From 05a8b9dcd048471ba00f931013ffbbf6b3756d1d Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 13:06:51 -0400 Subject: [PATCH 001/124] Swift interfaces for the WebIDL spec --- Package.swift | 2 + Sources/WebIDL/Argument.swift | 10 +++++ Sources/WebIDL/Attribute.swift | 8 ++++ Sources/WebIDL/Callback.swift | 8 ++++ Sources/WebIDL/Constant.swift | 7 ++++ Sources/WebIDL/Constructor.swift | 5 +++ Sources/WebIDL/Declaration.swift | 29 +++++++++++++ Sources/WebIDL/Dictionary.swift | 18 ++++++++ Sources/WebIDL/Enum.swift | 11 +++++ Sources/WebIDL/ExtendedAttribute.swift | 58 ++++++++++++++++++++++++++ Sources/WebIDL/GenericCollection.swift | 37 ++++++++++++++++ Sources/WebIDL/Includes.swift | 6 +++ Sources/WebIDL/Interface.swift | 27 ++++++++++++ Sources/WebIDL/InterfaceMixin.swift | 12 ++++++ Sources/WebIDL/Namespace.swift | 13 ++++++ Sources/WebIDL/Node.swift | 53 +++++++++++++++++++++++ Sources/WebIDL/Operation.swift | 8 ++++ Sources/WebIDL/Type.swift | 49 ++++++++++++++++++++++ Sources/WebIDL/Typedef.swift | 6 +++ Sources/WebIDL/Value.swift | 11 +++++ 20 files changed, 378 insertions(+) create mode 100644 Sources/WebIDL/Argument.swift create mode 100644 Sources/WebIDL/Attribute.swift create mode 100644 Sources/WebIDL/Callback.swift create mode 100644 Sources/WebIDL/Constant.swift create mode 100644 Sources/WebIDL/Constructor.swift create mode 100644 Sources/WebIDL/Declaration.swift create mode 100644 Sources/WebIDL/Dictionary.swift create mode 100644 Sources/WebIDL/Enum.swift create mode 100644 Sources/WebIDL/ExtendedAttribute.swift create mode 100644 Sources/WebIDL/GenericCollection.swift create mode 100644 Sources/WebIDL/Includes.swift create mode 100644 Sources/WebIDL/Interface.swift create mode 100644 Sources/WebIDL/InterfaceMixin.swift create mode 100644 Sources/WebIDL/Namespace.swift create mode 100644 Sources/WebIDL/Node.swift create mode 100644 Sources/WebIDL/Operation.swift create mode 100644 Sources/WebIDL/Type.swift create mode 100644 Sources/WebIDL/Typedef.swift create mode 100644 Sources/WebIDL/Value.swift diff --git a/Package.swift b/Package.swift index dd8874db..a515b84f 100644 --- a/Package.swift +++ b/Package.swift @@ -12,6 +12,7 @@ let package = Package( .library( name: "DOMKit", targets: ["DOMKit"]), + .library(name: "WebIDL", targets: ["WebIDL"]), ], dependencies: [ .package( @@ -27,6 +28,7 @@ let package = Package( .target( name: "DOMKit", dependencies: ["JavaScriptKit"]), + .target(name: "WebIDL"), .testTarget( name: "DOMKitTests", dependencies: ["DOMKit"]), diff --git a/Sources/WebIDL/Argument.swift b/Sources/WebIDL/Argument.swift new file mode 100644 index 00000000..22e477a7 --- /dev/null +++ b/Sources/WebIDL/Argument.swift @@ -0,0 +1,10 @@ +/// https://github.com/w3c/webidl2.js/#arguments +public struct IDLArgument: IDLNode { + public static let type = "argument" + public let `default`: IDLValue? + public let optional: Bool + public let variadic: Bool + public let idlType: IDLType + public let name: String + public let extAttrs: [IDLExtendedAttribute] +} diff --git a/Sources/WebIDL/Attribute.swift b/Sources/WebIDL/Attribute.swift new file mode 100644 index 00000000..eba5b42d --- /dev/null +++ b/Sources/WebIDL/Attribute.swift @@ -0,0 +1,8 @@ +public struct IDLAttribute: IDLNode { + public static let type = "attribute" + public let name: String + public let special: String + public let readonly: Bool + public let idlType: IDLType + public let extAttrs: [IDLExtendedAttribute] +} diff --git a/Sources/WebIDL/Callback.swift b/Sources/WebIDL/Callback.swift new file mode 100644 index 00000000..17329403 --- /dev/null +++ b/Sources/WebIDL/Callback.swift @@ -0,0 +1,8 @@ +/// https://github.com/w3c/webidl2.js#callback +public struct IDLCallback: IDLNode { + public static let type = "callback" + public let name: String + public let idlType: IDLType + public let arguments: [IDLArgument] + public let extAttrs: [IDLExtendedAttribute] +} diff --git a/Sources/WebIDL/Constant.swift b/Sources/WebIDL/Constant.swift new file mode 100644 index 00000000..654bcbfe --- /dev/null +++ b/Sources/WebIDL/Constant.swift @@ -0,0 +1,7 @@ +public struct IDLConstant: IDLNode { + public static let type = "const" + public let name: String + public let idlType: IDLType + public let value: IDLValue + public let extAttrs: [IDLExtendedAttribute] +} diff --git a/Sources/WebIDL/Constructor.swift b/Sources/WebIDL/Constructor.swift new file mode 100644 index 00000000..3dbb7386 --- /dev/null +++ b/Sources/WebIDL/Constructor.swift @@ -0,0 +1,5 @@ +public struct IDLConstructor: IDLNode { + public static let type = "constructor" + public let arguments: [IDLArgument] + public let extAttrs: [IDLExtendedAttribute] +} diff --git a/Sources/WebIDL/Declaration.swift b/Sources/WebIDL/Declaration.swift new file mode 100644 index 00000000..7b7ced1a --- /dev/null +++ b/Sources/WebIDL/Declaration.swift @@ -0,0 +1,29 @@ +/// https://github.com/w3c/webidl2.js#iterable-async-iterable-maplike-and-setlike-declarations +public protocol IDLDeclaration: IDLNode, IDLInterfaceMember { + var idlType: [IDLType] { get } + var arguments: [IDLArgument] { get } +} + +public struct IDLMapLikeDeclaration: IDLDeclaration { + public static let type = "maplike" + public let idlType: [IDLType] + public let readonly: Bool + public let arguments: [IDLArgument] + public let extAttrs: [IDLExtendedAttribute] +} + +public struct IDLSetLikeDeclaration: IDLDeclaration { + public static let type = "setlike" + public let idlType: [IDLType] + public let readonly: Bool + public let arguments: [IDLArgument] + public let extAttrs: [IDLExtendedAttribute] +} + +public struct IDLIterableDeclaration: IDLDeclaration { + public static let type = "iterable" + public let idlType: [IDLType] + public let async: Bool + public let arguments: [IDLArgument] + public let extAttrs: [IDLExtendedAttribute] +} diff --git a/Sources/WebIDL/Dictionary.swift b/Sources/WebIDL/Dictionary.swift new file mode 100644 index 00000000..037801f2 --- /dev/null +++ b/Sources/WebIDL/Dictionary.swift @@ -0,0 +1,18 @@ +/// https://github.com/w3c/webidl2.js/#dictionary +public struct IDLDictionary: IDLNode { + public static let type = "dictionary" + public let name: String + public let partial: Bool + public let members: [Member] + public let inheritance: String? + public let extAttrs: [IDLExtendedAttribute] + + public struct Member: IDLNode { + public static let type = "field" + public let name: String + public let required: Bool + public let idlType: IDLType + public let extAttrs: [IDLExtendedAttribute] + public let `default`: IDLValue? + } +} diff --git a/Sources/WebIDL/Enum.swift b/Sources/WebIDL/Enum.swift new file mode 100644 index 00000000..c422368f --- /dev/null +++ b/Sources/WebIDL/Enum.swift @@ -0,0 +1,11 @@ +public struct IDLEnum: IDLNode { + public static let type = "enum" + public let name: String + private let values: [Value] + public var cases: [String] { values.map(\.value) } + public let extAttrs: [IDLExtendedAttribute] + + private struct Value: Decodable { + let value: String + } +} diff --git a/Sources/WebIDL/ExtendedAttribute.swift b/Sources/WebIDL/ExtendedAttribute.swift new file mode 100644 index 00000000..7c009e25 --- /dev/null +++ b/Sources/WebIDL/ExtendedAttribute.swift @@ -0,0 +1,58 @@ +/// https://github.com/w3c/webidl2.js/#extended-attributes +public struct IDLExtendedAttribute: Decodable { + public let name: String + public let arguments: [IDLArgument] + public let rhs: RHS? + + public enum RHS: Decodable { + case identifier(String) + case identifierList([String]) + case string(String) + case stringList([String]) + case decimal(String) + case decimalList([String]) + case integer(String) + case integerList([String]) + case wildcard + + private enum CodingKeys: String, CodingKey { + case type + case value + } + + private struct ValueContainer: Decodable { + let value: String + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let type = try container.decode(String.self, forKey: .type) + switch type { + case "identifier": + self = .identifier(try container.decode(String.self, forKey: .value)) + case "identifier-list": + self = .identifierList(try container.decode([ValueContainer].self, forKey: .value).map(\.value)) + case "string": + self = .string(try container.decode(String.self, forKey: .value)) + case "string-list": + self = .stringList(try container.decode([ValueContainer].self, forKey: .value).map(\.value)) + case "decimal": + self = .decimal(try container.decode(String.self, forKey: .value)) + case "decimal-list": + self = .decimalList(try container.decode([ValueContainer].self, forKey: .value).map(\.value)) + case "integer": + self = .integer(try container.decode(String.self, forKey: .value)) + case "integer-list": + self = .integerList(try container.decode([ValueContainer].self, forKey: .value).map(\.value)) + case "wildcard": + self = .wildcard + default: + throw DecodingError.dataCorruptedError( + forKey: .type, + in: container, + debugDescription: "Unknown extended attribute type: \(type)" + ) + } + } + } +} diff --git a/Sources/WebIDL/GenericCollection.swift b/Sources/WebIDL/GenericCollection.swift new file mode 100644 index 00000000..b307d035 --- /dev/null +++ b/Sources/WebIDL/GenericCollection.swift @@ -0,0 +1,37 @@ +/// Necessary because it isn't possible to automatically decode an array +/// of different objects conforming to a protocol that is `Decodable`. +public struct GenericCollection: Collection, Decodable { + public let array: [Element] + public var startIndex: Array.Index { array.startIndex } + public var endIndex: Array.Index { array.endIndex } + public subscript(index: Array.Index) -> Element { array[index] } + public func index(after index: Array.Index) -> Array.Index { array.index(after: index) } + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + guard let count = container.count else { + throw DecodingError.dataCorrupted( + DecodingError.Context( + codingPath: decoder.codingPath, + debugDescription: "Unkeyed container has no length" + ) + ) + } + + var result: [Element] = [] + for i in 0 ..< count { + let member = try container.decodeIDLNode() + if let member = member as? Element { + result.append(member) + } else { + throw DecodingError.dataCorrupted( + DecodingError.Context( + codingPath: container.codingPath, + debugDescription: "Expected interface member at index \(i), found \(type(of: member).type)" + ) + ) + } + } + array = result + } +} diff --git a/Sources/WebIDL/Includes.swift b/Sources/WebIDL/Includes.swift new file mode 100644 index 00000000..39c49aef --- /dev/null +++ b/Sources/WebIDL/Includes.swift @@ -0,0 +1,6 @@ +public struct IDLIncludes: IDLNode { + public static let type = "includes" + public let target: String + public let includes: [String] + public let extAttrs: [IDLExtendedAttribute] +} diff --git a/Sources/WebIDL/Interface.swift b/Sources/WebIDL/Interface.swift new file mode 100644 index 00000000..3ef75c42 --- /dev/null +++ b/Sources/WebIDL/Interface.swift @@ -0,0 +1,27 @@ +/// https://github.com/w3c/webidl2.js#interface +public struct IDLInterface: IDLNode { + public static let type = "interface" + public let name: String + public let partial: Bool + public let members: GenericCollection + public let inheritance: String? + public let extAttrs: [IDLExtendedAttribute] +} + +/// https://github.com/w3c/webidl2.js#callback-interfaces +public struct IDLCallbackInterface: IDLNode { + public static let type = "callback interface" + public let name: String + public let partial: Bool + public let members: GenericCollection + public let inheritance: String? + public let extAttrs: [IDLExtendedAttribute] +} + +public protocol IDLInterfaceMember: IDLNode {} +extension IDLAttribute: IDLInterfaceMember {} +extension IDLConstant: IDLInterfaceMember {} +extension IDLConstructor: IDLInterfaceMember {} +// added on definition because of Swift limitation +// extension IDLDeclaration: IDLInterfaceMember {} +extension IDLOperation: IDLInterfaceMember {} diff --git a/Sources/WebIDL/InterfaceMixin.swift b/Sources/WebIDL/InterfaceMixin.swift new file mode 100644 index 00000000..4e1c7f7a --- /dev/null +++ b/Sources/WebIDL/InterfaceMixin.swift @@ -0,0 +1,12 @@ +public struct IDLInterfaceMixin: IDLNode { + public static let type = "interface mixin" + public let name: String + public let partial: Bool + public let members: GenericCollection + public let extAttrs: [IDLExtendedAttribute] +} + +public protocol IDLInterfaceMixinMember: IDLNode {} +extension IDLAttribute: IDLInterfaceMixinMember {} +extension IDLConstant: IDLInterfaceMixinMember {} +extension IDLOperation: IDLInterfaceMixinMember {} diff --git a/Sources/WebIDL/Namespace.swift b/Sources/WebIDL/Namespace.swift new file mode 100644 index 00000000..6632efed --- /dev/null +++ b/Sources/WebIDL/Namespace.swift @@ -0,0 +1,13 @@ +/// https://github.com/w3c/webidl2.js#namespace +public struct IDLNamespace: IDLNode { + public static let type = "namespace" + public let name: String + public let partial: Bool + public let members: GenericCollection + public let extAttrs: [IDLExtendedAttribute] +} + +public protocol IDLNamespaceMember: IDLNode {} +extension IDLAttribute: IDLNamespaceMember {} +extension IDLConstant: IDLNamespaceMember {} +extension IDLOperation: IDLNamespaceMember {} diff --git a/Sources/WebIDL/Node.swift b/Sources/WebIDL/Node.swift new file mode 100644 index 00000000..ff8100db --- /dev/null +++ b/Sources/WebIDL/Node.swift @@ -0,0 +1,53 @@ +public protocol IDLNode: Decodable { + static var type: String { get } + var extAttrs: [IDLExtendedAttribute] { get } +} + +var idlTypes: [String: IDLNode.Type] = [ + "argument": IDLArgument.self, + "attribute": IDLAttribute.self, + "callback": IDLCallback.self, + "const": IDLConstant.self, + "constructor": IDLConstructor.self, + "maplike": IDLMapLikeDeclaration.self, + "setlike": IDLSetLikeDeclaration.self, + "iterable": IDLIterableDeclaration.self, + "dictionary": IDLDictionary.self, + "enum": IDLEnum.self, + "includes": IDLIncludes.self, + "interface": IDLInterface.self, + "interface mixin": IDLInterfaceMixin.self, + "operation": IDLOperation.self, + "typedef": IDLTypedef.self, +] + +private enum TypeKey: String, CodingKey { + case type +} + +extension Decoder { + func decodeIDLNode() throws -> IDLNode { + try container(keyedBy: TypeKey.self).decodeIDLNode() + } +} + +extension UnkeyedDecodingContainer { + mutating func decodeIDLNode() throws -> IDLNode { + try nestedContainer(keyedBy: TypeKey.self).decodeIDLNode() + } +} + +private extension KeyedDecodingContainer where Key == TypeKey { + func decodeIDLNode() throws -> IDLNode { + let type = try decode(String.self, forKey: .type) + guard let idlType = idlTypes[type] else { + throw DecodingError.dataCorruptedError( + forKey: .type, + in: self, + debugDescription: "Unknown IDL type: \(type)" + ) + } + + return try idlType.init(from: superDecoder()) + } +} diff --git a/Sources/WebIDL/Operation.swift b/Sources/WebIDL/Operation.swift new file mode 100644 index 00000000..3d0cf13e --- /dev/null +++ b/Sources/WebIDL/Operation.swift @@ -0,0 +1,8 @@ +public struct IDLOperation: IDLNode { + public static let type = "operation" + public let special: String + public let idlType: IDLType + public let name: String + public let arguments: [IDLArgument] + public let extAttrs: [IDLExtendedAttribute] +} diff --git a/Sources/WebIDL/Type.swift b/Sources/WebIDL/Type.swift new file mode 100644 index 00000000..c15b1c7f --- /dev/null +++ b/Sources/WebIDL/Type.swift @@ -0,0 +1,49 @@ +public struct IDLType: Decodable { + public let type: String + public let value: TypeValue + public let nullable: Bool + public let extAttrs: [IDLExtendedAttribute] + + private enum CodingKeys: String, CodingKey { + case type + case generic + case idlType + case nullable + case extAttrs + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + type = try container.decode(String.self, forKey: .type) + nullable = try container.decode(Bool.self, forKey: .nullable) + extAttrs = try container.decode([IDLExtendedAttribute].self, forKey: .extAttrs) + value = try TypeValue(from: decoder) + } + + public enum TypeValue: Decodable { + case generic(String, args: [IDLType]) + case single(String) + case union([IDLType]) + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let generic = try container.decode(String.self, forKey: .generic) + if let args = try? container.decode([IDLType].self, forKey: .idlType) { + if generic.isEmpty { + self = .union(args) + } else { + self = .generic(generic, args: args) + } + } else if let name = try? container.decode(String.self, forKey: .idlType) { + self = .single(name) + } else { + throw DecodingError.dataCorrupted( + DecodingError.Context( + codingPath: container.codingPath, + debugDescription: "Expected generic, single, or union type" + ) + ) + } + } + } +} diff --git a/Sources/WebIDL/Typedef.swift b/Sources/WebIDL/Typedef.swift new file mode 100644 index 00000000..fcabc823 --- /dev/null +++ b/Sources/WebIDL/Typedef.swift @@ -0,0 +1,6 @@ +public struct IDLTypedef: IDLNode { + public static let type = "typedef" + public let name: String + public let idlType: IDLType + public let extAttrs: [IDLExtendedAttribute] +} diff --git a/Sources/WebIDL/Value.swift b/Sources/WebIDL/Value.swift new file mode 100644 index 00000000..2cb34c64 --- /dev/null +++ b/Sources/WebIDL/Value.swift @@ -0,0 +1,11 @@ +/// Default and Const Values +public enum IDLValue: Decodable { + case string(String) + case number(String) + case boolean(Bool) + case null + case infinity + case nan + case sequence + case dictionary(IDLDictionary) +} From 8fcd45865c2a0607228f7c4deb46175ee501a4b9 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 13:40:27 -0400 Subject: [PATCH 002/124] it parses! --- Package.swift | 6 ++++ Sources/WebIDL/GenericCollection.swift | 27 ++---------------- Sources/WebIDL/Node.swift | 31 ++++++++------------- Sources/WebIDL/Value.swift | 38 +++++++++++++++++++++++++- Sources/WebIDLToSwift/main.swift | 32 ++++++++++++++++++++++ 5 files changed, 88 insertions(+), 46 deletions(-) create mode 100644 Sources/WebIDLToSwift/main.swift diff --git a/Package.swift b/Package.swift index a515b84f..86658f2e 100644 --- a/Package.swift +++ b/Package.swift @@ -13,6 +13,7 @@ let package = Package( name: "DOMKit", targets: ["DOMKit"]), .library(name: "WebIDL", targets: ["WebIDL"]), + .executable(name: "WebIDLToSwift", targets: ["WebIDLToSwift"]), ], dependencies: [ .package( @@ -29,6 +30,11 @@ let package = Package( name: "DOMKit", dependencies: ["JavaScriptKit"]), .target(name: "WebIDL"), + .target( + name: "WebIDLToSwift", + dependencies: ["WebIDL"], + resources: [.copy("data.json")] + ), .testTarget( name: "DOMKitTests", dependencies: ["DOMKit"]), diff --git a/Sources/WebIDL/GenericCollection.swift b/Sources/WebIDL/GenericCollection.swift index b307d035..c05abd1a 100644 --- a/Sources/WebIDL/GenericCollection.swift +++ b/Sources/WebIDL/GenericCollection.swift @@ -8,30 +8,7 @@ public struct GenericCollection: Collection, Decodable { public func index(after index: Array.Index) -> Array.Index { array.index(after: index) } public init(from decoder: Decoder) throws { - var container = try decoder.unkeyedContainer() - guard let count = container.count else { - throw DecodingError.dataCorrupted( - DecodingError.Context( - codingPath: decoder.codingPath, - debugDescription: "Unkeyed container has no length" - ) - ) - } - - var result: [Element] = [] - for i in 0 ..< count { - let member = try container.decodeIDLNode() - if let member = member as? Element { - result.append(member) - } else { - throw DecodingError.dataCorrupted( - DecodingError.Context( - codingPath: container.codingPath, - debugDescription: "Expected interface member at index \(i), found \(type(of: member).type)" - ) - ) - } - } - array = result + let wrappers = try decoder.singleValueContainer().decode([IDLNodeDecoder].self) + array = wrappers.map(\.node) as! [Element] } } diff --git a/Sources/WebIDL/Node.swift b/Sources/WebIDL/Node.swift index ff8100db..ceeecdf4 100644 --- a/Sources/WebIDL/Node.swift +++ b/Sources/WebIDL/Node.swift @@ -25,29 +25,20 @@ private enum TypeKey: String, CodingKey { case type } -extension Decoder { - func decodeIDLNode() throws -> IDLNode { - try container(keyedBy: TypeKey.self).decodeIDLNode() - } -} - -extension UnkeyedDecodingContainer { - mutating func decodeIDLNode() throws -> IDLNode { - try nestedContainer(keyedBy: TypeKey.self).decodeIDLNode() - } -} - -private extension KeyedDecodingContainer where Key == TypeKey { - func decodeIDLNode() throws -> IDLNode { - let type = try decode(String.self, forKey: .type) +struct IDLNodeDecoder: Decodable { + let node: IDLNode + init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: TypeKey.self) + let type = try container.decode(String.self, forKey: .type) guard let idlType = idlTypes[type] else { - throw DecodingError.dataCorruptedError( - forKey: .type, - in: self, - debugDescription: "Unknown IDL type: \(type)" + throw DecodingError.dataCorrupted( + DecodingError.Context( + codingPath: container.codingPath, + debugDescription: "Unknown type: \(type)" + ) ) } - return try idlType.init(from: superDecoder()) + node = try idlType.init(from: decoder) } } diff --git a/Sources/WebIDL/Value.swift b/Sources/WebIDL/Value.swift index 2cb34c64..aa8f7952 100644 --- a/Sources/WebIDL/Value.swift +++ b/Sources/WebIDL/Value.swift @@ -4,8 +4,44 @@ public enum IDLValue: Decodable { case number(String) case boolean(Bool) case null - case infinity + case infinity(negative: Bool) case nan case sequence case dictionary(IDLDictionary) + + private enum CodingKeys: String, CodingKey { + case type + case value + case negative + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let type = try container.decode(String.self, forKey: .type) + switch type { + case "string": + self = .string(try container.decode(String.self, forKey: .value)) + case "number": + self = .number(try container.decode(String.self, forKey: .value)) + case "boolean": + self = .boolean(try container.decode(Bool.self, forKey: .value)) + case "null": + self = .null + case "infinity": + self = .infinity(negative: try container.decode(Bool.self, forKey: .negative)) + case "nan": + self = .nan + case "sequence": + self = .sequence + case "dictionary": + self = .dictionary(try container.decode(IDLDictionary.self, forKey: .value)) + default: + throw DecodingError.dataCorrupted( + DecodingError.Context( + codingPath: container.codingPath, + debugDescription: "Unknown value type: \(type)" + ) + ) + } + } } diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift new file mode 100644 index 00000000..a9b85ecb --- /dev/null +++ b/Sources/WebIDLToSwift/main.swift @@ -0,0 +1,32 @@ +import Foundation +import WebIDL + +do { + let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) + let idl = try JSONDecoder().decode(GenericCollection.self, from: data) + print(idl.array[0]) +} catch { + switch error as? DecodingError { + case .dataCorrupted(let ctx), .typeMismatch(_, let ctx): + debugContext(ctx) + case .valueNotFound(let type, let ctx): + print("Value of type \(type) not found") + debugContext(ctx) + case .keyNotFound(let key, let ctx): + print("Key \(key.stringValue) not found") + debugContext(ctx) + case nil, .some: + print(error.localizedDescription) + case .some: + print(error.localizedDescription) + } +} + +private func debugContext(_ ctx: DecodingError.Context) { + print("Key path: \(ctx.codingPath.map { "." + $0.stringValue }.joined())") + print(ctx.debugDescription) + if let underlying = ctx.underlyingError as NSError?, + let debugDescription = underlying.userInfo["NSDebugDescription"] { + print(debugDescription) + } +} From 1a8b6e09909b7bbaf6394da02de0f5e311ef1fe4 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 14:00:49 -0400 Subject: [PATCH 003/124] more fixes turns out copilot is not all-knowing --- Sources/WebIDL/ExtendedAttribute.swift | 2 +- Sources/WebIDL/Includes.swift | 2 +- Sources/WebIDL/Node.swift | 2 ++ Sources/WebIDL/Operation.swift | 4 ++-- Sources/WebIDL/Type.swift | 15 +++++++-------- Sources/WebIDL/Value.swift | 4 ++-- Sources/WebIDLToSwift/main.swift | 6 ++---- 7 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Sources/WebIDL/ExtendedAttribute.swift b/Sources/WebIDL/ExtendedAttribute.swift index 7c009e25..a08e3d5a 100644 --- a/Sources/WebIDL/ExtendedAttribute.swift +++ b/Sources/WebIDL/ExtendedAttribute.swift @@ -44,7 +44,7 @@ public struct IDLExtendedAttribute: Decodable { self = .integer(try container.decode(String.self, forKey: .value)) case "integer-list": self = .integerList(try container.decode([ValueContainer].self, forKey: .value).map(\.value)) - case "wildcard": + case "*": self = .wildcard default: throw DecodingError.dataCorruptedError( diff --git a/Sources/WebIDL/Includes.swift b/Sources/WebIDL/Includes.swift index 39c49aef..7f036ebe 100644 --- a/Sources/WebIDL/Includes.swift +++ b/Sources/WebIDL/Includes.swift @@ -1,6 +1,6 @@ public struct IDLIncludes: IDLNode { public static let type = "includes" public let target: String - public let includes: [String] + public let includes: String public let extAttrs: [IDLExtendedAttribute] } diff --git a/Sources/WebIDL/Node.swift b/Sources/WebIDL/Node.swift index ceeecdf4..75cda9fa 100644 --- a/Sources/WebIDL/Node.swift +++ b/Sources/WebIDL/Node.swift @@ -7,6 +7,7 @@ var idlTypes: [String: IDLNode.Type] = [ "argument": IDLArgument.self, "attribute": IDLAttribute.self, "callback": IDLCallback.self, + "callback interface": IDLCallbackInterface.self, "const": IDLConstant.self, "constructor": IDLConstructor.self, "maplike": IDLMapLikeDeclaration.self, @@ -17,6 +18,7 @@ var idlTypes: [String: IDLNode.Type] = [ "includes": IDLIncludes.self, "interface": IDLInterface.self, "interface mixin": IDLInterfaceMixin.self, + "namespace": IDLNamespace.self, "operation": IDLOperation.self, "typedef": IDLTypedef.self, ] diff --git a/Sources/WebIDL/Operation.swift b/Sources/WebIDL/Operation.swift index 3d0cf13e..772ec43f 100644 --- a/Sources/WebIDL/Operation.swift +++ b/Sources/WebIDL/Operation.swift @@ -1,8 +1,8 @@ public struct IDLOperation: IDLNode { public static let type = "operation" public let special: String - public let idlType: IDLType - public let name: String + public let idlType: IDLType? + public let name: String? public let arguments: [IDLArgument] public let extAttrs: [IDLExtendedAttribute] } diff --git a/Sources/WebIDL/Type.swift b/Sources/WebIDL/Type.swift index c15b1c7f..debe662a 100644 --- a/Sources/WebIDL/Type.swift +++ b/Sources/WebIDL/Type.swift @@ -1,5 +1,5 @@ public struct IDLType: Decodable { - public let type: String + public let type: String? public let value: TypeValue public let nullable: Bool public let extAttrs: [IDLExtendedAttribute] @@ -9,12 +9,13 @@ public struct IDLType: Decodable { case generic case idlType case nullable + case union case extAttrs } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - type = try container.decode(String.self, forKey: .type) + type = try container.decodeIfPresent(String?.self, forKey: .type) ?? nil nullable = try container.decode(Bool.self, forKey: .nullable) extAttrs = try container.decode([IDLExtendedAttribute].self, forKey: .extAttrs) value = try TypeValue(from: decoder) @@ -28,12 +29,10 @@ public struct IDLType: Decodable { public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let generic = try container.decode(String.self, forKey: .generic) - if let args = try? container.decode([IDLType].self, forKey: .idlType) { - if generic.isEmpty { - self = .union(args) - } else { - self = .generic(generic, args: args) - } + if try container.decode(Bool.self, forKey: .union) { + self = .union(try container.decode([IDLType].self, forKey: .idlType)) + } else if !generic.isEmpty { + self = .generic(generic, args: try container.decode([IDLType].self, forKey: .idlType)) } else if let name = try? container.decode(String.self, forKey: .idlType) { self = .single(name) } else { diff --git a/Sources/WebIDL/Value.swift b/Sources/WebIDL/Value.swift index aa8f7952..8119fc2f 100644 --- a/Sources/WebIDL/Value.swift +++ b/Sources/WebIDL/Value.swift @@ -7,7 +7,7 @@ public enum IDLValue: Decodable { case infinity(negative: Bool) case nan case sequence - case dictionary(IDLDictionary) + case dictionary private enum CodingKeys: String, CodingKey { case type @@ -34,7 +34,7 @@ public enum IDLValue: Decodable { case "sequence": self = .sequence case "dictionary": - self = .dictionary(try container.decode(IDLDictionary.self, forKey: .value)) + self = .dictionary default: throw DecodingError.dataCorrupted( DecodingError.Context( diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index a9b85ecb..d8095fdd 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -3,8 +3,8 @@ import WebIDL do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) - let idl = try JSONDecoder().decode(GenericCollection.self, from: data) - print(idl.array[0]) + let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) + print(idl) } catch { switch error as? DecodingError { case .dataCorrupted(let ctx), .typeMismatch(_, let ctx): @@ -17,8 +17,6 @@ do { debugContext(ctx) case nil, .some: print(error.localizedDescription) - case .some: - print(error.localizedDescription) } } From e169987221a614c5b850773b208af658847c936a Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 14:47:51 -0400 Subject: [PATCH 004/124] Start outputting Swift code --- Sources/WebIDL/GenericCollection.swift | 6 +- .../WebIDLToSwift/SwiftRepresentation.swift | 32 +++++++++ Sources/WebIDLToSwift/SwiftSource.swift | 47 +++++++++++++ .../WebIDL+SwiftRepresentation.swift | 70 +++++++++++++++++++ Sources/WebIDLToSwift/main.swift | 4 +- 5 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 Sources/WebIDLToSwift/SwiftRepresentation.swift create mode 100644 Sources/WebIDLToSwift/SwiftSource.swift create mode 100644 Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift diff --git a/Sources/WebIDL/GenericCollection.swift b/Sources/WebIDL/GenericCollection.swift index c05abd1a..867d1044 100644 --- a/Sources/WebIDL/GenericCollection.swift +++ b/Sources/WebIDL/GenericCollection.swift @@ -1,14 +1,14 @@ /// Necessary because it isn't possible to automatically decode an array /// of different objects conforming to a protocol that is `Decodable`. public struct GenericCollection: Collection, Decodable { - public let array: [Element] + public let array: [IDLNode] public var startIndex: Array.Index { array.startIndex } public var endIndex: Array.Index { array.endIndex } - public subscript(index: Array.Index) -> Element { array[index] } + public subscript(index: Array.Index) -> Element { array[index] as! Element } public func index(after index: Array.Index) -> Array.Index { array.index(after: index) } public init(from decoder: Decoder) throws { let wrappers = try decoder.singleValueContainer().decode([IDLNodeDecoder].self) - array = wrappers.map(\.node) as! [Element] + array = wrappers.map(\.node) } } diff --git a/Sources/WebIDLToSwift/SwiftRepresentation.swift b/Sources/WebIDLToSwift/SwiftRepresentation.swift new file mode 100644 index 00000000..9dba9e81 --- /dev/null +++ b/Sources/WebIDLToSwift/SwiftRepresentation.swift @@ -0,0 +1,32 @@ +import WebIDL + +protocol SwiftRepresentable { + var swiftRepresentation: SwiftSource { get } +} + +func toSwift(_ value: T) -> SwiftSource { + if let repr = (value as? SwiftRepresentable)?.swiftRepresentation { + return repr + } else { + let x = value as Any + fatalError("Type \(String(describing: type(of: x))) has no Swift representation") + } +} + +let swiftKeywords: [String: String] = [ + "init": "`init`", + "where": "`where`", + "protocol": "`protocol`", + "struct": "`struct`", + "class": "`class`", + "enum": "`enum`", + "func": "`func`", + "static": "`static`", + "is": "`is`", +] + +extension String: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + SwiftSource(swiftKeywords[self] ?? self) + } +} diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift new file mode 100644 index 00000000..a6acab84 --- /dev/null +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -0,0 +1,47 @@ +struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation { + let source: String + + init(_ value: String) { + source = value + } + + init(stringLiteral value: String) { + source = value + } + + init(stringInterpolation: StringInterpolation) { + source = stringInterpolation.output + } + + var description: String { + source + } + + struct StringInterpolation: StringInterpolationProtocol { + fileprivate var output = "" + + init(literalCapacity: Int, interpolationCount _: Int) { + output.reserveCapacity(literalCapacity * 2) + } + + mutating func appendLiteral(_ literal: String) { + output += literal + } + + mutating func appendInterpolation(_ value: T) { + output += toSwift(value).source + } + } +} + +extension Array where Element == SwiftSource { + func joined(separator: String) -> SwiftSource { + SwiftSource(map(\.source).joined(separator: separator)) + } +} + +extension SwiftSource: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + self + } +} diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift new file mode 100644 index 00000000..29454dcd --- /dev/null +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -0,0 +1,70 @@ +import WebIDL + +extension IDLArgument: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + "\(name): \(idlType)" + } +} + +extension IDLNamespace: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + let body = members.map { "static \(toSwift($0))" }.joined(separator: "\n") + if partial { + return """ + extension \(name) { + \(body) + } + """ + } else { + return """ + public enum \(name) { + public static var jsObject: JSObject { + JSObject.global.\(name).object! + } + + \(body) + } + """ + } + } +} + +extension IDLOperation: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + """ + func \(name!)(\(arguments.map(\.swiftRepresentation).joined(separator: ", "))) -> \(idlType) { + // TODO + } + """ + } +} + +let typeNameMap = [ + "boolean": "Bool", + "any": "Any", + "DOMString": "String", + "object": "JSObject", + "undefined": "Void", +] + +extension IDLType: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + switch value { + case let .generic(name, args): + switch name { + case "sequence": + return "[\(args[0])]" + default: + fatalError("Unsupported generic type: \(name)") + } + case let .single(name): + if let typeName = typeNameMap[name] { + return "\(typeName)" + } else { + fatalError("Unsupported type \(name)") + } + case let .union(types): + return "union(\(types.map(\.swiftRepresentation).joined(separator: ", ")))" + } + } +} diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index d8095fdd..e4c0ec35 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -4,7 +4,9 @@ import WebIDL do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) - print(idl) + for node in idl["console"]!.array { + print(toSwift(node).source) + } } catch { switch error as? DecodingError { case .dataCorrupted(let ctx), .typeMismatch(_, let ctx): From 7840dbc044bfd0d99bf6c82c80cd1f5eb347f6fb Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 15:02:11 -0400 Subject: [PATCH 005/124] Allow dynamic state --- Sources/WebIDLToSwift/Context.swift | 28 +++++++++++++++++++ Sources/WebIDLToSwift/SwiftSource.swift | 10 +++++++ .../WebIDL+SwiftRepresentation.swift | 13 +++++---- 3 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 Sources/WebIDLToSwift/Context.swift diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift new file mode 100644 index 00000000..0c9ed15f --- /dev/null +++ b/Sources/WebIDLToSwift/Context.swift @@ -0,0 +1,28 @@ +@dynamicMemberLookup +enum Context { + private(set) static var current = State(static: false, this: "this") + + private static var stack: [State] = [] + static func withState(_ new: State, body: () throws -> T) rethrows -> T { + stack.append(current) + current = new + defer { current = stack.removeLast() } + return try body() + } + + static subscript(dynamicMember member: KeyPath) -> T { + current[keyPath: member] + } + + struct State { + private(set) var `static`: Bool + private(set) var this: SwiftSource + + static func `static`(this: SwiftSource) -> Self { + var newState = Context.current + newState.static = true + newState.this = this + return newState + } + } +} diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift index a6acab84..1f651e96 100644 --- a/Sources/WebIDLToSwift/SwiftSource.swift +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -28,9 +28,19 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation { output += literal } + mutating func appendInterpolation(raw value: String) { + output += value + } + mutating func appendInterpolation(_ value: T) { output += toSwift(value).source } + + mutating func appendInterpolation(state: Context.State, _ value: T) { + Context.withState(state) { + output += toSwift(value).source + } + } } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 29454dcd..fc7457b2 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -8,7 +8,10 @@ extension IDLArgument: SwiftRepresentable { extension IDLNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let body = members.map { "static \(toSwift($0))" }.joined(separator: "\n") + let this: SwiftSource = "JSObject.global.\(name).object!" + let body = Context.withState(.static(this: this)) { + members.map(toSwift).joined(separator: "\n") + } if partial { return """ extension \(name) { @@ -19,7 +22,7 @@ extension IDLNamespace: SwiftRepresentable { return """ public enum \(name) { public static var jsObject: JSObject { - JSObject.global.\(name).object! + \(this) } \(body) @@ -32,8 +35,8 @@ extension IDLNamespace: SwiftRepresentable { extension IDLOperation: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - func \(name!)(\(arguments.map(\.swiftRepresentation).joined(separator: ", "))) -> \(idlType) { - // TODO + \(raw: Context.static ? "static" : "") func \(name!)(\(arguments.map(\.swiftRepresentation).joined(separator: ", "))) -> \(idlType!) { + \(Context.this).\(name!)(\(arguments.map(\.name.swiftRepresentation).joined(separator: ", "))) } """ } @@ -64,7 +67,7 @@ extension IDLType: SwiftRepresentable { fatalError("Unsupported type \(name)") } case let .union(types): - return "union(\(types.map(\.swiftRepresentation).joined(separator: ", ")))" + fatalError("Union types are unsupported") } } } From 2ab1dc67c02e3d1d195dceaf9b67767859360335 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 15:46:58 -0400 Subject: [PATCH 006/124] more work --- Sources/DOMKit/ECMAScript/Struct.swift | 1 + Sources/WebIDLToSwift/Context.swift | 17 +- .../WebIDL+SwiftRepresentation.swift | 154 +++++++++++++++++- Sources/WebIDLToSwift/main.swift | 8 +- 4 files changed, 172 insertions(+), 8 deletions(-) create mode 100644 Sources/DOMKit/ECMAScript/Struct.swift diff --git a/Sources/DOMKit/ECMAScript/Struct.swift b/Sources/DOMKit/ECMAScript/Struct.swift new file mode 100644 index 00000000..4aff82f9 --- /dev/null +++ b/Sources/DOMKit/ECMAScript/Struct.swift @@ -0,0 +1 @@ +import JavaScriptKit diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index 0c9ed15f..0f82c478 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -1,6 +1,6 @@ @dynamicMemberLookup enum Context { - private(set) static var current = State(static: false, this: "this") + private(set) static var current = State(static: false) private static var stack: [State] = [] static func withState(_ new: State, body: () throws -> T) rethrows -> T { @@ -10,13 +10,18 @@ enum Context { return try body() } + static subscript(dynamicMember member: KeyPath) -> T { + current[keyPath: member]! + } + static subscript(dynamicMember member: KeyPath) -> T { current[keyPath: member] } struct State { private(set) var `static`: Bool - private(set) var this: SwiftSource + private(set) var constructor: SwiftSource! + private(set) var this: SwiftSource! static func `static`(this: SwiftSource) -> Self { var newState = Context.current @@ -24,5 +29,13 @@ enum Context { newState.this = this return newState } + + static func instance(constructor: SwiftSource, this: SwiftSource) -> Self { + var newState = Context.current + newState.static = false + newState.constructor = constructor + newState.this = this + return newState + } } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index fc7457b2..ee34650e 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -6,6 +6,123 @@ extension IDLArgument: SwiftRepresentable { } } +extension IDLAttribute: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + """ + \(raw: Context.static ? "static" : "") var \(name): \(idlType) { + // TODO + } + """ + } +} + +extension IDLDictionary: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + """ + public class \(name): JSObject { + \(swiftInit) + \(swiftMembers.joined(separator: "\n")) + } + """ + } + + private var swiftInit: SwiftSource { + """ + convenience init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { + let object = JSObject.global.new() + \(members.map { SwiftSource("object[\"\(raw: $0.name)\"] = \($0.name).jsValue()") }.joined(separator: "\n")) + self = object + } + """ + } + + private var swiftMembers: [SwiftSource] { + members.map { + """ + var \($0.name): \($0.idlType) { + get { + self["\(raw: $0.name)"].fromJSValue() + } + set { + self["\(raw: $0.name)"] = newValue.jsValue() + } + } + """ + } + } +} + +extension IDLEnum: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + """ + enum \(name) { + \(raw: cases.map { "case \(SwiftSource($0).source)" }.joined(separator: "\n")) + } + """ + } +} + +extension IDLInterface: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + let constructor: SwiftSource = "JSObject.global.\(name).function!" + let body = Context.withState(.instance(constructor: constructor, this: "jsObject")) { + members.map(toSwift).joined(separator: "\n") + } + if partial { + assert(inheritance == nil) + return """ + extension \(name) { + \(body) + } + """ + } else { + let requiredInit = """ + required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + """ + + return """ + class \(name): \(inheritance ?? "JSBridgedClass") { + static var constructor: JSFunction { + \(constructor) + } + + let jsObject: JSObject + \(inheritance == nil ? requiredInit : "") + + \(body) + } + """ + } + } +} + +extension IDLInterfaceMixin: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + let this: SwiftSource = "JSObject.global.\(name).object!" + let body = Context.withState(.static(this: this)) { + members.map(toSwift).joined(separator: "\n") + } + return """ + extension \(name) { + \(body) + } + """ + } +} + +extension IDLConstructor: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + assert(!Context.static) + return """ + convenience init(\(arguments.map(\.swiftRepresentation).joined(separator: ", "))) { + self.init(unsafelyWrapping: \(Context.constructor).new(\(arguments.map(\.name.swiftRepresentation).joined(separator: ", ")))) + } + """ + } +} + extension IDLNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { let this: SwiftSource = "JSObject.global.\(name).object!" @@ -34,11 +151,26 @@ extension IDLNamespace: SwiftRepresentable { extension IDLOperation: SwiftRepresentable { var swiftRepresentation: SwiftSource { - """ - \(raw: Context.static ? "static" : "") func \(name!)(\(arguments.map(\.swiftRepresentation).joined(separator: ", "))) -> \(idlType!) { - \(Context.this).\(name!)(\(arguments.map(\.name.swiftRepresentation).joined(separator: ", "))) + if special.isEmpty { + let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") + let args = arguments.map(\.name.swiftRepresentation).joined(separator: ", ") + return """ + \(raw: Context.static ? "static" : "") func \(name!)(\(params)) -> \(idlType!) { + \(Context.this).\(name!)(\(args)).fromJSValue() + } + """ + } else { + switch special { + case "stringifier": + return """ + var description: String { + \(Context.this).toString().fromJSValue() + } + """ + default: + fatalError("Unsupported special operation \(special)") + } } - """ } } @@ -48,6 +180,8 @@ let typeNameMap = [ "DOMString": "String", "object": "JSObject", "undefined": "Void", + "double": "Double", + "unrestricted double": "Double", ] extension IDLType: SwiftRepresentable { @@ -57,6 +191,9 @@ extension IDLType: SwiftRepresentable { switch name { case "sequence": return "[\(args[0])]" + case "Promise": + // TODO: async + return "JSPromise" default: fatalError("Unsupported generic type: \(name)") } @@ -64,10 +201,17 @@ extension IDLType: SwiftRepresentable { if let typeName = typeNameMap[name] { return "\(typeName)" } else { - fatalError("Unsupported type \(name)") + print("Unsupported type: \(name)") + return "\(name)" } case let .union(types): fatalError("Union types are unsupported") } } } + +extension IDLTypedef: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + "typealias \(name) = \(idlType)" + } +} diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index e4c0ec35..eb54ef64 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -4,9 +4,15 @@ import WebIDL do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) - for node in idl["console"]!.array { + for (i, node) in idl["web-animations"]!.enumerated() { print(toSwift(node).source) } +// for (name, nodes) in idl { +// if name.starts(with: "WEBGL_") { continue } +// for (i, node) in nodes.enumerated() { +// print(toSwift(node).source) +// } +// } } catch { switch error as? DecodingError { case .dataCorrupted(let ctx), .typeMismatch(_, let ctx): From 7beaf87d39e18f109e33bf1d8b4adac576d31106 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 16:15:08 -0400 Subject: [PATCH 007/124] whee it gets through the dom spec! --- .../WebIDLToSwift/SwiftRepresentation.swift | 4 +- Sources/WebIDLToSwift/SwiftSource.swift | 4 + .../WebIDL+SwiftRepresentation.swift | 130 ++++++++++++++---- Sources/WebIDLToSwift/main.swift | 3 +- 4 files changed, 115 insertions(+), 26 deletions(-) diff --git a/Sources/WebIDLToSwift/SwiftRepresentation.swift b/Sources/WebIDLToSwift/SwiftRepresentation.swift index 9dba9e81..f542a4b7 100644 --- a/Sources/WebIDLToSwift/SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/SwiftRepresentation.swift @@ -5,8 +5,8 @@ protocol SwiftRepresentable { } func toSwift(_ value: T) -> SwiftSource { - if let repr = (value as? SwiftRepresentable)?.swiftRepresentation { - return repr + if let repr = value as? SwiftRepresentable { + return repr.swiftRepresentation } else { let x = value as Any fatalError("Type \(String(describing: type(of: x))) has no Swift representation") diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift index 1f651e96..52c27650 100644 --- a/Sources/WebIDLToSwift/SwiftSource.swift +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -17,6 +17,10 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation { source } + static func raw(_ value: String) -> SwiftSource { + SwiftSource(value) + } + struct StringInterpolation: StringInterpolationProtocol { fileprivate var output = "" diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index ee34650e..642729dd 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -9,9 +9,7 @@ extension IDLArgument: SwiftRepresentable { extension IDLAttribute: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - \(raw: Context.static ? "static" : "") var \(name): \(idlType) { - // TODO - } + \(raw: Context.static ? "static" : "") var \(name): \(idlType) { /* todo: attribute accessors */ } """ } } @@ -29,7 +27,7 @@ extension IDLDictionary: SwiftRepresentable { private var swiftInit: SwiftSource { """ convenience init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { - let object = JSObject.global.new() + let object = JSObject.global.Object.function!.new() \(members.map { SwiftSource("object[\"\(raw: $0.name)\"] = \($0.name).jsValue()") }.joined(separator: "\n")) self = object } @@ -62,6 +60,20 @@ extension IDLEnum: SwiftRepresentable { } } +extension IDLCallback: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + """ + typealias \(name) = (\(arguments.map(\.idlType.swiftRepresentation).joined(separator: ", "))) -> \(idlType) + """ + } +} + +extension IDLCallbackInterface: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + "/* [unsupported callback interface: \(name)] */" + } +} + extension IDLInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { let constructor: SwiftSource = "JSObject.global.\(name).function!" @@ -100,14 +112,23 @@ extension IDLInterface: SwiftRepresentable { extension IDLInterfaceMixin: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let this: SwiftSource = "JSObject.global.\(name).object!" - let body = Context.withState(.static(this: this)) { - members.map(toSwift).joined(separator: "\n") - } - return """ - extension \(name) { - \(body) - } + // let this: SwiftSource = "JSObject.global.\(name).object!" + // let body = Context.withState(.static(this: this)) { + // members.map(toSwift).joined(separator: "\n") + // } + // return """ + // extension \(name) { + // \(body) + // } + // """ + "/* [unsupported interface mixin: \(name)] */" + } +} + +extension IDLConstant: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + """ + public static let \(name): \(idlType) = \(value) """ } } @@ -115,14 +136,33 @@ extension IDLInterfaceMixin: SwiftRepresentable { extension IDLConstructor: SwiftRepresentable { var swiftRepresentation: SwiftSource { assert(!Context.static) + let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") + let args = arguments.map(\.name.swiftRepresentation).joined(separator: ", ") return """ - convenience init(\(arguments.map(\.swiftRepresentation).joined(separator: ", "))) { - self.init(unsafelyWrapping: \(Context.constructor).new(\(arguments.map(\.name.swiftRepresentation).joined(separator: ", ")))) + convenience init(\(params)) { + self.init(unsafelyWrapping: \(Context.constructor).new(\(args))) } """ } } +extension IDLIncludes: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + "" + // """ + // // TODO: IDLIncludes (\(includes) from \(target)) + // """ + } +} + +extension IDLIterableDeclaration: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + """ + /* [make me iterable plz] */ + """ + } +} + extension IDLNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { let this: SwiftSource = "JSObject.global.\(name).object!" @@ -152,13 +192,7 @@ extension IDLNamespace: SwiftRepresentable { extension IDLOperation: SwiftRepresentable { var swiftRepresentation: SwiftSource { if special.isEmpty { - let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") - let args = arguments.map(\.name.swiftRepresentation).joined(separator: ", ") - return """ - \(raw: Context.static ? "static" : "") func \(name!)(\(params)) -> \(idlType!) { - \(Context.this).\(name!)(\(args)).fromJSValue() - } - """ + return defaultRepresentation } else { switch special { case "stringifier": @@ -167,11 +201,31 @@ extension IDLOperation: SwiftRepresentable { \(Context.this).toString().fromJSValue() } """ + case "static": + return Context.withState(.static(this: Context.constructor)) { + defaultRepresentation + } + case "getter": + return """ + var \(name!): \(idlType!) { + \(Context.this)["\(raw: name!)"].fromJSValue() + } + """ default: fatalError("Unsupported special operation \(special)") } } } + + private var defaultRepresentation: SwiftSource { + let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") + let args = arguments.map(\.name.swiftRepresentation).joined(separator: ", ") + return """ + \(raw: Context.static ? "static" : "") func \(name!)(\(params)) -> \(idlType!) { + \(Context.this).\(name!)(\(args)).fromJSValue() + } + """ + } } let typeNameMap = [ @@ -182,6 +236,10 @@ let typeNameMap = [ "undefined": "Void", "double": "Double", "unrestricted double": "Double", + "unsigned short": "Double", + "unsigned long": "Double", + "unsigned long long": "Double", + "short": "Double", ] extension IDLType: SwiftRepresentable { @@ -201,11 +259,14 @@ extension IDLType: SwiftRepresentable { if let typeName = typeNameMap[name] { return "\(typeName)" } else { - print("Unsupported type: \(name)") + if name == name.lowercased() { + fatalError("Unsupported type: \(name)") + } return "\(name)" } case let .union(types): - fatalError("Union types are unsupported") + // print("union", types) + return "" } } } @@ -215,3 +276,26 @@ extension IDLTypedef: SwiftRepresentable { "typealias \(name) = \(idlType)" } } + +extension IDLValue: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + switch self { + case let .string(value): + return .raw(value) + case let .number(value): + return .raw(value) + case let .boolean(value): + return "\(value)" + case .null: + fatalError("`null` is not supported as a value in Swift") + case let .infinity(negative): + return negative ? "-.infinity" : ".infinity" + case .nan: + return ".nan" + case .sequence: + return "[]" + case .dictionary: + return "[:]" + } + } +} diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index eb54ef64..6694ee9f 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -4,7 +4,8 @@ import WebIDL do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) - for (i, node) in idl["web-animations"]!.enumerated() { + for (i, node) in idl["dom"]!.enumerated() { + let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String print(toSwift(node).source) } // for (name, nodes) in idl { From 75d117aac2855befe1d3b91a269e80d811865e4f Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 16:31:26 -0400 Subject: [PATCH 008/124] write out to the files, make public --- .../WebIDL+SwiftRepresentation.swift | 45 ++++++++++--------- Sources/WebIDLToSwift/main.swift | 17 ++++--- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 642729dd..8f5d932b 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -2,14 +2,18 @@ import WebIDL extension IDLArgument: SwiftRepresentable { var swiftRepresentation: SwiftSource { - "\(name): \(idlType)" + if optional { + return "\(name): \(idlType)" + } else { + return "\(name): \(idlType)? = nil" + } } } extension IDLAttribute: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - \(raw: Context.static ? "static" : "") var \(name): \(idlType) { /* todo: attribute accessors */ } + public\(raw: Context.static ? " static" : "") var \(name): \(idlType) { /* todo: attribute accessors */ } """ } } @@ -26,7 +30,7 @@ extension IDLDictionary: SwiftRepresentable { private var swiftInit: SwiftSource { """ - convenience init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { + public onvenience init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { let object = JSObject.global.Object.function!.new() \(members.map { SwiftSource("object[\"\(raw: $0.name)\"] = \($0.name).jsValue()") }.joined(separator: "\n")) self = object @@ -37,7 +41,7 @@ extension IDLDictionary: SwiftRepresentable { private var swiftMembers: [SwiftSource] { members.map { """ - var \($0.name): \($0.idlType) { + public var \($0.name): \($0.idlType) { get { self["\(raw: $0.name)"].fromJSValue() } @@ -53,7 +57,7 @@ extension IDLDictionary: SwiftRepresentable { extension IDLEnum: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - enum \(name) { + public enum \(name) { \(raw: cases.map { "case \(SwiftSource($0).source)" }.joined(separator: "\n")) } """ @@ -62,8 +66,9 @@ extension IDLEnum: SwiftRepresentable { extension IDLCallback: SwiftRepresentable { var swiftRepresentation: SwiftSource { - """ - typealias \(name) = (\(arguments.map(\.idlType.swiftRepresentation).joined(separator: ", "))) -> \(idlType) + let args = arguments.map(\.idlType.swiftRepresentation).joined(separator: ", ") + return """ + public typealias \(name) = (\(args)) -> \(idlType) """ } } @@ -83,24 +88,24 @@ extension IDLInterface: SwiftRepresentable { if partial { assert(inheritance == nil) return """ - extension \(name) { + public extension \(name) { \(body) } """ } else { let requiredInit = """ - required init(unsafelyWrapping jsObject: JSObject) { + public required init(unsafelyWrapping jsObject: JSObject) { self.jsObject = jsObject } """ return """ - class \(name): \(inheritance ?? "JSBridgedClass") { - static var constructor: JSFunction { + public class \(name): \(inheritance ?? "JSBridgedClass") { + public static var constructor: JSFunction { \(constructor) } - let jsObject: JSObject + public let jsObject: JSObject \(inheritance == nil ? requiredInit : "") \(body) @@ -139,8 +144,8 @@ extension IDLConstructor: SwiftRepresentable { let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") let args = arguments.map(\.name.swiftRepresentation).joined(separator: ", ") return """ - convenience init(\(params)) { - self.init(unsafelyWrapping: \(Context.constructor).new(\(args))) + public convenience init(\(params)) { + self.init(unsafelyWrapping: Self.constructor.new(\(args))) } """ } @@ -171,7 +176,7 @@ extension IDLNamespace: SwiftRepresentable { } if partial { return """ - extension \(name) { + public extension \(name) { \(body) } """ @@ -197,7 +202,7 @@ extension IDLOperation: SwiftRepresentable { switch special { case "stringifier": return """ - var description: String { + public var description: String { \(Context.this).toString().fromJSValue() } """ @@ -207,7 +212,7 @@ extension IDLOperation: SwiftRepresentable { } case "getter": return """ - var \(name!): \(idlType!) { + public var \(name!): \(idlType!) { \(Context.this)["\(raw: name!)"].fromJSValue() } """ @@ -221,7 +226,7 @@ extension IDLOperation: SwiftRepresentable { let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") let args = arguments.map(\.name.swiftRepresentation).joined(separator: ", ") return """ - \(raw: Context.static ? "static" : "") func \(name!)(\(params)) -> \(idlType!) { + public\(raw: Context.static ? " static" : "") func \(name!)(\(params)) -> \(idlType!) { \(Context.this).\(name!)(\(args)).fromJSValue() } """ @@ -230,7 +235,7 @@ extension IDLOperation: SwiftRepresentable { let typeNameMap = [ "boolean": "Bool", - "any": "Any", + "any": "ConvertibleToJSValue", "DOMString": "String", "object": "JSObject", "undefined": "Void", @@ -273,7 +278,7 @@ extension IDLType: SwiftRepresentable { extension IDLTypedef: SwiftRepresentable { var swiftRepresentation: SwiftSource { - "typealias \(name) = \(idlType)" + "public typealias \(name) = \(idlType)" } } diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 6694ee9f..15314f1b 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -6,7 +6,13 @@ do { let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) for (i, node) in idl["dom"]!.enumerated() { let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String - print(toSwift(node).source) + if let name = name { + let content = "import JavaScriptKit\n\n" + toSwift(node).source + let path = "/Users/jed/Documents/github-clones/Tokamak/DOMKit/Sources/DOMKit/WebIDL/" + name + ".swift" + try content.write(toFile: path, atomically: true, encoding: .utf8) + } else if !(node is IDLIncludes) { + print(Mirror(reflecting: node).children.map(\.label)) + } } // for (name, nodes) in idl { // if name.starts(with: "WEBGL_") { continue } @@ -16,12 +22,12 @@ do { // } } catch { switch error as? DecodingError { - case .dataCorrupted(let ctx), .typeMismatch(_, let ctx): + case let .dataCorrupted(ctx), let .typeMismatch(_, ctx): debugContext(ctx) - case .valueNotFound(let type, let ctx): + case let .valueNotFound(type, ctx): print("Value of type \(type) not found") debugContext(ctx) - case .keyNotFound(let key, let ctx): + case let .keyNotFound(key, ctx): print("Key \(key.stringValue) not found") debugContext(ctx) case nil, .some: @@ -33,7 +39,8 @@ private func debugContext(_ ctx: DecodingError.Context) { print("Key path: \(ctx.codingPath.map { "." + $0.stringValue }.joined())") print(ctx.debugDescription) if let underlying = ctx.underlyingError as NSError?, - let debugDescription = underlying.userInfo["NSDebugDescription"] { + let debugDescription = underlying.userInfo["NSDebugDescription"] + { print(debugDescription) } } From b1f051558a7c48d3200d0b65e95d233365175d0e Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 17:01:05 -0400 Subject: [PATCH 009/124] More fixes/polish --- Sources/WebIDLToSwift/Context.swift | 4 +- .../WebIDL+SwiftRepresentation.swift | 66 +++++++++++-------- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index 0f82c478..d4139dd1 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -1,6 +1,6 @@ @dynamicMemberLookup enum Context { - private(set) static var current = State(static: false) + private(set) static var current = State() private static var stack: [State] = [] static func withState(_ new: State, body: () throws -> T) rethrows -> T { @@ -19,7 +19,7 @@ enum Context { } struct State { - private(set) var `static`: Bool + private(set) var `static` = false private(set) var constructor: SwiftSource! private(set) var this: SwiftSource! diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 8f5d932b..9c9dfa3c 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -3,9 +3,9 @@ import WebIDL extension IDLArgument: SwiftRepresentable { var swiftRepresentation: SwiftSource { if optional { - return "\(name): \(idlType)" - } else { return "\(name): \(idlType)? = nil" + } else { + return "\(name): \(idlType)" } } } @@ -13,7 +13,8 @@ extension IDLArgument: SwiftRepresentable { extension IDLAttribute: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public\(raw: Context.static ? " static" : "") var \(name): \(idlType) { /* todo: attribute accessors */ } + @\(readonly ? "ReadonlyAttribute" : "ReadWriteAttribute") + public\(raw: Context.static ? " static" : "") var \(name): \(idlType) """ } } @@ -23,14 +24,14 @@ extension IDLDictionary: SwiftRepresentable { """ public class \(name): JSObject { \(swiftInit) - \(swiftMembers.joined(separator: "\n")) + \(swiftMembers.joined(separator: "\n\n")) } """ } private var swiftInit: SwiftSource { """ - public onvenience init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { + public convenience init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { let object = JSObject.global.Object.function!.new() \(members.map { SwiftSource("object[\"\(raw: $0.name)\"] = \($0.name).jsValue()") }.joined(separator: "\n")) self = object @@ -43,7 +44,7 @@ extension IDLDictionary: SwiftRepresentable { """ public var \($0.name): \($0.idlType) { get { - self["\(raw: $0.name)"].fromJSValue() + self["\(raw: $0.name)"].fromJSValue()! } set { self["\(raw: $0.name)"] = newValue.jsValue() @@ -57,8 +58,17 @@ extension IDLDictionary: SwiftRepresentable { extension IDLEnum: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public enum \(name) { + public enum \(name): String, JSValueCompatible { \(raw: cases.map { "case \(SwiftSource($0).source)" }.joined(separator: "\n")) + + public static func construct(from jsValue: JSValue) -> \(name)? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } } """ } @@ -83,7 +93,7 @@ extension IDLInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { let constructor: SwiftSource = "JSObject.global.\(name).function!" let body = Context.withState(.instance(constructor: constructor, this: "jsObject")) { - members.map(toSwift).joined(separator: "\n") + members.map(toSwift).joined(separator: "\n\n") } if partial { assert(inheritance == nil) @@ -93,20 +103,15 @@ extension IDLInterface: SwiftRepresentable { } """ } else { - let requiredInit = """ - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - """ - return """ public class \(name): \(inheritance ?? "JSBridgedClass") { - public static var constructor: JSFunction { - \(constructor) - } + public\(inheritance == nil ? "" : " override") class var constructor: JSFunction { \(constructor) } + + \(inheritance == nil ? "public let jsObject: JSObject" : "") - public let jsObject: JSObject - \(inheritance == nil ? requiredInit : "") + public required init(unsafelyWrapping jsObject: JSObject) { + \(inheritance == nil ? "self.jsObject = jsObject" : "super.init(unsafelyWrapping: jsObject)") + } \(body) } @@ -119,7 +124,7 @@ extension IDLInterfaceMixin: SwiftRepresentable { var swiftRepresentation: SwiftSource { // let this: SwiftSource = "JSObject.global.\(name).object!" // let body = Context.withState(.static(this: this)) { - // members.map(toSwift).joined(separator: "\n") + // members.map(toSwift).joined(separator: "\n\n") // } // return """ // extension \(name) { @@ -172,7 +177,7 @@ extension IDLNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { let this: SwiftSource = "JSObject.global.\(name).object!" let body = Context.withState(.static(this: this)) { - members.map(toSwift).joined(separator: "\n") + members.map(toSwift).joined(separator: "\n\n") } if partial { return """ @@ -203,7 +208,7 @@ extension IDLOperation: SwiftRepresentable { case "stringifier": return """ public var description: String { - \(Context.this).toString().fromJSValue() + \(Context.this)["toString"]!().fromJSValue()! } """ case "static": @@ -213,7 +218,7 @@ extension IDLOperation: SwiftRepresentable { case "getter": return """ public var \(name!): \(idlType!) { - \(Context.this)["\(raw: name!)"].fromJSValue() + \(Context.this)["\(raw: name!)"].fromJSValue()! } """ default: @@ -224,10 +229,17 @@ extension IDLOperation: SwiftRepresentable { private var defaultRepresentation: SwiftSource { let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") - let args = arguments.map(\.name.swiftRepresentation).joined(separator: ", ") + let args = arguments.map { SwiftSource("\($0.name.swiftRepresentation).jsValue()") }.joined(separator: ", ") + let call: SwiftSource = "\(Context.this)[\"\(raw: name!)\"]!(\(args))" + let body: SwiftSource + if idlType?.swiftRepresentation.source == "Void" { + body = "_ = \(call)" + } else { + body = "\(call).fromJSValue()!" + } return """ public\(raw: Context.static ? " static" : "") func \(name!)(\(params)) -> \(idlType!) { - \(Context.this).\(name!)(\(args)).fromJSValue() + \(body) } """ } @@ -235,7 +247,7 @@ extension IDLOperation: SwiftRepresentable { let typeNameMap = [ "boolean": "Bool", - "any": "ConvertibleToJSValue", + "any": "JSValue", "DOMString": "String", "object": "JSObject", "undefined": "Void", @@ -271,7 +283,7 @@ extension IDLType: SwiftRepresentable { } case let .union(types): // print("union", types) - return "" + return "__UNSUPPORTED_UNION__" } } } From affd27ab7dae8656a36e1c6858ce97c7520193a7 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 17:16:47 -0400 Subject: [PATCH 010/124] progress --- .../DOMKit/WebIDL/DOMHighResTimeStamp.swift | 5 --- Sources/DOMKit/WebIDL/EpochTimeStamp.swift | 3 ++ Sources/DOMKit/WebIDL/Performance.swift | 21 ++++++++++ Sources/WebIDL/Interface.swift | 1 + .../WebIDL+SwiftRepresentation.swift | 39 ++++++++++++++++--- Sources/WebIDLToSwift/main.swift | 2 +- 6 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 Sources/DOMKit/WebIDL/EpochTimeStamp.swift create mode 100644 Sources/DOMKit/WebIDL/Performance.swift diff --git a/Sources/DOMKit/WebIDL/DOMHighResTimeStamp.swift b/Sources/DOMKit/WebIDL/DOMHighResTimeStamp.swift index 6918922d..8ca3c550 100644 --- a/Sources/DOMKit/WebIDL/DOMHighResTimeStamp.swift +++ b/Sources/DOMKit/WebIDL/DOMHighResTimeStamp.swift @@ -1,8 +1,3 @@ - -/* - * The following code is auto generated using webidl2swift - */ - import JavaScriptKit public typealias DOMHighResTimeStamp = Double diff --git a/Sources/DOMKit/WebIDL/EpochTimeStamp.swift b/Sources/DOMKit/WebIDL/EpochTimeStamp.swift new file mode 100644 index 00000000..f8ca578a --- /dev/null +++ b/Sources/DOMKit/WebIDL/EpochTimeStamp.swift @@ -0,0 +1,3 @@ +import JavaScriptKit + +public typealias EpochTimeStamp = Double diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift new file mode 100644 index 00000000..212be2df --- /dev/null +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -0,0 +1,21 @@ +import JavaScriptKit + +public class Performance: EventTarget { + override public class var constructor: JSFunction { JSObject.global.Performance.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: "timeOrigin") + super.init(unsafelyWrapping: jsObject) + } + + public func now() -> DOMHighResTimeStamp { + jsObject["now"]!().fromJSValue()! + } + + @ReadonlyAttribute + public var timeOrigin: DOMHighResTimeStamp + + public func toJSON() -> JSObject { + jsObject["toJSON"]!().fromJSValue()! + } +} diff --git a/Sources/WebIDL/Interface.swift b/Sources/WebIDL/Interface.swift index 3ef75c42..2f2058e8 100644 --- a/Sources/WebIDL/Interface.swift +++ b/Sources/WebIDL/Interface.swift @@ -19,6 +19,7 @@ public struct IDLCallbackInterface: IDLNode { } public protocol IDLInterfaceMember: IDLNode {} + extension IDLAttribute: IDLInterfaceMember {} extension IDLConstant: IDLInterfaceMember {} extension IDLConstructor: IDLInterfaceMember {} diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 9c9dfa3c..cfeecb14 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -10,13 +10,19 @@ extension IDLArgument: SwiftRepresentable { } } -extension IDLAttribute: SwiftRepresentable { +extension IDLAttribute: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { """ @\(readonly ? "ReadonlyAttribute" : "ReadWriteAttribute") public\(raw: Context.static ? " static" : "") var \(name): \(idlType) """ } + + var initializer: SwiftSource? { + assert(!Context.static) + let wrapper: SwiftSource = readonly ? "ReadonlyAttribute" : "ReadWriteAttribute" + return "_\(name) = \(wrapper)(jsObject: jsObject, name: \"\(name)\")" + } } extension IDLDictionary: SwiftRepresentable { @@ -89,6 +95,10 @@ extension IDLCallbackInterface: SwiftRepresentable { } } +protocol Initializable { + var initializer: SwiftSource? { get } +} + extension IDLInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { let constructor: SwiftSource = "JSObject.global.\(name).function!" @@ -110,6 +120,7 @@ extension IDLInterface: SwiftRepresentable { \(inheritance == nil ? "public let jsObject: JSObject" : "") public required init(unsafelyWrapping jsObject: JSObject) { + \(memberInits.joined(separator: "\n")) \(inheritance == nil ? "self.jsObject = jsObject" : "super.init(unsafelyWrapping: jsObject)") } @@ -118,6 +129,16 @@ extension IDLInterface: SwiftRepresentable { """ } } + + var memberInits: [SwiftSource] { + members.compactMap { + if let alt = $0 as? Initializable { + return alt.initializer + } else { + fatalError("Add Initializable conformance to \(Swift.type(of: $0))") + } + } + } } extension IDLInterfaceMixin: SwiftRepresentable { @@ -135,15 +156,17 @@ extension IDLInterfaceMixin: SwiftRepresentable { } } -extension IDLConstant: SwiftRepresentable { +extension IDLConstant: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { """ public static let \(name): \(idlType) = \(value) """ } + + var initializer: SwiftSource? { nil } } -extension IDLConstructor: SwiftRepresentable { +extension IDLConstructor: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { assert(!Context.static) let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") @@ -154,6 +177,8 @@ extension IDLConstructor: SwiftRepresentable { } """ } + + var initializer: SwiftSource? { nil } } extension IDLIncludes: SwiftRepresentable { @@ -165,12 +190,14 @@ extension IDLIncludes: SwiftRepresentable { } } -extension IDLIterableDeclaration: SwiftRepresentable { +extension IDLIterableDeclaration: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { """ /* [make me iterable plz] */ """ } + + var initializer: SwiftSource? { nil } } extension IDLNamespace: SwiftRepresentable { @@ -199,7 +226,7 @@ extension IDLNamespace: SwiftRepresentable { } } -extension IDLOperation: SwiftRepresentable { +extension IDLOperation: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { if special.isEmpty { return defaultRepresentation @@ -243,6 +270,8 @@ extension IDLOperation: SwiftRepresentable { } """ } + + var initializer: SwiftSource? { nil } } let typeNameMap = [ diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 15314f1b..c5f94c92 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -4,7 +4,7 @@ import WebIDL do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) - for (i, node) in idl["dom"]!.enumerated() { + for (i, node) in (idl["dom"]!.array + idl["hr-time"]!.array).enumerated() { let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String if let name = name { let content = "import JavaScriptKit\n\n" + toSwift(node).source From 54367dbdc16d9eb73aee5ce36d8f180b7b7463d9 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 17:25:44 -0400 Subject: [PATCH 011/124] add HTML --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 10 ++++++++++ Sources/WebIDLToSwift/main.swift | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index cfeecb14..10aa5497 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -248,6 +248,10 @@ extension IDLOperation: SwiftRepresentable, Initializable { \(Context.this)["\(raw: name!)"].fromJSValue()! } """ + case "setter": + return "/* unsupported setter for keys of type \(arguments[0].idlType.swiftRepresentation.source) */" + case "deleter": + return "/* unsupported deleter for keys of type \(arguments[0].idlType.swiftRepresentation.source) */" default: fatalError("Unsupported special operation \(special)") } @@ -286,6 +290,7 @@ let typeNameMap = [ "unsigned long": "Double", "unsigned long long": "Double", "short": "Double", + "long": "Double", ] extension IDLType: SwiftRepresentable { @@ -295,9 +300,14 @@ extension IDLType: SwiftRepresentable { switch name { case "sequence": return "[\(args[0])]" + case "FrozenArray": + // ??? + return "[\(args[0])]" case "Promise": // TODO: async return "JSPromise" + case "record": + return "[\(args[0]): \(args[1])]" default: fatalError("Unsupported generic type: \(name)") } diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index c5f94c92..9e1f9a4b 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -4,7 +4,7 @@ import WebIDL do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) - for (i, node) in (idl["dom"]!.array + idl["hr-time"]!.array).enumerated() { + for (i, node) in ["dom", "hr-time", "html"].flatMap({ idl[$0]!.array }).enumerated() { let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String if let name = name { let content = "import JavaScriptKit\n\n" + toSwift(node).source From afc48a71bc09577657358123245d92d05921db0a Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 17:44:00 -0400 Subject: [PATCH 012/124] Fix broken enums --- .../WebIDLToSwift/SwiftRepresentation.swift | 14 ++------- Sources/WebIDLToSwift/SwiftSource.swift | 31 +++++++++++++++++++ .../WebIDL+SwiftRepresentation.swift | 4 ++- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/Sources/WebIDLToSwift/SwiftRepresentation.swift b/Sources/WebIDLToSwift/SwiftRepresentation.swift index f542a4b7..4521144c 100644 --- a/Sources/WebIDLToSwift/SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/SwiftRepresentation.swift @@ -13,20 +13,10 @@ func toSwift(_ value: T) -> SwiftSource { } } -let swiftKeywords: [String: String] = [ - "init": "`init`", - "where": "`where`", - "protocol": "`protocol`", - "struct": "`struct`", - "class": "`class`", - "enum": "`enum`", - "func": "`func`", - "static": "`static`", - "is": "`is`", -] +let swiftKeywords: Set = ["init", "where", "protocol", "struct", "class", "enum", "func", "static", "is", "default"] extension String: SwiftRepresentable { var swiftRepresentation: SwiftSource { - SwiftSource(swiftKeywords[self] ?? self) + SwiftSource(swiftKeywords.contains(self) ? "`\(self)`" : self) } } diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift index 52c27650..687e43ad 100644 --- a/Sources/WebIDLToSwift/SwiftSource.swift +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -1,3 +1,5 @@ +import Foundation + struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation { let source: String @@ -40,6 +42,10 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation { output += toSwift(value).source } + mutating func appendInterpolation(_ values: [SwiftSource]) { + output += values.map(\.source).joined(separator: "\n") + } + mutating func appendInterpolation(state: Context.State, _ value: T) { Context.withState(state) { output += toSwift(value).source @@ -59,3 +65,28 @@ extension SwiftSource: SwiftRepresentable { self } } + +extension String { + var camelized: String { + guard !isEmpty else { return "_empty" } + + let parts = self.components(separatedBy: CharacterSet.alphanumerics.inverted) + let first = parts.first!.lowercasingFirst + let rest = parts.dropFirst().map(\.uppercasingFirst) + + let result = ([first] + rest).joined() + if result.first!.isNumber { + return "_" + result + } else { + return result + } + } + + private var uppercasingFirst: String { + prefix(1).uppercased() + dropFirst() + } + + private var lowercasingFirst: String { + prefix(1).lowercased() + dropFirst() + } +} diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 10aa5497..94a05018 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -65,7 +65,9 @@ extension IDLEnum: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ public enum \(name): String, JSValueCompatible { - \(raw: cases.map { "case \(SwiftSource($0).source)" }.joined(separator: "\n")) + \(cases.map { name -> SwiftSource in + "case \(name.camelized) = \"\(name)\"" + }) public static func construct(from jsValue: JSValue) -> \(name)? { if let string = jsValue.string { From 2dc3245b0b8046f1bd47b46df98a20be3f3b028e Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 17:46:39 -0400 Subject: [PATCH 013/124] Fix nullable IDLTypes --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 94a05018..20f591c2 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -297,6 +297,13 @@ let typeNameMap = [ extension IDLType: SwiftRepresentable { var swiftRepresentation: SwiftSource { + if nullable { + return "\(baseType)?" + } + return baseType + } + + var baseType: SwiftSource { switch value { case let .generic(name, args): switch name { From f92b1cc97d9cb7db07a2c50f76a6e6defba76b66 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 17:52:31 -0400 Subject: [PATCH 014/124] more fixes --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 1 + Sources/WebIDLToSwift/main.swift | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 20f591c2..8cfd031b 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -284,6 +284,7 @@ let typeNameMap = [ "boolean": "Bool", "any": "JSValue", "DOMString": "String", + "USVString": "String", "object": "JSObject", "undefined": "Void", "double": "Double", diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 9e1f9a4b..526e0119 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -7,9 +7,14 @@ do { for (i, node) in ["dom", "hr-time", "html"].flatMap({ idl[$0]!.array }).enumerated() { let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String if let name = name { - let content = "import JavaScriptKit\n\n" + toSwift(node).source + let content = toSwift(node).source let path = "/Users/jed/Documents/github-clones/Tokamak/DOMKit/Sources/DOMKit/WebIDL/" + name + ".swift" - try content.write(toFile: path, atomically: true, encoding: .utf8) + if FileManager.default.fileExists(atPath: path) { + let oldContent = try String(contentsOfFile: path) + try (oldContent + "\n\n/* --- */\n\n" + content).write(toFile: path, atomically: true, encoding: .utf8) + } else { + try ("import JavaScriptKit\n\n" + content).write(toFile: path, atomically: true, encoding: .utf8) + } } else if !(node is IDLIncludes) { print(Mirror(reflecting: node).children.map(\.label)) } From 1569d9df3f0b1e782c6eb9ae4a66290c883294b1 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 17:52:50 -0400 Subject: [PATCH 015/124] fetch all the IDL files --- fetch-idl/.prettierrc.json | 1 + fetch-idl/build.js | 5 +++ fetch-idl/package-lock.json | 63 +++++++++++++++++++++++++++++++++++++ fetch-idl/package.json | 14 +++++++++ 4 files changed, 83 insertions(+) create mode 100644 fetch-idl/.prettierrc.json create mode 100644 fetch-idl/build.js create mode 100644 fetch-idl/package-lock.json create mode 100644 fetch-idl/package.json diff --git a/fetch-idl/.prettierrc.json b/fetch-idl/.prettierrc.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/fetch-idl/.prettierrc.json @@ -0,0 +1 @@ +{} diff --git a/fetch-idl/build.js b/fetch-idl/build.js new file mode 100644 index 00000000..d59aa48b --- /dev/null +++ b/fetch-idl/build.js @@ -0,0 +1,5 @@ +import { parseAll } from "@webref/idl"; +import fs from "node:fs/promises"; + +const parsedFiles = await parseAll(); +await fs.writeFile("out.json", JSON.stringify(parsedFiles, null, 2)); diff --git a/fetch-idl/package-lock.json b/fetch-idl/package-lock.json new file mode 100644 index 00000000..d4a7c019 --- /dev/null +++ b/fetch-idl/package-lock.json @@ -0,0 +1,63 @@ +{ + "name": "fetch-idl", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "@webref/idl": "^3.5.0", + "webidl2": "^24.2.1" + }, + "devDependencies": { + "prettier": "2.6.1" + } + }, + "node_modules/@webref/idl": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@webref/idl/-/idl-3.5.0.tgz", + "integrity": "sha512-e4nMYUWVSheHbA9j2kqLAeh3mjTVxG0H4ucVbi8l5nUHWP6kKW2qYik3nHcg7HNfHCDBm+ID6ZuSY0aT9tSDIg==", + "peerDependencies": { + "webidl2": "^24.2.1" + } + }, + "node_modules/prettier": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.1.tgz", + "integrity": "sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/webidl2": { + "version": "24.2.1", + "resolved": "https://registry.npmjs.org/webidl2/-/webidl2-24.2.1.tgz", + "integrity": "sha512-1jod69oNcC9BnFt3dgL5te+erImZqji1FCnJStIYOGK+fFrjVc03PGJrcJrhIUVJDIb/KyUNWy+xXIGQnAvQRA==" + } + }, + "dependencies": { + "@webref/idl": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@webref/idl/-/idl-3.5.0.tgz", + "integrity": "sha512-e4nMYUWVSheHbA9j2kqLAeh3mjTVxG0H4ucVbi8l5nUHWP6kKW2qYik3nHcg7HNfHCDBm+ID6ZuSY0aT9tSDIg==", + "requires": {} + }, + "prettier": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.1.tgz", + "integrity": "sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==", + "dev": true + }, + "webidl2": { + "version": "24.2.1", + "resolved": "https://registry.npmjs.org/webidl2/-/webidl2-24.2.1.tgz", + "integrity": "sha512-1jod69oNcC9BnFt3dgL5te+erImZqji1FCnJStIYOGK+fFrjVc03PGJrcJrhIUVJDIb/KyUNWy+xXIGQnAvQRA==" + } + } +} diff --git a/fetch-idl/package.json b/fetch-idl/package.json new file mode 100644 index 00000000..1489f0be --- /dev/null +++ b/fetch-idl/package.json @@ -0,0 +1,14 @@ +{ + "private": true, + "type": "module", + "scripts": { + "start": "node build.js" + }, + "devDependencies": { + "prettier": "2.6.1" + }, + "dependencies": { + "@webref/idl": "^3.5.0", + "webidl2": "^24.2.1" + } +} From aff3c6409d27ba0acfc7774069c69c7d91ecdd2c Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 18:03:02 -0400 Subject: [PATCH 016/124] remove IDLIncludes conformance for now since it is unused --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 8cfd031b..bf75e018 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -183,15 +183,6 @@ extension IDLConstructor: SwiftRepresentable, Initializable { var initializer: SwiftSource? { nil } } -extension IDLIncludes: SwiftRepresentable { - var swiftRepresentation: SwiftSource { - "" - // """ - // // TODO: IDLIncludes (\(includes) from \(target)) - // """ - } -} - extension IDLIterableDeclaration: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { """ From 98c9315997b59e7c1028686b5cb864d97622e607 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 19:51:01 -0400 Subject: [PATCH 017/124] fixes to optional arguments, merge declarations --- Sources/WebIDLToSwift/MergeDeclarations.swift | 65 +++++++++++++++++++ .../WebIDLToSwift/SwiftRepresentation.swift | 16 ++++- Sources/WebIDLToSwift/SwiftSource.swift | 4 +- .../WebIDL+SwiftRepresentation.swift | 44 ++++++------- Sources/WebIDLToSwift/main.swift | 24 ++++--- 5 files changed, 114 insertions(+), 39 deletions(-) create mode 100644 Sources/WebIDLToSwift/MergeDeclarations.swift diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift new file mode 100644 index 00000000..d9d7cc28 --- /dev/null +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -0,0 +1,65 @@ +import WebIDL + +func merge(declarations: [IDLNode]) -> [DeclarationFile] { + let byType: [String: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in + partialResult[type(of: node).type, default: []].append(node) + } + let byName: [String?: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in + let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String + partialResult[name, default: []].append(node) + } +// print(byName.filter { $0.value.count > 1 }.map { "\($0.key ?? ""): \($0.value.map { type(of: $0).type }))" }.joined(separator: "\n")) + // ["interface mixin", "interface", "includes"] + + func all(_: T.Type) -> [T] { + byType[T.type]!.map { $0 as! T } + } + + let mixins = Dictionary(all(IDLInterfaceMixin.self).map { + ($0.name, MergedMixin(name: $0.name, members: $0.members.array as! [IDLInterfaceMixinMember])) + }, uniquingKeysWith: { + MergedMixin(name: $0.name, members: $0.members + $1.members) + }) + var merged = Dictionary(all(IDLInterface.self).map { + ($0.name, MergedInterface( + name: $0.name, + inheritance: [$0.inheritance].compactMap { $0 }, + members: $0.members.array as! [IDLInterfaceMember] + )) + }, uniquingKeysWith: { + MergedInterface(name: $0.name, inheritance: $0.inheritance + $1.inheritance, members: $0.members + $1.members) + }) + + print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) + return Array(merged.values) + + [Typedefs(typedefs: all(IDLTypedef.self) + all(IDLCallback.self))] + + all(IDLDictionary.self) + + all(IDLEnum.self) + + all(IDLNamespace.self) +} + +protocol DeclarationFile {} + +extension IDLDictionary: DeclarationFile {} +extension IDLEnum: DeclarationFile {} +extension IDLNamespace: DeclarationFile {} + +struct MergedMixin { + let name: String + var members: [IDLInterfaceMixinMember] +} + +struct MergedInterface: DeclarationFile { + let name: String + var inheritance: [String] + var members: [IDLInterfaceMember] +} + +struct Typedefs: DeclarationFile, SwiftRepresentable { + let name = "Typedefs" + let typedefs: [IDLNode] + + var swiftRepresentation: SwiftSource { + "\(lines: typedefs.map(toSwift))" + } +} diff --git a/Sources/WebIDLToSwift/SwiftRepresentation.swift b/Sources/WebIDLToSwift/SwiftRepresentation.swift index 4521144c..b1eb71cd 100644 --- a/Sources/WebIDLToSwift/SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/SwiftRepresentation.swift @@ -13,7 +13,21 @@ func toSwift(_ value: T) -> SwiftSource { } } -let swiftKeywords: Set = ["init", "where", "protocol", "struct", "class", "enum", "func", "static", "is", "default"] +let swiftKeywords: Set = [ + "init", + "where", + "protocol", + "struct", + "class", + "enum", + "func", + "static", + "is", + "as", + "default", + "defer", + "self", +] extension String: SwiftRepresentable { var swiftRepresentation: SwiftSource { diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift index 687e43ad..82373f21 100644 --- a/Sources/WebIDLToSwift/SwiftSource.swift +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -42,7 +42,7 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation { output += toSwift(value).source } - mutating func appendInterpolation(_ values: [SwiftSource]) { + mutating func appendInterpolation(lines values: [SwiftSource]) { output += values.map(\.source).joined(separator: "\n") } @@ -70,7 +70,7 @@ extension String { var camelized: String { guard !isEmpty else { return "_empty" } - let parts = self.components(separatedBy: CharacterSet.alphanumerics.inverted) + let parts = components(separatedBy: CharacterSet.alphanumerics.inverted) let first = parts.first!.lowercasingFirst let rest = parts.dropFirst().map(\.uppercasingFirst) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index bf75e018..6dfa0ca9 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -21,7 +21,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { var initializer: SwiftSource? { assert(!Context.static) let wrapper: SwiftSource = readonly ? "ReadonlyAttribute" : "ReadWriteAttribute" - return "_\(name) = \(wrapper)(jsObject: jsObject, name: \"\(name)\")" + return "_\(raw: name) = \(wrapper)(jsObject: jsObject, name: \"\(raw: name)\")" } } @@ -65,8 +65,8 @@ extension IDLEnum: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ public enum \(name): String, JSValueCompatible { - \(cases.map { name -> SwiftSource in - "case \(name.camelized) = \"\(name)\"" + \(lines: cases.map { name -> SwiftSource in + "case \(name.camelized) = \"\(raw: name)\"" }) public static func construct(from jsValue: JSValue) -> \(name)? { @@ -101,35 +101,27 @@ protocol Initializable { var initializer: SwiftSource? { get } } -extension IDLInterface: SwiftRepresentable { +extension MergedInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { let constructor: SwiftSource = "JSObject.global.\(name).function!" let body = Context.withState(.instance(constructor: constructor, this: "jsObject")) { members.map(toSwift).joined(separator: "\n\n") } - if partial { - assert(inheritance == nil) - return """ - public extension \(name) { - \(body) - } - """ - } else { - return """ - public class \(name): \(inheritance ?? "JSBridgedClass") { - public\(inheritance == nil ? "" : " override") class var constructor: JSFunction { \(constructor) } - \(inheritance == nil ? "public let jsObject: JSObject" : "") + return """ + public class \(name): \(inheritance.isEmpty ? "JSBridgedClass" : inheritance.joined(separator: ", ")) { + public\(inheritance.isEmpty ? "" : " override") class var constructor: JSFunction { \(constructor) } - public required init(unsafelyWrapping jsObject: JSObject) { - \(memberInits.joined(separator: "\n")) - \(inheritance == nil ? "self.jsObject = jsObject" : "super.init(unsafelyWrapping: jsObject)") - } + \(inheritance.isEmpty ? "public let jsObject: JSObject" : "") - \(body) + public required init(unsafelyWrapping jsObject: JSObject) { + \(memberInits.joined(separator: "\n")) + \(inheritance.isEmpty ? "self.jsObject = jsObject" : "super.init(unsafelyWrapping: jsObject)") } - """ + + \(body) } + """ } var memberInits: [SwiftSource] { @@ -253,7 +245,13 @@ extension IDLOperation: SwiftRepresentable, Initializable { private var defaultRepresentation: SwiftSource { let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") - let args = arguments.map { SwiftSource("\($0.name.swiftRepresentation).jsValue()") }.joined(separator: ", ") + let args = arguments.map { arg -> SwiftSource in + if arg.optional { + return "\(arg.name)?.jsValue() ?? .undefined" + } else { + return "\(arg.name).jsValue()" + } + }.joined(separator: ", ") let call: SwiftSource = "\(Context.this)[\"\(raw: name!)\"]!(\(args))" let body: SwiftSource if idlType?.swiftRepresentation.source == "Void" { diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 526e0119..d1fe0edc 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -4,19 +4,17 @@ import WebIDL do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) - for (i, node) in ["dom", "hr-time", "html"].flatMap({ idl[$0]!.array }).enumerated() { - let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String - if let name = name { - let content = toSwift(node).source - let path = "/Users/jed/Documents/github-clones/Tokamak/DOMKit/Sources/DOMKit/WebIDL/" + name + ".swift" - if FileManager.default.fileExists(atPath: path) { - let oldContent = try String(contentsOfFile: path) - try (oldContent + "\n\n/* --- */\n\n" + content).write(toFile: path, atomically: true, encoding: .utf8) - } else { - try ("import JavaScriptKit\n\n" + content).write(toFile: path, atomically: true, encoding: .utf8) - } - } else if !(node is IDLIncludes) { - print(Mirror(reflecting: node).children.map(\.label)) + let declarations = ["dom", "hr-time", "html", "console"].flatMap { idl[$0]!.array } + for (i, node) in merge(declarations: declarations).enumerated() { + guard let name = Mirror(reflecting: node).children.first(where: { $0.label == "name" })?.value as? String else { + fatalError("Cannot find name for \(node)") + } + let content = toSwift(node).source + let path = "/Users/jed/Documents/github-clones/Tokamak/DOMKit/Sources/DOMKit/WebIDL/" + name + ".swift" + if FileManager.default.fileExists(atPath: path) { + fatalError("file already exists for \(name)") + } else { + try ("import JavaScriptKit\n\n" + content).write(toFile: path, atomically: true, encoding: .utf8) } } // for (name, nodes) in idl { From ae2568c05dc01f962a474b56714bacb37fe25c68 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 20:17:11 -0400 Subject: [PATCH 018/124] fix nullable optional params --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 6dfa0ca9..ed0910fb 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -2,10 +2,15 @@ import WebIDL extension IDLArgument: SwiftRepresentable { var swiftRepresentation: SwiftSource { + let type: SwiftSource = variadic ? "\(idlType)..." : "\(idlType)" if optional { - return "\(name): \(idlType)? = nil" + if idlType.nullable { + return "\(name): \(type) = nil" + } else { + return "\(name): \(type)? = nil" + } } else { - return "\(name): \(idlType)" + return "\(name): \(type)" } } } From ee2f72d86bd451aaac69f95861520fa544d9375a Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 20:22:05 -0400 Subject: [PATCH 019/124] use ReadWriteAttribute for dictionaries --- .../WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index ed0910fb..6b4f8abe 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -43,8 +43,9 @@ extension IDLDictionary: SwiftRepresentable { private var swiftInit: SwiftSource { """ public convenience init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { + \(lines: members.map { "_\($0.name) = ReadWriteAttribute(jsObject: object, name: \"\(raw: $0.name)\")" }) let object = JSObject.global.Object.function!.new() - \(members.map { SwiftSource("object[\"\(raw: $0.name)\"] = \($0.name).jsValue()") }.joined(separator: "\n")) + \(lines: members.map { "object[\"\(raw: $0.name)\"] = \($0.name).jsValue()" }) self = object } """ @@ -53,14 +54,8 @@ extension IDLDictionary: SwiftRepresentable { private var swiftMembers: [SwiftSource] { members.map { """ - public var \($0.name): \($0.idlType) { - get { - self["\(raw: $0.name)"].fromJSValue()! - } - set { - self["\(raw: $0.name)"] = newValue.jsValue() - } - } + @ReadWriteAttribute + public var \($0.name): \($0.idlType) """ } } From cc7263853c423edcc418468c6e5d29ecaca40b38 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 20:30:27 -0400 Subject: [PATCH 020/124] remove broken getter support, fix IDLDictionary init --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 6b4f8abe..b1121982 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -43,9 +43,9 @@ extension IDLDictionary: SwiftRepresentable { private var swiftInit: SwiftSource { """ public convenience init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { - \(lines: members.map { "_\($0.name) = ReadWriteAttribute(jsObject: object, name: \"\(raw: $0.name)\")" }) let object = JSObject.global.Object.function!.new() \(lines: members.map { "object[\"\(raw: $0.name)\"] = \($0.name).jsValue()" }) + \(lines: members.map { "_\(raw: $0.name) = ReadWriteAttribute(jsObject: object, name: \"\(raw: $0.name)\")" }) self = object } """ @@ -228,11 +228,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { defaultRepresentation } case "getter": - return """ - public var \(name!): \(idlType!) { - \(Context.this)["\(raw: name!)"].fromJSValue()! - } - """ + return "/* unsupported getter for keys of type \(arguments[0].idlType.swiftRepresentation.source) */" case "setter": return "/* unsupported setter for keys of type \(arguments[0].idlType.swiftRepresentation.source) */" case "deleter": From 5c2f3141390d887055340791b9180802f67d47fb Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 20:52:22 -0400 Subject: [PATCH 021/124] Changes to JSKit --- Package.resolved | 6 +++--- Package.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Package.resolved b/Package.resolved index bd43c161..a3354bea 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,9 +5,9 @@ "package": "JavaScriptKit", "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { - "branch": null, - "revision": "b7a02434c6e973c08c3fd5069105ef44dd82b891", - "version": "0.9.0" + "branch": "jed/open-object", + "revision": "0f9b0fbfb4004cbfb335a81416bd6658ece750c7", + "version": null } } ] diff --git a/Package.swift b/Package.swift index 86658f2e..b6624ace 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,7 @@ let package = Package( .package( name: "JavaScriptKit", url: "https://github.com/swiftwasm/JavaScriptKit.git", - .upToNextMinor(from: "0.9.0")), + .branch("jed/open-object")), ], targets: [ .target( From d6fab9b4991e2a4354d8c1331d0f694c42f73768 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 21:16:16 -0400 Subject: [PATCH 022/124] hammer more on errors --- .../WebIDL+SwiftRepresentation.swift | 25 +++++++++++++------ Sources/WebIDLToSwift/main.swift | 5 +++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index b1121982..3bd0e9ea 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -16,17 +16,26 @@ extension IDLArgument: SwiftRepresentable { } extension IDLAttribute: SwiftRepresentable, Initializable { + var propertyWrapper: SwiftSource { + if readonly { + return "ReadonlyAttribute" + } + if case let .single(name) = idlType.value, name == "EventHandler" { + return "OptionalClosureHandler" + } + return "ReadWriteAttribute" + } + var swiftRepresentation: SwiftSource { """ - @\(readonly ? "ReadonlyAttribute" : "ReadWriteAttribute") + @\(propertyWrapper) public\(raw: Context.static ? " static" : "") var \(name): \(idlType) """ } var initializer: SwiftSource? { assert(!Context.static) - let wrapper: SwiftSource = readonly ? "ReadonlyAttribute" : "ReadWriteAttribute" - return "_\(raw: name) = \(wrapper)(jsObject: jsObject, name: \"\(raw: name)\")" + return "_\(raw: name) = \(propertyWrapper)(jsObject: jsObject, name: \"\(raw: name)\")" } } @@ -42,11 +51,11 @@ extension IDLDictionary: SwiftRepresentable { private var swiftInit: SwiftSource { """ - public convenience init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { + public init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { let object = JSObject.global.Object.function!.new() \(lines: members.map { "object[\"\(raw: $0.name)\"] = \($0.name).jsValue()" }) - \(lines: members.map { "_\(raw: $0.name) = ReadWriteAttribute(jsObject: object, name: \"\(raw: $0.name)\")" }) - self = object + super.init(cloning: object) + \(lines: members.map { "_\(raw: $0.name) = ReadWriteAttribute(jsObject: self, name: \"\(raw: $0.name)\")" }) } """ } @@ -224,7 +233,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { } """ case "static": - return Context.withState(.static(this: Context.constructor)) { + return Context.withState(.static(this: "constructor")) { defaultRepresentation } case "getter": @@ -270,6 +279,7 @@ let typeNameMap = [ "any": "JSValue", "DOMString": "String", "USVString": "String", + "ByteString": "String", "object": "JSObject", "undefined": "Void", "double": "Double", @@ -279,6 +289,7 @@ let typeNameMap = [ "unsigned long long": "Double", "short": "Double", "long": "Double", + "long long": "Double", ] extension IDLType: SwiftRepresentable { diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index d1fe0edc..b1bbcbc4 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -4,7 +4,10 @@ import WebIDL do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) - let declarations = ["dom", "hr-time", "html", "console"].flatMap { idl[$0]!.array } + let declarations = [ + "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", + "referrer-policy", + ].flatMap { idl[$0]!.array } for (i, node) in merge(declarations: declarations).enumerated() { guard let name = Mirror(reflecting: node).children.first(where: { $0.label == "name" })?.value as? String else { fatalError("Cannot find name for \(node)") From cd34b3cf671103712b1d7225f08e5005b3644a67 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 21:35:28 -0400 Subject: [PATCH 023/124] fix broken dictionaries --- .../WebIDL/AddEventListenerOptions.swift | 39 ---------- .../DOMKit/WebIDL/AssignedNodesOptions.swift | 39 ---------- Sources/DOMKit/WebIDL/BlobPropertyBag.swift | 39 ---------- Sources/DOMKit/WebIDL/CompositionEvent.swift | 21 ++++++ Sources/DOMKit/WebIDL/CustomEventInit.swift | 39 ---------- .../WebIDL/ElementCreationOptions.swift | 39 ---------- Sources/DOMKit/WebIDL/EventInit.swift | 39 ---------- .../DOMKit/WebIDL/EventListenerOptions.swift | 39 ---------- Sources/DOMKit/WebIDL/FilePropertyBag.swift | 39 ---------- Sources/DOMKit/WebIDL/FocusEvent.swift | 17 +++++ Sources/DOMKit/WebIDL/FocusOptions.swift | 39 ---------- .../DOMKit/WebIDL/GetRootNodeOptions.swift | 39 ---------- Sources/DOMKit/WebIDL/InputEvent.swift | 25 +++++++ Sources/DOMKit/WebIDL/KeyboardEvent.swift | 73 +++++++++++++++++++ Sources/DOMKit/WebIDL/MouseEvent.swift | 65 +++++++++++++++++ Sources/DOMKit/WebIDL/MutationEvent.swift | 39 ++++++++++ .../DOMKit/WebIDL/MutationObserverInit.swift | 39 ---------- Sources/DOMKit/WebIDL/ShadowRootInit.swift | 39 ---------- Sources/DOMKit/WebIDL/StaticRangeInit.swift | 39 ---------- Sources/DOMKit/WebIDL/UIEvent.swift | 29 ++++++++ .../DOMKit/WebIDL/ValidityStateFlags.swift | 39 ---------- Sources/DOMKit/WebIDL/WheelEvent.swift | 35 +++++++++ Sources/WebIDLToSwift/MergeDeclarations.swift | 32 ++++++-- .../WebIDL+SwiftRepresentation.swift | 2 +- 24 files changed, 329 insertions(+), 555 deletions(-) delete mode 100644 Sources/DOMKit/WebIDL/AddEventListenerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AssignedNodesOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/BlobPropertyBag.swift create mode 100644 Sources/DOMKit/WebIDL/CompositionEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/CustomEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/ElementCreationOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/EventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/EventListenerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/FilePropertyBag.swift create mode 100644 Sources/DOMKit/WebIDL/FocusEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/FocusOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/GetRootNodeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/InputEvent.swift create mode 100644 Sources/DOMKit/WebIDL/KeyboardEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MouseEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MutationEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/MutationObserverInit.swift delete mode 100644 Sources/DOMKit/WebIDL/ShadowRootInit.swift delete mode 100644 Sources/DOMKit/WebIDL/StaticRangeInit.swift create mode 100644 Sources/DOMKit/WebIDL/UIEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/ValidityStateFlags.swift create mode 100644 Sources/DOMKit/WebIDL/WheelEvent.swift diff --git a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift deleted file mode 100644 index 52ecbe6b..00000000 --- a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct AddEventListenerOptions: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case capture, passive, once - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift deleted file mode 100644 index 8754b6ac..00000000 --- a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct AssignedNodesOptions: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case flatten - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift deleted file mode 100644 index 8dd21c0f..00000000 --- a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct BlobPropertyBag: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case type, endings - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift new file mode 100644 index 00000000..86f21296 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -0,0 +1,21 @@ +import JavaScriptKit + +public class CompositionEvent: UIEvent { + override public class var constructor: JSFunction { JSObject.global.CompositionEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: "data") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: CompositionEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var data: String + + public func initCompositionEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: WindowProxy? = nil, dataArg: String? = nil) { + _ = jsObject["initCompositionEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/CustomEventInit.swift b/Sources/DOMKit/WebIDL/CustomEventInit.swift deleted file mode 100644 index 52c858d6..00000000 --- a/Sources/DOMKit/WebIDL/CustomEventInit.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct CustomEventInit: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case bubbles, cancelable, composed, detail - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift deleted file mode 100644 index 0a2b9c15..00000000 --- a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct ElementCreationOptions: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case `is` - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/EventInit.swift b/Sources/DOMKit/WebIDL/EventInit.swift deleted file mode 100644 index 30322086..00000000 --- a/Sources/DOMKit/WebIDL/EventInit.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct EventInit: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case bubbles, cancelable, composed - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/EventListenerOptions.swift b/Sources/DOMKit/WebIDL/EventListenerOptions.swift deleted file mode 100644 index 2786767f..00000000 --- a/Sources/DOMKit/WebIDL/EventListenerOptions.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct EventListenerOptions: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case capture - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/FilePropertyBag.swift b/Sources/DOMKit/WebIDL/FilePropertyBag.swift deleted file mode 100644 index 6415c050..00000000 --- a/Sources/DOMKit/WebIDL/FilePropertyBag.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct FilePropertyBag: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case type, endings, lastModified - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/FocusEvent.swift b/Sources/DOMKit/WebIDL/FocusEvent.swift new file mode 100644 index 00000000..566508d7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FocusEvent.swift @@ -0,0 +1,17 @@ +import JavaScriptKit + +public class FocusEvent: UIEvent { + override public class var constructor: JSFunction { JSObject.global.FocusEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: "relatedTarget") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: FocusEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var relatedTarget: EventTarget? +} diff --git a/Sources/DOMKit/WebIDL/FocusOptions.swift b/Sources/DOMKit/WebIDL/FocusOptions.swift deleted file mode 100644 index ff3f0a1a..00000000 --- a/Sources/DOMKit/WebIDL/FocusOptions.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct FocusOptions: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case preventScroll - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift deleted file mode 100644 index cc024db8..00000000 --- a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct GetRootNodeOptions: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case composed - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift new file mode 100644 index 00000000..7f7c1c66 --- /dev/null +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -0,0 +1,25 @@ +import JavaScriptKit + +public class InputEvent: UIEvent { + override public class var constructor: JSFunction { JSObject.global.InputEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: "data") + _isComposing = ReadonlyAttribute(jsObject: jsObject, name: "isComposing") + _inputType = ReadonlyAttribute(jsObject: jsObject, name: "inputType") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: InputEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var data: String? + + @ReadonlyAttribute + public var isComposing: Bool + + @ReadonlyAttribute + public var inputType: String +} diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift new file mode 100644 index 00000000..93828bef --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -0,0 +1,73 @@ +import JavaScriptKit + +public class KeyboardEvent: UIEvent { + override public class var constructor: JSFunction { JSObject.global.KeyboardEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _key = ReadonlyAttribute(jsObject: jsObject, name: "key") + _code = ReadonlyAttribute(jsObject: jsObject, name: "code") + _location = ReadonlyAttribute(jsObject: jsObject, name: "location") + _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: "ctrlKey") + _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: "shiftKey") + _altKey = ReadonlyAttribute(jsObject: jsObject, name: "altKey") + _metaKey = ReadonlyAttribute(jsObject: jsObject, name: "metaKey") + _repeat = ReadonlyAttribute(jsObject: jsObject, name: "repeat") + _isComposing = ReadonlyAttribute(jsObject: jsObject, name: "isComposing") + _charCode = ReadonlyAttribute(jsObject: jsObject, name: "charCode") + _keyCode = ReadonlyAttribute(jsObject: jsObject, name: "keyCode") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: KeyboardEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + public static let DOM_KEY_LOCATION_STANDARD: Double = 0x00 + + public static let DOM_KEY_LOCATION_LEFT: Double = 0x01 + + public static let DOM_KEY_LOCATION_RIGHT: Double = 0x02 + + public static let DOM_KEY_LOCATION_NUMPAD: Double = 0x03 + + @ReadonlyAttribute + public var key: String + + @ReadonlyAttribute + public var code: String + + @ReadonlyAttribute + public var location: Double + + @ReadonlyAttribute + public var ctrlKey: Bool + + @ReadonlyAttribute + public var shiftKey: Bool + + @ReadonlyAttribute + public var altKey: Bool + + @ReadonlyAttribute + public var metaKey: Bool + + @ReadonlyAttribute + public var repeat: Bool + + @ReadonlyAttribute + public var isComposing: Bool + + public func getModifierState(keyArg: String) -> Bool { + jsObject["getModifierState"]!(keyArg.jsValue()).fromJSValue()! + } + + public func initKeyboardEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, keyArg: String? = nil, locationArg: Double? = nil, ctrlKey: Bool? = nil, altKey: Bool? = nil, shiftKey: Bool? = nil, metaKey: Bool? = nil) { + _ = jsObject["initKeyboardEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, keyArg?.jsValue() ?? .undefined, locationArg?.jsValue() ?? .undefined, ctrlKey?.jsValue() ?? .undefined, altKey?.jsValue() ?? .undefined, shiftKey?.jsValue() ?? .undefined, metaKey?.jsValue() ?? .undefined) + } + + @ReadonlyAttribute + public var charCode: Double + + @ReadonlyAttribute + public var keyCode: Double +} diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift new file mode 100644 index 00000000..1f429817 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -0,0 +1,65 @@ +import JavaScriptKit + +public class MouseEvent: UIEvent { + override public class var constructor: JSFunction { JSObject.global.MouseEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _screenX = ReadonlyAttribute(jsObject: jsObject, name: "screenX") + _screenY = ReadonlyAttribute(jsObject: jsObject, name: "screenY") + _clientX = ReadonlyAttribute(jsObject: jsObject, name: "clientX") + _clientY = ReadonlyAttribute(jsObject: jsObject, name: "clientY") + _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: "ctrlKey") + _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: "shiftKey") + _altKey = ReadonlyAttribute(jsObject: jsObject, name: "altKey") + _metaKey = ReadonlyAttribute(jsObject: jsObject, name: "metaKey") + _button = ReadonlyAttribute(jsObject: jsObject, name: "button") + _buttons = ReadonlyAttribute(jsObject: jsObject, name: "buttons") + _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: "relatedTarget") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: MouseEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var screenX: Double + + @ReadonlyAttribute + public var screenY: Double + + @ReadonlyAttribute + public var clientX: Double + + @ReadonlyAttribute + public var clientY: Double + + @ReadonlyAttribute + public var ctrlKey: Bool + + @ReadonlyAttribute + public var shiftKey: Bool + + @ReadonlyAttribute + public var altKey: Bool + + @ReadonlyAttribute + public var metaKey: Bool + + @ReadonlyAttribute + public var button: Double + + @ReadonlyAttribute + public var buttons: Double + + @ReadonlyAttribute + public var relatedTarget: EventTarget? + + public func getModifierState(keyArg: String) -> Bool { + jsObject["getModifierState"]!(keyArg.jsValue()).fromJSValue()! + } + + public func initMouseEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Double? = nil, screenXArg: Double? = nil, screenYArg: Double? = nil, clientXArg: Double? = nil, clientYArg: Double? = nil, ctrlKeyArg: Bool? = nil, altKeyArg: Bool? = nil, shiftKeyArg: Bool? = nil, metaKeyArg: Bool? = nil, buttonArg: Double? = nil, relatedTargetArg: EventTarget? = nil) { + _ = jsObject["initMouseEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined, screenXArg?.jsValue() ?? .undefined, screenYArg?.jsValue() ?? .undefined, clientXArg?.jsValue() ?? .undefined, clientYArg?.jsValue() ?? .undefined, ctrlKeyArg?.jsValue() ?? .undefined, altKeyArg?.jsValue() ?? .undefined, shiftKeyArg?.jsValue() ?? .undefined, metaKeyArg?.jsValue() ?? .undefined, buttonArg?.jsValue() ?? .undefined, relatedTargetArg?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift new file mode 100644 index 00000000..4eeb88ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -0,0 +1,39 @@ +import JavaScriptKit + +public class MutationEvent: Event { + override public class var constructor: JSFunction { JSObject.global.MutationEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _relatedNode = ReadonlyAttribute(jsObject: jsObject, name: "relatedNode") + _prevValue = ReadonlyAttribute(jsObject: jsObject, name: "prevValue") + _newValue = ReadonlyAttribute(jsObject: jsObject, name: "newValue") + _attrName = ReadonlyAttribute(jsObject: jsObject, name: "attrName") + _attrChange = ReadonlyAttribute(jsObject: jsObject, name: "attrChange") + super.init(unsafelyWrapping: jsObject) + } + + public static let MODIFICATION: Double = 1 + + public static let ADDITION: Double = 2 + + public static let REMOVAL: Double = 3 + + @ReadonlyAttribute + public var relatedNode: Node? + + @ReadonlyAttribute + public var prevValue: String + + @ReadonlyAttribute + public var newValue: String + + @ReadonlyAttribute + public var attrName: String + + @ReadonlyAttribute + public var attrChange: Double + + public func initMutationEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, relatedNodeArg: Node? = nil, prevValueArg: String? = nil, newValueArg: String? = nil, attrNameArg: String? = nil, attrChangeArg: Double? = nil) { + _ = jsObject["initMutationEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, relatedNodeArg?.jsValue() ?? .undefined, prevValueArg?.jsValue() ?? .undefined, newValueArg?.jsValue() ?? .undefined, attrNameArg?.jsValue() ?? .undefined, attrChangeArg?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/MutationObserverInit.swift b/Sources/DOMKit/WebIDL/MutationObserverInit.swift deleted file mode 100644 index 81f50906..00000000 --- a/Sources/DOMKit/WebIDL/MutationObserverInit.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct MutationObserverInit: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case childList, attributes, characterData, subtree, attributeOldValue, characterDataOldValue, attributeFilter - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/ShadowRootInit.swift b/Sources/DOMKit/WebIDL/ShadowRootInit.swift deleted file mode 100644 index 86cd543f..00000000 --- a/Sources/DOMKit/WebIDL/ShadowRootInit.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct ShadowRootInit: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case mode, delegatesFocus - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/StaticRangeInit.swift b/Sources/DOMKit/WebIDL/StaticRangeInit.swift deleted file mode 100644 index 90e7a402..00000000 --- a/Sources/DOMKit/WebIDL/StaticRangeInit.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct StaticRangeInit: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case startContainer, startOffset, endContainer, endOffset - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift new file mode 100644 index 00000000..f5e86846 --- /dev/null +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -0,0 +1,29 @@ +import JavaScriptKit + +public class UIEvent: Event { + override public class var constructor: JSFunction { JSObject.global.UIEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _view = ReadonlyAttribute(jsObject: jsObject, name: "view") + _detail = ReadonlyAttribute(jsObject: jsObject, name: "detail") + _which = ReadonlyAttribute(jsObject: jsObject, name: "which") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: UIEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var view: Window? + + @ReadonlyAttribute + public var detail: Double + + public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Double? = nil) { + _ = jsObject["initUIEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined) + } + + @ReadonlyAttribute + public var which: Double +} diff --git a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift deleted file mode 100644 index 8b507bc0..00000000 --- a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public struct ValidityStateFlags: ExpressibleByDictionaryLiteral, JSBridgedType { - public enum Key: String, Hashable { - case valueMissing, typeMismatch, patternMismatch, tooLong, tooShort, rangeUnderflow, rangeOverflow, stepMismatch, badInput, customError - } - - private let dictionary: [String: JSValue] - - public init(uniqueKeysWithValues elements: [(Key, ConvertibleToJSValue)]) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - public init(dictionaryLiteral elements: (Key, ConvertibleToJSValue)...) { - dictionary = Dictionary(uniqueKeysWithValues: elements.map { ($0.0.rawValue, $0.1.jsValue()) }) - } - - subscript(_ key: Key) -> JSValue? { - dictionary[key.rawValue] - } - - public init?(from value: JSValue) { - if let dictionary: [String: JSValue] = value.fromJSValue() { - self.dictionary = dictionary - } - return nil - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - return dictionary.jsValue() - } -} diff --git a/Sources/DOMKit/WebIDL/WheelEvent.swift b/Sources/DOMKit/WebIDL/WheelEvent.swift new file mode 100644 index 00000000..490be112 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WheelEvent.swift @@ -0,0 +1,35 @@ +import JavaScriptKit + +public class WheelEvent: MouseEvent { + override public class var constructor: JSFunction { JSObject.global.WheelEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _deltaX = ReadonlyAttribute(jsObject: jsObject, name: "deltaX") + _deltaY = ReadonlyAttribute(jsObject: jsObject, name: "deltaY") + _deltaZ = ReadonlyAttribute(jsObject: jsObject, name: "deltaZ") + _deltaMode = ReadonlyAttribute(jsObject: jsObject, name: "deltaMode") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: WheelEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + public static let DOM_DELTA_PIXEL: Double = 0x00 + + public static let DOM_DELTA_LINE: Double = 0x01 + + public static let DOM_DELTA_PAGE: Double = 0x02 + + @ReadonlyAttribute + public var deltaX: Double + + @ReadonlyAttribute + public var deltaY: Double + + @ReadonlyAttribute + public var deltaZ: Double + + @ReadonlyAttribute + public var deltaMode: Double +} diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index d9d7cc28..71063719 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -4,10 +4,10 @@ func merge(declarations: [IDLNode]) -> [DeclarationFile] { let byType: [String: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in partialResult[type(of: node).type, default: []].append(node) } - let byName: [String?: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in - let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String - partialResult[name, default: []].append(node) - } + // let byName: [String?: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in + // let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String + // partialResult[name, default: []].append(node) + // } // print(byName.filter { $0.value.count > 1 }.map { "\($0.key ?? ""): \($0.value.map { type(of: $0).type }))" }.joined(separator: "\n")) // ["interface mixin", "interface", "includes"] @@ -20,7 +20,9 @@ func merge(declarations: [IDLNode]) -> [DeclarationFile] { }, uniquingKeysWith: { MergedMixin(name: $0.name, members: $0.members + $1.members) }) - var merged = Dictionary(all(IDLInterface.self).map { + print("unhandled mixins", mixins.map(\.key)) + + var mergedInterfaces = Dictionary(all(IDLInterface.self).map { ($0.name, MergedInterface( name: $0.name, inheritance: [$0.inheritance].compactMap { $0 }, @@ -30,17 +32,25 @@ func merge(declarations: [IDLNode]) -> [DeclarationFile] { MergedInterface(name: $0.name, inheritance: $0.inheritance + $1.inheritance, members: $0.members + $1.members) }) + var mergedDictionaries = Dictionary(all(IDLDictionary.self).map { + ($0.name, MergedDictionary( + name: $0.name, + inheritance: [$0.inheritance].compactMap { $0 }, + members: $0.members + )) + }, uniquingKeysWith: { + MergedDictionary(name: $0.name, inheritance: $0.inheritance + $1.inheritance, members: $0.members + $1.members) + }) + print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) - return Array(merged.values) + return Array(mergedInterfaces.values) + [Typedefs(typedefs: all(IDLTypedef.self) + all(IDLCallback.self))] - + all(IDLDictionary.self) + all(IDLEnum.self) + all(IDLNamespace.self) } protocol DeclarationFile {} -extension IDLDictionary: DeclarationFile {} extension IDLEnum: DeclarationFile {} extension IDLNamespace: DeclarationFile {} @@ -49,6 +59,12 @@ struct MergedMixin { var members: [IDLInterfaceMixinMember] } +struct MergedDictionary: DeclarationFile { + let name: String + var inheritance: [String] + var members: [IDLDictionary.Member] +} + struct MergedInterface: DeclarationFile { let name: String var inheritance: [String] diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 3bd0e9ea..9f60df7c 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -54,8 +54,8 @@ extension IDLDictionary: SwiftRepresentable { public init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { let object = JSObject.global.Object.function!.new() \(lines: members.map { "object[\"\(raw: $0.name)\"] = \($0.name).jsValue()" }) + \(lines: members.map { "_\(raw: $0.name) = ReadWriteAttribute(jsObject: object, name: \"\(raw: $0.name)\")" }) super.init(cloning: object) - \(lines: members.map { "_\(raw: $0.name) = ReadWriteAttribute(jsObject: self, name: \"\(raw: $0.name)\")" }) } """ } From 139c4122f4f71ac76c3d39cc5bfed240828cbaea Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 21:35:34 -0400 Subject: [PATCH 024/124] try fix constructors --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 9f60df7c..932447e4 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -173,7 +173,10 @@ extension IDLConstructor: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { assert(!Context.static) let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") - let args = arguments.map(\.name.swiftRepresentation).joined(separator: ", ") + let args = arguments.map { + let conversion: SwiftSource = "\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" + return SwiftSource("\($0.name)\(conversion)") + }.joined(separator: ", ") return """ public convenience init(\(params)) { self.init(unsafelyWrapping: Self.constructor.new(\(args))) From e2f43ecf5926a2f4d5c4918adf00a743c45df8a9 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 21:35:41 -0400 Subject: [PATCH 025/124] add uievents --- Sources/WebIDLToSwift/main.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index b1bbcbc4..ffc0c734 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -6,7 +6,7 @@ do { let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) let declarations = [ "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", - "referrer-policy", + "referrer-policy", "uievents", ].flatMap { idl[$0]!.array } for (i, node) in merge(declarations: declarations).enumerated() { guard let name = Mirror(reflecting: node).children.first(where: { $0.label == "name" })?.value as? String else { From 9b318770550e046be436e11830ed73f4ee2f67d5 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 21:42:02 -0400 Subject: [PATCH 026/124] oops --- Sources/WebIDLToSwift/MergeDeclarations.swift | 2 +- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 71063719..4596cce3 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -43,7 +43,7 @@ func merge(declarations: [IDLNode]) -> [DeclarationFile] { }) print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) - return Array(mergedInterfaces.values) + return Array(mergedInterfaces.values) + Array(mergedDictionaries.values) + [Typedefs(typedefs: all(IDLTypedef.self) + all(IDLCallback.self))] + all(IDLEnum.self) + all(IDLNamespace.self) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 932447e4..eacf9f9c 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -39,7 +39,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { } } -extension IDLDictionary: SwiftRepresentable { +extension MergedDictionary: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ public class \(name): JSObject { From b3a61b5b54f6999cf2fdeb4fc001d3671f7e2b12 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 21:47:29 -0400 Subject: [PATCH 027/124] fancy number types --- .../WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index eacf9f9c..b7273f5e 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -285,14 +285,15 @@ let typeNameMap = [ "ByteString": "String", "object": "JSObject", "undefined": "Void", + "float": "Float", "double": "Double", "unrestricted double": "Double", - "unsigned short": "Double", - "unsigned long": "Double", - "unsigned long long": "Double", - "short": "Double", - "long": "Double", - "long long": "Double", + "unsigned short": "UInt16", + "unsigned long": "UInt32", + "unsigned long long": "UInt64", + "short": "Int16", + "long": "Int32", + "long long": "Int64", ] extension IDLType: SwiftRepresentable { From 3706967f8b03ce7f0a1621b992a5b8330547bbdc Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 22:41:38 -0400 Subject: [PATCH 028/124] correctly label class methods --- Sources/WebIDLToSwift/Context.swift | 4 +++- Sources/WebIDLToSwift/SwiftRepresentation.swift | 1 + Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index d4139dd1..c6106cd2 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -20,13 +20,15 @@ enum Context { struct State { private(set) var `static` = false + private(set) var inClass = false private(set) var constructor: SwiftSource! private(set) var this: SwiftSource! - static func `static`(this: SwiftSource) -> Self { + static func `static`(this: SwiftSource, inClass: Bool = Context.inClass) -> Self { var newState = Context.current newState.static = true newState.this = this + newState.inClass = inClass return newState } diff --git a/Sources/WebIDLToSwift/SwiftRepresentation.swift b/Sources/WebIDLToSwift/SwiftRepresentation.swift index b1eb71cd..e6413edb 100644 --- a/Sources/WebIDLToSwift/SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/SwiftRepresentation.swift @@ -27,6 +27,7 @@ let swiftKeywords: Set = [ "default", "defer", "self", + "repeat", ] extension String: SwiftRepresentable { diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index b7273f5e..3e28bd36 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -200,7 +200,7 @@ extension IDLIterableDeclaration: SwiftRepresentable, Initializable { extension IDLNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { let this: SwiftSource = "JSObject.global.\(name).object!" - let body = Context.withState(.static(this: this)) { + let body = Context.withState(.static(this: this, inClass: false)) { members.map(toSwift).joined(separator: "\n\n") } if partial { @@ -268,7 +268,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { body = "\(call).fromJSValue()!" } return """ - public\(raw: Context.static ? " static" : "") func \(name!)(\(params)) -> \(idlType!) { + public\(raw: Context.static ? (Context.inClass ? " class" : " static") : "") func \(name!)(\(params)) -> \(idlType!) { \(body) } """ From bcfa23053a6f6d45e376c81262d134c4f7e4a8a8 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 29 Mar 2022 22:54:33 -0400 Subject: [PATCH 029/124] Work around type checking slowness --- .../WebIDL+SwiftRepresentation.swift | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 3e28bd36..3145268d 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -253,22 +253,38 @@ extension IDLOperation: SwiftRepresentable, Initializable { private var defaultRepresentation: SwiftSource { let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") - let args = arguments.map { arg -> SwiftSource in - if arg.optional { - return "\(arg.name)?.jsValue() ?? .undefined" - } else { - return "\(arg.name).jsValue()" + let args: [SwiftSource] + let argsInit: [SwiftSource] + if arguments.count <= 5 { + args = arguments.map { arg in + if arg.optional { + return "\(arg.name)?.jsValue() ?? .undefined" + } else { + return "\(arg.name).jsValue()" + } } - }.joined(separator: ", ") - let call: SwiftSource = "\(Context.this)[\"\(raw: name!)\"]!(\(args))" + argsInit = [] + } else { + args = (0 ..< arguments.count).map { "_jskit\(String($0))" } + argsInit = arguments.enumerated().map { i, arg in + if arg.optional { + return "let _jskit\(String(i)) = \(arg.name)?.jsValue() ?? .undefined" + } else { + return "let _jskit\(String(i)) = \(arg.name).jsValue()" + } + } + } + let call: SwiftSource = "\(Context.this)[\"\(raw: name!)\"]!(\(args.joined(separator: ", ")))" let body: SwiftSource if idlType?.swiftRepresentation.source == "Void" { body = "_ = \(call)" } else { - body = "\(call).fromJSValue()!" + body = "return \(call).fromJSValue()!" } + let accessModifier = Context.static ? (Context.inClass ? " class" : " static") : "" return """ - public\(raw: Context.static ? (Context.inClass ? " class" : " static") : "") func \(name!)(\(params)) -> \(idlType!) { + public\(raw: accessModifier) func \(name!)(\(params)) -> \(idlType!) { + \(lines: argsInit) \(body) } """ From 82c358a8f4cfddf3148ae5f33a86b9ff2ae7af4b Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 07:32:51 -0400 Subject: [PATCH 030/124] Add IDLNamed protocol --- Sources/WebIDL/Argument.swift | 2 +- Sources/WebIDL/Attribute.swift | 2 +- Sources/WebIDL/Callback.swift | 2 +- Sources/WebIDL/Constant.swift | 2 +- Sources/WebIDL/Dictionary.swift | 4 ++-- Sources/WebIDL/Enum.swift | 2 +- Sources/WebIDL/ExtendedAttribute.swift | 2 +- Sources/WebIDL/Interface.swift | 2 +- Sources/WebIDL/InterfaceMixin.swift | 2 +- Sources/WebIDL/Namespace.swift | 2 +- Sources/WebIDL/Node.swift | 4 ++++ Sources/WebIDL/Operation.swift | 4 ++-- Sources/WebIDL/Typedef.swift | 2 +- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 4 ++-- 14 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Sources/WebIDL/Argument.swift b/Sources/WebIDL/Argument.swift index 22e477a7..e0daf363 100644 --- a/Sources/WebIDL/Argument.swift +++ b/Sources/WebIDL/Argument.swift @@ -1,5 +1,5 @@ /// https://github.com/w3c/webidl2.js/#arguments -public struct IDLArgument: IDLNode { +public struct IDLArgument: IDLNode, IDLNamed { public static let type = "argument" public let `default`: IDLValue? public let optional: Bool diff --git a/Sources/WebIDL/Attribute.swift b/Sources/WebIDL/Attribute.swift index eba5b42d..29f10b84 100644 --- a/Sources/WebIDL/Attribute.swift +++ b/Sources/WebIDL/Attribute.swift @@ -1,4 +1,4 @@ -public struct IDLAttribute: IDLNode { +public struct IDLAttribute: IDLNode, IDLNamed { public static let type = "attribute" public let name: String public let special: String diff --git a/Sources/WebIDL/Callback.swift b/Sources/WebIDL/Callback.swift index 17329403..db48a232 100644 --- a/Sources/WebIDL/Callback.swift +++ b/Sources/WebIDL/Callback.swift @@ -1,5 +1,5 @@ /// https://github.com/w3c/webidl2.js#callback -public struct IDLCallback: IDLNode { +public struct IDLCallback: IDLNode, IDLNamed { public static let type = "callback" public let name: String public let idlType: IDLType diff --git a/Sources/WebIDL/Constant.swift b/Sources/WebIDL/Constant.swift index 654bcbfe..900e3af3 100644 --- a/Sources/WebIDL/Constant.swift +++ b/Sources/WebIDL/Constant.swift @@ -1,4 +1,4 @@ -public struct IDLConstant: IDLNode { +public struct IDLConstant: IDLNode, IDLNamed { public static let type = "const" public let name: String public let idlType: IDLType diff --git a/Sources/WebIDL/Dictionary.swift b/Sources/WebIDL/Dictionary.swift index 037801f2..9c74a1d1 100644 --- a/Sources/WebIDL/Dictionary.swift +++ b/Sources/WebIDL/Dictionary.swift @@ -1,5 +1,5 @@ /// https://github.com/w3c/webidl2.js/#dictionary -public struct IDLDictionary: IDLNode { +public struct IDLDictionary: IDLNode, IDLNamed { public static let type = "dictionary" public let name: String public let partial: Bool @@ -7,7 +7,7 @@ public struct IDLDictionary: IDLNode { public let inheritance: String? public let extAttrs: [IDLExtendedAttribute] - public struct Member: IDLNode { + public struct Member: IDLNode, IDLNamed { public static let type = "field" public let name: String public let required: Bool diff --git a/Sources/WebIDL/Enum.swift b/Sources/WebIDL/Enum.swift index c422368f..e4e7dfad 100644 --- a/Sources/WebIDL/Enum.swift +++ b/Sources/WebIDL/Enum.swift @@ -1,4 +1,4 @@ -public struct IDLEnum: IDLNode { +public struct IDLEnum: IDLNode, IDLNamed { public static let type = "enum" public let name: String private let values: [Value] diff --git a/Sources/WebIDL/ExtendedAttribute.swift b/Sources/WebIDL/ExtendedAttribute.swift index a08e3d5a..ea1c1f0a 100644 --- a/Sources/WebIDL/ExtendedAttribute.swift +++ b/Sources/WebIDL/ExtendedAttribute.swift @@ -1,5 +1,5 @@ /// https://github.com/w3c/webidl2.js/#extended-attributes -public struct IDLExtendedAttribute: Decodable { +public struct IDLExtendedAttribute: Decodable, IDLNamed { public let name: String public let arguments: [IDLArgument] public let rhs: RHS? diff --git a/Sources/WebIDL/Interface.swift b/Sources/WebIDL/Interface.swift index 2f2058e8..9e1875be 100644 --- a/Sources/WebIDL/Interface.swift +++ b/Sources/WebIDL/Interface.swift @@ -1,5 +1,5 @@ /// https://github.com/w3c/webidl2.js#interface -public struct IDLInterface: IDLNode { +public struct IDLInterface: IDLNode, IDLNamed { public static let type = "interface" public let name: String public let partial: Bool diff --git a/Sources/WebIDL/InterfaceMixin.swift b/Sources/WebIDL/InterfaceMixin.swift index 4e1c7f7a..4b39285f 100644 --- a/Sources/WebIDL/InterfaceMixin.swift +++ b/Sources/WebIDL/InterfaceMixin.swift @@ -1,4 +1,4 @@ -public struct IDLInterfaceMixin: IDLNode { +public struct IDLInterfaceMixin: IDLNode, IDLNamed { public static let type = "interface mixin" public let name: String public let partial: Bool diff --git a/Sources/WebIDL/Namespace.swift b/Sources/WebIDL/Namespace.swift index 6632efed..763186b6 100644 --- a/Sources/WebIDL/Namespace.swift +++ b/Sources/WebIDL/Namespace.swift @@ -1,5 +1,5 @@ /// https://github.com/w3c/webidl2.js#namespace -public struct IDLNamespace: IDLNode { +public struct IDLNamespace: IDLNode, IDLNamed { public static let type = "namespace" public let name: String public let partial: Bool diff --git a/Sources/WebIDL/Node.swift b/Sources/WebIDL/Node.swift index 75cda9fa..614cb7fd 100644 --- a/Sources/WebIDL/Node.swift +++ b/Sources/WebIDL/Node.swift @@ -3,6 +3,10 @@ public protocol IDLNode: Decodable { var extAttrs: [IDLExtendedAttribute] { get } } +public protocol IDLNamed { + var name: String { get } +} + var idlTypes: [String: IDLNode.Type] = [ "argument": IDLArgument.self, "attribute": IDLAttribute.self, diff --git a/Sources/WebIDL/Operation.swift b/Sources/WebIDL/Operation.swift index 772ec43f..57201f40 100644 --- a/Sources/WebIDL/Operation.swift +++ b/Sources/WebIDL/Operation.swift @@ -1,8 +1,8 @@ -public struct IDLOperation: IDLNode { +public struct IDLOperation: IDLNode, IDLNamed { public static let type = "operation" public let special: String public let idlType: IDLType? - public let name: String? + public let name: String public let arguments: [IDLArgument] public let extAttrs: [IDLExtendedAttribute] } diff --git a/Sources/WebIDL/Typedef.swift b/Sources/WebIDL/Typedef.swift index fcabc823..b0e34288 100644 --- a/Sources/WebIDL/Typedef.swift +++ b/Sources/WebIDL/Typedef.swift @@ -1,4 +1,4 @@ -public struct IDLTypedef: IDLNode { +public struct IDLTypedef: IDLNode, IDLNamed { public static let type = "typedef" public let name: String public let idlType: IDLType diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 3145268d..c736d1c4 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -274,7 +274,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { } } } - let call: SwiftSource = "\(Context.this)[\"\(raw: name!)\"]!(\(args.joined(separator: ", ")))" + let call: SwiftSource = "\(Context.this)[\"\(raw: name)\"]!(\(args.joined(separator: ", ")))" let body: SwiftSource if idlType?.swiftRepresentation.source == "Void" { body = "_ = \(call)" @@ -283,7 +283,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { } let accessModifier = Context.static ? (Context.inClass ? " class" : " static") : "" return """ - public\(raw: accessModifier) func \(name!)(\(params)) -> \(idlType!) { + public\(raw: accessModifier) func \(name)(\(params)) -> \(idlType!) { \(lines: argsInit) \(body) } From fbda57ccc9cd67951feb3a411fdb199d1d7c46aa Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 07:38:45 -0400 Subject: [PATCH 031/124] Handle overridden declarations --- Sources/WebIDLToSwift/Context.swift | 14 +++++ Sources/WebIDLToSwift/MergeDeclarations.swift | 19 ++++--- .../WebIDL+SwiftRepresentation.swift | 56 +++++++++++++++---- Sources/WebIDLToSwift/main.swift | 7 ++- 4 files changed, 76 insertions(+), 20 deletions(-) diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index c6106cd2..104af834 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -23,6 +23,8 @@ enum Context { private(set) var inClass = false private(set) var constructor: SwiftSource! private(set) var this: SwiftSource! + private(set) var interfaces: [String: MergedInterface]! + private(set) var override = false static func `static`(this: SwiftSource, inClass: Bool = Context.inClass) -> Self { var newState = Context.current @@ -39,5 +41,17 @@ enum Context { newState.this = this return newState } + + static func override(_ isOverride: Bool) -> Self { + var newState = Context.current + newState.override = isOverride + return newState + } + + static func interfaces(_ interfaces: [String: MergedInterface]) -> Self { + var newState = Context.current + newState.interfaces = interfaces + return newState + } } } diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 4596cce3..2c5c3bf8 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -1,6 +1,6 @@ import WebIDL -func merge(declarations: [IDLNode]) -> [DeclarationFile] { +func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfaces: [String: MergedInterface]) { let byType: [String: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in partialResult[type(of: node).type, default: []].append(node) } @@ -8,7 +8,7 @@ func merge(declarations: [IDLNode]) -> [DeclarationFile] { // let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String // partialResult[name, default: []].append(node) // } -// print(byName.filter { $0.value.count > 1 }.map { "\($0.key ?? ""): \($0.value.map { type(of: $0).type }))" }.joined(separator: "\n")) + // print(byName.filter { $0.value.count > 1 }.map { "\($0.key ?? ""): \($0.value.map { type(of: $0).type }))" }.joined(separator: "\n")) // ["interface mixin", "interface", "includes"] func all(_: T.Type) -> [T] { @@ -22,7 +22,7 @@ func merge(declarations: [IDLNode]) -> [DeclarationFile] { }) print("unhandled mixins", mixins.map(\.key)) - var mergedInterfaces = Dictionary(all(IDLInterface.self).map { + let mergedInterfaces = Dictionary(all(IDLInterface.self).map { ($0.name, MergedInterface( name: $0.name, inheritance: [$0.inheritance].compactMap { $0 }, @@ -32,7 +32,7 @@ func merge(declarations: [IDLNode]) -> [DeclarationFile] { MergedInterface(name: $0.name, inheritance: $0.inheritance + $1.inheritance, members: $0.members + $1.members) }) - var mergedDictionaries = Dictionary(all(IDLDictionary.self).map { + let mergedDictionaries = Dictionary(all(IDLDictionary.self).map { ($0.name, MergedDictionary( name: $0.name, inheritance: [$0.inheritance].compactMap { $0 }, @@ -43,10 +43,13 @@ func merge(declarations: [IDLNode]) -> [DeclarationFile] { }) print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) - return Array(mergedInterfaces.values) + Array(mergedDictionaries.values) - + [Typedefs(typedefs: all(IDLTypedef.self) + all(IDLCallback.self))] - + all(IDLEnum.self) - + all(IDLNamespace.self) + return ( + Array(mergedInterfaces.values) + Array(mergedDictionaries.values) + + [Typedefs(typedefs: all(IDLTypedef.self) + all(IDLCallback.self))] + + all(IDLEnum.self) + + all(IDLNamespace.self), + mergedInterfaces + ) } protocol DeclarationFile {} diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index c736d1c4..99f4142d 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -16,7 +16,7 @@ extension IDLArgument: SwiftRepresentable { } extension IDLAttribute: SwiftRepresentable, Initializable { - var propertyWrapper: SwiftSource { + private var propertyWrapper: SwiftSource { if readonly { return "ReadonlyAttribute" } @@ -26,16 +26,32 @@ extension IDLAttribute: SwiftRepresentable, Initializable { return "ReadWriteAttribute" } + private var wrapperName: SwiftSource { + "_\(raw: name)" + } + var swiftRepresentation: SwiftSource { - """ - @\(propertyWrapper) - public\(raw: Context.static ? " static" : "") var \(name): \(idlType) - """ + assert(!Context.static) + if Context.override { + // can't do property wrappers on override declarations + return """ + private var \(wrapperName): \(propertyWrapper)<\(idlType)> + override public var \(name): \(idlType) { + get { \(wrapperName).wrappedValue } + set { \(wrapperName).wrappedValue = newValue } + } + """ + } else { + return """ + @\(propertyWrapper) + public var \(name): \(idlType) + """ + } } var initializer: SwiftSource? { assert(!Context.static) - return "_\(raw: name) = \(propertyWrapper)(jsObject: jsObject, name: \"\(raw: name)\")" + return "\(wrapperName) = \(propertyWrapper)(jsObject: jsObject, name: \"\(raw: name)\")" } } @@ -54,7 +70,11 @@ extension MergedDictionary: SwiftRepresentable { public init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { let object = JSObject.global.Object.function!.new() \(lines: members.map { "object[\"\(raw: $0.name)\"] = \($0.name).jsValue()" }) - \(lines: members.map { "_\(raw: $0.name) = ReadWriteAttribute(jsObject: object, name: \"\(raw: $0.name)\")" }) + \(lines: members.map { + """ + _\(raw: $0.name) = ReadWriteAttribute(jsObject: object, name: "\(raw: $0.name)") + """ + }) super.init(cloning: object) } """ @@ -114,7 +134,21 @@ extension MergedInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { let constructor: SwiftSource = "JSObject.global.\(name).function!" let body = Context.withState(.instance(constructor: constructor, this: "jsObject")) { - members.map(toSwift).joined(separator: "\n\n") + members.map { member in + let isOverride: Bool + if let memberName = (member as? IDLNamed)?.name { + isOverride = inheritance.flatMap { + Context.interfaces[$0]?.members ?? [] + }.contains { + memberName == ($0 as? IDLNamed)?.name + } + } else { + isOverride = false + } + return Context.withState(.override(isOverride)) { + toSwift(member) + } + }.joined(separator: "\n\n") } return """ @@ -228,6 +262,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { if special.isEmpty { return defaultRepresentation } else { + assert(!Context.static) switch special { case "stringifier": return """ @@ -281,9 +316,10 @@ extension IDLOperation: SwiftRepresentable, Initializable { } else { body = "return \(call).fromJSValue()!" } - let accessModifier = Context.static ? (Context.inClass ? " class" : " static") : "" + let accessModifier: SwiftSource = Context.static ? (Context.inClass ? " class" : " static") : "" + let overrideModifier: SwiftSource = Context.override ? "override " : "" return """ - public\(raw: accessModifier) func \(name)(\(params)) -> \(idlType!) { + \(overrideModifier)public\(accessModifier) func \(name)(\(params)) -> \(idlType!) { \(lines: argsInit) \(body) } diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index ffc0c734..75f132b0 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -8,11 +8,14 @@ do { "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", "referrer-policy", "uievents", ].flatMap { idl[$0]!.array } - for (i, node) in merge(declarations: declarations).enumerated() { + let merged = merge(declarations: declarations) + for (i, node) in merged.declarations.enumerated() { guard let name = Mirror(reflecting: node).children.first(where: { $0.label == "name" })?.value as? String else { fatalError("Cannot find name for \(node)") } - let content = toSwift(node).source + let content = Context.withState(.interfaces(merged.interfaces)) { + toSwift(node).source + } let path = "/Users/jed/Documents/github-clones/Tokamak/DOMKit/Sources/DOMKit/WebIDL/" + name + ".swift" if FileManager.default.fileExists(atPath: path) { fatalError("file already exists for \(name)") From 8a5586a9c57c236fe6a16103deec2189a417b771 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 07:45:49 -0400 Subject: [PATCH 032/124] use Self more, comment out static overrides --- Sources/WebIDLToSwift/Context.swift | 7 +++++-- Sources/WebIDLToSwift/SwiftSource.swift | 2 +- .../WebIDL+SwiftRepresentation.swift | 20 ++++++++++++++----- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index 104af834..a6ed53da 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -23,22 +23,25 @@ enum Context { private(set) var inClass = false private(set) var constructor: SwiftSource! private(set) var this: SwiftSource! + private(set) var className: SwiftSource! private(set) var interfaces: [String: MergedInterface]! private(set) var override = false - static func `static`(this: SwiftSource, inClass: Bool = Context.inClass) -> Self { + static func `static`(this: SwiftSource, inClass: Bool = Context.inClass, className: SwiftSource) -> Self { var newState = Context.current newState.static = true newState.this = this newState.inClass = inClass + newState.className = className return newState } - static func instance(constructor: SwiftSource, this: SwiftSource) -> Self { + static func instance(constructor: SwiftSource, this: SwiftSource, className: SwiftSource) -> Self { var newState = Context.current newState.static = false newState.constructor = constructor newState.this = this + newState.className = className return newState } diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift index 82373f21..e47f735c 100644 --- a/Sources/WebIDLToSwift/SwiftSource.swift +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -1,6 +1,6 @@ import Foundation -struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation { +struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation, Equatable { let source: String init(_ value: String) { diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 99f4142d..fc945be0 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -98,7 +98,7 @@ extension IDLEnum: SwiftRepresentable { "case \(name.camelized) = \"\(raw: name)\"" }) - public static func construct(from jsValue: JSValue) -> \(name)? { + public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.string { return Self(rawValue: string) } @@ -133,7 +133,7 @@ protocol Initializable { extension MergedInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { let constructor: SwiftSource = "JSObject.global.\(name).function!" - let body = Context.withState(.instance(constructor: constructor, this: "jsObject")) { + let body = Context.withState(.instance(constructor: constructor, this: "jsObject", className: "\(name)")) { members.map { member in let isOverride: Bool if let memberName = (member as? IDLNamed)?.name { @@ -234,7 +234,7 @@ extension IDLIterableDeclaration: SwiftRepresentable, Initializable { extension IDLNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { let this: SwiftSource = "JSObject.global.\(name).object!" - let body = Context.withState(.static(this: this, inClass: false)) { + let body = Context.withState(.static(this: this, inClass: false, className: "\(name)")) { members.map(toSwift).joined(separator: "\n\n") } if partial { @@ -271,7 +271,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { } """ case "static": - return Context.withState(.static(this: "constructor")) { + return Context.withState(.static(this: "constructor", className: Context.className)) { defaultRepresentation } case "getter": @@ -318,8 +318,18 @@ extension IDLOperation: SwiftRepresentable, Initializable { } let accessModifier: SwiftSource = Context.static ? (Context.inClass ? " class" : " static") : "" let overrideModifier: SwiftSource = Context.override ? "override " : "" + var returnType = idlType!.swiftRepresentation + if returnType == Context.className { + returnType = "Self" + } + if Context.override, Context.static { + return """ + // [illegal static override] + // func \(name)(\(params)) -> \(returnType) + """ + } return """ - \(overrideModifier)public\(accessModifier) func \(name)(\(params)) -> \(idlType!) { + \(overrideModifier)public\(accessModifier) func \(name)(\(params)) -> \(returnType) { \(lines: argsInit) \(body) } From d0194a4ff4f0a23c62b8d6d9e844432f1d8f7ca9 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 07:50:56 -0400 Subject: [PATCH 033/124] patches to Support.swift --- Sources/DOMKit/ECMAScript/Support.swift | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 45736af2..b5f5dbed 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -4,15 +4,10 @@ import JavaScriptKit -public extension Window { - public var document: Document { Document(unsafelyWrapping: jsObject.document.object!) } -} +/* TODO: fix this */ +public typealias __UNSUPPORTED_UNION__ = JSValue -public extension Document { - var body: HTMLElement { - .init(unsafelyWrapping: jsObject.body.object!) - } -} +public typealias WindowProxy = Window public extension HTMLElement { convenience init?(from element: Element) { @@ -38,6 +33,10 @@ public class ReadableStream: JSBridgedClass { } } +public class Uint8ClampedArray: JSTypedArray { + public static override var constructor: JSFunction { JSObject.global.Uint8ClampedArray.function! } +} + @propertyWrapper public final class OptionalClosureHandler where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { let jsObject: JSObject From e265f6c328df9b2d60165ac08e7c8c5d5ddafeb3 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 08:03:37 -0400 Subject: [PATCH 034/124] upstream Uint8ClampedArray, update JSClosure usage --- Sources/DOMKit/ECMAScript/Support.swift | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index b5f5dbed..f1afd246 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -33,11 +33,10 @@ public class ReadableStream: JSBridgedClass { } } -public class Uint8ClampedArray: JSTypedArray { - public static override var constructor: JSFunction { JSObject.global.Uint8ClampedArray.function! } -} -@propertyWrapper public final class OptionalClosureHandler +typealias Uint8ClampedArray = JSUInt8ClampedArray + +@propertyWrapper public final class OptionalClosureHandler where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { let jsObject: JSObject let name: String @@ -48,10 +47,6 @@ where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { self.name = name } - deinit { - closure?.release() - } - public var wrappedValue: ((ArgumentType) -> ReturnType)? { get { guard let function = jsObject[name].function else { @@ -60,15 +55,13 @@ where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { return { function($0.jsValue()).fromJSValue()! } } set { - if let closure = closure { - closure.release() - } if let newValue = newValue { let closure = JSClosure { newValue($0[0].fromJSValue()!).jsValue() } jsObject[name] = closure.jsValue() self.closure = closure } else { jsObject[name] = .null + self.closure = nil } } } From 8b141f5e773466782f1ec0aa4d0ed43fe8353c2a Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 08:40:07 -0400 Subject: [PATCH 035/124] manually remove problematic entities --- Sources/DOMKit/ECMAScript/Support.swift | 2 +- Sources/WebIDLToSwift/Context.swift | 4 +++- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 3 +++ Sources/WebIDLToSwift/main.swift | 10 +++++++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index f1afd246..c270f0f3 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -34,7 +34,7 @@ public class ReadableStream: JSBridgedClass { } -typealias Uint8ClampedArray = JSUInt8ClampedArray +public typealias Uint8ClampedArray = JSUInt8ClampedArray @propertyWrapper public final class OptionalClosureHandler where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index a6ed53da..675edfe6 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -25,6 +25,7 @@ enum Context { private(set) var this: SwiftSource! private(set) var className: SwiftSource! private(set) var interfaces: [String: MergedInterface]! + private(set) var ignored: [String: Set]! private(set) var override = false static func `static`(this: SwiftSource, inClass: Bool = Context.inClass, className: SwiftSource) -> Self { @@ -51,9 +52,10 @@ enum Context { return newState } - static func interfaces(_ interfaces: [String: MergedInterface]) -> Self { + static func root(interfaces: [String: MergedInterface], ignored: [String: Set]) -> Self { var newState = Context.current newState.interfaces = interfaces + newState.ignored = ignored return newState } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index fc945be0..294f9c96 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -137,6 +137,9 @@ extension MergedInterface: SwiftRepresentable { members.map { member in let isOverride: Bool if let memberName = (member as? IDLNamed)?.name { + if Context.ignored[name]?.contains(memberName) ?? false { + return "// [\(memberName) is ignored]" + } isOverride = inheritance.flatMap { Context.interfaces[$0]?.members ?? [] }.contains { diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 75f132b0..c572b334 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -1,6 +1,14 @@ import Foundation import WebIDL +let ignored: [String: Set] = [ + // unsupported function types + "HTMLCanvasElement": ["toBlob"], + "DataTransferItem": ["getAsString"], + "WorkerGlobalScope": ["onerror"], + "CustomElementRegistry": ["define"], +] + do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) @@ -13,7 +21,7 @@ do { guard let name = Mirror(reflecting: node).children.first(where: { $0.label == "name" })?.value as? String else { fatalError("Cannot find name for \(node)") } - let content = Context.withState(.interfaces(merged.interfaces)) { + let content = Context.withState(.root(interfaces: merged.interfaces, ignored: ignored)) { toSwift(node).source } let path = "/Users/jed/Documents/github-clones/Tokamak/DOMKit/Sources/DOMKit/WebIDL/" + name + ".swift" From ab42420bc28b1bd99bd431b77ba136ac2e66e8ab Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 10:13:10 -0400 Subject: [PATCH 036/124] print mixins --- Sources/WebIDL/InterfaceMixin.swift | 2 +- Sources/WebIDLToSwift/Context.swift | 2 +- Sources/WebIDLToSwift/MergeDeclarations.swift | 6 +++--- .../WebIDL+SwiftRepresentation.swift | 20 +++++++++---------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Sources/WebIDL/InterfaceMixin.swift b/Sources/WebIDL/InterfaceMixin.swift index 4b39285f..7bf257a6 100644 --- a/Sources/WebIDL/InterfaceMixin.swift +++ b/Sources/WebIDL/InterfaceMixin.swift @@ -6,7 +6,7 @@ public struct IDLInterfaceMixin: IDLNode, IDLNamed { public let extAttrs: [IDLExtendedAttribute] } -public protocol IDLInterfaceMixinMember: IDLNode {} +public protocol IDLInterfaceMixinMember: IDLNode, IDLNamed {} extension IDLAttribute: IDLInterfaceMixinMember {} extension IDLConstant: IDLInterfaceMixinMember {} extension IDLOperation: IDLInterfaceMixinMember {} diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index 675edfe6..b69aec1d 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -37,7 +37,7 @@ enum Context { return newState } - static func instance(constructor: SwiftSource, this: SwiftSource, className: SwiftSource) -> Self { + static func instance(constructor: SwiftSource!, this: SwiftSource, className: SwiftSource) -> Self { var newState = Context.current newState.static = false newState.constructor = constructor diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 2c5c3bf8..3bba9539 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -20,7 +20,6 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa }, uniquingKeysWith: { MergedMixin(name: $0.name, members: $0.members + $1.members) }) - print("unhandled mixins", mixins.map(\.key)) let mergedInterfaces = Dictionary(all(IDLInterface.self).map { ($0.name, MergedInterface( @@ -43,8 +42,9 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa }) print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) + let arrays: [DeclarationFile] = Array(mergedInterfaces.values) + Array(mergedDictionaries.values) + Array(mixins.values) return ( - Array(mergedInterfaces.values) + Array(mergedDictionaries.values) + arrays + [Typedefs(typedefs: all(IDLTypedef.self) + all(IDLCallback.self))] + all(IDLEnum.self) + all(IDLNamespace.self), @@ -57,7 +57,7 @@ protocol DeclarationFile {} extension IDLEnum: DeclarationFile {} extension IDLNamespace: DeclarationFile {} -struct MergedMixin { +struct MergedMixin: DeclarationFile { let name: String var members: [IDLInterfaceMixinMember] } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 294f9c96..64a5926a 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -181,18 +181,16 @@ extension MergedInterface: SwiftRepresentable { } } -extension IDLInterfaceMixin: SwiftRepresentable { +extension MergedMixin: SwiftRepresentable { var swiftRepresentation: SwiftSource { - // let this: SwiftSource = "JSObject.global.\(name).object!" - // let body = Context.withState(.static(this: this)) { - // members.map(toSwift).joined(separator: "\n\n") - // } - // return """ - // extension \(name) { - // \(body) - // } - // """ - "/* [unsupported interface mixin: \(name)] */" + Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name)")) { + """ + public protocol \(name): JSBridgedClass {} + public extension \(name) { + \(members.map(toSwift).joined(separator: "\n\n")) + } + """ + } } } From 6a8f02a998364b47693fea5604186416dbe63b63 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 10:36:18 -0400 Subject: [PATCH 037/124] add includes to the appropriate inheritances --- Sources/WebIDLToSwift/MergeDeclarations.swift | 85 +++++++++++++------ 1 file changed, 61 insertions(+), 24 deletions(-) diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 3bba9539..707da977 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -4,42 +4,79 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa let byType: [String: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in partialResult[type(of: node).type, default: []].append(node) } + + let missedTypes = Set(declarations.map { type(of: $0).type }) + .symmetricDifference([ + IDLInterfaceMixin.type, + IDLInterface.type, + IDLDictionary.type, + IDLCallbackInterface.type, + IDLIncludes.type, + IDLEnum.type, IDLNamespace.type, + IDLTypedef.type, IDLCallback.type, + ]) + if !missedTypes.isEmpty { + print("missed types!", missedTypes) + } // let byName: [String?: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in // let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String // partialResult[name, default: []].append(node) // } // print(byName.filter { $0.value.count > 1 }.map { "\($0.key ?? ""): \($0.value.map { type(of: $0).type }))" }.joined(separator: "\n")) - // ["interface mixin", "interface", "includes"] func all(_: T.Type) -> [T] { byType[T.type]!.map { $0 as! T } } - let mixins = Dictionary(all(IDLInterfaceMixin.self).map { - ($0.name, MergedMixin(name: $0.name, members: $0.members.array as! [IDLInterfaceMixinMember])) - }, uniquingKeysWith: { - MergedMixin(name: $0.name, members: $0.members + $1.members) - }) + let mixins = Dictionary( + grouping: all(IDLInterfaceMixin.self).map { + MergedMixin(name: $0.name, members: $0.members.array as! [IDLInterfaceMixinMember]) + }, + by: \.name + ).mapValues { + $0.dropFirst().reduce(into: $0.first!) { partialResult, mixin in + partialResult.members += mixin.members + } + } + + let includes = Dictionary(grouping: all(IDLIncludes.self)) { $0.target } + .mapValues { $0.map(\.includes) } - let mergedInterfaces = Dictionary(all(IDLInterface.self).map { - ($0.name, MergedInterface( - name: $0.name, - inheritance: [$0.inheritance].compactMap { $0 }, - members: $0.members.array as! [IDLInterfaceMember] - )) - }, uniquingKeysWith: { - MergedInterface(name: $0.name, inheritance: $0.inheritance + $1.inheritance, members: $0.members + $1.members) - }) + let mergedInterfaces = Dictionary( + grouping: all(IDLInterface.self).map { + MergedInterface( + name: $0.name, + inheritance: [$0.inheritance].compactMap { $0 }, + members: $0.members.array as! [IDLInterfaceMember] + ) + }, + by: \.name + ).mapValues { toMerge -> MergedInterface in + var interface = toMerge.dropFirst().reduce(into: toMerge.first!) { partialResult, interface in + partialResult.inheritance += interface.inheritance + partialResult.members += interface.members + } + interface.inheritance += includes[interface.name, default: []] + return interface + } - let mergedDictionaries = Dictionary(all(IDLDictionary.self).map { - ($0.name, MergedDictionary( - name: $0.name, - inheritance: [$0.inheritance].compactMap { $0 }, - members: $0.members - )) - }, uniquingKeysWith: { - MergedDictionary(name: $0.name, inheritance: $0.inheritance + $1.inheritance, members: $0.members + $1.members) - }) + let mergedDictionaries = Dictionary( + grouping: all(IDLDictionary.self).map { + MergedDictionary( + name: $0.name, + inheritance: [$0.inheritance].compactMap { $0 }, + members: $0.members + ) + }, + by: \.name + ).mapValues { toMerge -> MergedDictionary in + var dict = toMerge.dropFirst().reduce(into: toMerge.first!) { partialResult, interface in + partialResult.inheritance += interface.inheritance + partialResult.members += interface.members + } + dict.inheritance += includes[dict.name, default: []] + return dict + } print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) let arrays: [DeclarationFile] = Array(mergedInterfaces.values) + Array(mergedDictionaries.values) + Array(mixins.values) From 6667dcb2d327c3da1eb5994653e32c600b11e015 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 10:43:04 -0400 Subject: [PATCH 038/124] make ReadWriteAttribute, ReadonlyAttribute inlinable --- Sources/DOMKit/ECMAScript/Support.swift | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index c270f0f3..5ca6a9d4 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -18,7 +18,6 @@ public extension HTMLElement { public let globalThis = Window(from: JSObject.global.jsValue())! public class ReadableStream: JSBridgedClass { - public static var constructor: JSFunction { JSObject.global.ReadableStream.function! } public let jsObject: JSObject @@ -33,7 +32,6 @@ public class ReadableStream: JSBridgedClass { } } - public typealias Uint8ClampedArray = JSUInt8ClampedArray @propertyWrapper public final class OptionalClosureHandler @@ -77,18 +75,13 @@ where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { self.name = name } - public var wrappedValue: Wrapped { - get { - return jsObject[name].fromJSValue()! - } - set { - jsObject[name] = newValue.jsValue() - } + @inlinable public var wrappedValue: Wrapped { + get { jsObject[name].fromJSValue()! } + set { jsObject[name] = newValue.jsValue() } } } @propertyWrapper public struct ReadonlyAttribute { - let jsObject: JSObject let name: String @@ -97,15 +90,12 @@ where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { self.name = name } - public var wrappedValue: Wrapped { - get { - return jsObject[name].fromJSValue()! - } + @inlinable public var wrappedValue: Wrapped { + jsObject[name].fromJSValue()! } } public class ValueIterableIterator: IteratorProtocol where SequenceType.Element: ConstructibleFromJSValue { - private var index: Int = 0 private let sequence: SequenceType @@ -131,17 +121,15 @@ public protocol KeyValueSequence: Sequence where Element == (String, Value) { } public class PairIterableIterator: IteratorProtocol where SequenceType.Value: ConstructibleFromJSValue { - private let iterator: JSObject private let sequence: SequenceType public init(sequence: SequenceType) { self.sequence = sequence - self.iterator = sequence.jsObject.entries!().object! + iterator = sequence.jsObject.entries!().object! } public func next() -> SequenceType.Element? { - let next: JSObject = iterator.next!().object! guard next.done.boolean! == false else { From a1bc774b13cc8e81433e8750803335cf4e7bb9f0 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 10:43:21 -0400 Subject: [PATCH 039/124] Update OptionalClosureHandler based on new closure lifetimes --- Sources/DOMKit/ECMAScript/Support.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 5ca6a9d4..d3483eb9 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -35,17 +35,22 @@ public class ReadableStream: JSBridgedClass { public typealias Uint8ClampedArray = JSUInt8ClampedArray @propertyWrapper public final class OptionalClosureHandler -where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { + where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible +{ let jsObject: JSObject let name: String - var closure: JSClosure? public init(jsObject: JSObject, name: String) { self.jsObject = jsObject self.name = name } - public var wrappedValue: ((ArgumentType) -> ReturnType)? { + @inlinable public var wrappedValue: ((ArgumentType) -> ReturnType)? { + get { OptionalClosureHandler[name, in: jsObject] } + set { OptionalClosureHandler[name, in: jsObject] = newValue } + } + + @inlinable static subscript(name: String, in jsObject: JSObject) -> ((ArgumentType) -> ReturnType)? { get { guard let function = jsObject[name].function else { return nil @@ -56,17 +61,14 @@ where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { if let newValue = newValue { let closure = JSClosure { newValue($0[0].fromJSValue()!).jsValue() } jsObject[name] = closure.jsValue() - self.closure = closure } else { jsObject[name] = .null - self.closure = nil } } } } @propertyWrapper public struct ReadWriteAttribute { - let jsObject: JSObject let name: String From 0b034419b3dff8baaa95028d2c809de7a55539b6 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 10:49:46 -0400 Subject: [PATCH 040/124] fix inlinable, expand static subscripts --- Sources/DOMKit/ECMAScript/Support.swift | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index d3483eb9..76c33d22 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -37,8 +37,8 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray @propertyWrapper public final class OptionalClosureHandler where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { - let jsObject: JSObject - let name: String + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String public init(jsObject: JSObject, name: String) { self.jsObject = jsObject @@ -50,7 +50,7 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray set { OptionalClosureHandler[name, in: jsObject] = newValue } } - @inlinable static subscript(name: String, in jsObject: JSObject) -> ((ArgumentType) -> ReturnType)? { + @inlinable public static subscript(name: String, in jsObject: JSObject) -> ((ArgumentType) -> ReturnType)? { get { guard let function = jsObject[name].function else { return nil @@ -69,8 +69,8 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray } @propertyWrapper public struct ReadWriteAttribute { - let jsObject: JSObject - let name: String + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String public init(jsObject: JSObject, name: String) { self.jsObject = jsObject @@ -78,14 +78,19 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray } @inlinable public var wrappedValue: Wrapped { + get { ReadWriteAttribute[name, in: jsObject] } + set { ReadWriteAttribute[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, in jsObject: JSObject) -> Wrapped { get { jsObject[name].fromJSValue()! } set { jsObject[name] = newValue.jsValue() } } } @propertyWrapper public struct ReadonlyAttribute { - let jsObject: JSObject - let name: String + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String public init(jsObject: JSObject, name: String) { self.jsObject = jsObject @@ -93,6 +98,10 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray } @inlinable public var wrappedValue: Wrapped { + ReadonlyAttribute[name, in: jsObject] + } + + @inlinable public static subscript(name: String, in jsObject: JSObject) -> Wrapped { jsObject[name].fromJSValue()! } } From 843c5e130bfaa8a46d2e79316269c12d496622aa Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 10:50:02 -0400 Subject: [PATCH 041/124] fix wrapped properties on extensions --- Sources/WebIDLToSwift/Context.swift | 4 ++-- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index b69aec1d..5ef1360c 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -21,7 +21,7 @@ enum Context { struct State { private(set) var `static` = false private(set) var inClass = false - private(set) var constructor: SwiftSource! + private(set) var constructor: SwiftSource? private(set) var this: SwiftSource! private(set) var className: SwiftSource! private(set) var interfaces: [String: MergedInterface]! @@ -37,7 +37,7 @@ enum Context { return newState } - static func instance(constructor: SwiftSource!, this: SwiftSource, className: SwiftSource) -> Self { + static func instance(constructor: SwiftSource?, this: SwiftSource, className: SwiftSource) -> Self { var newState = Context.current newState.static = false newState.constructor = constructor diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 64a5926a..763a41fd 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -41,6 +41,14 @@ extension IDLAttribute: SwiftRepresentable, Initializable { set { \(wrapperName).wrappedValue = newValue } } """ + } else if Context.constructor == nil { + // can't do property wrappers on extensions + return """ + public var \(name): \(idlType) { + get { \(propertyWrapper)["\(raw: name)", in: jsObject] } + set { \(propertyWrapper)["\(raw: name)", in: jsObject] = newValue } + } + """ } else { return """ @\(propertyWrapper) From 41a5c247b328e753f0563d3224f8929419a7633f Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:04:39 -0400 Subject: [PATCH 042/124] more SwiftSource API --- Sources/WebIDLToSwift/SwiftSource.swift | 10 +++++ .../WebIDL+SwiftRepresentation.swift | 41 +++++++++---------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift index e47f735c..5f9285d1 100644 --- a/Sources/WebIDLToSwift/SwiftSource.swift +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -30,6 +30,7 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation, E output.reserveCapacity(literalCapacity * 2) } + mutating func appendLiteral(_ literal: String) { output += literal } @@ -38,10 +39,19 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation, E output += value } + mutating func appendInterpolation(_ source: SwiftSource) { + output += source.source + } + + @_disfavoredOverload mutating func appendInterpolation(_ value: T) { output += toSwift(value).source } + mutating func appendInterpolation(sequence values: [SwiftSource]) { + output += values.map(\.source).joined(separator: ", ") + } + mutating func appendInterpolation(lines values: [SwiftSource]) { output += values.map(\.source).joined(separator: "\n") } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 763a41fd..93789ca2 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -75,9 +75,13 @@ extension MergedDictionary: SwiftRepresentable { private var swiftInit: SwiftSource { """ - public init(\(members.map { SwiftSource("\($0.name): \($0.idlType)") }.joined(separator: ", "))) { + public init(\(sequence: members.map { "\($0.name): \($0.idlType)" })) { let object = JSObject.global.Object.function!.new() - \(lines: members.map { "object[\"\(raw: $0.name)\"] = \($0.name).jsValue()" }) + \(lines: members.map { + """ + object["\(raw: $0.name)"] = \($0.name).jsValue() + """ + }) \(lines: members.map { """ _\(raw: $0.name) = ReadWriteAttribute(jsObject: object, name: "\(raw: $0.name)") @@ -102,9 +106,7 @@ extension IDLEnum: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ public enum \(name): String, JSValueCompatible { - \(lines: cases.map { name -> SwiftSource in - "case \(name.camelized) = \"\(raw: name)\"" - }) + \(lines: cases.map { "case \($0.camelized) = \"\(raw: $0)\"" }) public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.string { @@ -121,9 +123,8 @@ extension IDLEnum: SwiftRepresentable { extension IDLCallback: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let args = arguments.map(\.idlType.swiftRepresentation).joined(separator: ", ") - return """ - public typealias \(name) = (\(args)) -> \(idlType) + """ + public typealias \(name) = (\(sequence: arguments.map(\.idlType.swiftRepresentation)) -> \(idlType) """ } } @@ -215,14 +216,12 @@ extension IDLConstant: SwiftRepresentable, Initializable { extension IDLConstructor: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { assert(!Context.static) - let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") - let args = arguments.map { - let conversion: SwiftSource = "\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" - return SwiftSource("\($0.name)\(conversion)") - }.joined(separator: ", ") + let args: [SwiftSource] = arguments.map { + "\($0.name)\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" + } return """ - public convenience init(\(params)) { - self.init(unsafelyWrapping: Self.constructor.new(\(args))) + public convenience init(\(sequence: arguments.map(\.swiftRepresentation))) { + self.init(unsafelyWrapping: Self.constructor.new(\(sequence: args))) } """ } @@ -296,7 +295,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { } private var defaultRepresentation: SwiftSource { - let params = arguments.map(\.swiftRepresentation).joined(separator: ", ") + let params = arguments.map(\.swiftRepresentation) let args: [SwiftSource] let argsInit: [SwiftSource] if arguments.count <= 5 { @@ -312,13 +311,13 @@ extension IDLOperation: SwiftRepresentable, Initializable { args = (0 ..< arguments.count).map { "_jskit\(String($0))" } argsInit = arguments.enumerated().map { i, arg in if arg.optional { - return "let _jskit\(String(i)) = \(arg.name)?.jsValue() ?? .undefined" + return "let _arg\(String(i)) = \(arg.name)?.jsValue() ?? .undefined" } else { - return "let _jskit\(String(i)) = \(arg.name).jsValue()" + return "let _arg\(String(i)) = \(arg.name).jsValue()" } } } - let call: SwiftSource = "\(Context.this)[\"\(raw: name)\"]!(\(args.joined(separator: ", ")))" + let call: SwiftSource = "\(Context.this)[\"\(raw: name)\"]!(\(sequence: args))" let body: SwiftSource if idlType?.swiftRepresentation.source == "Void" { body = "_ = \(call)" @@ -334,11 +333,11 @@ extension IDLOperation: SwiftRepresentable, Initializable { if Context.override, Context.static { return """ // [illegal static override] - // func \(name)(\(params)) -> \(returnType) + // func \(name)(\(sequence: params)) -> \(returnType) """ } return """ - \(overrideModifier)public\(accessModifier) func \(name)(\(params)) -> \(returnType) { + \(overrideModifier)public\(accessModifier) func \(name)(\(sequence: params)) -> \(returnType) { \(lines: argsInit) \(body) } From 77f2072302c75c7bd5e9ab0673319d0b52c3b589 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:04:51 -0400 Subject: [PATCH 043/124] fix readonly properties --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 93789ca2..daa70f75 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -38,7 +38,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { private var \(wrapperName): \(propertyWrapper)<\(idlType)> override public var \(name): \(idlType) { get { \(wrapperName).wrappedValue } - set { \(wrapperName).wrappedValue = newValue } + \(readonly ? "" : "set { \(wrapperName).wrappedValue = newValue }") } """ } else if Context.constructor == nil { @@ -46,7 +46,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { return """ public var \(name): \(idlType) { get { \(propertyWrapper)["\(raw: name)", in: jsObject] } - set { \(propertyWrapper)["\(raw: name)", in: jsObject] = newValue } + \(readonly ? "" : "set { \(propertyWrapper)[\"\(raw: name)\", in: jsObject] = newValue }") } """ } else { From 8d5bd84a8287bd7fecc4a2f3ba4da3ea0106a5b6 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:05:05 -0400 Subject: [PATCH 044/124] separate mixin and class inheritance --- Sources/WebIDLToSwift/MergeDeclarations.swift | 9 +++++---- .../WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 11 ++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 707da977..ca9375df 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -46,17 +46,17 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa grouping: all(IDLInterface.self).map { MergedInterface( name: $0.name, - inheritance: [$0.inheritance].compactMap { $0 }, + parentClasses: [$0.inheritance].compactMap { $0 }, members: $0.members.array as! [IDLInterfaceMember] ) }, by: \.name ).mapValues { toMerge -> MergedInterface in var interface = toMerge.dropFirst().reduce(into: toMerge.first!) { partialResult, interface in - partialResult.inheritance += interface.inheritance + partialResult.parentClasses += interface.parentClasses partialResult.members += interface.members } - interface.inheritance += includes[interface.name, default: []] + interface.mixins = includes[interface.name, default: []] return interface } @@ -107,7 +107,8 @@ struct MergedDictionary: DeclarationFile { struct MergedInterface: DeclarationFile { let name: String - var inheritance: [String] + var parentClasses: [String] + var mixins: [String] = [] var members: [IDLInterfaceMember] } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index daa70f75..c57f5433 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -149,7 +149,7 @@ extension MergedInterface: SwiftRepresentable { if Context.ignored[name]?.contains(memberName) ?? false { return "// [\(memberName) is ignored]" } - isOverride = inheritance.flatMap { + isOverride = parentClasses.flatMap { Context.interfaces[$0]?.members ?? [] }.contains { memberName == ($0 as? IDLNamed)?.name @@ -163,15 +163,16 @@ extension MergedInterface: SwiftRepresentable { }.joined(separator: "\n\n") } + let inheritance = (parentClasses.isEmpty ? ["JSBridgedClass"] : parentClasses) + mixins return """ - public class \(name): \(inheritance.isEmpty ? "JSBridgedClass" : inheritance.joined(separator: ", ")) { - public\(inheritance.isEmpty ? "" : " override") class var constructor: JSFunction { \(constructor) } + public class \(name): \(sequence: inheritance.map(SwiftSource.init(_:))) { + public\(parentClasses.isEmpty ? "" : " override") class var constructor: JSFunction { \(constructor) } - \(inheritance.isEmpty ? "public let jsObject: JSObject" : "") + \(parentClasses.isEmpty ? "public let jsObject: JSObject" : "") public required init(unsafelyWrapping jsObject: JSObject) { \(memberInits.joined(separator: "\n")) - \(inheritance.isEmpty ? "self.jsObject = jsObject" : "super.init(unsafelyWrapping: jsObject)") + \(parentClasses.isEmpty ? "self.jsObject = jsObject" : "super.init(unsafelyWrapping: jsObject)") } \(body) From 5c742647d1e5a77f968fa60cf8465821e4b2bca4 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:05:55 -0400 Subject: [PATCH 045/124] ) --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index c57f5433..7b01a127 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -124,7 +124,7 @@ extension IDLEnum: SwiftRepresentable { extension IDLCallback: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public typealias \(name) = (\(sequence: arguments.map(\.idlType.swiftRepresentation)) -> \(idlType) + public typealias \(name) = (\(sequence: arguments.map(\.idlType.swiftRepresentation))) -> \(idlType) """ } } From dd9cf5b4f8a20b40a6105fb072dfcd6e3b60e6c4 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:06:49 -0400 Subject: [PATCH 046/124] oops --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 7b01a127..a69e506c 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -309,7 +309,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { } argsInit = [] } else { - args = (0 ..< arguments.count).map { "_jskit\(String($0))" } + args = (0 ..< arguments.count).map { "_arg\(String($0))" } argsInit = arguments.enumerated().map { i, arg in if arg.optional { return "let _arg\(String(i)) = \(arg.name)?.jsValue() ?? .undefined" From 41b2fba5e997cdfeed41b70d964d71eb3d3a717b Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:14:47 -0400 Subject: [PATCH 047/124] fix some errors --- Sources/DOMKit/ECMAScript/Support.swift | 49 +++++++++++++++++-- .../WebIDL+SwiftRepresentation.swift | 7 ++- Sources/WebIDLToSwift/main.swift | 2 +- 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 76c33d22..95137ff6 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -34,7 +34,7 @@ public class ReadableStream: JSBridgedClass { public typealias Uint8ClampedArray = JSUInt8ClampedArray -@propertyWrapper public final class OptionalClosureHandler +@propertyWrapper public final class OptionalClosureAttribute where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible { @usableFromInline let jsObject: JSObject @@ -46,8 +46,8 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray } @inlinable public var wrappedValue: ((ArgumentType) -> ReturnType)? { - get { OptionalClosureHandler[name, in: jsObject] } - set { OptionalClosureHandler[name, in: jsObject] = newValue } + get { OptionalClosureAttribute[name, in: jsObject] } + set { OptionalClosureAttribute[name, in: jsObject] = newValue } } @inlinable public static subscript(name: String, in jsObject: JSObject) -> ((ArgumentType) -> ReturnType)? { @@ -68,6 +68,49 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray } } +/* variadic generics please */ +@propertyWrapper public final class OnErrorEventHandlerAttribute { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: ((JSValue, String, UInt32, UInt32, JSValue) -> JSValue)? { + get { OnErrorEventHandlerAttribute[name, in: jsObject] } + set { OnErrorEventHandlerAttribute[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, in jsObject: JSObject) + -> ((JSValue, String, UInt32, UInt32, JSValue) -> JSValue)? + { + get { + guard let function = jsObject[name].function else { + return nil + } + return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.fromJSValue()).fromJSValue()! } + } + set { + if let newValue = newValue { + let closure = JSClosure { + newValue( + $0[0].fromJSValue()!, + $0[1].fromJSValue()!, + $0[2].fromJSValue()!, + $0[3].fromJSValue()!, + $0[4].fromJSValue()! + ).jsValue() + } + jsObject[name] = closure.jsValue() + } else { + jsObject[name] = .null + } + } + } +} + @propertyWrapper public struct ReadWriteAttribute { @usableFromInline let jsObject: JSObject @usableFromInline let name: String diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index a69e506c..80d9b7bf 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -20,8 +20,11 @@ extension IDLAttribute: SwiftRepresentable, Initializable { if readonly { return "ReadonlyAttribute" } - if case let .single(name) = idlType.value, name == "EventHandler" { - return "OptionalClosureHandler" + if case let .single(name) = idlType.value, ["EventHandler", "OnBeforeUnloadEventHandler"].contains(name) { + return "OptionalClosureAttribute" + } + if case let .single(name) = idlType.value, name == "OnErrorEventHandler" { + return "OnErrorEventHandlerAttribute" } return "ReadWriteAttribute" } diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index c572b334..6fdc8b2e 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -14,7 +14,7 @@ do { let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) let declarations = [ "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", - "referrer-policy", "uievents", + "referrer-policy", "uievents", "wai-aria", ].flatMap { idl[$0]!.array } let merged = merge(declarations: declarations) for (i, node) in merged.declarations.enumerated() { From 7480bb04b2166cdea555075cd684df378d96fd71 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:34:53 -0400 Subject: [PATCH 048/124] more work --- Package.resolved | 2 +- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 3 ++- Sources/WebIDLToSwift/main.swift | 8 ++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Package.resolved b/Package.resolved index a3354bea..abe1656c 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { "branch": "jed/open-object", - "revision": "0f9b0fbfb4004cbfb335a81416bd6658ece750c7", + "revision": "40178501fc7a153e38268ac8025c541510a22881", "version": null } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 80d9b7bf..fab40aa6 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -356,6 +356,7 @@ let typeNameMap = [ "any": "JSValue", "DOMString": "String", "USVString": "String", + "CSSOMString": "String", "ByteString": "String", "object": "JSObject", "undefined": "Void", @@ -384,7 +385,7 @@ extension IDLType: SwiftRepresentable { switch name { case "sequence": return "[\(args[0])]" - case "FrozenArray": + case "FrozenArray", "ObservableArray": // ??? return "[\(args[0])]" case "Promise": diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 6fdc8b2e..068a741b 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -1,12 +1,8 @@ import Foundation import WebIDL -let ignored: [String: Set] = [ +let ignored: [String: Set] = [: // unsupported function types - "HTMLCanvasElement": ["toBlob"], - "DataTransferItem": ["getAsString"], - "WorkerGlobalScope": ["onerror"], - "CustomElementRegistry": ["define"], ] do { @@ -14,7 +10,7 @@ do { let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) let declarations = [ "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", - "referrer-policy", "uievents", "wai-aria", + "referrer-policy", "uievents", "wai-aria", "cssom", ].flatMap { idl[$0]!.array } let merged = merge(declarations: declarations) for (i, node) in merged.declarations.enumerated() { From b0a7b2f3ff2353d1f3f6dc1b771f572a67f87d1c Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:36:38 -0400 Subject: [PATCH 049/124] fix typo --- Sources/DOMKit/ECMAScript/Support.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 95137ff6..3d8080a6 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -90,7 +90,7 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray guard let function = jsObject[name].function else { return nil } - return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.fromJSValue()).fromJSValue()! } + return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } } set { if let newValue = newValue { From b2e175526aee37bf984970e574fd0677844a177d Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:50:08 -0400 Subject: [PATCH 050/124] BUILD PASSES --- .../WebIDL+SwiftRepresentation.swift | 18 +++++++++++++++++- Sources/WebIDLToSwift/main.swift | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index fab40aa6..ff6a859e 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -184,7 +184,15 @@ extension MergedInterface: SwiftRepresentable { } var memberInits: [SwiftSource] { - members.compactMap { + members.filter { member in + if let ignored = Context.ignored[name], + let memberName = (member as? IDLNamed)?.name + { + return !ignored.contains(memberName) + } else { + return true + } + }.compactMap { if let alt = $0 as? Initializable { return alt.initializer } else { @@ -220,6 +228,9 @@ extension IDLConstant: SwiftRepresentable, Initializable { extension IDLConstructor: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { assert(!Context.static) + if Context.ignored[Context.className.source]?.contains("") ?? false { + return "// [constructor ignored]" + } let args: [SwiftSource] = arguments.map { "\($0.name)\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" } @@ -271,6 +282,11 @@ extension IDLNamespace: SwiftRepresentable { extension IDLOperation: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { + if Context.ignored[Context.className.source]?.contains(name) ?? false { + return """ + // [\(name) is ignored] + """ + } if special.isEmpty { return defaultRepresentation } else { diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 068a741b..905a258b 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -1,8 +1,23 @@ import Foundation import WebIDL -let ignored: [String: Set] = [: - // unsupported function types +let ignored: [String: Set] = [ + // functions as parameters are unsupported + "EventTarget": ["addEventListener", "removeEventListener"], + "HTMLCanvasElement": ["toBlob"], + "AnimationFrameProvider": ["requestAnimationFrame"], + "DataTransferItem": ["getAsString"], + "WindowOrWorkerGlobalScope": ["queueMicrotask"], + "MutationObserver": [""], + "CustomElementRegistry": ["define"], + // NodeFilter + "Document": ["createNodeIterator", "createTreeWalker"], + "TreeWalker": ["filter"], + "NodeIterator": ["filter"], + // invalid overload in Swift + "BeforeUnloadEvent": ["returnValue"], + // XPathNSResolver + "XPathEvaluatorBase": ["createExpression", "createNSResolver", "evaluate"], ] do { From 66bb9494f7a83877d074b65499d72197f4d85eb9 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 11:55:45 -0400 Subject: [PATCH 051/124] add comment that the code was generated --- Sources/WebIDLToSwift/main.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 905a258b..1fac4fc3 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -39,7 +39,7 @@ do { if FileManager.default.fileExists(atPath: path) { fatalError("file already exists for \(name)") } else { - try ("import JavaScriptKit\n\n" + content).write(toFile: path, atomically: true, encoding: .utf8) + try ("// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!\n\nimport JavaScriptKit\n\n" + content).write(toFile: path, atomically: true, encoding: .utf8) } } // for (name, nodes) in idl { From b8c1bb2c3cf4f5af4b0ce1d26ebfc15b07c123ce Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 12:04:59 -0400 Subject: [PATCH 052/124] add iterable support --- Sources/WebIDLToSwift/MergeDeclarations.swift | 3 +++ Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index ca9375df..574b1617 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -57,6 +57,9 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa partialResult.members += interface.members } interface.mixins = includes[interface.name, default: []] + if interface.members.contains(where: { $0 is IDLIterableDeclaration }) { + interface.mixins.append("Sequence") + } return interface } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index ff6a859e..e2d78508 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -246,8 +246,12 @@ extension IDLConstructor: SwiftRepresentable, Initializable { extension IDLIterableDeclaration: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { - """ - /* [make me iterable plz] */ + assert(!async) + return """ + public typealias Element = \(idlType[0]) + public func makeIterator() -> ValueIterableIterator<\(Context.className)> { + ValueIterableIterator(sequence: self) + } """ } From e77a9ebde670cae3020214da85531f60e6077871 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 12:08:21 -0400 Subject: [PATCH 053/124] consistent syntax for removed code --- .../WebIDL+SwiftRepresentation.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index e2d78508..d8bbd859 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -134,7 +134,7 @@ extension IDLCallback: SwiftRepresentable { extension IDLCallbackInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { - "/* [unsupported callback interface: \(name)] */" + "// XXX: unsupported callback interface: \(name)" } } @@ -150,7 +150,7 @@ extension MergedInterface: SwiftRepresentable { let isOverride: Bool if let memberName = (member as? IDLNamed)?.name { if Context.ignored[name]?.contains(memberName) ?? false { - return "// [\(memberName) is ignored]" + return "// XXX: member '\(memberName)' is ignored" } isOverride = parentClasses.flatMap { Context.interfaces[$0]?.members ?? [] @@ -229,7 +229,7 @@ extension IDLConstructor: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { assert(!Context.static) if Context.ignored[Context.className.source]?.contains("") ?? false { - return "// [constructor ignored]" + return "// XXX: constructor is ignored" } let args: [SwiftSource] = arguments.map { "\($0.name)\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" @@ -288,7 +288,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { if Context.ignored[Context.className.source]?.contains(name) ?? false { return """ - // [\(name) is ignored] + // XXX: method '\(name)' is ignored """ } if special.isEmpty { @@ -307,11 +307,11 @@ extension IDLOperation: SwiftRepresentable, Initializable { defaultRepresentation } case "getter": - return "/* unsupported getter for keys of type \(arguments[0].idlType.swiftRepresentation.source) */" + return "// XXX: unsupported getter for keys of type \(arguments[0].idlType.swiftRepresentation.source)" case "setter": - return "/* unsupported setter for keys of type \(arguments[0].idlType.swiftRepresentation.source) */" + return "// XXX: unsupported setter for keys of type \(arguments[0].idlType.swiftRepresentation.source)" case "deleter": - return "/* unsupported deleter for keys of type \(arguments[0].idlType.swiftRepresentation.source) */" + return "// XXX: unsupported deleter for keys of type \(arguments[0].idlType.swiftRepresentation.source)" default: fatalError("Unsupported special operation \(special)") } @@ -356,7 +356,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { } if Context.override, Context.static { return """ - // [illegal static override] + // XXX: illegal static override // func \(name)(\(sequence: params)) -> \(returnType) """ } @@ -426,7 +426,7 @@ extension IDLType: SwiftRepresentable { return "\(name)" } case let .union(types): - // print("union", types) + print("union", types.count) return "__UNSUPPORTED_UNION__" } } From 5bd89f6512e2892d70f0bac0559b2c41a31a080d Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 12:55:22 -0400 Subject: [PATCH 054/124] Add getter support --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index d8bbd859..a7ffbdf9 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -307,7 +307,15 @@ extension IDLOperation: SwiftRepresentable, Initializable { defaultRepresentation } case "getter": - return "// XXX: unsupported getter for keys of type \(arguments[0].idlType.swiftRepresentation.source)" + var keyType = toSwift(arguments[0].idlType) + if keyType == "UInt32" { + keyType = "Int" + } + return """ + public subscript(key: \(keyType)) -> \(idlType!) { + jsObject[key].fromJSValue()\(idlType!.nullable ? "" : "!") + } + """ case "setter": return "// XXX: unsupported setter for keys of type \(arguments[0].idlType.swiftRepresentation.source)" case "deleter": From 20fd4122a209b3d707e0e648787584e60c562b0d Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 13:04:01 -0400 Subject: [PATCH 055/124] merge namespaces too --- Sources/WebIDLToSwift/MergeDeclarations.swift | 26 ++++++++++++++++--- .../WebIDL+SwiftRepresentation.swift | 22 +++++----------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 574b1617..951479a7 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -81,13 +81,27 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa return dict } + let mergedNamespaces = Dictionary( + grouping: all(IDLNamespace.self).map { + MergedNamespace(name: $0.name, members: $0.members.array as! [IDLNamespaceMember]) + }, + by: \.name + ).mapValues { + $0.dropFirst().reduce(into: $0.first!) { partialResult, namespace in + partialResult.members += namespace.members + } + } + print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) - let arrays: [DeclarationFile] = Array(mergedInterfaces.values) + Array(mergedDictionaries.values) + Array(mixins.values) + let arrays: [DeclarationFile] = + Array(mergedInterfaces.values) + + Array(mergedDictionaries.values) + + Array(mixins.values) + + Array(mergedNamespaces.values) return ( arrays + [Typedefs(typedefs: all(IDLTypedef.self) + all(IDLCallback.self))] - + all(IDLEnum.self) - + all(IDLNamespace.self), + + all(IDLEnum.self), mergedInterfaces ) } @@ -95,7 +109,11 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa protocol DeclarationFile {} extension IDLEnum: DeclarationFile {} -extension IDLNamespace: DeclarationFile {} + +struct MergedNamespace: DeclarationFile { + let name: String + var members: [IDLNamespaceMember] +} struct MergedMixin: DeclarationFile { let name: String diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index a7ffbdf9..5a084590 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -258,29 +258,21 @@ extension IDLIterableDeclaration: SwiftRepresentable, Initializable { var initializer: SwiftSource? { nil } } -extension IDLNamespace: SwiftRepresentable { +extension MergedNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { let this: SwiftSource = "JSObject.global.\(name).object!" let body = Context.withState(.static(this: this, inClass: false, className: "\(name)")) { members.map(toSwift).joined(separator: "\n\n") } - if partial { - return """ - public extension \(name) { - \(body) + return """ + public enum \(name) { + public static var jsObject: JSObject { + \(this) } - """ - } else { - return """ - public enum \(name) { - public static var jsObject: JSObject { - \(this) - } - \(body) - } - """ + \(body) } + """ } } From 8a2073e3e81c345da3da46b8931e8edf811b34b5 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 13:19:48 -0400 Subject: [PATCH 056/124] pretend to support async iterators --- Sources/WebIDLToSwift/MergeDeclarations.swift | 4 ++-- .../WebIDL+SwiftRepresentation.swift | 20 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 951479a7..3b4466e0 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -57,8 +57,8 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa partialResult.members += interface.members } interface.mixins = includes[interface.name, default: []] - if interface.members.contains(where: { $0 is IDLIterableDeclaration }) { - interface.mixins.append("Sequence") + if let decl = interface.members.first(where: { $0 is IDLIterableDeclaration }) as? IDLIterableDeclaration { + interface.mixins.append(decl.async ? "AsyncSequence" : "Sequence") } return interface } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 5a084590..5cd7c6ca 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -246,13 +246,21 @@ extension IDLConstructor: SwiftRepresentable, Initializable { extension IDLIterableDeclaration: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { - assert(!async) - return """ - public typealias Element = \(idlType[0]) - public func makeIterator() -> ValueIterableIterator<\(Context.className)> { - ValueIterableIterator(sequence: self) + if async { + return """ + public typealias Element = \(idlType[0]) + public func makeAsyncIterator() -> ValueIterableAsyncIterator<\(Context.className)> { + ValueIterableAsyncIterator(sequence: self) + } + """ + } else { + return """ + public typealias Element = \(idlType[0]) + public func makeIterator() -> ValueIterableIterator<\(Context.className)> { + ValueIterableIterator(sequence: self) + } + """ } - """ } var initializer: SwiftSource? { nil } From d4384f94b2bde41aa36769e6689f86b4b9302a59 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 14:19:04 -0400 Subject: [PATCH 057/124] generate async functions --- Sources/WebIDLToSwift/MergeDeclarations.swift | 38 ++++++++- .../WebIDL+SwiftRepresentation.swift | 81 +++++++++++++++---- Sources/WebIDLToSwift/main.swift | 10 ++- 3 files changed, 110 insertions(+), 19 deletions(-) diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 3b4466e0..2f58b524 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -1,5 +1,17 @@ import WebIDL +func addAsync(_ members: [IDLNode]) -> [IDLNode] { + members.flatMap { member -> [IDLNode] in + if let operation = member as? IDLOperation, + case .generic("Promise", _) = operation.idlType?.value + { + return [member, AsyncOperation(operation: operation)] + } else { + return [member] + } + } +} + func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfaces: [String: MergedInterface]) { let byType: [String: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in partialResult[type(of: node).type, default: []].append(node) @@ -30,7 +42,10 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa let mixins = Dictionary( grouping: all(IDLInterfaceMixin.self).map { - MergedMixin(name: $0.name, members: $0.members.array as! [IDLInterfaceMixinMember]) + MergedMixin( + name: $0.name, + members: addAsync($0.members.array) as! [IDLInterfaceMixinMember] + ) }, by: \.name ).mapValues { @@ -47,7 +62,7 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa MergedInterface( name: $0.name, parentClasses: [$0.inheritance].compactMap { $0 }, - members: $0.members.array as! [IDLInterfaceMember] + members: addAsync($0.members.array) as! [IDLInterfaceMember] ) }, by: \.name @@ -83,7 +98,10 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa let mergedNamespaces = Dictionary( grouping: all(IDLNamespace.self).map { - MergedNamespace(name: $0.name, members: $0.members.array as! [IDLNamespaceMember]) + MergedNamespace( + name: $0.name, + members: addAsync($0.members.array) as! [IDLNamespaceMember] + ) }, by: \.name ).mapValues { @@ -110,6 +128,20 @@ protocol DeclarationFile {} extension IDLEnum: DeclarationFile {} +struct AsyncOperation: IDLNode, IDLNamespaceMember, IDLInterfaceMember, IDLInterfaceMixinMember, IDLNamed { + static var type: String { "" } + var extAttrs: [IDLExtendedAttribute] { operation.extAttrs } + var name: String { operation.name } + let operation: IDLOperation + var returnType: IDLType { + guard case let .generic("Promise", values) = operation.idlType?.value else { + print(operation) + fatalError("Return type of async function \(name) is not a Promise") + } + return values.first! + } +} + struct MergedNamespace: DeclarationFile { let name: String var members: [IDLNamespaceMember] diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 5cd7c6ca..5dcb5009 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -249,6 +249,7 @@ extension IDLIterableDeclaration: SwiftRepresentable, Initializable { if async { return """ public typealias Element = \(idlType[0]) + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public func makeAsyncIterator() -> ValueIterableAsyncIterator<\(Context.className)> { ValueIterableAsyncIterator(sequence: self) } @@ -326,10 +327,9 @@ extension IDLOperation: SwiftRepresentable, Initializable { } } - private var defaultRepresentation: SwiftSource { - let params = arguments.map(\.swiftRepresentation) + fileprivate var defaultBody: (prep: SwiftSource, call: SwiftSource) { let args: [SwiftSource] - let argsInit: [SwiftSource] + let prep: [SwiftSource] if arguments.count <= 5 { args = arguments.map { arg in if arg.optional { @@ -338,10 +338,10 @@ extension IDLOperation: SwiftRepresentable, Initializable { return "\(arg.name).jsValue()" } } - argsInit = [] + prep = [] } else { args = (0 ..< arguments.count).map { "_arg\(String($0))" } - argsInit = arguments.enumerated().map { i, arg in + prep = arguments.enumerated().map { i, arg in if arg.optional { return "let _arg\(String(i)) = \(arg.name)?.jsValue() ?? .undefined" } else { @@ -349,15 +349,22 @@ extension IDLOperation: SwiftRepresentable, Initializable { } } } - let call: SwiftSource = "\(Context.this)[\"\(raw: name)\"]!(\(sequence: args))" - let body: SwiftSource - if idlType?.swiftRepresentation.source == "Void" { - body = "_ = \(call)" - } else { - body = "return \(call).fromJSValue()!" - } + + return ( + prep: "\(lines: prep)", + call: "\(Context.this)[\"\(raw: name)\"]!(\(sequence: args))" + ) + } + + fileprivate var nameAndParams: SwiftSource { let accessModifier: SwiftSource = Context.static ? (Context.inClass ? " class" : " static") : "" let overrideModifier: SwiftSource = Context.override ? "override " : "" + return """ + \(overrideModifier)public\(accessModifier) func \(name)(\(sequence: arguments.map(\.swiftRepresentation))) + """ + } + + private var defaultRepresentation: SwiftSource { var returnType = idlType!.swiftRepresentation if returnType == Context.className { returnType = "Self" @@ -365,12 +372,22 @@ extension IDLOperation: SwiftRepresentable, Initializable { if Context.override, Context.static { return """ // XXX: illegal static override - // func \(name)(\(sequence: params)) -> \(returnType) + // \(nameAndParams) -> \(returnType) """ } + + let (prep, call) = defaultBody + + let body: SwiftSource + if idlType?.swiftRepresentation.source == "Void" { + body = "_ = \(call)" + } else { + body = "return \(call).fromJSValue()!" + } + return """ - \(overrideModifier)public\(accessModifier) func \(name)(\(sequence: params)) -> \(returnType) { - \(lines: argsInit) + \(nameAndParams) -> \(returnType) { + \(prep) \(body) } """ @@ -379,6 +396,40 @@ extension IDLOperation: SwiftRepresentable, Initializable { var initializer: SwiftSource? { nil } } +extension AsyncOperation: SwiftRepresentable, Initializable { + var swiftRepresentation: SwiftSource { + if Context.ignored[Context.className.source]?.contains(name) ?? false { + // covered by non-async operation + return "" + } + assert(operation.special.isEmpty) + if Context.override, Context.static { + return """ + // XXX: illegal static override + // \(operation.nameAndParams) async -> \(returnType) + """ + } + + let (prep, call) = operation.defaultBody + let result: SwiftSource + if returnType.swiftRepresentation.source == "Void" { + result = "_ = try await _promise.value" + } else { + result = "return try await _promise.value.fromJSValue()!" + } + return """ + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + \(operation.nameAndParams) async throws -> \(returnType) { + \(prep) + let _promise: JSPromise = \(call).fromJSValue()! + \(result) + } + """ + } + + var initializer: SwiftSource? { nil } +} + let typeNameMap = [ "boolean": "Bool", "any": "JSValue", diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 1fac4fc3..fb10df65 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -20,6 +20,14 @@ let ignored: [String: Set] = [ "XPathEvaluatorBase": ["createExpression", "createNSResolver", "evaluate"], ] +let preamble = """ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptKit +import JavaScriptEventLoop +\n +""" + do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) @@ -39,7 +47,7 @@ do { if FileManager.default.fileExists(atPath: path) { fatalError("file already exists for \(name)") } else { - try ("// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!\n\nimport JavaScriptKit\n\n" + content).write(toFile: path, atomically: true, encoding: .utf8) + try (preamble + content).write(toFile: path, atomically: true, encoding: .utf8) } } // for (name, nodes) in idl { From 9d72d1b1a2a4a428050ebdc6ece32dbcfdf1e470 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 14:19:10 -0400 Subject: [PATCH 058/124] add more specs --- Sources/WebIDLToSwift/main.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index fb10df65..0fececa7 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -33,7 +33,7 @@ do { let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) let declarations = [ "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", - "referrer-policy", "uievents", "wai-aria", "cssom", + "referrer-policy", "uievents", "wai-aria", "cssom", "css-conditional", "streams", ].flatMap { idl[$0]!.array } let merged = merge(declarations: declarations) for (i, node) in merged.declarations.enumerated() { From b4dec820d4b40997f38086d2d3fb84061db52a30 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 14:19:16 -0400 Subject: [PATCH 059/124] Update Package.swift --- Package.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index b6624ace..dd2a82b9 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,6 @@ let package = Package( ], dependencies: [ .package( - name: "JavaScriptKit", url: "https://github.com/swiftwasm/JavaScriptKit.git", .branch("jed/open-object")), ], @@ -28,7 +27,7 @@ let package = Package( ), .target( name: "DOMKit", - dependencies: ["JavaScriptKit"]), + dependencies: ["JavaScriptKit", .product(name: "JavaScriptEventLoop", package: "JavaScriptKit")]), .target(name: "WebIDL"), .target( name: "WebIDLToSwift", From ce19248cb02a8cd2b8254f0273d7c70cfb2b89e4 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 14:20:00 -0400 Subject: [PATCH 060/124] drop custom ReadableStream --- Sources/DOMKit/ECMAScript/Support.swift | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 3d8080a6..28fbdf38 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -17,21 +17,6 @@ public extension HTMLElement { public let globalThis = Window(from: JSObject.global.jsValue())! -public class ReadableStream: JSBridgedClass { - public static var constructor: JSFunction { JSObject.global.ReadableStream.function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public subscript(dynamicMember name: String) -> JSValue { - get { jsObject[name] } - set { jsObject[name] = newValue } - } -} - public typealias Uint8ClampedArray = JSUInt8ClampedArray @propertyWrapper public final class OptionalClosureAttribute From e87bc3de900c4bf0e8049938336f0657662351ac Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 14:28:38 -0400 Subject: [PATCH 061/124] fix async functions --- Package.resolved | 2 +- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Package.resolved b/Package.resolved index abe1656c..bc767001 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { "branch": "jed/open-object", - "revision": "40178501fc7a153e38268ac8025c541510a22881", + "revision": "c03c6f9442bd023610988a819e3e830618c55cd5", "version": null } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 5dcb5009..921c9efc 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -249,7 +249,7 @@ extension IDLIterableDeclaration: SwiftRepresentable, Initializable { if async { return """ public typealias Element = \(idlType[0]) - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func makeAsyncIterator() -> ValueIterableAsyncIterator<\(Context.className)> { ValueIterableAsyncIterator(sequence: self) } @@ -413,12 +413,12 @@ extension AsyncOperation: SwiftRepresentable, Initializable { let (prep, call) = operation.defaultBody let result: SwiftSource if returnType.swiftRepresentation.source == "Void" { - result = "_ = try await _promise.value" + result = "_ = try await _promise.get()" } else { - result = "return try await _promise.value.fromJSValue()!" + result = "return try await _promise.get().fromJSValue()!" } return """ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) \(operation.nameAndParams) async throws -> \(returnType) { \(prep) let _promise: JSPromise = \(call).fromJSValue()! From 2ea276443849a0c00d1e560fe534765fa9d290e9 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 15:23:02 -0400 Subject: [PATCH 062/124] \(quoted: ...) --- Sources/WebIDLToSwift/SwiftSource.swift | 5 ++++- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift index 5f9285d1..5237ee61 100644 --- a/Sources/WebIDLToSwift/SwiftSource.swift +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -30,7 +30,6 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation, E output.reserveCapacity(literalCapacity * 2) } - mutating func appendLiteral(_ literal: String) { output += literal } @@ -39,6 +38,10 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation, E output += value } + mutating func appendInterpolation(quoted value: String) { + output += "\"\(value)\"" + } + mutating func appendInterpolation(_ source: SwiftSource) { output += source.source } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 921c9efc..85632374 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -62,7 +62,9 @@ extension IDLAttribute: SwiftRepresentable, Initializable { var initializer: SwiftSource? { assert(!Context.static) - return "\(wrapperName) = \(propertyWrapper)(jsObject: jsObject, name: \"\(raw: name)\")" + return """ + \(wrapperName) = \(idlType.propertyWrapper(readonly: readonly))(jsObject: jsObject, name: \(quoted: name)) + """ } } @@ -82,7 +84,7 @@ extension MergedDictionary: SwiftRepresentable { let object = JSObject.global.Object.function!.new() \(lines: members.map { """ - object["\(raw: $0.name)"] = \($0.name).jsValue() + object[\(quoted: $0.name)] = \($0.name).jsValue() """ }) \(lines: members.map { @@ -109,7 +111,7 @@ extension IDLEnum: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ public enum \(name): String, JSValueCompatible { - \(lines: cases.map { "case \($0.camelized) = \"\(raw: $0)\"" }) + \(lines: cases.map { "case \($0.camelized) = \(quoted: $0)" }) public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.string { @@ -352,7 +354,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { return ( prep: "\(lines: prep)", - call: "\(Context.this)[\"\(raw: name)\"]!(\(sequence: args))" + call: "\(Context.this)[\(quoted: name)]!(\(sequence: args))" ) } From 4fe726efe9338325ebb3d25ffee8910e47a0931d Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 15:24:31 -0400 Subject: [PATCH 063/124] Generate closure wrapper types automatically --- Sources/DOMKit/ECMAScript/Struct.swift | 1 - Sources/DOMKit/ECMAScript/Support.swift | 77 ---------------- Sources/WebIDLToSwift/ClosureWrappers.swift | 91 +++++++++++++++++++ Sources/WebIDLToSwift/Context.swift | 10 +- Sources/WebIDLToSwift/MergeDeclarations.swift | 22 ++++- .../WebIDL+SwiftRepresentation.swift | 51 +++++++---- Sources/WebIDLToSwift/main.swift | 31 +++++-- 7 files changed, 174 insertions(+), 109 deletions(-) delete mode 100644 Sources/DOMKit/ECMAScript/Struct.swift create mode 100644 Sources/WebIDLToSwift/ClosureWrappers.swift diff --git a/Sources/DOMKit/ECMAScript/Struct.swift b/Sources/DOMKit/ECMAScript/Struct.swift deleted file mode 100644 index 4aff82f9..00000000 --- a/Sources/DOMKit/ECMAScript/Struct.swift +++ /dev/null @@ -1 +0,0 @@ -import JavaScriptKit diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 28fbdf38..49569ddf 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -19,83 +19,6 @@ public let globalThis = Window(from: JSObject.global.jsValue())! public typealias Uint8ClampedArray = JSUInt8ClampedArray -@propertyWrapper public final class OptionalClosureAttribute - where ArgumentType: JSValueCompatible, ReturnType: JSValueCompatible -{ - @usableFromInline let jsObject: JSObject - @usableFromInline let name: String - - public init(jsObject: JSObject, name: String) { - self.jsObject = jsObject - self.name = name - } - - @inlinable public var wrappedValue: ((ArgumentType) -> ReturnType)? { - get { OptionalClosureAttribute[name, in: jsObject] } - set { OptionalClosureAttribute[name, in: jsObject] = newValue } - } - - @inlinable public static subscript(name: String, in jsObject: JSObject) -> ((ArgumentType) -> ReturnType)? { - get { - guard let function = jsObject[name].function else { - return nil - } - return { function($0.jsValue()).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { newValue($0[0].fromJSValue()!).jsValue() } - jsObject[name] = closure.jsValue() - } else { - jsObject[name] = .null - } - } - } -} - -/* variadic generics please */ -@propertyWrapper public final class OnErrorEventHandlerAttribute { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: String - - public init(jsObject: JSObject, name: String) { - self.jsObject = jsObject - self.name = name - } - - @inlinable public var wrappedValue: ((JSValue, String, UInt32, UInt32, JSValue) -> JSValue)? { - get { OnErrorEventHandlerAttribute[name, in: jsObject] } - set { OnErrorEventHandlerAttribute[name, in: jsObject] = newValue } - } - - @inlinable public static subscript(name: String, in jsObject: JSObject) - -> ((JSValue, String, UInt32, UInt32, JSValue) -> JSValue)? - { - get { - guard let function = jsObject[name].function else { - return nil - } - return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { - newValue( - $0[0].fromJSValue()!, - $0[1].fromJSValue()!, - $0[2].fromJSValue()!, - $0[3].fromJSValue()!, - $0[4].fromJSValue()! - ).jsValue() - } - jsObject[name] = closure.jsValue() - } else { - jsObject[name] = .null - } - } - } -} - @propertyWrapper public struct ReadWriteAttribute { @usableFromInline let jsObject: JSObject @usableFromInline let name: String diff --git a/Sources/WebIDLToSwift/ClosureWrappers.swift b/Sources/WebIDLToSwift/ClosureWrappers.swift new file mode 100644 index 00000000..4190b09a --- /dev/null +++ b/Sources/WebIDLToSwift/ClosureWrappers.swift @@ -0,0 +1,91 @@ +struct ClosureWrapper: SwiftRepresentable, Equatable { + let nullable: Bool + let argCount: Int + + var name: SwiftSource { + if nullable { + return "Optional\(String(argCount))" + } else { + return "Required\(String(argCount))" + } + } + + var indexes: [String] { (0 ..< argCount).map(String.init) } + + private var typeNames: [SwiftSource] { + indexes.map { "A\($0)" } + ["ReturnType"] + } + + private var closureType: SwiftSource { + let closure: SwiftSource = "(\(sequence: typeNames.dropLast())) -> ReturnType" + return nullable ? "(\(closure))?" : closure + } + + private var getter: SwiftSource { + let getFunction: SwiftSource + if nullable { + getFunction = """ + guard let function = jsObject[name].function else { + return nil + } + """ + } else { + getFunction = "let function = jsObject[name].function!" + } + return """ + \(getFunction) + return { function(\(sequence: indexes.map { "$\($0).jsValue()" })).fromJSValue()! } + """ + } + + private var setter: SwiftSource { + let setClosure: SwiftSource = """ + jsObject[name] = JSClosure { + newValue(\(sequence: indexes.map { "$0[\($0)].fromJSValue()!" })).jsValue() + }.jsValue() + """ + + if nullable { + return """ + if let newValue = newValue { + \(setClosure) + } else { + jsObject[name] = .null + } + """ + } else { + return setClosure + } + } + + var swiftRepresentation: SwiftSource { + """ + @propertyWrapper public final class \(name)<\(sequence: typeNames)> + where \(sequence: typeNames.map { "\($0): JSValueCompatible" }) + { + + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: \(closureType) { + get { \(name)[name, in: jsObject] } + set { \(name)[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, in jsObject: JSObject) -> \(closureType) { + get { + \(getter) + } + set { + \(setter) + } + } + } + """ + } +} diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index 5ef1360c..31bcbab2 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -2,6 +2,8 @@ enum Context { private(set) static var current = State() + static var requiredClosureArgCounts: Set = [] + private static var stack: [State] = [] static func withState(_ new: State, body: () throws -> T) rethrows -> T { stack.append(current) @@ -26,6 +28,7 @@ enum Context { private(set) var className: SwiftSource! private(set) var interfaces: [String: MergedInterface]! private(set) var ignored: [String: Set]! + private(set) var types: [String: IDLTypealias]! private(set) var override = false static func `static`(this: SwiftSource, inClass: Bool = Context.inClass, className: SwiftSource) -> Self { @@ -52,10 +55,15 @@ enum Context { return newState } - static func root(interfaces: [String: MergedInterface], ignored: [String: Set]) -> Self { + static func root( + interfaces: [String: MergedInterface], + ignored: [String: Set], + types: [String: IDLTypealias] + ) -> Self { var newState = Context.current newState.interfaces = interfaces newState.ignored = ignored + newState.types = types return newState } } diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 2f58b524..d11376e5 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -12,7 +12,11 @@ func addAsync(_ members: [IDLNode]) -> [IDLNode] { } } -func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfaces: [String: MergedInterface]) { +func merge(declarations: [IDLNode]) -> ( + declarations: [DeclarationFile], + interfaces: [String: MergedInterface], + types: [String: IDLTypealias] +) { let byType: [String: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in partialResult[type(of: node).type, default: []].append(node) } @@ -111,6 +115,10 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa } print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) + + let allTypes: [IDLTypealias] = all(IDLTypedef.self) + all(IDLCallback.self) + let mergedTypes = Dictionary(uniqueKeysWithValues: allTypes.map { ($0.name, $0) }) + let arrays: [DeclarationFile] = Array(mergedInterfaces.values) + Array(mergedDictionaries.values) @@ -120,7 +128,8 @@ func merge(declarations: [IDLNode]) -> (declarations: [DeclarationFile], interfa arrays + [Typedefs(typedefs: all(IDLTypedef.self) + all(IDLCallback.self))] + all(IDLEnum.self), - mergedInterfaces + mergedInterfaces, + mergedTypes ) } @@ -167,9 +176,16 @@ struct MergedInterface: DeclarationFile { struct Typedefs: DeclarationFile, SwiftRepresentable { let name = "Typedefs" - let typedefs: [IDLNode] + let typedefs: [IDLTypealias] var swiftRepresentation: SwiftSource { "\(lines: typedefs.map(toSwift))" } } + +protocol IDLTypealias: IDLNode, IDLNamed { + var idlType: IDLType { get } +} + +extension IDLCallback: IDLTypealias {} +extension IDLTypedef: IDLTypealias {} diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 85632374..d250f086 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -16,19 +16,6 @@ extension IDLArgument: SwiftRepresentable { } extension IDLAttribute: SwiftRepresentable, Initializable { - private var propertyWrapper: SwiftSource { - if readonly { - return "ReadonlyAttribute" - } - if case let .single(name) = idlType.value, ["EventHandler", "OnBeforeUnloadEventHandler"].contains(name) { - return "OptionalClosureAttribute" - } - if case let .single(name) = idlType.value, name == "OnErrorEventHandler" { - return "OnErrorEventHandlerAttribute" - } - return "ReadWriteAttribute" - } - private var wrapperName: SwiftSource { "_\(raw: name)" } @@ -38,7 +25,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { if Context.override { // can't do property wrappers on override declarations return """ - private var \(wrapperName): \(propertyWrapper)<\(idlType)> + private var \(wrapperName): \(idlType.propertyWrapper(readonly: readonly))<\(idlType)> override public var \(name): \(idlType) { get { \(wrapperName).wrappedValue } \(readonly ? "" : "set { \(wrapperName).wrappedValue = newValue }") @@ -46,15 +33,19 @@ extension IDLAttribute: SwiftRepresentable, Initializable { """ } else if Context.constructor == nil { // can't do property wrappers on extensions + let setter: SwiftSource = """ + set { \(idlType.propertyWrapper(readonly: readonly))[\(quoted: name), in: jsObject] = newValue } + """ + return """ public var \(name): \(idlType) { - get { \(propertyWrapper)["\(raw: name)", in: jsObject] } - \(readonly ? "" : "set { \(propertyWrapper)[\"\(raw: name)\", in: jsObject] = newValue }") + get { \(idlType.propertyWrapper(readonly: readonly))[\(quoted: name), in: jsObject] } + \(readonly ? "" : setter) } """ } else { return """ - @\(propertyWrapper) + @\(idlType.propertyWrapper(readonly: readonly)) public var \(name): \(idlType) """ } @@ -89,7 +80,7 @@ extension MergedDictionary: SwiftRepresentable { }) \(lines: members.map { """ - _\(raw: $0.name) = ReadWriteAttribute(jsObject: object, name: "\(raw: $0.name)") + _\(raw: $0.name) = \($0.idlType.propertyWrapper(readonly: false))(jsObject: object, name: \(quoted: $0.name)) """ }) super.init(cloning: object) @@ -100,7 +91,7 @@ extension MergedDictionary: SwiftRepresentable { private var swiftMembers: [SwiftSource] { members.map { """ - @ReadWriteAttribute + @\($0.idlType.propertyWrapper(readonly: false)) public var \($0.name): \($0.idlType) """ } @@ -128,7 +119,8 @@ extension IDLEnum: SwiftRepresentable { extension IDLCallback: SwiftRepresentable { var swiftRepresentation: SwiftSource { - """ + Context.requiredClosureArgCounts.insert(arguments.count) + return """ public typealias \(name) = (\(sequence: arguments.map(\.idlType.swiftRepresentation))) -> \(idlType) """ } @@ -491,6 +483,25 @@ extension IDLType: SwiftRepresentable { return "__UNSUPPORTED_UNION__" } } + + func propertyWrapper(readonly: Bool) -> SwiftSource { + if readonly { + return "ReadonlyAttribute" + } + if case let .single(name) = value { + if let callback = Context.types[name] as? IDLCallback { + return "ClosureAttribute.Required\(String(callback.arguments.count))" + } + if let ref = Context.types[name] as? IDLTypedef, + case let .single(name) = ref.idlType.value, + let callback = Context.types[name] as? IDLCallback + { + assert(ref.idlType.nullable) + return "ClosureAttribute.Optional\(String(callback.arguments.count))" + } + } + return "ReadWriteAttribute" + } } extension IDLTypedef: SwiftRepresentable { diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 0fececa7..5d7a94c9 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -28,6 +28,15 @@ import JavaScriptEventLoop \n """ +func writeFile(named name: String, content: String) throws { + let path = "/Users/jed/Documents/github-clones/Tokamak/DOMKit/Sources/DOMKit/WebIDL/" + name + ".swift" + if FileManager.default.fileExists(atPath: path) { + fatalError("file already exists for \(name)") + } else { + try (preamble + content).write(toFile: path, atomically: true, encoding: .utf8) + } +} + do { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) @@ -40,16 +49,24 @@ do { guard let name = Mirror(reflecting: node).children.first(where: { $0.label == "name" })?.value as? String else { fatalError("Cannot find name for \(node)") } - let content = Context.withState(.root(interfaces: merged.interfaces, ignored: ignored)) { + let content = Context.withState(.root(interfaces: merged.interfaces, ignored: ignored, types: merged.types)) { toSwift(node).source } - let path = "/Users/jed/Documents/github-clones/Tokamak/DOMKit/Sources/DOMKit/WebIDL/" + name + ".swift" - if FileManager.default.fileExists(atPath: path) { - fatalError("file already exists for \(name)") - } else { - try (preamble + content).write(toFile: path, atomically: true, encoding: .utf8) - } + try writeFile(named: name, content: content) } + + let closureTypesContent: SwiftSource = """ + /* variadic generics please */ + public enum ClosureAttribute { + // MARK: Required closures + \(lines: Context.requiredClosureArgCounts.sorted().map { ClosureWrapper(nullable: false, argCount: $0).swiftRepresentation }) + + // MARK: Optional closures + \(lines: Context.requiredClosureArgCounts.sorted().map { ClosureWrapper(nullable: true, argCount: $0).swiftRepresentation }) + } + """ + + try writeFile(named: "ClosureAttribute", content: closureTypesContent.source) // for (name, nodes) in idl { // if name.starts(with: "WEBGL_") { continue } // for (i, node) in nodes.enumerated() { From 5fdcd992fc8530d5f77826bbe1e90cc2f3720309 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 15:32:12 -0400 Subject: [PATCH 064/124] remove unsupported function --- Sources/WebIDLToSwift/main.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 5d7a94c9..2ec82d8a 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -9,7 +9,8 @@ let ignored: [String: Set] = [ "DataTransferItem": ["getAsString"], "WindowOrWorkerGlobalScope": ["queueMicrotask"], "MutationObserver": [""], - "CustomElementRegistry": ["define"], + // functions as return types are unsupported + "CustomElementRegistry": ["define", "whenDefined"], // NodeFilter "Document": ["createNodeIterator", "createTreeWalker"], "TreeWalker": ["filter"], From 4c37eb81c105da27258643150949169734007298 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 15:32:22 -0400 Subject: [PATCH 065/124] fix 0-arg closures --- Sources/WebIDLToSwift/ClosureWrappers.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/ClosureWrappers.swift b/Sources/WebIDLToSwift/ClosureWrappers.swift index 4190b09a..3f12e294 100644 --- a/Sources/WebIDLToSwift/ClosureWrappers.swift +++ b/Sources/WebIDLToSwift/ClosureWrappers.swift @@ -40,7 +40,7 @@ struct ClosureWrapper: SwiftRepresentable, Equatable { private var setter: SwiftSource { let setClosure: SwiftSource = """ - jsObject[name] = JSClosure { + jsObject[name] = JSClosure { \(argCount == 0 ? "_ in" : "") newValue(\(sequence: indexes.map { "$0[\($0)].fromJSValue()!" })).jsValue() }.jsValue() """ From ef7637b855f8562bf7ac8931c96d269e69a87900 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 15:32:40 -0400 Subject: [PATCH 066/124] =?UTF-8?q?=E2=80=9Cfix=E2=80=9D=20readonly=20clos?= =?UTF-8?q?ure=20properties=20(why=20are=20these=20not=20methods=3F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WebIDL+SwiftRepresentation.swift | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index d250f086..669edfc8 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -485,22 +485,27 @@ extension IDLType: SwiftRepresentable { } func propertyWrapper(readonly: Bool) -> SwiftSource { - if readonly { - return "ReadonlyAttribute" - } + // TODO: handle readonly closure properties + // (should they be a JSFunction? or a closure? or something else?)) if case let .single(name) = value { + let readonlyComment: SwiftSource = readonly ? " /* XXX: should be readonly! */ " : "" if let callback = Context.types[name] as? IDLCallback { - return "ClosureAttribute.Required\(String(callback.arguments.count))" + return "ClosureAttribute.Required\(String(callback.arguments.count))\(readonlyComment)" } if let ref = Context.types[name] as? IDLTypedef, case let .single(name) = ref.idlType.value, let callback = Context.types[name] as? IDLCallback { assert(ref.idlType.nullable) - return "ClosureAttribute.Optional\(String(callback.arguments.count))" + return "ClosureAttribute.Optional\(String(callback.arguments.count))\(readonlyComment)" } } - return "ReadWriteAttribute" + + if readonly { + return "ReadonlyAttribute" + } else { + return "ReadWriteAttribute" + } } } From 9daa6e8dd33f52b5fe7a704b1b6dca1f662d5974 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 15:44:10 -0400 Subject: [PATCH 067/124] fix variadic callbacks --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 669edfc8..c8eea58b 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -121,7 +121,9 @@ extension IDLCallback: SwiftRepresentable { var swiftRepresentation: SwiftSource { Context.requiredClosureArgCounts.insert(arguments.count) return """ - public typealias \(name) = (\(sequence: arguments.map(\.idlType.swiftRepresentation))) -> \(idlType) + public typealias \(name) = (\(sequence: arguments.map { + "\($0.idlType.swiftRepresentation)\($0.variadic ? "..." : "")" + })) -> \(idlType) """ } } From 18a948392963854e1aa0af56c2d8d4230a187b11 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 15:56:18 -0400 Subject: [PATCH 068/124] fixes for the Function type --- Sources/WebIDLToSwift/MergeDeclarations.swift | 9 ++++++--- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index d11376e5..1e43b450 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -1,5 +1,7 @@ import WebIDL +let ignoredTypedefs: Set = ["Function"] + func addAsync(_ members: [IDLNode]) -> [IDLNode] { members.flatMap { member -> [IDLNode] in if let operation = member as? IDLOperation, @@ -116,7 +118,8 @@ func merge(declarations: [IDLNode]) -> ( print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) - let allTypes: [IDLTypealias] = all(IDLTypedef.self) + all(IDLCallback.self) + var allTypes: [IDLTypealias] = all(IDLTypedef.self) + all(IDLCallback.self) + allTypes.removeAll(where: { ignoredTypedefs.contains($0.name) }) let mergedTypes = Dictionary(uniqueKeysWithValues: allTypes.map { ($0.name, $0) }) let arrays: [DeclarationFile] = @@ -126,7 +129,7 @@ func merge(declarations: [IDLNode]) -> ( + Array(mergedNamespaces.values) return ( arrays - + [Typedefs(typedefs: all(IDLTypedef.self) + all(IDLCallback.self))] + + [Typedefs(typedefs: allTypes)] + all(IDLEnum.self), mergedInterfaces, mergedTypes @@ -179,7 +182,7 @@ struct Typedefs: DeclarationFile, SwiftRepresentable { let typedefs: [IDLTypealias] var swiftRepresentation: SwiftSource { - "\(lines: typedefs.map(toSwift))" + "\(lines: typedefs.filter { !ignoredTypedefs.contains($0.name) }.map(toSwift))" } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index c8eea58b..51f3078a 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -444,6 +444,7 @@ let typeNameMap = [ "short": "Int16", "long": "Int32", "long long": "Int64", + "Function": "JSFunction", ] extension IDLType: SwiftRepresentable { From b65c5b245842d05b98fa419cad888df8f801cfcc Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 16:05:00 -0400 Subject: [PATCH 069/124] Fix closure keys in dictionaries --- Sources/DOMKit/ECMAScript/ArrayBuffer.swift | 1 - .../WebIDL+SwiftRepresentation.swift | 30 ++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/ArrayBuffer.swift b/Sources/DOMKit/ECMAScript/ArrayBuffer.swift index f225825e..195bbd54 100644 --- a/Sources/DOMKit/ECMAScript/ArrayBuffer.swift +++ b/Sources/DOMKit/ECMAScript/ArrayBuffer.swift @@ -11,7 +11,6 @@ public typealias Int32Array = JSTypedArray public typealias Uint8Array = JSTypedArray public typealias Uint16Array = JSTypedArray public typealias Uint32Array = JSTypedArray -//public typealias Uint8ClampedArray = JSTypedArray public typealias Float32Array = JSTypedArray public typealias Float64Array = JSTypedArray diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 51f3078a..75630089 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -71,12 +71,18 @@ extension MergedDictionary: SwiftRepresentable { private var swiftInit: SwiftSource { """ - public init(\(sequence: members.map { "\($0.name): \($0.idlType)" })) { + public init(\(sequence: members.map { "\($0.name): \($0.idlType.isFunction ? "@escaping " : "")\($0.idlType)" })) { let object = JSObject.global.Object.function!.new() \(lines: members.map { - """ - object[\(quoted: $0.name)] = \($0.name).jsValue() - """ + if $0.idlType.isFunction { + return """ + \($0.idlType.propertyWrapper(readonly: false))[\(quoted: $0.name), in: object] = \($0.name) + """ + } else { + return """ + object[\(quoted: $0.name)] = \($0.name).jsValue() + """ + } }) \(lines: members.map { """ @@ -487,6 +493,22 @@ extension IDLType: SwiftRepresentable { } } + var isFunction: Bool { + if case let .single(name) = value { + if Context.types[name] is IDLCallback { + return true + } + if let ref = Context.types[name] as? IDLTypedef, + case let .single(name) = ref.idlType.value, + Context.types[name] is IDLCallback + { + assert(ref.idlType.nullable) + return true + } + } + return false + } + func propertyWrapper(readonly: Bool) -> SwiftSource { // TODO: handle readonly closure properties // (should they be a JSFunction? or a closure? or something else?)) From 3d7c312832ae1fcbbcba52f992d214e956e0116b Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 16:08:09 -0400 Subject: [PATCH 070/124] check in my changes to the iterator support (not working) --- Sources/DOMKit/ECMAScript/Support.swift | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 49569ddf..ee060ff6 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -59,17 +59,15 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray public class ValueIterableIterator: IteratorProtocol where SequenceType.Element: ConstructibleFromJSValue { private var index: Int = 0 - private let sequence: SequenceType + private let iterator: JSObject public init(sequence: SequenceType) { - self.sequence = sequence + iterator = sequence.jsObject[JSObject.global.Symbol.object!.iterator]!().object! } public func next() -> SequenceType.Element? { - defer { - index += 1 - } - let value = sequence.jsObject[index] + defer { index += 1 } + let value = iterator.next!() guard value != .undefined else { return nil } @@ -78,6 +76,21 @@ public class ValueIterableIterator: Ite } } +@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) +public class ValueIterableAsyncIterator: AsyncIteratorProtocol where SequenceType.Element: ConstructibleFromJSValue { + private var index: Int = 0 + private let sequence: SequenceType + + public init(sequence: SequenceType) { + self.sequence = sequence + } + + public func next() async -> SequenceType.Element? { + // TODO: implement + nil + } +} + public protocol KeyValueSequence: Sequence where Element == (String, Value) { associatedtype Value } From 4e2421624e78d96c09d4e6752da647c5f1170329 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 16:41:57 -0400 Subject: [PATCH 071/124] refactor main.swift --- Sources/WebIDLToSwift/main.swift | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 2ec82d8a..9ff54814 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -30,7 +30,7 @@ import JavaScriptEventLoop """ func writeFile(named name: String, content: String) throws { - let path = "/Users/jed/Documents/github-clones/Tokamak/DOMKit/Sources/DOMKit/WebIDL/" + name + ".swift" + let path = "Sources/DOMKit/WebIDL/" + name + ".swift" if FileManager.default.fileExists(atPath: path) { fatalError("file already exists for \(name)") } else { @@ -38,7 +38,7 @@ func writeFile(named name: String, content: String) throws { } } -do { +func generateIDLBindings() throws { let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) let declarations = [ @@ -55,25 +55,27 @@ do { } try writeFile(named: name, content: content) } +} +func generateClosureTypes() throws { + let argCounts = Context.requiredClosureArgCounts.sorted() let closureTypesContent: SwiftSource = """ /* variadic generics please */ public enum ClosureAttribute { // MARK: Required closures - \(lines: Context.requiredClosureArgCounts.sorted().map { ClosureWrapper(nullable: false, argCount: $0).swiftRepresentation }) + \(lines: argCounts.map { ClosureWrapper(nullable: false, argCount: $0).swiftRepresentation }) - // MARK: Optional closures - \(lines: Context.requiredClosureArgCounts.sorted().map { ClosureWrapper(nullable: true, argCount: $0).swiftRepresentation }) + // MARK: - Optional closures + \(lines: argCounts.map { ClosureWrapper(nullable: true, argCount: $0).swiftRepresentation }) } """ try writeFile(named: "ClosureAttribute", content: closureTypesContent.source) -// for (name, nodes) in idl { -// if name.starts(with: "WEBGL_") { continue } -// for (i, node) in nodes.enumerated() { -// print(toSwift(node).source) -// } -// } +} + +do { + try generateIDLBindings() + try generateClosureTypes() } catch { switch error as? DecodingError { case let .dataCorrupted(ctx), let .typeMismatch(_, ctx): From 5d1baef7a698cb2b2981600297ad67011d947564 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 16:45:15 -0400 Subject: [PATCH 072/124] Clean output folder before building --- .../WebIDL+SwiftRepresentation.swift | 2 +- Sources/WebIDLToSwift/main.swift | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 75630089..8b68586a 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -488,7 +488,7 @@ extension IDLType: SwiftRepresentable { return "\(name)" } case let .union(types): - print("union", types.count) + // print("union", types.count) return "__UNSUPPORTED_UNION__" } } diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 9ff54814..8b04a20c 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -29,8 +29,10 @@ import JavaScriptEventLoop \n """ +let outDir = "Sources/DOMKit/WebIDL/" + func writeFile(named name: String, content: String) throws { - let path = "Sources/DOMKit/WebIDL/" + name + ".swift" + let path = outDir + name + ".swift" if FileManager.default.fileExists(atPath: path) { fatalError("file already exists for \(name)") } else { @@ -38,9 +40,13 @@ func writeFile(named name: String, content: String) throws { } } -func generateIDLBindings() throws { - let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) - let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) +func cleanOutputFolder() throws { + for file in try FileManager.default.contentsOfDirectory(atPath: outDir) { + try FileManager.default.removeItem(atPath: outDir + file) + } +} + +func generateIDLBindings(idl: [String: GenericCollection]) throws { let declarations = [ "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", "referrer-policy", "uievents", "wai-aria", "cssom", "css-conditional", "streams", @@ -74,7 +80,11 @@ func generateClosureTypes() throws { } do { - try generateIDLBindings() + let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) + let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) + + try cleanOutputFolder() + try generateIDLBindings(idl: idl) try generateClosureTypes() } catch { switch error as? DecodingError { From fdee5ba4b9a694938d076454263ea897b0620ecd Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 16:57:49 -0400 Subject: [PATCH 073/124] more refactoring --- Sources/WebIDLToSwift/IDLBuilder.swift | 85 ++++++ Sources/WebIDLToSwift/MergeDeclarations.swift | 246 +++++++++--------- .../WebIDLToSwift/SwiftRepresentation.swift | 36 +-- .../WebIDL+SwiftRepresentation.swift | 44 ++-- Sources/WebIDLToSwift/main.swift | 97 +------ 5 files changed, 264 insertions(+), 244 deletions(-) create mode 100644 Sources/WebIDLToSwift/IDLBuilder.swift diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift new file mode 100644 index 00000000..3ec4ff3f --- /dev/null +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -0,0 +1,85 @@ +import Foundation +import WebIDL + +enum IDLBuilder { + static let preamble = """ + // This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + + import JavaScriptKit + import JavaScriptEventLoop + \n + """ + + static let outDir = "Sources/DOMKit/WebIDL/" + static func writeFile(named name: String, content: String) throws { + let path = outDir + name + ".swift" + if FileManager.default.fileExists(atPath: path) { + fatalError("file already exists for \(name)") + } else { + try (preamble + content).write(toFile: path, atomically: true, encoding: .utf8) + } + } + + static func cleanOutputFolder() throws { + for file in try FileManager.default.contentsOfDirectory(atPath: outDir) { + try FileManager.default.removeItem(atPath: outDir + file) + } + } + + static func generateIDLBindings(idl: [String: GenericCollection]) throws { + let declarations = [ + "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", + "referrer-policy", "uievents", "wai-aria", "cssom", "css-conditional", "streams", + ].flatMap { idl[$0]!.array } + let merged = DeclarationMerger.merge(declarations: declarations) + for (i, node) in merged.declarations.enumerated() { + guard let nameNode = Mirror(reflecting: node).children.first(where: { $0.label == "name" }), + let name = nameNode.value as? String + else { + fatalError("Cannot find name for \(node)") + } + let content = Context.withState(.root( + interfaces: merged.interfaces, + ignored: [ + // functions as parameters are unsupported + "EventTarget": ["addEventListener", "removeEventListener"], + "HTMLCanvasElement": ["toBlob"], + "AnimationFrameProvider": ["requestAnimationFrame"], + "DataTransferItem": ["getAsString"], + "WindowOrWorkerGlobalScope": ["queueMicrotask"], + "MutationObserver": [""], + // functions as return types are unsupported + "CustomElementRegistry": ["define", "whenDefined"], + // NodeFilter + "Document": ["createNodeIterator", "createTreeWalker"], + "TreeWalker": ["filter"], + "NodeIterator": ["filter"], + // invalid overload in Swift + "BeforeUnloadEvent": ["returnValue"], + // XPathNSResolver + "XPathEvaluatorBase": ["createExpression", "createNSResolver", "evaluate"], + ], + types: merged.types + )) { + toSwift(node).source + } + try writeFile(named: name, content: content) + } + } + + static func generateClosureTypes() throws { + let argCounts = Context.requiredClosureArgCounts.sorted() + let closureTypesContent: SwiftSource = """ + /* variadic generics please */ + public enum ClosureAttribute { + // MARK: Required closures + \(lines: argCounts.map { ClosureWrapper(nullable: false, argCount: $0).swiftRepresentation }) + + // MARK: - Optional closures + \(lines: argCounts.map { ClosureWrapper(nullable: true, argCount: $0).swiftRepresentation }) + } + """ + + try writeFile(named: "ClosureAttribute", content: closureTypesContent.source) + } +} diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 1e43b450..6f4e077b 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -1,139 +1,143 @@ import WebIDL -let ignoredTypedefs: Set = ["Function"] - -func addAsync(_ members: [IDLNode]) -> [IDLNode] { - members.flatMap { member -> [IDLNode] in - if let operation = member as? IDLOperation, - case .generic("Promise", _) = operation.idlType?.value - { - return [member, AsyncOperation(operation: operation)] - } else { - return [member] +enum DeclarationMerger { + static let ignoredTypedefs: Set = ["Function"] + + private static func addAsync(_ members: [IDLNode]) -> [IDLNode] { + members.flatMap { member -> [IDLNode] in + if let operation = member as? IDLOperation, + case .generic("Promise", _) = operation.idlType?.value + { + return [member, AsyncOperation(operation: operation)] + } else { + return [member] + } } } -} - -func merge(declarations: [IDLNode]) -> ( - declarations: [DeclarationFile], - interfaces: [String: MergedInterface], - types: [String: IDLTypealias] -) { - let byType: [String: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in - partialResult[type(of: node).type, default: []].append(node) - } - let missedTypes = Set(declarations.map { type(of: $0).type }) - .symmetricDifference([ - IDLInterfaceMixin.type, - IDLInterface.type, - IDLDictionary.type, - IDLCallbackInterface.type, - IDLIncludes.type, - IDLEnum.type, IDLNamespace.type, - IDLTypedef.type, IDLCallback.type, - ]) - if !missedTypes.isEmpty { - print("missed types!", missedTypes) - } - // let byName: [String?: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in - // let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String - // partialResult[name, default: []].append(node) - // } - // print(byName.filter { $0.value.count > 1 }.map { "\($0.key ?? ""): \($0.value.map { type(of: $0).type }))" }.joined(separator: "\n")) - - func all(_: T.Type) -> [T] { - byType[T.type]!.map { $0 as! T } - } + static func merge(declarations: [IDLNode]) -> MergeResult { + let byType: [String: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in + partialResult[type(of: node).type, default: []].append(node) + } - let mixins = Dictionary( - grouping: all(IDLInterfaceMixin.self).map { - MergedMixin( - name: $0.name, - members: addAsync($0.members.array) as! [IDLInterfaceMixinMember] - ) - }, - by: \.name - ).mapValues { - $0.dropFirst().reduce(into: $0.first!) { partialResult, mixin in - partialResult.members += mixin.members + let missedTypes = Set(declarations.map { type(of: $0).type }) + .symmetricDifference([ + IDLInterfaceMixin.type, + IDLInterface.type, + IDLDictionary.type, + IDLCallbackInterface.type, + IDLIncludes.type, + IDLEnum.type, IDLNamespace.type, + IDLTypedef.type, IDLCallback.type, + ]) + if !missedTypes.isEmpty { + print("missed types!", missedTypes) + } + // let byName: [String?: [IDLNode]] = declarations.reduce(into: [:]) { partialResult, node in + // let name = Mirror(reflecting: node).children.first { $0.label == "name" }?.value as? String + // partialResult[name, default: []].append(node) + // } + // print(byName.filter { $0.value.count > 1 }.map { "\($0.key ?? ""): \($0.value.map { type(of: $0).type }))" }.joined(separator: "\n")) + + func all(_: T.Type) -> [T] { + byType[T.type]!.map { $0 as! T } } - } - let includes = Dictionary(grouping: all(IDLIncludes.self)) { $0.target } - .mapValues { $0.map(\.includes) } - - let mergedInterfaces = Dictionary( - grouping: all(IDLInterface.self).map { - MergedInterface( - name: $0.name, - parentClasses: [$0.inheritance].compactMap { $0 }, - members: addAsync($0.members.array) as! [IDLInterfaceMember] - ) - }, - by: \.name - ).mapValues { toMerge -> MergedInterface in - var interface = toMerge.dropFirst().reduce(into: toMerge.first!) { partialResult, interface in - partialResult.parentClasses += interface.parentClasses - partialResult.members += interface.members + let mixins = Dictionary( + grouping: all(IDLInterfaceMixin.self).map { + MergedMixin( + name: $0.name, + members: addAsync($0.members.array) as! [IDLInterfaceMixinMember] + ) + }, + by: \.name + ).mapValues { + $0.dropFirst().reduce(into: $0.first!) { partialResult, mixin in + partialResult.members += mixin.members + } } - interface.mixins = includes[interface.name, default: []] - if let decl = interface.members.first(where: { $0 is IDLIterableDeclaration }) as? IDLIterableDeclaration { - interface.mixins.append(decl.async ? "AsyncSequence" : "Sequence") + + let includes = Dictionary(grouping: all(IDLIncludes.self)) { $0.target } + .mapValues { $0.map(\.includes) } + + let mergedInterfaces = Dictionary( + grouping: all(IDLInterface.self).map { + MergedInterface( + name: $0.name, + parentClasses: [$0.inheritance].compactMap { $0 }, + members: addAsync($0.members.array) as! [IDLInterfaceMember] + ) + }, + by: \.name + ).mapValues { toMerge -> MergedInterface in + var interface = toMerge.dropFirst().reduce(into: toMerge.first!) { partialResult, interface in + partialResult.parentClasses += interface.parentClasses + partialResult.members += interface.members + } + interface.mixins = includes[interface.name, default: []] + if let decl = interface.members.first(where: { $0 is IDLIterableDeclaration }) as? IDLIterableDeclaration { + interface.mixins.append(decl.async ? "AsyncSequence" : "Sequence") + } + return interface } - return interface - } - let mergedDictionaries = Dictionary( - grouping: all(IDLDictionary.self).map { - MergedDictionary( - name: $0.name, - inheritance: [$0.inheritance].compactMap { $0 }, - members: $0.members - ) - }, - by: \.name - ).mapValues { toMerge -> MergedDictionary in - var dict = toMerge.dropFirst().reduce(into: toMerge.first!) { partialResult, interface in - partialResult.inheritance += interface.inheritance - partialResult.members += interface.members + let mergedDictionaries = Dictionary( + grouping: all(IDLDictionary.self).map { + MergedDictionary( + name: $0.name, + inheritance: [$0.inheritance].compactMap { $0 }, + members: $0.members + ) + }, + by: \.name + ).mapValues { toMerge -> MergedDictionary in + var dict = toMerge.dropFirst().reduce(into: toMerge.first!) { partialResult, interface in + partialResult.inheritance += interface.inheritance + partialResult.members += interface.members + } + dict.inheritance += includes[dict.name, default: []] + return dict } - dict.inheritance += includes[dict.name, default: []] - return dict - } - let mergedNamespaces = Dictionary( - grouping: all(IDLNamespace.self).map { - MergedNamespace( - name: $0.name, - members: addAsync($0.members.array) as! [IDLNamespaceMember] - ) - }, - by: \.name - ).mapValues { - $0.dropFirst().reduce(into: $0.first!) { partialResult, namespace in - partialResult.members += namespace.members + let mergedNamespaces = Dictionary( + grouping: all(IDLNamespace.self).map { + MergedNamespace( + name: $0.name, + members: addAsync($0.members.array) as! [IDLNamespaceMember] + ) + }, + by: \.name + ).mapValues { + $0.dropFirst().reduce(into: $0.first!) { partialResult, namespace in + partialResult.members += namespace.members + } } + + print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) + + var allTypes: [IDLTypealias] = all(IDLTypedef.self) + all(IDLCallback.self) + allTypes.removeAll(where: { ignoredTypedefs.contains($0.name) }) + let mergedTypes = Dictionary(uniqueKeysWithValues: allTypes.map { ($0.name, $0) }) + + let arrays: [DeclarationFile] = + Array(mergedInterfaces.values) + + Array(mergedDictionaries.values) + + Array(mixins.values) + + Array(mergedNamespaces.values) + return MergeResult( + declarations: arrays + + [Typedefs(typedefs: allTypes)] + + all(IDLEnum.self), + interfaces: mergedInterfaces, + types: mergedTypes + ) } - print("unhandled callback interfaces", all(IDLCallbackInterface.self).map(\.name)) - - var allTypes: [IDLTypealias] = all(IDLTypedef.self) + all(IDLCallback.self) - allTypes.removeAll(where: { ignoredTypedefs.contains($0.name) }) - let mergedTypes = Dictionary(uniqueKeysWithValues: allTypes.map { ($0.name, $0) }) - - let arrays: [DeclarationFile] = - Array(mergedInterfaces.values) - + Array(mergedDictionaries.values) - + Array(mixins.values) - + Array(mergedNamespaces.values) - return ( - arrays - + [Typedefs(typedefs: allTypes)] - + all(IDLEnum.self), - mergedInterfaces, - mergedTypes - ) + struct MergeResult { + let declarations: [DeclarationFile] + let interfaces: [String: MergedInterface] + let types: [String: IDLTypealias] + } } protocol DeclarationFile {} @@ -182,7 +186,7 @@ struct Typedefs: DeclarationFile, SwiftRepresentable { let typedefs: [IDLTypealias] var swiftRepresentation: SwiftSource { - "\(lines: typedefs.filter { !ignoredTypedefs.contains($0.name) }.map(toSwift))" + "\(lines: typedefs.filter { !DeclarationMerger.ignoredTypedefs.contains($0.name) }.map(toSwift))" } } diff --git a/Sources/WebIDLToSwift/SwiftRepresentation.swift b/Sources/WebIDLToSwift/SwiftRepresentation.swift index e6413edb..8bc01594 100644 --- a/Sources/WebIDLToSwift/SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/SwiftRepresentation.swift @@ -13,25 +13,25 @@ func toSwift(_ value: T) -> SwiftSource { } } -let swiftKeywords: Set = [ - "init", - "where", - "protocol", - "struct", - "class", - "enum", - "func", - "static", - "is", - "as", - "default", - "defer", - "self", - "repeat", -] - extension String: SwiftRepresentable { + private static let swiftKeywords: Set = [ + "init", + "where", + "protocol", + "struct", + "class", + "enum", + "func", + "static", + "is", + "as", + "default", + "defer", + "self", + "repeat", + ] + var swiftRepresentation: SwiftSource { - SwiftSource(swiftKeywords.contains(self) ? "`\(self)`" : self) + SwiftSource(Self.swiftKeywords.contains(self) ? "`\(self)`" : self) } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 8b68586a..bb748d6e 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -432,28 +432,28 @@ extension AsyncOperation: SwiftRepresentable, Initializable { var initializer: SwiftSource? { nil } } -let typeNameMap = [ - "boolean": "Bool", - "any": "JSValue", - "DOMString": "String", - "USVString": "String", - "CSSOMString": "String", - "ByteString": "String", - "object": "JSObject", - "undefined": "Void", - "float": "Float", - "double": "Double", - "unrestricted double": "Double", - "unsigned short": "UInt16", - "unsigned long": "UInt32", - "unsigned long long": "UInt64", - "short": "Int16", - "long": "Int32", - "long long": "Int64", - "Function": "JSFunction", -] - extension IDLType: SwiftRepresentable { + private static let typeNameMap = [ + "boolean": "Bool", + "any": "JSValue", + "DOMString": "String", + "USVString": "String", + "CSSOMString": "String", + "ByteString": "String", + "object": "JSObject", + "undefined": "Void", + "float": "Float", + "double": "Double", + "unrestricted double": "Double", + "unsigned short": "UInt16", + "unsigned long": "UInt32", + "unsigned long long": "UInt64", + "short": "Int16", + "long": "Int32", + "long long": "Int64", + "Function": "JSFunction", + ] + var swiftRepresentation: SwiftSource { if nullable { return "\(baseType)?" @@ -479,7 +479,7 @@ extension IDLType: SwiftRepresentable { fatalError("Unsupported generic type: \(name)") } case let .single(name): - if let typeName = typeNameMap[name] { + if let typeName = Self.typeNameMap[name] { return "\(typeName)" } else { if name == name.lowercased() { diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 8b04a20c..21bc395d 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -1,92 +1,22 @@ import Foundation import WebIDL -let ignored: [String: Set] = [ - // functions as parameters are unsupported - "EventTarget": ["addEventListener", "removeEventListener"], - "HTMLCanvasElement": ["toBlob"], - "AnimationFrameProvider": ["requestAnimationFrame"], - "DataTransferItem": ["getAsString"], - "WindowOrWorkerGlobalScope": ["queueMicrotask"], - "MutationObserver": [""], - // functions as return types are unsupported - "CustomElementRegistry": ["define", "whenDefined"], - // NodeFilter - "Document": ["createNodeIterator", "createTreeWalker"], - "TreeWalker": ["filter"], - "NodeIterator": ["filter"], - // invalid overload in Swift - "BeforeUnloadEvent": ["returnValue"], - // XPathNSResolver - "XPathEvaluatorBase": ["createExpression", "createNSResolver", "evaluate"], -] - -let preamble = """ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptKit -import JavaScriptEventLoop -\n -""" - -let outDir = "Sources/DOMKit/WebIDL/" - -func writeFile(named name: String, content: String) throws { - let path = outDir + name + ".swift" - if FileManager.default.fileExists(atPath: path) { - fatalError("file already exists for \(name)") - } else { - try (preamble + content).write(toFile: path, atomically: true, encoding: .utf8) - } -} - -func cleanOutputFolder() throws { - for file in try FileManager.default.contentsOfDirectory(atPath: outDir) { - try FileManager.default.removeItem(atPath: outDir + file) - } -} - -func generateIDLBindings(idl: [String: GenericCollection]) throws { - let declarations = [ - "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", - "referrer-policy", "uievents", "wai-aria", "cssom", "css-conditional", "streams", - ].flatMap { idl[$0]!.array } - let merged = merge(declarations: declarations) - for (i, node) in merged.declarations.enumerated() { - guard let name = Mirror(reflecting: node).children.first(where: { $0.label == "name" })?.value as? String else { - fatalError("Cannot find name for \(node)") - } - let content = Context.withState(.root(interfaces: merged.interfaces, ignored: ignored, types: merged.types)) { - toSwift(node).source - } - try writeFile(named: name, content: content) - } -} - -func generateClosureTypes() throws { - let argCounts = Context.requiredClosureArgCounts.sorted() - let closureTypesContent: SwiftSource = """ - /* variadic generics please */ - public enum ClosureAttribute { - // MARK: Required closures - \(lines: argCounts.map { ClosureWrapper(nullable: false, argCount: $0).swiftRepresentation }) - - // MARK: - Optional closures - \(lines: argCounts.map { ClosureWrapper(nullable: true, argCount: $0).swiftRepresentation }) +main() + +func main() { + do { + let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) + let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) + + try IDLBuilder.cleanOutputFolder() + try IDLBuilder.generateIDLBindings(idl: idl) + try IDLBuilder.generateClosureTypes() + } catch { + handleDecodingError(error) } - """ - - try writeFile(named: "ClosureAttribute", content: closureTypesContent.source) } -do { - let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) - let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) - - try cleanOutputFolder() - try generateIDLBindings(idl: idl) - try generateClosureTypes() -} catch { +private func handleDecodingError(_ error: Error) { switch error as? DecodingError { case let .dataCorrupted(ctx), let .typeMismatch(_, ctx): debugContext(ctx) @@ -99,6 +29,7 @@ do { case nil, .some: print(error.localizedDescription) } + exit(1) } private func debugContext(_ ctx: DecodingError.Context) { From ad6fe9350af590d30b07bbde337887d4c0b7ce7d Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 17:26:25 -0400 Subject: [PATCH 074/124] Parse the IDL files at runtime --- Package.swift | 7 ++---- Sources/WebIDLToSwift/IDLParser.swift | 24 ++++++++++++++++++++ Sources/WebIDLToSwift/main.swift | 9 +++++--- {fetch-idl => parse-idl}/.prettierrc.json | 0 {fetch-idl => parse-idl}/package-lock.json | 0 {fetch-idl => parse-idl}/package.json | 2 +- fetch-idl/build.js => parse-idl/parse-all.js | 2 +- 7 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 Sources/WebIDLToSwift/IDLParser.swift rename {fetch-idl => parse-idl}/.prettierrc.json (100%) rename {fetch-idl => parse-idl}/package-lock.json (100%) rename {fetch-idl => parse-idl}/package.json (85%) rename fetch-idl/build.js => parse-idl/parse-all.js (61%) diff --git a/Package.swift b/Package.swift index dd2a82b9..8e2e15e7 100644 --- a/Package.swift +++ b/Package.swift @@ -23,17 +23,14 @@ let package = Package( targets: [ .target( name: "DOMKitDemo", - dependencies: ["DOMKit"] - ), + dependencies: ["DOMKit"]), .target( name: "DOMKit", dependencies: ["JavaScriptKit", .product(name: "JavaScriptEventLoop", package: "JavaScriptKit")]), .target(name: "WebIDL"), .target( name: "WebIDLToSwift", - dependencies: ["WebIDL"], - resources: [.copy("data.json")] - ), + dependencies: ["WebIDL"]), .testTarget( name: "DOMKitTests", dependencies: ["DOMKit"]), diff --git a/Sources/WebIDLToSwift/IDLParser.swift b/Sources/WebIDLToSwift/IDLParser.swift new file mode 100644 index 00000000..eab40d7b --- /dev/null +++ b/Sources/WebIDLToSwift/IDLParser.swift @@ -0,0 +1,24 @@ +import Foundation +import WebIDL + +enum IDLParser { + private static func getJSONData() -> Data { + print("Fetching parsed IDL files...") + let task = Process() + let pipe = Pipe() + task.standardOutput = pipe + task.standardError = FileHandle.standardError + task.arguments = ["-c", "npm start --silent"] + task.launchPath = "/bin/zsh" + task.currentDirectoryPath = FileManager.default.currentDirectoryPath + "/parse-idl" + task.launch() + + return pipe.fileHandleForReading.readDataToEndOfFile() + } + + static func parseIDL() throws -> [String: GenericCollection] { + let data = getJSONData() + print("Building IDL struct tree...") + return try JSONDecoder().decode([String: GenericCollection].self, from: data) + } +} diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 21bc395d..6bfee4dc 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -5,12 +5,15 @@ main() func main() { do { - let data = try Data(contentsOf: Bundle.module.url(forResource: "data", withExtension: "json")!) - let idl = try JSONDecoder().decode([String: GenericCollection].self, from: data) - + let startTime = Date() + let idl = try IDLParser.parseIDL() + print("Removing old files...") try IDLBuilder.cleanOutputFolder() + print("Generating bindings...") try IDLBuilder.generateIDLBindings(idl: idl) + print("Generating closure property wrappers...") try IDLBuilder.generateClosureTypes() + print("Done in \(Int(Date().timeIntervalSince(startTime) * 1000))ms.") } catch { handleDecodingError(error) } diff --git a/fetch-idl/.prettierrc.json b/parse-idl/.prettierrc.json similarity index 100% rename from fetch-idl/.prettierrc.json rename to parse-idl/.prettierrc.json diff --git a/fetch-idl/package-lock.json b/parse-idl/package-lock.json similarity index 100% rename from fetch-idl/package-lock.json rename to parse-idl/package-lock.json diff --git a/fetch-idl/package.json b/parse-idl/package.json similarity index 85% rename from fetch-idl/package.json rename to parse-idl/package.json index 1489f0be..0ee60740 100644 --- a/fetch-idl/package.json +++ b/parse-idl/package.json @@ -2,7 +2,7 @@ "private": true, "type": "module", "scripts": { - "start": "node build.js" + "start": "node parse-all.js" }, "devDependencies": { "prettier": "2.6.1" diff --git a/fetch-idl/build.js b/parse-idl/parse-all.js similarity index 61% rename from fetch-idl/build.js rename to parse-idl/parse-all.js index d59aa48b..c8b46674 100644 --- a/fetch-idl/build.js +++ b/parse-idl/parse-all.js @@ -2,4 +2,4 @@ import { parseAll } from "@webref/idl"; import fs from "node:fs/promises"; const parsedFiles = await parseAll(); -await fs.writeFile("out.json", JSON.stringify(parsedFiles, null, 2)); +console.log(JSON.stringify(parsedFiles, null, 2)); From 2d995090eebb364856bb692a6fa237c204ccf84e Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 17:29:18 -0400 Subject: [PATCH 075/124] check in updated IDL files --- Sources/DOMKit/WebIDL/ARIAMixin.swift | 212 +++ Sources/DOMKit/WebIDL/AbortController.swift | 12 +- Sources/DOMKit/WebIDL/AbortSignal.swift | 26 +- Sources/DOMKit/WebIDL/AbstractRange.swift | 6 +- Sources/DOMKit/WebIDL/AbstractWorker.swift | 12 + .../WebIDL/AddEventListenerOptions.swift | 26 + .../AddEventListenerOptionsOrBool.swift | 38 - .../WebIDL/AnimationFrameProvider.swift | 13 + Sources/DOMKit/WebIDL/AnyChildNode.swift | 16 - .../WebIDL/AnyDocumentOrShadowRoot.swift | 16 - .../WebIDL/AnyElementContentEditable.swift | 16 - Sources/DOMKit/WebIDL/AnyEventListener.swift | 20 - .../DOMKit/WebIDL/AnyHTMLOrSVGElement.swift | 16 - Sources/DOMKit/WebIDL/AnyNodeFilter.swift | 20 - .../WebIDL/AnyNonDocumentTypeChildNode.swift | 16 - .../WebIDL/AnyNonElementParentNode.swift | 16 - Sources/DOMKit/WebIDL/AnyParentNode.swift | 16 - Sources/DOMKit/WebIDL/AnySlotable.swift | 16 - .../WebIDL/AnyWindowEventHandlers.swift | 16 - .../DOMKit/WebIDL/AnyXPathEvaluatorBase.swift | 16 - .../DOMKit/WebIDL/AnyXPathNSResolver.swift | 20 - Sources/DOMKit/WebIDL/ArrayBufferView.swift | 62 - .../WebIDL/ArrayBufferViewOrArrayBuffer.swift | 30 - .../DOMKit/WebIDL/AssignedNodesOptions.swift | 16 + Sources/DOMKit/WebIDL/Attr.swift | 6 +- Sources/DOMKit/WebIDL/AudioTrack.swift | 34 + Sources/DOMKit/WebIDL/AudioTrackList.swift | 36 + Sources/DOMKit/WebIDL/BarProp.swift | 18 + Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift | 14 + Sources/DOMKit/WebIDL/Blob.swift | 46 +- Sources/DOMKit/WebIDL/BlobPart.swift | 8 - Sources/DOMKit/WebIDL/BlobPropertyBag.swift | 21 + Sources/DOMKit/WebIDL/Body.swift | 61 + Sources/DOMKit/WebIDL/BroadcastChannel.swift | 36 + Sources/DOMKit/WebIDL/BufferSource.swift | 8 - .../WebIDL/BufferSourceOrBlobOrString.swift | 38 - .../WebIDL/ByteLengthQueuingStrategy.swift | 26 + Sources/DOMKit/WebIDL/CDATASection.swift | 6 +- Sources/DOMKit/WebIDL/CSS.swift | 22 + Sources/DOMKit/WebIDL/CSSConditionRule.swift | 16 + Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 24 + Sources/DOMKit/WebIDL/CSSImportRule.swift | 24 + Sources/DOMKit/WebIDL/CSSMarginRule.swift | 20 + Sources/DOMKit/WebIDL/CSSMediaRule.swift | 16 + Sources/DOMKit/WebIDL/CSSNamespaceRule.swift | 20 + Sources/DOMKit/WebIDL/CSSPageRule.swift | 20 + Sources/DOMKit/WebIDL/CSSRule.swift | 48 + Sources/DOMKit/WebIDL/CSSRuleList.swift | 22 + .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 50 + Sources/DOMKit/WebIDL/CSSStyleRule.swift | 20 + Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 58 + Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift | 26 + Sources/DOMKit/WebIDL/CSSSupportsRule.swift | 12 + Sources/DOMKit/WebIDL/CanPlayTypeResult.swift | 19 + Sources/DOMKit/WebIDL/CanvasCompositing.swift | 17 + Sources/DOMKit/WebIDL/CanvasDirection.swift | 19 + Sources/DOMKit/WebIDL/CanvasDrawImage.swift | 28 + Sources/DOMKit/WebIDL/CanvasDrawPath.swift | 51 + Sources/DOMKit/WebIDL/CanvasFillRule.swift | 18 + .../WebIDL/CanvasFillStrokeStyles.swift | 39 + Sources/DOMKit/WebIDL/CanvasFilter.swift | 18 + Sources/DOMKit/WebIDL/CanvasFilters.swift | 12 + Sources/DOMKit/WebIDL/CanvasFontKerning.swift | 19 + Sources/DOMKit/WebIDL/CanvasFontStretch.swift | 25 + .../DOMKit/WebIDL/CanvasFontVariantCaps.swift | 23 + Sources/DOMKit/WebIDL/CanvasGradient.swift | 18 + Sources/DOMKit/WebIDL/CanvasImageData.swift | 34 + .../DOMKit/WebIDL/CanvasImageSmoothing.swift | 17 + Sources/DOMKit/WebIDL/CanvasLineCap.swift | 19 + Sources/DOMKit/WebIDL/CanvasLineJoin.swift | 19 + Sources/DOMKit/WebIDL/CanvasPath.swift | 67 + .../WebIDL/CanvasPathDrawingStyles.swift | 40 + Sources/DOMKit/WebIDL/CanvasPattern.swift | 18 + Sources/DOMKit/WebIDL/CanvasRect.swift | 19 + .../WebIDL/CanvasRenderingContext2D.swift | 22 + .../CanvasRenderingContext2DSettings.swift | 31 + .../DOMKit/WebIDL/CanvasShadowStyles.swift | 27 + Sources/DOMKit/WebIDL/CanvasState.swift | 23 + Sources/DOMKit/WebIDL/CanvasText.swift | 19 + Sources/DOMKit/WebIDL/CanvasTextAlign.swift | 21 + .../DOMKit/WebIDL/CanvasTextBaseline.swift | 22 + .../WebIDL/CanvasTextDrawingStyles.swift | 57 + .../DOMKit/WebIDL/CanvasTextRendering.swift | 20 + Sources/DOMKit/WebIDL/CanvasTransform.swift | 51 + .../DOMKit/WebIDL/CanvasUserInterface.swift | 23 + Sources/DOMKit/WebIDL/CharacterData.swift | 18 +- Sources/DOMKit/WebIDL/ChildNode.swift | 33 +- Sources/DOMKit/WebIDL/ClosureAttribute.swift | 267 +++ .../DOMKit/WebIDL/ColorSpaceConversion.swift | 18 + Sources/DOMKit/WebIDL/Comment.swift | 10 +- Sources/DOMKit/WebIDL/CompositionEvent.swift | 3 + .../DOMKit/WebIDL/CompositionEventInit.swift | 16 + .../DOMKit/WebIDL/CountQueuingStrategy.swift | 26 + .../DOMKit/WebIDL/CustomElementRegistry.swift | 28 + Sources/DOMKit/WebIDL/CustomEvent.swift | 14 +- Sources/DOMKit/WebIDL/CustomEventInit.swift | 16 + Sources/DOMKit/WebIDL/DOMException.swift | 60 +- .../DOMKit/WebIDL/DOMHighResTimeStamp.swift | 3 - Sources/DOMKit/WebIDL/DOMImplementation.swift | 20 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 233 +++ Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift | 71 + Sources/DOMKit/WebIDL/DOMMatrixInit.swift | 66 + Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 204 +++ Sources/DOMKit/WebIDL/DOMParser.swift | 22 + .../WebIDL/DOMParserSupportedType.swift | 21 + Sources/DOMKit/WebIDL/DOMPoint.swift | 47 + Sources/DOMKit/WebIDL/DOMPointInit.swift | 31 + Sources/DOMKit/WebIDL/DOMPointReadOnly.swift | 46 + Sources/DOMKit/WebIDL/DOMQuad.swift | 50 + Sources/DOMKit/WebIDL/DOMQuadInit.swift | 31 + Sources/DOMKit/WebIDL/DOMRect.swift | 47 + Sources/DOMKit/WebIDL/DOMRectInit.swift | 31 + Sources/DOMKit/WebIDL/DOMRectList.swift | 22 + Sources/DOMKit/WebIDL/DOMRectReadOnly.swift | 58 + Sources/DOMKit/WebIDL/DOMStringList.swift | 26 + Sources/DOMKit/WebIDL/DOMStringMap.swift | 19 +- Sources/DOMKit/WebIDL/DOMTimeStamp.swift | 8 - Sources/DOMKit/WebIDL/DOMTokenList.swift | 47 +- Sources/DOMKit/WebIDL/DataTransfer.swift | 54 + Sources/DOMKit/WebIDL/DataTransferItem.swift | 28 + .../DOMKit/WebIDL/DataTransferItemList.swift | 38 + .../WebIDL/DedicatedWorkerGlobalScope.swift | 36 + Sources/DOMKit/WebIDL/Document.swift | 244 ++- .../DocumentAndElementEventHandlers.swift | 58 +- Sources/DOMKit/WebIDL/DocumentFragment.swift | 8 +- .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 16 +- .../DOMKit/WebIDL/DocumentReadyState.swift | 19 + Sources/DOMKit/WebIDL/DocumentType.swift | 6 +- .../WebIDL/DocumentVisibilityState.swift | 18 + Sources/DOMKit/WebIDL/DragEvent.swift | 20 + Sources/DOMKit/WebIDL/DragEventInit.swift | 16 + Sources/DOMKit/WebIDL/Element.swift | 64 +- .../DOMKit/WebIDL/ElementCSSInlineStyle.swift | 9 + .../WebIDL/ElementContentEditable.swift | 35 +- .../WebIDL/ElementCreationOptions.swift | 16 + .../WebIDL/ElementDefinitionOptions.swift | 16 + Sources/DOMKit/WebIDL/ElementInternals.swift | 34 +- Sources/DOMKit/WebIDL/EndingType.swift | 23 +- Sources/DOMKit/WebIDL/EpochTimeStamp.swift | 3 - Sources/DOMKit/WebIDL/ErrorEvent.swift | 36 + Sources/DOMKit/WebIDL/ErrorEventInit.swift | 36 + Sources/DOMKit/WebIDL/Event.swift | 30 +- Sources/DOMKit/WebIDL/EventHandler.swift | 8 - .../DOMKit/WebIDL/EventHandlerNonNull.swift | 8 - Sources/DOMKit/WebIDL/EventInit.swift | 26 + Sources/DOMKit/WebIDL/EventListener.swift | 10 - .../DOMKit/WebIDL/EventListenerOptions.swift | 16 + .../WebIDL/EventListenerOptionsOrBool.swift | 38 - Sources/DOMKit/WebIDL/EventModifierInit.swift | 81 + Sources/DOMKit/WebIDL/EventOrString.swift | 34 - Sources/DOMKit/WebIDL/EventSource.swift | 50 + Sources/DOMKit/WebIDL/EventSourceInit.swift | 16 + Sources/DOMKit/WebIDL/EventTarget.swift | 75 +- Sources/DOMKit/WebIDL/External.swift | 22 + Sources/DOMKit/WebIDL/File.swift | 10 +- Sources/DOMKit/WebIDL/FileList.swift | 10 +- Sources/DOMKit/WebIDL/FileOrString.swift | 34 - .../WebIDL/FileOrStringOrFormData.swift | 38 - Sources/DOMKit/WebIDL/FilePropertyBag.swift | 16 + Sources/DOMKit/WebIDL/FileReader.swift | 56 +- Sources/DOMKit/WebIDL/FileReaderSync.swift | 22 +- Sources/DOMKit/WebIDL/FocusEvent.swift | 3 + Sources/DOMKit/WebIDL/FocusEventInit.swift | 16 + Sources/DOMKit/WebIDL/FocusOptions.swift | 16 + Sources/DOMKit/WebIDL/FormData.swift | 49 +- .../DOMKit/WebIDL/FormDataEntryValue.swift | 8 - Sources/DOMKit/WebIDL/FormDataEvent.swift | 20 + Sources/DOMKit/WebIDL/FormDataEventInit.swift | 16 + Sources/DOMKit/WebIDL/Function.swift | 8 - .../WebIDL/GenericTransformStream.swift | 11 + .../DOMKit/WebIDL/GetRootNodeOptions.swift | 16 + .../DOMKit/WebIDL/GlobalEventHandlers.swift | 347 ++++ Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 30 + Sources/DOMKit/WebIDL/HTMLAnchorElement.swift | 72 + Sources/DOMKit/WebIDL/HTMLAreaElement.swift | 56 + Sources/DOMKit/WebIDL/HTMLAudioElement.swift | 16 + Sources/DOMKit/WebIDL/HTMLBRElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLBaseElement.swift | 24 + Sources/DOMKit/WebIDL/HTMLBodyElement.swift | 40 + Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 84 + Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 38 + Sources/DOMKit/WebIDL/HTMLCollection.swift | 18 +- Sources/DOMKit/WebIDL/HTMLDListElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLDataElement.swift | 20 + .../DOMKit/WebIDL/HTMLDataListElement.swift | 20 + .../DOMKit/WebIDL/HTMLDetailsElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 36 + .../DOMKit/WebIDL/HTMLDirectoryElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLDivElement.swift | 20 + .../WebIDL/HTMLElement+EventHandler.swift | 1549 ----------------- Sources/DOMKit/WebIDL/HTMLElement.swift | 30 +- Sources/DOMKit/WebIDL/HTMLEmbedElement.swift | 44 + .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 60 + Sources/DOMKit/WebIDL/HTMLFontElement.swift | 28 + .../WebIDL/HTMLFormControlsCollection.swift | 10 +- Sources/DOMKit/WebIDL/HTMLFormElement.swift | 30 +- Sources/DOMKit/WebIDL/HTMLFrameElement.swift | 56 + .../DOMKit/WebIDL/HTMLFrameSetElement.swift | 24 + Sources/DOMKit/WebIDL/HTMLHRElement.swift | 36 + Sources/DOMKit/WebIDL/HTMLHeadElement.swift | 16 + .../DOMKit/WebIDL/HTMLHeadingElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLHtmlElement.swift | 20 + .../WebIDL/HTMLHyperlinkElementUtils.swift | 59 + Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 92 + Sources/DOMKit/WebIDL/HTMLImageElement.swift | 118 ++ Sources/DOMKit/WebIDL/HTMLInputElement.swift | 236 +++ Sources/DOMKit/WebIDL/HTMLLIElement.swift | 24 + Sources/DOMKit/WebIDL/HTMLLabelElement.swift | 28 + Sources/DOMKit/WebIDL/HTMLLegendElement.swift | 24 + Sources/DOMKit/WebIDL/HTMLLinkElement.swift | 88 + Sources/DOMKit/WebIDL/HTMLMapElement.swift | 24 + .../DOMKit/WebIDL/HTMLMarqueeElement.swift | 68 + Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 176 ++ Sources/DOMKit/WebIDL/HTMLMenuElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLMetaElement.swift | 36 + Sources/DOMKit/WebIDL/HTMLMeterElement.swift | 44 + Sources/DOMKit/WebIDL/HTMLModElement.swift | 24 + Sources/DOMKit/WebIDL/HTMLOListElement.swift | 32 + Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 120 ++ .../DOMKit/WebIDL/HTMLOptGroupElement.swift | 24 + Sources/DOMKit/WebIDL/HTMLOptionElement.swift | 48 + .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 33 + Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift | 41 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 68 + .../DOMKit/WebIDL/HTMLParagraphElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLParamElement.swift | 32 + .../DOMKit/WebIDL/HTMLPictureElement.swift | 16 + Sources/DOMKit/WebIDL/HTMLPreElement.swift | 20 + .../DOMKit/WebIDL/HTMLProgressElement.swift | 32 + Sources/DOMKit/WebIDL/HTMLQuoteElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 72 + Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 118 ++ Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 20 +- Sources/DOMKit/WebIDL/HTMLSourceElement.swift | 44 + Sources/DOMKit/WebIDL/HTMLSpanElement.swift | 16 + Sources/DOMKit/WebIDL/HTMLStyleElement.swift | 28 + .../WebIDL/HTMLTableCaptionElement.swift | 20 + .../DOMKit/WebIDL/HTMLTableCellElement.swift | 76 + .../DOMKit/WebIDL/HTMLTableColElement.swift | 40 + Sources/DOMKit/WebIDL/HTMLTableElement.swift | 108 ++ .../DOMKit/WebIDL/HTMLTableRowElement.swift | 56 + .../WebIDL/HTMLTableSectionElement.swift | 44 + .../DOMKit/WebIDL/HTMLTemplateElement.swift | 20 + .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 140 ++ Sources/DOMKit/WebIDL/HTMLTimeElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLTitleElement.swift | 20 + Sources/DOMKit/WebIDL/HTMLTrackElement.swift | 52 + Sources/DOMKit/WebIDL/HTMLUListElement.swift | 24 + .../DOMKit/WebIDL/HTMLUnknownElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 40 + Sources/DOMKit/WebIDL/HashChangeEvent.swift | 24 + .../DOMKit/WebIDL/HashChangeEventInit.swift | 21 + Sources/DOMKit/WebIDL/Headers.swift | 43 + Sources/DOMKit/WebIDL/History.swift | 46 + Sources/DOMKit/WebIDL/ImageBitmap.swift | 26 + .../DOMKit/WebIDL/ImageBitmapOptions.swift | 41 + .../WebIDL/ImageBitmapRenderingContext.swift | 22 + .../ImageBitmapRenderingContextSettings.swift | 16 + Sources/DOMKit/WebIDL/ImageData.swift | 38 + Sources/DOMKit/WebIDL/ImageDataSettings.swift | 16 + .../DOMKit/WebIDL/ImageEncodeOptions.swift | 21 + Sources/DOMKit/WebIDL/ImageOrientation.swift | 18 + .../DOMKit/WebIDL/ImageSmoothingQuality.swift | 19 + Sources/DOMKit/WebIDL/InputEvent.swift | 3 + Sources/DOMKit/WebIDL/InputEventInit.swift | 26 + Sources/DOMKit/WebIDL/KeyboardEvent.swift | 33 +- Sources/DOMKit/WebIDL/KeyboardEventInit.swift | 46 + Sources/DOMKit/WebIDL/LinkStyle.swift | 9 + Sources/DOMKit/WebIDL/Location.swift | 66 + Sources/DOMKit/WebIDL/MediaError.swift | 30 + Sources/DOMKit/WebIDL/MediaList.swift | 34 + Sources/DOMKit/WebIDL/MessageChannel.swift | 26 + Sources/DOMKit/WebIDL/MessageEvent.swift | 48 + Sources/DOMKit/WebIDL/MessageEventInit.swift | 36 + Sources/DOMKit/WebIDL/MessagePort.swift | 36 + Sources/DOMKit/WebIDL/MimeType.swift | 30 + Sources/DOMKit/WebIDL/MimeTypeArray.swift | 26 + Sources/DOMKit/WebIDL/MouseEvent.swift | 34 +- Sources/DOMKit/WebIDL/MouseEventInit.swift | 46 + Sources/DOMKit/WebIDL/MutationCallback.swift | 8 - Sources/DOMKit/WebIDL/MutationEvent.swift | 25 +- Sources/DOMKit/WebIDL/MutationObserver.swift | 25 +- .../DOMKit/WebIDL/MutationObserverInit.swift | 46 + Sources/DOMKit/WebIDL/MutationRecord.swift | 6 +- Sources/DOMKit/WebIDL/NamedNodeMap.swift | 28 +- Sources/DOMKit/WebIDL/Navigator.swift | 14 + .../WebIDL/NavigatorConcurrentHardware.swift | 9 + .../DOMKit/WebIDL/NavigatorContentUtils.swift | 15 + Sources/DOMKit/WebIDL/NavigatorCookies.swift | 9 + Sources/DOMKit/WebIDL/NavigatorID.swift | 31 + Sources/DOMKit/WebIDL/NavigatorLanguage.swift | 11 + Sources/DOMKit/WebIDL/NavigatorOnLine.swift | 9 + Sources/DOMKit/WebIDL/NavigatorPlugins.swift | 17 + Sources/DOMKit/WebIDL/Node.swift | 84 +- Sources/DOMKit/WebIDL/NodeFilter.swift | 76 - Sources/DOMKit/WebIDL/NodeIterator.swift | 16 +- Sources/DOMKit/WebIDL/NodeList.swift | 15 +- Sources/DOMKit/WebIDL/NodeOrString.swift | 34 - .../WebIDL/NonDocumentTypeChildNode.swift | 15 +- .../DOMKit/WebIDL/NonElementParentNode.swift | 9 +- Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 50 + .../OffscreenCanvasRenderingContext2D.swift | 22 + .../WebIDL/OffscreenRenderingContextId.swift | 21 + .../WebIDL/OnBeforeUnloadEventHandler.swift | 8 - .../OnBeforeUnloadEventHandlerNonNull.swift | 8 - .../DOMKit/WebIDL/OnErrorEventHandler.swift | 8 - .../WebIDL/OnErrorEventHandlerNonNull.swift | 8 - .../DOMKit/WebIDL/PageTransitionEvent.swift | 20 + .../WebIDL/PageTransitionEventInit.swift | 16 + Sources/DOMKit/WebIDL/ParentNode.swift | 43 +- Sources/DOMKit/WebIDL/Path2D.swift | 22 + Sources/DOMKit/WebIDL/Performance.swift | 3 + Sources/DOMKit/WebIDL/Plugin.swift | 38 + Sources/DOMKit/WebIDL/PluginArray.swift | 30 + Sources/DOMKit/WebIDL/PopStateEvent.swift | 20 + Sources/DOMKit/WebIDL/PopStateEventInit.swift | 16 + .../DOMKit/WebIDL/PredefinedColorSpace.swift | 18 + Sources/DOMKit/WebIDL/PremultiplyAlpha.swift | 19 + .../DOMKit/WebIDL/ProcessingInstruction.swift | 8 +- Sources/DOMKit/WebIDL/ProgressEvent.swift | 28 + Sources/DOMKit/WebIDL/ProgressEventInit.swift | 26 + .../DOMKit/WebIDL/PromiseRejectionEvent.swift | 24 + .../WebIDL/PromiseRejectionEventInit.swift | 21 + Sources/DOMKit/WebIDL/QueuingStrategy.swift | 21 + .../DOMKit/WebIDL/QueuingStrategyInit.swift | 16 + Sources/DOMKit/WebIDL/RadioNodeList.swift | 6 +- .../WebIDL/RadioNodeListOrElement.swift | 30 - Sources/DOMKit/WebIDL/Range.swift | 64 +- .../WebIDL/ReadableByteStreamController.swift | 34 + Sources/DOMKit/WebIDL/ReadableStream.swift | 60 + .../WebIDL/ReadableStreamBYOBReadResult.swift | 21 + .../WebIDL/ReadableStreamBYOBReader.swift | 32 + .../WebIDL/ReadableStreamBYOBRequest.swift | 26 + .../ReadableStreamDefaultController.swift | 30 + .../ReadableStreamDefaultReadResult.swift | 21 + .../WebIDL/ReadableStreamDefaultReader.swift | 32 + .../WebIDL/ReadableStreamGenericReader.swift | 19 + .../ReadableStreamGetReaderOptions.swift | 16 + .../ReadableStreamIteratorOptions.swift | 16 + .../WebIDL/ReadableStreamReaderMode.swift | 17 + .../DOMKit/WebIDL/ReadableStreamType.swift | 17 + .../DOMKit/WebIDL/ReadableWritablePair.swift | 21 + Sources/DOMKit/WebIDL/ReferrerPolicy.swift | 25 + Sources/DOMKit/WebIDL/Request.swift | 82 + Sources/DOMKit/WebIDL/RequestCache.swift | 22 + .../DOMKit/WebIDL/RequestCredentials.swift | 19 + .../DOMKit/WebIDL/RequestDestination.swift | 36 + Sources/DOMKit/WebIDL/RequestInit.swift | 76 + Sources/DOMKit/WebIDL/RequestMode.swift | 20 + Sources/DOMKit/WebIDL/RequestRedirect.swift | 19 + Sources/DOMKit/WebIDL/ResizeQuality.swift | 20 + Sources/DOMKit/WebIDL/Response.swift | 58 + Sources/DOMKit/WebIDL/ResponseInit.swift | 26 + Sources/DOMKit/WebIDL/ResponseType.swift | 22 + Sources/DOMKit/WebIDL/ScrollRestoration.swift | 18 + Sources/DOMKit/WebIDL/SelectionMode.swift | 20 + Sources/DOMKit/WebIDL/ShadowRoot.swift | 18 +- Sources/DOMKit/WebIDL/ShadowRootInit.swift | 26 + Sources/DOMKit/WebIDL/ShadowRootMode.swift | 23 +- Sources/DOMKit/WebIDL/SharedWorker.swift | 20 + .../WebIDL/SharedWorkerGlobalScope.swift | 24 + .../DOMKit/WebIDL/SlotAssignmentMode.swift | 18 + Sources/DOMKit/WebIDL/Slotable.swift | 14 - Sources/DOMKit/WebIDL/Slottable.swift | 9 + Sources/DOMKit/WebIDL/StaticRange.swift | 8 +- Sources/DOMKit/WebIDL/StaticRangeInit.swift | 31 + Sources/DOMKit/WebIDL/Storage.swift | 34 + Sources/DOMKit/WebIDL/StorageEvent.swift | 48 + Sources/DOMKit/WebIDL/StorageEventInit.swift | 36 + Sources/DOMKit/WebIDL/StreamPipeOptions.swift | 31 + .../DOMKit/WebIDL/StringOrArrayBuffer.swift | 34 - .../StringOrElementCreationOptions.swift | 38 - .../WebIDL/StructuredSerializeOptions.swift | 16 + Sources/DOMKit/WebIDL/StyleSheet.swift | 42 + Sources/DOMKit/WebIDL/StyleSheetList.swift | 22 + Sources/DOMKit/WebIDL/SubmitEvent.swift | 20 + Sources/DOMKit/WebIDL/SubmitEventInit.swift | 16 + Sources/DOMKit/WebIDL/Text.swift | 16 +- Sources/DOMKit/WebIDL/TextMetrics.swift | 62 + Sources/DOMKit/WebIDL/TextTrack.swift | 56 + Sources/DOMKit/WebIDL/TextTrackCue.swift | 40 + Sources/DOMKit/WebIDL/TextTrackCueList.swift | 26 + Sources/DOMKit/WebIDL/TextTrackKind.swift | 21 + Sources/DOMKit/WebIDL/TextTrackList.swift | 36 + Sources/DOMKit/WebIDL/TextTrackMode.swift | 19 + Sources/DOMKit/WebIDL/TimeRanges.swift | 26 + Sources/DOMKit/WebIDL/TrackEvent.swift | 20 + Sources/DOMKit/WebIDL/TrackEventInit.swift | 16 + Sources/DOMKit/WebIDL/TransformStream.swift | 26 + .../TransformStreamDefaultController.swift | 30 + Sources/DOMKit/WebIDL/Transformer.swift | 36 + Sources/DOMKit/WebIDL/TreeWalker.swift | 24 +- Sources/DOMKit/WebIDL/Typedefs.swift | 51 + Sources/DOMKit/WebIDL/UIEvent.swift | 9 +- Sources/DOMKit/WebIDL/UIEventInit.swift | 26 + Sources/DOMKit/WebIDL/URL.swift | 14 +- Sources/DOMKit/WebIDL/UnderlyingSink.swift | 36 + Sources/DOMKit/WebIDL/UnderlyingSource.swift | 36 + Sources/DOMKit/WebIDL/ValidityState.swift | 6 +- .../DOMKit/WebIDL/ValidityStateFlags.swift | 61 + Sources/DOMKit/WebIDL/VideoTrack.swift | 34 + Sources/DOMKit/WebIDL/VideoTrackList.swift | 40 + Sources/DOMKit/WebIDL/WheelEvent.swift | 11 +- Sources/DOMKit/WebIDL/WheelEventInit.swift | 31 + Sources/DOMKit/WebIDL/Window.swift | 180 +- .../DOMKit/WebIDL/WindowEventHandlers.swift | 279 +-- .../DOMKit/WebIDL/WindowLocalStorage.swift | 9 + .../WebIDL/WindowOrWorkerGlobalScope.swift | 91 + .../WebIDL/WindowPostMessageOptions.swift | 16 + .../DOMKit/WebIDL/WindowSessionStorage.swift | 9 + Sources/DOMKit/WebIDL/Worker.swift | 36 + Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 52 + Sources/DOMKit/WebIDL/WorkerLocation.swift | 50 + Sources/DOMKit/WebIDL/WorkerNavigator.swift | 14 + Sources/DOMKit/WebIDL/WorkerOptions.swift | 26 + Sources/DOMKit/WebIDL/WorkerType.swift | 18 + Sources/DOMKit/WebIDL/Worklet.swift | 24 + .../DOMKit/WebIDL/WorkletGlobalScope.swift | 14 + Sources/DOMKit/WebIDL/WorkletOptions.swift | 16 + Sources/DOMKit/WebIDL/WritableStream.swift | 46 + .../WritableStreamDefaultController.swift | 22 + .../WebIDL/WritableStreamDefaultWriter.swift | 64 + Sources/DOMKit/WebIDL/XMLDocument.swift | 6 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 106 ++ .../WebIDL/XMLHttpRequestEventTarget.swift | 40 + .../WebIDL/XMLHttpRequestResponseType.swift | 22 + .../DOMKit/WebIDL/XMLHttpRequestUpload.swift | 12 + Sources/DOMKit/WebIDL/XPathEvaluator.swift | 8 +- .../DOMKit/WebIDL/XPathEvaluatorBase.swift | 27 +- Sources/DOMKit/WebIDL/XPathExpression.swift | 10 +- Sources/DOMKit/WebIDL/XPathNSResolver.swift | 10 - Sources/DOMKit/WebIDL/XPathResult.swift | 30 +- Sources/DOMKit/WebIDL/XSLTProcessor.swift | 50 + Sources/DOMKit/WebIDL/console.swift | 122 +- .../WebIDL+SwiftRepresentation.swift | 1 - 435 files changed, 12687 insertions(+), 3728 deletions(-) create mode 100644 Sources/DOMKit/WebIDL/ARIAMixin.swift create mode 100644 Sources/DOMKit/WebIDL/AbstractWorker.swift create mode 100644 Sources/DOMKit/WebIDL/AddEventListenerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AddEventListenerOptionsOrBool.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationFrameProvider.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyChildNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyDocumentOrShadowRoot.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyElementContentEditable.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyEventListener.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyHTMLOrSVGElement.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyNodeFilter.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyNonDocumentTypeChildNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyNonElementParentNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyParentNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AnySlotable.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyWindowEventHandlers.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyXPathEvaluatorBase.swift delete mode 100644 Sources/DOMKit/WebIDL/AnyXPathNSResolver.swift delete mode 100644 Sources/DOMKit/WebIDL/ArrayBufferView.swift delete mode 100644 Sources/DOMKit/WebIDL/ArrayBufferViewOrArrayBuffer.swift create mode 100644 Sources/DOMKit/WebIDL/AssignedNodesOptions.swift create mode 100644 Sources/DOMKit/WebIDL/AudioTrack.swift create mode 100644 Sources/DOMKit/WebIDL/AudioTrackList.swift create mode 100644 Sources/DOMKit/WebIDL/BarProp.swift create mode 100644 Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/BlobPart.swift create mode 100644 Sources/DOMKit/WebIDL/BlobPropertyBag.swift create mode 100644 Sources/DOMKit/WebIDL/Body.swift create mode 100644 Sources/DOMKit/WebIDL/BroadcastChannel.swift delete mode 100644 Sources/DOMKit/WebIDL/BufferSource.swift delete mode 100644 Sources/DOMKit/WebIDL/BufferSourceOrBlobOrString.swift create mode 100644 Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift create mode 100644 Sources/DOMKit/WebIDL/CSS.swift create mode 100644 Sources/DOMKit/WebIDL/CSSConditionRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSGroupingRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSImportRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMarginRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMediaRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSNamespaceRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSPageRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSRuleList.swift create mode 100644 Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift create mode 100644 Sources/DOMKit/WebIDL/CSSStyleRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSStyleSheet.swift create mode 100644 Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift create mode 100644 Sources/DOMKit/WebIDL/CSSSupportsRule.swift create mode 100644 Sources/DOMKit/WebIDL/CanPlayTypeResult.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasCompositing.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasDirection.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasDrawImage.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasDrawPath.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasFillRule.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasFilter.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasFilters.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasFontKerning.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasFontStretch.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasGradient.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasImageData.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasLineCap.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasLineJoin.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasPath.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasPattern.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasRect.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasShadowStyles.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasState.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasText.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasTextAlign.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasTextBaseline.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasTextRendering.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasTransform.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasUserInterface.swift create mode 100644 Sources/DOMKit/WebIDL/ClosureAttribute.swift create mode 100644 Sources/DOMKit/WebIDL/ColorSpaceConversion.swift create mode 100644 Sources/DOMKit/WebIDL/CompositionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/CountQueuingStrategy.swift create mode 100644 Sources/DOMKit/WebIDL/CustomElementRegistry.swift create mode 100644 Sources/DOMKit/WebIDL/CustomEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/DOMHighResTimeStamp.swift create mode 100644 Sources/DOMKit/WebIDL/DOMMatrix.swift create mode 100644 Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift create mode 100644 Sources/DOMKit/WebIDL/DOMMatrixInit.swift create mode 100644 Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift create mode 100644 Sources/DOMKit/WebIDL/DOMParser.swift create mode 100644 Sources/DOMKit/WebIDL/DOMParserSupportedType.swift create mode 100644 Sources/DOMKit/WebIDL/DOMPoint.swift create mode 100644 Sources/DOMKit/WebIDL/DOMPointInit.swift create mode 100644 Sources/DOMKit/WebIDL/DOMPointReadOnly.swift create mode 100644 Sources/DOMKit/WebIDL/DOMQuad.swift create mode 100644 Sources/DOMKit/WebIDL/DOMQuadInit.swift create mode 100644 Sources/DOMKit/WebIDL/DOMRect.swift create mode 100644 Sources/DOMKit/WebIDL/DOMRectInit.swift create mode 100644 Sources/DOMKit/WebIDL/DOMRectList.swift create mode 100644 Sources/DOMKit/WebIDL/DOMRectReadOnly.swift create mode 100644 Sources/DOMKit/WebIDL/DOMStringList.swift delete mode 100644 Sources/DOMKit/WebIDL/DOMTimeStamp.swift create mode 100644 Sources/DOMKit/WebIDL/DataTransfer.swift create mode 100644 Sources/DOMKit/WebIDL/DataTransferItem.swift create mode 100644 Sources/DOMKit/WebIDL/DataTransferItemList.swift create mode 100644 Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/DocumentReadyState.swift create mode 100644 Sources/DOMKit/WebIDL/DocumentVisibilityState.swift create mode 100644 Sources/DOMKit/WebIDL/DragEvent.swift create mode 100644 Sources/DOMKit/WebIDL/DragEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift create mode 100644 Sources/DOMKit/WebIDL/ElementCreationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/EpochTimeStamp.swift create mode 100644 Sources/DOMKit/WebIDL/ErrorEvent.swift create mode 100644 Sources/DOMKit/WebIDL/ErrorEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/EventHandler.swift delete mode 100644 Sources/DOMKit/WebIDL/EventHandlerNonNull.swift create mode 100644 Sources/DOMKit/WebIDL/EventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/EventListener.swift create mode 100644 Sources/DOMKit/WebIDL/EventListenerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/EventListenerOptionsOrBool.swift create mode 100644 Sources/DOMKit/WebIDL/EventModifierInit.swift delete mode 100644 Sources/DOMKit/WebIDL/EventOrString.swift create mode 100644 Sources/DOMKit/WebIDL/EventSource.swift create mode 100644 Sources/DOMKit/WebIDL/EventSourceInit.swift create mode 100644 Sources/DOMKit/WebIDL/External.swift delete mode 100644 Sources/DOMKit/WebIDL/FileOrString.swift delete mode 100644 Sources/DOMKit/WebIDL/FileOrStringOrFormData.swift create mode 100644 Sources/DOMKit/WebIDL/FilePropertyBag.swift create mode 100644 Sources/DOMKit/WebIDL/FocusEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/FocusOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/FormDataEntryValue.swift create mode 100644 Sources/DOMKit/WebIDL/FormDataEvent.swift create mode 100644 Sources/DOMKit/WebIDL/FormDataEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/Function.swift create mode 100644 Sources/DOMKit/WebIDL/GenericTransformStream.swift create mode 100644 Sources/DOMKit/WebIDL/GetRootNodeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/GlobalEventHandlers.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLAllCollection.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLAnchorElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLAreaElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLAudioElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLBRElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLBaseElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLBodyElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLButtonElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLCanvasElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLDListElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLDataElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLDataListElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLDetailsElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLDialogElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLDivElement.swift delete mode 100644 Sources/DOMKit/WebIDL/HTMLElement+EventHandler.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLEmbedElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLFontElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLFrameElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLHRElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLHeadElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLHeadingElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLHtmlElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLIFrameElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLImageElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLInputElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLLIElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLLabelElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLLegendElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLLinkElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLMapElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLMediaElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLMenuElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLMetaElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLMeterElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLModElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLOListElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLObjectElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLOptionElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLOutputElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLParagraphElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLParamElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLPictureElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLPreElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLProgressElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLQuoteElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLScriptElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLSelectElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLSourceElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLSpanElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLStyleElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTableCellElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTableColElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTableElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTableRowElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTemplateElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTimeElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTitleElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLTrackElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLUListElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLVideoElement.swift create mode 100644 Sources/DOMKit/WebIDL/HashChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/HashChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/Headers.swift create mode 100644 Sources/DOMKit/WebIDL/History.swift create mode 100644 Sources/DOMKit/WebIDL/ImageBitmap.swift create mode 100644 Sources/DOMKit/WebIDL/ImageBitmapOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift create mode 100644 Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift create mode 100644 Sources/DOMKit/WebIDL/ImageData.swift create mode 100644 Sources/DOMKit/WebIDL/ImageDataSettings.swift create mode 100644 Sources/DOMKit/WebIDL/ImageEncodeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ImageOrientation.swift create mode 100644 Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift create mode 100644 Sources/DOMKit/WebIDL/InputEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/KeyboardEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/LinkStyle.swift create mode 100644 Sources/DOMKit/WebIDL/Location.swift create mode 100644 Sources/DOMKit/WebIDL/MediaError.swift create mode 100644 Sources/DOMKit/WebIDL/MediaList.swift create mode 100644 Sources/DOMKit/WebIDL/MessageChannel.swift create mode 100644 Sources/DOMKit/WebIDL/MessageEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MessageEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/MessagePort.swift create mode 100644 Sources/DOMKit/WebIDL/MimeType.swift create mode 100644 Sources/DOMKit/WebIDL/MimeTypeArray.swift create mode 100644 Sources/DOMKit/WebIDL/MouseEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MutationCallback.swift create mode 100644 Sources/DOMKit/WebIDL/MutationObserverInit.swift create mode 100644 Sources/DOMKit/WebIDL/Navigator.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorContentUtils.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorCookies.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorID.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorLanguage.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorOnLine.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorPlugins.swift delete mode 100644 Sources/DOMKit/WebIDL/NodeFilter.swift delete mode 100644 Sources/DOMKit/WebIDL/NodeOrString.swift create mode 100644 Sources/DOMKit/WebIDL/OffscreenCanvas.swift create mode 100644 Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift create mode 100644 Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift delete mode 100644 Sources/DOMKit/WebIDL/OnBeforeUnloadEventHandler.swift delete mode 100644 Sources/DOMKit/WebIDL/OnBeforeUnloadEventHandlerNonNull.swift delete mode 100644 Sources/DOMKit/WebIDL/OnErrorEventHandler.swift delete mode 100644 Sources/DOMKit/WebIDL/OnErrorEventHandlerNonNull.swift create mode 100644 Sources/DOMKit/WebIDL/PageTransitionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PageTransitionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/Path2D.swift create mode 100644 Sources/DOMKit/WebIDL/Plugin.swift create mode 100644 Sources/DOMKit/WebIDL/PluginArray.swift create mode 100644 Sources/DOMKit/WebIDL/PopStateEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PopStateEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PredefinedColorSpace.swift create mode 100644 Sources/DOMKit/WebIDL/PremultiplyAlpha.swift create mode 100644 Sources/DOMKit/WebIDL/ProgressEvent.swift create mode 100644 Sources/DOMKit/WebIDL/ProgressEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/QueuingStrategy.swift create mode 100644 Sources/DOMKit/WebIDL/QueuingStrategyInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RadioNodeListOrElement.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableByteStreamController.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStream.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamType.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableWritablePair.swift create mode 100644 Sources/DOMKit/WebIDL/ReferrerPolicy.swift create mode 100644 Sources/DOMKit/WebIDL/Request.swift create mode 100644 Sources/DOMKit/WebIDL/RequestCache.swift create mode 100644 Sources/DOMKit/WebIDL/RequestCredentials.swift create mode 100644 Sources/DOMKit/WebIDL/RequestDestination.swift create mode 100644 Sources/DOMKit/WebIDL/RequestInit.swift create mode 100644 Sources/DOMKit/WebIDL/RequestMode.swift create mode 100644 Sources/DOMKit/WebIDL/RequestRedirect.swift create mode 100644 Sources/DOMKit/WebIDL/ResizeQuality.swift create mode 100644 Sources/DOMKit/WebIDL/Response.swift create mode 100644 Sources/DOMKit/WebIDL/ResponseInit.swift create mode 100644 Sources/DOMKit/WebIDL/ResponseType.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollRestoration.swift create mode 100644 Sources/DOMKit/WebIDL/SelectionMode.swift create mode 100644 Sources/DOMKit/WebIDL/ShadowRootInit.swift create mode 100644 Sources/DOMKit/WebIDL/SharedWorker.swift create mode 100644 Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/SlotAssignmentMode.swift delete mode 100644 Sources/DOMKit/WebIDL/Slotable.swift create mode 100644 Sources/DOMKit/WebIDL/Slottable.swift create mode 100644 Sources/DOMKit/WebIDL/StaticRangeInit.swift create mode 100644 Sources/DOMKit/WebIDL/Storage.swift create mode 100644 Sources/DOMKit/WebIDL/StorageEvent.swift create mode 100644 Sources/DOMKit/WebIDL/StorageEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/StreamPipeOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/StringOrArrayBuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/StringOrElementCreationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/StyleSheet.swift create mode 100644 Sources/DOMKit/WebIDL/StyleSheetList.swift create mode 100644 Sources/DOMKit/WebIDL/SubmitEvent.swift create mode 100644 Sources/DOMKit/WebIDL/SubmitEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/TextMetrics.swift create mode 100644 Sources/DOMKit/WebIDL/TextTrack.swift create mode 100644 Sources/DOMKit/WebIDL/TextTrackCue.swift create mode 100644 Sources/DOMKit/WebIDL/TextTrackCueList.swift create mode 100644 Sources/DOMKit/WebIDL/TextTrackKind.swift create mode 100644 Sources/DOMKit/WebIDL/TextTrackList.swift create mode 100644 Sources/DOMKit/WebIDL/TextTrackMode.swift create mode 100644 Sources/DOMKit/WebIDL/TimeRanges.swift create mode 100644 Sources/DOMKit/WebIDL/TrackEvent.swift create mode 100644 Sources/DOMKit/WebIDL/TrackEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/TransformStream.swift create mode 100644 Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift create mode 100644 Sources/DOMKit/WebIDL/Transformer.swift create mode 100644 Sources/DOMKit/WebIDL/Typedefs.swift create mode 100644 Sources/DOMKit/WebIDL/UIEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/UnderlyingSink.swift create mode 100644 Sources/DOMKit/WebIDL/UnderlyingSource.swift create mode 100644 Sources/DOMKit/WebIDL/ValidityStateFlags.swift create mode 100644 Sources/DOMKit/WebIDL/VideoTrack.swift create mode 100644 Sources/DOMKit/WebIDL/VideoTrackList.swift create mode 100644 Sources/DOMKit/WebIDL/WheelEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/WindowLocalStorage.swift create mode 100644 Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift create mode 100644 Sources/DOMKit/WebIDL/WindowSessionStorage.swift create mode 100644 Sources/DOMKit/WebIDL/Worker.swift create mode 100644 Sources/DOMKit/WebIDL/WorkerGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/WorkerLocation.swift create mode 100644 Sources/DOMKit/WebIDL/WorkerNavigator.swift create mode 100644 Sources/DOMKit/WebIDL/WorkerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/WorkerType.swift create mode 100644 Sources/DOMKit/WebIDL/Worklet.swift create mode 100644 Sources/DOMKit/WebIDL/WorkletGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/WorkletOptions.swift create mode 100644 Sources/DOMKit/WebIDL/WritableStream.swift create mode 100644 Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift create mode 100644 Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift create mode 100644 Sources/DOMKit/WebIDL/XMLHttpRequest.swift create mode 100644 Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift create mode 100644 Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift create mode 100644 Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift delete mode 100644 Sources/DOMKit/WebIDL/XPathNSResolver.swift create mode 100644 Sources/DOMKit/WebIDL/XSLTProcessor.swift diff --git a/Sources/DOMKit/WebIDL/ARIAMixin.swift b/Sources/DOMKit/WebIDL/ARIAMixin.swift new file mode 100644 index 00000000..be22e040 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ARIAMixin.swift @@ -0,0 +1,212 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol ARIAMixin: JSBridgedClass {} +public extension ARIAMixin { + var role: String? { + get { ReadWriteAttribute["role", in: jsObject] } + set { ReadWriteAttribute["role", in: jsObject] = newValue } + } + + var ariaAtomic: String? { + get { ReadWriteAttribute["ariaAtomic", in: jsObject] } + set { ReadWriteAttribute["ariaAtomic", in: jsObject] = newValue } + } + + var ariaAutoComplete: String? { + get { ReadWriteAttribute["ariaAutoComplete", in: jsObject] } + set { ReadWriteAttribute["ariaAutoComplete", in: jsObject] = newValue } + } + + var ariaBusy: String? { + get { ReadWriteAttribute["ariaBusy", in: jsObject] } + set { ReadWriteAttribute["ariaBusy", in: jsObject] = newValue } + } + + var ariaChecked: String? { + get { ReadWriteAttribute["ariaChecked", in: jsObject] } + set { ReadWriteAttribute["ariaChecked", in: jsObject] = newValue } + } + + var ariaColCount: String? { + get { ReadWriteAttribute["ariaColCount", in: jsObject] } + set { ReadWriteAttribute["ariaColCount", in: jsObject] = newValue } + } + + var ariaColIndex: String? { + get { ReadWriteAttribute["ariaColIndex", in: jsObject] } + set { ReadWriteAttribute["ariaColIndex", in: jsObject] = newValue } + } + + var ariaColIndexText: String? { + get { ReadWriteAttribute["ariaColIndexText", in: jsObject] } + set { ReadWriteAttribute["ariaColIndexText", in: jsObject] = newValue } + } + + var ariaColSpan: String? { + get { ReadWriteAttribute["ariaColSpan", in: jsObject] } + set { ReadWriteAttribute["ariaColSpan", in: jsObject] = newValue } + } + + var ariaCurrent: String? { + get { ReadWriteAttribute["ariaCurrent", in: jsObject] } + set { ReadWriteAttribute["ariaCurrent", in: jsObject] = newValue } + } + + var ariaDescription: String? { + get { ReadWriteAttribute["ariaDescription", in: jsObject] } + set { ReadWriteAttribute["ariaDescription", in: jsObject] = newValue } + } + + var ariaDisabled: String? { + get { ReadWriteAttribute["ariaDisabled", in: jsObject] } + set { ReadWriteAttribute["ariaDisabled", in: jsObject] = newValue } + } + + var ariaExpanded: String? { + get { ReadWriteAttribute["ariaExpanded", in: jsObject] } + set { ReadWriteAttribute["ariaExpanded", in: jsObject] = newValue } + } + + var ariaHasPopup: String? { + get { ReadWriteAttribute["ariaHasPopup", in: jsObject] } + set { ReadWriteAttribute["ariaHasPopup", in: jsObject] = newValue } + } + + var ariaHidden: String? { + get { ReadWriteAttribute["ariaHidden", in: jsObject] } + set { ReadWriteAttribute["ariaHidden", in: jsObject] = newValue } + } + + var ariaInvalid: String? { + get { ReadWriteAttribute["ariaInvalid", in: jsObject] } + set { ReadWriteAttribute["ariaInvalid", in: jsObject] = newValue } + } + + var ariaKeyShortcuts: String? { + get { ReadWriteAttribute["ariaKeyShortcuts", in: jsObject] } + set { ReadWriteAttribute["ariaKeyShortcuts", in: jsObject] = newValue } + } + + var ariaLabel: String? { + get { ReadWriteAttribute["ariaLabel", in: jsObject] } + set { ReadWriteAttribute["ariaLabel", in: jsObject] = newValue } + } + + var ariaLevel: String? { + get { ReadWriteAttribute["ariaLevel", in: jsObject] } + set { ReadWriteAttribute["ariaLevel", in: jsObject] = newValue } + } + + var ariaLive: String? { + get { ReadWriteAttribute["ariaLive", in: jsObject] } + set { ReadWriteAttribute["ariaLive", in: jsObject] = newValue } + } + + var ariaModal: String? { + get { ReadWriteAttribute["ariaModal", in: jsObject] } + set { ReadWriteAttribute["ariaModal", in: jsObject] = newValue } + } + + var ariaMultiLine: String? { + get { ReadWriteAttribute["ariaMultiLine", in: jsObject] } + set { ReadWriteAttribute["ariaMultiLine", in: jsObject] = newValue } + } + + var ariaMultiSelectable: String? { + get { ReadWriteAttribute["ariaMultiSelectable", in: jsObject] } + set { ReadWriteAttribute["ariaMultiSelectable", in: jsObject] = newValue } + } + + var ariaOrientation: String? { + get { ReadWriteAttribute["ariaOrientation", in: jsObject] } + set { ReadWriteAttribute["ariaOrientation", in: jsObject] = newValue } + } + + var ariaPlaceholder: String? { + get { ReadWriteAttribute["ariaPlaceholder", in: jsObject] } + set { ReadWriteAttribute["ariaPlaceholder", in: jsObject] = newValue } + } + + var ariaPosInSet: String? { + get { ReadWriteAttribute["ariaPosInSet", in: jsObject] } + set { ReadWriteAttribute["ariaPosInSet", in: jsObject] = newValue } + } + + var ariaPressed: String? { + get { ReadWriteAttribute["ariaPressed", in: jsObject] } + set { ReadWriteAttribute["ariaPressed", in: jsObject] = newValue } + } + + var ariaReadOnly: String? { + get { ReadWriteAttribute["ariaReadOnly", in: jsObject] } + set { ReadWriteAttribute["ariaReadOnly", in: jsObject] = newValue } + } + + var ariaRequired: String? { + get { ReadWriteAttribute["ariaRequired", in: jsObject] } + set { ReadWriteAttribute["ariaRequired", in: jsObject] = newValue } + } + + var ariaRoleDescription: String? { + get { ReadWriteAttribute["ariaRoleDescription", in: jsObject] } + set { ReadWriteAttribute["ariaRoleDescription", in: jsObject] = newValue } + } + + var ariaRowCount: String? { + get { ReadWriteAttribute["ariaRowCount", in: jsObject] } + set { ReadWriteAttribute["ariaRowCount", in: jsObject] = newValue } + } + + var ariaRowIndex: String? { + get { ReadWriteAttribute["ariaRowIndex", in: jsObject] } + set { ReadWriteAttribute["ariaRowIndex", in: jsObject] = newValue } + } + + var ariaRowIndexText: String? { + get { ReadWriteAttribute["ariaRowIndexText", in: jsObject] } + set { ReadWriteAttribute["ariaRowIndexText", in: jsObject] = newValue } + } + + var ariaRowSpan: String? { + get { ReadWriteAttribute["ariaRowSpan", in: jsObject] } + set { ReadWriteAttribute["ariaRowSpan", in: jsObject] = newValue } + } + + var ariaSelected: String? { + get { ReadWriteAttribute["ariaSelected", in: jsObject] } + set { ReadWriteAttribute["ariaSelected", in: jsObject] = newValue } + } + + var ariaSetSize: String? { + get { ReadWriteAttribute["ariaSetSize", in: jsObject] } + set { ReadWriteAttribute["ariaSetSize", in: jsObject] = newValue } + } + + var ariaSort: String? { + get { ReadWriteAttribute["ariaSort", in: jsObject] } + set { ReadWriteAttribute["ariaSort", in: jsObject] = newValue } + } + + var ariaValueMax: String? { + get { ReadWriteAttribute["ariaValueMax", in: jsObject] } + set { ReadWriteAttribute["ariaValueMax", in: jsObject] = newValue } + } + + var ariaValueMin: String? { + get { ReadWriteAttribute["ariaValueMin", in: jsObject] } + set { ReadWriteAttribute["ariaValueMin", in: jsObject] = newValue } + } + + var ariaValueNow: String? { + get { ReadWriteAttribute["ariaValueNow", in: jsObject] } + set { ReadWriteAttribute["ariaValueNow", in: jsObject] = newValue } + } + + var ariaValueText: String? { + get { ReadWriteAttribute["ariaValueText", in: jsObject] } + set { ReadWriteAttribute["ariaValueText", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index 1e1aa5f3..b3d5f5ee 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class AbortController: JSBridgedClass { @@ -16,13 +14,13 @@ public class AbortController: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: AbortController.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } @ReadonlyAttribute public var signal: AbortSignal - public func abort() { - _ = jsObject.abort!() + public func abort(reason: JSValue? = nil) { + _ = jsObject["abort"]!(reason?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index 3ce72586..3b9a216b 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class AbortSignal: EventTarget { @@ -10,13 +8,29 @@ public class AbortSignal: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _aborted = ReadonlyAttribute(jsObject: jsObject, name: "aborted") - _onabort = OptionalClosureHandler(jsObject: jsObject, name: "onabort") + _reason = ReadonlyAttribute(jsObject: jsObject, name: "reason") + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: "onabort") super.init(unsafelyWrapping: jsObject) } + public static func abort(reason: JSValue? = nil) -> Self { + constructor["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + } + + public static func timeout(milliseconds: UInt64) -> Self { + constructor["timeout"]!(milliseconds.jsValue()).fromJSValue()! + } + @ReadonlyAttribute public var aborted: Bool - @OptionalClosureHandler + @ReadonlyAttribute + public var reason: JSValue + + public func throwIfAborted() { + _ = jsObject["throwIfAborted"]!() + } + + @ClosureAttribute.Optional1 public var onabort: EventHandler } diff --git a/Sources/DOMKit/WebIDL/AbstractRange.swift b/Sources/DOMKit/WebIDL/AbstractRange.swift index 8bd9f93d..803bdc07 100644 --- a/Sources/DOMKit/WebIDL/AbstractRange.swift +++ b/Sources/DOMKit/WebIDL/AbstractRange.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class AbstractRange: JSBridgedClass { diff --git a/Sources/DOMKit/WebIDL/AbstractWorker.swift b/Sources/DOMKit/WebIDL/AbstractWorker.swift new file mode 100644 index 00000000..762f03bd --- /dev/null +++ b/Sources/DOMKit/WebIDL/AbstractWorker.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol AbstractWorker: JSBridgedClass {} +public extension AbstractWorker { + var onerror: EventHandler { + get { ClosureAttribute.Optional1["onerror", in: jsObject] } + set { ClosureAttribute.Optional1["onerror", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift new file mode 100644 index 00000000..cb56244f --- /dev/null +++ b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AddEventListenerOptions: JSObject { + public init(passive: Bool, once: Bool, signal: AbortSignal) { + let object = JSObject.global.Object.function!.new() + object["passive"] = passive.jsValue() + object["once"] = once.jsValue() + object["signal"] = signal.jsValue() + _passive = ReadWriteAttribute(jsObject: object, name: "passive") + _once = ReadWriteAttribute(jsObject: object, name: "once") + _signal = ReadWriteAttribute(jsObject: object, name: "signal") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var passive: Bool + + @ReadWriteAttribute + public var once: Bool + + @ReadWriteAttribute + public var signal: AbortSignal +} diff --git a/Sources/DOMKit/WebIDL/AddEventListenerOptionsOrBool.swift b/Sources/DOMKit/WebIDL/AddEventListenerOptionsOrBool.swift deleted file mode 100644 index 4fb8eed7..00000000 --- a/Sources/DOMKit/WebIDL/AddEventListenerOptionsOrBool.swift +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum AddEventListenerOptionsOrBool: JSBridgedType, ExpressibleByBooleanLiteral, ExpressibleByDictionaryLiteral { - case addEventListenerOptions(AddEventListenerOptions) - case bool(Bool) - - public init?(from value: JSValue) { - if let decoded: AddEventListenerOptions = value.fromJSValue() { - self = .addEventListenerOptions(decoded) - } else if let decoded: Bool = value.fromJSValue() { - self = .bool(decoded) - } else { - return nil - } - } - - public init(dictionaryLiteral elements: (AddEventListenerOptions.Key, AddEventListenerOptions.Value)...) { - self = .addEventListenerOptions(.init(uniqueKeysWithValues: elements)) - } - - public init(booleanLiteral value: Bool) { - self = .bool(value) - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .addEventListenerOptions(v): return v.jsValue() - case let .bool(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift new file mode 100644 index 00000000..74f65b5b --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift @@ -0,0 +1,13 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol AnimationFrameProvider: JSBridgedClass {} +public extension AnimationFrameProvider { + // XXX: method 'requestAnimationFrame' is ignored + + func cancelAnimationFrame(handle: UInt32) { + _ = jsObject["cancelAnimationFrame"]!(handle.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/AnyChildNode.swift b/Sources/DOMKit/WebIDL/AnyChildNode.swift deleted file mode 100644 index 3e33134c..00000000 --- a/Sources/DOMKit/WebIDL/AnyChildNode.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyChildNode: JSBridgedClass, ChildNode { - public class var constructor: JSFunction { JSObject.global.ChildNode.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnyDocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/AnyDocumentOrShadowRoot.swift deleted file mode 100644 index 8970399d..00000000 --- a/Sources/DOMKit/WebIDL/AnyDocumentOrShadowRoot.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyDocumentOrShadowRoot: JSBridgedClass, DocumentOrShadowRoot { - public class var constructor: JSFunction { JSObject.global.DocumentOrShadowRoot.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnyElementContentEditable.swift b/Sources/DOMKit/WebIDL/AnyElementContentEditable.swift deleted file mode 100644 index 68deb5c7..00000000 --- a/Sources/DOMKit/WebIDL/AnyElementContentEditable.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyElementContentEditable: JSBridgedClass, ElementContentEditable { - public class var constructor: JSFunction { JSObject.global.ElementContentEditable.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnyEventListener.swift b/Sources/DOMKit/WebIDL/AnyEventListener.swift deleted file mode 100644 index 9692354f..00000000 --- a/Sources/DOMKit/WebIDL/AnyEventListener.swift +++ /dev/null @@ -1,20 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyEventListener: JSBridgedClass, EventListener { - public class var constructor: JSFunction { JSObject.global.EventListener.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public func handleEvent(event: Event) { - _ = jsObject.handleEvent!(event.jsValue()) - } -} diff --git a/Sources/DOMKit/WebIDL/AnyHTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/AnyHTMLOrSVGElement.swift deleted file mode 100644 index 1f19b418..00000000 --- a/Sources/DOMKit/WebIDL/AnyHTMLOrSVGElement.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyHTMLOrSVGElement: JSBridgedClass, HTMLOrSVGElement { - public class var constructor: JSFunction { JSObject.global.HTMLOrSVGElement.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnyNodeFilter.swift b/Sources/DOMKit/WebIDL/AnyNodeFilter.swift deleted file mode 100644 index 1cabf105..00000000 --- a/Sources/DOMKit/WebIDL/AnyNodeFilter.swift +++ /dev/null @@ -1,20 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyNodeFilter: JSBridgedClass, NodeFilter { - public class var constructor: JSFunction { JSObject.global.NodeFilter.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public func acceptNode(node: Node) -> UInt16 { - return jsObject.acceptNode!(node.jsValue()).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/AnyNonDocumentTypeChildNode.swift b/Sources/DOMKit/WebIDL/AnyNonDocumentTypeChildNode.swift deleted file mode 100644 index a56a017c..00000000 --- a/Sources/DOMKit/WebIDL/AnyNonDocumentTypeChildNode.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyNonDocumentTypeChildNode: JSBridgedClass, NonDocumentTypeChildNode { - public class var constructor: JSFunction { JSObject.global.NonDocumentTypeChildNode.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnyNonElementParentNode.swift b/Sources/DOMKit/WebIDL/AnyNonElementParentNode.swift deleted file mode 100644 index 5eb2c437..00000000 --- a/Sources/DOMKit/WebIDL/AnyNonElementParentNode.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyNonElementParentNode: JSBridgedClass, NonElementParentNode { - public class var constructor: JSFunction { JSObject.global.NonElementParentNode.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnyParentNode.swift b/Sources/DOMKit/WebIDL/AnyParentNode.swift deleted file mode 100644 index 4bea759d..00000000 --- a/Sources/DOMKit/WebIDL/AnyParentNode.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyParentNode: JSBridgedClass, ParentNode { - public class var constructor: JSFunction { JSObject.global.ParentNode.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnySlotable.swift b/Sources/DOMKit/WebIDL/AnySlotable.swift deleted file mode 100644 index 48257cc5..00000000 --- a/Sources/DOMKit/WebIDL/AnySlotable.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnySlotable: JSBridgedClass, Slotable { - public class var constructor: JSFunction { JSObject.global.Slotable.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnyWindowEventHandlers.swift b/Sources/DOMKit/WebIDL/AnyWindowEventHandlers.swift deleted file mode 100644 index bba0e745..00000000 --- a/Sources/DOMKit/WebIDL/AnyWindowEventHandlers.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyWindowEventHandlers: JSBridgedClass, WindowEventHandlers { - public class var constructor: JSFunction { JSObject.global.WindowEventHandlers.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnyXPathEvaluatorBase.swift b/Sources/DOMKit/WebIDL/AnyXPathEvaluatorBase.swift deleted file mode 100644 index 354dac84..00000000 --- a/Sources/DOMKit/WebIDL/AnyXPathEvaluatorBase.swift +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyXPathEvaluatorBase: JSBridgedClass, XPathEvaluatorBase { - public class var constructor: JSFunction { JSObject.global.XPathEvaluatorBase.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/AnyXPathNSResolver.swift b/Sources/DOMKit/WebIDL/AnyXPathNSResolver.swift deleted file mode 100644 index 81095b32..00000000 --- a/Sources/DOMKit/WebIDL/AnyXPathNSResolver.swift +++ /dev/null @@ -1,20 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -class AnyXPathNSResolver: JSBridgedClass, XPathNSResolver { - public class var constructor: JSFunction { JSObject.global.XPathNSResolver.function! } - - let jsObject: JSObject - - required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public func lookupNamespaceURI(prefix: String?) -> String? { - return jsObject.lookupNamespaceURI!(prefix.jsValue()).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ArrayBufferView.swift b/Sources/DOMKit/WebIDL/ArrayBufferView.swift deleted file mode 100644 index 1cc4e1c2..00000000 --- a/Sources/DOMKit/WebIDL/ArrayBufferView.swift +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum ArrayBufferView: JSBridgedType { - case int8Array(JSTypedArray) - case int16Array(JSTypedArray) - case int32Array(JSTypedArray) - case uint8Array(JSTypedArray) - case uint16Array(JSTypedArray) - case uint32Array(JSTypedArray) - case uint8ClampedArray(JSTypedArray) - case float32Array(JSTypedArray) - case float64Array(JSTypedArray) - case dataView(DataView) - - public init?(from value: JSValue) { - if let decoded: JSTypedArray = value.fromJSValue() { - self = .int8Array(decoded) - } else if let decoded: JSTypedArray = value.fromJSValue() { - self = .int16Array(decoded) - } else if let decoded: JSTypedArray = value.fromJSValue() { - self = .int32Array(decoded) - } else if let decoded: JSTypedArray = value.fromJSValue() { - self = .uint8Array(decoded) - } else if let decoded: JSTypedArray = value.fromJSValue() { - self = .uint16Array(decoded) - } else if let decoded: JSTypedArray = value.fromJSValue() { - self = .uint32Array(decoded) - } else if let decoded: JSTypedArray = value.fromJSValue() { - self = .uint8ClampedArray(decoded) - } else if let decoded: JSTypedArray = value.fromJSValue() { - self = .float32Array(decoded) - } else if let decoded: JSTypedArray = value.fromJSValue() { - self = .float64Array(decoded) - } else if let decoded: DataView = value.fromJSValue() { - self = .dataView(decoded) - } else { - return nil - } - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .int8Array(v): return v.jsValue() - case let .int16Array(v): return v.jsValue() - case let .int32Array(v): return v.jsValue() - case let .uint8Array(v): return v.jsValue() - case let .uint16Array(v): return v.jsValue() - case let .uint32Array(v): return v.jsValue() - case let .uint8ClampedArray(v): return v.jsValue() - case let .float32Array(v): return v.jsValue() - case let .float64Array(v): return v.jsValue() - case let .dataView(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/ArrayBufferViewOrArrayBuffer.swift b/Sources/DOMKit/WebIDL/ArrayBufferViewOrArrayBuffer.swift deleted file mode 100644 index 2f97f7e7..00000000 --- a/Sources/DOMKit/WebIDL/ArrayBufferViewOrArrayBuffer.swift +++ /dev/null @@ -1,30 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum ArrayBufferViewOrArrayBuffer: JSBridgedType { - case arrayBufferView(ArrayBufferView) - case arrayBuffer(ArrayBuffer) - - public init?(from value: JSValue) { - if let decoded: ArrayBufferView = value.fromJSValue() { - self = .arrayBufferView(decoded) - } else if let decoded: ArrayBuffer = value.fromJSValue() { - self = .arrayBuffer(decoded) - } else { - return nil - } - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .arrayBufferView(v): return v.jsValue() - case let .arrayBuffer(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift new file mode 100644 index 00000000..cb49fd2a --- /dev/null +++ b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AssignedNodesOptions: JSObject { + public init(flatten: Bool) { + let object = JSObject.global.Object.function!.new() + object["flatten"] = flatten.jsValue() + _flatten = ReadWriteAttribute(jsObject: object, name: "flatten") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var flatten: Bool +} diff --git a/Sources/DOMKit/WebIDL/Attr.swift b/Sources/DOMKit/WebIDL/Attr.swift index 7de219b2..6fb072aa 100644 --- a/Sources/DOMKit/WebIDL/Attr.swift +++ b/Sources/DOMKit/WebIDL/Attr.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class Attr: Node { diff --git a/Sources/DOMKit/WebIDL/AudioTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack.swift new file mode 100644 index 00000000..afc6aa35 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioTrack.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioTrack: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.AudioTrack.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: "id") + _kind = ReadonlyAttribute(jsObject: jsObject, name: "kind") + _label = ReadonlyAttribute(jsObject: jsObject, name: "label") + _language = ReadonlyAttribute(jsObject: jsObject, name: "language") + _enabled = ReadWriteAttribute(jsObject: jsObject, name: "enabled") + 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 enabled: Bool +} diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift new file mode 100644 index 00000000..eaf3a7b2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioTrackList: EventTarget { + override public class var constructor: JSFunction { JSObject.global.AudioTrackList.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onchange") + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onaddtrack") + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onremovetrack") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> AudioTrack { + jsObject[key].fromJSValue()! + } + + public func getTrackById(id: String) -> AudioTrack? { + jsObject["getTrackById"]!(id.jsValue()).fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onchange: EventHandler + + @ClosureAttribute.Optional1 + public var onaddtrack: EventHandler + + @ClosureAttribute.Optional1 + public var onremovetrack: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/BarProp.swift b/Sources/DOMKit/WebIDL/BarProp.swift new file mode 100644 index 00000000..cd33602d --- /dev/null +++ b/Sources/DOMKit/WebIDL/BarProp.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BarProp: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.BarProp.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _visible = ReadonlyAttribute(jsObject: jsObject, name: "visible") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var visible: Bool +} diff --git a/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift new file mode 100644 index 00000000..a515357c --- /dev/null +++ b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BeforeUnloadEvent: Event { + override public class var constructor: JSFunction { JSObject.global.BeforeUnloadEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + // XXX: member 'returnValue' is ignored +} diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index e568adb1..d8046b70 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class Blob: JSBridgedClass { @@ -16,12 +14,8 @@ public class Blob: JSBridgedClass { self.jsObject = jsObject } - public convenience init(blobParts: [BlobPart], options: BlobPropertyBag = [:]) { - self.init(unsafelyWrapping: Blob.constructor.new(blobParts.jsValue(), options.jsValue())) - } - - public convenience init() { - self.init(unsafelyWrapping: Blob.constructor.new()) + public convenience init(blobParts: [BlobPart]? = nil, options: BlobPropertyBag? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(blobParts?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined)) } @ReadonlyAttribute @@ -30,31 +24,31 @@ public class Blob: JSBridgedClass { @ReadonlyAttribute public var type: String - public func slice(start: Int64, end: Int64, contentType: String) -> Blob { - return jsObject.slice!(start.jsValue(), end.jsValue(), contentType.jsValue()).fromJSValue()! + public func slice(start: Int64? = nil, end: Int64? = nil, contentType: String? = nil) -> Self { + jsObject["slice"]!(start?.jsValue() ?? .undefined, end?.jsValue() ?? .undefined, contentType?.jsValue() ?? .undefined).fromJSValue()! } - public func slice(start: Int64, end: Int64) -> Blob { - return jsObject.slice!(start.jsValue(), end.jsValue()).fromJSValue()! - } - - public func slice(start: Int64) -> Blob { - return jsObject.slice!(start.jsValue()).fromJSValue()! + public func stream() -> ReadableStream { + jsObject["stream"]!().fromJSValue()! } - public func slice() -> Blob { - return jsObject.slice!().fromJSValue()! + public func text() -> JSPromise { + jsObject["text"]!().fromJSValue()! } - public func stream() -> ReadableStream { - return jsObject.stream!().fromJSValue()! + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func text() async throws -> String { + let _promise: JSPromise = jsObject["text"]!().fromJSValue()! + return try await _promise.get().fromJSValue()! } - public func text() -> JSPromise { - return jsObject.text!().fromJSValue()! + public func arrayBuffer() -> JSPromise { + jsObject["arrayBuffer"]!().fromJSValue()! } - public func arrayBuffer() -> JSPromise { - return jsObject.arrayBuffer!().fromJSValue()! + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func arrayBuffer() async throws -> ArrayBuffer { + let _promise: JSPromise = jsObject["arrayBuffer"]!().fromJSValue()! + return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BlobPart.swift b/Sources/DOMKit/WebIDL/BlobPart.swift deleted file mode 100644 index fd2c3bea..00000000 --- a/Sources/DOMKit/WebIDL/BlobPart.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias BlobPart = BufferSourceOrBlobOrString diff --git a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift new file mode 100644 index 00000000..290c3b57 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BlobPropertyBag: JSObject { + public init(type: String, endings: EndingType) { + let object = JSObject.global.Object.function!.new() + object["type"] = type.jsValue() + object["endings"] = endings.jsValue() + _type = ReadWriteAttribute(jsObject: object, name: "type") + _endings = ReadWriteAttribute(jsObject: object, name: "endings") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var endings: EndingType +} diff --git a/Sources/DOMKit/WebIDL/Body.swift b/Sources/DOMKit/WebIDL/Body.swift new file mode 100644 index 00000000..aa3da49f --- /dev/null +++ b/Sources/DOMKit/WebIDL/Body.swift @@ -0,0 +1,61 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Body: JSBridgedClass {} +public extension Body { + var body: ReadableStream? { ReadonlyAttribute["body", in: jsObject] } + + var bodyUsed: Bool { ReadonlyAttribute["bodyUsed", in: jsObject] } + + func arrayBuffer() -> JSPromise { + jsObject["arrayBuffer"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func arrayBuffer() async throws -> ArrayBuffer { + let _promise: JSPromise = jsObject["arrayBuffer"]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + func blob() -> JSPromise { + jsObject["blob"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func blob() async throws -> Blob { + let _promise: JSPromise = jsObject["blob"]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + func formData() -> JSPromise { + jsObject["formData"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func formData() async throws -> FormData { + let _promise: JSPromise = jsObject["formData"]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + func json() -> JSPromise { + jsObject["json"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func json() async throws -> JSValue { + let _promise: JSPromise = jsObject["json"]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + func text() -> JSPromise { + jsObject["text"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func text() async throws -> String { + let _promise: JSPromise = jsObject["text"]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift new file mode 100644 index 00000000..230cd210 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BroadcastChannel: EventTarget { + override public class var constructor: JSFunction { JSObject.global.BroadcastChannel.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: "name") + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessageerror") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(name: String) { + self.init(unsafelyWrapping: Self.constructor.new(name.jsValue())) + } + + @ReadonlyAttribute + public var name: String + + public func postMessage(message: JSValue) { + _ = jsObject["postMessage"]!(message.jsValue()) + } + + public func close() { + _ = jsObject["close"]!() + } + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ClosureAttribute.Optional1 + public var onmessageerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/BufferSource.swift b/Sources/DOMKit/WebIDL/BufferSource.swift deleted file mode 100644 index 93c62692..00000000 --- a/Sources/DOMKit/WebIDL/BufferSource.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias BufferSource = ArrayBufferViewOrArrayBuffer diff --git a/Sources/DOMKit/WebIDL/BufferSourceOrBlobOrString.swift b/Sources/DOMKit/WebIDL/BufferSourceOrBlobOrString.swift deleted file mode 100644 index 992e339d..00000000 --- a/Sources/DOMKit/WebIDL/BufferSourceOrBlobOrString.swift +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum BufferSourceOrBlobOrString: JSBridgedType, ExpressibleByStringLiteral { - case bufferSource(BufferSource) - case blob(Blob) - case string(String) - - public init?(from value: JSValue) { - if let decoded: BufferSource = value.fromJSValue() { - self = .bufferSource(decoded) - } else if let decoded: Blob = value.fromJSValue() { - self = .blob(decoded) - } else if let decoded: String = value.fromJSValue() { - self = .string(decoded) - } else { - return nil - } - } - - public init(stringLiteral value: String) { - self = .string(value) - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .bufferSource(v): return v.jsValue() - case let .blob(v): return v.jsValue() - case let .string(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift new file mode 100644 index 00000000..1ce63d2e --- /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 { + public class var constructor: JSFunction { JSObject.global.ByteLengthQueuingStrategy.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: "highWaterMark") + _size = ReadonlyAttribute(jsObject: jsObject, name: "size") + self.jsObject = jsObject + } + + public convenience init(init: QueuingStrategyInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadonlyAttribute + public var highWaterMark: Double + + @ReadonlyAttribute + public var size: JSFunction +} diff --git a/Sources/DOMKit/WebIDL/CDATASection.swift b/Sources/DOMKit/WebIDL/CDATASection.swift index a37141c1..32a64c03 100644 --- a/Sources/DOMKit/WebIDL/CDATASection.swift +++ b/Sources/DOMKit/WebIDL/CDATASection.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class CDATASection: Text { diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift new file mode 100644 index 00000000..f4d48a75 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CSS { + public static var jsObject: JSObject { + JSObject.global.CSS.object! + } + + public static func escape(ident: String) -> String { + JSObject.global.CSS.object!["escape"]!(ident.jsValue()).fromJSValue()! + } + + public static func supports(property: String, value: String) -> Bool { + JSObject.global.CSS.object!["supports"]!(property.jsValue(), value.jsValue()).fromJSValue()! + } + + public static func supports(conditionText: String) -> Bool { + JSObject.global.CSS.object!["supports"]!(conditionText.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSConditionRule.swift b/Sources/DOMKit/WebIDL/CSSConditionRule.swift new file mode 100644 index 00000000..fb223e81 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSConditionRule.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSConditionRule: CSSGroupingRule { + override public class var constructor: JSFunction { JSObject.global.CSSConditionRule.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _conditionText = ReadWriteAttribute(jsObject: jsObject, name: "conditionText") + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var conditionText: String +} diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift new file mode 100644 index 00000000..38e80a20 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSGroupingRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global.CSSGroupingRule.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: "cssRules") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var cssRules: CSSRuleList + + public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { + jsObject["insertRule"]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteRule(index: UInt32) { + _ = jsObject["deleteRule"]!(index.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/CSSImportRule.swift b/Sources/DOMKit/WebIDL/CSSImportRule.swift new file mode 100644 index 00000000..f00a324a --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSImportRule.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSImportRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global.CSSImportRule.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _href = ReadonlyAttribute(jsObject: jsObject, name: "href") + _media = ReadonlyAttribute(jsObject: jsObject, name: "media") + _styleSheet = ReadonlyAttribute(jsObject: jsObject, name: "styleSheet") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var href: String + + @ReadonlyAttribute + public var media: MediaList + + @ReadonlyAttribute + public var styleSheet: CSSStyleSheet +} diff --git a/Sources/DOMKit/WebIDL/CSSMarginRule.swift b/Sources/DOMKit/WebIDL/CSSMarginRule.swift new file mode 100644 index 00000000..ba1a5378 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMarginRule.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMarginRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global.CSSMarginRule.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: "name") + _style = ReadonlyAttribute(jsObject: jsObject, name: "style") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var style: CSSStyleDeclaration +} diff --git a/Sources/DOMKit/WebIDL/CSSMediaRule.swift b/Sources/DOMKit/WebIDL/CSSMediaRule.swift new file mode 100644 index 00000000..6d4fa2b9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMediaRule.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMediaRule: CSSConditionRule { + override public class var constructor: JSFunction { JSObject.global.CSSMediaRule.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _media = ReadonlyAttribute(jsObject: jsObject, name: "media") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var media: MediaList +} diff --git a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift new file mode 100644 index 00000000..01a79c20 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSNamespaceRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global.CSSNamespaceRule.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: "namespaceURI") + _prefix = ReadonlyAttribute(jsObject: jsObject, name: "prefix") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var namespaceURI: String + + @ReadonlyAttribute + public var prefix: String +} diff --git a/Sources/DOMKit/WebIDL/CSSPageRule.swift b/Sources/DOMKit/WebIDL/CSSPageRule.swift new file mode 100644 index 00000000..13199ef4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSPageRule.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSPageRule: CSSGroupingRule { + override public class var constructor: JSFunction { JSObject.global.CSSPageRule.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _selectorText = ReadWriteAttribute(jsObject: jsObject, name: "selectorText") + _style = ReadonlyAttribute(jsObject: jsObject, name: "style") + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var selectorText: String + + @ReadonlyAttribute + public var style: CSSStyleDeclaration +} diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift new file mode 100644 index 00000000..828ed0bc --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSRule.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSRule: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.CSSRule.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _cssText = ReadWriteAttribute(jsObject: jsObject, name: "cssText") + _parentRule = ReadonlyAttribute(jsObject: jsObject, name: "parentRule") + _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: "parentStyleSheet") + _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var cssText: String + + @ReadonlyAttribute + public var parentRule: CSSRule? + + @ReadonlyAttribute + public var parentStyleSheet: CSSStyleSheet? + + @ReadonlyAttribute + public var type: UInt16 + + public static let STYLE_RULE: UInt16 = 1 + + public static let CHARSET_RULE: UInt16 = 2 + + public static let IMPORT_RULE: UInt16 = 3 + + public static let MEDIA_RULE: UInt16 = 4 + + public static let FONT_FACE_RULE: UInt16 = 5 + + public static let PAGE_RULE: UInt16 = 6 + + public static let MARGIN_RULE: UInt16 = 9 + + public static let NAMESPACE_RULE: UInt16 = 10 + + public static let SUPPORTS_RULE: UInt16 = 12 +} diff --git a/Sources/DOMKit/WebIDL/CSSRuleList.swift b/Sources/DOMKit/WebIDL/CSSRuleList.swift new file mode 100644 index 00000000..3131b2cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSRuleList.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSRuleList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.CSSRuleList.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + public subscript(key: Int) -> CSSRule? { + jsObject[key].fromJSValue() + } + + @ReadonlyAttribute + public var length: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift new file mode 100644 index 00000000..33e6f0ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSStyleDeclaration: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.CSSStyleDeclaration.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _cssText = ReadWriteAttribute(jsObject: jsObject, name: "cssText") + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _parentRule = ReadonlyAttribute(jsObject: jsObject, name: "parentRule") + _cssFloat = ReadWriteAttribute(jsObject: jsObject, name: "cssFloat") + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var cssText: String + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> String { + jsObject[key].fromJSValue()! + } + + public func getPropertyValue(property: String) -> String { + jsObject["getPropertyValue"]!(property.jsValue()).fromJSValue()! + } + + public func getPropertyPriority(property: String) -> String { + jsObject["getPropertyPriority"]!(property.jsValue()).fromJSValue()! + } + + public func setProperty(property: String, value: String, priority: String? = nil) { + _ = jsObject["setProperty"]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined) + } + + public func removeProperty(property: String) -> String { + jsObject["removeProperty"]!(property.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var parentRule: CSSRule? + + @ReadWriteAttribute + public var cssFloat: String +} diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift new file mode 100644 index 00000000..e7b2ca8c --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSStyleRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global.CSSStyleRule.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _selectorText = ReadWriteAttribute(jsObject: jsObject, name: "selectorText") + _style = ReadonlyAttribute(jsObject: jsObject, name: "style") + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var selectorText: String + + @ReadonlyAttribute + public var style: CSSStyleDeclaration +} diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift new file mode 100644 index 00000000..200577f3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSStyleSheet: StyleSheet { + override public class var constructor: JSFunction { JSObject.global.CSSStyleSheet.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _ownerRule = ReadonlyAttribute(jsObject: jsObject, name: "ownerRule") + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: "cssRules") + _rules = ReadonlyAttribute(jsObject: jsObject, name: "rules") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: CSSStyleSheetInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var ownerRule: CSSRule? + + @ReadonlyAttribute + public var cssRules: CSSRuleList + + public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { + jsObject["insertRule"]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteRule(index: UInt32) { + _ = jsObject["deleteRule"]!(index.jsValue()) + } + + public func replace(text: String) -> JSPromise { + jsObject["replace"]!(text.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func replace(text: String) async throws -> CSSStyleSheet { + let _promise: JSPromise = jsObject["replace"]!(text.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func replaceSync(text: String) { + _ = jsObject["replaceSync"]!(text.jsValue()) + } + + @ReadonlyAttribute + public var rules: CSSRuleList + + public func addRule(selector: String? = nil, style: String? = nil, index: UInt32? = nil) -> Int32 { + jsObject["addRule"]!(selector?.jsValue() ?? .undefined, style?.jsValue() ?? .undefined, index?.jsValue() ?? .undefined).fromJSValue()! + } + + public func removeRule(index: UInt32? = nil) { + _ = jsObject["removeRule"]!(index?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift new file mode 100644 index 00000000..a991dce0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSStyleSheetInit: JSObject { + public init(baseURL: String, media: __UNSUPPORTED_UNION__, disabled: Bool) { + let object = JSObject.global.Object.function!.new() + object["baseURL"] = baseURL.jsValue() + object["media"] = media.jsValue() + object["disabled"] = disabled.jsValue() + _baseURL = ReadWriteAttribute(jsObject: object, name: "baseURL") + _media = ReadWriteAttribute(jsObject: object, name: "media") + _disabled = ReadWriteAttribute(jsObject: object, name: "disabled") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var baseURL: String + + @ReadWriteAttribute + public var media: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var disabled: Bool +} diff --git a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift new file mode 100644 index 00000000..e5bea67b --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSSupportsRule: CSSConditionRule { + override public class var constructor: JSFunction { JSObject.global.CSSSupportsRule.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift new file mode 100644 index 00000000..d7272582 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanPlayTypeResult: String, JSValueCompatible { + case _empty = "" + case maybe + case probably + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasCompositing.swift b/Sources/DOMKit/WebIDL/CanvasCompositing.swift new file mode 100644 index 00000000..498b8d48 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasCompositing.swift @@ -0,0 +1,17 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasCompositing: JSBridgedClass {} +public extension CanvasCompositing { + var globalAlpha: Double { + get { ReadWriteAttribute["globalAlpha", in: jsObject] } + set { ReadWriteAttribute["globalAlpha", in: jsObject] = newValue } + } + + var globalCompositeOperation: String { + get { ReadWriteAttribute["globalCompositeOperation", in: jsObject] } + set { ReadWriteAttribute["globalCompositeOperation", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasDirection.swift b/Sources/DOMKit/WebIDL/CanvasDirection.swift new file mode 100644 index 00000000..fd474f29 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasDirection.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasDirection: String, JSValueCompatible { + case ltr + case rtl + case inherit + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift new file mode 100644 index 00000000..808f55b6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasDrawImage: JSBridgedClass {} +public extension CanvasDrawImage { + func drawImage(image: CanvasImageSource, dx: Double, dy: Double) { + _ = jsObject["drawImage"]!(image.jsValue(), dx.jsValue(), dy.jsValue()) + } + + func drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double) { + _ = jsObject["drawImage"]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()) + } + + 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() + _ = jsObject["drawImage"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift new file mode 100644 index 00000000..d857641b --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift @@ -0,0 +1,51 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasDrawPath: JSBridgedClass {} +public extension CanvasDrawPath { + func beginPath() { + _ = jsObject["beginPath"]!() + } + + func fill(fillRule: CanvasFillRule? = nil) { + _ = jsObject["fill"]!(fillRule?.jsValue() ?? .undefined) + } + + func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { + _ = jsObject["fill"]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + } + + func stroke() { + _ = jsObject["stroke"]!() + } + + func stroke(path: Path2D) { + _ = jsObject["stroke"]!(path.jsValue()) + } + + func clip(fillRule: CanvasFillRule? = nil) { + _ = jsObject["clip"]!(fillRule?.jsValue() ?? .undefined) + } + + func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { + _ = jsObject["clip"]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + } + + func isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { + jsObject["isPointInPath"]!(x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + } + + func isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { + jsObject["isPointInPath"]!(path.jsValue(), x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + } + + func isPointInStroke(x: Double, y: Double) -> Bool { + jsObject["isPointInStroke"]!(x.jsValue(), y.jsValue()).fromJSValue()! + } + + func isPointInStroke(path: Path2D, x: Double, y: Double) -> Bool { + jsObject["isPointInStroke"]!(path.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFillRule.swift b/Sources/DOMKit/WebIDL/CanvasFillRule.swift new file mode 100644 index 00000000..35879806 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasFillRule.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasFillRule: String, JSValueCompatible { + case nonzero + case evenodd + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift new file mode 100644 index 00000000..832ffd3a --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasFillStrokeStyles: JSBridgedClass {} +public extension CanvasFillStrokeStyles { + var strokeStyle: __UNSUPPORTED_UNION__ { + get { ReadWriteAttribute["strokeStyle", in: jsObject] } + set { ReadWriteAttribute["strokeStyle", in: jsObject] = newValue } + } + + var fillStyle: __UNSUPPORTED_UNION__ { + get { ReadWriteAttribute["fillStyle", in: jsObject] } + set { ReadWriteAttribute["fillStyle", in: jsObject] = newValue } + } + + func createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double) -> CanvasGradient { + jsObject["createLinearGradient"]!(x0.jsValue(), y0.jsValue(), x1.jsValue(), y1.jsValue()).fromJSValue()! + } + + 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() + return jsObject["createRadialGradient"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + } + + func createConicGradient(startAngle: Double, x: Double, y: Double) -> CanvasGradient { + jsObject["createConicGradient"]!(startAngle.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + } + + func createPattern(image: CanvasImageSource, repetition: String) -> CanvasPattern? { + jsObject["createPattern"]!(image.jsValue(), repetition.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFilter.swift b/Sources/DOMKit/WebIDL/CanvasFilter.swift new file mode 100644 index 00000000..cea985b1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasFilter.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CanvasFilter: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.CanvasFilter.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(filters: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(filters?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFilters.swift b/Sources/DOMKit/WebIDL/CanvasFilters.swift new file mode 100644 index 00000000..b5285839 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasFilters.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasFilters: JSBridgedClass {} +public extension CanvasFilters { + var filter: __UNSUPPORTED_UNION__ { + get { ReadWriteAttribute["filter", in: jsObject] } + set { ReadWriteAttribute["filter", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift new file mode 100644 index 00000000..b3fae3fa --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasFontKerning: String, JSValueCompatible { + case auto + case normal + case none + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift new file mode 100644 index 00000000..e52c386f --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasFontStretch: String, JSValueCompatible { + case ultraCondensed = "ultra-condensed" + case extraCondensed = "extra-condensed" + case condensed + case semiCondensed = "semi-condensed" + case normal + case semiExpanded = "semi-expanded" + case expanded + case extraExpanded = "extra-expanded" + case ultraExpanded = "ultra-expanded" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift new file mode 100644 index 00000000..dae73460 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasFontVariantCaps: String, JSValueCompatible { + case normal + case smallCaps = "small-caps" + case allSmallCaps = "all-small-caps" + case petiteCaps = "petite-caps" + case allPetiteCaps = "all-petite-caps" + case unicase + case titlingCaps = "titling-caps" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasGradient.swift b/Sources/DOMKit/WebIDL/CanvasGradient.swift new file mode 100644 index 00000000..2da9e7a4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasGradient.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CanvasGradient: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.CanvasGradient.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func addColorStop(offset: Double, color: String) { + _ = jsObject["addColorStop"]!(offset.jsValue(), color.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasImageData.swift b/Sources/DOMKit/WebIDL/CanvasImageData.swift new file mode 100644 index 00000000..18728d25 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasImageData.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasImageData: JSBridgedClass {} +public extension CanvasImageData { + func createImageData(sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { + jsObject["createImageData"]!(sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! + } + + func createImageData(imagedata: ImageData) -> ImageData { + jsObject["createImageData"]!(imagedata.jsValue()).fromJSValue()! + } + + func getImageData(sx: Int32, sy: Int32, sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { + jsObject["getImageData"]!(sx.jsValue(), sy.jsValue(), sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! + } + + func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { + _ = jsObject["putImageData"]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()) + } + + 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() + _ = jsObject["putImageData"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift new file mode 100644 index 00000000..3fd6bc80 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift @@ -0,0 +1,17 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasImageSmoothing: JSBridgedClass {} +public extension CanvasImageSmoothing { + var imageSmoothingEnabled: Bool { + get { ReadWriteAttribute["imageSmoothingEnabled", in: jsObject] } + set { ReadWriteAttribute["imageSmoothingEnabled", in: jsObject] = newValue } + } + + var imageSmoothingQuality: ImageSmoothingQuality { + get { ReadWriteAttribute["imageSmoothingQuality", in: jsObject] } + set { ReadWriteAttribute["imageSmoothingQuality", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasLineCap.swift b/Sources/DOMKit/WebIDL/CanvasLineCap.swift new file mode 100644 index 00000000..ce1d5675 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasLineCap.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasLineCap: String, JSValueCompatible { + case butt + case round + case square + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift new file mode 100644 index 00000000..796d0952 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasLineJoin: String, JSValueCompatible { + case round + case bevel + case miter + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasPath.swift b/Sources/DOMKit/WebIDL/CanvasPath.swift new file mode 100644 index 00000000..f668b650 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasPath.swift @@ -0,0 +1,67 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasPath: JSBridgedClass {} +public extension CanvasPath { + func closePath() { + _ = jsObject["closePath"]!() + } + + func moveTo(x: Double, y: Double) { + _ = jsObject["moveTo"]!(x.jsValue(), y.jsValue()) + } + + func lineTo(x: Double, y: Double) { + _ = jsObject["lineTo"]!(x.jsValue(), y.jsValue()) + } + + func quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double) { + _ = jsObject["quadraticCurveTo"]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()) + } + + 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() + _ = jsObject["bezierCurveTo"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + func arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) { + _ = jsObject["arcTo"]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()) + } + + func rect(x: Double, y: Double, w: Double, h: Double) { + _ = jsObject["rect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + } + + func roundRect(x: Double, y: Double, w: Double, h: Double, radii: __UNSUPPORTED_UNION__? = nil) { + _ = jsObject["roundRect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined) + } + + 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 + _ = jsObject["arc"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + 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 + _ = jsObject["ellipse"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift new file mode 100644 index 00000000..278f4fa6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasPathDrawingStyles: JSBridgedClass {} +public extension CanvasPathDrawingStyles { + var lineWidth: Double { + get { ReadWriteAttribute["lineWidth", in: jsObject] } + set { ReadWriteAttribute["lineWidth", in: jsObject] = newValue } + } + + var lineCap: CanvasLineCap { + get { ReadWriteAttribute["lineCap", in: jsObject] } + set { ReadWriteAttribute["lineCap", in: jsObject] = newValue } + } + + var lineJoin: CanvasLineJoin { + get { ReadWriteAttribute["lineJoin", in: jsObject] } + set { ReadWriteAttribute["lineJoin", in: jsObject] = newValue } + } + + var miterLimit: Double { + get { ReadWriteAttribute["miterLimit", in: jsObject] } + set { ReadWriteAttribute["miterLimit", in: jsObject] = newValue } + } + + func setLineDash(segments: [Double]) { + _ = jsObject["setLineDash"]!(segments.jsValue()) + } + + func getLineDash() -> [Double] { + jsObject["getLineDash"]!().fromJSValue()! + } + + var lineDashOffset: Double { + get { ReadWriteAttribute["lineDashOffset", in: jsObject] } + set { ReadWriteAttribute["lineDashOffset", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasPattern.swift b/Sources/DOMKit/WebIDL/CanvasPattern.swift new file mode 100644 index 00000000..ea834579 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasPattern.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CanvasPattern: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.CanvasPattern.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func setTransform(transform: DOMMatrix2DInit? = nil) { + _ = jsObject["setTransform"]!(transform?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasRect.swift b/Sources/DOMKit/WebIDL/CanvasRect.swift new file mode 100644 index 00000000..b25b6ae6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasRect.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasRect: JSBridgedClass {} +public extension CanvasRect { + func clearRect(x: Double, y: Double, w: Double, h: Double) { + _ = jsObject["clearRect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + } + + func fillRect(x: Double, y: Double, w: Double, h: Double) { + _ = jsObject["fillRect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + } + + func strokeRect(x: Double, y: Double, w: Double, h: Double) { + _ = jsObject["strokeRect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift new file mode 100644 index 00000000..b149b918 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { + public class var constructor: JSFunction { JSObject.global.CanvasRenderingContext2D.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _canvas = ReadonlyAttribute(jsObject: jsObject, name: "canvas") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var canvas: HTMLCanvasElement + + public func getContextAttributes() -> CanvasRenderingContext2DSettings { + jsObject["getContextAttributes"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift new file mode 100644 index 00000000..62758568 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CanvasRenderingContext2DSettings: JSObject { + public init(alpha: Bool, desynchronized: Bool, colorSpace: PredefinedColorSpace, willReadFrequently: Bool) { + let object = JSObject.global.Object.function!.new() + object["alpha"] = alpha.jsValue() + object["desynchronized"] = desynchronized.jsValue() + object["colorSpace"] = colorSpace.jsValue() + object["willReadFrequently"] = willReadFrequently.jsValue() + _alpha = ReadWriteAttribute(jsObject: object, name: "alpha") + _desynchronized = ReadWriteAttribute(jsObject: object, name: "desynchronized") + _colorSpace = ReadWriteAttribute(jsObject: object, name: "colorSpace") + _willReadFrequently = ReadWriteAttribute(jsObject: object, name: "willReadFrequently") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var alpha: Bool + + @ReadWriteAttribute + public var desynchronized: Bool + + @ReadWriteAttribute + public var colorSpace: PredefinedColorSpace + + @ReadWriteAttribute + public var willReadFrequently: Bool +} diff --git a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift new file mode 100644 index 00000000..7f1c7a9e --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasShadowStyles: JSBridgedClass {} +public extension CanvasShadowStyles { + var shadowOffsetX: Double { + get { ReadWriteAttribute["shadowOffsetX", in: jsObject] } + set { ReadWriteAttribute["shadowOffsetX", in: jsObject] = newValue } + } + + var shadowOffsetY: Double { + get { ReadWriteAttribute["shadowOffsetY", in: jsObject] } + set { ReadWriteAttribute["shadowOffsetY", in: jsObject] = newValue } + } + + var shadowBlur: Double { + get { ReadWriteAttribute["shadowBlur", in: jsObject] } + set { ReadWriteAttribute["shadowBlur", in: jsObject] = newValue } + } + + var shadowColor: String { + get { ReadWriteAttribute["shadowColor", in: jsObject] } + set { ReadWriteAttribute["shadowColor", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasState.swift b/Sources/DOMKit/WebIDL/CanvasState.swift new file mode 100644 index 00000000..d13b4416 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasState: JSBridgedClass {} +public extension CanvasState { + func save() { + _ = jsObject["save"]!() + } + + func restore() { + _ = jsObject["restore"]!() + } + + func reset() { + _ = jsObject["reset"]!() + } + + func isContextLost() -> Bool { + jsObject["isContextLost"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasText.swift b/Sources/DOMKit/WebIDL/CanvasText.swift new file mode 100644 index 00000000..c9dbaeec --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasText.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasText: JSBridgedClass {} +public extension CanvasText { + func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { + _ = jsObject["fillText"]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + } + + func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { + _ = jsObject["strokeText"]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + } + + func measureText(text: String) -> TextMetrics { + jsObject["measureText"]!(text.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift new file mode 100644 index 00000000..855bcdae --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasTextAlign: String, JSValueCompatible { + case start + case end + case left + case right + case center + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift new file mode 100644 index 00000000..56de331b --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasTextBaseline: String, JSValueCompatible { + case top + case hanging + case middle + case alphabetic + case ideographic + case bottom + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift new file mode 100644 index 00000000..a74779f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift @@ -0,0 +1,57 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasTextDrawingStyles: JSBridgedClass {} +public extension CanvasTextDrawingStyles { + var font: String { + get { ReadWriteAttribute["font", in: jsObject] } + set { ReadWriteAttribute["font", in: jsObject] = newValue } + } + + var textAlign: CanvasTextAlign { + get { ReadWriteAttribute["textAlign", in: jsObject] } + set { ReadWriteAttribute["textAlign", in: jsObject] = newValue } + } + + var textBaseline: CanvasTextBaseline { + get { ReadWriteAttribute["textBaseline", in: jsObject] } + set { ReadWriteAttribute["textBaseline", in: jsObject] = newValue } + } + + var direction: CanvasDirection { + get { ReadWriteAttribute["direction", in: jsObject] } + set { ReadWriteAttribute["direction", in: jsObject] = newValue } + } + + var letterSpacing: String { + get { ReadWriteAttribute["letterSpacing", in: jsObject] } + set { ReadWriteAttribute["letterSpacing", in: jsObject] = newValue } + } + + var fontKerning: CanvasFontKerning { + get { ReadWriteAttribute["fontKerning", in: jsObject] } + set { ReadWriteAttribute["fontKerning", in: jsObject] = newValue } + } + + var fontStretch: CanvasFontStretch { + get { ReadWriteAttribute["fontStretch", in: jsObject] } + set { ReadWriteAttribute["fontStretch", in: jsObject] = newValue } + } + + var fontVariantCaps: CanvasFontVariantCaps { + get { ReadWriteAttribute["fontVariantCaps", in: jsObject] } + set { ReadWriteAttribute["fontVariantCaps", in: jsObject] = newValue } + } + + var textRendering: CanvasTextRendering { + get { ReadWriteAttribute["textRendering", in: jsObject] } + set { ReadWriteAttribute["textRendering", in: jsObject] = newValue } + } + + var wordSpacing: String { + get { ReadWriteAttribute["wordSpacing", in: jsObject] } + set { ReadWriteAttribute["wordSpacing", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift new file mode 100644 index 00000000..345035f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CanvasTextRendering: String, JSValueCompatible { + case auto + case optimizeSpeed + case optimizeLegibility + case geometricPrecision + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CanvasTransform.swift b/Sources/DOMKit/WebIDL/CanvasTransform.swift new file mode 100644 index 00000000..d992e6e7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasTransform.swift @@ -0,0 +1,51 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasTransform: JSBridgedClass {} +public extension CanvasTransform { + func scale(x: Double, y: Double) { + _ = jsObject["scale"]!(x.jsValue(), y.jsValue()) + } + + func rotate(angle: Double) { + _ = jsObject["rotate"]!(angle.jsValue()) + } + + func translate(x: Double, y: Double) { + _ = jsObject["translate"]!(x.jsValue(), y.jsValue()) + } + + 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() + _ = jsObject["transform"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + func getTransform() -> DOMMatrix { + jsObject["getTransform"]!().fromJSValue()! + } + + 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() + _ = jsObject["setTransform"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + func setTransform(transform: DOMMatrix2DInit? = nil) { + _ = jsObject["setTransform"]!(transform?.jsValue() ?? .undefined) + } + + func resetTransform() { + _ = jsObject["resetTransform"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift new file mode 100644 index 00000000..6096e0e8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CanvasUserInterface: JSBridgedClass {} +public extension CanvasUserInterface { + func drawFocusIfNeeded(element: Element) { + _ = jsObject["drawFocusIfNeeded"]!(element.jsValue()) + } + + func drawFocusIfNeeded(path: Path2D, element: Element) { + _ = jsObject["drawFocusIfNeeded"]!(path.jsValue(), element.jsValue()) + } + + func scrollPathIntoView() { + _ = jsObject["scrollPathIntoView"]!() + } + + func scrollPathIntoView(path: Path2D) { + _ = jsObject["scrollPathIntoView"]!(path.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/CharacterData.swift b/Sources/DOMKit/WebIDL/CharacterData.swift index fcbc89a9..80012dab 100644 --- a/Sources/DOMKit/WebIDL/CharacterData.swift +++ b/Sources/DOMKit/WebIDL/CharacterData.swift @@ -1,11 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit -public class CharacterData: Node, ChildNode, NonDocumentTypeChildNode { +public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { override public class var constructor: JSFunction { JSObject.global.CharacterData.function! } public required init(unsafelyWrapping jsObject: JSObject) { @@ -21,22 +19,22 @@ public class CharacterData: Node, ChildNode, NonDocumentTypeChildNode { public var length: UInt32 public func substringData(offset: UInt32, count: UInt32) -> String { - return jsObject.substringData!(offset.jsValue(), count.jsValue()).fromJSValue()! + jsObject["substringData"]!(offset.jsValue(), count.jsValue()).fromJSValue()! } public func appendData(data: String) { - _ = jsObject.appendData!(data.jsValue()) + _ = jsObject["appendData"]!(data.jsValue()) } public func insertData(offset: UInt32, data: String) { - _ = jsObject.insertData!(offset.jsValue(), data.jsValue()) + _ = jsObject["insertData"]!(offset.jsValue(), data.jsValue()) } public func deleteData(offset: UInt32, count: UInt32) { - _ = jsObject.deleteData!(offset.jsValue(), count.jsValue()) + _ = jsObject["deleteData"]!(offset.jsValue(), count.jsValue()) } public func replaceData(offset: UInt32, count: UInt32, data: String) { - _ = jsObject.replaceData!(offset.jsValue(), count.jsValue(), data.jsValue()) + _ = jsObject["replaceData"]!(offset.jsValue(), count.jsValue(), data.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ChildNode.swift b/Sources/DOMKit/WebIDL/ChildNode.swift index 185bf7f5..3281222c 100644 --- a/Sources/DOMKit/WebIDL/ChildNode.swift +++ b/Sources/DOMKit/WebIDL/ChildNode.swift @@ -1,38 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol ChildNode: JSBridgedClass {} - public extension ChildNode { - func before(nodes: NodeOrString...) { - _ = jsObject.before!(nodes.jsValue()) - } - - func before() { - _ = jsObject.before!() - } - - func after(nodes: NodeOrString...) { - _ = jsObject.after!(nodes.jsValue()) - } - - func after() { - _ = jsObject.after!() + func before(nodes: __UNSUPPORTED_UNION__...) { + _ = jsObject["before"]!(nodes.jsValue()) } - func replaceWith(nodes: NodeOrString...) { - _ = jsObject.replaceWith!(nodes.jsValue()) + func after(nodes: __UNSUPPORTED_UNION__...) { + _ = jsObject["after"]!(nodes.jsValue()) } - func replaceWith() { - _ = jsObject.replaceWith!() + func replaceWith(nodes: __UNSUPPORTED_UNION__...) { + _ = jsObject["replaceWith"]!(nodes.jsValue()) } func remove() { - _ = jsObject.remove!() + _ = jsObject["remove"]!() } } diff --git a/Sources/DOMKit/WebIDL/ClosureAttribute.swift b/Sources/DOMKit/WebIDL/ClosureAttribute.swift new file mode 100644 index 00000000..759bc9d3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ClosureAttribute.swift @@ -0,0 +1,267 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +/* variadic generics please */ +public enum ClosureAttribute { + // MARK: Required closures + + @propertyWrapper public final class Required0 + where ReturnType: JSValueCompatible + { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: () -> ReturnType { + get { Required0[name, in: jsObject] } + set { Required0[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, 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 Required1 + where A0: JSValueCompatible, ReturnType: JSValueCompatible + { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: (A0) -> ReturnType { + get { Required1[name, in: jsObject] } + set { Required1[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, in jsObject: JSObject) -> (A0) -> ReturnType { + get { + let function = jsObject[name].function! + return { function($0.jsValue()).fromJSValue()! } + } + set { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!).jsValue() + }.jsValue() + } + } + } + + @propertyWrapper public final class Required2 + where A0: JSValueCompatible, A1: JSValueCompatible, ReturnType: JSValueCompatible + { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: (A0, A1) -> ReturnType { + get { Required2[name, in: jsObject] } + set { Required2[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, 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 Required5 + where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible + { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: (A0, A1, A2, A3, A4) -> ReturnType { + get { Required5[name, in: jsObject] } + set { Required5[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, in jsObject: JSObject) -> (A0, A1, A2, A3, A4) -> ReturnType { + get { + let function = jsObject[name].function! + return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } + } + set { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue() + }.jsValue() + } + } + } + + // MARK: - Optional closures + + @propertyWrapper public final class Optional0 + where ReturnType: JSValueCompatible + { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: (() -> ReturnType)? { + get { Optional0[name, in: jsObject] } + set { Optional0[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, 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 Optional1 + where A0: JSValueCompatible, ReturnType: JSValueCompatible + { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: ((A0) -> ReturnType)? { + get { Optional1[name, in: jsObject] } + set { Optional1[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, in jsObject: JSObject) -> ((A0) -> ReturnType)? { + get { + guard let function = jsObject[name].function else { + return nil + } + return { function($0.jsValue()).fromJSValue()! } + } + set { + if let newValue = newValue { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!).jsValue() + }.jsValue() + } else { + jsObject[name] = .null + } + } + } + } + + @propertyWrapper public final class Optional2 + where A0: JSValueCompatible, A1: JSValueCompatible, ReturnType: JSValueCompatible + { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: ((A0, A1) -> ReturnType)? { + get { Optional2[name, in: jsObject] } + set { Optional2[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, 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 Optional5 + where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible + { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: String + + public init(jsObject: JSObject, name: String) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: ((A0, A1, A2, A3, A4) -> ReturnType)? { + get { Optional5[name, in: jsObject] } + set { Optional5[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: String, in jsObject: JSObject) -> ((A0, A1, A2, A3, A4) -> ReturnType)? { + get { + guard let function = jsObject[name].function else { + return nil + } + return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } + } + set { + if let newValue = newValue { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue() + }.jsValue() + } else { + jsObject[name] = .null + } + } + } + } +} diff --git a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift new file mode 100644 index 00000000..cd4f08f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ColorSpaceConversion: String, JSValueCompatible { + case none + case `default` + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Comment.swift b/Sources/DOMKit/WebIDL/Comment.swift index e2375fb0..bce14aa1 100644 --- a/Sources/DOMKit/WebIDL/Comment.swift +++ b/Sources/DOMKit/WebIDL/Comment.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class Comment: CharacterData { @@ -12,7 +10,7 @@ public class Comment: CharacterData { super.init(unsafelyWrapping: jsObject) } - public convenience init(data: String = "") { - self.init(unsafelyWrapping: Comment.constructor.new(data.jsValue())) + public convenience init(data: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(data?.jsValue() ?? .undefined)) } } diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index 86f21296..929b0a8b 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -1,3 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop import JavaScriptKit public class CompositionEvent: UIEvent { diff --git a/Sources/DOMKit/WebIDL/CompositionEventInit.swift b/Sources/DOMKit/WebIDL/CompositionEventInit.swift new file mode 100644 index 00000000..36d5a351 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CompositionEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CompositionEventInit: JSObject { + public init(data: String) { + let object = JSObject.global.Object.function!.new() + object["data"] = data.jsValue() + _data = ReadWriteAttribute(jsObject: object, name: "data") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var data: String +} diff --git a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift new file mode 100644 index 00000000..f0b49be2 --- /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 { + public class var constructor: JSFunction { JSObject.global.CountQueuingStrategy.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: "highWaterMark") + _size = ReadonlyAttribute(jsObject: jsObject, name: "size") + self.jsObject = jsObject + } + + public convenience init(init: QueuingStrategyInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadonlyAttribute + public var highWaterMark: Double + + @ReadonlyAttribute + public var size: JSFunction +} diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift new file mode 100644 index 00000000..f3b1231c --- /dev/null +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CustomElementRegistry: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.CustomElementRegistry.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: member 'define' is ignored + + public func get(name: String) -> __UNSUPPORTED_UNION__ { + jsObject["get"]!(name.jsValue()).fromJSValue()! + } + + // XXX: member 'whenDefined' is ignored + + // XXX: member 'whenDefined' is ignored + + public func upgrade(root: Node) { + _ = jsObject["upgrade"]!(root.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index 01eb4d3f..892b2801 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class CustomEvent: Event { @@ -13,14 +11,14 @@ public class CustomEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: CustomEventInit = [:]) { - self.init(unsafelyWrapping: CustomEvent.constructor.new(type.jsValue(), eventInitDict.jsValue())) + public convenience init(type: String, eventInitDict: CustomEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } @ReadonlyAttribute public var detail: JSValue - public func initCustomEvent(type: String, bubbles: Bool = false, cancelable: Bool = false, detail: JSValue = nil) { - _ = jsObject.initCustomEvent!(type.jsValue(), bubbles.jsValue(), cancelable.jsValue(), detail.jsValue()) + public func initCustomEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, detail: JSValue? = nil) { + _ = jsObject["initCustomEvent"]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CustomEventInit.swift b/Sources/DOMKit/WebIDL/CustomEventInit.swift new file mode 100644 index 00000000..17459aae --- /dev/null +++ b/Sources/DOMKit/WebIDL/CustomEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CustomEventInit: JSObject { + public init(detail: JSValue) { + let object = JSObject.global.Object.function!.new() + object["detail"] = detail.jsValue() + _detail = ReadWriteAttribute(jsObject: object, name: "detail") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var detail: JSValue +} diff --git a/Sources/DOMKit/WebIDL/DOMException.swift b/Sources/DOMKit/WebIDL/DOMException.swift index f72cc1cb..f008c5c2 100644 --- a/Sources/DOMKit/WebIDL/DOMException.swift +++ b/Sources/DOMKit/WebIDL/DOMException.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class DOMException: JSBridgedClass { @@ -17,8 +15,8 @@ public class DOMException: JSBridgedClass { self.jsObject = jsObject } - public convenience init(message: String = "", name: String = "Error") { - self.init(unsafelyWrapping: DOMException.constructor.new(message.jsValue(), name.jsValue())) + public convenience init(message: String? = nil, name: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(message?.jsValue() ?? .undefined, name?.jsValue() ?? .undefined)) } @ReadonlyAttribute @@ -30,53 +28,53 @@ public class DOMException: JSBridgedClass { @ReadonlyAttribute public var code: UInt16 - public let INDEX_SIZE_ERR: UInt16 = 1 + public static let INDEX_SIZE_ERR: UInt16 = 1 - public let DOMSTRING_SIZE_ERR: UInt16 = 2 + public static let DOMSTRING_SIZE_ERR: UInt16 = 2 - public let HIERARCHY_REQUEST_ERR: UInt16 = 3 + public static let HIERARCHY_REQUEST_ERR: UInt16 = 3 - public let WRONG_DOCUMENT_ERR: UInt16 = 4 + public static let WRONG_DOCUMENT_ERR: UInt16 = 4 - public let INVALID_CHARACTER_ERR: UInt16 = 5 + public static let INVALID_CHARACTER_ERR: UInt16 = 5 - public let NO_DATA_ALLOWED_ERR: UInt16 = 6 + public static let NO_DATA_ALLOWED_ERR: UInt16 = 6 - public let NO_MODIFICATION_ALLOWED_ERR: UInt16 = 7 + public static let NO_MODIFICATION_ALLOWED_ERR: UInt16 = 7 - public let NOT_FOUND_ERR: UInt16 = 8 + public static let NOT_FOUND_ERR: UInt16 = 8 - public let NOT_SUPPORTED_ERR: UInt16 = 9 + public static let NOT_SUPPORTED_ERR: UInt16 = 9 - public let INUSE_ATTRIBUTE_ERR: UInt16 = 10 + public static let INUSE_ATTRIBUTE_ERR: UInt16 = 10 - public let INVALID_STATE_ERR: UInt16 = 11 + public static let INVALID_STATE_ERR: UInt16 = 11 - public let SYNTAX_ERR: UInt16 = 12 + public static let SYNTAX_ERR: UInt16 = 12 - public let INVALID_MODIFICATION_ERR: UInt16 = 13 + public static let INVALID_MODIFICATION_ERR: UInt16 = 13 - public let NAMESPACE_ERR: UInt16 = 14 + public static let NAMESPACE_ERR: UInt16 = 14 - public let INVALID_ACCESS_ERR: UInt16 = 15 + public static let INVALID_ACCESS_ERR: UInt16 = 15 - public let VALIDATION_ERR: UInt16 = 16 + public static let VALIDATION_ERR: UInt16 = 16 - public let TYPE_MISMATCH_ERR: UInt16 = 17 + public static let TYPE_MISMATCH_ERR: UInt16 = 17 - public let SECURITY_ERR: UInt16 = 18 + public static let SECURITY_ERR: UInt16 = 18 - public let NETWORK_ERR: UInt16 = 19 + public static let NETWORK_ERR: UInt16 = 19 - public let ABORT_ERR: UInt16 = 20 + public static let ABORT_ERR: UInt16 = 20 - public let URL_MISMATCH_ERR: UInt16 = 21 + public static let URL_MISMATCH_ERR: UInt16 = 21 - public let QUOTA_EXCEEDED_ERR: UInt16 = 22 + public static let QUOTA_EXCEEDED_ERR: UInt16 = 22 - public let TIMEOUT_ERR: UInt16 = 23 + public static let TIMEOUT_ERR: UInt16 = 23 - public let INVALID_NODE_TYPE_ERR: UInt16 = 24 + public static let INVALID_NODE_TYPE_ERR: UInt16 = 24 - public let DATA_CLONE_ERR: UInt16 = 25 + public static let DATA_CLONE_ERR: UInt16 = 25 } diff --git a/Sources/DOMKit/WebIDL/DOMHighResTimeStamp.swift b/Sources/DOMKit/WebIDL/DOMHighResTimeStamp.swift deleted file mode 100644 index 8ca3c550..00000000 --- a/Sources/DOMKit/WebIDL/DOMHighResTimeStamp.swift +++ /dev/null @@ -1,3 +0,0 @@ -import JavaScriptKit - -public typealias DOMHighResTimeStamp = Double diff --git a/Sources/DOMKit/WebIDL/DOMImplementation.swift b/Sources/DOMKit/WebIDL/DOMImplementation.swift index 6fa292cf..ad003c70 100644 --- a/Sources/DOMKit/WebIDL/DOMImplementation.swift +++ b/Sources/DOMKit/WebIDL/DOMImplementation.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class DOMImplementation: JSBridgedClass { @@ -15,22 +13,18 @@ public class DOMImplementation: JSBridgedClass { } public func createDocumentType(qualifiedName: String, publicId: String, systemId: String) -> DocumentType { - return jsObject.createDocumentType!(qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()).fromJSValue()! + jsObject["createDocumentType"]!(qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()).fromJSValue()! } public func createDocument(namespace: String?, qualifiedName: String, doctype: DocumentType? = nil) -> XMLDocument { - return jsObject.createDocument!(namespace.jsValue(), qualifiedName.jsValue(), doctype.jsValue()).fromJSValue()! - } - - public func createHTMLDocument(title: String) -> Document { - return jsObject.createHTMLDocument!(title.jsValue()).fromJSValue()! + jsObject["createDocument"]!(namespace.jsValue(), qualifiedName.jsValue(), doctype?.jsValue() ?? .undefined).fromJSValue()! } - public func createHTMLDocument() -> Document { - return jsObject.createHTMLDocument!().fromJSValue()! + public func createHTMLDocument(title: String? = nil) -> Document { + jsObject["createHTMLDocument"]!(title?.jsValue() ?? .undefined).fromJSValue()! } public func hasFeature() -> Bool { - return jsObject.hasFeature!().fromJSValue()! + jsObject["hasFeature"]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift new file mode 100644 index 00000000..abeeeae7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -0,0 +1,233 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMMatrix: DOMMatrixReadOnly { + override public class var constructor: JSFunction { JSObject.global.DOMMatrix.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _a = ReadWriteAttribute(jsObject: jsObject, name: "a") + _b = ReadWriteAttribute(jsObject: jsObject, name: "b") + _c = ReadWriteAttribute(jsObject: jsObject, name: "c") + _d = ReadWriteAttribute(jsObject: jsObject, name: "d") + _e = ReadWriteAttribute(jsObject: jsObject, name: "e") + _f = ReadWriteAttribute(jsObject: jsObject, name: "f") + _m11 = ReadWriteAttribute(jsObject: jsObject, name: "m11") + _m12 = ReadWriteAttribute(jsObject: jsObject, name: "m12") + _m13 = ReadWriteAttribute(jsObject: jsObject, name: "m13") + _m14 = ReadWriteAttribute(jsObject: jsObject, name: "m14") + _m21 = ReadWriteAttribute(jsObject: jsObject, name: "m21") + _m22 = ReadWriteAttribute(jsObject: jsObject, name: "m22") + _m23 = ReadWriteAttribute(jsObject: jsObject, name: "m23") + _m24 = ReadWriteAttribute(jsObject: jsObject, name: "m24") + _m31 = ReadWriteAttribute(jsObject: jsObject, name: "m31") + _m32 = ReadWriteAttribute(jsObject: jsObject, name: "m32") + _m33 = ReadWriteAttribute(jsObject: jsObject, name: "m33") + _m34 = ReadWriteAttribute(jsObject: jsObject, name: "m34") + _m41 = ReadWriteAttribute(jsObject: jsObject, name: "m41") + _m42 = ReadWriteAttribute(jsObject: jsObject, name: "m42") + _m43 = ReadWriteAttribute(jsObject: jsObject, name: "m43") + _m44 = ReadWriteAttribute(jsObject: jsObject, name: "m44") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(init: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + } + + // XXX: illegal static override + // override public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self + + // XXX: illegal static override + // override public static func fromFloat32Array(array32: Float32Array) -> Self + + // XXX: illegal static override + // override public static func fromFloat64Array(array64: Float64Array) -> Self + + private var _a: ReadWriteAttribute + override public var a: Double { + get { _a.wrappedValue } + set { _a.wrappedValue = newValue } + } + + private var _b: ReadWriteAttribute + override public var b: Double { + get { _b.wrappedValue } + set { _b.wrappedValue = newValue } + } + + private var _c: ReadWriteAttribute + override public var c: Double { + get { _c.wrappedValue } + set { _c.wrappedValue = newValue } + } + + private var _d: ReadWriteAttribute + override public var d: Double { + get { _d.wrappedValue } + set { _d.wrappedValue = newValue } + } + + private var _e: ReadWriteAttribute + override public var e: Double { + get { _e.wrappedValue } + set { _e.wrappedValue = newValue } + } + + private var _f: ReadWriteAttribute + override public var f: Double { + get { _f.wrappedValue } + set { _f.wrappedValue = newValue } + } + + private var _m11: ReadWriteAttribute + override public var m11: Double { + get { _m11.wrappedValue } + set { _m11.wrappedValue = newValue } + } + + private var _m12: ReadWriteAttribute + override public var m12: Double { + get { _m12.wrappedValue } + set { _m12.wrappedValue = newValue } + } + + private var _m13: ReadWriteAttribute + override public var m13: Double { + get { _m13.wrappedValue } + set { _m13.wrappedValue = newValue } + } + + private var _m14: ReadWriteAttribute + override public var m14: Double { + get { _m14.wrappedValue } + set { _m14.wrappedValue = newValue } + } + + private var _m21: ReadWriteAttribute + override public var m21: Double { + get { _m21.wrappedValue } + set { _m21.wrappedValue = newValue } + } + + private var _m22: ReadWriteAttribute + override public var m22: Double { + get { _m22.wrappedValue } + set { _m22.wrappedValue = newValue } + } + + private var _m23: ReadWriteAttribute + override public var m23: Double { + get { _m23.wrappedValue } + set { _m23.wrappedValue = newValue } + } + + private var _m24: ReadWriteAttribute + override public var m24: Double { + get { _m24.wrappedValue } + set { _m24.wrappedValue = newValue } + } + + private var _m31: ReadWriteAttribute + override public var m31: Double { + get { _m31.wrappedValue } + set { _m31.wrappedValue = newValue } + } + + private var _m32: ReadWriteAttribute + override public var m32: Double { + get { _m32.wrappedValue } + set { _m32.wrappedValue = newValue } + } + + private var _m33: ReadWriteAttribute + override public var m33: Double { + get { _m33.wrappedValue } + set { _m33.wrappedValue = newValue } + } + + private var _m34: ReadWriteAttribute + override public var m34: Double { + get { _m34.wrappedValue } + set { _m34.wrappedValue = newValue } + } + + private var _m41: ReadWriteAttribute + override public var m41: Double { + get { _m41.wrappedValue } + set { _m41.wrappedValue = newValue } + } + + private var _m42: ReadWriteAttribute + override public var m42: Double { + get { _m42.wrappedValue } + set { _m42.wrappedValue = newValue } + } + + private var _m43: ReadWriteAttribute + override public var m43: Double { + get { _m43.wrappedValue } + set { _m43.wrappedValue = newValue } + } + + private var _m44: ReadWriteAttribute + override public var m44: Double { + get { _m44.wrappedValue } + set { _m44.wrappedValue = newValue } + } + + public func multiplySelf(other: DOMMatrixInit? = nil) -> Self { + jsObject["multiplySelf"]!(other?.jsValue() ?? .undefined).fromJSValue()! + } + + public func preMultiplySelf(other: DOMMatrixInit? = nil) -> Self { + jsObject["preMultiplySelf"]!(other?.jsValue() ?? .undefined).fromJSValue()! + } + + public func translateSelf(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> Self { + jsObject["translateSelf"]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! + } + + public func scaleSelf(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { + let _arg0 = scaleX?.jsValue() ?? .undefined + let _arg1 = scaleY?.jsValue() ?? .undefined + let _arg2 = scaleZ?.jsValue() ?? .undefined + let _arg3 = originX?.jsValue() ?? .undefined + let _arg4 = originY?.jsValue() ?? .undefined + let _arg5 = originZ?.jsValue() ?? .undefined + return jsObject["scaleSelf"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + } + + public func scale3dSelf(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { + jsObject["scale3dSelf"]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! + } + + public func rotateSelf(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> Self { + jsObject["rotateSelf"]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! + } + + public func rotateFromVectorSelf(x: Double? = nil, y: Double? = nil) -> Self { + jsObject["rotateFromVectorSelf"]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! + } + + public func rotateAxisAngleSelf(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> Self { + jsObject["rotateAxisAngleSelf"]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! + } + + public func skewXSelf(sx: Double? = nil) -> Self { + jsObject["skewXSelf"]!(sx?.jsValue() ?? .undefined).fromJSValue()! + } + + public func skewYSelf(sy: Double? = nil) -> Self { + jsObject["skewYSelf"]!(sy?.jsValue() ?? .undefined).fromJSValue()! + } + + public func invertSelf() -> Self { + jsObject["invertSelf"]!().fromJSValue()! + } + + public func setMatrixValue(transformList: String) -> Self { + jsObject["setMatrixValue"]!(transformList.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift new file mode 100644 index 00000000..fce9728e --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift @@ -0,0 +1,71 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMMatrix2DInit: JSObject { + public init(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double, m11: Double, m12: Double, m21: Double, m22: Double, m41: Double, m42: Double) { + let object = JSObject.global.Object.function!.new() + object["a"] = a.jsValue() + object["b"] = b.jsValue() + object["c"] = c.jsValue() + object["d"] = d.jsValue() + object["e"] = e.jsValue() + object["f"] = f.jsValue() + object["m11"] = m11.jsValue() + object["m12"] = m12.jsValue() + object["m21"] = m21.jsValue() + object["m22"] = m22.jsValue() + object["m41"] = m41.jsValue() + object["m42"] = m42.jsValue() + _a = ReadWriteAttribute(jsObject: object, name: "a") + _b = ReadWriteAttribute(jsObject: object, name: "b") + _c = ReadWriteAttribute(jsObject: object, name: "c") + _d = ReadWriteAttribute(jsObject: object, name: "d") + _e = ReadWriteAttribute(jsObject: object, name: "e") + _f = ReadWriteAttribute(jsObject: object, name: "f") + _m11 = ReadWriteAttribute(jsObject: object, name: "m11") + _m12 = ReadWriteAttribute(jsObject: object, name: "m12") + _m21 = ReadWriteAttribute(jsObject: object, name: "m21") + _m22 = ReadWriteAttribute(jsObject: object, name: "m22") + _m41 = ReadWriteAttribute(jsObject: object, name: "m41") + _m42 = ReadWriteAttribute(jsObject: object, name: "m42") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var a: Double + + @ReadWriteAttribute + public var b: Double + + @ReadWriteAttribute + public var c: Double + + @ReadWriteAttribute + public var d: Double + + @ReadWriteAttribute + public var e: Double + + @ReadWriteAttribute + public var f: Double + + @ReadWriteAttribute + public var m11: Double + + @ReadWriteAttribute + public var m12: Double + + @ReadWriteAttribute + public var m21: Double + + @ReadWriteAttribute + public var m22: Double + + @ReadWriteAttribute + public var m41: Double + + @ReadWriteAttribute + public var m42: Double +} diff --git a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift new file mode 100644 index 00000000..96147b67 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift @@ -0,0 +1,66 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMMatrixInit: JSObject { + public init(m13: Double, m14: Double, m23: Double, m24: Double, m31: Double, m32: Double, m33: Double, m34: Double, m43: Double, m44: Double, is2D: Bool) { + let object = JSObject.global.Object.function!.new() + object["m13"] = m13.jsValue() + object["m14"] = m14.jsValue() + object["m23"] = m23.jsValue() + object["m24"] = m24.jsValue() + object["m31"] = m31.jsValue() + object["m32"] = m32.jsValue() + object["m33"] = m33.jsValue() + object["m34"] = m34.jsValue() + object["m43"] = m43.jsValue() + object["m44"] = m44.jsValue() + object["is2D"] = is2D.jsValue() + _m13 = ReadWriteAttribute(jsObject: object, name: "m13") + _m14 = ReadWriteAttribute(jsObject: object, name: "m14") + _m23 = ReadWriteAttribute(jsObject: object, name: "m23") + _m24 = ReadWriteAttribute(jsObject: object, name: "m24") + _m31 = ReadWriteAttribute(jsObject: object, name: "m31") + _m32 = ReadWriteAttribute(jsObject: object, name: "m32") + _m33 = ReadWriteAttribute(jsObject: object, name: "m33") + _m34 = ReadWriteAttribute(jsObject: object, name: "m34") + _m43 = ReadWriteAttribute(jsObject: object, name: "m43") + _m44 = ReadWriteAttribute(jsObject: object, name: "m44") + _is2D = ReadWriteAttribute(jsObject: object, name: "is2D") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var m13: Double + + @ReadWriteAttribute + public var m14: Double + + @ReadWriteAttribute + public var m23: Double + + @ReadWriteAttribute + public var m24: Double + + @ReadWriteAttribute + public var m31: Double + + @ReadWriteAttribute + public var m32: Double + + @ReadWriteAttribute + public var m33: Double + + @ReadWriteAttribute + public var m34: Double + + @ReadWriteAttribute + public var m43: Double + + @ReadWriteAttribute + public var m44: Double + + @ReadWriteAttribute + public var is2D: Bool +} diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift new file mode 100644 index 00000000..921f3ac7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -0,0 +1,204 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMMatrixReadOnly: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DOMMatrixReadOnly.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _a = ReadonlyAttribute(jsObject: jsObject, name: "a") + _b = ReadonlyAttribute(jsObject: jsObject, name: "b") + _c = ReadonlyAttribute(jsObject: jsObject, name: "c") + _d = ReadonlyAttribute(jsObject: jsObject, name: "d") + _e = ReadonlyAttribute(jsObject: jsObject, name: "e") + _f = ReadonlyAttribute(jsObject: jsObject, name: "f") + _m11 = ReadonlyAttribute(jsObject: jsObject, name: "m11") + _m12 = ReadonlyAttribute(jsObject: jsObject, name: "m12") + _m13 = ReadonlyAttribute(jsObject: jsObject, name: "m13") + _m14 = ReadonlyAttribute(jsObject: jsObject, name: "m14") + _m21 = ReadonlyAttribute(jsObject: jsObject, name: "m21") + _m22 = ReadonlyAttribute(jsObject: jsObject, name: "m22") + _m23 = ReadonlyAttribute(jsObject: jsObject, name: "m23") + _m24 = ReadonlyAttribute(jsObject: jsObject, name: "m24") + _m31 = ReadonlyAttribute(jsObject: jsObject, name: "m31") + _m32 = ReadonlyAttribute(jsObject: jsObject, name: "m32") + _m33 = ReadonlyAttribute(jsObject: jsObject, name: "m33") + _m34 = ReadonlyAttribute(jsObject: jsObject, name: "m34") + _m41 = ReadonlyAttribute(jsObject: jsObject, name: "m41") + _m42 = ReadonlyAttribute(jsObject: jsObject, name: "m42") + _m43 = ReadonlyAttribute(jsObject: jsObject, name: "m43") + _m44 = ReadonlyAttribute(jsObject: jsObject, name: "m44") + _is2D = ReadonlyAttribute(jsObject: jsObject, name: "is2D") + _isIdentity = ReadonlyAttribute(jsObject: jsObject, name: "isIdentity") + self.jsObject = jsObject + } + + public convenience init(init: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + } + + public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self { + constructor["fromMatrix"]!(other?.jsValue() ?? .undefined).fromJSValue()! + } + + public static func fromFloat32Array(array32: Float32Array) -> Self { + constructor["fromFloat32Array"]!(array32.jsValue()).fromJSValue()! + } + + public static func fromFloat64Array(array64: Float64Array) -> Self { + constructor["fromFloat64Array"]!(array64.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var a: Double + + @ReadonlyAttribute + public var b: Double + + @ReadonlyAttribute + public var c: Double + + @ReadonlyAttribute + public var d: Double + + @ReadonlyAttribute + public var e: Double + + @ReadonlyAttribute + public var f: Double + + @ReadonlyAttribute + public var m11: Double + + @ReadonlyAttribute + public var m12: Double + + @ReadonlyAttribute + public var m13: Double + + @ReadonlyAttribute + public var m14: Double + + @ReadonlyAttribute + public var m21: Double + + @ReadonlyAttribute + public var m22: Double + + @ReadonlyAttribute + public var m23: Double + + @ReadonlyAttribute + public var m24: Double + + @ReadonlyAttribute + public var m31: Double + + @ReadonlyAttribute + public var m32: Double + + @ReadonlyAttribute + public var m33: Double + + @ReadonlyAttribute + public var m34: Double + + @ReadonlyAttribute + public var m41: Double + + @ReadonlyAttribute + public var m42: Double + + @ReadonlyAttribute + public var m43: Double + + @ReadonlyAttribute + public var m44: Double + + @ReadonlyAttribute + public var is2D: Bool + + @ReadonlyAttribute + public var isIdentity: Bool + + public func translate(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> DOMMatrix { + jsObject["translate"]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! + } + + public func scale(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { + let _arg0 = scaleX?.jsValue() ?? .undefined + let _arg1 = scaleY?.jsValue() ?? .undefined + let _arg2 = scaleZ?.jsValue() ?? .undefined + let _arg3 = originX?.jsValue() ?? .undefined + let _arg4 = originY?.jsValue() ?? .undefined + let _arg5 = originZ?.jsValue() ?? .undefined + return jsObject["scale"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + } + + public func scaleNonUniform(scaleX: Double? = nil, scaleY: Double? = nil) -> DOMMatrix { + jsObject["scaleNonUniform"]!(scaleX?.jsValue() ?? .undefined, scaleY?.jsValue() ?? .undefined).fromJSValue()! + } + + public func scale3d(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { + jsObject["scale3d"]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! + } + + public func rotate(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> DOMMatrix { + jsObject["rotate"]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! + } + + public func rotateFromVector(x: Double? = nil, y: Double? = nil) -> DOMMatrix { + jsObject["rotateFromVector"]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! + } + + public func rotateAxisAngle(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> DOMMatrix { + jsObject["rotateAxisAngle"]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! + } + + public func skewX(sx: Double? = nil) -> DOMMatrix { + jsObject["skewX"]!(sx?.jsValue() ?? .undefined).fromJSValue()! + } + + public func skewY(sy: Double? = nil) -> DOMMatrix { + jsObject["skewY"]!(sy?.jsValue() ?? .undefined).fromJSValue()! + } + + public func multiply(other: DOMMatrixInit? = nil) -> DOMMatrix { + jsObject["multiply"]!(other?.jsValue() ?? .undefined).fromJSValue()! + } + + public func flipX() -> DOMMatrix { + jsObject["flipX"]!().fromJSValue()! + } + + public func flipY() -> DOMMatrix { + jsObject["flipY"]!().fromJSValue()! + } + + public func inverse() -> DOMMatrix { + jsObject["inverse"]!().fromJSValue()! + } + + public func transformPoint(point: DOMPointInit? = nil) -> DOMPoint { + jsObject["transformPoint"]!(point?.jsValue() ?? .undefined).fromJSValue()! + } + + public func toFloat32Array() -> Float32Array { + jsObject["toFloat32Array"]!().fromJSValue()! + } + + public func toFloat64Array() -> Float64Array { + jsObject["toFloat64Array"]!().fromJSValue()! + } + + public var description: String { + jsObject["toString"]!().fromJSValue()! + } + + public func toJSON() -> JSObject { + jsObject["toJSON"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DOMParser.swift b/Sources/DOMKit/WebIDL/DOMParser.swift new file mode 100644 index 00000000..69c08176 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMParser.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMParser: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DOMParser.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + public func parseFromString(string: String, type: DOMParserSupportedType) -> Document { + jsObject["parseFromString"]!(string.jsValue(), type.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift new file mode 100644 index 00000000..ac0e6319 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum DOMParserSupportedType: String, JSValueCompatible { + case textHtml = "text/html" + case textXml = "text/xml" + case applicationXml = "application/xml" + case applicationXhtmlXml = "application/xhtml+xml" + case imageSvgXml = "image/svg+xml" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/DOMPoint.swift b/Sources/DOMKit/WebIDL/DOMPoint.swift new file mode 100644 index 00000000..9bd42a2c --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMPoint.swift @@ -0,0 +1,47 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMPoint: DOMPointReadOnly { + override public class var constructor: JSFunction { JSObject.global.DOMPoint.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadWriteAttribute(jsObject: jsObject, name: "x") + _y = ReadWriteAttribute(jsObject: jsObject, name: "y") + _z = ReadWriteAttribute(jsObject: jsObject, name: "z") + _w = ReadWriteAttribute(jsObject: jsObject, name: "w") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined)) + } + + // XXX: illegal static override + // override public static func fromPoint(other: DOMPointInit? = nil) -> Self + + private var _x: ReadWriteAttribute + override public var x: Double { + get { _x.wrappedValue } + set { _x.wrappedValue = newValue } + } + + private var _y: ReadWriteAttribute + override public var y: Double { + get { _y.wrappedValue } + set { _y.wrappedValue = newValue } + } + + private var _z: ReadWriteAttribute + override public var z: Double { + get { _z.wrappedValue } + set { _z.wrappedValue = newValue } + } + + private var _w: ReadWriteAttribute + override public var w: Double { + get { _w.wrappedValue } + set { _w.wrappedValue = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/DOMPointInit.swift b/Sources/DOMKit/WebIDL/DOMPointInit.swift new file mode 100644 index 00000000..88a348fe --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMPointInit.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMPointInit: JSObject { + public init(x: Double, y: Double, z: Double, w: Double) { + let object = JSObject.global.Object.function!.new() + object["x"] = x.jsValue() + object["y"] = y.jsValue() + object["z"] = z.jsValue() + object["w"] = w.jsValue() + _x = ReadWriteAttribute(jsObject: object, name: "x") + _y = ReadWriteAttribute(jsObject: object, name: "y") + _z = ReadWriteAttribute(jsObject: object, name: "z") + _w = ReadWriteAttribute(jsObject: object, name: "w") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var x: Double + + @ReadWriteAttribute + public var y: Double + + @ReadWriteAttribute + public var z: Double + + @ReadWriteAttribute + public var w: Double +} diff --git a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift new file mode 100644 index 00000000..ceb30c88 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMPointReadOnly: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DOMPointReadOnly.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: "x") + _y = ReadonlyAttribute(jsObject: jsObject, name: "y") + _z = ReadonlyAttribute(jsObject: jsObject, name: "z") + _w = ReadonlyAttribute(jsObject: jsObject, name: "w") + self.jsObject = jsObject + } + + public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined)) + } + + public static func fromPoint(other: DOMPointInit? = nil) -> Self { + constructor["fromPoint"]!(other?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var x: Double + + @ReadonlyAttribute + public var y: Double + + @ReadonlyAttribute + public var z: Double + + @ReadonlyAttribute + public var w: Double + + public func matrixTransform(matrix: DOMMatrixInit? = nil) -> DOMPoint { + jsObject["matrixTransform"]!(matrix?.jsValue() ?? .undefined).fromJSValue()! + } + + public func toJSON() -> JSObject { + jsObject["toJSON"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DOMQuad.swift b/Sources/DOMKit/WebIDL/DOMQuad.swift new file mode 100644 index 00000000..e2c41057 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMQuad.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMQuad: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DOMQuad.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _p1 = ReadonlyAttribute(jsObject: jsObject, name: "p1") + _p2 = ReadonlyAttribute(jsObject: jsObject, name: "p2") + _p3 = ReadonlyAttribute(jsObject: jsObject, name: "p3") + _p4 = ReadonlyAttribute(jsObject: jsObject, name: "p4") + self.jsObject = jsObject + } + + public convenience init(p1: DOMPointInit? = nil, p2: DOMPointInit? = nil, p3: DOMPointInit? = nil, p4: DOMPointInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(p1?.jsValue() ?? .undefined, p2?.jsValue() ?? .undefined, p3?.jsValue() ?? .undefined, p4?.jsValue() ?? .undefined)) + } + + public static func fromRect(other: DOMRectInit? = nil) -> Self { + constructor["fromRect"]!(other?.jsValue() ?? .undefined).fromJSValue()! + } + + public static func fromQuad(other: DOMQuadInit? = nil) -> Self { + constructor["fromQuad"]!(other?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var p1: DOMPoint + + @ReadonlyAttribute + public var p2: DOMPoint + + @ReadonlyAttribute + public var p3: DOMPoint + + @ReadonlyAttribute + public var p4: DOMPoint + + public func getBounds() -> DOMRect { + jsObject["getBounds"]!().fromJSValue()! + } + + public func toJSON() -> JSObject { + jsObject["toJSON"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DOMQuadInit.swift b/Sources/DOMKit/WebIDL/DOMQuadInit.swift new file mode 100644 index 00000000..46d736d2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMQuadInit.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMQuadInit: JSObject { + public init(p1: DOMPointInit, p2: DOMPointInit, p3: DOMPointInit, p4: DOMPointInit) { + let object = JSObject.global.Object.function!.new() + object["p1"] = p1.jsValue() + object["p2"] = p2.jsValue() + object["p3"] = p3.jsValue() + object["p4"] = p4.jsValue() + _p1 = ReadWriteAttribute(jsObject: object, name: "p1") + _p2 = ReadWriteAttribute(jsObject: object, name: "p2") + _p3 = ReadWriteAttribute(jsObject: object, name: "p3") + _p4 = ReadWriteAttribute(jsObject: object, name: "p4") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var p1: DOMPointInit + + @ReadWriteAttribute + public var p2: DOMPointInit + + @ReadWriteAttribute + public var p3: DOMPointInit + + @ReadWriteAttribute + public var p4: DOMPointInit +} diff --git a/Sources/DOMKit/WebIDL/DOMRect.swift b/Sources/DOMKit/WebIDL/DOMRect.swift new file mode 100644 index 00000000..166997bd --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMRect.swift @@ -0,0 +1,47 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMRect: DOMRectReadOnly { + override public class var constructor: JSFunction { JSObject.global.DOMRect.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadWriteAttribute(jsObject: jsObject, name: "x") + _y = ReadWriteAttribute(jsObject: jsObject, name: "y") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined)) + } + + // XXX: illegal static override + // override public static func fromRect(other: DOMRectInit? = nil) -> Self + + private var _x: ReadWriteAttribute + override public var x: Double { + get { _x.wrappedValue } + set { _x.wrappedValue = newValue } + } + + private var _y: ReadWriteAttribute + override public var y: Double { + get { _y.wrappedValue } + set { _y.wrappedValue = newValue } + } + + private var _width: ReadWriteAttribute + override public var width: Double { + get { _width.wrappedValue } + set { _width.wrappedValue = newValue } + } + + private var _height: ReadWriteAttribute + override public var height: Double { + get { _height.wrappedValue } + set { _height.wrappedValue = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/DOMRectInit.swift b/Sources/DOMKit/WebIDL/DOMRectInit.swift new file mode 100644 index 00000000..2efdbdb7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMRectInit.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMRectInit: JSObject { + public init(x: Double, y: Double, width: Double, height: Double) { + let object = JSObject.global.Object.function!.new() + object["x"] = x.jsValue() + object["y"] = y.jsValue() + object["width"] = width.jsValue() + object["height"] = height.jsValue() + _x = ReadWriteAttribute(jsObject: object, name: "x") + _y = ReadWriteAttribute(jsObject: object, name: "y") + _width = ReadWriteAttribute(jsObject: object, name: "width") + _height = ReadWriteAttribute(jsObject: object, name: "height") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var x: Double + + @ReadWriteAttribute + public var y: Double + + @ReadWriteAttribute + public var width: Double + + @ReadWriteAttribute + public var height: Double +} diff --git a/Sources/DOMKit/WebIDL/DOMRectList.swift b/Sources/DOMKit/WebIDL/DOMRectList.swift new file mode 100644 index 00000000..5617ed6e --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMRectList.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMRectList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DOMRectList.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> DOMRect? { + jsObject[key].fromJSValue() + } +} diff --git a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift new file mode 100644 index 00000000..493816e4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMRectReadOnly: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DOMRectReadOnly.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: "x") + _y = ReadonlyAttribute(jsObject: jsObject, name: "y") + _width = ReadonlyAttribute(jsObject: jsObject, name: "width") + _height = ReadonlyAttribute(jsObject: jsObject, name: "height") + _top = ReadonlyAttribute(jsObject: jsObject, name: "top") + _right = ReadonlyAttribute(jsObject: jsObject, name: "right") + _bottom = ReadonlyAttribute(jsObject: jsObject, name: "bottom") + _left = ReadonlyAttribute(jsObject: jsObject, name: "left") + self.jsObject = jsObject + } + + public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined)) + } + + public static func fromRect(other: DOMRectInit? = nil) -> Self { + constructor["fromRect"]!(other?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var x: Double + + @ReadonlyAttribute + public var y: Double + + @ReadonlyAttribute + public var width: Double + + @ReadonlyAttribute + public var height: Double + + @ReadonlyAttribute + public var top: Double + + @ReadonlyAttribute + public var right: Double + + @ReadonlyAttribute + public var bottom: Double + + @ReadonlyAttribute + public var left: Double + + public func toJSON() -> JSObject { + jsObject["toJSON"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DOMStringList.swift b/Sources/DOMKit/WebIDL/DOMStringList.swift new file mode 100644 index 00000000..0625935d --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMStringList.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DOMStringList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DOMStringList.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> String? { + jsObject[key].fromJSValue() + } + + public func contains(string: String) -> Bool { + jsObject["contains"]!(string.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DOMStringMap.swift b/Sources/DOMKit/WebIDL/DOMStringMap.swift index 9b1cc086..c7f1ece3 100644 --- a/Sources/DOMKit/WebIDL/DOMStringMap.swift +++ b/Sources/DOMKit/WebIDL/DOMStringMap.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class DOMStringMap: JSBridgedClass { @@ -14,12 +12,11 @@ public class DOMStringMap: JSBridgedClass { self.jsObject = jsObject } - public subscript(_: String) -> String? { - get { - return jsObject.name.fromJSValue()! - } - set { - jsObject.name = newValue.jsValue() - } + public subscript(key: String) -> String { + jsObject[key].fromJSValue()! } + + // XXX: unsupported setter for keys of type String + + // XXX: unsupported deleter for keys of type String } diff --git a/Sources/DOMKit/WebIDL/DOMTimeStamp.swift b/Sources/DOMKit/WebIDL/DOMTimeStamp.swift deleted file mode 100644 index cdc83efe..00000000 --- a/Sources/DOMKit/WebIDL/DOMTimeStamp.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias DOMTimeStamp = UInt64 diff --git a/Sources/DOMKit/WebIDL/DOMTokenList.swift b/Sources/DOMKit/WebIDL/DOMTokenList.swift index 0690bcf4..cdc69371 100644 --- a/Sources/DOMKit/WebIDL/DOMTokenList.swift +++ b/Sources/DOMKit/WebIDL/DOMTokenList.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class DOMTokenList: JSBridgedClass, Sequence { @@ -12,49 +10,46 @@ public class DOMTokenList: JSBridgedClass, Sequence { public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") self.jsObject = jsObject } - public typealias Element = String - @ReadonlyAttribute public var length: UInt32 - public func contains(token: String) -> Bool { - return jsObject.contains!(token.jsValue()).fromJSValue()! + public subscript(key: Int) -> String? { + jsObject[key].fromJSValue() } - public func add(tokens: String...) { - _ = jsObject.add!(tokens.jsValue()) + public func contains(token: String) -> Bool { + jsObject["contains"]!(token.jsValue()).fromJSValue()! } - public func add() { - _ = jsObject.add!() + public func add(tokens: String...) { + _ = jsObject["add"]!(tokens.jsValue()) } public func remove(tokens: String...) { - _ = jsObject.remove!(tokens.jsValue()) + _ = jsObject["remove"]!(tokens.jsValue()) } - public func remove() { - _ = jsObject.remove!() - } - - public func toggle(token: String, force: Bool) -> Bool { - return jsObject.toggle!(token.jsValue(), force.jsValue()).fromJSValue()! - } - - public func toggle(token: String) -> Bool { - return jsObject.toggle!(token.jsValue()).fromJSValue()! + public func toggle(token: String, force: Bool? = nil) -> Bool { + jsObject["toggle"]!(token.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! } public func replace(token: String, newToken: String) -> Bool { - return jsObject.replace!(token.jsValue(), newToken.jsValue()).fromJSValue()! + jsObject["replace"]!(token.jsValue(), newToken.jsValue()).fromJSValue()! } public func supports(token: String) -> Bool { - return jsObject.supports!(token.jsValue()).fromJSValue()! + jsObject["supports"]!(token.jsValue()).fromJSValue()! } - public func makeIterator() -> ValueIterableIterator { return ValueIterableIterator(sequence: self) } + @ReadWriteAttribute + public var value: String + + public typealias Element = String + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } } diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift new file mode 100644 index 00000000..1ca53835 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DataTransfer: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DataTransfer.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _dropEffect = ReadWriteAttribute(jsObject: jsObject, name: "dropEffect") + _effectAllowed = ReadWriteAttribute(jsObject: jsObject, name: "effectAllowed") + _items = ReadonlyAttribute(jsObject: jsObject, name: "items") + _types = ReadonlyAttribute(jsObject: jsObject, name: "types") + _files = ReadonlyAttribute(jsObject: jsObject, name: "files") + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var dropEffect: String + + @ReadWriteAttribute + public var effectAllowed: String + + @ReadonlyAttribute + public var items: DataTransferItemList + + public func setDragImage(image: Element, x: Int32, y: Int32) { + _ = jsObject["setDragImage"]!(image.jsValue(), x.jsValue(), y.jsValue()) + } + + @ReadonlyAttribute + public var types: [String] + + public func getData(format: String) -> String { + jsObject["getData"]!(format.jsValue()).fromJSValue()! + } + + public func setData(format: String, data: String) { + _ = jsObject["setData"]!(format.jsValue(), data.jsValue()) + } + + public func clearData(format: String? = nil) { + _ = jsObject["clearData"]!(format?.jsValue() ?? .undefined) + } + + @ReadonlyAttribute + public var files: FileList +} diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift new file mode 100644 index 00000000..b335d693 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DataTransferItem: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DataTransferItem.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _kind = ReadonlyAttribute(jsObject: jsObject, name: "kind") + _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var kind: String + + @ReadonlyAttribute + public var type: String + + // XXX: member 'getAsString' is ignored + + public func getAsFile() -> File? { + jsObject["getAsFile"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DataTransferItemList.swift b/Sources/DOMKit/WebIDL/DataTransferItemList.swift new file mode 100644 index 00000000..b1afb8ed --- /dev/null +++ b/Sources/DOMKit/WebIDL/DataTransferItemList.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DataTransferItemList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.DataTransferItemList.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> DataTransferItem { + jsObject[key].fromJSValue()! + } + + public func add(data: String, type: String) -> DataTransferItem? { + jsObject["add"]!(data.jsValue(), type.jsValue()).fromJSValue()! + } + + public func add(data: File) -> DataTransferItem? { + jsObject["add"]!(data.jsValue()).fromJSValue()! + } + + public func remove(index: UInt32) { + _ = jsObject["remove"]!(index.jsValue()) + } + + public func clear() { + _ = jsObject["clear"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift new file mode 100644 index 00000000..6c19c8ec --- /dev/null +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvider { + override public class var constructor: JSFunction { JSObject.global.DedicatedWorkerGlobalScope.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: "name") + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessageerror") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var name: String + + public func postMessage(message: JSValue, transfer: [JSObject]) { + _ = jsObject["postMessage"]!(message.jsValue(), transfer.jsValue()) + } + + public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + _ = jsObject["postMessage"]!(message.jsValue(), options?.jsValue() ?? .undefined) + } + + public func close() { + _ = jsObject["close"]!() + } + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ClosureAttribute.Optional1 + public var onmessageerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 003c084b..155fe5db 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -1,11 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit -public class Document: Node, DocumentOrShadowRoot, NonElementParentNode, ParentNode, XPathEvaluatorBase { +public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { override public class var constructor: JSFunction { JSObject.global.Document.function! } public required init(unsafelyWrapping jsObject: JSObject) { @@ -19,11 +17,42 @@ public class Document: Node, DocumentOrShadowRoot, NonElementParentNode, ParentN _contentType = ReadonlyAttribute(jsObject: jsObject, name: "contentType") _doctype = ReadonlyAttribute(jsObject: jsObject, name: "doctype") _documentElement = ReadonlyAttribute(jsObject: jsObject, name: "documentElement") + _location = ReadonlyAttribute(jsObject: jsObject, name: "location") + _domain = ReadWriteAttribute(jsObject: jsObject, name: "domain") + _referrer = ReadonlyAttribute(jsObject: jsObject, name: "referrer") + _cookie = ReadWriteAttribute(jsObject: jsObject, name: "cookie") + _lastModified = ReadonlyAttribute(jsObject: jsObject, name: "lastModified") + _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") + _title = ReadWriteAttribute(jsObject: jsObject, name: "title") + _dir = ReadWriteAttribute(jsObject: jsObject, name: "dir") + _body = ReadWriteAttribute(jsObject: jsObject, name: "body") + _head = ReadonlyAttribute(jsObject: jsObject, name: "head") + _images = ReadonlyAttribute(jsObject: jsObject, name: "images") + _embeds = ReadonlyAttribute(jsObject: jsObject, name: "embeds") + _plugins = ReadonlyAttribute(jsObject: jsObject, name: "plugins") + _links = ReadonlyAttribute(jsObject: jsObject, name: "links") + _forms = ReadonlyAttribute(jsObject: jsObject, name: "forms") + _scripts = ReadonlyAttribute(jsObject: jsObject, name: "scripts") + _currentScript = ReadonlyAttribute(jsObject: jsObject, name: "currentScript") + _defaultView = ReadonlyAttribute(jsObject: jsObject, name: "defaultView") + _designMode = ReadWriteAttribute(jsObject: jsObject, name: "designMode") + _hidden = ReadonlyAttribute(jsObject: jsObject, name: "hidden") + _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: "visibilityState") + _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onreadystatechange") + _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onvisibilitychange") + _fgColor = ReadWriteAttribute(jsObject: jsObject, name: "fgColor") + _linkColor = ReadWriteAttribute(jsObject: jsObject, name: "linkColor") + _vlinkColor = ReadWriteAttribute(jsObject: jsObject, name: "vlinkColor") + _alinkColor = ReadWriteAttribute(jsObject: jsObject, name: "alinkColor") + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") + _anchors = ReadonlyAttribute(jsObject: jsObject, name: "anchors") + _applets = ReadonlyAttribute(jsObject: jsObject, name: "applets") + _all = ReadonlyAttribute(jsObject: jsObject, name: "all") super.init(unsafelyWrapping: jsObject) } public convenience init() { - self.init(unsafelyWrapping: Document.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } @ReadonlyAttribute @@ -57,82 +86,231 @@ public class Document: Node, DocumentOrShadowRoot, NonElementParentNode, ParentN public var documentElement: Element? public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { - return jsObject.getElementsByTagName!(qualifiedName.jsValue()).fromJSValue()! + jsObject["getElementsByTagName"]!(qualifiedName.jsValue()).fromJSValue()! } public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { - return jsObject.getElementsByTagNameNS!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject["getElementsByTagNameNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func getElementsByClassName(classNames: String) -> HTMLCollection { - return jsObject.getElementsByClassName!(classNames.jsValue()).fromJSValue()! + jsObject["getElementsByClassName"]!(classNames.jsValue()).fromJSValue()! } - public func createElement(localName: String, options: StringOrElementCreationOptions = [:]) -> Element { - return jsObject.createElement!(localName.jsValue(), options.jsValue()).fromJSValue()! + public func createElement(localName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { + jsObject["createElement"]!(localName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } - public func createElementNS(namespace: String?, qualifiedName: String, options: StringOrElementCreationOptions = [:]) -> Element { - return jsObject.createElementNS!(namespace.jsValue(), qualifiedName.jsValue(), options.jsValue()).fromJSValue()! + public func createElementNS(namespace: String?, qualifiedName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { + jsObject["createElementNS"]!(namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func createDocumentFragment() -> DocumentFragment { - return jsObject.createDocumentFragment!().fromJSValue()! + jsObject["createDocumentFragment"]!().fromJSValue()! } public func createTextNode(data: String) -> Text { - return jsObject.createTextNode!(data.jsValue()).fromJSValue()! + jsObject["createTextNode"]!(data.jsValue()).fromJSValue()! } public func createCDATASection(data: String) -> CDATASection { - return jsObject.createCDATASection!(data.jsValue()).fromJSValue()! + jsObject["createCDATASection"]!(data.jsValue()).fromJSValue()! } public func createComment(data: String) -> Comment { - return jsObject.createComment!(data.jsValue()).fromJSValue()! + jsObject["createComment"]!(data.jsValue()).fromJSValue()! } public func createProcessingInstruction(target: String, data: String) -> ProcessingInstruction { - return jsObject.createProcessingInstruction!(target.jsValue(), data.jsValue()).fromJSValue()! + jsObject["createProcessingInstruction"]!(target.jsValue(), data.jsValue()).fromJSValue()! } - public func importNode(node: Node, deep: Bool = false) -> Node { - return jsObject.importNode!(node.jsValue(), deep.jsValue()).fromJSValue()! + public func importNode(node: Node, deep: Bool? = nil) -> Node { + jsObject["importNode"]!(node.jsValue(), deep?.jsValue() ?? .undefined).fromJSValue()! } public func adoptNode(node: Node) -> Node { - return jsObject.adoptNode!(node.jsValue()).fromJSValue()! + jsObject["adoptNode"]!(node.jsValue()).fromJSValue()! } public func createAttribute(localName: String) -> Attr { - return jsObject.createAttribute!(localName.jsValue()).fromJSValue()! + jsObject["createAttribute"]!(localName.jsValue()).fromJSValue()! } public func createAttributeNS(namespace: String?, qualifiedName: String) -> Attr { - return jsObject.createAttributeNS!(namespace.jsValue(), qualifiedName.jsValue()).fromJSValue()! + jsObject["createAttributeNS"]!(namespace.jsValue(), qualifiedName.jsValue()).fromJSValue()! } public func createEvent(interface: String) -> Event { - return jsObject.createEvent!(interface.jsValue()).fromJSValue()! + jsObject["createEvent"]!(interface.jsValue()).fromJSValue()! } public func createRange() -> Range { - return jsObject.createRange!().fromJSValue()! + jsObject["createRange"]!().fromJSValue()! + } + + // XXX: member 'createNodeIterator' is ignored + + // XXX: member 'createTreeWalker' is ignored + + @ReadonlyAttribute + public var location: Location? + + @ReadWriteAttribute + public var domain: String + + @ReadonlyAttribute + public var referrer: String + + @ReadWriteAttribute + public var cookie: String + + @ReadonlyAttribute + public var lastModified: String + + @ReadonlyAttribute + public var readyState: DocumentReadyState + + public subscript(key: String) -> JSObject { + jsObject[key].fromJSValue()! + } + + @ReadWriteAttribute + public var title: String + + @ReadWriteAttribute + public var dir: String + + @ReadWriteAttribute + public var body: HTMLElement? + + @ReadonlyAttribute + public var head: HTMLHeadElement? + + @ReadonlyAttribute + public var images: HTMLCollection + + @ReadonlyAttribute + public var embeds: HTMLCollection + + @ReadonlyAttribute + public var plugins: HTMLCollection + + @ReadonlyAttribute + public var links: HTMLCollection + + @ReadonlyAttribute + public var forms: HTMLCollection + + @ReadonlyAttribute + public var scripts: HTMLCollection + + public func getElementsByName(elementName: String) -> NodeList { + jsObject["getElementsByName"]!(elementName.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var currentScript: HTMLOrSVGScriptElement? + + public func open(unused1: String? = nil, unused2: String? = nil) -> Self { + jsObject["open"]!(unused1?.jsValue() ?? .undefined, unused2?.jsValue() ?? .undefined).fromJSValue()! + } + + public func open(url: String, name: String, features: String) -> WindowProxy? { + jsObject["open"]!(url.jsValue(), name.jsValue(), features.jsValue()).fromJSValue()! + } + + public func close() { + _ = jsObject["close"]!() + } + + public func write(text: String...) { + _ = jsObject["write"]!(text.jsValue()) + } + + public func writeln(text: String...) { + _ = jsObject["writeln"]!(text.jsValue()) + } + + @ReadonlyAttribute + public var defaultView: WindowProxy? + + public func hasFocus() -> Bool { + jsObject["hasFocus"]!().fromJSValue()! + } + + @ReadWriteAttribute + public var designMode: String + + public func execCommand(commandId: String, showUI: Bool? = nil, value: String? = nil) -> Bool { + jsObject["execCommand"]!(commandId.jsValue(), showUI?.jsValue() ?? .undefined, value?.jsValue() ?? .undefined).fromJSValue()! + } + + public func queryCommandEnabled(commandId: String) -> Bool { + jsObject["queryCommandEnabled"]!(commandId.jsValue()).fromJSValue()! } - public func createNodeIterator(root: Node, whatToShow: UInt32 = 4_294_967_295, filter: NodeFilterType? = nil) -> NodeIterator { - return jsObject.createNodeIterator!(root.jsValue(), whatToShow.jsValue(), filter.jsValue()).fromJSValue()! + public func queryCommandIndeterm(commandId: String) -> Bool { + jsObject["queryCommandIndeterm"]!(commandId.jsValue()).fromJSValue()! } - public func createNodeIterator(root: Node, whatToShow: UInt32 = 4_294_967_295, filter: ((Node) -> UInt16)? = nil) -> NodeIterator { - return jsObject.createNodeIterator!(root.jsValue(), whatToShow.jsValue(), filter == nil ? nil : JSClosure { filter!($0[0].fromJSValue()!).jsValue() }).fromJSValue()! + public func queryCommandState(commandId: String) -> Bool { + jsObject["queryCommandState"]!(commandId.jsValue()).fromJSValue()! } - public func createTreeWalker(root: Node, whatToShow: UInt32 = 4_294_967_295, filter: NodeFilterType? = nil) -> TreeWalker { - return jsObject.createTreeWalker!(root.jsValue(), whatToShow.jsValue(), filter.jsValue()).fromJSValue()! + public func queryCommandSupported(commandId: String) -> Bool { + jsObject["queryCommandSupported"]!(commandId.jsValue()).fromJSValue()! } - public func createTreeWalker(root: Node, whatToShow: UInt32 = 4_294_967_295, filter: ((Node) -> UInt16)? = nil) -> TreeWalker { - return jsObject.createTreeWalker!(root.jsValue(), whatToShow.jsValue(), filter == nil ? nil : JSClosure { filter!($0[0].fromJSValue()!).jsValue() }).fromJSValue()! + public func queryCommandValue(commandId: String) -> String { + jsObject["queryCommandValue"]!(commandId.jsValue()).fromJSValue()! } + + @ReadonlyAttribute + public var hidden: Bool + + @ReadonlyAttribute + public var visibilityState: DocumentVisibilityState + + @ClosureAttribute.Optional1 + public var onreadystatechange: EventHandler + + @ClosureAttribute.Optional1 + public var onvisibilitychange: EventHandler + + @ReadWriteAttribute + public var fgColor: String + + @ReadWriteAttribute + public var linkColor: String + + @ReadWriteAttribute + public var vlinkColor: String + + @ReadWriteAttribute + public var alinkColor: String + + @ReadWriteAttribute + public var bgColor: String + + @ReadonlyAttribute + public var anchors: HTMLCollection + + @ReadonlyAttribute + public var applets: HTMLCollection + + public func clear() { + _ = jsObject["clear"]!() + } + + public func captureEvents() { + _ = jsObject["captureEvents"]!() + } + + public func releaseEvents() { + _ = jsObject["releaseEvents"]!() + } + + @ReadonlyAttribute + public var all: HTMLAllCollection } diff --git a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift index 93e4f09b..0b9fa5aa 100644 --- a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift @@ -1,64 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol DocumentAndElementEventHandlers: JSBridgedClass {} - public extension DocumentAndElementEventHandlers { var oncopy: EventHandler { - get { - guard let function = jsObject.oncopy.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.oncopy = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.oncopy = .null - } - } + get { ClosureAttribute.Optional1["oncopy", in: jsObject] } + set { ClosureAttribute.Optional1["oncopy", in: jsObject] = newValue } } var oncut: EventHandler { - get { - guard let function = jsObject.oncut.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.oncut = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.oncut = .null - } - } + get { ClosureAttribute.Optional1["oncut", in: jsObject] } + set { ClosureAttribute.Optional1["oncut", in: jsObject] = newValue } } var onpaste: EventHandler { - get { - guard let function = jsObject.onpaste.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onpaste = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onpaste = .null - } - } + get { ClosureAttribute.Optional1["onpaste", in: jsObject] } + set { ClosureAttribute.Optional1["onpaste", in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/DocumentFragment.swift b/Sources/DOMKit/WebIDL/DocumentFragment.swift index a239bd96..7091d224 100644 --- a/Sources/DOMKit/WebIDL/DocumentFragment.swift +++ b/Sources/DOMKit/WebIDL/DocumentFragment.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class DocumentFragment: Node, NonElementParentNode, ParentNode { @@ -13,6 +11,6 @@ public class DocumentFragment: Node, NonElementParentNode, ParentNode { } public convenience init() { - self.init(unsafelyWrapping: DocumentFragment.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } } diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index e74bc690..e9d3fbb2 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -1,8 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol DocumentOrShadowRoot: JSBridgedClass {} +public extension DocumentOrShadowRoot { + var activeElement: Element? { ReadonlyAttribute["activeElement", in: jsObject] } + + var styleSheets: StyleSheetList { ReadonlyAttribute["styleSheets", in: jsObject] } + + var adoptedStyleSheets: [CSSStyleSheet] { + get { ReadWriteAttribute["adoptedStyleSheets", in: jsObject] } + set { ReadWriteAttribute["adoptedStyleSheets", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/DocumentReadyState.swift b/Sources/DOMKit/WebIDL/DocumentReadyState.swift new file mode 100644 index 00000000..091c4983 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DocumentReadyState.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum DocumentReadyState: String, JSValueCompatible { + case loading + case interactive + case complete + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/DocumentType.swift b/Sources/DOMKit/WebIDL/DocumentType.swift index 2ae6a5da..eeb45672 100644 --- a/Sources/DOMKit/WebIDL/DocumentType.swift +++ b/Sources/DOMKit/WebIDL/DocumentType.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class DocumentType: Node, ChildNode { diff --git a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift new file mode 100644 index 00000000..2f323f71 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum DocumentVisibilityState: String, JSValueCompatible { + case visible + case hidden + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/DragEvent.swift b/Sources/DOMKit/WebIDL/DragEvent.swift new file mode 100644 index 00000000..84103a1b --- /dev/null +++ b/Sources/DOMKit/WebIDL/DragEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DragEvent: MouseEvent { + override public class var constructor: JSFunction { JSObject.global.DragEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: "dataTransfer") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: DragEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var dataTransfer: DataTransfer? +} diff --git a/Sources/DOMKit/WebIDL/DragEventInit.swift b/Sources/DOMKit/WebIDL/DragEventInit.swift new file mode 100644 index 00000000..8f1eec27 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DragEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DragEventInit: JSObject { + public init(dataTransfer: DataTransfer?) { + let object = JSObject.global.Object.function!.new() + object["dataTransfer"] = dataTransfer.jsValue() + _dataTransfer = ReadWriteAttribute(jsObject: object, name: "dataTransfer") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var dataTransfer: DataTransfer? +} diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index 5374059d..fa08334b 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -1,11 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit -public class Element: Node, ChildNode, NonDocumentTypeChildNode, ParentNode, Slotable { +public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin { override public class var constructor: JSFunction { JSObject.global.Element.function! } public required init(unsafelyWrapping jsObject: JSObject) { @@ -47,112 +45,108 @@ public class Element: Node, ChildNode, NonDocumentTypeChildNode, ParentNode, Slo public var slot: String public func hasAttributes() -> Bool { - return jsObject.hasAttributes!().fromJSValue()! + jsObject["hasAttributes"]!().fromJSValue()! } @ReadonlyAttribute public var attributes: NamedNodeMap public func getAttributeNames() -> [String] { - return jsObject.getAttributeNames!().fromJSValue()! + jsObject["getAttributeNames"]!().fromJSValue()! } public func getAttribute(qualifiedName: String) -> String? { - return jsObject.getAttribute!(qualifiedName.jsValue()).fromJSValue()! + jsObject["getAttribute"]!(qualifiedName.jsValue()).fromJSValue()! } public func getAttributeNS(namespace: String?, localName: String) -> String? { - return jsObject.getAttributeNS!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject["getAttributeNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func setAttribute(qualifiedName: String, value: String) { - _ = jsObject.setAttribute!(qualifiedName.jsValue(), value.jsValue()) + _ = jsObject["setAttribute"]!(qualifiedName.jsValue(), value.jsValue()) } public func setAttributeNS(namespace: String?, qualifiedName: String, value: String) { - _ = jsObject.setAttributeNS!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()) + _ = jsObject["setAttributeNS"]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()) } public func removeAttribute(qualifiedName: String) { - _ = jsObject.removeAttribute!(qualifiedName.jsValue()) + _ = jsObject["removeAttribute"]!(qualifiedName.jsValue()) } public func removeAttributeNS(namespace: String?, localName: String) { - _ = jsObject.removeAttributeNS!(namespace.jsValue(), localName.jsValue()) - } - - public func toggleAttribute(qualifiedName: String, force: Bool) -> Bool { - return jsObject.toggleAttribute!(qualifiedName.jsValue(), force.jsValue()).fromJSValue()! + _ = jsObject["removeAttributeNS"]!(namespace.jsValue(), localName.jsValue()) } - public func toggleAttribute(qualifiedName: String) -> Bool { - return jsObject.toggleAttribute!(qualifiedName.jsValue()).fromJSValue()! + public func toggleAttribute(qualifiedName: String, force: Bool? = nil) -> Bool { + jsObject["toggleAttribute"]!(qualifiedName.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! } public func hasAttribute(qualifiedName: String) -> Bool { - return jsObject.hasAttribute!(qualifiedName.jsValue()).fromJSValue()! + jsObject["hasAttribute"]!(qualifiedName.jsValue()).fromJSValue()! } public func hasAttributeNS(namespace: String?, localName: String) -> Bool { - return jsObject.hasAttributeNS!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject["hasAttributeNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func getAttributeNode(qualifiedName: String) -> Attr? { - return jsObject.getAttributeNode!(qualifiedName.jsValue()).fromJSValue()! + jsObject["getAttributeNode"]!(qualifiedName.jsValue()).fromJSValue()! } public func getAttributeNodeNS(namespace: String?, localName: String) -> Attr? { - return jsObject.getAttributeNodeNS!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject["getAttributeNodeNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func setAttributeNode(attr: Attr) -> Attr? { - return jsObject.setAttributeNode!(attr.jsValue()).fromJSValue()! + jsObject["setAttributeNode"]!(attr.jsValue()).fromJSValue()! } public func setAttributeNodeNS(attr: Attr) -> Attr? { - return jsObject.setAttributeNodeNS!(attr.jsValue()).fromJSValue()! + jsObject["setAttributeNodeNS"]!(attr.jsValue()).fromJSValue()! } public func removeAttributeNode(attr: Attr) -> Attr { - return jsObject.removeAttributeNode!(attr.jsValue()).fromJSValue()! + jsObject["removeAttributeNode"]!(attr.jsValue()).fromJSValue()! } public func attachShadow(init: ShadowRootInit) -> ShadowRoot { - return jsObject.attachShadow!(`init`.jsValue()).fromJSValue()! + jsObject["attachShadow"]!(`init`.jsValue()).fromJSValue()! } @ReadonlyAttribute public var shadowRoot: ShadowRoot? public func closest(selectors: String) -> Element? { - return jsObject.closest!(selectors.jsValue()).fromJSValue()! + jsObject["closest"]!(selectors.jsValue()).fromJSValue()! } public func matches(selectors: String) -> Bool { - return jsObject.matches!(selectors.jsValue()).fromJSValue()! + jsObject["matches"]!(selectors.jsValue()).fromJSValue()! } public func webkitMatchesSelector(selectors: String) -> Bool { - return jsObject.webkitMatchesSelector!(selectors.jsValue()).fromJSValue()! + jsObject["webkitMatchesSelector"]!(selectors.jsValue()).fromJSValue()! } public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { - return jsObject.getElementsByTagName!(qualifiedName.jsValue()).fromJSValue()! + jsObject["getElementsByTagName"]!(qualifiedName.jsValue()).fromJSValue()! } public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { - return jsObject.getElementsByTagNameNS!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject["getElementsByTagNameNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func getElementsByClassName(classNames: String) -> HTMLCollection { - return jsObject.getElementsByClassName!(classNames.jsValue()).fromJSValue()! + jsObject["getElementsByClassName"]!(classNames.jsValue()).fromJSValue()! } public func insertAdjacentElement(where: String, element: Element) -> Element? { - return jsObject.insertAdjacentElement!(`where`.jsValue(), element.jsValue()).fromJSValue()! + jsObject["insertAdjacentElement"]!(`where`.jsValue(), element.jsValue()).fromJSValue()! } public func insertAdjacentText(where: String, data: String) { - _ = jsObject.insertAdjacentText!(`where`.jsValue(), data.jsValue()) + _ = jsObject["insertAdjacentText"]!(`where`.jsValue(), data.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift new file mode 100644 index 00000000..3697ab62 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol ElementCSSInlineStyle: JSBridgedClass {} +public extension ElementCSSInlineStyle { + var style: CSSStyleDeclaration { ReadonlyAttribute["style", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/ElementContentEditable.swift b/Sources/DOMKit/WebIDL/ElementContentEditable.swift index afdf3b4c..833de77f 100644 --- a/Sources/DOMKit/WebIDL/ElementContentEditable.swift +++ b/Sources/DOMKit/WebIDL/ElementContentEditable.swift @@ -1,41 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol ElementContentEditable: JSBridgedClass {} - public extension ElementContentEditable { var contentEditable: String { - get { - return jsObject.contentEditable.fromJSValue()! - } - set { - jsObject.contentEditable = newValue.jsValue() - } + get { ReadWriteAttribute["contentEditable", in: jsObject] } + set { ReadWriteAttribute["contentEditable", in: jsObject] = newValue } } var enterKeyHint: String { - get { - return jsObject.enterKeyHint.fromJSValue()! - } - set { - jsObject.enterKeyHint = newValue.jsValue() - } + get { ReadWriteAttribute["enterKeyHint", in: jsObject] } + set { ReadWriteAttribute["enterKeyHint", in: jsObject] = newValue } } - var isContentEditable: Bool { - return jsObject.isContentEditable.fromJSValue()! - } + var isContentEditable: Bool { ReadonlyAttribute["isContentEditable", in: jsObject] } var inputMode: String { - get { - return jsObject.inputMode.fromJSValue()! - } - set { - jsObject.inputMode = newValue.jsValue() - } + get { ReadWriteAttribute["inputMode", in: jsObject] } + set { ReadWriteAttribute["inputMode", in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift new file mode 100644 index 00000000..72bb3297 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ElementCreationOptions: JSObject { + public init(is: String) { + let object = JSObject.global.Object.function!.new() + object["is"] = `is`.jsValue() + _is = ReadWriteAttribute(jsObject: object, name: "is") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var `is`: String +} diff --git a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift new file mode 100644 index 00000000..ad6f59cb --- /dev/null +++ b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ElementDefinitionOptions: JSObject { + public init(extends: String) { + let object = JSObject.global.Object.function!.new() + object["extends"] = extends.jsValue() + _extends = ReadWriteAttribute(jsObject: object, name: "extends") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var extends: String +} diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index ead9ef83..a61b8542 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -1,16 +1,15 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit -public class ElementInternals: JSBridgedClass { +public class ElementInternals: JSBridgedClass, ARIAMixin { public class var constructor: JSFunction { JSObject.global.ElementInternals.function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: "shadowRoot") _form = ReadonlyAttribute(jsObject: jsObject, name: "form") _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") @@ -19,27 +18,18 @@ public class ElementInternals: JSBridgedClass { self.jsObject = jsObject } - public func setFormValue(value: FileOrStringOrFormData?, state: FileOrStringOrFormData?) { - _ = jsObject.setFormValue!(value.jsValue(), state.jsValue()) - } + @ReadonlyAttribute + public var shadowRoot: ShadowRoot? - public func setFormValue(value: FileOrStringOrFormData?) { - _ = jsObject.setFormValue!(value.jsValue()) + public func setFormValue(value: __UNSUPPORTED_UNION__?, state: __UNSUPPORTED_UNION__? = nil) { + _ = jsObject["setFormValue"]!(value.jsValue(), state?.jsValue() ?? .undefined) } @ReadonlyAttribute public var form: HTMLFormElement? - public func setValidity(flags: ValidityStateFlags, message: String, anchor: HTMLElement) { - _ = jsObject.setValidity!(flags.jsValue(), message.jsValue(), anchor.jsValue()) - } - - public func setValidity(flags: ValidityStateFlags, message: String) { - _ = jsObject.setValidity!(flags.jsValue(), message.jsValue()) - } - - public func setValidity(flags: ValidityStateFlags) { - _ = jsObject.setValidity!(flags.jsValue()) + public func setValidity(flags: ValidityStateFlags? = nil, message: String? = nil, anchor: HTMLElement? = nil) { + _ = jsObject["setValidity"]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined) } @ReadonlyAttribute @@ -52,11 +42,11 @@ public class ElementInternals: JSBridgedClass { public var validationMessage: String public func checkValidity() -> Bool { - return jsObject.checkValidity!().fromJSValue()! + jsObject["checkValidity"]!().fromJSValue()! } public func reportValidity() -> Bool { - return jsObject.reportValidity!().fromJSValue()! + jsObject["reportValidity"]!().fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EndingType.swift b/Sources/DOMKit/WebIDL/EndingType.swift index 91a975d3..e59a7878 100644 --- a/Sources/DOMKit/WebIDL/EndingType.swift +++ b/Sources/DOMKit/WebIDL/EndingType.swift @@ -1,23 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public enum EndingType: String, JSValueCompatible { - public static func construct(from jsValue: JSValue) -> EndingType? { - if let string = jsValue.string, - let value = EndingType(rawValue: string) - { - return value + case transparent + case native + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) } return nil } - case transparent - case native - public func jsValue() -> JSValue { - return rawValue.jsValue() - } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/EpochTimeStamp.swift b/Sources/DOMKit/WebIDL/EpochTimeStamp.swift deleted file mode 100644 index f8ca578a..00000000 --- a/Sources/DOMKit/WebIDL/EpochTimeStamp.swift +++ /dev/null @@ -1,3 +0,0 @@ -import JavaScriptKit - -public typealias EpochTimeStamp = Double diff --git a/Sources/DOMKit/WebIDL/ErrorEvent.swift b/Sources/DOMKit/WebIDL/ErrorEvent.swift new file mode 100644 index 00000000..99a4850a --- /dev/null +++ b/Sources/DOMKit/WebIDL/ErrorEvent.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ErrorEvent: Event { + override public class var constructor: JSFunction { JSObject.global.ErrorEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _message = ReadonlyAttribute(jsObject: jsObject, name: "message") + _filename = ReadonlyAttribute(jsObject: jsObject, name: "filename") + _lineno = ReadonlyAttribute(jsObject: jsObject, name: "lineno") + _colno = ReadonlyAttribute(jsObject: jsObject, name: "colno") + _error = ReadonlyAttribute(jsObject: jsObject, name: "error") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: ErrorEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var message: String + + @ReadonlyAttribute + public var filename: String + + @ReadonlyAttribute + public var lineno: UInt32 + + @ReadonlyAttribute + public var colno: UInt32 + + @ReadonlyAttribute + public var error: JSValue +} diff --git a/Sources/DOMKit/WebIDL/ErrorEventInit.swift b/Sources/DOMKit/WebIDL/ErrorEventInit.swift new file mode 100644 index 00000000..ccf19955 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ErrorEventInit.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ErrorEventInit: JSObject { + public init(message: String, filename: String, lineno: UInt32, colno: UInt32, error: JSValue) { + let object = JSObject.global.Object.function!.new() + object["message"] = message.jsValue() + object["filename"] = filename.jsValue() + object["lineno"] = lineno.jsValue() + object["colno"] = colno.jsValue() + object["error"] = error.jsValue() + _message = ReadWriteAttribute(jsObject: object, name: "message") + _filename = ReadWriteAttribute(jsObject: object, name: "filename") + _lineno = ReadWriteAttribute(jsObject: object, name: "lineno") + _colno = ReadWriteAttribute(jsObject: object, name: "colno") + _error = ReadWriteAttribute(jsObject: object, name: "error") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var message: String + + @ReadWriteAttribute + public var filename: String + + @ReadWriteAttribute + public var lineno: UInt32 + + @ReadWriteAttribute + public var colno: UInt32 + + @ReadWriteAttribute + public var error: JSValue +} diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index 1c873e2e..a317ecb4 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class Event: JSBridgedClass { @@ -27,8 +25,8 @@ public class Event: JSBridgedClass { self.jsObject = jsObject } - public convenience init(type: String, eventInitDict: EventInit = [:]) { - self.init(unsafelyWrapping: Event.constructor.new(type.jsValue(), eventInitDict.jsValue())) + public convenience init(type: String, eventInitDict: EventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } @ReadonlyAttribute @@ -44,29 +42,29 @@ public class Event: JSBridgedClass { public var currentTarget: EventTarget? public func composedPath() -> [EventTarget] { - return jsObject.composedPath!().fromJSValue()! + jsObject["composedPath"]!().fromJSValue()! } - public let NONE: UInt16 = 0 + public static let NONE: UInt16 = 0 - public let CAPTURING_PHASE: UInt16 = 1 + public static let CAPTURING_PHASE: UInt16 = 1 - public let AT_TARGET: UInt16 = 2 + public static let AT_TARGET: UInt16 = 2 - public let BUBBLING_PHASE: UInt16 = 3 + public static let BUBBLING_PHASE: UInt16 = 3 @ReadonlyAttribute public var eventPhase: UInt16 public func stopPropagation() { - _ = jsObject.stopPropagation!() + _ = jsObject["stopPropagation"]!() } @ReadWriteAttribute public var cancelBubble: Bool public func stopImmediatePropagation() { - _ = jsObject.stopImmediatePropagation!() + _ = jsObject["stopImmediatePropagation"]!() } @ReadonlyAttribute @@ -79,7 +77,7 @@ public class Event: JSBridgedClass { public var returnValue: Bool public func preventDefault() { - _ = jsObject.preventDefault!() + _ = jsObject["preventDefault"]!() } @ReadonlyAttribute @@ -94,7 +92,7 @@ public class Event: JSBridgedClass { @ReadonlyAttribute public var timeStamp: DOMHighResTimeStamp - public func initEvent(type: String, bubbles: Bool = false, cancelable: Bool = false) { - _ = jsObject.initEvent!(type.jsValue(), bubbles.jsValue(), cancelable.jsValue()) + public func initEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil) { + _ = jsObject["initEvent"]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/EventHandler.swift b/Sources/DOMKit/WebIDL/EventHandler.swift deleted file mode 100644 index 35c30f68..00000000 --- a/Sources/DOMKit/WebIDL/EventHandler.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias EventHandler = EventHandlerNonNull? diff --git a/Sources/DOMKit/WebIDL/EventHandlerNonNull.swift b/Sources/DOMKit/WebIDL/EventHandlerNonNull.swift deleted file mode 100644 index cf2672b6..00000000 --- a/Sources/DOMKit/WebIDL/EventHandlerNonNull.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias EventHandlerNonNull = ((Event) -> JSValue) diff --git a/Sources/DOMKit/WebIDL/EventInit.swift b/Sources/DOMKit/WebIDL/EventInit.swift new file mode 100644 index 00000000..5aec4ad5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EventInit.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EventInit: JSObject { + public init(bubbles: Bool, cancelable: Bool, composed: Bool) { + let object = JSObject.global.Object.function!.new() + object["bubbles"] = bubbles.jsValue() + object["cancelable"] = cancelable.jsValue() + object["composed"] = composed.jsValue() + _bubbles = ReadWriteAttribute(jsObject: object, name: "bubbles") + _cancelable = ReadWriteAttribute(jsObject: object, name: "cancelable") + _composed = ReadWriteAttribute(jsObject: object, name: "composed") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var bubbles: Bool + + @ReadWriteAttribute + public var cancelable: Bool + + @ReadWriteAttribute + public var composed: Bool +} diff --git a/Sources/DOMKit/WebIDL/EventListener.swift b/Sources/DOMKit/WebIDL/EventListener.swift deleted file mode 100644 index 493a6072..00000000 --- a/Sources/DOMKit/WebIDL/EventListener.swift +++ /dev/null @@ -1,10 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public protocol EventListener: JSBridgedType { - func handleEvent(event: Event) -} diff --git a/Sources/DOMKit/WebIDL/EventListenerOptions.swift b/Sources/DOMKit/WebIDL/EventListenerOptions.swift new file mode 100644 index 00000000..2df1db5b --- /dev/null +++ b/Sources/DOMKit/WebIDL/EventListenerOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EventListenerOptions: JSObject { + public init(capture: Bool) { + let object = JSObject.global.Object.function!.new() + object["capture"] = capture.jsValue() + _capture = ReadWriteAttribute(jsObject: object, name: "capture") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var capture: Bool +} diff --git a/Sources/DOMKit/WebIDL/EventListenerOptionsOrBool.swift b/Sources/DOMKit/WebIDL/EventListenerOptionsOrBool.swift deleted file mode 100644 index 29c516d5..00000000 --- a/Sources/DOMKit/WebIDL/EventListenerOptionsOrBool.swift +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum EventListenerOptionsOrBool: JSBridgedType, ExpressibleByBooleanLiteral, ExpressibleByDictionaryLiteral { - case eventListenerOptions(EventListenerOptions) - case bool(Bool) - - public init?(from value: JSValue) { - if let decoded: EventListenerOptions = value.fromJSValue() { - self = .eventListenerOptions(decoded) - } else if let decoded: Bool = value.fromJSValue() { - self = .bool(decoded) - } else { - return nil - } - } - - public init(dictionaryLiteral elements: (EventListenerOptions.Key, EventListenerOptions.Value)...) { - self = .eventListenerOptions(.init(uniqueKeysWithValues: elements)) - } - - public init(booleanLiteral value: Bool) { - self = .bool(value) - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .eventListenerOptions(v): return v.jsValue() - case let .bool(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/EventModifierInit.swift b/Sources/DOMKit/WebIDL/EventModifierInit.swift new file mode 100644 index 00000000..04f085c5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EventModifierInit.swift @@ -0,0 +1,81 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EventModifierInit: JSObject { + public init(ctrlKey: Bool, shiftKey: Bool, altKey: Bool, metaKey: Bool, modifierAltGraph: Bool, modifierCapsLock: Bool, modifierFn: Bool, modifierFnLock: Bool, modifierHyper: Bool, modifierNumLock: Bool, modifierScrollLock: Bool, modifierSuper: Bool, modifierSymbol: Bool, modifierSymbolLock: Bool) { + let object = JSObject.global.Object.function!.new() + object["ctrlKey"] = ctrlKey.jsValue() + object["shiftKey"] = shiftKey.jsValue() + object["altKey"] = altKey.jsValue() + object["metaKey"] = metaKey.jsValue() + object["modifierAltGraph"] = modifierAltGraph.jsValue() + object["modifierCapsLock"] = modifierCapsLock.jsValue() + object["modifierFn"] = modifierFn.jsValue() + object["modifierFnLock"] = modifierFnLock.jsValue() + object["modifierHyper"] = modifierHyper.jsValue() + object["modifierNumLock"] = modifierNumLock.jsValue() + object["modifierScrollLock"] = modifierScrollLock.jsValue() + object["modifierSuper"] = modifierSuper.jsValue() + object["modifierSymbol"] = modifierSymbol.jsValue() + object["modifierSymbolLock"] = modifierSymbolLock.jsValue() + _ctrlKey = ReadWriteAttribute(jsObject: object, name: "ctrlKey") + _shiftKey = ReadWriteAttribute(jsObject: object, name: "shiftKey") + _altKey = ReadWriteAttribute(jsObject: object, name: "altKey") + _metaKey = ReadWriteAttribute(jsObject: object, name: "metaKey") + _modifierAltGraph = ReadWriteAttribute(jsObject: object, name: "modifierAltGraph") + _modifierCapsLock = ReadWriteAttribute(jsObject: object, name: "modifierCapsLock") + _modifierFn = ReadWriteAttribute(jsObject: object, name: "modifierFn") + _modifierFnLock = ReadWriteAttribute(jsObject: object, name: "modifierFnLock") + _modifierHyper = ReadWriteAttribute(jsObject: object, name: "modifierHyper") + _modifierNumLock = ReadWriteAttribute(jsObject: object, name: "modifierNumLock") + _modifierScrollLock = ReadWriteAttribute(jsObject: object, name: "modifierScrollLock") + _modifierSuper = ReadWriteAttribute(jsObject: object, name: "modifierSuper") + _modifierSymbol = ReadWriteAttribute(jsObject: object, name: "modifierSymbol") + _modifierSymbolLock = ReadWriteAttribute(jsObject: object, name: "modifierSymbolLock") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var ctrlKey: Bool + + @ReadWriteAttribute + public var shiftKey: Bool + + @ReadWriteAttribute + public var altKey: Bool + + @ReadWriteAttribute + public var metaKey: Bool + + @ReadWriteAttribute + public var modifierAltGraph: Bool + + @ReadWriteAttribute + public var modifierCapsLock: Bool + + @ReadWriteAttribute + public var modifierFn: Bool + + @ReadWriteAttribute + public var modifierFnLock: Bool + + @ReadWriteAttribute + public var modifierHyper: Bool + + @ReadWriteAttribute + public var modifierNumLock: Bool + + @ReadWriteAttribute + public var modifierScrollLock: Bool + + @ReadWriteAttribute + public var modifierSuper: Bool + + @ReadWriteAttribute + public var modifierSymbol: Bool + + @ReadWriteAttribute + public var modifierSymbolLock: Bool +} diff --git a/Sources/DOMKit/WebIDL/EventOrString.swift b/Sources/DOMKit/WebIDL/EventOrString.swift deleted file mode 100644 index 416e87c7..00000000 --- a/Sources/DOMKit/WebIDL/EventOrString.swift +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum EventOrString: JSBridgedType, ExpressibleByStringLiteral { - case event(Event) - case string(String) - - public init?(from value: JSValue) { - if let decoded: Event = value.fromJSValue() { - self = .event(decoded) - } else if let decoded: String = value.fromJSValue() { - self = .string(decoded) - } else { - return nil - } - } - - public init(stringLiteral value: String) { - self = .string(value) - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .event(v): return v.jsValue() - case let .string(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift new file mode 100644 index 00000000..b3f40489 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EventSource: EventTarget { + override public class var constructor: JSFunction { JSObject.global.EventSource.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _url = ReadonlyAttribute(jsObject: jsObject, name: "url") + _withCredentials = ReadonlyAttribute(jsObject: jsObject, name: "withCredentials") + _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") + _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: "onopen") + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onerror") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(url: String, eventSourceInitDict: EventSourceInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), eventSourceInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var withCredentials: Bool + + public static let CONNECTING: UInt16 = 0 + + public static let OPEN: UInt16 = 1 + + public static let CLOSED: UInt16 = 2 + + @ReadonlyAttribute + public var readyState: UInt16 + + @ClosureAttribute.Optional1 + public var onopen: EventHandler + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + public func close() { + _ = jsObject["close"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/EventSourceInit.swift b/Sources/DOMKit/WebIDL/EventSourceInit.swift new file mode 100644 index 00000000..94e5cfac --- /dev/null +++ b/Sources/DOMKit/WebIDL/EventSourceInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EventSourceInit: JSObject { + public init(withCredentials: Bool) { + let object = JSObject.global.Object.function!.new() + object["withCredentials"] = withCredentials.jsValue() + _withCredentials = ReadWriteAttribute(jsObject: object, name: "withCredentials") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var withCredentials: Bool +} diff --git a/Sources/DOMKit/WebIDL/EventTarget.swift b/Sources/DOMKit/WebIDL/EventTarget.swift index f5496619..6ade4fa1 100644 --- a/Sources/DOMKit/WebIDL/EventTarget.swift +++ b/Sources/DOMKit/WebIDL/EventTarget.swift @@ -1,19 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class EventTarget: JSBridgedClass { - public struct Token { - var type: String - var index: Int - } public class var constructor: JSFunction { JSObject.global.EventTarget.function! } - var eventListeners = [String: [JSClosure]]() - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -21,69 +13,14 @@ public class EventTarget: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: EventTarget.constructor.new()) - } - - deinit { - for (_, listeners) in eventListeners { - for closure in listeners { - closure.release() - } - } - } - - public func addEventListener( - type: String, - options: AddEventListenerOptionsOrBool = [:], - callback: EventListenerType) { - _ = jsObject.addEventListener!(type.jsValue(), callback.jsValue(), options.jsValue()) + self.init(unsafelyWrapping: Self.constructor.new()) } - public func addEventListener( - type: String, - options: AddEventListenerOptionsOrBool = [:], - callback: @escaping (Event) -> () - ) -> Token { - let closure = JSClosure { callback($0[0].fromJSValue()!) } - let token: Token - let listeners: [JSClosure] - if var existingListeners = eventListeners[type] { - token = Token(type: type, index: existingListeners.count) - existingListeners.append(closure) - listeners = existingListeners - } else { - token = Token(type: type, index: 0) - listeners = [closure] - } - eventListeners[type] = listeners + // XXX: member 'addEventListener' is ignored - _ = jsObject.addEventListener!(type.jsValue(), closure, options.jsValue()) - - return token - } - - public func removeEventListener( - type: String, - options: EventListenerOptionsOrBool = [:], - callback: EventListenerType - ) { - _ = jsObject.removeEventListener!(type.jsValue(), callback.jsValue(), options.jsValue()) - } - - public func removeEventListener( - type: String, - token: Token, - options: EventListenerOptionsOrBool = [:] - ) { - guard var listeners = eventListeners[type] else { return } - - let closure = listeners[token.index] - _ = jsObject.removeEventListener!(type.jsValue(), closure, options.jsValue()) - listeners.remove(at: token.index) - closure.release() - } + // XXX: member 'removeEventListener' is ignored public func dispatchEvent(event: Event) -> Bool { - return jsObject.dispatchEvent!(event.jsValue()).fromJSValue()! + jsObject["dispatchEvent"]!(event.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/External.swift b/Sources/DOMKit/WebIDL/External.swift new file mode 100644 index 00000000..1da9e24e --- /dev/null +++ b/Sources/DOMKit/WebIDL/External.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class External: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.External.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func AddSearchProvider() { + _ = jsObject["AddSearchProvider"]!() + } + + public func IsSearchProviderInstalled() { + _ = jsObject["IsSearchProviderInstalled"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/File.swift b/Sources/DOMKit/WebIDL/File.swift index b483c911..09538ca1 100644 --- a/Sources/DOMKit/WebIDL/File.swift +++ b/Sources/DOMKit/WebIDL/File.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class File: Blob { @@ -14,8 +12,8 @@ public class File: Blob { super.init(unsafelyWrapping: jsObject) } - public convenience init(fileBits: [BlobPart], fileName: String, options: FilePropertyBag = [:]) { - self.init(unsafelyWrapping: File.constructor.new(fileBits.jsValue(), fileName.jsValue(), options.jsValue())) + public convenience init(fileBits: [BlobPart], fileName: String, options: FilePropertyBag? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(fileBits.jsValue(), fileName.jsValue(), options?.jsValue() ?? .undefined)) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FileList.swift b/Sources/DOMKit/WebIDL/FileList.swift index 73d1b7ea..d03e5121 100644 --- a/Sources/DOMKit/WebIDL/FileList.swift +++ b/Sources/DOMKit/WebIDL/FileList.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class FileList: JSBridgedClass { @@ -15,6 +13,10 @@ public class FileList: JSBridgedClass { self.jsObject = jsObject } + public subscript(key: Int) -> File? { + jsObject[key].fromJSValue() + } + @ReadonlyAttribute public var length: UInt32 } diff --git a/Sources/DOMKit/WebIDL/FileOrString.swift b/Sources/DOMKit/WebIDL/FileOrString.swift deleted file mode 100644 index 18779852..00000000 --- a/Sources/DOMKit/WebIDL/FileOrString.swift +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum FileOrString: JSBridgedType, ExpressibleByStringLiteral { - case file(File) - case string(String) - - public init?(from value: JSValue) { - if let decoded: File = value.fromJSValue() { - self = .file(decoded) - } else if let decoded: String = value.fromJSValue() { - self = .string(decoded) - } else { - return nil - } - } - - public init(stringLiteral value: String) { - self = .string(value) - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .file(v): return v.jsValue() - case let .string(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/FileOrStringOrFormData.swift b/Sources/DOMKit/WebIDL/FileOrStringOrFormData.swift deleted file mode 100644 index 630bf795..00000000 --- a/Sources/DOMKit/WebIDL/FileOrStringOrFormData.swift +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum FileOrStringOrFormData: JSBridgedType, ExpressibleByStringLiteral { - case file(File) - case string(String) - case formData(FormData) - - public init?(from value: JSValue) { - if let decoded: File = value.fromJSValue() { - self = .file(decoded) - } else if let decoded: String = value.fromJSValue() { - self = .string(decoded) - } else if let decoded: FormData = value.fromJSValue() { - self = .formData(decoded) - } else { - return nil - } - } - - public init(stringLiteral value: String) { - self = .string(value) - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .file(v): return v.jsValue() - case let .string(v): return v.jsValue() - case let .formData(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/FilePropertyBag.swift b/Sources/DOMKit/WebIDL/FilePropertyBag.swift new file mode 100644 index 00000000..07fe8dca --- /dev/null +++ b/Sources/DOMKit/WebIDL/FilePropertyBag.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FilePropertyBag: JSObject { + public init(lastModified: Int64) { + let object = JSObject.global.Object.function!.new() + object["lastModified"] = lastModified.jsValue() + _lastModified = ReadWriteAttribute(jsObject: object, name: "lastModified") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var lastModified: Int64 +} diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index 103dd64f..5f522721 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class FileReader: EventTarget { @@ -12,73 +10,69 @@ public class FileReader: EventTarget { _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") _result = ReadonlyAttribute(jsObject: jsObject, name: "result") _error = ReadonlyAttribute(jsObject: jsObject, name: "error") - _onloadstart = OptionalClosureHandler(jsObject: jsObject, name: "onloadstart") - _onprogress = OptionalClosureHandler(jsObject: jsObject, name: "onprogress") - _onload = OptionalClosureHandler(jsObject: jsObject, name: "onload") - _onabort = OptionalClosureHandler(jsObject: jsObject, name: "onabort") - _onerror = OptionalClosureHandler(jsObject: jsObject, name: "onerror") - _onloadend = OptionalClosureHandler(jsObject: jsObject, name: "onloadend") + _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: "onloadstart") + _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: "onprogress") + _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: "onload") + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: "onabort") + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onerror") + _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: "onloadend") super.init(unsafelyWrapping: jsObject) } public convenience init() { - self.init(unsafelyWrapping: FileReader.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } public func readAsArrayBuffer(blob: Blob) { - _ = jsObject.readAsArrayBuffer!(blob.jsValue()) + _ = jsObject["readAsArrayBuffer"]!(blob.jsValue()) } public func readAsBinaryString(blob: Blob) { - _ = jsObject.readAsBinaryString!(blob.jsValue()) - } - - public func readAsText(blob: Blob, encoding: String) { - _ = jsObject.readAsText!(blob.jsValue(), encoding.jsValue()) + _ = jsObject["readAsBinaryString"]!(blob.jsValue()) } - public func readAsText(blob: Blob) { - _ = jsObject.readAsText!(blob.jsValue()) + public func readAsText(blob: Blob, encoding: String? = nil) { + _ = jsObject["readAsText"]!(blob.jsValue(), encoding?.jsValue() ?? .undefined) } public func readAsDataURL(blob: Blob) { - _ = jsObject.readAsDataURL!(blob.jsValue()) + _ = jsObject["readAsDataURL"]!(blob.jsValue()) } public func abort() { - _ = jsObject.abort!() + _ = jsObject["abort"]!() } - public let EMPTY: UInt16 = 0 + public static let EMPTY: UInt16 = 0 - public let LOADING: UInt16 = 1 + public static let LOADING: UInt16 = 1 - public let DONE: UInt16 = 2 + public static let DONE: UInt16 = 2 @ReadonlyAttribute public var readyState: UInt16 @ReadonlyAttribute - public var result: StringOrArrayBuffer? + public var result: __UNSUPPORTED_UNION__? @ReadonlyAttribute public var error: DOMException? - @OptionalClosureHandler + @ClosureAttribute.Optional1 public var onloadstart: EventHandler - @OptionalClosureHandler + @ClosureAttribute.Optional1 public var onprogress: EventHandler - @OptionalClosureHandler + @ClosureAttribute.Optional1 public var onload: EventHandler - @OptionalClosureHandler + @ClosureAttribute.Optional1 public var onabort: EventHandler - @OptionalClosureHandler + @ClosureAttribute.Optional1 public var onerror: EventHandler - @OptionalClosureHandler + @ClosureAttribute.Optional1 public var onloadend: EventHandler } diff --git a/Sources/DOMKit/WebIDL/FileReaderSync.swift b/Sources/DOMKit/WebIDL/FileReaderSync.swift index c1a0fbd2..90cc03e5 100644 --- a/Sources/DOMKit/WebIDL/FileReaderSync.swift +++ b/Sources/DOMKit/WebIDL/FileReaderSync.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class FileReaderSync: JSBridgedClass { @@ -15,26 +13,22 @@ public class FileReaderSync: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: FileReaderSync.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } public func readAsArrayBuffer(blob: Blob) -> ArrayBuffer { - return jsObject.readAsArrayBuffer!(blob.jsValue()).fromJSValue()! + jsObject["readAsArrayBuffer"]!(blob.jsValue()).fromJSValue()! } public func readAsBinaryString(blob: Blob) -> String { - return jsObject.readAsBinaryString!(blob.jsValue()).fromJSValue()! - } - - public func readAsText(blob: Blob, encoding: String) -> String { - return jsObject.readAsText!(blob.jsValue(), encoding.jsValue()).fromJSValue()! + jsObject["readAsBinaryString"]!(blob.jsValue()).fromJSValue()! } - public func readAsText(blob: Blob) -> String { - return jsObject.readAsText!(blob.jsValue()).fromJSValue()! + public func readAsText(blob: Blob, encoding: String? = nil) -> String { + jsObject["readAsText"]!(blob.jsValue(), encoding?.jsValue() ?? .undefined).fromJSValue()! } public func readAsDataURL(blob: Blob) -> String { - return jsObject.readAsDataURL!(blob.jsValue()).fromJSValue()! + jsObject["readAsDataURL"]!(blob.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FocusEvent.swift b/Sources/DOMKit/WebIDL/FocusEvent.swift index 566508d7..0347caad 100644 --- a/Sources/DOMKit/WebIDL/FocusEvent.swift +++ b/Sources/DOMKit/WebIDL/FocusEvent.swift @@ -1,3 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop import JavaScriptKit public class FocusEvent: UIEvent { diff --git a/Sources/DOMKit/WebIDL/FocusEventInit.swift b/Sources/DOMKit/WebIDL/FocusEventInit.swift new file mode 100644 index 00000000..ac9294dc --- /dev/null +++ b/Sources/DOMKit/WebIDL/FocusEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FocusEventInit: JSObject { + public init(relatedTarget: EventTarget?) { + let object = JSObject.global.Object.function!.new() + object["relatedTarget"] = relatedTarget.jsValue() + _relatedTarget = ReadWriteAttribute(jsObject: object, name: "relatedTarget") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var relatedTarget: EventTarget? +} diff --git a/Sources/DOMKit/WebIDL/FocusOptions.swift b/Sources/DOMKit/WebIDL/FocusOptions.swift new file mode 100644 index 00000000..4e5c2d48 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FocusOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FocusOptions: JSObject { + public init(preventScroll: Bool) { + let object = JSObject.global.Object.function!.new() + object["preventScroll"] = preventScroll.jsValue() + _preventScroll = ReadWriteAttribute(jsObject: object, name: "preventScroll") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var preventScroll: Bool +} diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index 44ab9165..370ec961 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -1,11 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit -public class FormData: JSBridgedClass, KeyValueSequence { +public class FormData: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.FormData.function! } public let jsObject: JSObject @@ -14,55 +12,44 @@ public class FormData: JSBridgedClass, KeyValueSequence { self.jsObject = jsObject } - public typealias Value = FormDataEntryValue - - public convenience init(form: HTMLFormElement) { - self.init(unsafelyWrapping: FormData.constructor.new(form.jsValue())) - } - - public convenience init() { - self.init(unsafelyWrapping: FormData.constructor.new()) + public convenience init(form: HTMLFormElement? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(form?.jsValue() ?? .undefined)) } public func append(name: String, value: String) { - _ = jsObject.append!(name.jsValue(), value.jsValue()) + _ = jsObject["append"]!(name.jsValue(), value.jsValue()) } - public func append(name: String, blobValue: Blob, filename: String) { - _ = jsObject.append!(name.jsValue(), blobValue.jsValue(), filename.jsValue()) - } - - public func append(name: String, blobValue: Blob) { - _ = jsObject.append!(name.jsValue(), blobValue.jsValue()) + public func append(name: String, blobValue: Blob, filename: String? = nil) { + _ = jsObject["append"]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) } public func delete(name: String) { - _ = jsObject.delete!(name.jsValue()) + _ = jsObject["delete"]!(name.jsValue()) } public func get(name: String) -> FormDataEntryValue? { - return jsObject.get!(name.jsValue()).fromJSValue()! + jsObject["get"]!(name.jsValue()).fromJSValue()! } public func getAll(name: String) -> [FormDataEntryValue] { - return jsObject.getAll!(name.jsValue()).fromJSValue()! + jsObject["getAll"]!(name.jsValue()).fromJSValue()! } public func has(name: String) -> Bool { - return jsObject.has!(name.jsValue()).fromJSValue()! + jsObject["has"]!(name.jsValue()).fromJSValue()! } public func set(name: String, value: String) { - _ = jsObject.set!(name.jsValue(), value.jsValue()) + _ = jsObject["set"]!(name.jsValue(), value.jsValue()) } - public func set(name: String, blobValue: Blob, filename: String) { - _ = jsObject.set!(name.jsValue(), blobValue.jsValue(), filename.jsValue()) + public func set(name: String, blobValue: Blob, filename: String? = nil) { + _ = jsObject["set"]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) } - public func set(name: String, blobValue: Blob) { - _ = jsObject.set!(name.jsValue(), blobValue.jsValue()) + public typealias Element = String + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) } - - public func makeIterator() -> PairIterableIterator { return PairIterableIterator(sequence: self) } } diff --git a/Sources/DOMKit/WebIDL/FormDataEntryValue.swift b/Sources/DOMKit/WebIDL/FormDataEntryValue.swift deleted file mode 100644 index fb8f934f..00000000 --- a/Sources/DOMKit/WebIDL/FormDataEntryValue.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias FormDataEntryValue = FileOrString diff --git a/Sources/DOMKit/WebIDL/FormDataEvent.swift b/Sources/DOMKit/WebIDL/FormDataEvent.swift new file mode 100644 index 00000000..95fc939c --- /dev/null +++ b/Sources/DOMKit/WebIDL/FormDataEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FormDataEvent: Event { + override public class var constructor: JSFunction { JSObject.global.FormDataEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _formData = ReadonlyAttribute(jsObject: jsObject, name: "formData") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: FormDataEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var formData: FormData +} diff --git a/Sources/DOMKit/WebIDL/FormDataEventInit.swift b/Sources/DOMKit/WebIDL/FormDataEventInit.swift new file mode 100644 index 00000000..97edcded --- /dev/null +++ b/Sources/DOMKit/WebIDL/FormDataEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FormDataEventInit: JSObject { + public init(formData: FormData) { + let object = JSObject.global.Object.function!.new() + object["formData"] = formData.jsValue() + _formData = ReadWriteAttribute(jsObject: object, name: "formData") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var formData: FormData +} diff --git a/Sources/DOMKit/WebIDL/Function.swift b/Sources/DOMKit/WebIDL/Function.swift deleted file mode 100644 index 2ae482e9..00000000 --- a/Sources/DOMKit/WebIDL/Function.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias Function = ((JSValue) -> JSValue) diff --git a/Sources/DOMKit/WebIDL/GenericTransformStream.swift b/Sources/DOMKit/WebIDL/GenericTransformStream.swift new file mode 100644 index 00000000..aa0a61ac --- /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 { + var readable: ReadableStream { ReadonlyAttribute["readable", in: jsObject] } + + var writable: WritableStream { ReadonlyAttribute["writable", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift new file mode 100644 index 00000000..0ecd17c2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GetRootNodeOptions: JSObject { + public init(composed: Bool) { + let object = JSObject.global.Object.function!.new() + object["composed"] = composed.jsValue() + _composed = ReadWriteAttribute(jsObject: object, name: "composed") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var composed: Bool +} diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift new file mode 100644 index 00000000..598afad1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -0,0 +1,347 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol GlobalEventHandlers: JSBridgedClass {} +public extension GlobalEventHandlers { + var onabort: EventHandler { + get { ClosureAttribute.Optional1["onabort", in: jsObject] } + set { ClosureAttribute.Optional1["onabort", in: jsObject] = newValue } + } + + var onauxclick: EventHandler { + get { ClosureAttribute.Optional1["onauxclick", in: jsObject] } + set { ClosureAttribute.Optional1["onauxclick", in: jsObject] = newValue } + } + + var onblur: EventHandler { + get { ClosureAttribute.Optional1["onblur", in: jsObject] } + set { ClosureAttribute.Optional1["onblur", in: jsObject] = newValue } + } + + var oncancel: EventHandler { + get { ClosureAttribute.Optional1["oncancel", in: jsObject] } + set { ClosureAttribute.Optional1["oncancel", in: jsObject] = newValue } + } + + var oncanplay: EventHandler { + get { ClosureAttribute.Optional1["oncanplay", in: jsObject] } + set { ClosureAttribute.Optional1["oncanplay", in: jsObject] = newValue } + } + + var oncanplaythrough: EventHandler { + get { ClosureAttribute.Optional1["oncanplaythrough", in: jsObject] } + set { ClosureAttribute.Optional1["oncanplaythrough", in: jsObject] = newValue } + } + + var onchange: EventHandler { + get { ClosureAttribute.Optional1["onchange", in: jsObject] } + set { ClosureAttribute.Optional1["onchange", in: jsObject] = newValue } + } + + var onclick: EventHandler { + get { ClosureAttribute.Optional1["onclick", in: jsObject] } + set { ClosureAttribute.Optional1["onclick", in: jsObject] = newValue } + } + + var onclose: EventHandler { + get { ClosureAttribute.Optional1["onclose", in: jsObject] } + set { ClosureAttribute.Optional1["onclose", in: jsObject] = newValue } + } + + var oncontextlost: EventHandler { + get { ClosureAttribute.Optional1["oncontextlost", in: jsObject] } + set { ClosureAttribute.Optional1["oncontextlost", in: jsObject] = newValue } + } + + var oncontextmenu: EventHandler { + get { ClosureAttribute.Optional1["oncontextmenu", in: jsObject] } + set { ClosureAttribute.Optional1["oncontextmenu", in: jsObject] = newValue } + } + + var oncontextrestored: EventHandler { + get { ClosureAttribute.Optional1["oncontextrestored", in: jsObject] } + set { ClosureAttribute.Optional1["oncontextrestored", in: jsObject] = newValue } + } + + var oncuechange: EventHandler { + get { ClosureAttribute.Optional1["oncuechange", in: jsObject] } + set { ClosureAttribute.Optional1["oncuechange", in: jsObject] = newValue } + } + + var ondblclick: EventHandler { + get { ClosureAttribute.Optional1["ondblclick", in: jsObject] } + set { ClosureAttribute.Optional1["ondblclick", in: jsObject] = newValue } + } + + var ondrag: EventHandler { + get { ClosureAttribute.Optional1["ondrag", in: jsObject] } + set { ClosureAttribute.Optional1["ondrag", in: jsObject] = newValue } + } + + var ondragend: EventHandler { + get { ClosureAttribute.Optional1["ondragend", in: jsObject] } + set { ClosureAttribute.Optional1["ondragend", in: jsObject] = newValue } + } + + var ondragenter: EventHandler { + get { ClosureAttribute.Optional1["ondragenter", in: jsObject] } + set { ClosureAttribute.Optional1["ondragenter", in: jsObject] = newValue } + } + + var ondragleave: EventHandler { + get { ClosureAttribute.Optional1["ondragleave", in: jsObject] } + set { ClosureAttribute.Optional1["ondragleave", in: jsObject] = newValue } + } + + var ondragover: EventHandler { + get { ClosureAttribute.Optional1["ondragover", in: jsObject] } + set { ClosureAttribute.Optional1["ondragover", in: jsObject] = newValue } + } + + var ondragstart: EventHandler { + get { ClosureAttribute.Optional1["ondragstart", in: jsObject] } + set { ClosureAttribute.Optional1["ondragstart", in: jsObject] = newValue } + } + + var ondrop: EventHandler { + get { ClosureAttribute.Optional1["ondrop", in: jsObject] } + set { ClosureAttribute.Optional1["ondrop", in: jsObject] = newValue } + } + + var ondurationchange: EventHandler { + get { ClosureAttribute.Optional1["ondurationchange", in: jsObject] } + set { ClosureAttribute.Optional1["ondurationchange", in: jsObject] = newValue } + } + + var onemptied: EventHandler { + get { ClosureAttribute.Optional1["onemptied", in: jsObject] } + set { ClosureAttribute.Optional1["onemptied", in: jsObject] = newValue } + } + + var onended: EventHandler { + get { ClosureAttribute.Optional1["onended", in: jsObject] } + set { ClosureAttribute.Optional1["onended", in: jsObject] = newValue } + } + + var onerror: OnErrorEventHandler { + get { ClosureAttribute.Optional5["onerror", in: jsObject] } + set { ClosureAttribute.Optional5["onerror", in: jsObject] = newValue } + } + + var onfocus: EventHandler { + get { ClosureAttribute.Optional1["onfocus", in: jsObject] } + set { ClosureAttribute.Optional1["onfocus", in: jsObject] = newValue } + } + + var onformdata: EventHandler { + get { ClosureAttribute.Optional1["onformdata", in: jsObject] } + set { ClosureAttribute.Optional1["onformdata", in: jsObject] = newValue } + } + + var oninput: EventHandler { + get { ClosureAttribute.Optional1["oninput", in: jsObject] } + set { ClosureAttribute.Optional1["oninput", in: jsObject] = newValue } + } + + var oninvalid: EventHandler { + get { ClosureAttribute.Optional1["oninvalid", in: jsObject] } + set { ClosureAttribute.Optional1["oninvalid", in: jsObject] = newValue } + } + + var onkeydown: EventHandler { + get { ClosureAttribute.Optional1["onkeydown", in: jsObject] } + set { ClosureAttribute.Optional1["onkeydown", in: jsObject] = newValue } + } + + var onkeypress: EventHandler { + get { ClosureAttribute.Optional1["onkeypress", in: jsObject] } + set { ClosureAttribute.Optional1["onkeypress", in: jsObject] = newValue } + } + + var onkeyup: EventHandler { + get { ClosureAttribute.Optional1["onkeyup", in: jsObject] } + set { ClosureAttribute.Optional1["onkeyup", in: jsObject] = newValue } + } + + var onload: EventHandler { + get { ClosureAttribute.Optional1["onload", in: jsObject] } + set { ClosureAttribute.Optional1["onload", in: jsObject] = newValue } + } + + var onloadeddata: EventHandler { + get { ClosureAttribute.Optional1["onloadeddata", in: jsObject] } + set { ClosureAttribute.Optional1["onloadeddata", in: jsObject] = newValue } + } + + var onloadedmetadata: EventHandler { + get { ClosureAttribute.Optional1["onloadedmetadata", in: jsObject] } + set { ClosureAttribute.Optional1["onloadedmetadata", in: jsObject] = newValue } + } + + var onloadstart: EventHandler { + get { ClosureAttribute.Optional1["onloadstart", in: jsObject] } + set { ClosureAttribute.Optional1["onloadstart", in: jsObject] = newValue } + } + + var onmousedown: EventHandler { + get { ClosureAttribute.Optional1["onmousedown", in: jsObject] } + set { ClosureAttribute.Optional1["onmousedown", in: jsObject] = newValue } + } + + var onmouseenter: EventHandler { + get { ClosureAttribute.Optional1["onmouseenter", in: jsObject] } + set { ClosureAttribute.Optional1["onmouseenter", in: jsObject] = newValue } + } + + var onmouseleave: EventHandler { + get { ClosureAttribute.Optional1["onmouseleave", in: jsObject] } + set { ClosureAttribute.Optional1["onmouseleave", in: jsObject] = newValue } + } + + var onmousemove: EventHandler { + get { ClosureAttribute.Optional1["onmousemove", in: jsObject] } + set { ClosureAttribute.Optional1["onmousemove", in: jsObject] = newValue } + } + + var onmouseout: EventHandler { + get { ClosureAttribute.Optional1["onmouseout", in: jsObject] } + set { ClosureAttribute.Optional1["onmouseout", in: jsObject] = newValue } + } + + var onmouseover: EventHandler { + get { ClosureAttribute.Optional1["onmouseover", in: jsObject] } + set { ClosureAttribute.Optional1["onmouseover", in: jsObject] = newValue } + } + + var onmouseup: EventHandler { + get { ClosureAttribute.Optional1["onmouseup", in: jsObject] } + set { ClosureAttribute.Optional1["onmouseup", in: jsObject] = newValue } + } + + var onpause: EventHandler { + get { ClosureAttribute.Optional1["onpause", in: jsObject] } + set { ClosureAttribute.Optional1["onpause", in: jsObject] = newValue } + } + + var onplay: EventHandler { + get { ClosureAttribute.Optional1["onplay", in: jsObject] } + set { ClosureAttribute.Optional1["onplay", in: jsObject] = newValue } + } + + var onplaying: EventHandler { + get { ClosureAttribute.Optional1["onplaying", in: jsObject] } + set { ClosureAttribute.Optional1["onplaying", in: jsObject] = newValue } + } + + var onprogress: EventHandler { + get { ClosureAttribute.Optional1["onprogress", in: jsObject] } + set { ClosureAttribute.Optional1["onprogress", in: jsObject] = newValue } + } + + var onratechange: EventHandler { + get { ClosureAttribute.Optional1["onratechange", in: jsObject] } + set { ClosureAttribute.Optional1["onratechange", in: jsObject] = newValue } + } + + var onreset: EventHandler { + get { ClosureAttribute.Optional1["onreset", in: jsObject] } + set { ClosureAttribute.Optional1["onreset", in: jsObject] = newValue } + } + + var onresize: EventHandler { + get { ClosureAttribute.Optional1["onresize", in: jsObject] } + set { ClosureAttribute.Optional1["onresize", in: jsObject] = newValue } + } + + var onscroll: EventHandler { + get { ClosureAttribute.Optional1["onscroll", in: jsObject] } + set { ClosureAttribute.Optional1["onscroll", in: jsObject] = newValue } + } + + var onsecuritypolicyviolation: EventHandler { + get { ClosureAttribute.Optional1["onsecuritypolicyviolation", in: jsObject] } + set { ClosureAttribute.Optional1["onsecuritypolicyviolation", in: jsObject] = newValue } + } + + var onseeked: EventHandler { + get { ClosureAttribute.Optional1["onseeked", in: jsObject] } + set { ClosureAttribute.Optional1["onseeked", in: jsObject] = newValue } + } + + var onseeking: EventHandler { + get { ClosureAttribute.Optional1["onseeking", in: jsObject] } + set { ClosureAttribute.Optional1["onseeking", in: jsObject] = newValue } + } + + var onselect: EventHandler { + get { ClosureAttribute.Optional1["onselect", in: jsObject] } + set { ClosureAttribute.Optional1["onselect", in: jsObject] = newValue } + } + + var onslotchange: EventHandler { + get { ClosureAttribute.Optional1["onslotchange", in: jsObject] } + set { ClosureAttribute.Optional1["onslotchange", in: jsObject] = newValue } + } + + var onstalled: EventHandler { + get { ClosureAttribute.Optional1["onstalled", in: jsObject] } + set { ClosureAttribute.Optional1["onstalled", in: jsObject] = newValue } + } + + var onsubmit: EventHandler { + get { ClosureAttribute.Optional1["onsubmit", in: jsObject] } + set { ClosureAttribute.Optional1["onsubmit", in: jsObject] = newValue } + } + + var onsuspend: EventHandler { + get { ClosureAttribute.Optional1["onsuspend", in: jsObject] } + set { ClosureAttribute.Optional1["onsuspend", in: jsObject] = newValue } + } + + var ontimeupdate: EventHandler { + get { ClosureAttribute.Optional1["ontimeupdate", in: jsObject] } + set { ClosureAttribute.Optional1["ontimeupdate", in: jsObject] = newValue } + } + + var ontoggle: EventHandler { + get { ClosureAttribute.Optional1["ontoggle", in: jsObject] } + set { ClosureAttribute.Optional1["ontoggle", in: jsObject] = newValue } + } + + var onvolumechange: EventHandler { + get { ClosureAttribute.Optional1["onvolumechange", in: jsObject] } + set { ClosureAttribute.Optional1["onvolumechange", in: jsObject] = newValue } + } + + var onwaiting: EventHandler { + get { ClosureAttribute.Optional1["onwaiting", in: jsObject] } + set { ClosureAttribute.Optional1["onwaiting", in: jsObject] = newValue } + } + + var onwebkitanimationend: EventHandler { + get { ClosureAttribute.Optional1["onwebkitanimationend", in: jsObject] } + set { ClosureAttribute.Optional1["onwebkitanimationend", in: jsObject] = newValue } + } + + var onwebkitanimationiteration: EventHandler { + get { ClosureAttribute.Optional1["onwebkitanimationiteration", in: jsObject] } + set { ClosureAttribute.Optional1["onwebkitanimationiteration", in: jsObject] = newValue } + } + + var onwebkitanimationstart: EventHandler { + get { ClosureAttribute.Optional1["onwebkitanimationstart", in: jsObject] } + set { ClosureAttribute.Optional1["onwebkitanimationstart", in: jsObject] = newValue } + } + + var onwebkittransitionend: EventHandler { + get { ClosureAttribute.Optional1["onwebkittransitionend", in: jsObject] } + set { ClosureAttribute.Optional1["onwebkittransitionend", in: jsObject] = newValue } + } + + var onwheel: EventHandler { + get { ClosureAttribute.Optional1["onwheel", in: jsObject] } + set { ClosureAttribute.Optional1["onwheel", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift new file mode 100644 index 00000000..dd1644ac --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLAllCollection: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.HTMLAllCollection.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> Element { + jsObject[key].fromJSValue()! + } + + public subscript(key: String) -> __UNSUPPORTED_UNION__? { + jsObject[key].fromJSValue() + } + + public func item(nameOrIndex: String? = nil) -> __UNSUPPORTED_UNION__? { + jsObject["item"]!(nameOrIndex?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift new file mode 100644 index 00000000..a1ba0561 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { + override public class var constructor: JSFunction { JSObject.global.HTMLAnchorElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _target = ReadWriteAttribute(jsObject: jsObject, name: "target") + _download = ReadWriteAttribute(jsObject: jsObject, name: "download") + _ping = ReadWriteAttribute(jsObject: jsObject, name: "ping") + _rel = ReadWriteAttribute(jsObject: jsObject, name: "rel") + _relList = ReadonlyAttribute(jsObject: jsObject, name: "relList") + _hreflang = ReadWriteAttribute(jsObject: jsObject, name: "hreflang") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _text = ReadWriteAttribute(jsObject: jsObject, name: "text") + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") + _coords = ReadWriteAttribute(jsObject: jsObject, name: "coords") + _charset = ReadWriteAttribute(jsObject: jsObject, name: "charset") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _rev = ReadWriteAttribute(jsObject: jsObject, name: "rev") + _shape = ReadWriteAttribute(jsObject: jsObject, name: "shape") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var target: String + + @ReadWriteAttribute + public var download: String + + @ReadWriteAttribute + public var ping: String + + @ReadWriteAttribute + public var rel: String + + @ReadonlyAttribute + public var relList: DOMTokenList + + @ReadWriteAttribute + public var hreflang: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var text: String + + @ReadWriteAttribute + public var referrerPolicy: String + + @ReadWriteAttribute + public var coords: String + + @ReadWriteAttribute + public var charset: String + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var rev: String + + @ReadWriteAttribute + public var shape: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift new file mode 100644 index 00000000..8ae9d39b --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLAreaElement: HTMLElement, HTMLHyperlinkElementUtils { + override public class var constructor: JSFunction { JSObject.global.HTMLAreaElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _alt = ReadWriteAttribute(jsObject: jsObject, name: "alt") + _coords = ReadWriteAttribute(jsObject: jsObject, name: "coords") + _shape = ReadWriteAttribute(jsObject: jsObject, name: "shape") + _target = ReadWriteAttribute(jsObject: jsObject, name: "target") + _download = ReadWriteAttribute(jsObject: jsObject, name: "download") + _ping = ReadWriteAttribute(jsObject: jsObject, name: "ping") + _rel = ReadWriteAttribute(jsObject: jsObject, name: "rel") + _relList = ReadonlyAttribute(jsObject: jsObject, name: "relList") + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") + _noHref = ReadWriteAttribute(jsObject: jsObject, name: "noHref") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var alt: String + + @ReadWriteAttribute + public var coords: String + + @ReadWriteAttribute + public var shape: String + + @ReadWriteAttribute + public var target: String + + @ReadWriteAttribute + public var download: String + + @ReadWriteAttribute + public var ping: String + + @ReadWriteAttribute + public var rel: String + + @ReadonlyAttribute + public var relList: DOMTokenList + + @ReadWriteAttribute + public var referrerPolicy: String + + @ReadWriteAttribute + public var noHref: Bool +} diff --git a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift new file mode 100644 index 00000000..61322a9b --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLAudioElement: HTMLMediaElement { + override public class var constructor: JSFunction { JSObject.global.HTMLAudioElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLBRElement.swift b/Sources/DOMKit/WebIDL/HTMLBRElement.swift new file mode 100644 index 00000000..8bc6acce --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLBRElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLBRElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLBRElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _clear = ReadWriteAttribute(jsObject: jsObject, name: "clear") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var clear: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift new file mode 100644 index 00000000..2d50177c --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLBaseElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLBaseElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _href = ReadWriteAttribute(jsObject: jsObject, name: "href") + _target = ReadWriteAttribute(jsObject: jsObject, name: "target") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var href: String + + @ReadWriteAttribute + public var target: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift new file mode 100644 index 00000000..c5647540 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLBodyElement: HTMLElement, WindowEventHandlers { + override public class var constructor: JSFunction { JSObject.global.HTMLBodyElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _text = ReadWriteAttribute(jsObject: jsObject, name: "text") + _link = ReadWriteAttribute(jsObject: jsObject, name: "link") + _vLink = ReadWriteAttribute(jsObject: jsObject, name: "vLink") + _aLink = ReadWriteAttribute(jsObject: jsObject, name: "aLink") + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") + _background = ReadWriteAttribute(jsObject: jsObject, name: "background") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var text: String + + @ReadWriteAttribute + public var link: String + + @ReadWriteAttribute + public var vLink: String + + @ReadWriteAttribute + public var aLink: String + + @ReadWriteAttribute + public var bgColor: String + + @ReadWriteAttribute + public var background: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift new file mode 100644 index 00000000..dede7ae6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -0,0 +1,84 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLButtonElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLButtonElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _formAction = ReadWriteAttribute(jsObject: jsObject, name: "formAction") + _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: "formEnctype") + _formMethod = ReadWriteAttribute(jsObject: jsObject, name: "formMethod") + _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: "formNoValidate") + _formTarget = ReadWriteAttribute(jsObject: jsObject, name: "formTarget") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") + _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") + _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var disabled: Bool + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var formAction: String + + @ReadWriteAttribute + public var formEnctype: String + + @ReadWriteAttribute + public var formMethod: String + + @ReadWriteAttribute + public var formNoValidate: Bool + + @ReadWriteAttribute + public var formTarget: String + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var value: String + + @ReadonlyAttribute + public var willValidate: Bool + + @ReadonlyAttribute + public var validity: ValidityState + + @ReadonlyAttribute + public var validationMessage: String + + public func checkValidity() -> Bool { + jsObject["checkValidity"]!().fromJSValue()! + } + + public func reportValidity() -> Bool { + jsObject["reportValidity"]!().fromJSValue()! + } + + public func setCustomValidity(error: String) { + _ = jsObject["setCustomValidity"]!(error.jsValue()) + } + + @ReadonlyAttribute + public var labels: NodeList +} diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift new file mode 100644 index 00000000..89b318af --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLCanvasElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLCanvasElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var width: UInt32 + + @ReadWriteAttribute + public var height: UInt32 + + public func getContext(contextId: String, options: JSValue? = nil) -> RenderingContext? { + jsObject["getContext"]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func toDataURL(type: String? = nil, quality: JSValue? = nil) -> String { + jsObject["toDataURL"]!(type?.jsValue() ?? .undefined, quality?.jsValue() ?? .undefined).fromJSValue()! + } + + // XXX: member 'toBlob' is ignored + + public func transferControlToOffscreen() -> OffscreenCanvas { + jsObject["transferControlToOffscreen"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLCollection.swift b/Sources/DOMKit/WebIDL/HTMLCollection.swift index 8b4b1622..74fb39b9 100644 --- a/Sources/DOMKit/WebIDL/HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLCollection.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class HTMLCollection: JSBridgedClass { @@ -15,10 +13,14 @@ public class HTMLCollection: JSBridgedClass { self.jsObject = jsObject } - public subscript(_: String) -> Element?? { - return jsObject.name.fromJSValue()! - } - @ReadonlyAttribute public var length: UInt32 + + public subscript(key: Int) -> Element? { + jsObject[key].fromJSValue() + } + + public subscript(key: String) -> Element? { + jsObject[key].fromJSValue() + } } diff --git a/Sources/DOMKit/WebIDL/HTMLDListElement.swift b/Sources/DOMKit/WebIDL/HTMLDListElement.swift new file mode 100644 index 00000000..10dba972 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLDListElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLDListElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLDListElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var compact: Bool +} diff --git a/Sources/DOMKit/WebIDL/HTMLDataElement.swift b/Sources/DOMKit/WebIDL/HTMLDataElement.swift new file mode 100644 index 00000000..1c5d07b3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLDataElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLDataElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLDataElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var value: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift new file mode 100644 index 00000000..1a0d02ec --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLDataListElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLDataListElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _options = ReadonlyAttribute(jsObject: jsObject, name: "options") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var options: HTMLCollection +} diff --git a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift new file mode 100644 index 00000000..bec9c6de --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLDetailsElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLDetailsElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _open = ReadWriteAttribute(jsObject: jsObject, name: "open") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var open: Bool +} diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift new file mode 100644 index 00000000..b22eecf1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLDialogElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLDialogElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _open = ReadWriteAttribute(jsObject: jsObject, name: "open") + _returnValue = ReadWriteAttribute(jsObject: jsObject, name: "returnValue") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var open: Bool + + @ReadWriteAttribute + public var returnValue: String + + public func show() { + _ = jsObject["show"]!() + } + + public func showModal() { + _ = jsObject["showModal"]!() + } + + public func close(returnValue: String? = nil) { + _ = jsObject["close"]!(returnValue?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift new file mode 100644 index 00000000..e023c219 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLDirectoryElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLDirectoryElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var compact: Bool +} diff --git a/Sources/DOMKit/WebIDL/HTMLDivElement.swift b/Sources/DOMKit/WebIDL/HTMLDivElement.swift new file mode 100644 index 00000000..6d79166b --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLDivElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLDivElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLDivElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var align: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLElement+EventHandler.swift b/Sources/DOMKit/WebIDL/HTMLElement+EventHandler.swift deleted file mode 100644 index 41d678e8..00000000 --- a/Sources/DOMKit/WebIDL/HTMLElement+EventHandler.swift +++ /dev/null @@ -1,1549 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public extension HTMLElement { - var onabort: EventHandler { - get { - guard let function = jsObject.onabort.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onabort"] { - oldClosure.release() - } - eventHandlerClosures["onabort"] = closure - jsObject.onabort = closure.jsValue() - } else { - jsObject.onabort = .null - } - } - } - - var onauxclick: EventHandler { - get { - guard let function = jsObject.onauxclick.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onauxclick"] { - oldClosure.release() - } - eventHandlerClosures["onauxclick"] = closure - jsObject.onauxclick = closure.jsValue() - } else { - jsObject.onauxclick = .null - } - } - } - - var onblur: EventHandler { - get { - guard let function = jsObject.onblur.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onblur"] { - oldClosure.release() - } - eventHandlerClosures["onblur"] = closure - jsObject.onblur = closure.jsValue() - } else { - jsObject.onblur = .null - } - } - } - - var oncancel: EventHandler { - get { - guard let function = jsObject.oncancel.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["oncancel"] { - oldClosure.release() - } - eventHandlerClosures["oncancel"] = closure - jsObject.oncancel = closure.jsValue() - } else { - jsObject.oncancel = .null - } - } - } - - var oncanplay: EventHandler { - get { - guard let function = jsObject.oncanplay.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["oncanplay"] { - oldClosure.release() - } - eventHandlerClosures["oncanplay"] = closure - jsObject.oncanplay = closure.jsValue() - } else { - jsObject.oncanplay = .null - } - } - } - - var oncanplaythrough: EventHandler { - get { - guard let function = jsObject.oncanplaythrough.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["oncanplaythrough"] { - oldClosure.release() - } - eventHandlerClosures["oncanplaythrough"] = closure - jsObject.oncanplaythrough = closure.jsValue() - } else { - jsObject.oncanplaythrough = .null - } - } - } - - var onchange: EventHandler { - get { - guard let function = jsObject.onchange.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onchange"] { - oldClosure.release() - } - eventHandlerClosures["onchange"] = closure - jsObject.onchange = closure.jsValue() - } else { - jsObject.onchange = .null - } - } - } - - var onclick: EventHandler { - get { - guard let function = jsObject.onclick.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onclick"] { - oldClosure.release() - } - eventHandlerClosures["onclick"] = closure - jsObject.onclick = closure.jsValue() - } else { - jsObject.onclick = .null - } - } - } - - var onclose: EventHandler { - get { - guard let function = jsObject.onclose.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onclose"] { - oldClosure.release() - } - eventHandlerClosures["onclose"] = closure - jsObject.onclose = closure.jsValue() - } else { - jsObject.onclose = .null - } - } - } - - var oncontextmenu: EventHandler { - get { - guard let function = jsObject.oncontextmenu.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["oncontextmenu"] { - oldClosure.release() - } - eventHandlerClosures["oncontextmenu"] = closure - jsObject.oncontextmenu = closure.jsValue() - } else { - jsObject.oncontextmenu = .null - } - } - } - - var oncuechange: EventHandler { - get { - guard let function = jsObject.oncuechange.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["oncuechange"] { - oldClosure.release() - } - eventHandlerClosures["oncuechange"] = closure - jsObject.oncuechange = closure.jsValue() - } else { - jsObject.oncuechange = .null - } - } - } - - var ondblclick: EventHandler { - get { - guard let function = jsObject.ondblclick.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondblclick"] { - oldClosure.release() - } - eventHandlerClosures["ondblclick"] = closure - jsObject.ondblclick = closure.jsValue() - } else { - jsObject.ondblclick = .null - } - } - } - - var ondrag: EventHandler { - get { - guard let function = jsObject.ondrag.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondrag"] { - oldClosure.release() - } - eventHandlerClosures["ondrag"] = closure - jsObject.ondrag = closure.jsValue() - } else { - jsObject.ondrag = .null - } - } - } - - var ondragend: EventHandler { - get { - guard let function = jsObject.ondragend.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondragend"] { - oldClosure.release() - } - eventHandlerClosures["ondragend"] = closure - jsObject.ondragend = closure.jsValue() - } else { - jsObject.ondragend = .null - } - } - } - - var ondragenter: EventHandler { - get { - guard let function = jsObject.ondragenter.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondragenter"] { - oldClosure.release() - } - eventHandlerClosures["ondragenter"] = closure - jsObject.ondragenter = closure.jsValue() - } else { - jsObject.ondragenter = .null - } - } - } - - var ondragexit: EventHandler { - get { - guard let function = jsObject.ondragexit.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondragexit"] { - oldClosure.release() - } - eventHandlerClosures["ondragexit"] = closure - jsObject.ondragexit = closure.jsValue() - } else { - jsObject.ondragexit = .null - } - } - } - - var ondragleave: EventHandler { - get { - guard let function = jsObject.ondragleave.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondragleave"] { - oldClosure.release() - } - eventHandlerClosures["ondragleave"] = closure - jsObject.ondragleave = closure.jsValue() - } else { - jsObject.ondragleave = .null - } - } - } - - var ondragover: EventHandler { - get { - guard let function = jsObject.ondragover.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondragover"] { - oldClosure.release() - } - eventHandlerClosures["ondragover"] = closure - jsObject.ondragover = closure.jsValue() - } else { - jsObject.ondragover = .null - } - } - } - - var ondragstart: EventHandler { - get { - guard let function = jsObject.ondragstart.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondragstart"] { - oldClosure.release() - } - eventHandlerClosures["ondragstart"] = closure - jsObject.ondragstart = closure.jsValue() - } else { - jsObject.ondragstart = .null - } - } - } - - var ondrop: EventHandler { - get { - guard let function = jsObject.ondrop.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondrop"] { - oldClosure.release() - } - eventHandlerClosures["ondrop"] = closure - jsObject.ondrop = closure.jsValue() - } else { - jsObject.ondrop = .null - } - } - } - - var ondurationchange: EventHandler { - get { - guard let function = jsObject.ondurationchange.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ondurationchange"] { - oldClosure.release() - } - eventHandlerClosures["ondurationchange"] = closure - jsObject.ondurationchange = closure.jsValue() - } else { - jsObject.ondurationchange = .null - } - } - } - - var onemptied: EventHandler { - get { - guard let function = jsObject.onemptied.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onemptied"] { - oldClosure.release() - } - eventHandlerClosures["onemptied"] = closure - jsObject.onemptied = closure.jsValue() - } else { - jsObject.onemptied = .null - } - } - } - - var onended: EventHandler { - get { - guard let function = jsObject.onended.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onended"] { - oldClosure.release() - } - eventHandlerClosures["onended"] = closure - jsObject.onended = closure.jsValue() - } else { - jsObject.onended = .null - } - } - } - - var onerror: OnErrorEventHandler { - get { - guard let function = jsObject.onerror.function else { - return nil - } - return { arg0, arg1, arg2, arg3, arg4 in function(arg0, arg1, arg2, arg3, arg4).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!, arguments[1].fromJSValue()!, arguments[2].fromJSValue()!, arguments[3].fromJSValue()!, arguments[4].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onerror"] { - oldClosure.release() - } - eventHandlerClosures["onerror"] = closure - jsObject.onerror = closure.jsValue() - } else { - jsObject.onerror = .null - } - } - } - - var onfocus: EventHandler { - get { - guard let function = jsObject.onfocus.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onfocus"] { - oldClosure.release() - } - eventHandlerClosures["onfocus"] = closure - jsObject.onfocus = closure.jsValue() - } else { - jsObject.onfocus = .null - } - } - } - - var onformdata: EventHandler { - get { - guard let function = jsObject.onformdata.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onformdata"] { - oldClosure.release() - } - eventHandlerClosures["onformdata"] = closure - jsObject.onformdata = closure.jsValue() - } else { - jsObject.onformdata = .null - } - } - } - - var oninput: EventHandler { - get { - guard let function = jsObject.oninput.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["oninput"] { - oldClosure.release() - } - eventHandlerClosures["oninput"] = closure - jsObject.oninput = closure.jsValue() - } else { - jsObject.oninput = .null - } - } - } - - var oninvalid: EventHandler { - get { - guard let function = jsObject.oninvalid.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["oninvalid"] { - oldClosure.release() - } - eventHandlerClosures["oninvalid"] = closure - jsObject.oninvalid = closure.jsValue() - } else { - jsObject.oninvalid = .null - } - } - } - - var onkeydown: EventHandler { - get { - guard let function = jsObject.onkeydown.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onkeydown"] { - oldClosure.release() - } - eventHandlerClosures["onkeydown"] = closure - jsObject.onkeydown = closure.jsValue() - } else { - jsObject.onkeydown = .null - } - } - } - - var onkeypress: EventHandler { - get { - guard let function = jsObject.onkeypress.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onkeypress"] { - oldClosure.release() - } - eventHandlerClosures["onkeypress"] = closure - jsObject.onkeypress = closure.jsValue() - } else { - jsObject.onkeypress = .null - } - } - } - - var onkeyup: EventHandler { - get { - guard let function = jsObject.onkeyup.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onkeyup"] { - oldClosure.release() - } - eventHandlerClosures["onkeyup"] = closure - jsObject.onkeyup = closure.jsValue() - } else { - jsObject.onkeyup = .null - } - } - } - - var onload: EventHandler { - get { - guard let function = jsObject.onload.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onload"] { - oldClosure.release() - } - eventHandlerClosures["onload"] = closure - jsObject.onload = closure.jsValue() - } else { - jsObject.onload = .null - } - } - } - - var onloadeddata: EventHandler { - get { - guard let function = jsObject.onloadeddata.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onloadeddata"] { - oldClosure.release() - } - eventHandlerClosures["onloadeddata"] = closure - jsObject.onloadeddata = closure.jsValue() - } else { - jsObject.onloadeddata = .null - } - } - } - - var onloadedmetadata: EventHandler { - get { - guard let function = jsObject.onloadedmetadata.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onloadedmetadata"] { - oldClosure.release() - } - eventHandlerClosures["onloadedmetadata"] = closure - jsObject.onloadedmetadata = closure.jsValue() - } else { - jsObject.onloadedmetadata = .null - } - } - } - - var onloadstart: EventHandler { - get { - guard let function = jsObject.onloadstart.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onloadstart"] { - oldClosure.release() - } - eventHandlerClosures["onloadstart"] = closure - jsObject.onloadstart = closure.jsValue() - } else { - jsObject.onloadstart = .null - } - } - } - - var onmousedown: EventHandler { - get { - guard let function = jsObject.onmousedown.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onmousedown"] { - oldClosure.release() - } - eventHandlerClosures["onmousedown"] = closure - jsObject.onmousedown = closure.jsValue() - } else { - jsObject.onmousedown = .null - } - } - } - - var onmouseenter: EventHandler { - get { - guard let function = jsObject.onmouseenter.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onmouseenter"] { - oldClosure.release() - } - eventHandlerClosures["onmouseenter"] = closure - jsObject.onmouseenter = closure.jsValue() - } else { - jsObject.onmouseenter = .null - } - } - } - - var onmouseleave: EventHandler { - get { - guard let function = jsObject.onmouseleave.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onmouseleave"] { - oldClosure.release() - } - eventHandlerClosures["onmouseleave"] = closure - jsObject.onmouseleave = closure.jsValue() - } else { - jsObject.onmouseleave = .null - } - } - } - - var onmousemove: EventHandler { - get { - guard let function = jsObject.onmousemove.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onmousemove"] { - oldClosure.release() - } - eventHandlerClosures["onmousemove"] = closure - jsObject.onmousemove = closure.jsValue() - } else { - jsObject.onmousemove = .null - } - } - } - - var onmouseout: EventHandler { - get { - guard let function = jsObject.onmouseout.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onmouseout"] { - oldClosure.release() - } - eventHandlerClosures["onmouseout"] = closure - jsObject.onmouseout = closure.jsValue() - } else { - jsObject.onmouseout = .null - } - } - } - - var onmouseover: EventHandler { - get { - guard let function = jsObject.onmouseover.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onmouseover"] { - oldClosure.release() - } - eventHandlerClosures["onmouseover"] = closure - jsObject.onmouseover = closure.jsValue() - } else { - jsObject.onmouseover = .null - } - } - } - - var onmouseup: EventHandler { - get { - guard let function = jsObject.onmouseup.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onmouseup"] { - oldClosure.release() - } - eventHandlerClosures["onmouseup"] = closure - jsObject.onmouseup = closure.jsValue() - } else { - jsObject.onmouseup = .null - } - } - } - - var onpause: EventHandler { - get { - guard let function = jsObject.onpause.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onpause"] { - oldClosure.release() - } - eventHandlerClosures["onpause"] = closure - jsObject.onpause = closure.jsValue() - } else { - jsObject.onpause = .null - } - } - } - - var onplay: EventHandler { - get { - guard let function = jsObject.onplay.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onplay"] { - oldClosure.release() - } - eventHandlerClosures["onplay"] = closure - jsObject.onplay = closure.jsValue() - } else { - jsObject.onplay = .null - } - } - } - - var onplaying: EventHandler { - get { - guard let function = jsObject.onplaying.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onplaying"] { - oldClosure.release() - } - eventHandlerClosures["onplaying"] = closure - jsObject.onplaying = closure.jsValue() - } else { - jsObject.onplaying = .null - } - } - } - - var onprogress: EventHandler { - get { - guard let function = jsObject.onprogress.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onprogress"] { - oldClosure.release() - } - eventHandlerClosures["onprogress"] = closure - jsObject.onprogress = closure.jsValue() - } else { - jsObject.onprogress = .null - } - } - } - - var onratechange: EventHandler { - get { - guard let function = jsObject.onratechange.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onratechange"] { - oldClosure.release() - } - eventHandlerClosures["onratechange"] = closure - jsObject.onratechange = closure.jsValue() - } else { - jsObject.onratechange = .null - } - } - } - - var onreset: EventHandler { - get { - guard let function = jsObject.onreset.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onreset"] { - oldClosure.release() - } - eventHandlerClosures["onreset"] = closure - jsObject.onreset = closure.jsValue() - } else { - jsObject.onreset = .null - } - } - } - - var onresize: EventHandler { - get { - guard let function = jsObject.onresize.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onresize"] { - oldClosure.release() - } - eventHandlerClosures["onresize"] = closure - jsObject.onresize = closure.jsValue() - } else { - jsObject.onresize = .null - } - } - } - - var onscroll: EventHandler { - get { - guard let function = jsObject.onscroll.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onscroll"] { - oldClosure.release() - } - eventHandlerClosures["onscroll"] = closure - jsObject.onscroll = closure.jsValue() - } else { - jsObject.onscroll = .null - } - } - } - - var onsecuritypolicyviolation: EventHandler { - get { - guard let function = jsObject.onsecuritypolicyviolation.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onsecuritypolicyviolation"] { - oldClosure.release() - } - eventHandlerClosures["onsecuritypolicyviolation"] = closure - jsObject.onsecuritypolicyviolation = closure.jsValue() - } else { - jsObject.onsecuritypolicyviolation = .null - } - } - } - - var onseeked: EventHandler { - get { - guard let function = jsObject.onseeked.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onseeked"] { - oldClosure.release() - } - eventHandlerClosures["onseeked"] = closure - jsObject.onseeked = closure.jsValue() - } else { - jsObject.onseeked = .null - } - } - } - - var onseeking: EventHandler { - get { - guard let function = jsObject.onseeking.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onseeking"] { - oldClosure.release() - } - eventHandlerClosures["onseeking"] = closure - jsObject.onseeking = closure.jsValue() - } else { - jsObject.onseeking = .null - } - } - } - - var onselect: EventHandler { - get { - guard let function = jsObject.onselect.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onselect"] { - oldClosure.release() - } - eventHandlerClosures["onselect"] = closure - jsObject.onselect = closure.jsValue() - } else { - jsObject.onselect = .null - } - } - } - - var onslotchange: EventHandler { - get { - guard let function = jsObject.onslotchange.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onslotchange"] { - oldClosure.release() - } - eventHandlerClosures["onslotchange"] = closure - jsObject.onslotchange = closure.jsValue() - } else { - jsObject.onslotchange = .null - } - } - } - - var onstalled: EventHandler { - get { - guard let function = jsObject.onstalled.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onstalled"] { - oldClosure.release() - } - eventHandlerClosures["onstalled"] = closure - jsObject.onstalled = closure.jsValue() - } else { - jsObject.onstalled = .null - } - } - } - - var onsubmit: EventHandler { - get { - guard let function = jsObject.onsubmit.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onsubmit"] { - oldClosure.release() - } - eventHandlerClosures["onsubmit"] = closure - jsObject.onsubmit = closure.jsValue() - } else { - jsObject.onsubmit = .null - } - } - } - - var onsuspend: EventHandler { - get { - guard let function = jsObject.onsuspend.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onsuspend"] { - oldClosure.release() - } - eventHandlerClosures["onsuspend"] = closure - jsObject.onsuspend = closure.jsValue() - } else { - jsObject.onsuspend = .null - } - } - } - - var ontimeupdate: EventHandler { - get { - guard let function = jsObject.ontimeupdate.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ontimeupdate"] { - oldClosure.release() - } - eventHandlerClosures["ontimeupdate"] = closure - jsObject.ontimeupdate = closure.jsValue() - } else { - jsObject.ontimeupdate = .null - } - } - } - - var ontoggle: EventHandler { - get { - guard let function = jsObject.ontoggle.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["ontoggle"] { - oldClosure.release() - } - eventHandlerClosures["ontoggle"] = closure - jsObject.ontoggle = closure.jsValue() - } else { - jsObject.ontoggle = .null - } - } - } - - var onvolumechange: EventHandler { - get { - guard let function = jsObject.onvolumechange.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onvolumechange"] { - oldClosure.release() - } - eventHandlerClosures["onvolumechange"] = closure - jsObject.onvolumechange = closure.jsValue() - } else { - jsObject.onvolumechange = .null - } - } - } - - var onwaiting: EventHandler { - get { - guard let function = jsObject.onwaiting.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onwaiting"] { - oldClosure.release() - } - eventHandlerClosures["onwaiting"] = closure - jsObject.onwaiting = closure.jsValue() - } else { - jsObject.onwaiting = .null - } - } - } - - var onwebkitanimationend: EventHandler { - get { - guard let function = jsObject.onwebkitanimationend.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onwebkitanimationend"] { - oldClosure.release() - } - eventHandlerClosures["onwebkitanimationend"] = closure - jsObject.onwebkitanimationend = closure.jsValue() - } else { - jsObject.onwebkitanimationend = .null - } - } - } - - var onwebkitanimationiteration: EventHandler { - get { - guard let function = jsObject.onwebkitanimationiteration.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onwebkitanimationiteration"] { - oldClosure.release() - } - eventHandlerClosures["onwebkitanimationiteration"] = closure - jsObject.onwebkitanimationiteration = closure.jsValue() - } else { - jsObject.onwebkitanimationiteration = .null - } - } - } - - var onwebkitanimationstart: EventHandler { - get { - guard let function = jsObject.onwebkitanimationstart.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onwebkitanimationstart"] { - oldClosure.release() - } - eventHandlerClosures["onwebkitanimationstart"] = closure - jsObject.onwebkitanimationstart = closure.jsValue() - } else { - jsObject.onwebkitanimationstart = .null - } - } - } - - var onwebkittransitionend: EventHandler { - get { - guard let function = jsObject.onwebkittransitionend.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onwebkittransitionend"] { - oldClosure.release() - } - eventHandlerClosures["onwebkittransitionend"] = closure - jsObject.onwebkittransitionend = closure.jsValue() - } else { - jsObject.onwebkittransitionend = .null - } - } - } - - var onwheel: EventHandler { - get { - guard let function = jsObject.onwheel.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - let closure = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - } - if let oldClosure = eventHandlerClosures["onwheel"] { - oldClosure.release() - } - eventHandlerClosures["onwheel"] = closure - jsObject.onwheel = closure.jsValue() - } else { - jsObject.onwheel = .null - } - } - } -} diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index da6d96b9..d40f7288 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -1,32 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit -public class HTMLElement: Element, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement { +public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement, ElementCSSInlineStyle { override public class var constructor: JSFunction { JSObject.global.HTMLElement.function! } - var eventHandlerClosures = [String: JSClosure]() - public required init(unsafelyWrapping jsObject: JSObject) { _title = ReadWriteAttribute(jsObject: jsObject, name: "title") _lang = ReadWriteAttribute(jsObject: jsObject, name: "lang") _translate = ReadWriteAttribute(jsObject: jsObject, name: "translate") _dir = ReadWriteAttribute(jsObject: jsObject, name: "dir") _hidden = ReadWriteAttribute(jsObject: jsObject, name: "hidden") + _inert = ReadWriteAttribute(jsObject: jsObject, name: "inert") _accessKey = ReadWriteAttribute(jsObject: jsObject, name: "accessKey") _accessKeyLabel = ReadonlyAttribute(jsObject: jsObject, name: "accessKeyLabel") _draggable = ReadWriteAttribute(jsObject: jsObject, name: "draggable") _spellcheck = ReadWriteAttribute(jsObject: jsObject, name: "spellcheck") _autocapitalize = ReadWriteAttribute(jsObject: jsObject, name: "autocapitalize") _innerText = ReadWriteAttribute(jsObject: jsObject, name: "innerText") + _outerText = ReadWriteAttribute(jsObject: jsObject, name: "outerText") super.init(unsafelyWrapping: jsObject) } public convenience init() { - self.init(unsafelyWrapping: HTMLElement.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } @ReadWriteAttribute @@ -44,8 +42,11 @@ public class HTMLElement: Element, DocumentAndElementEventHandlers, ElementConte @ReadWriteAttribute public var hidden: Bool + @ReadWriteAttribute + public var inert: Bool + public func click() { - _ = jsObject.click!() + _ = jsObject["click"]!() } @ReadWriteAttribute @@ -66,13 +67,10 @@ public class HTMLElement: Element, DocumentAndElementEventHandlers, ElementConte @ReadWriteAttribute public var innerText: String - public func attachInternals() -> ElementInternals { - return jsObject.attachInternals!().fromJSValue()! - } + @ReadWriteAttribute + public var outerText: String - deinit { - for (_, closure) in eventHandlerClosures { - closure.release() - } + public func attachInternals() -> ElementInternals { + jsObject["attachInternals"]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift new file mode 100644 index 00000000..a09fe3ed --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLEmbedElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLEmbedElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _src = ReadWriteAttribute(jsObject: jsObject, name: "src") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var width: String + + @ReadWriteAttribute + public var height: String + + public func getSVGDocument() -> Document? { + jsObject["getSVGDocument"]!().fromJSValue()! + } + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift new file mode 100644 index 00000000..1d2aa088 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLFieldSetElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLFieldSetElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _elements = ReadonlyAttribute(jsObject: jsObject, name: "elements") + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") + _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var disabled: Bool + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var name: String + + @ReadonlyAttribute + public var type: String + + @ReadonlyAttribute + public var elements: HTMLCollection + + @ReadonlyAttribute + public var willValidate: Bool + + @ReadonlyAttribute + public var validity: ValidityState + + @ReadonlyAttribute + public var validationMessage: String + + public func checkValidity() -> Bool { + jsObject["checkValidity"]!().fromJSValue()! + } + + public func reportValidity() -> Bool { + jsObject["reportValidity"]!().fromJSValue()! + } + + public func setCustomValidity(error: String) { + _ = jsObject["setCustomValidity"]!(error.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLFontElement.swift b/Sources/DOMKit/WebIDL/HTMLFontElement.swift new file mode 100644 index 00000000..03c6751a --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLFontElement.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLFontElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLFontElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _color = ReadWriteAttribute(jsObject: jsObject, name: "color") + _face = ReadWriteAttribute(jsObject: jsObject, name: "face") + _size = ReadWriteAttribute(jsObject: jsObject, name: "size") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var color: String + + @ReadWriteAttribute + public var face: String + + @ReadWriteAttribute + public var size: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift index 8b323e5e..c8dbc8e2 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class HTMLFormControlsCollection: HTMLCollection { @@ -12,7 +10,7 @@ public class HTMLFormControlsCollection: HTMLCollection { super.init(unsafelyWrapping: jsObject) } - public subscript(_: String) -> RadioNodeListOrElement?? { - return jsObject.name.fromJSValue()! + public subscript(key: String) -> __UNSUPPORTED_UNION__? { + jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index e1544505..e83af8d5 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class HTMLFormElement: HTMLElement { @@ -25,12 +23,8 @@ public class HTMLFormElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public subscript(_: String) -> RadioNodeListOrElement? { - return jsObject.name.fromJSValue()! - } - public convenience init() { - self.init(unsafelyWrapping: HTMLFormElement.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } @ReadWriteAttribute @@ -72,23 +66,31 @@ public class HTMLFormElement: HTMLElement { @ReadonlyAttribute public var length: UInt32 + public subscript(key: Int) -> Element { + jsObject[key].fromJSValue()! + } + + public subscript(key: String) -> __UNSUPPORTED_UNION__ { + jsObject[key].fromJSValue()! + } + public func submit() { - _ = jsObject.submit!() + _ = jsObject["submit"]!() } public func requestSubmit(submitter: HTMLElement? = nil) { - _ = jsObject.requestSubmit!(submitter.jsValue()) + _ = jsObject["requestSubmit"]!(submitter?.jsValue() ?? .undefined) } public func reset() { - _ = jsObject.reset!() + _ = jsObject["reset"]!() } public func checkValidity() -> Bool { - return jsObject.checkValidity!().fromJSValue()! + jsObject["checkValidity"]!().fromJSValue()! } public func reportValidity() -> Bool { - return jsObject.reportValidity!().fromJSValue()! + jsObject["reportValidity"]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift new file mode 100644 index 00000000..8c6000c0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLFrameElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLFrameElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _scrolling = ReadWriteAttribute(jsObject: jsObject, name: "scrolling") + _src = ReadWriteAttribute(jsObject: jsObject, name: "src") + _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: "frameBorder") + _longDesc = ReadWriteAttribute(jsObject: jsObject, name: "longDesc") + _noResize = ReadWriteAttribute(jsObject: jsObject, name: "noResize") + _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: "contentDocument") + _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: "contentWindow") + _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: "marginHeight") + _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: "marginWidth") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var scrolling: String + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var frameBorder: String + + @ReadWriteAttribute + public var longDesc: String + + @ReadWriteAttribute + public var noResize: Bool + + @ReadonlyAttribute + public var contentDocument: Document? + + @ReadonlyAttribute + public var contentWindow: WindowProxy? + + @ReadWriteAttribute + public var marginHeight: String + + @ReadWriteAttribute + public var marginWidth: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift new file mode 100644 index 00000000..7037f616 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLFrameSetElement: HTMLElement, WindowEventHandlers { + override public class var constructor: JSFunction { JSObject.global.HTMLFrameSetElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _cols = ReadWriteAttribute(jsObject: jsObject, name: "cols") + _rows = ReadWriteAttribute(jsObject: jsObject, name: "rows") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var cols: String + + @ReadWriteAttribute + public var rows: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLHRElement.swift b/Sources/DOMKit/WebIDL/HTMLHRElement.swift new file mode 100644 index 00000000..24d6e70b --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLHRElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLHRElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLHRElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _color = ReadWriteAttribute(jsObject: jsObject, name: "color") + _noShade = ReadWriteAttribute(jsObject: jsObject, name: "noShade") + _size = ReadWriteAttribute(jsObject: jsObject, name: "size") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var color: String + + @ReadWriteAttribute + public var noShade: Bool + + @ReadWriteAttribute + public var size: String + + @ReadWriteAttribute + public var width: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift new file mode 100644 index 00000000..16c56abd --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLHeadElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLHeadElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift new file mode 100644 index 00000000..1f4dce00 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLHeadingElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLHeadingElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var align: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift new file mode 100644 index 00000000..64dc4cb6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLHtmlElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLHtmlElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _version = ReadWriteAttribute(jsObject: jsObject, name: "version") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var version: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift new file mode 100644 index 00000000..607250ba --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift @@ -0,0 +1,59 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol HTMLHyperlinkElementUtils: JSBridgedClass {} +public extension HTMLHyperlinkElementUtils { + var href: String { + get { ReadWriteAttribute["href", in: jsObject] } + set { ReadWriteAttribute["href", in: jsObject] = newValue } + } + + var origin: String { ReadonlyAttribute["origin", in: jsObject] } + + var `protocol`: String { + get { ReadWriteAttribute["protocol", in: jsObject] } + set { ReadWriteAttribute["protocol", in: jsObject] = newValue } + } + + var username: String { + get { ReadWriteAttribute["username", in: jsObject] } + set { ReadWriteAttribute["username", in: jsObject] = newValue } + } + + var password: String { + get { ReadWriteAttribute["password", in: jsObject] } + set { ReadWriteAttribute["password", in: jsObject] = newValue } + } + + var host: String { + get { ReadWriteAttribute["host", in: jsObject] } + set { ReadWriteAttribute["host", in: jsObject] = newValue } + } + + var hostname: String { + get { ReadWriteAttribute["hostname", in: jsObject] } + set { ReadWriteAttribute["hostname", in: jsObject] = newValue } + } + + var port: String { + get { ReadWriteAttribute["port", in: jsObject] } + set { ReadWriteAttribute["port", in: jsObject] = newValue } + } + + var pathname: String { + get { ReadWriteAttribute["pathname", in: jsObject] } + set { ReadWriteAttribute["pathname", in: jsObject] = newValue } + } + + var search: String { + get { ReadWriteAttribute["search", in: jsObject] } + set { ReadWriteAttribute["search", in: jsObject] = newValue } + } + + var hash: String { + get { ReadWriteAttribute["hash", in: jsObject] } + set { ReadWriteAttribute["hash", in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift new file mode 100644 index 00000000..3eee22c5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -0,0 +1,92 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLIFrameElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLIFrameElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _src = ReadWriteAttribute(jsObject: jsObject, name: "src") + _srcdoc = ReadWriteAttribute(jsObject: jsObject, name: "srcdoc") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _sandbox = ReadonlyAttribute(jsObject: jsObject, name: "sandbox") + _allow = ReadWriteAttribute(jsObject: jsObject, name: "allow") + _allowFullscreen = ReadWriteAttribute(jsObject: jsObject, name: "allowFullscreen") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") + _loading = ReadWriteAttribute(jsObject: jsObject, name: "loading") + _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: "contentDocument") + _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: "contentWindow") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _scrolling = ReadWriteAttribute(jsObject: jsObject, name: "scrolling") + _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: "frameBorder") + _longDesc = ReadWriteAttribute(jsObject: jsObject, name: "longDesc") + _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: "marginHeight") + _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: "marginWidth") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var srcdoc: String + + @ReadWriteAttribute + public var name: String + + @ReadonlyAttribute + public var sandbox: DOMTokenList + + @ReadWriteAttribute + public var allow: String + + @ReadWriteAttribute + public var allowFullscreen: Bool + + @ReadWriteAttribute + public var width: String + + @ReadWriteAttribute + public var height: String + + @ReadWriteAttribute + public var referrerPolicy: String + + @ReadWriteAttribute + public var loading: String + + @ReadonlyAttribute + public var contentDocument: Document? + + @ReadonlyAttribute + public var contentWindow: WindowProxy? + + public func getSVGDocument() -> Document? { + jsObject["getSVGDocument"]!().fromJSValue()! + } + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var scrolling: String + + @ReadWriteAttribute + public var frameBorder: String + + @ReadWriteAttribute + public var longDesc: String + + @ReadWriteAttribute + public var marginHeight: String + + @ReadWriteAttribute + public var marginWidth: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift new file mode 100644 index 00000000..03ffdc25 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -0,0 +1,118 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLImageElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLImageElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _alt = ReadWriteAttribute(jsObject: jsObject, name: "alt") + _src = ReadWriteAttribute(jsObject: jsObject, name: "src") + _srcset = ReadWriteAttribute(jsObject: jsObject, name: "srcset") + _sizes = ReadWriteAttribute(jsObject: jsObject, name: "sizes") + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: "crossOrigin") + _useMap = ReadWriteAttribute(jsObject: jsObject, name: "useMap") + _isMap = ReadWriteAttribute(jsObject: jsObject, name: "isMap") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _naturalWidth = ReadonlyAttribute(jsObject: jsObject, name: "naturalWidth") + _naturalHeight = ReadonlyAttribute(jsObject: jsObject, name: "naturalHeight") + _complete = ReadonlyAttribute(jsObject: jsObject, name: "complete") + _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: "currentSrc") + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") + _decoding = ReadWriteAttribute(jsObject: jsObject, name: "decoding") + _loading = ReadWriteAttribute(jsObject: jsObject, name: "loading") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _lowsrc = ReadWriteAttribute(jsObject: jsObject, name: "lowsrc") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _hspace = ReadWriteAttribute(jsObject: jsObject, name: "hspace") + _vspace = ReadWriteAttribute(jsObject: jsObject, name: "vspace") + _longDesc = ReadWriteAttribute(jsObject: jsObject, name: "longDesc") + _border = ReadWriteAttribute(jsObject: jsObject, name: "border") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var alt: String + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var srcset: String + + @ReadWriteAttribute + public var sizes: String + + @ReadWriteAttribute + public var crossOrigin: String? + + @ReadWriteAttribute + public var useMap: String + + @ReadWriteAttribute + public var isMap: Bool + + @ReadWriteAttribute + public var width: UInt32 + + @ReadWriteAttribute + public var height: UInt32 + + @ReadonlyAttribute + public var naturalWidth: UInt32 + + @ReadonlyAttribute + public var naturalHeight: UInt32 + + @ReadonlyAttribute + public var complete: Bool + + @ReadonlyAttribute + public var currentSrc: String + + @ReadWriteAttribute + public var referrerPolicy: String + + @ReadWriteAttribute + public var decoding: String + + @ReadWriteAttribute + public var loading: String + + public func decode() -> JSPromise { + jsObject["decode"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func decode() async throws { + let _promise: JSPromise = jsObject["decode"]!().fromJSValue()! + _ = try await _promise.get() + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var lowsrc: String + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var hspace: UInt32 + + @ReadWriteAttribute + public var vspace: UInt32 + + @ReadWriteAttribute + public var longDesc: String + + @ReadWriteAttribute + public var border: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift new file mode 100644 index 00000000..8a0f666c --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -0,0 +1,236 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLInputElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLInputElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _accept = ReadWriteAttribute(jsObject: jsObject, name: "accept") + _alt = ReadWriteAttribute(jsObject: jsObject, name: "alt") + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: "autocomplete") + _defaultChecked = ReadWriteAttribute(jsObject: jsObject, name: "defaultChecked") + _checked = ReadWriteAttribute(jsObject: jsObject, name: "checked") + _dirName = ReadWriteAttribute(jsObject: jsObject, name: "dirName") + _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _files = ReadWriteAttribute(jsObject: jsObject, name: "files") + _formAction = ReadWriteAttribute(jsObject: jsObject, name: "formAction") + _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: "formEnctype") + _formMethod = ReadWriteAttribute(jsObject: jsObject, name: "formMethod") + _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: "formNoValidate") + _formTarget = ReadWriteAttribute(jsObject: jsObject, name: "formTarget") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _indeterminate = ReadWriteAttribute(jsObject: jsObject, name: "indeterminate") + _list = ReadonlyAttribute(jsObject: jsObject, name: "list") + _max = ReadWriteAttribute(jsObject: jsObject, name: "max") + _maxLength = ReadWriteAttribute(jsObject: jsObject, name: "maxLength") + _min = ReadWriteAttribute(jsObject: jsObject, name: "min") + _minLength = ReadWriteAttribute(jsObject: jsObject, name: "minLength") + _multiple = ReadWriteAttribute(jsObject: jsObject, name: "multiple") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _pattern = ReadWriteAttribute(jsObject: jsObject, name: "pattern") + _placeholder = ReadWriteAttribute(jsObject: jsObject, name: "placeholder") + _readOnly = ReadWriteAttribute(jsObject: jsObject, name: "readOnly") + _required = ReadWriteAttribute(jsObject: jsObject, name: "required") + _size = ReadWriteAttribute(jsObject: jsObject, name: "size") + _src = ReadWriteAttribute(jsObject: jsObject, name: "src") + _step = ReadWriteAttribute(jsObject: jsObject, name: "step") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: "defaultValue") + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _valueAsDate = ReadWriteAttribute(jsObject: jsObject, name: "valueAsDate") + _valueAsNumber = ReadWriteAttribute(jsObject: jsObject, name: "valueAsNumber") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") + _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") + _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: "selectionStart") + _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: "selectionEnd") + _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: "selectionDirection") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _useMap = ReadWriteAttribute(jsObject: jsObject, name: "useMap") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var accept: String + + @ReadWriteAttribute + public var alt: String + + @ReadWriteAttribute + public var autocomplete: String + + @ReadWriteAttribute + public var defaultChecked: Bool + + @ReadWriteAttribute + public var checked: Bool + + @ReadWriteAttribute + public var dirName: String + + @ReadWriteAttribute + public var disabled: Bool + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var files: FileList? + + @ReadWriteAttribute + public var formAction: String + + @ReadWriteAttribute + public var formEnctype: String + + @ReadWriteAttribute + public var formMethod: String + + @ReadWriteAttribute + public var formNoValidate: Bool + + @ReadWriteAttribute + public var formTarget: String + + @ReadWriteAttribute + public var height: UInt32 + + @ReadWriteAttribute + public var indeterminate: Bool + + @ReadonlyAttribute + public var list: HTMLElement? + + @ReadWriteAttribute + public var max: String + + @ReadWriteAttribute + public var maxLength: Int32 + + @ReadWriteAttribute + public var min: String + + @ReadWriteAttribute + public var minLength: Int32 + + @ReadWriteAttribute + public var multiple: Bool + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var pattern: String + + @ReadWriteAttribute + public var placeholder: String + + @ReadWriteAttribute + public var readOnly: Bool + + @ReadWriteAttribute + public var required: Bool + + @ReadWriteAttribute + public var size: UInt32 + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var step: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var defaultValue: String + + @ReadWriteAttribute + public var value: String + + @ReadWriteAttribute + public var valueAsDate: JSObject? + + @ReadWriteAttribute + public var valueAsNumber: Double + + @ReadWriteAttribute + public var width: UInt32 + + public func stepUp(n: Int32? = nil) { + _ = jsObject["stepUp"]!(n?.jsValue() ?? .undefined) + } + + public func stepDown(n: Int32? = nil) { + _ = jsObject["stepDown"]!(n?.jsValue() ?? .undefined) + } + + @ReadonlyAttribute + public var willValidate: Bool + + @ReadonlyAttribute + public var validity: ValidityState + + @ReadonlyAttribute + public var validationMessage: String + + public func checkValidity() -> Bool { + jsObject["checkValidity"]!().fromJSValue()! + } + + public func reportValidity() -> Bool { + jsObject["reportValidity"]!().fromJSValue()! + } + + public func setCustomValidity(error: String) { + _ = jsObject["setCustomValidity"]!(error.jsValue()) + } + + @ReadonlyAttribute + public var labels: NodeList? + + public func select() { + _ = jsObject["select"]!() + } + + @ReadWriteAttribute + public var selectionStart: UInt32? + + @ReadWriteAttribute + public var selectionEnd: UInt32? + + @ReadWriteAttribute + public var selectionDirection: String? + + public func setRangeText(replacement: String) { + _ = jsObject["setRangeText"]!(replacement.jsValue()) + } + + public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { + _ = jsObject["setRangeText"]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + } + + public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { + _ = jsObject["setSelectionRange"]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + } + + public func showPicker() { + _ = jsObject["showPicker"]!() + } + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var useMap: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLLIElement.swift b/Sources/DOMKit/WebIDL/HTMLLIElement.swift new file mode 100644 index 00000000..52ee330f --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLLIElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLLIElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLLIElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var value: Int32 + + @ReadWriteAttribute + public var type: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift new file mode 100644 index 00000000..3ade7c41 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLLabelElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLLabelElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: "htmlFor") + _control = ReadonlyAttribute(jsObject: jsObject, name: "control") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var htmlFor: String + + @ReadonlyAttribute + public var control: HTMLElement? +} diff --git a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift new file mode 100644 index 00000000..676b84ed --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLLegendElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLLegendElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var align: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift new file mode 100644 index 00000000..0c13380c --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift @@ -0,0 +1,88 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLLinkElement: HTMLElement, LinkStyle { + override public class var constructor: JSFunction { JSObject.global.HTMLLinkElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _href = ReadWriteAttribute(jsObject: jsObject, name: "href") + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: "crossOrigin") + _rel = ReadWriteAttribute(jsObject: jsObject, name: "rel") + _as = ReadWriteAttribute(jsObject: jsObject, name: "as") + _relList = ReadonlyAttribute(jsObject: jsObject, name: "relList") + _media = ReadWriteAttribute(jsObject: jsObject, name: "media") + _integrity = ReadWriteAttribute(jsObject: jsObject, name: "integrity") + _hreflang = ReadWriteAttribute(jsObject: jsObject, name: "hreflang") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _sizes = ReadonlyAttribute(jsObject: jsObject, name: "sizes") + _imageSrcset = ReadWriteAttribute(jsObject: jsObject, name: "imageSrcset") + _imageSizes = ReadWriteAttribute(jsObject: jsObject, name: "imageSizes") + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") + _blocking = ReadonlyAttribute(jsObject: jsObject, name: "blocking") + _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + _charset = ReadWriteAttribute(jsObject: jsObject, name: "charset") + _rev = ReadWriteAttribute(jsObject: jsObject, name: "rev") + _target = ReadWriteAttribute(jsObject: jsObject, name: "target") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var href: String + + @ReadWriteAttribute + public var crossOrigin: String? + + @ReadWriteAttribute + public var rel: String + + @ReadWriteAttribute + public var `as`: String + + @ReadonlyAttribute + public var relList: DOMTokenList + + @ReadWriteAttribute + public var media: String + + @ReadWriteAttribute + public var integrity: String + + @ReadWriteAttribute + public var hreflang: String + + @ReadWriteAttribute + public var type: String + + @ReadonlyAttribute + public var sizes: DOMTokenList + + @ReadWriteAttribute + public var imageSrcset: String + + @ReadWriteAttribute + public var imageSizes: String + + @ReadWriteAttribute + public var referrerPolicy: String + + @ReadonlyAttribute + public var blocking: DOMTokenList + + @ReadWriteAttribute + public var disabled: Bool + + @ReadWriteAttribute + public var charset: String + + @ReadWriteAttribute + public var rev: String + + @ReadWriteAttribute + public var target: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLMapElement.swift b/Sources/DOMKit/WebIDL/HTMLMapElement.swift new file mode 100644 index 00000000..90a13273 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLMapElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLMapElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLMapElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _areas = ReadonlyAttribute(jsObject: jsObject, name: "areas") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var name: String + + @ReadonlyAttribute + public var areas: HTMLCollection +} diff --git a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift new file mode 100644 index 00000000..3f050653 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift @@ -0,0 +1,68 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLMarqueeElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLMarqueeElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _behavior = ReadWriteAttribute(jsObject: jsObject, name: "behavior") + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") + _direction = ReadWriteAttribute(jsObject: jsObject, name: "direction") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _hspace = ReadWriteAttribute(jsObject: jsObject, name: "hspace") + _loop = ReadWriteAttribute(jsObject: jsObject, name: "loop") + _scrollAmount = ReadWriteAttribute(jsObject: jsObject, name: "scrollAmount") + _scrollDelay = ReadWriteAttribute(jsObject: jsObject, name: "scrollDelay") + _trueSpeed = ReadWriteAttribute(jsObject: jsObject, name: "trueSpeed") + _vspace = ReadWriteAttribute(jsObject: jsObject, name: "vspace") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var behavior: String + + @ReadWriteAttribute + public var bgColor: String + + @ReadWriteAttribute + public var direction: String + + @ReadWriteAttribute + public var height: String + + @ReadWriteAttribute + public var hspace: UInt32 + + @ReadWriteAttribute + public var loop: Int32 + + @ReadWriteAttribute + public var scrollAmount: UInt32 + + @ReadWriteAttribute + public var scrollDelay: UInt32 + + @ReadWriteAttribute + public var trueSpeed: Bool + + @ReadWriteAttribute + public var vspace: UInt32 + + @ReadWriteAttribute + public var width: String + + public func start() { + _ = jsObject["start"]!() + } + + public func stop() { + _ = jsObject["stop"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift new file mode 100644 index 00000000..d0da3e59 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -0,0 +1,176 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLMediaElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLMediaElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _error = ReadonlyAttribute(jsObject: jsObject, name: "error") + _src = ReadWriteAttribute(jsObject: jsObject, name: "src") + _srcObject = ReadWriteAttribute(jsObject: jsObject, name: "srcObject") + _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: "currentSrc") + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: "crossOrigin") + _networkState = ReadonlyAttribute(jsObject: jsObject, name: "networkState") + _preload = ReadWriteAttribute(jsObject: jsObject, name: "preload") + _buffered = ReadonlyAttribute(jsObject: jsObject, name: "buffered") + _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") + _seeking = ReadonlyAttribute(jsObject: jsObject, name: "seeking") + _currentTime = ReadWriteAttribute(jsObject: jsObject, name: "currentTime") + _duration = ReadonlyAttribute(jsObject: jsObject, name: "duration") + _paused = ReadonlyAttribute(jsObject: jsObject, name: "paused") + _defaultPlaybackRate = ReadWriteAttribute(jsObject: jsObject, name: "defaultPlaybackRate") + _playbackRate = ReadWriteAttribute(jsObject: jsObject, name: "playbackRate") + _preservesPitch = ReadWriteAttribute(jsObject: jsObject, name: "preservesPitch") + _played = ReadonlyAttribute(jsObject: jsObject, name: "played") + _seekable = ReadonlyAttribute(jsObject: jsObject, name: "seekable") + _ended = ReadonlyAttribute(jsObject: jsObject, name: "ended") + _autoplay = ReadWriteAttribute(jsObject: jsObject, name: "autoplay") + _loop = ReadWriteAttribute(jsObject: jsObject, name: "loop") + _controls = ReadWriteAttribute(jsObject: jsObject, name: "controls") + _volume = ReadWriteAttribute(jsObject: jsObject, name: "volume") + _muted = ReadWriteAttribute(jsObject: jsObject, name: "muted") + _defaultMuted = ReadWriteAttribute(jsObject: jsObject, name: "defaultMuted") + _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: "audioTracks") + _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: "videoTracks") + _textTracks = ReadonlyAttribute(jsObject: jsObject, name: "textTracks") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var error: MediaError? + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var srcObject: MediaProvider? + + @ReadonlyAttribute + public var currentSrc: String + + @ReadWriteAttribute + public var crossOrigin: String? + + public static let NETWORK_EMPTY: UInt16 = 0 + + public static let NETWORK_IDLE: UInt16 = 1 + + public static let NETWORK_LOADING: UInt16 = 2 + + public static let NETWORK_NO_SOURCE: UInt16 = 3 + + @ReadonlyAttribute + public var networkState: UInt16 + + @ReadWriteAttribute + public var preload: String + + @ReadonlyAttribute + public var buffered: TimeRanges + + public func load() { + _ = jsObject["load"]!() + } + + public func canPlayType(type: String) -> CanPlayTypeResult { + jsObject["canPlayType"]!(type.jsValue()).fromJSValue()! + } + + public static let HAVE_NOTHING: UInt16 = 0 + + public static let HAVE_METADATA: UInt16 = 1 + + public static let HAVE_CURRENT_DATA: UInt16 = 2 + + public static let HAVE_FUTURE_DATA: UInt16 = 3 + + public static let HAVE_ENOUGH_DATA: UInt16 = 4 + + @ReadonlyAttribute + public var readyState: UInt16 + + @ReadonlyAttribute + public var seeking: Bool + + @ReadWriteAttribute + public var currentTime: Double + + public func fastSeek(time: Double) { + _ = jsObject["fastSeek"]!(time.jsValue()) + } + + @ReadonlyAttribute + public var duration: Double + + public func getStartDate() -> JSObject { + jsObject["getStartDate"]!().fromJSValue()! + } + + @ReadonlyAttribute + public var paused: Bool + + @ReadWriteAttribute + public var defaultPlaybackRate: Double + + @ReadWriteAttribute + public var playbackRate: Double + + @ReadWriteAttribute + public var preservesPitch: Bool + + @ReadonlyAttribute + public var played: TimeRanges + + @ReadonlyAttribute + public var seekable: TimeRanges + + @ReadonlyAttribute + public var ended: Bool + + @ReadWriteAttribute + public var autoplay: Bool + + @ReadWriteAttribute + public var loop: Bool + + public func play() -> JSPromise { + jsObject["play"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func play() async throws { + let _promise: JSPromise = jsObject["play"]!().fromJSValue()! + _ = try await _promise.get() + } + + public func pause() { + _ = jsObject["pause"]!() + } + + @ReadWriteAttribute + public var controls: Bool + + @ReadWriteAttribute + public var volume: Double + + @ReadWriteAttribute + public var muted: Bool + + @ReadWriteAttribute + public var defaultMuted: Bool + + @ReadonlyAttribute + public var audioTracks: AudioTrackList + + @ReadonlyAttribute + public var videoTracks: VideoTrackList + + @ReadonlyAttribute + public var textTracks: TextTrackList + + public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { + jsObject["addTextTrack"]!(kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift new file mode 100644 index 00000000..40e3c1f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLMenuElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLMenuElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var compact: Bool +} diff --git a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift new file mode 100644 index 00000000..517c5dfb --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLMetaElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLMetaElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _httpEquiv = ReadWriteAttribute(jsObject: jsObject, name: "httpEquiv") + _content = ReadWriteAttribute(jsObject: jsObject, name: "content") + _media = ReadWriteAttribute(jsObject: jsObject, name: "media") + _scheme = ReadWriteAttribute(jsObject: jsObject, name: "scheme") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var httpEquiv: String + + @ReadWriteAttribute + public var content: String + + @ReadWriteAttribute + public var media: String + + @ReadWriteAttribute + public var scheme: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift new file mode 100644 index 00000000..f7867bd5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLMeterElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLMeterElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _min = ReadWriteAttribute(jsObject: jsObject, name: "min") + _max = ReadWriteAttribute(jsObject: jsObject, name: "max") + _low = ReadWriteAttribute(jsObject: jsObject, name: "low") + _high = ReadWriteAttribute(jsObject: jsObject, name: "high") + _optimum = ReadWriteAttribute(jsObject: jsObject, name: "optimum") + _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var value: Double + + @ReadWriteAttribute + public var min: Double + + @ReadWriteAttribute + public var max: Double + + @ReadWriteAttribute + public var low: Double + + @ReadWriteAttribute + public var high: Double + + @ReadWriteAttribute + public var optimum: Double + + @ReadonlyAttribute + public var labels: NodeList +} diff --git a/Sources/DOMKit/WebIDL/HTMLModElement.swift b/Sources/DOMKit/WebIDL/HTMLModElement.swift new file mode 100644 index 00000000..35d49220 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLModElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLModElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLModElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _cite = ReadWriteAttribute(jsObject: jsObject, name: "cite") + _dateTime = ReadWriteAttribute(jsObject: jsObject, name: "dateTime") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var cite: String + + @ReadWriteAttribute + public var dateTime: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLOListElement.swift b/Sources/DOMKit/WebIDL/HTMLOListElement.swift new file mode 100644 index 00000000..a8cc81ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLOListElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLOListElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLOListElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _reversed = ReadWriteAttribute(jsObject: jsObject, name: "reversed") + _start = ReadWriteAttribute(jsObject: jsObject, name: "start") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var reversed: Bool + + @ReadWriteAttribute + public var start: Int32 + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var compact: Bool +} diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift new file mode 100644 index 00000000..4fb88174 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -0,0 +1,120 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLObjectElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLObjectElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadWriteAttribute(jsObject: jsObject, name: "data") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: "contentDocument") + _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: "contentWindow") + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") + _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _archive = ReadWriteAttribute(jsObject: jsObject, name: "archive") + _code = ReadWriteAttribute(jsObject: jsObject, name: "code") + _declare = ReadWriteAttribute(jsObject: jsObject, name: "declare") + _hspace = ReadWriteAttribute(jsObject: jsObject, name: "hspace") + _standby = ReadWriteAttribute(jsObject: jsObject, name: "standby") + _vspace = ReadWriteAttribute(jsObject: jsObject, name: "vspace") + _codeBase = ReadWriteAttribute(jsObject: jsObject, name: "codeBase") + _codeType = ReadWriteAttribute(jsObject: jsObject, name: "codeType") + _useMap = ReadWriteAttribute(jsObject: jsObject, name: "useMap") + _border = ReadWriteAttribute(jsObject: jsObject, name: "border") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var data: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var name: String + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var width: String + + @ReadWriteAttribute + public var height: String + + @ReadonlyAttribute + public var contentDocument: Document? + + @ReadonlyAttribute + public var contentWindow: WindowProxy? + + public func getSVGDocument() -> Document? { + jsObject["getSVGDocument"]!().fromJSValue()! + } + + @ReadonlyAttribute + public var willValidate: Bool + + @ReadonlyAttribute + public var validity: ValidityState + + @ReadonlyAttribute + public var validationMessage: String + + public func checkValidity() -> Bool { + jsObject["checkValidity"]!().fromJSValue()! + } + + public func reportValidity() -> Bool { + jsObject["reportValidity"]!().fromJSValue()! + } + + public func setCustomValidity(error: String) { + _ = jsObject["setCustomValidity"]!(error.jsValue()) + } + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var archive: String + + @ReadWriteAttribute + public var code: String + + @ReadWriteAttribute + public var declare: Bool + + @ReadWriteAttribute + public var hspace: UInt32 + + @ReadWriteAttribute + public var standby: String + + @ReadWriteAttribute + public var vspace: UInt32 + + @ReadWriteAttribute + public var codeBase: String + + @ReadWriteAttribute + public var codeType: String + + @ReadWriteAttribute + public var useMap: String + + @ReadWriteAttribute + public var border: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift new file mode 100644 index 00000000..4ba8a430 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLOptGroupElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLOptGroupElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + _label = ReadWriteAttribute(jsObject: jsObject, name: "label") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var disabled: Bool + + @ReadWriteAttribute + public var label: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift new file mode 100644 index 00000000..e7fefd2d --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLOptionElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLOptionElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _label = ReadWriteAttribute(jsObject: jsObject, name: "label") + _defaultSelected = ReadWriteAttribute(jsObject: jsObject, name: "defaultSelected") + _selected = ReadWriteAttribute(jsObject: jsObject, name: "selected") + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _text = ReadWriteAttribute(jsObject: jsObject, name: "text") + _index = ReadonlyAttribute(jsObject: jsObject, name: "index") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var disabled: Bool + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var label: String + + @ReadWriteAttribute + public var defaultSelected: Bool + + @ReadWriteAttribute + public var selected: Bool + + @ReadWriteAttribute + public var value: String + + @ReadWriteAttribute + public var text: String + + @ReadonlyAttribute + public var index: Int32 +} diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift new file mode 100644 index 00000000..48cf96ae --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -0,0 +1,33 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLOptionsCollection: HTMLCollection { + override public class var constructor: JSFunction { JSObject.global.HTMLOptionsCollection.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadWriteAttribute(jsObject: jsObject, name: "length") + _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: "selectedIndex") + super.init(unsafelyWrapping: jsObject) + } + + private var _length: ReadWriteAttribute + override public var length: UInt32 { + get { _length.wrappedValue } + set { _length.wrappedValue = newValue } + } + + // XXX: unsupported setter for keys of type UInt32 + + public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { + _ = jsObject["add"]!(element.jsValue(), before?.jsValue() ?? .undefined) + } + + public func remove(index: Int32) { + _ = jsObject["remove"]!(index.jsValue()) + } + + @ReadWriteAttribute + public var selectedIndex: Int32 +} diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift index 1f0b0f53..54b9bd72 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift @@ -1,49 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol HTMLOrSVGElement: JSBridgedClass {} - public extension HTMLOrSVGElement { - var dataset: DOMStringMap { - return jsObject.dataset.fromJSValue()! - } + var dataset: DOMStringMap { ReadonlyAttribute["dataset", in: jsObject] } var nonce: String { - get { - return jsObject.nonce.fromJSValue()! - } - set { - jsObject.nonce = newValue.jsValue() - } + get { ReadWriteAttribute["nonce", in: jsObject] } + set { ReadWriteAttribute["nonce", in: jsObject] = newValue } } var autofocus: Bool { - get { - return jsObject.autofocus.fromJSValue()! - } - set { - jsObject.autofocus = newValue.jsValue() - } + get { ReadWriteAttribute["autofocus", in: jsObject] } + set { ReadWriteAttribute["autofocus", in: jsObject] = newValue } } var tabIndex: Int32 { - get { - return jsObject.tabIndex.fromJSValue()! - } - set { - jsObject.tabIndex = newValue.jsValue() - } + get { ReadWriteAttribute["tabIndex", in: jsObject] } + set { ReadWriteAttribute["tabIndex", in: jsObject] = newValue } } - func focus(options: FocusOptions = [:]) { - _ = jsObject.focus!(options.jsValue()) + func focus(options: FocusOptions? = nil) { + _ = jsObject["focus"]!(options?.jsValue() ?? .undefined) } func blur() { - _ = jsObject.blur!() + _ = jsObject["blur"]!() } } diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift new file mode 100644 index 00000000..1a4e69c1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -0,0 +1,68 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLOutputElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLOutputElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _htmlFor = ReadonlyAttribute(jsObject: jsObject, name: "htmlFor") + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: "defaultValue") + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") + _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") + _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var htmlFor: DOMTokenList + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var name: String + + @ReadonlyAttribute + public var type: String + + @ReadWriteAttribute + public var defaultValue: String + + @ReadWriteAttribute + public var value: String + + @ReadonlyAttribute + public var willValidate: Bool + + @ReadonlyAttribute + public var validity: ValidityState + + @ReadonlyAttribute + public var validationMessage: String + + public func checkValidity() -> Bool { + jsObject["checkValidity"]!().fromJSValue()! + } + + public func reportValidity() -> Bool { + jsObject["reportValidity"]!().fromJSValue()! + } + + public func setCustomValidity(error: String) { + _ = jsObject["setCustomValidity"]!(error.jsValue()) + } + + @ReadonlyAttribute + public var labels: NodeList +} diff --git a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift new file mode 100644 index 00000000..c665286b --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLParagraphElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLParagraphElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var align: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLParamElement.swift b/Sources/DOMKit/WebIDL/HTMLParamElement.swift new file mode 100644 index 00000000..6eacca52 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLParamElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLParamElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLParamElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _valueType = ReadWriteAttribute(jsObject: jsObject, name: "valueType") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var value: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var valueType: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift new file mode 100644 index 00000000..01d29383 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLPictureElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLPictureElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLPreElement.swift b/Sources/DOMKit/WebIDL/HTMLPreElement.swift new file mode 100644 index 00000000..8b2e4c1c --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLPreElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLPreElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLPreElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var width: Int32 +} diff --git a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift new file mode 100644 index 00000000..a931150d --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLProgressElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLProgressElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _max = ReadWriteAttribute(jsObject: jsObject, name: "max") + _position = ReadonlyAttribute(jsObject: jsObject, name: "position") + _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var value: Double + + @ReadWriteAttribute + public var max: Double + + @ReadonlyAttribute + public var position: Double + + @ReadonlyAttribute + public var labels: NodeList +} diff --git a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift new file mode 100644 index 00000000..527763ef --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLQuoteElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLQuoteElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _cite = ReadWriteAttribute(jsObject: jsObject, name: "cite") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var cite: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift new file mode 100644 index 00000000..e4888a27 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLScriptElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLScriptElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _src = ReadWriteAttribute(jsObject: jsObject, name: "src") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _noModule = ReadWriteAttribute(jsObject: jsObject, name: "noModule") + _async = ReadWriteAttribute(jsObject: jsObject, name: "async") + _defer = ReadWriteAttribute(jsObject: jsObject, name: "defer") + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: "crossOrigin") + _text = ReadWriteAttribute(jsObject: jsObject, name: "text") + _integrity = ReadWriteAttribute(jsObject: jsObject, name: "integrity") + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") + _blocking = ReadonlyAttribute(jsObject: jsObject, name: "blocking") + _charset = ReadWriteAttribute(jsObject: jsObject, name: "charset") + _event = ReadWriteAttribute(jsObject: jsObject, name: "event") + _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: "htmlFor") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var noModule: Bool + + @ReadWriteAttribute + public var async: Bool + + @ReadWriteAttribute + public var `defer`: Bool + + @ReadWriteAttribute + public var crossOrigin: String? + + @ReadWriteAttribute + public var text: String + + @ReadWriteAttribute + public var integrity: String + + @ReadWriteAttribute + public var referrerPolicy: String + + @ReadonlyAttribute + public var blocking: DOMTokenList + + public static func supports(type: String) -> Bool { + constructor["supports"]!(type.jsValue()).fromJSValue()! + } + + @ReadWriteAttribute + public var charset: String + + @ReadWriteAttribute + public var event: String + + @ReadWriteAttribute + public var htmlFor: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift new file mode 100644 index 00000000..67554c1c --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -0,0 +1,118 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLSelectElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLSelectElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: "autocomplete") + _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _multiple = ReadWriteAttribute(jsObject: jsObject, name: "multiple") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _required = ReadWriteAttribute(jsObject: jsObject, name: "required") + _size = ReadWriteAttribute(jsObject: jsObject, name: "size") + _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _options = ReadonlyAttribute(jsObject: jsObject, name: "options") + _length = ReadWriteAttribute(jsObject: jsObject, name: "length") + _selectedOptions = ReadonlyAttribute(jsObject: jsObject, name: "selectedOptions") + _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: "selectedIndex") + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") + _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") + _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var autocomplete: String + + @ReadWriteAttribute + public var disabled: Bool + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var multiple: Bool + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var required: Bool + + @ReadWriteAttribute + public var size: UInt32 + + @ReadonlyAttribute + public var type: String + + @ReadonlyAttribute + public var options: HTMLOptionsCollection + + @ReadWriteAttribute + public var length: UInt32 + + public subscript(key: Int) -> HTMLOptionElement? { + jsObject[key].fromJSValue() + } + + public func namedItem(name: String) -> HTMLOptionElement? { + jsObject["namedItem"]!(name.jsValue()).fromJSValue()! + } + + public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { + _ = jsObject["add"]!(element.jsValue(), before?.jsValue() ?? .undefined) + } + + public func remove() { + _ = jsObject["remove"]!() + } + + public func remove(index: Int32) { + _ = jsObject["remove"]!(index.jsValue()) + } + + // XXX: unsupported setter for keys of type UInt32 + + @ReadonlyAttribute + public var selectedOptions: HTMLCollection + + @ReadWriteAttribute + public var selectedIndex: Int32 + + @ReadWriteAttribute + public var value: String + + @ReadonlyAttribute + public var willValidate: Bool + + @ReadonlyAttribute + public var validity: ValidityState + + @ReadonlyAttribute + public var validationMessage: String + + public func checkValidity() -> Bool { + jsObject["checkValidity"]!().fromJSValue()! + } + + public func reportValidity() -> Bool { + jsObject["reportValidity"]!().fromJSValue()! + } + + public func setCustomValidity(error: String) { + _ = jsObject["setCustomValidity"]!(error.jsValue()) + } + + @ReadonlyAttribute + public var labels: NodeList +} diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index 7934b56d..b74f6fe4 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class HTMLSlotElement: HTMLElement { @@ -14,17 +12,21 @@ public class HTMLSlotElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: HTMLSlotElement.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } @ReadWriteAttribute public var name: String - public func assignedNodes(options: AssignedNodesOptions = [:]) -> [Node] { - return jsObject.assignedNodes!(options.jsValue()).fromJSValue()! + public func assignedNodes(options: AssignedNodesOptions? = nil) -> [Node] { + jsObject["assignedNodes"]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func assignedElements(options: AssignedNodesOptions? = nil) -> [Element] { + jsObject["assignedElements"]!(options?.jsValue() ?? .undefined).fromJSValue()! } - public func assignedElements(options: AssignedNodesOptions = [:]) -> [Element] { - return jsObject.assignedElements!(options.jsValue()).fromJSValue()! + public func assign(nodes: __UNSUPPORTED_UNION__...) { + _ = jsObject["assign"]!(nodes.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift new file mode 100644 index 00000000..e0db030e --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLSourceElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLSourceElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _src = ReadWriteAttribute(jsObject: jsObject, name: "src") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _srcset = ReadWriteAttribute(jsObject: jsObject, name: "srcset") + _sizes = ReadWriteAttribute(jsObject: jsObject, name: "sizes") + _media = ReadWriteAttribute(jsObject: jsObject, name: "media") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var srcset: String + + @ReadWriteAttribute + public var sizes: String + + @ReadWriteAttribute + public var media: String + + @ReadWriteAttribute + public var width: UInt32 + + @ReadWriteAttribute + public var height: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift new file mode 100644 index 00000000..b798e6c8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLSpanElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLSpanElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift new file mode 100644 index 00000000..8b20a994 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLStyleElement: HTMLElement, LinkStyle { + override public class var constructor: JSFunction { JSObject.global.HTMLStyleElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _media = ReadWriteAttribute(jsObject: jsObject, name: "media") + _blocking = ReadonlyAttribute(jsObject: jsObject, name: "blocking") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var media: String + + @ReadonlyAttribute + public var blocking: DOMTokenList + + @ReadWriteAttribute + public var type: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift new file mode 100644 index 00000000..1c36c36d --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTableCaptionElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTableCaptionElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var align: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift new file mode 100644 index 00000000..4f5c3e54 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift @@ -0,0 +1,76 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTableCellElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTableCellElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _colSpan = ReadWriteAttribute(jsObject: jsObject, name: "colSpan") + _rowSpan = ReadWriteAttribute(jsObject: jsObject, name: "rowSpan") + _headers = ReadWriteAttribute(jsObject: jsObject, name: "headers") + _cellIndex = ReadonlyAttribute(jsObject: jsObject, name: "cellIndex") + _scope = ReadWriteAttribute(jsObject: jsObject, name: "scope") + _abbr = ReadWriteAttribute(jsObject: jsObject, name: "abbr") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _axis = ReadWriteAttribute(jsObject: jsObject, name: "axis") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _ch = ReadWriteAttribute(jsObject: jsObject, name: "ch") + _chOff = ReadWriteAttribute(jsObject: jsObject, name: "chOff") + _noWrap = ReadWriteAttribute(jsObject: jsObject, name: "noWrap") + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: "vAlign") + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var colSpan: UInt32 + + @ReadWriteAttribute + public var rowSpan: UInt32 + + @ReadWriteAttribute + public var headers: String + + @ReadonlyAttribute + public var cellIndex: Int32 + + @ReadWriteAttribute + public var scope: String + + @ReadWriteAttribute + public var abbr: String + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var axis: String + + @ReadWriteAttribute + public var height: String + + @ReadWriteAttribute + public var width: String + + @ReadWriteAttribute + public var ch: String + + @ReadWriteAttribute + public var chOff: String + + @ReadWriteAttribute + public var noWrap: Bool + + @ReadWriteAttribute + public var vAlign: String + + @ReadWriteAttribute + public var bgColor: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift new file mode 100644 index 00000000..b169e61d --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTableColElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTableColElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _span = ReadWriteAttribute(jsObject: jsObject, name: "span") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _ch = ReadWriteAttribute(jsObject: jsObject, name: "ch") + _chOff = ReadWriteAttribute(jsObject: jsObject, name: "chOff") + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: "vAlign") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var span: UInt32 + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var ch: String + + @ReadWriteAttribute + public var chOff: String + + @ReadWriteAttribute + public var vAlign: String + + @ReadWriteAttribute + public var width: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift new file mode 100644 index 00000000..6ee5afb9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -0,0 +1,108 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTableElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTableElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _caption = ReadWriteAttribute(jsObject: jsObject, name: "caption") + _tHead = ReadWriteAttribute(jsObject: jsObject, name: "tHead") + _tFoot = ReadWriteAttribute(jsObject: jsObject, name: "tFoot") + _tBodies = ReadonlyAttribute(jsObject: jsObject, name: "tBodies") + _rows = ReadonlyAttribute(jsObject: jsObject, name: "rows") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _border = ReadWriteAttribute(jsObject: jsObject, name: "border") + _frame = ReadWriteAttribute(jsObject: jsObject, name: "frame") + _rules = ReadWriteAttribute(jsObject: jsObject, name: "rules") + _summary = ReadWriteAttribute(jsObject: jsObject, name: "summary") + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") + _cellPadding = ReadWriteAttribute(jsObject: jsObject, name: "cellPadding") + _cellSpacing = ReadWriteAttribute(jsObject: jsObject, name: "cellSpacing") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var caption: HTMLTableCaptionElement? + + public func createCaption() -> HTMLTableCaptionElement { + jsObject["createCaption"]!().fromJSValue()! + } + + public func deleteCaption() { + _ = jsObject["deleteCaption"]!() + } + + @ReadWriteAttribute + public var tHead: HTMLTableSectionElement? + + public func createTHead() -> HTMLTableSectionElement { + jsObject["createTHead"]!().fromJSValue()! + } + + public func deleteTHead() { + _ = jsObject["deleteTHead"]!() + } + + @ReadWriteAttribute + public var tFoot: HTMLTableSectionElement? + + public func createTFoot() -> HTMLTableSectionElement { + jsObject["createTFoot"]!().fromJSValue()! + } + + public func deleteTFoot() { + _ = jsObject["deleteTFoot"]!() + } + + @ReadonlyAttribute + public var tBodies: HTMLCollection + + public func createTBody() -> HTMLTableSectionElement { + jsObject["createTBody"]!().fromJSValue()! + } + + @ReadonlyAttribute + public var rows: HTMLCollection + + public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { + jsObject["insertRow"]!(index?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteRow(index: Int32) { + _ = jsObject["deleteRow"]!(index.jsValue()) + } + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var border: String + + @ReadWriteAttribute + public var frame: String + + @ReadWriteAttribute + public var rules: String + + @ReadWriteAttribute + public var summary: String + + @ReadWriteAttribute + public var width: String + + @ReadWriteAttribute + public var bgColor: String + + @ReadWriteAttribute + public var cellPadding: String + + @ReadWriteAttribute + public var cellSpacing: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift new file mode 100644 index 00000000..092b6e1d --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTableRowElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTableRowElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _rowIndex = ReadonlyAttribute(jsObject: jsObject, name: "rowIndex") + _sectionRowIndex = ReadonlyAttribute(jsObject: jsObject, name: "sectionRowIndex") + _cells = ReadonlyAttribute(jsObject: jsObject, name: "cells") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _ch = ReadWriteAttribute(jsObject: jsObject, name: "ch") + _chOff = ReadWriteAttribute(jsObject: jsObject, name: "chOff") + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: "vAlign") + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var rowIndex: Int32 + + @ReadonlyAttribute + public var sectionRowIndex: Int32 + + @ReadonlyAttribute + public var cells: HTMLCollection + + public func insertCell(index: Int32? = nil) -> HTMLTableCellElement { + jsObject["insertCell"]!(index?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteCell(index: Int32) { + _ = jsObject["deleteCell"]!(index.jsValue()) + } + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var ch: String + + @ReadWriteAttribute + public var chOff: String + + @ReadWriteAttribute + public var vAlign: String + + @ReadWriteAttribute + public var bgColor: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift new file mode 100644 index 00000000..f8493547 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTableSectionElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTableSectionElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _rows = ReadonlyAttribute(jsObject: jsObject, name: "rows") + _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _ch = ReadWriteAttribute(jsObject: jsObject, name: "ch") + _chOff = ReadWriteAttribute(jsObject: jsObject, name: "chOff") + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: "vAlign") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var rows: HTMLCollection + + public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { + jsObject["insertRow"]!(index?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteRow(index: Int32) { + _ = jsObject["deleteRow"]!(index.jsValue()) + } + + @ReadWriteAttribute + public var align: String + + @ReadWriteAttribute + public var ch: String + + @ReadWriteAttribute + public var chOff: String + + @ReadWriteAttribute + public var vAlign: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift new file mode 100644 index 00000000..cb5452e3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTemplateElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTemplateElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _content = ReadonlyAttribute(jsObject: jsObject, name: "content") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var content: DocumentFragment +} diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift new file mode 100644 index 00000000..be1e7130 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -0,0 +1,140 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTextAreaElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTextAreaElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: "autocomplete") + _cols = ReadWriteAttribute(jsObject: jsObject, name: "cols") + _dirName = ReadWriteAttribute(jsObject: jsObject, name: "dirName") + _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + _form = ReadonlyAttribute(jsObject: jsObject, name: "form") + _maxLength = ReadWriteAttribute(jsObject: jsObject, name: "maxLength") + _minLength = ReadWriteAttribute(jsObject: jsObject, name: "minLength") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _placeholder = ReadWriteAttribute(jsObject: jsObject, name: "placeholder") + _readOnly = ReadWriteAttribute(jsObject: jsObject, name: "readOnly") + _required = ReadWriteAttribute(jsObject: jsObject, name: "required") + _rows = ReadWriteAttribute(jsObject: jsObject, name: "rows") + _wrap = ReadWriteAttribute(jsObject: jsObject, name: "wrap") + _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: "defaultValue") + _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _textLength = ReadonlyAttribute(jsObject: jsObject, name: "textLength") + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") + _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") + _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: "selectionStart") + _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: "selectionEnd") + _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: "selectionDirection") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var autocomplete: String + + @ReadWriteAttribute + public var cols: UInt32 + + @ReadWriteAttribute + public var dirName: String + + @ReadWriteAttribute + public var disabled: Bool + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @ReadWriteAttribute + public var maxLength: Int32 + + @ReadWriteAttribute + public var minLength: Int32 + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var placeholder: String + + @ReadWriteAttribute + public var readOnly: Bool + + @ReadWriteAttribute + public var required: Bool + + @ReadWriteAttribute + public var rows: UInt32 + + @ReadWriteAttribute + public var wrap: String + + @ReadonlyAttribute + public var type: String + + @ReadWriteAttribute + public var defaultValue: String + + @ReadWriteAttribute + public var value: String + + @ReadonlyAttribute + public var textLength: UInt32 + + @ReadonlyAttribute + public var willValidate: Bool + + @ReadonlyAttribute + public var validity: ValidityState + + @ReadonlyAttribute + public var validationMessage: String + + public func checkValidity() -> Bool { + jsObject["checkValidity"]!().fromJSValue()! + } + + public func reportValidity() -> Bool { + jsObject["reportValidity"]!().fromJSValue()! + } + + public func setCustomValidity(error: String) { + _ = jsObject["setCustomValidity"]!(error.jsValue()) + } + + @ReadonlyAttribute + public var labels: NodeList + + public func select() { + _ = jsObject["select"]!() + } + + @ReadWriteAttribute + public var selectionStart: UInt32 + + @ReadWriteAttribute + public var selectionEnd: UInt32 + + @ReadWriteAttribute + public var selectionDirection: String + + public func setRangeText(replacement: String) { + _ = jsObject["setRangeText"]!(replacement.jsValue()) + } + + public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { + _ = jsObject["setRangeText"]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + } + + public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { + _ = jsObject["setSelectionRange"]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift new file mode 100644 index 00000000..4faaa612 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTimeElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTimeElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _dateTime = ReadWriteAttribute(jsObject: jsObject, name: "dateTime") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var dateTime: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift new file mode 100644 index 00000000..1636826d --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTitleElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTitleElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _text = ReadWriteAttribute(jsObject: jsObject, name: "text") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var text: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift new file mode 100644 index 00000000..82f828ee --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLTrackElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLTrackElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _kind = ReadWriteAttribute(jsObject: jsObject, name: "kind") + _src = ReadWriteAttribute(jsObject: jsObject, name: "src") + _srclang = ReadWriteAttribute(jsObject: jsObject, name: "srclang") + _label = ReadWriteAttribute(jsObject: jsObject, name: "label") + _default = ReadWriteAttribute(jsObject: jsObject, name: "default") + _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") + _track = ReadonlyAttribute(jsObject: jsObject, name: "track") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var kind: String + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var srclang: String + + @ReadWriteAttribute + public var label: String + + @ReadWriteAttribute + public var `default`: Bool + + public static let NONE: UInt16 = 0 + + public static let LOADING: UInt16 = 1 + + public static let LOADED: UInt16 = 2 + + public static let ERROR: UInt16 = 3 + + @ReadonlyAttribute + public var readyState: UInt16 + + @ReadonlyAttribute + public var track: TextTrack +} diff --git a/Sources/DOMKit/WebIDL/HTMLUListElement.swift b/Sources/DOMKit/WebIDL/HTMLUListElement.swift new file mode 100644 index 00000000..a21ffaea --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLUListElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLUListElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global.HTMLUListElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") + _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var compact: Bool + + @ReadWriteAttribute + public var type: String +} diff --git a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift index 143b0bad..fd3cfcd9 100644 --- a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class HTMLUnknownElement: HTMLElement { diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift new file mode 100644 index 00000000..77d1aed1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLVideoElement: HTMLMediaElement { + override public class var constructor: JSFunction { JSObject.global.HTMLVideoElement.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _videoWidth = ReadonlyAttribute(jsObject: jsObject, name: "videoWidth") + _videoHeight = ReadonlyAttribute(jsObject: jsObject, name: "videoHeight") + _poster = ReadWriteAttribute(jsObject: jsObject, name: "poster") + _playsInline = ReadWriteAttribute(jsObject: jsObject, name: "playsInline") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var width: UInt32 + + @ReadWriteAttribute + public var height: UInt32 + + @ReadonlyAttribute + public var videoWidth: UInt32 + + @ReadonlyAttribute + public var videoHeight: UInt32 + + @ReadWriteAttribute + public var poster: String + + @ReadWriteAttribute + public var playsInline: Bool +} diff --git a/Sources/DOMKit/WebIDL/HashChangeEvent.swift b/Sources/DOMKit/WebIDL/HashChangeEvent.swift new file mode 100644 index 00000000..27783cbf --- /dev/null +++ b/Sources/DOMKit/WebIDL/HashChangeEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HashChangeEvent: Event { + override public class var constructor: JSFunction { JSObject.global.HashChangeEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _oldURL = ReadonlyAttribute(jsObject: jsObject, name: "oldURL") + _newURL = ReadonlyAttribute(jsObject: jsObject, name: "newURL") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: HashChangeEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var oldURL: String + + @ReadonlyAttribute + public var newURL: String +} diff --git a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift new file mode 100644 index 00000000..361122bd --- /dev/null +++ b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HashChangeEventInit: JSObject { + public init(oldURL: String, newURL: String) { + let object = JSObject.global.Object.function!.new() + object["oldURL"] = oldURL.jsValue() + object["newURL"] = newURL.jsValue() + _oldURL = ReadWriteAttribute(jsObject: object, name: "oldURL") + _newURL = ReadWriteAttribute(jsObject: object, name: "newURL") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var oldURL: String + + @ReadWriteAttribute + public var newURL: String +} diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift new file mode 100644 index 00000000..767b02bb --- /dev/null +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -0,0 +1,43 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Headers: JSBridgedClass, Sequence { + public class var constructor: JSFunction { JSObject.global.Headers.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(init: HeadersInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + } + + public func append(name: String, value: String) { + _ = jsObject["append"]!(name.jsValue(), value.jsValue()) + } + + public func delete(name: String) { + _ = jsObject["delete"]!(name.jsValue()) + } + + public func get(name: String) -> String? { + jsObject["get"]!(name.jsValue()).fromJSValue()! + } + + public func has(name: String) -> Bool { + jsObject["has"]!(name.jsValue()).fromJSValue()! + } + + public func set(name: String, value: String) { + _ = jsObject["set"]!(name.jsValue(), value.jsValue()) + } + + public typealias Element = String + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } +} diff --git a/Sources/DOMKit/WebIDL/History.swift b/Sources/DOMKit/WebIDL/History.swift new file mode 100644 index 00000000..33297c91 --- /dev/null +++ b/Sources/DOMKit/WebIDL/History.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class History: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.History.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _scrollRestoration = ReadWriteAttribute(jsObject: jsObject, name: "scrollRestoration") + _state = ReadonlyAttribute(jsObject: jsObject, name: "state") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + @ReadWriteAttribute + public var scrollRestoration: ScrollRestoration + + @ReadonlyAttribute + public var state: JSValue + + public func go(delta: Int32? = nil) { + _ = jsObject["go"]!(delta?.jsValue() ?? .undefined) + } + + public func back() { + _ = jsObject["back"]!() + } + + public func forward() { + _ = jsObject["forward"]!() + } + + public func pushState(data: JSValue, unused: String, url: String? = nil) { + _ = jsObject["pushState"]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + } + + public func replaceState(data: JSValue, unused: String, url: String? = nil) { + _ = jsObject["replaceState"]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/ImageBitmap.swift b/Sources/DOMKit/WebIDL/ImageBitmap.swift new file mode 100644 index 00000000..504bc557 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageBitmap.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageBitmap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.ImageBitmap.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadonlyAttribute(jsObject: jsObject, name: "width") + _height = ReadonlyAttribute(jsObject: jsObject, name: "height") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var width: UInt32 + + @ReadonlyAttribute + public var height: UInt32 + + public func close() { + _ = jsObject["close"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift new file mode 100644 index 00000000..81431c9d --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift @@ -0,0 +1,41 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageBitmapOptions: JSObject { + public init(imageOrientation: ImageOrientation, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, resizeWidth: UInt32, resizeHeight: UInt32, resizeQuality: ResizeQuality) { + let object = JSObject.global.Object.function!.new() + object["imageOrientation"] = imageOrientation.jsValue() + object["premultiplyAlpha"] = premultiplyAlpha.jsValue() + object["colorSpaceConversion"] = colorSpaceConversion.jsValue() + object["resizeWidth"] = resizeWidth.jsValue() + object["resizeHeight"] = resizeHeight.jsValue() + object["resizeQuality"] = resizeQuality.jsValue() + _imageOrientation = ReadWriteAttribute(jsObject: object, name: "imageOrientation") + _premultiplyAlpha = ReadWriteAttribute(jsObject: object, name: "premultiplyAlpha") + _colorSpaceConversion = ReadWriteAttribute(jsObject: object, name: "colorSpaceConversion") + _resizeWidth = ReadWriteAttribute(jsObject: object, name: "resizeWidth") + _resizeHeight = ReadWriteAttribute(jsObject: object, name: "resizeHeight") + _resizeQuality = ReadWriteAttribute(jsObject: object, name: "resizeQuality") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var imageOrientation: ImageOrientation + + @ReadWriteAttribute + public var premultiplyAlpha: PremultiplyAlpha + + @ReadWriteAttribute + public var colorSpaceConversion: ColorSpaceConversion + + @ReadWriteAttribute + public var resizeWidth: UInt32 + + @ReadWriteAttribute + public var resizeHeight: UInt32 + + @ReadWriteAttribute + public var resizeQuality: ResizeQuality +} diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift new file mode 100644 index 00000000..a25f07c1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageBitmapRenderingContext: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.ImageBitmapRenderingContext.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _canvas = ReadonlyAttribute(jsObject: jsObject, name: "canvas") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var canvas: __UNSUPPORTED_UNION__ + + public func transferFromImageBitmap(bitmap: ImageBitmap?) { + _ = jsObject["transferFromImageBitmap"]!(bitmap.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift new file mode 100644 index 00000000..a9025bb4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageBitmapRenderingContextSettings: JSObject { + public init(alpha: Bool) { + let object = JSObject.global.Object.function!.new() + object["alpha"] = alpha.jsValue() + _alpha = ReadWriteAttribute(jsObject: object, name: "alpha") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var alpha: Bool +} diff --git a/Sources/DOMKit/WebIDL/ImageData.swift b/Sources/DOMKit/WebIDL/ImageData.swift new file mode 100644 index 00000000..4aa1db9c --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageData.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageData: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.ImageData.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadonlyAttribute(jsObject: jsObject, name: "width") + _height = ReadonlyAttribute(jsObject: jsObject, name: "height") + _data = ReadonlyAttribute(jsObject: jsObject, name: "data") + _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: "colorSpace") + self.jsObject = jsObject + } + + public convenience init(sw: UInt32, sh: UInt32, settings: ImageDataSettings? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined)) + } + + public convenience init(data: Uint8ClampedArray, sw: UInt32, sh: UInt32? = nil, settings: ImageDataSettings? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(data.jsValue(), sw.jsValue(), sh?.jsValue() ?? .undefined, settings?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var width: UInt32 + + @ReadonlyAttribute + public var height: UInt32 + + @ReadonlyAttribute + public var data: Uint8ClampedArray + + @ReadonlyAttribute + public var colorSpace: PredefinedColorSpace +} diff --git a/Sources/DOMKit/WebIDL/ImageDataSettings.swift b/Sources/DOMKit/WebIDL/ImageDataSettings.swift new file mode 100644 index 00000000..4c03c050 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageDataSettings.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageDataSettings: JSObject { + public init(colorSpace: PredefinedColorSpace) { + let object = JSObject.global.Object.function!.new() + object["colorSpace"] = colorSpace.jsValue() + _colorSpace = ReadWriteAttribute(jsObject: object, name: "colorSpace") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var colorSpace: PredefinedColorSpace +} diff --git a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift new file mode 100644 index 00000000..79793de7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageEncodeOptions: JSObject { + public init(type: String, quality: Double) { + let object = JSObject.global.Object.function!.new() + object["type"] = type.jsValue() + object["quality"] = quality.jsValue() + _type = ReadWriteAttribute(jsObject: object, name: "type") + _quality = ReadWriteAttribute(jsObject: object, name: "quality") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var quality: Double +} diff --git a/Sources/DOMKit/WebIDL/ImageOrientation.swift b/Sources/DOMKit/WebIDL/ImageOrientation.swift new file mode 100644 index 00000000..988153ca --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageOrientation.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ImageOrientation: String, JSValueCompatible { + case none + case flipY + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift new file mode 100644 index 00000000..e6ffa49d --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ImageSmoothingQuality: String, JSValueCompatible { + case low + case medium + case high + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index 7f7c1c66..ea84ef18 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -1,3 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop import JavaScriptKit public class InputEvent: UIEvent { diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift new file mode 100644 index 00000000..839be0d9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class InputEventInit: JSObject { + public init(data: String?, isComposing: Bool, inputType: String) { + let object = JSObject.global.Object.function!.new() + object["data"] = data.jsValue() + object["isComposing"] = isComposing.jsValue() + object["inputType"] = inputType.jsValue() + _data = ReadWriteAttribute(jsObject: object, name: "data") + _isComposing = ReadWriteAttribute(jsObject: object, name: "isComposing") + _inputType = ReadWriteAttribute(jsObject: object, name: "inputType") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var data: String? + + @ReadWriteAttribute + public var isComposing: Bool + + @ReadWriteAttribute + public var inputType: String +} diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index 93828bef..81f13e06 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -1,3 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop import JavaScriptKit public class KeyboardEvent: UIEvent { @@ -22,13 +25,13 @@ public class KeyboardEvent: UIEvent { self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } - public static let DOM_KEY_LOCATION_STANDARD: Double = 0x00 + public static let DOM_KEY_LOCATION_STANDARD: UInt32 = 0x00 - public static let DOM_KEY_LOCATION_LEFT: Double = 0x01 + public static let DOM_KEY_LOCATION_LEFT: UInt32 = 0x01 - public static let DOM_KEY_LOCATION_RIGHT: Double = 0x02 + public static let DOM_KEY_LOCATION_RIGHT: UInt32 = 0x02 - public static let DOM_KEY_LOCATION_NUMPAD: Double = 0x03 + public static let DOM_KEY_LOCATION_NUMPAD: UInt32 = 0x03 @ReadonlyAttribute public var key: String @@ -37,7 +40,7 @@ public class KeyboardEvent: UIEvent { public var code: String @ReadonlyAttribute - public var location: Double + public var location: UInt32 @ReadonlyAttribute public var ctrlKey: Bool @@ -52,7 +55,7 @@ public class KeyboardEvent: UIEvent { public var metaKey: Bool @ReadonlyAttribute - public var repeat: Bool + public var `repeat`: Bool @ReadonlyAttribute public var isComposing: Bool @@ -61,13 +64,23 @@ public class KeyboardEvent: UIEvent { jsObject["getModifierState"]!(keyArg.jsValue()).fromJSValue()! } - public func initKeyboardEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, keyArg: String? = nil, locationArg: Double? = nil, ctrlKey: Bool? = nil, altKey: Bool? = nil, shiftKey: Bool? = nil, metaKey: Bool? = nil) { - _ = jsObject["initKeyboardEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, keyArg?.jsValue() ?? .undefined, locationArg?.jsValue() ?? .undefined, ctrlKey?.jsValue() ?? .undefined, altKey?.jsValue() ?? .undefined, shiftKey?.jsValue() ?? .undefined, metaKey?.jsValue() ?? .undefined) + public func initKeyboardEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, keyArg: String? = nil, locationArg: UInt32? = nil, ctrlKey: Bool? = nil, altKey: Bool? = nil, shiftKey: Bool? = nil, metaKey: Bool? = nil) { + let _arg0 = typeArg.jsValue() + let _arg1 = bubblesArg?.jsValue() ?? .undefined + let _arg2 = cancelableArg?.jsValue() ?? .undefined + let _arg3 = viewArg?.jsValue() ?? .undefined + let _arg4 = keyArg?.jsValue() ?? .undefined + let _arg5 = locationArg?.jsValue() ?? .undefined + let _arg6 = ctrlKey?.jsValue() ?? .undefined + let _arg7 = altKey?.jsValue() ?? .undefined + let _arg8 = shiftKey?.jsValue() ?? .undefined + let _arg9 = metaKey?.jsValue() ?? .undefined + _ = jsObject["initKeyboardEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) } @ReadonlyAttribute - public var charCode: Double + public var charCode: UInt32 @ReadonlyAttribute - public var keyCode: Double + public var keyCode: UInt32 } diff --git a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift new file mode 100644 index 00000000..7b7874ef --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class KeyboardEventInit: JSObject { + public init(key: String, code: String, location: UInt32, repeat: Bool, isComposing: Bool, charCode: UInt32, keyCode: UInt32) { + let object = JSObject.global.Object.function!.new() + object["key"] = key.jsValue() + object["code"] = code.jsValue() + object["location"] = location.jsValue() + object["repeat"] = `repeat`.jsValue() + object["isComposing"] = isComposing.jsValue() + object["charCode"] = charCode.jsValue() + object["keyCode"] = keyCode.jsValue() + _key = ReadWriteAttribute(jsObject: object, name: "key") + _code = ReadWriteAttribute(jsObject: object, name: "code") + _location = ReadWriteAttribute(jsObject: object, name: "location") + _repeat = ReadWriteAttribute(jsObject: object, name: "repeat") + _isComposing = ReadWriteAttribute(jsObject: object, name: "isComposing") + _charCode = ReadWriteAttribute(jsObject: object, name: "charCode") + _keyCode = ReadWriteAttribute(jsObject: object, name: "keyCode") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var key: String + + @ReadWriteAttribute + public var code: String + + @ReadWriteAttribute + public var location: UInt32 + + @ReadWriteAttribute + public var `repeat`: Bool + + @ReadWriteAttribute + public var isComposing: Bool + + @ReadWriteAttribute + public var charCode: UInt32 + + @ReadWriteAttribute + public var keyCode: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/LinkStyle.swift b/Sources/DOMKit/WebIDL/LinkStyle.swift new file mode 100644 index 00000000..8938c6b4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LinkStyle.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol LinkStyle: JSBridgedClass {} +public extension LinkStyle { + var sheet: CSSStyleSheet? { ReadonlyAttribute["sheet", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/Location.swift b/Sources/DOMKit/WebIDL/Location.swift new file mode 100644 index 00000000..b4aff9c6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Location.swift @@ -0,0 +1,66 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Location: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.Location.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _href = ReadWriteAttribute(jsObject: jsObject, name: "href") + _origin = ReadonlyAttribute(jsObject: jsObject, name: "origin") + _protocol = ReadWriteAttribute(jsObject: jsObject, name: "protocol") + _host = ReadWriteAttribute(jsObject: jsObject, name: "host") + _hostname = ReadWriteAttribute(jsObject: jsObject, name: "hostname") + _port = ReadWriteAttribute(jsObject: jsObject, name: "port") + _pathname = ReadWriteAttribute(jsObject: jsObject, name: "pathname") + _search = ReadWriteAttribute(jsObject: jsObject, name: "search") + _hash = ReadWriteAttribute(jsObject: jsObject, name: "hash") + _ancestorOrigins = ReadonlyAttribute(jsObject: jsObject, name: "ancestorOrigins") + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var href: String + + @ReadonlyAttribute + public var origin: String + + @ReadWriteAttribute + public var `protocol`: 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 + + @ReadWriteAttribute + public var hash: String + + public func assign(url: String) { + _ = jsObject["assign"]!(url.jsValue()) + } + + public func replace(url: String) { + _ = jsObject["replace"]!(url.jsValue()) + } + + public func reload() { + _ = jsObject["reload"]!() + } + + @ReadonlyAttribute + public var ancestorOrigins: DOMStringList +} diff --git a/Sources/DOMKit/WebIDL/MediaError.swift b/Sources/DOMKit/WebIDL/MediaError.swift new file mode 100644 index 00000000..ec72e77a --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaError.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaError: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.MediaError.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _code = ReadonlyAttribute(jsObject: jsObject, name: "code") + _message = ReadonlyAttribute(jsObject: jsObject, name: "message") + self.jsObject = jsObject + } + + public static let MEDIA_ERR_ABORTED: UInt16 = 1 + + public static let MEDIA_ERR_NETWORK: UInt16 = 2 + + public static let MEDIA_ERR_DECODE: UInt16 = 3 + + public static let MEDIA_ERR_SRC_NOT_SUPPORTED: UInt16 = 4 + + @ReadonlyAttribute + public var code: UInt16 + + @ReadonlyAttribute + public var message: String +} diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift new file mode 100644 index 00000000..8f022b5d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaList.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.MediaList.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _mediaText = ReadWriteAttribute(jsObject: jsObject, name: "mediaText") + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var mediaText: String + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> String? { + jsObject[key].fromJSValue() + } + + public func appendMedium(medium: String) { + _ = jsObject["appendMedium"]!(medium.jsValue()) + } + + public func deleteMedium(medium: String) { + _ = jsObject["deleteMedium"]!(medium.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/MessageChannel.swift b/Sources/DOMKit/WebIDL/MessageChannel.swift new file mode 100644 index 00000000..153fa8e5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MessageChannel.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MessageChannel: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.MessageChannel.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _port1 = ReadonlyAttribute(jsObject: jsObject, name: "port1") + _port2 = ReadonlyAttribute(jsObject: jsObject, name: "port2") + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var port1: MessagePort + + @ReadonlyAttribute + public var port2: MessagePort +} diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift new file mode 100644 index 00000000..ae80176b --- /dev/null +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MessageEvent: Event { + override public class var constructor: JSFunction { JSObject.global.MessageEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: "data") + _origin = ReadonlyAttribute(jsObject: jsObject, name: "origin") + _lastEventId = ReadonlyAttribute(jsObject: jsObject, name: "lastEventId") + _source = ReadonlyAttribute(jsObject: jsObject, name: "source") + _ports = ReadonlyAttribute(jsObject: jsObject, name: "ports") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: MessageEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(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] + + 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 + _ = jsObject["initMessageEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + } +} diff --git a/Sources/DOMKit/WebIDL/MessageEventInit.swift b/Sources/DOMKit/WebIDL/MessageEventInit.swift new file mode 100644 index 00000000..7896e517 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MessageEventInit.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MessageEventInit: JSObject { + public init(data: JSValue, origin: String, lastEventId: String, source: MessageEventSource?, ports: [MessagePort]) { + let object = JSObject.global.Object.function!.new() + object["data"] = data.jsValue() + object["origin"] = origin.jsValue() + object["lastEventId"] = lastEventId.jsValue() + object["source"] = source.jsValue() + object["ports"] = ports.jsValue() + _data = ReadWriteAttribute(jsObject: object, name: "data") + _origin = ReadWriteAttribute(jsObject: object, name: "origin") + _lastEventId = ReadWriteAttribute(jsObject: object, name: "lastEventId") + _source = ReadWriteAttribute(jsObject: object, name: "source") + _ports = ReadWriteAttribute(jsObject: object, name: "ports") + super.init(cloning: 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] +} diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift new file mode 100644 index 00000000..276d2ed8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MessagePort: EventTarget { + override public class var constructor: JSFunction { JSObject.global.MessagePort.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessageerror") + super.init(unsafelyWrapping: jsObject) + } + + public func postMessage(message: JSValue, transfer: [JSObject]) { + _ = jsObject["postMessage"]!(message.jsValue(), transfer.jsValue()) + } + + public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + _ = jsObject["postMessage"]!(message.jsValue(), options?.jsValue() ?? .undefined) + } + + public func start() { + _ = jsObject["start"]!() + } + + public func close() { + _ = jsObject["close"]!() + } + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ClosureAttribute.Optional1 + public var onmessageerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/MimeType.swift b/Sources/DOMKit/WebIDL/MimeType.swift new file mode 100644 index 00000000..caeb17bf --- /dev/null +++ b/Sources/DOMKit/WebIDL/MimeType.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MimeType: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.MimeType.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _description = ReadonlyAttribute(jsObject: jsObject, name: "description") + _suffixes = ReadonlyAttribute(jsObject: jsObject, name: "suffixes") + _enabledPlugin = ReadonlyAttribute(jsObject: jsObject, name: "enabledPlugin") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var type: String + + @ReadonlyAttribute + public var description: String + + @ReadonlyAttribute + public var suffixes: String + + @ReadonlyAttribute + public var enabledPlugin: Plugin +} diff --git a/Sources/DOMKit/WebIDL/MimeTypeArray.swift b/Sources/DOMKit/WebIDL/MimeTypeArray.swift new file mode 100644 index 00000000..be7e8371 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MimeTypeArray.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MimeTypeArray: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.MimeTypeArray.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> MimeType? { + jsObject[key].fromJSValue() + } + + public subscript(key: String) -> MimeType? { + jsObject[key].fromJSValue() + } +} diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index 1f429817..55359a74 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -1,3 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop import JavaScriptKit public class MouseEvent: UIEvent { @@ -23,16 +26,16 @@ public class MouseEvent: UIEvent { } @ReadonlyAttribute - public var screenX: Double + public var screenX: Int32 @ReadonlyAttribute - public var screenY: Double + public var screenY: Int32 @ReadonlyAttribute - public var clientX: Double + public var clientX: Int32 @ReadonlyAttribute - public var clientY: Double + public var clientY: Int32 @ReadonlyAttribute public var ctrlKey: Bool @@ -47,10 +50,10 @@ public class MouseEvent: UIEvent { public var metaKey: Bool @ReadonlyAttribute - public var button: Double + public var button: Int16 @ReadonlyAttribute - public var buttons: Double + public var buttons: UInt16 @ReadonlyAttribute public var relatedTarget: EventTarget? @@ -59,7 +62,22 @@ public class MouseEvent: UIEvent { jsObject["getModifierState"]!(keyArg.jsValue()).fromJSValue()! } - public func initMouseEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Double? = nil, screenXArg: Double? = nil, screenYArg: Double? = nil, clientXArg: Double? = nil, clientYArg: Double? = nil, ctrlKeyArg: Bool? = nil, altKeyArg: Bool? = nil, shiftKeyArg: Bool? = nil, metaKeyArg: Bool? = nil, buttonArg: Double? = nil, relatedTargetArg: EventTarget? = nil) { - _ = jsObject["initMouseEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined, screenXArg?.jsValue() ?? .undefined, screenYArg?.jsValue() ?? .undefined, clientXArg?.jsValue() ?? .undefined, clientYArg?.jsValue() ?? .undefined, ctrlKeyArg?.jsValue() ?? .undefined, altKeyArg?.jsValue() ?? .undefined, shiftKeyArg?.jsValue() ?? .undefined, metaKeyArg?.jsValue() ?? .undefined, buttonArg?.jsValue() ?? .undefined, relatedTargetArg?.jsValue() ?? .undefined) + public func initMouseEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil, screenXArg: Int32? = nil, screenYArg: Int32? = nil, clientXArg: Int32? = nil, clientYArg: Int32? = nil, ctrlKeyArg: Bool? = nil, altKeyArg: Bool? = nil, shiftKeyArg: Bool? = nil, metaKeyArg: Bool? = nil, buttonArg: Int16? = nil, relatedTargetArg: EventTarget? = nil) { + let _arg0 = typeArg.jsValue() + let _arg1 = bubblesArg?.jsValue() ?? .undefined + let _arg2 = cancelableArg?.jsValue() ?? .undefined + let _arg3 = viewArg?.jsValue() ?? .undefined + let _arg4 = detailArg?.jsValue() ?? .undefined + let _arg5 = screenXArg?.jsValue() ?? .undefined + let _arg6 = screenYArg?.jsValue() ?? .undefined + let _arg7 = clientXArg?.jsValue() ?? .undefined + let _arg8 = clientYArg?.jsValue() ?? .undefined + let _arg9 = ctrlKeyArg?.jsValue() ?? .undefined + let _arg10 = altKeyArg?.jsValue() ?? .undefined + let _arg11 = shiftKeyArg?.jsValue() ?? .undefined + let _arg12 = metaKeyArg?.jsValue() ?? .undefined + let _arg13 = buttonArg?.jsValue() ?? .undefined + let _arg14 = relatedTargetArg?.jsValue() ?? .undefined + _ = jsObject["initMouseEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14) } } diff --git a/Sources/DOMKit/WebIDL/MouseEventInit.swift b/Sources/DOMKit/WebIDL/MouseEventInit.swift new file mode 100644 index 00000000..8782fdd3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MouseEventInit.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MouseEventInit: JSObject { + public init(screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { + let object = JSObject.global.Object.function!.new() + object["screenX"] = screenX.jsValue() + object["screenY"] = screenY.jsValue() + object["clientX"] = clientX.jsValue() + object["clientY"] = clientY.jsValue() + object["button"] = button.jsValue() + object["buttons"] = buttons.jsValue() + object["relatedTarget"] = relatedTarget.jsValue() + _screenX = ReadWriteAttribute(jsObject: object, name: "screenX") + _screenY = ReadWriteAttribute(jsObject: object, name: "screenY") + _clientX = ReadWriteAttribute(jsObject: object, name: "clientX") + _clientY = ReadWriteAttribute(jsObject: object, name: "clientY") + _button = ReadWriteAttribute(jsObject: object, name: "button") + _buttons = ReadWriteAttribute(jsObject: object, name: "buttons") + _relatedTarget = ReadWriteAttribute(jsObject: object, name: "relatedTarget") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var screenX: Int32 + + @ReadWriteAttribute + public var screenY: Int32 + + @ReadWriteAttribute + public var clientX: Int32 + + @ReadWriteAttribute + public var clientY: Int32 + + @ReadWriteAttribute + public var button: Int16 + + @ReadWriteAttribute + public var buttons: UInt16 + + @ReadWriteAttribute + public var relatedTarget: EventTarget? +} diff --git a/Sources/DOMKit/WebIDL/MutationCallback.swift b/Sources/DOMKit/WebIDL/MutationCallback.swift deleted file mode 100644 index 3223e519..00000000 --- a/Sources/DOMKit/WebIDL/MutationCallback.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias MutationCallback = (([MutationRecord], MutationObserver) -> Void) diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift index 4eeb88ff..a0dfb433 100644 --- a/Sources/DOMKit/WebIDL/MutationEvent.swift +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -1,3 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop import JavaScriptKit public class MutationEvent: Event { @@ -12,11 +15,11 @@ public class MutationEvent: Event { super.init(unsafelyWrapping: jsObject) } - public static let MODIFICATION: Double = 1 + public static let MODIFICATION: UInt16 = 1 - public static let ADDITION: Double = 2 + public static let ADDITION: UInt16 = 2 - public static let REMOVAL: Double = 3 + public static let REMOVAL: UInt16 = 3 @ReadonlyAttribute public var relatedNode: Node? @@ -31,9 +34,17 @@ public class MutationEvent: Event { public var attrName: String @ReadonlyAttribute - public var attrChange: Double - - public func initMutationEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, relatedNodeArg: Node? = nil, prevValueArg: String? = nil, newValueArg: String? = nil, attrNameArg: String? = nil, attrChangeArg: Double? = nil) { - _ = jsObject["initMutationEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, relatedNodeArg?.jsValue() ?? .undefined, prevValueArg?.jsValue() ?? .undefined, newValueArg?.jsValue() ?? .undefined, attrNameArg?.jsValue() ?? .undefined, attrChangeArg?.jsValue() ?? .undefined) + public var attrChange: UInt16 + + public func initMutationEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, relatedNodeArg: Node? = nil, prevValueArg: String? = nil, newValueArg: String? = nil, attrNameArg: String? = nil, attrChangeArg: UInt16? = nil) { + let _arg0 = typeArg.jsValue() + let _arg1 = bubblesArg?.jsValue() ?? .undefined + let _arg2 = cancelableArg?.jsValue() ?? .undefined + let _arg3 = relatedNodeArg?.jsValue() ?? .undefined + let _arg4 = prevValueArg?.jsValue() ?? .undefined + let _arg5 = newValueArg?.jsValue() ?? .undefined + let _arg6 = attrNameArg?.jsValue() ?? .undefined + let _arg7 = attrChangeArg?.jsValue() ?? .undefined + _ = jsObject["initMutationEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/MutationObserver.swift b/Sources/DOMKit/WebIDL/MutationObserver.swift index c3a7eb19..d1f1fe03 100644 --- a/Sources/DOMKit/WebIDL/MutationObserver.swift +++ b/Sources/DOMKit/WebIDL/MutationObserver.swift @@ -1,39 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class MutationObserver: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MutationObserver.function! } public let jsObject: JSObject - var closure: JSClosure? public required init(unsafelyWrapping jsObject: JSObject) { self.jsObject = jsObject } - public convenience init(callback: @escaping MutationCallback) { - let closure = JSClosure { callback($0[0].fromJSValue()!, $0[1].fromJSValue()!) } - self.init(unsafelyWrapping: MutationObserver.constructor.new(closure)) - self.closure = closure - } - - deinit { - closure?.release() - } + // XXX: constructor is ignored - public func observe(target: Node, options: MutationObserverInit = [:]) { - _ = jsObject.observe!(target.jsValue(), options.jsValue()) + public func observe(target: Node, options: MutationObserverInit? = nil) { + _ = jsObject["observe"]!(target.jsValue(), options?.jsValue() ?? .undefined) } public func disconnect() { - _ = jsObject.disconnect!() + _ = jsObject["disconnect"]!() } public func takeRecords() -> [MutationRecord] { - return jsObject.takeRecords!().fromJSValue()! + jsObject["takeRecords"]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MutationObserverInit.swift b/Sources/DOMKit/WebIDL/MutationObserverInit.swift new file mode 100644 index 00000000..725608b3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MutationObserverInit.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MutationObserverInit: JSObject { + public init(childList: Bool, attributes: Bool, characterData: Bool, subtree: Bool, attributeOldValue: Bool, characterDataOldValue: Bool, attributeFilter: [String]) { + let object = JSObject.global.Object.function!.new() + object["childList"] = childList.jsValue() + object["attributes"] = attributes.jsValue() + object["characterData"] = characterData.jsValue() + object["subtree"] = subtree.jsValue() + object["attributeOldValue"] = attributeOldValue.jsValue() + object["characterDataOldValue"] = characterDataOldValue.jsValue() + object["attributeFilter"] = attributeFilter.jsValue() + _childList = ReadWriteAttribute(jsObject: object, name: "childList") + _attributes = ReadWriteAttribute(jsObject: object, name: "attributes") + _characterData = ReadWriteAttribute(jsObject: object, name: "characterData") + _subtree = ReadWriteAttribute(jsObject: object, name: "subtree") + _attributeOldValue = ReadWriteAttribute(jsObject: object, name: "attributeOldValue") + _characterDataOldValue = ReadWriteAttribute(jsObject: object, name: "characterDataOldValue") + _attributeFilter = ReadWriteAttribute(jsObject: object, name: "attributeFilter") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var childList: Bool + + @ReadWriteAttribute + public var attributes: Bool + + @ReadWriteAttribute + public var characterData: Bool + + @ReadWriteAttribute + public var subtree: Bool + + @ReadWriteAttribute + public var attributeOldValue: Bool + + @ReadWriteAttribute + public var characterDataOldValue: Bool + + @ReadWriteAttribute + public var attributeFilter: [String] +} diff --git a/Sources/DOMKit/WebIDL/MutationRecord.swift b/Sources/DOMKit/WebIDL/MutationRecord.swift index 66b31816..00d08213 100644 --- a/Sources/DOMKit/WebIDL/MutationRecord.swift +++ b/Sources/DOMKit/WebIDL/MutationRecord.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class MutationRecord: JSBridgedClass { diff --git a/Sources/DOMKit/WebIDL/NamedNodeMap.swift b/Sources/DOMKit/WebIDL/NamedNodeMap.swift index f0f85c62..736320d8 100644 --- a/Sources/DOMKit/WebIDL/NamedNodeMap.swift +++ b/Sources/DOMKit/WebIDL/NamedNodeMap.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class NamedNodeMap: JSBridgedClass { @@ -15,30 +13,34 @@ public class NamedNodeMap: JSBridgedClass { self.jsObject = jsObject } - public subscript(_: String) -> Attr?? { - return jsObject.qualifiedName.fromJSValue()! - } - @ReadonlyAttribute public var length: UInt32 + public subscript(key: Int) -> Attr? { + jsObject[key].fromJSValue() + } + + public subscript(key: String) -> Attr? { + jsObject[key].fromJSValue() + } + public func getNamedItemNS(namespace: String?, localName: String) -> Attr? { - return jsObject.getNamedItemNS!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject["getNamedItemNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func setNamedItem(attr: Attr) -> Attr? { - return jsObject.setNamedItem!(attr.jsValue()).fromJSValue()! + jsObject["setNamedItem"]!(attr.jsValue()).fromJSValue()! } public func setNamedItemNS(attr: Attr) -> Attr? { - return jsObject.setNamedItemNS!(attr.jsValue()).fromJSValue()! + jsObject["setNamedItemNS"]!(attr.jsValue()).fromJSValue()! } public func removeNamedItem(qualifiedName: String) -> Attr { - return jsObject.removeNamedItem!(qualifiedName.jsValue()).fromJSValue()! + jsObject["removeNamedItem"]!(qualifiedName.jsValue()).fromJSValue()! } public func removeNamedItemNS(namespace: String?, localName: String) -> Attr { - return jsObject.removeNamedItemNS!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject["removeNamedItemNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift new file mode 100644 index 00000000..40e14532 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Navigator: JSBridgedClass, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware { + public class var constructor: JSFunction { JSObject.global.Navigator.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift b/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift new file mode 100644 index 00000000..fe4538f3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorConcurrentHardware: JSBridgedClass {} +public extension NavigatorConcurrentHardware { + var hardwareConcurrency: UInt64 { ReadonlyAttribute["hardwareConcurrency", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift new file mode 100644 index 00000000..337366b2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift @@ -0,0 +1,15 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorContentUtils: JSBridgedClass {} +public extension NavigatorContentUtils { + func registerProtocolHandler(scheme: String, url: String) { + _ = jsObject["registerProtocolHandler"]!(scheme.jsValue(), url.jsValue()) + } + + func unregisterProtocolHandler(scheme: String, url: String) { + _ = jsObject["unregisterProtocolHandler"]!(scheme.jsValue(), url.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorCookies.swift b/Sources/DOMKit/WebIDL/NavigatorCookies.swift new file mode 100644 index 00000000..2b7bcfd3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorCookies.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorCookies: JSBridgedClass {} +public extension NavigatorCookies { + var cookieEnabled: Bool { ReadonlyAttribute["cookieEnabled", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorID.swift b/Sources/DOMKit/WebIDL/NavigatorID.swift new file mode 100644 index 00000000..8687d818 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorID.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorID: JSBridgedClass {} +public extension NavigatorID { + var appCodeName: String { ReadonlyAttribute["appCodeName", in: jsObject] } + + var appName: String { ReadonlyAttribute["appName", in: jsObject] } + + var appVersion: String { ReadonlyAttribute["appVersion", in: jsObject] } + + var platform: String { ReadonlyAttribute["platform", in: jsObject] } + + var product: String { ReadonlyAttribute["product", in: jsObject] } + + var productSub: String { ReadonlyAttribute["productSub", in: jsObject] } + + var userAgent: String { ReadonlyAttribute["userAgent", in: jsObject] } + + var vendor: String { ReadonlyAttribute["vendor", in: jsObject] } + + var vendorSub: String { ReadonlyAttribute["vendorSub", in: jsObject] } + + func taintEnabled() -> Bool { + jsObject["taintEnabled"]!().fromJSValue()! + } + + var oscpu: String { ReadonlyAttribute["oscpu", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorLanguage.swift b/Sources/DOMKit/WebIDL/NavigatorLanguage.swift new file mode 100644 index 00000000..bdc16494 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorLanguage.swift @@ -0,0 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorLanguage: JSBridgedClass {} +public extension NavigatorLanguage { + var language: String { ReadonlyAttribute["language", in: jsObject] } + + var languages: [String] { ReadonlyAttribute["languages", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorOnLine.swift b/Sources/DOMKit/WebIDL/NavigatorOnLine.swift new file mode 100644 index 00000000..88523a00 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorOnLine.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorOnLine: JSBridgedClass {} +public extension NavigatorOnLine { + var onLine: Bool { ReadonlyAttribute["onLine", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift new file mode 100644 index 00000000..0e1534ef --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift @@ -0,0 +1,17 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorPlugins: JSBridgedClass {} +public extension NavigatorPlugins { + var plugins: PluginArray { ReadonlyAttribute["plugins", in: jsObject] } + + var mimeTypes: MimeTypeArray { ReadonlyAttribute["mimeTypes", in: jsObject] } + + func javaEnabled() -> Bool { + jsObject["javaEnabled"]!().fromJSValue()! + } + + var pdfViewerEnabled: Bool { ReadonlyAttribute["pdfViewerEnabled", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/Node.swift b/Sources/DOMKit/WebIDL/Node.swift index 8a965825..25f6d100 100644 --- a/Sources/DOMKit/WebIDL/Node.swift +++ b/Sources/DOMKit/WebIDL/Node.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class Node: EventTarget { @@ -26,29 +24,29 @@ public class Node: EventTarget { super.init(unsafelyWrapping: jsObject) } - public let ELEMENT_NODE: UInt16 = 1 + public static let ELEMENT_NODE: UInt16 = 1 - public let ATTRIBUTE_NODE: UInt16 = 2 + public static let ATTRIBUTE_NODE: UInt16 = 2 - public let TEXT_NODE: UInt16 = 3 + public static let TEXT_NODE: UInt16 = 3 - public let CDATA_SECTION_NODE: UInt16 = 4 + public static let CDATA_SECTION_NODE: UInt16 = 4 - public let ENTITY_REFERENCE_NODE: UInt16 = 5 + public static let ENTITY_REFERENCE_NODE: UInt16 = 5 - public let ENTITY_NODE: UInt16 = 6 + public static let ENTITY_NODE: UInt16 = 6 - public let PROCESSING_INSTRUCTION_NODE: UInt16 = 7 + public static let PROCESSING_INSTRUCTION_NODE: UInt16 = 7 - public let COMMENT_NODE: UInt16 = 8 + public static let COMMENT_NODE: UInt16 = 8 - public let DOCUMENT_NODE: UInt16 = 9 + public static let DOCUMENT_NODE: UInt16 = 9 - public let DOCUMENT_TYPE_NODE: UInt16 = 10 + public static let DOCUMENT_TYPE_NODE: UInt16 = 10 - public let DOCUMENT_FRAGMENT_NODE: UInt16 = 11 + public static let DOCUMENT_FRAGMENT_NODE: UInt16 = 11 - public let NOTATION_NODE: UInt16 = 12 + public static let NOTATION_NODE: UInt16 = 12 @ReadonlyAttribute public var nodeType: UInt16 @@ -65,8 +63,8 @@ public class Node: EventTarget { @ReadonlyAttribute public var ownerDocument: Document? - public func getRootNode(options: GetRootNodeOptions = [:]) -> Node { - return jsObject.getRootNode!(options.jsValue()).fromJSValue()! + public func getRootNode(options: GetRootNodeOptions? = nil) -> Self { + jsObject["getRootNode"]!(options?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -76,7 +74,7 @@ public class Node: EventTarget { public var parentElement: Element? public func hasChildNodes() -> Bool { - return jsObject.hasChildNodes!().fromJSValue()! + jsObject["hasChildNodes"]!().fromJSValue()! } @ReadonlyAttribute @@ -101,66 +99,66 @@ public class Node: EventTarget { public var textContent: String? public func normalize() { - _ = jsObject.normalize!() + _ = jsObject["normalize"]!() } - public func cloneNode(deep: Bool = false) -> Node { - return jsObject.cloneNode!(deep.jsValue()).fromJSValue()! + public func cloneNode(deep: Bool? = nil) -> Self { + jsObject["cloneNode"]!(deep?.jsValue() ?? .undefined).fromJSValue()! } public func isEqualNode(otherNode: Node?) -> Bool { - return jsObject.isEqualNode!(otherNode.jsValue()).fromJSValue()! + jsObject["isEqualNode"]!(otherNode.jsValue()).fromJSValue()! } public func isSameNode(otherNode: Node?) -> Bool { - return jsObject.isSameNode!(otherNode.jsValue()).fromJSValue()! + jsObject["isSameNode"]!(otherNode.jsValue()).fromJSValue()! } - public let DOCUMENT_POSITION_DISCONNECTED: UInt16 = 1 + public static let DOCUMENT_POSITION_DISCONNECTED: UInt16 = 0x01 - public let DOCUMENT_POSITION_PRECEDING: UInt16 = 2 + public static let DOCUMENT_POSITION_PRECEDING: UInt16 = 0x02 - public let DOCUMENT_POSITION_FOLLOWING: UInt16 = 4 + public static let DOCUMENT_POSITION_FOLLOWING: UInt16 = 0x04 - public let DOCUMENT_POSITION_CONTAINS: UInt16 = 8 + public static let DOCUMENT_POSITION_CONTAINS: UInt16 = 0x08 - public let DOCUMENT_POSITION_CONTAINED_BY: UInt16 = 16 + public static let DOCUMENT_POSITION_CONTAINED_BY: UInt16 = 0x10 - public let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: UInt16 = 32 + public static let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: UInt16 = 0x20 public func compareDocumentPosition(other: Node) -> UInt16 { - return jsObject.compareDocumentPosition!(other.jsValue()).fromJSValue()! + jsObject["compareDocumentPosition"]!(other.jsValue()).fromJSValue()! } public func contains(other: Node?) -> Bool { - return jsObject.contains!(other.jsValue()).fromJSValue()! + jsObject["contains"]!(other.jsValue()).fromJSValue()! } public func lookupPrefix(namespace: String?) -> String? { - return jsObject.lookupPrefix!(namespace.jsValue()).fromJSValue()! + jsObject["lookupPrefix"]!(namespace.jsValue()).fromJSValue()! } public func lookupNamespaceURI(prefix: String?) -> String? { - return jsObject.lookupNamespaceURI!(prefix.jsValue()).fromJSValue()! + jsObject["lookupNamespaceURI"]!(prefix.jsValue()).fromJSValue()! } public func isDefaultNamespace(namespace: String?) -> Bool { - return jsObject.isDefaultNamespace!(namespace.jsValue()).fromJSValue()! + jsObject["isDefaultNamespace"]!(namespace.jsValue()).fromJSValue()! } - public func insertBefore(node: Node, child: Node?) -> Node { - return jsObject.insertBefore!(node.jsValue(), child.jsValue()).fromJSValue()! + public func insertBefore(node: Node, child: Node?) -> Self { + jsObject["insertBefore"]!(node.jsValue(), child.jsValue()).fromJSValue()! } - public func appendChild(node: Node) -> Node { - return jsObject.appendChild!(node.jsValue()).fromJSValue()! + public func appendChild(node: Node) -> Self { + jsObject["appendChild"]!(node.jsValue()).fromJSValue()! } - public func replaceChild(node: Node, child: Node) -> Node { - return jsObject.replaceChild!(node.jsValue(), child.jsValue()).fromJSValue()! + public func replaceChild(node: Node, child: Node) -> Self { + jsObject["replaceChild"]!(node.jsValue(), child.jsValue()).fromJSValue()! } - public func removeChild(child: Node) -> Node { - return jsObject.removeChild!(child.jsValue()).fromJSValue()! + public func removeChild(child: Node) -> Self { + jsObject["removeChild"]!(child.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NodeFilter.swift b/Sources/DOMKit/WebIDL/NodeFilter.swift deleted file mode 100644 index 5a048aa0..00000000 --- a/Sources/DOMKit/WebIDL/NodeFilter.swift +++ /dev/null @@ -1,76 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public protocol NodeFilter: JSBridgedType { - func acceptNode(node: Node) -> UInt16 -} - -public extension NodeFilter { - var FILTER_ACCEPT: UInt16 { - return 1 - } - - var FILTER_REJECT: UInt16 { - return 2 - } - - var FILTER_SKIP: UInt16 { - return 3 - } - - var SHOW_ALL: UInt32 { - return 4_294_967_295 - } - - var SHOW_ELEMENT: UInt32 { - return 1 - } - - var SHOW_ATTRIBUTE: UInt32 { - return 2 - } - - var SHOW_TEXT: UInt32 { - return 4 - } - - var SHOW_CDATA_SECTION: UInt32 { - return 8 - } - - var SHOW_ENTITY_REFERENCE: UInt32 { - return 16 - } - - var SHOW_ENTITY: UInt32 { - return 32 - } - - var SHOW_PROCESSING_INSTRUCTION: UInt32 { - return 64 - } - - var SHOW_COMMENT: UInt32 { - return 128 - } - - var SHOW_DOCUMENT: UInt32 { - return 256 - } - - var SHOW_DOCUMENT_TYPE: UInt32 { - return 512 - } - - var SHOW_DOCUMENT_FRAGMENT: UInt32 { - return 1024 - } - - var SHOW_NOTATION: UInt32 { - return 2048 - } -} diff --git a/Sources/DOMKit/WebIDL/NodeIterator.swift b/Sources/DOMKit/WebIDL/NodeIterator.swift index f4615b30..78c31a68 100644 --- a/Sources/DOMKit/WebIDL/NodeIterator.swift +++ b/Sources/DOMKit/WebIDL/NodeIterator.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class NodeIterator: JSBridgedClass { @@ -30,19 +28,17 @@ public class NodeIterator: JSBridgedClass { @ReadonlyAttribute public var whatToShow: UInt32 - public var filter: NodeFilter? { - return jsObject.filter.fromJSValue()! as AnyNodeFilter? - } + // XXX: member 'filter' is ignored public func nextNode() -> Node? { - return jsObject.nextNode!().fromJSValue()! + jsObject["nextNode"]!().fromJSValue()! } public func previousNode() -> Node? { - return jsObject.previousNode!().fromJSValue()! + jsObject["previousNode"]!().fromJSValue()! } public func detach() { - _ = jsObject.detach!() + _ = jsObject["detach"]!() } } diff --git a/Sources/DOMKit/WebIDL/NodeList.swift b/Sources/DOMKit/WebIDL/NodeList.swift index c3746e46..3b469c2b 100644 --- a/Sources/DOMKit/WebIDL/NodeList.swift +++ b/Sources/DOMKit/WebIDL/NodeList.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class NodeList: JSBridgedClass, Sequence { @@ -15,10 +13,15 @@ public class NodeList: JSBridgedClass, Sequence { self.jsObject = jsObject } - public typealias Element = Node + public subscript(key: Int) -> Node? { + jsObject[key].fromJSValue() + } @ReadonlyAttribute public var length: UInt32 - public func makeIterator() -> ValueIterableIterator { return ValueIterableIterator(sequence: self) } + public typealias Element = Node + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } } diff --git a/Sources/DOMKit/WebIDL/NodeOrString.swift b/Sources/DOMKit/WebIDL/NodeOrString.swift deleted file mode 100644 index 76e353ee..00000000 --- a/Sources/DOMKit/WebIDL/NodeOrString.swift +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum NodeOrString: JSBridgedType, ExpressibleByStringLiteral { - case node(Node) - case string(String) - - public init?(from value: JSValue) { - if let decoded: Node = value.fromJSValue() { - self = .node(decoded) - } else if let decoded: String = value.fromJSValue() { - self = .string(decoded) - } else { - return nil - } - } - - public init(stringLiteral value: String) { - self = .string(value) - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .node(v): return v.jsValue() - case let .string(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift b/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift index 5e9e0325..2ffa5876 100644 --- a/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift +++ b/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift @@ -1,18 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol NonDocumentTypeChildNode: JSBridgedClass {} - public extension NonDocumentTypeChildNode { - var previousElementSibling: Element? { - return jsObject.previousElementSibling.fromJSValue()! - } + var previousElementSibling: Element? { ReadonlyAttribute["previousElementSibling", in: jsObject] } - var nextElementSibling: Element? { - return jsObject.nextElementSibling.fromJSValue()! - } + var nextElementSibling: Element? { ReadonlyAttribute["nextElementSibling", in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NonElementParentNode.swift b/Sources/DOMKit/WebIDL/NonElementParentNode.swift index 2ed2edc3..8a2b2c58 100644 --- a/Sources/DOMKit/WebIDL/NonElementParentNode.swift +++ b/Sources/DOMKit/WebIDL/NonElementParentNode.swift @@ -1,14 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol NonElementParentNode: JSBridgedClass {} - public extension NonElementParentNode { func getElementById(elementId: String) -> Element? { - return jsObject.getElementById!(elementId.jsValue()).fromJSValue()! + jsObject["getElementById"]!(elementId.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift new file mode 100644 index 00000000..9aa81aed --- /dev/null +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OffscreenCanvas: EventTarget { + override public class var constructor: JSFunction { JSObject.global.OffscreenCanvas.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _oncontextlost = ClosureAttribute.Optional1(jsObject: jsObject, name: "oncontextlost") + _oncontextrestored = ClosureAttribute.Optional1(jsObject: jsObject, name: "oncontextrestored") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(width: UInt64, height: UInt64) { + self.init(unsafelyWrapping: Self.constructor.new(width.jsValue(), height.jsValue())) + } + + @ReadWriteAttribute + public var width: UInt64 + + @ReadWriteAttribute + public var height: UInt64 + + public func getContext(contextId: OffscreenRenderingContextId, options: JSValue? = nil) -> OffscreenRenderingContext? { + jsObject["getContext"]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func transferToImageBitmap() -> ImageBitmap { + jsObject["transferToImageBitmap"]!().fromJSValue()! + } + + public func convertToBlob(options: ImageEncodeOptions? = nil) -> JSPromise { + jsObject["convertToBlob"]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func convertToBlob(options: ImageEncodeOptions? = nil) async throws -> Blob { + let _promise: JSPromise = jsObject["convertToBlob"]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var oncontextlost: EventHandler + + @ClosureAttribute.Optional1 + public var oncontextrestored: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift new file mode 100644 index 00000000..ef39a7d8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OffscreenCanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { + public class var constructor: JSFunction { JSObject.global.OffscreenCanvasRenderingContext2D.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _canvas = ReadonlyAttribute(jsObject: jsObject, name: "canvas") + self.jsObject = jsObject + } + + public func commit() { + _ = jsObject["commit"]!() + } + + @ReadonlyAttribute + public var canvas: OffscreenCanvas +} diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift new file mode 100644 index 00000000..7e9b2137 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum OffscreenRenderingContextId: String, JSValueCompatible { + case _2d = "2d" + case bitmaprenderer + case webgl + case webgl2 + case webgpu + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/OnBeforeUnloadEventHandler.swift b/Sources/DOMKit/WebIDL/OnBeforeUnloadEventHandler.swift deleted file mode 100644 index d85485ba..00000000 --- a/Sources/DOMKit/WebIDL/OnBeforeUnloadEventHandler.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? diff --git a/Sources/DOMKit/WebIDL/OnBeforeUnloadEventHandlerNonNull.swift b/Sources/DOMKit/WebIDL/OnBeforeUnloadEventHandlerNonNull.swift deleted file mode 100644 index 94daafd6..00000000 --- a/Sources/DOMKit/WebIDL/OnBeforeUnloadEventHandlerNonNull.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias OnBeforeUnloadEventHandlerNonNull = ((Event) -> String?) diff --git a/Sources/DOMKit/WebIDL/OnErrorEventHandler.swift b/Sources/DOMKit/WebIDL/OnErrorEventHandler.swift deleted file mode 100644 index d9227e1c..00000000 --- a/Sources/DOMKit/WebIDL/OnErrorEventHandler.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? diff --git a/Sources/DOMKit/WebIDL/OnErrorEventHandlerNonNull.swift b/Sources/DOMKit/WebIDL/OnErrorEventHandlerNonNull.swift deleted file mode 100644 index 3bfaffe1..00000000 --- a/Sources/DOMKit/WebIDL/OnErrorEventHandlerNonNull.swift +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public typealias OnErrorEventHandlerNonNull = ((EventOrString, String, UInt32, UInt32, JSValue) -> JSValue) diff --git a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift new file mode 100644 index 00000000..7cc2eacc --- /dev/null +++ b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PageTransitionEvent: Event { + override public class var constructor: JSFunction { JSObject.global.PageTransitionEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _persisted = ReadonlyAttribute(jsObject: jsObject, name: "persisted") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PageTransitionEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var persisted: Bool +} diff --git a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift new file mode 100644 index 00000000..ee1d0d8f --- /dev/null +++ b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PageTransitionEventInit: JSObject { + public init(persisted: Bool) { + let object = JSObject.global.Object.function!.new() + object["persisted"] = persisted.jsValue() + _persisted = ReadWriteAttribute(jsObject: object, name: "persisted") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var persisted: Bool +} diff --git a/Sources/DOMKit/WebIDL/ParentNode.swift b/Sources/DOMKit/WebIDL/ParentNode.swift index 4a8d817b..65ffb5ff 100644 --- a/Sources/DOMKit/WebIDL/ParentNode.swift +++ b/Sources/DOMKit/WebIDL/ParentNode.swift @@ -1,50 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol ParentNode: JSBridgedClass {} - public extension ParentNode { - var children: HTMLCollection { - return jsObject.children.fromJSValue()! - } - - var firstElementChild: Element? { - return jsObject.firstElementChild.fromJSValue()! - } + var children: HTMLCollection { ReadonlyAttribute["children", in: jsObject] } - var lastElementChild: Element? { - return jsObject.lastElementChild.fromJSValue()! - } + var firstElementChild: Element? { ReadonlyAttribute["firstElementChild", in: jsObject] } - var childElementCount: UInt32 { - return jsObject.childElementCount.fromJSValue()! - } + var lastElementChild: Element? { ReadonlyAttribute["lastElementChild", in: jsObject] } - func prepend(nodes: NodeOrString...) { - _ = jsObject.prepend!(nodes.jsValue()) - } + var childElementCount: UInt32 { ReadonlyAttribute["childElementCount", in: jsObject] } - func prepend() { - _ = jsObject.prepend!() + func prepend(nodes: __UNSUPPORTED_UNION__...) { + _ = jsObject["prepend"]!(nodes.jsValue()) } - func append(nodes: NodeOrString...) { - _ = jsObject.append!(nodes.jsValue()) + func append(nodes: __UNSUPPORTED_UNION__...) { + _ = jsObject["append"]!(nodes.jsValue()) } - func append() { - _ = jsObject.append!() + func replaceChildren(nodes: __UNSUPPORTED_UNION__...) { + _ = jsObject["replaceChildren"]!(nodes.jsValue()) } func querySelector(selectors: String) -> Element? { - return jsObject.querySelector!(selectors.jsValue()).fromJSValue()! + jsObject["querySelector"]!(selectors.jsValue()).fromJSValue()! } func querySelectorAll(selectors: String) -> NodeList { - return jsObject.querySelectorAll!(selectors.jsValue()).fromJSValue()! + jsObject["querySelectorAll"]!(selectors.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift new file mode 100644 index 00000000..67a0633f --- /dev/null +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Path2D: JSBridgedClass, CanvasPath { + public class var constructor: JSFunction { JSObject.global.Path2D.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(path: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(path?.jsValue() ?? .undefined)) + } + + public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { + _ = jsObject["addPath"]!(path.jsValue(), transform?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index 212be2df..ef5c32da 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -1,3 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop import JavaScriptKit public class Performance: EventTarget { diff --git a/Sources/DOMKit/WebIDL/Plugin.swift b/Sources/DOMKit/WebIDL/Plugin.swift new file mode 100644 index 00000000..cd58bc54 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Plugin.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Plugin: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.Plugin.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: "name") + _description = ReadonlyAttribute(jsObject: jsObject, name: "description") + _filename = ReadonlyAttribute(jsObject: jsObject, name: "filename") + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var description: String + + @ReadonlyAttribute + public var filename: String + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> MimeType? { + jsObject[key].fromJSValue() + } + + public subscript(key: String) -> MimeType? { + jsObject[key].fromJSValue() + } +} diff --git a/Sources/DOMKit/WebIDL/PluginArray.swift b/Sources/DOMKit/WebIDL/PluginArray.swift new file mode 100644 index 00000000..8492a4a6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PluginArray.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PluginArray: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.PluginArray.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + public func refresh() { + _ = jsObject["refresh"]!() + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> Plugin? { + jsObject[key].fromJSValue() + } + + public subscript(key: String) -> Plugin? { + jsObject[key].fromJSValue() + } +} diff --git a/Sources/DOMKit/WebIDL/PopStateEvent.swift b/Sources/DOMKit/WebIDL/PopStateEvent.swift new file mode 100644 index 00000000..6bbd1670 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PopStateEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PopStateEvent: Event { + override public class var constructor: JSFunction { JSObject.global.PopStateEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: "state") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PopStateEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var state: JSValue +} diff --git a/Sources/DOMKit/WebIDL/PopStateEventInit.swift b/Sources/DOMKit/WebIDL/PopStateEventInit.swift new file mode 100644 index 00000000..fc0da65a --- /dev/null +++ b/Sources/DOMKit/WebIDL/PopStateEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PopStateEventInit: JSObject { + public init(state: JSValue) { + let object = JSObject.global.Object.function!.new() + object["state"] = state.jsValue() + _state = ReadWriteAttribute(jsObject: object, name: "state") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var state: JSValue +} diff --git a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift new file mode 100644 index 00000000..c8d93748 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PredefinedColorSpace: String, JSValueCompatible { + case srgb + case displayP3 = "display-p3" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift new file mode 100644 index 00000000..a616a6b9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PremultiplyAlpha: String, JSValueCompatible { + case none + case premultiply + case `default` + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift index 8db31501..7b46deee 100644 --- a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift +++ b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift @@ -1,11 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit -public class ProcessingInstruction: CharacterData { +public class ProcessingInstruction: CharacterData, LinkStyle { override public class var constructor: JSFunction { JSObject.global.ProcessingInstruction.function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/ProgressEvent.swift b/Sources/DOMKit/WebIDL/ProgressEvent.swift new file mode 100644 index 00000000..9c51e3bd --- /dev/null +++ b/Sources/DOMKit/WebIDL/ProgressEvent.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ProgressEvent: Event { + override public class var constructor: JSFunction { JSObject.global.ProgressEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _lengthComputable = ReadonlyAttribute(jsObject: jsObject, name: "lengthComputable") + _loaded = ReadonlyAttribute(jsObject: jsObject, name: "loaded") + _total = ReadonlyAttribute(jsObject: jsObject, name: "total") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: ProgressEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var lengthComputable: Bool + + @ReadonlyAttribute + public var loaded: UInt64 + + @ReadonlyAttribute + public var total: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/ProgressEventInit.swift b/Sources/DOMKit/WebIDL/ProgressEventInit.swift new file mode 100644 index 00000000..a6be450b --- /dev/null +++ b/Sources/DOMKit/WebIDL/ProgressEventInit.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ProgressEventInit: JSObject { + public init(lengthComputable: Bool, loaded: UInt64, total: UInt64) { + let object = JSObject.global.Object.function!.new() + object["lengthComputable"] = lengthComputable.jsValue() + object["loaded"] = loaded.jsValue() + object["total"] = total.jsValue() + _lengthComputable = ReadWriteAttribute(jsObject: object, name: "lengthComputable") + _loaded = ReadWriteAttribute(jsObject: object, name: "loaded") + _total = ReadWriteAttribute(jsObject: object, name: "total") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var lengthComputable: Bool + + @ReadWriteAttribute + public var loaded: UInt64 + + @ReadWriteAttribute + public var total: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift new file mode 100644 index 00000000..00248652 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PromiseRejectionEvent: Event { + override public class var constructor: JSFunction { JSObject.global.PromiseRejectionEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _promise = ReadonlyAttribute(jsObject: jsObject, name: "promise") + _reason = ReadonlyAttribute(jsObject: jsObject, name: "reason") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PromiseRejectionEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var promise: JSPromise + + @ReadonlyAttribute + public var reason: JSValue +} diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift new file mode 100644 index 00000000..6e62ec34 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PromiseRejectionEventInit: JSObject { + public init(promise: JSPromise, reason: JSValue) { + let object = JSObject.global.Object.function!.new() + object["promise"] = promise.jsValue() + object["reason"] = reason.jsValue() + _promise = ReadWriteAttribute(jsObject: object, name: "promise") + _reason = ReadWriteAttribute(jsObject: object, name: "reason") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var promise: JSPromise + + @ReadWriteAttribute + public var reason: JSValue +} diff --git a/Sources/DOMKit/WebIDL/QueuingStrategy.swift b/Sources/DOMKit/WebIDL/QueuingStrategy.swift new file mode 100644 index 00000000..7990e769 --- /dev/null +++ b/Sources/DOMKit/WebIDL/QueuingStrategy.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class QueuingStrategy: JSObject { + public init(highWaterMark: Double, size: @escaping QueuingStrategySize) { + let object = JSObject.global.Object.function!.new() + object["highWaterMark"] = highWaterMark.jsValue() + ClosureAttribute.Required1["size", in: object] = size + _highWaterMark = ReadWriteAttribute(jsObject: object, name: "highWaterMark") + _size = ClosureAttribute.Required1(jsObject: object, name: "size") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var highWaterMark: Double + + @ClosureAttribute.Required1 + public var size: QueuingStrategySize +} diff --git a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift new file mode 100644 index 00000000..98e3ffbf --- /dev/null +++ b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class QueuingStrategyInit: JSObject { + public init(highWaterMark: Double) { + let object = JSObject.global.Object.function!.new() + object["highWaterMark"] = highWaterMark.jsValue() + _highWaterMark = ReadWriteAttribute(jsObject: object, name: "highWaterMark") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var highWaterMark: Double +} diff --git a/Sources/DOMKit/WebIDL/RadioNodeList.swift b/Sources/DOMKit/WebIDL/RadioNodeList.swift index e8f8c3d0..e370180d 100644 --- a/Sources/DOMKit/WebIDL/RadioNodeList.swift +++ b/Sources/DOMKit/WebIDL/RadioNodeList.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class RadioNodeList: NodeList { diff --git a/Sources/DOMKit/WebIDL/RadioNodeListOrElement.swift b/Sources/DOMKit/WebIDL/RadioNodeListOrElement.swift deleted file mode 100644 index 53644ae3..00000000 --- a/Sources/DOMKit/WebIDL/RadioNodeListOrElement.swift +++ /dev/null @@ -1,30 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum RadioNodeListOrElement: JSBridgedType { - case radioNodeList(RadioNodeList) - case element(Element) - - public init?(from value: JSValue) { - if let decoded: RadioNodeList = value.fromJSValue() { - self = .radioNodeList(decoded) - } else if let decoded: Element = value.fromJSValue() { - self = .element(decoded) - } else { - return nil - } - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .radioNodeList(v): return v.jsValue() - case let .element(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 4d72be56..3ac0e8fc 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class Range: AbstractRange { @@ -14,97 +12,101 @@ public class Range: AbstractRange { } public convenience init() { - self.init(unsafelyWrapping: Range.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } @ReadonlyAttribute public var commonAncestorContainer: Node public func setStart(node: Node, offset: UInt32) { - _ = jsObject.setStart!(node.jsValue(), offset.jsValue()) + _ = jsObject["setStart"]!(node.jsValue(), offset.jsValue()) } public func setEnd(node: Node, offset: UInt32) { - _ = jsObject.setEnd!(node.jsValue(), offset.jsValue()) + _ = jsObject["setEnd"]!(node.jsValue(), offset.jsValue()) } public func setStartBefore(node: Node) { - _ = jsObject.setStartBefore!(node.jsValue()) + _ = jsObject["setStartBefore"]!(node.jsValue()) } public func setStartAfter(node: Node) { - _ = jsObject.setStartAfter!(node.jsValue()) + _ = jsObject["setStartAfter"]!(node.jsValue()) } public func setEndBefore(node: Node) { - _ = jsObject.setEndBefore!(node.jsValue()) + _ = jsObject["setEndBefore"]!(node.jsValue()) } public func setEndAfter(node: Node) { - _ = jsObject.setEndAfter!(node.jsValue()) + _ = jsObject["setEndAfter"]!(node.jsValue()) } - public func collapse(toStart: Bool = false) { - _ = jsObject.collapse!(toStart.jsValue()) + public func collapse(toStart: Bool? = nil) { + _ = jsObject["collapse"]!(toStart?.jsValue() ?? .undefined) } public func selectNode(node: Node) { - _ = jsObject.selectNode!(node.jsValue()) + _ = jsObject["selectNode"]!(node.jsValue()) } public func selectNodeContents(node: Node) { - _ = jsObject.selectNodeContents!(node.jsValue()) + _ = jsObject["selectNodeContents"]!(node.jsValue()) } - public let START_TO_START: UInt16 = 0 + public static let START_TO_START: UInt16 = 0 - public let START_TO_END: UInt16 = 1 + public static let START_TO_END: UInt16 = 1 - public let END_TO_END: UInt16 = 2 + public static let END_TO_END: UInt16 = 2 - public let END_TO_START: UInt16 = 3 + public static let END_TO_START: UInt16 = 3 public func compareBoundaryPoints(how: UInt16, sourceRange: Range) -> Int16 { - return jsObject.compareBoundaryPoints!(how.jsValue(), sourceRange.jsValue()).fromJSValue()! + jsObject["compareBoundaryPoints"]!(how.jsValue(), sourceRange.jsValue()).fromJSValue()! } public func deleteContents() { - _ = jsObject.deleteContents!() + _ = jsObject["deleteContents"]!() } public func extractContents() -> DocumentFragment { - return jsObject.extractContents!().fromJSValue()! + jsObject["extractContents"]!().fromJSValue()! } public func cloneContents() -> DocumentFragment { - return jsObject.cloneContents!().fromJSValue()! + jsObject["cloneContents"]!().fromJSValue()! } public func insertNode(node: Node) { - _ = jsObject.insertNode!(node.jsValue()) + _ = jsObject["insertNode"]!(node.jsValue()) } public func surroundContents(newParent: Node) { - _ = jsObject.surroundContents!(newParent.jsValue()) + _ = jsObject["surroundContents"]!(newParent.jsValue()) } - public func cloneRange() -> Range { - return jsObject.cloneRange!().fromJSValue()! + public func cloneRange() -> Self { + jsObject["cloneRange"]!().fromJSValue()! } public func detach() { - _ = jsObject.detach!() + _ = jsObject["detach"]!() } public func isPointInRange(node: Node, offset: UInt32) -> Bool { - return jsObject.isPointInRange!(node.jsValue(), offset.jsValue()).fromJSValue()! + jsObject["isPointInRange"]!(node.jsValue(), offset.jsValue()).fromJSValue()! } public func comparePoint(node: Node, offset: UInt32) -> Int16 { - return jsObject.comparePoint!(node.jsValue(), offset.jsValue()).fromJSValue()! + jsObject["comparePoint"]!(node.jsValue(), offset.jsValue()).fromJSValue()! } public func intersectsNode(node: Node) -> Bool { - return jsObject.intersectsNode!(node.jsValue()).fromJSValue()! + jsObject["intersectsNode"]!(node.jsValue()).fromJSValue()! + } + + public var description: String { + jsObject["toString"]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift new file mode 100644 index 00000000..a441afcb --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableByteStreamController: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.ReadableByteStreamController.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _byobRequest = ReadonlyAttribute(jsObject: jsObject, name: "byobRequest") + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: "desiredSize") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var byobRequest: ReadableStreamBYOBRequest? + + @ReadonlyAttribute + public var desiredSize: Double? + + public func close() { + _ = jsObject["close"]!() + } + + public func enqueue(chunk: ArrayBufferView) { + _ = jsObject["enqueue"]!(chunk.jsValue()) + } + + public func error(e: JSValue? = nil) { + _ = jsObject["error"]!(e?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStream.swift b/Sources/DOMKit/WebIDL/ReadableStream.swift new file mode 100644 index 00000000..b135fa58 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableStream: JSBridgedClass, AsyncSequence { + public class var constructor: JSFunction { JSObject.global.ReadableStream.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _locked = ReadonlyAttribute(jsObject: jsObject, name: "locked") + self.jsObject = jsObject + } + + public convenience init(underlyingSource: JSObject? = nil, strategy: QueuingStrategy? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(underlyingSource?.jsValue() ?? .undefined, strategy?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var locked: Bool + + public func cancel(reason: JSValue? = nil) -> JSPromise { + jsObject["cancel"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func cancel(reason: JSValue? = nil) async throws { + let _promise: JSPromise = jsObject["cancel"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func getReader(options: ReadableStreamGetReaderOptions? = nil) -> ReadableStreamReader { + jsObject["getReader"]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func pipeThrough(transform: ReadableWritablePair, options: StreamPipeOptions? = nil) -> Self { + jsObject["pipeThrough"]!(transform.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) -> JSPromise { + jsObject["pipeTo"]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) async throws { + let _promise: JSPromise = jsObject["pipeTo"]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func tee() -> [ReadableStream] { + jsObject["tee"]!().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..7e3ca5c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableStreamBYOBReadResult: JSObject { + public init(value: __UNSUPPORTED_UNION__, done: Bool) { + let object = JSObject.global.Object.function!.new() + object["value"] = value.jsValue() + object["done"] = done.jsValue() + _value = ReadWriteAttribute(jsObject: object, name: "value") + _done = ReadWriteAttribute(jsObject: object, name: "done") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var value: __UNSUPPORTED_UNION__ + + @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..229053fa --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericReader { + public class var constructor: JSFunction { JSObject.global.ReadableStreamBYOBReader.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(stream: ReadableStream) { + self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue())) + } + + public func read(view: ArrayBufferView) -> JSPromise { + jsObject["read"]!(view.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func read(view: ArrayBufferView) async throws -> ReadableStreamBYOBReadResult { + let _promise: JSPromise = jsObject["read"]!(view.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func releaseLock() { + _ = jsObject["releaseLock"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift new file mode 100644 index 00000000..42039e7a --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableStreamBYOBRequest: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.ReadableStreamBYOBRequest.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _view = ReadonlyAttribute(jsObject: jsObject, name: "view") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var view: ArrayBufferView? + + public func respond(bytesWritten: UInt64) { + _ = jsObject["respond"]!(bytesWritten.jsValue()) + } + + public func respondWithNewView(view: ArrayBufferView) { + _ = jsObject["respondWithNewView"]!(view.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift new file mode 100644 index 00000000..be1343b9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableStreamDefaultController: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.ReadableStreamDefaultController.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: "desiredSize") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var desiredSize: Double? + + public func close() { + _ = jsObject["close"]!() + } + + public func enqueue(chunk: JSValue? = nil) { + _ = jsObject["enqueue"]!(chunk?.jsValue() ?? .undefined) + } + + public func error(e: JSValue? = nil) { + _ = jsObject["error"]!(e?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift new file mode 100644 index 00000000..3fd22dd7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableStreamDefaultReadResult: JSObject { + public init(value: JSValue, done: Bool) { + let object = JSObject.global.Object.function!.new() + object["value"] = value.jsValue() + object["done"] = done.jsValue() + _value = ReadWriteAttribute(jsObject: object, name: "value") + _done = ReadWriteAttribute(jsObject: object, name: "done") + super.init(cloning: 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..1e032f13 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericReader { + public class var constructor: JSFunction { JSObject.global.ReadableStreamDefaultReader.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(stream: ReadableStream) { + self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue())) + } + + public func read() -> JSPromise { + jsObject["read"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func read() async throws -> ReadableStreamDefaultReadResult { + let _promise: JSPromise = jsObject["read"]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func releaseLock() { + _ = jsObject["releaseLock"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift new file mode 100644 index 00000000..6f8b55c9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol ReadableStreamGenericReader: JSBridgedClass {} +public extension ReadableStreamGenericReader { + var closed: JSPromise { ReadonlyAttribute["closed", in: jsObject] } + + func cancel(reason: JSValue? = nil) -> JSPromise { + jsObject["cancel"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func cancel(reason: JSValue? = nil) async throws { + let _promise: JSPromise = jsObject["cancel"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift new file mode 100644 index 00000000..6dc03cf8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableStreamGetReaderOptions: JSObject { + public init(mode: ReadableStreamReaderMode) { + let object = JSObject.global.Object.function!.new() + object["mode"] = mode.jsValue() + _mode = ReadWriteAttribute(jsObject: object, name: "mode") + super.init(cloning: 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..2f158682 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableStreamIteratorOptions: JSObject { + public init(preventCancel: Bool) { + let object = JSObject.global.Object.function!.new() + object["preventCancel"] = preventCancel.jsValue() + _preventCancel = ReadWriteAttribute(jsObject: object, name: "preventCancel") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var preventCancel: Bool +} diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift new file mode 100644 index 00000000..23d696e6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift @@ -0,0 +1,17 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ReadableStreamReaderMode: String, JSValueCompatible { + case byob + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStreamType.swift b/Sources/DOMKit/WebIDL/ReadableStreamType.swift new file mode 100644 index 00000000..fe349e09 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamType.swift @@ -0,0 +1,17 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ReadableStreamType: String, JSValueCompatible { + case bytes + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift new file mode 100644 index 00000000..63d4e4a3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadableWritablePair: JSObject { + public init(readable: ReadableStream, writable: WritableStream) { + let object = JSObject.global.Object.function!.new() + object["readable"] = readable.jsValue() + object["writable"] = writable.jsValue() + _readable = ReadWriteAttribute(jsObject: object, name: "readable") + _writable = ReadWriteAttribute(jsObject: object, name: "writable") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var readable: ReadableStream + + @ReadWriteAttribute + public var writable: WritableStream +} diff --git a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift new file mode 100644 index 00000000..2d229054 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ReferrerPolicy: String, JSValueCompatible { + case _empty = "" + case noReferrer = "no-referrer" + case noReferrerWhenDowngrade = "no-referrer-when-downgrade" + case sameOrigin = "same-origin" + case origin + case strictOrigin = "strict-origin" + case originWhenCrossOrigin = "origin-when-cross-origin" + case strictOriginWhenCrossOrigin = "strict-origin-when-cross-origin" + case unsafeUrl = "unsafe-url" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift new file mode 100644 index 00000000..04362d04 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -0,0 +1,82 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Request: JSBridgedClass, Body { + public class var constructor: JSFunction { JSObject.global.Request.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _method = ReadonlyAttribute(jsObject: jsObject, name: "method") + _url = ReadonlyAttribute(jsObject: jsObject, name: "url") + _headers = ReadonlyAttribute(jsObject: jsObject, name: "headers") + _destination = ReadonlyAttribute(jsObject: jsObject, name: "destination") + _referrer = ReadonlyAttribute(jsObject: jsObject, name: "referrer") + _referrerPolicy = ReadonlyAttribute(jsObject: jsObject, name: "referrerPolicy") + _mode = ReadonlyAttribute(jsObject: jsObject, name: "mode") + _credentials = ReadonlyAttribute(jsObject: jsObject, name: "credentials") + _cache = ReadonlyAttribute(jsObject: jsObject, name: "cache") + _redirect = ReadonlyAttribute(jsObject: jsObject, name: "redirect") + _integrity = ReadonlyAttribute(jsObject: jsObject, name: "integrity") + _keepalive = ReadonlyAttribute(jsObject: jsObject, name: "keepalive") + _isReloadNavigation = ReadonlyAttribute(jsObject: jsObject, name: "isReloadNavigation") + _isHistoryNavigation = ReadonlyAttribute(jsObject: jsObject, name: "isHistoryNavigation") + _signal = ReadonlyAttribute(jsObject: jsObject, name: "signal") + self.jsObject = jsObject + } + + public convenience init(input: RequestInfo, init: RequestInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(input.jsValue(), `init`?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var method: String + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var headers: Headers + + @ReadonlyAttribute + public var destination: RequestDestination + + @ReadonlyAttribute + public var referrer: String + + @ReadonlyAttribute + public var referrerPolicy: ReferrerPolicy + + @ReadonlyAttribute + public var mode: RequestMode + + @ReadonlyAttribute + public var credentials: RequestCredentials + + @ReadonlyAttribute + public var cache: RequestCache + + @ReadonlyAttribute + public var redirect: RequestRedirect + + @ReadonlyAttribute + public var integrity: String + + @ReadonlyAttribute + public var keepalive: Bool + + @ReadonlyAttribute + public var isReloadNavigation: Bool + + @ReadonlyAttribute + public var isHistoryNavigation: Bool + + @ReadonlyAttribute + public var signal: AbortSignal + + public func clone() -> Self { + jsObject["clone"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/RequestCache.swift b/Sources/DOMKit/WebIDL/RequestCache.swift new file mode 100644 index 00000000..0b17dcb5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RequestCache.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RequestCache: String, JSValueCompatible { + case `default` + case noStore = "no-store" + case reload + case noCache = "no-cache" + case forceCache = "force-cache" + case onlyIfCached = "only-if-cached" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RequestCredentials.swift b/Sources/DOMKit/WebIDL/RequestCredentials.swift new file mode 100644 index 00000000..3bacfbb5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RequestCredentials.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RequestCredentials: String, JSValueCompatible { + case omit + case sameOrigin = "same-origin" + case include + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RequestDestination.swift b/Sources/DOMKit/WebIDL/RequestDestination.swift new file mode 100644 index 00000000..37ce3ca9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RequestDestination.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RequestDestination: String, JSValueCompatible { + case _empty = "" + case audio + case audioworklet + case document + case embed + case font + case frame + case iframe + case image + case manifest + case object + case paintworklet + case report + case script + case sharedworker + case style + case track + case video + case worker + case xslt + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RequestInit.swift b/Sources/DOMKit/WebIDL/RequestInit.swift new file mode 100644 index 00000000..4b2a2f28 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RequestInit.swift @@ -0,0 +1,76 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RequestInit: JSObject { + public init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue) { + let object = JSObject.global.Object.function!.new() + object["method"] = method.jsValue() + object["headers"] = headers.jsValue() + object["body"] = body.jsValue() + object["referrer"] = referrer.jsValue() + object["referrerPolicy"] = referrerPolicy.jsValue() + object["mode"] = mode.jsValue() + object["credentials"] = credentials.jsValue() + object["cache"] = cache.jsValue() + object["redirect"] = redirect.jsValue() + object["integrity"] = integrity.jsValue() + object["keepalive"] = keepalive.jsValue() + object["signal"] = signal.jsValue() + object["window"] = window.jsValue() + _method = ReadWriteAttribute(jsObject: object, name: "method") + _headers = ReadWriteAttribute(jsObject: object, name: "headers") + _body = ReadWriteAttribute(jsObject: object, name: "body") + _referrer = ReadWriteAttribute(jsObject: object, name: "referrer") + _referrerPolicy = ReadWriteAttribute(jsObject: object, name: "referrerPolicy") + _mode = ReadWriteAttribute(jsObject: object, name: "mode") + _credentials = ReadWriteAttribute(jsObject: object, name: "credentials") + _cache = ReadWriteAttribute(jsObject: object, name: "cache") + _redirect = ReadWriteAttribute(jsObject: object, name: "redirect") + _integrity = ReadWriteAttribute(jsObject: object, name: "integrity") + _keepalive = ReadWriteAttribute(jsObject: object, name: "keepalive") + _signal = ReadWriteAttribute(jsObject: object, name: "signal") + _window = ReadWriteAttribute(jsObject: object, name: "window") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var method: String + + @ReadWriteAttribute + public var headers: HeadersInit + + @ReadWriteAttribute + public var body: BodyInit? + + @ReadWriteAttribute + public var referrer: String + + @ReadWriteAttribute + public var referrerPolicy: ReferrerPolicy + + @ReadWriteAttribute + public var mode: RequestMode + + @ReadWriteAttribute + public var credentials: RequestCredentials + + @ReadWriteAttribute + public var cache: RequestCache + + @ReadWriteAttribute + public var redirect: RequestRedirect + + @ReadWriteAttribute + public var integrity: String + + @ReadWriteAttribute + public var keepalive: Bool + + @ReadWriteAttribute + public var signal: AbortSignal? + + @ReadWriteAttribute + public var window: JSValue +} diff --git a/Sources/DOMKit/WebIDL/RequestMode.swift b/Sources/DOMKit/WebIDL/RequestMode.swift new file mode 100644 index 00000000..93aea46c --- /dev/null +++ b/Sources/DOMKit/WebIDL/RequestMode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RequestMode: String, JSValueCompatible { + case navigate + case sameOrigin = "same-origin" + case noCors = "no-cors" + case cors + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RequestRedirect.swift b/Sources/DOMKit/WebIDL/RequestRedirect.swift new file mode 100644 index 00000000..d8181ab0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RequestRedirect.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RequestRedirect: String, JSValueCompatible { + case follow + case error + case manual + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ResizeQuality.swift b/Sources/DOMKit/WebIDL/ResizeQuality.swift new file mode 100644 index 00000000..9a2b5444 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ResizeQuality.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ResizeQuality: String, JSValueCompatible { + case pixelated + case low + case medium + case high + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Response.swift b/Sources/DOMKit/WebIDL/Response.swift new file mode 100644 index 00000000..4b3c8a3a --- /dev/null +++ b/Sources/DOMKit/WebIDL/Response.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Response: JSBridgedClass, Body { + public class var constructor: JSFunction { JSObject.global.Response.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _url = ReadonlyAttribute(jsObject: jsObject, name: "url") + _redirected = ReadonlyAttribute(jsObject: jsObject, name: "redirected") + _status = ReadonlyAttribute(jsObject: jsObject, name: "status") + _ok = ReadonlyAttribute(jsObject: jsObject, name: "ok") + _statusText = ReadonlyAttribute(jsObject: jsObject, name: "statusText") + _headers = ReadonlyAttribute(jsObject: jsObject, name: "headers") + self.jsObject = jsObject + } + + public convenience init(body: BodyInit? = nil, init: ResponseInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(body?.jsValue() ?? .undefined, `init`?.jsValue() ?? .undefined)) + } + + public static func error() -> Self { + constructor["error"]!().fromJSValue()! + } + + public static func redirect(url: String, status: UInt16? = nil) -> Self { + constructor["redirect"]!(url.jsValue(), status?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var type: ResponseType + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var redirected: Bool + + @ReadonlyAttribute + public var status: UInt16 + + @ReadonlyAttribute + public var ok: Bool + + @ReadonlyAttribute + public var statusText: String + + @ReadonlyAttribute + public var headers: Headers + + public func clone() -> Self { + jsObject["clone"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ResponseInit.swift b/Sources/DOMKit/WebIDL/ResponseInit.swift new file mode 100644 index 00000000..a20bbde8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ResponseInit.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ResponseInit: JSObject { + public init(status: UInt16, statusText: String, headers: HeadersInit) { + let object = JSObject.global.Object.function!.new() + object["status"] = status.jsValue() + object["statusText"] = statusText.jsValue() + object["headers"] = headers.jsValue() + _status = ReadWriteAttribute(jsObject: object, name: "status") + _statusText = ReadWriteAttribute(jsObject: object, name: "statusText") + _headers = ReadWriteAttribute(jsObject: object, name: "headers") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var status: UInt16 + + @ReadWriteAttribute + public var statusText: String + + @ReadWriteAttribute + public var headers: HeadersInit +} diff --git a/Sources/DOMKit/WebIDL/ResponseType.swift b/Sources/DOMKit/WebIDL/ResponseType.swift new file mode 100644 index 00000000..055b6c8b --- /dev/null +++ b/Sources/DOMKit/WebIDL/ResponseType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ResponseType: String, JSValueCompatible { + case basic + case cors + case `default` + case error + case opaque + case opaqueredirect + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ScrollRestoration.swift b/Sources/DOMKit/WebIDL/ScrollRestoration.swift new file mode 100644 index 00000000..125bebb8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollRestoration.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ScrollRestoration: String, JSValueCompatible { + case auto + case manual + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/SelectionMode.swift b/Sources/DOMKit/WebIDL/SelectionMode.swift new file mode 100644 index 00000000..2da070df --- /dev/null +++ b/Sources/DOMKit/WebIDL/SelectionMode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum SelectionMode: String, JSValueCompatible { + case select + case start + case end + case preserve + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ShadowRoot.swift b/Sources/DOMKit/WebIDL/ShadowRoot.swift index 97d45ea3..e60c1923 100644 --- a/Sources/DOMKit/WebIDL/ShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/ShadowRoot.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class ShadowRoot: DocumentFragment, DocumentOrShadowRoot { @@ -10,17 +8,25 @@ public class ShadowRoot: DocumentFragment, DocumentOrShadowRoot { public required init(unsafelyWrapping jsObject: JSObject) { _mode = ReadonlyAttribute(jsObject: jsObject, name: "mode") + _delegatesFocus = ReadonlyAttribute(jsObject: jsObject, name: "delegatesFocus") + _slotAssignment = ReadonlyAttribute(jsObject: jsObject, name: "slotAssignment") _host = ReadonlyAttribute(jsObject: jsObject, name: "host") - _onslotchange = OptionalClosureHandler(jsObject: jsObject, name: "onslotchange") + _onslotchange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onslotchange") super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute public var mode: ShadowRootMode + @ReadonlyAttribute + public var delegatesFocus: Bool + + @ReadonlyAttribute + public var slotAssignment: SlotAssignmentMode + @ReadonlyAttribute public var host: Element - @OptionalClosureHandler + @ClosureAttribute.Optional1 public var onslotchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/ShadowRootInit.swift b/Sources/DOMKit/WebIDL/ShadowRootInit.swift new file mode 100644 index 00000000..464e85d3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ShadowRootInit.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ShadowRootInit: JSObject { + public init(mode: ShadowRootMode, delegatesFocus: Bool, slotAssignment: SlotAssignmentMode) { + let object = JSObject.global.Object.function!.new() + object["mode"] = mode.jsValue() + object["delegatesFocus"] = delegatesFocus.jsValue() + object["slotAssignment"] = slotAssignment.jsValue() + _mode = ReadWriteAttribute(jsObject: object, name: "mode") + _delegatesFocus = ReadWriteAttribute(jsObject: object, name: "delegatesFocus") + _slotAssignment = ReadWriteAttribute(jsObject: object, name: "slotAssignment") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var mode: ShadowRootMode + + @ReadWriteAttribute + public var delegatesFocus: Bool + + @ReadWriteAttribute + public var slotAssignment: SlotAssignmentMode +} diff --git a/Sources/DOMKit/WebIDL/ShadowRootMode.swift b/Sources/DOMKit/WebIDL/ShadowRootMode.swift index 4768453a..ae05fc6b 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootMode.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootMode.swift @@ -1,23 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public enum ShadowRootMode: String, JSValueCompatible { - public static func construct(from jsValue: JSValue) -> ShadowRootMode? { - if let string = jsValue.string, - let value = ShadowRootMode(rawValue: string) - { - return value + case open + case closed + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) } return nil } - case open - case closed - public func jsValue() -> JSValue { - return rawValue.jsValue() - } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SharedWorker.swift b/Sources/DOMKit/WebIDL/SharedWorker.swift new file mode 100644 index 00000000..ed1f14aa --- /dev/null +++ b/Sources/DOMKit/WebIDL/SharedWorker.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SharedWorker: EventTarget, AbstractWorker { + override public class var constructor: JSFunction { JSObject.global.SharedWorker.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _port = ReadonlyAttribute(jsObject: jsObject, name: "port") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(scriptURL: String, options: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(scriptURL.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var port: MessagePort +} diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift new file mode 100644 index 00000000..9dca1cc1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SharedWorkerGlobalScope: WorkerGlobalScope { + override public class var constructor: JSFunction { JSObject.global.SharedWorkerGlobalScope.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: "name") + _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: "onconnect") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var name: String + + public func close() { + _ = jsObject["close"]!() + } + + @ClosureAttribute.Optional1 + public var onconnect: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift new file mode 100644 index 00000000..785a25e8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum SlotAssignmentMode: String, JSValueCompatible { + case manual + case named + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Slotable.swift b/Sources/DOMKit/WebIDL/Slotable.swift deleted file mode 100644 index bc041feb..00000000 --- a/Sources/DOMKit/WebIDL/Slotable.swift +++ /dev/null @@ -1,14 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public protocol Slotable: JSBridgedClass {} - -public extension Slotable { - var assignedSlot: HTMLSlotElement? { - return jsObject.assignedSlot.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/Slottable.swift b/Sources/DOMKit/WebIDL/Slottable.swift new file mode 100644 index 00000000..8e69c746 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Slottable.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Slottable: JSBridgedClass {} +public extension Slottable { + var assignedSlot: HTMLSlotElement? { ReadonlyAttribute["assignedSlot", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/StaticRange.swift b/Sources/DOMKit/WebIDL/StaticRange.swift index 4e2f2218..63a88d45 100644 --- a/Sources/DOMKit/WebIDL/StaticRange.swift +++ b/Sources/DOMKit/WebIDL/StaticRange.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class StaticRange: AbstractRange { @@ -13,6 +11,6 @@ public class StaticRange: AbstractRange { } public convenience init(init: StaticRangeInit) { - self.init(unsafelyWrapping: StaticRange.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) } } diff --git a/Sources/DOMKit/WebIDL/StaticRangeInit.swift b/Sources/DOMKit/WebIDL/StaticRangeInit.swift new file mode 100644 index 00000000..b5147037 --- /dev/null +++ b/Sources/DOMKit/WebIDL/StaticRangeInit.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StaticRangeInit: JSObject { + public init(startContainer: Node, startOffset: UInt32, endContainer: Node, endOffset: UInt32) { + let object = JSObject.global.Object.function!.new() + object["startContainer"] = startContainer.jsValue() + object["startOffset"] = startOffset.jsValue() + object["endContainer"] = endContainer.jsValue() + object["endOffset"] = endOffset.jsValue() + _startContainer = ReadWriteAttribute(jsObject: object, name: "startContainer") + _startOffset = ReadWriteAttribute(jsObject: object, name: "startOffset") + _endContainer = ReadWriteAttribute(jsObject: object, name: "endContainer") + _endOffset = ReadWriteAttribute(jsObject: object, name: "endOffset") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var startContainer: Node + + @ReadWriteAttribute + public var startOffset: UInt32 + + @ReadWriteAttribute + public var endContainer: Node + + @ReadWriteAttribute + public var endOffset: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/Storage.swift b/Sources/DOMKit/WebIDL/Storage.swift new file mode 100644 index 00000000..677b53df --- /dev/null +++ b/Sources/DOMKit/WebIDL/Storage.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Storage: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.Storage.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + public func key(index: UInt32) -> String? { + jsObject["key"]!(index.jsValue()).fromJSValue()! + } + + public subscript(key: String) -> String? { + jsObject[key].fromJSValue() + } + + // XXX: unsupported setter for keys of type String + + // XXX: unsupported deleter for keys of type String + + public func clear() { + _ = jsObject["clear"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift new file mode 100644 index 00000000..704df066 --- /dev/null +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StorageEvent: Event { + override public class var constructor: JSFunction { JSObject.global.StorageEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _key = ReadonlyAttribute(jsObject: jsObject, name: "key") + _oldValue = ReadonlyAttribute(jsObject: jsObject, name: "oldValue") + _newValue = ReadonlyAttribute(jsObject: jsObject, name: "newValue") + _url = ReadonlyAttribute(jsObject: jsObject, name: "url") + _storageArea = ReadonlyAttribute(jsObject: jsObject, name: "storageArea") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: StorageEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var key: String? + + @ReadonlyAttribute + public var oldValue: String? + + @ReadonlyAttribute + public var newValue: String? + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var storageArea: Storage? + + public func initStorageEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, key: String? = nil, oldValue: String? = nil, newValue: String? = nil, url: String? = nil, storageArea: Storage? = nil) { + let _arg0 = type.jsValue() + let _arg1 = bubbles?.jsValue() ?? .undefined + let _arg2 = cancelable?.jsValue() ?? .undefined + let _arg3 = key?.jsValue() ?? .undefined + let _arg4 = oldValue?.jsValue() ?? .undefined + let _arg5 = newValue?.jsValue() ?? .undefined + let _arg6 = url?.jsValue() ?? .undefined + let _arg7 = storageArea?.jsValue() ?? .undefined + _ = jsObject["initStorageEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + } +} diff --git a/Sources/DOMKit/WebIDL/StorageEventInit.swift b/Sources/DOMKit/WebIDL/StorageEventInit.swift new file mode 100644 index 00000000..e07f376c --- /dev/null +++ b/Sources/DOMKit/WebIDL/StorageEventInit.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StorageEventInit: JSObject { + public init(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?) { + let object = JSObject.global.Object.function!.new() + object["key"] = key.jsValue() + object["oldValue"] = oldValue.jsValue() + object["newValue"] = newValue.jsValue() + object["url"] = url.jsValue() + object["storageArea"] = storageArea.jsValue() + _key = ReadWriteAttribute(jsObject: object, name: "key") + _oldValue = ReadWriteAttribute(jsObject: object, name: "oldValue") + _newValue = ReadWriteAttribute(jsObject: object, name: "newValue") + _url = ReadWriteAttribute(jsObject: object, name: "url") + _storageArea = ReadWriteAttribute(jsObject: object, name: "storageArea") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var key: String? + + @ReadWriteAttribute + public var oldValue: String? + + @ReadWriteAttribute + public var newValue: String? + + @ReadWriteAttribute + public var url: String + + @ReadWriteAttribute + public var storageArea: Storage? +} diff --git a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift new file mode 100644 index 00000000..18222a88 --- /dev/null +++ b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StreamPipeOptions: JSObject { + public init(preventClose: Bool, preventAbort: Bool, preventCancel: Bool, signal: AbortSignal) { + let object = JSObject.global.Object.function!.new() + object["preventClose"] = preventClose.jsValue() + object["preventAbort"] = preventAbort.jsValue() + object["preventCancel"] = preventCancel.jsValue() + object["signal"] = signal.jsValue() + _preventClose = ReadWriteAttribute(jsObject: object, name: "preventClose") + _preventAbort = ReadWriteAttribute(jsObject: object, name: "preventAbort") + _preventCancel = ReadWriteAttribute(jsObject: object, name: "preventCancel") + _signal = ReadWriteAttribute(jsObject: object, name: "signal") + super.init(cloning: 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/StringOrArrayBuffer.swift b/Sources/DOMKit/WebIDL/StringOrArrayBuffer.swift deleted file mode 100644 index 675c5a8f..00000000 --- a/Sources/DOMKit/WebIDL/StringOrArrayBuffer.swift +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum StringOrArrayBuffer: JSBridgedType, ExpressibleByStringLiteral { - case string(String) - case arrayBuffer(ArrayBuffer) - - public init?(from value: JSValue) { - if let decoded: String = value.fromJSValue() { - self = .string(decoded) - } else if let decoded: ArrayBuffer = value.fromJSValue() { - self = .arrayBuffer(decoded) - } else { - return nil - } - } - - public init(stringLiteral value: String) { - self = .string(value) - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .string(v): return v.jsValue() - case let .arrayBuffer(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/StringOrElementCreationOptions.swift b/Sources/DOMKit/WebIDL/StringOrElementCreationOptions.swift deleted file mode 100644 index ba6cc8c1..00000000 --- a/Sources/DOMKit/WebIDL/StringOrElementCreationOptions.swift +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public enum StringOrElementCreationOptions: JSBridgedType, ExpressibleByDictionaryLiteral, ExpressibleByStringLiteral { - case string(String) - case elementCreationOptions(ElementCreationOptions) - - public init?(from value: JSValue) { - if let decoded: String = value.fromJSValue() { - self = .string(decoded) - } else if let decoded: ElementCreationOptions = value.fromJSValue() { - self = .elementCreationOptions(decoded) - } else { - return nil - } - } - - public init(stringLiteral value: String) { - self = .string(value) - } - - public init(dictionaryLiteral elements: (ElementCreationOptions.Key, ElementCreationOptions.Value)...) { - self = .elementCreationOptions(.init(uniqueKeysWithValues: elements)) - } - - public var value: JSValue { jsValue() } - - public func jsValue() -> JSValue { - switch self { - case let .string(v): return v.jsValue() - case let .elementCreationOptions(v): return v.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift new file mode 100644 index 00000000..2136271b --- /dev/null +++ b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StructuredSerializeOptions: JSObject { + public init(transfer: [JSObject]) { + let object = JSObject.global.Object.function!.new() + object["transfer"] = transfer.jsValue() + _transfer = ReadWriteAttribute(jsObject: object, name: "transfer") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var transfer: [JSObject] +} diff --git a/Sources/DOMKit/WebIDL/StyleSheet.swift b/Sources/DOMKit/WebIDL/StyleSheet.swift new file mode 100644 index 00000000..2c716a5b --- /dev/null +++ b/Sources/DOMKit/WebIDL/StyleSheet.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StyleSheet: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.StyleSheet.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _href = ReadonlyAttribute(jsObject: jsObject, name: "href") + _ownerNode = ReadonlyAttribute(jsObject: jsObject, name: "ownerNode") + _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: "parentStyleSheet") + _title = ReadonlyAttribute(jsObject: jsObject, name: "title") + _media = ReadonlyAttribute(jsObject: jsObject, name: "media") + _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var type: String + + @ReadonlyAttribute + public var href: String? + + @ReadonlyAttribute + public var ownerNode: __UNSUPPORTED_UNION__? + + @ReadonlyAttribute + public var parentStyleSheet: CSSStyleSheet? + + @ReadonlyAttribute + public var title: String? + + @ReadonlyAttribute + public var media: MediaList + + @ReadWriteAttribute + public var disabled: Bool +} diff --git a/Sources/DOMKit/WebIDL/StyleSheetList.swift b/Sources/DOMKit/WebIDL/StyleSheetList.swift new file mode 100644 index 00000000..94a9eeef --- /dev/null +++ b/Sources/DOMKit/WebIDL/StyleSheetList.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StyleSheetList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.StyleSheetList.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + public subscript(key: Int) -> CSSStyleSheet? { + jsObject[key].fromJSValue() + } + + @ReadonlyAttribute + public var length: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/SubmitEvent.swift b/Sources/DOMKit/WebIDL/SubmitEvent.swift new file mode 100644 index 00000000..57ef4cd7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SubmitEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SubmitEvent: Event { + override public class var constructor: JSFunction { JSObject.global.SubmitEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _submitter = ReadonlyAttribute(jsObject: jsObject, name: "submitter") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: SubmitEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var submitter: HTMLElement? +} diff --git a/Sources/DOMKit/WebIDL/SubmitEventInit.swift b/Sources/DOMKit/WebIDL/SubmitEventInit.swift new file mode 100644 index 00000000..7d4a7d16 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SubmitEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SubmitEventInit: JSObject { + public init(submitter: HTMLElement?) { + let object = JSObject.global.Object.function!.new() + object["submitter"] = submitter.jsValue() + _submitter = ReadWriteAttribute(jsObject: object, name: "submitter") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var submitter: HTMLElement? +} diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index 4138c2f1..51417b05 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -1,11 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit -public class Text: CharacterData, Slotable { +public class Text: CharacterData, Slottable { override public class var constructor: JSFunction { JSObject.global.Text.function! } public required init(unsafelyWrapping jsObject: JSObject) { @@ -13,12 +11,12 @@ public class Text: CharacterData, Slotable { super.init(unsafelyWrapping: jsObject) } - public convenience init(data: String = "") { - self.init(unsafelyWrapping: Text.constructor.new(data.jsValue())) + public convenience init(data: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(data?.jsValue() ?? .undefined)) } - public func splitText(offset: UInt32) -> Text { - return jsObject.splitText!(offset.jsValue()).fromJSValue()! + public func splitText(offset: UInt32) -> Self { + jsObject["splitText"]!(offset.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TextMetrics.swift b/Sources/DOMKit/WebIDL/TextMetrics.swift new file mode 100644 index 00000000..e3960601 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextMetrics.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextMetrics: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.TextMetrics.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadonlyAttribute(jsObject: jsObject, name: "width") + _actualBoundingBoxLeft = ReadonlyAttribute(jsObject: jsObject, name: "actualBoundingBoxLeft") + _actualBoundingBoxRight = ReadonlyAttribute(jsObject: jsObject, name: "actualBoundingBoxRight") + _fontBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: "fontBoundingBoxAscent") + _fontBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: "fontBoundingBoxDescent") + _actualBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: "actualBoundingBoxAscent") + _actualBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: "actualBoundingBoxDescent") + _emHeightAscent = ReadonlyAttribute(jsObject: jsObject, name: "emHeightAscent") + _emHeightDescent = ReadonlyAttribute(jsObject: jsObject, name: "emHeightDescent") + _hangingBaseline = ReadonlyAttribute(jsObject: jsObject, name: "hangingBaseline") + _alphabeticBaseline = ReadonlyAttribute(jsObject: jsObject, name: "alphabeticBaseline") + _ideographicBaseline = ReadonlyAttribute(jsObject: jsObject, name: "ideographicBaseline") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var width: Double + + @ReadonlyAttribute + public var actualBoundingBoxLeft: Double + + @ReadonlyAttribute + public var actualBoundingBoxRight: Double + + @ReadonlyAttribute + public var fontBoundingBoxAscent: Double + + @ReadonlyAttribute + public var fontBoundingBoxDescent: Double + + @ReadonlyAttribute + public var actualBoundingBoxAscent: Double + + @ReadonlyAttribute + public var actualBoundingBoxDescent: Double + + @ReadonlyAttribute + public var emHeightAscent: Double + + @ReadonlyAttribute + public var emHeightDescent: Double + + @ReadonlyAttribute + public var hangingBaseline: Double + + @ReadonlyAttribute + public var alphabeticBaseline: Double + + @ReadonlyAttribute + public var ideographicBaseline: Double +} diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift new file mode 100644 index 00000000..e9933993 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextTrack: EventTarget { + override public class var constructor: JSFunction { JSObject.global.TextTrack.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _kind = ReadonlyAttribute(jsObject: jsObject, name: "kind") + _label = ReadonlyAttribute(jsObject: jsObject, name: "label") + _language = ReadonlyAttribute(jsObject: jsObject, name: "language") + _id = ReadonlyAttribute(jsObject: jsObject, name: "id") + _inBandMetadataTrackDispatchType = ReadonlyAttribute(jsObject: jsObject, name: "inBandMetadataTrackDispatchType") + _mode = ReadWriteAttribute(jsObject: jsObject, name: "mode") + _cues = ReadonlyAttribute(jsObject: jsObject, name: "cues") + _activeCues = ReadonlyAttribute(jsObject: jsObject, name: "activeCues") + _oncuechange = ClosureAttribute.Optional1(jsObject: jsObject, name: "oncuechange") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var kind: TextTrackKind + + @ReadonlyAttribute + public var label: String + + @ReadonlyAttribute + public var language: String + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var inBandMetadataTrackDispatchType: String + + @ReadWriteAttribute + public var mode: TextTrackMode + + @ReadonlyAttribute + public var cues: TextTrackCueList? + + @ReadonlyAttribute + public var activeCues: TextTrackCueList? + + public func addCue(cue: TextTrackCue) { + _ = jsObject["addCue"]!(cue.jsValue()) + } + + public func removeCue(cue: TextTrackCue) { + _ = jsObject["removeCue"]!(cue.jsValue()) + } + + @ClosureAttribute.Optional1 + public var oncuechange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/TextTrackCue.swift b/Sources/DOMKit/WebIDL/TextTrackCue.swift new file mode 100644 index 00000000..f1e2161e --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextTrackCue.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextTrackCue: EventTarget { + override public class var constructor: JSFunction { JSObject.global.TextTrackCue.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _track = ReadonlyAttribute(jsObject: jsObject, name: "track") + _id = ReadWriteAttribute(jsObject: jsObject, name: "id") + _startTime = ReadWriteAttribute(jsObject: jsObject, name: "startTime") + _endTime = ReadWriteAttribute(jsObject: jsObject, name: "endTime") + _pauseOnExit = ReadWriteAttribute(jsObject: jsObject, name: "pauseOnExit") + _onenter = ClosureAttribute.Optional1(jsObject: jsObject, name: "onenter") + _onexit = ClosureAttribute.Optional1(jsObject: jsObject, name: "onexit") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var track: TextTrack? + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var startTime: Double + + @ReadWriteAttribute + public var endTime: Double + + @ReadWriteAttribute + public var pauseOnExit: Bool + + @ClosureAttribute.Optional1 + public var onenter: EventHandler + + @ClosureAttribute.Optional1 + public var onexit: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/TextTrackCueList.swift b/Sources/DOMKit/WebIDL/TextTrackCueList.swift new file mode 100644 index 00000000..cfaab293 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextTrackCueList.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextTrackCueList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.TextTrackCueList.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> TextTrackCue { + jsObject[key].fromJSValue()! + } + + public func getCueById(id: String) -> TextTrackCue? { + jsObject["getCueById"]!(id.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TextTrackKind.swift b/Sources/DOMKit/WebIDL/TextTrackKind.swift new file mode 100644 index 00000000..1381263f --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextTrackKind.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TextTrackKind: String, JSValueCompatible { + case subtitles + case captions + case descriptions + case chapters + case metadata + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift new file mode 100644 index 00000000..e76d5f99 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextTrackList: EventTarget { + override public class var constructor: JSFunction { JSObject.global.TextTrackList.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onchange") + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onaddtrack") + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onremovetrack") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> TextTrack { + jsObject[key].fromJSValue()! + } + + public func getTrackById(id: String) -> TextTrack? { + jsObject["getTrackById"]!(id.jsValue()).fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onchange: EventHandler + + @ClosureAttribute.Optional1 + public var onaddtrack: EventHandler + + @ClosureAttribute.Optional1 + public var onremovetrack: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/TextTrackMode.swift b/Sources/DOMKit/WebIDL/TextTrackMode.swift new file mode 100644 index 00000000..37af9717 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextTrackMode.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TextTrackMode: String, JSValueCompatible { + case disabled + case hidden + case showing + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/TimeRanges.swift b/Sources/DOMKit/WebIDL/TimeRanges.swift new file mode 100644 index 00000000..948a6166 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TimeRanges.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TimeRanges: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.TimeRanges.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + public func start(index: UInt32) -> Double { + jsObject["start"]!(index.jsValue()).fromJSValue()! + } + + public func end(index: UInt32) -> Double { + jsObject["end"]!(index.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TrackEvent.swift b/Sources/DOMKit/WebIDL/TrackEvent.swift new file mode 100644 index 00000000..2d3daec9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TrackEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TrackEvent: Event { + override public class var constructor: JSFunction { JSObject.global.TrackEvent.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _track = ReadonlyAttribute(jsObject: jsObject, name: "track") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: TrackEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var track: __UNSUPPORTED_UNION__? +} diff --git a/Sources/DOMKit/WebIDL/TrackEventInit.swift b/Sources/DOMKit/WebIDL/TrackEventInit.swift new file mode 100644 index 00000000..44acdc88 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TrackEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TrackEventInit: JSObject { + public init(track: __UNSUPPORTED_UNION__?) { + let object = JSObject.global.Object.function!.new() + object["track"] = track.jsValue() + _track = ReadWriteAttribute(jsObject: object, name: "track") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var track: __UNSUPPORTED_UNION__? +} diff --git a/Sources/DOMKit/WebIDL/TransformStream.swift b/Sources/DOMKit/WebIDL/TransformStream.swift new file mode 100644 index 00000000..20c54b40 --- /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 { + public class var constructor: JSFunction { JSObject.global.TransformStream.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _readable = ReadonlyAttribute(jsObject: jsObject, name: "readable") + _writable = ReadonlyAttribute(jsObject: jsObject, name: "writable") + self.jsObject = jsObject + } + + public convenience init(transformer: JSObject? = nil, writableStrategy: QueuingStrategy? = nil, readableStrategy: QueuingStrategy? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(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..45612eec --- /dev/null +++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TransformStreamDefaultController: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.TransformStreamDefaultController.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: "desiredSize") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var desiredSize: Double? + + public func enqueue(chunk: JSValue? = nil) { + _ = jsObject["enqueue"]!(chunk?.jsValue() ?? .undefined) + } + + public func error(reason: JSValue? = nil) { + _ = jsObject["error"]!(reason?.jsValue() ?? .undefined) + } + + public func terminate() { + _ = jsObject["terminate"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/Transformer.swift b/Sources/DOMKit/WebIDL/Transformer.swift new file mode 100644 index 00000000..7d356852 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Transformer.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Transformer: JSObject { + public init(start: @escaping TransformerStartCallback, transform: @escaping TransformerTransformCallback, flush: @escaping TransformerFlushCallback, readableType: JSValue, writableType: JSValue) { + let object = JSObject.global.Object.function!.new() + ClosureAttribute.Required1["start", in: object] = start + ClosureAttribute.Required2["transform", in: object] = transform + ClosureAttribute.Required1["flush", in: object] = flush + object["readableType"] = readableType.jsValue() + object["writableType"] = writableType.jsValue() + _start = ClosureAttribute.Required1(jsObject: object, name: "start") + _transform = ClosureAttribute.Required2(jsObject: object, name: "transform") + _flush = ClosureAttribute.Required1(jsObject: object, name: "flush") + _readableType = ReadWriteAttribute(jsObject: object, name: "readableType") + _writableType = ReadWriteAttribute(jsObject: object, name: "writableType") + super.init(cloning: object) + } + + @ClosureAttribute.Required1 + public var start: TransformerStartCallback + + @ClosureAttribute.Required2 + public var transform: TransformerTransformCallback + + @ClosureAttribute.Required1 + public var flush: TransformerFlushCallback + + @ReadWriteAttribute + public var readableType: JSValue + + @ReadWriteAttribute + public var writableType: JSValue +} diff --git a/Sources/DOMKit/WebIDL/TreeWalker.swift b/Sources/DOMKit/WebIDL/TreeWalker.swift index 6d0fd816..ea5c959d 100644 --- a/Sources/DOMKit/WebIDL/TreeWalker.swift +++ b/Sources/DOMKit/WebIDL/TreeWalker.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class TreeWalker: JSBridgedClass { @@ -23,38 +21,36 @@ public class TreeWalker: JSBridgedClass { @ReadonlyAttribute public var whatToShow: UInt32 - public var filter: NodeFilter? { - return jsObject.filter.fromJSValue()! as AnyNodeFilter? - } + // XXX: member 'filter' is ignored @ReadWriteAttribute public var currentNode: Node public func parentNode() -> Node? { - return jsObject.parentNode!().fromJSValue()! + jsObject["parentNode"]!().fromJSValue()! } public func firstChild() -> Node? { - return jsObject.firstChild!().fromJSValue()! + jsObject["firstChild"]!().fromJSValue()! } public func lastChild() -> Node? { - return jsObject.lastChild!().fromJSValue()! + jsObject["lastChild"]!().fromJSValue()! } public func previousSibling() -> Node? { - return jsObject.previousSibling!().fromJSValue()! + jsObject["previousSibling"]!().fromJSValue()! } public func nextSibling() -> Node? { - return jsObject.nextSibling!().fromJSValue()! + jsObject["nextSibling"]!().fromJSValue()! } public func previousNode() -> Node? { - return jsObject.previousNode!().fromJSValue()! + jsObject["previousNode"]!().fromJSValue()! } public func nextNode() -> Node? { - return jsObject.nextNode!().fromJSValue()! + jsObject["nextNode"]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift new file mode 100644 index 00000000..9c1b3f80 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -0,0 +1,51 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public typealias DOMHighResTimeStamp = Double +public typealias EpochTimeStamp = UInt64 +public typealias HTMLOrSVGScriptElement = __UNSUPPORTED_UNION__ +public typealias MediaProvider = __UNSUPPORTED_UNION__ +public typealias RenderingContext = __UNSUPPORTED_UNION__ +public typealias HTMLOrSVGImageElement = __UNSUPPORTED_UNION__ +public typealias CanvasImageSource = __UNSUPPORTED_UNION__ +public typealias CanvasFilterInput = [String: JSValue] +public typealias OffscreenRenderingContext = __UNSUPPORTED_UNION__ +public typealias EventHandler = EventHandlerNonNull? +public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? +public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? +public typealias TimerHandler = __UNSUPPORTED_UNION__ +public typealias ImageBitmapSource = __UNSUPPORTED_UNION__ +public typealias MessageEventSource = __UNSUPPORTED_UNION__ +public typealias BlobPart = __UNSUPPORTED_UNION__ +public typealias ArrayBufferView = __UNSUPPORTED_UNION__ +public typealias BufferSource = __UNSUPPORTED_UNION__ +public typealias DOMTimeStamp = UInt64 +public typealias HeadersInit = __UNSUPPORTED_UNION__ +public typealias XMLHttpRequestBodyInit = __UNSUPPORTED_UNION__ +public typealias BodyInit = __UNSUPPORTED_UNION__ +public typealias RequestInfo = __UNSUPPORTED_UNION__ +public typealias FormDataEntryValue = __UNSUPPORTED_UNION__ +public typealias ReadableStreamReader = __UNSUPPORTED_UNION__ +public typealias ReadableStreamController = __UNSUPPORTED_UNION__ +public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void +public typealias BlobCallback = (Blob?) -> Void +public typealias CustomElementConstructor = () -> HTMLElement +public typealias FunctionStringCallback = (String) -> Void +public typealias EventHandlerNonNull = (Event) -> JSValue +public typealias OnErrorEventHandlerNonNull = (__UNSUPPORTED_UNION__, 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 diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index f5e86846..9d1eb920 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -1,3 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop import JavaScriptKit public class UIEvent: Event { @@ -18,12 +21,12 @@ public class UIEvent: Event { public var view: Window? @ReadonlyAttribute - public var detail: Double + public var detail: Int32 - public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Double? = nil) { + public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil) { _ = jsObject["initUIEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined) } @ReadonlyAttribute - public var which: Double + public var which: UInt32 } diff --git a/Sources/DOMKit/WebIDL/UIEventInit.swift b/Sources/DOMKit/WebIDL/UIEventInit.swift new file mode 100644 index 00000000..4a210a39 --- /dev/null +++ b/Sources/DOMKit/WebIDL/UIEventInit.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class UIEventInit: JSObject { + public init(view: Window?, detail: Int32, which: UInt32) { + let object = JSObject.global.Object.function!.new() + object["view"] = view.jsValue() + object["detail"] = detail.jsValue() + object["which"] = which.jsValue() + _view = ReadWriteAttribute(jsObject: object, name: "view") + _detail = ReadWriteAttribute(jsObject: object, name: "detail") + _which = ReadWriteAttribute(jsObject: object, name: "which") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var view: Window? + + @ReadWriteAttribute + public var detail: Int32 + + @ReadWriteAttribute + public var which: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index c47a8ac8..b38e251d 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class URL: JSBridgedClass { @@ -13,4 +11,12 @@ public class URL: JSBridgedClass { public required init(unsafelyWrapping jsObject: JSObject) { self.jsObject = jsObject } + + public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { + constructor["createObjectURL"]!(obj.jsValue()).fromJSValue()! + } + + public static func revokeObjectURL(url: String) { + _ = constructor["revokeObjectURL"]!(url.jsValue()) + } } diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift new file mode 100644 index 00000000..265c3e75 --- /dev/null +++ b/Sources/DOMKit/WebIDL/UnderlyingSink.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class UnderlyingSink: JSObject { + public init(start: @escaping UnderlyingSinkStartCallback, write: @escaping UnderlyingSinkWriteCallback, close: @escaping UnderlyingSinkCloseCallback, abort: @escaping UnderlyingSinkAbortCallback, type: JSValue) { + let object = JSObject.global.Object.function!.new() + ClosureAttribute.Required1["start", in: object] = start + ClosureAttribute.Required2["write", in: object] = write + ClosureAttribute.Required0["close", in: object] = close + ClosureAttribute.Required1["abort", in: object] = abort + object["type"] = type.jsValue() + _start = ClosureAttribute.Required1(jsObject: object, name: "start") + _write = ClosureAttribute.Required2(jsObject: object, name: "write") + _close = ClosureAttribute.Required0(jsObject: object, name: "close") + _abort = ClosureAttribute.Required1(jsObject: object, name: "abort") + _type = ReadWriteAttribute(jsObject: object, name: "type") + super.init(cloning: object) + } + + @ClosureAttribute.Required1 + public var start: UnderlyingSinkStartCallback + + @ClosureAttribute.Required2 + public var write: UnderlyingSinkWriteCallback + + @ClosureAttribute.Required0 + public var close: UnderlyingSinkCloseCallback + + @ClosureAttribute.Required1 + 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..bfab348c --- /dev/null +++ b/Sources/DOMKit/WebIDL/UnderlyingSource.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class UnderlyingSource: JSObject { + public init(start: @escaping UnderlyingSourceStartCallback, pull: @escaping UnderlyingSourcePullCallback, cancel: @escaping UnderlyingSourceCancelCallback, type: ReadableStreamType, autoAllocateChunkSize: UInt64) { + let object = JSObject.global.Object.function!.new() + ClosureAttribute.Required1["start", in: object] = start + ClosureAttribute.Required1["pull", in: object] = pull + ClosureAttribute.Required1["cancel", in: object] = cancel + object["type"] = type.jsValue() + object["autoAllocateChunkSize"] = autoAllocateChunkSize.jsValue() + _start = ClosureAttribute.Required1(jsObject: object, name: "start") + _pull = ClosureAttribute.Required1(jsObject: object, name: "pull") + _cancel = ClosureAttribute.Required1(jsObject: object, name: "cancel") + _type = ReadWriteAttribute(jsObject: object, name: "type") + _autoAllocateChunkSize = ReadWriteAttribute(jsObject: object, name: "autoAllocateChunkSize") + super.init(cloning: object) + } + + @ClosureAttribute.Required1 + public var start: UnderlyingSourceStartCallback + + @ClosureAttribute.Required1 + public var pull: UnderlyingSourcePullCallback + + @ClosureAttribute.Required1 + public var cancel: UnderlyingSourceCancelCallback + + @ReadWriteAttribute + public var type: ReadableStreamType + + @ReadWriteAttribute + public var autoAllocateChunkSize: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/ValidityState.swift b/Sources/DOMKit/WebIDL/ValidityState.swift index 33d98c2c..d9df2f26 100644 --- a/Sources/DOMKit/WebIDL/ValidityState.swift +++ b/Sources/DOMKit/WebIDL/ValidityState.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class ValidityState: JSBridgedClass { diff --git a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift new file mode 100644 index 00000000..55e51486 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift @@ -0,0 +1,61 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ValidityStateFlags: JSObject { + public 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.Object.function!.new() + object["valueMissing"] = valueMissing.jsValue() + object["typeMismatch"] = typeMismatch.jsValue() + object["patternMismatch"] = patternMismatch.jsValue() + object["tooLong"] = tooLong.jsValue() + object["tooShort"] = tooShort.jsValue() + object["rangeUnderflow"] = rangeUnderflow.jsValue() + object["rangeOverflow"] = rangeOverflow.jsValue() + object["stepMismatch"] = stepMismatch.jsValue() + object["badInput"] = badInput.jsValue() + object["customError"] = customError.jsValue() + _valueMissing = ReadWriteAttribute(jsObject: object, name: "valueMissing") + _typeMismatch = ReadWriteAttribute(jsObject: object, name: "typeMismatch") + _patternMismatch = ReadWriteAttribute(jsObject: object, name: "patternMismatch") + _tooLong = ReadWriteAttribute(jsObject: object, name: "tooLong") + _tooShort = ReadWriteAttribute(jsObject: object, name: "tooShort") + _rangeUnderflow = ReadWriteAttribute(jsObject: object, name: "rangeUnderflow") + _rangeOverflow = ReadWriteAttribute(jsObject: object, name: "rangeOverflow") + _stepMismatch = ReadWriteAttribute(jsObject: object, name: "stepMismatch") + _badInput = ReadWriteAttribute(jsObject: object, name: "badInput") + _customError = ReadWriteAttribute(jsObject: object, name: "customError") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var valueMissing: Bool + + @ReadWriteAttribute + public var typeMismatch: Bool + + @ReadWriteAttribute + public var patternMismatch: Bool + + @ReadWriteAttribute + public var tooLong: Bool + + @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 +} diff --git a/Sources/DOMKit/WebIDL/VideoTrack.swift b/Sources/DOMKit/WebIDL/VideoTrack.swift new file mode 100644 index 00000000..aac3286d --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoTrack.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoTrack: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.VideoTrack.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: "id") + _kind = ReadonlyAttribute(jsObject: jsObject, name: "kind") + _label = ReadonlyAttribute(jsObject: jsObject, name: "label") + _language = ReadonlyAttribute(jsObject: jsObject, name: "language") + _selected = ReadWriteAttribute(jsObject: jsObject, name: "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 +} diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift new file mode 100644 index 00000000..15d53d75 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoTrackList: EventTarget { + override public class var constructor: JSFunction { JSObject.global.VideoTrackList.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: "selectedIndex") + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onchange") + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onaddtrack") + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onremovetrack") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> VideoTrack { + jsObject[key].fromJSValue()! + } + + public func getTrackById(id: String) -> VideoTrack? { + jsObject["getTrackById"]!(id.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var selectedIndex: Int32 + + @ClosureAttribute.Optional1 + public var onchange: EventHandler + + @ClosureAttribute.Optional1 + public var onaddtrack: EventHandler + + @ClosureAttribute.Optional1 + public var onremovetrack: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/WheelEvent.swift b/Sources/DOMKit/WebIDL/WheelEvent.swift index 490be112..7083cc48 100644 --- a/Sources/DOMKit/WebIDL/WheelEvent.swift +++ b/Sources/DOMKit/WebIDL/WheelEvent.swift @@ -1,3 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop import JavaScriptKit public class WheelEvent: MouseEvent { @@ -15,11 +18,11 @@ public class WheelEvent: MouseEvent { self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } - public static let DOM_DELTA_PIXEL: Double = 0x00 + public static let DOM_DELTA_PIXEL: UInt32 = 0x00 - public static let DOM_DELTA_LINE: Double = 0x01 + public static let DOM_DELTA_LINE: UInt32 = 0x01 - public static let DOM_DELTA_PAGE: Double = 0x02 + public static let DOM_DELTA_PAGE: UInt32 = 0x02 @ReadonlyAttribute public var deltaX: Double @@ -31,5 +34,5 @@ public class WheelEvent: MouseEvent { public var deltaZ: Double @ReadonlyAttribute - public var deltaMode: Double + public var deltaMode: UInt32 } diff --git a/Sources/DOMKit/WebIDL/WheelEventInit.swift b/Sources/DOMKit/WebIDL/WheelEventInit.swift new file mode 100644 index 00000000..f6fbfffd --- /dev/null +++ b/Sources/DOMKit/WebIDL/WheelEventInit.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WheelEventInit: JSObject { + public init(deltaX: Double, deltaY: Double, deltaZ: Double, deltaMode: UInt32) { + let object = JSObject.global.Object.function!.new() + object["deltaX"] = deltaX.jsValue() + object["deltaY"] = deltaY.jsValue() + object["deltaZ"] = deltaZ.jsValue() + object["deltaMode"] = deltaMode.jsValue() + _deltaX = ReadWriteAttribute(jsObject: object, name: "deltaX") + _deltaY = ReadWriteAttribute(jsObject: object, name: "deltaY") + _deltaZ = ReadWriteAttribute(jsObject: object, name: "deltaZ") + _deltaMode = ReadWriteAttribute(jsObject: object, name: "deltaMode") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var deltaX: Double + + @ReadWriteAttribute + public var deltaY: Double + + @ReadWriteAttribute + public var deltaZ: Double + + @ReadWriteAttribute + public var deltaMode: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index dc32ce32..03af4286 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -1,20 +1,180 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit -public class Window: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.Window.function! } - - public let jsObject: JSObject +public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, WindowOrWorkerGlobalScope, AnimationFrameProvider, WindowSessionStorage, WindowLocalStorage { + override public class var constructor: JSFunction { JSObject.global.Window.function! } public required init(unsafelyWrapping jsObject: JSObject) { _event = ReadonlyAttribute(jsObject: jsObject, name: "event") - self.jsObject = jsObject + _window = ReadonlyAttribute(jsObject: jsObject, name: "window") + _self = ReadonlyAttribute(jsObject: jsObject, name: "self") + _document = ReadonlyAttribute(jsObject: jsObject, name: "document") + _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _location = ReadonlyAttribute(jsObject: jsObject, name: "location") + _history = ReadonlyAttribute(jsObject: jsObject, name: "history") + _customElements = ReadonlyAttribute(jsObject: jsObject, name: "customElements") + _locationbar = ReadonlyAttribute(jsObject: jsObject, name: "locationbar") + _menubar = ReadonlyAttribute(jsObject: jsObject, name: "menubar") + _personalbar = ReadonlyAttribute(jsObject: jsObject, name: "personalbar") + _scrollbars = ReadonlyAttribute(jsObject: jsObject, name: "scrollbars") + _statusbar = ReadonlyAttribute(jsObject: jsObject, name: "statusbar") + _toolbar = ReadonlyAttribute(jsObject: jsObject, name: "toolbar") + _status = ReadWriteAttribute(jsObject: jsObject, name: "status") + _closed = ReadonlyAttribute(jsObject: jsObject, name: "closed") + _frames = ReadonlyAttribute(jsObject: jsObject, name: "frames") + _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _top = ReadonlyAttribute(jsObject: jsObject, name: "top") + _opener = ReadWriteAttribute(jsObject: jsObject, name: "opener") + _parent = ReadonlyAttribute(jsObject: jsObject, name: "parent") + _frameElement = ReadonlyAttribute(jsObject: jsObject, name: "frameElement") + _navigator = ReadonlyAttribute(jsObject: jsObject, name: "navigator") + _clientInformation = ReadonlyAttribute(jsObject: jsObject, name: "clientInformation") + _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: "originAgentCluster") + _external = ReadonlyAttribute(jsObject: jsObject, name: "external") + super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute - public var event: JSValue + public var event: __UNSUPPORTED_UNION__ + + @ReadonlyAttribute + public var window: WindowProxy + + @ReadonlyAttribute + public var `self`: WindowProxy + + @ReadonlyAttribute + public var document: Document + + @ReadWriteAttribute + public var name: String + + @ReadonlyAttribute + public var location: Location + + @ReadonlyAttribute + public var history: History + + @ReadonlyAttribute + public var customElements: CustomElementRegistry + + @ReadonlyAttribute + public var locationbar: BarProp + + @ReadonlyAttribute + public var menubar: BarProp + + @ReadonlyAttribute + public var personalbar: BarProp + + @ReadonlyAttribute + public var scrollbars: BarProp + + @ReadonlyAttribute + public var statusbar: BarProp + + @ReadonlyAttribute + public var toolbar: BarProp + + @ReadWriteAttribute + public var status: String + + public func close() { + _ = jsObject["close"]!() + } + + @ReadonlyAttribute + public var closed: Bool + + public func stop() { + _ = jsObject["stop"]!() + } + + public func focus() { + _ = jsObject["focus"]!() + } + + public func blur() { + _ = jsObject["blur"]!() + } + + @ReadonlyAttribute + public var frames: WindowProxy + + @ReadonlyAttribute + public var length: UInt32 + + @ReadonlyAttribute + public var top: WindowProxy? + + @ReadWriteAttribute + public var opener: JSValue + + @ReadonlyAttribute + public var parent: WindowProxy? + + @ReadonlyAttribute + public var frameElement: Element? + + public func open(url: String? = nil, target: String? = nil, features: String? = nil) -> WindowProxy? { + jsObject["open"]!(url?.jsValue() ?? .undefined, target?.jsValue() ?? .undefined, features?.jsValue() ?? .undefined).fromJSValue()! + } + + public subscript(key: String) -> JSObject { + jsObject[key].fromJSValue()! + } + + @ReadonlyAttribute + public var navigator: Navigator + + @ReadonlyAttribute + public var clientInformation: Navigator + + @ReadonlyAttribute + public var originAgentCluster: Bool + + public func alert() { + _ = jsObject["alert"]!() + } + + public func alert(message: String) { + _ = jsObject["alert"]!(message.jsValue()) + } + + public func confirm(message: String? = nil) -> Bool { + jsObject["confirm"]!(message?.jsValue() ?? .undefined).fromJSValue()! + } + + public func prompt(message: String? = nil, default: String? = nil) -> String? { + jsObject["prompt"]!(message?.jsValue() ?? .undefined, `default`?.jsValue() ?? .undefined).fromJSValue()! + } + + public func print() { + _ = jsObject["print"]!() + } + + public func postMessage(message: JSValue, targetOrigin: String, transfer: [JSObject]? = nil) { + _ = jsObject["postMessage"]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined) + } + + public func postMessage(message: JSValue, options: WindowPostMessageOptions? = nil) { + _ = jsObject["postMessage"]!(message.jsValue(), options?.jsValue() ?? .undefined) + } + + public func captureEvents() { + _ = jsObject["captureEvents"]!() + } + + public func releaseEvents() { + _ = jsObject["releaseEvents"]!() + } + + @ReadonlyAttribute + public var external: External + + public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { + jsObject["getComputedStyle"]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index 3bc1c6ed..154e14b5 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -1,298 +1,87 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol WindowEventHandlers: JSBridgedClass {} - public extension WindowEventHandlers { var onafterprint: EventHandler { - get { - guard let function = jsObject.onafterprint.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onafterprint = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onafterprint = .null - } - } + get { ClosureAttribute.Optional1["onafterprint", in: jsObject] } + set { ClosureAttribute.Optional1["onafterprint", in: jsObject] = newValue } } var onbeforeprint: EventHandler { - get { - guard let function = jsObject.onbeforeprint.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onbeforeprint = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onbeforeprint = .null - } - } + get { ClosureAttribute.Optional1["onbeforeprint", in: jsObject] } + set { ClosureAttribute.Optional1["onbeforeprint", in: jsObject] = newValue } } var onbeforeunload: OnBeforeUnloadEventHandler { - get { - guard let function = jsObject.onbeforeunload.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onbeforeunload = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onbeforeunload = .null - } - } + get { ClosureAttribute.Optional1["onbeforeunload", in: jsObject] } + set { ClosureAttribute.Optional1["onbeforeunload", in: jsObject] = newValue } } var onhashchange: EventHandler { - get { - guard let function = jsObject.onhashchange.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onhashchange = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onhashchange = .null - } - } + get { ClosureAttribute.Optional1["onhashchange", in: jsObject] } + set { ClosureAttribute.Optional1["onhashchange", in: jsObject] = newValue } } var onlanguagechange: EventHandler { - get { - guard let function = jsObject.onlanguagechange.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onlanguagechange = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onlanguagechange = .null - } - } + get { ClosureAttribute.Optional1["onlanguagechange", in: jsObject] } + set { ClosureAttribute.Optional1["onlanguagechange", in: jsObject] = newValue } } var onmessage: EventHandler { - get { - guard let function = jsObject.onmessage.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onmessage = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onmessage = .null - } - } + get { ClosureAttribute.Optional1["onmessage", in: jsObject] } + set { ClosureAttribute.Optional1["onmessage", in: jsObject] = newValue } } var onmessageerror: EventHandler { - get { - guard let function = jsObject.onmessageerror.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onmessageerror = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onmessageerror = .null - } - } + get { ClosureAttribute.Optional1["onmessageerror", in: jsObject] } + set { ClosureAttribute.Optional1["onmessageerror", in: jsObject] = newValue } } var onoffline: EventHandler { - get { - guard let function = jsObject.onoffline.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onoffline = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onoffline = .null - } - } + get { ClosureAttribute.Optional1["onoffline", in: jsObject] } + set { ClosureAttribute.Optional1["onoffline", in: jsObject] = newValue } } var ononline: EventHandler { - get { - guard let function = jsObject.ononline.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.ononline = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.ononline = .null - } - } + get { ClosureAttribute.Optional1["ononline", in: jsObject] } + set { ClosureAttribute.Optional1["ononline", in: jsObject] = newValue } } var onpagehide: EventHandler { - get { - guard let function = jsObject.onpagehide.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onpagehide = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onpagehide = .null - } - } + get { ClosureAttribute.Optional1["onpagehide", in: jsObject] } + set { ClosureAttribute.Optional1["onpagehide", in: jsObject] = newValue } } var onpageshow: EventHandler { - get { - guard let function = jsObject.onpageshow.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onpageshow = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onpageshow = .null - } - } + get { ClosureAttribute.Optional1["onpageshow", in: jsObject] } + set { ClosureAttribute.Optional1["onpageshow", in: jsObject] = newValue } } var onpopstate: EventHandler { - get { - guard let function = jsObject.onpopstate.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onpopstate = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onpopstate = .null - } - } + get { ClosureAttribute.Optional1["onpopstate", in: jsObject] } + set { ClosureAttribute.Optional1["onpopstate", in: jsObject] = newValue } } var onrejectionhandled: EventHandler { - get { - guard let function = jsObject.onrejectionhandled.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onrejectionhandled = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onrejectionhandled = .null - } - } + get { ClosureAttribute.Optional1["onrejectionhandled", in: jsObject] } + set { ClosureAttribute.Optional1["onrejectionhandled", in: jsObject] = newValue } } var onstorage: EventHandler { - get { - guard let function = jsObject.onstorage.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onstorage = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onstorage = .null - } - } + get { ClosureAttribute.Optional1["onstorage", in: jsObject] } + set { ClosureAttribute.Optional1["onstorage", in: jsObject] = newValue } } var onunhandledrejection: EventHandler { - get { - guard let function = jsObject.onunhandledrejection.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onunhandledrejection = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onunhandledrejection = .null - } - } + get { ClosureAttribute.Optional1["onunhandledrejection", in: jsObject] } + set { ClosureAttribute.Optional1["onunhandledrejection", in: jsObject] = newValue } } var onunload: EventHandler { - get { - guard let function = jsObject.onunload.function else { - return nil - } - return { arg0 in function(arg0).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject.onunload = JSClosure { arguments in - newValue(arguments[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject.onunload = .null - } - } + get { ClosureAttribute.Optional1["onunload", in: jsObject] } + set { ClosureAttribute.Optional1["onunload", in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/WindowLocalStorage.swift b/Sources/DOMKit/WebIDL/WindowLocalStorage.swift new file mode 100644 index 00000000..a94ba5b7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WindowLocalStorage.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol WindowLocalStorage: JSBridgedClass {} +public extension WindowLocalStorage { + var localStorage: Storage { ReadonlyAttribute["localStorage", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift new file mode 100644 index 00000000..a077dbcb --- /dev/null +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -0,0 +1,91 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol WindowOrWorkerGlobalScope: JSBridgedClass {} +public extension WindowOrWorkerGlobalScope { + var performance: Performance { ReadonlyAttribute["performance", in: jsObject] } + + var origin: String { ReadonlyAttribute["origin", in: jsObject] } + + var isSecureContext: Bool { ReadonlyAttribute["isSecureContext", in: jsObject] } + + var crossOriginIsolated: Bool { ReadonlyAttribute["crossOriginIsolated", in: jsObject] } + + func reportError(e: JSValue) { + _ = jsObject["reportError"]!(e.jsValue()) + } + + func btoa(data: String) -> String { + jsObject["btoa"]!(data.jsValue()).fromJSValue()! + } + + func atob(data: String) -> String { + jsObject["atob"]!(data.jsValue()).fromJSValue()! + } + + func setTimeout(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { + jsObject["setTimeout"]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! + } + + func clearTimeout(id: Int32? = nil) { + _ = jsObject["clearTimeout"]!(id?.jsValue() ?? .undefined) + } + + func setInterval(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { + jsObject["setInterval"]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! + } + + func clearInterval(id: Int32? = nil) { + _ = jsObject["clearInterval"]!(id?.jsValue() ?? .undefined) + } + + // XXX: method 'queueMicrotask' is ignored + + func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) -> JSPromise { + jsObject["createImageBitmap"]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { + let _promise: JSPromise = jsObject["createImageBitmap"]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + func createImageBitmap(image: ImageBitmapSource, sx: Int32, sy: Int32, sw: Int32, sh: Int32, options: ImageBitmapOptions? = nil) -> JSPromise { + let _arg0 = image.jsValue() + let _arg1 = sx.jsValue() + let _arg2 = sy.jsValue() + let _arg3 = sw.jsValue() + let _arg4 = sh.jsValue() + let _arg5 = options?.jsValue() ?? .undefined + return jsObject["createImageBitmap"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func createImageBitmap(image: ImageBitmapSource, sx: Int32, sy: Int32, sw: Int32, sh: Int32, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { + let _arg0 = image.jsValue() + let _arg1 = sx.jsValue() + let _arg2 = sy.jsValue() + let _arg3 = sw.jsValue() + let _arg4 = sh.jsValue() + let _arg5 = options?.jsValue() ?? .undefined + let _promise: JSPromise = jsObject["createImageBitmap"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + func structuredClone(value: JSValue, options: StructuredSerializeOptions? = nil) -> JSValue { + jsObject["structuredClone"]!(value.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { + jsObject["fetch"]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func fetch(input: RequestInfo, init: RequestInit? = nil) async throws -> Response { + let _promise: JSPromise = jsObject["fetch"]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift new file mode 100644 index 00000000..d09ccc06 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WindowPostMessageOptions: JSObject { + public init(targetOrigin: String) { + let object = JSObject.global.Object.function!.new() + object["targetOrigin"] = targetOrigin.jsValue() + _targetOrigin = ReadWriteAttribute(jsObject: object, name: "targetOrigin") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var targetOrigin: String +} diff --git a/Sources/DOMKit/WebIDL/WindowSessionStorage.swift b/Sources/DOMKit/WebIDL/WindowSessionStorage.swift new file mode 100644 index 00000000..03ff37b5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WindowSessionStorage.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol WindowSessionStorage: JSBridgedClass {} +public extension WindowSessionStorage { + var sessionStorage: Storage { ReadonlyAttribute["sessionStorage", in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift new file mode 100644 index 00000000..4542c84d --- /dev/null +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Worker: EventTarget, AbstractWorker { + override public class var constructor: JSFunction { JSObject.global.Worker.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessageerror") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(scriptURL: String, options: WorkerOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(scriptURL.jsValue(), options?.jsValue() ?? .undefined)) + } + + public func terminate() { + _ = jsObject["terminate"]!() + } + + public func postMessage(message: JSValue, transfer: [JSObject]) { + _ = jsObject["postMessage"]!(message.jsValue(), transfer.jsValue()) + } + + public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + _ = jsObject["postMessage"]!(message.jsValue(), options?.jsValue() ?? .undefined) + } + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ClosureAttribute.Optional1 + public var onmessageerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift new file mode 100644 index 00000000..1ebe5765 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope { + override public class var constructor: JSFunction { JSObject.global.WorkerGlobalScope.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _self = ReadonlyAttribute(jsObject: jsObject, name: "self") + _location = ReadonlyAttribute(jsObject: jsObject, name: "location") + _navigator = ReadonlyAttribute(jsObject: jsObject, name: "navigator") + _onerror = ClosureAttribute.Optional5(jsObject: jsObject, name: "onerror") + _onlanguagechange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onlanguagechange") + _onoffline = ClosureAttribute.Optional1(jsObject: jsObject, name: "onoffline") + _ononline = ClosureAttribute.Optional1(jsObject: jsObject, name: "ononline") + _onrejectionhandled = ClosureAttribute.Optional1(jsObject: jsObject, name: "onrejectionhandled") + _onunhandledrejection = ClosureAttribute.Optional1(jsObject: jsObject, name: "onunhandledrejection") + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var `self`: WorkerGlobalScope + + @ReadonlyAttribute + public var location: WorkerLocation + + @ReadonlyAttribute + public var navigator: WorkerNavigator + + public func importScripts(urls: String...) { + _ = jsObject["importScripts"]!(urls.jsValue()) + } + + @ClosureAttribute.Optional5 + public var onerror: OnErrorEventHandler + + @ClosureAttribute.Optional1 + public var onlanguagechange: EventHandler + + @ClosureAttribute.Optional1 + public var onoffline: EventHandler + + @ClosureAttribute.Optional1 + public var ononline: EventHandler + + @ClosureAttribute.Optional1 + public var onrejectionhandled: EventHandler + + @ClosureAttribute.Optional1 + public var onunhandledrejection: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/WorkerLocation.swift b/Sources/DOMKit/WebIDL/WorkerLocation.swift new file mode 100644 index 00000000..1b80f2cd --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkerLocation.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WorkerLocation: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.WorkerLocation.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _href = ReadonlyAttribute(jsObject: jsObject, name: "href") + _origin = ReadonlyAttribute(jsObject: jsObject, name: "origin") + _protocol = ReadonlyAttribute(jsObject: jsObject, name: "protocol") + _host = ReadonlyAttribute(jsObject: jsObject, name: "host") + _hostname = ReadonlyAttribute(jsObject: jsObject, name: "hostname") + _port = ReadonlyAttribute(jsObject: jsObject, name: "port") + _pathname = ReadonlyAttribute(jsObject: jsObject, name: "pathname") + _search = ReadonlyAttribute(jsObject: jsObject, name: "search") + _hash = ReadonlyAttribute(jsObject: jsObject, name: "hash") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var href: String + + @ReadonlyAttribute + public var origin: String + + @ReadonlyAttribute + public var `protocol`: String + + @ReadonlyAttribute + public var host: String + + @ReadonlyAttribute + public var hostname: String + + @ReadonlyAttribute + public var port: String + + @ReadonlyAttribute + public var pathname: String + + @ReadonlyAttribute + public var search: String + + @ReadonlyAttribute + public var hash: String +} diff --git a/Sources/DOMKit/WebIDL/WorkerNavigator.swift b/Sources/DOMKit/WebIDL/WorkerNavigator.swift new file mode 100644 index 00000000..3f859040 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkerNavigator.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WorkerNavigator: JSBridgedClass, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware { + public class var constructor: JSFunction { JSObject.global.WorkerNavigator.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/WorkerOptions.swift b/Sources/DOMKit/WebIDL/WorkerOptions.swift new file mode 100644 index 00000000..7ee18b4a --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkerOptions.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WorkerOptions: JSObject { + public init(type: WorkerType, credentials: RequestCredentials, name: String) { + let object = JSObject.global.Object.function!.new() + object["type"] = type.jsValue() + object["credentials"] = credentials.jsValue() + object["name"] = name.jsValue() + _type = ReadWriteAttribute(jsObject: object, name: "type") + _credentials = ReadWriteAttribute(jsObject: object, name: "credentials") + _name = ReadWriteAttribute(jsObject: object, name: "name") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var type: WorkerType + + @ReadWriteAttribute + public var credentials: RequestCredentials + + @ReadWriteAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/WorkerType.swift b/Sources/DOMKit/WebIDL/WorkerType.swift new file mode 100644 index 00000000..96e9c4c8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkerType.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum WorkerType: String, JSValueCompatible { + case classic + case module + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Worklet.swift b/Sources/DOMKit/WebIDL/Worklet.swift new file mode 100644 index 00000000..aae88b84 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Worklet.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Worklet: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.Worklet.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func addModule(moduleURL: String, options: WorkletOptions? = nil) -> JSPromise { + jsObject["addModule"]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func addModule(moduleURL: String, options: WorkletOptions? = nil) async throws { + let _promise: JSPromise = jsObject["addModule"]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift new file mode 100644 index 00000000..1deddd8d --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WorkletGlobalScope: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.WorkletGlobalScope.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/WorkletOptions.swift b/Sources/DOMKit/WebIDL/WorkletOptions.swift new file mode 100644 index 00000000..ff9c7ab3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkletOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WorkletOptions: JSObject { + public init(credentials: RequestCredentials) { + let object = JSObject.global.Object.function!.new() + object["credentials"] = credentials.jsValue() + _credentials = ReadWriteAttribute(jsObject: object, name: "credentials") + super.init(cloning: object) + } + + @ReadWriteAttribute + public var credentials: RequestCredentials +} diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift new file mode 100644 index 00000000..aa2aeb44 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WritableStream: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.WritableStream.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _locked = ReadonlyAttribute(jsObject: jsObject, name: "locked") + self.jsObject = jsObject + } + + public convenience init(underlyingSink: JSObject? = nil, strategy: QueuingStrategy? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(underlyingSink?.jsValue() ?? .undefined, strategy?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var locked: Bool + + public func abort(reason: JSValue? = nil) -> JSPromise { + jsObject["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func abort(reason: JSValue? = nil) async throws { + let _promise: JSPromise = jsObject["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func close() -> JSPromise { + jsObject["close"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func close() async throws { + let _promise: JSPromise = jsObject["close"]!().fromJSValue()! + _ = try await _promise.get() + } + + public func getWriter() -> WritableStreamDefaultWriter { + jsObject["getWriter"]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift new file mode 100644 index 00000000..94a9fa35 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WritableStreamDefaultController: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.WritableStreamDefaultController.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _signal = ReadonlyAttribute(jsObject: jsObject, name: "signal") + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var signal: AbortSignal + + public func error(e: JSValue? = nil) { + _ = jsObject["error"]!(e?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift new file mode 100644 index 00000000..66c19209 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WritableStreamDefaultWriter: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.WritableStreamDefaultWriter.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _closed = ReadonlyAttribute(jsObject: jsObject, name: "closed") + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: "desiredSize") + _ready = ReadonlyAttribute(jsObject: jsObject, name: "ready") + self.jsObject = jsObject + } + + public convenience init(stream: WritableStream) { + self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue())) + } + + @ReadonlyAttribute + public var closed: JSPromise + + @ReadonlyAttribute + public var desiredSize: Double? + + @ReadonlyAttribute + public var ready: JSPromise + + public func abort(reason: JSValue? = nil) -> JSPromise { + jsObject["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func abort(reason: JSValue? = nil) async throws { + let _promise: JSPromise = jsObject["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func close() -> JSPromise { + jsObject["close"]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func close() async throws { + let _promise: JSPromise = jsObject["close"]!().fromJSValue()! + _ = try await _promise.get() + } + + public func releaseLock() { + _ = jsObject["releaseLock"]!() + } + + public func write(chunk: JSValue? = nil) -> JSPromise { + jsObject["write"]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func write(chunk: JSValue? = nil) async throws { + let _promise: JSPromise = jsObject["write"]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/XMLDocument.swift b/Sources/DOMKit/WebIDL/XMLDocument.swift index 0fe2c9ba..acb045e7 100644 --- a/Sources/DOMKit/WebIDL/XMLDocument.swift +++ b/Sources/DOMKit/WebIDL/XMLDocument.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class XMLDocument: Document { diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift new file mode 100644 index 00000000..39df8230 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -0,0 +1,106 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XMLHttpRequest: XMLHttpRequestEventTarget { + override public class var constructor: JSFunction { JSObject.global.XMLHttpRequest.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onreadystatechange") + _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") + _timeout = ReadWriteAttribute(jsObject: jsObject, name: "timeout") + _withCredentials = ReadWriteAttribute(jsObject: jsObject, name: "withCredentials") + _upload = ReadonlyAttribute(jsObject: jsObject, name: "upload") + _responseURL = ReadonlyAttribute(jsObject: jsObject, name: "responseURL") + _status = ReadonlyAttribute(jsObject: jsObject, name: "status") + _statusText = ReadonlyAttribute(jsObject: jsObject, name: "statusText") + _responseType = ReadWriteAttribute(jsObject: jsObject, name: "responseType") + _response = ReadonlyAttribute(jsObject: jsObject, name: "response") + _responseText = ReadonlyAttribute(jsObject: jsObject, name: "responseText") + _responseXML = ReadonlyAttribute(jsObject: jsObject, name: "responseXML") + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ClosureAttribute.Optional1 + public var onreadystatechange: EventHandler + + public static let UNSENT: UInt16 = 0 + + public static let OPENED: UInt16 = 1 + + public static let HEADERS_RECEIVED: UInt16 = 2 + + public static let LOADING: UInt16 = 3 + + public static let DONE: UInt16 = 4 + + @ReadonlyAttribute + public var readyState: UInt16 + + public func open(method: String, url: String) { + _ = jsObject["open"]!(method.jsValue(), url.jsValue()) + } + + public func open(method: String, url: String, async: Bool, username: String? = nil, password: String? = nil) { + _ = jsObject["open"]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined) + } + + public func setRequestHeader(name: String, value: String) { + _ = jsObject["setRequestHeader"]!(name.jsValue(), value.jsValue()) + } + + @ReadWriteAttribute + public var timeout: UInt32 + + @ReadWriteAttribute + public var withCredentials: Bool + + @ReadonlyAttribute + public var upload: XMLHttpRequestUpload + + public func send(body: __UNSUPPORTED_UNION__? = nil) { + _ = jsObject["send"]!(body?.jsValue() ?? .undefined) + } + + public func abort() { + _ = jsObject["abort"]!() + } + + @ReadonlyAttribute + public var responseURL: String + + @ReadonlyAttribute + public var status: UInt16 + + @ReadonlyAttribute + public var statusText: String + + public func getResponseHeader(name: String) -> String? { + jsObject["getResponseHeader"]!(name.jsValue()).fromJSValue()! + } + + public func getAllResponseHeaders() -> String { + jsObject["getAllResponseHeaders"]!().fromJSValue()! + } + + public func overrideMimeType(mime: String) { + _ = jsObject["overrideMimeType"]!(mime.jsValue()) + } + + @ReadWriteAttribute + public var responseType: XMLHttpRequestResponseType + + @ReadonlyAttribute + public var response: JSValue + + @ReadonlyAttribute + public var responseText: String + + @ReadonlyAttribute + public var responseXML: Document? +} diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift new file mode 100644 index 00000000..d766e126 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XMLHttpRequestEventTarget: EventTarget { + override public class var constructor: JSFunction { JSObject.global.XMLHttpRequestEventTarget.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: "onloadstart") + _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: "onprogress") + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: "onabort") + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onerror") + _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: "onload") + _ontimeout = ClosureAttribute.Optional1(jsObject: jsObject, name: "ontimeout") + _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: "onloadend") + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var onloadstart: EventHandler + + @ClosureAttribute.Optional1 + public var onprogress: EventHandler + + @ClosureAttribute.Optional1 + public var onabort: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onload: EventHandler + + @ClosureAttribute.Optional1 + public var ontimeout: EventHandler + + @ClosureAttribute.Optional1 + public var onloadend: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift new file mode 100644 index 00000000..c15058dc --- /dev/null +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XMLHttpRequestResponseType: String, JSValueCompatible { + case _empty = "" + case arraybuffer + case blob + case document + case json + case text + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.string { + return Self(rawValue: string) + } + return nil + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift new file mode 100644 index 00000000..dfd38b44 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XMLHttpRequestUpload: XMLHttpRequestEventTarget { + override public class var constructor: JSFunction { JSObject.global.XMLHttpRequestUpload.function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/XPathEvaluator.swift b/Sources/DOMKit/WebIDL/XPathEvaluator.swift index 30e8da4a..98be6b9d 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluator.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluator.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class XPathEvaluator: JSBridgedClass, XPathEvaluatorBase { @@ -15,6 +13,6 @@ public class XPathEvaluator: JSBridgedClass, XPathEvaluatorBase { } public convenience init() { - self.init(unsafelyWrapping: XPathEvaluator.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new()) } } diff --git a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift index 9ec9e315..34302ee2 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift @@ -1,30 +1,13 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public protocol XPathEvaluatorBase: JSBridgedClass {} - public extension XPathEvaluatorBase { - func createExpression(expression: String, resolver: XPathNSResolverType? = nil) -> XPathExpression { - return jsObject.createExpression!(expression.jsValue(), resolver.jsValue()).fromJSValue()! - } - - func createExpression(expression: String, resolver: ((String?) -> String?)? = nil) -> XPathExpression { - return jsObject.createExpression!(expression.jsValue(), resolver == nil ? nil : JSClosure { resolver!($0[0].fromJSValue()!).jsValue() }).fromJSValue()! - } - - func createNSResolver(nodeResolver: Node) -> XPathNSResolver { - return jsObject.createNSResolver!(nodeResolver.jsValue()).fromJSValue()! as AnyXPathNSResolver - } + // XXX: method 'createExpression' is ignored - func evaluate(expression: String, contextNode: Node, resolver: XPathNSResolverType? = nil, type: UInt16 = 0, result: XPathResult? = nil) -> XPathResult { - return jsObject.evaluate!(expression.jsValue(), contextNode.jsValue(), resolver.jsValue(), type.jsValue(), result.jsValue()).fromJSValue()! - } + // XXX: method 'createNSResolver' is ignored - func evaluate(expression: String, contextNode: Node, resolver: ((String?) -> String?)? = nil, type: UInt16 = 0, result: XPathResult? = nil) -> XPathResult { - return jsObject.evaluate!(expression.jsValue(), contextNode.jsValue(), resolver == nil ? nil : JSClosure { resolver!($0[0].fromJSValue()!).jsValue() }, type.jsValue(), result.jsValue()).fromJSValue()! - } + // XXX: method 'evaluate' is ignored } diff --git a/Sources/DOMKit/WebIDL/XPathExpression.swift b/Sources/DOMKit/WebIDL/XPathExpression.swift index e52919ee..59f0bde3 100644 --- a/Sources/DOMKit/WebIDL/XPathExpression.swift +++ b/Sources/DOMKit/WebIDL/XPathExpression.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class XPathExpression: JSBridgedClass { @@ -14,7 +12,7 @@ public class XPathExpression: JSBridgedClass { self.jsObject = jsObject } - public func evaluate(contextNode: Node, type: UInt16 = 0, result: XPathResult? = nil) -> XPathResult { - return jsObject.evaluate!(contextNode.jsValue(), type.jsValue(), result.jsValue()).fromJSValue()! + public func evaluate(contextNode: Node, type: UInt16? = nil, result: XPathResult? = nil) -> XPathResult { + jsObject["evaluate"]!(contextNode.jsValue(), type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XPathNSResolver.swift b/Sources/DOMKit/WebIDL/XPathNSResolver.swift deleted file mode 100644 index 1d9cfe0d..00000000 --- a/Sources/DOMKit/WebIDL/XPathNSResolver.swift +++ /dev/null @@ -1,10 +0,0 @@ - -/* - * The following code is auto generated using webidl2swift - */ - -import JavaScriptKit - -public protocol XPathNSResolver: JSBridgedType { - func lookupNamespaceURI(prefix: String?) -> String? -} diff --git a/Sources/DOMKit/WebIDL/XPathResult.swift b/Sources/DOMKit/WebIDL/XPathResult.swift index 6395dd49..5b3776ea 100644 --- a/Sources/DOMKit/WebIDL/XPathResult.swift +++ b/Sources/DOMKit/WebIDL/XPathResult.swift @@ -1,8 +1,6 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public class XPathResult: JSBridgedClass { @@ -21,25 +19,25 @@ public class XPathResult: JSBridgedClass { self.jsObject = jsObject } - public let ANY_TYPE: UInt16 = 0 + public static let ANY_TYPE: UInt16 = 0 - public let NUMBER_TYPE: UInt16 = 1 + public static let NUMBER_TYPE: UInt16 = 1 - public let STRING_TYPE: UInt16 = 2 + public static let STRING_TYPE: UInt16 = 2 - public let BOOLEAN_TYPE: UInt16 = 3 + public static let BOOLEAN_TYPE: UInt16 = 3 - public let UNORDERED_NODE_ITERATOR_TYPE: UInt16 = 4 + public static let UNORDERED_NODE_ITERATOR_TYPE: UInt16 = 4 - public let ORDERED_NODE_ITERATOR_TYPE: UInt16 = 5 + public static let ORDERED_NODE_ITERATOR_TYPE: UInt16 = 5 - public let UNORDERED_NODE_SNAPSHOT_TYPE: UInt16 = 6 + public static let UNORDERED_NODE_SNAPSHOT_TYPE: UInt16 = 6 - public let ORDERED_NODE_SNAPSHOT_TYPE: UInt16 = 7 + public static let ORDERED_NODE_SNAPSHOT_TYPE: UInt16 = 7 - public let ANY_UNORDERED_NODE_TYPE: UInt16 = 8 + public static let ANY_UNORDERED_NODE_TYPE: UInt16 = 8 - public let FIRST_ORDERED_NODE_TYPE: UInt16 = 9 + public static let FIRST_ORDERED_NODE_TYPE: UInt16 = 9 @ReadonlyAttribute public var resultType: UInt16 @@ -63,10 +61,10 @@ public class XPathResult: JSBridgedClass { public var snapshotLength: UInt32 public func iterateNext() -> Node? { - return jsObject.iterateNext!().fromJSValue()! + jsObject["iterateNext"]!().fromJSValue()! } public func snapshotItem(index: UInt32) -> Node? { - return jsObject.snapshotItem!(index.jsValue()).fromJSValue()! + jsObject["snapshotItem"]!(index.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift new file mode 100644 index 00000000..fe50f6c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XSLTProcessor: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global.XSLTProcessor.function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + public func importStylesheet(style: Node) { + _ = jsObject["importStylesheet"]!(style.jsValue()) + } + + public func transformToFragment(source: Node, output: Document) -> DocumentFragment { + jsObject["transformToFragment"]!(source.jsValue(), output.jsValue()).fromJSValue()! + } + + public func transformToDocument(source: Node) -> Document { + jsObject["transformToDocument"]!(source.jsValue()).fromJSValue()! + } + + public func setParameter(namespaceURI: String, localName: String, value: JSValue) { + _ = jsObject["setParameter"]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()) + } + + public func getParameter(namespaceURI: String, localName: String) -> JSValue { + jsObject["getParameter"]!(namespaceURI.jsValue(), localName.jsValue()).fromJSValue()! + } + + public func removeParameter(namespaceURI: String, localName: String) { + _ = jsObject["removeParameter"]!(namespaceURI.jsValue(), localName.jsValue()) + } + + public func clearParameters() { + _ = jsObject["clearParameters"]!() + } + + public func reset() { + _ = jsObject["reset"]!() + } +} diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index a3e772d3..97b42921 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -1,148 +1,86 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! -/* - * The following code is auto generated using webidl2swift - */ - +import JavaScriptEventLoop import JavaScriptKit public enum console { public static var jsObject: JSObject { - return JSObject.global.console.object! - } - - public static func assert(condition: Bool = false, data: JSValue...) { - _ = jsObject.assert!(condition.jsValue(), data.jsValue()) + JSObject.global.console.object! } - public static func assert(condition: Bool = false) { - _ = jsObject.assert!(condition.jsValue()) + public static func assert(condition: Bool? = nil, data: JSValue...) { + _ = JSObject.global.console.object!["assert"]!(condition?.jsValue() ?? .undefined, data.jsValue()) } public static func clear() { - _ = jsObject.clear!() + _ = JSObject.global.console.object!["clear"]!() } public static func debug(data: JSValue...) { - _ = jsObject.debug!(data.jsValue()) - } - - public static func debug() { - _ = jsObject.debug!() + _ = JSObject.global.console.object!["debug"]!(data.jsValue()) } public static func error(data: JSValue...) { - _ = jsObject.error!(data.jsValue()) - } - - public static func error() { - _ = jsObject.error!() + _ = JSObject.global.console.object!["error"]!(data.jsValue()) } public static func info(data: JSValue...) { - _ = jsObject.info!(data.jsValue()) - } - - public static func info() { - _ = jsObject.info!() + _ = JSObject.global.console.object!["info"]!(data.jsValue()) } public static func log(data: JSValue...) { - _ = jsObject.log!(data.jsValue()) - } - - public static func log() { - _ = jsObject.log!() - } - - public static func table(tabularData: JSValue, properties: [String]) { - _ = jsObject.table!(tabularData.jsValue(), properties.jsValue()) - } - - public static func table(tabularData: JSValue) { - _ = jsObject.table!(tabularData.jsValue()) + _ = JSObject.global.console.object!["log"]!(data.jsValue()) } - public static func table() { - _ = jsObject.table!() + public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { + _ = JSObject.global.console.object!["table"]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) } public static func trace(data: JSValue...) { - _ = jsObject.trace!(data.jsValue()) - } - - public static func trace() { - _ = jsObject.trace!() + _ = JSObject.global.console.object!["trace"]!(data.jsValue()) } public static func warn(data: JSValue...) { - _ = jsObject.warn!(data.jsValue()) - } - - public static func warn() { - _ = jsObject.warn!() - } - - public static func dir(item: JSValue, options: JSValue?) { - _ = jsObject.dir!(item.jsValue(), options.jsValue()) - } - - public static func dir(item: JSValue) { - _ = jsObject.dir!(item.jsValue()) + _ = JSObject.global.console.object!["warn"]!(data.jsValue()) } - public static func dir() { - _ = jsObject.dir!() + public static func dir(item: JSValue? = nil, options: JSObject? = nil) { + _ = JSObject.global.console.object!["dir"]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) } public static func dirxml(data: JSValue...) { - _ = jsObject.dirxml!(data.jsValue()) + _ = JSObject.global.console.object!["dirxml"]!(data.jsValue()) } - public static func dirxml() { - _ = jsObject.dirxml!() + public static func count(label: String? = nil) { + _ = JSObject.global.console.object!["count"]!(label?.jsValue() ?? .undefined) } - public static func count(label: String = "default") { - _ = jsObject.count!(label.jsValue()) - } - - public static func countReset(label: String = "default") { - _ = jsObject.countReset!(label.jsValue()) + public static func countReset(label: String? = nil) { + _ = JSObject.global.console.object!["countReset"]!(label?.jsValue() ?? .undefined) } public static func group(data: JSValue...) { - _ = jsObject.group!(data.jsValue()) - } - - public static func group() { - _ = jsObject.group!() + _ = JSObject.global.console.object!["group"]!(data.jsValue()) } public static func groupCollapsed(data: JSValue...) { - _ = jsObject.groupCollapsed!(data.jsValue()) - } - - public static func groupCollapsed() { - _ = jsObject.groupCollapsed!() + _ = JSObject.global.console.object!["groupCollapsed"]!(data.jsValue()) } public static func groupEnd() { - _ = jsObject.groupEnd!() - } - - public static func time(label: String = "default") { - _ = jsObject.time!(label.jsValue()) + _ = JSObject.global.console.object!["groupEnd"]!() } - public static func timeLog(label: String = "default", data: JSValue...) { - _ = jsObject.timeLog!(label.jsValue(), data.jsValue()) + public static func time(label: String? = nil) { + _ = JSObject.global.console.object!["time"]!(label?.jsValue() ?? .undefined) } - public static func timeLog(label: String = "default") { - _ = jsObject.timeLog!(label.jsValue()) + public static func timeLog(label: String? = nil, data: JSValue...) { + _ = JSObject.global.console.object!["timeLog"]!(label?.jsValue() ?? .undefined, data.jsValue()) } - public static func timeEnd(label: String = "default") { - _ = jsObject.timeEnd!(label.jsValue()) + public static func timeEnd(label: String? = nil) { + _ = JSObject.global.console.object!["timeEnd"]!(label?.jsValue() ?? .undefined) } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index bb748d6e..4ce9a768 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -471,7 +471,6 @@ extension IDLType: SwiftRepresentable { // ??? return "[\(args[0])]" case "Promise": - // TODO: async return "JSPromise" case "record": return "[\(args[0]): \(args[1])]" From 67f10c8d4be6b6d0fd1107a5440d9c29be78a5a2 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 17:30:09 -0400 Subject: [PATCH 076/124] reformat iterators --- Sources/DOMKit/ECMAScript/Support.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index ee060ff6..65f8c3cc 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -77,7 +77,9 @@ public class ValueIterableIterator: Ite } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) -public class ValueIterableAsyncIterator: AsyncIteratorProtocol where SequenceType.Element: ConstructibleFromJSValue { +public class ValueIterableAsyncIterator: AsyncIteratorProtocol + where SequenceType.Element: ConstructibleFromJSValue +{ private var index: Int = 0 private let sequence: SequenceType @@ -95,7 +97,9 @@ public protocol KeyValueSequence: Sequence where Element == (String, Value) { associatedtype Value } -public class PairIterableIterator: IteratorProtocol where SequenceType.Value: ConstructibleFromJSValue { +public class PairIterableIterator: IteratorProtocol + where SequenceType.Value: ConstructibleFromJSValue +{ private let iterator: JSObject private let sequence: SequenceType From 934a47e23e39538157838bad0d16a59406a7ae84 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 17:33:29 -0400 Subject: [PATCH 077/124] =?UTF-8?q?Don=E2=80=99t=20forget=20to=20format!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/WebIDLToSwift/FormatOutputFiles.swift | 14 ++++++++++++++ Sources/WebIDLToSwift/main.swift | 1 + 2 files changed, 15 insertions(+) create mode 100644 Sources/WebIDLToSwift/FormatOutputFiles.swift diff --git a/Sources/WebIDLToSwift/FormatOutputFiles.swift b/Sources/WebIDLToSwift/FormatOutputFiles.swift new file mode 100644 index 00000000..c1f5be40 --- /dev/null +++ b/Sources/WebIDLToSwift/FormatOutputFiles.swift @@ -0,0 +1,14 @@ +import Foundation + +enum SwiftFormatter { + static func run() { + print("Formatting generated Swift files...") + let task = Process() + task.standardOutput = FileHandle.standardOutput + task.standardError = FileHandle.standardError + task.arguments = ["-c", "swiftformat Sources/DOMKit/WebIDL"] + task.launchPath = "/bin/zsh" + task.launch() + task.waitUntilExit() + } +} diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index 6bfee4dc..d1120582 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -13,6 +13,7 @@ func main() { try IDLBuilder.generateIDLBindings(idl: idl) print("Generating closure property wrappers...") try IDLBuilder.generateClosureTypes() + SwiftFormatter.run() print("Done in \(Int(Date().timeIntervalSince(startTime) * 1000))ms.") } catch { handleDecodingError(error) From 5421c985e443c4afaa92cb5f30e812ded281317e Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 17:33:53 -0400 Subject: [PATCH 078/124] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 95c43209..970bd4ca 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /Packages /*.xcodeproj xcuserdata/ +node_modules From ff24efd6092a29f2cc533181bfb65bfa1ef004a5 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 30 Mar 2022 17:50:03 -0400 Subject: [PATCH 079/124] =?UTF-8?q?clean=20up=20Support.swift,=20=E2=80=9C?= =?UTF-8?q?fix=E2=80=9D=20build=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/DOMKit/ECMAScript/Support.swift | 30 ++----------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 65f8c3cc..0371eed1 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -62,7 +62,8 @@ public class ValueIterableIterator: Ite private let iterator: JSObject public init(sequence: SequenceType) { - iterator = sequence.jsObject[JSObject.global.Symbol.object!.iterator]!().object! + // TODO: fetch the actual symbol + iterator = sequence.jsObject[JSObject.global.Symbol.object!.iterator.string!]!().object! } public func next() -> SequenceType.Element? { @@ -92,30 +93,3 @@ public class ValueIterableAsyncIterator: IteratorProtocol - where SequenceType.Value: ConstructibleFromJSValue -{ - private let iterator: JSObject - private let sequence: SequenceType - - public init(sequence: SequenceType) { - self.sequence = sequence - iterator = sequence.jsObject.entries!().object! - } - - public func next() -> SequenceType.Element? { - let next: JSObject = iterator.next!().object! - - guard next.done.boolean! == false else { - return nil - } - - let keyValue: [JSValue] = next.value.fromJSValue()! - return (keyValue[0].fromJSValue()!, keyValue[1].fromJSValue()!) - } -} From 810a4f736435f26884fdb95115d766713dd0220d Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 1 Apr 2022 08:05:58 -0400 Subject: [PATCH 080/124] =?UTF-8?q?Don=E2=80=99t=20subclass=20JSObject=20a?= =?UTF-8?q?nymore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/DOMKit/ECMAScript/Support.swift | 23 +++++++++++ .../WebIDL/AddEventListenerOptions.swift | 10 +++-- .../DOMKit/WebIDL/AssignedNodesOptions.swift | 10 +++-- Sources/DOMKit/WebIDL/BlobPropertyBag.swift | 10 +++-- Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift | 10 +++-- .../CanvasRenderingContext2DSettings.swift | 10 +++-- .../DOMKit/WebIDL/CompositionEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/CustomEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift | 10 +++-- Sources/DOMKit/WebIDL/DOMMatrixInit.swift | 10 +++-- Sources/DOMKit/WebIDL/DOMPointInit.swift | 10 +++-- Sources/DOMKit/WebIDL/DOMQuadInit.swift | 10 +++-- Sources/DOMKit/WebIDL/DOMRectInit.swift | 10 +++-- Sources/DOMKit/WebIDL/DragEventInit.swift | 10 +++-- .../WebIDL/ElementCreationOptions.swift | 10 +++-- .../WebIDL/ElementDefinitionOptions.swift | 10 +++-- Sources/DOMKit/WebIDL/ErrorEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/EventInit.swift | 10 +++-- .../DOMKit/WebIDL/EventListenerOptions.swift | 10 +++-- Sources/DOMKit/WebIDL/EventModifierInit.swift | 10 +++-- Sources/DOMKit/WebIDL/EventSourceInit.swift | 10 +++-- Sources/DOMKit/WebIDL/FilePropertyBag.swift | 10 +++-- Sources/DOMKit/WebIDL/FocusEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/FocusOptions.swift | 10 +++-- Sources/DOMKit/WebIDL/FormDataEventInit.swift | 10 +++-- .../DOMKit/WebIDL/GetRootNodeOptions.swift | 10 +++-- .../DOMKit/WebIDL/HashChangeEventInit.swift | 10 +++-- .../DOMKit/WebIDL/ImageBitmapOptions.swift | 10 +++-- .../ImageBitmapRenderingContextSettings.swift | 10 +++-- Sources/DOMKit/WebIDL/ImageDataSettings.swift | 10 +++-- .../DOMKit/WebIDL/ImageEncodeOptions.swift | 10 +++-- Sources/DOMKit/WebIDL/InputEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/KeyboardEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/MessageEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/MouseEventInit.swift | 10 +++-- .../DOMKit/WebIDL/MutationObserverInit.swift | 10 +++-- .../WebIDL/PageTransitionEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/PopStateEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/ProgressEventInit.swift | 10 +++-- .../WebIDL/PromiseRejectionEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/QueuingStrategy.swift | 10 +++-- .../DOMKit/WebIDL/QueuingStrategyInit.swift | 10 +++-- .../WebIDL/ReadableStreamBYOBReadResult.swift | 10 +++-- .../ReadableStreamDefaultReadResult.swift | 10 +++-- .../ReadableStreamGetReaderOptions.swift | 10 +++-- .../ReadableStreamIteratorOptions.swift | 10 +++-- .../DOMKit/WebIDL/ReadableWritablePair.swift | 10 +++-- Sources/DOMKit/WebIDL/RequestInit.swift | 10 +++-- Sources/DOMKit/WebIDL/ResponseInit.swift | 10 +++-- Sources/DOMKit/WebIDL/ShadowRootInit.swift | 10 +++-- Sources/DOMKit/WebIDL/StaticRangeInit.swift | 10 +++-- Sources/DOMKit/WebIDL/StorageEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/StreamPipeOptions.swift | 10 +++-- .../WebIDL/StructuredSerializeOptions.swift | 10 +++-- Sources/DOMKit/WebIDL/SubmitEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/TrackEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/Transformer.swift | 10 +++-- Sources/DOMKit/WebIDL/UIEventInit.swift | 10 +++-- Sources/DOMKit/WebIDL/UnderlyingSink.swift | 10 +++-- Sources/DOMKit/WebIDL/UnderlyingSource.swift | 10 +++-- .../DOMKit/WebIDL/ValidityStateFlags.swift | 10 +++-- Sources/DOMKit/WebIDL/WheelEventInit.swift | 10 +++-- .../WebIDL/WindowPostMessageOptions.swift | 10 +++-- Sources/DOMKit/WebIDL/WorkerOptions.swift | 10 +++-- Sources/DOMKit/WebIDL/WorkletOptions.swift | 10 +++-- .../WebIDL+SwiftRepresentation.swift | 41 ++++++++++++------- 66 files changed, 497 insertions(+), 207 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 0371eed1..4c173008 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -15,6 +15,29 @@ public extension HTMLElement { } } +public class BridgedDictionary: JSValueCompatible { + public let jsObject: JSObject + + public func jsValue() -> JSValue { + jsObject.jsValue() + } + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static func construct(from value: JSValue) -> Self? { + if let object = value.object { + return Self.construct(from: object) + } + return nil + } + + public static func construct(from object: JSObject) -> Self? { + Self(unsafelyWrapping: object) + } +} + public let globalThis = Window(from: JSObject.global.jsValue())! public typealias Uint8ClampedArray = JSUInt8ClampedArray diff --git a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift index cb56244f..599141d4 100644 --- a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class AddEventListenerOptions: JSObject { - public init(passive: Bool, once: Bool, signal: AbortSignal) { +public class AddEventListenerOptions: BridgedDictionary { + public convenience init(passive: Bool, once: Bool, signal: AbortSignal) { let object = JSObject.global.Object.function!.new() object["passive"] = passive.jsValue() object["once"] = once.jsValue() object["signal"] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _passive = ReadWriteAttribute(jsObject: object, name: "passive") _once = ReadWriteAttribute(jsObject: object, name: "once") _signal = ReadWriteAttribute(jsObject: object, name: "signal") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift index cb49fd2a..ee90c5b9 100644 --- a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift +++ b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class AssignedNodesOptions: JSObject { - public init(flatten: Bool) { +public class AssignedNodesOptions: BridgedDictionary { + public convenience init(flatten: Bool) { let object = JSObject.global.Object.function!.new() object["flatten"] = flatten.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _flatten = ReadWriteAttribute(jsObject: object, name: "flatten") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift index 290c3b57..c2dcd416 100644 --- a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift +++ b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift @@ -3,14 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit -public class BlobPropertyBag: JSObject { - public init(type: String, endings: EndingType) { +public class BlobPropertyBag: BridgedDictionary { + public convenience init(type: String, endings: EndingType) { let object = JSObject.global.Object.function!.new() object["type"] = type.jsValue() object["endings"] = endings.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _type = ReadWriteAttribute(jsObject: object, name: "type") _endings = ReadWriteAttribute(jsObject: object, name: "endings") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift index a991dce0..062ad517 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class CSSStyleSheetInit: JSObject { - public init(baseURL: String, media: __UNSUPPORTED_UNION__, disabled: Bool) { +public class CSSStyleSheetInit: BridgedDictionary { + public convenience init(baseURL: String, media: __UNSUPPORTED_UNION__, disabled: Bool) { let object = JSObject.global.Object.function!.new() object["baseURL"] = baseURL.jsValue() object["media"] = media.jsValue() object["disabled"] = disabled.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _baseURL = ReadWriteAttribute(jsObject: object, name: "baseURL") _media = ReadWriteAttribute(jsObject: object, name: "media") _disabled = ReadWriteAttribute(jsObject: object, name: "disabled") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift index 62758568..29dc144f 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public class CanvasRenderingContext2DSettings: JSObject { - public init(alpha: Bool, desynchronized: Bool, colorSpace: PredefinedColorSpace, willReadFrequently: Bool) { +public class CanvasRenderingContext2DSettings: BridgedDictionary { + public convenience init(alpha: Bool, desynchronized: Bool, colorSpace: PredefinedColorSpace, willReadFrequently: Bool) { let object = JSObject.global.Object.function!.new() object["alpha"] = alpha.jsValue() object["desynchronized"] = desynchronized.jsValue() object["colorSpace"] = colorSpace.jsValue() object["willReadFrequently"] = willReadFrequently.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _alpha = ReadWriteAttribute(jsObject: object, name: "alpha") _desynchronized = ReadWriteAttribute(jsObject: object, name: "desynchronized") _colorSpace = ReadWriteAttribute(jsObject: object, name: "colorSpace") _willReadFrequently = ReadWriteAttribute(jsObject: object, name: "willReadFrequently") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CompositionEventInit.swift b/Sources/DOMKit/WebIDL/CompositionEventInit.swift index 36d5a351..d015a623 100644 --- a/Sources/DOMKit/WebIDL/CompositionEventInit.swift +++ b/Sources/DOMKit/WebIDL/CompositionEventInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class CompositionEventInit: JSObject { - public init(data: String) { +public class CompositionEventInit: BridgedDictionary { + public convenience init(data: String) { let object = JSObject.global.Object.function!.new() object["data"] = data.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _data = ReadWriteAttribute(jsObject: object, name: "data") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CustomEventInit.swift b/Sources/DOMKit/WebIDL/CustomEventInit.swift index 17459aae..86452351 100644 --- a/Sources/DOMKit/WebIDL/CustomEventInit.swift +++ b/Sources/DOMKit/WebIDL/CustomEventInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class CustomEventInit: JSObject { - public init(detail: JSValue) { +public class CustomEventInit: BridgedDictionary { + public convenience init(detail: JSValue) { let object = JSObject.global.Object.function!.new() object["detail"] = detail.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _detail = ReadWriteAttribute(jsObject: object, name: "detail") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift index fce9728e..a62b8d62 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class DOMMatrix2DInit: JSObject { - public init(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double, m11: Double, m12: Double, m21: Double, m22: Double, m41: Double, m42: Double) { +public class DOMMatrix2DInit: BridgedDictionary { + public convenience init(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double, m11: Double, m12: Double, m21: Double, m22: Double, m41: Double, m42: Double) { let object = JSObject.global.Object.function!.new() object["a"] = a.jsValue() object["b"] = b.jsValue() @@ -18,6 +18,10 @@ public class DOMMatrix2DInit: JSObject { object["m22"] = m22.jsValue() object["m41"] = m41.jsValue() object["m42"] = m42.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _a = ReadWriteAttribute(jsObject: object, name: "a") _b = ReadWriteAttribute(jsObject: object, name: "b") _c = ReadWriteAttribute(jsObject: object, name: "c") @@ -30,7 +34,7 @@ public class DOMMatrix2DInit: JSObject { _m22 = ReadWriteAttribute(jsObject: object, name: "m22") _m41 = ReadWriteAttribute(jsObject: object, name: "m41") _m42 = ReadWriteAttribute(jsObject: object, name: "m42") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift index 96147b67..da50f78d 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class DOMMatrixInit: JSObject { - public init(m13: Double, m14: Double, m23: Double, m24: Double, m31: Double, m32: Double, m33: Double, m34: Double, m43: Double, m44: Double, is2D: Bool) { +public class DOMMatrixInit: BridgedDictionary { + public convenience init(m13: Double, m14: Double, m23: Double, m24: Double, m31: Double, m32: Double, m33: Double, m34: Double, m43: Double, m44: Double, is2D: Bool) { let object = JSObject.global.Object.function!.new() object["m13"] = m13.jsValue() object["m14"] = m14.jsValue() @@ -17,6 +17,10 @@ public class DOMMatrixInit: JSObject { object["m43"] = m43.jsValue() object["m44"] = m44.jsValue() object["is2D"] = is2D.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _m13 = ReadWriteAttribute(jsObject: object, name: "m13") _m14 = ReadWriteAttribute(jsObject: object, name: "m14") _m23 = ReadWriteAttribute(jsObject: object, name: "m23") @@ -28,7 +32,7 @@ public class DOMMatrixInit: JSObject { _m43 = ReadWriteAttribute(jsObject: object, name: "m43") _m44 = ReadWriteAttribute(jsObject: object, name: "m44") _is2D = ReadWriteAttribute(jsObject: object, name: "is2D") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DOMPointInit.swift b/Sources/DOMKit/WebIDL/DOMPointInit.swift index 88a348fe..dc11d32d 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public class DOMPointInit: JSObject { - public init(x: Double, y: Double, z: Double, w: Double) { +public class DOMPointInit: BridgedDictionary { + public convenience init(x: Double, y: Double, z: Double, w: Double) { let object = JSObject.global.Object.function!.new() object["x"] = x.jsValue() object["y"] = y.jsValue() object["z"] = z.jsValue() object["w"] = w.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _x = ReadWriteAttribute(jsObject: object, name: "x") _y = ReadWriteAttribute(jsObject: object, name: "y") _z = ReadWriteAttribute(jsObject: object, name: "z") _w = ReadWriteAttribute(jsObject: object, name: "w") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DOMQuadInit.swift b/Sources/DOMKit/WebIDL/DOMQuadInit.swift index 46d736d2..86d8ae47 100644 --- a/Sources/DOMKit/WebIDL/DOMQuadInit.swift +++ b/Sources/DOMKit/WebIDL/DOMQuadInit.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public class DOMQuadInit: JSObject { - public init(p1: DOMPointInit, p2: DOMPointInit, p3: DOMPointInit, p4: DOMPointInit) { +public class DOMQuadInit: BridgedDictionary { + public convenience init(p1: DOMPointInit, p2: DOMPointInit, p3: DOMPointInit, p4: DOMPointInit) { let object = JSObject.global.Object.function!.new() object["p1"] = p1.jsValue() object["p2"] = p2.jsValue() object["p3"] = p3.jsValue() object["p4"] = p4.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _p1 = ReadWriteAttribute(jsObject: object, name: "p1") _p2 = ReadWriteAttribute(jsObject: object, name: "p2") _p3 = ReadWriteAttribute(jsObject: object, name: "p3") _p4 = ReadWriteAttribute(jsObject: object, name: "p4") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DOMRectInit.swift b/Sources/DOMKit/WebIDL/DOMRectInit.swift index 2efdbdb7..bf141ef3 100644 --- a/Sources/DOMKit/WebIDL/DOMRectInit.swift +++ b/Sources/DOMKit/WebIDL/DOMRectInit.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public class DOMRectInit: JSObject { - public init(x: Double, y: Double, width: Double, height: Double) { +public class DOMRectInit: BridgedDictionary { + public convenience init(x: Double, y: Double, width: Double, height: Double) { let object = JSObject.global.Object.function!.new() object["x"] = x.jsValue() object["y"] = y.jsValue() object["width"] = width.jsValue() object["height"] = height.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _x = ReadWriteAttribute(jsObject: object, name: "x") _y = ReadWriteAttribute(jsObject: object, name: "y") _width = ReadWriteAttribute(jsObject: object, name: "width") _height = ReadWriteAttribute(jsObject: object, name: "height") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DragEventInit.swift b/Sources/DOMKit/WebIDL/DragEventInit.swift index 8f1eec27..7c28187f 100644 --- a/Sources/DOMKit/WebIDL/DragEventInit.swift +++ b/Sources/DOMKit/WebIDL/DragEventInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class DragEventInit: JSObject { - public init(dataTransfer: DataTransfer?) { +public class DragEventInit: BridgedDictionary { + public convenience init(dataTransfer: DataTransfer?) { let object = JSObject.global.Object.function!.new() object["dataTransfer"] = dataTransfer.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _dataTransfer = ReadWriteAttribute(jsObject: object, name: "dataTransfer") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift index 72bb3297..5ee018b7 100644 --- a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class ElementCreationOptions: JSObject { - public init(is: String) { +public class ElementCreationOptions: BridgedDictionary { + public convenience init(is: String) { let object = JSObject.global.Object.function!.new() object["is"] = `is`.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _is = ReadWriteAttribute(jsObject: object, name: "is") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift index ad6f59cb..0e5a7431 100644 --- a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class ElementDefinitionOptions: JSObject { - public init(extends: String) { +public class ElementDefinitionOptions: BridgedDictionary { + public convenience init(extends: String) { let object = JSObject.global.Object.function!.new() object["extends"] = extends.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _extends = ReadWriteAttribute(jsObject: object, name: "extends") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ErrorEventInit.swift b/Sources/DOMKit/WebIDL/ErrorEventInit.swift index ccf19955..b1283c4a 100644 --- a/Sources/DOMKit/WebIDL/ErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/ErrorEventInit.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public class ErrorEventInit: JSObject { - public init(message: String, filename: String, lineno: UInt32, colno: UInt32, error: JSValue) { +public class ErrorEventInit: BridgedDictionary { + public convenience init(message: String, filename: String, lineno: UInt32, colno: UInt32, error: JSValue) { let object = JSObject.global.Object.function!.new() object["message"] = message.jsValue() object["filename"] = filename.jsValue() object["lineno"] = lineno.jsValue() object["colno"] = colno.jsValue() object["error"] = error.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _message = ReadWriteAttribute(jsObject: object, name: "message") _filename = ReadWriteAttribute(jsObject: object, name: "filename") _lineno = ReadWriteAttribute(jsObject: object, name: "lineno") _colno = ReadWriteAttribute(jsObject: object, name: "colno") _error = ReadWriteAttribute(jsObject: object, name: "error") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/EventInit.swift b/Sources/DOMKit/WebIDL/EventInit.swift index 5aec4ad5..a85bad89 100644 --- a/Sources/DOMKit/WebIDL/EventInit.swift +++ b/Sources/DOMKit/WebIDL/EventInit.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class EventInit: JSObject { - public init(bubbles: Bool, cancelable: Bool, composed: Bool) { +public class EventInit: BridgedDictionary { + public convenience init(bubbles: Bool, cancelable: Bool, composed: Bool) { let object = JSObject.global.Object.function!.new() object["bubbles"] = bubbles.jsValue() object["cancelable"] = cancelable.jsValue() object["composed"] = composed.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _bubbles = ReadWriteAttribute(jsObject: object, name: "bubbles") _cancelable = ReadWriteAttribute(jsObject: object, name: "cancelable") _composed = ReadWriteAttribute(jsObject: object, name: "composed") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/EventListenerOptions.swift b/Sources/DOMKit/WebIDL/EventListenerOptions.swift index 2df1db5b..6edec737 100644 --- a/Sources/DOMKit/WebIDL/EventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/EventListenerOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class EventListenerOptions: JSObject { - public init(capture: Bool) { +public class EventListenerOptions: BridgedDictionary { + public convenience init(capture: Bool) { let object = JSObject.global.Object.function!.new() object["capture"] = capture.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _capture = ReadWriteAttribute(jsObject: object, name: "capture") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/EventModifierInit.swift b/Sources/DOMKit/WebIDL/EventModifierInit.swift index 04f085c5..01a53e06 100644 --- a/Sources/DOMKit/WebIDL/EventModifierInit.swift +++ b/Sources/DOMKit/WebIDL/EventModifierInit.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class EventModifierInit: JSObject { - public init(ctrlKey: Bool, shiftKey: Bool, altKey: Bool, metaKey: Bool, modifierAltGraph: Bool, modifierCapsLock: Bool, modifierFn: Bool, modifierFnLock: Bool, modifierHyper: Bool, modifierNumLock: Bool, modifierScrollLock: Bool, modifierSuper: Bool, modifierSymbol: Bool, modifierSymbolLock: Bool) { +public class EventModifierInit: BridgedDictionary { + public convenience init(ctrlKey: Bool, shiftKey: Bool, altKey: Bool, metaKey: Bool, modifierAltGraph: Bool, modifierCapsLock: Bool, modifierFn: Bool, modifierFnLock: Bool, modifierHyper: Bool, modifierNumLock: Bool, modifierScrollLock: Bool, modifierSuper: Bool, modifierSymbol: Bool, modifierSymbolLock: Bool) { let object = JSObject.global.Object.function!.new() object["ctrlKey"] = ctrlKey.jsValue() object["shiftKey"] = shiftKey.jsValue() @@ -20,6 +20,10 @@ public class EventModifierInit: JSObject { object["modifierSuper"] = modifierSuper.jsValue() object["modifierSymbol"] = modifierSymbol.jsValue() object["modifierSymbolLock"] = modifierSymbolLock.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _ctrlKey = ReadWriteAttribute(jsObject: object, name: "ctrlKey") _shiftKey = ReadWriteAttribute(jsObject: object, name: "shiftKey") _altKey = ReadWriteAttribute(jsObject: object, name: "altKey") @@ -34,7 +38,7 @@ public class EventModifierInit: JSObject { _modifierSuper = ReadWriteAttribute(jsObject: object, name: "modifierSuper") _modifierSymbol = ReadWriteAttribute(jsObject: object, name: "modifierSymbol") _modifierSymbolLock = ReadWriteAttribute(jsObject: object, name: "modifierSymbolLock") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/EventSourceInit.swift b/Sources/DOMKit/WebIDL/EventSourceInit.swift index 94e5cfac..f3f2bf7f 100644 --- a/Sources/DOMKit/WebIDL/EventSourceInit.swift +++ b/Sources/DOMKit/WebIDL/EventSourceInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class EventSourceInit: JSObject { - public init(withCredentials: Bool) { +public class EventSourceInit: BridgedDictionary { + public convenience init(withCredentials: Bool) { let object = JSObject.global.Object.function!.new() object["withCredentials"] = withCredentials.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _withCredentials = ReadWriteAttribute(jsObject: object, name: "withCredentials") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/FilePropertyBag.swift b/Sources/DOMKit/WebIDL/FilePropertyBag.swift index 07fe8dca..d0fa3042 100644 --- a/Sources/DOMKit/WebIDL/FilePropertyBag.swift +++ b/Sources/DOMKit/WebIDL/FilePropertyBag.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class FilePropertyBag: JSObject { - public init(lastModified: Int64) { +public class FilePropertyBag: BridgedDictionary { + public convenience init(lastModified: Int64) { let object = JSObject.global.Object.function!.new() object["lastModified"] = lastModified.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _lastModified = ReadWriteAttribute(jsObject: object, name: "lastModified") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/FocusEventInit.swift b/Sources/DOMKit/WebIDL/FocusEventInit.swift index ac9294dc..dece5805 100644 --- a/Sources/DOMKit/WebIDL/FocusEventInit.swift +++ b/Sources/DOMKit/WebIDL/FocusEventInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class FocusEventInit: JSObject { - public init(relatedTarget: EventTarget?) { +public class FocusEventInit: BridgedDictionary { + public convenience init(relatedTarget: EventTarget?) { let object = JSObject.global.Object.function!.new() object["relatedTarget"] = relatedTarget.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _relatedTarget = ReadWriteAttribute(jsObject: object, name: "relatedTarget") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/FocusOptions.swift b/Sources/DOMKit/WebIDL/FocusOptions.swift index 4e5c2d48..936052a6 100644 --- a/Sources/DOMKit/WebIDL/FocusOptions.swift +++ b/Sources/DOMKit/WebIDL/FocusOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class FocusOptions: JSObject { - public init(preventScroll: Bool) { +public class FocusOptions: BridgedDictionary { + public convenience init(preventScroll: Bool) { let object = JSObject.global.Object.function!.new() object["preventScroll"] = preventScroll.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _preventScroll = ReadWriteAttribute(jsObject: object, name: "preventScroll") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/FormDataEventInit.swift b/Sources/DOMKit/WebIDL/FormDataEventInit.swift index 97edcded..36342bf6 100644 --- a/Sources/DOMKit/WebIDL/FormDataEventInit.swift +++ b/Sources/DOMKit/WebIDL/FormDataEventInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class FormDataEventInit: JSObject { - public init(formData: FormData) { +public class FormDataEventInit: BridgedDictionary { + public convenience init(formData: FormData) { let object = JSObject.global.Object.function!.new() object["formData"] = formData.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _formData = ReadWriteAttribute(jsObject: object, name: "formData") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift index 0ecd17c2..7a3c20e3 100644 --- a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift +++ b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class GetRootNodeOptions: JSObject { - public init(composed: Bool) { +public class GetRootNodeOptions: BridgedDictionary { + public convenience init(composed: Bool) { let object = JSObject.global.Object.function!.new() object["composed"] = composed.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _composed = ReadWriteAttribute(jsObject: object, name: "composed") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift index 361122bd..0187907b 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift @@ -3,14 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit -public class HashChangeEventInit: JSObject { - public init(oldURL: String, newURL: String) { +public class HashChangeEventInit: BridgedDictionary { + public convenience init(oldURL: String, newURL: String) { let object = JSObject.global.Object.function!.new() object["oldURL"] = oldURL.jsValue() object["newURL"] = newURL.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _oldURL = ReadWriteAttribute(jsObject: object, name: "oldURL") _newURL = ReadWriteAttribute(jsObject: object, name: "newURL") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift index 81431c9d..5a15a988 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class ImageBitmapOptions: JSObject { - public init(imageOrientation: ImageOrientation, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, resizeWidth: UInt32, resizeHeight: UInt32, resizeQuality: ResizeQuality) { +public class ImageBitmapOptions: BridgedDictionary { + public convenience init(imageOrientation: ImageOrientation, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, resizeWidth: UInt32, resizeHeight: UInt32, resizeQuality: ResizeQuality) { let object = JSObject.global.Object.function!.new() object["imageOrientation"] = imageOrientation.jsValue() object["premultiplyAlpha"] = premultiplyAlpha.jsValue() @@ -12,13 +12,17 @@ public class ImageBitmapOptions: JSObject { object["resizeWidth"] = resizeWidth.jsValue() object["resizeHeight"] = resizeHeight.jsValue() object["resizeQuality"] = resizeQuality.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _imageOrientation = ReadWriteAttribute(jsObject: object, name: "imageOrientation") _premultiplyAlpha = ReadWriteAttribute(jsObject: object, name: "premultiplyAlpha") _colorSpaceConversion = ReadWriteAttribute(jsObject: object, name: "colorSpaceConversion") _resizeWidth = ReadWriteAttribute(jsObject: object, name: "resizeWidth") _resizeHeight = ReadWriteAttribute(jsObject: object, name: "resizeHeight") _resizeQuality = ReadWriteAttribute(jsObject: object, name: "resizeQuality") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift index a9025bb4..97bd62fa 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class ImageBitmapRenderingContextSettings: JSObject { - public init(alpha: Bool) { +public class ImageBitmapRenderingContextSettings: BridgedDictionary { + public convenience init(alpha: Bool) { let object = JSObject.global.Object.function!.new() object["alpha"] = alpha.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _alpha = ReadWriteAttribute(jsObject: object, name: "alpha") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ImageDataSettings.swift b/Sources/DOMKit/WebIDL/ImageDataSettings.swift index 4c03c050..e4e885f6 100644 --- a/Sources/DOMKit/WebIDL/ImageDataSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageDataSettings.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class ImageDataSettings: JSObject { - public init(colorSpace: PredefinedColorSpace) { +public class ImageDataSettings: BridgedDictionary { + public convenience init(colorSpace: PredefinedColorSpace) { let object = JSObject.global.Object.function!.new() object["colorSpace"] = colorSpace.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _colorSpace = ReadWriteAttribute(jsObject: object, name: "colorSpace") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift index 79793de7..5cc0fb12 100644 --- a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift @@ -3,14 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit -public class ImageEncodeOptions: JSObject { - public init(type: String, quality: Double) { +public class ImageEncodeOptions: BridgedDictionary { + public convenience init(type: String, quality: Double) { let object = JSObject.global.Object.function!.new() object["type"] = type.jsValue() object["quality"] = quality.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _type = ReadWriteAttribute(jsObject: object, name: "type") _quality = ReadWriteAttribute(jsObject: object, name: "quality") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift index 839be0d9..eb37490f 100644 --- a/Sources/DOMKit/WebIDL/InputEventInit.swift +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class InputEventInit: JSObject { - public init(data: String?, isComposing: Bool, inputType: String) { +public class InputEventInit: BridgedDictionary { + public convenience init(data: String?, isComposing: Bool, inputType: String) { let object = JSObject.global.Object.function!.new() object["data"] = data.jsValue() object["isComposing"] = isComposing.jsValue() object["inputType"] = inputType.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _data = ReadWriteAttribute(jsObject: object, name: "data") _isComposing = ReadWriteAttribute(jsObject: object, name: "isComposing") _inputType = ReadWriteAttribute(jsObject: object, name: "inputType") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift index 7b7874ef..078701dc 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class KeyboardEventInit: JSObject { - public init(key: String, code: String, location: UInt32, repeat: Bool, isComposing: Bool, charCode: UInt32, keyCode: UInt32) { +public class KeyboardEventInit: BridgedDictionary { + public convenience init(key: String, code: String, location: UInt32, repeat: Bool, isComposing: Bool, charCode: UInt32, keyCode: UInt32) { let object = JSObject.global.Object.function!.new() object["key"] = key.jsValue() object["code"] = code.jsValue() @@ -13,6 +13,10 @@ public class KeyboardEventInit: JSObject { object["isComposing"] = isComposing.jsValue() object["charCode"] = charCode.jsValue() object["keyCode"] = keyCode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _key = ReadWriteAttribute(jsObject: object, name: "key") _code = ReadWriteAttribute(jsObject: object, name: "code") _location = ReadWriteAttribute(jsObject: object, name: "location") @@ -20,7 +24,7 @@ public class KeyboardEventInit: JSObject { _isComposing = ReadWriteAttribute(jsObject: object, name: "isComposing") _charCode = ReadWriteAttribute(jsObject: object, name: "charCode") _keyCode = ReadWriteAttribute(jsObject: object, name: "keyCode") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/MessageEventInit.swift b/Sources/DOMKit/WebIDL/MessageEventInit.swift index 7896e517..35608a5c 100644 --- a/Sources/DOMKit/WebIDL/MessageEventInit.swift +++ b/Sources/DOMKit/WebIDL/MessageEventInit.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public class MessageEventInit: JSObject { - public init(data: JSValue, origin: String, lastEventId: String, source: MessageEventSource?, ports: [MessagePort]) { +public class MessageEventInit: BridgedDictionary { + public convenience init(data: JSValue, origin: String, lastEventId: String, source: MessageEventSource?, ports: [MessagePort]) { let object = JSObject.global.Object.function!.new() object["data"] = data.jsValue() object["origin"] = origin.jsValue() object["lastEventId"] = lastEventId.jsValue() object["source"] = source.jsValue() object["ports"] = ports.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _data = ReadWriteAttribute(jsObject: object, name: "data") _origin = ReadWriteAttribute(jsObject: object, name: "origin") _lastEventId = ReadWriteAttribute(jsObject: object, name: "lastEventId") _source = ReadWriteAttribute(jsObject: object, name: "source") _ports = ReadWriteAttribute(jsObject: object, name: "ports") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/MouseEventInit.swift b/Sources/DOMKit/WebIDL/MouseEventInit.swift index 8782fdd3..ebfea6da 100644 --- a/Sources/DOMKit/WebIDL/MouseEventInit.swift +++ b/Sources/DOMKit/WebIDL/MouseEventInit.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class MouseEventInit: JSObject { - public init(screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { +public class MouseEventInit: BridgedDictionary { + public convenience init(screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { let object = JSObject.global.Object.function!.new() object["screenX"] = screenX.jsValue() object["screenY"] = screenY.jsValue() @@ -13,6 +13,10 @@ public class MouseEventInit: JSObject { object["button"] = button.jsValue() object["buttons"] = buttons.jsValue() object["relatedTarget"] = relatedTarget.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _screenX = ReadWriteAttribute(jsObject: object, name: "screenX") _screenY = ReadWriteAttribute(jsObject: object, name: "screenY") _clientX = ReadWriteAttribute(jsObject: object, name: "clientX") @@ -20,7 +24,7 @@ public class MouseEventInit: JSObject { _button = ReadWriteAttribute(jsObject: object, name: "button") _buttons = ReadWriteAttribute(jsObject: object, name: "buttons") _relatedTarget = ReadWriteAttribute(jsObject: object, name: "relatedTarget") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/MutationObserverInit.swift b/Sources/DOMKit/WebIDL/MutationObserverInit.swift index 725608b3..3e76b371 100644 --- a/Sources/DOMKit/WebIDL/MutationObserverInit.swift +++ b/Sources/DOMKit/WebIDL/MutationObserverInit.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class MutationObserverInit: JSObject { - public init(childList: Bool, attributes: Bool, characterData: Bool, subtree: Bool, attributeOldValue: Bool, characterDataOldValue: Bool, attributeFilter: [String]) { +public class MutationObserverInit: BridgedDictionary { + public convenience init(childList: Bool, attributes: Bool, characterData: Bool, subtree: Bool, attributeOldValue: Bool, characterDataOldValue: Bool, attributeFilter: [String]) { let object = JSObject.global.Object.function!.new() object["childList"] = childList.jsValue() object["attributes"] = attributes.jsValue() @@ -13,6 +13,10 @@ public class MutationObserverInit: JSObject { object["attributeOldValue"] = attributeOldValue.jsValue() object["characterDataOldValue"] = characterDataOldValue.jsValue() object["attributeFilter"] = attributeFilter.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _childList = ReadWriteAttribute(jsObject: object, name: "childList") _attributes = ReadWriteAttribute(jsObject: object, name: "attributes") _characterData = ReadWriteAttribute(jsObject: object, name: "characterData") @@ -20,7 +24,7 @@ public class MutationObserverInit: JSObject { _attributeOldValue = ReadWriteAttribute(jsObject: object, name: "attributeOldValue") _characterDataOldValue = ReadWriteAttribute(jsObject: object, name: "characterDataOldValue") _attributeFilter = ReadWriteAttribute(jsObject: object, name: "attributeFilter") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift index ee1d0d8f..638e577e 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class PageTransitionEventInit: JSObject { - public init(persisted: Bool) { +public class PageTransitionEventInit: BridgedDictionary { + public convenience init(persisted: Bool) { let object = JSObject.global.Object.function!.new() object["persisted"] = persisted.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _persisted = ReadWriteAttribute(jsObject: object, name: "persisted") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/PopStateEventInit.swift b/Sources/DOMKit/WebIDL/PopStateEventInit.swift index fc0da65a..dd86545a 100644 --- a/Sources/DOMKit/WebIDL/PopStateEventInit.swift +++ b/Sources/DOMKit/WebIDL/PopStateEventInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class PopStateEventInit: JSObject { - public init(state: JSValue) { +public class PopStateEventInit: BridgedDictionary { + public convenience init(state: JSValue) { let object = JSObject.global.Object.function!.new() object["state"] = state.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _state = ReadWriteAttribute(jsObject: object, name: "state") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ProgressEventInit.swift b/Sources/DOMKit/WebIDL/ProgressEventInit.swift index a6be450b..1767c3a3 100644 --- a/Sources/DOMKit/WebIDL/ProgressEventInit.swift +++ b/Sources/DOMKit/WebIDL/ProgressEventInit.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class ProgressEventInit: JSObject { - public init(lengthComputable: Bool, loaded: UInt64, total: UInt64) { +public class ProgressEventInit: BridgedDictionary { + public convenience init(lengthComputable: Bool, loaded: UInt64, total: UInt64) { let object = JSObject.global.Object.function!.new() object["lengthComputable"] = lengthComputable.jsValue() object["loaded"] = loaded.jsValue() object["total"] = total.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _lengthComputable = ReadWriteAttribute(jsObject: object, name: "lengthComputable") _loaded = ReadWriteAttribute(jsObject: object, name: "loaded") _total = ReadWriteAttribute(jsObject: object, name: "total") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift index 6e62ec34..b174b5a8 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift @@ -3,14 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit -public class PromiseRejectionEventInit: JSObject { - public init(promise: JSPromise, reason: JSValue) { +public class PromiseRejectionEventInit: BridgedDictionary { + public convenience init(promise: JSPromise, reason: JSValue) { let object = JSObject.global.Object.function!.new() object["promise"] = promise.jsValue() object["reason"] = reason.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _promise = ReadWriteAttribute(jsObject: object, name: "promise") _reason = ReadWriteAttribute(jsObject: object, name: "reason") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/QueuingStrategy.swift b/Sources/DOMKit/WebIDL/QueuingStrategy.swift index 7990e769..2195625c 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategy.swift @@ -3,14 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit -public class QueuingStrategy: JSObject { - public init(highWaterMark: Double, size: @escaping QueuingStrategySize) { +public class QueuingStrategy: BridgedDictionary { + public convenience init(highWaterMark: Double, size: @escaping QueuingStrategySize) { let object = JSObject.global.Object.function!.new() object["highWaterMark"] = highWaterMark.jsValue() ClosureAttribute.Required1["size", in: object] = size + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _highWaterMark = ReadWriteAttribute(jsObject: object, name: "highWaterMark") _size = ClosureAttribute.Required1(jsObject: object, name: "size") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift index 98e3ffbf..7238a493 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class QueuingStrategyInit: JSObject { - public init(highWaterMark: Double) { +public class QueuingStrategyInit: BridgedDictionary { + public convenience init(highWaterMark: Double) { let object = JSObject.global.Object.function!.new() object["highWaterMark"] = highWaterMark.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _highWaterMark = ReadWriteAttribute(jsObject: object, name: "highWaterMark") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift index 7e3ca5c7..efc2cdf8 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift @@ -3,14 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit -public class ReadableStreamBYOBReadResult: JSObject { - public init(value: __UNSUPPORTED_UNION__, done: Bool) { +public class ReadableStreamBYOBReadResult: BridgedDictionary { + public convenience init(value: __UNSUPPORTED_UNION__, done: Bool) { let object = JSObject.global.Object.function!.new() object["value"] = value.jsValue() object["done"] = done.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _value = ReadWriteAttribute(jsObject: object, name: "value") _done = ReadWriteAttribute(jsObject: object, name: "done") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift index 3fd22dd7..8e82b959 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift @@ -3,14 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit -public class ReadableStreamDefaultReadResult: JSObject { - public init(value: JSValue, done: Bool) { +public class ReadableStreamDefaultReadResult: BridgedDictionary { + public convenience init(value: JSValue, done: Bool) { let object = JSObject.global.Object.function!.new() object["value"] = value.jsValue() object["done"] = done.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _value = ReadWriteAttribute(jsObject: object, name: "value") _done = ReadWriteAttribute(jsObject: object, name: "done") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift index 6dc03cf8..88998c20 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class ReadableStreamGetReaderOptions: JSObject { - public init(mode: ReadableStreamReaderMode) { +public class ReadableStreamGetReaderOptions: BridgedDictionary { + public convenience init(mode: ReadableStreamReaderMode) { let object = JSObject.global.Object.function!.new() object["mode"] = mode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _mode = ReadWriteAttribute(jsObject: object, name: "mode") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift index 2f158682..5684f97e 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class ReadableStreamIteratorOptions: JSObject { - public init(preventCancel: Bool) { +public class ReadableStreamIteratorOptions: BridgedDictionary { + public convenience init(preventCancel: Bool) { let object = JSObject.global.Object.function!.new() object["preventCancel"] = preventCancel.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _preventCancel = ReadWriteAttribute(jsObject: object, name: "preventCancel") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift index 63d4e4a3..d3c9cb17 100644 --- a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift +++ b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift @@ -3,14 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit -public class ReadableWritablePair: JSObject { - public init(readable: ReadableStream, writable: WritableStream) { +public class ReadableWritablePair: BridgedDictionary { + public convenience init(readable: ReadableStream, writable: WritableStream) { let object = JSObject.global.Object.function!.new() object["readable"] = readable.jsValue() object["writable"] = writable.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _readable = ReadWriteAttribute(jsObject: object, name: "readable") _writable = ReadWriteAttribute(jsObject: object, name: "writable") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/RequestInit.swift b/Sources/DOMKit/WebIDL/RequestInit.swift index 4b2a2f28..aa4d9ca6 100644 --- a/Sources/DOMKit/WebIDL/RequestInit.swift +++ b/Sources/DOMKit/WebIDL/RequestInit.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class RequestInit: JSObject { - public init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue) { +public class RequestInit: BridgedDictionary { + public convenience init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue) { let object = JSObject.global.Object.function!.new() object["method"] = method.jsValue() object["headers"] = headers.jsValue() @@ -19,6 +19,10 @@ public class RequestInit: JSObject { object["keepalive"] = keepalive.jsValue() object["signal"] = signal.jsValue() object["window"] = window.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _method = ReadWriteAttribute(jsObject: object, name: "method") _headers = ReadWriteAttribute(jsObject: object, name: "headers") _body = ReadWriteAttribute(jsObject: object, name: "body") @@ -32,7 +36,7 @@ public class RequestInit: JSObject { _keepalive = ReadWriteAttribute(jsObject: object, name: "keepalive") _signal = ReadWriteAttribute(jsObject: object, name: "signal") _window = ReadWriteAttribute(jsObject: object, name: "window") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ResponseInit.swift b/Sources/DOMKit/WebIDL/ResponseInit.swift index a20bbde8..4f0b83e5 100644 --- a/Sources/DOMKit/WebIDL/ResponseInit.swift +++ b/Sources/DOMKit/WebIDL/ResponseInit.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class ResponseInit: JSObject { - public init(status: UInt16, statusText: String, headers: HeadersInit) { +public class ResponseInit: BridgedDictionary { + public convenience init(status: UInt16, statusText: String, headers: HeadersInit) { let object = JSObject.global.Object.function!.new() object["status"] = status.jsValue() object["statusText"] = statusText.jsValue() object["headers"] = headers.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _status = ReadWriteAttribute(jsObject: object, name: "status") _statusText = ReadWriteAttribute(jsObject: object, name: "statusText") _headers = ReadWriteAttribute(jsObject: object, name: "headers") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ShadowRootInit.swift b/Sources/DOMKit/WebIDL/ShadowRootInit.swift index 464e85d3..17f33188 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootInit.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootInit.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class ShadowRootInit: JSObject { - public init(mode: ShadowRootMode, delegatesFocus: Bool, slotAssignment: SlotAssignmentMode) { +public class ShadowRootInit: BridgedDictionary { + public convenience init(mode: ShadowRootMode, delegatesFocus: Bool, slotAssignment: SlotAssignmentMode) { let object = JSObject.global.Object.function!.new() object["mode"] = mode.jsValue() object["delegatesFocus"] = delegatesFocus.jsValue() object["slotAssignment"] = slotAssignment.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _mode = ReadWriteAttribute(jsObject: object, name: "mode") _delegatesFocus = ReadWriteAttribute(jsObject: object, name: "delegatesFocus") _slotAssignment = ReadWriteAttribute(jsObject: object, name: "slotAssignment") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/StaticRangeInit.swift b/Sources/DOMKit/WebIDL/StaticRangeInit.swift index b5147037..b53c6244 100644 --- a/Sources/DOMKit/WebIDL/StaticRangeInit.swift +++ b/Sources/DOMKit/WebIDL/StaticRangeInit.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public class StaticRangeInit: JSObject { - public init(startContainer: Node, startOffset: UInt32, endContainer: Node, endOffset: UInt32) { +public class StaticRangeInit: BridgedDictionary { + public convenience init(startContainer: Node, startOffset: UInt32, endContainer: Node, endOffset: UInt32) { let object = JSObject.global.Object.function!.new() object["startContainer"] = startContainer.jsValue() object["startOffset"] = startOffset.jsValue() object["endContainer"] = endContainer.jsValue() object["endOffset"] = endOffset.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _startContainer = ReadWriteAttribute(jsObject: object, name: "startContainer") _startOffset = ReadWriteAttribute(jsObject: object, name: "startOffset") _endContainer = ReadWriteAttribute(jsObject: object, name: "endContainer") _endOffset = ReadWriteAttribute(jsObject: object, name: "endOffset") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/StorageEventInit.swift b/Sources/DOMKit/WebIDL/StorageEventInit.swift index e07f376c..935cfe03 100644 --- a/Sources/DOMKit/WebIDL/StorageEventInit.swift +++ b/Sources/DOMKit/WebIDL/StorageEventInit.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public class StorageEventInit: JSObject { - public init(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?) { +public class StorageEventInit: BridgedDictionary { + public convenience init(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?) { let object = JSObject.global.Object.function!.new() object["key"] = key.jsValue() object["oldValue"] = oldValue.jsValue() object["newValue"] = newValue.jsValue() object["url"] = url.jsValue() object["storageArea"] = storageArea.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _key = ReadWriteAttribute(jsObject: object, name: "key") _oldValue = ReadWriteAttribute(jsObject: object, name: "oldValue") _newValue = ReadWriteAttribute(jsObject: object, name: "newValue") _url = ReadWriteAttribute(jsObject: object, name: "url") _storageArea = ReadWriteAttribute(jsObject: object, name: "storageArea") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift index 18222a88..ab494046 100644 --- a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift +++ b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public class StreamPipeOptions: JSObject { - public init(preventClose: Bool, preventAbort: Bool, preventCancel: Bool, signal: AbortSignal) { +public class StreamPipeOptions: BridgedDictionary { + public convenience init(preventClose: Bool, preventAbort: Bool, preventCancel: Bool, signal: AbortSignal) { let object = JSObject.global.Object.function!.new() object["preventClose"] = preventClose.jsValue() object["preventAbort"] = preventAbort.jsValue() object["preventCancel"] = preventCancel.jsValue() object["signal"] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _preventClose = ReadWriteAttribute(jsObject: object, name: "preventClose") _preventAbort = ReadWriteAttribute(jsObject: object, name: "preventAbort") _preventCancel = ReadWriteAttribute(jsObject: object, name: "preventCancel") _signal = ReadWriteAttribute(jsObject: object, name: "signal") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift index 2136271b..b517cea1 100644 --- a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift +++ b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class StructuredSerializeOptions: JSObject { - public init(transfer: [JSObject]) { +public class StructuredSerializeOptions: BridgedDictionary { + public convenience init(transfer: [JSObject]) { let object = JSObject.global.Object.function!.new() object["transfer"] = transfer.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _transfer = ReadWriteAttribute(jsObject: object, name: "transfer") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/SubmitEventInit.swift b/Sources/DOMKit/WebIDL/SubmitEventInit.swift index 7d4a7d16..7c68bbd2 100644 --- a/Sources/DOMKit/WebIDL/SubmitEventInit.swift +++ b/Sources/DOMKit/WebIDL/SubmitEventInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class SubmitEventInit: JSObject { - public init(submitter: HTMLElement?) { +public class SubmitEventInit: BridgedDictionary { + public convenience init(submitter: HTMLElement?) { let object = JSObject.global.Object.function!.new() object["submitter"] = submitter.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _submitter = ReadWriteAttribute(jsObject: object, name: "submitter") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/TrackEventInit.swift b/Sources/DOMKit/WebIDL/TrackEventInit.swift index 44acdc88..f8f7eec3 100644 --- a/Sources/DOMKit/WebIDL/TrackEventInit.swift +++ b/Sources/DOMKit/WebIDL/TrackEventInit.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class TrackEventInit: JSObject { - public init(track: __UNSUPPORTED_UNION__?) { +public class TrackEventInit: BridgedDictionary { + public convenience init(track: __UNSUPPORTED_UNION__?) { let object = JSObject.global.Object.function!.new() object["track"] = track.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _track = ReadWriteAttribute(jsObject: object, name: "track") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/Transformer.swift b/Sources/DOMKit/WebIDL/Transformer.swift index 7d356852..cea69b86 100644 --- a/Sources/DOMKit/WebIDL/Transformer.swift +++ b/Sources/DOMKit/WebIDL/Transformer.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public class Transformer: JSObject { - public init(start: @escaping TransformerStartCallback, transform: @escaping TransformerTransformCallback, flush: @escaping TransformerFlushCallback, readableType: JSValue, writableType: JSValue) { +public class Transformer: BridgedDictionary { + public convenience init(start: @escaping TransformerStartCallback, transform: @escaping TransformerTransformCallback, flush: @escaping TransformerFlushCallback, readableType: JSValue, writableType: JSValue) { let object = JSObject.global.Object.function!.new() ClosureAttribute.Required1["start", in: object] = start ClosureAttribute.Required2["transform", in: object] = transform ClosureAttribute.Required1["flush", in: object] = flush object["readableType"] = readableType.jsValue() object["writableType"] = writableType.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _start = ClosureAttribute.Required1(jsObject: object, name: "start") _transform = ClosureAttribute.Required2(jsObject: object, name: "transform") _flush = ClosureAttribute.Required1(jsObject: object, name: "flush") _readableType = ReadWriteAttribute(jsObject: object, name: "readableType") _writableType = ReadWriteAttribute(jsObject: object, name: "writableType") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ClosureAttribute.Required1 diff --git a/Sources/DOMKit/WebIDL/UIEventInit.swift b/Sources/DOMKit/WebIDL/UIEventInit.swift index 4a210a39..a172283a 100644 --- a/Sources/DOMKit/WebIDL/UIEventInit.swift +++ b/Sources/DOMKit/WebIDL/UIEventInit.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class UIEventInit: JSObject { - public init(view: Window?, detail: Int32, which: UInt32) { +public class UIEventInit: BridgedDictionary { + public convenience init(view: Window?, detail: Int32, which: UInt32) { let object = JSObject.global.Object.function!.new() object["view"] = view.jsValue() object["detail"] = detail.jsValue() object["which"] = which.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _view = ReadWriteAttribute(jsObject: object, name: "view") _detail = ReadWriteAttribute(jsObject: object, name: "detail") _which = ReadWriteAttribute(jsObject: object, name: "which") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift index 265c3e75..b9c1a4b0 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSink.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSink.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public class UnderlyingSink: JSObject { - public init(start: @escaping UnderlyingSinkStartCallback, write: @escaping UnderlyingSinkWriteCallback, close: @escaping UnderlyingSinkCloseCallback, abort: @escaping UnderlyingSinkAbortCallback, type: 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.Object.function!.new() ClosureAttribute.Required1["start", in: object] = start ClosureAttribute.Required2["write", in: object] = write ClosureAttribute.Required0["close", in: object] = close ClosureAttribute.Required1["abort", in: object] = abort object["type"] = type.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _start = ClosureAttribute.Required1(jsObject: object, name: "start") _write = ClosureAttribute.Required2(jsObject: object, name: "write") _close = ClosureAttribute.Required0(jsObject: object, name: "close") _abort = ClosureAttribute.Required1(jsObject: object, name: "abort") _type = ReadWriteAttribute(jsObject: object, name: "type") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ClosureAttribute.Required1 diff --git a/Sources/DOMKit/WebIDL/UnderlyingSource.swift b/Sources/DOMKit/WebIDL/UnderlyingSource.swift index bfab348c..db2e673a 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSource.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSource.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public class UnderlyingSource: JSObject { - public init(start: @escaping UnderlyingSourceStartCallback, pull: @escaping UnderlyingSourcePullCallback, cancel: @escaping UnderlyingSourceCancelCallback, type: ReadableStreamType, autoAllocateChunkSize: UInt64) { +public class UnderlyingSource: BridgedDictionary { + public convenience init(start: @escaping UnderlyingSourceStartCallback, pull: @escaping UnderlyingSourcePullCallback, cancel: @escaping UnderlyingSourceCancelCallback, type: ReadableStreamType, autoAllocateChunkSize: UInt64) { let object = JSObject.global.Object.function!.new() ClosureAttribute.Required1["start", in: object] = start ClosureAttribute.Required1["pull", in: object] = pull ClosureAttribute.Required1["cancel", in: object] = cancel object["type"] = type.jsValue() object["autoAllocateChunkSize"] = autoAllocateChunkSize.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _start = ClosureAttribute.Required1(jsObject: object, name: "start") _pull = ClosureAttribute.Required1(jsObject: object, name: "pull") _cancel = ClosureAttribute.Required1(jsObject: object, name: "cancel") _type = ReadWriteAttribute(jsObject: object, name: "type") _autoAllocateChunkSize = ReadWriteAttribute(jsObject: object, name: "autoAllocateChunkSize") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ClosureAttribute.Required1 diff --git a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift index 55e51486..9784488d 100644 --- a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift +++ b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class ValidityStateFlags: JSObject { - public init(valueMissing: Bool, typeMismatch: Bool, patternMismatch: Bool, tooLong: Bool, tooShort: Bool, rangeUnderflow: Bool, rangeOverflow: Bool, stepMismatch: Bool, badInput: Bool, customError: 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.Object.function!.new() object["valueMissing"] = valueMissing.jsValue() object["typeMismatch"] = typeMismatch.jsValue() @@ -16,6 +16,10 @@ public class ValidityStateFlags: JSObject { object["stepMismatch"] = stepMismatch.jsValue() object["badInput"] = badInput.jsValue() object["customError"] = customError.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _valueMissing = ReadWriteAttribute(jsObject: object, name: "valueMissing") _typeMismatch = ReadWriteAttribute(jsObject: object, name: "typeMismatch") _patternMismatch = ReadWriteAttribute(jsObject: object, name: "patternMismatch") @@ -26,7 +30,7 @@ public class ValidityStateFlags: JSObject { _stepMismatch = ReadWriteAttribute(jsObject: object, name: "stepMismatch") _badInput = ReadWriteAttribute(jsObject: object, name: "badInput") _customError = ReadWriteAttribute(jsObject: object, name: "customError") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/WheelEventInit.swift b/Sources/DOMKit/WebIDL/WheelEventInit.swift index f6fbfffd..53396cee 100644 --- a/Sources/DOMKit/WebIDL/WheelEventInit.swift +++ b/Sources/DOMKit/WebIDL/WheelEventInit.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public class WheelEventInit: JSObject { - public init(deltaX: Double, deltaY: Double, deltaZ: Double, deltaMode: UInt32) { +public class WheelEventInit: BridgedDictionary { + public convenience init(deltaX: Double, deltaY: Double, deltaZ: Double, deltaMode: UInt32) { let object = JSObject.global.Object.function!.new() object["deltaX"] = deltaX.jsValue() object["deltaY"] = deltaY.jsValue() object["deltaZ"] = deltaZ.jsValue() object["deltaMode"] = deltaMode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _deltaX = ReadWriteAttribute(jsObject: object, name: "deltaX") _deltaY = ReadWriteAttribute(jsObject: object, name: "deltaY") _deltaZ = ReadWriteAttribute(jsObject: object, name: "deltaZ") _deltaMode = ReadWriteAttribute(jsObject: object, name: "deltaMode") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift index d09ccc06..74af44aa 100644 --- a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift +++ b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class WindowPostMessageOptions: JSObject { - public init(targetOrigin: String) { +public class WindowPostMessageOptions: BridgedDictionary { + public convenience init(targetOrigin: String) { let object = JSObject.global.Object.function!.new() object["targetOrigin"] = targetOrigin.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _targetOrigin = ReadWriteAttribute(jsObject: object, name: "targetOrigin") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/WorkerOptions.swift b/Sources/DOMKit/WebIDL/WorkerOptions.swift index 7ee18b4a..698db9db 100644 --- a/Sources/DOMKit/WebIDL/WorkerOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkerOptions.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class WorkerOptions: JSObject { - public init(type: WorkerType, credentials: RequestCredentials, name: String) { +public class WorkerOptions: BridgedDictionary { + public convenience init(type: WorkerType, credentials: RequestCredentials, name: String) { let object = JSObject.global.Object.function!.new() object["type"] = type.jsValue() object["credentials"] = credentials.jsValue() object["name"] = name.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _type = ReadWriteAttribute(jsObject: object, name: "type") _credentials = ReadWriteAttribute(jsObject: object, name: "credentials") _name = ReadWriteAttribute(jsObject: object, name: "name") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/WorkletOptions.swift b/Sources/DOMKit/WebIDL/WorkletOptions.swift index ff9c7ab3..26caffaf 100644 --- a/Sources/DOMKit/WebIDL/WorkletOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkletOptions.swift @@ -3,12 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class WorkletOptions: JSObject { - public init(credentials: RequestCredentials) { +public class WorkletOptions: BridgedDictionary { + public convenience init(credentials: RequestCredentials) { let object = JSObject.global.Object.function!.new() object["credentials"] = credentials.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { _credentials = ReadWriteAttribute(jsObject: object, name: "credentials") - super.init(cloning: object) + super.init(unsafelyWrapping: object) } @ReadWriteAttribute diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 4ce9a768..a04a25fb 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -62,43 +62,54 @@ extension IDLAttribute: SwiftRepresentable, Initializable { extension MergedDictionary: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public class \(name): JSObject { + public class \(name): BridgedDictionary { \(swiftInit) \(swiftMembers.joined(separator: "\n\n")) } """ } + private var membersWithPropertyWrapper: [(IDLDictionary.Member, SwiftSource)] { + members.map { + ($0, $0.idlType.propertyWrapper(readonly: false)) + } + } + private var swiftInit: SwiftSource { - """ - public init(\(sequence: members.map { "\($0.name): \($0.idlType.isFunction ? "@escaping " : "")\($0.idlType)" })) { + let params: [SwiftSource] = members.map { + "\($0.name): \($0.idlType.isFunction ? "@escaping " : "")\($0.idlType)" + } + return """ + public convenience init(\(sequence: params)) { let object = JSObject.global.Object.function!.new() - \(lines: members.map { - if $0.idlType.isFunction { + \(lines: membersWithPropertyWrapper.map { member, wrapper in + if member.idlType.isFunction { return """ - \($0.idlType.propertyWrapper(readonly: false))[\(quoted: $0.name), in: object] = \($0.name) + \(wrapper)[\(quoted: member.name), in: object] = \(member.name) """ } else { return """ - object[\(quoted: $0.name)] = \($0.name).jsValue() + object[\(quoted: member.name)] = \(member.name).jsValue() """ } }) - \(lines: members.map { - """ - _\(raw: $0.name) = \($0.idlType.propertyWrapper(readonly: false))(jsObject: object, name: \(quoted: $0.name)) - """ + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + \(lines: membersWithPropertyWrapper.map { member, wrapper in + "_\(raw: member.name) = \(wrapper)(jsObject: object, name: \(quoted: member.name))" }) - super.init(cloning: object) + super.init(unsafelyWrapping: object) } """ } private var swiftMembers: [SwiftSource] { - members.map { + membersWithPropertyWrapper.map { member, wrapper in """ - @\($0.idlType.propertyWrapper(readonly: false)) - public var \($0.name): \($0.idlType) + @\(wrapper) + public var \(member.name): \(member.idlType) """ } } From aacbe797e69d2a5597c3a353e4bf6c5ab52aa29c Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 1 Apr 2022 19:06:11 -0400 Subject: [PATCH 081/124] Just quote all the names and let SwiftFormat sort it out --- Sources/WebIDLToSwift/ClosureWrappers.swift | 6 +- .../WebIDLToSwift/SwiftRepresentation.swift | 23 ----- Sources/WebIDLToSwift/SwiftSource.swift | 7 +- .../WebIDL+SwiftRepresentation.swift | 91 ++++++++++--------- 4 files changed, 55 insertions(+), 72 deletions(-) diff --git a/Sources/WebIDLToSwift/ClosureWrappers.swift b/Sources/WebIDLToSwift/ClosureWrappers.swift index 3f12e294..1efde5c1 100644 --- a/Sources/WebIDLToSwift/ClosureWrappers.swift +++ b/Sources/WebIDLToSwift/ClosureWrappers.swift @@ -4,13 +4,13 @@ struct ClosureWrapper: SwiftRepresentable, Equatable { var name: SwiftSource { if nullable { - return "Optional\(String(argCount))" + return "Optional\(raw: String(argCount))" } else { - return "Required\(String(argCount))" + return "Required\(raw: String(argCount))" } } - var indexes: [String] { (0 ..< argCount).map(String.init) } + var indexes: [SwiftSource] { (0 ..< argCount).map(String.init).map(SwiftSource.raw) } private var typeNames: [SwiftSource] { indexes.map { "A\($0)" } + ["ReturnType"] diff --git a/Sources/WebIDLToSwift/SwiftRepresentation.swift b/Sources/WebIDLToSwift/SwiftRepresentation.swift index 8bc01594..b26372f0 100644 --- a/Sources/WebIDLToSwift/SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/SwiftRepresentation.swift @@ -12,26 +12,3 @@ func toSwift(_ value: T) -> SwiftSource { fatalError("Type \(String(describing: type(of: x))) has no Swift representation") } } - -extension String: SwiftRepresentable { - private static let swiftKeywords: Set = [ - "init", - "where", - "protocol", - "struct", - "class", - "enum", - "func", - "static", - "is", - "as", - "default", - "defer", - "self", - "repeat", - ] - - var swiftRepresentation: SwiftSource { - SwiftSource(Self.swiftKeywords.contains(self) ? "`\(self)`" : self) - } -} diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift index 5237ee61..86eddde9 100644 --- a/Sources/WebIDLToSwift/SwiftSource.swift +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -46,8 +46,11 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation, E output += source.source } - @_disfavoredOverload - mutating func appendInterpolation(_ value: T) { + mutating func appendInterpolation(name: String) { + output += "`\(name)`" + } + + mutating func appendInterpolation(_ value: T) where T: SwiftRepresentable { output += toSwift(value).source } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index a04a25fb..23b4c2f9 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -5,12 +5,12 @@ extension IDLArgument: SwiftRepresentable { let type: SwiftSource = variadic ? "\(idlType)..." : "\(idlType)" if optional { if idlType.nullable { - return "\(name): \(type) = nil" + return "\(name: name): \(type) = nil" } else { - return "\(name): \(type)? = nil" + return "\(name: name): \(type)? = nil" } } else { - return "\(name): \(type)" + return "\(name: name): \(type)" } } } @@ -26,7 +26,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { // can't do property wrappers on override declarations return """ private var \(wrapperName): \(idlType.propertyWrapper(readonly: readonly))<\(idlType)> - override public var \(name): \(idlType) { + override public var \(name: name): \(idlType) { get { \(wrapperName).wrappedValue } \(readonly ? "" : "set { \(wrapperName).wrappedValue = newValue }") } @@ -38,7 +38,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { """ return """ - public var \(name): \(idlType) { + public var \(name: name): \(idlType) { get { \(idlType.propertyWrapper(readonly: readonly))[\(quoted: name), in: jsObject] } \(readonly ? "" : setter) } @@ -46,7 +46,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { } else { return """ @\(idlType.propertyWrapper(readonly: readonly)) - public var \(name): \(idlType) + public var \(name: name): \(idlType) """ } } @@ -62,7 +62,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { extension MergedDictionary: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public class \(name): BridgedDictionary { + public class \(name: name): BridgedDictionary { \(swiftInit) \(swiftMembers.joined(separator: "\n\n")) } @@ -77,7 +77,7 @@ extension MergedDictionary: SwiftRepresentable { private var swiftInit: SwiftSource { let params: [SwiftSource] = members.map { - "\($0.name): \($0.idlType.isFunction ? "@escaping " : "")\($0.idlType)" + "\(name: $0.name): \($0.idlType.isFunction ? "@escaping " : "")\($0.idlType)" } return """ public convenience init(\(sequence: params)) { @@ -85,11 +85,11 @@ extension MergedDictionary: SwiftRepresentable { \(lines: membersWithPropertyWrapper.map { member, wrapper in if member.idlType.isFunction { return """ - \(wrapper)[\(quoted: member.name), in: object] = \(member.name) + \(wrapper)[\(quoted: member.name), in: object] = \(name: member.name) """ } else { return """ - object[\(quoted: member.name)] = \(member.name).jsValue() + object[\(quoted: member.name)] = \(name: member.name).jsValue() """ } }) @@ -109,7 +109,7 @@ extension MergedDictionary: SwiftRepresentable { membersWithPropertyWrapper.map { member, wrapper in """ @\(wrapper) - public var \(member.name): \(member.idlType) + public var \(name: member.name): \(member.idlType) """ } } @@ -118,8 +118,8 @@ extension MergedDictionary: SwiftRepresentable { extension IDLEnum: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public enum \(name): String, JSValueCompatible { - \(lines: cases.map { "case \($0.camelized) = \(quoted: $0)" }) + public enum \(name: name): JSString, JSValueCompatible { + \(lines: cases.map { "case \(name: $0.camelized) = \(quoted: $0)" }) public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.string { @@ -138,7 +138,7 @@ extension IDLCallback: SwiftRepresentable { var swiftRepresentation: SwiftSource { Context.requiredClosureArgCounts.insert(arguments.count) return """ - public typealias \(name) = (\(sequence: arguments.map { + public typealias \(name: name) = (\(sequence: arguments.map { "\($0.idlType.swiftRepresentation)\($0.variadic ? "..." : "")" })) -> \(idlType) """ @@ -147,7 +147,7 @@ extension IDLCallback: SwiftRepresentable { extension IDLCallbackInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { - "// XXX: unsupported callback interface: \(name)" + "// XXX: unsupported callback interface: \(raw: name)" } } @@ -157,13 +157,13 @@ protocol Initializable { extension MergedInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let constructor: SwiftSource = "JSObject.global.\(name).function!" - let body = Context.withState(.instance(constructor: constructor, this: "jsObject", className: "\(name)")) { + let constructor: SwiftSource = "JSObject.global.\(name: name).function!" + let body = Context.withState(.instance(constructor: constructor, this: "jsObject", className: "\(name: name)")) { members.map { member in let isOverride: Bool if let memberName = (member as? IDLNamed)?.name { if Context.ignored[name]?.contains(memberName) ?? false { - return "// XXX: member '\(memberName)' is ignored" + return "// XXX: member '\(raw: memberName)' is ignored" } isOverride = parentClasses.flatMap { Context.interfaces[$0]?.members ?? [] @@ -180,15 +180,18 @@ extension MergedInterface: SwiftRepresentable { } let inheritance = (parentClasses.isEmpty ? ["JSBridgedClass"] : parentClasses) + mixins + let initialize: SwiftSource = parentClasses.isEmpty + ? "self.jsObject = jsObject" + : "super.init(unsafelyWrapping: jsObject)" return """ - public class \(name): \(sequence: inheritance.map(SwiftSource.init(_:))) { + public class \(name: name): \(sequence: inheritance.map(SwiftSource.init(_:))) { public\(parentClasses.isEmpty ? "" : " override") class var constructor: JSFunction { \(constructor) } \(parentClasses.isEmpty ? "public let jsObject: JSObject" : "") public required init(unsafelyWrapping jsObject: JSObject) { \(memberInits.joined(separator: "\n")) - \(parentClasses.isEmpty ? "self.jsObject = jsObject" : "super.init(unsafelyWrapping: jsObject)") + \(initialize) } \(body) @@ -217,10 +220,10 @@ extension MergedInterface: SwiftRepresentable { extension MergedMixin: SwiftRepresentable { var swiftRepresentation: SwiftSource { - Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name)")) { + Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name: name)")) { """ - public protocol \(name): JSBridgedClass {} - public extension \(name) { + public protocol \(name: name): JSBridgedClass {} + public extension \(name: name) { \(members.map(toSwift).joined(separator: "\n\n")) } """ @@ -231,7 +234,7 @@ extension MergedMixin: SwiftRepresentable { extension IDLConstant: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { """ - public static let \(name): \(idlType) = \(value) + public static let \(name: name): \(idlType) = \(value) """ } @@ -245,7 +248,7 @@ extension IDLConstructor: SwiftRepresentable, Initializable { return "// XXX: constructor is ignored" } let args: [SwiftSource] = arguments.map { - "\($0.name)\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" + "\(name: $0.name)\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" } return """ public convenience init(\(sequence: arguments.map(\.swiftRepresentation))) { @@ -282,12 +285,12 @@ extension IDLIterableDeclaration: SwiftRepresentable, Initializable { extension MergedNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let this: SwiftSource = "JSObject.global.\(name).object!" - let body = Context.withState(.static(this: this, inClass: false, className: "\(name)")) { + let this: SwiftSource = "JSObject.global.\(name: name).object!" + let body = Context.withState(.static(this: this, inClass: false, className: "\(name: name)")) { members.map(toSwift).joined(separator: "\n\n") } return """ - public enum \(name) { + public enum \(name: name) { public static var jsObject: JSObject { \(this) } @@ -302,7 +305,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { if Context.ignored[Context.className.source]?.contains(name) ?? false { return """ - // XXX: method '\(name)' is ignored + // XXX: method '\(raw: name)' is ignored """ } if special.isEmpty { @@ -331,9 +334,9 @@ extension IDLOperation: SwiftRepresentable, Initializable { } """ case "setter": - return "// XXX: unsupported setter for keys of type \(arguments[0].idlType.swiftRepresentation.source)" + return "// XXX: unsupported setter for keys of type \(arguments[0].idlType.swiftRepresentation)" case "deleter": - return "// XXX: unsupported deleter for keys of type \(arguments[0].idlType.swiftRepresentation.source)" + return "// XXX: unsupported deleter for keys of type \(arguments[0].idlType.swiftRepresentation)" default: fatalError("Unsupported special operation \(special)") } @@ -346,19 +349,19 @@ extension IDLOperation: SwiftRepresentable, Initializable { if arguments.count <= 5 { args = arguments.map { arg in if arg.optional { - return "\(arg.name)?.jsValue() ?? .undefined" + return "\(name: arg.name)?.jsValue() ?? .undefined" } else { - return "\(arg.name).jsValue()" + return "\(name: arg.name).jsValue()" } } prep = [] } else { - args = (0 ..< arguments.count).map { "_arg\(String($0))" } - prep = arguments.enumerated().map { i, arg in + args = (0 ..< arguments.count).map { "_arg\(raw: String($0))" } + prep = zip(arguments, args).map { arg, name in if arg.optional { - return "let _arg\(String(i)) = \(arg.name)?.jsValue() ?? .undefined" + return "let \(name) = \(name: arg.name)?.jsValue() ?? .undefined" } else { - return "let _arg\(String(i)) = \(arg.name).jsValue()" + return "let \(name) = \(name: arg.name).jsValue()" } } } @@ -373,7 +376,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { let accessModifier: SwiftSource = Context.static ? (Context.inClass ? " class" : " static") : "" let overrideModifier: SwiftSource = Context.override ? "override " : "" return """ - \(overrideModifier)public\(accessModifier) func \(name)(\(sequence: arguments.map(\.swiftRepresentation))) + \(overrideModifier)public\(accessModifier) func \(name: name)(\(sequence: arguments.map(\.swiftRepresentation))) """ } @@ -490,12 +493,12 @@ extension IDLType: SwiftRepresentable { } case let .single(name): if let typeName = Self.typeNameMap[name] { - return "\(typeName)" + return "\(name: typeName)" } else { if name == name.lowercased() { fatalError("Unsupported type: \(name)") } - return "\(name)" + return "\(name: name)" } case let .union(types): // print("union", types.count) @@ -525,14 +528,14 @@ extension IDLType: SwiftRepresentable { if case let .single(name) = value { let readonlyComment: SwiftSource = readonly ? " /* XXX: should be readonly! */ " : "" if let callback = Context.types[name] as? IDLCallback { - return "ClosureAttribute.Required\(String(callback.arguments.count))\(readonlyComment)" + return "ClosureAttribute.Required\(raw: String(callback.arguments.count))\(readonlyComment)" } if let ref = Context.types[name] as? IDLTypedef, case let .single(name) = ref.idlType.value, let callback = Context.types[name] as? IDLCallback { assert(ref.idlType.nullable) - return "ClosureAttribute.Optional\(String(callback.arguments.count))\(readonlyComment)" + return "ClosureAttribute.Optional\(raw: String(callback.arguments.count))\(readonlyComment)" } } @@ -546,7 +549,7 @@ extension IDLType: SwiftRepresentable { extension IDLTypedef: SwiftRepresentable { var swiftRepresentation: SwiftSource { - "public typealias \(name) = \(idlType)" + "public typealias \(name: name) = \(idlType)" } } @@ -558,7 +561,7 @@ extension IDLValue: SwiftRepresentable { case let .number(value): return .raw(value) case let .boolean(value): - return "\(value)" + return .raw(String(value)) case .null: fatalError("`null` is not supported as a value in Swift") case let .infinity(negative): From 443952c72001278b6226f0e16e123e462187d989 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 1 Apr 2022 19:07:51 -0400 Subject: [PATCH 082/124] Use JSString more, intern all object keys --- Sources/DOMKit/ECMAScript/Support.swift | 16 +- Sources/DOMKit/WebIDL/ARIAMixin.swift | 208 ++++++----- Sources/DOMKit/WebIDL/AbortController.swift | 9 +- Sources/DOMKit/WebIDL/AbortSignal.swift | 21 +- Sources/DOMKit/WebIDL/AbstractRange.swift | 18 +- Sources/DOMKit/WebIDL/AbstractWorker.swift | 8 +- .../WebIDL/AddEventListenerOptions.swift | 18 +- .../WebIDL/AnimationFrameProvider.swift | 7 +- .../DOMKit/WebIDL/AssignedNodesOptions.swift | 8 +- Sources/DOMKit/WebIDL/Attr.swift | 24 +- Sources/DOMKit/WebIDL/AudioTrack.swift | 18 +- Sources/DOMKit/WebIDL/AudioTrackList.swift | 18 +- Sources/DOMKit/WebIDL/BarProp.swift | 6 +- Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift | 4 + Sources/DOMKit/WebIDL/Blob.swift | 25 +- Sources/DOMKit/WebIDL/BlobPropertyBag.swift | 13 +- Sources/DOMKit/WebIDL/Body.swift | 34 +- Sources/DOMKit/WebIDL/BroadcastChannel.swift | 18 +- .../WebIDL/ByteLengthQueuingStrategy.swift | 9 +- Sources/DOMKit/WebIDL/CDATASection.swift | 2 + Sources/DOMKit/WebIDL/CSS.swift | 11 +- Sources/DOMKit/WebIDL/CSSConditionRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 12 +- Sources/DOMKit/WebIDL/CSSImportRule.swift | 12 +- Sources/DOMKit/WebIDL/CSSMarginRule.swift | 9 +- Sources/DOMKit/WebIDL/CSSMediaRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSNamespaceRule.swift | 9 +- Sources/DOMKit/WebIDL/CSSPageRule.swift | 9 +- Sources/DOMKit/WebIDL/CSSRule.swift | 24 +- Sources/DOMKit/WebIDL/CSSRuleList.swift | 7 +- .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 28 +- Sources/DOMKit/WebIDL/CSSStyleRule.swift | 9 +- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 32 +- Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift | 18 +- Sources/DOMKit/WebIDL/CSSSupportsRule.swift | 2 + Sources/DOMKit/WebIDL/CanPlayTypeResult.swift | 12 +- Sources/DOMKit/WebIDL/CanvasCompositing.swift | 13 +- Sources/DOMKit/WebIDL/CanvasDirection.swift | 14 +- Sources/DOMKit/WebIDL/CanvasDrawImage.swift | 10 +- Sources/DOMKit/WebIDL/CanvasDrawPath.swift | 31 +- Sources/DOMKit/WebIDL/CanvasFillRule.swift | 12 +- .../WebIDL/CanvasFillStrokeStyles.swift | 25 +- Sources/DOMKit/WebIDL/CanvasFilter.swift | 2 + Sources/DOMKit/WebIDL/CanvasFilters.swift | 8 +- Sources/DOMKit/WebIDL/CanvasFontKerning.swift | 14 +- Sources/DOMKit/WebIDL/CanvasFontStretch.swift | 14 +- .../DOMKit/WebIDL/CanvasFontVariantCaps.swift | 12 +- Sources/DOMKit/WebIDL/CanvasGradient.swift | 6 +- Sources/DOMKit/WebIDL/CanvasImageData.swift | 16 +- .../DOMKit/WebIDL/CanvasImageSmoothing.swift | 13 +- Sources/DOMKit/WebIDL/CanvasLineCap.swift | 14 +- Sources/DOMKit/WebIDL/CanvasLineJoin.swift | 14 +- Sources/DOMKit/WebIDL/CanvasPath.swift | 33 +- .../WebIDL/CanvasPathDrawingStyles.swift | 34 +- Sources/DOMKit/WebIDL/CanvasPattern.swift | 6 +- Sources/DOMKit/WebIDL/CanvasRect.swift | 12 +- .../WebIDL/CanvasRenderingContext2D.swift | 9 +- .../CanvasRenderingContext2DSettings.swift | 23 +- .../DOMKit/WebIDL/CanvasShadowStyles.swift | 23 +- Sources/DOMKit/WebIDL/CanvasState.swift | 15 +- Sources/DOMKit/WebIDL/CanvasText.swift | 12 +- Sources/DOMKit/WebIDL/CanvasTextAlign.swift | 18 +- .../DOMKit/WebIDL/CanvasTextBaseline.swift | 20 +- .../WebIDL/CanvasTextDrawingStyles.swift | 53 ++- .../DOMKit/WebIDL/CanvasTextRendering.swift | 16 +- Sources/DOMKit/WebIDL/CanvasTransform.swift | 26 +- .../DOMKit/WebIDL/CanvasUserInterface.swift | 13 +- Sources/DOMKit/WebIDL/CharacterData.swift | 24 +- Sources/DOMKit/WebIDL/ChildNode.swift | 15 +- Sources/DOMKit/WebIDL/ClosureAttribute.swift | 48 +-- .../DOMKit/WebIDL/ColorSpaceConversion.swift | 12 +- Sources/DOMKit/WebIDL/Comment.swift | 2 + Sources/DOMKit/WebIDL/CompositionEvent.swift | 9 +- .../DOMKit/WebIDL/CompositionEventInit.swift | 8 +- .../DOMKit/WebIDL/CountQueuingStrategy.swift | 9 +- .../DOMKit/WebIDL/CustomElementRegistry.swift | 11 +- Sources/DOMKit/WebIDL/CustomEvent.swift | 9 +- Sources/DOMKit/WebIDL/CustomEventInit.swift | 8 +- Sources/DOMKit/WebIDL/DOMException.swift | 37 +- Sources/DOMKit/WebIDL/DOMImplementation.swift | 15 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 108 ++++-- Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift | 63 ++-- Sources/DOMKit/WebIDL/DOMMatrixInit.swift | 58 +-- Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 137 ++++--- Sources/DOMKit/WebIDL/DOMParser.swift | 6 +- .../WebIDL/DOMParserSupportedType.swift | 8 +- Sources/DOMKit/WebIDL/DOMPoint.swift | 16 +- Sources/DOMKit/WebIDL/DOMPointInit.swift | 23 +- Sources/DOMKit/WebIDL/DOMPointReadOnly.swift | 24 +- Sources/DOMKit/WebIDL/DOMQuad.swift | 27 +- Sources/DOMKit/WebIDL/DOMQuadInit.swift | 23 +- Sources/DOMKit/WebIDL/DOMRect.swift | 16 +- Sources/DOMKit/WebIDL/DOMRectInit.swift | 23 +- Sources/DOMKit/WebIDL/DOMRectList.swift | 7 +- Sources/DOMKit/WebIDL/DOMRectReadOnly.swift | 33 +- Sources/DOMKit/WebIDL/DOMStringList.swift | 10 +- Sources/DOMKit/WebIDL/DOMStringMap.swift | 2 + Sources/DOMKit/WebIDL/DOMTokenList.swift | 28 +- Sources/DOMKit/WebIDL/DataTransfer.swift | 30 +- Sources/DOMKit/WebIDL/DataTransferItem.swift | 13 +- .../DOMKit/WebIDL/DataTransferItemList.swift | 17 +- .../WebIDL/DedicatedWorkerGlobalScope.swift | 20 +- Sources/DOMKit/WebIDL/Document.swift | 223 ++++++++---- .../DocumentAndElementEventHandlers.swift | 18 +- Sources/DOMKit/WebIDL/DocumentFragment.swift | 2 + .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 14 +- .../DOMKit/WebIDL/DocumentReadyState.swift | 14 +- Sources/DOMKit/WebIDL/DocumentType.swift | 12 +- .../WebIDL/DocumentVisibilityState.swift | 12 +- Sources/DOMKit/WebIDL/DragEvent.swift | 6 +- Sources/DOMKit/WebIDL/DragEventInit.swift | 8 +- Sources/DOMKit/WebIDL/Element.swift | 108 ++++-- .../DOMKit/WebIDL/ElementCSSInlineStyle.swift | 6 +- .../WebIDL/ElementContentEditable.swift | 21 +- .../WebIDL/ElementCreationOptions.swift | 8 +- .../WebIDL/ElementDefinitionOptions.swift | 8 +- Sources/DOMKit/WebIDL/ElementInternals.swift | 33 +- Sources/DOMKit/WebIDL/EndingType.swift | 12 +- Sources/DOMKit/WebIDL/ErrorEvent.swift | 18 +- Sources/DOMKit/WebIDL/ErrorEventInit.swift | 28 +- Sources/DOMKit/WebIDL/Event.swift | 61 +++- Sources/DOMKit/WebIDL/EventInit.swift | 18 +- .../DOMKit/WebIDL/EventListenerOptions.swift | 8 +- Sources/DOMKit/WebIDL/EventModifierInit.swift | 73 ++-- Sources/DOMKit/WebIDL/EventSource.swift | 27 +- Sources/DOMKit/WebIDL/EventSourceInit.swift | 8 +- Sources/DOMKit/WebIDL/EventTarget.swift | 8 +- Sources/DOMKit/WebIDL/External.swift | 9 +- Sources/DOMKit/WebIDL/File.swift | 9 +- Sources/DOMKit/WebIDL/FileList.swift | 7 +- Sources/DOMKit/WebIDL/FilePropertyBag.swift | 8 +- Sources/DOMKit/WebIDL/FileReader.swift | 48 ++- Sources/DOMKit/WebIDL/FileReaderSync.swift | 15 +- Sources/DOMKit/WebIDL/FocusEvent.swift | 6 +- Sources/DOMKit/WebIDL/FocusEventInit.swift | 8 +- Sources/DOMKit/WebIDL/FocusOptions.swift | 8 +- Sources/DOMKit/WebIDL/FormData.swift | 25 +- Sources/DOMKit/WebIDL/FormDataEvent.swift | 6 +- Sources/DOMKit/WebIDL/FormDataEventInit.swift | 8 +- .../WebIDL/GenericTransformStream.swift | 9 +- .../DOMKit/WebIDL/GetRootNodeOptions.swift | 8 +- .../DOMKit/WebIDL/GlobalEventHandlers.swift | 343 +++++++++++------- Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 10 +- Sources/DOMKit/WebIDL/HTMLAnchorElement.swift | 45 ++- Sources/DOMKit/WebIDL/HTMLAreaElement.swift | 33 +- Sources/DOMKit/WebIDL/HTMLAudioElement.swift | 2 + Sources/DOMKit/WebIDL/HTMLBRElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLBaseElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLBodyElement.swift | 21 +- Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 54 ++- Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 19 +- Sources/DOMKit/WebIDL/HTMLCollection.swift | 8 +- Sources/DOMKit/WebIDL/HTMLDListElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLDataElement.swift | 6 +- .../DOMKit/WebIDL/HTMLDataListElement.swift | 6 +- .../DOMKit/WebIDL/HTMLDetailsElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 18 +- .../DOMKit/WebIDL/HTMLDirectoryElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLDivElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 48 ++- Sources/DOMKit/WebIDL/HTMLEmbedElement.swift | 24 +- .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 36 +- Sources/DOMKit/WebIDL/HTMLFontElement.swift | 12 +- .../WebIDL/HTMLFormControlsCollection.swift | 4 + Sources/DOMKit/WebIDL/HTMLFormElement.swift | 57 ++- Sources/DOMKit/WebIDL/HTMLFrameElement.swift | 33 +- .../DOMKit/WebIDL/HTMLFrameSetElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLHRElement.swift | 18 +- Sources/DOMKit/WebIDL/HTMLHeadElement.swift | 2 + .../DOMKit/WebIDL/HTMLHeadingElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLHtmlElement.swift | 6 +- .../WebIDL/HTMLHyperlinkElementUtils.swift | 56 +-- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 60 ++- Sources/DOMKit/WebIDL/HTMLImageElement.swift | 77 ++-- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 167 ++++++--- Sources/DOMKit/WebIDL/HTMLLIElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLLabelElement.swift | 12 +- Sources/DOMKit/WebIDL/HTMLLegendElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLLinkElement.swift | 57 ++- Sources/DOMKit/WebIDL/HTMLMapElement.swift | 9 +- .../DOMKit/WebIDL/HTMLMarqueeElement.swift | 42 ++- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 119 ++++-- Sources/DOMKit/WebIDL/HTMLMenuElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLMetaElement.swift | 18 +- Sources/DOMKit/WebIDL/HTMLMeterElement.swift | 24 +- Sources/DOMKit/WebIDL/HTMLModElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLOListElement.swift | 15 +- Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 81 +++-- .../DOMKit/WebIDL/HTMLOptGroupElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLOptionElement.swift | 27 +- .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 15 +- Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift | 27 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 42 ++- .../DOMKit/WebIDL/HTMLParagraphElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLParamElement.swift | 15 +- .../DOMKit/WebIDL/HTMLPictureElement.swift | 2 + Sources/DOMKit/WebIDL/HTMLPreElement.swift | 6 +- .../DOMKit/WebIDL/HTMLProgressElement.swift | 15 +- Sources/DOMKit/WebIDL/HTMLQuoteElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 45 ++- Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 75 ++-- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 15 +- Sources/DOMKit/WebIDL/HTMLSourceElement.swift | 24 +- Sources/DOMKit/WebIDL/HTMLSpanElement.swift | 2 + Sources/DOMKit/WebIDL/HTMLStyleElement.swift | 12 +- .../WebIDL/HTMLTableCaptionElement.swift | 6 +- .../DOMKit/WebIDL/HTMLTableCellElement.swift | 48 ++- .../DOMKit/WebIDL/HTMLTableColElement.swift | 21 +- Sources/DOMKit/WebIDL/HTMLTableElement.swift | 72 ++-- .../DOMKit/WebIDL/HTMLTableRowElement.swift | 33 +- .../WebIDL/HTMLTableSectionElement.swift | 24 +- .../DOMKit/WebIDL/HTMLTemplateElement.swift | 6 +- .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 95 +++-- Sources/DOMKit/WebIDL/HTMLTimeElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLTitleElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLTrackElement.swift | 28 +- Sources/DOMKit/WebIDL/HTMLUListElement.swift | 9 +- .../DOMKit/WebIDL/HTMLUnknownElement.swift | 2 + Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 21 +- Sources/DOMKit/WebIDL/HashChangeEvent.swift | 9 +- .../DOMKit/WebIDL/HashChangeEventInit.swift | 13 +- Sources/DOMKit/WebIDL/Headers.swift | 18 +- Sources/DOMKit/WebIDL/History.swift | 27 +- Sources/DOMKit/WebIDL/ImageBitmap.swift | 12 +- .../DOMKit/WebIDL/ImageBitmapOptions.swift | 33 +- .../WebIDL/ImageBitmapRenderingContext.swift | 9 +- .../ImageBitmapRenderingContextSettings.swift | 8 +- Sources/DOMKit/WebIDL/ImageData.swift | 15 +- Sources/DOMKit/WebIDL/ImageDataSettings.swift | 8 +- .../DOMKit/WebIDL/ImageEncodeOptions.swift | 13 +- Sources/DOMKit/WebIDL/ImageOrientation.swift | 12 +- .../DOMKit/WebIDL/ImageSmoothingQuality.swift | 14 +- Sources/DOMKit/WebIDL/InputEvent.swift | 12 +- Sources/DOMKit/WebIDL/InputEventInit.swift | 18 +- Sources/DOMKit/WebIDL/KeyboardEvent.swift | 46 ++- Sources/DOMKit/WebIDL/KeyboardEventInit.swift | 38 +- Sources/DOMKit/WebIDL/LinkStyle.swift | 6 +- Sources/DOMKit/WebIDL/Location.swift | 42 ++- Sources/DOMKit/WebIDL/MediaError.swift | 13 +- Sources/DOMKit/WebIDL/MediaList.swift | 16 +- Sources/DOMKit/WebIDL/MessageChannel.swift | 9 +- Sources/DOMKit/WebIDL/MessageEvent.swift | 21 +- Sources/DOMKit/WebIDL/MessageEventInit.swift | 28 +- Sources/DOMKit/WebIDL/MessagePort.swift | 20 +- Sources/DOMKit/WebIDL/MimeType.swift | 15 +- Sources/DOMKit/WebIDL/MimeTypeArray.swift | 8 +- Sources/DOMKit/WebIDL/MouseEvent.swift | 42 ++- Sources/DOMKit/WebIDL/MouseEventInit.swift | 38 +- Sources/DOMKit/WebIDL/MutationEvent.swift | 24 +- Sources/DOMKit/WebIDL/MutationObserver.swift | 12 +- .../DOMKit/WebIDL/MutationObserverInit.swift | 38 +- Sources/DOMKit/WebIDL/MutationRecord.swift | 30 +- Sources/DOMKit/WebIDL/NamedNodeMap.swift | 23 +- Sources/DOMKit/WebIDL/Navigator.swift | 2 + .../WebIDL/NavigatorConcurrentHardware.swift | 6 +- .../DOMKit/WebIDL/NavigatorContentUtils.swift | 9 +- Sources/DOMKit/WebIDL/NavigatorCookies.swift | 6 +- Sources/DOMKit/WebIDL/NavigatorID.swift | 36 +- Sources/DOMKit/WebIDL/NavigatorLanguage.swift | 9 +- Sources/DOMKit/WebIDL/NavigatorOnLine.swift | 6 +- Sources/DOMKit/WebIDL/NavigatorPlugins.swift | 15 +- Sources/DOMKit/WebIDL/Node.swift | 108 ++++-- Sources/DOMKit/WebIDL/NodeIterator.swift | 25 +- Sources/DOMKit/WebIDL/NodeList.swift | 7 +- .../WebIDL/NonDocumentTypeChildNode.swift | 9 +- .../DOMKit/WebIDL/NonElementParentNode.swift | 6 +- Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 26 +- .../OffscreenCanvasRenderingContext2D.swift | 9 +- .../WebIDL/OffscreenRenderingContextId.swift | 16 +- .../DOMKit/WebIDL/PageTransitionEvent.swift | 6 +- .../WebIDL/PageTransitionEventInit.swift | 8 +- Sources/DOMKit/WebIDL/ParentNode.swift | 30 +- Sources/DOMKit/WebIDL/Path2D.swift | 6 +- Sources/DOMKit/WebIDL/Performance.swift | 12 +- Sources/DOMKit/WebIDL/Plugin.swift | 17 +- Sources/DOMKit/WebIDL/PluginArray.swift | 11 +- Sources/DOMKit/WebIDL/PopStateEvent.swift | 6 +- Sources/DOMKit/WebIDL/PopStateEventInit.swift | 8 +- .../DOMKit/WebIDL/PredefinedColorSpace.swift | 10 +- Sources/DOMKit/WebIDL/PremultiplyAlpha.swift | 14 +- .../DOMKit/WebIDL/ProcessingInstruction.swift | 6 +- Sources/DOMKit/WebIDL/ProgressEvent.swift | 12 +- Sources/DOMKit/WebIDL/ProgressEventInit.swift | 18 +- .../DOMKit/WebIDL/PromiseRejectionEvent.swift | 9 +- .../WebIDL/PromiseRejectionEventInit.swift | 13 +- Sources/DOMKit/WebIDL/QueuingStrategy.swift | 13 +- .../DOMKit/WebIDL/QueuingStrategyInit.swift | 8 +- Sources/DOMKit/WebIDL/RadioNodeList.swift | 6 +- Sources/DOMKit/WebIDL/Range.swift | 72 ++-- .../WebIDL/ReadableByteStreamController.swift | 18 +- Sources/DOMKit/WebIDL/ReadableStream.swift | 25 +- .../WebIDL/ReadableStreamBYOBReadResult.swift | 13 +- .../WebIDL/ReadableStreamBYOBReader.swift | 11 +- .../WebIDL/ReadableStreamBYOBRequest.swift | 12 +- .../ReadableStreamDefaultController.swift | 15 +- .../ReadableStreamDefaultReadResult.swift | 13 +- .../WebIDL/ReadableStreamDefaultReader.swift | 11 +- .../WebIDL/ReadableStreamGenericReader.swift | 11 +- .../ReadableStreamGetReaderOptions.swift | 8 +- .../ReadableStreamIteratorOptions.swift | 8 +- .../WebIDL/ReadableStreamReaderMode.swift | 10 +- .../DOMKit/WebIDL/ReadableStreamType.swift | 10 +- .../DOMKit/WebIDL/ReadableWritablePair.swift | 13 +- Sources/DOMKit/WebIDL/ReferrerPolicy.swift | 10 +- Sources/DOMKit/WebIDL/Request.swift | 51 ++- Sources/DOMKit/WebIDL/RequestCache.swift | 12 +- .../DOMKit/WebIDL/RequestCredentials.swift | 12 +- .../DOMKit/WebIDL/RequestDestination.swift | 46 +-- Sources/DOMKit/WebIDL/RequestInit.swift | 68 ++-- Sources/DOMKit/WebIDL/RequestMode.swift | 12 +- Sources/DOMKit/WebIDL/RequestRedirect.swift | 14 +- Sources/DOMKit/WebIDL/ResizeQuality.swift | 16 +- Sources/DOMKit/WebIDL/Response.swift | 33 +- Sources/DOMKit/WebIDL/ResponseInit.swift | 18 +- Sources/DOMKit/WebIDL/ResponseType.swift | 20 +- Sources/DOMKit/WebIDL/ScrollRestoration.swift | 12 +- Sources/DOMKit/WebIDL/SelectionMode.swift | 16 +- Sources/DOMKit/WebIDL/ShadowRoot.swift | 18 +- Sources/DOMKit/WebIDL/ShadowRootInit.swift | 18 +- Sources/DOMKit/WebIDL/ShadowRootMode.swift | 12 +- Sources/DOMKit/WebIDL/SharedWorker.swift | 6 +- .../WebIDL/SharedWorkerGlobalScope.swift | 12 +- .../DOMKit/WebIDL/SlotAssignmentMode.swift | 12 +- Sources/DOMKit/WebIDL/Slottable.swift | 6 +- Sources/DOMKit/WebIDL/StaticRange.swift | 2 + Sources/DOMKit/WebIDL/StaticRangeInit.swift | 23 +- Sources/DOMKit/WebIDL/Storage.swift | 15 +- Sources/DOMKit/WebIDL/StorageEvent.swift | 21 +- Sources/DOMKit/WebIDL/StorageEventInit.swift | 28 +- Sources/DOMKit/WebIDL/StreamPipeOptions.swift | 23 +- .../WebIDL/StructuredSerializeOptions.swift | 8 +- Sources/DOMKit/WebIDL/StyleSheet.swift | 24 +- Sources/DOMKit/WebIDL/StyleSheetList.swift | 7 +- Sources/DOMKit/WebIDL/SubmitEvent.swift | 6 +- Sources/DOMKit/WebIDL/SubmitEventInit.swift | 8 +- Sources/DOMKit/WebIDL/Text.swift | 9 +- Sources/DOMKit/WebIDL/TextMetrics.swift | 39 +- Sources/DOMKit/WebIDL/TextTrack.swift | 36 +- Sources/DOMKit/WebIDL/TextTrackCue.swift | 24 +- Sources/DOMKit/WebIDL/TextTrackCueList.swift | 9 +- Sources/DOMKit/WebIDL/TextTrackKind.swift | 18 +- Sources/DOMKit/WebIDL/TextTrackList.swift | 18 +- Sources/DOMKit/WebIDL/TextTrackMode.swift | 14 +- Sources/DOMKit/WebIDL/TimeRanges.swift | 12 +- Sources/DOMKit/WebIDL/TrackEvent.swift | 6 +- Sources/DOMKit/WebIDL/TrackEventInit.swift | 8 +- Sources/DOMKit/WebIDL/TransformStream.swift | 9 +- .../TransformStreamDefaultController.swift | 15 +- Sources/DOMKit/WebIDL/Transformer.swift | 28 +- Sources/DOMKit/WebIDL/TreeWalker.swift | 34 +- Sources/DOMKit/WebIDL/UIEvent.swift | 15 +- Sources/DOMKit/WebIDL/UIEventInit.swift | 18 +- Sources/DOMKit/WebIDL/URL.swift | 9 +- Sources/DOMKit/WebIDL/UnderlyingSink.swift | 28 +- Sources/DOMKit/WebIDL/UnderlyingSource.swift | 28 +- Sources/DOMKit/WebIDL/ValidityState.swift | 36 +- .../DOMKit/WebIDL/ValidityStateFlags.swift | 53 ++- Sources/DOMKit/WebIDL/VideoTrack.swift | 18 +- Sources/DOMKit/WebIDL/VideoTrackList.swift | 21 +- Sources/DOMKit/WebIDL/WheelEvent.swift | 18 +- Sources/DOMKit/WebIDL/WheelEventInit.swift | 23 +- Sources/DOMKit/WebIDL/Window.swift | 124 ++++--- .../DOMKit/WebIDL/WindowEventHandlers.swift | 83 +++-- .../DOMKit/WebIDL/WindowLocalStorage.swift | 6 +- .../WebIDL/WindowOrWorkerGlobalScope.swift | 54 ++- .../WebIDL/WindowPostMessageOptions.swift | 8 +- .../DOMKit/WebIDL/WindowSessionStorage.swift | 6 +- Sources/DOMKit/WebIDL/Worker.swift | 17 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 33 +- Sources/DOMKit/WebIDL/WorkerLocation.swift | 30 +- Sources/DOMKit/WebIDL/WorkerNavigator.swift | 2 + Sources/DOMKit/WebIDL/WorkerOptions.swift | 18 +- Sources/DOMKit/WebIDL/WorkerType.swift | 12 +- Sources/DOMKit/WebIDL/Worklet.swift | 8 +- .../DOMKit/WebIDL/WorkletGlobalScope.swift | 2 + Sources/DOMKit/WebIDL/WorkletOptions.swift | 8 +- Sources/DOMKit/WebIDL/WritableStream.swift | 19 +- .../WritableStreamDefaultController.swift | 9 +- .../WebIDL/WritableStreamDefaultWriter.swift | 30 +- Sources/DOMKit/WebIDL/XMLDocument.swift | 2 + Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 67 +++- .../WebIDL/XMLHttpRequestEventTarget.swift | 24 +- .../WebIDL/XMLHttpRequestResponseType.swift | 18 +- .../DOMKit/WebIDL/XMLHttpRequestUpload.swift | 2 + Sources/DOMKit/WebIDL/XPathEvaluator.swift | 2 + .../DOMKit/WebIDL/XPathEvaluatorBase.swift | 6 + Sources/DOMKit/WebIDL/XPathExpression.swift | 6 +- Sources/DOMKit/WebIDL/XPathResult.swift | 40 +- Sources/DOMKit/WebIDL/XSLTProcessor.swift | 27 +- Sources/DOMKit/WebIDL/console.swift | 60 ++- Sources/WebIDLToSwift/ClosureWrappers.swift | 6 +- .../WebIDL+SwiftRepresentation.swift | 37 +- 392 files changed, 6057 insertions(+), 2689 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 4c173008..ff18fc5b 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -9,6 +9,10 @@ public typealias __UNSUPPORTED_UNION__ = JSValue public typealias WindowProxy = Window +internal enum Strings { + static let toString: JSString = "toString" +} + public extension HTMLElement { convenience init?(from element: Element) { self.init(from: .object(element.jsObject)) @@ -44,9 +48,9 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray @propertyWrapper public struct ReadWriteAttribute { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -56,7 +60,7 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray set { ReadWriteAttribute[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> Wrapped { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> Wrapped { get { jsObject[name].fromJSValue()! } set { jsObject[name] = newValue.jsValue() } } @@ -64,9 +68,9 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray @propertyWrapper public struct ReadonlyAttribute { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -75,7 +79,7 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray ReadonlyAttribute[name, in: jsObject] } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> Wrapped { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> Wrapped { jsObject[name].fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ARIAMixin.swift b/Sources/DOMKit/WebIDL/ARIAMixin.swift index be22e040..c56970cb 100644 --- a/Sources/DOMKit/WebIDL/ARIAMixin.swift +++ b/Sources/DOMKit/WebIDL/ARIAMixin.swift @@ -3,210 +3,254 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let ariaRowCount: JSString = "ariaRowCount" + static let ariaRowIndexText: JSString = "ariaRowIndexText" + static let ariaChecked: JSString = "ariaChecked" + static let ariaValueMin: JSString = "ariaValueMin" + static let ariaHidden: JSString = "ariaHidden" + static let ariaModal: JSString = "ariaModal" + static let ariaAutoComplete: JSString = "ariaAutoComplete" + static let ariaExpanded: JSString = "ariaExpanded" + static let ariaLabel: JSString = "ariaLabel" + static let ariaLevel: JSString = "ariaLevel" + static let ariaPosInSet: JSString = "ariaPosInSet" + static let ariaOrientation: JSString = "ariaOrientation" + static let role: JSString = "role" + static let ariaRequired: JSString = "ariaRequired" + static let ariaBusy: JSString = "ariaBusy" + static let ariaRoleDescription: JSString = "ariaRoleDescription" + static let ariaColSpan: JSString = "ariaColSpan" + static let ariaDescription: JSString = "ariaDescription" + static let ariaDisabled: JSString = "ariaDisabled" + static let ariaMultiSelectable: JSString = "ariaMultiSelectable" + static let ariaPlaceholder: JSString = "ariaPlaceholder" + static let ariaAtomic: JSString = "ariaAtomic" + static let ariaColIndexText: JSString = "ariaColIndexText" + static let ariaMultiLine: JSString = "ariaMultiLine" + static let ariaInvalid: JSString = "ariaInvalid" + static let ariaReadOnly: JSString = "ariaReadOnly" + static let ariaHasPopup: JSString = "ariaHasPopup" + static let ariaSelected: JSString = "ariaSelected" + static let ariaSort: JSString = "ariaSort" + static let ariaRowSpan: JSString = "ariaRowSpan" + static let ariaValueMax: JSString = "ariaValueMax" + static let ariaValueNow: JSString = "ariaValueNow" + static let ariaColCount: JSString = "ariaColCount" + static let ariaPressed: JSString = "ariaPressed" + static let ariaValueText: JSString = "ariaValueText" + static let ariaRowIndex: JSString = "ariaRowIndex" + static let ariaCurrent: JSString = "ariaCurrent" + static let ariaLive: JSString = "ariaLive" + static let ariaColIndex: JSString = "ariaColIndex" + static let ariaKeyShortcuts: JSString = "ariaKeyShortcuts" + static let ariaSetSize: JSString = "ariaSetSize" +} + public protocol ARIAMixin: JSBridgedClass {} public extension ARIAMixin { var role: String? { - get { ReadWriteAttribute["role", in: jsObject] } - set { ReadWriteAttribute["role", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.role, in: jsObject] } + set { ReadWriteAttribute[Keys.role, in: jsObject] = newValue } } var ariaAtomic: String? { - get { ReadWriteAttribute["ariaAtomic", in: jsObject] } - set { ReadWriteAttribute["ariaAtomic", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaAtomic, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaAtomic, in: jsObject] = newValue } } var ariaAutoComplete: String? { - get { ReadWriteAttribute["ariaAutoComplete", in: jsObject] } - set { ReadWriteAttribute["ariaAutoComplete", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaAutoComplete, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaAutoComplete, in: jsObject] = newValue } } var ariaBusy: String? { - get { ReadWriteAttribute["ariaBusy", in: jsObject] } - set { ReadWriteAttribute["ariaBusy", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaBusy, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaBusy, in: jsObject] = newValue } } var ariaChecked: String? { - get { ReadWriteAttribute["ariaChecked", in: jsObject] } - set { ReadWriteAttribute["ariaChecked", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaChecked, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaChecked, in: jsObject] = newValue } } var ariaColCount: String? { - get { ReadWriteAttribute["ariaColCount", in: jsObject] } - set { ReadWriteAttribute["ariaColCount", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaColCount, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaColCount, in: jsObject] = newValue } } var ariaColIndex: String? { - get { ReadWriteAttribute["ariaColIndex", in: jsObject] } - set { ReadWriteAttribute["ariaColIndex", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaColIndex, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaColIndex, in: jsObject] = newValue } } var ariaColIndexText: String? { - get { ReadWriteAttribute["ariaColIndexText", in: jsObject] } - set { ReadWriteAttribute["ariaColIndexText", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaColIndexText, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaColIndexText, in: jsObject] = newValue } } var ariaColSpan: String? { - get { ReadWriteAttribute["ariaColSpan", in: jsObject] } - set { ReadWriteAttribute["ariaColSpan", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaColSpan, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaColSpan, in: jsObject] = newValue } } var ariaCurrent: String? { - get { ReadWriteAttribute["ariaCurrent", in: jsObject] } - set { ReadWriteAttribute["ariaCurrent", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaCurrent, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaCurrent, in: jsObject] = newValue } } var ariaDescription: String? { - get { ReadWriteAttribute["ariaDescription", in: jsObject] } - set { ReadWriteAttribute["ariaDescription", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaDescription, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaDescription, in: jsObject] = newValue } } var ariaDisabled: String? { - get { ReadWriteAttribute["ariaDisabled", in: jsObject] } - set { ReadWriteAttribute["ariaDisabled", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaDisabled, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaDisabled, in: jsObject] = newValue } } var ariaExpanded: String? { - get { ReadWriteAttribute["ariaExpanded", in: jsObject] } - set { ReadWriteAttribute["ariaExpanded", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaExpanded, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaExpanded, in: jsObject] = newValue } } var ariaHasPopup: String? { - get { ReadWriteAttribute["ariaHasPopup", in: jsObject] } - set { ReadWriteAttribute["ariaHasPopup", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaHasPopup, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaHasPopup, in: jsObject] = newValue } } var ariaHidden: String? { - get { ReadWriteAttribute["ariaHidden", in: jsObject] } - set { ReadWriteAttribute["ariaHidden", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaHidden, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaHidden, in: jsObject] = newValue } } var ariaInvalid: String? { - get { ReadWriteAttribute["ariaInvalid", in: jsObject] } - set { ReadWriteAttribute["ariaInvalid", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaInvalid, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaInvalid, in: jsObject] = newValue } } var ariaKeyShortcuts: String? { - get { ReadWriteAttribute["ariaKeyShortcuts", in: jsObject] } - set { ReadWriteAttribute["ariaKeyShortcuts", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaKeyShortcuts, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaKeyShortcuts, in: jsObject] = newValue } } var ariaLabel: String? { - get { ReadWriteAttribute["ariaLabel", in: jsObject] } - set { ReadWriteAttribute["ariaLabel", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaLabel, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaLabel, in: jsObject] = newValue } } var ariaLevel: String? { - get { ReadWriteAttribute["ariaLevel", in: jsObject] } - set { ReadWriteAttribute["ariaLevel", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaLevel, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaLevel, in: jsObject] = newValue } } var ariaLive: String? { - get { ReadWriteAttribute["ariaLive", in: jsObject] } - set { ReadWriteAttribute["ariaLive", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaLive, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaLive, in: jsObject] = newValue } } var ariaModal: String? { - get { ReadWriteAttribute["ariaModal", in: jsObject] } - set { ReadWriteAttribute["ariaModal", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaModal, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaModal, in: jsObject] = newValue } } var ariaMultiLine: String? { - get { ReadWriteAttribute["ariaMultiLine", in: jsObject] } - set { ReadWriteAttribute["ariaMultiLine", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaMultiLine, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaMultiLine, in: jsObject] = newValue } } var ariaMultiSelectable: String? { - get { ReadWriteAttribute["ariaMultiSelectable", in: jsObject] } - set { ReadWriteAttribute["ariaMultiSelectable", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaMultiSelectable, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaMultiSelectable, in: jsObject] = newValue } } var ariaOrientation: String? { - get { ReadWriteAttribute["ariaOrientation", in: jsObject] } - set { ReadWriteAttribute["ariaOrientation", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaOrientation, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaOrientation, in: jsObject] = newValue } } var ariaPlaceholder: String? { - get { ReadWriteAttribute["ariaPlaceholder", in: jsObject] } - set { ReadWriteAttribute["ariaPlaceholder", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaPlaceholder, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaPlaceholder, in: jsObject] = newValue } } var ariaPosInSet: String? { - get { ReadWriteAttribute["ariaPosInSet", in: jsObject] } - set { ReadWriteAttribute["ariaPosInSet", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaPosInSet, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaPosInSet, in: jsObject] = newValue } } var ariaPressed: String? { - get { ReadWriteAttribute["ariaPressed", in: jsObject] } - set { ReadWriteAttribute["ariaPressed", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaPressed, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaPressed, in: jsObject] = newValue } } var ariaReadOnly: String? { - get { ReadWriteAttribute["ariaReadOnly", in: jsObject] } - set { ReadWriteAttribute["ariaReadOnly", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaReadOnly, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaReadOnly, in: jsObject] = newValue } } var ariaRequired: String? { - get { ReadWriteAttribute["ariaRequired", in: jsObject] } - set { ReadWriteAttribute["ariaRequired", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaRequired, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaRequired, in: jsObject] = newValue } } var ariaRoleDescription: String? { - get { ReadWriteAttribute["ariaRoleDescription", in: jsObject] } - set { ReadWriteAttribute["ariaRoleDescription", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaRoleDescription, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaRoleDescription, in: jsObject] = newValue } } var ariaRowCount: String? { - get { ReadWriteAttribute["ariaRowCount", in: jsObject] } - set { ReadWriteAttribute["ariaRowCount", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaRowCount, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaRowCount, in: jsObject] = newValue } } var ariaRowIndex: String? { - get { ReadWriteAttribute["ariaRowIndex", in: jsObject] } - set { ReadWriteAttribute["ariaRowIndex", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaRowIndex, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaRowIndex, in: jsObject] = newValue } } var ariaRowIndexText: String? { - get { ReadWriteAttribute["ariaRowIndexText", in: jsObject] } - set { ReadWriteAttribute["ariaRowIndexText", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaRowIndexText, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaRowIndexText, in: jsObject] = newValue } } var ariaRowSpan: String? { - get { ReadWriteAttribute["ariaRowSpan", in: jsObject] } - set { ReadWriteAttribute["ariaRowSpan", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaRowSpan, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaRowSpan, in: jsObject] = newValue } } var ariaSelected: String? { - get { ReadWriteAttribute["ariaSelected", in: jsObject] } - set { ReadWriteAttribute["ariaSelected", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaSelected, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaSelected, in: jsObject] = newValue } } var ariaSetSize: String? { - get { ReadWriteAttribute["ariaSetSize", in: jsObject] } - set { ReadWriteAttribute["ariaSetSize", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaSetSize, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaSetSize, in: jsObject] = newValue } } var ariaSort: String? { - get { ReadWriteAttribute["ariaSort", in: jsObject] } - set { ReadWriteAttribute["ariaSort", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaSort, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaSort, in: jsObject] = newValue } } var ariaValueMax: String? { - get { ReadWriteAttribute["ariaValueMax", in: jsObject] } - set { ReadWriteAttribute["ariaValueMax", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaValueMax, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaValueMax, in: jsObject] = newValue } } var ariaValueMin: String? { - get { ReadWriteAttribute["ariaValueMin", in: jsObject] } - set { ReadWriteAttribute["ariaValueMin", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaValueMin, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaValueMin, in: jsObject] = newValue } } var ariaValueNow: String? { - get { ReadWriteAttribute["ariaValueNow", in: jsObject] } - set { ReadWriteAttribute["ariaValueNow", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaValueNow, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaValueNow, in: jsObject] = newValue } } var ariaValueText: String? { - get { ReadWriteAttribute["ariaValueText", in: jsObject] } - set { ReadWriteAttribute["ariaValueText", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.ariaValueText, in: jsObject] } + set { ReadWriteAttribute[Keys.ariaValueText, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index b3d5f5ee..77c3ccc3 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class AbortController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.AbortController.function! } + private enum Keys { + static let signal: JSString = "signal" + static let abort: JSString = "abort" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _signal = ReadonlyAttribute(jsObject: jsObject, name: "signal") + _signal = ReadonlyAttribute(jsObject: jsObject, name: Keys.signal) self.jsObject = jsObject } @@ -21,6 +26,6 @@ public class AbortController: JSBridgedClass { public var signal: AbortSignal public func abort(reason: JSValue? = nil) { - _ = jsObject["abort"]!(reason?.jsValue() ?? .undefined) + _ = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index 3b9a216b..e2c62aca 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -6,19 +6,28 @@ import JavaScriptKit public class AbortSignal: EventTarget { override public class var constructor: JSFunction { JSObject.global.AbortSignal.function! } + private enum Keys { + static let throwIfAborted: JSString = "throwIfAborted" + static let reason: JSString = "reason" + static let aborted: JSString = "aborted" + static let onabort: JSString = "onabort" + static let timeout: JSString = "timeout" + static let abort: JSString = "abort" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _aborted = ReadonlyAttribute(jsObject: jsObject, name: "aborted") - _reason = ReadonlyAttribute(jsObject: jsObject, name: "reason") - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: "onabort") + _aborted = ReadonlyAttribute(jsObject: jsObject, name: Keys.aborted) + _reason = ReadonlyAttribute(jsObject: jsObject, name: Keys.reason) + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onabort) super.init(unsafelyWrapping: jsObject) } public static func abort(reason: JSValue? = nil) -> Self { - constructor["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + constructor[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! } public static func timeout(milliseconds: UInt64) -> Self { - constructor["timeout"]!(milliseconds.jsValue()).fromJSValue()! + constructor[Keys.timeout]!(milliseconds.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -28,7 +37,7 @@ public class AbortSignal: EventTarget { public var reason: JSValue public func throwIfAborted() { - _ = jsObject["throwIfAborted"]!() + _ = jsObject[Keys.throwIfAborted]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/AbstractRange.swift b/Sources/DOMKit/WebIDL/AbstractRange.swift index 803bdc07..99ca4494 100644 --- a/Sources/DOMKit/WebIDL/AbstractRange.swift +++ b/Sources/DOMKit/WebIDL/AbstractRange.swift @@ -6,14 +6,22 @@ import JavaScriptKit public class AbstractRange: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.AbstractRange.function! } + private enum Keys { + static let startContainer: JSString = "startContainer" + static let collapsed: JSString = "collapsed" + static let endContainer: JSString = "endContainer" + static let endOffset: JSString = "endOffset" + static let startOffset: JSString = "startOffset" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _startContainer = ReadonlyAttribute(jsObject: jsObject, name: "startContainer") - _startOffset = ReadonlyAttribute(jsObject: jsObject, name: "startOffset") - _endContainer = ReadonlyAttribute(jsObject: jsObject, name: "endContainer") - _endOffset = ReadonlyAttribute(jsObject: jsObject, name: "endOffset") - _collapsed = ReadonlyAttribute(jsObject: jsObject, name: "collapsed") + _startContainer = ReadonlyAttribute(jsObject: jsObject, name: Keys.startContainer) + _startOffset = ReadonlyAttribute(jsObject: jsObject, name: Keys.startOffset) + _endContainer = ReadonlyAttribute(jsObject: jsObject, name: Keys.endContainer) + _endOffset = ReadonlyAttribute(jsObject: jsObject, name: Keys.endOffset) + _collapsed = ReadonlyAttribute(jsObject: jsObject, name: Keys.collapsed) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/AbstractWorker.swift b/Sources/DOMKit/WebIDL/AbstractWorker.swift index 762f03bd..d18b137d 100644 --- a/Sources/DOMKit/WebIDL/AbstractWorker.swift +++ b/Sources/DOMKit/WebIDL/AbstractWorker.swift @@ -3,10 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let onerror: JSString = "onerror" +} + public protocol AbstractWorker: JSBridgedClass {} public extension AbstractWorker { var onerror: EventHandler { - get { ClosureAttribute.Optional1["onerror", in: jsObject] } - set { ClosureAttribute.Optional1["onerror", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onerror, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onerror, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift index 599141d4..a32a10d9 100644 --- a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift @@ -4,18 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class AddEventListenerOptions: BridgedDictionary { + private enum Keys { + static let signal: JSString = "signal" + static let passive: JSString = "passive" + static let once: JSString = "once" + } + public convenience init(passive: Bool, once: Bool, signal: AbortSignal) { let object = JSObject.global.Object.function!.new() - object["passive"] = passive.jsValue() - object["once"] = once.jsValue() - object["signal"] = signal.jsValue() + object[Keys.passive] = passive.jsValue() + object[Keys.once] = once.jsValue() + object[Keys.signal] = signal.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _passive = ReadWriteAttribute(jsObject: object, name: "passive") - _once = ReadWriteAttribute(jsObject: object, name: "once") - _signal = ReadWriteAttribute(jsObject: object, name: "signal") + _passive = ReadWriteAttribute(jsObject: object, name: Keys.passive) + _once = ReadWriteAttribute(jsObject: object, name: Keys.once) + _signal = ReadWriteAttribute(jsObject: object, name: Keys.signal) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift index 74f65b5b..bd802aa2 100644 --- a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift +++ b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift @@ -3,11 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let cancelAnimationFrame: JSString = "cancelAnimationFrame" + static let requestAnimationFrame: JSString = "requestAnimationFrame" +} + public protocol AnimationFrameProvider: JSBridgedClass {} public extension AnimationFrameProvider { // XXX: method 'requestAnimationFrame' is ignored func cancelAnimationFrame(handle: UInt32) { - _ = jsObject["cancelAnimationFrame"]!(handle.jsValue()) + _ = jsObject[Keys.cancelAnimationFrame]!(handle.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift index ee90c5b9..fce970a1 100644 --- a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift +++ b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class AssignedNodesOptions: BridgedDictionary { + private enum Keys { + static let flatten: JSString = "flatten" + } + public convenience init(flatten: Bool) { let object = JSObject.global.Object.function!.new() - object["flatten"] = flatten.jsValue() + object[Keys.flatten] = flatten.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _flatten = ReadWriteAttribute(jsObject: object, name: "flatten") + _flatten = ReadWriteAttribute(jsObject: object, name: Keys.flatten) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Attr.swift b/Sources/DOMKit/WebIDL/Attr.swift index 6fb072aa..b5fe010a 100644 --- a/Sources/DOMKit/WebIDL/Attr.swift +++ b/Sources/DOMKit/WebIDL/Attr.swift @@ -6,14 +6,24 @@ import JavaScriptKit public class Attr: Node { override public class var constructor: JSFunction { JSObject.global.Attr.function! } + private enum Keys { + static let specified: JSString = "specified" + static let ownerElement: JSString = "ownerElement" + static let prefix: JSString = "prefix" + static let localName: JSString = "localName" + static let namespaceURI: JSString = "namespaceURI" + static let value: JSString = "value" + static let name: JSString = "name" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: "namespaceURI") - _prefix = ReadonlyAttribute(jsObject: jsObject, name: "prefix") - _localName = ReadonlyAttribute(jsObject: jsObject, name: "localName") - _name = ReadonlyAttribute(jsObject: jsObject, name: "name") - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _ownerElement = ReadonlyAttribute(jsObject: jsObject, name: "ownerElement") - _specified = ReadonlyAttribute(jsObject: jsObject, name: "specified") + _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.namespaceURI) + _prefix = ReadonlyAttribute(jsObject: jsObject, name: Keys.prefix) + _localName = ReadonlyAttribute(jsObject: jsObject, name: Keys.localName) + _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _ownerElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.ownerElement) + _specified = ReadonlyAttribute(jsObject: jsObject, name: Keys.specified) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/AudioTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack.swift index afc6aa35..fd56fa86 100644 --- a/Sources/DOMKit/WebIDL/AudioTrack.swift +++ b/Sources/DOMKit/WebIDL/AudioTrack.swift @@ -6,14 +6,22 @@ import JavaScriptKit public class AudioTrack: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.AudioTrack.function! } + private enum Keys { + static let enabled: JSString = "enabled" + static let kind: JSString = "kind" + static let id: JSString = "id" + static let language: JSString = "language" + static let label: JSString = "label" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: "id") - _kind = ReadonlyAttribute(jsObject: jsObject, name: "kind") - _label = ReadonlyAttribute(jsObject: jsObject, name: "label") - _language = ReadonlyAttribute(jsObject: jsObject, name: "language") - _enabled = ReadWriteAttribute(jsObject: jsObject, name: "enabled") + _id = ReadonlyAttribute(jsObject: jsObject, name: Keys.id) + _kind = ReadonlyAttribute(jsObject: jsObject, name: Keys.kind) + _label = ReadonlyAttribute(jsObject: jsObject, name: Keys.label) + _language = ReadonlyAttribute(jsObject: jsObject, name: Keys.language) + _enabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.enabled) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift index eaf3a7b2..22c1b7ac 100644 --- a/Sources/DOMKit/WebIDL/AudioTrackList.swift +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -6,11 +6,19 @@ import JavaScriptKit public class AudioTrackList: EventTarget { override public class var constructor: JSFunction { JSObject.global.AudioTrackList.function! } + private enum Keys { + static let onaddtrack: JSString = "onaddtrack" + static let onremovetrack: JSString = "onremovetrack" + static let getTrackById: JSString = "getTrackById" + static let length: JSString = "length" + static let onchange: JSString = "onchange" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onchange") - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onaddtrack") - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onremovetrack") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onchange) + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onaddtrack) + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onremovetrack) super.init(unsafelyWrapping: jsObject) } @@ -22,7 +30,7 @@ public class AudioTrackList: EventTarget { } public func getTrackById(id: String) -> AudioTrack? { - jsObject["getTrackById"]!(id.jsValue()).fromJSValue()! + jsObject[Keys.getTrackById]!(id.jsValue()).fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/BarProp.swift b/Sources/DOMKit/WebIDL/BarProp.swift index cd33602d..5a4ee393 100644 --- a/Sources/DOMKit/WebIDL/BarProp.swift +++ b/Sources/DOMKit/WebIDL/BarProp.swift @@ -6,10 +6,14 @@ import JavaScriptKit public class BarProp: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.BarProp.function! } + private enum Keys { + static let visible: JSString = "visible" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _visible = ReadonlyAttribute(jsObject: jsObject, name: "visible") + _visible = ReadonlyAttribute(jsObject: jsObject, name: Keys.visible) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift index a515357c..09fa09cc 100644 --- a/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift +++ b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift @@ -6,6 +6,10 @@ import JavaScriptKit public class BeforeUnloadEvent: Event { override public class var constructor: JSFunction { JSObject.global.BeforeUnloadEvent.function! } + private enum Keys { + static let returnValue: JSString = "returnValue" + } + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index d8046b70..55d14ea2 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -6,11 +6,20 @@ import JavaScriptKit public class Blob: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Blob.function! } + private enum Keys { + static let slice: JSString = "slice" + static let size: JSString = "size" + static let stream: JSString = "stream" + static let arrayBuffer: JSString = "arrayBuffer" + static let text: JSString = "text" + static let type: JSString = "type" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _size = ReadonlyAttribute(jsObject: jsObject, name: "size") - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _size = ReadonlyAttribute(jsObject: jsObject, name: Keys.size) + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) self.jsObject = jsObject } @@ -25,30 +34,30 @@ public class Blob: JSBridgedClass { public var type: String public func slice(start: Int64? = nil, end: Int64? = nil, contentType: String? = nil) -> Self { - jsObject["slice"]!(start?.jsValue() ?? .undefined, end?.jsValue() ?? .undefined, contentType?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.slice]!(start?.jsValue() ?? .undefined, end?.jsValue() ?? .undefined, contentType?.jsValue() ?? .undefined).fromJSValue()! } public func stream() -> ReadableStream { - jsObject["stream"]!().fromJSValue()! + jsObject[Keys.stream]!().fromJSValue()! } public func text() -> JSPromise { - jsObject["text"]!().fromJSValue()! + jsObject[Keys.text]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func text() async throws -> String { - let _promise: JSPromise = jsObject["text"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.text]!().fromJSValue()! return try await _promise.get().fromJSValue()! } public func arrayBuffer() -> JSPromise { - jsObject["arrayBuffer"]!().fromJSValue()! + jsObject[Keys.arrayBuffer]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func arrayBuffer() async throws -> ArrayBuffer { - let _promise: JSPromise = jsObject["arrayBuffer"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.arrayBuffer]!().fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift index c2dcd416..25ce4704 100644 --- a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift +++ b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift @@ -4,16 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class BlobPropertyBag: BridgedDictionary { + private enum Keys { + static let type: JSString = "type" + static let endings: JSString = "endings" + } + public convenience init(type: String, endings: EndingType) { let object = JSObject.global.Object.function!.new() - object["type"] = type.jsValue() - object["endings"] = endings.jsValue() + object[Keys.type] = type.jsValue() + object[Keys.endings] = endings.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: "type") - _endings = ReadWriteAttribute(jsObject: object, name: "endings") + _type = ReadWriteAttribute(jsObject: object, name: Keys.type) + _endings = ReadWriteAttribute(jsObject: object, name: Keys.endings) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Body.swift b/Sources/DOMKit/WebIDL/Body.swift index aa3da49f..30f51b85 100644 --- a/Sources/DOMKit/WebIDL/Body.swift +++ b/Sources/DOMKit/WebIDL/Body.swift @@ -3,59 +3,69 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let body: JSString = "body" + static let json: JSString = "json" + static let arrayBuffer: JSString = "arrayBuffer" + static let formData: JSString = "formData" + static let bodyUsed: JSString = "bodyUsed" + static let blob: JSString = "blob" + static let text: JSString = "text" +} + public protocol Body: JSBridgedClass {} public extension Body { - var body: ReadableStream? { ReadonlyAttribute["body", in: jsObject] } + var body: ReadableStream? { ReadonlyAttribute[Keys.body, in: jsObject] } - var bodyUsed: Bool { ReadonlyAttribute["bodyUsed", in: jsObject] } + var bodyUsed: Bool { ReadonlyAttribute[Keys.bodyUsed, in: jsObject] } func arrayBuffer() -> JSPromise { - jsObject["arrayBuffer"]!().fromJSValue()! + jsObject[Keys.arrayBuffer]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func arrayBuffer() async throws -> ArrayBuffer { - let _promise: JSPromise = jsObject["arrayBuffer"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.arrayBuffer]!().fromJSValue()! return try await _promise.get().fromJSValue()! } func blob() -> JSPromise { - jsObject["blob"]!().fromJSValue()! + jsObject[Keys.blob]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func blob() async throws -> Blob { - let _promise: JSPromise = jsObject["blob"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.blob]!().fromJSValue()! return try await _promise.get().fromJSValue()! } func formData() -> JSPromise { - jsObject["formData"]!().fromJSValue()! + jsObject[Keys.formData]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func formData() async throws -> FormData { - let _promise: JSPromise = jsObject["formData"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.formData]!().fromJSValue()! return try await _promise.get().fromJSValue()! } func json() -> JSPromise { - jsObject["json"]!().fromJSValue()! + jsObject[Keys.json]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func json() async throws -> JSValue { - let _promise: JSPromise = jsObject["json"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.json]!().fromJSValue()! return try await _promise.get().fromJSValue()! } func text() -> JSPromise { - jsObject["text"]!().fromJSValue()! + jsObject[Keys.text]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func text() async throws -> String { - let _promise: JSPromise = jsObject["text"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.text]!().fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index 230cd210..4fe5ca9b 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -6,10 +6,18 @@ import JavaScriptKit public class BroadcastChannel: EventTarget { override public class var constructor: JSFunction { JSObject.global.BroadcastChannel.function! } + private enum Keys { + static let postMessage: JSString = "postMessage" + static let name: JSString = "name" + static let close: JSString = "close" + static let onmessage: JSString = "onmessage" + static let onmessageerror: JSString = "onmessageerror" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: "name") - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessageerror") + _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -21,11 +29,11 @@ public class BroadcastChannel: EventTarget { public var name: String public func postMessage(message: JSValue) { - _ = jsObject["postMessage"]!(message.jsValue()) + _ = jsObject[Keys.postMessage]!(message.jsValue()) } public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift index 1ce63d2e..3e39e8af 100644 --- a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift @@ -6,11 +6,16 @@ import JavaScriptKit public class ByteLengthQueuingStrategy: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ByteLengthQueuingStrategy.function! } + private enum Keys { + static let highWaterMark: JSString = "highWaterMark" + static let size: JSString = "size" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: "highWaterMark") - _size = ReadonlyAttribute(jsObject: jsObject, name: "size") + _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Keys.highWaterMark) + _size = ReadonlyAttribute(jsObject: jsObject, name: Keys.size) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/CDATASection.swift b/Sources/DOMKit/WebIDL/CDATASection.swift index 32a64c03..8fda5885 100644 --- a/Sources/DOMKit/WebIDL/CDATASection.swift +++ b/Sources/DOMKit/WebIDL/CDATASection.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class CDATASection: Text { override public class var constructor: JSFunction { JSObject.global.CDATASection.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index f4d48a75..4858f4d6 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -4,19 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public enum CSS { + private enum Keys { + static let supports: JSString = "supports" + static let escape: JSString = "escape" + } + public static var jsObject: JSObject { JSObject.global.CSS.object! } public static func escape(ident: String) -> String { - JSObject.global.CSS.object!["escape"]!(ident.jsValue()).fromJSValue()! + JSObject.global.CSS.object![Keys.escape]!(ident.jsValue()).fromJSValue()! } public static func supports(property: String, value: String) -> Bool { - JSObject.global.CSS.object!["supports"]!(property.jsValue(), value.jsValue()).fromJSValue()! + JSObject.global.CSS.object![Keys.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! } public static func supports(conditionText: String) -> Bool { - JSObject.global.CSS.object!["supports"]!(conditionText.jsValue()).fromJSValue()! + JSObject.global.CSS.object![Keys.supports]!(conditionText.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSConditionRule.swift b/Sources/DOMKit/WebIDL/CSSConditionRule.swift index fb223e81..d7703857 100644 --- a/Sources/DOMKit/WebIDL/CSSConditionRule.swift +++ b/Sources/DOMKit/WebIDL/CSSConditionRule.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class CSSConditionRule: CSSGroupingRule { override public class var constructor: JSFunction { JSObject.global.CSSConditionRule.function! } + private enum Keys { + static let conditionText: JSString = "conditionText" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _conditionText = ReadWriteAttribute(jsObject: jsObject, name: "conditionText") + _conditionText = ReadWriteAttribute(jsObject: jsObject, name: Keys.conditionText) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift index 38e80a20..4a0d2013 100644 --- a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift @@ -6,8 +6,14 @@ import JavaScriptKit public class CSSGroupingRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSGroupingRule.function! } + private enum Keys { + static let cssRules: JSString = "cssRules" + static let deleteRule: JSString = "deleteRule" + static let insertRule: JSString = "insertRule" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: "cssRules") + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Keys.cssRules) super.init(unsafelyWrapping: jsObject) } @@ -15,10 +21,10 @@ public class CSSGroupingRule: CSSRule { public var cssRules: CSSRuleList public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - jsObject["insertRule"]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteRule(index: UInt32) { - _ = jsObject["deleteRule"]!(index.jsValue()) + _ = jsObject[Keys.deleteRule]!(index.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CSSImportRule.swift b/Sources/DOMKit/WebIDL/CSSImportRule.swift index f00a324a..7807835b 100644 --- a/Sources/DOMKit/WebIDL/CSSImportRule.swift +++ b/Sources/DOMKit/WebIDL/CSSImportRule.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class CSSImportRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSImportRule.function! } + private enum Keys { + static let media: JSString = "media" + static let href: JSString = "href" + static let styleSheet: JSString = "styleSheet" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadonlyAttribute(jsObject: jsObject, name: "href") - _media = ReadonlyAttribute(jsObject: jsObject, name: "media") - _styleSheet = ReadonlyAttribute(jsObject: jsObject, name: "styleSheet") + _href = ReadonlyAttribute(jsObject: jsObject, name: Keys.href) + _media = ReadonlyAttribute(jsObject: jsObject, name: Keys.media) + _styleSheet = ReadonlyAttribute(jsObject: jsObject, name: Keys.styleSheet) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSMarginRule.swift b/Sources/DOMKit/WebIDL/CSSMarginRule.swift index ba1a5378..768c4be1 100644 --- a/Sources/DOMKit/WebIDL/CSSMarginRule.swift +++ b/Sources/DOMKit/WebIDL/CSSMarginRule.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class CSSMarginRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSMarginRule.function! } + private enum Keys { + static let style: JSString = "style" + static let name: JSString = "name" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: "name") - _style = ReadonlyAttribute(jsObject: jsObject, name: "style") + _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) + _style = ReadonlyAttribute(jsObject: jsObject, name: Keys.style) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSMediaRule.swift b/Sources/DOMKit/WebIDL/CSSMediaRule.swift index 6d4fa2b9..20283dd2 100644 --- a/Sources/DOMKit/WebIDL/CSSMediaRule.swift +++ b/Sources/DOMKit/WebIDL/CSSMediaRule.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class CSSMediaRule: CSSConditionRule { override public class var constructor: JSFunction { JSObject.global.CSSMediaRule.function! } + private enum Keys { + static let media: JSString = "media" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _media = ReadonlyAttribute(jsObject: jsObject, name: "media") + _media = ReadonlyAttribute(jsObject: jsObject, name: Keys.media) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift index 01a79c20..5b394e7f 100644 --- a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift +++ b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class CSSNamespaceRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSNamespaceRule.function! } + private enum Keys { + static let prefix: JSString = "prefix" + static let namespaceURI: JSString = "namespaceURI" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: "namespaceURI") - _prefix = ReadonlyAttribute(jsObject: jsObject, name: "prefix") + _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.namespaceURI) + _prefix = ReadonlyAttribute(jsObject: jsObject, name: Keys.prefix) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSPageRule.swift b/Sources/DOMKit/WebIDL/CSSPageRule.swift index 13199ef4..6798bca9 100644 --- a/Sources/DOMKit/WebIDL/CSSPageRule.swift +++ b/Sources/DOMKit/WebIDL/CSSPageRule.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class CSSPageRule: CSSGroupingRule { override public class var constructor: JSFunction { JSObject.global.CSSPageRule.function! } + private enum Keys { + static let selectorText: JSString = "selectorText" + static let style: JSString = "style" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _selectorText = ReadWriteAttribute(jsObject: jsObject, name: "selectorText") - _style = ReadonlyAttribute(jsObject: jsObject, name: "style") + _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectorText) + _style = ReadonlyAttribute(jsObject: jsObject, name: Keys.style) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift index 828ed0bc..c828ed87 100644 --- a/Sources/DOMKit/WebIDL/CSSRule.swift +++ b/Sources/DOMKit/WebIDL/CSSRule.swift @@ -6,13 +6,29 @@ import JavaScriptKit public class CSSRule: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CSSRule.function! } + private enum Keys { + static let SUPPORTS_RULE: JSString = "SUPPORTS_RULE" + static let NAMESPACE_RULE: JSString = "NAMESPACE_RULE" + static let PAGE_RULE: JSString = "PAGE_RULE" + static let MEDIA_RULE: JSString = "MEDIA_RULE" + static let STYLE_RULE: JSString = "STYLE_RULE" + static let FONT_FACE_RULE: JSString = "FONT_FACE_RULE" + static let parentRule: JSString = "parentRule" + static let parentStyleSheet: JSString = "parentStyleSheet" + static let CHARSET_RULE: JSString = "CHARSET_RULE" + static let cssText: JSString = "cssText" + static let type: JSString = "type" + static let IMPORT_RULE: JSString = "IMPORT_RULE" + static let MARGIN_RULE: JSString = "MARGIN_RULE" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _cssText = ReadWriteAttribute(jsObject: jsObject, name: "cssText") - _parentRule = ReadonlyAttribute(jsObject: jsObject, name: "parentRule") - _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: "parentStyleSheet") - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _cssText = ReadWriteAttribute(jsObject: jsObject, name: Keys.cssText) + _parentRule = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentRule) + _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentStyleSheet) + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/CSSRuleList.swift b/Sources/DOMKit/WebIDL/CSSRuleList.swift index 3131b2cc..47fe6c99 100644 --- a/Sources/DOMKit/WebIDL/CSSRuleList.swift +++ b/Sources/DOMKit/WebIDL/CSSRuleList.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class CSSRuleList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CSSRuleList.function! } + private enum Keys { + static let item: JSString = "item" + static let length: JSString = "length" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift index 33e6f0ff..b920b850 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift @@ -6,13 +6,25 @@ import JavaScriptKit public class CSSStyleDeclaration: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CSSStyleDeclaration.function! } + private enum Keys { + static let length: JSString = "length" + static let getPropertyPriority: JSString = "getPropertyPriority" + static let parentRule: JSString = "parentRule" + static let item: JSString = "item" + static let getPropertyValue: JSString = "getPropertyValue" + static let setProperty: JSString = "setProperty" + static let removeProperty: JSString = "removeProperty" + static let cssFloat: JSString = "cssFloat" + static let cssText: JSString = "cssText" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _cssText = ReadWriteAttribute(jsObject: jsObject, name: "cssText") - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") - _parentRule = ReadonlyAttribute(jsObject: jsObject, name: "parentRule") - _cssFloat = ReadWriteAttribute(jsObject: jsObject, name: "cssFloat") + _cssText = ReadWriteAttribute(jsObject: jsObject, name: Keys.cssText) + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _parentRule = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentRule) + _cssFloat = ReadWriteAttribute(jsObject: jsObject, name: Keys.cssFloat) self.jsObject = jsObject } @@ -27,19 +39,19 @@ public class CSSStyleDeclaration: JSBridgedClass { } public func getPropertyValue(property: String) -> String { - jsObject["getPropertyValue"]!(property.jsValue()).fromJSValue()! + jsObject[Keys.getPropertyValue]!(property.jsValue()).fromJSValue()! } public func getPropertyPriority(property: String) -> String { - jsObject["getPropertyPriority"]!(property.jsValue()).fromJSValue()! + jsObject[Keys.getPropertyPriority]!(property.jsValue()).fromJSValue()! } public func setProperty(property: String, value: String, priority: String? = nil) { - _ = jsObject["setProperty"]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined) + _ = jsObject[Keys.setProperty]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined) } public func removeProperty(property: String) -> String { - jsObject["removeProperty"]!(property.jsValue()).fromJSValue()! + jsObject[Keys.removeProperty]!(property.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift index e7b2ca8c..574bde91 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class CSSStyleRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSStyleRule.function! } + private enum Keys { + static let selectorText: JSString = "selectorText" + static let style: JSString = "style" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _selectorText = ReadWriteAttribute(jsObject: jsObject, name: "selectorText") - _style = ReadonlyAttribute(jsObject: jsObject, name: "style") + _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectorText) + _style = ReadonlyAttribute(jsObject: jsObject, name: Keys.style) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift index 200577f3..b9af9aaf 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -6,10 +6,22 @@ import JavaScriptKit public class CSSStyleSheet: StyleSheet { override public class var constructor: JSFunction { JSObject.global.CSSStyleSheet.function! } + private enum Keys { + static let removeRule: JSString = "removeRule" + static let insertRule: JSString = "insertRule" + static let rules: JSString = "rules" + static let cssRules: JSString = "cssRules" + static let addRule: JSString = "addRule" + static let replaceSync: JSString = "replaceSync" + static let ownerRule: JSString = "ownerRule" + static let replace: JSString = "replace" + static let deleteRule: JSString = "deleteRule" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _ownerRule = ReadonlyAttribute(jsObject: jsObject, name: "ownerRule") - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: "cssRules") - _rules = ReadonlyAttribute(jsObject: jsObject, name: "rules") + _ownerRule = ReadonlyAttribute(jsObject: jsObject, name: Keys.ownerRule) + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Keys.cssRules) + _rules = ReadonlyAttribute(jsObject: jsObject, name: Keys.rules) super.init(unsafelyWrapping: jsObject) } @@ -24,35 +36,35 @@ public class CSSStyleSheet: StyleSheet { public var cssRules: CSSRuleList public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - jsObject["insertRule"]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteRule(index: UInt32) { - _ = jsObject["deleteRule"]!(index.jsValue()) + _ = jsObject[Keys.deleteRule]!(index.jsValue()) } public func replace(text: String) -> JSPromise { - jsObject["replace"]!(text.jsValue()).fromJSValue()! + jsObject[Keys.replace]!(text.jsValue()).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func replace(text: String) async throws -> CSSStyleSheet { - let _promise: JSPromise = jsObject["replace"]!(text.jsValue()).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.replace]!(text.jsValue()).fromJSValue()! return try await _promise.get().fromJSValue()! } public func replaceSync(text: String) { - _ = jsObject["replaceSync"]!(text.jsValue()) + _ = jsObject[Keys.replaceSync]!(text.jsValue()) } @ReadonlyAttribute public var rules: CSSRuleList public func addRule(selector: String? = nil, style: String? = nil, index: UInt32? = nil) -> Int32 { - jsObject["addRule"]!(selector?.jsValue() ?? .undefined, style?.jsValue() ?? .undefined, index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.addRule]!(selector?.jsValue() ?? .undefined, style?.jsValue() ?? .undefined, index?.jsValue() ?? .undefined).fromJSValue()! } public func removeRule(index: UInt32? = nil) { - _ = jsObject["removeRule"]!(index?.jsValue() ?? .undefined) + _ = jsObject[Keys.removeRule]!(index?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift index 062ad517..e308253f 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift @@ -4,18 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleSheetInit: BridgedDictionary { + private enum Keys { + static let baseURL: JSString = "baseURL" + static let disabled: JSString = "disabled" + static let media: JSString = "media" + } + public convenience init(baseURL: String, media: __UNSUPPORTED_UNION__, disabled: Bool) { let object = JSObject.global.Object.function!.new() - object["baseURL"] = baseURL.jsValue() - object["media"] = media.jsValue() - object["disabled"] = disabled.jsValue() + object[Keys.baseURL] = baseURL.jsValue() + object[Keys.media] = media.jsValue() + object[Keys.disabled] = disabled.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _baseURL = ReadWriteAttribute(jsObject: object, name: "baseURL") - _media = ReadWriteAttribute(jsObject: object, name: "media") - _disabled = ReadWriteAttribute(jsObject: object, name: "disabled") + _baseURL = ReadWriteAttribute(jsObject: object, name: Keys.baseURL) + _media = ReadWriteAttribute(jsObject: object, name: Keys.media) + _disabled = ReadWriteAttribute(jsObject: object, name: Keys.disabled) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift index e5bea67b..2ab3b064 100644 --- a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift +++ b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class CSSSupportsRule: CSSConditionRule { override public class var constructor: JSFunction { JSObject.global.CSSSupportsRule.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift index d7272582..19e6edec 100644 --- a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift +++ b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanPlayTypeResult: String, JSValueCompatible { +public enum CanPlayTypeResult: JSString, JSValueCompatible { case _empty = "" - case maybe - case probably + case maybe = "maybe" + case probably = "probably" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasCompositing.swift b/Sources/DOMKit/WebIDL/CanvasCompositing.swift index 498b8d48..3b6e0f3b 100644 --- a/Sources/DOMKit/WebIDL/CanvasCompositing.swift +++ b/Sources/DOMKit/WebIDL/CanvasCompositing.swift @@ -3,15 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let globalAlpha: JSString = "globalAlpha" + static let globalCompositeOperation: JSString = "globalCompositeOperation" +} + public protocol CanvasCompositing: JSBridgedClass {} public extension CanvasCompositing { var globalAlpha: Double { - get { ReadWriteAttribute["globalAlpha", in: jsObject] } - set { ReadWriteAttribute["globalAlpha", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.globalAlpha, in: jsObject] } + set { ReadWriteAttribute[Keys.globalAlpha, in: jsObject] = newValue } } var globalCompositeOperation: String { - get { ReadWriteAttribute["globalCompositeOperation", in: jsObject] } - set { ReadWriteAttribute["globalCompositeOperation", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.globalCompositeOperation, in: jsObject] } + set { ReadWriteAttribute[Keys.globalCompositeOperation, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasDirection.swift b/Sources/DOMKit/WebIDL/CanvasDirection.swift index fd474f29..941beb15 100644 --- a/Sources/DOMKit/WebIDL/CanvasDirection.swift +++ b/Sources/DOMKit/WebIDL/CanvasDirection.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasDirection: String, JSValueCompatible { - case ltr - case rtl - case inherit +public enum CanvasDirection: JSString, JSValueCompatible { + case ltr = "ltr" + case rtl = "rtl" + case inherit = "inherit" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift index 808f55b6..cbf4719a 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift @@ -3,14 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let drawImage: JSString = "drawImage" +} + public protocol CanvasDrawImage: JSBridgedClass {} public extension CanvasDrawImage { func drawImage(image: CanvasImageSource, dx: Double, dy: Double) { - _ = jsObject["drawImage"]!(image.jsValue(), dx.jsValue(), dy.jsValue()) + _ = jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue()) } func drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double) { - _ = jsObject["drawImage"]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()) + _ = jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()) } func drawImage(image: CanvasImageSource, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { @@ -23,6 +27,6 @@ public extension CanvasDrawImage { let _arg6 = dy.jsValue() let _arg7 = dw.jsValue() let _arg8 = dh.jsValue() - _ = jsObject["drawImage"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + _ = jsObject[Keys.drawImage]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift index d857641b..1cb13eeb 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift @@ -3,49 +3,58 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let stroke: JSString = "stroke" + static let isPointInPath: JSString = "isPointInPath" + static let fill: JSString = "fill" + static let isPointInStroke: JSString = "isPointInStroke" + static let beginPath: JSString = "beginPath" + static let clip: JSString = "clip" +} + public protocol CanvasDrawPath: JSBridgedClass {} public extension CanvasDrawPath { func beginPath() { - _ = jsObject["beginPath"]!() + _ = jsObject[Keys.beginPath]!() } func fill(fillRule: CanvasFillRule? = nil) { - _ = jsObject["fill"]!(fillRule?.jsValue() ?? .undefined) + _ = jsObject[Keys.fill]!(fillRule?.jsValue() ?? .undefined) } func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { - _ = jsObject["fill"]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + _ = jsObject[Keys.fill]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) } func stroke() { - _ = jsObject["stroke"]!() + _ = jsObject[Keys.stroke]!() } func stroke(path: Path2D) { - _ = jsObject["stroke"]!(path.jsValue()) + _ = jsObject[Keys.stroke]!(path.jsValue()) } func clip(fillRule: CanvasFillRule? = nil) { - _ = jsObject["clip"]!(fillRule?.jsValue() ?? .undefined) + _ = jsObject[Keys.clip]!(fillRule?.jsValue() ?? .undefined) } func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { - _ = jsObject["clip"]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + _ = jsObject[Keys.clip]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) } func isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { - jsObject["isPointInPath"]!(x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.isPointInPath]!(x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! } func isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { - jsObject["isPointInPath"]!(path.jsValue(), x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.isPointInPath]!(path.jsValue(), x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! } func isPointInStroke(x: Double, y: Double) -> Bool { - jsObject["isPointInStroke"]!(x.jsValue(), y.jsValue()).fromJSValue()! + jsObject[Keys.isPointInStroke]!(x.jsValue(), y.jsValue()).fromJSValue()! } func isPointInStroke(path: Path2D, x: Double, y: Double) -> Bool { - jsObject["isPointInStroke"]!(path.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + jsObject[Keys.isPointInStroke]!(path.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasFillRule.swift b/Sources/DOMKit/WebIDL/CanvasFillRule.swift index 35879806..dc00a785 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillRule.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillRule.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFillRule: String, JSValueCompatible { - case nonzero - case evenodd +public enum CanvasFillRule: JSString, JSValueCompatible { + case nonzero = "nonzero" + case evenodd = "evenodd" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift index 832ffd3a..cb0e3deb 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift @@ -3,20 +3,29 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let strokeStyle: JSString = "strokeStyle" + static let createConicGradient: JSString = "createConicGradient" + static let fillStyle: JSString = "fillStyle" + static let createPattern: JSString = "createPattern" + static let createRadialGradient: JSString = "createRadialGradient" + static let createLinearGradient: JSString = "createLinearGradient" +} + public protocol CanvasFillStrokeStyles: JSBridgedClass {} public extension CanvasFillStrokeStyles { var strokeStyle: __UNSUPPORTED_UNION__ { - get { ReadWriteAttribute["strokeStyle", in: jsObject] } - set { ReadWriteAttribute["strokeStyle", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.strokeStyle, in: jsObject] } + set { ReadWriteAttribute[Keys.strokeStyle, in: jsObject] = newValue } } var fillStyle: __UNSUPPORTED_UNION__ { - get { ReadWriteAttribute["fillStyle", in: jsObject] } - set { ReadWriteAttribute["fillStyle", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.fillStyle, in: jsObject] } + set { ReadWriteAttribute[Keys.fillStyle, in: jsObject] = newValue } } func createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double) -> CanvasGradient { - jsObject["createLinearGradient"]!(x0.jsValue(), y0.jsValue(), x1.jsValue(), y1.jsValue()).fromJSValue()! + jsObject[Keys.createLinearGradient]!(x0.jsValue(), y0.jsValue(), x1.jsValue(), y1.jsValue()).fromJSValue()! } func createRadialGradient(x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double) -> CanvasGradient { @@ -26,14 +35,14 @@ public extension CanvasFillStrokeStyles { let _arg3 = x1.jsValue() let _arg4 = y1.jsValue() let _arg5 = r1.jsValue() - return jsObject["createRadialGradient"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + return jsObject[Keys.createRadialGradient]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } func createConicGradient(startAngle: Double, x: Double, y: Double) -> CanvasGradient { - jsObject["createConicGradient"]!(startAngle.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + jsObject[Keys.createConicGradient]!(startAngle.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! } func createPattern(image: CanvasImageSource, repetition: String) -> CanvasPattern? { - jsObject["createPattern"]!(image.jsValue(), repetition.jsValue()).fromJSValue()! + jsObject[Keys.createPattern]!(image.jsValue(), repetition.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasFilter.swift b/Sources/DOMKit/WebIDL/CanvasFilter.swift index cea985b1..44ca389c 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilter.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilter.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class CanvasFilter: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CanvasFilter.function! } + private enum Keys {} + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/CanvasFilters.swift b/Sources/DOMKit/WebIDL/CanvasFilters.swift index b5285839..e9f4af22 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilters.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilters.swift @@ -3,10 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let filter: JSString = "filter" +} + public protocol CanvasFilters: JSBridgedClass {} public extension CanvasFilters { var filter: __UNSUPPORTED_UNION__ { - get { ReadWriteAttribute["filter", in: jsObject] } - set { ReadWriteAttribute["filter", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.filter, in: jsObject] } + set { ReadWriteAttribute[Keys.filter, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift index b3fae3fa..a07d2b10 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFontKerning: String, JSValueCompatible { - case auto - case normal - case none +public enum CanvasFontKerning: JSString, JSValueCompatible { + case auto = "auto" + case normal = "normal" + case none = "none" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift index e52c386f..8102d9c1 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift @@ -3,23 +3,27 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFontStretch: String, JSValueCompatible { +public enum CanvasFontStretch: JSString, JSValueCompatible { case ultraCondensed = "ultra-condensed" case extraCondensed = "extra-condensed" - case condensed + case condensed = "condensed" case semiCondensed = "semi-condensed" - case normal + case normal = "normal" case semiExpanded = "semi-expanded" - case expanded + case expanded = "expanded" case extraExpanded = "extra-expanded" case ultraExpanded = "ultra-expanded" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift index dae73460..f1dd0ed9 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift @@ -3,21 +3,25 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFontVariantCaps: String, JSValueCompatible { - case normal +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 + case unicase = "unicase" case titlingCaps = "titling-caps" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasGradient.swift b/Sources/DOMKit/WebIDL/CanvasGradient.swift index 2da9e7a4..f8d39af1 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient.swift @@ -6,6 +6,10 @@ import JavaScriptKit public class CanvasGradient: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CanvasGradient.function! } + private enum Keys { + static let addColorStop: JSString = "addColorStop" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -13,6 +17,6 @@ public class CanvasGradient: JSBridgedClass { } public func addColorStop(offset: Double, color: String) { - _ = jsObject["addColorStop"]!(offset.jsValue(), color.jsValue()) + _ = jsObject[Keys.addColorStop]!(offset.jsValue(), color.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CanvasImageData.swift b/Sources/DOMKit/WebIDL/CanvasImageData.swift index 18728d25..563109cb 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageData.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageData.swift @@ -3,22 +3,28 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let putImageData: JSString = "putImageData" + static let createImageData: JSString = "createImageData" + static let getImageData: JSString = "getImageData" +} + public protocol CanvasImageData: JSBridgedClass {} public extension CanvasImageData { func createImageData(sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { - jsObject["createImageData"]!(sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.createImageData]!(sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! } func createImageData(imagedata: ImageData) -> ImageData { - jsObject["createImageData"]!(imagedata.jsValue()).fromJSValue()! + jsObject[Keys.createImageData]!(imagedata.jsValue()).fromJSValue()! } func getImageData(sx: Int32, sy: Int32, sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { - jsObject["getImageData"]!(sx.jsValue(), sy.jsValue(), sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.getImageData]!(sx.jsValue(), sy.jsValue(), sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { - _ = jsObject["putImageData"]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()) + _ = jsObject[Keys.putImageData]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()) } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32, dirtyX: Int32, dirtyY: Int32, dirtyWidth: Int32, dirtyHeight: Int32) { @@ -29,6 +35,6 @@ public extension CanvasImageData { let _arg4 = dirtyY.jsValue() let _arg5 = dirtyWidth.jsValue() let _arg6 = dirtyHeight.jsValue() - _ = jsObject["putImageData"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + _ = jsObject[Keys.putImageData]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) } } diff --git a/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift index 3fd6bc80..7eef7326 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift @@ -3,15 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let imageSmoothingEnabled: JSString = "imageSmoothingEnabled" + static let imageSmoothingQuality: JSString = "imageSmoothingQuality" +} + public protocol CanvasImageSmoothing: JSBridgedClass {} public extension CanvasImageSmoothing { var imageSmoothingEnabled: Bool { - get { ReadWriteAttribute["imageSmoothingEnabled", in: jsObject] } - set { ReadWriteAttribute["imageSmoothingEnabled", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.imageSmoothingEnabled, in: jsObject] } + set { ReadWriteAttribute[Keys.imageSmoothingEnabled, in: jsObject] = newValue } } var imageSmoothingQuality: ImageSmoothingQuality { - get { ReadWriteAttribute["imageSmoothingQuality", in: jsObject] } - set { ReadWriteAttribute["imageSmoothingQuality", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.imageSmoothingQuality, in: jsObject] } + set { ReadWriteAttribute[Keys.imageSmoothingQuality, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasLineCap.swift b/Sources/DOMKit/WebIDL/CanvasLineCap.swift index ce1d5675..4abf6591 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineCap.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineCap.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasLineCap: String, JSValueCompatible { - case butt - case round - case square +public enum CanvasLineCap: JSString, JSValueCompatible { + case butt = "butt" + case round = "round" + case square = "square" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift index 796d0952..cdb1b6c0 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasLineJoin: String, JSValueCompatible { - case round - case bevel - case miter +public enum CanvasLineJoin: JSString, JSValueCompatible { + case round = "round" + case bevel = "bevel" + case miter = "miter" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasPath.swift b/Sources/DOMKit/WebIDL/CanvasPath.swift index f668b650..7f5a6299 100644 --- a/Sources/DOMKit/WebIDL/CanvasPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasPath.swift @@ -3,22 +3,35 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let moveTo: JSString = "moveTo" + static let arc: JSString = "arc" + static let bezierCurveTo: JSString = "bezierCurveTo" + static let quadraticCurveTo: JSString = "quadraticCurveTo" + static let ellipse: JSString = "ellipse" + static let closePath: JSString = "closePath" + static let arcTo: JSString = "arcTo" + static let lineTo: JSString = "lineTo" + static let roundRect: JSString = "roundRect" + static let rect: JSString = "rect" +} + public protocol CanvasPath: JSBridgedClass {} public extension CanvasPath { func closePath() { - _ = jsObject["closePath"]!() + _ = jsObject[Keys.closePath]!() } func moveTo(x: Double, y: Double) { - _ = jsObject["moveTo"]!(x.jsValue(), y.jsValue()) + _ = jsObject[Keys.moveTo]!(x.jsValue(), y.jsValue()) } func lineTo(x: Double, y: Double) { - _ = jsObject["lineTo"]!(x.jsValue(), y.jsValue()) + _ = jsObject[Keys.lineTo]!(x.jsValue(), y.jsValue()) } func quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double) { - _ = jsObject["quadraticCurveTo"]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()) + _ = jsObject[Keys.quadraticCurveTo]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()) } func bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double) { @@ -28,19 +41,19 @@ public extension CanvasPath { let _arg3 = cp2y.jsValue() let _arg4 = x.jsValue() let _arg5 = y.jsValue() - _ = jsObject["bezierCurveTo"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + _ = jsObject[Keys.bezierCurveTo]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) { - _ = jsObject["arcTo"]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()) + _ = jsObject[Keys.arcTo]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()) } func rect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject["rect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + _ = jsObject[Keys.rect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } func roundRect(x: Double, y: Double, w: Double, h: Double, radii: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject["roundRect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined) + _ = jsObject[Keys.roundRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined) } func arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -50,7 +63,7 @@ public extension CanvasPath { let _arg3 = startAngle.jsValue() let _arg4 = endAngle.jsValue() let _arg5 = counterclockwise?.jsValue() ?? .undefined - _ = jsObject["arc"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + _ = jsObject[Keys.arc]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -62,6 +75,6 @@ public extension CanvasPath { let _arg5 = startAngle.jsValue() let _arg6 = endAngle.jsValue() let _arg7 = counterclockwise?.jsValue() ?? .undefined - _ = jsObject["ellipse"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + _ = jsObject[Keys.ellipse]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift index 278f4fa6..13929d5e 100644 --- a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift @@ -3,38 +3,48 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let lineCap: JSString = "lineCap" + static let getLineDash: JSString = "getLineDash" + static let lineJoin: JSString = "lineJoin" + static let miterLimit: JSString = "miterLimit" + static let setLineDash: JSString = "setLineDash" + static let lineWidth: JSString = "lineWidth" + static let lineDashOffset: JSString = "lineDashOffset" +} + public protocol CanvasPathDrawingStyles: JSBridgedClass {} public extension CanvasPathDrawingStyles { var lineWidth: Double { - get { ReadWriteAttribute["lineWidth", in: jsObject] } - set { ReadWriteAttribute["lineWidth", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.lineWidth, in: jsObject] } + set { ReadWriteAttribute[Keys.lineWidth, in: jsObject] = newValue } } var lineCap: CanvasLineCap { - get { ReadWriteAttribute["lineCap", in: jsObject] } - set { ReadWriteAttribute["lineCap", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.lineCap, in: jsObject] } + set { ReadWriteAttribute[Keys.lineCap, in: jsObject] = newValue } } var lineJoin: CanvasLineJoin { - get { ReadWriteAttribute["lineJoin", in: jsObject] } - set { ReadWriteAttribute["lineJoin", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.lineJoin, in: jsObject] } + set { ReadWriteAttribute[Keys.lineJoin, in: jsObject] = newValue } } var miterLimit: Double { - get { ReadWriteAttribute["miterLimit", in: jsObject] } - set { ReadWriteAttribute["miterLimit", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.miterLimit, in: jsObject] } + set { ReadWriteAttribute[Keys.miterLimit, in: jsObject] = newValue } } func setLineDash(segments: [Double]) { - _ = jsObject["setLineDash"]!(segments.jsValue()) + _ = jsObject[Keys.setLineDash]!(segments.jsValue()) } func getLineDash() -> [Double] { - jsObject["getLineDash"]!().fromJSValue()! + jsObject[Keys.getLineDash]!().fromJSValue()! } var lineDashOffset: Double { - get { ReadWriteAttribute["lineDashOffset", in: jsObject] } - set { ReadWriteAttribute["lineDashOffset", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.lineDashOffset, in: jsObject] } + set { ReadWriteAttribute[Keys.lineDashOffset, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasPattern.swift b/Sources/DOMKit/WebIDL/CanvasPattern.swift index ea834579..907d418d 100644 --- a/Sources/DOMKit/WebIDL/CanvasPattern.swift +++ b/Sources/DOMKit/WebIDL/CanvasPattern.swift @@ -6,6 +6,10 @@ import JavaScriptKit public class CanvasPattern: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CanvasPattern.function! } + private enum Keys { + static let setTransform: JSString = "setTransform" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -13,6 +17,6 @@ public class CanvasPattern: JSBridgedClass { } public func setTransform(transform: DOMMatrix2DInit? = nil) { - _ = jsObject["setTransform"]!(transform?.jsValue() ?? .undefined) + _ = jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CanvasRect.swift b/Sources/DOMKit/WebIDL/CanvasRect.swift index b25b6ae6..11301b43 100644 --- a/Sources/DOMKit/WebIDL/CanvasRect.swift +++ b/Sources/DOMKit/WebIDL/CanvasRect.swift @@ -3,17 +3,23 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let strokeRect: JSString = "strokeRect" + static let clearRect: JSString = "clearRect" + static let fillRect: JSString = "fillRect" +} + public protocol CanvasRect: JSBridgedClass {} public extension CanvasRect { func clearRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject["clearRect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + _ = jsObject[Keys.clearRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } func fillRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject["fillRect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + _ = jsObject[Keys.fillRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } func strokeRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject["strokeRect"]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + _ = jsObject[Keys.strokeRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift index b149b918..4b678cc8 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { public class var constructor: JSFunction { JSObject.global.CanvasRenderingContext2D.function! } + private enum Keys { + static let canvas: JSString = "canvas" + static let getContextAttributes: JSString = "getContextAttributes" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _canvas = ReadonlyAttribute(jsObject: jsObject, name: "canvas") + _canvas = ReadonlyAttribute(jsObject: jsObject, name: Keys.canvas) self.jsObject = jsObject } @@ -17,6 +22,6 @@ public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransf public var canvas: HTMLCanvasElement public func getContextAttributes() -> CanvasRenderingContext2DSettings { - jsObject["getContextAttributes"]!().fromJSValue()! + jsObject[Keys.getContextAttributes]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift index 29dc144f..443939e6 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift @@ -4,20 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasRenderingContext2DSettings: BridgedDictionary { + private enum Keys { + static let alpha: JSString = "alpha" + static let desynchronized: JSString = "desynchronized" + static let colorSpace: JSString = "colorSpace" + static let willReadFrequently: JSString = "willReadFrequently" + } + public convenience init(alpha: Bool, desynchronized: Bool, colorSpace: PredefinedColorSpace, willReadFrequently: Bool) { let object = JSObject.global.Object.function!.new() - object["alpha"] = alpha.jsValue() - object["desynchronized"] = desynchronized.jsValue() - object["colorSpace"] = colorSpace.jsValue() - object["willReadFrequently"] = willReadFrequently.jsValue() + object[Keys.alpha] = alpha.jsValue() + object[Keys.desynchronized] = desynchronized.jsValue() + object[Keys.colorSpace] = colorSpace.jsValue() + object[Keys.willReadFrequently] = willReadFrequently.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: "alpha") - _desynchronized = ReadWriteAttribute(jsObject: object, name: "desynchronized") - _colorSpace = ReadWriteAttribute(jsObject: object, name: "colorSpace") - _willReadFrequently = ReadWriteAttribute(jsObject: object, name: "willReadFrequently") + _alpha = ReadWriteAttribute(jsObject: object, name: Keys.alpha) + _desynchronized = ReadWriteAttribute(jsObject: object, name: Keys.desynchronized) + _colorSpace = ReadWriteAttribute(jsObject: object, name: Keys.colorSpace) + _willReadFrequently = ReadWriteAttribute(jsObject: object, name: Keys.willReadFrequently) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift index 7f1c7a9e..086557a5 100644 --- a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift @@ -3,25 +3,32 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let shadowOffsetY: JSString = "shadowOffsetY" + static let shadowBlur: JSString = "shadowBlur" + static let shadowOffsetX: JSString = "shadowOffsetX" + static let shadowColor: JSString = "shadowColor" +} + public protocol CanvasShadowStyles: JSBridgedClass {} public extension CanvasShadowStyles { var shadowOffsetX: Double { - get { ReadWriteAttribute["shadowOffsetX", in: jsObject] } - set { ReadWriteAttribute["shadowOffsetX", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.shadowOffsetX, in: jsObject] } + set { ReadWriteAttribute[Keys.shadowOffsetX, in: jsObject] = newValue } } var shadowOffsetY: Double { - get { ReadWriteAttribute["shadowOffsetY", in: jsObject] } - set { ReadWriteAttribute["shadowOffsetY", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.shadowOffsetY, in: jsObject] } + set { ReadWriteAttribute[Keys.shadowOffsetY, in: jsObject] = newValue } } var shadowBlur: Double { - get { ReadWriteAttribute["shadowBlur", in: jsObject] } - set { ReadWriteAttribute["shadowBlur", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.shadowBlur, in: jsObject] } + set { ReadWriteAttribute[Keys.shadowBlur, in: jsObject] = newValue } } var shadowColor: String { - get { ReadWriteAttribute["shadowColor", in: jsObject] } - set { ReadWriteAttribute["shadowColor", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.shadowColor, in: jsObject] } + set { ReadWriteAttribute[Keys.shadowColor, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasState.swift b/Sources/DOMKit/WebIDL/CanvasState.swift index d13b4416..9ed2a84b 100644 --- a/Sources/DOMKit/WebIDL/CanvasState.swift +++ b/Sources/DOMKit/WebIDL/CanvasState.swift @@ -3,21 +3,28 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let isContextLost: JSString = "isContextLost" + static let save: JSString = "save" + static let reset: JSString = "reset" + static let restore: JSString = "restore" +} + public protocol CanvasState: JSBridgedClass {} public extension CanvasState { func save() { - _ = jsObject["save"]!() + _ = jsObject[Keys.save]!() } func restore() { - _ = jsObject["restore"]!() + _ = jsObject[Keys.restore]!() } func reset() { - _ = jsObject["reset"]!() + _ = jsObject[Keys.reset]!() } func isContextLost() -> Bool { - jsObject["isContextLost"]!().fromJSValue()! + jsObject[Keys.isContextLost]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasText.swift b/Sources/DOMKit/WebIDL/CanvasText.swift index c9dbaeec..34dd0fd3 100644 --- a/Sources/DOMKit/WebIDL/CanvasText.swift +++ b/Sources/DOMKit/WebIDL/CanvasText.swift @@ -3,17 +3,23 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let fillText: JSString = "fillText" + static let strokeText: JSString = "strokeText" + static let measureText: JSString = "measureText" +} + public protocol CanvasText: JSBridgedClass {} public extension CanvasText { func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - _ = jsObject["fillText"]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + _ = jsObject[Keys.fillText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) } func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - _ = jsObject["strokeText"]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + _ = jsObject[Keys.strokeText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) } func measureText(text: String) -> TextMetrics { - jsObject["measureText"]!(text.jsValue()).fromJSValue()! + jsObject[Keys.measureText]!(text.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift index 855bcdae..6512b7ba 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift @@ -3,19 +3,23 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasTextAlign: String, JSValueCompatible { - case start - case end - case left - case right - case center +public enum CanvasTextAlign: JSString, JSValueCompatible { + case start = "start" + case end = "end" + case left = "left" + case right = "right" + case center = "center" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift index 56de331b..0ac85557 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasTextBaseline: String, JSValueCompatible { - case top - case hanging - case middle - case alphabetic - case ideographic - case bottom +public enum CanvasTextBaseline: JSString, JSValueCompatible { + case top = "top" + case hanging = "hanging" + case middle = "middle" + case alphabetic = "alphabetic" + case ideographic = "ideographic" + case bottom = "bottom" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift index a74779f5..929e42d8 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift @@ -3,55 +3,68 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let textBaseline: JSString = "textBaseline" + static let font: JSString = "font" + static let direction: JSString = "direction" + static let letterSpacing: JSString = "letterSpacing" + static let textAlign: JSString = "textAlign" + static let fontKerning: JSString = "fontKerning" + static let fontStretch: JSString = "fontStretch" + static let textRendering: JSString = "textRendering" + static let wordSpacing: JSString = "wordSpacing" + static let fontVariantCaps: JSString = "fontVariantCaps" +} + public protocol CanvasTextDrawingStyles: JSBridgedClass {} public extension CanvasTextDrawingStyles { var font: String { - get { ReadWriteAttribute["font", in: jsObject] } - set { ReadWriteAttribute["font", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.font, in: jsObject] } + set { ReadWriteAttribute[Keys.font, in: jsObject] = newValue } } var textAlign: CanvasTextAlign { - get { ReadWriteAttribute["textAlign", in: jsObject] } - set { ReadWriteAttribute["textAlign", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.textAlign, in: jsObject] } + set { ReadWriteAttribute[Keys.textAlign, in: jsObject] = newValue } } var textBaseline: CanvasTextBaseline { - get { ReadWriteAttribute["textBaseline", in: jsObject] } - set { ReadWriteAttribute["textBaseline", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.textBaseline, in: jsObject] } + set { ReadWriteAttribute[Keys.textBaseline, in: jsObject] = newValue } } var direction: CanvasDirection { - get { ReadWriteAttribute["direction", in: jsObject] } - set { ReadWriteAttribute["direction", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.direction, in: jsObject] } + set { ReadWriteAttribute[Keys.direction, in: jsObject] = newValue } } var letterSpacing: String { - get { ReadWriteAttribute["letterSpacing", in: jsObject] } - set { ReadWriteAttribute["letterSpacing", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.letterSpacing, in: jsObject] } + set { ReadWriteAttribute[Keys.letterSpacing, in: jsObject] = newValue } } var fontKerning: CanvasFontKerning { - get { ReadWriteAttribute["fontKerning", in: jsObject] } - set { ReadWriteAttribute["fontKerning", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.fontKerning, in: jsObject] } + set { ReadWriteAttribute[Keys.fontKerning, in: jsObject] = newValue } } var fontStretch: CanvasFontStretch { - get { ReadWriteAttribute["fontStretch", in: jsObject] } - set { ReadWriteAttribute["fontStretch", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.fontStretch, in: jsObject] } + set { ReadWriteAttribute[Keys.fontStretch, in: jsObject] = newValue } } var fontVariantCaps: CanvasFontVariantCaps { - get { ReadWriteAttribute["fontVariantCaps", in: jsObject] } - set { ReadWriteAttribute["fontVariantCaps", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.fontVariantCaps, in: jsObject] } + set { ReadWriteAttribute[Keys.fontVariantCaps, in: jsObject] = newValue } } var textRendering: CanvasTextRendering { - get { ReadWriteAttribute["textRendering", in: jsObject] } - set { ReadWriteAttribute["textRendering", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.textRendering, in: jsObject] } + set { ReadWriteAttribute[Keys.textRendering, in: jsObject] = newValue } } var wordSpacing: String { - get { ReadWriteAttribute["wordSpacing", in: jsObject] } - set { ReadWriteAttribute["wordSpacing", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.wordSpacing, in: jsObject] } + set { ReadWriteAttribute[Keys.wordSpacing, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift index 345035f9..1027dc20 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasTextRendering: String, JSValueCompatible { - case auto - case optimizeSpeed - case optimizeLegibility - case geometricPrecision +public enum CanvasTextRendering: JSString, JSValueCompatible { + case auto = "auto" + case optimizeSpeed = "optimizeSpeed" + case optimizeLegibility = "optimizeLegibility" + case geometricPrecision = "geometricPrecision" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasTransform.swift b/Sources/DOMKit/WebIDL/CanvasTransform.swift index d992e6e7..c9af099a 100644 --- a/Sources/DOMKit/WebIDL/CanvasTransform.swift +++ b/Sources/DOMKit/WebIDL/CanvasTransform.swift @@ -3,18 +3,28 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let setTransform: JSString = "setTransform" + static let translate: JSString = "translate" + static let getTransform: JSString = "getTransform" + static let resetTransform: JSString = "resetTransform" + static let rotate: JSString = "rotate" + static let transform: JSString = "transform" + static let scale: JSString = "scale" +} + public protocol CanvasTransform: JSBridgedClass {} public extension CanvasTransform { func scale(x: Double, y: Double) { - _ = jsObject["scale"]!(x.jsValue(), y.jsValue()) + _ = jsObject[Keys.scale]!(x.jsValue(), y.jsValue()) } func rotate(angle: Double) { - _ = jsObject["rotate"]!(angle.jsValue()) + _ = jsObject[Keys.rotate]!(angle.jsValue()) } func translate(x: Double, y: Double) { - _ = jsObject["translate"]!(x.jsValue(), y.jsValue()) + _ = jsObject[Keys.translate]!(x.jsValue(), y.jsValue()) } func transform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { @@ -24,11 +34,11 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - _ = jsObject["transform"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + _ = jsObject[Keys.transform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func getTransform() -> DOMMatrix { - jsObject["getTransform"]!().fromJSValue()! + jsObject[Keys.getTransform]!().fromJSValue()! } func setTransform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { @@ -38,14 +48,14 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - _ = jsObject["setTransform"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + _ = jsObject[Keys.setTransform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func setTransform(transform: DOMMatrix2DInit? = nil) { - _ = jsObject["setTransform"]!(transform?.jsValue() ?? .undefined) + _ = jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined) } func resetTransform() { - _ = jsObject["resetTransform"]!() + _ = jsObject[Keys.resetTransform]!() } } diff --git a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift index 6096e0e8..4faa8dc9 100644 --- a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift +++ b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift @@ -3,21 +3,26 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded" + static let scrollPathIntoView: JSString = "scrollPathIntoView" +} + public protocol CanvasUserInterface: JSBridgedClass {} public extension CanvasUserInterface { func drawFocusIfNeeded(element: Element) { - _ = jsObject["drawFocusIfNeeded"]!(element.jsValue()) + _ = jsObject[Keys.drawFocusIfNeeded]!(element.jsValue()) } func drawFocusIfNeeded(path: Path2D, element: Element) { - _ = jsObject["drawFocusIfNeeded"]!(path.jsValue(), element.jsValue()) + _ = jsObject[Keys.drawFocusIfNeeded]!(path.jsValue(), element.jsValue()) } func scrollPathIntoView() { - _ = jsObject["scrollPathIntoView"]!() + _ = jsObject[Keys.scrollPathIntoView]!() } func scrollPathIntoView(path: Path2D) { - _ = jsObject["scrollPathIntoView"]!(path.jsValue()) + _ = jsObject[Keys.scrollPathIntoView]!(path.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CharacterData.swift b/Sources/DOMKit/WebIDL/CharacterData.swift index 80012dab..0b2e91ae 100644 --- a/Sources/DOMKit/WebIDL/CharacterData.swift +++ b/Sources/DOMKit/WebIDL/CharacterData.swift @@ -6,9 +6,19 @@ import JavaScriptKit public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { override public class var constructor: JSFunction { JSObject.global.CharacterData.function! } + private enum Keys { + static let appendData: JSString = "appendData" + static let length: JSString = "length" + static let deleteData: JSString = "deleteData" + static let replaceData: JSString = "replaceData" + static let insertData: JSString = "insertData" + static let substringData: JSString = "substringData" + static let data: JSString = "data" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadWriteAttribute(jsObject: jsObject, name: "data") - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _data = ReadWriteAttribute(jsObject: jsObject, name: Keys.data) + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) super.init(unsafelyWrapping: jsObject) } @@ -19,22 +29,22 @@ public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { public var length: UInt32 public func substringData(offset: UInt32, count: UInt32) -> String { - jsObject["substringData"]!(offset.jsValue(), count.jsValue()).fromJSValue()! + jsObject[Keys.substringData]!(offset.jsValue(), count.jsValue()).fromJSValue()! } public func appendData(data: String) { - _ = jsObject["appendData"]!(data.jsValue()) + _ = jsObject[Keys.appendData]!(data.jsValue()) } public func insertData(offset: UInt32, data: String) { - _ = jsObject["insertData"]!(offset.jsValue(), data.jsValue()) + _ = jsObject[Keys.insertData]!(offset.jsValue(), data.jsValue()) } public func deleteData(offset: UInt32, count: UInt32) { - _ = jsObject["deleteData"]!(offset.jsValue(), count.jsValue()) + _ = jsObject[Keys.deleteData]!(offset.jsValue(), count.jsValue()) } public func replaceData(offset: UInt32, count: UInt32, data: String) { - _ = jsObject["replaceData"]!(offset.jsValue(), count.jsValue(), data.jsValue()) + _ = jsObject[Keys.replaceData]!(offset.jsValue(), count.jsValue(), data.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ChildNode.swift b/Sources/DOMKit/WebIDL/ChildNode.swift index 3281222c..373cfed1 100644 --- a/Sources/DOMKit/WebIDL/ChildNode.swift +++ b/Sources/DOMKit/WebIDL/ChildNode.swift @@ -3,21 +3,28 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let before: JSString = "before" + static let after: JSString = "after" + static let replaceWith: JSString = "replaceWith" + static let remove: JSString = "remove" +} + public protocol ChildNode: JSBridgedClass {} public extension ChildNode { func before(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject["before"]!(nodes.jsValue()) + _ = jsObject[Keys.before]!(nodes.jsValue()) } func after(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject["after"]!(nodes.jsValue()) + _ = jsObject[Keys.after]!(nodes.jsValue()) } func replaceWith(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject["replaceWith"]!(nodes.jsValue()) + _ = jsObject[Keys.replaceWith]!(nodes.jsValue()) } func remove() { - _ = jsObject["remove"]!() + _ = jsObject[Keys.remove]!() } } diff --git a/Sources/DOMKit/WebIDL/ClosureAttribute.swift b/Sources/DOMKit/WebIDL/ClosureAttribute.swift index 759bc9d3..0d147348 100644 --- a/Sources/DOMKit/WebIDL/ClosureAttribute.swift +++ b/Sources/DOMKit/WebIDL/ClosureAttribute.swift @@ -11,9 +11,9 @@ public enum ClosureAttribute { where ReturnType: JSValueCompatible { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -23,7 +23,7 @@ public enum ClosureAttribute { set { Required0[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> () -> ReturnType { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> () -> ReturnType { get { let function = jsObject[name].function! return { function().fromJSValue()! } @@ -40,9 +40,9 @@ public enum ClosureAttribute { where A0: JSValueCompatible, ReturnType: JSValueCompatible { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -52,7 +52,7 @@ public enum ClosureAttribute { set { Required1[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> (A0) -> ReturnType { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0) -> ReturnType { get { let function = jsObject[name].function! return { function($0.jsValue()).fromJSValue()! } @@ -69,9 +69,9 @@ public enum ClosureAttribute { where A0: JSValueCompatible, A1: JSValueCompatible, ReturnType: JSValueCompatible { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -81,7 +81,7 @@ public enum ClosureAttribute { set { Required2[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> (A0, A1) -> ReturnType { + @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()! } @@ -98,9 +98,9 @@ public enum ClosureAttribute { where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -110,7 +110,7 @@ public enum ClosureAttribute { set { Required5[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> (A0, A1, A2, A3, A4) -> ReturnType { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2, A3, A4) -> ReturnType { get { let function = jsObject[name].function! return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } @@ -129,9 +129,9 @@ public enum ClosureAttribute { where ReturnType: JSValueCompatible { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -141,7 +141,7 @@ public enum ClosureAttribute { set { Optional0[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> (() -> ReturnType)? { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (() -> ReturnType)? { get { guard let function = jsObject[name].function else { return nil @@ -164,9 +164,9 @@ public enum ClosureAttribute { where A0: JSValueCompatible, ReturnType: JSValueCompatible { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -176,7 +176,7 @@ public enum ClosureAttribute { set { Optional1[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> ((A0) -> ReturnType)? { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0) -> ReturnType)? { get { guard let function = jsObject[name].function else { return nil @@ -199,9 +199,9 @@ public enum ClosureAttribute { where A0: JSValueCompatible, A1: JSValueCompatible, ReturnType: JSValueCompatible { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -211,7 +211,7 @@ public enum ClosureAttribute { set { Optional2[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> ((A0, A1) -> ReturnType)? { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1) -> ReturnType)? { get { guard let function = jsObject[name].function else { return nil @@ -234,9 +234,9 @@ public enum ClosureAttribute { where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -246,7 +246,7 @@ public enum ClosureAttribute { set { Optional5[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> ((A0, A1, A2, A3, A4) -> ReturnType)? { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1, A2, A3, A4) -> ReturnType)? { get { guard let function = jsObject[name].function else { return nil diff --git a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift index cd4f08f1..a463e317 100644 --- a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift +++ b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ColorSpaceConversion: String, JSValueCompatible { - case none - case `default` +public enum ColorSpaceConversion: JSString, JSValueCompatible { + case none = "none" + case `default` = "default" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Comment.swift b/Sources/DOMKit/WebIDL/Comment.swift index bce14aa1..71d47cc9 100644 --- a/Sources/DOMKit/WebIDL/Comment.swift +++ b/Sources/DOMKit/WebIDL/Comment.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class Comment: CharacterData { override public class var constructor: JSFunction { JSObject.global.Comment.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index 929b0a8b..d284b152 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -6,8 +6,13 @@ import JavaScriptKit public class CompositionEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.CompositionEvent.function! } + private enum Keys { + static let data: JSString = "data" + static let initCompositionEvent: JSString = "initCompositionEvent" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: "data") + _data = ReadonlyAttribute(jsObject: jsObject, name: Keys.data) super.init(unsafelyWrapping: jsObject) } @@ -19,6 +24,6 @@ public class CompositionEvent: UIEvent { public var data: String public func initCompositionEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: WindowProxy? = nil, dataArg: String? = nil) { - _ = jsObject["initCompositionEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.jsValue() ?? .undefined) + _ = jsObject[Keys.initCompositionEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CompositionEventInit.swift b/Sources/DOMKit/WebIDL/CompositionEventInit.swift index d015a623..b711fcfd 100644 --- a/Sources/DOMKit/WebIDL/CompositionEventInit.swift +++ b/Sources/DOMKit/WebIDL/CompositionEventInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class CompositionEventInit: BridgedDictionary { + private enum Keys { + static let data: JSString = "data" + } + public convenience init(data: String) { let object = JSObject.global.Object.function!.new() - object["data"] = data.jsValue() + object[Keys.data] = data.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _data = ReadWriteAttribute(jsObject: object, name: "data") + _data = ReadWriteAttribute(jsObject: object, name: Keys.data) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift index f0b49be2..c0013845 100644 --- a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift @@ -6,11 +6,16 @@ import JavaScriptKit public class CountQueuingStrategy: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CountQueuingStrategy.function! } + private enum Keys { + static let highWaterMark: JSString = "highWaterMark" + static let size: JSString = "size" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: "highWaterMark") - _size = ReadonlyAttribute(jsObject: jsObject, name: "size") + _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Keys.highWaterMark) + _size = ReadonlyAttribute(jsObject: jsObject, name: Keys.size) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index f3b1231c..ec6fe988 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -6,6 +6,13 @@ import JavaScriptKit public class CustomElementRegistry: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CustomElementRegistry.function! } + private enum Keys { + static let whenDefined: JSString = "whenDefined" + static let upgrade: JSString = "upgrade" + static let get: JSString = "get" + static let define: JSString = "define" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -15,7 +22,7 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'define' is ignored public func get(name: String) -> __UNSUPPORTED_UNION__ { - jsObject["get"]!(name.jsValue()).fromJSValue()! + jsObject[Keys.get]!(name.jsValue()).fromJSValue()! } // XXX: member 'whenDefined' is ignored @@ -23,6 +30,6 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'whenDefined' is ignored public func upgrade(root: Node) { - _ = jsObject["upgrade"]!(root.jsValue()) + _ = jsObject[Keys.upgrade]!(root.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index 892b2801..685b8e7b 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -6,8 +6,13 @@ import JavaScriptKit public class CustomEvent: Event { override public class var constructor: JSFunction { JSObject.global.CustomEvent.function! } + private enum Keys { + static let detail: JSString = "detail" + static let initCustomEvent: JSString = "initCustomEvent" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _detail = ReadonlyAttribute(jsObject: jsObject, name: "detail") + _detail = ReadonlyAttribute(jsObject: jsObject, name: Keys.detail) super.init(unsafelyWrapping: jsObject) } @@ -19,6 +24,6 @@ public class CustomEvent: Event { public var detail: JSValue public func initCustomEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, detail: JSValue? = nil) { - _ = jsObject["initCustomEvent"]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined) + _ = jsObject[Keys.initCustomEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CustomEventInit.swift b/Sources/DOMKit/WebIDL/CustomEventInit.swift index 86452351..7403484f 100644 --- a/Sources/DOMKit/WebIDL/CustomEventInit.swift +++ b/Sources/DOMKit/WebIDL/CustomEventInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class CustomEventInit: BridgedDictionary { + private enum Keys { + static let detail: JSString = "detail" + } + public convenience init(detail: JSValue) { let object = JSObject.global.Object.function!.new() - object["detail"] = detail.jsValue() + object[Keys.detail] = detail.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _detail = ReadWriteAttribute(jsObject: object, name: "detail") + _detail = ReadWriteAttribute(jsObject: object, name: Keys.detail) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMException.swift b/Sources/DOMKit/WebIDL/DOMException.swift index f008c5c2..bf3c2945 100644 --- a/Sources/DOMKit/WebIDL/DOMException.swift +++ b/Sources/DOMKit/WebIDL/DOMException.swift @@ -6,12 +6,43 @@ import JavaScriptKit public class DOMException: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMException.function! } + private enum Keys { + static let INVALID_MODIFICATION_ERR: JSString = "INVALID_MODIFICATION_ERR" + static let INVALID_ACCESS_ERR: JSString = "INVALID_ACCESS_ERR" + static let VALIDATION_ERR: JSString = "VALIDATION_ERR" + static let QUOTA_EXCEEDED_ERR: JSString = "QUOTA_EXCEEDED_ERR" + static let NETWORK_ERR: JSString = "NETWORK_ERR" + static let WRONG_DOCUMENT_ERR: JSString = "WRONG_DOCUMENT_ERR" + static let INUSE_ATTRIBUTE_ERR: JSString = "INUSE_ATTRIBUTE_ERR" + static let INVALID_CHARACTER_ERR: JSString = "INVALID_CHARACTER_ERR" + static let SYNTAX_ERR: JSString = "SYNTAX_ERR" + static let DATA_CLONE_ERR: JSString = "DATA_CLONE_ERR" + static let SECURITY_ERR: JSString = "SECURITY_ERR" + static let NO_MODIFICATION_ALLOWED_ERR: JSString = "NO_MODIFICATION_ALLOWED_ERR" + static let URL_MISMATCH_ERR: JSString = "URL_MISMATCH_ERR" + static let TIMEOUT_ERR: JSString = "TIMEOUT_ERR" + static let message: JSString = "message" + static let ABORT_ERR: JSString = "ABORT_ERR" + static let INDEX_SIZE_ERR: JSString = "INDEX_SIZE_ERR" + static let NAMESPACE_ERR: JSString = "NAMESPACE_ERR" + static let TYPE_MISMATCH_ERR: JSString = "TYPE_MISMATCH_ERR" + static let name: JSString = "name" + static let DOMSTRING_SIZE_ERR: JSString = "DOMSTRING_SIZE_ERR" + static let NOT_SUPPORTED_ERR: JSString = "NOT_SUPPORTED_ERR" + static let code: JSString = "code" + static let HIERARCHY_REQUEST_ERR: JSString = "HIERARCHY_REQUEST_ERR" + static let INVALID_STATE_ERR: JSString = "INVALID_STATE_ERR" + static let NO_DATA_ALLOWED_ERR: JSString = "NO_DATA_ALLOWED_ERR" + static let NOT_FOUND_ERR: JSString = "NOT_FOUND_ERR" + static let INVALID_NODE_TYPE_ERR: JSString = "INVALID_NODE_TYPE_ERR" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: "name") - _message = ReadonlyAttribute(jsObject: jsObject, name: "message") - _code = ReadonlyAttribute(jsObject: jsObject, name: "code") + _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) + _message = ReadonlyAttribute(jsObject: jsObject, name: Keys.message) + _code = ReadonlyAttribute(jsObject: jsObject, name: Keys.code) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/DOMImplementation.swift b/Sources/DOMKit/WebIDL/DOMImplementation.swift index ad003c70..cfe9efc7 100644 --- a/Sources/DOMKit/WebIDL/DOMImplementation.swift +++ b/Sources/DOMKit/WebIDL/DOMImplementation.swift @@ -6,6 +6,13 @@ import JavaScriptKit public class DOMImplementation: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMImplementation.function! } + private enum Keys { + static let createDocument: JSString = "createDocument" + static let hasFeature: JSString = "hasFeature" + static let createHTMLDocument: JSString = "createHTMLDocument" + static let createDocumentType: JSString = "createDocumentType" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -13,18 +20,18 @@ public class DOMImplementation: JSBridgedClass { } public func createDocumentType(qualifiedName: String, publicId: String, systemId: String) -> DocumentType { - jsObject["createDocumentType"]!(qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()).fromJSValue()! + jsObject[Keys.createDocumentType]!(qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()).fromJSValue()! } public func createDocument(namespace: String?, qualifiedName: String, doctype: DocumentType? = nil) -> XMLDocument { - jsObject["createDocument"]!(namespace.jsValue(), qualifiedName.jsValue(), doctype?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.createDocument]!(namespace.jsValue(), qualifiedName.jsValue(), doctype?.jsValue() ?? .undefined).fromJSValue()! } public func createHTMLDocument(title: String? = nil) -> Document { - jsObject["createHTMLDocument"]!(title?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.createHTMLDocument]!(title?.jsValue() ?? .undefined).fromJSValue()! } public func hasFeature() -> Bool { - jsObject["hasFeature"]!().fromJSValue()! + jsObject[Keys.hasFeature]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index abeeeae7..5e3a0496 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -6,29 +6,69 @@ import JavaScriptKit public class DOMMatrix: DOMMatrixReadOnly { override public class var constructor: JSFunction { JSObject.global.DOMMatrix.function! } + private enum Keys { + static let m24: JSString = "m24" + static let m22: JSString = "m22" + static let fromFloat32Array: JSString = "fromFloat32Array" + static let e: JSString = "e" + static let fromFloat64Array: JSString = "fromFloat64Array" + static let multiplySelf: JSString = "multiplySelf" + static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" + static let f: JSString = "f" + static let invertSelf: JSString = "invertSelf" + static let c: JSString = "c" + static let m11: JSString = "m11" + static let b: JSString = "b" + static let m43: JSString = "m43" + static let scaleSelf: JSString = "scaleSelf" + static let fromMatrix: JSString = "fromMatrix" + static let scale3dSelf: JSString = "scale3dSelf" + static let m41: JSString = "m41" + static let m33: JSString = "m33" + static let skewYSelf: JSString = "skewYSelf" + static let a: JSString = "a" + static let m31: JSString = "m31" + static let rotateSelf: JSString = "rotateSelf" + static let m13: JSString = "m13" + static let m34: JSString = "m34" + static let translateSelf: JSString = "translateSelf" + static let m21: JSString = "m21" + static let d: JSString = "d" + static let m42: JSString = "m42" + static let m23: JSString = "m23" + static let m32: JSString = "m32" + static let m12: JSString = "m12" + static let rotateFromVectorSelf: JSString = "rotateFromVectorSelf" + static let preMultiplySelf: JSString = "preMultiplySelf" + static let m14: JSString = "m14" + static let skewXSelf: JSString = "skewXSelf" + static let setMatrixValue: JSString = "setMatrixValue" + static let m44: JSString = "m44" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _a = ReadWriteAttribute(jsObject: jsObject, name: "a") - _b = ReadWriteAttribute(jsObject: jsObject, name: "b") - _c = ReadWriteAttribute(jsObject: jsObject, name: "c") - _d = ReadWriteAttribute(jsObject: jsObject, name: "d") - _e = ReadWriteAttribute(jsObject: jsObject, name: "e") - _f = ReadWriteAttribute(jsObject: jsObject, name: "f") - _m11 = ReadWriteAttribute(jsObject: jsObject, name: "m11") - _m12 = ReadWriteAttribute(jsObject: jsObject, name: "m12") - _m13 = ReadWriteAttribute(jsObject: jsObject, name: "m13") - _m14 = ReadWriteAttribute(jsObject: jsObject, name: "m14") - _m21 = ReadWriteAttribute(jsObject: jsObject, name: "m21") - _m22 = ReadWriteAttribute(jsObject: jsObject, name: "m22") - _m23 = ReadWriteAttribute(jsObject: jsObject, name: "m23") - _m24 = ReadWriteAttribute(jsObject: jsObject, name: "m24") - _m31 = ReadWriteAttribute(jsObject: jsObject, name: "m31") - _m32 = ReadWriteAttribute(jsObject: jsObject, name: "m32") - _m33 = ReadWriteAttribute(jsObject: jsObject, name: "m33") - _m34 = ReadWriteAttribute(jsObject: jsObject, name: "m34") - _m41 = ReadWriteAttribute(jsObject: jsObject, name: "m41") - _m42 = ReadWriteAttribute(jsObject: jsObject, name: "m42") - _m43 = ReadWriteAttribute(jsObject: jsObject, name: "m43") - _m44 = ReadWriteAttribute(jsObject: jsObject, name: "m44") + _a = ReadWriteAttribute(jsObject: jsObject, name: Keys.a) + _b = ReadWriteAttribute(jsObject: jsObject, name: Keys.b) + _c = ReadWriteAttribute(jsObject: jsObject, name: Keys.c) + _d = ReadWriteAttribute(jsObject: jsObject, name: Keys.d) + _e = ReadWriteAttribute(jsObject: jsObject, name: Keys.e) + _f = ReadWriteAttribute(jsObject: jsObject, name: Keys.f) + _m11 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m11) + _m12 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m12) + _m13 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m13) + _m14 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m14) + _m21 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m21) + _m22 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m22) + _m23 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m23) + _m24 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m24) + _m31 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m31) + _m32 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m32) + _m33 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m33) + _m34 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m34) + _m41 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m41) + _m42 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m42) + _m43 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m43) + _m44 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m44) super.init(unsafelyWrapping: jsObject) } @@ -178,15 +218,15 @@ public class DOMMatrix: DOMMatrixReadOnly { } public func multiplySelf(other: DOMMatrixInit? = nil) -> Self { - jsObject["multiplySelf"]!(other?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.multiplySelf]!(other?.jsValue() ?? .undefined).fromJSValue()! } public func preMultiplySelf(other: DOMMatrixInit? = nil) -> Self { - jsObject["preMultiplySelf"]!(other?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.preMultiplySelf]!(other?.jsValue() ?? .undefined).fromJSValue()! } public func translateSelf(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> Self { - jsObject["translateSelf"]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.translateSelf]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! } public func scaleSelf(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { @@ -196,38 +236,38 @@ public class DOMMatrix: DOMMatrixReadOnly { let _arg3 = originX?.jsValue() ?? .undefined let _arg4 = originY?.jsValue() ?? .undefined let _arg5 = originZ?.jsValue() ?? .undefined - return jsObject["scaleSelf"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + return jsObject[Keys.scaleSelf]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } public func scale3dSelf(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { - jsObject["scale3dSelf"]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.scale3dSelf]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! } public func rotateSelf(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> Self { - jsObject["rotateSelf"]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.rotateSelf]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! } public func rotateFromVectorSelf(x: Double? = nil, y: Double? = nil) -> Self { - jsObject["rotateFromVectorSelf"]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.rotateFromVectorSelf]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! } public func rotateAxisAngleSelf(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> Self { - jsObject["rotateAxisAngleSelf"]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.rotateAxisAngleSelf]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! } public func skewXSelf(sx: Double? = nil) -> Self { - jsObject["skewXSelf"]!(sx?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.skewXSelf]!(sx?.jsValue() ?? .undefined).fromJSValue()! } public func skewYSelf(sy: Double? = nil) -> Self { - jsObject["skewYSelf"]!(sy?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.skewYSelf]!(sy?.jsValue() ?? .undefined).fromJSValue()! } public func invertSelf() -> Self { - jsObject["invertSelf"]!().fromJSValue()! + jsObject[Keys.invertSelf]!().fromJSValue()! } public func setMatrixValue(transformList: String) -> Self { - jsObject["setMatrixValue"]!(transformList.jsValue()).fromJSValue()! + jsObject[Keys.setMatrixValue]!(transformList.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift index a62b8d62..4bb6ecc0 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift @@ -4,36 +4,51 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMMatrix2DInit: BridgedDictionary { + private enum Keys { + static let a: JSString = "a" + static let f: JSString = "f" + static let m41: JSString = "m41" + static let m22: JSString = "m22" + static let m42: JSString = "m42" + static let m21: JSString = "m21" + static let b: JSString = "b" + static let d: JSString = "d" + static let e: JSString = "e" + static let c: JSString = "c" + static let m12: JSString = "m12" + static let m11: JSString = "m11" + } + public convenience init(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double, m11: Double, m12: Double, m21: Double, m22: Double, m41: Double, m42: Double) { let object = JSObject.global.Object.function!.new() - object["a"] = a.jsValue() - object["b"] = b.jsValue() - object["c"] = c.jsValue() - object["d"] = d.jsValue() - object["e"] = e.jsValue() - object["f"] = f.jsValue() - object["m11"] = m11.jsValue() - object["m12"] = m12.jsValue() - object["m21"] = m21.jsValue() - object["m22"] = m22.jsValue() - object["m41"] = m41.jsValue() - object["m42"] = m42.jsValue() + object[Keys.a] = a.jsValue() + object[Keys.b] = b.jsValue() + object[Keys.c] = c.jsValue() + object[Keys.d] = d.jsValue() + object[Keys.e] = e.jsValue() + object[Keys.f] = f.jsValue() + object[Keys.m11] = m11.jsValue() + object[Keys.m12] = m12.jsValue() + object[Keys.m21] = m21.jsValue() + object[Keys.m22] = m22.jsValue() + object[Keys.m41] = m41.jsValue() + object[Keys.m42] = m42.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _a = ReadWriteAttribute(jsObject: object, name: "a") - _b = ReadWriteAttribute(jsObject: object, name: "b") - _c = ReadWriteAttribute(jsObject: object, name: "c") - _d = ReadWriteAttribute(jsObject: object, name: "d") - _e = ReadWriteAttribute(jsObject: object, name: "e") - _f = ReadWriteAttribute(jsObject: object, name: "f") - _m11 = ReadWriteAttribute(jsObject: object, name: "m11") - _m12 = ReadWriteAttribute(jsObject: object, name: "m12") - _m21 = ReadWriteAttribute(jsObject: object, name: "m21") - _m22 = ReadWriteAttribute(jsObject: object, name: "m22") - _m41 = ReadWriteAttribute(jsObject: object, name: "m41") - _m42 = ReadWriteAttribute(jsObject: object, name: "m42") + _a = ReadWriteAttribute(jsObject: object, name: Keys.a) + _b = ReadWriteAttribute(jsObject: object, name: Keys.b) + _c = ReadWriteAttribute(jsObject: object, name: Keys.c) + _d = ReadWriteAttribute(jsObject: object, name: Keys.d) + _e = ReadWriteAttribute(jsObject: object, name: Keys.e) + _f = ReadWriteAttribute(jsObject: object, name: Keys.f) + _m11 = ReadWriteAttribute(jsObject: object, name: Keys.m11) + _m12 = ReadWriteAttribute(jsObject: object, name: Keys.m12) + _m21 = ReadWriteAttribute(jsObject: object, name: Keys.m21) + _m22 = ReadWriteAttribute(jsObject: object, name: Keys.m22) + _m41 = ReadWriteAttribute(jsObject: object, name: Keys.m41) + _m42 = ReadWriteAttribute(jsObject: object, name: Keys.m42) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift index da50f78d..2a2fff5a 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift @@ -4,34 +4,48 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMMatrixInit: BridgedDictionary { + private enum Keys { + static let m14: JSString = "m14" + static let m24: JSString = "m24" + static let m23: JSString = "m23" + static let m32: JSString = "m32" + static let m34: JSString = "m34" + static let m44: JSString = "m44" + static let m33: JSString = "m33" + static let is2D: JSString = "is2D" + static let m31: JSString = "m31" + static let m43: JSString = "m43" + static let m13: JSString = "m13" + } + public convenience init(m13: Double, m14: Double, m23: Double, m24: Double, m31: Double, m32: Double, m33: Double, m34: Double, m43: Double, m44: Double, is2D: Bool) { let object = JSObject.global.Object.function!.new() - object["m13"] = m13.jsValue() - object["m14"] = m14.jsValue() - object["m23"] = m23.jsValue() - object["m24"] = m24.jsValue() - object["m31"] = m31.jsValue() - object["m32"] = m32.jsValue() - object["m33"] = m33.jsValue() - object["m34"] = m34.jsValue() - object["m43"] = m43.jsValue() - object["m44"] = m44.jsValue() - object["is2D"] = is2D.jsValue() + object[Keys.m13] = m13.jsValue() + object[Keys.m14] = m14.jsValue() + object[Keys.m23] = m23.jsValue() + object[Keys.m24] = m24.jsValue() + object[Keys.m31] = m31.jsValue() + object[Keys.m32] = m32.jsValue() + object[Keys.m33] = m33.jsValue() + object[Keys.m34] = m34.jsValue() + object[Keys.m43] = m43.jsValue() + object[Keys.m44] = m44.jsValue() + object[Keys.is2D] = is2D.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _m13 = ReadWriteAttribute(jsObject: object, name: "m13") - _m14 = ReadWriteAttribute(jsObject: object, name: "m14") - _m23 = ReadWriteAttribute(jsObject: object, name: "m23") - _m24 = ReadWriteAttribute(jsObject: object, name: "m24") - _m31 = ReadWriteAttribute(jsObject: object, name: "m31") - _m32 = ReadWriteAttribute(jsObject: object, name: "m32") - _m33 = ReadWriteAttribute(jsObject: object, name: "m33") - _m34 = ReadWriteAttribute(jsObject: object, name: "m34") - _m43 = ReadWriteAttribute(jsObject: object, name: "m43") - _m44 = ReadWriteAttribute(jsObject: object, name: "m44") - _is2D = ReadWriteAttribute(jsObject: object, name: "is2D") + _m13 = ReadWriteAttribute(jsObject: object, name: Keys.m13) + _m14 = ReadWriteAttribute(jsObject: object, name: Keys.m14) + _m23 = ReadWriteAttribute(jsObject: object, name: Keys.m23) + _m24 = ReadWriteAttribute(jsObject: object, name: Keys.m24) + _m31 = ReadWriteAttribute(jsObject: object, name: Keys.m31) + _m32 = ReadWriteAttribute(jsObject: object, name: Keys.m32) + _m33 = ReadWriteAttribute(jsObject: object, name: Keys.m33) + _m34 = ReadWriteAttribute(jsObject: object, name: Keys.m34) + _m43 = ReadWriteAttribute(jsObject: object, name: Keys.m43) + _m44 = ReadWriteAttribute(jsObject: object, name: Keys.m44) + _is2D = ReadWriteAttribute(jsObject: object, name: Keys.is2D) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift index 921f3ac7..28c3e16d 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -6,33 +6,80 @@ import JavaScriptKit public class DOMMatrixReadOnly: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMMatrixReadOnly.function! } + private enum Keys { + static let a: JSString = "a" + static let translate: JSString = "translate" + static let skewX: JSString = "skewX" + static let m23: JSString = "m23" + static let d: JSString = "d" + static let m43: JSString = "m43" + static let rotate: JSString = "rotate" + static let m14: JSString = "m14" + static let m24: JSString = "m24" + static let isIdentity: JSString = "isIdentity" + static let flipX: JSString = "flipX" + static let m34: JSString = "m34" + static let toFloat32Array: JSString = "toFloat32Array" + static let fromFloat32Array: JSString = "fromFloat32Array" + static let toJSON: JSString = "toJSON" + static let c: JSString = "c" + static let m31: JSString = "m31" + static let m13: JSString = "m13" + static let multiply: JSString = "multiply" + static let m32: JSString = "m32" + static let rotateFromVector: JSString = "rotateFromVector" + static let scale: JSString = "scale" + static let flipY: JSString = "flipY" + static let m33: JSString = "m33" + static let m22: JSString = "m22" + static let m12: JSString = "m12" + static let m41: JSString = "m41" + static let is2D: JSString = "is2D" + static let scaleNonUniform: JSString = "scaleNonUniform" + static let scale3d: JSString = "scale3d" + static let rotateAxisAngle: JSString = "rotateAxisAngle" + static let skewY: JSString = "skewY" + static let inverse: JSString = "inverse" + static let m44: JSString = "m44" + static let transformPoint: JSString = "transformPoint" + static let e: JSString = "e" + static let toFloat64Array: JSString = "toFloat64Array" + static let fromFloat64Array: JSString = "fromFloat64Array" + static let m21: JSString = "m21" + static let fromMatrix: JSString = "fromMatrix" + static let b: JSString = "b" + static let f: JSString = "f" + static let m42: JSString = "m42" + static let m11: JSString = "m11" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _a = ReadonlyAttribute(jsObject: jsObject, name: "a") - _b = ReadonlyAttribute(jsObject: jsObject, name: "b") - _c = ReadonlyAttribute(jsObject: jsObject, name: "c") - _d = ReadonlyAttribute(jsObject: jsObject, name: "d") - _e = ReadonlyAttribute(jsObject: jsObject, name: "e") - _f = ReadonlyAttribute(jsObject: jsObject, name: "f") - _m11 = ReadonlyAttribute(jsObject: jsObject, name: "m11") - _m12 = ReadonlyAttribute(jsObject: jsObject, name: "m12") - _m13 = ReadonlyAttribute(jsObject: jsObject, name: "m13") - _m14 = ReadonlyAttribute(jsObject: jsObject, name: "m14") - _m21 = ReadonlyAttribute(jsObject: jsObject, name: "m21") - _m22 = ReadonlyAttribute(jsObject: jsObject, name: "m22") - _m23 = ReadonlyAttribute(jsObject: jsObject, name: "m23") - _m24 = ReadonlyAttribute(jsObject: jsObject, name: "m24") - _m31 = ReadonlyAttribute(jsObject: jsObject, name: "m31") - _m32 = ReadonlyAttribute(jsObject: jsObject, name: "m32") - _m33 = ReadonlyAttribute(jsObject: jsObject, name: "m33") - _m34 = ReadonlyAttribute(jsObject: jsObject, name: "m34") - _m41 = ReadonlyAttribute(jsObject: jsObject, name: "m41") - _m42 = ReadonlyAttribute(jsObject: jsObject, name: "m42") - _m43 = ReadonlyAttribute(jsObject: jsObject, name: "m43") - _m44 = ReadonlyAttribute(jsObject: jsObject, name: "m44") - _is2D = ReadonlyAttribute(jsObject: jsObject, name: "is2D") - _isIdentity = ReadonlyAttribute(jsObject: jsObject, name: "isIdentity") + _a = ReadonlyAttribute(jsObject: jsObject, name: Keys.a) + _b = ReadonlyAttribute(jsObject: jsObject, name: Keys.b) + _c = ReadonlyAttribute(jsObject: jsObject, name: Keys.c) + _d = ReadonlyAttribute(jsObject: jsObject, name: Keys.d) + _e = ReadonlyAttribute(jsObject: jsObject, name: Keys.e) + _f = ReadonlyAttribute(jsObject: jsObject, name: Keys.f) + _m11 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m11) + _m12 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m12) + _m13 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m13) + _m14 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m14) + _m21 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m21) + _m22 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m22) + _m23 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m23) + _m24 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m24) + _m31 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m31) + _m32 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m32) + _m33 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m33) + _m34 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m34) + _m41 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m41) + _m42 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m42) + _m43 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m43) + _m44 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m44) + _is2D = ReadonlyAttribute(jsObject: jsObject, name: Keys.is2D) + _isIdentity = ReadonlyAttribute(jsObject: jsObject, name: Keys.isIdentity) self.jsObject = jsObject } @@ -41,15 +88,15 @@ public class DOMMatrixReadOnly: JSBridgedClass { } public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self { - constructor["fromMatrix"]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Keys.fromMatrix]!(other?.jsValue() ?? .undefined).fromJSValue()! } public static func fromFloat32Array(array32: Float32Array) -> Self { - constructor["fromFloat32Array"]!(array32.jsValue()).fromJSValue()! + constructor[Keys.fromFloat32Array]!(array32.jsValue()).fromJSValue()! } public static func fromFloat64Array(array64: Float64Array) -> Self { - constructor["fromFloat64Array"]!(array64.jsValue()).fromJSValue()! + constructor[Keys.fromFloat64Array]!(array64.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -125,7 +172,7 @@ public class DOMMatrixReadOnly: JSBridgedClass { public var isIdentity: Bool public func translate(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> DOMMatrix { - jsObject["translate"]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.translate]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! } public func scale(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { @@ -135,70 +182,70 @@ public class DOMMatrixReadOnly: JSBridgedClass { let _arg3 = originX?.jsValue() ?? .undefined let _arg4 = originY?.jsValue() ?? .undefined let _arg5 = originZ?.jsValue() ?? .undefined - return jsObject["scale"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + return jsObject[Keys.scale]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } public func scaleNonUniform(scaleX: Double? = nil, scaleY: Double? = nil) -> DOMMatrix { - jsObject["scaleNonUniform"]!(scaleX?.jsValue() ?? .undefined, scaleY?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.scaleNonUniform]!(scaleX?.jsValue() ?? .undefined, scaleY?.jsValue() ?? .undefined).fromJSValue()! } public func scale3d(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { - jsObject["scale3d"]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.scale3d]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! } public func rotate(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> DOMMatrix { - jsObject["rotate"]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.rotate]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! } public func rotateFromVector(x: Double? = nil, y: Double? = nil) -> DOMMatrix { - jsObject["rotateFromVector"]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.rotateFromVector]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! } public func rotateAxisAngle(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> DOMMatrix { - jsObject["rotateAxisAngle"]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.rotateAxisAngle]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! } public func skewX(sx: Double? = nil) -> DOMMatrix { - jsObject["skewX"]!(sx?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.skewX]!(sx?.jsValue() ?? .undefined).fromJSValue()! } public func skewY(sy: Double? = nil) -> DOMMatrix { - jsObject["skewY"]!(sy?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.skewY]!(sy?.jsValue() ?? .undefined).fromJSValue()! } public func multiply(other: DOMMatrixInit? = nil) -> DOMMatrix { - jsObject["multiply"]!(other?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.multiply]!(other?.jsValue() ?? .undefined).fromJSValue()! } public func flipX() -> DOMMatrix { - jsObject["flipX"]!().fromJSValue()! + jsObject[Keys.flipX]!().fromJSValue()! } public func flipY() -> DOMMatrix { - jsObject["flipY"]!().fromJSValue()! + jsObject[Keys.flipY]!().fromJSValue()! } public func inverse() -> DOMMatrix { - jsObject["inverse"]!().fromJSValue()! + jsObject[Keys.inverse]!().fromJSValue()! } public func transformPoint(point: DOMPointInit? = nil) -> DOMPoint { - jsObject["transformPoint"]!(point?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.transformPoint]!(point?.jsValue() ?? .undefined).fromJSValue()! } public func toFloat32Array() -> Float32Array { - jsObject["toFloat32Array"]!().fromJSValue()! + jsObject[Keys.toFloat32Array]!().fromJSValue()! } public func toFloat64Array() -> Float64Array { - jsObject["toFloat64Array"]!().fromJSValue()! + jsObject[Keys.toFloat64Array]!().fromJSValue()! } public var description: String { - jsObject["toString"]!().fromJSValue()! + jsObject[Strings.toString]!().fromJSValue()! } public func toJSON() -> JSObject { - jsObject["toJSON"]!().fromJSValue()! + jsObject[Keys.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMParser.swift b/Sources/DOMKit/WebIDL/DOMParser.swift index 69c08176..26d63992 100644 --- a/Sources/DOMKit/WebIDL/DOMParser.swift +++ b/Sources/DOMKit/WebIDL/DOMParser.swift @@ -6,6 +6,10 @@ import JavaScriptKit public class DOMParser: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMParser.function! } + private enum Keys { + static let parseFromString: JSString = "parseFromString" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,6 +21,6 @@ public class DOMParser: JSBridgedClass { } public func parseFromString(string: String, type: DOMParserSupportedType) -> Document { - jsObject["parseFromString"]!(string.jsValue(), type.jsValue()).fromJSValue()! + jsObject[Keys.parseFromString]!(string.jsValue(), type.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift index ac0e6319..9e2d5c07 100644 --- a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift +++ b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public enum DOMParserSupportedType: String, JSValueCompatible { +public enum DOMParserSupportedType: JSString, JSValueCompatible { case textHtml = "text/html" case textXml = "text/xml" case applicationXml = "application/xml" @@ -11,11 +11,15 @@ public enum DOMParserSupportedType: String, JSValueCompatible { case imageSvgXml = "image/svg+xml" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/DOMPoint.swift b/Sources/DOMKit/WebIDL/DOMPoint.swift index 9bd42a2c..aeced126 100644 --- a/Sources/DOMKit/WebIDL/DOMPoint.swift +++ b/Sources/DOMKit/WebIDL/DOMPoint.swift @@ -6,11 +6,19 @@ import JavaScriptKit public class DOMPoint: DOMPointReadOnly { override public class var constructor: JSFunction { JSObject.global.DOMPoint.function! } + private enum Keys { + static let z: JSString = "z" + static let x: JSString = "x" + static let fromPoint: JSString = "fromPoint" + static let y: JSString = "y" + static let w: JSString = "w" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadWriteAttribute(jsObject: jsObject, name: "x") - _y = ReadWriteAttribute(jsObject: jsObject, name: "y") - _z = ReadWriteAttribute(jsObject: jsObject, name: "z") - _w = ReadWriteAttribute(jsObject: jsObject, name: "w") + _x = ReadWriteAttribute(jsObject: jsObject, name: Keys.x) + _y = ReadWriteAttribute(jsObject: jsObject, name: Keys.y) + _z = ReadWriteAttribute(jsObject: jsObject, name: Keys.z) + _w = ReadWriteAttribute(jsObject: jsObject, name: Keys.w) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DOMPointInit.swift b/Sources/DOMKit/WebIDL/DOMPointInit.swift index dc11d32d..3c1bfc6d 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit.swift @@ -4,20 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMPointInit: BridgedDictionary { + private enum Keys { + static let x: JSString = "x" + static let z: JSString = "z" + static let w: JSString = "w" + static let y: JSString = "y" + } + public convenience init(x: Double, y: Double, z: Double, w: Double) { let object = JSObject.global.Object.function!.new() - object["x"] = x.jsValue() - object["y"] = y.jsValue() - object["z"] = z.jsValue() - object["w"] = w.jsValue() + object[Keys.x] = x.jsValue() + object[Keys.y] = y.jsValue() + object[Keys.z] = z.jsValue() + object[Keys.w] = w.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: "x") - _y = ReadWriteAttribute(jsObject: object, name: "y") - _z = ReadWriteAttribute(jsObject: object, name: "z") - _w = ReadWriteAttribute(jsObject: object, name: "w") + _x = ReadWriteAttribute(jsObject: object, name: Keys.x) + _y = ReadWriteAttribute(jsObject: object, name: Keys.y) + _z = ReadWriteAttribute(jsObject: object, name: Keys.z) + _w = ReadWriteAttribute(jsObject: object, name: Keys.w) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift index ceb30c88..d3a96897 100644 --- a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift @@ -6,13 +6,23 @@ import JavaScriptKit public class DOMPointReadOnly: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMPointReadOnly.function! } + private enum Keys { + static let w: JSString = "w" + static let x: JSString = "x" + static let y: JSString = "y" + static let fromPoint: JSString = "fromPoint" + static let z: JSString = "z" + static let toJSON: JSString = "toJSON" + static let matrixTransform: JSString = "matrixTransform" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: "x") - _y = ReadonlyAttribute(jsObject: jsObject, name: "y") - _z = ReadonlyAttribute(jsObject: jsObject, name: "z") - _w = ReadonlyAttribute(jsObject: jsObject, name: "w") + _x = ReadonlyAttribute(jsObject: jsObject, name: Keys.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Keys.y) + _z = ReadonlyAttribute(jsObject: jsObject, name: Keys.z) + _w = ReadonlyAttribute(jsObject: jsObject, name: Keys.w) self.jsObject = jsObject } @@ -21,7 +31,7 @@ public class DOMPointReadOnly: JSBridgedClass { } public static func fromPoint(other: DOMPointInit? = nil) -> Self { - constructor["fromPoint"]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Keys.fromPoint]!(other?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -37,10 +47,10 @@ public class DOMPointReadOnly: JSBridgedClass { public var w: Double public func matrixTransform(matrix: DOMMatrixInit? = nil) -> DOMPoint { - jsObject["matrixTransform"]!(matrix?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.matrixTransform]!(matrix?.jsValue() ?? .undefined).fromJSValue()! } public func toJSON() -> JSObject { - jsObject["toJSON"]!().fromJSValue()! + jsObject[Keys.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMQuad.swift b/Sources/DOMKit/WebIDL/DOMQuad.swift index e2c41057..ce7d4bd2 100644 --- a/Sources/DOMKit/WebIDL/DOMQuad.swift +++ b/Sources/DOMKit/WebIDL/DOMQuad.swift @@ -6,13 +6,24 @@ import JavaScriptKit public class DOMQuad: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMQuad.function! } + private enum Keys { + static let p1: JSString = "p1" + static let p2: JSString = "p2" + static let getBounds: JSString = "getBounds" + static let toJSON: JSString = "toJSON" + static let p3: JSString = "p3" + static let fromRect: JSString = "fromRect" + static let p4: JSString = "p4" + static let fromQuad: JSString = "fromQuad" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _p1 = ReadonlyAttribute(jsObject: jsObject, name: "p1") - _p2 = ReadonlyAttribute(jsObject: jsObject, name: "p2") - _p3 = ReadonlyAttribute(jsObject: jsObject, name: "p3") - _p4 = ReadonlyAttribute(jsObject: jsObject, name: "p4") + _p1 = ReadonlyAttribute(jsObject: jsObject, name: Keys.p1) + _p2 = ReadonlyAttribute(jsObject: jsObject, name: Keys.p2) + _p3 = ReadonlyAttribute(jsObject: jsObject, name: Keys.p3) + _p4 = ReadonlyAttribute(jsObject: jsObject, name: Keys.p4) self.jsObject = jsObject } @@ -21,11 +32,11 @@ public class DOMQuad: JSBridgedClass { } public static func fromRect(other: DOMRectInit? = nil) -> Self { - constructor["fromRect"]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Keys.fromRect]!(other?.jsValue() ?? .undefined).fromJSValue()! } public static func fromQuad(other: DOMQuadInit? = nil) -> Self { - constructor["fromQuad"]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Keys.fromQuad]!(other?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -41,10 +52,10 @@ public class DOMQuad: JSBridgedClass { public var p4: DOMPoint public func getBounds() -> DOMRect { - jsObject["getBounds"]!().fromJSValue()! + jsObject[Keys.getBounds]!().fromJSValue()! } public func toJSON() -> JSObject { - jsObject["toJSON"]!().fromJSValue()! + jsObject[Keys.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMQuadInit.swift b/Sources/DOMKit/WebIDL/DOMQuadInit.swift index 86d8ae47..bf11f1df 100644 --- a/Sources/DOMKit/WebIDL/DOMQuadInit.swift +++ b/Sources/DOMKit/WebIDL/DOMQuadInit.swift @@ -4,20 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMQuadInit: BridgedDictionary { + private enum Keys { + static let p4: JSString = "p4" + static let p2: JSString = "p2" + static let p3: JSString = "p3" + static let p1: JSString = "p1" + } + public convenience init(p1: DOMPointInit, p2: DOMPointInit, p3: DOMPointInit, p4: DOMPointInit) { let object = JSObject.global.Object.function!.new() - object["p1"] = p1.jsValue() - object["p2"] = p2.jsValue() - object["p3"] = p3.jsValue() - object["p4"] = p4.jsValue() + object[Keys.p1] = p1.jsValue() + object[Keys.p2] = p2.jsValue() + object[Keys.p3] = p3.jsValue() + object[Keys.p4] = p4.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _p1 = ReadWriteAttribute(jsObject: object, name: "p1") - _p2 = ReadWriteAttribute(jsObject: object, name: "p2") - _p3 = ReadWriteAttribute(jsObject: object, name: "p3") - _p4 = ReadWriteAttribute(jsObject: object, name: "p4") + _p1 = ReadWriteAttribute(jsObject: object, name: Keys.p1) + _p2 = ReadWriteAttribute(jsObject: object, name: Keys.p2) + _p3 = ReadWriteAttribute(jsObject: object, name: Keys.p3) + _p4 = ReadWriteAttribute(jsObject: object, name: Keys.p4) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMRect.swift b/Sources/DOMKit/WebIDL/DOMRect.swift index 166997bd..4905a5ea 100644 --- a/Sources/DOMKit/WebIDL/DOMRect.swift +++ b/Sources/DOMKit/WebIDL/DOMRect.swift @@ -6,11 +6,19 @@ import JavaScriptKit public class DOMRect: DOMRectReadOnly { override public class var constructor: JSFunction { JSObject.global.DOMRect.function! } + private enum Keys { + static let width: JSString = "width" + static let x: JSString = "x" + static let height: JSString = "height" + static let fromRect: JSString = "fromRect" + static let y: JSString = "y" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadWriteAttribute(jsObject: jsObject, name: "x") - _y = ReadWriteAttribute(jsObject: jsObject, name: "y") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _x = ReadWriteAttribute(jsObject: jsObject, name: Keys.x) + _y = ReadWriteAttribute(jsObject: jsObject, name: Keys.y) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DOMRectInit.swift b/Sources/DOMKit/WebIDL/DOMRectInit.swift index bf141ef3..408c3ce7 100644 --- a/Sources/DOMKit/WebIDL/DOMRectInit.swift +++ b/Sources/DOMKit/WebIDL/DOMRectInit.swift @@ -4,20 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMRectInit: BridgedDictionary { + private enum Keys { + static let x: JSString = "x" + static let width: JSString = "width" + static let height: JSString = "height" + static let y: JSString = "y" + } + public convenience init(x: Double, y: Double, width: Double, height: Double) { let object = JSObject.global.Object.function!.new() - object["x"] = x.jsValue() - object["y"] = y.jsValue() - object["width"] = width.jsValue() - object["height"] = height.jsValue() + object[Keys.x] = x.jsValue() + object[Keys.y] = y.jsValue() + object[Keys.width] = width.jsValue() + object[Keys.height] = height.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: "x") - _y = ReadWriteAttribute(jsObject: object, name: "y") - _width = ReadWriteAttribute(jsObject: object, name: "width") - _height = ReadWriteAttribute(jsObject: object, name: "height") + _x = ReadWriteAttribute(jsObject: object, name: Keys.x) + _y = ReadWriteAttribute(jsObject: object, name: Keys.y) + _width = ReadWriteAttribute(jsObject: object, name: Keys.width) + _height = ReadWriteAttribute(jsObject: object, name: Keys.height) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMRectList.swift b/Sources/DOMKit/WebIDL/DOMRectList.swift index 5617ed6e..0422c58b 100644 --- a/Sources/DOMKit/WebIDL/DOMRectList.swift +++ b/Sources/DOMKit/WebIDL/DOMRectList.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class DOMRectList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMRectList.function! } + private enum Keys { + static let length: JSString = "length" + static let item: JSString = "item" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift index 493816e4..d7d4e9a6 100644 --- a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift @@ -6,17 +6,30 @@ import JavaScriptKit public class DOMRectReadOnly: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMRectReadOnly.function! } + private enum Keys { + static let width: JSString = "width" + static let fromRect: JSString = "fromRect" + static let x: JSString = "x" + static let y: JSString = "y" + static let left: JSString = "left" + static let height: JSString = "height" + static let right: JSString = "right" + static let bottom: JSString = "bottom" + static let top: JSString = "top" + static let toJSON: JSString = "toJSON" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: "x") - _y = ReadonlyAttribute(jsObject: jsObject, name: "y") - _width = ReadonlyAttribute(jsObject: jsObject, name: "width") - _height = ReadonlyAttribute(jsObject: jsObject, name: "height") - _top = ReadonlyAttribute(jsObject: jsObject, name: "top") - _right = ReadonlyAttribute(jsObject: jsObject, name: "right") - _bottom = ReadonlyAttribute(jsObject: jsObject, name: "bottom") - _left = ReadonlyAttribute(jsObject: jsObject, name: "left") + _x = ReadonlyAttribute(jsObject: jsObject, name: Keys.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Keys.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Keys.height) + _top = ReadonlyAttribute(jsObject: jsObject, name: Keys.top) + _right = ReadonlyAttribute(jsObject: jsObject, name: Keys.right) + _bottom = ReadonlyAttribute(jsObject: jsObject, name: Keys.bottom) + _left = ReadonlyAttribute(jsObject: jsObject, name: Keys.left) self.jsObject = jsObject } @@ -25,7 +38,7 @@ public class DOMRectReadOnly: JSBridgedClass { } public static func fromRect(other: DOMRectInit? = nil) -> Self { - constructor["fromRect"]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Keys.fromRect]!(other?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -53,6 +66,6 @@ public class DOMRectReadOnly: JSBridgedClass { public var left: Double public func toJSON() -> JSObject { - jsObject["toJSON"]!().fromJSValue()! + jsObject[Keys.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMStringList.swift b/Sources/DOMKit/WebIDL/DOMStringList.swift index 0625935d..1a94ac6d 100644 --- a/Sources/DOMKit/WebIDL/DOMStringList.swift +++ b/Sources/DOMKit/WebIDL/DOMStringList.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class DOMStringList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMStringList.function! } + private enum Keys { + static let length: JSString = "length" + static let contains: JSString = "contains" + static let item: JSString = "item" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } @@ -21,6 +27,6 @@ public class DOMStringList: JSBridgedClass { } public func contains(string: String) -> Bool { - jsObject["contains"]!(string.jsValue()).fromJSValue()! + jsObject[Keys.contains]!(string.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMStringMap.swift b/Sources/DOMKit/WebIDL/DOMStringMap.swift index c7f1ece3..4a32e5da 100644 --- a/Sources/DOMKit/WebIDL/DOMStringMap.swift +++ b/Sources/DOMKit/WebIDL/DOMStringMap.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class DOMStringMap: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMStringMap.function! } + private enum Keys {} + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/DOMTokenList.swift b/Sources/DOMKit/WebIDL/DOMTokenList.swift index cdc69371..342a1703 100644 --- a/Sources/DOMKit/WebIDL/DOMTokenList.swift +++ b/Sources/DOMKit/WebIDL/DOMTokenList.swift @@ -6,11 +6,23 @@ import JavaScriptKit public class DOMTokenList: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.DOMTokenList.function! } + private enum Keys { + static let toggle: JSString = "toggle" + static let supports: JSString = "supports" + static let add: JSString = "add" + static let value: JSString = "value" + static let remove: JSString = "remove" + static let replace: JSString = "replace" + static let item: JSString = "item" + static let length: JSString = "length" + static let contains: JSString = "contains" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) self.jsObject = jsObject } @@ -22,27 +34,27 @@ public class DOMTokenList: JSBridgedClass, Sequence { } public func contains(token: String) -> Bool { - jsObject["contains"]!(token.jsValue()).fromJSValue()! + jsObject[Keys.contains]!(token.jsValue()).fromJSValue()! } public func add(tokens: String...) { - _ = jsObject["add"]!(tokens.jsValue()) + _ = jsObject[Keys.add]!(tokens.jsValue()) } public func remove(tokens: String...) { - _ = jsObject["remove"]!(tokens.jsValue()) + _ = jsObject[Keys.remove]!(tokens.jsValue()) } public func toggle(token: String, force: Bool? = nil) -> Bool { - jsObject["toggle"]!(token.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.toggle]!(token.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! } public func replace(token: String, newToken: String) -> Bool { - jsObject["replace"]!(token.jsValue(), newToken.jsValue()).fromJSValue()! + jsObject[Keys.replace]!(token.jsValue(), newToken.jsValue()).fromJSValue()! } public func supports(token: String) -> Bool { - jsObject["supports"]!(token.jsValue()).fromJSValue()! + jsObject[Keys.supports]!(token.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift index 1ca53835..a9fa551f 100644 --- a/Sources/DOMKit/WebIDL/DataTransfer.swift +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -6,14 +6,26 @@ import JavaScriptKit public class DataTransfer: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DataTransfer.function! } + private enum Keys { + static let getData: JSString = "getData" + static let items: JSString = "items" + static let dropEffect: JSString = "dropEffect" + static let types: JSString = "types" + static let effectAllowed: JSString = "effectAllowed" + static let clearData: JSString = "clearData" + static let files: JSString = "files" + static let setDragImage: JSString = "setDragImage" + static let setData: JSString = "setData" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _dropEffect = ReadWriteAttribute(jsObject: jsObject, name: "dropEffect") - _effectAllowed = ReadWriteAttribute(jsObject: jsObject, name: "effectAllowed") - _items = ReadonlyAttribute(jsObject: jsObject, name: "items") - _types = ReadonlyAttribute(jsObject: jsObject, name: "types") - _files = ReadonlyAttribute(jsObject: jsObject, name: "files") + _dropEffect = ReadWriteAttribute(jsObject: jsObject, name: Keys.dropEffect) + _effectAllowed = ReadWriteAttribute(jsObject: jsObject, name: Keys.effectAllowed) + _items = ReadonlyAttribute(jsObject: jsObject, name: Keys.items) + _types = ReadonlyAttribute(jsObject: jsObject, name: Keys.types) + _files = ReadonlyAttribute(jsObject: jsObject, name: Keys.files) self.jsObject = jsObject } @@ -31,22 +43,22 @@ public class DataTransfer: JSBridgedClass { public var items: DataTransferItemList public func setDragImage(image: Element, x: Int32, y: Int32) { - _ = jsObject["setDragImage"]!(image.jsValue(), x.jsValue(), y.jsValue()) + _ = jsObject[Keys.setDragImage]!(image.jsValue(), x.jsValue(), y.jsValue()) } @ReadonlyAttribute public var types: [String] public func getData(format: String) -> String { - jsObject["getData"]!(format.jsValue()).fromJSValue()! + jsObject[Keys.getData]!(format.jsValue()).fromJSValue()! } public func setData(format: String, data: String) { - _ = jsObject["setData"]!(format.jsValue(), data.jsValue()) + _ = jsObject[Keys.setData]!(format.jsValue(), data.jsValue()) } public func clearData(format: String? = nil) { - _ = jsObject["clearData"]!(format?.jsValue() ?? .undefined) + _ = jsObject[Keys.clearData]!(format?.jsValue() ?? .undefined) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index b335d693..969a1957 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -6,11 +6,18 @@ import JavaScriptKit public class DataTransferItem: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DataTransferItem.function! } + private enum Keys { + static let getAsString: JSString = "getAsString" + static let type: JSString = "type" + static let kind: JSString = "kind" + static let getAsFile: JSString = "getAsFile" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _kind = ReadonlyAttribute(jsObject: jsObject, name: "kind") - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") + _kind = ReadonlyAttribute(jsObject: jsObject, name: Keys.kind) + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) self.jsObject = jsObject } @@ -23,6 +30,6 @@ public class DataTransferItem: JSBridgedClass { // XXX: member 'getAsString' is ignored public func getAsFile() -> File? { - jsObject["getAsFile"]!().fromJSValue()! + jsObject[Keys.getAsFile]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DataTransferItemList.swift b/Sources/DOMKit/WebIDL/DataTransferItemList.swift index b1afb8ed..df1a5cb2 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItemList.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItemList.swift @@ -6,10 +6,17 @@ import JavaScriptKit public class DataTransferItemList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DataTransferItemList.function! } + private enum Keys { + static let remove: JSString = "remove" + static let length: JSString = "length" + static let clear: JSString = "clear" + static let add: JSString = "add" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } @@ -21,18 +28,18 @@ public class DataTransferItemList: JSBridgedClass { } public func add(data: String, type: String) -> DataTransferItem? { - jsObject["add"]!(data.jsValue(), type.jsValue()).fromJSValue()! + jsObject[Keys.add]!(data.jsValue(), type.jsValue()).fromJSValue()! } public func add(data: File) -> DataTransferItem? { - jsObject["add"]!(data.jsValue()).fromJSValue()! + jsObject[Keys.add]!(data.jsValue()).fromJSValue()! } public func remove(index: UInt32) { - _ = jsObject["remove"]!(index.jsValue()) + _ = jsObject[Keys.remove]!(index.jsValue()) } public func clear() { - _ = jsObject["clear"]!() + _ = jsObject[Keys.clear]!() } } diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index 6c19c8ec..0ea34d94 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -6,10 +6,18 @@ import JavaScriptKit public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvider { override public class var constructor: JSFunction { JSObject.global.DedicatedWorkerGlobalScope.function! } + private enum Keys { + static let onmessage: JSString = "onmessage" + static let postMessage: JSString = "postMessage" + static let close: JSString = "close" + static let onmessageerror: JSString = "onmessageerror" + static let name: JSString = "name" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: "name") - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessageerror") + _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -17,15 +25,15 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid public var name: String public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject["postMessage"]!(message.jsValue(), transfer.jsValue()) + _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject["postMessage"]!(message.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 155fe5db..426fb6da 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -6,48 +6,125 @@ import JavaScriptKit public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { override public class var constructor: JSFunction { JSObject.global.Document.function! } + private enum Keys { + static let currentScript: JSString = "currentScript" + static let getElementsByTagName: JSString = "getElementsByTagName" + static let URL: JSString = "URL" + static let vlinkColor: JSString = "vlinkColor" + static let createAttributeNS: JSString = "createAttributeNS" + static let documentElement: JSString = "documentElement" + static let head: JSString = "head" + static let implementation: JSString = "implementation" + static let scripts: JSString = "scripts" + static let designMode: JSString = "designMode" + static let hidden: JSString = "hidden" + static let clear: JSString = "clear" + static let lastModified: JSString = "lastModified" + static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" + static let doctype: JSString = "doctype" + static let images: JSString = "images" + static let captureEvents: JSString = "captureEvents" + static let all: JSString = "all" + static let queryCommandValue: JSString = "queryCommandValue" + static let queryCommandEnabled: JSString = "queryCommandEnabled" + static let createElement: JSString = "createElement" + static let queryCommandIndeterm: JSString = "queryCommandIndeterm" + static let queryCommandState: JSString = "queryCommandState" + static let createTextNode: JSString = "createTextNode" + static let charset: JSString = "charset" + static let onreadystatechange: JSString = "onreadystatechange" + static let createElementNS: JSString = "createElementNS" + static let queryCommandSupported: JSString = "queryCommandSupported" + static let visibilityState: JSString = "visibilityState" + static let contentType: JSString = "contentType" + static let plugins: JSString = "plugins" + static let applets: JSString = "applets" + static let adoptNode: JSString = "adoptNode" + static let compatMode: JSString = "compatMode" + static let createComment: JSString = "createComment" + static let location: JSString = "location" + static let execCommand: JSString = "execCommand" + static let referrer: JSString = "referrer" + static let documentURI: JSString = "documentURI" + static let characterSet: JSString = "characterSet" + static let links: JSString = "links" + static let open: JSString = "open" + static let alinkColor: JSString = "alinkColor" + static let createNodeIterator: JSString = "createNodeIterator" + static let forms: JSString = "forms" + static let cookie: JSString = "cookie" + static let domain: JSString = "domain" + static let createDocumentFragment: JSString = "createDocumentFragment" + static let getElementsByClassName: JSString = "getElementsByClassName" + static let title: JSString = "title" + static let createProcessingInstruction: JSString = "createProcessingInstruction" + static let getElementsByName: JSString = "getElementsByName" + static let createRange: JSString = "createRange" + static let embeds: JSString = "embeds" + static let createAttribute: JSString = "createAttribute" + static let linkColor: JSString = "linkColor" + static let onvisibilitychange: JSString = "onvisibilitychange" + static let inputEncoding: JSString = "inputEncoding" + static let createEvent: JSString = "createEvent" + static let defaultView: JSString = "defaultView" + static let readyState: JSString = "readyState" + static let hasFocus: JSString = "hasFocus" + static let writeln: JSString = "writeln" + static let fgColor: JSString = "fgColor" + static let close: JSString = "close" + static let write: JSString = "write" + static let body: JSString = "body" + static let bgColor: JSString = "bgColor" + static let releaseEvents: JSString = "releaseEvents" + static let dir: JSString = "dir" + static let anchors: JSString = "anchors" + static let importNode: JSString = "importNode" + static let createCDATASection: JSString = "createCDATASection" + static let createTreeWalker: JSString = "createTreeWalker" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _implementation = ReadonlyAttribute(jsObject: jsObject, name: "implementation") - _URL = ReadonlyAttribute(jsObject: jsObject, name: "URL") - _documentURI = ReadonlyAttribute(jsObject: jsObject, name: "documentURI") - _compatMode = ReadonlyAttribute(jsObject: jsObject, name: "compatMode") - _characterSet = ReadonlyAttribute(jsObject: jsObject, name: "characterSet") - _charset = ReadonlyAttribute(jsObject: jsObject, name: "charset") - _inputEncoding = ReadonlyAttribute(jsObject: jsObject, name: "inputEncoding") - _contentType = ReadonlyAttribute(jsObject: jsObject, name: "contentType") - _doctype = ReadonlyAttribute(jsObject: jsObject, name: "doctype") - _documentElement = ReadonlyAttribute(jsObject: jsObject, name: "documentElement") - _location = ReadonlyAttribute(jsObject: jsObject, name: "location") - _domain = ReadWriteAttribute(jsObject: jsObject, name: "domain") - _referrer = ReadonlyAttribute(jsObject: jsObject, name: "referrer") - _cookie = ReadWriteAttribute(jsObject: jsObject, name: "cookie") - _lastModified = ReadonlyAttribute(jsObject: jsObject, name: "lastModified") - _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") - _title = ReadWriteAttribute(jsObject: jsObject, name: "title") - _dir = ReadWriteAttribute(jsObject: jsObject, name: "dir") - _body = ReadWriteAttribute(jsObject: jsObject, name: "body") - _head = ReadonlyAttribute(jsObject: jsObject, name: "head") - _images = ReadonlyAttribute(jsObject: jsObject, name: "images") - _embeds = ReadonlyAttribute(jsObject: jsObject, name: "embeds") - _plugins = ReadonlyAttribute(jsObject: jsObject, name: "plugins") - _links = ReadonlyAttribute(jsObject: jsObject, name: "links") - _forms = ReadonlyAttribute(jsObject: jsObject, name: "forms") - _scripts = ReadonlyAttribute(jsObject: jsObject, name: "scripts") - _currentScript = ReadonlyAttribute(jsObject: jsObject, name: "currentScript") - _defaultView = ReadonlyAttribute(jsObject: jsObject, name: "defaultView") - _designMode = ReadWriteAttribute(jsObject: jsObject, name: "designMode") - _hidden = ReadonlyAttribute(jsObject: jsObject, name: "hidden") - _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: "visibilityState") - _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onreadystatechange") - _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onvisibilitychange") - _fgColor = ReadWriteAttribute(jsObject: jsObject, name: "fgColor") - _linkColor = ReadWriteAttribute(jsObject: jsObject, name: "linkColor") - _vlinkColor = ReadWriteAttribute(jsObject: jsObject, name: "vlinkColor") - _alinkColor = ReadWriteAttribute(jsObject: jsObject, name: "alinkColor") - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") - _anchors = ReadonlyAttribute(jsObject: jsObject, name: "anchors") - _applets = ReadonlyAttribute(jsObject: jsObject, name: "applets") - _all = ReadonlyAttribute(jsObject: jsObject, name: "all") + _implementation = ReadonlyAttribute(jsObject: jsObject, name: Keys.implementation) + _URL = ReadonlyAttribute(jsObject: jsObject, name: Keys.URL) + _documentURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.documentURI) + _compatMode = ReadonlyAttribute(jsObject: jsObject, name: Keys.compatMode) + _characterSet = ReadonlyAttribute(jsObject: jsObject, name: Keys.characterSet) + _charset = ReadonlyAttribute(jsObject: jsObject, name: Keys.charset) + _inputEncoding = ReadonlyAttribute(jsObject: jsObject, name: Keys.inputEncoding) + _contentType = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentType) + _doctype = ReadonlyAttribute(jsObject: jsObject, name: Keys.doctype) + _documentElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.documentElement) + _location = ReadonlyAttribute(jsObject: jsObject, name: Keys.location) + _domain = ReadWriteAttribute(jsObject: jsObject, name: Keys.domain) + _referrer = ReadonlyAttribute(jsObject: jsObject, name: Keys.referrer) + _cookie = ReadWriteAttribute(jsObject: jsObject, name: Keys.cookie) + _lastModified = ReadonlyAttribute(jsObject: jsObject, name: Keys.lastModified) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) + _title = ReadWriteAttribute(jsObject: jsObject, name: Keys.title) + _dir = ReadWriteAttribute(jsObject: jsObject, name: Keys.dir) + _body = ReadWriteAttribute(jsObject: jsObject, name: Keys.body) + _head = ReadonlyAttribute(jsObject: jsObject, name: Keys.head) + _images = ReadonlyAttribute(jsObject: jsObject, name: Keys.images) + _embeds = ReadonlyAttribute(jsObject: jsObject, name: Keys.embeds) + _plugins = ReadonlyAttribute(jsObject: jsObject, name: Keys.plugins) + _links = ReadonlyAttribute(jsObject: jsObject, name: Keys.links) + _forms = ReadonlyAttribute(jsObject: jsObject, name: Keys.forms) + _scripts = ReadonlyAttribute(jsObject: jsObject, name: Keys.scripts) + _currentScript = ReadonlyAttribute(jsObject: jsObject, name: Keys.currentScript) + _defaultView = ReadonlyAttribute(jsObject: jsObject, name: Keys.defaultView) + _designMode = ReadWriteAttribute(jsObject: jsObject, name: Keys.designMode) + _hidden = ReadonlyAttribute(jsObject: jsObject, name: Keys.hidden) + _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Keys.visibilityState) + _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onreadystatechange) + _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onvisibilitychange) + _fgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.fgColor) + _linkColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.linkColor) + _vlinkColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.vlinkColor) + _alinkColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.alinkColor) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) + _anchors = ReadonlyAttribute(jsObject: jsObject, name: Keys.anchors) + _applets = ReadonlyAttribute(jsObject: jsObject, name: Keys.applets) + _all = ReadonlyAttribute(jsObject: jsObject, name: Keys.all) super.init(unsafelyWrapping: jsObject) } @@ -86,67 +163,67 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN public var documentElement: Element? public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { - jsObject["getElementsByTagName"]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Keys.getElementsByTagName]!(qualifiedName.jsValue()).fromJSValue()! } public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { - jsObject["getElementsByTagNameNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Keys.getElementsByTagNameNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func getElementsByClassName(classNames: String) -> HTMLCollection { - jsObject["getElementsByClassName"]!(classNames.jsValue()).fromJSValue()! + jsObject[Keys.getElementsByClassName]!(classNames.jsValue()).fromJSValue()! } public func createElement(localName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { - jsObject["createElement"]!(localName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.createElement]!(localName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func createElementNS(namespace: String?, qualifiedName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { - jsObject["createElementNS"]!(namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.createElementNS]!(namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func createDocumentFragment() -> DocumentFragment { - jsObject["createDocumentFragment"]!().fromJSValue()! + jsObject[Keys.createDocumentFragment]!().fromJSValue()! } public func createTextNode(data: String) -> Text { - jsObject["createTextNode"]!(data.jsValue()).fromJSValue()! + jsObject[Keys.createTextNode]!(data.jsValue()).fromJSValue()! } public func createCDATASection(data: String) -> CDATASection { - jsObject["createCDATASection"]!(data.jsValue()).fromJSValue()! + jsObject[Keys.createCDATASection]!(data.jsValue()).fromJSValue()! } public func createComment(data: String) -> Comment { - jsObject["createComment"]!(data.jsValue()).fromJSValue()! + jsObject[Keys.createComment]!(data.jsValue()).fromJSValue()! } public func createProcessingInstruction(target: String, data: String) -> ProcessingInstruction { - jsObject["createProcessingInstruction"]!(target.jsValue(), data.jsValue()).fromJSValue()! + jsObject[Keys.createProcessingInstruction]!(target.jsValue(), data.jsValue()).fromJSValue()! } public func importNode(node: Node, deep: Bool? = nil) -> Node { - jsObject["importNode"]!(node.jsValue(), deep?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.importNode]!(node.jsValue(), deep?.jsValue() ?? .undefined).fromJSValue()! } public func adoptNode(node: Node) -> Node { - jsObject["adoptNode"]!(node.jsValue()).fromJSValue()! + jsObject[Keys.adoptNode]!(node.jsValue()).fromJSValue()! } public func createAttribute(localName: String) -> Attr { - jsObject["createAttribute"]!(localName.jsValue()).fromJSValue()! + jsObject[Keys.createAttribute]!(localName.jsValue()).fromJSValue()! } public func createAttributeNS(namespace: String?, qualifiedName: String) -> Attr { - jsObject["createAttributeNS"]!(namespace.jsValue(), qualifiedName.jsValue()).fromJSValue()! + jsObject[Keys.createAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue()).fromJSValue()! } public func createEvent(interface: String) -> Event { - jsObject["createEvent"]!(interface.jsValue()).fromJSValue()! + jsObject[Keys.createEvent]!(interface.jsValue()).fromJSValue()! } public func createRange() -> Range { - jsObject["createRange"]!().fromJSValue()! + jsObject[Keys.createRange]!().fromJSValue()! } // XXX: member 'createNodeIterator' is ignored @@ -206,64 +283,64 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN public var scripts: HTMLCollection public func getElementsByName(elementName: String) -> NodeList { - jsObject["getElementsByName"]!(elementName.jsValue()).fromJSValue()! + jsObject[Keys.getElementsByName]!(elementName.jsValue()).fromJSValue()! } @ReadonlyAttribute public var currentScript: HTMLOrSVGScriptElement? public func open(unused1: String? = nil, unused2: String? = nil) -> Self { - jsObject["open"]!(unused1?.jsValue() ?? .undefined, unused2?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.open]!(unused1?.jsValue() ?? .undefined, unused2?.jsValue() ?? .undefined).fromJSValue()! } public func open(url: String, name: String, features: String) -> WindowProxy? { - jsObject["open"]!(url.jsValue(), name.jsValue(), features.jsValue()).fromJSValue()! + jsObject[Keys.open]!(url.jsValue(), name.jsValue(), features.jsValue()).fromJSValue()! } public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } public func write(text: String...) { - _ = jsObject["write"]!(text.jsValue()) + _ = jsObject[Keys.write]!(text.jsValue()) } public func writeln(text: String...) { - _ = jsObject["writeln"]!(text.jsValue()) + _ = jsObject[Keys.writeln]!(text.jsValue()) } @ReadonlyAttribute public var defaultView: WindowProxy? public func hasFocus() -> Bool { - jsObject["hasFocus"]!().fromJSValue()! + jsObject[Keys.hasFocus]!().fromJSValue()! } @ReadWriteAttribute public var designMode: String public func execCommand(commandId: String, showUI: Bool? = nil, value: String? = nil) -> Bool { - jsObject["execCommand"]!(commandId.jsValue(), showUI?.jsValue() ?? .undefined, value?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.execCommand]!(commandId.jsValue(), showUI?.jsValue() ?? .undefined, value?.jsValue() ?? .undefined).fromJSValue()! } public func queryCommandEnabled(commandId: String) -> Bool { - jsObject["queryCommandEnabled"]!(commandId.jsValue()).fromJSValue()! + jsObject[Keys.queryCommandEnabled]!(commandId.jsValue()).fromJSValue()! } public func queryCommandIndeterm(commandId: String) -> Bool { - jsObject["queryCommandIndeterm"]!(commandId.jsValue()).fromJSValue()! + jsObject[Keys.queryCommandIndeterm]!(commandId.jsValue()).fromJSValue()! } public func queryCommandState(commandId: String) -> Bool { - jsObject["queryCommandState"]!(commandId.jsValue()).fromJSValue()! + jsObject[Keys.queryCommandState]!(commandId.jsValue()).fromJSValue()! } public func queryCommandSupported(commandId: String) -> Bool { - jsObject["queryCommandSupported"]!(commandId.jsValue()).fromJSValue()! + jsObject[Keys.queryCommandSupported]!(commandId.jsValue()).fromJSValue()! } public func queryCommandValue(commandId: String) -> String { - jsObject["queryCommandValue"]!(commandId.jsValue()).fromJSValue()! + jsObject[Keys.queryCommandValue]!(commandId.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -300,15 +377,15 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN public var applets: HTMLCollection public func clear() { - _ = jsObject["clear"]!() + _ = jsObject[Keys.clear]!() } public func captureEvents() { - _ = jsObject["captureEvents"]!() + _ = jsObject[Keys.captureEvents]!() } public func releaseEvents() { - _ = jsObject["releaseEvents"]!() + _ = jsObject[Keys.releaseEvents]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift index 0b9fa5aa..c23d3829 100644 --- a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift @@ -3,20 +3,26 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let onpaste: JSString = "onpaste" + static let oncopy: JSString = "oncopy" + static let oncut: JSString = "oncut" +} + public protocol DocumentAndElementEventHandlers: JSBridgedClass {} public extension DocumentAndElementEventHandlers { var oncopy: EventHandler { - get { ClosureAttribute.Optional1["oncopy", in: jsObject] } - set { ClosureAttribute.Optional1["oncopy", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oncopy, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oncopy, in: jsObject] = newValue } } var oncut: EventHandler { - get { ClosureAttribute.Optional1["oncut", in: jsObject] } - set { ClosureAttribute.Optional1["oncut", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oncut, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oncut, in: jsObject] = newValue } } var onpaste: EventHandler { - get { ClosureAttribute.Optional1["onpaste", in: jsObject] } - set { ClosureAttribute.Optional1["onpaste", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onpaste, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onpaste, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/DocumentFragment.swift b/Sources/DOMKit/WebIDL/DocumentFragment.swift index 7091d224..aaa848c3 100644 --- a/Sources/DOMKit/WebIDL/DocumentFragment.swift +++ b/Sources/DOMKit/WebIDL/DocumentFragment.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class DocumentFragment: Node, NonElementParentNode, ParentNode { override public class var constructor: JSFunction { JSObject.global.DocumentFragment.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index e9d3fbb2..0d68aa09 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -3,14 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let activeElement: JSString = "activeElement" + static let adoptedStyleSheets: JSString = "adoptedStyleSheets" + static let styleSheets: JSString = "styleSheets" +} + public protocol DocumentOrShadowRoot: JSBridgedClass {} public extension DocumentOrShadowRoot { - var activeElement: Element? { ReadonlyAttribute["activeElement", in: jsObject] } + var activeElement: Element? { ReadonlyAttribute[Keys.activeElement, in: jsObject] } - var styleSheets: StyleSheetList { ReadonlyAttribute["styleSheets", in: jsObject] } + var styleSheets: StyleSheetList { ReadonlyAttribute[Keys.styleSheets, in: jsObject] } var adoptedStyleSheets: [CSSStyleSheet] { - get { ReadWriteAttribute["adoptedStyleSheets", in: jsObject] } - set { ReadWriteAttribute["adoptedStyleSheets", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.adoptedStyleSheets, in: jsObject] } + set { ReadWriteAttribute[Keys.adoptedStyleSheets, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/DocumentReadyState.swift b/Sources/DOMKit/WebIDL/DocumentReadyState.swift index 091c4983..79948fce 100644 --- a/Sources/DOMKit/WebIDL/DocumentReadyState.swift +++ b/Sources/DOMKit/WebIDL/DocumentReadyState.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum DocumentReadyState: String, JSValueCompatible { - case loading - case interactive - case complete +public enum DocumentReadyState: JSString, JSValueCompatible { + case loading = "loading" + case interactive = "interactive" + case complete = "complete" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/DocumentType.swift b/Sources/DOMKit/WebIDL/DocumentType.swift index eeb45672..ff4f964d 100644 --- a/Sources/DOMKit/WebIDL/DocumentType.swift +++ b/Sources/DOMKit/WebIDL/DocumentType.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class DocumentType: Node, ChildNode { override public class var constructor: JSFunction { JSObject.global.DocumentType.function! } + private enum Keys { + static let name: JSString = "name" + static let publicId: JSString = "publicId" + static let systemId: JSString = "systemId" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: "name") - _publicId = ReadonlyAttribute(jsObject: jsObject, name: "publicId") - _systemId = ReadonlyAttribute(jsObject: jsObject, name: "systemId") + _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) + _publicId = ReadonlyAttribute(jsObject: jsObject, name: Keys.publicId) + _systemId = ReadonlyAttribute(jsObject: jsObject, name: Keys.systemId) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift index 2f323f71..bad5b547 100644 --- a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift +++ b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum DocumentVisibilityState: String, JSValueCompatible { - case visible - case hidden +public enum DocumentVisibilityState: JSString, JSValueCompatible { + case visible = "visible" + case hidden = "hidden" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/DragEvent.swift b/Sources/DOMKit/WebIDL/DragEvent.swift index 84103a1b..f13b88e5 100644 --- a/Sources/DOMKit/WebIDL/DragEvent.swift +++ b/Sources/DOMKit/WebIDL/DragEvent.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class DragEvent: MouseEvent { override public class var constructor: JSFunction { JSObject.global.DragEvent.function! } + private enum Keys { + static let dataTransfer: JSString = "dataTransfer" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: "dataTransfer") + _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Keys.dataTransfer) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DragEventInit.swift b/Sources/DOMKit/WebIDL/DragEventInit.swift index 7c28187f..d31813e2 100644 --- a/Sources/DOMKit/WebIDL/DragEventInit.swift +++ b/Sources/DOMKit/WebIDL/DragEventInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class DragEventInit: BridgedDictionary { + private enum Keys { + static let dataTransfer: JSString = "dataTransfer" + } + public convenience init(dataTransfer: DataTransfer?) { let object = JSObject.global.Object.function!.new() - object["dataTransfer"] = dataTransfer.jsValue() + object[Keys.dataTransfer] = dataTransfer.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _dataTransfer = ReadWriteAttribute(jsObject: object, name: "dataTransfer") + _dataTransfer = ReadWriteAttribute(jsObject: object, name: Keys.dataTransfer) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index fa08334b..80cb710f 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -6,17 +6,55 @@ import JavaScriptKit public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin { override public class var constructor: JSFunction { JSObject.global.Element.function! } + private enum Keys { + static let getAttribute: JSString = "getAttribute" + static let removeAttributeNS: JSString = "removeAttributeNS" + static let getAttributeNode: JSString = "getAttributeNode" + static let hasAttribute: JSString = "hasAttribute" + static let setAttributeNodeNS: JSString = "setAttributeNodeNS" + static let removeAttributeNode: JSString = "removeAttributeNode" + static let hasAttributes: JSString = "hasAttributes" + static let toggleAttribute: JSString = "toggleAttribute" + static let webkitMatchesSelector: JSString = "webkitMatchesSelector" + static let getElementsByTagName: JSString = "getElementsByTagName" + static let tagName: JSString = "tagName" + static let classList: JSString = "classList" + static let getAttributeNames: JSString = "getAttributeNames" + static let hasAttributeNS: JSString = "hasAttributeNS" + static let getAttributeNodeNS: JSString = "getAttributeNodeNS" + static let insertAdjacentElement: JSString = "insertAdjacentElement" + static let namespaceURI: JSString = "namespaceURI" + static let setAttributeNode: JSString = "setAttributeNode" + static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" + static let getElementsByClassName: JSString = "getElementsByClassName" + static let setAttribute: JSString = "setAttribute" + static let matches: JSString = "matches" + static let insertAdjacentText: JSString = "insertAdjacentText" + static let setAttributeNS: JSString = "setAttributeNS" + static let removeAttribute: JSString = "removeAttribute" + static let closest: JSString = "closest" + static let prefix: JSString = "prefix" + static let attachShadow: JSString = "attachShadow" + static let className: JSString = "className" + static let shadowRoot: JSString = "shadowRoot" + static let attributes: JSString = "attributes" + static let slot: JSString = "slot" + static let id: JSString = "id" + static let getAttributeNS: JSString = "getAttributeNS" + static let localName: JSString = "localName" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: "namespaceURI") - _prefix = ReadonlyAttribute(jsObject: jsObject, name: "prefix") - _localName = ReadonlyAttribute(jsObject: jsObject, name: "localName") - _tagName = ReadonlyAttribute(jsObject: jsObject, name: "tagName") - _id = ReadWriteAttribute(jsObject: jsObject, name: "id") - _className = ReadWriteAttribute(jsObject: jsObject, name: "className") - _classList = ReadonlyAttribute(jsObject: jsObject, name: "classList") - _slot = ReadWriteAttribute(jsObject: jsObject, name: "slot") - _attributes = ReadonlyAttribute(jsObject: jsObject, name: "attributes") - _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: "shadowRoot") + _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.namespaceURI) + _prefix = ReadonlyAttribute(jsObject: jsObject, name: Keys.prefix) + _localName = ReadonlyAttribute(jsObject: jsObject, name: Keys.localName) + _tagName = ReadonlyAttribute(jsObject: jsObject, name: Keys.tagName) + _id = ReadWriteAttribute(jsObject: jsObject, name: Keys.id) + _className = ReadWriteAttribute(jsObject: jsObject, name: Keys.className) + _classList = ReadonlyAttribute(jsObject: jsObject, name: Keys.classList) + _slot = ReadWriteAttribute(jsObject: jsObject, name: Keys.slot) + _attributes = ReadonlyAttribute(jsObject: jsObject, name: Keys.attributes) + _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Keys.shadowRoot) super.init(unsafelyWrapping: jsObject) } @@ -45,108 +83,108 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo public var slot: String public func hasAttributes() -> Bool { - jsObject["hasAttributes"]!().fromJSValue()! + jsObject[Keys.hasAttributes]!().fromJSValue()! } @ReadonlyAttribute public var attributes: NamedNodeMap public func getAttributeNames() -> [String] { - jsObject["getAttributeNames"]!().fromJSValue()! + jsObject[Keys.getAttributeNames]!().fromJSValue()! } public func getAttribute(qualifiedName: String) -> String? { - jsObject["getAttribute"]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Keys.getAttribute]!(qualifiedName.jsValue()).fromJSValue()! } public func getAttributeNS(namespace: String?, localName: String) -> String? { - jsObject["getAttributeNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Keys.getAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func setAttribute(qualifiedName: String, value: String) { - _ = jsObject["setAttribute"]!(qualifiedName.jsValue(), value.jsValue()) + _ = jsObject[Keys.setAttribute]!(qualifiedName.jsValue(), value.jsValue()) } public func setAttributeNS(namespace: String?, qualifiedName: String, value: String) { - _ = jsObject["setAttributeNS"]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()) + _ = jsObject[Keys.setAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()) } public func removeAttribute(qualifiedName: String) { - _ = jsObject["removeAttribute"]!(qualifiedName.jsValue()) + _ = jsObject[Keys.removeAttribute]!(qualifiedName.jsValue()) } public func removeAttributeNS(namespace: String?, localName: String) { - _ = jsObject["removeAttributeNS"]!(namespace.jsValue(), localName.jsValue()) + _ = jsObject[Keys.removeAttributeNS]!(namespace.jsValue(), localName.jsValue()) } public func toggleAttribute(qualifiedName: String, force: Bool? = nil) -> Bool { - jsObject["toggleAttribute"]!(qualifiedName.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.toggleAttribute]!(qualifiedName.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! } public func hasAttribute(qualifiedName: String) -> Bool { - jsObject["hasAttribute"]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Keys.hasAttribute]!(qualifiedName.jsValue()).fromJSValue()! } public func hasAttributeNS(namespace: String?, localName: String) -> Bool { - jsObject["hasAttributeNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Keys.hasAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func getAttributeNode(qualifiedName: String) -> Attr? { - jsObject["getAttributeNode"]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Keys.getAttributeNode]!(qualifiedName.jsValue()).fromJSValue()! } public func getAttributeNodeNS(namespace: String?, localName: String) -> Attr? { - jsObject["getAttributeNodeNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Keys.getAttributeNodeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func setAttributeNode(attr: Attr) -> Attr? { - jsObject["setAttributeNode"]!(attr.jsValue()).fromJSValue()! + jsObject[Keys.setAttributeNode]!(attr.jsValue()).fromJSValue()! } public func setAttributeNodeNS(attr: Attr) -> Attr? { - jsObject["setAttributeNodeNS"]!(attr.jsValue()).fromJSValue()! + jsObject[Keys.setAttributeNodeNS]!(attr.jsValue()).fromJSValue()! } public func removeAttributeNode(attr: Attr) -> Attr { - jsObject["removeAttributeNode"]!(attr.jsValue()).fromJSValue()! + jsObject[Keys.removeAttributeNode]!(attr.jsValue()).fromJSValue()! } public func attachShadow(init: ShadowRootInit) -> ShadowRoot { - jsObject["attachShadow"]!(`init`.jsValue()).fromJSValue()! + jsObject[Keys.attachShadow]!(`init`.jsValue()).fromJSValue()! } @ReadonlyAttribute public var shadowRoot: ShadowRoot? public func closest(selectors: String) -> Element? { - jsObject["closest"]!(selectors.jsValue()).fromJSValue()! + jsObject[Keys.closest]!(selectors.jsValue()).fromJSValue()! } public func matches(selectors: String) -> Bool { - jsObject["matches"]!(selectors.jsValue()).fromJSValue()! + jsObject[Keys.matches]!(selectors.jsValue()).fromJSValue()! } public func webkitMatchesSelector(selectors: String) -> Bool { - jsObject["webkitMatchesSelector"]!(selectors.jsValue()).fromJSValue()! + jsObject[Keys.webkitMatchesSelector]!(selectors.jsValue()).fromJSValue()! } public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { - jsObject["getElementsByTagName"]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Keys.getElementsByTagName]!(qualifiedName.jsValue()).fromJSValue()! } public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { - jsObject["getElementsByTagNameNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Keys.getElementsByTagNameNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func getElementsByClassName(classNames: String) -> HTMLCollection { - jsObject["getElementsByClassName"]!(classNames.jsValue()).fromJSValue()! + jsObject[Keys.getElementsByClassName]!(classNames.jsValue()).fromJSValue()! } public func insertAdjacentElement(where: String, element: Element) -> Element? { - jsObject["insertAdjacentElement"]!(`where`.jsValue(), element.jsValue()).fromJSValue()! + jsObject[Keys.insertAdjacentElement]!(`where`.jsValue(), element.jsValue()).fromJSValue()! } public func insertAdjacentText(where: String, data: String) { - _ = jsObject["insertAdjacentText"]!(`where`.jsValue(), data.jsValue()) + _ = jsObject[Keys.insertAdjacentText]!(`where`.jsValue(), data.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift index 3697ab62..8a47d9e1 100644 --- a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift +++ b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift @@ -3,7 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let style: JSString = "style" +} + public protocol ElementCSSInlineStyle: JSBridgedClass {} public extension ElementCSSInlineStyle { - var style: CSSStyleDeclaration { ReadonlyAttribute["style", in: jsObject] } + var style: CSSStyleDeclaration { ReadonlyAttribute[Keys.style, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/ElementContentEditable.swift b/Sources/DOMKit/WebIDL/ElementContentEditable.swift index 833de77f..4c6d2db0 100644 --- a/Sources/DOMKit/WebIDL/ElementContentEditable.swift +++ b/Sources/DOMKit/WebIDL/ElementContentEditable.swift @@ -3,22 +3,29 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let enterKeyHint: JSString = "enterKeyHint" + static let isContentEditable: JSString = "isContentEditable" + static let contentEditable: JSString = "contentEditable" + static let inputMode: JSString = "inputMode" +} + public protocol ElementContentEditable: JSBridgedClass {} public extension ElementContentEditable { var contentEditable: String { - get { ReadWriteAttribute["contentEditable", in: jsObject] } - set { ReadWriteAttribute["contentEditable", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.contentEditable, in: jsObject] } + set { ReadWriteAttribute[Keys.contentEditable, in: jsObject] = newValue } } var enterKeyHint: String { - get { ReadWriteAttribute["enterKeyHint", in: jsObject] } - set { ReadWriteAttribute["enterKeyHint", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.enterKeyHint, in: jsObject] } + set { ReadWriteAttribute[Keys.enterKeyHint, in: jsObject] = newValue } } - var isContentEditable: Bool { ReadonlyAttribute["isContentEditable", in: jsObject] } + var isContentEditable: Bool { ReadonlyAttribute[Keys.isContentEditable, in: jsObject] } var inputMode: String { - get { ReadWriteAttribute["inputMode", in: jsObject] } - set { ReadWriteAttribute["inputMode", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.inputMode, in: jsObject] } + set { ReadWriteAttribute[Keys.inputMode, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift index 5ee018b7..667f0582 100644 --- a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class ElementCreationOptions: BridgedDictionary { + private enum Keys { + static let `is`: JSString = "is" + } + public convenience init(is: String) { let object = JSObject.global.Object.function!.new() - object["is"] = `is`.jsValue() + object[Keys.is] = `is`.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _is = ReadWriteAttribute(jsObject: object, name: "is") + _is = ReadWriteAttribute(jsObject: object, name: Keys.is) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift index 0e5a7431..9d82589c 100644 --- a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class ElementDefinitionOptions: BridgedDictionary { + private enum Keys { + static let extends: JSString = "extends" + } + public convenience init(extends: String) { let object = JSObject.global.Object.function!.new() - object["extends"] = extends.jsValue() + object[Keys.extends] = extends.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _extends = ReadWriteAttribute(jsObject: object, name: "extends") + _extends = ReadWriteAttribute(jsObject: object, name: Keys.extends) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index a61b8542..15d67bfe 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -6,15 +6,28 @@ import JavaScriptKit public class ElementInternals: JSBridgedClass, ARIAMixin { public class var constructor: JSFunction { JSObject.global.ElementInternals.function! } + private enum Keys { + static let setValidity: JSString = "setValidity" + static let setFormValue: JSString = "setFormValue" + static let form: JSString = "form" + static let validity: JSString = "validity" + static let willValidate: JSString = "willValidate" + static let validationMessage: JSString = "validationMessage" + static let shadowRoot: JSString = "shadowRoot" + static let checkValidity: JSString = "checkValidity" + static let reportValidity: JSString = "reportValidity" + static let labels: JSString = "labels" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: "shadowRoot") - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") - _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") - _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Keys.shadowRoot) + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) self.jsObject = jsObject } @@ -22,14 +35,14 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public var shadowRoot: ShadowRoot? public func setFormValue(value: __UNSUPPORTED_UNION__?, state: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject["setFormValue"]!(value.jsValue(), state?.jsValue() ?? .undefined) + _ = jsObject[Keys.setFormValue]!(value.jsValue(), state?.jsValue() ?? .undefined) } @ReadonlyAttribute public var form: HTMLFormElement? public func setValidity(flags: ValidityStateFlags? = nil, message: String? = nil, anchor: HTMLElement? = nil) { - _ = jsObject["setValidity"]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined) + _ = jsObject[Keys.setValidity]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined) } @ReadonlyAttribute @@ -42,11 +55,11 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public var validationMessage: String public func checkValidity() -> Bool { - jsObject["checkValidity"]!().fromJSValue()! + jsObject[Keys.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject["reportValidity"]!().fromJSValue()! + jsObject[Keys.reportValidity]!().fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EndingType.swift b/Sources/DOMKit/WebIDL/EndingType.swift index e59a7878..2681f937 100644 --- a/Sources/DOMKit/WebIDL/EndingType.swift +++ b/Sources/DOMKit/WebIDL/EndingType.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum EndingType: String, JSValueCompatible { - case transparent - case native +public enum EndingType: JSString, JSValueCompatible { + case transparent = "transparent" + case native = "native" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ErrorEvent.swift b/Sources/DOMKit/WebIDL/ErrorEvent.swift index 99a4850a..b6990dcd 100644 --- a/Sources/DOMKit/WebIDL/ErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/ErrorEvent.swift @@ -6,12 +6,20 @@ import JavaScriptKit public class ErrorEvent: Event { override public class var constructor: JSFunction { JSObject.global.ErrorEvent.function! } + private enum Keys { + static let message: JSString = "message" + static let error: JSString = "error" + static let lineno: JSString = "lineno" + static let filename: JSString = "filename" + static let colno: JSString = "colno" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _message = ReadonlyAttribute(jsObject: jsObject, name: "message") - _filename = ReadonlyAttribute(jsObject: jsObject, name: "filename") - _lineno = ReadonlyAttribute(jsObject: jsObject, name: "lineno") - _colno = ReadonlyAttribute(jsObject: jsObject, name: "colno") - _error = ReadonlyAttribute(jsObject: jsObject, name: "error") + _message = ReadonlyAttribute(jsObject: jsObject, name: Keys.message) + _filename = ReadonlyAttribute(jsObject: jsObject, name: Keys.filename) + _lineno = ReadonlyAttribute(jsObject: jsObject, name: Keys.lineno) + _colno = ReadonlyAttribute(jsObject: jsObject, name: Keys.colno) + _error = ReadonlyAttribute(jsObject: jsObject, name: Keys.error) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/ErrorEventInit.swift b/Sources/DOMKit/WebIDL/ErrorEventInit.swift index b1283c4a..93d56c76 100644 --- a/Sources/DOMKit/WebIDL/ErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/ErrorEventInit.swift @@ -4,22 +4,30 @@ import JavaScriptEventLoop import JavaScriptKit public class ErrorEventInit: BridgedDictionary { + private enum Keys { + static let message: JSString = "message" + static let lineno: JSString = "lineno" + static let colno: JSString = "colno" + static let filename: JSString = "filename" + static let error: JSString = "error" + } + public convenience init(message: String, filename: String, lineno: UInt32, colno: UInt32, error: JSValue) { let object = JSObject.global.Object.function!.new() - object["message"] = message.jsValue() - object["filename"] = filename.jsValue() - object["lineno"] = lineno.jsValue() - object["colno"] = colno.jsValue() - object["error"] = error.jsValue() + object[Keys.message] = message.jsValue() + object[Keys.filename] = filename.jsValue() + object[Keys.lineno] = lineno.jsValue() + object[Keys.colno] = colno.jsValue() + object[Keys.error] = error.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _message = ReadWriteAttribute(jsObject: object, name: "message") - _filename = ReadWriteAttribute(jsObject: object, name: "filename") - _lineno = ReadWriteAttribute(jsObject: object, name: "lineno") - _colno = ReadWriteAttribute(jsObject: object, name: "colno") - _error = ReadWriteAttribute(jsObject: object, name: "error") + _message = ReadWriteAttribute(jsObject: object, name: Keys.message) + _filename = ReadWriteAttribute(jsObject: object, name: Keys.filename) + _lineno = ReadWriteAttribute(jsObject: object, name: Keys.lineno) + _colno = ReadWriteAttribute(jsObject: object, name: Keys.colno) + _error = ReadWriteAttribute(jsObject: object, name: Keys.error) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index a317ecb4..1c45ea3e 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -6,22 +6,47 @@ import JavaScriptKit public class Event: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Event.function! } + private enum Keys { + static let type: JSString = "type" + static let currentTarget: JSString = "currentTarget" + static let composedPath: JSString = "composedPath" + static let stopImmediatePropagation: JSString = "stopImmediatePropagation" + static let preventDefault: JSString = "preventDefault" + static let NONE: JSString = "NONE" + static let defaultPrevented: JSString = "defaultPrevented" + static let composed: JSString = "composed" + static let CAPTURING_PHASE: JSString = "CAPTURING_PHASE" + static let timeStamp: JSString = "timeStamp" + static let returnValue: JSString = "returnValue" + static let eventPhase: JSString = "eventPhase" + static let bubbles: JSString = "bubbles" + static let AT_TARGET: JSString = "AT_TARGET" + static let srcElement: JSString = "srcElement" + static let stopPropagation: JSString = "stopPropagation" + static let target: JSString = "target" + static let BUBBLING_PHASE: JSString = "BUBBLING_PHASE" + static let cancelBubble: JSString = "cancelBubble" + static let cancelable: JSString = "cancelable" + static let initEvent: JSString = "initEvent" + static let isTrusted: JSString = "isTrusted" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") - _target = ReadonlyAttribute(jsObject: jsObject, name: "target") - _srcElement = ReadonlyAttribute(jsObject: jsObject, name: "srcElement") - _currentTarget = ReadonlyAttribute(jsObject: jsObject, name: "currentTarget") - _eventPhase = ReadonlyAttribute(jsObject: jsObject, name: "eventPhase") - _cancelBubble = ReadWriteAttribute(jsObject: jsObject, name: "cancelBubble") - _bubbles = ReadonlyAttribute(jsObject: jsObject, name: "bubbles") - _cancelable = ReadonlyAttribute(jsObject: jsObject, name: "cancelable") - _returnValue = ReadWriteAttribute(jsObject: jsObject, name: "returnValue") - _defaultPrevented = ReadonlyAttribute(jsObject: jsObject, name: "defaultPrevented") - _composed = ReadonlyAttribute(jsObject: jsObject, name: "composed") - _isTrusted = ReadonlyAttribute(jsObject: jsObject, name: "isTrusted") - _timeStamp = ReadonlyAttribute(jsObject: jsObject, name: "timeStamp") + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _target = ReadonlyAttribute(jsObject: jsObject, name: Keys.target) + _srcElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.srcElement) + _currentTarget = ReadonlyAttribute(jsObject: jsObject, name: Keys.currentTarget) + _eventPhase = ReadonlyAttribute(jsObject: jsObject, name: Keys.eventPhase) + _cancelBubble = ReadWriteAttribute(jsObject: jsObject, name: Keys.cancelBubble) + _bubbles = ReadonlyAttribute(jsObject: jsObject, name: Keys.bubbles) + _cancelable = ReadonlyAttribute(jsObject: jsObject, name: Keys.cancelable) + _returnValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.returnValue) + _defaultPrevented = ReadonlyAttribute(jsObject: jsObject, name: Keys.defaultPrevented) + _composed = ReadonlyAttribute(jsObject: jsObject, name: Keys.composed) + _isTrusted = ReadonlyAttribute(jsObject: jsObject, name: Keys.isTrusted) + _timeStamp = ReadonlyAttribute(jsObject: jsObject, name: Keys.timeStamp) self.jsObject = jsObject } @@ -42,7 +67,7 @@ public class Event: JSBridgedClass { public var currentTarget: EventTarget? public func composedPath() -> [EventTarget] { - jsObject["composedPath"]!().fromJSValue()! + jsObject[Keys.composedPath]!().fromJSValue()! } public static let NONE: UInt16 = 0 @@ -57,14 +82,14 @@ public class Event: JSBridgedClass { public var eventPhase: UInt16 public func stopPropagation() { - _ = jsObject["stopPropagation"]!() + _ = jsObject[Keys.stopPropagation]!() } @ReadWriteAttribute public var cancelBubble: Bool public func stopImmediatePropagation() { - _ = jsObject["stopImmediatePropagation"]!() + _ = jsObject[Keys.stopImmediatePropagation]!() } @ReadonlyAttribute @@ -77,7 +102,7 @@ public class Event: JSBridgedClass { public var returnValue: Bool public func preventDefault() { - _ = jsObject["preventDefault"]!() + _ = jsObject[Keys.preventDefault]!() } @ReadonlyAttribute @@ -93,6 +118,6 @@ public class Event: JSBridgedClass { public var timeStamp: DOMHighResTimeStamp public func initEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil) { - _ = jsObject["initEvent"]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined) + _ = jsObject[Keys.initEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/EventInit.swift b/Sources/DOMKit/WebIDL/EventInit.swift index a85bad89..87448979 100644 --- a/Sources/DOMKit/WebIDL/EventInit.swift +++ b/Sources/DOMKit/WebIDL/EventInit.swift @@ -4,18 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class EventInit: BridgedDictionary { + private enum Keys { + static let bubbles: JSString = "bubbles" + static let cancelable: JSString = "cancelable" + static let composed: JSString = "composed" + } + public convenience init(bubbles: Bool, cancelable: Bool, composed: Bool) { let object = JSObject.global.Object.function!.new() - object["bubbles"] = bubbles.jsValue() - object["cancelable"] = cancelable.jsValue() - object["composed"] = composed.jsValue() + object[Keys.bubbles] = bubbles.jsValue() + object[Keys.cancelable] = cancelable.jsValue() + object[Keys.composed] = composed.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _bubbles = ReadWriteAttribute(jsObject: object, name: "bubbles") - _cancelable = ReadWriteAttribute(jsObject: object, name: "cancelable") - _composed = ReadWriteAttribute(jsObject: object, name: "composed") + _bubbles = ReadWriteAttribute(jsObject: object, name: Keys.bubbles) + _cancelable = ReadWriteAttribute(jsObject: object, name: Keys.cancelable) + _composed = ReadWriteAttribute(jsObject: object, name: Keys.composed) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventListenerOptions.swift b/Sources/DOMKit/WebIDL/EventListenerOptions.swift index 6edec737..c2973782 100644 --- a/Sources/DOMKit/WebIDL/EventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/EventListenerOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class EventListenerOptions: BridgedDictionary { + private enum Keys { + static let capture: JSString = "capture" + } + public convenience init(capture: Bool) { let object = JSObject.global.Object.function!.new() - object["capture"] = capture.jsValue() + object[Keys.capture] = capture.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _capture = ReadWriteAttribute(jsObject: object, name: "capture") + _capture = ReadWriteAttribute(jsObject: object, name: Keys.capture) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventModifierInit.swift b/Sources/DOMKit/WebIDL/EventModifierInit.swift index 01a53e06..f1aafba3 100644 --- a/Sources/DOMKit/WebIDL/EventModifierInit.swift +++ b/Sources/DOMKit/WebIDL/EventModifierInit.swift @@ -4,40 +4,57 @@ import JavaScriptEventLoop import JavaScriptKit public class EventModifierInit: BridgedDictionary { + private enum Keys { + static let modifierFnLock: JSString = "modifierFnLock" + static let modifierNumLock: JSString = "modifierNumLock" + static let shiftKey: JSString = "shiftKey" + static let metaKey: JSString = "metaKey" + static let modifierFn: JSString = "modifierFn" + static let modifierSymbol: JSString = "modifierSymbol" + static let ctrlKey: JSString = "ctrlKey" + static let altKey: JSString = "altKey" + static let modifierAltGraph: JSString = "modifierAltGraph" + static let modifierHyper: JSString = "modifierHyper" + static let modifierCapsLock: JSString = "modifierCapsLock" + static let modifierSymbolLock: JSString = "modifierSymbolLock" + static let modifierScrollLock: JSString = "modifierScrollLock" + static let modifierSuper: JSString = "modifierSuper" + } + public convenience init(ctrlKey: Bool, shiftKey: Bool, altKey: Bool, metaKey: Bool, modifierAltGraph: Bool, modifierCapsLock: Bool, modifierFn: Bool, modifierFnLock: Bool, modifierHyper: Bool, modifierNumLock: Bool, modifierScrollLock: Bool, modifierSuper: Bool, modifierSymbol: Bool, modifierSymbolLock: Bool) { let object = JSObject.global.Object.function!.new() - object["ctrlKey"] = ctrlKey.jsValue() - object["shiftKey"] = shiftKey.jsValue() - object["altKey"] = altKey.jsValue() - object["metaKey"] = metaKey.jsValue() - object["modifierAltGraph"] = modifierAltGraph.jsValue() - object["modifierCapsLock"] = modifierCapsLock.jsValue() - object["modifierFn"] = modifierFn.jsValue() - object["modifierFnLock"] = modifierFnLock.jsValue() - object["modifierHyper"] = modifierHyper.jsValue() - object["modifierNumLock"] = modifierNumLock.jsValue() - object["modifierScrollLock"] = modifierScrollLock.jsValue() - object["modifierSuper"] = modifierSuper.jsValue() - object["modifierSymbol"] = modifierSymbol.jsValue() - object["modifierSymbolLock"] = modifierSymbolLock.jsValue() + object[Keys.ctrlKey] = ctrlKey.jsValue() + object[Keys.shiftKey] = shiftKey.jsValue() + object[Keys.altKey] = altKey.jsValue() + object[Keys.metaKey] = metaKey.jsValue() + object[Keys.modifierAltGraph] = modifierAltGraph.jsValue() + object[Keys.modifierCapsLock] = modifierCapsLock.jsValue() + object[Keys.modifierFn] = modifierFn.jsValue() + object[Keys.modifierFnLock] = modifierFnLock.jsValue() + object[Keys.modifierHyper] = modifierHyper.jsValue() + object[Keys.modifierNumLock] = modifierNumLock.jsValue() + object[Keys.modifierScrollLock] = modifierScrollLock.jsValue() + object[Keys.modifierSuper] = modifierSuper.jsValue() + object[Keys.modifierSymbol] = modifierSymbol.jsValue() + object[Keys.modifierSymbolLock] = modifierSymbolLock.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _ctrlKey = ReadWriteAttribute(jsObject: object, name: "ctrlKey") - _shiftKey = ReadWriteAttribute(jsObject: object, name: "shiftKey") - _altKey = ReadWriteAttribute(jsObject: object, name: "altKey") - _metaKey = ReadWriteAttribute(jsObject: object, name: "metaKey") - _modifierAltGraph = ReadWriteAttribute(jsObject: object, name: "modifierAltGraph") - _modifierCapsLock = ReadWriteAttribute(jsObject: object, name: "modifierCapsLock") - _modifierFn = ReadWriteAttribute(jsObject: object, name: "modifierFn") - _modifierFnLock = ReadWriteAttribute(jsObject: object, name: "modifierFnLock") - _modifierHyper = ReadWriteAttribute(jsObject: object, name: "modifierHyper") - _modifierNumLock = ReadWriteAttribute(jsObject: object, name: "modifierNumLock") - _modifierScrollLock = ReadWriteAttribute(jsObject: object, name: "modifierScrollLock") - _modifierSuper = ReadWriteAttribute(jsObject: object, name: "modifierSuper") - _modifierSymbol = ReadWriteAttribute(jsObject: object, name: "modifierSymbol") - _modifierSymbolLock = ReadWriteAttribute(jsObject: object, name: "modifierSymbolLock") + _ctrlKey = ReadWriteAttribute(jsObject: object, name: Keys.ctrlKey) + _shiftKey = ReadWriteAttribute(jsObject: object, name: Keys.shiftKey) + _altKey = ReadWriteAttribute(jsObject: object, name: Keys.altKey) + _metaKey = ReadWriteAttribute(jsObject: object, name: Keys.metaKey) + _modifierAltGraph = ReadWriteAttribute(jsObject: object, name: Keys.modifierAltGraph) + _modifierCapsLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierCapsLock) + _modifierFn = ReadWriteAttribute(jsObject: object, name: Keys.modifierFn) + _modifierFnLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierFnLock) + _modifierHyper = ReadWriteAttribute(jsObject: object, name: Keys.modifierHyper) + _modifierNumLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierNumLock) + _modifierScrollLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierScrollLock) + _modifierSuper = ReadWriteAttribute(jsObject: object, name: Keys.modifierSuper) + _modifierSymbol = ReadWriteAttribute(jsObject: object, name: Keys.modifierSymbol) + _modifierSymbolLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierSymbolLock) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index b3f40489..2b25c647 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -6,13 +6,26 @@ import JavaScriptKit public class EventSource: EventTarget { override public class var constructor: JSFunction { JSObject.global.EventSource.function! } + private enum Keys { + static let onerror: JSString = "onerror" + static let close: JSString = "close" + static let OPEN: JSString = "OPEN" + static let readyState: JSString = "readyState" + static let withCredentials: JSString = "withCredentials" + static let CLOSED: JSString = "CLOSED" + static let onmessage: JSString = "onmessage" + static let url: JSString = "url" + static let CONNECTING: JSString = "CONNECTING" + static let onopen: JSString = "onopen" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _url = ReadonlyAttribute(jsObject: jsObject, name: "url") - _withCredentials = ReadonlyAttribute(jsObject: jsObject, name: "withCredentials") - _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") - _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: "onopen") - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onerror") + _url = ReadonlyAttribute(jsObject: jsObject, name: Keys.url) + _withCredentials = ReadonlyAttribute(jsObject: jsObject, name: Keys.withCredentials) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) + _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onopen) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onerror) super.init(unsafelyWrapping: jsObject) } @@ -45,6 +58,6 @@ public class EventSource: EventTarget { public var onerror: EventHandler public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } } diff --git a/Sources/DOMKit/WebIDL/EventSourceInit.swift b/Sources/DOMKit/WebIDL/EventSourceInit.swift index f3f2bf7f..d0109b69 100644 --- a/Sources/DOMKit/WebIDL/EventSourceInit.swift +++ b/Sources/DOMKit/WebIDL/EventSourceInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class EventSourceInit: BridgedDictionary { + private enum Keys { + static let withCredentials: JSString = "withCredentials" + } + public convenience init(withCredentials: Bool) { let object = JSObject.global.Object.function!.new() - object["withCredentials"] = withCredentials.jsValue() + object[Keys.withCredentials] = withCredentials.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _withCredentials = ReadWriteAttribute(jsObject: object, name: "withCredentials") + _withCredentials = ReadWriteAttribute(jsObject: object, name: Keys.withCredentials) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventTarget.swift b/Sources/DOMKit/WebIDL/EventTarget.swift index 6ade4fa1..7ebd6414 100644 --- a/Sources/DOMKit/WebIDL/EventTarget.swift +++ b/Sources/DOMKit/WebIDL/EventTarget.swift @@ -6,6 +6,12 @@ import JavaScriptKit public class EventTarget: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.EventTarget.function! } + private enum Keys { + static let addEventListener: JSString = "addEventListener" + static let removeEventListener: JSString = "removeEventListener" + static let dispatchEvent: JSString = "dispatchEvent" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -21,6 +27,6 @@ public class EventTarget: JSBridgedClass { // XXX: member 'removeEventListener' is ignored public func dispatchEvent(event: Event) -> Bool { - jsObject["dispatchEvent"]!(event.jsValue()).fromJSValue()! + jsObject[Keys.dispatchEvent]!(event.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/External.swift b/Sources/DOMKit/WebIDL/External.swift index 1da9e24e..0cd7fd57 100644 --- a/Sources/DOMKit/WebIDL/External.swift +++ b/Sources/DOMKit/WebIDL/External.swift @@ -6,6 +6,11 @@ import JavaScriptKit public class External: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.External.function! } + private enum Keys { + static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" + static let AddSearchProvider: JSString = "AddSearchProvider" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -13,10 +18,10 @@ public class External: JSBridgedClass { } public func AddSearchProvider() { - _ = jsObject["AddSearchProvider"]!() + _ = jsObject[Keys.AddSearchProvider]!() } public func IsSearchProviderInstalled() { - _ = jsObject["IsSearchProviderInstalled"]!() + _ = jsObject[Keys.IsSearchProviderInstalled]!() } } diff --git a/Sources/DOMKit/WebIDL/File.swift b/Sources/DOMKit/WebIDL/File.swift index 09538ca1..cfb5a1ba 100644 --- a/Sources/DOMKit/WebIDL/File.swift +++ b/Sources/DOMKit/WebIDL/File.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class File: Blob { override public class var constructor: JSFunction { JSObject.global.File.function! } + private enum Keys { + static let lastModified: JSString = "lastModified" + static let name: JSString = "name" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: "name") - _lastModified = ReadonlyAttribute(jsObject: jsObject, name: "lastModified") + _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) + _lastModified = ReadonlyAttribute(jsObject: jsObject, name: Keys.lastModified) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/FileList.swift b/Sources/DOMKit/WebIDL/FileList.swift index d03e5121..bfe0837c 100644 --- a/Sources/DOMKit/WebIDL/FileList.swift +++ b/Sources/DOMKit/WebIDL/FileList.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class FileList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.FileList.function! } + private enum Keys { + static let item: JSString = "item" + static let length: JSString = "length" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/FilePropertyBag.swift b/Sources/DOMKit/WebIDL/FilePropertyBag.swift index d0fa3042..04d02567 100644 --- a/Sources/DOMKit/WebIDL/FilePropertyBag.swift +++ b/Sources/DOMKit/WebIDL/FilePropertyBag.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class FilePropertyBag: BridgedDictionary { + private enum Keys { + static let lastModified: JSString = "lastModified" + } + public convenience init(lastModified: Int64) { let object = JSObject.global.Object.function!.new() - object["lastModified"] = lastModified.jsValue() + object[Keys.lastModified] = lastModified.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _lastModified = ReadWriteAttribute(jsObject: object, name: "lastModified") + _lastModified = ReadWriteAttribute(jsObject: object, name: Keys.lastModified) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index 5f522721..e958a9ab 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -6,16 +6,36 @@ import JavaScriptKit public class FileReader: EventTarget { override public class var constructor: JSFunction { JSObject.global.FileReader.function! } + private enum Keys { + static let onerror: JSString = "onerror" + static let onloadend: JSString = "onloadend" + static let DONE: JSString = "DONE" + static let onload: JSString = "onload" + static let EMPTY: JSString = "EMPTY" + static let readAsDataURL: JSString = "readAsDataURL" + static let onloadstart: JSString = "onloadstart" + static let readyState: JSString = "readyState" + static let onprogress: JSString = "onprogress" + static let readAsArrayBuffer: JSString = "readAsArrayBuffer" + static let onabort: JSString = "onabort" + static let result: JSString = "result" + static let error: JSString = "error" + static let readAsBinaryString: JSString = "readAsBinaryString" + static let abort: JSString = "abort" + static let readAsText: JSString = "readAsText" + static let LOADING: JSString = "LOADING" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") - _result = ReadonlyAttribute(jsObject: jsObject, name: "result") - _error = ReadonlyAttribute(jsObject: jsObject, name: "error") - _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: "onloadstart") - _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: "onprogress") - _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: "onload") - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: "onabort") - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onerror") - _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: "onloadend") + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) + _result = ReadonlyAttribute(jsObject: jsObject, name: Keys.result) + _error = ReadonlyAttribute(jsObject: jsObject, name: Keys.error) + _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onloadstart) + _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onprogress) + _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onload) + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onabort) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onerror) + _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onloadend) super.init(unsafelyWrapping: jsObject) } @@ -24,23 +44,23 @@ public class FileReader: EventTarget { } public func readAsArrayBuffer(blob: Blob) { - _ = jsObject["readAsArrayBuffer"]!(blob.jsValue()) + _ = jsObject[Keys.readAsArrayBuffer]!(blob.jsValue()) } public func readAsBinaryString(blob: Blob) { - _ = jsObject["readAsBinaryString"]!(blob.jsValue()) + _ = jsObject[Keys.readAsBinaryString]!(blob.jsValue()) } public func readAsText(blob: Blob, encoding: String? = nil) { - _ = jsObject["readAsText"]!(blob.jsValue(), encoding?.jsValue() ?? .undefined) + _ = jsObject[Keys.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined) } public func readAsDataURL(blob: Blob) { - _ = jsObject["readAsDataURL"]!(blob.jsValue()) + _ = jsObject[Keys.readAsDataURL]!(blob.jsValue()) } public func abort() { - _ = jsObject["abort"]!() + _ = jsObject[Keys.abort]!() } public static let EMPTY: UInt16 = 0 diff --git a/Sources/DOMKit/WebIDL/FileReaderSync.swift b/Sources/DOMKit/WebIDL/FileReaderSync.swift index 90cc03e5..f3f69430 100644 --- a/Sources/DOMKit/WebIDL/FileReaderSync.swift +++ b/Sources/DOMKit/WebIDL/FileReaderSync.swift @@ -6,6 +6,13 @@ import JavaScriptKit public class FileReaderSync: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.FileReaderSync.function! } + private enum Keys { + static let readAsText: JSString = "readAsText" + static let readAsBinaryString: JSString = "readAsBinaryString" + static let readAsArrayBuffer: JSString = "readAsArrayBuffer" + static let readAsDataURL: JSString = "readAsDataURL" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,18 +24,18 @@ public class FileReaderSync: JSBridgedClass { } public func readAsArrayBuffer(blob: Blob) -> ArrayBuffer { - jsObject["readAsArrayBuffer"]!(blob.jsValue()).fromJSValue()! + jsObject[Keys.readAsArrayBuffer]!(blob.jsValue()).fromJSValue()! } public func readAsBinaryString(blob: Blob) -> String { - jsObject["readAsBinaryString"]!(blob.jsValue()).fromJSValue()! + jsObject[Keys.readAsBinaryString]!(blob.jsValue()).fromJSValue()! } public func readAsText(blob: Blob, encoding: String? = nil) -> String { - jsObject["readAsText"]!(blob.jsValue(), encoding?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined).fromJSValue()! } public func readAsDataURL(blob: Blob) -> String { - jsObject["readAsDataURL"]!(blob.jsValue()).fromJSValue()! + jsObject[Keys.readAsDataURL]!(blob.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FocusEvent.swift b/Sources/DOMKit/WebIDL/FocusEvent.swift index 0347caad..cd459a45 100644 --- a/Sources/DOMKit/WebIDL/FocusEvent.swift +++ b/Sources/DOMKit/WebIDL/FocusEvent.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class FocusEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.FocusEvent.function! } + private enum Keys { + static let relatedTarget: JSString = "relatedTarget" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: "relatedTarget") + _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Keys.relatedTarget) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/FocusEventInit.swift b/Sources/DOMKit/WebIDL/FocusEventInit.swift index dece5805..f9040195 100644 --- a/Sources/DOMKit/WebIDL/FocusEventInit.swift +++ b/Sources/DOMKit/WebIDL/FocusEventInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class FocusEventInit: BridgedDictionary { + private enum Keys { + static let relatedTarget: JSString = "relatedTarget" + } + public convenience init(relatedTarget: EventTarget?) { let object = JSObject.global.Object.function!.new() - object["relatedTarget"] = relatedTarget.jsValue() + object[Keys.relatedTarget] = relatedTarget.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _relatedTarget = ReadWriteAttribute(jsObject: object, name: "relatedTarget") + _relatedTarget = ReadWriteAttribute(jsObject: object, name: Keys.relatedTarget) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FocusOptions.swift b/Sources/DOMKit/WebIDL/FocusOptions.swift index 936052a6..a2a2a8ce 100644 --- a/Sources/DOMKit/WebIDL/FocusOptions.swift +++ b/Sources/DOMKit/WebIDL/FocusOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class FocusOptions: BridgedDictionary { + private enum Keys { + static let preventScroll: JSString = "preventScroll" + } + public convenience init(preventScroll: Bool) { let object = JSObject.global.Object.function!.new() - object["preventScroll"] = preventScroll.jsValue() + object[Keys.preventScroll] = preventScroll.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _preventScroll = ReadWriteAttribute(jsObject: object, name: "preventScroll") + _preventScroll = ReadWriteAttribute(jsObject: object, name: Keys.preventScroll) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index 370ec961..f2ee479d 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -6,6 +6,15 @@ import JavaScriptKit public class FormData: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.FormData.function! } + private enum Keys { + static let set: JSString = "set" + static let get: JSString = "get" + static let append: JSString = "append" + static let delete: JSString = "delete" + static let has: JSString = "has" + static let getAll: JSString = "getAll" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,35 +26,35 @@ public class FormData: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - _ = jsObject["append"]!(name.jsValue(), value.jsValue()) + _ = jsObject[Keys.append]!(name.jsValue(), value.jsValue()) } public func append(name: String, blobValue: Blob, filename: String? = nil) { - _ = jsObject["append"]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) + _ = jsObject[Keys.append]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) } public func delete(name: String) { - _ = jsObject["delete"]!(name.jsValue()) + _ = jsObject[Keys.delete]!(name.jsValue()) } public func get(name: String) -> FormDataEntryValue? { - jsObject["get"]!(name.jsValue()).fromJSValue()! + jsObject[Keys.get]!(name.jsValue()).fromJSValue()! } public func getAll(name: String) -> [FormDataEntryValue] { - jsObject["getAll"]!(name.jsValue()).fromJSValue()! + jsObject[Keys.getAll]!(name.jsValue()).fromJSValue()! } public func has(name: String) -> Bool { - jsObject["has"]!(name.jsValue()).fromJSValue()! + jsObject[Keys.has]!(name.jsValue()).fromJSValue()! } public func set(name: String, value: String) { - _ = jsObject["set"]!(name.jsValue(), value.jsValue()) + _ = jsObject[Keys.set]!(name.jsValue(), value.jsValue()) } public func set(name: String, blobValue: Blob, filename: String? = nil) { - _ = jsObject["set"]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) + _ = jsObject[Keys.set]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/FormDataEvent.swift b/Sources/DOMKit/WebIDL/FormDataEvent.swift index 95fc939c..86e1c23d 100644 --- a/Sources/DOMKit/WebIDL/FormDataEvent.swift +++ b/Sources/DOMKit/WebIDL/FormDataEvent.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class FormDataEvent: Event { override public class var constructor: JSFunction { JSObject.global.FormDataEvent.function! } + private enum Keys { + static let formData: JSString = "formData" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _formData = ReadonlyAttribute(jsObject: jsObject, name: "formData") + _formData = ReadonlyAttribute(jsObject: jsObject, name: Keys.formData) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/FormDataEventInit.swift b/Sources/DOMKit/WebIDL/FormDataEventInit.swift index 36342bf6..a8fcb915 100644 --- a/Sources/DOMKit/WebIDL/FormDataEventInit.swift +++ b/Sources/DOMKit/WebIDL/FormDataEventInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class FormDataEventInit: BridgedDictionary { + private enum Keys { + static let formData: JSString = "formData" + } + public convenience init(formData: FormData) { let object = JSObject.global.Object.function!.new() - object["formData"] = formData.jsValue() + object[Keys.formData] = formData.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _formData = ReadWriteAttribute(jsObject: object, name: "formData") + _formData = ReadWriteAttribute(jsObject: object, name: Keys.formData) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GenericTransformStream.swift b/Sources/DOMKit/WebIDL/GenericTransformStream.swift index aa0a61ac..fbb2bad3 100644 --- a/Sources/DOMKit/WebIDL/GenericTransformStream.swift +++ b/Sources/DOMKit/WebIDL/GenericTransformStream.swift @@ -3,9 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let readable: JSString = "readable" + static let writable: JSString = "writable" +} + public protocol GenericTransformStream: JSBridgedClass {} public extension GenericTransformStream { - var readable: ReadableStream { ReadonlyAttribute["readable", in: jsObject] } + var readable: ReadableStream { ReadonlyAttribute[Keys.readable, in: jsObject] } - var writable: WritableStream { ReadonlyAttribute["writable", in: jsObject] } + var writable: WritableStream { ReadonlyAttribute[Keys.writable, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift index 7a3c20e3..991d043b 100644 --- a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift +++ b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class GetRootNodeOptions: BridgedDictionary { + private enum Keys { + static let composed: JSString = "composed" + } + public convenience init(composed: Bool) { let object = JSObject.global.Object.function!.new() - object["composed"] = composed.jsValue() + object[Keys.composed] = composed.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _composed = ReadWriteAttribute(jsObject: object, name: "composed") + _composed = ReadWriteAttribute(jsObject: object, name: Keys.composed) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index 598afad1..848cb002 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -3,345 +3,416 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let onclick: JSString = "onclick" + static let ondblclick: JSString = "ondblclick" + static let ondrop: JSString = "ondrop" + static let onloadedmetadata: JSString = "onloadedmetadata" + static let onchange: JSString = "onchange" + static let oninvalid: JSString = "oninvalid" + static let onmouseleave: JSString = "onmouseleave" + static let onplay: JSString = "onplay" + static let onresize: JSString = "onresize" + static let onwaiting: JSString = "onwaiting" + static let onauxclick: JSString = "onauxclick" + static let onmouseup: JSString = "onmouseup" + static let onsuspend: JSString = "onsuspend" + static let onpause: JSString = "onpause" + static let onwebkittransitionend: JSString = "onwebkittransitionend" + static let ondragend: JSString = "ondragend" + static let onkeypress: JSString = "onkeypress" + static let ontoggle: JSString = "ontoggle" + static let onstalled: JSString = "onstalled" + static let ondurationchange: JSString = "ondurationchange" + static let onselect: JSString = "onselect" + static let onmousemove: JSString = "onmousemove" + static let onratechange: JSString = "onratechange" + static let onwebkitanimationstart: JSString = "onwebkitanimationstart" + static let ondragleave: JSString = "ondragleave" + static let oncontextrestored: JSString = "oncontextrestored" + static let ondragstart: JSString = "ondragstart" + static let onloadstart: JSString = "onloadstart" + static let onmouseover: JSString = "onmouseover" + static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" + static let onblur: JSString = "onblur" + static let onload: JSString = "onload" + static let oncontextlost: JSString = "oncontextlost" + static let oncuechange: JSString = "oncuechange" + static let ondragover: JSString = "ondragover" + static let onformdata: JSString = "onformdata" + static let onended: JSString = "onended" + static let onwebkitanimationiteration: JSString = "onwebkitanimationiteration" + static let onabort: JSString = "onabort" + static let onseeked: JSString = "onseeked" + static let ontimeupdate: JSString = "ontimeupdate" + static let oncanplaythrough: JSString = "oncanplaythrough" + static let onemptied: JSString = "onemptied" + static let onerror: JSString = "onerror" + static let onsubmit: JSString = "onsubmit" + static let onclose: JSString = "onclose" + static let oncanplay: JSString = "oncanplay" + static let onscroll: JSString = "onscroll" + static let onvolumechange: JSString = "onvolumechange" + static let onplaying: JSString = "onplaying" + static let onloadeddata: JSString = "onloadeddata" + static let oninput: JSString = "oninput" + static let onmousedown: JSString = "onmousedown" + static let onwheel: JSString = "onwheel" + static let onwebkitanimationend: JSString = "onwebkitanimationend" + static let oncancel: JSString = "oncancel" + static let onprogress: JSString = "onprogress" + static let onseeking: JSString = "onseeking" + static let onmouseout: JSString = "onmouseout" + static let onfocus: JSString = "onfocus" + static let onreset: JSString = "onreset" + static let onslotchange: JSString = "onslotchange" + static let onkeyup: JSString = "onkeyup" + static let onkeydown: JSString = "onkeydown" + static let onmouseenter: JSString = "onmouseenter" + static let oncontextmenu: JSString = "oncontextmenu" + static let ondragenter: JSString = "ondragenter" + static let ondrag: JSString = "ondrag" +} + public protocol GlobalEventHandlers: JSBridgedClass {} public extension GlobalEventHandlers { var onabort: EventHandler { - get { ClosureAttribute.Optional1["onabort", in: jsObject] } - set { ClosureAttribute.Optional1["onabort", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onabort, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onabort, in: jsObject] = newValue } } var onauxclick: EventHandler { - get { ClosureAttribute.Optional1["onauxclick", in: jsObject] } - set { ClosureAttribute.Optional1["onauxclick", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onauxclick, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onauxclick, in: jsObject] = newValue } } var onblur: EventHandler { - get { ClosureAttribute.Optional1["onblur", in: jsObject] } - set { ClosureAttribute.Optional1["onblur", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onblur, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onblur, in: jsObject] = newValue } } var oncancel: EventHandler { - get { ClosureAttribute.Optional1["oncancel", in: jsObject] } - set { ClosureAttribute.Optional1["oncancel", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oncancel, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oncancel, in: jsObject] = newValue } } var oncanplay: EventHandler { - get { ClosureAttribute.Optional1["oncanplay", in: jsObject] } - set { ClosureAttribute.Optional1["oncanplay", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oncanplay, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oncanplay, in: jsObject] = newValue } } var oncanplaythrough: EventHandler { - get { ClosureAttribute.Optional1["oncanplaythrough", in: jsObject] } - set { ClosureAttribute.Optional1["oncanplaythrough", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oncanplaythrough, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oncanplaythrough, in: jsObject] = newValue } } var onchange: EventHandler { - get { ClosureAttribute.Optional1["onchange", in: jsObject] } - set { ClosureAttribute.Optional1["onchange", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onchange, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onchange, in: jsObject] = newValue } } var onclick: EventHandler { - get { ClosureAttribute.Optional1["onclick", in: jsObject] } - set { ClosureAttribute.Optional1["onclick", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onclick, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onclick, in: jsObject] = newValue } } var onclose: EventHandler { - get { ClosureAttribute.Optional1["onclose", in: jsObject] } - set { ClosureAttribute.Optional1["onclose", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onclose, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onclose, in: jsObject] = newValue } } var oncontextlost: EventHandler { - get { ClosureAttribute.Optional1["oncontextlost", in: jsObject] } - set { ClosureAttribute.Optional1["oncontextlost", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oncontextlost, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oncontextlost, in: jsObject] = newValue } } var oncontextmenu: EventHandler { - get { ClosureAttribute.Optional1["oncontextmenu", in: jsObject] } - set { ClosureAttribute.Optional1["oncontextmenu", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oncontextmenu, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oncontextmenu, in: jsObject] = newValue } } var oncontextrestored: EventHandler { - get { ClosureAttribute.Optional1["oncontextrestored", in: jsObject] } - set { ClosureAttribute.Optional1["oncontextrestored", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oncontextrestored, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oncontextrestored, in: jsObject] = newValue } } var oncuechange: EventHandler { - get { ClosureAttribute.Optional1["oncuechange", in: jsObject] } - set { ClosureAttribute.Optional1["oncuechange", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oncuechange, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oncuechange, in: jsObject] = newValue } } var ondblclick: EventHandler { - get { ClosureAttribute.Optional1["ondblclick", in: jsObject] } - set { ClosureAttribute.Optional1["ondblclick", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ondblclick, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ondblclick, in: jsObject] = newValue } } var ondrag: EventHandler { - get { ClosureAttribute.Optional1["ondrag", in: jsObject] } - set { ClosureAttribute.Optional1["ondrag", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ondrag, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ondrag, in: jsObject] = newValue } } var ondragend: EventHandler { - get { ClosureAttribute.Optional1["ondragend", in: jsObject] } - set { ClosureAttribute.Optional1["ondragend", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ondragend, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ondragend, in: jsObject] = newValue } } var ondragenter: EventHandler { - get { ClosureAttribute.Optional1["ondragenter", in: jsObject] } - set { ClosureAttribute.Optional1["ondragenter", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ondragenter, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ondragenter, in: jsObject] = newValue } } var ondragleave: EventHandler { - get { ClosureAttribute.Optional1["ondragleave", in: jsObject] } - set { ClosureAttribute.Optional1["ondragleave", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ondragleave, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ondragleave, in: jsObject] = newValue } } var ondragover: EventHandler { - get { ClosureAttribute.Optional1["ondragover", in: jsObject] } - set { ClosureAttribute.Optional1["ondragover", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ondragover, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ondragover, in: jsObject] = newValue } } var ondragstart: EventHandler { - get { ClosureAttribute.Optional1["ondragstart", in: jsObject] } - set { ClosureAttribute.Optional1["ondragstart", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ondragstart, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ondragstart, in: jsObject] = newValue } } var ondrop: EventHandler { - get { ClosureAttribute.Optional1["ondrop", in: jsObject] } - set { ClosureAttribute.Optional1["ondrop", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ondrop, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ondrop, in: jsObject] = newValue } } var ondurationchange: EventHandler { - get { ClosureAttribute.Optional1["ondurationchange", in: jsObject] } - set { ClosureAttribute.Optional1["ondurationchange", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ondurationchange, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ondurationchange, in: jsObject] = newValue } } var onemptied: EventHandler { - get { ClosureAttribute.Optional1["onemptied", in: jsObject] } - set { ClosureAttribute.Optional1["onemptied", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onemptied, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onemptied, in: jsObject] = newValue } } var onended: EventHandler { - get { ClosureAttribute.Optional1["onended", in: jsObject] } - set { ClosureAttribute.Optional1["onended", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onended, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onended, in: jsObject] = newValue } } var onerror: OnErrorEventHandler { - get { ClosureAttribute.Optional5["onerror", in: jsObject] } - set { ClosureAttribute.Optional5["onerror", in: jsObject] = newValue } + get { ClosureAttribute.Optional5[Keys.onerror, in: jsObject] } + set { ClosureAttribute.Optional5[Keys.onerror, in: jsObject] = newValue } } var onfocus: EventHandler { - get { ClosureAttribute.Optional1["onfocus", in: jsObject] } - set { ClosureAttribute.Optional1["onfocus", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onfocus, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onfocus, in: jsObject] = newValue } } var onformdata: EventHandler { - get { ClosureAttribute.Optional1["onformdata", in: jsObject] } - set { ClosureAttribute.Optional1["onformdata", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onformdata, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onformdata, in: jsObject] = newValue } } var oninput: EventHandler { - get { ClosureAttribute.Optional1["oninput", in: jsObject] } - set { ClosureAttribute.Optional1["oninput", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oninput, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oninput, in: jsObject] = newValue } } var oninvalid: EventHandler { - get { ClosureAttribute.Optional1["oninvalid", in: jsObject] } - set { ClosureAttribute.Optional1["oninvalid", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.oninvalid, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.oninvalid, in: jsObject] = newValue } } var onkeydown: EventHandler { - get { ClosureAttribute.Optional1["onkeydown", in: jsObject] } - set { ClosureAttribute.Optional1["onkeydown", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onkeydown, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onkeydown, in: jsObject] = newValue } } var onkeypress: EventHandler { - get { ClosureAttribute.Optional1["onkeypress", in: jsObject] } - set { ClosureAttribute.Optional1["onkeypress", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onkeypress, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onkeypress, in: jsObject] = newValue } } var onkeyup: EventHandler { - get { ClosureAttribute.Optional1["onkeyup", in: jsObject] } - set { ClosureAttribute.Optional1["onkeyup", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onkeyup, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onkeyup, in: jsObject] = newValue } } var onload: EventHandler { - get { ClosureAttribute.Optional1["onload", in: jsObject] } - set { ClosureAttribute.Optional1["onload", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onload, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onload, in: jsObject] = newValue } } var onloadeddata: EventHandler { - get { ClosureAttribute.Optional1["onloadeddata", in: jsObject] } - set { ClosureAttribute.Optional1["onloadeddata", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onloadeddata, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onloadeddata, in: jsObject] = newValue } } var onloadedmetadata: EventHandler { - get { ClosureAttribute.Optional1["onloadedmetadata", in: jsObject] } - set { ClosureAttribute.Optional1["onloadedmetadata", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onloadedmetadata, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onloadedmetadata, in: jsObject] = newValue } } var onloadstart: EventHandler { - get { ClosureAttribute.Optional1["onloadstart", in: jsObject] } - set { ClosureAttribute.Optional1["onloadstart", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onloadstart, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onloadstart, in: jsObject] = newValue } } var onmousedown: EventHandler { - get { ClosureAttribute.Optional1["onmousedown", in: jsObject] } - set { ClosureAttribute.Optional1["onmousedown", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onmousedown, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onmousedown, in: jsObject] = newValue } } var onmouseenter: EventHandler { - get { ClosureAttribute.Optional1["onmouseenter", in: jsObject] } - set { ClosureAttribute.Optional1["onmouseenter", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onmouseenter, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onmouseenter, in: jsObject] = newValue } } var onmouseleave: EventHandler { - get { ClosureAttribute.Optional1["onmouseleave", in: jsObject] } - set { ClosureAttribute.Optional1["onmouseleave", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onmouseleave, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onmouseleave, in: jsObject] = newValue } } var onmousemove: EventHandler { - get { ClosureAttribute.Optional1["onmousemove", in: jsObject] } - set { ClosureAttribute.Optional1["onmousemove", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onmousemove, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onmousemove, in: jsObject] = newValue } } var onmouseout: EventHandler { - get { ClosureAttribute.Optional1["onmouseout", in: jsObject] } - set { ClosureAttribute.Optional1["onmouseout", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onmouseout, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onmouseout, in: jsObject] = newValue } } var onmouseover: EventHandler { - get { ClosureAttribute.Optional1["onmouseover", in: jsObject] } - set { ClosureAttribute.Optional1["onmouseover", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onmouseover, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onmouseover, in: jsObject] = newValue } } var onmouseup: EventHandler { - get { ClosureAttribute.Optional1["onmouseup", in: jsObject] } - set { ClosureAttribute.Optional1["onmouseup", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onmouseup, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onmouseup, in: jsObject] = newValue } } var onpause: EventHandler { - get { ClosureAttribute.Optional1["onpause", in: jsObject] } - set { ClosureAttribute.Optional1["onpause", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onpause, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onpause, in: jsObject] = newValue } } var onplay: EventHandler { - get { ClosureAttribute.Optional1["onplay", in: jsObject] } - set { ClosureAttribute.Optional1["onplay", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onplay, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onplay, in: jsObject] = newValue } } var onplaying: EventHandler { - get { ClosureAttribute.Optional1["onplaying", in: jsObject] } - set { ClosureAttribute.Optional1["onplaying", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onplaying, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onplaying, in: jsObject] = newValue } } var onprogress: EventHandler { - get { ClosureAttribute.Optional1["onprogress", in: jsObject] } - set { ClosureAttribute.Optional1["onprogress", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onprogress, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onprogress, in: jsObject] = newValue } } var onratechange: EventHandler { - get { ClosureAttribute.Optional1["onratechange", in: jsObject] } - set { ClosureAttribute.Optional1["onratechange", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onratechange, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onratechange, in: jsObject] = newValue } } var onreset: EventHandler { - get { ClosureAttribute.Optional1["onreset", in: jsObject] } - set { ClosureAttribute.Optional1["onreset", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onreset, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onreset, in: jsObject] = newValue } } var onresize: EventHandler { - get { ClosureAttribute.Optional1["onresize", in: jsObject] } - set { ClosureAttribute.Optional1["onresize", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onresize, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onresize, in: jsObject] = newValue } } var onscroll: EventHandler { - get { ClosureAttribute.Optional1["onscroll", in: jsObject] } - set { ClosureAttribute.Optional1["onscroll", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onscroll, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onscroll, in: jsObject] = newValue } } var onsecuritypolicyviolation: EventHandler { - get { ClosureAttribute.Optional1["onsecuritypolicyviolation", in: jsObject] } - set { ClosureAttribute.Optional1["onsecuritypolicyviolation", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onsecuritypolicyviolation, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onsecuritypolicyviolation, in: jsObject] = newValue } } var onseeked: EventHandler { - get { ClosureAttribute.Optional1["onseeked", in: jsObject] } - set { ClosureAttribute.Optional1["onseeked", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onseeked, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onseeked, in: jsObject] = newValue } } var onseeking: EventHandler { - get { ClosureAttribute.Optional1["onseeking", in: jsObject] } - set { ClosureAttribute.Optional1["onseeking", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onseeking, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onseeking, in: jsObject] = newValue } } var onselect: EventHandler { - get { ClosureAttribute.Optional1["onselect", in: jsObject] } - set { ClosureAttribute.Optional1["onselect", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onselect, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onselect, in: jsObject] = newValue } } var onslotchange: EventHandler { - get { ClosureAttribute.Optional1["onslotchange", in: jsObject] } - set { ClosureAttribute.Optional1["onslotchange", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onslotchange, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onslotchange, in: jsObject] = newValue } } var onstalled: EventHandler { - get { ClosureAttribute.Optional1["onstalled", in: jsObject] } - set { ClosureAttribute.Optional1["onstalled", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onstalled, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onstalled, in: jsObject] = newValue } } var onsubmit: EventHandler { - get { ClosureAttribute.Optional1["onsubmit", in: jsObject] } - set { ClosureAttribute.Optional1["onsubmit", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onsubmit, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onsubmit, in: jsObject] = newValue } } var onsuspend: EventHandler { - get { ClosureAttribute.Optional1["onsuspend", in: jsObject] } - set { ClosureAttribute.Optional1["onsuspend", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onsuspend, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onsuspend, in: jsObject] = newValue } } var ontimeupdate: EventHandler { - get { ClosureAttribute.Optional1["ontimeupdate", in: jsObject] } - set { ClosureAttribute.Optional1["ontimeupdate", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ontimeupdate, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ontimeupdate, in: jsObject] = newValue } } var ontoggle: EventHandler { - get { ClosureAttribute.Optional1["ontoggle", in: jsObject] } - set { ClosureAttribute.Optional1["ontoggle", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ontoggle, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ontoggle, in: jsObject] = newValue } } var onvolumechange: EventHandler { - get { ClosureAttribute.Optional1["onvolumechange", in: jsObject] } - set { ClosureAttribute.Optional1["onvolumechange", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onvolumechange, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onvolumechange, in: jsObject] = newValue } } var onwaiting: EventHandler { - get { ClosureAttribute.Optional1["onwaiting", in: jsObject] } - set { ClosureAttribute.Optional1["onwaiting", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onwaiting, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onwaiting, in: jsObject] = newValue } } var onwebkitanimationend: EventHandler { - get { ClosureAttribute.Optional1["onwebkitanimationend", in: jsObject] } - set { ClosureAttribute.Optional1["onwebkitanimationend", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onwebkitanimationend, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onwebkitanimationend, in: jsObject] = newValue } } var onwebkitanimationiteration: EventHandler { - get { ClosureAttribute.Optional1["onwebkitanimationiteration", in: jsObject] } - set { ClosureAttribute.Optional1["onwebkitanimationiteration", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onwebkitanimationiteration, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onwebkitanimationiteration, in: jsObject] = newValue } } var onwebkitanimationstart: EventHandler { - get { ClosureAttribute.Optional1["onwebkitanimationstart", in: jsObject] } - set { ClosureAttribute.Optional1["onwebkitanimationstart", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onwebkitanimationstart, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onwebkitanimationstart, in: jsObject] = newValue } } var onwebkittransitionend: EventHandler { - get { ClosureAttribute.Optional1["onwebkittransitionend", in: jsObject] } - set { ClosureAttribute.Optional1["onwebkittransitionend", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onwebkittransitionend, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onwebkittransitionend, in: jsObject] = newValue } } var onwheel: EventHandler { - get { ClosureAttribute.Optional1["onwheel", in: jsObject] } - set { ClosureAttribute.Optional1["onwheel", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onwheel, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onwheel, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift index dd1644ac..c996c038 100644 --- a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class HTMLAllCollection: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.HTMLAllCollection.function! } + private enum Keys { + static let namedItem: JSString = "namedItem" + static let item: JSString = "item" + static let length: JSString = "length" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } @@ -25,6 +31,6 @@ public class HTMLAllCollection: JSBridgedClass { } public func item(nameOrIndex: String? = nil) -> __UNSUPPORTED_UNION__? { - jsObject["item"]!(nameOrIndex?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.item]!(nameOrIndex?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift index a1ba0561..589dcd4b 100644 --- a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift @@ -6,21 +6,38 @@ import JavaScriptKit public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { override public class var constructor: JSFunction { JSObject.global.HTMLAnchorElement.function! } + private enum Keys { + static let rel: JSString = "rel" + static let charset: JSString = "charset" + static let target: JSString = "target" + static let coords: JSString = "coords" + static let name: JSString = "name" + static let ping: JSString = "ping" + static let download: JSString = "download" + static let text: JSString = "text" + static let shape: JSString = "shape" + static let referrerPolicy: JSString = "referrerPolicy" + static let type: JSString = "type" + static let rev: JSString = "rev" + static let relList: JSString = "relList" + static let hreflang: JSString = "hreflang" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _target = ReadWriteAttribute(jsObject: jsObject, name: "target") - _download = ReadWriteAttribute(jsObject: jsObject, name: "download") - _ping = ReadWriteAttribute(jsObject: jsObject, name: "ping") - _rel = ReadWriteAttribute(jsObject: jsObject, name: "rel") - _relList = ReadonlyAttribute(jsObject: jsObject, name: "relList") - _hreflang = ReadWriteAttribute(jsObject: jsObject, name: "hreflang") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _text = ReadWriteAttribute(jsObject: jsObject, name: "text") - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") - _coords = ReadWriteAttribute(jsObject: jsObject, name: "coords") - _charset = ReadWriteAttribute(jsObject: jsObject, name: "charset") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _rev = ReadWriteAttribute(jsObject: jsObject, name: "rev") - _shape = ReadWriteAttribute(jsObject: jsObject, name: "shape") + _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) + _download = ReadWriteAttribute(jsObject: jsObject, name: Keys.download) + _ping = ReadWriteAttribute(jsObject: jsObject, name: Keys.ping) + _rel = ReadWriteAttribute(jsObject: jsObject, name: Keys.rel) + _relList = ReadonlyAttribute(jsObject: jsObject, name: Keys.relList) + _hreflang = ReadWriteAttribute(jsObject: jsObject, name: Keys.hreflang) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) + _coords = ReadWriteAttribute(jsObject: jsObject, name: Keys.coords) + _charset = ReadWriteAttribute(jsObject: jsObject, name: Keys.charset) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _rev = ReadWriteAttribute(jsObject: jsObject, name: Keys.rev) + _shape = ReadWriteAttribute(jsObject: jsObject, name: Keys.shape) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift index 8ae9d39b..c108e128 100644 --- a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift @@ -6,17 +6,30 @@ import JavaScriptKit public class HTMLAreaElement: HTMLElement, HTMLHyperlinkElementUtils { override public class var constructor: JSFunction { JSObject.global.HTMLAreaElement.function! } + private enum Keys { + static let rel: JSString = "rel" + static let alt: JSString = "alt" + static let ping: JSString = "ping" + static let relList: JSString = "relList" + static let noHref: JSString = "noHref" + static let download: JSString = "download" + static let shape: JSString = "shape" + static let coords: JSString = "coords" + static let target: JSString = "target" + static let referrerPolicy: JSString = "referrerPolicy" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _alt = ReadWriteAttribute(jsObject: jsObject, name: "alt") - _coords = ReadWriteAttribute(jsObject: jsObject, name: "coords") - _shape = ReadWriteAttribute(jsObject: jsObject, name: "shape") - _target = ReadWriteAttribute(jsObject: jsObject, name: "target") - _download = ReadWriteAttribute(jsObject: jsObject, name: "download") - _ping = ReadWriteAttribute(jsObject: jsObject, name: "ping") - _rel = ReadWriteAttribute(jsObject: jsObject, name: "rel") - _relList = ReadonlyAttribute(jsObject: jsObject, name: "relList") - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") - _noHref = ReadWriteAttribute(jsObject: jsObject, name: "noHref") + _alt = ReadWriteAttribute(jsObject: jsObject, name: Keys.alt) + _coords = ReadWriteAttribute(jsObject: jsObject, name: Keys.coords) + _shape = ReadWriteAttribute(jsObject: jsObject, name: Keys.shape) + _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) + _download = ReadWriteAttribute(jsObject: jsObject, name: Keys.download) + _ping = ReadWriteAttribute(jsObject: jsObject, name: Keys.ping) + _rel = ReadWriteAttribute(jsObject: jsObject, name: Keys.rel) + _relList = ReadonlyAttribute(jsObject: jsObject, name: Keys.relList) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) + _noHref = ReadWriteAttribute(jsObject: jsObject, name: Keys.noHref) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift index 61322a9b..f45e1a96 100644 --- a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class HTMLAudioElement: HTMLMediaElement { override public class var constructor: JSFunction { JSObject.global.HTMLAudioElement.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLBRElement.swift b/Sources/DOMKit/WebIDL/HTMLBRElement.swift index 8bc6acce..20ae5cc6 100644 --- a/Sources/DOMKit/WebIDL/HTMLBRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBRElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLBRElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLBRElement.function! } + private enum Keys { + static let clear: JSString = "clear" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _clear = ReadWriteAttribute(jsObject: jsObject, name: "clear") + _clear = ReadWriteAttribute(jsObject: jsObject, name: Keys.clear) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift index 2d50177c..21a407ca 100644 --- a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class HTMLBaseElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLBaseElement.function! } + private enum Keys { + static let href: JSString = "href" + static let target: JSString = "target" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadWriteAttribute(jsObject: jsObject, name: "href") - _target = ReadWriteAttribute(jsObject: jsObject, name: "target") + _href = ReadWriteAttribute(jsObject: jsObject, name: Keys.href) + _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift index c5647540..d40be838 100644 --- a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift @@ -6,13 +6,22 @@ import JavaScriptKit public class HTMLBodyElement: HTMLElement, WindowEventHandlers { override public class var constructor: JSFunction { JSObject.global.HTMLBodyElement.function! } + private enum Keys { + static let background: JSString = "background" + static let bgColor: JSString = "bgColor" + static let link: JSString = "link" + static let aLink: JSString = "aLink" + static let text: JSString = "text" + static let vLink: JSString = "vLink" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _text = ReadWriteAttribute(jsObject: jsObject, name: "text") - _link = ReadWriteAttribute(jsObject: jsObject, name: "link") - _vLink = ReadWriteAttribute(jsObject: jsObject, name: "vLink") - _aLink = ReadWriteAttribute(jsObject: jsObject, name: "aLink") - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") - _background = ReadWriteAttribute(jsObject: jsObject, name: "background") + _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) + _link = ReadWriteAttribute(jsObject: jsObject, name: Keys.link) + _vLink = ReadWriteAttribute(jsObject: jsObject, name: Keys.vLink) + _aLink = ReadWriteAttribute(jsObject: jsObject, name: Keys.aLink) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) + _background = ReadWriteAttribute(jsObject: jsObject, name: Keys.background) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift index dede7ae6..0fe2787a 100644 --- a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -6,21 +6,41 @@ import JavaScriptKit public class HTMLButtonElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLButtonElement.function! } + private enum Keys { + static let formMethod: JSString = "formMethod" + static let setCustomValidity: JSString = "setCustomValidity" + static let name: JSString = "name" + static let reportValidity: JSString = "reportValidity" + static let labels: JSString = "labels" + static let willValidate: JSString = "willValidate" + static let formNoValidate: JSString = "formNoValidate" + static let formTarget: JSString = "formTarget" + static let value: JSString = "value" + static let checkValidity: JSString = "checkValidity" + static let type: JSString = "type" + static let disabled: JSString = "disabled" + static let validity: JSString = "validity" + static let formEnctype: JSString = "formEnctype" + static let form: JSString = "form" + static let formAction: JSString = "formAction" + static let validationMessage: JSString = "validationMessage" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _formAction = ReadWriteAttribute(jsObject: jsObject, name: "formAction") - _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: "formEnctype") - _formMethod = ReadWriteAttribute(jsObject: jsObject, name: "formMethod") - _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: "formNoValidate") - _formTarget = ReadWriteAttribute(jsObject: jsObject, name: "formTarget") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") - _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") - _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _formAction = ReadWriteAttribute(jsObject: jsObject, name: Keys.formAction) + _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: Keys.formEnctype) + _formMethod = ReadWriteAttribute(jsObject: jsObject, name: Keys.formMethod) + _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: Keys.formNoValidate) + _formTarget = ReadWriteAttribute(jsObject: jsObject, name: Keys.formTarget) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) super.init(unsafelyWrapping: jsObject) } @@ -68,15 +88,15 @@ public class HTMLButtonElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject["checkValidity"]!().fromJSValue()! + jsObject[Keys.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject["reportValidity"]!().fromJSValue()! + jsObject[Keys.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject["setCustomValidity"]!(error.jsValue()) + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index 89b318af..9d01226e 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -6,9 +6,18 @@ import JavaScriptKit public class HTMLCanvasElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLCanvasElement.function! } + private enum Keys { + static let getContext: JSString = "getContext" + static let toBlob: JSString = "toBlob" + static let width: JSString = "width" + static let height: JSString = "height" + static let toDataURL: JSString = "toDataURL" + static let transferControlToOffscreen: JSString = "transferControlToOffscreen" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) super.init(unsafelyWrapping: jsObject) } @@ -23,16 +32,16 @@ public class HTMLCanvasElement: HTMLElement { public var height: UInt32 public func getContext(contextId: String, options: JSValue? = nil) -> RenderingContext? { - jsObject["getContext"]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.getContext]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func toDataURL(type: String? = nil, quality: JSValue? = nil) -> String { - jsObject["toDataURL"]!(type?.jsValue() ?? .undefined, quality?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.toDataURL]!(type?.jsValue() ?? .undefined, quality?.jsValue() ?? .undefined).fromJSValue()! } // XXX: member 'toBlob' is ignored public func transferControlToOffscreen() -> OffscreenCanvas { - jsObject["transferControlToOffscreen"]!().fromJSValue()! + jsObject[Keys.transferControlToOffscreen]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLCollection.swift b/Sources/DOMKit/WebIDL/HTMLCollection.swift index 74fb39b9..452644a2 100644 --- a/Sources/DOMKit/WebIDL/HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLCollection.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class HTMLCollection: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.HTMLCollection.function! } + private enum Keys { + static let length: JSString = "length" + static let namedItem: JSString = "namedItem" + static let item: JSString = "item" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/HTMLDListElement.swift b/Sources/DOMKit/WebIDL/HTMLDListElement.swift index 10dba972..5725d1fa 100644 --- a/Sources/DOMKit/WebIDL/HTMLDListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDListElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLDListElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDListElement.function! } + private enum Keys { + static let compact: JSString = "compact" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") + _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDataElement.swift b/Sources/DOMKit/WebIDL/HTMLDataElement.swift index 1c5d07b3..57dea6e8 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLDataElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDataElement.function! } + private enum Keys { + static let value: JSString = "value" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift index 1a0d02ec..3084eeee 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLDataListElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDataListElement.function! } + private enum Keys { + static let options: JSString = "options" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _options = ReadonlyAttribute(jsObject: jsObject, name: "options") + _options = ReadonlyAttribute(jsObject: jsObject, name: Keys.options) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift index bec9c6de..4701692f 100644 --- a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLDetailsElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDetailsElement.function! } + private enum Keys { + static let open: JSString = "open" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _open = ReadWriteAttribute(jsObject: jsObject, name: "open") + _open = ReadWriteAttribute(jsObject: jsObject, name: Keys.open) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift index b22eecf1..f6e93087 100644 --- a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -6,9 +6,17 @@ import JavaScriptKit public class HTMLDialogElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDialogElement.function! } + private enum Keys { + static let show: JSString = "show" + static let close: JSString = "close" + static let showModal: JSString = "showModal" + static let returnValue: JSString = "returnValue" + static let open: JSString = "open" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _open = ReadWriteAttribute(jsObject: jsObject, name: "open") - _returnValue = ReadWriteAttribute(jsObject: jsObject, name: "returnValue") + _open = ReadWriteAttribute(jsObject: jsObject, name: Keys.open) + _returnValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.returnValue) super.init(unsafelyWrapping: jsObject) } @@ -23,14 +31,14 @@ public class HTMLDialogElement: HTMLElement { public var returnValue: String public func show() { - _ = jsObject["show"]!() + _ = jsObject[Keys.show]!() } public func showModal() { - _ = jsObject["showModal"]!() + _ = jsObject[Keys.showModal]!() } public func close(returnValue: String? = nil) { - _ = jsObject["close"]!(returnValue?.jsValue() ?? .undefined) + _ = jsObject[Keys.close]!(returnValue?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift index e023c219..40e2028c 100644 --- a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLDirectoryElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDirectoryElement.function! } + private enum Keys { + static let compact: JSString = "compact" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") + _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDivElement.swift b/Sources/DOMKit/WebIDL/HTMLDivElement.swift index 6d79166b..e8af0b95 100644 --- a/Sources/DOMKit/WebIDL/HTMLDivElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDivElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLDivElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDivElement.function! } + private enum Keys { + static let align: JSString = "align" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index d40f7288..00e14dec 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -6,20 +6,38 @@ import JavaScriptKit public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement, ElementCSSInlineStyle { override public class var constructor: JSFunction { JSObject.global.HTMLElement.function! } + private enum Keys { + static let attachInternals: JSString = "attachInternals" + static let title: JSString = "title" + static let spellcheck: JSString = "spellcheck" + static let translate: JSString = "translate" + static let hidden: JSString = "hidden" + static let click: JSString = "click" + static let draggable: JSString = "draggable" + static let dir: JSString = "dir" + static let accessKey: JSString = "accessKey" + static let innerText: JSString = "innerText" + static let autocapitalize: JSString = "autocapitalize" + static let outerText: JSString = "outerText" + static let inert: JSString = "inert" + static let lang: JSString = "lang" + static let accessKeyLabel: JSString = "accessKeyLabel" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _title = ReadWriteAttribute(jsObject: jsObject, name: "title") - _lang = ReadWriteAttribute(jsObject: jsObject, name: "lang") - _translate = ReadWriteAttribute(jsObject: jsObject, name: "translate") - _dir = ReadWriteAttribute(jsObject: jsObject, name: "dir") - _hidden = ReadWriteAttribute(jsObject: jsObject, name: "hidden") - _inert = ReadWriteAttribute(jsObject: jsObject, name: "inert") - _accessKey = ReadWriteAttribute(jsObject: jsObject, name: "accessKey") - _accessKeyLabel = ReadonlyAttribute(jsObject: jsObject, name: "accessKeyLabel") - _draggable = ReadWriteAttribute(jsObject: jsObject, name: "draggable") - _spellcheck = ReadWriteAttribute(jsObject: jsObject, name: "spellcheck") - _autocapitalize = ReadWriteAttribute(jsObject: jsObject, name: "autocapitalize") - _innerText = ReadWriteAttribute(jsObject: jsObject, name: "innerText") - _outerText = ReadWriteAttribute(jsObject: jsObject, name: "outerText") + _title = ReadWriteAttribute(jsObject: jsObject, name: Keys.title) + _lang = ReadWriteAttribute(jsObject: jsObject, name: Keys.lang) + _translate = ReadWriteAttribute(jsObject: jsObject, name: Keys.translate) + _dir = ReadWriteAttribute(jsObject: jsObject, name: Keys.dir) + _hidden = ReadWriteAttribute(jsObject: jsObject, name: Keys.hidden) + _inert = ReadWriteAttribute(jsObject: jsObject, name: Keys.inert) + _accessKey = ReadWriteAttribute(jsObject: jsObject, name: Keys.accessKey) + _accessKeyLabel = ReadonlyAttribute(jsObject: jsObject, name: Keys.accessKeyLabel) + _draggable = ReadWriteAttribute(jsObject: jsObject, name: Keys.draggable) + _spellcheck = ReadWriteAttribute(jsObject: jsObject, name: Keys.spellcheck) + _autocapitalize = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocapitalize) + _innerText = ReadWriteAttribute(jsObject: jsObject, name: Keys.innerText) + _outerText = ReadWriteAttribute(jsObject: jsObject, name: Keys.outerText) super.init(unsafelyWrapping: jsObject) } @@ -46,7 +64,7 @@ public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventH public var inert: Bool public func click() { - _ = jsObject["click"]!() + _ = jsObject[Keys.click]!() } @ReadWriteAttribute @@ -71,6 +89,6 @@ public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventH public var outerText: String public func attachInternals() -> ElementInternals { - jsObject["attachInternals"]!().fromJSValue()! + jsObject[Keys.attachInternals]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift index a09fe3ed..a399a3b5 100644 --- a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift @@ -6,13 +6,23 @@ import JavaScriptKit public class HTMLEmbedElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLEmbedElement.function! } + private enum Keys { + static let width: JSString = "width" + static let getSVGDocument: JSString = "getSVGDocument" + static let align: JSString = "align" + static let type: JSString = "type" + static let src: JSString = "src" + static let name: JSString = "name" + static let height: JSString = "height" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: "src") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) super.init(unsafelyWrapping: jsObject) } @@ -33,7 +43,7 @@ public class HTMLEmbedElement: HTMLElement { public var height: String public func getSVGDocument() -> Document? { - jsObject["getSVGDocument"]!().fromJSValue()! + jsObject[Keys.getSVGDocument]!().fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift index 1d2aa088..f946d713 100644 --- a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -6,15 +6,29 @@ import JavaScriptKit public class HTMLFieldSetElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFieldSetElement.function! } + private enum Keys { + static let checkValidity: JSString = "checkValidity" + static let type: JSString = "type" + static let name: JSString = "name" + static let validity: JSString = "validity" + static let validationMessage: JSString = "validationMessage" + static let setCustomValidity: JSString = "setCustomValidity" + static let form: JSString = "form" + static let disabled: JSString = "disabled" + static let elements: JSString = "elements" + static let reportValidity: JSString = "reportValidity" + static let willValidate: JSString = "willValidate" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") - _elements = ReadonlyAttribute(jsObject: jsObject, name: "elements") - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") - _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _elements = ReadonlyAttribute(jsObject: jsObject, name: Keys.elements) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) super.init(unsafelyWrapping: jsObject) } @@ -47,14 +61,14 @@ public class HTMLFieldSetElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject["checkValidity"]!().fromJSValue()! + jsObject[Keys.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject["reportValidity"]!().fromJSValue()! + jsObject[Keys.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject["setCustomValidity"]!(error.jsValue()) + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/HTMLFontElement.swift b/Sources/DOMKit/WebIDL/HTMLFontElement.swift index 03c6751a..caf58baf 100644 --- a/Sources/DOMKit/WebIDL/HTMLFontElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFontElement.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class HTMLFontElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFontElement.function! } + private enum Keys { + static let face: JSString = "face" + static let color: JSString = "color" + static let size: JSString = "size" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _color = ReadWriteAttribute(jsObject: jsObject, name: "color") - _face = ReadWriteAttribute(jsObject: jsObject, name: "face") - _size = ReadWriteAttribute(jsObject: jsObject, name: "size") + _color = ReadWriteAttribute(jsObject: jsObject, name: Keys.color) + _face = ReadWriteAttribute(jsObject: jsObject, name: Keys.face) + _size = ReadWriteAttribute(jsObject: jsObject, name: Keys.size) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift index c8dbc8e2..8351e746 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift @@ -6,6 +6,10 @@ import JavaScriptKit public class HTMLFormControlsCollection: HTMLCollection { override public class var constructor: JSFunction { JSObject.global.HTMLFormControlsCollection.function! } + private enum Keys { + static let namedItem: JSString = "namedItem" + } + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index e83af8d5..59ddf66f 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -6,20 +6,41 @@ import JavaScriptKit public class HTMLFormElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFormElement.function! } + private enum Keys { + static let reportValidity: JSString = "reportValidity" + static let rel: JSString = "rel" + static let autocomplete: JSString = "autocomplete" + static let name: JSString = "name" + static let method: JSString = "method" + static let acceptCharset: JSString = "acceptCharset" + static let noValidate: JSString = "noValidate" + static let target: JSString = "target" + static let encoding: JSString = "encoding" + static let checkValidity: JSString = "checkValidity" + static let action: JSString = "action" + static let length: JSString = "length" + static let submit: JSString = "submit" + static let requestSubmit: JSString = "requestSubmit" + static let enctype: JSString = "enctype" + static let relList: JSString = "relList" + static let reset: JSString = "reset" + static let elements: JSString = "elements" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _acceptCharset = ReadWriteAttribute(jsObject: jsObject, name: "acceptCharset") - _action = ReadWriteAttribute(jsObject: jsObject, name: "action") - _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: "autocomplete") - _enctype = ReadWriteAttribute(jsObject: jsObject, name: "enctype") - _encoding = ReadWriteAttribute(jsObject: jsObject, name: "encoding") - _method = ReadWriteAttribute(jsObject: jsObject, name: "method") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _noValidate = ReadWriteAttribute(jsObject: jsObject, name: "noValidate") - _target = ReadWriteAttribute(jsObject: jsObject, name: "target") - _rel = ReadWriteAttribute(jsObject: jsObject, name: "rel") - _relList = ReadonlyAttribute(jsObject: jsObject, name: "relList") - _elements = ReadonlyAttribute(jsObject: jsObject, name: "elements") - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _acceptCharset = ReadWriteAttribute(jsObject: jsObject, name: Keys.acceptCharset) + _action = ReadWriteAttribute(jsObject: jsObject, name: Keys.action) + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocomplete) + _enctype = ReadWriteAttribute(jsObject: jsObject, name: Keys.enctype) + _encoding = ReadWriteAttribute(jsObject: jsObject, name: Keys.encoding) + _method = ReadWriteAttribute(jsObject: jsObject, name: Keys.method) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _noValidate = ReadWriteAttribute(jsObject: jsObject, name: Keys.noValidate) + _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) + _rel = ReadWriteAttribute(jsObject: jsObject, name: Keys.rel) + _relList = ReadonlyAttribute(jsObject: jsObject, name: Keys.relList) + _elements = ReadonlyAttribute(jsObject: jsObject, name: Keys.elements) + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) super.init(unsafelyWrapping: jsObject) } @@ -75,22 +96,22 @@ public class HTMLFormElement: HTMLElement { } public func submit() { - _ = jsObject["submit"]!() + _ = jsObject[Keys.submit]!() } public func requestSubmit(submitter: HTMLElement? = nil) { - _ = jsObject["requestSubmit"]!(submitter?.jsValue() ?? .undefined) + _ = jsObject[Keys.requestSubmit]!(submitter?.jsValue() ?? .undefined) } public func reset() { - _ = jsObject["reset"]!() + _ = jsObject[Keys.reset]!() } public func checkValidity() -> Bool { - jsObject["checkValidity"]!().fromJSValue()! + jsObject[Keys.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject["reportValidity"]!().fromJSValue()! + jsObject[Keys.reportValidity]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift index 8c6000c0..8d503525 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift @@ -6,17 +6,30 @@ import JavaScriptKit public class HTMLFrameElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFrameElement.function! } + private enum Keys { + static let contentWindow: JSString = "contentWindow" + static let src: JSString = "src" + static let name: JSString = "name" + static let scrolling: JSString = "scrolling" + static let frameBorder: JSString = "frameBorder" + static let marginHeight: JSString = "marginHeight" + static let longDesc: JSString = "longDesc" + static let marginWidth: JSString = "marginWidth" + static let noResize: JSString = "noResize" + static let contentDocument: JSString = "contentDocument" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _scrolling = ReadWriteAttribute(jsObject: jsObject, name: "scrolling") - _src = ReadWriteAttribute(jsObject: jsObject, name: "src") - _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: "frameBorder") - _longDesc = ReadWriteAttribute(jsObject: jsObject, name: "longDesc") - _noResize = ReadWriteAttribute(jsObject: jsObject, name: "noResize") - _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: "contentDocument") - _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: "contentWindow") - _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: "marginHeight") - _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: "marginWidth") + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _scrolling = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrolling) + _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) + _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: Keys.frameBorder) + _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Keys.longDesc) + _noResize = ReadWriteAttribute(jsObject: jsObject, name: Keys.noResize) + _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentDocument) + _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentWindow) + _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Keys.marginHeight) + _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Keys.marginWidth) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift index 7037f616..5b124069 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class HTMLFrameSetElement: HTMLElement, WindowEventHandlers { override public class var constructor: JSFunction { JSObject.global.HTMLFrameSetElement.function! } + private enum Keys { + static let cols: JSString = "cols" + static let rows: JSString = "rows" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _cols = ReadWriteAttribute(jsObject: jsObject, name: "cols") - _rows = ReadWriteAttribute(jsObject: jsObject, name: "rows") + _cols = ReadWriteAttribute(jsObject: jsObject, name: Keys.cols) + _rows = ReadWriteAttribute(jsObject: jsObject, name: Keys.rows) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHRElement.swift b/Sources/DOMKit/WebIDL/HTMLHRElement.swift index 24d6e70b..e54acd9e 100644 --- a/Sources/DOMKit/WebIDL/HTMLHRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHRElement.swift @@ -6,12 +6,20 @@ import JavaScriptKit public class HTMLHRElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLHRElement.function! } + private enum Keys { + static let width: JSString = "width" + static let size: JSString = "size" + static let align: JSString = "align" + static let noShade: JSString = "noShade" + static let color: JSString = "color" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _color = ReadWriteAttribute(jsObject: jsObject, name: "color") - _noShade = ReadWriteAttribute(jsObject: jsObject, name: "noShade") - _size = ReadWriteAttribute(jsObject: jsObject, name: "size") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _color = ReadWriteAttribute(jsObject: jsObject, name: Keys.color) + _noShade = ReadWriteAttribute(jsObject: jsObject, name: Keys.noShade) + _size = ReadWriteAttribute(jsObject: jsObject, name: Keys.size) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift index 16c56abd..c3334ec8 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class HTMLHeadElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLHeadElement.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift index 1f4dce00..df7f11dc 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLHeadingElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLHeadingElement.function! } + private enum Keys { + static let align: JSString = "align" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift index 64dc4cb6..c7a84848 100644 --- a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLHtmlElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLHtmlElement.function! } + private enum Keys { + static let version: JSString = "version" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _version = ReadWriteAttribute(jsObject: jsObject, name: "version") + _version = ReadWriteAttribute(jsObject: jsObject, name: Keys.version) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift index 607250ba..28cd7ac6 100644 --- a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift +++ b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift @@ -3,57 +3,71 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let `protocol`: JSString = "protocol" + static let pathname: JSString = "pathname" + static let password: JSString = "password" + static let origin: JSString = "origin" + static let username: JSString = "username" + static let hash: JSString = "hash" + static let href: JSString = "href" + static let host: JSString = "host" + static let hostname: JSString = "hostname" + static let port: JSString = "port" + static let search: JSString = "search" +} + public protocol HTMLHyperlinkElementUtils: JSBridgedClass {} public extension HTMLHyperlinkElementUtils { var href: String { - get { ReadWriteAttribute["href", in: jsObject] } - set { ReadWriteAttribute["href", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.href, in: jsObject] } + set { ReadWriteAttribute[Keys.href, in: jsObject] = newValue } } - var origin: String { ReadonlyAttribute["origin", in: jsObject] } + var origin: String { ReadonlyAttribute[Keys.origin, in: jsObject] } var `protocol`: String { - get { ReadWriteAttribute["protocol", in: jsObject] } - set { ReadWriteAttribute["protocol", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.protocol, in: jsObject] } + set { ReadWriteAttribute[Keys.protocol, in: jsObject] = newValue } } var username: String { - get { ReadWriteAttribute["username", in: jsObject] } - set { ReadWriteAttribute["username", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.username, in: jsObject] } + set { ReadWriteAttribute[Keys.username, in: jsObject] = newValue } } var password: String { - get { ReadWriteAttribute["password", in: jsObject] } - set { ReadWriteAttribute["password", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.password, in: jsObject] } + set { ReadWriteAttribute[Keys.password, in: jsObject] = newValue } } var host: String { - get { ReadWriteAttribute["host", in: jsObject] } - set { ReadWriteAttribute["host", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.host, in: jsObject] } + set { ReadWriteAttribute[Keys.host, in: jsObject] = newValue } } var hostname: String { - get { ReadWriteAttribute["hostname", in: jsObject] } - set { ReadWriteAttribute["hostname", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.hostname, in: jsObject] } + set { ReadWriteAttribute[Keys.hostname, in: jsObject] = newValue } } var port: String { - get { ReadWriteAttribute["port", in: jsObject] } - set { ReadWriteAttribute["port", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.port, in: jsObject] } + set { ReadWriteAttribute[Keys.port, in: jsObject] = newValue } } var pathname: String { - get { ReadWriteAttribute["pathname", in: jsObject] } - set { ReadWriteAttribute["pathname", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.pathname, in: jsObject] } + set { ReadWriteAttribute[Keys.pathname, in: jsObject] = newValue } } var search: String { - get { ReadWriteAttribute["search", in: jsObject] } - set { ReadWriteAttribute["search", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.search, in: jsObject] } + set { ReadWriteAttribute[Keys.search, in: jsObject] = newValue } } var hash: String { - get { ReadWriteAttribute["hash", in: jsObject] } - set { ReadWriteAttribute["hash", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.hash, in: jsObject] } + set { ReadWriteAttribute[Keys.hash, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index 3eee22c5..5cf217c2 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -6,25 +6,47 @@ import JavaScriptKit public class HTMLIFrameElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLIFrameElement.function! } + private enum Keys { + static let frameBorder: JSString = "frameBorder" + static let sandbox: JSString = "sandbox" + static let contentWindow: JSString = "contentWindow" + static let referrerPolicy: JSString = "referrerPolicy" + static let allowFullscreen: JSString = "allowFullscreen" + static let contentDocument: JSString = "contentDocument" + static let marginWidth: JSString = "marginWidth" + static let getSVGDocument: JSString = "getSVGDocument" + static let height: JSString = "height" + static let src: JSString = "src" + static let loading: JSString = "loading" + static let align: JSString = "align" + static let scrolling: JSString = "scrolling" + static let longDesc: JSString = "longDesc" + static let marginHeight: JSString = "marginHeight" + static let width: JSString = "width" + static let srcdoc: JSString = "srcdoc" + static let name: JSString = "name" + static let allow: JSString = "allow" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: "src") - _srcdoc = ReadWriteAttribute(jsObject: jsObject, name: "srcdoc") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _sandbox = ReadonlyAttribute(jsObject: jsObject, name: "sandbox") - _allow = ReadWriteAttribute(jsObject: jsObject, name: "allow") - _allowFullscreen = ReadWriteAttribute(jsObject: jsObject, name: "allowFullscreen") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") - _loading = ReadWriteAttribute(jsObject: jsObject, name: "loading") - _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: "contentDocument") - _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: "contentWindow") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _scrolling = ReadWriteAttribute(jsObject: jsObject, name: "scrolling") - _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: "frameBorder") - _longDesc = ReadWriteAttribute(jsObject: jsObject, name: "longDesc") - _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: "marginHeight") - _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: "marginWidth") + _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) + _srcdoc = ReadWriteAttribute(jsObject: jsObject, name: Keys.srcdoc) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _sandbox = ReadonlyAttribute(jsObject: jsObject, name: Keys.sandbox) + _allow = ReadWriteAttribute(jsObject: jsObject, name: Keys.allow) + _allowFullscreen = ReadWriteAttribute(jsObject: jsObject, name: Keys.allowFullscreen) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) + _loading = ReadWriteAttribute(jsObject: jsObject, name: Keys.loading) + _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentDocument) + _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentWindow) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _scrolling = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrolling) + _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: Keys.frameBorder) + _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Keys.longDesc) + _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Keys.marginHeight) + _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Keys.marginWidth) super.init(unsafelyWrapping: jsObject) } @@ -69,7 +91,7 @@ public class HTMLIFrameElement: HTMLElement { public var contentWindow: WindowProxy? public func getSVGDocument() -> Document? { - jsObject["getSVGDocument"]!().fromJSValue()! + jsObject[Keys.getSVGDocument]!().fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index 03ffdc25..659c1b76 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -6,30 +6,57 @@ import JavaScriptKit public class HTMLImageElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLImageElement.function! } + private enum Keys { + static let useMap: JSString = "useMap" + static let decoding: JSString = "decoding" + static let naturalHeight: JSString = "naturalHeight" + static let sizes: JSString = "sizes" + static let alt: JSString = "alt" + static let lowsrc: JSString = "lowsrc" + static let vspace: JSString = "vspace" + static let currentSrc: JSString = "currentSrc" + static let longDesc: JSString = "longDesc" + static let referrerPolicy: JSString = "referrerPolicy" + static let src: JSString = "src" + static let hspace: JSString = "hspace" + static let border: JSString = "border" + static let decode: JSString = "decode" + static let srcset: JSString = "srcset" + static let width: JSString = "width" + static let name: JSString = "name" + static let complete: JSString = "complete" + static let loading: JSString = "loading" + static let height: JSString = "height" + static let naturalWidth: JSString = "naturalWidth" + static let crossOrigin: JSString = "crossOrigin" + static let align: JSString = "align" + static let isMap: JSString = "isMap" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _alt = ReadWriteAttribute(jsObject: jsObject, name: "alt") - _src = ReadWriteAttribute(jsObject: jsObject, name: "src") - _srcset = ReadWriteAttribute(jsObject: jsObject, name: "srcset") - _sizes = ReadWriteAttribute(jsObject: jsObject, name: "sizes") - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: "crossOrigin") - _useMap = ReadWriteAttribute(jsObject: jsObject, name: "useMap") - _isMap = ReadWriteAttribute(jsObject: jsObject, name: "isMap") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") - _naturalWidth = ReadonlyAttribute(jsObject: jsObject, name: "naturalWidth") - _naturalHeight = ReadonlyAttribute(jsObject: jsObject, name: "naturalHeight") - _complete = ReadonlyAttribute(jsObject: jsObject, name: "complete") - _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: "currentSrc") - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") - _decoding = ReadWriteAttribute(jsObject: jsObject, name: "decoding") - _loading = ReadWriteAttribute(jsObject: jsObject, name: "loading") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _lowsrc = ReadWriteAttribute(jsObject: jsObject, name: "lowsrc") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _hspace = ReadWriteAttribute(jsObject: jsObject, name: "hspace") - _vspace = ReadWriteAttribute(jsObject: jsObject, name: "vspace") - _longDesc = ReadWriteAttribute(jsObject: jsObject, name: "longDesc") - _border = ReadWriteAttribute(jsObject: jsObject, name: "border") + _alt = ReadWriteAttribute(jsObject: jsObject, name: Keys.alt) + _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) + _srcset = ReadWriteAttribute(jsObject: jsObject, name: Keys.srcset) + _sizes = ReadWriteAttribute(jsObject: jsObject, name: Keys.sizes) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Keys.crossOrigin) + _useMap = ReadWriteAttribute(jsObject: jsObject, name: Keys.useMap) + _isMap = ReadWriteAttribute(jsObject: jsObject, name: Keys.isMap) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _naturalWidth = ReadonlyAttribute(jsObject: jsObject, name: Keys.naturalWidth) + _naturalHeight = ReadonlyAttribute(jsObject: jsObject, name: Keys.naturalHeight) + _complete = ReadonlyAttribute(jsObject: jsObject, name: Keys.complete) + _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: Keys.currentSrc) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) + _decoding = ReadWriteAttribute(jsObject: jsObject, name: Keys.decoding) + _loading = ReadWriteAttribute(jsObject: jsObject, name: Keys.loading) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _lowsrc = ReadWriteAttribute(jsObject: jsObject, name: Keys.lowsrc) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _hspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.hspace) + _vspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.vspace) + _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Keys.longDesc) + _border = ReadWriteAttribute(jsObject: jsObject, name: Keys.border) super.init(unsafelyWrapping: jsObject) } @@ -86,12 +113,12 @@ public class HTMLImageElement: HTMLElement { public var loading: String public func decode() -> JSPromise { - jsObject["decode"]!().fromJSValue()! + jsObject[Keys.decode]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func decode() async throws { - let _promise: JSPromise = jsObject["decode"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.decode]!().fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index 8a0f666c..657f6de9 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -6,52 +6,109 @@ import JavaScriptKit public class HTMLInputElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLInputElement.function! } + private enum Keys { + static let minLength: JSString = "minLength" + static let align: JSString = "align" + static let step: JSString = "step" + static let valueAsDate: JSString = "valueAsDate" + static let formNoValidate: JSString = "formNoValidate" + static let formTarget: JSString = "formTarget" + static let list: JSString = "list" + static let indeterminate: JSString = "indeterminate" + static let form: JSString = "form" + static let disabled: JSString = "disabled" + static let labels: JSString = "labels" + static let placeholder: JSString = "placeholder" + static let min: JSString = "min" + static let willValidate: JSString = "willValidate" + static let stepDown: JSString = "stepDown" + static let formAction: JSString = "formAction" + static let setSelectionRange: JSString = "setSelectionRange" + static let checkValidity: JSString = "checkValidity" + static let dirName: JSString = "dirName" + static let height: JSString = "height" + static let readOnly: JSString = "readOnly" + static let pattern: JSString = "pattern" + static let defaultChecked: JSString = "defaultChecked" + static let showPicker: JSString = "showPicker" + static let alt: JSString = "alt" + static let useMap: JSString = "useMap" + static let size: JSString = "size" + static let value: JSString = "value" + static let formMethod: JSString = "formMethod" + static let selectionDirection: JSString = "selectionDirection" + static let maxLength: JSString = "maxLength" + static let type: JSString = "type" + static let select: JSString = "select" + static let formEnctype: JSString = "formEnctype" + static let defaultValue: JSString = "defaultValue" + static let validity: JSString = "validity" + static let required: JSString = "required" + static let valueAsNumber: JSString = "valueAsNumber" + static let width: JSString = "width" + static let reportValidity: JSString = "reportValidity" + static let checked: JSString = "checked" + static let validationMessage: JSString = "validationMessage" + static let setCustomValidity: JSString = "setCustomValidity" + static let selectionStart: JSString = "selectionStart" + static let accept: JSString = "accept" + static let files: JSString = "files" + static let setRangeText: JSString = "setRangeText" + static let name: JSString = "name" + static let max: JSString = "max" + static let multiple: JSString = "multiple" + static let selectionEnd: JSString = "selectionEnd" + static let src: JSString = "src" + static let stepUp: JSString = "stepUp" + static let autocomplete: JSString = "autocomplete" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _accept = ReadWriteAttribute(jsObject: jsObject, name: "accept") - _alt = ReadWriteAttribute(jsObject: jsObject, name: "alt") - _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: "autocomplete") - _defaultChecked = ReadWriteAttribute(jsObject: jsObject, name: "defaultChecked") - _checked = ReadWriteAttribute(jsObject: jsObject, name: "checked") - _dirName = ReadWriteAttribute(jsObject: jsObject, name: "dirName") - _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _files = ReadWriteAttribute(jsObject: jsObject, name: "files") - _formAction = ReadWriteAttribute(jsObject: jsObject, name: "formAction") - _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: "formEnctype") - _formMethod = ReadWriteAttribute(jsObject: jsObject, name: "formMethod") - _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: "formNoValidate") - _formTarget = ReadWriteAttribute(jsObject: jsObject, name: "formTarget") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") - _indeterminate = ReadWriteAttribute(jsObject: jsObject, name: "indeterminate") - _list = ReadonlyAttribute(jsObject: jsObject, name: "list") - _max = ReadWriteAttribute(jsObject: jsObject, name: "max") - _maxLength = ReadWriteAttribute(jsObject: jsObject, name: "maxLength") - _min = ReadWriteAttribute(jsObject: jsObject, name: "min") - _minLength = ReadWriteAttribute(jsObject: jsObject, name: "minLength") - _multiple = ReadWriteAttribute(jsObject: jsObject, name: "multiple") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _pattern = ReadWriteAttribute(jsObject: jsObject, name: "pattern") - _placeholder = ReadWriteAttribute(jsObject: jsObject, name: "placeholder") - _readOnly = ReadWriteAttribute(jsObject: jsObject, name: "readOnly") - _required = ReadWriteAttribute(jsObject: jsObject, name: "required") - _size = ReadWriteAttribute(jsObject: jsObject, name: "size") - _src = ReadWriteAttribute(jsObject: jsObject, name: "src") - _step = ReadWriteAttribute(jsObject: jsObject, name: "step") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: "defaultValue") - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _valueAsDate = ReadWriteAttribute(jsObject: jsObject, name: "valueAsDate") - _valueAsNumber = ReadWriteAttribute(jsObject: jsObject, name: "valueAsNumber") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") - _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") - _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") - _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: "selectionStart") - _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: "selectionEnd") - _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: "selectionDirection") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _useMap = ReadWriteAttribute(jsObject: jsObject, name: "useMap") + _accept = ReadWriteAttribute(jsObject: jsObject, name: Keys.accept) + _alt = ReadWriteAttribute(jsObject: jsObject, name: Keys.alt) + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocomplete) + _defaultChecked = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultChecked) + _checked = ReadWriteAttribute(jsObject: jsObject, name: Keys.checked) + _dirName = ReadWriteAttribute(jsObject: jsObject, name: Keys.dirName) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _files = ReadWriteAttribute(jsObject: jsObject, name: Keys.files) + _formAction = ReadWriteAttribute(jsObject: jsObject, name: Keys.formAction) + _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: Keys.formEnctype) + _formMethod = ReadWriteAttribute(jsObject: jsObject, name: Keys.formMethod) + _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: Keys.formNoValidate) + _formTarget = ReadWriteAttribute(jsObject: jsObject, name: Keys.formTarget) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _indeterminate = ReadWriteAttribute(jsObject: jsObject, name: Keys.indeterminate) + _list = ReadonlyAttribute(jsObject: jsObject, name: Keys.list) + _max = ReadWriteAttribute(jsObject: jsObject, name: Keys.max) + _maxLength = ReadWriteAttribute(jsObject: jsObject, name: Keys.maxLength) + _min = ReadWriteAttribute(jsObject: jsObject, name: Keys.min) + _minLength = ReadWriteAttribute(jsObject: jsObject, name: Keys.minLength) + _multiple = ReadWriteAttribute(jsObject: jsObject, name: Keys.multiple) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _pattern = ReadWriteAttribute(jsObject: jsObject, name: Keys.pattern) + _placeholder = ReadWriteAttribute(jsObject: jsObject, name: Keys.placeholder) + _readOnly = ReadWriteAttribute(jsObject: jsObject, name: Keys.readOnly) + _required = ReadWriteAttribute(jsObject: jsObject, name: Keys.required) + _size = ReadWriteAttribute(jsObject: jsObject, name: Keys.size) + _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) + _step = ReadWriteAttribute(jsObject: jsObject, name: Keys.step) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultValue) + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _valueAsDate = ReadWriteAttribute(jsObject: jsObject, name: Keys.valueAsDate) + _valueAsNumber = ReadWriteAttribute(jsObject: jsObject, name: Keys.valueAsNumber) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) + _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionStart) + _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionEnd) + _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionDirection) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _useMap = ReadWriteAttribute(jsObject: jsObject, name: Keys.useMap) super.init(unsafelyWrapping: jsObject) } @@ -168,11 +225,11 @@ public class HTMLInputElement: HTMLElement { public var width: UInt32 public func stepUp(n: Int32? = nil) { - _ = jsObject["stepUp"]!(n?.jsValue() ?? .undefined) + _ = jsObject[Keys.stepUp]!(n?.jsValue() ?? .undefined) } public func stepDown(n: Int32? = nil) { - _ = jsObject["stepDown"]!(n?.jsValue() ?? .undefined) + _ = jsObject[Keys.stepDown]!(n?.jsValue() ?? .undefined) } @ReadonlyAttribute @@ -185,22 +242,22 @@ public class HTMLInputElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject["checkValidity"]!().fromJSValue()! + jsObject[Keys.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject["reportValidity"]!().fromJSValue()! + jsObject[Keys.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject["setCustomValidity"]!(error.jsValue()) + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute public var labels: NodeList? public func select() { - _ = jsObject["select"]!() + _ = jsObject[Keys.select]!() } @ReadWriteAttribute @@ -213,19 +270,19 @@ public class HTMLInputElement: HTMLElement { public var selectionDirection: String? public func setRangeText(replacement: String) { - _ = jsObject["setRangeText"]!(replacement.jsValue()) + _ = jsObject[Keys.setRangeText]!(replacement.jsValue()) } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - _ = jsObject["setRangeText"]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + _ = jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - _ = jsObject["setSelectionRange"]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + _ = jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) } public func showPicker() { - _ = jsObject["showPicker"]!() + _ = jsObject[Keys.showPicker]!() } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLLIElement.swift b/Sources/DOMKit/WebIDL/HTMLLIElement.swift index 52ee330f..dd1b84ce 100644 --- a/Sources/DOMKit/WebIDL/HTMLLIElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLIElement.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class HTMLLIElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLLIElement.function! } + private enum Keys { + static let type: JSString = "type" + static let value: JSString = "value" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift index 3ade7c41..e07aa9a9 100644 --- a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class HTMLLabelElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLLabelElement.function! } + private enum Keys { + static let htmlFor: JSString = "htmlFor" + static let control: JSString = "control" + static let form: JSString = "form" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: "htmlFor") - _control = ReadonlyAttribute(jsObject: jsObject, name: "control") + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: Keys.htmlFor) + _control = ReadonlyAttribute(jsObject: jsObject, name: Keys.control) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift index 676b84ed..d262b5b4 100644 --- a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class HTMLLegendElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLLegendElement.function! } + private enum Keys { + static let align: JSString = "align" + static let form: JSString = "form" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift index 0c13380c..84cf843c 100644 --- a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift @@ -6,25 +6,46 @@ import JavaScriptKit public class HTMLLinkElement: HTMLElement, LinkStyle { override public class var constructor: JSFunction { JSObject.global.HTMLLinkElement.function! } + private enum Keys { + static let type: JSString = "type" + static let hreflang: JSString = "hreflang" + static let charset: JSString = "charset" + static let target: JSString = "target" + static let rev: JSString = "rev" + static let href: JSString = "href" + static let media: JSString = "media" + static let relList: JSString = "relList" + static let imageSizes: JSString = "imageSizes" + static let crossOrigin: JSString = "crossOrigin" + static let blocking: JSString = "blocking" + static let referrerPolicy: JSString = "referrerPolicy" + static let `as`: JSString = "as" + static let integrity: JSString = "integrity" + static let rel: JSString = "rel" + static let sizes: JSString = "sizes" + static let imageSrcset: JSString = "imageSrcset" + static let disabled: JSString = "disabled" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadWriteAttribute(jsObject: jsObject, name: "href") - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: "crossOrigin") - _rel = ReadWriteAttribute(jsObject: jsObject, name: "rel") - _as = ReadWriteAttribute(jsObject: jsObject, name: "as") - _relList = ReadonlyAttribute(jsObject: jsObject, name: "relList") - _media = ReadWriteAttribute(jsObject: jsObject, name: "media") - _integrity = ReadWriteAttribute(jsObject: jsObject, name: "integrity") - _hreflang = ReadWriteAttribute(jsObject: jsObject, name: "hreflang") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _sizes = ReadonlyAttribute(jsObject: jsObject, name: "sizes") - _imageSrcset = ReadWriteAttribute(jsObject: jsObject, name: "imageSrcset") - _imageSizes = ReadWriteAttribute(jsObject: jsObject, name: "imageSizes") - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") - _blocking = ReadonlyAttribute(jsObject: jsObject, name: "blocking") - _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") - _charset = ReadWriteAttribute(jsObject: jsObject, name: "charset") - _rev = ReadWriteAttribute(jsObject: jsObject, name: "rev") - _target = ReadWriteAttribute(jsObject: jsObject, name: "target") + _href = ReadWriteAttribute(jsObject: jsObject, name: Keys.href) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Keys.crossOrigin) + _rel = ReadWriteAttribute(jsObject: jsObject, name: Keys.rel) + _as = ReadWriteAttribute(jsObject: jsObject, name: Keys.as) + _relList = ReadonlyAttribute(jsObject: jsObject, name: Keys.relList) + _media = ReadWriteAttribute(jsObject: jsObject, name: Keys.media) + _integrity = ReadWriteAttribute(jsObject: jsObject, name: Keys.integrity) + _hreflang = ReadWriteAttribute(jsObject: jsObject, name: Keys.hreflang) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _sizes = ReadonlyAttribute(jsObject: jsObject, name: Keys.sizes) + _imageSrcset = ReadWriteAttribute(jsObject: jsObject, name: Keys.imageSrcset) + _imageSizes = ReadWriteAttribute(jsObject: jsObject, name: Keys.imageSizes) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) + _blocking = ReadonlyAttribute(jsObject: jsObject, name: Keys.blocking) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) + _charset = ReadWriteAttribute(jsObject: jsObject, name: Keys.charset) + _rev = ReadWriteAttribute(jsObject: jsObject, name: Keys.rev) + _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLMapElement.swift b/Sources/DOMKit/WebIDL/HTMLMapElement.swift index 90a13273..4c286c3b 100644 --- a/Sources/DOMKit/WebIDL/HTMLMapElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMapElement.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class HTMLMapElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMapElement.function! } + private enum Keys { + static let areas: JSString = "areas" + static let name: JSString = "name" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _areas = ReadonlyAttribute(jsObject: jsObject, name: "areas") + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _areas = ReadonlyAttribute(jsObject: jsObject, name: Keys.areas) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift index 3f050653..2c1767ca 100644 --- a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift @@ -6,18 +6,34 @@ import JavaScriptKit public class HTMLMarqueeElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMarqueeElement.function! } + private enum Keys { + static let behavior: JSString = "behavior" + static let width: JSString = "width" + static let loop: JSString = "loop" + static let scrollDelay: JSString = "scrollDelay" + static let direction: JSString = "direction" + static let bgColor: JSString = "bgColor" + static let hspace: JSString = "hspace" + static let start: JSString = "start" + static let trueSpeed: JSString = "trueSpeed" + static let vspace: JSString = "vspace" + static let stop: JSString = "stop" + static let height: JSString = "height" + static let scrollAmount: JSString = "scrollAmount" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _behavior = ReadWriteAttribute(jsObject: jsObject, name: "behavior") - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") - _direction = ReadWriteAttribute(jsObject: jsObject, name: "direction") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") - _hspace = ReadWriteAttribute(jsObject: jsObject, name: "hspace") - _loop = ReadWriteAttribute(jsObject: jsObject, name: "loop") - _scrollAmount = ReadWriteAttribute(jsObject: jsObject, name: "scrollAmount") - _scrollDelay = ReadWriteAttribute(jsObject: jsObject, name: "scrollDelay") - _trueSpeed = ReadWriteAttribute(jsObject: jsObject, name: "trueSpeed") - _vspace = ReadWriteAttribute(jsObject: jsObject, name: "vspace") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _behavior = ReadWriteAttribute(jsObject: jsObject, name: Keys.behavior) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) + _direction = ReadWriteAttribute(jsObject: jsObject, name: Keys.direction) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _hspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.hspace) + _loop = ReadWriteAttribute(jsObject: jsObject, name: Keys.loop) + _scrollAmount = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrollAmount) + _scrollDelay = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrollDelay) + _trueSpeed = ReadWriteAttribute(jsObject: jsObject, name: Keys.trueSpeed) + _vspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.vspace) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) super.init(unsafelyWrapping: jsObject) } @@ -59,10 +75,10 @@ public class HTMLMarqueeElement: HTMLElement { public var width: String public func start() { - _ = jsObject["start"]!() + _ = jsObject[Keys.start]!() } public func stop() { - _ = jsObject["stop"]!() + _ = jsObject[Keys.stop]!() } } diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index d0da3e59..e67b9171 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -6,35 +6,82 @@ import JavaScriptKit public class HTMLMediaElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMediaElement.function! } + private enum Keys { + static let currentTime: JSString = "currentTime" + static let NETWORK_NO_SOURCE: JSString = "NETWORK_NO_SOURCE" + static let HAVE_NOTHING: JSString = "HAVE_NOTHING" + static let buffered: JSString = "buffered" + static let NETWORK_IDLE: JSString = "NETWORK_IDLE" + static let paused: JSString = "paused" + static let play: JSString = "play" + static let preload: JSString = "preload" + static let seekable: JSString = "seekable" + static let currentSrc: JSString = "currentSrc" + static let fastSeek: JSString = "fastSeek" + static let audioTracks: JSString = "audioTracks" + static let volume: JSString = "volume" + static let networkState: JSString = "networkState" + static let getStartDate: JSString = "getStartDate" + static let HAVE_ENOUGH_DATA: JSString = "HAVE_ENOUGH_DATA" + static let playbackRate: JSString = "playbackRate" + static let addTextTrack: JSString = "addTextTrack" + static let seeking: JSString = "seeking" + static let canPlayType: JSString = "canPlayType" + static let duration: JSString = "duration" + static let defaultPlaybackRate: JSString = "defaultPlaybackRate" + static let loop: JSString = "loop" + static let pause: JSString = "pause" + static let HAVE_METADATA: JSString = "HAVE_METADATA" + static let textTracks: JSString = "textTracks" + static let HAVE_CURRENT_DATA: JSString = "HAVE_CURRENT_DATA" + static let NETWORK_EMPTY: JSString = "NETWORK_EMPTY" + static let preservesPitch: JSString = "preservesPitch" + static let muted: JSString = "muted" + static let src: JSString = "src" + static let load: JSString = "load" + static let HAVE_FUTURE_DATA: JSString = "HAVE_FUTURE_DATA" + static let played: JSString = "played" + static let error: JSString = "error" + static let srcObject: JSString = "srcObject" + static let controls: JSString = "controls" + static let NETWORK_LOADING: JSString = "NETWORK_LOADING" + static let autoplay: JSString = "autoplay" + static let readyState: JSString = "readyState" + static let ended: JSString = "ended" + static let defaultMuted: JSString = "defaultMuted" + static let videoTracks: JSString = "videoTracks" + static let crossOrigin: JSString = "crossOrigin" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _error = ReadonlyAttribute(jsObject: jsObject, name: "error") - _src = ReadWriteAttribute(jsObject: jsObject, name: "src") - _srcObject = ReadWriteAttribute(jsObject: jsObject, name: "srcObject") - _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: "currentSrc") - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: "crossOrigin") - _networkState = ReadonlyAttribute(jsObject: jsObject, name: "networkState") - _preload = ReadWriteAttribute(jsObject: jsObject, name: "preload") - _buffered = ReadonlyAttribute(jsObject: jsObject, name: "buffered") - _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") - _seeking = ReadonlyAttribute(jsObject: jsObject, name: "seeking") - _currentTime = ReadWriteAttribute(jsObject: jsObject, name: "currentTime") - _duration = ReadonlyAttribute(jsObject: jsObject, name: "duration") - _paused = ReadonlyAttribute(jsObject: jsObject, name: "paused") - _defaultPlaybackRate = ReadWriteAttribute(jsObject: jsObject, name: "defaultPlaybackRate") - _playbackRate = ReadWriteAttribute(jsObject: jsObject, name: "playbackRate") - _preservesPitch = ReadWriteAttribute(jsObject: jsObject, name: "preservesPitch") - _played = ReadonlyAttribute(jsObject: jsObject, name: "played") - _seekable = ReadonlyAttribute(jsObject: jsObject, name: "seekable") - _ended = ReadonlyAttribute(jsObject: jsObject, name: "ended") - _autoplay = ReadWriteAttribute(jsObject: jsObject, name: "autoplay") - _loop = ReadWriteAttribute(jsObject: jsObject, name: "loop") - _controls = ReadWriteAttribute(jsObject: jsObject, name: "controls") - _volume = ReadWriteAttribute(jsObject: jsObject, name: "volume") - _muted = ReadWriteAttribute(jsObject: jsObject, name: "muted") - _defaultMuted = ReadWriteAttribute(jsObject: jsObject, name: "defaultMuted") - _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: "audioTracks") - _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: "videoTracks") - _textTracks = ReadonlyAttribute(jsObject: jsObject, name: "textTracks") + _error = ReadonlyAttribute(jsObject: jsObject, name: Keys.error) + _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) + _srcObject = ReadWriteAttribute(jsObject: jsObject, name: Keys.srcObject) + _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: Keys.currentSrc) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Keys.crossOrigin) + _networkState = ReadonlyAttribute(jsObject: jsObject, name: Keys.networkState) + _preload = ReadWriteAttribute(jsObject: jsObject, name: Keys.preload) + _buffered = ReadonlyAttribute(jsObject: jsObject, name: Keys.buffered) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) + _seeking = ReadonlyAttribute(jsObject: jsObject, name: Keys.seeking) + _currentTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.currentTime) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Keys.duration) + _paused = ReadonlyAttribute(jsObject: jsObject, name: Keys.paused) + _defaultPlaybackRate = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultPlaybackRate) + _playbackRate = ReadWriteAttribute(jsObject: jsObject, name: Keys.playbackRate) + _preservesPitch = ReadWriteAttribute(jsObject: jsObject, name: Keys.preservesPitch) + _played = ReadonlyAttribute(jsObject: jsObject, name: Keys.played) + _seekable = ReadonlyAttribute(jsObject: jsObject, name: Keys.seekable) + _ended = ReadonlyAttribute(jsObject: jsObject, name: Keys.ended) + _autoplay = ReadWriteAttribute(jsObject: jsObject, name: Keys.autoplay) + _loop = ReadWriteAttribute(jsObject: jsObject, name: Keys.loop) + _controls = ReadWriteAttribute(jsObject: jsObject, name: Keys.controls) + _volume = ReadWriteAttribute(jsObject: jsObject, name: Keys.volume) + _muted = ReadWriteAttribute(jsObject: jsObject, name: Keys.muted) + _defaultMuted = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultMuted) + _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: Keys.audioTracks) + _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: Keys.videoTracks) + _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Keys.textTracks) super.init(unsafelyWrapping: jsObject) } @@ -71,11 +118,11 @@ public class HTMLMediaElement: HTMLElement { public var buffered: TimeRanges public func load() { - _ = jsObject["load"]!() + _ = jsObject[Keys.load]!() } public func canPlayType(type: String) -> CanPlayTypeResult { - jsObject["canPlayType"]!(type.jsValue()).fromJSValue()! + jsObject[Keys.canPlayType]!(type.jsValue()).fromJSValue()! } public static let HAVE_NOTHING: UInt16 = 0 @@ -98,14 +145,14 @@ public class HTMLMediaElement: HTMLElement { public var currentTime: Double public func fastSeek(time: Double) { - _ = jsObject["fastSeek"]!(time.jsValue()) + _ = jsObject[Keys.fastSeek]!(time.jsValue()) } @ReadonlyAttribute public var duration: Double public func getStartDate() -> JSObject { - jsObject["getStartDate"]!().fromJSValue()! + jsObject[Keys.getStartDate]!().fromJSValue()! } @ReadonlyAttribute @@ -136,17 +183,17 @@ public class HTMLMediaElement: HTMLElement { public var loop: Bool public func play() -> JSPromise { - jsObject["play"]!().fromJSValue()! + jsObject[Keys.play]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func play() async throws { - let _promise: JSPromise = jsObject["play"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.play]!().fromJSValue()! _ = try await _promise.get() } public func pause() { - _ = jsObject["pause"]!() + _ = jsObject[Keys.pause]!() } @ReadWriteAttribute @@ -171,6 +218,6 @@ public class HTMLMediaElement: HTMLElement { public var textTracks: TextTrackList public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { - jsObject["addTextTrack"]!(kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.addTextTrack]!(kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift index 40e3c1f1..00ea25d1 100644 --- a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLMenuElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMenuElement.function! } + private enum Keys { + static let compact: JSString = "compact" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") + _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift index 517c5dfb..c9a710a3 100644 --- a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift @@ -6,12 +6,20 @@ import JavaScriptKit public class HTMLMetaElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMetaElement.function! } + private enum Keys { + static let name: JSString = "name" + static let scheme: JSString = "scheme" + static let content: JSString = "content" + static let httpEquiv: JSString = "httpEquiv" + static let media: JSString = "media" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _httpEquiv = ReadWriteAttribute(jsObject: jsObject, name: "httpEquiv") - _content = ReadWriteAttribute(jsObject: jsObject, name: "content") - _media = ReadWriteAttribute(jsObject: jsObject, name: "media") - _scheme = ReadWriteAttribute(jsObject: jsObject, name: "scheme") + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _httpEquiv = ReadWriteAttribute(jsObject: jsObject, name: Keys.httpEquiv) + _content = ReadWriteAttribute(jsObject: jsObject, name: Keys.content) + _media = ReadWriteAttribute(jsObject: jsObject, name: Keys.media) + _scheme = ReadWriteAttribute(jsObject: jsObject, name: Keys.scheme) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift index f7867bd5..58285d7a 100644 --- a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift @@ -6,14 +6,24 @@ import JavaScriptKit public class HTMLMeterElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMeterElement.function! } + private enum Keys { + static let optimum: JSString = "optimum" + static let value: JSString = "value" + static let min: JSString = "min" + static let low: JSString = "low" + static let max: JSString = "max" + static let high: JSString = "high" + static let labels: JSString = "labels" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _min = ReadWriteAttribute(jsObject: jsObject, name: "min") - _max = ReadWriteAttribute(jsObject: jsObject, name: "max") - _low = ReadWriteAttribute(jsObject: jsObject, name: "low") - _high = ReadWriteAttribute(jsObject: jsObject, name: "high") - _optimum = ReadWriteAttribute(jsObject: jsObject, name: "optimum") - _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _min = ReadWriteAttribute(jsObject: jsObject, name: Keys.min) + _max = ReadWriteAttribute(jsObject: jsObject, name: Keys.max) + _low = ReadWriteAttribute(jsObject: jsObject, name: Keys.low) + _high = ReadWriteAttribute(jsObject: jsObject, name: Keys.high) + _optimum = ReadWriteAttribute(jsObject: jsObject, name: Keys.optimum) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLModElement.swift b/Sources/DOMKit/WebIDL/HTMLModElement.swift index 35d49220..9a7dc9e0 100644 --- a/Sources/DOMKit/WebIDL/HTMLModElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLModElement.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class HTMLModElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLModElement.function! } + private enum Keys { + static let dateTime: JSString = "dateTime" + static let cite: JSString = "cite" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _cite = ReadWriteAttribute(jsObject: jsObject, name: "cite") - _dateTime = ReadWriteAttribute(jsObject: jsObject, name: "dateTime") + _cite = ReadWriteAttribute(jsObject: jsObject, name: Keys.cite) + _dateTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.dateTime) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLOListElement.swift b/Sources/DOMKit/WebIDL/HTMLOListElement.swift index a8cc81ff..7533883f 100644 --- a/Sources/DOMKit/WebIDL/HTMLOListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOListElement.swift @@ -6,11 +6,18 @@ import JavaScriptKit public class HTMLOListElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOListElement.function! } + private enum Keys { + static let type: JSString = "type" + static let compact: JSString = "compact" + static let start: JSString = "start" + static let reversed: JSString = "reversed" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _reversed = ReadWriteAttribute(jsObject: jsObject, name: "reversed") - _start = ReadWriteAttribute(jsObject: jsObject, name: "start") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") + _reversed = ReadWriteAttribute(jsObject: jsObject, name: Keys.reversed) + _start = ReadWriteAttribute(jsObject: jsObject, name: Keys.start) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift index 4fb88174..10ff6ec6 100644 --- a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -6,29 +6,58 @@ import JavaScriptKit public class HTMLObjectElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLObjectElement.function! } + private enum Keys { + static let hspace: JSString = "hspace" + static let archive: JSString = "archive" + static let type: JSString = "type" + static let contentWindow: JSString = "contentWindow" + static let reportValidity: JSString = "reportValidity" + static let getSVGDocument: JSString = "getSVGDocument" + static let validity: JSString = "validity" + static let height: JSString = "height" + static let validationMessage: JSString = "validationMessage" + static let standby: JSString = "standby" + static let contentDocument: JSString = "contentDocument" + static let codeType: JSString = "codeType" + static let border: JSString = "border" + static let code: JSString = "code" + static let declare: JSString = "declare" + static let setCustomValidity: JSString = "setCustomValidity" + static let checkValidity: JSString = "checkValidity" + static let width: JSString = "width" + static let form: JSString = "form" + static let useMap: JSString = "useMap" + static let align: JSString = "align" + static let vspace: JSString = "vspace" + static let willValidate: JSString = "willValidate" + static let name: JSString = "name" + static let codeBase: JSString = "codeBase" + static let data: JSString = "data" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadWriteAttribute(jsObject: jsObject, name: "data") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") - _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: "contentDocument") - _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: "contentWindow") - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") - _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _archive = ReadWriteAttribute(jsObject: jsObject, name: "archive") - _code = ReadWriteAttribute(jsObject: jsObject, name: "code") - _declare = ReadWriteAttribute(jsObject: jsObject, name: "declare") - _hspace = ReadWriteAttribute(jsObject: jsObject, name: "hspace") - _standby = ReadWriteAttribute(jsObject: jsObject, name: "standby") - _vspace = ReadWriteAttribute(jsObject: jsObject, name: "vspace") - _codeBase = ReadWriteAttribute(jsObject: jsObject, name: "codeBase") - _codeType = ReadWriteAttribute(jsObject: jsObject, name: "codeType") - _useMap = ReadWriteAttribute(jsObject: jsObject, name: "useMap") - _border = ReadWriteAttribute(jsObject: jsObject, name: "border") + _data = ReadWriteAttribute(jsObject: jsObject, name: Keys.data) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentDocument) + _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentWindow) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _archive = ReadWriteAttribute(jsObject: jsObject, name: Keys.archive) + _code = ReadWriteAttribute(jsObject: jsObject, name: Keys.code) + _declare = ReadWriteAttribute(jsObject: jsObject, name: Keys.declare) + _hspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.hspace) + _standby = ReadWriteAttribute(jsObject: jsObject, name: Keys.standby) + _vspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.vspace) + _codeBase = ReadWriteAttribute(jsObject: jsObject, name: Keys.codeBase) + _codeType = ReadWriteAttribute(jsObject: jsObject, name: Keys.codeType) + _useMap = ReadWriteAttribute(jsObject: jsObject, name: Keys.useMap) + _border = ReadWriteAttribute(jsObject: jsObject, name: Keys.border) super.init(unsafelyWrapping: jsObject) } @@ -61,7 +90,7 @@ public class HTMLObjectElement: HTMLElement { public var contentWindow: WindowProxy? public func getSVGDocument() -> Document? { - jsObject["getSVGDocument"]!().fromJSValue()! + jsObject[Keys.getSVGDocument]!().fromJSValue()! } @ReadonlyAttribute @@ -74,15 +103,15 @@ public class HTMLObjectElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject["checkValidity"]!().fromJSValue()! + jsObject[Keys.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject["reportValidity"]!().fromJSValue()! + jsObject[Keys.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject["setCustomValidity"]!(error.jsValue()) + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift index 4ba8a430..82da7f8f 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class HTMLOptGroupElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOptGroupElement.function! } + private enum Keys { + static let label: JSString = "label" + static let disabled: JSString = "disabled" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") - _label = ReadWriteAttribute(jsObject: jsObject, name: "label") + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) + _label = ReadWriteAttribute(jsObject: jsObject, name: Keys.label) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift index e7fefd2d..bab56806 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift @@ -6,15 +6,26 @@ import JavaScriptKit public class HTMLOptionElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOptionElement.function! } + private enum Keys { + static let selected: JSString = "selected" + static let disabled: JSString = "disabled" + static let label: JSString = "label" + static let value: JSString = "value" + static let index: JSString = "index" + static let form: JSString = "form" + static let text: JSString = "text" + static let defaultSelected: JSString = "defaultSelected" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _label = ReadWriteAttribute(jsObject: jsObject, name: "label") - _defaultSelected = ReadWriteAttribute(jsObject: jsObject, name: "defaultSelected") - _selected = ReadWriteAttribute(jsObject: jsObject, name: "selected") - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _text = ReadWriteAttribute(jsObject: jsObject, name: "text") - _index = ReadonlyAttribute(jsObject: jsObject, name: "index") + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _label = ReadWriteAttribute(jsObject: jsObject, name: Keys.label) + _defaultSelected = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultSelected) + _selected = ReadWriteAttribute(jsObject: jsObject, name: Keys.selected) + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) + _index = ReadonlyAttribute(jsObject: jsObject, name: Keys.index) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift index 48cf96ae..84f87514 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -6,9 +6,16 @@ import JavaScriptKit public class HTMLOptionsCollection: HTMLCollection { override public class var constructor: JSFunction { JSObject.global.HTMLOptionsCollection.function! } + private enum Keys { + static let length: JSString = "length" + static let selectedIndex: JSString = "selectedIndex" + static let add: JSString = "add" + static let remove: JSString = "remove" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadWriteAttribute(jsObject: jsObject, name: "length") - _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: "selectedIndex") + _length = ReadWriteAttribute(jsObject: jsObject, name: Keys.length) + _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectedIndex) super.init(unsafelyWrapping: jsObject) } @@ -21,11 +28,11 @@ public class HTMLOptionsCollection: HTMLCollection { // XXX: unsupported setter for keys of type UInt32 public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject["add"]!(element.jsValue(), before?.jsValue() ?? .undefined) + _ = jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined) } public func remove(index: Int32) { - _ = jsObject["remove"]!(index.jsValue()) + _ = jsObject[Keys.remove]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift index 54b9bd72..2df302c1 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift @@ -3,30 +3,39 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let tabIndex: JSString = "tabIndex" + static let dataset: JSString = "dataset" + static let autofocus: JSString = "autofocus" + static let nonce: JSString = "nonce" + static let focus: JSString = "focus" + static let blur: JSString = "blur" +} + public protocol HTMLOrSVGElement: JSBridgedClass {} public extension HTMLOrSVGElement { - var dataset: DOMStringMap { ReadonlyAttribute["dataset", in: jsObject] } + var dataset: DOMStringMap { ReadonlyAttribute[Keys.dataset, in: jsObject] } var nonce: String { - get { ReadWriteAttribute["nonce", in: jsObject] } - set { ReadWriteAttribute["nonce", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.nonce, in: jsObject] } + set { ReadWriteAttribute[Keys.nonce, in: jsObject] = newValue } } var autofocus: Bool { - get { ReadWriteAttribute["autofocus", in: jsObject] } - set { ReadWriteAttribute["autofocus", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.autofocus, in: jsObject] } + set { ReadWriteAttribute[Keys.autofocus, in: jsObject] = newValue } } var tabIndex: Int32 { - get { ReadWriteAttribute["tabIndex", in: jsObject] } - set { ReadWriteAttribute["tabIndex", in: jsObject] = newValue } + get { ReadWriteAttribute[Keys.tabIndex, in: jsObject] } + set { ReadWriteAttribute[Keys.tabIndex, in: jsObject] = newValue } } func focus(options: FocusOptions? = nil) { - _ = jsObject["focus"]!(options?.jsValue() ?? .undefined) + _ = jsObject[Keys.focus]!(options?.jsValue() ?? .undefined) } func blur() { - _ = jsObject["blur"]!() + _ = jsObject[Keys.blur]!() } } diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift index 1a4e69c1..179ee860 100644 --- a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -6,17 +6,33 @@ import JavaScriptKit public class HTMLOutputElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOutputElement.function! } + private enum Keys { + static let name: JSString = "name" + static let validationMessage: JSString = "validationMessage" + static let checkValidity: JSString = "checkValidity" + static let type: JSString = "type" + static let willValidate: JSString = "willValidate" + static let validity: JSString = "validity" + static let form: JSString = "form" + static let labels: JSString = "labels" + static let htmlFor: JSString = "htmlFor" + static let reportValidity: JSString = "reportValidity" + static let defaultValue: JSString = "defaultValue" + static let setCustomValidity: JSString = "setCustomValidity" + static let value: JSString = "value" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _htmlFor = ReadonlyAttribute(jsObject: jsObject, name: "htmlFor") - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") - _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: "defaultValue") - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") - _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") - _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + _htmlFor = ReadonlyAttribute(jsObject: jsObject, name: Keys.htmlFor) + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultValue) + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) super.init(unsafelyWrapping: jsObject) } @@ -52,15 +68,15 @@ public class HTMLOutputElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject["checkValidity"]!().fromJSValue()! + jsObject[Keys.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject["reportValidity"]!().fromJSValue()! + jsObject[Keys.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject["setCustomValidity"]!(error.jsValue()) + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift index c665286b..33d4fe98 100644 --- a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLParagraphElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLParagraphElement.function! } + private enum Keys { + static let align: JSString = "align" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLParamElement.swift b/Sources/DOMKit/WebIDL/HTMLParamElement.swift index 6eacca52..b3ac15e0 100644 --- a/Sources/DOMKit/WebIDL/HTMLParamElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParamElement.swift @@ -6,11 +6,18 @@ import JavaScriptKit public class HTMLParamElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLParamElement.function! } + private enum Keys { + static let type: JSString = "type" + static let valueType: JSString = "valueType" + static let name: JSString = "name" + static let value: JSString = "value" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _valueType = ReadWriteAttribute(jsObject: jsObject, name: "valueType") + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _valueType = ReadWriteAttribute(jsObject: jsObject, name: Keys.valueType) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift index 01d29383..c25bccd2 100644 --- a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class HTMLPictureElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLPictureElement.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLPreElement.swift b/Sources/DOMKit/WebIDL/HTMLPreElement.swift index 8b2e4c1c..324c09ad 100644 --- a/Sources/DOMKit/WebIDL/HTMLPreElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPreElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLPreElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLPreElement.function! } + private enum Keys { + static let width: JSString = "width" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift index a931150d..c2d6ffb0 100644 --- a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift @@ -6,11 +6,18 @@ import JavaScriptKit public class HTMLProgressElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLProgressElement.function! } + private enum Keys { + static let labels: JSString = "labels" + static let value: JSString = "value" + static let position: JSString = "position" + static let max: JSString = "max" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _max = ReadWriteAttribute(jsObject: jsObject, name: "max") - _position = ReadonlyAttribute(jsObject: jsObject, name: "position") - _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _max = ReadWriteAttribute(jsObject: jsObject, name: Keys.max) + _position = ReadonlyAttribute(jsObject: jsObject, name: Keys.position) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift index 527763ef..023d24f3 100644 --- a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLQuoteElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLQuoteElement.function! } + private enum Keys { + static let cite: JSString = "cite" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _cite = ReadWriteAttribute(jsObject: jsObject, name: "cite") + _cite = ReadWriteAttribute(jsObject: jsObject, name: Keys.cite) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift index e4888a27..4c893c59 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -6,20 +6,37 @@ import JavaScriptKit public class HTMLScriptElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLScriptElement.function! } + private enum Keys { + static let supports: JSString = "supports" + static let type: JSString = "type" + static let noModule: JSString = "noModule" + static let crossOrigin: JSString = "crossOrigin" + static let blocking: JSString = "blocking" + static let event: JSString = "event" + static let src: JSString = "src" + static let charset: JSString = "charset" + static let htmlFor: JSString = "htmlFor" + static let async: JSString = "async" + static let referrerPolicy: JSString = "referrerPolicy" + static let text: JSString = "text" + static let integrity: JSString = "integrity" + static let `defer`: JSString = "defer" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: "src") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _noModule = ReadWriteAttribute(jsObject: jsObject, name: "noModule") - _async = ReadWriteAttribute(jsObject: jsObject, name: "async") - _defer = ReadWriteAttribute(jsObject: jsObject, name: "defer") - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: "crossOrigin") - _text = ReadWriteAttribute(jsObject: jsObject, name: "text") - _integrity = ReadWriteAttribute(jsObject: jsObject, name: "integrity") - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: "referrerPolicy") - _blocking = ReadonlyAttribute(jsObject: jsObject, name: "blocking") - _charset = ReadWriteAttribute(jsObject: jsObject, name: "charset") - _event = ReadWriteAttribute(jsObject: jsObject, name: "event") - _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: "htmlFor") + _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _noModule = ReadWriteAttribute(jsObject: jsObject, name: Keys.noModule) + _async = ReadWriteAttribute(jsObject: jsObject, name: Keys.async) + _defer = ReadWriteAttribute(jsObject: jsObject, name: Keys.defer) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Keys.crossOrigin) + _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) + _integrity = ReadWriteAttribute(jsObject: jsObject, name: Keys.integrity) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) + _blocking = ReadonlyAttribute(jsObject: jsObject, name: Keys.blocking) + _charset = ReadWriteAttribute(jsObject: jsObject, name: Keys.charset) + _event = ReadWriteAttribute(jsObject: jsObject, name: Keys.event) + _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: Keys.htmlFor) super.init(unsafelyWrapping: jsObject) } @@ -58,7 +75,7 @@ public class HTMLScriptElement: HTMLElement { public var blocking: DOMTokenList public static func supports(type: String) -> Bool { - constructor["supports"]!(type.jsValue()).fromJSValue()! + constructor[Keys.supports]!(type.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index 67554c1c..9f47389e 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -6,24 +6,51 @@ import JavaScriptKit public class HTMLSelectElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSelectElement.function! } + private enum Keys { + static let selectedOptions: JSString = "selectedOptions" + static let reportValidity: JSString = "reportValidity" + static let setCustomValidity: JSString = "setCustomValidity" + static let autocomplete: JSString = "autocomplete" + static let type: JSString = "type" + static let validationMessage: JSString = "validationMessage" + static let add: JSString = "add" + static let selectedIndex: JSString = "selectedIndex" + static let item: JSString = "item" + static let value: JSString = "value" + static let validity: JSString = "validity" + static let remove: JSString = "remove" + static let checkValidity: JSString = "checkValidity" + static let options: JSString = "options" + static let disabled: JSString = "disabled" + static let namedItem: JSString = "namedItem" + static let multiple: JSString = "multiple" + static let labels: JSString = "labels" + static let required: JSString = "required" + static let form: JSString = "form" + static let name: JSString = "name" + static let size: JSString = "size" + static let length: JSString = "length" + static let willValidate: JSString = "willValidate" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: "autocomplete") - _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _multiple = ReadWriteAttribute(jsObject: jsObject, name: "multiple") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _required = ReadWriteAttribute(jsObject: jsObject, name: "required") - _size = ReadWriteAttribute(jsObject: jsObject, name: "size") - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") - _options = ReadonlyAttribute(jsObject: jsObject, name: "options") - _length = ReadWriteAttribute(jsObject: jsObject, name: "length") - _selectedOptions = ReadonlyAttribute(jsObject: jsObject, name: "selectedOptions") - _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: "selectedIndex") - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") - _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") - _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocomplete) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _multiple = ReadWriteAttribute(jsObject: jsObject, name: Keys.multiple) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _required = ReadWriteAttribute(jsObject: jsObject, name: Keys.required) + _size = ReadWriteAttribute(jsObject: jsObject, name: Keys.size) + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _options = ReadonlyAttribute(jsObject: jsObject, name: Keys.options) + _length = ReadWriteAttribute(jsObject: jsObject, name: Keys.length) + _selectedOptions = ReadonlyAttribute(jsObject: jsObject, name: Keys.selectedOptions) + _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectedIndex) + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) super.init(unsafelyWrapping: jsObject) } @@ -66,19 +93,19 @@ public class HTMLSelectElement: HTMLElement { } public func namedItem(name: String) -> HTMLOptionElement? { - jsObject["namedItem"]!(name.jsValue()).fromJSValue()! + jsObject[Keys.namedItem]!(name.jsValue()).fromJSValue()! } public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject["add"]!(element.jsValue(), before?.jsValue() ?? .undefined) + _ = jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined) } public func remove() { - _ = jsObject["remove"]!() + _ = jsObject[Keys.remove]!() } public func remove(index: Int32) { - _ = jsObject["remove"]!(index.jsValue()) + _ = jsObject[Keys.remove]!(index.jsValue()) } // XXX: unsupported setter for keys of type UInt32 @@ -102,15 +129,15 @@ public class HTMLSelectElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject["checkValidity"]!().fromJSValue()! + jsObject[Keys.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject["reportValidity"]!().fromJSValue()! + jsObject[Keys.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject["setCustomValidity"]!(error.jsValue()) + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index b74f6fe4..db1f661d 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -6,8 +6,15 @@ import JavaScriptKit public class HTMLSlotElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSlotElement.function! } + private enum Keys { + static let assignedNodes: JSString = "assignedNodes" + static let name: JSString = "name" + static let assign: JSString = "assign" + static let assignedElements: JSString = "assignedElements" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) super.init(unsafelyWrapping: jsObject) } @@ -19,14 +26,14 @@ public class HTMLSlotElement: HTMLElement { public var name: String public func assignedNodes(options: AssignedNodesOptions? = nil) -> [Node] { - jsObject["assignedNodes"]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.assignedNodes]!(options?.jsValue() ?? .undefined).fromJSValue()! } public func assignedElements(options: AssignedNodesOptions? = nil) -> [Element] { - jsObject["assignedElements"]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.assignedElements]!(options?.jsValue() ?? .undefined).fromJSValue()! } public func assign(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject["assign"]!(nodes.jsValue()) + _ = jsObject[Keys.assign]!(nodes.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift index e0db030e..216f0e71 100644 --- a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift @@ -6,14 +6,24 @@ import JavaScriptKit public class HTMLSourceElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSourceElement.function! } + private enum Keys { + static let type: JSString = "type" + static let media: JSString = "media" + static let width: JSString = "width" + static let sizes: JSString = "sizes" + static let src: JSString = "src" + static let srcset: JSString = "srcset" + static let height: JSString = "height" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: "src") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") - _srcset = ReadWriteAttribute(jsObject: jsObject, name: "srcset") - _sizes = ReadWriteAttribute(jsObject: jsObject, name: "sizes") - _media = ReadWriteAttribute(jsObject: jsObject, name: "media") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") + _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _srcset = ReadWriteAttribute(jsObject: jsObject, name: Keys.srcset) + _sizes = ReadWriteAttribute(jsObject: jsObject, name: Keys.sizes) + _media = ReadWriteAttribute(jsObject: jsObject, name: Keys.media) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift index b798e6c8..da10dab2 100644 --- a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class HTMLSpanElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSpanElement.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift index 8b20a994..2c8a73b1 100644 --- a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class HTMLStyleElement: HTMLElement, LinkStyle { override public class var constructor: JSFunction { JSObject.global.HTMLStyleElement.function! } + private enum Keys { + static let media: JSString = "media" + static let blocking: JSString = "blocking" + static let type: JSString = "type" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _media = ReadWriteAttribute(jsObject: jsObject, name: "media") - _blocking = ReadonlyAttribute(jsObject: jsObject, name: "blocking") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _media = ReadWriteAttribute(jsObject: jsObject, name: Keys.media) + _blocking = ReadonlyAttribute(jsObject: jsObject, name: Keys.blocking) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift index 1c36c36d..ef24c80e 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLTableCaptionElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableCaptionElement.function! } + private enum Keys { + static let align: JSString = "align" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift index 4f5c3e54..1bc91f17 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift @@ -6,22 +6,40 @@ import JavaScriptKit public class HTMLTableCellElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableCellElement.function! } + private enum Keys { + static let chOff: JSString = "chOff" + static let scope: JSString = "scope" + static let cellIndex: JSString = "cellIndex" + static let height: JSString = "height" + static let width: JSString = "width" + static let ch: JSString = "ch" + static let vAlign: JSString = "vAlign" + static let noWrap: JSString = "noWrap" + static let colSpan: JSString = "colSpan" + static let align: JSString = "align" + static let headers: JSString = "headers" + static let bgColor: JSString = "bgColor" + static let rowSpan: JSString = "rowSpan" + static let abbr: JSString = "abbr" + static let axis: JSString = "axis" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _colSpan = ReadWriteAttribute(jsObject: jsObject, name: "colSpan") - _rowSpan = ReadWriteAttribute(jsObject: jsObject, name: "rowSpan") - _headers = ReadWriteAttribute(jsObject: jsObject, name: "headers") - _cellIndex = ReadonlyAttribute(jsObject: jsObject, name: "cellIndex") - _scope = ReadWriteAttribute(jsObject: jsObject, name: "scope") - _abbr = ReadWriteAttribute(jsObject: jsObject, name: "abbr") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _axis = ReadWriteAttribute(jsObject: jsObject, name: "axis") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _ch = ReadWriteAttribute(jsObject: jsObject, name: "ch") - _chOff = ReadWriteAttribute(jsObject: jsObject, name: "chOff") - _noWrap = ReadWriteAttribute(jsObject: jsObject, name: "noWrap") - _vAlign = ReadWriteAttribute(jsObject: jsObject, name: "vAlign") - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") + _colSpan = ReadWriteAttribute(jsObject: jsObject, name: Keys.colSpan) + _rowSpan = ReadWriteAttribute(jsObject: jsObject, name: Keys.rowSpan) + _headers = ReadWriteAttribute(jsObject: jsObject, name: Keys.headers) + _cellIndex = ReadonlyAttribute(jsObject: jsObject, name: Keys.cellIndex) + _scope = ReadWriteAttribute(jsObject: jsObject, name: Keys.scope) + _abbr = ReadWriteAttribute(jsObject: jsObject, name: Keys.abbr) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _axis = ReadWriteAttribute(jsObject: jsObject, name: Keys.axis) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _ch = ReadWriteAttribute(jsObject: jsObject, name: Keys.ch) + _chOff = ReadWriteAttribute(jsObject: jsObject, name: Keys.chOff) + _noWrap = ReadWriteAttribute(jsObject: jsObject, name: Keys.noWrap) + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Keys.vAlign) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift index b169e61d..7c44a472 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift @@ -6,13 +6,22 @@ import JavaScriptKit public class HTMLTableColElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableColElement.function! } + private enum Keys { + static let ch: JSString = "ch" + static let align: JSString = "align" + static let span: JSString = "span" + static let width: JSString = "width" + static let vAlign: JSString = "vAlign" + static let chOff: JSString = "chOff" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _span = ReadWriteAttribute(jsObject: jsObject, name: "span") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _ch = ReadWriteAttribute(jsObject: jsObject, name: "ch") - _chOff = ReadWriteAttribute(jsObject: jsObject, name: "chOff") - _vAlign = ReadWriteAttribute(jsObject: jsObject, name: "vAlign") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") + _span = ReadWriteAttribute(jsObject: jsObject, name: Keys.span) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _ch = ReadWriteAttribute(jsObject: jsObject, name: Keys.ch) + _chOff = ReadWriteAttribute(jsObject: jsObject, name: Keys.chOff) + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Keys.vAlign) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift index 6ee5afb9..e95d0a9a 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -6,21 +6,47 @@ import JavaScriptKit public class HTMLTableElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableElement.function! } + private enum Keys { + static let createTFoot: JSString = "createTFoot" + static let deleteRow: JSString = "deleteRow" + static let createTBody: JSString = "createTBody" + static let cellSpacing: JSString = "cellSpacing" + static let align: JSString = "align" + static let tHead: JSString = "tHead" + static let tFoot: JSString = "tFoot" + static let frame: JSString = "frame" + static let createTHead: JSString = "createTHead" + static let border: JSString = "border" + static let rules: JSString = "rules" + static let bgColor: JSString = "bgColor" + static let caption: JSString = "caption" + static let deleteTFoot: JSString = "deleteTFoot" + static let width: JSString = "width" + static let cellPadding: JSString = "cellPadding" + static let deleteTHead: JSString = "deleteTHead" + static let deleteCaption: JSString = "deleteCaption" + static let tBodies: JSString = "tBodies" + static let createCaption: JSString = "createCaption" + static let rows: JSString = "rows" + static let insertRow: JSString = "insertRow" + static let summary: JSString = "summary" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _caption = ReadWriteAttribute(jsObject: jsObject, name: "caption") - _tHead = ReadWriteAttribute(jsObject: jsObject, name: "tHead") - _tFoot = ReadWriteAttribute(jsObject: jsObject, name: "tFoot") - _tBodies = ReadonlyAttribute(jsObject: jsObject, name: "tBodies") - _rows = ReadonlyAttribute(jsObject: jsObject, name: "rows") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _border = ReadWriteAttribute(jsObject: jsObject, name: "border") - _frame = ReadWriteAttribute(jsObject: jsObject, name: "frame") - _rules = ReadWriteAttribute(jsObject: jsObject, name: "rules") - _summary = ReadWriteAttribute(jsObject: jsObject, name: "summary") - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") - _cellPadding = ReadWriteAttribute(jsObject: jsObject, name: "cellPadding") - _cellSpacing = ReadWriteAttribute(jsObject: jsObject, name: "cellSpacing") + _caption = ReadWriteAttribute(jsObject: jsObject, name: Keys.caption) + _tHead = ReadWriteAttribute(jsObject: jsObject, name: Keys.tHead) + _tFoot = ReadWriteAttribute(jsObject: jsObject, name: Keys.tFoot) + _tBodies = ReadonlyAttribute(jsObject: jsObject, name: Keys.tBodies) + _rows = ReadonlyAttribute(jsObject: jsObject, name: Keys.rows) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _border = ReadWriteAttribute(jsObject: jsObject, name: Keys.border) + _frame = ReadWriteAttribute(jsObject: jsObject, name: Keys.frame) + _rules = ReadWriteAttribute(jsObject: jsObject, name: Keys.rules) + _summary = ReadWriteAttribute(jsObject: jsObject, name: Keys.summary) + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) + _cellPadding = ReadWriteAttribute(jsObject: jsObject, name: Keys.cellPadding) + _cellSpacing = ReadWriteAttribute(jsObject: jsObject, name: Keys.cellSpacing) super.init(unsafelyWrapping: jsObject) } @@ -32,51 +58,51 @@ public class HTMLTableElement: HTMLElement { public var caption: HTMLTableCaptionElement? public func createCaption() -> HTMLTableCaptionElement { - jsObject["createCaption"]!().fromJSValue()! + jsObject[Keys.createCaption]!().fromJSValue()! } public func deleteCaption() { - _ = jsObject["deleteCaption"]!() + _ = jsObject[Keys.deleteCaption]!() } @ReadWriteAttribute public var tHead: HTMLTableSectionElement? public func createTHead() -> HTMLTableSectionElement { - jsObject["createTHead"]!().fromJSValue()! + jsObject[Keys.createTHead]!().fromJSValue()! } public func deleteTHead() { - _ = jsObject["deleteTHead"]!() + _ = jsObject[Keys.deleteTHead]!() } @ReadWriteAttribute public var tFoot: HTMLTableSectionElement? public func createTFoot() -> HTMLTableSectionElement { - jsObject["createTFoot"]!().fromJSValue()! + jsObject[Keys.createTFoot]!().fromJSValue()! } public func deleteTFoot() { - _ = jsObject["deleteTFoot"]!() + _ = jsObject[Keys.deleteTFoot]!() } @ReadonlyAttribute public var tBodies: HTMLCollection public func createTBody() -> HTMLTableSectionElement { - jsObject["createTBody"]!().fromJSValue()! + jsObject[Keys.createTBody]!().fromJSValue()! } @ReadonlyAttribute public var rows: HTMLCollection public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { - jsObject["insertRow"]!(index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.insertRow]!(index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteRow(index: Int32) { - _ = jsObject["deleteRow"]!(index.jsValue()) + _ = jsObject[Keys.deleteRow]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift index 092b6e1d..3c6af65a 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -6,15 +6,28 @@ import JavaScriptKit public class HTMLTableRowElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableRowElement.function! } + private enum Keys { + static let vAlign: JSString = "vAlign" + static let sectionRowIndex: JSString = "sectionRowIndex" + static let rowIndex: JSString = "rowIndex" + static let cells: JSString = "cells" + static let insertCell: JSString = "insertCell" + static let deleteCell: JSString = "deleteCell" + static let align: JSString = "align" + static let ch: JSString = "ch" + static let bgColor: JSString = "bgColor" + static let chOff: JSString = "chOff" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _rowIndex = ReadonlyAttribute(jsObject: jsObject, name: "rowIndex") - _sectionRowIndex = ReadonlyAttribute(jsObject: jsObject, name: "sectionRowIndex") - _cells = ReadonlyAttribute(jsObject: jsObject, name: "cells") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _ch = ReadWriteAttribute(jsObject: jsObject, name: "ch") - _chOff = ReadWriteAttribute(jsObject: jsObject, name: "chOff") - _vAlign = ReadWriteAttribute(jsObject: jsObject, name: "vAlign") - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: "bgColor") + _rowIndex = ReadonlyAttribute(jsObject: jsObject, name: Keys.rowIndex) + _sectionRowIndex = ReadonlyAttribute(jsObject: jsObject, name: Keys.sectionRowIndex) + _cells = ReadonlyAttribute(jsObject: jsObject, name: Keys.cells) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _ch = ReadWriteAttribute(jsObject: jsObject, name: Keys.ch) + _chOff = ReadWriteAttribute(jsObject: jsObject, name: Keys.chOff) + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Keys.vAlign) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) super.init(unsafelyWrapping: jsObject) } @@ -32,11 +45,11 @@ public class HTMLTableRowElement: HTMLElement { public var cells: HTMLCollection public func insertCell(index: Int32? = nil) -> HTMLTableCellElement { - jsObject["insertCell"]!(index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.insertCell]!(index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteCell(index: Int32) { - _ = jsObject["deleteCell"]!(index.jsValue()) + _ = jsObject[Keys.deleteCell]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift index f8493547..58f88825 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -6,12 +6,22 @@ import JavaScriptKit public class HTMLTableSectionElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableSectionElement.function! } + private enum Keys { + static let insertRow: JSString = "insertRow" + static let rows: JSString = "rows" + static let vAlign: JSString = "vAlign" + static let deleteRow: JSString = "deleteRow" + static let align: JSString = "align" + static let chOff: JSString = "chOff" + static let ch: JSString = "ch" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _rows = ReadonlyAttribute(jsObject: jsObject, name: "rows") - _align = ReadWriteAttribute(jsObject: jsObject, name: "align") - _ch = ReadWriteAttribute(jsObject: jsObject, name: "ch") - _chOff = ReadWriteAttribute(jsObject: jsObject, name: "chOff") - _vAlign = ReadWriteAttribute(jsObject: jsObject, name: "vAlign") + _rows = ReadonlyAttribute(jsObject: jsObject, name: Keys.rows) + _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _ch = ReadWriteAttribute(jsObject: jsObject, name: Keys.ch) + _chOff = ReadWriteAttribute(jsObject: jsObject, name: Keys.chOff) + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Keys.vAlign) super.init(unsafelyWrapping: jsObject) } @@ -23,11 +33,11 @@ public class HTMLTableSectionElement: HTMLElement { public var rows: HTMLCollection public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { - jsObject["insertRow"]!(index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.insertRow]!(index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteRow(index: Int32) { - _ = jsObject["deleteRow"]!(index.jsValue()) + _ = jsObject[Keys.deleteRow]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift index cb5452e3..84747a57 100644 --- a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLTemplateElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTemplateElement.function! } + private enum Keys { + static let content: JSString = "content" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _content = ReadonlyAttribute(jsObject: jsObject, name: "content") + _content = ReadonlyAttribute(jsObject: jsObject, name: Keys.content) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift index be1e7130..4e3c9a3e 100644 --- a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -6,31 +6,64 @@ import JavaScriptKit public class HTMLTextAreaElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTextAreaElement.function! } + private enum Keys { + static let maxLength: JSString = "maxLength" + static let minLength: JSString = "minLength" + static let checkValidity: JSString = "checkValidity" + static let setRangeText: JSString = "setRangeText" + static let type: JSString = "type" + static let selectionDirection: JSString = "selectionDirection" + static let select: JSString = "select" + static let selectionStart: JSString = "selectionStart" + static let validationMessage: JSString = "validationMessage" + static let rows: JSString = "rows" + static let cols: JSString = "cols" + static let reportValidity: JSString = "reportValidity" + static let labels: JSString = "labels" + static let name: JSString = "name" + static let form: JSString = "form" + static let setSelectionRange: JSString = "setSelectionRange" + static let placeholder: JSString = "placeholder" + static let selectionEnd: JSString = "selectionEnd" + static let disabled: JSString = "disabled" + static let dirName: JSString = "dirName" + static let defaultValue: JSString = "defaultValue" + static let readOnly: JSString = "readOnly" + static let wrap: JSString = "wrap" + static let validity: JSString = "validity" + static let willValidate: JSString = "willValidate" + static let value: JSString = "value" + static let setCustomValidity: JSString = "setCustomValidity" + static let required: JSString = "required" + static let autocomplete: JSString = "autocomplete" + static let textLength: JSString = "textLength" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: "autocomplete") - _cols = ReadWriteAttribute(jsObject: jsObject, name: "cols") - _dirName = ReadWriteAttribute(jsObject: jsObject, name: "dirName") - _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") - _form = ReadonlyAttribute(jsObject: jsObject, name: "form") - _maxLength = ReadWriteAttribute(jsObject: jsObject, name: "maxLength") - _minLength = ReadWriteAttribute(jsObject: jsObject, name: "minLength") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _placeholder = ReadWriteAttribute(jsObject: jsObject, name: "placeholder") - _readOnly = ReadWriteAttribute(jsObject: jsObject, name: "readOnly") - _required = ReadWriteAttribute(jsObject: jsObject, name: "required") - _rows = ReadWriteAttribute(jsObject: jsObject, name: "rows") - _wrap = ReadWriteAttribute(jsObject: jsObject, name: "wrap") - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") - _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: "defaultValue") - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") - _textLength = ReadonlyAttribute(jsObject: jsObject, name: "textLength") - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: "willValidate") - _validity = ReadonlyAttribute(jsObject: jsObject, name: "validity") - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: "validationMessage") - _labels = ReadonlyAttribute(jsObject: jsObject, name: "labels") - _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: "selectionStart") - _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: "selectionEnd") - _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: "selectionDirection") + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocomplete) + _cols = ReadWriteAttribute(jsObject: jsObject, name: Keys.cols) + _dirName = ReadWriteAttribute(jsObject: jsObject, name: Keys.dirName) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) + _maxLength = ReadWriteAttribute(jsObject: jsObject, name: Keys.maxLength) + _minLength = ReadWriteAttribute(jsObject: jsObject, name: Keys.minLength) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _placeholder = ReadWriteAttribute(jsObject: jsObject, name: Keys.placeholder) + _readOnly = ReadWriteAttribute(jsObject: jsObject, name: Keys.readOnly) + _required = ReadWriteAttribute(jsObject: jsObject, name: Keys.required) + _rows = ReadWriteAttribute(jsObject: jsObject, name: Keys.rows) + _wrap = ReadWriteAttribute(jsObject: jsObject, name: Keys.wrap) + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultValue) + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _textLength = ReadonlyAttribute(jsObject: jsObject, name: Keys.textLength) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) + _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionStart) + _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionEnd) + _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionDirection) super.init(unsafelyWrapping: jsObject) } @@ -99,22 +132,22 @@ public class HTMLTextAreaElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject["checkValidity"]!().fromJSValue()! + jsObject[Keys.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject["reportValidity"]!().fromJSValue()! + jsObject[Keys.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject["setCustomValidity"]!(error.jsValue()) + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute public var labels: NodeList public func select() { - _ = jsObject["select"]!() + _ = jsObject[Keys.select]!() } @ReadWriteAttribute @@ -127,14 +160,14 @@ public class HTMLTextAreaElement: HTMLElement { public var selectionDirection: String public func setRangeText(replacement: String) { - _ = jsObject["setRangeText"]!(replacement.jsValue()) + _ = jsObject[Keys.setRangeText]!(replacement.jsValue()) } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - _ = jsObject["setRangeText"]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + _ = jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - _ = jsObject["setSelectionRange"]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + _ = jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift index 4faaa612..60d1e797 100644 --- a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLTimeElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTimeElement.function! } + private enum Keys { + static let dateTime: JSString = "dateTime" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _dateTime = ReadWriteAttribute(jsObject: jsObject, name: "dateTime") + _dateTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.dateTime) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift index 1636826d..c050bcf4 100644 --- a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class HTMLTitleElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTitleElement.function! } + private enum Keys { + static let text: JSString = "text" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _text = ReadWriteAttribute(jsObject: jsObject, name: "text") + _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift index 82f828ee..a6ad26d7 100644 --- a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift @@ -6,14 +6,28 @@ import JavaScriptKit public class HTMLTrackElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTrackElement.function! } + private enum Keys { + static let label: JSString = "label" + static let LOADING: JSString = "LOADING" + static let NONE: JSString = "NONE" + static let srclang: JSString = "srclang" + static let src: JSString = "src" + static let LOADED: JSString = "LOADED" + static let readyState: JSString = "readyState" + static let `default`: JSString = "default" + static let ERROR: JSString = "ERROR" + static let kind: JSString = "kind" + static let track: JSString = "track" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _kind = ReadWriteAttribute(jsObject: jsObject, name: "kind") - _src = ReadWriteAttribute(jsObject: jsObject, name: "src") - _srclang = ReadWriteAttribute(jsObject: jsObject, name: "srclang") - _label = ReadWriteAttribute(jsObject: jsObject, name: "label") - _default = ReadWriteAttribute(jsObject: jsObject, name: "default") - _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") - _track = ReadonlyAttribute(jsObject: jsObject, name: "track") + _kind = ReadWriteAttribute(jsObject: jsObject, name: Keys.kind) + _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) + _srclang = ReadWriteAttribute(jsObject: jsObject, name: Keys.srclang) + _label = ReadWriteAttribute(jsObject: jsObject, name: Keys.label) + _default = ReadWriteAttribute(jsObject: jsObject, name: Keys.default) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) + _track = ReadonlyAttribute(jsObject: jsObject, name: Keys.track) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLUListElement.swift b/Sources/DOMKit/WebIDL/HTMLUListElement.swift index a21ffaea..7fc292a1 100644 --- a/Sources/DOMKit/WebIDL/HTMLUListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUListElement.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class HTMLUListElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLUListElement.function! } + private enum Keys { + static let compact: JSString = "compact" + static let type: JSString = "type" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _compact = ReadWriteAttribute(jsObject: jsObject, name: "compact") - _type = ReadWriteAttribute(jsObject: jsObject, name: "type") + _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) + _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift index fd3cfcd9..b5315c98 100644 --- a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class HTMLUnknownElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLUnknownElement.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 77d1aed1..de7a5f18 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -6,13 +6,22 @@ import JavaScriptKit public class HTMLVideoElement: HTMLMediaElement { override public class var constructor: JSFunction { JSObject.global.HTMLVideoElement.function! } + private enum Keys { + static let videoHeight: JSString = "videoHeight" + static let playsInline: JSString = "playsInline" + static let width: JSString = "width" + static let poster: JSString = "poster" + static let height: JSString = "height" + static let videoWidth: JSString = "videoWidth" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") - _videoWidth = ReadonlyAttribute(jsObject: jsObject, name: "videoWidth") - _videoHeight = ReadonlyAttribute(jsObject: jsObject, name: "videoHeight") - _poster = ReadWriteAttribute(jsObject: jsObject, name: "poster") - _playsInline = ReadWriteAttribute(jsObject: jsObject, name: "playsInline") + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _videoWidth = ReadonlyAttribute(jsObject: jsObject, name: Keys.videoWidth) + _videoHeight = ReadonlyAttribute(jsObject: jsObject, name: Keys.videoHeight) + _poster = ReadWriteAttribute(jsObject: jsObject, name: Keys.poster) + _playsInline = ReadWriteAttribute(jsObject: jsObject, name: Keys.playsInline) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HashChangeEvent.swift b/Sources/DOMKit/WebIDL/HashChangeEvent.swift index 27783cbf..c33a61b4 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEvent.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class HashChangeEvent: Event { override public class var constructor: JSFunction { JSObject.global.HashChangeEvent.function! } + private enum Keys { + static let oldURL: JSString = "oldURL" + static let newURL: JSString = "newURL" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _oldURL = ReadonlyAttribute(jsObject: jsObject, name: "oldURL") - _newURL = ReadonlyAttribute(jsObject: jsObject, name: "newURL") + _oldURL = ReadonlyAttribute(jsObject: jsObject, name: Keys.oldURL) + _newURL = ReadonlyAttribute(jsObject: jsObject, name: Keys.newURL) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift index 0187907b..7a14ce49 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift @@ -4,16 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class HashChangeEventInit: BridgedDictionary { + private enum Keys { + static let oldURL: JSString = "oldURL" + static let newURL: JSString = "newURL" + } + public convenience init(oldURL: String, newURL: String) { let object = JSObject.global.Object.function!.new() - object["oldURL"] = oldURL.jsValue() - object["newURL"] = newURL.jsValue() + object[Keys.oldURL] = oldURL.jsValue() + object[Keys.newURL] = newURL.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _oldURL = ReadWriteAttribute(jsObject: object, name: "oldURL") - _newURL = ReadWriteAttribute(jsObject: object, name: "newURL") + _oldURL = ReadWriteAttribute(jsObject: object, name: Keys.oldURL) + _newURL = ReadWriteAttribute(jsObject: object, name: Keys.newURL) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift index 767b02bb..4da1ee21 100644 --- a/Sources/DOMKit/WebIDL/Headers.swift +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -6,6 +6,14 @@ import JavaScriptKit public class Headers: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.Headers.function! } + private enum Keys { + static let get: JSString = "get" + static let set: JSString = "set" + static let append: JSString = "append" + static let delete: JSString = "delete" + static let has: JSString = "has" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,23 +25,23 @@ public class Headers: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - _ = jsObject["append"]!(name.jsValue(), value.jsValue()) + _ = jsObject[Keys.append]!(name.jsValue(), value.jsValue()) } public func delete(name: String) { - _ = jsObject["delete"]!(name.jsValue()) + _ = jsObject[Keys.delete]!(name.jsValue()) } public func get(name: String) -> String? { - jsObject["get"]!(name.jsValue()).fromJSValue()! + jsObject[Keys.get]!(name.jsValue()).fromJSValue()! } public func has(name: String) -> Bool { - jsObject["has"]!(name.jsValue()).fromJSValue()! + jsObject[Keys.has]!(name.jsValue()).fromJSValue()! } public func set(name: String, value: String) { - _ = jsObject["set"]!(name.jsValue(), value.jsValue()) + _ = jsObject[Keys.set]!(name.jsValue(), value.jsValue()) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/History.swift b/Sources/DOMKit/WebIDL/History.swift index 33297c91..19d07c59 100644 --- a/Sources/DOMKit/WebIDL/History.swift +++ b/Sources/DOMKit/WebIDL/History.swift @@ -6,12 +6,23 @@ import JavaScriptKit public class History: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.History.function! } + private enum Keys { + static let length: JSString = "length" + static let replaceState: JSString = "replaceState" + static let back: JSString = "back" + static let forward: JSString = "forward" + static let pushState: JSString = "pushState" + static let state: JSString = "state" + static let go: JSString = "go" + static let scrollRestoration: JSString = "scrollRestoration" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") - _scrollRestoration = ReadWriteAttribute(jsObject: jsObject, name: "scrollRestoration") - _state = ReadonlyAttribute(jsObject: jsObject, name: "state") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _scrollRestoration = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrollRestoration) + _state = ReadonlyAttribute(jsObject: jsObject, name: Keys.state) self.jsObject = jsObject } @@ -25,22 +36,22 @@ public class History: JSBridgedClass { public var state: JSValue public func go(delta: Int32? = nil) { - _ = jsObject["go"]!(delta?.jsValue() ?? .undefined) + _ = jsObject[Keys.go]!(delta?.jsValue() ?? .undefined) } public func back() { - _ = jsObject["back"]!() + _ = jsObject[Keys.back]!() } public func forward() { - _ = jsObject["forward"]!() + _ = jsObject[Keys.forward]!() } public func pushState(data: JSValue, unused: String, url: String? = nil) { - _ = jsObject["pushState"]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + _ = jsObject[Keys.pushState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) } public func replaceState(data: JSValue, unused: String, url: String? = nil) { - _ = jsObject["replaceState"]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + _ = jsObject[Keys.replaceState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmap.swift b/Sources/DOMKit/WebIDL/ImageBitmap.swift index 504bc557..fb7d11a7 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmap.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmap.swift @@ -6,11 +6,17 @@ import JavaScriptKit public class ImageBitmap: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ImageBitmap.function! } + private enum Keys { + static let close: JSString = "close" + static let width: JSString = "width" + static let height: JSString = "height" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: "width") - _height = ReadonlyAttribute(jsObject: jsObject, name: "height") + _width = ReadonlyAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Keys.height) self.jsObject = jsObject } @@ -21,6 +27,6 @@ public class ImageBitmap: JSBridgedClass { public var height: UInt32 public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift index 5a15a988..dcafc8e1 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift @@ -4,24 +4,33 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageBitmapOptions: BridgedDictionary { + private enum Keys { + static let imageOrientation: JSString = "imageOrientation" + static let resizeWidth: JSString = "resizeWidth" + static let premultiplyAlpha: JSString = "premultiplyAlpha" + static let resizeHeight: JSString = "resizeHeight" + static let resizeQuality: JSString = "resizeQuality" + static let colorSpaceConversion: JSString = "colorSpaceConversion" + } + public convenience init(imageOrientation: ImageOrientation, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, resizeWidth: UInt32, resizeHeight: UInt32, resizeQuality: ResizeQuality) { let object = JSObject.global.Object.function!.new() - object["imageOrientation"] = imageOrientation.jsValue() - object["premultiplyAlpha"] = premultiplyAlpha.jsValue() - object["colorSpaceConversion"] = colorSpaceConversion.jsValue() - object["resizeWidth"] = resizeWidth.jsValue() - object["resizeHeight"] = resizeHeight.jsValue() - object["resizeQuality"] = resizeQuality.jsValue() + object[Keys.imageOrientation] = imageOrientation.jsValue() + object[Keys.premultiplyAlpha] = premultiplyAlpha.jsValue() + object[Keys.colorSpaceConversion] = colorSpaceConversion.jsValue() + object[Keys.resizeWidth] = resizeWidth.jsValue() + object[Keys.resizeHeight] = resizeHeight.jsValue() + object[Keys.resizeQuality] = resizeQuality.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _imageOrientation = ReadWriteAttribute(jsObject: object, name: "imageOrientation") - _premultiplyAlpha = ReadWriteAttribute(jsObject: object, name: "premultiplyAlpha") - _colorSpaceConversion = ReadWriteAttribute(jsObject: object, name: "colorSpaceConversion") - _resizeWidth = ReadWriteAttribute(jsObject: object, name: "resizeWidth") - _resizeHeight = ReadWriteAttribute(jsObject: object, name: "resizeHeight") - _resizeQuality = ReadWriteAttribute(jsObject: object, name: "resizeQuality") + _imageOrientation = ReadWriteAttribute(jsObject: object, name: Keys.imageOrientation) + _premultiplyAlpha = ReadWriteAttribute(jsObject: object, name: Keys.premultiplyAlpha) + _colorSpaceConversion = ReadWriteAttribute(jsObject: object, name: Keys.colorSpaceConversion) + _resizeWidth = ReadWriteAttribute(jsObject: object, name: Keys.resizeWidth) + _resizeHeight = ReadWriteAttribute(jsObject: object, name: Keys.resizeHeight) + _resizeQuality = ReadWriteAttribute(jsObject: object, name: Keys.resizeQuality) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift index a25f07c1..6bf855ae 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class ImageBitmapRenderingContext: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ImageBitmapRenderingContext.function! } + private enum Keys { + static let transferFromImageBitmap: JSString = "transferFromImageBitmap" + static let canvas: JSString = "canvas" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _canvas = ReadonlyAttribute(jsObject: jsObject, name: "canvas") + _canvas = ReadonlyAttribute(jsObject: jsObject, name: Keys.canvas) self.jsObject = jsObject } @@ -17,6 +22,6 @@ public class ImageBitmapRenderingContext: JSBridgedClass { public var canvas: __UNSUPPORTED_UNION__ public func transferFromImageBitmap(bitmap: ImageBitmap?) { - _ = jsObject["transferFromImageBitmap"]!(bitmap.jsValue()) + _ = jsObject[Keys.transferFromImageBitmap]!(bitmap.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift index 97bd62fa..47c851fa 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageBitmapRenderingContextSettings: BridgedDictionary { + private enum Keys { + static let alpha: JSString = "alpha" + } + public convenience init(alpha: Bool) { let object = JSObject.global.Object.function!.new() - object["alpha"] = alpha.jsValue() + object[Keys.alpha] = alpha.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: "alpha") + _alpha = ReadWriteAttribute(jsObject: object, name: Keys.alpha) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageData.swift b/Sources/DOMKit/WebIDL/ImageData.swift index 4aa1db9c..7c4ff466 100644 --- a/Sources/DOMKit/WebIDL/ImageData.swift +++ b/Sources/DOMKit/WebIDL/ImageData.swift @@ -6,13 +6,20 @@ import JavaScriptKit public class ImageData: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ImageData.function! } + private enum Keys { + static let colorSpace: JSString = "colorSpace" + static let height: JSString = "height" + static let data: JSString = "data" + static let width: JSString = "width" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: "width") - _height = ReadonlyAttribute(jsObject: jsObject, name: "height") - _data = ReadonlyAttribute(jsObject: jsObject, name: "data") - _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: "colorSpace") + _width = ReadonlyAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Keys.height) + _data = ReadonlyAttribute(jsObject: jsObject, name: Keys.data) + _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: Keys.colorSpace) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/ImageDataSettings.swift b/Sources/DOMKit/WebIDL/ImageDataSettings.swift index e4e885f6..180054b1 100644 --- a/Sources/DOMKit/WebIDL/ImageDataSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageDataSettings.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageDataSettings: BridgedDictionary { + private enum Keys { + static let colorSpace: JSString = "colorSpace" + } + public convenience init(colorSpace: PredefinedColorSpace) { let object = JSObject.global.Object.function!.new() - object["colorSpace"] = colorSpace.jsValue() + object[Keys.colorSpace] = colorSpace.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _colorSpace = ReadWriteAttribute(jsObject: object, name: "colorSpace") + _colorSpace = ReadWriteAttribute(jsObject: object, name: Keys.colorSpace) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift index 5cc0fb12..08aeed6b 100644 --- a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift @@ -4,16 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageEncodeOptions: BridgedDictionary { + private enum Keys { + static let quality: JSString = "quality" + static let type: JSString = "type" + } + public convenience init(type: String, quality: Double) { let object = JSObject.global.Object.function!.new() - object["type"] = type.jsValue() - object["quality"] = quality.jsValue() + object[Keys.type] = type.jsValue() + object[Keys.quality] = quality.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: "type") - _quality = ReadWriteAttribute(jsObject: object, name: "quality") + _type = ReadWriteAttribute(jsObject: object, name: Keys.type) + _quality = ReadWriteAttribute(jsObject: object, name: Keys.quality) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageOrientation.swift b/Sources/DOMKit/WebIDL/ImageOrientation.swift index 988153ca..36bc2af1 100644 --- a/Sources/DOMKit/WebIDL/ImageOrientation.swift +++ b/Sources/DOMKit/WebIDL/ImageOrientation.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ImageOrientation: String, JSValueCompatible { - case none - case flipY +public enum ImageOrientation: JSString, JSValueCompatible { + case none = "none" + case flipY = "flipY" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift index e6ffa49d..634c1f83 100644 --- a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift +++ b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ImageSmoothingQuality: String, JSValueCompatible { - case low - case medium - case high +public enum ImageSmoothingQuality: JSString, JSValueCompatible { + case low = "low" + case medium = "medium" + case high = "high" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index ea84ef18..26a2374e 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class InputEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.InputEvent.function! } + private enum Keys { + static let data: JSString = "data" + static let isComposing: JSString = "isComposing" + static let inputType: JSString = "inputType" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: "data") - _isComposing = ReadonlyAttribute(jsObject: jsObject, name: "isComposing") - _inputType = ReadonlyAttribute(jsObject: jsObject, name: "inputType") + _data = ReadonlyAttribute(jsObject: jsObject, name: Keys.data) + _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Keys.isComposing) + _inputType = ReadonlyAttribute(jsObject: jsObject, name: Keys.inputType) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift index eb37490f..4e7e140e 100644 --- a/Sources/DOMKit/WebIDL/InputEventInit.swift +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -4,18 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class InputEventInit: BridgedDictionary { + private enum Keys { + static let inputType: JSString = "inputType" + static let data: JSString = "data" + static let isComposing: JSString = "isComposing" + } + public convenience init(data: String?, isComposing: Bool, inputType: String) { let object = JSObject.global.Object.function!.new() - object["data"] = data.jsValue() - object["isComposing"] = isComposing.jsValue() - object["inputType"] = inputType.jsValue() + object[Keys.data] = data.jsValue() + object[Keys.isComposing] = isComposing.jsValue() + object[Keys.inputType] = inputType.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _data = ReadWriteAttribute(jsObject: object, name: "data") - _isComposing = ReadWriteAttribute(jsObject: object, name: "isComposing") - _inputType = ReadWriteAttribute(jsObject: object, name: "inputType") + _data = ReadWriteAttribute(jsObject: object, name: Keys.data) + _isComposing = ReadWriteAttribute(jsObject: object, name: Keys.isComposing) + _inputType = ReadWriteAttribute(jsObject: object, name: Keys.inputType) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index 81f13e06..42c1e0a7 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -6,18 +6,38 @@ import JavaScriptKit public class KeyboardEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.KeyboardEvent.function! } + private enum Keys { + static let DOM_KEY_LOCATION_STANDARD: JSString = "DOM_KEY_LOCATION_STANDARD" + static let getModifierState: JSString = "getModifierState" + static let DOM_KEY_LOCATION_RIGHT: JSString = "DOM_KEY_LOCATION_RIGHT" + static let initKeyboardEvent: JSString = "initKeyboardEvent" + static let keyCode: JSString = "keyCode" + static let shiftKey: JSString = "shiftKey" + static let location: JSString = "location" + static let altKey: JSString = "altKey" + static let DOM_KEY_LOCATION_NUMPAD: JSString = "DOM_KEY_LOCATION_NUMPAD" + static let ctrlKey: JSString = "ctrlKey" + static let metaKey: JSString = "metaKey" + static let `repeat`: JSString = "repeat" + static let charCode: JSString = "charCode" + static let DOM_KEY_LOCATION_LEFT: JSString = "DOM_KEY_LOCATION_LEFT" + static let code: JSString = "code" + static let key: JSString = "key" + static let isComposing: JSString = "isComposing" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _key = ReadonlyAttribute(jsObject: jsObject, name: "key") - _code = ReadonlyAttribute(jsObject: jsObject, name: "code") - _location = ReadonlyAttribute(jsObject: jsObject, name: "location") - _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: "ctrlKey") - _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: "shiftKey") - _altKey = ReadonlyAttribute(jsObject: jsObject, name: "altKey") - _metaKey = ReadonlyAttribute(jsObject: jsObject, name: "metaKey") - _repeat = ReadonlyAttribute(jsObject: jsObject, name: "repeat") - _isComposing = ReadonlyAttribute(jsObject: jsObject, name: "isComposing") - _charCode = ReadonlyAttribute(jsObject: jsObject, name: "charCode") - _keyCode = ReadonlyAttribute(jsObject: jsObject, name: "keyCode") + _key = ReadonlyAttribute(jsObject: jsObject, name: Keys.key) + _code = ReadonlyAttribute(jsObject: jsObject, name: Keys.code) + _location = ReadonlyAttribute(jsObject: jsObject, name: Keys.location) + _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.ctrlKey) + _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.shiftKey) + _altKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.altKey) + _metaKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.metaKey) + _repeat = ReadonlyAttribute(jsObject: jsObject, name: Keys.repeat) + _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Keys.isComposing) + _charCode = ReadonlyAttribute(jsObject: jsObject, name: Keys.charCode) + _keyCode = ReadonlyAttribute(jsObject: jsObject, name: Keys.keyCode) super.init(unsafelyWrapping: jsObject) } @@ -61,7 +81,7 @@ public class KeyboardEvent: UIEvent { public var isComposing: Bool public func getModifierState(keyArg: String) -> Bool { - jsObject["getModifierState"]!(keyArg.jsValue()).fromJSValue()! + jsObject[Keys.getModifierState]!(keyArg.jsValue()).fromJSValue()! } public func initKeyboardEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, keyArg: String? = nil, locationArg: UInt32? = nil, ctrlKey: Bool? = nil, altKey: Bool? = nil, shiftKey: Bool? = nil, metaKey: Bool? = nil) { @@ -75,7 +95,7 @@ public class KeyboardEvent: UIEvent { let _arg7 = altKey?.jsValue() ?? .undefined let _arg8 = shiftKey?.jsValue() ?? .undefined let _arg9 = metaKey?.jsValue() ?? .undefined - _ = jsObject["initKeyboardEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + _ = jsObject[Keys.initKeyboardEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift index 078701dc..a92d0f01 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift @@ -4,26 +4,36 @@ import JavaScriptEventLoop import JavaScriptKit public class KeyboardEventInit: BridgedDictionary { + private enum Keys { + static let location: JSString = "location" + static let `repeat`: JSString = "repeat" + static let keyCode: JSString = "keyCode" + static let isComposing: JSString = "isComposing" + static let charCode: JSString = "charCode" + static let code: JSString = "code" + static let key: JSString = "key" + } + public convenience init(key: String, code: String, location: UInt32, repeat: Bool, isComposing: Bool, charCode: UInt32, keyCode: UInt32) { let object = JSObject.global.Object.function!.new() - object["key"] = key.jsValue() - object["code"] = code.jsValue() - object["location"] = location.jsValue() - object["repeat"] = `repeat`.jsValue() - object["isComposing"] = isComposing.jsValue() - object["charCode"] = charCode.jsValue() - object["keyCode"] = keyCode.jsValue() + object[Keys.key] = key.jsValue() + object[Keys.code] = code.jsValue() + object[Keys.location] = location.jsValue() + object[Keys.repeat] = `repeat`.jsValue() + object[Keys.isComposing] = isComposing.jsValue() + object[Keys.charCode] = charCode.jsValue() + object[Keys.keyCode] = keyCode.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _key = ReadWriteAttribute(jsObject: object, name: "key") - _code = ReadWriteAttribute(jsObject: object, name: "code") - _location = ReadWriteAttribute(jsObject: object, name: "location") - _repeat = ReadWriteAttribute(jsObject: object, name: "repeat") - _isComposing = ReadWriteAttribute(jsObject: object, name: "isComposing") - _charCode = ReadWriteAttribute(jsObject: object, name: "charCode") - _keyCode = ReadWriteAttribute(jsObject: object, name: "keyCode") + _key = ReadWriteAttribute(jsObject: object, name: Keys.key) + _code = ReadWriteAttribute(jsObject: object, name: Keys.code) + _location = ReadWriteAttribute(jsObject: object, name: Keys.location) + _repeat = ReadWriteAttribute(jsObject: object, name: Keys.repeat) + _isComposing = ReadWriteAttribute(jsObject: object, name: Keys.isComposing) + _charCode = ReadWriteAttribute(jsObject: object, name: Keys.charCode) + _keyCode = ReadWriteAttribute(jsObject: object, name: Keys.keyCode) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/LinkStyle.swift b/Sources/DOMKit/WebIDL/LinkStyle.swift index 8938c6b4..4228b88a 100644 --- a/Sources/DOMKit/WebIDL/LinkStyle.swift +++ b/Sources/DOMKit/WebIDL/LinkStyle.swift @@ -3,7 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let sheet: JSString = "sheet" +} + public protocol LinkStyle: JSBridgedClass {} public extension LinkStyle { - var sheet: CSSStyleSheet? { ReadonlyAttribute["sheet", in: jsObject] } + var sheet: CSSStyleSheet? { ReadonlyAttribute[Keys.sheet, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Location.swift b/Sources/DOMKit/WebIDL/Location.swift index b4aff9c6..6d237d9b 100644 --- a/Sources/DOMKit/WebIDL/Location.swift +++ b/Sources/DOMKit/WebIDL/Location.swift @@ -6,19 +6,35 @@ import JavaScriptKit public class Location: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Location.function! } + private enum Keys { + static let replace: JSString = "replace" + static let assign: JSString = "assign" + static let host: JSString = "host" + static let pathname: JSString = "pathname" + static let ancestorOrigins: JSString = "ancestorOrigins" + static let href: JSString = "href" + static let hostname: JSString = "hostname" + static let reload: JSString = "reload" + static let port: JSString = "port" + static let search: JSString = "search" + static let `protocol`: JSString = "protocol" + static let origin: JSString = "origin" + static let hash: JSString = "hash" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadWriteAttribute(jsObject: jsObject, name: "href") - _origin = ReadonlyAttribute(jsObject: jsObject, name: "origin") - _protocol = ReadWriteAttribute(jsObject: jsObject, name: "protocol") - _host = ReadWriteAttribute(jsObject: jsObject, name: "host") - _hostname = ReadWriteAttribute(jsObject: jsObject, name: "hostname") - _port = ReadWriteAttribute(jsObject: jsObject, name: "port") - _pathname = ReadWriteAttribute(jsObject: jsObject, name: "pathname") - _search = ReadWriteAttribute(jsObject: jsObject, name: "search") - _hash = ReadWriteAttribute(jsObject: jsObject, name: "hash") - _ancestorOrigins = ReadonlyAttribute(jsObject: jsObject, name: "ancestorOrigins") + _href = ReadWriteAttribute(jsObject: jsObject, name: Keys.href) + _origin = ReadonlyAttribute(jsObject: jsObject, name: Keys.origin) + _protocol = ReadWriteAttribute(jsObject: jsObject, name: Keys.protocol) + _host = ReadWriteAttribute(jsObject: jsObject, name: Keys.host) + _hostname = ReadWriteAttribute(jsObject: jsObject, name: Keys.hostname) + _port = ReadWriteAttribute(jsObject: jsObject, name: Keys.port) + _pathname = ReadWriteAttribute(jsObject: jsObject, name: Keys.pathname) + _search = ReadWriteAttribute(jsObject: jsObject, name: Keys.search) + _hash = ReadWriteAttribute(jsObject: jsObject, name: Keys.hash) + _ancestorOrigins = ReadonlyAttribute(jsObject: jsObject, name: Keys.ancestorOrigins) self.jsObject = jsObject } @@ -50,15 +66,15 @@ public class Location: JSBridgedClass { public var hash: String public func assign(url: String) { - _ = jsObject["assign"]!(url.jsValue()) + _ = jsObject[Keys.assign]!(url.jsValue()) } public func replace(url: String) { - _ = jsObject["replace"]!(url.jsValue()) + _ = jsObject[Keys.replace]!(url.jsValue()) } public func reload() { - _ = jsObject["reload"]!() + _ = jsObject[Keys.reload]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaError.swift b/Sources/DOMKit/WebIDL/MediaError.swift index ec72e77a..7c9767c7 100644 --- a/Sources/DOMKit/WebIDL/MediaError.swift +++ b/Sources/DOMKit/WebIDL/MediaError.swift @@ -6,11 +6,20 @@ import JavaScriptKit public class MediaError: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MediaError.function! } + private enum Keys { + static let MEDIA_ERR_NETWORK: JSString = "MEDIA_ERR_NETWORK" + static let MEDIA_ERR_SRC_NOT_SUPPORTED: JSString = "MEDIA_ERR_SRC_NOT_SUPPORTED" + static let message: JSString = "message" + static let MEDIA_ERR_ABORTED: JSString = "MEDIA_ERR_ABORTED" + static let code: JSString = "code" + static let MEDIA_ERR_DECODE: JSString = "MEDIA_ERR_DECODE" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _code = ReadonlyAttribute(jsObject: jsObject, name: "code") - _message = ReadonlyAttribute(jsObject: jsObject, name: "message") + _code = ReadonlyAttribute(jsObject: jsObject, name: Keys.code) + _message = ReadonlyAttribute(jsObject: jsObject, name: Keys.message) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift index 8f022b5d..5ffc1466 100644 --- a/Sources/DOMKit/WebIDL/MediaList.swift +++ b/Sources/DOMKit/WebIDL/MediaList.swift @@ -6,11 +6,19 @@ import JavaScriptKit public class MediaList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MediaList.function! } + private enum Keys { + static let appendMedium: JSString = "appendMedium" + static let deleteMedium: JSString = "deleteMedium" + static let length: JSString = "length" + static let item: JSString = "item" + static let mediaText: JSString = "mediaText" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _mediaText = ReadWriteAttribute(jsObject: jsObject, name: "mediaText") - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _mediaText = ReadWriteAttribute(jsObject: jsObject, name: Keys.mediaText) + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } @@ -25,10 +33,10 @@ public class MediaList: JSBridgedClass { } public func appendMedium(medium: String) { - _ = jsObject["appendMedium"]!(medium.jsValue()) + _ = jsObject[Keys.appendMedium]!(medium.jsValue()) } public func deleteMedium(medium: String) { - _ = jsObject["deleteMedium"]!(medium.jsValue()) + _ = jsObject[Keys.deleteMedium]!(medium.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/MessageChannel.swift b/Sources/DOMKit/WebIDL/MessageChannel.swift index 153fa8e5..7c4390d3 100644 --- a/Sources/DOMKit/WebIDL/MessageChannel.swift +++ b/Sources/DOMKit/WebIDL/MessageChannel.swift @@ -6,11 +6,16 @@ import JavaScriptKit public class MessageChannel: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MessageChannel.function! } + private enum Keys { + static let port2: JSString = "port2" + static let port1: JSString = "port1" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _port1 = ReadonlyAttribute(jsObject: jsObject, name: "port1") - _port2 = ReadonlyAttribute(jsObject: jsObject, name: "port2") + _port1 = ReadonlyAttribute(jsObject: jsObject, name: Keys.port1) + _port2 = ReadonlyAttribute(jsObject: jsObject, name: Keys.port2) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift index ae80176b..89d462b1 100644 --- a/Sources/DOMKit/WebIDL/MessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -6,12 +6,21 @@ import JavaScriptKit public class MessageEvent: Event { override public class var constructor: JSFunction { JSObject.global.MessageEvent.function! } + private enum Keys { + static let initMessageEvent: JSString = "initMessageEvent" + static let origin: JSString = "origin" + static let source: JSString = "source" + static let data: JSString = "data" + static let ports: JSString = "ports" + static let lastEventId: JSString = "lastEventId" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: "data") - _origin = ReadonlyAttribute(jsObject: jsObject, name: "origin") - _lastEventId = ReadonlyAttribute(jsObject: jsObject, name: "lastEventId") - _source = ReadonlyAttribute(jsObject: jsObject, name: "source") - _ports = ReadonlyAttribute(jsObject: jsObject, name: "ports") + _data = ReadonlyAttribute(jsObject: jsObject, name: Keys.data) + _origin = ReadonlyAttribute(jsObject: jsObject, name: Keys.origin) + _lastEventId = ReadonlyAttribute(jsObject: jsObject, name: Keys.lastEventId) + _source = ReadonlyAttribute(jsObject: jsObject, name: Keys.source) + _ports = ReadonlyAttribute(jsObject: jsObject, name: Keys.ports) super.init(unsafelyWrapping: jsObject) } @@ -43,6 +52,6 @@ public class MessageEvent: Event { let _arg5 = lastEventId?.jsValue() ?? .undefined let _arg6 = source?.jsValue() ?? .undefined let _arg7 = ports?.jsValue() ?? .undefined - _ = jsObject["initMessageEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + _ = jsObject[Keys.initMessageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/MessageEventInit.swift b/Sources/DOMKit/WebIDL/MessageEventInit.swift index 35608a5c..f5dabcf2 100644 --- a/Sources/DOMKit/WebIDL/MessageEventInit.swift +++ b/Sources/DOMKit/WebIDL/MessageEventInit.swift @@ -4,22 +4,30 @@ import JavaScriptEventLoop import JavaScriptKit public class MessageEventInit: BridgedDictionary { + private enum Keys { + static let data: JSString = "data" + static let lastEventId: JSString = "lastEventId" + static let origin: JSString = "origin" + static let source: JSString = "source" + static let ports: JSString = "ports" + } + public convenience init(data: JSValue, origin: String, lastEventId: String, source: MessageEventSource?, ports: [MessagePort]) { let object = JSObject.global.Object.function!.new() - object["data"] = data.jsValue() - object["origin"] = origin.jsValue() - object["lastEventId"] = lastEventId.jsValue() - object["source"] = source.jsValue() - object["ports"] = ports.jsValue() + object[Keys.data] = data.jsValue() + object[Keys.origin] = origin.jsValue() + object[Keys.lastEventId] = lastEventId.jsValue() + object[Keys.source] = source.jsValue() + object[Keys.ports] = ports.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _data = ReadWriteAttribute(jsObject: object, name: "data") - _origin = ReadWriteAttribute(jsObject: object, name: "origin") - _lastEventId = ReadWriteAttribute(jsObject: object, name: "lastEventId") - _source = ReadWriteAttribute(jsObject: object, name: "source") - _ports = ReadWriteAttribute(jsObject: object, name: "ports") + _data = ReadWriteAttribute(jsObject: object, name: Keys.data) + _origin = ReadWriteAttribute(jsObject: object, name: Keys.origin) + _lastEventId = ReadWriteAttribute(jsObject: object, name: Keys.lastEventId) + _source = ReadWriteAttribute(jsObject: object, name: Keys.source) + _ports = ReadWriteAttribute(jsObject: object, name: Keys.ports) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift index 276d2ed8..c4b82804 100644 --- a/Sources/DOMKit/WebIDL/MessagePort.swift +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -6,26 +6,34 @@ import JavaScriptKit public class MessagePort: EventTarget { override public class var constructor: JSFunction { JSObject.global.MessagePort.function! } + private enum Keys { + static let onmessageerror: JSString = "onmessageerror" + static let start: JSString = "start" + static let close: JSString = "close" + static let onmessage: JSString = "onmessage" + static let postMessage: JSString = "postMessage" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessageerror") + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessageerror) super.init(unsafelyWrapping: jsObject) } public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject["postMessage"]!(message.jsValue(), transfer.jsValue()) + _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject["postMessage"]!(message.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } public func start() { - _ = jsObject["start"]!() + _ = jsObject[Keys.start]!() } public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/MimeType.swift b/Sources/DOMKit/WebIDL/MimeType.swift index caeb17bf..d419ea43 100644 --- a/Sources/DOMKit/WebIDL/MimeType.swift +++ b/Sources/DOMKit/WebIDL/MimeType.swift @@ -6,13 +6,20 @@ import JavaScriptKit public class MimeType: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MimeType.function! } + private enum Keys { + static let enabledPlugin: JSString = "enabledPlugin" + static let type: JSString = "type" + static let description: JSString = "description" + static let suffixes: JSString = "suffixes" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") - _description = ReadonlyAttribute(jsObject: jsObject, name: "description") - _suffixes = ReadonlyAttribute(jsObject: jsObject, name: "suffixes") - _enabledPlugin = ReadonlyAttribute(jsObject: jsObject, name: "enabledPlugin") + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _description = ReadonlyAttribute(jsObject: jsObject, name: Keys.description) + _suffixes = ReadonlyAttribute(jsObject: jsObject, name: Keys.suffixes) + _enabledPlugin = ReadonlyAttribute(jsObject: jsObject, name: Keys.enabledPlugin) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/MimeTypeArray.swift b/Sources/DOMKit/WebIDL/MimeTypeArray.swift index be7e8371..47ba8857 100644 --- a/Sources/DOMKit/WebIDL/MimeTypeArray.swift +++ b/Sources/DOMKit/WebIDL/MimeTypeArray.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class MimeTypeArray: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MimeTypeArray.function! } + private enum Keys { + static let item: JSString = "item" + static let length: JSString = "length" + static let namedItem: JSString = "namedItem" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index 55359a74..24ce9adb 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -6,18 +6,34 @@ import JavaScriptKit public class MouseEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.MouseEvent.function! } + private enum Keys { + static let ctrlKey: JSString = "ctrlKey" + static let shiftKey: JSString = "shiftKey" + static let altKey: JSString = "altKey" + static let screenY: JSString = "screenY" + static let metaKey: JSString = "metaKey" + static let button: JSString = "button" + static let relatedTarget: JSString = "relatedTarget" + static let screenX: JSString = "screenX" + static let buttons: JSString = "buttons" + static let clientX: JSString = "clientX" + static let getModifierState: JSString = "getModifierState" + static let initMouseEvent: JSString = "initMouseEvent" + static let clientY: JSString = "clientY" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _screenX = ReadonlyAttribute(jsObject: jsObject, name: "screenX") - _screenY = ReadonlyAttribute(jsObject: jsObject, name: "screenY") - _clientX = ReadonlyAttribute(jsObject: jsObject, name: "clientX") - _clientY = ReadonlyAttribute(jsObject: jsObject, name: "clientY") - _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: "ctrlKey") - _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: "shiftKey") - _altKey = ReadonlyAttribute(jsObject: jsObject, name: "altKey") - _metaKey = ReadonlyAttribute(jsObject: jsObject, name: "metaKey") - _button = ReadonlyAttribute(jsObject: jsObject, name: "button") - _buttons = ReadonlyAttribute(jsObject: jsObject, name: "buttons") - _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: "relatedTarget") + _screenX = ReadonlyAttribute(jsObject: jsObject, name: Keys.screenX) + _screenY = ReadonlyAttribute(jsObject: jsObject, name: Keys.screenY) + _clientX = ReadonlyAttribute(jsObject: jsObject, name: Keys.clientX) + _clientY = ReadonlyAttribute(jsObject: jsObject, name: Keys.clientY) + _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.ctrlKey) + _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.shiftKey) + _altKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.altKey) + _metaKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.metaKey) + _button = ReadonlyAttribute(jsObject: jsObject, name: Keys.button) + _buttons = ReadonlyAttribute(jsObject: jsObject, name: Keys.buttons) + _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Keys.relatedTarget) super.init(unsafelyWrapping: jsObject) } @@ -59,7 +75,7 @@ public class MouseEvent: UIEvent { public var relatedTarget: EventTarget? public func getModifierState(keyArg: String) -> Bool { - jsObject["getModifierState"]!(keyArg.jsValue()).fromJSValue()! + jsObject[Keys.getModifierState]!(keyArg.jsValue()).fromJSValue()! } public func initMouseEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil, screenXArg: Int32? = nil, screenYArg: Int32? = nil, clientXArg: Int32? = nil, clientYArg: Int32? = nil, ctrlKeyArg: Bool? = nil, altKeyArg: Bool? = nil, shiftKeyArg: Bool? = nil, metaKeyArg: Bool? = nil, buttonArg: Int16? = nil, relatedTargetArg: EventTarget? = nil) { @@ -78,6 +94,6 @@ public class MouseEvent: UIEvent { let _arg12 = metaKeyArg?.jsValue() ?? .undefined let _arg13 = buttonArg?.jsValue() ?? .undefined let _arg14 = relatedTargetArg?.jsValue() ?? .undefined - _ = jsObject["initMouseEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14) + _ = jsObject[Keys.initMouseEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14) } } diff --git a/Sources/DOMKit/WebIDL/MouseEventInit.swift b/Sources/DOMKit/WebIDL/MouseEventInit.swift index ebfea6da..11fe163d 100644 --- a/Sources/DOMKit/WebIDL/MouseEventInit.swift +++ b/Sources/DOMKit/WebIDL/MouseEventInit.swift @@ -4,26 +4,36 @@ import JavaScriptEventLoop import JavaScriptKit public class MouseEventInit: BridgedDictionary { + private enum Keys { + static let button: JSString = "button" + static let relatedTarget: JSString = "relatedTarget" + static let clientY: JSString = "clientY" + static let clientX: JSString = "clientX" + static let buttons: JSString = "buttons" + static let screenY: JSString = "screenY" + static let screenX: JSString = "screenX" + } + public convenience init(screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { let object = JSObject.global.Object.function!.new() - object["screenX"] = screenX.jsValue() - object["screenY"] = screenY.jsValue() - object["clientX"] = clientX.jsValue() - object["clientY"] = clientY.jsValue() - object["button"] = button.jsValue() - object["buttons"] = buttons.jsValue() - object["relatedTarget"] = relatedTarget.jsValue() + object[Keys.screenX] = screenX.jsValue() + object[Keys.screenY] = screenY.jsValue() + object[Keys.clientX] = clientX.jsValue() + object[Keys.clientY] = clientY.jsValue() + object[Keys.button] = button.jsValue() + object[Keys.buttons] = buttons.jsValue() + object[Keys.relatedTarget] = relatedTarget.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _screenX = ReadWriteAttribute(jsObject: object, name: "screenX") - _screenY = ReadWriteAttribute(jsObject: object, name: "screenY") - _clientX = ReadWriteAttribute(jsObject: object, name: "clientX") - _clientY = ReadWriteAttribute(jsObject: object, name: "clientY") - _button = ReadWriteAttribute(jsObject: object, name: "button") - _buttons = ReadWriteAttribute(jsObject: object, name: "buttons") - _relatedTarget = ReadWriteAttribute(jsObject: object, name: "relatedTarget") + _screenX = ReadWriteAttribute(jsObject: object, name: Keys.screenX) + _screenY = ReadWriteAttribute(jsObject: object, name: Keys.screenY) + _clientX = ReadWriteAttribute(jsObject: object, name: Keys.clientX) + _clientY = ReadWriteAttribute(jsObject: object, name: Keys.clientY) + _button = ReadWriteAttribute(jsObject: object, name: Keys.button) + _buttons = ReadWriteAttribute(jsObject: object, name: Keys.buttons) + _relatedTarget = ReadWriteAttribute(jsObject: object, name: Keys.relatedTarget) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift index a0dfb433..dba530e4 100644 --- a/Sources/DOMKit/WebIDL/MutationEvent.swift +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -6,12 +6,24 @@ import JavaScriptKit public class MutationEvent: Event { override public class var constructor: JSFunction { JSObject.global.MutationEvent.function! } + private enum Keys { + static let attrName: JSString = "attrName" + static let attrChange: JSString = "attrChange" + static let newValue: JSString = "newValue" + static let ADDITION: JSString = "ADDITION" + static let initMutationEvent: JSString = "initMutationEvent" + static let prevValue: JSString = "prevValue" + static let MODIFICATION: JSString = "MODIFICATION" + static let REMOVAL: JSString = "REMOVAL" + static let relatedNode: JSString = "relatedNode" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _relatedNode = ReadonlyAttribute(jsObject: jsObject, name: "relatedNode") - _prevValue = ReadonlyAttribute(jsObject: jsObject, name: "prevValue") - _newValue = ReadonlyAttribute(jsObject: jsObject, name: "newValue") - _attrName = ReadonlyAttribute(jsObject: jsObject, name: "attrName") - _attrChange = ReadonlyAttribute(jsObject: jsObject, name: "attrChange") + _relatedNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.relatedNode) + _prevValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.prevValue) + _newValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.newValue) + _attrName = ReadonlyAttribute(jsObject: jsObject, name: Keys.attrName) + _attrChange = ReadonlyAttribute(jsObject: jsObject, name: Keys.attrChange) super.init(unsafelyWrapping: jsObject) } @@ -45,6 +57,6 @@ public class MutationEvent: Event { let _arg5 = newValueArg?.jsValue() ?? .undefined let _arg6 = attrNameArg?.jsValue() ?? .undefined let _arg7 = attrChangeArg?.jsValue() ?? .undefined - _ = jsObject["initMutationEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + _ = jsObject[Keys.initMutationEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/MutationObserver.swift b/Sources/DOMKit/WebIDL/MutationObserver.swift index d1f1fe03..ccead703 100644 --- a/Sources/DOMKit/WebIDL/MutationObserver.swift +++ b/Sources/DOMKit/WebIDL/MutationObserver.swift @@ -6,6 +6,12 @@ import JavaScriptKit public class MutationObserver: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MutationObserver.function! } + private enum Keys { + static let observe: JSString = "observe" + static let disconnect: JSString = "disconnect" + static let takeRecords: JSString = "takeRecords" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -15,14 +21,14 @@ public class MutationObserver: JSBridgedClass { // XXX: constructor is ignored public func observe(target: Node, options: MutationObserverInit? = nil) { - _ = jsObject["observe"]!(target.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Keys.observe]!(target.jsValue(), options?.jsValue() ?? .undefined) } public func disconnect() { - _ = jsObject["disconnect"]!() + _ = jsObject[Keys.disconnect]!() } public func takeRecords() -> [MutationRecord] { - jsObject["takeRecords"]!().fromJSValue()! + jsObject[Keys.takeRecords]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MutationObserverInit.swift b/Sources/DOMKit/WebIDL/MutationObserverInit.swift index 3e76b371..77ea648c 100644 --- a/Sources/DOMKit/WebIDL/MutationObserverInit.swift +++ b/Sources/DOMKit/WebIDL/MutationObserverInit.swift @@ -4,26 +4,36 @@ import JavaScriptEventLoop import JavaScriptKit public class MutationObserverInit: BridgedDictionary { + private enum Keys { + static let characterDataOldValue: JSString = "characterDataOldValue" + static let childList: JSString = "childList" + static let attributes: JSString = "attributes" + static let attributeFilter: JSString = "attributeFilter" + static let subtree: JSString = "subtree" + static let attributeOldValue: JSString = "attributeOldValue" + static let characterData: JSString = "characterData" + } + public convenience init(childList: Bool, attributes: Bool, characterData: Bool, subtree: Bool, attributeOldValue: Bool, characterDataOldValue: Bool, attributeFilter: [String]) { let object = JSObject.global.Object.function!.new() - object["childList"] = childList.jsValue() - object["attributes"] = attributes.jsValue() - object["characterData"] = characterData.jsValue() - object["subtree"] = subtree.jsValue() - object["attributeOldValue"] = attributeOldValue.jsValue() - object["characterDataOldValue"] = characterDataOldValue.jsValue() - object["attributeFilter"] = attributeFilter.jsValue() + object[Keys.childList] = childList.jsValue() + object[Keys.attributes] = attributes.jsValue() + object[Keys.characterData] = characterData.jsValue() + object[Keys.subtree] = subtree.jsValue() + object[Keys.attributeOldValue] = attributeOldValue.jsValue() + object[Keys.characterDataOldValue] = characterDataOldValue.jsValue() + object[Keys.attributeFilter] = attributeFilter.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _childList = ReadWriteAttribute(jsObject: object, name: "childList") - _attributes = ReadWriteAttribute(jsObject: object, name: "attributes") - _characterData = ReadWriteAttribute(jsObject: object, name: "characterData") - _subtree = ReadWriteAttribute(jsObject: object, name: "subtree") - _attributeOldValue = ReadWriteAttribute(jsObject: object, name: "attributeOldValue") - _characterDataOldValue = ReadWriteAttribute(jsObject: object, name: "characterDataOldValue") - _attributeFilter = ReadWriteAttribute(jsObject: object, name: "attributeFilter") + _childList = ReadWriteAttribute(jsObject: object, name: Keys.childList) + _attributes = ReadWriteAttribute(jsObject: object, name: Keys.attributes) + _characterData = ReadWriteAttribute(jsObject: object, name: Keys.characterData) + _subtree = ReadWriteAttribute(jsObject: object, name: Keys.subtree) + _attributeOldValue = ReadWriteAttribute(jsObject: object, name: Keys.attributeOldValue) + _characterDataOldValue = ReadWriteAttribute(jsObject: object, name: Keys.characterDataOldValue) + _attributeFilter = ReadWriteAttribute(jsObject: object, name: Keys.attributeFilter) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MutationRecord.swift b/Sources/DOMKit/WebIDL/MutationRecord.swift index 00d08213..1ab0c055 100644 --- a/Sources/DOMKit/WebIDL/MutationRecord.swift +++ b/Sources/DOMKit/WebIDL/MutationRecord.swift @@ -6,18 +6,30 @@ import JavaScriptKit public class MutationRecord: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MutationRecord.function! } + private enum Keys { + static let type: JSString = "type" + static let removedNodes: JSString = "removedNodes" + static let previousSibling: JSString = "previousSibling" + static let attributeNamespace: JSString = "attributeNamespace" + static let nextSibling: JSString = "nextSibling" + static let target: JSString = "target" + static let attributeName: JSString = "attributeName" + static let oldValue: JSString = "oldValue" + static let addedNodes: JSString = "addedNodes" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") - _target = ReadonlyAttribute(jsObject: jsObject, name: "target") - _addedNodes = ReadonlyAttribute(jsObject: jsObject, name: "addedNodes") - _removedNodes = ReadonlyAttribute(jsObject: jsObject, name: "removedNodes") - _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: "previousSibling") - _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: "nextSibling") - _attributeName = ReadonlyAttribute(jsObject: jsObject, name: "attributeName") - _attributeNamespace = ReadonlyAttribute(jsObject: jsObject, name: "attributeNamespace") - _oldValue = ReadonlyAttribute(jsObject: jsObject, name: "oldValue") + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _target = ReadonlyAttribute(jsObject: jsObject, name: Keys.target) + _addedNodes = ReadonlyAttribute(jsObject: jsObject, name: Keys.addedNodes) + _removedNodes = ReadonlyAttribute(jsObject: jsObject, name: Keys.removedNodes) + _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: Keys.previousSibling) + _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: Keys.nextSibling) + _attributeName = ReadonlyAttribute(jsObject: jsObject, name: Keys.attributeName) + _attributeNamespace = ReadonlyAttribute(jsObject: jsObject, name: Keys.attributeNamespace) + _oldValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.oldValue) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/NamedNodeMap.swift b/Sources/DOMKit/WebIDL/NamedNodeMap.swift index 736320d8..418c5066 100644 --- a/Sources/DOMKit/WebIDL/NamedNodeMap.swift +++ b/Sources/DOMKit/WebIDL/NamedNodeMap.swift @@ -6,10 +6,21 @@ import JavaScriptKit public class NamedNodeMap: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.NamedNodeMap.function! } + private enum Keys { + static let setNamedItemNS: JSString = "setNamedItemNS" + static let removeNamedItem: JSString = "removeNamedItem" + static let removeNamedItemNS: JSString = "removeNamedItemNS" + static let length: JSString = "length" + static let getNamedItem: JSString = "getNamedItem" + static let getNamedItemNS: JSString = "getNamedItemNS" + static let setNamedItem: JSString = "setNamedItem" + static let item: JSString = "item" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } @@ -25,22 +36,22 @@ public class NamedNodeMap: JSBridgedClass { } public func getNamedItemNS(namespace: String?, localName: String) -> Attr? { - jsObject["getNamedItemNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Keys.getNamedItemNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func setNamedItem(attr: Attr) -> Attr? { - jsObject["setNamedItem"]!(attr.jsValue()).fromJSValue()! + jsObject[Keys.setNamedItem]!(attr.jsValue()).fromJSValue()! } public func setNamedItemNS(attr: Attr) -> Attr? { - jsObject["setNamedItemNS"]!(attr.jsValue()).fromJSValue()! + jsObject[Keys.setNamedItemNS]!(attr.jsValue()).fromJSValue()! } public func removeNamedItem(qualifiedName: String) -> Attr { - jsObject["removeNamedItem"]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Keys.removeNamedItem]!(qualifiedName.jsValue()).fromJSValue()! } public func removeNamedItemNS(namespace: String?, localName: String) -> Attr { - jsObject["removeNamedItemNS"]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Keys.removeNamedItemNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index 40e14532..a6079f57 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class Navigator: JSBridgedClass, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware { public class var constructor: JSFunction { JSObject.global.Navigator.function! } + private enum Keys {} + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift b/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift index fe4538f3..85c27b37 100644 --- a/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift +++ b/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift @@ -3,7 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let hardwareConcurrency: JSString = "hardwareConcurrency" +} + public protocol NavigatorConcurrentHardware: JSBridgedClass {} public extension NavigatorConcurrentHardware { - var hardwareConcurrency: UInt64 { ReadonlyAttribute["hardwareConcurrency", in: jsObject] } + var hardwareConcurrency: UInt64 { ReadonlyAttribute[Keys.hardwareConcurrency, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift index 337366b2..6ab3af30 100644 --- a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift +++ b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift @@ -3,13 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" + static let registerProtocolHandler: JSString = "registerProtocolHandler" +} + public protocol NavigatorContentUtils: JSBridgedClass {} public extension NavigatorContentUtils { func registerProtocolHandler(scheme: String, url: String) { - _ = jsObject["registerProtocolHandler"]!(scheme.jsValue(), url.jsValue()) + _ = jsObject[Keys.registerProtocolHandler]!(scheme.jsValue(), url.jsValue()) } func unregisterProtocolHandler(scheme: String, url: String) { - _ = jsObject["unregisterProtocolHandler"]!(scheme.jsValue(), url.jsValue()) + _ = jsObject[Keys.unregisterProtocolHandler]!(scheme.jsValue(), url.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/NavigatorCookies.swift b/Sources/DOMKit/WebIDL/NavigatorCookies.swift index 2b7bcfd3..e3a6ea5f 100644 --- a/Sources/DOMKit/WebIDL/NavigatorCookies.swift +++ b/Sources/DOMKit/WebIDL/NavigatorCookies.swift @@ -3,7 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let cookieEnabled: JSString = "cookieEnabled" +} + public protocol NavigatorCookies: JSBridgedClass {} public extension NavigatorCookies { - var cookieEnabled: Bool { ReadonlyAttribute["cookieEnabled", in: jsObject] } + var cookieEnabled: Bool { ReadonlyAttribute[Keys.cookieEnabled, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorID.swift b/Sources/DOMKit/WebIDL/NavigatorID.swift index 8687d818..fda29a7a 100644 --- a/Sources/DOMKit/WebIDL/NavigatorID.swift +++ b/Sources/DOMKit/WebIDL/NavigatorID.swift @@ -3,29 +3,43 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let appVersion: JSString = "appVersion" + static let product: JSString = "product" + static let userAgent: JSString = "userAgent" + static let productSub: JSString = "productSub" + static let vendor: JSString = "vendor" + static let oscpu: JSString = "oscpu" + static let platform: JSString = "platform" + static let appName: JSString = "appName" + static let appCodeName: JSString = "appCodeName" + static let vendorSub: JSString = "vendorSub" + static let taintEnabled: JSString = "taintEnabled" +} + public protocol NavigatorID: JSBridgedClass {} public extension NavigatorID { - var appCodeName: String { ReadonlyAttribute["appCodeName", in: jsObject] } + var appCodeName: String { ReadonlyAttribute[Keys.appCodeName, in: jsObject] } - var appName: String { ReadonlyAttribute["appName", in: jsObject] } + var appName: String { ReadonlyAttribute[Keys.appName, in: jsObject] } - var appVersion: String { ReadonlyAttribute["appVersion", in: jsObject] } + var appVersion: String { ReadonlyAttribute[Keys.appVersion, in: jsObject] } - var platform: String { ReadonlyAttribute["platform", in: jsObject] } + var platform: String { ReadonlyAttribute[Keys.platform, in: jsObject] } - var product: String { ReadonlyAttribute["product", in: jsObject] } + var product: String { ReadonlyAttribute[Keys.product, in: jsObject] } - var productSub: String { ReadonlyAttribute["productSub", in: jsObject] } + var productSub: String { ReadonlyAttribute[Keys.productSub, in: jsObject] } - var userAgent: String { ReadonlyAttribute["userAgent", in: jsObject] } + var userAgent: String { ReadonlyAttribute[Keys.userAgent, in: jsObject] } - var vendor: String { ReadonlyAttribute["vendor", in: jsObject] } + var vendor: String { ReadonlyAttribute[Keys.vendor, in: jsObject] } - var vendorSub: String { ReadonlyAttribute["vendorSub", in: jsObject] } + var vendorSub: String { ReadonlyAttribute[Keys.vendorSub, in: jsObject] } func taintEnabled() -> Bool { - jsObject["taintEnabled"]!().fromJSValue()! + jsObject[Keys.taintEnabled]!().fromJSValue()! } - var oscpu: String { ReadonlyAttribute["oscpu", in: jsObject] } + var oscpu: String { ReadonlyAttribute[Keys.oscpu, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorLanguage.swift b/Sources/DOMKit/WebIDL/NavigatorLanguage.swift index bdc16494..bcb6d4e9 100644 --- a/Sources/DOMKit/WebIDL/NavigatorLanguage.swift +++ b/Sources/DOMKit/WebIDL/NavigatorLanguage.swift @@ -3,9 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let language: JSString = "language" + static let languages: JSString = "languages" +} + public protocol NavigatorLanguage: JSBridgedClass {} public extension NavigatorLanguage { - var language: String { ReadonlyAttribute["language", in: jsObject] } + var language: String { ReadonlyAttribute[Keys.language, in: jsObject] } - var languages: [String] { ReadonlyAttribute["languages", in: jsObject] } + var languages: [String] { ReadonlyAttribute[Keys.languages, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorOnLine.swift b/Sources/DOMKit/WebIDL/NavigatorOnLine.swift index 88523a00..617c8792 100644 --- a/Sources/DOMKit/WebIDL/NavigatorOnLine.swift +++ b/Sources/DOMKit/WebIDL/NavigatorOnLine.swift @@ -3,7 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let onLine: JSString = "onLine" +} + public protocol NavigatorOnLine: JSBridgedClass {} public extension NavigatorOnLine { - var onLine: Bool { ReadonlyAttribute["onLine", in: jsObject] } + var onLine: Bool { ReadonlyAttribute[Keys.onLine, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift index 0e1534ef..4bbeee0f 100644 --- a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift +++ b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift @@ -3,15 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let pdfViewerEnabled: JSString = "pdfViewerEnabled" + static let plugins: JSString = "plugins" + static let mimeTypes: JSString = "mimeTypes" + static let javaEnabled: JSString = "javaEnabled" +} + public protocol NavigatorPlugins: JSBridgedClass {} public extension NavigatorPlugins { - var plugins: PluginArray { ReadonlyAttribute["plugins", in: jsObject] } + var plugins: PluginArray { ReadonlyAttribute[Keys.plugins, in: jsObject] } - var mimeTypes: MimeTypeArray { ReadonlyAttribute["mimeTypes", in: jsObject] } + var mimeTypes: MimeTypeArray { ReadonlyAttribute[Keys.mimeTypes, in: jsObject] } func javaEnabled() -> Bool { - jsObject["javaEnabled"]!().fromJSValue()! + jsObject[Keys.javaEnabled]!().fromJSValue()! } - var pdfViewerEnabled: Bool { ReadonlyAttribute["pdfViewerEnabled", in: jsObject] } + var pdfViewerEnabled: Bool { ReadonlyAttribute[Keys.pdfViewerEnabled, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Node.swift b/Sources/DOMKit/WebIDL/Node.swift index 25f6d100..20c509b3 100644 --- a/Sources/DOMKit/WebIDL/Node.swift +++ b/Sources/DOMKit/WebIDL/Node.swift @@ -6,21 +6,71 @@ import JavaScriptKit public class Node: EventTarget { override public class var constructor: JSFunction { JSObject.global.Node.function! } + private enum Keys { + static let hasChildNodes: JSString = "hasChildNodes" + static let previousSibling: JSString = "previousSibling" + static let DOCUMENT_POSITION_DISCONNECTED: JSString = "DOCUMENT_POSITION_DISCONNECTED" + static let DOCUMENT_POSITION_PRECEDING: JSString = "DOCUMENT_POSITION_PRECEDING" + static let DOCUMENT_POSITION_CONTAINED_BY: JSString = "DOCUMENT_POSITION_CONTAINED_BY" + static let compareDocumentPosition: JSString = "compareDocumentPosition" + static let getRootNode: JSString = "getRootNode" + static let DOCUMENT_TYPE_NODE: JSString = "DOCUMENT_TYPE_NODE" + static let lookupPrefix: JSString = "lookupPrefix" + static let TEXT_NODE: JSString = "TEXT_NODE" + static let lookupNamespaceURI: JSString = "lookupNamespaceURI" + static let isDefaultNamespace: JSString = "isDefaultNamespace" + static let normalize: JSString = "normalize" + static let insertBefore: JSString = "insertBefore" + static let ATTRIBUTE_NODE: JSString = "ATTRIBUTE_NODE" + static let replaceChild: JSString = "replaceChild" + static let parentElement: JSString = "parentElement" + static let isEqualNode: JSString = "isEqualNode" + static let textContent: JSString = "textContent" + static let PROCESSING_INSTRUCTION_NODE: JSString = "PROCESSING_INSTRUCTION_NODE" + static let ENTITY_REFERENCE_NODE: JSString = "ENTITY_REFERENCE_NODE" + static let lastChild: JSString = "lastChild" + static let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: JSString = "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" + static let nodeValue: JSString = "nodeValue" + static let appendChild: JSString = "appendChild" + static let DOCUMENT_FRAGMENT_NODE: JSString = "DOCUMENT_FRAGMENT_NODE" + static let firstChild: JSString = "firstChild" + static let nodeName: JSString = "nodeName" + static let CDATA_SECTION_NODE: JSString = "CDATA_SECTION_NODE" + static let isConnected: JSString = "isConnected" + static let ENTITY_NODE: JSString = "ENTITY_NODE" + static let ELEMENT_NODE: JSString = "ELEMENT_NODE" + static let DOCUMENT_POSITION_FOLLOWING: JSString = "DOCUMENT_POSITION_FOLLOWING" + static let nodeType: JSString = "nodeType" + static let contains: JSString = "contains" + static let removeChild: JSString = "removeChild" + static let NOTATION_NODE: JSString = "NOTATION_NODE" + static let isSameNode: JSString = "isSameNode" + static let DOCUMENT_NODE: JSString = "DOCUMENT_NODE" + static let nextSibling: JSString = "nextSibling" + static let cloneNode: JSString = "cloneNode" + static let parentNode: JSString = "parentNode" + static let childNodes: JSString = "childNodes" + static let COMMENT_NODE: JSString = "COMMENT_NODE" + static let baseURI: JSString = "baseURI" + static let ownerDocument: JSString = "ownerDocument" + static let DOCUMENT_POSITION_CONTAINS: JSString = "DOCUMENT_POSITION_CONTAINS" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _nodeType = ReadonlyAttribute(jsObject: jsObject, name: "nodeType") - _nodeName = ReadonlyAttribute(jsObject: jsObject, name: "nodeName") - _baseURI = ReadonlyAttribute(jsObject: jsObject, name: "baseURI") - _isConnected = ReadonlyAttribute(jsObject: jsObject, name: "isConnected") - _ownerDocument = ReadonlyAttribute(jsObject: jsObject, name: "ownerDocument") - _parentNode = ReadonlyAttribute(jsObject: jsObject, name: "parentNode") - _parentElement = ReadonlyAttribute(jsObject: jsObject, name: "parentElement") - _childNodes = ReadonlyAttribute(jsObject: jsObject, name: "childNodes") - _firstChild = ReadonlyAttribute(jsObject: jsObject, name: "firstChild") - _lastChild = ReadonlyAttribute(jsObject: jsObject, name: "lastChild") - _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: "previousSibling") - _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: "nextSibling") - _nodeValue = ReadWriteAttribute(jsObject: jsObject, name: "nodeValue") - _textContent = ReadWriteAttribute(jsObject: jsObject, name: "textContent") + _nodeType = ReadonlyAttribute(jsObject: jsObject, name: Keys.nodeType) + _nodeName = ReadonlyAttribute(jsObject: jsObject, name: Keys.nodeName) + _baseURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.baseURI) + _isConnected = ReadonlyAttribute(jsObject: jsObject, name: Keys.isConnected) + _ownerDocument = ReadonlyAttribute(jsObject: jsObject, name: Keys.ownerDocument) + _parentNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentNode) + _parentElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentElement) + _childNodes = ReadonlyAttribute(jsObject: jsObject, name: Keys.childNodes) + _firstChild = ReadonlyAttribute(jsObject: jsObject, name: Keys.firstChild) + _lastChild = ReadonlyAttribute(jsObject: jsObject, name: Keys.lastChild) + _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: Keys.previousSibling) + _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: Keys.nextSibling) + _nodeValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.nodeValue) + _textContent = ReadWriteAttribute(jsObject: jsObject, name: Keys.textContent) super.init(unsafelyWrapping: jsObject) } @@ -64,7 +114,7 @@ public class Node: EventTarget { public var ownerDocument: Document? public func getRootNode(options: GetRootNodeOptions? = nil) -> Self { - jsObject["getRootNode"]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.getRootNode]!(options?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -74,7 +124,7 @@ public class Node: EventTarget { public var parentElement: Element? public func hasChildNodes() -> Bool { - jsObject["hasChildNodes"]!().fromJSValue()! + jsObject[Keys.hasChildNodes]!().fromJSValue()! } @ReadonlyAttribute @@ -99,19 +149,19 @@ public class Node: EventTarget { public var textContent: String? public func normalize() { - _ = jsObject["normalize"]!() + _ = jsObject[Keys.normalize]!() } public func cloneNode(deep: Bool? = nil) -> Self { - jsObject["cloneNode"]!(deep?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.cloneNode]!(deep?.jsValue() ?? .undefined).fromJSValue()! } public func isEqualNode(otherNode: Node?) -> Bool { - jsObject["isEqualNode"]!(otherNode.jsValue()).fromJSValue()! + jsObject[Keys.isEqualNode]!(otherNode.jsValue()).fromJSValue()! } public func isSameNode(otherNode: Node?) -> Bool { - jsObject["isSameNode"]!(otherNode.jsValue()).fromJSValue()! + jsObject[Keys.isSameNode]!(otherNode.jsValue()).fromJSValue()! } public static let DOCUMENT_POSITION_DISCONNECTED: UInt16 = 0x01 @@ -127,38 +177,38 @@ public class Node: EventTarget { public static let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: UInt16 = 0x20 public func compareDocumentPosition(other: Node) -> UInt16 { - jsObject["compareDocumentPosition"]!(other.jsValue()).fromJSValue()! + jsObject[Keys.compareDocumentPosition]!(other.jsValue()).fromJSValue()! } public func contains(other: Node?) -> Bool { - jsObject["contains"]!(other.jsValue()).fromJSValue()! + jsObject[Keys.contains]!(other.jsValue()).fromJSValue()! } public func lookupPrefix(namespace: String?) -> String? { - jsObject["lookupPrefix"]!(namespace.jsValue()).fromJSValue()! + jsObject[Keys.lookupPrefix]!(namespace.jsValue()).fromJSValue()! } public func lookupNamespaceURI(prefix: String?) -> String? { - jsObject["lookupNamespaceURI"]!(prefix.jsValue()).fromJSValue()! + jsObject[Keys.lookupNamespaceURI]!(prefix.jsValue()).fromJSValue()! } public func isDefaultNamespace(namespace: String?) -> Bool { - jsObject["isDefaultNamespace"]!(namespace.jsValue()).fromJSValue()! + jsObject[Keys.isDefaultNamespace]!(namespace.jsValue()).fromJSValue()! } public func insertBefore(node: Node, child: Node?) -> Self { - jsObject["insertBefore"]!(node.jsValue(), child.jsValue()).fromJSValue()! + jsObject[Keys.insertBefore]!(node.jsValue(), child.jsValue()).fromJSValue()! } public func appendChild(node: Node) -> Self { - jsObject["appendChild"]!(node.jsValue()).fromJSValue()! + jsObject[Keys.appendChild]!(node.jsValue()).fromJSValue()! } public func replaceChild(node: Node, child: Node) -> Self { - jsObject["replaceChild"]!(node.jsValue(), child.jsValue()).fromJSValue()! + jsObject[Keys.replaceChild]!(node.jsValue(), child.jsValue()).fromJSValue()! } public func removeChild(child: Node) -> Self { - jsObject["removeChild"]!(child.jsValue()).fromJSValue()! + jsObject[Keys.removeChild]!(child.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NodeIterator.swift b/Sources/DOMKit/WebIDL/NodeIterator.swift index 78c31a68..3c1410ec 100644 --- a/Sources/DOMKit/WebIDL/NodeIterator.swift +++ b/Sources/DOMKit/WebIDL/NodeIterator.swift @@ -6,13 +6,24 @@ import JavaScriptKit public class NodeIterator: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.NodeIterator.function! } + private enum Keys { + static let filter: JSString = "filter" + static let whatToShow: JSString = "whatToShow" + static let previousNode: JSString = "previousNode" + static let root: JSString = "root" + static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" + static let nextNode: JSString = "nextNode" + static let detach: JSString = "detach" + static let referenceNode: JSString = "referenceNode" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _root = ReadonlyAttribute(jsObject: jsObject, name: "root") - _referenceNode = ReadonlyAttribute(jsObject: jsObject, name: "referenceNode") - _pointerBeforeReferenceNode = ReadonlyAttribute(jsObject: jsObject, name: "pointerBeforeReferenceNode") - _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: "whatToShow") + _root = ReadonlyAttribute(jsObject: jsObject, name: Keys.root) + _referenceNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.referenceNode) + _pointerBeforeReferenceNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.pointerBeforeReferenceNode) + _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: Keys.whatToShow) self.jsObject = jsObject } @@ -31,14 +42,14 @@ public class NodeIterator: JSBridgedClass { // XXX: member 'filter' is ignored public func nextNode() -> Node? { - jsObject["nextNode"]!().fromJSValue()! + jsObject[Keys.nextNode]!().fromJSValue()! } public func previousNode() -> Node? { - jsObject["previousNode"]!().fromJSValue()! + jsObject[Keys.previousNode]!().fromJSValue()! } public func detach() { - _ = jsObject["detach"]!() + _ = jsObject[Keys.detach]!() } } diff --git a/Sources/DOMKit/WebIDL/NodeList.swift b/Sources/DOMKit/WebIDL/NodeList.swift index 3b469c2b..2c515eeb 100644 --- a/Sources/DOMKit/WebIDL/NodeList.swift +++ b/Sources/DOMKit/WebIDL/NodeList.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class NodeList: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.NodeList.function! } + private enum Keys { + static let item: JSString = "item" + static let length: JSString = "length" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift b/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift index 2ffa5876..8674067c 100644 --- a/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift +++ b/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift @@ -3,9 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let nextElementSibling: JSString = "nextElementSibling" + static let previousElementSibling: JSString = "previousElementSibling" +} + public protocol NonDocumentTypeChildNode: JSBridgedClass {} public extension NonDocumentTypeChildNode { - var previousElementSibling: Element? { ReadonlyAttribute["previousElementSibling", in: jsObject] } + var previousElementSibling: Element? { ReadonlyAttribute[Keys.previousElementSibling, in: jsObject] } - var nextElementSibling: Element? { ReadonlyAttribute["nextElementSibling", in: jsObject] } + var nextElementSibling: Element? { ReadonlyAttribute[Keys.nextElementSibling, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NonElementParentNode.swift b/Sources/DOMKit/WebIDL/NonElementParentNode.swift index 8a2b2c58..8785975a 100644 --- a/Sources/DOMKit/WebIDL/NonElementParentNode.swift +++ b/Sources/DOMKit/WebIDL/NonElementParentNode.swift @@ -3,9 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let getElementById: JSString = "getElementById" +} + public protocol NonElementParentNode: JSBridgedClass {} public extension NonElementParentNode { func getElementById(elementId: String) -> Element? { - jsObject["getElementById"]!(elementId.jsValue()).fromJSValue()! + jsObject[Keys.getElementById]!(elementId.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift index 9aa81aed..393dbf72 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -6,11 +6,21 @@ import JavaScriptKit public class OffscreenCanvas: EventTarget { override public class var constructor: JSFunction { JSObject.global.OffscreenCanvas.function! } + private enum Keys { + static let width: JSString = "width" + static let oncontextrestored: JSString = "oncontextrestored" + static let getContext: JSString = "getContext" + static let transferToImageBitmap: JSString = "transferToImageBitmap" + static let convertToBlob: JSString = "convertToBlob" + static let height: JSString = "height" + static let oncontextlost: JSString = "oncontextlost" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadWriteAttribute(jsObject: jsObject, name: "width") - _height = ReadWriteAttribute(jsObject: jsObject, name: "height") - _oncontextlost = ClosureAttribute.Optional1(jsObject: jsObject, name: "oncontextlost") - _oncontextrestored = ClosureAttribute.Optional1(jsObject: jsObject, name: "oncontextrestored") + _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _oncontextlost = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.oncontextlost) + _oncontextrestored = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.oncontextrestored) super.init(unsafelyWrapping: jsObject) } @@ -25,20 +35,20 @@ public class OffscreenCanvas: EventTarget { public var height: UInt64 public func getContext(contextId: OffscreenRenderingContextId, options: JSValue? = nil) -> OffscreenRenderingContext? { - jsObject["getContext"]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.getContext]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func transferToImageBitmap() -> ImageBitmap { - jsObject["transferToImageBitmap"]!().fromJSValue()! + jsObject[Keys.transferToImageBitmap]!().fromJSValue()! } public func convertToBlob(options: ImageEncodeOptions? = nil) -> JSPromise { - jsObject["convertToBlob"]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.convertToBlob]!(options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func convertToBlob(options: ImageEncodeOptions? = nil) async throws -> Blob { - let _promise: JSPromise = jsObject["convertToBlob"]!(options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.convertToBlob]!(options?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift index ef39a7d8..01e08e3a 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift @@ -6,15 +6,20 @@ import JavaScriptKit public class OffscreenCanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { public class var constructor: JSFunction { JSObject.global.OffscreenCanvasRenderingContext2D.function! } + private enum Keys { + static let canvas: JSString = "canvas" + static let commit: JSString = "commit" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _canvas = ReadonlyAttribute(jsObject: jsObject, name: "canvas") + _canvas = ReadonlyAttribute(jsObject: jsObject, name: Keys.canvas) self.jsObject = jsObject } public func commit() { - _ = jsObject["commit"]!() + _ = jsObject[Keys.commit]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift index 7e9b2137..1a971dd6 100644 --- a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift @@ -3,19 +3,23 @@ import JavaScriptEventLoop import JavaScriptKit -public enum OffscreenRenderingContextId: String, JSValueCompatible { +public enum OffscreenRenderingContextId: JSString, JSValueCompatible { case _2d = "2d" - case bitmaprenderer - case webgl - case webgl2 - case webgpu + case bitmaprenderer = "bitmaprenderer" + case webgl = "webgl" + case webgl2 = "webgl2" + case webgpu = "webgpu" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift index 7cc2eacc..24044632 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class PageTransitionEvent: Event { override public class var constructor: JSFunction { JSObject.global.PageTransitionEvent.function! } + private enum Keys { + static let persisted: JSString = "persisted" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _persisted = ReadonlyAttribute(jsObject: jsObject, name: "persisted") + _persisted = ReadonlyAttribute(jsObject: jsObject, name: Keys.persisted) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift index 638e577e..fcb700c1 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class PageTransitionEventInit: BridgedDictionary { + private enum Keys { + static let persisted: JSString = "persisted" + } + public convenience init(persisted: Bool) { let object = JSObject.global.Object.function!.new() - object["persisted"] = persisted.jsValue() + object[Keys.persisted] = persisted.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _persisted = ReadWriteAttribute(jsObject: object, name: "persisted") + _persisted = ReadWriteAttribute(jsObject: object, name: Keys.persisted) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ParentNode.swift b/Sources/DOMKit/WebIDL/ParentNode.swift index 65ffb5ff..7dfa90eb 100644 --- a/Sources/DOMKit/WebIDL/ParentNode.swift +++ b/Sources/DOMKit/WebIDL/ParentNode.swift @@ -3,33 +3,45 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let querySelector: JSString = "querySelector" + static let querySelectorAll: JSString = "querySelectorAll" + static let childElementCount: JSString = "childElementCount" + static let prepend: JSString = "prepend" + static let append: JSString = "append" + static let replaceChildren: JSString = "replaceChildren" + static let lastElementChild: JSString = "lastElementChild" + static let children: JSString = "children" + static let firstElementChild: JSString = "firstElementChild" +} + public protocol ParentNode: JSBridgedClass {} public extension ParentNode { - var children: HTMLCollection { ReadonlyAttribute["children", in: jsObject] } + var children: HTMLCollection { ReadonlyAttribute[Keys.children, in: jsObject] } - var firstElementChild: Element? { ReadonlyAttribute["firstElementChild", in: jsObject] } + var firstElementChild: Element? { ReadonlyAttribute[Keys.firstElementChild, in: jsObject] } - var lastElementChild: Element? { ReadonlyAttribute["lastElementChild", in: jsObject] } + var lastElementChild: Element? { ReadonlyAttribute[Keys.lastElementChild, in: jsObject] } - var childElementCount: UInt32 { ReadonlyAttribute["childElementCount", in: jsObject] } + var childElementCount: UInt32 { ReadonlyAttribute[Keys.childElementCount, in: jsObject] } func prepend(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject["prepend"]!(nodes.jsValue()) + _ = jsObject[Keys.prepend]!(nodes.jsValue()) } func append(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject["append"]!(nodes.jsValue()) + _ = jsObject[Keys.append]!(nodes.jsValue()) } func replaceChildren(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject["replaceChildren"]!(nodes.jsValue()) + _ = jsObject[Keys.replaceChildren]!(nodes.jsValue()) } func querySelector(selectors: String) -> Element? { - jsObject["querySelector"]!(selectors.jsValue()).fromJSValue()! + jsObject[Keys.querySelector]!(selectors.jsValue()).fromJSValue()! } func querySelectorAll(selectors: String) -> NodeList { - jsObject["querySelectorAll"]!(selectors.jsValue()).fromJSValue()! + jsObject[Keys.querySelectorAll]!(selectors.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index 67a0633f..465e0947 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -6,6 +6,10 @@ import JavaScriptKit public class Path2D: JSBridgedClass, CanvasPath { public class var constructor: JSFunction { JSObject.global.Path2D.function! } + private enum Keys { + static let addPath: JSString = "addPath" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,6 +21,6 @@ public class Path2D: JSBridgedClass, CanvasPath { } public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { - _ = jsObject["addPath"]!(path.jsValue(), transform?.jsValue() ?? .undefined) + _ = jsObject[Keys.addPath]!(path.jsValue(), transform?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index ef5c32da..e5dde2a8 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -6,19 +6,25 @@ import JavaScriptKit public class Performance: EventTarget { override public class var constructor: JSFunction { JSObject.global.Performance.function! } + private enum Keys { + static let timeOrigin: JSString = "timeOrigin" + static let toJSON: JSString = "toJSON" + static let now: JSString = "now" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: "timeOrigin") + _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: Keys.timeOrigin) super.init(unsafelyWrapping: jsObject) } public func now() -> DOMHighResTimeStamp { - jsObject["now"]!().fromJSValue()! + jsObject[Keys.now]!().fromJSValue()! } @ReadonlyAttribute public var timeOrigin: DOMHighResTimeStamp public func toJSON() -> JSObject { - jsObject["toJSON"]!().fromJSValue()! + jsObject[Keys.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Plugin.swift b/Sources/DOMKit/WebIDL/Plugin.swift index cd58bc54..a8451d4d 100644 --- a/Sources/DOMKit/WebIDL/Plugin.swift +++ b/Sources/DOMKit/WebIDL/Plugin.swift @@ -6,13 +6,22 @@ import JavaScriptKit public class Plugin: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Plugin.function! } + private enum Keys { + static let description: JSString = "description" + static let filename: JSString = "filename" + static let length: JSString = "length" + static let item: JSString = "item" + static let namedItem: JSString = "namedItem" + static let name: JSString = "name" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: "name") - _description = ReadonlyAttribute(jsObject: jsObject, name: "description") - _filename = ReadonlyAttribute(jsObject: jsObject, name: "filename") - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) + _description = ReadonlyAttribute(jsObject: jsObject, name: Keys.description) + _filename = ReadonlyAttribute(jsObject: jsObject, name: Keys.filename) + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/PluginArray.swift b/Sources/DOMKit/WebIDL/PluginArray.swift index 8492a4a6..ca9dc7eb 100644 --- a/Sources/DOMKit/WebIDL/PluginArray.swift +++ b/Sources/DOMKit/WebIDL/PluginArray.swift @@ -6,15 +6,22 @@ import JavaScriptKit public class PluginArray: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.PluginArray.function! } + private enum Keys { + static let length: JSString = "length" + static let refresh: JSString = "refresh" + static let item: JSString = "item" + static let namedItem: JSString = "namedItem" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } public func refresh() { - _ = jsObject["refresh"]!() + _ = jsObject[Keys.refresh]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PopStateEvent.swift b/Sources/DOMKit/WebIDL/PopStateEvent.swift index 6bbd1670..748fda82 100644 --- a/Sources/DOMKit/WebIDL/PopStateEvent.swift +++ b/Sources/DOMKit/WebIDL/PopStateEvent.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class PopStateEvent: Event { override public class var constructor: JSFunction { JSObject.global.PopStateEvent.function! } + private enum Keys { + static let state: JSString = "state" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _state = ReadonlyAttribute(jsObject: jsObject, name: "state") + _state = ReadonlyAttribute(jsObject: jsObject, name: Keys.state) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/PopStateEventInit.swift b/Sources/DOMKit/WebIDL/PopStateEventInit.swift index dd86545a..340bf67a 100644 --- a/Sources/DOMKit/WebIDL/PopStateEventInit.swift +++ b/Sources/DOMKit/WebIDL/PopStateEventInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class PopStateEventInit: BridgedDictionary { + private enum Keys { + static let state: JSString = "state" + } + public convenience init(state: JSValue) { let object = JSObject.global.Object.function!.new() - object["state"] = state.jsValue() + object[Keys.state] = state.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _state = ReadWriteAttribute(jsObject: object, name: "state") + _state = ReadWriteAttribute(jsObject: object, name: Keys.state) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift index c8d93748..7d584fc3 100644 --- a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift +++ b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum PredefinedColorSpace: String, JSValueCompatible { - case srgb +public enum PredefinedColorSpace: JSString, JSValueCompatible { + case srgb = "srgb" case displayP3 = "display-p3" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift index a616a6b9..77d1f884 100644 --- a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift +++ b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum PremultiplyAlpha: String, JSValueCompatible { - case none - case premultiply - case `default` +public enum PremultiplyAlpha: JSString, JSValueCompatible { + case none = "none" + case premultiply = "premultiply" + case `default` = "default" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift index 7b46deee..c9b3fc1a 100644 --- a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift +++ b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class ProcessingInstruction: CharacterData, LinkStyle { override public class var constructor: JSFunction { JSObject.global.ProcessingInstruction.function! } + private enum Keys { + static let target: JSString = "target" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _target = ReadonlyAttribute(jsObject: jsObject, name: "target") + _target = ReadonlyAttribute(jsObject: jsObject, name: Keys.target) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/ProgressEvent.swift b/Sources/DOMKit/WebIDL/ProgressEvent.swift index 9c51e3bd..4d7ca9b7 100644 --- a/Sources/DOMKit/WebIDL/ProgressEvent.swift +++ b/Sources/DOMKit/WebIDL/ProgressEvent.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class ProgressEvent: Event { override public class var constructor: JSFunction { JSObject.global.ProgressEvent.function! } + private enum Keys { + static let loaded: JSString = "loaded" + static let lengthComputable: JSString = "lengthComputable" + static let total: JSString = "total" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _lengthComputable = ReadonlyAttribute(jsObject: jsObject, name: "lengthComputable") - _loaded = ReadonlyAttribute(jsObject: jsObject, name: "loaded") - _total = ReadonlyAttribute(jsObject: jsObject, name: "total") + _lengthComputable = ReadonlyAttribute(jsObject: jsObject, name: Keys.lengthComputable) + _loaded = ReadonlyAttribute(jsObject: jsObject, name: Keys.loaded) + _total = ReadonlyAttribute(jsObject: jsObject, name: Keys.total) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/ProgressEventInit.swift b/Sources/DOMKit/WebIDL/ProgressEventInit.swift index 1767c3a3..2b434f8d 100644 --- a/Sources/DOMKit/WebIDL/ProgressEventInit.swift +++ b/Sources/DOMKit/WebIDL/ProgressEventInit.swift @@ -4,18 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class ProgressEventInit: BridgedDictionary { + private enum Keys { + static let total: JSString = "total" + static let lengthComputable: JSString = "lengthComputable" + static let loaded: JSString = "loaded" + } + public convenience init(lengthComputable: Bool, loaded: UInt64, total: UInt64) { let object = JSObject.global.Object.function!.new() - object["lengthComputable"] = lengthComputable.jsValue() - object["loaded"] = loaded.jsValue() - object["total"] = total.jsValue() + object[Keys.lengthComputable] = lengthComputable.jsValue() + object[Keys.loaded] = loaded.jsValue() + object[Keys.total] = total.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _lengthComputable = ReadWriteAttribute(jsObject: object, name: "lengthComputable") - _loaded = ReadWriteAttribute(jsObject: object, name: "loaded") - _total = ReadWriteAttribute(jsObject: object, name: "total") + _lengthComputable = ReadWriteAttribute(jsObject: object, name: Keys.lengthComputable) + _loaded = ReadWriteAttribute(jsObject: object, name: Keys.loaded) + _total = ReadWriteAttribute(jsObject: object, name: Keys.total) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift index 00248652..7358ad92 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift @@ -6,9 +6,14 @@ import JavaScriptKit public class PromiseRejectionEvent: Event { override public class var constructor: JSFunction { JSObject.global.PromiseRejectionEvent.function! } + private enum Keys { + static let promise: JSString = "promise" + static let reason: JSString = "reason" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _promise = ReadonlyAttribute(jsObject: jsObject, name: "promise") - _reason = ReadonlyAttribute(jsObject: jsObject, name: "reason") + _promise = ReadonlyAttribute(jsObject: jsObject, name: Keys.promise) + _reason = ReadonlyAttribute(jsObject: jsObject, name: Keys.reason) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift index b174b5a8..4a3ed008 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift @@ -4,16 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class PromiseRejectionEventInit: BridgedDictionary { + private enum Keys { + static let promise: JSString = "promise" + static let reason: JSString = "reason" + } + public convenience init(promise: JSPromise, reason: JSValue) { let object = JSObject.global.Object.function!.new() - object["promise"] = promise.jsValue() - object["reason"] = reason.jsValue() + object[Keys.promise] = promise.jsValue() + object[Keys.reason] = reason.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _promise = ReadWriteAttribute(jsObject: object, name: "promise") - _reason = ReadWriteAttribute(jsObject: object, name: "reason") + _promise = ReadWriteAttribute(jsObject: object, name: Keys.promise) + _reason = ReadWriteAttribute(jsObject: object, name: Keys.reason) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/QueuingStrategy.swift b/Sources/DOMKit/WebIDL/QueuingStrategy.swift index 2195625c..6dc6ba22 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategy.swift @@ -4,16 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class QueuingStrategy: BridgedDictionary { + private enum Keys { + static let highWaterMark: JSString = "highWaterMark" + static let size: JSString = "size" + } + public convenience init(highWaterMark: Double, size: @escaping QueuingStrategySize) { let object = JSObject.global.Object.function!.new() - object["highWaterMark"] = highWaterMark.jsValue() - ClosureAttribute.Required1["size", in: object] = size + object[Keys.highWaterMark] = highWaterMark.jsValue() + ClosureAttribute.Required1[Keys.size, in: object] = size self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _highWaterMark = ReadWriteAttribute(jsObject: object, name: "highWaterMark") - _size = ClosureAttribute.Required1(jsObject: object, name: "size") + _highWaterMark = ReadWriteAttribute(jsObject: object, name: Keys.highWaterMark) + _size = ClosureAttribute.Required1(jsObject: object, name: Keys.size) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift index 7238a493..1012d183 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class QueuingStrategyInit: BridgedDictionary { + private enum Keys { + static let highWaterMark: JSString = "highWaterMark" + } + public convenience init(highWaterMark: Double) { let object = JSObject.global.Object.function!.new() - object["highWaterMark"] = highWaterMark.jsValue() + object[Keys.highWaterMark] = highWaterMark.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _highWaterMark = ReadWriteAttribute(jsObject: object, name: "highWaterMark") + _highWaterMark = ReadWriteAttribute(jsObject: object, name: Keys.highWaterMark) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RadioNodeList.swift b/Sources/DOMKit/WebIDL/RadioNodeList.swift index e370180d..c45d2341 100644 --- a/Sources/DOMKit/WebIDL/RadioNodeList.swift +++ b/Sources/DOMKit/WebIDL/RadioNodeList.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class RadioNodeList: NodeList { override public class var constructor: JSFunction { JSObject.global.RadioNodeList.function! } + private enum Keys { + static let value: JSString = "value" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: "value") + _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 3ac0e8fc..6a19ab4c 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -6,8 +6,36 @@ import JavaScriptKit public class Range: AbstractRange { override public class var constructor: JSFunction { JSObject.global.Range.function! } + private enum Keys { + static let deleteContents: JSString = "deleteContents" + static let detach: JSString = "detach" + static let setEnd: JSString = "setEnd" + static let setStart: JSString = "setStart" + static let setEndAfter: JSString = "setEndAfter" + static let collapse: JSString = "collapse" + static let selectNode: JSString = "selectNode" + static let END_TO_START: JSString = "END_TO_START" + static let isPointInRange: JSString = "isPointInRange" + static let comparePoint: JSString = "comparePoint" + static let insertNode: JSString = "insertNode" + static let extractContents: JSString = "extractContents" + static let setEndBefore: JSString = "setEndBefore" + static let cloneContents: JSString = "cloneContents" + static let surroundContents: JSString = "surroundContents" + static let compareBoundaryPoints: JSString = "compareBoundaryPoints" + static let setStartBefore: JSString = "setStartBefore" + static let START_TO_START: JSString = "START_TO_START" + static let cloneRange: JSString = "cloneRange" + static let END_TO_END: JSString = "END_TO_END" + static let commonAncestorContainer: JSString = "commonAncestorContainer" + static let setStartAfter: JSString = "setStartAfter" + static let START_TO_END: JSString = "START_TO_END" + static let selectNodeContents: JSString = "selectNodeContents" + static let intersectsNode: JSString = "intersectsNode" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _commonAncestorContainer = ReadonlyAttribute(jsObject: jsObject, name: "commonAncestorContainer") + _commonAncestorContainer = ReadonlyAttribute(jsObject: jsObject, name: Keys.commonAncestorContainer) super.init(unsafelyWrapping: jsObject) } @@ -19,39 +47,39 @@ public class Range: AbstractRange { public var commonAncestorContainer: Node public func setStart(node: Node, offset: UInt32) { - _ = jsObject["setStart"]!(node.jsValue(), offset.jsValue()) + _ = jsObject[Keys.setStart]!(node.jsValue(), offset.jsValue()) } public func setEnd(node: Node, offset: UInt32) { - _ = jsObject["setEnd"]!(node.jsValue(), offset.jsValue()) + _ = jsObject[Keys.setEnd]!(node.jsValue(), offset.jsValue()) } public func setStartBefore(node: Node) { - _ = jsObject["setStartBefore"]!(node.jsValue()) + _ = jsObject[Keys.setStartBefore]!(node.jsValue()) } public func setStartAfter(node: Node) { - _ = jsObject["setStartAfter"]!(node.jsValue()) + _ = jsObject[Keys.setStartAfter]!(node.jsValue()) } public func setEndBefore(node: Node) { - _ = jsObject["setEndBefore"]!(node.jsValue()) + _ = jsObject[Keys.setEndBefore]!(node.jsValue()) } public func setEndAfter(node: Node) { - _ = jsObject["setEndAfter"]!(node.jsValue()) + _ = jsObject[Keys.setEndAfter]!(node.jsValue()) } public func collapse(toStart: Bool? = nil) { - _ = jsObject["collapse"]!(toStart?.jsValue() ?? .undefined) + _ = jsObject[Keys.collapse]!(toStart?.jsValue() ?? .undefined) } public func selectNode(node: Node) { - _ = jsObject["selectNode"]!(node.jsValue()) + _ = jsObject[Keys.selectNode]!(node.jsValue()) } public func selectNodeContents(node: Node) { - _ = jsObject["selectNodeContents"]!(node.jsValue()) + _ = jsObject[Keys.selectNodeContents]!(node.jsValue()) } public static let START_TO_START: UInt16 = 0 @@ -63,50 +91,50 @@ public class Range: AbstractRange { public static let END_TO_START: UInt16 = 3 public func compareBoundaryPoints(how: UInt16, sourceRange: Range) -> Int16 { - jsObject["compareBoundaryPoints"]!(how.jsValue(), sourceRange.jsValue()).fromJSValue()! + jsObject[Keys.compareBoundaryPoints]!(how.jsValue(), sourceRange.jsValue()).fromJSValue()! } public func deleteContents() { - _ = jsObject["deleteContents"]!() + _ = jsObject[Keys.deleteContents]!() } public func extractContents() -> DocumentFragment { - jsObject["extractContents"]!().fromJSValue()! + jsObject[Keys.extractContents]!().fromJSValue()! } public func cloneContents() -> DocumentFragment { - jsObject["cloneContents"]!().fromJSValue()! + jsObject[Keys.cloneContents]!().fromJSValue()! } public func insertNode(node: Node) { - _ = jsObject["insertNode"]!(node.jsValue()) + _ = jsObject[Keys.insertNode]!(node.jsValue()) } public func surroundContents(newParent: Node) { - _ = jsObject["surroundContents"]!(newParent.jsValue()) + _ = jsObject[Keys.surroundContents]!(newParent.jsValue()) } public func cloneRange() -> Self { - jsObject["cloneRange"]!().fromJSValue()! + jsObject[Keys.cloneRange]!().fromJSValue()! } public func detach() { - _ = jsObject["detach"]!() + _ = jsObject[Keys.detach]!() } public func isPointInRange(node: Node, offset: UInt32) -> Bool { - jsObject["isPointInRange"]!(node.jsValue(), offset.jsValue()).fromJSValue()! + jsObject[Keys.isPointInRange]!(node.jsValue(), offset.jsValue()).fromJSValue()! } public func comparePoint(node: Node, offset: UInt32) -> Int16 { - jsObject["comparePoint"]!(node.jsValue(), offset.jsValue()).fromJSValue()! + jsObject[Keys.comparePoint]!(node.jsValue(), offset.jsValue()).fromJSValue()! } public func intersectsNode(node: Node) -> Bool { - jsObject["intersectsNode"]!(node.jsValue()).fromJSValue()! + jsObject[Keys.intersectsNode]!(node.jsValue()).fromJSValue()! } public var description: String { - jsObject["toString"]!().fromJSValue()! + jsObject[Strings.toString]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift index a441afcb..e9d8b07a 100644 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift @@ -6,11 +6,19 @@ import JavaScriptKit public class ReadableByteStreamController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ReadableByteStreamController.function! } + private enum Keys { + static let desiredSize: JSString = "desiredSize" + static let enqueue: JSString = "enqueue" + static let close: JSString = "close" + static let error: JSString = "error" + static let byobRequest: JSString = "byobRequest" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _byobRequest = ReadonlyAttribute(jsObject: jsObject, name: "byobRequest") - _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: "desiredSize") + _byobRequest = ReadonlyAttribute(jsObject: jsObject, name: Keys.byobRequest) + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Keys.desiredSize) self.jsObject = jsObject } @@ -21,14 +29,14 @@ public class ReadableByteStreamController: JSBridgedClass { public var desiredSize: Double? public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } public func enqueue(chunk: ArrayBufferView) { - _ = jsObject["enqueue"]!(chunk.jsValue()) + _ = jsObject[Keys.enqueue]!(chunk.jsValue()) } public func error(e: JSValue? = nil) { - _ = jsObject["error"]!(e?.jsValue() ?? .undefined) + _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStream.swift b/Sources/DOMKit/WebIDL/ReadableStream.swift index b135fa58..5adbe1b5 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -6,10 +6,19 @@ import JavaScriptKit public class ReadableStream: JSBridgedClass, AsyncSequence { public class var constructor: JSFunction { JSObject.global.ReadableStream.function! } + private enum Keys { + static let pipeTo: JSString = "pipeTo" + static let pipeThrough: JSString = "pipeThrough" + static let cancel: JSString = "cancel" + static let getReader: JSString = "getReader" + static let tee: JSString = "tee" + static let locked: JSString = "locked" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _locked = ReadonlyAttribute(jsObject: jsObject, name: "locked") + _locked = ReadonlyAttribute(jsObject: jsObject, name: Keys.locked) self.jsObject = jsObject } @@ -21,35 +30,35 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { public var locked: Bool public func cancel(reason: JSValue? = nil) -> JSPromise { - jsObject["cancel"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func cancel(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject["cancel"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } public func getReader(options: ReadableStreamGetReaderOptions? = nil) -> ReadableStreamReader { - jsObject["getReader"]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.getReader]!(options?.jsValue() ?? .undefined).fromJSValue()! } public func pipeThrough(transform: ReadableWritablePair, options: StreamPipeOptions? = nil) -> Self { - jsObject["pipeThrough"]!(transform.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.pipeThrough]!(transform.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) -> JSPromise { - jsObject["pipeTo"]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) async throws { - let _promise: JSPromise = jsObject["pipeTo"]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } public func tee() -> [ReadableStream] { - jsObject["tee"]!().fromJSValue()! + jsObject[Keys.tee]!().fromJSValue()! } public typealias Element = JSValue diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift index efc2cdf8..d3eb915a 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift @@ -4,16 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamBYOBReadResult: BridgedDictionary { + private enum Keys { + static let value: JSString = "value" + static let done: JSString = "done" + } + public convenience init(value: __UNSUPPORTED_UNION__, done: Bool) { let object = JSObject.global.Object.function!.new() - object["value"] = value.jsValue() - object["done"] = done.jsValue() + object[Keys.value] = value.jsValue() + object[Keys.done] = done.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _value = ReadWriteAttribute(jsObject: object, name: "value") - _done = ReadWriteAttribute(jsObject: object, name: "done") + _value = ReadWriteAttribute(jsObject: object, name: Keys.value) + _done = ReadWriteAttribute(jsObject: object, name: Keys.done) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift index 229053fa..a6dd84b3 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -6,6 +6,11 @@ import JavaScriptKit public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericReader { public class var constructor: JSFunction { JSObject.global.ReadableStreamBYOBReader.function! } + private enum Keys { + static let releaseLock: JSString = "releaseLock" + static let read: JSString = "read" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,16 +22,16 @@ public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericRead } public func read(view: ArrayBufferView) -> JSPromise { - jsObject["read"]!(view.jsValue()).fromJSValue()! + jsObject[Keys.read]!(view.jsValue()).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func read(view: ArrayBufferView) async throws -> ReadableStreamBYOBReadResult { - let _promise: JSPromise = jsObject["read"]!(view.jsValue()).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.read]!(view.jsValue()).fromJSValue()! return try await _promise.get().fromJSValue()! } public func releaseLock() { - _ = jsObject["releaseLock"]!() + _ = jsObject[Keys.releaseLock]!() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift index 42039e7a..b66e5a85 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class ReadableStreamBYOBRequest: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ReadableStreamBYOBRequest.function! } + private enum Keys { + static let respond: JSString = "respond" + static let respondWithNewView: JSString = "respondWithNewView" + static let view: JSString = "view" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _view = ReadonlyAttribute(jsObject: jsObject, name: "view") + _view = ReadonlyAttribute(jsObject: jsObject, name: Keys.view) self.jsObject = jsObject } @@ -17,10 +23,10 @@ public class ReadableStreamBYOBRequest: JSBridgedClass { public var view: ArrayBufferView? public func respond(bytesWritten: UInt64) { - _ = jsObject["respond"]!(bytesWritten.jsValue()) + _ = jsObject[Keys.respond]!(bytesWritten.jsValue()) } public func respondWithNewView(view: ArrayBufferView) { - _ = jsObject["respondWithNewView"]!(view.jsValue()) + _ = jsObject[Keys.respondWithNewView]!(view.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift index be1343b9..a53e30a1 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift @@ -6,10 +6,17 @@ import JavaScriptKit public class ReadableStreamDefaultController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ReadableStreamDefaultController.function! } + private enum Keys { + static let close: JSString = "close" + static let desiredSize: JSString = "desiredSize" + static let error: JSString = "error" + static let enqueue: JSString = "enqueue" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: "desiredSize") + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Keys.desiredSize) self.jsObject = jsObject } @@ -17,14 +24,14 @@ public class ReadableStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } public func enqueue(chunk: JSValue? = nil) { - _ = jsObject["enqueue"]!(chunk?.jsValue() ?? .undefined) + _ = jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined) } public func error(e: JSValue? = nil) { - _ = jsObject["error"]!(e?.jsValue() ?? .undefined) + _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift index 8e82b959..5527b8a4 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift @@ -4,16 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamDefaultReadResult: BridgedDictionary { + private enum Keys { + static let value: JSString = "value" + static let done: JSString = "done" + } + public convenience init(value: JSValue, done: Bool) { let object = JSObject.global.Object.function!.new() - object["value"] = value.jsValue() - object["done"] = done.jsValue() + object[Keys.value] = value.jsValue() + object[Keys.done] = done.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _value = ReadWriteAttribute(jsObject: object, name: "value") - _done = ReadWriteAttribute(jsObject: object, name: "done") + _value = ReadWriteAttribute(jsObject: object, name: Keys.value) + _done = ReadWriteAttribute(jsObject: object, name: Keys.done) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift index 1e032f13..510d333f 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -6,6 +6,11 @@ import JavaScriptKit public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericReader { public class var constructor: JSFunction { JSObject.global.ReadableStreamDefaultReader.function! } + private enum Keys { + static let releaseLock: JSString = "releaseLock" + static let read: JSString = "read" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,16 +22,16 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR } public func read() -> JSPromise { - jsObject["read"]!().fromJSValue()! + jsObject[Keys.read]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func read() async throws -> ReadableStreamDefaultReadResult { - let _promise: JSPromise = jsObject["read"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.read]!().fromJSValue()! return try await _promise.get().fromJSValue()! } public func releaseLock() { - _ = jsObject["releaseLock"]!() + _ = jsObject[Keys.releaseLock]!() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift index 6f8b55c9..b391f377 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift @@ -3,17 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let cancel: JSString = "cancel" + static let closed: JSString = "closed" +} + public protocol ReadableStreamGenericReader: JSBridgedClass {} public extension ReadableStreamGenericReader { - var closed: JSPromise { ReadonlyAttribute["closed", in: jsObject] } + var closed: JSPromise { ReadonlyAttribute[Keys.closed, in: jsObject] } func cancel(reason: JSValue? = nil) -> JSPromise { - jsObject["cancel"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func cancel(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject["cancel"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift index 88998c20..7bc540c3 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamGetReaderOptions: BridgedDictionary { + private enum Keys { + static let mode: JSString = "mode" + } + public convenience init(mode: ReadableStreamReaderMode) { let object = JSObject.global.Object.function!.new() - object["mode"] = mode.jsValue() + object[Keys.mode] = mode.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _mode = ReadWriteAttribute(jsObject: object, name: "mode") + _mode = ReadWriteAttribute(jsObject: object, name: Keys.mode) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift index 5684f97e..1bb1b3c0 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamIteratorOptions: BridgedDictionary { + private enum Keys { + static let preventCancel: JSString = "preventCancel" + } + public convenience init(preventCancel: Bool) { let object = JSObject.global.Object.function!.new() - object["preventCancel"] = preventCancel.jsValue() + object[Keys.preventCancel] = preventCancel.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _preventCancel = ReadWriteAttribute(jsObject: object, name: "preventCancel") + _preventCancel = ReadWriteAttribute(jsObject: object, name: Keys.preventCancel) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift index 23d696e6..3dcab4d7 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift @@ -3,15 +3,19 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ReadableStreamReaderMode: String, JSValueCompatible { - case byob +public enum ReadableStreamReaderMode: JSString, JSValueCompatible { + case byob = "byob" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamType.swift b/Sources/DOMKit/WebIDL/ReadableStreamType.swift index fe349e09..2129d7e4 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamType.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamType.swift @@ -3,15 +3,19 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ReadableStreamType: String, JSValueCompatible { - case bytes +public enum ReadableStreamType: JSString, JSValueCompatible { + case bytes = "bytes" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift index d3c9cb17..5ff27230 100644 --- a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift +++ b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift @@ -4,16 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableWritablePair: BridgedDictionary { + private enum Keys { + static let readable: JSString = "readable" + static let writable: JSString = "writable" + } + public convenience init(readable: ReadableStream, writable: WritableStream) { let object = JSObject.global.Object.function!.new() - object["readable"] = readable.jsValue() - object["writable"] = writable.jsValue() + object[Keys.readable] = readable.jsValue() + object[Keys.writable] = writable.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _readable = ReadWriteAttribute(jsObject: object, name: "readable") - _writable = ReadWriteAttribute(jsObject: object, name: "writable") + _readable = ReadWriteAttribute(jsObject: object, name: Keys.readable) + _writable = ReadWriteAttribute(jsObject: object, name: Keys.writable) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift index 2d229054..d6813f1d 100644 --- a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift +++ b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift @@ -3,23 +3,27 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ReferrerPolicy: String, JSValueCompatible { +public enum ReferrerPolicy: JSString, JSValueCompatible { case _empty = "" case noReferrer = "no-referrer" case noReferrerWhenDowngrade = "no-referrer-when-downgrade" case sameOrigin = "same-origin" - case origin + case origin = "origin" case strictOrigin = "strict-origin" case originWhenCrossOrigin = "origin-when-cross-origin" case strictOriginWhenCrossOrigin = "strict-origin-when-cross-origin" case unsafeUrl = "unsafe-url" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift index 04362d04..0d78c1f4 100644 --- a/Sources/DOMKit/WebIDL/Request.swift +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -6,24 +6,43 @@ import JavaScriptKit public class Request: JSBridgedClass, Body { public class var constructor: JSFunction { JSObject.global.Request.function! } + private enum Keys { + static let clone: JSString = "clone" + static let referrer: JSString = "referrer" + static let redirect: JSString = "redirect" + static let signal: JSString = "signal" + static let mode: JSString = "mode" + static let isHistoryNavigation: JSString = "isHistoryNavigation" + static let keepalive: JSString = "keepalive" + static let cache: JSString = "cache" + static let credentials: JSString = "credentials" + static let headers: JSString = "headers" + static let url: JSString = "url" + static let integrity: JSString = "integrity" + static let destination: JSString = "destination" + static let method: JSString = "method" + static let referrerPolicy: JSString = "referrerPolicy" + static let isReloadNavigation: JSString = "isReloadNavigation" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _method = ReadonlyAttribute(jsObject: jsObject, name: "method") - _url = ReadonlyAttribute(jsObject: jsObject, name: "url") - _headers = ReadonlyAttribute(jsObject: jsObject, name: "headers") - _destination = ReadonlyAttribute(jsObject: jsObject, name: "destination") - _referrer = ReadonlyAttribute(jsObject: jsObject, name: "referrer") - _referrerPolicy = ReadonlyAttribute(jsObject: jsObject, name: "referrerPolicy") - _mode = ReadonlyAttribute(jsObject: jsObject, name: "mode") - _credentials = ReadonlyAttribute(jsObject: jsObject, name: "credentials") - _cache = ReadonlyAttribute(jsObject: jsObject, name: "cache") - _redirect = ReadonlyAttribute(jsObject: jsObject, name: "redirect") - _integrity = ReadonlyAttribute(jsObject: jsObject, name: "integrity") - _keepalive = ReadonlyAttribute(jsObject: jsObject, name: "keepalive") - _isReloadNavigation = ReadonlyAttribute(jsObject: jsObject, name: "isReloadNavigation") - _isHistoryNavigation = ReadonlyAttribute(jsObject: jsObject, name: "isHistoryNavigation") - _signal = ReadonlyAttribute(jsObject: jsObject, name: "signal") + _method = ReadonlyAttribute(jsObject: jsObject, name: Keys.method) + _url = ReadonlyAttribute(jsObject: jsObject, name: Keys.url) + _headers = ReadonlyAttribute(jsObject: jsObject, name: Keys.headers) + _destination = ReadonlyAttribute(jsObject: jsObject, name: Keys.destination) + _referrer = ReadonlyAttribute(jsObject: jsObject, name: Keys.referrer) + _referrerPolicy = ReadonlyAttribute(jsObject: jsObject, name: Keys.referrerPolicy) + _mode = ReadonlyAttribute(jsObject: jsObject, name: Keys.mode) + _credentials = ReadonlyAttribute(jsObject: jsObject, name: Keys.credentials) + _cache = ReadonlyAttribute(jsObject: jsObject, name: Keys.cache) + _redirect = ReadonlyAttribute(jsObject: jsObject, name: Keys.redirect) + _integrity = ReadonlyAttribute(jsObject: jsObject, name: Keys.integrity) + _keepalive = ReadonlyAttribute(jsObject: jsObject, name: Keys.keepalive) + _isReloadNavigation = ReadonlyAttribute(jsObject: jsObject, name: Keys.isReloadNavigation) + _isHistoryNavigation = ReadonlyAttribute(jsObject: jsObject, name: Keys.isHistoryNavigation) + _signal = ReadonlyAttribute(jsObject: jsObject, name: Keys.signal) self.jsObject = jsObject } @@ -77,6 +96,6 @@ public class Request: JSBridgedClass, Body { public var signal: AbortSignal public func clone() -> Self { - jsObject["clone"]!().fromJSValue()! + jsObject[Keys.clone]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RequestCache.swift b/Sources/DOMKit/WebIDL/RequestCache.swift index 0b17dcb5..18cf39bc 100644 --- a/Sources/DOMKit/WebIDL/RequestCache.swift +++ b/Sources/DOMKit/WebIDL/RequestCache.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestCache: String, JSValueCompatible { - case `default` +public enum RequestCache: JSString, JSValueCompatible { + case `default` = "default" case noStore = "no-store" - case reload + case reload = "reload" case noCache = "no-cache" case forceCache = "force-cache" case onlyIfCached = "only-if-cached" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RequestCredentials.swift b/Sources/DOMKit/WebIDL/RequestCredentials.swift index 3bacfbb5..013749e0 100644 --- a/Sources/DOMKit/WebIDL/RequestCredentials.swift +++ b/Sources/DOMKit/WebIDL/RequestCredentials.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestCredentials: String, JSValueCompatible { - case omit +public enum RequestCredentials: JSString, JSValueCompatible { + case omit = "omit" case sameOrigin = "same-origin" - case include + case include = "include" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RequestDestination.swift b/Sources/DOMKit/WebIDL/RequestDestination.swift index 37ce3ca9..55e4c1f1 100644 --- a/Sources/DOMKit/WebIDL/RequestDestination.swift +++ b/Sources/DOMKit/WebIDL/RequestDestination.swift @@ -3,34 +3,38 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestDestination: String, JSValueCompatible { +public enum RequestDestination: JSString, JSValueCompatible { case _empty = "" - case audio - case audioworklet - case document - case embed - case font - case frame - case iframe - case image - case manifest - case object - case paintworklet - case report - case script - case sharedworker - case style - case track - case video - case worker - case xslt + case audio = "audio" + case audioworklet = "audioworklet" + case document = "document" + case embed = "embed" + case font = "font" + case frame = "frame" + case iframe = "iframe" + case image = "image" + case manifest = "manifest" + case object = "object" + case paintworklet = "paintworklet" + case report = "report" + case script = "script" + case sharedworker = "sharedworker" + case style = "style" + case track = "track" + case video = "video" + case worker = "worker" + case xslt = "xslt" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RequestInit.swift b/Sources/DOMKit/WebIDL/RequestInit.swift index aa4d9ca6..bb70ebee 100644 --- a/Sources/DOMKit/WebIDL/RequestInit.swift +++ b/Sources/DOMKit/WebIDL/RequestInit.swift @@ -4,38 +4,54 @@ import JavaScriptEventLoop import JavaScriptKit public class RequestInit: BridgedDictionary { + private enum Keys { + static let credentials: JSString = "credentials" + static let integrity: JSString = "integrity" + static let mode: JSString = "mode" + static let referrerPolicy: JSString = "referrerPolicy" + static let redirect: JSString = "redirect" + static let body: JSString = "body" + static let keepalive: JSString = "keepalive" + static let headers: JSString = "headers" + static let cache: JSString = "cache" + static let method: JSString = "method" + static let signal: JSString = "signal" + static let window: JSString = "window" + static let referrer: JSString = "referrer" + } + public convenience init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue) { let object = JSObject.global.Object.function!.new() - object["method"] = method.jsValue() - object["headers"] = headers.jsValue() - object["body"] = body.jsValue() - object["referrer"] = referrer.jsValue() - object["referrerPolicy"] = referrerPolicy.jsValue() - object["mode"] = mode.jsValue() - object["credentials"] = credentials.jsValue() - object["cache"] = cache.jsValue() - object["redirect"] = redirect.jsValue() - object["integrity"] = integrity.jsValue() - object["keepalive"] = keepalive.jsValue() - object["signal"] = signal.jsValue() - object["window"] = window.jsValue() + object[Keys.method] = method.jsValue() + object[Keys.headers] = headers.jsValue() + object[Keys.body] = body.jsValue() + object[Keys.referrer] = referrer.jsValue() + object[Keys.referrerPolicy] = referrerPolicy.jsValue() + object[Keys.mode] = mode.jsValue() + object[Keys.credentials] = credentials.jsValue() + object[Keys.cache] = cache.jsValue() + object[Keys.redirect] = redirect.jsValue() + object[Keys.integrity] = integrity.jsValue() + object[Keys.keepalive] = keepalive.jsValue() + object[Keys.signal] = signal.jsValue() + object[Keys.window] = window.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _method = ReadWriteAttribute(jsObject: object, name: "method") - _headers = ReadWriteAttribute(jsObject: object, name: "headers") - _body = ReadWriteAttribute(jsObject: object, name: "body") - _referrer = ReadWriteAttribute(jsObject: object, name: "referrer") - _referrerPolicy = ReadWriteAttribute(jsObject: object, name: "referrerPolicy") - _mode = ReadWriteAttribute(jsObject: object, name: "mode") - _credentials = ReadWriteAttribute(jsObject: object, name: "credentials") - _cache = ReadWriteAttribute(jsObject: object, name: "cache") - _redirect = ReadWriteAttribute(jsObject: object, name: "redirect") - _integrity = ReadWriteAttribute(jsObject: object, name: "integrity") - _keepalive = ReadWriteAttribute(jsObject: object, name: "keepalive") - _signal = ReadWriteAttribute(jsObject: object, name: "signal") - _window = ReadWriteAttribute(jsObject: object, name: "window") + _method = ReadWriteAttribute(jsObject: object, name: Keys.method) + _headers = ReadWriteAttribute(jsObject: object, name: Keys.headers) + _body = ReadWriteAttribute(jsObject: object, name: Keys.body) + _referrer = ReadWriteAttribute(jsObject: object, name: Keys.referrer) + _referrerPolicy = ReadWriteAttribute(jsObject: object, name: Keys.referrerPolicy) + _mode = ReadWriteAttribute(jsObject: object, name: Keys.mode) + _credentials = ReadWriteAttribute(jsObject: object, name: Keys.credentials) + _cache = ReadWriteAttribute(jsObject: object, name: Keys.cache) + _redirect = ReadWriteAttribute(jsObject: object, name: Keys.redirect) + _integrity = ReadWriteAttribute(jsObject: object, name: Keys.integrity) + _keepalive = ReadWriteAttribute(jsObject: object, name: Keys.keepalive) + _signal = ReadWriteAttribute(jsObject: object, name: Keys.signal) + _window = ReadWriteAttribute(jsObject: object, name: Keys.window) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RequestMode.swift b/Sources/DOMKit/WebIDL/RequestMode.swift index 93aea46c..96294c76 100644 --- a/Sources/DOMKit/WebIDL/RequestMode.swift +++ b/Sources/DOMKit/WebIDL/RequestMode.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestMode: String, JSValueCompatible { - case navigate +public enum RequestMode: JSString, JSValueCompatible { + case navigate = "navigate" case sameOrigin = "same-origin" case noCors = "no-cors" - case cors + case cors = "cors" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RequestRedirect.swift b/Sources/DOMKit/WebIDL/RequestRedirect.swift index d8181ab0..67019909 100644 --- a/Sources/DOMKit/WebIDL/RequestRedirect.swift +++ b/Sources/DOMKit/WebIDL/RequestRedirect.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestRedirect: String, JSValueCompatible { - case follow - case error - case manual +public enum RequestRedirect: JSString, JSValueCompatible { + case follow = "follow" + case error = "error" + case manual = "manual" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ResizeQuality.swift b/Sources/DOMKit/WebIDL/ResizeQuality.swift index 9a2b5444..c50100dd 100644 --- a/Sources/DOMKit/WebIDL/ResizeQuality.swift +++ b/Sources/DOMKit/WebIDL/ResizeQuality.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ResizeQuality: String, JSValueCompatible { - case pixelated - case low - case medium - case high +public enum ResizeQuality: JSString, JSValueCompatible { + case pixelated = "pixelated" + case low = "low" + case medium = "medium" + case high = "high" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Response.swift b/Sources/DOMKit/WebIDL/Response.swift index 4b3c8a3a..e5d3c2bd 100644 --- a/Sources/DOMKit/WebIDL/Response.swift +++ b/Sources/DOMKit/WebIDL/Response.swift @@ -6,16 +6,29 @@ import JavaScriptKit public class Response: JSBridgedClass, Body { public class var constructor: JSFunction { JSObject.global.Response.function! } + private enum Keys { + static let redirected: JSString = "redirected" + static let type: JSString = "type" + static let status: JSString = "status" + static let statusText: JSString = "statusText" + static let headers: JSString = "headers" + static let clone: JSString = "clone" + static let ok: JSString = "ok" + static let error: JSString = "error" + static let redirect: JSString = "redirect" + static let url: JSString = "url" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") - _url = ReadonlyAttribute(jsObject: jsObject, name: "url") - _redirected = ReadonlyAttribute(jsObject: jsObject, name: "redirected") - _status = ReadonlyAttribute(jsObject: jsObject, name: "status") - _ok = ReadonlyAttribute(jsObject: jsObject, name: "ok") - _statusText = ReadonlyAttribute(jsObject: jsObject, name: "statusText") - _headers = ReadonlyAttribute(jsObject: jsObject, name: "headers") + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _url = ReadonlyAttribute(jsObject: jsObject, name: Keys.url) + _redirected = ReadonlyAttribute(jsObject: jsObject, name: Keys.redirected) + _status = ReadonlyAttribute(jsObject: jsObject, name: Keys.status) + _ok = ReadonlyAttribute(jsObject: jsObject, name: Keys.ok) + _statusText = ReadonlyAttribute(jsObject: jsObject, name: Keys.statusText) + _headers = ReadonlyAttribute(jsObject: jsObject, name: Keys.headers) self.jsObject = jsObject } @@ -24,11 +37,11 @@ public class Response: JSBridgedClass, Body { } public static func error() -> Self { - constructor["error"]!().fromJSValue()! + constructor[Keys.error]!().fromJSValue()! } public static func redirect(url: String, status: UInt16? = nil) -> Self { - constructor["redirect"]!(url.jsValue(), status?.jsValue() ?? .undefined).fromJSValue()! + constructor[Keys.redirect]!(url.jsValue(), status?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -53,6 +66,6 @@ public class Response: JSBridgedClass, Body { public var headers: Headers public func clone() -> Self { - jsObject["clone"]!().fromJSValue()! + jsObject[Keys.clone]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ResponseInit.swift b/Sources/DOMKit/WebIDL/ResponseInit.swift index 4f0b83e5..a9da2bcc 100644 --- a/Sources/DOMKit/WebIDL/ResponseInit.swift +++ b/Sources/DOMKit/WebIDL/ResponseInit.swift @@ -4,18 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class ResponseInit: BridgedDictionary { + private enum Keys { + static let headers: JSString = "headers" + static let status: JSString = "status" + static let statusText: JSString = "statusText" + } + public convenience init(status: UInt16, statusText: String, headers: HeadersInit) { let object = JSObject.global.Object.function!.new() - object["status"] = status.jsValue() - object["statusText"] = statusText.jsValue() - object["headers"] = headers.jsValue() + object[Keys.status] = status.jsValue() + object[Keys.statusText] = statusText.jsValue() + object[Keys.headers] = headers.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _status = ReadWriteAttribute(jsObject: object, name: "status") - _statusText = ReadWriteAttribute(jsObject: object, name: "statusText") - _headers = ReadWriteAttribute(jsObject: object, name: "headers") + _status = ReadWriteAttribute(jsObject: object, name: Keys.status) + _statusText = ReadWriteAttribute(jsObject: object, name: Keys.statusText) + _headers = ReadWriteAttribute(jsObject: object, name: Keys.headers) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ResponseType.swift b/Sources/DOMKit/WebIDL/ResponseType.swift index 055b6c8b..d62225e9 100644 --- a/Sources/DOMKit/WebIDL/ResponseType.swift +++ b/Sources/DOMKit/WebIDL/ResponseType.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ResponseType: String, JSValueCompatible { - case basic - case cors - case `default` - case error - case opaque - case opaqueredirect +public enum ResponseType: JSString, JSValueCompatible { + case basic = "basic" + case cors = "cors" + case `default` = "default" + case error = "error" + case opaque = "opaque" + case opaqueredirect = "opaqueredirect" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ScrollRestoration.swift b/Sources/DOMKit/WebIDL/ScrollRestoration.swift index 125bebb8..9e04eb9f 100644 --- a/Sources/DOMKit/WebIDL/ScrollRestoration.swift +++ b/Sources/DOMKit/WebIDL/ScrollRestoration.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ScrollRestoration: String, JSValueCompatible { - case auto - case manual +public enum ScrollRestoration: JSString, JSValueCompatible { + case auto = "auto" + case manual = "manual" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SelectionMode.swift b/Sources/DOMKit/WebIDL/SelectionMode.swift index 2da070df..3fee2390 100644 --- a/Sources/DOMKit/WebIDL/SelectionMode.swift +++ b/Sources/DOMKit/WebIDL/SelectionMode.swift @@ -3,18 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public enum SelectionMode: String, JSValueCompatible { - case select - case start - case end - case preserve +public enum SelectionMode: JSString, JSValueCompatible { + case select = "select" + case start = "start" + case end = "end" + case preserve = "preserve" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ShadowRoot.swift b/Sources/DOMKit/WebIDL/ShadowRoot.swift index e60c1923..068135b5 100644 --- a/Sources/DOMKit/WebIDL/ShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/ShadowRoot.swift @@ -6,12 +6,20 @@ import JavaScriptKit public class ShadowRoot: DocumentFragment, DocumentOrShadowRoot { override public class var constructor: JSFunction { JSObject.global.ShadowRoot.function! } + private enum Keys { + static let onslotchange: JSString = "onslotchange" + static let delegatesFocus: JSString = "delegatesFocus" + static let mode: JSString = "mode" + static let slotAssignment: JSString = "slotAssignment" + static let host: JSString = "host" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _mode = ReadonlyAttribute(jsObject: jsObject, name: "mode") - _delegatesFocus = ReadonlyAttribute(jsObject: jsObject, name: "delegatesFocus") - _slotAssignment = ReadonlyAttribute(jsObject: jsObject, name: "slotAssignment") - _host = ReadonlyAttribute(jsObject: jsObject, name: "host") - _onslotchange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onslotchange") + _mode = ReadonlyAttribute(jsObject: jsObject, name: Keys.mode) + _delegatesFocus = ReadonlyAttribute(jsObject: jsObject, name: Keys.delegatesFocus) + _slotAssignment = ReadonlyAttribute(jsObject: jsObject, name: Keys.slotAssignment) + _host = ReadonlyAttribute(jsObject: jsObject, name: Keys.host) + _onslotchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onslotchange) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/ShadowRootInit.swift b/Sources/DOMKit/WebIDL/ShadowRootInit.swift index 17f33188..6a7d74b4 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootInit.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootInit.swift @@ -4,18 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class ShadowRootInit: BridgedDictionary { + private enum Keys { + static let slotAssignment: JSString = "slotAssignment" + static let delegatesFocus: JSString = "delegatesFocus" + static let mode: JSString = "mode" + } + public convenience init(mode: ShadowRootMode, delegatesFocus: Bool, slotAssignment: SlotAssignmentMode) { let object = JSObject.global.Object.function!.new() - object["mode"] = mode.jsValue() - object["delegatesFocus"] = delegatesFocus.jsValue() - object["slotAssignment"] = slotAssignment.jsValue() + object[Keys.mode] = mode.jsValue() + object[Keys.delegatesFocus] = delegatesFocus.jsValue() + object[Keys.slotAssignment] = slotAssignment.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _mode = ReadWriteAttribute(jsObject: object, name: "mode") - _delegatesFocus = ReadWriteAttribute(jsObject: object, name: "delegatesFocus") - _slotAssignment = ReadWriteAttribute(jsObject: object, name: "slotAssignment") + _mode = ReadWriteAttribute(jsObject: object, name: Keys.mode) + _delegatesFocus = ReadWriteAttribute(jsObject: object, name: Keys.delegatesFocus) + _slotAssignment = ReadWriteAttribute(jsObject: object, name: Keys.slotAssignment) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ShadowRootMode.swift b/Sources/DOMKit/WebIDL/ShadowRootMode.swift index ae05fc6b..3beddbf2 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootMode.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootMode.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ShadowRootMode: String, JSValueCompatible { - case open - case closed +public enum ShadowRootMode: JSString, JSValueCompatible { + case open = "open" + case closed = "closed" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SharedWorker.swift b/Sources/DOMKit/WebIDL/SharedWorker.swift index ed1f14aa..67c24c5a 100644 --- a/Sources/DOMKit/WebIDL/SharedWorker.swift +++ b/Sources/DOMKit/WebIDL/SharedWorker.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class SharedWorker: EventTarget, AbstractWorker { override public class var constructor: JSFunction { JSObject.global.SharedWorker.function! } + private enum Keys { + static let port: JSString = "port" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _port = ReadonlyAttribute(jsObject: jsObject, name: "port") + _port = ReadonlyAttribute(jsObject: jsObject, name: Keys.port) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift index 9dca1cc1..8ecb94f0 100644 --- a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift @@ -6,9 +6,15 @@ import JavaScriptKit public class SharedWorkerGlobalScope: WorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global.SharedWorkerGlobalScope.function! } + private enum Keys { + static let onconnect: JSString = "onconnect" + static let name: JSString = "name" + static let close: JSString = "close" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: "name") - _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: "onconnect") + _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) + _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onconnect) super.init(unsafelyWrapping: jsObject) } @@ -16,7 +22,7 @@ public class SharedWorkerGlobalScope: WorkerGlobalScope { public var name: String public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift index 785a25e8..3913b9b1 100644 --- a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift +++ b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum SlotAssignmentMode: String, JSValueCompatible { - case manual - case named +public enum SlotAssignmentMode: JSString, JSValueCompatible { + case manual = "manual" + case named = "named" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Slottable.swift b/Sources/DOMKit/WebIDL/Slottable.swift index 8e69c746..9ba3b974 100644 --- a/Sources/DOMKit/WebIDL/Slottable.swift +++ b/Sources/DOMKit/WebIDL/Slottable.swift @@ -3,7 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let assignedSlot: JSString = "assignedSlot" +} + public protocol Slottable: JSBridgedClass {} public extension Slottable { - var assignedSlot: HTMLSlotElement? { ReadonlyAttribute["assignedSlot", in: jsObject] } + var assignedSlot: HTMLSlotElement? { ReadonlyAttribute[Keys.assignedSlot, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/StaticRange.swift b/Sources/DOMKit/WebIDL/StaticRange.swift index 63a88d45..64623a08 100644 --- a/Sources/DOMKit/WebIDL/StaticRange.swift +++ b/Sources/DOMKit/WebIDL/StaticRange.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class StaticRange: AbstractRange { override public class var constructor: JSFunction { JSObject.global.StaticRange.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/StaticRangeInit.swift b/Sources/DOMKit/WebIDL/StaticRangeInit.swift index b53c6244..b442fc36 100644 --- a/Sources/DOMKit/WebIDL/StaticRangeInit.swift +++ b/Sources/DOMKit/WebIDL/StaticRangeInit.swift @@ -4,20 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class StaticRangeInit: BridgedDictionary { + private enum Keys { + static let endOffset: JSString = "endOffset" + static let endContainer: JSString = "endContainer" + static let startContainer: JSString = "startContainer" + static let startOffset: JSString = "startOffset" + } + public convenience init(startContainer: Node, startOffset: UInt32, endContainer: Node, endOffset: UInt32) { let object = JSObject.global.Object.function!.new() - object["startContainer"] = startContainer.jsValue() - object["startOffset"] = startOffset.jsValue() - object["endContainer"] = endContainer.jsValue() - object["endOffset"] = endOffset.jsValue() + object[Keys.startContainer] = startContainer.jsValue() + object[Keys.startOffset] = startOffset.jsValue() + object[Keys.endContainer] = endContainer.jsValue() + object[Keys.endOffset] = endOffset.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _startContainer = ReadWriteAttribute(jsObject: object, name: "startContainer") - _startOffset = ReadWriteAttribute(jsObject: object, name: "startOffset") - _endContainer = ReadWriteAttribute(jsObject: object, name: "endContainer") - _endOffset = ReadWriteAttribute(jsObject: object, name: "endOffset") + _startContainer = ReadWriteAttribute(jsObject: object, name: Keys.startContainer) + _startOffset = ReadWriteAttribute(jsObject: object, name: Keys.startOffset) + _endContainer = ReadWriteAttribute(jsObject: object, name: Keys.endContainer) + _endOffset = ReadWriteAttribute(jsObject: object, name: Keys.endOffset) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Storage.swift b/Sources/DOMKit/WebIDL/Storage.swift index 677b53df..aeb8a3e7 100644 --- a/Sources/DOMKit/WebIDL/Storage.swift +++ b/Sources/DOMKit/WebIDL/Storage.swift @@ -6,10 +6,19 @@ import JavaScriptKit public class Storage: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Storage.function! } + private enum Keys { + static let clear: JSString = "clear" + static let key: JSString = "key" + static let removeItem: JSString = "removeItem" + static let getItem: JSString = "getItem" + static let length: JSString = "length" + static let setItem: JSString = "setItem" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } @@ -17,7 +26,7 @@ public class Storage: JSBridgedClass { public var length: UInt32 public func key(index: UInt32) -> String? { - jsObject["key"]!(index.jsValue()).fromJSValue()! + jsObject[Keys.key]!(index.jsValue()).fromJSValue()! } public subscript(key: String) -> String? { @@ -29,6 +38,6 @@ public class Storage: JSBridgedClass { // XXX: unsupported deleter for keys of type String public func clear() { - _ = jsObject["clear"]!() + _ = jsObject[Keys.clear]!() } } diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift index 704df066..2dd1a91d 100644 --- a/Sources/DOMKit/WebIDL/StorageEvent.swift +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -6,12 +6,21 @@ import JavaScriptKit public class StorageEvent: Event { override public class var constructor: JSFunction { JSObject.global.StorageEvent.function! } + private enum Keys { + static let oldValue: JSString = "oldValue" + static let key: JSString = "key" + static let storageArea: JSString = "storageArea" + static let url: JSString = "url" + static let newValue: JSString = "newValue" + static let initStorageEvent: JSString = "initStorageEvent" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _key = ReadonlyAttribute(jsObject: jsObject, name: "key") - _oldValue = ReadonlyAttribute(jsObject: jsObject, name: "oldValue") - _newValue = ReadonlyAttribute(jsObject: jsObject, name: "newValue") - _url = ReadonlyAttribute(jsObject: jsObject, name: "url") - _storageArea = ReadonlyAttribute(jsObject: jsObject, name: "storageArea") + _key = ReadonlyAttribute(jsObject: jsObject, name: Keys.key) + _oldValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.oldValue) + _newValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.newValue) + _url = ReadonlyAttribute(jsObject: jsObject, name: Keys.url) + _storageArea = ReadonlyAttribute(jsObject: jsObject, name: Keys.storageArea) super.init(unsafelyWrapping: jsObject) } @@ -43,6 +52,6 @@ public class StorageEvent: Event { let _arg5 = newValue?.jsValue() ?? .undefined let _arg6 = url?.jsValue() ?? .undefined let _arg7 = storageArea?.jsValue() ?? .undefined - _ = jsObject["initStorageEvent"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + _ = jsObject[Keys.initStorageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/StorageEventInit.swift b/Sources/DOMKit/WebIDL/StorageEventInit.swift index 935cfe03..a38d657a 100644 --- a/Sources/DOMKit/WebIDL/StorageEventInit.swift +++ b/Sources/DOMKit/WebIDL/StorageEventInit.swift @@ -4,22 +4,30 @@ import JavaScriptEventLoop import JavaScriptKit public class StorageEventInit: BridgedDictionary { + private enum Keys { + static let key: JSString = "key" + static let url: JSString = "url" + static let oldValue: JSString = "oldValue" + static let newValue: JSString = "newValue" + static let storageArea: JSString = "storageArea" + } + public convenience init(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?) { let object = JSObject.global.Object.function!.new() - object["key"] = key.jsValue() - object["oldValue"] = oldValue.jsValue() - object["newValue"] = newValue.jsValue() - object["url"] = url.jsValue() - object["storageArea"] = storageArea.jsValue() + object[Keys.key] = key.jsValue() + object[Keys.oldValue] = oldValue.jsValue() + object[Keys.newValue] = newValue.jsValue() + object[Keys.url] = url.jsValue() + object[Keys.storageArea] = storageArea.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _key = ReadWriteAttribute(jsObject: object, name: "key") - _oldValue = ReadWriteAttribute(jsObject: object, name: "oldValue") - _newValue = ReadWriteAttribute(jsObject: object, name: "newValue") - _url = ReadWriteAttribute(jsObject: object, name: "url") - _storageArea = ReadWriteAttribute(jsObject: object, name: "storageArea") + _key = ReadWriteAttribute(jsObject: object, name: Keys.key) + _oldValue = ReadWriteAttribute(jsObject: object, name: Keys.oldValue) + _newValue = ReadWriteAttribute(jsObject: object, name: Keys.newValue) + _url = ReadWriteAttribute(jsObject: object, name: Keys.url) + _storageArea = ReadWriteAttribute(jsObject: object, name: Keys.storageArea) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift index ab494046..d0d6478b 100644 --- a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift +++ b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift @@ -4,20 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class StreamPipeOptions: BridgedDictionary { + private enum Keys { + static let preventClose: JSString = "preventClose" + static let preventAbort: JSString = "preventAbort" + static let signal: JSString = "signal" + static let preventCancel: JSString = "preventCancel" + } + public convenience init(preventClose: Bool, preventAbort: Bool, preventCancel: Bool, signal: AbortSignal) { let object = JSObject.global.Object.function!.new() - object["preventClose"] = preventClose.jsValue() - object["preventAbort"] = preventAbort.jsValue() - object["preventCancel"] = preventCancel.jsValue() - object["signal"] = signal.jsValue() + object[Keys.preventClose] = preventClose.jsValue() + object[Keys.preventAbort] = preventAbort.jsValue() + object[Keys.preventCancel] = preventCancel.jsValue() + object[Keys.signal] = signal.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _preventClose = ReadWriteAttribute(jsObject: object, name: "preventClose") - _preventAbort = ReadWriteAttribute(jsObject: object, name: "preventAbort") - _preventCancel = ReadWriteAttribute(jsObject: object, name: "preventCancel") - _signal = ReadWriteAttribute(jsObject: object, name: "signal") + _preventClose = ReadWriteAttribute(jsObject: object, name: Keys.preventClose) + _preventAbort = ReadWriteAttribute(jsObject: object, name: Keys.preventAbort) + _preventCancel = ReadWriteAttribute(jsObject: object, name: Keys.preventCancel) + _signal = ReadWriteAttribute(jsObject: object, name: Keys.signal) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift index b517cea1..79aaaf40 100644 --- a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift +++ b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class StructuredSerializeOptions: BridgedDictionary { + private enum Keys { + static let transfer: JSString = "transfer" + } + public convenience init(transfer: [JSObject]) { let object = JSObject.global.Object.function!.new() - object["transfer"] = transfer.jsValue() + object[Keys.transfer] = transfer.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _transfer = ReadWriteAttribute(jsObject: object, name: "transfer") + _transfer = ReadWriteAttribute(jsObject: object, name: Keys.transfer) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StyleSheet.swift b/Sources/DOMKit/WebIDL/StyleSheet.swift index 2c716a5b..f12f9c03 100644 --- a/Sources/DOMKit/WebIDL/StyleSheet.swift +++ b/Sources/DOMKit/WebIDL/StyleSheet.swift @@ -6,16 +6,26 @@ import JavaScriptKit public class StyleSheet: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.StyleSheet.function! } + private enum Keys { + static let title: JSString = "title" + static let disabled: JSString = "disabled" + static let type: JSString = "type" + static let ownerNode: JSString = "ownerNode" + static let href: JSString = "href" + static let media: JSString = "media" + static let parentStyleSheet: JSString = "parentStyleSheet" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: "type") - _href = ReadonlyAttribute(jsObject: jsObject, name: "href") - _ownerNode = ReadonlyAttribute(jsObject: jsObject, name: "ownerNode") - _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: "parentStyleSheet") - _title = ReadonlyAttribute(jsObject: jsObject, name: "title") - _media = ReadonlyAttribute(jsObject: jsObject, name: "media") - _disabled = ReadWriteAttribute(jsObject: jsObject, name: "disabled") + _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _href = ReadonlyAttribute(jsObject: jsObject, name: Keys.href) + _ownerNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.ownerNode) + _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentStyleSheet) + _title = ReadonlyAttribute(jsObject: jsObject, name: Keys.title) + _media = ReadonlyAttribute(jsObject: jsObject, name: Keys.media) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/StyleSheetList.swift b/Sources/DOMKit/WebIDL/StyleSheetList.swift index 94a9eeef..41acf789 100644 --- a/Sources/DOMKit/WebIDL/StyleSheetList.swift +++ b/Sources/DOMKit/WebIDL/StyleSheetList.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class StyleSheetList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.StyleSheetList.function! } + private enum Keys { + static let item: JSString = "item" + static let length: JSString = "length" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/SubmitEvent.swift b/Sources/DOMKit/WebIDL/SubmitEvent.swift index 57ef4cd7..00542482 100644 --- a/Sources/DOMKit/WebIDL/SubmitEvent.swift +++ b/Sources/DOMKit/WebIDL/SubmitEvent.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class SubmitEvent: Event { override public class var constructor: JSFunction { JSObject.global.SubmitEvent.function! } + private enum Keys { + static let submitter: JSString = "submitter" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _submitter = ReadonlyAttribute(jsObject: jsObject, name: "submitter") + _submitter = ReadonlyAttribute(jsObject: jsObject, name: Keys.submitter) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/SubmitEventInit.swift b/Sources/DOMKit/WebIDL/SubmitEventInit.swift index 7c68bbd2..9bcf9332 100644 --- a/Sources/DOMKit/WebIDL/SubmitEventInit.swift +++ b/Sources/DOMKit/WebIDL/SubmitEventInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class SubmitEventInit: BridgedDictionary { + private enum Keys { + static let submitter: JSString = "submitter" + } + public convenience init(submitter: HTMLElement?) { let object = JSObject.global.Object.function!.new() - object["submitter"] = submitter.jsValue() + object[Keys.submitter] = submitter.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _submitter = ReadWriteAttribute(jsObject: object, name: "submitter") + _submitter = ReadWriteAttribute(jsObject: object, name: Keys.submitter) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index 51417b05..9f57fa34 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -6,8 +6,13 @@ import JavaScriptKit public class Text: CharacterData, Slottable { override public class var constructor: JSFunction { JSObject.global.Text.function! } + private enum Keys { + static let wholeText: JSString = "wholeText" + static let splitText: JSString = "splitText" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _wholeText = ReadonlyAttribute(jsObject: jsObject, name: "wholeText") + _wholeText = ReadonlyAttribute(jsObject: jsObject, name: Keys.wholeText) super.init(unsafelyWrapping: jsObject) } @@ -16,7 +21,7 @@ public class Text: CharacterData, Slottable { } public func splitText(offset: UInt32) -> Self { - jsObject["splitText"]!(offset.jsValue()).fromJSValue()! + jsObject[Keys.splitText]!(offset.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TextMetrics.swift b/Sources/DOMKit/WebIDL/TextMetrics.swift index e3960601..0f3bb189 100644 --- a/Sources/DOMKit/WebIDL/TextMetrics.swift +++ b/Sources/DOMKit/WebIDL/TextMetrics.swift @@ -6,21 +6,36 @@ import JavaScriptKit public class TextMetrics: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TextMetrics.function! } + private enum Keys { + static let actualBoundingBoxRight: JSString = "actualBoundingBoxRight" + static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" + static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" + static let hangingBaseline: JSString = "hangingBaseline" + static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" + static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" + static let alphabeticBaseline: JSString = "alphabeticBaseline" + static let emHeightDescent: JSString = "emHeightDescent" + static let width: JSString = "width" + static let fontBoundingBoxDescent: JSString = "fontBoundingBoxDescent" + static let emHeightAscent: JSString = "emHeightAscent" + static let ideographicBaseline: JSString = "ideographicBaseline" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: "width") - _actualBoundingBoxLeft = ReadonlyAttribute(jsObject: jsObject, name: "actualBoundingBoxLeft") - _actualBoundingBoxRight = ReadonlyAttribute(jsObject: jsObject, name: "actualBoundingBoxRight") - _fontBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: "fontBoundingBoxAscent") - _fontBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: "fontBoundingBoxDescent") - _actualBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: "actualBoundingBoxAscent") - _actualBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: "actualBoundingBoxDescent") - _emHeightAscent = ReadonlyAttribute(jsObject: jsObject, name: "emHeightAscent") - _emHeightDescent = ReadonlyAttribute(jsObject: jsObject, name: "emHeightDescent") - _hangingBaseline = ReadonlyAttribute(jsObject: jsObject, name: "hangingBaseline") - _alphabeticBaseline = ReadonlyAttribute(jsObject: jsObject, name: "alphabeticBaseline") - _ideographicBaseline = ReadonlyAttribute(jsObject: jsObject, name: "ideographicBaseline") + _width = ReadonlyAttribute(jsObject: jsObject, name: Keys.width) + _actualBoundingBoxLeft = ReadonlyAttribute(jsObject: jsObject, name: Keys.actualBoundingBoxLeft) + _actualBoundingBoxRight = ReadonlyAttribute(jsObject: jsObject, name: Keys.actualBoundingBoxRight) + _fontBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Keys.fontBoundingBoxAscent) + _fontBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Keys.fontBoundingBoxDescent) + _actualBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Keys.actualBoundingBoxAscent) + _actualBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Keys.actualBoundingBoxDescent) + _emHeightAscent = ReadonlyAttribute(jsObject: jsObject, name: Keys.emHeightAscent) + _emHeightDescent = ReadonlyAttribute(jsObject: jsObject, name: Keys.emHeightDescent) + _hangingBaseline = ReadonlyAttribute(jsObject: jsObject, name: Keys.hangingBaseline) + _alphabeticBaseline = ReadonlyAttribute(jsObject: jsObject, name: Keys.alphabeticBaseline) + _ideographicBaseline = ReadonlyAttribute(jsObject: jsObject, name: Keys.ideographicBaseline) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index e9933993..923febb3 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -6,16 +6,30 @@ import JavaScriptKit public class TextTrack: EventTarget { override public class var constructor: JSFunction { JSObject.global.TextTrack.function! } + private enum Keys { + static let removeCue: JSString = "removeCue" + static let cues: JSString = "cues" + static let addCue: JSString = "addCue" + static let label: JSString = "label" + static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" + static let id: JSString = "id" + static let oncuechange: JSString = "oncuechange" + static let language: JSString = "language" + static let kind: JSString = "kind" + static let activeCues: JSString = "activeCues" + static let mode: JSString = "mode" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _kind = ReadonlyAttribute(jsObject: jsObject, name: "kind") - _label = ReadonlyAttribute(jsObject: jsObject, name: "label") - _language = ReadonlyAttribute(jsObject: jsObject, name: "language") - _id = ReadonlyAttribute(jsObject: jsObject, name: "id") - _inBandMetadataTrackDispatchType = ReadonlyAttribute(jsObject: jsObject, name: "inBandMetadataTrackDispatchType") - _mode = ReadWriteAttribute(jsObject: jsObject, name: "mode") - _cues = ReadonlyAttribute(jsObject: jsObject, name: "cues") - _activeCues = ReadonlyAttribute(jsObject: jsObject, name: "activeCues") - _oncuechange = ClosureAttribute.Optional1(jsObject: jsObject, name: "oncuechange") + _kind = ReadonlyAttribute(jsObject: jsObject, name: Keys.kind) + _label = ReadonlyAttribute(jsObject: jsObject, name: Keys.label) + _language = ReadonlyAttribute(jsObject: jsObject, name: Keys.language) + _id = ReadonlyAttribute(jsObject: jsObject, name: Keys.id) + _inBandMetadataTrackDispatchType = ReadonlyAttribute(jsObject: jsObject, name: Keys.inBandMetadataTrackDispatchType) + _mode = ReadWriteAttribute(jsObject: jsObject, name: Keys.mode) + _cues = ReadonlyAttribute(jsObject: jsObject, name: Keys.cues) + _activeCues = ReadonlyAttribute(jsObject: jsObject, name: Keys.activeCues) + _oncuechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.oncuechange) super.init(unsafelyWrapping: jsObject) } @@ -44,11 +58,11 @@ public class TextTrack: EventTarget { public var activeCues: TextTrackCueList? public func addCue(cue: TextTrackCue) { - _ = jsObject["addCue"]!(cue.jsValue()) + _ = jsObject[Keys.addCue]!(cue.jsValue()) } public func removeCue(cue: TextTrackCue) { - _ = jsObject["removeCue"]!(cue.jsValue()) + _ = jsObject[Keys.removeCue]!(cue.jsValue()) } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/TextTrackCue.swift b/Sources/DOMKit/WebIDL/TextTrackCue.swift index f1e2161e..78bd90c6 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCue.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCue.swift @@ -6,14 +6,24 @@ import JavaScriptKit public class TextTrackCue: EventTarget { override public class var constructor: JSFunction { JSObject.global.TextTrackCue.function! } + private enum Keys { + static let startTime: JSString = "startTime" + static let track: JSString = "track" + static let endTime: JSString = "endTime" + static let pauseOnExit: JSString = "pauseOnExit" + static let onenter: JSString = "onenter" + static let id: JSString = "id" + static let onexit: JSString = "onexit" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _track = ReadonlyAttribute(jsObject: jsObject, name: "track") - _id = ReadWriteAttribute(jsObject: jsObject, name: "id") - _startTime = ReadWriteAttribute(jsObject: jsObject, name: "startTime") - _endTime = ReadWriteAttribute(jsObject: jsObject, name: "endTime") - _pauseOnExit = ReadWriteAttribute(jsObject: jsObject, name: "pauseOnExit") - _onenter = ClosureAttribute.Optional1(jsObject: jsObject, name: "onenter") - _onexit = ClosureAttribute.Optional1(jsObject: jsObject, name: "onexit") + _track = ReadonlyAttribute(jsObject: jsObject, name: Keys.track) + _id = ReadWriteAttribute(jsObject: jsObject, name: Keys.id) + _startTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.startTime) + _endTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.endTime) + _pauseOnExit = ReadWriteAttribute(jsObject: jsObject, name: Keys.pauseOnExit) + _onenter = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onenter) + _onexit = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onexit) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/TextTrackCueList.swift b/Sources/DOMKit/WebIDL/TextTrackCueList.swift index cfaab293..122b45af 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCueList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCueList.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class TextTrackCueList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TextTrackCueList.function! } + private enum Keys { + static let getCueById: JSString = "getCueById" + static let length: JSString = "length" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } @@ -21,6 +26,6 @@ public class TextTrackCueList: JSBridgedClass { } public func getCueById(id: String) -> TextTrackCue? { - jsObject["getCueById"]!(id.jsValue()).fromJSValue()! + jsObject[Keys.getCueById]!(id.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextTrackKind.swift b/Sources/DOMKit/WebIDL/TextTrackKind.swift index 1381263f..6794a701 100644 --- a/Sources/DOMKit/WebIDL/TextTrackKind.swift +++ b/Sources/DOMKit/WebIDL/TextTrackKind.swift @@ -3,19 +3,23 @@ import JavaScriptEventLoop import JavaScriptKit -public enum TextTrackKind: String, JSValueCompatible { - case subtitles - case captions - case descriptions - case chapters - case metadata +public enum TextTrackKind: JSString, JSValueCompatible { + case subtitles = "subtitles" + case captions = "captions" + case descriptions = "descriptions" + case chapters = "chapters" + case metadata = "metadata" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift index e76d5f99..f2bb6ce1 100644 --- a/Sources/DOMKit/WebIDL/TextTrackList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -6,11 +6,19 @@ import JavaScriptKit public class TextTrackList: EventTarget { override public class var constructor: JSFunction { JSObject.global.TextTrackList.function! } + private enum Keys { + static let onremovetrack: JSString = "onremovetrack" + static let onaddtrack: JSString = "onaddtrack" + static let onchange: JSString = "onchange" + static let length: JSString = "length" + static let getTrackById: JSString = "getTrackById" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onchange") - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onaddtrack") - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onremovetrack") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onchange) + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onaddtrack) + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onremovetrack) super.init(unsafelyWrapping: jsObject) } @@ -22,7 +30,7 @@ public class TextTrackList: EventTarget { } public func getTrackById(id: String) -> TextTrack? { - jsObject["getTrackById"]!(id.jsValue()).fromJSValue()! + jsObject[Keys.getTrackById]!(id.jsValue()).fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/TextTrackMode.swift b/Sources/DOMKit/WebIDL/TextTrackMode.swift index 37af9717..4bd17465 100644 --- a/Sources/DOMKit/WebIDL/TextTrackMode.swift +++ b/Sources/DOMKit/WebIDL/TextTrackMode.swift @@ -3,17 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -public enum TextTrackMode: String, JSValueCompatible { - case disabled - case hidden - case showing +public enum TextTrackMode: JSString, JSValueCompatible { + case disabled = "disabled" + case hidden = "hidden" + case showing = "showing" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TimeRanges.swift b/Sources/DOMKit/WebIDL/TimeRanges.swift index 948a6166..01122c26 100644 --- a/Sources/DOMKit/WebIDL/TimeRanges.swift +++ b/Sources/DOMKit/WebIDL/TimeRanges.swift @@ -6,10 +6,16 @@ import JavaScriptKit public class TimeRanges: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TimeRanges.function! } + private enum Keys { + static let start: JSString = "start" + static let length: JSString = "length" + static let end: JSString = "end" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) self.jsObject = jsObject } @@ -17,10 +23,10 @@ public class TimeRanges: JSBridgedClass { public var length: UInt32 public func start(index: UInt32) -> Double { - jsObject["start"]!(index.jsValue()).fromJSValue()! + jsObject[Keys.start]!(index.jsValue()).fromJSValue()! } public func end(index: UInt32) -> Double { - jsObject["end"]!(index.jsValue()).fromJSValue()! + jsObject[Keys.end]!(index.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrackEvent.swift b/Sources/DOMKit/WebIDL/TrackEvent.swift index 2d3daec9..b5392a01 100644 --- a/Sources/DOMKit/WebIDL/TrackEvent.swift +++ b/Sources/DOMKit/WebIDL/TrackEvent.swift @@ -6,8 +6,12 @@ import JavaScriptKit public class TrackEvent: Event { override public class var constructor: JSFunction { JSObject.global.TrackEvent.function! } + private enum Keys { + static let track: JSString = "track" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _track = ReadonlyAttribute(jsObject: jsObject, name: "track") + _track = ReadonlyAttribute(jsObject: jsObject, name: Keys.track) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/TrackEventInit.swift b/Sources/DOMKit/WebIDL/TrackEventInit.swift index f8f7eec3..1cd8ee38 100644 --- a/Sources/DOMKit/WebIDL/TrackEventInit.swift +++ b/Sources/DOMKit/WebIDL/TrackEventInit.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class TrackEventInit: BridgedDictionary { + private enum Keys { + static let track: JSString = "track" + } + public convenience init(track: __UNSUPPORTED_UNION__?) { let object = JSObject.global.Object.function!.new() - object["track"] = track.jsValue() + object[Keys.track] = track.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _track = ReadWriteAttribute(jsObject: object, name: "track") + _track = ReadWriteAttribute(jsObject: object, name: Keys.track) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TransformStream.swift b/Sources/DOMKit/WebIDL/TransformStream.swift index 20c54b40..bb3e25de 100644 --- a/Sources/DOMKit/WebIDL/TransformStream.swift +++ b/Sources/DOMKit/WebIDL/TransformStream.swift @@ -6,11 +6,16 @@ import JavaScriptKit public class TransformStream: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TransformStream.function! } + private enum Keys { + static let readable: JSString = "readable" + static let writable: JSString = "writable" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _readable = ReadonlyAttribute(jsObject: jsObject, name: "readable") - _writable = ReadonlyAttribute(jsObject: jsObject, name: "writable") + _readable = ReadonlyAttribute(jsObject: jsObject, name: Keys.readable) + _writable = ReadonlyAttribute(jsObject: jsObject, name: Keys.writable) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift index 45612eec..6c2c66cc 100644 --- a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift @@ -6,10 +6,17 @@ import JavaScriptKit public class TransformStreamDefaultController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TransformStreamDefaultController.function! } + private enum Keys { + static let terminate: JSString = "terminate" + static let desiredSize: JSString = "desiredSize" + static let enqueue: JSString = "enqueue" + static let error: JSString = "error" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: "desiredSize") + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Keys.desiredSize) self.jsObject = jsObject } @@ -17,14 +24,14 @@ public class TransformStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func enqueue(chunk: JSValue? = nil) { - _ = jsObject["enqueue"]!(chunk?.jsValue() ?? .undefined) + _ = jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined) } public func error(reason: JSValue? = nil) { - _ = jsObject["error"]!(reason?.jsValue() ?? .undefined) + _ = jsObject[Keys.error]!(reason?.jsValue() ?? .undefined) } public func terminate() { - _ = jsObject["terminate"]!() + _ = jsObject[Keys.terminate]!() } } diff --git a/Sources/DOMKit/WebIDL/Transformer.swift b/Sources/DOMKit/WebIDL/Transformer.swift index cea69b86..515348a1 100644 --- a/Sources/DOMKit/WebIDL/Transformer.swift +++ b/Sources/DOMKit/WebIDL/Transformer.swift @@ -4,22 +4,30 @@ import JavaScriptEventLoop import JavaScriptKit public class Transformer: BridgedDictionary { + private enum Keys { + static let writableType: JSString = "writableType" + static let start: JSString = "start" + static let flush: JSString = "flush" + static let transform: JSString = "transform" + static let readableType: JSString = "readableType" + } + public convenience init(start: @escaping TransformerStartCallback, transform: @escaping TransformerTransformCallback, flush: @escaping TransformerFlushCallback, readableType: JSValue, writableType: JSValue) { let object = JSObject.global.Object.function!.new() - ClosureAttribute.Required1["start", in: object] = start - ClosureAttribute.Required2["transform", in: object] = transform - ClosureAttribute.Required1["flush", in: object] = flush - object["readableType"] = readableType.jsValue() - object["writableType"] = writableType.jsValue() + ClosureAttribute.Required1[Keys.start, in: object] = start + ClosureAttribute.Required2[Keys.transform, in: object] = transform + ClosureAttribute.Required1[Keys.flush, in: object] = flush + object[Keys.readableType] = readableType.jsValue() + object[Keys.writableType] = writableType.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _start = ClosureAttribute.Required1(jsObject: object, name: "start") - _transform = ClosureAttribute.Required2(jsObject: object, name: "transform") - _flush = ClosureAttribute.Required1(jsObject: object, name: "flush") - _readableType = ReadWriteAttribute(jsObject: object, name: "readableType") - _writableType = ReadWriteAttribute(jsObject: object, name: "writableType") + _start = ClosureAttribute.Required1(jsObject: object, name: Keys.start) + _transform = ClosureAttribute.Required2(jsObject: object, name: Keys.transform) + _flush = ClosureAttribute.Required1(jsObject: object, name: Keys.flush) + _readableType = ReadWriteAttribute(jsObject: object, name: Keys.readableType) + _writableType = ReadWriteAttribute(jsObject: object, name: Keys.writableType) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TreeWalker.swift b/Sources/DOMKit/WebIDL/TreeWalker.swift index ea5c959d..89e933bc 100644 --- a/Sources/DOMKit/WebIDL/TreeWalker.swift +++ b/Sources/DOMKit/WebIDL/TreeWalker.swift @@ -6,12 +6,26 @@ import JavaScriptKit public class TreeWalker: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TreeWalker.function! } + private enum Keys { + static let parentNode: JSString = "parentNode" + static let filter: JSString = "filter" + static let previousSibling: JSString = "previousSibling" + static let nextSibling: JSString = "nextSibling" + static let firstChild: JSString = "firstChild" + static let currentNode: JSString = "currentNode" + static let previousNode: JSString = "previousNode" + static let root: JSString = "root" + static let whatToShow: JSString = "whatToShow" + static let lastChild: JSString = "lastChild" + static let nextNode: JSString = "nextNode" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _root = ReadonlyAttribute(jsObject: jsObject, name: "root") - _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: "whatToShow") - _currentNode = ReadWriteAttribute(jsObject: jsObject, name: "currentNode") + _root = ReadonlyAttribute(jsObject: jsObject, name: Keys.root) + _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: Keys.whatToShow) + _currentNode = ReadWriteAttribute(jsObject: jsObject, name: Keys.currentNode) self.jsObject = jsObject } @@ -27,30 +41,30 @@ public class TreeWalker: JSBridgedClass { public var currentNode: Node public func parentNode() -> Node? { - jsObject["parentNode"]!().fromJSValue()! + jsObject[Keys.parentNode]!().fromJSValue()! } public func firstChild() -> Node? { - jsObject["firstChild"]!().fromJSValue()! + jsObject[Keys.firstChild]!().fromJSValue()! } public func lastChild() -> Node? { - jsObject["lastChild"]!().fromJSValue()! + jsObject[Keys.lastChild]!().fromJSValue()! } public func previousSibling() -> Node? { - jsObject["previousSibling"]!().fromJSValue()! + jsObject[Keys.previousSibling]!().fromJSValue()! } public func nextSibling() -> Node? { - jsObject["nextSibling"]!().fromJSValue()! + jsObject[Keys.nextSibling]!().fromJSValue()! } public func previousNode() -> Node? { - jsObject["previousNode"]!().fromJSValue()! + jsObject[Keys.previousNode]!().fromJSValue()! } public func nextNode() -> Node? { - jsObject["nextNode"]!().fromJSValue()! + jsObject[Keys.nextNode]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index 9d1eb920..6d018fa8 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -6,10 +6,17 @@ import JavaScriptKit public class UIEvent: Event { override public class var constructor: JSFunction { JSObject.global.UIEvent.function! } + private enum Keys { + static let view: JSString = "view" + static let detail: JSString = "detail" + static let which: JSString = "which" + static let initUIEvent: JSString = "initUIEvent" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _view = ReadonlyAttribute(jsObject: jsObject, name: "view") - _detail = ReadonlyAttribute(jsObject: jsObject, name: "detail") - _which = ReadonlyAttribute(jsObject: jsObject, name: "which") + _view = ReadonlyAttribute(jsObject: jsObject, name: Keys.view) + _detail = ReadonlyAttribute(jsObject: jsObject, name: Keys.detail) + _which = ReadonlyAttribute(jsObject: jsObject, name: Keys.which) super.init(unsafelyWrapping: jsObject) } @@ -24,7 +31,7 @@ public class UIEvent: Event { public var detail: Int32 public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil) { - _ = jsObject["initUIEvent"]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined) + _ = jsObject[Keys.initUIEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/UIEventInit.swift b/Sources/DOMKit/WebIDL/UIEventInit.swift index a172283a..9e60a25a 100644 --- a/Sources/DOMKit/WebIDL/UIEventInit.swift +++ b/Sources/DOMKit/WebIDL/UIEventInit.swift @@ -4,18 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class UIEventInit: BridgedDictionary { + private enum Keys { + static let which: JSString = "which" + static let view: JSString = "view" + static let detail: JSString = "detail" + } + public convenience init(view: Window?, detail: Int32, which: UInt32) { let object = JSObject.global.Object.function!.new() - object["view"] = view.jsValue() - object["detail"] = detail.jsValue() - object["which"] = which.jsValue() + object[Keys.view] = view.jsValue() + object[Keys.detail] = detail.jsValue() + object[Keys.which] = which.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _view = ReadWriteAttribute(jsObject: object, name: "view") - _detail = ReadWriteAttribute(jsObject: object, name: "detail") - _which = ReadWriteAttribute(jsObject: object, name: "which") + _view = ReadWriteAttribute(jsObject: object, name: Keys.view) + _detail = ReadWriteAttribute(jsObject: object, name: Keys.detail) + _which = ReadWriteAttribute(jsObject: object, name: Keys.which) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index b38e251d..e884ce66 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -6,6 +6,11 @@ import JavaScriptKit public class URL: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.URL.function! } + private enum Keys { + static let revokeObjectURL: JSString = "revokeObjectURL" + static let createObjectURL: JSString = "createObjectURL" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -13,10 +18,10 @@ public class URL: JSBridgedClass { } public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { - constructor["createObjectURL"]!(obj.jsValue()).fromJSValue()! + constructor[Keys.createObjectURL]!(obj.jsValue()).fromJSValue()! } public static func revokeObjectURL(url: String) { - _ = constructor["revokeObjectURL"]!(url.jsValue()) + _ = constructor[Keys.revokeObjectURL]!(url.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift index b9c1a4b0..3adf4cee 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSink.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSink.swift @@ -4,22 +4,30 @@ import JavaScriptEventLoop import JavaScriptKit public class UnderlyingSink: BridgedDictionary { + private enum Keys { + static let type: JSString = "type" + static let abort: JSString = "abort" + static let start: JSString = "start" + static let write: JSString = "write" + static let close: JSString = "close" + } + public convenience init(start: @escaping UnderlyingSinkStartCallback, write: @escaping UnderlyingSinkWriteCallback, close: @escaping UnderlyingSinkCloseCallback, abort: @escaping UnderlyingSinkAbortCallback, type: JSValue) { let object = JSObject.global.Object.function!.new() - ClosureAttribute.Required1["start", in: object] = start - ClosureAttribute.Required2["write", in: object] = write - ClosureAttribute.Required0["close", in: object] = close - ClosureAttribute.Required1["abort", in: object] = abort - object["type"] = type.jsValue() + ClosureAttribute.Required1[Keys.start, in: object] = start + ClosureAttribute.Required2[Keys.write, in: object] = write + ClosureAttribute.Required0[Keys.close, in: object] = close + ClosureAttribute.Required1[Keys.abort, in: object] = abort + object[Keys.type] = type.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _start = ClosureAttribute.Required1(jsObject: object, name: "start") - _write = ClosureAttribute.Required2(jsObject: object, name: "write") - _close = ClosureAttribute.Required0(jsObject: object, name: "close") - _abort = ClosureAttribute.Required1(jsObject: object, name: "abort") - _type = ReadWriteAttribute(jsObject: object, name: "type") + _start = ClosureAttribute.Required1(jsObject: object, name: Keys.start) + _write = ClosureAttribute.Required2(jsObject: object, name: Keys.write) + _close = ClosureAttribute.Required0(jsObject: object, name: Keys.close) + _abort = ClosureAttribute.Required1(jsObject: object, name: Keys.abort) + _type = ReadWriteAttribute(jsObject: object, name: Keys.type) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/UnderlyingSource.swift b/Sources/DOMKit/WebIDL/UnderlyingSource.swift index db2e673a..92999796 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSource.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSource.swift @@ -4,22 +4,30 @@ import JavaScriptEventLoop import JavaScriptKit public class UnderlyingSource: BridgedDictionary { + private enum Keys { + static let cancel: JSString = "cancel" + static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" + static let type: JSString = "type" + static let pull: JSString = "pull" + static let start: JSString = "start" + } + public convenience init(start: @escaping UnderlyingSourceStartCallback, pull: @escaping UnderlyingSourcePullCallback, cancel: @escaping UnderlyingSourceCancelCallback, type: ReadableStreamType, autoAllocateChunkSize: UInt64) { let object = JSObject.global.Object.function!.new() - ClosureAttribute.Required1["start", in: object] = start - ClosureAttribute.Required1["pull", in: object] = pull - ClosureAttribute.Required1["cancel", in: object] = cancel - object["type"] = type.jsValue() - object["autoAllocateChunkSize"] = autoAllocateChunkSize.jsValue() + ClosureAttribute.Required1[Keys.start, in: object] = start + ClosureAttribute.Required1[Keys.pull, in: object] = pull + ClosureAttribute.Required1[Keys.cancel, in: object] = cancel + object[Keys.type] = type.jsValue() + object[Keys.autoAllocateChunkSize] = autoAllocateChunkSize.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _start = ClosureAttribute.Required1(jsObject: object, name: "start") - _pull = ClosureAttribute.Required1(jsObject: object, name: "pull") - _cancel = ClosureAttribute.Required1(jsObject: object, name: "cancel") - _type = ReadWriteAttribute(jsObject: object, name: "type") - _autoAllocateChunkSize = ReadWriteAttribute(jsObject: object, name: "autoAllocateChunkSize") + _start = ClosureAttribute.Required1(jsObject: object, name: Keys.start) + _pull = ClosureAttribute.Required1(jsObject: object, name: Keys.pull) + _cancel = ClosureAttribute.Required1(jsObject: object, name: Keys.cancel) + _type = ReadWriteAttribute(jsObject: object, name: Keys.type) + _autoAllocateChunkSize = ReadWriteAttribute(jsObject: object, name: Keys.autoAllocateChunkSize) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ValidityState.swift b/Sources/DOMKit/WebIDL/ValidityState.swift index d9df2f26..c68a226b 100644 --- a/Sources/DOMKit/WebIDL/ValidityState.swift +++ b/Sources/DOMKit/WebIDL/ValidityState.swift @@ -6,20 +6,34 @@ import JavaScriptKit public class ValidityState: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ValidityState.function! } + private enum Keys { + static let stepMismatch: JSString = "stepMismatch" + static let typeMismatch: JSString = "typeMismatch" + static let valid: JSString = "valid" + static let customError: JSString = "customError" + static let patternMismatch: JSString = "patternMismatch" + static let valueMissing: JSString = "valueMissing" + static let rangeUnderflow: JSString = "rangeUnderflow" + static let rangeOverflow: JSString = "rangeOverflow" + static let badInput: JSString = "badInput" + static let tooShort: JSString = "tooShort" + static let tooLong: JSString = "tooLong" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _valueMissing = ReadonlyAttribute(jsObject: jsObject, name: "valueMissing") - _typeMismatch = ReadonlyAttribute(jsObject: jsObject, name: "typeMismatch") - _patternMismatch = ReadonlyAttribute(jsObject: jsObject, name: "patternMismatch") - _tooLong = ReadonlyAttribute(jsObject: jsObject, name: "tooLong") - _tooShort = ReadonlyAttribute(jsObject: jsObject, name: "tooShort") - _rangeUnderflow = ReadonlyAttribute(jsObject: jsObject, name: "rangeUnderflow") - _rangeOverflow = ReadonlyAttribute(jsObject: jsObject, name: "rangeOverflow") - _stepMismatch = ReadonlyAttribute(jsObject: jsObject, name: "stepMismatch") - _badInput = ReadonlyAttribute(jsObject: jsObject, name: "badInput") - _customError = ReadonlyAttribute(jsObject: jsObject, name: "customError") - _valid = ReadonlyAttribute(jsObject: jsObject, name: "valid") + _valueMissing = ReadonlyAttribute(jsObject: jsObject, name: Keys.valueMissing) + _typeMismatch = ReadonlyAttribute(jsObject: jsObject, name: Keys.typeMismatch) + _patternMismatch = ReadonlyAttribute(jsObject: jsObject, name: Keys.patternMismatch) + _tooLong = ReadonlyAttribute(jsObject: jsObject, name: Keys.tooLong) + _tooShort = ReadonlyAttribute(jsObject: jsObject, name: Keys.tooShort) + _rangeUnderflow = ReadonlyAttribute(jsObject: jsObject, name: Keys.rangeUnderflow) + _rangeOverflow = ReadonlyAttribute(jsObject: jsObject, name: Keys.rangeOverflow) + _stepMismatch = ReadonlyAttribute(jsObject: jsObject, name: Keys.stepMismatch) + _badInput = ReadonlyAttribute(jsObject: jsObject, name: Keys.badInput) + _customError = ReadonlyAttribute(jsObject: jsObject, name: Keys.customError) + _valid = ReadonlyAttribute(jsObject: jsObject, name: Keys.valid) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift index 9784488d..39240df2 100644 --- a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift +++ b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift @@ -4,32 +4,45 @@ import JavaScriptEventLoop import JavaScriptKit public class ValidityStateFlags: BridgedDictionary { + private enum Keys { + static let badInput: JSString = "badInput" + static let patternMismatch: JSString = "patternMismatch" + static let tooShort: JSString = "tooShort" + static let rangeUnderflow: JSString = "rangeUnderflow" + static let stepMismatch: JSString = "stepMismatch" + static let customError: JSString = "customError" + static let typeMismatch: JSString = "typeMismatch" + static let valueMissing: JSString = "valueMissing" + static let rangeOverflow: JSString = "rangeOverflow" + static let tooLong: JSString = "tooLong" + } + 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.Object.function!.new() - object["valueMissing"] = valueMissing.jsValue() - object["typeMismatch"] = typeMismatch.jsValue() - object["patternMismatch"] = patternMismatch.jsValue() - object["tooLong"] = tooLong.jsValue() - object["tooShort"] = tooShort.jsValue() - object["rangeUnderflow"] = rangeUnderflow.jsValue() - object["rangeOverflow"] = rangeOverflow.jsValue() - object["stepMismatch"] = stepMismatch.jsValue() - object["badInput"] = badInput.jsValue() - object["customError"] = customError.jsValue() + object[Keys.valueMissing] = valueMissing.jsValue() + object[Keys.typeMismatch] = typeMismatch.jsValue() + object[Keys.patternMismatch] = patternMismatch.jsValue() + object[Keys.tooLong] = tooLong.jsValue() + object[Keys.tooShort] = tooShort.jsValue() + object[Keys.rangeUnderflow] = rangeUnderflow.jsValue() + object[Keys.rangeOverflow] = rangeOverflow.jsValue() + object[Keys.stepMismatch] = stepMismatch.jsValue() + object[Keys.badInput] = badInput.jsValue() + object[Keys.customError] = customError.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _valueMissing = ReadWriteAttribute(jsObject: object, name: "valueMissing") - _typeMismatch = ReadWriteAttribute(jsObject: object, name: "typeMismatch") - _patternMismatch = ReadWriteAttribute(jsObject: object, name: "patternMismatch") - _tooLong = ReadWriteAttribute(jsObject: object, name: "tooLong") - _tooShort = ReadWriteAttribute(jsObject: object, name: "tooShort") - _rangeUnderflow = ReadWriteAttribute(jsObject: object, name: "rangeUnderflow") - _rangeOverflow = ReadWriteAttribute(jsObject: object, name: "rangeOverflow") - _stepMismatch = ReadWriteAttribute(jsObject: object, name: "stepMismatch") - _badInput = ReadWriteAttribute(jsObject: object, name: "badInput") - _customError = ReadWriteAttribute(jsObject: object, name: "customError") + _valueMissing = ReadWriteAttribute(jsObject: object, name: Keys.valueMissing) + _typeMismatch = ReadWriteAttribute(jsObject: object, name: Keys.typeMismatch) + _patternMismatch = ReadWriteAttribute(jsObject: object, name: Keys.patternMismatch) + _tooLong = ReadWriteAttribute(jsObject: object, name: Keys.tooLong) + _tooShort = ReadWriteAttribute(jsObject: object, name: Keys.tooShort) + _rangeUnderflow = ReadWriteAttribute(jsObject: object, name: Keys.rangeUnderflow) + _rangeOverflow = ReadWriteAttribute(jsObject: object, name: Keys.rangeOverflow) + _stepMismatch = ReadWriteAttribute(jsObject: object, name: Keys.stepMismatch) + _badInput = ReadWriteAttribute(jsObject: object, name: Keys.badInput) + _customError = ReadWriteAttribute(jsObject: object, name: Keys.customError) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/VideoTrack.swift b/Sources/DOMKit/WebIDL/VideoTrack.swift index aac3286d..f9b49d69 100644 --- a/Sources/DOMKit/WebIDL/VideoTrack.swift +++ b/Sources/DOMKit/WebIDL/VideoTrack.swift @@ -6,14 +6,22 @@ import JavaScriptKit public class VideoTrack: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.VideoTrack.function! } + private enum Keys { + static let selected: JSString = "selected" + static let language: JSString = "language" + static let kind: JSString = "kind" + static let id: JSString = "id" + static let label: JSString = "label" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: "id") - _kind = ReadonlyAttribute(jsObject: jsObject, name: "kind") - _label = ReadonlyAttribute(jsObject: jsObject, name: "label") - _language = ReadonlyAttribute(jsObject: jsObject, name: "language") - _selected = ReadWriteAttribute(jsObject: jsObject, name: "selected") + _id = ReadonlyAttribute(jsObject: jsObject, name: Keys.id) + _kind = ReadonlyAttribute(jsObject: jsObject, name: Keys.kind) + _label = ReadonlyAttribute(jsObject: jsObject, name: Keys.label) + _language = ReadonlyAttribute(jsObject: jsObject, name: Keys.language) + _selected = ReadWriteAttribute(jsObject: jsObject, name: Keys.selected) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift index 15d53d75..d13e9ee3 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackList.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -6,12 +6,21 @@ import JavaScriptKit public class VideoTrackList: EventTarget { override public class var constructor: JSFunction { JSObject.global.VideoTrackList.function! } + private enum Keys { + static let length: JSString = "length" + static let getTrackById: JSString = "getTrackById" + static let onchange: JSString = "onchange" + static let selectedIndex: JSString = "selectedIndex" + static let onaddtrack: JSString = "onaddtrack" + static let onremovetrack: JSString = "onremovetrack" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") - _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: "selectedIndex") - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onchange") - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onaddtrack") - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: "onremovetrack") + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Keys.selectedIndex) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onchange) + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onaddtrack) + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onremovetrack) super.init(unsafelyWrapping: jsObject) } @@ -23,7 +32,7 @@ public class VideoTrackList: EventTarget { } public func getTrackById(id: String) -> VideoTrack? { - jsObject["getTrackById"]!(id.jsValue()).fromJSValue()! + jsObject[Keys.getTrackById]!(id.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WheelEvent.swift b/Sources/DOMKit/WebIDL/WheelEvent.swift index 7083cc48..5fd24136 100644 --- a/Sources/DOMKit/WebIDL/WheelEvent.swift +++ b/Sources/DOMKit/WebIDL/WheelEvent.swift @@ -6,11 +6,21 @@ import JavaScriptKit public class WheelEvent: MouseEvent { override public class var constructor: JSFunction { JSObject.global.WheelEvent.function! } + private enum Keys { + static let DOM_DELTA_PIXEL: JSString = "DOM_DELTA_PIXEL" + static let deltaY: JSString = "deltaY" + static let DOM_DELTA_PAGE: JSString = "DOM_DELTA_PAGE" + static let deltaZ: JSString = "deltaZ" + static let DOM_DELTA_LINE: JSString = "DOM_DELTA_LINE" + static let deltaMode: JSString = "deltaMode" + static let deltaX: JSString = "deltaX" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _deltaX = ReadonlyAttribute(jsObject: jsObject, name: "deltaX") - _deltaY = ReadonlyAttribute(jsObject: jsObject, name: "deltaY") - _deltaZ = ReadonlyAttribute(jsObject: jsObject, name: "deltaZ") - _deltaMode = ReadonlyAttribute(jsObject: jsObject, name: "deltaMode") + _deltaX = ReadonlyAttribute(jsObject: jsObject, name: Keys.deltaX) + _deltaY = ReadonlyAttribute(jsObject: jsObject, name: Keys.deltaY) + _deltaZ = ReadonlyAttribute(jsObject: jsObject, name: Keys.deltaZ) + _deltaMode = ReadonlyAttribute(jsObject: jsObject, name: Keys.deltaMode) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/WheelEventInit.swift b/Sources/DOMKit/WebIDL/WheelEventInit.swift index 53396cee..c723f91e 100644 --- a/Sources/DOMKit/WebIDL/WheelEventInit.swift +++ b/Sources/DOMKit/WebIDL/WheelEventInit.swift @@ -4,20 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class WheelEventInit: BridgedDictionary { + private enum Keys { + static let deltaMode: JSString = "deltaMode" + static let deltaY: JSString = "deltaY" + static let deltaZ: JSString = "deltaZ" + static let deltaX: JSString = "deltaX" + } + public convenience init(deltaX: Double, deltaY: Double, deltaZ: Double, deltaMode: UInt32) { let object = JSObject.global.Object.function!.new() - object["deltaX"] = deltaX.jsValue() - object["deltaY"] = deltaY.jsValue() - object["deltaZ"] = deltaZ.jsValue() - object["deltaMode"] = deltaMode.jsValue() + object[Keys.deltaX] = deltaX.jsValue() + object[Keys.deltaY] = deltaY.jsValue() + object[Keys.deltaZ] = deltaZ.jsValue() + object[Keys.deltaMode] = deltaMode.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _deltaX = ReadWriteAttribute(jsObject: object, name: "deltaX") - _deltaY = ReadWriteAttribute(jsObject: object, name: "deltaY") - _deltaZ = ReadWriteAttribute(jsObject: object, name: "deltaZ") - _deltaMode = ReadWriteAttribute(jsObject: object, name: "deltaMode") + _deltaX = ReadWriteAttribute(jsObject: object, name: Keys.deltaX) + _deltaY = ReadWriteAttribute(jsObject: object, name: Keys.deltaY) + _deltaZ = ReadWriteAttribute(jsObject: object, name: Keys.deltaZ) + _deltaMode = ReadWriteAttribute(jsObject: object, name: Keys.deltaMode) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 03af4286..47105c7e 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -6,33 +6,75 @@ import JavaScriptKit public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, WindowOrWorkerGlobalScope, AnimationFrameProvider, WindowSessionStorage, WindowLocalStorage { override public class var constructor: JSFunction { JSObject.global.Window.function! } + private enum Keys { + static let print: JSString = "print" + static let name: JSString = "name" + static let `self`: JSString = "self" + static let document: JSString = "document" + static let status: JSString = "status" + static let close: JSString = "close" + static let opener: JSString = "opener" + static let menubar: JSString = "menubar" + static let personalbar: JSString = "personalbar" + static let clientInformation: JSString = "clientInformation" + static let focus: JSString = "focus" + static let parent: JSString = "parent" + static let top: JSString = "top" + static let location: JSString = "location" + static let alert: JSString = "alert" + static let window: JSString = "window" + static let locationbar: JSString = "locationbar" + static let closed: JSString = "closed" + static let customElements: JSString = "customElements" + static let frameElement: JSString = "frameElement" + static let statusbar: JSString = "statusbar" + static let open: JSString = "open" + static let navigator: JSString = "navigator" + static let history: JSString = "history" + static let length: JSString = "length" + static let releaseEvents: JSString = "releaseEvents" + static let postMessage: JSString = "postMessage" + static let external: JSString = "external" + static let getComputedStyle: JSString = "getComputedStyle" + static let blur: JSString = "blur" + static let stop: JSString = "stop" + static let originAgentCluster: JSString = "originAgentCluster" + static let confirm: JSString = "confirm" + static let frames: JSString = "frames" + static let captureEvents: JSString = "captureEvents" + static let event: JSString = "event" + static let prompt: JSString = "prompt" + static let toolbar: JSString = "toolbar" + static let scrollbars: JSString = "scrollbars" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _event = ReadonlyAttribute(jsObject: jsObject, name: "event") - _window = ReadonlyAttribute(jsObject: jsObject, name: "window") - _self = ReadonlyAttribute(jsObject: jsObject, name: "self") - _document = ReadonlyAttribute(jsObject: jsObject, name: "document") - _name = ReadWriteAttribute(jsObject: jsObject, name: "name") - _location = ReadonlyAttribute(jsObject: jsObject, name: "location") - _history = ReadonlyAttribute(jsObject: jsObject, name: "history") - _customElements = ReadonlyAttribute(jsObject: jsObject, name: "customElements") - _locationbar = ReadonlyAttribute(jsObject: jsObject, name: "locationbar") - _menubar = ReadonlyAttribute(jsObject: jsObject, name: "menubar") - _personalbar = ReadonlyAttribute(jsObject: jsObject, name: "personalbar") - _scrollbars = ReadonlyAttribute(jsObject: jsObject, name: "scrollbars") - _statusbar = ReadonlyAttribute(jsObject: jsObject, name: "statusbar") - _toolbar = ReadonlyAttribute(jsObject: jsObject, name: "toolbar") - _status = ReadWriteAttribute(jsObject: jsObject, name: "status") - _closed = ReadonlyAttribute(jsObject: jsObject, name: "closed") - _frames = ReadonlyAttribute(jsObject: jsObject, name: "frames") - _length = ReadonlyAttribute(jsObject: jsObject, name: "length") - _top = ReadonlyAttribute(jsObject: jsObject, name: "top") - _opener = ReadWriteAttribute(jsObject: jsObject, name: "opener") - _parent = ReadonlyAttribute(jsObject: jsObject, name: "parent") - _frameElement = ReadonlyAttribute(jsObject: jsObject, name: "frameElement") - _navigator = ReadonlyAttribute(jsObject: jsObject, name: "navigator") - _clientInformation = ReadonlyAttribute(jsObject: jsObject, name: "clientInformation") - _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: "originAgentCluster") - _external = ReadonlyAttribute(jsObject: jsObject, name: "external") + _event = ReadonlyAttribute(jsObject: jsObject, name: Keys.event) + _window = ReadonlyAttribute(jsObject: jsObject, name: Keys.window) + _self = ReadonlyAttribute(jsObject: jsObject, name: Keys.self) + _document = ReadonlyAttribute(jsObject: jsObject, name: Keys.document) + _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _location = ReadonlyAttribute(jsObject: jsObject, name: Keys.location) + _history = ReadonlyAttribute(jsObject: jsObject, name: Keys.history) + _customElements = ReadonlyAttribute(jsObject: jsObject, name: Keys.customElements) + _locationbar = ReadonlyAttribute(jsObject: jsObject, name: Keys.locationbar) + _menubar = ReadonlyAttribute(jsObject: jsObject, name: Keys.menubar) + _personalbar = ReadonlyAttribute(jsObject: jsObject, name: Keys.personalbar) + _scrollbars = ReadonlyAttribute(jsObject: jsObject, name: Keys.scrollbars) + _statusbar = ReadonlyAttribute(jsObject: jsObject, name: Keys.statusbar) + _toolbar = ReadonlyAttribute(jsObject: jsObject, name: Keys.toolbar) + _status = ReadWriteAttribute(jsObject: jsObject, name: Keys.status) + _closed = ReadonlyAttribute(jsObject: jsObject, name: Keys.closed) + _frames = ReadonlyAttribute(jsObject: jsObject, name: Keys.frames) + _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _top = ReadonlyAttribute(jsObject: jsObject, name: Keys.top) + _opener = ReadWriteAttribute(jsObject: jsObject, name: Keys.opener) + _parent = ReadonlyAttribute(jsObject: jsObject, name: Keys.parent) + _frameElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.frameElement) + _navigator = ReadonlyAttribute(jsObject: jsObject, name: Keys.navigator) + _clientInformation = ReadonlyAttribute(jsObject: jsObject, name: Keys.clientInformation) + _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: Keys.originAgentCluster) + _external = ReadonlyAttribute(jsObject: jsObject, name: Keys.external) super.init(unsafelyWrapping: jsObject) } @@ -82,22 +124,22 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var status: String public func close() { - _ = jsObject["close"]!() + _ = jsObject[Keys.close]!() } @ReadonlyAttribute public var closed: Bool public func stop() { - _ = jsObject["stop"]!() + _ = jsObject[Keys.stop]!() } public func focus() { - _ = jsObject["focus"]!() + _ = jsObject[Keys.focus]!() } public func blur() { - _ = jsObject["blur"]!() + _ = jsObject[Keys.blur]!() } @ReadonlyAttribute @@ -119,7 +161,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var frameElement: Element? public func open(url: String? = nil, target: String? = nil, features: String? = nil) -> WindowProxy? { - jsObject["open"]!(url?.jsValue() ?? .undefined, target?.jsValue() ?? .undefined, features?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.open]!(url?.jsValue() ?? .undefined, target?.jsValue() ?? .undefined, features?.jsValue() ?? .undefined).fromJSValue()! } public subscript(key: String) -> JSObject { @@ -136,45 +178,45 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var originAgentCluster: Bool public func alert() { - _ = jsObject["alert"]!() + _ = jsObject[Keys.alert]!() } public func alert(message: String) { - _ = jsObject["alert"]!(message.jsValue()) + _ = jsObject[Keys.alert]!(message.jsValue()) } public func confirm(message: String? = nil) -> Bool { - jsObject["confirm"]!(message?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.confirm]!(message?.jsValue() ?? .undefined).fromJSValue()! } public func prompt(message: String? = nil, default: String? = nil) -> String? { - jsObject["prompt"]!(message?.jsValue() ?? .undefined, `default`?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.prompt]!(message?.jsValue() ?? .undefined, `default`?.jsValue() ?? .undefined).fromJSValue()! } public func print() { - _ = jsObject["print"]!() + _ = jsObject[Keys.print]!() } public func postMessage(message: JSValue, targetOrigin: String, transfer: [JSObject]? = nil) { - _ = jsObject["postMessage"]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined) + _ = jsObject[Keys.postMessage]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined) } public func postMessage(message: JSValue, options: WindowPostMessageOptions? = nil) { - _ = jsObject["postMessage"]!(message.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } public func captureEvents() { - _ = jsObject["captureEvents"]!() + _ = jsObject[Keys.captureEvents]!() } public func releaseEvents() { - _ = jsObject["releaseEvents"]!() + _ = jsObject[Keys.releaseEvents]!() } @ReadonlyAttribute public var external: External public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { - jsObject["getComputedStyle"]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index 154e14b5..4a34b80b 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -3,85 +3,104 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let onbeforeunload: JSString = "onbeforeunload" + static let onafterprint: JSString = "onafterprint" + static let onstorage: JSString = "onstorage" + static let onmessage: JSString = "onmessage" + static let onmessageerror: JSString = "onmessageerror" + static let onunhandledrejection: JSString = "onunhandledrejection" + static let onlanguagechange: JSString = "onlanguagechange" + static let onhashchange: JSString = "onhashchange" + static let onbeforeprint: JSString = "onbeforeprint" + static let onoffline: JSString = "onoffline" + static let ononline: JSString = "ononline" + static let onpopstate: JSString = "onpopstate" + static let onpagehide: JSString = "onpagehide" + static let onpageshow: JSString = "onpageshow" + static let onrejectionhandled: JSString = "onrejectionhandled" + static let onunload: JSString = "onunload" +} + public protocol WindowEventHandlers: JSBridgedClass {} public extension WindowEventHandlers { var onafterprint: EventHandler { - get { ClosureAttribute.Optional1["onafterprint", in: jsObject] } - set { ClosureAttribute.Optional1["onafterprint", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onafterprint, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onafterprint, in: jsObject] = newValue } } var onbeforeprint: EventHandler { - get { ClosureAttribute.Optional1["onbeforeprint", in: jsObject] } - set { ClosureAttribute.Optional1["onbeforeprint", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onbeforeprint, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onbeforeprint, in: jsObject] = newValue } } var onbeforeunload: OnBeforeUnloadEventHandler { - get { ClosureAttribute.Optional1["onbeforeunload", in: jsObject] } - set { ClosureAttribute.Optional1["onbeforeunload", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onbeforeunload, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onbeforeunload, in: jsObject] = newValue } } var onhashchange: EventHandler { - get { ClosureAttribute.Optional1["onhashchange", in: jsObject] } - set { ClosureAttribute.Optional1["onhashchange", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onhashchange, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onhashchange, in: jsObject] = newValue } } var onlanguagechange: EventHandler { - get { ClosureAttribute.Optional1["onlanguagechange", in: jsObject] } - set { ClosureAttribute.Optional1["onlanguagechange", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onlanguagechange, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onlanguagechange, in: jsObject] = newValue } } var onmessage: EventHandler { - get { ClosureAttribute.Optional1["onmessage", in: jsObject] } - set { ClosureAttribute.Optional1["onmessage", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onmessage, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onmessage, in: jsObject] = newValue } } var onmessageerror: EventHandler { - get { ClosureAttribute.Optional1["onmessageerror", in: jsObject] } - set { ClosureAttribute.Optional1["onmessageerror", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onmessageerror, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onmessageerror, in: jsObject] = newValue } } var onoffline: EventHandler { - get { ClosureAttribute.Optional1["onoffline", in: jsObject] } - set { ClosureAttribute.Optional1["onoffline", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onoffline, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onoffline, in: jsObject] = newValue } } var ononline: EventHandler { - get { ClosureAttribute.Optional1["ononline", in: jsObject] } - set { ClosureAttribute.Optional1["ononline", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.ononline, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.ononline, in: jsObject] = newValue } } var onpagehide: EventHandler { - get { ClosureAttribute.Optional1["onpagehide", in: jsObject] } - set { ClosureAttribute.Optional1["onpagehide", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onpagehide, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onpagehide, in: jsObject] = newValue } } var onpageshow: EventHandler { - get { ClosureAttribute.Optional1["onpageshow", in: jsObject] } - set { ClosureAttribute.Optional1["onpageshow", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onpageshow, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onpageshow, in: jsObject] = newValue } } var onpopstate: EventHandler { - get { ClosureAttribute.Optional1["onpopstate", in: jsObject] } - set { ClosureAttribute.Optional1["onpopstate", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onpopstate, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onpopstate, in: jsObject] = newValue } } var onrejectionhandled: EventHandler { - get { ClosureAttribute.Optional1["onrejectionhandled", in: jsObject] } - set { ClosureAttribute.Optional1["onrejectionhandled", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onrejectionhandled, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onrejectionhandled, in: jsObject] = newValue } } var onstorage: EventHandler { - get { ClosureAttribute.Optional1["onstorage", in: jsObject] } - set { ClosureAttribute.Optional1["onstorage", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onstorage, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onstorage, in: jsObject] = newValue } } var onunhandledrejection: EventHandler { - get { ClosureAttribute.Optional1["onunhandledrejection", in: jsObject] } - set { ClosureAttribute.Optional1["onunhandledrejection", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onunhandledrejection, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onunhandledrejection, in: jsObject] = newValue } } var onunload: EventHandler { - get { ClosureAttribute.Optional1["onunload", in: jsObject] } - set { ClosureAttribute.Optional1["onunload", in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Keys.onunload, in: jsObject] } + set { ClosureAttribute.Optional1[Keys.onunload, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/WindowLocalStorage.swift b/Sources/DOMKit/WebIDL/WindowLocalStorage.swift index a94ba5b7..4fb37a47 100644 --- a/Sources/DOMKit/WebIDL/WindowLocalStorage.swift +++ b/Sources/DOMKit/WebIDL/WindowLocalStorage.swift @@ -3,7 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let localStorage: JSString = "localStorage" +} + public protocol WindowLocalStorage: JSBridgedClass {} public extension WindowLocalStorage { - var localStorage: Storage { ReadonlyAttribute["localStorage", in: jsObject] } + var localStorage: Storage { ReadonlyAttribute[Keys.localStorage, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index a077dbcb..744174d5 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -3,53 +3,71 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let crossOriginIsolated: JSString = "crossOriginIsolated" + static let queueMicrotask: JSString = "queueMicrotask" + static let structuredClone: JSString = "structuredClone" + static let origin: JSString = "origin" + static let setTimeout: JSString = "setTimeout" + static let performance: JSString = "performance" + static let setInterval: JSString = "setInterval" + static let btoa: JSString = "btoa" + static let createImageBitmap: JSString = "createImageBitmap" + static let reportError: JSString = "reportError" + static let clearTimeout: JSString = "clearTimeout" + static let atob: JSString = "atob" + static let clearInterval: JSString = "clearInterval" + static let fetch: JSString = "fetch" + static let isSecureContext: JSString = "isSecureContext" +} + public protocol WindowOrWorkerGlobalScope: JSBridgedClass {} public extension WindowOrWorkerGlobalScope { - var performance: Performance { ReadonlyAttribute["performance", in: jsObject] } + var performance: Performance { ReadonlyAttribute[Keys.performance, in: jsObject] } - var origin: String { ReadonlyAttribute["origin", in: jsObject] } + var origin: String { ReadonlyAttribute[Keys.origin, in: jsObject] } - var isSecureContext: Bool { ReadonlyAttribute["isSecureContext", in: jsObject] } + var isSecureContext: Bool { ReadonlyAttribute[Keys.isSecureContext, in: jsObject] } - var crossOriginIsolated: Bool { ReadonlyAttribute["crossOriginIsolated", in: jsObject] } + var crossOriginIsolated: Bool { ReadonlyAttribute[Keys.crossOriginIsolated, in: jsObject] } func reportError(e: JSValue) { - _ = jsObject["reportError"]!(e.jsValue()) + _ = jsObject[Keys.reportError]!(e.jsValue()) } func btoa(data: String) -> String { - jsObject["btoa"]!(data.jsValue()).fromJSValue()! + jsObject[Keys.btoa]!(data.jsValue()).fromJSValue()! } func atob(data: String) -> String { - jsObject["atob"]!(data.jsValue()).fromJSValue()! + jsObject[Keys.atob]!(data.jsValue()).fromJSValue()! } func setTimeout(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { - jsObject["setTimeout"]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! + jsObject[Keys.setTimeout]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! } func clearTimeout(id: Int32? = nil) { - _ = jsObject["clearTimeout"]!(id?.jsValue() ?? .undefined) + _ = jsObject[Keys.clearTimeout]!(id?.jsValue() ?? .undefined) } func setInterval(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { - jsObject["setInterval"]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! + jsObject[Keys.setInterval]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! } func clearInterval(id: Int32? = nil) { - _ = jsObject["clearInterval"]!(id?.jsValue() ?? .undefined) + _ = jsObject[Keys.clearInterval]!(id?.jsValue() ?? .undefined) } // XXX: method 'queueMicrotask' is ignored func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) -> JSPromise { - jsObject["createImageBitmap"]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { - let _promise: JSPromise = jsObject["createImageBitmap"]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -60,7 +78,7 @@ public extension WindowOrWorkerGlobalScope { let _arg3 = sw.jsValue() let _arg4 = sh.jsValue() let _arg5 = options?.jsValue() ?? .undefined - return jsObject["createImageBitmap"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + return jsObject[Keys.createImageBitmap]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @@ -71,21 +89,21 @@ public extension WindowOrWorkerGlobalScope { let _arg3 = sw.jsValue() let _arg4 = sh.jsValue() let _arg5 = options?.jsValue() ?? .undefined - let _promise: JSPromise = jsObject["createImageBitmap"]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.createImageBitmap]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! return try await _promise.get().fromJSValue()! } func structuredClone(value: JSValue, options: StructuredSerializeOptions? = nil) -> JSValue { - jsObject["structuredClone"]!(value.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.structuredClone]!(value.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { - jsObject["fetch"]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func fetch(input: RequestInfo, init: RequestInit? = nil) async throws -> Response { - let _promise: JSPromise = jsObject["fetch"]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift index 74af44aa..5f743c4e 100644 --- a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift +++ b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class WindowPostMessageOptions: BridgedDictionary { + private enum Keys { + static let targetOrigin: JSString = "targetOrigin" + } + public convenience init(targetOrigin: String) { let object = JSObject.global.Object.function!.new() - object["targetOrigin"] = targetOrigin.jsValue() + object[Keys.targetOrigin] = targetOrigin.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _targetOrigin = ReadWriteAttribute(jsObject: object, name: "targetOrigin") + _targetOrigin = ReadWriteAttribute(jsObject: object, name: Keys.targetOrigin) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WindowSessionStorage.swift b/Sources/DOMKit/WebIDL/WindowSessionStorage.swift index 03ff37b5..40049ec0 100644 --- a/Sources/DOMKit/WebIDL/WindowSessionStorage.swift +++ b/Sources/DOMKit/WebIDL/WindowSessionStorage.swift @@ -3,7 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let sessionStorage: JSString = "sessionStorage" +} + public protocol WindowSessionStorage: JSBridgedClass {} public extension WindowSessionStorage { - var sessionStorage: Storage { ReadonlyAttribute["sessionStorage", in: jsObject] } + var sessionStorage: Storage { ReadonlyAttribute[Keys.sessionStorage, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index 4542c84d..63940ce8 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -6,9 +6,16 @@ import JavaScriptKit public class Worker: EventTarget, AbstractWorker { override public class var constructor: JSFunction { JSObject.global.Worker.function! } + private enum Keys { + static let postMessage: JSString = "postMessage" + static let onmessage: JSString = "onmessage" + static let terminate: JSString = "terminate" + static let onmessageerror: JSString = "onmessageerror" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessage") - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onmessageerror") + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -17,15 +24,15 @@ public class Worker: EventTarget, AbstractWorker { } public func terminate() { - _ = jsObject["terminate"]!() + _ = jsObject[Keys.terminate]!() } public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject["postMessage"]!(message.jsValue(), transfer.jsValue()) + _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject["postMessage"]!(message.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index 1ebe5765..228dffbd 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -6,16 +6,29 @@ import JavaScriptKit public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global.WorkerGlobalScope.function! } + private enum Keys { + static let location: JSString = "location" + static let `self`: JSString = "self" + static let onunhandledrejection: JSString = "onunhandledrejection" + static let onerror: JSString = "onerror" + static let ononline: JSString = "ononline" + static let navigator: JSString = "navigator" + static let importScripts: JSString = "importScripts" + static let onlanguagechange: JSString = "onlanguagechange" + static let onoffline: JSString = "onoffline" + static let onrejectionhandled: JSString = "onrejectionhandled" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _self = ReadonlyAttribute(jsObject: jsObject, name: "self") - _location = ReadonlyAttribute(jsObject: jsObject, name: "location") - _navigator = ReadonlyAttribute(jsObject: jsObject, name: "navigator") - _onerror = ClosureAttribute.Optional5(jsObject: jsObject, name: "onerror") - _onlanguagechange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onlanguagechange") - _onoffline = ClosureAttribute.Optional1(jsObject: jsObject, name: "onoffline") - _ononline = ClosureAttribute.Optional1(jsObject: jsObject, name: "ononline") - _onrejectionhandled = ClosureAttribute.Optional1(jsObject: jsObject, name: "onrejectionhandled") - _onunhandledrejection = ClosureAttribute.Optional1(jsObject: jsObject, name: "onunhandledrejection") + _self = ReadonlyAttribute(jsObject: jsObject, name: Keys.self) + _location = ReadonlyAttribute(jsObject: jsObject, name: Keys.location) + _navigator = ReadonlyAttribute(jsObject: jsObject, name: Keys.navigator) + _onerror = ClosureAttribute.Optional5(jsObject: jsObject, name: Keys.onerror) + _onlanguagechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onlanguagechange) + _onoffline = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onoffline) + _ononline = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.ononline) + _onrejectionhandled = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onrejectionhandled) + _onunhandledrejection = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onunhandledrejection) super.init(unsafelyWrapping: jsObject) } @@ -29,7 +42,7 @@ public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope { public var navigator: WorkerNavigator public func importScripts(urls: String...) { - _ = jsObject["importScripts"]!(urls.jsValue()) + _ = jsObject[Keys.importScripts]!(urls.jsValue()) } @ClosureAttribute.Optional5 diff --git a/Sources/DOMKit/WebIDL/WorkerLocation.swift b/Sources/DOMKit/WebIDL/WorkerLocation.swift index 1b80f2cd..de3967de 100644 --- a/Sources/DOMKit/WebIDL/WorkerLocation.swift +++ b/Sources/DOMKit/WebIDL/WorkerLocation.swift @@ -6,18 +6,30 @@ import JavaScriptKit public class WorkerLocation: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WorkerLocation.function! } + private enum Keys { + static let href: JSString = "href" + static let host: JSString = "host" + static let search: JSString = "search" + static let origin: JSString = "origin" + static let hash: JSString = "hash" + static let `protocol`: JSString = "protocol" + static let pathname: JSString = "pathname" + static let port: JSString = "port" + static let hostname: JSString = "hostname" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadonlyAttribute(jsObject: jsObject, name: "href") - _origin = ReadonlyAttribute(jsObject: jsObject, name: "origin") - _protocol = ReadonlyAttribute(jsObject: jsObject, name: "protocol") - _host = ReadonlyAttribute(jsObject: jsObject, name: "host") - _hostname = ReadonlyAttribute(jsObject: jsObject, name: "hostname") - _port = ReadonlyAttribute(jsObject: jsObject, name: "port") - _pathname = ReadonlyAttribute(jsObject: jsObject, name: "pathname") - _search = ReadonlyAttribute(jsObject: jsObject, name: "search") - _hash = ReadonlyAttribute(jsObject: jsObject, name: "hash") + _href = ReadonlyAttribute(jsObject: jsObject, name: Keys.href) + _origin = ReadonlyAttribute(jsObject: jsObject, name: Keys.origin) + _protocol = ReadonlyAttribute(jsObject: jsObject, name: Keys.protocol) + _host = ReadonlyAttribute(jsObject: jsObject, name: Keys.host) + _hostname = ReadonlyAttribute(jsObject: jsObject, name: Keys.hostname) + _port = ReadonlyAttribute(jsObject: jsObject, name: Keys.port) + _pathname = ReadonlyAttribute(jsObject: jsObject, name: Keys.pathname) + _search = ReadonlyAttribute(jsObject: jsObject, name: Keys.search) + _hash = ReadonlyAttribute(jsObject: jsObject, name: Keys.hash) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/WorkerNavigator.swift b/Sources/DOMKit/WebIDL/WorkerNavigator.swift index 3f859040..9dc89d33 100644 --- a/Sources/DOMKit/WebIDL/WorkerNavigator.swift +++ b/Sources/DOMKit/WebIDL/WorkerNavigator.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class WorkerNavigator: JSBridgedClass, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware { public class var constructor: JSFunction { JSObject.global.WorkerNavigator.function! } + private enum Keys {} + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/WorkerOptions.swift b/Sources/DOMKit/WebIDL/WorkerOptions.swift index 698db9db..c2b1cfc5 100644 --- a/Sources/DOMKit/WebIDL/WorkerOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkerOptions.swift @@ -4,18 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkerOptions: BridgedDictionary { + private enum Keys { + static let type: JSString = "type" + static let credentials: JSString = "credentials" + static let name: JSString = "name" + } + public convenience init(type: WorkerType, credentials: RequestCredentials, name: String) { let object = JSObject.global.Object.function!.new() - object["type"] = type.jsValue() - object["credentials"] = credentials.jsValue() - object["name"] = name.jsValue() + object[Keys.type] = type.jsValue() + object[Keys.credentials] = credentials.jsValue() + object[Keys.name] = name.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: "type") - _credentials = ReadWriteAttribute(jsObject: object, name: "credentials") - _name = ReadWriteAttribute(jsObject: object, name: "name") + _type = ReadWriteAttribute(jsObject: object, name: Keys.type) + _credentials = ReadWriteAttribute(jsObject: object, name: Keys.credentials) + _name = ReadWriteAttribute(jsObject: object, name: Keys.name) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WorkerType.swift b/Sources/DOMKit/WebIDL/WorkerType.swift index 96e9c4c8..8e1f37ec 100644 --- a/Sources/DOMKit/WebIDL/WorkerType.swift +++ b/Sources/DOMKit/WebIDL/WorkerType.swift @@ -3,16 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public enum WorkerType: String, JSValueCompatible { - case classic - case module +public enum WorkerType: JSString, JSValueCompatible { + case classic = "classic" + case module = "module" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Worklet.swift b/Sources/DOMKit/WebIDL/Worklet.swift index aae88b84..abc59f91 100644 --- a/Sources/DOMKit/WebIDL/Worklet.swift +++ b/Sources/DOMKit/WebIDL/Worklet.swift @@ -6,6 +6,10 @@ import JavaScriptKit public class Worklet: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Worklet.function! } + private enum Keys { + static let addModule: JSString = "addModule" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -13,12 +17,12 @@ public class Worklet: JSBridgedClass { } public func addModule(moduleURL: String, options: WorkletOptions? = nil) -> JSPromise { - jsObject["addModule"]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func addModule(moduleURL: String, options: WorkletOptions? = nil) async throws { - let _promise: JSPromise = jsObject["addModule"]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift index 1deddd8d..daf4d2cd 100644 --- a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class WorkletGlobalScope: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WorkletGlobalScope.function! } + private enum Keys {} + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/WorkletOptions.swift b/Sources/DOMKit/WebIDL/WorkletOptions.swift index 26caffaf..633ca416 100644 --- a/Sources/DOMKit/WebIDL/WorkletOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkletOptions.swift @@ -4,14 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkletOptions: BridgedDictionary { + private enum Keys { + static let credentials: JSString = "credentials" + } + public convenience init(credentials: RequestCredentials) { let object = JSObject.global.Object.function!.new() - object["credentials"] = credentials.jsValue() + object[Keys.credentials] = credentials.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _credentials = ReadWriteAttribute(jsObject: object, name: "credentials") + _credentials = ReadWriteAttribute(jsObject: object, name: Keys.credentials) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift index aa2aeb44..4c08b03f 100644 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -6,10 +6,17 @@ import JavaScriptKit public class WritableStream: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WritableStream.function! } + private enum Keys { + static let getWriter: JSString = "getWriter" + static let locked: JSString = "locked" + static let abort: JSString = "abort" + static let close: JSString = "close" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _locked = ReadonlyAttribute(jsObject: jsObject, name: "locked") + _locked = ReadonlyAttribute(jsObject: jsObject, name: Keys.locked) self.jsObject = jsObject } @@ -21,26 +28,26 @@ public class WritableStream: JSBridgedClass { public var locked: Bool public func abort(reason: JSValue? = nil) -> JSPromise { - jsObject["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject["close"]!().fromJSValue()! + jsObject[Keys.close]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func close() async throws { - let _promise: JSPromise = jsObject["close"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.close]!().fromJSValue()! _ = try await _promise.get() } public func getWriter() -> WritableStreamDefaultWriter { - jsObject["getWriter"]!().fromJSValue()! + jsObject[Keys.getWriter]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift index 94a9fa35..8280410c 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift @@ -6,10 +6,15 @@ import JavaScriptKit public class WritableStreamDefaultController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WritableStreamDefaultController.function! } + private enum Keys { + static let error: JSString = "error" + static let signal: JSString = "signal" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _signal = ReadonlyAttribute(jsObject: jsObject, name: "signal") + _signal = ReadonlyAttribute(jsObject: jsObject, name: Keys.signal) self.jsObject = jsObject } @@ -17,6 +22,6 @@ public class WritableStreamDefaultController: JSBridgedClass { public var signal: AbortSignal public func error(e: JSValue? = nil) { - _ = jsObject["error"]!(e?.jsValue() ?? .undefined) + _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift index 66c19209..b6695349 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -6,12 +6,22 @@ import JavaScriptKit public class WritableStreamDefaultWriter: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WritableStreamDefaultWriter.function! } + private enum Keys { + static let abort: JSString = "abort" + static let close: JSString = "close" + static let ready: JSString = "ready" + static let write: JSString = "write" + static let releaseLock: JSString = "releaseLock" + static let closed: JSString = "closed" + static let desiredSize: JSString = "desiredSize" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _closed = ReadonlyAttribute(jsObject: jsObject, name: "closed") - _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: "desiredSize") - _ready = ReadonlyAttribute(jsObject: jsObject, name: "ready") + _closed = ReadonlyAttribute(jsObject: jsObject, name: Keys.closed) + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Keys.desiredSize) + _ready = ReadonlyAttribute(jsObject: jsObject, name: Keys.ready) self.jsObject = jsObject } @@ -29,36 +39,36 @@ public class WritableStreamDefaultWriter: JSBridgedClass { public var ready: JSPromise public func abort(reason: JSValue? = nil) -> JSPromise { - jsObject["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject["abort"]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject["close"]!().fromJSValue()! + jsObject[Keys.close]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func close() async throws { - let _promise: JSPromise = jsObject["close"]!().fromJSValue()! + let _promise: JSPromise = jsObject[Keys.close]!().fromJSValue()! _ = try await _promise.get() } public func releaseLock() { - _ = jsObject["releaseLock"]!() + _ = jsObject[Keys.releaseLock]!() } public func write(chunk: JSValue? = nil) -> JSPromise { - jsObject["write"]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func write(chunk: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject["write"]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Keys.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/XMLDocument.swift b/Sources/DOMKit/WebIDL/XMLDocument.swift index acb045e7..848b0081 100644 --- a/Sources/DOMKit/WebIDL/XMLDocument.swift +++ b/Sources/DOMKit/WebIDL/XMLDocument.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class XMLDocument: Document { override public class var constructor: JSFunction { JSObject.global.XMLDocument.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index 39df8230..9b6adf0c 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -6,19 +6,46 @@ import JavaScriptKit public class XMLHttpRequest: XMLHttpRequestEventTarget { override public class var constructor: JSFunction { JSObject.global.XMLHttpRequest.function! } + private enum Keys { + static let LOADING: JSString = "LOADING" + static let readyState: JSString = "readyState" + static let responseXML: JSString = "responseXML" + static let UNSENT: JSString = "UNSENT" + static let open: JSString = "open" + static let abort: JSString = "abort" + static let getResponseHeader: JSString = "getResponseHeader" + static let statusText: JSString = "statusText" + static let getAllResponseHeaders: JSString = "getAllResponseHeaders" + static let withCredentials: JSString = "withCredentials" + static let responseText: JSString = "responseText" + static let setRequestHeader: JSString = "setRequestHeader" + static let upload: JSString = "upload" + static let HEADERS_RECEIVED: JSString = "HEADERS_RECEIVED" + static let responseURL: JSString = "responseURL" + static let overrideMimeType: JSString = "overrideMimeType" + static let status: JSString = "status" + static let OPENED: JSString = "OPENED" + static let send: JSString = "send" + static let onreadystatechange: JSString = "onreadystatechange" + static let response: JSString = "response" + static let timeout: JSString = "timeout" + static let DONE: JSString = "DONE" + static let responseType: JSString = "responseType" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: "onreadystatechange") - _readyState = ReadonlyAttribute(jsObject: jsObject, name: "readyState") - _timeout = ReadWriteAttribute(jsObject: jsObject, name: "timeout") - _withCredentials = ReadWriteAttribute(jsObject: jsObject, name: "withCredentials") - _upload = ReadonlyAttribute(jsObject: jsObject, name: "upload") - _responseURL = ReadonlyAttribute(jsObject: jsObject, name: "responseURL") - _status = ReadonlyAttribute(jsObject: jsObject, name: "status") - _statusText = ReadonlyAttribute(jsObject: jsObject, name: "statusText") - _responseType = ReadWriteAttribute(jsObject: jsObject, name: "responseType") - _response = ReadonlyAttribute(jsObject: jsObject, name: "response") - _responseText = ReadonlyAttribute(jsObject: jsObject, name: "responseText") - _responseXML = ReadonlyAttribute(jsObject: jsObject, name: "responseXML") + _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onreadystatechange) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) + _timeout = ReadWriteAttribute(jsObject: jsObject, name: Keys.timeout) + _withCredentials = ReadWriteAttribute(jsObject: jsObject, name: Keys.withCredentials) + _upload = ReadonlyAttribute(jsObject: jsObject, name: Keys.upload) + _responseURL = ReadonlyAttribute(jsObject: jsObject, name: Keys.responseURL) + _status = ReadonlyAttribute(jsObject: jsObject, name: Keys.status) + _statusText = ReadonlyAttribute(jsObject: jsObject, name: Keys.statusText) + _responseType = ReadWriteAttribute(jsObject: jsObject, name: Keys.responseType) + _response = ReadonlyAttribute(jsObject: jsObject, name: Keys.response) + _responseText = ReadonlyAttribute(jsObject: jsObject, name: Keys.responseText) + _responseXML = ReadonlyAttribute(jsObject: jsObject, name: Keys.responseXML) super.init(unsafelyWrapping: jsObject) } @@ -43,15 +70,15 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var readyState: UInt16 public func open(method: String, url: String) { - _ = jsObject["open"]!(method.jsValue(), url.jsValue()) + _ = jsObject[Keys.open]!(method.jsValue(), url.jsValue()) } public func open(method: String, url: String, async: Bool, username: String? = nil, password: String? = nil) { - _ = jsObject["open"]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined) + _ = jsObject[Keys.open]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined) } public func setRequestHeader(name: String, value: String) { - _ = jsObject["setRequestHeader"]!(name.jsValue(), value.jsValue()) + _ = jsObject[Keys.setRequestHeader]!(name.jsValue(), value.jsValue()) } @ReadWriteAttribute @@ -64,11 +91,11 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var upload: XMLHttpRequestUpload public func send(body: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject["send"]!(body?.jsValue() ?? .undefined) + _ = jsObject[Keys.send]!(body?.jsValue() ?? .undefined) } public func abort() { - _ = jsObject["abort"]!() + _ = jsObject[Keys.abort]!() } @ReadonlyAttribute @@ -81,15 +108,15 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var statusText: String public func getResponseHeader(name: String) -> String? { - jsObject["getResponseHeader"]!(name.jsValue()).fromJSValue()! + jsObject[Keys.getResponseHeader]!(name.jsValue()).fromJSValue()! } public func getAllResponseHeaders() -> String { - jsObject["getAllResponseHeaders"]!().fromJSValue()! + jsObject[Keys.getAllResponseHeaders]!().fromJSValue()! } public func overrideMimeType(mime: String) { - _ = jsObject["overrideMimeType"]!(mime.jsValue()) + _ = jsObject[Keys.overrideMimeType]!(mime.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift index d766e126..9ca06224 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift @@ -6,14 +6,24 @@ import JavaScriptKit public class XMLHttpRequestEventTarget: EventTarget { override public class var constructor: JSFunction { JSObject.global.XMLHttpRequestEventTarget.function! } + private enum Keys { + static let onabort: JSString = "onabort" + static let onloadend: JSString = "onloadend" + static let onload: JSString = "onload" + static let onerror: JSString = "onerror" + static let onprogress: JSString = "onprogress" + static let onloadstart: JSString = "onloadstart" + static let ontimeout: JSString = "ontimeout" + } + public required init(unsafelyWrapping jsObject: JSObject) { - _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: "onloadstart") - _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: "onprogress") - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: "onabort") - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: "onerror") - _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: "onload") - _ontimeout = ClosureAttribute.Optional1(jsObject: jsObject, name: "ontimeout") - _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: "onloadend") + _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onloadstart) + _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onprogress) + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onabort) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onerror) + _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onload) + _ontimeout = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.ontimeout) + _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onloadend) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift index c15058dc..7e5dc5a1 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift @@ -3,20 +3,24 @@ import JavaScriptEventLoop import JavaScriptKit -public enum XMLHttpRequestResponseType: String, JSValueCompatible { +public enum XMLHttpRequestResponseType: JSString, JSValueCompatible { case _empty = "" - case arraybuffer - case blob - case document - case json - case text + case arraybuffer = "arraybuffer" + case blob = "blob" + case document = "document" + case json = "json" + case text = "text" public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift index dfd38b44..b52646c6 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class XMLHttpRequestUpload: XMLHttpRequestEventTarget { override public class var constructor: JSFunction { JSObject.global.XMLHttpRequestUpload.function! } + private enum Keys {} + public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/XPathEvaluator.swift b/Sources/DOMKit/WebIDL/XPathEvaluator.swift index 98be6b9d..5136016d 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluator.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluator.swift @@ -6,6 +6,8 @@ import JavaScriptKit public class XPathEvaluator: JSBridgedClass, XPathEvaluatorBase { public class var constructor: JSFunction { JSObject.global.XPathEvaluator.function! } + private enum Keys {} + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift index 34302ee2..86a4493b 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift @@ -3,6 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit +private enum Keys { + static let createExpression: JSString = "createExpression" + static let createNSResolver: JSString = "createNSResolver" + static let evaluate: JSString = "evaluate" +} + public protocol XPathEvaluatorBase: JSBridgedClass {} public extension XPathEvaluatorBase { // XXX: method 'createExpression' is ignored diff --git a/Sources/DOMKit/WebIDL/XPathExpression.swift b/Sources/DOMKit/WebIDL/XPathExpression.swift index 59f0bde3..3f844e90 100644 --- a/Sources/DOMKit/WebIDL/XPathExpression.swift +++ b/Sources/DOMKit/WebIDL/XPathExpression.swift @@ -6,6 +6,10 @@ import JavaScriptKit public class XPathExpression: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.XPathExpression.function! } + private enum Keys { + static let evaluate: JSString = "evaluate" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -13,6 +17,6 @@ public class XPathExpression: JSBridgedClass { } public func evaluate(contextNode: Node, type: UInt16? = nil, result: XPathResult? = nil) -> XPathResult { - jsObject["evaluate"]!(contextNode.jsValue(), type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Keys.evaluate]!(contextNode.jsValue(), type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XPathResult.swift b/Sources/DOMKit/WebIDL/XPathResult.swift index 5b3776ea..3d2568f0 100644 --- a/Sources/DOMKit/WebIDL/XPathResult.swift +++ b/Sources/DOMKit/WebIDL/XPathResult.swift @@ -6,16 +6,38 @@ import JavaScriptKit public class XPathResult: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.XPathResult.function! } + private enum Keys { + static let FIRST_ORDERED_NODE_TYPE: JSString = "FIRST_ORDERED_NODE_TYPE" + static let snapshotItem: JSString = "snapshotItem" + static let UNORDERED_NODE_SNAPSHOT_TYPE: JSString = "UNORDERED_NODE_SNAPSHOT_TYPE" + static let STRING_TYPE: JSString = "STRING_TYPE" + static let ORDERED_NODE_SNAPSHOT_TYPE: JSString = "ORDERED_NODE_SNAPSHOT_TYPE" + static let invalidIteratorState: JSString = "invalidIteratorState" + static let snapshotLength: JSString = "snapshotLength" + static let iterateNext: JSString = "iterateNext" + static let UNORDERED_NODE_ITERATOR_TYPE: JSString = "UNORDERED_NODE_ITERATOR_TYPE" + static let stringValue: JSString = "stringValue" + static let NUMBER_TYPE: JSString = "NUMBER_TYPE" + static let BOOLEAN_TYPE: JSString = "BOOLEAN_TYPE" + static let resultType: JSString = "resultType" + static let ANY_UNORDERED_NODE_TYPE: JSString = "ANY_UNORDERED_NODE_TYPE" + static let booleanValue: JSString = "booleanValue" + static let singleNodeValue: JSString = "singleNodeValue" + static let numberValue: JSString = "numberValue" + static let ANY_TYPE: JSString = "ANY_TYPE" + static let ORDERED_NODE_ITERATOR_TYPE: JSString = "ORDERED_NODE_ITERATOR_TYPE" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _resultType = ReadonlyAttribute(jsObject: jsObject, name: "resultType") - _numberValue = ReadonlyAttribute(jsObject: jsObject, name: "numberValue") - _stringValue = ReadonlyAttribute(jsObject: jsObject, name: "stringValue") - _booleanValue = ReadonlyAttribute(jsObject: jsObject, name: "booleanValue") - _singleNodeValue = ReadonlyAttribute(jsObject: jsObject, name: "singleNodeValue") - _invalidIteratorState = ReadonlyAttribute(jsObject: jsObject, name: "invalidIteratorState") - _snapshotLength = ReadonlyAttribute(jsObject: jsObject, name: "snapshotLength") + _resultType = ReadonlyAttribute(jsObject: jsObject, name: Keys.resultType) + _numberValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.numberValue) + _stringValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.stringValue) + _booleanValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.booleanValue) + _singleNodeValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.singleNodeValue) + _invalidIteratorState = ReadonlyAttribute(jsObject: jsObject, name: Keys.invalidIteratorState) + _snapshotLength = ReadonlyAttribute(jsObject: jsObject, name: Keys.snapshotLength) self.jsObject = jsObject } @@ -61,10 +83,10 @@ public class XPathResult: JSBridgedClass { public var snapshotLength: UInt32 public func iterateNext() -> Node? { - jsObject["iterateNext"]!().fromJSValue()! + jsObject[Keys.iterateNext]!().fromJSValue()! } public func snapshotItem(index: UInt32) -> Node? { - jsObject["snapshotItem"]!(index.jsValue()).fromJSValue()! + jsObject[Keys.snapshotItem]!(index.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift index fe50f6c7..8a31c957 100644 --- a/Sources/DOMKit/WebIDL/XSLTProcessor.swift +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -6,6 +6,17 @@ import JavaScriptKit public class XSLTProcessor: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.XSLTProcessor.function! } + private enum Keys { + static let importStylesheet: JSString = "importStylesheet" + static let transformToFragment: JSString = "transformToFragment" + static let setParameter: JSString = "setParameter" + static let transformToDocument: JSString = "transformToDocument" + static let getParameter: JSString = "getParameter" + static let removeParameter: JSString = "removeParameter" + static let clearParameters: JSString = "clearParameters" + static let reset: JSString = "reset" + } + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,34 +28,34 @@ public class XSLTProcessor: JSBridgedClass { } public func importStylesheet(style: Node) { - _ = jsObject["importStylesheet"]!(style.jsValue()) + _ = jsObject[Keys.importStylesheet]!(style.jsValue()) } public func transformToFragment(source: Node, output: Document) -> DocumentFragment { - jsObject["transformToFragment"]!(source.jsValue(), output.jsValue()).fromJSValue()! + jsObject[Keys.transformToFragment]!(source.jsValue(), output.jsValue()).fromJSValue()! } public func transformToDocument(source: Node) -> Document { - jsObject["transformToDocument"]!(source.jsValue()).fromJSValue()! + jsObject[Keys.transformToDocument]!(source.jsValue()).fromJSValue()! } public func setParameter(namespaceURI: String, localName: String, value: JSValue) { - _ = jsObject["setParameter"]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()) + _ = jsObject[Keys.setParameter]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()) } public func getParameter(namespaceURI: String, localName: String) -> JSValue { - jsObject["getParameter"]!(namespaceURI.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Keys.getParameter]!(namespaceURI.jsValue(), localName.jsValue()).fromJSValue()! } public func removeParameter(namespaceURI: String, localName: String) { - _ = jsObject["removeParameter"]!(namespaceURI.jsValue(), localName.jsValue()) + _ = jsObject[Keys.removeParameter]!(namespaceURI.jsValue(), localName.jsValue()) } public func clearParameters() { - _ = jsObject["clearParameters"]!() + _ = jsObject[Keys.clearParameters]!() } public func reset() { - _ = jsObject["reset"]!() + _ = jsObject[Keys.reset]!() } } diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index 97b42921..989b8e73 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -4,83 +4,105 @@ import JavaScriptEventLoop import JavaScriptKit public enum console { + private enum Keys { + static let trace: JSString = "trace" + static let clear: JSString = "clear" + static let dir: JSString = "dir" + static let timeEnd: JSString = "timeEnd" + static let debug: JSString = "debug" + static let info: JSString = "info" + static let count: JSString = "count" + static let group: JSString = "group" + static let groupEnd: JSString = "groupEnd" + static let time: JSString = "time" + static let log: JSString = "log" + static let assert: JSString = "assert" + static let warn: JSString = "warn" + static let error: JSString = "error" + static let table: JSString = "table" + static let dirxml: JSString = "dirxml" + static let groupCollapsed: JSString = "groupCollapsed" + static let timeLog: JSString = "timeLog" + static let countReset: JSString = "countReset" + } + public static var jsObject: JSObject { JSObject.global.console.object! } public static func assert(condition: Bool? = nil, data: JSValue...) { - _ = JSObject.global.console.object!["assert"]!(condition?.jsValue() ?? .undefined, data.jsValue()) + _ = JSObject.global.console.object![Keys.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) } public static func clear() { - _ = JSObject.global.console.object!["clear"]!() + _ = JSObject.global.console.object![Keys.clear]!() } public static func debug(data: JSValue...) { - _ = JSObject.global.console.object!["debug"]!(data.jsValue()) + _ = JSObject.global.console.object![Keys.debug]!(data.jsValue()) } public static func error(data: JSValue...) { - _ = JSObject.global.console.object!["error"]!(data.jsValue()) + _ = JSObject.global.console.object![Keys.error]!(data.jsValue()) } public static func info(data: JSValue...) { - _ = JSObject.global.console.object!["info"]!(data.jsValue()) + _ = JSObject.global.console.object![Keys.info]!(data.jsValue()) } public static func log(data: JSValue...) { - _ = JSObject.global.console.object!["log"]!(data.jsValue()) + _ = JSObject.global.console.object![Keys.log]!(data.jsValue()) } public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { - _ = JSObject.global.console.object!["table"]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Keys.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) } public static func trace(data: JSValue...) { - _ = JSObject.global.console.object!["trace"]!(data.jsValue()) + _ = JSObject.global.console.object![Keys.trace]!(data.jsValue()) } public static func warn(data: JSValue...) { - _ = JSObject.global.console.object!["warn"]!(data.jsValue()) + _ = JSObject.global.console.object![Keys.warn]!(data.jsValue()) } public static func dir(item: JSValue? = nil, options: JSObject? = nil) { - _ = JSObject.global.console.object!["dir"]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Keys.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) } public static func dirxml(data: JSValue...) { - _ = JSObject.global.console.object!["dirxml"]!(data.jsValue()) + _ = JSObject.global.console.object![Keys.dirxml]!(data.jsValue()) } public static func count(label: String? = nil) { - _ = JSObject.global.console.object!["count"]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Keys.count]!(label?.jsValue() ?? .undefined) } public static func countReset(label: String? = nil) { - _ = JSObject.global.console.object!["countReset"]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Keys.countReset]!(label?.jsValue() ?? .undefined) } public static func group(data: JSValue...) { - _ = JSObject.global.console.object!["group"]!(data.jsValue()) + _ = JSObject.global.console.object![Keys.group]!(data.jsValue()) } public static func groupCollapsed(data: JSValue...) { - _ = JSObject.global.console.object!["groupCollapsed"]!(data.jsValue()) + _ = JSObject.global.console.object![Keys.groupCollapsed]!(data.jsValue()) } public static func groupEnd() { - _ = JSObject.global.console.object!["groupEnd"]!() + _ = JSObject.global.console.object![Keys.groupEnd]!() } public static func time(label: String? = nil) { - _ = JSObject.global.console.object!["time"]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Keys.time]!(label?.jsValue() ?? .undefined) } public static func timeLog(label: String? = nil, data: JSValue...) { - _ = JSObject.global.console.object!["timeLog"]!(label?.jsValue() ?? .undefined, data.jsValue()) + _ = JSObject.global.console.object![Keys.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) } public static func timeEnd(label: String? = nil) { - _ = JSObject.global.console.object!["timeEnd"]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Keys.timeEnd]!(label?.jsValue() ?? .undefined) } } diff --git a/Sources/WebIDLToSwift/ClosureWrappers.swift b/Sources/WebIDLToSwift/ClosureWrappers.swift index 1efde5c1..88105db5 100644 --- a/Sources/WebIDLToSwift/ClosureWrappers.swift +++ b/Sources/WebIDLToSwift/ClosureWrappers.swift @@ -65,9 +65,9 @@ struct ClosureWrapper: SwiftRepresentable, Equatable { { @usableFromInline let jsObject: JSObject - @usableFromInline let name: String + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: String) { + public init(jsObject: JSObject, name: JSString) { self.jsObject = jsObject self.name = name } @@ -77,7 +77,7 @@ struct ClosureWrapper: SwiftRepresentable, Equatable { set { \(name)[name, in: jsObject] = newValue } } - @inlinable public static subscript(name: String, in jsObject: JSObject) -> \(closureType) { + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> \(closureType) { get { \(getter) } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 23b4c2f9..55f4ffb7 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -34,12 +34,12 @@ extension IDLAttribute: SwiftRepresentable, Initializable { } else if Context.constructor == nil { // can't do property wrappers on extensions let setter: SwiftSource = """ - set { \(idlType.propertyWrapper(readonly: readonly))[\(quoted: name), in: jsObject] = newValue } + set { \(idlType.propertyWrapper(readonly: readonly))[Keys.\(name: name), in: jsObject] = newValue } """ return """ public var \(name: name): \(idlType) { - get { \(idlType.propertyWrapper(readonly: readonly))[\(quoted: name), in: jsObject] } + get { \(idlType.propertyWrapper(readonly: readonly))[Keys.\(name: name), in: jsObject] } \(readonly ? "" : setter) } """ @@ -54,15 +54,25 @@ extension IDLAttribute: SwiftRepresentable, Initializable { var initializer: SwiftSource? { assert(!Context.static) return """ - \(wrapperName) = \(idlType.propertyWrapper(readonly: readonly))(jsObject: jsObject, name: \(quoted: name)) + \(wrapperName) = \(idlType.propertyWrapper(readonly: readonly))(jsObject: jsObject, name: Keys.\(name: name)) """ } } +private func printKeys(_ keys: [IDLNamed]) -> SwiftSource { + let validKeys = Set(keys.map(\.name).filter { !$0.isEmpty }) + return """ + private enum Keys { + \(lines: validKeys.map { "static let \(name: $0): JSString = \(quoted: $0)" }) + } + """ +} + extension MergedDictionary: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ public class \(name: name): BridgedDictionary { + \(printKeys(members)) \(swiftInit) \(swiftMembers.joined(separator: "\n\n")) } @@ -85,11 +95,11 @@ extension MergedDictionary: SwiftRepresentable { \(lines: membersWithPropertyWrapper.map { member, wrapper in if member.idlType.isFunction { return """ - \(wrapper)[\(quoted: member.name), in: object] = \(name: member.name) + \(wrapper)[Keys.\(name: member.name), in: object] = \(name: member.name) """ } else { return """ - object[\(quoted: member.name)] = \(name: member.name).jsValue() + object[Keys.\(name: member.name)] = \(name: member.name).jsValue() """ } }) @@ -98,7 +108,7 @@ extension MergedDictionary: SwiftRepresentable { public required init(unsafelyWrapping object: JSObject) { \(lines: membersWithPropertyWrapper.map { member, wrapper in - "_\(raw: member.name) = \(wrapper)(jsObject: object, name: \(quoted: member.name))" + "_\(raw: member.name) = \(wrapper)(jsObject: object, name: Keys.\(name: member.name))" }) super.init(unsafelyWrapping: object) } @@ -122,12 +132,16 @@ extension IDLEnum: SwiftRepresentable { \(lines: cases.map { "case \(name: $0.camelized) = \(quoted: $0)" }) public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.string { + if let string = jsValue.jsString { return Self(rawValue: string) } return nil } + public init?(rawValue: String) { + self.init(rawValue: JSString(rawValue)) + } + public func jsValue() -> JSValue { rawValue.jsValue() } } """ @@ -187,6 +201,8 @@ extension MergedInterface: SwiftRepresentable { public class \(name: name): \(sequence: inheritance.map(SwiftSource.init(_:))) { public\(parentClasses.isEmpty ? "" : " override") class var constructor: JSFunction { \(constructor) } + \(printKeys(members.compactMap { $0 as? IDLNamed })) + \(parentClasses.isEmpty ? "public let jsObject: JSObject" : "") public required init(unsafelyWrapping jsObject: JSObject) { @@ -222,6 +238,8 @@ extension MergedMixin: SwiftRepresentable { var swiftRepresentation: SwiftSource { Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name: name)")) { """ + \(printKeys(members)) + public protocol \(name: name): JSBridgedClass {} public extension \(name: name) { \(members.map(toSwift).joined(separator: "\n\n")) @@ -291,6 +309,7 @@ extension MergedNamespace: SwiftRepresentable { } return """ public enum \(name: name) { + \(printKeys(members.compactMap { $0 as? IDLNamed })) public static var jsObject: JSObject { \(this) } @@ -316,7 +335,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { case "stringifier": return """ public var description: String { - \(Context.this)["toString"]!().fromJSValue()! + \(Context.this)[Strings.toString]!().fromJSValue()! } """ case "static": @@ -368,7 +387,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { return ( prep: "\(lines: prep)", - call: "\(Context.this)[\(quoted: name)]!(\(sequence: args))" + call: "\(Context.this)[Keys.\(name: name)]!(\(sequence: args))" ) } From f5d0edcdc7bed8c0b1580c6e7aa637afbb2dfc5e Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 1 Apr 2022 19:08:10 -0400 Subject: [PATCH 083/124] bump JSKit --- Package.resolved | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.resolved b/Package.resolved index bc767001..e49cf6b6 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { "branch": "jed/open-object", - "revision": "c03c6f9442bd023610988a819e3e830618c55cd5", + "revision": "d76f26a9e3807331c44048b0429d6ac8aba65f8a", "version": null } } From a7b625b2cab3c02e019a4e1c0d37d9809be473d0 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 1 Apr 2022 19:10:59 -0400 Subject: [PATCH 084/124] sdfasg --- Sources/DOMKit/WebIDL/ARIAMixin.swift | 56 ++++---- Sources/DOMKit/WebIDL/AbortController.swift | 4 +- Sources/DOMKit/WebIDL/AbortSignal.swift | 8 +- Sources/DOMKit/WebIDL/AbstractRange.swift | 2 +- .../WebIDL/AddEventListenerOptions.swift | 4 +- .../WebIDL/AnimationFrameProvider.swift | 6 +- Sources/DOMKit/WebIDL/Attr.swift | 8 +- Sources/DOMKit/WebIDL/AudioTrack.swift | 4 +- Sources/DOMKit/WebIDL/AudioTrackList.swift | 6 +- Sources/DOMKit/WebIDL/Blob.swift | 4 +- Sources/DOMKit/WebIDL/BlobPropertyBag.swift | 2 +- Sources/DOMKit/WebIDL/Body.swift | 8 +- Sources/DOMKit/WebIDL/BroadcastChannel.swift | 8 +- Sources/DOMKit/WebIDL/CSS.swift | 2 +- Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSImportRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSMarginRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSNamespaceRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSRule.swift | 14 +- Sources/DOMKit/WebIDL/CSSRuleList.swift | 2 +- .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 16 +-- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 18 +-- Sources/DOMKit/WebIDL/CanvasDrawImage.swift | 6 +- Sources/DOMKit/WebIDL/CanvasDrawPath.swift | 22 +-- .../WebIDL/CanvasFillStrokeStyles.swift | 6 +- Sources/DOMKit/WebIDL/CanvasGradient.swift | 2 +- Sources/DOMKit/WebIDL/CanvasImageData.swift | 6 +- Sources/DOMKit/WebIDL/CanvasPath.swift | 30 ++-- .../WebIDL/CanvasPathDrawingStyles.swift | 8 +- Sources/DOMKit/WebIDL/CanvasPattern.swift | 2 +- Sources/DOMKit/WebIDL/CanvasRect.swift | 8 +- .../CanvasRenderingContext2DSettings.swift | 2 +- .../DOMKit/WebIDL/CanvasShadowStyles.swift | 4 +- Sources/DOMKit/WebIDL/CanvasState.swift | 8 +- Sources/DOMKit/WebIDL/CanvasText.swift | 6 +- .../WebIDL/CanvasTextDrawingStyles.swift | 10 +- Sources/DOMKit/WebIDL/CanvasTransform.swift | 20 +-- .../DOMKit/WebIDL/CanvasUserInterface.swift | 8 +- Sources/DOMKit/WebIDL/CharacterData.swift | 14 +- Sources/DOMKit/WebIDL/ChildNode.swift | 12 +- Sources/DOMKit/WebIDL/CompositionEvent.swift | 2 +- .../DOMKit/WebIDL/CustomElementRegistry.swift | 8 +- Sources/DOMKit/WebIDL/CustomEvent.swift | 2 +- Sources/DOMKit/WebIDL/DOMException.swift | 44 +++--- Sources/DOMKit/WebIDL/DOMImplementation.swift | 4 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 60 ++++---- Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift | 14 +- Sources/DOMKit/WebIDL/DOMMatrixInit.swift | 12 +- Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 66 ++++----- Sources/DOMKit/WebIDL/DOMPoint.swift | 8 +- Sources/DOMKit/WebIDL/DOMPointInit.swift | 4 +- Sources/DOMKit/WebIDL/DOMPointReadOnly.swift | 6 +- Sources/DOMKit/WebIDL/DOMQuad.swift | 8 +- Sources/DOMKit/WebIDL/DOMQuadInit.swift | 4 +- Sources/DOMKit/WebIDL/DOMRect.swift | 6 +- Sources/DOMKit/WebIDL/DOMRectInit.swift | 4 +- Sources/DOMKit/WebIDL/DOMRectList.swift | 4 +- Sources/DOMKit/WebIDL/DOMRectReadOnly.swift | 12 +- Sources/DOMKit/WebIDL/DOMStringList.swift | 4 +- Sources/DOMKit/WebIDL/DOMStringMap.swift | 4 +- Sources/DOMKit/WebIDL/DOMTokenList.swift | 18 +-- Sources/DOMKit/WebIDL/DataTransfer.swift | 16 +-- Sources/DOMKit/WebIDL/DataTransferItem.swift | 4 +- .../DOMKit/WebIDL/DataTransferItemList.swift | 12 +- .../WebIDL/DedicatedWorkerGlobalScope.swift | 12 +- Sources/DOMKit/WebIDL/Document.swift | 134 +++++++++--------- .../DocumentAndElementEventHandlers.swift | 2 +- Sources/DOMKit/WebIDL/Element.swift | 60 ++++---- .../WebIDL/ElementContentEditable.swift | 4 +- Sources/DOMKit/WebIDL/ElementInternals.swift | 18 +-- Sources/DOMKit/WebIDL/ErrorEvent.swift | 6 +- Sources/DOMKit/WebIDL/ErrorEventInit.swift | 6 +- Sources/DOMKit/WebIDL/Event.swift | 40 +++--- Sources/DOMKit/WebIDL/EventModifierInit.swift | 18 +-- Sources/DOMKit/WebIDL/EventSource.swift | 16 +-- Sources/DOMKit/WebIDL/EventTarget.swift | 2 +- Sources/DOMKit/WebIDL/External.swift | 6 +- Sources/DOMKit/WebIDL/FileList.swift | 2 +- Sources/DOMKit/WebIDL/FileReader.swift | 30 ++-- Sources/DOMKit/WebIDL/FileReaderSync.swift | 4 +- Sources/DOMKit/WebIDL/FormData.swift | 16 +-- .../DOMKit/WebIDL/GlobalEventHandlers.swift | 110 +++++++------- Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 4 +- Sources/DOMKit/WebIDL/HTMLAnchorElement.swift | 16 +-- Sources/DOMKit/WebIDL/HTMLAreaElement.swift | 10 +- Sources/DOMKit/WebIDL/HTMLBodyElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 26 ++-- Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLCollection.swift | 4 +- Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 12 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 22 +-- Sources/DOMKit/WebIDL/HTMLEmbedElement.swift | 10 +- .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 14 +- Sources/DOMKit/WebIDL/HTMLFontElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFormElement.swift | 34 ++--- Sources/DOMKit/WebIDL/HTMLFrameElement.swift | 10 +- Sources/DOMKit/WebIDL/HTMLHRElement.swift | 6 +- .../WebIDL/HTMLHyperlinkElementUtils.swift | 12 +- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 22 +-- Sources/DOMKit/WebIDL/HTMLImageElement.swift | 36 ++--- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 98 ++++++------- Sources/DOMKit/WebIDL/HTMLLabelElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLLinkElement.swift | 24 ++-- .../DOMKit/WebIDL/HTMLMarqueeElement.swift | 18 +-- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 74 +++++----- Sources/DOMKit/WebIDL/HTMLMetaElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLMeterElement.swift | 10 +- Sources/DOMKit/WebIDL/HTMLModElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLOListElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 38 ++--- .../DOMKit/WebIDL/HTMLOptGroupElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLOptionElement.swift | 10 +- .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 10 +- Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift | 12 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 16 +-- Sources/DOMKit/WebIDL/HTMLParamElement.swift | 4 +- .../DOMKit/WebIDL/HTMLProgressElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 18 +-- Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 46 +++--- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLSourceElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLStyleElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTableCellElement.swift | 20 +-- .../DOMKit/WebIDL/HTMLTableColElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLTableElement.swift | 40 +++--- .../DOMKit/WebIDL/HTMLTableRowElement.swift | 16 +-- .../WebIDL/HTMLTableSectionElement.swift | 10 +- .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 54 +++---- Sources/DOMKit/WebIDL/HTMLTrackElement.swift | 12 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 6 +- Sources/DOMKit/WebIDL/HashChangeEvent.swift | 2 +- .../DOMKit/WebIDL/HashChangeEventInit.swift | 2 +- Sources/DOMKit/WebIDL/Headers.swift | 10 +- Sources/DOMKit/WebIDL/History.swift | 18 +-- Sources/DOMKit/WebIDL/ImageBitmap.swift | 4 +- .../DOMKit/WebIDL/ImageBitmapOptions.swift | 4 +- .../WebIDL/ImageBitmapRenderingContext.swift | 4 +- Sources/DOMKit/WebIDL/ImageData.swift | 2 +- Sources/DOMKit/WebIDL/InputEvent.swift | 2 +- Sources/DOMKit/WebIDL/InputEventInit.swift | 2 +- Sources/DOMKit/WebIDL/KeyboardEvent.swift | 22 +-- Sources/DOMKit/WebIDL/KeyboardEventInit.swift | 8 +- Sources/DOMKit/WebIDL/Location.swift | 22 +-- Sources/DOMKit/WebIDL/MediaError.swift | 6 +- Sources/DOMKit/WebIDL/MediaList.swift | 8 +- Sources/DOMKit/WebIDL/MessageChannel.swift | 2 +- Sources/DOMKit/WebIDL/MessageEvent.swift | 8 +- Sources/DOMKit/WebIDL/MessageEventInit.swift | 2 +- Sources/DOMKit/WebIDL/MessagePort.swift | 12 +- Sources/DOMKit/WebIDL/MimeType.swift | 4 +- Sources/DOMKit/WebIDL/MimeTypeArray.swift | 2 +- Sources/DOMKit/WebIDL/MouseEvent.swift | 16 +-- Sources/DOMKit/WebIDL/MouseEventInit.swift | 8 +- Sources/DOMKit/WebIDL/MutationEvent.swift | 12 +- Sources/DOMKit/WebIDL/MutationObserver.swift | 10 +- .../DOMKit/WebIDL/MutationObserverInit.swift | 8 +- Sources/DOMKit/WebIDL/MutationRecord.swift | 12 +- Sources/DOMKit/WebIDL/NamedNodeMap.swift | 12 +- .../DOMKit/WebIDL/NavigatorContentUtils.swift | 6 +- Sources/DOMKit/WebIDL/NavigatorID.swift | 12 +- Sources/DOMKit/WebIDL/NavigatorPlugins.swift | 4 +- Sources/DOMKit/WebIDL/Node.swift | 76 +++++----- Sources/DOMKit/WebIDL/NodeIterator.swift | 12 +- Sources/DOMKit/WebIDL/NodeList.swift | 2 +- Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 8 +- .../OffscreenCanvasRenderingContext2D.swift | 2 +- Sources/DOMKit/WebIDL/ParentNode.swift | 18 +-- Sources/DOMKit/WebIDL/Path2D.swift | 2 +- Sources/DOMKit/WebIDL/Performance.swift | 2 +- Sources/DOMKit/WebIDL/Plugin.swift | 6 +- Sources/DOMKit/WebIDL/PluginArray.swift | 8 +- Sources/DOMKit/WebIDL/ProgressEvent.swift | 2 +- Sources/DOMKit/WebIDL/ProgressEventInit.swift | 2 +- Sources/DOMKit/WebIDL/Range.swift | 64 ++++----- .../WebIDL/ReadableByteStreamController.swift | 10 +- Sources/DOMKit/WebIDL/ReadableStream.swift | 10 +- .../WebIDL/ReadableStreamBYOBReadResult.swift | 2 +- .../WebIDL/ReadableStreamBYOBReader.swift | 4 +- .../WebIDL/ReadableStreamBYOBRequest.swift | 4 +- .../ReadableStreamDefaultController.swift | 8 +- .../ReadableStreamDefaultReadResult.swift | 2 +- .../WebIDL/ReadableStreamDefaultReader.swift | 4 +- .../WebIDL/ReadableStreamGenericReader.swift | 2 +- Sources/DOMKit/WebIDL/Request.swift | 20 +-- Sources/DOMKit/WebIDL/RequestInit.swift | 14 +- Sources/DOMKit/WebIDL/Response.swift | 12 +- Sources/DOMKit/WebIDL/ShadowRoot.swift | 4 +- Sources/DOMKit/WebIDL/ShadowRootInit.swift | 2 +- .../WebIDL/SharedWorkerGlobalScope.swift | 6 +- Sources/DOMKit/WebIDL/StaticRangeInit.swift | 2 +- Sources/DOMKit/WebIDL/Storage.swift | 10 +- Sources/DOMKit/WebIDL/StorageEvent.swift | 8 +- Sources/DOMKit/WebIDL/StorageEventInit.swift | 4 +- Sources/DOMKit/WebIDL/StreamPipeOptions.swift | 4 +- Sources/DOMKit/WebIDL/StyleSheet.swift | 6 +- Sources/DOMKit/WebIDL/StyleSheetList.swift | 2 +- Sources/DOMKit/WebIDL/Text.swift | 2 +- Sources/DOMKit/WebIDL/TextMetrics.swift | 12 +- Sources/DOMKit/WebIDL/TextTrack.swift | 18 +-- Sources/DOMKit/WebIDL/TextTrackCue.swift | 8 +- Sources/DOMKit/WebIDL/TextTrackCueList.swift | 2 +- Sources/DOMKit/WebIDL/TextTrackList.swift | 8 +- Sources/DOMKit/WebIDL/TimeRanges.swift | 4 +- .../TransformStreamDefaultController.swift | 8 +- Sources/DOMKit/WebIDL/Transformer.swift | 6 +- Sources/DOMKit/WebIDL/TreeWalker.swift | 12 +- Sources/DOMKit/WebIDL/UIEvent.swift | 6 +- Sources/DOMKit/WebIDL/UIEventInit.swift | 4 +- Sources/DOMKit/WebIDL/URL.swift | 4 +- Sources/DOMKit/WebIDL/UnderlyingSink.swift | 4 +- Sources/DOMKit/WebIDL/UnderlyingSource.swift | 4 +- Sources/DOMKit/WebIDL/ValidityState.swift | 14 +- .../DOMKit/WebIDL/ValidityStateFlags.swift | 8 +- Sources/DOMKit/WebIDL/VideoTrack.swift | 6 +- Sources/DOMKit/WebIDL/VideoTrackList.swift | 8 +- Sources/DOMKit/WebIDL/WheelEvent.swift | 8 +- Sources/DOMKit/WebIDL/WheelEventInit.swift | 2 +- Sources/DOMKit/WebIDL/Window.swift | 82 +++++------ .../DOMKit/WebIDL/WindowEventHandlers.swift | 14 +- .../WebIDL/WindowOrWorkerGlobalScope.swift | 32 +++-- Sources/DOMKit/WebIDL/Worker.swift | 10 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 12 +- Sources/DOMKit/WebIDL/WorkerLocation.swift | 10 +- Sources/DOMKit/WebIDL/WorkerOptions.swift | 2 +- Sources/DOMKit/WebIDL/Worklet.swift | 2 +- Sources/DOMKit/WebIDL/WritableStream.swift | 8 +- .../WritableStreamDefaultController.swift | 2 +- .../WebIDL/WritableStreamDefaultWriter.swift | 14 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 44 +++--- .../WebIDL/XMLHttpRequestEventTarget.swift | 6 +- .../DOMKit/WebIDL/XPathEvaluatorBase.swift | 12 +- Sources/DOMKit/WebIDL/XPathResult.swift | 26 ++-- Sources/DOMKit/WebIDL/XSLTProcessor.swift | 20 +-- Sources/DOMKit/WebIDL/console.swift | 62 ++++---- .../WebIDL+SwiftRepresentation.swift | 2 +- 235 files changed, 1548 insertions(+), 1536 deletions(-) diff --git a/Sources/DOMKit/WebIDL/ARIAMixin.swift b/Sources/DOMKit/WebIDL/ARIAMixin.swift index c56970cb..d84a755f 100644 --- a/Sources/DOMKit/WebIDL/ARIAMixin.swift +++ b/Sources/DOMKit/WebIDL/ARIAMixin.swift @@ -4,47 +4,47 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let ariaRowCount: JSString = "ariaRowCount" - static let ariaRowIndexText: JSString = "ariaRowIndexText" - static let ariaChecked: JSString = "ariaChecked" - static let ariaValueMin: JSString = "ariaValueMin" - static let ariaHidden: JSString = "ariaHidden" - static let ariaModal: JSString = "ariaModal" + static let ariaAtomic: JSString = "ariaAtomic" static let ariaAutoComplete: JSString = "ariaAutoComplete" - static let ariaExpanded: JSString = "ariaExpanded" - static let ariaLabel: JSString = "ariaLabel" - static let ariaLevel: JSString = "ariaLevel" - static let ariaPosInSet: JSString = "ariaPosInSet" - static let ariaOrientation: JSString = "ariaOrientation" - static let role: JSString = "role" - static let ariaRequired: JSString = "ariaRequired" static let ariaBusy: JSString = "ariaBusy" - static let ariaRoleDescription: JSString = "ariaRoleDescription" + static let ariaChecked: JSString = "ariaChecked" + static let ariaColCount: JSString = "ariaColCount" + static let ariaColIndex: JSString = "ariaColIndex" + static let ariaColIndexText: JSString = "ariaColIndexText" static let ariaColSpan: JSString = "ariaColSpan" + static let ariaCurrent: JSString = "ariaCurrent" static let ariaDescription: JSString = "ariaDescription" static let ariaDisabled: JSString = "ariaDisabled" + static let ariaExpanded: JSString = "ariaExpanded" + static let ariaHasPopup: JSString = "ariaHasPopup" + static let ariaHidden: JSString = "ariaHidden" + static let ariaInvalid: JSString = "ariaInvalid" + static let ariaKeyShortcuts: JSString = "ariaKeyShortcuts" + static let ariaLabel: JSString = "ariaLabel" + static let ariaLevel: JSString = "ariaLevel" + static let ariaLive: JSString = "ariaLive" + static let ariaModal: JSString = "ariaModal" + static let ariaMultiLine: JSString = "ariaMultiLine" static let ariaMultiSelectable: JSString = "ariaMultiSelectable" + static let ariaOrientation: JSString = "ariaOrientation" static let ariaPlaceholder: JSString = "ariaPlaceholder" - static let ariaAtomic: JSString = "ariaAtomic" - static let ariaColIndexText: JSString = "ariaColIndexText" - static let ariaMultiLine: JSString = "ariaMultiLine" - static let ariaInvalid: JSString = "ariaInvalid" + static let ariaPosInSet: JSString = "ariaPosInSet" + static let ariaPressed: JSString = "ariaPressed" static let ariaReadOnly: JSString = "ariaReadOnly" - static let ariaHasPopup: JSString = "ariaHasPopup" + static let ariaRequired: JSString = "ariaRequired" + static let ariaRoleDescription: JSString = "ariaRoleDescription" + static let ariaRowCount: JSString = "ariaRowCount" + static let ariaRowIndex: JSString = "ariaRowIndex" + static let ariaRowIndexText: JSString = "ariaRowIndexText" + static let ariaRowSpan: JSString = "ariaRowSpan" static let ariaSelected: JSString = "ariaSelected" + static let ariaSetSize: JSString = "ariaSetSize" static let ariaSort: JSString = "ariaSort" - static let ariaRowSpan: JSString = "ariaRowSpan" static let ariaValueMax: JSString = "ariaValueMax" + static let ariaValueMin: JSString = "ariaValueMin" static let ariaValueNow: JSString = "ariaValueNow" - static let ariaColCount: JSString = "ariaColCount" - static let ariaPressed: JSString = "ariaPressed" static let ariaValueText: JSString = "ariaValueText" - static let ariaRowIndex: JSString = "ariaRowIndex" - static let ariaCurrent: JSString = "ariaCurrent" - static let ariaLive: JSString = "ariaLive" - static let ariaColIndex: JSString = "ariaColIndex" - static let ariaKeyShortcuts: JSString = "ariaKeyShortcuts" - static let ariaSetSize: JSString = "ariaSetSize" + static let role: JSString = "role" } public protocol ARIAMixin: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index 77c3ccc3..dff87454 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -7,8 +7,8 @@ public class AbortController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.AbortController.function! } private enum Keys { - static let signal: JSString = "signal" static let abort: JSString = "abort" + static let signal: JSString = "signal" } public let jsObject: JSObject @@ -26,6 +26,6 @@ public class AbortController: JSBridgedClass { public var signal: AbortSignal public func abort(reason: JSValue? = nil) { - _ = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined) + jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index e2c62aca..b29ba214 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -7,12 +7,12 @@ public class AbortSignal: EventTarget { override public class var constructor: JSFunction { JSObject.global.AbortSignal.function! } private enum Keys { - static let throwIfAborted: JSString = "throwIfAborted" - static let reason: JSString = "reason" + static let abort: JSString = "abort" static let aborted: JSString = "aborted" static let onabort: JSString = "onabort" + static let reason: JSString = "reason" + static let throwIfAborted: JSString = "throwIfAborted" static let timeout: JSString = "timeout" - static let abort: JSString = "abort" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -37,7 +37,7 @@ public class AbortSignal: EventTarget { public var reason: JSValue public func throwIfAborted() { - _ = jsObject[Keys.throwIfAborted]!() + jsObject[Keys.throwIfAborted]!().fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/AbstractRange.swift b/Sources/DOMKit/WebIDL/AbstractRange.swift index 99ca4494..5173886f 100644 --- a/Sources/DOMKit/WebIDL/AbstractRange.swift +++ b/Sources/DOMKit/WebIDL/AbstractRange.swift @@ -7,10 +7,10 @@ public class AbstractRange: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.AbstractRange.function! } private enum Keys { - static let startContainer: JSString = "startContainer" static let collapsed: JSString = "collapsed" static let endContainer: JSString = "endContainer" static let endOffset: JSString = "endOffset" + static let startContainer: JSString = "startContainer" static let startOffset: JSString = "startOffset" } diff --git a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift index a32a10d9..67347200 100644 --- a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift @@ -5,9 +5,9 @@ import JavaScriptKit public class AddEventListenerOptions: BridgedDictionary { private enum Keys { - static let signal: JSString = "signal" - static let passive: JSString = "passive" static let once: JSString = "once" + static let passive: JSString = "passive" + static let signal: JSString = "signal" } public convenience init(passive: Bool, once: Bool, signal: AbortSignal) { diff --git a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift index bd802aa2..d52774be 100644 --- a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift +++ b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift @@ -10,9 +10,11 @@ private enum Keys { public protocol AnimationFrameProvider: JSBridgedClass {} public extension AnimationFrameProvider { - // XXX: method 'requestAnimationFrame' is ignored + func requestAnimationFrame(callback: FrameRequestCallback) -> UInt32 { + jsObject[Keys.requestAnimationFrame]!(callback.jsValue()).fromJSValue()! + } func cancelAnimationFrame(handle: UInt32) { - _ = jsObject[Keys.cancelAnimationFrame]!(handle.jsValue()) + jsObject[Keys.cancelAnimationFrame]!(handle.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Attr.swift b/Sources/DOMKit/WebIDL/Attr.swift index b5fe010a..909aa650 100644 --- a/Sources/DOMKit/WebIDL/Attr.swift +++ b/Sources/DOMKit/WebIDL/Attr.swift @@ -7,13 +7,13 @@ public class Attr: Node { override public class var constructor: JSFunction { JSObject.global.Attr.function! } private enum Keys { - static let specified: JSString = "specified" - static let ownerElement: JSString = "ownerElement" - static let prefix: JSString = "prefix" static let localName: JSString = "localName" + static let name: JSString = "name" static let namespaceURI: JSString = "namespaceURI" + static let ownerElement: JSString = "ownerElement" + static let prefix: JSString = "prefix" + static let specified: JSString = "specified" static let value: JSString = "value" - static let name: JSString = "name" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/AudioTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack.swift index fd56fa86..85de483b 100644 --- a/Sources/DOMKit/WebIDL/AudioTrack.swift +++ b/Sources/DOMKit/WebIDL/AudioTrack.swift @@ -8,10 +8,10 @@ public class AudioTrack: JSBridgedClass { private enum Keys { static let enabled: JSString = "enabled" - static let kind: JSString = "kind" static let id: JSString = "id" - static let language: JSString = "language" + static let kind: JSString = "kind" static let label: JSString = "label" + static let language: JSString = "language" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift index 22c1b7ac..f15bc7a6 100644 --- a/Sources/DOMKit/WebIDL/AudioTrackList.swift +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -7,11 +7,11 @@ public class AudioTrackList: EventTarget { override public class var constructor: JSFunction { JSObject.global.AudioTrackList.function! } private enum Keys { - static let onaddtrack: JSString = "onaddtrack" - static let onremovetrack: JSString = "onremovetrack" static let getTrackById: JSString = "getTrackById" static let length: JSString = "length" + static let onaddtrack: JSString = "onaddtrack" static let onchange: JSString = "onchange" + static let onremovetrack: JSString = "onremovetrack" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -25,7 +25,7 @@ public class AudioTrackList: EventTarget { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> AudioTrack { + public subscript(key: UInt32) -> AudioTrack { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index 55d14ea2..2caed282 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -7,10 +7,10 @@ public class Blob: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Blob.function! } private enum Keys { - static let slice: JSString = "slice" + static let arrayBuffer: JSString = "arrayBuffer" static let size: JSString = "size" + static let slice: JSString = "slice" static let stream: JSString = "stream" - static let arrayBuffer: JSString = "arrayBuffer" static let text: JSString = "text" static let type: JSString = "type" } diff --git a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift index 25ce4704..5f679911 100644 --- a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift +++ b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift @@ -5,8 +5,8 @@ import JavaScriptKit public class BlobPropertyBag: BridgedDictionary { private enum Keys { - static let type: JSString = "type" static let endings: JSString = "endings" + static let type: JSString = "type" } public convenience init(type: String, endings: EndingType) { diff --git a/Sources/DOMKit/WebIDL/Body.swift b/Sources/DOMKit/WebIDL/Body.swift index 30f51b85..6fffda0a 100644 --- a/Sources/DOMKit/WebIDL/Body.swift +++ b/Sources/DOMKit/WebIDL/Body.swift @@ -4,12 +4,12 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let body: JSString = "body" - static let json: JSString = "json" static let arrayBuffer: JSString = "arrayBuffer" - static let formData: JSString = "formData" - static let bodyUsed: JSString = "bodyUsed" static let blob: JSString = "blob" + static let body: JSString = "body" + static let bodyUsed: JSString = "bodyUsed" + static let formData: JSString = "formData" + static let json: JSString = "json" static let text: JSString = "text" } diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index 4fe5ca9b..fe5a023d 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -7,11 +7,11 @@ public class BroadcastChannel: EventTarget { override public class var constructor: JSFunction { JSObject.global.BroadcastChannel.function! } private enum Keys { - static let postMessage: JSString = "postMessage" - static let name: JSString = "name" static let close: JSString = "close" + static let name: JSString = "name" static let onmessage: JSString = "onmessage" static let onmessageerror: JSString = "onmessageerror" + static let postMessage: JSString = "postMessage" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -29,11 +29,11 @@ public class BroadcastChannel: EventTarget { public var name: String public func postMessage(message: JSValue) { - _ = jsObject[Keys.postMessage]!(message.jsValue()) + jsObject[Keys.postMessage]!(message.jsValue()).fromJSValue()! } public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index 4858f4d6..f11dcd8e 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -5,8 +5,8 @@ import JavaScriptKit public enum CSS { private enum Keys { - static let supports: JSString = "supports" static let escape: JSString = "escape" + static let supports: JSString = "supports" } public static var jsObject: JSObject { diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift index 4a0d2013..dd857bbe 100644 --- a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift @@ -25,6 +25,6 @@ public class CSSGroupingRule: CSSRule { } public func deleteRule(index: UInt32) { - _ = jsObject[Keys.deleteRule]!(index.jsValue()) + jsObject[Keys.deleteRule]!(index.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSImportRule.swift b/Sources/DOMKit/WebIDL/CSSImportRule.swift index 7807835b..a259d64d 100644 --- a/Sources/DOMKit/WebIDL/CSSImportRule.swift +++ b/Sources/DOMKit/WebIDL/CSSImportRule.swift @@ -7,8 +7,8 @@ public class CSSImportRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSImportRule.function! } private enum Keys { - static let media: JSString = "media" static let href: JSString = "href" + static let media: JSString = "media" static let styleSheet: JSString = "styleSheet" } diff --git a/Sources/DOMKit/WebIDL/CSSMarginRule.swift b/Sources/DOMKit/WebIDL/CSSMarginRule.swift index 768c4be1..0aa6f7ed 100644 --- a/Sources/DOMKit/WebIDL/CSSMarginRule.swift +++ b/Sources/DOMKit/WebIDL/CSSMarginRule.swift @@ -7,8 +7,8 @@ public class CSSMarginRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSMarginRule.function! } private enum Keys { - static let style: JSString = "style" static let name: JSString = "name" + static let style: JSString = "style" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift index 5b394e7f..3648af52 100644 --- a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift +++ b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift @@ -7,8 +7,8 @@ public class CSSNamespaceRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSNamespaceRule.function! } private enum Keys { - static let prefix: JSString = "prefix" static let namespaceURI: JSString = "namespaceURI" + static let prefix: JSString = "prefix" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift index c828ed87..90752262 100644 --- a/Sources/DOMKit/WebIDL/CSSRule.swift +++ b/Sources/DOMKit/WebIDL/CSSRule.swift @@ -7,19 +7,19 @@ public class CSSRule: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CSSRule.function! } private enum Keys { - static let SUPPORTS_RULE: JSString = "SUPPORTS_RULE" + static let CHARSET_RULE: JSString = "CHARSET_RULE" + static let FONT_FACE_RULE: JSString = "FONT_FACE_RULE" + static let IMPORT_RULE: JSString = "IMPORT_RULE" + static let MARGIN_RULE: JSString = "MARGIN_RULE" + static let MEDIA_RULE: JSString = "MEDIA_RULE" static let NAMESPACE_RULE: JSString = "NAMESPACE_RULE" static let PAGE_RULE: JSString = "PAGE_RULE" - static let MEDIA_RULE: JSString = "MEDIA_RULE" static let STYLE_RULE: JSString = "STYLE_RULE" - static let FONT_FACE_RULE: JSString = "FONT_FACE_RULE" + static let SUPPORTS_RULE: JSString = "SUPPORTS_RULE" + static let cssText: JSString = "cssText" static let parentRule: JSString = "parentRule" static let parentStyleSheet: JSString = "parentStyleSheet" - static let CHARSET_RULE: JSString = "CHARSET_RULE" - static let cssText: JSString = "cssText" static let type: JSString = "type" - static let IMPORT_RULE: JSString = "IMPORT_RULE" - static let MARGIN_RULE: JSString = "MARGIN_RULE" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CSSRuleList.swift b/Sources/DOMKit/WebIDL/CSSRuleList.swift index 47fe6c99..b45e18af 100644 --- a/Sources/DOMKit/WebIDL/CSSRuleList.swift +++ b/Sources/DOMKit/WebIDL/CSSRuleList.swift @@ -18,7 +18,7 @@ public class CSSRuleList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: Int) -> CSSRule? { + public subscript(key: UInt32) -> CSSRule? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift index b920b850..feac7812 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift @@ -7,15 +7,15 @@ public class CSSStyleDeclaration: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CSSStyleDeclaration.function! } private enum Keys { - static let length: JSString = "length" + static let cssFloat: JSString = "cssFloat" + static let cssText: JSString = "cssText" static let getPropertyPriority: JSString = "getPropertyPriority" - static let parentRule: JSString = "parentRule" - static let item: JSString = "item" static let getPropertyValue: JSString = "getPropertyValue" - static let setProperty: JSString = "setProperty" + static let item: JSString = "item" + static let length: JSString = "length" + static let parentRule: JSString = "parentRule" static let removeProperty: JSString = "removeProperty" - static let cssFloat: JSString = "cssFloat" - static let cssText: JSString = "cssText" + static let setProperty: JSString = "setProperty" } public let jsObject: JSObject @@ -34,7 +34,7 @@ public class CSSStyleDeclaration: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> String { + public subscript(key: UInt32) -> String { jsObject[key].fromJSValue()! } @@ -47,7 +47,7 @@ public class CSSStyleDeclaration: JSBridgedClass { } public func setProperty(property: String, value: String, priority: String? = nil) { - _ = jsObject[Keys.setProperty]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined) + jsObject[Keys.setProperty]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined).fromJSValue()! } public func removeProperty(property: String) -> String { diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift index b9af9aaf..c77632c5 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -7,15 +7,15 @@ public class CSSStyleSheet: StyleSheet { override public class var constructor: JSFunction { JSObject.global.CSSStyleSheet.function! } private enum Keys { - static let removeRule: JSString = "removeRule" - static let insertRule: JSString = "insertRule" - static let rules: JSString = "rules" - static let cssRules: JSString = "cssRules" static let addRule: JSString = "addRule" - static let replaceSync: JSString = "replaceSync" + static let cssRules: JSString = "cssRules" + static let deleteRule: JSString = "deleteRule" + static let insertRule: JSString = "insertRule" static let ownerRule: JSString = "ownerRule" + static let removeRule: JSString = "removeRule" static let replace: JSString = "replace" - static let deleteRule: JSString = "deleteRule" + static let replaceSync: JSString = "replaceSync" + static let rules: JSString = "rules" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -40,7 +40,7 @@ public class CSSStyleSheet: StyleSheet { } public func deleteRule(index: UInt32) { - _ = jsObject[Keys.deleteRule]!(index.jsValue()) + jsObject[Keys.deleteRule]!(index.jsValue()).fromJSValue()! } public func replace(text: String) -> JSPromise { @@ -54,7 +54,7 @@ public class CSSStyleSheet: StyleSheet { } public func replaceSync(text: String) { - _ = jsObject[Keys.replaceSync]!(text.jsValue()) + jsObject[Keys.replaceSync]!(text.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -65,6 +65,6 @@ public class CSSStyleSheet: StyleSheet { } public func removeRule(index: UInt32? = nil) { - _ = jsObject[Keys.removeRule]!(index?.jsValue() ?? .undefined) + jsObject[Keys.removeRule]!(index?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift index cbf4719a..456fbcb6 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift @@ -10,11 +10,11 @@ private enum Keys { public protocol CanvasDrawImage: JSBridgedClass {} public extension CanvasDrawImage { func drawImage(image: CanvasImageSource, dx: Double, dy: Double) { - _ = jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue()) + jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue()).fromJSValue()! } func drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double) { - _ = jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()) + jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()).fromJSValue()! } func drawImage(image: CanvasImageSource, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { @@ -27,6 +27,6 @@ public extension CanvasDrawImage { let _arg6 = dy.jsValue() let _arg7 = dw.jsValue() let _arg8 = dh.jsValue() - _ = jsObject[Keys.drawImage]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + return jsObject[Keys.drawImage]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift index 1cb13eeb..4c104932 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift @@ -4,42 +4,42 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let stroke: JSString = "stroke" - static let isPointInPath: JSString = "isPointInPath" - static let fill: JSString = "fill" - static let isPointInStroke: JSString = "isPointInStroke" static let beginPath: JSString = "beginPath" static let clip: JSString = "clip" + static let fill: JSString = "fill" + static let isPointInPath: JSString = "isPointInPath" + static let isPointInStroke: JSString = "isPointInStroke" + static let stroke: JSString = "stroke" } public protocol CanvasDrawPath: JSBridgedClass {} public extension CanvasDrawPath { func beginPath() { - _ = jsObject[Keys.beginPath]!() + jsObject[Keys.beginPath]!().fromJSValue()! } func fill(fillRule: CanvasFillRule? = nil) { - _ = jsObject[Keys.fill]!(fillRule?.jsValue() ?? .undefined) + jsObject[Keys.fill]!(fillRule?.jsValue() ?? .undefined).fromJSValue()! } func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { - _ = jsObject[Keys.fill]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + jsObject[Keys.fill]!(path.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! } func stroke() { - _ = jsObject[Keys.stroke]!() + jsObject[Keys.stroke]!().fromJSValue()! } func stroke(path: Path2D) { - _ = jsObject[Keys.stroke]!(path.jsValue()) + jsObject[Keys.stroke]!(path.jsValue()).fromJSValue()! } func clip(fillRule: CanvasFillRule? = nil) { - _ = jsObject[Keys.clip]!(fillRule?.jsValue() ?? .undefined) + jsObject[Keys.clip]!(fillRule?.jsValue() ?? .undefined).fromJSValue()! } func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { - _ = jsObject[Keys.clip]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + jsObject[Keys.clip]!(path.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! } func isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { diff --git a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift index cb0e3deb..3efa41a0 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift @@ -4,12 +4,12 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let strokeStyle: JSString = "strokeStyle" static let createConicGradient: JSString = "createConicGradient" - static let fillStyle: JSString = "fillStyle" + static let createLinearGradient: JSString = "createLinearGradient" static let createPattern: JSString = "createPattern" static let createRadialGradient: JSString = "createRadialGradient" - static let createLinearGradient: JSString = "createLinearGradient" + static let fillStyle: JSString = "fillStyle" + static let strokeStyle: JSString = "strokeStyle" } public protocol CanvasFillStrokeStyles: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/CanvasGradient.swift b/Sources/DOMKit/WebIDL/CanvasGradient.swift index f8d39af1..f3c555b0 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient.swift @@ -17,6 +17,6 @@ public class CanvasGradient: JSBridgedClass { } public func addColorStop(offset: Double, color: String) { - _ = jsObject[Keys.addColorStop]!(offset.jsValue(), color.jsValue()) + jsObject[Keys.addColorStop]!(offset.jsValue(), color.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasImageData.swift b/Sources/DOMKit/WebIDL/CanvasImageData.swift index 563109cb..ae4f07bd 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageData.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageData.swift @@ -4,9 +4,9 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let putImageData: JSString = "putImageData" static let createImageData: JSString = "createImageData" static let getImageData: JSString = "getImageData" + static let putImageData: JSString = "putImageData" } public protocol CanvasImageData: JSBridgedClass {} @@ -24,7 +24,7 @@ public extension CanvasImageData { } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { - _ = jsObject[Keys.putImageData]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()) + jsObject[Keys.putImageData]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()).fromJSValue()! } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32, dirtyX: Int32, dirtyY: Int32, dirtyWidth: Int32, dirtyHeight: Int32) { @@ -35,6 +35,6 @@ public extension CanvasImageData { let _arg4 = dirtyY.jsValue() let _arg5 = dirtyWidth.jsValue() let _arg6 = dirtyHeight.jsValue() - _ = jsObject[Keys.putImageData]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + return jsObject[Keys.putImageData]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasPath.swift b/Sources/DOMKit/WebIDL/CanvasPath.swift index 7f5a6299..c304b4d7 100644 --- a/Sources/DOMKit/WebIDL/CanvasPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasPath.swift @@ -4,34 +4,34 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let moveTo: JSString = "moveTo" static let arc: JSString = "arc" + static let arcTo: JSString = "arcTo" static let bezierCurveTo: JSString = "bezierCurveTo" - static let quadraticCurveTo: JSString = "quadraticCurveTo" - static let ellipse: JSString = "ellipse" static let closePath: JSString = "closePath" - static let arcTo: JSString = "arcTo" + static let ellipse: JSString = "ellipse" static let lineTo: JSString = "lineTo" - static let roundRect: JSString = "roundRect" + static let moveTo: JSString = "moveTo" + static let quadraticCurveTo: JSString = "quadraticCurveTo" static let rect: JSString = "rect" + static let roundRect: JSString = "roundRect" } public protocol CanvasPath: JSBridgedClass {} public extension CanvasPath { func closePath() { - _ = jsObject[Keys.closePath]!() + jsObject[Keys.closePath]!().fromJSValue()! } func moveTo(x: Double, y: Double) { - _ = jsObject[Keys.moveTo]!(x.jsValue(), y.jsValue()) + jsObject[Keys.moveTo]!(x.jsValue(), y.jsValue()).fromJSValue()! } func lineTo(x: Double, y: Double) { - _ = jsObject[Keys.lineTo]!(x.jsValue(), y.jsValue()) + jsObject[Keys.lineTo]!(x.jsValue(), y.jsValue()).fromJSValue()! } func quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double) { - _ = jsObject[Keys.quadraticCurveTo]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()) + jsObject[Keys.quadraticCurveTo]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! } func bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double) { @@ -41,19 +41,19 @@ public extension CanvasPath { let _arg3 = cp2y.jsValue() let _arg4 = x.jsValue() let _arg5 = y.jsValue() - _ = jsObject[Keys.bezierCurveTo]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + return jsObject[Keys.bezierCurveTo]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } func arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) { - _ = jsObject[Keys.arcTo]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()) + jsObject[Keys.arcTo]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()).fromJSValue()! } func rect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Keys.rect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + jsObject[Keys.rect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()).fromJSValue()! } func roundRect(x: Double, y: Double, w: Double, h: Double, radii: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.roundRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined) + jsObject[Keys.roundRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined).fromJSValue()! } func arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -63,7 +63,7 @@ public extension CanvasPath { let _arg3 = startAngle.jsValue() let _arg4 = endAngle.jsValue() let _arg5 = counterclockwise?.jsValue() ?? .undefined - _ = jsObject[Keys.arc]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + return jsObject[Keys.arc]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } func ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -75,6 +75,6 @@ public extension CanvasPath { let _arg5 = startAngle.jsValue() let _arg6 = endAngle.jsValue() let _arg7 = counterclockwise?.jsValue() ?? .undefined - _ = jsObject[Keys.ellipse]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + return jsObject[Keys.ellipse]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift index 13929d5e..0147e8f9 100644 --- a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let lineCap: JSString = "lineCap" static let getLineDash: JSString = "getLineDash" + static let lineCap: JSString = "lineCap" + static let lineDashOffset: JSString = "lineDashOffset" static let lineJoin: JSString = "lineJoin" + static let lineWidth: JSString = "lineWidth" static let miterLimit: JSString = "miterLimit" static let setLineDash: JSString = "setLineDash" - static let lineWidth: JSString = "lineWidth" - static let lineDashOffset: JSString = "lineDashOffset" } public protocol CanvasPathDrawingStyles: JSBridgedClass {} @@ -36,7 +36,7 @@ public extension CanvasPathDrawingStyles { } func setLineDash(segments: [Double]) { - _ = jsObject[Keys.setLineDash]!(segments.jsValue()) + jsObject[Keys.setLineDash]!(segments.jsValue()).fromJSValue()! } func getLineDash() -> [Double] { diff --git a/Sources/DOMKit/WebIDL/CanvasPattern.swift b/Sources/DOMKit/WebIDL/CanvasPattern.swift index 907d418d..f7db7069 100644 --- a/Sources/DOMKit/WebIDL/CanvasPattern.swift +++ b/Sources/DOMKit/WebIDL/CanvasPattern.swift @@ -17,6 +17,6 @@ public class CanvasPattern: JSBridgedClass { } public func setTransform(transform: DOMMatrix2DInit? = nil) { - _ = jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined) + jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasRect.swift b/Sources/DOMKit/WebIDL/CanvasRect.swift index 11301b43..e76e5466 100644 --- a/Sources/DOMKit/WebIDL/CanvasRect.swift +++ b/Sources/DOMKit/WebIDL/CanvasRect.swift @@ -4,22 +4,22 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let strokeRect: JSString = "strokeRect" static let clearRect: JSString = "clearRect" static let fillRect: JSString = "fillRect" + static let strokeRect: JSString = "strokeRect" } public protocol CanvasRect: JSBridgedClass {} public extension CanvasRect { func clearRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Keys.clearRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + jsObject[Keys.clearRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()).fromJSValue()! } func fillRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Keys.fillRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + jsObject[Keys.fillRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()).fromJSValue()! } func strokeRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Keys.strokeRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + jsObject[Keys.strokeRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift index 443939e6..83002bdd 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class CanvasRenderingContext2DSettings: BridgedDictionary { private enum Keys { static let alpha: JSString = "alpha" - static let desynchronized: JSString = "desynchronized" static let colorSpace: JSString = "colorSpace" + static let desynchronized: JSString = "desynchronized" static let willReadFrequently: JSString = "willReadFrequently" } diff --git a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift index 086557a5..8f870bd3 100644 --- a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift @@ -4,10 +4,10 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let shadowOffsetY: JSString = "shadowOffsetY" static let shadowBlur: JSString = "shadowBlur" - static let shadowOffsetX: JSString = "shadowOffsetX" static let shadowColor: JSString = "shadowColor" + static let shadowOffsetX: JSString = "shadowOffsetX" + static let shadowOffsetY: JSString = "shadowOffsetY" } public protocol CanvasShadowStyles: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/CanvasState.swift b/Sources/DOMKit/WebIDL/CanvasState.swift index 9ed2a84b..f792dbc1 100644 --- a/Sources/DOMKit/WebIDL/CanvasState.swift +++ b/Sources/DOMKit/WebIDL/CanvasState.swift @@ -5,23 +5,23 @@ import JavaScriptKit private enum Keys { static let isContextLost: JSString = "isContextLost" - static let save: JSString = "save" static let reset: JSString = "reset" static let restore: JSString = "restore" + static let save: JSString = "save" } public protocol CanvasState: JSBridgedClass {} public extension CanvasState { func save() { - _ = jsObject[Keys.save]!() + jsObject[Keys.save]!().fromJSValue()! } func restore() { - _ = jsObject[Keys.restore]!() + jsObject[Keys.restore]!().fromJSValue()! } func reset() { - _ = jsObject[Keys.reset]!() + jsObject[Keys.reset]!().fromJSValue()! } func isContextLost() -> Bool { diff --git a/Sources/DOMKit/WebIDL/CanvasText.swift b/Sources/DOMKit/WebIDL/CanvasText.swift index 34dd0fd3..d60e97ab 100644 --- a/Sources/DOMKit/WebIDL/CanvasText.swift +++ b/Sources/DOMKit/WebIDL/CanvasText.swift @@ -5,18 +5,18 @@ import JavaScriptKit private enum Keys { static let fillText: JSString = "fillText" - static let strokeText: JSString = "strokeText" static let measureText: JSString = "measureText" + static let strokeText: JSString = "strokeText" } public protocol CanvasText: JSBridgedClass {} public extension CanvasText { func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - _ = jsObject[Keys.fillText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + jsObject[Keys.fillText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined).fromJSValue()! } func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - _ = jsObject[Keys.strokeText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + jsObject[Keys.strokeText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined).fromJSValue()! } func measureText(text: String) -> TextMetrics { diff --git a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift index 929e42d8..b995c050 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift @@ -4,16 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let textBaseline: JSString = "textBaseline" - static let font: JSString = "font" static let direction: JSString = "direction" - static let letterSpacing: JSString = "letterSpacing" - static let textAlign: JSString = "textAlign" + static let font: JSString = "font" static let fontKerning: JSString = "fontKerning" static let fontStretch: JSString = "fontStretch" + static let fontVariantCaps: JSString = "fontVariantCaps" + static let letterSpacing: JSString = "letterSpacing" + static let textAlign: JSString = "textAlign" + static let textBaseline: JSString = "textBaseline" static let textRendering: JSString = "textRendering" static let wordSpacing: JSString = "wordSpacing" - static let fontVariantCaps: JSString = "fontVariantCaps" } public protocol CanvasTextDrawingStyles: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/CanvasTransform.swift b/Sources/DOMKit/WebIDL/CanvasTransform.swift index c9af099a..730e29c2 100644 --- a/Sources/DOMKit/WebIDL/CanvasTransform.swift +++ b/Sources/DOMKit/WebIDL/CanvasTransform.swift @@ -4,27 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let setTransform: JSString = "setTransform" - static let translate: JSString = "translate" static let getTransform: JSString = "getTransform" static let resetTransform: JSString = "resetTransform" static let rotate: JSString = "rotate" - static let transform: JSString = "transform" static let scale: JSString = "scale" + static let setTransform: JSString = "setTransform" + static let transform: JSString = "transform" + static let translate: JSString = "translate" } public protocol CanvasTransform: JSBridgedClass {} public extension CanvasTransform { func scale(x: Double, y: Double) { - _ = jsObject[Keys.scale]!(x.jsValue(), y.jsValue()) + jsObject[Keys.scale]!(x.jsValue(), y.jsValue()).fromJSValue()! } func rotate(angle: Double) { - _ = jsObject[Keys.rotate]!(angle.jsValue()) + jsObject[Keys.rotate]!(angle.jsValue()).fromJSValue()! } func translate(x: Double, y: Double) { - _ = jsObject[Keys.translate]!(x.jsValue(), y.jsValue()) + jsObject[Keys.translate]!(x.jsValue(), y.jsValue()).fromJSValue()! } func transform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { @@ -34,7 +34,7 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - _ = jsObject[Keys.transform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + return jsObject[Keys.transform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } func getTransform() -> DOMMatrix { @@ -48,14 +48,14 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - _ = jsObject[Keys.setTransform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + return jsObject[Keys.setTransform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } func setTransform(transform: DOMMatrix2DInit? = nil) { - _ = jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined) + jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined).fromJSValue()! } func resetTransform() { - _ = jsObject[Keys.resetTransform]!() + jsObject[Keys.resetTransform]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift index 4faa8dc9..9a792709 100644 --- a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift +++ b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift @@ -11,18 +11,18 @@ private enum Keys { public protocol CanvasUserInterface: JSBridgedClass {} public extension CanvasUserInterface { func drawFocusIfNeeded(element: Element) { - _ = jsObject[Keys.drawFocusIfNeeded]!(element.jsValue()) + jsObject[Keys.drawFocusIfNeeded]!(element.jsValue()).fromJSValue()! } func drawFocusIfNeeded(path: Path2D, element: Element) { - _ = jsObject[Keys.drawFocusIfNeeded]!(path.jsValue(), element.jsValue()) + jsObject[Keys.drawFocusIfNeeded]!(path.jsValue(), element.jsValue()).fromJSValue()! } func scrollPathIntoView() { - _ = jsObject[Keys.scrollPathIntoView]!() + jsObject[Keys.scrollPathIntoView]!().fromJSValue()! } func scrollPathIntoView(path: Path2D) { - _ = jsObject[Keys.scrollPathIntoView]!(path.jsValue()) + jsObject[Keys.scrollPathIntoView]!(path.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CharacterData.swift b/Sources/DOMKit/WebIDL/CharacterData.swift index 0b2e91ae..3c828ea5 100644 --- a/Sources/DOMKit/WebIDL/CharacterData.swift +++ b/Sources/DOMKit/WebIDL/CharacterData.swift @@ -8,12 +8,12 @@ public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { private enum Keys { static let appendData: JSString = "appendData" - static let length: JSString = "length" + static let data: JSString = "data" static let deleteData: JSString = "deleteData" - static let replaceData: JSString = "replaceData" static let insertData: JSString = "insertData" + static let length: JSString = "length" + static let replaceData: JSString = "replaceData" static let substringData: JSString = "substringData" - static let data: JSString = "data" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -33,18 +33,18 @@ public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { } public func appendData(data: String) { - _ = jsObject[Keys.appendData]!(data.jsValue()) + jsObject[Keys.appendData]!(data.jsValue()).fromJSValue()! } public func insertData(offset: UInt32, data: String) { - _ = jsObject[Keys.insertData]!(offset.jsValue(), data.jsValue()) + jsObject[Keys.insertData]!(offset.jsValue(), data.jsValue()).fromJSValue()! } public func deleteData(offset: UInt32, count: UInt32) { - _ = jsObject[Keys.deleteData]!(offset.jsValue(), count.jsValue()) + jsObject[Keys.deleteData]!(offset.jsValue(), count.jsValue()).fromJSValue()! } public func replaceData(offset: UInt32, count: UInt32, data: String) { - _ = jsObject[Keys.replaceData]!(offset.jsValue(), count.jsValue(), data.jsValue()) + jsObject[Keys.replaceData]!(offset.jsValue(), count.jsValue(), data.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ChildNode.swift b/Sources/DOMKit/WebIDL/ChildNode.swift index 373cfed1..da50df7d 100644 --- a/Sources/DOMKit/WebIDL/ChildNode.swift +++ b/Sources/DOMKit/WebIDL/ChildNode.swift @@ -4,27 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let before: JSString = "before" static let after: JSString = "after" - static let replaceWith: JSString = "replaceWith" + static let before: JSString = "before" static let remove: JSString = "remove" + static let replaceWith: JSString = "replaceWith" } public protocol ChildNode: JSBridgedClass {} public extension ChildNode { func before(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.before]!(nodes.jsValue()) + jsObject[Keys.before]!(nodes.jsValue()).fromJSValue()! } func after(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.after]!(nodes.jsValue()) + jsObject[Keys.after]!(nodes.jsValue()).fromJSValue()! } func replaceWith(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.replaceWith]!(nodes.jsValue()) + jsObject[Keys.replaceWith]!(nodes.jsValue()).fromJSValue()! } func remove() { - _ = jsObject[Keys.remove]!() + jsObject[Keys.remove]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index d284b152..b5588d50 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -24,6 +24,6 @@ public class CompositionEvent: UIEvent { public var data: String public func initCompositionEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: WindowProxy? = nil, dataArg: String? = nil) { - _ = jsObject[Keys.initCompositionEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.jsValue() ?? .undefined) + jsObject[Keys.initCompositionEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index ec6fe988..215f702d 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -7,10 +7,10 @@ public class CustomElementRegistry: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CustomElementRegistry.function! } private enum Keys { - static let whenDefined: JSString = "whenDefined" - static let upgrade: JSString = "upgrade" - static let get: JSString = "get" static let define: JSString = "define" + static let get: JSString = "get" + static let upgrade: JSString = "upgrade" + static let whenDefined: JSString = "whenDefined" } public let jsObject: JSObject @@ -30,6 +30,6 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'whenDefined' is ignored public func upgrade(root: Node) { - _ = jsObject[Keys.upgrade]!(root.jsValue()) + jsObject[Keys.upgrade]!(root.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index 685b8e7b..7e5756fc 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -24,6 +24,6 @@ public class CustomEvent: Event { public var detail: JSValue public func initCustomEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, detail: JSValue? = nil) { - _ = jsObject[Keys.initCustomEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined) + jsObject[Keys.initCustomEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMException.swift b/Sources/DOMKit/WebIDL/DOMException.swift index bf3c2945..c810d284 100644 --- a/Sources/DOMKit/WebIDL/DOMException.swift +++ b/Sources/DOMKit/WebIDL/DOMException.swift @@ -7,34 +7,34 @@ public class DOMException: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMException.function! } private enum Keys { - static let INVALID_MODIFICATION_ERR: JSString = "INVALID_MODIFICATION_ERR" - static let INVALID_ACCESS_ERR: JSString = "INVALID_ACCESS_ERR" - static let VALIDATION_ERR: JSString = "VALIDATION_ERR" - static let QUOTA_EXCEEDED_ERR: JSString = "QUOTA_EXCEEDED_ERR" - static let NETWORK_ERR: JSString = "NETWORK_ERR" - static let WRONG_DOCUMENT_ERR: JSString = "WRONG_DOCUMENT_ERR" + static let ABORT_ERR: JSString = "ABORT_ERR" + static let DATA_CLONE_ERR: JSString = "DATA_CLONE_ERR" + static let DOMSTRING_SIZE_ERR: JSString = "DOMSTRING_SIZE_ERR" + static let HIERARCHY_REQUEST_ERR: JSString = "HIERARCHY_REQUEST_ERR" + static let INDEX_SIZE_ERR: JSString = "INDEX_SIZE_ERR" static let INUSE_ATTRIBUTE_ERR: JSString = "INUSE_ATTRIBUTE_ERR" + static let INVALID_ACCESS_ERR: JSString = "INVALID_ACCESS_ERR" static let INVALID_CHARACTER_ERR: JSString = "INVALID_CHARACTER_ERR" - static let SYNTAX_ERR: JSString = "SYNTAX_ERR" - static let DATA_CLONE_ERR: JSString = "DATA_CLONE_ERR" - static let SECURITY_ERR: JSString = "SECURITY_ERR" + static let INVALID_MODIFICATION_ERR: JSString = "INVALID_MODIFICATION_ERR" + static let INVALID_NODE_TYPE_ERR: JSString = "INVALID_NODE_TYPE_ERR" + static let INVALID_STATE_ERR: JSString = "INVALID_STATE_ERR" + static let NAMESPACE_ERR: JSString = "NAMESPACE_ERR" + static let NETWORK_ERR: JSString = "NETWORK_ERR" + static let NOT_FOUND_ERR: JSString = "NOT_FOUND_ERR" + static let NOT_SUPPORTED_ERR: JSString = "NOT_SUPPORTED_ERR" + static let NO_DATA_ALLOWED_ERR: JSString = "NO_DATA_ALLOWED_ERR" static let NO_MODIFICATION_ALLOWED_ERR: JSString = "NO_MODIFICATION_ALLOWED_ERR" - static let URL_MISMATCH_ERR: JSString = "URL_MISMATCH_ERR" + static let QUOTA_EXCEEDED_ERR: JSString = "QUOTA_EXCEEDED_ERR" + static let SECURITY_ERR: JSString = "SECURITY_ERR" + static let SYNTAX_ERR: JSString = "SYNTAX_ERR" static let TIMEOUT_ERR: JSString = "TIMEOUT_ERR" - static let message: JSString = "message" - static let ABORT_ERR: JSString = "ABORT_ERR" - static let INDEX_SIZE_ERR: JSString = "INDEX_SIZE_ERR" - static let NAMESPACE_ERR: JSString = "NAMESPACE_ERR" static let TYPE_MISMATCH_ERR: JSString = "TYPE_MISMATCH_ERR" - static let name: JSString = "name" - static let DOMSTRING_SIZE_ERR: JSString = "DOMSTRING_SIZE_ERR" - static let NOT_SUPPORTED_ERR: JSString = "NOT_SUPPORTED_ERR" + static let URL_MISMATCH_ERR: JSString = "URL_MISMATCH_ERR" + static let VALIDATION_ERR: JSString = "VALIDATION_ERR" + static let WRONG_DOCUMENT_ERR: JSString = "WRONG_DOCUMENT_ERR" static let code: JSString = "code" - static let HIERARCHY_REQUEST_ERR: JSString = "HIERARCHY_REQUEST_ERR" - static let INVALID_STATE_ERR: JSString = "INVALID_STATE_ERR" - static let NO_DATA_ALLOWED_ERR: JSString = "NO_DATA_ALLOWED_ERR" - static let NOT_FOUND_ERR: JSString = "NOT_FOUND_ERR" - static let INVALID_NODE_TYPE_ERR: JSString = "INVALID_NODE_TYPE_ERR" + static let message: JSString = "message" + static let name: JSString = "name" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMImplementation.swift b/Sources/DOMKit/WebIDL/DOMImplementation.swift index cfe9efc7..29f8dede 100644 --- a/Sources/DOMKit/WebIDL/DOMImplementation.swift +++ b/Sources/DOMKit/WebIDL/DOMImplementation.swift @@ -8,9 +8,9 @@ public class DOMImplementation: JSBridgedClass { private enum Keys { static let createDocument: JSString = "createDocument" - static let hasFeature: JSString = "hasFeature" - static let createHTMLDocument: JSString = "createHTMLDocument" static let createDocumentType: JSString = "createDocumentType" + static let createHTMLDocument: JSString = "createHTMLDocument" + static let hasFeature: JSString = "hasFeature" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index 5e3a0496..4ba547b4 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -7,43 +7,43 @@ public class DOMMatrix: DOMMatrixReadOnly { override public class var constructor: JSFunction { JSObject.global.DOMMatrix.function! } private enum Keys { - static let m24: JSString = "m24" - static let m22: JSString = "m22" - static let fromFloat32Array: JSString = "fromFloat32Array" + static let a: JSString = "a" + static let b: JSString = "b" + static let c: JSString = "c" + static let d: JSString = "d" static let e: JSString = "e" - static let fromFloat64Array: JSString = "fromFloat64Array" - static let multiplySelf: JSString = "multiplySelf" - static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" static let f: JSString = "f" + static let fromFloat32Array: JSString = "fromFloat32Array" + static let fromFloat64Array: JSString = "fromFloat64Array" + static let fromMatrix: JSString = "fromMatrix" static let invertSelf: JSString = "invertSelf" - static let c: JSString = "c" static let m11: JSString = "m11" - static let b: JSString = "b" - static let m43: JSString = "m43" - static let scaleSelf: JSString = "scaleSelf" - static let fromMatrix: JSString = "fromMatrix" - static let scale3dSelf: JSString = "scale3dSelf" - static let m41: JSString = "m41" - static let m33: JSString = "m33" - static let skewYSelf: JSString = "skewYSelf" - static let a: JSString = "a" - static let m31: JSString = "m31" - static let rotateSelf: JSString = "rotateSelf" + static let m12: JSString = "m12" static let m13: JSString = "m13" - static let m34: JSString = "m34" - static let translateSelf: JSString = "translateSelf" + static let m14: JSString = "m14" static let m21: JSString = "m21" - static let d: JSString = "d" - static let m42: JSString = "m42" + static let m22: JSString = "m22" static let m23: JSString = "m23" + static let m24: JSString = "m24" + static let m31: JSString = "m31" static let m32: JSString = "m32" - static let m12: JSString = "m12" - static let rotateFromVectorSelf: JSString = "rotateFromVectorSelf" + static let m33: JSString = "m33" + static let m34: JSString = "m34" + static let m41: JSString = "m41" + static let m42: JSString = "m42" + static let m43: JSString = "m43" + static let m44: JSString = "m44" + static let multiplySelf: JSString = "multiplySelf" static let preMultiplySelf: JSString = "preMultiplySelf" - static let m14: JSString = "m14" - static let skewXSelf: JSString = "skewXSelf" + static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" + static let rotateFromVectorSelf: JSString = "rotateFromVectorSelf" + static let rotateSelf: JSString = "rotateSelf" + static let scale3dSelf: JSString = "scale3dSelf" + static let scaleSelf: JSString = "scaleSelf" static let setMatrixValue: JSString = "setMatrixValue" - static let m44: JSString = "m44" + static let skewXSelf: JSString = "skewXSelf" + static let skewYSelf: JSString = "skewYSelf" + static let translateSelf: JSString = "translateSelf" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -77,13 +77,13 @@ public class DOMMatrix: DOMMatrixReadOnly { } // XXX: illegal static override - // override public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self + // override public static func `fromMatrix`(`other`: `DOMMatrixInit`? = nil) -> Self // XXX: illegal static override - // override public static func fromFloat32Array(array32: Float32Array) -> Self + // override public static func `fromFloat32Array`(`array32`: `Float32Array`) -> Self // XXX: illegal static override - // override public static func fromFloat64Array(array64: Float64Array) -> Self + // override public static func `fromFloat64Array`(`array64`: `Float64Array`) -> Self private var _a: ReadWriteAttribute override public var a: Double { diff --git a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift index 4bb6ecc0..492463a1 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift @@ -6,17 +6,17 @@ import JavaScriptKit public class DOMMatrix2DInit: BridgedDictionary { private enum Keys { static let a: JSString = "a" - static let f: JSString = "f" - static let m41: JSString = "m41" - static let m22: JSString = "m22" - static let m42: JSString = "m42" - static let m21: JSString = "m21" static let b: JSString = "b" + static let c: JSString = "c" static let d: JSString = "d" static let e: JSString = "e" - static let c: JSString = "c" - static let m12: JSString = "m12" + static let f: JSString = "f" static let m11: JSString = "m11" + static let m12: JSString = "m12" + static let m21: JSString = "m21" + static let m22: JSString = "m22" + static let m41: JSString = "m41" + static let m42: JSString = "m42" } public convenience init(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double, m11: Double, m12: Double, m21: Double, m22: Double, m41: Double, m42: Double) { diff --git a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift index 2a2fff5a..f9b324b8 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift @@ -5,17 +5,17 @@ import JavaScriptKit public class DOMMatrixInit: BridgedDictionary { private enum Keys { + static let is2D: JSString = "is2D" + static let m13: JSString = "m13" static let m14: JSString = "m14" - static let m24: JSString = "m24" static let m23: JSString = "m23" + static let m24: JSString = "m24" + static let m31: JSString = "m31" static let m32: JSString = "m32" - static let m34: JSString = "m34" - static let m44: JSString = "m44" static let m33: JSString = "m33" - static let is2D: JSString = "is2D" - static let m31: JSString = "m31" + static let m34: JSString = "m34" static let m43: JSString = "m43" - static let m13: JSString = "m13" + static let m44: JSString = "m44" } public convenience init(m13: Double, m14: Double, m23: Double, m24: Double, m31: Double, m32: Double, m33: Double, m34: Double, m43: Double, m44: Double, is2D: Bool) { diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift index 28c3e16d..8b16b9a4 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -8,49 +8,49 @@ public class DOMMatrixReadOnly: JSBridgedClass { private enum Keys { static let a: JSString = "a" - static let translate: JSString = "translate" - static let skewX: JSString = "skewX" - static let m23: JSString = "m23" + static let b: JSString = "b" + static let c: JSString = "c" static let d: JSString = "d" - static let m43: JSString = "m43" - static let rotate: JSString = "rotate" - static let m14: JSString = "m14" - static let m24: JSString = "m24" - static let isIdentity: JSString = "isIdentity" + static let e: JSString = "e" + static let f: JSString = "f" static let flipX: JSString = "flipX" - static let m34: JSString = "m34" - static let toFloat32Array: JSString = "toFloat32Array" + static let flipY: JSString = "flipY" static let fromFloat32Array: JSString = "fromFloat32Array" - static let toJSON: JSString = "toJSON" - static let c: JSString = "c" - static let m31: JSString = "m31" + static let fromFloat64Array: JSString = "fromFloat64Array" + static let fromMatrix: JSString = "fromMatrix" + static let inverse: JSString = "inverse" + static let is2D: JSString = "is2D" + static let isIdentity: JSString = "isIdentity" + static let m11: JSString = "m11" + static let m12: JSString = "m12" static let m13: JSString = "m13" - static let multiply: JSString = "multiply" + static let m14: JSString = "m14" + static let m21: JSString = "m21" + static let m22: JSString = "m22" + static let m23: JSString = "m23" + static let m24: JSString = "m24" + static let m31: JSString = "m31" static let m32: JSString = "m32" - static let rotateFromVector: JSString = "rotateFromVector" - static let scale: JSString = "scale" - static let flipY: JSString = "flipY" static let m33: JSString = "m33" - static let m22: JSString = "m22" - static let m12: JSString = "m12" + static let m34: JSString = "m34" static let m41: JSString = "m41" - static let is2D: JSString = "is2D" - static let scaleNonUniform: JSString = "scaleNonUniform" - static let scale3d: JSString = "scale3d" + static let m42: JSString = "m42" + static let m43: JSString = "m43" + static let m44: JSString = "m44" + static let multiply: JSString = "multiply" + static let rotate: JSString = "rotate" static let rotateAxisAngle: JSString = "rotateAxisAngle" + static let rotateFromVector: JSString = "rotateFromVector" + static let scale: JSString = "scale" + static let scale3d: JSString = "scale3d" + static let scaleNonUniform: JSString = "scaleNonUniform" + static let skewX: JSString = "skewX" static let skewY: JSString = "skewY" - static let inverse: JSString = "inverse" - static let m44: JSString = "m44" - static let transformPoint: JSString = "transformPoint" - static let e: JSString = "e" + static let toFloat32Array: JSString = "toFloat32Array" static let toFloat64Array: JSString = "toFloat64Array" - static let fromFloat64Array: JSString = "fromFloat64Array" - static let m21: JSString = "m21" - static let fromMatrix: JSString = "fromMatrix" - static let b: JSString = "b" - static let f: JSString = "f" - static let m42: JSString = "m42" - static let m11: JSString = "m11" + static let toJSON: JSString = "toJSON" + static let transformPoint: JSString = "transformPoint" + static let translate: JSString = "translate" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMPoint.swift b/Sources/DOMKit/WebIDL/DOMPoint.swift index aeced126..b92a886a 100644 --- a/Sources/DOMKit/WebIDL/DOMPoint.swift +++ b/Sources/DOMKit/WebIDL/DOMPoint.swift @@ -7,11 +7,11 @@ public class DOMPoint: DOMPointReadOnly { override public class var constructor: JSFunction { JSObject.global.DOMPoint.function! } private enum Keys { - static let z: JSString = "z" - static let x: JSString = "x" static let fromPoint: JSString = "fromPoint" - static let y: JSString = "y" static let w: JSString = "w" + static let x: JSString = "x" + static let y: JSString = "y" + static let z: JSString = "z" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -27,7 +27,7 @@ public class DOMPoint: DOMPointReadOnly { } // XXX: illegal static override - // override public static func fromPoint(other: DOMPointInit? = nil) -> Self + // override public static func `fromPoint`(`other`: `DOMPointInit`? = nil) -> Self private var _x: ReadWriteAttribute override public var x: Double { diff --git a/Sources/DOMKit/WebIDL/DOMPointInit.swift b/Sources/DOMKit/WebIDL/DOMPointInit.swift index 3c1bfc6d..a3ae638d 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit.swift @@ -5,10 +5,10 @@ import JavaScriptKit public class DOMPointInit: BridgedDictionary { private enum Keys { - static let x: JSString = "x" - static let z: JSString = "z" static let w: JSString = "w" + static let x: JSString = "x" static let y: JSString = "y" + static let z: JSString = "z" } public convenience init(x: Double, y: Double, z: Double, w: Double) { diff --git a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift index d3a96897..26fee3cc 100644 --- a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift @@ -7,13 +7,13 @@ public class DOMPointReadOnly: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMPointReadOnly.function! } private enum Keys { + static let fromPoint: JSString = "fromPoint" + static let matrixTransform: JSString = "matrixTransform" + static let toJSON: JSString = "toJSON" static let w: JSString = "w" static let x: JSString = "x" static let y: JSString = "y" - static let fromPoint: JSString = "fromPoint" static let z: JSString = "z" - static let toJSON: JSString = "toJSON" - static let matrixTransform: JSString = "matrixTransform" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMQuad.swift b/Sources/DOMKit/WebIDL/DOMQuad.swift index ce7d4bd2..62abc776 100644 --- a/Sources/DOMKit/WebIDL/DOMQuad.swift +++ b/Sources/DOMKit/WebIDL/DOMQuad.swift @@ -7,14 +7,14 @@ public class DOMQuad: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMQuad.function! } private enum Keys { + static let fromQuad: JSString = "fromQuad" + static let fromRect: JSString = "fromRect" + static let getBounds: JSString = "getBounds" static let p1: JSString = "p1" static let p2: JSString = "p2" - static let getBounds: JSString = "getBounds" - static let toJSON: JSString = "toJSON" static let p3: JSString = "p3" - static let fromRect: JSString = "fromRect" static let p4: JSString = "p4" - static let fromQuad: JSString = "fromQuad" + static let toJSON: JSString = "toJSON" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMQuadInit.swift b/Sources/DOMKit/WebIDL/DOMQuadInit.swift index bf11f1df..20eab437 100644 --- a/Sources/DOMKit/WebIDL/DOMQuadInit.swift +++ b/Sources/DOMKit/WebIDL/DOMQuadInit.swift @@ -5,10 +5,10 @@ import JavaScriptKit public class DOMQuadInit: BridgedDictionary { private enum Keys { - static let p4: JSString = "p4" + static let p1: JSString = "p1" static let p2: JSString = "p2" static let p3: JSString = "p3" - static let p1: JSString = "p1" + static let p4: JSString = "p4" } public convenience init(p1: DOMPointInit, p2: DOMPointInit, p3: DOMPointInit, p4: DOMPointInit) { diff --git a/Sources/DOMKit/WebIDL/DOMRect.swift b/Sources/DOMKit/WebIDL/DOMRect.swift index 4905a5ea..4d06ad0c 100644 --- a/Sources/DOMKit/WebIDL/DOMRect.swift +++ b/Sources/DOMKit/WebIDL/DOMRect.swift @@ -7,10 +7,10 @@ public class DOMRect: DOMRectReadOnly { override public class var constructor: JSFunction { JSObject.global.DOMRect.function! } private enum Keys { + static let fromRect: JSString = "fromRect" + static let height: JSString = "height" static let width: JSString = "width" static let x: JSString = "x" - static let height: JSString = "height" - static let fromRect: JSString = "fromRect" static let y: JSString = "y" } @@ -27,7 +27,7 @@ public class DOMRect: DOMRectReadOnly { } // XXX: illegal static override - // override public static func fromRect(other: DOMRectInit? = nil) -> Self + // override public static func `fromRect`(`other`: `DOMRectInit`? = nil) -> Self private var _x: ReadWriteAttribute override public var x: Double { diff --git a/Sources/DOMKit/WebIDL/DOMRectInit.swift b/Sources/DOMKit/WebIDL/DOMRectInit.swift index 408c3ce7..a953b96e 100644 --- a/Sources/DOMKit/WebIDL/DOMRectInit.swift +++ b/Sources/DOMKit/WebIDL/DOMRectInit.swift @@ -5,9 +5,9 @@ import JavaScriptKit public class DOMRectInit: BridgedDictionary { private enum Keys { - static let x: JSString = "x" - static let width: JSString = "width" static let height: JSString = "height" + static let width: JSString = "width" + static let x: JSString = "x" static let y: JSString = "y" } diff --git a/Sources/DOMKit/WebIDL/DOMRectList.swift b/Sources/DOMKit/WebIDL/DOMRectList.swift index 0422c58b..46270166 100644 --- a/Sources/DOMKit/WebIDL/DOMRectList.swift +++ b/Sources/DOMKit/WebIDL/DOMRectList.swift @@ -7,8 +7,8 @@ public class DOMRectList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMRectList.function! } private enum Keys { - static let length: JSString = "length" static let item: JSString = "item" + static let length: JSString = "length" } public let jsObject: JSObject @@ -21,7 +21,7 @@ public class DOMRectList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> DOMRect? { + public subscript(key: UInt32) -> DOMRect? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift index d7d4e9a6..79ae4550 100644 --- a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift @@ -7,16 +7,16 @@ public class DOMRectReadOnly: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMRectReadOnly.function! } private enum Keys { - static let width: JSString = "width" + static let bottom: JSString = "bottom" static let fromRect: JSString = "fromRect" - static let x: JSString = "x" - static let y: JSString = "y" - static let left: JSString = "left" static let height: JSString = "height" + static let left: JSString = "left" static let right: JSString = "right" - static let bottom: JSString = "bottom" - static let top: JSString = "top" static let toJSON: JSString = "toJSON" + static let top: JSString = "top" + static let width: JSString = "width" + static let x: JSString = "x" + static let y: JSString = "y" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMStringList.swift b/Sources/DOMKit/WebIDL/DOMStringList.swift index 1a94ac6d..904c493a 100644 --- a/Sources/DOMKit/WebIDL/DOMStringList.swift +++ b/Sources/DOMKit/WebIDL/DOMStringList.swift @@ -7,9 +7,9 @@ public class DOMStringList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMStringList.function! } private enum Keys { - static let length: JSString = "length" static let contains: JSString = "contains" static let item: JSString = "item" + static let length: JSString = "length" } public let jsObject: JSObject @@ -22,7 +22,7 @@ public class DOMStringList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> String? { + public subscript(key: UInt32) -> String? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/DOMStringMap.swift b/Sources/DOMKit/WebIDL/DOMStringMap.swift index 4a32e5da..8914cce2 100644 --- a/Sources/DOMKit/WebIDL/DOMStringMap.swift +++ b/Sources/DOMKit/WebIDL/DOMStringMap.swift @@ -18,7 +18,7 @@ public class DOMStringMap: JSBridgedClass { jsObject[key].fromJSValue()! } - // XXX: unsupported setter for keys of type String + // XXX: unsupported setter for keys of type `String` - // XXX: unsupported deleter for keys of type String + // XXX: unsupported deleter for keys of type `String` } diff --git a/Sources/DOMKit/WebIDL/DOMTokenList.swift b/Sources/DOMKit/WebIDL/DOMTokenList.swift index 342a1703..49589a11 100644 --- a/Sources/DOMKit/WebIDL/DOMTokenList.swift +++ b/Sources/DOMKit/WebIDL/DOMTokenList.swift @@ -7,15 +7,15 @@ public class DOMTokenList: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.DOMTokenList.function! } private enum Keys { - static let toggle: JSString = "toggle" - static let supports: JSString = "supports" static let add: JSString = "add" - static let value: JSString = "value" - static let remove: JSString = "remove" - static let replace: JSString = "replace" + static let contains: JSString = "contains" static let item: JSString = "item" static let length: JSString = "length" - static let contains: JSString = "contains" + static let remove: JSString = "remove" + static let replace: JSString = "replace" + static let supports: JSString = "supports" + static let toggle: JSString = "toggle" + static let value: JSString = "value" } public let jsObject: JSObject @@ -29,7 +29,7 @@ public class DOMTokenList: JSBridgedClass, Sequence { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> String? { + public subscript(key: UInt32) -> String? { jsObject[key].fromJSValue() } @@ -38,11 +38,11 @@ public class DOMTokenList: JSBridgedClass, Sequence { } public func add(tokens: String...) { - _ = jsObject[Keys.add]!(tokens.jsValue()) + jsObject[Keys.add]!(tokens.jsValue()).fromJSValue()! } public func remove(tokens: String...) { - _ = jsObject[Keys.remove]!(tokens.jsValue()) + jsObject[Keys.remove]!(tokens.jsValue()).fromJSValue()! } public func toggle(token: String, force: Bool? = nil) -> Bool { diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift index a9fa551f..f8597722 100644 --- a/Sources/DOMKit/WebIDL/DataTransfer.swift +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -7,15 +7,15 @@ public class DataTransfer: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DataTransfer.function! } private enum Keys { - static let getData: JSString = "getData" - static let items: JSString = "items" + static let clearData: JSString = "clearData" static let dropEffect: JSString = "dropEffect" - static let types: JSString = "types" static let effectAllowed: JSString = "effectAllowed" - static let clearData: JSString = "clearData" static let files: JSString = "files" - static let setDragImage: JSString = "setDragImage" + static let getData: JSString = "getData" + static let items: JSString = "items" static let setData: JSString = "setData" + static let setDragImage: JSString = "setDragImage" + static let types: JSString = "types" } public let jsObject: JSObject @@ -43,7 +43,7 @@ public class DataTransfer: JSBridgedClass { public var items: DataTransferItemList public func setDragImage(image: Element, x: Int32, y: Int32) { - _ = jsObject[Keys.setDragImage]!(image.jsValue(), x.jsValue(), y.jsValue()) + jsObject[Keys.setDragImage]!(image.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -54,11 +54,11 @@ public class DataTransfer: JSBridgedClass { } public func setData(format: String, data: String) { - _ = jsObject[Keys.setData]!(format.jsValue(), data.jsValue()) + jsObject[Keys.setData]!(format.jsValue(), data.jsValue()).fromJSValue()! } public func clearData(format: String? = nil) { - _ = jsObject[Keys.clearData]!(format?.jsValue() ?? .undefined) + jsObject[Keys.clearData]!(format?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index 969a1957..751aac97 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -7,10 +7,10 @@ public class DataTransferItem: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DataTransferItem.function! } private enum Keys { + static let getAsFile: JSString = "getAsFile" static let getAsString: JSString = "getAsString" - static let type: JSString = "type" static let kind: JSString = "kind" - static let getAsFile: JSString = "getAsFile" + static let type: JSString = "type" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DataTransferItemList.swift b/Sources/DOMKit/WebIDL/DataTransferItemList.swift index df1a5cb2..746f636f 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItemList.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItemList.swift @@ -7,10 +7,10 @@ public class DataTransferItemList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DataTransferItemList.function! } private enum Keys { - static let remove: JSString = "remove" - static let length: JSString = "length" - static let clear: JSString = "clear" static let add: JSString = "add" + static let clear: JSString = "clear" + static let length: JSString = "length" + static let remove: JSString = "remove" } public let jsObject: JSObject @@ -23,7 +23,7 @@ public class DataTransferItemList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> DataTransferItem { + public subscript(key: UInt32) -> DataTransferItem { jsObject[key].fromJSValue()! } @@ -36,10 +36,10 @@ public class DataTransferItemList: JSBridgedClass { } public func remove(index: UInt32) { - _ = jsObject[Keys.remove]!(index.jsValue()) + jsObject[Keys.remove]!(index.jsValue()).fromJSValue()! } public func clear() { - _ = jsObject[Keys.clear]!() + jsObject[Keys.clear]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index 0ea34d94..0ef02b06 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -7,11 +7,11 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid override public class var constructor: JSFunction { JSObject.global.DedicatedWorkerGlobalScope.function! } private enum Keys { - static let onmessage: JSString = "onmessage" - static let postMessage: JSString = "postMessage" static let close: JSString = "close" - static let onmessageerror: JSString = "onmessageerror" static let name: JSString = "name" + static let onmessage: JSString = "onmessage" + static let onmessageerror: JSString = "onmessageerror" + static let postMessage: JSString = "postMessage" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -25,15 +25,15 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid public var name: String public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) + jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()).fromJSValue()! } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 426fb6da..17cd6195 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -7,80 +7,80 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN override public class var constructor: JSFunction { JSObject.global.Document.function! } private enum Keys { - static let currentScript: JSString = "currentScript" - static let getElementsByTagName: JSString = "getElementsByTagName" static let URL: JSString = "URL" - static let vlinkColor: JSString = "vlinkColor" - static let createAttributeNS: JSString = "createAttributeNS" - static let documentElement: JSString = "documentElement" - static let head: JSString = "head" - static let implementation: JSString = "implementation" - static let scripts: JSString = "scripts" - static let designMode: JSString = "designMode" - static let hidden: JSString = "hidden" - static let clear: JSString = "clear" - static let lastModified: JSString = "lastModified" - static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" - static let doctype: JSString = "doctype" - static let images: JSString = "images" - static let captureEvents: JSString = "captureEvents" + static let adoptNode: JSString = "adoptNode" + static let alinkColor: JSString = "alinkColor" static let all: JSString = "all" - static let queryCommandValue: JSString = "queryCommandValue" - static let queryCommandEnabled: JSString = "queryCommandEnabled" - static let createElement: JSString = "createElement" - static let queryCommandIndeterm: JSString = "queryCommandIndeterm" - static let queryCommandState: JSString = "queryCommandState" - static let createTextNode: JSString = "createTextNode" - static let charset: JSString = "charset" - static let onreadystatechange: JSString = "onreadystatechange" - static let createElementNS: JSString = "createElementNS" - static let queryCommandSupported: JSString = "queryCommandSupported" - static let visibilityState: JSString = "visibilityState" - static let contentType: JSString = "contentType" - static let plugins: JSString = "plugins" + static let anchors: JSString = "anchors" static let applets: JSString = "applets" - static let adoptNode: JSString = "adoptNode" - static let compatMode: JSString = "compatMode" - static let createComment: JSString = "createComment" - static let location: JSString = "location" - static let execCommand: JSString = "execCommand" - static let referrer: JSString = "referrer" - static let documentURI: JSString = "documentURI" + static let bgColor: JSString = "bgColor" + static let body: JSString = "body" + static let captureEvents: JSString = "captureEvents" static let characterSet: JSString = "characterSet" - static let links: JSString = "links" - static let open: JSString = "open" - static let alinkColor: JSString = "alinkColor" - static let createNodeIterator: JSString = "createNodeIterator" - static let forms: JSString = "forms" + static let charset: JSString = "charset" + static let clear: JSString = "clear" + static let close: JSString = "close" + static let compatMode: JSString = "compatMode" + static let contentType: JSString = "contentType" static let cookie: JSString = "cookie" - static let domain: JSString = "domain" + static let createAttribute: JSString = "createAttribute" + static let createAttributeNS: JSString = "createAttributeNS" + static let createCDATASection: JSString = "createCDATASection" + static let createComment: JSString = "createComment" static let createDocumentFragment: JSString = "createDocumentFragment" - static let getElementsByClassName: JSString = "getElementsByClassName" - static let title: JSString = "title" + static let createElement: JSString = "createElement" + static let createElementNS: JSString = "createElementNS" + static let createEvent: JSString = "createEvent" + static let createNodeIterator: JSString = "createNodeIterator" static let createProcessingInstruction: JSString = "createProcessingInstruction" - static let getElementsByName: JSString = "getElementsByName" static let createRange: JSString = "createRange" + static let createTextNode: JSString = "createTextNode" + static let createTreeWalker: JSString = "createTreeWalker" + static let currentScript: JSString = "currentScript" + static let defaultView: JSString = "defaultView" + static let designMode: JSString = "designMode" + static let dir: JSString = "dir" + static let doctype: JSString = "doctype" + static let documentElement: JSString = "documentElement" + static let documentURI: JSString = "documentURI" + static let domain: JSString = "domain" static let embeds: JSString = "embeds" - static let createAttribute: JSString = "createAttribute" + static let execCommand: JSString = "execCommand" + static let fgColor: JSString = "fgColor" + static let forms: JSString = "forms" + static let getElementsByClassName: JSString = "getElementsByClassName" + static let getElementsByName: JSString = "getElementsByName" + static let getElementsByTagName: JSString = "getElementsByTagName" + static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" + static let hasFocus: JSString = "hasFocus" + static let head: JSString = "head" + static let hidden: JSString = "hidden" + static let images: JSString = "images" + static let implementation: JSString = "implementation" + static let importNode: JSString = "importNode" + static let inputEncoding: JSString = "inputEncoding" + static let lastModified: JSString = "lastModified" static let linkColor: JSString = "linkColor" + static let links: JSString = "links" + static let location: JSString = "location" + static let onreadystatechange: JSString = "onreadystatechange" static let onvisibilitychange: JSString = "onvisibilitychange" - static let inputEncoding: JSString = "inputEncoding" - static let createEvent: JSString = "createEvent" - static let defaultView: JSString = "defaultView" + static let open: JSString = "open" + static let plugins: JSString = "plugins" + static let queryCommandEnabled: JSString = "queryCommandEnabled" + static let queryCommandIndeterm: JSString = "queryCommandIndeterm" + static let queryCommandState: JSString = "queryCommandState" + static let queryCommandSupported: JSString = "queryCommandSupported" + static let queryCommandValue: JSString = "queryCommandValue" static let readyState: JSString = "readyState" - static let hasFocus: JSString = "hasFocus" - static let writeln: JSString = "writeln" - static let fgColor: JSString = "fgColor" - static let close: JSString = "close" - static let write: JSString = "write" - static let body: JSString = "body" - static let bgColor: JSString = "bgColor" + static let referrer: JSString = "referrer" static let releaseEvents: JSString = "releaseEvents" - static let dir: JSString = "dir" - static let anchors: JSString = "anchors" - static let importNode: JSString = "importNode" - static let createCDATASection: JSString = "createCDATASection" - static let createTreeWalker: JSString = "createTreeWalker" + static let scripts: JSString = "scripts" + static let title: JSString = "title" + static let visibilityState: JSString = "visibilityState" + static let vlinkColor: JSString = "vlinkColor" + static let write: JSString = "write" + static let writeln: JSString = "writeln" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -298,15 +298,15 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN } public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } public func write(text: String...) { - _ = jsObject[Keys.write]!(text.jsValue()) + jsObject[Keys.write]!(text.jsValue()).fromJSValue()! } public func writeln(text: String...) { - _ = jsObject[Keys.writeln]!(text.jsValue()) + jsObject[Keys.writeln]!(text.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -377,15 +377,15 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN public var applets: HTMLCollection public func clear() { - _ = jsObject[Keys.clear]!() + jsObject[Keys.clear]!().fromJSValue()! } public func captureEvents() { - _ = jsObject[Keys.captureEvents]!() + jsObject[Keys.captureEvents]!().fromJSValue()! } public func releaseEvents() { - _ = jsObject[Keys.releaseEvents]!() + jsObject[Keys.releaseEvents]!().fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift index c23d3829..80abcbf9 100644 --- a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift @@ -4,9 +4,9 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let onpaste: JSString = "onpaste" static let oncopy: JSString = "oncopy" static let oncut: JSString = "oncut" + static let onpaste: JSString = "onpaste" } public protocol DocumentAndElementEventHandlers: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index 80cb710f..5615def9 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -7,41 +7,41 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo override public class var constructor: JSFunction { JSObject.global.Element.function! } private enum Keys { + static let attachShadow: JSString = "attachShadow" + static let attributes: JSString = "attributes" + static let classList: JSString = "classList" + static let className: JSString = "className" + static let closest: JSString = "closest" static let getAttribute: JSString = "getAttribute" - static let removeAttributeNS: JSString = "removeAttributeNS" + static let getAttributeNS: JSString = "getAttributeNS" + static let getAttributeNames: JSString = "getAttributeNames" static let getAttributeNode: JSString = "getAttributeNode" - static let hasAttribute: JSString = "hasAttribute" - static let setAttributeNodeNS: JSString = "setAttributeNodeNS" - static let removeAttributeNode: JSString = "removeAttributeNode" - static let hasAttributes: JSString = "hasAttributes" - static let toggleAttribute: JSString = "toggleAttribute" - static let webkitMatchesSelector: JSString = "webkitMatchesSelector" + static let getAttributeNodeNS: JSString = "getAttributeNodeNS" + static let getElementsByClassName: JSString = "getElementsByClassName" static let getElementsByTagName: JSString = "getElementsByTagName" - static let tagName: JSString = "tagName" - static let classList: JSString = "classList" - static let getAttributeNames: JSString = "getAttributeNames" + static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" + static let hasAttribute: JSString = "hasAttribute" static let hasAttributeNS: JSString = "hasAttributeNS" - static let getAttributeNodeNS: JSString = "getAttributeNodeNS" + static let hasAttributes: JSString = "hasAttributes" + static let id: JSString = "id" static let insertAdjacentElement: JSString = "insertAdjacentElement" + static let insertAdjacentText: JSString = "insertAdjacentText" + static let localName: JSString = "localName" + static let matches: JSString = "matches" static let namespaceURI: JSString = "namespaceURI" - static let setAttributeNode: JSString = "setAttributeNode" - static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" - static let getElementsByClassName: JSString = "getElementsByClassName" + static let prefix: JSString = "prefix" + static let removeAttribute: JSString = "removeAttribute" + static let removeAttributeNS: JSString = "removeAttributeNS" + static let removeAttributeNode: JSString = "removeAttributeNode" static let setAttribute: JSString = "setAttribute" - static let matches: JSString = "matches" - static let insertAdjacentText: JSString = "insertAdjacentText" static let setAttributeNS: JSString = "setAttributeNS" - static let removeAttribute: JSString = "removeAttribute" - static let closest: JSString = "closest" - static let prefix: JSString = "prefix" - static let attachShadow: JSString = "attachShadow" - static let className: JSString = "className" + static let setAttributeNode: JSString = "setAttributeNode" + static let setAttributeNodeNS: JSString = "setAttributeNodeNS" static let shadowRoot: JSString = "shadowRoot" - static let attributes: JSString = "attributes" static let slot: JSString = "slot" - static let id: JSString = "id" - static let getAttributeNS: JSString = "getAttributeNS" - static let localName: JSString = "localName" + static let tagName: JSString = "tagName" + static let toggleAttribute: JSString = "toggleAttribute" + static let webkitMatchesSelector: JSString = "webkitMatchesSelector" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -102,19 +102,19 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo } public func setAttribute(qualifiedName: String, value: String) { - _ = jsObject[Keys.setAttribute]!(qualifiedName.jsValue(), value.jsValue()) + jsObject[Keys.setAttribute]!(qualifiedName.jsValue(), value.jsValue()).fromJSValue()! } public func setAttributeNS(namespace: String?, qualifiedName: String, value: String) { - _ = jsObject[Keys.setAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()) + jsObject[Keys.setAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()).fromJSValue()! } public func removeAttribute(qualifiedName: String) { - _ = jsObject[Keys.removeAttribute]!(qualifiedName.jsValue()) + jsObject[Keys.removeAttribute]!(qualifiedName.jsValue()).fromJSValue()! } public func removeAttributeNS(namespace: String?, localName: String) { - _ = jsObject[Keys.removeAttributeNS]!(namespace.jsValue(), localName.jsValue()) + jsObject[Keys.removeAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func toggleAttribute(qualifiedName: String, force: Bool? = nil) -> Bool { @@ -185,6 +185,6 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo } public func insertAdjacentText(where: String, data: String) { - _ = jsObject[Keys.insertAdjacentText]!(`where`.jsValue(), data.jsValue()) + jsObject[Keys.insertAdjacentText]!(`where`.jsValue(), data.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ElementContentEditable.swift b/Sources/DOMKit/WebIDL/ElementContentEditable.swift index 4c6d2db0..247d6f9e 100644 --- a/Sources/DOMKit/WebIDL/ElementContentEditable.swift +++ b/Sources/DOMKit/WebIDL/ElementContentEditable.swift @@ -4,10 +4,10 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let enterKeyHint: JSString = "enterKeyHint" - static let isContentEditable: JSString = "isContentEditable" static let contentEditable: JSString = "contentEditable" + static let enterKeyHint: JSString = "enterKeyHint" static let inputMode: JSString = "inputMode" + static let isContentEditable: JSString = "isContentEditable" } public protocol ElementContentEditable: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index 15d67bfe..84860c06 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -7,16 +7,16 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public class var constructor: JSFunction { JSObject.global.ElementInternals.function! } private enum Keys { - static let setValidity: JSString = "setValidity" - static let setFormValue: JSString = "setFormValue" + static let checkValidity: JSString = "checkValidity" static let form: JSString = "form" + static let labels: JSString = "labels" + static let reportValidity: JSString = "reportValidity" + static let setFormValue: JSString = "setFormValue" + static let setValidity: JSString = "setValidity" + static let shadowRoot: JSString = "shadowRoot" + static let validationMessage: JSString = "validationMessage" static let validity: JSString = "validity" static let willValidate: JSString = "willValidate" - static let validationMessage: JSString = "validationMessage" - static let shadowRoot: JSString = "shadowRoot" - static let checkValidity: JSString = "checkValidity" - static let reportValidity: JSString = "reportValidity" - static let labels: JSString = "labels" } public let jsObject: JSObject @@ -35,14 +35,14 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public var shadowRoot: ShadowRoot? public func setFormValue(value: __UNSUPPORTED_UNION__?, state: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.setFormValue]!(value.jsValue(), state?.jsValue() ?? .undefined) + jsObject[Keys.setFormValue]!(value.jsValue(), state?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute public var form: HTMLFormElement? public func setValidity(flags: ValidityStateFlags? = nil, message: String? = nil, anchor: HTMLElement? = nil) { - _ = jsObject[Keys.setValidity]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined) + jsObject[Keys.setValidity]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ErrorEvent.swift b/Sources/DOMKit/WebIDL/ErrorEvent.swift index b6990dcd..62f30c88 100644 --- a/Sources/DOMKit/WebIDL/ErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/ErrorEvent.swift @@ -7,11 +7,11 @@ public class ErrorEvent: Event { override public class var constructor: JSFunction { JSObject.global.ErrorEvent.function! } private enum Keys { - static let message: JSString = "message" + static let colno: JSString = "colno" static let error: JSString = "error" - static let lineno: JSString = "lineno" static let filename: JSString = "filename" - static let colno: JSString = "colno" + static let lineno: JSString = "lineno" + static let message: JSString = "message" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/ErrorEventInit.swift b/Sources/DOMKit/WebIDL/ErrorEventInit.swift index 93d56c76..8b1fe11e 100644 --- a/Sources/DOMKit/WebIDL/ErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/ErrorEventInit.swift @@ -5,11 +5,11 @@ import JavaScriptKit public class ErrorEventInit: BridgedDictionary { private enum Keys { - static let message: JSString = "message" - static let lineno: JSString = "lineno" static let colno: JSString = "colno" - static let filename: JSString = "filename" static let error: JSString = "error" + static let filename: JSString = "filename" + static let lineno: JSString = "lineno" + static let message: JSString = "message" } public convenience init(message: String, filename: String, lineno: UInt32, colno: UInt32, error: JSValue) { diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index 1c45ea3e..aa15f52c 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -7,28 +7,28 @@ public class Event: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Event.function! } private enum Keys { - static let type: JSString = "type" - static let currentTarget: JSString = "currentTarget" - static let composedPath: JSString = "composedPath" - static let stopImmediatePropagation: JSString = "stopImmediatePropagation" - static let preventDefault: JSString = "preventDefault" - static let NONE: JSString = "NONE" - static let defaultPrevented: JSString = "defaultPrevented" - static let composed: JSString = "composed" - static let CAPTURING_PHASE: JSString = "CAPTURING_PHASE" - static let timeStamp: JSString = "timeStamp" - static let returnValue: JSString = "returnValue" - static let eventPhase: JSString = "eventPhase" - static let bubbles: JSString = "bubbles" static let AT_TARGET: JSString = "AT_TARGET" - static let srcElement: JSString = "srcElement" - static let stopPropagation: JSString = "stopPropagation" - static let target: JSString = "target" static let BUBBLING_PHASE: JSString = "BUBBLING_PHASE" + static let CAPTURING_PHASE: JSString = "CAPTURING_PHASE" + static let NONE: JSString = "NONE" + static let bubbles: JSString = "bubbles" static let cancelBubble: JSString = "cancelBubble" static let cancelable: JSString = "cancelable" + static let composed: JSString = "composed" + static let composedPath: JSString = "composedPath" + static let currentTarget: JSString = "currentTarget" + static let defaultPrevented: JSString = "defaultPrevented" + static let eventPhase: JSString = "eventPhase" static let initEvent: JSString = "initEvent" static let isTrusted: JSString = "isTrusted" + static let preventDefault: JSString = "preventDefault" + static let returnValue: JSString = "returnValue" + static let srcElement: JSString = "srcElement" + static let stopImmediatePropagation: JSString = "stopImmediatePropagation" + static let stopPropagation: JSString = "stopPropagation" + static let target: JSString = "target" + static let timeStamp: JSString = "timeStamp" + static let type: JSString = "type" } public let jsObject: JSObject @@ -82,14 +82,14 @@ public class Event: JSBridgedClass { public var eventPhase: UInt16 public func stopPropagation() { - _ = jsObject[Keys.stopPropagation]!() + jsObject[Keys.stopPropagation]!().fromJSValue()! } @ReadWriteAttribute public var cancelBubble: Bool public func stopImmediatePropagation() { - _ = jsObject[Keys.stopImmediatePropagation]!() + jsObject[Keys.stopImmediatePropagation]!().fromJSValue()! } @ReadonlyAttribute @@ -102,7 +102,7 @@ public class Event: JSBridgedClass { public var returnValue: Bool public func preventDefault() { - _ = jsObject[Keys.preventDefault]!() + jsObject[Keys.preventDefault]!().fromJSValue()! } @ReadonlyAttribute @@ -118,6 +118,6 @@ public class Event: JSBridgedClass { public var timeStamp: DOMHighResTimeStamp public func initEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil) { - _ = jsObject[Keys.initEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined) + jsObject[Keys.initEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/EventModifierInit.swift b/Sources/DOMKit/WebIDL/EventModifierInit.swift index f1aafba3..97435198 100644 --- a/Sources/DOMKit/WebIDL/EventModifierInit.swift +++ b/Sources/DOMKit/WebIDL/EventModifierInit.swift @@ -5,20 +5,20 @@ import JavaScriptKit public class EventModifierInit: BridgedDictionary { private enum Keys { - static let modifierFnLock: JSString = "modifierFnLock" - static let modifierNumLock: JSString = "modifierNumLock" - static let shiftKey: JSString = "shiftKey" - static let metaKey: JSString = "metaKey" - static let modifierFn: JSString = "modifierFn" - static let modifierSymbol: JSString = "modifierSymbol" - static let ctrlKey: JSString = "ctrlKey" static let altKey: JSString = "altKey" + static let ctrlKey: JSString = "ctrlKey" + static let metaKey: JSString = "metaKey" static let modifierAltGraph: JSString = "modifierAltGraph" - static let modifierHyper: JSString = "modifierHyper" static let modifierCapsLock: JSString = "modifierCapsLock" - static let modifierSymbolLock: JSString = "modifierSymbolLock" + static let modifierFn: JSString = "modifierFn" + static let modifierFnLock: JSString = "modifierFnLock" + static let modifierHyper: JSString = "modifierHyper" + static let modifierNumLock: JSString = "modifierNumLock" static let modifierScrollLock: JSString = "modifierScrollLock" static let modifierSuper: JSString = "modifierSuper" + static let modifierSymbol: JSString = "modifierSymbol" + static let modifierSymbolLock: JSString = "modifierSymbolLock" + static let shiftKey: JSString = "shiftKey" } public convenience init(ctrlKey: Bool, shiftKey: Bool, altKey: Bool, metaKey: Bool, modifierAltGraph: Bool, modifierCapsLock: Bool, modifierFn: Bool, modifierFnLock: Bool, modifierHyper: Bool, modifierNumLock: Bool, modifierScrollLock: Bool, modifierSuper: Bool, modifierSymbol: Bool, modifierSymbolLock: Bool) { diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index 2b25c647..3a10c9d5 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -7,16 +7,16 @@ public class EventSource: EventTarget { override public class var constructor: JSFunction { JSObject.global.EventSource.function! } private enum Keys { - static let onerror: JSString = "onerror" - static let close: JSString = "close" - static let OPEN: JSString = "OPEN" - static let readyState: JSString = "readyState" - static let withCredentials: JSString = "withCredentials" static let CLOSED: JSString = "CLOSED" - static let onmessage: JSString = "onmessage" - static let url: JSString = "url" static let CONNECTING: JSString = "CONNECTING" + static let OPEN: JSString = "OPEN" + static let close: JSString = "close" + static let onerror: JSString = "onerror" + static let onmessage: JSString = "onmessage" static let onopen: JSString = "onopen" + static let readyState: JSString = "readyState" + static let url: JSString = "url" + static let withCredentials: JSString = "withCredentials" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -58,6 +58,6 @@ public class EventSource: EventTarget { public var onerror: EventHandler public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/EventTarget.swift b/Sources/DOMKit/WebIDL/EventTarget.swift index 7ebd6414..2a5e4904 100644 --- a/Sources/DOMKit/WebIDL/EventTarget.swift +++ b/Sources/DOMKit/WebIDL/EventTarget.swift @@ -8,8 +8,8 @@ public class EventTarget: JSBridgedClass { private enum Keys { static let addEventListener: JSString = "addEventListener" - static let removeEventListener: JSString = "removeEventListener" static let dispatchEvent: JSString = "dispatchEvent" + static let removeEventListener: JSString = "removeEventListener" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/External.swift b/Sources/DOMKit/WebIDL/External.swift index 0cd7fd57..dcdbef4c 100644 --- a/Sources/DOMKit/WebIDL/External.swift +++ b/Sources/DOMKit/WebIDL/External.swift @@ -7,8 +7,8 @@ public class External: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.External.function! } private enum Keys { - static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" static let AddSearchProvider: JSString = "AddSearchProvider" + static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" } public let jsObject: JSObject @@ -18,10 +18,10 @@ public class External: JSBridgedClass { } public func AddSearchProvider() { - _ = jsObject[Keys.AddSearchProvider]!() + jsObject[Keys.AddSearchProvider]!().fromJSValue()! } public func IsSearchProviderInstalled() { - _ = jsObject[Keys.IsSearchProviderInstalled]!() + jsObject[Keys.IsSearchProviderInstalled]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FileList.swift b/Sources/DOMKit/WebIDL/FileList.swift index bfe0837c..ff5bb675 100644 --- a/Sources/DOMKit/WebIDL/FileList.swift +++ b/Sources/DOMKit/WebIDL/FileList.swift @@ -18,7 +18,7 @@ public class FileList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: Int) -> File? { + public subscript(key: UInt32) -> File? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index e958a9ab..2d877801 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -7,23 +7,23 @@ public class FileReader: EventTarget { override public class var constructor: JSFunction { JSObject.global.FileReader.function! } private enum Keys { - static let onerror: JSString = "onerror" - static let onloadend: JSString = "onloadend" static let DONE: JSString = "DONE" - static let onload: JSString = "onload" static let EMPTY: JSString = "EMPTY" - static let readAsDataURL: JSString = "readAsDataURL" + static let LOADING: JSString = "LOADING" + static let abort: JSString = "abort" + static let error: JSString = "error" + static let onabort: JSString = "onabort" + static let onerror: JSString = "onerror" + static let onload: JSString = "onload" + static let onloadend: JSString = "onloadend" static let onloadstart: JSString = "onloadstart" - static let readyState: JSString = "readyState" static let onprogress: JSString = "onprogress" static let readAsArrayBuffer: JSString = "readAsArrayBuffer" - static let onabort: JSString = "onabort" - static let result: JSString = "result" - static let error: JSString = "error" static let readAsBinaryString: JSString = "readAsBinaryString" - static let abort: JSString = "abort" + static let readAsDataURL: JSString = "readAsDataURL" static let readAsText: JSString = "readAsText" - static let LOADING: JSString = "LOADING" + static let readyState: JSString = "readyState" + static let result: JSString = "result" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -44,23 +44,23 @@ public class FileReader: EventTarget { } public func readAsArrayBuffer(blob: Blob) { - _ = jsObject[Keys.readAsArrayBuffer]!(blob.jsValue()) + jsObject[Keys.readAsArrayBuffer]!(blob.jsValue()).fromJSValue()! } public func readAsBinaryString(blob: Blob) { - _ = jsObject[Keys.readAsBinaryString]!(blob.jsValue()) + jsObject[Keys.readAsBinaryString]!(blob.jsValue()).fromJSValue()! } public func readAsText(blob: Blob, encoding: String? = nil) { - _ = jsObject[Keys.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined) + jsObject[Keys.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined).fromJSValue()! } public func readAsDataURL(blob: Blob) { - _ = jsObject[Keys.readAsDataURL]!(blob.jsValue()) + jsObject[Keys.readAsDataURL]!(blob.jsValue()).fromJSValue()! } public func abort() { - _ = jsObject[Keys.abort]!() + jsObject[Keys.abort]!().fromJSValue()! } public static let EMPTY: UInt16 = 0 diff --git a/Sources/DOMKit/WebIDL/FileReaderSync.swift b/Sources/DOMKit/WebIDL/FileReaderSync.swift index f3f69430..5dd598be 100644 --- a/Sources/DOMKit/WebIDL/FileReaderSync.swift +++ b/Sources/DOMKit/WebIDL/FileReaderSync.swift @@ -7,10 +7,10 @@ public class FileReaderSync: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.FileReaderSync.function! } private enum Keys { - static let readAsText: JSString = "readAsText" - static let readAsBinaryString: JSString = "readAsBinaryString" static let readAsArrayBuffer: JSString = "readAsArrayBuffer" + static let readAsBinaryString: JSString = "readAsBinaryString" static let readAsDataURL: JSString = "readAsDataURL" + static let readAsText: JSString = "readAsText" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index f2ee479d..25915174 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -7,12 +7,12 @@ public class FormData: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.FormData.function! } private enum Keys { - static let set: JSString = "set" - static let get: JSString = "get" static let append: JSString = "append" static let delete: JSString = "delete" - static let has: JSString = "has" + static let get: JSString = "get" static let getAll: JSString = "getAll" + static let has: JSString = "has" + static let set: JSString = "set" } public let jsObject: JSObject @@ -26,15 +26,15 @@ public class FormData: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - _ = jsObject[Keys.append]!(name.jsValue(), value.jsValue()) + jsObject[Keys.append]!(name.jsValue(), value.jsValue()).fromJSValue()! } public func append(name: String, blobValue: Blob, filename: String? = nil) { - _ = jsObject[Keys.append]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) + jsObject[Keys.append]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined).fromJSValue()! } public func delete(name: String) { - _ = jsObject[Keys.delete]!(name.jsValue()) + jsObject[Keys.delete]!(name.jsValue()).fromJSValue()! } public func get(name: String) -> FormDataEntryValue? { @@ -50,11 +50,11 @@ public class FormData: JSBridgedClass, Sequence { } public func set(name: String, value: String) { - _ = jsObject[Keys.set]!(name.jsValue(), value.jsValue()) + jsObject[Keys.set]!(name.jsValue(), value.jsValue()).fromJSValue()! } public func set(name: String, blobValue: Blob, filename: String? = nil) { - _ = jsObject[Keys.set]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) + jsObject[Keys.set]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined).fromJSValue()! } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index 848cb002..553cd0a5 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -4,74 +4,74 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { + static let onabort: JSString = "onabort" + static let onauxclick: JSString = "onauxclick" + static let onblur: JSString = "onblur" + static let oncancel: JSString = "oncancel" + static let oncanplay: JSString = "oncanplay" + static let oncanplaythrough: JSString = "oncanplaythrough" + static let onchange: JSString = "onchange" static let onclick: JSString = "onclick" + static let onclose: JSString = "onclose" + static let oncontextlost: JSString = "oncontextlost" + static let oncontextmenu: JSString = "oncontextmenu" + static let oncontextrestored: JSString = "oncontextrestored" + static let oncuechange: JSString = "oncuechange" static let ondblclick: JSString = "ondblclick" + static let ondrag: JSString = "ondrag" + static let ondragend: JSString = "ondragend" + static let ondragenter: JSString = "ondragenter" + static let ondragleave: JSString = "ondragleave" + static let ondragover: JSString = "ondragover" + static let ondragstart: JSString = "ondragstart" static let ondrop: JSString = "ondrop" - static let onloadedmetadata: JSString = "onloadedmetadata" - static let onchange: JSString = "onchange" + static let ondurationchange: JSString = "ondurationchange" + static let onemptied: JSString = "onemptied" + static let onended: JSString = "onended" + static let onerror: JSString = "onerror" + static let onfocus: JSString = "onfocus" + static let onformdata: JSString = "onformdata" + static let oninput: JSString = "oninput" static let oninvalid: JSString = "oninvalid" + static let onkeydown: JSString = "onkeydown" + static let onkeypress: JSString = "onkeypress" + static let onkeyup: JSString = "onkeyup" + static let onload: JSString = "onload" + static let onloadeddata: JSString = "onloadeddata" + static let onloadedmetadata: JSString = "onloadedmetadata" + static let onloadstart: JSString = "onloadstart" + static let onmousedown: JSString = "onmousedown" + static let onmouseenter: JSString = "onmouseenter" static let onmouseleave: JSString = "onmouseleave" - static let onplay: JSString = "onplay" - static let onresize: JSString = "onresize" - static let onwaiting: JSString = "onwaiting" - static let onauxclick: JSString = "onauxclick" + static let onmousemove: JSString = "onmousemove" + static let onmouseout: JSString = "onmouseout" + static let onmouseover: JSString = "onmouseover" static let onmouseup: JSString = "onmouseup" - static let onsuspend: JSString = "onsuspend" static let onpause: JSString = "onpause" - static let onwebkittransitionend: JSString = "onwebkittransitionend" - static let ondragend: JSString = "ondragend" - static let onkeypress: JSString = "onkeypress" - static let ontoggle: JSString = "ontoggle" - static let onstalled: JSString = "onstalled" - static let ondurationchange: JSString = "ondurationchange" - static let onselect: JSString = "onselect" - static let onmousemove: JSString = "onmousemove" + static let onplay: JSString = "onplay" + static let onplaying: JSString = "onplaying" + static let onprogress: JSString = "onprogress" static let onratechange: JSString = "onratechange" - static let onwebkitanimationstart: JSString = "onwebkitanimationstart" - static let ondragleave: JSString = "ondragleave" - static let oncontextrestored: JSString = "oncontextrestored" - static let ondragstart: JSString = "ondragstart" - static let onloadstart: JSString = "onloadstart" - static let onmouseover: JSString = "onmouseover" + static let onreset: JSString = "onreset" + static let onresize: JSString = "onresize" + static let onscroll: JSString = "onscroll" static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" - static let onblur: JSString = "onblur" - static let onload: JSString = "onload" - static let oncontextlost: JSString = "oncontextlost" - static let oncuechange: JSString = "oncuechange" - static let ondragover: JSString = "ondragover" - static let onformdata: JSString = "onformdata" - static let onended: JSString = "onended" - static let onwebkitanimationiteration: JSString = "onwebkitanimationiteration" - static let onabort: JSString = "onabort" static let onseeked: JSString = "onseeked" - static let ontimeupdate: JSString = "ontimeupdate" - static let oncanplaythrough: JSString = "oncanplaythrough" - static let onemptied: JSString = "onemptied" - static let onerror: JSString = "onerror" + static let onseeking: JSString = "onseeking" + static let onselect: JSString = "onselect" + static let onslotchange: JSString = "onslotchange" + static let onstalled: JSString = "onstalled" static let onsubmit: JSString = "onsubmit" - static let onclose: JSString = "onclose" - static let oncanplay: JSString = "oncanplay" - static let onscroll: JSString = "onscroll" + static let onsuspend: JSString = "onsuspend" + static let ontimeupdate: JSString = "ontimeupdate" + static let ontoggle: JSString = "ontoggle" static let onvolumechange: JSString = "onvolumechange" - static let onplaying: JSString = "onplaying" - static let onloadeddata: JSString = "onloadeddata" - static let oninput: JSString = "oninput" - static let onmousedown: JSString = "onmousedown" - static let onwheel: JSString = "onwheel" + static let onwaiting: JSString = "onwaiting" static let onwebkitanimationend: JSString = "onwebkitanimationend" - static let oncancel: JSString = "oncancel" - static let onprogress: JSString = "onprogress" - static let onseeking: JSString = "onseeking" - static let onmouseout: JSString = "onmouseout" - static let onfocus: JSString = "onfocus" - static let onreset: JSString = "onreset" - static let onslotchange: JSString = "onslotchange" - static let onkeyup: JSString = "onkeyup" - static let onkeydown: JSString = "onkeydown" - static let onmouseenter: JSString = "onmouseenter" - static let oncontextmenu: JSString = "oncontextmenu" - static let ondragenter: JSString = "ondragenter" - static let ondrag: JSString = "ondrag" + static let onwebkitanimationiteration: JSString = "onwebkitanimationiteration" + static let onwebkitanimationstart: JSString = "onwebkitanimationstart" + static let onwebkittransitionend: JSString = "onwebkittransitionend" + static let onwheel: JSString = "onwheel" } public protocol GlobalEventHandlers: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift index c996c038..c627f1b7 100644 --- a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -7,9 +7,9 @@ public class HTMLAllCollection: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.HTMLAllCollection.function! } private enum Keys { - static let namedItem: JSString = "namedItem" static let item: JSString = "item" static let length: JSString = "length" + static let namedItem: JSString = "namedItem" } public let jsObject: JSObject @@ -22,7 +22,7 @@ public class HTMLAllCollection: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Element { + public subscript(key: UInt32) -> Element { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift index 589dcd4b..2456233d 100644 --- a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift @@ -7,20 +7,20 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { override public class var constructor: JSFunction { JSObject.global.HTMLAnchorElement.function! } private enum Keys { - static let rel: JSString = "rel" static let charset: JSString = "charset" - static let target: JSString = "target" static let coords: JSString = "coords" + static let download: JSString = "download" + static let hreflang: JSString = "hreflang" static let name: JSString = "name" static let ping: JSString = "ping" - static let download: JSString = "download" - static let text: JSString = "text" - static let shape: JSString = "shape" static let referrerPolicy: JSString = "referrerPolicy" - static let type: JSString = "type" - static let rev: JSString = "rev" + static let rel: JSString = "rel" static let relList: JSString = "relList" - static let hreflang: JSString = "hreflang" + static let rev: JSString = "rev" + static let shape: JSString = "shape" + static let target: JSString = "target" + static let text: JSString = "text" + static let type: JSString = "type" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift index c108e128..22dcd8cc 100644 --- a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift @@ -7,16 +7,16 @@ public class HTMLAreaElement: HTMLElement, HTMLHyperlinkElementUtils { override public class var constructor: JSFunction { JSObject.global.HTMLAreaElement.function! } private enum Keys { - static let rel: JSString = "rel" static let alt: JSString = "alt" + static let coords: JSString = "coords" + static let download: JSString = "download" + static let noHref: JSString = "noHref" static let ping: JSString = "ping" + static let referrerPolicy: JSString = "referrerPolicy" + static let rel: JSString = "rel" static let relList: JSString = "relList" - static let noHref: JSString = "noHref" - static let download: JSString = "download" static let shape: JSString = "shape" - static let coords: JSString = "coords" static let target: JSString = "target" - static let referrerPolicy: JSString = "referrerPolicy" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift index d40be838..214a7fc1 100644 --- a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift @@ -7,10 +7,10 @@ public class HTMLBodyElement: HTMLElement, WindowEventHandlers { override public class var constructor: JSFunction { JSObject.global.HTMLBodyElement.function! } private enum Keys { + static let aLink: JSString = "aLink" static let background: JSString = "background" static let bgColor: JSString = "bgColor" static let link: JSString = "link" - static let aLink: JSString = "aLink" static let text: JSString = "text" static let vLink: JSString = "vLink" } diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift index 0fe2787a..ea877bbc 100644 --- a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -7,23 +7,23 @@ public class HTMLButtonElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLButtonElement.function! } private enum Keys { - static let formMethod: JSString = "formMethod" - static let setCustomValidity: JSString = "setCustomValidity" - static let name: JSString = "name" - static let reportValidity: JSString = "reportValidity" - static let labels: JSString = "labels" - static let willValidate: JSString = "willValidate" - static let formNoValidate: JSString = "formNoValidate" - static let formTarget: JSString = "formTarget" - static let value: JSString = "value" static let checkValidity: JSString = "checkValidity" - static let type: JSString = "type" static let disabled: JSString = "disabled" - static let validity: JSString = "validity" - static let formEnctype: JSString = "formEnctype" static let form: JSString = "form" static let formAction: JSString = "formAction" + static let formEnctype: JSString = "formEnctype" + static let formMethod: JSString = "formMethod" + static let formNoValidate: JSString = "formNoValidate" + static let formTarget: JSString = "formTarget" + static let labels: JSString = "labels" + static let name: JSString = "name" + static let reportValidity: JSString = "reportValidity" + static let setCustomValidity: JSString = "setCustomValidity" + static let type: JSString = "type" static let validationMessage: JSString = "validationMessage" + static let validity: JSString = "validity" + static let value: JSString = "value" + static let willValidate: JSString = "willValidate" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -96,7 +96,7 @@ public class HTMLButtonElement: HTMLElement { } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index 9d01226e..4b15cbb1 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -8,11 +8,11 @@ public class HTMLCanvasElement: HTMLElement { private enum Keys { static let getContext: JSString = "getContext" - static let toBlob: JSString = "toBlob" - static let width: JSString = "width" static let height: JSString = "height" + static let toBlob: JSString = "toBlob" static let toDataURL: JSString = "toDataURL" static let transferControlToOffscreen: JSString = "transferControlToOffscreen" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLCollection.swift b/Sources/DOMKit/WebIDL/HTMLCollection.swift index 452644a2..fcee1f5c 100644 --- a/Sources/DOMKit/WebIDL/HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLCollection.swift @@ -7,9 +7,9 @@ public class HTMLCollection: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.HTMLCollection.function! } private enum Keys { + static let item: JSString = "item" static let length: JSString = "length" static let namedItem: JSString = "namedItem" - static let item: JSString = "item" } public let jsObject: JSObject @@ -22,7 +22,7 @@ public class HTMLCollection: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Element? { + public subscript(key: UInt32) -> Element? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift index f6e93087..f4326bb1 100644 --- a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -7,11 +7,11 @@ public class HTMLDialogElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDialogElement.function! } private enum Keys { - static let show: JSString = "show" static let close: JSString = "close" - static let showModal: JSString = "showModal" - static let returnValue: JSString = "returnValue" static let open: JSString = "open" + static let returnValue: JSString = "returnValue" + static let show: JSString = "show" + static let showModal: JSString = "showModal" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -31,14 +31,14 @@ public class HTMLDialogElement: HTMLElement { public var returnValue: String public func show() { - _ = jsObject[Keys.show]!() + jsObject[Keys.show]!().fromJSValue()! } public func showModal() { - _ = jsObject[Keys.showModal]!() + jsObject[Keys.showModal]!().fromJSValue()! } public func close(returnValue: String? = nil) { - _ = jsObject[Keys.close]!(returnValue?.jsValue() ?? .undefined) + jsObject[Keys.close]!(returnValue?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 00e14dec..1fed310e 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -7,21 +7,21 @@ public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventH override public class var constructor: JSFunction { JSObject.global.HTMLElement.function! } private enum Keys { + static let accessKey: JSString = "accessKey" + static let accessKeyLabel: JSString = "accessKeyLabel" static let attachInternals: JSString = "attachInternals" - static let title: JSString = "title" - static let spellcheck: JSString = "spellcheck" - static let translate: JSString = "translate" - static let hidden: JSString = "hidden" + static let autocapitalize: JSString = "autocapitalize" static let click: JSString = "click" - static let draggable: JSString = "draggable" static let dir: JSString = "dir" - static let accessKey: JSString = "accessKey" - static let innerText: JSString = "innerText" - static let autocapitalize: JSString = "autocapitalize" - static let outerText: JSString = "outerText" + static let draggable: JSString = "draggable" + static let hidden: JSString = "hidden" static let inert: JSString = "inert" + static let innerText: JSString = "innerText" static let lang: JSString = "lang" - static let accessKeyLabel: JSString = "accessKeyLabel" + static let outerText: JSString = "outerText" + static let spellcheck: JSString = "spellcheck" + static let title: JSString = "title" + static let translate: JSString = "translate" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -64,7 +64,7 @@ public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventH public var inert: Bool public func click() { - _ = jsObject[Keys.click]!() + jsObject[Keys.click]!().fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift index a399a3b5..6300b909 100644 --- a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift @@ -7,13 +7,13 @@ public class HTMLEmbedElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLEmbedElement.function! } private enum Keys { - static let width: JSString = "width" - static let getSVGDocument: JSString = "getSVGDocument" static let align: JSString = "align" - static let type: JSString = "type" - static let src: JSString = "src" - static let name: JSString = "name" + static let getSVGDocument: JSString = "getSVGDocument" static let height: JSString = "height" + static let name: JSString = "name" + static let src: JSString = "src" + static let type: JSString = "type" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift index f946d713..14287627 100644 --- a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -8,15 +8,15 @@ public class HTMLFieldSetElement: HTMLElement { private enum Keys { static let checkValidity: JSString = "checkValidity" - static let type: JSString = "type" - static let name: JSString = "name" - static let validity: JSString = "validity" - static let validationMessage: JSString = "validationMessage" - static let setCustomValidity: JSString = "setCustomValidity" - static let form: JSString = "form" static let disabled: JSString = "disabled" static let elements: JSString = "elements" + static let form: JSString = "form" + static let name: JSString = "name" static let reportValidity: JSString = "reportValidity" + static let setCustomValidity: JSString = "setCustomValidity" + static let type: JSString = "type" + static let validationMessage: JSString = "validationMessage" + static let validity: JSString = "validity" static let willValidate: JSString = "willValidate" } @@ -69,6 +69,6 @@ public class HTMLFieldSetElement: HTMLElement { } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLFontElement.swift b/Sources/DOMKit/WebIDL/HTMLFontElement.swift index caf58baf..fbd96e8c 100644 --- a/Sources/DOMKit/WebIDL/HTMLFontElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFontElement.swift @@ -7,8 +7,8 @@ public class HTMLFontElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFontElement.function! } private enum Keys { - static let face: JSString = "face" static let color: JSString = "color" + static let face: JSString = "face" static let size: JSString = "size" } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index 59ddf66f..a9a151ac 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -7,24 +7,24 @@ public class HTMLFormElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFormElement.function! } private enum Keys { - static let reportValidity: JSString = "reportValidity" - static let rel: JSString = "rel" - static let autocomplete: JSString = "autocomplete" - static let name: JSString = "name" - static let method: JSString = "method" static let acceptCharset: JSString = "acceptCharset" - static let noValidate: JSString = "noValidate" - static let target: JSString = "target" - static let encoding: JSString = "encoding" - static let checkValidity: JSString = "checkValidity" static let action: JSString = "action" - static let length: JSString = "length" - static let submit: JSString = "submit" - static let requestSubmit: JSString = "requestSubmit" + static let autocomplete: JSString = "autocomplete" + static let checkValidity: JSString = "checkValidity" + static let elements: JSString = "elements" + static let encoding: JSString = "encoding" static let enctype: JSString = "enctype" + static let length: JSString = "length" + static let method: JSString = "method" + static let name: JSString = "name" + static let noValidate: JSString = "noValidate" + static let rel: JSString = "rel" static let relList: JSString = "relList" + static let reportValidity: JSString = "reportValidity" + static let requestSubmit: JSString = "requestSubmit" static let reset: JSString = "reset" - static let elements: JSString = "elements" + static let submit: JSString = "submit" + static let target: JSString = "target" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -87,7 +87,7 @@ public class HTMLFormElement: HTMLElement { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Element { + public subscript(key: UInt32) -> Element { jsObject[key].fromJSValue()! } @@ -96,15 +96,15 @@ public class HTMLFormElement: HTMLElement { } public func submit() { - _ = jsObject[Keys.submit]!() + jsObject[Keys.submit]!().fromJSValue()! } public func requestSubmit(submitter: HTMLElement? = nil) { - _ = jsObject[Keys.requestSubmit]!(submitter?.jsValue() ?? .undefined) + jsObject[Keys.requestSubmit]!(submitter?.jsValue() ?? .undefined).fromJSValue()! } public func reset() { - _ = jsObject[Keys.reset]!() + jsObject[Keys.reset]!().fromJSValue()! } public func checkValidity() -> Bool { diff --git a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift index 8d503525..974c779b 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift @@ -7,16 +7,16 @@ public class HTMLFrameElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFrameElement.function! } private enum Keys { + static let contentDocument: JSString = "contentDocument" static let contentWindow: JSString = "contentWindow" - static let src: JSString = "src" - static let name: JSString = "name" - static let scrolling: JSString = "scrolling" static let frameBorder: JSString = "frameBorder" - static let marginHeight: JSString = "marginHeight" static let longDesc: JSString = "longDesc" + static let marginHeight: JSString = "marginHeight" static let marginWidth: JSString = "marginWidth" + static let name: JSString = "name" static let noResize: JSString = "noResize" - static let contentDocument: JSString = "contentDocument" + static let scrolling: JSString = "scrolling" + static let src: JSString = "src" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLHRElement.swift b/Sources/DOMKit/WebIDL/HTMLHRElement.swift index e54acd9e..f08175cd 100644 --- a/Sources/DOMKit/WebIDL/HTMLHRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHRElement.swift @@ -7,11 +7,11 @@ public class HTMLHRElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLHRElement.function! } private enum Keys { - static let width: JSString = "width" - static let size: JSString = "size" static let align: JSString = "align" - static let noShade: JSString = "noShade" static let color: JSString = "color" + static let noShade: JSString = "noShade" + static let size: JSString = "size" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift index 28cd7ac6..1f636bc8 100644 --- a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift +++ b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let `protocol`: JSString = "protocol" - static let pathname: JSString = "pathname" - static let password: JSString = "password" - static let origin: JSString = "origin" - static let username: JSString = "username" static let hash: JSString = "hash" - static let href: JSString = "href" static let host: JSString = "host" static let hostname: JSString = "hostname" + static let href: JSString = "href" + static let origin: JSString = "origin" + static let password: JSString = "password" + static let pathname: JSString = "pathname" static let port: JSString = "port" + static let `protocol`: JSString = "protocol" static let search: JSString = "search" + static let username: JSString = "username" } public protocol HTMLHyperlinkElementUtils: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index 5cf217c2..9b541ecd 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -7,25 +7,25 @@ public class HTMLIFrameElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLIFrameElement.function! } private enum Keys { - static let frameBorder: JSString = "frameBorder" - static let sandbox: JSString = "sandbox" - static let contentWindow: JSString = "contentWindow" - static let referrerPolicy: JSString = "referrerPolicy" + static let align: JSString = "align" + static let allow: JSString = "allow" static let allowFullscreen: JSString = "allowFullscreen" static let contentDocument: JSString = "contentDocument" - static let marginWidth: JSString = "marginWidth" + static let contentWindow: JSString = "contentWindow" + static let frameBorder: JSString = "frameBorder" static let getSVGDocument: JSString = "getSVGDocument" static let height: JSString = "height" - static let src: JSString = "src" static let loading: JSString = "loading" - static let align: JSString = "align" - static let scrolling: JSString = "scrolling" static let longDesc: JSString = "longDesc" static let marginHeight: JSString = "marginHeight" - static let width: JSString = "width" - static let srcdoc: JSString = "srcdoc" + static let marginWidth: JSString = "marginWidth" static let name: JSString = "name" - static let allow: JSString = "allow" + static let referrerPolicy: JSString = "referrerPolicy" + static let sandbox: JSString = "sandbox" + static let scrolling: JSString = "scrolling" + static let src: JSString = "src" + static let srcdoc: JSString = "srcdoc" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index 659c1b76..d975bb67 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -7,30 +7,30 @@ public class HTMLImageElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLImageElement.function! } private enum Keys { - static let useMap: JSString = "useMap" - static let decoding: JSString = "decoding" - static let naturalHeight: JSString = "naturalHeight" - static let sizes: JSString = "sizes" + static let align: JSString = "align" static let alt: JSString = "alt" - static let lowsrc: JSString = "lowsrc" - static let vspace: JSString = "vspace" + static let border: JSString = "border" + static let complete: JSString = "complete" + static let crossOrigin: JSString = "crossOrigin" static let currentSrc: JSString = "currentSrc" + static let decode: JSString = "decode" + static let decoding: JSString = "decoding" + static let height: JSString = "height" + static let hspace: JSString = "hspace" + static let isMap: JSString = "isMap" + static let loading: JSString = "loading" static let longDesc: JSString = "longDesc" + static let lowsrc: JSString = "lowsrc" + static let name: JSString = "name" + static let naturalHeight: JSString = "naturalHeight" + static let naturalWidth: JSString = "naturalWidth" static let referrerPolicy: JSString = "referrerPolicy" + static let sizes: JSString = "sizes" static let src: JSString = "src" - static let hspace: JSString = "hspace" - static let border: JSString = "border" - static let decode: JSString = "decode" static let srcset: JSString = "srcset" + static let useMap: JSString = "useMap" + static let vspace: JSString = "vspace" static let width: JSString = "width" - static let name: JSString = "name" - static let complete: JSString = "complete" - static let loading: JSString = "loading" - static let height: JSString = "height" - static let naturalWidth: JSString = "naturalWidth" - static let crossOrigin: JSString = "crossOrigin" - static let align: JSString = "align" - static let isMap: JSString = "isMap" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -119,7 +119,7 @@ public class HTMLImageElement: HTMLElement { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func decode() async throws { let _promise: JSPromise = jsObject[Keys.decode]!().fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index 657f6de9..e7a5fa0b 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -7,60 +7,60 @@ public class HTMLInputElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLInputElement.function! } private enum Keys { - static let minLength: JSString = "minLength" + static let accept: JSString = "accept" static let align: JSString = "align" - static let step: JSString = "step" - static let valueAsDate: JSString = "valueAsDate" + static let alt: JSString = "alt" + static let autocomplete: JSString = "autocomplete" + static let checkValidity: JSString = "checkValidity" + static let checked: JSString = "checked" + static let defaultChecked: JSString = "defaultChecked" + static let defaultValue: JSString = "defaultValue" + static let dirName: JSString = "dirName" + static let disabled: JSString = "disabled" + static let files: JSString = "files" + static let form: JSString = "form" + static let formAction: JSString = "formAction" + static let formEnctype: JSString = "formEnctype" + static let formMethod: JSString = "formMethod" static let formNoValidate: JSString = "formNoValidate" static let formTarget: JSString = "formTarget" - static let list: JSString = "list" + static let height: JSString = "height" static let indeterminate: JSString = "indeterminate" - static let form: JSString = "form" - static let disabled: JSString = "disabled" static let labels: JSString = "labels" - static let placeholder: JSString = "placeholder" + static let list: JSString = "list" + static let max: JSString = "max" + static let maxLength: JSString = "maxLength" static let min: JSString = "min" - static let willValidate: JSString = "willValidate" - static let stepDown: JSString = "stepDown" - static let formAction: JSString = "formAction" - static let setSelectionRange: JSString = "setSelectionRange" - static let checkValidity: JSString = "checkValidity" - static let dirName: JSString = "dirName" - static let height: JSString = "height" - static let readOnly: JSString = "readOnly" + static let minLength: JSString = "minLength" + static let multiple: JSString = "multiple" + static let name: JSString = "name" static let pattern: JSString = "pattern" - static let defaultChecked: JSString = "defaultChecked" + static let placeholder: JSString = "placeholder" + static let readOnly: JSString = "readOnly" + static let reportValidity: JSString = "reportValidity" + static let required: JSString = "required" + static let select: JSString = "select" + static let selectionDirection: JSString = "selectionDirection" + static let selectionEnd: JSString = "selectionEnd" + static let selectionStart: JSString = "selectionStart" + static let setCustomValidity: JSString = "setCustomValidity" + static let setRangeText: JSString = "setRangeText" + static let setSelectionRange: JSString = "setSelectionRange" static let showPicker: JSString = "showPicker" - static let alt: JSString = "alt" - static let useMap: JSString = "useMap" static let size: JSString = "size" - static let value: JSString = "value" - static let formMethod: JSString = "formMethod" - static let selectionDirection: JSString = "selectionDirection" - static let maxLength: JSString = "maxLength" + static let src: JSString = "src" + static let step: JSString = "step" + static let stepDown: JSString = "stepDown" + static let stepUp: JSString = "stepUp" static let type: JSString = "type" - static let select: JSString = "select" - static let formEnctype: JSString = "formEnctype" - static let defaultValue: JSString = "defaultValue" + static let useMap: JSString = "useMap" + static let validationMessage: JSString = "validationMessage" static let validity: JSString = "validity" - static let required: JSString = "required" + static let value: JSString = "value" + static let valueAsDate: JSString = "valueAsDate" static let valueAsNumber: JSString = "valueAsNumber" static let width: JSString = "width" - static let reportValidity: JSString = "reportValidity" - static let checked: JSString = "checked" - static let validationMessage: JSString = "validationMessage" - static let setCustomValidity: JSString = "setCustomValidity" - static let selectionStart: JSString = "selectionStart" - static let accept: JSString = "accept" - static let files: JSString = "files" - static let setRangeText: JSString = "setRangeText" - static let name: JSString = "name" - static let max: JSString = "max" - static let multiple: JSString = "multiple" - static let selectionEnd: JSString = "selectionEnd" - static let src: JSString = "src" - static let stepUp: JSString = "stepUp" - static let autocomplete: JSString = "autocomplete" + static let willValidate: JSString = "willValidate" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -225,11 +225,11 @@ public class HTMLInputElement: HTMLElement { public var width: UInt32 public func stepUp(n: Int32? = nil) { - _ = jsObject[Keys.stepUp]!(n?.jsValue() ?? .undefined) + jsObject[Keys.stepUp]!(n?.jsValue() ?? .undefined).fromJSValue()! } public func stepDown(n: Int32? = nil) { - _ = jsObject[Keys.stepDown]!(n?.jsValue() ?? .undefined) + jsObject[Keys.stepDown]!(n?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -250,14 +250,14 @@ public class HTMLInputElement: HTMLElement { } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! } @ReadonlyAttribute public var labels: NodeList? public func select() { - _ = jsObject[Keys.select]!() + jsObject[Keys.select]!().fromJSValue()! } @ReadWriteAttribute @@ -270,19 +270,19 @@ public class HTMLInputElement: HTMLElement { public var selectionDirection: String? public func setRangeText(replacement: String) { - _ = jsObject[Keys.setRangeText]!(replacement.jsValue()) + jsObject[Keys.setRangeText]!(replacement.jsValue()).fromJSValue()! } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - _ = jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined).fromJSValue()! } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - _ = jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined).fromJSValue()! } public func showPicker() { - _ = jsObject[Keys.showPicker]!() + jsObject[Keys.showPicker]!().fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift index e07aa9a9..aadcc812 100644 --- a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift @@ -7,9 +7,9 @@ public class HTMLLabelElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLLabelElement.function! } private enum Keys { - static let htmlFor: JSString = "htmlFor" static let control: JSString = "control" static let form: JSString = "form" + static let htmlFor: JSString = "htmlFor" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift index 84cf843c..c0e8dd02 100644 --- a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift @@ -7,24 +7,24 @@ public class HTMLLinkElement: HTMLElement, LinkStyle { override public class var constructor: JSFunction { JSObject.global.HTMLLinkElement.function! } private enum Keys { - static let type: JSString = "type" - static let hreflang: JSString = "hreflang" + static let `as`: JSString = "as" + static let blocking: JSString = "blocking" static let charset: JSString = "charset" - static let target: JSString = "target" - static let rev: JSString = "rev" + static let crossOrigin: JSString = "crossOrigin" + static let disabled: JSString = "disabled" static let href: JSString = "href" - static let media: JSString = "media" - static let relList: JSString = "relList" + static let hreflang: JSString = "hreflang" static let imageSizes: JSString = "imageSizes" - static let crossOrigin: JSString = "crossOrigin" - static let blocking: JSString = "blocking" - static let referrerPolicy: JSString = "referrerPolicy" - static let `as`: JSString = "as" + static let imageSrcset: JSString = "imageSrcset" static let integrity: JSString = "integrity" + static let media: JSString = "media" + static let referrerPolicy: JSString = "referrerPolicy" static let rel: JSString = "rel" + static let relList: JSString = "relList" + static let rev: JSString = "rev" static let sizes: JSString = "sizes" - static let imageSrcset: JSString = "imageSrcset" - static let disabled: JSString = "disabled" + static let target: JSString = "target" + static let type: JSString = "type" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift index 2c1767ca..081f57f2 100644 --- a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift @@ -8,18 +8,18 @@ public class HTMLMarqueeElement: HTMLElement { private enum Keys { static let behavior: JSString = "behavior" - static let width: JSString = "width" - static let loop: JSString = "loop" - static let scrollDelay: JSString = "scrollDelay" - static let direction: JSString = "direction" static let bgColor: JSString = "bgColor" + static let direction: JSString = "direction" + static let height: JSString = "height" static let hspace: JSString = "hspace" + static let loop: JSString = "loop" + static let scrollAmount: JSString = "scrollAmount" + static let scrollDelay: JSString = "scrollDelay" static let start: JSString = "start" + static let stop: JSString = "stop" static let trueSpeed: JSString = "trueSpeed" static let vspace: JSString = "vspace" - static let stop: JSString = "stop" - static let height: JSString = "height" - static let scrollAmount: JSString = "scrollAmount" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -75,10 +75,10 @@ public class HTMLMarqueeElement: HTMLElement { public var width: String public func start() { - _ = jsObject[Keys.start]!() + jsObject[Keys.start]!().fromJSValue()! } public func stop() { - _ = jsObject[Keys.stop]!() + jsObject[Keys.stop]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index e67b9171..6e480b70 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -7,50 +7,50 @@ public class HTMLMediaElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMediaElement.function! } private enum Keys { - static let currentTime: JSString = "currentTime" - static let NETWORK_NO_SOURCE: JSString = "NETWORK_NO_SOURCE" + static let HAVE_CURRENT_DATA: JSString = "HAVE_CURRENT_DATA" + static let HAVE_ENOUGH_DATA: JSString = "HAVE_ENOUGH_DATA" + static let HAVE_FUTURE_DATA: JSString = "HAVE_FUTURE_DATA" + static let HAVE_METADATA: JSString = "HAVE_METADATA" static let HAVE_NOTHING: JSString = "HAVE_NOTHING" - static let buffered: JSString = "buffered" + static let NETWORK_EMPTY: JSString = "NETWORK_EMPTY" static let NETWORK_IDLE: JSString = "NETWORK_IDLE" - static let paused: JSString = "paused" - static let play: JSString = "play" - static let preload: JSString = "preload" - static let seekable: JSString = "seekable" - static let currentSrc: JSString = "currentSrc" - static let fastSeek: JSString = "fastSeek" - static let audioTracks: JSString = "audioTracks" - static let volume: JSString = "volume" - static let networkState: JSString = "networkState" - static let getStartDate: JSString = "getStartDate" - static let HAVE_ENOUGH_DATA: JSString = "HAVE_ENOUGH_DATA" - static let playbackRate: JSString = "playbackRate" + static let NETWORK_LOADING: JSString = "NETWORK_LOADING" + static let NETWORK_NO_SOURCE: JSString = "NETWORK_NO_SOURCE" static let addTextTrack: JSString = "addTextTrack" - static let seeking: JSString = "seeking" + static let audioTracks: JSString = "audioTracks" + static let autoplay: JSString = "autoplay" + static let buffered: JSString = "buffered" static let canPlayType: JSString = "canPlayType" - static let duration: JSString = "duration" + static let controls: JSString = "controls" + static let crossOrigin: JSString = "crossOrigin" + static let currentSrc: JSString = "currentSrc" + static let currentTime: JSString = "currentTime" + static let defaultMuted: JSString = "defaultMuted" static let defaultPlaybackRate: JSString = "defaultPlaybackRate" + static let duration: JSString = "duration" + static let ended: JSString = "ended" + static let error: JSString = "error" + static let fastSeek: JSString = "fastSeek" + static let getStartDate: JSString = "getStartDate" + static let load: JSString = "load" static let loop: JSString = "loop" + static let muted: JSString = "muted" + static let networkState: JSString = "networkState" static let pause: JSString = "pause" - static let HAVE_METADATA: JSString = "HAVE_METADATA" - static let textTracks: JSString = "textTracks" - static let HAVE_CURRENT_DATA: JSString = "HAVE_CURRENT_DATA" - static let NETWORK_EMPTY: JSString = "NETWORK_EMPTY" + static let paused: JSString = "paused" + static let play: JSString = "play" + static let playbackRate: JSString = "playbackRate" + static let played: JSString = "played" + static let preload: JSString = "preload" static let preservesPitch: JSString = "preservesPitch" - static let muted: JSString = "muted" + static let readyState: JSString = "readyState" + static let seekable: JSString = "seekable" + static let seeking: JSString = "seeking" static let src: JSString = "src" - static let load: JSString = "load" - static let HAVE_FUTURE_DATA: JSString = "HAVE_FUTURE_DATA" - static let played: JSString = "played" - static let error: JSString = "error" static let srcObject: JSString = "srcObject" - static let controls: JSString = "controls" - static let NETWORK_LOADING: JSString = "NETWORK_LOADING" - static let autoplay: JSString = "autoplay" - static let readyState: JSString = "readyState" - static let ended: JSString = "ended" - static let defaultMuted: JSString = "defaultMuted" + static let textTracks: JSString = "textTracks" static let videoTracks: JSString = "videoTracks" - static let crossOrigin: JSString = "crossOrigin" + static let volume: JSString = "volume" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -118,7 +118,7 @@ public class HTMLMediaElement: HTMLElement { public var buffered: TimeRanges public func load() { - _ = jsObject[Keys.load]!() + jsObject[Keys.load]!().fromJSValue()! } public func canPlayType(type: String) -> CanPlayTypeResult { @@ -145,7 +145,7 @@ public class HTMLMediaElement: HTMLElement { public var currentTime: Double public func fastSeek(time: Double) { - _ = jsObject[Keys.fastSeek]!(time.jsValue()) + jsObject[Keys.fastSeek]!(time.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -189,11 +189,11 @@ public class HTMLMediaElement: HTMLElement { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func play() async throws { let _promise: JSPromise = jsObject[Keys.play]!().fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } public func pause() { - _ = jsObject[Keys.pause]!() + jsObject[Keys.pause]!().fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift index c9a710a3..d050ee64 100644 --- a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift @@ -7,11 +7,11 @@ public class HTMLMetaElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMetaElement.function! } private enum Keys { - static let name: JSString = "name" - static let scheme: JSString = "scheme" static let content: JSString = "content" static let httpEquiv: JSString = "httpEquiv" static let media: JSString = "media" + static let name: JSString = "name" + static let scheme: JSString = "scheme" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift index 58285d7a..3ae6bcd2 100644 --- a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift @@ -7,13 +7,13 @@ public class HTMLMeterElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMeterElement.function! } private enum Keys { - static let optimum: JSString = "optimum" - static let value: JSString = "value" - static let min: JSString = "min" - static let low: JSString = "low" - static let max: JSString = "max" static let high: JSString = "high" static let labels: JSString = "labels" + static let low: JSString = "low" + static let max: JSString = "max" + static let min: JSString = "min" + static let optimum: JSString = "optimum" + static let value: JSString = "value" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLModElement.swift b/Sources/DOMKit/WebIDL/HTMLModElement.swift index 9a7dc9e0..a2e64fbc 100644 --- a/Sources/DOMKit/WebIDL/HTMLModElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLModElement.swift @@ -7,8 +7,8 @@ public class HTMLModElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLModElement.function! } private enum Keys { - static let dateTime: JSString = "dateTime" static let cite: JSString = "cite" + static let dateTime: JSString = "dateTime" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLOListElement.swift b/Sources/DOMKit/WebIDL/HTMLOListElement.swift index 7533883f..4fa3ea76 100644 --- a/Sources/DOMKit/WebIDL/HTMLOListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOListElement.swift @@ -7,10 +7,10 @@ public class HTMLOListElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOListElement.function! } private enum Keys { - static let type: JSString = "type" static let compact: JSString = "compact" - static let start: JSString = "start" static let reversed: JSString = "reversed" + static let start: JSString = "start" + static let type: JSString = "type" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift index 10ff6ec6..61f9c1a6 100644 --- a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -7,32 +7,32 @@ public class HTMLObjectElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLObjectElement.function! } private enum Keys { - static let hspace: JSString = "hspace" + static let align: JSString = "align" static let archive: JSString = "archive" - static let type: JSString = "type" - static let contentWindow: JSString = "contentWindow" - static let reportValidity: JSString = "reportValidity" - static let getSVGDocument: JSString = "getSVGDocument" - static let validity: JSString = "validity" - static let height: JSString = "height" - static let validationMessage: JSString = "validationMessage" - static let standby: JSString = "standby" - static let contentDocument: JSString = "contentDocument" - static let codeType: JSString = "codeType" static let border: JSString = "border" + static let checkValidity: JSString = "checkValidity" static let code: JSString = "code" + static let codeBase: JSString = "codeBase" + static let codeType: JSString = "codeType" + static let contentDocument: JSString = "contentDocument" + static let contentWindow: JSString = "contentWindow" + static let data: JSString = "data" static let declare: JSString = "declare" - static let setCustomValidity: JSString = "setCustomValidity" - static let checkValidity: JSString = "checkValidity" - static let width: JSString = "width" static let form: JSString = "form" + static let getSVGDocument: JSString = "getSVGDocument" + static let height: JSString = "height" + static let hspace: JSString = "hspace" + static let name: JSString = "name" + static let reportValidity: JSString = "reportValidity" + static let setCustomValidity: JSString = "setCustomValidity" + static let standby: JSString = "standby" + static let type: JSString = "type" static let useMap: JSString = "useMap" - static let align: JSString = "align" + static let validationMessage: JSString = "validationMessage" + static let validity: JSString = "validity" static let vspace: JSString = "vspace" + static let width: JSString = "width" static let willValidate: JSString = "willValidate" - static let name: JSString = "name" - static let codeBase: JSString = "codeBase" - static let data: JSString = "data" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -111,7 +111,7 @@ public class HTMLObjectElement: HTMLElement { } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift index 82da7f8f..c3b98f05 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift @@ -7,8 +7,8 @@ public class HTMLOptGroupElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOptGroupElement.function! } private enum Keys { - static let label: JSString = "label" static let disabled: JSString = "disabled" + static let label: JSString = "label" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift index bab56806..9ea9d3e0 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift @@ -7,14 +7,14 @@ public class HTMLOptionElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOptionElement.function! } private enum Keys { - static let selected: JSString = "selected" + static let defaultSelected: JSString = "defaultSelected" static let disabled: JSString = "disabled" - static let label: JSString = "label" - static let value: JSString = "value" - static let index: JSString = "index" static let form: JSString = "form" + static let index: JSString = "index" + static let label: JSString = "label" + static let selected: JSString = "selected" static let text: JSString = "text" - static let defaultSelected: JSString = "defaultSelected" + static let value: JSString = "value" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift index 84f87514..0204304e 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -7,10 +7,10 @@ public class HTMLOptionsCollection: HTMLCollection { override public class var constructor: JSFunction { JSObject.global.HTMLOptionsCollection.function! } private enum Keys { - static let length: JSString = "length" - static let selectedIndex: JSString = "selectedIndex" static let add: JSString = "add" + static let length: JSString = "length" static let remove: JSString = "remove" + static let selectedIndex: JSString = "selectedIndex" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -25,14 +25,14 @@ public class HTMLOptionsCollection: HTMLCollection { set { _length.wrappedValue = newValue } } - // XXX: unsupported setter for keys of type UInt32 + // XXX: unsupported setter for keys of type `UInt32` public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined) + jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined).fromJSValue()! } public func remove(index: Int32) { - _ = jsObject[Keys.remove]!(index.jsValue()) + jsObject[Keys.remove]!(index.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift index 2df302c1..f5186ce3 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift @@ -4,12 +4,12 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let tabIndex: JSString = "tabIndex" - static let dataset: JSString = "dataset" static let autofocus: JSString = "autofocus" - static let nonce: JSString = "nonce" - static let focus: JSString = "focus" static let blur: JSString = "blur" + static let dataset: JSString = "dataset" + static let focus: JSString = "focus" + static let nonce: JSString = "nonce" + static let tabIndex: JSString = "tabIndex" } public protocol HTMLOrSVGElement: JSBridgedClass {} @@ -32,10 +32,10 @@ public extension HTMLOrSVGElement { } func focus(options: FocusOptions? = nil) { - _ = jsObject[Keys.focus]!(options?.jsValue() ?? .undefined) + jsObject[Keys.focus]!(options?.jsValue() ?? .undefined).fromJSValue()! } func blur() { - _ = jsObject[Keys.blur]!() + jsObject[Keys.blur]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift index 179ee860..56b2e729 100644 --- a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -7,19 +7,19 @@ public class HTMLOutputElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOutputElement.function! } private enum Keys { - static let name: JSString = "name" - static let validationMessage: JSString = "validationMessage" static let checkValidity: JSString = "checkValidity" - static let type: JSString = "type" - static let willValidate: JSString = "willValidate" - static let validity: JSString = "validity" + static let defaultValue: JSString = "defaultValue" static let form: JSString = "form" - static let labels: JSString = "labels" static let htmlFor: JSString = "htmlFor" + static let labels: JSString = "labels" + static let name: JSString = "name" static let reportValidity: JSString = "reportValidity" - static let defaultValue: JSString = "defaultValue" static let setCustomValidity: JSString = "setCustomValidity" + static let type: JSString = "type" + static let validationMessage: JSString = "validationMessage" + static let validity: JSString = "validity" static let value: JSString = "value" + static let willValidate: JSString = "willValidate" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -76,7 +76,7 @@ public class HTMLOutputElement: HTMLElement { } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLParamElement.swift b/Sources/DOMKit/WebIDL/HTMLParamElement.swift index b3ac15e0..5cf4966b 100644 --- a/Sources/DOMKit/WebIDL/HTMLParamElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParamElement.swift @@ -7,10 +7,10 @@ public class HTMLParamElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLParamElement.function! } private enum Keys { - static let type: JSString = "type" - static let valueType: JSString = "valueType" static let name: JSString = "name" + static let type: JSString = "type" static let value: JSString = "value" + static let valueType: JSString = "valueType" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift index c2d6ffb0..7298c345 100644 --- a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift @@ -8,9 +8,9 @@ public class HTMLProgressElement: HTMLElement { private enum Keys { static let labels: JSString = "labels" - static let value: JSString = "value" - static let position: JSString = "position" static let max: JSString = "max" + static let position: JSString = "position" + static let value: JSString = "value" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift index 4c893c59..5d819ce2 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -7,20 +7,20 @@ public class HTMLScriptElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLScriptElement.function! } private enum Keys { - static let supports: JSString = "supports" - static let type: JSString = "type" - static let noModule: JSString = "noModule" - static let crossOrigin: JSString = "crossOrigin" + static let async: JSString = "async" static let blocking: JSString = "blocking" - static let event: JSString = "event" - static let src: JSString = "src" static let charset: JSString = "charset" + static let crossOrigin: JSString = "crossOrigin" + static let `defer`: JSString = "defer" + static let event: JSString = "event" static let htmlFor: JSString = "htmlFor" - static let async: JSString = "async" + static let integrity: JSString = "integrity" + static let noModule: JSString = "noModule" static let referrerPolicy: JSString = "referrerPolicy" + static let src: JSString = "src" + static let supports: JSString = "supports" static let text: JSString = "text" - static let integrity: JSString = "integrity" - static let `defer`: JSString = "defer" + static let type: JSString = "type" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index 9f47389e..53495e47 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -7,29 +7,29 @@ public class HTMLSelectElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSelectElement.function! } private enum Keys { - static let selectedOptions: JSString = "selectedOptions" - static let reportValidity: JSString = "reportValidity" - static let setCustomValidity: JSString = "setCustomValidity" - static let autocomplete: JSString = "autocomplete" - static let type: JSString = "type" - static let validationMessage: JSString = "validationMessage" static let add: JSString = "add" - static let selectedIndex: JSString = "selectedIndex" - static let item: JSString = "item" - static let value: JSString = "value" - static let validity: JSString = "validity" - static let remove: JSString = "remove" + static let autocomplete: JSString = "autocomplete" static let checkValidity: JSString = "checkValidity" - static let options: JSString = "options" static let disabled: JSString = "disabled" - static let namedItem: JSString = "namedItem" - static let multiple: JSString = "multiple" - static let labels: JSString = "labels" - static let required: JSString = "required" static let form: JSString = "form" + static let item: JSString = "item" + static let labels: JSString = "labels" + static let length: JSString = "length" + static let multiple: JSString = "multiple" static let name: JSString = "name" + static let namedItem: JSString = "namedItem" + static let options: JSString = "options" + static let remove: JSString = "remove" + static let reportValidity: JSString = "reportValidity" + static let required: JSString = "required" + static let selectedIndex: JSString = "selectedIndex" + static let selectedOptions: JSString = "selectedOptions" + static let setCustomValidity: JSString = "setCustomValidity" static let size: JSString = "size" - static let length: JSString = "length" + static let type: JSString = "type" + static let validationMessage: JSString = "validationMessage" + static let validity: JSString = "validity" + static let value: JSString = "value" static let willValidate: JSString = "willValidate" } @@ -88,7 +88,7 @@ public class HTMLSelectElement: HTMLElement { @ReadWriteAttribute public var length: UInt32 - public subscript(key: Int) -> HTMLOptionElement? { + public subscript(key: UInt32) -> HTMLOptionElement? { jsObject[key].fromJSValue() } @@ -97,18 +97,18 @@ public class HTMLSelectElement: HTMLElement { } public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined) + jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined).fromJSValue()! } public func remove() { - _ = jsObject[Keys.remove]!() + jsObject[Keys.remove]!().fromJSValue()! } public func remove(index: Int32) { - _ = jsObject[Keys.remove]!(index.jsValue()) + jsObject[Keys.remove]!(index.jsValue()).fromJSValue()! } - // XXX: unsupported setter for keys of type UInt32 + // XXX: unsupported setter for keys of type `UInt32` @ReadonlyAttribute public var selectedOptions: HTMLCollection @@ -137,7 +137,7 @@ public class HTMLSelectElement: HTMLElement { } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index db1f661d..d98cba18 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -7,10 +7,10 @@ public class HTMLSlotElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSlotElement.function! } private enum Keys { - static let assignedNodes: JSString = "assignedNodes" - static let name: JSString = "name" static let assign: JSString = "assign" static let assignedElements: JSString = "assignedElements" + static let assignedNodes: JSString = "assignedNodes" + static let name: JSString = "name" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -34,6 +34,6 @@ public class HTMLSlotElement: HTMLElement { } public func assign(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.assign]!(nodes.jsValue()) + jsObject[Keys.assign]!(nodes.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift index 216f0e71..d930ac39 100644 --- a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift @@ -7,13 +7,13 @@ public class HTMLSourceElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSourceElement.function! } private enum Keys { - static let type: JSString = "type" + static let height: JSString = "height" static let media: JSString = "media" - static let width: JSString = "width" static let sizes: JSString = "sizes" static let src: JSString = "src" static let srcset: JSString = "srcset" - static let height: JSString = "height" + static let type: JSString = "type" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift index 2c8a73b1..253ca746 100644 --- a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift @@ -7,8 +7,8 @@ public class HTMLStyleElement: HTMLElement, LinkStyle { override public class var constructor: JSFunction { JSObject.global.HTMLStyleElement.function! } private enum Keys { - static let media: JSString = "media" static let blocking: JSString = "blocking" + static let media: JSString = "media" static let type: JSString = "type" } diff --git a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift index 1bc91f17..b82a56c4 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift @@ -7,21 +7,21 @@ public class HTMLTableCellElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableCellElement.function! } private enum Keys { - static let chOff: JSString = "chOff" - static let scope: JSString = "scope" + static let abbr: JSString = "abbr" + static let align: JSString = "align" + static let axis: JSString = "axis" + static let bgColor: JSString = "bgColor" static let cellIndex: JSString = "cellIndex" - static let height: JSString = "height" - static let width: JSString = "width" static let ch: JSString = "ch" - static let vAlign: JSString = "vAlign" - static let noWrap: JSString = "noWrap" + static let chOff: JSString = "chOff" static let colSpan: JSString = "colSpan" - static let align: JSString = "align" static let headers: JSString = "headers" - static let bgColor: JSString = "bgColor" + static let height: JSString = "height" + static let noWrap: JSString = "noWrap" static let rowSpan: JSString = "rowSpan" - static let abbr: JSString = "abbr" - static let axis: JSString = "axis" + static let scope: JSString = "scope" + static let vAlign: JSString = "vAlign" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift index 7c44a472..6dfe4674 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift @@ -7,12 +7,12 @@ public class HTMLTableColElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableColElement.function! } private enum Keys { - static let ch: JSString = "ch" static let align: JSString = "align" + static let ch: JSString = "ch" + static let chOff: JSString = "chOff" static let span: JSString = "span" - static let width: JSString = "width" static let vAlign: JSString = "vAlign" - static let chOff: JSString = "chOff" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift index e95d0a9a..e12d35b9 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -7,29 +7,29 @@ public class HTMLTableElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableElement.function! } private enum Keys { - static let createTFoot: JSString = "createTFoot" - static let deleteRow: JSString = "deleteRow" - static let createTBody: JSString = "createTBody" - static let cellSpacing: JSString = "cellSpacing" static let align: JSString = "align" - static let tHead: JSString = "tHead" - static let tFoot: JSString = "tFoot" - static let frame: JSString = "frame" - static let createTHead: JSString = "createTHead" - static let border: JSString = "border" - static let rules: JSString = "rules" static let bgColor: JSString = "bgColor" + static let border: JSString = "border" static let caption: JSString = "caption" - static let deleteTFoot: JSString = "deleteTFoot" - static let width: JSString = "width" static let cellPadding: JSString = "cellPadding" - static let deleteTHead: JSString = "deleteTHead" - static let deleteCaption: JSString = "deleteCaption" - static let tBodies: JSString = "tBodies" + static let cellSpacing: JSString = "cellSpacing" static let createCaption: JSString = "createCaption" - static let rows: JSString = "rows" + static let createTBody: JSString = "createTBody" + static let createTFoot: JSString = "createTFoot" + static let createTHead: JSString = "createTHead" + static let deleteCaption: JSString = "deleteCaption" + static let deleteRow: JSString = "deleteRow" + static let deleteTFoot: JSString = "deleteTFoot" + static let deleteTHead: JSString = "deleteTHead" + static let frame: JSString = "frame" static let insertRow: JSString = "insertRow" + static let rows: JSString = "rows" + static let rules: JSString = "rules" static let summary: JSString = "summary" + static let tBodies: JSString = "tBodies" + static let tFoot: JSString = "tFoot" + static let tHead: JSString = "tHead" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -62,7 +62,7 @@ public class HTMLTableElement: HTMLElement { } public func deleteCaption() { - _ = jsObject[Keys.deleteCaption]!() + jsObject[Keys.deleteCaption]!().fromJSValue()! } @ReadWriteAttribute @@ -73,7 +73,7 @@ public class HTMLTableElement: HTMLElement { } public func deleteTHead() { - _ = jsObject[Keys.deleteTHead]!() + jsObject[Keys.deleteTHead]!().fromJSValue()! } @ReadWriteAttribute @@ -84,7 +84,7 @@ public class HTMLTableElement: HTMLElement { } public func deleteTFoot() { - _ = jsObject[Keys.deleteTFoot]!() + jsObject[Keys.deleteTFoot]!().fromJSValue()! } @ReadonlyAttribute @@ -102,7 +102,7 @@ public class HTMLTableElement: HTMLElement { } public func deleteRow(index: Int32) { - _ = jsObject[Keys.deleteRow]!(index.jsValue()) + jsObject[Keys.deleteRow]!(index.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift index 3c6af65a..bcc6da55 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -7,16 +7,16 @@ public class HTMLTableRowElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableRowElement.function! } private enum Keys { - static let vAlign: JSString = "vAlign" - static let sectionRowIndex: JSString = "sectionRowIndex" - static let rowIndex: JSString = "rowIndex" - static let cells: JSString = "cells" - static let insertCell: JSString = "insertCell" - static let deleteCell: JSString = "deleteCell" static let align: JSString = "align" - static let ch: JSString = "ch" static let bgColor: JSString = "bgColor" + static let cells: JSString = "cells" + static let ch: JSString = "ch" static let chOff: JSString = "chOff" + static let deleteCell: JSString = "deleteCell" + static let insertCell: JSString = "insertCell" + static let rowIndex: JSString = "rowIndex" + static let sectionRowIndex: JSString = "sectionRowIndex" + static let vAlign: JSString = "vAlign" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -49,7 +49,7 @@ public class HTMLTableRowElement: HTMLElement { } public func deleteCell(index: Int32) { - _ = jsObject[Keys.deleteCell]!(index.jsValue()) + jsObject[Keys.deleteCell]!(index.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift index 58f88825..b0e612c6 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -7,13 +7,13 @@ public class HTMLTableSectionElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableSectionElement.function! } private enum Keys { + static let align: JSString = "align" + static let ch: JSString = "ch" + static let chOff: JSString = "chOff" + static let deleteRow: JSString = "deleteRow" static let insertRow: JSString = "insertRow" static let rows: JSString = "rows" static let vAlign: JSString = "vAlign" - static let deleteRow: JSString = "deleteRow" - static let align: JSString = "align" - static let chOff: JSString = "chOff" - static let ch: JSString = "ch" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -37,7 +37,7 @@ public class HTMLTableSectionElement: HTMLElement { } public func deleteRow(index: Int32) { - _ = jsObject[Keys.deleteRow]!(index.jsValue()) + jsObject[Keys.deleteRow]!(index.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift index 4e3c9a3e..a63883a8 100644 --- a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -7,36 +7,36 @@ public class HTMLTextAreaElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTextAreaElement.function! } private enum Keys { - static let maxLength: JSString = "maxLength" - static let minLength: JSString = "minLength" + static let autocomplete: JSString = "autocomplete" static let checkValidity: JSString = "checkValidity" - static let setRangeText: JSString = "setRangeText" - static let type: JSString = "type" - static let selectionDirection: JSString = "selectionDirection" - static let select: JSString = "select" - static let selectionStart: JSString = "selectionStart" - static let validationMessage: JSString = "validationMessage" - static let rows: JSString = "rows" static let cols: JSString = "cols" - static let reportValidity: JSString = "reportValidity" + static let defaultValue: JSString = "defaultValue" + static let dirName: JSString = "dirName" + static let disabled: JSString = "disabled" + static let form: JSString = "form" static let labels: JSString = "labels" + static let maxLength: JSString = "maxLength" + static let minLength: JSString = "minLength" static let name: JSString = "name" - static let form: JSString = "form" - static let setSelectionRange: JSString = "setSelectionRange" static let placeholder: JSString = "placeholder" - static let selectionEnd: JSString = "selectionEnd" - static let disabled: JSString = "disabled" - static let dirName: JSString = "dirName" - static let defaultValue: JSString = "defaultValue" static let readOnly: JSString = "readOnly" - static let wrap: JSString = "wrap" - static let validity: JSString = "validity" - static let willValidate: JSString = "willValidate" - static let value: JSString = "value" - static let setCustomValidity: JSString = "setCustomValidity" + static let reportValidity: JSString = "reportValidity" static let required: JSString = "required" - static let autocomplete: JSString = "autocomplete" + static let rows: JSString = "rows" + static let select: JSString = "select" + static let selectionDirection: JSString = "selectionDirection" + static let selectionEnd: JSString = "selectionEnd" + static let selectionStart: JSString = "selectionStart" + static let setCustomValidity: JSString = "setCustomValidity" + static let setRangeText: JSString = "setRangeText" + static let setSelectionRange: JSString = "setSelectionRange" static let textLength: JSString = "textLength" + static let type: JSString = "type" + static let validationMessage: JSString = "validationMessage" + static let validity: JSString = "validity" + static let value: JSString = "value" + static let willValidate: JSString = "willValidate" + static let wrap: JSString = "wrap" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -140,14 +140,14 @@ public class HTMLTextAreaElement: HTMLElement { } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! } @ReadonlyAttribute public var labels: NodeList public func select() { - _ = jsObject[Keys.select]!() + jsObject[Keys.select]!().fromJSValue()! } @ReadWriteAttribute @@ -160,14 +160,14 @@ public class HTMLTextAreaElement: HTMLElement { public var selectionDirection: String public func setRangeText(replacement: String) { - _ = jsObject[Keys.setRangeText]!(replacement.jsValue()) + jsObject[Keys.setRangeText]!(replacement.jsValue()).fromJSValue()! } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - _ = jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined).fromJSValue()! } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - _ = jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift index a6ad26d7..c468cd84 100644 --- a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift @@ -7,16 +7,16 @@ public class HTMLTrackElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTrackElement.function! } private enum Keys { - static let label: JSString = "label" + static let ERROR: JSString = "ERROR" + static let LOADED: JSString = "LOADED" static let LOADING: JSString = "LOADING" static let NONE: JSString = "NONE" - static let srclang: JSString = "srclang" - static let src: JSString = "src" - static let LOADED: JSString = "LOADED" - static let readyState: JSString = "readyState" static let `default`: JSString = "default" - static let ERROR: JSString = "ERROR" static let kind: JSString = "kind" + static let label: JSString = "label" + static let readyState: JSString = "readyState" + static let src: JSString = "src" + static let srclang: JSString = "srclang" static let track: JSString = "track" } diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index de7a5f18..17d02cbd 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -7,12 +7,12 @@ public class HTMLVideoElement: HTMLMediaElement { override public class var constructor: JSFunction { JSObject.global.HTMLVideoElement.function! } private enum Keys { - static let videoHeight: JSString = "videoHeight" + static let height: JSString = "height" static let playsInline: JSString = "playsInline" - static let width: JSString = "width" static let poster: JSString = "poster" - static let height: JSString = "height" + static let videoHeight: JSString = "videoHeight" static let videoWidth: JSString = "videoWidth" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HashChangeEvent.swift b/Sources/DOMKit/WebIDL/HashChangeEvent.swift index c33a61b4..32d4ec3d 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEvent.swift @@ -7,8 +7,8 @@ public class HashChangeEvent: Event { override public class var constructor: JSFunction { JSObject.global.HashChangeEvent.function! } private enum Keys { - static let oldURL: JSString = "oldURL" static let newURL: JSString = "newURL" + static let oldURL: JSString = "oldURL" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift index 7a14ce49..8514b462 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift @@ -5,8 +5,8 @@ import JavaScriptKit public class HashChangeEventInit: BridgedDictionary { private enum Keys { - static let oldURL: JSString = "oldURL" static let newURL: JSString = "newURL" + static let oldURL: JSString = "oldURL" } public convenience init(oldURL: String, newURL: String) { diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift index 4da1ee21..d2988f7c 100644 --- a/Sources/DOMKit/WebIDL/Headers.swift +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -7,11 +7,11 @@ public class Headers: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.Headers.function! } private enum Keys { - static let get: JSString = "get" - static let set: JSString = "set" static let append: JSString = "append" static let delete: JSString = "delete" + static let get: JSString = "get" static let has: JSString = "has" + static let set: JSString = "set" } public let jsObject: JSObject @@ -25,11 +25,11 @@ public class Headers: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - _ = jsObject[Keys.append]!(name.jsValue(), value.jsValue()) + jsObject[Keys.append]!(name.jsValue(), value.jsValue()).fromJSValue()! } public func delete(name: String) { - _ = jsObject[Keys.delete]!(name.jsValue()) + jsObject[Keys.delete]!(name.jsValue()).fromJSValue()! } public func get(name: String) -> String? { @@ -41,7 +41,7 @@ public class Headers: JSBridgedClass, Sequence { } public func set(name: String, value: String) { - _ = jsObject[Keys.set]!(name.jsValue(), value.jsValue()) + jsObject[Keys.set]!(name.jsValue(), value.jsValue()).fromJSValue()! } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/History.swift b/Sources/DOMKit/WebIDL/History.swift index 19d07c59..85d37e58 100644 --- a/Sources/DOMKit/WebIDL/History.swift +++ b/Sources/DOMKit/WebIDL/History.swift @@ -7,14 +7,14 @@ public class History: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.History.function! } private enum Keys { - static let length: JSString = "length" - static let replaceState: JSString = "replaceState" static let back: JSString = "back" static let forward: JSString = "forward" - static let pushState: JSString = "pushState" - static let state: JSString = "state" static let go: JSString = "go" + static let length: JSString = "length" + static let pushState: JSString = "pushState" + static let replaceState: JSString = "replaceState" static let scrollRestoration: JSString = "scrollRestoration" + static let state: JSString = "state" } public let jsObject: JSObject @@ -36,22 +36,22 @@ public class History: JSBridgedClass { public var state: JSValue public func go(delta: Int32? = nil) { - _ = jsObject[Keys.go]!(delta?.jsValue() ?? .undefined) + jsObject[Keys.go]!(delta?.jsValue() ?? .undefined).fromJSValue()! } public func back() { - _ = jsObject[Keys.back]!() + jsObject[Keys.back]!().fromJSValue()! } public func forward() { - _ = jsObject[Keys.forward]!() + jsObject[Keys.forward]!().fromJSValue()! } public func pushState(data: JSValue, unused: String, url: String? = nil) { - _ = jsObject[Keys.pushState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + jsObject[Keys.pushState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined).fromJSValue()! } public func replaceState(data: JSValue, unused: String, url: String? = nil) { - _ = jsObject[Keys.replaceState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + jsObject[Keys.replaceState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmap.swift b/Sources/DOMKit/WebIDL/ImageBitmap.swift index fb7d11a7..602d015c 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmap.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmap.swift @@ -8,8 +8,8 @@ public class ImageBitmap: JSBridgedClass { private enum Keys { static let close: JSString = "close" - static let width: JSString = "width" static let height: JSString = "height" + static let width: JSString = "width" } public let jsObject: JSObject @@ -27,6 +27,6 @@ public class ImageBitmap: JSBridgedClass { public var height: UInt32 public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift index dcafc8e1..97b36262 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift @@ -5,12 +5,12 @@ import JavaScriptKit public class ImageBitmapOptions: BridgedDictionary { private enum Keys { + static let colorSpaceConversion: JSString = "colorSpaceConversion" static let imageOrientation: JSString = "imageOrientation" - static let resizeWidth: JSString = "resizeWidth" static let premultiplyAlpha: JSString = "premultiplyAlpha" static let resizeHeight: JSString = "resizeHeight" static let resizeQuality: JSString = "resizeQuality" - static let colorSpaceConversion: JSString = "colorSpaceConversion" + static let resizeWidth: JSString = "resizeWidth" } public convenience init(imageOrientation: ImageOrientation, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, resizeWidth: UInt32, resizeHeight: UInt32, resizeQuality: ResizeQuality) { diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift index 6bf855ae..d961e29c 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -7,8 +7,8 @@ public class ImageBitmapRenderingContext: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ImageBitmapRenderingContext.function! } private enum Keys { - static let transferFromImageBitmap: JSString = "transferFromImageBitmap" static let canvas: JSString = "canvas" + static let transferFromImageBitmap: JSString = "transferFromImageBitmap" } public let jsObject: JSObject @@ -22,6 +22,6 @@ public class ImageBitmapRenderingContext: JSBridgedClass { public var canvas: __UNSUPPORTED_UNION__ public func transferFromImageBitmap(bitmap: ImageBitmap?) { - _ = jsObject[Keys.transferFromImageBitmap]!(bitmap.jsValue()) + jsObject[Keys.transferFromImageBitmap]!(bitmap.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ImageData.swift b/Sources/DOMKit/WebIDL/ImageData.swift index 7c4ff466..61d378a9 100644 --- a/Sources/DOMKit/WebIDL/ImageData.swift +++ b/Sources/DOMKit/WebIDL/ImageData.swift @@ -8,8 +8,8 @@ public class ImageData: JSBridgedClass { private enum Keys { static let colorSpace: JSString = "colorSpace" - static let height: JSString = "height" static let data: JSString = "data" + static let height: JSString = "height" static let width: JSString = "width" } diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index 26a2374e..d590febd 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -8,8 +8,8 @@ public class InputEvent: UIEvent { private enum Keys { static let data: JSString = "data" - static let isComposing: JSString = "isComposing" static let inputType: JSString = "inputType" + static let isComposing: JSString = "isComposing" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift index 4e7e140e..c643d394 100644 --- a/Sources/DOMKit/WebIDL/InputEventInit.swift +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -5,8 +5,8 @@ import JavaScriptKit public class InputEventInit: BridgedDictionary { private enum Keys { - static let inputType: JSString = "inputType" static let data: JSString = "data" + static let inputType: JSString = "inputType" static let isComposing: JSString = "isComposing" } diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index 42c1e0a7..a7cf2312 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -7,23 +7,23 @@ public class KeyboardEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.KeyboardEvent.function! } private enum Keys { + static let DOM_KEY_LOCATION_LEFT: JSString = "DOM_KEY_LOCATION_LEFT" + static let DOM_KEY_LOCATION_NUMPAD: JSString = "DOM_KEY_LOCATION_NUMPAD" + static let DOM_KEY_LOCATION_RIGHT: JSString = "DOM_KEY_LOCATION_RIGHT" static let DOM_KEY_LOCATION_STANDARD: JSString = "DOM_KEY_LOCATION_STANDARD" + static let altKey: JSString = "altKey" + static let charCode: JSString = "charCode" + static let code: JSString = "code" + static let ctrlKey: JSString = "ctrlKey" static let getModifierState: JSString = "getModifierState" - static let DOM_KEY_LOCATION_RIGHT: JSString = "DOM_KEY_LOCATION_RIGHT" static let initKeyboardEvent: JSString = "initKeyboardEvent" + static let isComposing: JSString = "isComposing" + static let key: JSString = "key" static let keyCode: JSString = "keyCode" - static let shiftKey: JSString = "shiftKey" static let location: JSString = "location" - static let altKey: JSString = "altKey" - static let DOM_KEY_LOCATION_NUMPAD: JSString = "DOM_KEY_LOCATION_NUMPAD" - static let ctrlKey: JSString = "ctrlKey" static let metaKey: JSString = "metaKey" static let `repeat`: JSString = "repeat" - static let charCode: JSString = "charCode" - static let DOM_KEY_LOCATION_LEFT: JSString = "DOM_KEY_LOCATION_LEFT" - static let code: JSString = "code" - static let key: JSString = "key" - static let isComposing: JSString = "isComposing" + static let shiftKey: JSString = "shiftKey" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -95,7 +95,7 @@ public class KeyboardEvent: UIEvent { let _arg7 = altKey?.jsValue() ?? .undefined let _arg8 = shiftKey?.jsValue() ?? .undefined let _arg9 = metaKey?.jsValue() ?? .undefined - _ = jsObject[Keys.initKeyboardEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + return jsObject[Keys.initKeyboardEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift index a92d0f01..adac9658 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift @@ -5,13 +5,13 @@ import JavaScriptKit public class KeyboardEventInit: BridgedDictionary { private enum Keys { - static let location: JSString = "location" - static let `repeat`: JSString = "repeat" - static let keyCode: JSString = "keyCode" - static let isComposing: JSString = "isComposing" static let charCode: JSString = "charCode" static let code: JSString = "code" + static let isComposing: JSString = "isComposing" static let key: JSString = "key" + static let keyCode: JSString = "keyCode" + static let location: JSString = "location" + static let `repeat`: JSString = "repeat" } public convenience init(key: String, code: String, location: UInt32, repeat: Bool, isComposing: Bool, charCode: UInt32, keyCode: UInt32) { diff --git a/Sources/DOMKit/WebIDL/Location.swift b/Sources/DOMKit/WebIDL/Location.swift index 6d237d9b..6c781f5d 100644 --- a/Sources/DOMKit/WebIDL/Location.swift +++ b/Sources/DOMKit/WebIDL/Location.swift @@ -7,19 +7,19 @@ public class Location: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Location.function! } private enum Keys { - static let replace: JSString = "replace" + static let ancestorOrigins: JSString = "ancestorOrigins" static let assign: JSString = "assign" + static let hash: JSString = "hash" static let host: JSString = "host" - static let pathname: JSString = "pathname" - static let ancestorOrigins: JSString = "ancestorOrigins" - static let href: JSString = "href" static let hostname: JSString = "hostname" - static let reload: JSString = "reload" + static let href: JSString = "href" + static let origin: JSString = "origin" + static let pathname: JSString = "pathname" static let port: JSString = "port" - static let search: JSString = "search" static let `protocol`: JSString = "protocol" - static let origin: JSString = "origin" - static let hash: JSString = "hash" + static let reload: JSString = "reload" + static let replace: JSString = "replace" + static let search: JSString = "search" } public let jsObject: JSObject @@ -66,15 +66,15 @@ public class Location: JSBridgedClass { public var hash: String public func assign(url: String) { - _ = jsObject[Keys.assign]!(url.jsValue()) + jsObject[Keys.assign]!(url.jsValue()).fromJSValue()! } public func replace(url: String) { - _ = jsObject[Keys.replace]!(url.jsValue()) + jsObject[Keys.replace]!(url.jsValue()).fromJSValue()! } public func reload() { - _ = jsObject[Keys.reload]!() + jsObject[Keys.reload]!().fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaError.swift b/Sources/DOMKit/WebIDL/MediaError.swift index 7c9767c7..58177682 100644 --- a/Sources/DOMKit/WebIDL/MediaError.swift +++ b/Sources/DOMKit/WebIDL/MediaError.swift @@ -7,12 +7,12 @@ public class MediaError: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MediaError.function! } private enum Keys { + static let MEDIA_ERR_ABORTED: JSString = "MEDIA_ERR_ABORTED" + static let MEDIA_ERR_DECODE: JSString = "MEDIA_ERR_DECODE" static let MEDIA_ERR_NETWORK: JSString = "MEDIA_ERR_NETWORK" static let MEDIA_ERR_SRC_NOT_SUPPORTED: JSString = "MEDIA_ERR_SRC_NOT_SUPPORTED" - static let message: JSString = "message" - static let MEDIA_ERR_ABORTED: JSString = "MEDIA_ERR_ABORTED" static let code: JSString = "code" - static let MEDIA_ERR_DECODE: JSString = "MEDIA_ERR_DECODE" + static let message: JSString = "message" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift index 5ffc1466..8346a1d6 100644 --- a/Sources/DOMKit/WebIDL/MediaList.swift +++ b/Sources/DOMKit/WebIDL/MediaList.swift @@ -9,8 +9,8 @@ public class MediaList: JSBridgedClass { private enum Keys { static let appendMedium: JSString = "appendMedium" static let deleteMedium: JSString = "deleteMedium" - static let length: JSString = "length" static let item: JSString = "item" + static let length: JSString = "length" static let mediaText: JSString = "mediaText" } @@ -28,15 +28,15 @@ public class MediaList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> String? { + public subscript(key: UInt32) -> String? { jsObject[key].fromJSValue() } public func appendMedium(medium: String) { - _ = jsObject[Keys.appendMedium]!(medium.jsValue()) + jsObject[Keys.appendMedium]!(medium.jsValue()).fromJSValue()! } public func deleteMedium(medium: String) { - _ = jsObject[Keys.deleteMedium]!(medium.jsValue()) + jsObject[Keys.deleteMedium]!(medium.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MessageChannel.swift b/Sources/DOMKit/WebIDL/MessageChannel.swift index 7c4390d3..2688b7a3 100644 --- a/Sources/DOMKit/WebIDL/MessageChannel.swift +++ b/Sources/DOMKit/WebIDL/MessageChannel.swift @@ -7,8 +7,8 @@ public class MessageChannel: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MessageChannel.function! } private enum Keys { - static let port2: JSString = "port2" static let port1: JSString = "port1" + static let port2: JSString = "port2" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift index 89d462b1..746ab318 100644 --- a/Sources/DOMKit/WebIDL/MessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -7,12 +7,12 @@ public class MessageEvent: Event { override public class var constructor: JSFunction { JSObject.global.MessageEvent.function! } private enum Keys { + static let data: JSString = "data" static let initMessageEvent: JSString = "initMessageEvent" + static let lastEventId: JSString = "lastEventId" static let origin: JSString = "origin" - static let source: JSString = "source" - static let data: JSString = "data" static let ports: JSString = "ports" - static let lastEventId: JSString = "lastEventId" + static let source: JSString = "source" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -52,6 +52,6 @@ public class MessageEvent: Event { let _arg5 = lastEventId?.jsValue() ?? .undefined let _arg6 = source?.jsValue() ?? .undefined let _arg7 = ports?.jsValue() ?? .undefined - _ = jsObject[Keys.initMessageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + return jsObject[Keys.initMessageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MessageEventInit.swift b/Sources/DOMKit/WebIDL/MessageEventInit.swift index f5dabcf2..6fc41948 100644 --- a/Sources/DOMKit/WebIDL/MessageEventInit.swift +++ b/Sources/DOMKit/WebIDL/MessageEventInit.swift @@ -8,8 +8,8 @@ public class MessageEventInit: BridgedDictionary { static let data: JSString = "data" static let lastEventId: JSString = "lastEventId" static let origin: JSString = "origin" - static let source: JSString = "source" static let ports: JSString = "ports" + static let source: JSString = "source" } public convenience init(data: JSValue, origin: String, lastEventId: String, source: MessageEventSource?, ports: [MessagePort]) { diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift index c4b82804..c2d15ba9 100644 --- a/Sources/DOMKit/WebIDL/MessagePort.swift +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -7,11 +7,11 @@ public class MessagePort: EventTarget { override public class var constructor: JSFunction { JSObject.global.MessagePort.function! } private enum Keys { - static let onmessageerror: JSString = "onmessageerror" - static let start: JSString = "start" static let close: JSString = "close" static let onmessage: JSString = "onmessage" + static let onmessageerror: JSString = "onmessageerror" static let postMessage: JSString = "postMessage" + static let start: JSString = "start" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -21,19 +21,19 @@ public class MessagePort: EventTarget { } public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) + jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()).fromJSValue()! } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func start() { - _ = jsObject[Keys.start]!() + jsObject[Keys.start]!().fromJSValue()! } public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/MimeType.swift b/Sources/DOMKit/WebIDL/MimeType.swift index d419ea43..6268fc9e 100644 --- a/Sources/DOMKit/WebIDL/MimeType.swift +++ b/Sources/DOMKit/WebIDL/MimeType.swift @@ -7,10 +7,10 @@ public class MimeType: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MimeType.function! } private enum Keys { - static let enabledPlugin: JSString = "enabledPlugin" - static let type: JSString = "type" static let description: JSString = "description" + static let enabledPlugin: JSString = "enabledPlugin" static let suffixes: JSString = "suffixes" + static let type: JSString = "type" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MimeTypeArray.swift b/Sources/DOMKit/WebIDL/MimeTypeArray.swift index 47ba8857..58a75e30 100644 --- a/Sources/DOMKit/WebIDL/MimeTypeArray.swift +++ b/Sources/DOMKit/WebIDL/MimeTypeArray.swift @@ -22,7 +22,7 @@ public class MimeTypeArray: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> MimeType? { + public subscript(key: UInt32) -> MimeType? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index 24ce9adb..988d4931 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -7,19 +7,19 @@ public class MouseEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.MouseEvent.function! } private enum Keys { - static let ctrlKey: JSString = "ctrlKey" - static let shiftKey: JSString = "shiftKey" static let altKey: JSString = "altKey" - static let screenY: JSString = "screenY" - static let metaKey: JSString = "metaKey" static let button: JSString = "button" - static let relatedTarget: JSString = "relatedTarget" - static let screenX: JSString = "screenX" static let buttons: JSString = "buttons" static let clientX: JSString = "clientX" + static let clientY: JSString = "clientY" + static let ctrlKey: JSString = "ctrlKey" static let getModifierState: JSString = "getModifierState" static let initMouseEvent: JSString = "initMouseEvent" - static let clientY: JSString = "clientY" + static let metaKey: JSString = "metaKey" + static let relatedTarget: JSString = "relatedTarget" + static let screenX: JSString = "screenX" + static let screenY: JSString = "screenY" + static let shiftKey: JSString = "shiftKey" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -94,6 +94,6 @@ public class MouseEvent: UIEvent { let _arg12 = metaKeyArg?.jsValue() ?? .undefined let _arg13 = buttonArg?.jsValue() ?? .undefined let _arg14 = relatedTargetArg?.jsValue() ?? .undefined - _ = jsObject[Keys.initMouseEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14) + return jsObject[Keys.initMouseEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MouseEventInit.swift b/Sources/DOMKit/WebIDL/MouseEventInit.swift index 11fe163d..1f0ad297 100644 --- a/Sources/DOMKit/WebIDL/MouseEventInit.swift +++ b/Sources/DOMKit/WebIDL/MouseEventInit.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class MouseEventInit: BridgedDictionary { private enum Keys { static let button: JSString = "button" - static let relatedTarget: JSString = "relatedTarget" - static let clientY: JSString = "clientY" - static let clientX: JSString = "clientX" static let buttons: JSString = "buttons" - static let screenY: JSString = "screenY" + static let clientX: JSString = "clientX" + static let clientY: JSString = "clientY" + static let relatedTarget: JSString = "relatedTarget" static let screenX: JSString = "screenX" + static let screenY: JSString = "screenY" } public convenience init(screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift index dba530e4..d1bf3e04 100644 --- a/Sources/DOMKit/WebIDL/MutationEvent.swift +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -7,14 +7,14 @@ public class MutationEvent: Event { override public class var constructor: JSFunction { JSObject.global.MutationEvent.function! } private enum Keys { - static let attrName: JSString = "attrName" - static let attrChange: JSString = "attrChange" - static let newValue: JSString = "newValue" static let ADDITION: JSString = "ADDITION" - static let initMutationEvent: JSString = "initMutationEvent" - static let prevValue: JSString = "prevValue" static let MODIFICATION: JSString = "MODIFICATION" static let REMOVAL: JSString = "REMOVAL" + static let attrChange: JSString = "attrChange" + static let attrName: JSString = "attrName" + static let initMutationEvent: JSString = "initMutationEvent" + static let newValue: JSString = "newValue" + static let prevValue: JSString = "prevValue" static let relatedNode: JSString = "relatedNode" } @@ -57,6 +57,6 @@ public class MutationEvent: Event { let _arg5 = newValueArg?.jsValue() ?? .undefined let _arg6 = attrNameArg?.jsValue() ?? .undefined let _arg7 = attrChangeArg?.jsValue() ?? .undefined - _ = jsObject[Keys.initMutationEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + return jsObject[Keys.initMutationEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MutationObserver.swift b/Sources/DOMKit/WebIDL/MutationObserver.swift index ccead703..d9178e42 100644 --- a/Sources/DOMKit/WebIDL/MutationObserver.swift +++ b/Sources/DOMKit/WebIDL/MutationObserver.swift @@ -7,8 +7,8 @@ public class MutationObserver: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MutationObserver.function! } private enum Keys { - static let observe: JSString = "observe" static let disconnect: JSString = "disconnect" + static let observe: JSString = "observe" static let takeRecords: JSString = "takeRecords" } @@ -18,14 +18,16 @@ public class MutationObserver: JSBridgedClass { self.jsObject = jsObject } - // XXX: constructor is ignored + public convenience init(callback: MutationCallback) { + self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue())) + } public func observe(target: Node, options: MutationObserverInit? = nil) { - _ = jsObject[Keys.observe]!(target.jsValue(), options?.jsValue() ?? .undefined) + jsObject[Keys.observe]!(target.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func disconnect() { - _ = jsObject[Keys.disconnect]!() + jsObject[Keys.disconnect]!().fromJSValue()! } public func takeRecords() -> [MutationRecord] { diff --git a/Sources/DOMKit/WebIDL/MutationObserverInit.swift b/Sources/DOMKit/WebIDL/MutationObserverInit.swift index 77ea648c..b10eb10f 100644 --- a/Sources/DOMKit/WebIDL/MutationObserverInit.swift +++ b/Sources/DOMKit/WebIDL/MutationObserverInit.swift @@ -5,13 +5,13 @@ import JavaScriptKit public class MutationObserverInit: BridgedDictionary { private enum Keys { - static let characterDataOldValue: JSString = "characterDataOldValue" - static let childList: JSString = "childList" - static let attributes: JSString = "attributes" static let attributeFilter: JSString = "attributeFilter" - static let subtree: JSString = "subtree" static let attributeOldValue: JSString = "attributeOldValue" + static let attributes: JSString = "attributes" static let characterData: JSString = "characterData" + static let characterDataOldValue: JSString = "characterDataOldValue" + static let childList: JSString = "childList" + static let subtree: JSString = "subtree" } public convenience init(childList: Bool, attributes: Bool, characterData: Bool, subtree: Bool, attributeOldValue: Bool, characterDataOldValue: Bool, attributeFilter: [String]) { diff --git a/Sources/DOMKit/WebIDL/MutationRecord.swift b/Sources/DOMKit/WebIDL/MutationRecord.swift index 1ab0c055..de3bed85 100644 --- a/Sources/DOMKit/WebIDL/MutationRecord.swift +++ b/Sources/DOMKit/WebIDL/MutationRecord.swift @@ -7,15 +7,15 @@ public class MutationRecord: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MutationRecord.function! } private enum Keys { - static let type: JSString = "type" - static let removedNodes: JSString = "removedNodes" - static let previousSibling: JSString = "previousSibling" + static let addedNodes: JSString = "addedNodes" + static let attributeName: JSString = "attributeName" static let attributeNamespace: JSString = "attributeNamespace" static let nextSibling: JSString = "nextSibling" - static let target: JSString = "target" - static let attributeName: JSString = "attributeName" static let oldValue: JSString = "oldValue" - static let addedNodes: JSString = "addedNodes" + static let previousSibling: JSString = "previousSibling" + static let removedNodes: JSString = "removedNodes" + static let target: JSString = "target" + static let type: JSString = "type" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/NamedNodeMap.swift b/Sources/DOMKit/WebIDL/NamedNodeMap.swift index 418c5066..f137b76d 100644 --- a/Sources/DOMKit/WebIDL/NamedNodeMap.swift +++ b/Sources/DOMKit/WebIDL/NamedNodeMap.swift @@ -7,14 +7,14 @@ public class NamedNodeMap: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.NamedNodeMap.function! } private enum Keys { - static let setNamedItemNS: JSString = "setNamedItemNS" - static let removeNamedItem: JSString = "removeNamedItem" - static let removeNamedItemNS: JSString = "removeNamedItemNS" - static let length: JSString = "length" static let getNamedItem: JSString = "getNamedItem" static let getNamedItemNS: JSString = "getNamedItemNS" - static let setNamedItem: JSString = "setNamedItem" static let item: JSString = "item" + static let length: JSString = "length" + static let removeNamedItem: JSString = "removeNamedItem" + static let removeNamedItemNS: JSString = "removeNamedItemNS" + static let setNamedItem: JSString = "setNamedItem" + static let setNamedItemNS: JSString = "setNamedItemNS" } public let jsObject: JSObject @@ -27,7 +27,7 @@ public class NamedNodeMap: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Attr? { + public subscript(key: UInt32) -> Attr? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift index 6ab3af30..7b8bb7ed 100644 --- a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift +++ b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" static let registerProtocolHandler: JSString = "registerProtocolHandler" + static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" } public protocol NavigatorContentUtils: JSBridgedClass {} public extension NavigatorContentUtils { func registerProtocolHandler(scheme: String, url: String) { - _ = jsObject[Keys.registerProtocolHandler]!(scheme.jsValue(), url.jsValue()) + jsObject[Keys.registerProtocolHandler]!(scheme.jsValue(), url.jsValue()).fromJSValue()! } func unregisterProtocolHandler(scheme: String, url: String) { - _ = jsObject[Keys.unregisterProtocolHandler]!(scheme.jsValue(), url.jsValue()) + jsObject[Keys.unregisterProtocolHandler]!(scheme.jsValue(), url.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NavigatorID.swift b/Sources/DOMKit/WebIDL/NavigatorID.swift index fda29a7a..f36b625a 100644 --- a/Sources/DOMKit/WebIDL/NavigatorID.swift +++ b/Sources/DOMKit/WebIDL/NavigatorID.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { + static let appCodeName: JSString = "appCodeName" + static let appName: JSString = "appName" static let appVersion: JSString = "appVersion" + static let oscpu: JSString = "oscpu" + static let platform: JSString = "platform" static let product: JSString = "product" - static let userAgent: JSString = "userAgent" static let productSub: JSString = "productSub" + static let taintEnabled: JSString = "taintEnabled" + static let userAgent: JSString = "userAgent" static let vendor: JSString = "vendor" - static let oscpu: JSString = "oscpu" - static let platform: JSString = "platform" - static let appName: JSString = "appName" - static let appCodeName: JSString = "appCodeName" static let vendorSub: JSString = "vendorSub" - static let taintEnabled: JSString = "taintEnabled" } public protocol NavigatorID: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift index 4bbeee0f..f8ab0dc6 100644 --- a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift +++ b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift @@ -4,10 +4,10 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { + static let javaEnabled: JSString = "javaEnabled" + static let mimeTypes: JSString = "mimeTypes" static let pdfViewerEnabled: JSString = "pdfViewerEnabled" static let plugins: JSString = "plugins" - static let mimeTypes: JSString = "mimeTypes" - static let javaEnabled: JSString = "javaEnabled" } public protocol NavigatorPlugins: JSBridgedClass {} diff --git a/Sources/DOMKit/WebIDL/Node.swift b/Sources/DOMKit/WebIDL/Node.swift index 20c509b3..aac64cee 100644 --- a/Sources/DOMKit/WebIDL/Node.swift +++ b/Sources/DOMKit/WebIDL/Node.swift @@ -7,53 +7,53 @@ public class Node: EventTarget { override public class var constructor: JSFunction { JSObject.global.Node.function! } private enum Keys { - static let hasChildNodes: JSString = "hasChildNodes" - static let previousSibling: JSString = "previousSibling" + static let ATTRIBUTE_NODE: JSString = "ATTRIBUTE_NODE" + static let CDATA_SECTION_NODE: JSString = "CDATA_SECTION_NODE" + static let COMMENT_NODE: JSString = "COMMENT_NODE" + static let DOCUMENT_FRAGMENT_NODE: JSString = "DOCUMENT_FRAGMENT_NODE" + static let DOCUMENT_NODE: JSString = "DOCUMENT_NODE" + static let DOCUMENT_POSITION_CONTAINED_BY: JSString = "DOCUMENT_POSITION_CONTAINED_BY" + static let DOCUMENT_POSITION_CONTAINS: JSString = "DOCUMENT_POSITION_CONTAINS" static let DOCUMENT_POSITION_DISCONNECTED: JSString = "DOCUMENT_POSITION_DISCONNECTED" + static let DOCUMENT_POSITION_FOLLOWING: JSString = "DOCUMENT_POSITION_FOLLOWING" + static let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: JSString = "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" static let DOCUMENT_POSITION_PRECEDING: JSString = "DOCUMENT_POSITION_PRECEDING" - static let DOCUMENT_POSITION_CONTAINED_BY: JSString = "DOCUMENT_POSITION_CONTAINED_BY" - static let compareDocumentPosition: JSString = "compareDocumentPosition" - static let getRootNode: JSString = "getRootNode" static let DOCUMENT_TYPE_NODE: JSString = "DOCUMENT_TYPE_NODE" - static let lookupPrefix: JSString = "lookupPrefix" - static let TEXT_NODE: JSString = "TEXT_NODE" - static let lookupNamespaceURI: JSString = "lookupNamespaceURI" - static let isDefaultNamespace: JSString = "isDefaultNamespace" - static let normalize: JSString = "normalize" - static let insertBefore: JSString = "insertBefore" - static let ATTRIBUTE_NODE: JSString = "ATTRIBUTE_NODE" - static let replaceChild: JSString = "replaceChild" - static let parentElement: JSString = "parentElement" - static let isEqualNode: JSString = "isEqualNode" - static let textContent: JSString = "textContent" - static let PROCESSING_INSTRUCTION_NODE: JSString = "PROCESSING_INSTRUCTION_NODE" + static let ELEMENT_NODE: JSString = "ELEMENT_NODE" + static let ENTITY_NODE: JSString = "ENTITY_NODE" static let ENTITY_REFERENCE_NODE: JSString = "ENTITY_REFERENCE_NODE" - static let lastChild: JSString = "lastChild" - static let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: JSString = "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" - static let nodeValue: JSString = "nodeValue" + static let NOTATION_NODE: JSString = "NOTATION_NODE" + static let PROCESSING_INSTRUCTION_NODE: JSString = "PROCESSING_INSTRUCTION_NODE" + static let TEXT_NODE: JSString = "TEXT_NODE" static let appendChild: JSString = "appendChild" - static let DOCUMENT_FRAGMENT_NODE: JSString = "DOCUMENT_FRAGMENT_NODE" + static let baseURI: JSString = "baseURI" + static let childNodes: JSString = "childNodes" + static let cloneNode: JSString = "cloneNode" + static let compareDocumentPosition: JSString = "compareDocumentPosition" + static let contains: JSString = "contains" static let firstChild: JSString = "firstChild" - static let nodeName: JSString = "nodeName" - static let CDATA_SECTION_NODE: JSString = "CDATA_SECTION_NODE" + static let getRootNode: JSString = "getRootNode" + static let hasChildNodes: JSString = "hasChildNodes" + static let insertBefore: JSString = "insertBefore" static let isConnected: JSString = "isConnected" - static let ENTITY_NODE: JSString = "ENTITY_NODE" - static let ELEMENT_NODE: JSString = "ELEMENT_NODE" - static let DOCUMENT_POSITION_FOLLOWING: JSString = "DOCUMENT_POSITION_FOLLOWING" - static let nodeType: JSString = "nodeType" - static let contains: JSString = "contains" - static let removeChild: JSString = "removeChild" - static let NOTATION_NODE: JSString = "NOTATION_NODE" + static let isDefaultNamespace: JSString = "isDefaultNamespace" + static let isEqualNode: JSString = "isEqualNode" static let isSameNode: JSString = "isSameNode" - static let DOCUMENT_NODE: JSString = "DOCUMENT_NODE" + static let lastChild: JSString = "lastChild" + static let lookupNamespaceURI: JSString = "lookupNamespaceURI" + static let lookupPrefix: JSString = "lookupPrefix" static let nextSibling: JSString = "nextSibling" - static let cloneNode: JSString = "cloneNode" - static let parentNode: JSString = "parentNode" - static let childNodes: JSString = "childNodes" - static let COMMENT_NODE: JSString = "COMMENT_NODE" - static let baseURI: JSString = "baseURI" + static let nodeName: JSString = "nodeName" + static let nodeType: JSString = "nodeType" + static let nodeValue: JSString = "nodeValue" + static let normalize: JSString = "normalize" static let ownerDocument: JSString = "ownerDocument" - static let DOCUMENT_POSITION_CONTAINS: JSString = "DOCUMENT_POSITION_CONTAINS" + static let parentElement: JSString = "parentElement" + static let parentNode: JSString = "parentNode" + static let previousSibling: JSString = "previousSibling" + static let removeChild: JSString = "removeChild" + static let replaceChild: JSString = "replaceChild" + static let textContent: JSString = "textContent" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -149,7 +149,7 @@ public class Node: EventTarget { public var textContent: String? public func normalize() { - _ = jsObject[Keys.normalize]!() + jsObject[Keys.normalize]!().fromJSValue()! } public func cloneNode(deep: Bool? = nil) -> Self { diff --git a/Sources/DOMKit/WebIDL/NodeIterator.swift b/Sources/DOMKit/WebIDL/NodeIterator.swift index 3c1410ec..fb64a61a 100644 --- a/Sources/DOMKit/WebIDL/NodeIterator.swift +++ b/Sources/DOMKit/WebIDL/NodeIterator.swift @@ -7,14 +7,14 @@ public class NodeIterator: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.NodeIterator.function! } private enum Keys { + static let detach: JSString = "detach" static let filter: JSString = "filter" - static let whatToShow: JSString = "whatToShow" - static let previousNode: JSString = "previousNode" - static let root: JSString = "root" - static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" static let nextNode: JSString = "nextNode" - static let detach: JSString = "detach" + static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" + static let previousNode: JSString = "previousNode" static let referenceNode: JSString = "referenceNode" + static let root: JSString = "root" + static let whatToShow: JSString = "whatToShow" } public let jsObject: JSObject @@ -50,6 +50,6 @@ public class NodeIterator: JSBridgedClass { } public func detach() { - _ = jsObject[Keys.detach]!() + jsObject[Keys.detach]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NodeList.swift b/Sources/DOMKit/WebIDL/NodeList.swift index 2c515eeb..4e972a5b 100644 --- a/Sources/DOMKit/WebIDL/NodeList.swift +++ b/Sources/DOMKit/WebIDL/NodeList.swift @@ -18,7 +18,7 @@ public class NodeList: JSBridgedClass, Sequence { self.jsObject = jsObject } - public subscript(key: Int) -> Node? { + public subscript(key: UInt32) -> Node? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift index 393dbf72..21f60872 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -7,13 +7,13 @@ public class OffscreenCanvas: EventTarget { override public class var constructor: JSFunction { JSObject.global.OffscreenCanvas.function! } private enum Keys { - static let width: JSString = "width" - static let oncontextrestored: JSString = "oncontextrestored" - static let getContext: JSString = "getContext" - static let transferToImageBitmap: JSString = "transferToImageBitmap" static let convertToBlob: JSString = "convertToBlob" + static let getContext: JSString = "getContext" static let height: JSString = "height" static let oncontextlost: JSString = "oncontextlost" + static let oncontextrestored: JSString = "oncontextrestored" + static let transferToImageBitmap: JSString = "transferToImageBitmap" + static let width: JSString = "width" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift index 01e08e3a..5f71a4c3 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift @@ -19,7 +19,7 @@ public class OffscreenCanvasRenderingContext2D: JSBridgedClass, CanvasState, Can } public func commit() { - _ = jsObject[Keys.commit]!() + jsObject[Keys.commit]!().fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ParentNode.swift b/Sources/DOMKit/WebIDL/ParentNode.swift index 7dfa90eb..eba7b381 100644 --- a/Sources/DOMKit/WebIDL/ParentNode.swift +++ b/Sources/DOMKit/WebIDL/ParentNode.swift @@ -4,15 +4,15 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let querySelector: JSString = "querySelector" - static let querySelectorAll: JSString = "querySelectorAll" - static let childElementCount: JSString = "childElementCount" - static let prepend: JSString = "prepend" static let append: JSString = "append" - static let replaceChildren: JSString = "replaceChildren" - static let lastElementChild: JSString = "lastElementChild" + static let childElementCount: JSString = "childElementCount" static let children: JSString = "children" static let firstElementChild: JSString = "firstElementChild" + static let lastElementChild: JSString = "lastElementChild" + static let prepend: JSString = "prepend" + static let querySelector: JSString = "querySelector" + static let querySelectorAll: JSString = "querySelectorAll" + static let replaceChildren: JSString = "replaceChildren" } public protocol ParentNode: JSBridgedClass {} @@ -26,15 +26,15 @@ public extension ParentNode { var childElementCount: UInt32 { ReadonlyAttribute[Keys.childElementCount, in: jsObject] } func prepend(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.prepend]!(nodes.jsValue()) + jsObject[Keys.prepend]!(nodes.jsValue()).fromJSValue()! } func append(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.append]!(nodes.jsValue()) + jsObject[Keys.append]!(nodes.jsValue()).fromJSValue()! } func replaceChildren(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.replaceChildren]!(nodes.jsValue()) + jsObject[Keys.replaceChildren]!(nodes.jsValue()).fromJSValue()! } func querySelector(selectors: String) -> Element? { diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index 465e0947..9126406d 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -21,6 +21,6 @@ public class Path2D: JSBridgedClass, CanvasPath { } public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { - _ = jsObject[Keys.addPath]!(path.jsValue(), transform?.jsValue() ?? .undefined) + jsObject[Keys.addPath]!(path.jsValue(), transform?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index e5dde2a8..c98ae120 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -7,9 +7,9 @@ public class Performance: EventTarget { override public class var constructor: JSFunction { JSObject.global.Performance.function! } private enum Keys { + static let now: JSString = "now" static let timeOrigin: JSString = "timeOrigin" static let toJSON: JSString = "toJSON" - static let now: JSString = "now" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/Plugin.swift b/Sources/DOMKit/WebIDL/Plugin.swift index a8451d4d..b28958c9 100644 --- a/Sources/DOMKit/WebIDL/Plugin.swift +++ b/Sources/DOMKit/WebIDL/Plugin.swift @@ -9,10 +9,10 @@ public class Plugin: JSBridgedClass { private enum Keys { static let description: JSString = "description" static let filename: JSString = "filename" - static let length: JSString = "length" static let item: JSString = "item" - static let namedItem: JSString = "namedItem" + static let length: JSString = "length" static let name: JSString = "name" + static let namedItem: JSString = "namedItem" } public let jsObject: JSObject @@ -37,7 +37,7 @@ public class Plugin: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> MimeType? { + public subscript(key: UInt32) -> MimeType? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/PluginArray.swift b/Sources/DOMKit/WebIDL/PluginArray.swift index ca9dc7eb..c06a030d 100644 --- a/Sources/DOMKit/WebIDL/PluginArray.swift +++ b/Sources/DOMKit/WebIDL/PluginArray.swift @@ -7,10 +7,10 @@ public class PluginArray: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.PluginArray.function! } private enum Keys { - static let length: JSString = "length" - static let refresh: JSString = "refresh" static let item: JSString = "item" + static let length: JSString = "length" static let namedItem: JSString = "namedItem" + static let refresh: JSString = "refresh" } public let jsObject: JSObject @@ -21,13 +21,13 @@ public class PluginArray: JSBridgedClass { } public func refresh() { - _ = jsObject[Keys.refresh]!() + jsObject[Keys.refresh]!().fromJSValue()! } @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Plugin? { + public subscript(key: UInt32) -> Plugin? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/ProgressEvent.swift b/Sources/DOMKit/WebIDL/ProgressEvent.swift index 4d7ca9b7..9dcf312e 100644 --- a/Sources/DOMKit/WebIDL/ProgressEvent.swift +++ b/Sources/DOMKit/WebIDL/ProgressEvent.swift @@ -7,8 +7,8 @@ public class ProgressEvent: Event { override public class var constructor: JSFunction { JSObject.global.ProgressEvent.function! } private enum Keys { - static let loaded: JSString = "loaded" static let lengthComputable: JSString = "lengthComputable" + static let loaded: JSString = "loaded" static let total: JSString = "total" } diff --git a/Sources/DOMKit/WebIDL/ProgressEventInit.swift b/Sources/DOMKit/WebIDL/ProgressEventInit.swift index 2b434f8d..9fb567c4 100644 --- a/Sources/DOMKit/WebIDL/ProgressEventInit.swift +++ b/Sources/DOMKit/WebIDL/ProgressEventInit.swift @@ -5,9 +5,9 @@ import JavaScriptKit public class ProgressEventInit: BridgedDictionary { private enum Keys { - static let total: JSString = "total" static let lengthComputable: JSString = "lengthComputable" static let loaded: JSString = "loaded" + static let total: JSString = "total" } public convenience init(lengthComputable: Bool, loaded: UInt64, total: UInt64) { diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 6a19ab4c..99829465 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -7,31 +7,31 @@ public class Range: AbstractRange { override public class var constructor: JSFunction { JSObject.global.Range.function! } private enum Keys { + static let END_TO_END: JSString = "END_TO_END" + static let END_TO_START: JSString = "END_TO_START" + static let START_TO_END: JSString = "START_TO_END" + static let START_TO_START: JSString = "START_TO_START" + static let cloneContents: JSString = "cloneContents" + static let cloneRange: JSString = "cloneRange" + static let collapse: JSString = "collapse" + static let commonAncestorContainer: JSString = "commonAncestorContainer" + static let compareBoundaryPoints: JSString = "compareBoundaryPoints" + static let comparePoint: JSString = "comparePoint" static let deleteContents: JSString = "deleteContents" static let detach: JSString = "detach" + static let extractContents: JSString = "extractContents" + static let insertNode: JSString = "insertNode" + static let intersectsNode: JSString = "intersectsNode" + static let isPointInRange: JSString = "isPointInRange" + static let selectNode: JSString = "selectNode" + static let selectNodeContents: JSString = "selectNodeContents" static let setEnd: JSString = "setEnd" - static let setStart: JSString = "setStart" static let setEndAfter: JSString = "setEndAfter" - static let collapse: JSString = "collapse" - static let selectNode: JSString = "selectNode" - static let END_TO_START: JSString = "END_TO_START" - static let isPointInRange: JSString = "isPointInRange" - static let comparePoint: JSString = "comparePoint" - static let insertNode: JSString = "insertNode" - static let extractContents: JSString = "extractContents" static let setEndBefore: JSString = "setEndBefore" - static let cloneContents: JSString = "cloneContents" - static let surroundContents: JSString = "surroundContents" - static let compareBoundaryPoints: JSString = "compareBoundaryPoints" - static let setStartBefore: JSString = "setStartBefore" - static let START_TO_START: JSString = "START_TO_START" - static let cloneRange: JSString = "cloneRange" - static let END_TO_END: JSString = "END_TO_END" - static let commonAncestorContainer: JSString = "commonAncestorContainer" + static let setStart: JSString = "setStart" static let setStartAfter: JSString = "setStartAfter" - static let START_TO_END: JSString = "START_TO_END" - static let selectNodeContents: JSString = "selectNodeContents" - static let intersectsNode: JSString = "intersectsNode" + static let setStartBefore: JSString = "setStartBefore" + static let surroundContents: JSString = "surroundContents" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -47,39 +47,39 @@ public class Range: AbstractRange { public var commonAncestorContainer: Node public func setStart(node: Node, offset: UInt32) { - _ = jsObject[Keys.setStart]!(node.jsValue(), offset.jsValue()) + jsObject[Keys.setStart]!(node.jsValue(), offset.jsValue()).fromJSValue()! } public func setEnd(node: Node, offset: UInt32) { - _ = jsObject[Keys.setEnd]!(node.jsValue(), offset.jsValue()) + jsObject[Keys.setEnd]!(node.jsValue(), offset.jsValue()).fromJSValue()! } public func setStartBefore(node: Node) { - _ = jsObject[Keys.setStartBefore]!(node.jsValue()) + jsObject[Keys.setStartBefore]!(node.jsValue()).fromJSValue()! } public func setStartAfter(node: Node) { - _ = jsObject[Keys.setStartAfter]!(node.jsValue()) + jsObject[Keys.setStartAfter]!(node.jsValue()).fromJSValue()! } public func setEndBefore(node: Node) { - _ = jsObject[Keys.setEndBefore]!(node.jsValue()) + jsObject[Keys.setEndBefore]!(node.jsValue()).fromJSValue()! } public func setEndAfter(node: Node) { - _ = jsObject[Keys.setEndAfter]!(node.jsValue()) + jsObject[Keys.setEndAfter]!(node.jsValue()).fromJSValue()! } public func collapse(toStart: Bool? = nil) { - _ = jsObject[Keys.collapse]!(toStart?.jsValue() ?? .undefined) + jsObject[Keys.collapse]!(toStart?.jsValue() ?? .undefined).fromJSValue()! } public func selectNode(node: Node) { - _ = jsObject[Keys.selectNode]!(node.jsValue()) + jsObject[Keys.selectNode]!(node.jsValue()).fromJSValue()! } public func selectNodeContents(node: Node) { - _ = jsObject[Keys.selectNodeContents]!(node.jsValue()) + jsObject[Keys.selectNodeContents]!(node.jsValue()).fromJSValue()! } public static let START_TO_START: UInt16 = 0 @@ -95,7 +95,7 @@ public class Range: AbstractRange { } public func deleteContents() { - _ = jsObject[Keys.deleteContents]!() + jsObject[Keys.deleteContents]!().fromJSValue()! } public func extractContents() -> DocumentFragment { @@ -107,11 +107,11 @@ public class Range: AbstractRange { } public func insertNode(node: Node) { - _ = jsObject[Keys.insertNode]!(node.jsValue()) + jsObject[Keys.insertNode]!(node.jsValue()).fromJSValue()! } public func surroundContents(newParent: Node) { - _ = jsObject[Keys.surroundContents]!(newParent.jsValue()) + jsObject[Keys.surroundContents]!(newParent.jsValue()).fromJSValue()! } public func cloneRange() -> Self { @@ -119,7 +119,7 @@ public class Range: AbstractRange { } public func detach() { - _ = jsObject[Keys.detach]!() + jsObject[Keys.detach]!().fromJSValue()! } public func isPointInRange(node: Node, offset: UInt32) -> Bool { diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift index e9d8b07a..296c3916 100644 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift @@ -7,11 +7,11 @@ public class ReadableByteStreamController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ReadableByteStreamController.function! } private enum Keys { + static let byobRequest: JSString = "byobRequest" + static let close: JSString = "close" static let desiredSize: JSString = "desiredSize" static let enqueue: JSString = "enqueue" - static let close: JSString = "close" static let error: JSString = "error" - static let byobRequest: JSString = "byobRequest" } public let jsObject: JSObject @@ -29,14 +29,14 @@ public class ReadableByteStreamController: JSBridgedClass { public var desiredSize: Double? public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } public func enqueue(chunk: ArrayBufferView) { - _ = jsObject[Keys.enqueue]!(chunk.jsValue()) + jsObject[Keys.enqueue]!(chunk.jsValue()).fromJSValue()! } public func error(e: JSValue? = nil) { - _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) + jsObject[Keys.error]!(e?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ReadableStream.swift b/Sources/DOMKit/WebIDL/ReadableStream.swift index 5adbe1b5..02166a47 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -7,12 +7,12 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { public class var constructor: JSFunction { JSObject.global.ReadableStream.function! } private enum Keys { - static let pipeTo: JSString = "pipeTo" - static let pipeThrough: JSString = "pipeThrough" static let cancel: JSString = "cancel" static let getReader: JSString = "getReader" - static let tee: JSString = "tee" static let locked: JSString = "locked" + static let pipeThrough: JSString = "pipeThrough" + static let pipeTo: JSString = "pipeTo" + static let tee: JSString = "tee" } public let jsObject: JSObject @@ -36,7 +36,7 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func cancel(reason: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } public func getReader(options: ReadableStreamGetReaderOptions? = nil) -> ReadableStreamReader { @@ -54,7 +54,7 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) async throws { let _promise: JSPromise = jsObject[Keys.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } public func tee() -> [ReadableStream] { diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift index d3eb915a..30fd332a 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift @@ -5,8 +5,8 @@ import JavaScriptKit public class ReadableStreamBYOBReadResult: BridgedDictionary { private enum Keys { - static let value: JSString = "value" static let done: JSString = "done" + static let value: JSString = "value" } public convenience init(value: __UNSUPPORTED_UNION__, done: Bool) { diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift index a6dd84b3..2dfbed60 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -7,8 +7,8 @@ public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericRead public class var constructor: JSFunction { JSObject.global.ReadableStreamBYOBReader.function! } private enum Keys { - static let releaseLock: JSString = "releaseLock" static let read: JSString = "read" + static let releaseLock: JSString = "releaseLock" } public let jsObject: JSObject @@ -32,6 +32,6 @@ public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericRead } public func releaseLock() { - _ = jsObject[Keys.releaseLock]!() + jsObject[Keys.releaseLock]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift index b66e5a85..7702aa5d 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift @@ -23,10 +23,10 @@ public class ReadableStreamBYOBRequest: JSBridgedClass { public var view: ArrayBufferView? public func respond(bytesWritten: UInt64) { - _ = jsObject[Keys.respond]!(bytesWritten.jsValue()) + jsObject[Keys.respond]!(bytesWritten.jsValue()).fromJSValue()! } public func respondWithNewView(view: ArrayBufferView) { - _ = jsObject[Keys.respondWithNewView]!(view.jsValue()) + jsObject[Keys.respondWithNewView]!(view.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift index a53e30a1..99f20b9c 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift @@ -9,8 +9,8 @@ public class ReadableStreamDefaultController: JSBridgedClass { private enum Keys { static let close: JSString = "close" static let desiredSize: JSString = "desiredSize" - static let error: JSString = "error" static let enqueue: JSString = "enqueue" + static let error: JSString = "error" } public let jsObject: JSObject @@ -24,14 +24,14 @@ public class ReadableStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } public func enqueue(chunk: JSValue? = nil) { - _ = jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined) + jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined).fromJSValue()! } public func error(e: JSValue? = nil) { - _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) + jsObject[Keys.error]!(e?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift index 5527b8a4..64df4997 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift @@ -5,8 +5,8 @@ import JavaScriptKit public class ReadableStreamDefaultReadResult: BridgedDictionary { private enum Keys { - static let value: JSString = "value" static let done: JSString = "done" + static let value: JSString = "value" } public convenience init(value: JSValue, done: Bool) { diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift index 510d333f..c18efe6a 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -7,8 +7,8 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR public class var constructor: JSFunction { JSObject.global.ReadableStreamDefaultReader.function! } private enum Keys { - static let releaseLock: JSString = "releaseLock" static let read: JSString = "read" + static let releaseLock: JSString = "releaseLock" } public let jsObject: JSObject @@ -32,6 +32,6 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR } public func releaseLock() { - _ = jsObject[Keys.releaseLock]!() + jsObject[Keys.releaseLock]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift index b391f377..cc07521f 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift @@ -19,6 +19,6 @@ public extension ReadableStreamGenericReader { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func cancel(reason: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift index 0d78c1f4..ebe3ff90 100644 --- a/Sources/DOMKit/WebIDL/Request.swift +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -7,22 +7,22 @@ public class Request: JSBridgedClass, Body { public class var constructor: JSFunction { JSObject.global.Request.function! } private enum Keys { - static let clone: JSString = "clone" - static let referrer: JSString = "referrer" - static let redirect: JSString = "redirect" - static let signal: JSString = "signal" - static let mode: JSString = "mode" - static let isHistoryNavigation: JSString = "isHistoryNavigation" - static let keepalive: JSString = "keepalive" static let cache: JSString = "cache" + static let clone: JSString = "clone" static let credentials: JSString = "credentials" + static let destination: JSString = "destination" static let headers: JSString = "headers" - static let url: JSString = "url" static let integrity: JSString = "integrity" - static let destination: JSString = "destination" + static let isHistoryNavigation: JSString = "isHistoryNavigation" + static let isReloadNavigation: JSString = "isReloadNavigation" + static let keepalive: JSString = "keepalive" static let method: JSString = "method" + static let mode: JSString = "mode" + static let redirect: JSString = "redirect" + static let referrer: JSString = "referrer" static let referrerPolicy: JSString = "referrerPolicy" - static let isReloadNavigation: JSString = "isReloadNavigation" + static let signal: JSString = "signal" + static let url: JSString = "url" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/RequestInit.swift b/Sources/DOMKit/WebIDL/RequestInit.swift index bb70ebee..121a87f9 100644 --- a/Sources/DOMKit/WebIDL/RequestInit.swift +++ b/Sources/DOMKit/WebIDL/RequestInit.swift @@ -5,19 +5,19 @@ import JavaScriptKit public class RequestInit: BridgedDictionary { private enum Keys { + static let body: JSString = "body" + static let cache: JSString = "cache" static let credentials: JSString = "credentials" + static let headers: JSString = "headers" static let integrity: JSString = "integrity" - static let mode: JSString = "mode" - static let referrerPolicy: JSString = "referrerPolicy" - static let redirect: JSString = "redirect" - static let body: JSString = "body" static let keepalive: JSString = "keepalive" - static let headers: JSString = "headers" - static let cache: JSString = "cache" static let method: JSString = "method" + static let mode: JSString = "mode" + static let redirect: JSString = "redirect" + static let referrer: JSString = "referrer" + static let referrerPolicy: JSString = "referrerPolicy" static let signal: JSString = "signal" static let window: JSString = "window" - static let referrer: JSString = "referrer" } public convenience init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue) { diff --git a/Sources/DOMKit/WebIDL/Response.swift b/Sources/DOMKit/WebIDL/Response.swift index e5d3c2bd..079038da 100644 --- a/Sources/DOMKit/WebIDL/Response.swift +++ b/Sources/DOMKit/WebIDL/Response.swift @@ -7,15 +7,15 @@ public class Response: JSBridgedClass, Body { public class var constructor: JSFunction { JSObject.global.Response.function! } private enum Keys { - static let redirected: JSString = "redirected" - static let type: JSString = "type" - static let status: JSString = "status" - static let statusText: JSString = "statusText" - static let headers: JSString = "headers" static let clone: JSString = "clone" - static let ok: JSString = "ok" static let error: JSString = "error" + static let headers: JSString = "headers" + static let ok: JSString = "ok" static let redirect: JSString = "redirect" + static let redirected: JSString = "redirected" + static let status: JSString = "status" + static let statusText: JSString = "statusText" + static let type: JSString = "type" static let url: JSString = "url" } diff --git a/Sources/DOMKit/WebIDL/ShadowRoot.swift b/Sources/DOMKit/WebIDL/ShadowRoot.swift index 068135b5..dab3ff57 100644 --- a/Sources/DOMKit/WebIDL/ShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/ShadowRoot.swift @@ -7,11 +7,11 @@ public class ShadowRoot: DocumentFragment, DocumentOrShadowRoot { override public class var constructor: JSFunction { JSObject.global.ShadowRoot.function! } private enum Keys { - static let onslotchange: JSString = "onslotchange" static let delegatesFocus: JSString = "delegatesFocus" + static let host: JSString = "host" static let mode: JSString = "mode" + static let onslotchange: JSString = "onslotchange" static let slotAssignment: JSString = "slotAssignment" - static let host: JSString = "host" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/ShadowRootInit.swift b/Sources/DOMKit/WebIDL/ShadowRootInit.swift index 6a7d74b4..c31af858 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootInit.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootInit.swift @@ -5,9 +5,9 @@ import JavaScriptKit public class ShadowRootInit: BridgedDictionary { private enum Keys { - static let slotAssignment: JSString = "slotAssignment" static let delegatesFocus: JSString = "delegatesFocus" static let mode: JSString = "mode" + static let slotAssignment: JSString = "slotAssignment" } public convenience init(mode: ShadowRootMode, delegatesFocus: Bool, slotAssignment: SlotAssignmentMode) { diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift index 8ecb94f0..266e4aa3 100644 --- a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift @@ -7,9 +7,9 @@ public class SharedWorkerGlobalScope: WorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global.SharedWorkerGlobalScope.function! } private enum Keys { - static let onconnect: JSString = "onconnect" - static let name: JSString = "name" static let close: JSString = "close" + static let name: JSString = "name" + static let onconnect: JSString = "onconnect" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -22,7 +22,7 @@ public class SharedWorkerGlobalScope: WorkerGlobalScope { public var name: String public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/StaticRangeInit.swift b/Sources/DOMKit/WebIDL/StaticRangeInit.swift index b442fc36..7861b0db 100644 --- a/Sources/DOMKit/WebIDL/StaticRangeInit.swift +++ b/Sources/DOMKit/WebIDL/StaticRangeInit.swift @@ -5,8 +5,8 @@ import JavaScriptKit public class StaticRangeInit: BridgedDictionary { private enum Keys { - static let endOffset: JSString = "endOffset" static let endContainer: JSString = "endContainer" + static let endOffset: JSString = "endOffset" static let startContainer: JSString = "startContainer" static let startOffset: JSString = "startOffset" } diff --git a/Sources/DOMKit/WebIDL/Storage.swift b/Sources/DOMKit/WebIDL/Storage.swift index aeb8a3e7..6d24072c 100644 --- a/Sources/DOMKit/WebIDL/Storage.swift +++ b/Sources/DOMKit/WebIDL/Storage.swift @@ -8,10 +8,10 @@ public class Storage: JSBridgedClass { private enum Keys { static let clear: JSString = "clear" - static let key: JSString = "key" - static let removeItem: JSString = "removeItem" static let getItem: JSString = "getItem" + static let key: JSString = "key" static let length: JSString = "length" + static let removeItem: JSString = "removeItem" static let setItem: JSString = "setItem" } @@ -33,11 +33,11 @@ public class Storage: JSBridgedClass { jsObject[key].fromJSValue() } - // XXX: unsupported setter for keys of type String + // XXX: unsupported setter for keys of type `String` - // XXX: unsupported deleter for keys of type String + // XXX: unsupported deleter for keys of type `String` public func clear() { - _ = jsObject[Keys.clear]!() + jsObject[Keys.clear]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift index 2dd1a91d..8ecc538f 100644 --- a/Sources/DOMKit/WebIDL/StorageEvent.swift +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -7,12 +7,12 @@ public class StorageEvent: Event { override public class var constructor: JSFunction { JSObject.global.StorageEvent.function! } private enum Keys { - static let oldValue: JSString = "oldValue" + static let initStorageEvent: JSString = "initStorageEvent" static let key: JSString = "key" + static let newValue: JSString = "newValue" + static let oldValue: JSString = "oldValue" static let storageArea: JSString = "storageArea" static let url: JSString = "url" - static let newValue: JSString = "newValue" - static let initStorageEvent: JSString = "initStorageEvent" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -52,6 +52,6 @@ public class StorageEvent: Event { let _arg5 = newValue?.jsValue() ?? .undefined let _arg6 = url?.jsValue() ?? .undefined let _arg7 = storageArea?.jsValue() ?? .undefined - _ = jsObject[Keys.initStorageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + return jsObject[Keys.initStorageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/StorageEventInit.swift b/Sources/DOMKit/WebIDL/StorageEventInit.swift index a38d657a..bbbefcb6 100644 --- a/Sources/DOMKit/WebIDL/StorageEventInit.swift +++ b/Sources/DOMKit/WebIDL/StorageEventInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class StorageEventInit: BridgedDictionary { private enum Keys { static let key: JSString = "key" - static let url: JSString = "url" - static let oldValue: JSString = "oldValue" static let newValue: JSString = "newValue" + static let oldValue: JSString = "oldValue" static let storageArea: JSString = "storageArea" + static let url: JSString = "url" } public convenience init(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?) { diff --git a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift index d0d6478b..d5f8ae74 100644 --- a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift +++ b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift @@ -5,10 +5,10 @@ import JavaScriptKit public class StreamPipeOptions: BridgedDictionary { private enum Keys { - static let preventClose: JSString = "preventClose" static let preventAbort: JSString = "preventAbort" - static let signal: JSString = "signal" static let preventCancel: JSString = "preventCancel" + static let preventClose: JSString = "preventClose" + static let signal: JSString = "signal" } public convenience init(preventClose: Bool, preventAbort: Bool, preventCancel: Bool, signal: AbortSignal) { diff --git a/Sources/DOMKit/WebIDL/StyleSheet.swift b/Sources/DOMKit/WebIDL/StyleSheet.swift index f12f9c03..3d7ceb07 100644 --- a/Sources/DOMKit/WebIDL/StyleSheet.swift +++ b/Sources/DOMKit/WebIDL/StyleSheet.swift @@ -7,13 +7,13 @@ public class StyleSheet: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.StyleSheet.function! } private enum Keys { - static let title: JSString = "title" static let disabled: JSString = "disabled" - static let type: JSString = "type" - static let ownerNode: JSString = "ownerNode" static let href: JSString = "href" static let media: JSString = "media" + static let ownerNode: JSString = "ownerNode" static let parentStyleSheet: JSString = "parentStyleSheet" + static let title: JSString = "title" + static let type: JSString = "type" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/StyleSheetList.swift b/Sources/DOMKit/WebIDL/StyleSheetList.swift index 41acf789..4c45a678 100644 --- a/Sources/DOMKit/WebIDL/StyleSheetList.swift +++ b/Sources/DOMKit/WebIDL/StyleSheetList.swift @@ -18,7 +18,7 @@ public class StyleSheetList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: Int) -> CSSStyleSheet? { + public subscript(key: UInt32) -> CSSStyleSheet? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index 9f57fa34..742ac845 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -7,8 +7,8 @@ public class Text: CharacterData, Slottable { override public class var constructor: JSFunction { JSObject.global.Text.function! } private enum Keys { - static let wholeText: JSString = "wholeText" static let splitText: JSString = "splitText" + static let wholeText: JSString = "wholeText" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/TextMetrics.swift b/Sources/DOMKit/WebIDL/TextMetrics.swift index 0f3bb189..6bf424e0 100644 --- a/Sources/DOMKit/WebIDL/TextMetrics.swift +++ b/Sources/DOMKit/WebIDL/TextMetrics.swift @@ -7,18 +7,18 @@ public class TextMetrics: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TextMetrics.function! } private enum Keys { - static let actualBoundingBoxRight: JSString = "actualBoundingBoxRight" - static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" - static let hangingBaseline: JSString = "hangingBaseline" - static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" + static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" + static let actualBoundingBoxRight: JSString = "actualBoundingBoxRight" static let alphabeticBaseline: JSString = "alphabeticBaseline" + static let emHeightAscent: JSString = "emHeightAscent" static let emHeightDescent: JSString = "emHeightDescent" - static let width: JSString = "width" + static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" static let fontBoundingBoxDescent: JSString = "fontBoundingBoxDescent" - static let emHeightAscent: JSString = "emHeightAscent" + static let hangingBaseline: JSString = "hangingBaseline" static let ideographicBaseline: JSString = "ideographicBaseline" + static let width: JSString = "width" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index 923febb3..d1bbbb7b 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -7,17 +7,17 @@ public class TextTrack: EventTarget { override public class var constructor: JSFunction { JSObject.global.TextTrack.function! } private enum Keys { - static let removeCue: JSString = "removeCue" - static let cues: JSString = "cues" + static let activeCues: JSString = "activeCues" static let addCue: JSString = "addCue" - static let label: JSString = "label" - static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" + static let cues: JSString = "cues" static let id: JSString = "id" - static let oncuechange: JSString = "oncuechange" - static let language: JSString = "language" + static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" static let kind: JSString = "kind" - static let activeCues: JSString = "activeCues" + static let label: JSString = "label" + static let language: JSString = "language" static let mode: JSString = "mode" + static let oncuechange: JSString = "oncuechange" + static let removeCue: JSString = "removeCue" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -58,11 +58,11 @@ public class TextTrack: EventTarget { public var activeCues: TextTrackCueList? public func addCue(cue: TextTrackCue) { - _ = jsObject[Keys.addCue]!(cue.jsValue()) + jsObject[Keys.addCue]!(cue.jsValue()).fromJSValue()! } public func removeCue(cue: TextTrackCue) { - _ = jsObject[Keys.removeCue]!(cue.jsValue()) + jsObject[Keys.removeCue]!(cue.jsValue()).fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/TextTrackCue.swift b/Sources/DOMKit/WebIDL/TextTrackCue.swift index 78bd90c6..173bc802 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCue.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCue.swift @@ -7,13 +7,13 @@ public class TextTrackCue: EventTarget { override public class var constructor: JSFunction { JSObject.global.TextTrackCue.function! } private enum Keys { - static let startTime: JSString = "startTime" - static let track: JSString = "track" static let endTime: JSString = "endTime" - static let pauseOnExit: JSString = "pauseOnExit" - static let onenter: JSString = "onenter" static let id: JSString = "id" + static let onenter: JSString = "onenter" static let onexit: JSString = "onexit" + static let pauseOnExit: JSString = "pauseOnExit" + static let startTime: JSString = "startTime" + static let track: JSString = "track" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/TextTrackCueList.swift b/Sources/DOMKit/WebIDL/TextTrackCueList.swift index 122b45af..6d448faf 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCueList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCueList.swift @@ -21,7 +21,7 @@ public class TextTrackCueList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> TextTrackCue { + public subscript(key: UInt32) -> TextTrackCue { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift index f2bb6ce1..2137a2fa 100644 --- a/Sources/DOMKit/WebIDL/TextTrackList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -7,11 +7,11 @@ public class TextTrackList: EventTarget { override public class var constructor: JSFunction { JSObject.global.TextTrackList.function! } private enum Keys { - static let onremovetrack: JSString = "onremovetrack" + static let getTrackById: JSString = "getTrackById" + static let length: JSString = "length" static let onaddtrack: JSString = "onaddtrack" static let onchange: JSString = "onchange" - static let length: JSString = "length" - static let getTrackById: JSString = "getTrackById" + static let onremovetrack: JSString = "onremovetrack" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -25,7 +25,7 @@ public class TextTrackList: EventTarget { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> TextTrack { + public subscript(key: UInt32) -> TextTrack { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TimeRanges.swift b/Sources/DOMKit/WebIDL/TimeRanges.swift index 01122c26..88082cae 100644 --- a/Sources/DOMKit/WebIDL/TimeRanges.swift +++ b/Sources/DOMKit/WebIDL/TimeRanges.swift @@ -7,9 +7,9 @@ public class TimeRanges: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TimeRanges.function! } private enum Keys { - static let start: JSString = "start" - static let length: JSString = "length" static let end: JSString = "end" + static let length: JSString = "length" + static let start: JSString = "start" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift index 6c2c66cc..d47b8341 100644 --- a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift @@ -7,10 +7,10 @@ public class TransformStreamDefaultController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TransformStreamDefaultController.function! } private enum Keys { - static let terminate: JSString = "terminate" static let desiredSize: JSString = "desiredSize" static let enqueue: JSString = "enqueue" static let error: JSString = "error" + static let terminate: JSString = "terminate" } public let jsObject: JSObject @@ -24,14 +24,14 @@ public class TransformStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func enqueue(chunk: JSValue? = nil) { - _ = jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined) + jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined).fromJSValue()! } public func error(reason: JSValue? = nil) { - _ = jsObject[Keys.error]!(reason?.jsValue() ?? .undefined) + jsObject[Keys.error]!(reason?.jsValue() ?? .undefined).fromJSValue()! } public func terminate() { - _ = jsObject[Keys.terminate]!() + jsObject[Keys.terminate]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Transformer.swift b/Sources/DOMKit/WebIDL/Transformer.swift index 515348a1..7fdd443a 100644 --- a/Sources/DOMKit/WebIDL/Transformer.swift +++ b/Sources/DOMKit/WebIDL/Transformer.swift @@ -5,11 +5,11 @@ import JavaScriptKit public class Transformer: BridgedDictionary { private enum Keys { - static let writableType: JSString = "writableType" - static let start: JSString = "start" static let flush: JSString = "flush" - static let transform: JSString = "transform" static let readableType: JSString = "readableType" + static let start: JSString = "start" + static let transform: JSString = "transform" + static let writableType: JSString = "writableType" } public convenience init(start: @escaping TransformerStartCallback, transform: @escaping TransformerTransformCallback, flush: @escaping TransformerFlushCallback, readableType: JSValue, writableType: JSValue) { diff --git a/Sources/DOMKit/WebIDL/TreeWalker.swift b/Sources/DOMKit/WebIDL/TreeWalker.swift index 89e933bc..82edd454 100644 --- a/Sources/DOMKit/WebIDL/TreeWalker.swift +++ b/Sources/DOMKit/WebIDL/TreeWalker.swift @@ -7,17 +7,17 @@ public class TreeWalker: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TreeWalker.function! } private enum Keys { - static let parentNode: JSString = "parentNode" + static let currentNode: JSString = "currentNode" static let filter: JSString = "filter" - static let previousSibling: JSString = "previousSibling" - static let nextSibling: JSString = "nextSibling" static let firstChild: JSString = "firstChild" - static let currentNode: JSString = "currentNode" + static let lastChild: JSString = "lastChild" + static let nextNode: JSString = "nextNode" + static let nextSibling: JSString = "nextSibling" + static let parentNode: JSString = "parentNode" static let previousNode: JSString = "previousNode" + static let previousSibling: JSString = "previousSibling" static let root: JSString = "root" static let whatToShow: JSString = "whatToShow" - static let lastChild: JSString = "lastChild" - static let nextNode: JSString = "nextNode" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index 6d018fa8..a67371c7 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -7,10 +7,10 @@ public class UIEvent: Event { override public class var constructor: JSFunction { JSObject.global.UIEvent.function! } private enum Keys { - static let view: JSString = "view" static let detail: JSString = "detail" - static let which: JSString = "which" static let initUIEvent: JSString = "initUIEvent" + static let view: JSString = "view" + static let which: JSString = "which" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -31,7 +31,7 @@ public class UIEvent: Event { public var detail: Int32 public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil) { - _ = jsObject[Keys.initUIEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined) + jsObject[Keys.initUIEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/UIEventInit.swift b/Sources/DOMKit/WebIDL/UIEventInit.swift index 9e60a25a..0e312303 100644 --- a/Sources/DOMKit/WebIDL/UIEventInit.swift +++ b/Sources/DOMKit/WebIDL/UIEventInit.swift @@ -5,9 +5,9 @@ import JavaScriptKit public class UIEventInit: BridgedDictionary { private enum Keys { - static let which: JSString = "which" - static let view: JSString = "view" static let detail: JSString = "detail" + static let view: JSString = "view" + static let which: JSString = "which" } public convenience init(view: Window?, detail: Int32, which: UInt32) { diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index e884ce66..72ae93d7 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -7,8 +7,8 @@ public class URL: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.URL.function! } private enum Keys { - static let revokeObjectURL: JSString = "revokeObjectURL" static let createObjectURL: JSString = "createObjectURL" + static let revokeObjectURL: JSString = "revokeObjectURL" } public let jsObject: JSObject @@ -22,6 +22,6 @@ public class URL: JSBridgedClass { } public static func revokeObjectURL(url: String) { - _ = constructor[Keys.revokeObjectURL]!(url.jsValue()) + constructor[Keys.revokeObjectURL]!(url.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift index 3adf4cee..7f3a2c7d 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSink.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSink.swift @@ -5,11 +5,11 @@ import JavaScriptKit public class UnderlyingSink: BridgedDictionary { private enum Keys { - static let type: JSString = "type" static let abort: JSString = "abort" + static let close: JSString = "close" static let start: JSString = "start" + static let type: JSString = "type" static let write: JSString = "write" - static let close: JSString = "close" } public convenience init(start: @escaping UnderlyingSinkStartCallback, write: @escaping UnderlyingSinkWriteCallback, close: @escaping UnderlyingSinkCloseCallback, abort: @escaping UnderlyingSinkAbortCallback, type: JSValue) { diff --git a/Sources/DOMKit/WebIDL/UnderlyingSource.swift b/Sources/DOMKit/WebIDL/UnderlyingSource.swift index 92999796..87e66ee8 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSource.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSource.swift @@ -5,11 +5,11 @@ import JavaScriptKit public class UnderlyingSource: BridgedDictionary { private enum Keys { - static let cancel: JSString = "cancel" static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" - static let type: JSString = "type" + static let cancel: JSString = "cancel" static let pull: JSString = "pull" static let start: JSString = "start" + static let type: JSString = "type" } public convenience init(start: @escaping UnderlyingSourceStartCallback, pull: @escaping UnderlyingSourcePullCallback, cancel: @escaping UnderlyingSourceCancelCallback, type: ReadableStreamType, autoAllocateChunkSize: UInt64) { diff --git a/Sources/DOMKit/WebIDL/ValidityState.swift b/Sources/DOMKit/WebIDL/ValidityState.swift index c68a226b..9470bb39 100644 --- a/Sources/DOMKit/WebIDL/ValidityState.swift +++ b/Sources/DOMKit/WebIDL/ValidityState.swift @@ -7,17 +7,17 @@ public class ValidityState: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ValidityState.function! } private enum Keys { - static let stepMismatch: JSString = "stepMismatch" - static let typeMismatch: JSString = "typeMismatch" - static let valid: JSString = "valid" + static let badInput: JSString = "badInput" static let customError: JSString = "customError" static let patternMismatch: JSString = "patternMismatch" - static let valueMissing: JSString = "valueMissing" - static let rangeUnderflow: JSString = "rangeUnderflow" static let rangeOverflow: JSString = "rangeOverflow" - static let badInput: JSString = "badInput" - static let tooShort: JSString = "tooShort" + static let rangeUnderflow: JSString = "rangeUnderflow" + static let stepMismatch: JSString = "stepMismatch" static let tooLong: JSString = "tooLong" + static let tooShort: JSString = "tooShort" + static let typeMismatch: JSString = "typeMismatch" + static let valid: JSString = "valid" + static let valueMissing: JSString = "valueMissing" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift index 39240df2..3041e5ee 100644 --- a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift +++ b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class ValidityStateFlags: BridgedDictionary { private enum Keys { static let badInput: JSString = "badInput" + static let customError: JSString = "customError" static let patternMismatch: JSString = "patternMismatch" - static let tooShort: JSString = "tooShort" + static let rangeOverflow: JSString = "rangeOverflow" static let rangeUnderflow: JSString = "rangeUnderflow" static let stepMismatch: JSString = "stepMismatch" - static let customError: JSString = "customError" + static let tooLong: JSString = "tooLong" + static let tooShort: JSString = "tooShort" static let typeMismatch: JSString = "typeMismatch" static let valueMissing: JSString = "valueMissing" - static let rangeOverflow: JSString = "rangeOverflow" - static let tooLong: JSString = "tooLong" } public convenience init(valueMissing: Bool, typeMismatch: Bool, patternMismatch: Bool, tooLong: Bool, tooShort: Bool, rangeUnderflow: Bool, rangeOverflow: Bool, stepMismatch: Bool, badInput: Bool, customError: Bool) { diff --git a/Sources/DOMKit/WebIDL/VideoTrack.swift b/Sources/DOMKit/WebIDL/VideoTrack.swift index f9b49d69..ff691306 100644 --- a/Sources/DOMKit/WebIDL/VideoTrack.swift +++ b/Sources/DOMKit/WebIDL/VideoTrack.swift @@ -7,11 +7,11 @@ public class VideoTrack: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.VideoTrack.function! } private enum Keys { - static let selected: JSString = "selected" - static let language: JSString = "language" - static let kind: JSString = "kind" static let id: JSString = "id" + static let kind: JSString = "kind" static let label: JSString = "label" + static let language: JSString = "language" + static let selected: JSString = "selected" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift index d13e9ee3..28db9735 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackList.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -7,12 +7,12 @@ public class VideoTrackList: EventTarget { override public class var constructor: JSFunction { JSObject.global.VideoTrackList.function! } private enum Keys { - static let length: JSString = "length" static let getTrackById: JSString = "getTrackById" - static let onchange: JSString = "onchange" - static let selectedIndex: JSString = "selectedIndex" + static let length: JSString = "length" static let onaddtrack: JSString = "onaddtrack" + static let onchange: JSString = "onchange" static let onremovetrack: JSString = "onremovetrack" + static let selectedIndex: JSString = "selectedIndex" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -27,7 +27,7 @@ public class VideoTrackList: EventTarget { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> VideoTrack { + public subscript(key: UInt32) -> VideoTrack { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/WheelEvent.swift b/Sources/DOMKit/WebIDL/WheelEvent.swift index 5fd24136..2ee1d488 100644 --- a/Sources/DOMKit/WebIDL/WheelEvent.swift +++ b/Sources/DOMKit/WebIDL/WheelEvent.swift @@ -7,13 +7,13 @@ public class WheelEvent: MouseEvent { override public class var constructor: JSFunction { JSObject.global.WheelEvent.function! } private enum Keys { - static let DOM_DELTA_PIXEL: JSString = "DOM_DELTA_PIXEL" - static let deltaY: JSString = "deltaY" - static let DOM_DELTA_PAGE: JSString = "DOM_DELTA_PAGE" - static let deltaZ: JSString = "deltaZ" static let DOM_DELTA_LINE: JSString = "DOM_DELTA_LINE" + static let DOM_DELTA_PAGE: JSString = "DOM_DELTA_PAGE" + static let DOM_DELTA_PIXEL: JSString = "DOM_DELTA_PIXEL" static let deltaMode: JSString = "deltaMode" static let deltaX: JSString = "deltaX" + static let deltaY: JSString = "deltaY" + static let deltaZ: JSString = "deltaZ" } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/WheelEventInit.swift b/Sources/DOMKit/WebIDL/WheelEventInit.swift index c723f91e..2d52242b 100644 --- a/Sources/DOMKit/WebIDL/WheelEventInit.swift +++ b/Sources/DOMKit/WebIDL/WheelEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class WheelEventInit: BridgedDictionary { private enum Keys { static let deltaMode: JSString = "deltaMode" + static let deltaX: JSString = "deltaX" static let deltaY: JSString = "deltaY" static let deltaZ: JSString = "deltaZ" - static let deltaX: JSString = "deltaX" } public convenience init(deltaX: Double, deltaY: Double, deltaZ: Double, deltaMode: UInt32) { diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 47105c7e..19f17640 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -7,45 +7,45 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind override public class var constructor: JSFunction { JSObject.global.Window.function! } private enum Keys { - static let print: JSString = "print" - static let name: JSString = "name" - static let `self`: JSString = "self" - static let document: JSString = "document" - static let status: JSString = "status" - static let close: JSString = "close" - static let opener: JSString = "opener" - static let menubar: JSString = "menubar" - static let personalbar: JSString = "personalbar" - static let clientInformation: JSString = "clientInformation" - static let focus: JSString = "focus" - static let parent: JSString = "parent" - static let top: JSString = "top" - static let location: JSString = "location" static let alert: JSString = "alert" - static let window: JSString = "window" - static let locationbar: JSString = "locationbar" + static let blur: JSString = "blur" + static let captureEvents: JSString = "captureEvents" + static let clientInformation: JSString = "clientInformation" + static let close: JSString = "close" static let closed: JSString = "closed" + static let confirm: JSString = "confirm" static let customElements: JSString = "customElements" + static let document: JSString = "document" + static let event: JSString = "event" + static let external: JSString = "external" + static let focus: JSString = "focus" static let frameElement: JSString = "frameElement" - static let statusbar: JSString = "statusbar" - static let open: JSString = "open" - static let navigator: JSString = "navigator" + static let frames: JSString = "frames" + static let getComputedStyle: JSString = "getComputedStyle" static let history: JSString = "history" static let length: JSString = "length" - static let releaseEvents: JSString = "releaseEvents" - static let postMessage: JSString = "postMessage" - static let external: JSString = "external" - static let getComputedStyle: JSString = "getComputedStyle" - static let blur: JSString = "blur" - static let stop: JSString = "stop" + static let location: JSString = "location" + static let locationbar: JSString = "locationbar" + static let menubar: JSString = "menubar" + static let name: JSString = "name" + static let navigator: JSString = "navigator" + static let open: JSString = "open" + static let opener: JSString = "opener" static let originAgentCluster: JSString = "originAgentCluster" - static let confirm: JSString = "confirm" - static let frames: JSString = "frames" - static let captureEvents: JSString = "captureEvents" - static let event: JSString = "event" + static let parent: JSString = "parent" + static let personalbar: JSString = "personalbar" + static let postMessage: JSString = "postMessage" + static let print: JSString = "print" static let prompt: JSString = "prompt" - static let toolbar: JSString = "toolbar" + static let releaseEvents: JSString = "releaseEvents" static let scrollbars: JSString = "scrollbars" + static let `self`: JSString = "self" + static let status: JSString = "status" + static let statusbar: JSString = "statusbar" + static let stop: JSString = "stop" + static let toolbar: JSString = "toolbar" + static let top: JSString = "top" + static let window: JSString = "window" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -124,22 +124,22 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var status: String public func close() { - _ = jsObject[Keys.close]!() + jsObject[Keys.close]!().fromJSValue()! } @ReadonlyAttribute public var closed: Bool public func stop() { - _ = jsObject[Keys.stop]!() + jsObject[Keys.stop]!().fromJSValue()! } public func focus() { - _ = jsObject[Keys.focus]!() + jsObject[Keys.focus]!().fromJSValue()! } public func blur() { - _ = jsObject[Keys.blur]!() + jsObject[Keys.blur]!().fromJSValue()! } @ReadonlyAttribute @@ -178,11 +178,11 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var originAgentCluster: Bool public func alert() { - _ = jsObject[Keys.alert]!() + jsObject[Keys.alert]!().fromJSValue()! } public func alert(message: String) { - _ = jsObject[Keys.alert]!(message.jsValue()) + jsObject[Keys.alert]!(message.jsValue()).fromJSValue()! } public func confirm(message: String? = nil) -> Bool { @@ -194,23 +194,23 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind } public func print() { - _ = jsObject[Keys.print]!() + jsObject[Keys.print]!().fromJSValue()! } public func postMessage(message: JSValue, targetOrigin: String, transfer: [JSObject]? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined) + jsObject[Keys.postMessage]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined).fromJSValue()! } public func postMessage(message: JSValue, options: WindowPostMessageOptions? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func captureEvents() { - _ = jsObject[Keys.captureEvents]!() + jsObject[Keys.captureEvents]!().fromJSValue()! } public func releaseEvents() { - _ = jsObject[Keys.releaseEvents]!() + jsObject[Keys.releaseEvents]!().fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index 4a34b80b..0e4e14a2 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -4,21 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let onbeforeunload: JSString = "onbeforeunload" static let onafterprint: JSString = "onafterprint" - static let onstorage: JSString = "onstorage" + static let onbeforeprint: JSString = "onbeforeprint" + static let onbeforeunload: JSString = "onbeforeunload" + static let onhashchange: JSString = "onhashchange" + static let onlanguagechange: JSString = "onlanguagechange" static let onmessage: JSString = "onmessage" static let onmessageerror: JSString = "onmessageerror" - static let onunhandledrejection: JSString = "onunhandledrejection" - static let onlanguagechange: JSString = "onlanguagechange" - static let onhashchange: JSString = "onhashchange" - static let onbeforeprint: JSString = "onbeforeprint" static let onoffline: JSString = "onoffline" static let ononline: JSString = "ononline" - static let onpopstate: JSString = "onpopstate" static let onpagehide: JSString = "onpagehide" static let onpageshow: JSString = "onpageshow" + static let onpopstate: JSString = "onpopstate" static let onrejectionhandled: JSString = "onrejectionhandled" + static let onstorage: JSString = "onstorage" + static let onunhandledrejection: JSString = "onunhandledrejection" static let onunload: JSString = "onunload" } diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index 744174d5..3c661290 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -4,21 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit private enum Keys { - static let crossOriginIsolated: JSString = "crossOriginIsolated" - static let queueMicrotask: JSString = "queueMicrotask" - static let structuredClone: JSString = "structuredClone" - static let origin: JSString = "origin" - static let setTimeout: JSString = "setTimeout" - static let performance: JSString = "performance" - static let setInterval: JSString = "setInterval" - static let btoa: JSString = "btoa" - static let createImageBitmap: JSString = "createImageBitmap" - static let reportError: JSString = "reportError" - static let clearTimeout: JSString = "clearTimeout" static let atob: JSString = "atob" + static let btoa: JSString = "btoa" static let clearInterval: JSString = "clearInterval" + static let clearTimeout: JSString = "clearTimeout" + static let createImageBitmap: JSString = "createImageBitmap" + static let crossOriginIsolated: JSString = "crossOriginIsolated" static let fetch: JSString = "fetch" static let isSecureContext: JSString = "isSecureContext" + static let origin: JSString = "origin" + static let performance: JSString = "performance" + static let queueMicrotask: JSString = "queueMicrotask" + static let reportError: JSString = "reportError" + static let setInterval: JSString = "setInterval" + static let setTimeout: JSString = "setTimeout" + static let structuredClone: JSString = "structuredClone" } public protocol WindowOrWorkerGlobalScope: JSBridgedClass {} @@ -32,7 +32,7 @@ public extension WindowOrWorkerGlobalScope { var crossOriginIsolated: Bool { ReadonlyAttribute[Keys.crossOriginIsolated, in: jsObject] } func reportError(e: JSValue) { - _ = jsObject[Keys.reportError]!(e.jsValue()) + jsObject[Keys.reportError]!(e.jsValue()).fromJSValue()! } func btoa(data: String) -> String { @@ -48,7 +48,7 @@ public extension WindowOrWorkerGlobalScope { } func clearTimeout(id: Int32? = nil) { - _ = jsObject[Keys.clearTimeout]!(id?.jsValue() ?? .undefined) + jsObject[Keys.clearTimeout]!(id?.jsValue() ?? .undefined).fromJSValue()! } func setInterval(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { @@ -56,10 +56,12 @@ public extension WindowOrWorkerGlobalScope { } func clearInterval(id: Int32? = nil) { - _ = jsObject[Keys.clearInterval]!(id?.jsValue() ?? .undefined) + jsObject[Keys.clearInterval]!(id?.jsValue() ?? .undefined).fromJSValue()! } - // XXX: method 'queueMicrotask' is ignored + func queueMicrotask(callback: VoidFunction) { + jsObject[Keys.queueMicrotask]!(callback.jsValue()).fromJSValue()! + } func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) -> JSPromise { jsObject[Keys.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index 63940ce8..92f1b4cf 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -7,10 +7,10 @@ public class Worker: EventTarget, AbstractWorker { override public class var constructor: JSFunction { JSObject.global.Worker.function! } private enum Keys { - static let postMessage: JSString = "postMessage" static let onmessage: JSString = "onmessage" - static let terminate: JSString = "terminate" static let onmessageerror: JSString = "onmessageerror" + static let postMessage: JSString = "postMessage" + static let terminate: JSString = "terminate" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -24,15 +24,15 @@ public class Worker: EventTarget, AbstractWorker { } public func terminate() { - _ = jsObject[Keys.terminate]!() + jsObject[Keys.terminate]!().fromJSValue()! } public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) + jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()).fromJSValue()! } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index 228dffbd..4c25d576 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -7,16 +7,16 @@ public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global.WorkerGlobalScope.function! } private enum Keys { + static let importScripts: JSString = "importScripts" static let location: JSString = "location" - static let `self`: JSString = "self" - static let onunhandledrejection: JSString = "onunhandledrejection" - static let onerror: JSString = "onerror" - static let ononline: JSString = "ononline" static let navigator: JSString = "navigator" - static let importScripts: JSString = "importScripts" + static let onerror: JSString = "onerror" static let onlanguagechange: JSString = "onlanguagechange" static let onoffline: JSString = "onoffline" + static let ononline: JSString = "ononline" static let onrejectionhandled: JSString = "onrejectionhandled" + static let onunhandledrejection: JSString = "onunhandledrejection" + static let `self`: JSString = "self" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -42,7 +42,7 @@ public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope { public var navigator: WorkerNavigator public func importScripts(urls: String...) { - _ = jsObject[Keys.importScripts]!(urls.jsValue()) + jsObject[Keys.importScripts]!(urls.jsValue()).fromJSValue()! } @ClosureAttribute.Optional5 diff --git a/Sources/DOMKit/WebIDL/WorkerLocation.swift b/Sources/DOMKit/WebIDL/WorkerLocation.swift index de3967de..40b50ff4 100644 --- a/Sources/DOMKit/WebIDL/WorkerLocation.swift +++ b/Sources/DOMKit/WebIDL/WorkerLocation.swift @@ -7,15 +7,15 @@ public class WorkerLocation: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WorkerLocation.function! } private enum Keys { - static let href: JSString = "href" + static let hash: JSString = "hash" static let host: JSString = "host" - static let search: JSString = "search" + static let hostname: JSString = "hostname" + static let href: JSString = "href" static let origin: JSString = "origin" - static let hash: JSString = "hash" - static let `protocol`: JSString = "protocol" static let pathname: JSString = "pathname" static let port: JSString = "port" - static let hostname: JSString = "hostname" + static let `protocol`: JSString = "protocol" + static let search: JSString = "search" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WorkerOptions.swift b/Sources/DOMKit/WebIDL/WorkerOptions.swift index c2b1cfc5..243847ac 100644 --- a/Sources/DOMKit/WebIDL/WorkerOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkerOptions.swift @@ -5,9 +5,9 @@ import JavaScriptKit public class WorkerOptions: BridgedDictionary { private enum Keys { - static let type: JSString = "type" static let credentials: JSString = "credentials" static let name: JSString = "name" + static let type: JSString = "type" } public convenience init(type: WorkerType, credentials: RequestCredentials, name: String) { diff --git a/Sources/DOMKit/WebIDL/Worklet.swift b/Sources/DOMKit/WebIDL/Worklet.swift index abc59f91..c92ed9f9 100644 --- a/Sources/DOMKit/WebIDL/Worklet.swift +++ b/Sources/DOMKit/WebIDL/Worklet.swift @@ -23,6 +23,6 @@ public class Worklet: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func addModule(moduleURL: String, options: WorkletOptions? = nil) async throws { let _promise: JSPromise = jsObject[Keys.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift index 4c08b03f..d42fe4c3 100644 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -7,10 +7,10 @@ public class WritableStream: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WritableStream.function! } private enum Keys { - static let getWriter: JSString = "getWriter" - static let locked: JSString = "locked" static let abort: JSString = "abort" static let close: JSString = "close" + static let getWriter: JSString = "getWriter" + static let locked: JSString = "locked" } public let jsObject: JSObject @@ -34,7 +34,7 @@ public class WritableStream: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort(reason: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } public func close() -> JSPromise { @@ -44,7 +44,7 @@ public class WritableStream: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func close() async throws { let _promise: JSPromise = jsObject[Keys.close]!().fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } public func getWriter() -> WritableStreamDefaultWriter { diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift index 8280410c..b467bf7e 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift @@ -22,6 +22,6 @@ public class WritableStreamDefaultController: JSBridgedClass { public var signal: AbortSignal public func error(e: JSValue? = nil) { - _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) + jsObject[Keys.error]!(e?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift index b6695349..489ffd2e 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -9,11 +9,11 @@ public class WritableStreamDefaultWriter: JSBridgedClass { private enum Keys { static let abort: JSString = "abort" static let close: JSString = "close" - static let ready: JSString = "ready" - static let write: JSString = "write" - static let releaseLock: JSString = "releaseLock" static let closed: JSString = "closed" static let desiredSize: JSString = "desiredSize" + static let ready: JSString = "ready" + static let releaseLock: JSString = "releaseLock" + static let write: JSString = "write" } public let jsObject: JSObject @@ -45,7 +45,7 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort(reason: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } public func close() -> JSPromise { @@ -55,11 +55,11 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func close() async throws { let _promise: JSPromise = jsObject[Keys.close]!().fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } public func releaseLock() { - _ = jsObject[Keys.releaseLock]!() + jsObject[Keys.releaseLock]!().fromJSValue()! } public func write(chunk: JSValue? = nil) -> JSPromise { @@ -69,6 +69,6 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func write(chunk: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() + return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index 9b6adf0c..d9a9da2e 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -7,30 +7,30 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { override public class var constructor: JSFunction { JSObject.global.XMLHttpRequest.function! } private enum Keys { + static let DONE: JSString = "DONE" + static let HEADERS_RECEIVED: JSString = "HEADERS_RECEIVED" static let LOADING: JSString = "LOADING" - static let readyState: JSString = "readyState" - static let responseXML: JSString = "responseXML" + static let OPENED: JSString = "OPENED" static let UNSENT: JSString = "UNSENT" - static let open: JSString = "open" static let abort: JSString = "abort" - static let getResponseHeader: JSString = "getResponseHeader" - static let statusText: JSString = "statusText" static let getAllResponseHeaders: JSString = "getAllResponseHeaders" - static let withCredentials: JSString = "withCredentials" + static let getResponseHeader: JSString = "getResponseHeader" + static let onreadystatechange: JSString = "onreadystatechange" + static let open: JSString = "open" + static let overrideMimeType: JSString = "overrideMimeType" + static let readyState: JSString = "readyState" + static let response: JSString = "response" static let responseText: JSString = "responseText" - static let setRequestHeader: JSString = "setRequestHeader" - static let upload: JSString = "upload" - static let HEADERS_RECEIVED: JSString = "HEADERS_RECEIVED" + static let responseType: JSString = "responseType" static let responseURL: JSString = "responseURL" - static let overrideMimeType: JSString = "overrideMimeType" - static let status: JSString = "status" - static let OPENED: JSString = "OPENED" + static let responseXML: JSString = "responseXML" static let send: JSString = "send" - static let onreadystatechange: JSString = "onreadystatechange" - static let response: JSString = "response" + static let setRequestHeader: JSString = "setRequestHeader" + static let status: JSString = "status" + static let statusText: JSString = "statusText" static let timeout: JSString = "timeout" - static let DONE: JSString = "DONE" - static let responseType: JSString = "responseType" + static let upload: JSString = "upload" + static let withCredentials: JSString = "withCredentials" } public required init(unsafelyWrapping jsObject: JSObject) { @@ -70,15 +70,15 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var readyState: UInt16 public func open(method: String, url: String) { - _ = jsObject[Keys.open]!(method.jsValue(), url.jsValue()) + jsObject[Keys.open]!(method.jsValue(), url.jsValue()).fromJSValue()! } public func open(method: String, url: String, async: Bool, username: String? = nil, password: String? = nil) { - _ = jsObject[Keys.open]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined) + jsObject[Keys.open]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined).fromJSValue()! } public func setRequestHeader(name: String, value: String) { - _ = jsObject[Keys.setRequestHeader]!(name.jsValue(), value.jsValue()) + jsObject[Keys.setRequestHeader]!(name.jsValue(), value.jsValue()).fromJSValue()! } @ReadWriteAttribute @@ -91,11 +91,11 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var upload: XMLHttpRequestUpload public func send(body: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.send]!(body?.jsValue() ?? .undefined) + jsObject[Keys.send]!(body?.jsValue() ?? .undefined).fromJSValue()! } public func abort() { - _ = jsObject[Keys.abort]!() + jsObject[Keys.abort]!().fromJSValue()! } @ReadonlyAttribute @@ -116,7 +116,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { } public func overrideMimeType(mime: String) { - _ = jsObject[Keys.overrideMimeType]!(mime.jsValue()) + jsObject[Keys.overrideMimeType]!(mime.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift index 9ca06224..c9a3d3c8 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift @@ -8,11 +8,11 @@ public class XMLHttpRequestEventTarget: EventTarget { private enum Keys { static let onabort: JSString = "onabort" - static let onloadend: JSString = "onloadend" - static let onload: JSString = "onload" static let onerror: JSString = "onerror" - static let onprogress: JSString = "onprogress" + static let onload: JSString = "onload" + static let onloadend: JSString = "onloadend" static let onloadstart: JSString = "onloadstart" + static let onprogress: JSString = "onprogress" static let ontimeout: JSString = "ontimeout" } diff --git a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift index 86a4493b..cea3644c 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift @@ -11,9 +11,15 @@ private enum Keys { public protocol XPathEvaluatorBase: JSBridgedClass {} public extension XPathEvaluatorBase { - // XXX: method 'createExpression' is ignored + func createExpression(expression: String, resolver: XPathNSResolver? = nil) -> XPathExpression { + jsObject[Keys.createExpression]!(expression.jsValue(), resolver?.jsValue() ?? .undefined).fromJSValue()! + } - // XXX: method 'createNSResolver' is ignored + func createNSResolver(nodeResolver: Node) -> XPathNSResolver { + jsObject[Keys.createNSResolver]!(nodeResolver.jsValue()).fromJSValue()! + } - // XXX: method 'evaluate' is ignored + func evaluate(expression: String, contextNode: Node, resolver: XPathNSResolver? = nil, type: UInt16? = nil, result: XPathResult? = nil) -> XPathResult { + jsObject[Keys.evaluate]!(expression.jsValue(), contextNode.jsValue(), resolver?.jsValue() ?? .undefined, type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/XPathResult.swift b/Sources/DOMKit/WebIDL/XPathResult.swift index 3d2568f0..fd17eae7 100644 --- a/Sources/DOMKit/WebIDL/XPathResult.swift +++ b/Sources/DOMKit/WebIDL/XPathResult.swift @@ -7,25 +7,25 @@ public class XPathResult: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.XPathResult.function! } private enum Keys { + static let ANY_TYPE: JSString = "ANY_TYPE" + static let ANY_UNORDERED_NODE_TYPE: JSString = "ANY_UNORDERED_NODE_TYPE" + static let BOOLEAN_TYPE: JSString = "BOOLEAN_TYPE" static let FIRST_ORDERED_NODE_TYPE: JSString = "FIRST_ORDERED_NODE_TYPE" - static let snapshotItem: JSString = "snapshotItem" - static let UNORDERED_NODE_SNAPSHOT_TYPE: JSString = "UNORDERED_NODE_SNAPSHOT_TYPE" - static let STRING_TYPE: JSString = "STRING_TYPE" + static let NUMBER_TYPE: JSString = "NUMBER_TYPE" + static let ORDERED_NODE_ITERATOR_TYPE: JSString = "ORDERED_NODE_ITERATOR_TYPE" static let ORDERED_NODE_SNAPSHOT_TYPE: JSString = "ORDERED_NODE_SNAPSHOT_TYPE" + static let STRING_TYPE: JSString = "STRING_TYPE" + static let UNORDERED_NODE_ITERATOR_TYPE: JSString = "UNORDERED_NODE_ITERATOR_TYPE" + static let UNORDERED_NODE_SNAPSHOT_TYPE: JSString = "UNORDERED_NODE_SNAPSHOT_TYPE" + static let booleanValue: JSString = "booleanValue" static let invalidIteratorState: JSString = "invalidIteratorState" - static let snapshotLength: JSString = "snapshotLength" static let iterateNext: JSString = "iterateNext" - static let UNORDERED_NODE_ITERATOR_TYPE: JSString = "UNORDERED_NODE_ITERATOR_TYPE" - static let stringValue: JSString = "stringValue" - static let NUMBER_TYPE: JSString = "NUMBER_TYPE" - static let BOOLEAN_TYPE: JSString = "BOOLEAN_TYPE" + static let numberValue: JSString = "numberValue" static let resultType: JSString = "resultType" - static let ANY_UNORDERED_NODE_TYPE: JSString = "ANY_UNORDERED_NODE_TYPE" - static let booleanValue: JSString = "booleanValue" static let singleNodeValue: JSString = "singleNodeValue" - static let numberValue: JSString = "numberValue" - static let ANY_TYPE: JSString = "ANY_TYPE" - static let ORDERED_NODE_ITERATOR_TYPE: JSString = "ORDERED_NODE_ITERATOR_TYPE" + static let snapshotItem: JSString = "snapshotItem" + static let snapshotLength: JSString = "snapshotLength" + static let stringValue: JSString = "stringValue" } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift index 8a31c957..7c1ad010 100644 --- a/Sources/DOMKit/WebIDL/XSLTProcessor.swift +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -7,14 +7,14 @@ public class XSLTProcessor: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.XSLTProcessor.function! } private enum Keys { - static let importStylesheet: JSString = "importStylesheet" - static let transformToFragment: JSString = "transformToFragment" - static let setParameter: JSString = "setParameter" - static let transformToDocument: JSString = "transformToDocument" + static let clearParameters: JSString = "clearParameters" static let getParameter: JSString = "getParameter" + static let importStylesheet: JSString = "importStylesheet" static let removeParameter: JSString = "removeParameter" - static let clearParameters: JSString = "clearParameters" static let reset: JSString = "reset" + static let setParameter: JSString = "setParameter" + static let transformToDocument: JSString = "transformToDocument" + static let transformToFragment: JSString = "transformToFragment" } public let jsObject: JSObject @@ -28,7 +28,7 @@ public class XSLTProcessor: JSBridgedClass { } public func importStylesheet(style: Node) { - _ = jsObject[Keys.importStylesheet]!(style.jsValue()) + jsObject[Keys.importStylesheet]!(style.jsValue()).fromJSValue()! } public func transformToFragment(source: Node, output: Document) -> DocumentFragment { @@ -40,7 +40,7 @@ public class XSLTProcessor: JSBridgedClass { } public func setParameter(namespaceURI: String, localName: String, value: JSValue) { - _ = jsObject[Keys.setParameter]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()) + jsObject[Keys.setParameter]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()).fromJSValue()! } public func getParameter(namespaceURI: String, localName: String) -> JSValue { @@ -48,14 +48,14 @@ public class XSLTProcessor: JSBridgedClass { } public func removeParameter(namespaceURI: String, localName: String) { - _ = jsObject[Keys.removeParameter]!(namespaceURI.jsValue(), localName.jsValue()) + jsObject[Keys.removeParameter]!(namespaceURI.jsValue(), localName.jsValue()).fromJSValue()! } public func clearParameters() { - _ = jsObject[Keys.clearParameters]!() + jsObject[Keys.clearParameters]!().fromJSValue()! } public func reset() { - _ = jsObject[Keys.reset]!() + jsObject[Keys.reset]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index 989b8e73..7112d16f 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -5,25 +5,25 @@ import JavaScriptKit public enum console { private enum Keys { - static let trace: JSString = "trace" + static let assert: JSString = "assert" static let clear: JSString = "clear" - static let dir: JSString = "dir" - static let timeEnd: JSString = "timeEnd" - static let debug: JSString = "debug" - static let info: JSString = "info" static let count: JSString = "count" + static let countReset: JSString = "countReset" + static let debug: JSString = "debug" + static let dir: JSString = "dir" + static let dirxml: JSString = "dirxml" + static let error: JSString = "error" static let group: JSString = "group" + static let groupCollapsed: JSString = "groupCollapsed" static let groupEnd: JSString = "groupEnd" - static let time: JSString = "time" + static let info: JSString = "info" static let log: JSString = "log" - static let assert: JSString = "assert" - static let warn: JSString = "warn" - static let error: JSString = "error" static let table: JSString = "table" - static let dirxml: JSString = "dirxml" - static let groupCollapsed: JSString = "groupCollapsed" + static let time: JSString = "time" + static let timeEnd: JSString = "timeEnd" static let timeLog: JSString = "timeLog" - static let countReset: JSString = "countReset" + static let trace: JSString = "trace" + static let warn: JSString = "warn" } public static var jsObject: JSObject { @@ -31,78 +31,78 @@ public enum console { } public static func assert(condition: Bool? = nil, data: JSValue...) { - _ = JSObject.global.console.object![Keys.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) + JSObject.global.console.object![Keys.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()).fromJSValue()! } public static func clear() { - _ = JSObject.global.console.object![Keys.clear]!() + JSObject.global.console.object![Keys.clear]!().fromJSValue()! } public static func debug(data: JSValue...) { - _ = JSObject.global.console.object![Keys.debug]!(data.jsValue()) + JSObject.global.console.object![Keys.debug]!(data.jsValue()).fromJSValue()! } public static func error(data: JSValue...) { - _ = JSObject.global.console.object![Keys.error]!(data.jsValue()) + JSObject.global.console.object![Keys.error]!(data.jsValue()).fromJSValue()! } public static func info(data: JSValue...) { - _ = JSObject.global.console.object![Keys.info]!(data.jsValue()) + JSObject.global.console.object![Keys.info]!(data.jsValue()).fromJSValue()! } public static func log(data: JSValue...) { - _ = JSObject.global.console.object![Keys.log]!(data.jsValue()) + JSObject.global.console.object![Keys.log]!(data.jsValue()).fromJSValue()! } public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { - _ = JSObject.global.console.object![Keys.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) + JSObject.global.console.object![Keys.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined).fromJSValue()! } public static func trace(data: JSValue...) { - _ = JSObject.global.console.object![Keys.trace]!(data.jsValue()) + JSObject.global.console.object![Keys.trace]!(data.jsValue()).fromJSValue()! } public static func warn(data: JSValue...) { - _ = JSObject.global.console.object![Keys.warn]!(data.jsValue()) + JSObject.global.console.object![Keys.warn]!(data.jsValue()).fromJSValue()! } public static func dir(item: JSValue? = nil, options: JSObject? = nil) { - _ = JSObject.global.console.object![Keys.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) + JSObject.global.console.object![Keys.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! } public static func dirxml(data: JSValue...) { - _ = JSObject.global.console.object![Keys.dirxml]!(data.jsValue()) + JSObject.global.console.object![Keys.dirxml]!(data.jsValue()).fromJSValue()! } public static func count(label: String? = nil) { - _ = JSObject.global.console.object![Keys.count]!(label?.jsValue() ?? .undefined) + JSObject.global.console.object![Keys.count]!(label?.jsValue() ?? .undefined).fromJSValue()! } public static func countReset(label: String? = nil) { - _ = JSObject.global.console.object![Keys.countReset]!(label?.jsValue() ?? .undefined) + JSObject.global.console.object![Keys.countReset]!(label?.jsValue() ?? .undefined).fromJSValue()! } public static func group(data: JSValue...) { - _ = JSObject.global.console.object![Keys.group]!(data.jsValue()) + JSObject.global.console.object![Keys.group]!(data.jsValue()).fromJSValue()! } public static func groupCollapsed(data: JSValue...) { - _ = JSObject.global.console.object![Keys.groupCollapsed]!(data.jsValue()) + JSObject.global.console.object![Keys.groupCollapsed]!(data.jsValue()).fromJSValue()! } public static func groupEnd() { - _ = JSObject.global.console.object![Keys.groupEnd]!() + JSObject.global.console.object![Keys.groupEnd]!().fromJSValue()! } public static func time(label: String? = nil) { - _ = JSObject.global.console.object![Keys.time]!(label?.jsValue() ?? .undefined) + JSObject.global.console.object![Keys.time]!(label?.jsValue() ?? .undefined).fromJSValue()! } public static func timeLog(label: String? = nil, data: JSValue...) { - _ = JSObject.global.console.object![Keys.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) + JSObject.global.console.object![Keys.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()).fromJSValue()! } public static func timeEnd(label: String? = nil) { - _ = JSObject.global.console.object![Keys.timeEnd]!(label?.jsValue() ?? .undefined) + JSObject.global.console.object![Keys.timeEnd]!(label?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 55f4ffb7..c989c482 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -63,7 +63,7 @@ private func printKeys(_ keys: [IDLNamed]) -> SwiftSource { let validKeys = Set(keys.map(\.name).filter { !$0.isEmpty }) return """ private enum Keys { - \(lines: validKeys.map { "static let \(name: $0): JSString = \(quoted: $0)" }) + \(lines: validKeys.sorted().map { "static let \(name: $0): JSString = \(quoted: $0)" }) } """ } From 4c75f8df56c12806744fd237db3f96df86f9f414 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 1 Apr 2022 19:16:40 -0400 Subject: [PATCH 085/124] remove some swiftRepresentation --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index c989c482..6697c6fa 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -153,7 +153,7 @@ extension IDLCallback: SwiftRepresentable { Context.requiredClosureArgCounts.insert(arguments.count) return """ public typealias \(name: name) = (\(sequence: arguments.map { - "\($0.idlType.swiftRepresentation)\($0.variadic ? "..." : "")" + "\($0.idlType)\($0.variadic ? "..." : "")" })) -> \(idlType) """ } @@ -353,9 +353,9 @@ extension IDLOperation: SwiftRepresentable, Initializable { } """ case "setter": - return "// XXX: unsupported setter for keys of type \(arguments[0].idlType.swiftRepresentation)" + return "// XXX: unsupported setter for keys of type \(arguments[0].idlType)" case "deleter": - return "// XXX: unsupported deleter for keys of type \(arguments[0].idlType.swiftRepresentation)" + return "// XXX: unsupported deleter for keys of type \(arguments[0].idlType)" default: fatalError("Unsupported special operation \(special)") } From 7f8681e0b28fe4b72b97219d27de78d6ebd48719 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 08:37:57 -0400 Subject: [PATCH 086/124] Revert "Just quote all the names and let SwiftFormat sort it out" This reverts commit aacbe797e69d2a5597c3a353e4bf6c5ab52aa29c --- Sources/DOMKit/WebIDL/AbortController.swift | 2 +- Sources/DOMKit/WebIDL/AbortSignal.swift | 2 +- .../WebIDL/AnimationFrameProvider.swift | 6 +- Sources/DOMKit/WebIDL/AudioTrackList.swift | 2 +- Sources/DOMKit/WebIDL/BroadcastChannel.swift | 4 +- Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSRuleList.swift | 2 +- .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 4 +- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 6 +- Sources/DOMKit/WebIDL/CanPlayTypeResult.swift | 6 +- Sources/DOMKit/WebIDL/CanvasDirection.swift | 8 +- Sources/DOMKit/WebIDL/CanvasDrawImage.swift | 6 +- Sources/DOMKit/WebIDL/CanvasDrawPath.swift | 14 +-- Sources/DOMKit/WebIDL/CanvasFillRule.swift | 6 +- Sources/DOMKit/WebIDL/CanvasFontKerning.swift | 8 +- Sources/DOMKit/WebIDL/CanvasFontStretch.swift | 8 +- .../DOMKit/WebIDL/CanvasFontVariantCaps.swift | 6 +- Sources/DOMKit/WebIDL/CanvasGradient.swift | 2 +- Sources/DOMKit/WebIDL/CanvasImageData.swift | 4 +- Sources/DOMKit/WebIDL/CanvasLineCap.swift | 8 +- Sources/DOMKit/WebIDL/CanvasLineJoin.swift | 8 +- Sources/DOMKit/WebIDL/CanvasPath.swift | 20 ++-- .../WebIDL/CanvasPathDrawingStyles.swift | 2 +- Sources/DOMKit/WebIDL/CanvasPattern.swift | 2 +- Sources/DOMKit/WebIDL/CanvasRect.swift | 6 +- Sources/DOMKit/WebIDL/CanvasState.swift | 6 +- Sources/DOMKit/WebIDL/CanvasText.swift | 4 +- Sources/DOMKit/WebIDL/CanvasTextAlign.swift | 12 +-- .../DOMKit/WebIDL/CanvasTextBaseline.swift | 14 +-- .../DOMKit/WebIDL/CanvasTextRendering.swift | 10 +- Sources/DOMKit/WebIDL/CanvasTransform.swift | 14 +-- .../DOMKit/WebIDL/CanvasUserInterface.swift | 8 +- Sources/DOMKit/WebIDL/CharacterData.swift | 8 +- Sources/DOMKit/WebIDL/ChildNode.swift | 8 +- .../DOMKit/WebIDL/ColorSpaceConversion.swift | 6 +- Sources/DOMKit/WebIDL/CompositionEvent.swift | 2 +- .../DOMKit/WebIDL/CustomElementRegistry.swift | 2 +- Sources/DOMKit/WebIDL/CustomEvent.swift | 2 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 6 +- .../WebIDL/DOMParserSupportedType.swift | 2 +- Sources/DOMKit/WebIDL/DOMPoint.swift | 2 +- Sources/DOMKit/WebIDL/DOMRect.swift | 2 +- Sources/DOMKit/WebIDL/DOMRectList.swift | 2 +- Sources/DOMKit/WebIDL/DOMStringList.swift | 2 +- Sources/DOMKit/WebIDL/DOMStringMap.swift | 4 +- Sources/DOMKit/WebIDL/DOMTokenList.swift | 6 +- Sources/DOMKit/WebIDL/DataTransfer.swift | 6 +- .../DOMKit/WebIDL/DataTransferItemList.swift | 6 +- .../WebIDL/DedicatedWorkerGlobalScope.swift | 6 +- Sources/DOMKit/WebIDL/Document.swift | 12 +-- .../DOMKit/WebIDL/DocumentReadyState.swift | 8 +- .../WebIDL/DocumentVisibilityState.swift | 6 +- Sources/DOMKit/WebIDL/Element.swift | 10 +- Sources/DOMKit/WebIDL/ElementInternals.swift | 4 +- Sources/DOMKit/WebIDL/EndingType.swift | 6 +- Sources/DOMKit/WebIDL/Event.swift | 8 +- Sources/DOMKit/WebIDL/EventSource.swift | 2 +- Sources/DOMKit/WebIDL/External.swift | 4 +- Sources/DOMKit/WebIDL/FileList.swift | 2 +- Sources/DOMKit/WebIDL/FileReader.swift | 10 +- Sources/DOMKit/WebIDL/FormData.swift | 10 +- Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 2 +- Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLCollection.swift | 2 +- Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 2 +- .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFormElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLImageElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 16 +-- .../DOMKit/WebIDL/HTMLMarqueeElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 2 +- .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 6 +- Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 12 +-- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLTableElement.swift | 8 +- .../DOMKit/WebIDL/HTMLTableRowElement.swift | 2 +- .../WebIDL/HTMLTableSectionElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 10 +- Sources/DOMKit/WebIDL/Headers.swift | 6 +- Sources/DOMKit/WebIDL/History.swift | 10 +- Sources/DOMKit/WebIDL/ImageBitmap.swift | 2 +- .../WebIDL/ImageBitmapRenderingContext.swift | 2 +- Sources/DOMKit/WebIDL/ImageOrientation.swift | 6 +- .../DOMKit/WebIDL/ImageSmoothingQuality.swift | 8 +- Sources/DOMKit/WebIDL/KeyboardEvent.swift | 2 +- Sources/DOMKit/WebIDL/Location.swift | 6 +- Sources/DOMKit/WebIDL/MediaList.swift | 6 +- Sources/DOMKit/WebIDL/MessageEvent.swift | 2 +- Sources/DOMKit/WebIDL/MessagePort.swift | 8 +- Sources/DOMKit/WebIDL/MimeTypeArray.swift | 2 +- Sources/DOMKit/WebIDL/MouseEvent.swift | 2 +- Sources/DOMKit/WebIDL/MutationEvent.swift | 2 +- Sources/DOMKit/WebIDL/MutationObserver.swift | 8 +- Sources/DOMKit/WebIDL/NamedNodeMap.swift | 2 +- .../DOMKit/WebIDL/NavigatorContentUtils.swift | 4 +- Sources/DOMKit/WebIDL/Node.swift | 2 +- Sources/DOMKit/WebIDL/NodeIterator.swift | 2 +- Sources/DOMKit/WebIDL/NodeList.swift | 2 +- .../OffscreenCanvasRenderingContext2D.swift | 2 +- .../WebIDL/OffscreenRenderingContextId.swift | 10 +- Sources/DOMKit/WebIDL/ParentNode.swift | 6 +- Sources/DOMKit/WebIDL/Path2D.swift | 2 +- Sources/DOMKit/WebIDL/Plugin.swift | 2 +- Sources/DOMKit/WebIDL/PluginArray.swift | 4 +- .../DOMKit/WebIDL/PredefinedColorSpace.swift | 4 +- Sources/DOMKit/WebIDL/PremultiplyAlpha.swift | 8 +- Sources/DOMKit/WebIDL/Range.swift | 26 ++--- .../WebIDL/ReadableByteStreamController.swift | 6 +- Sources/DOMKit/WebIDL/ReadableStream.swift | 4 +- .../WebIDL/ReadableStreamBYOBReader.swift | 2 +- .../WebIDL/ReadableStreamBYOBRequest.swift | 4 +- .../ReadableStreamDefaultController.swift | 6 +- .../WebIDL/ReadableStreamDefaultReader.swift | 2 +- .../WebIDL/ReadableStreamGenericReader.swift | 2 +- .../WebIDL/ReadableStreamReaderMode.swift | 4 +- .../DOMKit/WebIDL/ReadableStreamType.swift | 4 +- Sources/DOMKit/WebIDL/ReferrerPolicy.swift | 4 +- Sources/DOMKit/WebIDL/RequestCache.swift | 6 +- .../DOMKit/WebIDL/RequestCredentials.swift | 6 +- .../DOMKit/WebIDL/RequestDestination.swift | 40 ++++---- Sources/DOMKit/WebIDL/RequestMode.swift | 6 +- Sources/DOMKit/WebIDL/RequestRedirect.swift | 8 +- Sources/DOMKit/WebIDL/ResizeQuality.swift | 10 +- Sources/DOMKit/WebIDL/ResponseType.swift | 14 +-- Sources/DOMKit/WebIDL/ScrollRestoration.swift | 6 +- Sources/DOMKit/WebIDL/SelectionMode.swift | 10 +- Sources/DOMKit/WebIDL/ShadowRootMode.swift | 6 +- .../WebIDL/SharedWorkerGlobalScope.swift | 2 +- .../DOMKit/WebIDL/SlotAssignmentMode.swift | 6 +- Sources/DOMKit/WebIDL/Storage.swift | 6 +- Sources/DOMKit/WebIDL/StorageEvent.swift | 2 +- Sources/DOMKit/WebIDL/StyleSheetList.swift | 2 +- Sources/DOMKit/WebIDL/TextTrack.swift | 4 +- Sources/DOMKit/WebIDL/TextTrackCueList.swift | 2 +- Sources/DOMKit/WebIDL/TextTrackKind.swift | 12 +-- Sources/DOMKit/WebIDL/TextTrackList.swift | 2 +- Sources/DOMKit/WebIDL/TextTrackMode.swift | 8 +- .../TransformStreamDefaultController.swift | 6 +- Sources/DOMKit/WebIDL/UIEvent.swift | 2 +- Sources/DOMKit/WebIDL/URL.swift | 2 +- Sources/DOMKit/WebIDL/VideoTrackList.swift | 2 +- Sources/DOMKit/WebIDL/Window.swift | 22 ++--- .../WebIDL/WindowOrWorkerGlobalScope.swift | 10 +- Sources/DOMKit/WebIDL/Worker.swift | 6 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 2 +- Sources/DOMKit/WebIDL/WorkerType.swift | 6 +- Sources/DOMKit/WebIDL/Worklet.swift | 2 +- Sources/DOMKit/WebIDL/WritableStream.swift | 4 +- .../WritableStreamDefaultController.swift | 2 +- .../WebIDL/WritableStreamDefaultWriter.swift | 8 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 12 +-- .../WebIDL/XMLHttpRequestResponseType.swift | 12 +-- .../DOMKit/WebIDL/XPathEvaluatorBase.swift | 12 +-- Sources/DOMKit/WebIDL/XSLTProcessor.swift | 10 +- Sources/DOMKit/WebIDL/console.swift | 38 +++---- Sources/WebIDLToSwift/ClosureWrappers.swift | 6 +- .../WebIDLToSwift/SwiftRepresentation.swift | 23 +++++ Sources/WebIDLToSwift/SwiftSource.swift | 7 +- .../WebIDL+SwiftRepresentation.swift | 99 +++++++++---------- 163 files changed, 556 insertions(+), 551 deletions(-) diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index dff87454..52fe0a64 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -26,6 +26,6 @@ public class AbortController: JSBridgedClass { public var signal: AbortSignal public func abort(reason: JSValue? = nil) { - jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index b29ba214..6508afa8 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -37,7 +37,7 @@ public class AbortSignal: EventTarget { public var reason: JSValue public func throwIfAborted() { - jsObject[Keys.throwIfAborted]!().fromJSValue()! + _ = jsObject[Keys.throwIfAborted]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift index d52774be..bd802aa2 100644 --- a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift +++ b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift @@ -10,11 +10,9 @@ private enum Keys { public protocol AnimationFrameProvider: JSBridgedClass {} public extension AnimationFrameProvider { - func requestAnimationFrame(callback: FrameRequestCallback) -> UInt32 { - jsObject[Keys.requestAnimationFrame]!(callback.jsValue()).fromJSValue()! - } + // XXX: method 'requestAnimationFrame' is ignored func cancelAnimationFrame(handle: UInt32) { - jsObject[Keys.cancelAnimationFrame]!(handle.jsValue()).fromJSValue()! + _ = jsObject[Keys.cancelAnimationFrame]!(handle.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift index f15bc7a6..cc29851a 100644 --- a/Sources/DOMKit/WebIDL/AudioTrackList.swift +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -25,7 +25,7 @@ public class AudioTrackList: EventTarget { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> AudioTrack { + public subscript(key: Int) -> AudioTrack { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index fe5a023d..9115d8cb 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -29,11 +29,11 @@ public class BroadcastChannel: EventTarget { public var name: String public func postMessage(message: JSValue) { - jsObject[Keys.postMessage]!(message.jsValue()).fromJSValue()! + _ = jsObject[Keys.postMessage]!(message.jsValue()) } public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift index dd857bbe..4a0d2013 100644 --- a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift @@ -25,6 +25,6 @@ public class CSSGroupingRule: CSSRule { } public func deleteRule(index: UInt32) { - jsObject[Keys.deleteRule]!(index.jsValue()).fromJSValue()! + _ = jsObject[Keys.deleteRule]!(index.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CSSRuleList.swift b/Sources/DOMKit/WebIDL/CSSRuleList.swift index b45e18af..47fe6c99 100644 --- a/Sources/DOMKit/WebIDL/CSSRuleList.swift +++ b/Sources/DOMKit/WebIDL/CSSRuleList.swift @@ -18,7 +18,7 @@ public class CSSRuleList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: UInt32) -> CSSRule? { + public subscript(key: Int) -> CSSRule? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift index feac7812..93317962 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift @@ -34,7 +34,7 @@ public class CSSStyleDeclaration: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> String { + public subscript(key: Int) -> String { jsObject[key].fromJSValue()! } @@ -47,7 +47,7 @@ public class CSSStyleDeclaration: JSBridgedClass { } public func setProperty(property: String, value: String, priority: String? = nil) { - jsObject[Keys.setProperty]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.setProperty]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined) } public func removeProperty(property: String) -> String { diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift index c77632c5..fa4956ed 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -40,7 +40,7 @@ public class CSSStyleSheet: StyleSheet { } public func deleteRule(index: UInt32) { - jsObject[Keys.deleteRule]!(index.jsValue()).fromJSValue()! + _ = jsObject[Keys.deleteRule]!(index.jsValue()) } public func replace(text: String) -> JSPromise { @@ -54,7 +54,7 @@ public class CSSStyleSheet: StyleSheet { } public func replaceSync(text: String) { - jsObject[Keys.replaceSync]!(text.jsValue()).fromJSValue()! + _ = jsObject[Keys.replaceSync]!(text.jsValue()) } @ReadonlyAttribute @@ -65,6 +65,6 @@ public class CSSStyleSheet: StyleSheet { } public func removeRule(index: UInt32? = nil) { - jsObject[Keys.removeRule]!(index?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.removeRule]!(index?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift index 19e6edec..e0736c2a 100644 --- a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift +++ b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanPlayTypeResult: JSString, JSValueCompatible { +public enum CanPlayTypeResult: String, JSValueCompatible { case _empty = "" - case maybe = "maybe" - case probably = "probably" + case maybe + case probably public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CanvasDirection.swift b/Sources/DOMKit/WebIDL/CanvasDirection.swift index 941beb15..790c1f34 100644 --- a/Sources/DOMKit/WebIDL/CanvasDirection.swift +++ b/Sources/DOMKit/WebIDL/CanvasDirection.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasDirection: JSString, JSValueCompatible { - case ltr = "ltr" - case rtl = "rtl" - case inherit = "inherit" +public enum CanvasDirection: String, JSValueCompatible { + case ltr + case rtl + case inherit public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift index 456fbcb6..cbf4719a 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift @@ -10,11 +10,11 @@ private enum Keys { public protocol CanvasDrawImage: JSBridgedClass {} public extension CanvasDrawImage { func drawImage(image: CanvasImageSource, dx: Double, dy: Double) { - jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue()).fromJSValue()! + _ = jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue()) } func drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double) { - jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()).fromJSValue()! + _ = jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()) } func drawImage(image: CanvasImageSource, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { @@ -27,6 +27,6 @@ public extension CanvasDrawImage { let _arg6 = dy.jsValue() let _arg7 = dw.jsValue() let _arg8 = dh.jsValue() - return jsObject[Keys.drawImage]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8).fromJSValue()! + _ = jsObject[Keys.drawImage]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift index 4c104932..d748921c 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift @@ -15,31 +15,31 @@ private enum Keys { public protocol CanvasDrawPath: JSBridgedClass {} public extension CanvasDrawPath { func beginPath() { - jsObject[Keys.beginPath]!().fromJSValue()! + _ = jsObject[Keys.beginPath]!() } func fill(fillRule: CanvasFillRule? = nil) { - jsObject[Keys.fill]!(fillRule?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.fill]!(fillRule?.jsValue() ?? .undefined) } func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { - jsObject[Keys.fill]!(path.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.fill]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) } func stroke() { - jsObject[Keys.stroke]!().fromJSValue()! + _ = jsObject[Keys.stroke]!() } func stroke(path: Path2D) { - jsObject[Keys.stroke]!(path.jsValue()).fromJSValue()! + _ = jsObject[Keys.stroke]!(path.jsValue()) } func clip(fillRule: CanvasFillRule? = nil) { - jsObject[Keys.clip]!(fillRule?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.clip]!(fillRule?.jsValue() ?? .undefined) } func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { - jsObject[Keys.clip]!(path.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.clip]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) } func isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { diff --git a/Sources/DOMKit/WebIDL/CanvasFillRule.swift b/Sources/DOMKit/WebIDL/CanvasFillRule.swift index dc00a785..541b4ce1 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillRule.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillRule.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFillRule: JSString, JSValueCompatible { - case nonzero = "nonzero" - case evenodd = "evenodd" +public enum CanvasFillRule: String, JSValueCompatible { + case nonzero + case evenodd public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift index a07d2b10..b37b8742 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFontKerning: JSString, JSValueCompatible { - case auto = "auto" - case normal = "normal" - case none = "none" +public enum CanvasFontKerning: String, JSValueCompatible { + case auto + case normal + case none public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift index 8102d9c1..8bcca5b3 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift @@ -3,14 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFontStretch: JSString, JSValueCompatible { +public enum CanvasFontStretch: String, JSValueCompatible { case ultraCondensed = "ultra-condensed" case extraCondensed = "extra-condensed" - case condensed = "condensed" + case condensed case semiCondensed = "semi-condensed" - case normal = "normal" + case normal case semiExpanded = "semi-expanded" - case expanded = "expanded" + case expanded case extraExpanded = "extra-expanded" case ultraExpanded = "ultra-expanded" diff --git a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift index f1dd0ed9..3a61a862 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFontVariantCaps: JSString, JSValueCompatible { - case normal = "normal" +public enum CanvasFontVariantCaps: String, JSValueCompatible { + case normal case smallCaps = "small-caps" case allSmallCaps = "all-small-caps" case petiteCaps = "petite-caps" case allPetiteCaps = "all-petite-caps" - case unicase = "unicase" + case unicase case titlingCaps = "titling-caps" public static func construct(from jsValue: JSValue) -> Self? { diff --git a/Sources/DOMKit/WebIDL/CanvasGradient.swift b/Sources/DOMKit/WebIDL/CanvasGradient.swift index f3c555b0..f8d39af1 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient.swift @@ -17,6 +17,6 @@ public class CanvasGradient: JSBridgedClass { } public func addColorStop(offset: Double, color: String) { - jsObject[Keys.addColorStop]!(offset.jsValue(), color.jsValue()).fromJSValue()! + _ = jsObject[Keys.addColorStop]!(offset.jsValue(), color.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CanvasImageData.swift b/Sources/DOMKit/WebIDL/CanvasImageData.swift index ae4f07bd..6de10b80 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageData.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageData.swift @@ -24,7 +24,7 @@ public extension CanvasImageData { } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { - jsObject[Keys.putImageData]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()).fromJSValue()! + _ = jsObject[Keys.putImageData]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()) } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32, dirtyX: Int32, dirtyY: Int32, dirtyWidth: Int32, dirtyHeight: Int32) { @@ -35,6 +35,6 @@ public extension CanvasImageData { let _arg4 = dirtyY.jsValue() let _arg5 = dirtyWidth.jsValue() let _arg6 = dirtyHeight.jsValue() - return jsObject[Keys.putImageData]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6).fromJSValue()! + _ = jsObject[Keys.putImageData]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) } } diff --git a/Sources/DOMKit/WebIDL/CanvasLineCap.swift b/Sources/DOMKit/WebIDL/CanvasLineCap.swift index 4abf6591..e344ba04 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineCap.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineCap.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasLineCap: JSString, JSValueCompatible { - case butt = "butt" - case round = "round" - case square = "square" +public enum CanvasLineCap: String, JSValueCompatible { + case butt + case round + case square public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift index cdb1b6c0..03b8d7f0 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasLineJoin: JSString, JSValueCompatible { - case round = "round" - case bevel = "bevel" - case miter = "miter" +public enum CanvasLineJoin: String, JSValueCompatible { + case round + case bevel + case miter public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CanvasPath.swift b/Sources/DOMKit/WebIDL/CanvasPath.swift index c304b4d7..523128e2 100644 --- a/Sources/DOMKit/WebIDL/CanvasPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasPath.swift @@ -19,19 +19,19 @@ private enum Keys { public protocol CanvasPath: JSBridgedClass {} public extension CanvasPath { func closePath() { - jsObject[Keys.closePath]!().fromJSValue()! + _ = jsObject[Keys.closePath]!() } func moveTo(x: Double, y: Double) { - jsObject[Keys.moveTo]!(x.jsValue(), y.jsValue()).fromJSValue()! + _ = jsObject[Keys.moveTo]!(x.jsValue(), y.jsValue()) } func lineTo(x: Double, y: Double) { - jsObject[Keys.lineTo]!(x.jsValue(), y.jsValue()).fromJSValue()! + _ = jsObject[Keys.lineTo]!(x.jsValue(), y.jsValue()) } func quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double) { - jsObject[Keys.quadraticCurveTo]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + _ = jsObject[Keys.quadraticCurveTo]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()) } func bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double) { @@ -41,19 +41,19 @@ public extension CanvasPath { let _arg3 = cp2y.jsValue() let _arg4 = x.jsValue() let _arg5 = y.jsValue() - return jsObject[Keys.bezierCurveTo]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + _ = jsObject[Keys.bezierCurveTo]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) { - jsObject[Keys.arcTo]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()).fromJSValue()! + _ = jsObject[Keys.arcTo]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()) } func rect(x: Double, y: Double, w: Double, h: Double) { - jsObject[Keys.rect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()).fromJSValue()! + _ = jsObject[Keys.rect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } func roundRect(x: Double, y: Double, w: Double, h: Double, radii: __UNSUPPORTED_UNION__? = nil) { - jsObject[Keys.roundRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.roundRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined) } func arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -63,7 +63,7 @@ public extension CanvasPath { let _arg3 = startAngle.jsValue() let _arg4 = endAngle.jsValue() let _arg5 = counterclockwise?.jsValue() ?? .undefined - return jsObject[Keys.arc]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + _ = jsObject[Keys.arc]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -75,6 +75,6 @@ public extension CanvasPath { let _arg5 = startAngle.jsValue() let _arg6 = endAngle.jsValue() let _arg7 = counterclockwise?.jsValue() ?? .undefined - return jsObject[Keys.ellipse]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7).fromJSValue()! + _ = jsObject[Keys.ellipse]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift index 0147e8f9..38eddef1 100644 --- a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift @@ -36,7 +36,7 @@ public extension CanvasPathDrawingStyles { } func setLineDash(segments: [Double]) { - jsObject[Keys.setLineDash]!(segments.jsValue()).fromJSValue()! + _ = jsObject[Keys.setLineDash]!(segments.jsValue()) } func getLineDash() -> [Double] { diff --git a/Sources/DOMKit/WebIDL/CanvasPattern.swift b/Sources/DOMKit/WebIDL/CanvasPattern.swift index f7db7069..907d418d 100644 --- a/Sources/DOMKit/WebIDL/CanvasPattern.swift +++ b/Sources/DOMKit/WebIDL/CanvasPattern.swift @@ -17,6 +17,6 @@ public class CanvasPattern: JSBridgedClass { } public func setTransform(transform: DOMMatrix2DInit? = nil) { - jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CanvasRect.swift b/Sources/DOMKit/WebIDL/CanvasRect.swift index e76e5466..999fa9bf 100644 --- a/Sources/DOMKit/WebIDL/CanvasRect.swift +++ b/Sources/DOMKit/WebIDL/CanvasRect.swift @@ -12,14 +12,14 @@ private enum Keys { public protocol CanvasRect: JSBridgedClass {} public extension CanvasRect { func clearRect(x: Double, y: Double, w: Double, h: Double) { - jsObject[Keys.clearRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()).fromJSValue()! + _ = jsObject[Keys.clearRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } func fillRect(x: Double, y: Double, w: Double, h: Double) { - jsObject[Keys.fillRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()).fromJSValue()! + _ = jsObject[Keys.fillRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } func strokeRect(x: Double, y: Double, w: Double, h: Double) { - jsObject[Keys.strokeRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()).fromJSValue()! + _ = jsObject[Keys.strokeRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CanvasState.swift b/Sources/DOMKit/WebIDL/CanvasState.swift index f792dbc1..001c4ddf 100644 --- a/Sources/DOMKit/WebIDL/CanvasState.swift +++ b/Sources/DOMKit/WebIDL/CanvasState.swift @@ -13,15 +13,15 @@ private enum Keys { public protocol CanvasState: JSBridgedClass {} public extension CanvasState { func save() { - jsObject[Keys.save]!().fromJSValue()! + _ = jsObject[Keys.save]!() } func restore() { - jsObject[Keys.restore]!().fromJSValue()! + _ = jsObject[Keys.restore]!() } func reset() { - jsObject[Keys.reset]!().fromJSValue()! + _ = jsObject[Keys.reset]!() } func isContextLost() -> Bool { diff --git a/Sources/DOMKit/WebIDL/CanvasText.swift b/Sources/DOMKit/WebIDL/CanvasText.swift index d60e97ab..e7611071 100644 --- a/Sources/DOMKit/WebIDL/CanvasText.swift +++ b/Sources/DOMKit/WebIDL/CanvasText.swift @@ -12,11 +12,11 @@ private enum Keys { public protocol CanvasText: JSBridgedClass {} public extension CanvasText { func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - jsObject[Keys.fillText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.fillText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) } func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - jsObject[Keys.strokeText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.strokeText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) } func measureText(text: String) -> TextMetrics { diff --git a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift index 6512b7ba..727ff3d3 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasTextAlign: JSString, JSValueCompatible { - case start = "start" - case end = "end" - case left = "left" - case right = "right" - case center = "center" +public enum CanvasTextAlign: String, JSValueCompatible { + case start + case end + case left + case right + case center public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift index 0ac85557..da5f274c 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -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 CanvasTextBaseline: String, JSValueCompatible { + case top + case hanging + case middle + case alphabetic + case ideographic + case bottom public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift index 1027dc20..93970426 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasTextRendering: JSString, JSValueCompatible { - case auto = "auto" - case optimizeSpeed = "optimizeSpeed" - case optimizeLegibility = "optimizeLegibility" - case geometricPrecision = "geometricPrecision" +public enum CanvasTextRendering: String, JSValueCompatible { + case auto + case optimizeSpeed + case optimizeLegibility + case geometricPrecision public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CanvasTransform.swift b/Sources/DOMKit/WebIDL/CanvasTransform.swift index 730e29c2..744b0f19 100644 --- a/Sources/DOMKit/WebIDL/CanvasTransform.swift +++ b/Sources/DOMKit/WebIDL/CanvasTransform.swift @@ -16,15 +16,15 @@ private enum Keys { public protocol CanvasTransform: JSBridgedClass {} public extension CanvasTransform { func scale(x: Double, y: Double) { - jsObject[Keys.scale]!(x.jsValue(), y.jsValue()).fromJSValue()! + _ = jsObject[Keys.scale]!(x.jsValue(), y.jsValue()) } func rotate(angle: Double) { - jsObject[Keys.rotate]!(angle.jsValue()).fromJSValue()! + _ = jsObject[Keys.rotate]!(angle.jsValue()) } func translate(x: Double, y: Double) { - jsObject[Keys.translate]!(x.jsValue(), y.jsValue()).fromJSValue()! + _ = jsObject[Keys.translate]!(x.jsValue(), y.jsValue()) } func transform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { @@ -34,7 +34,7 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - return jsObject[Keys.transform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + _ = jsObject[Keys.transform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func getTransform() -> DOMMatrix { @@ -48,14 +48,14 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - return jsObject[Keys.setTransform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + _ = jsObject[Keys.setTransform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func setTransform(transform: DOMMatrix2DInit? = nil) { - jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined) } func resetTransform() { - jsObject[Keys.resetTransform]!().fromJSValue()! + _ = jsObject[Keys.resetTransform]!() } } diff --git a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift index 9a792709..4faa8dc9 100644 --- a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift +++ b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift @@ -11,18 +11,18 @@ private enum Keys { public protocol CanvasUserInterface: JSBridgedClass {} public extension CanvasUserInterface { func drawFocusIfNeeded(element: Element) { - jsObject[Keys.drawFocusIfNeeded]!(element.jsValue()).fromJSValue()! + _ = jsObject[Keys.drawFocusIfNeeded]!(element.jsValue()) } func drawFocusIfNeeded(path: Path2D, element: Element) { - jsObject[Keys.drawFocusIfNeeded]!(path.jsValue(), element.jsValue()).fromJSValue()! + _ = jsObject[Keys.drawFocusIfNeeded]!(path.jsValue(), element.jsValue()) } func scrollPathIntoView() { - jsObject[Keys.scrollPathIntoView]!().fromJSValue()! + _ = jsObject[Keys.scrollPathIntoView]!() } func scrollPathIntoView(path: Path2D) { - jsObject[Keys.scrollPathIntoView]!(path.jsValue()).fromJSValue()! + _ = jsObject[Keys.scrollPathIntoView]!(path.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CharacterData.swift b/Sources/DOMKit/WebIDL/CharacterData.swift index 3c828ea5..53330197 100644 --- a/Sources/DOMKit/WebIDL/CharacterData.swift +++ b/Sources/DOMKit/WebIDL/CharacterData.swift @@ -33,18 +33,18 @@ public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { } public func appendData(data: String) { - jsObject[Keys.appendData]!(data.jsValue()).fromJSValue()! + _ = jsObject[Keys.appendData]!(data.jsValue()) } public func insertData(offset: UInt32, data: String) { - jsObject[Keys.insertData]!(offset.jsValue(), data.jsValue()).fromJSValue()! + _ = jsObject[Keys.insertData]!(offset.jsValue(), data.jsValue()) } public func deleteData(offset: UInt32, count: UInt32) { - jsObject[Keys.deleteData]!(offset.jsValue(), count.jsValue()).fromJSValue()! + _ = jsObject[Keys.deleteData]!(offset.jsValue(), count.jsValue()) } public func replaceData(offset: UInt32, count: UInt32, data: String) { - jsObject[Keys.replaceData]!(offset.jsValue(), count.jsValue(), data.jsValue()).fromJSValue()! + _ = jsObject[Keys.replaceData]!(offset.jsValue(), count.jsValue(), data.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ChildNode.swift b/Sources/DOMKit/WebIDL/ChildNode.swift index da50df7d..5a833ac3 100644 --- a/Sources/DOMKit/WebIDL/ChildNode.swift +++ b/Sources/DOMKit/WebIDL/ChildNode.swift @@ -13,18 +13,18 @@ private enum Keys { public protocol ChildNode: JSBridgedClass {} public extension ChildNode { func before(nodes: __UNSUPPORTED_UNION__...) { - jsObject[Keys.before]!(nodes.jsValue()).fromJSValue()! + _ = jsObject[Keys.before]!(nodes.jsValue()) } func after(nodes: __UNSUPPORTED_UNION__...) { - jsObject[Keys.after]!(nodes.jsValue()).fromJSValue()! + _ = jsObject[Keys.after]!(nodes.jsValue()) } func replaceWith(nodes: __UNSUPPORTED_UNION__...) { - jsObject[Keys.replaceWith]!(nodes.jsValue()).fromJSValue()! + _ = jsObject[Keys.replaceWith]!(nodes.jsValue()) } func remove() { - jsObject[Keys.remove]!().fromJSValue()! + _ = jsObject[Keys.remove]!() } } diff --git a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift index a463e317..69470a4f 100644 --- a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift +++ b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ColorSpaceConversion: JSString, JSValueCompatible { - case none = "none" - case `default` = "default" +public enum ColorSpaceConversion: String, JSValueCompatible { + case none + case `default` public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index b5588d50..d284b152 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -24,6 +24,6 @@ public class CompositionEvent: UIEvent { public var data: String public func initCompositionEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: WindowProxy? = nil, dataArg: String? = nil) { - jsObject[Keys.initCompositionEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.initCompositionEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index 215f702d..72301429 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -30,6 +30,6 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'whenDefined' is ignored public func upgrade(root: Node) { - jsObject[Keys.upgrade]!(root.jsValue()).fromJSValue()! + _ = jsObject[Keys.upgrade]!(root.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index 7e5756fc..685b8e7b 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -24,6 +24,6 @@ public class CustomEvent: Event { public var detail: JSValue public func initCustomEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, detail: JSValue? = nil) { - jsObject[Keys.initCustomEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.initCustomEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index 4ba547b4..912f1a05 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -77,13 +77,13 @@ public class DOMMatrix: DOMMatrixReadOnly { } // XXX: illegal static override - // override public static func `fromMatrix`(`other`: `DOMMatrixInit`? = nil) -> Self + // override public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self // XXX: illegal static override - // override public static func `fromFloat32Array`(`array32`: `Float32Array`) -> Self + // override public static func fromFloat32Array(array32: Float32Array) -> Self // XXX: illegal static override - // override public static func `fromFloat64Array`(`array64`: `Float64Array`) -> Self + // override public static func fromFloat64Array(array64: Float64Array) -> Self private var _a: ReadWriteAttribute override public var a: Double { diff --git a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift index 9e2d5c07..2c3fcf94 100644 --- a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift +++ b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public enum DOMParserSupportedType: JSString, JSValueCompatible { +public enum DOMParserSupportedType: String, JSValueCompatible { case textHtml = "text/html" case textXml = "text/xml" case applicationXml = "application/xml" diff --git a/Sources/DOMKit/WebIDL/DOMPoint.swift b/Sources/DOMKit/WebIDL/DOMPoint.swift index b92a886a..7325ab15 100644 --- a/Sources/DOMKit/WebIDL/DOMPoint.swift +++ b/Sources/DOMKit/WebIDL/DOMPoint.swift @@ -27,7 +27,7 @@ public class DOMPoint: DOMPointReadOnly { } // XXX: illegal static override - // override public static func `fromPoint`(`other`: `DOMPointInit`? = nil) -> Self + // override public static func fromPoint(other: DOMPointInit? = nil) -> Self private var _x: ReadWriteAttribute override public var x: Double { diff --git a/Sources/DOMKit/WebIDL/DOMRect.swift b/Sources/DOMKit/WebIDL/DOMRect.swift index 4d06ad0c..19097f9e 100644 --- a/Sources/DOMKit/WebIDL/DOMRect.swift +++ b/Sources/DOMKit/WebIDL/DOMRect.swift @@ -27,7 +27,7 @@ public class DOMRect: DOMRectReadOnly { } // XXX: illegal static override - // override public static func `fromRect`(`other`: `DOMRectInit`? = nil) -> Self + // override public static func fromRect(other: DOMRectInit? = nil) -> Self private var _x: ReadWriteAttribute override public var x: Double { diff --git a/Sources/DOMKit/WebIDL/DOMRectList.swift b/Sources/DOMKit/WebIDL/DOMRectList.swift index 46270166..00827200 100644 --- a/Sources/DOMKit/WebIDL/DOMRectList.swift +++ b/Sources/DOMKit/WebIDL/DOMRectList.swift @@ -21,7 +21,7 @@ public class DOMRectList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> DOMRect? { + public subscript(key: Int) -> DOMRect? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/DOMStringList.swift b/Sources/DOMKit/WebIDL/DOMStringList.swift index 904c493a..88ea6bbe 100644 --- a/Sources/DOMKit/WebIDL/DOMStringList.swift +++ b/Sources/DOMKit/WebIDL/DOMStringList.swift @@ -22,7 +22,7 @@ public class DOMStringList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> String? { + public subscript(key: Int) -> String? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/DOMStringMap.swift b/Sources/DOMKit/WebIDL/DOMStringMap.swift index 8914cce2..4a32e5da 100644 --- a/Sources/DOMKit/WebIDL/DOMStringMap.swift +++ b/Sources/DOMKit/WebIDL/DOMStringMap.swift @@ -18,7 +18,7 @@ public class DOMStringMap: JSBridgedClass { jsObject[key].fromJSValue()! } - // XXX: unsupported setter for keys of type `String` + // XXX: unsupported setter for keys of type String - // XXX: unsupported deleter for keys of type `String` + // XXX: unsupported deleter for keys of type String } diff --git a/Sources/DOMKit/WebIDL/DOMTokenList.swift b/Sources/DOMKit/WebIDL/DOMTokenList.swift index 49589a11..01e93d87 100644 --- a/Sources/DOMKit/WebIDL/DOMTokenList.swift +++ b/Sources/DOMKit/WebIDL/DOMTokenList.swift @@ -29,7 +29,7 @@ public class DOMTokenList: JSBridgedClass, Sequence { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> String? { + public subscript(key: Int) -> String? { jsObject[key].fromJSValue() } @@ -38,11 +38,11 @@ public class DOMTokenList: JSBridgedClass, Sequence { } public func add(tokens: String...) { - jsObject[Keys.add]!(tokens.jsValue()).fromJSValue()! + _ = jsObject[Keys.add]!(tokens.jsValue()) } public func remove(tokens: String...) { - jsObject[Keys.remove]!(tokens.jsValue()).fromJSValue()! + _ = jsObject[Keys.remove]!(tokens.jsValue()) } public func toggle(token: String, force: Bool? = nil) -> Bool { diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift index f8597722..5b74322c 100644 --- a/Sources/DOMKit/WebIDL/DataTransfer.swift +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -43,7 +43,7 @@ public class DataTransfer: JSBridgedClass { public var items: DataTransferItemList public func setDragImage(image: Element, x: Int32, y: Int32) { - jsObject[Keys.setDragImage]!(image.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + _ = jsObject[Keys.setDragImage]!(image.jsValue(), x.jsValue(), y.jsValue()) } @ReadonlyAttribute @@ -54,11 +54,11 @@ public class DataTransfer: JSBridgedClass { } public func setData(format: String, data: String) { - jsObject[Keys.setData]!(format.jsValue(), data.jsValue()).fromJSValue()! + _ = jsObject[Keys.setData]!(format.jsValue(), data.jsValue()) } public func clearData(format: String? = nil) { - jsObject[Keys.clearData]!(format?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.clearData]!(format?.jsValue() ?? .undefined) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransferItemList.swift b/Sources/DOMKit/WebIDL/DataTransferItemList.swift index 746f636f..0cf60b32 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItemList.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItemList.swift @@ -23,7 +23,7 @@ public class DataTransferItemList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> DataTransferItem { + public subscript(key: Int) -> DataTransferItem { jsObject[key].fromJSValue()! } @@ -36,10 +36,10 @@ public class DataTransferItemList: JSBridgedClass { } public func remove(index: UInt32) { - jsObject[Keys.remove]!(index.jsValue()).fromJSValue()! + _ = jsObject[Keys.remove]!(index.jsValue()) } public func clear() { - jsObject[Keys.clear]!().fromJSValue()! + _ = jsObject[Keys.clear]!() } } diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index 0ef02b06..47d556b4 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -25,15 +25,15 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid public var name: String public func postMessage(message: JSValue, transfer: [JSObject]) { - jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()).fromJSValue()! + _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 17cd6195..52cb1141 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -298,15 +298,15 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN } public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } public func write(text: String...) { - jsObject[Keys.write]!(text.jsValue()).fromJSValue()! + _ = jsObject[Keys.write]!(text.jsValue()) } public func writeln(text: String...) { - jsObject[Keys.writeln]!(text.jsValue()).fromJSValue()! + _ = jsObject[Keys.writeln]!(text.jsValue()) } @ReadonlyAttribute @@ -377,15 +377,15 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN public var applets: HTMLCollection public func clear() { - jsObject[Keys.clear]!().fromJSValue()! + _ = jsObject[Keys.clear]!() } public func captureEvents() { - jsObject[Keys.captureEvents]!().fromJSValue()! + _ = jsObject[Keys.captureEvents]!() } public func releaseEvents() { - jsObject[Keys.releaseEvents]!().fromJSValue()! + _ = jsObject[Keys.releaseEvents]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DocumentReadyState.swift b/Sources/DOMKit/WebIDL/DocumentReadyState.swift index 79948fce..3fd6716f 100644 --- a/Sources/DOMKit/WebIDL/DocumentReadyState.swift +++ b/Sources/DOMKit/WebIDL/DocumentReadyState.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum DocumentReadyState: JSString, JSValueCompatible { - case loading = "loading" - case interactive = "interactive" - case complete = "complete" +public enum DocumentReadyState: String, JSValueCompatible { + case loading + case interactive + case complete public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift index bad5b547..5475c766 100644 --- a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift +++ b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum DocumentVisibilityState: JSString, JSValueCompatible { - case visible = "visible" - case hidden = "hidden" +public enum DocumentVisibilityState: String, JSValueCompatible { + case visible + case hidden public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index 5615def9..22b70aae 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -102,19 +102,19 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo } public func setAttribute(qualifiedName: String, value: String) { - jsObject[Keys.setAttribute]!(qualifiedName.jsValue(), value.jsValue()).fromJSValue()! + _ = jsObject[Keys.setAttribute]!(qualifiedName.jsValue(), value.jsValue()) } public func setAttributeNS(namespace: String?, qualifiedName: String, value: String) { - jsObject[Keys.setAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()).fromJSValue()! + _ = jsObject[Keys.setAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()) } public func removeAttribute(qualifiedName: String) { - jsObject[Keys.removeAttribute]!(qualifiedName.jsValue()).fromJSValue()! + _ = jsObject[Keys.removeAttribute]!(qualifiedName.jsValue()) } public func removeAttributeNS(namespace: String?, localName: String) { - jsObject[Keys.removeAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + _ = jsObject[Keys.removeAttributeNS]!(namespace.jsValue(), localName.jsValue()) } public func toggleAttribute(qualifiedName: String, force: Bool? = nil) -> Bool { @@ -185,6 +185,6 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo } public func insertAdjacentText(where: String, data: String) { - jsObject[Keys.insertAdjacentText]!(`where`.jsValue(), data.jsValue()).fromJSValue()! + _ = jsObject[Keys.insertAdjacentText]!(`where`.jsValue(), data.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index 84860c06..92910461 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -35,14 +35,14 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public var shadowRoot: ShadowRoot? public func setFormValue(value: __UNSUPPORTED_UNION__?, state: __UNSUPPORTED_UNION__? = nil) { - jsObject[Keys.setFormValue]!(value.jsValue(), state?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.setFormValue]!(value.jsValue(), state?.jsValue() ?? .undefined) } @ReadonlyAttribute public var form: HTMLFormElement? public func setValidity(flags: ValidityStateFlags? = nil, message: String? = nil, anchor: HTMLElement? = nil) { - jsObject[Keys.setValidity]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.setValidity]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EndingType.swift b/Sources/DOMKit/WebIDL/EndingType.swift index 2681f937..a4d8ee5f 100644 --- a/Sources/DOMKit/WebIDL/EndingType.swift +++ b/Sources/DOMKit/WebIDL/EndingType.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum EndingType: JSString, JSValueCompatible { - case transparent = "transparent" - case native = "native" +public enum EndingType: String, JSValueCompatible { + case transparent + case native public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index aa15f52c..37a7aad5 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -82,14 +82,14 @@ public class Event: JSBridgedClass { public var eventPhase: UInt16 public func stopPropagation() { - jsObject[Keys.stopPropagation]!().fromJSValue()! + _ = jsObject[Keys.stopPropagation]!() } @ReadWriteAttribute public var cancelBubble: Bool public func stopImmediatePropagation() { - jsObject[Keys.stopImmediatePropagation]!().fromJSValue()! + _ = jsObject[Keys.stopImmediatePropagation]!() } @ReadonlyAttribute @@ -102,7 +102,7 @@ public class Event: JSBridgedClass { public var returnValue: Bool public func preventDefault() { - jsObject[Keys.preventDefault]!().fromJSValue()! + _ = jsObject[Keys.preventDefault]!() } @ReadonlyAttribute @@ -118,6 +118,6 @@ public class Event: JSBridgedClass { public var timeStamp: DOMHighResTimeStamp public func initEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil) { - jsObject[Keys.initEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.initEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index 3a10c9d5..9af5fd7e 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -58,6 +58,6 @@ public class EventSource: EventTarget { public var onerror: EventHandler public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } } diff --git a/Sources/DOMKit/WebIDL/External.swift b/Sources/DOMKit/WebIDL/External.swift index dcdbef4c..4c6e4497 100644 --- a/Sources/DOMKit/WebIDL/External.swift +++ b/Sources/DOMKit/WebIDL/External.swift @@ -18,10 +18,10 @@ public class External: JSBridgedClass { } public func AddSearchProvider() { - jsObject[Keys.AddSearchProvider]!().fromJSValue()! + _ = jsObject[Keys.AddSearchProvider]!() } public func IsSearchProviderInstalled() { - jsObject[Keys.IsSearchProviderInstalled]!().fromJSValue()! + _ = jsObject[Keys.IsSearchProviderInstalled]!() } } diff --git a/Sources/DOMKit/WebIDL/FileList.swift b/Sources/DOMKit/WebIDL/FileList.swift index ff5bb675..bfe0837c 100644 --- a/Sources/DOMKit/WebIDL/FileList.swift +++ b/Sources/DOMKit/WebIDL/FileList.swift @@ -18,7 +18,7 @@ public class FileList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: UInt32) -> File? { + public subscript(key: Int) -> File? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index 2d877801..c6f8a62e 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -44,23 +44,23 @@ public class FileReader: EventTarget { } public func readAsArrayBuffer(blob: Blob) { - jsObject[Keys.readAsArrayBuffer]!(blob.jsValue()).fromJSValue()! + _ = jsObject[Keys.readAsArrayBuffer]!(blob.jsValue()) } public func readAsBinaryString(blob: Blob) { - jsObject[Keys.readAsBinaryString]!(blob.jsValue()).fromJSValue()! + _ = jsObject[Keys.readAsBinaryString]!(blob.jsValue()) } public func readAsText(blob: Blob, encoding: String? = nil) { - jsObject[Keys.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined) } public func readAsDataURL(blob: Blob) { - jsObject[Keys.readAsDataURL]!(blob.jsValue()).fromJSValue()! + _ = jsObject[Keys.readAsDataURL]!(blob.jsValue()) } public func abort() { - jsObject[Keys.abort]!().fromJSValue()! + _ = jsObject[Keys.abort]!() } public static let EMPTY: UInt16 = 0 diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index 25915174..3d29e8e1 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -26,15 +26,15 @@ public class FormData: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - jsObject[Keys.append]!(name.jsValue(), value.jsValue()).fromJSValue()! + _ = jsObject[Keys.append]!(name.jsValue(), value.jsValue()) } public func append(name: String, blobValue: Blob, filename: String? = nil) { - jsObject[Keys.append]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.append]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) } public func delete(name: String) { - jsObject[Keys.delete]!(name.jsValue()).fromJSValue()! + _ = jsObject[Keys.delete]!(name.jsValue()) } public func get(name: String) -> FormDataEntryValue? { @@ -50,11 +50,11 @@ public class FormData: JSBridgedClass, Sequence { } public func set(name: String, value: String) { - jsObject[Keys.set]!(name.jsValue(), value.jsValue()).fromJSValue()! + _ = jsObject[Keys.set]!(name.jsValue(), value.jsValue()) } public func set(name: String, blobValue: Blob, filename: String? = nil) { - jsObject[Keys.set]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.set]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift index c627f1b7..a4f82368 100644 --- a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -22,7 +22,7 @@ public class HTMLAllCollection: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> Element { + public subscript(key: Int) -> Element { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift index ea877bbc..78f64f1a 100644 --- a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -96,7 +96,7 @@ public class HTMLButtonElement: HTMLElement { } public func setCustomValidity(error: String) { - jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLCollection.swift b/Sources/DOMKit/WebIDL/HTMLCollection.swift index fcee1f5c..a4de02ad 100644 --- a/Sources/DOMKit/WebIDL/HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLCollection.swift @@ -22,7 +22,7 @@ public class HTMLCollection: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> Element? { + public subscript(key: Int) -> Element? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift index f4326bb1..51775d34 100644 --- a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -31,14 +31,14 @@ public class HTMLDialogElement: HTMLElement { public var returnValue: String public func show() { - jsObject[Keys.show]!().fromJSValue()! + _ = jsObject[Keys.show]!() } public func showModal() { - jsObject[Keys.showModal]!().fromJSValue()! + _ = jsObject[Keys.showModal]!() } public func close(returnValue: String? = nil) { - jsObject[Keys.close]!(returnValue?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.close]!(returnValue?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 1fed310e..029758e2 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -64,7 +64,7 @@ public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventH public var inert: Bool public func click() { - jsObject[Keys.click]!().fromJSValue()! + _ = jsObject[Keys.click]!() } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift index 14287627..9dc84ce7 100644 --- a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -69,6 +69,6 @@ public class HTMLFieldSetElement: HTMLElement { } public func setCustomValidity(error: String) { - jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index a9a151ac..c729ed1c 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -87,7 +87,7 @@ public class HTMLFormElement: HTMLElement { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> Element { + public subscript(key: Int) -> Element { jsObject[key].fromJSValue()! } @@ -96,15 +96,15 @@ public class HTMLFormElement: HTMLElement { } public func submit() { - jsObject[Keys.submit]!().fromJSValue()! + _ = jsObject[Keys.submit]!() } public func requestSubmit(submitter: HTMLElement? = nil) { - jsObject[Keys.requestSubmit]!(submitter?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.requestSubmit]!(submitter?.jsValue() ?? .undefined) } public func reset() { - jsObject[Keys.reset]!().fromJSValue()! + _ = jsObject[Keys.reset]!() } public func checkValidity() -> Bool { diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index d975bb67..235f788d 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -119,7 +119,7 @@ public class HTMLImageElement: HTMLElement { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func decode() async throws { let _promise: JSPromise = jsObject[Keys.decode]!().fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index e7a5fa0b..b26cb3ba 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -225,11 +225,11 @@ public class HTMLInputElement: HTMLElement { public var width: UInt32 public func stepUp(n: Int32? = nil) { - jsObject[Keys.stepUp]!(n?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.stepUp]!(n?.jsValue() ?? .undefined) } public func stepDown(n: Int32? = nil) { - jsObject[Keys.stepDown]!(n?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.stepDown]!(n?.jsValue() ?? .undefined) } @ReadonlyAttribute @@ -250,14 +250,14 @@ public class HTMLInputElement: HTMLElement { } public func setCustomValidity(error: String) { - jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute public var labels: NodeList? public func select() { - jsObject[Keys.select]!().fromJSValue()! + _ = jsObject[Keys.select]!() } @ReadWriteAttribute @@ -270,19 +270,19 @@ public class HTMLInputElement: HTMLElement { public var selectionDirection: String? public func setRangeText(replacement: String) { - jsObject[Keys.setRangeText]!(replacement.jsValue()).fromJSValue()! + _ = jsObject[Keys.setRangeText]!(replacement.jsValue()) } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) } public func showPicker() { - jsObject[Keys.showPicker]!().fromJSValue()! + _ = jsObject[Keys.showPicker]!() } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift index 081f57f2..8a91d554 100644 --- a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift @@ -75,10 +75,10 @@ public class HTMLMarqueeElement: HTMLElement { public var width: String public func start() { - jsObject[Keys.start]!().fromJSValue()! + _ = jsObject[Keys.start]!() } public func stop() { - jsObject[Keys.stop]!().fromJSValue()! + _ = jsObject[Keys.stop]!() } } diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index 6e480b70..48363e2b 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -118,7 +118,7 @@ public class HTMLMediaElement: HTMLElement { public var buffered: TimeRanges public func load() { - jsObject[Keys.load]!().fromJSValue()! + _ = jsObject[Keys.load]!() } public func canPlayType(type: String) -> CanPlayTypeResult { @@ -145,7 +145,7 @@ public class HTMLMediaElement: HTMLElement { public var currentTime: Double public func fastSeek(time: Double) { - jsObject[Keys.fastSeek]!(time.jsValue()).fromJSValue()! + _ = jsObject[Keys.fastSeek]!(time.jsValue()) } @ReadonlyAttribute @@ -189,11 +189,11 @@ public class HTMLMediaElement: HTMLElement { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func play() async throws { let _promise: JSPromise = jsObject[Keys.play]!().fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } public func pause() { - jsObject[Keys.pause]!().fromJSValue()! + _ = jsObject[Keys.pause]!() } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift index 61f9c1a6..4c756692 100644 --- a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -111,7 +111,7 @@ public class HTMLObjectElement: HTMLElement { } public func setCustomValidity(error: String) { - jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift index 0204304e..4b9344ff 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -25,14 +25,14 @@ public class HTMLOptionsCollection: HTMLCollection { set { _length.wrappedValue = newValue } } - // XXX: unsupported setter for keys of type `UInt32` + // XXX: unsupported setter for keys of type UInt32 public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined) } public func remove(index: Int32) { - jsObject[Keys.remove]!(index.jsValue()).fromJSValue()! + _ = jsObject[Keys.remove]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift index f5186ce3..6816ab99 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift @@ -32,10 +32,10 @@ public extension HTMLOrSVGElement { } func focus(options: FocusOptions? = nil) { - jsObject[Keys.focus]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.focus]!(options?.jsValue() ?? .undefined) } func blur() { - jsObject[Keys.blur]!().fromJSValue()! + _ = jsObject[Keys.blur]!() } } diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift index 56b2e729..7802df2f 100644 --- a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -76,7 +76,7 @@ public class HTMLOutputElement: HTMLElement { } public func setCustomValidity(error: String) { - jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index 53495e47..d17d0cb9 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -88,7 +88,7 @@ public class HTMLSelectElement: HTMLElement { @ReadWriteAttribute public var length: UInt32 - public subscript(key: UInt32) -> HTMLOptionElement? { + public subscript(key: Int) -> HTMLOptionElement? { jsObject[key].fromJSValue() } @@ -97,18 +97,18 @@ public class HTMLSelectElement: HTMLElement { } public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined) } public func remove() { - jsObject[Keys.remove]!().fromJSValue()! + _ = jsObject[Keys.remove]!() } public func remove(index: Int32) { - jsObject[Keys.remove]!(index.jsValue()).fromJSValue()! + _ = jsObject[Keys.remove]!(index.jsValue()) } - // XXX: unsupported setter for keys of type `UInt32` + // XXX: unsupported setter for keys of type UInt32 @ReadonlyAttribute public var selectedOptions: HTMLCollection @@ -137,7 +137,7 @@ public class HTMLSelectElement: HTMLElement { } public func setCustomValidity(error: String) { - jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index d98cba18..2f8431f4 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -34,6 +34,6 @@ public class HTMLSlotElement: HTMLElement { } public func assign(nodes: __UNSUPPORTED_UNION__...) { - jsObject[Keys.assign]!(nodes.jsValue()).fromJSValue()! + _ = jsObject[Keys.assign]!(nodes.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift index e12d35b9..3da61598 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -62,7 +62,7 @@ public class HTMLTableElement: HTMLElement { } public func deleteCaption() { - jsObject[Keys.deleteCaption]!().fromJSValue()! + _ = jsObject[Keys.deleteCaption]!() } @ReadWriteAttribute @@ -73,7 +73,7 @@ public class HTMLTableElement: HTMLElement { } public func deleteTHead() { - jsObject[Keys.deleteTHead]!().fromJSValue()! + _ = jsObject[Keys.deleteTHead]!() } @ReadWriteAttribute @@ -84,7 +84,7 @@ public class HTMLTableElement: HTMLElement { } public func deleteTFoot() { - jsObject[Keys.deleteTFoot]!().fromJSValue()! + _ = jsObject[Keys.deleteTFoot]!() } @ReadonlyAttribute @@ -102,7 +102,7 @@ public class HTMLTableElement: HTMLElement { } public func deleteRow(index: Int32) { - jsObject[Keys.deleteRow]!(index.jsValue()).fromJSValue()! + _ = jsObject[Keys.deleteRow]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift index bcc6da55..b91d1018 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -49,7 +49,7 @@ public class HTMLTableRowElement: HTMLElement { } public func deleteCell(index: Int32) { - jsObject[Keys.deleteCell]!(index.jsValue()).fromJSValue()! + _ = jsObject[Keys.deleteCell]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift index b0e612c6..4fe06c07 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -37,7 +37,7 @@ public class HTMLTableSectionElement: HTMLElement { } public func deleteRow(index: Int32) { - jsObject[Keys.deleteRow]!(index.jsValue()).fromJSValue()! + _ = jsObject[Keys.deleteRow]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift index a63883a8..af3cb5f9 100644 --- a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -140,14 +140,14 @@ public class HTMLTextAreaElement: HTMLElement { } public func setCustomValidity(error: String) { - jsObject[Keys.setCustomValidity]!(error.jsValue()).fromJSValue()! + _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute public var labels: NodeList public func select() { - jsObject[Keys.select]!().fromJSValue()! + _ = jsObject[Keys.select]!() } @ReadWriteAttribute @@ -160,14 +160,14 @@ public class HTMLTextAreaElement: HTMLElement { public var selectionDirection: String public func setRangeText(replacement: String) { - jsObject[Keys.setRangeText]!(replacement.jsValue()).fromJSValue()! + _ = jsObject[Keys.setRangeText]!(replacement.jsValue()) } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift index d2988f7c..54d72cf3 100644 --- a/Sources/DOMKit/WebIDL/Headers.swift +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -25,11 +25,11 @@ public class Headers: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - jsObject[Keys.append]!(name.jsValue(), value.jsValue()).fromJSValue()! + _ = jsObject[Keys.append]!(name.jsValue(), value.jsValue()) } public func delete(name: String) { - jsObject[Keys.delete]!(name.jsValue()).fromJSValue()! + _ = jsObject[Keys.delete]!(name.jsValue()) } public func get(name: String) -> String? { @@ -41,7 +41,7 @@ public class Headers: JSBridgedClass, Sequence { } public func set(name: String, value: String) { - jsObject[Keys.set]!(name.jsValue(), value.jsValue()).fromJSValue()! + _ = jsObject[Keys.set]!(name.jsValue(), value.jsValue()) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/History.swift b/Sources/DOMKit/WebIDL/History.swift index 85d37e58..c233b1dd 100644 --- a/Sources/DOMKit/WebIDL/History.swift +++ b/Sources/DOMKit/WebIDL/History.swift @@ -36,22 +36,22 @@ public class History: JSBridgedClass { public var state: JSValue public func go(delta: Int32? = nil) { - jsObject[Keys.go]!(delta?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.go]!(delta?.jsValue() ?? .undefined) } public func back() { - jsObject[Keys.back]!().fromJSValue()! + _ = jsObject[Keys.back]!() } public func forward() { - jsObject[Keys.forward]!().fromJSValue()! + _ = jsObject[Keys.forward]!() } public func pushState(data: JSValue, unused: String, url: String? = nil) { - jsObject[Keys.pushState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.pushState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) } public func replaceState(data: JSValue, unused: String, url: String? = nil) { - jsObject[Keys.replaceState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.replaceState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmap.swift b/Sources/DOMKit/WebIDL/ImageBitmap.swift index 602d015c..0e0c6ff7 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmap.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmap.swift @@ -27,6 +27,6 @@ public class ImageBitmap: JSBridgedClass { public var height: UInt32 public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift index d961e29c..7f7114b8 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -22,6 +22,6 @@ public class ImageBitmapRenderingContext: JSBridgedClass { public var canvas: __UNSUPPORTED_UNION__ public func transferFromImageBitmap(bitmap: ImageBitmap?) { - jsObject[Keys.transferFromImageBitmap]!(bitmap.jsValue()).fromJSValue()! + _ = jsObject[Keys.transferFromImageBitmap]!(bitmap.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ImageOrientation.swift b/Sources/DOMKit/WebIDL/ImageOrientation.swift index 36bc2af1..52001125 100644 --- a/Sources/DOMKit/WebIDL/ImageOrientation.swift +++ b/Sources/DOMKit/WebIDL/ImageOrientation.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ImageOrientation: JSString, JSValueCompatible { - case none = "none" - case flipY = "flipY" +public enum ImageOrientation: String, JSValueCompatible { + case none + case flipY public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift index 634c1f83..ca275f9e 100644 --- a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift +++ b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ImageSmoothingQuality: JSString, JSValueCompatible { - case low = "low" - case medium = "medium" - case high = "high" +public enum ImageSmoothingQuality: String, JSValueCompatible { + case low + case medium + case high public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index a7cf2312..a3de1cda 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -95,7 +95,7 @@ public class KeyboardEvent: UIEvent { let _arg7 = altKey?.jsValue() ?? .undefined let _arg8 = shiftKey?.jsValue() ?? .undefined let _arg9 = metaKey?.jsValue() ?? .undefined - return jsObject[Keys.initKeyboardEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9).fromJSValue()! + _ = jsObject[Keys.initKeyboardEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Location.swift b/Sources/DOMKit/WebIDL/Location.swift index 6c781f5d..baea9170 100644 --- a/Sources/DOMKit/WebIDL/Location.swift +++ b/Sources/DOMKit/WebIDL/Location.swift @@ -66,15 +66,15 @@ public class Location: JSBridgedClass { public var hash: String public func assign(url: String) { - jsObject[Keys.assign]!(url.jsValue()).fromJSValue()! + _ = jsObject[Keys.assign]!(url.jsValue()) } public func replace(url: String) { - jsObject[Keys.replace]!(url.jsValue()).fromJSValue()! + _ = jsObject[Keys.replace]!(url.jsValue()) } public func reload() { - jsObject[Keys.reload]!().fromJSValue()! + _ = jsObject[Keys.reload]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift index 8346a1d6..e1c051e3 100644 --- a/Sources/DOMKit/WebIDL/MediaList.swift +++ b/Sources/DOMKit/WebIDL/MediaList.swift @@ -28,15 +28,15 @@ public class MediaList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> String? { + public subscript(key: Int) -> String? { jsObject[key].fromJSValue() } public func appendMedium(medium: String) { - jsObject[Keys.appendMedium]!(medium.jsValue()).fromJSValue()! + _ = jsObject[Keys.appendMedium]!(medium.jsValue()) } public func deleteMedium(medium: String) { - jsObject[Keys.deleteMedium]!(medium.jsValue()).fromJSValue()! + _ = jsObject[Keys.deleteMedium]!(medium.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift index 746ab318..0492a558 100644 --- a/Sources/DOMKit/WebIDL/MessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -52,6 +52,6 @@ public class MessageEvent: Event { let _arg5 = lastEventId?.jsValue() ?? .undefined let _arg6 = source?.jsValue() ?? .undefined let _arg7 = ports?.jsValue() ?? .undefined - return jsObject[Keys.initMessageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7).fromJSValue()! + _ = jsObject[Keys.initMessageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift index c2d15ba9..76590e62 100644 --- a/Sources/DOMKit/WebIDL/MessagePort.swift +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -21,19 +21,19 @@ public class MessagePort: EventTarget { } public func postMessage(message: JSValue, transfer: [JSObject]) { - jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()).fromJSValue()! + _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } public func start() { - jsObject[Keys.start]!().fromJSValue()! + _ = jsObject[Keys.start]!() } public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/MimeTypeArray.swift b/Sources/DOMKit/WebIDL/MimeTypeArray.swift index 58a75e30..47ba8857 100644 --- a/Sources/DOMKit/WebIDL/MimeTypeArray.swift +++ b/Sources/DOMKit/WebIDL/MimeTypeArray.swift @@ -22,7 +22,7 @@ public class MimeTypeArray: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> MimeType? { + public subscript(key: Int) -> MimeType? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index 988d4931..b6004e1e 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -94,6 +94,6 @@ public class MouseEvent: UIEvent { let _arg12 = metaKeyArg?.jsValue() ?? .undefined let _arg13 = buttonArg?.jsValue() ?? .undefined let _arg14 = relatedTargetArg?.jsValue() ?? .undefined - return jsObject[Keys.initMouseEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14).fromJSValue()! + _ = jsObject[Keys.initMouseEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14) } } diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift index d1bf3e04..7dbcab29 100644 --- a/Sources/DOMKit/WebIDL/MutationEvent.swift +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -57,6 +57,6 @@ public class MutationEvent: Event { let _arg5 = newValueArg?.jsValue() ?? .undefined let _arg6 = attrNameArg?.jsValue() ?? .undefined let _arg7 = attrChangeArg?.jsValue() ?? .undefined - return jsObject[Keys.initMutationEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7).fromJSValue()! + _ = jsObject[Keys.initMutationEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/MutationObserver.swift b/Sources/DOMKit/WebIDL/MutationObserver.swift index d9178e42..ca65ec74 100644 --- a/Sources/DOMKit/WebIDL/MutationObserver.swift +++ b/Sources/DOMKit/WebIDL/MutationObserver.swift @@ -18,16 +18,14 @@ public class MutationObserver: JSBridgedClass { self.jsObject = jsObject } - public convenience init(callback: MutationCallback) { - self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue())) - } + // XXX: constructor is ignored public func observe(target: Node, options: MutationObserverInit? = nil) { - jsObject[Keys.observe]!(target.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.observe]!(target.jsValue(), options?.jsValue() ?? .undefined) } public func disconnect() { - jsObject[Keys.disconnect]!().fromJSValue()! + _ = jsObject[Keys.disconnect]!() } public func takeRecords() -> [MutationRecord] { diff --git a/Sources/DOMKit/WebIDL/NamedNodeMap.swift b/Sources/DOMKit/WebIDL/NamedNodeMap.swift index f137b76d..91421b72 100644 --- a/Sources/DOMKit/WebIDL/NamedNodeMap.swift +++ b/Sources/DOMKit/WebIDL/NamedNodeMap.swift @@ -27,7 +27,7 @@ public class NamedNodeMap: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> Attr? { + public subscript(key: Int) -> Attr? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift index 7b8bb7ed..434c7d84 100644 --- a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift +++ b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift @@ -11,10 +11,10 @@ private enum Keys { public protocol NavigatorContentUtils: JSBridgedClass {} public extension NavigatorContentUtils { func registerProtocolHandler(scheme: String, url: String) { - jsObject[Keys.registerProtocolHandler]!(scheme.jsValue(), url.jsValue()).fromJSValue()! + _ = jsObject[Keys.registerProtocolHandler]!(scheme.jsValue(), url.jsValue()) } func unregisterProtocolHandler(scheme: String, url: String) { - jsObject[Keys.unregisterProtocolHandler]!(scheme.jsValue(), url.jsValue()).fromJSValue()! + _ = jsObject[Keys.unregisterProtocolHandler]!(scheme.jsValue(), url.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/Node.swift b/Sources/DOMKit/WebIDL/Node.swift index aac64cee..fa046a25 100644 --- a/Sources/DOMKit/WebIDL/Node.swift +++ b/Sources/DOMKit/WebIDL/Node.swift @@ -149,7 +149,7 @@ public class Node: EventTarget { public var textContent: String? public func normalize() { - jsObject[Keys.normalize]!().fromJSValue()! + _ = jsObject[Keys.normalize]!() } public func cloneNode(deep: Bool? = nil) -> Self { diff --git a/Sources/DOMKit/WebIDL/NodeIterator.swift b/Sources/DOMKit/WebIDL/NodeIterator.swift index fb64a61a..8d9c3996 100644 --- a/Sources/DOMKit/WebIDL/NodeIterator.swift +++ b/Sources/DOMKit/WebIDL/NodeIterator.swift @@ -50,6 +50,6 @@ public class NodeIterator: JSBridgedClass { } public func detach() { - jsObject[Keys.detach]!().fromJSValue()! + _ = jsObject[Keys.detach]!() } } diff --git a/Sources/DOMKit/WebIDL/NodeList.swift b/Sources/DOMKit/WebIDL/NodeList.swift index 4e972a5b..2c515eeb 100644 --- a/Sources/DOMKit/WebIDL/NodeList.swift +++ b/Sources/DOMKit/WebIDL/NodeList.swift @@ -18,7 +18,7 @@ public class NodeList: JSBridgedClass, Sequence { self.jsObject = jsObject } - public subscript(key: UInt32) -> Node? { + public subscript(key: Int) -> Node? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift index 5f71a4c3..01e08e3a 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift @@ -19,7 +19,7 @@ public class OffscreenCanvasRenderingContext2D: JSBridgedClass, CanvasState, Can } public func commit() { - jsObject[Keys.commit]!().fromJSValue()! + _ = jsObject[Keys.commit]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift index 1a971dd6..b06ef497 100644 --- a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public enum OffscreenRenderingContextId: JSString, JSValueCompatible { +public enum OffscreenRenderingContextId: String, JSValueCompatible { case _2d = "2d" - case bitmaprenderer = "bitmaprenderer" - case webgl = "webgl" - case webgl2 = "webgl2" - case webgpu = "webgpu" + case bitmaprenderer + case webgl + case webgl2 + case webgpu public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/ParentNode.swift b/Sources/DOMKit/WebIDL/ParentNode.swift index eba7b381..1a447815 100644 --- a/Sources/DOMKit/WebIDL/ParentNode.swift +++ b/Sources/DOMKit/WebIDL/ParentNode.swift @@ -26,15 +26,15 @@ public extension ParentNode { var childElementCount: UInt32 { ReadonlyAttribute[Keys.childElementCount, in: jsObject] } func prepend(nodes: __UNSUPPORTED_UNION__...) { - jsObject[Keys.prepend]!(nodes.jsValue()).fromJSValue()! + _ = jsObject[Keys.prepend]!(nodes.jsValue()) } func append(nodes: __UNSUPPORTED_UNION__...) { - jsObject[Keys.append]!(nodes.jsValue()).fromJSValue()! + _ = jsObject[Keys.append]!(nodes.jsValue()) } func replaceChildren(nodes: __UNSUPPORTED_UNION__...) { - jsObject[Keys.replaceChildren]!(nodes.jsValue()).fromJSValue()! + _ = jsObject[Keys.replaceChildren]!(nodes.jsValue()) } func querySelector(selectors: String) -> Element? { diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index 9126406d..465e0947 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -21,6 +21,6 @@ public class Path2D: JSBridgedClass, CanvasPath { } public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { - jsObject[Keys.addPath]!(path.jsValue(), transform?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.addPath]!(path.jsValue(), transform?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/Plugin.swift b/Sources/DOMKit/WebIDL/Plugin.swift index b28958c9..815e76b7 100644 --- a/Sources/DOMKit/WebIDL/Plugin.swift +++ b/Sources/DOMKit/WebIDL/Plugin.swift @@ -37,7 +37,7 @@ public class Plugin: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> MimeType? { + public subscript(key: Int) -> MimeType? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/PluginArray.swift b/Sources/DOMKit/WebIDL/PluginArray.swift index c06a030d..c7047fad 100644 --- a/Sources/DOMKit/WebIDL/PluginArray.swift +++ b/Sources/DOMKit/WebIDL/PluginArray.swift @@ -21,13 +21,13 @@ public class PluginArray: JSBridgedClass { } public func refresh() { - jsObject[Keys.refresh]!().fromJSValue()! + _ = jsObject[Keys.refresh]!() } @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> Plugin? { + public subscript(key: Int) -> Plugin? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift index 7d584fc3..e2d8d4ae 100644 --- a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift +++ b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public enum PredefinedColorSpace: JSString, JSValueCompatible { - case srgb = "srgb" +public enum PredefinedColorSpace: String, JSValueCompatible { + case srgb case displayP3 = "display-p3" public static func construct(from jsValue: JSValue) -> Self? { diff --git a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift index 77d1f884..4bda25e8 100644 --- a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift +++ b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum PremultiplyAlpha: JSString, JSValueCompatible { - case none = "none" - case premultiply = "premultiply" - case `default` = "default" +public enum PremultiplyAlpha: String, JSValueCompatible { + case none + case premultiply + case `default` public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 99829465..36c73f0e 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -47,39 +47,39 @@ public class Range: AbstractRange { public var commonAncestorContainer: Node public func setStart(node: Node, offset: UInt32) { - jsObject[Keys.setStart]!(node.jsValue(), offset.jsValue()).fromJSValue()! + _ = jsObject[Keys.setStart]!(node.jsValue(), offset.jsValue()) } public func setEnd(node: Node, offset: UInt32) { - jsObject[Keys.setEnd]!(node.jsValue(), offset.jsValue()).fromJSValue()! + _ = jsObject[Keys.setEnd]!(node.jsValue(), offset.jsValue()) } public func setStartBefore(node: Node) { - jsObject[Keys.setStartBefore]!(node.jsValue()).fromJSValue()! + _ = jsObject[Keys.setStartBefore]!(node.jsValue()) } public func setStartAfter(node: Node) { - jsObject[Keys.setStartAfter]!(node.jsValue()).fromJSValue()! + _ = jsObject[Keys.setStartAfter]!(node.jsValue()) } public func setEndBefore(node: Node) { - jsObject[Keys.setEndBefore]!(node.jsValue()).fromJSValue()! + _ = jsObject[Keys.setEndBefore]!(node.jsValue()) } public func setEndAfter(node: Node) { - jsObject[Keys.setEndAfter]!(node.jsValue()).fromJSValue()! + _ = jsObject[Keys.setEndAfter]!(node.jsValue()) } public func collapse(toStart: Bool? = nil) { - jsObject[Keys.collapse]!(toStart?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.collapse]!(toStart?.jsValue() ?? .undefined) } public func selectNode(node: Node) { - jsObject[Keys.selectNode]!(node.jsValue()).fromJSValue()! + _ = jsObject[Keys.selectNode]!(node.jsValue()) } public func selectNodeContents(node: Node) { - jsObject[Keys.selectNodeContents]!(node.jsValue()).fromJSValue()! + _ = jsObject[Keys.selectNodeContents]!(node.jsValue()) } public static let START_TO_START: UInt16 = 0 @@ -95,7 +95,7 @@ public class Range: AbstractRange { } public func deleteContents() { - jsObject[Keys.deleteContents]!().fromJSValue()! + _ = jsObject[Keys.deleteContents]!() } public func extractContents() -> DocumentFragment { @@ -107,11 +107,11 @@ public class Range: AbstractRange { } public func insertNode(node: Node) { - jsObject[Keys.insertNode]!(node.jsValue()).fromJSValue()! + _ = jsObject[Keys.insertNode]!(node.jsValue()) } public func surroundContents(newParent: Node) { - jsObject[Keys.surroundContents]!(newParent.jsValue()).fromJSValue()! + _ = jsObject[Keys.surroundContents]!(newParent.jsValue()) } public func cloneRange() -> Self { @@ -119,7 +119,7 @@ public class Range: AbstractRange { } public func detach() { - jsObject[Keys.detach]!().fromJSValue()! + _ = jsObject[Keys.detach]!() } public func isPointInRange(node: Node, offset: UInt32) -> Bool { diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift index 296c3916..b4257dc0 100644 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift @@ -29,14 +29,14 @@ public class ReadableByteStreamController: JSBridgedClass { public var desiredSize: Double? public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } public func enqueue(chunk: ArrayBufferView) { - jsObject[Keys.enqueue]!(chunk.jsValue()).fromJSValue()! + _ = jsObject[Keys.enqueue]!(chunk.jsValue()) } public func error(e: JSValue? = nil) { - jsObject[Keys.error]!(e?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStream.swift b/Sources/DOMKit/WebIDL/ReadableStream.swift index 02166a47..ca78ba61 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -36,7 +36,7 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func cancel(reason: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } public func getReader(options: ReadableStreamGetReaderOptions? = nil) -> ReadableStreamReader { @@ -54,7 +54,7 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) async throws { let _promise: JSPromise = jsObject[Keys.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } public func tee() -> [ReadableStream] { diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift index 2dfbed60..8ec09383 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -32,6 +32,6 @@ public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericRead } public func releaseLock() { - jsObject[Keys.releaseLock]!().fromJSValue()! + _ = jsObject[Keys.releaseLock]!() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift index 7702aa5d..b66e5a85 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift @@ -23,10 +23,10 @@ public class ReadableStreamBYOBRequest: JSBridgedClass { public var view: ArrayBufferView? public func respond(bytesWritten: UInt64) { - jsObject[Keys.respond]!(bytesWritten.jsValue()).fromJSValue()! + _ = jsObject[Keys.respond]!(bytesWritten.jsValue()) } public func respondWithNewView(view: ArrayBufferView) { - jsObject[Keys.respondWithNewView]!(view.jsValue()).fromJSValue()! + _ = jsObject[Keys.respondWithNewView]!(view.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift index 99f20b9c..823b687b 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift @@ -24,14 +24,14 @@ public class ReadableStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } public func enqueue(chunk: JSValue? = nil) { - jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined) } public func error(e: JSValue? = nil) { - jsObject[Keys.error]!(e?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift index c18efe6a..1e557ee5 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -32,6 +32,6 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR } public func releaseLock() { - jsObject[Keys.releaseLock]!().fromJSValue()! + _ = jsObject[Keys.releaseLock]!() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift index cc07521f..b391f377 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift @@ -19,6 +19,6 @@ public extension ReadableStreamGenericReader { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func cancel(reason: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift index 3dcab4d7..2bc4c031 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ReadableStreamReaderMode: JSString, JSValueCompatible { - case byob = "byob" +public enum ReadableStreamReaderMode: String, JSValueCompatible { + case byob public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/ReadableStreamType.swift b/Sources/DOMKit/WebIDL/ReadableStreamType.swift index 2129d7e4..98573e32 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamType.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamType.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ReadableStreamType: JSString, JSValueCompatible { - case bytes = "bytes" +public enum ReadableStreamType: String, JSValueCompatible { + case bytes public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift index d6813f1d..c555f808 100644 --- a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift +++ b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ReferrerPolicy: JSString, JSValueCompatible { +public enum ReferrerPolicy: String, JSValueCompatible { case _empty = "" case noReferrer = "no-referrer" case noReferrerWhenDowngrade = "no-referrer-when-downgrade" case sameOrigin = "same-origin" - case origin = "origin" + case origin case strictOrigin = "strict-origin" case originWhenCrossOrigin = "origin-when-cross-origin" case strictOriginWhenCrossOrigin = "strict-origin-when-cross-origin" diff --git a/Sources/DOMKit/WebIDL/RequestCache.swift b/Sources/DOMKit/WebIDL/RequestCache.swift index 18cf39bc..cb066649 100644 --- a/Sources/DOMKit/WebIDL/RequestCache.swift +++ b/Sources/DOMKit/WebIDL/RequestCache.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestCache: JSString, JSValueCompatible { - case `default` = "default" +public enum RequestCache: String, JSValueCompatible { + case `default` case noStore = "no-store" - case reload = "reload" + case reload case noCache = "no-cache" case forceCache = "force-cache" case onlyIfCached = "only-if-cached" diff --git a/Sources/DOMKit/WebIDL/RequestCredentials.swift b/Sources/DOMKit/WebIDL/RequestCredentials.swift index 013749e0..f6299bdf 100644 --- a/Sources/DOMKit/WebIDL/RequestCredentials.swift +++ b/Sources/DOMKit/WebIDL/RequestCredentials.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestCredentials: JSString, JSValueCompatible { - case omit = "omit" +public enum RequestCredentials: String, JSValueCompatible { + case omit case sameOrigin = "same-origin" - case include = "include" + case include public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/RequestDestination.swift b/Sources/DOMKit/WebIDL/RequestDestination.swift index 55e4c1f1..93d623bd 100644 --- a/Sources/DOMKit/WebIDL/RequestDestination.swift +++ b/Sources/DOMKit/WebIDL/RequestDestination.swift @@ -3,27 +3,27 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestDestination: JSString, JSValueCompatible { +public enum RequestDestination: String, JSValueCompatible { case _empty = "" - case audio = "audio" - case audioworklet = "audioworklet" - case document = "document" - case embed = "embed" - case font = "font" - case frame = "frame" - case iframe = "iframe" - case image = "image" - case manifest = "manifest" - case object = "object" - case paintworklet = "paintworklet" - case report = "report" - case script = "script" - case sharedworker = "sharedworker" - case style = "style" - case track = "track" - case video = "video" - case worker = "worker" - case xslt = "xslt" + case audio + case audioworklet + case document + case embed + case font + case frame + case iframe + case image + case manifest + case object + case paintworklet + case report + case script + case sharedworker + case style + case track + case video + case worker + case xslt public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/RequestMode.swift b/Sources/DOMKit/WebIDL/RequestMode.swift index 96294c76..698055fb 100644 --- a/Sources/DOMKit/WebIDL/RequestMode.swift +++ b/Sources/DOMKit/WebIDL/RequestMode.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestMode: JSString, JSValueCompatible { - case navigate = "navigate" +public enum RequestMode: String, JSValueCompatible { + case navigate case sameOrigin = "same-origin" case noCors = "no-cors" - case cors = "cors" + case cors public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/RequestRedirect.swift b/Sources/DOMKit/WebIDL/RequestRedirect.swift index 67019909..42845b12 100644 --- a/Sources/DOMKit/WebIDL/RequestRedirect.swift +++ b/Sources/DOMKit/WebIDL/RequestRedirect.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestRedirect: JSString, JSValueCompatible { - case follow = "follow" - case error = "error" - case manual = "manual" +public enum RequestRedirect: String, JSValueCompatible { + case follow + case error + case manual public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/ResizeQuality.swift b/Sources/DOMKit/WebIDL/ResizeQuality.swift index c50100dd..b78dd977 100644 --- a/Sources/DOMKit/WebIDL/ResizeQuality.swift +++ b/Sources/DOMKit/WebIDL/ResizeQuality.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ResizeQuality: JSString, JSValueCompatible { - case pixelated = "pixelated" - case low = "low" - case medium = "medium" - case high = "high" +public enum ResizeQuality: String, JSValueCompatible { + case pixelated + case low + case medium + case high public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/ResponseType.swift b/Sources/DOMKit/WebIDL/ResponseType.swift index d62225e9..59676bda 100644 --- a/Sources/DOMKit/WebIDL/ResponseType.swift +++ b/Sources/DOMKit/WebIDL/ResponseType.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ResponseType: JSString, JSValueCompatible { - case basic = "basic" - case cors = "cors" - case `default` = "default" - case error = "error" - case opaque = "opaque" - case opaqueredirect = "opaqueredirect" +public enum ResponseType: String, JSValueCompatible { + case basic + case cors + case `default` + case error + case opaque + case opaqueredirect public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/ScrollRestoration.swift b/Sources/DOMKit/WebIDL/ScrollRestoration.swift index 9e04eb9f..cb1d08a7 100644 --- a/Sources/DOMKit/WebIDL/ScrollRestoration.swift +++ b/Sources/DOMKit/WebIDL/ScrollRestoration.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ScrollRestoration: JSString, JSValueCompatible { - case auto = "auto" - case manual = "manual" +public enum ScrollRestoration: String, JSValueCompatible { + case auto + case manual public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/SelectionMode.swift b/Sources/DOMKit/WebIDL/SelectionMode.swift index 3fee2390..4e6e27fd 100644 --- a/Sources/DOMKit/WebIDL/SelectionMode.swift +++ b/Sources/DOMKit/WebIDL/SelectionMode.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public enum SelectionMode: JSString, JSValueCompatible { - case select = "select" - case start = "start" - case end = "end" - case preserve = "preserve" +public enum SelectionMode: String, JSValueCompatible { + case select + case start + case end + case preserve public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/ShadowRootMode.swift b/Sources/DOMKit/WebIDL/ShadowRootMode.swift index 3beddbf2..36d4b62e 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootMode.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootMode.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ShadowRootMode: JSString, JSValueCompatible { - case open = "open" - case closed = "closed" +public enum ShadowRootMode: String, JSValueCompatible { + case open + case closed public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift index 266e4aa3..04b7b182 100644 --- a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift @@ -22,7 +22,7 @@ public class SharedWorkerGlobalScope: WorkerGlobalScope { public var name: String public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift index 3913b9b1..f2e9a40d 100644 --- a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift +++ b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum SlotAssignmentMode: JSString, JSValueCompatible { - case manual = "manual" - case named = "named" +public enum SlotAssignmentMode: String, JSValueCompatible { + case manual + case named public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/Storage.swift b/Sources/DOMKit/WebIDL/Storage.swift index 6d24072c..515db6f3 100644 --- a/Sources/DOMKit/WebIDL/Storage.swift +++ b/Sources/DOMKit/WebIDL/Storage.swift @@ -33,11 +33,11 @@ public class Storage: JSBridgedClass { jsObject[key].fromJSValue() } - // XXX: unsupported setter for keys of type `String` + // XXX: unsupported setter for keys of type String - // XXX: unsupported deleter for keys of type `String` + // XXX: unsupported deleter for keys of type String public func clear() { - jsObject[Keys.clear]!().fromJSValue()! + _ = jsObject[Keys.clear]!() } } diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift index 8ecc538f..ffe55c9b 100644 --- a/Sources/DOMKit/WebIDL/StorageEvent.swift +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -52,6 +52,6 @@ public class StorageEvent: Event { let _arg5 = newValue?.jsValue() ?? .undefined let _arg6 = url?.jsValue() ?? .undefined let _arg7 = storageArea?.jsValue() ?? .undefined - return jsObject[Keys.initStorageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7).fromJSValue()! + _ = jsObject[Keys.initStorageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/StyleSheetList.swift b/Sources/DOMKit/WebIDL/StyleSheetList.swift index 4c45a678..41acf789 100644 --- a/Sources/DOMKit/WebIDL/StyleSheetList.swift +++ b/Sources/DOMKit/WebIDL/StyleSheetList.swift @@ -18,7 +18,7 @@ public class StyleSheetList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: UInt32) -> CSSStyleSheet? { + public subscript(key: Int) -> CSSStyleSheet? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index d1bbbb7b..6a84a996 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -58,11 +58,11 @@ public class TextTrack: EventTarget { public var activeCues: TextTrackCueList? public func addCue(cue: TextTrackCue) { - jsObject[Keys.addCue]!(cue.jsValue()).fromJSValue()! + _ = jsObject[Keys.addCue]!(cue.jsValue()) } public func removeCue(cue: TextTrackCue) { - jsObject[Keys.removeCue]!(cue.jsValue()).fromJSValue()! + _ = jsObject[Keys.removeCue]!(cue.jsValue()) } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/TextTrackCueList.swift b/Sources/DOMKit/WebIDL/TextTrackCueList.swift index 6d448faf..122b45af 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCueList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCueList.swift @@ -21,7 +21,7 @@ public class TextTrackCueList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> TextTrackCue { + public subscript(key: Int) -> TextTrackCue { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TextTrackKind.swift b/Sources/DOMKit/WebIDL/TextTrackKind.swift index 6794a701..6bf2237a 100644 --- a/Sources/DOMKit/WebIDL/TextTrackKind.swift +++ b/Sources/DOMKit/WebIDL/TextTrackKind.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public enum TextTrackKind: JSString, JSValueCompatible { - case subtitles = "subtitles" - case captions = "captions" - case descriptions = "descriptions" - case chapters = "chapters" - case metadata = "metadata" +public enum TextTrackKind: String, JSValueCompatible { + case subtitles + case captions + case descriptions + case chapters + case metadata public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift index 2137a2fa..ad8bc807 100644 --- a/Sources/DOMKit/WebIDL/TextTrackList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -25,7 +25,7 @@ public class TextTrackList: EventTarget { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> TextTrack { + public subscript(key: Int) -> TextTrack { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TextTrackMode.swift b/Sources/DOMKit/WebIDL/TextTrackMode.swift index 4bd17465..e286f6c1 100644 --- a/Sources/DOMKit/WebIDL/TextTrackMode.swift +++ b/Sources/DOMKit/WebIDL/TextTrackMode.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum TextTrackMode: JSString, JSValueCompatible { - case disabled = "disabled" - case hidden = "hidden" - case showing = "showing" +public enum TextTrackMode: String, JSValueCompatible { + case disabled + case hidden + case showing public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift index d47b8341..ef93cd2d 100644 --- a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift @@ -24,14 +24,14 @@ public class TransformStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func enqueue(chunk: JSValue? = nil) { - jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined) } public func error(reason: JSValue? = nil) { - jsObject[Keys.error]!(reason?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.error]!(reason?.jsValue() ?? .undefined) } public func terminate() { - jsObject[Keys.terminate]!().fromJSValue()! + _ = jsObject[Keys.terminate]!() } } diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index a67371c7..b14816d1 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -31,7 +31,7 @@ public class UIEvent: Event { public var detail: Int32 public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil) { - jsObject[Keys.initUIEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.initUIEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index 72ae93d7..923a9cfd 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -22,6 +22,6 @@ public class URL: JSBridgedClass { } public static func revokeObjectURL(url: String) { - constructor[Keys.revokeObjectURL]!(url.jsValue()).fromJSValue()! + _ = constructor[Keys.revokeObjectURL]!(url.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift index 28db9735..41bd3a0b 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackList.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -27,7 +27,7 @@ public class VideoTrackList: EventTarget { @ReadonlyAttribute public var length: UInt32 - public subscript(key: UInt32) -> VideoTrack { + public subscript(key: Int) -> VideoTrack { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 19f17640..21c78edc 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -124,22 +124,22 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var status: String public func close() { - jsObject[Keys.close]!().fromJSValue()! + _ = jsObject[Keys.close]!() } @ReadonlyAttribute public var closed: Bool public func stop() { - jsObject[Keys.stop]!().fromJSValue()! + _ = jsObject[Keys.stop]!() } public func focus() { - jsObject[Keys.focus]!().fromJSValue()! + _ = jsObject[Keys.focus]!() } public func blur() { - jsObject[Keys.blur]!().fromJSValue()! + _ = jsObject[Keys.blur]!() } @ReadonlyAttribute @@ -178,11 +178,11 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var originAgentCluster: Bool public func alert() { - jsObject[Keys.alert]!().fromJSValue()! + _ = jsObject[Keys.alert]!() } public func alert(message: String) { - jsObject[Keys.alert]!(message.jsValue()).fromJSValue()! + _ = jsObject[Keys.alert]!(message.jsValue()) } public func confirm(message: String? = nil) -> Bool { @@ -194,23 +194,23 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind } public func print() { - jsObject[Keys.print]!().fromJSValue()! + _ = jsObject[Keys.print]!() } public func postMessage(message: JSValue, targetOrigin: String, transfer: [JSObject]? = nil) { - jsObject[Keys.postMessage]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.postMessage]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined) } public func postMessage(message: JSValue, options: WindowPostMessageOptions? = nil) { - jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } public func captureEvents() { - jsObject[Keys.captureEvents]!().fromJSValue()! + _ = jsObject[Keys.captureEvents]!() } public func releaseEvents() { - jsObject[Keys.releaseEvents]!().fromJSValue()! + _ = jsObject[Keys.releaseEvents]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index 3c661290..774311ed 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -32,7 +32,7 @@ public extension WindowOrWorkerGlobalScope { var crossOriginIsolated: Bool { ReadonlyAttribute[Keys.crossOriginIsolated, in: jsObject] } func reportError(e: JSValue) { - jsObject[Keys.reportError]!(e.jsValue()).fromJSValue()! + _ = jsObject[Keys.reportError]!(e.jsValue()) } func btoa(data: String) -> String { @@ -48,7 +48,7 @@ public extension WindowOrWorkerGlobalScope { } func clearTimeout(id: Int32? = nil) { - jsObject[Keys.clearTimeout]!(id?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.clearTimeout]!(id?.jsValue() ?? .undefined) } func setInterval(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { @@ -56,12 +56,10 @@ public extension WindowOrWorkerGlobalScope { } func clearInterval(id: Int32? = nil) { - jsObject[Keys.clearInterval]!(id?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.clearInterval]!(id?.jsValue() ?? .undefined) } - func queueMicrotask(callback: VoidFunction) { - jsObject[Keys.queueMicrotask]!(callback.jsValue()).fromJSValue()! - } + // XXX: method 'queueMicrotask' is ignored func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) -> JSPromise { jsObject[Keys.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index 92f1b4cf..2aa5486d 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -24,15 +24,15 @@ public class Worker: EventTarget, AbstractWorker { } public func terminate() { - jsObject[Keys.terminate]!().fromJSValue()! + _ = jsObject[Keys.terminate]!() } public func postMessage(message: JSValue, transfer: [JSObject]) { - jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()).fromJSValue()! + _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index 4c25d576..8828bbff 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -42,7 +42,7 @@ public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope { public var navigator: WorkerNavigator public func importScripts(urls: String...) { - jsObject[Keys.importScripts]!(urls.jsValue()).fromJSValue()! + _ = jsObject[Keys.importScripts]!(urls.jsValue()) } @ClosureAttribute.Optional5 diff --git a/Sources/DOMKit/WebIDL/WorkerType.swift b/Sources/DOMKit/WebIDL/WorkerType.swift index 8e1f37ec..c5c38611 100644 --- a/Sources/DOMKit/WebIDL/WorkerType.swift +++ b/Sources/DOMKit/WebIDL/WorkerType.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum WorkerType: JSString, JSValueCompatible { - case classic = "classic" - case module = "module" +public enum WorkerType: String, JSValueCompatible { + case classic + case module public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/Worklet.swift b/Sources/DOMKit/WebIDL/Worklet.swift index c92ed9f9..abc59f91 100644 --- a/Sources/DOMKit/WebIDL/Worklet.swift +++ b/Sources/DOMKit/WebIDL/Worklet.swift @@ -23,6 +23,6 @@ public class Worklet: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func addModule(moduleURL: String, options: WorkletOptions? = nil) async throws { let _promise: JSPromise = jsObject[Keys.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift index d42fe4c3..0105bd89 100644 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -34,7 +34,7 @@ public class WritableStream: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort(reason: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } public func close() -> JSPromise { @@ -44,7 +44,7 @@ public class WritableStream: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func close() async throws { let _promise: JSPromise = jsObject[Keys.close]!().fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } public func getWriter() -> WritableStreamDefaultWriter { diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift index b467bf7e..8280410c 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift @@ -22,6 +22,6 @@ public class WritableStreamDefaultController: JSBridgedClass { public var signal: AbortSignal public func error(e: JSValue? = nil) { - jsObject[Keys.error]!(e?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift index 489ffd2e..a6b7e7f3 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -45,7 +45,7 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort(reason: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } public func close() -> JSPromise { @@ -55,11 +55,11 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func close() async throws { let _promise: JSPromise = jsObject[Keys.close]!().fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } public func releaseLock() { - jsObject[Keys.releaseLock]!().fromJSValue()! + _ = jsObject[Keys.releaseLock]!() } public func write(chunk: JSValue? = nil) -> JSPromise { @@ -69,6 +69,6 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func write(chunk: JSValue? = nil) async throws { let _promise: JSPromise = jsObject[Keys.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! + _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index d9a9da2e..eea36f96 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -70,15 +70,15 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var readyState: UInt16 public func open(method: String, url: String) { - jsObject[Keys.open]!(method.jsValue(), url.jsValue()).fromJSValue()! + _ = jsObject[Keys.open]!(method.jsValue(), url.jsValue()) } public func open(method: String, url: String, async: Bool, username: String? = nil, password: String? = nil) { - jsObject[Keys.open]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.open]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined) } public func setRequestHeader(name: String, value: String) { - jsObject[Keys.setRequestHeader]!(name.jsValue(), value.jsValue()).fromJSValue()! + _ = jsObject[Keys.setRequestHeader]!(name.jsValue(), value.jsValue()) } @ReadWriteAttribute @@ -91,11 +91,11 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var upload: XMLHttpRequestUpload public func send(body: __UNSUPPORTED_UNION__? = nil) { - jsObject[Keys.send]!(body?.jsValue() ?? .undefined).fromJSValue()! + _ = jsObject[Keys.send]!(body?.jsValue() ?? .undefined) } public func abort() { - jsObject[Keys.abort]!().fromJSValue()! + _ = jsObject[Keys.abort]!() } @ReadonlyAttribute @@ -116,7 +116,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { } public func overrideMimeType(mime: String) { - jsObject[Keys.overrideMimeType]!(mime.jsValue()).fromJSValue()! + _ = jsObject[Keys.overrideMimeType]!(mime.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift index 7e5dc5a1..6a3e5269 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public enum XMLHttpRequestResponseType: JSString, JSValueCompatible { +public enum XMLHttpRequestResponseType: String, JSValueCompatible { case _empty = "" - case arraybuffer = "arraybuffer" - case blob = "blob" - case document = "document" - case json = "json" - case text = "text" + case arraybuffer + case blob + case document + case json + case text public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift index cea3644c..86a4493b 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift @@ -11,15 +11,9 @@ private enum Keys { public protocol XPathEvaluatorBase: JSBridgedClass {} public extension XPathEvaluatorBase { - func createExpression(expression: String, resolver: XPathNSResolver? = nil) -> XPathExpression { - jsObject[Keys.createExpression]!(expression.jsValue(), resolver?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: method 'createExpression' is ignored - func createNSResolver(nodeResolver: Node) -> XPathNSResolver { - jsObject[Keys.createNSResolver]!(nodeResolver.jsValue()).fromJSValue()! - } + // XXX: method 'createNSResolver' is ignored - func evaluate(expression: String, contextNode: Node, resolver: XPathNSResolver? = nil, type: UInt16? = nil, result: XPathResult? = nil) -> XPathResult { - jsObject[Keys.evaluate]!(expression.jsValue(), contextNode.jsValue(), resolver?.jsValue() ?? .undefined, type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: method 'evaluate' is ignored } diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift index 7c1ad010..106132de 100644 --- a/Sources/DOMKit/WebIDL/XSLTProcessor.swift +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -28,7 +28,7 @@ public class XSLTProcessor: JSBridgedClass { } public func importStylesheet(style: Node) { - jsObject[Keys.importStylesheet]!(style.jsValue()).fromJSValue()! + _ = jsObject[Keys.importStylesheet]!(style.jsValue()) } public func transformToFragment(source: Node, output: Document) -> DocumentFragment { @@ -40,7 +40,7 @@ public class XSLTProcessor: JSBridgedClass { } public func setParameter(namespaceURI: String, localName: String, value: JSValue) { - jsObject[Keys.setParameter]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()).fromJSValue()! + _ = jsObject[Keys.setParameter]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()) } public func getParameter(namespaceURI: String, localName: String) -> JSValue { @@ -48,14 +48,14 @@ public class XSLTProcessor: JSBridgedClass { } public func removeParameter(namespaceURI: String, localName: String) { - jsObject[Keys.removeParameter]!(namespaceURI.jsValue(), localName.jsValue()).fromJSValue()! + _ = jsObject[Keys.removeParameter]!(namespaceURI.jsValue(), localName.jsValue()) } public func clearParameters() { - jsObject[Keys.clearParameters]!().fromJSValue()! + _ = jsObject[Keys.clearParameters]!() } public func reset() { - jsObject[Keys.reset]!().fromJSValue()! + _ = jsObject[Keys.reset]!() } } diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index 7112d16f..d6585175 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -31,78 +31,78 @@ public enum console { } public static func assert(condition: Bool? = nil, data: JSValue...) { - JSObject.global.console.object![Keys.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) } public static func clear() { - JSObject.global.console.object![Keys.clear]!().fromJSValue()! + _ = JSObject.global.console.object![Keys.clear]!() } public static func debug(data: JSValue...) { - JSObject.global.console.object![Keys.debug]!(data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.debug]!(data.jsValue()) } public static func error(data: JSValue...) { - JSObject.global.console.object![Keys.error]!(data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.error]!(data.jsValue()) } public static func info(data: JSValue...) { - JSObject.global.console.object![Keys.info]!(data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.info]!(data.jsValue()) } public static func log(data: JSValue...) { - JSObject.global.console.object![Keys.log]!(data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.log]!(data.jsValue()) } public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { - JSObject.global.console.object![Keys.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined).fromJSValue()! + _ = JSObject.global.console.object![Keys.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) } public static func trace(data: JSValue...) { - JSObject.global.console.object![Keys.trace]!(data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.trace]!(data.jsValue()) } public static func warn(data: JSValue...) { - JSObject.global.console.object![Keys.warn]!(data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.warn]!(data.jsValue()) } public static func dir(item: JSValue? = nil, options: JSObject? = nil) { - JSObject.global.console.object![Keys.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + _ = JSObject.global.console.object![Keys.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) } public static func dirxml(data: JSValue...) { - JSObject.global.console.object![Keys.dirxml]!(data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.dirxml]!(data.jsValue()) } public static func count(label: String? = nil) { - JSObject.global.console.object![Keys.count]!(label?.jsValue() ?? .undefined).fromJSValue()! + _ = JSObject.global.console.object![Keys.count]!(label?.jsValue() ?? .undefined) } public static func countReset(label: String? = nil) { - JSObject.global.console.object![Keys.countReset]!(label?.jsValue() ?? .undefined).fromJSValue()! + _ = JSObject.global.console.object![Keys.countReset]!(label?.jsValue() ?? .undefined) } public static func group(data: JSValue...) { - JSObject.global.console.object![Keys.group]!(data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.group]!(data.jsValue()) } public static func groupCollapsed(data: JSValue...) { - JSObject.global.console.object![Keys.groupCollapsed]!(data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.groupCollapsed]!(data.jsValue()) } public static func groupEnd() { - JSObject.global.console.object![Keys.groupEnd]!().fromJSValue()! + _ = JSObject.global.console.object![Keys.groupEnd]!() } public static func time(label: String? = nil) { - JSObject.global.console.object![Keys.time]!(label?.jsValue() ?? .undefined).fromJSValue()! + _ = JSObject.global.console.object![Keys.time]!(label?.jsValue() ?? .undefined) } public static func timeLog(label: String? = nil, data: JSValue...) { - JSObject.global.console.object![Keys.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()).fromJSValue()! + _ = JSObject.global.console.object![Keys.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) } public static func timeEnd(label: String? = nil) { - JSObject.global.console.object![Keys.timeEnd]!(label?.jsValue() ?? .undefined).fromJSValue()! + _ = JSObject.global.console.object![Keys.timeEnd]!(label?.jsValue() ?? .undefined) } } diff --git a/Sources/WebIDLToSwift/ClosureWrappers.swift b/Sources/WebIDLToSwift/ClosureWrappers.swift index 88105db5..2188f127 100644 --- a/Sources/WebIDLToSwift/ClosureWrappers.swift +++ b/Sources/WebIDLToSwift/ClosureWrappers.swift @@ -4,13 +4,13 @@ struct ClosureWrapper: SwiftRepresentable, Equatable { var name: SwiftSource { if nullable { - return "Optional\(raw: String(argCount))" + return "Optional\(String(argCount))" } else { - return "Required\(raw: String(argCount))" + return "Required\(String(argCount))" } } - var indexes: [SwiftSource] { (0 ..< argCount).map(String.init).map(SwiftSource.raw) } + var indexes: [String] { (0 ..< argCount).map(String.init) } private var typeNames: [SwiftSource] { indexes.map { "A\($0)" } + ["ReturnType"] diff --git a/Sources/WebIDLToSwift/SwiftRepresentation.swift b/Sources/WebIDLToSwift/SwiftRepresentation.swift index b26372f0..8bc01594 100644 --- a/Sources/WebIDLToSwift/SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/SwiftRepresentation.swift @@ -12,3 +12,26 @@ func toSwift(_ value: T) -> SwiftSource { fatalError("Type \(String(describing: type(of: x))) has no Swift representation") } } + +extension String: SwiftRepresentable { + private static let swiftKeywords: Set = [ + "init", + "where", + "protocol", + "struct", + "class", + "enum", + "func", + "static", + "is", + "as", + "default", + "defer", + "self", + "repeat", + ] + + var swiftRepresentation: SwiftSource { + SwiftSource(Self.swiftKeywords.contains(self) ? "`\(self)`" : self) + } +} diff --git a/Sources/WebIDLToSwift/SwiftSource.swift b/Sources/WebIDLToSwift/SwiftSource.swift index 86eddde9..5237ee61 100644 --- a/Sources/WebIDLToSwift/SwiftSource.swift +++ b/Sources/WebIDLToSwift/SwiftSource.swift @@ -46,11 +46,8 @@ struct SwiftSource: CustomStringConvertible, ExpressibleByStringInterpolation, E output += source.source } - mutating func appendInterpolation(name: String) { - output += "`\(name)`" - } - - mutating func appendInterpolation(_ value: T) where T: SwiftRepresentable { + @_disfavoredOverload + mutating func appendInterpolation(_ value: T) { output += toSwift(value).source } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 6697c6fa..d9968424 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -5,12 +5,12 @@ extension IDLArgument: SwiftRepresentable { let type: SwiftSource = variadic ? "\(idlType)..." : "\(idlType)" if optional { if idlType.nullable { - return "\(name: name): \(type) = nil" + return "\(name): \(type) = nil" } else { - return "\(name: name): \(type)? = nil" + return "\(name): \(type)? = nil" } } else { - return "\(name: name): \(type)" + return "\(name): \(type)" } } } @@ -26,7 +26,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { // can't do property wrappers on override declarations return """ private var \(wrapperName): \(idlType.propertyWrapper(readonly: readonly))<\(idlType)> - override public var \(name: name): \(idlType) { + override public var \(name): \(idlType) { get { \(wrapperName).wrappedValue } \(readonly ? "" : "set { \(wrapperName).wrappedValue = newValue }") } @@ -34,19 +34,19 @@ extension IDLAttribute: SwiftRepresentable, Initializable { } else if Context.constructor == nil { // can't do property wrappers on extensions let setter: SwiftSource = """ - set { \(idlType.propertyWrapper(readonly: readonly))[Keys.\(name: name), in: jsObject] = newValue } + set { \(idlType.propertyWrapper(readonly: readonly))[Keys.\(name), in: jsObject] = newValue } """ return """ - public var \(name: name): \(idlType) { - get { \(idlType.propertyWrapper(readonly: readonly))[Keys.\(name: name), in: jsObject] } + public var \(name): \(idlType) { + get { \(idlType.propertyWrapper(readonly: readonly))[Keys.\(name), in: jsObject] } \(readonly ? "" : setter) } """ } else { return """ @\(idlType.propertyWrapper(readonly: readonly)) - public var \(name: name): \(idlType) + public var \(name): \(idlType) """ } } @@ -54,7 +54,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { var initializer: SwiftSource? { assert(!Context.static) return """ - \(wrapperName) = \(idlType.propertyWrapper(readonly: readonly))(jsObject: jsObject, name: Keys.\(name: name)) + \(wrapperName) = \(idlType.propertyWrapper(readonly: readonly))(jsObject: jsObject, name: Keys.\(name)) """ } } @@ -63,7 +63,7 @@ private func printKeys(_ keys: [IDLNamed]) -> SwiftSource { let validKeys = Set(keys.map(\.name).filter { !$0.isEmpty }) return """ private enum Keys { - \(lines: validKeys.sorted().map { "static let \(name: $0): JSString = \(quoted: $0)" }) + \(lines: validKeys.sorted().map { "static let \($0): JSString = \(quoted: $0)" }) } """ } @@ -71,7 +71,7 @@ private func printKeys(_ keys: [IDLNamed]) -> SwiftSource { extension MergedDictionary: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public class \(name: name): BridgedDictionary { + public class \(name): BridgedDictionary { \(printKeys(members)) \(swiftInit) \(swiftMembers.joined(separator: "\n\n")) @@ -87,7 +87,7 @@ extension MergedDictionary: SwiftRepresentable { private var swiftInit: SwiftSource { let params: [SwiftSource] = members.map { - "\(name: $0.name): \($0.idlType.isFunction ? "@escaping " : "")\($0.idlType)" + "\($0.name): \($0.idlType.isFunction ? "@escaping " : "")\($0.idlType)" } return """ public convenience init(\(sequence: params)) { @@ -95,11 +95,11 @@ extension MergedDictionary: SwiftRepresentable { \(lines: membersWithPropertyWrapper.map { member, wrapper in if member.idlType.isFunction { return """ - \(wrapper)[Keys.\(name: member.name), in: object] = \(name: member.name) + \(wrapper)[Keys.\(member.name), in: object] = \(member.name) """ } else { return """ - object[Keys.\(name: member.name)] = \(name: member.name).jsValue() + object[Keys.\(member.name)] = \(member.name).jsValue() """ } }) @@ -108,7 +108,7 @@ extension MergedDictionary: SwiftRepresentable { public required init(unsafelyWrapping object: JSObject) { \(lines: membersWithPropertyWrapper.map { member, wrapper in - "_\(raw: member.name) = \(wrapper)(jsObject: object, name: Keys.\(name: member.name))" + "_\(raw: member.name) = \(wrapper)(jsObject: object, name: Keys.\(member.name))" }) super.init(unsafelyWrapping: object) } @@ -119,7 +119,7 @@ extension MergedDictionary: SwiftRepresentable { membersWithPropertyWrapper.map { member, wrapper in """ @\(wrapper) - public var \(name: member.name): \(member.idlType) + public var \(member.name): \(member.idlType) """ } } @@ -128,8 +128,8 @@ extension MergedDictionary: SwiftRepresentable { extension IDLEnum: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public enum \(name: name): JSString, JSValueCompatible { - \(lines: cases.map { "case \(name: $0.camelized) = \(quoted: $0)" }) + public enum \(name): String, JSValueCompatible { + \(lines: cases.map { "case \($0.camelized) = \(quoted: $0)" }) public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -152,7 +152,7 @@ extension IDLCallback: SwiftRepresentable { var swiftRepresentation: SwiftSource { Context.requiredClosureArgCounts.insert(arguments.count) return """ - public typealias \(name: name) = (\(sequence: arguments.map { + public typealias \(name) = (\(sequence: arguments.map { "\($0.idlType)\($0.variadic ? "..." : "")" })) -> \(idlType) """ @@ -161,7 +161,7 @@ extension IDLCallback: SwiftRepresentable { extension IDLCallbackInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { - "// XXX: unsupported callback interface: \(raw: name)" + "// XXX: unsupported callback interface: \(name)" } } @@ -171,13 +171,13 @@ protocol Initializable { extension MergedInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let constructor: SwiftSource = "JSObject.global.\(name: name).function!" - let body = Context.withState(.instance(constructor: constructor, this: "jsObject", className: "\(name: name)")) { + let constructor: SwiftSource = "JSObject.global.\(name).function!" + let body = Context.withState(.instance(constructor: constructor, this: "jsObject", className: "\(name)")) { members.map { member in let isOverride: Bool if let memberName = (member as? IDLNamed)?.name { if Context.ignored[name]?.contains(memberName) ?? false { - return "// XXX: member '\(raw: memberName)' is ignored" + return "// XXX: member '\(memberName)' is ignored" } isOverride = parentClasses.flatMap { Context.interfaces[$0]?.members ?? [] @@ -194,11 +194,8 @@ extension MergedInterface: SwiftRepresentable { } let inheritance = (parentClasses.isEmpty ? ["JSBridgedClass"] : parentClasses) + mixins - let initialize: SwiftSource = parentClasses.isEmpty - ? "self.jsObject = jsObject" - : "super.init(unsafelyWrapping: jsObject)" return """ - public class \(name: name): \(sequence: inheritance.map(SwiftSource.init(_:))) { + public class \(name): \(sequence: inheritance.map(SwiftSource.init(_:))) { public\(parentClasses.isEmpty ? "" : " override") class var constructor: JSFunction { \(constructor) } \(printKeys(members.compactMap { $0 as? IDLNamed })) @@ -207,7 +204,7 @@ extension MergedInterface: SwiftRepresentable { public required init(unsafelyWrapping jsObject: JSObject) { \(memberInits.joined(separator: "\n")) - \(initialize) + \(parentClasses.isEmpty ? "self.jsObject = jsObject" : "super.init(unsafelyWrapping: jsObject)") } \(body) @@ -236,12 +233,12 @@ extension MergedInterface: SwiftRepresentable { extension MergedMixin: SwiftRepresentable { var swiftRepresentation: SwiftSource { - Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name: name)")) { + Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name)")) { """ \(printKeys(members)) - public protocol \(name: name): JSBridgedClass {} - public extension \(name: name) { + public protocol \(name): JSBridgedClass {} + public extension \(name) { \(members.map(toSwift).joined(separator: "\n\n")) } """ @@ -252,7 +249,7 @@ extension MergedMixin: SwiftRepresentable { extension IDLConstant: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { """ - public static let \(name: name): \(idlType) = \(value) + public static let \(name): \(idlType) = \(value) """ } @@ -266,7 +263,7 @@ extension IDLConstructor: SwiftRepresentable, Initializable { return "// XXX: constructor is ignored" } let args: [SwiftSource] = arguments.map { - "\(name: $0.name)\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" + "\($0.name)\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" } return """ public convenience init(\(sequence: arguments.map(\.swiftRepresentation))) { @@ -303,12 +300,12 @@ extension IDLIterableDeclaration: SwiftRepresentable, Initializable { extension MergedNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let this: SwiftSource = "JSObject.global.\(name: name).object!" - let body = Context.withState(.static(this: this, inClass: false, className: "\(name: name)")) { + let this: SwiftSource = "JSObject.global.\(name).object!" + let body = Context.withState(.static(this: this, inClass: false, className: "\(name)")) { members.map(toSwift).joined(separator: "\n\n") } return """ - public enum \(name: name) { + public enum \(name) { \(printKeys(members.compactMap { $0 as? IDLNamed })) public static var jsObject: JSObject { \(this) @@ -324,7 +321,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { if Context.ignored[Context.className.source]?.contains(name) ?? false { return """ - // XXX: method '\(raw: name)' is ignored + // XXX: method '\(name)' is ignored """ } if special.isEmpty { @@ -368,26 +365,26 @@ extension IDLOperation: SwiftRepresentable, Initializable { if arguments.count <= 5 { args = arguments.map { arg in if arg.optional { - return "\(name: arg.name)?.jsValue() ?? .undefined" + return "\(arg.name)?.jsValue() ?? .undefined" } else { - return "\(name: arg.name).jsValue()" + return "\(arg.name).jsValue()" } } prep = [] } else { - args = (0 ..< arguments.count).map { "_arg\(raw: String($0))" } - prep = zip(arguments, args).map { arg, name in + args = (0 ..< arguments.count).map { "_arg\(String($0))" } + prep = arguments.enumerated().map { i, arg in if arg.optional { - return "let \(name) = \(name: arg.name)?.jsValue() ?? .undefined" + return "let _arg\(String(i)) = \(arg.name)?.jsValue() ?? .undefined" } else { - return "let \(name) = \(name: arg.name).jsValue()" + return "let _arg\(String(i)) = \(arg.name).jsValue()" } } } return ( prep: "\(lines: prep)", - call: "\(Context.this)[Keys.\(name: name)]!(\(sequence: args))" + call: "\(Context.this)[Keys.\(name)]!(\(sequence: args))" ) } @@ -395,7 +392,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { let accessModifier: SwiftSource = Context.static ? (Context.inClass ? " class" : " static") : "" let overrideModifier: SwiftSource = Context.override ? "override " : "" return """ - \(overrideModifier)public\(accessModifier) func \(name: name)(\(sequence: arguments.map(\.swiftRepresentation))) + \(overrideModifier)public\(accessModifier) func \(name)(\(sequence: arguments.map(\.swiftRepresentation))) """ } @@ -512,12 +509,12 @@ extension IDLType: SwiftRepresentable { } case let .single(name): if let typeName = Self.typeNameMap[name] { - return "\(name: typeName)" + return "\(typeName)" } else { if name == name.lowercased() { fatalError("Unsupported type: \(name)") } - return "\(name: name)" + return "\(name)" } case let .union(types): // print("union", types.count) @@ -547,14 +544,14 @@ extension IDLType: SwiftRepresentable { if case let .single(name) = value { let readonlyComment: SwiftSource = readonly ? " /* XXX: should be readonly! */ " : "" if let callback = Context.types[name] as? IDLCallback { - return "ClosureAttribute.Required\(raw: String(callback.arguments.count))\(readonlyComment)" + return "ClosureAttribute.Required\(String(callback.arguments.count))\(readonlyComment)" } if let ref = Context.types[name] as? IDLTypedef, case let .single(name) = ref.idlType.value, let callback = Context.types[name] as? IDLCallback { assert(ref.idlType.nullable) - return "ClosureAttribute.Optional\(raw: String(callback.arguments.count))\(readonlyComment)" + return "ClosureAttribute.Optional\(String(callback.arguments.count))\(readonlyComment)" } } @@ -568,7 +565,7 @@ extension IDLType: SwiftRepresentable { extension IDLTypedef: SwiftRepresentable { var swiftRepresentation: SwiftSource { - "public typealias \(name: name) = \(idlType)" + "public typealias \(name) = \(idlType)" } } @@ -580,7 +577,7 @@ extension IDLValue: SwiftRepresentable { case let .number(value): return .raw(value) case let .boolean(value): - return .raw(String(value)) + return "\(value)" case .null: fatalError("`null` is not supported as a value in Swift") case let .infinity(negative): From 3d778bffd152e7650904cf0480869db3cf34d1ce Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 08:40:20 -0400 Subject: [PATCH 087/124] Fix most errors --- Sources/DOMKit/WebIDL/CanPlayTypeResult.swift | 10 ++--- Sources/DOMKit/WebIDL/CanvasDirection.swift | 12 ++--- Sources/DOMKit/WebIDL/CanvasFillRule.swift | 10 ++--- Sources/DOMKit/WebIDL/CanvasFontKerning.swift | 12 ++--- Sources/DOMKit/WebIDL/CanvasFontStretch.swift | 12 ++--- .../DOMKit/WebIDL/CanvasFontVariantCaps.swift | 10 ++--- Sources/DOMKit/WebIDL/CanvasLineCap.swift | 12 ++--- Sources/DOMKit/WebIDL/CanvasLineJoin.swift | 12 ++--- Sources/DOMKit/WebIDL/CanvasTextAlign.swift | 16 +++---- .../DOMKit/WebIDL/CanvasTextBaseline.swift | 18 ++++---- .../DOMKit/WebIDL/CanvasTextRendering.swift | 14 +++--- .../DOMKit/WebIDL/ColorSpaceConversion.swift | 10 ++--- .../WebIDL/DOMParserSupportedType.swift | 6 +-- .../DOMKit/WebIDL/DocumentReadyState.swift | 12 ++--- .../WebIDL/DocumentVisibilityState.swift | 10 ++--- Sources/DOMKit/WebIDL/EndingType.swift | 10 ++--- Sources/DOMKit/WebIDL/ImageOrientation.swift | 10 ++--- .../DOMKit/WebIDL/ImageSmoothingQuality.swift | 12 ++--- .../WebIDL/OffscreenRenderingContextId.swift | 14 +++--- .../DOMKit/WebIDL/PredefinedColorSpace.swift | 8 ++-- Sources/DOMKit/WebIDL/PremultiplyAlpha.swift | 12 ++--- .../WebIDL/ReadableStreamReaderMode.swift | 8 ++-- .../DOMKit/WebIDL/ReadableStreamType.swift | 8 ++-- Sources/DOMKit/WebIDL/ReferrerPolicy.swift | 8 ++-- Sources/DOMKit/WebIDL/RequestCache.swift | 10 ++--- .../DOMKit/WebIDL/RequestCredentials.swift | 10 ++--- .../DOMKit/WebIDL/RequestDestination.swift | 44 +++++++++---------- Sources/DOMKit/WebIDL/RequestMode.swift | 10 ++--- Sources/DOMKit/WebIDL/RequestRedirect.swift | 12 ++--- Sources/DOMKit/WebIDL/ResizeQuality.swift | 14 +++--- Sources/DOMKit/WebIDL/ResponseType.swift | 18 ++++---- Sources/DOMKit/WebIDL/ScrollRestoration.swift | 10 ++--- Sources/DOMKit/WebIDL/SelectionMode.swift | 14 +++--- Sources/DOMKit/WebIDL/ShadowRootMode.swift | 10 ++--- .../DOMKit/WebIDL/SlotAssignmentMode.swift | 10 ++--- Sources/DOMKit/WebIDL/TextTrackKind.swift | 16 +++---- Sources/DOMKit/WebIDL/TextTrackMode.swift | 12 ++--- Sources/DOMKit/WebIDL/WorkerType.swift | 10 ++--- .../WebIDL/XMLHttpRequestResponseType.swift | 16 +++---- .../WebIDL+SwiftRepresentation.swift | 6 +-- 40 files changed, 244 insertions(+), 244 deletions(-) diff --git a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift index e0736c2a..3b4868b3 100644 --- a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift +++ b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanPlayTypeResult: String, JSValueCompatible { +public enum CanPlayTypeResult: JSString, JSValueCompatible { case _empty = "" - case maybe - case probably + case maybe = "maybe" + case probably = "probably" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum CanPlayTypeResult: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasDirection.swift b/Sources/DOMKit/WebIDL/CanvasDirection.swift index 790c1f34..183c4fa1 100644 --- a/Sources/DOMKit/WebIDL/CanvasDirection.swift +++ b/Sources/DOMKit/WebIDL/CanvasDirection.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasDirection: String, JSValueCompatible { - case ltr - case rtl - case inherit +public enum CanvasDirection: JSString, JSValueCompatible { + case ltr = "ltr" + case rtl = "rtl" + case inherit = "inherit" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum CanvasDirection: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasFillRule.swift b/Sources/DOMKit/WebIDL/CanvasFillRule.swift index 541b4ce1..9d4bfb49 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillRule.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillRule.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFillRule: String, JSValueCompatible { - case nonzero - case evenodd +public enum CanvasFillRule: JSString, JSValueCompatible { + case nonzero = "nonzero" + case evenodd = "evenodd" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14,8 +14,8 @@ public enum CanvasFillRule: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift index b37b8742..6d4c1cba 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFontKerning: String, JSValueCompatible { - case auto - case normal - case none +public enum CanvasFontKerning: JSString, JSValueCompatible { + case auto = "auto" + case normal = "normal" + case none = "none" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum CanvasFontKerning: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift index 8bcca5b3..f65fec62 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift @@ -3,14 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFontStretch: String, JSValueCompatible { +public enum CanvasFontStretch: JSString, JSValueCompatible { case ultraCondensed = "ultra-condensed" case extraCondensed = "extra-condensed" - case condensed + case condensed = "condensed" case semiCondensed = "semi-condensed" - case normal + case normal = "normal" case semiExpanded = "semi-expanded" - case expanded + case expanded = "expanded" case extraExpanded = "extra-expanded" case ultraExpanded = "ultra-expanded" @@ -21,8 +21,8 @@ public enum CanvasFontStretch: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift index 3a61a862..6df5135e 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasFontVariantCaps: String, JSValueCompatible { - case normal +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 + case unicase = "unicase" case titlingCaps = "titling-caps" public static func construct(from jsValue: JSValue) -> Self? { @@ -19,8 +19,8 @@ public enum CanvasFontVariantCaps: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasLineCap.swift b/Sources/DOMKit/WebIDL/CanvasLineCap.swift index e344ba04..4e1efebb 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineCap.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineCap.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasLineCap: String, JSValueCompatible { - case butt - case round - case square +public enum CanvasLineCap: JSString, JSValueCompatible { + case butt = "butt" + case round = "round" + case square = "square" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum CanvasLineCap: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift index 03b8d7f0..07082df1 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasLineJoin: String, JSValueCompatible { - case round - case bevel - case miter +public enum CanvasLineJoin: JSString, JSValueCompatible { + case round = "round" + case bevel = "bevel" + case miter = "miter" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum CanvasLineJoin: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift index 727ff3d3..0f5277dc 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasTextAlign: String, JSValueCompatible { - case start - case end - case left - case right - case center +public enum CanvasTextAlign: JSString, JSValueCompatible { + case start = "start" + case end = "end" + case left = "left" + case right = "right" + case center = "center" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -17,8 +17,8 @@ public enum CanvasTextAlign: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift index da5f274c..c7d38447 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasTextBaseline: String, JSValueCompatible { - case top - case hanging - case middle - case alphabetic - case ideographic - case bottom +public enum CanvasTextBaseline: JSString, JSValueCompatible { + case top = "top" + case hanging = "hanging" + case middle = "middle" + case alphabetic = "alphabetic" + case ideographic = "ideographic" + case bottom = "bottom" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -18,8 +18,8 @@ public enum CanvasTextBaseline: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift index 93970426..164e4ee6 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public enum CanvasTextRendering: String, JSValueCompatible { - case auto - case optimizeSpeed - case optimizeLegibility - case geometricPrecision +public enum CanvasTextRendering: JSString, JSValueCompatible { + case auto = "auto" + case optimizeSpeed = "optimizeSpeed" + case optimizeLegibility = "optimizeLegibility" + case geometricPrecision = "geometricPrecision" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -16,8 +16,8 @@ public enum CanvasTextRendering: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift index 69470a4f..3273a619 100644 --- a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift +++ b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ColorSpaceConversion: String, JSValueCompatible { - case none - case `default` +public enum ColorSpaceConversion: JSString, JSValueCompatible { + case none = "none" + case `default` = "default" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14,8 +14,8 @@ public enum ColorSpaceConversion: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift index 2c3fcf94..019e2ca3 100644 --- a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift +++ b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public enum DOMParserSupportedType: String, JSValueCompatible { +public enum DOMParserSupportedType: JSString, JSValueCompatible { case textHtml = "text/html" case textXml = "text/xml" case applicationXml = "application/xml" @@ -17,8 +17,8 @@ public enum DOMParserSupportedType: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/DocumentReadyState.swift b/Sources/DOMKit/WebIDL/DocumentReadyState.swift index 3fd6716f..e69ad4c9 100644 --- a/Sources/DOMKit/WebIDL/DocumentReadyState.swift +++ b/Sources/DOMKit/WebIDL/DocumentReadyState.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum DocumentReadyState: String, JSValueCompatible { - case loading - case interactive - case complete +public enum DocumentReadyState: JSString, JSValueCompatible { + case loading = "loading" + case interactive = "interactive" + case complete = "complete" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum DocumentReadyState: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift index 5475c766..9f63b9f6 100644 --- a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift +++ b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum DocumentVisibilityState: String, JSValueCompatible { - case visible - case hidden +public enum DocumentVisibilityState: JSString, JSValueCompatible { + case visible = "visible" + case hidden = "hidden" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14,8 +14,8 @@ public enum DocumentVisibilityState: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/EndingType.swift b/Sources/DOMKit/WebIDL/EndingType.swift index a4d8ee5f..6b49b44c 100644 --- a/Sources/DOMKit/WebIDL/EndingType.swift +++ b/Sources/DOMKit/WebIDL/EndingType.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum EndingType: String, JSValueCompatible { - case transparent - case native +public enum EndingType: JSString, JSValueCompatible { + case transparent = "transparent" + case native = "native" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14,8 +14,8 @@ public enum EndingType: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ImageOrientation.swift b/Sources/DOMKit/WebIDL/ImageOrientation.swift index 52001125..bdeeadc2 100644 --- a/Sources/DOMKit/WebIDL/ImageOrientation.swift +++ b/Sources/DOMKit/WebIDL/ImageOrientation.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ImageOrientation: String, JSValueCompatible { - case none - case flipY +public enum ImageOrientation: JSString, JSValueCompatible { + case none = "none" + case flipY = "flipY" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14,8 +14,8 @@ public enum ImageOrientation: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift index ca275f9e..70b4d48d 100644 --- a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift +++ b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ImageSmoothingQuality: String, JSValueCompatible { - case low - case medium - case high +public enum ImageSmoothingQuality: JSString, JSValueCompatible { + case low = "low" + case medium = "medium" + case high = "high" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum ImageSmoothingQuality: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift index b06ef497..ad8c1828 100644 --- a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public enum OffscreenRenderingContextId: String, JSValueCompatible { +public enum OffscreenRenderingContextId: JSString, JSValueCompatible { case _2d = "2d" - case bitmaprenderer - case webgl - case webgl2 - case webgpu + case bitmaprenderer = "bitmaprenderer" + case webgl = "webgl" + case webgl2 = "webgl2" + case webgpu = "webgpu" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -17,8 +17,8 @@ public enum OffscreenRenderingContextId: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift index e2d8d4ae..635ecb91 100644 --- a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift +++ b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public enum PredefinedColorSpace: String, JSValueCompatible { - case srgb +public enum PredefinedColorSpace: JSString, JSValueCompatible { + case srgb = "srgb" case displayP3 = "display-p3" public static func construct(from jsValue: JSValue) -> Self? { @@ -14,8 +14,8 @@ public enum PredefinedColorSpace: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift index 4bda25e8..811f4ce3 100644 --- a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift +++ b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum PremultiplyAlpha: String, JSValueCompatible { - case none - case premultiply - case `default` +public enum PremultiplyAlpha: JSString, JSValueCompatible { + case none = "none" + case premultiply = "premultiply" + case `default` = "default" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum PremultiplyAlpha: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift index 2bc4c031..5441c54b 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ReadableStreamReaderMode: String, JSValueCompatible { - case byob +public enum ReadableStreamReaderMode: JSString, JSValueCompatible { + case byob = "byob" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -13,8 +13,8 @@ public enum ReadableStreamReaderMode: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamType.swift b/Sources/DOMKit/WebIDL/ReadableStreamType.swift index 98573e32..136accfe 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamType.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamType.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ReadableStreamType: String, JSValueCompatible { - case bytes +public enum ReadableStreamType: JSString, JSValueCompatible { + case bytes = "bytes" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -13,8 +13,8 @@ public enum ReadableStreamType: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift index c555f808..e2ab79f9 100644 --- a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift +++ b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ReferrerPolicy: String, JSValueCompatible { +public enum ReferrerPolicy: JSString, JSValueCompatible { case _empty = "" case noReferrer = "no-referrer" case noReferrerWhenDowngrade = "no-referrer-when-downgrade" case sameOrigin = "same-origin" - case origin + case origin = "origin" case strictOrigin = "strict-origin" case originWhenCrossOrigin = "origin-when-cross-origin" case strictOriginWhenCrossOrigin = "strict-origin-when-cross-origin" @@ -21,8 +21,8 @@ public enum ReferrerPolicy: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/RequestCache.swift b/Sources/DOMKit/WebIDL/RequestCache.swift index cb066649..5a2bc97a 100644 --- a/Sources/DOMKit/WebIDL/RequestCache.swift +++ b/Sources/DOMKit/WebIDL/RequestCache.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestCache: String, JSValueCompatible { - case `default` +public enum RequestCache: JSString, JSValueCompatible { + case `default` = "default" case noStore = "no-store" - case reload + case reload = "reload" case noCache = "no-cache" case forceCache = "force-cache" case onlyIfCached = "only-if-cached" @@ -18,8 +18,8 @@ public enum RequestCache: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/RequestCredentials.swift b/Sources/DOMKit/WebIDL/RequestCredentials.swift index f6299bdf..842c1862 100644 --- a/Sources/DOMKit/WebIDL/RequestCredentials.swift +++ b/Sources/DOMKit/WebIDL/RequestCredentials.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestCredentials: String, JSValueCompatible { - case omit +public enum RequestCredentials: JSString, JSValueCompatible { + case omit = "omit" case sameOrigin = "same-origin" - case include + case include = "include" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum RequestCredentials: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/RequestDestination.swift b/Sources/DOMKit/WebIDL/RequestDestination.swift index 93d623bd..992014b8 100644 --- a/Sources/DOMKit/WebIDL/RequestDestination.swift +++ b/Sources/DOMKit/WebIDL/RequestDestination.swift @@ -3,27 +3,27 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestDestination: String, JSValueCompatible { +public enum RequestDestination: JSString, JSValueCompatible { case _empty = "" - case audio - case audioworklet - case document - case embed - case font - case frame - case iframe - case image - case manifest - case object - case paintworklet - case report - case script - case sharedworker - case style - case track - case video - case worker - case xslt + case audio = "audio" + case audioworklet = "audioworklet" + case document = "document" + case embed = "embed" + case font = "font" + case frame = "frame" + case iframe = "iframe" + case image = "image" + case manifest = "manifest" + case object = "object" + case paintworklet = "paintworklet" + case report = "report" + case script = "script" + case sharedworker = "sharedworker" + case style = "style" + case track = "track" + case video = "video" + case worker = "worker" + case xslt = "xslt" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -32,8 +32,8 @@ public enum RequestDestination: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/RequestMode.swift b/Sources/DOMKit/WebIDL/RequestMode.swift index 698055fb..d90fb39e 100644 --- a/Sources/DOMKit/WebIDL/RequestMode.swift +++ b/Sources/DOMKit/WebIDL/RequestMode.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestMode: String, JSValueCompatible { - case navigate +public enum RequestMode: JSString, JSValueCompatible { + case navigate = "navigate" case sameOrigin = "same-origin" case noCors = "no-cors" - case cors + case cors = "cors" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -16,8 +16,8 @@ public enum RequestMode: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/RequestRedirect.swift b/Sources/DOMKit/WebIDL/RequestRedirect.swift index 42845b12..4cf86139 100644 --- a/Sources/DOMKit/WebIDL/RequestRedirect.swift +++ b/Sources/DOMKit/WebIDL/RequestRedirect.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum RequestRedirect: String, JSValueCompatible { - case follow - case error - case manual +public enum RequestRedirect: JSString, JSValueCompatible { + case follow = "follow" + case error = "error" + case manual = "manual" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum RequestRedirect: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ResizeQuality.swift b/Sources/DOMKit/WebIDL/ResizeQuality.swift index b78dd977..d1cc889c 100644 --- a/Sources/DOMKit/WebIDL/ResizeQuality.swift +++ b/Sources/DOMKit/WebIDL/ResizeQuality.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ResizeQuality: String, JSValueCompatible { - case pixelated - case low - case medium - case high +public enum ResizeQuality: JSString, JSValueCompatible { + case pixelated = "pixelated" + case low = "low" + case medium = "medium" + case high = "high" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -16,8 +16,8 @@ public enum ResizeQuality: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ResponseType.swift b/Sources/DOMKit/WebIDL/ResponseType.swift index 59676bda..db6f244f 100644 --- a/Sources/DOMKit/WebIDL/ResponseType.swift +++ b/Sources/DOMKit/WebIDL/ResponseType.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ResponseType: String, JSValueCompatible { - case basic - case cors - case `default` - case error - case opaque - case opaqueredirect +public enum ResponseType: JSString, JSValueCompatible { + case basic = "basic" + case cors = "cors" + case `default` = "default" + case error = "error" + case opaque = "opaque" + case opaqueredirect = "opaqueredirect" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -18,8 +18,8 @@ public enum ResponseType: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ScrollRestoration.swift b/Sources/DOMKit/WebIDL/ScrollRestoration.swift index cb1d08a7..3b7bb2ec 100644 --- a/Sources/DOMKit/WebIDL/ScrollRestoration.swift +++ b/Sources/DOMKit/WebIDL/ScrollRestoration.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ScrollRestoration: String, JSValueCompatible { - case auto - case manual +public enum ScrollRestoration: JSString, JSValueCompatible { + case auto = "auto" + case manual = "manual" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14,8 +14,8 @@ public enum ScrollRestoration: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/SelectionMode.swift b/Sources/DOMKit/WebIDL/SelectionMode.swift index 4e6e27fd..73d9e54f 100644 --- a/Sources/DOMKit/WebIDL/SelectionMode.swift +++ b/Sources/DOMKit/WebIDL/SelectionMode.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public enum SelectionMode: String, JSValueCompatible { - case select - case start - case end - case preserve +public enum SelectionMode: JSString, JSValueCompatible { + case select = "select" + case start = "start" + case end = "end" + case preserve = "preserve" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -16,8 +16,8 @@ public enum SelectionMode: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/ShadowRootMode.swift b/Sources/DOMKit/WebIDL/ShadowRootMode.swift index 36d4b62e..5798a255 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootMode.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootMode.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum ShadowRootMode: String, JSValueCompatible { - case open - case closed +public enum ShadowRootMode: JSString, JSValueCompatible { + case open = "open" + case closed = "closed" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14,8 +14,8 @@ public enum ShadowRootMode: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift index f2e9a40d..a9b9718a 100644 --- a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift +++ b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum SlotAssignmentMode: String, JSValueCompatible { - case manual - case named +public enum SlotAssignmentMode: JSString, JSValueCompatible { + case manual = "manual" + case named = "named" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14,8 +14,8 @@ public enum SlotAssignmentMode: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/TextTrackKind.swift b/Sources/DOMKit/WebIDL/TextTrackKind.swift index 6bf2237a..1be60c48 100644 --- a/Sources/DOMKit/WebIDL/TextTrackKind.swift +++ b/Sources/DOMKit/WebIDL/TextTrackKind.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public enum TextTrackKind: String, JSValueCompatible { - case subtitles - case captions - case descriptions - case chapters - case metadata +public enum TextTrackKind: JSString, JSValueCompatible { + case subtitles = "subtitles" + case captions = "captions" + case descriptions = "descriptions" + case chapters = "chapters" + case metadata = "metadata" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -17,8 +17,8 @@ public enum TextTrackKind: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/TextTrackMode.swift b/Sources/DOMKit/WebIDL/TextTrackMode.swift index e286f6c1..2b9de600 100644 --- a/Sources/DOMKit/WebIDL/TextTrackMode.swift +++ b/Sources/DOMKit/WebIDL/TextTrackMode.swift @@ -3,10 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public enum TextTrackMode: String, JSValueCompatible { - case disabled - case hidden - case showing +public enum TextTrackMode: JSString, JSValueCompatible { + case disabled = "disabled" + case hidden = "hidden" + case showing = "showing" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -15,8 +15,8 @@ public enum TextTrackMode: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/WorkerType.swift b/Sources/DOMKit/WebIDL/WorkerType.swift index c5c38611..bf3e953d 100644 --- a/Sources/DOMKit/WebIDL/WorkerType.swift +++ b/Sources/DOMKit/WebIDL/WorkerType.swift @@ -3,9 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -public enum WorkerType: String, JSValueCompatible { - case classic - case module +public enum WorkerType: JSString, JSValueCompatible { + case classic = "classic" + case module = "module" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14,8 +14,8 @@ public enum WorkerType: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift index 6a3e5269..dd867ba5 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public enum XMLHttpRequestResponseType: String, JSValueCompatible { +public enum XMLHttpRequestResponseType: JSString, JSValueCompatible { case _empty = "" - case arraybuffer - case blob - case document - case json - case text + case arraybuffer = "arraybuffer" + case blob = "blob" + case document = "document" + case json = "json" + case text = "text" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -18,8 +18,8 @@ public enum XMLHttpRequestResponseType: String, JSValueCompatible { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index d9968424..9773f85b 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -128,7 +128,7 @@ extension MergedDictionary: SwiftRepresentable { extension IDLEnum: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public enum \(name): String, JSValueCompatible { + public enum \(name): JSString, JSValueCompatible { \(lines: cases.map { "case \($0.camelized) = \(quoted: $0)" }) public static func construct(from jsValue: JSValue) -> Self? { @@ -138,8 +138,8 @@ extension IDLEnum: SwiftRepresentable { return nil } - public init?(rawValue: String) { - self.init(rawValue: JSString(rawValue)) + public init?(string: String) { + self.init(rawValue: JSString(string)) } public func jsValue() -> JSValue { rawValue.jsValue() } From 3a0e62772020bce97b648941dc2569e89b14ef6e Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 08:51:58 -0400 Subject: [PATCH 088/124] Merge all the strings into one enum --- Sources/DOMKit/ECMAScript/Support.swift | 4 - Sources/DOMKit/WebIDL/ARIAMixin.swift | 208 ++- Sources/DOMKit/WebIDL/AbortController.swift | 9 +- Sources/DOMKit/WebIDL/AbortSignal.swift | 21 +- Sources/DOMKit/WebIDL/AbstractRange.swift | 18 +- Sources/DOMKit/WebIDL/AbstractWorker.swift | 8 +- .../WebIDL/AddEventListenerOptions.swift | 18 +- .../WebIDL/AnimationFrameProvider.swift | 7 +- .../DOMKit/WebIDL/AssignedNodesOptions.swift | 8 +- Sources/DOMKit/WebIDL/Attr.swift | 24 +- Sources/DOMKit/WebIDL/AudioTrack.swift | 18 +- Sources/DOMKit/WebIDL/AudioTrackList.swift | 18 +- Sources/DOMKit/WebIDL/BarProp.swift | 6 +- Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift | 4 - Sources/DOMKit/WebIDL/Blob.swift | 25 +- Sources/DOMKit/WebIDL/BlobPropertyBag.swift | 13 +- Sources/DOMKit/WebIDL/Body.swift | 34 +- Sources/DOMKit/WebIDL/BroadcastChannel.swift | 18 +- .../WebIDL/ByteLengthQueuingStrategy.swift | 9 +- Sources/DOMKit/WebIDL/CDATASection.swift | 2 - Sources/DOMKit/WebIDL/CSS.swift | 11 +- Sources/DOMKit/WebIDL/CSSConditionRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 12 +- Sources/DOMKit/WebIDL/CSSImportRule.swift | 12 +- Sources/DOMKit/WebIDL/CSSMarginRule.swift | 9 +- Sources/DOMKit/WebIDL/CSSMediaRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSNamespaceRule.swift | 9 +- Sources/DOMKit/WebIDL/CSSPageRule.swift | 9 +- Sources/DOMKit/WebIDL/CSSRule.swift | 24 +- Sources/DOMKit/WebIDL/CSSRuleList.swift | 7 +- .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 28 +- Sources/DOMKit/WebIDL/CSSStyleRule.swift | 9 +- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 32 +- Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift | 18 +- Sources/DOMKit/WebIDL/CSSSupportsRule.swift | 2 - Sources/DOMKit/WebIDL/CanvasCompositing.swift | 13 +- Sources/DOMKit/WebIDL/CanvasDrawImage.swift | 10 +- Sources/DOMKit/WebIDL/CanvasDrawPath.swift | 31 +- .../WebIDL/CanvasFillStrokeStyles.swift | 25 +- Sources/DOMKit/WebIDL/CanvasFilter.swift | 2 - Sources/DOMKit/WebIDL/CanvasFilters.swift | 8 +- Sources/DOMKit/WebIDL/CanvasGradient.swift | 6 +- Sources/DOMKit/WebIDL/CanvasImageData.swift | 16 +- .../DOMKit/WebIDL/CanvasImageSmoothing.swift | 13 +- Sources/DOMKit/WebIDL/CanvasPath.swift | 33 +- .../WebIDL/CanvasPathDrawingStyles.swift | 34 +- Sources/DOMKit/WebIDL/CanvasPattern.swift | 6 +- Sources/DOMKit/WebIDL/CanvasRect.swift | 12 +- .../WebIDL/CanvasRenderingContext2D.swift | 9 +- .../CanvasRenderingContext2DSettings.swift | 23 +- .../DOMKit/WebIDL/CanvasShadowStyles.swift | 23 +- Sources/DOMKit/WebIDL/CanvasState.swift | 15 +- Sources/DOMKit/WebIDL/CanvasText.swift | 12 +- .../WebIDL/CanvasTextDrawingStyles.swift | 53 +- Sources/DOMKit/WebIDL/CanvasTransform.swift | 26 +- .../DOMKit/WebIDL/CanvasUserInterface.swift | 13 +- Sources/DOMKit/WebIDL/CharacterData.swift | 24 +- Sources/DOMKit/WebIDL/ChildNode.swift | 15 +- Sources/DOMKit/WebIDL/Comment.swift | 2 - Sources/DOMKit/WebIDL/CompositionEvent.swift | 9 +- .../DOMKit/WebIDL/CompositionEventInit.swift | 8 +- .../DOMKit/WebIDL/CountQueuingStrategy.swift | 9 +- .../DOMKit/WebIDL/CustomElementRegistry.swift | 11 +- Sources/DOMKit/WebIDL/CustomEvent.swift | 9 +- Sources/DOMKit/WebIDL/CustomEventInit.swift | 8 +- Sources/DOMKit/WebIDL/DOMException.swift | 37 +- Sources/DOMKit/WebIDL/DOMImplementation.swift | 15 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 108 +- Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift | 63 +- Sources/DOMKit/WebIDL/DOMMatrixInit.swift | 58 +- Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 135 +- Sources/DOMKit/WebIDL/DOMParser.swift | 6 +- Sources/DOMKit/WebIDL/DOMPoint.swift | 16 +- Sources/DOMKit/WebIDL/DOMPointInit.swift | 23 +- Sources/DOMKit/WebIDL/DOMPointReadOnly.swift | 24 +- Sources/DOMKit/WebIDL/DOMQuad.swift | 27 +- Sources/DOMKit/WebIDL/DOMQuadInit.swift | 23 +- Sources/DOMKit/WebIDL/DOMRect.swift | 16 +- Sources/DOMKit/WebIDL/DOMRectInit.swift | 23 +- Sources/DOMKit/WebIDL/DOMRectList.swift | 7 +- Sources/DOMKit/WebIDL/DOMRectReadOnly.swift | 33 +- Sources/DOMKit/WebIDL/DOMStringList.swift | 10 +- Sources/DOMKit/WebIDL/DOMStringMap.swift | 2 - Sources/DOMKit/WebIDL/DOMTokenList.swift | 28 +- Sources/DOMKit/WebIDL/DataTransfer.swift | 30 +- Sources/DOMKit/WebIDL/DataTransferItem.swift | 13 +- .../DOMKit/WebIDL/DataTransferItemList.swift | 17 +- .../WebIDL/DedicatedWorkerGlobalScope.swift | 20 +- Sources/DOMKit/WebIDL/Document.swift | 223 +--- .../DocumentAndElementEventHandlers.swift | 18 +- Sources/DOMKit/WebIDL/DocumentFragment.swift | 2 - .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 14 +- Sources/DOMKit/WebIDL/DocumentType.swift | 12 +- Sources/DOMKit/WebIDL/DragEvent.swift | 6 +- Sources/DOMKit/WebIDL/DragEventInit.swift | 8 +- Sources/DOMKit/WebIDL/Element.swift | 108 +- .../DOMKit/WebIDL/ElementCSSInlineStyle.swift | 6 +- .../WebIDL/ElementContentEditable.swift | 21 +- .../WebIDL/ElementCreationOptions.swift | 8 +- .../WebIDL/ElementDefinitionOptions.swift | 8 +- Sources/DOMKit/WebIDL/ElementInternals.swift | 33 +- Sources/DOMKit/WebIDL/ErrorEvent.swift | 18 +- Sources/DOMKit/WebIDL/ErrorEventInit.swift | 28 +- Sources/DOMKit/WebIDL/Event.swift | 61 +- Sources/DOMKit/WebIDL/EventInit.swift | 18 +- .../DOMKit/WebIDL/EventListenerOptions.swift | 8 +- Sources/DOMKit/WebIDL/EventModifierInit.swift | 73 +- Sources/DOMKit/WebIDL/EventSource.swift | 27 +- Sources/DOMKit/WebIDL/EventSourceInit.swift | 8 +- Sources/DOMKit/WebIDL/EventTarget.swift | 8 +- Sources/DOMKit/WebIDL/External.swift | 9 +- Sources/DOMKit/WebIDL/File.swift | 9 +- Sources/DOMKit/WebIDL/FileList.swift | 7 +- Sources/DOMKit/WebIDL/FilePropertyBag.swift | 8 +- Sources/DOMKit/WebIDL/FileReader.swift | 48 +- Sources/DOMKit/WebIDL/FileReaderSync.swift | 15 +- Sources/DOMKit/WebIDL/FocusEvent.swift | 6 +- Sources/DOMKit/WebIDL/FocusEventInit.swift | 8 +- Sources/DOMKit/WebIDL/FocusOptions.swift | 8 +- Sources/DOMKit/WebIDL/FormData.swift | 25 +- Sources/DOMKit/WebIDL/FormDataEvent.swift | 6 +- Sources/DOMKit/WebIDL/FormDataEventInit.swift | 8 +- .../WebIDL/GenericTransformStream.swift | 9 +- .../DOMKit/WebIDL/GetRootNodeOptions.swift | 8 +- .../DOMKit/WebIDL/GlobalEventHandlers.swift | 343 ++--- Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 10 +- Sources/DOMKit/WebIDL/HTMLAnchorElement.swift | 45 +- Sources/DOMKit/WebIDL/HTMLAreaElement.swift | 33 +- Sources/DOMKit/WebIDL/HTMLAudioElement.swift | 2 - Sources/DOMKit/WebIDL/HTMLBRElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLBaseElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLBodyElement.swift | 21 +- Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 54 +- Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 19 +- Sources/DOMKit/WebIDL/HTMLCollection.swift | 8 +- Sources/DOMKit/WebIDL/HTMLDListElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLDataElement.swift | 6 +- .../DOMKit/WebIDL/HTMLDataListElement.swift | 6 +- .../DOMKit/WebIDL/HTMLDetailsElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 18 +- .../DOMKit/WebIDL/HTMLDirectoryElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLDivElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 48 +- Sources/DOMKit/WebIDL/HTMLEmbedElement.swift | 24 +- .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 36 +- Sources/DOMKit/WebIDL/HTMLFontElement.swift | 12 +- .../WebIDL/HTMLFormControlsCollection.swift | 4 - Sources/DOMKit/WebIDL/HTMLFormElement.swift | 57 +- Sources/DOMKit/WebIDL/HTMLFrameElement.swift | 33 +- .../DOMKit/WebIDL/HTMLFrameSetElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLHRElement.swift | 18 +- Sources/DOMKit/WebIDL/HTMLHeadElement.swift | 2 - .../DOMKit/WebIDL/HTMLHeadingElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLHtmlElement.swift | 6 +- .../WebIDL/HTMLHyperlinkElementUtils.swift | 56 +- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 60 +- Sources/DOMKit/WebIDL/HTMLImageElement.swift | 77 +- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 167 +-- Sources/DOMKit/WebIDL/HTMLLIElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLLabelElement.swift | 12 +- Sources/DOMKit/WebIDL/HTMLLegendElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLLinkElement.swift | 57 +- Sources/DOMKit/WebIDL/HTMLMapElement.swift | 9 +- .../DOMKit/WebIDL/HTMLMarqueeElement.swift | 42 +- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 119 +- Sources/DOMKit/WebIDL/HTMLMenuElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLMetaElement.swift | 18 +- Sources/DOMKit/WebIDL/HTMLMeterElement.swift | 24 +- Sources/DOMKit/WebIDL/HTMLModElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLOListElement.swift | 15 +- Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 81 +- .../DOMKit/WebIDL/HTMLOptGroupElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLOptionElement.swift | 27 +- .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 15 +- Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift | 27 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 42 +- .../DOMKit/WebIDL/HTMLParagraphElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLParamElement.swift | 15 +- .../DOMKit/WebIDL/HTMLPictureElement.swift | 2 - Sources/DOMKit/WebIDL/HTMLPreElement.swift | 6 +- .../DOMKit/WebIDL/HTMLProgressElement.swift | 15 +- Sources/DOMKit/WebIDL/HTMLQuoteElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 45 +- Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 75 +- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 15 +- Sources/DOMKit/WebIDL/HTMLSourceElement.swift | 24 +- Sources/DOMKit/WebIDL/HTMLSpanElement.swift | 2 - Sources/DOMKit/WebIDL/HTMLStyleElement.swift | 12 +- .../WebIDL/HTMLTableCaptionElement.swift | 6 +- .../DOMKit/WebIDL/HTMLTableCellElement.swift | 48 +- .../DOMKit/WebIDL/HTMLTableColElement.swift | 21 +- Sources/DOMKit/WebIDL/HTMLTableElement.swift | 72 +- .../DOMKit/WebIDL/HTMLTableRowElement.swift | 33 +- .../WebIDL/HTMLTableSectionElement.swift | 24 +- .../DOMKit/WebIDL/HTMLTemplateElement.swift | 6 +- .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 95 +- Sources/DOMKit/WebIDL/HTMLTimeElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLTitleElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLTrackElement.swift | 28 +- Sources/DOMKit/WebIDL/HTMLUListElement.swift | 9 +- .../DOMKit/WebIDL/HTMLUnknownElement.swift | 2 - Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 21 +- Sources/DOMKit/WebIDL/HashChangeEvent.swift | 9 +- .../DOMKit/WebIDL/HashChangeEventInit.swift | 13 +- Sources/DOMKit/WebIDL/Headers.swift | 18 +- Sources/DOMKit/WebIDL/History.swift | 27 +- Sources/DOMKit/WebIDL/ImageBitmap.swift | 12 +- .../DOMKit/WebIDL/ImageBitmapOptions.swift | 33 +- .../WebIDL/ImageBitmapRenderingContext.swift | 9 +- .../ImageBitmapRenderingContextSettings.swift | 8 +- Sources/DOMKit/WebIDL/ImageData.swift | 15 +- Sources/DOMKit/WebIDL/ImageDataSettings.swift | 8 +- .../DOMKit/WebIDL/ImageEncodeOptions.swift | 13 +- Sources/DOMKit/WebIDL/InputEvent.swift | 12 +- Sources/DOMKit/WebIDL/InputEventInit.swift | 18 +- Sources/DOMKit/WebIDL/KeyboardEvent.swift | 46 +- Sources/DOMKit/WebIDL/KeyboardEventInit.swift | 38 +- Sources/DOMKit/WebIDL/LinkStyle.swift | 6 +- Sources/DOMKit/WebIDL/Location.swift | 42 +- Sources/DOMKit/WebIDL/MediaError.swift | 13 +- Sources/DOMKit/WebIDL/MediaList.swift | 16 +- Sources/DOMKit/WebIDL/MessageChannel.swift | 9 +- Sources/DOMKit/WebIDL/MessageEvent.swift | 21 +- Sources/DOMKit/WebIDL/MessageEventInit.swift | 28 +- Sources/DOMKit/WebIDL/MessagePort.swift | 20 +- Sources/DOMKit/WebIDL/MimeType.swift | 15 +- Sources/DOMKit/WebIDL/MimeTypeArray.swift | 8 +- Sources/DOMKit/WebIDL/MouseEvent.swift | 42 +- Sources/DOMKit/WebIDL/MouseEventInit.swift | 38 +- Sources/DOMKit/WebIDL/MutationEvent.swift | 24 +- Sources/DOMKit/WebIDL/MutationObserver.swift | 12 +- .../DOMKit/WebIDL/MutationObserverInit.swift | 38 +- Sources/DOMKit/WebIDL/MutationRecord.swift | 30 +- Sources/DOMKit/WebIDL/NamedNodeMap.swift | 23 +- Sources/DOMKit/WebIDL/Navigator.swift | 2 - .../WebIDL/NavigatorConcurrentHardware.swift | 6 +- .../DOMKit/WebIDL/NavigatorContentUtils.swift | 9 +- Sources/DOMKit/WebIDL/NavigatorCookies.swift | 6 +- Sources/DOMKit/WebIDL/NavigatorID.swift | 36 +- Sources/DOMKit/WebIDL/NavigatorLanguage.swift | 9 +- Sources/DOMKit/WebIDL/NavigatorOnLine.swift | 6 +- Sources/DOMKit/WebIDL/NavigatorPlugins.swift | 15 +- Sources/DOMKit/WebIDL/Node.swift | 108 +- Sources/DOMKit/WebIDL/NodeIterator.swift | 25 +- Sources/DOMKit/WebIDL/NodeList.swift | 7 +- .../WebIDL/NonDocumentTypeChildNode.swift | 9 +- .../DOMKit/WebIDL/NonElementParentNode.swift | 6 +- Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 26 +- .../OffscreenCanvasRenderingContext2D.swift | 9 +- .../DOMKit/WebIDL/PageTransitionEvent.swift | 6 +- .../WebIDL/PageTransitionEventInit.swift | 8 +- Sources/DOMKit/WebIDL/ParentNode.swift | 30 +- Sources/DOMKit/WebIDL/Path2D.swift | 6 +- Sources/DOMKit/WebIDL/Performance.swift | 12 +- Sources/DOMKit/WebIDL/Plugin.swift | 17 +- Sources/DOMKit/WebIDL/PluginArray.swift | 11 +- Sources/DOMKit/WebIDL/PopStateEvent.swift | 6 +- Sources/DOMKit/WebIDL/PopStateEventInit.swift | 8 +- .../DOMKit/WebIDL/ProcessingInstruction.swift | 6 +- Sources/DOMKit/WebIDL/ProgressEvent.swift | 12 +- Sources/DOMKit/WebIDL/ProgressEventInit.swift | 18 +- .../DOMKit/WebIDL/PromiseRejectionEvent.swift | 9 +- .../WebIDL/PromiseRejectionEventInit.swift | 13 +- Sources/DOMKit/WebIDL/QueuingStrategy.swift | 13 +- .../DOMKit/WebIDL/QueuingStrategyInit.swift | 8 +- Sources/DOMKit/WebIDL/RadioNodeList.swift | 6 +- Sources/DOMKit/WebIDL/Range.swift | 70 +- .../WebIDL/ReadableByteStreamController.swift | 18 +- Sources/DOMKit/WebIDL/ReadableStream.swift | 25 +- .../WebIDL/ReadableStreamBYOBReadResult.swift | 13 +- .../WebIDL/ReadableStreamBYOBReader.swift | 11 +- .../WebIDL/ReadableStreamBYOBRequest.swift | 12 +- .../ReadableStreamDefaultController.swift | 15 +- .../ReadableStreamDefaultReadResult.swift | 13 +- .../WebIDL/ReadableStreamDefaultReader.swift | 11 +- .../WebIDL/ReadableStreamGenericReader.swift | 11 +- .../ReadableStreamGetReaderOptions.swift | 8 +- .../ReadableStreamIteratorOptions.swift | 8 +- .../DOMKit/WebIDL/ReadableWritablePair.swift | 13 +- Sources/DOMKit/WebIDL/Request.swift | 51 +- Sources/DOMKit/WebIDL/RequestInit.swift | 68 +- Sources/DOMKit/WebIDL/Response.swift | 33 +- Sources/DOMKit/WebIDL/ResponseInit.swift | 18 +- Sources/DOMKit/WebIDL/ShadowRoot.swift | 18 +- Sources/DOMKit/WebIDL/ShadowRootInit.swift | 18 +- Sources/DOMKit/WebIDL/SharedWorker.swift | 6 +- .../WebIDL/SharedWorkerGlobalScope.swift | 12 +- Sources/DOMKit/WebIDL/Slottable.swift | 6 +- Sources/DOMKit/WebIDL/StaticRange.swift | 2 - Sources/DOMKit/WebIDL/StaticRangeInit.swift | 23 +- Sources/DOMKit/WebIDL/Storage.swift | 15 +- Sources/DOMKit/WebIDL/StorageEvent.swift | 21 +- Sources/DOMKit/WebIDL/StorageEventInit.swift | 28 +- Sources/DOMKit/WebIDL/StreamPipeOptions.swift | 23 +- Sources/DOMKit/WebIDL/Strings.swift | 1169 +++++++++++++++++ .../WebIDL/StructuredSerializeOptions.swift | 8 +- Sources/DOMKit/WebIDL/StyleSheet.swift | 24 +- Sources/DOMKit/WebIDL/StyleSheetList.swift | 7 +- Sources/DOMKit/WebIDL/SubmitEvent.swift | 6 +- Sources/DOMKit/WebIDL/SubmitEventInit.swift | 8 +- Sources/DOMKit/WebIDL/Text.swift | 9 +- Sources/DOMKit/WebIDL/TextMetrics.swift | 39 +- Sources/DOMKit/WebIDL/TextTrack.swift | 36 +- Sources/DOMKit/WebIDL/TextTrackCue.swift | 24 +- Sources/DOMKit/WebIDL/TextTrackCueList.swift | 9 +- Sources/DOMKit/WebIDL/TextTrackList.swift | 18 +- Sources/DOMKit/WebIDL/TimeRanges.swift | 12 +- Sources/DOMKit/WebIDL/TrackEvent.swift | 6 +- Sources/DOMKit/WebIDL/TrackEventInit.swift | 8 +- Sources/DOMKit/WebIDL/TransformStream.swift | 9 +- .../TransformStreamDefaultController.swift | 15 +- Sources/DOMKit/WebIDL/Transformer.swift | 28 +- Sources/DOMKit/WebIDL/TreeWalker.swift | 34 +- Sources/DOMKit/WebIDL/UIEvent.swift | 15 +- Sources/DOMKit/WebIDL/UIEventInit.swift | 18 +- Sources/DOMKit/WebIDL/URL.swift | 9 +- Sources/DOMKit/WebIDL/UnderlyingSink.swift | 28 +- Sources/DOMKit/WebIDL/UnderlyingSource.swift | 28 +- Sources/DOMKit/WebIDL/ValidityState.swift | 36 +- .../DOMKit/WebIDL/ValidityStateFlags.swift | 53 +- Sources/DOMKit/WebIDL/VideoTrack.swift | 18 +- Sources/DOMKit/WebIDL/VideoTrackList.swift | 21 +- Sources/DOMKit/WebIDL/WheelEvent.swift | 18 +- Sources/DOMKit/WebIDL/WheelEventInit.swift | 23 +- Sources/DOMKit/WebIDL/Window.swift | 124 +- .../DOMKit/WebIDL/WindowEventHandlers.swift | 83 +- .../DOMKit/WebIDL/WindowLocalStorage.swift | 6 +- .../WebIDL/WindowOrWorkerGlobalScope.swift | 54 +- .../WebIDL/WindowPostMessageOptions.swift | 8 +- .../DOMKit/WebIDL/WindowSessionStorage.swift | 6 +- Sources/DOMKit/WebIDL/Worker.swift | 17 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 33 +- Sources/DOMKit/WebIDL/WorkerLocation.swift | 30 +- Sources/DOMKit/WebIDL/WorkerNavigator.swift | 2 - Sources/DOMKit/WebIDL/WorkerOptions.swift | 18 +- Sources/DOMKit/WebIDL/Worklet.swift | 8 +- .../DOMKit/WebIDL/WorkletGlobalScope.swift | 2 - Sources/DOMKit/WebIDL/WorkletOptions.swift | 8 +- Sources/DOMKit/WebIDL/WritableStream.swift | 19 +- .../WritableStreamDefaultController.swift | 9 +- .../WebIDL/WritableStreamDefaultWriter.swift | 30 +- Sources/DOMKit/WebIDL/XMLDocument.swift | 2 - Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 67 +- .../WebIDL/XMLHttpRequestEventTarget.swift | 24 +- .../DOMKit/WebIDL/XMLHttpRequestUpload.swift | 2 - Sources/DOMKit/WebIDL/XPathEvaluator.swift | 2 - .../DOMKit/WebIDL/XPathEvaluatorBase.swift | 6 - Sources/DOMKit/WebIDL/XPathExpression.swift | 6 +- Sources/DOMKit/WebIDL/XPathResult.swift | 40 +- Sources/DOMKit/WebIDL/XSLTProcessor.swift | 27 +- Sources/DOMKit/WebIDL/console.swift | 60 +- Sources/WebIDLToSwift/Context.swift | 10 + Sources/WebIDLToSwift/IDLBuilder.swift | 12 + .../WebIDL+SwiftRepresentation.swift | 29 +- Sources/WebIDLToSwift/main.swift | 2 + 355 files changed, 3643 insertions(+), 5658 deletions(-) create mode 100644 Sources/DOMKit/WebIDL/Strings.swift diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index ff18fc5b..0e7c9bdb 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -9,10 +9,6 @@ public typealias __UNSUPPORTED_UNION__ = JSValue public typealias WindowProxy = Window -internal enum Strings { - static let toString: JSString = "toString" -} - public extension HTMLElement { convenience init?(from element: Element) { self.init(from: .object(element.jsObject)) diff --git a/Sources/DOMKit/WebIDL/ARIAMixin.swift b/Sources/DOMKit/WebIDL/ARIAMixin.swift index d84a755f..18edb7e9 100644 --- a/Sources/DOMKit/WebIDL/ARIAMixin.swift +++ b/Sources/DOMKit/WebIDL/ARIAMixin.swift @@ -3,254 +3,210 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let ariaAtomic: JSString = "ariaAtomic" - static let ariaAutoComplete: JSString = "ariaAutoComplete" - static let ariaBusy: JSString = "ariaBusy" - static let ariaChecked: JSString = "ariaChecked" - static let ariaColCount: JSString = "ariaColCount" - static let ariaColIndex: JSString = "ariaColIndex" - static let ariaColIndexText: JSString = "ariaColIndexText" - static let ariaColSpan: JSString = "ariaColSpan" - static let ariaCurrent: JSString = "ariaCurrent" - static let ariaDescription: JSString = "ariaDescription" - static let ariaDisabled: JSString = "ariaDisabled" - static let ariaExpanded: JSString = "ariaExpanded" - static let ariaHasPopup: JSString = "ariaHasPopup" - static let ariaHidden: JSString = "ariaHidden" - static let ariaInvalid: JSString = "ariaInvalid" - static let ariaKeyShortcuts: JSString = "ariaKeyShortcuts" - static let ariaLabel: JSString = "ariaLabel" - static let ariaLevel: JSString = "ariaLevel" - static let ariaLive: JSString = "ariaLive" - static let ariaModal: JSString = "ariaModal" - static let ariaMultiLine: JSString = "ariaMultiLine" - static let ariaMultiSelectable: JSString = "ariaMultiSelectable" - static let ariaOrientation: JSString = "ariaOrientation" - static let ariaPlaceholder: JSString = "ariaPlaceholder" - static let ariaPosInSet: JSString = "ariaPosInSet" - static let ariaPressed: JSString = "ariaPressed" - static let ariaReadOnly: JSString = "ariaReadOnly" - static let ariaRequired: JSString = "ariaRequired" - static let ariaRoleDescription: JSString = "ariaRoleDescription" - static let ariaRowCount: JSString = "ariaRowCount" - static let ariaRowIndex: JSString = "ariaRowIndex" - static let ariaRowIndexText: JSString = "ariaRowIndexText" - static let ariaRowSpan: JSString = "ariaRowSpan" - static let ariaSelected: JSString = "ariaSelected" - static let ariaSetSize: JSString = "ariaSetSize" - static let ariaSort: JSString = "ariaSort" - static let ariaValueMax: JSString = "ariaValueMax" - static let ariaValueMin: JSString = "ariaValueMin" - static let ariaValueNow: JSString = "ariaValueNow" - static let ariaValueText: JSString = "ariaValueText" - static let role: JSString = "role" -} - public protocol ARIAMixin: JSBridgedClass {} public extension ARIAMixin { var role: String? { - get { ReadWriteAttribute[Keys.role, in: jsObject] } - set { ReadWriteAttribute[Keys.role, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.role, in: jsObject] } + set { ReadWriteAttribute[Strings.role, in: jsObject] = newValue } } var ariaAtomic: String? { - get { ReadWriteAttribute[Keys.ariaAtomic, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaAtomic, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaAtomic, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaAtomic, in: jsObject] = newValue } } var ariaAutoComplete: String? { - get { ReadWriteAttribute[Keys.ariaAutoComplete, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaAutoComplete, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaAutoComplete, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaAutoComplete, in: jsObject] = newValue } } var ariaBusy: String? { - get { ReadWriteAttribute[Keys.ariaBusy, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaBusy, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaBusy, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaBusy, in: jsObject] = newValue } } var ariaChecked: String? { - get { ReadWriteAttribute[Keys.ariaChecked, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaChecked, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaChecked, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaChecked, in: jsObject] = newValue } } var ariaColCount: String? { - get { ReadWriteAttribute[Keys.ariaColCount, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaColCount, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaColCount, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaColCount, in: jsObject] = newValue } } var ariaColIndex: String? { - get { ReadWriteAttribute[Keys.ariaColIndex, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaColIndex, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaColIndex, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaColIndex, in: jsObject] = newValue } } var ariaColIndexText: String? { - get { ReadWriteAttribute[Keys.ariaColIndexText, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaColIndexText, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaColIndexText, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaColIndexText, in: jsObject] = newValue } } var ariaColSpan: String? { - get { ReadWriteAttribute[Keys.ariaColSpan, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaColSpan, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaColSpan, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaColSpan, in: jsObject] = newValue } } var ariaCurrent: String? { - get { ReadWriteAttribute[Keys.ariaCurrent, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaCurrent, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaCurrent, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaCurrent, in: jsObject] = newValue } } var ariaDescription: String? { - get { ReadWriteAttribute[Keys.ariaDescription, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaDescription, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaDescription, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaDescription, in: jsObject] = newValue } } var ariaDisabled: String? { - get { ReadWriteAttribute[Keys.ariaDisabled, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaDisabled, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaDisabled, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaDisabled, in: jsObject] = newValue } } var ariaExpanded: String? { - get { ReadWriteAttribute[Keys.ariaExpanded, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaExpanded, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaExpanded, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaExpanded, in: jsObject] = newValue } } var ariaHasPopup: String? { - get { ReadWriteAttribute[Keys.ariaHasPopup, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaHasPopup, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaHasPopup, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaHasPopup, in: jsObject] = newValue } } var ariaHidden: String? { - get { ReadWriteAttribute[Keys.ariaHidden, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaHidden, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaHidden, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaHidden, in: jsObject] = newValue } } var ariaInvalid: String? { - get { ReadWriteAttribute[Keys.ariaInvalid, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaInvalid, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaInvalid, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaInvalid, in: jsObject] = newValue } } var ariaKeyShortcuts: String? { - get { ReadWriteAttribute[Keys.ariaKeyShortcuts, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaKeyShortcuts, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaKeyShortcuts, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaKeyShortcuts, in: jsObject] = newValue } } var ariaLabel: String? { - get { ReadWriteAttribute[Keys.ariaLabel, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaLabel, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaLabel, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaLabel, in: jsObject] = newValue } } var ariaLevel: String? { - get { ReadWriteAttribute[Keys.ariaLevel, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaLevel, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaLevel, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaLevel, in: jsObject] = newValue } } var ariaLive: String? { - get { ReadWriteAttribute[Keys.ariaLive, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaLive, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaLive, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaLive, in: jsObject] = newValue } } var ariaModal: String? { - get { ReadWriteAttribute[Keys.ariaModal, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaModal, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaModal, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaModal, in: jsObject] = newValue } } var ariaMultiLine: String? { - get { ReadWriteAttribute[Keys.ariaMultiLine, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaMultiLine, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaMultiLine, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaMultiLine, in: jsObject] = newValue } } var ariaMultiSelectable: String? { - get { ReadWriteAttribute[Keys.ariaMultiSelectable, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaMultiSelectable, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaMultiSelectable, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaMultiSelectable, in: jsObject] = newValue } } var ariaOrientation: String? { - get { ReadWriteAttribute[Keys.ariaOrientation, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaOrientation, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaOrientation, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaOrientation, in: jsObject] = newValue } } var ariaPlaceholder: String? { - get { ReadWriteAttribute[Keys.ariaPlaceholder, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaPlaceholder, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaPlaceholder, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaPlaceholder, in: jsObject] = newValue } } var ariaPosInSet: String? { - get { ReadWriteAttribute[Keys.ariaPosInSet, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaPosInSet, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaPosInSet, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaPosInSet, in: jsObject] = newValue } } var ariaPressed: String? { - get { ReadWriteAttribute[Keys.ariaPressed, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaPressed, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaPressed, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaPressed, in: jsObject] = newValue } } var ariaReadOnly: String? { - get { ReadWriteAttribute[Keys.ariaReadOnly, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaReadOnly, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaReadOnly, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaReadOnly, in: jsObject] = newValue } } var ariaRequired: String? { - get { ReadWriteAttribute[Keys.ariaRequired, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaRequired, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaRequired, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaRequired, in: jsObject] = newValue } } var ariaRoleDescription: String? { - get { ReadWriteAttribute[Keys.ariaRoleDescription, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaRoleDescription, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaRoleDescription, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaRoleDescription, in: jsObject] = newValue } } var ariaRowCount: String? { - get { ReadWriteAttribute[Keys.ariaRowCount, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaRowCount, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaRowCount, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaRowCount, in: jsObject] = newValue } } var ariaRowIndex: String? { - get { ReadWriteAttribute[Keys.ariaRowIndex, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaRowIndex, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaRowIndex, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaRowIndex, in: jsObject] = newValue } } var ariaRowIndexText: String? { - get { ReadWriteAttribute[Keys.ariaRowIndexText, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaRowIndexText, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaRowIndexText, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaRowIndexText, in: jsObject] = newValue } } var ariaRowSpan: String? { - get { ReadWriteAttribute[Keys.ariaRowSpan, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaRowSpan, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaRowSpan, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaRowSpan, in: jsObject] = newValue } } var ariaSelected: String? { - get { ReadWriteAttribute[Keys.ariaSelected, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaSelected, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaSelected, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaSelected, in: jsObject] = newValue } } var ariaSetSize: String? { - get { ReadWriteAttribute[Keys.ariaSetSize, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaSetSize, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaSetSize, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaSetSize, in: jsObject] = newValue } } var ariaSort: String? { - get { ReadWriteAttribute[Keys.ariaSort, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaSort, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaSort, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaSort, in: jsObject] = newValue } } var ariaValueMax: String? { - get { ReadWriteAttribute[Keys.ariaValueMax, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaValueMax, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaValueMax, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaValueMax, in: jsObject] = newValue } } var ariaValueMin: String? { - get { ReadWriteAttribute[Keys.ariaValueMin, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaValueMin, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaValueMin, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaValueMin, in: jsObject] = newValue } } var ariaValueNow: String? { - get { ReadWriteAttribute[Keys.ariaValueNow, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaValueNow, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaValueNow, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaValueNow, in: jsObject] = newValue } } var ariaValueText: String? { - get { ReadWriteAttribute[Keys.ariaValueText, in: jsObject] } - set { ReadWriteAttribute[Keys.ariaValueText, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.ariaValueText, in: jsObject] } + set { ReadWriteAttribute[Strings.ariaValueText, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index 52fe0a64..2b88abc2 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class AbortController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.AbortController.function! } - private enum Keys { - static let abort: JSString = "abort" - static let signal: JSString = "signal" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _signal = ReadonlyAttribute(jsObject: jsObject, name: Keys.signal) + _signal = ReadonlyAttribute(jsObject: jsObject, name: Strings.signal) self.jsObject = jsObject } @@ -26,6 +21,6 @@ public class AbortController: JSBridgedClass { public var signal: AbortSignal public func abort(reason: JSValue? = nil) { - _ = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined) + _ = jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index 6508afa8..e9a4cacb 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -6,28 +6,19 @@ import JavaScriptKit public class AbortSignal: EventTarget { override public class var constructor: JSFunction { JSObject.global.AbortSignal.function! } - private enum Keys { - static let abort: JSString = "abort" - static let aborted: JSString = "aborted" - static let onabort: JSString = "onabort" - static let reason: JSString = "reason" - static let throwIfAborted: JSString = "throwIfAborted" - static let timeout: JSString = "timeout" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _aborted = ReadonlyAttribute(jsObject: jsObject, name: Keys.aborted) - _reason = ReadonlyAttribute(jsObject: jsObject, name: Keys.reason) - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onabort) + _aborted = ReadonlyAttribute(jsObject: jsObject, name: Strings.aborted) + _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) super.init(unsafelyWrapping: jsObject) } public static func abort(reason: JSValue? = nil) -> Self { - constructor[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + constructor[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! } public static func timeout(milliseconds: UInt64) -> Self { - constructor[Keys.timeout]!(milliseconds.jsValue()).fromJSValue()! + constructor[Strings.timeout]!(milliseconds.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -37,7 +28,7 @@ public class AbortSignal: EventTarget { public var reason: JSValue public func throwIfAborted() { - _ = jsObject[Keys.throwIfAborted]!() + _ = jsObject[Strings.throwIfAborted]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/AbstractRange.swift b/Sources/DOMKit/WebIDL/AbstractRange.swift index 5173886f..a815fa0e 100644 --- a/Sources/DOMKit/WebIDL/AbstractRange.swift +++ b/Sources/DOMKit/WebIDL/AbstractRange.swift @@ -6,22 +6,14 @@ import JavaScriptKit public class AbstractRange: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.AbstractRange.function! } - private enum Keys { - static let collapsed: JSString = "collapsed" - static let endContainer: JSString = "endContainer" - static let endOffset: JSString = "endOffset" - static let startContainer: JSString = "startContainer" - static let startOffset: JSString = "startOffset" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _startContainer = ReadonlyAttribute(jsObject: jsObject, name: Keys.startContainer) - _startOffset = ReadonlyAttribute(jsObject: jsObject, name: Keys.startOffset) - _endContainer = ReadonlyAttribute(jsObject: jsObject, name: Keys.endContainer) - _endOffset = ReadonlyAttribute(jsObject: jsObject, name: Keys.endOffset) - _collapsed = ReadonlyAttribute(jsObject: jsObject, name: Keys.collapsed) + _startContainer = ReadonlyAttribute(jsObject: jsObject, name: Strings.startContainer) + _startOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.startOffset) + _endContainer = ReadonlyAttribute(jsObject: jsObject, name: Strings.endContainer) + _endOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.endOffset) + _collapsed = ReadonlyAttribute(jsObject: jsObject, name: Strings.collapsed) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/AbstractWorker.swift b/Sources/DOMKit/WebIDL/AbstractWorker.swift index d18b137d..3fee6853 100644 --- a/Sources/DOMKit/WebIDL/AbstractWorker.swift +++ b/Sources/DOMKit/WebIDL/AbstractWorker.swift @@ -3,14 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let onerror: JSString = "onerror" -} - public protocol AbstractWorker: JSBridgedClass {} public extension AbstractWorker { var onerror: EventHandler { - get { ClosureAttribute.Optional1[Keys.onerror, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onerror, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onerror, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onerror, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift index 67347200..76dc7d65 100644 --- a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift @@ -4,24 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class AddEventListenerOptions: BridgedDictionary { - private enum Keys { - static let once: JSString = "once" - static let passive: JSString = "passive" - static let signal: JSString = "signal" - } - public convenience init(passive: Bool, once: Bool, signal: AbortSignal) { let object = JSObject.global.Object.function!.new() - object[Keys.passive] = passive.jsValue() - object[Keys.once] = once.jsValue() - object[Keys.signal] = signal.jsValue() + object[Strings.passive] = passive.jsValue() + object[Strings.once] = once.jsValue() + object[Strings.signal] = signal.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _passive = ReadWriteAttribute(jsObject: object, name: Keys.passive) - _once = ReadWriteAttribute(jsObject: object, name: Keys.once) - _signal = ReadWriteAttribute(jsObject: object, name: Keys.signal) + _passive = ReadWriteAttribute(jsObject: object, name: Strings.passive) + _once = ReadWriteAttribute(jsObject: object, name: Strings.once) + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift index bd802aa2..ee1d927b 100644 --- a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift +++ b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift @@ -3,16 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let cancelAnimationFrame: JSString = "cancelAnimationFrame" - static let requestAnimationFrame: JSString = "requestAnimationFrame" -} - public protocol AnimationFrameProvider: JSBridgedClass {} public extension AnimationFrameProvider { // XXX: method 'requestAnimationFrame' is ignored func cancelAnimationFrame(handle: UInt32) { - _ = jsObject[Keys.cancelAnimationFrame]!(handle.jsValue()) + _ = jsObject[Strings.cancelAnimationFrame]!(handle.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift index fce970a1..416a6d70 100644 --- a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift +++ b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class AssignedNodesOptions: BridgedDictionary { - private enum Keys { - static let flatten: JSString = "flatten" - } - public convenience init(flatten: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.flatten] = flatten.jsValue() + object[Strings.flatten] = flatten.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _flatten = ReadWriteAttribute(jsObject: object, name: Keys.flatten) + _flatten = ReadWriteAttribute(jsObject: object, name: Strings.flatten) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Attr.swift b/Sources/DOMKit/WebIDL/Attr.swift index 909aa650..2a9e1f28 100644 --- a/Sources/DOMKit/WebIDL/Attr.swift +++ b/Sources/DOMKit/WebIDL/Attr.swift @@ -6,24 +6,14 @@ import JavaScriptKit public class Attr: Node { override public class var constructor: JSFunction { JSObject.global.Attr.function! } - private enum Keys { - static let localName: JSString = "localName" - static let name: JSString = "name" - static let namespaceURI: JSString = "namespaceURI" - static let ownerElement: JSString = "ownerElement" - static let prefix: JSString = "prefix" - static let specified: JSString = "specified" - static let value: JSString = "value" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.namespaceURI) - _prefix = ReadonlyAttribute(jsObject: jsObject, name: Keys.prefix) - _localName = ReadonlyAttribute(jsObject: jsObject, name: Keys.localName) - _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _ownerElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.ownerElement) - _specified = ReadonlyAttribute(jsObject: jsObject, name: Keys.specified) + _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) + _prefix = ReadonlyAttribute(jsObject: jsObject, name: Strings.prefix) + _localName = ReadonlyAttribute(jsObject: jsObject, name: Strings.localName) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _ownerElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerElement) + _specified = ReadonlyAttribute(jsObject: jsObject, name: Strings.specified) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/AudioTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack.swift index 85de483b..c6cd22e3 100644 --- a/Sources/DOMKit/WebIDL/AudioTrack.swift +++ b/Sources/DOMKit/WebIDL/AudioTrack.swift @@ -6,22 +6,14 @@ import JavaScriptKit public class AudioTrack: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.AudioTrack.function! } - private enum Keys { - static let enabled: JSString = "enabled" - static let id: JSString = "id" - static let kind: JSString = "kind" - static let label: JSString = "label" - static let language: JSString = "language" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Keys.id) - _kind = ReadonlyAttribute(jsObject: jsObject, name: Keys.kind) - _label = ReadonlyAttribute(jsObject: jsObject, name: Keys.label) - _language = ReadonlyAttribute(jsObject: jsObject, name: Keys.language) - _enabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.enabled) + _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 } diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift index cc29851a..33e997be 100644 --- a/Sources/DOMKit/WebIDL/AudioTrackList.swift +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -6,19 +6,11 @@ import JavaScriptKit public class AudioTrackList: EventTarget { override public class var constructor: JSFunction { JSObject.global.AudioTrackList.function! } - private enum Keys { - static let getTrackById: JSString = "getTrackById" - static let length: JSString = "length" - static let onaddtrack: JSString = "onaddtrack" - static let onchange: JSString = "onchange" - static let onremovetrack: JSString = "onremovetrack" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onchange) - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onaddtrack) - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onremovetrack) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddtrack) + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovetrack) super.init(unsafelyWrapping: jsObject) } @@ -30,7 +22,7 @@ public class AudioTrackList: EventTarget { } public func getTrackById(id: String) -> AudioTrack? { - jsObject[Keys.getTrackById]!(id.jsValue()).fromJSValue()! + jsObject[Strings.getTrackById]!(id.jsValue()).fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/BarProp.swift b/Sources/DOMKit/WebIDL/BarProp.swift index 5a4ee393..26eea5c1 100644 --- a/Sources/DOMKit/WebIDL/BarProp.swift +++ b/Sources/DOMKit/WebIDL/BarProp.swift @@ -6,14 +6,10 @@ import JavaScriptKit public class BarProp: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.BarProp.function! } - private enum Keys { - static let visible: JSString = "visible" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _visible = ReadonlyAttribute(jsObject: jsObject, name: Keys.visible) + _visible = ReadonlyAttribute(jsObject: jsObject, name: Strings.visible) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift index 09fa09cc..a515357c 100644 --- a/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift +++ b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift @@ -6,10 +6,6 @@ import JavaScriptKit public class BeforeUnloadEvent: Event { override public class var constructor: JSFunction { JSObject.global.BeforeUnloadEvent.function! } - private enum Keys { - static let returnValue: JSString = "returnValue" - } - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index 2caed282..dad6c830 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -6,20 +6,11 @@ import JavaScriptKit public class Blob: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Blob.function! } - private enum Keys { - static let arrayBuffer: JSString = "arrayBuffer" - static let size: JSString = "size" - static let slice: JSString = "slice" - static let stream: JSString = "stream" - static let text: JSString = "text" - static let type: JSString = "type" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _size = ReadonlyAttribute(jsObject: jsObject, name: Keys.size) - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) self.jsObject = jsObject } @@ -34,30 +25,30 @@ public class Blob: JSBridgedClass { public var type: String public func slice(start: Int64? = nil, end: Int64? = nil, contentType: String? = nil) -> Self { - jsObject[Keys.slice]!(start?.jsValue() ?? .undefined, end?.jsValue() ?? .undefined, contentType?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.slice]!(start?.jsValue() ?? .undefined, end?.jsValue() ?? .undefined, contentType?.jsValue() ?? .undefined).fromJSValue()! } public func stream() -> ReadableStream { - jsObject[Keys.stream]!().fromJSValue()! + jsObject[Strings.stream]!().fromJSValue()! } public func text() -> JSPromise { - jsObject[Keys.text]!().fromJSValue()! + jsObject[Strings.text]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func text() async throws -> String { - let _promise: JSPromise = jsObject[Keys.text]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.text]!().fromJSValue()! return try await _promise.get().fromJSValue()! } public func arrayBuffer() -> JSPromise { - jsObject[Keys.arrayBuffer]!().fromJSValue()! + jsObject[Strings.arrayBuffer]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func arrayBuffer() async throws -> ArrayBuffer { - let _promise: JSPromise = jsObject[Keys.arrayBuffer]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.arrayBuffer]!().fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift index 5f679911..b81ff396 100644 --- a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift +++ b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift @@ -4,21 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class BlobPropertyBag: BridgedDictionary { - private enum Keys { - static let endings: JSString = "endings" - static let type: JSString = "type" - } - public convenience init(type: String, endings: EndingType) { let object = JSObject.global.Object.function!.new() - object[Keys.type] = type.jsValue() - object[Keys.endings] = endings.jsValue() + object[Strings.type] = type.jsValue() + object[Strings.endings] = endings.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Keys.type) - _endings = ReadWriteAttribute(jsObject: object, name: Keys.endings) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _endings = ReadWriteAttribute(jsObject: object, name: Strings.endings) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Body.swift b/Sources/DOMKit/WebIDL/Body.swift index 6fffda0a..02034891 100644 --- a/Sources/DOMKit/WebIDL/Body.swift +++ b/Sources/DOMKit/WebIDL/Body.swift @@ -3,69 +3,59 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let arrayBuffer: JSString = "arrayBuffer" - static let blob: JSString = "blob" - static let body: JSString = "body" - static let bodyUsed: JSString = "bodyUsed" - static let formData: JSString = "formData" - static let json: JSString = "json" - static let text: JSString = "text" -} - public protocol Body: JSBridgedClass {} public extension Body { - var body: ReadableStream? { ReadonlyAttribute[Keys.body, in: jsObject] } + var body: ReadableStream? { ReadonlyAttribute[Strings.body, in: jsObject] } - var bodyUsed: Bool { ReadonlyAttribute[Keys.bodyUsed, in: jsObject] } + var bodyUsed: Bool { ReadonlyAttribute[Strings.bodyUsed, in: jsObject] } func arrayBuffer() -> JSPromise { - jsObject[Keys.arrayBuffer]!().fromJSValue()! + jsObject[Strings.arrayBuffer]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func arrayBuffer() async throws -> ArrayBuffer { - let _promise: JSPromise = jsObject[Keys.arrayBuffer]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.arrayBuffer]!().fromJSValue()! return try await _promise.get().fromJSValue()! } func blob() -> JSPromise { - jsObject[Keys.blob]!().fromJSValue()! + jsObject[Strings.blob]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func blob() async throws -> Blob { - let _promise: JSPromise = jsObject[Keys.blob]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.blob]!().fromJSValue()! return try await _promise.get().fromJSValue()! } func formData() -> JSPromise { - jsObject[Keys.formData]!().fromJSValue()! + jsObject[Strings.formData]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func formData() async throws -> FormData { - let _promise: JSPromise = jsObject[Keys.formData]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.formData]!().fromJSValue()! return try await _promise.get().fromJSValue()! } func json() -> JSPromise { - jsObject[Keys.json]!().fromJSValue()! + jsObject[Strings.json]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func json() async throws -> JSValue { - let _promise: JSPromise = jsObject[Keys.json]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.json]!().fromJSValue()! return try await _promise.get().fromJSValue()! } func text() -> JSPromise { - jsObject[Keys.text]!().fromJSValue()! + jsObject[Strings.text]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func text() async throws -> String { - let _promise: JSPromise = jsObject[Keys.text]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.text]!().fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index 9115d8cb..2582bcfc 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -6,18 +6,10 @@ import JavaScriptKit public class BroadcastChannel: EventTarget { override public class var constructor: JSFunction { JSObject.global.BroadcastChannel.function! } - private enum Keys { - static let close: JSString = "close" - static let name: JSString = "name" - static let onmessage: JSString = "onmessage" - static let onmessageerror: JSString = "onmessageerror" - static let postMessage: JSString = "postMessage" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessageerror) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -29,11 +21,11 @@ public class BroadcastChannel: EventTarget { public var name: String public func postMessage(message: JSValue) { - _ = jsObject[Keys.postMessage]!(message.jsValue()) + _ = jsObject[Strings.postMessage]!(message.jsValue()) } public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift index 3e39e8af..867df413 100644 --- a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift @@ -6,16 +6,11 @@ import JavaScriptKit public class ByteLengthQueuingStrategy: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ByteLengthQueuingStrategy.function! } - private enum Keys { - static let highWaterMark: JSString = "highWaterMark" - static let size: JSString = "size" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Keys.highWaterMark) - _size = ReadonlyAttribute(jsObject: jsObject, name: Keys.size) + _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Strings.highWaterMark) + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/CDATASection.swift b/Sources/DOMKit/WebIDL/CDATASection.swift index 8fda5885..32a64c03 100644 --- a/Sources/DOMKit/WebIDL/CDATASection.swift +++ b/Sources/DOMKit/WebIDL/CDATASection.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class CDATASection: Text { override public class var constructor: JSFunction { JSObject.global.CDATASection.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index f11dcd8e..1f23c24d 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -4,24 +4,19 @@ import JavaScriptEventLoop import JavaScriptKit public enum CSS { - private enum Keys { - static let escape: JSString = "escape" - static let supports: JSString = "supports" - } - public static var jsObject: JSObject { JSObject.global.CSS.object! } public static func escape(ident: String) -> String { - JSObject.global.CSS.object![Keys.escape]!(ident.jsValue()).fromJSValue()! + JSObject.global.CSS.object![Strings.escape]!(ident.jsValue()).fromJSValue()! } public static func supports(property: String, value: String) -> Bool { - JSObject.global.CSS.object![Keys.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! + JSObject.global.CSS.object![Strings.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! } public static func supports(conditionText: String) -> Bool { - JSObject.global.CSS.object![Keys.supports]!(conditionText.jsValue()).fromJSValue()! + JSObject.global.CSS.object![Strings.supports]!(conditionText.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSConditionRule.swift b/Sources/DOMKit/WebIDL/CSSConditionRule.swift index d7703857..76048a06 100644 --- a/Sources/DOMKit/WebIDL/CSSConditionRule.swift +++ b/Sources/DOMKit/WebIDL/CSSConditionRule.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class CSSConditionRule: CSSGroupingRule { override public class var constructor: JSFunction { JSObject.global.CSSConditionRule.function! } - private enum Keys { - static let conditionText: JSString = "conditionText" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _conditionText = ReadWriteAttribute(jsObject: jsObject, name: Keys.conditionText) + _conditionText = ReadWriteAttribute(jsObject: jsObject, name: Strings.conditionText) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift index 4a0d2013..0502fba2 100644 --- a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift @@ -6,14 +6,8 @@ import JavaScriptKit public class CSSGroupingRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSGroupingRule.function! } - private enum Keys { - static let cssRules: JSString = "cssRules" - static let deleteRule: JSString = "deleteRule" - static let insertRule: JSString = "insertRule" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Keys.cssRules) + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) super.init(unsafelyWrapping: jsObject) } @@ -21,10 +15,10 @@ public class CSSGroupingRule: CSSRule { public var cssRules: CSSRuleList public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - jsObject[Keys.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteRule(index: UInt32) { - _ = jsObject[Keys.deleteRule]!(index.jsValue()) + _ = jsObject[Strings.deleteRule]!(index.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CSSImportRule.swift b/Sources/DOMKit/WebIDL/CSSImportRule.swift index a259d64d..2ada38da 100644 --- a/Sources/DOMKit/WebIDL/CSSImportRule.swift +++ b/Sources/DOMKit/WebIDL/CSSImportRule.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class CSSImportRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSImportRule.function! } - private enum Keys { - static let href: JSString = "href" - static let media: JSString = "media" - static let styleSheet: JSString = "styleSheet" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadonlyAttribute(jsObject: jsObject, name: Keys.href) - _media = ReadonlyAttribute(jsObject: jsObject, name: Keys.media) - _styleSheet = ReadonlyAttribute(jsObject: jsObject, name: Keys.styleSheet) + _href = ReadonlyAttribute(jsObject: jsObject, name: Strings.href) + _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) + _styleSheet = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleSheet) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSMarginRule.swift b/Sources/DOMKit/WebIDL/CSSMarginRule.swift index 0aa6f7ed..04241bd0 100644 --- a/Sources/DOMKit/WebIDL/CSSMarginRule.swift +++ b/Sources/DOMKit/WebIDL/CSSMarginRule.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class CSSMarginRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSMarginRule.function! } - private enum Keys { - static let name: JSString = "name" - static let style: JSString = "style" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) - _style = ReadonlyAttribute(jsObject: jsObject, name: Keys.style) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSMediaRule.swift b/Sources/DOMKit/WebIDL/CSSMediaRule.swift index 20283dd2..b605a387 100644 --- a/Sources/DOMKit/WebIDL/CSSMediaRule.swift +++ b/Sources/DOMKit/WebIDL/CSSMediaRule.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class CSSMediaRule: CSSConditionRule { override public class var constructor: JSFunction { JSObject.global.CSSMediaRule.function! } - private enum Keys { - static let media: JSString = "media" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _media = ReadonlyAttribute(jsObject: jsObject, name: Keys.media) + _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift index 3648af52..bae4777e 100644 --- a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift +++ b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class CSSNamespaceRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSNamespaceRule.function! } - private enum Keys { - static let namespaceURI: JSString = "namespaceURI" - static let prefix: JSString = "prefix" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.namespaceURI) - _prefix = ReadonlyAttribute(jsObject: jsObject, name: Keys.prefix) + _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) + _prefix = ReadonlyAttribute(jsObject: jsObject, name: Strings.prefix) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSPageRule.swift b/Sources/DOMKit/WebIDL/CSSPageRule.swift index 6798bca9..5dd56710 100644 --- a/Sources/DOMKit/WebIDL/CSSPageRule.swift +++ b/Sources/DOMKit/WebIDL/CSSPageRule.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class CSSPageRule: CSSGroupingRule { override public class var constructor: JSFunction { JSObject.global.CSSPageRule.function! } - private enum Keys { - static let selectorText: JSString = "selectorText" - static let style: JSString = "style" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectorText) - _style = ReadonlyAttribute(jsObject: jsObject, name: Keys.style) + _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) + _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift index 90752262..5137db57 100644 --- a/Sources/DOMKit/WebIDL/CSSRule.swift +++ b/Sources/DOMKit/WebIDL/CSSRule.swift @@ -6,29 +6,13 @@ import JavaScriptKit public class CSSRule: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CSSRule.function! } - private enum Keys { - static let CHARSET_RULE: JSString = "CHARSET_RULE" - static let FONT_FACE_RULE: JSString = "FONT_FACE_RULE" - static let IMPORT_RULE: JSString = "IMPORT_RULE" - static let MARGIN_RULE: JSString = "MARGIN_RULE" - static let MEDIA_RULE: JSString = "MEDIA_RULE" - static let NAMESPACE_RULE: JSString = "NAMESPACE_RULE" - static let PAGE_RULE: JSString = "PAGE_RULE" - static let STYLE_RULE: JSString = "STYLE_RULE" - static let SUPPORTS_RULE: JSString = "SUPPORTS_RULE" - static let cssText: JSString = "cssText" - static let parentRule: JSString = "parentRule" - static let parentStyleSheet: JSString = "parentStyleSheet" - static let type: JSString = "type" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _cssText = ReadWriteAttribute(jsObject: jsObject, name: Keys.cssText) - _parentRule = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentRule) - _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentStyleSheet) - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _cssText = ReadWriteAttribute(jsObject: jsObject, name: Strings.cssText) + _parentRule = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentRule) + _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentStyleSheet) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/CSSRuleList.swift b/Sources/DOMKit/WebIDL/CSSRuleList.swift index 47fe6c99..b4e6b5fc 100644 --- a/Sources/DOMKit/WebIDL/CSSRuleList.swift +++ b/Sources/DOMKit/WebIDL/CSSRuleList.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class CSSRuleList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CSSRuleList.function! } - private enum Keys { - static let item: JSString = "item" - static let length: JSString = "length" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift index 93317962..36d075bf 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift @@ -6,25 +6,13 @@ import JavaScriptKit public class CSSStyleDeclaration: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CSSStyleDeclaration.function! } - private enum Keys { - static let cssFloat: JSString = "cssFloat" - static let cssText: JSString = "cssText" - static let getPropertyPriority: JSString = "getPropertyPriority" - static let getPropertyValue: JSString = "getPropertyValue" - static let item: JSString = "item" - static let length: JSString = "length" - static let parentRule: JSString = "parentRule" - static let removeProperty: JSString = "removeProperty" - static let setProperty: JSString = "setProperty" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _cssText = ReadWriteAttribute(jsObject: jsObject, name: Keys.cssText) - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) - _parentRule = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentRule) - _cssFloat = ReadWriteAttribute(jsObject: jsObject, name: Keys.cssFloat) + _cssText = ReadWriteAttribute(jsObject: jsObject, name: Strings.cssText) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _parentRule = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentRule) + _cssFloat = ReadWriteAttribute(jsObject: jsObject, name: Strings.cssFloat) self.jsObject = jsObject } @@ -39,19 +27,19 @@ public class CSSStyleDeclaration: JSBridgedClass { } public func getPropertyValue(property: String) -> String { - jsObject[Keys.getPropertyValue]!(property.jsValue()).fromJSValue()! + jsObject[Strings.getPropertyValue]!(property.jsValue()).fromJSValue()! } public func getPropertyPriority(property: String) -> String { - jsObject[Keys.getPropertyPriority]!(property.jsValue()).fromJSValue()! + jsObject[Strings.getPropertyPriority]!(property.jsValue()).fromJSValue()! } public func setProperty(property: String, value: String, priority: String? = nil) { - _ = jsObject[Keys.setProperty]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined) + _ = jsObject[Strings.setProperty]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined) } public func removeProperty(property: String) -> String { - jsObject[Keys.removeProperty]!(property.jsValue()).fromJSValue()! + jsObject[Strings.removeProperty]!(property.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift index 574bde91..53f1270b 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class CSSStyleRule: CSSRule { override public class var constructor: JSFunction { JSObject.global.CSSStyleRule.function! } - private enum Keys { - static let selectorText: JSString = "selectorText" - static let style: JSString = "style" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectorText) - _style = ReadonlyAttribute(jsObject: jsObject, name: Keys.style) + _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) + _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift index fa4956ed..1a1581e2 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -6,22 +6,10 @@ import JavaScriptKit public class CSSStyleSheet: StyleSheet { override public class var constructor: JSFunction { JSObject.global.CSSStyleSheet.function! } - private enum Keys { - static let addRule: JSString = "addRule" - static let cssRules: JSString = "cssRules" - static let deleteRule: JSString = "deleteRule" - static let insertRule: JSString = "insertRule" - static let ownerRule: JSString = "ownerRule" - static let removeRule: JSString = "removeRule" - static let replace: JSString = "replace" - static let replaceSync: JSString = "replaceSync" - static let rules: JSString = "rules" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _ownerRule = ReadonlyAttribute(jsObject: jsObject, name: Keys.ownerRule) - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Keys.cssRules) - _rules = ReadonlyAttribute(jsObject: jsObject, name: Keys.rules) + _ownerRule = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerRule) + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) + _rules = ReadonlyAttribute(jsObject: jsObject, name: Strings.rules) super.init(unsafelyWrapping: jsObject) } @@ -36,35 +24,35 @@ public class CSSStyleSheet: StyleSheet { public var cssRules: CSSRuleList public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - jsObject[Keys.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteRule(index: UInt32) { - _ = jsObject[Keys.deleteRule]!(index.jsValue()) + _ = jsObject[Strings.deleteRule]!(index.jsValue()) } public func replace(text: String) -> JSPromise { - jsObject[Keys.replace]!(text.jsValue()).fromJSValue()! + jsObject[Strings.replace]!(text.jsValue()).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func replace(text: String) async throws -> CSSStyleSheet { - let _promise: JSPromise = jsObject[Keys.replace]!(text.jsValue()).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.replace]!(text.jsValue()).fromJSValue()! return try await _promise.get().fromJSValue()! } public func replaceSync(text: String) { - _ = jsObject[Keys.replaceSync]!(text.jsValue()) + _ = jsObject[Strings.replaceSync]!(text.jsValue()) } @ReadonlyAttribute public var rules: CSSRuleList public func addRule(selector: String? = nil, style: String? = nil, index: UInt32? = nil) -> Int32 { - jsObject[Keys.addRule]!(selector?.jsValue() ?? .undefined, style?.jsValue() ?? .undefined, index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.addRule]!(selector?.jsValue() ?? .undefined, style?.jsValue() ?? .undefined, index?.jsValue() ?? .undefined).fromJSValue()! } public func removeRule(index: UInt32? = nil) { - _ = jsObject[Keys.removeRule]!(index?.jsValue() ?? .undefined) + _ = jsObject[Strings.removeRule]!(index?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift index e308253f..f778e090 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift @@ -4,24 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleSheetInit: BridgedDictionary { - private enum Keys { - static let baseURL: JSString = "baseURL" - static let disabled: JSString = "disabled" - static let media: JSString = "media" - } - public convenience init(baseURL: String, media: __UNSUPPORTED_UNION__, disabled: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.baseURL] = baseURL.jsValue() - object[Keys.media] = media.jsValue() - object[Keys.disabled] = disabled.jsValue() + object[Strings.baseURL] = baseURL.jsValue() + object[Strings.media] = media.jsValue() + object[Strings.disabled] = disabled.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _baseURL = ReadWriteAttribute(jsObject: object, name: Keys.baseURL) - _media = ReadWriteAttribute(jsObject: object, name: Keys.media) - _disabled = ReadWriteAttribute(jsObject: object, name: Keys.disabled) + _baseURL = ReadWriteAttribute(jsObject: object, name: Strings.baseURL) + _media = ReadWriteAttribute(jsObject: object, name: Strings.media) + _disabled = ReadWriteAttribute(jsObject: object, name: Strings.disabled) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift index 2ab3b064..e5bea67b 100644 --- a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift +++ b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class CSSSupportsRule: CSSConditionRule { override public class var constructor: JSFunction { JSObject.global.CSSSupportsRule.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CanvasCompositing.swift b/Sources/DOMKit/WebIDL/CanvasCompositing.swift index 3b6e0f3b..f9de503f 100644 --- a/Sources/DOMKit/WebIDL/CanvasCompositing.swift +++ b/Sources/DOMKit/WebIDL/CanvasCompositing.swift @@ -3,20 +3,15 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let globalAlpha: JSString = "globalAlpha" - static let globalCompositeOperation: JSString = "globalCompositeOperation" -} - public protocol CanvasCompositing: JSBridgedClass {} public extension CanvasCompositing { var globalAlpha: Double { - get { ReadWriteAttribute[Keys.globalAlpha, in: jsObject] } - set { ReadWriteAttribute[Keys.globalAlpha, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] } + set { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] = newValue } } var globalCompositeOperation: String { - get { ReadWriteAttribute[Keys.globalCompositeOperation, in: jsObject] } - set { ReadWriteAttribute[Keys.globalCompositeOperation, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] } + set { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift index cbf4719a..61809f5f 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift @@ -3,18 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let drawImage: JSString = "drawImage" -} - public protocol CanvasDrawImage: JSBridgedClass {} public extension CanvasDrawImage { func drawImage(image: CanvasImageSource, dx: Double, dy: Double) { - _ = jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue()) + _ = jsObject[Strings.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue()) } func drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double) { - _ = jsObject[Keys.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()) + _ = jsObject[Strings.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()) } func drawImage(image: CanvasImageSource, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { @@ -27,6 +23,6 @@ public extension CanvasDrawImage { let _arg6 = dy.jsValue() let _arg7 = dw.jsValue() let _arg8 = dh.jsValue() - _ = jsObject[Keys.drawImage]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + _ = jsObject[Strings.drawImage]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift index d748921c..a5034ccd 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift @@ -3,58 +3,49 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let beginPath: JSString = "beginPath" - static let clip: JSString = "clip" - static let fill: JSString = "fill" - static let isPointInPath: JSString = "isPointInPath" - static let isPointInStroke: JSString = "isPointInStroke" - static let stroke: JSString = "stroke" -} - public protocol CanvasDrawPath: JSBridgedClass {} public extension CanvasDrawPath { func beginPath() { - _ = jsObject[Keys.beginPath]!() + _ = jsObject[Strings.beginPath]!() } func fill(fillRule: CanvasFillRule? = nil) { - _ = jsObject[Keys.fill]!(fillRule?.jsValue() ?? .undefined) + _ = jsObject[Strings.fill]!(fillRule?.jsValue() ?? .undefined) } func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { - _ = jsObject[Keys.fill]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + _ = jsObject[Strings.fill]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) } func stroke() { - _ = jsObject[Keys.stroke]!() + _ = jsObject[Strings.stroke]!() } func stroke(path: Path2D) { - _ = jsObject[Keys.stroke]!(path.jsValue()) + _ = jsObject[Strings.stroke]!(path.jsValue()) } func clip(fillRule: CanvasFillRule? = nil) { - _ = jsObject[Keys.clip]!(fillRule?.jsValue() ?? .undefined) + _ = jsObject[Strings.clip]!(fillRule?.jsValue() ?? .undefined) } func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { - _ = jsObject[Keys.clip]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + _ = jsObject[Strings.clip]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) } func isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { - jsObject[Keys.isPointInPath]!(x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.isPointInPath]!(x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! } func isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { - jsObject[Keys.isPointInPath]!(path.jsValue(), x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.isPointInPath]!(path.jsValue(), x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! } func isPointInStroke(x: Double, y: Double) -> Bool { - jsObject[Keys.isPointInStroke]!(x.jsValue(), y.jsValue()).fromJSValue()! + jsObject[Strings.isPointInStroke]!(x.jsValue(), y.jsValue()).fromJSValue()! } func isPointInStroke(path: Path2D, x: Double, y: Double) -> Bool { - jsObject[Keys.isPointInStroke]!(path.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + jsObject[Strings.isPointInStroke]!(path.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift index 3efa41a0..ee82b6e1 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift @@ -3,29 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let createConicGradient: JSString = "createConicGradient" - static let createLinearGradient: JSString = "createLinearGradient" - static let createPattern: JSString = "createPattern" - static let createRadialGradient: JSString = "createRadialGradient" - static let fillStyle: JSString = "fillStyle" - static let strokeStyle: JSString = "strokeStyle" -} - public protocol CanvasFillStrokeStyles: JSBridgedClass {} public extension CanvasFillStrokeStyles { var strokeStyle: __UNSUPPORTED_UNION__ { - get { ReadWriteAttribute[Keys.strokeStyle, in: jsObject] } - set { ReadWriteAttribute[Keys.strokeStyle, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] } + set { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] = newValue } } var fillStyle: __UNSUPPORTED_UNION__ { - get { ReadWriteAttribute[Keys.fillStyle, in: jsObject] } - set { ReadWriteAttribute[Keys.fillStyle, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.fillStyle, in: jsObject] } + set { ReadWriteAttribute[Strings.fillStyle, in: jsObject] = newValue } } func createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double) -> CanvasGradient { - jsObject[Keys.createLinearGradient]!(x0.jsValue(), y0.jsValue(), x1.jsValue(), y1.jsValue()).fromJSValue()! + jsObject[Strings.createLinearGradient]!(x0.jsValue(), y0.jsValue(), x1.jsValue(), y1.jsValue()).fromJSValue()! } func createRadialGradient(x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double) -> CanvasGradient { @@ -35,14 +26,14 @@ public extension CanvasFillStrokeStyles { let _arg3 = x1.jsValue() let _arg4 = y1.jsValue() let _arg5 = r1.jsValue() - return jsObject[Keys.createRadialGradient]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + return jsObject[Strings.createRadialGradient]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } func createConicGradient(startAngle: Double, x: Double, y: Double) -> CanvasGradient { - jsObject[Keys.createConicGradient]!(startAngle.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + jsObject[Strings.createConicGradient]!(startAngle.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! } func createPattern(image: CanvasImageSource, repetition: String) -> CanvasPattern? { - jsObject[Keys.createPattern]!(image.jsValue(), repetition.jsValue()).fromJSValue()! + jsObject[Strings.createPattern]!(image.jsValue(), repetition.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasFilter.swift b/Sources/DOMKit/WebIDL/CanvasFilter.swift index 44ca389c..cea985b1 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilter.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilter.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class CanvasFilter: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CanvasFilter.function! } - private enum Keys {} - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/CanvasFilters.swift b/Sources/DOMKit/WebIDL/CanvasFilters.swift index e9f4af22..4786890a 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilters.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilters.swift @@ -3,14 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let filter: JSString = "filter" -} - public protocol CanvasFilters: JSBridgedClass {} public extension CanvasFilters { var filter: __UNSUPPORTED_UNION__ { - get { ReadWriteAttribute[Keys.filter, in: jsObject] } - set { ReadWriteAttribute[Keys.filter, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.filter, in: jsObject] } + set { ReadWriteAttribute[Strings.filter, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasGradient.swift b/Sources/DOMKit/WebIDL/CanvasGradient.swift index f8d39af1..f64bb4d6 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient.swift @@ -6,10 +6,6 @@ import JavaScriptKit public class CanvasGradient: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CanvasGradient.function! } - private enum Keys { - static let addColorStop: JSString = "addColorStop" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,6 +13,6 @@ public class CanvasGradient: JSBridgedClass { } public func addColorStop(offset: Double, color: String) { - _ = jsObject[Keys.addColorStop]!(offset.jsValue(), color.jsValue()) + _ = jsObject[Strings.addColorStop]!(offset.jsValue(), color.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CanvasImageData.swift b/Sources/DOMKit/WebIDL/CanvasImageData.swift index 6de10b80..7925cac9 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageData.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageData.swift @@ -3,28 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let createImageData: JSString = "createImageData" - static let getImageData: JSString = "getImageData" - static let putImageData: JSString = "putImageData" -} - public protocol CanvasImageData: JSBridgedClass {} public extension CanvasImageData { func createImageData(sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { - jsObject[Keys.createImageData]!(sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.createImageData]!(sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! } func createImageData(imagedata: ImageData) -> ImageData { - jsObject[Keys.createImageData]!(imagedata.jsValue()).fromJSValue()! + jsObject[Strings.createImageData]!(imagedata.jsValue()).fromJSValue()! } func getImageData(sx: Int32, sy: Int32, sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { - jsObject[Keys.getImageData]!(sx.jsValue(), sy.jsValue(), sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.getImageData]!(sx.jsValue(), sy.jsValue(), sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { - _ = jsObject[Keys.putImageData]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()) + _ = jsObject[Strings.putImageData]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()) } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32, dirtyX: Int32, dirtyY: Int32, dirtyWidth: Int32, dirtyHeight: Int32) { @@ -35,6 +29,6 @@ public extension CanvasImageData { let _arg4 = dirtyY.jsValue() let _arg5 = dirtyWidth.jsValue() let _arg6 = dirtyHeight.jsValue() - _ = jsObject[Keys.putImageData]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + _ = jsObject[Strings.putImageData]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) } } diff --git a/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift index 7eef7326..b9d5a820 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift @@ -3,20 +3,15 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let imageSmoothingEnabled: JSString = "imageSmoothingEnabled" - static let imageSmoothingQuality: JSString = "imageSmoothingQuality" -} - public protocol CanvasImageSmoothing: JSBridgedClass {} public extension CanvasImageSmoothing { var imageSmoothingEnabled: Bool { - get { ReadWriteAttribute[Keys.imageSmoothingEnabled, in: jsObject] } - set { ReadWriteAttribute[Keys.imageSmoothingEnabled, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] } + set { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] = newValue } } var imageSmoothingQuality: ImageSmoothingQuality { - get { ReadWriteAttribute[Keys.imageSmoothingQuality, in: jsObject] } - set { ReadWriteAttribute[Keys.imageSmoothingQuality, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] } + set { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasPath.swift b/Sources/DOMKit/WebIDL/CanvasPath.swift index 523128e2..8e4c001c 100644 --- a/Sources/DOMKit/WebIDL/CanvasPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasPath.swift @@ -3,35 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let arc: JSString = "arc" - static let arcTo: JSString = "arcTo" - static let bezierCurveTo: JSString = "bezierCurveTo" - static let closePath: JSString = "closePath" - static let ellipse: JSString = "ellipse" - static let lineTo: JSString = "lineTo" - static let moveTo: JSString = "moveTo" - static let quadraticCurveTo: JSString = "quadraticCurveTo" - static let rect: JSString = "rect" - static let roundRect: JSString = "roundRect" -} - public protocol CanvasPath: JSBridgedClass {} public extension CanvasPath { func closePath() { - _ = jsObject[Keys.closePath]!() + _ = jsObject[Strings.closePath]!() } func moveTo(x: Double, y: Double) { - _ = jsObject[Keys.moveTo]!(x.jsValue(), y.jsValue()) + _ = jsObject[Strings.moveTo]!(x.jsValue(), y.jsValue()) } func lineTo(x: Double, y: Double) { - _ = jsObject[Keys.lineTo]!(x.jsValue(), y.jsValue()) + _ = jsObject[Strings.lineTo]!(x.jsValue(), y.jsValue()) } func quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double) { - _ = jsObject[Keys.quadraticCurveTo]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()) + _ = jsObject[Strings.quadraticCurveTo]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()) } func bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double) { @@ -41,19 +28,19 @@ public extension CanvasPath { let _arg3 = cp2y.jsValue() let _arg4 = x.jsValue() let _arg5 = y.jsValue() - _ = jsObject[Keys.bezierCurveTo]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + _ = jsObject[Strings.bezierCurveTo]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) { - _ = jsObject[Keys.arcTo]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()) + _ = jsObject[Strings.arcTo]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()) } func rect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Keys.rect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + _ = jsObject[Strings.rect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } func roundRect(x: Double, y: Double, w: Double, h: Double, radii: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.roundRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined) + _ = jsObject[Strings.roundRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined) } func arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -63,7 +50,7 @@ public extension CanvasPath { let _arg3 = startAngle.jsValue() let _arg4 = endAngle.jsValue() let _arg5 = counterclockwise?.jsValue() ?? .undefined - _ = jsObject[Keys.arc]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + _ = jsObject[Strings.arc]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -75,6 +62,6 @@ public extension CanvasPath { let _arg5 = startAngle.jsValue() let _arg6 = endAngle.jsValue() let _arg7 = counterclockwise?.jsValue() ?? .undefined - _ = jsObject[Keys.ellipse]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + _ = jsObject[Strings.ellipse]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift index 38eddef1..b1cd6b25 100644 --- a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift @@ -3,48 +3,38 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let getLineDash: JSString = "getLineDash" - static let lineCap: JSString = "lineCap" - static let lineDashOffset: JSString = "lineDashOffset" - static let lineJoin: JSString = "lineJoin" - static let lineWidth: JSString = "lineWidth" - static let miterLimit: JSString = "miterLimit" - static let setLineDash: JSString = "setLineDash" -} - public protocol CanvasPathDrawingStyles: JSBridgedClass {} public extension CanvasPathDrawingStyles { var lineWidth: Double { - get { ReadWriteAttribute[Keys.lineWidth, in: jsObject] } - set { ReadWriteAttribute[Keys.lineWidth, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.lineWidth, in: jsObject] } + set { ReadWriteAttribute[Strings.lineWidth, in: jsObject] = newValue } } var lineCap: CanvasLineCap { - get { ReadWriteAttribute[Keys.lineCap, in: jsObject] } - set { ReadWriteAttribute[Keys.lineCap, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.lineCap, in: jsObject] } + set { ReadWriteAttribute[Strings.lineCap, in: jsObject] = newValue } } var lineJoin: CanvasLineJoin { - get { ReadWriteAttribute[Keys.lineJoin, in: jsObject] } - set { ReadWriteAttribute[Keys.lineJoin, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.lineJoin, in: jsObject] } + set { ReadWriteAttribute[Strings.lineJoin, in: jsObject] = newValue } } var miterLimit: Double { - get { ReadWriteAttribute[Keys.miterLimit, in: jsObject] } - set { ReadWriteAttribute[Keys.miterLimit, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.miterLimit, in: jsObject] } + set { ReadWriteAttribute[Strings.miterLimit, in: jsObject] = newValue } } func setLineDash(segments: [Double]) { - _ = jsObject[Keys.setLineDash]!(segments.jsValue()) + _ = jsObject[Strings.setLineDash]!(segments.jsValue()) } func getLineDash() -> [Double] { - jsObject[Keys.getLineDash]!().fromJSValue()! + jsObject[Strings.getLineDash]!().fromJSValue()! } var lineDashOffset: Double { - get { ReadWriteAttribute[Keys.lineDashOffset, in: jsObject] } - set { ReadWriteAttribute[Keys.lineDashOffset, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] } + set { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasPattern.swift b/Sources/DOMKit/WebIDL/CanvasPattern.swift index 907d418d..e41f4b3b 100644 --- a/Sources/DOMKit/WebIDL/CanvasPattern.swift +++ b/Sources/DOMKit/WebIDL/CanvasPattern.swift @@ -6,10 +6,6 @@ import JavaScriptKit public class CanvasPattern: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CanvasPattern.function! } - private enum Keys { - static let setTransform: JSString = "setTransform" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,6 +13,6 @@ public class CanvasPattern: JSBridgedClass { } public func setTransform(transform: DOMMatrix2DInit? = nil) { - _ = jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined) + _ = jsObject[Strings.setTransform]!(transform?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CanvasRect.swift b/Sources/DOMKit/WebIDL/CanvasRect.swift index 999fa9bf..6bf9205b 100644 --- a/Sources/DOMKit/WebIDL/CanvasRect.swift +++ b/Sources/DOMKit/WebIDL/CanvasRect.swift @@ -3,23 +3,17 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let clearRect: JSString = "clearRect" - static let fillRect: JSString = "fillRect" - static let strokeRect: JSString = "strokeRect" -} - public protocol CanvasRect: JSBridgedClass {} public extension CanvasRect { func clearRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Keys.clearRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + _ = jsObject[Strings.clearRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } func fillRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Keys.fillRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + _ = jsObject[Strings.fillRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } func strokeRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Keys.strokeRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + _ = jsObject[Strings.strokeRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift index 4b678cc8..7cb568cf 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { public class var constructor: JSFunction { JSObject.global.CanvasRenderingContext2D.function! } - private enum Keys { - static let canvas: JSString = "canvas" - static let getContextAttributes: JSString = "getContextAttributes" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _canvas = ReadonlyAttribute(jsObject: jsObject, name: Keys.canvas) + _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) self.jsObject = jsObject } @@ -22,6 +17,6 @@ public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransf public var canvas: HTMLCanvasElement public func getContextAttributes() -> CanvasRenderingContext2DSettings { - jsObject[Keys.getContextAttributes]!().fromJSValue()! + jsObject[Strings.getContextAttributes]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift index 83002bdd..1a61ca15 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift @@ -4,27 +4,20 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasRenderingContext2DSettings: BridgedDictionary { - private enum Keys { - static let alpha: JSString = "alpha" - static let colorSpace: JSString = "colorSpace" - static let desynchronized: JSString = "desynchronized" - static let willReadFrequently: JSString = "willReadFrequently" - } - public convenience init(alpha: Bool, desynchronized: Bool, colorSpace: PredefinedColorSpace, willReadFrequently: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.alpha] = alpha.jsValue() - object[Keys.desynchronized] = desynchronized.jsValue() - object[Keys.colorSpace] = colorSpace.jsValue() - object[Keys.willReadFrequently] = willReadFrequently.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) { - _alpha = ReadWriteAttribute(jsObject: object, name: Keys.alpha) - _desynchronized = ReadWriteAttribute(jsObject: object, name: Keys.desynchronized) - _colorSpace = ReadWriteAttribute(jsObject: object, name: Keys.colorSpace) - _willReadFrequently = ReadWriteAttribute(jsObject: object, name: Keys.willReadFrequently) + _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) } diff --git a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift index 8f870bd3..2257c8f3 100644 --- a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift @@ -3,32 +3,25 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let shadowBlur: JSString = "shadowBlur" - static let shadowColor: JSString = "shadowColor" - static let shadowOffsetX: JSString = "shadowOffsetX" - static let shadowOffsetY: JSString = "shadowOffsetY" -} - public protocol CanvasShadowStyles: JSBridgedClass {} public extension CanvasShadowStyles { var shadowOffsetX: Double { - get { ReadWriteAttribute[Keys.shadowOffsetX, in: jsObject] } - set { ReadWriteAttribute[Keys.shadowOffsetX, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] } + set { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] = newValue } } var shadowOffsetY: Double { - get { ReadWriteAttribute[Keys.shadowOffsetY, in: jsObject] } - set { ReadWriteAttribute[Keys.shadowOffsetY, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] } + set { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] = newValue } } var shadowBlur: Double { - get { ReadWriteAttribute[Keys.shadowBlur, in: jsObject] } - set { ReadWriteAttribute[Keys.shadowBlur, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] } + set { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] = newValue } } var shadowColor: String { - get { ReadWriteAttribute[Keys.shadowColor, in: jsObject] } - set { ReadWriteAttribute[Keys.shadowColor, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.shadowColor, in: jsObject] } + set { ReadWriteAttribute[Strings.shadowColor, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasState.swift b/Sources/DOMKit/WebIDL/CanvasState.swift index 001c4ddf..6cc154be 100644 --- a/Sources/DOMKit/WebIDL/CanvasState.swift +++ b/Sources/DOMKit/WebIDL/CanvasState.swift @@ -3,28 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let isContextLost: JSString = "isContextLost" - static let reset: JSString = "reset" - static let restore: JSString = "restore" - static let save: JSString = "save" -} - public protocol CanvasState: JSBridgedClass {} public extension CanvasState { func save() { - _ = jsObject[Keys.save]!() + _ = jsObject[Strings.save]!() } func restore() { - _ = jsObject[Keys.restore]!() + _ = jsObject[Strings.restore]!() } func reset() { - _ = jsObject[Keys.reset]!() + _ = jsObject[Strings.reset]!() } func isContextLost() -> Bool { - jsObject[Keys.isContextLost]!().fromJSValue()! + jsObject[Strings.isContextLost]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasText.swift b/Sources/DOMKit/WebIDL/CanvasText.swift index e7611071..e3f3f80f 100644 --- a/Sources/DOMKit/WebIDL/CanvasText.swift +++ b/Sources/DOMKit/WebIDL/CanvasText.swift @@ -3,23 +3,17 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let fillText: JSString = "fillText" - static let measureText: JSString = "measureText" - static let strokeText: JSString = "strokeText" -} - public protocol CanvasText: JSBridgedClass {} public extension CanvasText { func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - _ = jsObject[Keys.fillText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + _ = jsObject[Strings.fillText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) } func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - _ = jsObject[Keys.strokeText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + _ = jsObject[Strings.strokeText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) } func measureText(text: String) -> TextMetrics { - jsObject[Keys.measureText]!(text.jsValue()).fromJSValue()! + jsObject[Strings.measureText]!(text.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift index b995c050..011c1563 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift @@ -3,68 +3,55 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let direction: JSString = "direction" - static let font: JSString = "font" - static let fontKerning: JSString = "fontKerning" - static let fontStretch: JSString = "fontStretch" - static let fontVariantCaps: JSString = "fontVariantCaps" - static let letterSpacing: JSString = "letterSpacing" - static let textAlign: JSString = "textAlign" - static let textBaseline: JSString = "textBaseline" - static let textRendering: JSString = "textRendering" - static let wordSpacing: JSString = "wordSpacing" -} - public protocol CanvasTextDrawingStyles: JSBridgedClass {} public extension CanvasTextDrawingStyles { var font: String { - get { ReadWriteAttribute[Keys.font, in: jsObject] } - set { ReadWriteAttribute[Keys.font, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.font, in: jsObject] } + set { ReadWriteAttribute[Strings.font, in: jsObject] = newValue } } var textAlign: CanvasTextAlign { - get { ReadWriteAttribute[Keys.textAlign, in: jsObject] } - set { ReadWriteAttribute[Keys.textAlign, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.textAlign, in: jsObject] } + set { ReadWriteAttribute[Strings.textAlign, in: jsObject] = newValue } } var textBaseline: CanvasTextBaseline { - get { ReadWriteAttribute[Keys.textBaseline, in: jsObject] } - set { ReadWriteAttribute[Keys.textBaseline, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.textBaseline, in: jsObject] } + set { ReadWriteAttribute[Strings.textBaseline, in: jsObject] = newValue } } var direction: CanvasDirection { - get { ReadWriteAttribute[Keys.direction, in: jsObject] } - set { ReadWriteAttribute[Keys.direction, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.direction, in: jsObject] } + set { ReadWriteAttribute[Strings.direction, in: jsObject] = newValue } } var letterSpacing: String { - get { ReadWriteAttribute[Keys.letterSpacing, in: jsObject] } - set { ReadWriteAttribute[Keys.letterSpacing, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] } + set { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] = newValue } } var fontKerning: CanvasFontKerning { - get { ReadWriteAttribute[Keys.fontKerning, in: jsObject] } - set { ReadWriteAttribute[Keys.fontKerning, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.fontKerning, in: jsObject] } + set { ReadWriteAttribute[Strings.fontKerning, in: jsObject] = newValue } } var fontStretch: CanvasFontStretch { - get { ReadWriteAttribute[Keys.fontStretch, in: jsObject] } - set { ReadWriteAttribute[Keys.fontStretch, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.fontStretch, in: jsObject] } + set { ReadWriteAttribute[Strings.fontStretch, in: jsObject] = newValue } } var fontVariantCaps: CanvasFontVariantCaps { - get { ReadWriteAttribute[Keys.fontVariantCaps, in: jsObject] } - set { ReadWriteAttribute[Keys.fontVariantCaps, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] } + set { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] = newValue } } var textRendering: CanvasTextRendering { - get { ReadWriteAttribute[Keys.textRendering, in: jsObject] } - set { ReadWriteAttribute[Keys.textRendering, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.textRendering, in: jsObject] } + set { ReadWriteAttribute[Strings.textRendering, in: jsObject] = newValue } } var wordSpacing: String { - get { ReadWriteAttribute[Keys.wordSpacing, in: jsObject] } - set { ReadWriteAttribute[Keys.wordSpacing, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] } + set { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasTransform.swift b/Sources/DOMKit/WebIDL/CanvasTransform.swift index 744b0f19..597fec8a 100644 --- a/Sources/DOMKit/WebIDL/CanvasTransform.swift +++ b/Sources/DOMKit/WebIDL/CanvasTransform.swift @@ -3,28 +3,18 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let getTransform: JSString = "getTransform" - static let resetTransform: JSString = "resetTransform" - static let rotate: JSString = "rotate" - static let scale: JSString = "scale" - static let setTransform: JSString = "setTransform" - static let transform: JSString = "transform" - static let translate: JSString = "translate" -} - public protocol CanvasTransform: JSBridgedClass {} public extension CanvasTransform { func scale(x: Double, y: Double) { - _ = jsObject[Keys.scale]!(x.jsValue(), y.jsValue()) + _ = jsObject[Strings.scale]!(x.jsValue(), y.jsValue()) } func rotate(angle: Double) { - _ = jsObject[Keys.rotate]!(angle.jsValue()) + _ = jsObject[Strings.rotate]!(angle.jsValue()) } func translate(x: Double, y: Double) { - _ = jsObject[Keys.translate]!(x.jsValue(), y.jsValue()) + _ = jsObject[Strings.translate]!(x.jsValue(), y.jsValue()) } func transform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { @@ -34,11 +24,11 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - _ = jsObject[Keys.transform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + _ = jsObject[Strings.transform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func getTransform() -> DOMMatrix { - jsObject[Keys.getTransform]!().fromJSValue()! + jsObject[Strings.getTransform]!().fromJSValue()! } func setTransform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { @@ -48,14 +38,14 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - _ = jsObject[Keys.setTransform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + _ = jsObject[Strings.setTransform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) } func setTransform(transform: DOMMatrix2DInit? = nil) { - _ = jsObject[Keys.setTransform]!(transform?.jsValue() ?? .undefined) + _ = jsObject[Strings.setTransform]!(transform?.jsValue() ?? .undefined) } func resetTransform() { - _ = jsObject[Keys.resetTransform]!() + _ = jsObject[Strings.resetTransform]!() } } diff --git a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift index 4faa8dc9..c64641cd 100644 --- a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift +++ b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift @@ -3,26 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded" - static let scrollPathIntoView: JSString = "scrollPathIntoView" -} - public protocol CanvasUserInterface: JSBridgedClass {} public extension CanvasUserInterface { func drawFocusIfNeeded(element: Element) { - _ = jsObject[Keys.drawFocusIfNeeded]!(element.jsValue()) + _ = jsObject[Strings.drawFocusIfNeeded]!(element.jsValue()) } func drawFocusIfNeeded(path: Path2D, element: Element) { - _ = jsObject[Keys.drawFocusIfNeeded]!(path.jsValue(), element.jsValue()) + _ = jsObject[Strings.drawFocusIfNeeded]!(path.jsValue(), element.jsValue()) } func scrollPathIntoView() { - _ = jsObject[Keys.scrollPathIntoView]!() + _ = jsObject[Strings.scrollPathIntoView]!() } func scrollPathIntoView(path: Path2D) { - _ = jsObject[Keys.scrollPathIntoView]!(path.jsValue()) + _ = jsObject[Strings.scrollPathIntoView]!(path.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CharacterData.swift b/Sources/DOMKit/WebIDL/CharacterData.swift index 53330197..03a8d56c 100644 --- a/Sources/DOMKit/WebIDL/CharacterData.swift +++ b/Sources/DOMKit/WebIDL/CharacterData.swift @@ -6,19 +6,9 @@ import JavaScriptKit public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { override public class var constructor: JSFunction { JSObject.global.CharacterData.function! } - private enum Keys { - static let appendData: JSString = "appendData" - static let data: JSString = "data" - static let deleteData: JSString = "deleteData" - static let insertData: JSString = "insertData" - static let length: JSString = "length" - static let replaceData: JSString = "replaceData" - static let substringData: JSString = "substringData" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadWriteAttribute(jsObject: jsObject, name: Keys.data) - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) super.init(unsafelyWrapping: jsObject) } @@ -29,22 +19,22 @@ public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { public var length: UInt32 public func substringData(offset: UInt32, count: UInt32) -> String { - jsObject[Keys.substringData]!(offset.jsValue(), count.jsValue()).fromJSValue()! + jsObject[Strings.substringData]!(offset.jsValue(), count.jsValue()).fromJSValue()! } public func appendData(data: String) { - _ = jsObject[Keys.appendData]!(data.jsValue()) + _ = jsObject[Strings.appendData]!(data.jsValue()) } public func insertData(offset: UInt32, data: String) { - _ = jsObject[Keys.insertData]!(offset.jsValue(), data.jsValue()) + _ = jsObject[Strings.insertData]!(offset.jsValue(), data.jsValue()) } public func deleteData(offset: UInt32, count: UInt32) { - _ = jsObject[Keys.deleteData]!(offset.jsValue(), count.jsValue()) + _ = jsObject[Strings.deleteData]!(offset.jsValue(), count.jsValue()) } public func replaceData(offset: UInt32, count: UInt32, data: String) { - _ = jsObject[Keys.replaceData]!(offset.jsValue(), count.jsValue(), data.jsValue()) + _ = jsObject[Strings.replaceData]!(offset.jsValue(), count.jsValue(), data.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ChildNode.swift b/Sources/DOMKit/WebIDL/ChildNode.swift index 5a833ac3..5d0ec263 100644 --- a/Sources/DOMKit/WebIDL/ChildNode.swift +++ b/Sources/DOMKit/WebIDL/ChildNode.swift @@ -3,28 +3,21 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let after: JSString = "after" - static let before: JSString = "before" - static let remove: JSString = "remove" - static let replaceWith: JSString = "replaceWith" -} - public protocol ChildNode: JSBridgedClass {} public extension ChildNode { func before(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.before]!(nodes.jsValue()) + _ = jsObject[Strings.before]!(nodes.jsValue()) } func after(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.after]!(nodes.jsValue()) + _ = jsObject[Strings.after]!(nodes.jsValue()) } func replaceWith(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.replaceWith]!(nodes.jsValue()) + _ = jsObject[Strings.replaceWith]!(nodes.jsValue()) } func remove() { - _ = jsObject[Keys.remove]!() + _ = jsObject[Strings.remove]!() } } diff --git a/Sources/DOMKit/WebIDL/Comment.swift b/Sources/DOMKit/WebIDL/Comment.swift index 71d47cc9..bce14aa1 100644 --- a/Sources/DOMKit/WebIDL/Comment.swift +++ b/Sources/DOMKit/WebIDL/Comment.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class Comment: CharacterData { override public class var constructor: JSFunction { JSObject.global.Comment.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index d284b152..e51c4331 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -6,13 +6,8 @@ import JavaScriptKit public class CompositionEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.CompositionEvent.function! } - private enum Keys { - static let data: JSString = "data" - static let initCompositionEvent: JSString = "initCompositionEvent" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Keys.data) + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) super.init(unsafelyWrapping: jsObject) } @@ -24,6 +19,6 @@ public class CompositionEvent: UIEvent { public var data: String public func initCompositionEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: WindowProxy? = nil, dataArg: String? = nil) { - _ = jsObject[Keys.initCompositionEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.jsValue() ?? .undefined) + _ = jsObject[Strings.initCompositionEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CompositionEventInit.swift b/Sources/DOMKit/WebIDL/CompositionEventInit.swift index b711fcfd..f6bbaa20 100644 --- a/Sources/DOMKit/WebIDL/CompositionEventInit.swift +++ b/Sources/DOMKit/WebIDL/CompositionEventInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CompositionEventInit: BridgedDictionary { - private enum Keys { - static let data: JSString = "data" - } - public convenience init(data: String) { let object = JSObject.global.Object.function!.new() - object[Keys.data] = data.jsValue() + object[Strings.data] = data.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _data = ReadWriteAttribute(jsObject: object, name: Keys.data) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift index c0013845..94f41926 100644 --- a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift @@ -6,16 +6,11 @@ import JavaScriptKit public class CountQueuingStrategy: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CountQueuingStrategy.function! } - private enum Keys { - static let highWaterMark: JSString = "highWaterMark" - static let size: JSString = "size" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Keys.highWaterMark) - _size = ReadonlyAttribute(jsObject: jsObject, name: Keys.size) + _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Strings.highWaterMark) + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index 72301429..4010fd9d 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -6,13 +6,6 @@ import JavaScriptKit public class CustomElementRegistry: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.CustomElementRegistry.function! } - private enum Keys { - static let define: JSString = "define" - static let get: JSString = "get" - static let upgrade: JSString = "upgrade" - static let whenDefined: JSString = "whenDefined" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -22,7 +15,7 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'define' is ignored public func get(name: String) -> __UNSUPPORTED_UNION__ { - jsObject[Keys.get]!(name.jsValue()).fromJSValue()! + jsObject[Strings.get]!(name.jsValue()).fromJSValue()! } // XXX: member 'whenDefined' is ignored @@ -30,6 +23,6 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'whenDefined' is ignored public func upgrade(root: Node) { - _ = jsObject[Keys.upgrade]!(root.jsValue()) + _ = jsObject[Strings.upgrade]!(root.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index 685b8e7b..54874201 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -6,13 +6,8 @@ import JavaScriptKit public class CustomEvent: Event { override public class var constructor: JSFunction { JSObject.global.CustomEvent.function! } - private enum Keys { - static let detail: JSString = "detail" - static let initCustomEvent: JSString = "initCustomEvent" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _detail = ReadonlyAttribute(jsObject: jsObject, name: Keys.detail) + _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) super.init(unsafelyWrapping: jsObject) } @@ -24,6 +19,6 @@ public class CustomEvent: Event { public var detail: JSValue public func initCustomEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, detail: JSValue? = nil) { - _ = jsObject[Keys.initCustomEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined) + _ = jsObject[Strings.initCustomEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/CustomEventInit.swift b/Sources/DOMKit/WebIDL/CustomEventInit.swift index 7403484f..87edc8da 100644 --- a/Sources/DOMKit/WebIDL/CustomEventInit.swift +++ b/Sources/DOMKit/WebIDL/CustomEventInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CustomEventInit: BridgedDictionary { - private enum Keys { - static let detail: JSString = "detail" - } - public convenience init(detail: JSValue) { let object = JSObject.global.Object.function!.new() - object[Keys.detail] = detail.jsValue() + object[Strings.detail] = detail.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _detail = ReadWriteAttribute(jsObject: object, name: Keys.detail) + _detail = ReadWriteAttribute(jsObject: object, name: Strings.detail) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMException.swift b/Sources/DOMKit/WebIDL/DOMException.swift index c810d284..6f934c6f 100644 --- a/Sources/DOMKit/WebIDL/DOMException.swift +++ b/Sources/DOMKit/WebIDL/DOMException.swift @@ -6,43 +6,12 @@ import JavaScriptKit public class DOMException: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMException.function! } - private enum Keys { - static let ABORT_ERR: JSString = "ABORT_ERR" - static let DATA_CLONE_ERR: JSString = "DATA_CLONE_ERR" - static let DOMSTRING_SIZE_ERR: JSString = "DOMSTRING_SIZE_ERR" - static let HIERARCHY_REQUEST_ERR: JSString = "HIERARCHY_REQUEST_ERR" - static let INDEX_SIZE_ERR: JSString = "INDEX_SIZE_ERR" - static let INUSE_ATTRIBUTE_ERR: JSString = "INUSE_ATTRIBUTE_ERR" - static let INVALID_ACCESS_ERR: JSString = "INVALID_ACCESS_ERR" - static let INVALID_CHARACTER_ERR: JSString = "INVALID_CHARACTER_ERR" - static let INVALID_MODIFICATION_ERR: JSString = "INVALID_MODIFICATION_ERR" - static let INVALID_NODE_TYPE_ERR: JSString = "INVALID_NODE_TYPE_ERR" - static let INVALID_STATE_ERR: JSString = "INVALID_STATE_ERR" - static let NAMESPACE_ERR: JSString = "NAMESPACE_ERR" - static let NETWORK_ERR: JSString = "NETWORK_ERR" - static let NOT_FOUND_ERR: JSString = "NOT_FOUND_ERR" - static let NOT_SUPPORTED_ERR: JSString = "NOT_SUPPORTED_ERR" - static let NO_DATA_ALLOWED_ERR: JSString = "NO_DATA_ALLOWED_ERR" - static let NO_MODIFICATION_ALLOWED_ERR: JSString = "NO_MODIFICATION_ALLOWED_ERR" - static let QUOTA_EXCEEDED_ERR: JSString = "QUOTA_EXCEEDED_ERR" - static let SECURITY_ERR: JSString = "SECURITY_ERR" - static let SYNTAX_ERR: JSString = "SYNTAX_ERR" - static let TIMEOUT_ERR: JSString = "TIMEOUT_ERR" - static let TYPE_MISMATCH_ERR: JSString = "TYPE_MISMATCH_ERR" - static let URL_MISMATCH_ERR: JSString = "URL_MISMATCH_ERR" - static let VALIDATION_ERR: JSString = "VALIDATION_ERR" - static let WRONG_DOCUMENT_ERR: JSString = "WRONG_DOCUMENT_ERR" - static let code: JSString = "code" - static let message: JSString = "message" - static let name: JSString = "name" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) - _message = ReadonlyAttribute(jsObject: jsObject, name: Keys.message) - _code = ReadonlyAttribute(jsObject: jsObject, name: Keys.code) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/DOMImplementation.swift b/Sources/DOMKit/WebIDL/DOMImplementation.swift index 29f8dede..b837fe1a 100644 --- a/Sources/DOMKit/WebIDL/DOMImplementation.swift +++ b/Sources/DOMKit/WebIDL/DOMImplementation.swift @@ -6,13 +6,6 @@ import JavaScriptKit public class DOMImplementation: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMImplementation.function! } - private enum Keys { - static let createDocument: JSString = "createDocument" - static let createDocumentType: JSString = "createDocumentType" - static let createHTMLDocument: JSString = "createHTMLDocument" - static let hasFeature: JSString = "hasFeature" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -20,18 +13,18 @@ public class DOMImplementation: JSBridgedClass { } public func createDocumentType(qualifiedName: String, publicId: String, systemId: String) -> DocumentType { - jsObject[Keys.createDocumentType]!(qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()).fromJSValue()! + jsObject[Strings.createDocumentType]!(qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()).fromJSValue()! } public func createDocument(namespace: String?, qualifiedName: String, doctype: DocumentType? = nil) -> XMLDocument { - jsObject[Keys.createDocument]!(namespace.jsValue(), qualifiedName.jsValue(), doctype?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.createDocument]!(namespace.jsValue(), qualifiedName.jsValue(), doctype?.jsValue() ?? .undefined).fromJSValue()! } public func createHTMLDocument(title: String? = nil) -> Document { - jsObject[Keys.createHTMLDocument]!(title?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.createHTMLDocument]!(title?.jsValue() ?? .undefined).fromJSValue()! } public func hasFeature() -> Bool { - jsObject[Keys.hasFeature]!().fromJSValue()! + jsObject[Strings.hasFeature]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index 912f1a05..36528b74 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -6,69 +6,29 @@ import JavaScriptKit public class DOMMatrix: DOMMatrixReadOnly { override public class var constructor: JSFunction { JSObject.global.DOMMatrix.function! } - private enum Keys { - static let a: JSString = "a" - static let b: JSString = "b" - static let c: JSString = "c" - static let d: JSString = "d" - static let e: JSString = "e" - static let f: JSString = "f" - static let fromFloat32Array: JSString = "fromFloat32Array" - static let fromFloat64Array: JSString = "fromFloat64Array" - static let fromMatrix: JSString = "fromMatrix" - static let invertSelf: JSString = "invertSelf" - static let m11: JSString = "m11" - static let m12: JSString = "m12" - static let m13: JSString = "m13" - static let m14: JSString = "m14" - static let m21: JSString = "m21" - static let m22: JSString = "m22" - static let m23: JSString = "m23" - static let m24: JSString = "m24" - static let m31: JSString = "m31" - static let m32: JSString = "m32" - static let m33: JSString = "m33" - static let m34: JSString = "m34" - static let m41: JSString = "m41" - static let m42: JSString = "m42" - static let m43: JSString = "m43" - static let m44: JSString = "m44" - static let multiplySelf: JSString = "multiplySelf" - static let preMultiplySelf: JSString = "preMultiplySelf" - static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" - static let rotateFromVectorSelf: JSString = "rotateFromVectorSelf" - static let rotateSelf: JSString = "rotateSelf" - static let scale3dSelf: JSString = "scale3dSelf" - static let scaleSelf: JSString = "scaleSelf" - static let setMatrixValue: JSString = "setMatrixValue" - static let skewXSelf: JSString = "skewXSelf" - static let skewYSelf: JSString = "skewYSelf" - static let translateSelf: JSString = "translateSelf" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _a = ReadWriteAttribute(jsObject: jsObject, name: Keys.a) - _b = ReadWriteAttribute(jsObject: jsObject, name: Keys.b) - _c = ReadWriteAttribute(jsObject: jsObject, name: Keys.c) - _d = ReadWriteAttribute(jsObject: jsObject, name: Keys.d) - _e = ReadWriteAttribute(jsObject: jsObject, name: Keys.e) - _f = ReadWriteAttribute(jsObject: jsObject, name: Keys.f) - _m11 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m11) - _m12 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m12) - _m13 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m13) - _m14 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m14) - _m21 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m21) - _m22 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m22) - _m23 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m23) - _m24 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m24) - _m31 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m31) - _m32 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m32) - _m33 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m33) - _m34 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m34) - _m41 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m41) - _m42 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m42) - _m43 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m43) - _m44 = ReadWriteAttribute(jsObject: jsObject, name: Keys.m44) + _a = ReadWriteAttribute(jsObject: jsObject, name: Strings.a) + _b = ReadWriteAttribute(jsObject: jsObject, name: Strings.b) + _c = ReadWriteAttribute(jsObject: jsObject, name: Strings.c) + _d = ReadWriteAttribute(jsObject: jsObject, name: Strings.d) + _e = ReadWriteAttribute(jsObject: jsObject, name: Strings.e) + _f = ReadWriteAttribute(jsObject: jsObject, name: Strings.f) + _m11 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m11) + _m12 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m12) + _m13 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m13) + _m14 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m14) + _m21 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m21) + _m22 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m22) + _m23 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m23) + _m24 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m24) + _m31 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m31) + _m32 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m32) + _m33 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m33) + _m34 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m34) + _m41 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m41) + _m42 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m42) + _m43 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m43) + _m44 = ReadWriteAttribute(jsObject: jsObject, name: Strings.m44) super.init(unsafelyWrapping: jsObject) } @@ -218,15 +178,15 @@ public class DOMMatrix: DOMMatrixReadOnly { } public func multiplySelf(other: DOMMatrixInit? = nil) -> Self { - jsObject[Keys.multiplySelf]!(other?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.multiplySelf]!(other?.jsValue() ?? .undefined).fromJSValue()! } public func preMultiplySelf(other: DOMMatrixInit? = nil) -> Self { - jsObject[Keys.preMultiplySelf]!(other?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.preMultiplySelf]!(other?.jsValue() ?? .undefined).fromJSValue()! } public func translateSelf(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> Self { - jsObject[Keys.translateSelf]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.translateSelf]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! } public func scaleSelf(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { @@ -236,38 +196,38 @@ public class DOMMatrix: DOMMatrixReadOnly { let _arg3 = originX?.jsValue() ?? .undefined let _arg4 = originY?.jsValue() ?? .undefined let _arg5 = originZ?.jsValue() ?? .undefined - return jsObject[Keys.scaleSelf]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + return jsObject[Strings.scaleSelf]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } public func scale3dSelf(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { - jsObject[Keys.scale3dSelf]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.scale3dSelf]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! } public func rotateSelf(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> Self { - jsObject[Keys.rotateSelf]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.rotateSelf]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! } public func rotateFromVectorSelf(x: Double? = nil, y: Double? = nil) -> Self { - jsObject[Keys.rotateFromVectorSelf]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.rotateFromVectorSelf]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! } public func rotateAxisAngleSelf(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> Self { - jsObject[Keys.rotateAxisAngleSelf]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.rotateAxisAngleSelf]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! } public func skewXSelf(sx: Double? = nil) -> Self { - jsObject[Keys.skewXSelf]!(sx?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.skewXSelf]!(sx?.jsValue() ?? .undefined).fromJSValue()! } public func skewYSelf(sy: Double? = nil) -> Self { - jsObject[Keys.skewYSelf]!(sy?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.skewYSelf]!(sy?.jsValue() ?? .undefined).fromJSValue()! } public func invertSelf() -> Self { - jsObject[Keys.invertSelf]!().fromJSValue()! + jsObject[Strings.invertSelf]!().fromJSValue()! } public func setMatrixValue(transformList: String) -> Self { - jsObject[Keys.setMatrixValue]!(transformList.jsValue()).fromJSValue()! + jsObject[Strings.setMatrixValue]!(transformList.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift index 492463a1..d15b4e41 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift @@ -4,51 +4,36 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMMatrix2DInit: BridgedDictionary { - private enum Keys { - static let a: JSString = "a" - static let b: JSString = "b" - static let c: JSString = "c" - static let d: JSString = "d" - static let e: JSString = "e" - static let f: JSString = "f" - static let m11: JSString = "m11" - static let m12: JSString = "m12" - static let m21: JSString = "m21" - static let m22: JSString = "m22" - static let m41: JSString = "m41" - static let m42: JSString = "m42" - } - public convenience init(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double, m11: Double, m12: Double, m21: Double, m22: Double, m41: Double, m42: Double) { let object = JSObject.global.Object.function!.new() - object[Keys.a] = a.jsValue() - object[Keys.b] = b.jsValue() - object[Keys.c] = c.jsValue() - object[Keys.d] = d.jsValue() - object[Keys.e] = e.jsValue() - object[Keys.f] = f.jsValue() - object[Keys.m11] = m11.jsValue() - object[Keys.m12] = m12.jsValue() - object[Keys.m21] = m21.jsValue() - object[Keys.m22] = m22.jsValue() - object[Keys.m41] = m41.jsValue() - object[Keys.m42] = m42.jsValue() + object[Strings.a] = a.jsValue() + object[Strings.b] = b.jsValue() + object[Strings.c] = c.jsValue() + object[Strings.d] = d.jsValue() + object[Strings.e] = e.jsValue() + object[Strings.f] = f.jsValue() + object[Strings.m11] = m11.jsValue() + object[Strings.m12] = m12.jsValue() + object[Strings.m21] = m21.jsValue() + object[Strings.m22] = m22.jsValue() + object[Strings.m41] = m41.jsValue() + object[Strings.m42] = m42.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _a = ReadWriteAttribute(jsObject: object, name: Keys.a) - _b = ReadWriteAttribute(jsObject: object, name: Keys.b) - _c = ReadWriteAttribute(jsObject: object, name: Keys.c) - _d = ReadWriteAttribute(jsObject: object, name: Keys.d) - _e = ReadWriteAttribute(jsObject: object, name: Keys.e) - _f = ReadWriteAttribute(jsObject: object, name: Keys.f) - _m11 = ReadWriteAttribute(jsObject: object, name: Keys.m11) - _m12 = ReadWriteAttribute(jsObject: object, name: Keys.m12) - _m21 = ReadWriteAttribute(jsObject: object, name: Keys.m21) - _m22 = ReadWriteAttribute(jsObject: object, name: Keys.m22) - _m41 = ReadWriteAttribute(jsObject: object, name: Keys.m41) - _m42 = ReadWriteAttribute(jsObject: object, name: Keys.m42) + _a = ReadWriteAttribute(jsObject: object, name: Strings.a) + _b = ReadWriteAttribute(jsObject: object, name: Strings.b) + _c = ReadWriteAttribute(jsObject: object, name: Strings.c) + _d = ReadWriteAttribute(jsObject: object, name: Strings.d) + _e = ReadWriteAttribute(jsObject: object, name: Strings.e) + _f = ReadWriteAttribute(jsObject: object, name: Strings.f) + _m11 = ReadWriteAttribute(jsObject: object, name: Strings.m11) + _m12 = ReadWriteAttribute(jsObject: object, name: Strings.m12) + _m21 = ReadWriteAttribute(jsObject: object, name: Strings.m21) + _m22 = ReadWriteAttribute(jsObject: object, name: Strings.m22) + _m41 = ReadWriteAttribute(jsObject: object, name: Strings.m41) + _m42 = ReadWriteAttribute(jsObject: object, name: Strings.m42) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift index f9b324b8..8f2d97e7 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift @@ -4,48 +4,34 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMMatrixInit: BridgedDictionary { - private enum Keys { - static let is2D: JSString = "is2D" - static let m13: JSString = "m13" - static let m14: JSString = "m14" - static let m23: JSString = "m23" - static let m24: JSString = "m24" - static let m31: JSString = "m31" - static let m32: JSString = "m32" - static let m33: JSString = "m33" - static let m34: JSString = "m34" - static let m43: JSString = "m43" - static let m44: JSString = "m44" - } - public convenience init(m13: Double, m14: Double, m23: Double, m24: Double, m31: Double, m32: Double, m33: Double, m34: Double, m43: Double, m44: Double, is2D: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.m13] = m13.jsValue() - object[Keys.m14] = m14.jsValue() - object[Keys.m23] = m23.jsValue() - object[Keys.m24] = m24.jsValue() - object[Keys.m31] = m31.jsValue() - object[Keys.m32] = m32.jsValue() - object[Keys.m33] = m33.jsValue() - object[Keys.m34] = m34.jsValue() - object[Keys.m43] = m43.jsValue() - object[Keys.m44] = m44.jsValue() - object[Keys.is2D] = is2D.jsValue() + object[Strings.m13] = m13.jsValue() + object[Strings.m14] = m14.jsValue() + object[Strings.m23] = m23.jsValue() + object[Strings.m24] = m24.jsValue() + object[Strings.m31] = m31.jsValue() + object[Strings.m32] = m32.jsValue() + object[Strings.m33] = m33.jsValue() + object[Strings.m34] = m34.jsValue() + object[Strings.m43] = m43.jsValue() + object[Strings.m44] = m44.jsValue() + object[Strings.is2D] = is2D.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _m13 = ReadWriteAttribute(jsObject: object, name: Keys.m13) - _m14 = ReadWriteAttribute(jsObject: object, name: Keys.m14) - _m23 = ReadWriteAttribute(jsObject: object, name: Keys.m23) - _m24 = ReadWriteAttribute(jsObject: object, name: Keys.m24) - _m31 = ReadWriteAttribute(jsObject: object, name: Keys.m31) - _m32 = ReadWriteAttribute(jsObject: object, name: Keys.m32) - _m33 = ReadWriteAttribute(jsObject: object, name: Keys.m33) - _m34 = ReadWriteAttribute(jsObject: object, name: Keys.m34) - _m43 = ReadWriteAttribute(jsObject: object, name: Keys.m43) - _m44 = ReadWriteAttribute(jsObject: object, name: Keys.m44) - _is2D = ReadWriteAttribute(jsObject: object, name: Keys.is2D) + _m13 = ReadWriteAttribute(jsObject: object, name: Strings.m13) + _m14 = ReadWriteAttribute(jsObject: object, name: Strings.m14) + _m23 = ReadWriteAttribute(jsObject: object, name: Strings.m23) + _m24 = ReadWriteAttribute(jsObject: object, name: Strings.m24) + _m31 = ReadWriteAttribute(jsObject: object, name: Strings.m31) + _m32 = ReadWriteAttribute(jsObject: object, name: Strings.m32) + _m33 = ReadWriteAttribute(jsObject: object, name: Strings.m33) + _m34 = ReadWriteAttribute(jsObject: object, name: Strings.m34) + _m43 = ReadWriteAttribute(jsObject: object, name: Strings.m43) + _m44 = ReadWriteAttribute(jsObject: object, name: Strings.m44) + _is2D = ReadWriteAttribute(jsObject: object, name: Strings.is2D) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift index 8b16b9a4..f029813d 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -6,80 +6,33 @@ import JavaScriptKit public class DOMMatrixReadOnly: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMMatrixReadOnly.function! } - private enum Keys { - static let a: JSString = "a" - static let b: JSString = "b" - static let c: JSString = "c" - static let d: JSString = "d" - static let e: JSString = "e" - static let f: JSString = "f" - static let flipX: JSString = "flipX" - static let flipY: JSString = "flipY" - static let fromFloat32Array: JSString = "fromFloat32Array" - static let fromFloat64Array: JSString = "fromFloat64Array" - static let fromMatrix: JSString = "fromMatrix" - static let inverse: JSString = "inverse" - static let is2D: JSString = "is2D" - static let isIdentity: JSString = "isIdentity" - static let m11: JSString = "m11" - static let m12: JSString = "m12" - static let m13: JSString = "m13" - static let m14: JSString = "m14" - static let m21: JSString = "m21" - static let m22: JSString = "m22" - static let m23: JSString = "m23" - static let m24: JSString = "m24" - static let m31: JSString = "m31" - static let m32: JSString = "m32" - static let m33: JSString = "m33" - static let m34: JSString = "m34" - static let m41: JSString = "m41" - static let m42: JSString = "m42" - static let m43: JSString = "m43" - static let m44: JSString = "m44" - static let multiply: JSString = "multiply" - static let rotate: JSString = "rotate" - static let rotateAxisAngle: JSString = "rotateAxisAngle" - static let rotateFromVector: JSString = "rotateFromVector" - static let scale: JSString = "scale" - static let scale3d: JSString = "scale3d" - static let scaleNonUniform: JSString = "scaleNonUniform" - static let skewX: JSString = "skewX" - static let skewY: JSString = "skewY" - static let toFloat32Array: JSString = "toFloat32Array" - static let toFloat64Array: JSString = "toFloat64Array" - static let toJSON: JSString = "toJSON" - static let transformPoint: JSString = "transformPoint" - static let translate: JSString = "translate" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _a = ReadonlyAttribute(jsObject: jsObject, name: Keys.a) - _b = ReadonlyAttribute(jsObject: jsObject, name: Keys.b) - _c = ReadonlyAttribute(jsObject: jsObject, name: Keys.c) - _d = ReadonlyAttribute(jsObject: jsObject, name: Keys.d) - _e = ReadonlyAttribute(jsObject: jsObject, name: Keys.e) - _f = ReadonlyAttribute(jsObject: jsObject, name: Keys.f) - _m11 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m11) - _m12 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m12) - _m13 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m13) - _m14 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m14) - _m21 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m21) - _m22 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m22) - _m23 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m23) - _m24 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m24) - _m31 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m31) - _m32 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m32) - _m33 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m33) - _m34 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m34) - _m41 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m41) - _m42 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m42) - _m43 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m43) - _m44 = ReadonlyAttribute(jsObject: jsObject, name: Keys.m44) - _is2D = ReadonlyAttribute(jsObject: jsObject, name: Keys.is2D) - _isIdentity = ReadonlyAttribute(jsObject: jsObject, name: Keys.isIdentity) + _a = ReadonlyAttribute(jsObject: jsObject, name: Strings.a) + _b = ReadonlyAttribute(jsObject: jsObject, name: Strings.b) + _c = ReadonlyAttribute(jsObject: jsObject, name: Strings.c) + _d = ReadonlyAttribute(jsObject: jsObject, name: Strings.d) + _e = ReadonlyAttribute(jsObject: jsObject, name: Strings.e) + _f = ReadonlyAttribute(jsObject: jsObject, name: Strings.f) + _m11 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m11) + _m12 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m12) + _m13 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m13) + _m14 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m14) + _m21 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m21) + _m22 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m22) + _m23 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m23) + _m24 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m24) + _m31 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m31) + _m32 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m32) + _m33 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m33) + _m34 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m34) + _m41 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m41) + _m42 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m42) + _m43 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m43) + _m44 = ReadonlyAttribute(jsObject: jsObject, name: Strings.m44) + _is2D = ReadonlyAttribute(jsObject: jsObject, name: Strings.is2D) + _isIdentity = ReadonlyAttribute(jsObject: jsObject, name: Strings.isIdentity) self.jsObject = jsObject } @@ -88,15 +41,15 @@ public class DOMMatrixReadOnly: JSBridgedClass { } public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self { - constructor[Keys.fromMatrix]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Strings.fromMatrix]!(other?.jsValue() ?? .undefined).fromJSValue()! } public static func fromFloat32Array(array32: Float32Array) -> Self { - constructor[Keys.fromFloat32Array]!(array32.jsValue()).fromJSValue()! + constructor[Strings.fromFloat32Array]!(array32.jsValue()).fromJSValue()! } public static func fromFloat64Array(array64: Float64Array) -> Self { - constructor[Keys.fromFloat64Array]!(array64.jsValue()).fromJSValue()! + constructor[Strings.fromFloat64Array]!(array64.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -172,7 +125,7 @@ public class DOMMatrixReadOnly: JSBridgedClass { public var isIdentity: Bool public func translate(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> DOMMatrix { - jsObject[Keys.translate]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.translate]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! } public func scale(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { @@ -182,63 +135,63 @@ public class DOMMatrixReadOnly: JSBridgedClass { let _arg3 = originX?.jsValue() ?? .undefined let _arg4 = originY?.jsValue() ?? .undefined let _arg5 = originZ?.jsValue() ?? .undefined - return jsObject[Keys.scale]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + return jsObject[Strings.scale]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } public func scaleNonUniform(scaleX: Double? = nil, scaleY: Double? = nil) -> DOMMatrix { - jsObject[Keys.scaleNonUniform]!(scaleX?.jsValue() ?? .undefined, scaleY?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.scaleNonUniform]!(scaleX?.jsValue() ?? .undefined, scaleY?.jsValue() ?? .undefined).fromJSValue()! } public func scale3d(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { - jsObject[Keys.scale3d]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.scale3d]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! } public func rotate(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> DOMMatrix { - jsObject[Keys.rotate]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.rotate]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! } public func rotateFromVector(x: Double? = nil, y: Double? = nil) -> DOMMatrix { - jsObject[Keys.rotateFromVector]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.rotateFromVector]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! } public func rotateAxisAngle(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> DOMMatrix { - jsObject[Keys.rotateAxisAngle]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.rotateAxisAngle]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! } public func skewX(sx: Double? = nil) -> DOMMatrix { - jsObject[Keys.skewX]!(sx?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.skewX]!(sx?.jsValue() ?? .undefined).fromJSValue()! } public func skewY(sy: Double? = nil) -> DOMMatrix { - jsObject[Keys.skewY]!(sy?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.skewY]!(sy?.jsValue() ?? .undefined).fromJSValue()! } public func multiply(other: DOMMatrixInit? = nil) -> DOMMatrix { - jsObject[Keys.multiply]!(other?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.multiply]!(other?.jsValue() ?? .undefined).fromJSValue()! } public func flipX() -> DOMMatrix { - jsObject[Keys.flipX]!().fromJSValue()! + jsObject[Strings.flipX]!().fromJSValue()! } public func flipY() -> DOMMatrix { - jsObject[Keys.flipY]!().fromJSValue()! + jsObject[Strings.flipY]!().fromJSValue()! } public func inverse() -> DOMMatrix { - jsObject[Keys.inverse]!().fromJSValue()! + jsObject[Strings.inverse]!().fromJSValue()! } public func transformPoint(point: DOMPointInit? = nil) -> DOMPoint { - jsObject[Keys.transformPoint]!(point?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.transformPoint]!(point?.jsValue() ?? .undefined).fromJSValue()! } public func toFloat32Array() -> Float32Array { - jsObject[Keys.toFloat32Array]!().fromJSValue()! + jsObject[Strings.toFloat32Array]!().fromJSValue()! } public func toFloat64Array() -> Float64Array { - jsObject[Keys.toFloat64Array]!().fromJSValue()! + jsObject[Strings.toFloat64Array]!().fromJSValue()! } public var description: String { @@ -246,6 +199,6 @@ public class DOMMatrixReadOnly: JSBridgedClass { } public func toJSON() -> JSObject { - jsObject[Keys.toJSON]!().fromJSValue()! + jsObject[Strings.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMParser.swift b/Sources/DOMKit/WebIDL/DOMParser.swift index 26d63992..01464648 100644 --- a/Sources/DOMKit/WebIDL/DOMParser.swift +++ b/Sources/DOMKit/WebIDL/DOMParser.swift @@ -6,10 +6,6 @@ import JavaScriptKit public class DOMParser: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMParser.function! } - private enum Keys { - static let parseFromString: JSString = "parseFromString" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -21,6 +17,6 @@ public class DOMParser: JSBridgedClass { } public func parseFromString(string: String, type: DOMParserSupportedType) -> Document { - jsObject[Keys.parseFromString]!(string.jsValue(), type.jsValue()).fromJSValue()! + jsObject[Strings.parseFromString]!(string.jsValue(), type.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMPoint.swift b/Sources/DOMKit/WebIDL/DOMPoint.swift index 7325ab15..ef6af3c8 100644 --- a/Sources/DOMKit/WebIDL/DOMPoint.swift +++ b/Sources/DOMKit/WebIDL/DOMPoint.swift @@ -6,19 +6,11 @@ import JavaScriptKit public class DOMPoint: DOMPointReadOnly { override public class var constructor: JSFunction { JSObject.global.DOMPoint.function! } - private enum Keys { - static let fromPoint: JSString = "fromPoint" - static let w: JSString = "w" - static let x: JSString = "x" - static let y: JSString = "y" - static let z: JSString = "z" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadWriteAttribute(jsObject: jsObject, name: Keys.x) - _y = ReadWriteAttribute(jsObject: jsObject, name: Keys.y) - _z = ReadWriteAttribute(jsObject: jsObject, name: Keys.z) - _w = ReadWriteAttribute(jsObject: jsObject, name: Keys.w) + _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadWriteAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadWriteAttribute(jsObject: jsObject, name: Strings.z) + _w = ReadWriteAttribute(jsObject: jsObject, name: Strings.w) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DOMPointInit.swift b/Sources/DOMKit/WebIDL/DOMPointInit.swift index a3ae638d..cfc8aac8 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit.swift @@ -4,27 +4,20 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMPointInit: BridgedDictionary { - private enum Keys { - static let w: JSString = "w" - static let x: JSString = "x" - static let y: JSString = "y" - static let z: JSString = "z" - } - public convenience init(x: Double, y: Double, z: Double, w: Double) { let object = JSObject.global.Object.function!.new() - object[Keys.x] = x.jsValue() - object[Keys.y] = y.jsValue() - object[Keys.z] = z.jsValue() - object[Keys.w] = w.jsValue() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.z] = z.jsValue() + object[Strings.w] = w.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Keys.x) - _y = ReadWriteAttribute(jsObject: object, name: Keys.y) - _z = ReadWriteAttribute(jsObject: object, name: Keys.z) - _w = ReadWriteAttribute(jsObject: object, name: Keys.w) + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _z = ReadWriteAttribute(jsObject: object, name: Strings.z) + _w = ReadWriteAttribute(jsObject: object, name: Strings.w) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift index 26fee3cc..747d82b9 100644 --- a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift @@ -6,23 +6,13 @@ import JavaScriptKit public class DOMPointReadOnly: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMPointReadOnly.function! } - private enum Keys { - static let fromPoint: JSString = "fromPoint" - static let matrixTransform: JSString = "matrixTransform" - static let toJSON: JSString = "toJSON" - static let w: JSString = "w" - static let x: JSString = "x" - static let y: JSString = "y" - static let z: JSString = "z" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Keys.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Keys.y) - _z = ReadonlyAttribute(jsObject: jsObject, name: Keys.z) - _w = ReadonlyAttribute(jsObject: jsObject, name: Keys.w) + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) + _w = ReadonlyAttribute(jsObject: jsObject, name: Strings.w) self.jsObject = jsObject } @@ -31,7 +21,7 @@ public class DOMPointReadOnly: JSBridgedClass { } public static func fromPoint(other: DOMPointInit? = nil) -> Self { - constructor[Keys.fromPoint]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Strings.fromPoint]!(other?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -47,10 +37,10 @@ public class DOMPointReadOnly: JSBridgedClass { public var w: Double public func matrixTransform(matrix: DOMMatrixInit? = nil) -> DOMPoint { - jsObject[Keys.matrixTransform]!(matrix?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.matrixTransform]!(matrix?.jsValue() ?? .undefined).fromJSValue()! } public func toJSON() -> JSObject { - jsObject[Keys.toJSON]!().fromJSValue()! + jsObject[Strings.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMQuad.swift b/Sources/DOMKit/WebIDL/DOMQuad.swift index 62abc776..a5b201ce 100644 --- a/Sources/DOMKit/WebIDL/DOMQuad.swift +++ b/Sources/DOMKit/WebIDL/DOMQuad.swift @@ -6,24 +6,13 @@ import JavaScriptKit public class DOMQuad: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMQuad.function! } - private enum Keys { - static let fromQuad: JSString = "fromQuad" - static let fromRect: JSString = "fromRect" - static let getBounds: JSString = "getBounds" - static let p1: JSString = "p1" - static let p2: JSString = "p2" - static let p3: JSString = "p3" - static let p4: JSString = "p4" - static let toJSON: JSString = "toJSON" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _p1 = ReadonlyAttribute(jsObject: jsObject, name: Keys.p1) - _p2 = ReadonlyAttribute(jsObject: jsObject, name: Keys.p2) - _p3 = ReadonlyAttribute(jsObject: jsObject, name: Keys.p3) - _p4 = ReadonlyAttribute(jsObject: jsObject, name: Keys.p4) + _p1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.p1) + _p2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.p2) + _p3 = ReadonlyAttribute(jsObject: jsObject, name: Strings.p3) + _p4 = ReadonlyAttribute(jsObject: jsObject, name: Strings.p4) self.jsObject = jsObject } @@ -32,11 +21,11 @@ public class DOMQuad: JSBridgedClass { } public static func fromRect(other: DOMRectInit? = nil) -> Self { - constructor[Keys.fromRect]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Strings.fromRect]!(other?.jsValue() ?? .undefined).fromJSValue()! } public static func fromQuad(other: DOMQuadInit? = nil) -> Self { - constructor[Keys.fromQuad]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Strings.fromQuad]!(other?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -52,10 +41,10 @@ public class DOMQuad: JSBridgedClass { public var p4: DOMPoint public func getBounds() -> DOMRect { - jsObject[Keys.getBounds]!().fromJSValue()! + jsObject[Strings.getBounds]!().fromJSValue()! } public func toJSON() -> JSObject { - jsObject[Keys.toJSON]!().fromJSValue()! + jsObject[Strings.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMQuadInit.swift b/Sources/DOMKit/WebIDL/DOMQuadInit.swift index 20eab437..221a6fa9 100644 --- a/Sources/DOMKit/WebIDL/DOMQuadInit.swift +++ b/Sources/DOMKit/WebIDL/DOMQuadInit.swift @@ -4,27 +4,20 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMQuadInit: BridgedDictionary { - private enum Keys { - static let p1: JSString = "p1" - static let p2: JSString = "p2" - static let p3: JSString = "p3" - static let p4: JSString = "p4" - } - public convenience init(p1: DOMPointInit, p2: DOMPointInit, p3: DOMPointInit, p4: DOMPointInit) { let object = JSObject.global.Object.function!.new() - object[Keys.p1] = p1.jsValue() - object[Keys.p2] = p2.jsValue() - object[Keys.p3] = p3.jsValue() - object[Keys.p4] = p4.jsValue() + object[Strings.p1] = p1.jsValue() + object[Strings.p2] = p2.jsValue() + object[Strings.p3] = p3.jsValue() + object[Strings.p4] = p4.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _p1 = ReadWriteAttribute(jsObject: object, name: Keys.p1) - _p2 = ReadWriteAttribute(jsObject: object, name: Keys.p2) - _p3 = ReadWriteAttribute(jsObject: object, name: Keys.p3) - _p4 = ReadWriteAttribute(jsObject: object, name: Keys.p4) + _p1 = ReadWriteAttribute(jsObject: object, name: Strings.p1) + _p2 = ReadWriteAttribute(jsObject: object, name: Strings.p2) + _p3 = ReadWriteAttribute(jsObject: object, name: Strings.p3) + _p4 = ReadWriteAttribute(jsObject: object, name: Strings.p4) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMRect.swift b/Sources/DOMKit/WebIDL/DOMRect.swift index 19097f9e..bbb52006 100644 --- a/Sources/DOMKit/WebIDL/DOMRect.swift +++ b/Sources/DOMKit/WebIDL/DOMRect.swift @@ -6,19 +6,11 @@ import JavaScriptKit public class DOMRect: DOMRectReadOnly { override public class var constructor: JSFunction { JSObject.global.DOMRect.function! } - private enum Keys { - static let fromRect: JSString = "fromRect" - static let height: JSString = "height" - static let width: JSString = "width" - static let x: JSString = "x" - static let y: JSString = "y" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadWriteAttribute(jsObject: jsObject, name: Keys.x) - _y = ReadWriteAttribute(jsObject: jsObject, name: Keys.y) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadWriteAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DOMRectInit.swift b/Sources/DOMKit/WebIDL/DOMRectInit.swift index a953b96e..172f06de 100644 --- a/Sources/DOMKit/WebIDL/DOMRectInit.swift +++ b/Sources/DOMKit/WebIDL/DOMRectInit.swift @@ -4,27 +4,20 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMRectInit: BridgedDictionary { - private enum Keys { - static let height: JSString = "height" - static let width: JSString = "width" - static let x: JSString = "x" - static let y: JSString = "y" - } - public convenience init(x: Double, y: Double, width: Double, height: Double) { let object = JSObject.global.Object.function!.new() - object[Keys.x] = x.jsValue() - object[Keys.y] = y.jsValue() - object[Keys.width] = width.jsValue() - object[Keys.height] = height.jsValue() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.width] = width.jsValue() + object[Strings.height] = height.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Keys.x) - _y = ReadWriteAttribute(jsObject: object, name: Keys.y) - _width = ReadWriteAttribute(jsObject: object, name: Keys.width) - _height = ReadWriteAttribute(jsObject: object, name: Keys.height) + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMRectList.swift b/Sources/DOMKit/WebIDL/DOMRectList.swift index 00827200..079668d7 100644 --- a/Sources/DOMKit/WebIDL/DOMRectList.swift +++ b/Sources/DOMKit/WebIDL/DOMRectList.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class DOMRectList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMRectList.function! } - private enum Keys { - static let item: JSString = "item" - static let length: JSString = "length" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift index 79ae4550..3ef789f4 100644 --- a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift @@ -6,30 +6,17 @@ import JavaScriptKit public class DOMRectReadOnly: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMRectReadOnly.function! } - private enum Keys { - static let bottom: JSString = "bottom" - static let fromRect: JSString = "fromRect" - static let height: JSString = "height" - static let left: JSString = "left" - static let right: JSString = "right" - static let toJSON: JSString = "toJSON" - static let top: JSString = "top" - static let width: JSString = "width" - static let x: JSString = "x" - static let y: JSString = "y" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Keys.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Keys.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Keys.height) - _top = ReadonlyAttribute(jsObject: jsObject, name: Keys.top) - _right = ReadonlyAttribute(jsObject: jsObject, name: Keys.right) - _bottom = ReadonlyAttribute(jsObject: jsObject, name: Keys.bottom) - _left = ReadonlyAttribute(jsObject: jsObject, name: Keys.left) + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _top = ReadonlyAttribute(jsObject: jsObject, name: Strings.top) + _right = ReadonlyAttribute(jsObject: jsObject, name: Strings.right) + _bottom = ReadonlyAttribute(jsObject: jsObject, name: Strings.bottom) + _left = ReadonlyAttribute(jsObject: jsObject, name: Strings.left) self.jsObject = jsObject } @@ -38,7 +25,7 @@ public class DOMRectReadOnly: JSBridgedClass { } public static func fromRect(other: DOMRectInit? = nil) -> Self { - constructor[Keys.fromRect]!(other?.jsValue() ?? .undefined).fromJSValue()! + constructor[Strings.fromRect]!(other?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -66,6 +53,6 @@ public class DOMRectReadOnly: JSBridgedClass { public var left: Double public func toJSON() -> JSObject { - jsObject[Keys.toJSON]!().fromJSValue()! + jsObject[Strings.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMStringList.swift b/Sources/DOMKit/WebIDL/DOMStringList.swift index 88ea6bbe..5ff90704 100644 --- a/Sources/DOMKit/WebIDL/DOMStringList.swift +++ b/Sources/DOMKit/WebIDL/DOMStringList.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class DOMStringList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMStringList.function! } - private enum Keys { - static let contains: JSString = "contains" - static let item: JSString = "item" - static let length: JSString = "length" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } @@ -27,6 +21,6 @@ public class DOMStringList: JSBridgedClass { } public func contains(string: String) -> Bool { - jsObject[Keys.contains]!(string.jsValue()).fromJSValue()! + jsObject[Strings.contains]!(string.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMStringMap.swift b/Sources/DOMKit/WebIDL/DOMStringMap.swift index 4a32e5da..c7f1ece3 100644 --- a/Sources/DOMKit/WebIDL/DOMStringMap.swift +++ b/Sources/DOMKit/WebIDL/DOMStringMap.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class DOMStringMap: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DOMStringMap.function! } - private enum Keys {} - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/DOMTokenList.swift b/Sources/DOMKit/WebIDL/DOMTokenList.swift index 01e93d87..4d16f691 100644 --- a/Sources/DOMKit/WebIDL/DOMTokenList.swift +++ b/Sources/DOMKit/WebIDL/DOMTokenList.swift @@ -6,23 +6,11 @@ import JavaScriptKit public class DOMTokenList: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.DOMTokenList.function! } - private enum Keys { - static let add: JSString = "add" - static let contains: JSString = "contains" - static let item: JSString = "item" - static let length: JSString = "length" - static let remove: JSString = "remove" - static let replace: JSString = "replace" - static let supports: JSString = "supports" - static let toggle: JSString = "toggle" - static let value: JSString = "value" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) self.jsObject = jsObject } @@ -34,27 +22,27 @@ public class DOMTokenList: JSBridgedClass, Sequence { } public func contains(token: String) -> Bool { - jsObject[Keys.contains]!(token.jsValue()).fromJSValue()! + jsObject[Strings.contains]!(token.jsValue()).fromJSValue()! } public func add(tokens: String...) { - _ = jsObject[Keys.add]!(tokens.jsValue()) + _ = jsObject[Strings.add]!(tokens.jsValue()) } public func remove(tokens: String...) { - _ = jsObject[Keys.remove]!(tokens.jsValue()) + _ = jsObject[Strings.remove]!(tokens.jsValue()) } public func toggle(token: String, force: Bool? = nil) -> Bool { - jsObject[Keys.toggle]!(token.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.toggle]!(token.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! } public func replace(token: String, newToken: String) -> Bool { - jsObject[Keys.replace]!(token.jsValue(), newToken.jsValue()).fromJSValue()! + jsObject[Strings.replace]!(token.jsValue(), newToken.jsValue()).fromJSValue()! } public func supports(token: String) -> Bool { - jsObject[Keys.supports]!(token.jsValue()).fromJSValue()! + jsObject[Strings.supports]!(token.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift index 5b74322c..a660eacb 100644 --- a/Sources/DOMKit/WebIDL/DataTransfer.swift +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -6,26 +6,14 @@ import JavaScriptKit public class DataTransfer: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DataTransfer.function! } - private enum Keys { - static let clearData: JSString = "clearData" - static let dropEffect: JSString = "dropEffect" - static let effectAllowed: JSString = "effectAllowed" - static let files: JSString = "files" - static let getData: JSString = "getData" - static let items: JSString = "items" - static let setData: JSString = "setData" - static let setDragImage: JSString = "setDragImage" - static let types: JSString = "types" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _dropEffect = ReadWriteAttribute(jsObject: jsObject, name: Keys.dropEffect) - _effectAllowed = ReadWriteAttribute(jsObject: jsObject, name: Keys.effectAllowed) - _items = ReadonlyAttribute(jsObject: jsObject, name: Keys.items) - _types = ReadonlyAttribute(jsObject: jsObject, name: Keys.types) - _files = ReadonlyAttribute(jsObject: jsObject, name: Keys.files) + _dropEffect = ReadWriteAttribute(jsObject: jsObject, name: Strings.dropEffect) + _effectAllowed = ReadWriteAttribute(jsObject: jsObject, name: Strings.effectAllowed) + _items = ReadonlyAttribute(jsObject: jsObject, name: Strings.items) + _types = ReadonlyAttribute(jsObject: jsObject, name: Strings.types) + _files = ReadonlyAttribute(jsObject: jsObject, name: Strings.files) self.jsObject = jsObject } @@ -43,22 +31,22 @@ public class DataTransfer: JSBridgedClass { public var items: DataTransferItemList public func setDragImage(image: Element, x: Int32, y: Int32) { - _ = jsObject[Keys.setDragImage]!(image.jsValue(), x.jsValue(), y.jsValue()) + _ = jsObject[Strings.setDragImage]!(image.jsValue(), x.jsValue(), y.jsValue()) } @ReadonlyAttribute public var types: [String] public func getData(format: String) -> String { - jsObject[Keys.getData]!(format.jsValue()).fromJSValue()! + jsObject[Strings.getData]!(format.jsValue()).fromJSValue()! } public func setData(format: String, data: String) { - _ = jsObject[Keys.setData]!(format.jsValue(), data.jsValue()) + _ = jsObject[Strings.setData]!(format.jsValue(), data.jsValue()) } public func clearData(format: String? = nil) { - _ = jsObject[Keys.clearData]!(format?.jsValue() ?? .undefined) + _ = jsObject[Strings.clearData]!(format?.jsValue() ?? .undefined) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index 751aac97..16733079 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -6,18 +6,11 @@ import JavaScriptKit public class DataTransferItem: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DataTransferItem.function! } - private enum Keys { - static let getAsFile: JSString = "getAsFile" - static let getAsString: JSString = "getAsString" - static let kind: JSString = "kind" - static let type: JSString = "type" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _kind = ReadonlyAttribute(jsObject: jsObject, name: Keys.kind) - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) + _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) self.jsObject = jsObject } @@ -30,6 +23,6 @@ public class DataTransferItem: JSBridgedClass { // XXX: member 'getAsString' is ignored public func getAsFile() -> File? { - jsObject[Keys.getAsFile]!().fromJSValue()! + jsObject[Strings.getAsFile]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DataTransferItemList.swift b/Sources/DOMKit/WebIDL/DataTransferItemList.swift index 0cf60b32..475e4777 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItemList.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItemList.swift @@ -6,17 +6,10 @@ import JavaScriptKit public class DataTransferItemList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.DataTransferItemList.function! } - private enum Keys { - static let add: JSString = "add" - static let clear: JSString = "clear" - static let length: JSString = "length" - static let remove: JSString = "remove" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } @@ -28,18 +21,18 @@ public class DataTransferItemList: JSBridgedClass { } public func add(data: String, type: String) -> DataTransferItem? { - jsObject[Keys.add]!(data.jsValue(), type.jsValue()).fromJSValue()! + jsObject[Strings.add]!(data.jsValue(), type.jsValue()).fromJSValue()! } public func add(data: File) -> DataTransferItem? { - jsObject[Keys.add]!(data.jsValue()).fromJSValue()! + jsObject[Strings.add]!(data.jsValue()).fromJSValue()! } public func remove(index: UInt32) { - _ = jsObject[Keys.remove]!(index.jsValue()) + _ = jsObject[Strings.remove]!(index.jsValue()) } public func clear() { - _ = jsObject[Keys.clear]!() + _ = jsObject[Strings.clear]!() } } diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index 47d556b4..6763f8bc 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -6,18 +6,10 @@ import JavaScriptKit public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvider { override public class var constructor: JSFunction { JSObject.global.DedicatedWorkerGlobalScope.function! } - private enum Keys { - static let close: JSString = "close" - static let name: JSString = "name" - static let onmessage: JSString = "onmessage" - static let onmessageerror: JSString = "onmessageerror" - static let postMessage: JSString = "postMessage" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessageerror) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -25,15 +17,15 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid public var name: String public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) + _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 52cb1141..895b057e 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -6,125 +6,48 @@ import JavaScriptKit public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { override public class var constructor: JSFunction { JSObject.global.Document.function! } - private enum Keys { - static let URL: JSString = "URL" - static let adoptNode: JSString = "adoptNode" - static let alinkColor: JSString = "alinkColor" - static let all: JSString = "all" - static let anchors: JSString = "anchors" - static let applets: JSString = "applets" - static let bgColor: JSString = "bgColor" - static let body: JSString = "body" - static let captureEvents: JSString = "captureEvents" - static let characterSet: JSString = "characterSet" - static let charset: JSString = "charset" - static let clear: JSString = "clear" - static let close: JSString = "close" - static let compatMode: JSString = "compatMode" - static let contentType: JSString = "contentType" - static let cookie: JSString = "cookie" - static let createAttribute: JSString = "createAttribute" - static let createAttributeNS: JSString = "createAttributeNS" - static let createCDATASection: JSString = "createCDATASection" - static let createComment: JSString = "createComment" - static let createDocumentFragment: JSString = "createDocumentFragment" - static let createElement: JSString = "createElement" - static let createElementNS: JSString = "createElementNS" - static let createEvent: JSString = "createEvent" - static let createNodeIterator: JSString = "createNodeIterator" - static let createProcessingInstruction: JSString = "createProcessingInstruction" - static let createRange: JSString = "createRange" - static let createTextNode: JSString = "createTextNode" - static let createTreeWalker: JSString = "createTreeWalker" - static let currentScript: JSString = "currentScript" - static let defaultView: JSString = "defaultView" - static let designMode: JSString = "designMode" - static let dir: JSString = "dir" - static let doctype: JSString = "doctype" - static let documentElement: JSString = "documentElement" - static let documentURI: JSString = "documentURI" - static let domain: JSString = "domain" - static let embeds: JSString = "embeds" - static let execCommand: JSString = "execCommand" - static let fgColor: JSString = "fgColor" - static let forms: JSString = "forms" - static let getElementsByClassName: JSString = "getElementsByClassName" - static let getElementsByName: JSString = "getElementsByName" - static let getElementsByTagName: JSString = "getElementsByTagName" - static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" - static let hasFocus: JSString = "hasFocus" - static let head: JSString = "head" - static let hidden: JSString = "hidden" - static let images: JSString = "images" - static let implementation: JSString = "implementation" - static let importNode: JSString = "importNode" - static let inputEncoding: JSString = "inputEncoding" - static let lastModified: JSString = "lastModified" - static let linkColor: JSString = "linkColor" - static let links: JSString = "links" - static let location: JSString = "location" - static let onreadystatechange: JSString = "onreadystatechange" - static let onvisibilitychange: JSString = "onvisibilitychange" - static let open: JSString = "open" - static let plugins: JSString = "plugins" - static let queryCommandEnabled: JSString = "queryCommandEnabled" - static let queryCommandIndeterm: JSString = "queryCommandIndeterm" - static let queryCommandState: JSString = "queryCommandState" - static let queryCommandSupported: JSString = "queryCommandSupported" - static let queryCommandValue: JSString = "queryCommandValue" - static let readyState: JSString = "readyState" - static let referrer: JSString = "referrer" - static let releaseEvents: JSString = "releaseEvents" - static let scripts: JSString = "scripts" - static let title: JSString = "title" - static let visibilityState: JSString = "visibilityState" - static let vlinkColor: JSString = "vlinkColor" - static let write: JSString = "write" - static let writeln: JSString = "writeln" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _implementation = ReadonlyAttribute(jsObject: jsObject, name: Keys.implementation) - _URL = ReadonlyAttribute(jsObject: jsObject, name: Keys.URL) - _documentURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.documentURI) - _compatMode = ReadonlyAttribute(jsObject: jsObject, name: Keys.compatMode) - _characterSet = ReadonlyAttribute(jsObject: jsObject, name: Keys.characterSet) - _charset = ReadonlyAttribute(jsObject: jsObject, name: Keys.charset) - _inputEncoding = ReadonlyAttribute(jsObject: jsObject, name: Keys.inputEncoding) - _contentType = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentType) - _doctype = ReadonlyAttribute(jsObject: jsObject, name: Keys.doctype) - _documentElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.documentElement) - _location = ReadonlyAttribute(jsObject: jsObject, name: Keys.location) - _domain = ReadWriteAttribute(jsObject: jsObject, name: Keys.domain) - _referrer = ReadonlyAttribute(jsObject: jsObject, name: Keys.referrer) - _cookie = ReadWriteAttribute(jsObject: jsObject, name: Keys.cookie) - _lastModified = ReadonlyAttribute(jsObject: jsObject, name: Keys.lastModified) - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) - _title = ReadWriteAttribute(jsObject: jsObject, name: Keys.title) - _dir = ReadWriteAttribute(jsObject: jsObject, name: Keys.dir) - _body = ReadWriteAttribute(jsObject: jsObject, name: Keys.body) - _head = ReadonlyAttribute(jsObject: jsObject, name: Keys.head) - _images = ReadonlyAttribute(jsObject: jsObject, name: Keys.images) - _embeds = ReadonlyAttribute(jsObject: jsObject, name: Keys.embeds) - _plugins = ReadonlyAttribute(jsObject: jsObject, name: Keys.plugins) - _links = ReadonlyAttribute(jsObject: jsObject, name: Keys.links) - _forms = ReadonlyAttribute(jsObject: jsObject, name: Keys.forms) - _scripts = ReadonlyAttribute(jsObject: jsObject, name: Keys.scripts) - _currentScript = ReadonlyAttribute(jsObject: jsObject, name: Keys.currentScript) - _defaultView = ReadonlyAttribute(jsObject: jsObject, name: Keys.defaultView) - _designMode = ReadWriteAttribute(jsObject: jsObject, name: Keys.designMode) - _hidden = ReadonlyAttribute(jsObject: jsObject, name: Keys.hidden) - _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Keys.visibilityState) - _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onreadystatechange) - _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onvisibilitychange) - _fgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.fgColor) - _linkColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.linkColor) - _vlinkColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.vlinkColor) - _alinkColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.alinkColor) - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) - _anchors = ReadonlyAttribute(jsObject: jsObject, name: Keys.anchors) - _applets = ReadonlyAttribute(jsObject: jsObject, name: Keys.applets) - _all = ReadonlyAttribute(jsObject: jsObject, name: Keys.all) + _implementation = ReadonlyAttribute(jsObject: jsObject, name: Strings.implementation) + _URL = ReadonlyAttribute(jsObject: jsObject, name: Strings.URL) + _documentURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURI) + _compatMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.compatMode) + _characterSet = ReadonlyAttribute(jsObject: jsObject, name: Strings.characterSet) + _charset = ReadonlyAttribute(jsObject: jsObject, name: Strings.charset) + _inputEncoding = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputEncoding) + _contentType = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentType) + _doctype = ReadonlyAttribute(jsObject: jsObject, name: Strings.doctype) + _documentElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentElement) + _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) + _domain = ReadWriteAttribute(jsObject: jsObject, name: Strings.domain) + _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) + _cookie = ReadWriteAttribute(jsObject: jsObject, name: Strings.cookie) + _lastModified = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastModified) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _title = ReadWriteAttribute(jsObject: jsObject, name: Strings.title) + _dir = ReadWriteAttribute(jsObject: jsObject, name: Strings.dir) + _body = ReadWriteAttribute(jsObject: jsObject, name: Strings.body) + _head = ReadonlyAttribute(jsObject: jsObject, name: Strings.head) + _images = ReadonlyAttribute(jsObject: jsObject, name: Strings.images) + _embeds = ReadonlyAttribute(jsObject: jsObject, name: Strings.embeds) + _plugins = ReadonlyAttribute(jsObject: jsObject, name: Strings.plugins) + _links = ReadonlyAttribute(jsObject: jsObject, name: Strings.links) + _forms = ReadonlyAttribute(jsObject: jsObject, name: Strings.forms) + _scripts = ReadonlyAttribute(jsObject: jsObject, name: Strings.scripts) + _currentScript = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentScript) + _defaultView = ReadonlyAttribute(jsObject: jsObject, name: Strings.defaultView) + _designMode = ReadWriteAttribute(jsObject: jsObject, name: Strings.designMode) + _hidden = ReadonlyAttribute(jsObject: jsObject, name: Strings.hidden) + _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibilityState) + _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreadystatechange) + _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onvisibilitychange) + _fgColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.fgColor) + _linkColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.linkColor) + _vlinkColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.vlinkColor) + _alinkColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.alinkColor) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.bgColor) + _anchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchors) + _applets = ReadonlyAttribute(jsObject: jsObject, name: Strings.applets) + _all = ReadonlyAttribute(jsObject: jsObject, name: Strings.all) super.init(unsafelyWrapping: jsObject) } @@ -163,67 +86,67 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN public var documentElement: Element? public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { - jsObject[Keys.getElementsByTagName]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Strings.getElementsByTagName]!(qualifiedName.jsValue()).fromJSValue()! } public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { - jsObject[Keys.getElementsByTagNameNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Strings.getElementsByTagNameNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func getElementsByClassName(classNames: String) -> HTMLCollection { - jsObject[Keys.getElementsByClassName]!(classNames.jsValue()).fromJSValue()! + jsObject[Strings.getElementsByClassName]!(classNames.jsValue()).fromJSValue()! } public func createElement(localName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { - jsObject[Keys.createElement]!(localName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.createElement]!(localName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func createElementNS(namespace: String?, qualifiedName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { - jsObject[Keys.createElementNS]!(namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.createElementNS]!(namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func createDocumentFragment() -> DocumentFragment { - jsObject[Keys.createDocumentFragment]!().fromJSValue()! + jsObject[Strings.createDocumentFragment]!().fromJSValue()! } public func createTextNode(data: String) -> Text { - jsObject[Keys.createTextNode]!(data.jsValue()).fromJSValue()! + jsObject[Strings.createTextNode]!(data.jsValue()).fromJSValue()! } public func createCDATASection(data: String) -> CDATASection { - jsObject[Keys.createCDATASection]!(data.jsValue()).fromJSValue()! + jsObject[Strings.createCDATASection]!(data.jsValue()).fromJSValue()! } public func createComment(data: String) -> Comment { - jsObject[Keys.createComment]!(data.jsValue()).fromJSValue()! + jsObject[Strings.createComment]!(data.jsValue()).fromJSValue()! } public func createProcessingInstruction(target: String, data: String) -> ProcessingInstruction { - jsObject[Keys.createProcessingInstruction]!(target.jsValue(), data.jsValue()).fromJSValue()! + jsObject[Strings.createProcessingInstruction]!(target.jsValue(), data.jsValue()).fromJSValue()! } public func importNode(node: Node, deep: Bool? = nil) -> Node { - jsObject[Keys.importNode]!(node.jsValue(), deep?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.importNode]!(node.jsValue(), deep?.jsValue() ?? .undefined).fromJSValue()! } public func adoptNode(node: Node) -> Node { - jsObject[Keys.adoptNode]!(node.jsValue()).fromJSValue()! + jsObject[Strings.adoptNode]!(node.jsValue()).fromJSValue()! } public func createAttribute(localName: String) -> Attr { - jsObject[Keys.createAttribute]!(localName.jsValue()).fromJSValue()! + jsObject[Strings.createAttribute]!(localName.jsValue()).fromJSValue()! } public func createAttributeNS(namespace: String?, qualifiedName: String) -> Attr { - jsObject[Keys.createAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue()).fromJSValue()! + jsObject[Strings.createAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue()).fromJSValue()! } public func createEvent(interface: String) -> Event { - jsObject[Keys.createEvent]!(interface.jsValue()).fromJSValue()! + jsObject[Strings.createEvent]!(interface.jsValue()).fromJSValue()! } public func createRange() -> Range { - jsObject[Keys.createRange]!().fromJSValue()! + jsObject[Strings.createRange]!().fromJSValue()! } // XXX: member 'createNodeIterator' is ignored @@ -283,64 +206,64 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN public var scripts: HTMLCollection public func getElementsByName(elementName: String) -> NodeList { - jsObject[Keys.getElementsByName]!(elementName.jsValue()).fromJSValue()! + jsObject[Strings.getElementsByName]!(elementName.jsValue()).fromJSValue()! } @ReadonlyAttribute public var currentScript: HTMLOrSVGScriptElement? public func open(unused1: String? = nil, unused2: String? = nil) -> Self { - jsObject[Keys.open]!(unused1?.jsValue() ?? .undefined, unused2?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.open]!(unused1?.jsValue() ?? .undefined, unused2?.jsValue() ?? .undefined).fromJSValue()! } public func open(url: String, name: String, features: String) -> WindowProxy? { - jsObject[Keys.open]!(url.jsValue(), name.jsValue(), features.jsValue()).fromJSValue()! + jsObject[Strings.open]!(url.jsValue(), name.jsValue(), features.jsValue()).fromJSValue()! } public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } public func write(text: String...) { - _ = jsObject[Keys.write]!(text.jsValue()) + _ = jsObject[Strings.write]!(text.jsValue()) } public func writeln(text: String...) { - _ = jsObject[Keys.writeln]!(text.jsValue()) + _ = jsObject[Strings.writeln]!(text.jsValue()) } @ReadonlyAttribute public var defaultView: WindowProxy? public func hasFocus() -> Bool { - jsObject[Keys.hasFocus]!().fromJSValue()! + jsObject[Strings.hasFocus]!().fromJSValue()! } @ReadWriteAttribute public var designMode: String public func execCommand(commandId: String, showUI: Bool? = nil, value: String? = nil) -> Bool { - jsObject[Keys.execCommand]!(commandId.jsValue(), showUI?.jsValue() ?? .undefined, value?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.execCommand]!(commandId.jsValue(), showUI?.jsValue() ?? .undefined, value?.jsValue() ?? .undefined).fromJSValue()! } public func queryCommandEnabled(commandId: String) -> Bool { - jsObject[Keys.queryCommandEnabled]!(commandId.jsValue()).fromJSValue()! + jsObject[Strings.queryCommandEnabled]!(commandId.jsValue()).fromJSValue()! } public func queryCommandIndeterm(commandId: String) -> Bool { - jsObject[Keys.queryCommandIndeterm]!(commandId.jsValue()).fromJSValue()! + jsObject[Strings.queryCommandIndeterm]!(commandId.jsValue()).fromJSValue()! } public func queryCommandState(commandId: String) -> Bool { - jsObject[Keys.queryCommandState]!(commandId.jsValue()).fromJSValue()! + jsObject[Strings.queryCommandState]!(commandId.jsValue()).fromJSValue()! } public func queryCommandSupported(commandId: String) -> Bool { - jsObject[Keys.queryCommandSupported]!(commandId.jsValue()).fromJSValue()! + jsObject[Strings.queryCommandSupported]!(commandId.jsValue()).fromJSValue()! } public func queryCommandValue(commandId: String) -> String { - jsObject[Keys.queryCommandValue]!(commandId.jsValue()).fromJSValue()! + jsObject[Strings.queryCommandValue]!(commandId.jsValue()).fromJSValue()! } @ReadonlyAttribute @@ -377,15 +300,15 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN public var applets: HTMLCollection public func clear() { - _ = jsObject[Keys.clear]!() + _ = jsObject[Strings.clear]!() } public func captureEvents() { - _ = jsObject[Keys.captureEvents]!() + _ = jsObject[Strings.captureEvents]!() } public func releaseEvents() { - _ = jsObject[Keys.releaseEvents]!() + _ = jsObject[Strings.releaseEvents]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift index 80abcbf9..8c000a0e 100644 --- a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift @@ -3,26 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let oncopy: JSString = "oncopy" - static let oncut: JSString = "oncut" - static let onpaste: JSString = "onpaste" -} - public protocol DocumentAndElementEventHandlers: JSBridgedClass {} public extension DocumentAndElementEventHandlers { var oncopy: EventHandler { - get { ClosureAttribute.Optional1[Keys.oncopy, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oncopy, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oncopy, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncopy, in: jsObject] = newValue } } var oncut: EventHandler { - get { ClosureAttribute.Optional1[Keys.oncut, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oncut, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oncut, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncut, in: jsObject] = newValue } } var onpaste: EventHandler { - get { ClosureAttribute.Optional1[Keys.onpaste, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onpaste, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onpaste, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpaste, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/DocumentFragment.swift b/Sources/DOMKit/WebIDL/DocumentFragment.swift index aaa848c3..7091d224 100644 --- a/Sources/DOMKit/WebIDL/DocumentFragment.swift +++ b/Sources/DOMKit/WebIDL/DocumentFragment.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class DocumentFragment: Node, NonElementParentNode, ParentNode { override public class var constructor: JSFunction { JSObject.global.DocumentFragment.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index 0d68aa09..8f5a2cf9 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -3,20 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let activeElement: JSString = "activeElement" - static let adoptedStyleSheets: JSString = "adoptedStyleSheets" - static let styleSheets: JSString = "styleSheets" -} - public protocol DocumentOrShadowRoot: JSBridgedClass {} public extension DocumentOrShadowRoot { - var activeElement: Element? { ReadonlyAttribute[Keys.activeElement, in: jsObject] } + var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } - var styleSheets: StyleSheetList { ReadonlyAttribute[Keys.styleSheets, in: jsObject] } + var styleSheets: StyleSheetList { ReadonlyAttribute[Strings.styleSheets, in: jsObject] } var adoptedStyleSheets: [CSSStyleSheet] { - get { ReadWriteAttribute[Keys.adoptedStyleSheets, in: jsObject] } - set { ReadWriteAttribute[Keys.adoptedStyleSheets, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] } + set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/DocumentType.swift b/Sources/DOMKit/WebIDL/DocumentType.swift index ff4f964d..91dff6fc 100644 --- a/Sources/DOMKit/WebIDL/DocumentType.swift +++ b/Sources/DOMKit/WebIDL/DocumentType.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class DocumentType: Node, ChildNode { override public class var constructor: JSFunction { JSObject.global.DocumentType.function! } - private enum Keys { - static let name: JSString = "name" - static let publicId: JSString = "publicId" - static let systemId: JSString = "systemId" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) - _publicId = ReadonlyAttribute(jsObject: jsObject, name: Keys.publicId) - _systemId = ReadonlyAttribute(jsObject: jsObject, name: Keys.systemId) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _publicId = ReadonlyAttribute(jsObject: jsObject, name: Strings.publicId) + _systemId = ReadonlyAttribute(jsObject: jsObject, name: Strings.systemId) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DragEvent.swift b/Sources/DOMKit/WebIDL/DragEvent.swift index f13b88e5..a7f1575d 100644 --- a/Sources/DOMKit/WebIDL/DragEvent.swift +++ b/Sources/DOMKit/WebIDL/DragEvent.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class DragEvent: MouseEvent { override public class var constructor: JSFunction { JSObject.global.DragEvent.function! } - private enum Keys { - static let dataTransfer: JSString = "dataTransfer" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Keys.dataTransfer) + _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/DragEventInit.swift b/Sources/DOMKit/WebIDL/DragEventInit.swift index d31813e2..42dba8d1 100644 --- a/Sources/DOMKit/WebIDL/DragEventInit.swift +++ b/Sources/DOMKit/WebIDL/DragEventInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class DragEventInit: BridgedDictionary { - private enum Keys { - static let dataTransfer: JSString = "dataTransfer" - } - public convenience init(dataTransfer: DataTransfer?) { let object = JSObject.global.Object.function!.new() - object[Keys.dataTransfer] = dataTransfer.jsValue() + object[Strings.dataTransfer] = dataTransfer.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _dataTransfer = ReadWriteAttribute(jsObject: object, name: Keys.dataTransfer) + _dataTransfer = ReadWriteAttribute(jsObject: object, name: Strings.dataTransfer) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index 22b70aae..fdbae7fd 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -6,55 +6,17 @@ import JavaScriptKit public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin { override public class var constructor: JSFunction { JSObject.global.Element.function! } - private enum Keys { - static let attachShadow: JSString = "attachShadow" - static let attributes: JSString = "attributes" - static let classList: JSString = "classList" - static let className: JSString = "className" - static let closest: JSString = "closest" - static let getAttribute: JSString = "getAttribute" - static let getAttributeNS: JSString = "getAttributeNS" - static let getAttributeNames: JSString = "getAttributeNames" - static let getAttributeNode: JSString = "getAttributeNode" - static let getAttributeNodeNS: JSString = "getAttributeNodeNS" - static let getElementsByClassName: JSString = "getElementsByClassName" - static let getElementsByTagName: JSString = "getElementsByTagName" - static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" - static let hasAttribute: JSString = "hasAttribute" - static let hasAttributeNS: JSString = "hasAttributeNS" - static let hasAttributes: JSString = "hasAttributes" - static let id: JSString = "id" - static let insertAdjacentElement: JSString = "insertAdjacentElement" - static let insertAdjacentText: JSString = "insertAdjacentText" - static let localName: JSString = "localName" - static let matches: JSString = "matches" - static let namespaceURI: JSString = "namespaceURI" - static let prefix: JSString = "prefix" - static let removeAttribute: JSString = "removeAttribute" - static let removeAttributeNS: JSString = "removeAttributeNS" - static let removeAttributeNode: JSString = "removeAttributeNode" - static let setAttribute: JSString = "setAttribute" - static let setAttributeNS: JSString = "setAttributeNS" - static let setAttributeNode: JSString = "setAttributeNode" - static let setAttributeNodeNS: JSString = "setAttributeNodeNS" - static let shadowRoot: JSString = "shadowRoot" - static let slot: JSString = "slot" - static let tagName: JSString = "tagName" - static let toggleAttribute: JSString = "toggleAttribute" - static let webkitMatchesSelector: JSString = "webkitMatchesSelector" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.namespaceURI) - _prefix = ReadonlyAttribute(jsObject: jsObject, name: Keys.prefix) - _localName = ReadonlyAttribute(jsObject: jsObject, name: Keys.localName) - _tagName = ReadonlyAttribute(jsObject: jsObject, name: Keys.tagName) - _id = ReadWriteAttribute(jsObject: jsObject, name: Keys.id) - _className = ReadWriteAttribute(jsObject: jsObject, name: Keys.className) - _classList = ReadonlyAttribute(jsObject: jsObject, name: Keys.classList) - _slot = ReadWriteAttribute(jsObject: jsObject, name: Keys.slot) - _attributes = ReadonlyAttribute(jsObject: jsObject, name: Keys.attributes) - _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Keys.shadowRoot) + _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) + _prefix = ReadonlyAttribute(jsObject: jsObject, name: Strings.prefix) + _localName = ReadonlyAttribute(jsObject: jsObject, name: Strings.localName) + _tagName = ReadonlyAttribute(jsObject: jsObject, name: Strings.tagName) + _id = ReadWriteAttribute(jsObject: jsObject, name: Strings.id) + _className = ReadWriteAttribute(jsObject: jsObject, name: Strings.className) + _classList = ReadonlyAttribute(jsObject: jsObject, name: Strings.classList) + _slot = ReadWriteAttribute(jsObject: jsObject, name: Strings.slot) + _attributes = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributes) + _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) super.init(unsafelyWrapping: jsObject) } @@ -83,108 +45,108 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo public var slot: String public func hasAttributes() -> Bool { - jsObject[Keys.hasAttributes]!().fromJSValue()! + jsObject[Strings.hasAttributes]!().fromJSValue()! } @ReadonlyAttribute public var attributes: NamedNodeMap public func getAttributeNames() -> [String] { - jsObject[Keys.getAttributeNames]!().fromJSValue()! + jsObject[Strings.getAttributeNames]!().fromJSValue()! } public func getAttribute(qualifiedName: String) -> String? { - jsObject[Keys.getAttribute]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Strings.getAttribute]!(qualifiedName.jsValue()).fromJSValue()! } public func getAttributeNS(namespace: String?, localName: String) -> String? { - jsObject[Keys.getAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Strings.getAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func setAttribute(qualifiedName: String, value: String) { - _ = jsObject[Keys.setAttribute]!(qualifiedName.jsValue(), value.jsValue()) + _ = jsObject[Strings.setAttribute]!(qualifiedName.jsValue(), value.jsValue()) } public func setAttributeNS(namespace: String?, qualifiedName: String, value: String) { - _ = jsObject[Keys.setAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()) + _ = jsObject[Strings.setAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()) } public func removeAttribute(qualifiedName: String) { - _ = jsObject[Keys.removeAttribute]!(qualifiedName.jsValue()) + _ = jsObject[Strings.removeAttribute]!(qualifiedName.jsValue()) } public func removeAttributeNS(namespace: String?, localName: String) { - _ = jsObject[Keys.removeAttributeNS]!(namespace.jsValue(), localName.jsValue()) + _ = jsObject[Strings.removeAttributeNS]!(namespace.jsValue(), localName.jsValue()) } public func toggleAttribute(qualifiedName: String, force: Bool? = nil) -> Bool { - jsObject[Keys.toggleAttribute]!(qualifiedName.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.toggleAttribute]!(qualifiedName.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! } public func hasAttribute(qualifiedName: String) -> Bool { - jsObject[Keys.hasAttribute]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Strings.hasAttribute]!(qualifiedName.jsValue()).fromJSValue()! } public func hasAttributeNS(namespace: String?, localName: String) -> Bool { - jsObject[Keys.hasAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Strings.hasAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func getAttributeNode(qualifiedName: String) -> Attr? { - jsObject[Keys.getAttributeNode]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Strings.getAttributeNode]!(qualifiedName.jsValue()).fromJSValue()! } public func getAttributeNodeNS(namespace: String?, localName: String) -> Attr? { - jsObject[Keys.getAttributeNodeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Strings.getAttributeNodeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func setAttributeNode(attr: Attr) -> Attr? { - jsObject[Keys.setAttributeNode]!(attr.jsValue()).fromJSValue()! + jsObject[Strings.setAttributeNode]!(attr.jsValue()).fromJSValue()! } public func setAttributeNodeNS(attr: Attr) -> Attr? { - jsObject[Keys.setAttributeNodeNS]!(attr.jsValue()).fromJSValue()! + jsObject[Strings.setAttributeNodeNS]!(attr.jsValue()).fromJSValue()! } public func removeAttributeNode(attr: Attr) -> Attr { - jsObject[Keys.removeAttributeNode]!(attr.jsValue()).fromJSValue()! + jsObject[Strings.removeAttributeNode]!(attr.jsValue()).fromJSValue()! } public func attachShadow(init: ShadowRootInit) -> ShadowRoot { - jsObject[Keys.attachShadow]!(`init`.jsValue()).fromJSValue()! + jsObject[Strings.attachShadow]!(`init`.jsValue()).fromJSValue()! } @ReadonlyAttribute public var shadowRoot: ShadowRoot? public func closest(selectors: String) -> Element? { - jsObject[Keys.closest]!(selectors.jsValue()).fromJSValue()! + jsObject[Strings.closest]!(selectors.jsValue()).fromJSValue()! } public func matches(selectors: String) -> Bool { - jsObject[Keys.matches]!(selectors.jsValue()).fromJSValue()! + jsObject[Strings.matches]!(selectors.jsValue()).fromJSValue()! } public func webkitMatchesSelector(selectors: String) -> Bool { - jsObject[Keys.webkitMatchesSelector]!(selectors.jsValue()).fromJSValue()! + jsObject[Strings.webkitMatchesSelector]!(selectors.jsValue()).fromJSValue()! } public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { - jsObject[Keys.getElementsByTagName]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Strings.getElementsByTagName]!(qualifiedName.jsValue()).fromJSValue()! } public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { - jsObject[Keys.getElementsByTagNameNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Strings.getElementsByTagNameNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func getElementsByClassName(classNames: String) -> HTMLCollection { - jsObject[Keys.getElementsByClassName]!(classNames.jsValue()).fromJSValue()! + jsObject[Strings.getElementsByClassName]!(classNames.jsValue()).fromJSValue()! } public func insertAdjacentElement(where: String, element: Element) -> Element? { - jsObject[Keys.insertAdjacentElement]!(`where`.jsValue(), element.jsValue()).fromJSValue()! + jsObject[Strings.insertAdjacentElement]!(`where`.jsValue(), element.jsValue()).fromJSValue()! } public func insertAdjacentText(where: String, data: String) { - _ = jsObject[Keys.insertAdjacentText]!(`where`.jsValue(), data.jsValue()) + _ = jsObject[Strings.insertAdjacentText]!(`where`.jsValue(), data.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift index 8a47d9e1..faff44bf 100644 --- a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift +++ b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift @@ -3,11 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let style: JSString = "style" -} - public protocol ElementCSSInlineStyle: JSBridgedClass {} public extension ElementCSSInlineStyle { - var style: CSSStyleDeclaration { ReadonlyAttribute[Keys.style, in: jsObject] } + var style: CSSStyleDeclaration { ReadonlyAttribute[Strings.style, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/ElementContentEditable.swift b/Sources/DOMKit/WebIDL/ElementContentEditable.swift index 247d6f9e..139caa51 100644 --- a/Sources/DOMKit/WebIDL/ElementContentEditable.swift +++ b/Sources/DOMKit/WebIDL/ElementContentEditable.swift @@ -3,29 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let contentEditable: JSString = "contentEditable" - static let enterKeyHint: JSString = "enterKeyHint" - static let inputMode: JSString = "inputMode" - static let isContentEditable: JSString = "isContentEditable" -} - public protocol ElementContentEditable: JSBridgedClass {} public extension ElementContentEditable { var contentEditable: String { - get { ReadWriteAttribute[Keys.contentEditable, in: jsObject] } - set { ReadWriteAttribute[Keys.contentEditable, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.contentEditable, in: jsObject] } + set { ReadWriteAttribute[Strings.contentEditable, in: jsObject] = newValue } } var enterKeyHint: String { - get { ReadWriteAttribute[Keys.enterKeyHint, in: jsObject] } - set { ReadWriteAttribute[Keys.enterKeyHint, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.enterKeyHint, in: jsObject] } + set { ReadWriteAttribute[Strings.enterKeyHint, in: jsObject] = newValue } } - var isContentEditable: Bool { ReadonlyAttribute[Keys.isContentEditable, in: jsObject] } + var isContentEditable: Bool { ReadonlyAttribute[Strings.isContentEditable, in: jsObject] } var inputMode: String { - get { ReadWriteAttribute[Keys.inputMode, in: jsObject] } - set { ReadWriteAttribute[Keys.inputMode, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.inputMode, in: jsObject] } + set { ReadWriteAttribute[Strings.inputMode, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift index 667f0582..01ae6375 100644 --- a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ElementCreationOptions: BridgedDictionary { - private enum Keys { - static let `is`: JSString = "is" - } - public convenience init(is: String) { let object = JSObject.global.Object.function!.new() - object[Keys.is] = `is`.jsValue() + object[Strings.is] = `is`.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _is = ReadWriteAttribute(jsObject: object, name: Keys.is) + _is = ReadWriteAttribute(jsObject: object, name: Strings.is) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift index 9d82589c..717ee030 100644 --- a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ElementDefinitionOptions: BridgedDictionary { - private enum Keys { - static let extends: JSString = "extends" - } - public convenience init(extends: String) { let object = JSObject.global.Object.function!.new() - object[Keys.extends] = extends.jsValue() + object[Strings.extends] = extends.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _extends = ReadWriteAttribute(jsObject: object, name: Keys.extends) + _extends = ReadWriteAttribute(jsObject: object, name: Strings.extends) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index 92910461..4d68099d 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -6,28 +6,15 @@ import JavaScriptKit public class ElementInternals: JSBridgedClass, ARIAMixin { public class var constructor: JSFunction { JSObject.global.ElementInternals.function! } - private enum Keys { - static let checkValidity: JSString = "checkValidity" - static let form: JSString = "form" - static let labels: JSString = "labels" - static let reportValidity: JSString = "reportValidity" - static let setFormValue: JSString = "setFormValue" - static let setValidity: JSString = "setValidity" - static let shadowRoot: JSString = "shadowRoot" - static let validationMessage: JSString = "validationMessage" - static let validity: JSString = "validity" - static let willValidate: JSString = "willValidate" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Keys.shadowRoot) - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) - _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) - _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) + _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 } @@ -35,14 +22,14 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public var shadowRoot: ShadowRoot? public func setFormValue(value: __UNSUPPORTED_UNION__?, state: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.setFormValue]!(value.jsValue(), state?.jsValue() ?? .undefined) + _ = jsObject[Strings.setFormValue]!(value.jsValue(), state?.jsValue() ?? .undefined) } @ReadonlyAttribute public var form: HTMLFormElement? public func setValidity(flags: ValidityStateFlags? = nil, message: String? = nil, anchor: HTMLElement? = nil) { - _ = jsObject[Keys.setValidity]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined) + _ = jsObject[Strings.setValidity]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined) } @ReadonlyAttribute @@ -55,11 +42,11 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Keys.checkValidity]!().fromJSValue()! + jsObject[Strings.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Keys.reportValidity]!().fromJSValue()! + jsObject[Strings.reportValidity]!().fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ErrorEvent.swift b/Sources/DOMKit/WebIDL/ErrorEvent.swift index 62f30c88..9b57e8c1 100644 --- a/Sources/DOMKit/WebIDL/ErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/ErrorEvent.swift @@ -6,20 +6,12 @@ import JavaScriptKit public class ErrorEvent: Event { override public class var constructor: JSFunction { JSObject.global.ErrorEvent.function! } - private enum Keys { - static let colno: JSString = "colno" - static let error: JSString = "error" - static let filename: JSString = "filename" - static let lineno: JSString = "lineno" - static let message: JSString = "message" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _message = ReadonlyAttribute(jsObject: jsObject, name: Keys.message) - _filename = ReadonlyAttribute(jsObject: jsObject, name: Keys.filename) - _lineno = ReadonlyAttribute(jsObject: jsObject, name: Keys.lineno) - _colno = ReadonlyAttribute(jsObject: jsObject, name: Keys.colno) - _error = ReadonlyAttribute(jsObject: jsObject, name: Keys.error) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + _filename = ReadonlyAttribute(jsObject: jsObject, name: Strings.filename) + _lineno = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineno) + _colno = ReadonlyAttribute(jsObject: jsObject, name: Strings.colno) + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/ErrorEventInit.swift b/Sources/DOMKit/WebIDL/ErrorEventInit.swift index 8b1fe11e..c753f6d3 100644 --- a/Sources/DOMKit/WebIDL/ErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/ErrorEventInit.swift @@ -4,30 +4,22 @@ import JavaScriptEventLoop import JavaScriptKit public class ErrorEventInit: BridgedDictionary { - private enum Keys { - static let colno: JSString = "colno" - static let error: JSString = "error" - static let filename: JSString = "filename" - static let lineno: JSString = "lineno" - static let message: JSString = "message" - } - public convenience init(message: String, filename: String, lineno: UInt32, colno: UInt32, error: JSValue) { let object = JSObject.global.Object.function!.new() - object[Keys.message] = message.jsValue() - object[Keys.filename] = filename.jsValue() - object[Keys.lineno] = lineno.jsValue() - object[Keys.colno] = colno.jsValue() - object[Keys.error] = error.jsValue() + object[Strings.message] = message.jsValue() + object[Strings.filename] = filename.jsValue() + object[Strings.lineno] = lineno.jsValue() + object[Strings.colno] = colno.jsValue() + object[Strings.error] = error.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _message = ReadWriteAttribute(jsObject: object, name: Keys.message) - _filename = ReadWriteAttribute(jsObject: object, name: Keys.filename) - _lineno = ReadWriteAttribute(jsObject: object, name: Keys.lineno) - _colno = ReadWriteAttribute(jsObject: object, name: Keys.colno) - _error = ReadWriteAttribute(jsObject: object, name: Keys.error) + _message = ReadWriteAttribute(jsObject: object, name: Strings.message) + _filename = ReadWriteAttribute(jsObject: object, name: Strings.filename) + _lineno = ReadWriteAttribute(jsObject: object, name: Strings.lineno) + _colno = ReadWriteAttribute(jsObject: object, name: Strings.colno) + _error = ReadWriteAttribute(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index 37a7aad5..12fe37d7 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -6,47 +6,22 @@ import JavaScriptKit public class Event: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Event.function! } - private enum Keys { - static let AT_TARGET: JSString = "AT_TARGET" - static let BUBBLING_PHASE: JSString = "BUBBLING_PHASE" - static let CAPTURING_PHASE: JSString = "CAPTURING_PHASE" - static let NONE: JSString = "NONE" - static let bubbles: JSString = "bubbles" - static let cancelBubble: JSString = "cancelBubble" - static let cancelable: JSString = "cancelable" - static let composed: JSString = "composed" - static let composedPath: JSString = "composedPath" - static let currentTarget: JSString = "currentTarget" - static let defaultPrevented: JSString = "defaultPrevented" - static let eventPhase: JSString = "eventPhase" - static let initEvent: JSString = "initEvent" - static let isTrusted: JSString = "isTrusted" - static let preventDefault: JSString = "preventDefault" - static let returnValue: JSString = "returnValue" - static let srcElement: JSString = "srcElement" - static let stopImmediatePropagation: JSString = "stopImmediatePropagation" - static let stopPropagation: JSString = "stopPropagation" - static let target: JSString = "target" - static let timeStamp: JSString = "timeStamp" - static let type: JSString = "type" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) - _target = ReadonlyAttribute(jsObject: jsObject, name: Keys.target) - _srcElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.srcElement) - _currentTarget = ReadonlyAttribute(jsObject: jsObject, name: Keys.currentTarget) - _eventPhase = ReadonlyAttribute(jsObject: jsObject, name: Keys.eventPhase) - _cancelBubble = ReadWriteAttribute(jsObject: jsObject, name: Keys.cancelBubble) - _bubbles = ReadonlyAttribute(jsObject: jsObject, name: Keys.bubbles) - _cancelable = ReadonlyAttribute(jsObject: jsObject, name: Keys.cancelable) - _returnValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.returnValue) - _defaultPrevented = ReadonlyAttribute(jsObject: jsObject, name: Keys.defaultPrevented) - _composed = ReadonlyAttribute(jsObject: jsObject, name: Keys.composed) - _isTrusted = ReadonlyAttribute(jsObject: jsObject, name: Keys.isTrusted) - _timeStamp = ReadonlyAttribute(jsObject: jsObject, name: Keys.timeStamp) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) + _srcElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.srcElement) + _currentTarget = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTarget) + _eventPhase = ReadonlyAttribute(jsObject: jsObject, name: Strings.eventPhase) + _cancelBubble = ReadWriteAttribute(jsObject: jsObject, name: Strings.cancelBubble) + _bubbles = ReadonlyAttribute(jsObject: jsObject, name: Strings.bubbles) + _cancelable = ReadonlyAttribute(jsObject: jsObject, name: Strings.cancelable) + _returnValue = ReadWriteAttribute(jsObject: jsObject, name: Strings.returnValue) + _defaultPrevented = ReadonlyAttribute(jsObject: jsObject, name: Strings.defaultPrevented) + _composed = ReadonlyAttribute(jsObject: jsObject, name: Strings.composed) + _isTrusted = ReadonlyAttribute(jsObject: jsObject, name: Strings.isTrusted) + _timeStamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeStamp) self.jsObject = jsObject } @@ -67,7 +42,7 @@ public class Event: JSBridgedClass { public var currentTarget: EventTarget? public func composedPath() -> [EventTarget] { - jsObject[Keys.composedPath]!().fromJSValue()! + jsObject[Strings.composedPath]!().fromJSValue()! } public static let NONE: UInt16 = 0 @@ -82,14 +57,14 @@ public class Event: JSBridgedClass { public var eventPhase: UInt16 public func stopPropagation() { - _ = jsObject[Keys.stopPropagation]!() + _ = jsObject[Strings.stopPropagation]!() } @ReadWriteAttribute public var cancelBubble: Bool public func stopImmediatePropagation() { - _ = jsObject[Keys.stopImmediatePropagation]!() + _ = jsObject[Strings.stopImmediatePropagation]!() } @ReadonlyAttribute @@ -102,7 +77,7 @@ public class Event: JSBridgedClass { public var returnValue: Bool public func preventDefault() { - _ = jsObject[Keys.preventDefault]!() + _ = jsObject[Strings.preventDefault]!() } @ReadonlyAttribute @@ -118,6 +93,6 @@ public class Event: JSBridgedClass { public var timeStamp: DOMHighResTimeStamp public func initEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil) { - _ = jsObject[Keys.initEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined) + _ = jsObject[Strings.initEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/EventInit.swift b/Sources/DOMKit/WebIDL/EventInit.swift index 87448979..ef24e26d 100644 --- a/Sources/DOMKit/WebIDL/EventInit.swift +++ b/Sources/DOMKit/WebIDL/EventInit.swift @@ -4,24 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class EventInit: BridgedDictionary { - private enum Keys { - static let bubbles: JSString = "bubbles" - static let cancelable: JSString = "cancelable" - static let composed: JSString = "composed" - } - public convenience init(bubbles: Bool, cancelable: Bool, composed: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.bubbles] = bubbles.jsValue() - object[Keys.cancelable] = cancelable.jsValue() - object[Keys.composed] = composed.jsValue() + object[Strings.bubbles] = bubbles.jsValue() + object[Strings.cancelable] = cancelable.jsValue() + object[Strings.composed] = composed.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _bubbles = ReadWriteAttribute(jsObject: object, name: Keys.bubbles) - _cancelable = ReadWriteAttribute(jsObject: object, name: Keys.cancelable) - _composed = ReadWriteAttribute(jsObject: object, name: Keys.composed) + _bubbles = ReadWriteAttribute(jsObject: object, name: Strings.bubbles) + _cancelable = ReadWriteAttribute(jsObject: object, name: Strings.cancelable) + _composed = ReadWriteAttribute(jsObject: object, name: Strings.composed) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventListenerOptions.swift b/Sources/DOMKit/WebIDL/EventListenerOptions.swift index c2973782..1ada7d34 100644 --- a/Sources/DOMKit/WebIDL/EventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/EventListenerOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class EventListenerOptions: BridgedDictionary { - private enum Keys { - static let capture: JSString = "capture" - } - public convenience init(capture: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.capture] = capture.jsValue() + object[Strings.capture] = capture.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _capture = ReadWriteAttribute(jsObject: object, name: Keys.capture) + _capture = ReadWriteAttribute(jsObject: object, name: Strings.capture) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventModifierInit.swift b/Sources/DOMKit/WebIDL/EventModifierInit.swift index 97435198..16e06b1a 100644 --- a/Sources/DOMKit/WebIDL/EventModifierInit.swift +++ b/Sources/DOMKit/WebIDL/EventModifierInit.swift @@ -4,57 +4,40 @@ import JavaScriptEventLoop import JavaScriptKit public class EventModifierInit: BridgedDictionary { - private enum Keys { - static let altKey: JSString = "altKey" - static let ctrlKey: JSString = "ctrlKey" - static let metaKey: JSString = "metaKey" - static let modifierAltGraph: JSString = "modifierAltGraph" - static let modifierCapsLock: JSString = "modifierCapsLock" - static let modifierFn: JSString = "modifierFn" - static let modifierFnLock: JSString = "modifierFnLock" - static let modifierHyper: JSString = "modifierHyper" - static let modifierNumLock: JSString = "modifierNumLock" - static let modifierScrollLock: JSString = "modifierScrollLock" - static let modifierSuper: JSString = "modifierSuper" - static let modifierSymbol: JSString = "modifierSymbol" - static let modifierSymbolLock: JSString = "modifierSymbolLock" - static let shiftKey: JSString = "shiftKey" - } - public convenience init(ctrlKey: Bool, shiftKey: Bool, altKey: Bool, metaKey: Bool, modifierAltGraph: Bool, modifierCapsLock: Bool, modifierFn: Bool, modifierFnLock: Bool, modifierHyper: Bool, modifierNumLock: Bool, modifierScrollLock: Bool, modifierSuper: Bool, modifierSymbol: Bool, modifierSymbolLock: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.ctrlKey] = ctrlKey.jsValue() - object[Keys.shiftKey] = shiftKey.jsValue() - object[Keys.altKey] = altKey.jsValue() - object[Keys.metaKey] = metaKey.jsValue() - object[Keys.modifierAltGraph] = modifierAltGraph.jsValue() - object[Keys.modifierCapsLock] = modifierCapsLock.jsValue() - object[Keys.modifierFn] = modifierFn.jsValue() - object[Keys.modifierFnLock] = modifierFnLock.jsValue() - object[Keys.modifierHyper] = modifierHyper.jsValue() - object[Keys.modifierNumLock] = modifierNumLock.jsValue() - object[Keys.modifierScrollLock] = modifierScrollLock.jsValue() - object[Keys.modifierSuper] = modifierSuper.jsValue() - object[Keys.modifierSymbol] = modifierSymbol.jsValue() - object[Keys.modifierSymbolLock] = modifierSymbolLock.jsValue() + object[Strings.ctrlKey] = ctrlKey.jsValue() + object[Strings.shiftKey] = shiftKey.jsValue() + object[Strings.altKey] = altKey.jsValue() + object[Strings.metaKey] = metaKey.jsValue() + object[Strings.modifierAltGraph] = modifierAltGraph.jsValue() + object[Strings.modifierCapsLock] = modifierCapsLock.jsValue() + object[Strings.modifierFn] = modifierFn.jsValue() + object[Strings.modifierFnLock] = modifierFnLock.jsValue() + object[Strings.modifierHyper] = modifierHyper.jsValue() + object[Strings.modifierNumLock] = modifierNumLock.jsValue() + object[Strings.modifierScrollLock] = modifierScrollLock.jsValue() + object[Strings.modifierSuper] = modifierSuper.jsValue() + object[Strings.modifierSymbol] = modifierSymbol.jsValue() + object[Strings.modifierSymbolLock] = modifierSymbolLock.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _ctrlKey = ReadWriteAttribute(jsObject: object, name: Keys.ctrlKey) - _shiftKey = ReadWriteAttribute(jsObject: object, name: Keys.shiftKey) - _altKey = ReadWriteAttribute(jsObject: object, name: Keys.altKey) - _metaKey = ReadWriteAttribute(jsObject: object, name: Keys.metaKey) - _modifierAltGraph = ReadWriteAttribute(jsObject: object, name: Keys.modifierAltGraph) - _modifierCapsLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierCapsLock) - _modifierFn = ReadWriteAttribute(jsObject: object, name: Keys.modifierFn) - _modifierFnLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierFnLock) - _modifierHyper = ReadWriteAttribute(jsObject: object, name: Keys.modifierHyper) - _modifierNumLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierNumLock) - _modifierScrollLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierScrollLock) - _modifierSuper = ReadWriteAttribute(jsObject: object, name: Keys.modifierSuper) - _modifierSymbol = ReadWriteAttribute(jsObject: object, name: Keys.modifierSymbol) - _modifierSymbolLock = ReadWriteAttribute(jsObject: object, name: Keys.modifierSymbolLock) + _ctrlKey = ReadWriteAttribute(jsObject: object, name: Strings.ctrlKey) + _shiftKey = ReadWriteAttribute(jsObject: object, name: Strings.shiftKey) + _altKey = ReadWriteAttribute(jsObject: object, name: Strings.altKey) + _metaKey = ReadWriteAttribute(jsObject: object, name: Strings.metaKey) + _modifierAltGraph = ReadWriteAttribute(jsObject: object, name: Strings.modifierAltGraph) + _modifierCapsLock = ReadWriteAttribute(jsObject: object, name: Strings.modifierCapsLock) + _modifierFn = ReadWriteAttribute(jsObject: object, name: Strings.modifierFn) + _modifierFnLock = ReadWriteAttribute(jsObject: object, name: Strings.modifierFnLock) + _modifierHyper = ReadWriteAttribute(jsObject: object, name: Strings.modifierHyper) + _modifierNumLock = ReadWriteAttribute(jsObject: object, name: Strings.modifierNumLock) + _modifierScrollLock = ReadWriteAttribute(jsObject: object, name: Strings.modifierScrollLock) + _modifierSuper = ReadWriteAttribute(jsObject: object, name: Strings.modifierSuper) + _modifierSymbol = ReadWriteAttribute(jsObject: object, name: Strings.modifierSymbol) + _modifierSymbolLock = ReadWriteAttribute(jsObject: object, name: Strings.modifierSymbolLock) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index 9af5fd7e..1e896713 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -6,26 +6,13 @@ import JavaScriptKit public class EventSource: EventTarget { override public class var constructor: JSFunction { JSObject.global.EventSource.function! } - private enum Keys { - static let CLOSED: JSString = "CLOSED" - static let CONNECTING: JSString = "CONNECTING" - static let OPEN: JSString = "OPEN" - static let close: JSString = "close" - static let onerror: JSString = "onerror" - static let onmessage: JSString = "onmessage" - static let onopen: JSString = "onopen" - static let readyState: JSString = "readyState" - static let url: JSString = "url" - static let withCredentials: JSString = "withCredentials" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _url = ReadonlyAttribute(jsObject: jsObject, name: Keys.url) - _withCredentials = ReadonlyAttribute(jsObject: jsObject, name: Keys.withCredentials) - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) - _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onopen) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onerror) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _withCredentials = ReadonlyAttribute(jsObject: jsObject, name: Strings.withCredentials) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onopen) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) super.init(unsafelyWrapping: jsObject) } @@ -58,6 +45,6 @@ public class EventSource: EventTarget { public var onerror: EventHandler public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } } diff --git a/Sources/DOMKit/WebIDL/EventSourceInit.swift b/Sources/DOMKit/WebIDL/EventSourceInit.swift index d0109b69..00d32af6 100644 --- a/Sources/DOMKit/WebIDL/EventSourceInit.swift +++ b/Sources/DOMKit/WebIDL/EventSourceInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class EventSourceInit: BridgedDictionary { - private enum Keys { - static let withCredentials: JSString = "withCredentials" - } - public convenience init(withCredentials: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.withCredentials] = withCredentials.jsValue() + object[Strings.withCredentials] = withCredentials.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _withCredentials = ReadWriteAttribute(jsObject: object, name: Keys.withCredentials) + _withCredentials = ReadWriteAttribute(jsObject: object, name: Strings.withCredentials) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventTarget.swift b/Sources/DOMKit/WebIDL/EventTarget.swift index 2a5e4904..64c67da1 100644 --- a/Sources/DOMKit/WebIDL/EventTarget.swift +++ b/Sources/DOMKit/WebIDL/EventTarget.swift @@ -6,12 +6,6 @@ import JavaScriptKit public class EventTarget: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.EventTarget.function! } - private enum Keys { - static let addEventListener: JSString = "addEventListener" - static let dispatchEvent: JSString = "dispatchEvent" - static let removeEventListener: JSString = "removeEventListener" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -27,6 +21,6 @@ public class EventTarget: JSBridgedClass { // XXX: member 'removeEventListener' is ignored public func dispatchEvent(event: Event) -> Bool { - jsObject[Keys.dispatchEvent]!(event.jsValue()).fromJSValue()! + jsObject[Strings.dispatchEvent]!(event.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/External.swift b/Sources/DOMKit/WebIDL/External.swift index 4c6e4497..9ca28bda 100644 --- a/Sources/DOMKit/WebIDL/External.swift +++ b/Sources/DOMKit/WebIDL/External.swift @@ -6,11 +6,6 @@ import JavaScriptKit public class External: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.External.function! } - private enum Keys { - static let AddSearchProvider: JSString = "AddSearchProvider" - static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -18,10 +13,10 @@ public class External: JSBridgedClass { } public func AddSearchProvider() { - _ = jsObject[Keys.AddSearchProvider]!() + _ = jsObject[Strings.AddSearchProvider]!() } public func IsSearchProviderInstalled() { - _ = jsObject[Keys.IsSearchProviderInstalled]!() + _ = jsObject[Strings.IsSearchProviderInstalled]!() } } diff --git a/Sources/DOMKit/WebIDL/File.swift b/Sources/DOMKit/WebIDL/File.swift index cfb5a1ba..6b711f6a 100644 --- a/Sources/DOMKit/WebIDL/File.swift +++ b/Sources/DOMKit/WebIDL/File.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class File: Blob { override public class var constructor: JSFunction { JSObject.global.File.function! } - private enum Keys { - static let lastModified: JSString = "lastModified" - static let name: JSString = "name" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) - _lastModified = ReadonlyAttribute(jsObject: jsObject, name: Keys.lastModified) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _lastModified = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastModified) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/FileList.swift b/Sources/DOMKit/WebIDL/FileList.swift index bfe0837c..7d09065f 100644 --- a/Sources/DOMKit/WebIDL/FileList.swift +++ b/Sources/DOMKit/WebIDL/FileList.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class FileList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.FileList.function! } - private enum Keys { - static let item: JSString = "item" - static let length: JSString = "length" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/FilePropertyBag.swift b/Sources/DOMKit/WebIDL/FilePropertyBag.swift index 04d02567..24d525a8 100644 --- a/Sources/DOMKit/WebIDL/FilePropertyBag.swift +++ b/Sources/DOMKit/WebIDL/FilePropertyBag.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class FilePropertyBag: BridgedDictionary { - private enum Keys { - static let lastModified: JSString = "lastModified" - } - public convenience init(lastModified: Int64) { let object = JSObject.global.Object.function!.new() - object[Keys.lastModified] = lastModified.jsValue() + object[Strings.lastModified] = lastModified.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _lastModified = ReadWriteAttribute(jsObject: object, name: Keys.lastModified) + _lastModified = ReadWriteAttribute(jsObject: object, name: Strings.lastModified) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index c6f8a62e..f9a0375c 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -6,36 +6,16 @@ import JavaScriptKit public class FileReader: EventTarget { override public class var constructor: JSFunction { JSObject.global.FileReader.function! } - private enum Keys { - static let DONE: JSString = "DONE" - static let EMPTY: JSString = "EMPTY" - static let LOADING: JSString = "LOADING" - static let abort: JSString = "abort" - static let error: JSString = "error" - static let onabort: JSString = "onabort" - static let onerror: JSString = "onerror" - static let onload: JSString = "onload" - static let onloadend: JSString = "onloadend" - static let onloadstart: JSString = "onloadstart" - static let onprogress: JSString = "onprogress" - static let readAsArrayBuffer: JSString = "readAsArrayBuffer" - static let readAsBinaryString: JSString = "readAsBinaryString" - static let readAsDataURL: JSString = "readAsDataURL" - static let readAsText: JSString = "readAsText" - static let readyState: JSString = "readyState" - static let result: JSString = "result" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) - _result = ReadonlyAttribute(jsObject: jsObject, name: Keys.result) - _error = ReadonlyAttribute(jsObject: jsObject, name: Keys.error) - _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onloadstart) - _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onprogress) - _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onload) - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onabort) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onerror) - _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onloadend) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _result = ReadonlyAttribute(jsObject: jsObject, name: Strings.result) + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadstart) + _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprogress) + _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onload) + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadend) super.init(unsafelyWrapping: jsObject) } @@ -44,23 +24,23 @@ public class FileReader: EventTarget { } public func readAsArrayBuffer(blob: Blob) { - _ = jsObject[Keys.readAsArrayBuffer]!(blob.jsValue()) + _ = jsObject[Strings.readAsArrayBuffer]!(blob.jsValue()) } public func readAsBinaryString(blob: Blob) { - _ = jsObject[Keys.readAsBinaryString]!(blob.jsValue()) + _ = jsObject[Strings.readAsBinaryString]!(blob.jsValue()) } public func readAsText(blob: Blob, encoding: String? = nil) { - _ = jsObject[Keys.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined) + _ = jsObject[Strings.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined) } public func readAsDataURL(blob: Blob) { - _ = jsObject[Keys.readAsDataURL]!(blob.jsValue()) + _ = jsObject[Strings.readAsDataURL]!(blob.jsValue()) } public func abort() { - _ = jsObject[Keys.abort]!() + _ = jsObject[Strings.abort]!() } public static let EMPTY: UInt16 = 0 diff --git a/Sources/DOMKit/WebIDL/FileReaderSync.swift b/Sources/DOMKit/WebIDL/FileReaderSync.swift index 5dd598be..d7bc9a1d 100644 --- a/Sources/DOMKit/WebIDL/FileReaderSync.swift +++ b/Sources/DOMKit/WebIDL/FileReaderSync.swift @@ -6,13 +6,6 @@ import JavaScriptKit public class FileReaderSync: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.FileReaderSync.function! } - private enum Keys { - static let readAsArrayBuffer: JSString = "readAsArrayBuffer" - static let readAsBinaryString: JSString = "readAsBinaryString" - static let readAsDataURL: JSString = "readAsDataURL" - static let readAsText: JSString = "readAsText" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -24,18 +17,18 @@ public class FileReaderSync: JSBridgedClass { } public func readAsArrayBuffer(blob: Blob) -> ArrayBuffer { - jsObject[Keys.readAsArrayBuffer]!(blob.jsValue()).fromJSValue()! + jsObject[Strings.readAsArrayBuffer]!(blob.jsValue()).fromJSValue()! } public func readAsBinaryString(blob: Blob) -> String { - jsObject[Keys.readAsBinaryString]!(blob.jsValue()).fromJSValue()! + jsObject[Strings.readAsBinaryString]!(blob.jsValue()).fromJSValue()! } public func readAsText(blob: Blob, encoding: String? = nil) -> String { - jsObject[Keys.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined).fromJSValue()! } public func readAsDataURL(blob: Blob) -> String { - jsObject[Keys.readAsDataURL]!(blob.jsValue()).fromJSValue()! + jsObject[Strings.readAsDataURL]!(blob.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FocusEvent.swift b/Sources/DOMKit/WebIDL/FocusEvent.swift index cd459a45..c38fbecf 100644 --- a/Sources/DOMKit/WebIDL/FocusEvent.swift +++ b/Sources/DOMKit/WebIDL/FocusEvent.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class FocusEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.FocusEvent.function! } - private enum Keys { - static let relatedTarget: JSString = "relatedTarget" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Keys.relatedTarget) + _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedTarget) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/FocusEventInit.swift b/Sources/DOMKit/WebIDL/FocusEventInit.swift index f9040195..5c0fc273 100644 --- a/Sources/DOMKit/WebIDL/FocusEventInit.swift +++ b/Sources/DOMKit/WebIDL/FocusEventInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class FocusEventInit: BridgedDictionary { - private enum Keys { - static let relatedTarget: JSString = "relatedTarget" - } - public convenience init(relatedTarget: EventTarget?) { let object = JSObject.global.Object.function!.new() - object[Keys.relatedTarget] = relatedTarget.jsValue() + object[Strings.relatedTarget] = relatedTarget.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _relatedTarget = ReadWriteAttribute(jsObject: object, name: Keys.relatedTarget) + _relatedTarget = ReadWriteAttribute(jsObject: object, name: Strings.relatedTarget) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FocusOptions.swift b/Sources/DOMKit/WebIDL/FocusOptions.swift index a2a2a8ce..da5d89ff 100644 --- a/Sources/DOMKit/WebIDL/FocusOptions.swift +++ b/Sources/DOMKit/WebIDL/FocusOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class FocusOptions: BridgedDictionary { - private enum Keys { - static let preventScroll: JSString = "preventScroll" - } - public convenience init(preventScroll: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.preventScroll] = preventScroll.jsValue() + object[Strings.preventScroll] = preventScroll.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _preventScroll = ReadWriteAttribute(jsObject: object, name: Keys.preventScroll) + _preventScroll = ReadWriteAttribute(jsObject: object, name: Strings.preventScroll) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index 3d29e8e1..6e0d7689 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -6,15 +6,6 @@ import JavaScriptKit public class FormData: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.FormData.function! } - private enum Keys { - static let append: JSString = "append" - static let delete: JSString = "delete" - static let get: JSString = "get" - static let getAll: JSString = "getAll" - static let has: JSString = "has" - static let set: JSString = "set" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -26,35 +17,35 @@ public class FormData: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - _ = jsObject[Keys.append]!(name.jsValue(), value.jsValue()) + _ = jsObject[Strings.append]!(name.jsValue(), value.jsValue()) } public func append(name: String, blobValue: Blob, filename: String? = nil) { - _ = jsObject[Keys.append]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) + _ = jsObject[Strings.append]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) } public func delete(name: String) { - _ = jsObject[Keys.delete]!(name.jsValue()) + _ = jsObject[Strings.delete]!(name.jsValue()) } public func get(name: String) -> FormDataEntryValue? { - jsObject[Keys.get]!(name.jsValue()).fromJSValue()! + jsObject[Strings.get]!(name.jsValue()).fromJSValue()! } public func getAll(name: String) -> [FormDataEntryValue] { - jsObject[Keys.getAll]!(name.jsValue()).fromJSValue()! + jsObject[Strings.getAll]!(name.jsValue()).fromJSValue()! } public func has(name: String) -> Bool { - jsObject[Keys.has]!(name.jsValue()).fromJSValue()! + jsObject[Strings.has]!(name.jsValue()).fromJSValue()! } public func set(name: String, value: String) { - _ = jsObject[Keys.set]!(name.jsValue(), value.jsValue()) + _ = jsObject[Strings.set]!(name.jsValue(), value.jsValue()) } public func set(name: String, blobValue: Blob, filename: String? = nil) { - _ = jsObject[Keys.set]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) + _ = jsObject[Strings.set]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/FormDataEvent.swift b/Sources/DOMKit/WebIDL/FormDataEvent.swift index 86e1c23d..16693fdd 100644 --- a/Sources/DOMKit/WebIDL/FormDataEvent.swift +++ b/Sources/DOMKit/WebIDL/FormDataEvent.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class FormDataEvent: Event { override public class var constructor: JSFunction { JSObject.global.FormDataEvent.function! } - private enum Keys { - static let formData: JSString = "formData" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _formData = ReadonlyAttribute(jsObject: jsObject, name: Keys.formData) + _formData = ReadonlyAttribute(jsObject: jsObject, name: Strings.formData) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/FormDataEventInit.swift b/Sources/DOMKit/WebIDL/FormDataEventInit.swift index a8fcb915..b6127cd0 100644 --- a/Sources/DOMKit/WebIDL/FormDataEventInit.swift +++ b/Sources/DOMKit/WebIDL/FormDataEventInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class FormDataEventInit: BridgedDictionary { - private enum Keys { - static let formData: JSString = "formData" - } - public convenience init(formData: FormData) { let object = JSObject.global.Object.function!.new() - object[Keys.formData] = formData.jsValue() + object[Strings.formData] = formData.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _formData = ReadWriteAttribute(jsObject: object, name: Keys.formData) + _formData = ReadWriteAttribute(jsObject: object, name: Strings.formData) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GenericTransformStream.swift b/Sources/DOMKit/WebIDL/GenericTransformStream.swift index fbb2bad3..20704ef4 100644 --- a/Sources/DOMKit/WebIDL/GenericTransformStream.swift +++ b/Sources/DOMKit/WebIDL/GenericTransformStream.swift @@ -3,14 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let readable: JSString = "readable" - static let writable: JSString = "writable" -} - public protocol GenericTransformStream: JSBridgedClass {} public extension GenericTransformStream { - var readable: ReadableStream { ReadonlyAttribute[Keys.readable, in: jsObject] } + var readable: ReadableStream { ReadonlyAttribute[Strings.readable, in: jsObject] } - var writable: WritableStream { ReadonlyAttribute[Keys.writable, in: jsObject] } + var writable: WritableStream { ReadonlyAttribute[Strings.writable, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift index 991d043b..8e867878 100644 --- a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift +++ b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class GetRootNodeOptions: BridgedDictionary { - private enum Keys { - static let composed: JSString = "composed" - } - public convenience init(composed: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.composed] = composed.jsValue() + object[Strings.composed] = composed.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _composed = ReadWriteAttribute(jsObject: object, name: Keys.composed) + _composed = ReadWriteAttribute(jsObject: object, name: Strings.composed) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index 553cd0a5..865a18c8 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -3,416 +3,345 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let onabort: JSString = "onabort" - static let onauxclick: JSString = "onauxclick" - static let onblur: JSString = "onblur" - static let oncancel: JSString = "oncancel" - static let oncanplay: JSString = "oncanplay" - static let oncanplaythrough: JSString = "oncanplaythrough" - static let onchange: JSString = "onchange" - static let onclick: JSString = "onclick" - static let onclose: JSString = "onclose" - static let oncontextlost: JSString = "oncontextlost" - static let oncontextmenu: JSString = "oncontextmenu" - static let oncontextrestored: JSString = "oncontextrestored" - static let oncuechange: JSString = "oncuechange" - static let ondblclick: JSString = "ondblclick" - static let ondrag: JSString = "ondrag" - static let ondragend: JSString = "ondragend" - static let ondragenter: JSString = "ondragenter" - static let ondragleave: JSString = "ondragleave" - static let ondragover: JSString = "ondragover" - static let ondragstart: JSString = "ondragstart" - static let ondrop: JSString = "ondrop" - static let ondurationchange: JSString = "ondurationchange" - static let onemptied: JSString = "onemptied" - static let onended: JSString = "onended" - static let onerror: JSString = "onerror" - static let onfocus: JSString = "onfocus" - static let onformdata: JSString = "onformdata" - static let oninput: JSString = "oninput" - static let oninvalid: JSString = "oninvalid" - static let onkeydown: JSString = "onkeydown" - static let onkeypress: JSString = "onkeypress" - static let onkeyup: JSString = "onkeyup" - static let onload: JSString = "onload" - static let onloadeddata: JSString = "onloadeddata" - static let onloadedmetadata: JSString = "onloadedmetadata" - static let onloadstart: JSString = "onloadstart" - static let onmousedown: JSString = "onmousedown" - static let onmouseenter: JSString = "onmouseenter" - static let onmouseleave: JSString = "onmouseleave" - static let onmousemove: JSString = "onmousemove" - static let onmouseout: JSString = "onmouseout" - static let onmouseover: JSString = "onmouseover" - static let onmouseup: JSString = "onmouseup" - static let onpause: JSString = "onpause" - static let onplay: JSString = "onplay" - static let onplaying: JSString = "onplaying" - static let onprogress: JSString = "onprogress" - static let onratechange: JSString = "onratechange" - static let onreset: JSString = "onreset" - static let onresize: JSString = "onresize" - static let onscroll: JSString = "onscroll" - static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" - static let onseeked: JSString = "onseeked" - static let onseeking: JSString = "onseeking" - static let onselect: JSString = "onselect" - static let onslotchange: JSString = "onslotchange" - static let onstalled: JSString = "onstalled" - static let onsubmit: JSString = "onsubmit" - static let onsuspend: JSString = "onsuspend" - static let ontimeupdate: JSString = "ontimeupdate" - static let ontoggle: JSString = "ontoggle" - static let onvolumechange: JSString = "onvolumechange" - static let onwaiting: JSString = "onwaiting" - static let onwebkitanimationend: JSString = "onwebkitanimationend" - static let onwebkitanimationiteration: JSString = "onwebkitanimationiteration" - static let onwebkitanimationstart: JSString = "onwebkitanimationstart" - static let onwebkittransitionend: JSString = "onwebkittransitionend" - static let onwheel: JSString = "onwheel" -} - public protocol GlobalEventHandlers: JSBridgedClass {} public extension GlobalEventHandlers { var onabort: EventHandler { - get { ClosureAttribute.Optional1[Keys.onabort, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onabort, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onabort, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onabort, in: jsObject] = newValue } } var onauxclick: EventHandler { - get { ClosureAttribute.Optional1[Keys.onauxclick, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onauxclick, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onauxclick, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onauxclick, in: jsObject] = newValue } } var onblur: EventHandler { - get { ClosureAttribute.Optional1[Keys.onblur, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onblur, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onblur, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onblur, in: jsObject] = newValue } } var oncancel: EventHandler { - get { ClosureAttribute.Optional1[Keys.oncancel, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oncancel, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oncancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncancel, in: jsObject] = newValue } } var oncanplay: EventHandler { - get { ClosureAttribute.Optional1[Keys.oncanplay, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oncanplay, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oncanplay, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncanplay, in: jsObject] = newValue } } var oncanplaythrough: EventHandler { - get { ClosureAttribute.Optional1[Keys.oncanplaythrough, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oncanplaythrough, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oncanplaythrough, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncanplaythrough, in: jsObject] = newValue } } var onchange: EventHandler { - get { ClosureAttribute.Optional1[Keys.onchange, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onchange, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onchange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onchange, in: jsObject] = newValue } } var onclick: EventHandler { - get { ClosureAttribute.Optional1[Keys.onclick, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onclick, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onclick, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onclick, in: jsObject] = newValue } } var onclose: EventHandler { - get { ClosureAttribute.Optional1[Keys.onclose, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onclose, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onclose, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onclose, in: jsObject] = newValue } } var oncontextlost: EventHandler { - get { ClosureAttribute.Optional1[Keys.oncontextlost, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oncontextlost, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oncontextlost, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncontextlost, in: jsObject] = newValue } } var oncontextmenu: EventHandler { - get { ClosureAttribute.Optional1[Keys.oncontextmenu, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oncontextmenu, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oncontextmenu, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncontextmenu, in: jsObject] = newValue } } var oncontextrestored: EventHandler { - get { ClosureAttribute.Optional1[Keys.oncontextrestored, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oncontextrestored, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oncontextrestored, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncontextrestored, in: jsObject] = newValue } } var oncuechange: EventHandler { - get { ClosureAttribute.Optional1[Keys.oncuechange, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oncuechange, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oncuechange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncuechange, in: jsObject] = newValue } } var ondblclick: EventHandler { - get { ClosureAttribute.Optional1[Keys.ondblclick, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ondblclick, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ondblclick, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ondblclick, in: jsObject] = newValue } } var ondrag: EventHandler { - get { ClosureAttribute.Optional1[Keys.ondrag, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ondrag, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ondrag, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ondrag, in: jsObject] = newValue } } var ondragend: EventHandler { - get { ClosureAttribute.Optional1[Keys.ondragend, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ondragend, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ondragend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ondragend, in: jsObject] = newValue } } var ondragenter: EventHandler { - get { ClosureAttribute.Optional1[Keys.ondragenter, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ondragenter, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ondragenter, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ondragenter, in: jsObject] = newValue } } var ondragleave: EventHandler { - get { ClosureAttribute.Optional1[Keys.ondragleave, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ondragleave, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ondragleave, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ondragleave, in: jsObject] = newValue } } var ondragover: EventHandler { - get { ClosureAttribute.Optional1[Keys.ondragover, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ondragover, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ondragover, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ondragover, in: jsObject] = newValue } } var ondragstart: EventHandler { - get { ClosureAttribute.Optional1[Keys.ondragstart, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ondragstart, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ondragstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ondragstart, in: jsObject] = newValue } } var ondrop: EventHandler { - get { ClosureAttribute.Optional1[Keys.ondrop, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ondrop, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ondrop, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ondrop, in: jsObject] = newValue } } var ondurationchange: EventHandler { - get { ClosureAttribute.Optional1[Keys.ondurationchange, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ondurationchange, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ondurationchange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ondurationchange, in: jsObject] = newValue } } var onemptied: EventHandler { - get { ClosureAttribute.Optional1[Keys.onemptied, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onemptied, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onemptied, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onemptied, in: jsObject] = newValue } } var onended: EventHandler { - get { ClosureAttribute.Optional1[Keys.onended, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onended, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onended, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onended, in: jsObject] = newValue } } var onerror: OnErrorEventHandler { - get { ClosureAttribute.Optional5[Keys.onerror, in: jsObject] } - set { ClosureAttribute.Optional5[Keys.onerror, in: jsObject] = newValue } + get { ClosureAttribute.Optional5[Strings.onerror, in: jsObject] } + set { ClosureAttribute.Optional5[Strings.onerror, in: jsObject] = newValue } } var onfocus: EventHandler { - get { ClosureAttribute.Optional1[Keys.onfocus, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onfocus, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onfocus, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onfocus, in: jsObject] = newValue } } var onformdata: EventHandler { - get { ClosureAttribute.Optional1[Keys.onformdata, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onformdata, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onformdata, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onformdata, in: jsObject] = newValue } } var oninput: EventHandler { - get { ClosureAttribute.Optional1[Keys.oninput, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oninput, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oninput, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oninput, in: jsObject] = newValue } } var oninvalid: EventHandler { - get { ClosureAttribute.Optional1[Keys.oninvalid, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.oninvalid, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.oninvalid, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oninvalid, in: jsObject] = newValue } } var onkeydown: EventHandler { - get { ClosureAttribute.Optional1[Keys.onkeydown, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onkeydown, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onkeydown, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onkeydown, in: jsObject] = newValue } } var onkeypress: EventHandler { - get { ClosureAttribute.Optional1[Keys.onkeypress, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onkeypress, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onkeypress, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onkeypress, in: jsObject] = newValue } } var onkeyup: EventHandler { - get { ClosureAttribute.Optional1[Keys.onkeyup, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onkeyup, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onkeyup, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onkeyup, in: jsObject] = newValue } } var onload: EventHandler { - get { ClosureAttribute.Optional1[Keys.onload, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onload, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onload, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onload, in: jsObject] = newValue } } var onloadeddata: EventHandler { - get { ClosureAttribute.Optional1[Keys.onloadeddata, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onloadeddata, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onloadeddata, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onloadeddata, in: jsObject] = newValue } } var onloadedmetadata: EventHandler { - get { ClosureAttribute.Optional1[Keys.onloadedmetadata, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onloadedmetadata, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onloadedmetadata, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onloadedmetadata, in: jsObject] = newValue } } var onloadstart: EventHandler { - get { ClosureAttribute.Optional1[Keys.onloadstart, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onloadstart, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onloadstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onloadstart, in: jsObject] = newValue } } var onmousedown: EventHandler { - get { ClosureAttribute.Optional1[Keys.onmousedown, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onmousedown, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onmousedown, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onmousedown, in: jsObject] = newValue } } var onmouseenter: EventHandler { - get { ClosureAttribute.Optional1[Keys.onmouseenter, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onmouseenter, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onmouseenter, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onmouseenter, in: jsObject] = newValue } } var onmouseleave: EventHandler { - get { ClosureAttribute.Optional1[Keys.onmouseleave, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onmouseleave, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onmouseleave, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onmouseleave, in: jsObject] = newValue } } var onmousemove: EventHandler { - get { ClosureAttribute.Optional1[Keys.onmousemove, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onmousemove, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onmousemove, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onmousemove, in: jsObject] = newValue } } var onmouseout: EventHandler { - get { ClosureAttribute.Optional1[Keys.onmouseout, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onmouseout, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onmouseout, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onmouseout, in: jsObject] = newValue } } var onmouseover: EventHandler { - get { ClosureAttribute.Optional1[Keys.onmouseover, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onmouseover, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onmouseover, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onmouseover, in: jsObject] = newValue } } var onmouseup: EventHandler { - get { ClosureAttribute.Optional1[Keys.onmouseup, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onmouseup, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onmouseup, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onmouseup, in: jsObject] = newValue } } var onpause: EventHandler { - get { ClosureAttribute.Optional1[Keys.onpause, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onpause, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onpause, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpause, in: jsObject] = newValue } } var onplay: EventHandler { - get { ClosureAttribute.Optional1[Keys.onplay, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onplay, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onplay, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onplay, in: jsObject] = newValue } } var onplaying: EventHandler { - get { ClosureAttribute.Optional1[Keys.onplaying, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onplaying, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onplaying, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onplaying, in: jsObject] = newValue } } var onprogress: EventHandler { - get { ClosureAttribute.Optional1[Keys.onprogress, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onprogress, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onprogress, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onprogress, in: jsObject] = newValue } } var onratechange: EventHandler { - get { ClosureAttribute.Optional1[Keys.onratechange, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onratechange, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onratechange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onratechange, in: jsObject] = newValue } } var onreset: EventHandler { - get { ClosureAttribute.Optional1[Keys.onreset, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onreset, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onreset, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onreset, in: jsObject] = newValue } } var onresize: EventHandler { - get { ClosureAttribute.Optional1[Keys.onresize, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onresize, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onresize, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onresize, in: jsObject] = newValue } } var onscroll: EventHandler { - get { ClosureAttribute.Optional1[Keys.onscroll, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onscroll, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onscroll, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onscroll, in: jsObject] = newValue } } var onsecuritypolicyviolation: EventHandler { - get { ClosureAttribute.Optional1[Keys.onsecuritypolicyviolation, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onsecuritypolicyviolation, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onsecuritypolicyviolation, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onsecuritypolicyviolation, in: jsObject] = newValue } } var onseeked: EventHandler { - get { ClosureAttribute.Optional1[Keys.onseeked, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onseeked, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onseeked, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onseeked, in: jsObject] = newValue } } var onseeking: EventHandler { - get { ClosureAttribute.Optional1[Keys.onseeking, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onseeking, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onseeking, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onseeking, in: jsObject] = newValue } } var onselect: EventHandler { - get { ClosureAttribute.Optional1[Keys.onselect, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onselect, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onselect, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onselect, in: jsObject] = newValue } } var onslotchange: EventHandler { - get { ClosureAttribute.Optional1[Keys.onslotchange, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onslotchange, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onslotchange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onslotchange, in: jsObject] = newValue } } var onstalled: EventHandler { - get { ClosureAttribute.Optional1[Keys.onstalled, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onstalled, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onstalled, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onstalled, in: jsObject] = newValue } } var onsubmit: EventHandler { - get { ClosureAttribute.Optional1[Keys.onsubmit, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onsubmit, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onsubmit, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onsubmit, in: jsObject] = newValue } } var onsuspend: EventHandler { - get { ClosureAttribute.Optional1[Keys.onsuspend, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onsuspend, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onsuspend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onsuspend, in: jsObject] = newValue } } var ontimeupdate: EventHandler { - get { ClosureAttribute.Optional1[Keys.ontimeupdate, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ontimeupdate, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ontimeupdate, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontimeupdate, in: jsObject] = newValue } } var ontoggle: EventHandler { - get { ClosureAttribute.Optional1[Keys.ontoggle, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ontoggle, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ontoggle, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontoggle, in: jsObject] = newValue } } var onvolumechange: EventHandler { - get { ClosureAttribute.Optional1[Keys.onvolumechange, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onvolumechange, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onvolumechange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onvolumechange, in: jsObject] = newValue } } var onwaiting: EventHandler { - get { ClosureAttribute.Optional1[Keys.onwaiting, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onwaiting, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onwaiting, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onwaiting, in: jsObject] = newValue } } var onwebkitanimationend: EventHandler { - get { ClosureAttribute.Optional1[Keys.onwebkitanimationend, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onwebkitanimationend, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onwebkitanimationend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onwebkitanimationend, in: jsObject] = newValue } } var onwebkitanimationiteration: EventHandler { - get { ClosureAttribute.Optional1[Keys.onwebkitanimationiteration, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onwebkitanimationiteration, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onwebkitanimationiteration, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onwebkitanimationiteration, in: jsObject] = newValue } } var onwebkitanimationstart: EventHandler { - get { ClosureAttribute.Optional1[Keys.onwebkitanimationstart, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onwebkitanimationstart, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onwebkitanimationstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onwebkitanimationstart, in: jsObject] = newValue } } var onwebkittransitionend: EventHandler { - get { ClosureAttribute.Optional1[Keys.onwebkittransitionend, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onwebkittransitionend, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onwebkittransitionend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onwebkittransitionend, in: jsObject] = newValue } } var onwheel: EventHandler { - get { ClosureAttribute.Optional1[Keys.onwheel, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onwheel, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onwheel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onwheel, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift index a4f82368..d459c017 100644 --- a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class HTMLAllCollection: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.HTMLAllCollection.function! } - private enum Keys { - static let item: JSString = "item" - static let length: JSString = "length" - static let namedItem: JSString = "namedItem" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } @@ -31,6 +25,6 @@ public class HTMLAllCollection: JSBridgedClass { } public func item(nameOrIndex: String? = nil) -> __UNSUPPORTED_UNION__? { - jsObject[Keys.item]!(nameOrIndex?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.item]!(nameOrIndex?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift index 2456233d..ee3b0fbe 100644 --- a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift @@ -6,38 +6,21 @@ import JavaScriptKit public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { override public class var constructor: JSFunction { JSObject.global.HTMLAnchorElement.function! } - private enum Keys { - static let charset: JSString = "charset" - static let coords: JSString = "coords" - static let download: JSString = "download" - static let hreflang: JSString = "hreflang" - static let name: JSString = "name" - static let ping: JSString = "ping" - static let referrerPolicy: JSString = "referrerPolicy" - static let rel: JSString = "rel" - static let relList: JSString = "relList" - static let rev: JSString = "rev" - static let shape: JSString = "shape" - static let target: JSString = "target" - static let text: JSString = "text" - static let type: JSString = "type" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) - _download = ReadWriteAttribute(jsObject: jsObject, name: Keys.download) - _ping = ReadWriteAttribute(jsObject: jsObject, name: Keys.ping) - _rel = ReadWriteAttribute(jsObject: jsObject, name: Keys.rel) - _relList = ReadonlyAttribute(jsObject: jsObject, name: Keys.relList) - _hreflang = ReadWriteAttribute(jsObject: jsObject, name: Keys.hreflang) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) - _coords = ReadWriteAttribute(jsObject: jsObject, name: Keys.coords) - _charset = ReadWriteAttribute(jsObject: jsObject, name: Keys.charset) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _rev = ReadWriteAttribute(jsObject: jsObject, name: Keys.rev) - _shape = ReadWriteAttribute(jsObject: jsObject, name: Keys.shape) + _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) + _download = ReadWriteAttribute(jsObject: jsObject, name: Strings.download) + _ping = ReadWriteAttribute(jsObject: jsObject, name: Strings.ping) + _rel = ReadWriteAttribute(jsObject: jsObject, name: Strings.rel) + _relList = ReadonlyAttribute(jsObject: jsObject, name: Strings.relList) + _hreflang = ReadWriteAttribute(jsObject: jsObject, name: Strings.hreflang) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) + _coords = ReadWriteAttribute(jsObject: jsObject, name: Strings.coords) + _charset = ReadWriteAttribute(jsObject: jsObject, name: Strings.charset) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _rev = ReadWriteAttribute(jsObject: jsObject, name: Strings.rev) + _shape = ReadWriteAttribute(jsObject: jsObject, name: Strings.shape) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift index 22dcd8cc..3c1c20f4 100644 --- a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift @@ -6,30 +6,17 @@ import JavaScriptKit public class HTMLAreaElement: HTMLElement, HTMLHyperlinkElementUtils { override public class var constructor: JSFunction { JSObject.global.HTMLAreaElement.function! } - private enum Keys { - static let alt: JSString = "alt" - static let coords: JSString = "coords" - static let download: JSString = "download" - static let noHref: JSString = "noHref" - static let ping: JSString = "ping" - static let referrerPolicy: JSString = "referrerPolicy" - static let rel: JSString = "rel" - static let relList: JSString = "relList" - static let shape: JSString = "shape" - static let target: JSString = "target" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _alt = ReadWriteAttribute(jsObject: jsObject, name: Keys.alt) - _coords = ReadWriteAttribute(jsObject: jsObject, name: Keys.coords) - _shape = ReadWriteAttribute(jsObject: jsObject, name: Keys.shape) - _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) - _download = ReadWriteAttribute(jsObject: jsObject, name: Keys.download) - _ping = ReadWriteAttribute(jsObject: jsObject, name: Keys.ping) - _rel = ReadWriteAttribute(jsObject: jsObject, name: Keys.rel) - _relList = ReadonlyAttribute(jsObject: jsObject, name: Keys.relList) - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) - _noHref = ReadWriteAttribute(jsObject: jsObject, name: Keys.noHref) + _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) + _coords = ReadWriteAttribute(jsObject: jsObject, name: Strings.coords) + _shape = ReadWriteAttribute(jsObject: jsObject, name: Strings.shape) + _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) + _download = ReadWriteAttribute(jsObject: jsObject, name: Strings.download) + _ping = ReadWriteAttribute(jsObject: jsObject, name: Strings.ping) + _rel = ReadWriteAttribute(jsObject: jsObject, name: Strings.rel) + _relList = ReadonlyAttribute(jsObject: jsObject, name: Strings.relList) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) + _noHref = ReadWriteAttribute(jsObject: jsObject, name: Strings.noHref) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift index f45e1a96..61322a9b 100644 --- a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class HTMLAudioElement: HTMLMediaElement { override public class var constructor: JSFunction { JSObject.global.HTMLAudioElement.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLBRElement.swift b/Sources/DOMKit/WebIDL/HTMLBRElement.swift index 20ae5cc6..2fcfb7e8 100644 --- a/Sources/DOMKit/WebIDL/HTMLBRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBRElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLBRElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLBRElement.function! } - private enum Keys { - static let clear: JSString = "clear" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _clear = ReadWriteAttribute(jsObject: jsObject, name: Keys.clear) + _clear = ReadWriteAttribute(jsObject: jsObject, name: Strings.clear) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift index 21a407ca..b013f289 100644 --- a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class HTMLBaseElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLBaseElement.function! } - private enum Keys { - static let href: JSString = "href" - static let target: JSString = "target" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadWriteAttribute(jsObject: jsObject, name: Keys.href) - _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) + _href = ReadWriteAttribute(jsObject: jsObject, name: Strings.href) + _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift index 214a7fc1..2c94047c 100644 --- a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift @@ -6,22 +6,13 @@ import JavaScriptKit public class HTMLBodyElement: HTMLElement, WindowEventHandlers { override public class var constructor: JSFunction { JSObject.global.HTMLBodyElement.function! } - private enum Keys { - static let aLink: JSString = "aLink" - static let background: JSString = "background" - static let bgColor: JSString = "bgColor" - static let link: JSString = "link" - static let text: JSString = "text" - static let vLink: JSString = "vLink" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) - _link = ReadWriteAttribute(jsObject: jsObject, name: Keys.link) - _vLink = ReadWriteAttribute(jsObject: jsObject, name: Keys.vLink) - _aLink = ReadWriteAttribute(jsObject: jsObject, name: Keys.aLink) - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) - _background = ReadWriteAttribute(jsObject: jsObject, name: Keys.background) + _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) + _link = ReadWriteAttribute(jsObject: jsObject, name: Strings.link) + _vLink = ReadWriteAttribute(jsObject: jsObject, name: Strings.vLink) + _aLink = ReadWriteAttribute(jsObject: jsObject, name: Strings.aLink) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.bgColor) + _background = ReadWriteAttribute(jsObject: jsObject, name: Strings.background) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift index 78f64f1a..bc7a7e8a 100644 --- a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -6,41 +6,21 @@ import JavaScriptKit public class HTMLButtonElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLButtonElement.function! } - private enum Keys { - static let checkValidity: JSString = "checkValidity" - static let disabled: JSString = "disabled" - static let form: JSString = "form" - static let formAction: JSString = "formAction" - static let formEnctype: JSString = "formEnctype" - static let formMethod: JSString = "formMethod" - static let formNoValidate: JSString = "formNoValidate" - static let formTarget: JSString = "formTarget" - static let labels: JSString = "labels" - static let name: JSString = "name" - static let reportValidity: JSString = "reportValidity" - static let setCustomValidity: JSString = "setCustomValidity" - static let type: JSString = "type" - static let validationMessage: JSString = "validationMessage" - static let validity: JSString = "validity" - static let value: JSString = "value" - static let willValidate: JSString = "willValidate" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _formAction = ReadWriteAttribute(jsObject: jsObject, name: Keys.formAction) - _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: Keys.formEnctype) - _formMethod = ReadWriteAttribute(jsObject: jsObject, name: Keys.formMethod) - _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: Keys.formNoValidate) - _formTarget = ReadWriteAttribute(jsObject: jsObject, name: Keys.formTarget) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) - _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) - _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _formAction = ReadWriteAttribute(jsObject: jsObject, name: Strings.formAction) + _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: Strings.formEnctype) + _formMethod = ReadWriteAttribute(jsObject: jsObject, name: Strings.formMethod) + _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: Strings.formNoValidate) + _formTarget = ReadWriteAttribute(jsObject: jsObject, name: Strings.formTarget) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _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) super.init(unsafelyWrapping: jsObject) } @@ -88,15 +68,15 @@ public class HTMLButtonElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Keys.checkValidity]!().fromJSValue()! + jsObject[Strings.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Keys.reportValidity]!().fromJSValue()! + jsObject[Strings.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index 4b15cbb1..838f3efd 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -6,18 +6,9 @@ import JavaScriptKit public class HTMLCanvasElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLCanvasElement.function! } - private enum Keys { - static let getContext: JSString = "getContext" - static let height: JSString = "height" - static let toBlob: JSString = "toBlob" - static let toDataURL: JSString = "toDataURL" - static let transferControlToOffscreen: JSString = "transferControlToOffscreen" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) super.init(unsafelyWrapping: jsObject) } @@ -32,16 +23,16 @@ public class HTMLCanvasElement: HTMLElement { public var height: UInt32 public func getContext(contextId: String, options: JSValue? = nil) -> RenderingContext? { - jsObject[Keys.getContext]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.getContext]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func toDataURL(type: String? = nil, quality: JSValue? = nil) -> String { - jsObject[Keys.toDataURL]!(type?.jsValue() ?? .undefined, quality?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.toDataURL]!(type?.jsValue() ?? .undefined, quality?.jsValue() ?? .undefined).fromJSValue()! } // XXX: member 'toBlob' is ignored public func transferControlToOffscreen() -> OffscreenCanvas { - jsObject[Keys.transferControlToOffscreen]!().fromJSValue()! + jsObject[Strings.transferControlToOffscreen]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLCollection.swift b/Sources/DOMKit/WebIDL/HTMLCollection.swift index a4de02ad..f2b0e984 100644 --- a/Sources/DOMKit/WebIDL/HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLCollection.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class HTMLCollection: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.HTMLCollection.function! } - private enum Keys { - static let item: JSString = "item" - static let length: JSString = "length" - static let namedItem: JSString = "namedItem" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/HTMLDListElement.swift b/Sources/DOMKit/WebIDL/HTMLDListElement.swift index 5725d1fa..cef605dd 100644 --- a/Sources/DOMKit/WebIDL/HTMLDListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDListElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLDListElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDListElement.function! } - private enum Keys { - static let compact: JSString = "compact" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) + _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDataElement.swift b/Sources/DOMKit/WebIDL/HTMLDataElement.swift index 57dea6e8..461c9269 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLDataElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDataElement.function! } - private enum Keys { - static let value: JSString = "value" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift index 3084eeee..9b843631 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLDataListElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDataListElement.function! } - private enum Keys { - static let options: JSString = "options" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _options = ReadonlyAttribute(jsObject: jsObject, name: Keys.options) + _options = ReadonlyAttribute(jsObject: jsObject, name: Strings.options) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift index 4701692f..1a5b7b12 100644 --- a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLDetailsElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDetailsElement.function! } - private enum Keys { - static let open: JSString = "open" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _open = ReadWriteAttribute(jsObject: jsObject, name: Keys.open) + _open = ReadWriteAttribute(jsObject: jsObject, name: Strings.open) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift index 51775d34..3f961e97 100644 --- a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -6,17 +6,9 @@ import JavaScriptKit public class HTMLDialogElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDialogElement.function! } - private enum Keys { - static let close: JSString = "close" - static let open: JSString = "open" - static let returnValue: JSString = "returnValue" - static let show: JSString = "show" - static let showModal: JSString = "showModal" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _open = ReadWriteAttribute(jsObject: jsObject, name: Keys.open) - _returnValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.returnValue) + _open = ReadWriteAttribute(jsObject: jsObject, name: Strings.open) + _returnValue = ReadWriteAttribute(jsObject: jsObject, name: Strings.returnValue) super.init(unsafelyWrapping: jsObject) } @@ -31,14 +23,14 @@ public class HTMLDialogElement: HTMLElement { public var returnValue: String public func show() { - _ = jsObject[Keys.show]!() + _ = jsObject[Strings.show]!() } public func showModal() { - _ = jsObject[Keys.showModal]!() + _ = jsObject[Strings.showModal]!() } public func close(returnValue: String? = nil) { - _ = jsObject[Keys.close]!(returnValue?.jsValue() ?? .undefined) + _ = jsObject[Strings.close]!(returnValue?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift index 40e2028c..ca7119e0 100644 --- a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLDirectoryElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDirectoryElement.function! } - private enum Keys { - static let compact: JSString = "compact" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) + _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLDivElement.swift b/Sources/DOMKit/WebIDL/HTMLDivElement.swift index e8af0b95..8c58fb8d 100644 --- a/Sources/DOMKit/WebIDL/HTMLDivElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDivElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLDivElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLDivElement.function! } - private enum Keys { - static let align: JSString = "align" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 029758e2..26fc2baa 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -6,38 +6,20 @@ import JavaScriptKit public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement, ElementCSSInlineStyle { override public class var constructor: JSFunction { JSObject.global.HTMLElement.function! } - private enum Keys { - static let accessKey: JSString = "accessKey" - static let accessKeyLabel: JSString = "accessKeyLabel" - static let attachInternals: JSString = "attachInternals" - static let autocapitalize: JSString = "autocapitalize" - static let click: JSString = "click" - static let dir: JSString = "dir" - static let draggable: JSString = "draggable" - static let hidden: JSString = "hidden" - static let inert: JSString = "inert" - static let innerText: JSString = "innerText" - static let lang: JSString = "lang" - static let outerText: JSString = "outerText" - static let spellcheck: JSString = "spellcheck" - static let title: JSString = "title" - static let translate: JSString = "translate" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _title = ReadWriteAttribute(jsObject: jsObject, name: Keys.title) - _lang = ReadWriteAttribute(jsObject: jsObject, name: Keys.lang) - _translate = ReadWriteAttribute(jsObject: jsObject, name: Keys.translate) - _dir = ReadWriteAttribute(jsObject: jsObject, name: Keys.dir) - _hidden = ReadWriteAttribute(jsObject: jsObject, name: Keys.hidden) - _inert = ReadWriteAttribute(jsObject: jsObject, name: Keys.inert) - _accessKey = ReadWriteAttribute(jsObject: jsObject, name: Keys.accessKey) - _accessKeyLabel = ReadonlyAttribute(jsObject: jsObject, name: Keys.accessKeyLabel) - _draggable = ReadWriteAttribute(jsObject: jsObject, name: Keys.draggable) - _spellcheck = ReadWriteAttribute(jsObject: jsObject, name: Keys.spellcheck) - _autocapitalize = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocapitalize) - _innerText = ReadWriteAttribute(jsObject: jsObject, name: Keys.innerText) - _outerText = ReadWriteAttribute(jsObject: jsObject, name: Keys.outerText) + _title = ReadWriteAttribute(jsObject: jsObject, name: Strings.title) + _lang = ReadWriteAttribute(jsObject: jsObject, name: Strings.lang) + _translate = ReadWriteAttribute(jsObject: jsObject, name: Strings.translate) + _dir = ReadWriteAttribute(jsObject: jsObject, name: Strings.dir) + _hidden = ReadWriteAttribute(jsObject: jsObject, name: Strings.hidden) + _inert = ReadWriteAttribute(jsObject: jsObject, name: Strings.inert) + _accessKey = ReadWriteAttribute(jsObject: jsObject, name: Strings.accessKey) + _accessKeyLabel = ReadonlyAttribute(jsObject: jsObject, name: Strings.accessKeyLabel) + _draggable = ReadWriteAttribute(jsObject: jsObject, name: Strings.draggable) + _spellcheck = ReadWriteAttribute(jsObject: jsObject, name: Strings.spellcheck) + _autocapitalize = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocapitalize) + _innerText = ReadWriteAttribute(jsObject: jsObject, name: Strings.innerText) + _outerText = ReadWriteAttribute(jsObject: jsObject, name: Strings.outerText) super.init(unsafelyWrapping: jsObject) } @@ -64,7 +46,7 @@ public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventH public var inert: Bool public func click() { - _ = jsObject[Keys.click]!() + _ = jsObject[Strings.click]!() } @ReadWriteAttribute @@ -89,6 +71,6 @@ public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventH public var outerText: String public func attachInternals() -> ElementInternals { - jsObject[Keys.attachInternals]!().fromJSValue()! + jsObject[Strings.attachInternals]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift index 6300b909..fe95169c 100644 --- a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift @@ -6,23 +6,13 @@ import JavaScriptKit public class HTMLEmbedElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLEmbedElement.function! } - private enum Keys { - static let align: JSString = "align" - static let getSVGDocument: JSString = "getSVGDocument" - static let height: JSString = "height" - static let name: JSString = "name" - static let src: JSString = "src" - static let type: JSString = "type" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) super.init(unsafelyWrapping: jsObject) } @@ -43,7 +33,7 @@ public class HTMLEmbedElement: HTMLElement { public var height: String public func getSVGDocument() -> Document? { - jsObject[Keys.getSVGDocument]!().fromJSValue()! + jsObject[Strings.getSVGDocument]!().fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift index 9dc84ce7..17192326 100644 --- a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -6,29 +6,15 @@ import JavaScriptKit public class HTMLFieldSetElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFieldSetElement.function! } - private enum Keys { - static let checkValidity: JSString = "checkValidity" - static let disabled: JSString = "disabled" - static let elements: JSString = "elements" - static let form: JSString = "form" - static let name: JSString = "name" - static let reportValidity: JSString = "reportValidity" - static let setCustomValidity: JSString = "setCustomValidity" - static let type: JSString = "type" - static let validationMessage: JSString = "validationMessage" - static let validity: JSString = "validity" - static let willValidate: JSString = "willValidate" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) - _elements = ReadonlyAttribute(jsObject: jsObject, name: Keys.elements) - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) - _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _elements = ReadonlyAttribute(jsObject: jsObject, name: Strings.elements) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Strings.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Strings.validationMessage) super.init(unsafelyWrapping: jsObject) } @@ -61,14 +47,14 @@ public class HTMLFieldSetElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Keys.checkValidity]!().fromJSValue()! + jsObject[Strings.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Keys.reportValidity]!().fromJSValue()! + jsObject[Strings.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/HTMLFontElement.swift b/Sources/DOMKit/WebIDL/HTMLFontElement.swift index fbd96e8c..6efaeb06 100644 --- a/Sources/DOMKit/WebIDL/HTMLFontElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFontElement.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class HTMLFontElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFontElement.function! } - private enum Keys { - static let color: JSString = "color" - static let face: JSString = "face" - static let size: JSString = "size" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _color = ReadWriteAttribute(jsObject: jsObject, name: Keys.color) - _face = ReadWriteAttribute(jsObject: jsObject, name: Keys.face) - _size = ReadWriteAttribute(jsObject: jsObject, name: Keys.size) + _color = ReadWriteAttribute(jsObject: jsObject, name: Strings.color) + _face = ReadWriteAttribute(jsObject: jsObject, name: Strings.face) + _size = ReadWriteAttribute(jsObject: jsObject, name: Strings.size) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift index 8351e746..c8dbc8e2 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift @@ -6,10 +6,6 @@ import JavaScriptKit public class HTMLFormControlsCollection: HTMLCollection { override public class var constructor: JSFunction { JSObject.global.HTMLFormControlsCollection.function! } - private enum Keys { - static let namedItem: JSString = "namedItem" - } - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index c729ed1c..1cfb5c4e 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -6,41 +6,20 @@ import JavaScriptKit public class HTMLFormElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFormElement.function! } - private enum Keys { - static let acceptCharset: JSString = "acceptCharset" - static let action: JSString = "action" - static let autocomplete: JSString = "autocomplete" - static let checkValidity: JSString = "checkValidity" - static let elements: JSString = "elements" - static let encoding: JSString = "encoding" - static let enctype: JSString = "enctype" - static let length: JSString = "length" - static let method: JSString = "method" - static let name: JSString = "name" - static let noValidate: JSString = "noValidate" - static let rel: JSString = "rel" - static let relList: JSString = "relList" - static let reportValidity: JSString = "reportValidity" - static let requestSubmit: JSString = "requestSubmit" - static let reset: JSString = "reset" - static let submit: JSString = "submit" - static let target: JSString = "target" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _acceptCharset = ReadWriteAttribute(jsObject: jsObject, name: Keys.acceptCharset) - _action = ReadWriteAttribute(jsObject: jsObject, name: Keys.action) - _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocomplete) - _enctype = ReadWriteAttribute(jsObject: jsObject, name: Keys.enctype) - _encoding = ReadWriteAttribute(jsObject: jsObject, name: Keys.encoding) - _method = ReadWriteAttribute(jsObject: jsObject, name: Keys.method) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _noValidate = ReadWriteAttribute(jsObject: jsObject, name: Keys.noValidate) - _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) - _rel = ReadWriteAttribute(jsObject: jsObject, name: Keys.rel) - _relList = ReadonlyAttribute(jsObject: jsObject, name: Keys.relList) - _elements = ReadonlyAttribute(jsObject: jsObject, name: Keys.elements) - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _acceptCharset = ReadWriteAttribute(jsObject: jsObject, name: Strings.acceptCharset) + _action = ReadWriteAttribute(jsObject: jsObject, name: Strings.action) + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) + _enctype = ReadWriteAttribute(jsObject: jsObject, name: Strings.enctype) + _encoding = ReadWriteAttribute(jsObject: jsObject, name: Strings.encoding) + _method = ReadWriteAttribute(jsObject: jsObject, name: Strings.method) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _noValidate = ReadWriteAttribute(jsObject: jsObject, name: Strings.noValidate) + _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) + _rel = ReadWriteAttribute(jsObject: jsObject, name: Strings.rel) + _relList = ReadonlyAttribute(jsObject: jsObject, name: Strings.relList) + _elements = ReadonlyAttribute(jsObject: jsObject, name: Strings.elements) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) super.init(unsafelyWrapping: jsObject) } @@ -96,22 +75,22 @@ public class HTMLFormElement: HTMLElement { } public func submit() { - _ = jsObject[Keys.submit]!() + _ = jsObject[Strings.submit]!() } public func requestSubmit(submitter: HTMLElement? = nil) { - _ = jsObject[Keys.requestSubmit]!(submitter?.jsValue() ?? .undefined) + _ = jsObject[Strings.requestSubmit]!(submitter?.jsValue() ?? .undefined) } public func reset() { - _ = jsObject[Keys.reset]!() + _ = jsObject[Strings.reset]!() } public func checkValidity() -> Bool { - jsObject[Keys.checkValidity]!().fromJSValue()! + jsObject[Strings.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Keys.reportValidity]!().fromJSValue()! + jsObject[Strings.reportValidity]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift index 974c779b..9bdd2826 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift @@ -6,30 +6,17 @@ import JavaScriptKit public class HTMLFrameElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLFrameElement.function! } - private enum Keys { - static let contentDocument: JSString = "contentDocument" - static let contentWindow: JSString = "contentWindow" - static let frameBorder: JSString = "frameBorder" - static let longDesc: JSString = "longDesc" - static let marginHeight: JSString = "marginHeight" - static let marginWidth: JSString = "marginWidth" - static let name: JSString = "name" - static let noResize: JSString = "noResize" - static let scrolling: JSString = "scrolling" - static let src: JSString = "src" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _scrolling = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrolling) - _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) - _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: Keys.frameBorder) - _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Keys.longDesc) - _noResize = ReadWriteAttribute(jsObject: jsObject, name: Keys.noResize) - _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentDocument) - _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentWindow) - _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Keys.marginHeight) - _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Keys.marginWidth) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _scrolling = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrolling) + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: Strings.frameBorder) + _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Strings.longDesc) + _noResize = ReadWriteAttribute(jsObject: jsObject, name: Strings.noResize) + _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentDocument) + _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentWindow) + _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginHeight) + _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginWidth) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift index 5b124069..8c87b631 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class HTMLFrameSetElement: HTMLElement, WindowEventHandlers { override public class var constructor: JSFunction { JSObject.global.HTMLFrameSetElement.function! } - private enum Keys { - static let cols: JSString = "cols" - static let rows: JSString = "rows" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _cols = ReadWriteAttribute(jsObject: jsObject, name: Keys.cols) - _rows = ReadWriteAttribute(jsObject: jsObject, name: Keys.rows) + _cols = ReadWriteAttribute(jsObject: jsObject, name: Strings.cols) + _rows = ReadWriteAttribute(jsObject: jsObject, name: Strings.rows) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHRElement.swift b/Sources/DOMKit/WebIDL/HTMLHRElement.swift index f08175cd..d04976c3 100644 --- a/Sources/DOMKit/WebIDL/HTMLHRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHRElement.swift @@ -6,20 +6,12 @@ import JavaScriptKit public class HTMLHRElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLHRElement.function! } - private enum Keys { - static let align: JSString = "align" - static let color: JSString = "color" - static let noShade: JSString = "noShade" - static let size: JSString = "size" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _color = ReadWriteAttribute(jsObject: jsObject, name: Keys.color) - _noShade = ReadWriteAttribute(jsObject: jsObject, name: Keys.noShade) - _size = ReadWriteAttribute(jsObject: jsObject, name: Keys.size) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _color = ReadWriteAttribute(jsObject: jsObject, name: Strings.color) + _noShade = ReadWriteAttribute(jsObject: jsObject, name: Strings.noShade) + _size = ReadWriteAttribute(jsObject: jsObject, name: Strings.size) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift index c3334ec8..16c56abd 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class HTMLHeadElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLHeadElement.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift index df7f11dc..e704a34d 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLHeadingElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLHeadingElement.function! } - private enum Keys { - static let align: JSString = "align" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift index c7a84848..ddec8557 100644 --- a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLHtmlElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLHtmlElement.function! } - private enum Keys { - static let version: JSString = "version" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _version = ReadWriteAttribute(jsObject: jsObject, name: Keys.version) + _version = ReadWriteAttribute(jsObject: jsObject, name: Strings.version) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift index 1f636bc8..173327fe 100644 --- a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift +++ b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift @@ -3,71 +3,57 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let hash: JSString = "hash" - static let host: JSString = "host" - static let hostname: JSString = "hostname" - static let href: JSString = "href" - static let origin: JSString = "origin" - static let password: JSString = "password" - static let pathname: JSString = "pathname" - static let port: JSString = "port" - static let `protocol`: JSString = "protocol" - static let search: JSString = "search" - static let username: JSString = "username" -} - public protocol HTMLHyperlinkElementUtils: JSBridgedClass {} public extension HTMLHyperlinkElementUtils { var href: String { - get { ReadWriteAttribute[Keys.href, in: jsObject] } - set { ReadWriteAttribute[Keys.href, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.href, in: jsObject] } + set { ReadWriteAttribute[Strings.href, in: jsObject] = newValue } } - var origin: String { ReadonlyAttribute[Keys.origin, in: jsObject] } + var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } var `protocol`: String { - get { ReadWriteAttribute[Keys.protocol, in: jsObject] } - set { ReadWriteAttribute[Keys.protocol, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.protocol, in: jsObject] } + set { ReadWriteAttribute[Strings.protocol, in: jsObject] = newValue } } var username: String { - get { ReadWriteAttribute[Keys.username, in: jsObject] } - set { ReadWriteAttribute[Keys.username, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.username, in: jsObject] } + set { ReadWriteAttribute[Strings.username, in: jsObject] = newValue } } var password: String { - get { ReadWriteAttribute[Keys.password, in: jsObject] } - set { ReadWriteAttribute[Keys.password, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.password, in: jsObject] } + set { ReadWriteAttribute[Strings.password, in: jsObject] = newValue } } var host: String { - get { ReadWriteAttribute[Keys.host, in: jsObject] } - set { ReadWriteAttribute[Keys.host, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.host, in: jsObject] } + set { ReadWriteAttribute[Strings.host, in: jsObject] = newValue } } var hostname: String { - get { ReadWriteAttribute[Keys.hostname, in: jsObject] } - set { ReadWriteAttribute[Keys.hostname, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.hostname, in: jsObject] } + set { ReadWriteAttribute[Strings.hostname, in: jsObject] = newValue } } var port: String { - get { ReadWriteAttribute[Keys.port, in: jsObject] } - set { ReadWriteAttribute[Keys.port, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.port, in: jsObject] } + set { ReadWriteAttribute[Strings.port, in: jsObject] = newValue } } var pathname: String { - get { ReadWriteAttribute[Keys.pathname, in: jsObject] } - set { ReadWriteAttribute[Keys.pathname, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.pathname, in: jsObject] } + set { ReadWriteAttribute[Strings.pathname, in: jsObject] = newValue } } var search: String { - get { ReadWriteAttribute[Keys.search, in: jsObject] } - set { ReadWriteAttribute[Keys.search, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.search, in: jsObject] } + set { ReadWriteAttribute[Strings.search, in: jsObject] = newValue } } var hash: String { - get { ReadWriteAttribute[Keys.hash, in: jsObject] } - set { ReadWriteAttribute[Keys.hash, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.hash, in: jsObject] } + set { ReadWriteAttribute[Strings.hash, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index 9b541ecd..b7773861 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -6,47 +6,25 @@ import JavaScriptKit public class HTMLIFrameElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLIFrameElement.function! } - private enum Keys { - static let align: JSString = "align" - static let allow: JSString = "allow" - static let allowFullscreen: JSString = "allowFullscreen" - static let contentDocument: JSString = "contentDocument" - static let contentWindow: JSString = "contentWindow" - static let frameBorder: JSString = "frameBorder" - static let getSVGDocument: JSString = "getSVGDocument" - static let height: JSString = "height" - static let loading: JSString = "loading" - static let longDesc: JSString = "longDesc" - static let marginHeight: JSString = "marginHeight" - static let marginWidth: JSString = "marginWidth" - static let name: JSString = "name" - static let referrerPolicy: JSString = "referrerPolicy" - static let sandbox: JSString = "sandbox" - static let scrolling: JSString = "scrolling" - static let src: JSString = "src" - static let srcdoc: JSString = "srcdoc" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) - _srcdoc = ReadWriteAttribute(jsObject: jsObject, name: Keys.srcdoc) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _sandbox = ReadonlyAttribute(jsObject: jsObject, name: Keys.sandbox) - _allow = ReadWriteAttribute(jsObject: jsObject, name: Keys.allow) - _allowFullscreen = ReadWriteAttribute(jsObject: jsObject, name: Keys.allowFullscreen) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) - _loading = ReadWriteAttribute(jsObject: jsObject, name: Keys.loading) - _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentDocument) - _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentWindow) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _scrolling = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrolling) - _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: Keys.frameBorder) - _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Keys.longDesc) - _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Keys.marginHeight) - _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Keys.marginWidth) + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _srcdoc = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcdoc) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _sandbox = ReadonlyAttribute(jsObject: jsObject, name: Strings.sandbox) + _allow = ReadWriteAttribute(jsObject: jsObject, name: Strings.allow) + _allowFullscreen = ReadWriteAttribute(jsObject: jsObject, name: Strings.allowFullscreen) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) + _loading = ReadWriteAttribute(jsObject: jsObject, name: Strings.loading) + _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentDocument) + _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentWindow) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _scrolling = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrolling) + _frameBorder = ReadWriteAttribute(jsObject: jsObject, name: Strings.frameBorder) + _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Strings.longDesc) + _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginHeight) + _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginWidth) super.init(unsafelyWrapping: jsObject) } @@ -91,7 +69,7 @@ public class HTMLIFrameElement: HTMLElement { public var contentWindow: WindowProxy? public func getSVGDocument() -> Document? { - jsObject[Keys.getSVGDocument]!().fromJSValue()! + jsObject[Strings.getSVGDocument]!().fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index 235f788d..86a553b0 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -6,57 +6,30 @@ import JavaScriptKit public class HTMLImageElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLImageElement.function! } - private enum Keys { - static let align: JSString = "align" - static let alt: JSString = "alt" - static let border: JSString = "border" - static let complete: JSString = "complete" - static let crossOrigin: JSString = "crossOrigin" - static let currentSrc: JSString = "currentSrc" - static let decode: JSString = "decode" - static let decoding: JSString = "decoding" - static let height: JSString = "height" - static let hspace: JSString = "hspace" - static let isMap: JSString = "isMap" - static let loading: JSString = "loading" - static let longDesc: JSString = "longDesc" - static let lowsrc: JSString = "lowsrc" - static let name: JSString = "name" - static let naturalHeight: JSString = "naturalHeight" - static let naturalWidth: JSString = "naturalWidth" - static let referrerPolicy: JSString = "referrerPolicy" - static let sizes: JSString = "sizes" - static let src: JSString = "src" - static let srcset: JSString = "srcset" - static let useMap: JSString = "useMap" - static let vspace: JSString = "vspace" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _alt = ReadWriteAttribute(jsObject: jsObject, name: Keys.alt) - _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) - _srcset = ReadWriteAttribute(jsObject: jsObject, name: Keys.srcset) - _sizes = ReadWriteAttribute(jsObject: jsObject, name: Keys.sizes) - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Keys.crossOrigin) - _useMap = ReadWriteAttribute(jsObject: jsObject, name: Keys.useMap) - _isMap = ReadWriteAttribute(jsObject: jsObject, name: Keys.isMap) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) - _naturalWidth = ReadonlyAttribute(jsObject: jsObject, name: Keys.naturalWidth) - _naturalHeight = ReadonlyAttribute(jsObject: jsObject, name: Keys.naturalHeight) - _complete = ReadonlyAttribute(jsObject: jsObject, name: Keys.complete) - _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: Keys.currentSrc) - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) - _decoding = ReadWriteAttribute(jsObject: jsObject, name: Keys.decoding) - _loading = ReadWriteAttribute(jsObject: jsObject, name: Keys.loading) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _lowsrc = ReadWriteAttribute(jsObject: jsObject, name: Keys.lowsrc) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _hspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.hspace) - _vspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.vspace) - _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Keys.longDesc) - _border = ReadWriteAttribute(jsObject: jsObject, name: Keys.border) + _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _srcset = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcset) + _sizes = ReadWriteAttribute(jsObject: jsObject, name: Strings.sizes) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Strings.crossOrigin) + _useMap = ReadWriteAttribute(jsObject: jsObject, name: Strings.useMap) + _isMap = ReadWriteAttribute(jsObject: jsObject, name: Strings.isMap) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _naturalWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.naturalWidth) + _naturalHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.naturalHeight) + _complete = ReadonlyAttribute(jsObject: jsObject, name: Strings.complete) + _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentSrc) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) + _decoding = ReadWriteAttribute(jsObject: jsObject, name: Strings.decoding) + _loading = ReadWriteAttribute(jsObject: jsObject, name: Strings.loading) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _lowsrc = ReadWriteAttribute(jsObject: jsObject, name: Strings.lowsrc) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _hspace = ReadWriteAttribute(jsObject: jsObject, name: Strings.hspace) + _vspace = ReadWriteAttribute(jsObject: jsObject, name: Strings.vspace) + _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Strings.longDesc) + _border = ReadWriteAttribute(jsObject: jsObject, name: Strings.border) super.init(unsafelyWrapping: jsObject) } @@ -113,12 +86,12 @@ public class HTMLImageElement: HTMLElement { public var loading: String public func decode() -> JSPromise { - jsObject[Keys.decode]!().fromJSValue()! + jsObject[Strings.decode]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func decode() async throws { - let _promise: JSPromise = jsObject[Keys.decode]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.decode]!().fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index b26cb3ba..60b57799 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -6,109 +6,52 @@ import JavaScriptKit public class HTMLInputElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLInputElement.function! } - private enum Keys { - static let accept: JSString = "accept" - static let align: JSString = "align" - static let alt: JSString = "alt" - static let autocomplete: JSString = "autocomplete" - static let checkValidity: JSString = "checkValidity" - static let checked: JSString = "checked" - static let defaultChecked: JSString = "defaultChecked" - static let defaultValue: JSString = "defaultValue" - static let dirName: JSString = "dirName" - static let disabled: JSString = "disabled" - static let files: JSString = "files" - static let form: JSString = "form" - static let formAction: JSString = "formAction" - static let formEnctype: JSString = "formEnctype" - static let formMethod: JSString = "formMethod" - static let formNoValidate: JSString = "formNoValidate" - static let formTarget: JSString = "formTarget" - static let height: JSString = "height" - static let indeterminate: JSString = "indeterminate" - static let labels: JSString = "labels" - static let list: JSString = "list" - static let max: JSString = "max" - static let maxLength: JSString = "maxLength" - static let min: JSString = "min" - static let minLength: JSString = "minLength" - static let multiple: JSString = "multiple" - static let name: JSString = "name" - static let pattern: JSString = "pattern" - static let placeholder: JSString = "placeholder" - static let readOnly: JSString = "readOnly" - static let reportValidity: JSString = "reportValidity" - static let required: JSString = "required" - static let select: JSString = "select" - static let selectionDirection: JSString = "selectionDirection" - static let selectionEnd: JSString = "selectionEnd" - static let selectionStart: JSString = "selectionStart" - static let setCustomValidity: JSString = "setCustomValidity" - static let setRangeText: JSString = "setRangeText" - static let setSelectionRange: JSString = "setSelectionRange" - static let showPicker: JSString = "showPicker" - static let size: JSString = "size" - static let src: JSString = "src" - static let step: JSString = "step" - static let stepDown: JSString = "stepDown" - static let stepUp: JSString = "stepUp" - static let type: JSString = "type" - static let useMap: JSString = "useMap" - static let validationMessage: JSString = "validationMessage" - static let validity: JSString = "validity" - static let value: JSString = "value" - static let valueAsDate: JSString = "valueAsDate" - static let valueAsNumber: JSString = "valueAsNumber" - static let width: JSString = "width" - static let willValidate: JSString = "willValidate" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _accept = ReadWriteAttribute(jsObject: jsObject, name: Keys.accept) - _alt = ReadWriteAttribute(jsObject: jsObject, name: Keys.alt) - _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocomplete) - _defaultChecked = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultChecked) - _checked = ReadWriteAttribute(jsObject: jsObject, name: Keys.checked) - _dirName = ReadWriteAttribute(jsObject: jsObject, name: Keys.dirName) - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _files = ReadWriteAttribute(jsObject: jsObject, name: Keys.files) - _formAction = ReadWriteAttribute(jsObject: jsObject, name: Keys.formAction) - _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: Keys.formEnctype) - _formMethod = ReadWriteAttribute(jsObject: jsObject, name: Keys.formMethod) - _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: Keys.formNoValidate) - _formTarget = ReadWriteAttribute(jsObject: jsObject, name: Keys.formTarget) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) - _indeterminate = ReadWriteAttribute(jsObject: jsObject, name: Keys.indeterminate) - _list = ReadonlyAttribute(jsObject: jsObject, name: Keys.list) - _max = ReadWriteAttribute(jsObject: jsObject, name: Keys.max) - _maxLength = ReadWriteAttribute(jsObject: jsObject, name: Keys.maxLength) - _min = ReadWriteAttribute(jsObject: jsObject, name: Keys.min) - _minLength = ReadWriteAttribute(jsObject: jsObject, name: Keys.minLength) - _multiple = ReadWriteAttribute(jsObject: jsObject, name: Keys.multiple) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _pattern = ReadWriteAttribute(jsObject: jsObject, name: Keys.pattern) - _placeholder = ReadWriteAttribute(jsObject: jsObject, name: Keys.placeholder) - _readOnly = ReadWriteAttribute(jsObject: jsObject, name: Keys.readOnly) - _required = ReadWriteAttribute(jsObject: jsObject, name: Keys.required) - _size = ReadWriteAttribute(jsObject: jsObject, name: Keys.size) - _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) - _step = ReadWriteAttribute(jsObject: jsObject, name: Keys.step) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultValue) - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _valueAsDate = ReadWriteAttribute(jsObject: jsObject, name: Keys.valueAsDate) - _valueAsNumber = ReadWriteAttribute(jsObject: jsObject, name: Keys.valueAsNumber) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) - _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) - _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) - _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionStart) - _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionEnd) - _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionDirection) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _useMap = ReadWriteAttribute(jsObject: jsObject, name: Keys.useMap) + _accept = ReadWriteAttribute(jsObject: jsObject, name: Strings.accept) + _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) + _defaultChecked = ReadWriteAttribute(jsObject: jsObject, name: Strings.defaultChecked) + _checked = ReadWriteAttribute(jsObject: jsObject, name: Strings.checked) + _dirName = ReadWriteAttribute(jsObject: jsObject, name: Strings.dirName) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _files = ReadWriteAttribute(jsObject: jsObject, name: Strings.files) + _formAction = ReadWriteAttribute(jsObject: jsObject, name: Strings.formAction) + _formEnctype = ReadWriteAttribute(jsObject: jsObject, name: Strings.formEnctype) + _formMethod = ReadWriteAttribute(jsObject: jsObject, name: Strings.formMethod) + _formNoValidate = ReadWriteAttribute(jsObject: jsObject, name: Strings.formNoValidate) + _formTarget = ReadWriteAttribute(jsObject: jsObject, name: Strings.formTarget) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _indeterminate = ReadWriteAttribute(jsObject: jsObject, name: Strings.indeterminate) + _list = ReadonlyAttribute(jsObject: jsObject, name: Strings.list) + _max = ReadWriteAttribute(jsObject: jsObject, name: Strings.max) + _maxLength = ReadWriteAttribute(jsObject: jsObject, name: Strings.maxLength) + _min = ReadWriteAttribute(jsObject: jsObject, name: Strings.min) + _minLength = ReadWriteAttribute(jsObject: jsObject, name: Strings.minLength) + _multiple = ReadWriteAttribute(jsObject: jsObject, name: Strings.multiple) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _pattern = ReadWriteAttribute(jsObject: jsObject, name: Strings.pattern) + _placeholder = ReadWriteAttribute(jsObject: jsObject, name: Strings.placeholder) + _readOnly = ReadWriteAttribute(jsObject: jsObject, name: Strings.readOnly) + _required = ReadWriteAttribute(jsObject: jsObject, name: Strings.required) + _size = ReadWriteAttribute(jsObject: jsObject, name: Strings.size) + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _step = ReadWriteAttribute(jsObject: jsObject, name: Strings.step) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: Strings.defaultValue) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _valueAsDate = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueAsDate) + _valueAsNumber = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueAsNumber) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _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) + _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectionStart) + _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectionEnd) + _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectionDirection) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _useMap = ReadWriteAttribute(jsObject: jsObject, name: Strings.useMap) super.init(unsafelyWrapping: jsObject) } @@ -225,11 +168,11 @@ public class HTMLInputElement: HTMLElement { public var width: UInt32 public func stepUp(n: Int32? = nil) { - _ = jsObject[Keys.stepUp]!(n?.jsValue() ?? .undefined) + _ = jsObject[Strings.stepUp]!(n?.jsValue() ?? .undefined) } public func stepDown(n: Int32? = nil) { - _ = jsObject[Keys.stepDown]!(n?.jsValue() ?? .undefined) + _ = jsObject[Strings.stepDown]!(n?.jsValue() ?? .undefined) } @ReadonlyAttribute @@ -242,22 +185,22 @@ public class HTMLInputElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Keys.checkValidity]!().fromJSValue()! + jsObject[Strings.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Keys.reportValidity]!().fromJSValue()! + jsObject[Strings.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute public var labels: NodeList? public func select() { - _ = jsObject[Keys.select]!() + _ = jsObject[Strings.select]!() } @ReadWriteAttribute @@ -270,19 +213,19 @@ public class HTMLInputElement: HTMLElement { public var selectionDirection: String? public func setRangeText(replacement: String) { - _ = jsObject[Keys.setRangeText]!(replacement.jsValue()) + _ = jsObject[Strings.setRangeText]!(replacement.jsValue()) } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - _ = jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + _ = jsObject[Strings.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - _ = jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + _ = jsObject[Strings.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) } public func showPicker() { - _ = jsObject[Keys.showPicker]!() + _ = jsObject[Strings.showPicker]!() } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLLIElement.swift b/Sources/DOMKit/WebIDL/HTMLLIElement.swift index dd1b84ce..0f47f237 100644 --- a/Sources/DOMKit/WebIDL/HTMLLIElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLIElement.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class HTMLLIElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLLIElement.function! } - private enum Keys { - static let type: JSString = "type" - static let value: JSString = "value" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift index aadcc812..8f7c3bbd 100644 --- a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class HTMLLabelElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLLabelElement.function! } - private enum Keys { - static let control: JSString = "control" - static let form: JSString = "form" - static let htmlFor: JSString = "htmlFor" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: Keys.htmlFor) - _control = ReadonlyAttribute(jsObject: jsObject, name: Keys.control) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: Strings.htmlFor) + _control = ReadonlyAttribute(jsObject: jsObject, name: Strings.control) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift index d262b5b4..48740c1c 100644 --- a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class HTMLLegendElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLLegendElement.function! } - private enum Keys { - static let align: JSString = "align" - static let form: JSString = "form" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift index c0e8dd02..713ce7ef 100644 --- a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift @@ -6,46 +6,25 @@ import JavaScriptKit public class HTMLLinkElement: HTMLElement, LinkStyle { override public class var constructor: JSFunction { JSObject.global.HTMLLinkElement.function! } - private enum Keys { - static let `as`: JSString = "as" - static let blocking: JSString = "blocking" - static let charset: JSString = "charset" - static let crossOrigin: JSString = "crossOrigin" - static let disabled: JSString = "disabled" - static let href: JSString = "href" - static let hreflang: JSString = "hreflang" - static let imageSizes: JSString = "imageSizes" - static let imageSrcset: JSString = "imageSrcset" - static let integrity: JSString = "integrity" - static let media: JSString = "media" - static let referrerPolicy: JSString = "referrerPolicy" - static let rel: JSString = "rel" - static let relList: JSString = "relList" - static let rev: JSString = "rev" - static let sizes: JSString = "sizes" - static let target: JSString = "target" - static let type: JSString = "type" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadWriteAttribute(jsObject: jsObject, name: Keys.href) - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Keys.crossOrigin) - _rel = ReadWriteAttribute(jsObject: jsObject, name: Keys.rel) - _as = ReadWriteAttribute(jsObject: jsObject, name: Keys.as) - _relList = ReadonlyAttribute(jsObject: jsObject, name: Keys.relList) - _media = ReadWriteAttribute(jsObject: jsObject, name: Keys.media) - _integrity = ReadWriteAttribute(jsObject: jsObject, name: Keys.integrity) - _hreflang = ReadWriteAttribute(jsObject: jsObject, name: Keys.hreflang) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _sizes = ReadonlyAttribute(jsObject: jsObject, name: Keys.sizes) - _imageSrcset = ReadWriteAttribute(jsObject: jsObject, name: Keys.imageSrcset) - _imageSizes = ReadWriteAttribute(jsObject: jsObject, name: Keys.imageSizes) - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) - _blocking = ReadonlyAttribute(jsObject: jsObject, name: Keys.blocking) - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) - _charset = ReadWriteAttribute(jsObject: jsObject, name: Keys.charset) - _rev = ReadWriteAttribute(jsObject: jsObject, name: Keys.rev) - _target = ReadWriteAttribute(jsObject: jsObject, name: Keys.target) + _href = ReadWriteAttribute(jsObject: jsObject, name: Strings.href) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Strings.crossOrigin) + _rel = ReadWriteAttribute(jsObject: jsObject, name: Strings.rel) + _as = ReadWriteAttribute(jsObject: jsObject, name: Strings.as) + _relList = ReadonlyAttribute(jsObject: jsObject, name: Strings.relList) + _media = ReadWriteAttribute(jsObject: jsObject, name: Strings.media) + _integrity = ReadWriteAttribute(jsObject: jsObject, name: Strings.integrity) + _hreflang = ReadWriteAttribute(jsObject: jsObject, name: Strings.hreflang) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _sizes = ReadonlyAttribute(jsObject: jsObject, name: Strings.sizes) + _imageSrcset = ReadWriteAttribute(jsObject: jsObject, name: Strings.imageSrcset) + _imageSizes = ReadWriteAttribute(jsObject: jsObject, name: Strings.imageSizes) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) + _blocking = ReadonlyAttribute(jsObject: jsObject, name: Strings.blocking) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) + _charset = ReadWriteAttribute(jsObject: jsObject, name: Strings.charset) + _rev = ReadWriteAttribute(jsObject: jsObject, name: Strings.rev) + _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLMapElement.swift b/Sources/DOMKit/WebIDL/HTMLMapElement.swift index 4c286c3b..42bc60b3 100644 --- a/Sources/DOMKit/WebIDL/HTMLMapElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMapElement.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class HTMLMapElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMapElement.function! } - private enum Keys { - static let areas: JSString = "areas" - static let name: JSString = "name" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _areas = ReadonlyAttribute(jsObject: jsObject, name: Keys.areas) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _areas = ReadonlyAttribute(jsObject: jsObject, name: Strings.areas) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift index 8a91d554..0b80ca1b 100644 --- a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift @@ -6,34 +6,18 @@ import JavaScriptKit public class HTMLMarqueeElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMarqueeElement.function! } - private enum Keys { - static let behavior: JSString = "behavior" - static let bgColor: JSString = "bgColor" - static let direction: JSString = "direction" - static let height: JSString = "height" - static let hspace: JSString = "hspace" - static let loop: JSString = "loop" - static let scrollAmount: JSString = "scrollAmount" - static let scrollDelay: JSString = "scrollDelay" - static let start: JSString = "start" - static let stop: JSString = "stop" - static let trueSpeed: JSString = "trueSpeed" - static let vspace: JSString = "vspace" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _behavior = ReadWriteAttribute(jsObject: jsObject, name: Keys.behavior) - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) - _direction = ReadWriteAttribute(jsObject: jsObject, name: Keys.direction) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) - _hspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.hspace) - _loop = ReadWriteAttribute(jsObject: jsObject, name: Keys.loop) - _scrollAmount = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrollAmount) - _scrollDelay = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrollDelay) - _trueSpeed = ReadWriteAttribute(jsObject: jsObject, name: Keys.trueSpeed) - _vspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.vspace) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _behavior = ReadWriteAttribute(jsObject: jsObject, name: Strings.behavior) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.bgColor) + _direction = ReadWriteAttribute(jsObject: jsObject, name: Strings.direction) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _hspace = ReadWriteAttribute(jsObject: jsObject, name: Strings.hspace) + _loop = ReadWriteAttribute(jsObject: jsObject, name: Strings.loop) + _scrollAmount = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollAmount) + _scrollDelay = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollDelay) + _trueSpeed = ReadWriteAttribute(jsObject: jsObject, name: Strings.trueSpeed) + _vspace = ReadWriteAttribute(jsObject: jsObject, name: Strings.vspace) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) super.init(unsafelyWrapping: jsObject) } @@ -75,10 +59,10 @@ public class HTMLMarqueeElement: HTMLElement { public var width: String public func start() { - _ = jsObject[Keys.start]!() + _ = jsObject[Strings.start]!() } public func stop() { - _ = jsObject[Keys.stop]!() + _ = jsObject[Strings.stop]!() } } diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index 48363e2b..374d08bb 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -6,82 +6,35 @@ import JavaScriptKit public class HTMLMediaElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMediaElement.function! } - private enum Keys { - static let HAVE_CURRENT_DATA: JSString = "HAVE_CURRENT_DATA" - static let HAVE_ENOUGH_DATA: JSString = "HAVE_ENOUGH_DATA" - static let HAVE_FUTURE_DATA: JSString = "HAVE_FUTURE_DATA" - static let HAVE_METADATA: JSString = "HAVE_METADATA" - static let HAVE_NOTHING: JSString = "HAVE_NOTHING" - static let NETWORK_EMPTY: JSString = "NETWORK_EMPTY" - static let NETWORK_IDLE: JSString = "NETWORK_IDLE" - static let NETWORK_LOADING: JSString = "NETWORK_LOADING" - static let NETWORK_NO_SOURCE: JSString = "NETWORK_NO_SOURCE" - static let addTextTrack: JSString = "addTextTrack" - static let audioTracks: JSString = "audioTracks" - static let autoplay: JSString = "autoplay" - static let buffered: JSString = "buffered" - static let canPlayType: JSString = "canPlayType" - static let controls: JSString = "controls" - static let crossOrigin: JSString = "crossOrigin" - static let currentSrc: JSString = "currentSrc" - static let currentTime: JSString = "currentTime" - static let defaultMuted: JSString = "defaultMuted" - static let defaultPlaybackRate: JSString = "defaultPlaybackRate" - static let duration: JSString = "duration" - static let ended: JSString = "ended" - static let error: JSString = "error" - static let fastSeek: JSString = "fastSeek" - static let getStartDate: JSString = "getStartDate" - static let load: JSString = "load" - static let loop: JSString = "loop" - static let muted: JSString = "muted" - static let networkState: JSString = "networkState" - static let pause: JSString = "pause" - static let paused: JSString = "paused" - static let play: JSString = "play" - static let playbackRate: JSString = "playbackRate" - static let played: JSString = "played" - static let preload: JSString = "preload" - static let preservesPitch: JSString = "preservesPitch" - static let readyState: JSString = "readyState" - static let seekable: JSString = "seekable" - static let seeking: JSString = "seeking" - static let src: JSString = "src" - static let srcObject: JSString = "srcObject" - static let textTracks: JSString = "textTracks" - static let videoTracks: JSString = "videoTracks" - static let volume: JSString = "volume" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _error = ReadonlyAttribute(jsObject: jsObject, name: Keys.error) - _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) - _srcObject = ReadWriteAttribute(jsObject: jsObject, name: Keys.srcObject) - _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: Keys.currentSrc) - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Keys.crossOrigin) - _networkState = ReadonlyAttribute(jsObject: jsObject, name: Keys.networkState) - _preload = ReadWriteAttribute(jsObject: jsObject, name: Keys.preload) - _buffered = ReadonlyAttribute(jsObject: jsObject, name: Keys.buffered) - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) - _seeking = ReadonlyAttribute(jsObject: jsObject, name: Keys.seeking) - _currentTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.currentTime) - _duration = ReadonlyAttribute(jsObject: jsObject, name: Keys.duration) - _paused = ReadonlyAttribute(jsObject: jsObject, name: Keys.paused) - _defaultPlaybackRate = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultPlaybackRate) - _playbackRate = ReadWriteAttribute(jsObject: jsObject, name: Keys.playbackRate) - _preservesPitch = ReadWriteAttribute(jsObject: jsObject, name: Keys.preservesPitch) - _played = ReadonlyAttribute(jsObject: jsObject, name: Keys.played) - _seekable = ReadonlyAttribute(jsObject: jsObject, name: Keys.seekable) - _ended = ReadonlyAttribute(jsObject: jsObject, name: Keys.ended) - _autoplay = ReadWriteAttribute(jsObject: jsObject, name: Keys.autoplay) - _loop = ReadWriteAttribute(jsObject: jsObject, name: Keys.loop) - _controls = ReadWriteAttribute(jsObject: jsObject, name: Keys.controls) - _volume = ReadWriteAttribute(jsObject: jsObject, name: Keys.volume) - _muted = ReadWriteAttribute(jsObject: jsObject, name: Keys.muted) - _defaultMuted = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultMuted) - _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: Keys.audioTracks) - _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: Keys.videoTracks) - _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Keys.textTracks) + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _srcObject = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcObject) + _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentSrc) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Strings.crossOrigin) + _networkState = ReadonlyAttribute(jsObject: jsObject, name: Strings.networkState) + _preload = ReadWriteAttribute(jsObject: jsObject, name: Strings.preload) + _buffered = ReadonlyAttribute(jsObject: jsObject, name: Strings.buffered) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _seeking = ReadonlyAttribute(jsObject: jsObject, name: Strings.seeking) + _currentTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentTime) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _paused = ReadonlyAttribute(jsObject: jsObject, name: Strings.paused) + _defaultPlaybackRate = ReadWriteAttribute(jsObject: jsObject, name: Strings.defaultPlaybackRate) + _playbackRate = ReadWriteAttribute(jsObject: jsObject, name: Strings.playbackRate) + _preservesPitch = ReadWriteAttribute(jsObject: jsObject, name: Strings.preservesPitch) + _played = ReadonlyAttribute(jsObject: jsObject, name: Strings.played) + _seekable = ReadonlyAttribute(jsObject: jsObject, name: Strings.seekable) + _ended = ReadonlyAttribute(jsObject: jsObject, name: Strings.ended) + _autoplay = ReadWriteAttribute(jsObject: jsObject, name: Strings.autoplay) + _loop = ReadWriteAttribute(jsObject: jsObject, name: Strings.loop) + _controls = ReadWriteAttribute(jsObject: jsObject, name: Strings.controls) + _volume = ReadWriteAttribute(jsObject: jsObject, name: Strings.volume) + _muted = ReadWriteAttribute(jsObject: jsObject, name: Strings.muted) + _defaultMuted = ReadWriteAttribute(jsObject: jsObject, name: Strings.defaultMuted) + _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioTracks) + _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoTracks) + _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.textTracks) super.init(unsafelyWrapping: jsObject) } @@ -118,11 +71,11 @@ public class HTMLMediaElement: HTMLElement { public var buffered: TimeRanges public func load() { - _ = jsObject[Keys.load]!() + _ = jsObject[Strings.load]!() } public func canPlayType(type: String) -> CanPlayTypeResult { - jsObject[Keys.canPlayType]!(type.jsValue()).fromJSValue()! + jsObject[Strings.canPlayType]!(type.jsValue()).fromJSValue()! } public static let HAVE_NOTHING: UInt16 = 0 @@ -145,14 +98,14 @@ public class HTMLMediaElement: HTMLElement { public var currentTime: Double public func fastSeek(time: Double) { - _ = jsObject[Keys.fastSeek]!(time.jsValue()) + _ = jsObject[Strings.fastSeek]!(time.jsValue()) } @ReadonlyAttribute public var duration: Double public func getStartDate() -> JSObject { - jsObject[Keys.getStartDate]!().fromJSValue()! + jsObject[Strings.getStartDate]!().fromJSValue()! } @ReadonlyAttribute @@ -183,17 +136,17 @@ public class HTMLMediaElement: HTMLElement { public var loop: Bool public func play() -> JSPromise { - jsObject[Keys.play]!().fromJSValue()! + jsObject[Strings.play]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func play() async throws { - let _promise: JSPromise = jsObject[Keys.play]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.play]!().fromJSValue()! _ = try await _promise.get() } public func pause() { - _ = jsObject[Keys.pause]!() + _ = jsObject[Strings.pause]!() } @ReadWriteAttribute @@ -218,6 +171,6 @@ public class HTMLMediaElement: HTMLElement { public var textTracks: TextTrackList public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { - jsObject[Keys.addTextTrack]!(kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.addTextTrack]!(kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift index 00ea25d1..4342606c 100644 --- a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLMenuElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMenuElement.function! } - private enum Keys { - static let compact: JSString = "compact" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) + _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift index d050ee64..123fbcb7 100644 --- a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift @@ -6,20 +6,12 @@ import JavaScriptKit public class HTMLMetaElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMetaElement.function! } - private enum Keys { - static let content: JSString = "content" - static let httpEquiv: JSString = "httpEquiv" - static let media: JSString = "media" - static let name: JSString = "name" - static let scheme: JSString = "scheme" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _httpEquiv = ReadWriteAttribute(jsObject: jsObject, name: Keys.httpEquiv) - _content = ReadWriteAttribute(jsObject: jsObject, name: Keys.content) - _media = ReadWriteAttribute(jsObject: jsObject, name: Keys.media) - _scheme = ReadWriteAttribute(jsObject: jsObject, name: Keys.scheme) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _httpEquiv = ReadWriteAttribute(jsObject: jsObject, name: Strings.httpEquiv) + _content = ReadWriteAttribute(jsObject: jsObject, name: Strings.content) + _media = ReadWriteAttribute(jsObject: jsObject, name: Strings.media) + _scheme = ReadWriteAttribute(jsObject: jsObject, name: Strings.scheme) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift index 3ae6bcd2..d00415d9 100644 --- a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift @@ -6,24 +6,14 @@ import JavaScriptKit public class HTMLMeterElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLMeterElement.function! } - private enum Keys { - static let high: JSString = "high" - static let labels: JSString = "labels" - static let low: JSString = "low" - static let max: JSString = "max" - static let min: JSString = "min" - static let optimum: JSString = "optimum" - static let value: JSString = "value" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _min = ReadWriteAttribute(jsObject: jsObject, name: Keys.min) - _max = ReadWriteAttribute(jsObject: jsObject, name: Keys.max) - _low = ReadWriteAttribute(jsObject: jsObject, name: Keys.low) - _high = ReadWriteAttribute(jsObject: jsObject, name: Keys.high) - _optimum = ReadWriteAttribute(jsObject: jsObject, name: Keys.optimum) - _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _min = ReadWriteAttribute(jsObject: jsObject, name: Strings.min) + _max = ReadWriteAttribute(jsObject: jsObject, name: Strings.max) + _low = ReadWriteAttribute(jsObject: jsObject, name: Strings.low) + _high = ReadWriteAttribute(jsObject: jsObject, name: Strings.high) + _optimum = ReadWriteAttribute(jsObject: jsObject, name: Strings.optimum) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Strings.labels) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLModElement.swift b/Sources/DOMKit/WebIDL/HTMLModElement.swift index a2e64fbc..ad7a789d 100644 --- a/Sources/DOMKit/WebIDL/HTMLModElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLModElement.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class HTMLModElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLModElement.function! } - private enum Keys { - static let cite: JSString = "cite" - static let dateTime: JSString = "dateTime" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _cite = ReadWriteAttribute(jsObject: jsObject, name: Keys.cite) - _dateTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.dateTime) + _cite = ReadWriteAttribute(jsObject: jsObject, name: Strings.cite) + _dateTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.dateTime) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLOListElement.swift b/Sources/DOMKit/WebIDL/HTMLOListElement.swift index 4fa3ea76..c73f5cfc 100644 --- a/Sources/DOMKit/WebIDL/HTMLOListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOListElement.swift @@ -6,18 +6,11 @@ import JavaScriptKit public class HTMLOListElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOListElement.function! } - private enum Keys { - static let compact: JSString = "compact" - static let reversed: JSString = "reversed" - static let start: JSString = "start" - static let type: JSString = "type" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _reversed = ReadWriteAttribute(jsObject: jsObject, name: Keys.reversed) - _start = ReadWriteAttribute(jsObject: jsObject, name: Keys.start) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) + _reversed = ReadWriteAttribute(jsObject: jsObject, name: Strings.reversed) + _start = ReadWriteAttribute(jsObject: jsObject, name: Strings.start) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift index 4c756692..bf79ec77 100644 --- a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -6,58 +6,29 @@ import JavaScriptKit public class HTMLObjectElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLObjectElement.function! } - private enum Keys { - static let align: JSString = "align" - static let archive: JSString = "archive" - static let border: JSString = "border" - static let checkValidity: JSString = "checkValidity" - static let code: JSString = "code" - static let codeBase: JSString = "codeBase" - static let codeType: JSString = "codeType" - static let contentDocument: JSString = "contentDocument" - static let contentWindow: JSString = "contentWindow" - static let data: JSString = "data" - static let declare: JSString = "declare" - static let form: JSString = "form" - static let getSVGDocument: JSString = "getSVGDocument" - static let height: JSString = "height" - static let hspace: JSString = "hspace" - static let name: JSString = "name" - static let reportValidity: JSString = "reportValidity" - static let setCustomValidity: JSString = "setCustomValidity" - static let standby: JSString = "standby" - static let type: JSString = "type" - static let useMap: JSString = "useMap" - static let validationMessage: JSString = "validationMessage" - static let validity: JSString = "validity" - static let vspace: JSString = "vspace" - static let width: JSString = "width" - static let willValidate: JSString = "willValidate" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadWriteAttribute(jsObject: jsObject, name: Keys.data) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) - _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentDocument) - _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: Keys.contentWindow) - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) - _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _archive = ReadWriteAttribute(jsObject: jsObject, name: Keys.archive) - _code = ReadWriteAttribute(jsObject: jsObject, name: Keys.code) - _declare = ReadWriteAttribute(jsObject: jsObject, name: Keys.declare) - _hspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.hspace) - _standby = ReadWriteAttribute(jsObject: jsObject, name: Keys.standby) - _vspace = ReadWriteAttribute(jsObject: jsObject, name: Keys.vspace) - _codeBase = ReadWriteAttribute(jsObject: jsObject, name: Keys.codeBase) - _codeType = ReadWriteAttribute(jsObject: jsObject, name: Keys.codeType) - _useMap = ReadWriteAttribute(jsObject: jsObject, name: Keys.useMap) - _border = ReadWriteAttribute(jsObject: jsObject, name: Keys.border) + _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _contentDocument = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentDocument) + _contentWindow = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentWindow) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Strings.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Strings.validationMessage) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _archive = ReadWriteAttribute(jsObject: jsObject, name: Strings.archive) + _code = ReadWriteAttribute(jsObject: jsObject, name: Strings.code) + _declare = ReadWriteAttribute(jsObject: jsObject, name: Strings.declare) + _hspace = ReadWriteAttribute(jsObject: jsObject, name: Strings.hspace) + _standby = ReadWriteAttribute(jsObject: jsObject, name: Strings.standby) + _vspace = ReadWriteAttribute(jsObject: jsObject, name: Strings.vspace) + _codeBase = ReadWriteAttribute(jsObject: jsObject, name: Strings.codeBase) + _codeType = ReadWriteAttribute(jsObject: jsObject, name: Strings.codeType) + _useMap = ReadWriteAttribute(jsObject: jsObject, name: Strings.useMap) + _border = ReadWriteAttribute(jsObject: jsObject, name: Strings.border) super.init(unsafelyWrapping: jsObject) } @@ -90,7 +61,7 @@ public class HTMLObjectElement: HTMLElement { public var contentWindow: WindowProxy? public func getSVGDocument() -> Document? { - jsObject[Keys.getSVGDocument]!().fromJSValue()! + jsObject[Strings.getSVGDocument]!().fromJSValue()! } @ReadonlyAttribute @@ -103,15 +74,15 @@ public class HTMLObjectElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Keys.checkValidity]!().fromJSValue()! + jsObject[Strings.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Keys.reportValidity]!().fromJSValue()! + jsObject[Strings.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift index c3b98f05..66c3f481 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class HTMLOptGroupElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOptGroupElement.function! } - private enum Keys { - static let disabled: JSString = "disabled" - static let label: JSString = "label" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) - _label = ReadWriteAttribute(jsObject: jsObject, name: Keys.label) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) + _label = ReadWriteAttribute(jsObject: jsObject, name: Strings.label) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift index 9ea9d3e0..efd04e95 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift @@ -6,26 +6,15 @@ import JavaScriptKit public class HTMLOptionElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOptionElement.function! } - private enum Keys { - static let defaultSelected: JSString = "defaultSelected" - static let disabled: JSString = "disabled" - static let form: JSString = "form" - static let index: JSString = "index" - static let label: JSString = "label" - static let selected: JSString = "selected" - static let text: JSString = "text" - static let value: JSString = "value" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _label = ReadWriteAttribute(jsObject: jsObject, name: Keys.label) - _defaultSelected = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultSelected) - _selected = ReadWriteAttribute(jsObject: jsObject, name: Keys.selected) - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) - _index = ReadonlyAttribute(jsObject: jsObject, name: Keys.index) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _label = ReadWriteAttribute(jsObject: jsObject, name: Strings.label) + _defaultSelected = ReadWriteAttribute(jsObject: jsObject, name: Strings.defaultSelected) + _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) + _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift index 4b9344ff..8d71ebb8 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -6,16 +6,9 @@ import JavaScriptKit public class HTMLOptionsCollection: HTMLCollection { override public class var constructor: JSFunction { JSObject.global.HTMLOptionsCollection.function! } - private enum Keys { - static let add: JSString = "add" - static let length: JSString = "length" - static let remove: JSString = "remove" - static let selectedIndex: JSString = "selectedIndex" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadWriteAttribute(jsObject: jsObject, name: Keys.length) - _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectedIndex) + _length = ReadWriteAttribute(jsObject: jsObject, name: Strings.length) + _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectedIndex) super.init(unsafelyWrapping: jsObject) } @@ -28,11 +21,11 @@ public class HTMLOptionsCollection: HTMLCollection { // XXX: unsupported setter for keys of type UInt32 public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined) + _ = jsObject[Strings.add]!(element.jsValue(), before?.jsValue() ?? .undefined) } public func remove(index: Int32) { - _ = jsObject[Keys.remove]!(index.jsValue()) + _ = jsObject[Strings.remove]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift index 6816ab99..ef44bea9 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift @@ -3,39 +3,30 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let autofocus: JSString = "autofocus" - static let blur: JSString = "blur" - static let dataset: JSString = "dataset" - static let focus: JSString = "focus" - static let nonce: JSString = "nonce" - static let tabIndex: JSString = "tabIndex" -} - public protocol HTMLOrSVGElement: JSBridgedClass {} public extension HTMLOrSVGElement { - var dataset: DOMStringMap { ReadonlyAttribute[Keys.dataset, in: jsObject] } + var dataset: DOMStringMap { ReadonlyAttribute[Strings.dataset, in: jsObject] } var nonce: String { - get { ReadWriteAttribute[Keys.nonce, in: jsObject] } - set { ReadWriteAttribute[Keys.nonce, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.nonce, in: jsObject] } + set { ReadWriteAttribute[Strings.nonce, in: jsObject] = newValue } } var autofocus: Bool { - get { ReadWriteAttribute[Keys.autofocus, in: jsObject] } - set { ReadWriteAttribute[Keys.autofocus, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.autofocus, in: jsObject] } + set { ReadWriteAttribute[Strings.autofocus, in: jsObject] = newValue } } var tabIndex: Int32 { - get { ReadWriteAttribute[Keys.tabIndex, in: jsObject] } - set { ReadWriteAttribute[Keys.tabIndex, in: jsObject] = newValue } + get { ReadWriteAttribute[Strings.tabIndex, in: jsObject] } + set { ReadWriteAttribute[Strings.tabIndex, in: jsObject] = newValue } } func focus(options: FocusOptions? = nil) { - _ = jsObject[Keys.focus]!(options?.jsValue() ?? .undefined) + _ = jsObject[Strings.focus]!(options?.jsValue() ?? .undefined) } func blur() { - _ = jsObject[Keys.blur]!() + _ = jsObject[Strings.blur]!() } } diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift index 7802df2f..a46adbe3 100644 --- a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -6,33 +6,17 @@ import JavaScriptKit public class HTMLOutputElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLOutputElement.function! } - private enum Keys { - static let checkValidity: JSString = "checkValidity" - static let defaultValue: JSString = "defaultValue" - static let form: JSString = "form" - static let htmlFor: JSString = "htmlFor" - static let labels: JSString = "labels" - static let name: JSString = "name" - static let reportValidity: JSString = "reportValidity" - static let setCustomValidity: JSString = "setCustomValidity" - static let type: JSString = "type" - static let validationMessage: JSString = "validationMessage" - static let validity: JSString = "validity" - static let value: JSString = "value" - static let willValidate: JSString = "willValidate" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _htmlFor = ReadonlyAttribute(jsObject: jsObject, name: Keys.htmlFor) - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) - _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultValue) - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) - _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) - _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) + _htmlFor = ReadonlyAttribute(jsObject: jsObject, name: Strings.htmlFor) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: Strings.defaultValue) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _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) super.init(unsafelyWrapping: jsObject) } @@ -68,15 +52,15 @@ public class HTMLOutputElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Keys.checkValidity]!().fromJSValue()! + jsObject[Strings.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Keys.reportValidity]!().fromJSValue()! + jsObject[Strings.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift index 33d4fe98..2efd3f3f 100644 --- a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLParagraphElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLParagraphElement.function! } - private enum Keys { - static let align: JSString = "align" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLParamElement.swift b/Sources/DOMKit/WebIDL/HTMLParamElement.swift index 5cf4966b..621fbccb 100644 --- a/Sources/DOMKit/WebIDL/HTMLParamElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParamElement.swift @@ -6,18 +6,11 @@ import JavaScriptKit public class HTMLParamElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLParamElement.function! } - private enum Keys { - static let name: JSString = "name" - static let type: JSString = "type" - static let value: JSString = "value" - static let valueType: JSString = "valueType" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _valueType = ReadWriteAttribute(jsObject: jsObject, name: Keys.valueType) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _valueType = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueType) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift index c25bccd2..01d29383 100644 --- a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class HTMLPictureElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLPictureElement.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLPreElement.swift b/Sources/DOMKit/WebIDL/HTMLPreElement.swift index 324c09ad..d6309f21 100644 --- a/Sources/DOMKit/WebIDL/HTMLPreElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPreElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLPreElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLPreElement.function! } - private enum Keys { - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift index 7298c345..4b7fb56d 100644 --- a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift @@ -6,18 +6,11 @@ import JavaScriptKit public class HTMLProgressElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLProgressElement.function! } - private enum Keys { - static let labels: JSString = "labels" - static let max: JSString = "max" - static let position: JSString = "position" - static let value: JSString = "value" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _max = ReadWriteAttribute(jsObject: jsObject, name: Keys.max) - _position = ReadonlyAttribute(jsObject: jsObject, name: Keys.position) - _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _max = ReadWriteAttribute(jsObject: jsObject, name: Strings.max) + _position = ReadonlyAttribute(jsObject: jsObject, name: Strings.position) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Strings.labels) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift index 023d24f3..d58e7a0d 100644 --- a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLQuoteElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLQuoteElement.function! } - private enum Keys { - static let cite: JSString = "cite" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _cite = ReadWriteAttribute(jsObject: jsObject, name: Keys.cite) + _cite = ReadWriteAttribute(jsObject: jsObject, name: Strings.cite) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift index 5d819ce2..1c62ba1f 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -6,37 +6,20 @@ import JavaScriptKit public class HTMLScriptElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLScriptElement.function! } - private enum Keys { - static let async: JSString = "async" - static let blocking: JSString = "blocking" - static let charset: JSString = "charset" - static let crossOrigin: JSString = "crossOrigin" - static let `defer`: JSString = "defer" - static let event: JSString = "event" - static let htmlFor: JSString = "htmlFor" - static let integrity: JSString = "integrity" - static let noModule: JSString = "noModule" - static let referrerPolicy: JSString = "referrerPolicy" - static let src: JSString = "src" - static let supports: JSString = "supports" - static let text: JSString = "text" - static let type: JSString = "type" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _noModule = ReadWriteAttribute(jsObject: jsObject, name: Keys.noModule) - _async = ReadWriteAttribute(jsObject: jsObject, name: Keys.async) - _defer = ReadWriteAttribute(jsObject: jsObject, name: Keys.defer) - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Keys.crossOrigin) - _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) - _integrity = ReadWriteAttribute(jsObject: jsObject, name: Keys.integrity) - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Keys.referrerPolicy) - _blocking = ReadonlyAttribute(jsObject: jsObject, name: Keys.blocking) - _charset = ReadWriteAttribute(jsObject: jsObject, name: Keys.charset) - _event = ReadWriteAttribute(jsObject: jsObject, name: Keys.event) - _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: Keys.htmlFor) + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _noModule = ReadWriteAttribute(jsObject: jsObject, name: Strings.noModule) + _async = ReadWriteAttribute(jsObject: jsObject, name: Strings.async) + _defer = ReadWriteAttribute(jsObject: jsObject, name: Strings.defer) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Strings.crossOrigin) + _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) + _integrity = ReadWriteAttribute(jsObject: jsObject, name: Strings.integrity) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) + _blocking = ReadonlyAttribute(jsObject: jsObject, name: Strings.blocking) + _charset = ReadWriteAttribute(jsObject: jsObject, name: Strings.charset) + _event = ReadWriteAttribute(jsObject: jsObject, name: Strings.event) + _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: Strings.htmlFor) super.init(unsafelyWrapping: jsObject) } @@ -75,7 +58,7 @@ public class HTMLScriptElement: HTMLElement { public var blocking: DOMTokenList public static func supports(type: String) -> Bool { - constructor[Keys.supports]!(type.jsValue()).fromJSValue()! + constructor[Strings.supports]!(type.jsValue()).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index d17d0cb9..fe393159 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -6,51 +6,24 @@ import JavaScriptKit public class HTMLSelectElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSelectElement.function! } - private enum Keys { - static let add: JSString = "add" - static let autocomplete: JSString = "autocomplete" - static let checkValidity: JSString = "checkValidity" - static let disabled: JSString = "disabled" - static let form: JSString = "form" - static let item: JSString = "item" - static let labels: JSString = "labels" - static let length: JSString = "length" - static let multiple: JSString = "multiple" - static let name: JSString = "name" - static let namedItem: JSString = "namedItem" - static let options: JSString = "options" - static let remove: JSString = "remove" - static let reportValidity: JSString = "reportValidity" - static let required: JSString = "required" - static let selectedIndex: JSString = "selectedIndex" - static let selectedOptions: JSString = "selectedOptions" - static let setCustomValidity: JSString = "setCustomValidity" - static let size: JSString = "size" - static let type: JSString = "type" - static let validationMessage: JSString = "validationMessage" - static let validity: JSString = "validity" - static let value: JSString = "value" - static let willValidate: JSString = "willValidate" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocomplete) - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _multiple = ReadWriteAttribute(jsObject: jsObject, name: Keys.multiple) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _required = ReadWriteAttribute(jsObject: jsObject, name: Keys.required) - _size = ReadWriteAttribute(jsObject: jsObject, name: Keys.size) - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) - _options = ReadonlyAttribute(jsObject: jsObject, name: Keys.options) - _length = ReadWriteAttribute(jsObject: jsObject, name: Keys.length) - _selectedOptions = ReadonlyAttribute(jsObject: jsObject, name: Keys.selectedOptions) - _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectedIndex) - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) - _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) - _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _multiple = ReadWriteAttribute(jsObject: jsObject, name: Strings.multiple) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _required = ReadWriteAttribute(jsObject: jsObject, name: Strings.required) + _size = ReadWriteAttribute(jsObject: jsObject, name: Strings.size) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _options = ReadonlyAttribute(jsObject: jsObject, name: Strings.options) + _length = ReadWriteAttribute(jsObject: jsObject, name: Strings.length) + _selectedOptions = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedOptions) + _selectedIndex = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectedIndex) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _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) super.init(unsafelyWrapping: jsObject) } @@ -93,19 +66,19 @@ public class HTMLSelectElement: HTMLElement { } public func namedItem(name: String) -> HTMLOptionElement? { - jsObject[Keys.namedItem]!(name.jsValue()).fromJSValue()! + jsObject[Strings.namedItem]!(name.jsValue()).fromJSValue()! } public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.add]!(element.jsValue(), before?.jsValue() ?? .undefined) + _ = jsObject[Strings.add]!(element.jsValue(), before?.jsValue() ?? .undefined) } public func remove() { - _ = jsObject[Keys.remove]!() + _ = jsObject[Strings.remove]!() } public func remove(index: Int32) { - _ = jsObject[Keys.remove]!(index.jsValue()) + _ = jsObject[Strings.remove]!(index.jsValue()) } // XXX: unsupported setter for keys of type UInt32 @@ -129,15 +102,15 @@ public class HTMLSelectElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Keys.checkValidity]!().fromJSValue()! + jsObject[Strings.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Keys.reportValidity]!().fromJSValue()! + jsObject[Strings.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index 2f8431f4..5e34a069 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -6,15 +6,8 @@ import JavaScriptKit public class HTMLSlotElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSlotElement.function! } - private enum Keys { - static let assign: JSString = "assign" - static let assignedElements: JSString = "assignedElements" - static let assignedNodes: JSString = "assignedNodes" - static let name: JSString = "name" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) super.init(unsafelyWrapping: jsObject) } @@ -26,14 +19,14 @@ public class HTMLSlotElement: HTMLElement { public var name: String public func assignedNodes(options: AssignedNodesOptions? = nil) -> [Node] { - jsObject[Keys.assignedNodes]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.assignedNodes]!(options?.jsValue() ?? .undefined).fromJSValue()! } public func assignedElements(options: AssignedNodesOptions? = nil) -> [Element] { - jsObject[Keys.assignedElements]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.assignedElements]!(options?.jsValue() ?? .undefined).fromJSValue()! } public func assign(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.assign]!(nodes.jsValue()) + _ = jsObject[Strings.assign]!(nodes.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift index d930ac39..07f92e3b 100644 --- a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift @@ -6,24 +6,14 @@ import JavaScriptKit public class HTMLSourceElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSourceElement.function! } - private enum Keys { - static let height: JSString = "height" - static let media: JSString = "media" - static let sizes: JSString = "sizes" - static let src: JSString = "src" - static let srcset: JSString = "srcset" - static let type: JSString = "type" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) - _srcset = ReadWriteAttribute(jsObject: jsObject, name: Keys.srcset) - _sizes = ReadWriteAttribute(jsObject: jsObject, name: Keys.sizes) - _media = ReadWriteAttribute(jsObject: jsObject, name: Keys.media) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _srcset = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcset) + _sizes = ReadWriteAttribute(jsObject: jsObject, name: Strings.sizes) + _media = ReadWriteAttribute(jsObject: jsObject, name: Strings.media) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift index da10dab2..b798e6c8 100644 --- a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class HTMLSpanElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLSpanElement.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift index 253ca746..9031f522 100644 --- a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class HTMLStyleElement: HTMLElement, LinkStyle { override public class var constructor: JSFunction { JSObject.global.HTMLStyleElement.function! } - private enum Keys { - static let blocking: JSString = "blocking" - static let media: JSString = "media" - static let type: JSString = "type" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _media = ReadWriteAttribute(jsObject: jsObject, name: Keys.media) - _blocking = ReadonlyAttribute(jsObject: jsObject, name: Keys.blocking) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _media = ReadWriteAttribute(jsObject: jsObject, name: Strings.media) + _blocking = ReadonlyAttribute(jsObject: jsObject, name: Strings.blocking) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift index ef24c80e..c5332e79 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLTableCaptionElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableCaptionElement.function! } - private enum Keys { - static let align: JSString = "align" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift index b82a56c4..b383dca4 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift @@ -6,40 +6,22 @@ import JavaScriptKit public class HTMLTableCellElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableCellElement.function! } - private enum Keys { - static let abbr: JSString = "abbr" - static let align: JSString = "align" - static let axis: JSString = "axis" - static let bgColor: JSString = "bgColor" - static let cellIndex: JSString = "cellIndex" - static let ch: JSString = "ch" - static let chOff: JSString = "chOff" - static let colSpan: JSString = "colSpan" - static let headers: JSString = "headers" - static let height: JSString = "height" - static let noWrap: JSString = "noWrap" - static let rowSpan: JSString = "rowSpan" - static let scope: JSString = "scope" - static let vAlign: JSString = "vAlign" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _colSpan = ReadWriteAttribute(jsObject: jsObject, name: Keys.colSpan) - _rowSpan = ReadWriteAttribute(jsObject: jsObject, name: Keys.rowSpan) - _headers = ReadWriteAttribute(jsObject: jsObject, name: Keys.headers) - _cellIndex = ReadonlyAttribute(jsObject: jsObject, name: Keys.cellIndex) - _scope = ReadWriteAttribute(jsObject: jsObject, name: Keys.scope) - _abbr = ReadWriteAttribute(jsObject: jsObject, name: Keys.abbr) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _axis = ReadWriteAttribute(jsObject: jsObject, name: Keys.axis) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _ch = ReadWriteAttribute(jsObject: jsObject, name: Keys.ch) - _chOff = ReadWriteAttribute(jsObject: jsObject, name: Keys.chOff) - _noWrap = ReadWriteAttribute(jsObject: jsObject, name: Keys.noWrap) - _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Keys.vAlign) - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) + _colSpan = ReadWriteAttribute(jsObject: jsObject, name: Strings.colSpan) + _rowSpan = ReadWriteAttribute(jsObject: jsObject, name: Strings.rowSpan) + _headers = ReadWriteAttribute(jsObject: jsObject, name: Strings.headers) + _cellIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.cellIndex) + _scope = ReadWriteAttribute(jsObject: jsObject, name: Strings.scope) + _abbr = ReadWriteAttribute(jsObject: jsObject, name: Strings.abbr) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _axis = ReadWriteAttribute(jsObject: jsObject, name: Strings.axis) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _ch = ReadWriteAttribute(jsObject: jsObject, name: Strings.ch) + _chOff = ReadWriteAttribute(jsObject: jsObject, name: Strings.chOff) + _noWrap = ReadWriteAttribute(jsObject: jsObject, name: Strings.noWrap) + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Strings.vAlign) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.bgColor) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift index 6dfe4674..98f3943d 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift @@ -6,22 +6,13 @@ import JavaScriptKit public class HTMLTableColElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableColElement.function! } - private enum Keys { - static let align: JSString = "align" - static let ch: JSString = "ch" - static let chOff: JSString = "chOff" - static let span: JSString = "span" - static let vAlign: JSString = "vAlign" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _span = ReadWriteAttribute(jsObject: jsObject, name: Keys.span) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _ch = ReadWriteAttribute(jsObject: jsObject, name: Keys.ch) - _chOff = ReadWriteAttribute(jsObject: jsObject, name: Keys.chOff) - _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Keys.vAlign) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) + _span = ReadWriteAttribute(jsObject: jsObject, name: Strings.span) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _ch = ReadWriteAttribute(jsObject: jsObject, name: Strings.ch) + _chOff = ReadWriteAttribute(jsObject: jsObject, name: Strings.chOff) + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Strings.vAlign) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift index 3da61598..b72b19d1 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -6,47 +6,21 @@ import JavaScriptKit public class HTMLTableElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableElement.function! } - private enum Keys { - static let align: JSString = "align" - static let bgColor: JSString = "bgColor" - static let border: JSString = "border" - static let caption: JSString = "caption" - static let cellPadding: JSString = "cellPadding" - static let cellSpacing: JSString = "cellSpacing" - static let createCaption: JSString = "createCaption" - static let createTBody: JSString = "createTBody" - static let createTFoot: JSString = "createTFoot" - static let createTHead: JSString = "createTHead" - static let deleteCaption: JSString = "deleteCaption" - static let deleteRow: JSString = "deleteRow" - static let deleteTFoot: JSString = "deleteTFoot" - static let deleteTHead: JSString = "deleteTHead" - static let frame: JSString = "frame" - static let insertRow: JSString = "insertRow" - static let rows: JSString = "rows" - static let rules: JSString = "rules" - static let summary: JSString = "summary" - static let tBodies: JSString = "tBodies" - static let tFoot: JSString = "tFoot" - static let tHead: JSString = "tHead" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _caption = ReadWriteAttribute(jsObject: jsObject, name: Keys.caption) - _tHead = ReadWriteAttribute(jsObject: jsObject, name: Keys.tHead) - _tFoot = ReadWriteAttribute(jsObject: jsObject, name: Keys.tFoot) - _tBodies = ReadonlyAttribute(jsObject: jsObject, name: Keys.tBodies) - _rows = ReadonlyAttribute(jsObject: jsObject, name: Keys.rows) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _border = ReadWriteAttribute(jsObject: jsObject, name: Keys.border) - _frame = ReadWriteAttribute(jsObject: jsObject, name: Keys.frame) - _rules = ReadWriteAttribute(jsObject: jsObject, name: Keys.rules) - _summary = ReadWriteAttribute(jsObject: jsObject, name: Keys.summary) - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) - _cellPadding = ReadWriteAttribute(jsObject: jsObject, name: Keys.cellPadding) - _cellSpacing = ReadWriteAttribute(jsObject: jsObject, name: Keys.cellSpacing) + _caption = ReadWriteAttribute(jsObject: jsObject, name: Strings.caption) + _tHead = ReadWriteAttribute(jsObject: jsObject, name: Strings.tHead) + _tFoot = ReadWriteAttribute(jsObject: jsObject, name: Strings.tFoot) + _tBodies = ReadonlyAttribute(jsObject: jsObject, name: Strings.tBodies) + _rows = ReadonlyAttribute(jsObject: jsObject, name: Strings.rows) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _border = ReadWriteAttribute(jsObject: jsObject, name: Strings.border) + _frame = ReadWriteAttribute(jsObject: jsObject, name: Strings.frame) + _rules = ReadWriteAttribute(jsObject: jsObject, name: Strings.rules) + _summary = ReadWriteAttribute(jsObject: jsObject, name: Strings.summary) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.bgColor) + _cellPadding = ReadWriteAttribute(jsObject: jsObject, name: Strings.cellPadding) + _cellSpacing = ReadWriteAttribute(jsObject: jsObject, name: Strings.cellSpacing) super.init(unsafelyWrapping: jsObject) } @@ -58,51 +32,51 @@ public class HTMLTableElement: HTMLElement { public var caption: HTMLTableCaptionElement? public func createCaption() -> HTMLTableCaptionElement { - jsObject[Keys.createCaption]!().fromJSValue()! + jsObject[Strings.createCaption]!().fromJSValue()! } public func deleteCaption() { - _ = jsObject[Keys.deleteCaption]!() + _ = jsObject[Strings.deleteCaption]!() } @ReadWriteAttribute public var tHead: HTMLTableSectionElement? public func createTHead() -> HTMLTableSectionElement { - jsObject[Keys.createTHead]!().fromJSValue()! + jsObject[Strings.createTHead]!().fromJSValue()! } public func deleteTHead() { - _ = jsObject[Keys.deleteTHead]!() + _ = jsObject[Strings.deleteTHead]!() } @ReadWriteAttribute public var tFoot: HTMLTableSectionElement? public func createTFoot() -> HTMLTableSectionElement { - jsObject[Keys.createTFoot]!().fromJSValue()! + jsObject[Strings.createTFoot]!().fromJSValue()! } public func deleteTFoot() { - _ = jsObject[Keys.deleteTFoot]!() + _ = jsObject[Strings.deleteTFoot]!() } @ReadonlyAttribute public var tBodies: HTMLCollection public func createTBody() -> HTMLTableSectionElement { - jsObject[Keys.createTBody]!().fromJSValue()! + jsObject[Strings.createTBody]!().fromJSValue()! } @ReadonlyAttribute public var rows: HTMLCollection public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { - jsObject[Keys.insertRow]!(index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.insertRow]!(index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteRow(index: Int32) { - _ = jsObject[Keys.deleteRow]!(index.jsValue()) + _ = jsObject[Strings.deleteRow]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift index b91d1018..3d7999f7 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -6,28 +6,15 @@ import JavaScriptKit public class HTMLTableRowElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableRowElement.function! } - private enum Keys { - static let align: JSString = "align" - static let bgColor: JSString = "bgColor" - static let cells: JSString = "cells" - static let ch: JSString = "ch" - static let chOff: JSString = "chOff" - static let deleteCell: JSString = "deleteCell" - static let insertCell: JSString = "insertCell" - static let rowIndex: JSString = "rowIndex" - static let sectionRowIndex: JSString = "sectionRowIndex" - static let vAlign: JSString = "vAlign" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _rowIndex = ReadonlyAttribute(jsObject: jsObject, name: Keys.rowIndex) - _sectionRowIndex = ReadonlyAttribute(jsObject: jsObject, name: Keys.sectionRowIndex) - _cells = ReadonlyAttribute(jsObject: jsObject, name: Keys.cells) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _ch = ReadWriteAttribute(jsObject: jsObject, name: Keys.ch) - _chOff = ReadWriteAttribute(jsObject: jsObject, name: Keys.chOff) - _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Keys.vAlign) - _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Keys.bgColor) + _rowIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.rowIndex) + _sectionRowIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.sectionRowIndex) + _cells = ReadonlyAttribute(jsObject: jsObject, name: Strings.cells) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _ch = ReadWriteAttribute(jsObject: jsObject, name: Strings.ch) + _chOff = ReadWriteAttribute(jsObject: jsObject, name: Strings.chOff) + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Strings.vAlign) + _bgColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.bgColor) super.init(unsafelyWrapping: jsObject) } @@ -45,11 +32,11 @@ public class HTMLTableRowElement: HTMLElement { public var cells: HTMLCollection public func insertCell(index: Int32? = nil) -> HTMLTableCellElement { - jsObject[Keys.insertCell]!(index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.insertCell]!(index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteCell(index: Int32) { - _ = jsObject[Keys.deleteCell]!(index.jsValue()) + _ = jsObject[Strings.deleteCell]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift index 4fe06c07..fa504b12 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -6,22 +6,12 @@ import JavaScriptKit public class HTMLTableSectionElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTableSectionElement.function! } - private enum Keys { - static let align: JSString = "align" - static let ch: JSString = "ch" - static let chOff: JSString = "chOff" - static let deleteRow: JSString = "deleteRow" - static let insertRow: JSString = "insertRow" - static let rows: JSString = "rows" - static let vAlign: JSString = "vAlign" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _rows = ReadonlyAttribute(jsObject: jsObject, name: Keys.rows) - _align = ReadWriteAttribute(jsObject: jsObject, name: Keys.align) - _ch = ReadWriteAttribute(jsObject: jsObject, name: Keys.ch) - _chOff = ReadWriteAttribute(jsObject: jsObject, name: Keys.chOff) - _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Keys.vAlign) + _rows = ReadonlyAttribute(jsObject: jsObject, name: Strings.rows) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _ch = ReadWriteAttribute(jsObject: jsObject, name: Strings.ch) + _chOff = ReadWriteAttribute(jsObject: jsObject, name: Strings.chOff) + _vAlign = ReadWriteAttribute(jsObject: jsObject, name: Strings.vAlign) super.init(unsafelyWrapping: jsObject) } @@ -33,11 +23,11 @@ public class HTMLTableSectionElement: HTMLElement { public var rows: HTMLCollection public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { - jsObject[Keys.insertRow]!(index?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.insertRow]!(index?.jsValue() ?? .undefined).fromJSValue()! } public func deleteRow(index: Int32) { - _ = jsObject[Keys.deleteRow]!(index.jsValue()) + _ = jsObject[Strings.deleteRow]!(index.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift index 84747a57..75a21a74 100644 --- a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLTemplateElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTemplateElement.function! } - private enum Keys { - static let content: JSString = "content" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _content = ReadonlyAttribute(jsObject: jsObject, name: Keys.content) + _content = ReadonlyAttribute(jsObject: jsObject, name: Strings.content) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift index af3cb5f9..3243262b 100644 --- a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -6,64 +6,31 @@ import JavaScriptKit public class HTMLTextAreaElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTextAreaElement.function! } - private enum Keys { - static let autocomplete: JSString = "autocomplete" - static let checkValidity: JSString = "checkValidity" - static let cols: JSString = "cols" - static let defaultValue: JSString = "defaultValue" - static let dirName: JSString = "dirName" - static let disabled: JSString = "disabled" - static let form: JSString = "form" - static let labels: JSString = "labels" - static let maxLength: JSString = "maxLength" - static let minLength: JSString = "minLength" - static let name: JSString = "name" - static let placeholder: JSString = "placeholder" - static let readOnly: JSString = "readOnly" - static let reportValidity: JSString = "reportValidity" - static let required: JSString = "required" - static let rows: JSString = "rows" - static let select: JSString = "select" - static let selectionDirection: JSString = "selectionDirection" - static let selectionEnd: JSString = "selectionEnd" - static let selectionStart: JSString = "selectionStart" - static let setCustomValidity: JSString = "setCustomValidity" - static let setRangeText: JSString = "setRangeText" - static let setSelectionRange: JSString = "setSelectionRange" - static let textLength: JSString = "textLength" - static let type: JSString = "type" - static let validationMessage: JSString = "validationMessage" - static let validity: JSString = "validity" - static let value: JSString = "value" - static let willValidate: JSString = "willValidate" - static let wrap: JSString = "wrap" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Keys.autocomplete) - _cols = ReadWriteAttribute(jsObject: jsObject, name: Keys.cols) - _dirName = ReadWriteAttribute(jsObject: jsObject, name: Keys.dirName) - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) - _form = ReadonlyAttribute(jsObject: jsObject, name: Keys.form) - _maxLength = ReadWriteAttribute(jsObject: jsObject, name: Keys.maxLength) - _minLength = ReadWriteAttribute(jsObject: jsObject, name: Keys.minLength) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _placeholder = ReadWriteAttribute(jsObject: jsObject, name: Keys.placeholder) - _readOnly = ReadWriteAttribute(jsObject: jsObject, name: Keys.readOnly) - _required = ReadWriteAttribute(jsObject: jsObject, name: Keys.required) - _rows = ReadWriteAttribute(jsObject: jsObject, name: Keys.rows) - _wrap = ReadWriteAttribute(jsObject: jsObject, name: Keys.wrap) - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) - _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.defaultValue) - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) - _textLength = ReadonlyAttribute(jsObject: jsObject, name: Keys.textLength) - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Keys.willValidate) - _validity = ReadonlyAttribute(jsObject: jsObject, name: Keys.validity) - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Keys.validationMessage) - _labels = ReadonlyAttribute(jsObject: jsObject, name: Keys.labels) - _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionStart) - _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionEnd) - _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: Keys.selectionDirection) + _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) + _cols = ReadWriteAttribute(jsObject: jsObject, name: Strings.cols) + _dirName = ReadWriteAttribute(jsObject: jsObject, name: Strings.dirName) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _maxLength = ReadWriteAttribute(jsObject: jsObject, name: Strings.maxLength) + _minLength = ReadWriteAttribute(jsObject: jsObject, name: Strings.minLength) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _placeholder = ReadWriteAttribute(jsObject: jsObject, name: Strings.placeholder) + _readOnly = ReadWriteAttribute(jsObject: jsObject, name: Strings.readOnly) + _required = ReadWriteAttribute(jsObject: jsObject, name: Strings.required) + _rows = ReadWriteAttribute(jsObject: jsObject, name: Strings.rows) + _wrap = ReadWriteAttribute(jsObject: jsObject, name: Strings.wrap) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _defaultValue = ReadWriteAttribute(jsObject: jsObject, name: Strings.defaultValue) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _textLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.textLength) + _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) + _selectionStart = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectionStart) + _selectionEnd = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectionEnd) + _selectionDirection = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectionDirection) super.init(unsafelyWrapping: jsObject) } @@ -132,22 +99,22 @@ public class HTMLTextAreaElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Keys.checkValidity]!().fromJSValue()! + jsObject[Strings.checkValidity]!().fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Keys.reportValidity]!().fromJSValue()! + jsObject[Strings.reportValidity]!().fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Keys.setCustomValidity]!(error.jsValue()) + _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) } @ReadonlyAttribute public var labels: NodeList public func select() { - _ = jsObject[Keys.select]!() + _ = jsObject[Strings.select]!() } @ReadWriteAttribute @@ -160,14 +127,14 @@ public class HTMLTextAreaElement: HTMLElement { public var selectionDirection: String public func setRangeText(replacement: String) { - _ = jsObject[Keys.setRangeText]!(replacement.jsValue()) + _ = jsObject[Strings.setRangeText]!(replacement.jsValue()) } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - _ = jsObject[Keys.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + _ = jsObject[Strings.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - _ = jsObject[Keys.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + _ = jsObject[Strings.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift index 60d1e797..3d81a58d 100644 --- a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLTimeElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTimeElement.function! } - private enum Keys { - static let dateTime: JSString = "dateTime" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _dateTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.dateTime) + _dateTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.dateTime) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift index c050bcf4..5a40692b 100644 --- a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class HTMLTitleElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTitleElement.function! } - private enum Keys { - static let text: JSString = "text" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _text = ReadWriteAttribute(jsObject: jsObject, name: Keys.text) + _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift index c468cd84..8c185931 100644 --- a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift @@ -6,28 +6,14 @@ import JavaScriptKit public class HTMLTrackElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLTrackElement.function! } - private enum Keys { - static let ERROR: JSString = "ERROR" - static let LOADED: JSString = "LOADED" - static let LOADING: JSString = "LOADING" - static let NONE: JSString = "NONE" - static let `default`: JSString = "default" - static let kind: JSString = "kind" - static let label: JSString = "label" - static let readyState: JSString = "readyState" - static let src: JSString = "src" - static let srclang: JSString = "srclang" - static let track: JSString = "track" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _kind = ReadWriteAttribute(jsObject: jsObject, name: Keys.kind) - _src = ReadWriteAttribute(jsObject: jsObject, name: Keys.src) - _srclang = ReadWriteAttribute(jsObject: jsObject, name: Keys.srclang) - _label = ReadWriteAttribute(jsObject: jsObject, name: Keys.label) - _default = ReadWriteAttribute(jsObject: jsObject, name: Keys.default) - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) - _track = ReadonlyAttribute(jsObject: jsObject, name: Keys.track) + _kind = ReadWriteAttribute(jsObject: jsObject, name: Strings.kind) + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _srclang = ReadWriteAttribute(jsObject: jsObject, name: Strings.srclang) + _label = ReadWriteAttribute(jsObject: jsObject, name: Strings.label) + _default = ReadWriteAttribute(jsObject: jsObject, name: Strings.default) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLUListElement.swift b/Sources/DOMKit/WebIDL/HTMLUListElement.swift index 7fc292a1..d02107c7 100644 --- a/Sources/DOMKit/WebIDL/HTMLUListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUListElement.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class HTMLUListElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLUListElement.function! } - private enum Keys { - static let compact: JSString = "compact" - static let type: JSString = "type" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _compact = ReadWriteAttribute(jsObject: jsObject, name: Keys.compact) - _type = ReadWriteAttribute(jsObject: jsObject, name: Keys.type) + _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift index b5315c98..fd3cfcd9 100644 --- a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class HTMLUnknownElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global.HTMLUnknownElement.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 17d02cbd..14bb3df0 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -6,22 +6,13 @@ import JavaScriptKit public class HTMLVideoElement: HTMLMediaElement { override public class var constructor: JSFunction { JSObject.global.HTMLVideoElement.function! } - private enum Keys { - static let height: JSString = "height" - static let playsInline: JSString = "playsInline" - static let poster: JSString = "poster" - static let videoHeight: JSString = "videoHeight" - static let videoWidth: JSString = "videoWidth" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) - _videoWidth = ReadonlyAttribute(jsObject: jsObject, name: Keys.videoWidth) - _videoHeight = ReadonlyAttribute(jsObject: jsObject, name: Keys.videoHeight) - _poster = ReadWriteAttribute(jsObject: jsObject, name: Keys.poster) - _playsInline = ReadWriteAttribute(jsObject: jsObject, name: Keys.playsInline) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _videoWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoWidth) + _videoHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoHeight) + _poster = ReadWriteAttribute(jsObject: jsObject, name: Strings.poster) + _playsInline = ReadWriteAttribute(jsObject: jsObject, name: Strings.playsInline) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HashChangeEvent.swift b/Sources/DOMKit/WebIDL/HashChangeEvent.swift index 32d4ec3d..7c76751d 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEvent.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class HashChangeEvent: Event { override public class var constructor: JSFunction { JSObject.global.HashChangeEvent.function! } - private enum Keys { - static let newURL: JSString = "newURL" - static let oldURL: JSString = "oldURL" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _oldURL = ReadonlyAttribute(jsObject: jsObject, name: Keys.oldURL) - _newURL = ReadonlyAttribute(jsObject: jsObject, name: Keys.newURL) + _oldURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldURL) + _newURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.newURL) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift index 8514b462..bc312d23 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift @@ -4,21 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class HashChangeEventInit: BridgedDictionary { - private enum Keys { - static let newURL: JSString = "newURL" - static let oldURL: JSString = "oldURL" - } - public convenience init(oldURL: String, newURL: String) { let object = JSObject.global.Object.function!.new() - object[Keys.oldURL] = oldURL.jsValue() - object[Keys.newURL] = newURL.jsValue() + object[Strings.oldURL] = oldURL.jsValue() + object[Strings.newURL] = newURL.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _oldURL = ReadWriteAttribute(jsObject: object, name: Keys.oldURL) - _newURL = ReadWriteAttribute(jsObject: object, name: Keys.newURL) + _oldURL = ReadWriteAttribute(jsObject: object, name: Strings.oldURL) + _newURL = ReadWriteAttribute(jsObject: object, name: Strings.newURL) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift index 54d72cf3..03913300 100644 --- a/Sources/DOMKit/WebIDL/Headers.swift +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -6,14 +6,6 @@ import JavaScriptKit public class Headers: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.Headers.function! } - private enum Keys { - static let append: JSString = "append" - static let delete: JSString = "delete" - static let get: JSString = "get" - static let has: JSString = "has" - static let set: JSString = "set" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -25,23 +17,23 @@ public class Headers: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - _ = jsObject[Keys.append]!(name.jsValue(), value.jsValue()) + _ = jsObject[Strings.append]!(name.jsValue(), value.jsValue()) } public func delete(name: String) { - _ = jsObject[Keys.delete]!(name.jsValue()) + _ = jsObject[Strings.delete]!(name.jsValue()) } public func get(name: String) -> String? { - jsObject[Keys.get]!(name.jsValue()).fromJSValue()! + jsObject[Strings.get]!(name.jsValue()).fromJSValue()! } public func has(name: String) -> Bool { - jsObject[Keys.has]!(name.jsValue()).fromJSValue()! + jsObject[Strings.has]!(name.jsValue()).fromJSValue()! } public func set(name: String, value: String) { - _ = jsObject[Keys.set]!(name.jsValue(), value.jsValue()) + _ = jsObject[Strings.set]!(name.jsValue(), value.jsValue()) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/History.swift b/Sources/DOMKit/WebIDL/History.swift index c233b1dd..99719524 100644 --- a/Sources/DOMKit/WebIDL/History.swift +++ b/Sources/DOMKit/WebIDL/History.swift @@ -6,23 +6,12 @@ import JavaScriptKit public class History: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.History.function! } - private enum Keys { - static let back: JSString = "back" - static let forward: JSString = "forward" - static let go: JSString = "go" - static let length: JSString = "length" - static let pushState: JSString = "pushState" - static let replaceState: JSString = "replaceState" - static let scrollRestoration: JSString = "scrollRestoration" - static let state: JSString = "state" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) - _scrollRestoration = ReadWriteAttribute(jsObject: jsObject, name: Keys.scrollRestoration) - _state = ReadonlyAttribute(jsObject: jsObject, name: Keys.state) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _scrollRestoration = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollRestoration) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) self.jsObject = jsObject } @@ -36,22 +25,22 @@ public class History: JSBridgedClass { public var state: JSValue public func go(delta: Int32? = nil) { - _ = jsObject[Keys.go]!(delta?.jsValue() ?? .undefined) + _ = jsObject[Strings.go]!(delta?.jsValue() ?? .undefined) } public func back() { - _ = jsObject[Keys.back]!() + _ = jsObject[Strings.back]!() } public func forward() { - _ = jsObject[Keys.forward]!() + _ = jsObject[Strings.forward]!() } public func pushState(data: JSValue, unused: String, url: String? = nil) { - _ = jsObject[Keys.pushState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + _ = jsObject[Strings.pushState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) } public func replaceState(data: JSValue, unused: String, url: String? = nil) { - _ = jsObject[Keys.replaceState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + _ = jsObject[Strings.replaceState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmap.swift b/Sources/DOMKit/WebIDL/ImageBitmap.swift index 0e0c6ff7..3f38248f 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmap.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmap.swift @@ -6,17 +6,11 @@ import JavaScriptKit public class ImageBitmap: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ImageBitmap.function! } - private enum Keys { - static let close: JSString = "close" - static let height: JSString = "height" - static let width: JSString = "width" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Keys.height) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) self.jsObject = jsObject } @@ -27,6 +21,6 @@ public class ImageBitmap: JSBridgedClass { public var height: UInt32 public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift index 97b36262..453eb0b2 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift @@ -4,33 +4,24 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageBitmapOptions: BridgedDictionary { - private enum Keys { - static let colorSpaceConversion: JSString = "colorSpaceConversion" - static let imageOrientation: JSString = "imageOrientation" - static let premultiplyAlpha: JSString = "premultiplyAlpha" - static let resizeHeight: JSString = "resizeHeight" - static let resizeQuality: JSString = "resizeQuality" - static let resizeWidth: JSString = "resizeWidth" - } - public convenience init(imageOrientation: ImageOrientation, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, resizeWidth: UInt32, resizeHeight: UInt32, resizeQuality: ResizeQuality) { let object = JSObject.global.Object.function!.new() - object[Keys.imageOrientation] = imageOrientation.jsValue() - object[Keys.premultiplyAlpha] = premultiplyAlpha.jsValue() - object[Keys.colorSpaceConversion] = colorSpaceConversion.jsValue() - object[Keys.resizeWidth] = resizeWidth.jsValue() - object[Keys.resizeHeight] = resizeHeight.jsValue() - object[Keys.resizeQuality] = resizeQuality.jsValue() + object[Strings.imageOrientation] = imageOrientation.jsValue() + object[Strings.premultiplyAlpha] = premultiplyAlpha.jsValue() + object[Strings.colorSpaceConversion] = colorSpaceConversion.jsValue() + object[Strings.resizeWidth] = resizeWidth.jsValue() + object[Strings.resizeHeight] = resizeHeight.jsValue() + object[Strings.resizeQuality] = resizeQuality.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _imageOrientation = ReadWriteAttribute(jsObject: object, name: Keys.imageOrientation) - _premultiplyAlpha = ReadWriteAttribute(jsObject: object, name: Keys.premultiplyAlpha) - _colorSpaceConversion = ReadWriteAttribute(jsObject: object, name: Keys.colorSpaceConversion) - _resizeWidth = ReadWriteAttribute(jsObject: object, name: Keys.resizeWidth) - _resizeHeight = ReadWriteAttribute(jsObject: object, name: Keys.resizeHeight) - _resizeQuality = ReadWriteAttribute(jsObject: object, name: Keys.resizeQuality) + _imageOrientation = ReadWriteAttribute(jsObject: object, name: Strings.imageOrientation) + _premultiplyAlpha = ReadWriteAttribute(jsObject: object, name: Strings.premultiplyAlpha) + _colorSpaceConversion = ReadWriteAttribute(jsObject: object, name: Strings.colorSpaceConversion) + _resizeWidth = ReadWriteAttribute(jsObject: object, name: Strings.resizeWidth) + _resizeHeight = ReadWriteAttribute(jsObject: object, name: Strings.resizeHeight) + _resizeQuality = ReadWriteAttribute(jsObject: object, name: Strings.resizeQuality) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift index 7f7114b8..6cbe889c 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class ImageBitmapRenderingContext: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ImageBitmapRenderingContext.function! } - private enum Keys { - static let canvas: JSString = "canvas" - static let transferFromImageBitmap: JSString = "transferFromImageBitmap" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _canvas = ReadonlyAttribute(jsObject: jsObject, name: Keys.canvas) + _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) self.jsObject = jsObject } @@ -22,6 +17,6 @@ public class ImageBitmapRenderingContext: JSBridgedClass { public var canvas: __UNSUPPORTED_UNION__ public func transferFromImageBitmap(bitmap: ImageBitmap?) { - _ = jsObject[Keys.transferFromImageBitmap]!(bitmap.jsValue()) + _ = jsObject[Strings.transferFromImageBitmap]!(bitmap.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift index 47c851fa..db66e2da 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageBitmapRenderingContextSettings: BridgedDictionary { - private enum Keys { - static let alpha: JSString = "alpha" - } - public convenience init(alpha: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.alpha] = alpha.jsValue() + object[Strings.alpha] = alpha.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Keys.alpha) + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageData.swift b/Sources/DOMKit/WebIDL/ImageData.swift index 61d378a9..1731081e 100644 --- a/Sources/DOMKit/WebIDL/ImageData.swift +++ b/Sources/DOMKit/WebIDL/ImageData.swift @@ -6,20 +6,13 @@ import JavaScriptKit public class ImageData: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ImageData.function! } - private enum Keys { - static let colorSpace: JSString = "colorSpace" - static let data: JSString = "data" - static let height: JSString = "height" - static let width: JSString = "width" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Keys.height) - _data = ReadonlyAttribute(jsObject: jsObject, name: Keys.data) - _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: Keys.colorSpace) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorSpace) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/ImageDataSettings.swift b/Sources/DOMKit/WebIDL/ImageDataSettings.swift index 180054b1..0ad4cc85 100644 --- a/Sources/DOMKit/WebIDL/ImageDataSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageDataSettings.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageDataSettings: BridgedDictionary { - private enum Keys { - static let colorSpace: JSString = "colorSpace" - } - public convenience init(colorSpace: PredefinedColorSpace) { let object = JSObject.global.Object.function!.new() - object[Keys.colorSpace] = colorSpace.jsValue() + object[Strings.colorSpace] = colorSpace.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _colorSpace = ReadWriteAttribute(jsObject: object, name: Keys.colorSpace) + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift index 08aeed6b..d33cf5a5 100644 --- a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift @@ -4,21 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageEncodeOptions: BridgedDictionary { - private enum Keys { - static let quality: JSString = "quality" - static let type: JSString = "type" - } - public convenience init(type: String, quality: Double) { let object = JSObject.global.Object.function!.new() - object[Keys.type] = type.jsValue() - object[Keys.quality] = quality.jsValue() + object[Strings.type] = type.jsValue() + object[Strings.quality] = quality.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Keys.type) - _quality = ReadWriteAttribute(jsObject: object, name: Keys.quality) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _quality = ReadWriteAttribute(jsObject: object, name: Strings.quality) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index d590febd..a6651413 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class InputEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.InputEvent.function! } - private enum Keys { - static let data: JSString = "data" - static let inputType: JSString = "inputType" - static let isComposing: JSString = "isComposing" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Keys.data) - _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Keys.isComposing) - _inputType = ReadonlyAttribute(jsObject: jsObject, name: Keys.inputType) + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Strings.isComposing) + _inputType = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputType) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift index c643d394..5bf9ac58 100644 --- a/Sources/DOMKit/WebIDL/InputEventInit.swift +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -4,24 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class InputEventInit: BridgedDictionary { - private enum Keys { - static let data: JSString = "data" - static let inputType: JSString = "inputType" - static let isComposing: JSString = "isComposing" - } - public convenience init(data: String?, isComposing: Bool, inputType: String) { let object = JSObject.global.Object.function!.new() - object[Keys.data] = data.jsValue() - object[Keys.isComposing] = isComposing.jsValue() - object[Keys.inputType] = inputType.jsValue() + object[Strings.data] = data.jsValue() + object[Strings.isComposing] = isComposing.jsValue() + object[Strings.inputType] = inputType.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _data = ReadWriteAttribute(jsObject: object, name: Keys.data) - _isComposing = ReadWriteAttribute(jsObject: object, name: Keys.isComposing) - _inputType = ReadWriteAttribute(jsObject: object, name: Keys.inputType) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + _isComposing = ReadWriteAttribute(jsObject: object, name: Strings.isComposing) + _inputType = ReadWriteAttribute(jsObject: object, name: Strings.inputType) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index a3de1cda..2096ceb6 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -6,38 +6,18 @@ import JavaScriptKit public class KeyboardEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.KeyboardEvent.function! } - private enum Keys { - static let DOM_KEY_LOCATION_LEFT: JSString = "DOM_KEY_LOCATION_LEFT" - static let DOM_KEY_LOCATION_NUMPAD: JSString = "DOM_KEY_LOCATION_NUMPAD" - static let DOM_KEY_LOCATION_RIGHT: JSString = "DOM_KEY_LOCATION_RIGHT" - static let DOM_KEY_LOCATION_STANDARD: JSString = "DOM_KEY_LOCATION_STANDARD" - static let altKey: JSString = "altKey" - static let charCode: JSString = "charCode" - static let code: JSString = "code" - static let ctrlKey: JSString = "ctrlKey" - static let getModifierState: JSString = "getModifierState" - static let initKeyboardEvent: JSString = "initKeyboardEvent" - static let isComposing: JSString = "isComposing" - static let key: JSString = "key" - static let keyCode: JSString = "keyCode" - static let location: JSString = "location" - static let metaKey: JSString = "metaKey" - static let `repeat`: JSString = "repeat" - static let shiftKey: JSString = "shiftKey" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _key = ReadonlyAttribute(jsObject: jsObject, name: Keys.key) - _code = ReadonlyAttribute(jsObject: jsObject, name: Keys.code) - _location = ReadonlyAttribute(jsObject: jsObject, name: Keys.location) - _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.ctrlKey) - _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.shiftKey) - _altKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.altKey) - _metaKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.metaKey) - _repeat = ReadonlyAttribute(jsObject: jsObject, name: Keys.repeat) - _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Keys.isComposing) - _charCode = ReadonlyAttribute(jsObject: jsObject, name: Keys.charCode) - _keyCode = ReadonlyAttribute(jsObject: jsObject, name: Keys.keyCode) + _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) + _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) + _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) + _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.ctrlKey) + _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.shiftKey) + _altKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.altKey) + _metaKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.metaKey) + _repeat = ReadonlyAttribute(jsObject: jsObject, name: Strings.repeat) + _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Strings.isComposing) + _charCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.charCode) + _keyCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyCode) super.init(unsafelyWrapping: jsObject) } @@ -81,7 +61,7 @@ public class KeyboardEvent: UIEvent { public var isComposing: Bool public func getModifierState(keyArg: String) -> Bool { - jsObject[Keys.getModifierState]!(keyArg.jsValue()).fromJSValue()! + jsObject[Strings.getModifierState]!(keyArg.jsValue()).fromJSValue()! } public func initKeyboardEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, keyArg: String? = nil, locationArg: UInt32? = nil, ctrlKey: Bool? = nil, altKey: Bool? = nil, shiftKey: Bool? = nil, metaKey: Bool? = nil) { @@ -95,7 +75,7 @@ public class KeyboardEvent: UIEvent { let _arg7 = altKey?.jsValue() ?? .undefined let _arg8 = shiftKey?.jsValue() ?? .undefined let _arg9 = metaKey?.jsValue() ?? .undefined - _ = jsObject[Keys.initKeyboardEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + _ = jsObject[Strings.initKeyboardEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift index adac9658..2d1e3d25 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift @@ -4,36 +4,26 @@ import JavaScriptEventLoop import JavaScriptKit public class KeyboardEventInit: BridgedDictionary { - private enum Keys { - static let charCode: JSString = "charCode" - static let code: JSString = "code" - static let isComposing: JSString = "isComposing" - static let key: JSString = "key" - static let keyCode: JSString = "keyCode" - static let location: JSString = "location" - static let `repeat`: JSString = "repeat" - } - public convenience init(key: String, code: String, location: UInt32, repeat: Bool, isComposing: Bool, charCode: UInt32, keyCode: UInt32) { let object = JSObject.global.Object.function!.new() - object[Keys.key] = key.jsValue() - object[Keys.code] = code.jsValue() - object[Keys.location] = location.jsValue() - object[Keys.repeat] = `repeat`.jsValue() - object[Keys.isComposing] = isComposing.jsValue() - object[Keys.charCode] = charCode.jsValue() - object[Keys.keyCode] = keyCode.jsValue() + object[Strings.key] = key.jsValue() + object[Strings.code] = code.jsValue() + object[Strings.location] = location.jsValue() + object[Strings.repeat] = `repeat`.jsValue() + object[Strings.isComposing] = isComposing.jsValue() + object[Strings.charCode] = charCode.jsValue() + object[Strings.keyCode] = keyCode.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _key = ReadWriteAttribute(jsObject: object, name: Keys.key) - _code = ReadWriteAttribute(jsObject: object, name: Keys.code) - _location = ReadWriteAttribute(jsObject: object, name: Keys.location) - _repeat = ReadWriteAttribute(jsObject: object, name: Keys.repeat) - _isComposing = ReadWriteAttribute(jsObject: object, name: Keys.isComposing) - _charCode = ReadWriteAttribute(jsObject: object, name: Keys.charCode) - _keyCode = ReadWriteAttribute(jsObject: object, name: Keys.keyCode) + _key = ReadWriteAttribute(jsObject: object, name: Strings.key) + _code = ReadWriteAttribute(jsObject: object, name: Strings.code) + _location = ReadWriteAttribute(jsObject: object, name: Strings.location) + _repeat = ReadWriteAttribute(jsObject: object, name: Strings.repeat) + _isComposing = ReadWriteAttribute(jsObject: object, name: Strings.isComposing) + _charCode = ReadWriteAttribute(jsObject: object, name: Strings.charCode) + _keyCode = ReadWriteAttribute(jsObject: object, name: Strings.keyCode) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/LinkStyle.swift b/Sources/DOMKit/WebIDL/LinkStyle.swift index 4228b88a..19330183 100644 --- a/Sources/DOMKit/WebIDL/LinkStyle.swift +++ b/Sources/DOMKit/WebIDL/LinkStyle.swift @@ -3,11 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let sheet: JSString = "sheet" -} - public protocol LinkStyle: JSBridgedClass {} public extension LinkStyle { - var sheet: CSSStyleSheet? { ReadonlyAttribute[Keys.sheet, in: jsObject] } + var sheet: CSSStyleSheet? { ReadonlyAttribute[Strings.sheet, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Location.swift b/Sources/DOMKit/WebIDL/Location.swift index baea9170..5697cdb2 100644 --- a/Sources/DOMKit/WebIDL/Location.swift +++ b/Sources/DOMKit/WebIDL/Location.swift @@ -6,35 +6,19 @@ import JavaScriptKit public class Location: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Location.function! } - private enum Keys { - static let ancestorOrigins: JSString = "ancestorOrigins" - static let assign: JSString = "assign" - static let hash: JSString = "hash" - static let host: JSString = "host" - static let hostname: JSString = "hostname" - static let href: JSString = "href" - static let origin: JSString = "origin" - static let pathname: JSString = "pathname" - static let port: JSString = "port" - static let `protocol`: JSString = "protocol" - static let reload: JSString = "reload" - static let replace: JSString = "replace" - static let search: JSString = "search" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadWriteAttribute(jsObject: jsObject, name: Keys.href) - _origin = ReadonlyAttribute(jsObject: jsObject, name: Keys.origin) - _protocol = ReadWriteAttribute(jsObject: jsObject, name: Keys.protocol) - _host = ReadWriteAttribute(jsObject: jsObject, name: Keys.host) - _hostname = ReadWriteAttribute(jsObject: jsObject, name: Keys.hostname) - _port = ReadWriteAttribute(jsObject: jsObject, name: Keys.port) - _pathname = ReadWriteAttribute(jsObject: jsObject, name: Keys.pathname) - _search = ReadWriteAttribute(jsObject: jsObject, name: Keys.search) - _hash = ReadWriteAttribute(jsObject: jsObject, name: Keys.hash) - _ancestorOrigins = ReadonlyAttribute(jsObject: jsObject, name: Keys.ancestorOrigins) + _href = ReadWriteAttribute(jsObject: jsObject, name: Strings.href) + _origin = ReadonlyAttribute(jsObject: jsObject, name: Strings.origin) + _protocol = ReadWriteAttribute(jsObject: jsObject, name: Strings.protocol) + _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) + _hash = ReadWriteAttribute(jsObject: jsObject, name: Strings.hash) + _ancestorOrigins = ReadonlyAttribute(jsObject: jsObject, name: Strings.ancestorOrigins) self.jsObject = jsObject } @@ -66,15 +50,15 @@ public class Location: JSBridgedClass { public var hash: String public func assign(url: String) { - _ = jsObject[Keys.assign]!(url.jsValue()) + _ = jsObject[Strings.assign]!(url.jsValue()) } public func replace(url: String) { - _ = jsObject[Keys.replace]!(url.jsValue()) + _ = jsObject[Strings.replace]!(url.jsValue()) } public func reload() { - _ = jsObject[Keys.reload]!() + _ = jsObject[Strings.reload]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaError.swift b/Sources/DOMKit/WebIDL/MediaError.swift index 58177682..39024ff6 100644 --- a/Sources/DOMKit/WebIDL/MediaError.swift +++ b/Sources/DOMKit/WebIDL/MediaError.swift @@ -6,20 +6,11 @@ import JavaScriptKit public class MediaError: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MediaError.function! } - private enum Keys { - static let MEDIA_ERR_ABORTED: JSString = "MEDIA_ERR_ABORTED" - static let MEDIA_ERR_DECODE: JSString = "MEDIA_ERR_DECODE" - static let MEDIA_ERR_NETWORK: JSString = "MEDIA_ERR_NETWORK" - static let MEDIA_ERR_SRC_NOT_SUPPORTED: JSString = "MEDIA_ERR_SRC_NOT_SUPPORTED" - static let code: JSString = "code" - static let message: JSString = "message" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _code = ReadonlyAttribute(jsObject: jsObject, name: Keys.code) - _message = ReadonlyAttribute(jsObject: jsObject, name: Keys.message) + _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift index e1c051e3..f41f5bd5 100644 --- a/Sources/DOMKit/WebIDL/MediaList.swift +++ b/Sources/DOMKit/WebIDL/MediaList.swift @@ -6,19 +6,11 @@ import JavaScriptKit public class MediaList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MediaList.function! } - private enum Keys { - static let appendMedium: JSString = "appendMedium" - static let deleteMedium: JSString = "deleteMedium" - static let item: JSString = "item" - static let length: JSString = "length" - static let mediaText: JSString = "mediaText" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _mediaText = ReadWriteAttribute(jsObject: jsObject, name: Keys.mediaText) - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _mediaText = ReadWriteAttribute(jsObject: jsObject, name: Strings.mediaText) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } @@ -33,10 +25,10 @@ public class MediaList: JSBridgedClass { } public func appendMedium(medium: String) { - _ = jsObject[Keys.appendMedium]!(medium.jsValue()) + _ = jsObject[Strings.appendMedium]!(medium.jsValue()) } public func deleteMedium(medium: String) { - _ = jsObject[Keys.deleteMedium]!(medium.jsValue()) + _ = jsObject[Strings.deleteMedium]!(medium.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/MessageChannel.swift b/Sources/DOMKit/WebIDL/MessageChannel.swift index 2688b7a3..fc5f5e4a 100644 --- a/Sources/DOMKit/WebIDL/MessageChannel.swift +++ b/Sources/DOMKit/WebIDL/MessageChannel.swift @@ -6,16 +6,11 @@ import JavaScriptKit public class MessageChannel: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MessageChannel.function! } - private enum Keys { - static let port1: JSString = "port1" - static let port2: JSString = "port2" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _port1 = ReadonlyAttribute(jsObject: jsObject, name: Keys.port1) - _port2 = ReadonlyAttribute(jsObject: jsObject, name: Keys.port2) + _port1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.port1) + _port2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.port2) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift index 0492a558..7ef0748f 100644 --- a/Sources/DOMKit/WebIDL/MessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -6,21 +6,12 @@ import JavaScriptKit public class MessageEvent: Event { override public class var constructor: JSFunction { JSObject.global.MessageEvent.function! } - private enum Keys { - static let data: JSString = "data" - static let initMessageEvent: JSString = "initMessageEvent" - static let lastEventId: JSString = "lastEventId" - static let origin: JSString = "origin" - static let ports: JSString = "ports" - static let source: JSString = "source" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Keys.data) - _origin = ReadonlyAttribute(jsObject: jsObject, name: Keys.origin) - _lastEventId = ReadonlyAttribute(jsObject: jsObject, name: Keys.lastEventId) - _source = ReadonlyAttribute(jsObject: jsObject, name: Keys.source) - _ports = ReadonlyAttribute(jsObject: jsObject, name: Keys.ports) + _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) } @@ -52,6 +43,6 @@ public class MessageEvent: Event { let _arg5 = lastEventId?.jsValue() ?? .undefined let _arg6 = source?.jsValue() ?? .undefined let _arg7 = ports?.jsValue() ?? .undefined - _ = jsObject[Keys.initMessageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + _ = jsObject[Strings.initMessageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/MessageEventInit.swift b/Sources/DOMKit/WebIDL/MessageEventInit.swift index 6fc41948..47707951 100644 --- a/Sources/DOMKit/WebIDL/MessageEventInit.swift +++ b/Sources/DOMKit/WebIDL/MessageEventInit.swift @@ -4,30 +4,22 @@ import JavaScriptEventLoop import JavaScriptKit public class MessageEventInit: BridgedDictionary { - private enum Keys { - static let data: JSString = "data" - static let lastEventId: JSString = "lastEventId" - static let origin: JSString = "origin" - static let ports: JSString = "ports" - static let source: JSString = "source" - } - public convenience init(data: JSValue, origin: String, lastEventId: String, source: MessageEventSource?, ports: [MessagePort]) { let object = JSObject.global.Object.function!.new() - object[Keys.data] = data.jsValue() - object[Keys.origin] = origin.jsValue() - object[Keys.lastEventId] = lastEventId.jsValue() - object[Keys.source] = source.jsValue() - object[Keys.ports] = ports.jsValue() + 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: Keys.data) - _origin = ReadWriteAttribute(jsObject: object, name: Keys.origin) - _lastEventId = ReadWriteAttribute(jsObject: object, name: Keys.lastEventId) - _source = ReadWriteAttribute(jsObject: object, name: Keys.source) - _ports = ReadWriteAttribute(jsObject: object, name: Keys.ports) + _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) } diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift index 76590e62..98f5bd3b 100644 --- a/Sources/DOMKit/WebIDL/MessagePort.swift +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -6,34 +6,26 @@ import JavaScriptKit public class MessagePort: EventTarget { override public class var constructor: JSFunction { JSObject.global.MessagePort.function! } - private enum Keys { - static let close: JSString = "close" - static let onmessage: JSString = "onmessage" - static let onmessageerror: JSString = "onmessageerror" - static let postMessage: JSString = "postMessage" - static let start: JSString = "start" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessageerror) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) + _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } public func start() { - _ = jsObject[Keys.start]!() + _ = jsObject[Strings.start]!() } public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/MimeType.swift b/Sources/DOMKit/WebIDL/MimeType.swift index 6268fc9e..28f25412 100644 --- a/Sources/DOMKit/WebIDL/MimeType.swift +++ b/Sources/DOMKit/WebIDL/MimeType.swift @@ -6,20 +6,13 @@ import JavaScriptKit public class MimeType: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MimeType.function! } - private enum Keys { - static let description: JSString = "description" - static let enabledPlugin: JSString = "enabledPlugin" - static let suffixes: JSString = "suffixes" - static let type: JSString = "type" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) - _description = ReadonlyAttribute(jsObject: jsObject, name: Keys.description) - _suffixes = ReadonlyAttribute(jsObject: jsObject, name: Keys.suffixes) - _enabledPlugin = ReadonlyAttribute(jsObject: jsObject, name: Keys.enabledPlugin) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _description = ReadonlyAttribute(jsObject: jsObject, name: Strings.description) + _suffixes = ReadonlyAttribute(jsObject: jsObject, name: Strings.suffixes) + _enabledPlugin = ReadonlyAttribute(jsObject: jsObject, name: Strings.enabledPlugin) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/MimeTypeArray.swift b/Sources/DOMKit/WebIDL/MimeTypeArray.swift index 47ba8857..25ea90a0 100644 --- a/Sources/DOMKit/WebIDL/MimeTypeArray.swift +++ b/Sources/DOMKit/WebIDL/MimeTypeArray.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class MimeTypeArray: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MimeTypeArray.function! } - private enum Keys { - static let item: JSString = "item" - static let length: JSString = "length" - static let namedItem: JSString = "namedItem" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index b6004e1e..6064c5c3 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -6,34 +6,18 @@ import JavaScriptKit public class MouseEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global.MouseEvent.function! } - private enum Keys { - static let altKey: JSString = "altKey" - static let button: JSString = "button" - static let buttons: JSString = "buttons" - static let clientX: JSString = "clientX" - static let clientY: JSString = "clientY" - static let ctrlKey: JSString = "ctrlKey" - static let getModifierState: JSString = "getModifierState" - static let initMouseEvent: JSString = "initMouseEvent" - static let metaKey: JSString = "metaKey" - static let relatedTarget: JSString = "relatedTarget" - static let screenX: JSString = "screenX" - static let screenY: JSString = "screenY" - static let shiftKey: JSString = "shiftKey" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _screenX = ReadonlyAttribute(jsObject: jsObject, name: Keys.screenX) - _screenY = ReadonlyAttribute(jsObject: jsObject, name: Keys.screenY) - _clientX = ReadonlyAttribute(jsObject: jsObject, name: Keys.clientX) - _clientY = ReadonlyAttribute(jsObject: jsObject, name: Keys.clientY) - _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.ctrlKey) - _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.shiftKey) - _altKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.altKey) - _metaKey = ReadonlyAttribute(jsObject: jsObject, name: Keys.metaKey) - _button = ReadonlyAttribute(jsObject: jsObject, name: Keys.button) - _buttons = ReadonlyAttribute(jsObject: jsObject, name: Keys.buttons) - _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Keys.relatedTarget) + _screenX = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenX) + _screenY = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenY) + _clientX = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientX) + _clientY = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientY) + _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.ctrlKey) + _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.shiftKey) + _altKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.altKey) + _metaKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.metaKey) + _button = ReadonlyAttribute(jsObject: jsObject, name: Strings.button) + _buttons = ReadonlyAttribute(jsObject: jsObject, name: Strings.buttons) + _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedTarget) super.init(unsafelyWrapping: jsObject) } @@ -75,7 +59,7 @@ public class MouseEvent: UIEvent { public var relatedTarget: EventTarget? public func getModifierState(keyArg: String) -> Bool { - jsObject[Keys.getModifierState]!(keyArg.jsValue()).fromJSValue()! + jsObject[Strings.getModifierState]!(keyArg.jsValue()).fromJSValue()! } public func initMouseEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil, screenXArg: Int32? = nil, screenYArg: Int32? = nil, clientXArg: Int32? = nil, clientYArg: Int32? = nil, ctrlKeyArg: Bool? = nil, altKeyArg: Bool? = nil, shiftKeyArg: Bool? = nil, metaKeyArg: Bool? = nil, buttonArg: Int16? = nil, relatedTargetArg: EventTarget? = nil) { @@ -94,6 +78,6 @@ public class MouseEvent: UIEvent { let _arg12 = metaKeyArg?.jsValue() ?? .undefined let _arg13 = buttonArg?.jsValue() ?? .undefined let _arg14 = relatedTargetArg?.jsValue() ?? .undefined - _ = jsObject[Keys.initMouseEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14) + _ = jsObject[Strings.initMouseEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14) } } diff --git a/Sources/DOMKit/WebIDL/MouseEventInit.swift b/Sources/DOMKit/WebIDL/MouseEventInit.swift index 1f0ad297..925934cc 100644 --- a/Sources/DOMKit/WebIDL/MouseEventInit.swift +++ b/Sources/DOMKit/WebIDL/MouseEventInit.swift @@ -4,36 +4,26 @@ import JavaScriptEventLoop import JavaScriptKit public class MouseEventInit: BridgedDictionary { - private enum Keys { - static let button: JSString = "button" - static let buttons: JSString = "buttons" - static let clientX: JSString = "clientX" - static let clientY: JSString = "clientY" - static let relatedTarget: JSString = "relatedTarget" - static let screenX: JSString = "screenX" - static let screenY: JSString = "screenY" - } - public convenience init(screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { let object = JSObject.global.Object.function!.new() - object[Keys.screenX] = screenX.jsValue() - object[Keys.screenY] = screenY.jsValue() - object[Keys.clientX] = clientX.jsValue() - object[Keys.clientY] = clientY.jsValue() - object[Keys.button] = button.jsValue() - object[Keys.buttons] = buttons.jsValue() - object[Keys.relatedTarget] = relatedTarget.jsValue() + object[Strings.screenX] = screenX.jsValue() + object[Strings.screenY] = screenY.jsValue() + object[Strings.clientX] = clientX.jsValue() + object[Strings.clientY] = clientY.jsValue() + object[Strings.button] = button.jsValue() + object[Strings.buttons] = buttons.jsValue() + object[Strings.relatedTarget] = relatedTarget.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _screenX = ReadWriteAttribute(jsObject: object, name: Keys.screenX) - _screenY = ReadWriteAttribute(jsObject: object, name: Keys.screenY) - _clientX = ReadWriteAttribute(jsObject: object, name: Keys.clientX) - _clientY = ReadWriteAttribute(jsObject: object, name: Keys.clientY) - _button = ReadWriteAttribute(jsObject: object, name: Keys.button) - _buttons = ReadWriteAttribute(jsObject: object, name: Keys.buttons) - _relatedTarget = ReadWriteAttribute(jsObject: object, name: Keys.relatedTarget) + _screenX = ReadWriteAttribute(jsObject: object, name: Strings.screenX) + _screenY = ReadWriteAttribute(jsObject: object, name: Strings.screenY) + _clientX = ReadWriteAttribute(jsObject: object, name: Strings.clientX) + _clientY = ReadWriteAttribute(jsObject: object, name: Strings.clientY) + _button = ReadWriteAttribute(jsObject: object, name: Strings.button) + _buttons = ReadWriteAttribute(jsObject: object, name: Strings.buttons) + _relatedTarget = ReadWriteAttribute(jsObject: object, name: Strings.relatedTarget) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift index 7dbcab29..7ed5b139 100644 --- a/Sources/DOMKit/WebIDL/MutationEvent.swift +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -6,24 +6,12 @@ import JavaScriptKit public class MutationEvent: Event { override public class var constructor: JSFunction { JSObject.global.MutationEvent.function! } - private enum Keys { - static let ADDITION: JSString = "ADDITION" - static let MODIFICATION: JSString = "MODIFICATION" - static let REMOVAL: JSString = "REMOVAL" - static let attrChange: JSString = "attrChange" - static let attrName: JSString = "attrName" - static let initMutationEvent: JSString = "initMutationEvent" - static let newValue: JSString = "newValue" - static let prevValue: JSString = "prevValue" - static let relatedNode: JSString = "relatedNode" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _relatedNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.relatedNode) - _prevValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.prevValue) - _newValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.newValue) - _attrName = ReadonlyAttribute(jsObject: jsObject, name: Keys.attrName) - _attrChange = ReadonlyAttribute(jsObject: jsObject, name: Keys.attrChange) + _relatedNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedNode) + _prevValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.prevValue) + _newValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.newValue) + _attrName = ReadonlyAttribute(jsObject: jsObject, name: Strings.attrName) + _attrChange = ReadonlyAttribute(jsObject: jsObject, name: Strings.attrChange) super.init(unsafelyWrapping: jsObject) } @@ -57,6 +45,6 @@ public class MutationEvent: Event { let _arg5 = newValueArg?.jsValue() ?? .undefined let _arg6 = attrNameArg?.jsValue() ?? .undefined let _arg7 = attrChangeArg?.jsValue() ?? .undefined - _ = jsObject[Keys.initMutationEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + _ = jsObject[Strings.initMutationEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/MutationObserver.swift b/Sources/DOMKit/WebIDL/MutationObserver.swift index ca65ec74..8fcc66cf 100644 --- a/Sources/DOMKit/WebIDL/MutationObserver.swift +++ b/Sources/DOMKit/WebIDL/MutationObserver.swift @@ -6,12 +6,6 @@ import JavaScriptKit public class MutationObserver: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MutationObserver.function! } - private enum Keys { - static let disconnect: JSString = "disconnect" - static let observe: JSString = "observe" - static let takeRecords: JSString = "takeRecords" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -21,14 +15,14 @@ public class MutationObserver: JSBridgedClass { // XXX: constructor is ignored public func observe(target: Node, options: MutationObserverInit? = nil) { - _ = jsObject[Keys.observe]!(target.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Strings.observe]!(target.jsValue(), options?.jsValue() ?? .undefined) } public func disconnect() { - _ = jsObject[Keys.disconnect]!() + _ = jsObject[Strings.disconnect]!() } public func takeRecords() -> [MutationRecord] { - jsObject[Keys.takeRecords]!().fromJSValue()! + jsObject[Strings.takeRecords]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MutationObserverInit.swift b/Sources/DOMKit/WebIDL/MutationObserverInit.swift index b10eb10f..6435f166 100644 --- a/Sources/DOMKit/WebIDL/MutationObserverInit.swift +++ b/Sources/DOMKit/WebIDL/MutationObserverInit.swift @@ -4,36 +4,26 @@ import JavaScriptEventLoop import JavaScriptKit public class MutationObserverInit: BridgedDictionary { - private enum Keys { - static let attributeFilter: JSString = "attributeFilter" - static let attributeOldValue: JSString = "attributeOldValue" - static let attributes: JSString = "attributes" - static let characterData: JSString = "characterData" - static let characterDataOldValue: JSString = "characterDataOldValue" - static let childList: JSString = "childList" - static let subtree: JSString = "subtree" - } - public convenience init(childList: Bool, attributes: Bool, characterData: Bool, subtree: Bool, attributeOldValue: Bool, characterDataOldValue: Bool, attributeFilter: [String]) { let object = JSObject.global.Object.function!.new() - object[Keys.childList] = childList.jsValue() - object[Keys.attributes] = attributes.jsValue() - object[Keys.characterData] = characterData.jsValue() - object[Keys.subtree] = subtree.jsValue() - object[Keys.attributeOldValue] = attributeOldValue.jsValue() - object[Keys.characterDataOldValue] = characterDataOldValue.jsValue() - object[Keys.attributeFilter] = attributeFilter.jsValue() + object[Strings.childList] = childList.jsValue() + object[Strings.attributes] = attributes.jsValue() + object[Strings.characterData] = characterData.jsValue() + object[Strings.subtree] = subtree.jsValue() + object[Strings.attributeOldValue] = attributeOldValue.jsValue() + object[Strings.characterDataOldValue] = characterDataOldValue.jsValue() + object[Strings.attributeFilter] = attributeFilter.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _childList = ReadWriteAttribute(jsObject: object, name: Keys.childList) - _attributes = ReadWriteAttribute(jsObject: object, name: Keys.attributes) - _characterData = ReadWriteAttribute(jsObject: object, name: Keys.characterData) - _subtree = ReadWriteAttribute(jsObject: object, name: Keys.subtree) - _attributeOldValue = ReadWriteAttribute(jsObject: object, name: Keys.attributeOldValue) - _characterDataOldValue = ReadWriteAttribute(jsObject: object, name: Keys.characterDataOldValue) - _attributeFilter = ReadWriteAttribute(jsObject: object, name: Keys.attributeFilter) + _childList = ReadWriteAttribute(jsObject: object, name: Strings.childList) + _attributes = ReadWriteAttribute(jsObject: object, name: Strings.attributes) + _characterData = ReadWriteAttribute(jsObject: object, name: Strings.characterData) + _subtree = ReadWriteAttribute(jsObject: object, name: Strings.subtree) + _attributeOldValue = ReadWriteAttribute(jsObject: object, name: Strings.attributeOldValue) + _characterDataOldValue = ReadWriteAttribute(jsObject: object, name: Strings.characterDataOldValue) + _attributeFilter = ReadWriteAttribute(jsObject: object, name: Strings.attributeFilter) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MutationRecord.swift b/Sources/DOMKit/WebIDL/MutationRecord.swift index de3bed85..cc66604a 100644 --- a/Sources/DOMKit/WebIDL/MutationRecord.swift +++ b/Sources/DOMKit/WebIDL/MutationRecord.swift @@ -6,30 +6,18 @@ import JavaScriptKit public class MutationRecord: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.MutationRecord.function! } - private enum Keys { - static let addedNodes: JSString = "addedNodes" - static let attributeName: JSString = "attributeName" - static let attributeNamespace: JSString = "attributeNamespace" - static let nextSibling: JSString = "nextSibling" - static let oldValue: JSString = "oldValue" - static let previousSibling: JSString = "previousSibling" - static let removedNodes: JSString = "removedNodes" - static let target: JSString = "target" - static let type: JSString = "type" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) - _target = ReadonlyAttribute(jsObject: jsObject, name: Keys.target) - _addedNodes = ReadonlyAttribute(jsObject: jsObject, name: Keys.addedNodes) - _removedNodes = ReadonlyAttribute(jsObject: jsObject, name: Keys.removedNodes) - _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: Keys.previousSibling) - _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: Keys.nextSibling) - _attributeName = ReadonlyAttribute(jsObject: jsObject, name: Keys.attributeName) - _attributeNamespace = ReadonlyAttribute(jsObject: jsObject, name: Keys.attributeNamespace) - _oldValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.oldValue) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) + _addedNodes = ReadonlyAttribute(jsObject: jsObject, name: Strings.addedNodes) + _removedNodes = ReadonlyAttribute(jsObject: jsObject, name: Strings.removedNodes) + _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: Strings.previousSibling) + _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: Strings.nextSibling) + _attributeName = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributeName) + _attributeNamespace = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributeNamespace) + _oldValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldValue) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/NamedNodeMap.swift b/Sources/DOMKit/WebIDL/NamedNodeMap.swift index 91421b72..5dd5fd51 100644 --- a/Sources/DOMKit/WebIDL/NamedNodeMap.swift +++ b/Sources/DOMKit/WebIDL/NamedNodeMap.swift @@ -6,21 +6,10 @@ import JavaScriptKit public class NamedNodeMap: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.NamedNodeMap.function! } - private enum Keys { - static let getNamedItem: JSString = "getNamedItem" - static let getNamedItemNS: JSString = "getNamedItemNS" - static let item: JSString = "item" - static let length: JSString = "length" - static let removeNamedItem: JSString = "removeNamedItem" - static let removeNamedItemNS: JSString = "removeNamedItemNS" - static let setNamedItem: JSString = "setNamedItem" - static let setNamedItemNS: JSString = "setNamedItemNS" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } @@ -36,22 +25,22 @@ public class NamedNodeMap: JSBridgedClass { } public func getNamedItemNS(namespace: String?, localName: String) -> Attr? { - jsObject[Keys.getNamedItemNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Strings.getNamedItemNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } public func setNamedItem(attr: Attr) -> Attr? { - jsObject[Keys.setNamedItem]!(attr.jsValue()).fromJSValue()! + jsObject[Strings.setNamedItem]!(attr.jsValue()).fromJSValue()! } public func setNamedItemNS(attr: Attr) -> Attr? { - jsObject[Keys.setNamedItemNS]!(attr.jsValue()).fromJSValue()! + jsObject[Strings.setNamedItemNS]!(attr.jsValue()).fromJSValue()! } public func removeNamedItem(qualifiedName: String) -> Attr { - jsObject[Keys.removeNamedItem]!(qualifiedName.jsValue()).fromJSValue()! + jsObject[Strings.removeNamedItem]!(qualifiedName.jsValue()).fromJSValue()! } public func removeNamedItemNS(namespace: String?, localName: String) -> Attr { - jsObject[Keys.removeNamedItemNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Strings.removeNamedItemNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index a6079f57..40e14532 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class Navigator: JSBridgedClass, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware { public class var constructor: JSFunction { JSObject.global.Navigator.function! } - private enum Keys {} - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift b/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift index 85c27b37..07edf796 100644 --- a/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift +++ b/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift @@ -3,11 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let hardwareConcurrency: JSString = "hardwareConcurrency" -} - public protocol NavigatorConcurrentHardware: JSBridgedClass {} public extension NavigatorConcurrentHardware { - var hardwareConcurrency: UInt64 { ReadonlyAttribute[Keys.hardwareConcurrency, in: jsObject] } + var hardwareConcurrency: UInt64 { ReadonlyAttribute[Strings.hardwareConcurrency, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift index 434c7d84..e5ae39fb 100644 --- a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift +++ b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift @@ -3,18 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let registerProtocolHandler: JSString = "registerProtocolHandler" - static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" -} - public protocol NavigatorContentUtils: JSBridgedClass {} public extension NavigatorContentUtils { func registerProtocolHandler(scheme: String, url: String) { - _ = jsObject[Keys.registerProtocolHandler]!(scheme.jsValue(), url.jsValue()) + _ = jsObject[Strings.registerProtocolHandler]!(scheme.jsValue(), url.jsValue()) } func unregisterProtocolHandler(scheme: String, url: String) { - _ = jsObject[Keys.unregisterProtocolHandler]!(scheme.jsValue(), url.jsValue()) + _ = jsObject[Strings.unregisterProtocolHandler]!(scheme.jsValue(), url.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/NavigatorCookies.swift b/Sources/DOMKit/WebIDL/NavigatorCookies.swift index e3a6ea5f..7eec4e0b 100644 --- a/Sources/DOMKit/WebIDL/NavigatorCookies.swift +++ b/Sources/DOMKit/WebIDL/NavigatorCookies.swift @@ -3,11 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let cookieEnabled: JSString = "cookieEnabled" -} - public protocol NavigatorCookies: JSBridgedClass {} public extension NavigatorCookies { - var cookieEnabled: Bool { ReadonlyAttribute[Keys.cookieEnabled, in: jsObject] } + var cookieEnabled: Bool { ReadonlyAttribute[Strings.cookieEnabled, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorID.swift b/Sources/DOMKit/WebIDL/NavigatorID.swift index f36b625a..5d099c91 100644 --- a/Sources/DOMKit/WebIDL/NavigatorID.swift +++ b/Sources/DOMKit/WebIDL/NavigatorID.swift @@ -3,43 +3,29 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let appCodeName: JSString = "appCodeName" - static let appName: JSString = "appName" - static let appVersion: JSString = "appVersion" - static let oscpu: JSString = "oscpu" - static let platform: JSString = "platform" - static let product: JSString = "product" - static let productSub: JSString = "productSub" - static let taintEnabled: JSString = "taintEnabled" - static let userAgent: JSString = "userAgent" - static let vendor: JSString = "vendor" - static let vendorSub: JSString = "vendorSub" -} - public protocol NavigatorID: JSBridgedClass {} public extension NavigatorID { - var appCodeName: String { ReadonlyAttribute[Keys.appCodeName, in: jsObject] } + var appCodeName: String { ReadonlyAttribute[Strings.appCodeName, in: jsObject] } - var appName: String { ReadonlyAttribute[Keys.appName, in: jsObject] } + var appName: String { ReadonlyAttribute[Strings.appName, in: jsObject] } - var appVersion: String { ReadonlyAttribute[Keys.appVersion, in: jsObject] } + var appVersion: String { ReadonlyAttribute[Strings.appVersion, in: jsObject] } - var platform: String { ReadonlyAttribute[Keys.platform, in: jsObject] } + var platform: String { ReadonlyAttribute[Strings.platform, in: jsObject] } - var product: String { ReadonlyAttribute[Keys.product, in: jsObject] } + var product: String { ReadonlyAttribute[Strings.product, in: jsObject] } - var productSub: String { ReadonlyAttribute[Keys.productSub, in: jsObject] } + var productSub: String { ReadonlyAttribute[Strings.productSub, in: jsObject] } - var userAgent: String { ReadonlyAttribute[Keys.userAgent, in: jsObject] } + var userAgent: String { ReadonlyAttribute[Strings.userAgent, in: jsObject] } - var vendor: String { ReadonlyAttribute[Keys.vendor, in: jsObject] } + var vendor: String { ReadonlyAttribute[Strings.vendor, in: jsObject] } - var vendorSub: String { ReadonlyAttribute[Keys.vendorSub, in: jsObject] } + var vendorSub: String { ReadonlyAttribute[Strings.vendorSub, in: jsObject] } func taintEnabled() -> Bool { - jsObject[Keys.taintEnabled]!().fromJSValue()! + jsObject[Strings.taintEnabled]!().fromJSValue()! } - var oscpu: String { ReadonlyAttribute[Keys.oscpu, in: jsObject] } + var oscpu: String { ReadonlyAttribute[Strings.oscpu, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorLanguage.swift b/Sources/DOMKit/WebIDL/NavigatorLanguage.swift index bcb6d4e9..11780c8c 100644 --- a/Sources/DOMKit/WebIDL/NavigatorLanguage.swift +++ b/Sources/DOMKit/WebIDL/NavigatorLanguage.swift @@ -3,14 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let language: JSString = "language" - static let languages: JSString = "languages" -} - public protocol NavigatorLanguage: JSBridgedClass {} public extension NavigatorLanguage { - var language: String { ReadonlyAttribute[Keys.language, in: jsObject] } + var language: String { ReadonlyAttribute[Strings.language, in: jsObject] } - var languages: [String] { ReadonlyAttribute[Keys.languages, in: jsObject] } + var languages: [String] { ReadonlyAttribute[Strings.languages, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorOnLine.swift b/Sources/DOMKit/WebIDL/NavigatorOnLine.swift index 617c8792..aad1a3e9 100644 --- a/Sources/DOMKit/WebIDL/NavigatorOnLine.swift +++ b/Sources/DOMKit/WebIDL/NavigatorOnLine.swift @@ -3,11 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let onLine: JSString = "onLine" -} - public protocol NavigatorOnLine: JSBridgedClass {} public extension NavigatorOnLine { - var onLine: Bool { ReadonlyAttribute[Keys.onLine, in: jsObject] } + var onLine: Bool { ReadonlyAttribute[Strings.onLine, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift index f8ab0dc6..70d97440 100644 --- a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift +++ b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift @@ -3,22 +3,15 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let javaEnabled: JSString = "javaEnabled" - static let mimeTypes: JSString = "mimeTypes" - static let pdfViewerEnabled: JSString = "pdfViewerEnabled" - static let plugins: JSString = "plugins" -} - public protocol NavigatorPlugins: JSBridgedClass {} public extension NavigatorPlugins { - var plugins: PluginArray { ReadonlyAttribute[Keys.plugins, in: jsObject] } + var plugins: PluginArray { ReadonlyAttribute[Strings.plugins, in: jsObject] } - var mimeTypes: MimeTypeArray { ReadonlyAttribute[Keys.mimeTypes, in: jsObject] } + var mimeTypes: MimeTypeArray { ReadonlyAttribute[Strings.mimeTypes, in: jsObject] } func javaEnabled() -> Bool { - jsObject[Keys.javaEnabled]!().fromJSValue()! + jsObject[Strings.javaEnabled]!().fromJSValue()! } - var pdfViewerEnabled: Bool { ReadonlyAttribute[Keys.pdfViewerEnabled, in: jsObject] } + var pdfViewerEnabled: Bool { ReadonlyAttribute[Strings.pdfViewerEnabled, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Node.swift b/Sources/DOMKit/WebIDL/Node.swift index fa046a25..8589d301 100644 --- a/Sources/DOMKit/WebIDL/Node.swift +++ b/Sources/DOMKit/WebIDL/Node.swift @@ -6,71 +6,21 @@ import JavaScriptKit public class Node: EventTarget { override public class var constructor: JSFunction { JSObject.global.Node.function! } - private enum Keys { - static let ATTRIBUTE_NODE: JSString = "ATTRIBUTE_NODE" - static let CDATA_SECTION_NODE: JSString = "CDATA_SECTION_NODE" - static let COMMENT_NODE: JSString = "COMMENT_NODE" - static let DOCUMENT_FRAGMENT_NODE: JSString = "DOCUMENT_FRAGMENT_NODE" - static let DOCUMENT_NODE: JSString = "DOCUMENT_NODE" - static let DOCUMENT_POSITION_CONTAINED_BY: JSString = "DOCUMENT_POSITION_CONTAINED_BY" - static let DOCUMENT_POSITION_CONTAINS: JSString = "DOCUMENT_POSITION_CONTAINS" - static let DOCUMENT_POSITION_DISCONNECTED: JSString = "DOCUMENT_POSITION_DISCONNECTED" - static let DOCUMENT_POSITION_FOLLOWING: JSString = "DOCUMENT_POSITION_FOLLOWING" - static let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: JSString = "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" - static let DOCUMENT_POSITION_PRECEDING: JSString = "DOCUMENT_POSITION_PRECEDING" - static let DOCUMENT_TYPE_NODE: JSString = "DOCUMENT_TYPE_NODE" - static let ELEMENT_NODE: JSString = "ELEMENT_NODE" - static let ENTITY_NODE: JSString = "ENTITY_NODE" - static let ENTITY_REFERENCE_NODE: JSString = "ENTITY_REFERENCE_NODE" - static let NOTATION_NODE: JSString = "NOTATION_NODE" - static let PROCESSING_INSTRUCTION_NODE: JSString = "PROCESSING_INSTRUCTION_NODE" - static let TEXT_NODE: JSString = "TEXT_NODE" - static let appendChild: JSString = "appendChild" - static let baseURI: JSString = "baseURI" - static let childNodes: JSString = "childNodes" - static let cloneNode: JSString = "cloneNode" - static let compareDocumentPosition: JSString = "compareDocumentPosition" - static let contains: JSString = "contains" - static let firstChild: JSString = "firstChild" - static let getRootNode: JSString = "getRootNode" - static let hasChildNodes: JSString = "hasChildNodes" - static let insertBefore: JSString = "insertBefore" - static let isConnected: JSString = "isConnected" - static let isDefaultNamespace: JSString = "isDefaultNamespace" - static let isEqualNode: JSString = "isEqualNode" - static let isSameNode: JSString = "isSameNode" - static let lastChild: JSString = "lastChild" - static let lookupNamespaceURI: JSString = "lookupNamespaceURI" - static let lookupPrefix: JSString = "lookupPrefix" - static let nextSibling: JSString = "nextSibling" - static let nodeName: JSString = "nodeName" - static let nodeType: JSString = "nodeType" - static let nodeValue: JSString = "nodeValue" - static let normalize: JSString = "normalize" - static let ownerDocument: JSString = "ownerDocument" - static let parentElement: JSString = "parentElement" - static let parentNode: JSString = "parentNode" - static let previousSibling: JSString = "previousSibling" - static let removeChild: JSString = "removeChild" - static let replaceChild: JSString = "replaceChild" - static let textContent: JSString = "textContent" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _nodeType = ReadonlyAttribute(jsObject: jsObject, name: Keys.nodeType) - _nodeName = ReadonlyAttribute(jsObject: jsObject, name: Keys.nodeName) - _baseURI = ReadonlyAttribute(jsObject: jsObject, name: Keys.baseURI) - _isConnected = ReadonlyAttribute(jsObject: jsObject, name: Keys.isConnected) - _ownerDocument = ReadonlyAttribute(jsObject: jsObject, name: Keys.ownerDocument) - _parentNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentNode) - _parentElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentElement) - _childNodes = ReadonlyAttribute(jsObject: jsObject, name: Keys.childNodes) - _firstChild = ReadonlyAttribute(jsObject: jsObject, name: Keys.firstChild) - _lastChild = ReadonlyAttribute(jsObject: jsObject, name: Keys.lastChild) - _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: Keys.previousSibling) - _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: Keys.nextSibling) - _nodeValue = ReadWriteAttribute(jsObject: jsObject, name: Keys.nodeValue) - _textContent = ReadWriteAttribute(jsObject: jsObject, name: Keys.textContent) + _nodeType = ReadonlyAttribute(jsObject: jsObject, name: Strings.nodeType) + _nodeName = ReadonlyAttribute(jsObject: jsObject, name: Strings.nodeName) + _baseURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseURI) + _isConnected = ReadonlyAttribute(jsObject: jsObject, name: Strings.isConnected) + _ownerDocument = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerDocument) + _parentNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentNode) + _parentElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentElement) + _childNodes = ReadonlyAttribute(jsObject: jsObject, name: Strings.childNodes) + _firstChild = ReadonlyAttribute(jsObject: jsObject, name: Strings.firstChild) + _lastChild = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastChild) + _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: Strings.previousSibling) + _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: Strings.nextSibling) + _nodeValue = ReadWriteAttribute(jsObject: jsObject, name: Strings.nodeValue) + _textContent = ReadWriteAttribute(jsObject: jsObject, name: Strings.textContent) super.init(unsafelyWrapping: jsObject) } @@ -114,7 +64,7 @@ public class Node: EventTarget { public var ownerDocument: Document? public func getRootNode(options: GetRootNodeOptions? = nil) -> Self { - jsObject[Keys.getRootNode]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.getRootNode]!(options?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -124,7 +74,7 @@ public class Node: EventTarget { public var parentElement: Element? public func hasChildNodes() -> Bool { - jsObject[Keys.hasChildNodes]!().fromJSValue()! + jsObject[Strings.hasChildNodes]!().fromJSValue()! } @ReadonlyAttribute @@ -149,19 +99,19 @@ public class Node: EventTarget { public var textContent: String? public func normalize() { - _ = jsObject[Keys.normalize]!() + _ = jsObject[Strings.normalize]!() } public func cloneNode(deep: Bool? = nil) -> Self { - jsObject[Keys.cloneNode]!(deep?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.cloneNode]!(deep?.jsValue() ?? .undefined).fromJSValue()! } public func isEqualNode(otherNode: Node?) -> Bool { - jsObject[Keys.isEqualNode]!(otherNode.jsValue()).fromJSValue()! + jsObject[Strings.isEqualNode]!(otherNode.jsValue()).fromJSValue()! } public func isSameNode(otherNode: Node?) -> Bool { - jsObject[Keys.isSameNode]!(otherNode.jsValue()).fromJSValue()! + jsObject[Strings.isSameNode]!(otherNode.jsValue()).fromJSValue()! } public static let DOCUMENT_POSITION_DISCONNECTED: UInt16 = 0x01 @@ -177,38 +127,38 @@ public class Node: EventTarget { public static let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: UInt16 = 0x20 public func compareDocumentPosition(other: Node) -> UInt16 { - jsObject[Keys.compareDocumentPosition]!(other.jsValue()).fromJSValue()! + jsObject[Strings.compareDocumentPosition]!(other.jsValue()).fromJSValue()! } public func contains(other: Node?) -> Bool { - jsObject[Keys.contains]!(other.jsValue()).fromJSValue()! + jsObject[Strings.contains]!(other.jsValue()).fromJSValue()! } public func lookupPrefix(namespace: String?) -> String? { - jsObject[Keys.lookupPrefix]!(namespace.jsValue()).fromJSValue()! + jsObject[Strings.lookupPrefix]!(namespace.jsValue()).fromJSValue()! } public func lookupNamespaceURI(prefix: String?) -> String? { - jsObject[Keys.lookupNamespaceURI]!(prefix.jsValue()).fromJSValue()! + jsObject[Strings.lookupNamespaceURI]!(prefix.jsValue()).fromJSValue()! } public func isDefaultNamespace(namespace: String?) -> Bool { - jsObject[Keys.isDefaultNamespace]!(namespace.jsValue()).fromJSValue()! + jsObject[Strings.isDefaultNamespace]!(namespace.jsValue()).fromJSValue()! } public func insertBefore(node: Node, child: Node?) -> Self { - jsObject[Keys.insertBefore]!(node.jsValue(), child.jsValue()).fromJSValue()! + jsObject[Strings.insertBefore]!(node.jsValue(), child.jsValue()).fromJSValue()! } public func appendChild(node: Node) -> Self { - jsObject[Keys.appendChild]!(node.jsValue()).fromJSValue()! + jsObject[Strings.appendChild]!(node.jsValue()).fromJSValue()! } public func replaceChild(node: Node, child: Node) -> Self { - jsObject[Keys.replaceChild]!(node.jsValue(), child.jsValue()).fromJSValue()! + jsObject[Strings.replaceChild]!(node.jsValue(), child.jsValue()).fromJSValue()! } public func removeChild(child: Node) -> Self { - jsObject[Keys.removeChild]!(child.jsValue()).fromJSValue()! + jsObject[Strings.removeChild]!(child.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NodeIterator.swift b/Sources/DOMKit/WebIDL/NodeIterator.swift index 8d9c3996..4ea435f0 100644 --- a/Sources/DOMKit/WebIDL/NodeIterator.swift +++ b/Sources/DOMKit/WebIDL/NodeIterator.swift @@ -6,24 +6,13 @@ import JavaScriptKit public class NodeIterator: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.NodeIterator.function! } - private enum Keys { - static let detach: JSString = "detach" - static let filter: JSString = "filter" - static let nextNode: JSString = "nextNode" - static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" - static let previousNode: JSString = "previousNode" - static let referenceNode: JSString = "referenceNode" - static let root: JSString = "root" - static let whatToShow: JSString = "whatToShow" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _root = ReadonlyAttribute(jsObject: jsObject, name: Keys.root) - _referenceNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.referenceNode) - _pointerBeforeReferenceNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.pointerBeforeReferenceNode) - _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: Keys.whatToShow) + _root = ReadonlyAttribute(jsObject: jsObject, name: Strings.root) + _referenceNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.referenceNode) + _pointerBeforeReferenceNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointerBeforeReferenceNode) + _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: Strings.whatToShow) self.jsObject = jsObject } @@ -42,14 +31,14 @@ public class NodeIterator: JSBridgedClass { // XXX: member 'filter' is ignored public func nextNode() -> Node? { - jsObject[Keys.nextNode]!().fromJSValue()! + jsObject[Strings.nextNode]!().fromJSValue()! } public func previousNode() -> Node? { - jsObject[Keys.previousNode]!().fromJSValue()! + jsObject[Strings.previousNode]!().fromJSValue()! } public func detach() { - _ = jsObject[Keys.detach]!() + _ = jsObject[Strings.detach]!() } } diff --git a/Sources/DOMKit/WebIDL/NodeList.swift b/Sources/DOMKit/WebIDL/NodeList.swift index 2c515eeb..29b3276a 100644 --- a/Sources/DOMKit/WebIDL/NodeList.swift +++ b/Sources/DOMKit/WebIDL/NodeList.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class NodeList: JSBridgedClass, Sequence { public class var constructor: JSFunction { JSObject.global.NodeList.function! } - private enum Keys { - static let item: JSString = "item" - static let length: JSString = "length" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift b/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift index 8674067c..8bac3f59 100644 --- a/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift +++ b/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift @@ -3,14 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let nextElementSibling: JSString = "nextElementSibling" - static let previousElementSibling: JSString = "previousElementSibling" -} - public protocol NonDocumentTypeChildNode: JSBridgedClass {} public extension NonDocumentTypeChildNode { - var previousElementSibling: Element? { ReadonlyAttribute[Keys.previousElementSibling, in: jsObject] } + var previousElementSibling: Element? { ReadonlyAttribute[Strings.previousElementSibling, in: jsObject] } - var nextElementSibling: Element? { ReadonlyAttribute[Keys.nextElementSibling, in: jsObject] } + var nextElementSibling: Element? { ReadonlyAttribute[Strings.nextElementSibling, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NonElementParentNode.swift b/Sources/DOMKit/WebIDL/NonElementParentNode.swift index 8785975a..6fb68a12 100644 --- a/Sources/DOMKit/WebIDL/NonElementParentNode.swift +++ b/Sources/DOMKit/WebIDL/NonElementParentNode.swift @@ -3,13 +3,9 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let getElementById: JSString = "getElementById" -} - public protocol NonElementParentNode: JSBridgedClass {} public extension NonElementParentNode { func getElementById(elementId: String) -> Element? { - jsObject[Keys.getElementById]!(elementId.jsValue()).fromJSValue()! + jsObject[Strings.getElementById]!(elementId.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift index 21f60872..e94f49bc 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -6,21 +6,11 @@ import JavaScriptKit public class OffscreenCanvas: EventTarget { override public class var constructor: JSFunction { JSObject.global.OffscreenCanvas.function! } - private enum Keys { - static let convertToBlob: JSString = "convertToBlob" - static let getContext: JSString = "getContext" - static let height: JSString = "height" - static let oncontextlost: JSString = "oncontextlost" - static let oncontextrestored: JSString = "oncontextrestored" - static let transferToImageBitmap: JSString = "transferToImageBitmap" - static let width: JSString = "width" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadWriteAttribute(jsObject: jsObject, name: Keys.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Keys.height) - _oncontextlost = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.oncontextlost) - _oncontextrestored = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.oncontextrestored) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _oncontextlost = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontextlost) + _oncontextrestored = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontextrestored) super.init(unsafelyWrapping: jsObject) } @@ -35,20 +25,20 @@ public class OffscreenCanvas: EventTarget { public var height: UInt64 public func getContext(contextId: OffscreenRenderingContextId, options: JSValue? = nil) -> OffscreenRenderingContext? { - jsObject[Keys.getContext]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.getContext]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func transferToImageBitmap() -> ImageBitmap { - jsObject[Keys.transferToImageBitmap]!().fromJSValue()! + jsObject[Strings.transferToImageBitmap]!().fromJSValue()! } public func convertToBlob(options: ImageEncodeOptions? = nil) -> JSPromise { - jsObject[Keys.convertToBlob]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.convertToBlob]!(options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func convertToBlob(options: ImageEncodeOptions? = nil) async throws -> Blob { - let _promise: JSPromise = jsObject[Keys.convertToBlob]!(options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.convertToBlob]!(options?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift index 01e08e3a..f0522f4e 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift @@ -6,20 +6,15 @@ import JavaScriptKit public class OffscreenCanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { public class var constructor: JSFunction { JSObject.global.OffscreenCanvasRenderingContext2D.function! } - private enum Keys { - static let canvas: JSString = "canvas" - static let commit: JSString = "commit" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _canvas = ReadonlyAttribute(jsObject: jsObject, name: Keys.canvas) + _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) self.jsObject = jsObject } public func commit() { - _ = jsObject[Keys.commit]!() + _ = jsObject[Strings.commit]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift index 24044632..dd4fafc7 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class PageTransitionEvent: Event { override public class var constructor: JSFunction { JSObject.global.PageTransitionEvent.function! } - private enum Keys { - static let persisted: JSString = "persisted" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _persisted = ReadonlyAttribute(jsObject: jsObject, name: Keys.persisted) + _persisted = ReadonlyAttribute(jsObject: jsObject, name: Strings.persisted) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift index fcb700c1..20b14465 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class PageTransitionEventInit: BridgedDictionary { - private enum Keys { - static let persisted: JSString = "persisted" - } - public convenience init(persisted: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.persisted] = persisted.jsValue() + object[Strings.persisted] = persisted.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _persisted = ReadWriteAttribute(jsObject: object, name: Keys.persisted) + _persisted = ReadWriteAttribute(jsObject: object, name: Strings.persisted) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ParentNode.swift b/Sources/DOMKit/WebIDL/ParentNode.swift index 1a447815..9f1a4041 100644 --- a/Sources/DOMKit/WebIDL/ParentNode.swift +++ b/Sources/DOMKit/WebIDL/ParentNode.swift @@ -3,45 +3,33 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let append: JSString = "append" - static let childElementCount: JSString = "childElementCount" - static let children: JSString = "children" - static let firstElementChild: JSString = "firstElementChild" - static let lastElementChild: JSString = "lastElementChild" - static let prepend: JSString = "prepend" - static let querySelector: JSString = "querySelector" - static let querySelectorAll: JSString = "querySelectorAll" - static let replaceChildren: JSString = "replaceChildren" -} - public protocol ParentNode: JSBridgedClass {} public extension ParentNode { - var children: HTMLCollection { ReadonlyAttribute[Keys.children, in: jsObject] } + var children: HTMLCollection { ReadonlyAttribute[Strings.children, in: jsObject] } - var firstElementChild: Element? { ReadonlyAttribute[Keys.firstElementChild, in: jsObject] } + var firstElementChild: Element? { ReadonlyAttribute[Strings.firstElementChild, in: jsObject] } - var lastElementChild: Element? { ReadonlyAttribute[Keys.lastElementChild, in: jsObject] } + var lastElementChild: Element? { ReadonlyAttribute[Strings.lastElementChild, in: jsObject] } - var childElementCount: UInt32 { ReadonlyAttribute[Keys.childElementCount, in: jsObject] } + var childElementCount: UInt32 { ReadonlyAttribute[Strings.childElementCount, in: jsObject] } func prepend(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.prepend]!(nodes.jsValue()) + _ = jsObject[Strings.prepend]!(nodes.jsValue()) } func append(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.append]!(nodes.jsValue()) + _ = jsObject[Strings.append]!(nodes.jsValue()) } func replaceChildren(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Keys.replaceChildren]!(nodes.jsValue()) + _ = jsObject[Strings.replaceChildren]!(nodes.jsValue()) } func querySelector(selectors: String) -> Element? { - jsObject[Keys.querySelector]!(selectors.jsValue()).fromJSValue()! + jsObject[Strings.querySelector]!(selectors.jsValue()).fromJSValue()! } func querySelectorAll(selectors: String) -> NodeList { - jsObject[Keys.querySelectorAll]!(selectors.jsValue()).fromJSValue()! + jsObject[Strings.querySelectorAll]!(selectors.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index 465e0947..651a3e4c 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -6,10 +6,6 @@ import JavaScriptKit public class Path2D: JSBridgedClass, CanvasPath { public class var constructor: JSFunction { JSObject.global.Path2D.function! } - private enum Keys { - static let addPath: JSString = "addPath" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -21,6 +17,6 @@ public class Path2D: JSBridgedClass, CanvasPath { } public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { - _ = jsObject[Keys.addPath]!(path.jsValue(), transform?.jsValue() ?? .undefined) + _ = jsObject[Strings.addPath]!(path.jsValue(), transform?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index c98ae120..686089c1 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -6,25 +6,19 @@ import JavaScriptKit public class Performance: EventTarget { override public class var constructor: JSFunction { JSObject.global.Performance.function! } - private enum Keys { - static let now: JSString = "now" - static let timeOrigin: JSString = "timeOrigin" - static let toJSON: JSString = "toJSON" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: Keys.timeOrigin) + _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeOrigin) super.init(unsafelyWrapping: jsObject) } public func now() -> DOMHighResTimeStamp { - jsObject[Keys.now]!().fromJSValue()! + jsObject[Strings.now]!().fromJSValue()! } @ReadonlyAttribute public var timeOrigin: DOMHighResTimeStamp public func toJSON() -> JSObject { - jsObject[Keys.toJSON]!().fromJSValue()! + jsObject[Strings.toJSON]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Plugin.swift b/Sources/DOMKit/WebIDL/Plugin.swift index 815e76b7..882849f2 100644 --- a/Sources/DOMKit/WebIDL/Plugin.swift +++ b/Sources/DOMKit/WebIDL/Plugin.swift @@ -6,22 +6,13 @@ import JavaScriptKit public class Plugin: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Plugin.function! } - private enum Keys { - static let description: JSString = "description" - static let filename: JSString = "filename" - static let item: JSString = "item" - static let length: JSString = "length" - static let name: JSString = "name" - static let namedItem: JSString = "namedItem" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) - _description = ReadonlyAttribute(jsObject: jsObject, name: Keys.description) - _filename = ReadonlyAttribute(jsObject: jsObject, name: Keys.filename) - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _description = ReadonlyAttribute(jsObject: jsObject, name: Strings.description) + _filename = ReadonlyAttribute(jsObject: jsObject, name: Strings.filename) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/PluginArray.swift b/Sources/DOMKit/WebIDL/PluginArray.swift index c7047fad..6d7e0717 100644 --- a/Sources/DOMKit/WebIDL/PluginArray.swift +++ b/Sources/DOMKit/WebIDL/PluginArray.swift @@ -6,22 +6,15 @@ import JavaScriptKit public class PluginArray: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.PluginArray.function! } - private enum Keys { - static let item: JSString = "item" - static let length: JSString = "length" - static let namedItem: JSString = "namedItem" - static let refresh: JSString = "refresh" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } public func refresh() { - _ = jsObject[Keys.refresh]!() + _ = jsObject[Strings.refresh]!() } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PopStateEvent.swift b/Sources/DOMKit/WebIDL/PopStateEvent.swift index 748fda82..a4b39644 100644 --- a/Sources/DOMKit/WebIDL/PopStateEvent.swift +++ b/Sources/DOMKit/WebIDL/PopStateEvent.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class PopStateEvent: Event { override public class var constructor: JSFunction { JSObject.global.PopStateEvent.function! } - private enum Keys { - static let state: JSString = "state" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _state = ReadonlyAttribute(jsObject: jsObject, name: Keys.state) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/PopStateEventInit.swift b/Sources/DOMKit/WebIDL/PopStateEventInit.swift index 340bf67a..35ae24da 100644 --- a/Sources/DOMKit/WebIDL/PopStateEventInit.swift +++ b/Sources/DOMKit/WebIDL/PopStateEventInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class PopStateEventInit: BridgedDictionary { - private enum Keys { - static let state: JSString = "state" - } - public convenience init(state: JSValue) { let object = JSObject.global.Object.function!.new() - object[Keys.state] = state.jsValue() + object[Strings.state] = state.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _state = ReadWriteAttribute(jsObject: object, name: Keys.state) + _state = ReadWriteAttribute(jsObject: object, name: Strings.state) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift index c9b3fc1a..482ac7cd 100644 --- a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift +++ b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class ProcessingInstruction: CharacterData, LinkStyle { override public class var constructor: JSFunction { JSObject.global.ProcessingInstruction.function! } - private enum Keys { - static let target: JSString = "target" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _target = ReadonlyAttribute(jsObject: jsObject, name: Keys.target) + _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/ProgressEvent.swift b/Sources/DOMKit/WebIDL/ProgressEvent.swift index 9dcf312e..65d9fd66 100644 --- a/Sources/DOMKit/WebIDL/ProgressEvent.swift +++ b/Sources/DOMKit/WebIDL/ProgressEvent.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class ProgressEvent: Event { override public class var constructor: JSFunction { JSObject.global.ProgressEvent.function! } - private enum Keys { - static let lengthComputable: JSString = "lengthComputable" - static let loaded: JSString = "loaded" - static let total: JSString = "total" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _lengthComputable = ReadonlyAttribute(jsObject: jsObject, name: Keys.lengthComputable) - _loaded = ReadonlyAttribute(jsObject: jsObject, name: Keys.loaded) - _total = ReadonlyAttribute(jsObject: jsObject, name: Keys.total) + _lengthComputable = ReadonlyAttribute(jsObject: jsObject, name: Strings.lengthComputable) + _loaded = ReadonlyAttribute(jsObject: jsObject, name: Strings.loaded) + _total = ReadonlyAttribute(jsObject: jsObject, name: Strings.total) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/ProgressEventInit.swift b/Sources/DOMKit/WebIDL/ProgressEventInit.swift index 9fb567c4..27fab936 100644 --- a/Sources/DOMKit/WebIDL/ProgressEventInit.swift +++ b/Sources/DOMKit/WebIDL/ProgressEventInit.swift @@ -4,24 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class ProgressEventInit: BridgedDictionary { - private enum Keys { - static let lengthComputable: JSString = "lengthComputable" - static let loaded: JSString = "loaded" - static let total: JSString = "total" - } - public convenience init(lengthComputable: Bool, loaded: UInt64, total: UInt64) { let object = JSObject.global.Object.function!.new() - object[Keys.lengthComputable] = lengthComputable.jsValue() - object[Keys.loaded] = loaded.jsValue() - object[Keys.total] = total.jsValue() + object[Strings.lengthComputable] = lengthComputable.jsValue() + object[Strings.loaded] = loaded.jsValue() + object[Strings.total] = total.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _lengthComputable = ReadWriteAttribute(jsObject: object, name: Keys.lengthComputable) - _loaded = ReadWriteAttribute(jsObject: object, name: Keys.loaded) - _total = ReadWriteAttribute(jsObject: object, name: Keys.total) + _lengthComputable = ReadWriteAttribute(jsObject: object, name: Strings.lengthComputable) + _loaded = ReadWriteAttribute(jsObject: object, name: Strings.loaded) + _total = ReadWriteAttribute(jsObject: object, name: Strings.total) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift index 7358ad92..e28f557f 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift @@ -6,14 +6,9 @@ import JavaScriptKit public class PromiseRejectionEvent: Event { override public class var constructor: JSFunction { JSObject.global.PromiseRejectionEvent.function! } - private enum Keys { - static let promise: JSString = "promise" - static let reason: JSString = "reason" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _promise = ReadonlyAttribute(jsObject: jsObject, name: Keys.promise) - _reason = ReadonlyAttribute(jsObject: jsObject, name: Keys.reason) + _promise = ReadonlyAttribute(jsObject: jsObject, name: Strings.promise) + _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift index 4a3ed008..788e8196 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift @@ -4,21 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class PromiseRejectionEventInit: BridgedDictionary { - private enum Keys { - static let promise: JSString = "promise" - static let reason: JSString = "reason" - } - public convenience init(promise: JSPromise, reason: JSValue) { let object = JSObject.global.Object.function!.new() - object[Keys.promise] = promise.jsValue() - object[Keys.reason] = reason.jsValue() + object[Strings.promise] = promise.jsValue() + object[Strings.reason] = reason.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _promise = ReadWriteAttribute(jsObject: object, name: Keys.promise) - _reason = ReadWriteAttribute(jsObject: object, name: Keys.reason) + _promise = ReadWriteAttribute(jsObject: object, name: Strings.promise) + _reason = ReadWriteAttribute(jsObject: object, name: Strings.reason) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/QueuingStrategy.swift b/Sources/DOMKit/WebIDL/QueuingStrategy.swift index 6dc6ba22..f057ec1a 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategy.swift @@ -4,21 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class QueuingStrategy: BridgedDictionary { - private enum Keys { - static let highWaterMark: JSString = "highWaterMark" - static let size: JSString = "size" - } - public convenience init(highWaterMark: Double, size: @escaping QueuingStrategySize) { let object = JSObject.global.Object.function!.new() - object[Keys.highWaterMark] = highWaterMark.jsValue() - ClosureAttribute.Required1[Keys.size, in: object] = size + object[Strings.highWaterMark] = highWaterMark.jsValue() + ClosureAttribute.Required1[Strings.size, in: object] = size self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _highWaterMark = ReadWriteAttribute(jsObject: object, name: Keys.highWaterMark) - _size = ClosureAttribute.Required1(jsObject: object, name: Keys.size) + _highWaterMark = ReadWriteAttribute(jsObject: object, name: Strings.highWaterMark) + _size = ClosureAttribute.Required1(jsObject: object, name: Strings.size) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift index 1012d183..83941e9b 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class QueuingStrategyInit: BridgedDictionary { - private enum Keys { - static let highWaterMark: JSString = "highWaterMark" - } - public convenience init(highWaterMark: Double) { let object = JSObject.global.Object.function!.new() - object[Keys.highWaterMark] = highWaterMark.jsValue() + object[Strings.highWaterMark] = highWaterMark.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _highWaterMark = ReadWriteAttribute(jsObject: object, name: Keys.highWaterMark) + _highWaterMark = ReadWriteAttribute(jsObject: object, name: Strings.highWaterMark) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RadioNodeList.swift b/Sources/DOMKit/WebIDL/RadioNodeList.swift index c45d2341..d68c1809 100644 --- a/Sources/DOMKit/WebIDL/RadioNodeList.swift +++ b/Sources/DOMKit/WebIDL/RadioNodeList.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class RadioNodeList: NodeList { override public class var constructor: JSFunction { JSObject.global.RadioNodeList.function! } - private enum Keys { - static let value: JSString = "value" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Keys.value) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 36c73f0e..863d42f2 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -6,36 +6,8 @@ import JavaScriptKit public class Range: AbstractRange { override public class var constructor: JSFunction { JSObject.global.Range.function! } - private enum Keys { - static let END_TO_END: JSString = "END_TO_END" - static let END_TO_START: JSString = "END_TO_START" - static let START_TO_END: JSString = "START_TO_END" - static let START_TO_START: JSString = "START_TO_START" - static let cloneContents: JSString = "cloneContents" - static let cloneRange: JSString = "cloneRange" - static let collapse: JSString = "collapse" - static let commonAncestorContainer: JSString = "commonAncestorContainer" - static let compareBoundaryPoints: JSString = "compareBoundaryPoints" - static let comparePoint: JSString = "comparePoint" - static let deleteContents: JSString = "deleteContents" - static let detach: JSString = "detach" - static let extractContents: JSString = "extractContents" - static let insertNode: JSString = "insertNode" - static let intersectsNode: JSString = "intersectsNode" - static let isPointInRange: JSString = "isPointInRange" - static let selectNode: JSString = "selectNode" - static let selectNodeContents: JSString = "selectNodeContents" - static let setEnd: JSString = "setEnd" - static let setEndAfter: JSString = "setEndAfter" - static let setEndBefore: JSString = "setEndBefore" - static let setStart: JSString = "setStart" - static let setStartAfter: JSString = "setStartAfter" - static let setStartBefore: JSString = "setStartBefore" - static let surroundContents: JSString = "surroundContents" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _commonAncestorContainer = ReadonlyAttribute(jsObject: jsObject, name: Keys.commonAncestorContainer) + _commonAncestorContainer = ReadonlyAttribute(jsObject: jsObject, name: Strings.commonAncestorContainer) super.init(unsafelyWrapping: jsObject) } @@ -47,39 +19,39 @@ public class Range: AbstractRange { public var commonAncestorContainer: Node public func setStart(node: Node, offset: UInt32) { - _ = jsObject[Keys.setStart]!(node.jsValue(), offset.jsValue()) + _ = jsObject[Strings.setStart]!(node.jsValue(), offset.jsValue()) } public func setEnd(node: Node, offset: UInt32) { - _ = jsObject[Keys.setEnd]!(node.jsValue(), offset.jsValue()) + _ = jsObject[Strings.setEnd]!(node.jsValue(), offset.jsValue()) } public func setStartBefore(node: Node) { - _ = jsObject[Keys.setStartBefore]!(node.jsValue()) + _ = jsObject[Strings.setStartBefore]!(node.jsValue()) } public func setStartAfter(node: Node) { - _ = jsObject[Keys.setStartAfter]!(node.jsValue()) + _ = jsObject[Strings.setStartAfter]!(node.jsValue()) } public func setEndBefore(node: Node) { - _ = jsObject[Keys.setEndBefore]!(node.jsValue()) + _ = jsObject[Strings.setEndBefore]!(node.jsValue()) } public func setEndAfter(node: Node) { - _ = jsObject[Keys.setEndAfter]!(node.jsValue()) + _ = jsObject[Strings.setEndAfter]!(node.jsValue()) } public func collapse(toStart: Bool? = nil) { - _ = jsObject[Keys.collapse]!(toStart?.jsValue() ?? .undefined) + _ = jsObject[Strings.collapse]!(toStart?.jsValue() ?? .undefined) } public func selectNode(node: Node) { - _ = jsObject[Keys.selectNode]!(node.jsValue()) + _ = jsObject[Strings.selectNode]!(node.jsValue()) } public func selectNodeContents(node: Node) { - _ = jsObject[Keys.selectNodeContents]!(node.jsValue()) + _ = jsObject[Strings.selectNodeContents]!(node.jsValue()) } public static let START_TO_START: UInt16 = 0 @@ -91,47 +63,47 @@ public class Range: AbstractRange { public static let END_TO_START: UInt16 = 3 public func compareBoundaryPoints(how: UInt16, sourceRange: Range) -> Int16 { - jsObject[Keys.compareBoundaryPoints]!(how.jsValue(), sourceRange.jsValue()).fromJSValue()! + jsObject[Strings.compareBoundaryPoints]!(how.jsValue(), sourceRange.jsValue()).fromJSValue()! } public func deleteContents() { - _ = jsObject[Keys.deleteContents]!() + _ = jsObject[Strings.deleteContents]!() } public func extractContents() -> DocumentFragment { - jsObject[Keys.extractContents]!().fromJSValue()! + jsObject[Strings.extractContents]!().fromJSValue()! } public func cloneContents() -> DocumentFragment { - jsObject[Keys.cloneContents]!().fromJSValue()! + jsObject[Strings.cloneContents]!().fromJSValue()! } public func insertNode(node: Node) { - _ = jsObject[Keys.insertNode]!(node.jsValue()) + _ = jsObject[Strings.insertNode]!(node.jsValue()) } public func surroundContents(newParent: Node) { - _ = jsObject[Keys.surroundContents]!(newParent.jsValue()) + _ = jsObject[Strings.surroundContents]!(newParent.jsValue()) } public func cloneRange() -> Self { - jsObject[Keys.cloneRange]!().fromJSValue()! + jsObject[Strings.cloneRange]!().fromJSValue()! } public func detach() { - _ = jsObject[Keys.detach]!() + _ = jsObject[Strings.detach]!() } public func isPointInRange(node: Node, offset: UInt32) -> Bool { - jsObject[Keys.isPointInRange]!(node.jsValue(), offset.jsValue()).fromJSValue()! + jsObject[Strings.isPointInRange]!(node.jsValue(), offset.jsValue()).fromJSValue()! } public func comparePoint(node: Node, offset: UInt32) -> Int16 { - jsObject[Keys.comparePoint]!(node.jsValue(), offset.jsValue()).fromJSValue()! + jsObject[Strings.comparePoint]!(node.jsValue(), offset.jsValue()).fromJSValue()! } public func intersectsNode(node: Node) -> Bool { - jsObject[Keys.intersectsNode]!(node.jsValue()).fromJSValue()! + jsObject[Strings.intersectsNode]!(node.jsValue()).fromJSValue()! } public var description: String { diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift index b4257dc0..7aaccee3 100644 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift @@ -6,19 +6,11 @@ import JavaScriptKit public class ReadableByteStreamController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ReadableByteStreamController.function! } - private enum Keys { - static let byobRequest: JSString = "byobRequest" - static let close: JSString = "close" - static let desiredSize: JSString = "desiredSize" - static let enqueue: JSString = "enqueue" - static let error: JSString = "error" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _byobRequest = ReadonlyAttribute(jsObject: jsObject, name: Keys.byobRequest) - _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Keys.desiredSize) + _byobRequest = ReadonlyAttribute(jsObject: jsObject, name: Strings.byobRequest) + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.desiredSize) self.jsObject = jsObject } @@ -29,14 +21,14 @@ public class ReadableByteStreamController: JSBridgedClass { public var desiredSize: Double? public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } public func enqueue(chunk: ArrayBufferView) { - _ = jsObject[Keys.enqueue]!(chunk.jsValue()) + _ = jsObject[Strings.enqueue]!(chunk.jsValue()) } public func error(e: JSValue? = nil) { - _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) + _ = jsObject[Strings.error]!(e?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStream.swift b/Sources/DOMKit/WebIDL/ReadableStream.swift index ca78ba61..d0d0fd09 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -6,19 +6,10 @@ import JavaScriptKit public class ReadableStream: JSBridgedClass, AsyncSequence { public class var constructor: JSFunction { JSObject.global.ReadableStream.function! } - private enum Keys { - static let cancel: JSString = "cancel" - static let getReader: JSString = "getReader" - static let locked: JSString = "locked" - static let pipeThrough: JSString = "pipeThrough" - static let pipeTo: JSString = "pipeTo" - static let tee: JSString = "tee" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _locked = ReadonlyAttribute(jsObject: jsObject, name: Keys.locked) + _locked = ReadonlyAttribute(jsObject: jsObject, name: Strings.locked) self.jsObject = jsObject } @@ -30,35 +21,35 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { public var locked: Bool public func cancel(reason: JSValue? = nil) -> JSPromise { - jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func cancel(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } public func getReader(options: ReadableStreamGetReaderOptions? = nil) -> ReadableStreamReader { - jsObject[Keys.getReader]!(options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.getReader]!(options?.jsValue() ?? .undefined).fromJSValue()! } public func pipeThrough(transform: ReadableWritablePair, options: StreamPipeOptions? = nil) -> Self { - jsObject[Keys.pipeThrough]!(transform.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.pipeThrough]!(transform.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) -> JSPromise { - jsObject[Keys.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Keys.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } public func tee() -> [ReadableStream] { - jsObject[Keys.tee]!().fromJSValue()! + jsObject[Strings.tee]!().fromJSValue()! } public typealias Element = JSValue diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift index 30fd332a..392a2b5e 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift @@ -4,21 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamBYOBReadResult: BridgedDictionary { - private enum Keys { - static let done: JSString = "done" - static let value: JSString = "value" - } - public convenience init(value: __UNSUPPORTED_UNION__, done: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.value] = value.jsValue() - object[Keys.done] = done.jsValue() + 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: Keys.value) - _done = ReadWriteAttribute(jsObject: object, name: Keys.done) + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + _done = ReadWriteAttribute(jsObject: object, name: Strings.done) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift index 8ec09383..291b6171 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -6,11 +6,6 @@ import JavaScriptKit public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericReader { public class var constructor: JSFunction { JSObject.global.ReadableStreamBYOBReader.function! } - private enum Keys { - static let read: JSString = "read" - static let releaseLock: JSString = "releaseLock" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -22,16 +17,16 @@ public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericRead } public func read(view: ArrayBufferView) -> JSPromise { - jsObject[Keys.read]!(view.jsValue()).fromJSValue()! + jsObject[Strings.read]!(view.jsValue()).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func read(view: ArrayBufferView) async throws -> ReadableStreamBYOBReadResult { - let _promise: JSPromise = jsObject[Keys.read]!(view.jsValue()).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.read]!(view.jsValue()).fromJSValue()! return try await _promise.get().fromJSValue()! } public func releaseLock() { - _ = jsObject[Keys.releaseLock]!() + _ = jsObject[Strings.releaseLock]!() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift index b66e5a85..44adb09a 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class ReadableStreamBYOBRequest: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ReadableStreamBYOBRequest.function! } - private enum Keys { - static let respond: JSString = "respond" - static let respondWithNewView: JSString = "respondWithNewView" - static let view: JSString = "view" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _view = ReadonlyAttribute(jsObject: jsObject, name: Keys.view) + _view = ReadonlyAttribute(jsObject: jsObject, name: Strings.view) self.jsObject = jsObject } @@ -23,10 +17,10 @@ public class ReadableStreamBYOBRequest: JSBridgedClass { public var view: ArrayBufferView? public func respond(bytesWritten: UInt64) { - _ = jsObject[Keys.respond]!(bytesWritten.jsValue()) + _ = jsObject[Strings.respond]!(bytesWritten.jsValue()) } public func respondWithNewView(view: ArrayBufferView) { - _ = jsObject[Keys.respondWithNewView]!(view.jsValue()) + _ = jsObject[Strings.respondWithNewView]!(view.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift index 823b687b..9658e5ca 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift @@ -6,17 +6,10 @@ import JavaScriptKit public class ReadableStreamDefaultController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ReadableStreamDefaultController.function! } - private enum Keys { - static let close: JSString = "close" - static let desiredSize: JSString = "desiredSize" - static let enqueue: JSString = "enqueue" - static let error: JSString = "error" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Keys.desiredSize) + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.desiredSize) self.jsObject = jsObject } @@ -24,14 +17,14 @@ public class ReadableStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } public func enqueue(chunk: JSValue? = nil) { - _ = jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined) + _ = jsObject[Strings.enqueue]!(chunk?.jsValue() ?? .undefined) } public func error(e: JSValue? = nil) { - _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) + _ = jsObject[Strings.error]!(e?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift index 64df4997..4c440ddb 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift @@ -4,21 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamDefaultReadResult: BridgedDictionary { - private enum Keys { - static let done: JSString = "done" - static let value: JSString = "value" - } - public convenience init(value: JSValue, done: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.value] = value.jsValue() - object[Keys.done] = done.jsValue() + 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: Keys.value) - _done = ReadWriteAttribute(jsObject: object, name: Keys.done) + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + _done = ReadWriteAttribute(jsObject: object, name: Strings.done) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift index 1e557ee5..680fe760 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -6,11 +6,6 @@ import JavaScriptKit public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericReader { public class var constructor: JSFunction { JSObject.global.ReadableStreamDefaultReader.function! } - private enum Keys { - static let read: JSString = "read" - static let releaseLock: JSString = "releaseLock" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -22,16 +17,16 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR } public func read() -> JSPromise { - jsObject[Keys.read]!().fromJSValue()! + jsObject[Strings.read]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func read() async throws -> ReadableStreamDefaultReadResult { - let _promise: JSPromise = jsObject[Keys.read]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.read]!().fromJSValue()! return try await _promise.get().fromJSValue()! } public func releaseLock() { - _ = jsObject[Keys.releaseLock]!() + _ = jsObject[Strings.releaseLock]!() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift index b391f377..aa63c91b 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift @@ -3,22 +3,17 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let cancel: JSString = "cancel" - static let closed: JSString = "closed" -} - public protocol ReadableStreamGenericReader: JSBridgedClass {} public extension ReadableStreamGenericReader { - var closed: JSPromise { ReadonlyAttribute[Keys.closed, in: jsObject] } + var closed: JSPromise { ReadonlyAttribute[Strings.closed, in: jsObject] } func cancel(reason: JSValue? = nil) -> JSPromise { - jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func cancel(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Keys.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift index 7bc540c3..c387b3cd 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamGetReaderOptions: BridgedDictionary { - private enum Keys { - static let mode: JSString = "mode" - } - public convenience init(mode: ReadableStreamReaderMode) { let object = JSObject.global.Object.function!.new() - object[Keys.mode] = mode.jsValue() + object[Strings.mode] = mode.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _mode = ReadWriteAttribute(jsObject: object, name: Keys.mode) + _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift index 1bb1b3c0..5dd18f1a 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamIteratorOptions: BridgedDictionary { - private enum Keys { - static let preventCancel: JSString = "preventCancel" - } - public convenience init(preventCancel: Bool) { let object = JSObject.global.Object.function!.new() - object[Keys.preventCancel] = preventCancel.jsValue() + object[Strings.preventCancel] = preventCancel.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _preventCancel = ReadWriteAttribute(jsObject: object, name: Keys.preventCancel) + _preventCancel = ReadWriteAttribute(jsObject: object, name: Strings.preventCancel) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift index 5ff27230..5adcd54f 100644 --- a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift +++ b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift @@ -4,21 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableWritablePair: BridgedDictionary { - private enum Keys { - static let readable: JSString = "readable" - static let writable: JSString = "writable" - } - public convenience init(readable: ReadableStream, writable: WritableStream) { let object = JSObject.global.Object.function!.new() - object[Keys.readable] = readable.jsValue() - object[Keys.writable] = writable.jsValue() + 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: Keys.readable) - _writable = ReadWriteAttribute(jsObject: object, name: Keys.writable) + _readable = ReadWriteAttribute(jsObject: object, name: Strings.readable) + _writable = ReadWriteAttribute(jsObject: object, name: Strings.writable) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift index ebe3ff90..8ae70943 100644 --- a/Sources/DOMKit/WebIDL/Request.swift +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -6,43 +6,24 @@ import JavaScriptKit public class Request: JSBridgedClass, Body { public class var constructor: JSFunction { JSObject.global.Request.function! } - private enum Keys { - static let cache: JSString = "cache" - static let clone: JSString = "clone" - static let credentials: JSString = "credentials" - static let destination: JSString = "destination" - static let headers: JSString = "headers" - static let integrity: JSString = "integrity" - static let isHistoryNavigation: JSString = "isHistoryNavigation" - static let isReloadNavigation: JSString = "isReloadNavigation" - static let keepalive: JSString = "keepalive" - static let method: JSString = "method" - static let mode: JSString = "mode" - static let redirect: JSString = "redirect" - static let referrer: JSString = "referrer" - static let referrerPolicy: JSString = "referrerPolicy" - static let signal: JSString = "signal" - static let url: JSString = "url" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _method = ReadonlyAttribute(jsObject: jsObject, name: Keys.method) - _url = ReadonlyAttribute(jsObject: jsObject, name: Keys.url) - _headers = ReadonlyAttribute(jsObject: jsObject, name: Keys.headers) - _destination = ReadonlyAttribute(jsObject: jsObject, name: Keys.destination) - _referrer = ReadonlyAttribute(jsObject: jsObject, name: Keys.referrer) - _referrerPolicy = ReadonlyAttribute(jsObject: jsObject, name: Keys.referrerPolicy) - _mode = ReadonlyAttribute(jsObject: jsObject, name: Keys.mode) - _credentials = ReadonlyAttribute(jsObject: jsObject, name: Keys.credentials) - _cache = ReadonlyAttribute(jsObject: jsObject, name: Keys.cache) - _redirect = ReadonlyAttribute(jsObject: jsObject, name: Keys.redirect) - _integrity = ReadonlyAttribute(jsObject: jsObject, name: Keys.integrity) - _keepalive = ReadonlyAttribute(jsObject: jsObject, name: Keys.keepalive) - _isReloadNavigation = ReadonlyAttribute(jsObject: jsObject, name: Keys.isReloadNavigation) - _isHistoryNavigation = ReadonlyAttribute(jsObject: jsObject, name: Keys.isHistoryNavigation) - _signal = ReadonlyAttribute(jsObject: jsObject, name: Keys.signal) + _method = ReadonlyAttribute(jsObject: jsObject, name: Strings.method) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _headers = ReadonlyAttribute(jsObject: jsObject, name: Strings.headers) + _destination = ReadonlyAttribute(jsObject: jsObject, name: Strings.destination) + _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) + _referrerPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrerPolicy) + _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) + _credentials = ReadonlyAttribute(jsObject: jsObject, name: Strings.credentials) + _cache = ReadonlyAttribute(jsObject: jsObject, name: Strings.cache) + _redirect = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirect) + _integrity = ReadonlyAttribute(jsObject: jsObject, name: Strings.integrity) + _keepalive = ReadonlyAttribute(jsObject: jsObject, name: Strings.keepalive) + _isReloadNavigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.isReloadNavigation) + _isHistoryNavigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.isHistoryNavigation) + _signal = ReadonlyAttribute(jsObject: jsObject, name: Strings.signal) self.jsObject = jsObject } @@ -96,6 +77,6 @@ public class Request: JSBridgedClass, Body { public var signal: AbortSignal public func clone() -> Self { - jsObject[Keys.clone]!().fromJSValue()! + jsObject[Strings.clone]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RequestInit.swift b/Sources/DOMKit/WebIDL/RequestInit.swift index 121a87f9..d7270c36 100644 --- a/Sources/DOMKit/WebIDL/RequestInit.swift +++ b/Sources/DOMKit/WebIDL/RequestInit.swift @@ -4,54 +4,38 @@ import JavaScriptEventLoop import JavaScriptKit public class RequestInit: BridgedDictionary { - private enum Keys { - static let body: JSString = "body" - static let cache: JSString = "cache" - static let credentials: JSString = "credentials" - static let headers: JSString = "headers" - static let integrity: JSString = "integrity" - static let keepalive: JSString = "keepalive" - static let method: JSString = "method" - static let mode: JSString = "mode" - static let redirect: JSString = "redirect" - static let referrer: JSString = "referrer" - static let referrerPolicy: JSString = "referrerPolicy" - static let signal: JSString = "signal" - static let window: JSString = "window" - } - public convenience init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue) { let object = JSObject.global.Object.function!.new() - object[Keys.method] = method.jsValue() - object[Keys.headers] = headers.jsValue() - object[Keys.body] = body.jsValue() - object[Keys.referrer] = referrer.jsValue() - object[Keys.referrerPolicy] = referrerPolicy.jsValue() - object[Keys.mode] = mode.jsValue() - object[Keys.credentials] = credentials.jsValue() - object[Keys.cache] = cache.jsValue() - object[Keys.redirect] = redirect.jsValue() - object[Keys.integrity] = integrity.jsValue() - object[Keys.keepalive] = keepalive.jsValue() - object[Keys.signal] = signal.jsValue() - object[Keys.window] = window.jsValue() + object[Strings.method] = method.jsValue() + object[Strings.headers] = headers.jsValue() + object[Strings.body] = body.jsValue() + object[Strings.referrer] = referrer.jsValue() + object[Strings.referrerPolicy] = referrerPolicy.jsValue() + object[Strings.mode] = mode.jsValue() + object[Strings.credentials] = credentials.jsValue() + object[Strings.cache] = cache.jsValue() + object[Strings.redirect] = redirect.jsValue() + object[Strings.integrity] = integrity.jsValue() + object[Strings.keepalive] = keepalive.jsValue() + object[Strings.signal] = signal.jsValue() + object[Strings.window] = window.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _method = ReadWriteAttribute(jsObject: object, name: Keys.method) - _headers = ReadWriteAttribute(jsObject: object, name: Keys.headers) - _body = ReadWriteAttribute(jsObject: object, name: Keys.body) - _referrer = ReadWriteAttribute(jsObject: object, name: Keys.referrer) - _referrerPolicy = ReadWriteAttribute(jsObject: object, name: Keys.referrerPolicy) - _mode = ReadWriteAttribute(jsObject: object, name: Keys.mode) - _credentials = ReadWriteAttribute(jsObject: object, name: Keys.credentials) - _cache = ReadWriteAttribute(jsObject: object, name: Keys.cache) - _redirect = ReadWriteAttribute(jsObject: object, name: Keys.redirect) - _integrity = ReadWriteAttribute(jsObject: object, name: Keys.integrity) - _keepalive = ReadWriteAttribute(jsObject: object, name: Keys.keepalive) - _signal = ReadWriteAttribute(jsObject: object, name: Keys.signal) - _window = ReadWriteAttribute(jsObject: object, name: Keys.window) + _method = ReadWriteAttribute(jsObject: object, name: Strings.method) + _headers = ReadWriteAttribute(jsObject: object, name: Strings.headers) + _body = ReadWriteAttribute(jsObject: object, name: Strings.body) + _referrer = ReadWriteAttribute(jsObject: object, name: Strings.referrer) + _referrerPolicy = ReadWriteAttribute(jsObject: object, name: Strings.referrerPolicy) + _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) + _credentials = ReadWriteAttribute(jsObject: object, name: Strings.credentials) + _cache = ReadWriteAttribute(jsObject: object, name: Strings.cache) + _redirect = ReadWriteAttribute(jsObject: object, name: Strings.redirect) + _integrity = ReadWriteAttribute(jsObject: object, name: Strings.integrity) + _keepalive = ReadWriteAttribute(jsObject: object, name: Strings.keepalive) + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + _window = ReadWriteAttribute(jsObject: object, name: Strings.window) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Response.swift b/Sources/DOMKit/WebIDL/Response.swift index 079038da..3e8f04cc 100644 --- a/Sources/DOMKit/WebIDL/Response.swift +++ b/Sources/DOMKit/WebIDL/Response.swift @@ -6,29 +6,16 @@ import JavaScriptKit public class Response: JSBridgedClass, Body { public class var constructor: JSFunction { JSObject.global.Response.function! } - private enum Keys { - static let clone: JSString = "clone" - static let error: JSString = "error" - static let headers: JSString = "headers" - static let ok: JSString = "ok" - static let redirect: JSString = "redirect" - static let redirected: JSString = "redirected" - static let status: JSString = "status" - static let statusText: JSString = "statusText" - static let type: JSString = "type" - static let url: JSString = "url" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) - _url = ReadonlyAttribute(jsObject: jsObject, name: Keys.url) - _redirected = ReadonlyAttribute(jsObject: jsObject, name: Keys.redirected) - _status = ReadonlyAttribute(jsObject: jsObject, name: Keys.status) - _ok = ReadonlyAttribute(jsObject: jsObject, name: Keys.ok) - _statusText = ReadonlyAttribute(jsObject: jsObject, name: Keys.statusText) - _headers = ReadonlyAttribute(jsObject: jsObject, name: Keys.headers) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _redirected = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirected) + _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) + _ok = ReadonlyAttribute(jsObject: jsObject, name: Strings.ok) + _statusText = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusText) + _headers = ReadonlyAttribute(jsObject: jsObject, name: Strings.headers) self.jsObject = jsObject } @@ -37,11 +24,11 @@ public class Response: JSBridgedClass, Body { } public static func error() -> Self { - constructor[Keys.error]!().fromJSValue()! + constructor[Strings.error]!().fromJSValue()! } public static func redirect(url: String, status: UInt16? = nil) -> Self { - constructor[Keys.redirect]!(url.jsValue(), status?.jsValue() ?? .undefined).fromJSValue()! + constructor[Strings.redirect]!(url.jsValue(), status?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute @@ -66,6 +53,6 @@ public class Response: JSBridgedClass, Body { public var headers: Headers public func clone() -> Self { - jsObject[Keys.clone]!().fromJSValue()! + jsObject[Strings.clone]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ResponseInit.swift b/Sources/DOMKit/WebIDL/ResponseInit.swift index a9da2bcc..1d543363 100644 --- a/Sources/DOMKit/WebIDL/ResponseInit.swift +++ b/Sources/DOMKit/WebIDL/ResponseInit.swift @@ -4,24 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class ResponseInit: BridgedDictionary { - private enum Keys { - static let headers: JSString = "headers" - static let status: JSString = "status" - static let statusText: JSString = "statusText" - } - public convenience init(status: UInt16, statusText: String, headers: HeadersInit) { let object = JSObject.global.Object.function!.new() - object[Keys.status] = status.jsValue() - object[Keys.statusText] = statusText.jsValue() - object[Keys.headers] = headers.jsValue() + object[Strings.status] = status.jsValue() + object[Strings.statusText] = statusText.jsValue() + object[Strings.headers] = headers.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _status = ReadWriteAttribute(jsObject: object, name: Keys.status) - _statusText = ReadWriteAttribute(jsObject: object, name: Keys.statusText) - _headers = ReadWriteAttribute(jsObject: object, name: Keys.headers) + _status = ReadWriteAttribute(jsObject: object, name: Strings.status) + _statusText = ReadWriteAttribute(jsObject: object, name: Strings.statusText) + _headers = ReadWriteAttribute(jsObject: object, name: Strings.headers) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ShadowRoot.swift b/Sources/DOMKit/WebIDL/ShadowRoot.swift index dab3ff57..47dfdae9 100644 --- a/Sources/DOMKit/WebIDL/ShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/ShadowRoot.swift @@ -6,20 +6,12 @@ import JavaScriptKit public class ShadowRoot: DocumentFragment, DocumentOrShadowRoot { override public class var constructor: JSFunction { JSObject.global.ShadowRoot.function! } - private enum Keys { - static let delegatesFocus: JSString = "delegatesFocus" - static let host: JSString = "host" - static let mode: JSString = "mode" - static let onslotchange: JSString = "onslotchange" - static let slotAssignment: JSString = "slotAssignment" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _mode = ReadonlyAttribute(jsObject: jsObject, name: Keys.mode) - _delegatesFocus = ReadonlyAttribute(jsObject: jsObject, name: Keys.delegatesFocus) - _slotAssignment = ReadonlyAttribute(jsObject: jsObject, name: Keys.slotAssignment) - _host = ReadonlyAttribute(jsObject: jsObject, name: Keys.host) - _onslotchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onslotchange) + _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) + _delegatesFocus = ReadonlyAttribute(jsObject: jsObject, name: Strings.delegatesFocus) + _slotAssignment = ReadonlyAttribute(jsObject: jsObject, name: Strings.slotAssignment) + _host = ReadonlyAttribute(jsObject: jsObject, name: Strings.host) + _onslotchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onslotchange) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/ShadowRootInit.swift b/Sources/DOMKit/WebIDL/ShadowRootInit.swift index c31af858..f69210da 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootInit.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootInit.swift @@ -4,24 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class ShadowRootInit: BridgedDictionary { - private enum Keys { - static let delegatesFocus: JSString = "delegatesFocus" - static let mode: JSString = "mode" - static let slotAssignment: JSString = "slotAssignment" - } - public convenience init(mode: ShadowRootMode, delegatesFocus: Bool, slotAssignment: SlotAssignmentMode) { let object = JSObject.global.Object.function!.new() - object[Keys.mode] = mode.jsValue() - object[Keys.delegatesFocus] = delegatesFocus.jsValue() - object[Keys.slotAssignment] = slotAssignment.jsValue() + object[Strings.mode] = mode.jsValue() + object[Strings.delegatesFocus] = delegatesFocus.jsValue() + object[Strings.slotAssignment] = slotAssignment.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _mode = ReadWriteAttribute(jsObject: object, name: Keys.mode) - _delegatesFocus = ReadWriteAttribute(jsObject: object, name: Keys.delegatesFocus) - _slotAssignment = ReadWriteAttribute(jsObject: object, name: Keys.slotAssignment) + _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) + _delegatesFocus = ReadWriteAttribute(jsObject: object, name: Strings.delegatesFocus) + _slotAssignment = ReadWriteAttribute(jsObject: object, name: Strings.slotAssignment) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SharedWorker.swift b/Sources/DOMKit/WebIDL/SharedWorker.swift index 67c24c5a..a9ab36a1 100644 --- a/Sources/DOMKit/WebIDL/SharedWorker.swift +++ b/Sources/DOMKit/WebIDL/SharedWorker.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class SharedWorker: EventTarget, AbstractWorker { override public class var constructor: JSFunction { JSObject.global.SharedWorker.function! } - private enum Keys { - static let port: JSString = "port" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _port = ReadonlyAttribute(jsObject: jsObject, name: Keys.port) + _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift index 04b7b182..58a516c9 100644 --- a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift @@ -6,15 +6,9 @@ import JavaScriptKit public class SharedWorkerGlobalScope: WorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global.SharedWorkerGlobalScope.function! } - private enum Keys { - static let close: JSString = "close" - static let name: JSString = "name" - static let onconnect: JSString = "onconnect" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Keys.name) - _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onconnect) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) super.init(unsafelyWrapping: jsObject) } @@ -22,7 +16,7 @@ public class SharedWorkerGlobalScope: WorkerGlobalScope { public var name: String public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/Slottable.swift b/Sources/DOMKit/WebIDL/Slottable.swift index 9ba3b974..b66c17e6 100644 --- a/Sources/DOMKit/WebIDL/Slottable.swift +++ b/Sources/DOMKit/WebIDL/Slottable.swift @@ -3,11 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let assignedSlot: JSString = "assignedSlot" -} - public protocol Slottable: JSBridgedClass {} public extension Slottable { - var assignedSlot: HTMLSlotElement? { ReadonlyAttribute[Keys.assignedSlot, in: jsObject] } + var assignedSlot: HTMLSlotElement? { ReadonlyAttribute[Strings.assignedSlot, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/StaticRange.swift b/Sources/DOMKit/WebIDL/StaticRange.swift index 64623a08..63a88d45 100644 --- a/Sources/DOMKit/WebIDL/StaticRange.swift +++ b/Sources/DOMKit/WebIDL/StaticRange.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class StaticRange: AbstractRange { override public class var constructor: JSFunction { JSObject.global.StaticRange.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/StaticRangeInit.swift b/Sources/DOMKit/WebIDL/StaticRangeInit.swift index 7861b0db..1c05fc14 100644 --- a/Sources/DOMKit/WebIDL/StaticRangeInit.swift +++ b/Sources/DOMKit/WebIDL/StaticRangeInit.swift @@ -4,27 +4,20 @@ import JavaScriptEventLoop import JavaScriptKit public class StaticRangeInit: BridgedDictionary { - private enum Keys { - static let endContainer: JSString = "endContainer" - static let endOffset: JSString = "endOffset" - static let startContainer: JSString = "startContainer" - static let startOffset: JSString = "startOffset" - } - public convenience init(startContainer: Node, startOffset: UInt32, endContainer: Node, endOffset: UInt32) { let object = JSObject.global.Object.function!.new() - object[Keys.startContainer] = startContainer.jsValue() - object[Keys.startOffset] = startOffset.jsValue() - object[Keys.endContainer] = endContainer.jsValue() - object[Keys.endOffset] = endOffset.jsValue() + object[Strings.startContainer] = startContainer.jsValue() + object[Strings.startOffset] = startOffset.jsValue() + object[Strings.endContainer] = endContainer.jsValue() + object[Strings.endOffset] = endOffset.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _startContainer = ReadWriteAttribute(jsObject: object, name: Keys.startContainer) - _startOffset = ReadWriteAttribute(jsObject: object, name: Keys.startOffset) - _endContainer = ReadWriteAttribute(jsObject: object, name: Keys.endContainer) - _endOffset = ReadWriteAttribute(jsObject: object, name: Keys.endOffset) + _startContainer = ReadWriteAttribute(jsObject: object, name: Strings.startContainer) + _startOffset = ReadWriteAttribute(jsObject: object, name: Strings.startOffset) + _endContainer = ReadWriteAttribute(jsObject: object, name: Strings.endContainer) + _endOffset = ReadWriteAttribute(jsObject: object, name: Strings.endOffset) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Storage.swift b/Sources/DOMKit/WebIDL/Storage.swift index 515db6f3..2acb5ed0 100644 --- a/Sources/DOMKit/WebIDL/Storage.swift +++ b/Sources/DOMKit/WebIDL/Storage.swift @@ -6,19 +6,10 @@ import JavaScriptKit public class Storage: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Storage.function! } - private enum Keys { - static let clear: JSString = "clear" - static let getItem: JSString = "getItem" - static let key: JSString = "key" - static let length: JSString = "length" - static let removeItem: JSString = "removeItem" - static let setItem: JSString = "setItem" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } @@ -26,7 +17,7 @@ public class Storage: JSBridgedClass { public var length: UInt32 public func key(index: UInt32) -> String? { - jsObject[Keys.key]!(index.jsValue()).fromJSValue()! + jsObject[Strings.key]!(index.jsValue()).fromJSValue()! } public subscript(key: String) -> String? { @@ -38,6 +29,6 @@ public class Storage: JSBridgedClass { // XXX: unsupported deleter for keys of type String public func clear() { - _ = jsObject[Keys.clear]!() + _ = jsObject[Strings.clear]!() } } diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift index ffe55c9b..faeaa503 100644 --- a/Sources/DOMKit/WebIDL/StorageEvent.swift +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -6,21 +6,12 @@ import JavaScriptKit public class StorageEvent: Event { override public class var constructor: JSFunction { JSObject.global.StorageEvent.function! } - private enum Keys { - static let initStorageEvent: JSString = "initStorageEvent" - static let key: JSString = "key" - static let newValue: JSString = "newValue" - static let oldValue: JSString = "oldValue" - static let storageArea: JSString = "storageArea" - static let url: JSString = "url" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _key = ReadonlyAttribute(jsObject: jsObject, name: Keys.key) - _oldValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.oldValue) - _newValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.newValue) - _url = ReadonlyAttribute(jsObject: jsObject, name: Keys.url) - _storageArea = ReadonlyAttribute(jsObject: jsObject, name: Keys.storageArea) + _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) + _oldValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldValue) + _newValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.newValue) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _storageArea = ReadonlyAttribute(jsObject: jsObject, name: Strings.storageArea) super.init(unsafelyWrapping: jsObject) } @@ -52,6 +43,6 @@ public class StorageEvent: Event { let _arg5 = newValue?.jsValue() ?? .undefined let _arg6 = url?.jsValue() ?? .undefined let _arg7 = storageArea?.jsValue() ?? .undefined - _ = jsObject[Keys.initStorageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + _ = jsObject[Strings.initStorageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) } } diff --git a/Sources/DOMKit/WebIDL/StorageEventInit.swift b/Sources/DOMKit/WebIDL/StorageEventInit.swift index bbbefcb6..560b2c3e 100644 --- a/Sources/DOMKit/WebIDL/StorageEventInit.swift +++ b/Sources/DOMKit/WebIDL/StorageEventInit.swift @@ -4,30 +4,22 @@ import JavaScriptEventLoop import JavaScriptKit public class StorageEventInit: BridgedDictionary { - private enum Keys { - static let key: JSString = "key" - static let newValue: JSString = "newValue" - static let oldValue: JSString = "oldValue" - static let storageArea: JSString = "storageArea" - static let url: JSString = "url" - } - public convenience init(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?) { let object = JSObject.global.Object.function!.new() - object[Keys.key] = key.jsValue() - object[Keys.oldValue] = oldValue.jsValue() - object[Keys.newValue] = newValue.jsValue() - object[Keys.url] = url.jsValue() - object[Keys.storageArea] = storageArea.jsValue() + object[Strings.key] = key.jsValue() + object[Strings.oldValue] = oldValue.jsValue() + object[Strings.newValue] = newValue.jsValue() + object[Strings.url] = url.jsValue() + object[Strings.storageArea] = storageArea.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _key = ReadWriteAttribute(jsObject: object, name: Keys.key) - _oldValue = ReadWriteAttribute(jsObject: object, name: Keys.oldValue) - _newValue = ReadWriteAttribute(jsObject: object, name: Keys.newValue) - _url = ReadWriteAttribute(jsObject: object, name: Keys.url) - _storageArea = ReadWriteAttribute(jsObject: object, name: Keys.storageArea) + _key = ReadWriteAttribute(jsObject: object, name: Strings.key) + _oldValue = ReadWriteAttribute(jsObject: object, name: Strings.oldValue) + _newValue = ReadWriteAttribute(jsObject: object, name: Strings.newValue) + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + _storageArea = ReadWriteAttribute(jsObject: object, name: Strings.storageArea) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift index d5f8ae74..738cd57c 100644 --- a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift +++ b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift @@ -4,27 +4,20 @@ import JavaScriptEventLoop import JavaScriptKit public class StreamPipeOptions: BridgedDictionary { - private enum Keys { - static let preventAbort: JSString = "preventAbort" - static let preventCancel: JSString = "preventCancel" - static let preventClose: JSString = "preventClose" - static let signal: JSString = "signal" - } - public convenience init(preventClose: Bool, preventAbort: Bool, preventCancel: Bool, signal: AbortSignal) { let object = JSObject.global.Object.function!.new() - object[Keys.preventClose] = preventClose.jsValue() - object[Keys.preventAbort] = preventAbort.jsValue() - object[Keys.preventCancel] = preventCancel.jsValue() - object[Keys.signal] = signal.jsValue() + 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: Keys.preventClose) - _preventAbort = ReadWriteAttribute(jsObject: object, name: Keys.preventAbort) - _preventCancel = ReadWriteAttribute(jsObject: object, name: Keys.preventCancel) - _signal = ReadWriteAttribute(jsObject: object, name: Keys.signal) + _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) } diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift new file mode 100644 index 00000000..d3cd53f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -0,0 +1,1169 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +enum Strings { + static let _self: JSString = "self" + static let AddSearchProvider: JSString = "AddSearchProvider" + static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" + static let URL: JSString = "URL" + static let a: JSString = "a" + static let aLink: JSString = "aLink" + static let abbr: JSString = "abbr" + static let abort: JSString = "abort" + static let aborted: JSString = "aborted" + static let accept: JSString = "accept" + static let acceptCharset: JSString = "acceptCharset" + static let accessKey: JSString = "accessKey" + static let accessKeyLabel: JSString = "accessKeyLabel" + static let action: JSString = "action" + static let activeCues: JSString = "activeCues" + static let activeElement: JSString = "activeElement" + static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" + static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" + static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" + static let actualBoundingBoxRight: JSString = "actualBoundingBoxRight" + static let add: JSString = "add" + static let addColorStop: JSString = "addColorStop" + static let addCue: JSString = "addCue" + static let addModule: JSString = "addModule" + static let addPath: JSString = "addPath" + static let addRule: JSString = "addRule" + static let addTextTrack: JSString = "addTextTrack" + static let addedNodes: JSString = "addedNodes" + static let adoptNode: JSString = "adoptNode" + static let adoptedStyleSheets: JSString = "adoptedStyleSheets" + static let after: JSString = "after" + static let alert: JSString = "alert" + static let align: JSString = "align" + static let alinkColor: JSString = "alinkColor" + static let all: JSString = "all" + static let allow: JSString = "allow" + static let allowFullscreen: JSString = "allowFullscreen" + static let alpha: JSString = "alpha" + static let alphabeticBaseline: JSString = "alphabeticBaseline" + static let alt: JSString = "alt" + static let altKey: JSString = "altKey" + static let ancestorOrigins: JSString = "ancestorOrigins" + static let anchors: JSString = "anchors" + static let appCodeName: JSString = "appCodeName" + static let appName: JSString = "appName" + static let appVersion: JSString = "appVersion" + static let append: JSString = "append" + static let appendChild: JSString = "appendChild" + static let appendData: JSString = "appendData" + static let appendMedium: JSString = "appendMedium" + static let applets: JSString = "applets" + static let arc: JSString = "arc" + static let arcTo: JSString = "arcTo" + static let archive: JSString = "archive" + static let areas: JSString = "areas" + static let ariaAtomic: JSString = "ariaAtomic" + static let ariaAutoComplete: JSString = "ariaAutoComplete" + static let ariaBusy: JSString = "ariaBusy" + static let ariaChecked: JSString = "ariaChecked" + static let ariaColCount: JSString = "ariaColCount" + static let ariaColIndex: JSString = "ariaColIndex" + static let ariaColIndexText: JSString = "ariaColIndexText" + static let ariaColSpan: JSString = "ariaColSpan" + static let ariaCurrent: JSString = "ariaCurrent" + static let ariaDescription: JSString = "ariaDescription" + static let ariaDisabled: JSString = "ariaDisabled" + static let ariaExpanded: JSString = "ariaExpanded" + static let ariaHasPopup: JSString = "ariaHasPopup" + static let ariaHidden: JSString = "ariaHidden" + static let ariaInvalid: JSString = "ariaInvalid" + static let ariaKeyShortcuts: JSString = "ariaKeyShortcuts" + static let ariaLabel: JSString = "ariaLabel" + static let ariaLevel: JSString = "ariaLevel" + static let ariaLive: JSString = "ariaLive" + static let ariaModal: JSString = "ariaModal" + static let ariaMultiLine: JSString = "ariaMultiLine" + static let ariaMultiSelectable: JSString = "ariaMultiSelectable" + static let ariaOrientation: JSString = "ariaOrientation" + static let ariaPlaceholder: JSString = "ariaPlaceholder" + static let ariaPosInSet: JSString = "ariaPosInSet" + static let ariaPressed: JSString = "ariaPressed" + static let ariaReadOnly: JSString = "ariaReadOnly" + static let ariaRequired: JSString = "ariaRequired" + static let ariaRoleDescription: JSString = "ariaRoleDescription" + static let ariaRowCount: JSString = "ariaRowCount" + static let ariaRowIndex: JSString = "ariaRowIndex" + static let ariaRowIndexText: JSString = "ariaRowIndexText" + static let ariaRowSpan: JSString = "ariaRowSpan" + static let ariaSelected: JSString = "ariaSelected" + static let ariaSetSize: JSString = "ariaSetSize" + static let ariaSort: JSString = "ariaSort" + static let ariaValueMax: JSString = "ariaValueMax" + static let ariaValueMin: JSString = "ariaValueMin" + static let ariaValueNow: JSString = "ariaValueNow" + static let ariaValueText: JSString = "ariaValueText" + static let arrayBuffer: JSString = "arrayBuffer" + static let `as`: JSString = "as" + static let assert: JSString = "assert" + static let assign: JSString = "assign" + static let assignedElements: JSString = "assignedElements" + static let assignedNodes: JSString = "assignedNodes" + static let assignedSlot: JSString = "assignedSlot" + static let async: JSString = "async" + static let atob: JSString = "atob" + static let attachInternals: JSString = "attachInternals" + static let attachShadow: JSString = "attachShadow" + static let attrChange: JSString = "attrChange" + static let attrName: JSString = "attrName" + static let attributeFilter: JSString = "attributeFilter" + static let attributeName: JSString = "attributeName" + static let attributeNamespace: JSString = "attributeNamespace" + static let attributeOldValue: JSString = "attributeOldValue" + static let attributes: JSString = "attributes" + static let audioTracks: JSString = "audioTracks" + static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" + static let autocapitalize: JSString = "autocapitalize" + static let autocomplete: JSString = "autocomplete" + static let autofocus: JSString = "autofocus" + static let autoplay: JSString = "autoplay" + static let axis: JSString = "axis" + static let b: JSString = "b" + static let back: JSString = "back" + static let background: JSString = "background" + static let badInput: JSString = "badInput" + static let baseURI: JSString = "baseURI" + static let baseURL: JSString = "baseURL" + static let before: JSString = "before" + static let beginPath: JSString = "beginPath" + static let behavior: JSString = "behavior" + static let bezierCurveTo: JSString = "bezierCurveTo" + static let bgColor: JSString = "bgColor" + static let blob: JSString = "blob" + static let blocking: JSString = "blocking" + static let blur: JSString = "blur" + static let body: JSString = "body" + static let bodyUsed: JSString = "bodyUsed" + static let booleanValue: JSString = "booleanValue" + static let border: JSString = "border" + static let bottom: JSString = "bottom" + static let btoa: JSString = "btoa" + static let bubbles: JSString = "bubbles" + static let buffered: JSString = "buffered" + static let button: JSString = "button" + static let buttons: JSString = "buttons" + static let byobRequest: JSString = "byobRequest" + static let c: JSString = "c" + static let cache: JSString = "cache" + static let canPlayType: JSString = "canPlayType" + static let cancel: JSString = "cancel" + static let cancelAnimationFrame: JSString = "cancelAnimationFrame" + static let cancelBubble: JSString = "cancelBubble" + static let cancelable: JSString = "cancelable" + static let canvas: JSString = "canvas" + static let caption: JSString = "caption" + static let capture: JSString = "capture" + static let captureEvents: JSString = "captureEvents" + static let cellIndex: JSString = "cellIndex" + static let cellPadding: JSString = "cellPadding" + static let cellSpacing: JSString = "cellSpacing" + static let cells: JSString = "cells" + static let ch: JSString = "ch" + static let chOff: JSString = "chOff" + static let charCode: JSString = "charCode" + static let characterData: JSString = "characterData" + static let characterDataOldValue: JSString = "characterDataOldValue" + static let characterSet: JSString = "characterSet" + static let charset: JSString = "charset" + static let checkValidity: JSString = "checkValidity" + static let checked: JSString = "checked" + static let childElementCount: JSString = "childElementCount" + static let childList: JSString = "childList" + static let childNodes: JSString = "childNodes" + static let children: JSString = "children" + static let cite: JSString = "cite" + static let classList: JSString = "classList" + static let className: JSString = "className" + static let clear: JSString = "clear" + static let clearData: JSString = "clearData" + static let clearInterval: JSString = "clearInterval" + static let clearParameters: JSString = "clearParameters" + static let clearRect: JSString = "clearRect" + static let clearTimeout: JSString = "clearTimeout" + static let click: JSString = "click" + static let clientInformation: JSString = "clientInformation" + static let clientX: JSString = "clientX" + static let clientY: JSString = "clientY" + static let clip: JSString = "clip" + static let clone: JSString = "clone" + static let cloneContents: JSString = "cloneContents" + static let cloneNode: JSString = "cloneNode" + static let cloneRange: JSString = "cloneRange" + static let close: JSString = "close" + static let closePath: JSString = "closePath" + static let closed: JSString = "closed" + static let closest: JSString = "closest" + static let code: JSString = "code" + static let codeBase: JSString = "codeBase" + static let codeType: JSString = "codeType" + static let colSpan: JSString = "colSpan" + static let collapse: JSString = "collapse" + static let collapsed: JSString = "collapsed" + static let colno: JSString = "colno" + static let color: JSString = "color" + static let colorSpace: JSString = "colorSpace" + static let colorSpaceConversion: JSString = "colorSpaceConversion" + static let cols: JSString = "cols" + static let commit: JSString = "commit" + static let commonAncestorContainer: JSString = "commonAncestorContainer" + static let compact: JSString = "compact" + static let compareBoundaryPoints: JSString = "compareBoundaryPoints" + static let compareDocumentPosition: JSString = "compareDocumentPosition" + static let comparePoint: JSString = "comparePoint" + static let compatMode: JSString = "compatMode" + static let complete: JSString = "complete" + static let composed: JSString = "composed" + static let composedPath: JSString = "composedPath" + static let conditionText: JSString = "conditionText" + static let confirm: JSString = "confirm" + static let contains: JSString = "contains" + static let content: JSString = "content" + static let contentDocument: JSString = "contentDocument" + static let contentEditable: JSString = "contentEditable" + static let contentType: JSString = "contentType" + static let contentWindow: JSString = "contentWindow" + static let control: JSString = "control" + static let controls: JSString = "controls" + static let convertToBlob: JSString = "convertToBlob" + static let cookie: JSString = "cookie" + static let cookieEnabled: JSString = "cookieEnabled" + static let coords: JSString = "coords" + static let count: JSString = "count" + static let countReset: JSString = "countReset" + static let createAttribute: JSString = "createAttribute" + static let createAttributeNS: JSString = "createAttributeNS" + static let createCDATASection: JSString = "createCDATASection" + static let createCaption: JSString = "createCaption" + static let createComment: JSString = "createComment" + static let createConicGradient: JSString = "createConicGradient" + static let createDocument: JSString = "createDocument" + static let createDocumentFragment: JSString = "createDocumentFragment" + static let createDocumentType: JSString = "createDocumentType" + static let createElement: JSString = "createElement" + static let createElementNS: JSString = "createElementNS" + static let createEvent: JSString = "createEvent" + static let createHTMLDocument: JSString = "createHTMLDocument" + static let createImageBitmap: JSString = "createImageBitmap" + static let createImageData: JSString = "createImageData" + static let createLinearGradient: JSString = "createLinearGradient" + static let createObjectURL: JSString = "createObjectURL" + static let createPattern: JSString = "createPattern" + static let createProcessingInstruction: JSString = "createProcessingInstruction" + static let createRadialGradient: JSString = "createRadialGradient" + static let createRange: JSString = "createRange" + static let createTBody: JSString = "createTBody" + static let createTFoot: JSString = "createTFoot" + static let createTHead: JSString = "createTHead" + static let createTextNode: JSString = "createTextNode" + static let credentials: JSString = "credentials" + static let crossOrigin: JSString = "crossOrigin" + static let crossOriginIsolated: JSString = "crossOriginIsolated" + static let cssFloat: JSString = "cssFloat" + static let cssRules: JSString = "cssRules" + static let cssText: JSString = "cssText" + static let ctrlKey: JSString = "ctrlKey" + static let cues: JSString = "cues" + static let currentNode: JSString = "currentNode" + static let currentScript: JSString = "currentScript" + static let currentSrc: JSString = "currentSrc" + static let currentTarget: JSString = "currentTarget" + static let currentTime: JSString = "currentTime" + static let customElements: JSString = "customElements" + static let customError: JSString = "customError" + static let d: JSString = "d" + static let data: JSString = "data" + static let dataTransfer: JSString = "dataTransfer" + static let dataset: JSString = "dataset" + static let dateTime: JSString = "dateTime" + static let debug: JSString = "debug" + static let declare: JSString = "declare" + static let decode: JSString = "decode" + static let decoding: JSString = "decoding" + static let `default`: JSString = "default" + static let defaultChecked: JSString = "defaultChecked" + static let defaultMuted: JSString = "defaultMuted" + static let defaultPlaybackRate: JSString = "defaultPlaybackRate" + static let defaultPrevented: JSString = "defaultPrevented" + static let defaultSelected: JSString = "defaultSelected" + static let defaultValue: JSString = "defaultValue" + static let defaultView: JSString = "defaultView" + static let `defer`: JSString = "defer" + static let delegatesFocus: JSString = "delegatesFocus" + static let delete: JSString = "delete" + static let deleteCaption: JSString = "deleteCaption" + static let deleteCell: JSString = "deleteCell" + static let deleteContents: JSString = "deleteContents" + static let deleteData: JSString = "deleteData" + static let deleteMedium: JSString = "deleteMedium" + static let deleteRow: JSString = "deleteRow" + static let deleteRule: JSString = "deleteRule" + static let deleteTFoot: JSString = "deleteTFoot" + static let deleteTHead: JSString = "deleteTHead" + static let deltaMode: JSString = "deltaMode" + static let deltaX: JSString = "deltaX" + static let deltaY: JSString = "deltaY" + static let deltaZ: JSString = "deltaZ" + static let description: JSString = "description" + static let designMode: JSString = "designMode" + static let desiredSize: JSString = "desiredSize" + static let destination: JSString = "destination" + static let desynchronized: JSString = "desynchronized" + static let detach: JSString = "detach" + static let detail: JSString = "detail" + static let dir: JSString = "dir" + static let dirName: JSString = "dirName" + static let direction: JSString = "direction" + static let dirxml: JSString = "dirxml" + static let disabled: JSString = "disabled" + static let disconnect: JSString = "disconnect" + static let dispatchEvent: JSString = "dispatchEvent" + static let doctype: JSString = "doctype" + static let document: JSString = "document" + static let documentElement: JSString = "documentElement" + static let documentURI: JSString = "documentURI" + static let domain: JSString = "domain" + static let done: JSString = "done" + static let download: JSString = "download" + static let draggable: JSString = "draggable" + static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded" + static let drawImage: JSString = "drawImage" + static let dropEffect: JSString = "dropEffect" + static let duration: JSString = "duration" + static let e: JSString = "e" + static let effectAllowed: JSString = "effectAllowed" + static let elements: JSString = "elements" + static let ellipse: JSString = "ellipse" + static let emHeightAscent: JSString = "emHeightAscent" + static let emHeightDescent: JSString = "emHeightDescent" + static let embeds: JSString = "embeds" + static let enabled: JSString = "enabled" + static let enabledPlugin: JSString = "enabledPlugin" + static let encoding: JSString = "encoding" + static let enctype: JSString = "enctype" + static let end: JSString = "end" + static let endContainer: JSString = "endContainer" + static let endOffset: JSString = "endOffset" + static let endTime: JSString = "endTime" + static let ended: JSString = "ended" + static let endings: JSString = "endings" + static let enqueue: JSString = "enqueue" + static let enterKeyHint: JSString = "enterKeyHint" + static let error: JSString = "error" + static let escape: JSString = "escape" + static let evaluate: JSString = "evaluate" + static let event: JSString = "event" + static let eventPhase: JSString = "eventPhase" + static let execCommand: JSString = "execCommand" + static let extends: JSString = "extends" + static let external: JSString = "external" + static let extractContents: JSString = "extractContents" + static let f: JSString = "f" + static let face: JSString = "face" + static let fastSeek: JSString = "fastSeek" + static let fetch: JSString = "fetch" + static let fgColor: JSString = "fgColor" + static let filename: JSString = "filename" + static let files: JSString = "files" + static let fill: JSString = "fill" + static let fillRect: JSString = "fillRect" + static let fillStyle: JSString = "fillStyle" + static let fillText: JSString = "fillText" + static let filter: JSString = "filter" + static let firstChild: JSString = "firstChild" + static let firstElementChild: JSString = "firstElementChild" + static let flatten: JSString = "flatten" + static let flipX: JSString = "flipX" + static let flipY: JSString = "flipY" + static let flush: JSString = "flush" + static let focus: JSString = "focus" + static let font: JSString = "font" + static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" + static let fontBoundingBoxDescent: JSString = "fontBoundingBoxDescent" + static let fontKerning: JSString = "fontKerning" + static let fontStretch: JSString = "fontStretch" + static let fontVariantCaps: JSString = "fontVariantCaps" + static let form: JSString = "form" + static let formAction: JSString = "formAction" + static let formData: JSString = "formData" + static let formEnctype: JSString = "formEnctype" + static let formMethod: JSString = "formMethod" + static let formNoValidate: JSString = "formNoValidate" + static let formTarget: JSString = "formTarget" + static let forms: JSString = "forms" + static let forward: JSString = "forward" + static let frame: JSString = "frame" + static let frameBorder: JSString = "frameBorder" + static let frameElement: JSString = "frameElement" + static let frames: JSString = "frames" + static let fromFloat32Array: JSString = "fromFloat32Array" + static let fromFloat64Array: JSString = "fromFloat64Array" + static let fromMatrix: JSString = "fromMatrix" + static let fromPoint: JSString = "fromPoint" + static let fromQuad: JSString = "fromQuad" + static let fromRect: JSString = "fromRect" + static let get: JSString = "get" + static let getAll: JSString = "getAll" + static let getAllResponseHeaders: JSString = "getAllResponseHeaders" + static let getAsFile: JSString = "getAsFile" + static let getAttribute: JSString = "getAttribute" + static let getAttributeNS: JSString = "getAttributeNS" + static let getAttributeNames: JSString = "getAttributeNames" + static let getAttributeNode: JSString = "getAttributeNode" + static let getAttributeNodeNS: JSString = "getAttributeNodeNS" + static let getBounds: JSString = "getBounds" + static let getComputedStyle: JSString = "getComputedStyle" + static let getContext: JSString = "getContext" + static let getContextAttributes: JSString = "getContextAttributes" + static let getCueById: JSString = "getCueById" + static let getData: JSString = "getData" + static let getElementById: JSString = "getElementById" + static let getElementsByClassName: JSString = "getElementsByClassName" + static let getElementsByName: JSString = "getElementsByName" + static let getElementsByTagName: JSString = "getElementsByTagName" + static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" + static let getImageData: JSString = "getImageData" + static let getLineDash: JSString = "getLineDash" + static let getModifierState: JSString = "getModifierState" + static let getNamedItemNS: JSString = "getNamedItemNS" + static let getParameter: JSString = "getParameter" + static let getPropertyPriority: JSString = "getPropertyPriority" + static let getPropertyValue: JSString = "getPropertyValue" + static let getReader: JSString = "getReader" + static let getResponseHeader: JSString = "getResponseHeader" + static let getRootNode: JSString = "getRootNode" + static let getSVGDocument: JSString = "getSVGDocument" + static let getStartDate: JSString = "getStartDate" + static let getTrackById: JSString = "getTrackById" + static let getTransform: JSString = "getTransform" + static let getWriter: JSString = "getWriter" + static let globalAlpha: JSString = "globalAlpha" + static let globalCompositeOperation: JSString = "globalCompositeOperation" + static let go: JSString = "go" + static let group: JSString = "group" + static let groupCollapsed: JSString = "groupCollapsed" + static let groupEnd: JSString = "groupEnd" + static let hangingBaseline: JSString = "hangingBaseline" + static let hardwareConcurrency: JSString = "hardwareConcurrency" + static let has: JSString = "has" + static let hasAttribute: JSString = "hasAttribute" + static let hasAttributeNS: JSString = "hasAttributeNS" + static let hasAttributes: JSString = "hasAttributes" + static let hasChildNodes: JSString = "hasChildNodes" + static let hasFeature: JSString = "hasFeature" + static let hasFocus: JSString = "hasFocus" + static let hash: JSString = "hash" + static let head: JSString = "head" + static let headers: JSString = "headers" + static let height: JSString = "height" + static let hidden: JSString = "hidden" + static let high: JSString = "high" + static let highWaterMark: JSString = "highWaterMark" + static let history: JSString = "history" + static let host: JSString = "host" + static let hostname: JSString = "hostname" + static let href: JSString = "href" + static let hreflang: JSString = "hreflang" + static let hspace: JSString = "hspace" + static let htmlFor: JSString = "htmlFor" + static let httpEquiv: JSString = "httpEquiv" + static let id: JSString = "id" + static let ideographicBaseline: JSString = "ideographicBaseline" + static let imageOrientation: JSString = "imageOrientation" + static let imageSizes: JSString = "imageSizes" + static let imageSmoothingEnabled: JSString = "imageSmoothingEnabled" + static let imageSmoothingQuality: JSString = "imageSmoothingQuality" + static let imageSrcset: JSString = "imageSrcset" + static let images: JSString = "images" + static let implementation: JSString = "implementation" + static let importNode: JSString = "importNode" + static let importScripts: JSString = "importScripts" + static let importStylesheet: JSString = "importStylesheet" + static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" + static let indeterminate: JSString = "indeterminate" + static let index: JSString = "index" + static let inert: JSString = "inert" + static let info: JSString = "info" + static let initCompositionEvent: JSString = "initCompositionEvent" + static let initCustomEvent: JSString = "initCustomEvent" + static let initEvent: JSString = "initEvent" + static let initKeyboardEvent: JSString = "initKeyboardEvent" + static let initMessageEvent: JSString = "initMessageEvent" + static let initMouseEvent: JSString = "initMouseEvent" + static let initMutationEvent: JSString = "initMutationEvent" + static let initStorageEvent: JSString = "initStorageEvent" + static let initUIEvent: JSString = "initUIEvent" + static let innerText: JSString = "innerText" + static let inputEncoding: JSString = "inputEncoding" + static let inputMode: JSString = "inputMode" + static let inputType: JSString = "inputType" + static let insertAdjacentElement: JSString = "insertAdjacentElement" + static let insertAdjacentText: JSString = "insertAdjacentText" + static let insertBefore: JSString = "insertBefore" + static let insertCell: JSString = "insertCell" + static let insertData: JSString = "insertData" + static let insertNode: JSString = "insertNode" + static let insertRow: JSString = "insertRow" + static let insertRule: JSString = "insertRule" + static let integrity: JSString = "integrity" + static let intersectsNode: JSString = "intersectsNode" + static let invalidIteratorState: JSString = "invalidIteratorState" + static let inverse: JSString = "inverse" + static let invertSelf: JSString = "invertSelf" + static let `is`: JSString = "is" + static let is2D: JSString = "is2D" + static let isComposing: JSString = "isComposing" + static let isConnected: JSString = "isConnected" + static let isContentEditable: JSString = "isContentEditable" + static let isContextLost: JSString = "isContextLost" + static let isDefaultNamespace: JSString = "isDefaultNamespace" + static let isEqualNode: JSString = "isEqualNode" + static let isHistoryNavigation: JSString = "isHistoryNavigation" + static let isIdentity: JSString = "isIdentity" + static let isMap: JSString = "isMap" + static let isPointInPath: JSString = "isPointInPath" + static let isPointInRange: JSString = "isPointInRange" + static let isPointInStroke: JSString = "isPointInStroke" + static let isReloadNavigation: JSString = "isReloadNavigation" + static let isSameNode: JSString = "isSameNode" + static let isSecureContext: JSString = "isSecureContext" + static let isTrusted: JSString = "isTrusted" + static let item: JSString = "item" + static let items: JSString = "items" + static let iterateNext: JSString = "iterateNext" + static let javaEnabled: JSString = "javaEnabled" + static let json: JSString = "json" + static let keepalive: JSString = "keepalive" + static let key: JSString = "key" + static let keyCode: JSString = "keyCode" + static let kind: JSString = "kind" + static let label: JSString = "label" + static let labels: JSString = "labels" + static let lang: JSString = "lang" + static let language: JSString = "language" + static let languages: JSString = "languages" + static let lastChild: JSString = "lastChild" + static let lastElementChild: JSString = "lastElementChild" + static let lastEventId: JSString = "lastEventId" + static let lastModified: JSString = "lastModified" + static let left: JSString = "left" + static let length: JSString = "length" + static let lengthComputable: JSString = "lengthComputable" + static let letterSpacing: JSString = "letterSpacing" + static let lineCap: JSString = "lineCap" + static let lineDashOffset: JSString = "lineDashOffset" + static let lineJoin: JSString = "lineJoin" + static let lineTo: JSString = "lineTo" + static let lineWidth: JSString = "lineWidth" + static let lineno: JSString = "lineno" + static let link: JSString = "link" + static let linkColor: JSString = "linkColor" + static let links: JSString = "links" + static let list: JSString = "list" + static let load: JSString = "load" + static let loaded: JSString = "loaded" + static let loading: JSString = "loading" + static let localName: JSString = "localName" + static let localStorage: JSString = "localStorage" + static let location: JSString = "location" + static let locationbar: JSString = "locationbar" + static let locked: JSString = "locked" + static let log: JSString = "log" + static let longDesc: JSString = "longDesc" + static let lookupNamespaceURI: JSString = "lookupNamespaceURI" + static let lookupPrefix: JSString = "lookupPrefix" + static let loop: JSString = "loop" + static let low: JSString = "low" + static let lowsrc: JSString = "lowsrc" + static let m11: JSString = "m11" + static let m12: JSString = "m12" + static let m13: JSString = "m13" + static let m14: JSString = "m14" + static let m21: JSString = "m21" + static let m22: JSString = "m22" + static let m23: JSString = "m23" + static let m24: JSString = "m24" + static let m31: JSString = "m31" + static let m32: JSString = "m32" + static let m33: JSString = "m33" + static let m34: JSString = "m34" + static let m41: JSString = "m41" + static let m42: JSString = "m42" + static let m43: JSString = "m43" + static let m44: JSString = "m44" + static let marginHeight: JSString = "marginHeight" + static let marginWidth: JSString = "marginWidth" + static let matches: JSString = "matches" + static let matrixTransform: JSString = "matrixTransform" + static let max: JSString = "max" + static let maxLength: JSString = "maxLength" + static let measureText: JSString = "measureText" + static let media: JSString = "media" + static let mediaText: JSString = "mediaText" + static let menubar: JSString = "menubar" + static let message: JSString = "message" + static let metaKey: JSString = "metaKey" + static let method: JSString = "method" + static let mimeTypes: JSString = "mimeTypes" + static let min: JSString = "min" + static let minLength: JSString = "minLength" + static let miterLimit: JSString = "miterLimit" + static let mode: JSString = "mode" + static let modifierAltGraph: JSString = "modifierAltGraph" + static let modifierCapsLock: JSString = "modifierCapsLock" + static let modifierFn: JSString = "modifierFn" + static let modifierFnLock: JSString = "modifierFnLock" + static let modifierHyper: JSString = "modifierHyper" + static let modifierNumLock: JSString = "modifierNumLock" + static let modifierScrollLock: JSString = "modifierScrollLock" + static let modifierSuper: JSString = "modifierSuper" + static let modifierSymbol: JSString = "modifierSymbol" + static let modifierSymbolLock: JSString = "modifierSymbolLock" + static let moveTo: JSString = "moveTo" + static let multiple: JSString = "multiple" + static let multiply: JSString = "multiply" + static let multiplySelf: JSString = "multiplySelf" + static let muted: JSString = "muted" + static let name: JSString = "name" + static let namedItem: JSString = "namedItem" + static let namespaceURI: JSString = "namespaceURI" + static let naturalHeight: JSString = "naturalHeight" + static let naturalWidth: JSString = "naturalWidth" + static let navigator: JSString = "navigator" + static let networkState: JSString = "networkState" + static let newURL: JSString = "newURL" + static let newValue: JSString = "newValue" + static let nextElementSibling: JSString = "nextElementSibling" + static let nextNode: JSString = "nextNode" + static let nextSibling: JSString = "nextSibling" + static let noHref: JSString = "noHref" + static let noModule: JSString = "noModule" + static let noResize: JSString = "noResize" + static let noShade: JSString = "noShade" + static let noValidate: JSString = "noValidate" + static let noWrap: JSString = "noWrap" + static let nodeName: JSString = "nodeName" + static let nodeType: JSString = "nodeType" + static let nodeValue: JSString = "nodeValue" + static let nonce: JSString = "nonce" + static let normalize: JSString = "normalize" + static let now: JSString = "now" + static let numberValue: JSString = "numberValue" + static let observe: JSString = "observe" + static let ok: JSString = "ok" + static let oldURL: JSString = "oldURL" + static let oldValue: JSString = "oldValue" + static let onLine: JSString = "onLine" + static let onabort: JSString = "onabort" + static let onaddtrack: JSString = "onaddtrack" + static let onafterprint: JSString = "onafterprint" + static let onauxclick: JSString = "onauxclick" + static let onbeforeprint: JSString = "onbeforeprint" + static let onbeforeunload: JSString = "onbeforeunload" + static let onblur: JSString = "onblur" + static let oncancel: JSString = "oncancel" + static let oncanplay: JSString = "oncanplay" + static let oncanplaythrough: JSString = "oncanplaythrough" + static let once: JSString = "once" + static let onchange: JSString = "onchange" + static let onclick: JSString = "onclick" + static let onclose: JSString = "onclose" + static let onconnect: JSString = "onconnect" + static let oncontextlost: JSString = "oncontextlost" + static let oncontextmenu: JSString = "oncontextmenu" + static let oncontextrestored: JSString = "oncontextrestored" + static let oncopy: JSString = "oncopy" + static let oncuechange: JSString = "oncuechange" + static let oncut: JSString = "oncut" + static let ondblclick: JSString = "ondblclick" + static let ondrag: JSString = "ondrag" + static let ondragend: JSString = "ondragend" + static let ondragenter: JSString = "ondragenter" + static let ondragleave: JSString = "ondragleave" + static let ondragover: JSString = "ondragover" + static let ondragstart: JSString = "ondragstart" + static let ondrop: JSString = "ondrop" + static let ondurationchange: JSString = "ondurationchange" + static let onemptied: JSString = "onemptied" + static let onended: JSString = "onended" + static let onenter: JSString = "onenter" + static let onerror: JSString = "onerror" + static let onexit: JSString = "onexit" + static let onfocus: JSString = "onfocus" + static let onformdata: JSString = "onformdata" + static let onhashchange: JSString = "onhashchange" + static let oninput: JSString = "oninput" + static let oninvalid: JSString = "oninvalid" + static let onkeydown: JSString = "onkeydown" + static let onkeypress: JSString = "onkeypress" + static let onkeyup: JSString = "onkeyup" + static let onlanguagechange: JSString = "onlanguagechange" + static let onload: JSString = "onload" + static let onloadeddata: JSString = "onloadeddata" + static let onloadedmetadata: JSString = "onloadedmetadata" + static let onloadend: JSString = "onloadend" + static let onloadstart: JSString = "onloadstart" + static let onmessage: JSString = "onmessage" + static let onmessageerror: JSString = "onmessageerror" + static let onmousedown: JSString = "onmousedown" + static let onmouseenter: JSString = "onmouseenter" + static let onmouseleave: JSString = "onmouseleave" + static let onmousemove: JSString = "onmousemove" + static let onmouseout: JSString = "onmouseout" + static let onmouseover: JSString = "onmouseover" + static let onmouseup: JSString = "onmouseup" + static let onoffline: JSString = "onoffline" + static let ononline: JSString = "ononline" + static let onopen: JSString = "onopen" + static let onpagehide: JSString = "onpagehide" + static let onpageshow: JSString = "onpageshow" + static let onpaste: JSString = "onpaste" + static let onpause: JSString = "onpause" + static let onplay: JSString = "onplay" + static let onplaying: JSString = "onplaying" + static let onpopstate: JSString = "onpopstate" + static let onprogress: JSString = "onprogress" + static let onratechange: JSString = "onratechange" + static let onreadystatechange: JSString = "onreadystatechange" + static let onrejectionhandled: JSString = "onrejectionhandled" + static let onremovetrack: JSString = "onremovetrack" + static let onreset: JSString = "onreset" + static let onresize: JSString = "onresize" + static let onscroll: JSString = "onscroll" + static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" + static let onseeked: JSString = "onseeked" + static let onseeking: JSString = "onseeking" + static let onselect: JSString = "onselect" + static let onslotchange: JSString = "onslotchange" + static let onstalled: JSString = "onstalled" + static let onstorage: JSString = "onstorage" + static let onsubmit: JSString = "onsubmit" + static let onsuspend: JSString = "onsuspend" + static let ontimeout: JSString = "ontimeout" + static let ontimeupdate: JSString = "ontimeupdate" + static let ontoggle: JSString = "ontoggle" + static let onunhandledrejection: JSString = "onunhandledrejection" + static let onunload: JSString = "onunload" + static let onvisibilitychange: JSString = "onvisibilitychange" + static let onvolumechange: JSString = "onvolumechange" + static let onwaiting: JSString = "onwaiting" + static let onwebkitanimationend: JSString = "onwebkitanimationend" + static let onwebkitanimationiteration: JSString = "onwebkitanimationiteration" + static let onwebkitanimationstart: JSString = "onwebkitanimationstart" + static let onwebkittransitionend: JSString = "onwebkittransitionend" + static let onwheel: JSString = "onwheel" + static let open: JSString = "open" + static let opener: JSString = "opener" + static let optimum: JSString = "optimum" + static let options: JSString = "options" + static let origin: JSString = "origin" + static let originAgentCluster: JSString = "originAgentCluster" + static let oscpu: JSString = "oscpu" + static let outerText: JSString = "outerText" + static let overrideMimeType: JSString = "overrideMimeType" + static let ownerDocument: JSString = "ownerDocument" + static let ownerElement: JSString = "ownerElement" + static let ownerNode: JSString = "ownerNode" + static let ownerRule: JSString = "ownerRule" + static let p1: JSString = "p1" + static let p2: JSString = "p2" + static let p3: JSString = "p3" + static let p4: JSString = "p4" + static let parent: JSString = "parent" + static let parentElement: JSString = "parentElement" + static let parentNode: JSString = "parentNode" + static let parentRule: JSString = "parentRule" + static let parentStyleSheet: JSString = "parentStyleSheet" + static let parseFromString: JSString = "parseFromString" + static let passive: JSString = "passive" + static let password: JSString = "password" + static let pathname: JSString = "pathname" + static let pattern: JSString = "pattern" + static let patternMismatch: JSString = "patternMismatch" + static let pause: JSString = "pause" + static let pauseOnExit: JSString = "pauseOnExit" + static let paused: JSString = "paused" + static let pdfViewerEnabled: JSString = "pdfViewerEnabled" + static let performance: JSString = "performance" + static let persisted: JSString = "persisted" + static let personalbar: JSString = "personalbar" + static let ping: JSString = "ping" + static let pipeThrough: JSString = "pipeThrough" + static let pipeTo: JSString = "pipeTo" + static let placeholder: JSString = "placeholder" + static let platform: JSString = "platform" + static let play: JSString = "play" + static let playbackRate: JSString = "playbackRate" + static let played: JSString = "played" + static let playsInline: JSString = "playsInline" + static let plugins: JSString = "plugins" + static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" + static let port: JSString = "port" + static let port1: JSString = "port1" + static let port2: JSString = "port2" + static let ports: JSString = "ports" + static let position: JSString = "position" + static let postMessage: JSString = "postMessage" + static let poster: JSString = "poster" + static let preMultiplySelf: JSString = "preMultiplySelf" + static let prefix: JSString = "prefix" + static let preload: JSString = "preload" + static let premultiplyAlpha: JSString = "premultiplyAlpha" + static let prepend: JSString = "prepend" + static let preservesPitch: JSString = "preservesPitch" + static let prevValue: JSString = "prevValue" + static let preventAbort: JSString = "preventAbort" + static let preventCancel: JSString = "preventCancel" + static let preventClose: JSString = "preventClose" + static let preventDefault: JSString = "preventDefault" + static let preventScroll: JSString = "preventScroll" + static let previousElementSibling: JSString = "previousElementSibling" + static let previousNode: JSString = "previousNode" + static let previousSibling: JSString = "previousSibling" + static let print: JSString = "print" + static let product: JSString = "product" + static let productSub: JSString = "productSub" + static let promise: JSString = "promise" + static let prompt: JSString = "prompt" + static let `protocol`: JSString = "protocol" + static let publicId: JSString = "publicId" + static let pull: JSString = "pull" + static let pushState: JSString = "pushState" + static let putImageData: JSString = "putImageData" + static let quadraticCurveTo: JSString = "quadraticCurveTo" + static let quality: JSString = "quality" + static let queryCommandEnabled: JSString = "queryCommandEnabled" + static let queryCommandIndeterm: JSString = "queryCommandIndeterm" + static let queryCommandState: JSString = "queryCommandState" + static let queryCommandSupported: JSString = "queryCommandSupported" + static let queryCommandValue: JSString = "queryCommandValue" + static let querySelector: JSString = "querySelector" + static let querySelectorAll: JSString = "querySelectorAll" + static let rangeOverflow: JSString = "rangeOverflow" + static let rangeUnderflow: JSString = "rangeUnderflow" + static let read: JSString = "read" + static let readAsArrayBuffer: JSString = "readAsArrayBuffer" + static let readAsBinaryString: JSString = "readAsBinaryString" + static let readAsDataURL: JSString = "readAsDataURL" + static let readAsText: JSString = "readAsText" + static let readOnly: JSString = "readOnly" + static let readable: JSString = "readable" + static let readableType: JSString = "readableType" + static let ready: JSString = "ready" + static let readyState: JSString = "readyState" + static let reason: JSString = "reason" + static let rect: JSString = "rect" + static let redirect: JSString = "redirect" + static let redirected: JSString = "redirected" + static let referenceNode: JSString = "referenceNode" + static let referrer: JSString = "referrer" + static let referrerPolicy: JSString = "referrerPolicy" + static let refresh: JSString = "refresh" + static let registerProtocolHandler: JSString = "registerProtocolHandler" + static let rel: JSString = "rel" + static let relList: JSString = "relList" + static let relatedNode: JSString = "relatedNode" + static let relatedTarget: JSString = "relatedTarget" + static let releaseEvents: JSString = "releaseEvents" + static let releaseLock: JSString = "releaseLock" + static let reload: JSString = "reload" + static let remove: JSString = "remove" + static let removeAttribute: JSString = "removeAttribute" + static let removeAttributeNS: JSString = "removeAttributeNS" + static let removeAttributeNode: JSString = "removeAttributeNode" + static let removeChild: JSString = "removeChild" + static let removeCue: JSString = "removeCue" + static let removeNamedItem: JSString = "removeNamedItem" + static let removeNamedItemNS: JSString = "removeNamedItemNS" + static let removeParameter: JSString = "removeParameter" + static let removeProperty: JSString = "removeProperty" + static let removeRule: JSString = "removeRule" + static let removedNodes: JSString = "removedNodes" + static let `repeat`: JSString = "repeat" + static let replace: JSString = "replace" + static let replaceChild: JSString = "replaceChild" + static let replaceChildren: JSString = "replaceChildren" + static let replaceData: JSString = "replaceData" + static let replaceState: JSString = "replaceState" + static let replaceSync: JSString = "replaceSync" + static let replaceWith: JSString = "replaceWith" + static let reportError: JSString = "reportError" + static let reportValidity: JSString = "reportValidity" + static let requestSubmit: JSString = "requestSubmit" + static let required: JSString = "required" + static let reset: JSString = "reset" + static let resetTransform: JSString = "resetTransform" + static let resizeHeight: JSString = "resizeHeight" + static let resizeQuality: JSString = "resizeQuality" + static let resizeWidth: JSString = "resizeWidth" + static let respond: JSString = "respond" + static let respondWithNewView: JSString = "respondWithNewView" + static let response: JSString = "response" + static let responseText: JSString = "responseText" + static let responseType: JSString = "responseType" + static let responseURL: JSString = "responseURL" + static let responseXML: JSString = "responseXML" + static let restore: JSString = "restore" + static let result: JSString = "result" + static let resultType: JSString = "resultType" + static let returnValue: JSString = "returnValue" + static let rev: JSString = "rev" + static let reversed: JSString = "reversed" + static let revokeObjectURL: JSString = "revokeObjectURL" + static let right: JSString = "right" + static let role: JSString = "role" + static let root: JSString = "root" + static let rotate: JSString = "rotate" + static let rotateAxisAngle: JSString = "rotateAxisAngle" + static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" + static let rotateFromVector: JSString = "rotateFromVector" + static let rotateFromVectorSelf: JSString = "rotateFromVectorSelf" + static let rotateSelf: JSString = "rotateSelf" + static let roundRect: JSString = "roundRect" + static let rowIndex: JSString = "rowIndex" + static let rowSpan: JSString = "rowSpan" + static let rows: JSString = "rows" + static let rules: JSString = "rules" + static let sandbox: JSString = "sandbox" + static let save: JSString = "save" + static let scale: JSString = "scale" + static let scale3d: JSString = "scale3d" + static let scale3dSelf: JSString = "scale3dSelf" + static let scaleNonUniform: JSString = "scaleNonUniform" + static let scaleSelf: JSString = "scaleSelf" + static let scheme: JSString = "scheme" + static let scope: JSString = "scope" + static let screenX: JSString = "screenX" + static let screenY: JSString = "screenY" + static let scripts: JSString = "scripts" + static let scrollAmount: JSString = "scrollAmount" + static let scrollDelay: JSString = "scrollDelay" + static let scrollPathIntoView: JSString = "scrollPathIntoView" + static let scrollRestoration: JSString = "scrollRestoration" + static let scrollbars: JSString = "scrollbars" + static let scrolling: JSString = "scrolling" + static let search: JSString = "search" + static let sectionRowIndex: JSString = "sectionRowIndex" + static let seekable: JSString = "seekable" + static let seeking: JSString = "seeking" + static let select: JSString = "select" + static let selectNode: JSString = "selectNode" + static let selectNodeContents: JSString = "selectNodeContents" + static let selected: JSString = "selected" + static let selectedIndex: JSString = "selectedIndex" + static let selectedOptions: JSString = "selectedOptions" + static let selectionDirection: JSString = "selectionDirection" + static let selectionEnd: JSString = "selectionEnd" + static let selectionStart: JSString = "selectionStart" + static let selectorText: JSString = "selectorText" + static let send: JSString = "send" + static let sessionStorage: JSString = "sessionStorage" + static let set: JSString = "set" + static let setAttribute: JSString = "setAttribute" + static let setAttributeNS: JSString = "setAttributeNS" + static let setAttributeNode: JSString = "setAttributeNode" + static let setAttributeNodeNS: JSString = "setAttributeNodeNS" + static let setCustomValidity: JSString = "setCustomValidity" + static let setData: JSString = "setData" + static let setDragImage: JSString = "setDragImage" + static let setEnd: JSString = "setEnd" + static let setEndAfter: JSString = "setEndAfter" + static let setEndBefore: JSString = "setEndBefore" + static let setFormValue: JSString = "setFormValue" + static let setInterval: JSString = "setInterval" + static let setLineDash: JSString = "setLineDash" + static let setMatrixValue: JSString = "setMatrixValue" + static let setNamedItem: JSString = "setNamedItem" + static let setNamedItemNS: JSString = "setNamedItemNS" + static let setParameter: JSString = "setParameter" + static let setProperty: JSString = "setProperty" + static let setRangeText: JSString = "setRangeText" + static let setRequestHeader: JSString = "setRequestHeader" + static let setSelectionRange: JSString = "setSelectionRange" + static let setStart: JSString = "setStart" + static let setStartAfter: JSString = "setStartAfter" + static let setStartBefore: JSString = "setStartBefore" + static let setTimeout: JSString = "setTimeout" + static let setTransform: JSString = "setTransform" + static let setValidity: JSString = "setValidity" + static let shadowBlur: JSString = "shadowBlur" + static let shadowColor: JSString = "shadowColor" + static let shadowOffsetX: JSString = "shadowOffsetX" + static let shadowOffsetY: JSString = "shadowOffsetY" + static let shadowRoot: JSString = "shadowRoot" + static let shape: JSString = "shape" + static let sheet: JSString = "sheet" + static let shiftKey: JSString = "shiftKey" + static let show: JSString = "show" + static let showModal: JSString = "showModal" + static let showPicker: JSString = "showPicker" + static let signal: JSString = "signal" + static let singleNodeValue: JSString = "singleNodeValue" + static let size: JSString = "size" + static let sizes: JSString = "sizes" + static let skewX: JSString = "skewX" + static let skewXSelf: JSString = "skewXSelf" + static let skewY: JSString = "skewY" + static let skewYSelf: JSString = "skewYSelf" + static let slice: JSString = "slice" + static let slot: JSString = "slot" + static let slotAssignment: JSString = "slotAssignment" + static let snapshotItem: JSString = "snapshotItem" + static let snapshotLength: JSString = "snapshotLength" + static let source: JSString = "source" + static let span: JSString = "span" + static let specified: JSString = "specified" + static let spellcheck: JSString = "spellcheck" + static let splitText: JSString = "splitText" + static let src: JSString = "src" + static let srcElement: JSString = "srcElement" + static let srcObject: JSString = "srcObject" + static let srcdoc: JSString = "srcdoc" + static let srclang: JSString = "srclang" + static let srcset: JSString = "srcset" + static let standby: JSString = "standby" + static let start: JSString = "start" + static let startContainer: JSString = "startContainer" + static let startOffset: JSString = "startOffset" + static let startTime: JSString = "startTime" + static let state: JSString = "state" + static let status: JSString = "status" + static let statusText: JSString = "statusText" + static let statusbar: JSString = "statusbar" + static let step: JSString = "step" + static let stepDown: JSString = "stepDown" + static let stepMismatch: JSString = "stepMismatch" + static let stepUp: JSString = "stepUp" + static let stop: JSString = "stop" + static let stopImmediatePropagation: JSString = "stopImmediatePropagation" + static let stopPropagation: JSString = "stopPropagation" + static let storageArea: JSString = "storageArea" + static let stream: JSString = "stream" + static let stringValue: JSString = "stringValue" + static let stroke: JSString = "stroke" + static let strokeRect: JSString = "strokeRect" + static let strokeStyle: JSString = "strokeStyle" + static let strokeText: JSString = "strokeText" + static let structuredClone: JSString = "structuredClone" + static let style: JSString = "style" + static let styleSheet: JSString = "styleSheet" + static let styleSheets: JSString = "styleSheets" + static let submit: JSString = "submit" + static let submitter: JSString = "submitter" + static let substringData: JSString = "substringData" + static let subtree: JSString = "subtree" + static let suffixes: JSString = "suffixes" + static let summary: JSString = "summary" + static let supports: JSString = "supports" + static let surroundContents: JSString = "surroundContents" + static let systemId: JSString = "systemId" + static let tBodies: JSString = "tBodies" + static let tFoot: JSString = "tFoot" + static let tHead: JSString = "tHead" + static let tabIndex: JSString = "tabIndex" + static let table: JSString = "table" + static let tagName: JSString = "tagName" + static let taintEnabled: JSString = "taintEnabled" + static let takeRecords: JSString = "takeRecords" + static let target: JSString = "target" + static let targetOrigin: JSString = "targetOrigin" + static let tee: JSString = "tee" + static let terminate: JSString = "terminate" + static let text: JSString = "text" + static let textAlign: JSString = "textAlign" + static let textBaseline: JSString = "textBaseline" + static let textContent: JSString = "textContent" + static let textLength: JSString = "textLength" + static let textRendering: JSString = "textRendering" + static let textTracks: JSString = "textTracks" + static let throwIfAborted: JSString = "throwIfAborted" + static let time: JSString = "time" + static let timeEnd: JSString = "timeEnd" + static let timeLog: JSString = "timeLog" + static let timeOrigin: JSString = "timeOrigin" + static let timeStamp: JSString = "timeStamp" + static let timeout: JSString = "timeout" + static let title: JSString = "title" + static let toDataURL: JSString = "toDataURL" + static let toFloat32Array: JSString = "toFloat32Array" + static let toFloat64Array: JSString = "toFloat64Array" + static let toJSON: JSString = "toJSON" + static let toString: JSString = "toString" + static let toggle: JSString = "toggle" + static let toggleAttribute: JSString = "toggleAttribute" + static let tooLong: JSString = "tooLong" + static let tooShort: JSString = "tooShort" + static let toolbar: JSString = "toolbar" + static let top: JSString = "top" + static let total: JSString = "total" + static let trace: JSString = "trace" + static let track: JSString = "track" + static let transfer: JSString = "transfer" + static let transferControlToOffscreen: JSString = "transferControlToOffscreen" + static let transferFromImageBitmap: JSString = "transferFromImageBitmap" + static let transferToImageBitmap: JSString = "transferToImageBitmap" + static let transform: JSString = "transform" + static let transformPoint: JSString = "transformPoint" + static let transformToDocument: JSString = "transformToDocument" + static let transformToFragment: JSString = "transformToFragment" + static let translate: JSString = "translate" + static let translateSelf: JSString = "translateSelf" + static let trueSpeed: JSString = "trueSpeed" + static let type: JSString = "type" + static let typeMismatch: JSString = "typeMismatch" + static let types: JSString = "types" + static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" + static let upgrade: JSString = "upgrade" + static let upload: JSString = "upload" + static let url: JSString = "url" + static let useMap: JSString = "useMap" + static let userAgent: JSString = "userAgent" + static let username: JSString = "username" + static let vAlign: JSString = "vAlign" + static let vLink: JSString = "vLink" + static let valid: JSString = "valid" + static let validationMessage: JSString = "validationMessage" + static let validity: JSString = "validity" + static let value: JSString = "value" + static let valueAsDate: JSString = "valueAsDate" + static let valueAsNumber: JSString = "valueAsNumber" + static let valueMissing: JSString = "valueMissing" + static let valueType: JSString = "valueType" + static let vendor: JSString = "vendor" + static let vendorSub: JSString = "vendorSub" + static let version: JSString = "version" + static let videoHeight: JSString = "videoHeight" + static let videoTracks: JSString = "videoTracks" + static let videoWidth: JSString = "videoWidth" + static let view: JSString = "view" + static let visibilityState: JSString = "visibilityState" + static let visible: JSString = "visible" + static let vlinkColor: JSString = "vlinkColor" + static let volume: JSString = "volume" + static let vspace: JSString = "vspace" + static let w: JSString = "w" + static let warn: JSString = "warn" + static let webkitMatchesSelector: JSString = "webkitMatchesSelector" + static let whatToShow: JSString = "whatToShow" + static let which: JSString = "which" + static let wholeText: JSString = "wholeText" + static let width: JSString = "width" + static let willReadFrequently: JSString = "willReadFrequently" + static let willValidate: JSString = "willValidate" + static let window: JSString = "window" + static let withCredentials: JSString = "withCredentials" + static let wordSpacing: JSString = "wordSpacing" + static let wrap: JSString = "wrap" + static let writable: JSString = "writable" + static let writableType: JSString = "writableType" + static let write: JSString = "write" + static let writeln: JSString = "writeln" + static let x: JSString = "x" + static let y: JSString = "y" + static let z: JSString = "z" +} diff --git a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift index 79aaaf40..ebace7bd 100644 --- a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift +++ b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class StructuredSerializeOptions: BridgedDictionary { - private enum Keys { - static let transfer: JSString = "transfer" - } - public convenience init(transfer: [JSObject]) { let object = JSObject.global.Object.function!.new() - object[Keys.transfer] = transfer.jsValue() + object[Strings.transfer] = transfer.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _transfer = ReadWriteAttribute(jsObject: object, name: Keys.transfer) + _transfer = ReadWriteAttribute(jsObject: object, name: Strings.transfer) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StyleSheet.swift b/Sources/DOMKit/WebIDL/StyleSheet.swift index 3d7ceb07..b706f27b 100644 --- a/Sources/DOMKit/WebIDL/StyleSheet.swift +++ b/Sources/DOMKit/WebIDL/StyleSheet.swift @@ -6,26 +6,16 @@ import JavaScriptKit public class StyleSheet: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.StyleSheet.function! } - private enum Keys { - static let disabled: JSString = "disabled" - static let href: JSString = "href" - static let media: JSString = "media" - static let ownerNode: JSString = "ownerNode" - static let parentStyleSheet: JSString = "parentStyleSheet" - static let title: JSString = "title" - static let type: JSString = "type" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Keys.type) - _href = ReadonlyAttribute(jsObject: jsObject, name: Keys.href) - _ownerNode = ReadonlyAttribute(jsObject: jsObject, name: Keys.ownerNode) - _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: Keys.parentStyleSheet) - _title = ReadonlyAttribute(jsObject: jsObject, name: Keys.title) - _media = ReadonlyAttribute(jsObject: jsObject, name: Keys.media) - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Keys.disabled) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _href = ReadonlyAttribute(jsObject: jsObject, name: Strings.href) + _ownerNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerNode) + _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentStyleSheet) + _title = ReadonlyAttribute(jsObject: jsObject, name: Strings.title) + _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) + _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/StyleSheetList.swift b/Sources/DOMKit/WebIDL/StyleSheetList.swift index 41acf789..41054c22 100644 --- a/Sources/DOMKit/WebIDL/StyleSheetList.swift +++ b/Sources/DOMKit/WebIDL/StyleSheetList.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class StyleSheetList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.StyleSheetList.function! } - private enum Keys { - static let item: JSString = "item" - static let length: JSString = "length" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/SubmitEvent.swift b/Sources/DOMKit/WebIDL/SubmitEvent.swift index 00542482..3e7752be 100644 --- a/Sources/DOMKit/WebIDL/SubmitEvent.swift +++ b/Sources/DOMKit/WebIDL/SubmitEvent.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class SubmitEvent: Event { override public class var constructor: JSFunction { JSObject.global.SubmitEvent.function! } - private enum Keys { - static let submitter: JSString = "submitter" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _submitter = ReadonlyAttribute(jsObject: jsObject, name: Keys.submitter) + _submitter = ReadonlyAttribute(jsObject: jsObject, name: Strings.submitter) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/SubmitEventInit.swift b/Sources/DOMKit/WebIDL/SubmitEventInit.swift index 9bcf9332..23cb1bcf 100644 --- a/Sources/DOMKit/WebIDL/SubmitEventInit.swift +++ b/Sources/DOMKit/WebIDL/SubmitEventInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class SubmitEventInit: BridgedDictionary { - private enum Keys { - static let submitter: JSString = "submitter" - } - public convenience init(submitter: HTMLElement?) { let object = JSObject.global.Object.function!.new() - object[Keys.submitter] = submitter.jsValue() + object[Strings.submitter] = submitter.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _submitter = ReadWriteAttribute(jsObject: object, name: Keys.submitter) + _submitter = ReadWriteAttribute(jsObject: object, name: Strings.submitter) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index 742ac845..adcb7d87 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -6,13 +6,8 @@ import JavaScriptKit public class Text: CharacterData, Slottable { override public class var constructor: JSFunction { JSObject.global.Text.function! } - private enum Keys { - static let splitText: JSString = "splitText" - static let wholeText: JSString = "wholeText" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _wholeText = ReadonlyAttribute(jsObject: jsObject, name: Keys.wholeText) + _wholeText = ReadonlyAttribute(jsObject: jsObject, name: Strings.wholeText) super.init(unsafelyWrapping: jsObject) } @@ -21,7 +16,7 @@ public class Text: CharacterData, Slottable { } public func splitText(offset: UInt32) -> Self { - jsObject[Keys.splitText]!(offset.jsValue()).fromJSValue()! + jsObject[Strings.splitText]!(offset.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TextMetrics.swift b/Sources/DOMKit/WebIDL/TextMetrics.swift index 6bf424e0..41a2d74e 100644 --- a/Sources/DOMKit/WebIDL/TextMetrics.swift +++ b/Sources/DOMKit/WebIDL/TextMetrics.swift @@ -6,36 +6,21 @@ import JavaScriptKit public class TextMetrics: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TextMetrics.function! } - private enum Keys { - static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" - static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" - static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" - static let actualBoundingBoxRight: JSString = "actualBoundingBoxRight" - static let alphabeticBaseline: JSString = "alphabeticBaseline" - static let emHeightAscent: JSString = "emHeightAscent" - static let emHeightDescent: JSString = "emHeightDescent" - static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" - static let fontBoundingBoxDescent: JSString = "fontBoundingBoxDescent" - static let hangingBaseline: JSString = "hangingBaseline" - static let ideographicBaseline: JSString = "ideographicBaseline" - static let width: JSString = "width" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: Keys.width) - _actualBoundingBoxLeft = ReadonlyAttribute(jsObject: jsObject, name: Keys.actualBoundingBoxLeft) - _actualBoundingBoxRight = ReadonlyAttribute(jsObject: jsObject, name: Keys.actualBoundingBoxRight) - _fontBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Keys.fontBoundingBoxAscent) - _fontBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Keys.fontBoundingBoxDescent) - _actualBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Keys.actualBoundingBoxAscent) - _actualBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Keys.actualBoundingBoxDescent) - _emHeightAscent = ReadonlyAttribute(jsObject: jsObject, name: Keys.emHeightAscent) - _emHeightDescent = ReadonlyAttribute(jsObject: jsObject, name: Keys.emHeightDescent) - _hangingBaseline = ReadonlyAttribute(jsObject: jsObject, name: Keys.hangingBaseline) - _alphabeticBaseline = ReadonlyAttribute(jsObject: jsObject, name: Keys.alphabeticBaseline) - _ideographicBaseline = ReadonlyAttribute(jsObject: jsObject, name: Keys.ideographicBaseline) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _actualBoundingBoxLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.actualBoundingBoxLeft) + _actualBoundingBoxRight = ReadonlyAttribute(jsObject: jsObject, name: Strings.actualBoundingBoxRight) + _fontBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontBoundingBoxAscent) + _fontBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontBoundingBoxDescent) + _actualBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Strings.actualBoundingBoxAscent) + _actualBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Strings.actualBoundingBoxDescent) + _emHeightAscent = ReadonlyAttribute(jsObject: jsObject, name: Strings.emHeightAscent) + _emHeightDescent = ReadonlyAttribute(jsObject: jsObject, name: Strings.emHeightDescent) + _hangingBaseline = ReadonlyAttribute(jsObject: jsObject, name: Strings.hangingBaseline) + _alphabeticBaseline = ReadonlyAttribute(jsObject: jsObject, name: Strings.alphabeticBaseline) + _ideographicBaseline = ReadonlyAttribute(jsObject: jsObject, name: Strings.ideographicBaseline) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index 6a84a996..f4a59987 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -6,30 +6,16 @@ import JavaScriptKit public class TextTrack: EventTarget { override public class var constructor: JSFunction { JSObject.global.TextTrack.function! } - private enum Keys { - static let activeCues: JSString = "activeCues" - static let addCue: JSString = "addCue" - static let cues: JSString = "cues" - static let id: JSString = "id" - static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" - static let kind: JSString = "kind" - static let label: JSString = "label" - static let language: JSString = "language" - static let mode: JSString = "mode" - static let oncuechange: JSString = "oncuechange" - static let removeCue: JSString = "removeCue" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _kind = ReadonlyAttribute(jsObject: jsObject, name: Keys.kind) - _label = ReadonlyAttribute(jsObject: jsObject, name: Keys.label) - _language = ReadonlyAttribute(jsObject: jsObject, name: Keys.language) - _id = ReadonlyAttribute(jsObject: jsObject, name: Keys.id) - _inBandMetadataTrackDispatchType = ReadonlyAttribute(jsObject: jsObject, name: Keys.inBandMetadataTrackDispatchType) - _mode = ReadWriteAttribute(jsObject: jsObject, name: Keys.mode) - _cues = ReadonlyAttribute(jsObject: jsObject, name: Keys.cues) - _activeCues = ReadonlyAttribute(jsObject: jsObject, name: Keys.activeCues) - _oncuechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.oncuechange) + _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) + _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) + _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _inBandMetadataTrackDispatchType = ReadonlyAttribute(jsObject: jsObject, name: Strings.inBandMetadataTrackDispatchType) + _mode = ReadWriteAttribute(jsObject: jsObject, name: Strings.mode) + _cues = ReadonlyAttribute(jsObject: jsObject, name: Strings.cues) + _activeCues = ReadonlyAttribute(jsObject: jsObject, name: Strings.activeCues) + _oncuechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncuechange) super.init(unsafelyWrapping: jsObject) } @@ -58,11 +44,11 @@ public class TextTrack: EventTarget { public var activeCues: TextTrackCueList? public func addCue(cue: TextTrackCue) { - _ = jsObject[Keys.addCue]!(cue.jsValue()) + _ = jsObject[Strings.addCue]!(cue.jsValue()) } public func removeCue(cue: TextTrackCue) { - _ = jsObject[Keys.removeCue]!(cue.jsValue()) + _ = jsObject[Strings.removeCue]!(cue.jsValue()) } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/TextTrackCue.swift b/Sources/DOMKit/WebIDL/TextTrackCue.swift index 173bc802..e90191ef 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCue.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCue.swift @@ -6,24 +6,14 @@ import JavaScriptKit public class TextTrackCue: EventTarget { override public class var constructor: JSFunction { JSObject.global.TextTrackCue.function! } - private enum Keys { - static let endTime: JSString = "endTime" - static let id: JSString = "id" - static let onenter: JSString = "onenter" - static let onexit: JSString = "onexit" - static let pauseOnExit: JSString = "pauseOnExit" - static let startTime: JSString = "startTime" - static let track: JSString = "track" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _track = ReadonlyAttribute(jsObject: jsObject, name: Keys.track) - _id = ReadWriteAttribute(jsObject: jsObject, name: Keys.id) - _startTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.startTime) - _endTime = ReadWriteAttribute(jsObject: jsObject, name: Keys.endTime) - _pauseOnExit = ReadWriteAttribute(jsObject: jsObject, name: Keys.pauseOnExit) - _onenter = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onenter) - _onexit = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onexit) + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) + _id = ReadWriteAttribute(jsObject: jsObject, name: Strings.id) + _startTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.startTime) + _endTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.endTime) + _pauseOnExit = ReadWriteAttribute(jsObject: jsObject, name: Strings.pauseOnExit) + _onenter = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onenter) + _onexit = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onexit) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/TextTrackCueList.swift b/Sources/DOMKit/WebIDL/TextTrackCueList.swift index 122b45af..4dc6df71 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCueList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCueList.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class TextTrackCueList: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TextTrackCueList.function! } - private enum Keys { - static let getCueById: JSString = "getCueById" - static let length: JSString = "length" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } @@ -26,6 +21,6 @@ public class TextTrackCueList: JSBridgedClass { } public func getCueById(id: String) -> TextTrackCue? { - jsObject[Keys.getCueById]!(id.jsValue()).fromJSValue()! + jsObject[Strings.getCueById]!(id.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift index ad8bc807..08aace39 100644 --- a/Sources/DOMKit/WebIDL/TextTrackList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -6,19 +6,11 @@ import JavaScriptKit public class TextTrackList: EventTarget { override public class var constructor: JSFunction { JSObject.global.TextTrackList.function! } - private enum Keys { - static let getTrackById: JSString = "getTrackById" - static let length: JSString = "length" - static let onaddtrack: JSString = "onaddtrack" - static let onchange: JSString = "onchange" - static let onremovetrack: JSString = "onremovetrack" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onchange) - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onaddtrack) - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onremovetrack) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddtrack) + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovetrack) super.init(unsafelyWrapping: jsObject) } @@ -30,7 +22,7 @@ public class TextTrackList: EventTarget { } public func getTrackById(id: String) -> TextTrack? { - jsObject[Keys.getTrackById]!(id.jsValue()).fromJSValue()! + jsObject[Strings.getTrackById]!(id.jsValue()).fromJSValue()! } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/TimeRanges.swift b/Sources/DOMKit/WebIDL/TimeRanges.swift index 88082cae..12fd7529 100644 --- a/Sources/DOMKit/WebIDL/TimeRanges.swift +++ b/Sources/DOMKit/WebIDL/TimeRanges.swift @@ -6,16 +6,10 @@ import JavaScriptKit public class TimeRanges: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TimeRanges.function! } - private enum Keys { - static let end: JSString = "end" - static let length: JSString = "length" - static let start: JSString = "start" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) self.jsObject = jsObject } @@ -23,10 +17,10 @@ public class TimeRanges: JSBridgedClass { public var length: UInt32 public func start(index: UInt32) -> Double { - jsObject[Keys.start]!(index.jsValue()).fromJSValue()! + jsObject[Strings.start]!(index.jsValue()).fromJSValue()! } public func end(index: UInt32) -> Double { - jsObject[Keys.end]!(index.jsValue()).fromJSValue()! + jsObject[Strings.end]!(index.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrackEvent.swift b/Sources/DOMKit/WebIDL/TrackEvent.swift index b5392a01..891a39a1 100644 --- a/Sources/DOMKit/WebIDL/TrackEvent.swift +++ b/Sources/DOMKit/WebIDL/TrackEvent.swift @@ -6,12 +6,8 @@ import JavaScriptKit public class TrackEvent: Event { override public class var constructor: JSFunction { JSObject.global.TrackEvent.function! } - private enum Keys { - static let track: JSString = "track" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _track = ReadonlyAttribute(jsObject: jsObject, name: Keys.track) + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/TrackEventInit.swift b/Sources/DOMKit/WebIDL/TrackEventInit.swift index 1cd8ee38..ab9cf461 100644 --- a/Sources/DOMKit/WebIDL/TrackEventInit.swift +++ b/Sources/DOMKit/WebIDL/TrackEventInit.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class TrackEventInit: BridgedDictionary { - private enum Keys { - static let track: JSString = "track" - } - public convenience init(track: __UNSUPPORTED_UNION__?) { let object = JSObject.global.Object.function!.new() - object[Keys.track] = track.jsValue() + object[Strings.track] = track.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _track = ReadWriteAttribute(jsObject: object, name: Keys.track) + _track = ReadWriteAttribute(jsObject: object, name: Strings.track) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TransformStream.swift b/Sources/DOMKit/WebIDL/TransformStream.swift index bb3e25de..f885f3c3 100644 --- a/Sources/DOMKit/WebIDL/TransformStream.swift +++ b/Sources/DOMKit/WebIDL/TransformStream.swift @@ -6,16 +6,11 @@ import JavaScriptKit public class TransformStream: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TransformStream.function! } - private enum Keys { - static let readable: JSString = "readable" - static let writable: JSString = "writable" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _readable = ReadonlyAttribute(jsObject: jsObject, name: Keys.readable) - _writable = ReadonlyAttribute(jsObject: jsObject, name: Keys.writable) + _readable = ReadonlyAttribute(jsObject: jsObject, name: Strings.readable) + _writable = ReadonlyAttribute(jsObject: jsObject, name: Strings.writable) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift index ef93cd2d..830b48fe 100644 --- a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift @@ -6,17 +6,10 @@ import JavaScriptKit public class TransformStreamDefaultController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TransformStreamDefaultController.function! } - private enum Keys { - static let desiredSize: JSString = "desiredSize" - static let enqueue: JSString = "enqueue" - static let error: JSString = "error" - static let terminate: JSString = "terminate" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Keys.desiredSize) + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.desiredSize) self.jsObject = jsObject } @@ -24,14 +17,14 @@ public class TransformStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func enqueue(chunk: JSValue? = nil) { - _ = jsObject[Keys.enqueue]!(chunk?.jsValue() ?? .undefined) + _ = jsObject[Strings.enqueue]!(chunk?.jsValue() ?? .undefined) } public func error(reason: JSValue? = nil) { - _ = jsObject[Keys.error]!(reason?.jsValue() ?? .undefined) + _ = jsObject[Strings.error]!(reason?.jsValue() ?? .undefined) } public func terminate() { - _ = jsObject[Keys.terminate]!() + _ = jsObject[Strings.terminate]!() } } diff --git a/Sources/DOMKit/WebIDL/Transformer.swift b/Sources/DOMKit/WebIDL/Transformer.swift index 7fdd443a..d93f280a 100644 --- a/Sources/DOMKit/WebIDL/Transformer.swift +++ b/Sources/DOMKit/WebIDL/Transformer.swift @@ -4,30 +4,22 @@ import JavaScriptEventLoop import JavaScriptKit public class Transformer: BridgedDictionary { - private enum Keys { - static let flush: JSString = "flush" - static let readableType: JSString = "readableType" - static let start: JSString = "start" - static let transform: JSString = "transform" - static let writableType: JSString = "writableType" - } - public convenience init(start: @escaping TransformerStartCallback, transform: @escaping TransformerTransformCallback, flush: @escaping TransformerFlushCallback, readableType: JSValue, writableType: JSValue) { let object = JSObject.global.Object.function!.new() - ClosureAttribute.Required1[Keys.start, in: object] = start - ClosureAttribute.Required2[Keys.transform, in: object] = transform - ClosureAttribute.Required1[Keys.flush, in: object] = flush - object[Keys.readableType] = readableType.jsValue() - object[Keys.writableType] = writableType.jsValue() + ClosureAttribute.Required1[Strings.start, in: object] = start + ClosureAttribute.Required2[Strings.transform, in: object] = transform + ClosureAttribute.Required1[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 = ClosureAttribute.Required1(jsObject: object, name: Keys.start) - _transform = ClosureAttribute.Required2(jsObject: object, name: Keys.transform) - _flush = ClosureAttribute.Required1(jsObject: object, name: Keys.flush) - _readableType = ReadWriteAttribute(jsObject: object, name: Keys.readableType) - _writableType = ReadWriteAttribute(jsObject: object, name: Keys.writableType) + _start = ClosureAttribute.Required1(jsObject: object, name: Strings.start) + _transform = ClosureAttribute.Required2(jsObject: object, name: Strings.transform) + _flush = ClosureAttribute.Required1(jsObject: object, name: Strings.flush) + _readableType = ReadWriteAttribute(jsObject: object, name: Strings.readableType) + _writableType = ReadWriteAttribute(jsObject: object, name: Strings.writableType) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TreeWalker.swift b/Sources/DOMKit/WebIDL/TreeWalker.swift index 82edd454..731a6ae6 100644 --- a/Sources/DOMKit/WebIDL/TreeWalker.swift +++ b/Sources/DOMKit/WebIDL/TreeWalker.swift @@ -6,26 +6,12 @@ import JavaScriptKit public class TreeWalker: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.TreeWalker.function! } - private enum Keys { - static let currentNode: JSString = "currentNode" - static let filter: JSString = "filter" - static let firstChild: JSString = "firstChild" - static let lastChild: JSString = "lastChild" - static let nextNode: JSString = "nextNode" - static let nextSibling: JSString = "nextSibling" - static let parentNode: JSString = "parentNode" - static let previousNode: JSString = "previousNode" - static let previousSibling: JSString = "previousSibling" - static let root: JSString = "root" - static let whatToShow: JSString = "whatToShow" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _root = ReadonlyAttribute(jsObject: jsObject, name: Keys.root) - _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: Keys.whatToShow) - _currentNode = ReadWriteAttribute(jsObject: jsObject, name: Keys.currentNode) + _root = ReadonlyAttribute(jsObject: jsObject, name: Strings.root) + _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: Strings.whatToShow) + _currentNode = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentNode) self.jsObject = jsObject } @@ -41,30 +27,30 @@ public class TreeWalker: JSBridgedClass { public var currentNode: Node public func parentNode() -> Node? { - jsObject[Keys.parentNode]!().fromJSValue()! + jsObject[Strings.parentNode]!().fromJSValue()! } public func firstChild() -> Node? { - jsObject[Keys.firstChild]!().fromJSValue()! + jsObject[Strings.firstChild]!().fromJSValue()! } public func lastChild() -> Node? { - jsObject[Keys.lastChild]!().fromJSValue()! + jsObject[Strings.lastChild]!().fromJSValue()! } public func previousSibling() -> Node? { - jsObject[Keys.previousSibling]!().fromJSValue()! + jsObject[Strings.previousSibling]!().fromJSValue()! } public func nextSibling() -> Node? { - jsObject[Keys.nextSibling]!().fromJSValue()! + jsObject[Strings.nextSibling]!().fromJSValue()! } public func previousNode() -> Node? { - jsObject[Keys.previousNode]!().fromJSValue()! + jsObject[Strings.previousNode]!().fromJSValue()! } public func nextNode() -> Node? { - jsObject[Keys.nextNode]!().fromJSValue()! + jsObject[Strings.nextNode]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index b14816d1..ab1dc140 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -6,17 +6,10 @@ import JavaScriptKit public class UIEvent: Event { override public class var constructor: JSFunction { JSObject.global.UIEvent.function! } - private enum Keys { - static let detail: JSString = "detail" - static let initUIEvent: JSString = "initUIEvent" - static let view: JSString = "view" - static let which: JSString = "which" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _view = ReadonlyAttribute(jsObject: jsObject, name: Keys.view) - _detail = ReadonlyAttribute(jsObject: jsObject, name: Keys.detail) - _which = ReadonlyAttribute(jsObject: jsObject, name: Keys.which) + _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) } @@ -31,7 +24,7 @@ public class UIEvent: Event { public var detail: Int32 public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil) { - _ = jsObject[Keys.initUIEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined) + _ = jsObject[Strings.initUIEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/UIEventInit.swift b/Sources/DOMKit/WebIDL/UIEventInit.swift index 0e312303..fd161f65 100644 --- a/Sources/DOMKit/WebIDL/UIEventInit.swift +++ b/Sources/DOMKit/WebIDL/UIEventInit.swift @@ -4,24 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class UIEventInit: BridgedDictionary { - private enum Keys { - static let detail: JSString = "detail" - static let view: JSString = "view" - static let which: JSString = "which" - } - public convenience init(view: Window?, detail: Int32, which: UInt32) { let object = JSObject.global.Object.function!.new() - object[Keys.view] = view.jsValue() - object[Keys.detail] = detail.jsValue() - object[Keys.which] = which.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) { - _view = ReadWriteAttribute(jsObject: object, name: Keys.view) - _detail = ReadWriteAttribute(jsObject: object, name: Keys.detail) - _which = ReadWriteAttribute(jsObject: object, name: Keys.which) + _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) } diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index 923a9cfd..d107adf0 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -6,11 +6,6 @@ import JavaScriptKit public class URL: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.URL.function! } - private enum Keys { - static let createObjectURL: JSString = "createObjectURL" - static let revokeObjectURL: JSString = "revokeObjectURL" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -18,10 +13,10 @@ public class URL: JSBridgedClass { } public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { - constructor[Keys.createObjectURL]!(obj.jsValue()).fromJSValue()! + constructor[Strings.createObjectURL]!(obj.jsValue()).fromJSValue()! } public static func revokeObjectURL(url: String) { - _ = constructor[Keys.revokeObjectURL]!(url.jsValue()) + _ = constructor[Strings.revokeObjectURL]!(url.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift index 7f3a2c7d..e8fa13ab 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSink.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSink.swift @@ -4,30 +4,22 @@ import JavaScriptEventLoop import JavaScriptKit public class UnderlyingSink: BridgedDictionary { - private enum Keys { - static let abort: JSString = "abort" - static let close: JSString = "close" - static let start: JSString = "start" - static let type: JSString = "type" - static let write: JSString = "write" - } - public convenience init(start: @escaping UnderlyingSinkStartCallback, write: @escaping UnderlyingSinkWriteCallback, close: @escaping UnderlyingSinkCloseCallback, abort: @escaping UnderlyingSinkAbortCallback, type: JSValue) { let object = JSObject.global.Object.function!.new() - ClosureAttribute.Required1[Keys.start, in: object] = start - ClosureAttribute.Required2[Keys.write, in: object] = write - ClosureAttribute.Required0[Keys.close, in: object] = close - ClosureAttribute.Required1[Keys.abort, in: object] = abort - object[Keys.type] = type.jsValue() + ClosureAttribute.Required1[Strings.start, in: object] = start + ClosureAttribute.Required2[Strings.write, in: object] = write + ClosureAttribute.Required0[Strings.close, in: object] = close + ClosureAttribute.Required1[Strings.abort, in: object] = abort + object[Strings.type] = type.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _start = ClosureAttribute.Required1(jsObject: object, name: Keys.start) - _write = ClosureAttribute.Required2(jsObject: object, name: Keys.write) - _close = ClosureAttribute.Required0(jsObject: object, name: Keys.close) - _abort = ClosureAttribute.Required1(jsObject: object, name: Keys.abort) - _type = ReadWriteAttribute(jsObject: object, name: Keys.type) + _start = ClosureAttribute.Required1(jsObject: object, name: Strings.start) + _write = ClosureAttribute.Required2(jsObject: object, name: Strings.write) + _close = ClosureAttribute.Required0(jsObject: object, name: Strings.close) + _abort = ClosureAttribute.Required1(jsObject: object, name: Strings.abort) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/UnderlyingSource.swift b/Sources/DOMKit/WebIDL/UnderlyingSource.swift index 87e66ee8..eb36bc46 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSource.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSource.swift @@ -4,30 +4,22 @@ import JavaScriptEventLoop import JavaScriptKit public class UnderlyingSource: BridgedDictionary { - private enum Keys { - static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" - static let cancel: JSString = "cancel" - static let pull: JSString = "pull" - static let start: JSString = "start" - static let type: JSString = "type" - } - public convenience init(start: @escaping UnderlyingSourceStartCallback, pull: @escaping UnderlyingSourcePullCallback, cancel: @escaping UnderlyingSourceCancelCallback, type: ReadableStreamType, autoAllocateChunkSize: UInt64) { let object = JSObject.global.Object.function!.new() - ClosureAttribute.Required1[Keys.start, in: object] = start - ClosureAttribute.Required1[Keys.pull, in: object] = pull - ClosureAttribute.Required1[Keys.cancel, in: object] = cancel - object[Keys.type] = type.jsValue() - object[Keys.autoAllocateChunkSize] = autoAllocateChunkSize.jsValue() + ClosureAttribute.Required1[Strings.start, in: object] = start + ClosureAttribute.Required1[Strings.pull, in: object] = pull + ClosureAttribute.Required1[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 = ClosureAttribute.Required1(jsObject: object, name: Keys.start) - _pull = ClosureAttribute.Required1(jsObject: object, name: Keys.pull) - _cancel = ClosureAttribute.Required1(jsObject: object, name: Keys.cancel) - _type = ReadWriteAttribute(jsObject: object, name: Keys.type) - _autoAllocateChunkSize = ReadWriteAttribute(jsObject: object, name: Keys.autoAllocateChunkSize) + _start = ClosureAttribute.Required1(jsObject: object, name: Strings.start) + _pull = ClosureAttribute.Required1(jsObject: object, name: Strings.pull) + _cancel = ClosureAttribute.Required1(jsObject: object, name: Strings.cancel) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _autoAllocateChunkSize = ReadWriteAttribute(jsObject: object, name: Strings.autoAllocateChunkSize) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ValidityState.swift b/Sources/DOMKit/WebIDL/ValidityState.swift index 9470bb39..0f0e5af0 100644 --- a/Sources/DOMKit/WebIDL/ValidityState.swift +++ b/Sources/DOMKit/WebIDL/ValidityState.swift @@ -6,34 +6,20 @@ import JavaScriptKit public class ValidityState: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.ValidityState.function! } - private enum Keys { - static let badInput: JSString = "badInput" - static let customError: JSString = "customError" - static let patternMismatch: JSString = "patternMismatch" - static let rangeOverflow: JSString = "rangeOverflow" - static let rangeUnderflow: JSString = "rangeUnderflow" - static let stepMismatch: JSString = "stepMismatch" - static let tooLong: JSString = "tooLong" - static let tooShort: JSString = "tooShort" - static let typeMismatch: JSString = "typeMismatch" - static let valid: JSString = "valid" - static let valueMissing: JSString = "valueMissing" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _valueMissing = ReadonlyAttribute(jsObject: jsObject, name: Keys.valueMissing) - _typeMismatch = ReadonlyAttribute(jsObject: jsObject, name: Keys.typeMismatch) - _patternMismatch = ReadonlyAttribute(jsObject: jsObject, name: Keys.patternMismatch) - _tooLong = ReadonlyAttribute(jsObject: jsObject, name: Keys.tooLong) - _tooShort = ReadonlyAttribute(jsObject: jsObject, name: Keys.tooShort) - _rangeUnderflow = ReadonlyAttribute(jsObject: jsObject, name: Keys.rangeUnderflow) - _rangeOverflow = ReadonlyAttribute(jsObject: jsObject, name: Keys.rangeOverflow) - _stepMismatch = ReadonlyAttribute(jsObject: jsObject, name: Keys.stepMismatch) - _badInput = ReadonlyAttribute(jsObject: jsObject, name: Keys.badInput) - _customError = ReadonlyAttribute(jsObject: jsObject, name: Keys.customError) - _valid = ReadonlyAttribute(jsObject: jsObject, name: Keys.valid) + _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 } diff --git a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift index 3041e5ee..b97cd7c3 100644 --- a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift +++ b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift @@ -4,45 +4,32 @@ import JavaScriptEventLoop import JavaScriptKit public class ValidityStateFlags: BridgedDictionary { - private enum Keys { - static let badInput: JSString = "badInput" - static let customError: JSString = "customError" - static let patternMismatch: JSString = "patternMismatch" - static let rangeOverflow: JSString = "rangeOverflow" - static let rangeUnderflow: JSString = "rangeUnderflow" - static let stepMismatch: JSString = "stepMismatch" - static let tooLong: JSString = "tooLong" - static let tooShort: JSString = "tooShort" - static let typeMismatch: JSString = "typeMismatch" - static let valueMissing: JSString = "valueMissing" - } - 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.Object.function!.new() - object[Keys.valueMissing] = valueMissing.jsValue() - object[Keys.typeMismatch] = typeMismatch.jsValue() - object[Keys.patternMismatch] = patternMismatch.jsValue() - object[Keys.tooLong] = tooLong.jsValue() - object[Keys.tooShort] = tooShort.jsValue() - object[Keys.rangeUnderflow] = rangeUnderflow.jsValue() - object[Keys.rangeOverflow] = rangeOverflow.jsValue() - object[Keys.stepMismatch] = stepMismatch.jsValue() - object[Keys.badInput] = badInput.jsValue() - object[Keys.customError] = customError.jsValue() + 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) } public required init(unsafelyWrapping object: JSObject) { - _valueMissing = ReadWriteAttribute(jsObject: object, name: Keys.valueMissing) - _typeMismatch = ReadWriteAttribute(jsObject: object, name: Keys.typeMismatch) - _patternMismatch = ReadWriteAttribute(jsObject: object, name: Keys.patternMismatch) - _tooLong = ReadWriteAttribute(jsObject: object, name: Keys.tooLong) - _tooShort = ReadWriteAttribute(jsObject: object, name: Keys.tooShort) - _rangeUnderflow = ReadWriteAttribute(jsObject: object, name: Keys.rangeUnderflow) - _rangeOverflow = ReadWriteAttribute(jsObject: object, name: Keys.rangeOverflow) - _stepMismatch = ReadWriteAttribute(jsObject: object, name: Keys.stepMismatch) - _badInput = ReadWriteAttribute(jsObject: object, name: Keys.badInput) - _customError = ReadWriteAttribute(jsObject: object, name: Keys.customError) + _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) } diff --git a/Sources/DOMKit/WebIDL/VideoTrack.swift b/Sources/DOMKit/WebIDL/VideoTrack.swift index ff691306..2bd49efd 100644 --- a/Sources/DOMKit/WebIDL/VideoTrack.swift +++ b/Sources/DOMKit/WebIDL/VideoTrack.swift @@ -6,22 +6,14 @@ import JavaScriptKit public class VideoTrack: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.VideoTrack.function! } - private enum Keys { - static let id: JSString = "id" - static let kind: JSString = "kind" - static let label: JSString = "label" - static let language: JSString = "language" - static let selected: JSString = "selected" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Keys.id) - _kind = ReadonlyAttribute(jsObject: jsObject, name: Keys.kind) - _label = ReadonlyAttribute(jsObject: jsObject, name: Keys.label) - _language = ReadonlyAttribute(jsObject: jsObject, name: Keys.language) - _selected = ReadWriteAttribute(jsObject: jsObject, name: Keys.selected) + _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 } diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift index 41bd3a0b..763a574b 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackList.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -6,21 +6,12 @@ import JavaScriptKit public class VideoTrackList: EventTarget { override public class var constructor: JSFunction { JSObject.global.VideoTrackList.function! } - private enum Keys { - static let getTrackById: JSString = "getTrackById" - static let length: JSString = "length" - static let onaddtrack: JSString = "onaddtrack" - static let onchange: JSString = "onchange" - static let onremovetrack: JSString = "onremovetrack" - static let selectedIndex: JSString = "selectedIndex" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) - _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Keys.selectedIndex) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onchange) - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onaddtrack) - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onremovetrack) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedIndex) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddtrack) + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovetrack) super.init(unsafelyWrapping: jsObject) } @@ -32,7 +23,7 @@ public class VideoTrackList: EventTarget { } public func getTrackById(id: String) -> VideoTrack? { - jsObject[Keys.getTrackById]!(id.jsValue()).fromJSValue()! + jsObject[Strings.getTrackById]!(id.jsValue()).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WheelEvent.swift b/Sources/DOMKit/WebIDL/WheelEvent.swift index 2ee1d488..a9f93b3c 100644 --- a/Sources/DOMKit/WebIDL/WheelEvent.swift +++ b/Sources/DOMKit/WebIDL/WheelEvent.swift @@ -6,21 +6,11 @@ import JavaScriptKit public class WheelEvent: MouseEvent { override public class var constructor: JSFunction { JSObject.global.WheelEvent.function! } - private enum Keys { - static let DOM_DELTA_LINE: JSString = "DOM_DELTA_LINE" - static let DOM_DELTA_PAGE: JSString = "DOM_DELTA_PAGE" - static let DOM_DELTA_PIXEL: JSString = "DOM_DELTA_PIXEL" - static let deltaMode: JSString = "deltaMode" - static let deltaX: JSString = "deltaX" - static let deltaY: JSString = "deltaY" - static let deltaZ: JSString = "deltaZ" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _deltaX = ReadonlyAttribute(jsObject: jsObject, name: Keys.deltaX) - _deltaY = ReadonlyAttribute(jsObject: jsObject, name: Keys.deltaY) - _deltaZ = ReadonlyAttribute(jsObject: jsObject, name: Keys.deltaZ) - _deltaMode = ReadonlyAttribute(jsObject: jsObject, name: Keys.deltaMode) + _deltaX = ReadonlyAttribute(jsObject: jsObject, name: Strings.deltaX) + _deltaY = ReadonlyAttribute(jsObject: jsObject, name: Strings.deltaY) + _deltaZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.deltaZ) + _deltaMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.deltaMode) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/WheelEventInit.swift b/Sources/DOMKit/WebIDL/WheelEventInit.swift index 2d52242b..5d0ea665 100644 --- a/Sources/DOMKit/WebIDL/WheelEventInit.swift +++ b/Sources/DOMKit/WebIDL/WheelEventInit.swift @@ -4,27 +4,20 @@ import JavaScriptEventLoop import JavaScriptKit public class WheelEventInit: BridgedDictionary { - private enum Keys { - static let deltaMode: JSString = "deltaMode" - static let deltaX: JSString = "deltaX" - static let deltaY: JSString = "deltaY" - static let deltaZ: JSString = "deltaZ" - } - public convenience init(deltaX: Double, deltaY: Double, deltaZ: Double, deltaMode: UInt32) { let object = JSObject.global.Object.function!.new() - object[Keys.deltaX] = deltaX.jsValue() - object[Keys.deltaY] = deltaY.jsValue() - object[Keys.deltaZ] = deltaZ.jsValue() - object[Keys.deltaMode] = deltaMode.jsValue() + object[Strings.deltaX] = deltaX.jsValue() + object[Strings.deltaY] = deltaY.jsValue() + object[Strings.deltaZ] = deltaZ.jsValue() + object[Strings.deltaMode] = deltaMode.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _deltaX = ReadWriteAttribute(jsObject: object, name: Keys.deltaX) - _deltaY = ReadWriteAttribute(jsObject: object, name: Keys.deltaY) - _deltaZ = ReadWriteAttribute(jsObject: object, name: Keys.deltaZ) - _deltaMode = ReadWriteAttribute(jsObject: object, name: Keys.deltaMode) + _deltaX = ReadWriteAttribute(jsObject: object, name: Strings.deltaX) + _deltaY = ReadWriteAttribute(jsObject: object, name: Strings.deltaY) + _deltaZ = ReadWriteAttribute(jsObject: object, name: Strings.deltaZ) + _deltaMode = ReadWriteAttribute(jsObject: object, name: Strings.deltaMode) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 21c78edc..3944100d 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -6,75 +6,33 @@ import JavaScriptKit public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, WindowOrWorkerGlobalScope, AnimationFrameProvider, WindowSessionStorage, WindowLocalStorage { override public class var constructor: JSFunction { JSObject.global.Window.function! } - private enum Keys { - static let alert: JSString = "alert" - static let blur: JSString = "blur" - static let captureEvents: JSString = "captureEvents" - static let clientInformation: JSString = "clientInformation" - static let close: JSString = "close" - static let closed: JSString = "closed" - static let confirm: JSString = "confirm" - static let customElements: JSString = "customElements" - static let document: JSString = "document" - static let event: JSString = "event" - static let external: JSString = "external" - static let focus: JSString = "focus" - static let frameElement: JSString = "frameElement" - static let frames: JSString = "frames" - static let getComputedStyle: JSString = "getComputedStyle" - static let history: JSString = "history" - static let length: JSString = "length" - static let location: JSString = "location" - static let locationbar: JSString = "locationbar" - static let menubar: JSString = "menubar" - static let name: JSString = "name" - static let navigator: JSString = "navigator" - static let open: JSString = "open" - static let opener: JSString = "opener" - static let originAgentCluster: JSString = "originAgentCluster" - static let parent: JSString = "parent" - static let personalbar: JSString = "personalbar" - static let postMessage: JSString = "postMessage" - static let print: JSString = "print" - static let prompt: JSString = "prompt" - static let releaseEvents: JSString = "releaseEvents" - static let scrollbars: JSString = "scrollbars" - static let `self`: JSString = "self" - static let status: JSString = "status" - static let statusbar: JSString = "statusbar" - static let stop: JSString = "stop" - static let toolbar: JSString = "toolbar" - static let top: JSString = "top" - static let window: JSString = "window" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _event = ReadonlyAttribute(jsObject: jsObject, name: Keys.event) - _window = ReadonlyAttribute(jsObject: jsObject, name: Keys.window) - _self = ReadonlyAttribute(jsObject: jsObject, name: Keys.self) - _document = ReadonlyAttribute(jsObject: jsObject, name: Keys.document) - _name = ReadWriteAttribute(jsObject: jsObject, name: Keys.name) - _location = ReadonlyAttribute(jsObject: jsObject, name: Keys.location) - _history = ReadonlyAttribute(jsObject: jsObject, name: Keys.history) - _customElements = ReadonlyAttribute(jsObject: jsObject, name: Keys.customElements) - _locationbar = ReadonlyAttribute(jsObject: jsObject, name: Keys.locationbar) - _menubar = ReadonlyAttribute(jsObject: jsObject, name: Keys.menubar) - _personalbar = ReadonlyAttribute(jsObject: jsObject, name: Keys.personalbar) - _scrollbars = ReadonlyAttribute(jsObject: jsObject, name: Keys.scrollbars) - _statusbar = ReadonlyAttribute(jsObject: jsObject, name: Keys.statusbar) - _toolbar = ReadonlyAttribute(jsObject: jsObject, name: Keys.toolbar) - _status = ReadWriteAttribute(jsObject: jsObject, name: Keys.status) - _closed = ReadonlyAttribute(jsObject: jsObject, name: Keys.closed) - _frames = ReadonlyAttribute(jsObject: jsObject, name: Keys.frames) - _length = ReadonlyAttribute(jsObject: jsObject, name: Keys.length) - _top = ReadonlyAttribute(jsObject: jsObject, name: Keys.top) - _opener = ReadWriteAttribute(jsObject: jsObject, name: Keys.opener) - _parent = ReadonlyAttribute(jsObject: jsObject, name: Keys.parent) - _frameElement = ReadonlyAttribute(jsObject: jsObject, name: Keys.frameElement) - _navigator = ReadonlyAttribute(jsObject: jsObject, name: Keys.navigator) - _clientInformation = ReadonlyAttribute(jsObject: jsObject, name: Keys.clientInformation) - _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: Keys.originAgentCluster) - _external = ReadonlyAttribute(jsObject: jsObject, name: Keys.external) + _event = ReadonlyAttribute(jsObject: jsObject, name: Strings.event) + _window = ReadonlyAttribute(jsObject: jsObject, name: Strings.window) + _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) + _document = ReadonlyAttribute(jsObject: jsObject, name: Strings.document) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) + _history = ReadonlyAttribute(jsObject: jsObject, name: Strings.history) + _customElements = ReadonlyAttribute(jsObject: jsObject, name: Strings.customElements) + _locationbar = ReadonlyAttribute(jsObject: jsObject, name: Strings.locationbar) + _menubar = ReadonlyAttribute(jsObject: jsObject, name: Strings.menubar) + _personalbar = ReadonlyAttribute(jsObject: jsObject, name: Strings.personalbar) + _scrollbars = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollbars) + _statusbar = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusbar) + _toolbar = ReadonlyAttribute(jsObject: jsObject, name: Strings.toolbar) + _status = ReadWriteAttribute(jsObject: jsObject, name: Strings.status) + _closed = ReadonlyAttribute(jsObject: jsObject, name: Strings.closed) + _frames = ReadonlyAttribute(jsObject: jsObject, name: Strings.frames) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _top = ReadonlyAttribute(jsObject: jsObject, name: Strings.top) + _opener = ReadWriteAttribute(jsObject: jsObject, name: Strings.opener) + _parent = ReadonlyAttribute(jsObject: jsObject, name: Strings.parent) + _frameElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameElement) + _navigator = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigator) + _clientInformation = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientInformation) + _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: Strings.originAgentCluster) + _external = ReadonlyAttribute(jsObject: jsObject, name: Strings.external) super.init(unsafelyWrapping: jsObject) } @@ -124,22 +82,22 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var status: String public func close() { - _ = jsObject[Keys.close]!() + _ = jsObject[Strings.close]!() } @ReadonlyAttribute public var closed: Bool public func stop() { - _ = jsObject[Keys.stop]!() + _ = jsObject[Strings.stop]!() } public func focus() { - _ = jsObject[Keys.focus]!() + _ = jsObject[Strings.focus]!() } public func blur() { - _ = jsObject[Keys.blur]!() + _ = jsObject[Strings.blur]!() } @ReadonlyAttribute @@ -161,7 +119,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var frameElement: Element? public func open(url: String? = nil, target: String? = nil, features: String? = nil) -> WindowProxy? { - jsObject[Keys.open]!(url?.jsValue() ?? .undefined, target?.jsValue() ?? .undefined, features?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.open]!(url?.jsValue() ?? .undefined, target?.jsValue() ?? .undefined, features?.jsValue() ?? .undefined).fromJSValue()! } public subscript(key: String) -> JSObject { @@ -178,45 +136,45 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var originAgentCluster: Bool public func alert() { - _ = jsObject[Keys.alert]!() + _ = jsObject[Strings.alert]!() } public func alert(message: String) { - _ = jsObject[Keys.alert]!(message.jsValue()) + _ = jsObject[Strings.alert]!(message.jsValue()) } public func confirm(message: String? = nil) -> Bool { - jsObject[Keys.confirm]!(message?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.confirm]!(message?.jsValue() ?? .undefined).fromJSValue()! } public func prompt(message: String? = nil, default: String? = nil) -> String? { - jsObject[Keys.prompt]!(message?.jsValue() ?? .undefined, `default`?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.prompt]!(message?.jsValue() ?? .undefined, `default`?.jsValue() ?? .undefined).fromJSValue()! } public func print() { - _ = jsObject[Keys.print]!() + _ = jsObject[Strings.print]!() } public func postMessage(message: JSValue, targetOrigin: String, transfer: [JSObject]? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined) + _ = jsObject[Strings.postMessage]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined) } public func postMessage(message: JSValue, options: WindowPostMessageOptions? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } public func captureEvents() { - _ = jsObject[Keys.captureEvents]!() + _ = jsObject[Strings.captureEvents]!() } public func releaseEvents() { - _ = jsObject[Keys.releaseEvents]!() + _ = jsObject[Strings.releaseEvents]!() } @ReadonlyAttribute public var external: External public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { - jsObject[Keys.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index 0e4e14a2..d3da4258 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -3,104 +3,85 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let onafterprint: JSString = "onafterprint" - static let onbeforeprint: JSString = "onbeforeprint" - static let onbeforeunload: JSString = "onbeforeunload" - static let onhashchange: JSString = "onhashchange" - static let onlanguagechange: JSString = "onlanguagechange" - static let onmessage: JSString = "onmessage" - static let onmessageerror: JSString = "onmessageerror" - static let onoffline: JSString = "onoffline" - static let ononline: JSString = "ononline" - static let onpagehide: JSString = "onpagehide" - static let onpageshow: JSString = "onpageshow" - static let onpopstate: JSString = "onpopstate" - static let onrejectionhandled: JSString = "onrejectionhandled" - static let onstorage: JSString = "onstorage" - static let onunhandledrejection: JSString = "onunhandledrejection" - static let onunload: JSString = "onunload" -} - public protocol WindowEventHandlers: JSBridgedClass {} public extension WindowEventHandlers { var onafterprint: EventHandler { - get { ClosureAttribute.Optional1[Keys.onafterprint, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onafterprint, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onafterprint, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onafterprint, in: jsObject] = newValue } } var onbeforeprint: EventHandler { - get { ClosureAttribute.Optional1[Keys.onbeforeprint, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onbeforeprint, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onbeforeprint, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onbeforeprint, in: jsObject] = newValue } } var onbeforeunload: OnBeforeUnloadEventHandler { - get { ClosureAttribute.Optional1[Keys.onbeforeunload, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onbeforeunload, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onbeforeunload, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onbeforeunload, in: jsObject] = newValue } } var onhashchange: EventHandler { - get { ClosureAttribute.Optional1[Keys.onhashchange, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onhashchange, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onhashchange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onhashchange, in: jsObject] = newValue } } var onlanguagechange: EventHandler { - get { ClosureAttribute.Optional1[Keys.onlanguagechange, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onlanguagechange, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onlanguagechange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onlanguagechange, in: jsObject] = newValue } } var onmessage: EventHandler { - get { ClosureAttribute.Optional1[Keys.onmessage, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onmessage, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onmessage, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onmessage, in: jsObject] = newValue } } var onmessageerror: EventHandler { - get { ClosureAttribute.Optional1[Keys.onmessageerror, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onmessageerror, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onmessageerror, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onmessageerror, in: jsObject] = newValue } } var onoffline: EventHandler { - get { ClosureAttribute.Optional1[Keys.onoffline, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onoffline, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onoffline, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onoffline, in: jsObject] = newValue } } var ononline: EventHandler { - get { ClosureAttribute.Optional1[Keys.ononline, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.ononline, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.ononline, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ononline, in: jsObject] = newValue } } var onpagehide: EventHandler { - get { ClosureAttribute.Optional1[Keys.onpagehide, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onpagehide, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onpagehide, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpagehide, in: jsObject] = newValue } } var onpageshow: EventHandler { - get { ClosureAttribute.Optional1[Keys.onpageshow, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onpageshow, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onpageshow, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpageshow, in: jsObject] = newValue } } var onpopstate: EventHandler { - get { ClosureAttribute.Optional1[Keys.onpopstate, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onpopstate, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onpopstate, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpopstate, in: jsObject] = newValue } } var onrejectionhandled: EventHandler { - get { ClosureAttribute.Optional1[Keys.onrejectionhandled, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onrejectionhandled, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onrejectionhandled, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onrejectionhandled, in: jsObject] = newValue } } var onstorage: EventHandler { - get { ClosureAttribute.Optional1[Keys.onstorage, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onstorage, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onstorage, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onstorage, in: jsObject] = newValue } } var onunhandledrejection: EventHandler { - get { ClosureAttribute.Optional1[Keys.onunhandledrejection, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onunhandledrejection, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onunhandledrejection, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onunhandledrejection, in: jsObject] = newValue } } var onunload: EventHandler { - get { ClosureAttribute.Optional1[Keys.onunload, in: jsObject] } - set { ClosureAttribute.Optional1[Keys.onunload, in: jsObject] = newValue } + get { ClosureAttribute.Optional1[Strings.onunload, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onunload, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/WindowLocalStorage.swift b/Sources/DOMKit/WebIDL/WindowLocalStorage.swift index 4fb37a47..909b1fe9 100644 --- a/Sources/DOMKit/WebIDL/WindowLocalStorage.swift +++ b/Sources/DOMKit/WebIDL/WindowLocalStorage.swift @@ -3,11 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let localStorage: JSString = "localStorage" -} - public protocol WindowLocalStorage: JSBridgedClass {} public extension WindowLocalStorage { - var localStorage: Storage { ReadonlyAttribute[Keys.localStorage, in: jsObject] } + var localStorage: Storage { ReadonlyAttribute[Strings.localStorage, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index 774311ed..3c7f9f8f 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -3,71 +3,53 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let atob: JSString = "atob" - static let btoa: JSString = "btoa" - static let clearInterval: JSString = "clearInterval" - static let clearTimeout: JSString = "clearTimeout" - static let createImageBitmap: JSString = "createImageBitmap" - static let crossOriginIsolated: JSString = "crossOriginIsolated" - static let fetch: JSString = "fetch" - static let isSecureContext: JSString = "isSecureContext" - static let origin: JSString = "origin" - static let performance: JSString = "performance" - static let queueMicrotask: JSString = "queueMicrotask" - static let reportError: JSString = "reportError" - static let setInterval: JSString = "setInterval" - static let setTimeout: JSString = "setTimeout" - static let structuredClone: JSString = "structuredClone" -} - public protocol WindowOrWorkerGlobalScope: JSBridgedClass {} public extension WindowOrWorkerGlobalScope { - var performance: Performance { ReadonlyAttribute[Keys.performance, in: jsObject] } + var performance: Performance { ReadonlyAttribute[Strings.performance, in: jsObject] } - var origin: String { ReadonlyAttribute[Keys.origin, in: jsObject] } + var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } - var isSecureContext: Bool { ReadonlyAttribute[Keys.isSecureContext, in: jsObject] } + var isSecureContext: Bool { ReadonlyAttribute[Strings.isSecureContext, in: jsObject] } - var crossOriginIsolated: Bool { ReadonlyAttribute[Keys.crossOriginIsolated, in: jsObject] } + var crossOriginIsolated: Bool { ReadonlyAttribute[Strings.crossOriginIsolated, in: jsObject] } func reportError(e: JSValue) { - _ = jsObject[Keys.reportError]!(e.jsValue()) + _ = jsObject[Strings.reportError]!(e.jsValue()) } func btoa(data: String) -> String { - jsObject[Keys.btoa]!(data.jsValue()).fromJSValue()! + jsObject[Strings.btoa]!(data.jsValue()).fromJSValue()! } func atob(data: String) -> String { - jsObject[Keys.atob]!(data.jsValue()).fromJSValue()! + jsObject[Strings.atob]!(data.jsValue()).fromJSValue()! } func setTimeout(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { - jsObject[Keys.setTimeout]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! + jsObject[Strings.setTimeout]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! } func clearTimeout(id: Int32? = nil) { - _ = jsObject[Keys.clearTimeout]!(id?.jsValue() ?? .undefined) + _ = jsObject[Strings.clearTimeout]!(id?.jsValue() ?? .undefined) } func setInterval(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { - jsObject[Keys.setInterval]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! + jsObject[Strings.setInterval]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! } func clearInterval(id: Int32? = nil) { - _ = jsObject[Keys.clearInterval]!(id?.jsValue() ?? .undefined) + _ = jsObject[Strings.clearInterval]!(id?.jsValue() ?? .undefined) } // XXX: method 'queueMicrotask' is ignored func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) -> JSPromise { - jsObject[Keys.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { - let _promise: JSPromise = jsObject[Keys.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -78,7 +60,7 @@ public extension WindowOrWorkerGlobalScope { let _arg3 = sw.jsValue() let _arg4 = sh.jsValue() let _arg5 = options?.jsValue() ?? .undefined - return jsObject[Keys.createImageBitmap]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + return jsObject[Strings.createImageBitmap]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @@ -89,21 +71,21 @@ public extension WindowOrWorkerGlobalScope { let _arg3 = sw.jsValue() let _arg4 = sh.jsValue() let _arg5 = options?.jsValue() ?? .undefined - let _promise: JSPromise = jsObject[Keys.createImageBitmap]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.createImageBitmap]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! return try await _promise.get().fromJSValue()! } func structuredClone(value: JSValue, options: StructuredSerializeOptions? = nil) -> JSValue { - jsObject[Keys.structuredClone]!(value.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.structuredClone]!(value.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { - jsObject[Keys.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func fetch(input: RequestInfo, init: RequestInit? = nil) async throws -> Response { - let _promise: JSPromise = jsObject[Keys.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift index 5f743c4e..8f7c420d 100644 --- a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift +++ b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class WindowPostMessageOptions: BridgedDictionary { - private enum Keys { - static let targetOrigin: JSString = "targetOrigin" - } - public convenience init(targetOrigin: String) { let object = JSObject.global.Object.function!.new() - object[Keys.targetOrigin] = targetOrigin.jsValue() + object[Strings.targetOrigin] = targetOrigin.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _targetOrigin = ReadWriteAttribute(jsObject: object, name: Keys.targetOrigin) + _targetOrigin = ReadWriteAttribute(jsObject: object, name: Strings.targetOrigin) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WindowSessionStorage.swift b/Sources/DOMKit/WebIDL/WindowSessionStorage.swift index 40049ec0..19ea0aae 100644 --- a/Sources/DOMKit/WebIDL/WindowSessionStorage.swift +++ b/Sources/DOMKit/WebIDL/WindowSessionStorage.swift @@ -3,11 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let sessionStorage: JSString = "sessionStorage" -} - public protocol WindowSessionStorage: JSBridgedClass {} public extension WindowSessionStorage { - var sessionStorage: Storage { ReadonlyAttribute[Keys.sessionStorage, in: jsObject] } + var sessionStorage: Storage { ReadonlyAttribute[Strings.sessionStorage, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index 2aa5486d..e05166ac 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -6,16 +6,9 @@ import JavaScriptKit public class Worker: EventTarget, AbstractWorker { override public class var constructor: JSFunction { JSObject.global.Worker.function! } - private enum Keys { - static let onmessage: JSString = "onmessage" - static let onmessageerror: JSString = "onmessageerror" - static let postMessage: JSString = "postMessage" - static let terminate: JSString = "terminate" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onmessageerror) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -24,15 +17,15 @@ public class Worker: EventTarget, AbstractWorker { } public func terminate() { - _ = jsObject[Keys.terminate]!() + _ = jsObject[Strings.terminate]!() } public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), transfer.jsValue()) + _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Keys.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } @ClosureAttribute.Optional1 diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index 8828bbff..fdcecbb0 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -6,29 +6,16 @@ import JavaScriptKit public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global.WorkerGlobalScope.function! } - private enum Keys { - static let importScripts: JSString = "importScripts" - static let location: JSString = "location" - static let navigator: JSString = "navigator" - static let onerror: JSString = "onerror" - static let onlanguagechange: JSString = "onlanguagechange" - static let onoffline: JSString = "onoffline" - static let ononline: JSString = "ononline" - static let onrejectionhandled: JSString = "onrejectionhandled" - static let onunhandledrejection: JSString = "onunhandledrejection" - static let `self`: JSString = "self" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _self = ReadonlyAttribute(jsObject: jsObject, name: Keys.self) - _location = ReadonlyAttribute(jsObject: jsObject, name: Keys.location) - _navigator = ReadonlyAttribute(jsObject: jsObject, name: Keys.navigator) - _onerror = ClosureAttribute.Optional5(jsObject: jsObject, name: Keys.onerror) - _onlanguagechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onlanguagechange) - _onoffline = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onoffline) - _ononline = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.ononline) - _onrejectionhandled = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onrejectionhandled) - _onunhandledrejection = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onunhandledrejection) + _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) + _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) + _navigator = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigator) + _onerror = ClosureAttribute.Optional5(jsObject: jsObject, name: Strings.onerror) + _onlanguagechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onlanguagechange) + _onoffline = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onoffline) + _ononline = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ononline) + _onrejectionhandled = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrejectionhandled) + _onunhandledrejection = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onunhandledrejection) super.init(unsafelyWrapping: jsObject) } @@ -42,7 +29,7 @@ public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope { public var navigator: WorkerNavigator public func importScripts(urls: String...) { - _ = jsObject[Keys.importScripts]!(urls.jsValue()) + _ = jsObject[Strings.importScripts]!(urls.jsValue()) } @ClosureAttribute.Optional5 diff --git a/Sources/DOMKit/WebIDL/WorkerLocation.swift b/Sources/DOMKit/WebIDL/WorkerLocation.swift index 40b50ff4..ac8aa25b 100644 --- a/Sources/DOMKit/WebIDL/WorkerLocation.swift +++ b/Sources/DOMKit/WebIDL/WorkerLocation.swift @@ -6,30 +6,18 @@ import JavaScriptKit public class WorkerLocation: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WorkerLocation.function! } - private enum Keys { - static let hash: JSString = "hash" - static let host: JSString = "host" - static let hostname: JSString = "hostname" - static let href: JSString = "href" - static let origin: JSString = "origin" - static let pathname: JSString = "pathname" - static let port: JSString = "port" - static let `protocol`: JSString = "protocol" - static let search: JSString = "search" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadonlyAttribute(jsObject: jsObject, name: Keys.href) - _origin = ReadonlyAttribute(jsObject: jsObject, name: Keys.origin) - _protocol = ReadonlyAttribute(jsObject: jsObject, name: Keys.protocol) - _host = ReadonlyAttribute(jsObject: jsObject, name: Keys.host) - _hostname = ReadonlyAttribute(jsObject: jsObject, name: Keys.hostname) - _port = ReadonlyAttribute(jsObject: jsObject, name: Keys.port) - _pathname = ReadonlyAttribute(jsObject: jsObject, name: Keys.pathname) - _search = ReadonlyAttribute(jsObject: jsObject, name: Keys.search) - _hash = ReadonlyAttribute(jsObject: jsObject, name: Keys.hash) + _href = ReadonlyAttribute(jsObject: jsObject, name: Strings.href) + _origin = ReadonlyAttribute(jsObject: jsObject, name: Strings.origin) + _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) + _host = ReadonlyAttribute(jsObject: jsObject, name: Strings.host) + _hostname = ReadonlyAttribute(jsObject: jsObject, name: Strings.hostname) + _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) + _pathname = ReadonlyAttribute(jsObject: jsObject, name: Strings.pathname) + _search = ReadonlyAttribute(jsObject: jsObject, name: Strings.search) + _hash = ReadonlyAttribute(jsObject: jsObject, name: Strings.hash) self.jsObject = jsObject } diff --git a/Sources/DOMKit/WebIDL/WorkerNavigator.swift b/Sources/DOMKit/WebIDL/WorkerNavigator.swift index 9dc89d33..3f859040 100644 --- a/Sources/DOMKit/WebIDL/WorkerNavigator.swift +++ b/Sources/DOMKit/WebIDL/WorkerNavigator.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class WorkerNavigator: JSBridgedClass, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware { public class var constructor: JSFunction { JSObject.global.WorkerNavigator.function! } - private enum Keys {} - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/WorkerOptions.swift b/Sources/DOMKit/WebIDL/WorkerOptions.swift index 243847ac..547ac4db 100644 --- a/Sources/DOMKit/WebIDL/WorkerOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkerOptions.swift @@ -4,24 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkerOptions: BridgedDictionary { - private enum Keys { - static let credentials: JSString = "credentials" - static let name: JSString = "name" - static let type: JSString = "type" - } - public convenience init(type: WorkerType, credentials: RequestCredentials, name: String) { let object = JSObject.global.Object.function!.new() - object[Keys.type] = type.jsValue() - object[Keys.credentials] = credentials.jsValue() - object[Keys.name] = name.jsValue() + object[Strings.type] = type.jsValue() + object[Strings.credentials] = credentials.jsValue() + object[Strings.name] = name.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Keys.type) - _credentials = ReadWriteAttribute(jsObject: object, name: Keys.credentials) - _name = ReadWriteAttribute(jsObject: object, name: Keys.name) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _credentials = ReadWriteAttribute(jsObject: object, name: Strings.credentials) + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Worklet.swift b/Sources/DOMKit/WebIDL/Worklet.swift index abc59f91..c45fc7bf 100644 --- a/Sources/DOMKit/WebIDL/Worklet.swift +++ b/Sources/DOMKit/WebIDL/Worklet.swift @@ -6,10 +6,6 @@ import JavaScriptKit public class Worklet: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.Worklet.function! } - private enum Keys { - static let addModule: JSString = "addModule" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,12 +13,12 @@ public class Worklet: JSBridgedClass { } public func addModule(moduleURL: String, options: WorkletOptions? = nil) -> JSPromise { - jsObject[Keys.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func addModule(moduleURL: String, options: WorkletOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Keys.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift index daf4d2cd..1deddd8d 100644 --- a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class WorkletGlobalScope: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WorkletGlobalScope.function! } - private enum Keys {} - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/WorkletOptions.swift b/Sources/DOMKit/WebIDL/WorkletOptions.swift index 633ca416..838dc1f0 100644 --- a/Sources/DOMKit/WebIDL/WorkletOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkletOptions.swift @@ -4,18 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkletOptions: BridgedDictionary { - private enum Keys { - static let credentials: JSString = "credentials" - } - public convenience init(credentials: RequestCredentials) { let object = JSObject.global.Object.function!.new() - object[Keys.credentials] = credentials.jsValue() + object[Strings.credentials] = credentials.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _credentials = ReadWriteAttribute(jsObject: object, name: Keys.credentials) + _credentials = ReadWriteAttribute(jsObject: object, name: Strings.credentials) super.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift index 0105bd89..02ccf7cf 100644 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -6,17 +6,10 @@ import JavaScriptKit public class WritableStream: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WritableStream.function! } - private enum Keys { - static let abort: JSString = "abort" - static let close: JSString = "close" - static let getWriter: JSString = "getWriter" - static let locked: JSString = "locked" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _locked = ReadonlyAttribute(jsObject: jsObject, name: Keys.locked) + _locked = ReadonlyAttribute(jsObject: jsObject, name: Strings.locked) self.jsObject = jsObject } @@ -28,26 +21,26 @@ public class WritableStream: JSBridgedClass { public var locked: Bool public func abort(reason: JSValue? = nil) -> JSPromise { - jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject[Keys.close]!().fromJSValue()! + jsObject[Strings.close]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func close() async throws { - let _promise: JSPromise = jsObject[Keys.close]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! _ = try await _promise.get() } public func getWriter() -> WritableStreamDefaultWriter { - jsObject[Keys.getWriter]!().fromJSValue()! + jsObject[Strings.getWriter]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift index 8280410c..57780c2f 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift @@ -6,15 +6,10 @@ import JavaScriptKit public class WritableStreamDefaultController: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WritableStreamDefaultController.function! } - private enum Keys { - static let error: JSString = "error" - static let signal: JSString = "signal" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _signal = ReadonlyAttribute(jsObject: jsObject, name: Keys.signal) + _signal = ReadonlyAttribute(jsObject: jsObject, name: Strings.signal) self.jsObject = jsObject } @@ -22,6 +17,6 @@ public class WritableStreamDefaultController: JSBridgedClass { public var signal: AbortSignal public func error(e: JSValue? = nil) { - _ = jsObject[Keys.error]!(e?.jsValue() ?? .undefined) + _ = jsObject[Strings.error]!(e?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift index a6b7e7f3..240861f0 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -6,22 +6,12 @@ import JavaScriptKit public class WritableStreamDefaultWriter: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.WritableStreamDefaultWriter.function! } - private enum Keys { - static let abort: JSString = "abort" - static let close: JSString = "close" - static let closed: JSString = "closed" - static let desiredSize: JSString = "desiredSize" - static let ready: JSString = "ready" - static let releaseLock: JSString = "releaseLock" - static let write: JSString = "write" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _closed = ReadonlyAttribute(jsObject: jsObject, name: Keys.closed) - _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Keys.desiredSize) - _ready = ReadonlyAttribute(jsObject: jsObject, name: Keys.ready) + _closed = ReadonlyAttribute(jsObject: jsObject, name: Strings.closed) + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.desiredSize) + _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) self.jsObject = jsObject } @@ -39,36 +29,36 @@ public class WritableStreamDefaultWriter: JSBridgedClass { public var ready: JSPromise public func abort(reason: JSValue? = nil) -> JSPromise { - jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Keys.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject[Keys.close]!().fromJSValue()! + jsObject[Strings.close]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func close() async throws { - let _promise: JSPromise = jsObject[Keys.close]!().fromJSValue()! + let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! _ = try await _promise.get() } public func releaseLock() { - _ = jsObject[Keys.releaseLock]!() + _ = jsObject[Strings.releaseLock]!() } public func write(chunk: JSValue? = nil) -> JSPromise { - jsObject[Keys.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func write(chunk: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Keys.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = jsObject[Strings.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/XMLDocument.swift b/Sources/DOMKit/WebIDL/XMLDocument.swift index 848b0081..acb045e7 100644 --- a/Sources/DOMKit/WebIDL/XMLDocument.swift +++ b/Sources/DOMKit/WebIDL/XMLDocument.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class XMLDocument: Document { override public class var constructor: JSFunction { JSObject.global.XMLDocument.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index eea36f96..f96f71b4 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -6,46 +6,19 @@ import JavaScriptKit public class XMLHttpRequest: XMLHttpRequestEventTarget { override public class var constructor: JSFunction { JSObject.global.XMLHttpRequest.function! } - private enum Keys { - static let DONE: JSString = "DONE" - static let HEADERS_RECEIVED: JSString = "HEADERS_RECEIVED" - static let LOADING: JSString = "LOADING" - static let OPENED: JSString = "OPENED" - static let UNSENT: JSString = "UNSENT" - static let abort: JSString = "abort" - static let getAllResponseHeaders: JSString = "getAllResponseHeaders" - static let getResponseHeader: JSString = "getResponseHeader" - static let onreadystatechange: JSString = "onreadystatechange" - static let open: JSString = "open" - static let overrideMimeType: JSString = "overrideMimeType" - static let readyState: JSString = "readyState" - static let response: JSString = "response" - static let responseText: JSString = "responseText" - static let responseType: JSString = "responseType" - static let responseURL: JSString = "responseURL" - static let responseXML: JSString = "responseXML" - static let send: JSString = "send" - static let setRequestHeader: JSString = "setRequestHeader" - static let status: JSString = "status" - static let statusText: JSString = "statusText" - static let timeout: JSString = "timeout" - static let upload: JSString = "upload" - static let withCredentials: JSString = "withCredentials" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onreadystatechange) - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Keys.readyState) - _timeout = ReadWriteAttribute(jsObject: jsObject, name: Keys.timeout) - _withCredentials = ReadWriteAttribute(jsObject: jsObject, name: Keys.withCredentials) - _upload = ReadonlyAttribute(jsObject: jsObject, name: Keys.upload) - _responseURL = ReadonlyAttribute(jsObject: jsObject, name: Keys.responseURL) - _status = ReadonlyAttribute(jsObject: jsObject, name: Keys.status) - _statusText = ReadonlyAttribute(jsObject: jsObject, name: Keys.statusText) - _responseType = ReadWriteAttribute(jsObject: jsObject, name: Keys.responseType) - _response = ReadonlyAttribute(jsObject: jsObject, name: Keys.response) - _responseText = ReadonlyAttribute(jsObject: jsObject, name: Keys.responseText) - _responseXML = ReadonlyAttribute(jsObject: jsObject, name: Keys.responseXML) + _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreadystatechange) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _timeout = ReadWriteAttribute(jsObject: jsObject, name: Strings.timeout) + _withCredentials = ReadWriteAttribute(jsObject: jsObject, name: Strings.withCredentials) + _upload = ReadonlyAttribute(jsObject: jsObject, name: Strings.upload) + _responseURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseURL) + _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) + _statusText = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusText) + _responseType = ReadWriteAttribute(jsObject: jsObject, name: Strings.responseType) + _response = ReadonlyAttribute(jsObject: jsObject, name: Strings.response) + _responseText = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseText) + _responseXML = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseXML) super.init(unsafelyWrapping: jsObject) } @@ -70,15 +43,15 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var readyState: UInt16 public func open(method: String, url: String) { - _ = jsObject[Keys.open]!(method.jsValue(), url.jsValue()) + _ = jsObject[Strings.open]!(method.jsValue(), url.jsValue()) } public func open(method: String, url: String, async: Bool, username: String? = nil, password: String? = nil) { - _ = jsObject[Keys.open]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined) + _ = jsObject[Strings.open]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined) } public func setRequestHeader(name: String, value: String) { - _ = jsObject[Keys.setRequestHeader]!(name.jsValue(), value.jsValue()) + _ = jsObject[Strings.setRequestHeader]!(name.jsValue(), value.jsValue()) } @ReadWriteAttribute @@ -91,11 +64,11 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var upload: XMLHttpRequestUpload public func send(body: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Keys.send]!(body?.jsValue() ?? .undefined) + _ = jsObject[Strings.send]!(body?.jsValue() ?? .undefined) } public func abort() { - _ = jsObject[Keys.abort]!() + _ = jsObject[Strings.abort]!() } @ReadonlyAttribute @@ -108,15 +81,15 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var statusText: String public func getResponseHeader(name: String) -> String? { - jsObject[Keys.getResponseHeader]!(name.jsValue()).fromJSValue()! + jsObject[Strings.getResponseHeader]!(name.jsValue()).fromJSValue()! } public func getAllResponseHeaders() -> String { - jsObject[Keys.getAllResponseHeaders]!().fromJSValue()! + jsObject[Strings.getAllResponseHeaders]!().fromJSValue()! } public func overrideMimeType(mime: String) { - _ = jsObject[Keys.overrideMimeType]!(mime.jsValue()) + _ = jsObject[Strings.overrideMimeType]!(mime.jsValue()) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift index c9a3d3c8..cc05ab7b 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift @@ -6,24 +6,14 @@ import JavaScriptKit public class XMLHttpRequestEventTarget: EventTarget { override public class var constructor: JSFunction { JSObject.global.XMLHttpRequestEventTarget.function! } - private enum Keys { - static let onabort: JSString = "onabort" - static let onerror: JSString = "onerror" - static let onload: JSString = "onload" - static let onloadend: JSString = "onloadend" - static let onloadstart: JSString = "onloadstart" - static let onprogress: JSString = "onprogress" - static let ontimeout: JSString = "ontimeout" - } - public required init(unsafelyWrapping jsObject: JSObject) { - _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onloadstart) - _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onprogress) - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onabort) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onerror) - _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onload) - _ontimeout = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.ontimeout) - _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: Keys.onloadend) + _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadstart) + _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprogress) + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onload) + _ontimeout = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontimeout) + _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadend) super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift index b52646c6..dfd38b44 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class XMLHttpRequestUpload: XMLHttpRequestEventTarget { override public class var constructor: JSFunction { JSObject.global.XMLHttpRequestUpload.function! } - private enum Keys {} - public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } diff --git a/Sources/DOMKit/WebIDL/XPathEvaluator.swift b/Sources/DOMKit/WebIDL/XPathEvaluator.swift index 5136016d..98be6b9d 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluator.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluator.swift @@ -6,8 +6,6 @@ import JavaScriptKit public class XPathEvaluator: JSBridgedClass, XPathEvaluatorBase { public class var constructor: JSFunction { JSObject.global.XPathEvaluator.function! } - private enum Keys {} - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift index 86a4493b..34302ee2 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluatorBase.swift @@ -3,12 +3,6 @@ import JavaScriptEventLoop import JavaScriptKit -private enum Keys { - static let createExpression: JSString = "createExpression" - static let createNSResolver: JSString = "createNSResolver" - static let evaluate: JSString = "evaluate" -} - public protocol XPathEvaluatorBase: JSBridgedClass {} public extension XPathEvaluatorBase { // XXX: method 'createExpression' is ignored diff --git a/Sources/DOMKit/WebIDL/XPathExpression.swift b/Sources/DOMKit/WebIDL/XPathExpression.swift index 3f844e90..02c0faab 100644 --- a/Sources/DOMKit/WebIDL/XPathExpression.swift +++ b/Sources/DOMKit/WebIDL/XPathExpression.swift @@ -6,10 +6,6 @@ import JavaScriptKit public class XPathExpression: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.XPathExpression.function! } - private enum Keys { - static let evaluate: JSString = "evaluate" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -17,6 +13,6 @@ public class XPathExpression: JSBridgedClass { } public func evaluate(contextNode: Node, type: UInt16? = nil, result: XPathResult? = nil) -> XPathResult { - jsObject[Keys.evaluate]!(contextNode.jsValue(), type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined).fromJSValue()! + jsObject[Strings.evaluate]!(contextNode.jsValue(), type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XPathResult.swift b/Sources/DOMKit/WebIDL/XPathResult.swift index fd17eae7..dc0c6b17 100644 --- a/Sources/DOMKit/WebIDL/XPathResult.swift +++ b/Sources/DOMKit/WebIDL/XPathResult.swift @@ -6,38 +6,16 @@ import JavaScriptKit public class XPathResult: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.XPathResult.function! } - private enum Keys { - static let ANY_TYPE: JSString = "ANY_TYPE" - static let ANY_UNORDERED_NODE_TYPE: JSString = "ANY_UNORDERED_NODE_TYPE" - static let BOOLEAN_TYPE: JSString = "BOOLEAN_TYPE" - static let FIRST_ORDERED_NODE_TYPE: JSString = "FIRST_ORDERED_NODE_TYPE" - static let NUMBER_TYPE: JSString = "NUMBER_TYPE" - static let ORDERED_NODE_ITERATOR_TYPE: JSString = "ORDERED_NODE_ITERATOR_TYPE" - static let ORDERED_NODE_SNAPSHOT_TYPE: JSString = "ORDERED_NODE_SNAPSHOT_TYPE" - static let STRING_TYPE: JSString = "STRING_TYPE" - static let UNORDERED_NODE_ITERATOR_TYPE: JSString = "UNORDERED_NODE_ITERATOR_TYPE" - static let UNORDERED_NODE_SNAPSHOT_TYPE: JSString = "UNORDERED_NODE_SNAPSHOT_TYPE" - static let booleanValue: JSString = "booleanValue" - static let invalidIteratorState: JSString = "invalidIteratorState" - static let iterateNext: JSString = "iterateNext" - static let numberValue: JSString = "numberValue" - static let resultType: JSString = "resultType" - static let singleNodeValue: JSString = "singleNodeValue" - static let snapshotItem: JSString = "snapshotItem" - static let snapshotLength: JSString = "snapshotLength" - static let stringValue: JSString = "stringValue" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _resultType = ReadonlyAttribute(jsObject: jsObject, name: Keys.resultType) - _numberValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.numberValue) - _stringValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.stringValue) - _booleanValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.booleanValue) - _singleNodeValue = ReadonlyAttribute(jsObject: jsObject, name: Keys.singleNodeValue) - _invalidIteratorState = ReadonlyAttribute(jsObject: jsObject, name: Keys.invalidIteratorState) - _snapshotLength = ReadonlyAttribute(jsObject: jsObject, name: Keys.snapshotLength) + _resultType = ReadonlyAttribute(jsObject: jsObject, name: Strings.resultType) + _numberValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberValue) + _stringValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.stringValue) + _booleanValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.booleanValue) + _singleNodeValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.singleNodeValue) + _invalidIteratorState = ReadonlyAttribute(jsObject: jsObject, name: Strings.invalidIteratorState) + _snapshotLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.snapshotLength) self.jsObject = jsObject } @@ -83,10 +61,10 @@ public class XPathResult: JSBridgedClass { public var snapshotLength: UInt32 public func iterateNext() -> Node? { - jsObject[Keys.iterateNext]!().fromJSValue()! + jsObject[Strings.iterateNext]!().fromJSValue()! } public func snapshotItem(index: UInt32) -> Node? { - jsObject[Keys.snapshotItem]!(index.jsValue()).fromJSValue()! + jsObject[Strings.snapshotItem]!(index.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift index 106132de..778bbac8 100644 --- a/Sources/DOMKit/WebIDL/XSLTProcessor.swift +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -6,17 +6,6 @@ import JavaScriptKit public class XSLTProcessor: JSBridgedClass { public class var constructor: JSFunction { JSObject.global.XSLTProcessor.function! } - private enum Keys { - static let clearParameters: JSString = "clearParameters" - static let getParameter: JSString = "getParameter" - static let importStylesheet: JSString = "importStylesheet" - static let removeParameter: JSString = "removeParameter" - static let reset: JSString = "reset" - static let setParameter: JSString = "setParameter" - static let transformToDocument: JSString = "transformToDocument" - static let transformToFragment: JSString = "transformToFragment" - } - public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { @@ -28,34 +17,34 @@ public class XSLTProcessor: JSBridgedClass { } public func importStylesheet(style: Node) { - _ = jsObject[Keys.importStylesheet]!(style.jsValue()) + _ = jsObject[Strings.importStylesheet]!(style.jsValue()) } public func transformToFragment(source: Node, output: Document) -> DocumentFragment { - jsObject[Keys.transformToFragment]!(source.jsValue(), output.jsValue()).fromJSValue()! + jsObject[Strings.transformToFragment]!(source.jsValue(), output.jsValue()).fromJSValue()! } public func transformToDocument(source: Node) -> Document { - jsObject[Keys.transformToDocument]!(source.jsValue()).fromJSValue()! + jsObject[Strings.transformToDocument]!(source.jsValue()).fromJSValue()! } public func setParameter(namespaceURI: String, localName: String, value: JSValue) { - _ = jsObject[Keys.setParameter]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()) + _ = jsObject[Strings.setParameter]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()) } public func getParameter(namespaceURI: String, localName: String) -> JSValue { - jsObject[Keys.getParameter]!(namespaceURI.jsValue(), localName.jsValue()).fromJSValue()! + jsObject[Strings.getParameter]!(namespaceURI.jsValue(), localName.jsValue()).fromJSValue()! } public func removeParameter(namespaceURI: String, localName: String) { - _ = jsObject[Keys.removeParameter]!(namespaceURI.jsValue(), localName.jsValue()) + _ = jsObject[Strings.removeParameter]!(namespaceURI.jsValue(), localName.jsValue()) } public func clearParameters() { - _ = jsObject[Keys.clearParameters]!() + _ = jsObject[Strings.clearParameters]!() } public func reset() { - _ = jsObject[Keys.reset]!() + _ = jsObject[Strings.reset]!() } } diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index d6585175..94570882 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -4,105 +4,83 @@ import JavaScriptEventLoop import JavaScriptKit public enum console { - private enum Keys { - static let assert: JSString = "assert" - static let clear: JSString = "clear" - static let count: JSString = "count" - static let countReset: JSString = "countReset" - static let debug: JSString = "debug" - static let dir: JSString = "dir" - static let dirxml: JSString = "dirxml" - static let error: JSString = "error" - static let group: JSString = "group" - static let groupCollapsed: JSString = "groupCollapsed" - static let groupEnd: JSString = "groupEnd" - static let info: JSString = "info" - static let log: JSString = "log" - static let table: JSString = "table" - static let time: JSString = "time" - static let timeEnd: JSString = "timeEnd" - static let timeLog: JSString = "timeLog" - static let trace: JSString = "trace" - static let warn: JSString = "warn" - } - public static var jsObject: JSObject { JSObject.global.console.object! } public static func assert(condition: Bool? = nil, data: JSValue...) { - _ = JSObject.global.console.object![Keys.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) + _ = JSObject.global.console.object![Strings.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) } public static func clear() { - _ = JSObject.global.console.object![Keys.clear]!() + _ = JSObject.global.console.object![Strings.clear]!() } public static func debug(data: JSValue...) { - _ = JSObject.global.console.object![Keys.debug]!(data.jsValue()) + _ = JSObject.global.console.object![Strings.debug]!(data.jsValue()) } public static func error(data: JSValue...) { - _ = JSObject.global.console.object![Keys.error]!(data.jsValue()) + _ = JSObject.global.console.object![Strings.error]!(data.jsValue()) } public static func info(data: JSValue...) { - _ = JSObject.global.console.object![Keys.info]!(data.jsValue()) + _ = JSObject.global.console.object![Strings.info]!(data.jsValue()) } public static func log(data: JSValue...) { - _ = JSObject.global.console.object![Keys.log]!(data.jsValue()) + _ = JSObject.global.console.object![Strings.log]!(data.jsValue()) } public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { - _ = JSObject.global.console.object![Keys.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Strings.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) } public static func trace(data: JSValue...) { - _ = JSObject.global.console.object![Keys.trace]!(data.jsValue()) + _ = JSObject.global.console.object![Strings.trace]!(data.jsValue()) } public static func warn(data: JSValue...) { - _ = JSObject.global.console.object![Keys.warn]!(data.jsValue()) + _ = JSObject.global.console.object![Strings.warn]!(data.jsValue()) } public static func dir(item: JSValue? = nil, options: JSObject? = nil) { - _ = JSObject.global.console.object![Keys.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Strings.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) } public static func dirxml(data: JSValue...) { - _ = JSObject.global.console.object![Keys.dirxml]!(data.jsValue()) + _ = JSObject.global.console.object![Strings.dirxml]!(data.jsValue()) } public static func count(label: String? = nil) { - _ = JSObject.global.console.object![Keys.count]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Strings.count]!(label?.jsValue() ?? .undefined) } public static func countReset(label: String? = nil) { - _ = JSObject.global.console.object![Keys.countReset]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Strings.countReset]!(label?.jsValue() ?? .undefined) } public static func group(data: JSValue...) { - _ = JSObject.global.console.object![Keys.group]!(data.jsValue()) + _ = JSObject.global.console.object![Strings.group]!(data.jsValue()) } public static func groupCollapsed(data: JSValue...) { - _ = JSObject.global.console.object![Keys.groupCollapsed]!(data.jsValue()) + _ = JSObject.global.console.object![Strings.groupCollapsed]!(data.jsValue()) } public static func groupEnd() { - _ = JSObject.global.console.object![Keys.groupEnd]!() + _ = JSObject.global.console.object![Strings.groupEnd]!() } public static func time(label: String? = nil) { - _ = JSObject.global.console.object![Keys.time]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Strings.time]!(label?.jsValue() ?? .undefined) } public static func timeLog(label: String? = nil, data: JSValue...) { - _ = JSObject.global.console.object![Keys.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) + _ = JSObject.global.console.object![Strings.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) } public static func timeEnd(label: String? = nil) { - _ = JSObject.global.console.object![Keys.timeEnd]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.console.object![Strings.timeEnd]!(label?.jsValue() ?? .undefined) } } diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index 31bcbab2..0195cf4f 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -3,6 +3,16 @@ enum Context { private(set) static var current = State() static var requiredClosureArgCounts: Set = [] + private(set) static var strings: Set = ["toString"] + + static func source(for name: String) -> SwiftSource { + assert(!name.isEmpty) + if name == "self" { + return "Strings._self" + } + strings.insert(name) + return "Strings.\(name)" + } private static var stack: [State] = [] static func withState(_ new: State, body: () throws -> T) rethrows -> T { diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 3ec4ff3f..dd431ca1 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -82,4 +82,16 @@ enum IDLBuilder { try writeFile(named: "ClosureAttribute", content: closureTypesContent.source) } + + static func generateStrings() throws { + let strings = Context.strings.sorted() + let stringsContent: SwiftSource = """ + enum Strings { + static let _self: JSString = "self" + \(lines: strings.map { "static let \($0): JSString = \(quoted: $0)" }) + } + """ + + try writeFile(named: "Strings", content: stringsContent.source) + } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 9773f85b..2012805b 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -34,12 +34,12 @@ extension IDLAttribute: SwiftRepresentable, Initializable { } else if Context.constructor == nil { // can't do property wrappers on extensions let setter: SwiftSource = """ - set { \(idlType.propertyWrapper(readonly: readonly))[Keys.\(name), in: jsObject] = newValue } + set { \(idlType.propertyWrapper(readonly: readonly))[\(Context.source(for: name)), in: jsObject] = newValue } """ return """ public var \(name): \(idlType) { - get { \(idlType.propertyWrapper(readonly: readonly))[Keys.\(name), in: jsObject] } + get { \(idlType.propertyWrapper(readonly: readonly))[\(Context.source(for: name)), in: jsObject] } \(readonly ? "" : setter) } """ @@ -54,25 +54,15 @@ extension IDLAttribute: SwiftRepresentable, Initializable { var initializer: SwiftSource? { assert(!Context.static) return """ - \(wrapperName) = \(idlType.propertyWrapper(readonly: readonly))(jsObject: jsObject, name: Keys.\(name)) + \(wrapperName) = \(idlType.propertyWrapper(readonly: readonly))(jsObject: jsObject, name: \(Context.source(for: name))) """ } } -private func printKeys(_ keys: [IDLNamed]) -> SwiftSource { - let validKeys = Set(keys.map(\.name).filter { !$0.isEmpty }) - return """ - private enum Keys { - \(lines: validKeys.sorted().map { "static let \($0): JSString = \(quoted: $0)" }) - } - """ -} - extension MergedDictionary: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ public class \(name): BridgedDictionary { - \(printKeys(members)) \(swiftInit) \(swiftMembers.joined(separator: "\n\n")) } @@ -95,11 +85,11 @@ extension MergedDictionary: SwiftRepresentable { \(lines: membersWithPropertyWrapper.map { member, wrapper in if member.idlType.isFunction { return """ - \(wrapper)[Keys.\(member.name), in: object] = \(member.name) + \(wrapper)[\(Context.source(for: member.name)), in: object] = \(member.name) """ } else { return """ - object[Keys.\(member.name)] = \(member.name).jsValue() + object[\(Context.source(for: member.name))] = \(member.name).jsValue() """ } }) @@ -108,7 +98,7 @@ extension MergedDictionary: SwiftRepresentable { public required init(unsafelyWrapping object: JSObject) { \(lines: membersWithPropertyWrapper.map { member, wrapper in - "_\(raw: member.name) = \(wrapper)(jsObject: object, name: Keys.\(member.name))" + "_\(raw: member.name) = \(wrapper)(jsObject: object, name: \(Context.source(for: member.name)))" }) super.init(unsafelyWrapping: object) } @@ -198,8 +188,6 @@ extension MergedInterface: SwiftRepresentable { public class \(name): \(sequence: inheritance.map(SwiftSource.init(_:))) { public\(parentClasses.isEmpty ? "" : " override") class var constructor: JSFunction { \(constructor) } - \(printKeys(members.compactMap { $0 as? IDLNamed })) - \(parentClasses.isEmpty ? "public let jsObject: JSObject" : "") public required init(unsafelyWrapping jsObject: JSObject) { @@ -235,8 +223,6 @@ extension MergedMixin: SwiftRepresentable { var swiftRepresentation: SwiftSource { Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name)")) { """ - \(printKeys(members)) - public protocol \(name): JSBridgedClass {} public extension \(name) { \(members.map(toSwift).joined(separator: "\n\n")) @@ -306,7 +292,6 @@ extension MergedNamespace: SwiftRepresentable { } return """ public enum \(name) { - \(printKeys(members.compactMap { $0 as? IDLNamed })) public static var jsObject: JSObject { \(this) } @@ -384,7 +369,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { return ( prep: "\(lines: prep)", - call: "\(Context.this)[Keys.\(name)]!(\(sequence: args))" + call: "\(Context.this)[\(Context.source(for: name))]!(\(sequence: args))" ) } diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index d1120582..a32aa75d 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -13,6 +13,8 @@ func main() { try IDLBuilder.generateIDLBindings(idl: idl) print("Generating closure property wrappers...") try IDLBuilder.generateClosureTypes() + print("Generating JSString constants...") + try IDLBuilder.generateStrings() SwiftFormatter.run() print("Done in \(Int(Date().timeIntervalSince(startTime) * 1000))ms.") } catch { From 432eba60199d2af66a7c736b3d427647d44efffd Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 09:13:33 -0400 Subject: [PATCH 089/124] Also look up global names using Strings --- Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 2012805b..990aa09d 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -81,7 +81,7 @@ extension MergedDictionary: SwiftRepresentable { } return """ public convenience init(\(sequence: params)) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[\(Context.source(for: "Object"))].function!.new() \(lines: membersWithPropertyWrapper.map { member, wrapper in if member.idlType.isFunction { return """ @@ -161,7 +161,7 @@ protocol Initializable { extension MergedInterface: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let constructor: SwiftSource = "JSObject.global.\(name).function!" + let constructor: SwiftSource = "JSObject.global[\(Context.source(for: name))].function!" let body = Context.withState(.instance(constructor: constructor, this: "jsObject", className: "\(name)")) { members.map { member in let isOverride: Bool @@ -286,7 +286,7 @@ extension IDLIterableDeclaration: SwiftRepresentable, Initializable { extension MergedNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let this: SwiftSource = "JSObject.global.\(name).object!" + let this: SwiftSource = "JSObject.global.[\(Context.source(for: name))].object!" let body = Context.withState(.static(this: this, inClass: false, className: "\(name)")) { members.map(toSwift).joined(separator: "\n\n") } From 6dc015f52ef5cd5edb2e6e34e1855cde6559d6b9 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 09:14:10 -0400 Subject: [PATCH 090/124] Add the rest of the APIs! --- .../WebIDL/ANGLE_instanced_arrays.swift | 28 + Sources/DOMKit/WebIDL/AbortController.swift | 2 +- Sources/DOMKit/WebIDL/AbortSignal.swift | 2 +- .../AbsoluteOrientationReadingValues.swift | 20 + .../WebIDL/AbsoluteOrientationSensor.swift | 16 + Sources/DOMKit/WebIDL/AbstractRange.swift | 2 +- Sources/DOMKit/WebIDL/Accelerometer.swift | 28 + .../AccelerometerLocalCoordinateSystem.swift | 22 + .../WebIDL/AccelerometerReadingValues.swift | 30 + .../WebIDL/AccelerometerSensorOptions.swift | 20 + .../WebIDL/AddEventListenerOptions.swift | 2 +- Sources/DOMKit/WebIDL/AesCbcParams.swift | 20 + Sources/DOMKit/WebIDL/AesCtrParams.swift | 25 + .../DOMKit/WebIDL/AesDerivedKeyParams.swift | 20 + Sources/DOMKit/WebIDL/AesGcmParams.swift | 30 + Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift | 20 + Sources/DOMKit/WebIDL/AesKeyGenParams.swift | 20 + Sources/DOMKit/WebIDL/Algorithm.swift | 20 + Sources/DOMKit/WebIDL/AlignSetting.swift | 25 + .../WebIDL/AllowedBluetoothDevice.swift | 35 + Sources/DOMKit/WebIDL/AllowedUSBDevice.swift | 30 + Sources/DOMKit/WebIDL/AlphaOption.swift | 22 + .../WebIDL/AmbientLightReadingValues.swift | 20 + .../DOMKit/WebIDL/AmbientLightSensor.swift | 20 + Sources/DOMKit/WebIDL/AnalyserNode.swift | 52 + Sources/DOMKit/WebIDL/AnalyserOptions.swift | 35 + Sources/DOMKit/WebIDL/Animatable.swift | 15 + Sources/DOMKit/WebIDL/Animation.swift | 104 + Sources/DOMKit/WebIDL/AnimationEffect.swift | 54 + Sources/DOMKit/WebIDL/AnimationEvent.swift | 28 + .../DOMKit/WebIDL/AnimationEventInit.swift | 30 + Sources/DOMKit/WebIDL/AnimationNodeList.swift | 22 + .../DOMKit/WebIDL/AnimationPlayState.swift | 24 + .../WebIDL/AnimationPlaybackEvent.swift | 24 + .../WebIDL/AnimationPlaybackEventInit.swift | 25 + .../DOMKit/WebIDL/AnimationReplaceState.swift | 23 + Sources/DOMKit/WebIDL/AnimationTimeline.swift | 30 + .../WebIDL/AnimationWorkletGlobalScope.swift | 16 + .../WebIDL/AppBannerPromptOutcome.swift | 22 + Sources/DOMKit/WebIDL/AppendMode.swift | 22 + .../DOMKit/WebIDL/AssignedNodesOptions.swift | 2 +- .../AttestationConveyancePreference.swift | 24 + Sources/DOMKit/WebIDL/Attr.swift | 2 +- .../DOMKit/WebIDL/AttributionReporting.swift | 24 + .../WebIDL/AttributionSourceParams.swift | 40 + Sources/DOMKit/WebIDL/AudioBuffer.swift | 46 + .../DOMKit/WebIDL/AudioBufferOptions.swift | 30 + .../DOMKit/WebIDL/AudioBufferSourceNode.swift | 44 + .../WebIDL/AudioBufferSourceOptions.swift | 45 + .../DOMKit/WebIDL/AudioConfiguration.swift | 40 + Sources/DOMKit/WebIDL/AudioContext.swift | 74 + .../WebIDL/AudioContextLatencyCategory.swift | 23 + .../DOMKit/WebIDL/AudioContextOptions.swift | 25 + Sources/DOMKit/WebIDL/AudioContextState.swift | 23 + Sources/DOMKit/WebIDL/AudioData.swift | 58 + .../WebIDL/AudioDataCopyToOptions.swift | 35 + Sources/DOMKit/WebIDL/AudioDataInit.swift | 45 + Sources/DOMKit/WebIDL/AudioDecoder.swift | 62 + .../DOMKit/WebIDL/AudioDecoderConfig.swift | 35 + Sources/DOMKit/WebIDL/AudioDecoderInit.swift | 25 + .../DOMKit/WebIDL/AudioDecoderSupport.swift | 25 + .../DOMKit/WebIDL/AudioDestinationNode.swift | 16 + Sources/DOMKit/WebIDL/AudioEncoder.swift | 62 + .../DOMKit/WebIDL/AudioEncoderConfig.swift | 35 + Sources/DOMKit/WebIDL/AudioEncoderInit.swift | 25 + .../DOMKit/WebIDL/AudioEncoderSupport.swift | 25 + Sources/DOMKit/WebIDL/AudioListener.swift | 64 + Sources/DOMKit/WebIDL/AudioNode.swift | 72 + Sources/DOMKit/WebIDL/AudioNodeOptions.swift | 30 + .../DOMKit/WebIDL/AudioOutputOptions.swift | 20 + Sources/DOMKit/WebIDL/AudioParam.swift | 62 + .../DOMKit/WebIDL/AudioParamDescriptor.swift | 40 + Sources/DOMKit/WebIDL/AudioParamMap.swift | 16 + .../DOMKit/WebIDL/AudioProcessingEvent.swift | 28 + .../WebIDL/AudioProcessingEventInit.swift | 30 + Sources/DOMKit/WebIDL/AudioSampleFormat.swift | 28 + .../WebIDL/AudioScheduledSourceNode.swift | 24 + Sources/DOMKit/WebIDL/AudioTimestamp.swift | 25 + Sources/DOMKit/WebIDL/AudioTrack.swift | 6 +- Sources/DOMKit/WebIDL/AudioTrackList.swift | 2 +- Sources/DOMKit/WebIDL/AudioWorklet.swift | 12 + .../WebIDL/AudioWorkletGlobalScope.swift | 28 + Sources/DOMKit/WebIDL/AudioWorkletNode.swift | 28 + .../WebIDL/AudioWorkletNodeOptions.swift | 40 + .../DOMKit/WebIDL/AudioWorkletProcessor.swift | 22 + ...AuthenticationExtensionsClientInputs.swift | 45 + ...uthenticationExtensionsClientOutputs.swift | 40 + ...henticationExtensionsLargeBlobInputs.swift | 30 + ...enticationExtensionsLargeBlobOutputs.swift | 30 + ...uthenticationExtensionsPaymentInputs.swift | 45 + .../AuthenticatorAssertionResponse.swift | 24 + .../WebIDL/AuthenticatorAttachment.swift | 22 + .../AuthenticatorAttestationResponse.swift | 32 + .../DOMKit/WebIDL/AuthenticatorResponse.swift | 18 + .../AuthenticatorSelectionCriteria.swift | 35 + .../WebIDL/AuthenticatorTransport.swift | 24 + Sources/DOMKit/WebIDL/AutoKeyword.swift | 21 + Sources/DOMKit/WebIDL/AutomationRate.swift | 22 + Sources/DOMKit/WebIDL/AutoplayPolicy.swift | 23 + .../WebIDL/AutoplayPolicyMediaType.swift | 22 + .../DOMKit/WebIDL/BackgroundFetchEvent.swift | 20 + .../WebIDL/BackgroundFetchEventInit.swift | 20 + .../WebIDL/BackgroundFetchFailureReason.swift | 26 + .../WebIDL/BackgroundFetchManager.swift | 44 + .../WebIDL/BackgroundFetchOptions.swift | 20 + .../DOMKit/WebIDL/BackgroundFetchRecord.swift | 22 + .../WebIDL/BackgroundFetchRegistration.swift | 78 + .../DOMKit/WebIDL/BackgroundFetchResult.swift | 23 + .../WebIDL/BackgroundFetchUIOptions.swift | 25 + .../WebIDL/BackgroundFetchUpdateUIEvent.swift | 26 + .../DOMKit/WebIDL/BackgroundSyncOptions.swift | 20 + Sources/DOMKit/WebIDL/BarProp.swift | 2 +- Sources/DOMKit/WebIDL/BarcodeDetector.swift | 38 + .../WebIDL/BarcodeDetectorOptions.swift | 20 + Sources/DOMKit/WebIDL/BarcodeFormat.swift | 34 + Sources/DOMKit/WebIDL/BaseAudioContext.swift | 122 + .../DOMKit/WebIDL/BaseComputedKeyframe.swift | 35 + Sources/DOMKit/WebIDL/BaseKeyframe.swift | 30 + .../WebIDL/BasePropertyIndexedKeyframe.swift | 30 + Sources/DOMKit/WebIDL/Baseline.swift | 22 + Sources/DOMKit/WebIDL/BatteryManager.swift | 44 + .../WebIDL/BeforeInstallPromptEvent.swift | 26 + Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift | 2 +- Sources/DOMKit/WebIDL/BinaryType.swift | 22 + Sources/DOMKit/WebIDL/BiquadFilterNode.swift | 40 + .../DOMKit/WebIDL/BiquadFilterOptions.swift | 40 + Sources/DOMKit/WebIDL/BiquadFilterType.swift | 28 + Sources/DOMKit/WebIDL/BitrateMode.swift | 22 + Sources/DOMKit/WebIDL/Blob.swift | 2 +- Sources/DOMKit/WebIDL/BlobEvent.swift | 24 + Sources/DOMKit/WebIDL/BlobEventInit.swift | 25 + Sources/DOMKit/WebIDL/BlobPropertyBag.swift | 2 +- .../WebIDL/BlockFragmentationType.swift | 24 + Sources/DOMKit/WebIDL/Bluetooth.swift | 50 + .../WebIDL/BluetoothAdvertisingEvent.swift | 48 + .../BluetoothAdvertisingEventInit.swift | 55 + .../BluetoothCharacteristicProperties.swift | 50 + .../WebIDL/BluetoothDataFilterInit.swift | 25 + Sources/DOMKit/WebIDL/BluetoothDevice.swift | 38 + .../WebIDL/BluetoothDeviceEventHandlers.swift | 17 + .../WebIDL/BluetoothLEScanFilterInit.swift | 40 + .../BluetoothManufacturerDataFilterInit.swift | 20 + .../WebIDL/BluetoothManufacturerDataMap.swift | 16 + .../BluetoothPermissionDescriptor.swift | 40 + .../WebIDL/BluetoothPermissionResult.swift | 16 + .../WebIDL/BluetoothPermissionStorage.swift | 20 + .../BluetoothRemoteGATTCharacteristic.swift | 108 + .../BluetoothRemoteGATTDescriptor.swift | 46 + .../WebIDL/BluetoothRemoteGATTServer.swift | 56 + .../WebIDL/BluetoothRemoteGATTService.swift | 64 + .../BluetoothServiceDataFilterInit.swift | 20 + .../WebIDL/BluetoothServiceDataMap.swift | 16 + Sources/DOMKit/WebIDL/BluetoothUUID.swift | 30 + Sources/DOMKit/WebIDL/BoxQuadOptions.swift | 25 + Sources/DOMKit/WebIDL/BreakToken.swift | 22 + Sources/DOMKit/WebIDL/BreakTokenOptions.swift | 25 + Sources/DOMKit/WebIDL/BreakType.swift | 25 + Sources/DOMKit/WebIDL/BroadcastChannel.swift | 2 +- .../BrowserCaptureMediaStreamTrack.swift | 26 + .../WebIDL/ByteLengthQueuingStrategy.swift | 2 +- Sources/DOMKit/WebIDL/CDATASection.swift | 2 +- .../WebIDL/CSPViolationReportBody.swift | 56 + Sources/DOMKit/WebIDL/CSS.swift | 312 +- Sources/DOMKit/WebIDL/CSSAnimation.swift | 16 + Sources/DOMKit/WebIDL/CSSBoxType.swift | 24 + Sources/DOMKit/WebIDL/CSSColor.swift | 31 + Sources/DOMKit/WebIDL/CSSColorValue.swift | 23 + Sources/DOMKit/WebIDL/CSSConditionRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSContainerRule.swift | 12 + .../DOMKit/WebIDL/CSSCounterStyleRule.swift | 56 + Sources/DOMKit/WebIDL/CSSFontFaceRule.swift | 16 + .../WebIDL/CSSFontFeatureValuesMap.swift | 20 + .../WebIDL/CSSFontFeatureValuesRule.swift | 40 + .../WebIDL/CSSFontPaletteValuesRule.swift | 28 + Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSHSL.swift | 32 + Sources/DOMKit/WebIDL/CSSHWB.swift | 32 + Sources/DOMKit/WebIDL/CSSImageValue.swift | 12 + Sources/DOMKit/WebIDL/CSSImportRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSKeyframeRule.swift | 20 + Sources/DOMKit/WebIDL/CSSKeyframesRule.swift | 32 + Sources/DOMKit/WebIDL/CSSKeywordValue.swift | 20 + Sources/DOMKit/WebIDL/CSSLCH.swift | 32 + Sources/DOMKit/WebIDL/CSSLab.swift | 32 + Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift | 16 + .../DOMKit/WebIDL/CSSLayerStatementRule.swift | 16 + Sources/DOMKit/WebIDL/CSSMarginRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathClamp.swift | 28 + Sources/DOMKit/WebIDL/CSSMathInvert.swift | 20 + Sources/DOMKit/WebIDL/CSSMathMax.swift | 20 + Sources/DOMKit/WebIDL/CSSMathMin.swift | 20 + Sources/DOMKit/WebIDL/CSSMathNegate.swift | 20 + Sources/DOMKit/WebIDL/CSSMathOperator.swift | 27 + Sources/DOMKit/WebIDL/CSSMathProduct.swift | 20 + Sources/DOMKit/WebIDL/CSSMathSum.swift | 20 + Sources/DOMKit/WebIDL/CSSMathValue.swift | 16 + .../DOMKit/WebIDL/CSSMatrixComponent.swift | 20 + .../WebIDL/CSSMatrixComponentOptions.swift | 20 + Sources/DOMKit/WebIDL/CSSMediaRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSNamespaceRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSNestingRule.swift | 32 + Sources/DOMKit/WebIDL/CSSNumericArray.swift | 27 + .../DOMKit/WebIDL/CSSNumericBaseType.swift | 27 + Sources/DOMKit/WebIDL/CSSNumericType.swift | 55 + Sources/DOMKit/WebIDL/CSSNumericValue.swift | 55 + Sources/DOMKit/WebIDL/CSSOKLCH.swift | 32 + Sources/DOMKit/WebIDL/CSSOKLab.swift | 32 + Sources/DOMKit/WebIDL/CSSPageRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserAtRule.swift | 32 + Sources/DOMKit/WebIDL/CSSParserBlock.swift | 28 + .../DOMKit/WebIDL/CSSParserDeclaration.swift | 28 + Sources/DOMKit/WebIDL/CSSParserFunction.swift | 28 + Sources/DOMKit/WebIDL/CSSParserOptions.swift | 20 + .../WebIDL/CSSParserQualifiedRule.swift | 28 + Sources/DOMKit/WebIDL/CSSParserRule.swift | 14 + Sources/DOMKit/WebIDL/CSSParserValue.swift | 14 + Sources/DOMKit/WebIDL/CSSPerspective.swift | 20 + Sources/DOMKit/WebIDL/CSSPropertyRule.swift | 28 + Sources/DOMKit/WebIDL/CSSPseudoElement.swift | 28 + Sources/DOMKit/WebIDL/CSSRGB.swift | 32 + Sources/DOMKit/WebIDL/CSSRotate.swift | 36 + Sources/DOMKit/WebIDL/CSSRule.swift | 14 +- Sources/DOMKit/WebIDL/CSSRuleList.swift | 2 +- Sources/DOMKit/WebIDL/CSSScale.swift | 28 + .../DOMKit/WebIDL/CSSScrollTimelineRule.swift | 28 + Sources/DOMKit/WebIDL/CSSSkew.swift | 24 + Sources/DOMKit/WebIDL/CSSSkewX.swift | 20 + Sources/DOMKit/WebIDL/CSSSkewY.swift | 20 + .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 2 +- Sources/DOMKit/WebIDL/CSSStyleRule.swift | 18 +- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 2 +- Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift | 2 +- Sources/DOMKit/WebIDL/CSSStyleValue.swift | 26 + Sources/DOMKit/WebIDL/CSSSupportsRule.swift | 2 +- .../DOMKit/WebIDL/CSSTransformComponent.swift | 26 + Sources/DOMKit/WebIDL/CSSTransformValue.swift | 39 + Sources/DOMKit/WebIDL/CSSTransition.swift | 16 + Sources/DOMKit/WebIDL/CSSTranslate.swift | 28 + Sources/DOMKit/WebIDL/CSSUnitValue.swift | 24 + Sources/DOMKit/WebIDL/CSSUnparsedValue.swift | 31 + .../WebIDL/CSSVariableReferenceValue.swift | 26 + Sources/DOMKit/WebIDL/CSSViewportRule.swift | 16 + Sources/DOMKit/WebIDL/Cache.swift | 84 + Sources/DOMKit/WebIDL/CacheQueryOptions.swift | 30 + Sources/DOMKit/WebIDL/CacheStorage.swift | 64 + .../CameraDevicePermissionDescriptor.swift | 20 + .../DOMKit/WebIDL/CanMakePaymentEvent.swift | 32 + .../WebIDL/CanMakePaymentEventInit.swift | 30 + .../CanvasCaptureMediaStreamTrack.swift | 20 + Sources/DOMKit/WebIDL/CanvasFilter.swift | 2 +- Sources/DOMKit/WebIDL/CanvasGradient.swift | 2 +- Sources/DOMKit/WebIDL/CanvasPattern.swift | 2 +- .../WebIDL/CanvasRenderingContext2D.swift | 2 +- .../CanvasRenderingContext2DSettings.swift | 2 +- Sources/DOMKit/WebIDL/CaretPosition.swift | 26 + Sources/DOMKit/WebIDL/ChannelCountMode.swift | 23 + .../DOMKit/WebIDL/ChannelInterpretation.swift | 22 + Sources/DOMKit/WebIDL/ChannelMergerNode.swift | 16 + .../DOMKit/WebIDL/ChannelMergerOptions.swift | 20 + .../DOMKit/WebIDL/ChannelSplitterNode.swift | 16 + .../WebIDL/ChannelSplitterOptions.swift | 20 + .../WebIDL/CharacterBoundsUpdateEvent.swift | 24 + .../CharacterBoundsUpdateEventInit.swift | 25 + Sources/DOMKit/WebIDL/CharacterData.swift | 2 +- .../WebIDL/CharacteristicEventHandlers.swift | 12 + Sources/DOMKit/WebIDL/ChildBreakToken.swift | 22 + Sources/DOMKit/WebIDL/ChildDisplayType.swift | 22 + Sources/DOMKit/WebIDL/Client.swift | 42 + .../DOMKit/WebIDL/ClientLifecycleState.swift | 22 + .../DOMKit/WebIDL/ClientQueryOptions.swift | 25 + Sources/DOMKit/WebIDL/ClientType.swift | 24 + Sources/DOMKit/WebIDL/Clients.swift | 54 + Sources/DOMKit/WebIDL/Clipboard.swift | 52 + Sources/DOMKit/WebIDL/ClipboardEvent.swift | 20 + .../DOMKit/WebIDL/ClipboardEventInit.swift | 20 + Sources/DOMKit/WebIDL/ClipboardItem.swift | 36 + .../DOMKit/WebIDL/ClipboardItemOptions.swift | 20 + .../ClipboardPermissionDescriptor.swift | 20 + Sources/DOMKit/WebIDL/CloseEvent.swift | 28 + Sources/DOMKit/WebIDL/CloseEventInit.swift | 30 + Sources/DOMKit/WebIDL/CloseWatcher.swift | 32 + .../DOMKit/WebIDL/CloseWatcherOptions.swift | 20 + Sources/DOMKit/WebIDL/ClosureAttribute.swift | 64 + Sources/DOMKit/WebIDL/CodecState.swift | 23 + ...CollectedClientAdditionalPaymentData.swift | 40 + .../DOMKit/WebIDL/CollectedClientData.swift | 35 + .../WebIDL/CollectedClientPaymentData.swift | 20 + Sources/DOMKit/WebIDL/ColorGamut.swift | 23 + .../DOMKit/WebIDL/ColorSelectionOptions.swift | 20 + .../DOMKit/WebIDL/ColorSelectionResult.swift | 20 + Sources/DOMKit/WebIDL/Comment.swift | 2 +- .../DOMKit/WebIDL/CompositeOperation.swift | 23 + .../WebIDL/CompositeOperationOrAuto.swift | 24 + Sources/DOMKit/WebIDL/CompositionEvent.swift | 2 +- .../DOMKit/WebIDL/CompositionEventInit.swift | 2 +- Sources/DOMKit/WebIDL/CompressionStream.swift | 18 + .../DOMKit/WebIDL/ComputePressureFactor.swift | 22 + .../WebIDL/ComputePressureObserver.swift | 48 + .../ComputePressureObserverOptions.swift | 20 + .../DOMKit/WebIDL/ComputePressureRecord.swift | 35 + .../DOMKit/WebIDL/ComputePressureSource.swift | 21 + .../DOMKit/WebIDL/ComputePressureState.swift | 24 + .../DOMKit/WebIDL/ComputedEffectTiming.swift | 45 + Sources/DOMKit/WebIDL/ConnectionType.swift | 29 + .../DOMKit/WebIDL/ConstantSourceNode.swift | 20 + .../DOMKit/WebIDL/ConstantSourceOptions.swift | 20 + .../WebIDL/ConstrainBooleanParameters.swift | 25 + .../WebIDL/ConstrainDOMStringParameters.swift | 25 + .../DOMKit/WebIDL/ConstrainDoubleRange.swift | 25 + .../WebIDL/ConstrainPoint2DParameters.swift | 25 + .../DOMKit/WebIDL/ConstrainULongRange.swift | 25 + Sources/DOMKit/WebIDL/ContactAddress.swift | 58 + Sources/DOMKit/WebIDL/ContactInfo.swift | 40 + Sources/DOMKit/WebIDL/ContactProperty.swift | 25 + Sources/DOMKit/WebIDL/ContactsManager.swift | 34 + .../DOMKit/WebIDL/ContactsSelectOptions.swift | 20 + Sources/DOMKit/WebIDL/ContentCategory.swift | 25 + .../DOMKit/WebIDL/ContentDescription.swift | 45 + Sources/DOMKit/WebIDL/ContentIndex.swift | 44 + Sources/DOMKit/WebIDL/ContentIndexEvent.swift | 20 + .../DOMKit/WebIDL/ContentIndexEventInit.swift | 20 + .../WebIDL/ConvertCoordinateOptions.swift | 25 + Sources/DOMKit/WebIDL/ConvolverNode.swift | 24 + Sources/DOMKit/WebIDL/ConvolverOptions.swift | 25 + Sources/DOMKit/WebIDL/CookieChangeEvent.swift | 24 + .../DOMKit/WebIDL/CookieChangeEventInit.swift | 25 + Sources/DOMKit/WebIDL/CookieInit.swift | 45 + Sources/DOMKit/WebIDL/CookieListItem.swift | 50 + Sources/DOMKit/WebIDL/CookieSameSite.swift | 23 + Sources/DOMKit/WebIDL/CookieStore.swift | 96 + .../WebIDL/CookieStoreDeleteOptions.swift | 30 + .../DOMKit/WebIDL/CookieStoreGetOptions.swift | 25 + .../DOMKit/WebIDL/CookieStoreManager.swift | 44 + .../DOMKit/WebIDL/CountQueuingStrategy.swift | 2 +- Sources/DOMKit/WebIDL/CrashReportBody.swift | 20 + Sources/DOMKit/WebIDL/Credential.swift | 26 + .../WebIDL/CredentialCreationOptions.swift | 35 + Sources/DOMKit/WebIDL/CredentialData.swift | 20 + .../CredentialMediationRequirement.swift | 24 + .../WebIDL/CredentialPropertiesOutput.swift | 20 + .../WebIDL/CredentialRequestOptions.swift | 45 + .../DOMKit/WebIDL/CredentialUserData.swift | 11 + .../DOMKit/WebIDL/CredentialsContainer.swift | 54 + Sources/DOMKit/WebIDL/CropTarget.swift | 14 + Sources/DOMKit/WebIDL/Crypto.swift | 26 + Sources/DOMKit/WebIDL/CryptoKey.swift | 30 + Sources/DOMKit/WebIDL/CryptoKeyPair.swift | 25 + .../WebIDL/CursorCaptureConstraint.swift | 23 + .../DOMKit/WebIDL/CustomElementRegistry.swift | 2 +- Sources/DOMKit/WebIDL/CustomEvent.swift | 2 +- Sources/DOMKit/WebIDL/CustomEventInit.swift | 2 +- Sources/DOMKit/WebIDL/CustomStateSet.swift | 20 + Sources/DOMKit/WebIDL/DOMException.swift | 2 +- Sources/DOMKit/WebIDL/DOMImplementation.swift | 2 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 2 +- Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift | 2 +- Sources/DOMKit/WebIDL/DOMMatrixInit.swift | 2 +- Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 2 +- Sources/DOMKit/WebIDL/DOMParser.swift | 2 +- Sources/DOMKit/WebIDL/DOMPoint.swift | 2 +- Sources/DOMKit/WebIDL/DOMPointInit.swift | 2 +- Sources/DOMKit/WebIDL/DOMPointReadOnly.swift | 2 +- Sources/DOMKit/WebIDL/DOMQuad.swift | 2 +- Sources/DOMKit/WebIDL/DOMQuadInit.swift | 2 +- Sources/DOMKit/WebIDL/DOMRect.swift | 2 +- Sources/DOMKit/WebIDL/DOMRectInit.swift | 2 +- Sources/DOMKit/WebIDL/DOMRectList.swift | 2 +- Sources/DOMKit/WebIDL/DOMRectReadOnly.swift | 2 +- Sources/DOMKit/WebIDL/DOMStringList.swift | 2 +- Sources/DOMKit/WebIDL/DOMStringMap.swift | 2 +- Sources/DOMKit/WebIDL/DOMTokenList.swift | 2 +- Sources/DOMKit/WebIDL/DataCue.swift | 24 + Sources/DOMKit/WebIDL/DataTransfer.swift | 2 +- Sources/DOMKit/WebIDL/DataTransferItem.swift | 16 +- .../DOMKit/WebIDL/DataTransferItemList.swift | 2 +- .../DOMKit/WebIDL/DecompressionStream.swift | 18 + .../WebIDL/DedicatedWorkerGlobalScope.swift | 6 +- Sources/DOMKit/WebIDL/DelayNode.swift | 20 + Sources/DOMKit/WebIDL/DelayOptions.swift | 25 + .../DOMKit/WebIDL/DeprecationReportBody.swift | 40 + Sources/DOMKit/WebIDL/DetectedBarcode.swift | 35 + Sources/DOMKit/WebIDL/DetectedFace.swift | 25 + Sources/DOMKit/WebIDL/DetectedText.swift | 30 + Sources/DOMKit/WebIDL/DeviceMotionEvent.swift | 42 + .../DeviceMotionEventAcceleration.swift | 26 + .../DeviceMotionEventAccelerationInit.swift | 30 + .../DOMKit/WebIDL/DeviceMotionEventInit.swift | 35 + .../DeviceMotionEventRotationRate.swift | 26 + .../DeviceMotionEventRotationRateInit.swift | 30 + .../WebIDL/DeviceOrientationEvent.swift | 42 + .../WebIDL/DeviceOrientationEventInit.swift | 35 + .../WebIDL/DevicePermissionDescriptor.swift | 20 + Sources/DOMKit/WebIDL/DevicePosture.swift | 20 + Sources/DOMKit/WebIDL/DevicePostureType.swift | 23 + .../DOMKit/WebIDL/DigitalGoodsService.swift | 54 + Sources/DOMKit/WebIDL/DirectionSetting.swift | 23 + .../WebIDL/DirectoryPickerOptions.swift | 25 + .../WebIDL/DisplayCaptureSurfaceType.swift | 24 + .../DisplayMediaStreamConstraints.swift | 25 + Sources/DOMKit/WebIDL/DistanceModelType.swift | 23 + Sources/DOMKit/WebIDL/Document.swift | 136 +- Sources/DOMKit/WebIDL/DocumentFragment.swift | 2 +- .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 12 +- Sources/DOMKit/WebIDL/DocumentTimeline.swift | 16 + .../WebIDL/DocumentTimelineOptions.swift | 20 + Sources/DOMKit/WebIDL/DocumentType.swift | 2 +- Sources/DOMKit/WebIDL/DoubleRange.swift | 25 + Sources/DOMKit/WebIDL/DragEvent.swift | 2 +- Sources/DOMKit/WebIDL/DragEventInit.swift | 2 +- .../WebIDL/DynamicsCompressorNode.swift | 40 + .../WebIDL/DynamicsCompressorOptions.swift | 40 + Sources/DOMKit/WebIDL/EXT_blend_minmax.swift | 18 + .../WebIDL/EXT_clip_cull_distance.swift | 36 + .../WebIDL/EXT_color_buffer_float.swift | 14 + .../WebIDL/EXT_color_buffer_half_float.swift | 22 + .../WebIDL/EXT_disjoint_timer_query.swift | 60 + .../EXT_disjoint_timer_query_webgl2.swift | 26 + Sources/DOMKit/WebIDL/EXT_float_blend.swift | 14 + Sources/DOMKit/WebIDL/EXT_frag_depth.swift | 14 + Sources/DOMKit/WebIDL/EXT_sRGB.swift | 22 + .../WebIDL/EXT_shader_texture_lod.swift | 14 + .../WebIDL/EXT_texture_compression_bptc.swift | 22 + .../WebIDL/EXT_texture_compression_rgtc.swift | 22 + .../EXT_texture_filter_anisotropic.swift | 18 + .../DOMKit/WebIDL/EXT_texture_norm16.swift | 30 + Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift | 20 + Sources/DOMKit/WebIDL/EcKeyGenParams.swift | 20 + Sources/DOMKit/WebIDL/EcKeyImportParams.swift | 20 + .../DOMKit/WebIDL/EcdhKeyDeriveParams.swift | 20 + Sources/DOMKit/WebIDL/EcdsaParams.swift | 20 + Sources/DOMKit/WebIDL/Edge.swift | 22 + Sources/DOMKit/WebIDL/EditContext.swift | 100 + Sources/DOMKit/WebIDL/EditContextInit.swift | 30 + Sources/DOMKit/WebIDL/EffectTiming.swift | 60 + .../WebIDL/EffectiveConnectionType.swift | 24 + Sources/DOMKit/WebIDL/Element.swift | 154 +- .../DOMKit/WebIDL/ElementBasedOffset.swift | 30 + .../DOMKit/WebIDL/ElementCSSInlineStyle.swift | 2 + .../WebIDL/ElementContentEditable.swift | 5 + .../WebIDL/ElementCreationOptions.swift | 2 +- .../WebIDL/ElementDefinitionOptions.swift | 2 +- Sources/DOMKit/WebIDL/ElementInternals.swift | 6 +- Sources/DOMKit/WebIDL/EncodedAudioChunk.swift | 38 + .../DOMKit/WebIDL/EncodedAudioChunkInit.swift | 35 + .../WebIDL/EncodedAudioChunkMetadata.swift | 20 + .../DOMKit/WebIDL/EncodedAudioChunkType.swift | 22 + Sources/DOMKit/WebIDL/EncodedVideoChunk.swift | 38 + .../DOMKit/WebIDL/EncodedVideoChunkInit.swift | 35 + .../WebIDL/EncodedVideoChunkMetadata.swift | 30 + .../DOMKit/WebIDL/EncodedVideoChunkType.swift | 22 + Sources/DOMKit/WebIDL/EndOfStreamError.swift | 22 + Sources/DOMKit/WebIDL/ErrorEvent.swift | 2 +- Sources/DOMKit/WebIDL/ErrorEventInit.swift | 2 +- Sources/DOMKit/WebIDL/Event.swift | 2 +- Sources/DOMKit/WebIDL/EventCounts.swift | 16 + Sources/DOMKit/WebIDL/EventInit.swift | 2 +- .../DOMKit/WebIDL/EventListenerOptions.swift | 2 +- Sources/DOMKit/WebIDL/EventModifierInit.swift | 2 +- Sources/DOMKit/WebIDL/EventSource.swift | 2 +- Sources/DOMKit/WebIDL/EventSourceInit.swift | 2 +- Sources/DOMKit/WebIDL/EventTarget.swift | 2 +- .../WebIDL/ExtendableCookieChangeEvent.swift | 24 + .../ExtendableCookieChangeEventInit.swift | 25 + Sources/DOMKit/WebIDL/ExtendableEvent.swift | 20 + .../DOMKit/WebIDL/ExtendableEventInit.swift | 16 + .../WebIDL/ExtendableMessageEvent.swift | 36 + .../WebIDL/ExtendableMessageEventInit.swift | 40 + Sources/DOMKit/WebIDL/External.swift | 2 +- Sources/DOMKit/WebIDL/EyeDropper.swift | 28 + Sources/DOMKit/WebIDL/FaceDetector.swift | 28 + .../DOMKit/WebIDL/FaceDetectorOptions.swift | 25 + .../DOMKit/WebIDL/FederatedCredential.swift | 24 + .../WebIDL/FederatedCredentialInit.swift | 40 + .../FederatedCredentialRequestOptions.swift | 25 + Sources/DOMKit/WebIDL/FetchEvent.swift | 44 + Sources/DOMKit/WebIDL/FetchEventInit.swift | 45 + Sources/DOMKit/WebIDL/FetchPriority.swift | 23 + Sources/DOMKit/WebIDL/File.swift | 6 +- Sources/DOMKit/WebIDL/FileList.swift | 2 +- .../DOMKit/WebIDL/FilePickerAcceptType.swift | 25 + Sources/DOMKit/WebIDL/FilePickerOptions.swift | 35 + Sources/DOMKit/WebIDL/FilePropertyBag.swift | 2 +- Sources/DOMKit/WebIDL/FileReader.swift | 2 +- Sources/DOMKit/WebIDL/FileReaderSync.swift | 2 +- Sources/DOMKit/WebIDL/FileSystem.swift | 22 + .../FileSystemCreateWritableOptions.swift | 20 + .../WebIDL/FileSystemDirectoryEntry.swift | 24 + .../WebIDL/FileSystemDirectoryHandle.swift | 58 + .../WebIDL/FileSystemDirectoryReader.swift | 18 + Sources/DOMKit/WebIDL/FileSystemEntry.swift | 38 + .../DOMKit/WebIDL/FileSystemFileEntry.swift | 16 + .../DOMKit/WebIDL/FileSystemFileHandle.swift | 32 + Sources/DOMKit/WebIDL/FileSystemFlags.swift | 25 + .../FileSystemGetDirectoryOptions.swift | 20 + .../WebIDL/FileSystemGetFileOptions.swift | 20 + Sources/DOMKit/WebIDL/FileSystemHandle.swift | 52 + .../DOMKit/WebIDL/FileSystemHandleKind.swift | 22 + ...FileSystemHandlePermissionDescriptor.swift | 20 + .../FileSystemPermissionDescriptor.swift | 25 + .../WebIDL/FileSystemPermissionMode.swift | 22 + .../WebIDL/FileSystemRemoveOptions.swift | 20 + .../WebIDL/FileSystemWritableFileStream.swift | 42 + Sources/DOMKit/WebIDL/FillLightMode.swift | 23 + Sources/DOMKit/WebIDL/FillMode.swift | 25 + Sources/DOMKit/WebIDL/FlowControlType.swift | 22 + Sources/DOMKit/WebIDL/FocusEvent.swift | 2 +- Sources/DOMKit/WebIDL/FocusEventInit.swift | 2 +- Sources/DOMKit/WebIDL/FocusOptions.swift | 2 +- .../WebIDL/FocusableAreaSearchMode.swift | 22 + .../DOMKit/WebIDL/FocusableAreasOption.swift | 20 + Sources/DOMKit/WebIDL/Font.swift | 22 + Sources/DOMKit/WebIDL/FontFace.swift | 96 + .../DOMKit/WebIDL/FontFaceDescriptors.swift | 70 + Sources/DOMKit/WebIDL/FontFaceFeatures.swift | 14 + .../DOMKit/WebIDL/FontFaceLoadStatus.swift | 24 + Sources/DOMKit/WebIDL/FontFacePalette.swift | 35 + Sources/DOMKit/WebIDL/FontFacePalettes.swift | 27 + Sources/DOMKit/WebIDL/FontFaceSet.swift | 64 + .../DOMKit/WebIDL/FontFaceSetLoadEvent.swift | 20 + .../WebIDL/FontFaceSetLoadEventInit.swift | 20 + .../DOMKit/WebIDL/FontFaceSetLoadStatus.swift | 22 + Sources/DOMKit/WebIDL/FontFaceSource.swift | 9 + .../DOMKit/WebIDL/FontFaceVariationAxis.swift | 34 + .../DOMKit/WebIDL/FontFaceVariations.swift | 16 + Sources/DOMKit/WebIDL/FontManager.swift | 24 + Sources/DOMKit/WebIDL/FontMetadata.swift | 40 + Sources/DOMKit/WebIDL/FontMetrics.swift | 70 + Sources/DOMKit/WebIDL/FormData.swift | 2 +- Sources/DOMKit/WebIDL/FormDataEvent.swift | 2 +- Sources/DOMKit/WebIDL/FormDataEventInit.swift | 2 +- Sources/DOMKit/WebIDL/FragmentDirective.swift | 14 + Sources/DOMKit/WebIDL/FragmentResult.swift | 26 + .../DOMKit/WebIDL/FragmentResultOptions.swift | 45 + Sources/DOMKit/WebIDL/FrameType.swift | 24 + .../WebIDL/FullscreenNavigationUI.swift | 23 + Sources/DOMKit/WebIDL/FullscreenOptions.swift | 20 + Sources/DOMKit/WebIDL/GPU.swift | 24 + Sources/DOMKit/WebIDL/GPUAdapter.swift | 40 + Sources/DOMKit/WebIDL/GPUAddressMode.swift | 23 + Sources/DOMKit/WebIDL/GPUBindGroup.swift | 14 + .../WebIDL/GPUBindGroupDescriptor.swift | 25 + Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift | 25 + .../DOMKit/WebIDL/GPUBindGroupLayout.swift | 14 + .../WebIDL/GPUBindGroupLayoutDescriptor.swift | 20 + .../WebIDL/GPUBindGroupLayoutEntry.swift | 50 + Sources/DOMKit/WebIDL/GPUBlendComponent.swift | 30 + Sources/DOMKit/WebIDL/GPUBlendFactor.swift | 33 + Sources/DOMKit/WebIDL/GPUBlendOperation.swift | 25 + Sources/DOMKit/WebIDL/GPUBlendState.swift | 25 + Sources/DOMKit/WebIDL/GPUBuffer.swift | 36 + Sources/DOMKit/WebIDL/GPUBufferBinding.swift | 30 + .../WebIDL/GPUBufferBindingLayout.swift | 30 + .../DOMKit/WebIDL/GPUBufferBindingType.swift | 23 + .../DOMKit/WebIDL/GPUBufferDescriptor.swift | 30 + Sources/DOMKit/WebIDL/GPUBufferUsage.swift | 30 + .../GPUCanvasCompositingAlphaMode.swift | 22 + .../WebIDL/GPUCanvasConfiguration.swift | 50 + Sources/DOMKit/WebIDL/GPUCanvasContext.swift | 34 + Sources/DOMKit/WebIDL/GPUColorDict.swift | 35 + .../DOMKit/WebIDL/GPUColorTargetState.swift | 30 + Sources/DOMKit/WebIDL/GPUColorWrite.swift | 20 + Sources/DOMKit/WebIDL/GPUCommandBuffer.swift | 14 + .../WebIDL/GPUCommandBufferDescriptor.swift | 16 + Sources/DOMKit/WebIDL/GPUCommandEncoder.swift | 54 + .../WebIDL/GPUCommandEncoderDescriptor.swift | 16 + Sources/DOMKit/WebIDL/GPUCommandsMixin.swift | 7 + .../DOMKit/WebIDL/GPUCompareFunction.swift | 28 + .../DOMKit/WebIDL/GPUCompilationInfo.swift | 18 + .../DOMKit/WebIDL/GPUCompilationMessage.swift | 38 + .../WebIDL/GPUCompilationMessageType.swift | 23 + .../WebIDL/GPUComputePassDescriptor.swift | 20 + .../DOMKit/WebIDL/GPUComputePassEncoder.swift | 30 + .../GPUComputePassTimestampLocation.swift | 22 + .../WebIDL/GPUComputePassTimestampWrite.swift | 30 + .../DOMKit/WebIDL/GPUComputePipeline.swift | 14 + .../WebIDL/GPUComputePipelineDescriptor.swift | 20 + Sources/DOMKit/WebIDL/GPUCullMode.swift | 23 + .../DOMKit/WebIDL/GPUDebugCommandsMixin.swift | 19 + .../DOMKit/WebIDL/GPUDepthStencilState.swift | 65 + Sources/DOMKit/WebIDL/GPUDevice.swift | 122 + .../DOMKit/WebIDL/GPUDeviceDescriptor.swift | 30 + Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift | 22 + .../DOMKit/WebIDL/GPUDeviceLostReason.swift | 21 + Sources/DOMKit/WebIDL/GPUErrorFilter.swift | 22 + Sources/DOMKit/WebIDL/GPUExtent3DDict.swift | 30 + .../DOMKit/WebIDL/GPUExternalTexture.swift | 18 + .../GPUExternalTextureBindingLayout.swift | 16 + .../WebIDL/GPUExternalTextureDescriptor.swift | 25 + Sources/DOMKit/WebIDL/GPUFeatureName.swift | 28 + Sources/DOMKit/WebIDL/GPUFilterMode.swift | 22 + Sources/DOMKit/WebIDL/GPUFragmentState.swift | 20 + Sources/DOMKit/WebIDL/GPUFrontFace.swift | 22 + .../DOMKit/WebIDL/GPUImageCopyBuffer.swift | 20 + .../WebIDL/GPUImageCopyExternalImage.swift | 30 + .../DOMKit/WebIDL/GPUImageCopyTexture.swift | 35 + .../WebIDL/GPUImageCopyTextureTagged.swift | 25 + .../DOMKit/WebIDL/GPUImageDataLayout.swift | 30 + Sources/DOMKit/WebIDL/GPUIndexFormat.swift | 22 + Sources/DOMKit/WebIDL/GPULoadOp.swift | 22 + Sources/DOMKit/WebIDL/GPUMapMode.swift | 14 + .../DOMKit/WebIDL/GPUMipmapFilterMode.swift | 22 + .../DOMKit/WebIDL/GPUMultisampleState.swift | 30 + Sources/DOMKit/WebIDL/GPUObjectBase.swift | 12 + .../WebIDL/GPUObjectDescriptorBase.swift | 20 + Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift | 25 + Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift | 30 + .../DOMKit/WebIDL/GPUOutOfMemoryError.swift | 18 + Sources/DOMKit/WebIDL/GPUPipelineBase.swift | 11 + .../WebIDL/GPUPipelineDescriptorBase.swift | 20 + Sources/DOMKit/WebIDL/GPUPipelineLayout.swift | 14 + .../WebIDL/GPUPipelineLayoutDescriptor.swift | 20 + .../DOMKit/WebIDL/GPUPowerPreference.swift | 22 + .../WebIDL/GPUPredefinedColorSpace.swift | 21 + Sources/DOMKit/WebIDL/GPUPrimitiveState.swift | 40 + .../DOMKit/WebIDL/GPUPrimitiveTopology.swift | 25 + .../WebIDL/GPUProgrammablePassEncoder.swift | 15 + .../DOMKit/WebIDL/GPUProgrammableStage.swift | 30 + Sources/DOMKit/WebIDL/GPUQuerySet.swift | 18 + .../DOMKit/WebIDL/GPUQuerySetDescriptor.swift | 25 + Sources/DOMKit/WebIDL/GPUQueryType.swift | 22 + Sources/DOMKit/WebIDL/GPUQueue.swift | 40 + .../DOMKit/WebIDL/GPUQueueDescriptor.swift | 16 + Sources/DOMKit/WebIDL/GPURenderBundle.swift | 14 + .../WebIDL/GPURenderBundleDescriptor.swift | 16 + .../WebIDL/GPURenderBundleEncoder.swift | 18 + .../GPURenderBundleEncoderDescriptor.swift | 25 + .../DOMKit/WebIDL/GPURenderEncoderBase.swift | 35 + .../WebIDL/GPURenderPassColorAttachment.swift | 40 + .../GPURenderPassDepthStencilAttachment.swift | 60 + .../WebIDL/GPURenderPassDescriptor.swift | 35 + .../DOMKit/WebIDL/GPURenderPassEncoder.swift | 52 + .../DOMKit/WebIDL/GPURenderPassLayout.swift | 30 + .../GPURenderPassTimestampLocation.swift | 22 + .../WebIDL/GPURenderPassTimestampWrite.swift | 30 + Sources/DOMKit/WebIDL/GPURenderPipeline.swift | 14 + .../WebIDL/GPURenderPipelineDescriptor.swift | 40 + .../WebIDL/GPURequestAdapterOptions.swift | 25 + Sources/DOMKit/WebIDL/GPUSampler.swift | 14 + .../WebIDL/GPUSamplerBindingLayout.swift | 20 + .../DOMKit/WebIDL/GPUSamplerBindingType.swift | 23 + .../DOMKit/WebIDL/GPUSamplerDescriptor.swift | 65 + Sources/DOMKit/WebIDL/GPUShaderModule.swift | 24 + .../GPUShaderModuleCompilationHint.swift | 20 + .../WebIDL/GPUShaderModuleDescriptor.swift | 30 + Sources/DOMKit/WebIDL/GPUShaderStage.swift | 16 + .../DOMKit/WebIDL/GPUStencilFaceState.swift | 35 + .../DOMKit/WebIDL/GPUStencilOperation.swift | 28 + .../WebIDL/GPUStorageTextureAccess.swift | 21 + .../GPUStorageTextureBindingLayout.swift | 30 + Sources/DOMKit/WebIDL/GPUStoreOp.swift | 22 + .../DOMKit/WebIDL/GPUSupportedFeatures.swift | 16 + .../DOMKit/WebIDL/GPUSupportedLimits.swift | 118 + Sources/DOMKit/WebIDL/GPUTexture.swift | 22 + Sources/DOMKit/WebIDL/GPUTextureAspect.swift | 23 + .../WebIDL/GPUTextureBindingLayout.swift | 30 + .../DOMKit/WebIDL/GPUTextureDescriptor.swift | 50 + .../DOMKit/WebIDL/GPUTextureDimension.swift | 23 + Sources/DOMKit/WebIDL/GPUTextureFormat.swift | 115 + .../DOMKit/WebIDL/GPUTextureSampleType.swift | 25 + Sources/DOMKit/WebIDL/GPUTextureUsage.swift | 20 + Sources/DOMKit/WebIDL/GPUTextureView.swift | 14 + .../WebIDL/GPUTextureViewDescriptor.swift | 50 + .../WebIDL/GPUTextureViewDimension.swift | 26 + .../WebIDL/GPUUncapturedErrorEvent.swift | 20 + .../WebIDL/GPUUncapturedErrorEventInit.swift | 20 + .../DOMKit/WebIDL/GPUValidationError.swift | 22 + .../DOMKit/WebIDL/GPUVertexAttribute.swift | 30 + .../DOMKit/WebIDL/GPUVertexBufferLayout.swift | 30 + Sources/DOMKit/WebIDL/GPUVertexFormat.swift | 50 + Sources/DOMKit/WebIDL/GPUVertexState.swift | 20 + Sources/DOMKit/WebIDL/GPUVertexStepMode.swift | 22 + Sources/DOMKit/WebIDL/GainNode.swift | 20 + Sources/DOMKit/WebIDL/GainOptions.swift | 20 + Sources/DOMKit/WebIDL/Gamepad.swift | 58 + Sources/DOMKit/WebIDL/GamepadButton.swift | 26 + Sources/DOMKit/WebIDL/GamepadEvent.swift | 20 + Sources/DOMKit/WebIDL/GamepadEventInit.swift | 20 + Sources/DOMKit/WebIDL/GamepadHand.swift | 23 + .../DOMKit/WebIDL/GamepadHapticActuator.swift | 28 + .../WebIDL/GamepadHapticActuatorType.swift | 21 + .../DOMKit/WebIDL/GamepadMappingType.swift | 23 + Sources/DOMKit/WebIDL/GamepadPose.swift | 46 + Sources/DOMKit/WebIDL/GamepadTouch.swift | 30 + .../WebIDL/GenerateTestReportParameters.swift | 25 + Sources/DOMKit/WebIDL/Geolocation.swift | 26 + .../WebIDL/GeolocationCoordinates.swift | 42 + .../DOMKit/WebIDL/GeolocationPosition.swift | 22 + .../WebIDL/GeolocationPositionError.swift | 28 + .../WebIDL/GeolocationReadingValues.swift | 50 + Sources/DOMKit/WebIDL/GeolocationSensor.swift | 54 + .../WebIDL/GeolocationSensorOptions.swift | 16 + .../WebIDL/GeolocationSensorReading.swift | 55 + Sources/DOMKit/WebIDL/GeometryUtils.swift | 23 + .../DOMKit/WebIDL/GetAnimationsOptions.swift | 20 + .../WebIDL/GetNotificationOptions.swift | 20 + .../DOMKit/WebIDL/GetRootNodeOptions.swift | 2 +- Sources/DOMKit/WebIDL/GetSVGDocument.swift | 11 + Sources/DOMKit/WebIDL/Global.swift | 26 + Sources/DOMKit/WebIDL/GlobalDescriptor.swift | 25 + .../DOMKit/WebIDL/GlobalEventHandlers.swift | 130 + .../DOMKit/WebIDL/GravityReadingValues.swift | 16 + Sources/DOMKit/WebIDL/GravitySensor.swift | 16 + Sources/DOMKit/WebIDL/GroupEffect.swift | 42 + Sources/DOMKit/WebIDL/Gyroscope.swift | 28 + .../GyroscopeLocalCoordinateSystem.swift | 22 + .../WebIDL/GyroscopeReadingValues.swift | 30 + .../WebIDL/GyroscopeSensorOptions.swift | 20 + Sources/DOMKit/WebIDL/HID.swift | 40 + Sources/DOMKit/WebIDL/HIDCollectionInfo.swift | 50 + .../DOMKit/WebIDL/HIDConnectionEvent.swift | 20 + .../WebIDL/HIDConnectionEventInit.swift | 20 + Sources/DOMKit/WebIDL/HIDDevice.swift | 96 + Sources/DOMKit/WebIDL/HIDDeviceFilter.swift | 35 + .../WebIDL/HIDDeviceRequestOptions.swift | 20 + .../DOMKit/WebIDL/HIDInputReportEvent.swift | 28 + .../WebIDL/HIDInputReportEventInit.swift | 30 + Sources/DOMKit/WebIDL/HIDReportInfo.swift | 25 + Sources/DOMKit/WebIDL/HIDReportItem.swift | 155 + Sources/DOMKit/WebIDL/HIDUnitSystem.swift | 27 + Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 2 +- Sources/DOMKit/WebIDL/HTMLAnchorElement.swift | 30 +- Sources/DOMKit/WebIDL/HTMLAreaElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLAudioElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLBRElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLBaseElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLBodyElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLCollection.swift | 2 +- Sources/DOMKit/WebIDL/HTMLDListElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLDataElement.swift | 2 +- .../DOMKit/WebIDL/HTMLDataListElement.swift | 2 +- .../DOMKit/WebIDL/HTMLDetailsElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 2 +- .../DOMKit/WebIDL/HTMLDirectoryElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLDivElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 24 +- Sources/DOMKit/WebIDL/HTMLEmbedElement.swift | 2 +- .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFontElement.swift | 2 +- .../WebIDL/HTMLFormControlsCollection.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFormElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFrameElement.swift | 2 +- .../DOMKit/WebIDL/HTMLFrameSetElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLHRElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLHeadElement.swift | 2 +- .../DOMKit/WebIDL/HTMLHeadingElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLHtmlElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 14 +- Sources/DOMKit/WebIDL/HTMLImageElement.swift | 14 +- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 14 +- Sources/DOMKit/WebIDL/HTMLLIElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLLabelElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLLegendElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLLinkElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLMapElement.swift | 2 +- .../DOMKit/WebIDL/HTMLMarqueeElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 50 +- Sources/DOMKit/WebIDL/HTMLMenuElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLMetaElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLMeterElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLModElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLOListElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 2 +- .../DOMKit/WebIDL/HTMLOptGroupElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLOptionElement.swift | 2 +- .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 2 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 2 +- .../DOMKit/WebIDL/HTMLParagraphElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLParamElement.swift | 2 +- .../DOMKit/WebIDL/HTMLPictureElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLPortalElement.swift | 46 + Sources/DOMKit/WebIDL/HTMLPreElement.swift | 2 +- .../DOMKit/WebIDL/HTMLProgressElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLQuoteElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSourceElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSpanElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLStyleElement.swift | 2 +- .../WebIDL/HTMLTableCaptionElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTableCellElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTableColElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLTableElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTableRowElement.swift | 2 +- .../WebIDL/HTMLTableSectionElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTemplateElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLTimeElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLTitleElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLTrackElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLUListElement.swift | 2 +- .../DOMKit/WebIDL/HTMLUnknownElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 40 +- .../DOMKit/WebIDL/HardwareAcceleration.swift | 23 + Sources/DOMKit/WebIDL/HashChangeEvent.swift | 2 +- .../DOMKit/WebIDL/HashChangeEventInit.swift | 2 +- Sources/DOMKit/WebIDL/HdrMetadataType.swift | 23 + Sources/DOMKit/WebIDL/Headers.swift | 2 +- Sources/DOMKit/WebIDL/Highlight.swift | 28 + Sources/DOMKit/WebIDL/HighlightRegistry.swift | 16 + Sources/DOMKit/WebIDL/HighlightType.swift | 23 + Sources/DOMKit/WebIDL/History.swift | 2 +- Sources/DOMKit/WebIDL/HkdfParams.swift | 30 + Sources/DOMKit/WebIDL/HmacImportParams.swift | 25 + Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift | 25 + Sources/DOMKit/WebIDL/HmacKeyGenParams.swift | 25 + Sources/DOMKit/WebIDL/IDBCursor.swift | 54 + .../DOMKit/WebIDL/IDBCursorDirection.swift | 24 + .../DOMKit/WebIDL/IDBCursorWithValue.swift | 16 + Sources/DOMKit/WebIDL/IDBDatabase.swift | 56 + Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift | 25 + Sources/DOMKit/WebIDL/IDBFactory.swift | 36 + Sources/DOMKit/WebIDL/IDBIndex.swift | 62 + .../DOMKit/WebIDL/IDBIndexParameters.swift | 25 + Sources/DOMKit/WebIDL/IDBKeyRange.swift | 50 + Sources/DOMKit/WebIDL/IDBObjectStore.swift | 90 + .../WebIDL/IDBObjectStoreParameters.swift | 25 + Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift | 20 + Sources/DOMKit/WebIDL/IDBRequest.swift | 40 + .../DOMKit/WebIDL/IDBRequestReadyState.swift | 22 + Sources/DOMKit/WebIDL/IDBTransaction.swift | 56 + .../WebIDL/IDBTransactionDurability.swift | 23 + .../DOMKit/WebIDL/IDBTransactionMode.swift | 23 + .../DOMKit/WebIDL/IDBTransactionOptions.swift | 20 + .../DOMKit/WebIDL/IDBVersionChangeEvent.swift | 24 + .../WebIDL/IDBVersionChangeEventInit.swift | 25 + Sources/DOMKit/WebIDL/IIRFilterNode.swift | 20 + Sources/DOMKit/WebIDL/IIRFilterOptions.swift | 25 + Sources/DOMKit/WebIDL/IdleDeadline.swift | 22 + Sources/DOMKit/WebIDL/IdleDetector.swift | 48 + Sources/DOMKit/WebIDL/IdleOptions.swift | 25 + .../DOMKit/WebIDL/IdleRequestOptions.swift | 20 + Sources/DOMKit/WebIDL/ImageBitmap.swift | 2 +- .../DOMKit/WebIDL/ImageBitmapOptions.swift | 2 +- .../WebIDL/ImageBitmapRenderingContext.swift | 2 +- .../ImageBitmapRenderingContextSettings.swift | 2 +- Sources/DOMKit/WebIDL/ImageCapture.swift | 62 + Sources/DOMKit/WebIDL/ImageData.swift | 2 +- Sources/DOMKit/WebIDL/ImageDataSettings.swift | 2 +- .../DOMKit/WebIDL/ImageDecodeOptions.swift | 25 + Sources/DOMKit/WebIDL/ImageDecodeResult.swift | 25 + Sources/DOMKit/WebIDL/ImageDecoder.swift | 62 + Sources/DOMKit/WebIDL/ImageDecoderInit.swift | 50 + .../DOMKit/WebIDL/ImageEncodeOptions.swift | 2 +- Sources/DOMKit/WebIDL/ImageObject.swift | 30 + Sources/DOMKit/WebIDL/ImageResource.swift | 35 + Sources/DOMKit/WebIDL/ImageTrack.swift | 32 + Sources/DOMKit/WebIDL/ImageTrackList.swift | 34 + Sources/DOMKit/WebIDL/ImportExportKind.swift | 24 + Sources/DOMKit/WebIDL/Ink.swift | 24 + Sources/DOMKit/WebIDL/InkPresenter.swift | 26 + Sources/DOMKit/WebIDL/InkPresenterParam.swift | 20 + Sources/DOMKit/WebIDL/InkTrailStyle.swift | 25 + Sources/DOMKit/WebIDL/InnerHTML.swift | 12 + .../WebIDL/InputDeviceCapabilities.swift | 26 + .../WebIDL/InputDeviceCapabilitiesInit.swift | 25 + Sources/DOMKit/WebIDL/InputDeviceInfo.swift | 16 + Sources/DOMKit/WebIDL/InputEvent.swift | 10 +- Sources/DOMKit/WebIDL/InputEventInit.swift | 14 +- Sources/DOMKit/WebIDL/Instance.swift | 22 + Sources/DOMKit/WebIDL/InteractionCounts.swift | 16 + .../DOMKit/WebIDL/IntersectionObserver.swift | 46 + .../WebIDL/IntersectionObserverEntry.swift | 46 + .../IntersectionObserverEntryInit.swift | 50 + .../WebIDL/IntersectionObserverInit.swift | 30 + .../WebIDL/InterventionReportBody.swift | 36 + Sources/DOMKit/WebIDL/IntrinsicSizes.swift | 22 + .../WebIDL/IntrinsicSizesResultOptions.swift | 25 + .../DOMKit/WebIDL/IsInputPendingOptions.swift | 20 + Sources/DOMKit/WebIDL/IsVisibleOptions.swift | 16 + Sources/DOMKit/WebIDL/ItemDetails.swift | 70 + Sources/DOMKit/WebIDL/ItemType.swift | 22 + .../WebIDL/IterationCompositeOperation.swift | 22 + Sources/DOMKit/WebIDL/JsonWebKey.swift | 105 + .../WebIDL/KHR_parallel_shader_compile.swift | 16 + Sources/DOMKit/WebIDL/KeyAlgorithm.swift | 20 + Sources/DOMKit/WebIDL/KeyFormat.swift | 24 + .../WebIDL/KeySystemTrackConfiguration.swift | 25 + Sources/DOMKit/WebIDL/KeyType.swift | 23 + Sources/DOMKit/WebIDL/KeyUsage.swift | 28 + Sources/DOMKit/WebIDL/Keyboard.swift | 40 + Sources/DOMKit/WebIDL/KeyboardEvent.swift | 2 +- Sources/DOMKit/WebIDL/KeyboardEventInit.swift | 2 +- Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift | 16 + .../WebIDL/KeyframeAnimationOptions.swift | 25 + Sources/DOMKit/WebIDL/KeyframeEffect.swift | 44 + .../DOMKit/WebIDL/KeyframeEffectOptions.swift | 30 + Sources/DOMKit/WebIDL/Landmark.swift | 25 + Sources/DOMKit/WebIDL/LandmarkType.swift | 23 + Sources/DOMKit/WebIDL/LargeBlobSupport.swift | 22 + .../WebIDL/LargestContentfulPaint.swift | 40 + Sources/DOMKit/WebIDL/LatencyMode.swift | 22 + Sources/DOMKit/WebIDL/LayoutChild.swift | 38 + Sources/DOMKit/WebIDL/LayoutConstraints.swift | 50 + .../WebIDL/LayoutConstraintsOptions.swift | 60 + Sources/DOMKit/WebIDL/LayoutEdges.swift | 38 + Sources/DOMKit/WebIDL/LayoutFragment.swift | 38 + Sources/DOMKit/WebIDL/LayoutOptions.swift | 25 + Sources/DOMKit/WebIDL/LayoutShift.swift | 32 + .../WebIDL/LayoutShiftAttribution.swift | 26 + Sources/DOMKit/WebIDL/LayoutSizingMode.swift | 22 + .../WebIDL/LayoutWorkletGlobalScope.swift | 16 + Sources/DOMKit/WebIDL/LineAlignSetting.swift | 23 + .../LinearAccelerationReadingValues.swift | 16 + .../WebIDL/LinearAccelerationSensor.swift | 16 + Sources/DOMKit/WebIDL/Location.swift | 2 +- Sources/DOMKit/WebIDL/Lock.swift | 22 + Sources/DOMKit/WebIDL/LockInfo.swift | 30 + Sources/DOMKit/WebIDL/LockManager.swift | 44 + .../DOMKit/WebIDL/LockManagerSnapshot.swift | 25 + Sources/DOMKit/WebIDL/LockMode.swift | 22 + Sources/DOMKit/WebIDL/LockOptions.swift | 35 + Sources/DOMKit/WebIDL/MIDIAccess.swift | 28 + .../DOMKit/WebIDL/MIDIConnectionEvent.swift | 20 + .../WebIDL/MIDIConnectionEventInit.swift | 20 + Sources/DOMKit/WebIDL/MIDIInput.swift | 16 + Sources/DOMKit/WebIDL/MIDIInputMap.swift | 16 + Sources/DOMKit/WebIDL/MIDIMessageEvent.swift | 20 + .../DOMKit/WebIDL/MIDIMessageEventInit.swift | 20 + Sources/DOMKit/WebIDL/MIDIOptions.swift | 25 + Sources/DOMKit/WebIDL/MIDIOutput.swift | 20 + Sources/DOMKit/WebIDL/MIDIOutputMap.swift | 16 + Sources/DOMKit/WebIDL/MIDIPort.swift | 64 + .../WebIDL/MIDIPortConnectionState.swift | 23 + .../DOMKit/WebIDL/MIDIPortDeviceState.swift | 22 + Sources/DOMKit/WebIDL/MIDIPortType.swift | 22 + Sources/DOMKit/WebIDL/ML.swift | 26 + Sources/DOMKit/WebIDL/MLAutoPad.swift | 23 + .../WebIDL/MLBatchNormalizationOptions.swift | 40 + .../DOMKit/WebIDL/MLBufferResourceView.swift | 30 + Sources/DOMKit/WebIDL/MLClampOptions.swift | 25 + Sources/DOMKit/WebIDL/MLContext.swift | 14 + Sources/DOMKit/WebIDL/MLContextOptions.swift | 25 + .../WebIDL/MLConv2dFilterOperandLayout.swift | 24 + Sources/DOMKit/WebIDL/MLConv2dOptions.swift | 60 + ...MLConvTranspose2dFilterOperandLayout.swift | 23 + .../WebIDL/MLConvTranspose2dOptions.swift | 70 + .../DOMKit/WebIDL/MLDevicePreference.swift | 23 + Sources/DOMKit/WebIDL/MLEluOptions.swift | 20 + Sources/DOMKit/WebIDL/MLGemmOptions.swift | 40 + Sources/DOMKit/WebIDL/MLGraph.swift | 18 + Sources/DOMKit/WebIDL/MLGraphBuilder.swift | 318 ++ Sources/DOMKit/WebIDL/MLGruCellOptions.swift | 40 + Sources/DOMKit/WebIDL/MLGruOptions.swift | 55 + .../DOMKit/WebIDL/MLHardSigmoidOptions.swift | 25 + Sources/DOMKit/WebIDL/MLInput.swift | 25 + .../DOMKit/WebIDL/MLInputOperandLayout.swift | 22 + .../MLInstanceNormalizationOptions.swift | 35 + .../DOMKit/WebIDL/MLInterpolationMode.swift | 22 + .../DOMKit/WebIDL/MLLeakyReluOptions.swift | 20 + Sources/DOMKit/WebIDL/MLLinearOptions.swift | 25 + Sources/DOMKit/WebIDL/MLOperand.swift | 14 + .../DOMKit/WebIDL/MLOperandDescriptor.swift | 25 + Sources/DOMKit/WebIDL/MLOperandType.swift | 26 + Sources/DOMKit/WebIDL/MLOperator.swift | 14 + Sources/DOMKit/WebIDL/MLPadOptions.swift | 25 + Sources/DOMKit/WebIDL/MLPaddingMode.swift | 24 + Sources/DOMKit/WebIDL/MLPool2dOptions.swift | 55 + Sources/DOMKit/WebIDL/MLPowerPreference.swift | 23 + .../WebIDL/MLRecurrentNetworkDirection.swift | 23 + .../MLRecurrentNetworkWeightLayout.swift | 22 + Sources/DOMKit/WebIDL/MLReduceOptions.swift | 25 + .../DOMKit/WebIDL/MLResample2dOptions.swift | 35 + Sources/DOMKit/WebIDL/MLRoundingType.swift | 22 + Sources/DOMKit/WebIDL/MLSliceOptions.swift | 20 + Sources/DOMKit/WebIDL/MLSoftplusOptions.swift | 20 + Sources/DOMKit/WebIDL/MLSplitOptions.swift | 20 + Sources/DOMKit/WebIDL/MLSqueezeOptions.swift | 20 + .../DOMKit/WebIDL/MLTransposeOptions.swift | 20 + Sources/DOMKit/WebIDL/Magnetometer.swift | 28 + .../MagnetometerLocalCoordinateSystem.swift | 22 + .../WebIDL/MagnetometerReadingValues.swift | 30 + .../WebIDL/MagnetometerSensorOptions.swift | 20 + Sources/DOMKit/WebIDL/MathMLElement.swift | 12 + Sources/DOMKit/WebIDL/MediaCapabilities.swift | 34 + .../MediaCapabilitiesDecodingInfo.swift | 25 + .../MediaCapabilitiesEncodingInfo.swift | 20 + .../DOMKit/WebIDL/MediaCapabilitiesInfo.swift | 30 + ...iaCapabilitiesKeySystemConfiguration.swift | 50 + .../DOMKit/WebIDL/MediaConfiguration.swift | 25 + .../WebIDL/MediaDecodingConfiguration.swift | 25 + Sources/DOMKit/WebIDL/MediaDecodingType.swift | 23 + Sources/DOMKit/WebIDL/MediaDeviceInfo.swift | 34 + Sources/DOMKit/WebIDL/MediaDeviceKind.swift | 23 + Sources/DOMKit/WebIDL/MediaDevices.swift | 70 + .../WebIDL/MediaElementAudioSourceNode.swift | 20 + .../MediaElementAudioSourceOptions.swift | 20 + .../WebIDL/MediaEncodingConfiguration.swift | 20 + Sources/DOMKit/WebIDL/MediaEncodingType.swift | 22 + .../DOMKit/WebIDL/MediaEncryptedEvent.swift | 24 + .../WebIDL/MediaEncryptedEventInit.swift | 25 + Sources/DOMKit/WebIDL/MediaError.swift | 2 +- Sources/DOMKit/WebIDL/MediaImage.swift | 30 + .../DOMKit/WebIDL/MediaKeyMessageEvent.swift | 24 + .../WebIDL/MediaKeyMessageEventInit.swift | 25 + .../DOMKit/WebIDL/MediaKeyMessageType.swift | 24 + Sources/DOMKit/WebIDL/MediaKeySession.swift | 86 + .../WebIDL/MediaKeySessionClosedReason.swift | 25 + .../DOMKit/WebIDL/MediaKeySessionType.swift | 22 + Sources/DOMKit/WebIDL/MediaKeyStatus.swift | 28 + Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift | 31 + .../DOMKit/WebIDL/MediaKeySystemAccess.swift | 32 + .../WebIDL/MediaKeySystemConfiguration.swift | 50 + .../MediaKeySystemMediaCapability.swift | 30 + Sources/DOMKit/WebIDL/MediaKeys.swift | 28 + .../DOMKit/WebIDL/MediaKeysRequirement.swift | 23 + Sources/DOMKit/WebIDL/MediaList.swift | 2 +- Sources/DOMKit/WebIDL/MediaMetadata.swift | 34 + Sources/DOMKit/WebIDL/MediaMetadataInit.swift | 35 + .../DOMKit/WebIDL/MediaPositionState.swift | 30 + Sources/DOMKit/WebIDL/MediaQueryList.swift | 32 + .../DOMKit/WebIDL/MediaQueryListEvent.swift | 24 + .../WebIDL/MediaQueryListEventInit.swift | 25 + Sources/DOMKit/WebIDL/MediaRecorder.swift | 88 + .../WebIDL/MediaRecorderErrorEvent.swift | 20 + .../WebIDL/MediaRecorderErrorEventInit.swift | 20 + .../DOMKit/WebIDL/MediaRecorderOptions.swift | 40 + Sources/DOMKit/WebIDL/MediaSession.swift | 38 + .../DOMKit/WebIDL/MediaSessionAction.swift | 32 + .../WebIDL/MediaSessionActionDetails.swift | 35 + .../WebIDL/MediaSessionPlaybackState.swift | 23 + .../DOMKit/WebIDL/MediaSettingsRange.swift | 30 + Sources/DOMKit/WebIDL/MediaSource.swift | 72 + Sources/DOMKit/WebIDL/MediaStream.swift | 68 + .../MediaStreamAudioDestinationNode.swift | 20 + .../WebIDL/MediaStreamAudioSourceNode.swift | 20 + .../MediaStreamAudioSourceOptions.swift | 20 + .../WebIDL/MediaStreamConstraints.swift | 35 + Sources/DOMKit/WebIDL/MediaStreamTrack.swift | 90 + .../MediaStreamTrackAudioSourceNode.swift | 16 + .../MediaStreamTrackAudioSourceOptions.swift | 20 + .../DOMKit/WebIDL/MediaStreamTrackEvent.swift | 20 + .../WebIDL/MediaStreamTrackEventInit.swift | 20 + .../WebIDL/MediaStreamTrackProcessor.swift | 22 + .../MediaStreamTrackProcessorInit.swift | 25 + .../DOMKit/WebIDL/MediaStreamTrackState.swift | 22 + .../WebIDL/MediaTrackCapabilities.swift | 185 + .../WebIDL/MediaTrackConstraintSet.swift | 200 + .../DOMKit/WebIDL/MediaTrackConstraints.swift | 20 + .../DOMKit/WebIDL/MediaTrackSettings.swift | 195 + .../MediaTrackSupportedConstraints.swift | 200 + Sources/DOMKit/WebIDL/Memory.swift | 26 + Sources/DOMKit/WebIDL/MemoryAttribution.swift | 30 + .../WebIDL/MemoryAttributionContainer.swift | 25 + .../DOMKit/WebIDL/MemoryBreakdownEntry.swift | 30 + Sources/DOMKit/WebIDL/MemoryDescriptor.swift | 25 + Sources/DOMKit/WebIDL/MemoryMeasurement.swift | 25 + Sources/DOMKit/WebIDL/MessageChannel.swift | 2 +- Sources/DOMKit/WebIDL/MessageEvent.swift | 2 +- Sources/DOMKit/WebIDL/MessageEventInit.swift | 2 +- Sources/DOMKit/WebIDL/MessagePort.swift | 2 +- Sources/DOMKit/WebIDL/MeteringMode.swift | 24 + .../WebIDL/MidiPermissionDescriptor.swift | 20 + Sources/DOMKit/WebIDL/MimeType.swift | 2 +- Sources/DOMKit/WebIDL/MimeTypeArray.swift | 2 +- .../WebIDL/MockCameraConfiguration.swift | 25 + .../MockCaptureDeviceConfiguration.swift | 30 + .../WebIDL/MockCapturePromptResult.swift | 22 + ...MockCapturePromptResultConfiguration.swift | 25 + .../WebIDL/MockMicrophoneConfiguration.swift | 20 + Sources/DOMKit/WebIDL/MockSensor.swift | 30 + .../WebIDL/MockSensorConfiguration.swift | 35 + .../WebIDL/MockSensorReadingValues.swift | 16 + Sources/DOMKit/WebIDL/MockSensorType.swift | 31 + Sources/DOMKit/WebIDL/Module.swift | 30 + .../WebIDL/ModuleExportDescriptor.swift | 25 + .../WebIDL/ModuleImportDescriptor.swift | 30 + Sources/DOMKit/WebIDL/MouseEvent.swift | 34 +- Sources/DOMKit/WebIDL/MouseEventInit.swift | 14 +- .../WebIDL/MultiCacheQueryOptions.swift | 20 + Sources/DOMKit/WebIDL/MutationEvent.swift | 2 +- Sources/DOMKit/WebIDL/MutationObserver.swift | 2 +- .../DOMKit/WebIDL/MutationObserverInit.swift | 2 +- Sources/DOMKit/WebIDL/MutationRecord.swift | 2 +- .../WebIDL/NDEFMakeReadOnlyOptions.swift | 20 + Sources/DOMKit/WebIDL/NDEFMessage.swift | 22 + Sources/DOMKit/WebIDL/NDEFMessageInit.swift | 20 + Sources/DOMKit/WebIDL/NDEFReader.swift | 54 + Sources/DOMKit/WebIDL/NDEFReadingEvent.swift | 24 + .../DOMKit/WebIDL/NDEFReadingEventInit.swift | 25 + Sources/DOMKit/WebIDL/NDEFRecord.swift | 46 + Sources/DOMKit/WebIDL/NDEFRecordInit.swift | 45 + Sources/DOMKit/WebIDL/NDEFScanOptions.swift | 20 + Sources/DOMKit/WebIDL/NDEFWriteOptions.swift | 25 + Sources/DOMKit/WebIDL/NamedFlow.swift | 36 + Sources/DOMKit/WebIDL/NamedFlowMap.swift | 16 + Sources/DOMKit/WebIDL/NamedNodeMap.swift | 2 +- Sources/DOMKit/WebIDL/NavigateEvent.swift | 52 + Sources/DOMKit/WebIDL/NavigateEventInit.swift | 55 + Sources/DOMKit/WebIDL/Navigation.swift | 72 + .../NavigationCurrentEntryChangeEvent.swift | 24 + ...avigationCurrentEntryChangeEventInit.swift | 25 + .../DOMKit/WebIDL/NavigationDestination.swift | 38 + Sources/DOMKit/WebIDL/NavigationEvent.swift | 24 + .../DOMKit/WebIDL/NavigationEventInit.swift | 25 + .../WebIDL/NavigationHistoryEntry.swift | 52 + .../WebIDL/NavigationNavigateOptions.swift | 25 + .../WebIDL/NavigationNavigationType.swift | 24 + Sources/DOMKit/WebIDL/NavigationOptions.swift | 20 + .../WebIDL/NavigationPreloadManager.swift | 54 + .../WebIDL/NavigationPreloadState.swift | 25 + .../WebIDL/NavigationReloadOptions.swift | 20 + Sources/DOMKit/WebIDL/NavigationResult.swift | 25 + .../DOMKit/WebIDL/NavigationTimingType.swift | 24 + .../DOMKit/WebIDL/NavigationTransition.swift | 30 + .../NavigationUpdateCurrentEntryOptions.swift | 20 + Sources/DOMKit/WebIDL/Navigator.swift | 198 +- .../NavigatorAutomationInformation.swift | 9 + Sources/DOMKit/WebIDL/NavigatorBadge.swift | 27 + .../DOMKit/WebIDL/NavigatorDeviceMemory.swift | 9 + Sources/DOMKit/WebIDL/NavigatorFonts.swift | 9 + Sources/DOMKit/WebIDL/NavigatorGPU.swift | 9 + Sources/DOMKit/WebIDL/NavigatorLocks.swift | 9 + Sources/DOMKit/WebIDL/NavigatorML.swift | 9 + .../WebIDL/NavigatorNetworkInformation.swift | 9 + Sources/DOMKit/WebIDL/NavigatorStorage.swift | 9 + Sources/DOMKit/WebIDL/NavigatorUA.swift | 9 + .../WebIDL/NavigatorUABrandVersion.swift | 25 + Sources/DOMKit/WebIDL/NavigatorUAData.swift | 40 + .../DOMKit/WebIDL/NetworkInformation.swift | 36 + .../WebIDL/NetworkInformationSaveData.swift | 9 + Sources/DOMKit/WebIDL/Node.swift | 2 +- Sources/DOMKit/WebIDL/NodeIterator.swift | 2 +- Sources/DOMKit/WebIDL/NodeList.swift | 2 +- Sources/DOMKit/WebIDL/Notification.swift | 114 + .../DOMKit/WebIDL/NotificationAction.swift | 30 + .../DOMKit/WebIDL/NotificationDirection.swift | 23 + Sources/DOMKit/WebIDL/NotificationEvent.swift | 24 + .../DOMKit/WebIDL/NotificationEventInit.swift | 25 + .../DOMKit/WebIDL/NotificationOptions.swift | 85 + .../WebIDL/NotificationPermission.swift | 23 + .../WebIDL/OES_draw_buffers_indexed.swift | 42 + .../WebIDL/OES_element_index_uint.swift | 14 + .../DOMKit/WebIDL/OES_fbo_render_mipmap.swift | 14 + .../WebIDL/OES_standard_derivatives.swift | 16 + Sources/DOMKit/WebIDL/OES_texture_float.swift | 14 + .../WebIDL/OES_texture_float_linear.swift | 14 + .../WebIDL/OES_texture_half_float.swift | 16 + .../OES_texture_half_float_linear.swift | 14 + .../WebIDL/OES_vertex_array_object.swift | 32 + Sources/DOMKit/WebIDL/OTPCredential.swift | 16 + .../WebIDL/OTPCredentialRequestOptions.swift | 20 + .../WebIDL/OTPCredentialTransportType.swift | 21 + Sources/DOMKit/WebIDL/OVR_multiview2.swift | 32 + .../WebIDL/OfflineAudioCompletionEvent.swift | 20 + .../OfflineAudioCompletionEventInit.swift | 20 + .../DOMKit/WebIDL/OfflineAudioContext.swift | 58 + .../WebIDL/OfflineAudioContextOptions.swift | 30 + Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 2 +- .../OffscreenCanvasRenderingContext2D.swift | 2 +- .../DOMKit/WebIDL/OpenFilePickerOptions.swift | 20 + .../DOMKit/WebIDL/OptionalEffectTiming.swift | 60 + .../DOMKit/WebIDL/OrientationLockType.swift | 28 + Sources/DOMKit/WebIDL/OrientationSensor.swift | 20 + ...ientationSensorLocalCoordinateSystem.swift | 22 + .../WebIDL/OrientationSensorOptions.swift | 20 + Sources/DOMKit/WebIDL/OrientationType.swift | 24 + Sources/DOMKit/WebIDL/OscillatorNode.swift | 32 + Sources/DOMKit/WebIDL/OscillatorOptions.swift | 35 + Sources/DOMKit/WebIDL/OscillatorType.swift | 25 + Sources/DOMKit/WebIDL/OverSampleType.swift | 23 + .../DOMKit/WebIDL/OverconstrainedError.swift | 20 + .../DOMKit/WebIDL/PageTransitionEvent.swift | 2 +- .../WebIDL/PageTransitionEventInit.swift | 2 +- .../WebIDL/PaintRenderingContext2D.swift | 14 + .../PaintRenderingContext2DSettings.swift | 20 + Sources/DOMKit/WebIDL/PaintSize.swift | 22 + .../WebIDL/PaintWorkletGlobalScope.swift | 20 + Sources/DOMKit/WebIDL/PannerNode.swift | 80 + Sources/DOMKit/WebIDL/PannerOptions.swift | 85 + Sources/DOMKit/WebIDL/PanningModelType.swift | 22 + Sources/DOMKit/WebIDL/ParityType.swift | 23 + .../DOMKit/WebIDL/PasswordCredential.swift | 24 + .../WebIDL/PasswordCredentialData.swift | 35 + Sources/DOMKit/WebIDL/Path2D.swift | 2 +- Sources/DOMKit/WebIDL/PaymentComplete.swift | 23 + .../WebIDL/PaymentCredentialInstrument.swift | 30 + .../DOMKit/WebIDL/PaymentCurrencyAmount.swift | 25 + .../DOMKit/WebIDL/PaymentDetailsBase.swift | 25 + .../DOMKit/WebIDL/PaymentDetailsInit.swift | 25 + .../WebIDL/PaymentDetailsModifier.swift | 35 + .../DOMKit/WebIDL/PaymentDetailsUpdate.swift | 25 + .../WebIDL/PaymentHandlerResponse.swift | 25 + Sources/DOMKit/WebIDL/PaymentInstrument.swift | 30 + .../DOMKit/WebIDL/PaymentInstruments.swift | 74 + Sources/DOMKit/WebIDL/PaymentItem.swift | 30 + Sources/DOMKit/WebIDL/PaymentManager.swift | 22 + .../WebIDL/PaymentMethodChangeEvent.swift | 24 + .../WebIDL/PaymentMethodChangeEventInit.swift | 25 + Sources/DOMKit/WebIDL/PaymentMethodData.swift | 25 + Sources/DOMKit/WebIDL/PaymentRequest.swift | 54 + .../WebIDL/PaymentRequestDetailsUpdate.swift | 35 + .../DOMKit/WebIDL/PaymentRequestEvent.swift | 64 + .../WebIDL/PaymentRequestEventInit.swift | 45 + .../WebIDL/PaymentRequestUpdateEvent.swift | 20 + .../PaymentRequestUpdateEventInit.swift | 16 + Sources/DOMKit/WebIDL/PaymentResponse.swift | 48 + .../WebIDL/PaymentValidationErrors.swift | 25 + Sources/DOMKit/WebIDL/Pbkdf2Params.swift | 30 + Sources/DOMKit/WebIDL/Performance.swift | 68 +- .../WebIDL/PerformanceElementTiming.swift | 52 + Sources/DOMKit/WebIDL/PerformanceEntry.swift | 34 + .../WebIDL/PerformanceEventTiming.swift | 36 + .../WebIDL/PerformanceLongTaskTiming.swift | 20 + Sources/DOMKit/WebIDL/PerformanceMark.swift | 20 + .../WebIDL/PerformanceMarkOptions.swift | 25 + .../DOMKit/WebIDL/PerformanceMeasure.swift | 16 + .../WebIDL/PerformanceMeasureOptions.swift | 35 + .../DOMKit/WebIDL/PerformanceNavigation.swift | 34 + .../WebIDL/PerformanceNavigationTiming.swift | 56 + .../DOMKit/WebIDL/PerformanceObserver.swift | 34 + .../PerformanceObserverCallbackOptions.swift | 20 + .../WebIDL/PerformanceObserverEntryList.swift | 26 + .../WebIDL/PerformanceObserverInit.swift | 35 + .../WebIDL/PerformancePaintTiming.swift | 12 + .../WebIDL/PerformanceResourceTiming.swift | 88 + .../WebIDL/PerformanceServerTiming.swift | 30 + Sources/DOMKit/WebIDL/PerformanceTiming.swift | 102 + Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift | 20 + .../DOMKit/WebIDL/PeriodicSyncEventInit.swift | 20 + .../DOMKit/WebIDL/PeriodicSyncManager.swift | 44 + Sources/DOMKit/WebIDL/PeriodicWave.swift | 18 + .../WebIDL/PeriodicWaveConstraints.swift | 20 + .../DOMKit/WebIDL/PeriodicWaveOptions.swift | 25 + .../DOMKit/WebIDL/PermissionDescriptor.swift | 20 + .../WebIDL/PermissionSetParameters.swift | 30 + Sources/DOMKit/WebIDL/PermissionState.swift | 23 + Sources/DOMKit/WebIDL/PermissionStatus.swift | 24 + Sources/DOMKit/WebIDL/Permissions.swift | 44 + Sources/DOMKit/WebIDL/PermissionsPolicy.swift | 30 + ...PermissionsPolicyViolationReportBody.swift | 32 + Sources/DOMKit/WebIDL/PhotoCapabilities.swift | 35 + Sources/DOMKit/WebIDL/PhotoSettings.swift | 35 + .../DOMKit/WebIDL/PictureInPictureEvent.swift | 20 + .../WebIDL/PictureInPictureEventInit.swift | 20 + .../WebIDL/PictureInPictureWindow.swift | 24 + Sources/DOMKit/WebIDL/PlaneLayout.swift | 25 + Sources/DOMKit/WebIDL/PlaybackDirection.swift | 24 + Sources/DOMKit/WebIDL/Plugin.swift | 2 +- Sources/DOMKit/WebIDL/PluginArray.swift | 2 +- Sources/DOMKit/WebIDL/Point2D.swift | 25 + Sources/DOMKit/WebIDL/PointerEvent.swift | 72 + Sources/DOMKit/WebIDL/PointerEventInit.swift | 85 + Sources/DOMKit/WebIDL/PopStateEvent.swift | 2 +- Sources/DOMKit/WebIDL/PopStateEventInit.swift | 2 +- .../DOMKit/WebIDL/PortalActivateEvent.swift | 24 + .../WebIDL/PortalActivateEventInit.swift | 20 + .../DOMKit/WebIDL/PortalActivateOptions.swift | 20 + Sources/DOMKit/WebIDL/PortalHost.swift | 24 + .../DOMKit/WebIDL/PositionAlignSetting.swift | 24 + Sources/DOMKit/WebIDL/PositionOptions.swift | 30 + Sources/DOMKit/WebIDL/Presentation.swift | 22 + .../WebIDL/PresentationAvailability.swift | 20 + .../WebIDL/PresentationConnection.swift | 68 + ...PresentationConnectionAvailableEvent.swift | 20 + ...entationConnectionAvailableEventInit.swift | 20 + .../PresentationConnectionCloseEvent.swift | 24 + ...PresentationConnectionCloseEventInit.swift | 25 + .../PresentationConnectionCloseReason.swift | 23 + .../WebIDL/PresentationConnectionList.swift | 20 + .../WebIDL/PresentationConnectionState.swift | 24 + .../DOMKit/WebIDL/PresentationReceiver.swift | 18 + .../DOMKit/WebIDL/PresentationRequest.swift | 54 + Sources/DOMKit/WebIDL/PresentationStyle.swift | 23 + .../DOMKit/WebIDL/ProcessingInstruction.swift | 2 +- Sources/DOMKit/WebIDL/Profiler.swift | 34 + Sources/DOMKit/WebIDL/ProfilerFrame.swift | 35 + .../DOMKit/WebIDL/ProfilerInitOptions.swift | 25 + Sources/DOMKit/WebIDL/ProfilerSample.swift | 25 + Sources/DOMKit/WebIDL/ProfilerStack.swift | 25 + Sources/DOMKit/WebIDL/ProfilerTrace.swift | 35 + Sources/DOMKit/WebIDL/ProgressEvent.swift | 2 +- Sources/DOMKit/WebIDL/ProgressEventInit.swift | 2 +- .../DOMKit/WebIDL/PromiseRejectionEvent.swift | 2 +- .../WebIDL/PromiseRejectionEventInit.swift | 2 +- .../DOMKit/WebIDL/PromptResponseObject.swift | 20 + .../DOMKit/WebIDL/PropertyDefinition.swift | 35 + .../WebIDL/ProximityReadingValues.swift | 30 + Sources/DOMKit/WebIDL/ProximitySensor.swift | 28 + .../DOMKit/WebIDL/PublicKeyCredential.swift | 38 + .../PublicKeyCredentialCreationOptions.swift | 60 + .../PublicKeyCredentialDescriptor.swift | 30 + .../WebIDL/PublicKeyCredentialEntity.swift | 20 + .../PublicKeyCredentialParameters.swift | 25 + .../PublicKeyCredentialRequestOptions.swift | 45 + .../WebIDL/PublicKeyCredentialRpEntity.swift | 20 + .../WebIDL/PublicKeyCredentialType.swift | 21 + .../PublicKeyCredentialUserEntity.swift | 25 + Sources/DOMKit/WebIDL/PurchaseDetails.swift | 25 + .../DOMKit/WebIDL/PushEncryptionKeyName.swift | 22 + Sources/DOMKit/WebIDL/PushEvent.swift | 20 + Sources/DOMKit/WebIDL/PushEventInit.swift | 20 + Sources/DOMKit/WebIDL/PushManager.swift | 48 + Sources/DOMKit/WebIDL/PushMessageData.swift | 30 + .../WebIDL/PushPermissionDescriptor.swift | 20 + Sources/DOMKit/WebIDL/PushSubscription.swift | 44 + .../WebIDL/PushSubscriptionChangeEvent.swift | 24 + .../PushSubscriptionChangeEventInit.swift | 25 + .../DOMKit/WebIDL/PushSubscriptionJSON.swift | 30 + .../WebIDL/PushSubscriptionOptions.swift | 22 + .../WebIDL/PushSubscriptionOptionsInit.swift | 25 + Sources/DOMKit/WebIDL/QueryOptions.swift | 20 + Sources/DOMKit/WebIDL/QueuingStrategy.swift | 2 +- .../DOMKit/WebIDL/QueuingStrategyInit.swift | 2 +- Sources/DOMKit/WebIDL/RTCAnswerOptions.swift | 16 + .../DOMKit/WebIDL/RTCAudioHandlerStats.swift | 16 + .../DOMKit/WebIDL/RTCAudioReceiverStats.swift | 16 + .../DOMKit/WebIDL/RTCAudioSenderStats.swift | 20 + .../DOMKit/WebIDL/RTCAudioSourceStats.swift | 40 + Sources/DOMKit/WebIDL/RTCBundlePolicy.swift | 23 + Sources/DOMKit/WebIDL/RTCCertificate.swift | 22 + .../WebIDL/RTCCertificateExpiration.swift | 20 + .../DOMKit/WebIDL/RTCCertificateStats.swift | 35 + Sources/DOMKit/WebIDL/RTCCodecStats.swift | 50 + Sources/DOMKit/WebIDL/RTCCodecType.swift | 22 + Sources/DOMKit/WebIDL/RTCConfiguration.swift | 50 + Sources/DOMKit/WebIDL/RTCDTMFSender.swift | 28 + .../WebIDL/RTCDTMFToneChangeEvent.swift | 20 + .../WebIDL/RTCDTMFToneChangeEventInit.swift | 20 + Sources/DOMKit/WebIDL/RTCDataChannel.swift | 104 + .../DOMKit/WebIDL/RTCDataChannelEvent.swift | 20 + .../WebIDL/RTCDataChannelEventInit.swift | 20 + .../DOMKit/WebIDL/RTCDataChannelInit.swift | 50 + .../DOMKit/WebIDL/RTCDataChannelState.swift | 24 + .../DOMKit/WebIDL/RTCDataChannelStats.swift | 55 + .../WebIDL/RTCDegradationPreference.swift | 23 + .../DOMKit/WebIDL/RTCDtlsFingerprint.swift | 25 + Sources/DOMKit/WebIDL/RTCDtlsTransport.swift | 32 + .../DOMKit/WebIDL/RTCDtlsTransportState.swift | 25 + .../DOMKit/WebIDL/RTCEncodedAudioFrame.swift | 26 + .../WebIDL/RTCEncodedAudioFrameMetadata.swift | 30 + .../DOMKit/WebIDL/RTCEncodedVideoFrame.swift | 30 + .../WebIDL/RTCEncodedVideoFrameMetadata.swift | 60 + .../WebIDL/RTCEncodedVideoFrameType.swift | 23 + Sources/DOMKit/WebIDL/RTCError.swift | 40 + .../DOMKit/WebIDL/RTCErrorDetailType.swift | 27 + .../DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift | 28 + Sources/DOMKit/WebIDL/RTCErrorEvent.swift | 20 + Sources/DOMKit/WebIDL/RTCErrorEventInit.swift | 20 + Sources/DOMKit/WebIDL/RTCErrorInit.swift | 45 + Sources/DOMKit/WebIDL/RTCIceCandidate.swift | 78 + .../DOMKit/WebIDL/RTCIceCandidateInit.swift | 35 + .../DOMKit/WebIDL/RTCIceCandidatePair.swift | 25 + .../WebIDL/RTCIceCandidatePairStats.swift | 175 + .../DOMKit/WebIDL/RTCIceCandidateStats.swift | 55 + .../DOMKit/WebIDL/RTCIceCandidateType.swift | 24 + Sources/DOMKit/WebIDL/RTCIceComponent.swift | 22 + .../DOMKit/WebIDL/RTCIceConnectionState.swift | 27 + .../DOMKit/WebIDL/RTCIceCredentialType.swift | 21 + .../DOMKit/WebIDL/RTCIceGatherOptions.swift | 25 + .../DOMKit/WebIDL/RTCIceGathererState.swift | 23 + .../DOMKit/WebIDL/RTCIceGatheringState.swift | 23 + Sources/DOMKit/WebIDL/RTCIceParameters.swift | 30 + Sources/DOMKit/WebIDL/RTCIceProtocol.swift | 22 + Sources/DOMKit/WebIDL/RTCIceRole.swift | 23 + Sources/DOMKit/WebIDL/RTCIceServer.swift | 35 + Sources/DOMKit/WebIDL/RTCIceServerStats.swift | 45 + .../WebIDL/RTCIceTcpCandidateType.swift | 23 + Sources/DOMKit/WebIDL/RTCIceTransport.swift | 88 + .../DOMKit/WebIDL/RTCIceTransportPolicy.swift | 22 + .../DOMKit/WebIDL/RTCIceTransportState.swift | 27 + .../DOMKit/WebIDL/RTCIdentityAssertion.swift | 26 + .../WebIDL/RTCIdentityAssertionResult.swift | 25 + .../DOMKit/WebIDL/RTCIdentityProvider.swift | 25 + .../WebIDL/RTCIdentityProviderDetails.swift | 25 + .../RTCIdentityProviderGlobalScope.swift | 16 + .../WebIDL/RTCIdentityProviderOptions.swift | 30 + .../WebIDL/RTCIdentityProviderRegistrar.swift | 18 + .../WebIDL/RTCIdentityValidationResult.swift | 25 + .../WebIDL/RTCInboundRtpStreamStats.swift | 235 + .../DOMKit/WebIDL/RTCInsertableStreams.swift | 25 + .../RTCLocalSessionDescriptionInit.swift | 25 + .../DOMKit/WebIDL/RTCMediaHandlerStats.swift | 30 + .../DOMKit/WebIDL/RTCMediaSourceStats.swift | 30 + .../DOMKit/WebIDL/RTCOfferAnswerOptions.swift | 16 + Sources/DOMKit/WebIDL/RTCOfferOptions.swift | 30 + .../WebIDL/RTCOutboundRtpStreamStats.swift | 215 + Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 290 ++ .../RTCPeerConnectionIceErrorEvent.swift | 36 + .../RTCPeerConnectionIceErrorEventInit.swift | 40 + .../WebIDL/RTCPeerConnectionIceEvent.swift | 24 + .../RTCPeerConnectionIceEventInit.swift | 25 + .../WebIDL/RTCPeerConnectionState.swift | 26 + .../WebIDL/RTCPeerConnectionStats.swift | 35 + Sources/DOMKit/WebIDL/RTCPriorityType.swift | 24 + .../WebIDL/RTCQualityLimitationReason.swift | 24 + .../WebIDL/RTCReceivedRtpStreamStats.swift | 95 + .../RTCRemoteInboundRtpStreamStats.swift | 45 + .../RTCRemoteOutboundRtpStreamStats.swift | 45 + Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift | 21 + Sources/DOMKit/WebIDL/RTCRtcpParameters.swift | 25 + .../DOMKit/WebIDL/RTCRtpCapabilities.swift | 25 + .../DOMKit/WebIDL/RTCRtpCodecCapability.swift | 40 + .../DOMKit/WebIDL/RTCRtpCodecParameters.swift | 40 + .../WebIDL/RTCRtpCodingParameters.swift | 20 + .../WebIDL/RTCRtpContributingSource.swift | 35 + .../RTCRtpContributingSourceStats.swift | 35 + .../WebIDL/RTCRtpDecodingParameters.swift | 16 + .../WebIDL/RTCRtpEncodingParameters.swift | 45 + .../RTCRtpHeaderExtensionCapability.swift | 20 + .../RTCRtpHeaderExtensionParameters.swift | 30 + Sources/DOMKit/WebIDL/RTCRtpParameters.swift | 30 + .../WebIDL/RTCRtpReceiveParameters.swift | 16 + Sources/DOMKit/WebIDL/RTCRtpReceiver.swift | 52 + .../DOMKit/WebIDL/RTCRtpScriptTransform.swift | 18 + .../WebIDL/RTCRtpScriptTransformer.swift | 46 + .../DOMKit/WebIDL/RTCRtpSendParameters.swift | 30 + Sources/DOMKit/WebIDL/RTCRtpSender.swift | 82 + Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift | 35 + .../WebIDL/RTCRtpSynchronizationSource.swift | 16 + Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift | 42 + .../WebIDL/RTCRtpTransceiverDirection.swift | 25 + .../DOMKit/WebIDL/RTCRtpTransceiverInit.swift | 30 + .../WebIDL/RTCRtpTransceiverStats.swift | 30 + Sources/DOMKit/WebIDL/RTCSctpTransport.swift | 32 + .../DOMKit/WebIDL/RTCSctpTransportState.swift | 23 + .../DOMKit/WebIDL/RTCSctpTransportStats.swift | 45 + Sources/DOMKit/WebIDL/RTCSdpType.swift | 24 + .../DOMKit/WebIDL/RTCSentRtpStreamStats.swift | 25 + .../DOMKit/WebIDL/RTCSessionDescription.swift | 30 + .../WebIDL/RTCSessionDescriptionInit.swift | 25 + Sources/DOMKit/WebIDL/RTCSignalingState.swift | 26 + Sources/DOMKit/WebIDL/RTCStats.swift | 30 + .../RTCStatsIceCandidatePairState.swift | 25 + Sources/DOMKit/WebIDL/RTCStatsReport.swift | 16 + Sources/DOMKit/WebIDL/RTCStatsType.swift | 41 + Sources/DOMKit/WebIDL/RTCTrackEvent.swift | 32 + Sources/DOMKit/WebIDL/RTCTrackEventInit.swift | 35 + Sources/DOMKit/WebIDL/RTCTransformEvent.swift | 16 + Sources/DOMKit/WebIDL/RTCTransportStats.swift | 100 + .../DOMKit/WebIDL/RTCVideoHandlerStats.swift | 16 + .../DOMKit/WebIDL/RTCVideoReceiverStats.swift | 16 + .../DOMKit/WebIDL/RTCVideoSenderStats.swift | 20 + .../DOMKit/WebIDL/RTCVideoSourceStats.swift | 40 + Sources/DOMKit/WebIDL/RadioNodeList.swift | 2 +- Sources/DOMKit/WebIDL/Range.swift | 14 +- Sources/DOMKit/WebIDL/ReadOptions.swift | 20 + .../WebIDL/ReadableByteStreamController.swift | 2 +- Sources/DOMKit/WebIDL/ReadableStream.swift | 2 +- .../WebIDL/ReadableStreamBYOBReadResult.swift | 2 +- .../WebIDL/ReadableStreamBYOBReader.swift | 2 +- .../WebIDL/ReadableStreamBYOBRequest.swift | 2 +- .../ReadableStreamDefaultController.swift | 2 +- .../ReadableStreamDefaultReadResult.swift | 2 +- .../WebIDL/ReadableStreamDefaultReader.swift | 2 +- .../ReadableStreamGetReaderOptions.swift | 2 +- .../ReadableStreamIteratorOptions.swift | 2 +- .../DOMKit/WebIDL/ReadableWritablePair.swift | 2 +- Sources/DOMKit/WebIDL/ReadyState.swift | 23 + Sources/DOMKit/WebIDL/RecordingState.swift | 23 + Sources/DOMKit/WebIDL/RedEyeReduction.swift | 23 + Sources/DOMKit/WebIDL/Region.swift | 13 + .../DOMKit/WebIDL/RegistrationOptions.swift | 30 + .../DOMKit/WebIDL/RelatedApplication.swift | 35 + .../RelativeOrientationReadingValues.swift | 16 + .../WebIDL/RelativeOrientationSensor.swift | 16 + Sources/DOMKit/WebIDL/RemotePlayback.swift | 58 + .../DOMKit/WebIDL/RemotePlaybackState.swift | 23 + Sources/DOMKit/WebIDL/Report.swift | 30 + Sources/DOMKit/WebIDL/ReportBody.swift | 18 + Sources/DOMKit/WebIDL/ReportingObserver.swift | 30 + .../WebIDL/ReportingObserverOptions.swift | 25 + Sources/DOMKit/WebIDL/Request.swift | 6 +- .../DOMKit/WebIDL/RequestDeviceOptions.swift | 35 + Sources/DOMKit/WebIDL/RequestInit.swift | 9 +- .../WebIDL/ResidentKeyRequirement.swift | 23 + Sources/DOMKit/WebIDL/ResizeObserver.swift | 30 + .../WebIDL/ResizeObserverBoxOptions.swift | 23 + .../DOMKit/WebIDL/ResizeObserverEntry.swift | 34 + .../DOMKit/WebIDL/ResizeObserverOptions.swift | 20 + .../DOMKit/WebIDL/ResizeObserverSize.swift | 22 + Sources/DOMKit/WebIDL/Response.swift | 2 +- Sources/DOMKit/WebIDL/ResponseInit.swift | 2 +- .../DOMKit/WebIDL/RsaHashedImportParams.swift | 20 + .../DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift | 20 + .../DOMKit/WebIDL/RsaHashedKeyGenParams.swift | 20 + Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift | 25 + Sources/DOMKit/WebIDL/RsaKeyGenParams.swift | 25 + Sources/DOMKit/WebIDL/RsaOaepParams.swift | 20 + .../DOMKit/WebIDL/RsaOtherPrimesInfo.swift | 30 + Sources/DOMKit/WebIDL/RsaPssParams.swift | 20 + Sources/DOMKit/WebIDL/SFrameTransform.swift | 32 + .../WebIDL/SFrameTransformErrorEvent.swift | 28 + .../SFrameTransformErrorEventInit.swift | 30 + .../SFrameTransformErrorEventType.swift | 23 + .../WebIDL/SFrameTransformOptions.swift | 20 + .../DOMKit/WebIDL/SFrameTransformRole.swift | 22 + Sources/DOMKit/WebIDL/SVGAElement.swift | 88 + Sources/DOMKit/WebIDL/SVGAngle.swift | 48 + Sources/DOMKit/WebIDL/SVGAnimateElement.swift | 12 + .../WebIDL/SVGAnimateMotionElement.swift | 12 + .../WebIDL/SVGAnimateTransformElement.swift | 12 + Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift | 22 + .../DOMKit/WebIDL/SVGAnimatedBoolean.swift | 22 + .../WebIDL/SVGAnimatedEnumeration.swift | 22 + .../DOMKit/WebIDL/SVGAnimatedInteger.swift | 22 + Sources/DOMKit/WebIDL/SVGAnimatedLength.swift | 22 + .../DOMKit/WebIDL/SVGAnimatedLengthList.swift | 22 + Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift | 22 + .../DOMKit/WebIDL/SVGAnimatedNumberList.swift | 22 + Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift | 11 + .../SVGAnimatedPreserveAspectRatio.swift | 22 + Sources/DOMKit/WebIDL/SVGAnimatedRect.swift | 22 + Sources/DOMKit/WebIDL/SVGAnimatedString.swift | 22 + .../WebIDL/SVGAnimatedTransformList.swift | 22 + .../DOMKit/WebIDL/SVGAnimationElement.swift | 56 + .../DOMKit/WebIDL/SVGBoundingBoxOptions.swift | 35 + Sources/DOMKit/WebIDL/SVGCircleElement.swift | 24 + .../DOMKit/WebIDL/SVGClipPathElement.swift | 20 + .../SVGComponentTransferFunctionElement.swift | 52 + Sources/DOMKit/WebIDL/SVGDefsElement.swift | 12 + Sources/DOMKit/WebIDL/SVGDescElement.swift | 12 + Sources/DOMKit/WebIDL/SVGDiscardElement.swift | 12 + Sources/DOMKit/WebIDL/SVGElement.swift | 24 + .../DOMKit/WebIDL/SVGElementInstance.swift | 11 + Sources/DOMKit/WebIDL/SVGEllipseElement.swift | 28 + Sources/DOMKit/WebIDL/SVGFEBlendElement.swift | 58 + .../WebIDL/SVGFEColorMatrixElement.swift | 34 + .../SVGFEComponentTransferElement.swift | 16 + .../DOMKit/WebIDL/SVGFECompositeElement.swift | 54 + .../WebIDL/SVGFEConvolveMatrixElement.swift | 68 + .../WebIDL/SVGFEDiffuseLightingElement.swift | 32 + .../WebIDL/SVGFEDisplacementMapElement.swift | 42 + .../WebIDL/SVGFEDistantLightElement.swift | 20 + .../WebIDL/SVGFEDropShadowElement.swift | 36 + Sources/DOMKit/WebIDL/SVGFEFloodElement.swift | 12 + Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift | 12 + Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift | 12 + Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift | 12 + Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift | 12 + .../WebIDL/SVGFEGaussianBlurElement.swift | 40 + Sources/DOMKit/WebIDL/SVGFEImageElement.swift | 20 + Sources/DOMKit/WebIDL/SVGFEMergeElement.swift | 12 + .../DOMKit/WebIDL/SVGFEMergeNodeElement.swift | 16 + .../WebIDL/SVGFEMorphologyElement.swift | 34 + .../DOMKit/WebIDL/SVGFEOffsetElement.swift | 24 + .../WebIDL/SVGFEPointLightElement.swift | 24 + .../WebIDL/SVGFESpecularLightingElement.swift | 36 + .../DOMKit/WebIDL/SVGFESpotLightElement.swift | 44 + Sources/DOMKit/WebIDL/SVGFETileElement.swift | 16 + .../WebIDL/SVGFETurbulenceElement.swift | 48 + Sources/DOMKit/WebIDL/SVGFilterElement.swift | 36 + ...SVGFilterPrimitiveStandardAttributes.swift | 17 + Sources/DOMKit/WebIDL/SVGFitToViewBox.swift | 11 + .../WebIDL/SVGForeignObjectElement.swift | 28 + Sources/DOMKit/WebIDL/SVGGElement.swift | 12 + .../DOMKit/WebIDL/SVGGeometryElement.swift | 32 + .../DOMKit/WebIDL/SVGGradientElement.swift | 32 + .../DOMKit/WebIDL/SVGGraphicsElement.swift | 28 + Sources/DOMKit/WebIDL/SVGImageElement.swift | 36 + Sources/DOMKit/WebIDL/SVGLength.swift | 60 + Sources/DOMKit/WebIDL/SVGLengthList.swift | 52 + Sources/DOMKit/WebIDL/SVGLineElement.swift | 28 + .../WebIDL/SVGLinearGradientElement.swift | 28 + Sources/DOMKit/WebIDL/SVGMPathElement.swift | 12 + Sources/DOMKit/WebIDL/SVGMarkerElement.swift | 64 + Sources/DOMKit/WebIDL/SVGMaskElement.swift | 36 + .../DOMKit/WebIDL/SVGMetadataElement.swift | 12 + Sources/DOMKit/WebIDL/SVGNumber.swift | 18 + Sources/DOMKit/WebIDL/SVGNumberList.swift | 52 + Sources/DOMKit/WebIDL/SVGPathElement.swift | 12 + Sources/DOMKit/WebIDL/SVGPatternElement.swift | 40 + Sources/DOMKit/WebIDL/SVGPointList.swift | 52 + Sources/DOMKit/WebIDL/SVGPolygonElement.swift | 12 + .../DOMKit/WebIDL/SVGPolylineElement.swift | 12 + .../WebIDL/SVGPreserveAspectRatio.swift | 50 + .../WebIDL/SVGRadialGradientElement.swift | 36 + Sources/DOMKit/WebIDL/SVGRectElement.swift | 36 + Sources/DOMKit/WebIDL/SVGSVGElement.swift | 128 + Sources/DOMKit/WebIDL/SVGScriptElement.swift | 20 + Sources/DOMKit/WebIDL/SVGSetElement.swift | 12 + Sources/DOMKit/WebIDL/SVGStopElement.swift | 16 + Sources/DOMKit/WebIDL/SVGStringList.swift | 52 + Sources/DOMKit/WebIDL/SVGStyleElement.swift | 24 + Sources/DOMKit/WebIDL/SVGSwitchElement.swift | 12 + Sources/DOMKit/WebIDL/SVGSymbolElement.swift | 12 + Sources/DOMKit/WebIDL/SVGTSpanElement.swift | 12 + Sources/DOMKit/WebIDL/SVGTests.swift | 11 + .../DOMKit/WebIDL/SVGTextContentElement.swift | 62 + Sources/DOMKit/WebIDL/SVGTextElement.swift | 12 + .../DOMKit/WebIDL/SVGTextPathElement.swift | 36 + .../WebIDL/SVGTextPositioningElement.swift | 32 + Sources/DOMKit/WebIDL/SVGTitleElement.swift | 12 + Sources/DOMKit/WebIDL/SVGTransform.swift | 64 + Sources/DOMKit/WebIDL/SVGTransformList.swift | 60 + Sources/DOMKit/WebIDL/SVGURIReference.swift | 9 + Sources/DOMKit/WebIDL/SVGUnitTypes.swift | 20 + Sources/DOMKit/WebIDL/SVGUseElement.swift | 36 + .../WebIDL/SVGUseElementShadowRoot.swift | 12 + Sources/DOMKit/WebIDL/SVGViewElement.swift | 12 + Sources/DOMKit/WebIDL/Sanitizer.swift | 34 + Sources/DOMKit/WebIDL/SanitizerConfig.swift | 50 + .../DOMKit/WebIDL/SaveFilePickerOptions.swift | 20 + Sources/DOMKit/WebIDL/Scheduler.swift | 24 + .../WebIDL/SchedulerPostTaskOptions.swift | 30 + Sources/DOMKit/WebIDL/Scheduling.swift | 18 + Sources/DOMKit/WebIDL/Screen.swift | 42 + Sources/DOMKit/WebIDL/ScreenIdleState.swift | 22 + Sources/DOMKit/WebIDL/ScreenOrientation.swift | 38 + .../DOMKit/WebIDL/ScriptProcessorNode.swift | 20 + .../WebIDL/ScriptingPolicyReportBody.swift | 36 + .../WebIDL/ScriptingPolicyViolationType.swift | 24 + Sources/DOMKit/WebIDL/ScrollBehavior.swift | 22 + Sources/DOMKit/WebIDL/ScrollDirection.swift | 24 + .../DOMKit/WebIDL/ScrollIntoViewOptions.swift | 25 + .../DOMKit/WebIDL/ScrollLogicalPosition.swift | 24 + Sources/DOMKit/WebIDL/ScrollOptions.swift | 20 + Sources/DOMKit/WebIDL/ScrollSetting.swift | 22 + Sources/DOMKit/WebIDL/ScrollTimeline.swift | 28 + .../WebIDL/ScrollTimelineAutoKeyword.swift | 21 + .../DOMKit/WebIDL/ScrollTimelineOptions.swift | 30 + Sources/DOMKit/WebIDL/ScrollToOptions.swift | 25 + .../SecurePaymentConfirmationRequest.swift | 50 + .../WebIDL/SecurityPolicyViolationEvent.swift | 64 + ...urityPolicyViolationEventDisposition.swift | 22 + .../SecurityPolicyViolationEventInit.swift | 75 + Sources/DOMKit/WebIDL/Selection.swift | 102 + Sources/DOMKit/WebIDL/Sensor.swift | 44 + Sources/DOMKit/WebIDL/SensorErrorEvent.swift | 20 + .../DOMKit/WebIDL/SensorErrorEventInit.swift | 20 + Sources/DOMKit/WebIDL/SensorOptions.swift | 20 + Sources/DOMKit/WebIDL/SequenceEffect.swift | 20 + Sources/DOMKit/WebIDL/Serial.swift | 40 + .../DOMKit/WebIDL/SerialInputSignals.swift | 35 + Sources/DOMKit/WebIDL/SerialOptions.swift | 45 + .../DOMKit/WebIDL/SerialOutputSignals.swift | 30 + Sources/DOMKit/WebIDL/SerialPort.swift | 72 + Sources/DOMKit/WebIDL/SerialPortFilter.swift | 25 + Sources/DOMKit/WebIDL/SerialPortInfo.swift | 25 + .../WebIDL/SerialPortRequestOptions.swift | 20 + .../DOMKit/WebIDL/ServiceEventHandlers.swift | 22 + Sources/DOMKit/WebIDL/ServiceWorker.swift | 32 + .../WebIDL/ServiceWorkerContainer.swift | 66 + .../WebIDL/ServiceWorkerGlobalScope.swift | 114 + .../WebIDL/ServiceWorkerRegistration.swift | 108 + .../DOMKit/WebIDL/ServiceWorkerState.swift | 26 + .../WebIDL/ServiceWorkerUpdateViaCache.swift | 23 + Sources/DOMKit/WebIDL/SetHTMLOptions.swift | 20 + Sources/DOMKit/WebIDL/ShadowAnimation.swift | 20 + Sources/DOMKit/WebIDL/ShadowRoot.swift | 4 +- Sources/DOMKit/WebIDL/ShadowRootInit.swift | 2 +- Sources/DOMKit/WebIDL/ShareData.swift | 35 + Sources/DOMKit/WebIDL/SharedWorker.swift | 2 +- .../WebIDL/SharedWorkerGlobalScope.swift | 2 +- Sources/DOMKit/WebIDL/SourceBuffer.swift | 84 + Sources/DOMKit/WebIDL/SourceBufferList.swift | 28 + .../WebIDL/SpatialNavigationDirection.swift | 24 + .../SpatialNavigationSearchOptions.swift | 25 + Sources/DOMKit/WebIDL/SpeechGrammar.swift | 22 + Sources/DOMKit/WebIDL/SpeechGrammarList.swift | 34 + Sources/DOMKit/WebIDL/SpeechRecognition.swift | 92 + .../WebIDL/SpeechRecognitionAlternative.swift | 22 + .../WebIDL/SpeechRecognitionErrorCode.swift | 28 + .../WebIDL/SpeechRecognitionErrorEvent.swift | 24 + .../SpeechRecognitionErrorEventInit.swift | 25 + .../WebIDL/SpeechRecognitionEvent.swift | 24 + .../WebIDL/SpeechRecognitionEventInit.swift | 25 + .../WebIDL/SpeechRecognitionResult.swift | 26 + .../WebIDL/SpeechRecognitionResultList.swift | 22 + Sources/DOMKit/WebIDL/SpeechSynthesis.swift | 48 + .../WebIDL/SpeechSynthesisErrorCode.swift | 32 + .../WebIDL/SpeechSynthesisErrorEvent.swift | 20 + .../SpeechSynthesisErrorEventInit.swift | 20 + .../DOMKit/WebIDL/SpeechSynthesisEvent.swift | 36 + .../WebIDL/SpeechSynthesisEventInit.swift | 40 + .../WebIDL/SpeechSynthesisUtterance.swift | 68 + .../DOMKit/WebIDL/SpeechSynthesisVoice.swift | 34 + Sources/DOMKit/WebIDL/StaticRange.swift | 2 +- Sources/DOMKit/WebIDL/StaticRangeInit.swift | 2 +- Sources/DOMKit/WebIDL/StereoPannerNode.swift | 20 + .../DOMKit/WebIDL/StereoPannerOptions.swift | 20 + Sources/DOMKit/WebIDL/Storage.swift | 2 +- Sources/DOMKit/WebIDL/StorageEstimate.swift | 25 + Sources/DOMKit/WebIDL/StorageEvent.swift | 2 +- Sources/DOMKit/WebIDL/StorageEventInit.swift | 2 +- Sources/DOMKit/WebIDL/StorageManager.swift | 54 + Sources/DOMKit/WebIDL/StreamPipeOptions.swift | 2 +- Sources/DOMKit/WebIDL/Strings.swift | 3975 +++++++++++++++++ .../WebIDL/StructuredSerializeOptions.swift | 2 +- Sources/DOMKit/WebIDL/StylePropertyMap.swift | 28 + .../WebIDL/StylePropertyMapReadOnly.swift | 35 + Sources/DOMKit/WebIDL/StyleSheet.swift | 2 +- Sources/DOMKit/WebIDL/StyleSheetList.swift | 2 +- Sources/DOMKit/WebIDL/SubmitEvent.swift | 2 +- Sources/DOMKit/WebIDL/SubmitEventInit.swift | 2 +- Sources/DOMKit/WebIDL/SubtleCrypto.swift | 148 + Sources/DOMKit/WebIDL/SvcOutputMetadata.swift | 20 + Sources/DOMKit/WebIDL/SyncEvent.swift | 24 + Sources/DOMKit/WebIDL/SyncEventInit.swift | 25 + Sources/DOMKit/WebIDL/SyncManager.swift | 34 + Sources/DOMKit/WebIDL/Table.swift | 34 + Sources/DOMKit/WebIDL/TableDescriptor.swift | 30 + Sources/DOMKit/WebIDL/TableKind.swift | 22 + .../DOMKit/WebIDL/TaskAttributionTiming.swift | 32 + Sources/DOMKit/WebIDL/TaskController.swift | 20 + .../DOMKit/WebIDL/TaskControllerInit.swift | 20 + Sources/DOMKit/WebIDL/TaskPriority.swift | 23 + .../WebIDL/TaskPriorityChangeEvent.swift | 20 + .../WebIDL/TaskPriorityChangeEventInit.swift | 20 + Sources/DOMKit/WebIDL/TaskSignal.swift | 20 + Sources/DOMKit/WebIDL/TestUtils.swift | 20 + Sources/DOMKit/WebIDL/Text.swift | 4 +- Sources/DOMKit/WebIDL/TextDecodeOptions.swift | 20 + Sources/DOMKit/WebIDL/TextDecoder.swift | 22 + Sources/DOMKit/WebIDL/TextDecoderCommon.swift | 13 + .../DOMKit/WebIDL/TextDecoderOptions.swift | 25 + Sources/DOMKit/WebIDL/TextDecoderStream.swift | 18 + Sources/DOMKit/WebIDL/TextDetector.swift | 28 + Sources/DOMKit/WebIDL/TextEncoder.swift | 26 + Sources/DOMKit/WebIDL/TextEncoderCommon.swift | 9 + .../WebIDL/TextEncoderEncodeIntoResult.swift | 25 + Sources/DOMKit/WebIDL/TextEncoderStream.swift | 18 + Sources/DOMKit/WebIDL/TextFormat.swift | 46 + Sources/DOMKit/WebIDL/TextFormatInit.swift | 50 + .../DOMKit/WebIDL/TextFormatUpdateEvent.swift | 20 + .../WebIDL/TextFormatUpdateEventInit.swift | 20 + Sources/DOMKit/WebIDL/TextMetrics.swift | 2 +- Sources/DOMKit/WebIDL/TextTrack.swift | 6 +- Sources/DOMKit/WebIDL/TextTrackCue.swift | 2 +- Sources/DOMKit/WebIDL/TextTrackCueList.swift | 2 +- Sources/DOMKit/WebIDL/TextTrackList.swift | 2 +- Sources/DOMKit/WebIDL/TextUpdateEvent.swift | 44 + .../DOMKit/WebIDL/TextUpdateEventInit.swift | 50 + Sources/DOMKit/WebIDL/TimeEvent.swift | 24 + Sources/DOMKit/WebIDL/TimeRanges.swift | 2 +- Sources/DOMKit/WebIDL/TimelinePhase.swift | 24 + Sources/DOMKit/WebIDL/TokenBinding.swift | 25 + .../DOMKit/WebIDL/TokenBindingStatus.swift | 22 + Sources/DOMKit/WebIDL/Touch.swift | 78 + Sources/DOMKit/WebIDL/TouchEvent.swift | 44 + Sources/DOMKit/WebIDL/TouchEventInit.swift | 30 + Sources/DOMKit/WebIDL/TouchInit.swift | 90 + Sources/DOMKit/WebIDL/TouchList.swift | 22 + Sources/DOMKit/WebIDL/TouchType.swift | 22 + Sources/DOMKit/WebIDL/TrackEvent.swift | 2 +- Sources/DOMKit/WebIDL/TrackEventInit.swift | 2 +- .../WebIDL/TransactionAutomationMode.swift | 23 + Sources/DOMKit/WebIDL/TransferFunction.swift | 23 + Sources/DOMKit/WebIDL/TransformStream.swift | 2 +- .../TransformStreamDefaultController.swift | 2 +- Sources/DOMKit/WebIDL/Transformer.swift | 2 +- Sources/DOMKit/WebIDL/TransitionEvent.swift | 28 + .../DOMKit/WebIDL/TransitionEventInit.swift | 30 + Sources/DOMKit/WebIDL/TreeWalker.swift | 2 +- Sources/DOMKit/WebIDL/TrustedHTML.swift | 26 + Sources/DOMKit/WebIDL/TrustedScript.swift | 26 + Sources/DOMKit/WebIDL/TrustedScriptURL.swift | 26 + Sources/DOMKit/WebIDL/TrustedTypePolicy.swift | 30 + .../WebIDL/TrustedTypePolicyFactory.swift | 50 + .../WebIDL/TrustedTypePolicyOptions.swift | 30 + Sources/DOMKit/WebIDL/Typedefs.swift | 182 +- Sources/DOMKit/WebIDL/UADataValues.swift | 65 + Sources/DOMKit/WebIDL/UALowEntropyJSON.swift | 30 + Sources/DOMKit/WebIDL/UIEvent.swift | 6 +- Sources/DOMKit/WebIDL/UIEventInit.swift | 9 +- Sources/DOMKit/WebIDL/ULongRange.swift | 25 + Sources/DOMKit/WebIDL/URL.swift | 58 +- Sources/DOMKit/WebIDL/URLPattern.swift | 58 + .../WebIDL/URLPatternComponentResult.swift | 25 + Sources/DOMKit/WebIDL/URLPatternInit.swift | 60 + Sources/DOMKit/WebIDL/URLPatternResult.swift | 60 + Sources/DOMKit/WebIDL/URLSearchParams.swift | 55 + Sources/DOMKit/WebIDL/USB.swift | 40 + .../DOMKit/WebIDL/USBAlternateInterface.swift | 42 + Sources/DOMKit/WebIDL/USBConfiguration.swift | 30 + .../DOMKit/WebIDL/USBConnectionEvent.swift | 20 + .../WebIDL/USBConnectionEventInit.swift | 20 + .../WebIDL/USBControlTransferParameters.swift | 40 + Sources/DOMKit/WebIDL/USBDevice.swift | 232 + Sources/DOMKit/WebIDL/USBDeviceFilter.swift | 45 + .../WebIDL/USBDeviceRequestOptions.swift | 20 + Sources/DOMKit/WebIDL/USBDirection.swift | 22 + Sources/DOMKit/WebIDL/USBEndpoint.swift | 34 + Sources/DOMKit/WebIDL/USBEndpointType.swift | 23 + .../DOMKit/WebIDL/USBInTransferResult.swift | 26 + Sources/DOMKit/WebIDL/USBInterface.swift | 34 + .../USBIsochronousInTransferPacket.swift | 26 + .../USBIsochronousInTransferResult.swift | 26 + .../USBIsochronousOutTransferPacket.swift | 26 + .../USBIsochronousOutTransferResult.swift | 22 + .../DOMKit/WebIDL/USBOutTransferResult.swift | 26 + .../WebIDL/USBPermissionDescriptor.swift | 20 + .../DOMKit/WebIDL/USBPermissionResult.swift | 16 + .../DOMKit/WebIDL/USBPermissionStorage.swift | 20 + Sources/DOMKit/WebIDL/USBRecipient.swift | 24 + Sources/DOMKit/WebIDL/USBRequestType.swift | 23 + Sources/DOMKit/WebIDL/USBTransferStatus.swift | 23 + .../WebIDL/UncalibratedMagnetometer.swift | 40 + ...ncalibratedMagnetometerReadingValues.swift | 45 + Sources/DOMKit/WebIDL/UnderlyingSink.swift | 2 +- Sources/DOMKit/WebIDL/UnderlyingSource.swift | 2 +- Sources/DOMKit/WebIDL/UserIdleState.swift | 22 + .../WebIDL/UserVerificationRequirement.swift | 23 + Sources/DOMKit/WebIDL/VTTCue.swift | 60 + Sources/DOMKit/WebIDL/VTTRegion.swift | 50 + Sources/DOMKit/WebIDL/ValidityState.swift | 2 +- .../DOMKit/WebIDL/ValidityStateFlags.swift | 2 +- Sources/DOMKit/WebIDL/ValueEvent.swift | 20 + Sources/DOMKit/WebIDL/ValueEventInit.swift | 20 + Sources/DOMKit/WebIDL/ValueType.swift | 27 + .../DOMKit/WebIDL/VideoColorPrimaries.swift | 23 + Sources/DOMKit/WebIDL/VideoColorSpace.swift | 38 + .../DOMKit/WebIDL/VideoColorSpaceInit.swift | 35 + .../DOMKit/WebIDL/VideoConfiguration.swift | 65 + Sources/DOMKit/WebIDL/VideoDecoder.swift | 62 + .../DOMKit/WebIDL/VideoDecoderConfig.swift | 60 + Sources/DOMKit/WebIDL/VideoDecoderInit.swift | 25 + .../DOMKit/WebIDL/VideoDecoderSupport.swift | 25 + Sources/DOMKit/WebIDL/VideoEncoder.swift | 62 + .../DOMKit/WebIDL/VideoEncoderConfig.swift | 75 + .../WebIDL/VideoEncoderEncodeOptions.swift | 20 + Sources/DOMKit/WebIDL/VideoEncoderInit.swift | 25 + .../DOMKit/WebIDL/VideoEncoderSupport.swift | 25 + .../DOMKit/WebIDL/VideoFacingModeEnum.swift | 24 + Sources/DOMKit/WebIDL/VideoFrame.swift | 84 + .../DOMKit/WebIDL/VideoFrameBufferInit.swift | 65 + .../WebIDL/VideoFrameCopyToOptions.swift | 25 + Sources/DOMKit/WebIDL/VideoFrameInit.swift | 45 + .../DOMKit/WebIDL/VideoFrameMetadata.swift | 65 + .../WebIDL/VideoMatrixCoefficients.swift | 24 + Sources/DOMKit/WebIDL/VideoPixelFormat.swift | 29 + .../DOMKit/WebIDL/VideoPlaybackQuality.swift | 30 + .../DOMKit/WebIDL/VideoResizeModeEnum.swift | 22 + Sources/DOMKit/WebIDL/VideoTrack.swift | 6 +- .../DOMKit/WebIDL/VideoTrackGenerator.swift | 30 + Sources/DOMKit/WebIDL/VideoTrackList.swift | 2 +- .../WebIDL/VideoTransferCharacteristics.swift | 23 + Sources/DOMKit/WebIDL/VirtualKeyboard.swift | 32 + Sources/DOMKit/WebIDL/VisualViewport.swift | 52 + ...BGL_blend_equation_advanced_coherent.swift | 44 + .../WebIDL/WEBGL_color_buffer_float.swift | 20 + .../WEBGL_compressed_texture_astc.swift | 74 + .../WebIDL/WEBGL_compressed_texture_etc.swift | 34 + .../WEBGL_compressed_texture_etc1.swift | 16 + .../WEBGL_compressed_texture_pvrtc.swift | 22 + .../WEBGL_compressed_texture_s3tc.swift | 22 + .../WEBGL_compressed_texture_s3tc_srgb.swift | 22 + .../WebIDL/WEBGL_debug_renderer_info.swift | 18 + .../DOMKit/WebIDL/WEBGL_debug_shaders.swift | 18 + .../DOMKit/WebIDL/WEBGL_depth_texture.swift | 16 + .../DOMKit/WebIDL/WEBGL_draw_buffers.swift | 86 + ..._instanced_base_vertex_base_instance.swift | 29 + .../DOMKit/WebIDL/WEBGL_lose_context.swift | 22 + Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift | 60 + ..._instanced_base_vertex_base_instance.swift | 45 + Sources/DOMKit/WebIDL/WakeLock.swift | 24 + Sources/DOMKit/WebIDL/WakeLockSentinel.swift | 34 + Sources/DOMKit/WebIDL/WakeLockType.swift | 21 + .../WebIDL/WatchAdvertisementsOptions.swift | 20 + Sources/DOMKit/WebIDL/WaveShaperNode.swift | 24 + Sources/DOMKit/WebIDL/WaveShaperOptions.swift | 25 + Sources/DOMKit/WebIDL/WebAssembly.swift | 64 + .../WebAssemblyInstantiatedSource.swift | 25 + .../WebIDL/WebGL2RenderingContext.swift | 14 + .../WebIDL/WebGL2RenderingContextBase.swift | 1067 +++++ .../WebGL2RenderingContextOverloads.swift | 284 ++ Sources/DOMKit/WebIDL/WebGLActiveInfo.swift | 26 + Sources/DOMKit/WebIDL/WebGLBuffer.swift | 12 + .../WebIDL/WebGLContextAttributes.swift | 65 + 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/WebGLQuery.swift | 12 + Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift | 12 + .../DOMKit/WebIDL/WebGLRenderingContext.swift | 14 + .../WebIDL/WebGLRenderingContextBase.swift | 1109 +++++ .../WebGLRenderingContextOverloads.swift | 144 + Sources/DOMKit/WebIDL/WebGLSampler.swift | 12 + Sources/DOMKit/WebIDL/WebGLShader.swift | 12 + .../WebIDL/WebGLShaderPrecisionFormat.swift | 26 + Sources/DOMKit/WebIDL/WebGLSync.swift | 12 + Sources/DOMKit/WebIDL/WebGLTexture.swift | 12 + .../DOMKit/WebIDL/WebGLTimerQueryEXT.swift | 12 + .../WebIDL/WebGLTransformFeedback.swift | 12 + .../DOMKit/WebIDL/WebGLUniformLocation.swift | 14 + .../WebIDL/WebGLVertexArrayObject.swift | 12 + .../WebIDL/WebGLVertexArrayObjectOES.swift | 12 + Sources/DOMKit/WebIDL/WebSocket.swift | 72 + Sources/DOMKit/WebIDL/WebTransport.swift | 72 + .../WebTransportBidirectionalStream.swift | 22 + .../DOMKit/WebIDL/WebTransportCloseInfo.swift | 25 + .../WebTransportDatagramDuplexStream.swift | 42 + Sources/DOMKit/WebIDL/WebTransportError.swift | 24 + .../DOMKit/WebIDL/WebTransportErrorInit.swift | 25 + .../WebIDL/WebTransportErrorSource.swift | 22 + Sources/DOMKit/WebIDL/WebTransportHash.swift | 25 + .../DOMKit/WebIDL/WebTransportOptions.swift | 25 + Sources/DOMKit/WebIDL/WebTransportStats.swift | 75 + .../DOMKit/WebIDL/WellKnownDirectory.swift | 26 + Sources/DOMKit/WebIDL/WheelEvent.swift | 2 +- Sources/DOMKit/WebIDL/WheelEventInit.swift | 2 +- Sources/DOMKit/WebIDL/Window.swift | 218 +- Sources/DOMKit/WebIDL/WindowClient.swift | 44 + .../DOMKit/WebIDL/WindowControlsOverlay.swift | 24 + ...owControlsOverlayGeometryChangeEvent.swift | 24 + ...ntrolsOverlayGeometryChangeEventInit.swift | 25 + .../DOMKit/WebIDL/WindowEventHandlers.swift | 15 + .../WebIDL/WindowOrWorkerGlobalScope.swift | 30 +- .../WebIDL/WindowPostMessageOptions.swift | 2 +- Sources/DOMKit/WebIDL/Worker.swift | 2 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 4 +- Sources/DOMKit/WebIDL/WorkerLocation.swift | 2 +- Sources/DOMKit/WebIDL/WorkerNavigator.swift | 24 +- Sources/DOMKit/WebIDL/WorkerOptions.swift | 2 +- Sources/DOMKit/WebIDL/Worklet.swift | 2 +- Sources/DOMKit/WebIDL/WorkletAnimation.swift | 20 + .../WebIDL/WorkletAnimationEffect.swift | 26 + .../DOMKit/WebIDL/WorkletGlobalScope.swift | 2 +- .../DOMKit/WebIDL/WorkletGroupEffect.swift | 18 + Sources/DOMKit/WebIDL/WorkletOptions.swift | 2 +- Sources/DOMKit/WebIDL/WritableStream.swift | 2 +- .../WritableStreamDefaultController.swift | 2 +- .../WebIDL/WritableStreamDefaultWriter.swift | 2 +- Sources/DOMKit/WebIDL/WriteCommandType.swift | 23 + Sources/DOMKit/WebIDL/WriteParams.swift | 35 + Sources/DOMKit/WebIDL/XMLDocument.swift | 2 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 2 +- .../WebIDL/XMLHttpRequestEventTarget.swift | 2 +- .../DOMKit/WebIDL/XMLHttpRequestUpload.swift | 2 +- Sources/DOMKit/WebIDL/XMLSerializer.swift | 22 + Sources/DOMKit/WebIDL/XPathEvaluator.swift | 2 +- Sources/DOMKit/WebIDL/XPathExpression.swift | 2 +- Sources/DOMKit/WebIDL/XPathResult.swift | 2 +- Sources/DOMKit/WebIDL/XRAnchor.swift | 22 + Sources/DOMKit/WebIDL/XRAnchorSet.swift | 16 + .../WebIDL/XRBoundedReferenceSpace.swift | 16 + .../DOMKit/WebIDL/XRCPUDepthInformation.swift | 20 + .../DOMKit/WebIDL/XRCompositionLayer.swift | 36 + Sources/DOMKit/WebIDL/XRCubeLayer.swift | 24 + Sources/DOMKit/WebIDL/XRCubeLayerInit.swift | 20 + Sources/DOMKit/WebIDL/XRCylinderLayer.swift | 36 + .../DOMKit/WebIDL/XRCylinderLayerInit.swift | 40 + Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift | 20 + Sources/DOMKit/WebIDL/XRDOMOverlayState.swift | 20 + Sources/DOMKit/WebIDL/XRDOMOverlayType.swift | 23 + Sources/DOMKit/WebIDL/XRDepthDataFormat.swift | 22 + .../DOMKit/WebIDL/XRDepthInformation.swift | 30 + Sources/DOMKit/WebIDL/XRDepthStateInit.swift | 25 + Sources/DOMKit/WebIDL/XRDepthUsage.swift | 22 + .../WebIDL/XREnvironmentBlendMode.swift | 23 + Sources/DOMKit/WebIDL/XREquirectLayer.swift | 40 + .../DOMKit/WebIDL/XREquirectLayerInit.swift | 45 + Sources/DOMKit/WebIDL/XREye.swift | 23 + Sources/DOMKit/WebIDL/XRFrame.swift | 72 + Sources/DOMKit/WebIDL/XRHand.swift | 27 + Sources/DOMKit/WebIDL/XRHandJoint.swift | 45 + Sources/DOMKit/WebIDL/XRHandedness.swift | 23 + .../DOMKit/WebIDL/XRHitTestOptionsInit.swift | 30 + Sources/DOMKit/WebIDL/XRHitTestResult.swift | 28 + Sources/DOMKit/WebIDL/XRHitTestSource.swift | 18 + .../WebIDL/XRHitTestTrackableType.swift | 23 + Sources/DOMKit/WebIDL/XRInputSource.swift | 42 + .../DOMKit/WebIDL/XRInputSourceArray.swift | 27 + .../DOMKit/WebIDL/XRInputSourceEvent.swift | 24 + .../WebIDL/XRInputSourceEventInit.swift | 25 + .../WebIDL/XRInputSourcesChangeEvent.swift | 28 + .../XRInputSourcesChangeEventInit.swift | 30 + Sources/DOMKit/WebIDL/XRInteractionMode.swift | 22 + Sources/DOMKit/WebIDL/XRJointPose.swift | 16 + Sources/DOMKit/WebIDL/XRJointSpace.swift | 16 + Sources/DOMKit/WebIDL/XRLayer.swift | 12 + Sources/DOMKit/WebIDL/XRLayerEvent.swift | 20 + Sources/DOMKit/WebIDL/XRLayerEventInit.swift | 20 + Sources/DOMKit/WebIDL/XRLayerInit.swift | 55 + Sources/DOMKit/WebIDL/XRLayerLayout.swift | 25 + Sources/DOMKit/WebIDL/XRLightEstimate.swift | 26 + Sources/DOMKit/WebIDL/XRLightProbe.swift | 20 + Sources/DOMKit/WebIDL/XRLightProbeInit.swift | 20 + Sources/DOMKit/WebIDL/XRMediaBinding.swift | 30 + .../WebIDL/XRMediaCylinderLayerInit.swift | 35 + .../WebIDL/XRMediaEquirectLayerInit.swift | 40 + Sources/DOMKit/WebIDL/XRMediaLayerInit.swift | 30 + .../DOMKit/WebIDL/XRMediaQuadLayerInit.swift | 30 + .../WebIDL/XRPermissionDescriptor.swift | 30 + .../DOMKit/WebIDL/XRPermissionStatus.swift | 16 + Sources/DOMKit/WebIDL/XRPose.swift | 30 + Sources/DOMKit/WebIDL/XRProjectionLayer.swift | 32 + .../DOMKit/WebIDL/XRProjectionLayerInit.swift | 35 + Sources/DOMKit/WebIDL/XRQuadLayer.swift | 32 + Sources/DOMKit/WebIDL/XRQuadLayerInit.swift | 35 + Sources/DOMKit/WebIDL/XRRay.swift | 34 + .../DOMKit/WebIDL/XRRayDirectionInit.swift | 35 + Sources/DOMKit/WebIDL/XRReferenceSpace.swift | 20 + .../DOMKit/WebIDL/XRReferenceSpaceEvent.swift | 24 + .../WebIDL/XRReferenceSpaceEventInit.swift | 25 + .../DOMKit/WebIDL/XRReferenceSpaceType.swift | 25 + .../DOMKit/WebIDL/XRReflectionFormat.swift | 22 + Sources/DOMKit/WebIDL/XRRenderState.swift | 34 + Sources/DOMKit/WebIDL/XRRenderStateInit.swift | 40 + Sources/DOMKit/WebIDL/XRRigidTransform.swift | 34 + Sources/DOMKit/WebIDL/XRSession.swift | 168 + Sources/DOMKit/WebIDL/XRSessionEvent.swift | 20 + .../DOMKit/WebIDL/XRSessionEventInit.swift | 20 + Sources/DOMKit/WebIDL/XRSessionInit.swift | 35 + Sources/DOMKit/WebIDL/XRSessionMode.swift | 23 + ...SessionSupportedPermissionDescriptor.swift | 20 + Sources/DOMKit/WebIDL/XRSpace.swift | 12 + Sources/DOMKit/WebIDL/XRSubImage.swift | 18 + Sources/DOMKit/WebIDL/XRSystem.swift | 36 + Sources/DOMKit/WebIDL/XRTargetRayMode.swift | 23 + Sources/DOMKit/WebIDL/XRTextureType.swift | 22 + .../XRTransientInputHitTestOptionsInit.swift | 30 + .../XRTransientInputHitTestResult.swift | 22 + .../XRTransientInputHitTestSource.swift | 18 + Sources/DOMKit/WebIDL/XRView.swift | 38 + Sources/DOMKit/WebIDL/XRViewerPose.swift | 16 + Sources/DOMKit/WebIDL/XRViewport.swift | 30 + Sources/DOMKit/WebIDL/XRVisibilityState.swift | 23 + Sources/DOMKit/WebIDL/XRWebGLBinding.swift | 62 + .../WebIDL/XRWebGLDepthInformation.swift | 16 + Sources/DOMKit/WebIDL/XRWebGLLayer.swift | 48 + Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift | 45 + Sources/DOMKit/WebIDL/XRWebGLSubImage.swift | 32 + Sources/DOMKit/WebIDL/XSLTProcessor.swift | 2 +- Sources/DOMKit/WebIDL/console.swift | 40 +- Sources/WebIDLToSwift/IDLBuilder.swift | 5 +- .../WebIDL+SwiftRepresentation.swift | 45 +- 2022 files changed, 62178 insertions(+), 379 deletions(-) create mode 100644 Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift create mode 100644 Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift create mode 100644 Sources/DOMKit/WebIDL/Accelerometer.swift create mode 100644 Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift create mode 100644 Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/AesCbcParams.swift create mode 100644 Sources/DOMKit/WebIDL/AesCtrParams.swift create mode 100644 Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift create mode 100644 Sources/DOMKit/WebIDL/AesGcmParams.swift create mode 100644 Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift create mode 100644 Sources/DOMKit/WebIDL/AesKeyGenParams.swift create mode 100644 Sources/DOMKit/WebIDL/Algorithm.swift create mode 100644 Sources/DOMKit/WebIDL/AlignSetting.swift create mode 100644 Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift create mode 100644 Sources/DOMKit/WebIDL/AllowedUSBDevice.swift create mode 100644 Sources/DOMKit/WebIDL/AlphaOption.swift create mode 100644 Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/AmbientLightSensor.swift create mode 100644 Sources/DOMKit/WebIDL/AnalyserNode.swift create mode 100644 Sources/DOMKit/WebIDL/AnalyserOptions.swift create mode 100644 Sources/DOMKit/WebIDL/Animatable.swift create mode 100644 Sources/DOMKit/WebIDL/Animation.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationEffect.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationEvent.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationNodeList.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationPlayState.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationReplaceState.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationTimeline.swift create mode 100644 Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift create mode 100644 Sources/DOMKit/WebIDL/AppendMode.swift create mode 100644 Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift create mode 100644 Sources/DOMKit/WebIDL/AttributionReporting.swift create mode 100644 Sources/DOMKit/WebIDL/AttributionSourceParams.swift create mode 100644 Sources/DOMKit/WebIDL/AudioBuffer.swift create mode 100644 Sources/DOMKit/WebIDL/AudioBufferOptions.swift create mode 100644 Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift create mode 100644 Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift create mode 100644 Sources/DOMKit/WebIDL/AudioConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/AudioContext.swift create mode 100644 Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift create mode 100644 Sources/DOMKit/WebIDL/AudioContextOptions.swift create mode 100644 Sources/DOMKit/WebIDL/AudioContextState.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/AudioDestinationNode.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/AudioListener.swift create mode 100644 Sources/DOMKit/WebIDL/AudioNode.swift create mode 100644 Sources/DOMKit/WebIDL/AudioNodeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/AudioOutputOptions.swift create mode 100644 Sources/DOMKit/WebIDL/AudioParam.swift create mode 100644 Sources/DOMKit/WebIDL/AudioParamDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/AudioParamMap.swift create mode 100644 Sources/DOMKit/WebIDL/AudioProcessingEvent.swift create mode 100644 Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/AudioSampleFormat.swift create mode 100644 Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift create mode 100644 Sources/DOMKit/WebIDL/AudioTimestamp.swift create mode 100644 Sources/DOMKit/WebIDL/AudioWorklet.swift create mode 100644 Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/AudioWorkletNode.swift create mode 100644 Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticatorResponse.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift create mode 100644 Sources/DOMKit/WebIDL/AuthenticatorTransport.swift create mode 100644 Sources/DOMKit/WebIDL/AutoKeyword.swift create mode 100644 Sources/DOMKit/WebIDL/AutomationRate.swift create mode 100644 Sources/DOMKit/WebIDL/AutoplayPolicy.swift create mode 100644 Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchManager.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchResult.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift create mode 100644 Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift create mode 100644 Sources/DOMKit/WebIDL/BarcodeDetector.swift create mode 100644 Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/BarcodeFormat.swift create mode 100644 Sources/DOMKit/WebIDL/BaseAudioContext.swift create mode 100644 Sources/DOMKit/WebIDL/BaseComputedKeyframe.swift create mode 100644 Sources/DOMKit/WebIDL/BaseKeyframe.swift create mode 100644 Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift create mode 100644 Sources/DOMKit/WebIDL/Baseline.swift create mode 100644 Sources/DOMKit/WebIDL/BatteryManager.swift create mode 100644 Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift create mode 100644 Sources/DOMKit/WebIDL/BinaryType.swift create mode 100644 Sources/DOMKit/WebIDL/BiquadFilterNode.swift create mode 100644 Sources/DOMKit/WebIDL/BiquadFilterOptions.swift create mode 100644 Sources/DOMKit/WebIDL/BiquadFilterType.swift create mode 100644 Sources/DOMKit/WebIDL/BitrateMode.swift create mode 100644 Sources/DOMKit/WebIDL/BlobEvent.swift create mode 100644 Sources/DOMKit/WebIDL/BlobEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/BlockFragmentationType.swift create mode 100644 Sources/DOMKit/WebIDL/Bluetooth.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothDevice.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift create mode 100644 Sources/DOMKit/WebIDL/BluetoothUUID.swift create mode 100644 Sources/DOMKit/WebIDL/BoxQuadOptions.swift create mode 100644 Sources/DOMKit/WebIDL/BreakToken.swift create mode 100644 Sources/DOMKit/WebIDL/BreakTokenOptions.swift create mode 100644 Sources/DOMKit/WebIDL/BreakType.swift create mode 100644 Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift create mode 100644 Sources/DOMKit/WebIDL/CSPViolationReportBody.swift create mode 100644 Sources/DOMKit/WebIDL/CSSAnimation.swift create mode 100644 Sources/DOMKit/WebIDL/CSSBoxType.swift create mode 100644 Sources/DOMKit/WebIDL/CSSColor.swift create mode 100644 Sources/DOMKit/WebIDL/CSSColorValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSContainerRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSFontFaceRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift create mode 100644 Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSHSL.swift create mode 100644 Sources/DOMKit/WebIDL/CSSHWB.swift create mode 100644 Sources/DOMKit/WebIDL/CSSImageValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSKeyframeRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSKeyframesRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSKeywordValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSLCH.swift create mode 100644 Sources/DOMKit/WebIDL/CSSLab.swift create mode 100644 Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMathClamp.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMathInvert.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMathMax.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMathMin.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMathNegate.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMathOperator.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMathProduct.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMathSum.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMathValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMatrixComponent.swift create mode 100644 Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CSSNestingRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSNumericArray.swift create mode 100644 Sources/DOMKit/WebIDL/CSSNumericBaseType.swift create mode 100644 Sources/DOMKit/WebIDL/CSSNumericType.swift create mode 100644 Sources/DOMKit/WebIDL/CSSNumericValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSOKLCH.swift create mode 100644 Sources/DOMKit/WebIDL/CSSOKLab.swift create mode 100644 Sources/DOMKit/WebIDL/CSSParserAtRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSParserBlock.swift create mode 100644 Sources/DOMKit/WebIDL/CSSParserDeclaration.swift create mode 100644 Sources/DOMKit/WebIDL/CSSParserFunction.swift create mode 100644 Sources/DOMKit/WebIDL/CSSParserOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSParserRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSParserValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSPerspective.swift create mode 100644 Sources/DOMKit/WebIDL/CSSPropertyRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSPseudoElement.swift create mode 100644 Sources/DOMKit/WebIDL/CSSRGB.swift create mode 100644 Sources/DOMKit/WebIDL/CSSRotate.swift create mode 100644 Sources/DOMKit/WebIDL/CSSScale.swift create mode 100644 Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift create mode 100644 Sources/DOMKit/WebIDL/CSSSkew.swift create mode 100644 Sources/DOMKit/WebIDL/CSSSkewX.swift create mode 100644 Sources/DOMKit/WebIDL/CSSSkewY.swift create mode 100644 Sources/DOMKit/WebIDL/CSSStyleValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSTransformComponent.swift create mode 100644 Sources/DOMKit/WebIDL/CSSTransformValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSTransition.swift create mode 100644 Sources/DOMKit/WebIDL/CSSTranslate.swift create mode 100644 Sources/DOMKit/WebIDL/CSSUnitValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSUnparsedValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSViewportRule.swift create mode 100644 Sources/DOMKit/WebIDL/Cache.swift create mode 100644 Sources/DOMKit/WebIDL/CacheQueryOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CacheStorage.swift create mode 100644 Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift create mode 100644 Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift create mode 100644 Sources/DOMKit/WebIDL/CaretPosition.swift create mode 100644 Sources/DOMKit/WebIDL/ChannelCountMode.swift create mode 100644 Sources/DOMKit/WebIDL/ChannelInterpretation.swift create mode 100644 Sources/DOMKit/WebIDL/ChannelMergerNode.swift create mode 100644 Sources/DOMKit/WebIDL/ChannelMergerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ChannelSplitterNode.swift create mode 100644 Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift create mode 100644 Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift create mode 100644 Sources/DOMKit/WebIDL/ChildBreakToken.swift create mode 100644 Sources/DOMKit/WebIDL/ChildDisplayType.swift create mode 100644 Sources/DOMKit/WebIDL/Client.swift create mode 100644 Sources/DOMKit/WebIDL/ClientLifecycleState.swift create mode 100644 Sources/DOMKit/WebIDL/ClientQueryOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ClientType.swift create mode 100644 Sources/DOMKit/WebIDL/Clients.swift create mode 100644 Sources/DOMKit/WebIDL/Clipboard.swift create mode 100644 Sources/DOMKit/WebIDL/ClipboardEvent.swift create mode 100644 Sources/DOMKit/WebIDL/ClipboardEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/ClipboardItem.swift create mode 100644 Sources/DOMKit/WebIDL/ClipboardItemOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/CloseEvent.swift create mode 100644 Sources/DOMKit/WebIDL/CloseEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/CloseWatcher.swift create mode 100644 Sources/DOMKit/WebIDL/CloseWatcherOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CodecState.swift create mode 100644 Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift create mode 100644 Sources/DOMKit/WebIDL/CollectedClientData.swift create mode 100644 Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift create mode 100644 Sources/DOMKit/WebIDL/ColorGamut.swift create mode 100644 Sources/DOMKit/WebIDL/ColorSelectionOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ColorSelectionResult.swift create mode 100644 Sources/DOMKit/WebIDL/CompositeOperation.swift create mode 100644 Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift create mode 100644 Sources/DOMKit/WebIDL/CompressionStream.swift create mode 100644 Sources/DOMKit/WebIDL/ComputePressureFactor.swift create mode 100644 Sources/DOMKit/WebIDL/ComputePressureObserver.swift create mode 100644 Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ComputePressureRecord.swift create mode 100644 Sources/DOMKit/WebIDL/ComputePressureSource.swift create mode 100644 Sources/DOMKit/WebIDL/ComputePressureState.swift create mode 100644 Sources/DOMKit/WebIDL/ComputedEffectTiming.swift create mode 100644 Sources/DOMKit/WebIDL/ConnectionType.swift create mode 100644 Sources/DOMKit/WebIDL/ConstantSourceNode.swift create mode 100644 Sources/DOMKit/WebIDL/ConstantSourceOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift create mode 100644 Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift create mode 100644 Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift create mode 100644 Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift create mode 100644 Sources/DOMKit/WebIDL/ConstrainULongRange.swift create mode 100644 Sources/DOMKit/WebIDL/ContactAddress.swift create mode 100644 Sources/DOMKit/WebIDL/ContactInfo.swift create mode 100644 Sources/DOMKit/WebIDL/ContactProperty.swift create mode 100644 Sources/DOMKit/WebIDL/ContactsManager.swift create mode 100644 Sources/DOMKit/WebIDL/ContactsSelectOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ContentCategory.swift create mode 100644 Sources/DOMKit/WebIDL/ContentDescription.swift create mode 100644 Sources/DOMKit/WebIDL/ContentIndex.swift create mode 100644 Sources/DOMKit/WebIDL/ContentIndexEvent.swift create mode 100644 Sources/DOMKit/WebIDL/ContentIndexEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ConvolverNode.swift create mode 100644 Sources/DOMKit/WebIDL/ConvolverOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CookieChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/CookieChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/CookieInit.swift create mode 100644 Sources/DOMKit/WebIDL/CookieListItem.swift create mode 100644 Sources/DOMKit/WebIDL/CookieSameSite.swift create mode 100644 Sources/DOMKit/WebIDL/CookieStore.swift create mode 100644 Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CookieStoreManager.swift create mode 100644 Sources/DOMKit/WebIDL/CrashReportBody.swift create mode 100644 Sources/DOMKit/WebIDL/Credential.swift create mode 100644 Sources/DOMKit/WebIDL/CredentialCreationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CredentialData.swift create mode 100644 Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift create mode 100644 Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift create mode 100644 Sources/DOMKit/WebIDL/CredentialRequestOptions.swift create mode 100644 Sources/DOMKit/WebIDL/CredentialUserData.swift create mode 100644 Sources/DOMKit/WebIDL/CredentialsContainer.swift create mode 100644 Sources/DOMKit/WebIDL/CropTarget.swift create mode 100644 Sources/DOMKit/WebIDL/Crypto.swift create mode 100644 Sources/DOMKit/WebIDL/CryptoKey.swift create mode 100644 Sources/DOMKit/WebIDL/CryptoKeyPair.swift create mode 100644 Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift create mode 100644 Sources/DOMKit/WebIDL/CustomStateSet.swift create mode 100644 Sources/DOMKit/WebIDL/DataCue.swift create mode 100644 Sources/DOMKit/WebIDL/DecompressionStream.swift create mode 100644 Sources/DOMKit/WebIDL/DelayNode.swift create mode 100644 Sources/DOMKit/WebIDL/DelayOptions.swift create mode 100644 Sources/DOMKit/WebIDL/DeprecationReportBody.swift create mode 100644 Sources/DOMKit/WebIDL/DetectedBarcode.swift create mode 100644 Sources/DOMKit/WebIDL/DetectedFace.swift create mode 100644 Sources/DOMKit/WebIDL/DetectedText.swift create mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift create mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift create mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift create mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift create mode 100644 Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift create mode 100644 Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/DevicePosture.swift create mode 100644 Sources/DOMKit/WebIDL/DevicePostureType.swift create mode 100644 Sources/DOMKit/WebIDL/DigitalGoodsService.swift create mode 100644 Sources/DOMKit/WebIDL/DirectionSetting.swift create mode 100644 Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift create mode 100644 Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift create mode 100644 Sources/DOMKit/WebIDL/DistanceModelType.swift create mode 100644 Sources/DOMKit/WebIDL/DocumentTimeline.swift create mode 100644 Sources/DOMKit/WebIDL/DocumentTimelineOptions.swift create mode 100644 Sources/DOMKit/WebIDL/DoubleRange.swift create mode 100644 Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift create mode 100644 Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_blend_minmax.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_float_blend.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_frag_depth.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_sRGB.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift create mode 100644 Sources/DOMKit/WebIDL/EXT_texture_norm16.swift create mode 100644 Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift create mode 100644 Sources/DOMKit/WebIDL/EcKeyGenParams.swift create mode 100644 Sources/DOMKit/WebIDL/EcKeyImportParams.swift create mode 100644 Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift create mode 100644 Sources/DOMKit/WebIDL/EcdsaParams.swift create mode 100644 Sources/DOMKit/WebIDL/Edge.swift create mode 100644 Sources/DOMKit/WebIDL/EditContext.swift create mode 100644 Sources/DOMKit/WebIDL/EditContextInit.swift create mode 100644 Sources/DOMKit/WebIDL/EffectTiming.swift create mode 100644 Sources/DOMKit/WebIDL/EffectiveConnectionType.swift create mode 100644 Sources/DOMKit/WebIDL/ElementBasedOffset.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/EndOfStreamError.swift create mode 100644 Sources/DOMKit/WebIDL/EventCounts.swift create mode 100644 Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/ExtendableEvent.swift create mode 100644 Sources/DOMKit/WebIDL/ExtendableEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift create mode 100644 Sources/DOMKit/WebIDL/ExtendableMessageEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/EyeDropper.swift create mode 100644 Sources/DOMKit/WebIDL/FaceDetector.swift create mode 100644 Sources/DOMKit/WebIDL/FaceDetectorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/FederatedCredential.swift create mode 100644 Sources/DOMKit/WebIDL/FederatedCredentialInit.swift create mode 100644 Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift create mode 100644 Sources/DOMKit/WebIDL/FetchEvent.swift create mode 100644 Sources/DOMKit/WebIDL/FetchEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/FetchPriority.swift create mode 100644 Sources/DOMKit/WebIDL/FilePickerAcceptType.swift create mode 100644 Sources/DOMKit/WebIDL/FilePickerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystem.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemEntry.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemFileEntry.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemFileHandle.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemFlags.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemHandle.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemHandleKind.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift create mode 100644 Sources/DOMKit/WebIDL/FillLightMode.swift create mode 100644 Sources/DOMKit/WebIDL/FillMode.swift create mode 100644 Sources/DOMKit/WebIDL/FlowControlType.swift create mode 100644 Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift create mode 100644 Sources/DOMKit/WebIDL/FocusableAreasOption.swift create mode 100644 Sources/DOMKit/WebIDL/Font.swift create mode 100644 Sources/DOMKit/WebIDL/FontFace.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceDescriptors.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceFeatures.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift create mode 100644 Sources/DOMKit/WebIDL/FontFacePalette.swift create mode 100644 Sources/DOMKit/WebIDL/FontFacePalettes.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceSet.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceSource.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift create mode 100644 Sources/DOMKit/WebIDL/FontFaceVariations.swift create mode 100644 Sources/DOMKit/WebIDL/FontManager.swift create mode 100644 Sources/DOMKit/WebIDL/FontMetadata.swift create mode 100644 Sources/DOMKit/WebIDL/FontMetrics.swift create mode 100644 Sources/DOMKit/WebIDL/FragmentDirective.swift create mode 100644 Sources/DOMKit/WebIDL/FragmentResult.swift create mode 100644 Sources/DOMKit/WebIDL/FragmentResultOptions.swift create mode 100644 Sources/DOMKit/WebIDL/FrameType.swift create mode 100644 Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift create mode 100644 Sources/DOMKit/WebIDL/FullscreenOptions.swift create mode 100644 Sources/DOMKit/WebIDL/GPU.swift create mode 100644 Sources/DOMKit/WebIDL/GPUAdapter.swift create mode 100644 Sources/DOMKit/WebIDL/GPUAddressMode.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBindGroup.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBlendComponent.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBlendFactor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBlendOperation.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBlendState.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBuffer.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBufferBinding.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBufferBindingType.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBufferUsage.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCanvasContext.swift create mode 100644 Sources/DOMKit/WebIDL/GPUColorDict.swift create mode 100644 Sources/DOMKit/WebIDL/GPUColorTargetState.swift create mode 100644 Sources/DOMKit/WebIDL/GPUColorWrite.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCommandBuffer.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCommandBufferDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCommandEncoder.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCommandEncoderDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCommandsMixin.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCompareFunction.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCompilationInfo.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCompilationMessage.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift create mode 100644 Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift create mode 100644 Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift create mode 100644 Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift create mode 100644 Sources/DOMKit/WebIDL/GPUComputePipeline.swift create mode 100644 Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCullMode.swift create mode 100644 Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift create mode 100644 Sources/DOMKit/WebIDL/GPUDepthStencilState.swift create mode 100644 Sources/DOMKit/WebIDL/GPUDevice.swift create mode 100644 Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift create mode 100644 Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift create mode 100644 Sources/DOMKit/WebIDL/GPUErrorFilter.swift create mode 100644 Sources/DOMKit/WebIDL/GPUExtent3DDict.swift create mode 100644 Sources/DOMKit/WebIDL/GPUExternalTexture.swift create mode 100644 Sources/DOMKit/WebIDL/GPUExternalTextureBindingLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUFeatureName.swift create mode 100644 Sources/DOMKit/WebIDL/GPUFilterMode.swift create mode 100644 Sources/DOMKit/WebIDL/GPUFragmentState.swift create mode 100644 Sources/DOMKit/WebIDL/GPUFrontFace.swift create mode 100644 Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift create mode 100644 Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift create mode 100644 Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift create mode 100644 Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift create mode 100644 Sources/DOMKit/WebIDL/GPUImageDataLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPUIndexFormat.swift create mode 100644 Sources/DOMKit/WebIDL/GPULoadOp.swift create mode 100644 Sources/DOMKit/WebIDL/GPUMapMode.swift create mode 100644 Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift create mode 100644 Sources/DOMKit/WebIDL/GPUMultisampleState.swift create mode 100644 Sources/DOMKit/WebIDL/GPUObjectBase.swift create mode 100644 Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift create mode 100644 Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift create mode 100644 Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift create mode 100644 Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift create mode 100644 Sources/DOMKit/WebIDL/GPUPipelineBase.swift create mode 100644 Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift create mode 100644 Sources/DOMKit/WebIDL/GPUPipelineLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUPowerPreference.swift create mode 100644 Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift create mode 100644 Sources/DOMKit/WebIDL/GPUPrimitiveState.swift create mode 100644 Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift create mode 100644 Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift create mode 100644 Sources/DOMKit/WebIDL/GPUProgrammableStage.swift create mode 100644 Sources/DOMKit/WebIDL/GPUQuerySet.swift create mode 100644 Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUQueryType.swift create mode 100644 Sources/DOMKit/WebIDL/GPUQueue.swift create mode 100644 Sources/DOMKit/WebIDL/GPUQueueDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderBundle.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderBundleDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderPassLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderPipeline.swift create mode 100644 Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift create mode 100644 Sources/DOMKit/WebIDL/GPUSampler.swift create mode 100644 Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift create mode 100644 Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUShaderModule.swift create mode 100644 Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift create mode 100644 Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUShaderStage.swift create mode 100644 Sources/DOMKit/WebIDL/GPUStencilFaceState.swift create mode 100644 Sources/DOMKit/WebIDL/GPUStencilOperation.swift create mode 100644 Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift create mode 100644 Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPUStoreOp.swift create mode 100644 Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift create mode 100644 Sources/DOMKit/WebIDL/GPUSupportedLimits.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTexture.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureAspect.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureDimension.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureFormat.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureSampleType.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureUsage.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureView.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift create mode 100644 Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift create mode 100644 Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/GPUValidationError.swift create mode 100644 Sources/DOMKit/WebIDL/GPUVertexAttribute.swift create mode 100644 Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift create mode 100644 Sources/DOMKit/WebIDL/GPUVertexFormat.swift create mode 100644 Sources/DOMKit/WebIDL/GPUVertexState.swift create mode 100644 Sources/DOMKit/WebIDL/GPUVertexStepMode.swift create mode 100644 Sources/DOMKit/WebIDL/GainNode.swift create mode 100644 Sources/DOMKit/WebIDL/GainOptions.swift create mode 100644 Sources/DOMKit/WebIDL/Gamepad.swift create mode 100644 Sources/DOMKit/WebIDL/GamepadButton.swift create mode 100644 Sources/DOMKit/WebIDL/GamepadEvent.swift create mode 100644 Sources/DOMKit/WebIDL/GamepadEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/GamepadHand.swift create mode 100644 Sources/DOMKit/WebIDL/GamepadHapticActuator.swift create mode 100644 Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift create mode 100644 Sources/DOMKit/WebIDL/GamepadMappingType.swift create mode 100644 Sources/DOMKit/WebIDL/GamepadPose.swift create mode 100644 Sources/DOMKit/WebIDL/GamepadTouch.swift create mode 100644 Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift create mode 100644 Sources/DOMKit/WebIDL/Geolocation.swift create mode 100644 Sources/DOMKit/WebIDL/GeolocationCoordinates.swift create mode 100644 Sources/DOMKit/WebIDL/GeolocationPosition.swift create mode 100644 Sources/DOMKit/WebIDL/GeolocationPositionError.swift create mode 100644 Sources/DOMKit/WebIDL/GeolocationReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/GeolocationSensor.swift create mode 100644 Sources/DOMKit/WebIDL/GeolocationSensorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/GeolocationSensorReading.swift create mode 100644 Sources/DOMKit/WebIDL/GeometryUtils.swift create mode 100644 Sources/DOMKit/WebIDL/GetAnimationsOptions.swift create mode 100644 Sources/DOMKit/WebIDL/GetNotificationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/GetSVGDocument.swift create mode 100644 Sources/DOMKit/WebIDL/Global.swift create mode 100644 Sources/DOMKit/WebIDL/GlobalDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/GravityReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/GravitySensor.swift create mode 100644 Sources/DOMKit/WebIDL/GroupEffect.swift create mode 100644 Sources/DOMKit/WebIDL/Gyroscope.swift create mode 100644 Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift create mode 100644 Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/HID.swift create mode 100644 Sources/DOMKit/WebIDL/HIDCollectionInfo.swift create mode 100644 Sources/DOMKit/WebIDL/HIDConnectionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/HIDDevice.swift create mode 100644 Sources/DOMKit/WebIDL/HIDDeviceFilter.swift create mode 100644 Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift create mode 100644 Sources/DOMKit/WebIDL/HIDInputReportEvent.swift create mode 100644 Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/HIDReportInfo.swift create mode 100644 Sources/DOMKit/WebIDL/HIDReportItem.swift create mode 100644 Sources/DOMKit/WebIDL/HIDUnitSystem.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLPortalElement.swift create mode 100644 Sources/DOMKit/WebIDL/HardwareAcceleration.swift create mode 100644 Sources/DOMKit/WebIDL/HdrMetadataType.swift create mode 100644 Sources/DOMKit/WebIDL/Highlight.swift create mode 100644 Sources/DOMKit/WebIDL/HighlightRegistry.swift create mode 100644 Sources/DOMKit/WebIDL/HighlightType.swift create mode 100644 Sources/DOMKit/WebIDL/HkdfParams.swift create mode 100644 Sources/DOMKit/WebIDL/HmacImportParams.swift create mode 100644 Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift create mode 100644 Sources/DOMKit/WebIDL/HmacKeyGenParams.swift create mode 100644 Sources/DOMKit/WebIDL/IDBCursor.swift create mode 100644 Sources/DOMKit/WebIDL/IDBCursorDirection.swift create mode 100644 Sources/DOMKit/WebIDL/IDBCursorWithValue.swift create mode 100644 Sources/DOMKit/WebIDL/IDBDatabase.swift create mode 100644 Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift create mode 100644 Sources/DOMKit/WebIDL/IDBFactory.swift create mode 100644 Sources/DOMKit/WebIDL/IDBIndex.swift create mode 100644 Sources/DOMKit/WebIDL/IDBIndexParameters.swift create mode 100644 Sources/DOMKit/WebIDL/IDBKeyRange.swift create mode 100644 Sources/DOMKit/WebIDL/IDBObjectStore.swift create mode 100644 Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift create mode 100644 Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift create mode 100644 Sources/DOMKit/WebIDL/IDBRequest.swift create mode 100644 Sources/DOMKit/WebIDL/IDBRequestReadyState.swift create mode 100644 Sources/DOMKit/WebIDL/IDBTransaction.swift create mode 100644 Sources/DOMKit/WebIDL/IDBTransactionDurability.swift create mode 100644 Sources/DOMKit/WebIDL/IDBTransactionMode.swift create mode 100644 Sources/DOMKit/WebIDL/IDBTransactionOptions.swift create mode 100644 Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/IIRFilterNode.swift create mode 100644 Sources/DOMKit/WebIDL/IIRFilterOptions.swift create mode 100644 Sources/DOMKit/WebIDL/IdleDeadline.swift create mode 100644 Sources/DOMKit/WebIDL/IdleDetector.swift create mode 100644 Sources/DOMKit/WebIDL/IdleOptions.swift create mode 100644 Sources/DOMKit/WebIDL/IdleRequestOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ImageCapture.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/ImageObject.swift create mode 100644 Sources/DOMKit/WebIDL/ImageResource.swift create mode 100644 Sources/DOMKit/WebIDL/ImageTrack.swift create mode 100644 Sources/DOMKit/WebIDL/ImageTrackList.swift create mode 100644 Sources/DOMKit/WebIDL/ImportExportKind.swift create mode 100644 Sources/DOMKit/WebIDL/Ink.swift create mode 100644 Sources/DOMKit/WebIDL/InkPresenter.swift create mode 100644 Sources/DOMKit/WebIDL/InkPresenterParam.swift create mode 100644 Sources/DOMKit/WebIDL/InkTrailStyle.swift create mode 100644 Sources/DOMKit/WebIDL/InnerHTML.swift create mode 100644 Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift create mode 100644 Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift create mode 100644 Sources/DOMKit/WebIDL/InputDeviceInfo.swift create mode 100644 Sources/DOMKit/WebIDL/Instance.swift create mode 100644 Sources/DOMKit/WebIDL/InteractionCounts.swift create mode 100644 Sources/DOMKit/WebIDL/IntersectionObserver.swift create mode 100644 Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift create mode 100644 Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift create mode 100644 Sources/DOMKit/WebIDL/IntersectionObserverInit.swift create mode 100644 Sources/DOMKit/WebIDL/InterventionReportBody.swift create mode 100644 Sources/DOMKit/WebIDL/IntrinsicSizes.swift create mode 100644 Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift create mode 100644 Sources/DOMKit/WebIDL/IsInputPendingOptions.swift create mode 100644 Sources/DOMKit/WebIDL/IsVisibleOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ItemDetails.swift create mode 100644 Sources/DOMKit/WebIDL/ItemType.swift create mode 100644 Sources/DOMKit/WebIDL/IterationCompositeOperation.swift create mode 100644 Sources/DOMKit/WebIDL/JsonWebKey.swift create mode 100644 Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift create mode 100644 Sources/DOMKit/WebIDL/KeyAlgorithm.swift create mode 100644 Sources/DOMKit/WebIDL/KeyFormat.swift create mode 100644 Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/KeyType.swift create mode 100644 Sources/DOMKit/WebIDL/KeyUsage.swift create mode 100644 Sources/DOMKit/WebIDL/Keyboard.swift create mode 100644 Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift create mode 100644 Sources/DOMKit/WebIDL/KeyframeAnimationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/KeyframeEffect.swift create mode 100644 Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift create mode 100644 Sources/DOMKit/WebIDL/Landmark.swift create mode 100644 Sources/DOMKit/WebIDL/LandmarkType.swift create mode 100644 Sources/DOMKit/WebIDL/LargeBlobSupport.swift create mode 100644 Sources/DOMKit/WebIDL/LargestContentfulPaint.swift create mode 100644 Sources/DOMKit/WebIDL/LatencyMode.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutChild.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutConstraints.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutEdges.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutFragment.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutOptions.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutShift.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutSizingMode.swift create mode 100644 Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/LineAlignSetting.swift create mode 100644 Sources/DOMKit/WebIDL/LinearAccelerationReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift create mode 100644 Sources/DOMKit/WebIDL/Lock.swift create mode 100644 Sources/DOMKit/WebIDL/LockInfo.swift create mode 100644 Sources/DOMKit/WebIDL/LockManager.swift create mode 100644 Sources/DOMKit/WebIDL/LockManagerSnapshot.swift create mode 100644 Sources/DOMKit/WebIDL/LockMode.swift create mode 100644 Sources/DOMKit/WebIDL/LockOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIAccess.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIInput.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIInputMap.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIMessageEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIOutput.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIOutputMap.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIPort.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift create mode 100644 Sources/DOMKit/WebIDL/MIDIPortType.swift create mode 100644 Sources/DOMKit/WebIDL/ML.swift create mode 100644 Sources/DOMKit/WebIDL/MLAutoPad.swift create mode 100644 Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLBufferResourceView.swift create mode 100644 Sources/DOMKit/WebIDL/MLClampOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLContext.swift create mode 100644 Sources/DOMKit/WebIDL/MLContextOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift create mode 100644 Sources/DOMKit/WebIDL/MLConv2dOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift create mode 100644 Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLDevicePreference.swift create mode 100644 Sources/DOMKit/WebIDL/MLEluOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLGemmOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLGraph.swift create mode 100644 Sources/DOMKit/WebIDL/MLGraphBuilder.swift create mode 100644 Sources/DOMKit/WebIDL/MLGruCellOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLGruOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLInput.swift create mode 100644 Sources/DOMKit/WebIDL/MLInputOperandLayout.swift create mode 100644 Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLInterpolationMode.swift create mode 100644 Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLLinearOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLOperand.swift create mode 100644 Sources/DOMKit/WebIDL/MLOperandDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/MLOperandType.swift create mode 100644 Sources/DOMKit/WebIDL/MLOperator.swift create mode 100644 Sources/DOMKit/WebIDL/MLPadOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLPaddingMode.swift create mode 100644 Sources/DOMKit/WebIDL/MLPool2dOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLPowerPreference.swift create mode 100644 Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift create mode 100644 Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift create mode 100644 Sources/DOMKit/WebIDL/MLReduceOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLResample2dOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLRoundingType.swift create mode 100644 Sources/DOMKit/WebIDL/MLSliceOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLSoftplusOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLSplitOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLSqueezeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MLTransposeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/Magnetometer.swift create mode 100644 Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift create mode 100644 Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MathMLElement.swift create mode 100644 Sources/DOMKit/WebIDL/MediaCapabilities.swift create mode 100644 Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift create mode 100644 Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift create mode 100644 Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift create mode 100644 Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MediaConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MediaDecodingType.swift create mode 100644 Sources/DOMKit/WebIDL/MediaDeviceInfo.swift create mode 100644 Sources/DOMKit/WebIDL/MediaDeviceKind.swift create mode 100644 Sources/DOMKit/WebIDL/MediaDevices.swift create mode 100644 Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift create mode 100644 Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MediaEncodingType.swift create mode 100644 Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/MediaImage.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeyMessageType.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeySession.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeySessionType.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeyStatus.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeys.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeysRequirement.swift create mode 100644 Sources/DOMKit/WebIDL/MediaMetadata.swift create mode 100644 Sources/DOMKit/WebIDL/MediaMetadataInit.swift create mode 100644 Sources/DOMKit/WebIDL/MediaPositionState.swift create mode 100644 Sources/DOMKit/WebIDL/MediaQueryList.swift create mode 100644 Sources/DOMKit/WebIDL/MediaQueryListEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/MediaRecorder.swift create mode 100644 Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/MediaRecorderOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MediaSession.swift create mode 100644 Sources/DOMKit/WebIDL/MediaSessionAction.swift create mode 100644 Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift create mode 100644 Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift create mode 100644 Sources/DOMKit/WebIDL/MediaSettingsRange.swift create mode 100644 Sources/DOMKit/WebIDL/MediaSource.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStream.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamConstraints.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrack.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackState.swift create mode 100644 Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift create mode 100644 Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift create mode 100644 Sources/DOMKit/WebIDL/MediaTrackConstraints.swift create mode 100644 Sources/DOMKit/WebIDL/MediaTrackSettings.swift create mode 100644 Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift create mode 100644 Sources/DOMKit/WebIDL/Memory.swift create mode 100644 Sources/DOMKit/WebIDL/MemoryAttribution.swift create mode 100644 Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift create mode 100644 Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift create mode 100644 Sources/DOMKit/WebIDL/MemoryDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/MemoryMeasurement.swift create mode 100644 Sources/DOMKit/WebIDL/MeteringMode.swift create mode 100644 Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/MockCameraConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MockCapturePromptResult.swift create mode 100644 Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MockSensor.swift create mode 100644 Sources/DOMKit/WebIDL/MockSensorConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/MockSensorReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/MockSensorType.swift create mode 100644 Sources/DOMKit/WebIDL/Module.swift create mode 100644 Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/MultiCacheQueryOptions.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFMessage.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFMessageInit.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFReader.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFReadingEvent.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFRecord.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFRecordInit.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFScanOptions.swift create mode 100644 Sources/DOMKit/WebIDL/NDEFWriteOptions.swift create mode 100644 Sources/DOMKit/WebIDL/NamedFlow.swift create mode 100644 Sources/DOMKit/WebIDL/NamedFlowMap.swift create mode 100644 Sources/DOMKit/WebIDL/NavigateEvent.swift create mode 100644 Sources/DOMKit/WebIDL/NavigateEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/Navigation.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationDestination.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationEvent.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationNavigationType.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationPreloadManager.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationPreloadState.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationReloadOptions.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationResult.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationTimingType.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationTransition.swift create mode 100644 Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorBadge.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorFonts.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorGPU.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorLocks.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorML.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorStorage.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorUA.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift create mode 100644 Sources/DOMKit/WebIDL/NavigatorUAData.swift create mode 100644 Sources/DOMKit/WebIDL/NetworkInformation.swift create mode 100644 Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift create mode 100644 Sources/DOMKit/WebIDL/Notification.swift create mode 100644 Sources/DOMKit/WebIDL/NotificationAction.swift create mode 100644 Sources/DOMKit/WebIDL/NotificationDirection.swift create mode 100644 Sources/DOMKit/WebIDL/NotificationEvent.swift create mode 100644 Sources/DOMKit/WebIDL/NotificationEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/NotificationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/NotificationPermission.swift create mode 100644 Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift create mode 100644 Sources/DOMKit/WebIDL/OES_element_index_uint.swift create mode 100644 Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift create mode 100644 Sources/DOMKit/WebIDL/OES_standard_derivatives.swift create mode 100644 Sources/DOMKit/WebIDL/OES_texture_float.swift create mode 100644 Sources/DOMKit/WebIDL/OES_texture_float_linear.swift create mode 100644 Sources/DOMKit/WebIDL/OES_texture_half_float.swift create mode 100644 Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift create mode 100644 Sources/DOMKit/WebIDL/OES_vertex_array_object.swift create mode 100644 Sources/DOMKit/WebIDL/OTPCredential.swift create mode 100644 Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift create mode 100644 Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift create mode 100644 Sources/DOMKit/WebIDL/OVR_multiview2.swift create mode 100644 Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/OfflineAudioContext.swift create mode 100644 Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift create mode 100644 Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/OptionalEffectTiming.swift create mode 100644 Sources/DOMKit/WebIDL/OrientationLockType.swift create mode 100644 Sources/DOMKit/WebIDL/OrientationSensor.swift create mode 100644 Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift create mode 100644 Sources/DOMKit/WebIDL/OrientationSensorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/OrientationType.swift create mode 100644 Sources/DOMKit/WebIDL/OscillatorNode.swift create mode 100644 Sources/DOMKit/WebIDL/OscillatorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/OscillatorType.swift create mode 100644 Sources/DOMKit/WebIDL/OverSampleType.swift create mode 100644 Sources/DOMKit/WebIDL/OverconstrainedError.swift create mode 100644 Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift create mode 100644 Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift create mode 100644 Sources/DOMKit/WebIDL/PaintSize.swift create mode 100644 Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/PannerNode.swift create mode 100644 Sources/DOMKit/WebIDL/PannerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/PanningModelType.swift create mode 100644 Sources/DOMKit/WebIDL/ParityType.swift create mode 100644 Sources/DOMKit/WebIDL/PasswordCredential.swift create mode 100644 Sources/DOMKit/WebIDL/PasswordCredentialData.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentComplete.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentDetailsBase.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentDetailsInit.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentInstrument.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentInstruments.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentItem.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentManager.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentMethodData.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentRequest.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentRequestEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentRequestUpdateEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentResponse.swift create mode 100644 Sources/DOMKit/WebIDL/PaymentValidationErrors.swift create mode 100644 Sources/DOMKit/WebIDL/Pbkdf2Params.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceElementTiming.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceEntry.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceEventTiming.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceMark.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceMeasure.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceNavigation.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceObserver.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceObserverInit.swift create mode 100644 Sources/DOMKit/WebIDL/PerformancePaintTiming.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceServerTiming.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceTiming.swift create mode 100644 Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PeriodicSyncManager.swift create mode 100644 Sources/DOMKit/WebIDL/PeriodicWave.swift create mode 100644 Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift create mode 100644 Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift create mode 100644 Sources/DOMKit/WebIDL/PermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/PermissionSetParameters.swift create mode 100644 Sources/DOMKit/WebIDL/PermissionState.swift create mode 100644 Sources/DOMKit/WebIDL/PermissionStatus.swift create mode 100644 Sources/DOMKit/WebIDL/Permissions.swift create mode 100644 Sources/DOMKit/WebIDL/PermissionsPolicy.swift create mode 100644 Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift create mode 100644 Sources/DOMKit/WebIDL/PhotoCapabilities.swift create mode 100644 Sources/DOMKit/WebIDL/PhotoSettings.swift create mode 100644 Sources/DOMKit/WebIDL/PictureInPictureEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PictureInPictureWindow.swift create mode 100644 Sources/DOMKit/WebIDL/PlaneLayout.swift create mode 100644 Sources/DOMKit/WebIDL/PlaybackDirection.swift create mode 100644 Sources/DOMKit/WebIDL/Point2D.swift create mode 100644 Sources/DOMKit/WebIDL/PointerEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PointerEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PortalActivateEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PortalActivateEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PortalActivateOptions.swift create mode 100644 Sources/DOMKit/WebIDL/PortalHost.swift create mode 100644 Sources/DOMKit/WebIDL/PositionAlignSetting.swift create mode 100644 Sources/DOMKit/WebIDL/PositionOptions.swift create mode 100644 Sources/DOMKit/WebIDL/Presentation.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationAvailability.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationConnection.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionList.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionState.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationReceiver.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationRequest.swift create mode 100644 Sources/DOMKit/WebIDL/PresentationStyle.swift create mode 100644 Sources/DOMKit/WebIDL/Profiler.swift create mode 100644 Sources/DOMKit/WebIDL/ProfilerFrame.swift create mode 100644 Sources/DOMKit/WebIDL/ProfilerInitOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ProfilerSample.swift create mode 100644 Sources/DOMKit/WebIDL/ProfilerStack.swift create mode 100644 Sources/DOMKit/WebIDL/ProfilerTrace.swift create mode 100644 Sources/DOMKit/WebIDL/PromptResponseObject.swift create mode 100644 Sources/DOMKit/WebIDL/PropertyDefinition.swift create mode 100644 Sources/DOMKit/WebIDL/ProximityReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/ProximitySensor.swift create mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredential.swift create mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift create mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift create mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift create mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift create mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift create mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift create mode 100644 Sources/DOMKit/WebIDL/PurchaseDetails.swift create mode 100644 Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift create mode 100644 Sources/DOMKit/WebIDL/PushEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PushEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PushManager.swift create mode 100644 Sources/DOMKit/WebIDL/PushMessageData.swift create mode 100644 Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/PushSubscription.swift create mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift create mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift create mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift create mode 100644 Sources/DOMKit/WebIDL/QueryOptions.swift create mode 100644 Sources/DOMKit/WebIDL/RTCAnswerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/RTCAudioHandlerStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCAudioReceiverStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCBundlePolicy.swift create mode 100644 Sources/DOMKit/WebIDL/RTCCertificate.swift create mode 100644 Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift create mode 100644 Sources/DOMKit/WebIDL/RTCCertificateStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCCodecStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCCodecType.swift create mode 100644 Sources/DOMKit/WebIDL/RTCConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDTMFSender.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDataChannel.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDegradationPreference.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDtlsTransport.swift create mode 100644 Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift create mode 100644 Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift create mode 100644 Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift create mode 100644 Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift create mode 100644 Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift create mode 100644 Sources/DOMKit/WebIDL/RTCError.swift create mode 100644 Sources/DOMKit/WebIDL/RTCErrorDetailType.swift create mode 100644 Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift create mode 100644 Sources/DOMKit/WebIDL/RTCErrorEvent.swift create mode 100644 Sources/DOMKit/WebIDL/RTCErrorEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCErrorInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidate.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidateType.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceComponent.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceConnectionState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceCredentialType.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceGathererState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceGatheringState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceProtocol.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceRole.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceServer.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceServerStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceTransport.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIceTransportState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProvider.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift create mode 100644 Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift create mode 100644 Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCInsertableStreams.swift create mode 100644 Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCOfferAnswerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/RTCOfferOptions.swift create mode 100644 Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnection.swift create mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift create mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift create mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCPriorityType.swift create mode 100644 Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift create mode 100644 Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtcpParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpDecodingParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpReceiveParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpReceiver.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpSender.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpSynchronizationSource.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCSctpTransport.swift create mode 100644 Sources/DOMKit/WebIDL/RTCSctpTransportState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCSdpType.swift create mode 100644 Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCSessionDescription.swift create mode 100644 Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCSignalingState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift create mode 100644 Sources/DOMKit/WebIDL/RTCStatsReport.swift create mode 100644 Sources/DOMKit/WebIDL/RTCStatsType.swift create mode 100644 Sources/DOMKit/WebIDL/RTCTrackEvent.swift create mode 100644 Sources/DOMKit/WebIDL/RTCTrackEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/RTCTransformEvent.swift create mode 100644 Sources/DOMKit/WebIDL/RTCTransportStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCVideoHandlerStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCVideoReceiverStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift create mode 100644 Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift create mode 100644 Sources/DOMKit/WebIDL/ReadOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ReadyState.swift create mode 100644 Sources/DOMKit/WebIDL/RecordingState.swift create mode 100644 Sources/DOMKit/WebIDL/RedEyeReduction.swift create mode 100644 Sources/DOMKit/WebIDL/Region.swift create mode 100644 Sources/DOMKit/WebIDL/RegistrationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/RelatedApplication.swift create mode 100644 Sources/DOMKit/WebIDL/RelativeOrientationReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift create mode 100644 Sources/DOMKit/WebIDL/RemotePlayback.swift create mode 100644 Sources/DOMKit/WebIDL/RemotePlaybackState.swift create mode 100644 Sources/DOMKit/WebIDL/Report.swift create mode 100644 Sources/DOMKit/WebIDL/ReportBody.swift create mode 100644 Sources/DOMKit/WebIDL/ReportingObserver.swift create mode 100644 Sources/DOMKit/WebIDL/ReportingObserverOptions.swift create mode 100644 Sources/DOMKit/WebIDL/RequestDeviceOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift create mode 100644 Sources/DOMKit/WebIDL/ResizeObserver.swift create mode 100644 Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ResizeObserverEntry.swift create mode 100644 Sources/DOMKit/WebIDL/ResizeObserverOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ResizeObserverSize.swift create mode 100644 Sources/DOMKit/WebIDL/RsaHashedImportParams.swift create mode 100644 Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift create mode 100644 Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift create mode 100644 Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift create mode 100644 Sources/DOMKit/WebIDL/RsaKeyGenParams.swift create mode 100644 Sources/DOMKit/WebIDL/RsaOaepParams.swift create mode 100644 Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift create mode 100644 Sources/DOMKit/WebIDL/RsaPssParams.swift create mode 100644 Sources/DOMKit/WebIDL/SFrameTransform.swift create mode 100644 Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift create mode 100644 Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift create mode 100644 Sources/DOMKit/WebIDL/SFrameTransformOptions.swift create mode 100644 Sources/DOMKit/WebIDL/SFrameTransformRole.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAngle.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimateElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedLength.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedRect.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedString.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift create mode 100644 Sources/DOMKit/WebIDL/SVGAnimationElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift create mode 100644 Sources/DOMKit/WebIDL/SVGCircleElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGClipPathElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGDefsElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGDescElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGDiscardElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGElementInstance.swift create mode 100644 Sources/DOMKit/WebIDL/SVGEllipseElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEBlendElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFECompositeElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEFloodElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEImageElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEMergeElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFETileElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFilterElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift create mode 100644 Sources/DOMKit/WebIDL/SVGFitToViewBox.swift create mode 100644 Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGGElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGGeometryElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGGradientElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGGraphicsElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGImageElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGLength.swift create mode 100644 Sources/DOMKit/WebIDL/SVGLengthList.swift create mode 100644 Sources/DOMKit/WebIDL/SVGLineElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGMPathElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGMarkerElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGMaskElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGMetadataElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGNumber.swift create mode 100644 Sources/DOMKit/WebIDL/SVGNumberList.swift create mode 100644 Sources/DOMKit/WebIDL/SVGPathElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGPatternElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGPointList.swift create mode 100644 Sources/DOMKit/WebIDL/SVGPolygonElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGPolylineElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift create mode 100644 Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGRectElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGSVGElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGScriptElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGSetElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGStopElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGStringList.swift create mode 100644 Sources/DOMKit/WebIDL/SVGStyleElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGSwitchElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGSymbolElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGTSpanElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGTests.swift create mode 100644 Sources/DOMKit/WebIDL/SVGTextContentElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGTextElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGTextPathElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGTitleElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGTransform.swift create mode 100644 Sources/DOMKit/WebIDL/SVGTransformList.swift create mode 100644 Sources/DOMKit/WebIDL/SVGURIReference.swift create mode 100644 Sources/DOMKit/WebIDL/SVGUnitTypes.swift create mode 100644 Sources/DOMKit/WebIDL/SVGUseElement.swift create mode 100644 Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift create mode 100644 Sources/DOMKit/WebIDL/SVGViewElement.swift create mode 100644 Sources/DOMKit/WebIDL/Sanitizer.swift create mode 100644 Sources/DOMKit/WebIDL/SanitizerConfig.swift create mode 100644 Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/Scheduler.swift create mode 100644 Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift create mode 100644 Sources/DOMKit/WebIDL/Scheduling.swift create mode 100644 Sources/DOMKit/WebIDL/Screen.swift create mode 100644 Sources/DOMKit/WebIDL/ScreenIdleState.swift create mode 100644 Sources/DOMKit/WebIDL/ScreenOrientation.swift create mode 100644 Sources/DOMKit/WebIDL/ScriptProcessorNode.swift create mode 100644 Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift create mode 100644 Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollBehavior.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollDirection.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollSetting.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollTimeline.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ScrollToOptions.swift create mode 100644 Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift create mode 100644 Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift create mode 100644 Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift create mode 100644 Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/Selection.swift create mode 100644 Sources/DOMKit/WebIDL/Sensor.swift create mode 100644 Sources/DOMKit/WebIDL/SensorErrorEvent.swift create mode 100644 Sources/DOMKit/WebIDL/SensorErrorEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/SensorOptions.swift create mode 100644 Sources/DOMKit/WebIDL/SequenceEffect.swift create mode 100644 Sources/DOMKit/WebIDL/Serial.swift create mode 100644 Sources/DOMKit/WebIDL/SerialInputSignals.swift create mode 100644 Sources/DOMKit/WebIDL/SerialOptions.swift create mode 100644 Sources/DOMKit/WebIDL/SerialOutputSignals.swift create mode 100644 Sources/DOMKit/WebIDL/SerialPort.swift create mode 100644 Sources/DOMKit/WebIDL/SerialPortFilter.swift create mode 100644 Sources/DOMKit/WebIDL/SerialPortInfo.swift create mode 100644 Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ServiceEventHandlers.swift create mode 100644 Sources/DOMKit/WebIDL/ServiceWorker.swift create mode 100644 Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift create mode 100644 Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift create mode 100644 Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift create mode 100644 Sources/DOMKit/WebIDL/ServiceWorkerState.swift create mode 100644 Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift create mode 100644 Sources/DOMKit/WebIDL/SetHTMLOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ShadowAnimation.swift create mode 100644 Sources/DOMKit/WebIDL/ShareData.swift create mode 100644 Sources/DOMKit/WebIDL/SourceBuffer.swift create mode 100644 Sources/DOMKit/WebIDL/SourceBufferList.swift create mode 100644 Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift create mode 100644 Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechGrammar.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechGrammarList.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechRecognition.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesis.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift create mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift create mode 100644 Sources/DOMKit/WebIDL/StereoPannerNode.swift create mode 100644 Sources/DOMKit/WebIDL/StereoPannerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/StorageEstimate.swift create mode 100644 Sources/DOMKit/WebIDL/StorageManager.swift create mode 100644 Sources/DOMKit/WebIDL/StylePropertyMap.swift create mode 100644 Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift create mode 100644 Sources/DOMKit/WebIDL/SubtleCrypto.swift create mode 100644 Sources/DOMKit/WebIDL/SvcOutputMetadata.swift create mode 100644 Sources/DOMKit/WebIDL/SyncEvent.swift create mode 100644 Sources/DOMKit/WebIDL/SyncEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/SyncManager.swift create mode 100644 Sources/DOMKit/WebIDL/Table.swift create mode 100644 Sources/DOMKit/WebIDL/TableDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/TableKind.swift create mode 100644 Sources/DOMKit/WebIDL/TaskAttributionTiming.swift create mode 100644 Sources/DOMKit/WebIDL/TaskController.swift create mode 100644 Sources/DOMKit/WebIDL/TaskControllerInit.swift create mode 100644 Sources/DOMKit/WebIDL/TaskPriority.swift create mode 100644 Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/TaskSignal.swift create mode 100644 Sources/DOMKit/WebIDL/TestUtils.swift create mode 100644 Sources/DOMKit/WebIDL/TextDecodeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/TextDecoder.swift create mode 100644 Sources/DOMKit/WebIDL/TextDecoderCommon.swift create mode 100644 Sources/DOMKit/WebIDL/TextDecoderOptions.swift create mode 100644 Sources/DOMKit/WebIDL/TextDecoderStream.swift create mode 100644 Sources/DOMKit/WebIDL/TextDetector.swift create mode 100644 Sources/DOMKit/WebIDL/TextEncoder.swift create mode 100644 Sources/DOMKit/WebIDL/TextEncoderCommon.swift create mode 100644 Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift create mode 100644 Sources/DOMKit/WebIDL/TextEncoderStream.swift create mode 100644 Sources/DOMKit/WebIDL/TextFormat.swift create mode 100644 Sources/DOMKit/WebIDL/TextFormatInit.swift create mode 100644 Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift create mode 100644 Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/TextUpdateEvent.swift create mode 100644 Sources/DOMKit/WebIDL/TextUpdateEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/TimeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/TimelinePhase.swift create mode 100644 Sources/DOMKit/WebIDL/TokenBinding.swift create mode 100644 Sources/DOMKit/WebIDL/TokenBindingStatus.swift create mode 100644 Sources/DOMKit/WebIDL/Touch.swift create mode 100644 Sources/DOMKit/WebIDL/TouchEvent.swift create mode 100644 Sources/DOMKit/WebIDL/TouchEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/TouchInit.swift create mode 100644 Sources/DOMKit/WebIDL/TouchList.swift create mode 100644 Sources/DOMKit/WebIDL/TouchType.swift create mode 100644 Sources/DOMKit/WebIDL/TransactionAutomationMode.swift create mode 100644 Sources/DOMKit/WebIDL/TransferFunction.swift create mode 100644 Sources/DOMKit/WebIDL/TransitionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/TransitionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/TrustedHTML.swift create mode 100644 Sources/DOMKit/WebIDL/TrustedScript.swift create mode 100644 Sources/DOMKit/WebIDL/TrustedScriptURL.swift create mode 100644 Sources/DOMKit/WebIDL/TrustedTypePolicy.swift create mode 100644 Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift create mode 100644 Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift create mode 100644 Sources/DOMKit/WebIDL/UADataValues.swift create mode 100644 Sources/DOMKit/WebIDL/UALowEntropyJSON.swift create mode 100644 Sources/DOMKit/WebIDL/ULongRange.swift create mode 100644 Sources/DOMKit/WebIDL/URLPattern.swift create mode 100644 Sources/DOMKit/WebIDL/URLPatternComponentResult.swift create mode 100644 Sources/DOMKit/WebIDL/URLPatternInit.swift create mode 100644 Sources/DOMKit/WebIDL/URLPatternResult.swift create mode 100644 Sources/DOMKit/WebIDL/URLSearchParams.swift create mode 100644 Sources/DOMKit/WebIDL/USB.swift create mode 100644 Sources/DOMKit/WebIDL/USBAlternateInterface.swift create mode 100644 Sources/DOMKit/WebIDL/USBConfiguration.swift create mode 100644 Sources/DOMKit/WebIDL/USBConnectionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/USBConnectionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/USBControlTransferParameters.swift create mode 100644 Sources/DOMKit/WebIDL/USBDevice.swift create mode 100644 Sources/DOMKit/WebIDL/USBDeviceFilter.swift create mode 100644 Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift create mode 100644 Sources/DOMKit/WebIDL/USBDirection.swift create mode 100644 Sources/DOMKit/WebIDL/USBEndpoint.swift create mode 100644 Sources/DOMKit/WebIDL/USBEndpointType.swift create mode 100644 Sources/DOMKit/WebIDL/USBInTransferResult.swift create mode 100644 Sources/DOMKit/WebIDL/USBInterface.swift create mode 100644 Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift create mode 100644 Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift create mode 100644 Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift create mode 100644 Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift create mode 100644 Sources/DOMKit/WebIDL/USBOutTransferResult.swift create mode 100644 Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/USBPermissionResult.swift create mode 100644 Sources/DOMKit/WebIDL/USBPermissionStorage.swift create mode 100644 Sources/DOMKit/WebIDL/USBRecipient.swift create mode 100644 Sources/DOMKit/WebIDL/USBRequestType.swift create mode 100644 Sources/DOMKit/WebIDL/USBTransferStatus.swift create mode 100644 Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift create mode 100644 Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift create mode 100644 Sources/DOMKit/WebIDL/UserIdleState.swift create mode 100644 Sources/DOMKit/WebIDL/UserVerificationRequirement.swift create mode 100644 Sources/DOMKit/WebIDL/VTTCue.swift create mode 100644 Sources/DOMKit/WebIDL/VTTRegion.swift create mode 100644 Sources/DOMKit/WebIDL/ValueEvent.swift create mode 100644 Sources/DOMKit/WebIDL/ValueEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/ValueType.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/VideoConfiguration.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/VideoFacingModeEnum.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/VideoFrameMetadata.swift create mode 100644 Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift create mode 100644 Sources/DOMKit/WebIDL/VideoPixelFormat.swift create mode 100644 Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift create mode 100644 Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift create mode 100644 Sources/DOMKit/WebIDL/VideoTrackGenerator.swift create mode 100644 Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift create mode 100644 Sources/DOMKit/WebIDL/VirtualKeyboard.swift create mode 100644 Sources/DOMKit/WebIDL/VisualViewport.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_lose_context.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift create mode 100644 Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift create mode 100644 Sources/DOMKit/WebIDL/WakeLock.swift create mode 100644 Sources/DOMKit/WebIDL/WakeLockSentinel.swift create mode 100644 Sources/DOMKit/WebIDL/WakeLockType.swift create mode 100644 Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift create mode 100644 Sources/DOMKit/WebIDL/WaveShaperNode.swift create mode 100644 Sources/DOMKit/WebIDL/WaveShaperOptions.swift create mode 100644 Sources/DOMKit/WebIDL/WebAssembly.swift create mode 100644 Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift create mode 100644 Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift create mode 100644 Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift create mode 100644 Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.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/WebGLQuery.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/WebGLSampler.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLShader.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLSync.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLTexture.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLTimerQueryEXT.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLUniformLocation.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift create mode 100644 Sources/DOMKit/WebIDL/WebSocket.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransport.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransportError.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransportErrorInit.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransportErrorSource.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransportHash.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransportOptions.swift create mode 100644 Sources/DOMKit/WebIDL/WebTransportStats.swift create mode 100644 Sources/DOMKit/WebIDL/WellKnownDirectory.swift create mode 100644 Sources/DOMKit/WebIDL/WindowClient.swift create mode 100644 Sources/DOMKit/WebIDL/WindowControlsOverlay.swift create mode 100644 Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/WorkletAnimation.swift create mode 100644 Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift create mode 100644 Sources/DOMKit/WebIDL/WorkletGroupEffect.swift create mode 100644 Sources/DOMKit/WebIDL/WriteCommandType.swift create mode 100644 Sources/DOMKit/WebIDL/WriteParams.swift create mode 100644 Sources/DOMKit/WebIDL/XMLSerializer.swift create mode 100644 Sources/DOMKit/WebIDL/XRAnchor.swift create mode 100644 Sources/DOMKit/WebIDL/XRAnchorSet.swift create mode 100644 Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift create mode 100644 Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift create mode 100644 Sources/DOMKit/WebIDL/XRCompositionLayer.swift create mode 100644 Sources/DOMKit/WebIDL/XRCubeLayer.swift create mode 100644 Sources/DOMKit/WebIDL/XRCubeLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRCylinderLayer.swift create mode 100644 Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRDOMOverlayState.swift create mode 100644 Sources/DOMKit/WebIDL/XRDOMOverlayType.swift create mode 100644 Sources/DOMKit/WebIDL/XRDepthDataFormat.swift create mode 100644 Sources/DOMKit/WebIDL/XRDepthInformation.swift create mode 100644 Sources/DOMKit/WebIDL/XRDepthStateInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRDepthUsage.swift create mode 100644 Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift create mode 100644 Sources/DOMKit/WebIDL/XREquirectLayer.swift create mode 100644 Sources/DOMKit/WebIDL/XREquirectLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XREye.swift create mode 100644 Sources/DOMKit/WebIDL/XRFrame.swift create mode 100644 Sources/DOMKit/WebIDL/XRHand.swift create mode 100644 Sources/DOMKit/WebIDL/XRHandJoint.swift create mode 100644 Sources/DOMKit/WebIDL/XRHandedness.swift create mode 100644 Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRHitTestResult.swift create mode 100644 Sources/DOMKit/WebIDL/XRHitTestSource.swift create mode 100644 Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift create mode 100644 Sources/DOMKit/WebIDL/XRInputSource.swift create mode 100644 Sources/DOMKit/WebIDL/XRInputSourceArray.swift create mode 100644 Sources/DOMKit/WebIDL/XRInputSourceEvent.swift create mode 100644 Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift create mode 100644 Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRInteractionMode.swift create mode 100644 Sources/DOMKit/WebIDL/XRJointPose.swift create mode 100644 Sources/DOMKit/WebIDL/XRJointSpace.swift create mode 100644 Sources/DOMKit/WebIDL/XRLayer.swift create mode 100644 Sources/DOMKit/WebIDL/XRLayerEvent.swift create mode 100644 Sources/DOMKit/WebIDL/XRLayerEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRLayerLayout.swift create mode 100644 Sources/DOMKit/WebIDL/XRLightEstimate.swift create mode 100644 Sources/DOMKit/WebIDL/XRLightProbe.swift create mode 100644 Sources/DOMKit/WebIDL/XRLightProbeInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRMediaBinding.swift create mode 100644 Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRMediaLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/XRPermissionStatus.swift create mode 100644 Sources/DOMKit/WebIDL/XRPose.swift create mode 100644 Sources/DOMKit/WebIDL/XRProjectionLayer.swift create mode 100644 Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRQuadLayer.swift create mode 100644 Sources/DOMKit/WebIDL/XRQuadLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRRay.swift create mode 100644 Sources/DOMKit/WebIDL/XRRayDirectionInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRReferenceSpace.swift create mode 100644 Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift create mode 100644 Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift create mode 100644 Sources/DOMKit/WebIDL/XRReflectionFormat.swift create mode 100644 Sources/DOMKit/WebIDL/XRRenderState.swift create mode 100644 Sources/DOMKit/WebIDL/XRRenderStateInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRRigidTransform.swift create mode 100644 Sources/DOMKit/WebIDL/XRSession.swift create mode 100644 Sources/DOMKit/WebIDL/XRSessionEvent.swift create mode 100644 Sources/DOMKit/WebIDL/XRSessionEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRSessionInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRSessionMode.swift create mode 100644 Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift create mode 100644 Sources/DOMKit/WebIDL/XRSpace.swift create mode 100644 Sources/DOMKit/WebIDL/XRSubImage.swift create mode 100644 Sources/DOMKit/WebIDL/XRSystem.swift create mode 100644 Sources/DOMKit/WebIDL/XRTargetRayMode.swift create mode 100644 Sources/DOMKit/WebIDL/XRTextureType.swift create mode 100644 Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift create mode 100644 Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift create mode 100644 Sources/DOMKit/WebIDL/XRView.swift create mode 100644 Sources/DOMKit/WebIDL/XRViewerPose.swift create mode 100644 Sources/DOMKit/WebIDL/XRViewport.swift create mode 100644 Sources/DOMKit/WebIDL/XRVisibilityState.swift create mode 100644 Sources/DOMKit/WebIDL/XRWebGLBinding.swift create mode 100644 Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift create mode 100644 Sources/DOMKit/WebIDL/XRWebGLLayer.swift create mode 100644 Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift create mode 100644 Sources/DOMKit/WebIDL/XRWebGLSubImage.swift diff --git a/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift b/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift new file mode 100644 index 00000000..50992b5e --- /dev/null +++ b/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ANGLE_instanced_arrays: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ANGLE_instanced_arrays].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum = 0x88FE + + public func drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) { + _ = jsObject[Strings.drawArraysInstancedANGLE]!(mode.jsValue(), first.jsValue(), count.jsValue(), primcount.jsValue()) + } + + public func drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei) { + _ = jsObject[Strings.drawElementsInstancedANGLE]!(mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), primcount.jsValue()) + } + + public func vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint) { + _ = jsObject[Strings.vertexAttribDivisorANGLE]!(index.jsValue(), divisor.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index 2b88abc2..7850a5a2 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AbortController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.AbortController.function! } + public class var constructor: JSFunction { JSObject.global[Strings.AbortController].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index e9a4cacb..50d0e34f 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AbortSignal: EventTarget { - override public class var constructor: JSFunction { JSObject.global.AbortSignal.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.AbortSignal].function! } public required init(unsafelyWrapping jsObject: JSObject) { _aborted = ReadonlyAttribute(jsObject: jsObject, name: Strings.aborted) diff --git a/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift b/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift new file mode 100644 index 00000000..08588d42 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AbsoluteOrientationReadingValues: BridgedDictionary { + public convenience init(quaternion: [Double]?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.quaternion] = quaternion.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _quaternion = ReadWriteAttribute(jsObject: object, name: Strings.quaternion) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var quaternion: [Double]? +} diff --git a/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift b/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift new file mode 100644 index 00000000..aa0fd95a --- /dev/null +++ b/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AbsoluteOrientationSensor: OrientationSensor { + override public class var constructor: JSFunction { JSObject.global[Strings.AbsoluteOrientationSensor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(sensorOptions: OrientationSensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/AbstractRange.swift b/Sources/DOMKit/WebIDL/AbstractRange.swift index a815fa0e..945317c3 100644 --- a/Sources/DOMKit/WebIDL/AbstractRange.swift +++ b/Sources/DOMKit/WebIDL/AbstractRange.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AbstractRange: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.AbstractRange.function! } + public class var constructor: JSFunction { JSObject.global[Strings.AbstractRange].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/Accelerometer.swift b/Sources/DOMKit/WebIDL/Accelerometer.swift new file mode 100644 index 00000000..279d9a56 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Accelerometer.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Accelerometer: Sensor { + override public class var constructor: JSFunction { JSObject.global[Strings.Accelerometer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: AccelerometerSensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var x: Double? + + @ReadonlyAttribute + public var y: Double? + + @ReadonlyAttribute + public var z: Double? +} diff --git a/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift new file mode 100644 index 00000000..932f7420 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AccelerometerLocalCoordinateSystem: JSString, JSValueCompatible { + case device = "device" + case screen = "screen" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift b/Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift new file mode 100644 index 00000000..8829034d --- /dev/null +++ b/Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AccelerometerReadingValues: BridgedDictionary { + public convenience init(x: Double?, y: Double?, z: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.z] = z.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _z = ReadWriteAttribute(jsObject: object, name: Strings.z) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var x: Double? + + @ReadWriteAttribute + public var y: Double? + + @ReadWriteAttribute + public var z: Double? +} diff --git a/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift b/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift new file mode 100644 index 00000000..e20c62d8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AccelerometerSensorOptions: BridgedDictionary { + public convenience init(referenceFrame: AccelerometerLocalCoordinateSystem) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.referenceFrame] = referenceFrame.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _referenceFrame = ReadWriteAttribute(jsObject: object, name: Strings.referenceFrame) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var referenceFrame: AccelerometerLocalCoordinateSystem +} diff --git a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift index 76dc7d65..177f0f59 100644 --- a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class AddEventListenerOptions: BridgedDictionary { public convenience init(passive: Bool, once: Bool, signal: AbortSignal) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.passive] = passive.jsValue() object[Strings.once] = once.jsValue() object[Strings.signal] = signal.jsValue() diff --git a/Sources/DOMKit/WebIDL/AesCbcParams.swift b/Sources/DOMKit/WebIDL/AesCbcParams.swift new file mode 100644 index 00000000..d83b9c57 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AesCbcParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AesCbcParams: BridgedDictionary { + public convenience init(iv: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.iv] = iv.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _iv = ReadWriteAttribute(jsObject: object, name: Strings.iv) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var iv: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/AesCtrParams.swift b/Sources/DOMKit/WebIDL/AesCtrParams.swift new file mode 100644 index 00000000..22e37710 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AesCtrParams.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AesCtrParams: BridgedDictionary { + public convenience init(counter: BufferSource, length: UInt8) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.counter] = counter.jsValue() + object[Strings.length] = length.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _counter = ReadWriteAttribute(jsObject: object, name: Strings.counter) + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var counter: BufferSource + + @ReadWriteAttribute + public var length: UInt8 +} diff --git a/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift b/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift new file mode 100644 index 00000000..b7c3c507 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AesDerivedKeyParams: BridgedDictionary { + public convenience init(length: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.length] = length.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var length: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/AesGcmParams.swift b/Sources/DOMKit/WebIDL/AesGcmParams.swift new file mode 100644 index 00000000..0f7edad9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AesGcmParams.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AesGcmParams: BridgedDictionary { + public convenience init(iv: BufferSource, additionalData: BufferSource, tagLength: UInt8) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.iv] = iv.jsValue() + object[Strings.additionalData] = additionalData.jsValue() + object[Strings.tagLength] = tagLength.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _iv = ReadWriteAttribute(jsObject: object, name: Strings.iv) + _additionalData = ReadWriteAttribute(jsObject: object, name: Strings.additionalData) + _tagLength = ReadWriteAttribute(jsObject: object, name: Strings.tagLength) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var iv: BufferSource + + @ReadWriteAttribute + public var additionalData: BufferSource + + @ReadWriteAttribute + public var tagLength: UInt8 +} diff --git a/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift new file mode 100644 index 00000000..8564bbe8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AesKeyAlgorithm: BridgedDictionary { + public convenience init(length: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.length] = length.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var length: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/AesKeyGenParams.swift b/Sources/DOMKit/WebIDL/AesKeyGenParams.swift new file mode 100644 index 00000000..3d774ae7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AesKeyGenParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AesKeyGenParams: BridgedDictionary { + public convenience init(length: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.length] = length.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var length: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/Algorithm.swift b/Sources/DOMKit/WebIDL/Algorithm.swift new file mode 100644 index 00000000..e7f95196 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Algorithm.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Algorithm: BridgedDictionary { + public convenience init(name: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/AlignSetting.swift b/Sources/DOMKit/WebIDL/AlignSetting.swift new file mode 100644 index 00000000..8b8ff979 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AlignSetting.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AlignSetting: JSString, JSValueCompatible { + case start = "start" + case center = "center" + case end = "end" + case left = "left" + case right = "right" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift b/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift new file mode 100644 index 00000000..6b9d863a --- /dev/null +++ b/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AllowedBluetoothDevice: BridgedDictionary { + public convenience init(deviceId: String, mayUseGATT: Bool, allowedServices: __UNSUPPORTED_UNION__, allowedManufacturerData: [UInt16]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.deviceId] = deviceId.jsValue() + object[Strings.mayUseGATT] = mayUseGATT.jsValue() + object[Strings.allowedServices] = allowedServices.jsValue() + object[Strings.allowedManufacturerData] = allowedManufacturerData.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) + _mayUseGATT = ReadWriteAttribute(jsObject: object, name: Strings.mayUseGATT) + _allowedServices = ReadWriteAttribute(jsObject: object, name: Strings.allowedServices) + _allowedManufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.allowedManufacturerData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var deviceId: String + + @ReadWriteAttribute + public var mayUseGATT: Bool + + @ReadWriteAttribute + public var allowedServices: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var allowedManufacturerData: [UInt16] +} diff --git a/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift b/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift new file mode 100644 index 00000000..9675f41d --- /dev/null +++ b/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AllowedUSBDevice: BridgedDictionary { + public convenience init(vendorId: UInt8, productId: UInt8, serialNumber: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.vendorId] = vendorId.jsValue() + object[Strings.productId] = productId.jsValue() + object[Strings.serialNumber] = serialNumber.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _vendorId = ReadWriteAttribute(jsObject: object, name: Strings.vendorId) + _productId = ReadWriteAttribute(jsObject: object, name: Strings.productId) + _serialNumber = ReadWriteAttribute(jsObject: object, name: Strings.serialNumber) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var vendorId: UInt8 + + @ReadWriteAttribute + public var productId: UInt8 + + @ReadWriteAttribute + public var serialNumber: String +} diff --git a/Sources/DOMKit/WebIDL/AlphaOption.swift b/Sources/DOMKit/WebIDL/AlphaOption.swift new file mode 100644 index 00000000..474e80dd --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift b/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift new file mode 100644 index 00000000..009b8f7e --- /dev/null +++ b/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AmbientLightReadingValues: BridgedDictionary { + public convenience init(illuminance: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.illuminance] = illuminance.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _illuminance = ReadWriteAttribute(jsObject: object, name: Strings.illuminance) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var illuminance: Double? +} diff --git a/Sources/DOMKit/WebIDL/AmbientLightSensor.swift b/Sources/DOMKit/WebIDL/AmbientLightSensor.swift new file mode 100644 index 00000000..09ded714 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AmbientLightSensor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AmbientLightSensor: Sensor { + override public class var constructor: JSFunction { JSObject.global[Strings.AmbientLightSensor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _illuminance = ReadonlyAttribute(jsObject: jsObject, name: Strings.illuminance) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(sensorOptions: SensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var illuminance: Double? +} diff --git a/Sources/DOMKit/WebIDL/AnalyserNode.swift b/Sources/DOMKit/WebIDL/AnalyserNode.swift new file mode 100644 index 00000000..bf1cc757 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnalyserNode.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnalyserNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.AnalyserNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _fftSize = ReadWriteAttribute(jsObject: jsObject, name: Strings.fftSize) + _frequencyBinCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.frequencyBinCount) + _minDecibels = ReadWriteAttribute(jsObject: jsObject, name: Strings.minDecibels) + _maxDecibels = ReadWriteAttribute(jsObject: jsObject, name: Strings.maxDecibels) + _smoothingTimeConstant = ReadWriteAttribute(jsObject: jsObject, name: Strings.smoothingTimeConstant) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: AnalyserOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + public func getFloatFrequencyData(array: Float32Array) { + _ = jsObject[Strings.getFloatFrequencyData]!(array.jsValue()) + } + + public func getByteFrequencyData(array: Uint8Array) { + _ = jsObject[Strings.getByteFrequencyData]!(array.jsValue()) + } + + public func getFloatTimeDomainData(array: Float32Array) { + _ = jsObject[Strings.getFloatTimeDomainData]!(array.jsValue()) + } + + public func getByteTimeDomainData(array: Uint8Array) { + _ = jsObject[Strings.getByteTimeDomainData]!(array.jsValue()) + } + + @ReadWriteAttribute + public var fftSize: UInt32 + + @ReadonlyAttribute + public var frequencyBinCount: UInt32 + + @ReadWriteAttribute + public var minDecibels: Double + + @ReadWriteAttribute + public var maxDecibels: Double + + @ReadWriteAttribute + public var smoothingTimeConstant: Double +} diff --git a/Sources/DOMKit/WebIDL/AnalyserOptions.swift b/Sources/DOMKit/WebIDL/AnalyserOptions.swift new file mode 100644 index 00000000..b47ebce6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnalyserOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnalyserOptions: BridgedDictionary { + public convenience init(fftSize: UInt32, maxDecibels: Double, minDecibels: Double, smoothingTimeConstant: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.fftSize] = fftSize.jsValue() + object[Strings.maxDecibels] = maxDecibels.jsValue() + object[Strings.minDecibels] = minDecibels.jsValue() + object[Strings.smoothingTimeConstant] = smoothingTimeConstant.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _fftSize = ReadWriteAttribute(jsObject: object, name: Strings.fftSize) + _maxDecibels = ReadWriteAttribute(jsObject: object, name: Strings.maxDecibels) + _minDecibels = ReadWriteAttribute(jsObject: object, name: Strings.minDecibels) + _smoothingTimeConstant = ReadWriteAttribute(jsObject: object, name: Strings.smoothingTimeConstant) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var fftSize: UInt32 + + @ReadWriteAttribute + public var maxDecibels: Double + + @ReadWriteAttribute + public var minDecibels: Double + + @ReadWriteAttribute + public var smoothingTimeConstant: Double +} diff --git a/Sources/DOMKit/WebIDL/Animatable.swift b/Sources/DOMKit/WebIDL/Animatable.swift new file mode 100644 index 00000000..aecfdb4e --- /dev/null +++ b/Sources/DOMKit/WebIDL/Animatable.swift @@ -0,0 +1,15 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Animatable: JSBridgedClass {} +public extension Animatable { + func animate(keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) -> Animation { + jsObject[Strings.animate]!(keyframes.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + func getAnimations(options: GetAnimationsOptions? = nil) -> [Animation] { + jsObject[Strings.getAnimations]!(options?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/Animation.swift b/Sources/DOMKit/WebIDL/Animation.swift new file mode 100644 index 00000000..de6e4e1c --- /dev/null +++ b/Sources/DOMKit/WebIDL/Animation.swift @@ -0,0 +1,104 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Animation: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.Animation].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _startTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.startTime) + _currentTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentTime) + _id = ReadWriteAttribute(jsObject: jsObject, name: Strings.id) + _effect = ReadWriteAttribute(jsObject: jsObject, name: Strings.effect) + _timeline = ReadWriteAttribute(jsObject: jsObject, name: Strings.timeline) + _playbackRate = ReadWriteAttribute(jsObject: jsObject, name: Strings.playbackRate) + _playState = ReadonlyAttribute(jsObject: jsObject, name: Strings.playState) + _replaceState = ReadonlyAttribute(jsObject: jsObject, name: Strings.replaceState) + _pending = ReadonlyAttribute(jsObject: jsObject, name: Strings.pending) + _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) + _finished = ReadonlyAttribute(jsObject: jsObject, name: Strings.finished) + _onfinish = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfinish) + _oncancel = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncancel) + _onremove = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremove) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var startTime: CSSNumberish? + + @ReadWriteAttribute + public var currentTime: CSSNumberish? + + public convenience init(effect: AnimationEffect? = nil, timeline: AnimationTimeline? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(effect?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var effect: AnimationEffect? + + @ReadWriteAttribute + public var timeline: AnimationTimeline? + + @ReadWriteAttribute + public var playbackRate: Double + + @ReadonlyAttribute + public var playState: AnimationPlayState + + @ReadonlyAttribute + public var replaceState: AnimationReplaceState + + @ReadonlyAttribute + public var pending: Bool + + @ReadonlyAttribute + public var ready: JSPromise + + @ReadonlyAttribute + public var finished: JSPromise + + @ClosureAttribute.Optional1 + public var onfinish: EventHandler + + @ClosureAttribute.Optional1 + public var oncancel: EventHandler + + @ClosureAttribute.Optional1 + public var onremove: EventHandler + + public func cancel() { + _ = jsObject[Strings.cancel]!() + } + + public func finish() { + _ = jsObject[Strings.finish]!() + } + + public func play() { + _ = jsObject[Strings.play]!() + } + + public func pause() { + _ = jsObject[Strings.pause]!() + } + + public func updatePlaybackRate(playbackRate: Double) { + _ = jsObject[Strings.updatePlaybackRate]!(playbackRate.jsValue()) + } + + public func reverse() { + _ = jsObject[Strings.reverse]!() + } + + public func persist() { + _ = jsObject[Strings.persist]!() + } + + public func commitStyles() { + _ = jsObject[Strings.commitStyles]!() + } +} diff --git a/Sources/DOMKit/WebIDL/AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect.swift new file mode 100644 index 00000000..643370c2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationEffect.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnimationEffect: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AnimationEffect].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _parent = ReadonlyAttribute(jsObject: jsObject, name: Strings.parent) + _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: Strings.previousSibling) + _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: Strings.nextSibling) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var parent: GroupEffect? + + @ReadonlyAttribute + public var previousSibling: AnimationEffect? + + @ReadonlyAttribute + public var nextSibling: AnimationEffect? + + public func before(effects: AnimationEffect...) { + _ = jsObject[Strings.before]!(effects.jsValue()) + } + + public func after(effects: AnimationEffect...) { + _ = jsObject[Strings.after]!(effects.jsValue()) + } + + public func replace(effects: AnimationEffect...) { + _ = jsObject[Strings.replace]!(effects.jsValue()) + } + + public func remove() { + _ = jsObject[Strings.remove]!() + } + + public func getTiming() -> EffectTiming { + jsObject[Strings.getTiming]!().fromJSValue()! + } + + public func getComputedTiming() -> ComputedEffectTiming { + jsObject[Strings.getComputedTiming]!().fromJSValue()! + } + + public func updateTiming(timing: OptionalEffectTiming? = nil) { + _ = jsObject[Strings.updateTiming]!(timing?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/AnimationEvent.swift b/Sources/DOMKit/WebIDL/AnimationEvent.swift new file mode 100644 index 00000000..1a625947 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationEvent.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnimationEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.AnimationEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _animationName = ReadonlyAttribute(jsObject: jsObject, name: Strings.animationName) + _elapsedTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.elapsedTime) + _pseudoElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.pseudoElement) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, animationEventInitDict: AnimationEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), animationEventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var animationName: String + + @ReadonlyAttribute + public var elapsedTime: Double + + @ReadonlyAttribute + public var pseudoElement: String +} diff --git a/Sources/DOMKit/WebIDL/AnimationEventInit.swift b/Sources/DOMKit/WebIDL/AnimationEventInit.swift new file mode 100644 index 00000000..1c82a6cb --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationEventInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnimationEventInit: BridgedDictionary { + public convenience init(animationName: String, elapsedTime: Double, pseudoElement: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.animationName] = animationName.jsValue() + object[Strings.elapsedTime] = elapsedTime.jsValue() + object[Strings.pseudoElement] = pseudoElement.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _animationName = ReadWriteAttribute(jsObject: object, name: Strings.animationName) + _elapsedTime = ReadWriteAttribute(jsObject: object, name: Strings.elapsedTime) + _pseudoElement = ReadWriteAttribute(jsObject: object, name: Strings.pseudoElement) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var animationName: String + + @ReadWriteAttribute + public var elapsedTime: Double + + @ReadWriteAttribute + public var pseudoElement: String +} diff --git a/Sources/DOMKit/WebIDL/AnimationNodeList.swift b/Sources/DOMKit/WebIDL/AnimationNodeList.swift new file mode 100644 index 00000000..56d329f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationNodeList.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnimationNodeList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AnimationNodeList].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 + + public subscript(key: Int) -> AnimationEffect? { + jsObject[key].fromJSValue() + } +} diff --git a/Sources/DOMKit/WebIDL/AnimationPlayState.swift b/Sources/DOMKit/WebIDL/AnimationPlayState.swift new file mode 100644 index 00000000..a409d86b --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationPlayState.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AnimationPlayState: JSString, JSValueCompatible { + case idle = "idle" + case running = "running" + case paused = "paused" + case finished = "finished" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift b/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift new file mode 100644 index 00000000..21ec8aa8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnimationPlaybackEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.AnimationPlaybackEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) + _timelineTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.timelineTime) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: AnimationPlaybackEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var currentTime: CSSNumberish? + + @ReadonlyAttribute + public var timelineTime: CSSNumberish? +} diff --git a/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift b/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift new file mode 100644 index 00000000..13dab666 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnimationPlaybackEventInit: BridgedDictionary { + public convenience init(currentTime: CSSNumberish?, timelineTime: CSSNumberish?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.currentTime] = currentTime.jsValue() + object[Strings.timelineTime] = timelineTime.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _currentTime = ReadWriteAttribute(jsObject: object, name: Strings.currentTime) + _timelineTime = ReadWriteAttribute(jsObject: object, name: Strings.timelineTime) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var currentTime: CSSNumberish? + + @ReadWriteAttribute + public var timelineTime: CSSNumberish? +} diff --git a/Sources/DOMKit/WebIDL/AnimationReplaceState.swift b/Sources/DOMKit/WebIDL/AnimationReplaceState.swift new file mode 100644 index 00000000..4d76829f --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationReplaceState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AnimationReplaceState: JSString, JSValueCompatible { + case active = "active" + case removed = "removed" + case persisted = "persisted" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AnimationTimeline.swift b/Sources/DOMKit/WebIDL/AnimationTimeline.swift new file mode 100644 index 00000000..34c8bc8d --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationTimeline.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnimationTimeline: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AnimationTimeline].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) + _phase = ReadonlyAttribute(jsObject: jsObject, name: Strings.phase) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var duration: CSSNumberish? + + public func play(effect: AnimationEffect? = nil) -> Animation { + jsObject[Strings.play]!(effect?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var currentTime: Double? + + @ReadonlyAttribute + public var phase: TimelinePhase +} diff --git a/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift new file mode 100644 index 00000000..9bd26ae1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AnimationWorkletGlobalScope: WorkletGlobalScope { + override public class var constructor: JSFunction { JSObject.global[Strings.AnimationWorkletGlobalScope].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func registerAnimator(name: String, animatorCtor: AnimatorInstanceConstructor) { + _ = jsObject[Strings.registerAnimator]!(name.jsValue(), animatorCtor.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift b/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift new file mode 100644 index 00000000..642ec2e4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AppBannerPromptOutcome: JSString, JSValueCompatible { + case accepted = "accepted" + case dismissed = "dismissed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AppendMode.swift b/Sources/DOMKit/WebIDL/AppendMode.swift new file mode 100644 index 00000000..3180d133 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AppendMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AppendMode: JSString, JSValueCompatible { + case segments = "segments" + case sequence = "sequence" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift index 416a6d70..1b897a66 100644 --- a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift +++ b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class AssignedNodesOptions: BridgedDictionary { public convenience init(flatten: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.flatten] = flatten.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift b/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift new file mode 100644 index 00000000..c880bd89 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AttestationConveyancePreference: JSString, JSValueCompatible { + case none = "none" + case indirect = "indirect" + case direct = "direct" + case enterprise = "enterprise" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Attr.swift b/Sources/DOMKit/WebIDL/Attr.swift index 2a9e1f28..3bd34214 100644 --- a/Sources/DOMKit/WebIDL/Attr.swift +++ b/Sources/DOMKit/WebIDL/Attr.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Attr: Node { - override public class var constructor: JSFunction { JSObject.global.Attr.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.Attr].function! } public required init(unsafelyWrapping jsObject: JSObject) { _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) diff --git a/Sources/DOMKit/WebIDL/AttributionReporting.swift b/Sources/DOMKit/WebIDL/AttributionReporting.swift new file mode 100644 index 00000000..67de0db3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AttributionReporting.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AttributionReporting: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AttributionReporting].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func registerAttributionSource(params: AttributionSourceParams) -> JSPromise { + jsObject[Strings.registerAttributionSource]!(params.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func registerAttributionSource(params: AttributionSourceParams) async throws { + let _promise: JSPromise = jsObject[Strings.registerAttributionSource]!(params.jsValue()).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/AttributionSourceParams.swift b/Sources/DOMKit/WebIDL/AttributionSourceParams.swift new file mode 100644 index 00000000..83ae649a --- /dev/null +++ b/Sources/DOMKit/WebIDL/AttributionSourceParams.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AttributionSourceParams: BridgedDictionary { + public convenience init(attributionDestination: String, attributionSourceEventId: String, attributionReportTo: String, attributionExpiry: Int64, attributionSourcePriority: Int64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.attributionDestination] = attributionDestination.jsValue() + object[Strings.attributionSourceEventId] = attributionSourceEventId.jsValue() + object[Strings.attributionReportTo] = attributionReportTo.jsValue() + object[Strings.attributionExpiry] = attributionExpiry.jsValue() + object[Strings.attributionSourcePriority] = attributionSourcePriority.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _attributionDestination = ReadWriteAttribute(jsObject: object, name: Strings.attributionDestination) + _attributionSourceEventId = ReadWriteAttribute(jsObject: object, name: Strings.attributionSourceEventId) + _attributionReportTo = ReadWriteAttribute(jsObject: object, name: Strings.attributionReportTo) + _attributionExpiry = ReadWriteAttribute(jsObject: object, name: Strings.attributionExpiry) + _attributionSourcePriority = ReadWriteAttribute(jsObject: object, name: Strings.attributionSourcePriority) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var attributionDestination: String + + @ReadWriteAttribute + public var attributionSourceEventId: String + + @ReadWriteAttribute + public var attributionReportTo: String + + @ReadWriteAttribute + public var attributionExpiry: Int64 + + @ReadWriteAttribute + public var attributionSourcePriority: Int64 +} diff --git a/Sources/DOMKit/WebIDL/AudioBuffer.swift b/Sources/DOMKit/WebIDL/AudioBuffer.swift new file mode 100644 index 00000000..4db4630b --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioBuffer.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioBuffer: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AudioBuffer].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _sampleRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleRate) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _numberOfChannels = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfChannels) + self.jsObject = jsObject + } + + public convenience init(options: AudioBufferOptions) { + self.init(unsafelyWrapping: Self.constructor.new(options.jsValue())) + } + + @ReadonlyAttribute + public var sampleRate: Float + + @ReadonlyAttribute + public var length: UInt32 + + @ReadonlyAttribute + public var duration: Double + + @ReadonlyAttribute + public var numberOfChannels: UInt32 + + public func getChannelData(channel: UInt32) -> Float32Array { + jsObject[Strings.getChannelData]!(channel.jsValue()).fromJSValue()! + } + + public func copyFromChannel(destination: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { + _ = jsObject[Strings.copyFromChannel]!(destination.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined) + } + + public func copyToChannel(source: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { + _ = jsObject[Strings.copyToChannel]!(source.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/AudioBufferOptions.swift b/Sources/DOMKit/WebIDL/AudioBufferOptions.swift new file mode 100644 index 00000000..e2ace5c9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioBufferOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioBufferOptions: BridgedDictionary { + public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.numberOfChannels] = numberOfChannels.jsValue() + object[Strings.length] = length.jsValue() + object[Strings.sampleRate] = sampleRate.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var numberOfChannels: UInt32 + + @ReadWriteAttribute + public var length: UInt32 + + @ReadWriteAttribute + public var sampleRate: Float +} diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift new file mode 100644 index 00000000..4fc1b59a --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioBufferSourceNode: AudioScheduledSourceNode { + override public class var constructor: JSFunction { JSObject.global[Strings.AudioBufferSourceNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _buffer = ReadWriteAttribute(jsObject: jsObject, name: Strings.buffer) + _playbackRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.playbackRate) + _detune = ReadonlyAttribute(jsObject: jsObject, name: Strings.detune) + _loop = ReadWriteAttribute(jsObject: jsObject, name: Strings.loop) + _loopStart = ReadWriteAttribute(jsObject: jsObject, name: Strings.loopStart) + _loopEnd = ReadWriteAttribute(jsObject: jsObject, name: Strings.loopEnd) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: AudioBufferSourceOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var buffer: AudioBuffer? + + @ReadonlyAttribute + public var playbackRate: AudioParam + + @ReadonlyAttribute + public var detune: AudioParam + + @ReadWriteAttribute + public var loop: Bool + + @ReadWriteAttribute + public var loopStart: Double + + @ReadWriteAttribute + public var loopEnd: Double + + override public func start(when: Double? = nil, offset: Double? = nil, duration: Double? = nil) { + _ = jsObject[Strings.start]!(when?.jsValue() ?? .undefined, offset?.jsValue() ?? .undefined, duration?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift new file mode 100644 index 00000000..792099b5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioBufferSourceOptions: BridgedDictionary { + public convenience init(buffer: AudioBuffer?, detune: Float, loop: Bool, loopEnd: Double, loopStart: Double, playbackRate: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.buffer] = buffer.jsValue() + object[Strings.detune] = detune.jsValue() + object[Strings.loop] = loop.jsValue() + object[Strings.loopEnd] = loopEnd.jsValue() + object[Strings.loopStart] = loopStart.jsValue() + object[Strings.playbackRate] = playbackRate.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) + _detune = ReadWriteAttribute(jsObject: object, name: Strings.detune) + _loop = ReadWriteAttribute(jsObject: object, name: Strings.loop) + _loopEnd = ReadWriteAttribute(jsObject: object, name: Strings.loopEnd) + _loopStart = ReadWriteAttribute(jsObject: object, name: Strings.loopStart) + _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var buffer: AudioBuffer? + + @ReadWriteAttribute + public var detune: Float + + @ReadWriteAttribute + public var loop: Bool + + @ReadWriteAttribute + public var loopEnd: Double + + @ReadWriteAttribute + public var loopStart: Double + + @ReadWriteAttribute + public var playbackRate: Float +} diff --git a/Sources/DOMKit/WebIDL/AudioConfiguration.swift b/Sources/DOMKit/WebIDL/AudioConfiguration.swift new file mode 100644 index 00000000..68f925ee --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioConfiguration.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioConfiguration: BridgedDictionary { + public convenience init(contentType: String, channels: String, bitrate: UInt64, samplerate: UInt32, spatialRendering: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.contentType] = contentType.jsValue() + object[Strings.channels] = channels.jsValue() + object[Strings.bitrate] = bitrate.jsValue() + object[Strings.samplerate] = samplerate.jsValue() + object[Strings.spatialRendering] = spatialRendering.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _contentType = ReadWriteAttribute(jsObject: object, name: Strings.contentType) + _channels = ReadWriteAttribute(jsObject: object, name: Strings.channels) + _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) + _samplerate = ReadWriteAttribute(jsObject: object, name: Strings.samplerate) + _spatialRendering = ReadWriteAttribute(jsObject: object, name: Strings.spatialRendering) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var contentType: String + + @ReadWriteAttribute + public var channels: String + + @ReadWriteAttribute + public var bitrate: UInt64 + + @ReadWriteAttribute + public var samplerate: UInt32 + + @ReadWriteAttribute + public var spatialRendering: Bool +} diff --git a/Sources/DOMKit/WebIDL/AudioContext.swift b/Sources/DOMKit/WebIDL/AudioContext.swift new file mode 100644 index 00000000..d102b5d6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioContext.swift @@ -0,0 +1,74 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioContext: BaseAudioContext { + override public class var constructor: JSFunction { JSObject.global[Strings.AudioContext].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseLatency = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseLatency) + _outputLatency = ReadonlyAttribute(jsObject: jsObject, name: Strings.outputLatency) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(contextOptions: AudioContextOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(contextOptions?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var baseLatency: Double + + @ReadonlyAttribute + public var outputLatency: Double + + public func getOutputTimestamp() -> AudioTimestamp { + jsObject[Strings.getOutputTimestamp]!().fromJSValue()! + } + + public func resume() -> JSPromise { + jsObject[Strings.resume]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func resume() async throws { + let _promise: JSPromise = jsObject[Strings.resume]!().fromJSValue()! + _ = try await _promise.get() + } + + public func suspend() -> JSPromise { + jsObject[Strings.suspend]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func suspend() async throws { + let _promise: JSPromise = jsObject[Strings.suspend]!().fromJSValue()! + _ = try await _promise.get() + } + + public func close() -> JSPromise { + jsObject[Strings.close]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func close() async throws { + let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + _ = try await _promise.get() + } + + public func createMediaElementSource(mediaElement: HTMLMediaElement) -> MediaElementAudioSourceNode { + jsObject[Strings.createMediaElementSource]!(mediaElement.jsValue()).fromJSValue()! + } + + public func createMediaStreamSource(mediaStream: MediaStream) -> MediaStreamAudioSourceNode { + jsObject[Strings.createMediaStreamSource]!(mediaStream.jsValue()).fromJSValue()! + } + + public func createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack) -> MediaStreamTrackAudioSourceNode { + jsObject[Strings.createMediaStreamTrackSource]!(mediaStreamTrack.jsValue()).fromJSValue()! + } + + public func createMediaStreamDestination() -> MediaStreamAudioDestinationNode { + jsObject[Strings.createMediaStreamDestination]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift new file mode 100644 index 00000000..f6dbfabb --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AudioContextLatencyCategory: JSString, JSValueCompatible { + case balanced = "balanced" + case interactive = "interactive" + case playback = "playback" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AudioContextOptions.swift b/Sources/DOMKit/WebIDL/AudioContextOptions.swift new file mode 100644 index 00000000..b63c4ec2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioContextOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioContextOptions: BridgedDictionary { + public convenience init(latencyHint: __UNSUPPORTED_UNION__, sampleRate: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.latencyHint] = latencyHint.jsValue() + object[Strings.sampleRate] = sampleRate.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _latencyHint = ReadWriteAttribute(jsObject: object, name: Strings.latencyHint) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var latencyHint: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var sampleRate: Float +} diff --git a/Sources/DOMKit/WebIDL/AudioContextState.swift b/Sources/DOMKit/WebIDL/AudioContextState.swift new file mode 100644 index 00000000..9c629c3e --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioContextState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AudioContextState: JSString, JSValueCompatible { + case suspended = "suspended" + case running = "running" + case closed = "closed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AudioData.swift b/Sources/DOMKit/WebIDL/AudioData.swift new file mode 100644 index 00000000..f7568b18 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioData.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioData: JSBridgedClass { + 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 + } + + public convenience init(init: AudioDataInit) { + self.init(unsafelyWrapping: Self.constructor.new(`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 + + public func allocationSize(options: AudioDataCopyToOptions) -> UInt32 { + jsObject[Strings.allocationSize]!(options.jsValue()).fromJSValue()! + } + + public func copyTo(destination: BufferSource, options: AudioDataCopyToOptions) { + _ = jsObject[Strings.copyTo]!(destination.jsValue(), options.jsValue()) + } + + public func clone() -> Self { + jsObject[Strings.clone]!().fromJSValue()! + } + + public func close() { + _ = jsObject[Strings.close]!() + } +} diff --git a/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift b/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift new file mode 100644 index 00000000..e24c9eb0 --- /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..78c34d70 --- /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..2afeec16 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioDecoder.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioDecoder: JSBridgedClass { + 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 + } + + public convenience init(init: AudioDecoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadonlyAttribute + public var state: CodecState + + @ReadonlyAttribute + public var decodeQueueSize: UInt32 + + public func configure(config: AudioDecoderConfig) { + _ = jsObject[Strings.configure]!(config.jsValue()) + } + + public func decode(chunk: EncodedAudioChunk) { + _ = jsObject[Strings.decode]!(chunk.jsValue()) + } + + public func flush() -> JSPromise { + jsObject[Strings.flush]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func flush() async throws { + let _promise: JSPromise = jsObject[Strings.flush]!().fromJSValue()! + _ = try await _promise.get() + } + + public func reset() { + _ = jsObject[Strings.reset]!() + } + + public func close() { + _ = jsObject[Strings.close]!() + } + + public static func isConfigSupported(config: AudioDecoderConfig) -> JSPromise { + constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func isConfigSupported(config: AudioDecoderConfig) async throws -> AudioDecoderSupport { + let _promise: JSPromise = constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift b/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift new file mode 100644 index 00000000..cf7e341b --- /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..893662e9 --- /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() + ClosureAttribute.Required1[Strings.output, in: object] = output + ClosureAttribute.Required1[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute.Required1(jsObject: object, name: Strings.output) + _error = ClosureAttribute.Required1(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute.Required1 + public var output: AudioDataOutputCallback + + @ClosureAttribute.Required1 + public var error: WebCodecsErrorCallback +} diff --git a/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift b/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift new file mode 100644 index 00000000..19c9221c --- /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/AudioDestinationNode.swift b/Sources/DOMKit/WebIDL/AudioDestinationNode.swift new file mode 100644 index 00000000..4f57b8d3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioDestinationNode.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioDestinationNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.AudioDestinationNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _maxChannelCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxChannelCount) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var maxChannelCount: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/AudioEncoder.swift b/Sources/DOMKit/WebIDL/AudioEncoder.swift new file mode 100644 index 00000000..41653c8f --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioEncoder.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioEncoder: JSBridgedClass { + 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 + } + + public convenience init(init: AudioEncoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadonlyAttribute + public var state: CodecState + + @ReadonlyAttribute + public var encodeQueueSize: UInt32 + + public func configure(config: AudioEncoderConfig) { + _ = jsObject[Strings.configure]!(config.jsValue()) + } + + public func encode(data: AudioData) { + _ = jsObject[Strings.encode]!(data.jsValue()) + } + + public func flush() -> JSPromise { + jsObject[Strings.flush]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func flush() async throws { + let _promise: JSPromise = jsObject[Strings.flush]!().fromJSValue()! + _ = try await _promise.get() + } + + public func reset() { + _ = jsObject[Strings.reset]!() + } + + public func close() { + _ = jsObject[Strings.close]!() + } + + public static func isConfigSupported(config: AudioEncoderConfig) -> JSPromise { + constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func isConfigSupported(config: AudioEncoderConfig) async throws -> AudioEncoderSupport { + let _promise: JSPromise = constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift b/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift new file mode 100644 index 00000000..157f051c --- /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..76d2f55d --- /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() + ClosureAttribute.Required2[Strings.output, in: object] = output + ClosureAttribute.Required1[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute.Required2(jsObject: object, name: Strings.output) + _error = ClosureAttribute.Required1(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute.Required2 + public var output: EncodedAudioChunkOutputCallback + + @ClosureAttribute.Required1 + public var error: WebCodecsErrorCallback +} diff --git a/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift b/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift new file mode 100644 index 00000000..fccf587d --- /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/AudioListener.swift b/Sources/DOMKit/WebIDL/AudioListener.swift new file mode 100644 index 00000000..9900dae1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioListener.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioListener: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AudioListener].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _positionX = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionX) + _positionY = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionY) + _positionZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionZ) + _forwardX = ReadonlyAttribute(jsObject: jsObject, name: Strings.forwardX) + _forwardY = ReadonlyAttribute(jsObject: jsObject, name: Strings.forwardY) + _forwardZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.forwardZ) + _upX = ReadonlyAttribute(jsObject: jsObject, name: Strings.upX) + _upY = ReadonlyAttribute(jsObject: jsObject, name: Strings.upY) + _upZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.upZ) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var positionX: AudioParam + + @ReadonlyAttribute + public var positionY: AudioParam + + @ReadonlyAttribute + public var positionZ: AudioParam + + @ReadonlyAttribute + public var forwardX: AudioParam + + @ReadonlyAttribute + public var forwardY: AudioParam + + @ReadonlyAttribute + public var forwardZ: AudioParam + + @ReadonlyAttribute + public var upX: AudioParam + + @ReadonlyAttribute + public var upY: AudioParam + + @ReadonlyAttribute + public var upZ: AudioParam + + public func setPosition(x: Float, y: Float, z: Float) { + _ = jsObject[Strings.setPosition]!(x.jsValue(), y.jsValue(), z.jsValue()) + } + + public func setOrientation(x: Float, y: Float, z: Float, xUp: Float, yUp: Float, zUp: Float) { + let _arg0 = x.jsValue() + let _arg1 = y.jsValue() + let _arg2 = z.jsValue() + let _arg3 = xUp.jsValue() + let _arg4 = yUp.jsValue() + let _arg5 = zUp.jsValue() + _ = jsObject[Strings.setOrientation]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } +} diff --git a/Sources/DOMKit/WebIDL/AudioNode.swift b/Sources/DOMKit/WebIDL/AudioNode.swift new file mode 100644 index 00000000..6b7ba555 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioNode.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioNode: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.AudioNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _context = ReadonlyAttribute(jsObject: jsObject, name: Strings.context) + _numberOfInputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfInputs) + _numberOfOutputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfOutputs) + _channelCount = ReadWriteAttribute(jsObject: jsObject, name: Strings.channelCount) + _channelCountMode = ReadWriteAttribute(jsObject: jsObject, name: Strings.channelCountMode) + _channelInterpretation = ReadWriteAttribute(jsObject: jsObject, name: Strings.channelInterpretation) + super.init(unsafelyWrapping: jsObject) + } + + public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self { + jsObject[Strings.connect]!(destinationNode.jsValue(), output?.jsValue() ?? .undefined, input?.jsValue() ?? .undefined).fromJSValue()! + } + + public func connect(destinationParam: AudioParam, output: UInt32? = nil) { + _ = jsObject[Strings.connect]!(destinationParam.jsValue(), output?.jsValue() ?? .undefined) + } + + public func disconnect() { + _ = jsObject[Strings.disconnect]!() + } + + public func disconnect(output: UInt32) { + _ = jsObject[Strings.disconnect]!(output.jsValue()) + } + + public func disconnect(destinationNode: AudioNode) { + _ = jsObject[Strings.disconnect]!(destinationNode.jsValue()) + } + + public func disconnect(destinationNode: AudioNode, output: UInt32) { + _ = jsObject[Strings.disconnect]!(destinationNode.jsValue(), output.jsValue()) + } + + public func disconnect(destinationNode: AudioNode, output: UInt32, input: UInt32) { + _ = jsObject[Strings.disconnect]!(destinationNode.jsValue(), output.jsValue(), input.jsValue()) + } + + public func disconnect(destinationParam: AudioParam) { + _ = jsObject[Strings.disconnect]!(destinationParam.jsValue()) + } + + public func disconnect(destinationParam: AudioParam, output: UInt32) { + _ = jsObject[Strings.disconnect]!(destinationParam.jsValue(), output.jsValue()) + } + + @ReadonlyAttribute + public var context: BaseAudioContext + + @ReadonlyAttribute + public var numberOfInputs: UInt32 + + @ReadonlyAttribute + public var numberOfOutputs: UInt32 + + @ReadWriteAttribute + public var channelCount: UInt32 + + @ReadWriteAttribute + public var channelCountMode: ChannelCountMode + + @ReadWriteAttribute + public var channelInterpretation: ChannelInterpretation +} diff --git a/Sources/DOMKit/WebIDL/AudioNodeOptions.swift b/Sources/DOMKit/WebIDL/AudioNodeOptions.swift new file mode 100644 index 00000000..e79d4d6b --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioNodeOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioNodeOptions: BridgedDictionary { + public convenience init(channelCount: UInt32, channelCountMode: ChannelCountMode, channelInterpretation: ChannelInterpretation) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.channelCount] = channelCount.jsValue() + object[Strings.channelCountMode] = channelCountMode.jsValue() + object[Strings.channelInterpretation] = channelInterpretation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) + _channelCountMode = ReadWriteAttribute(jsObject: object, name: Strings.channelCountMode) + _channelInterpretation = ReadWriteAttribute(jsObject: object, name: Strings.channelInterpretation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var channelCount: UInt32 + + @ReadWriteAttribute + public var channelCountMode: ChannelCountMode + + @ReadWriteAttribute + public var channelInterpretation: ChannelInterpretation +} diff --git a/Sources/DOMKit/WebIDL/AudioOutputOptions.swift b/Sources/DOMKit/WebIDL/AudioOutputOptions.swift new file mode 100644 index 00000000..a9fd10ca --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioOutputOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioOutputOptions: 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 +} diff --git a/Sources/DOMKit/WebIDL/AudioParam.swift b/Sources/DOMKit/WebIDL/AudioParam.swift new file mode 100644 index 00000000..24818772 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioParam.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioParam: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AudioParam].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _automationRate = ReadWriteAttribute(jsObject: jsObject, name: Strings.automationRate) + _defaultValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.defaultValue) + _minValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.minValue) + _maxValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxValue) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var value: Float + + @ReadWriteAttribute + public var automationRate: AutomationRate + + @ReadonlyAttribute + public var defaultValue: Float + + @ReadonlyAttribute + public var minValue: Float + + @ReadonlyAttribute + public var maxValue: Float + + public func setValueAtTime(value: Float, startTime: Double) -> Self { + jsObject[Strings.setValueAtTime]!(value.jsValue(), startTime.jsValue()).fromJSValue()! + } + + public func linearRampToValueAtTime(value: Float, endTime: Double) -> Self { + jsObject[Strings.linearRampToValueAtTime]!(value.jsValue(), endTime.jsValue()).fromJSValue()! + } + + public func exponentialRampToValueAtTime(value: Float, endTime: Double) -> Self { + jsObject[Strings.exponentialRampToValueAtTime]!(value.jsValue(), endTime.jsValue()).fromJSValue()! + } + + public func setTargetAtTime(target: Float, startTime: Double, timeConstant: Float) -> Self { + jsObject[Strings.setTargetAtTime]!(target.jsValue(), startTime.jsValue(), timeConstant.jsValue()).fromJSValue()! + } + + public func setValueCurveAtTime(values: [Float], startTime: Double, duration: Double) -> Self { + jsObject[Strings.setValueCurveAtTime]!(values.jsValue(), startTime.jsValue(), duration.jsValue()).fromJSValue()! + } + + public func cancelScheduledValues(cancelTime: Double) -> Self { + jsObject[Strings.cancelScheduledValues]!(cancelTime.jsValue()).fromJSValue()! + } + + public func cancelAndHoldAtTime(cancelTime: Double) -> Self { + jsObject[Strings.cancelAndHoldAtTime]!(cancelTime.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift b/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift new file mode 100644 index 00000000..51fd3218 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioParamDescriptor: BridgedDictionary { + public convenience init(name: String, defaultValue: Float, minValue: Float, maxValue: Float, automationRate: AutomationRate) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.defaultValue] = defaultValue.jsValue() + object[Strings.minValue] = minValue.jsValue() + object[Strings.maxValue] = maxValue.jsValue() + object[Strings.automationRate] = automationRate.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _defaultValue = ReadWriteAttribute(jsObject: object, name: Strings.defaultValue) + _minValue = ReadWriteAttribute(jsObject: object, name: Strings.minValue) + _maxValue = ReadWriteAttribute(jsObject: object, name: Strings.maxValue) + _automationRate = ReadWriteAttribute(jsObject: object, name: Strings.automationRate) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var defaultValue: Float + + @ReadWriteAttribute + public var minValue: Float + + @ReadWriteAttribute + public var maxValue: Float + + @ReadWriteAttribute + public var automationRate: AutomationRate +} diff --git a/Sources/DOMKit/WebIDL/AudioParamMap.swift b/Sources/DOMKit/WebIDL/AudioParamMap.swift new file mode 100644 index 00000000..baf0a627 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioParamMap.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioParamMap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AudioParamMap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift b/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift new file mode 100644 index 00000000..f8c04faa --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioProcessingEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.AudioProcessingEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _playbackTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.playbackTime) + _inputBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputBuffer) + _outputBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.outputBuffer) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: AudioProcessingEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var playbackTime: Double + + @ReadonlyAttribute + public var inputBuffer: AudioBuffer + + @ReadonlyAttribute + public var outputBuffer: AudioBuffer +} diff --git a/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift b/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift new file mode 100644 index 00000000..a41bf229 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioProcessingEventInit: BridgedDictionary { + public convenience init(playbackTime: Double, inputBuffer: AudioBuffer, outputBuffer: AudioBuffer) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.playbackTime] = playbackTime.jsValue() + object[Strings.inputBuffer] = inputBuffer.jsValue() + object[Strings.outputBuffer] = outputBuffer.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _playbackTime = ReadWriteAttribute(jsObject: object, name: Strings.playbackTime) + _inputBuffer = ReadWriteAttribute(jsObject: object, name: Strings.inputBuffer) + _outputBuffer = ReadWriteAttribute(jsObject: object, name: Strings.outputBuffer) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var playbackTime: Double + + @ReadWriteAttribute + public var inputBuffer: AudioBuffer + + @ReadWriteAttribute + public var outputBuffer: AudioBuffer +} diff --git a/Sources/DOMKit/WebIDL/AudioSampleFormat.swift b/Sources/DOMKit/WebIDL/AudioSampleFormat.swift new file mode 100644 index 00000000..7bfc68b5 --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift new file mode 100644 index 00000000..c2dcfb14 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioScheduledSourceNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.AudioScheduledSourceNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onended = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onended) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var onended: EventHandler + + public func start(when: Double? = nil) { + _ = jsObject[Strings.start]!(when?.jsValue() ?? .undefined) + } + + public func stop(when: Double? = nil) { + _ = jsObject[Strings.stop]!(when?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/AudioTimestamp.swift b/Sources/DOMKit/WebIDL/AudioTimestamp.swift new file mode 100644 index 00000000..26e6840e --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioTimestamp.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioTimestamp: BridgedDictionary { + public convenience init(contextTime: Double, performanceTime: DOMHighResTimeStamp) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.contextTime] = contextTime.jsValue() + object[Strings.performanceTime] = performanceTime.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _contextTime = ReadWriteAttribute(jsObject: object, name: Strings.contextTime) + _performanceTime = ReadWriteAttribute(jsObject: object, name: Strings.performanceTime) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var contextTime: Double + + @ReadWriteAttribute + public var performanceTime: DOMHighResTimeStamp +} diff --git a/Sources/DOMKit/WebIDL/AudioTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack.swift index c6cd22e3..87dab07f 100644 --- a/Sources/DOMKit/WebIDL/AudioTrack.swift +++ b/Sources/DOMKit/WebIDL/AudioTrack.swift @@ -4,11 +4,12 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioTrack: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.AudioTrack.function! } + public class var constructor: JSFunction { JSObject.global[Strings.AudioTrack].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) @@ -17,6 +18,9 @@ public class AudioTrack: JSBridgedClass { self.jsObject = jsObject } + @ReadonlyAttribute + public var sourceBuffer: SourceBuffer? + @ReadonlyAttribute public var id: String diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift index 33e997be..cbea3426 100644 --- a/Sources/DOMKit/WebIDL/AudioTrackList.swift +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioTrackList: EventTarget { - override public class var constructor: JSFunction { JSObject.global.AudioTrackList.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.AudioTrackList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) diff --git a/Sources/DOMKit/WebIDL/AudioWorklet.swift b/Sources/DOMKit/WebIDL/AudioWorklet.swift new file mode 100644 index 00000000..ce1e5999 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioWorklet.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioWorklet: Worklet { + override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorklet].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift new file mode 100644 index 00000000..92cdd5a6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioWorkletGlobalScope: WorkletGlobalScope { + override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletGlobalScope].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _currentFrame = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentFrame) + _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) + _sampleRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleRate) + super.init(unsafelyWrapping: jsObject) + } + + public func registerProcessor(name: String, processorCtor: AudioWorkletProcessorConstructor) { + _ = jsObject[Strings.registerProcessor]!(name.jsValue(), processorCtor.jsValue()) + } + + @ReadonlyAttribute + public var currentFrame: UInt64 + + @ReadonlyAttribute + public var currentTime: Double + + @ReadonlyAttribute + public var sampleRate: Float +} diff --git a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift new file mode 100644 index 00000000..b33b6500 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioWorkletNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _parameters = ReadonlyAttribute(jsObject: jsObject, name: Strings.parameters) + _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) + _onprocessorerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprocessorerror) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, name: String, options: AudioWorkletNodeOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), name.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var parameters: AudioParamMap + + @ReadonlyAttribute + public var port: MessagePort + + @ClosureAttribute.Optional1 + public var onprocessorerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift b/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift new file mode 100644 index 00000000..3d702309 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioWorkletNodeOptions: BridgedDictionary { + public convenience init(numberOfInputs: UInt32, numberOfOutputs: UInt32, outputChannelCount: [UInt32], parameterData: [String: Double], processorOptions: JSObject) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.numberOfInputs] = numberOfInputs.jsValue() + object[Strings.numberOfOutputs] = numberOfOutputs.jsValue() + object[Strings.outputChannelCount] = outputChannelCount.jsValue() + object[Strings.parameterData] = parameterData.jsValue() + object[Strings.processorOptions] = processorOptions.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _numberOfInputs = ReadWriteAttribute(jsObject: object, name: Strings.numberOfInputs) + _numberOfOutputs = ReadWriteAttribute(jsObject: object, name: Strings.numberOfOutputs) + _outputChannelCount = ReadWriteAttribute(jsObject: object, name: Strings.outputChannelCount) + _parameterData = ReadWriteAttribute(jsObject: object, name: Strings.parameterData) + _processorOptions = ReadWriteAttribute(jsObject: object, name: Strings.processorOptions) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var numberOfInputs: UInt32 + + @ReadWriteAttribute + public var numberOfOutputs: UInt32 + + @ReadWriteAttribute + public var outputChannelCount: [UInt32] + + @ReadWriteAttribute + public var parameterData: [String: Double] + + @ReadWriteAttribute + public var processorOptions: JSObject +} diff --git a/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift b/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift new file mode 100644 index 00000000..a3391e67 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioWorkletProcessor: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletProcessor].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var port: MessagePort +} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift new file mode 100644 index 00000000..6b3201a0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AuthenticationExtensionsClientInputs: BridgedDictionary { + public convenience init(payment: AuthenticationExtensionsPaymentInputs, appid: String, appidExclude: String, uvm: Bool, credProps: Bool, largeBlob: AuthenticationExtensionsLargeBlobInputs) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.payment] = payment.jsValue() + object[Strings.appid] = appid.jsValue() + object[Strings.appidExclude] = appidExclude.jsValue() + object[Strings.uvm] = uvm.jsValue() + object[Strings.credProps] = credProps.jsValue() + object[Strings.largeBlob] = largeBlob.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _payment = ReadWriteAttribute(jsObject: object, name: Strings.payment) + _appid = ReadWriteAttribute(jsObject: object, name: Strings.appid) + _appidExclude = ReadWriteAttribute(jsObject: object, name: Strings.appidExclude) + _uvm = ReadWriteAttribute(jsObject: object, name: Strings.uvm) + _credProps = ReadWriteAttribute(jsObject: object, name: Strings.credProps) + _largeBlob = ReadWriteAttribute(jsObject: object, name: Strings.largeBlob) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var payment: AuthenticationExtensionsPaymentInputs + + @ReadWriteAttribute + public var appid: String + + @ReadWriteAttribute + public var appidExclude: String + + @ReadWriteAttribute + public var uvm: Bool + + @ReadWriteAttribute + public var credProps: Bool + + @ReadWriteAttribute + public var largeBlob: AuthenticationExtensionsLargeBlobInputs +} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift new file mode 100644 index 00000000..84ae7b5d --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AuthenticationExtensionsClientOutputs: BridgedDictionary { + public convenience init(appid: Bool, appidExclude: Bool, uvm: UvmEntries, credProps: CredentialPropertiesOutput, largeBlob: AuthenticationExtensionsLargeBlobOutputs) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.appid] = appid.jsValue() + object[Strings.appidExclude] = appidExclude.jsValue() + object[Strings.uvm] = uvm.jsValue() + object[Strings.credProps] = credProps.jsValue() + object[Strings.largeBlob] = largeBlob.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _appid = ReadWriteAttribute(jsObject: object, name: Strings.appid) + _appidExclude = ReadWriteAttribute(jsObject: object, name: Strings.appidExclude) + _uvm = ReadWriteAttribute(jsObject: object, name: Strings.uvm) + _credProps = ReadWriteAttribute(jsObject: object, name: Strings.credProps) + _largeBlob = ReadWriteAttribute(jsObject: object, name: Strings.largeBlob) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var appid: Bool + + @ReadWriteAttribute + public var appidExclude: Bool + + @ReadWriteAttribute + public var uvm: UvmEntries + + @ReadWriteAttribute + public var credProps: CredentialPropertiesOutput + + @ReadWriteAttribute + public var largeBlob: AuthenticationExtensionsLargeBlobOutputs +} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift new file mode 100644 index 00000000..4ef5f216 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AuthenticationExtensionsLargeBlobInputs: BridgedDictionary { + public convenience init(support: String, read: Bool, write: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.support] = support.jsValue() + object[Strings.read] = read.jsValue() + object[Strings.write] = write.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _support = ReadWriteAttribute(jsObject: object, name: Strings.support) + _read = ReadWriteAttribute(jsObject: object, name: Strings.read) + _write = ReadWriteAttribute(jsObject: object, name: Strings.write) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var support: String + + @ReadWriteAttribute + public var read: Bool + + @ReadWriteAttribute + public var write: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift new file mode 100644 index 00000000..95cc0ecd --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AuthenticationExtensionsLargeBlobOutputs: BridgedDictionary { + public convenience init(supported: Bool, blob: ArrayBuffer, written: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supported] = supported.jsValue() + object[Strings.blob] = blob.jsValue() + object[Strings.written] = written.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _blob = ReadWriteAttribute(jsObject: object, name: Strings.blob) + _written = ReadWriteAttribute(jsObject: object, name: Strings.written) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var supported: Bool + + @ReadWriteAttribute + public var blob: ArrayBuffer + + @ReadWriteAttribute + public var written: Bool +} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift new file mode 100644 index 00000000..c5c69bdd --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AuthenticationExtensionsPaymentInputs: BridgedDictionary { + public convenience init(isPayment: Bool, rp: String, topOrigin: String, payeeOrigin: String, total: PaymentCurrencyAmount, instrument: PaymentCredentialInstrument) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.isPayment] = isPayment.jsValue() + object[Strings.rp] = rp.jsValue() + object[Strings.topOrigin] = topOrigin.jsValue() + object[Strings.payeeOrigin] = payeeOrigin.jsValue() + object[Strings.total] = total.jsValue() + object[Strings.instrument] = instrument.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _isPayment = ReadWriteAttribute(jsObject: object, name: Strings.isPayment) + _rp = ReadWriteAttribute(jsObject: object, name: Strings.rp) + _topOrigin = ReadWriteAttribute(jsObject: object, name: Strings.topOrigin) + _payeeOrigin = ReadWriteAttribute(jsObject: object, name: Strings.payeeOrigin) + _total = ReadWriteAttribute(jsObject: object, name: Strings.total) + _instrument = ReadWriteAttribute(jsObject: object, name: Strings.instrument) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var isPayment: Bool + + @ReadWriteAttribute + public var rp: String + + @ReadWriteAttribute + public var topOrigin: String + + @ReadWriteAttribute + public var payeeOrigin: String + + @ReadWriteAttribute + public var total: PaymentCurrencyAmount + + @ReadWriteAttribute + public var instrument: PaymentCredentialInstrument +} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift new file mode 100644 index 00000000..112d23db --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AuthenticatorAssertionResponse: AuthenticatorResponse { + override public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorAssertionResponse].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _authenticatorData = ReadonlyAttribute(jsObject: jsObject, name: Strings.authenticatorData) + _signature = ReadonlyAttribute(jsObject: jsObject, name: Strings.signature) + _userHandle = ReadonlyAttribute(jsObject: jsObject, name: Strings.userHandle) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var authenticatorData: ArrayBuffer + + @ReadonlyAttribute + public var signature: ArrayBuffer + + @ReadonlyAttribute + public var userHandle: ArrayBuffer? +} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift b/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift new file mode 100644 index 00000000..07958805 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AuthenticatorAttachment: JSString, JSValueCompatible { + case platform = "platform" + case crossPlatform = "cross-platform" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift new file mode 100644 index 00000000..bc60bbb1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AuthenticatorAttestationResponse: AuthenticatorResponse { + override public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorAttestationResponse].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _attestationObject = ReadonlyAttribute(jsObject: jsObject, name: Strings.attestationObject) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var attestationObject: ArrayBuffer + + public func getTransports() -> [String] { + jsObject[Strings.getTransports]!().fromJSValue()! + } + + public func getAuthenticatorData() -> ArrayBuffer { + jsObject[Strings.getAuthenticatorData]!().fromJSValue()! + } + + public func getPublicKey() -> ArrayBuffer? { + jsObject[Strings.getPublicKey]!().fromJSValue()! + } + + public func getPublicKeyAlgorithm() -> COSEAlgorithmIdentifier { + jsObject[Strings.getPublicKeyAlgorithm]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift new file mode 100644 index 00000000..18d026a6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AuthenticatorResponse: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorResponse].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _clientDataJSON = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientDataJSON) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var clientDataJSON: ArrayBuffer +} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift b/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift new file mode 100644 index 00000000..fc7e516b --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AuthenticatorSelectionCriteria: BridgedDictionary { + public convenience init(authenticatorAttachment: String, residentKey: String, requireResidentKey: Bool, userVerification: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.authenticatorAttachment] = authenticatorAttachment.jsValue() + object[Strings.residentKey] = residentKey.jsValue() + object[Strings.requireResidentKey] = requireResidentKey.jsValue() + object[Strings.userVerification] = userVerification.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _authenticatorAttachment = ReadWriteAttribute(jsObject: object, name: Strings.authenticatorAttachment) + _residentKey = ReadWriteAttribute(jsObject: object, name: Strings.residentKey) + _requireResidentKey = ReadWriteAttribute(jsObject: object, name: Strings.requireResidentKey) + _userVerification = ReadWriteAttribute(jsObject: object, name: Strings.userVerification) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var authenticatorAttachment: String + + @ReadWriteAttribute + public var residentKey: String + + @ReadWriteAttribute + public var requireResidentKey: Bool + + @ReadWriteAttribute + public var userVerification: String +} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift b/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift new file mode 100644 index 00000000..c27f68e9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AuthenticatorTransport: JSString, JSValueCompatible { + case usb = "usb" + case nfc = "nfc" + case ble = "ble" + case internal = "internal" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AutoKeyword.swift b/Sources/DOMKit/WebIDL/AutoKeyword.swift new file mode 100644 index 00000000..0f171a2e --- /dev/null +++ b/Sources/DOMKit/WebIDL/AutoKeyword.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AutoKeyword: JSString, JSValueCompatible { + case auto = "auto" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AutomationRate.swift b/Sources/DOMKit/WebIDL/AutomationRate.swift new file mode 100644 index 00000000..53f0f478 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AutomationRate.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AutomationRate: JSString, JSValueCompatible { + case aRate = "a-rate" + case kRate = "k-rate" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AutoplayPolicy.swift b/Sources/DOMKit/WebIDL/AutoplayPolicy.swift new file mode 100644 index 00000000..b56a357c --- /dev/null +++ b/Sources/DOMKit/WebIDL/AutoplayPolicy.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AutoplayPolicy: JSString, JSValueCompatible { + case allowed = "allowed" + case allowedMuted = "allowed-muted" + case disallowed = "disallowed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift b/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift new file mode 100644 index 00000000..0408a209 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AutoplayPolicyMediaType: JSString, JSValueCompatible { + case mediaelement = "mediaelement" + case audiocontext = "audiocontext" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift b/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift new file mode 100644 index 00000000..2522b01d --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BackgroundFetchEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _registration = ReadonlyAttribute(jsObject: jsObject, name: Strings.registration) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, init: BackgroundFetchEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + } + + @ReadonlyAttribute + public var registration: BackgroundFetchRegistration +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift b/Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift new file mode 100644 index 00000000..e2199e32 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BackgroundFetchEventInit: BridgedDictionary { + public convenience init(registration: BackgroundFetchRegistration) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.registration] = registration.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _registration = ReadWriteAttribute(jsObject: object, name: Strings.registration) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var registration: BackgroundFetchRegistration +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift b/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift new file mode 100644 index 00000000..760a4604 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum BackgroundFetchFailureReason: JSString, JSValueCompatible { + case _empty = "" + case aborted = "aborted" + case badStatus = "bad-status" + case fetchError = "fetch-error" + case quotaExceeded = "quota-exceeded" + case downloadTotalExceeded = "download-total-exceeded" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift new file mode 100644 index 00000000..288a158c --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BackgroundFetchManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) -> JSPromise { + jsObject[Strings.fetch]!(id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) async throws -> BackgroundFetchRegistration { + let _promise: JSPromise = jsObject[Strings.fetch]!(id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func get(id: String) -> JSPromise { + jsObject[Strings.get]!(id.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func get(id: String) async throws -> BackgroundFetchRegistration? { + let _promise: JSPromise = jsObject[Strings.get]!(id.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getIds() -> JSPromise { + jsObject[Strings.getIds]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getIds() async throws -> [String] { + let _promise: JSPromise = jsObject[Strings.getIds]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift b/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift new file mode 100644 index 00000000..7dd27c3c --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BackgroundFetchOptions: BridgedDictionary { + public convenience init(downloadTotal: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.downloadTotal] = downloadTotal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _downloadTotal = ReadWriteAttribute(jsObject: object, name: Strings.downloadTotal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var downloadTotal: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift b/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift new file mode 100644 index 00000000..c2f2c58d --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BackgroundFetchRecord: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchRecord].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _request = ReadonlyAttribute(jsObject: jsObject, name: Strings.request) + _responseReady = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseReady) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var request: Request + + @ReadonlyAttribute + public var responseReady: JSPromise +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift new file mode 100644 index 00000000..9cdd9bc9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift @@ -0,0 +1,78 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BackgroundFetchRegistration: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchRegistration].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _uploadTotal = ReadonlyAttribute(jsObject: jsObject, name: Strings.uploadTotal) + _uploaded = ReadonlyAttribute(jsObject: jsObject, name: Strings.uploaded) + _downloadTotal = ReadonlyAttribute(jsObject: jsObject, name: Strings.downloadTotal) + _downloaded = ReadonlyAttribute(jsObject: jsObject, name: Strings.downloaded) + _result = ReadonlyAttribute(jsObject: jsObject, name: Strings.result) + _failureReason = ReadonlyAttribute(jsObject: jsObject, name: Strings.failureReason) + _recordsAvailable = ReadonlyAttribute(jsObject: jsObject, name: Strings.recordsAvailable) + _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprogress) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var uploadTotal: UInt64 + + @ReadonlyAttribute + public var uploaded: UInt64 + + @ReadonlyAttribute + public var downloadTotal: UInt64 + + @ReadonlyAttribute + public var downloaded: UInt64 + + @ReadonlyAttribute + public var result: BackgroundFetchResult + + @ReadonlyAttribute + public var failureReason: BackgroundFetchFailureReason + + @ReadonlyAttribute + public var recordsAvailable: Bool + + @ClosureAttribute.Optional1 + public var onprogress: EventHandler + + public func abort() -> JSPromise { + jsObject[Strings.abort]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func abort() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.abort]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func match(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { + jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> BackgroundFetchRecord { + let _promise: JSPromise = jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { + jsObject[Strings.matchAll]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [BackgroundFetchRecord] { + let _promise: JSPromise = jsObject[Strings.matchAll]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift b/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift new file mode 100644 index 00000000..fa223105 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum BackgroundFetchResult: JSString, JSValueCompatible { + case _empty = "" + case success = "success" + case failure = "failure" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift b/Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift new file mode 100644 index 00000000..3b5d342d --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BackgroundFetchUIOptions: BridgedDictionary { + public convenience init(icons: [ImageResource], title: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.icons] = icons.jsValue() + object[Strings.title] = title.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _icons = ReadWriteAttribute(jsObject: object, name: Strings.icons) + _title = ReadWriteAttribute(jsObject: object, name: Strings.title) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var icons: [ImageResource] + + @ReadWriteAttribute + public var title: String +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift b/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift new file mode 100644 index 00000000..261027f2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BackgroundFetchUpdateUIEvent: BackgroundFetchEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchUpdateUIEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, init: BackgroundFetchEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + } + + public func updateUI(options: BackgroundFetchUIOptions? = nil) -> JSPromise { + jsObject[Strings.updateUI]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func updateUI(options: BackgroundFetchUIOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.updateUI]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift b/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift new file mode 100644 index 00000000..bc9dd520 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BackgroundSyncOptions: BridgedDictionary { + public convenience init(minInterval: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.minInterval] = minInterval.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _minInterval = ReadWriteAttribute(jsObject: object, name: Strings.minInterval) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var minInterval: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/BarProp.swift b/Sources/DOMKit/WebIDL/BarProp.swift index 26eea5c1..3089eba0 100644 --- a/Sources/DOMKit/WebIDL/BarProp.swift +++ b/Sources/DOMKit/WebIDL/BarProp.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BarProp: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.BarProp.function! } + public class var constructor: JSFunction { JSObject.global[Strings.BarProp].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/BarcodeDetector.swift b/Sources/DOMKit/WebIDL/BarcodeDetector.swift new file mode 100644 index 00000000..9506b226 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BarcodeDetector.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BarcodeDetector: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BarcodeDetector].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(barcodeDetectorOptions: BarcodeDetectorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(barcodeDetectorOptions?.jsValue() ?? .undefined)) + } + + public static func getSupportedFormats() -> JSPromise { + constructor[Strings.getSupportedFormats]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func getSupportedFormats() async throws -> [BarcodeFormat] { + let _promise: JSPromise = constructor[Strings.getSupportedFormats]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func detect(image: ImageBitmapSource) -> JSPromise { + jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func detect(image: ImageBitmapSource) async throws -> [DetectedBarcode] { + let _promise: JSPromise = jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift b/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift new file mode 100644 index 00000000..b75192c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BarcodeDetectorOptions: BridgedDictionary { + public convenience init(formats: [BarcodeFormat]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.formats] = formats.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _formats = ReadWriteAttribute(jsObject: object, name: Strings.formats) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var formats: [BarcodeFormat] +} diff --git a/Sources/DOMKit/WebIDL/BarcodeFormat.swift b/Sources/DOMKit/WebIDL/BarcodeFormat.swift new file mode 100644 index 00000000..26cfc1c5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BarcodeFormat.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum BarcodeFormat: JSString, JSValueCompatible { + case aztec = "aztec" + case code128 = "code_128" + case code39 = "code_39" + case code93 = "code_93" + case codabar = "codabar" + case dataMatrix = "data_matrix" + case ean13 = "ean_13" + case ean8 = "ean_8" + case itf = "itf" + case pdf417 = "pdf417" + case qrCode = "qr_code" + case unknown = "unknown" + case upcA = "upc_a" + case upcE = "upc_e" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/BaseAudioContext.swift b/Sources/DOMKit/WebIDL/BaseAudioContext.swift new file mode 100644 index 00000000..b4fc6c64 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BaseAudioContext.swift @@ -0,0 +1,122 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BaseAudioContext: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.BaseAudioContext].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _destination = ReadonlyAttribute(jsObject: jsObject, name: Strings.destination) + _sampleRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleRate) + _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) + _listener = ReadonlyAttribute(jsObject: jsObject, name: Strings.listener) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _audioWorklet = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioWorklet) + _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var destination: AudioDestinationNode + + @ReadonlyAttribute + public var sampleRate: Float + + @ReadonlyAttribute + public var currentTime: Double + + @ReadonlyAttribute + public var listener: AudioListener + + @ReadonlyAttribute + public var state: AudioContextState + + @ReadonlyAttribute + public var audioWorklet: AudioWorklet + + @ClosureAttribute.Optional1 + public var onstatechange: EventHandler + + public func createAnalyser() -> AnalyserNode { + jsObject[Strings.createAnalyser]!().fromJSValue()! + } + + public func createBiquadFilter() -> BiquadFilterNode { + jsObject[Strings.createBiquadFilter]!().fromJSValue()! + } + + public func createBuffer(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) -> AudioBuffer { + jsObject[Strings.createBuffer]!(numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue()).fromJSValue()! + } + + public func createBufferSource() -> AudioBufferSourceNode { + jsObject[Strings.createBufferSource]!().fromJSValue()! + } + + public func createChannelMerger(numberOfInputs: UInt32? = nil) -> ChannelMergerNode { + jsObject[Strings.createChannelMerger]!(numberOfInputs?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createChannelSplitter(numberOfOutputs: UInt32? = nil) -> ChannelSplitterNode { + jsObject[Strings.createChannelSplitter]!(numberOfOutputs?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createConstantSource() -> ConstantSourceNode { + jsObject[Strings.createConstantSource]!().fromJSValue()! + } + + public func createConvolver() -> ConvolverNode { + jsObject[Strings.createConvolver]!().fromJSValue()! + } + + public func createDelay(maxDelayTime: Double? = nil) -> DelayNode { + jsObject[Strings.createDelay]!(maxDelayTime?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createDynamicsCompressor() -> DynamicsCompressorNode { + jsObject[Strings.createDynamicsCompressor]!().fromJSValue()! + } + + public func createGain() -> GainNode { + jsObject[Strings.createGain]!().fromJSValue()! + } + + public func createIIRFilter(feedforward: [Double], feedback: [Double]) -> IIRFilterNode { + jsObject[Strings.createIIRFilter]!(feedforward.jsValue(), feedback.jsValue()).fromJSValue()! + } + + public func createOscillator() -> OscillatorNode { + jsObject[Strings.createOscillator]!().fromJSValue()! + } + + public func createPanner() -> PannerNode { + jsObject[Strings.createPanner]!().fromJSValue()! + } + + public func createPeriodicWave(real: [Float], imag: [Float], constraints: PeriodicWaveConstraints? = nil) -> PeriodicWave { + jsObject[Strings.createPeriodicWave]!(real.jsValue(), imag.jsValue(), constraints?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createScriptProcessor(bufferSize: UInt32? = nil, numberOfInputChannels: UInt32? = nil, numberOfOutputChannels: UInt32? = nil) -> ScriptProcessorNode { + jsObject[Strings.createScriptProcessor]!(bufferSize?.jsValue() ?? .undefined, numberOfInputChannels?.jsValue() ?? .undefined, numberOfOutputChannels?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createStereoPanner() -> StereoPannerNode { + jsObject[Strings.createStereoPanner]!().fromJSValue()! + } + + public func createWaveShaper() -> WaveShaperNode { + jsObject[Strings.createWaveShaper]!().fromJSValue()! + } + + public func decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback? = nil, errorCallback: DecodeErrorCallback? = nil) -> JSPromise { + jsObject[Strings.decodeAudioData]!(audioData.jsValue(), successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback? = nil, errorCallback: DecodeErrorCallback? = nil) async throws -> AudioBuffer { + let _promise: JSPromise = jsObject[Strings.decodeAudioData]!(audioData.jsValue(), successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BaseComputedKeyframe.swift b/Sources/DOMKit/WebIDL/BaseComputedKeyframe.swift new file mode 100644 index 00000000..8e5499e1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BaseComputedKeyframe.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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.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) { + _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 offset: Double? + + @ReadWriteAttribute + public var computedOffset: Double + + @ReadWriteAttribute + public var easing: String + + @ReadWriteAttribute + public var composite: CompositeOperationOrAuto +} diff --git a/Sources/DOMKit/WebIDL/BaseKeyframe.swift b/Sources/DOMKit/WebIDL/BaseKeyframe.swift new file mode 100644 index 00000000..0ce61c23 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BaseKeyframe.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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) + } + + 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) + } + + @ReadWriteAttribute + public var offset: Double? + + @ReadWriteAttribute + public var easing: String + + @ReadWriteAttribute + public var composite: CompositeOperationOrAuto +} diff --git a/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift b/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift new file mode 100644 index 00000000..cf7075e5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BasePropertyIndexedKeyframe: BridgedDictionary { + public convenience init(offset: __UNSUPPORTED_UNION__, easing: __UNSUPPORTED_UNION__, composite: __UNSUPPORTED_UNION__) { + 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) + } + + @ReadWriteAttribute + public var offset: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var easing: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var composite: __UNSUPPORTED_UNION__ +} diff --git a/Sources/DOMKit/WebIDL/Baseline.swift b/Sources/DOMKit/WebIDL/Baseline.swift new file mode 100644 index 00000000..90b0e54f --- /dev/null +++ b/Sources/DOMKit/WebIDL/Baseline.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Baseline: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Baseline].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var value: Double +} diff --git a/Sources/DOMKit/WebIDL/BatteryManager.swift b/Sources/DOMKit/WebIDL/BatteryManager.swift new file mode 100644 index 00000000..c636dbf8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BatteryManager.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BatteryManager: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.BatteryManager].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _charging = ReadonlyAttribute(jsObject: jsObject, name: Strings.charging) + _chargingTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.chargingTime) + _dischargingTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.dischargingTime) + _level = ReadonlyAttribute(jsObject: jsObject, name: Strings.level) + _onchargingchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchargingchange) + _onchargingtimechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchargingtimechange) + _ondischargingtimechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondischargingtimechange) + _onlevelchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onlevelchange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var charging: Bool + + @ReadonlyAttribute + public var chargingTime: Double + + @ReadonlyAttribute + public var dischargingTime: Double + + @ReadonlyAttribute + public var level: Double + + @ClosureAttribute.Optional1 + public var onchargingchange: EventHandler + + @ClosureAttribute.Optional1 + public var onchargingtimechange: EventHandler + + @ClosureAttribute.Optional1 + public var ondischargingtimechange: EventHandler + + @ClosureAttribute.Optional1 + public var onlevelchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift new file mode 100644 index 00000000..ef1911fd --- /dev/null +++ b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BeforeInstallPromptEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.BeforeInstallPromptEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: EventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + public func prompt() -> JSPromise { + jsObject[Strings.prompt]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func prompt() async throws -> PromptResponseObject { + let _promise: JSPromise = jsObject[Strings.prompt]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift index a515357c..10326891 100644 --- a/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift +++ b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BeforeUnloadEvent: Event { - override public class var constructor: JSFunction { JSObject.global.BeforeUnloadEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.BeforeUnloadEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/BinaryType.swift b/Sources/DOMKit/WebIDL/BinaryType.swift new file mode 100644 index 00000000..40d2bd76 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BinaryType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum BinaryType: JSString, JSValueCompatible { + case blob = "blob" + case arraybuffer = "arraybuffer" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift new file mode 100644 index 00000000..1bc09324 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BiquadFilterNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.BiquadFilterNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _frequency = ReadonlyAttribute(jsObject: jsObject, name: Strings.frequency) + _detune = ReadonlyAttribute(jsObject: jsObject, name: Strings.detune) + _Q = ReadonlyAttribute(jsObject: jsObject, name: Strings.Q) + _gain = ReadonlyAttribute(jsObject: jsObject, name: Strings.gain) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: BiquadFilterOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var type: BiquadFilterType + + @ReadonlyAttribute + public var frequency: AudioParam + + @ReadonlyAttribute + public var detune: AudioParam + + @ReadonlyAttribute + public var Q: AudioParam + + @ReadonlyAttribute + public var gain: AudioParam + + public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { + _ = jsObject[Strings.getFrequencyResponse]!(frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift b/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift new file mode 100644 index 00000000..55fa7816 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BiquadFilterOptions: BridgedDictionary { + public convenience init(type: BiquadFilterType, Q: Float, detune: Float, frequency: Float, gain: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.Q] = Q.jsValue() + object[Strings.detune] = detune.jsValue() + object[Strings.frequency] = frequency.jsValue() + object[Strings.gain] = gain.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _Q = ReadWriteAttribute(jsObject: object, name: Strings.Q) + _detune = ReadWriteAttribute(jsObject: object, name: Strings.detune) + _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) + _gain = ReadWriteAttribute(jsObject: object, name: Strings.gain) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: BiquadFilterType + + @ReadWriteAttribute + public var Q: Float + + @ReadWriteAttribute + public var detune: Float + + @ReadWriteAttribute + public var frequency: Float + + @ReadWriteAttribute + public var gain: Float +} diff --git a/Sources/DOMKit/WebIDL/BiquadFilterType.swift b/Sources/DOMKit/WebIDL/BiquadFilterType.swift new file mode 100644 index 00000000..b7912a14 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BiquadFilterType.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum BiquadFilterType: JSString, JSValueCompatible { + case lowpass = "lowpass" + case highpass = "highpass" + case bandpass = "bandpass" + case lowshelf = "lowshelf" + case highshelf = "highshelf" + case peaking = "peaking" + case notch = "notch" + case allpass = "allpass" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/BitrateMode.swift b/Sources/DOMKit/WebIDL/BitrateMode.swift new file mode 100644 index 00000000..4b5af8c4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BitrateMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum BitrateMode: JSString, JSValueCompatible { + case constant = "constant" + case variable = "variable" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index dad6c830..8d6fded9 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Blob: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.Blob.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Blob].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/BlobEvent.swift b/Sources/DOMKit/WebIDL/BlobEvent.swift new file mode 100644 index 00000000..fad322b7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BlobEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BlobEvent: Event { + 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 convenience init(type: String, eventInitDict: BlobEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var data: Blob + + @ReadonlyAttribute + public var timecode: DOMHighResTimeStamp +} diff --git a/Sources/DOMKit/WebIDL/BlobEventInit.swift b/Sources/DOMKit/WebIDL/BlobEventInit.swift new file mode 100644 index 00000000..75ca5918 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BlobEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift index b81ff396..3e7513f2 100644 --- a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift +++ b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class BlobPropertyBag: BridgedDictionary { public convenience init(type: String, endings: EndingType) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.type] = type.jsValue() object[Strings.endings] = endings.jsValue() self.init(unsafelyWrapping: object) diff --git a/Sources/DOMKit/WebIDL/BlockFragmentationType.swift b/Sources/DOMKit/WebIDL/BlockFragmentationType.swift new file mode 100644 index 00000000..026dac3d --- /dev/null +++ b/Sources/DOMKit/WebIDL/BlockFragmentationType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum BlockFragmentationType: JSString, JSValueCompatible { + case none = "none" + case page = "page" + case column = "column" + case region = "region" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Bluetooth.swift b/Sources/DOMKit/WebIDL/Bluetooth.swift new file mode 100644 index 00000000..375d8bf5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Bluetooth.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, CharacteristicEventHandlers, ServiceEventHandlers { + override public class var constructor: JSFunction { JSObject.global[Strings.Bluetooth].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onavailabilitychanged = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onavailabilitychanged) + _referringDevice = ReadonlyAttribute(jsObject: jsObject, name: Strings.referringDevice) + super.init(unsafelyWrapping: jsObject) + } + + public func getAvailability() -> JSPromise { + jsObject[Strings.getAvailability]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getAvailability() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.getAvailability]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onavailabilitychanged: EventHandler + + @ReadonlyAttribute + public var referringDevice: BluetoothDevice? + + public func getDevices() -> JSPromise { + jsObject[Strings.getDevices]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDevices() async throws -> [BluetoothDevice] { + let _promise: JSPromise = jsObject[Strings.getDevices]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestDevice(options: RequestDeviceOptions? = nil) -> JSPromise { + jsObject[Strings.requestDevice]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestDevice(options: RequestDeviceOptions? = nil) async throws -> BluetoothDevice { + let _promise: JSPromise = jsObject[Strings.requestDevice]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift new file mode 100644 index 00000000..474ac0a9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothAdvertisingEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothAdvertisingEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) + _uuids = ReadonlyAttribute(jsObject: jsObject, name: Strings.uuids) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _appearance = ReadonlyAttribute(jsObject: jsObject, name: Strings.appearance) + _txPower = ReadonlyAttribute(jsObject: jsObject, name: Strings.txPower) + _rssi = ReadonlyAttribute(jsObject: jsObject, name: Strings.rssi) + _manufacturerData = ReadonlyAttribute(jsObject: jsObject, name: Strings.manufacturerData) + _serviceData = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceData) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, init: BluetoothAdvertisingEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + } + + @ReadonlyAttribute + public var device: BluetoothDevice + + @ReadonlyAttribute + public var uuids: [UUID] + + @ReadonlyAttribute + public var name: String? + + @ReadonlyAttribute + public var appearance: UInt16? + + @ReadonlyAttribute + public var txPower: Int8? + + @ReadonlyAttribute + public var rssi: Int8? + + @ReadonlyAttribute + public var manufacturerData: BluetoothManufacturerDataMap + + @ReadonlyAttribute + public var serviceData: BluetoothServiceDataMap +} diff --git a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift new file mode 100644 index 00000000..fca7d625 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothAdvertisingEventInit: BridgedDictionary { + public convenience init(device: BluetoothDevice, uuids: [__UNSUPPORTED_UNION__], name: String, appearance: UInt16, txPower: Int8, rssi: Int8, manufacturerData: BluetoothManufacturerDataMap, serviceData: BluetoothServiceDataMap) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.device] = device.jsValue() + object[Strings.uuids] = uuids.jsValue() + object[Strings.name] = name.jsValue() + object[Strings.appearance] = appearance.jsValue() + object[Strings.txPower] = txPower.jsValue() + object[Strings.rssi] = rssi.jsValue() + object[Strings.manufacturerData] = manufacturerData.jsValue() + object[Strings.serviceData] = serviceData.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _device = ReadWriteAttribute(jsObject: object, name: Strings.device) + _uuids = ReadWriteAttribute(jsObject: object, name: Strings.uuids) + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _appearance = ReadWriteAttribute(jsObject: object, name: Strings.appearance) + _txPower = ReadWriteAttribute(jsObject: object, name: Strings.txPower) + _rssi = ReadWriteAttribute(jsObject: object, name: Strings.rssi) + _manufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.manufacturerData) + _serviceData = ReadWriteAttribute(jsObject: object, name: Strings.serviceData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var device: BluetoothDevice + + @ReadWriteAttribute + public var uuids: [__UNSUPPORTED_UNION__] + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var appearance: UInt16 + + @ReadWriteAttribute + public var txPower: Int8 + + @ReadWriteAttribute + public var rssi: Int8 + + @ReadWriteAttribute + public var manufacturerData: BluetoothManufacturerDataMap + + @ReadWriteAttribute + public var serviceData: BluetoothServiceDataMap +} diff --git a/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift b/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift new file mode 100644 index 00000000..24a4b341 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothCharacteristicProperties: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BluetoothCharacteristicProperties].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _broadcast = ReadonlyAttribute(jsObject: jsObject, name: Strings.broadcast) + _read = ReadonlyAttribute(jsObject: jsObject, name: Strings.read) + _writeWithoutResponse = ReadonlyAttribute(jsObject: jsObject, name: Strings.writeWithoutResponse) + _write = ReadonlyAttribute(jsObject: jsObject, name: Strings.write) + _notify = ReadonlyAttribute(jsObject: jsObject, name: Strings.notify) + _indicate = ReadonlyAttribute(jsObject: jsObject, name: Strings.indicate) + _authenticatedSignedWrites = ReadonlyAttribute(jsObject: jsObject, name: Strings.authenticatedSignedWrites) + _reliableWrite = ReadonlyAttribute(jsObject: jsObject, name: Strings.reliableWrite) + _writableAuxiliaries = ReadonlyAttribute(jsObject: jsObject, name: Strings.writableAuxiliaries) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var broadcast: Bool + + @ReadonlyAttribute + public var read: Bool + + @ReadonlyAttribute + public var writeWithoutResponse: Bool + + @ReadonlyAttribute + public var write: Bool + + @ReadonlyAttribute + public var notify: Bool + + @ReadonlyAttribute + public var indicate: Bool + + @ReadonlyAttribute + public var authenticatedSignedWrites: Bool + + @ReadonlyAttribute + public var reliableWrite: Bool + + @ReadonlyAttribute + public var writableAuxiliaries: Bool +} diff --git a/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift new file mode 100644 index 00000000..4fe801a8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothDataFilterInit: BridgedDictionary { + public convenience init(dataPrefix: BufferSource, mask: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.dataPrefix] = dataPrefix.jsValue() + object[Strings.mask] = mask.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _dataPrefix = ReadWriteAttribute(jsObject: object, name: Strings.dataPrefix) + _mask = ReadWriteAttribute(jsObject: object, name: Strings.mask) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var dataPrefix: BufferSource + + @ReadWriteAttribute + public var mask: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/BluetoothDevice.swift b/Sources/DOMKit/WebIDL/BluetoothDevice.swift new file mode 100644 index 00000000..fee404cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothDevice.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothDevice: EventTarget, BluetoothDeviceEventHandlers, CharacteristicEventHandlers, ServiceEventHandlers { + override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothDevice].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _gatt = ReadonlyAttribute(jsObject: jsObject, name: Strings.gatt) + _watchingAdvertisements = ReadonlyAttribute(jsObject: jsObject, name: Strings.watchingAdvertisements) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var name: String? + + @ReadonlyAttribute + public var gatt: BluetoothRemoteGATTServer? + + public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) -> JSPromise { + jsObject[Strings.watchAdvertisements]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.watchAdvertisements]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + @ReadonlyAttribute + public var watchingAdvertisements: Bool +} diff --git a/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift b/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift new file mode 100644 index 00000000..399afe91 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift @@ -0,0 +1,17 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol BluetoothDeviceEventHandlers: JSBridgedClass {} +public extension BluetoothDeviceEventHandlers { + var onadvertisementreceived: EventHandler { + get { ClosureAttribute.Optional1[Strings.onadvertisementreceived, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onadvertisementreceived, in: jsObject] = newValue } + } + + var ongattserverdisconnected: EventHandler { + get { ClosureAttribute.Optional1[Strings.ongattserverdisconnected, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ongattserverdisconnected, in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift new file mode 100644 index 00000000..e0080b87 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothLEScanFilterInit: BridgedDictionary { + public convenience init(services: [BluetoothServiceUUID], name: String, namePrefix: String, manufacturerData: [BluetoothManufacturerDataFilterInit], serviceData: [BluetoothServiceDataFilterInit]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.services] = services.jsValue() + object[Strings.name] = name.jsValue() + object[Strings.namePrefix] = namePrefix.jsValue() + object[Strings.manufacturerData] = manufacturerData.jsValue() + object[Strings.serviceData] = serviceData.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _services = ReadWriteAttribute(jsObject: object, name: Strings.services) + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _namePrefix = ReadWriteAttribute(jsObject: object, name: Strings.namePrefix) + _manufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.manufacturerData) + _serviceData = ReadWriteAttribute(jsObject: object, name: Strings.serviceData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var services: [BluetoothServiceUUID] + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var namePrefix: String + + @ReadWriteAttribute + public var manufacturerData: [BluetoothManufacturerDataFilterInit] + + @ReadWriteAttribute + public var serviceData: [BluetoothServiceDataFilterInit] +} diff --git a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift new file mode 100644 index 00000000..c564d0bd --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothManufacturerDataFilterInit: BridgedDictionary { + public convenience init(companyIdentifier: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.companyIdentifier] = companyIdentifier.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _companyIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.companyIdentifier) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var companyIdentifier: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift new file mode 100644 index 00000000..8f75d821 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothManufacturerDataMap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BluetoothManufacturerDataMap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift new file mode 100644 index 00000000..a10858c0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothPermissionDescriptor: BridgedDictionary { + public convenience init(deviceId: String, filters: [BluetoothLEScanFilterInit], optionalServices: [BluetoothServiceUUID], optionalManufacturerData: [UInt16], acceptAllDevices: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.deviceId] = deviceId.jsValue() + object[Strings.filters] = filters.jsValue() + object[Strings.optionalServices] = optionalServices.jsValue() + object[Strings.optionalManufacturerData] = optionalManufacturerData.jsValue() + object[Strings.acceptAllDevices] = acceptAllDevices.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) + _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) + _optionalServices = ReadWriteAttribute(jsObject: object, name: Strings.optionalServices) + _optionalManufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.optionalManufacturerData) + _acceptAllDevices = ReadWriteAttribute(jsObject: object, name: Strings.acceptAllDevices) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var deviceId: String + + @ReadWriteAttribute + public var filters: [BluetoothLEScanFilterInit] + + @ReadWriteAttribute + public var optionalServices: [BluetoothServiceUUID] + + @ReadWriteAttribute + public var optionalManufacturerData: [UInt16] + + @ReadWriteAttribute + public var acceptAllDevices: Bool +} diff --git a/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift b/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift new file mode 100644 index 00000000..d217b3a4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothPermissionResult: PermissionStatus { + override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothPermissionResult].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _devices = ReadWriteAttribute(jsObject: jsObject, name: Strings.devices) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var devices: [BluetoothDevice] +} diff --git a/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift b/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift new file mode 100644 index 00000000..0bfbeeb2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothPermissionStorage: BridgedDictionary { + public convenience init(allowedDevices: [AllowedBluetoothDevice]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.allowedDevices] = allowedDevices.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _allowedDevices = ReadWriteAttribute(jsObject: object, name: Strings.allowedDevices) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var allowedDevices: [AllowedBluetoothDevice] +} diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift new file mode 100644 index 00000000..692c9d14 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift @@ -0,0 +1,108 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothRemoteGATTCharacteristic: EventTarget, CharacteristicEventHandlers { + override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTCharacteristic].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _service = ReadonlyAttribute(jsObject: jsObject, name: Strings.service) + _uuid = ReadonlyAttribute(jsObject: jsObject, name: Strings.uuid) + _properties = ReadonlyAttribute(jsObject: jsObject, name: Strings.properties) + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var service: BluetoothRemoteGATTService + + @ReadonlyAttribute + public var uuid: UUID + + @ReadonlyAttribute + public var properties: BluetoothCharacteristicProperties + + @ReadonlyAttribute + public var value: DataView? + + public func getDescriptor(descriptor: BluetoothDescriptorUUID) -> JSPromise { + jsObject[Strings.getDescriptor]!(descriptor.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDescriptor(descriptor: BluetoothDescriptorUUID) async throws -> BluetoothRemoteGATTDescriptor { + let _promise: JSPromise = jsObject[Strings.getDescriptor]!(descriptor.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) -> JSPromise { + jsObject[Strings.getDescriptors]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) async throws -> [BluetoothRemoteGATTDescriptor] { + let _promise: JSPromise = jsObject[Strings.getDescriptors]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func readValue() -> JSPromise { + jsObject[Strings.readValue]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func readValue() async throws -> DataView { + let _promise: JSPromise = jsObject[Strings.readValue]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func writeValue(value: BufferSource) -> JSPromise { + jsObject[Strings.writeValue]!(value.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func writeValue(value: BufferSource) async throws { + let _promise: JSPromise = jsObject[Strings.writeValue]!(value.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func writeValueWithResponse(value: BufferSource) -> JSPromise { + jsObject[Strings.writeValueWithResponse]!(value.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func writeValueWithResponse(value: BufferSource) async throws { + let _promise: JSPromise = jsObject[Strings.writeValueWithResponse]!(value.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func writeValueWithoutResponse(value: BufferSource) -> JSPromise { + jsObject[Strings.writeValueWithoutResponse]!(value.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func writeValueWithoutResponse(value: BufferSource) async throws { + let _promise: JSPromise = jsObject[Strings.writeValueWithoutResponse]!(value.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func startNotifications() -> JSPromise { + jsObject[Strings.startNotifications]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func startNotifications() async throws -> BluetoothRemoteGATTCharacteristic { + let _promise: JSPromise = jsObject[Strings.startNotifications]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func stopNotifications() -> JSPromise { + jsObject[Strings.stopNotifications]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func stopNotifications() async throws -> BluetoothRemoteGATTCharacteristic { + let _promise: JSPromise = jsObject[Strings.stopNotifications]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift new file mode 100644 index 00000000..56304d69 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothRemoteGATTDescriptor: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTDescriptor].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _characteristic = ReadonlyAttribute(jsObject: jsObject, name: Strings.characteristic) + _uuid = ReadonlyAttribute(jsObject: jsObject, name: Strings.uuid) + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var characteristic: BluetoothRemoteGATTCharacteristic + + @ReadonlyAttribute + public var uuid: UUID + + @ReadonlyAttribute + public var value: DataView? + + public func readValue() -> JSPromise { + jsObject[Strings.readValue]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func readValue() async throws -> DataView { + let _promise: JSPromise = jsObject[Strings.readValue]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func writeValue(value: BufferSource) -> JSPromise { + jsObject[Strings.writeValue]!(value.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func writeValue(value: BufferSource) async throws { + let _promise: JSPromise = jsObject[Strings.writeValue]!(value.jsValue()).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift new file mode 100644 index 00000000..6dab1617 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothRemoteGATTServer: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTServer].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) + _connected = ReadonlyAttribute(jsObject: jsObject, name: Strings.connected) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var device: BluetoothDevice + + @ReadonlyAttribute + public var connected: Bool + + public func connect() -> JSPromise { + jsObject[Strings.connect]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func connect() async throws -> BluetoothRemoteGATTServer { + let _promise: JSPromise = jsObject[Strings.connect]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func disconnect() { + _ = jsObject[Strings.disconnect]!() + } + + public func getPrimaryService(service: BluetoothServiceUUID) -> JSPromise { + jsObject[Strings.getPrimaryService]!(service.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getPrimaryService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { + let _promise: JSPromise = jsObject[Strings.getPrimaryService]!(service.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getPrimaryServices(service: BluetoothServiceUUID? = nil) -> JSPromise { + jsObject[Strings.getPrimaryServices]!(service?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getPrimaryServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { + let _promise: JSPromise = jsObject[Strings.getPrimaryServices]!(service?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift new file mode 100644 index 00000000..75aed837 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothRemoteGATTService: EventTarget, CharacteristicEventHandlers, ServiceEventHandlers { + override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTService].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) + _uuid = ReadonlyAttribute(jsObject: jsObject, name: Strings.uuid) + _isPrimary = ReadonlyAttribute(jsObject: jsObject, name: Strings.isPrimary) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var device: BluetoothDevice + + @ReadonlyAttribute + public var uuid: UUID + + @ReadonlyAttribute + public var isPrimary: Bool + + public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) -> JSPromise { + jsObject[Strings.getCharacteristic]!(characteristic.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) async throws -> BluetoothRemoteGATTCharacteristic { + let _promise: JSPromise = jsObject[Strings.getCharacteristic]!(characteristic.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) -> JSPromise { + jsObject[Strings.getCharacteristics]!(characteristic?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) async throws -> [BluetoothRemoteGATTCharacteristic] { + let _promise: JSPromise = jsObject[Strings.getCharacteristics]!(characteristic?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getIncludedService(service: BluetoothServiceUUID) -> JSPromise { + jsObject[Strings.getIncludedService]!(service.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getIncludedService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { + let _promise: JSPromise = jsObject[Strings.getIncludedService]!(service.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getIncludedServices(service: BluetoothServiceUUID? = nil) -> JSPromise { + jsObject[Strings.getIncludedServices]!(service?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getIncludedServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { + let _promise: JSPromise = jsObject[Strings.getIncludedServices]!(service?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift new file mode 100644 index 00000000..f034d096 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothServiceDataFilterInit: BridgedDictionary { + public convenience init(service: BluetoothServiceUUID) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.service] = service.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _service = ReadWriteAttribute(jsObject: object, name: Strings.service) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var service: BluetoothServiceUUID +} diff --git a/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift b/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift new file mode 100644 index 00000000..25f44901 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothServiceDataMap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BluetoothServiceDataMap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/BluetoothUUID.swift b/Sources/DOMKit/WebIDL/BluetoothUUID.swift new file mode 100644 index 00000000..34c989f8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BluetoothUUID.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BluetoothUUID: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BluetoothUUID].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static func getService(name: __UNSUPPORTED_UNION__) -> UUID { + constructor[Strings.getService]!(name.jsValue()).fromJSValue()! + } + + public static func getCharacteristic(name: __UNSUPPORTED_UNION__) -> UUID { + constructor[Strings.getCharacteristic]!(name.jsValue()).fromJSValue()! + } + + public static func getDescriptor(name: __UNSUPPORTED_UNION__) -> UUID { + constructor[Strings.getDescriptor]!(name.jsValue()).fromJSValue()! + } + + public static func canonicalUUID(alias: UInt32) -> UUID { + constructor[Strings.canonicalUUID]!(alias.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/BoxQuadOptions.swift b/Sources/DOMKit/WebIDL/BoxQuadOptions.swift new file mode 100644 index 00000000..8e766079 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BoxQuadOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BoxQuadOptions: BridgedDictionary { + public convenience init(box: CSSBoxType, relativeTo: GeometryNode) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.box] = box.jsValue() + object[Strings.relativeTo] = relativeTo.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _box = ReadWriteAttribute(jsObject: object, name: Strings.box) + _relativeTo = ReadWriteAttribute(jsObject: object, name: Strings.relativeTo) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var box: CSSBoxType + + @ReadWriteAttribute + public var relativeTo: GeometryNode +} diff --git a/Sources/DOMKit/WebIDL/BreakToken.swift b/Sources/DOMKit/WebIDL/BreakToken.swift new file mode 100644 index 00000000..2b672ce2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BreakToken.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BreakToken: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.BreakToken].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _childBreakTokens = ReadonlyAttribute(jsObject: jsObject, name: Strings.childBreakTokens) + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var childBreakTokens: [ChildBreakToken] + + @ReadonlyAttribute + public var data: JSValue +} diff --git a/Sources/DOMKit/WebIDL/BreakTokenOptions.swift b/Sources/DOMKit/WebIDL/BreakTokenOptions.swift new file mode 100644 index 00000000..6e27e8f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BreakTokenOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BreakTokenOptions: BridgedDictionary { + public convenience init(childBreakTokens: [ChildBreakToken], data: JSValue) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.childBreakTokens] = childBreakTokens.jsValue() + object[Strings.data] = data.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _childBreakTokens = ReadWriteAttribute(jsObject: object, name: Strings.childBreakTokens) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var childBreakTokens: [ChildBreakToken] + + @ReadWriteAttribute + public var data: JSValue +} diff --git a/Sources/DOMKit/WebIDL/BreakType.swift b/Sources/DOMKit/WebIDL/BreakType.swift new file mode 100644 index 00000000..f31b54be --- /dev/null +++ b/Sources/DOMKit/WebIDL/BreakType.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum BreakType: JSString, JSValueCompatible { + case none = "none" + case line = "line" + case column = "column" + case page = "page" + case region = "region" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index 2582bcfc..1c9ff18f 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BroadcastChannel: EventTarget { - override public class var constructor: JSFunction { JSObject.global.BroadcastChannel.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.BroadcastChannel].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift b/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift new file mode 100644 index 00000000..fb865bb7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class BrowserCaptureMediaStreamTrack: MediaStreamTrack { + override public class var constructor: JSFunction { JSObject.global[Strings.BrowserCaptureMediaStreamTrack].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func cropTo(cropTarget: CropTarget?) -> JSPromise { + jsObject[Strings.cropTo]!(cropTarget.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func cropTo(cropTarget: CropTarget?) async throws { + let _promise: JSPromise = jsObject[Strings.cropTo]!(cropTarget.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + override public func clone() -> Self { + jsObject[Strings.clone]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift index 867df413..8501e922 100644 --- a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ByteLengthQueuingStrategy: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.ByteLengthQueuingStrategy.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ByteLengthQueuingStrategy].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CDATASection.swift b/Sources/DOMKit/WebIDL/CDATASection.swift index 32a64c03..619ad62b 100644 --- a/Sources/DOMKit/WebIDL/CDATASection.swift +++ b/Sources/DOMKit/WebIDL/CDATASection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CDATASection: Text { - override public class var constructor: JSFunction { JSObject.global.CDATASection.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CDATASection].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift b/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift new file mode 100644 index 00000000..f710bfbb --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSPViolationReportBody: ReportBody { + override public class var constructor: JSFunction { JSObject.global[Strings.CSPViolationReportBody].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _documentURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURL) + _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) + _blockedURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockedURL) + _effectiveDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.effectiveDirective) + _originalPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.originalPolicy) + _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) + _sample = ReadonlyAttribute(jsObject: jsObject, name: Strings.sample) + _disposition = ReadonlyAttribute(jsObject: jsObject, name: Strings.disposition) + _statusCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusCode) + _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) + _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var documentURL: String + + @ReadonlyAttribute + public var referrer: String? + + @ReadonlyAttribute + public var blockedURL: String? + + @ReadonlyAttribute + public var effectiveDirective: String + + @ReadonlyAttribute + public var originalPolicy: String + + @ReadonlyAttribute + public var sourceFile: String? + + @ReadonlyAttribute + public var sample: String? + + @ReadonlyAttribute + public var disposition: SecurityPolicyViolationEventDisposition + + @ReadonlyAttribute + public var statusCode: UInt16 + + @ReadonlyAttribute + public var lineNumber: UInt32? + + @ReadonlyAttribute + public var columnNumber: UInt32? +} diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index 1f23c24d..d6d01966 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -5,18 +5,320 @@ import JavaScriptKit public enum CSS { public static var jsObject: JSObject { - JSObject.global.CSS.object! + JSObject.global.[Strings.CSS].object! } - public static func escape(ident: String) -> String { - JSObject.global.CSS.object![Strings.escape]!(ident.jsValue()).fromJSValue()! + public static func registerProperty(definition: PropertyDefinition) { + _ = JSObject.global.[Strings.CSS].object![Strings.registerProperty]!(definition.jsValue()) } public static func supports(property: String, value: String) -> Bool { - JSObject.global.CSS.object![Strings.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! + JSObject.global.[Strings.CSS].object![Strings.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! } public static func supports(conditionText: String) -> Bool { - JSObject.global.CSS.object![Strings.supports]!(conditionText.jsValue()).fromJSValue()! + JSObject.global.[Strings.CSS].object![Strings.supports]!(conditionText.jsValue()).fromJSValue()! + } + + public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { + JSObject.global.[Strings.CSS].object![Strings.parseStylesheet]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { + let _promise: JSPromise = JSObject.global.[Strings.CSS].object![Strings.parseStylesheet]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { + JSObject.global.[Strings.CSS].object![Strings.parseRuleList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { + let _promise: JSPromise = JSObject.global.[Strings.CSS].object![Strings.parseRuleList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { + JSObject.global.[Strings.CSS].object![Strings.parseRule]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> CSSParserRule { + let _promise: JSPromise = JSObject.global.[Strings.CSS].object![Strings.parseRule]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { + JSObject.global.[Strings.CSS].object![Strings.parseDeclarationList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { + let _promise: JSPromise = JSObject.global.[Strings.CSS].object![Strings.parseDeclarationList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public static func parseDeclaration(css: String, options: CSSParserOptions? = nil) -> CSSParserDeclaration { + JSObject.global.[Strings.CSS].object![Strings.parseDeclaration]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public static func parseValue(css: String) -> CSSToken { + JSObject.global.[Strings.CSS].object![Strings.parseValue]!(css.jsValue()).fromJSValue()! + } + + public static func parseValueList(css: String) -> [CSSToken] { + JSObject.global.[Strings.CSS].object![Strings.parseValueList]!(css.jsValue()).fromJSValue()! + } + + public static func parseCommaValueList(css: String) -> [[CSSToken]] { + JSObject.global.[Strings.CSS].object![Strings.parseCommaValueList]!(css.jsValue()).fromJSValue()! + } + + public static var elementSources: JSValue { ReadonlyAttribute[Strings.elementSources, in: jsObject] } + + public static var layoutWorklet: Worklet { ReadonlyAttribute[Strings.layoutWorklet, in: jsObject] } + + public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } + + public static func escape(ident: String) -> String { + JSObject.global.[Strings.CSS].object![Strings.escape]!(ident.jsValue()).fromJSValue()! + } + + public static func number(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.number]!(value.jsValue()).fromJSValue()! + } + + public static func percent(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.percent]!(value.jsValue()).fromJSValue()! + } + + public static func em(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.em]!(value.jsValue()).fromJSValue()! + } + + public static func ex(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.ex]!(value.jsValue()).fromJSValue()! + } + + public static func ch(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.ch]!(value.jsValue()).fromJSValue()! + } + + public static func ic(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.ic]!(value.jsValue()).fromJSValue()! + } + + public static func rem(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.rem]!(value.jsValue()).fromJSValue()! + } + + public static func lh(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.lh]!(value.jsValue()).fromJSValue()! + } + + public static func rlh(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.rlh]!(value.jsValue()).fromJSValue()! + } + + public static func vw(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.vw]!(value.jsValue()).fromJSValue()! + } + + public static func vh(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.vh]!(value.jsValue()).fromJSValue()! + } + + public static func vi(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.vi]!(value.jsValue()).fromJSValue()! + } + + public static func vb(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.vb]!(value.jsValue()).fromJSValue()! + } + + public static func vmin(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.vmin]!(value.jsValue()).fromJSValue()! + } + + public static func vmax(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.vmax]!(value.jsValue()).fromJSValue()! + } + + public static func svw(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.svw]!(value.jsValue()).fromJSValue()! + } + + public static func svh(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.svh]!(value.jsValue()).fromJSValue()! + } + + public static func svi(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.svi]!(value.jsValue()).fromJSValue()! } + + public static func svb(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.svb]!(value.jsValue()).fromJSValue()! + } + + public static func svmin(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.svmin]!(value.jsValue()).fromJSValue()! + } + + public static func svmax(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.svmax]!(value.jsValue()).fromJSValue()! + } + + public static func lvw(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.lvw]!(value.jsValue()).fromJSValue()! + } + + public static func lvh(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.lvh]!(value.jsValue()).fromJSValue()! + } + + public static func lvi(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.lvi]!(value.jsValue()).fromJSValue()! + } + + public static func lvb(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.lvb]!(value.jsValue()).fromJSValue()! + } + + public static func lvmin(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.lvmin]!(value.jsValue()).fromJSValue()! + } + + public static func lvmax(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.lvmax]!(value.jsValue()).fromJSValue()! + } + + public static func dvw(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.dvw]!(value.jsValue()).fromJSValue()! + } + + public static func dvh(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.dvh]!(value.jsValue()).fromJSValue()! + } + + public static func dvi(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.dvi]!(value.jsValue()).fromJSValue()! + } + + public static func dvb(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.dvb]!(value.jsValue()).fromJSValue()! + } + + public static func dvmin(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.dvmin]!(value.jsValue()).fromJSValue()! + } + + public static func dvmax(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.dvmax]!(value.jsValue()).fromJSValue()! + } + + public static func cqw(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.cqw]!(value.jsValue()).fromJSValue()! + } + + public static func cqh(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.cqh]!(value.jsValue()).fromJSValue()! + } + + public static func cqi(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.cqi]!(value.jsValue()).fromJSValue()! + } + + public static func cqb(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.cqb]!(value.jsValue()).fromJSValue()! + } + + public static func cqmin(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.cqmin]!(value.jsValue()).fromJSValue()! + } + + public static func cqmax(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.cqmax]!(value.jsValue()).fromJSValue()! + } + + public static func cm(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.cm]!(value.jsValue()).fromJSValue()! + } + + public static func mm(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.mm]!(value.jsValue()).fromJSValue()! + } + + public static func Q(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.Q]!(value.jsValue()).fromJSValue()! + } + + public static func in (value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.in]!(value.jsValue()).fromJSValue()! + } + + public static func pt(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.pt]!(value.jsValue()).fromJSValue()! + } + + public static func pc(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.pc]!(value.jsValue()).fromJSValue()! + } + + public static func px(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.px]!(value.jsValue()).fromJSValue()! + } + + public static func deg(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.deg]!(value.jsValue()).fromJSValue()! + } + + public static func grad(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.grad]!(value.jsValue()).fromJSValue()! + } + + public static func rad(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.rad]!(value.jsValue()).fromJSValue()! + } + + public static func turn(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.turn]!(value.jsValue()).fromJSValue()! + } + + public static func s(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.s]!(value.jsValue()).fromJSValue()! + } + + public static func ms(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.ms]!(value.jsValue()).fromJSValue()! + } + + public static func Hz(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.Hz]!(value.jsValue()).fromJSValue()! + } + + public static func kHz(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.kHz]!(value.jsValue()).fromJSValue()! + } + + public static func dpi(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.dpi]!(value.jsValue()).fromJSValue()! + } + + public static func dpcm(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.dpcm]!(value.jsValue()).fromJSValue()! + } + + public static func dppx(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.dppx]!(value.jsValue()).fromJSValue()! + } + + public static func fr(value: Double) -> CSSUnitValue { + JSObject.global.[Strings.CSS].object![Strings.fr]!(value.jsValue()).fromJSValue()! + } + + public static var animationWorklet: Worklet { ReadonlyAttribute[Strings.animationWorklet, in: jsObject] } + + public static var paintWorklet: Worklet { ReadonlyAttribute[Strings.paintWorklet, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/CSSAnimation.swift b/Sources/DOMKit/WebIDL/CSSAnimation.swift new file mode 100644 index 00000000..3fab1761 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSAnimation.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSAnimation: Animation { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSAnimation].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _animationName = ReadonlyAttribute(jsObject: jsObject, name: Strings.animationName) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var animationName: String +} diff --git a/Sources/DOMKit/WebIDL/CSSBoxType.swift b/Sources/DOMKit/WebIDL/CSSBoxType.swift new file mode 100644 index 00000000..bbb32fe0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSBoxType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CSSBoxType: JSString, JSValueCompatible { + case margin = "margin" + case border = "border" + case padding = "padding" + case content = "content" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CSSColor.swift b/Sources/DOMKit/WebIDL/CSSColor.swift new file mode 100644 index 00000000..48a917df --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSColor.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSColor: CSSColorValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSColor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _colorSpace = ReadWriteAttribute(jsObject: jsObject, name: Strings.colorSpace) + _channels = ReadWriteAttribute(jsObject: jsObject, name: Strings.channels) + _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(colorSpace: CSSKeywordish, channels: [CSSColorPercent], alpha: CSSNumberish? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(colorSpace.jsValue(), channels.jsValue(), alpha?.jsValue() ?? .undefined)) + } + + private var _colorSpace: ReadWriteAttribute + override public var colorSpace: CSSKeywordish { + get { _colorSpace.wrappedValue } + set { _colorSpace.wrappedValue = newValue } + } + + @ReadWriteAttribute + public var channels: [CSSColorPercent] + + @ReadWriteAttribute + public var alpha: CSSNumberish +} diff --git a/Sources/DOMKit/WebIDL/CSSColorValue.swift b/Sources/DOMKit/WebIDL/CSSColorValue.swift new file mode 100644 index 00000000..279b7309 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSColorValue.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSColorValue: CSSStyleValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSColorValue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorSpace) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var colorSpace: CSSKeywordValue + + public func to(colorSpace: CSSKeywordish) -> Self { + jsObject[Strings.to]!(colorSpace.jsValue()).fromJSValue()! + } + + // XXX: illegal static override + // override public static func parse(cssText: String) -> __UNSUPPORTED_UNION__ +} diff --git a/Sources/DOMKit/WebIDL/CSSConditionRule.swift b/Sources/DOMKit/WebIDL/CSSConditionRule.swift index 76048a06..d447606e 100644 --- a/Sources/DOMKit/WebIDL/CSSConditionRule.swift +++ b/Sources/DOMKit/WebIDL/CSSConditionRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSConditionRule: CSSGroupingRule { - override public class var constructor: JSFunction { JSObject.global.CSSConditionRule.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSConditionRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _conditionText = ReadWriteAttribute(jsObject: jsObject, name: Strings.conditionText) diff --git a/Sources/DOMKit/WebIDL/CSSContainerRule.swift b/Sources/DOMKit/WebIDL/CSSContainerRule.swift new file mode 100644 index 00000000..54be31f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSContainerRule.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSContainerRule: CSSConditionRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSContainerRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift b/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift new file mode 100644 index 00000000..6b0d644a --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSCounterStyleRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSCounterStyleRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _system = ReadWriteAttribute(jsObject: jsObject, name: Strings.system) + _symbols = ReadWriteAttribute(jsObject: jsObject, name: Strings.symbols) + _additiveSymbols = ReadWriteAttribute(jsObject: jsObject, name: Strings.additiveSymbols) + _negative = ReadWriteAttribute(jsObject: jsObject, name: Strings.negative) + _prefix = ReadWriteAttribute(jsObject: jsObject, name: Strings.prefix) + _suffix = ReadWriteAttribute(jsObject: jsObject, name: Strings.suffix) + _range = ReadWriteAttribute(jsObject: jsObject, name: Strings.range) + _pad = ReadWriteAttribute(jsObject: jsObject, name: Strings.pad) + _speakAs = ReadWriteAttribute(jsObject: jsObject, name: Strings.speakAs) + _fallback = ReadWriteAttribute(jsObject: jsObject, name: Strings.fallback) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var system: String + + @ReadWriteAttribute + public var symbols: String + + @ReadWriteAttribute + public var additiveSymbols: String + + @ReadWriteAttribute + public var negative: String + + @ReadWriteAttribute + public var prefix: String + + @ReadWriteAttribute + public var suffix: String + + @ReadWriteAttribute + public var range: String + + @ReadWriteAttribute + public var pad: String + + @ReadWriteAttribute + public var speakAs: String + + @ReadWriteAttribute + public var fallback: String +} diff --git a/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift b/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift new file mode 100644 index 00000000..76272661 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSFontFaceRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFaceRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var style: CSSStyleDeclaration +} diff --git a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift new file mode 100644 index 00000000..e3c5987c --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSFontFeatureValuesMap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFeatureValuesMap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! + + public func set(featureValueName: String, values: __UNSUPPORTED_UNION__) { + _ = jsObject[Strings.set]!(featureValueName.jsValue(), values.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift new file mode 100644 index 00000000..21e7f83d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSFontFeatureValuesRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFeatureValuesRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _fontFamily = ReadWriteAttribute(jsObject: jsObject, name: Strings.fontFamily) + _annotation = ReadonlyAttribute(jsObject: jsObject, name: Strings.annotation) + _ornaments = ReadonlyAttribute(jsObject: jsObject, name: Strings.ornaments) + _stylistic = ReadonlyAttribute(jsObject: jsObject, name: Strings.stylistic) + _swash = ReadonlyAttribute(jsObject: jsObject, name: Strings.swash) + _characterVariant = ReadonlyAttribute(jsObject: jsObject, name: Strings.characterVariant) + _styleset = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleset) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var fontFamily: String + + @ReadonlyAttribute + public var annotation: CSSFontFeatureValuesMap + + @ReadonlyAttribute + public var ornaments: CSSFontFeatureValuesMap + + @ReadonlyAttribute + public var stylistic: CSSFontFeatureValuesMap + + @ReadonlyAttribute + public var swash: CSSFontFeatureValuesMap + + @ReadonlyAttribute + public var characterVariant: CSSFontFeatureValuesMap + + @ReadonlyAttribute + public var styleset: CSSFontFeatureValuesMap +} diff --git a/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift b/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift new file mode 100644 index 00000000..7c57366a --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSFontPaletteValuesRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontPaletteValuesRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _fontFamily = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontFamily) + _basePalette = ReadonlyAttribute(jsObject: jsObject, name: Strings.basePalette) + _overrideColors = ReadonlyAttribute(jsObject: jsObject, name: Strings.overrideColors) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var fontFamily: String + + @ReadonlyAttribute + public var basePalette: String + + @ReadonlyAttribute + public var overrideColors: String +} diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift index 0502fba2..2b0f997e 100644 --- a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSGroupingRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global.CSSGroupingRule.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSGroupingRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) diff --git a/Sources/DOMKit/WebIDL/CSSHSL.swift b/Sources/DOMKit/WebIDL/CSSHSL.swift new file mode 100644 index 00000000..78ddae5d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSHSL.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSHSL: CSSColorValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSHSL].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) + _s = ReadWriteAttribute(jsObject: jsObject, name: Strings.s) + _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) + _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(h: CSSColorAngle, s: CSSColorPercent, l: CSSColorPercent, alpha: CSSColorPercent? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(h.jsValue(), s.jsValue(), l.jsValue(), alpha?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var h: CSSColorAngle + + @ReadWriteAttribute + public var s: CSSColorPercent + + @ReadWriteAttribute + public var l: CSSColorPercent + + @ReadWriteAttribute + public var alpha: CSSColorPercent +} diff --git a/Sources/DOMKit/WebIDL/CSSHWB.swift b/Sources/DOMKit/WebIDL/CSSHWB.swift new file mode 100644 index 00000000..2c5be80b --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSHWB.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSHWB: CSSColorValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSHWB].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) + _w = ReadWriteAttribute(jsObject: jsObject, name: Strings.w) + _b = ReadWriteAttribute(jsObject: jsObject, name: Strings.b) + _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(h: CSSNumericValue, w: CSSNumberish, b: CSSNumberish, alpha: CSSNumberish? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(h.jsValue(), w.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var h: CSSNumericValue + + @ReadWriteAttribute + public var w: CSSNumberish + + @ReadWriteAttribute + public var b: CSSNumberish + + @ReadWriteAttribute + public var alpha: CSSNumberish +} diff --git a/Sources/DOMKit/WebIDL/CSSImageValue.swift b/Sources/DOMKit/WebIDL/CSSImageValue.swift new file mode 100644 index 00000000..f1f1a293 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSImageValue.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSImageValue: CSSStyleValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSImageValue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/CSSImportRule.swift b/Sources/DOMKit/WebIDL/CSSImportRule.swift index 2ada38da..260ba76a 100644 --- a/Sources/DOMKit/WebIDL/CSSImportRule.swift +++ b/Sources/DOMKit/WebIDL/CSSImportRule.swift @@ -4,12 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSImportRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global.CSSImportRule.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSImportRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _href = ReadonlyAttribute(jsObject: jsObject, name: Strings.href) _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) _styleSheet = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleSheet) + _layerName = ReadonlyAttribute(jsObject: jsObject, name: Strings.layerName) super.init(unsafelyWrapping: jsObject) } @@ -21,4 +22,7 @@ public class CSSImportRule: CSSRule { @ReadonlyAttribute public var styleSheet: CSSStyleSheet + + @ReadonlyAttribute + public var layerName: String? } diff --git a/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift b/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift new file mode 100644 index 00000000..bad39e4f --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSKeyframeRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeyframeRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _keyText = ReadWriteAttribute(jsObject: jsObject, name: Strings.keyText) + _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var keyText: String + + @ReadonlyAttribute + public var style: CSSStyleDeclaration +} diff --git a/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift b/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift new file mode 100644 index 00000000..526d2c3d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSKeyframesRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeyframesRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var name: String + + @ReadonlyAttribute + public var cssRules: CSSRuleList + + public func appendRule(rule: String) { + _ = jsObject[Strings.appendRule]!(rule.jsValue()) + } + + public func deleteRule(select: String) { + _ = jsObject[Strings.deleteRule]!(select.jsValue()) + } + + public func findRule(select: String) -> CSSKeyframeRule? { + jsObject[Strings.findRule]!(select.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSKeywordValue.swift b/Sources/DOMKit/WebIDL/CSSKeywordValue.swift new file mode 100644 index 00000000..70ad6918 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSKeywordValue.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSKeywordValue: CSSStyleValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeywordValue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(value: String) { + self.init(unsafelyWrapping: Self.constructor.new(value.jsValue())) + } + + @ReadWriteAttribute + public var value: String +} diff --git a/Sources/DOMKit/WebIDL/CSSLCH.swift b/Sources/DOMKit/WebIDL/CSSLCH.swift new file mode 100644 index 00000000..8b681f5d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSLCH.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSLCH: CSSColorValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSLCH].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) + _c = ReadWriteAttribute(jsObject: jsObject, name: Strings.c) + _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) + _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var l: CSSColorPercent + + @ReadWriteAttribute + public var c: CSSColorPercent + + @ReadWriteAttribute + public var h: CSSColorAngle + + @ReadWriteAttribute + public var alpha: CSSColorPercent +} diff --git a/Sources/DOMKit/WebIDL/CSSLab.swift b/Sources/DOMKit/WebIDL/CSSLab.swift new file mode 100644 index 00000000..5e3a3ef4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSLab.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSLab: CSSColorValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSLab].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) + _a = ReadWriteAttribute(jsObject: jsObject, name: Strings.a) + _b = ReadWriteAttribute(jsObject: jsObject, name: Strings.b) + _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var l: CSSColorPercent + + @ReadWriteAttribute + public var a: CSSColorNumber + + @ReadWriteAttribute + public var b: CSSColorNumber + + @ReadWriteAttribute + public var alpha: CSSColorPercent +} diff --git a/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift b/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift new file mode 100644 index 00000000..15a7ab17 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSLayerBlockRule: CSSGroupingRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSLayerBlockRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift b/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift new file mode 100644 index 00000000..c6a75cff --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSLayerStatementRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSLayerStatementRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _nameList = ReadonlyAttribute(jsObject: jsObject, name: Strings.nameList) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var nameList: [String] +} diff --git a/Sources/DOMKit/WebIDL/CSSMarginRule.swift b/Sources/DOMKit/WebIDL/CSSMarginRule.swift index 04241bd0..8be75104 100644 --- a/Sources/DOMKit/WebIDL/CSSMarginRule.swift +++ b/Sources/DOMKit/WebIDL/CSSMarginRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMarginRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global.CSSMarginRule.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMarginRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/CSSMathClamp.swift b/Sources/DOMKit/WebIDL/CSSMathClamp.swift new file mode 100644 index 00000000..e13c7d2c --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMathClamp.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMathClamp: CSSMathValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathClamp].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _lower = ReadonlyAttribute(jsObject: jsObject, name: Strings.lower) + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + _upper = ReadonlyAttribute(jsObject: jsObject, name: Strings.upper) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(lower: CSSNumberish, value: CSSNumberish, upper: CSSNumberish) { + self.init(unsafelyWrapping: Self.constructor.new(lower.jsValue(), value.jsValue(), upper.jsValue())) + } + + @ReadonlyAttribute + public var lower: CSSNumericValue + + @ReadonlyAttribute + public var value: CSSNumericValue + + @ReadonlyAttribute + public var upper: CSSNumericValue +} diff --git a/Sources/DOMKit/WebIDL/CSSMathInvert.swift b/Sources/DOMKit/WebIDL/CSSMathInvert.swift new file mode 100644 index 00000000..dfe5d44f --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMathInvert.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMathInvert: CSSMathValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathInvert].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(arg: CSSNumberish) { + self.init(unsafelyWrapping: Self.constructor.new(arg.jsValue())) + } + + @ReadonlyAttribute + public var value: CSSNumericValue +} diff --git a/Sources/DOMKit/WebIDL/CSSMathMax.swift b/Sources/DOMKit/WebIDL/CSSMathMax.swift new file mode 100644 index 00000000..6ff5f486 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMathMax.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMathMax: CSSMathValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathMax].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(args: CSSNumberish...) { + self.init(unsafelyWrapping: Self.constructor.new(args.jsValue())) + } + + @ReadonlyAttribute + public var values: CSSNumericArray +} diff --git a/Sources/DOMKit/WebIDL/CSSMathMin.swift b/Sources/DOMKit/WebIDL/CSSMathMin.swift new file mode 100644 index 00000000..d7c208e2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMathMin.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMathMin: CSSMathValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathMin].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(args: CSSNumberish...) { + self.init(unsafelyWrapping: Self.constructor.new(args.jsValue())) + } + + @ReadonlyAttribute + public var values: CSSNumericArray +} diff --git a/Sources/DOMKit/WebIDL/CSSMathNegate.swift b/Sources/DOMKit/WebIDL/CSSMathNegate.swift new file mode 100644 index 00000000..e0f7c3e7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMathNegate.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMathNegate: CSSMathValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathNegate].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(arg: CSSNumberish) { + self.init(unsafelyWrapping: Self.constructor.new(arg.jsValue())) + } + + @ReadonlyAttribute + public var value: CSSNumericValue +} diff --git a/Sources/DOMKit/WebIDL/CSSMathOperator.swift b/Sources/DOMKit/WebIDL/CSSMathOperator.swift new file mode 100644 index 00000000..10d6e51d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMathOperator.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CSSMathOperator: JSString, JSValueCompatible { + case sum = "sum" + case product = "product" + case negate = "negate" + case invert = "invert" + case min = "min" + case max = "max" + case clamp = "clamp" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CSSMathProduct.swift b/Sources/DOMKit/WebIDL/CSSMathProduct.swift new file mode 100644 index 00000000..2b4bb9ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMathProduct.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMathProduct: CSSMathValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathProduct].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(args: CSSNumberish...) { + self.init(unsafelyWrapping: Self.constructor.new(args.jsValue())) + } + + @ReadonlyAttribute + public var values: CSSNumericArray +} diff --git a/Sources/DOMKit/WebIDL/CSSMathSum.swift b/Sources/DOMKit/WebIDL/CSSMathSum.swift new file mode 100644 index 00000000..1e945ac8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMathSum.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMathSum: CSSMathValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathSum].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(args: CSSNumberish...) { + self.init(unsafelyWrapping: Self.constructor.new(args.jsValue())) + } + + @ReadonlyAttribute + public var values: CSSNumericArray +} diff --git a/Sources/DOMKit/WebIDL/CSSMathValue.swift b/Sources/DOMKit/WebIDL/CSSMathValue.swift new file mode 100644 index 00000000..31ebe083 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMathValue.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMathValue: CSSNumericValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathValue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _operator = ReadonlyAttribute(jsObject: jsObject, name: Strings.operator) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var operator: CSSMathOperator +} diff --git a/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift b/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift new file mode 100644 index 00000000..283e7b08 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMatrixComponent: CSSTransformComponent { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMatrixComponent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _matrix = ReadWriteAttribute(jsObject: jsObject, name: Strings.matrix) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(matrix: DOMMatrixReadOnly, options: CSSMatrixComponentOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(matrix.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var matrix: DOMMatrix +} diff --git a/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift b/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift new file mode 100644 index 00000000..26b76319 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSMatrixComponentOptions: BridgedDictionary { + public convenience init(is2D: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.is2D] = is2D.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _is2D = ReadWriteAttribute(jsObject: object, name: Strings.is2D) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var is2D: Bool +} diff --git a/Sources/DOMKit/WebIDL/CSSMediaRule.swift b/Sources/DOMKit/WebIDL/CSSMediaRule.swift index b605a387..a0efc30b 100644 --- a/Sources/DOMKit/WebIDL/CSSMediaRule.swift +++ b/Sources/DOMKit/WebIDL/CSSMediaRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMediaRule: CSSConditionRule { - override public class var constructor: JSFunction { JSObject.global.CSSMediaRule.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSMediaRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) diff --git a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift index bae4777e..aa6633cf 100644 --- a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift +++ b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSNamespaceRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global.CSSNamespaceRule.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSNamespaceRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) diff --git a/Sources/DOMKit/WebIDL/CSSNestingRule.swift b/Sources/DOMKit/WebIDL/CSSNestingRule.swift new file mode 100644 index 00000000..f40761f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSNestingRule.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSNestingRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSNestingRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) + _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var selectorText: String + + @ReadonlyAttribute + public var style: CSSStyleDeclaration + + @ReadonlyAttribute + public var cssRules: CSSRuleList + + public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { + jsObject[Strings.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteRule(index: UInt32) { + _ = jsObject[Strings.deleteRule]!(index.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/CSSNumericArray.swift b/Sources/DOMKit/WebIDL/CSSNumericArray.swift new file mode 100644 index 00000000..a5478781 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSNumericArray.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSNumericArray: JSBridgedClass, Sequence { + public class var constructor: JSFunction { JSObject.global[Strings.CSSNumericArray].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + self.jsObject = jsObject + } + + public typealias Element = CSSNumericValue + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> CSSNumericValue { + jsObject[key].fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift b/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift new file mode 100644 index 00000000..8364a77d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CSSNumericBaseType: JSString, JSValueCompatible { + case length = "length" + case angle = "angle" + case time = "time" + case frequency = "frequency" + case resolution = "resolution" + case flex = "flex" + case percent = "percent" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CSSNumericType.swift b/Sources/DOMKit/WebIDL/CSSNumericType.swift new file mode 100644 index 00000000..9e263cce --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSNumericType.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSNumericType: BridgedDictionary { + public convenience init(length: Int32, angle: Int32, time: Int32, frequency: Int32, resolution: Int32, flex: Int32, percent: Int32, percentHint: CSSNumericBaseType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.length] = length.jsValue() + object[Strings.angle] = angle.jsValue() + object[Strings.time] = time.jsValue() + object[Strings.frequency] = frequency.jsValue() + object[Strings.resolution] = resolution.jsValue() + object[Strings.flex] = flex.jsValue() + object[Strings.percent] = percent.jsValue() + object[Strings.percentHint] = percentHint.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + _angle = ReadWriteAttribute(jsObject: object, name: Strings.angle) + _time = ReadWriteAttribute(jsObject: object, name: Strings.time) + _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) + _resolution = ReadWriteAttribute(jsObject: object, name: Strings.resolution) + _flex = ReadWriteAttribute(jsObject: object, name: Strings.flex) + _percent = ReadWriteAttribute(jsObject: object, name: Strings.percent) + _percentHint = ReadWriteAttribute(jsObject: object, name: Strings.percentHint) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var length: Int32 + + @ReadWriteAttribute + public var angle: Int32 + + @ReadWriteAttribute + public var time: Int32 + + @ReadWriteAttribute + public var frequency: Int32 + + @ReadWriteAttribute + public var resolution: Int32 + + @ReadWriteAttribute + public var flex: Int32 + + @ReadWriteAttribute + public var percent: Int32 + + @ReadWriteAttribute + public var percentHint: CSSNumericBaseType +} diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue.swift b/Sources/DOMKit/WebIDL/CSSNumericValue.swift new file mode 100644 index 00000000..fdba4a5c --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSNumericValue.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSNumericValue: CSSStyleValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSNumericValue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func add(values: CSSNumberish...) -> Self { + jsObject[Strings.add]!(values.jsValue()).fromJSValue()! + } + + public func sub(values: CSSNumberish...) -> Self { + jsObject[Strings.sub]!(values.jsValue()).fromJSValue()! + } + + public func mul(values: CSSNumberish...) -> Self { + jsObject[Strings.mul]!(values.jsValue()).fromJSValue()! + } + + public func div(values: CSSNumberish...) -> Self { + jsObject[Strings.div]!(values.jsValue()).fromJSValue()! + } + + public func min(values: CSSNumberish...) -> Self { + jsObject[Strings.min]!(values.jsValue()).fromJSValue()! + } + + public func max(values: CSSNumberish...) -> Self { + jsObject[Strings.max]!(values.jsValue()).fromJSValue()! + } + + public func equals(value: CSSNumberish...) -> Bool { + jsObject[Strings.equals]!(value.jsValue()).fromJSValue()! + } + + public func to(unit: String) -> CSSUnitValue { + jsObject[Strings.to]!(unit.jsValue()).fromJSValue()! + } + + public func toSum(units: String...) -> CSSMathSum { + jsObject[Strings.toSum]!(units.jsValue()).fromJSValue()! + } + + public func type() -> CSSNumericType { + jsObject[Strings.type]!().fromJSValue()! + } + + // XXX: illegal static override + // override public static func parse(cssText: String) -> Self +} diff --git a/Sources/DOMKit/WebIDL/CSSOKLCH.swift b/Sources/DOMKit/WebIDL/CSSOKLCH.swift new file mode 100644 index 00000000..e1182c88 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSOKLCH.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSOKLCH: CSSColorValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSOKLCH].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) + _c = ReadWriteAttribute(jsObject: jsObject, name: Strings.c) + _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) + _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var l: CSSColorPercent + + @ReadWriteAttribute + public var c: CSSColorPercent + + @ReadWriteAttribute + public var h: CSSColorAngle + + @ReadWriteAttribute + public var alpha: CSSColorPercent +} diff --git a/Sources/DOMKit/WebIDL/CSSOKLab.swift b/Sources/DOMKit/WebIDL/CSSOKLab.swift new file mode 100644 index 00000000..95c67393 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSOKLab.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSOKLab: CSSColorValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSOKLab].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) + _a = ReadWriteAttribute(jsObject: jsObject, name: Strings.a) + _b = ReadWriteAttribute(jsObject: jsObject, name: Strings.b) + _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var l: CSSColorPercent + + @ReadWriteAttribute + public var a: CSSColorNumber + + @ReadWriteAttribute + public var b: CSSColorNumber + + @ReadWriteAttribute + public var alpha: CSSColorPercent +} diff --git a/Sources/DOMKit/WebIDL/CSSPageRule.swift b/Sources/DOMKit/WebIDL/CSSPageRule.swift index 5dd56710..23c8c868 100644 --- a/Sources/DOMKit/WebIDL/CSSPageRule.swift +++ b/Sources/DOMKit/WebIDL/CSSPageRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSPageRule: CSSGroupingRule { - override public class var constructor: JSFunction { JSObject.global.CSSPageRule.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSPageRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) diff --git a/Sources/DOMKit/WebIDL/CSSParserAtRule.swift b/Sources/DOMKit/WebIDL/CSSParserAtRule.swift new file mode 100644 index 00000000..916e74b6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSParserAtRule.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSParserAtRule: CSSParserRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserAtRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _prelude = ReadonlyAttribute(jsObject: jsObject, name: Strings.prelude) + _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(name: String, prelude: [CSSToken], body: [CSSParserRule]? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(name.jsValue(), prelude.jsValue(), body?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var prelude: [CSSParserValue] + + @ReadonlyAttribute + public var body: [CSSParserRule]? + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSParserBlock.swift b/Sources/DOMKit/WebIDL/CSSParserBlock.swift new file mode 100644 index 00000000..ef349d8c --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSParserBlock.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSParserBlock: CSSParserValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserBlock].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(name: String, body: [CSSParserValue]) { + self.init(unsafelyWrapping: Self.constructor.new(name.jsValue(), body.jsValue())) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var body: [CSSParserValue] + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift b/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift new file mode 100644 index 00000000..9d84a746 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSParserDeclaration: CSSParserRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserDeclaration].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(name: String, body: [CSSParserRule]? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(name.jsValue(), body?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var body: [CSSParserValue] + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSParserFunction.swift b/Sources/DOMKit/WebIDL/CSSParserFunction.swift new file mode 100644 index 00000000..b74c36f3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSParserFunction.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSParserFunction: CSSParserValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserFunction].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _args = ReadonlyAttribute(jsObject: jsObject, name: Strings.args) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(name: String, args: [[CSSParserValue]]) { + self.init(unsafelyWrapping: Self.constructor.new(name.jsValue(), args.jsValue())) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var args: [[CSSParserValue]] + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSParserOptions.swift b/Sources/DOMKit/WebIDL/CSSParserOptions.swift new file mode 100644 index 00000000..36fe8d79 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSParserOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSParserOptions: BridgedDictionary { + public convenience init(atRules: JSObject) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.atRules] = atRules.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _atRules = ReadWriteAttribute(jsObject: object, name: Strings.atRules) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var atRules: JSObject +} diff --git a/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift b/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift new file mode 100644 index 00000000..23fe62d4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSParserQualifiedRule: CSSParserRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserQualifiedRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _prelude = ReadonlyAttribute(jsObject: jsObject, name: Strings.prelude) + _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(prelude: [CSSToken], body: [CSSParserRule]? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(prelude.jsValue(), body?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var prelude: [CSSParserValue] + + @ReadonlyAttribute + public var body: [CSSParserRule] + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSParserRule.swift b/Sources/DOMKit/WebIDL/CSSParserRule.swift new file mode 100644 index 00000000..9295c737 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSParserRule.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSParserRule: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CSSParserRule].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/CSSParserValue.swift b/Sources/DOMKit/WebIDL/CSSParserValue.swift new file mode 100644 index 00000000..d152bbd5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSParserValue.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSParserValue: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CSSParserValue].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/CSSPerspective.swift b/Sources/DOMKit/WebIDL/CSSPerspective.swift new file mode 100644 index 00000000..54d085c1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSPerspective.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSPerspective: CSSTransformComponent { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSPerspective].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadWriteAttribute(jsObject: jsObject, name: Strings.length) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(length: CSSPerspectiveValue) { + self.init(unsafelyWrapping: Self.constructor.new(length.jsValue())) + } + + @ReadWriteAttribute + public var length: CSSPerspectiveValue +} diff --git a/Sources/DOMKit/WebIDL/CSSPropertyRule.swift b/Sources/DOMKit/WebIDL/CSSPropertyRule.swift new file mode 100644 index 00000000..4ed90e52 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSPropertyRule.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSPropertyRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSPropertyRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _syntax = ReadonlyAttribute(jsObject: jsObject, name: Strings.syntax) + _inherits = ReadonlyAttribute(jsObject: jsObject, name: Strings.inherits) + _initialValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.initialValue) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var syntax: String + + @ReadonlyAttribute + public var inherits: Bool + + @ReadonlyAttribute + public var initialValue: String? +} diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift new file mode 100644 index 00000000..45144b76 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSPseudoElement: EventTarget, GeometryUtils { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSPseudoElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _element = ReadonlyAttribute(jsObject: jsObject, name: Strings.element) + _parent = ReadonlyAttribute(jsObject: jsObject, name: Strings.parent) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var type: String + + @ReadonlyAttribute + public var element: Element + + @ReadonlyAttribute + public var parent: __UNSUPPORTED_UNION__ + + public func pseudo(type: String) -> CSSPseudoElement? { + jsObject[Strings.pseudo]!(type.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSRGB.swift b/Sources/DOMKit/WebIDL/CSSRGB.swift new file mode 100644 index 00000000..6a263ad2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSRGB.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSRGB: CSSColorValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSRGB].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _r = ReadWriteAttribute(jsObject: jsObject, name: Strings.r) + _g = ReadWriteAttribute(jsObject: jsObject, name: Strings.g) + _b = ReadWriteAttribute(jsObject: jsObject, name: Strings.b) + _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(r: CSSColorRGBComp, g: CSSColorRGBComp, b: CSSColorRGBComp, alpha: CSSColorPercent? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(r.jsValue(), g.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var r: CSSColorRGBComp + + @ReadWriteAttribute + public var g: CSSColorRGBComp + + @ReadWriteAttribute + public var b: CSSColorRGBComp + + @ReadWriteAttribute + public var alpha: CSSColorPercent +} diff --git a/Sources/DOMKit/WebIDL/CSSRotate.swift b/Sources/DOMKit/WebIDL/CSSRotate.swift new file mode 100644 index 00000000..66d62a7e --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSRotate.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSRotate: CSSTransformComponent { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSRotate].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadWriteAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadWriteAttribute(jsObject: jsObject, name: Strings.z) + _angle = ReadWriteAttribute(jsObject: jsObject, name: Strings.angle) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(angle: CSSNumericValue) { + self.init(unsafelyWrapping: Self.constructor.new(angle.jsValue())) + } + + public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish, angle: CSSNumericValue) { + self.init(unsafelyWrapping: Self.constructor.new(x.jsValue(), y.jsValue(), z.jsValue(), angle.jsValue())) + } + + @ReadWriteAttribute + public var x: CSSNumberish + + @ReadWriteAttribute + public var y: CSSNumberish + + @ReadWriteAttribute + public var z: CSSNumberish + + @ReadWriteAttribute + public var angle: CSSNumericValue +} diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift index 5137db57..3cccc5fc 100644 --- a/Sources/DOMKit/WebIDL/CSSRule.swift +++ b/Sources/DOMKit/WebIDL/CSSRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSRule: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.CSSRule.function! } + public class var constructor: JSFunction { JSObject.global[Strings.CSSRule].function! } public let jsObject: JSObject @@ -16,6 +16,14 @@ public class CSSRule: JSBridgedClass { self.jsObject = jsObject } + public static let SUPPORTS_RULE: UInt16 = 12 + + public static let KEYFRAMES_RULE: UInt16 = 7 + + public static let KEYFRAME_RULE: UInt16 = 8 + + public static let FONT_FEATURE_VALUES_RULE: UInt16 = 14 + @ReadWriteAttribute public var cssText: String @@ -44,5 +52,7 @@ public class CSSRule: JSBridgedClass { public static let NAMESPACE_RULE: UInt16 = 10 - public static let SUPPORTS_RULE: UInt16 = 12 + public static let VIEWPORT_RULE: UInt16 = 15 + + public static let COUNTER_STYLE_RULE: UInt16 = 11 } diff --git a/Sources/DOMKit/WebIDL/CSSRuleList.swift b/Sources/DOMKit/WebIDL/CSSRuleList.swift index b4e6b5fc..6ec4a8c4 100644 --- a/Sources/DOMKit/WebIDL/CSSRuleList.swift +++ b/Sources/DOMKit/WebIDL/CSSRuleList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSRuleList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.CSSRuleList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.CSSRuleList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CSSScale.swift b/Sources/DOMKit/WebIDL/CSSScale.swift new file mode 100644 index 00000000..7e4fdb1e --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSScale.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSScale: CSSTransformComponent { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSScale].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadWriteAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadWriteAttribute(jsObject: jsObject, name: Strings.z) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var x: CSSNumberish + + @ReadWriteAttribute + public var y: CSSNumberish + + @ReadWriteAttribute + public var z: CSSNumberish +} diff --git a/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift b/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift new file mode 100644 index 00000000..b446d43e --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSScrollTimelineRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSScrollTimelineRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) + _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) + _scrollOffsets = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollOffsets) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var source: String + + @ReadonlyAttribute + public var orientation: String + + @ReadonlyAttribute + public var scrollOffsets: String +} diff --git a/Sources/DOMKit/WebIDL/CSSSkew.swift b/Sources/DOMKit/WebIDL/CSSSkew.swift new file mode 100644 index 00000000..bb77d06f --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSSkew.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSSkew: CSSTransformComponent { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkew].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _ax = ReadWriteAttribute(jsObject: jsObject, name: Strings.ax) + _ay = ReadWriteAttribute(jsObject: jsObject, name: Strings.ay) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(ax: CSSNumericValue, ay: CSSNumericValue) { + self.init(unsafelyWrapping: Self.constructor.new(ax.jsValue(), ay.jsValue())) + } + + @ReadWriteAttribute + public var ax: CSSNumericValue + + @ReadWriteAttribute + public var ay: CSSNumericValue +} diff --git a/Sources/DOMKit/WebIDL/CSSSkewX.swift b/Sources/DOMKit/WebIDL/CSSSkewX.swift new file mode 100644 index 00000000..ccd6dc7b --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSSkewX.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSSkewX: CSSTransformComponent { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkewX].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _ax = ReadWriteAttribute(jsObject: jsObject, name: Strings.ax) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(ax: CSSNumericValue) { + self.init(unsafelyWrapping: Self.constructor.new(ax.jsValue())) + } + + @ReadWriteAttribute + public var ax: CSSNumericValue +} diff --git a/Sources/DOMKit/WebIDL/CSSSkewY.swift b/Sources/DOMKit/WebIDL/CSSSkewY.swift new file mode 100644 index 00000000..a8789f2b --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSSkewY.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSSkewY: CSSTransformComponent { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkewY].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _ay = ReadWriteAttribute(jsObject: jsObject, name: Strings.ay) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(ay: CSSNumericValue) { + self.init(unsafelyWrapping: Self.constructor.new(ay.jsValue())) + } + + @ReadWriteAttribute + public var ay: CSSNumericValue +} diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift index 36d075bf..532811c2 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleDeclaration: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.CSSStyleDeclaration.function! } + public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleDeclaration].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift index 53f1270b..c0ebc90f 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -4,17 +4,33 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global.CSSStyleRule.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) + _styleMap = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleMap) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var cssRules: CSSRuleList + + public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { + jsObject[Strings.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteRule(index: UInt32) { + _ = jsObject[Strings.deleteRule]!(index.jsValue()) + } + @ReadWriteAttribute public var selectorText: String @ReadonlyAttribute public var style: CSSStyleDeclaration + + @ReadonlyAttribute + public var styleMap: StylePropertyMap } diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift index 1a1581e2..3df9a26d 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleSheet: StyleSheet { - override public class var constructor: JSFunction { JSObject.global.CSSStyleSheet.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleSheet].function! } public required init(unsafelyWrapping jsObject: JSObject) { _ownerRule = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerRule) diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift index f778e090..e05ef5ba 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class CSSStyleSheetInit: BridgedDictionary { public convenience init(baseURL: String, media: __UNSUPPORTED_UNION__, disabled: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.baseURL] = baseURL.jsValue() object[Strings.media] = media.jsValue() object[Strings.disabled] = disabled.jsValue() diff --git a/Sources/DOMKit/WebIDL/CSSStyleValue.swift b/Sources/DOMKit/WebIDL/CSSStyleValue.swift new file mode 100644 index 00000000..2c45aa13 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSStyleValue.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSStyleValue: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleValue].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } + + public static func parse(property: String, cssText: String) -> Self { + constructor[Strings.parse]!(property.jsValue(), cssText.jsValue()).fromJSValue()! + } + + public static func parseAll(property: String, cssText: String) -> [CSSStyleValue] { + constructor[Strings.parseAll]!(property.jsValue(), cssText.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift index e5bea67b..e3c09e1e 100644 --- a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift +++ b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSSupportsRule: CSSConditionRule { - override public class var constructor: JSFunction { JSObject.global.CSSSupportsRule.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CSSSupportsRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/CSSTransformComponent.swift b/Sources/DOMKit/WebIDL/CSSTransformComponent.swift new file mode 100644 index 00000000..e0ceb085 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSTransformComponent.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSTransformComponent: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CSSTransformComponent].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _is2D = ReadWriteAttribute(jsObject: jsObject, name: Strings.is2D) + self.jsObject = jsObject + } + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } + + @ReadWriteAttribute + public var is2D: Bool + + public func toMatrix() -> DOMMatrix { + jsObject[Strings.toMatrix]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSTransformValue.swift b/Sources/DOMKit/WebIDL/CSSTransformValue.swift new file mode 100644 index 00000000..8215f0e2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSTransformValue.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSTransformValue: CSSStyleValue, Sequence { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSTransformValue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _is2D = ReadonlyAttribute(jsObject: jsObject, name: Strings.is2D) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(transforms: [CSSTransformComponent]) { + self.init(unsafelyWrapping: Self.constructor.new(transforms.jsValue())) + } + + public typealias Element = CSSTransformComponent + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> CSSTransformComponent { + jsObject[key].fromJSValue()! + } + + // XXX: unsupported setter for keys of type UInt32 + + @ReadonlyAttribute + public var is2D: Bool + + public func toMatrix() -> DOMMatrix { + jsObject[Strings.toMatrix]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CSSTransition.swift b/Sources/DOMKit/WebIDL/CSSTransition.swift new file mode 100644 index 00000000..193cbc25 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSTransition.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSTransition: Animation { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSTransition].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _transitionProperty = ReadonlyAttribute(jsObject: jsObject, name: Strings.transitionProperty) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var transitionProperty: String +} diff --git a/Sources/DOMKit/WebIDL/CSSTranslate.swift b/Sources/DOMKit/WebIDL/CSSTranslate.swift new file mode 100644 index 00000000..55cd10c5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSTranslate.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSTranslate: CSSTransformComponent { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSTranslate].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadWriteAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadWriteAttribute(jsObject: jsObject, name: Strings.z) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(x: CSSNumericValue, y: CSSNumericValue, z: CSSNumericValue? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var x: CSSNumericValue + + @ReadWriteAttribute + public var y: CSSNumericValue + + @ReadWriteAttribute + public var z: CSSNumericValue +} diff --git a/Sources/DOMKit/WebIDL/CSSUnitValue.swift b/Sources/DOMKit/WebIDL/CSSUnitValue.swift new file mode 100644 index 00000000..576de37b --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSUnitValue.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSUnitValue: CSSNumericValue { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSUnitValue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _unit = ReadonlyAttribute(jsObject: jsObject, name: Strings.unit) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(value: Double, unit: String) { + self.init(unsafelyWrapping: Self.constructor.new(value.jsValue(), unit.jsValue())) + } + + @ReadWriteAttribute + public var value: Double + + @ReadonlyAttribute + public var unit: String +} diff --git a/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift b/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift new file mode 100644 index 00000000..7153fbaa --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSUnparsedValue: CSSStyleValue, Sequence { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSUnparsedValue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(members: [CSSUnparsedSegment]) { + self.init(unsafelyWrapping: Self.constructor.new(members.jsValue())) + } + + public typealias Element = CSSUnparsedSegment + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> CSSUnparsedSegment { + jsObject[key].fromJSValue()! + } + + // XXX: unsupported setter for keys of type UInt32 +} diff --git a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift new file mode 100644 index 00000000..6d7b1f09 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSVariableReferenceValue: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CSSVariableReferenceValue].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _variable = ReadWriteAttribute(jsObject: jsObject, name: Strings.variable) + _fallback = ReadonlyAttribute(jsObject: jsObject, name: Strings.fallback) + self.jsObject = jsObject + } + + public convenience init(variable: String, fallback: CSSUnparsedValue? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(variable.jsValue(), fallback?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var variable: String + + @ReadonlyAttribute + public var fallback: CSSUnparsedValue? +} diff --git a/Sources/DOMKit/WebIDL/CSSViewportRule.swift b/Sources/DOMKit/WebIDL/CSSViewportRule.swift new file mode 100644 index 00000000..b0a4a89a --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSViewportRule.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CSSViewportRule: CSSRule { + override public class var constructor: JSFunction { JSObject.global[Strings.CSSViewportRule].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var style: CSSStyleDeclaration +} diff --git a/Sources/DOMKit/WebIDL/Cache.swift b/Sources/DOMKit/WebIDL/Cache.swift new file mode 100644 index 00000000..b32dbcbb --- /dev/null +++ b/Sources/DOMKit/WebIDL/Cache.swift @@ -0,0 +1,84 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Cache: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Cache].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func match(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { + jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { + let _promise: JSPromise = jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { + jsObject[Strings.matchAll]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Response] { + let _promise: JSPromise = jsObject[Strings.matchAll]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func add(request: RequestInfo) -> JSPromise { + jsObject[Strings.add]!(request.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func add(request: RequestInfo) async throws { + let _promise: JSPromise = jsObject[Strings.add]!(request.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func addAll(requests: [RequestInfo]) -> JSPromise { + jsObject[Strings.addAll]!(requests.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func addAll(requests: [RequestInfo]) async throws { + let _promise: JSPromise = jsObject[Strings.addAll]!(requests.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func put(request: RequestInfo, response: Response) -> JSPromise { + jsObject[Strings.put]!(request.jsValue(), response.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func put(request: RequestInfo, response: Response) async throws { + let _promise: JSPromise = jsObject[Strings.put]!(request.jsValue(), response.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { + jsObject[Strings.delete]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.delete]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { + jsObject[Strings.keys]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Request] { + let _promise: JSPromise = jsObject[Strings.keys]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CacheQueryOptions.swift b/Sources/DOMKit/WebIDL/CacheQueryOptions.swift new file mode 100644 index 00000000..17647398 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CacheQueryOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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) + } + + 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) + } + + @ReadWriteAttribute + public var ignoreSearch: Bool + + @ReadWriteAttribute + public var ignoreMethod: Bool + + @ReadWriteAttribute + public var ignoreVary: Bool +} diff --git a/Sources/DOMKit/WebIDL/CacheStorage.swift b/Sources/DOMKit/WebIDL/CacheStorage.swift new file mode 100644 index 00000000..03dc978b --- /dev/null +++ b/Sources/DOMKit/WebIDL/CacheStorage.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CacheStorage: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CacheStorage].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) -> JSPromise { + jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { + let _promise: JSPromise = jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func has(cacheName: String) -> JSPromise { + jsObject[Strings.has]!(cacheName.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func has(cacheName: String) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.has]!(cacheName.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func open(cacheName: String) -> JSPromise { + jsObject[Strings.open]!(cacheName.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func open(cacheName: String) async throws -> Cache { + let _promise: JSPromise = jsObject[Strings.open]!(cacheName.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func delete(cacheName: String) -> JSPromise { + jsObject[Strings.delete]!(cacheName.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func delete(cacheName: String) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.delete]!(cacheName.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func keys() -> JSPromise { + jsObject[Strings.keys]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func keys() async throws -> [String] { + let _promise: JSPromise = jsObject[Strings.keys]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift b/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift new file mode 100644 index 00000000..d233be9d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift b/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift new file mode 100644 index 00000000..95d179ab --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CanMakePaymentEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.CanMakePaymentEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _topOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.topOrigin) + _paymentRequestOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentRequestOrigin) + _methodData = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodData) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: CanMakePaymentEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var topOrigin: String + + @ReadonlyAttribute + public var paymentRequestOrigin: String + + @ReadonlyAttribute + public var methodData: [PaymentMethodData] + + public func respondWith(canMakePaymentResponse: JSPromise) { + _ = jsObject[Strings.respondWith]!(canMakePaymentResponse.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift b/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift new file mode 100644 index 00000000..4516c70e --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CanMakePaymentEventInit: BridgedDictionary { + public convenience init(topOrigin: String, paymentRequestOrigin: String, methodData: [PaymentMethodData]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.topOrigin] = topOrigin.jsValue() + object[Strings.paymentRequestOrigin] = paymentRequestOrigin.jsValue() + object[Strings.methodData] = methodData.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _topOrigin = ReadWriteAttribute(jsObject: object, name: Strings.topOrigin) + _paymentRequestOrigin = ReadWriteAttribute(jsObject: object, name: Strings.paymentRequestOrigin) + _methodData = ReadWriteAttribute(jsObject: object, name: Strings.methodData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var topOrigin: String + + @ReadWriteAttribute + public var paymentRequestOrigin: String + + @ReadWriteAttribute + public var methodData: [PaymentMethodData] +} diff --git a/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift b/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift new file mode 100644 index 00000000..d7c0cb64 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CanvasCaptureMediaStreamTrack: MediaStreamTrack { + override public class var constructor: JSFunction { JSObject.global[Strings.CanvasCaptureMediaStreamTrack].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var canvas: HTMLCanvasElement + + public func requestFrame() { + _ = jsObject[Strings.requestFrame]!() + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFilter.swift b/Sources/DOMKit/WebIDL/CanvasFilter.swift index cea985b1..c796e198 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilter.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilter.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasFilter: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.CanvasFilter.function! } + public class var constructor: JSFunction { JSObject.global[Strings.CanvasFilter].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CanvasGradient.swift b/Sources/DOMKit/WebIDL/CanvasGradient.swift index f64bb4d6..5a7f2b18 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasGradient: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.CanvasGradient.function! } + public class var constructor: JSFunction { JSObject.global[Strings.CanvasGradient].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CanvasPattern.swift b/Sources/DOMKit/WebIDL/CanvasPattern.swift index e41f4b3b..9903f9de 100644 --- a/Sources/DOMKit/WebIDL/CanvasPattern.swift +++ b/Sources/DOMKit/WebIDL/CanvasPattern.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasPattern: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.CanvasPattern.function! } + public class var constructor: JSFunction { JSObject.global[Strings.CanvasPattern].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift index 7cb568cf..036223eb 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { - public class var constructor: JSFunction { JSObject.global.CanvasRenderingContext2D.function! } + public class var constructor: JSFunction { JSObject.global[Strings.CanvasRenderingContext2D].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift index 1a61ca15..eac37c5d 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class CanvasRenderingContext2DSettings: BridgedDictionary { public convenience init(alpha: Bool, desynchronized: Bool, colorSpace: PredefinedColorSpace, willReadFrequently: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.alpha] = alpha.jsValue() object[Strings.desynchronized] = desynchronized.jsValue() object[Strings.colorSpace] = colorSpace.jsValue() diff --git a/Sources/DOMKit/WebIDL/CaretPosition.swift b/Sources/DOMKit/WebIDL/CaretPosition.swift new file mode 100644 index 00000000..8f9dce26 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CaretPosition.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CaretPosition: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CaretPosition].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _offsetNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetNode) + _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var offsetNode: Node + + @ReadonlyAttribute + public var offset: UInt32 + + public func getClientRect() -> DOMRect? { + jsObject[Strings.getClientRect]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ChannelCountMode.swift b/Sources/DOMKit/WebIDL/ChannelCountMode.swift new file mode 100644 index 00000000..19d0f422 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ChannelCountMode.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ChannelCountMode: JSString, JSValueCompatible { + case max = "max" + case clampedMax = "clamped-max" + case explicit = "explicit" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ChannelInterpretation.swift b/Sources/DOMKit/WebIDL/ChannelInterpretation.swift new file mode 100644 index 00000000..72fd9c42 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ChannelInterpretation.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ChannelInterpretation: JSString, JSValueCompatible { + case speakers = "speakers" + case discrete = "discrete" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ChannelMergerNode.swift b/Sources/DOMKit/WebIDL/ChannelMergerNode.swift new file mode 100644 index 00000000..ef442c74 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ChannelMergerNode.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ChannelMergerNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.ChannelMergerNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: ChannelMergerOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift b/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift new file mode 100644 index 00000000..aa9decee --- /dev/null +++ b/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ChannelMergerOptions: BridgedDictionary { + public convenience init(numberOfInputs: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.numberOfInputs] = numberOfInputs.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _numberOfInputs = ReadWriteAttribute(jsObject: object, name: Strings.numberOfInputs) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var numberOfInputs: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift b/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift new file mode 100644 index 00000000..a1d8d979 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ChannelSplitterNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.ChannelSplitterNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: ChannelSplitterOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift b/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift new file mode 100644 index 00000000..d10365e1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ChannelSplitterOptions: BridgedDictionary { + public convenience init(numberOfOutputs: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.numberOfOutputs] = numberOfOutputs.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _numberOfOutputs = ReadWriteAttribute(jsObject: object, name: Strings.numberOfOutputs) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var numberOfOutputs: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift new file mode 100644 index 00000000..d8bec0e1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CharacterBoundsUpdateEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.CharacterBoundsUpdateEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _rangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeStart) + _rangeEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeEnd) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: CharacterBoundsUpdateEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var rangeStart: UInt32 + + @ReadonlyAttribute + public var rangeEnd: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift new file mode 100644 index 00000000..7f11e5b8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CharacterBoundsUpdateEventInit: BridgedDictionary { + public convenience init(rangeStart: UInt32, rangeEnd: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.rangeStart] = rangeStart.jsValue() + object[Strings.rangeEnd] = rangeEnd.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _rangeStart = ReadWriteAttribute(jsObject: object, name: Strings.rangeStart) + _rangeEnd = ReadWriteAttribute(jsObject: object, name: Strings.rangeEnd) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var rangeStart: UInt32 + + @ReadWriteAttribute + public var rangeEnd: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/CharacterData.swift b/Sources/DOMKit/WebIDL/CharacterData.swift index 03a8d56c..4ee2df6c 100644 --- a/Sources/DOMKit/WebIDL/CharacterData.swift +++ b/Sources/DOMKit/WebIDL/CharacterData.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { - override public class var constructor: JSFunction { JSObject.global.CharacterData.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CharacterData].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) diff --git a/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift b/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift new file mode 100644 index 00000000..2b219ca2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CharacteristicEventHandlers: JSBridgedClass {} +public extension CharacteristicEventHandlers { + var oncharacteristicvaluechanged: EventHandler { + get { ClosureAttribute.Optional1[Strings.oncharacteristicvaluechanged, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.oncharacteristicvaluechanged, in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/ChildBreakToken.swift b/Sources/DOMKit/WebIDL/ChildBreakToken.swift new file mode 100644 index 00000000..14bd49b0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ChildBreakToken.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ChildBreakToken: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ChildBreakToken].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _breakType = ReadonlyAttribute(jsObject: jsObject, name: Strings.breakType) + _child = ReadonlyAttribute(jsObject: jsObject, name: Strings.child) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var breakType: BreakType + + @ReadonlyAttribute + public var child: LayoutChild +} diff --git a/Sources/DOMKit/WebIDL/ChildDisplayType.swift b/Sources/DOMKit/WebIDL/ChildDisplayType.swift new file mode 100644 index 00000000..dd67107e --- /dev/null +++ b/Sources/DOMKit/WebIDL/ChildDisplayType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ChildDisplayType: JSString, JSValueCompatible { + case block = "block" + case normal = "normal" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Client.swift b/Sources/DOMKit/WebIDL/Client.swift new file mode 100644 index 00000000..bcc64716 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Client.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Client: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Client].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _frameType = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameType) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _lifecycleState = ReadonlyAttribute(jsObject: jsObject, name: Strings.lifecycleState) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var frameType: FrameType + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var type: ClientType + + public func postMessage(message: JSValue, transfer: [JSObject]) { + _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) + } + + public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + } + + @ReadonlyAttribute + public var lifecycleState: ClientLifecycleState +} diff --git a/Sources/DOMKit/WebIDL/ClientLifecycleState.swift b/Sources/DOMKit/WebIDL/ClientLifecycleState.swift new file mode 100644 index 00000000..0d01d9b4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ClientLifecycleState.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ClientLifecycleState: JSString, JSValueCompatible { + case active = "active" + case frozen = "frozen" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ClientQueryOptions.swift b/Sources/DOMKit/WebIDL/ClientQueryOptions.swift new file mode 100644 index 00000000..6f925ff7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ClientQueryOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/ClientType.swift b/Sources/DOMKit/WebIDL/ClientType.swift new file mode 100644 index 00000000..017ddf49 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ClientType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ClientType: JSString, JSValueCompatible { + case window = "window" + case worker = "worker" + case sharedworker = "sharedworker" + case all = "all" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Clients.swift b/Sources/DOMKit/WebIDL/Clients.swift new file mode 100644 index 00000000..01f94c49 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Clients.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Clients: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Clients].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func get(id: String) -> JSPromise { + jsObject[Strings.get]!(id.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func get(id: String) async throws -> __UNSUPPORTED_UNION__ { + let _promise: JSPromise = jsObject[Strings.get]!(id.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func matchAll(options: ClientQueryOptions? = nil) -> JSPromise { + jsObject[Strings.matchAll]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func matchAll(options: ClientQueryOptions? = nil) async throws -> [Client] { + let _promise: JSPromise = jsObject[Strings.matchAll]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func openWindow(url: String) -> JSPromise { + jsObject[Strings.openWindow]!(url.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func openWindow(url: String) async throws -> WindowClient? { + let _promise: JSPromise = jsObject[Strings.openWindow]!(url.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func claim() -> JSPromise { + jsObject[Strings.claim]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func claim() async throws { + let _promise: JSPromise = jsObject[Strings.claim]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/Clipboard.swift b/Sources/DOMKit/WebIDL/Clipboard.swift new file mode 100644 index 00000000..f247347f --- /dev/null +++ b/Sources/DOMKit/WebIDL/Clipboard.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Clipboard: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.Clipboard].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func read() -> JSPromise { + jsObject[Strings.read]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func read() async throws -> ClipboardItems { + let _promise: JSPromise = jsObject[Strings.read]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func readText() -> JSPromise { + jsObject[Strings.readText]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func readText() async throws -> String { + let _promise: JSPromise = jsObject[Strings.readText]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func write(data: ClipboardItems) -> JSPromise { + jsObject[Strings.write]!(data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func write(data: ClipboardItems) async throws { + let _promise: JSPromise = jsObject[Strings.write]!(data.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func writeText(data: String) -> JSPromise { + jsObject[Strings.writeText]!(data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func writeText(data: String) async throws { + let _promise: JSPromise = jsObject[Strings.writeText]!(data.jsValue()).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/ClipboardEvent.swift b/Sources/DOMKit/WebIDL/ClipboardEvent.swift new file mode 100644 index 00000000..deb61442 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ClipboardEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ClipboardEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.ClipboardEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _clipboardData = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipboardData) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: ClipboardEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var clipboardData: DataTransfer? +} diff --git a/Sources/DOMKit/WebIDL/ClipboardEventInit.swift b/Sources/DOMKit/WebIDL/ClipboardEventInit.swift new file mode 100644 index 00000000..03a5e7ac --- /dev/null +++ b/Sources/DOMKit/WebIDL/ClipboardEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ClipboardEventInit: BridgedDictionary { + public convenience init(clipboardData: DataTransfer?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.clipboardData] = clipboardData.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _clipboardData = ReadWriteAttribute(jsObject: object, name: Strings.clipboardData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var clipboardData: DataTransfer? +} diff --git a/Sources/DOMKit/WebIDL/ClipboardItem.swift b/Sources/DOMKit/WebIDL/ClipboardItem.swift new file mode 100644 index 00000000..482893bd --- /dev/null +++ b/Sources/DOMKit/WebIDL/ClipboardItem.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ClipboardItem: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ClipboardItem].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _presentationStyle = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentationStyle) + _types = ReadonlyAttribute(jsObject: jsObject, name: Strings.types) + self.jsObject = jsObject + } + + public convenience init(items: [String: ClipboardItemData], options: ClipboardItemOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(items.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var presentationStyle: PresentationStyle + + @ReadonlyAttribute + public var types: [String] + + public func getType(type: String) -> JSPromise { + jsObject[Strings.getType]!(type.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getType(type: String) async throws -> Blob { + let _promise: JSPromise = jsObject[Strings.getType]!(type.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift b/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift new file mode 100644 index 00000000..ec97b76f --- /dev/null +++ b/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ClipboardItemOptions: BridgedDictionary { + public convenience init(presentationStyle: PresentationStyle) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.presentationStyle] = presentationStyle.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _presentationStyle = ReadWriteAttribute(jsObject: object, name: Strings.presentationStyle) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var presentationStyle: PresentationStyle +} diff --git a/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift new file mode 100644 index 00000000..ea5de3b7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ClipboardPermissionDescriptor: BridgedDictionary { + public convenience init(allowWithoutGesture: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.allowWithoutGesture] = allowWithoutGesture.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _allowWithoutGesture = ReadWriteAttribute(jsObject: object, name: Strings.allowWithoutGesture) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var allowWithoutGesture: Bool +} diff --git a/Sources/DOMKit/WebIDL/CloseEvent.swift b/Sources/DOMKit/WebIDL/CloseEvent.swift new file mode 100644 index 00000000..6d7aff31 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CloseEvent.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CloseEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.CloseEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _wasClean = ReadonlyAttribute(jsObject: jsObject, name: Strings.wasClean) + _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) + _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: CloseEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var wasClean: Bool + + @ReadonlyAttribute + public var code: UInt16 + + @ReadonlyAttribute + public var reason: String +} diff --git a/Sources/DOMKit/WebIDL/CloseEventInit.swift b/Sources/DOMKit/WebIDL/CloseEventInit.swift new file mode 100644 index 00000000..66b8a3b2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CloseEventInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CloseEventInit: BridgedDictionary { + public convenience init(wasClean: Bool, code: UInt16, reason: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.wasClean] = wasClean.jsValue() + object[Strings.code] = code.jsValue() + object[Strings.reason] = reason.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _wasClean = ReadWriteAttribute(jsObject: object, name: Strings.wasClean) + _code = ReadWriteAttribute(jsObject: object, name: Strings.code) + _reason = ReadWriteAttribute(jsObject: object, name: Strings.reason) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var wasClean: Bool + + @ReadWriteAttribute + public var code: UInt16 + + @ReadWriteAttribute + public var reason: String +} diff --git a/Sources/DOMKit/WebIDL/CloseWatcher.swift b/Sources/DOMKit/WebIDL/CloseWatcher.swift new file mode 100644 index 00000000..c4533fb1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CloseWatcher.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CloseWatcher: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.CloseWatcher].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _oncancel = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncancel) + _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: CloseWatcherOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + public func destroy() { + _ = jsObject[Strings.destroy]!() + } + + public func close() { + _ = jsObject[Strings.close]!() + } + + @ClosureAttribute.Optional1 + public var oncancel: EventHandler + + @ClosureAttribute.Optional1 + public var onclose: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift b/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift new file mode 100644 index 00000000..bf858075 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CloseWatcherOptions: BridgedDictionary { + public convenience init(signal: AbortSignal) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.signal] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var signal: AbortSignal +} diff --git a/Sources/DOMKit/WebIDL/ClosureAttribute.swift b/Sources/DOMKit/WebIDL/ClosureAttribute.swift index 0d147348..5f61e7ba 100644 --- a/Sources/DOMKit/WebIDL/ClosureAttribute.swift +++ b/Sources/DOMKit/WebIDL/ClosureAttribute.swift @@ -94,6 +94,35 @@ public enum ClosureAttribute { } } + @propertyWrapper public final class Required3 + where A0: JSValueCompatible, A1: JSValueCompatible, A2: 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, A2) -> ReturnType { + get { Required3[name, in: jsObject] } + set { Required3[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2) -> ReturnType { + get { + let function = jsObject[name].function! + return { function($0.jsValue(), $1.jsValue(), $2.jsValue()).fromJSValue()! } + } + set { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue() + }.jsValue() + } + } + } + @propertyWrapper public final class Required5 where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible { @@ -230,6 +259,41 @@ public enum ClosureAttribute { } } + @propertyWrapper public final class Optional3 + where A0: JSValueCompatible, A1: JSValueCompatible, A2: 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, A2) -> ReturnType)? { + get { Optional3[name, in: jsObject] } + set { Optional3[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1, A2) -> ReturnType)? { + get { + guard let function = jsObject[name].function else { + return nil + } + return { function($0.jsValue(), $1.jsValue(), $2.jsValue()).fromJSValue()! } + } + set { + if let newValue = newValue { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue() + }.jsValue() + } else { + jsObject[name] = .null + } + } + } + } + @propertyWrapper public final class Optional5 where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible { diff --git a/Sources/DOMKit/WebIDL/CodecState.swift b/Sources/DOMKit/WebIDL/CodecState.swift new file mode 100644 index 00000000..4bdbf93e --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift b/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift new file mode 100644 index 00000000..3bacd4eb --- /dev/null +++ b/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CollectedClientAdditionalPaymentData: BridgedDictionary { + public convenience init(rp: String, topOrigin: String, payeeOrigin: String, total: PaymentCurrencyAmount, instrument: PaymentCredentialInstrument) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.rp] = rp.jsValue() + object[Strings.topOrigin] = topOrigin.jsValue() + object[Strings.payeeOrigin] = payeeOrigin.jsValue() + object[Strings.total] = total.jsValue() + object[Strings.instrument] = instrument.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _rp = ReadWriteAttribute(jsObject: object, name: Strings.rp) + _topOrigin = ReadWriteAttribute(jsObject: object, name: Strings.topOrigin) + _payeeOrigin = ReadWriteAttribute(jsObject: object, name: Strings.payeeOrigin) + _total = ReadWriteAttribute(jsObject: object, name: Strings.total) + _instrument = ReadWriteAttribute(jsObject: object, name: Strings.instrument) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var rp: String + + @ReadWriteAttribute + public var topOrigin: String + + @ReadWriteAttribute + public var payeeOrigin: String + + @ReadWriteAttribute + public var total: PaymentCurrencyAmount + + @ReadWriteAttribute + public var instrument: PaymentCredentialInstrument +} diff --git a/Sources/DOMKit/WebIDL/CollectedClientData.swift b/Sources/DOMKit/WebIDL/CollectedClientData.swift new file mode 100644 index 00000000..f4e9ab49 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CollectedClientData.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CollectedClientData: BridgedDictionary { + public convenience init(type: String, challenge: String, origin: String, crossOrigin: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.challenge] = challenge.jsValue() + object[Strings.origin] = origin.jsValue() + object[Strings.crossOrigin] = crossOrigin.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _challenge = ReadWriteAttribute(jsObject: object, name: Strings.challenge) + _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) + _crossOrigin = ReadWriteAttribute(jsObject: object, name: Strings.crossOrigin) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var challenge: String + + @ReadWriteAttribute + public var origin: String + + @ReadWriteAttribute + public var crossOrigin: Bool +} diff --git a/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift b/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift new file mode 100644 index 00000000..99439f4d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CollectedClientPaymentData: BridgedDictionary { + public convenience init(payment: CollectedClientAdditionalPaymentData) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.payment] = payment.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _payment = ReadWriteAttribute(jsObject: object, name: Strings.payment) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var payment: CollectedClientAdditionalPaymentData +} diff --git a/Sources/DOMKit/WebIDL/ColorGamut.swift b/Sources/DOMKit/WebIDL/ColorGamut.swift new file mode 100644 index 00000000..2d733050 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ColorGamut.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ColorGamut: JSString, JSValueCompatible { + case srgb = "srgb" + case p3 = "p3" + case rec2020 = "rec2020" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ColorSelectionOptions.swift b/Sources/DOMKit/WebIDL/ColorSelectionOptions.swift new file mode 100644 index 00000000..6891aefa --- /dev/null +++ b/Sources/DOMKit/WebIDL/ColorSelectionOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ColorSelectionOptions: BridgedDictionary { + public convenience init(signal: AbortSignal) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.signal] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var signal: AbortSignal +} diff --git a/Sources/DOMKit/WebIDL/ColorSelectionResult.swift b/Sources/DOMKit/WebIDL/ColorSelectionResult.swift new file mode 100644 index 00000000..5d212201 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ColorSelectionResult.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ColorSelectionResult: BridgedDictionary { + public convenience init(sRGBHex: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.sRGBHex] = sRGBHex.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _sRGBHex = ReadWriteAttribute(jsObject: object, name: Strings.sRGBHex) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var sRGBHex: String +} diff --git a/Sources/DOMKit/WebIDL/Comment.swift b/Sources/DOMKit/WebIDL/Comment.swift index bce14aa1..3a3cc62d 100644 --- a/Sources/DOMKit/WebIDL/Comment.swift +++ b/Sources/DOMKit/WebIDL/Comment.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Comment: CharacterData { - override public class var constructor: JSFunction { JSObject.global.Comment.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.Comment].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/CompositeOperation.swift b/Sources/DOMKit/WebIDL/CompositeOperation.swift new file mode 100644 index 00000000..ce31f3aa --- /dev/null +++ b/Sources/DOMKit/WebIDL/CompositeOperation.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CompositeOperation: JSString, JSValueCompatible { + case replace = "replace" + case add = "add" + case accumulate = "accumulate" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift new file mode 100644 index 00000000..73679c54 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CompositeOperationOrAuto: JSString, JSValueCompatible { + case replace = "replace" + case add = "add" + case accumulate = "accumulate" + case auto = "auto" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index e51c4331..cd6c8fea 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CompositionEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global.CompositionEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CompositionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) diff --git a/Sources/DOMKit/WebIDL/CompositionEventInit.swift b/Sources/DOMKit/WebIDL/CompositionEventInit.swift index f6bbaa20..35751d53 100644 --- a/Sources/DOMKit/WebIDL/CompositionEventInit.swift +++ b/Sources/DOMKit/WebIDL/CompositionEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class CompositionEventInit: BridgedDictionary { public convenience init(data: String) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.data] = data.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CompressionStream.swift b/Sources/DOMKit/WebIDL/CompressionStream.swift new file mode 100644 index 00000000..ebf9fb7d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CompressionStream.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CompressionStream: JSBridgedClass, GenericTransformStream { + public class var constructor: JSFunction { JSObject.global[Strings.CompressionStream].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(format: String) { + self.init(unsafelyWrapping: Self.constructor.new(format.jsValue())) + } +} diff --git a/Sources/DOMKit/WebIDL/ComputePressureFactor.swift b/Sources/DOMKit/WebIDL/ComputePressureFactor.swift new file mode 100644 index 00000000..337fc722 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ComputePressureFactor.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ComputePressureFactor: JSString, JSValueCompatible { + case thermal = "thermal" + case powerSupply = "power-supply" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift new file mode 100644 index 00000000..3f45b6ee --- /dev/null +++ b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ComputePressureObserver: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ComputePressureObserver].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _supportedSources = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedSources) + self.jsObject = jsObject + } + + public convenience init(callback: ComputePressureUpdateCallback, options: ComputePressureObserverOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue(), options?.jsValue() ?? .undefined)) + } + + public func observe(source: ComputePressureSource) { + _ = jsObject[Strings.observe]!(source.jsValue()) + } + + public func unobserve(source: ComputePressureSource) { + _ = jsObject[Strings.unobserve]!(source.jsValue()) + } + + public func disconnect() { + _ = jsObject[Strings.disconnect]!() + } + + public func takeRecords() -> [ComputePressureRecord] { + jsObject[Strings.takeRecords]!().fromJSValue()! + } + + @ReadonlyAttribute + public var supportedSources: [ComputePressureSource] + + public static func requestPermission() -> JSPromise { + constructor[Strings.requestPermission]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func requestPermission() async throws -> PermissionState { + let _promise: JSPromise = constructor[Strings.requestPermission]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift b/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift new file mode 100644 index 00000000..bdc8f5a0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ComputePressureObserverOptions: BridgedDictionary { + public convenience init(frequency: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.frequency] = frequency.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var frequency: Double +} diff --git a/Sources/DOMKit/WebIDL/ComputePressureRecord.swift b/Sources/DOMKit/WebIDL/ComputePressureRecord.swift new file mode 100644 index 00000000..0a344e01 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ComputePressureRecord.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ComputePressureRecord: BridgedDictionary { + public convenience init(source: ComputePressureSource, state: ComputePressureState, factors: [ComputePressureFactor], time: DOMHighResTimeStamp) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.source] = source.jsValue() + object[Strings.state] = state.jsValue() + object[Strings.factors] = factors.jsValue() + object[Strings.time] = time.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _source = ReadWriteAttribute(jsObject: object, name: Strings.source) + _state = ReadWriteAttribute(jsObject: object, name: Strings.state) + _factors = ReadWriteAttribute(jsObject: object, name: Strings.factors) + _time = ReadWriteAttribute(jsObject: object, name: Strings.time) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var source: ComputePressureSource + + @ReadWriteAttribute + public var state: ComputePressureState + + @ReadWriteAttribute + public var factors: [ComputePressureFactor] + + @ReadWriteAttribute + public var time: DOMHighResTimeStamp +} diff --git a/Sources/DOMKit/WebIDL/ComputePressureSource.swift b/Sources/DOMKit/WebIDL/ComputePressureSource.swift new file mode 100644 index 00000000..84276a5e --- /dev/null +++ b/Sources/DOMKit/WebIDL/ComputePressureSource.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ComputePressureSource: JSString, JSValueCompatible { + case cpu = "cpu" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ComputePressureState.swift b/Sources/DOMKit/WebIDL/ComputePressureState.swift new file mode 100644 index 00000000..70ad1f99 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ComputePressureState.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ComputePressureState: JSString, JSValueCompatible { + case nominal = "nominal" + case fair = "fair" + case serious = "serious" + case critical = "critical" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift new file mode 100644 index 00000000..e91a4365 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ComputedEffectTiming: BridgedDictionary { + public convenience init(startTime: CSSNumberish, endTime: CSSNumberish, activeDuration: CSSNumberish, localTime: CSSNumberish?, progress: Double?, currentIteration: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.startTime] = startTime.jsValue() + object[Strings.endTime] = endTime.jsValue() + object[Strings.activeDuration] = activeDuration.jsValue() + object[Strings.localTime] = localTime.jsValue() + object[Strings.progress] = progress.jsValue() + object[Strings.currentIteration] = currentIteration.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _startTime = ReadWriteAttribute(jsObject: object, name: Strings.startTime) + _endTime = ReadWriteAttribute(jsObject: object, name: Strings.endTime) + _activeDuration = ReadWriteAttribute(jsObject: object, name: Strings.activeDuration) + _localTime = ReadWriteAttribute(jsObject: object, name: Strings.localTime) + _progress = ReadWriteAttribute(jsObject: object, name: Strings.progress) + _currentIteration = ReadWriteAttribute(jsObject: object, name: Strings.currentIteration) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var startTime: CSSNumberish + + @ReadWriteAttribute + public var endTime: CSSNumberish + + @ReadWriteAttribute + public var activeDuration: CSSNumberish + + @ReadWriteAttribute + public var localTime: CSSNumberish? + + @ReadWriteAttribute + public var progress: Double? + + @ReadWriteAttribute + public var currentIteration: Double? +} diff --git a/Sources/DOMKit/WebIDL/ConnectionType.swift b/Sources/DOMKit/WebIDL/ConnectionType.swift new file mode 100644 index 00000000..28222503 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConnectionType.swift @@ -0,0 +1,29 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ConnectionType: JSString, JSValueCompatible { + case bluetooth = "bluetooth" + case cellular = "cellular" + case ethernet = "ethernet" + case mixed = "mixed" + case none = "none" + case other = "other" + case unknown = "unknown" + case wifi = "wifi" + case wimax = "wimax" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ConstantSourceNode.swift b/Sources/DOMKit/WebIDL/ConstantSourceNode.swift new file mode 100644 index 00000000..e53b9e9d --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstantSourceNode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ConstantSourceNode: AudioScheduledSourceNode { + override public class var constructor: JSFunction { JSObject.global[Strings.ConstantSourceNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: ConstantSourceOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var offset: AudioParam +} diff --git a/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift b/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift new file mode 100644 index 00000000..906ae7b9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ConstantSourceOptions: BridgedDictionary { + public convenience init(offset: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.offset] = offset.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var offset: Float +} diff --git a/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift b/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift new file mode 100644 index 00000000..28cc952e --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift b/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift new file mode 100644 index 00000000..0d9cba58 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ConstrainDOMStringParameters: BridgedDictionary { + public convenience init(exact: __UNSUPPORTED_UNION__, ideal: __UNSUPPORTED_UNION__) { + 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: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var ideal: __UNSUPPORTED_UNION__ +} diff --git a/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift b/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift new file mode 100644 index 00000000..1046449d --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift b/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift new file mode 100644 index 00000000..865d0b29 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ConstrainPoint2DParameters: BridgedDictionary { + public convenience init(exact: [Point2D], ideal: [Point2D]) { + 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: [Point2D] + + @ReadWriteAttribute + public var ideal: [Point2D] +} diff --git a/Sources/DOMKit/WebIDL/ConstrainULongRange.swift b/Sources/DOMKit/WebIDL/ConstrainULongRange.swift new file mode 100644 index 00000000..61ce0f06 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstrainULongRange.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/ContactAddress.swift b/Sources/DOMKit/WebIDL/ContactAddress.swift new file mode 100644 index 00000000..e2c4db57 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContactAddress.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ContactAddress: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ContactAddress].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _city = ReadonlyAttribute(jsObject: jsObject, name: Strings.city) + _country = ReadonlyAttribute(jsObject: jsObject, name: Strings.country) + _dependentLocality = ReadonlyAttribute(jsObject: jsObject, name: Strings.dependentLocality) + _organization = ReadonlyAttribute(jsObject: jsObject, name: Strings.organization) + _phone = ReadonlyAttribute(jsObject: jsObject, name: Strings.phone) + _postalCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.postalCode) + _recipient = ReadonlyAttribute(jsObject: jsObject, name: Strings.recipient) + _region = ReadonlyAttribute(jsObject: jsObject, name: Strings.region) + _sortingCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.sortingCode) + _addressLine = ReadonlyAttribute(jsObject: jsObject, name: Strings.addressLine) + self.jsObject = jsObject + } + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + @ReadonlyAttribute + public var city: String + + @ReadonlyAttribute + public var country: String + + @ReadonlyAttribute + public var dependentLocality: String + + @ReadonlyAttribute + public var organization: String + + @ReadonlyAttribute + public var phone: String + + @ReadonlyAttribute + public var postalCode: String + + @ReadonlyAttribute + public var recipient: String + + @ReadonlyAttribute + public var region: String + + @ReadonlyAttribute + public var sortingCode: String + + @ReadonlyAttribute + public var addressLine: [String] +} diff --git a/Sources/DOMKit/WebIDL/ContactInfo.swift b/Sources/DOMKit/WebIDL/ContactInfo.swift new file mode 100644 index 00000000..67b673b0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContactInfo.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ContactInfo: BridgedDictionary { + public convenience init(address: [ContactAddress], email: [String], icon: [Blob], name: [String], tel: [String]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.address] = address.jsValue() + object[Strings.email] = email.jsValue() + object[Strings.icon] = icon.jsValue() + object[Strings.name] = name.jsValue() + object[Strings.tel] = tel.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _address = ReadWriteAttribute(jsObject: object, name: Strings.address) + _email = ReadWriteAttribute(jsObject: object, name: Strings.email) + _icon = ReadWriteAttribute(jsObject: object, name: Strings.icon) + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _tel = ReadWriteAttribute(jsObject: object, name: Strings.tel) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var address: [ContactAddress] + + @ReadWriteAttribute + public var email: [String] + + @ReadWriteAttribute + public var icon: [Blob] + + @ReadWriteAttribute + public var name: [String] + + @ReadWriteAttribute + public var tel: [String] +} diff --git a/Sources/DOMKit/WebIDL/ContactProperty.swift b/Sources/DOMKit/WebIDL/ContactProperty.swift new file mode 100644 index 00000000..b57de34f --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContactProperty.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ContactProperty: JSString, JSValueCompatible { + case address = "address" + case email = "email" + case icon = "icon" + case name = "name" + case tel = "tel" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ContactsManager.swift b/Sources/DOMKit/WebIDL/ContactsManager.swift new file mode 100644 index 00000000..fd94bdfa --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContactsManager.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ContactsManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ContactsManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func getProperties() -> JSPromise { + jsObject[Strings.getProperties]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getProperties() async throws -> [ContactProperty] { + let _promise: JSPromise = jsObject[Strings.getProperties]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) -> JSPromise { + jsObject[Strings.select]!(properties.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) async throws -> [ContactInfo] { + let _promise: JSPromise = jsObject[Strings.select]!(properties.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift b/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift new file mode 100644 index 00000000..23c0336f --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ContactsSelectOptions: BridgedDictionary { + public convenience init(multiple: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.multiple] = multiple.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _multiple = ReadWriteAttribute(jsObject: object, name: Strings.multiple) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var multiple: Bool +} diff --git a/Sources/DOMKit/WebIDL/ContentCategory.swift b/Sources/DOMKit/WebIDL/ContentCategory.swift new file mode 100644 index 00000000..5655585d --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContentCategory.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ContentCategory: JSString, JSValueCompatible { + case _empty = "" + case homepage = "homepage" + case article = "article" + case video = "video" + case audio = "audio" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ContentDescription.swift b/Sources/DOMKit/WebIDL/ContentDescription.swift new file mode 100644 index 00000000..c09f01b0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContentDescription.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ContentDescription: BridgedDictionary { + public convenience init(id: String, title: String, description: String, category: ContentCategory, icons: [ImageResource], url: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.id] = id.jsValue() + object[Strings.title] = title.jsValue() + object[Strings.description] = description.jsValue() + object[Strings.category] = category.jsValue() + object[Strings.icons] = icons.jsValue() + object[Strings.url] = url.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _title = ReadWriteAttribute(jsObject: object, name: Strings.title) + _description = ReadWriteAttribute(jsObject: object, name: Strings.description) + _category = ReadWriteAttribute(jsObject: object, name: Strings.category) + _icons = ReadWriteAttribute(jsObject: object, name: Strings.icons) + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var title: String + + @ReadWriteAttribute + public var description: String + + @ReadWriteAttribute + public var category: ContentCategory + + @ReadWriteAttribute + public var icons: [ImageResource] + + @ReadWriteAttribute + public var url: String +} diff --git a/Sources/DOMKit/WebIDL/ContentIndex.swift b/Sources/DOMKit/WebIDL/ContentIndex.swift new file mode 100644 index 00000000..a733231c --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContentIndex.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ContentIndex: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ContentIndex].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func add(description: ContentDescription) -> JSPromise { + jsObject[Strings.add]!(description.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func add(description: ContentDescription) async throws { + let _promise: JSPromise = jsObject[Strings.add]!(description.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func delete(id: String) -> JSPromise { + jsObject[Strings.delete]!(id.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func delete(id: String) async throws { + let _promise: JSPromise = jsObject[Strings.delete]!(id.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func getAll() -> JSPromise { + jsObject[Strings.getAll]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getAll() async throws -> [ContentDescription] { + let _promise: JSPromise = jsObject[Strings.getAll]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ContentIndexEvent.swift b/Sources/DOMKit/WebIDL/ContentIndexEvent.swift new file mode 100644 index 00000000..be0c1842 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContentIndexEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ContentIndexEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.ContentIndexEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, init: ContentIndexEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + } + + @ReadonlyAttribute + public var id: String +} diff --git a/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift b/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift new file mode 100644 index 00000000..7b82c67d --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ContentIndexEventInit: BridgedDictionary { + public convenience init(id: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.id] = id.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var id: String +} diff --git a/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift b/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift new file mode 100644 index 00000000..5dffa467 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ConvertCoordinateOptions: BridgedDictionary { + public convenience init(fromBox: CSSBoxType, toBox: CSSBoxType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.fromBox] = fromBox.jsValue() + object[Strings.toBox] = toBox.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _fromBox = ReadWriteAttribute(jsObject: object, name: Strings.fromBox) + _toBox = ReadWriteAttribute(jsObject: object, name: Strings.toBox) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var fromBox: CSSBoxType + + @ReadWriteAttribute + public var toBox: CSSBoxType +} diff --git a/Sources/DOMKit/WebIDL/ConvolverNode.swift b/Sources/DOMKit/WebIDL/ConvolverNode.swift new file mode 100644 index 00000000..068b41a5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConvolverNode.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ConvolverNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.ConvolverNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _buffer = ReadWriteAttribute(jsObject: jsObject, name: Strings.buffer) + _normalize = ReadWriteAttribute(jsObject: jsObject, name: Strings.normalize) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: ConvolverOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var buffer: AudioBuffer? + + @ReadWriteAttribute + public var normalize: Bool +} diff --git a/Sources/DOMKit/WebIDL/ConvolverOptions.swift b/Sources/DOMKit/WebIDL/ConvolverOptions.swift new file mode 100644 index 00000000..fd438d57 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConvolverOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ConvolverOptions: BridgedDictionary { + public convenience init(buffer: AudioBuffer?, disableNormalization: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.buffer] = buffer.jsValue() + object[Strings.disableNormalization] = disableNormalization.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) + _disableNormalization = ReadWriteAttribute(jsObject: object, name: Strings.disableNormalization) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var buffer: AudioBuffer? + + @ReadWriteAttribute + public var disableNormalization: Bool +} diff --git a/Sources/DOMKit/WebIDL/CookieChangeEvent.swift b/Sources/DOMKit/WebIDL/CookieChangeEvent.swift new file mode 100644 index 00000000..f2fe3c68 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CookieChangeEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CookieChangeEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.CookieChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _changed = ReadonlyAttribute(jsObject: jsObject, name: Strings.changed) + _deleted = ReadonlyAttribute(jsObject: jsObject, name: Strings.deleted) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: CookieChangeEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var changed: [CookieListItem] + + @ReadonlyAttribute + public var deleted: [CookieListItem] +} diff --git a/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift b/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift new file mode 100644 index 00000000..ddd23a81 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CookieChangeEventInit: BridgedDictionary { + public convenience init(changed: CookieList, deleted: CookieList) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.changed] = changed.jsValue() + object[Strings.deleted] = deleted.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _changed = ReadWriteAttribute(jsObject: object, name: Strings.changed) + _deleted = ReadWriteAttribute(jsObject: object, name: Strings.deleted) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var changed: CookieList + + @ReadWriteAttribute + public var deleted: CookieList +} diff --git a/Sources/DOMKit/WebIDL/CookieInit.swift b/Sources/DOMKit/WebIDL/CookieInit.swift new file mode 100644 index 00000000..fd5f9aff --- /dev/null +++ b/Sources/DOMKit/WebIDL/CookieInit.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CookieInit: BridgedDictionary { + public convenience init(name: String, value: String, expires: DOMTimeStamp?, domain: String?, path: String, sameSite: CookieSameSite) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.value] = value.jsValue() + object[Strings.expires] = expires.jsValue() + object[Strings.domain] = domain.jsValue() + object[Strings.path] = path.jsValue() + object[Strings.sameSite] = sameSite.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + _expires = ReadWriteAttribute(jsObject: object, name: Strings.expires) + _domain = ReadWriteAttribute(jsObject: object, name: Strings.domain) + _path = ReadWriteAttribute(jsObject: object, name: Strings.path) + _sameSite = ReadWriteAttribute(jsObject: object, name: Strings.sameSite) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var value: String + + @ReadWriteAttribute + public var expires: DOMTimeStamp? + + @ReadWriteAttribute + public var domain: String? + + @ReadWriteAttribute + public var path: String + + @ReadWriteAttribute + public var sameSite: CookieSameSite +} diff --git a/Sources/DOMKit/WebIDL/CookieListItem.swift b/Sources/DOMKit/WebIDL/CookieListItem.swift new file mode 100644 index 00000000..51acd310 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CookieListItem.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CookieListItem: BridgedDictionary { + public convenience init(name: String, value: String, domain: String?, path: String, expires: DOMTimeStamp?, secure: Bool, sameSite: CookieSameSite) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.value] = value.jsValue() + object[Strings.domain] = domain.jsValue() + object[Strings.path] = path.jsValue() + object[Strings.expires] = expires.jsValue() + object[Strings.secure] = secure.jsValue() + object[Strings.sameSite] = sameSite.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + _domain = ReadWriteAttribute(jsObject: object, name: Strings.domain) + _path = ReadWriteAttribute(jsObject: object, name: Strings.path) + _expires = ReadWriteAttribute(jsObject: object, name: Strings.expires) + _secure = ReadWriteAttribute(jsObject: object, name: Strings.secure) + _sameSite = ReadWriteAttribute(jsObject: object, name: Strings.sameSite) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var value: String + + @ReadWriteAttribute + public var domain: String? + + @ReadWriteAttribute + public var path: String + + @ReadWriteAttribute + public var expires: DOMTimeStamp? + + @ReadWriteAttribute + public var secure: Bool + + @ReadWriteAttribute + public var sameSite: CookieSameSite +} diff --git a/Sources/DOMKit/WebIDL/CookieSameSite.swift b/Sources/DOMKit/WebIDL/CookieSameSite.swift new file mode 100644 index 00000000..ecdc8cdc --- /dev/null +++ b/Sources/DOMKit/WebIDL/CookieSameSite.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CookieSameSite: JSString, JSValueCompatible { + case strict = "strict" + case lax = "lax" + case none = "none" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CookieStore.swift b/Sources/DOMKit/WebIDL/CookieStore.swift new file mode 100644 index 00000000..4630151f --- /dev/null +++ b/Sources/DOMKit/WebIDL/CookieStore.swift @@ -0,0 +1,96 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CookieStore: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.CookieStore].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + super.init(unsafelyWrapping: jsObject) + } + + public func get(name: String) -> JSPromise { + jsObject[Strings.get]!(name.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func get(name: String) async throws -> CookieListItem? { + let _promise: JSPromise = jsObject[Strings.get]!(name.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func get(options: CookieStoreGetOptions? = nil) -> JSPromise { + jsObject[Strings.get]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func get(options: CookieStoreGetOptions? = nil) async throws -> CookieListItem? { + let _promise: JSPromise = jsObject[Strings.get]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getAll(name: String) -> JSPromise { + jsObject[Strings.getAll]!(name.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getAll(name: String) async throws -> CookieList { + let _promise: JSPromise = jsObject[Strings.getAll]!(name.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getAll(options: CookieStoreGetOptions? = nil) -> JSPromise { + jsObject[Strings.getAll]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getAll(options: CookieStoreGetOptions? = nil) async throws -> CookieList { + let _promise: JSPromise = jsObject[Strings.getAll]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func set(name: String, value: String) -> JSPromise { + jsObject[Strings.set]!(name.jsValue(), value.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func set(name: String, value: String) async throws { + let _promise: JSPromise = jsObject[Strings.set]!(name.jsValue(), value.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func set(options: CookieInit) -> JSPromise { + jsObject[Strings.set]!(options.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func set(options: CookieInit) async throws { + let _promise: JSPromise = jsObject[Strings.set]!(options.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func delete(name: String) -> JSPromise { + jsObject[Strings.delete]!(name.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func delete(name: String) async throws { + let _promise: JSPromise = jsObject[Strings.delete]!(name.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func delete(options: CookieStoreDeleteOptions) -> JSPromise { + jsObject[Strings.delete]!(options.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func delete(options: CookieStoreDeleteOptions) async throws { + let _promise: JSPromise = jsObject[Strings.delete]!(options.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var onchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift b/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift new file mode 100644 index 00000000..2c67c3f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CookieStoreDeleteOptions: BridgedDictionary { + public convenience init(name: String, domain: String?, path: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.domain] = domain.jsValue() + object[Strings.path] = path.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _domain = ReadWriteAttribute(jsObject: object, name: Strings.domain) + _path = ReadWriteAttribute(jsObject: object, name: Strings.path) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var domain: String? + + @ReadWriteAttribute + public var path: String +} diff --git a/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift b/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift new file mode 100644 index 00000000..b873989e --- /dev/null +++ b/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CookieStoreGetOptions: BridgedDictionary { + public convenience init(name: String, url: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.url] = url.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var url: String +} diff --git a/Sources/DOMKit/WebIDL/CookieStoreManager.swift b/Sources/DOMKit/WebIDL/CookieStoreManager.swift new file mode 100644 index 00000000..8560cedd --- /dev/null +++ b/Sources/DOMKit/WebIDL/CookieStoreManager.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CookieStoreManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CookieStoreManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func subscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { + jsObject[Strings.subscribe]!(subscriptions.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func subscribe(subscriptions: [CookieStoreGetOptions]) async throws { + let _promise: JSPromise = jsObject[Strings.subscribe]!(subscriptions.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func getSubscriptions() -> JSPromise { + jsObject[Strings.getSubscriptions]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getSubscriptions() async throws -> [CookieStoreGetOptions] { + let _promise: JSPromise = jsObject[Strings.getSubscriptions]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func unsubscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { + jsObject[Strings.unsubscribe]!(subscriptions.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func unsubscribe(subscriptions: [CookieStoreGetOptions]) async throws { + let _promise: JSPromise = jsObject[Strings.unsubscribe]!(subscriptions.jsValue()).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift index 94f41926..676ed834 100644 --- a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CountQueuingStrategy: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.CountQueuingStrategy.function! } + public class var constructor: JSFunction { JSObject.global[Strings.CountQueuingStrategy].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CrashReportBody.swift b/Sources/DOMKit/WebIDL/CrashReportBody.swift new file mode 100644 index 00000000..75118d13 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CrashReportBody.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CrashReportBody: ReportBody { + override public class var constructor: JSFunction { JSObject.global[Strings.CrashReportBody].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) + super.init(unsafelyWrapping: jsObject) + } + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + @ReadonlyAttribute + public var reason: String? +} diff --git a/Sources/DOMKit/WebIDL/Credential.swift b/Sources/DOMKit/WebIDL/Credential.swift new file mode 100644 index 00000000..bf751808 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Credential.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Credential: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Credential].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var type: String + + public static func isConditionalMediationAvailable() -> Bool { + constructor[Strings.isConditionalMediationAvailable]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift b/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift new file mode 100644 index 00000000..66db2d2d --- /dev/null +++ b/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CredentialCreationOptions: BridgedDictionary { + public convenience init(signal: AbortSignal, password: PasswordCredentialInit, federated: FederatedCredentialInit, publicKey: PublicKeyCredentialCreationOptions) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.signal] = signal.jsValue() + object[Strings.password] = password.jsValue() + object[Strings.federated] = federated.jsValue() + object[Strings.publicKey] = publicKey.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + _password = ReadWriteAttribute(jsObject: object, name: Strings.password) + _federated = ReadWriteAttribute(jsObject: object, name: Strings.federated) + _publicKey = ReadWriteAttribute(jsObject: object, name: Strings.publicKey) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var signal: AbortSignal + + @ReadWriteAttribute + public var password: PasswordCredentialInit + + @ReadWriteAttribute + public var federated: FederatedCredentialInit + + @ReadWriteAttribute + public var publicKey: PublicKeyCredentialCreationOptions +} diff --git a/Sources/DOMKit/WebIDL/CredentialData.swift b/Sources/DOMKit/WebIDL/CredentialData.swift new file mode 100644 index 00000000..7266cd8f --- /dev/null +++ b/Sources/DOMKit/WebIDL/CredentialData.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CredentialData: BridgedDictionary { + public convenience init(id: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.id] = id.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var id: String +} diff --git a/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift b/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift new file mode 100644 index 00000000..1e0296d9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CredentialMediationRequirement: JSString, JSValueCompatible { + case silent = "silent" + case optional = "optional" + case conditional = "conditional" + case required = "required" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift b/Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift new file mode 100644 index 00000000..2bac06cd --- /dev/null +++ b/Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CredentialPropertiesOutput: BridgedDictionary { + public convenience init(rk: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.rk] = rk.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _rk = ReadWriteAttribute(jsObject: object, name: Strings.rk) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var rk: Bool +} diff --git a/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift new file mode 100644 index 00000000..dd328fd6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CredentialRequestOptions: BridgedDictionary { + public convenience init(mediation: CredentialMediationRequirement, signal: AbortSignal, password: Bool, federated: FederatedCredentialRequestOptions, otp: OTPCredentialRequestOptions, publicKey: PublicKeyCredentialRequestOptions) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mediation] = mediation.jsValue() + object[Strings.signal] = signal.jsValue() + object[Strings.password] = password.jsValue() + object[Strings.federated] = federated.jsValue() + object[Strings.otp] = otp.jsValue() + object[Strings.publicKey] = publicKey.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mediation = ReadWriteAttribute(jsObject: object, name: Strings.mediation) + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + _password = ReadWriteAttribute(jsObject: object, name: Strings.password) + _federated = ReadWriteAttribute(jsObject: object, name: Strings.federated) + _otp = ReadWriteAttribute(jsObject: object, name: Strings.otp) + _publicKey = ReadWriteAttribute(jsObject: object, name: Strings.publicKey) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mediation: CredentialMediationRequirement + + @ReadWriteAttribute + public var signal: AbortSignal + + @ReadWriteAttribute + public var password: Bool + + @ReadWriteAttribute + public var federated: FederatedCredentialRequestOptions + + @ReadWriteAttribute + public var otp: OTPCredentialRequestOptions + + @ReadWriteAttribute + public var publicKey: PublicKeyCredentialRequestOptions +} diff --git a/Sources/DOMKit/WebIDL/CredentialUserData.swift b/Sources/DOMKit/WebIDL/CredentialUserData.swift new file mode 100644 index 00000000..83d9b47c --- /dev/null +++ b/Sources/DOMKit/WebIDL/CredentialUserData.swift @@ -0,0 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol CredentialUserData: JSBridgedClass {} +public extension CredentialUserData { + var name: String { ReadonlyAttribute[Strings.name, in: jsObject] } + + var iconURL: String { ReadonlyAttribute[Strings.iconURL, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/CredentialsContainer.swift b/Sources/DOMKit/WebIDL/CredentialsContainer.swift new file mode 100644 index 00000000..8825c9da --- /dev/null +++ b/Sources/DOMKit/WebIDL/CredentialsContainer.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CredentialsContainer: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CredentialsContainer].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func get(options: CredentialRequestOptions? = nil) -> JSPromise { + jsObject[Strings.get]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func get(options: CredentialRequestOptions? = nil) async throws -> Credential? { + let _promise: JSPromise = jsObject[Strings.get]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func store(credential: Credential) -> JSPromise { + jsObject[Strings.store]!(credential.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func store(credential: Credential) async throws -> Credential { + let _promise: JSPromise = jsObject[Strings.store]!(credential.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func create(options: CredentialCreationOptions? = nil) -> JSPromise { + jsObject[Strings.create]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func create(options: CredentialCreationOptions? = nil) async throws -> Credential? { + let _promise: JSPromise = jsObject[Strings.create]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func preventSilentAccess() -> JSPromise { + jsObject[Strings.preventSilentAccess]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func preventSilentAccess() async throws { + let _promise: JSPromise = jsObject[Strings.preventSilentAccess]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/CropTarget.swift b/Sources/DOMKit/WebIDL/CropTarget.swift new file mode 100644 index 00000000..62d4fc47 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CropTarget.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CropTarget: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CropTarget].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/Crypto.swift b/Sources/DOMKit/WebIDL/Crypto.swift new file mode 100644 index 00000000..1a2dfb06 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Crypto.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Crypto: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Crypto].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _subtle = ReadonlyAttribute(jsObject: jsObject, name: Strings.subtle) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var subtle: SubtleCrypto + + public func getRandomValues(array: ArrayBufferView) -> ArrayBufferView { + jsObject[Strings.getRandomValues]!(array.jsValue()).fromJSValue()! + } + + public func randomUUID() -> String { + jsObject[Strings.randomUUID]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/CryptoKey.swift b/Sources/DOMKit/WebIDL/CryptoKey.swift new file mode 100644 index 00000000..7b782d17 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CryptoKey.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CryptoKey: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CryptoKey].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _extractable = ReadonlyAttribute(jsObject: jsObject, name: Strings.extractable) + _algorithm = ReadonlyAttribute(jsObject: jsObject, name: Strings.algorithm) + _usages = ReadonlyAttribute(jsObject: jsObject, name: Strings.usages) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var type: KeyType + + @ReadonlyAttribute + public var extractable: Bool + + @ReadonlyAttribute + public var algorithm: JSObject + + @ReadonlyAttribute + public var usages: JSObject +} diff --git a/Sources/DOMKit/WebIDL/CryptoKeyPair.swift b/Sources/DOMKit/WebIDL/CryptoKeyPair.swift new file mode 100644 index 00000000..c8d3fd68 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CryptoKeyPair.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CryptoKeyPair: BridgedDictionary { + public convenience init(publicKey: CryptoKey, privateKey: CryptoKey) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.publicKey] = publicKey.jsValue() + object[Strings.privateKey] = privateKey.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _publicKey = ReadWriteAttribute(jsObject: object, name: Strings.publicKey) + _privateKey = ReadWriteAttribute(jsObject: object, name: Strings.privateKey) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var publicKey: CryptoKey + + @ReadWriteAttribute + public var privateKey: CryptoKey +} diff --git a/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift b/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift new file mode 100644 index 00000000..dc240429 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CursorCaptureConstraint: JSString, JSValueCompatible { + case never = "never" + case always = "always" + case motion = "motion" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index 4010fd9d..580bdb81 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CustomElementRegistry: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.CustomElementRegistry.function! } + public class var constructor: JSFunction { JSObject.global[Strings.CustomElementRegistry].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index 54874201..f31072fa 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CustomEvent: Event { - override public class var constructor: JSFunction { JSObject.global.CustomEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.CustomEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) diff --git a/Sources/DOMKit/WebIDL/CustomEventInit.swift b/Sources/DOMKit/WebIDL/CustomEventInit.swift index 87edc8da..a3447748 100644 --- a/Sources/DOMKit/WebIDL/CustomEventInit.swift +++ b/Sources/DOMKit/WebIDL/CustomEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class CustomEventInit: BridgedDictionary { public convenience init(detail: JSValue) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.detail] = detail.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CustomStateSet.swift b/Sources/DOMKit/WebIDL/CustomStateSet.swift new file mode 100644 index 00000000..3f088adb --- /dev/null +++ b/Sources/DOMKit/WebIDL/CustomStateSet.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class CustomStateSet: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.CustomStateSet].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Set-like! + + public func add(value: String) { + _ = jsObject[Strings.add]!(value.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/DOMException.swift b/Sources/DOMKit/WebIDL/DOMException.swift index 6f934c6f..a2223c42 100644 --- a/Sources/DOMKit/WebIDL/DOMException.swift +++ b/Sources/DOMKit/WebIDL/DOMException.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMException: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMException.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMException].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMImplementation.swift b/Sources/DOMKit/WebIDL/DOMImplementation.swift index b837fe1a..d04cefff 100644 --- a/Sources/DOMKit/WebIDL/DOMImplementation.swift +++ b/Sources/DOMKit/WebIDL/DOMImplementation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMImplementation: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMImplementation.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMImplementation].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index 36528b74..45b4e036 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMMatrix: DOMMatrixReadOnly { - override public class var constructor: JSFunction { JSObject.global.DOMMatrix.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.DOMMatrix].function! } public required init(unsafelyWrapping jsObject: JSObject) { _a = ReadWriteAttribute(jsObject: jsObject, name: Strings.a) diff --git a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift index d15b4e41..aa5caaa4 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class DOMMatrix2DInit: BridgedDictionary { public convenience init(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double, m11: Double, m12: Double, m21: Double, m22: Double, m41: Double, m42: Double) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.a] = a.jsValue() object[Strings.b] = b.jsValue() object[Strings.c] = c.jsValue() diff --git a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift index 8f2d97e7..d21f1736 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class DOMMatrixInit: BridgedDictionary { public convenience init(m13: Double, m14: Double, m23: Double, m24: Double, m31: Double, m32: Double, m33: Double, m34: Double, m43: Double, m44: Double, is2D: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.m13] = m13.jsValue() object[Strings.m14] = m14.jsValue() object[Strings.m23] = m23.jsValue() diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift index f029813d..52f94ecd 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMMatrixReadOnly: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMMatrixReadOnly.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMMatrixReadOnly].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMParser.swift b/Sources/DOMKit/WebIDL/DOMParser.swift index 01464648..37be80d8 100644 --- a/Sources/DOMKit/WebIDL/DOMParser.swift +++ b/Sources/DOMKit/WebIDL/DOMParser.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMParser: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMParser.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMParser].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMPoint.swift b/Sources/DOMKit/WebIDL/DOMPoint.swift index ef6af3c8..c8e29bc1 100644 --- a/Sources/DOMKit/WebIDL/DOMPoint.swift +++ b/Sources/DOMKit/WebIDL/DOMPoint.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMPoint: DOMPointReadOnly { - override public class var constructor: JSFunction { JSObject.global.DOMPoint.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.DOMPoint].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) diff --git a/Sources/DOMKit/WebIDL/DOMPointInit.swift b/Sources/DOMKit/WebIDL/DOMPointInit.swift index cfc8aac8..3ec95447 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class DOMPointInit: BridgedDictionary { public convenience init(x: Double, y: Double, z: Double, w: Double) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.x] = x.jsValue() object[Strings.y] = y.jsValue() object[Strings.z] = z.jsValue() diff --git a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift index 747d82b9..dc1ad91f 100644 --- a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMPointReadOnly: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMPointReadOnly.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMPointReadOnly].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMQuad.swift b/Sources/DOMKit/WebIDL/DOMQuad.swift index a5b201ce..73495706 100644 --- a/Sources/DOMKit/WebIDL/DOMQuad.swift +++ b/Sources/DOMKit/WebIDL/DOMQuad.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMQuad: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMQuad.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMQuad].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMQuadInit.swift b/Sources/DOMKit/WebIDL/DOMQuadInit.swift index 221a6fa9..cc4ef6a4 100644 --- a/Sources/DOMKit/WebIDL/DOMQuadInit.swift +++ b/Sources/DOMKit/WebIDL/DOMQuadInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class DOMQuadInit: BridgedDictionary { public convenience init(p1: DOMPointInit, p2: DOMPointInit, p3: DOMPointInit, p4: DOMPointInit) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.p1] = p1.jsValue() object[Strings.p2] = p2.jsValue() object[Strings.p3] = p3.jsValue() diff --git a/Sources/DOMKit/WebIDL/DOMRect.swift b/Sources/DOMKit/WebIDL/DOMRect.swift index bbb52006..3212774e 100644 --- a/Sources/DOMKit/WebIDL/DOMRect.swift +++ b/Sources/DOMKit/WebIDL/DOMRect.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMRect: DOMRectReadOnly { - override public class var constructor: JSFunction { JSObject.global.DOMRect.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.DOMRect].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) diff --git a/Sources/DOMKit/WebIDL/DOMRectInit.swift b/Sources/DOMKit/WebIDL/DOMRectInit.swift index 172f06de..5e17de6f 100644 --- a/Sources/DOMKit/WebIDL/DOMRectInit.swift +++ b/Sources/DOMKit/WebIDL/DOMRectInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class DOMRectInit: BridgedDictionary { public convenience init(x: Double, y: Double, width: Double, height: Double) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.x] = x.jsValue() object[Strings.y] = y.jsValue() object[Strings.width] = width.jsValue() diff --git a/Sources/DOMKit/WebIDL/DOMRectList.swift b/Sources/DOMKit/WebIDL/DOMRectList.swift index 079668d7..9ffefe9a 100644 --- a/Sources/DOMKit/WebIDL/DOMRectList.swift +++ b/Sources/DOMKit/WebIDL/DOMRectList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMRectList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMRectList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMRectList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift index 3ef789f4..29389a75 100644 --- a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMRectReadOnly: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMRectReadOnly.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMRectReadOnly].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMStringList.swift b/Sources/DOMKit/WebIDL/DOMStringList.swift index 5ff90704..d85732f9 100644 --- a/Sources/DOMKit/WebIDL/DOMStringList.swift +++ b/Sources/DOMKit/WebIDL/DOMStringList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMStringList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMStringList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMStringList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMStringMap.swift b/Sources/DOMKit/WebIDL/DOMStringMap.swift index c7f1ece3..ec4a215a 100644 --- a/Sources/DOMKit/WebIDL/DOMStringMap.swift +++ b/Sources/DOMKit/WebIDL/DOMStringMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMStringMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DOMStringMap.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMStringMap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DOMTokenList.swift b/Sources/DOMKit/WebIDL/DOMTokenList.swift index 4d16f691..7f620aaa 100644 --- a/Sources/DOMKit/WebIDL/DOMTokenList.swift +++ b/Sources/DOMKit/WebIDL/DOMTokenList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMTokenList: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global.DOMTokenList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DOMTokenList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DataCue.swift b/Sources/DOMKit/WebIDL/DataCue.swift new file mode 100644 index 00000000..a0be4ccc --- /dev/null +++ b/Sources/DOMKit/WebIDL/DataCue.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DataCue: TextTrackCue { + override public class var constructor: JSFunction { JSObject.global[Strings.DataCue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(startTime: Double, endTime: Double, value: JSValue, type: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(startTime.jsValue(), endTime.jsValue(), value.jsValue(), type?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var value: JSValue + + @ReadonlyAttribute + public var type: String +} diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift index a660eacb..44b540a8 100644 --- a/Sources/DOMKit/WebIDL/DataTransfer.swift +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DataTransfer: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DataTransfer.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DataTransfer].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index 16733079..506a87a2 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DataTransferItem: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DataTransferItem.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DataTransferItem].function! } public let jsObject: JSObject @@ -14,6 +14,20 @@ public class DataTransferItem: JSBridgedClass { self.jsObject = jsObject } + public func webkitGetAsEntry() -> FileSystemEntry? { + jsObject[Strings.webkitGetAsEntry]!().fromJSValue()! + } + + public func getAsFileSystemHandle() -> JSPromise { + jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getAsFileSystemHandle() async throws -> FileSystemHandle? { + let _promise: JSPromise = jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + @ReadonlyAttribute public var kind: String diff --git a/Sources/DOMKit/WebIDL/DataTransferItemList.swift b/Sources/DOMKit/WebIDL/DataTransferItemList.swift index 475e4777..b58b18e8 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItemList.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItemList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DataTransferItemList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DataTransferItemList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.DataTransferItemList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DecompressionStream.swift b/Sources/DOMKit/WebIDL/DecompressionStream.swift new file mode 100644 index 00000000..2c13f02c --- /dev/null +++ b/Sources/DOMKit/WebIDL/DecompressionStream.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DecompressionStream: JSBridgedClass, GenericTransformStream { + public class var constructor: JSFunction { JSObject.global[Strings.DecompressionStream].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(format: String) { + self.init(unsafelyWrapping: Self.constructor.new(format.jsValue())) + } +} diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index 6763f8bc..aed3881d 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -4,12 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvider { - override public class var constructor: JSFunction { JSObject.global.DedicatedWorkerGlobalScope.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.DedicatedWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _onrtctransform = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrtctransform) super.init(unsafelyWrapping: jsObject) } @@ -33,4 +34,7 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid @ClosureAttribute.Optional1 public var onmessageerror: EventHandler + + @ClosureAttribute.Optional1 + public var onrtctransform: EventHandler } diff --git a/Sources/DOMKit/WebIDL/DelayNode.swift b/Sources/DOMKit/WebIDL/DelayNode.swift new file mode 100644 index 00000000..d9d0b37e --- /dev/null +++ b/Sources/DOMKit/WebIDL/DelayNode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DelayNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.DelayNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _delayTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.delayTime) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: DelayOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var delayTime: AudioParam +} diff --git a/Sources/DOMKit/WebIDL/DelayOptions.swift b/Sources/DOMKit/WebIDL/DelayOptions.swift new file mode 100644 index 00000000..6f652255 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DelayOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DelayOptions: BridgedDictionary { + public convenience init(maxDelayTime: Double, delayTime: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.maxDelayTime] = maxDelayTime.jsValue() + object[Strings.delayTime] = delayTime.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _maxDelayTime = ReadWriteAttribute(jsObject: object, name: Strings.maxDelayTime) + _delayTime = ReadWriteAttribute(jsObject: object, name: Strings.delayTime) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var maxDelayTime: Double + + @ReadWriteAttribute + public var delayTime: Double +} diff --git a/Sources/DOMKit/WebIDL/DeprecationReportBody.swift b/Sources/DOMKit/WebIDL/DeprecationReportBody.swift new file mode 100644 index 00000000..03601c95 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DeprecationReportBody.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DeprecationReportBody: ReportBody { + override public class var constructor: JSFunction { JSObject.global[Strings.DeprecationReportBody].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _anticipatedRemoval = ReadonlyAttribute(jsObject: jsObject, name: Strings.anticipatedRemoval) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) + _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) + _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) + super.init(unsafelyWrapping: jsObject) + } + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var anticipatedRemoval: JSObject? + + @ReadonlyAttribute + public var message: String + + @ReadonlyAttribute + public var sourceFile: String? + + @ReadonlyAttribute + public var lineNumber: UInt32? + + @ReadonlyAttribute + public var columnNumber: UInt32? +} diff --git a/Sources/DOMKit/WebIDL/DetectedBarcode.swift b/Sources/DOMKit/WebIDL/DetectedBarcode.swift new file mode 100644 index 00000000..24fc1341 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DetectedBarcode.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DetectedBarcode: BridgedDictionary { + public convenience init(boundingBox: DOMRectReadOnly, rawValue: String, format: BarcodeFormat, cornerPoints: [Point2D]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.boundingBox] = boundingBox.jsValue() + object[Strings.rawValue] = rawValue.jsValue() + object[Strings.format] = format.jsValue() + object[Strings.cornerPoints] = cornerPoints.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _boundingBox = ReadWriteAttribute(jsObject: object, name: Strings.boundingBox) + _rawValue = ReadWriteAttribute(jsObject: object, name: Strings.rawValue) + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _cornerPoints = ReadWriteAttribute(jsObject: object, name: Strings.cornerPoints) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var boundingBox: DOMRectReadOnly + + @ReadWriteAttribute + public var rawValue: String + + @ReadWriteAttribute + public var format: BarcodeFormat + + @ReadWriteAttribute + public var cornerPoints: [Point2D] +} diff --git a/Sources/DOMKit/WebIDL/DetectedFace.swift b/Sources/DOMKit/WebIDL/DetectedFace.swift new file mode 100644 index 00000000..ba2d672e --- /dev/null +++ b/Sources/DOMKit/WebIDL/DetectedFace.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DetectedFace: BridgedDictionary { + public convenience init(boundingBox: DOMRectReadOnly, landmarks: [Landmark]?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.boundingBox] = boundingBox.jsValue() + object[Strings.landmarks] = landmarks.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _boundingBox = ReadWriteAttribute(jsObject: object, name: Strings.boundingBox) + _landmarks = ReadWriteAttribute(jsObject: object, name: Strings.landmarks) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var boundingBox: DOMRectReadOnly + + @ReadWriteAttribute + public var landmarks: [Landmark]? +} diff --git a/Sources/DOMKit/WebIDL/DetectedText.swift b/Sources/DOMKit/WebIDL/DetectedText.swift new file mode 100644 index 00000000..3617aec7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DetectedText.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DetectedText: BridgedDictionary { + public convenience init(boundingBox: DOMRectReadOnly, rawValue: String, cornerPoints: [Point2D]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.boundingBox] = boundingBox.jsValue() + object[Strings.rawValue] = rawValue.jsValue() + object[Strings.cornerPoints] = cornerPoints.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _boundingBox = ReadWriteAttribute(jsObject: object, name: Strings.boundingBox) + _rawValue = ReadWriteAttribute(jsObject: object, name: Strings.rawValue) + _cornerPoints = ReadWriteAttribute(jsObject: object, name: Strings.cornerPoints) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var boundingBox: DOMRectReadOnly + + @ReadWriteAttribute + public var rawValue: String + + @ReadWriteAttribute + public var cornerPoints: [Point2D] +} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift new file mode 100644 index 00000000..21078163 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DeviceMotionEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _acceleration = ReadonlyAttribute(jsObject: jsObject, name: Strings.acceleration) + _accelerationIncludingGravity = ReadonlyAttribute(jsObject: jsObject, name: Strings.accelerationIncludingGravity) + _rotationRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.rotationRate) + _interval = ReadonlyAttribute(jsObject: jsObject, name: Strings.interval) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: DeviceMotionEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var acceleration: DeviceMotionEventAcceleration? + + @ReadonlyAttribute + public var accelerationIncludingGravity: DeviceMotionEventAcceleration? + + @ReadonlyAttribute + public var rotationRate: DeviceMotionEventRotationRate? + + @ReadonlyAttribute + public var interval: Double + + public static func requestPermission() -> JSPromise { + constructor[Strings.requestPermission]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func requestPermission() async throws -> PermissionState { + let _promise: JSPromise = constructor[Strings.requestPermission]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift new file mode 100644 index 00000000..2b499413 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DeviceMotionEventAcceleration: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEventAcceleration].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var x: Double? + + @ReadonlyAttribute + public var y: Double? + + @ReadonlyAttribute + public var z: Double? +} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift new file mode 100644 index 00000000..732fd86c --- /dev/null +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DeviceMotionEventAccelerationInit: BridgedDictionary { + public convenience init(x: Double?, y: Double?, z: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.z] = z.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _z = ReadWriteAttribute(jsObject: object, name: Strings.z) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var x: Double? + + @ReadWriteAttribute + public var y: Double? + + @ReadWriteAttribute + public var z: Double? +} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift new file mode 100644 index 00000000..be84b191 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DeviceMotionEventInit: BridgedDictionary { + public convenience init(acceleration: DeviceMotionEventAccelerationInit, accelerationIncludingGravity: DeviceMotionEventAccelerationInit, rotationRate: DeviceMotionEventRotationRateInit, interval: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.acceleration] = acceleration.jsValue() + object[Strings.accelerationIncludingGravity] = accelerationIncludingGravity.jsValue() + object[Strings.rotationRate] = rotationRate.jsValue() + object[Strings.interval] = interval.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _acceleration = ReadWriteAttribute(jsObject: object, name: Strings.acceleration) + _accelerationIncludingGravity = ReadWriteAttribute(jsObject: object, name: Strings.accelerationIncludingGravity) + _rotationRate = ReadWriteAttribute(jsObject: object, name: Strings.rotationRate) + _interval = ReadWriteAttribute(jsObject: object, name: Strings.interval) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var acceleration: DeviceMotionEventAccelerationInit + + @ReadWriteAttribute + public var accelerationIncludingGravity: DeviceMotionEventAccelerationInit + + @ReadWriteAttribute + public var rotationRate: DeviceMotionEventRotationRateInit + + @ReadWriteAttribute + public var interval: Double +} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift new file mode 100644 index 00000000..595bfdbb --- /dev/null +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DeviceMotionEventRotationRate: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEventRotationRate].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _alpha = ReadonlyAttribute(jsObject: jsObject, name: Strings.alpha) + _beta = ReadonlyAttribute(jsObject: jsObject, name: Strings.beta) + _gamma = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamma) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var alpha: Double? + + @ReadonlyAttribute + public var beta: Double? + + @ReadonlyAttribute + public var gamma: Double? +} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift new file mode 100644 index 00000000..b84fc37e --- /dev/null +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DeviceMotionEventRotationRateInit: BridgedDictionary { + public convenience init(alpha: Double?, beta: Double?, gamma: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.alpha] = alpha.jsValue() + object[Strings.beta] = beta.jsValue() + object[Strings.gamma] = gamma.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) + _gamma = ReadWriteAttribute(jsObject: object, name: Strings.gamma) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var alpha: Double? + + @ReadWriteAttribute + public var beta: Double? + + @ReadWriteAttribute + public var gamma: Double? +} diff --git a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift new file mode 100644 index 00000000..6399a430 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DeviceOrientationEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.DeviceOrientationEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _alpha = ReadonlyAttribute(jsObject: jsObject, name: Strings.alpha) + _beta = ReadonlyAttribute(jsObject: jsObject, name: Strings.beta) + _gamma = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamma) + _absolute = ReadonlyAttribute(jsObject: jsObject, name: Strings.absolute) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: DeviceOrientationEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var alpha: Double? + + @ReadonlyAttribute + public var beta: Double? + + @ReadonlyAttribute + public var gamma: Double? + + @ReadonlyAttribute + public var absolute: Bool + + public static func requestPermission() -> JSPromise { + constructor[Strings.requestPermission]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func requestPermission() async throws -> PermissionState { + let _promise: JSPromise = constructor[Strings.requestPermission]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift b/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift new file mode 100644 index 00000000..1c484cdd --- /dev/null +++ b/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DeviceOrientationEventInit: BridgedDictionary { + public convenience init(alpha: Double?, beta: Double?, gamma: Double?, absolute: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.alpha] = alpha.jsValue() + object[Strings.beta] = beta.jsValue() + object[Strings.gamma] = gamma.jsValue() + object[Strings.absolute] = absolute.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) + _gamma = ReadWriteAttribute(jsObject: object, name: Strings.gamma) + _absolute = ReadWriteAttribute(jsObject: object, name: Strings.absolute) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var alpha: Double? + + @ReadWriteAttribute + public var beta: Double? + + @ReadWriteAttribute + public var gamma: Double? + + @ReadWriteAttribute + public var absolute: Bool +} diff --git a/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift b/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift new file mode 100644 index 00000000..59a01900 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/DevicePosture.swift b/Sources/DOMKit/WebIDL/DevicePosture.swift new file mode 100644 index 00000000..1b61b848 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DevicePosture.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DevicePosture: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.DevicePosture].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var type: DevicePostureType + + @ClosureAttribute.Optional1 + public var onchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/DevicePostureType.swift b/Sources/DOMKit/WebIDL/DevicePostureType.swift new file mode 100644 index 00000000..dedffc7c --- /dev/null +++ b/Sources/DOMKit/WebIDL/DevicePostureType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum DevicePostureType: JSString, JSValueCompatible { + case continuous = "continuous" + case folded = "folded" + case foldedOver = "folded-over" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/DigitalGoodsService.swift b/Sources/DOMKit/WebIDL/DigitalGoodsService.swift new file mode 100644 index 00000000..9b72dd71 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DigitalGoodsService.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DigitalGoodsService: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.DigitalGoodsService].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func getDetails(itemIds: [String]) -> JSPromise { + jsObject[Strings.getDetails]!(itemIds.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDetails(itemIds: [String]) async throws -> [ItemDetails] { + let _promise: JSPromise = jsObject[Strings.getDetails]!(itemIds.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func listPurchases() -> JSPromise { + jsObject[Strings.listPurchases]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func listPurchases() async throws -> [PurchaseDetails] { + let _promise: JSPromise = jsObject[Strings.listPurchases]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func listPurchaseHistory() -> JSPromise { + jsObject[Strings.listPurchaseHistory]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func listPurchaseHistory() async throws -> [PurchaseDetails] { + let _promise: JSPromise = jsObject[Strings.listPurchaseHistory]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func consume(purchaseToken: String) -> JSPromise { + jsObject[Strings.consume]!(purchaseToken.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func consume(purchaseToken: String) async throws { + let _promise: JSPromise = jsObject[Strings.consume]!(purchaseToken.jsValue()).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/DirectionSetting.swift b/Sources/DOMKit/WebIDL/DirectionSetting.swift new file mode 100644 index 00000000..ac6f24c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DirectionSetting.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum DirectionSetting: JSString, JSValueCompatible { + case _empty = "" + case rl = "rl" + case lr = "lr" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift b/Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift new file mode 100644 index 00000000..573582cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DirectoryPickerOptions: BridgedDictionary { + public convenience init(id: String, startIn: StartInDirectory) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.id] = id.jsValue() + object[Strings.startIn] = startIn.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _startIn = ReadWriteAttribute(jsObject: object, name: Strings.startIn) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var startIn: StartInDirectory +} diff --git a/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift b/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift new file mode 100644 index 00000000..cc43ddf9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum DisplayCaptureSurfaceType: JSString, JSValueCompatible { + case monitor = "monitor" + case window = "window" + case application = "application" + case browser = "browser" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift new file mode 100644 index 00000000..80a5c90e --- /dev/null +++ b/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DisplayMediaStreamConstraints: BridgedDictionary { + public convenience init(video: __UNSUPPORTED_UNION__, audio: __UNSUPPORTED_UNION__) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.video] = video.jsValue() + object[Strings.audio] = audio.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _video = ReadWriteAttribute(jsObject: object, name: Strings.video) + _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var video: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var audio: __UNSUPPORTED_UNION__ +} diff --git a/Sources/DOMKit/WebIDL/DistanceModelType.swift b/Sources/DOMKit/WebIDL/DistanceModelType.swift new file mode 100644 index 00000000..d09f08a5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DistanceModelType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum DistanceModelType: JSString, JSValueCompatible { + case linear = "linear" + case inverse = "inverse" + case exponential = "exponential" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 895b057e..7581b45b 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { - override public class var constructor: JSFunction { JSObject.global.Document.function! } +public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GeometryUtils, FontFaceSource, GlobalEventHandlers, DocumentAndElementEventHandlers { + override public class var constructor: JSFunction { JSObject.global[Strings.Document].function! } public required init(unsafelyWrapping jsObject: JSObject) { _implementation = ReadonlyAttribute(jsObject: jsObject, name: Strings.implementation) @@ -17,6 +17,10 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN _contentType = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentType) _doctype = ReadonlyAttribute(jsObject: jsObject, name: Strings.doctype) _documentElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentElement) + _onpointerlockchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockchange) + _onpointerlockerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockerror) + _scrollingElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollingElement) + _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) _domain = ReadWriteAttribute(jsObject: jsObject, name: Strings.domain) _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) @@ -48,9 +52,29 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN _anchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchors) _applets = ReadonlyAttribute(jsObject: jsObject, name: Strings.applets) _all = ReadonlyAttribute(jsObject: jsObject, name: Strings.all) + _fragmentDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.fragmentDirective) + _timeline = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeline) + _namedFlows = ReadonlyAttribute(jsObject: jsObject, name: Strings.namedFlows) + _rootElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootElement) + _pictureInPictureEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.pictureInPictureEnabled) + _onfreeze = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfreeze) + _onresume = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresume) + _wasDiscarded = ReadonlyAttribute(jsObject: jsObject, name: Strings.wasDiscarded) + _fullscreenEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreenEnabled) + _fullscreen = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreen) + _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) + _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) super.init(unsafelyWrapping: jsObject) } + public func measureElement(element: Element) -> FontMetrics { + jsObject[Strings.measureElement]!(element.jsValue()).fromJSValue()! + } + + public func measureText(text: String, styleMap: StylePropertyMapReadOnly) -> FontMetrics { + jsObject[Strings.measureText]!(text.jsValue(), styleMap.jsValue()).fromJSValue()! + } + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -153,6 +177,54 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN // XXX: member 'createTreeWalker' is ignored + @ClosureAttribute.Optional1 + public var onpointerlockchange: EventHandler + + @ClosureAttribute.Optional1 + public var onpointerlockerror: EventHandler + + public func exitPointerLock() { + _ = jsObject[Strings.exitPointerLock]!() + } + + public func elementFromPoint(x: Double, y: Double) -> Element? { + jsObject[Strings.elementFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! + } + + public func elementsFromPoint(x: Double, y: Double) -> [Element] { + jsObject[Strings.elementsFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! + } + + public func caretPositionFromPoint(x: Double, y: Double) -> CaretPosition? { + jsObject[Strings.caretPositionFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var scrollingElement: Element? + + @ReadonlyAttribute + public var permissionsPolicy: PermissionsPolicy + + public func hasStorageAccess() -> JSPromise { + jsObject[Strings.hasStorageAccess]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func hasStorageAccess() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.hasStorageAccess]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestStorageAccess() -> JSPromise { + jsObject[Strings.requestStorageAccess]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestStorageAccess() async throws { + let _promise: JSPromise = jsObject[Strings.requestStorageAccess]!().fromJSValue()! + _ = try await _promise.get() + } + @ReadonlyAttribute public var location: Location? @@ -313,4 +385,64 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN @ReadonlyAttribute public var all: HTMLAllCollection + + @ReadonlyAttribute + public var fragmentDirective: FragmentDirective + + @ReadonlyAttribute + public var timeline: DocumentTimeline + + @ReadonlyAttribute + public var namedFlows: NamedFlowMap + + @ReadonlyAttribute + public var rootElement: SVGSVGElement? + + @ReadonlyAttribute + public var pictureInPictureEnabled: Bool + + public func exitPictureInPicture() -> JSPromise { + jsObject[Strings.exitPictureInPicture]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func exitPictureInPicture() async throws { + let _promise: JSPromise = jsObject[Strings.exitPictureInPicture]!().fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var onfreeze: EventHandler + + @ClosureAttribute.Optional1 + public var onresume: EventHandler + + @ReadonlyAttribute + public var wasDiscarded: Bool + + public func getSelection() -> Selection? { + jsObject[Strings.getSelection]!().fromJSValue()! + } + + @ReadonlyAttribute + public var fullscreenEnabled: Bool + + @ReadonlyAttribute + public var fullscreen: Bool + + public func exitFullscreen() -> JSPromise { + jsObject[Strings.exitFullscreen]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func exitFullscreen() async throws { + let _promise: JSPromise = jsObject[Strings.exitFullscreen]!().fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var onfullscreenchange: EventHandler + + @ClosureAttribute.Optional1 + public var onfullscreenerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/DocumentFragment.swift b/Sources/DOMKit/WebIDL/DocumentFragment.swift index 7091d224..99f37e39 100644 --- a/Sources/DOMKit/WebIDL/DocumentFragment.swift +++ b/Sources/DOMKit/WebIDL/DocumentFragment.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DocumentFragment: Node, NonElementParentNode, ParentNode { - override public class var constructor: JSFunction { JSObject.global.DocumentFragment.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.DocumentFragment].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index 8f5a2cf9..0f1e3cb6 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol DocumentOrShadowRoot: JSBridgedClass {} public extension DocumentOrShadowRoot { - var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } + var pointerLockElement: Element? { ReadonlyAttribute[Strings.pointerLockElement, in: jsObject] } var styleSheets: StyleSheetList { ReadonlyAttribute[Strings.styleSheets, in: jsObject] } @@ -13,4 +13,14 @@ public extension DocumentOrShadowRoot { get { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] } set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } } + + var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } + + func getAnimations() -> [Animation] { + jsObject[Strings.getAnimations]!().fromJSValue()! + } + + var pictureInPictureElement: Element? { ReadonlyAttribute[Strings.pictureInPictureElement, in: jsObject] } + + var fullscreenElement: Element? { ReadonlyAttribute[Strings.fullscreenElement, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/DocumentTimeline.swift b/Sources/DOMKit/WebIDL/DocumentTimeline.swift new file mode 100644 index 00000000..f0f5385d --- /dev/null +++ b/Sources/DOMKit/WebIDL/DocumentTimeline.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DocumentTimeline: AnimationTimeline { + override public class var constructor: JSFunction { JSObject.global[Strings.DocumentTimeline].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: DocumentTimelineOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/DocumentTimelineOptions.swift b/Sources/DOMKit/WebIDL/DocumentTimelineOptions.swift new file mode 100644 index 00000000..00f027d5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DocumentTimelineOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DocumentTimelineOptions: BridgedDictionary { + public convenience init(originTime: DOMHighResTimeStamp) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.originTime] = originTime.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _originTime = ReadWriteAttribute(jsObject: object, name: Strings.originTime) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var originTime: DOMHighResTimeStamp +} diff --git a/Sources/DOMKit/WebIDL/DocumentType.swift b/Sources/DOMKit/WebIDL/DocumentType.swift index 91dff6fc..5718c25c 100644 --- a/Sources/DOMKit/WebIDL/DocumentType.swift +++ b/Sources/DOMKit/WebIDL/DocumentType.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DocumentType: Node, ChildNode { - override public class var constructor: JSFunction { JSObject.global.DocumentType.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.DocumentType].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/DoubleRange.swift b/Sources/DOMKit/WebIDL/DoubleRange.swift new file mode 100644 index 00000000..91e52bef --- /dev/null +++ b/Sources/DOMKit/WebIDL/DoubleRange.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/DragEvent.swift b/Sources/DOMKit/WebIDL/DragEvent.swift index a7f1575d..a71c2fd2 100644 --- a/Sources/DOMKit/WebIDL/DragEvent.swift +++ b/Sources/DOMKit/WebIDL/DragEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DragEvent: MouseEvent { - override public class var constructor: JSFunction { JSObject.global.DragEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.DragEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) diff --git a/Sources/DOMKit/WebIDL/DragEventInit.swift b/Sources/DOMKit/WebIDL/DragEventInit.swift index 42dba8d1..7e6eaab1 100644 --- a/Sources/DOMKit/WebIDL/DragEventInit.swift +++ b/Sources/DOMKit/WebIDL/DragEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class DragEventInit: BridgedDictionary { public convenience init(dataTransfer: DataTransfer?) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.dataTransfer] = dataTransfer.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift b/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift new file mode 100644 index 00000000..26a1771a --- /dev/null +++ b/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DynamicsCompressorNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.DynamicsCompressorNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _threshold = ReadonlyAttribute(jsObject: jsObject, name: Strings.threshold) + _knee = ReadonlyAttribute(jsObject: jsObject, name: Strings.knee) + _ratio = ReadonlyAttribute(jsObject: jsObject, name: Strings.ratio) + _reduction = ReadonlyAttribute(jsObject: jsObject, name: Strings.reduction) + _attack = ReadonlyAttribute(jsObject: jsObject, name: Strings.attack) + _release = ReadonlyAttribute(jsObject: jsObject, name: Strings.release) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: DynamicsCompressorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var threshold: AudioParam + + @ReadonlyAttribute + public var knee: AudioParam + + @ReadonlyAttribute + public var ratio: AudioParam + + @ReadonlyAttribute + public var reduction: Float + + @ReadonlyAttribute + public var attack: AudioParam + + @ReadonlyAttribute + public var release: AudioParam +} diff --git a/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift b/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift new file mode 100644 index 00000000..ae7480a5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class DynamicsCompressorOptions: BridgedDictionary { + public convenience init(attack: Float, knee: Float, ratio: Float, release: Float, threshold: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.attack] = attack.jsValue() + object[Strings.knee] = knee.jsValue() + object[Strings.ratio] = ratio.jsValue() + object[Strings.release] = release.jsValue() + object[Strings.threshold] = threshold.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _attack = ReadWriteAttribute(jsObject: object, name: Strings.attack) + _knee = ReadWriteAttribute(jsObject: object, name: Strings.knee) + _ratio = ReadWriteAttribute(jsObject: object, name: Strings.ratio) + _release = ReadWriteAttribute(jsObject: object, name: Strings.release) + _threshold = ReadWriteAttribute(jsObject: object, name: Strings.threshold) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var attack: Float + + @ReadWriteAttribute + public var knee: Float + + @ReadWriteAttribute + public var ratio: Float + + @ReadWriteAttribute + public var release: Float + + @ReadWriteAttribute + public var threshold: Float +} diff --git a/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift b/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift new file mode 100644 index 00000000..80bb0238 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_blend_minmax: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_blend_minmax].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let MIN_EXT: GLenum = 0x8007 + + public static let MAX_EXT: GLenum = 0x8008 +} diff --git a/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift b/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift new file mode 100644 index 00000000..0f79c235 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_clip_cull_distance: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_clip_cull_distance].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let MAX_CLIP_DISTANCES_EXT: GLenum = 0x0D32 + + public static let MAX_CULL_DISTANCES_EXT: GLenum = 0x82F9 + + public static let MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT: GLenum = 0x82FA + + public static let CLIP_DISTANCE0_EXT: GLenum = 0x3000 + + public static let CLIP_DISTANCE1_EXT: GLenum = 0x3001 + + public static let CLIP_DISTANCE2_EXT: GLenum = 0x3002 + + public static let CLIP_DISTANCE3_EXT: GLenum = 0x3003 + + public static let CLIP_DISTANCE4_EXT: GLenum = 0x3004 + + public static let CLIP_DISTANCE5_EXT: GLenum = 0x3005 + + public static let CLIP_DISTANCE6_EXT: GLenum = 0x3006 + + public static let CLIP_DISTANCE7_EXT: GLenum = 0x3007 +} diff --git a/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift b/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift new file mode 100644 index 00000000..d704efd9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_color_buffer_float: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_color_buffer_float].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift b/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift new file mode 100644 index 00000000..111c927f --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_color_buffer_half_float: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_color_buffer_half_float].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let RGBA16F_EXT: GLenum = 0x881A + + public static let RGB16F_EXT: GLenum = 0x881B + + public static let FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum = 0x8211 + + public static let UNSIGNED_NORMALIZED_EXT: GLenum = 0x8C17 +} diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift new file mode 100644 index 00000000..5d2f5b2d --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_disjoint_timer_query: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_disjoint_timer_query].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let QUERY_COUNTER_BITS_EXT: GLenum = 0x8864 + + public static let CURRENT_QUERY_EXT: GLenum = 0x8865 + + public static let QUERY_RESULT_EXT: GLenum = 0x8866 + + public static let QUERY_RESULT_AVAILABLE_EXT: GLenum = 0x8867 + + public static let TIME_ELAPSED_EXT: GLenum = 0x88BF + + public static let TIMESTAMP_EXT: GLenum = 0x8E28 + + public static let GPU_DISJOINT_EXT: GLenum = 0x8FBB + + public func createQueryEXT() -> WebGLTimerQueryEXT? { + jsObject[Strings.createQueryEXT]!().fromJSValue()! + } + + public func deleteQueryEXT(query: WebGLTimerQueryEXT?) { + _ = jsObject[Strings.deleteQueryEXT]!(query.jsValue()) + } + + public func isQueryEXT(query: WebGLTimerQueryEXT?) -> Bool { + jsObject[Strings.isQueryEXT]!(query.jsValue()).fromJSValue()! + } + + public func beginQueryEXT(target: GLenum, query: WebGLTimerQueryEXT) { + _ = jsObject[Strings.beginQueryEXT]!(target.jsValue(), query.jsValue()) + } + + public func endQueryEXT(target: GLenum) { + _ = jsObject[Strings.endQueryEXT]!(target.jsValue()) + } + + public func queryCounterEXT(query: WebGLTimerQueryEXT, target: GLenum) { + _ = jsObject[Strings.queryCounterEXT]!(query.jsValue(), target.jsValue()) + } + + public func getQueryEXT(target: GLenum, pname: GLenum) -> JSValue { + jsObject[Strings.getQueryEXT]!(target.jsValue(), pname.jsValue()).fromJSValue()! + } + + public func getQueryObjectEXT(query: WebGLTimerQueryEXT, pname: GLenum) -> JSValue { + jsObject[Strings.getQueryObjectEXT]!(query.jsValue(), pname.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift new file mode 100644 index 00000000..a0bc0ead --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_disjoint_timer_query_webgl2: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_disjoint_timer_query_webgl2].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let QUERY_COUNTER_BITS_EXT: GLenum = 0x8864 + + public static let TIME_ELAPSED_EXT: GLenum = 0x88BF + + public static let TIMESTAMP_EXT: GLenum = 0x8E28 + + public static let GPU_DISJOINT_EXT: GLenum = 0x8FBB + + public func queryCounterEXT(query: WebGLQuery, target: GLenum) { + _ = jsObject[Strings.queryCounterEXT]!(query.jsValue(), target.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/EXT_float_blend.swift b/Sources/DOMKit/WebIDL/EXT_float_blend.swift new file mode 100644 index 00000000..34a3eea5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_float_blend.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_float_blend: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_float_blend].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/EXT_frag_depth.swift b/Sources/DOMKit/WebIDL/EXT_frag_depth.swift new file mode 100644 index 00000000..2d590411 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_frag_depth.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_frag_depth: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_frag_depth].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/EXT_sRGB.swift b/Sources/DOMKit/WebIDL/EXT_sRGB.swift new file mode 100644 index 00000000..bc1f5e66 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_sRGB.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_sRGB: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_sRGB].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let SRGB_EXT: GLenum = 0x8C40 + + public static let SRGB_ALPHA_EXT: GLenum = 0x8C42 + + public static let SRGB8_ALPHA8_EXT: GLenum = 0x8C43 + + public static let FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum = 0x8210 +} diff --git a/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift b/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift new file mode 100644 index 00000000..70b0e369 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_shader_texture_lod: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_shader_texture_lod].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift b/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift new file mode 100644 index 00000000..52714a67 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_texture_compression_bptc: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_compression_bptc].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COMPRESSED_RGBA_BPTC_UNORM_EXT: GLenum = 0x8E8C + + public static let COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: GLenum = 0x8E8D + + public static let COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: GLenum = 0x8E8E + + public static let COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: GLenum = 0x8E8F +} diff --git a/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift b/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift new file mode 100644 index 00000000..70a69c79 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_texture_compression_rgtc: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_compression_rgtc].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COMPRESSED_RED_RGTC1_EXT: GLenum = 0x8DBB + + public static let COMPRESSED_SIGNED_RED_RGTC1_EXT: GLenum = 0x8DBC + + public static let COMPRESSED_RED_GREEN_RGTC2_EXT: GLenum = 0x8DBD + + public static let COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GLenum = 0x8DBE +} diff --git a/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift b/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift new file mode 100644 index 00000000..56fb332d --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_texture_filter_anisotropic: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_filter_anisotropic].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let TEXTURE_MAX_ANISOTROPY_EXT: GLenum = 0x84FE + + public static let MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum = 0x84FF +} diff --git a/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift b/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift new file mode 100644 index 00000000..36a59a84 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EXT_texture_norm16: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_norm16].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let R16_EXT: GLenum = 0x822A + + public static let RG16_EXT: GLenum = 0x822C + + public static let RGB16_EXT: GLenum = 0x8054 + + public static let RGBA16_EXT: GLenum = 0x805B + + public static let R16_SNORM_EXT: GLenum = 0x8F98 + + public static let RG16_SNORM_EXT: GLenum = 0x8F99 + + public static let RGB16_SNORM_EXT: GLenum = 0x8F9A + + public static let RGBA16_SNORM_EXT: GLenum = 0x8F9B +} diff --git a/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift new file mode 100644 index 00000000..9cb137dc --- /dev/null +++ b/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EcKeyAlgorithm: BridgedDictionary { + public convenience init(namedCurve: NamedCurve) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.namedCurve] = namedCurve.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _namedCurve = ReadWriteAttribute(jsObject: object, name: Strings.namedCurve) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var namedCurve: NamedCurve +} diff --git a/Sources/DOMKit/WebIDL/EcKeyGenParams.swift b/Sources/DOMKit/WebIDL/EcKeyGenParams.swift new file mode 100644 index 00000000..27f62940 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EcKeyGenParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EcKeyGenParams: BridgedDictionary { + public convenience init(namedCurve: NamedCurve) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.namedCurve] = namedCurve.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _namedCurve = ReadWriteAttribute(jsObject: object, name: Strings.namedCurve) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var namedCurve: NamedCurve +} diff --git a/Sources/DOMKit/WebIDL/EcKeyImportParams.swift b/Sources/DOMKit/WebIDL/EcKeyImportParams.swift new file mode 100644 index 00000000..ddd6dea7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EcKeyImportParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EcKeyImportParams: BridgedDictionary { + public convenience init(namedCurve: NamedCurve) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.namedCurve] = namedCurve.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _namedCurve = ReadWriteAttribute(jsObject: object, name: Strings.namedCurve) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var namedCurve: NamedCurve +} diff --git a/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift b/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift new file mode 100644 index 00000000..979a2dd4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EcdhKeyDeriveParams: BridgedDictionary { + public convenience init(public _: CryptoKey) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.public] = public .jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _public = ReadWriteAttribute(jsObject: object, name: Strings.public) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var public: CryptoKey +} diff --git a/Sources/DOMKit/WebIDL/EcdsaParams.swift b/Sources/DOMKit/WebIDL/EcdsaParams.swift new file mode 100644 index 00000000..2912d0a3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EcdsaParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EcdsaParams: BridgedDictionary { + public convenience init(hash: HashAlgorithmIdentifier) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.hash] = hash.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var hash: HashAlgorithmIdentifier +} diff --git a/Sources/DOMKit/WebIDL/Edge.swift b/Sources/DOMKit/WebIDL/Edge.swift new file mode 100644 index 00000000..0615fb2d --- /dev/null +++ b/Sources/DOMKit/WebIDL/Edge.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum Edge: JSString, JSValueCompatible { + case start = "start" + case end = "end" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/EditContext.swift b/Sources/DOMKit/WebIDL/EditContext.swift new file mode 100644 index 00000000..df2878c6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EditContext.swift @@ -0,0 +1,100 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EditContext: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.EditContext].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _text = ReadonlyAttribute(jsObject: jsObject, name: Strings.text) + _selectionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionStart) + _selectionEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionEnd) + _compositionRangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.compositionRangeStart) + _compositionRangeEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.compositionRangeEnd) + _isInComposition = ReadonlyAttribute(jsObject: jsObject, name: Strings.isInComposition) + _controlBound = ReadonlyAttribute(jsObject: jsObject, name: Strings.controlBound) + _selectionBound = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionBound) + _characterBoundsRangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.characterBoundsRangeStart) + _ontextupdate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontextupdate) + _ontextformatupdate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontextformatupdate) + _oncharacterboundsupdate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncharacterboundsupdate) + _oncompositionstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompositionstart) + _oncompositionend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompositionend) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: EditContextInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + public func updateText(rangeStart: UInt32, rangeEnd: UInt32, text: String) { + _ = jsObject[Strings.updateText]!(rangeStart.jsValue(), rangeEnd.jsValue(), text.jsValue()) + } + + public func updateSelection(start: UInt32, end: UInt32) { + _ = jsObject[Strings.updateSelection]!(start.jsValue(), end.jsValue()) + } + + public func updateControlBound(controlBound: DOMRect) { + _ = jsObject[Strings.updateControlBound]!(controlBound.jsValue()) + } + + public func updateSelectionBound(selectionBound: DOMRect) { + _ = jsObject[Strings.updateSelectionBound]!(selectionBound.jsValue()) + } + + public func updateCharacterBounds(rangeStart: UInt32, characterBounds: [DOMRect]) { + _ = jsObject[Strings.updateCharacterBounds]!(rangeStart.jsValue(), characterBounds.jsValue()) + } + + public func attachedElements() -> [Element] { + jsObject[Strings.attachedElements]!().fromJSValue()! + } + + @ReadonlyAttribute + public var text: String + + @ReadonlyAttribute + public var selectionStart: UInt32 + + @ReadonlyAttribute + public var selectionEnd: UInt32 + + @ReadonlyAttribute + public var compositionRangeStart: UInt32 + + @ReadonlyAttribute + public var compositionRangeEnd: UInt32 + + @ReadonlyAttribute + public var isInComposition: Bool + + @ReadonlyAttribute + public var controlBound: DOMRect + + @ReadonlyAttribute + public var selectionBound: DOMRect + + @ReadonlyAttribute + public var characterBoundsRangeStart: UInt32 + + public func characterBounds() -> [DOMRect] { + jsObject[Strings.characterBounds]!().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var ontextupdate: EventHandler + + @ClosureAttribute.Optional1 + public var ontextformatupdate: EventHandler + + @ClosureAttribute.Optional1 + public var oncharacterboundsupdate: EventHandler + + @ClosureAttribute.Optional1 + public var oncompositionstart: EventHandler + + @ClosureAttribute.Optional1 + public var oncompositionend: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/EditContextInit.swift b/Sources/DOMKit/WebIDL/EditContextInit.swift new file mode 100644 index 00000000..78173136 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EditContextInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EditContextInit: BridgedDictionary { + public convenience init(text: String, selectionStart: UInt32, selectionEnd: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.text] = text.jsValue() + object[Strings.selectionStart] = selectionStart.jsValue() + object[Strings.selectionEnd] = selectionEnd.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _text = ReadWriteAttribute(jsObject: object, name: Strings.text) + _selectionStart = ReadWriteAttribute(jsObject: object, name: Strings.selectionStart) + _selectionEnd = ReadWriteAttribute(jsObject: object, name: Strings.selectionEnd) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var text: String + + @ReadWriteAttribute + public var selectionStart: UInt32 + + @ReadWriteAttribute + public var selectionEnd: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/EffectTiming.swift b/Sources/DOMKit/WebIDL/EffectTiming.swift new file mode 100644 index 00000000..e418897f --- /dev/null +++ b/Sources/DOMKit/WebIDL/EffectTiming.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EffectTiming: BridgedDictionary { + public convenience init(playbackRate: Double, duration: __UNSUPPORTED_UNION__, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.playbackRate] = playbackRate.jsValue() + object[Strings.duration] = duration.jsValue() + object[Strings.delay] = delay.jsValue() + object[Strings.endDelay] = endDelay.jsValue() + object[Strings.fill] = fill.jsValue() + object[Strings.iterationStart] = iterationStart.jsValue() + object[Strings.iterations] = iterations.jsValue() + object[Strings.direction] = direction.jsValue() + object[Strings.easing] = easing.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) + _endDelay = ReadWriteAttribute(jsObject: object, name: Strings.endDelay) + _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) + _iterationStart = ReadWriteAttribute(jsObject: object, name: Strings.iterationStart) + _iterations = ReadWriteAttribute(jsObject: object, name: Strings.iterations) + _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) + _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var playbackRate: Double + + @ReadWriteAttribute + public var duration: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var delay: Double + + @ReadWriteAttribute + public var endDelay: Double + + @ReadWriteAttribute + public var fill: FillMode + + @ReadWriteAttribute + public var iterationStart: Double + + @ReadWriteAttribute + public var iterations: Double + + @ReadWriteAttribute + public var direction: PlaybackDirection + + @ReadWriteAttribute + public var easing: String +} diff --git a/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift b/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift new file mode 100644 index 00000000..10ae3f48 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum EffectiveConnectionType: JSString, JSValueCompatible { + case _2g = "2g" + case _3g = "3g" + case _4g = "4g" + case slow2g = "slow-2g" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index fdbae7fd..c5478522 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin { - override public class var constructor: JSFunction { JSObject.global.Element.function! } +public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin, GeometryUtils, Animatable, Region, InnerHTML { + override public class var constructor: JSFunction { JSObject.global[Strings.Element].function! } public required init(unsafelyWrapping jsObject: JSObject) { _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) @@ -17,6 +17,20 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo _slot = ReadWriteAttribute(jsObject: jsObject, name: Strings.slot) _attributes = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributes) _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) + _editContext = ReadWriteAttribute(jsObject: jsObject, name: Strings.editContext) + _scrollTop = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollTop) + _scrollLeft = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollLeft) + _scrollWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollWidth) + _scrollHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollHeight) + _clientTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientTop) + _clientLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientLeft) + _clientWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientWidth) + _clientHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientHeight) + _part = ReadonlyAttribute(jsObject: jsObject, name: Strings.part) + _elementTiming = ReadWriteAttribute(jsObject: jsObject, name: Strings.elementTiming) + _outerHTML = ReadWriteAttribute(jsObject: jsObject, name: Strings.outerHTML) + _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) + _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) super.init(unsafelyWrapping: jsObject) } @@ -149,4 +163,140 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo public func insertAdjacentText(where: String, data: String) { _ = jsObject[Strings.insertAdjacentText]!(`where`.jsValue(), data.jsValue()) } + + public func requestPointerLock() { + _ = jsObject[Strings.requestPointerLock]!() + } + + @ReadWriteAttribute + public var editContext: EditContext? + + public func getClientRects() -> DOMRectList { + jsObject[Strings.getClientRects]!().fromJSValue()! + } + + public func getBoundingClientRect() -> DOMRect { + jsObject[Strings.getBoundingClientRect]!().fromJSValue()! + } + + public func isVisible(options: IsVisibleOptions? = nil) -> Bool { + jsObject[Strings.isVisible]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func scrollIntoView(arg: __UNSUPPORTED_UNION__? = nil) { + _ = jsObject[Strings.scrollIntoView]!(arg?.jsValue() ?? .undefined) + } + + public func scroll(options: ScrollToOptions? = nil) { + _ = jsObject[Strings.scroll]!(options?.jsValue() ?? .undefined) + } + + public func scroll(x: Double, y: Double) { + _ = jsObject[Strings.scroll]!(x.jsValue(), y.jsValue()) + } + + public func scrollTo(options: ScrollToOptions? = nil) { + _ = jsObject[Strings.scrollTo]!(options?.jsValue() ?? .undefined) + } + + public func scrollTo(x: Double, y: Double) { + _ = jsObject[Strings.scrollTo]!(x.jsValue(), y.jsValue()) + } + + public func scrollBy(options: ScrollToOptions? = nil) { + _ = jsObject[Strings.scrollBy]!(options?.jsValue() ?? .undefined) + } + + public func scrollBy(x: Double, y: Double) { + _ = jsObject[Strings.scrollBy]!(x.jsValue(), y.jsValue()) + } + + @ReadWriteAttribute + public var scrollTop: Double + + @ReadWriteAttribute + public var scrollLeft: Double + + @ReadonlyAttribute + public var scrollWidth: Int32 + + @ReadonlyAttribute + public var scrollHeight: Int32 + + @ReadonlyAttribute + public var clientTop: Int32 + + @ReadonlyAttribute + public var clientLeft: Int32 + + @ReadonlyAttribute + public var clientWidth: Int32 + + @ReadonlyAttribute + public var clientHeight: Int32 + + @ReadonlyAttribute + public var part: DOMTokenList + + public func computedStyleMap() -> StylePropertyMapReadOnly { + jsObject[Strings.computedStyleMap]!().fromJSValue()! + } + + public func setPointerCapture(pointerId: Int32) { + _ = jsObject[Strings.setPointerCapture]!(pointerId.jsValue()) + } + + public func releasePointerCapture(pointerId: Int32) { + _ = jsObject[Strings.releasePointerCapture]!(pointerId.jsValue()) + } + + public func hasPointerCapture(pointerId: Int32) -> Bool { + jsObject[Strings.hasPointerCapture]!(pointerId.jsValue()).fromJSValue()! + } + + public func setHTML(input: String, options: SetHTMLOptions? = nil) { + _ = jsObject[Strings.setHTML]!(input.jsValue(), options?.jsValue() ?? .undefined) + } + + public func pseudo(type: String) -> CSSPseudoElement? { + jsObject[Strings.pseudo]!(type.jsValue()).fromJSValue()! + } + + @ReadWriteAttribute + public var elementTiming: String + + @ReadWriteAttribute + public var outerHTML: String + + public func insertAdjacentHTML(position: String, text: String) { + _ = jsObject[Strings.insertAdjacentHTML]!(position.jsValue(), text.jsValue()) + } + + public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { + jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestFullscreen(options: FullscreenOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var onfullscreenchange: EventHandler + + @ClosureAttribute.Optional1 + public var onfullscreenerror: EventHandler + + public func getSpatialNavigationContainer() -> Node { + jsObject[Strings.getSpatialNavigationContainer]!().fromJSValue()! + } + + public func focusableAreas(option: FocusableAreasOption? = nil) -> [Node] { + jsObject[Strings.focusableAreas]!(option?.jsValue() ?? .undefined).fromJSValue()! + } + + public func spatialNavigationSearch(dir: SpatialNavigationDirection, options: SpatialNavigationSearchOptions? = nil) -> Node? { + jsObject[Strings.spatialNavigationSearch]!(dir.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/ElementBasedOffset.swift b/Sources/DOMKit/WebIDL/ElementBasedOffset.swift new file mode 100644 index 00000000..790a1df6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ElementBasedOffset.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ElementBasedOffset: BridgedDictionary { + public convenience init(target: Element, edge: Edge, threshold: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.target] = target.jsValue() + object[Strings.edge] = edge.jsValue() + object[Strings.threshold] = threshold.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _target = ReadWriteAttribute(jsObject: object, name: Strings.target) + _edge = ReadWriteAttribute(jsObject: object, name: Strings.edge) + _threshold = ReadWriteAttribute(jsObject: object, name: Strings.threshold) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var target: Element + + @ReadWriteAttribute + public var edge: Edge + + @ReadWriteAttribute + public var threshold: Double +} diff --git a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift index faff44bf..0eea662c 100644 --- a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift +++ b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift @@ -6,4 +6,6 @@ import JavaScriptKit public protocol ElementCSSInlineStyle: JSBridgedClass {} public extension ElementCSSInlineStyle { var style: CSSStyleDeclaration { ReadonlyAttribute[Strings.style, in: jsObject] } + + var attributeStyleMap: StylePropertyMap { ReadonlyAttribute[Strings.attributeStyleMap, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/ElementContentEditable.swift b/Sources/DOMKit/WebIDL/ElementContentEditable.swift index 139caa51..bb06fcc7 100644 --- a/Sources/DOMKit/WebIDL/ElementContentEditable.swift +++ b/Sources/DOMKit/WebIDL/ElementContentEditable.swift @@ -21,4 +21,9 @@ public extension ElementContentEditable { get { ReadWriteAttribute[Strings.inputMode, in: jsObject] } set { ReadWriteAttribute[Strings.inputMode, in: jsObject] = newValue } } + + var virtualKeyboardPolicy: String { + get { ReadWriteAttribute[Strings.virtualKeyboardPolicy, in: jsObject] } + set { ReadWriteAttribute[Strings.virtualKeyboardPolicy, in: jsObject] = newValue } + } } diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift index 01ae6375..84bbad50 100644 --- a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ElementCreationOptions: BridgedDictionary { public convenience init(is: String) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.is] = `is`.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift index 717ee030..24f1b770 100644 --- a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ElementDefinitionOptions: BridgedDictionary { public convenience init(extends: String) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.extends] = extends.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index 4d68099d..4769317f 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -4,11 +4,12 @@ import JavaScriptEventLoop import JavaScriptKit public class ElementInternals: JSBridgedClass, ARIAMixin { - public class var constructor: JSFunction { JSObject.global.ElementInternals.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ElementInternals].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _states = ReadonlyAttribute(jsObject: jsObject, name: Strings.states) _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.willValidate) @@ -18,6 +19,9 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { self.jsObject = jsObject } + @ReadonlyAttribute + public var states: CustomStateSet + @ReadonlyAttribute public var shadowRoot: ShadowRoot? diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift new file mode 100644 index 00000000..1c5c5281 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EncodedAudioChunk: JSBridgedClass { + 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 + } + + public convenience init(init: EncodedAudioChunkInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadonlyAttribute + public var type: EncodedAudioChunkType + + @ReadonlyAttribute + public var timestamp: Int64 + + @ReadonlyAttribute + public var duration: UInt64? + + @ReadonlyAttribute + public var byteLength: UInt32 + + public func copyTo(destination: BufferSource) { + _ = jsObject[Strings.copyTo]!(destination.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift new file mode 100644 index 00000000..da387f14 --- /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..b1432f02 --- /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..03291d0f --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift new file mode 100644 index 00000000..85d410bf --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EncodedVideoChunk: JSBridgedClass { + 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 + } + + public convenience init(init: EncodedVideoChunkInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadonlyAttribute + public var type: EncodedVideoChunkType + + @ReadonlyAttribute + public var timestamp: Int64 + + @ReadonlyAttribute + public var duration: UInt64? + + @ReadonlyAttribute + public var byteLength: UInt32 + + public func copyTo(destination: BufferSource) { + _ = jsObject[Strings.copyTo]!(destination.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift new file mode 100644 index 00000000..e91d7005 --- /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..ea1a9dae --- /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..78a26d63 --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/EndOfStreamError.swift b/Sources/DOMKit/WebIDL/EndOfStreamError.swift new file mode 100644 index 00000000..676ac3ae --- /dev/null +++ b/Sources/DOMKit/WebIDL/EndOfStreamError.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum EndOfStreamError: JSString, JSValueCompatible { + case network = "network" + case decode = "decode" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ErrorEvent.swift b/Sources/DOMKit/WebIDL/ErrorEvent.swift index 9b57e8c1..91148499 100644 --- a/Sources/DOMKit/WebIDL/ErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/ErrorEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ErrorEvent: Event { - override public class var constructor: JSFunction { JSObject.global.ErrorEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.ErrorEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) diff --git a/Sources/DOMKit/WebIDL/ErrorEventInit.swift b/Sources/DOMKit/WebIDL/ErrorEventInit.swift index c753f6d3..f2ef72c9 100644 --- a/Sources/DOMKit/WebIDL/ErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/ErrorEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ErrorEventInit: BridgedDictionary { public convenience init(message: String, filename: String, lineno: UInt32, colno: UInt32, error: JSValue) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.message] = message.jsValue() object[Strings.filename] = filename.jsValue() object[Strings.lineno] = lineno.jsValue() diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index 12fe37d7..0c984ab2 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Event: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.Event.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Event].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EventCounts.swift b/Sources/DOMKit/WebIDL/EventCounts.swift new file mode 100644 index 00000000..1da05254 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EventCounts.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EventCounts: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EventCounts].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/EventInit.swift b/Sources/DOMKit/WebIDL/EventInit.swift index ef24e26d..75091801 100644 --- a/Sources/DOMKit/WebIDL/EventInit.swift +++ b/Sources/DOMKit/WebIDL/EventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class EventInit: BridgedDictionary { public convenience init(bubbles: Bool, cancelable: Bool, composed: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.bubbles] = bubbles.jsValue() object[Strings.cancelable] = cancelable.jsValue() object[Strings.composed] = composed.jsValue() diff --git a/Sources/DOMKit/WebIDL/EventListenerOptions.swift b/Sources/DOMKit/WebIDL/EventListenerOptions.swift index 1ada7d34..4ee7158c 100644 --- a/Sources/DOMKit/WebIDL/EventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/EventListenerOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class EventListenerOptions: BridgedDictionary { public convenience init(capture: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.capture] = capture.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventModifierInit.swift b/Sources/DOMKit/WebIDL/EventModifierInit.swift index 16e06b1a..f1ed622f 100644 --- a/Sources/DOMKit/WebIDL/EventModifierInit.swift +++ b/Sources/DOMKit/WebIDL/EventModifierInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class EventModifierInit: BridgedDictionary { public convenience init(ctrlKey: Bool, shiftKey: Bool, altKey: Bool, metaKey: Bool, modifierAltGraph: Bool, modifierCapsLock: Bool, modifierFn: Bool, modifierFnLock: Bool, modifierHyper: Bool, modifierNumLock: Bool, modifierScrollLock: Bool, modifierSuper: Bool, modifierSymbol: Bool, modifierSymbolLock: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.ctrlKey] = ctrlKey.jsValue() object[Strings.shiftKey] = shiftKey.jsValue() object[Strings.altKey] = altKey.jsValue() diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index 1e896713..caea0f0a 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EventSource: EventTarget { - override public class var constructor: JSFunction { JSObject.global.EventSource.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.EventSource].function! } public required init(unsafelyWrapping jsObject: JSObject) { _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) diff --git a/Sources/DOMKit/WebIDL/EventSourceInit.swift b/Sources/DOMKit/WebIDL/EventSourceInit.swift index 00d32af6..ff77088a 100644 --- a/Sources/DOMKit/WebIDL/EventSourceInit.swift +++ b/Sources/DOMKit/WebIDL/EventSourceInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class EventSourceInit: BridgedDictionary { public convenience init(withCredentials: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.withCredentials] = withCredentials.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventTarget.swift b/Sources/DOMKit/WebIDL/EventTarget.swift index 64c67da1..55943d32 100644 --- a/Sources/DOMKit/WebIDL/EventTarget.swift +++ b/Sources/DOMKit/WebIDL/EventTarget.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EventTarget: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.EventTarget.function! } + public class var constructor: JSFunction { JSObject.global[Strings.EventTarget].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift new file mode 100644 index 00000000..66a7e54f --- /dev/null +++ b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ExtendableCookieChangeEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableCookieChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _changed = ReadonlyAttribute(jsObject: jsObject, name: Strings.changed) + _deleted = ReadonlyAttribute(jsObject: jsObject, name: Strings.deleted) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: ExtendableCookieChangeEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var changed: [CookieListItem] + + @ReadonlyAttribute + public var deleted: [CookieListItem] +} diff --git a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift new file mode 100644 index 00000000..409e0c24 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ExtendableCookieChangeEventInit: BridgedDictionary { + public convenience init(changed: CookieList, deleted: CookieList) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.changed] = changed.jsValue() + object[Strings.deleted] = deleted.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _changed = ReadWriteAttribute(jsObject: object, name: Strings.changed) + _deleted = ReadWriteAttribute(jsObject: object, name: Strings.deleted) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var changed: CookieList + + @ReadWriteAttribute + public var deleted: CookieList +} diff --git a/Sources/DOMKit/WebIDL/ExtendableEvent.swift b/Sources/DOMKit/WebIDL/ExtendableEvent.swift new file mode 100644 index 00000000..6cd10038 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ExtendableEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ExtendableEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: ExtendableEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + public func waitUntil(f: JSPromise) { + _ = jsObject[Strings.waitUntil]!(f.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/ExtendableEventInit.swift b/Sources/DOMKit/WebIDL/ExtendableEventInit.swift new file mode 100644 index 00000000..efb5d334 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ExtendableEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ExtendableEventInit: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift b/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift new file mode 100644 index 00000000..b4806b9b --- /dev/null +++ b/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ExtendableMessageEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableMessageEvent].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) + } + + public convenience init(type: String, eventInitDict: ExtendableMessageEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var data: JSValue + + @ReadonlyAttribute + public var origin: String + + @ReadonlyAttribute + public var lastEventId: String + + @ReadonlyAttribute + public var source: __UNSUPPORTED_UNION__? + + @ReadonlyAttribute + public var ports: [MessagePort] +} diff --git a/Sources/DOMKit/WebIDL/ExtendableMessageEventInit.swift b/Sources/DOMKit/WebIDL/ExtendableMessageEventInit.swift new file mode 100644 index 00000000..83c287ee --- /dev/null +++ b/Sources/DOMKit/WebIDL/ExtendableMessageEventInit.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ExtendableMessageEventInit: BridgedDictionary { + public convenience init(data: JSValue, origin: String, lastEventId: String, source: __UNSUPPORTED_UNION__?, 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: __UNSUPPORTED_UNION__? + + @ReadWriteAttribute + public var ports: [MessagePort] +} diff --git a/Sources/DOMKit/WebIDL/External.swift b/Sources/DOMKit/WebIDL/External.swift index 9ca28bda..6fe224ce 100644 --- a/Sources/DOMKit/WebIDL/External.swift +++ b/Sources/DOMKit/WebIDL/External.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class External: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.External.function! } + public class var constructor: JSFunction { JSObject.global[Strings.External].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EyeDropper.swift b/Sources/DOMKit/WebIDL/EyeDropper.swift new file mode 100644 index 00000000..d72805e3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EyeDropper.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EyeDropper: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.EyeDropper].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + public func open(options: ColorSelectionOptions? = nil) -> JSPromise { + jsObject[Strings.open]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func open(options: ColorSelectionOptions? = nil) async throws -> ColorSelectionResult { + let _promise: JSPromise = jsObject[Strings.open]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/FaceDetector.swift b/Sources/DOMKit/WebIDL/FaceDetector.swift new file mode 100644 index 00000000..af3ded3c --- /dev/null +++ b/Sources/DOMKit/WebIDL/FaceDetector.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FaceDetector: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FaceDetector].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(faceDetectorOptions: FaceDetectorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(faceDetectorOptions?.jsValue() ?? .undefined)) + } + + public func detect(image: ImageBitmapSource) -> JSPromise { + jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func detect(image: ImageBitmapSource) async throws -> [DetectedFace] { + let _promise: JSPromise = jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift b/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift new file mode 100644 index 00000000..60400fc9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FaceDetectorOptions: BridgedDictionary { + public convenience init(maxDetectedFaces: UInt16, fastMode: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.maxDetectedFaces] = maxDetectedFaces.jsValue() + object[Strings.fastMode] = fastMode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _maxDetectedFaces = ReadWriteAttribute(jsObject: object, name: Strings.maxDetectedFaces) + _fastMode = ReadWriteAttribute(jsObject: object, name: Strings.fastMode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var maxDetectedFaces: UInt16 + + @ReadWriteAttribute + public var fastMode: Bool +} diff --git a/Sources/DOMKit/WebIDL/FederatedCredential.swift b/Sources/DOMKit/WebIDL/FederatedCredential.swift new file mode 100644 index 00000000..0e2fc3d0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FederatedCredential.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FederatedCredential: Credential, CredentialUserData { + override public class var constructor: JSFunction { JSObject.global[Strings.FederatedCredential].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _provider = ReadonlyAttribute(jsObject: jsObject, name: Strings.provider) + _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(data: FederatedCredentialInit) { + self.init(unsafelyWrapping: Self.constructor.new(data.jsValue())) + } + + @ReadonlyAttribute + public var provider: String + + @ReadonlyAttribute + public var `protocol`: String? +} diff --git a/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift b/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift new file mode 100644 index 00000000..4f5512d0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FederatedCredentialInit: BridgedDictionary { + public convenience init(name: String, iconURL: String, origin: String, provider: String, protocol: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.iconURL] = iconURL.jsValue() + object[Strings.origin] = origin.jsValue() + object[Strings.provider] = provider.jsValue() + object[Strings.protocol] = `protocol`.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _iconURL = ReadWriteAttribute(jsObject: object, name: Strings.iconURL) + _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) + _provider = ReadWriteAttribute(jsObject: object, name: Strings.provider) + _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var iconURL: String + + @ReadWriteAttribute + public var origin: String + + @ReadWriteAttribute + public var provider: String + + @ReadWriteAttribute + public var `protocol`: String +} diff --git a/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift new file mode 100644 index 00000000..290fcb09 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FederatedCredentialRequestOptions: BridgedDictionary { + public convenience init(providers: [String], protocols: [String]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.providers] = providers.jsValue() + object[Strings.protocols] = protocols.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _providers = ReadWriteAttribute(jsObject: object, name: Strings.providers) + _protocols = ReadWriteAttribute(jsObject: object, name: Strings.protocols) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var providers: [String] + + @ReadWriteAttribute + public var protocols: [String] +} diff --git a/Sources/DOMKit/WebIDL/FetchEvent.swift b/Sources/DOMKit/WebIDL/FetchEvent.swift new file mode 100644 index 00000000..859df2e3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FetchEvent.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FetchEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.FetchEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _request = ReadonlyAttribute(jsObject: jsObject, name: Strings.request) + _preloadResponse = ReadonlyAttribute(jsObject: jsObject, name: Strings.preloadResponse) + _clientId = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientId) + _resultingClientId = ReadonlyAttribute(jsObject: jsObject, name: Strings.resultingClientId) + _replacesClientId = ReadonlyAttribute(jsObject: jsObject, name: Strings.replacesClientId) + _handled = ReadonlyAttribute(jsObject: jsObject, name: Strings.handled) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: FetchEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var request: Request + + @ReadonlyAttribute + public var preloadResponse: JSPromise + + @ReadonlyAttribute + public var clientId: String + + @ReadonlyAttribute + public var resultingClientId: String + + @ReadonlyAttribute + public var replacesClientId: String + + @ReadonlyAttribute + public var handled: JSPromise + + public func respondWith(r: JSPromise) { + _ = jsObject[Strings.respondWith]!(r.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/FetchEventInit.swift b/Sources/DOMKit/WebIDL/FetchEventInit.swift new file mode 100644 index 00000000..c06c637a --- /dev/null +++ b/Sources/DOMKit/WebIDL/FetchEventInit.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FetchEventInit: BridgedDictionary { + public convenience init(request: Request, preloadResponse: JSPromise, clientId: String, resultingClientId: String, replacesClientId: String, handled: JSPromise) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.request] = request.jsValue() + object[Strings.preloadResponse] = preloadResponse.jsValue() + object[Strings.clientId] = clientId.jsValue() + object[Strings.resultingClientId] = resultingClientId.jsValue() + object[Strings.replacesClientId] = replacesClientId.jsValue() + object[Strings.handled] = handled.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _request = ReadWriteAttribute(jsObject: object, name: Strings.request) + _preloadResponse = ReadWriteAttribute(jsObject: object, name: Strings.preloadResponse) + _clientId = ReadWriteAttribute(jsObject: object, name: Strings.clientId) + _resultingClientId = ReadWriteAttribute(jsObject: object, name: Strings.resultingClientId) + _replacesClientId = ReadWriteAttribute(jsObject: object, name: Strings.replacesClientId) + _handled = ReadWriteAttribute(jsObject: object, name: Strings.handled) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var request: Request + + @ReadWriteAttribute + public var preloadResponse: JSPromise + + @ReadWriteAttribute + public var clientId: String + + @ReadWriteAttribute + public var resultingClientId: String + + @ReadWriteAttribute + public var replacesClientId: String + + @ReadWriteAttribute + public var handled: JSPromise +} diff --git a/Sources/DOMKit/WebIDL/FetchPriority.swift b/Sources/DOMKit/WebIDL/FetchPriority.swift new file mode 100644 index 00000000..fce522d5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FetchPriority.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FetchPriority: JSString, JSValueCompatible { + case high = "high" + case low = "low" + case auto = "auto" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/File.swift b/Sources/DOMKit/WebIDL/File.swift index 6b711f6a..8ce7277a 100644 --- a/Sources/DOMKit/WebIDL/File.swift +++ b/Sources/DOMKit/WebIDL/File.swift @@ -4,11 +4,12 @@ import JavaScriptEventLoop import JavaScriptKit public class File: Blob { - override public class var constructor: JSFunction { JSObject.global.File.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.File].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) _lastModified = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastModified) + _webkitRelativePath = ReadonlyAttribute(jsObject: jsObject, name: Strings.webkitRelativePath) super.init(unsafelyWrapping: jsObject) } @@ -21,4 +22,7 @@ public class File: Blob { @ReadonlyAttribute public var lastModified: Int64 + + @ReadonlyAttribute + public var webkitRelativePath: String } diff --git a/Sources/DOMKit/WebIDL/FileList.swift b/Sources/DOMKit/WebIDL/FileList.swift index 7d09065f..9ec7c077 100644 --- a/Sources/DOMKit/WebIDL/FileList.swift +++ b/Sources/DOMKit/WebIDL/FileList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.FileList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.FileList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift b/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift new file mode 100644 index 00000000..9b776c34 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FilePickerAcceptType: BridgedDictionary { + public convenience init(description: String, accept: [String: __UNSUPPORTED_UNION__]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.description] = description.jsValue() + object[Strings.accept] = accept.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _description = ReadWriteAttribute(jsObject: object, name: Strings.description) + _accept = ReadWriteAttribute(jsObject: object, name: Strings.accept) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var description: String + + @ReadWriteAttribute + public var accept: [String: __UNSUPPORTED_UNION__] +} diff --git a/Sources/DOMKit/WebIDL/FilePickerOptions.swift b/Sources/DOMKit/WebIDL/FilePickerOptions.swift new file mode 100644 index 00000000..30fbe897 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FilePickerOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FilePickerOptions: BridgedDictionary { + public convenience init(types: [FilePickerAcceptType], excludeAcceptAllOption: Bool, id: String, startIn: StartInDirectory) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.types] = types.jsValue() + object[Strings.excludeAcceptAllOption] = excludeAcceptAllOption.jsValue() + object[Strings.id] = id.jsValue() + object[Strings.startIn] = startIn.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _types = ReadWriteAttribute(jsObject: object, name: Strings.types) + _excludeAcceptAllOption = ReadWriteAttribute(jsObject: object, name: Strings.excludeAcceptAllOption) + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _startIn = ReadWriteAttribute(jsObject: object, name: Strings.startIn) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var types: [FilePickerAcceptType] + + @ReadWriteAttribute + public var excludeAcceptAllOption: Bool + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var startIn: StartInDirectory +} diff --git a/Sources/DOMKit/WebIDL/FilePropertyBag.swift b/Sources/DOMKit/WebIDL/FilePropertyBag.swift index 24d525a8..26bafec1 100644 --- a/Sources/DOMKit/WebIDL/FilePropertyBag.swift +++ b/Sources/DOMKit/WebIDL/FilePropertyBag.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class FilePropertyBag: BridgedDictionary { public convenience init(lastModified: Int64) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.lastModified] = lastModified.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index f9a0375c..beb092fc 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileReader: EventTarget { - override public class var constructor: JSFunction { JSObject.global.FileReader.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.FileReader].function! } public required init(unsafelyWrapping jsObject: JSObject) { _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) diff --git a/Sources/DOMKit/WebIDL/FileReaderSync.swift b/Sources/DOMKit/WebIDL/FileReaderSync.swift index d7bc9a1d..c5cf35de 100644 --- a/Sources/DOMKit/WebIDL/FileReaderSync.swift +++ b/Sources/DOMKit/WebIDL/FileReaderSync.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileReaderSync: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.FileReaderSync.function! } + public class var constructor: JSFunction { JSObject.global[Strings.FileReaderSync].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FileSystem.swift b/Sources/DOMKit/WebIDL/FileSystem.swift new file mode 100644 index 00000000..03ba5370 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystem.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystem: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FileSystem].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _root = ReadonlyAttribute(jsObject: jsObject, name: Strings.root) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var root: FileSystemDirectoryEntry +} diff --git a/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift b/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift new file mode 100644 index 00000000..625b2d58 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemCreateWritableOptions: BridgedDictionary { + public convenience init(keepExistingData: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.keepExistingData] = keepExistingData.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _keepExistingData = ReadWriteAttribute(jsObject: object, name: Strings.keepExistingData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var keepExistingData: Bool +} diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift new file mode 100644 index 00000000..ce834c3c --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemDirectoryEntry: FileSystemEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryEntry].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func createReader() -> FileSystemDirectoryReader { + jsObject[Strings.createReader]!().fromJSValue()! + } + + public func getFile(path: String? = nil, options: FileSystemFlags? = nil, successCallback: FileSystemEntryCallback? = nil, errorCallback: ErrorCallback? = nil) { + _ = jsObject[Strings.getFile]!(path?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined, successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined) + } + + public func getDirectory(path: String? = nil, options: FileSystemFlags? = nil, successCallback: FileSystemEntryCallback? = nil, errorCallback: ErrorCallback? = nil) { + _ = jsObject[Strings.getDirectory]!(path?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined, successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift new file mode 100644 index 00000000..e4de9fbf --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemDirectoryHandle: FileSystemHandle, AsyncSequence { + override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryHandle].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public typealias Element = String + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func makeAsyncIterator() -> ValueIterableAsyncIterator { + ValueIterableAsyncIterator(sequence: self) + } + + public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) -> JSPromise { + jsObject[Strings.getFileHandle]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) async throws -> FileSystemFileHandle { + let _promise: JSPromise = jsObject[Strings.getFileHandle]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) -> JSPromise { + jsObject[Strings.getDirectoryHandle]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) async throws -> FileSystemDirectoryHandle { + let _promise: JSPromise = jsObject[Strings.getDirectoryHandle]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) -> JSPromise { + jsObject[Strings.removeEntry]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.removeEntry]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func resolve(possibleDescendant: FileSystemHandle) -> JSPromise { + jsObject[Strings.resolve]!(possibleDescendant.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func resolve(possibleDescendant: FileSystemHandle) async throws -> [String]? { + let _promise: JSPromise = jsObject[Strings.resolve]!(possibleDescendant.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift new file mode 100644 index 00000000..b94cb599 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemDirectoryReader: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryReader].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func readEntries(successCallback: FileSystemEntriesCallback, errorCallback: ErrorCallback? = nil) { + _ = jsObject[Strings.readEntries]!(successCallback.jsValue(), errorCallback?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/FileSystemEntry.swift b/Sources/DOMKit/WebIDL/FileSystemEntry.swift new file mode 100644 index 00000000..197ec7d0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemEntry.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemEntry: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FileSystemEntry].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _isFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFile) + _isDirectory = ReadonlyAttribute(jsObject: jsObject, name: Strings.isDirectory) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _fullPath = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullPath) + _filesystem = ReadonlyAttribute(jsObject: jsObject, name: Strings.filesystem) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var isFile: Bool + + @ReadonlyAttribute + public var isDirectory: Bool + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var fullPath: String + + @ReadonlyAttribute + public var filesystem: FileSystem + + public func getParent(successCallback: FileSystemEntryCallback? = nil, errorCallback: ErrorCallback? = nil) { + _ = jsObject[Strings.getParent]!(successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift b/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift new file mode 100644 index 00000000..435b9bf6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemFileEntry: FileSystemEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemFileEntry].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func file(successCallback: FileCallback, errorCallback: ErrorCallback? = nil) { + _ = jsObject[Strings.file]!(successCallback.jsValue(), errorCallback?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift b/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift new file mode 100644 index 00000000..e5e9fe4c --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemFileHandle: FileSystemHandle { + override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemFileHandle].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func getFile() -> JSPromise { + jsObject[Strings.getFile]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getFile() async throws -> File { + let _promise: JSPromise = jsObject[Strings.getFile]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func createWritable(options: FileSystemCreateWritableOptions? = nil) -> JSPromise { + jsObject[Strings.createWritable]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createWritable(options: FileSystemCreateWritableOptions? = nil) async throws -> FileSystemWritableFileStream { + let _promise: JSPromise = jsObject[Strings.createWritable]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/FileSystemFlags.swift b/Sources/DOMKit/WebIDL/FileSystemFlags.swift new file mode 100644 index 00000000..2efbf986 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemFlags.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemFlags: BridgedDictionary { + public convenience init(create: Bool, exclusive: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.create] = create.jsValue() + object[Strings.exclusive] = exclusive.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _create = ReadWriteAttribute(jsObject: object, name: Strings.create) + _exclusive = ReadWriteAttribute(jsObject: object, name: Strings.exclusive) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var create: Bool + + @ReadWriteAttribute + public var exclusive: Bool +} diff --git a/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift b/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift new file mode 100644 index 00000000..166372c1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemGetDirectoryOptions: BridgedDictionary { + public convenience init(create: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.create] = create.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _create = ReadWriteAttribute(jsObject: object, name: Strings.create) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var create: Bool +} diff --git a/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift b/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift new file mode 100644 index 00000000..790da979 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemGetFileOptions: BridgedDictionary { + public convenience init(create: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.create] = create.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _create = ReadWriteAttribute(jsObject: object, name: Strings.create) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var create: Bool +} diff --git a/Sources/DOMKit/WebIDL/FileSystemHandle.swift b/Sources/DOMKit/WebIDL/FileSystemHandle.swift new file mode 100644 index 00000000..9cc43c54 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemHandle.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemHandle: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FileSystemHandle].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var kind: FileSystemHandleKind + + @ReadonlyAttribute + public var name: String + + public func isSameEntry(other: FileSystemHandle) -> JSPromise { + jsObject[Strings.isSameEntry]!(other.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func isSameEntry(other: FileSystemHandle) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.isSameEntry]!(other.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { + jsObject[Strings.queryPermission]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { + let _promise: JSPromise = jsObject[Strings.queryPermission]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { + jsObject[Strings.requestPermission]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { + let _promise: JSPromise = jsObject[Strings.requestPermission]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift b/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift new file mode 100644 index 00000000..8947defc --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FileSystemHandleKind: JSString, JSValueCompatible { + case file = "file" + case directory = "directory" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift b/Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift new file mode 100644 index 00000000..daeb3952 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemHandlePermissionDescriptor: BridgedDictionary { + public convenience init(mode: FileSystemPermissionMode) { + 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: FileSystemPermissionMode +} diff --git a/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift new file mode 100644 index 00000000..c1180bdc --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemPermissionDescriptor: BridgedDictionary { + public convenience init(handle: FileSystemHandle, mode: FileSystemPermissionMode) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.handle] = handle.jsValue() + object[Strings.mode] = mode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _handle = ReadWriteAttribute(jsObject: object, name: Strings.handle) + _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var handle: FileSystemHandle + + @ReadWriteAttribute + public var mode: FileSystemPermissionMode +} diff --git a/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift b/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift new file mode 100644 index 00000000..c49475a5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FileSystemPermissionMode: JSString, JSValueCompatible { + case read = "read" + case readwrite = "readwrite" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift b/Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift new file mode 100644 index 00000000..190961be --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemRemoveOptions: BridgedDictionary { + public convenience init(recursive: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.recursive] = recursive.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _recursive = ReadWriteAttribute(jsObject: object, name: Strings.recursive) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var recursive: Bool +} diff --git a/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift b/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift new file mode 100644 index 00000000..0269b72a --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FileSystemWritableFileStream: WritableStream { + override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemWritableFileStream].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func write(data: FileSystemWriteChunkType) -> JSPromise { + jsObject[Strings.write]!(data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func write(data: FileSystemWriteChunkType) async throws { + let _promise: JSPromise = jsObject[Strings.write]!(data.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func seek(position: UInt64) -> JSPromise { + jsObject[Strings.seek]!(position.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func seek(position: UInt64) async throws { + let _promise: JSPromise = jsObject[Strings.seek]!(position.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func truncate(size: UInt64) -> JSPromise { + jsObject[Strings.truncate]!(size.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func truncate(size: UInt64) async throws { + let _promise: JSPromise = jsObject[Strings.truncate]!(size.jsValue()).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/FillLightMode.swift b/Sources/DOMKit/WebIDL/FillLightMode.swift new file mode 100644 index 00000000..0ee92607 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FillLightMode.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FillLightMode: JSString, JSValueCompatible { + case auto = "auto" + case off = "off" + case flash = "flash" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FillMode.swift b/Sources/DOMKit/WebIDL/FillMode.swift new file mode 100644 index 00000000..056e0014 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FillMode.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FillMode: JSString, JSValueCompatible { + case none = "none" + case forwards = "forwards" + case backwards = "backwards" + case both = "both" + case auto = "auto" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FlowControlType.swift b/Sources/DOMKit/WebIDL/FlowControlType.swift new file mode 100644 index 00000000..6355127c --- /dev/null +++ b/Sources/DOMKit/WebIDL/FlowControlType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FlowControlType: JSString, JSValueCompatible { + case none = "none" + case hardware = "hardware" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FocusEvent.swift b/Sources/DOMKit/WebIDL/FocusEvent.swift index c38fbecf..0bfe3b4c 100644 --- a/Sources/DOMKit/WebIDL/FocusEvent.swift +++ b/Sources/DOMKit/WebIDL/FocusEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FocusEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global.FocusEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.FocusEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedTarget) diff --git a/Sources/DOMKit/WebIDL/FocusEventInit.swift b/Sources/DOMKit/WebIDL/FocusEventInit.swift index 5c0fc273..d3ee1c3d 100644 --- a/Sources/DOMKit/WebIDL/FocusEventInit.swift +++ b/Sources/DOMKit/WebIDL/FocusEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class FocusEventInit: BridgedDictionary { public convenience init(relatedTarget: EventTarget?) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.relatedTarget] = relatedTarget.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FocusOptions.swift b/Sources/DOMKit/WebIDL/FocusOptions.swift index da5d89ff..d40f27c3 100644 --- a/Sources/DOMKit/WebIDL/FocusOptions.swift +++ b/Sources/DOMKit/WebIDL/FocusOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class FocusOptions: BridgedDictionary { public convenience init(preventScroll: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.preventScroll] = preventScroll.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift b/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift new file mode 100644 index 00000000..d66080cd --- /dev/null +++ b/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FocusableAreaSearchMode: JSString, JSValueCompatible { + case visible = "visible" + case all = "all" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FocusableAreasOption.swift b/Sources/DOMKit/WebIDL/FocusableAreasOption.swift new file mode 100644 index 00000000..f7c02834 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FocusableAreasOption.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FocusableAreasOption: BridgedDictionary { + public convenience init(mode: FocusableAreaSearchMode) { + 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: FocusableAreaSearchMode +} diff --git a/Sources/DOMKit/WebIDL/Font.swift b/Sources/DOMKit/WebIDL/Font.swift new file mode 100644 index 00000000..1460213e --- /dev/null +++ b/Sources/DOMKit/WebIDL/Font.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Font: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Font].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _glyphsRendered = ReadonlyAttribute(jsObject: jsObject, name: Strings.glyphsRendered) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var glyphsRendered: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/FontFace.swift b/Sources/DOMKit/WebIDL/FontFace.swift new file mode 100644 index 00000000..195abc3b --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFace.swift @@ -0,0 +1,96 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFace: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FontFace].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _family = ReadWriteAttribute(jsObject: jsObject, name: Strings.family) + _style = ReadWriteAttribute(jsObject: jsObject, name: Strings.style) + _weight = ReadWriteAttribute(jsObject: jsObject, name: Strings.weight) + _stretch = ReadWriteAttribute(jsObject: jsObject, name: Strings.stretch) + _unicodeRange = ReadWriteAttribute(jsObject: jsObject, name: Strings.unicodeRange) + _variant = ReadWriteAttribute(jsObject: jsObject, name: Strings.variant) + _featureSettings = ReadWriteAttribute(jsObject: jsObject, name: Strings.featureSettings) + _variationSettings = ReadWriteAttribute(jsObject: jsObject, name: Strings.variationSettings) + _display = ReadWriteAttribute(jsObject: jsObject, name: Strings.display) + _ascentOverride = ReadWriteAttribute(jsObject: jsObject, name: Strings.ascentOverride) + _descentOverride = ReadWriteAttribute(jsObject: jsObject, name: Strings.descentOverride) + _lineGapOverride = ReadWriteAttribute(jsObject: jsObject, name: Strings.lineGapOverride) + _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) + _loaded = ReadonlyAttribute(jsObject: jsObject, name: Strings.loaded) + _features = ReadonlyAttribute(jsObject: jsObject, name: Strings.features) + _variations = ReadonlyAttribute(jsObject: jsObject, name: Strings.variations) + _palettes = ReadonlyAttribute(jsObject: jsObject, name: Strings.palettes) + self.jsObject = jsObject + } + + public convenience init(family: String, source: __UNSUPPORTED_UNION__, descriptors: FontFaceDescriptors? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(family.jsValue(), source.jsValue(), descriptors?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var family: String + + @ReadWriteAttribute + public var style: String + + @ReadWriteAttribute + public var weight: String + + @ReadWriteAttribute + public var stretch: String + + @ReadWriteAttribute + public var unicodeRange: String + + @ReadWriteAttribute + public var variant: String + + @ReadWriteAttribute + public var featureSettings: String + + @ReadWriteAttribute + public var variationSettings: String + + @ReadWriteAttribute + public var display: String + + @ReadWriteAttribute + public var ascentOverride: String + + @ReadWriteAttribute + public var descentOverride: String + + @ReadWriteAttribute + public var lineGapOverride: String + + @ReadonlyAttribute + public var status: FontFaceLoadStatus + + public func load() -> JSPromise { + jsObject[Strings.load]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func load() async throws -> FontFace { + let _promise: JSPromise = jsObject[Strings.load]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var loaded: JSPromise + + @ReadonlyAttribute + public var features: FontFaceFeatures + + @ReadonlyAttribute + public var variations: FontFaceVariations + + @ReadonlyAttribute + public var palettes: FontFacePalettes +} diff --git a/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift b/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift new file mode 100644 index 00000000..6b1186ec --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift @@ -0,0 +1,70 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFaceDescriptors: BridgedDictionary { + public convenience init(style: String, weight: String, stretch: String, unicodeRange: String, variant: String, featureSettings: String, variationSettings: String, display: String, ascentOverride: String, descentOverride: String, lineGapOverride: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.style] = style.jsValue() + object[Strings.weight] = weight.jsValue() + object[Strings.stretch] = stretch.jsValue() + object[Strings.unicodeRange] = unicodeRange.jsValue() + object[Strings.variant] = variant.jsValue() + object[Strings.featureSettings] = featureSettings.jsValue() + object[Strings.variationSettings] = variationSettings.jsValue() + object[Strings.display] = display.jsValue() + object[Strings.ascentOverride] = ascentOverride.jsValue() + object[Strings.descentOverride] = descentOverride.jsValue() + object[Strings.lineGapOverride] = lineGapOverride.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _style = ReadWriteAttribute(jsObject: object, name: Strings.style) + _weight = ReadWriteAttribute(jsObject: object, name: Strings.weight) + _stretch = ReadWriteAttribute(jsObject: object, name: Strings.stretch) + _unicodeRange = ReadWriteAttribute(jsObject: object, name: Strings.unicodeRange) + _variant = ReadWriteAttribute(jsObject: object, name: Strings.variant) + _featureSettings = ReadWriteAttribute(jsObject: object, name: Strings.featureSettings) + _variationSettings = ReadWriteAttribute(jsObject: object, name: Strings.variationSettings) + _display = ReadWriteAttribute(jsObject: object, name: Strings.display) + _ascentOverride = ReadWriteAttribute(jsObject: object, name: Strings.ascentOverride) + _descentOverride = ReadWriteAttribute(jsObject: object, name: Strings.descentOverride) + _lineGapOverride = ReadWriteAttribute(jsObject: object, name: Strings.lineGapOverride) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var style: String + + @ReadWriteAttribute + public var weight: String + + @ReadWriteAttribute + public var stretch: String + + @ReadWriteAttribute + public var unicodeRange: String + + @ReadWriteAttribute + public var variant: String + + @ReadWriteAttribute + public var featureSettings: String + + @ReadWriteAttribute + public var variationSettings: String + + @ReadWriteAttribute + public var display: String + + @ReadWriteAttribute + public var ascentOverride: String + + @ReadWriteAttribute + public var descentOverride: String + + @ReadWriteAttribute + public var lineGapOverride: String +} diff --git a/Sources/DOMKit/WebIDL/FontFaceFeatures.swift b/Sources/DOMKit/WebIDL/FontFaceFeatures.swift new file mode 100644 index 00000000..f732565d --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceFeatures.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFaceFeatures: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FontFaceFeatures].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift b/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift new file mode 100644 index 00000000..9d9f98ad --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FontFaceLoadStatus: JSString, JSValueCompatible { + case unloaded = "unloaded" + case loading = "loading" + case loaded = "loaded" + case error = "error" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FontFacePalette.swift b/Sources/DOMKit/WebIDL/FontFacePalette.swift new file mode 100644 index 00000000..6e01ef95 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFacePalette.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFacePalette: JSBridgedClass, Sequence { + public class var constructor: JSFunction { JSObject.global[Strings.FontFacePalette].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _usableWithLightBackground = ReadonlyAttribute(jsObject: jsObject, name: Strings.usableWithLightBackground) + _usableWithDarkBackground = ReadonlyAttribute(jsObject: jsObject, name: Strings.usableWithDarkBackground) + self.jsObject = jsObject + } + + public typealias Element = String + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> String { + jsObject[key].fromJSValue()! + } + + @ReadonlyAttribute + public var usableWithLightBackground: Bool + + @ReadonlyAttribute + public var usableWithDarkBackground: Bool +} diff --git a/Sources/DOMKit/WebIDL/FontFacePalettes.swift b/Sources/DOMKit/WebIDL/FontFacePalettes.swift new file mode 100644 index 00000000..77a5db5b --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFacePalettes.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFacePalettes: JSBridgedClass, Sequence { + public class var constructor: JSFunction { JSObject.global[Strings.FontFacePalettes].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + self.jsObject = jsObject + } + + public typealias Element = FontFacePalette + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> FontFacePalette { + jsObject[key].fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/FontFaceSet.swift b/Sources/DOMKit/WebIDL/FontFaceSet.swift new file mode 100644 index 00000000..d65d3872 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceSet.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFaceSet: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.FontFaceSet].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onloading = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloading) + _onloadingdone = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadingdone) + _onloadingerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadingerror) + _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) + _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(initialFaces: [FontFace]) { + self.init(unsafelyWrapping: Self.constructor.new(initialFaces.jsValue())) + } + + // XXX: make me Set-like! + + public func add(font: FontFace) -> Self { + jsObject[Strings.add]!(font.jsValue()).fromJSValue()! + } + + public func delete(font: FontFace) -> Bool { + jsObject[Strings.delete]!(font.jsValue()).fromJSValue()! + } + + public func clear() { + _ = jsObject[Strings.clear]!() + } + + @ClosureAttribute.Optional1 + public var onloading: EventHandler + + @ClosureAttribute.Optional1 + public var onloadingdone: EventHandler + + @ClosureAttribute.Optional1 + public var onloadingerror: EventHandler + + public func load(font: String, text: String? = nil) -> JSPromise { + jsObject[Strings.load]!(font.jsValue(), text?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func load(font: String, text: String? = nil) async throws -> [FontFace] { + let _promise: JSPromise = jsObject[Strings.load]!(font.jsValue(), text?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func check(font: String, text: String? = nil) -> Bool { + jsObject[Strings.check]!(font.jsValue(), text?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var ready: JSPromise + + @ReadonlyAttribute + public var status: FontFaceSetLoadStatus +} diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift new file mode 100644 index 00000000..16f06669 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFaceSetLoadEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.FontFaceSetLoadEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _fontfaces = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontfaces) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: FontFaceSetLoadEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var fontfaces: [FontFace] +} diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift new file mode 100644 index 00000000..9336d52e --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFaceSetLoadEventInit: BridgedDictionary { + public convenience init(fontfaces: [FontFace]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.fontfaces] = fontfaces.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _fontfaces = ReadWriteAttribute(jsObject: object, name: Strings.fontfaces) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var fontfaces: [FontFace] +} diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift new file mode 100644 index 00000000..0ea10999 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FontFaceSetLoadStatus: JSString, JSValueCompatible { + case loading = "loading" + case loaded = "loaded" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FontFaceSource.swift b/Sources/DOMKit/WebIDL/FontFaceSource.swift new file mode 100644 index 00000000..f2138572 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceSource.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol FontFaceSource: JSBridgedClass {} +public extension FontFaceSource { + var fonts: FontFaceSet { ReadonlyAttribute[Strings.fonts, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift b/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift new file mode 100644 index 00000000..5f898646 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFaceVariationAxis: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FontFaceVariationAxis].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _axisTag = ReadonlyAttribute(jsObject: jsObject, name: Strings.axisTag) + _minimumValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.minimumValue) + _maximumValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.maximumValue) + _defaultValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.defaultValue) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var axisTag: String + + @ReadonlyAttribute + public var minimumValue: Double + + @ReadonlyAttribute + public var maximumValue: Double + + @ReadonlyAttribute + public var defaultValue: Double +} diff --git a/Sources/DOMKit/WebIDL/FontFaceVariations.swift b/Sources/DOMKit/WebIDL/FontFaceVariations.swift new file mode 100644 index 00000000..289c7a31 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontFaceVariations.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontFaceVariations: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FontFaceVariations].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Set-like! +} diff --git a/Sources/DOMKit/WebIDL/FontManager.swift b/Sources/DOMKit/WebIDL/FontManager.swift new file mode 100644 index 00000000..4a260da0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontManager.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FontManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func query(options: QueryOptions? = nil) -> JSPromise { + jsObject[Strings.query]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func query(options: QueryOptions? = nil) async throws -> [FontMetadata] { + let _promise: JSPromise = jsObject[Strings.query]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/FontMetadata.swift b/Sources/DOMKit/WebIDL/FontMetadata.swift new file mode 100644 index 00000000..a83723c2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontMetadata.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontMetadata: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FontMetadata].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _postscriptName = ReadonlyAttribute(jsObject: jsObject, name: Strings.postscriptName) + _fullName = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullName) + _family = ReadonlyAttribute(jsObject: jsObject, name: Strings.family) + _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) + self.jsObject = jsObject + } + + public func blob() -> JSPromise { + jsObject[Strings.blob]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func blob() async throws -> Blob { + let _promise: JSPromise = jsObject[Strings.blob]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var postscriptName: String + + @ReadonlyAttribute + public var fullName: String + + @ReadonlyAttribute + public var family: String + + @ReadonlyAttribute + public var style: String +} diff --git a/Sources/DOMKit/WebIDL/FontMetrics.swift b/Sources/DOMKit/WebIDL/FontMetrics.swift new file mode 100644 index 00000000..2fca20d9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FontMetrics.swift @@ -0,0 +1,70 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FontMetrics: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FontMetrics].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _advances = ReadonlyAttribute(jsObject: jsObject, name: Strings.advances) + _boundingBoxLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingBoxLeft) + _boundingBoxRight = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingBoxRight) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _emHeightAscent = ReadonlyAttribute(jsObject: jsObject, name: Strings.emHeightAscent) + _emHeightDescent = ReadonlyAttribute(jsObject: jsObject, name: Strings.emHeightDescent) + _boundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingBoxAscent) + _boundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingBoxDescent) + _fontBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontBoundingBoxAscent) + _fontBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontBoundingBoxDescent) + _dominantBaseline = ReadonlyAttribute(jsObject: jsObject, name: Strings.dominantBaseline) + _baselines = ReadonlyAttribute(jsObject: jsObject, name: Strings.baselines) + _fonts = ReadonlyAttribute(jsObject: jsObject, name: Strings.fonts) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var width: Double + + @ReadonlyAttribute + public var advances: [Double] + + @ReadonlyAttribute + public var boundingBoxLeft: Double + + @ReadonlyAttribute + public var boundingBoxRight: Double + + @ReadonlyAttribute + public var height: Double + + @ReadonlyAttribute + public var emHeightAscent: Double + + @ReadonlyAttribute + public var emHeightDescent: Double + + @ReadonlyAttribute + public var boundingBoxAscent: Double + + @ReadonlyAttribute + public var boundingBoxDescent: Double + + @ReadonlyAttribute + public var fontBoundingBoxAscent: Double + + @ReadonlyAttribute + public var fontBoundingBoxDescent: Double + + @ReadonlyAttribute + public var dominantBaseline: Baseline + + @ReadonlyAttribute + public var baselines: [Baseline] + + @ReadonlyAttribute + public var fonts: [Font] +} diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index 6e0d7689..7663fe4a 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FormData: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global.FormData.function! } + public class var constructor: JSFunction { JSObject.global[Strings.FormData].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FormDataEvent.swift b/Sources/DOMKit/WebIDL/FormDataEvent.swift index 16693fdd..43417a4f 100644 --- a/Sources/DOMKit/WebIDL/FormDataEvent.swift +++ b/Sources/DOMKit/WebIDL/FormDataEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FormDataEvent: Event { - override public class var constructor: JSFunction { JSObject.global.FormDataEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.FormDataEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _formData = ReadonlyAttribute(jsObject: jsObject, name: Strings.formData) diff --git a/Sources/DOMKit/WebIDL/FormDataEventInit.swift b/Sources/DOMKit/WebIDL/FormDataEventInit.swift index b6127cd0..c6193fd5 100644 --- a/Sources/DOMKit/WebIDL/FormDataEventInit.swift +++ b/Sources/DOMKit/WebIDL/FormDataEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class FormDataEventInit: BridgedDictionary { public convenience init(formData: FormData) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.formData] = formData.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FragmentDirective.swift b/Sources/DOMKit/WebIDL/FragmentDirective.swift new file mode 100644 index 00000000..87e01a23 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FragmentDirective.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FragmentDirective: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FragmentDirective].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/FragmentResult.swift b/Sources/DOMKit/WebIDL/FragmentResult.swift new file mode 100644 index 00000000..e4f29c0a --- /dev/null +++ b/Sources/DOMKit/WebIDL/FragmentResult.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FragmentResult: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.FragmentResult].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _inlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineSize) + _blockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockSize) + self.jsObject = jsObject + } + + public convenience init(options: FragmentResultOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var inlineSize: Double + + @ReadonlyAttribute + public var blockSize: Double +} diff --git a/Sources/DOMKit/WebIDL/FragmentResultOptions.swift b/Sources/DOMKit/WebIDL/FragmentResultOptions.swift new file mode 100644 index 00000000..5ea7333c --- /dev/null +++ b/Sources/DOMKit/WebIDL/FragmentResultOptions.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FragmentResultOptions: BridgedDictionary { + public convenience init(inlineSize: Double, blockSize: Double, autoBlockSize: Double, childFragments: [LayoutFragment], data: JSValue, breakToken: BreakTokenOptions) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.inlineSize] = inlineSize.jsValue() + object[Strings.blockSize] = blockSize.jsValue() + object[Strings.autoBlockSize] = autoBlockSize.jsValue() + object[Strings.childFragments] = childFragments.jsValue() + object[Strings.data] = data.jsValue() + object[Strings.breakToken] = breakToken.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _inlineSize = ReadWriteAttribute(jsObject: object, name: Strings.inlineSize) + _blockSize = ReadWriteAttribute(jsObject: object, name: Strings.blockSize) + _autoBlockSize = ReadWriteAttribute(jsObject: object, name: Strings.autoBlockSize) + _childFragments = ReadWriteAttribute(jsObject: object, name: Strings.childFragments) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + _breakToken = ReadWriteAttribute(jsObject: object, name: Strings.breakToken) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var inlineSize: Double + + @ReadWriteAttribute + public var blockSize: Double + + @ReadWriteAttribute + public var autoBlockSize: Double + + @ReadWriteAttribute + public var childFragments: [LayoutFragment] + + @ReadWriteAttribute + public var data: JSValue + + @ReadWriteAttribute + public var breakToken: BreakTokenOptions +} diff --git a/Sources/DOMKit/WebIDL/FrameType.swift b/Sources/DOMKit/WebIDL/FrameType.swift new file mode 100644 index 00000000..28a618b2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FrameType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FrameType: JSString, JSValueCompatible { + case auxiliary = "auxiliary" + case topLevel = "top-level" + case nested = "nested" + case none = "none" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift b/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift new file mode 100644 index 00000000..bf5ae7f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum FullscreenNavigationUI: JSString, JSValueCompatible { + case auto = "auto" + case show = "show" + case hide = "hide" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/FullscreenOptions.swift b/Sources/DOMKit/WebIDL/FullscreenOptions.swift new file mode 100644 index 00000000..0e5ff5a9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FullscreenOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class FullscreenOptions: BridgedDictionary { + public convenience init(navigationUI: FullscreenNavigationUI) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.navigationUI] = navigationUI.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _navigationUI = ReadWriteAttribute(jsObject: object, name: Strings.navigationUI) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var navigationUI: FullscreenNavigationUI +} diff --git a/Sources/DOMKit/WebIDL/GPU.swift b/Sources/DOMKit/WebIDL/GPU.swift new file mode 100644 index 00000000..ea617891 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPU.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPU: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPU].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func requestAdapter(options: GPURequestAdapterOptions? = nil) -> JSPromise { + jsObject[Strings.requestAdapter]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestAdapter(options: GPURequestAdapterOptions? = nil) async throws -> GPUAdapter? { + let _promise: JSPromise = jsObject[Strings.requestAdapter]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/GPUAdapter.swift b/Sources/DOMKit/WebIDL/GPUAdapter.swift new file mode 100644 index 00000000..51111602 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUAdapter.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUAdapter: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPUAdapter].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _features = ReadonlyAttribute(jsObject: jsObject, name: Strings.features) + _limits = ReadonlyAttribute(jsObject: jsObject, name: Strings.limits) + _isFallbackAdapter = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFallbackAdapter) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var features: GPUSupportedFeatures + + @ReadonlyAttribute + public var limits: GPUSupportedLimits + + @ReadonlyAttribute + public var isFallbackAdapter: Bool + + public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) -> JSPromise { + jsObject[Strings.requestDevice]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) async throws -> GPUDevice { + let _promise: JSPromise = jsObject[Strings.requestDevice]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/GPUAddressMode.swift b/Sources/DOMKit/WebIDL/GPUAddressMode.swift new file mode 100644 index 00000000..6aecea51 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUAddressMode.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUAddressMode: JSString, JSValueCompatible { + case clampToEdge = "clamp-to-edge" + case `repeat` = "repeat" + case mirrorRepeat = "mirror-repeat" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroup.swift b/Sources/DOMKit/WebIDL/GPUBindGroup.swift new file mode 100644 index 00000000..0aa1ba60 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBindGroup.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBindGroup: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUBindGroup].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift b/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift new file mode 100644 index 00000000..22ec36c0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBindGroupDescriptor: BridgedDictionary { + public convenience init(layout: GPUBindGroupLayout, entries: [GPUBindGroupEntry]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.layout] = layout.jsValue() + object[Strings.entries] = entries.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + _entries = ReadWriteAttribute(jsObject: object, name: Strings.entries) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var layout: GPUBindGroupLayout + + @ReadWriteAttribute + public var entries: [GPUBindGroupEntry] +} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift b/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift new file mode 100644 index 00000000..1e0652f0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBindGroupEntry: BridgedDictionary { + public convenience init(binding: GPUIndex32, resource: GPUBindingResource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.binding] = binding.jsValue() + object[Strings.resource] = resource.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _binding = ReadWriteAttribute(jsObject: object, name: Strings.binding) + _resource = ReadWriteAttribute(jsObject: object, name: Strings.resource) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var binding: GPUIndex32 + + @ReadWriteAttribute + public var resource: GPUBindingResource +} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift b/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift new file mode 100644 index 00000000..5e6c2bd8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBindGroupLayout: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUBindGroupLayout].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift new file mode 100644 index 00000000..43cfd3ca --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBindGroupLayoutDescriptor: BridgedDictionary { + public convenience init(entries: [GPUBindGroupLayoutEntry]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.entries] = entries.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _entries = ReadWriteAttribute(jsObject: object, name: Strings.entries) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var entries: [GPUBindGroupLayoutEntry] +} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift new file mode 100644 index 00000000..5759ce63 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBindGroupLayoutEntry: BridgedDictionary { + public convenience init(binding: GPUIndex32, visibility: GPUShaderStageFlags, buffer: GPUBufferBindingLayout, sampler: GPUSamplerBindingLayout, texture: GPUTextureBindingLayout, storageTexture: GPUStorageTextureBindingLayout, externalTexture: GPUExternalTextureBindingLayout) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.binding] = binding.jsValue() + object[Strings.visibility] = visibility.jsValue() + object[Strings.buffer] = buffer.jsValue() + object[Strings.sampler] = sampler.jsValue() + object[Strings.texture] = texture.jsValue() + object[Strings.storageTexture] = storageTexture.jsValue() + object[Strings.externalTexture] = externalTexture.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _binding = ReadWriteAttribute(jsObject: object, name: Strings.binding) + _visibility = ReadWriteAttribute(jsObject: object, name: Strings.visibility) + _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) + _sampler = ReadWriteAttribute(jsObject: object, name: Strings.sampler) + _texture = ReadWriteAttribute(jsObject: object, name: Strings.texture) + _storageTexture = ReadWriteAttribute(jsObject: object, name: Strings.storageTexture) + _externalTexture = ReadWriteAttribute(jsObject: object, name: Strings.externalTexture) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var binding: GPUIndex32 + + @ReadWriteAttribute + public var visibility: GPUShaderStageFlags + + @ReadWriteAttribute + public var buffer: GPUBufferBindingLayout + + @ReadWriteAttribute + public var sampler: GPUSamplerBindingLayout + + @ReadWriteAttribute + public var texture: GPUTextureBindingLayout + + @ReadWriteAttribute + public var storageTexture: GPUStorageTextureBindingLayout + + @ReadWriteAttribute + public var externalTexture: GPUExternalTextureBindingLayout +} diff --git a/Sources/DOMKit/WebIDL/GPUBlendComponent.swift b/Sources/DOMKit/WebIDL/GPUBlendComponent.swift new file mode 100644 index 00000000..798fa2e5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBlendComponent.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBlendComponent: BridgedDictionary { + public convenience init(operation: GPUBlendOperation, srcFactor: GPUBlendFactor, dstFactor: GPUBlendFactor) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.operation] = operation.jsValue() + object[Strings.srcFactor] = srcFactor.jsValue() + object[Strings.dstFactor] = dstFactor.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _operation = ReadWriteAttribute(jsObject: object, name: Strings.operation) + _srcFactor = ReadWriteAttribute(jsObject: object, name: Strings.srcFactor) + _dstFactor = ReadWriteAttribute(jsObject: object, name: Strings.dstFactor) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var operation: GPUBlendOperation + + @ReadWriteAttribute + public var srcFactor: GPUBlendFactor + + @ReadWriteAttribute + public var dstFactor: GPUBlendFactor +} diff --git a/Sources/DOMKit/WebIDL/GPUBlendFactor.swift b/Sources/DOMKit/WebIDL/GPUBlendFactor.swift new file mode 100644 index 00000000..4eb8b4cd --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBlendFactor.swift @@ -0,0 +1,33 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUBlendFactor: JSString, JSValueCompatible { + case zero = "zero" + case one = "one" + case src = "src" + case oneMinusSrc = "one-minus-src" + case srcAlpha = "src-alpha" + case oneMinusSrcAlpha = "one-minus-src-alpha" + case dst = "dst" + case oneMinusDst = "one-minus-dst" + case dstAlpha = "dst-alpha" + case oneMinusDstAlpha = "one-minus-dst-alpha" + case srcAlphaSaturated = "src-alpha-saturated" + case constant = "constant" + case oneMinusConstant = "one-minus-constant" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUBlendOperation.swift b/Sources/DOMKit/WebIDL/GPUBlendOperation.swift new file mode 100644 index 00000000..014def01 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBlendOperation.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUBlendOperation: JSString, JSValueCompatible { + case add = "add" + case subtract = "subtract" + case reverseSubtract = "reverse-subtract" + case min = "min" + case max = "max" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUBlendState.swift b/Sources/DOMKit/WebIDL/GPUBlendState.swift new file mode 100644 index 00000000..1d09ca29 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBlendState.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBlendState: BridgedDictionary { + public convenience init(color: GPUBlendComponent, alpha: GPUBlendComponent) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.color] = color.jsValue() + object[Strings.alpha] = alpha.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _color = ReadWriteAttribute(jsObject: object, name: Strings.color) + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var color: GPUBlendComponent + + @ReadWriteAttribute + public var alpha: GPUBlendComponent +} diff --git a/Sources/DOMKit/WebIDL/GPUBuffer.swift b/Sources/DOMKit/WebIDL/GPUBuffer.swift new file mode 100644 index 00000000..0cb27c44 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBuffer.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBuffer: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUBuffer].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) -> JSPromise { + jsObject[Strings.mapAsync]!(mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.mapAsync]!(mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func getMappedRange(offset: GPUSize64? = nil, size: GPUSize64? = nil) -> ArrayBuffer { + jsObject[Strings.getMappedRange]!(offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined).fromJSValue()! + } + + public func unmap() { + _ = jsObject[Strings.unmap]!() + } + + public func destroy() { + _ = jsObject[Strings.destroy]!() + } +} diff --git a/Sources/DOMKit/WebIDL/GPUBufferBinding.swift b/Sources/DOMKit/WebIDL/GPUBufferBinding.swift new file mode 100644 index 00000000..b73f06c4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBufferBinding.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBufferBinding: BridgedDictionary { + public convenience init(buffer: GPUBuffer, offset: GPUSize64, size: GPUSize64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.buffer] = buffer.jsValue() + object[Strings.offset] = offset.jsValue() + object[Strings.size] = size.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + _size = ReadWriteAttribute(jsObject: object, name: Strings.size) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var buffer: GPUBuffer + + @ReadWriteAttribute + public var offset: GPUSize64 + + @ReadWriteAttribute + public var size: GPUSize64 +} diff --git a/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift new file mode 100644 index 00000000..fb214e7d --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBufferBindingLayout: BridgedDictionary { + public convenience init(type: GPUBufferBindingType, hasDynamicOffset: Bool, minBindingSize: GPUSize64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.hasDynamicOffset] = hasDynamicOffset.jsValue() + object[Strings.minBindingSize] = minBindingSize.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _hasDynamicOffset = ReadWriteAttribute(jsObject: object, name: Strings.hasDynamicOffset) + _minBindingSize = ReadWriteAttribute(jsObject: object, name: Strings.minBindingSize) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: GPUBufferBindingType + + @ReadWriteAttribute + public var hasDynamicOffset: Bool + + @ReadWriteAttribute + public var minBindingSize: GPUSize64 +} diff --git a/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift b/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift new file mode 100644 index 00000000..d24a01ce --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUBufferBindingType: JSString, JSValueCompatible { + case uniform = "uniform" + case storage = "storage" + case readOnlyStorage = "read-only-storage" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift b/Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift new file mode 100644 index 00000000..fbb643ae --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUBufferDescriptor: BridgedDictionary { + public convenience init(size: GPUSize64, usage: GPUBufferUsageFlags, mappedAtCreation: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.size] = size.jsValue() + object[Strings.usage] = usage.jsValue() + object[Strings.mappedAtCreation] = mappedAtCreation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _size = ReadWriteAttribute(jsObject: object, name: Strings.size) + _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) + _mappedAtCreation = ReadWriteAttribute(jsObject: object, name: Strings.mappedAtCreation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var size: GPUSize64 + + @ReadWriteAttribute + public var usage: GPUBufferUsageFlags + + @ReadWriteAttribute + public var mappedAtCreation: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPUBufferUsage.swift b/Sources/DOMKit/WebIDL/GPUBufferUsage.swift new file mode 100644 index 00000000..f15122f0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBufferUsage.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUBufferUsage { + public static var jsObject: JSObject { + JSObject.global.[Strings.GPUBufferUsage].object! + } + + public static let MAP_READ: GPUFlagsConstant = 0x0001 + + public static let MAP_WRITE: GPUFlagsConstant = 0x0002 + + public static let COPY_SRC: GPUFlagsConstant = 0x0004 + + public static let COPY_DST: GPUFlagsConstant = 0x0008 + + public static let INDEX: GPUFlagsConstant = 0x0010 + + public static let VERTEX: GPUFlagsConstant = 0x0020 + + public static let UNIFORM: GPUFlagsConstant = 0x0040 + + public static let STORAGE: GPUFlagsConstant = 0x0080 + + public static let INDIRECT: GPUFlagsConstant = 0x0100 + + public static let QUERY_RESOLVE: GPUFlagsConstant = 0x0200 +} diff --git a/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift b/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift new file mode 100644 index 00000000..4afa667f --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUCanvasCompositingAlphaMode: JSString, JSValueCompatible { + case opaque = "opaque" + case premultiplied = "premultiplied" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift b/Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift new file mode 100644 index 00000000..3cdf14bd --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUCanvasConfiguration: BridgedDictionary { + public convenience init(device: GPUDevice, format: GPUTextureFormat, usage: GPUTextureUsageFlags, viewFormats: [GPUTextureFormat], colorSpace: GPUPredefinedColorSpace, compositingAlphaMode: GPUCanvasCompositingAlphaMode, size: GPUExtent3D) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.device] = device.jsValue() + object[Strings.format] = format.jsValue() + object[Strings.usage] = usage.jsValue() + object[Strings.viewFormats] = viewFormats.jsValue() + object[Strings.colorSpace] = colorSpace.jsValue() + object[Strings.compositingAlphaMode] = compositingAlphaMode.jsValue() + object[Strings.size] = size.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _device = ReadWriteAttribute(jsObject: object, name: Strings.device) + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) + _viewFormats = ReadWriteAttribute(jsObject: object, name: Strings.viewFormats) + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) + _compositingAlphaMode = ReadWriteAttribute(jsObject: object, name: Strings.compositingAlphaMode) + _size = ReadWriteAttribute(jsObject: object, name: Strings.size) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var device: GPUDevice + + @ReadWriteAttribute + public var format: GPUTextureFormat + + @ReadWriteAttribute + public var usage: GPUTextureUsageFlags + + @ReadWriteAttribute + public var viewFormats: [GPUTextureFormat] + + @ReadWriteAttribute + public var colorSpace: GPUPredefinedColorSpace + + @ReadWriteAttribute + public var compositingAlphaMode: GPUCanvasCompositingAlphaMode + + @ReadWriteAttribute + public var size: GPUExtent3D +} diff --git a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift new file mode 100644 index 00000000..102f0518 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUCanvasContext: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPUCanvasContext].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var canvas: __UNSUPPORTED_UNION__ + + public func configure(configuration: GPUCanvasConfiguration) { + _ = jsObject[Strings.configure]!(configuration.jsValue()) + } + + public func unconfigure() { + _ = jsObject[Strings.unconfigure]!() + } + + public func getPreferredFormat(adapter: GPUAdapter) -> GPUTextureFormat { + jsObject[Strings.getPreferredFormat]!(adapter.jsValue()).fromJSValue()! + } + + public func getCurrentTexture() -> GPUTexture { + jsObject[Strings.getCurrentTexture]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/GPUColorDict.swift b/Sources/DOMKit/WebIDL/GPUColorDict.swift new file mode 100644 index 00000000..36762e44 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUColorDict.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUColorDict: BridgedDictionary { + public convenience init(r: Double, g: Double, b: Double, a: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.r] = r.jsValue() + object[Strings.g] = g.jsValue() + object[Strings.b] = b.jsValue() + object[Strings.a] = a.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _r = ReadWriteAttribute(jsObject: object, name: Strings.r) + _g = ReadWriteAttribute(jsObject: object, name: Strings.g) + _b = ReadWriteAttribute(jsObject: object, name: Strings.b) + _a = ReadWriteAttribute(jsObject: object, name: Strings.a) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var r: Double + + @ReadWriteAttribute + public var g: Double + + @ReadWriteAttribute + public var b: Double + + @ReadWriteAttribute + public var a: Double +} diff --git a/Sources/DOMKit/WebIDL/GPUColorTargetState.swift b/Sources/DOMKit/WebIDL/GPUColorTargetState.swift new file mode 100644 index 00000000..adf69613 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUColorTargetState.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUColorTargetState: BridgedDictionary { + public convenience init(format: GPUTextureFormat, blend: GPUBlendState, writeMask: GPUColorWriteFlags) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.format] = format.jsValue() + object[Strings.blend] = blend.jsValue() + object[Strings.writeMask] = writeMask.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _blend = ReadWriteAttribute(jsObject: object, name: Strings.blend) + _writeMask = ReadWriteAttribute(jsObject: object, name: Strings.writeMask) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var format: GPUTextureFormat + + @ReadWriteAttribute + public var blend: GPUBlendState + + @ReadWriteAttribute + public var writeMask: GPUColorWriteFlags +} diff --git a/Sources/DOMKit/WebIDL/GPUColorWrite.swift b/Sources/DOMKit/WebIDL/GPUColorWrite.swift new file mode 100644 index 00000000..6127c126 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUColorWrite.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUColorWrite { + public static var jsObject: JSObject { + JSObject.global.[Strings.GPUColorWrite].object! + } + + public static let RED: GPUFlagsConstant = 0x1 + + public static let GREEN: GPUFlagsConstant = 0x2 + + public static let BLUE: GPUFlagsConstant = 0x4 + + public static let ALPHA: GPUFlagsConstant = 0x8 + + public static let ALL: GPUFlagsConstant = 0xF +} diff --git a/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift b/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift new file mode 100644 index 00000000..ac975fff --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUCommandBuffer: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUCommandBuffer].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/GPUCommandBufferDescriptor.swift b/Sources/DOMKit/WebIDL/GPUCommandBufferDescriptor.swift new file mode 100644 index 00000000..cd2f999d --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCommandBufferDescriptor.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUCommandBufferDescriptor: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift b/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift new file mode 100644 index 00000000..53c87458 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUCommandEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin { + public class var constructor: JSFunction { JSObject.global[Strings.GPUCommandEncoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func beginRenderPass(descriptor: GPURenderPassDescriptor) -> GPURenderPassEncoder { + jsObject[Strings.beginRenderPass]!(descriptor.jsValue()).fromJSValue()! + } + + public func beginComputePass(descriptor: GPUComputePassDescriptor? = nil) -> GPUComputePassEncoder { + jsObject[Strings.beginComputePass]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } + + public func copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64) { + _ = jsObject[Strings.copyBufferToBuffer]!(source.jsValue(), sourceOffset.jsValue(), destination.jsValue(), destinationOffset.jsValue(), size.jsValue()) + } + + public func copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { + _ = jsObject[Strings.copyBufferToTexture]!(source.jsValue(), destination.jsValue(), copySize.jsValue()) + } + + public func copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D) { + _ = jsObject[Strings.copyTextureToBuffer]!(source.jsValue(), destination.jsValue(), copySize.jsValue()) + } + + public func copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { + _ = jsObject[Strings.copyTextureToTexture]!(source.jsValue(), destination.jsValue(), copySize.jsValue()) + } + + public func clearBuffer(buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { + _ = jsObject[Strings.clearBuffer]!(buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined) + } + + public func writeTimestamp(querySet: GPUQuerySet, queryIndex: GPUSize32) { + _ = jsObject[Strings.writeTimestamp]!(querySet.jsValue(), queryIndex.jsValue()) + } + + public func resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64) { + _ = jsObject[Strings.resolveQuerySet]!(querySet.jsValue(), firstQuery.jsValue(), queryCount.jsValue(), destination.jsValue(), destinationOffset.jsValue()) + } + + public func finish(descriptor: GPUCommandBufferDescriptor? = nil) -> GPUCommandBuffer { + jsObject[Strings.finish]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/GPUCommandEncoderDescriptor.swift b/Sources/DOMKit/WebIDL/GPUCommandEncoderDescriptor.swift new file mode 100644 index 00000000..a778bfdb --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCommandEncoderDescriptor.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUCommandEncoderDescriptor: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/GPUCommandsMixin.swift b/Sources/DOMKit/WebIDL/GPUCommandsMixin.swift new file mode 100644 index 00000000..4a48057c --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCommandsMixin.swift @@ -0,0 +1,7 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol GPUCommandsMixin: JSBridgedClass {} +public extension GPUCommandsMixin {} diff --git a/Sources/DOMKit/WebIDL/GPUCompareFunction.swift b/Sources/DOMKit/WebIDL/GPUCompareFunction.swift new file mode 100644 index 00000000..6e8388f6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCompareFunction.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUCompareFunction: JSString, JSValueCompatible { + case never = "never" + case less = "less" + case equal = "equal" + case lessEqual = "less-equal" + case greater = "greater" + case notEqual = "not-equal" + case greaterEqual = "greater-equal" + case always = "always" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUCompilationInfo.swift b/Sources/DOMKit/WebIDL/GPUCompilationInfo.swift new file mode 100644 index 00000000..c30a254f --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCompilationInfo.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUCompilationInfo: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPUCompilationInfo].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _messages = ReadonlyAttribute(jsObject: jsObject, name: Strings.messages) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var messages: [GPUCompilationMessage] +} diff --git a/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift b/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift new file mode 100644 index 00000000..b1ad4065 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUCompilationMessage: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPUCompilationMessage].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _lineNum = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNum) + _linePos = ReadonlyAttribute(jsObject: jsObject, name: Strings.linePos) + _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var message: String + + @ReadonlyAttribute + public var type: GPUCompilationMessageType + + @ReadonlyAttribute + public var lineNum: UInt64 + + @ReadonlyAttribute + public var linePos: UInt64 + + @ReadonlyAttribute + public var offset: UInt64 + + @ReadonlyAttribute + public var length: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift b/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift new file mode 100644 index 00000000..aa3e03f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUCompilationMessageType: JSString, JSValueCompatible { + case error = "error" + case warning = "warning" + case info = "info" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift b/Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift new file mode 100644 index 00000000..e1b0575b --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUComputePassDescriptor: BridgedDictionary { + public convenience init(timestampWrites: GPUComputePassTimestampWrites) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.timestampWrites] = timestampWrites.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _timestampWrites = ReadWriteAttribute(jsObject: object, name: Strings.timestampWrites) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var timestampWrites: GPUComputePassTimestampWrites +} diff --git a/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift new file mode 100644 index 00000000..64d8f4ce --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUComputePassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder { + public class var constructor: JSFunction { JSObject.global[Strings.GPUComputePassEncoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func setPipeline(pipeline: GPUComputePipeline) { + _ = jsObject[Strings.setPipeline]!(pipeline.jsValue()) + } + + public func dispatch(workgroupCountX: GPUSize32, workgroupCountY: GPUSize32? = nil, workgroupCountZ: GPUSize32? = nil) { + _ = jsObject[Strings.dispatch]!(workgroupCountX.jsValue(), workgroupCountY?.jsValue() ?? .undefined, workgroupCountZ?.jsValue() ?? .undefined) + } + + public func dispatchIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { + _ = jsObject[Strings.dispatchIndirect]!(indirectBuffer.jsValue(), indirectOffset.jsValue()) + } + + public func end() { + _ = jsObject[Strings.end]!() + } +} diff --git a/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift b/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift new file mode 100644 index 00000000..7bd4f416 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUComputePassTimestampLocation: JSString, JSValueCompatible { + case beginning = "beginning" + case end = "end" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift b/Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift new file mode 100644 index 00000000..4c656940 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUComputePassTimestampWrite: BridgedDictionary { + public convenience init(querySet: GPUQuerySet, queryIndex: GPUSize32, location: GPUComputePassTimestampLocation) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.querySet] = querySet.jsValue() + object[Strings.queryIndex] = queryIndex.jsValue() + object[Strings.location] = location.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _querySet = ReadWriteAttribute(jsObject: object, name: Strings.querySet) + _queryIndex = ReadWriteAttribute(jsObject: object, name: Strings.queryIndex) + _location = ReadWriteAttribute(jsObject: object, name: Strings.location) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var querySet: GPUQuerySet + + @ReadWriteAttribute + public var queryIndex: GPUSize32 + + @ReadWriteAttribute + public var location: GPUComputePassTimestampLocation +} diff --git a/Sources/DOMKit/WebIDL/GPUComputePipeline.swift b/Sources/DOMKit/WebIDL/GPUComputePipeline.swift new file mode 100644 index 00000000..ecacd7f3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUComputePipeline.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUComputePipeline: JSBridgedClass, GPUObjectBase, GPUPipelineBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUComputePipeline].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift b/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift new file mode 100644 index 00000000..e54ae67c --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUComputePipelineDescriptor: BridgedDictionary { + public convenience init(compute: GPUProgrammableStage) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.compute] = compute.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _compute = ReadWriteAttribute(jsObject: object, name: Strings.compute) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var compute: GPUProgrammableStage +} diff --git a/Sources/DOMKit/WebIDL/GPUCullMode.swift b/Sources/DOMKit/WebIDL/GPUCullMode.swift new file mode 100644 index 00000000..1f6b5a25 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCullMode.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUCullMode: JSString, JSValueCompatible { + case none = "none" + case front = "front" + case back = "back" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift b/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift new file mode 100644 index 00000000..0c163888 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift @@ -0,0 +1,19 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol GPUDebugCommandsMixin: JSBridgedClass {} +public extension GPUDebugCommandsMixin { + func pushDebugGroup(groupLabel: String) { + _ = jsObject[Strings.pushDebugGroup]!(groupLabel.jsValue()) + } + + func popDebugGroup() { + _ = jsObject[Strings.popDebugGroup]!() + } + + func insertDebugMarker(markerLabel: String) { + _ = jsObject[Strings.insertDebugMarker]!(markerLabel.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift b/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift new file mode 100644 index 00000000..45e86e56 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift @@ -0,0 +1,65 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUDepthStencilState: BridgedDictionary { + public convenience init(format: GPUTextureFormat, depthWriteEnabled: Bool, depthCompare: GPUCompareFunction, stencilFront: GPUStencilFaceState, stencilBack: GPUStencilFaceState, stencilReadMask: GPUStencilValue, stencilWriteMask: GPUStencilValue, depthBias: GPUDepthBias, depthBiasSlopeScale: Float, depthBiasClamp: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.format] = format.jsValue() + object[Strings.depthWriteEnabled] = depthWriteEnabled.jsValue() + object[Strings.depthCompare] = depthCompare.jsValue() + object[Strings.stencilFront] = stencilFront.jsValue() + object[Strings.stencilBack] = stencilBack.jsValue() + object[Strings.stencilReadMask] = stencilReadMask.jsValue() + object[Strings.stencilWriteMask] = stencilWriteMask.jsValue() + object[Strings.depthBias] = depthBias.jsValue() + object[Strings.depthBiasSlopeScale] = depthBiasSlopeScale.jsValue() + object[Strings.depthBiasClamp] = depthBiasClamp.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _depthWriteEnabled = ReadWriteAttribute(jsObject: object, name: Strings.depthWriteEnabled) + _depthCompare = ReadWriteAttribute(jsObject: object, name: Strings.depthCompare) + _stencilFront = ReadWriteAttribute(jsObject: object, name: Strings.stencilFront) + _stencilBack = ReadWriteAttribute(jsObject: object, name: Strings.stencilBack) + _stencilReadMask = ReadWriteAttribute(jsObject: object, name: Strings.stencilReadMask) + _stencilWriteMask = ReadWriteAttribute(jsObject: object, name: Strings.stencilWriteMask) + _depthBias = ReadWriteAttribute(jsObject: object, name: Strings.depthBias) + _depthBiasSlopeScale = ReadWriteAttribute(jsObject: object, name: Strings.depthBiasSlopeScale) + _depthBiasClamp = ReadWriteAttribute(jsObject: object, name: Strings.depthBiasClamp) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var format: GPUTextureFormat + + @ReadWriteAttribute + public var depthWriteEnabled: Bool + + @ReadWriteAttribute + public var depthCompare: GPUCompareFunction + + @ReadWriteAttribute + public var stencilFront: GPUStencilFaceState + + @ReadWriteAttribute + public var stencilBack: GPUStencilFaceState + + @ReadWriteAttribute + public var stencilReadMask: GPUStencilValue + + @ReadWriteAttribute + public var stencilWriteMask: GPUStencilValue + + @ReadWriteAttribute + public var depthBias: GPUDepthBias + + @ReadWriteAttribute + public var depthBiasSlopeScale: Float + + @ReadWriteAttribute + public var depthBiasClamp: Float +} diff --git a/Sources/DOMKit/WebIDL/GPUDevice.swift b/Sources/DOMKit/WebIDL/GPUDevice.swift new file mode 100644 index 00000000..9b8d2e3a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUDevice.swift @@ -0,0 +1,122 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUDevice: EventTarget, GPUObjectBase { + override public class var constructor: JSFunction { JSObject.global[Strings.GPUDevice].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _features = ReadonlyAttribute(jsObject: jsObject, name: Strings.features) + _limits = ReadonlyAttribute(jsObject: jsObject, name: Strings.limits) + _queue = ReadonlyAttribute(jsObject: jsObject, name: Strings.queue) + _lost = ReadonlyAttribute(jsObject: jsObject, name: Strings.lost) + _onuncapturederror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onuncapturederror) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var features: GPUSupportedFeatures + + @ReadonlyAttribute + public var limits: GPUSupportedLimits + + @ReadonlyAttribute + public var queue: GPUQueue + + public func destroy() { + _ = jsObject[Strings.destroy]!() + } + + public func createBuffer(descriptor: GPUBufferDescriptor) -> GPUBuffer { + jsObject[Strings.createBuffer]!(descriptor.jsValue()).fromJSValue()! + } + + public func createTexture(descriptor: GPUTextureDescriptor) -> GPUTexture { + jsObject[Strings.createTexture]!(descriptor.jsValue()).fromJSValue()! + } + + public func createSampler(descriptor: GPUSamplerDescriptor? = nil) -> GPUSampler { + jsObject[Strings.createSampler]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } + + public func importExternalTexture(descriptor: GPUExternalTextureDescriptor) -> GPUExternalTexture { + jsObject[Strings.importExternalTexture]!(descriptor.jsValue()).fromJSValue()! + } + + public func createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor) -> GPUBindGroupLayout { + jsObject[Strings.createBindGroupLayout]!(descriptor.jsValue()).fromJSValue()! + } + + public func createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor) -> GPUPipelineLayout { + jsObject[Strings.createPipelineLayout]!(descriptor.jsValue()).fromJSValue()! + } + + public func createBindGroup(descriptor: GPUBindGroupDescriptor) -> GPUBindGroup { + jsObject[Strings.createBindGroup]!(descriptor.jsValue()).fromJSValue()! + } + + public func createShaderModule(descriptor: GPUShaderModuleDescriptor) -> GPUShaderModule { + jsObject[Strings.createShaderModule]!(descriptor.jsValue()).fromJSValue()! + } + + public func createComputePipeline(descriptor: GPUComputePipelineDescriptor) -> GPUComputePipeline { + jsObject[Strings.createComputePipeline]!(descriptor.jsValue()).fromJSValue()! + } + + public func createRenderPipeline(descriptor: GPURenderPipelineDescriptor) -> GPURenderPipeline { + jsObject[Strings.createRenderPipeline]!(descriptor.jsValue()).fromJSValue()! + } + + public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) -> JSPromise { + jsObject[Strings.createComputePipelineAsync]!(descriptor.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) async throws -> GPUComputePipeline { + let _promise: JSPromise = jsObject[Strings.createComputePipelineAsync]!(descriptor.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) -> JSPromise { + jsObject[Strings.createRenderPipelineAsync]!(descriptor.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) async throws -> GPURenderPipeline { + let _promise: JSPromise = jsObject[Strings.createRenderPipelineAsync]!(descriptor.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func createCommandEncoder(descriptor: GPUCommandEncoderDescriptor? = nil) -> GPUCommandEncoder { + jsObject[Strings.createCommandEncoder]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor) -> GPURenderBundleEncoder { + jsObject[Strings.createRenderBundleEncoder]!(descriptor.jsValue()).fromJSValue()! + } + + public func createQuerySet(descriptor: GPUQuerySetDescriptor) -> GPUQuerySet { + jsObject[Strings.createQuerySet]!(descriptor.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var lost: JSPromise + + public func pushErrorScope(filter: GPUErrorFilter) { + _ = jsObject[Strings.pushErrorScope]!(filter.jsValue()) + } + + public func popErrorScope() -> JSPromise { + jsObject[Strings.popErrorScope]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func popErrorScope() async throws -> GPUError? { + let _promise: JSPromise = jsObject[Strings.popErrorScope]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onuncapturederror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift b/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift new file mode 100644 index 00000000..db1e5cb1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUDeviceDescriptor: BridgedDictionary { + public convenience init(requiredFeatures: [GPUFeatureName], requiredLimits: [String: GPUSize64], defaultQueue: GPUQueueDescriptor) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.requiredFeatures] = requiredFeatures.jsValue() + object[Strings.requiredLimits] = requiredLimits.jsValue() + object[Strings.defaultQueue] = defaultQueue.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _requiredFeatures = ReadWriteAttribute(jsObject: object, name: Strings.requiredFeatures) + _requiredLimits = ReadWriteAttribute(jsObject: object, name: Strings.requiredLimits) + _defaultQueue = ReadWriteAttribute(jsObject: object, name: Strings.defaultQueue) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var requiredFeatures: [GPUFeatureName] + + @ReadWriteAttribute + public var requiredLimits: [String: GPUSize64] + + @ReadWriteAttribute + public var defaultQueue: GPUQueueDescriptor +} diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift new file mode 100644 index 00000000..bc4ac9e3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUDeviceLostInfo: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPUDeviceLostInfo].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var reason: __UNSUPPORTED_UNION__ + + @ReadonlyAttribute + public var message: String +} diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift new file mode 100644 index 00000000..a99a2e9a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUDeviceLostReason: JSString, JSValueCompatible { + case destroyed = "destroyed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUErrorFilter.swift b/Sources/DOMKit/WebIDL/GPUErrorFilter.swift new file mode 100644 index 00000000..c4481a00 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUErrorFilter.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUErrorFilter: JSString, JSValueCompatible { + case outOfMemory = "out-of-memory" + case validation = "validation" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift b/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift new file mode 100644 index 00000000..28c529ad --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUExtent3DDict: BridgedDictionary { + public convenience init(width: GPUIntegerCoordinate, height: GPUIntegerCoordinate, depthOrArrayLayers: GPUIntegerCoordinate) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.width] = width.jsValue() + object[Strings.height] = height.jsValue() + object[Strings.depthOrArrayLayers] = depthOrArrayLayers.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) + _depthOrArrayLayers = ReadWriteAttribute(jsObject: object, name: Strings.depthOrArrayLayers) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var width: GPUIntegerCoordinate + + @ReadWriteAttribute + public var height: GPUIntegerCoordinate + + @ReadWriteAttribute + public var depthOrArrayLayers: GPUIntegerCoordinate +} diff --git a/Sources/DOMKit/WebIDL/GPUExternalTexture.swift b/Sources/DOMKit/WebIDL/GPUExternalTexture.swift new file mode 100644 index 00000000..152e1090 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUExternalTexture.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUExternalTexture: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUExternalTexture].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _expired = ReadonlyAttribute(jsObject: jsObject, name: Strings.expired) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var expired: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPUExternalTextureBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUExternalTextureBindingLayout.swift new file mode 100644 index 00000000..a68629e6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUExternalTextureBindingLayout.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUExternalTextureBindingLayout: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift b/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift new file mode 100644 index 00000000..4dd787eb --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUExternalTextureDescriptor: BridgedDictionary { + public convenience init(source: HTMLVideoElement, colorSpace: GPUPredefinedColorSpace) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.source] = source.jsValue() + object[Strings.colorSpace] = colorSpace.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _source = ReadWriteAttribute(jsObject: object, name: Strings.source) + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var source: HTMLVideoElement + + @ReadWriteAttribute + public var colorSpace: GPUPredefinedColorSpace +} diff --git a/Sources/DOMKit/WebIDL/GPUFeatureName.swift b/Sources/DOMKit/WebIDL/GPUFeatureName.swift new file mode 100644 index 00000000..3ab1f34f --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUFeatureName.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUFeatureName: JSString, JSValueCompatible { + case depthClipControl = "depth-clip-control" + case depth24unormStencil8 = "depth24unorm-stencil8" + case depth32floatStencil8 = "depth32float-stencil8" + case textureCompressionBc = "texture-compression-bc" + case textureCompressionEtc2 = "texture-compression-etc2" + case textureCompressionAstc = "texture-compression-astc" + case timestampQuery = "timestamp-query" + case indirectFirstInstance = "indirect-first-instance" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUFilterMode.swift b/Sources/DOMKit/WebIDL/GPUFilterMode.swift new file mode 100644 index 00000000..f3e5e2b4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUFilterMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUFilterMode: JSString, JSValueCompatible { + case nearest = "nearest" + case linear = "linear" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUFragmentState.swift b/Sources/DOMKit/WebIDL/GPUFragmentState.swift new file mode 100644 index 00000000..cd78605e --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUFragmentState.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUFragmentState: BridgedDictionary { + public convenience init(targets: [GPUColorTargetState?]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.targets] = targets.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _targets = ReadWriteAttribute(jsObject: object, name: Strings.targets) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var targets: [GPUColorTargetState?] +} diff --git a/Sources/DOMKit/WebIDL/GPUFrontFace.swift b/Sources/DOMKit/WebIDL/GPUFrontFace.swift new file mode 100644 index 00000000..721695c4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUFrontFace.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUFrontFace: JSString, JSValueCompatible { + case ccw = "ccw" + case cw = "cw" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift b/Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift new file mode 100644 index 00000000..8191875d --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUImageCopyBuffer: BridgedDictionary { + public convenience init(buffer: GPUBuffer) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.buffer] = buffer.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var buffer: GPUBuffer +} diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift b/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift new file mode 100644 index 00000000..74bffea5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUImageCopyExternalImage: BridgedDictionary { + public convenience init(source: __UNSUPPORTED_UNION__, origin: GPUOrigin2D, flipY: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.source] = source.jsValue() + object[Strings.origin] = origin.jsValue() + object[Strings.flipY] = flipY.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _source = ReadWriteAttribute(jsObject: object, name: Strings.source) + _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) + _flipY = ReadWriteAttribute(jsObject: object, name: Strings.flipY) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var source: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var origin: GPUOrigin2D + + @ReadWriteAttribute + public var flipY: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift b/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift new file mode 100644 index 00000000..2648b776 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUImageCopyTexture: BridgedDictionary { + public convenience init(texture: GPUTexture, mipLevel: GPUIntegerCoordinate, origin: GPUOrigin3D, aspect: GPUTextureAspect) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.texture] = texture.jsValue() + object[Strings.mipLevel] = mipLevel.jsValue() + object[Strings.origin] = origin.jsValue() + object[Strings.aspect] = aspect.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _texture = ReadWriteAttribute(jsObject: object, name: Strings.texture) + _mipLevel = ReadWriteAttribute(jsObject: object, name: Strings.mipLevel) + _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) + _aspect = ReadWriteAttribute(jsObject: object, name: Strings.aspect) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var texture: GPUTexture + + @ReadWriteAttribute + public var mipLevel: GPUIntegerCoordinate + + @ReadWriteAttribute + public var origin: GPUOrigin3D + + @ReadWriteAttribute + public var aspect: GPUTextureAspect +} diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift b/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift new file mode 100644 index 00000000..d60bf036 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUImageCopyTextureTagged: BridgedDictionary { + public convenience init(colorSpace: GPUPredefinedColorSpace, premultipliedAlpha: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.colorSpace] = colorSpace.jsValue() + object[Strings.premultipliedAlpha] = premultipliedAlpha.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) + _premultipliedAlpha = ReadWriteAttribute(jsObject: object, name: Strings.premultipliedAlpha) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var colorSpace: GPUPredefinedColorSpace + + @ReadWriteAttribute + public var premultipliedAlpha: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift b/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift new file mode 100644 index 00000000..907ecfbc --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUImageDataLayout: BridgedDictionary { + public convenience init(offset: GPUSize64, bytesPerRow: GPUSize32, rowsPerImage: GPUSize32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.offset] = offset.jsValue() + object[Strings.bytesPerRow] = bytesPerRow.jsValue() + object[Strings.rowsPerImage] = rowsPerImage.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + _bytesPerRow = ReadWriteAttribute(jsObject: object, name: Strings.bytesPerRow) + _rowsPerImage = ReadWriteAttribute(jsObject: object, name: Strings.rowsPerImage) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var offset: GPUSize64 + + @ReadWriteAttribute + public var bytesPerRow: GPUSize32 + + @ReadWriteAttribute + public var rowsPerImage: GPUSize32 +} diff --git a/Sources/DOMKit/WebIDL/GPUIndexFormat.swift b/Sources/DOMKit/WebIDL/GPUIndexFormat.swift new file mode 100644 index 00000000..d04ba305 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUIndexFormat.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUIndexFormat: JSString, JSValueCompatible { + case uint16 = "uint16" + case uint32 = "uint32" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPULoadOp.swift b/Sources/DOMKit/WebIDL/GPULoadOp.swift new file mode 100644 index 00000000..ee8f8c07 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPULoadOp.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPULoadOp: JSString, JSValueCompatible { + case load = "load" + case clear = "clear" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUMapMode.swift b/Sources/DOMKit/WebIDL/GPUMapMode.swift new file mode 100644 index 00000000..ef0fd29b --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUMapMode.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUMapMode { + public static var jsObject: JSObject { + JSObject.global.[Strings.GPUMapMode].object! + } + + public static let READ: GPUFlagsConstant = 0x0001 + + public static let WRITE: GPUFlagsConstant = 0x0002 +} diff --git a/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift b/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift new file mode 100644 index 00000000..c95dcd47 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUMipmapFilterMode: JSString, JSValueCompatible { + case nearest = "nearest" + case linear = "linear" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUMultisampleState.swift b/Sources/DOMKit/WebIDL/GPUMultisampleState.swift new file mode 100644 index 00000000..40fcbaf0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUMultisampleState.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUMultisampleState: BridgedDictionary { + public convenience init(count: GPUSize32, mask: GPUSampleMask, alphaToCoverageEnabled: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.count] = count.jsValue() + object[Strings.mask] = mask.jsValue() + object[Strings.alphaToCoverageEnabled] = alphaToCoverageEnabled.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _count = ReadWriteAttribute(jsObject: object, name: Strings.count) + _mask = ReadWriteAttribute(jsObject: object, name: Strings.mask) + _alphaToCoverageEnabled = ReadWriteAttribute(jsObject: object, name: Strings.alphaToCoverageEnabled) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var count: GPUSize32 + + @ReadWriteAttribute + public var mask: GPUSampleMask + + @ReadWriteAttribute + public var alphaToCoverageEnabled: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPUObjectBase.swift b/Sources/DOMKit/WebIDL/GPUObjectBase.swift new file mode 100644 index 00000000..f67ba423 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUObjectBase.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol GPUObjectBase: JSBridgedClass {} +public extension GPUObjectBase { + var label: __UNSUPPORTED_UNION__ { + get { ReadWriteAttribute[Strings.label, in: jsObject] } + set { ReadWriteAttribute[Strings.label, in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift b/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift new file mode 100644 index 00000000..2555fbeb --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUObjectDescriptorBase: BridgedDictionary { + public convenience init(label: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.label] = label.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _label = ReadWriteAttribute(jsObject: object, name: Strings.label) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var label: String +} diff --git a/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift b/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift new file mode 100644 index 00000000..5cbe2a05 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUOrigin2DDict: BridgedDictionary { + public convenience init(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var x: GPUIntegerCoordinate + + @ReadWriteAttribute + public var y: GPUIntegerCoordinate +} diff --git a/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift b/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift new file mode 100644 index 00000000..516a3e98 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUOrigin3DDict: BridgedDictionary { + public convenience init(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, z: GPUIntegerCoordinate) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.z] = z.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _z = ReadWriteAttribute(jsObject: object, name: Strings.z) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var x: GPUIntegerCoordinate + + @ReadWriteAttribute + public var y: GPUIntegerCoordinate + + @ReadWriteAttribute + public var z: GPUIntegerCoordinate +} diff --git a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift b/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift new file mode 100644 index 00000000..df85d8fd --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUOutOfMemoryError: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPUOutOfMemoryError].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } +} diff --git a/Sources/DOMKit/WebIDL/GPUPipelineBase.swift b/Sources/DOMKit/WebIDL/GPUPipelineBase.swift new file mode 100644 index 00000000..bae96dfc --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUPipelineBase.swift @@ -0,0 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol GPUPipelineBase: JSBridgedClass {} +public extension GPUPipelineBase { + func getBindGroupLayout(index: UInt32) -> GPUBindGroupLayout { + jsObject[Strings.getBindGroupLayout]!(index.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift b/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift new file mode 100644 index 00000000..a594983a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUPipelineDescriptorBase: BridgedDictionary { + public convenience init(layout: GPUPipelineLayout) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.layout] = layout.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var layout: GPUPipelineLayout +} diff --git a/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift b/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift new file mode 100644 index 00000000..6b376e13 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUPipelineLayout: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUPipelineLayout].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift b/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift new file mode 100644 index 00000000..ac0ac11d --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUPipelineLayoutDescriptor: BridgedDictionary { + public convenience init(bindGroupLayouts: [GPUBindGroupLayout]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.bindGroupLayouts] = bindGroupLayouts.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _bindGroupLayouts = ReadWriteAttribute(jsObject: object, name: Strings.bindGroupLayouts) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var bindGroupLayouts: [GPUBindGroupLayout] +} diff --git a/Sources/DOMKit/WebIDL/GPUPowerPreference.swift b/Sources/DOMKit/WebIDL/GPUPowerPreference.swift new file mode 100644 index 00000000..520ce024 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUPowerPreference.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUPowerPreference: JSString, JSValueCompatible { + case lowPower = "low-power" + case highPerformance = "high-performance" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift new file mode 100644 index 00000000..2a5464cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUPredefinedColorSpace: JSString, JSValueCompatible { + case srgb = "srgb" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUPrimitiveState.swift b/Sources/DOMKit/WebIDL/GPUPrimitiveState.swift new file mode 100644 index 00000000..dd1d92a9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUPrimitiveState.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUPrimitiveState: BridgedDictionary { + public convenience init(topology: GPUPrimitiveTopology, stripIndexFormat: GPUIndexFormat, frontFace: GPUFrontFace, cullMode: GPUCullMode, unclippedDepth: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.topology] = topology.jsValue() + object[Strings.stripIndexFormat] = stripIndexFormat.jsValue() + object[Strings.frontFace] = frontFace.jsValue() + object[Strings.cullMode] = cullMode.jsValue() + object[Strings.unclippedDepth] = unclippedDepth.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _topology = ReadWriteAttribute(jsObject: object, name: Strings.topology) + _stripIndexFormat = ReadWriteAttribute(jsObject: object, name: Strings.stripIndexFormat) + _frontFace = ReadWriteAttribute(jsObject: object, name: Strings.frontFace) + _cullMode = ReadWriteAttribute(jsObject: object, name: Strings.cullMode) + _unclippedDepth = ReadWriteAttribute(jsObject: object, name: Strings.unclippedDepth) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var topology: GPUPrimitiveTopology + + @ReadWriteAttribute + public var stripIndexFormat: GPUIndexFormat + + @ReadWriteAttribute + public var frontFace: GPUFrontFace + + @ReadWriteAttribute + public var cullMode: GPUCullMode + + @ReadWriteAttribute + public var unclippedDepth: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift b/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift new file mode 100644 index 00000000..9cb8a8d4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUPrimitiveTopology: JSString, JSValueCompatible { + case pointList = "point-list" + case lineList = "line-list" + case lineStrip = "line-strip" + case triangleList = "triangle-list" + case triangleStrip = "triangle-strip" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift new file mode 100644 index 00000000..b4972b21 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift @@ -0,0 +1,15 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol GPUProgrammablePassEncoder: JSBridgedClass {} +public extension GPUProgrammablePassEncoder { + func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets: [GPUBufferDynamicOffset]? = nil) { + _ = jsObject[Strings.setBindGroup]!(index.jsValue(), bindGroup.jsValue(), dynamicOffsets?.jsValue() ?? .undefined) + } + + func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32) { + _ = jsObject[Strings.setBindGroup]!(index.jsValue(), bindGroup.jsValue(), dynamicOffsetsData.jsValue(), dynamicOffsetsDataStart.jsValue(), dynamicOffsetsDataLength.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift b/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift new file mode 100644 index 00000000..16bd24c3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUProgrammableStage: BridgedDictionary { + public convenience init(module: GPUShaderModule, entryPoint: String, constants: [String: GPUPipelineConstantValue]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.module] = module.jsValue() + object[Strings.entryPoint] = entryPoint.jsValue() + object[Strings.constants] = constants.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _module = ReadWriteAttribute(jsObject: object, name: Strings.module) + _entryPoint = ReadWriteAttribute(jsObject: object, name: Strings.entryPoint) + _constants = ReadWriteAttribute(jsObject: object, name: Strings.constants) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var module: GPUShaderModule + + @ReadWriteAttribute + public var entryPoint: String + + @ReadWriteAttribute + public var constants: [String: GPUPipelineConstantValue] +} diff --git a/Sources/DOMKit/WebIDL/GPUQuerySet.swift b/Sources/DOMKit/WebIDL/GPUQuerySet.swift new file mode 100644 index 00000000..0a4b2097 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUQuerySet.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUQuerySet: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUQuerySet].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func destroy() { + _ = jsObject[Strings.destroy]!() + } +} diff --git a/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift b/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift new file mode 100644 index 00000000..f83ca73e --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUQuerySetDescriptor: BridgedDictionary { + public convenience init(type: GPUQueryType, count: GPUSize32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.count] = count.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _count = ReadWriteAttribute(jsObject: object, name: Strings.count) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: GPUQueryType + + @ReadWriteAttribute + public var count: GPUSize32 +} diff --git a/Sources/DOMKit/WebIDL/GPUQueryType.swift b/Sources/DOMKit/WebIDL/GPUQueryType.swift new file mode 100644 index 00000000..12033db0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUQueryType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUQueryType: JSString, JSValueCompatible { + case occlusion = "occlusion" + case timestamp = "timestamp" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUQueue.swift b/Sources/DOMKit/WebIDL/GPUQueue.swift new file mode 100644 index 00000000..8ac00787 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUQueue.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUQueue: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUQueue].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func submit(commandBuffers: [GPUCommandBuffer]) { + _ = jsObject[Strings.submit]!(commandBuffers.jsValue()) + } + + public func onSubmittedWorkDone() -> JSPromise { + jsObject[Strings.onSubmittedWorkDone]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func onSubmittedWorkDone() async throws { + let _promise: JSPromise = jsObject[Strings.onSubmittedWorkDone]!().fromJSValue()! + _ = try await _promise.get() + } + + public func writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: BufferSource, dataOffset: GPUSize64? = nil, size: GPUSize64? = nil) { + _ = jsObject[Strings.writeBuffer]!(buffer.jsValue(), bufferOffset.jsValue(), data.jsValue(), dataOffset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined) + } + + public func writeTexture(destination: GPUImageCopyTexture, data: BufferSource, dataLayout: GPUImageDataLayout, size: GPUExtent3D) { + _ = jsObject[Strings.writeTexture]!(destination.jsValue(), data.jsValue(), dataLayout.jsValue(), size.jsValue()) + } + + public func copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: GPUExtent3D) { + _ = jsObject[Strings.copyExternalImageToTexture]!(source.jsValue(), destination.jsValue(), copySize.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/GPUQueueDescriptor.swift b/Sources/DOMKit/WebIDL/GPUQueueDescriptor.swift new file mode 100644 index 00000000..4331c43f --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUQueueDescriptor.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUQueueDescriptor: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/GPURenderBundle.swift b/Sources/DOMKit/WebIDL/GPURenderBundle.swift new file mode 100644 index 00000000..61dc62fd --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderBundle.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderBundle: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPURenderBundle].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderBundleDescriptor.swift new file mode 100644 index 00000000..b86b3f91 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderBundleDescriptor.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderBundleDescriptor: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift new file mode 100644 index 00000000..4231323f --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderBundleEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder, GPURenderEncoderBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPURenderBundleEncoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func finish(descriptor: GPURenderBundleDescriptor? = nil) -> GPURenderBundle { + jsObject[Strings.finish]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift new file mode 100644 index 00000000..18cc529c --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderBundleEncoderDescriptor: BridgedDictionary { + public convenience init(depthReadOnly: Bool, stencilReadOnly: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.depthReadOnly] = depthReadOnly.jsValue() + object[Strings.stencilReadOnly] = stencilReadOnly.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _depthReadOnly = ReadWriteAttribute(jsObject: object, name: Strings.depthReadOnly) + _stencilReadOnly = ReadWriteAttribute(jsObject: object, name: Strings.stencilReadOnly) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var depthReadOnly: Bool + + @ReadWriteAttribute + public var stencilReadOnly: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift b/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift new file mode 100644 index 00000000..4faafa23 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol GPURenderEncoderBase: JSBridgedClass {} +public extension GPURenderEncoderBase { + func setPipeline(pipeline: GPURenderPipeline) { + _ = jsObject[Strings.setPipeline]!(pipeline.jsValue()) + } + + func setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset: GPUSize64? = nil, size: GPUSize64? = nil) { + _ = jsObject[Strings.setIndexBuffer]!(buffer.jsValue(), indexFormat.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined) + } + + func setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { + _ = jsObject[Strings.setVertexBuffer]!(slot.jsValue(), buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined) + } + + func draw(vertexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstVertex: GPUSize32? = nil, firstInstance: GPUSize32? = nil) { + _ = jsObject[Strings.draw]!(vertexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined) + } + + func drawIndexed(indexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstIndex: GPUSize32? = nil, baseVertex: GPUSignedOffset32? = nil, firstInstance: GPUSize32? = nil) { + _ = jsObject[Strings.drawIndexed]!(indexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstIndex?.jsValue() ?? .undefined, baseVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined) + } + + func drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { + _ = jsObject[Strings.drawIndirect]!(indirectBuffer.jsValue(), indirectOffset.jsValue()) + } + + func drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { + _ = jsObject[Strings.drawIndexedIndirect]!(indirectBuffer.jsValue(), indirectOffset.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift b/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift new file mode 100644 index 00000000..807d1f51 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderPassColorAttachment: BridgedDictionary { + public convenience init(view: GPUTextureView, resolveTarget: GPUTextureView, clearValue: GPUColor, loadOp: GPULoadOp, storeOp: GPUStoreOp) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.view] = view.jsValue() + object[Strings.resolveTarget] = resolveTarget.jsValue() + object[Strings.clearValue] = clearValue.jsValue() + object[Strings.loadOp] = loadOp.jsValue() + object[Strings.storeOp] = storeOp.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _view = ReadWriteAttribute(jsObject: object, name: Strings.view) + _resolveTarget = ReadWriteAttribute(jsObject: object, name: Strings.resolveTarget) + _clearValue = ReadWriteAttribute(jsObject: object, name: Strings.clearValue) + _loadOp = ReadWriteAttribute(jsObject: object, name: Strings.loadOp) + _storeOp = ReadWriteAttribute(jsObject: object, name: Strings.storeOp) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var view: GPUTextureView + + @ReadWriteAttribute + public var resolveTarget: GPUTextureView + + @ReadWriteAttribute + public var clearValue: GPUColor + + @ReadWriteAttribute + public var loadOp: GPULoadOp + + @ReadWriteAttribute + public var storeOp: GPUStoreOp +} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift b/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift new file mode 100644 index 00000000..35fa1ae8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderPassDepthStencilAttachment: BridgedDictionary { + public convenience init(view: GPUTextureView, depthClearValue: Float, depthLoadOp: GPULoadOp, depthStoreOp: GPUStoreOp, depthReadOnly: Bool, stencilClearValue: GPUStencilValue, stencilLoadOp: GPULoadOp, stencilStoreOp: GPUStoreOp, stencilReadOnly: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.view] = view.jsValue() + object[Strings.depthClearValue] = depthClearValue.jsValue() + object[Strings.depthLoadOp] = depthLoadOp.jsValue() + object[Strings.depthStoreOp] = depthStoreOp.jsValue() + object[Strings.depthReadOnly] = depthReadOnly.jsValue() + object[Strings.stencilClearValue] = stencilClearValue.jsValue() + object[Strings.stencilLoadOp] = stencilLoadOp.jsValue() + object[Strings.stencilStoreOp] = stencilStoreOp.jsValue() + object[Strings.stencilReadOnly] = stencilReadOnly.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _view = ReadWriteAttribute(jsObject: object, name: Strings.view) + _depthClearValue = ReadWriteAttribute(jsObject: object, name: Strings.depthClearValue) + _depthLoadOp = ReadWriteAttribute(jsObject: object, name: Strings.depthLoadOp) + _depthStoreOp = ReadWriteAttribute(jsObject: object, name: Strings.depthStoreOp) + _depthReadOnly = ReadWriteAttribute(jsObject: object, name: Strings.depthReadOnly) + _stencilClearValue = ReadWriteAttribute(jsObject: object, name: Strings.stencilClearValue) + _stencilLoadOp = ReadWriteAttribute(jsObject: object, name: Strings.stencilLoadOp) + _stencilStoreOp = ReadWriteAttribute(jsObject: object, name: Strings.stencilStoreOp) + _stencilReadOnly = ReadWriteAttribute(jsObject: object, name: Strings.stencilReadOnly) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var view: GPUTextureView + + @ReadWriteAttribute + public var depthClearValue: Float + + @ReadWriteAttribute + public var depthLoadOp: GPULoadOp + + @ReadWriteAttribute + public var depthStoreOp: GPUStoreOp + + @ReadWriteAttribute + public var depthReadOnly: Bool + + @ReadWriteAttribute + public var stencilClearValue: GPUStencilValue + + @ReadWriteAttribute + public var stencilLoadOp: GPULoadOp + + @ReadWriteAttribute + public var stencilStoreOp: GPUStoreOp + + @ReadWriteAttribute + public var stencilReadOnly: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift new file mode 100644 index 00000000..dbf0786d --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderPassDescriptor: BridgedDictionary { + public convenience init(colorAttachments: [GPURenderPassColorAttachment?], depthStencilAttachment: GPURenderPassDepthStencilAttachment, occlusionQuerySet: GPUQuerySet, timestampWrites: GPURenderPassTimestampWrites) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.colorAttachments] = colorAttachments.jsValue() + object[Strings.depthStencilAttachment] = depthStencilAttachment.jsValue() + object[Strings.occlusionQuerySet] = occlusionQuerySet.jsValue() + object[Strings.timestampWrites] = timestampWrites.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _colorAttachments = ReadWriteAttribute(jsObject: object, name: Strings.colorAttachments) + _depthStencilAttachment = ReadWriteAttribute(jsObject: object, name: Strings.depthStencilAttachment) + _occlusionQuerySet = ReadWriteAttribute(jsObject: object, name: Strings.occlusionQuerySet) + _timestampWrites = ReadWriteAttribute(jsObject: object, name: Strings.timestampWrites) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var colorAttachments: [GPURenderPassColorAttachment?] + + @ReadWriteAttribute + public var depthStencilAttachment: GPURenderPassDepthStencilAttachment + + @ReadWriteAttribute + public var occlusionQuerySet: GPUQuerySet + + @ReadWriteAttribute + public var timestampWrites: GPURenderPassTimestampWrites +} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift new file mode 100644 index 00000000..45f36685 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderPassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder, GPURenderEncoderBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPURenderPassEncoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func setViewport(x: Float, y: Float, width: Float, height: Float, minDepth: Float, maxDepth: Float) { + let _arg0 = x.jsValue() + let _arg1 = y.jsValue() + let _arg2 = width.jsValue() + let _arg3 = height.jsValue() + let _arg4 = minDepth.jsValue() + let _arg5 = maxDepth.jsValue() + _ = jsObject[Strings.setViewport]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + public func setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate) { + _ = jsObject[Strings.setScissorRect]!(x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()) + } + + public func setBlendConstant(color: GPUColor) { + _ = jsObject[Strings.setBlendConstant]!(color.jsValue()) + } + + public func setStencilReference(reference: GPUStencilValue) { + _ = jsObject[Strings.setStencilReference]!(reference.jsValue()) + } + + public func beginOcclusionQuery(queryIndex: GPUSize32) { + _ = jsObject[Strings.beginOcclusionQuery]!(queryIndex.jsValue()) + } + + public func endOcclusionQuery() { + _ = jsObject[Strings.endOcclusionQuery]!() + } + + public func executeBundles(bundles: [GPURenderBundle]) { + _ = jsObject[Strings.executeBundles]!(bundles.jsValue()) + } + + public func end() { + _ = jsObject[Strings.end]!() + } +} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift b/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift new file mode 100644 index 00000000..132b3a1b --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderPassLayout: BridgedDictionary { + public convenience init(colorFormats: [GPUTextureFormat?], depthStencilFormat: GPUTextureFormat, sampleCount: GPUSize32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.colorFormats] = colorFormats.jsValue() + object[Strings.depthStencilFormat] = depthStencilFormat.jsValue() + object[Strings.sampleCount] = sampleCount.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _colorFormats = ReadWriteAttribute(jsObject: object, name: Strings.colorFormats) + _depthStencilFormat = ReadWriteAttribute(jsObject: object, name: Strings.depthStencilFormat) + _sampleCount = ReadWriteAttribute(jsObject: object, name: Strings.sampleCount) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var colorFormats: [GPUTextureFormat?] + + @ReadWriteAttribute + public var depthStencilFormat: GPUTextureFormat + + @ReadWriteAttribute + public var sampleCount: GPUSize32 +} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift b/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift new file mode 100644 index 00000000..63ddc0dc --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPURenderPassTimestampLocation: JSString, JSValueCompatible { + case beginning = "beginning" + case end = "end" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift b/Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift new file mode 100644 index 00000000..3f07b5f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderPassTimestampWrite: BridgedDictionary { + public convenience init(querySet: GPUQuerySet, queryIndex: GPUSize32, location: GPURenderPassTimestampLocation) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.querySet] = querySet.jsValue() + object[Strings.queryIndex] = queryIndex.jsValue() + object[Strings.location] = location.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _querySet = ReadWriteAttribute(jsObject: object, name: Strings.querySet) + _queryIndex = ReadWriteAttribute(jsObject: object, name: Strings.queryIndex) + _location = ReadWriteAttribute(jsObject: object, name: Strings.location) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var querySet: GPUQuerySet + + @ReadWriteAttribute + public var queryIndex: GPUSize32 + + @ReadWriteAttribute + public var location: GPURenderPassTimestampLocation +} diff --git a/Sources/DOMKit/WebIDL/GPURenderPipeline.swift b/Sources/DOMKit/WebIDL/GPURenderPipeline.swift new file mode 100644 index 00000000..82550d89 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderPipeline.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderPipeline: JSBridgedClass, GPUObjectBase, GPUPipelineBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPURenderPipeline].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift new file mode 100644 index 00000000..eb76d6ec --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURenderPipelineDescriptor: BridgedDictionary { + public convenience init(vertex: GPUVertexState, primitive: GPUPrimitiveState, depthStencil: GPUDepthStencilState, multisample: GPUMultisampleState, fragment: GPUFragmentState) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.vertex] = vertex.jsValue() + object[Strings.primitive] = primitive.jsValue() + object[Strings.depthStencil] = depthStencil.jsValue() + object[Strings.multisample] = multisample.jsValue() + object[Strings.fragment] = fragment.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _vertex = ReadWriteAttribute(jsObject: object, name: Strings.vertex) + _primitive = ReadWriteAttribute(jsObject: object, name: Strings.primitive) + _depthStencil = ReadWriteAttribute(jsObject: object, name: Strings.depthStencil) + _multisample = ReadWriteAttribute(jsObject: object, name: Strings.multisample) + _fragment = ReadWriteAttribute(jsObject: object, name: Strings.fragment) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var vertex: GPUVertexState + + @ReadWriteAttribute + public var primitive: GPUPrimitiveState + + @ReadWriteAttribute + public var depthStencil: GPUDepthStencilState + + @ReadWriteAttribute + public var multisample: GPUMultisampleState + + @ReadWriteAttribute + public var fragment: GPUFragmentState +} diff --git a/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift b/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift new file mode 100644 index 00000000..c8b5be34 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPURequestAdapterOptions: BridgedDictionary { + public convenience init(powerPreference: GPUPowerPreference, forceFallbackAdapter: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.powerPreference] = powerPreference.jsValue() + object[Strings.forceFallbackAdapter] = forceFallbackAdapter.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _powerPreference = ReadWriteAttribute(jsObject: object, name: Strings.powerPreference) + _forceFallbackAdapter = ReadWriteAttribute(jsObject: object, name: Strings.forceFallbackAdapter) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var powerPreference: GPUPowerPreference + + @ReadWriteAttribute + public var forceFallbackAdapter: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPUSampler.swift b/Sources/DOMKit/WebIDL/GPUSampler.swift new file mode 100644 index 00000000..802f08c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUSampler.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUSampler: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUSampler].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift new file mode 100644 index 00000000..5f0407a0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUSamplerBindingLayout: BridgedDictionary { + public convenience init(type: GPUSamplerBindingType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: GPUSamplerBindingType +} diff --git a/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift b/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift new file mode 100644 index 00000000..ebccb701 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUSamplerBindingType: JSString, JSValueCompatible { + case filtering = "filtering" + case nonFiltering = "non-filtering" + case comparison = "comparison" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift b/Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift new file mode 100644 index 00000000..2e458264 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift @@ -0,0 +1,65 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUSamplerDescriptor: BridgedDictionary { + public convenience init(addressModeU: GPUAddressMode, addressModeV: GPUAddressMode, addressModeW: GPUAddressMode, magFilter: GPUFilterMode, minFilter: GPUFilterMode, mipmapFilter: GPUMipmapFilterMode, lodMinClamp: Float, lodMaxClamp: Float, compare: GPUCompareFunction, maxAnisotropy: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.addressModeU] = addressModeU.jsValue() + object[Strings.addressModeV] = addressModeV.jsValue() + object[Strings.addressModeW] = addressModeW.jsValue() + object[Strings.magFilter] = magFilter.jsValue() + object[Strings.minFilter] = minFilter.jsValue() + object[Strings.mipmapFilter] = mipmapFilter.jsValue() + object[Strings.lodMinClamp] = lodMinClamp.jsValue() + object[Strings.lodMaxClamp] = lodMaxClamp.jsValue() + object[Strings.compare] = compare.jsValue() + object[Strings.maxAnisotropy] = maxAnisotropy.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _addressModeU = ReadWriteAttribute(jsObject: object, name: Strings.addressModeU) + _addressModeV = ReadWriteAttribute(jsObject: object, name: Strings.addressModeV) + _addressModeW = ReadWriteAttribute(jsObject: object, name: Strings.addressModeW) + _magFilter = ReadWriteAttribute(jsObject: object, name: Strings.magFilter) + _minFilter = ReadWriteAttribute(jsObject: object, name: Strings.minFilter) + _mipmapFilter = ReadWriteAttribute(jsObject: object, name: Strings.mipmapFilter) + _lodMinClamp = ReadWriteAttribute(jsObject: object, name: Strings.lodMinClamp) + _lodMaxClamp = ReadWriteAttribute(jsObject: object, name: Strings.lodMaxClamp) + _compare = ReadWriteAttribute(jsObject: object, name: Strings.compare) + _maxAnisotropy = ReadWriteAttribute(jsObject: object, name: Strings.maxAnisotropy) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var addressModeU: GPUAddressMode + + @ReadWriteAttribute + public var addressModeV: GPUAddressMode + + @ReadWriteAttribute + public var addressModeW: GPUAddressMode + + @ReadWriteAttribute + public var magFilter: GPUFilterMode + + @ReadWriteAttribute + public var minFilter: GPUFilterMode + + @ReadWriteAttribute + public var mipmapFilter: GPUMipmapFilterMode + + @ReadWriteAttribute + public var lodMinClamp: Float + + @ReadWriteAttribute + public var lodMaxClamp: Float + + @ReadWriteAttribute + public var compare: GPUCompareFunction + + @ReadWriteAttribute + public var maxAnisotropy: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/GPUShaderModule.swift b/Sources/DOMKit/WebIDL/GPUShaderModule.swift new file mode 100644 index 00000000..69764bb2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUShaderModule.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUShaderModule: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUShaderModule].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func compilationInfo() -> JSPromise { + jsObject[Strings.compilationInfo]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func compilationInfo() async throws -> GPUCompilationInfo { + let _promise: JSPromise = jsObject[Strings.compilationInfo]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift b/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift new file mode 100644 index 00000000..54ff6121 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUShaderModuleCompilationHint: BridgedDictionary { + public convenience init(layout: GPUPipelineLayout) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.layout] = layout.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var layout: GPUPipelineLayout +} diff --git a/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift b/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift new file mode 100644 index 00000000..1d1a36fe --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUShaderModuleDescriptor: BridgedDictionary { + public convenience init(code: String, sourceMap: JSObject, hints: [String: GPUShaderModuleCompilationHint]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.code] = code.jsValue() + object[Strings.sourceMap] = sourceMap.jsValue() + object[Strings.hints] = hints.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _code = ReadWriteAttribute(jsObject: object, name: Strings.code) + _sourceMap = ReadWriteAttribute(jsObject: object, name: Strings.sourceMap) + _hints = ReadWriteAttribute(jsObject: object, name: Strings.hints) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var code: String + + @ReadWriteAttribute + public var sourceMap: JSObject + + @ReadWriteAttribute + public var hints: [String: GPUShaderModuleCompilationHint] +} diff --git a/Sources/DOMKit/WebIDL/GPUShaderStage.swift b/Sources/DOMKit/WebIDL/GPUShaderStage.swift new file mode 100644 index 00000000..bb57f0e2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUShaderStage.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUShaderStage { + public static var jsObject: JSObject { + JSObject.global.[Strings.GPUShaderStage].object! + } + + public static let VERTEX: GPUFlagsConstant = 0x1 + + public static let FRAGMENT: GPUFlagsConstant = 0x2 + + public static let COMPUTE: GPUFlagsConstant = 0x4 +} diff --git a/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift b/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift new file mode 100644 index 00000000..ab3d6ff6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUStencilFaceState: BridgedDictionary { + public convenience init(compare: GPUCompareFunction, failOp: GPUStencilOperation, depthFailOp: GPUStencilOperation, passOp: GPUStencilOperation) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.compare] = compare.jsValue() + object[Strings.failOp] = failOp.jsValue() + object[Strings.depthFailOp] = depthFailOp.jsValue() + object[Strings.passOp] = passOp.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _compare = ReadWriteAttribute(jsObject: object, name: Strings.compare) + _failOp = ReadWriteAttribute(jsObject: object, name: Strings.failOp) + _depthFailOp = ReadWriteAttribute(jsObject: object, name: Strings.depthFailOp) + _passOp = ReadWriteAttribute(jsObject: object, name: Strings.passOp) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var compare: GPUCompareFunction + + @ReadWriteAttribute + public var failOp: GPUStencilOperation + + @ReadWriteAttribute + public var depthFailOp: GPUStencilOperation + + @ReadWriteAttribute + public var passOp: GPUStencilOperation +} diff --git a/Sources/DOMKit/WebIDL/GPUStencilOperation.swift b/Sources/DOMKit/WebIDL/GPUStencilOperation.swift new file mode 100644 index 00000000..c36f970a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUStencilOperation.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUStencilOperation: JSString, JSValueCompatible { + case keep = "keep" + case zero = "zero" + case replace = "replace" + case invert = "invert" + case incrementClamp = "increment-clamp" + case decrementClamp = "decrement-clamp" + case incrementWrap = "increment-wrap" + case decrementWrap = "decrement-wrap" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift b/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift new file mode 100644 index 00000000..df91bc95 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUStorageTextureAccess: JSString, JSValueCompatible { + case writeOnly = "write-only" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift new file mode 100644 index 00000000..3bb5a9d6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUStorageTextureBindingLayout: BridgedDictionary { + public convenience init(access: GPUStorageTextureAccess, format: GPUTextureFormat, viewDimension: GPUTextureViewDimension) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.access] = access.jsValue() + object[Strings.format] = format.jsValue() + object[Strings.viewDimension] = viewDimension.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _access = ReadWriteAttribute(jsObject: object, name: Strings.access) + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _viewDimension = ReadWriteAttribute(jsObject: object, name: Strings.viewDimension) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var access: GPUStorageTextureAccess + + @ReadWriteAttribute + public var format: GPUTextureFormat + + @ReadWriteAttribute + public var viewDimension: GPUTextureViewDimension +} diff --git a/Sources/DOMKit/WebIDL/GPUStoreOp.swift b/Sources/DOMKit/WebIDL/GPUStoreOp.swift new file mode 100644 index 00000000..9fcb8cec --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUStoreOp.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUStoreOp: JSString, JSValueCompatible { + case store = "store" + case discard = "discard" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift b/Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift new file mode 100644 index 00000000..a8357ed5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUSupportedFeatures: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPUSupportedFeatures].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Set-like! +} diff --git a/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift b/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift new file mode 100644 index 00000000..965837f0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift @@ -0,0 +1,118 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUSupportedLimits: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPUSupportedLimits].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _maxTextureDimension1D = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTextureDimension1D) + _maxTextureDimension2D = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTextureDimension2D) + _maxTextureDimension3D = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTextureDimension3D) + _maxTextureArrayLayers = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTextureArrayLayers) + _maxBindGroups = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxBindGroups) + _maxDynamicUniformBuffersPerPipelineLayout = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxDynamicUniformBuffersPerPipelineLayout) + _maxDynamicStorageBuffersPerPipelineLayout = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxDynamicStorageBuffersPerPipelineLayout) + _maxSampledTexturesPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxSampledTexturesPerShaderStage) + _maxSamplersPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxSamplersPerShaderStage) + _maxStorageBuffersPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxStorageBuffersPerShaderStage) + _maxStorageTexturesPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxStorageTexturesPerShaderStage) + _maxUniformBuffersPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxUniformBuffersPerShaderStage) + _maxUniformBufferBindingSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxUniformBufferBindingSize) + _maxStorageBufferBindingSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxStorageBufferBindingSize) + _minUniformBufferOffsetAlignment = ReadonlyAttribute(jsObject: jsObject, name: Strings.minUniformBufferOffsetAlignment) + _minStorageBufferOffsetAlignment = ReadonlyAttribute(jsObject: jsObject, name: Strings.minStorageBufferOffsetAlignment) + _maxVertexBuffers = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxVertexBuffers) + _maxVertexAttributes = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxVertexAttributes) + _maxVertexBufferArrayStride = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxVertexBufferArrayStride) + _maxInterStageShaderComponents = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxInterStageShaderComponents) + _maxComputeWorkgroupStorageSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupStorageSize) + _maxComputeInvocationsPerWorkgroup = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeInvocationsPerWorkgroup) + _maxComputeWorkgroupSizeX = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupSizeX) + _maxComputeWorkgroupSizeY = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupSizeY) + _maxComputeWorkgroupSizeZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupSizeZ) + _maxComputeWorkgroupsPerDimension = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupsPerDimension) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var maxTextureDimension1D: UInt32 + + @ReadonlyAttribute + public var maxTextureDimension2D: UInt32 + + @ReadonlyAttribute + public var maxTextureDimension3D: UInt32 + + @ReadonlyAttribute + public var maxTextureArrayLayers: UInt32 + + @ReadonlyAttribute + public var maxBindGroups: UInt32 + + @ReadonlyAttribute + public var maxDynamicUniformBuffersPerPipelineLayout: UInt32 + + @ReadonlyAttribute + public var maxDynamicStorageBuffersPerPipelineLayout: UInt32 + + @ReadonlyAttribute + public var maxSampledTexturesPerShaderStage: UInt32 + + @ReadonlyAttribute + public var maxSamplersPerShaderStage: UInt32 + + @ReadonlyAttribute + public var maxStorageBuffersPerShaderStage: UInt32 + + @ReadonlyAttribute + public var maxStorageTexturesPerShaderStage: UInt32 + + @ReadonlyAttribute + public var maxUniformBuffersPerShaderStage: UInt32 + + @ReadonlyAttribute + public var maxUniformBufferBindingSize: UInt64 + + @ReadonlyAttribute + public var maxStorageBufferBindingSize: UInt64 + + @ReadonlyAttribute + public var minUniformBufferOffsetAlignment: UInt32 + + @ReadonlyAttribute + public var minStorageBufferOffsetAlignment: UInt32 + + @ReadonlyAttribute + public var maxVertexBuffers: UInt32 + + @ReadonlyAttribute + public var maxVertexAttributes: UInt32 + + @ReadonlyAttribute + public var maxVertexBufferArrayStride: UInt32 + + @ReadonlyAttribute + public var maxInterStageShaderComponents: UInt32 + + @ReadonlyAttribute + public var maxComputeWorkgroupStorageSize: UInt32 + + @ReadonlyAttribute + public var maxComputeInvocationsPerWorkgroup: UInt32 + + @ReadonlyAttribute + public var maxComputeWorkgroupSizeX: UInt32 + + @ReadonlyAttribute + public var maxComputeWorkgroupSizeY: UInt32 + + @ReadonlyAttribute + public var maxComputeWorkgroupSizeZ: UInt32 + + @ReadonlyAttribute + public var maxComputeWorkgroupsPerDimension: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/GPUTexture.swift b/Sources/DOMKit/WebIDL/GPUTexture.swift new file mode 100644 index 00000000..67b6d01a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTexture.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUTexture: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUTexture].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func createView(descriptor: GPUTextureViewDescriptor? = nil) -> GPUTextureView { + jsObject[Strings.createView]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + } + + public func destroy() { + _ = jsObject[Strings.destroy]!() + } +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureAspect.swift b/Sources/DOMKit/WebIDL/GPUTextureAspect.swift new file mode 100644 index 00000000..8a52d4c6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureAspect.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUTextureAspect: JSString, JSValueCompatible { + case all = "all" + case stencilOnly = "stencil-only" + case depthOnly = "depth-only" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift new file mode 100644 index 00000000..7cfaa9e7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUTextureBindingLayout: BridgedDictionary { + public convenience init(sampleType: GPUTextureSampleType, viewDimension: GPUTextureViewDimension, multisampled: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.sampleType] = sampleType.jsValue() + object[Strings.viewDimension] = viewDimension.jsValue() + object[Strings.multisampled] = multisampled.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _sampleType = ReadWriteAttribute(jsObject: object, name: Strings.sampleType) + _viewDimension = ReadWriteAttribute(jsObject: object, name: Strings.viewDimension) + _multisampled = ReadWriteAttribute(jsObject: object, name: Strings.multisampled) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var sampleType: GPUTextureSampleType + + @ReadWriteAttribute + public var viewDimension: GPUTextureViewDimension + + @ReadWriteAttribute + public var multisampled: Bool +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift b/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift new file mode 100644 index 00000000..939e3305 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUTextureDescriptor: BridgedDictionary { + public convenience init(size: GPUExtent3D, mipLevelCount: GPUIntegerCoordinate, sampleCount: GPUSize32, dimension: GPUTextureDimension, format: GPUTextureFormat, usage: GPUTextureUsageFlags, viewFormats: [GPUTextureFormat]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.size] = size.jsValue() + object[Strings.mipLevelCount] = mipLevelCount.jsValue() + object[Strings.sampleCount] = sampleCount.jsValue() + object[Strings.dimension] = dimension.jsValue() + object[Strings.format] = format.jsValue() + object[Strings.usage] = usage.jsValue() + object[Strings.viewFormats] = viewFormats.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _size = ReadWriteAttribute(jsObject: object, name: Strings.size) + _mipLevelCount = ReadWriteAttribute(jsObject: object, name: Strings.mipLevelCount) + _sampleCount = ReadWriteAttribute(jsObject: object, name: Strings.sampleCount) + _dimension = ReadWriteAttribute(jsObject: object, name: Strings.dimension) + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) + _viewFormats = ReadWriteAttribute(jsObject: object, name: Strings.viewFormats) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var size: GPUExtent3D + + @ReadWriteAttribute + public var mipLevelCount: GPUIntegerCoordinate + + @ReadWriteAttribute + public var sampleCount: GPUSize32 + + @ReadWriteAttribute + public var dimension: GPUTextureDimension + + @ReadWriteAttribute + public var format: GPUTextureFormat + + @ReadWriteAttribute + public var usage: GPUTextureUsageFlags + + @ReadWriteAttribute + public var viewFormats: [GPUTextureFormat] +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureDimension.swift b/Sources/DOMKit/WebIDL/GPUTextureDimension.swift new file mode 100644 index 00000000..12d73f83 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureDimension.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUTextureDimension: JSString, JSValueCompatible { + case _1d = "1d" + case _2d = "2d" + case _3d = "3d" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureFormat.swift b/Sources/DOMKit/WebIDL/GPUTextureFormat.swift new file mode 100644 index 00000000..cfee9b01 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureFormat.swift @@ -0,0 +1,115 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUTextureFormat: JSString, JSValueCompatible { + case r8unorm = "r8unorm" + case r8snorm = "r8snorm" + case r8uint = "r8uint" + case r8sint = "r8sint" + case r16uint = "r16uint" + case r16sint = "r16sint" + case r16float = "r16float" + case rg8unorm = "rg8unorm" + case rg8snorm = "rg8snorm" + case rg8uint = "rg8uint" + case rg8sint = "rg8sint" + case r32uint = "r32uint" + case r32sint = "r32sint" + case r32float = "r32float" + case rg16uint = "rg16uint" + case rg16sint = "rg16sint" + case rg16float = "rg16float" + case rgba8unorm = "rgba8unorm" + case rgba8unormSrgb = "rgba8unorm-srgb" + case rgba8snorm = "rgba8snorm" + case rgba8uint = "rgba8uint" + case rgba8sint = "rgba8sint" + case bgra8unorm = "bgra8unorm" + case bgra8unormSrgb = "bgra8unorm-srgb" + case rgb9e5ufloat = "rgb9e5ufloat" + case rgb10a2unorm = "rgb10a2unorm" + case rg11b10ufloat = "rg11b10ufloat" + case rg32uint = "rg32uint" + case rg32sint = "rg32sint" + case rg32float = "rg32float" + case rgba16uint = "rgba16uint" + case rgba16sint = "rgba16sint" + case rgba16float = "rgba16float" + case rgba32uint = "rgba32uint" + case rgba32sint = "rgba32sint" + case rgba32float = "rgba32float" + case stencil8 = "stencil8" + case depth16unorm = "depth16unorm" + case depth24plus = "depth24plus" + case depth24plusStencil8 = "depth24plus-stencil8" + case depth32float = "depth32float" + case depth24unormStencil8 = "depth24unorm-stencil8" + case depth32floatStencil8 = "depth32float-stencil8" + case bc1RgbaUnorm = "bc1-rgba-unorm" + case bc1RgbaUnormSrgb = "bc1-rgba-unorm-srgb" + case bc2RgbaUnorm = "bc2-rgba-unorm" + case bc2RgbaUnormSrgb = "bc2-rgba-unorm-srgb" + case bc3RgbaUnorm = "bc3-rgba-unorm" + case bc3RgbaUnormSrgb = "bc3-rgba-unorm-srgb" + case bc4RUnorm = "bc4-r-unorm" + case bc4RSnorm = "bc4-r-snorm" + case bc5RgUnorm = "bc5-rg-unorm" + case bc5RgSnorm = "bc5-rg-snorm" + case bc6hRgbUfloat = "bc6h-rgb-ufloat" + case bc6hRgbFloat = "bc6h-rgb-float" + case bc7RgbaUnorm = "bc7-rgba-unorm" + case bc7RgbaUnormSrgb = "bc7-rgba-unorm-srgb" + case etc2Rgb8unorm = "etc2-rgb8unorm" + case etc2Rgb8unormSrgb = "etc2-rgb8unorm-srgb" + case etc2Rgb8a1unorm = "etc2-rgb8a1unorm" + case etc2Rgb8a1unormSrgb = "etc2-rgb8a1unorm-srgb" + case etc2Rgba8unorm = "etc2-rgba8unorm" + case etc2Rgba8unormSrgb = "etc2-rgba8unorm-srgb" + case eacR11unorm = "eac-r11unorm" + case eacR11snorm = "eac-r11snorm" + case eacRg11unorm = "eac-rg11unorm" + case eacRg11snorm = "eac-rg11snorm" + case astc4x4Unorm = "astc-4x4-unorm" + case astc4x4UnormSrgb = "astc-4x4-unorm-srgb" + case astc5x4Unorm = "astc-5x4-unorm" + case astc5x4UnormSrgb = "astc-5x4-unorm-srgb" + case astc5x5Unorm = "astc-5x5-unorm" + case astc5x5UnormSrgb = "astc-5x5-unorm-srgb" + case astc6x5Unorm = "astc-6x5-unorm" + case astc6x5UnormSrgb = "astc-6x5-unorm-srgb" + case astc6x6Unorm = "astc-6x6-unorm" + case astc6x6UnormSrgb = "astc-6x6-unorm-srgb" + case astc8x5Unorm = "astc-8x5-unorm" + case astc8x5UnormSrgb = "astc-8x5-unorm-srgb" + case astc8x6Unorm = "astc-8x6-unorm" + case astc8x6UnormSrgb = "astc-8x6-unorm-srgb" + case astc8x8Unorm = "astc-8x8-unorm" + case astc8x8UnormSrgb = "astc-8x8-unorm-srgb" + case astc10x5Unorm = "astc-10x5-unorm" + case astc10x5UnormSrgb = "astc-10x5-unorm-srgb" + case astc10x6Unorm = "astc-10x6-unorm" + case astc10x6UnormSrgb = "astc-10x6-unorm-srgb" + case astc10x8Unorm = "astc-10x8-unorm" + case astc10x8UnormSrgb = "astc-10x8-unorm-srgb" + case astc10x10Unorm = "astc-10x10-unorm" + case astc10x10UnormSrgb = "astc-10x10-unorm-srgb" + case astc12x10Unorm = "astc-12x10-unorm" + case astc12x10UnormSrgb = "astc-12x10-unorm-srgb" + case astc12x12Unorm = "astc-12x12-unorm" + case astc12x12UnormSrgb = "astc-12x12-unorm-srgb" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift b/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift new file mode 100644 index 00000000..f3709129 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUTextureSampleType: JSString, JSValueCompatible { + case float = "float" + case unfilterableFloat = "unfilterable-float" + case depth = "depth" + case sint = "sint" + case uint = "uint" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureUsage.swift b/Sources/DOMKit/WebIDL/GPUTextureUsage.swift new file mode 100644 index 00000000..b346f48c --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureUsage.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUTextureUsage { + public static var jsObject: JSObject { + JSObject.global.[Strings.GPUTextureUsage].object! + } + + public static let COPY_SRC: GPUFlagsConstant = 0x01 + + public static let COPY_DST: GPUFlagsConstant = 0x02 + + public static let TEXTURE_BINDING: GPUFlagsConstant = 0x04 + + public static let STORAGE_BINDING: GPUFlagsConstant = 0x08 + + public static let RENDER_ATTACHMENT: GPUFlagsConstant = 0x10 +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureView.swift b/Sources/DOMKit/WebIDL/GPUTextureView.swift new file mode 100644 index 00000000..6b08fa3b --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureView.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUTextureView: JSBridgedClass, GPUObjectBase { + public class var constructor: JSFunction { JSObject.global[Strings.GPUTextureView].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift b/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift new file mode 100644 index 00000000..9d2fb44e --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUTextureViewDescriptor: BridgedDictionary { + public convenience init(format: GPUTextureFormat, dimension: GPUTextureViewDimension, aspect: GPUTextureAspect, baseMipLevel: GPUIntegerCoordinate, mipLevelCount: GPUIntegerCoordinate, baseArrayLayer: GPUIntegerCoordinate, arrayLayerCount: GPUIntegerCoordinate) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.format] = format.jsValue() + object[Strings.dimension] = dimension.jsValue() + object[Strings.aspect] = aspect.jsValue() + object[Strings.baseMipLevel] = baseMipLevel.jsValue() + object[Strings.mipLevelCount] = mipLevelCount.jsValue() + object[Strings.baseArrayLayer] = baseArrayLayer.jsValue() + object[Strings.arrayLayerCount] = arrayLayerCount.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _dimension = ReadWriteAttribute(jsObject: object, name: Strings.dimension) + _aspect = ReadWriteAttribute(jsObject: object, name: Strings.aspect) + _baseMipLevel = ReadWriteAttribute(jsObject: object, name: Strings.baseMipLevel) + _mipLevelCount = ReadWriteAttribute(jsObject: object, name: Strings.mipLevelCount) + _baseArrayLayer = ReadWriteAttribute(jsObject: object, name: Strings.baseArrayLayer) + _arrayLayerCount = ReadWriteAttribute(jsObject: object, name: Strings.arrayLayerCount) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var format: GPUTextureFormat + + @ReadWriteAttribute + public var dimension: GPUTextureViewDimension + + @ReadWriteAttribute + public var aspect: GPUTextureAspect + + @ReadWriteAttribute + public var baseMipLevel: GPUIntegerCoordinate + + @ReadWriteAttribute + public var mipLevelCount: GPUIntegerCoordinate + + @ReadWriteAttribute + public var baseArrayLayer: GPUIntegerCoordinate + + @ReadWriteAttribute + public var arrayLayerCount: GPUIntegerCoordinate +} diff --git a/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift b/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift new file mode 100644 index 00000000..efec5cbf --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUTextureViewDimension: JSString, JSValueCompatible { + case _1d = "1d" + case _2d = "2d" + case _2dArray = "2d-array" + case cube = "cube" + case cubeArray = "cube-array" + case _3d = "3d" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift new file mode 100644 index 00000000..2f8aacca --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUUncapturedErrorEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.GPUUncapturedErrorEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), gpuUncapturedErrorEventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var error: GPUError +} diff --git a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift new file mode 100644 index 00000000..f5c68732 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUUncapturedErrorEventInit: BridgedDictionary { + public convenience init(error: GPUError) { + 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: GPUError +} diff --git a/Sources/DOMKit/WebIDL/GPUValidationError.swift b/Sources/DOMKit/WebIDL/GPUValidationError.swift new file mode 100644 index 00000000..115e6fa7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUValidationError.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUValidationError: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GPUValidationError].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + self.jsObject = jsObject + } + + public convenience init(message: String) { + self.init(unsafelyWrapping: Self.constructor.new(message.jsValue())) + } + + @ReadonlyAttribute + public var message: String +} diff --git a/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift b/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift new file mode 100644 index 00000000..81828266 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUVertexAttribute: BridgedDictionary { + public convenience init(format: GPUVertexFormat, offset: GPUSize64, shaderLocation: GPUIndex32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.format] = format.jsValue() + object[Strings.offset] = offset.jsValue() + object[Strings.shaderLocation] = shaderLocation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + _shaderLocation = ReadWriteAttribute(jsObject: object, name: Strings.shaderLocation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var format: GPUVertexFormat + + @ReadWriteAttribute + public var offset: GPUSize64 + + @ReadWriteAttribute + public var shaderLocation: GPUIndex32 +} diff --git a/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift b/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift new file mode 100644 index 00000000..9140b21e --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUVertexBufferLayout: BridgedDictionary { + public convenience init(arrayStride: GPUSize64, stepMode: GPUVertexStepMode, attributes: [GPUVertexAttribute]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.arrayStride] = arrayStride.jsValue() + object[Strings.stepMode] = stepMode.jsValue() + object[Strings.attributes] = attributes.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _arrayStride = ReadWriteAttribute(jsObject: object, name: Strings.arrayStride) + _stepMode = ReadWriteAttribute(jsObject: object, name: Strings.stepMode) + _attributes = ReadWriteAttribute(jsObject: object, name: Strings.attributes) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var arrayStride: GPUSize64 + + @ReadWriteAttribute + public var stepMode: GPUVertexStepMode + + @ReadWriteAttribute + public var attributes: [GPUVertexAttribute] +} diff --git a/Sources/DOMKit/WebIDL/GPUVertexFormat.swift b/Sources/DOMKit/WebIDL/GPUVertexFormat.swift new file mode 100644 index 00000000..df7930e0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUVertexFormat.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUVertexFormat: JSString, JSValueCompatible { + case uint8x2 = "uint8x2" + case uint8x4 = "uint8x4" + case sint8x2 = "sint8x2" + case sint8x4 = "sint8x4" + case unorm8x2 = "unorm8x2" + case unorm8x4 = "unorm8x4" + case snorm8x2 = "snorm8x2" + case snorm8x4 = "snorm8x4" + case uint16x2 = "uint16x2" + case uint16x4 = "uint16x4" + case sint16x2 = "sint16x2" + case sint16x4 = "sint16x4" + case unorm16x2 = "unorm16x2" + case unorm16x4 = "unorm16x4" + case snorm16x2 = "snorm16x2" + case snorm16x4 = "snorm16x4" + case float16x2 = "float16x2" + case float16x4 = "float16x4" + case float32 = "float32" + case float32x2 = "float32x2" + case float32x3 = "float32x3" + case float32x4 = "float32x4" + case uint32 = "uint32" + case uint32x2 = "uint32x2" + case uint32x3 = "uint32x3" + case uint32x4 = "uint32x4" + case sint32 = "sint32" + case sint32x2 = "sint32x2" + case sint32x3 = "sint32x3" + case sint32x4 = "sint32x4" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GPUVertexState.swift b/Sources/DOMKit/WebIDL/GPUVertexState.swift new file mode 100644 index 00000000..d01fbd2a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUVertexState.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GPUVertexState: BridgedDictionary { + public convenience init(buffers: [GPUVertexBufferLayout?]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.buffers] = buffers.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _buffers = ReadWriteAttribute(jsObject: object, name: Strings.buffers) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var buffers: [GPUVertexBufferLayout?] +} diff --git a/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift b/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift new file mode 100644 index 00000000..696f7eb0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GPUVertexStepMode: JSString, JSValueCompatible { + case vertex = "vertex" + case instance = "instance" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GainNode.swift b/Sources/DOMKit/WebIDL/GainNode.swift new file mode 100644 index 00000000..e2f526cd --- /dev/null +++ b/Sources/DOMKit/WebIDL/GainNode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GainNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.GainNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _gain = ReadonlyAttribute(jsObject: jsObject, name: Strings.gain) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: GainOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var gain: AudioParam +} diff --git a/Sources/DOMKit/WebIDL/GainOptions.swift b/Sources/DOMKit/WebIDL/GainOptions.swift new file mode 100644 index 00000000..60f70b26 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GainOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GainOptions: BridgedDictionary { + public convenience init(gain: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.gain] = gain.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _gain = ReadWriteAttribute(jsObject: object, name: Strings.gain) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var gain: Float +} diff --git a/Sources/DOMKit/WebIDL/Gamepad.swift b/Sources/DOMKit/WebIDL/Gamepad.swift new file mode 100644 index 00000000..66829d13 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Gamepad.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Gamepad: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Gamepad].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) + _hapticActuators = ReadonlyAttribute(jsObject: jsObject, name: Strings.hapticActuators) + _pose = ReadonlyAttribute(jsObject: jsObject, name: Strings.pose) + _touchEvents = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchEvents) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) + _connected = ReadonlyAttribute(jsObject: jsObject, name: Strings.connected) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _mapping = ReadonlyAttribute(jsObject: jsObject, name: Strings.mapping) + _axes = ReadonlyAttribute(jsObject: jsObject, name: Strings.axes) + _buttons = ReadonlyAttribute(jsObject: jsObject, name: Strings.buttons) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var hand: GamepadHand + + @ReadonlyAttribute + public var hapticActuators: [GamepadHapticActuator] + + @ReadonlyAttribute + public var pose: GamepadPose? + + @ReadonlyAttribute + public var touchEvents: [GamepadTouch]? + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var index: Int32 + + @ReadonlyAttribute + public var connected: Bool + + @ReadonlyAttribute + public var timestamp: DOMHighResTimeStamp + + @ReadonlyAttribute + public var mapping: GamepadMappingType + + @ReadonlyAttribute + public var axes: [Double] + + @ReadonlyAttribute + public var buttons: [GamepadButton] +} diff --git a/Sources/DOMKit/WebIDL/GamepadButton.swift b/Sources/DOMKit/WebIDL/GamepadButton.swift new file mode 100644 index 00000000..d8101a99 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GamepadButton.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GamepadButton: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GamepadButton].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _pressed = ReadonlyAttribute(jsObject: jsObject, name: Strings.pressed) + _touched = ReadonlyAttribute(jsObject: jsObject, name: Strings.touched) + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var pressed: Bool + + @ReadonlyAttribute + public var touched: Bool + + @ReadonlyAttribute + public var value: Double +} diff --git a/Sources/DOMKit/WebIDL/GamepadEvent.swift b/Sources/DOMKit/WebIDL/GamepadEvent.swift new file mode 100644 index 00000000..76f4f140 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GamepadEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GamepadEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.GamepadEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _gamepad = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamepad) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: GamepadEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var gamepad: Gamepad +} diff --git a/Sources/DOMKit/WebIDL/GamepadEventInit.swift b/Sources/DOMKit/WebIDL/GamepadEventInit.swift new file mode 100644 index 00000000..fb8a1e53 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GamepadEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GamepadEventInit: BridgedDictionary { + public convenience init(gamepad: Gamepad) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.gamepad] = gamepad.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _gamepad = ReadWriteAttribute(jsObject: object, name: Strings.gamepad) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var gamepad: Gamepad +} diff --git a/Sources/DOMKit/WebIDL/GamepadHand.swift b/Sources/DOMKit/WebIDL/GamepadHand.swift new file mode 100644 index 00000000..84775529 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GamepadHand.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GamepadHand: JSString, JSValueCompatible { + case _empty = "" + case left = "left" + case right = "right" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift b/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift new file mode 100644 index 00000000..3f1a6cdd --- /dev/null +++ b/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GamepadHapticActuator: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GamepadHapticActuator].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var type: GamepadHapticActuatorType + + public func pulse(value: Double, duration: Double) -> JSPromise { + jsObject[Strings.pulse]!(value.jsValue(), duration.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func pulse(value: Double, duration: Double) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.pulse]!(value.jsValue(), duration.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift b/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift new file mode 100644 index 00000000..fd6552e7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GamepadHapticActuatorType: JSString, JSValueCompatible { + case vibration = "vibration" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GamepadMappingType.swift b/Sources/DOMKit/WebIDL/GamepadMappingType.swift new file mode 100644 index 00000000..e410b5ab --- /dev/null +++ b/Sources/DOMKit/WebIDL/GamepadMappingType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GamepadMappingType: JSString, JSValueCompatible { + case _empty = "" + case standard = "standard" + case xrStandard = "xr-standard" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GamepadPose.swift b/Sources/DOMKit/WebIDL/GamepadPose.swift new file mode 100644 index 00000000..3f085d20 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GamepadPose.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GamepadPose: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GamepadPose].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _hasOrientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.hasOrientation) + _hasPosition = ReadonlyAttribute(jsObject: jsObject, name: Strings.hasPosition) + _position = ReadonlyAttribute(jsObject: jsObject, name: Strings.position) + _linearVelocity = ReadonlyAttribute(jsObject: jsObject, name: Strings.linearVelocity) + _linearAcceleration = ReadonlyAttribute(jsObject: jsObject, name: Strings.linearAcceleration) + _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) + _angularVelocity = ReadonlyAttribute(jsObject: jsObject, name: Strings.angularVelocity) + _angularAcceleration = ReadonlyAttribute(jsObject: jsObject, name: Strings.angularAcceleration) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var hasOrientation: Bool + + @ReadonlyAttribute + public var hasPosition: Bool + + @ReadonlyAttribute + public var position: Float32Array? + + @ReadonlyAttribute + public var linearVelocity: Float32Array? + + @ReadonlyAttribute + public var linearAcceleration: Float32Array? + + @ReadonlyAttribute + public var orientation: Float32Array? + + @ReadonlyAttribute + public var angularVelocity: Float32Array? + + @ReadonlyAttribute + public var angularAcceleration: Float32Array? +} diff --git a/Sources/DOMKit/WebIDL/GamepadTouch.swift b/Sources/DOMKit/WebIDL/GamepadTouch.swift new file mode 100644 index 00000000..a720cad5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GamepadTouch.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GamepadTouch: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GamepadTouch].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _touchId = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchId) + _surfaceId = ReadonlyAttribute(jsObject: jsObject, name: Strings.surfaceId) + _position = ReadonlyAttribute(jsObject: jsObject, name: Strings.position) + _surfaceDimensions = ReadonlyAttribute(jsObject: jsObject, name: Strings.surfaceDimensions) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var touchId: UInt32 + + @ReadonlyAttribute + public var surfaceId: UInt8 + + @ReadonlyAttribute + public var position: Float32Array + + @ReadonlyAttribute + public var surfaceDimensions: Uint32Array? +} diff --git a/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift b/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift new file mode 100644 index 00000000..3d68f426 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GenerateTestReportParameters: BridgedDictionary { + public convenience init(message: String, group: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.message] = message.jsValue() + object[Strings.group] = group.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _message = ReadWriteAttribute(jsObject: object, name: Strings.message) + _group = ReadWriteAttribute(jsObject: object, name: Strings.group) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var message: String + + @ReadWriteAttribute + public var group: String +} diff --git a/Sources/DOMKit/WebIDL/Geolocation.swift b/Sources/DOMKit/WebIDL/Geolocation.swift new file mode 100644 index 00000000..b0ddbcdd --- /dev/null +++ b/Sources/DOMKit/WebIDL/Geolocation.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Geolocation: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Geolocation].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func getCurrentPosition(successCallback: PositionCallback, errorCallback: PositionErrorCallback? = nil, options: PositionOptions? = nil) { + _ = jsObject[Strings.getCurrentPosition]!(successCallback.jsValue(), errorCallback?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) + } + + public func watchPosition(successCallback: PositionCallback, errorCallback: PositionErrorCallback? = nil, options: PositionOptions? = nil) -> Int32 { + jsObject[Strings.watchPosition]!(successCallback.jsValue(), errorCallback?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func clearWatch(watchId: Int32) { + _ = jsObject[Strings.clearWatch]!(watchId.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift b/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift new file mode 100644 index 00000000..cb62d0c9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GeolocationCoordinates: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GeolocationCoordinates].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _accuracy = ReadonlyAttribute(jsObject: jsObject, name: Strings.accuracy) + _latitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.latitude) + _longitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.longitude) + _altitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitude) + _altitudeAccuracy = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitudeAccuracy) + _heading = ReadonlyAttribute(jsObject: jsObject, name: Strings.heading) + _speed = ReadonlyAttribute(jsObject: jsObject, name: Strings.speed) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var accuracy: Double + + @ReadonlyAttribute + public var latitude: Double + + @ReadonlyAttribute + public var longitude: Double + + @ReadonlyAttribute + public var altitude: Double? + + @ReadonlyAttribute + public var altitudeAccuracy: Double? + + @ReadonlyAttribute + public var heading: Double? + + @ReadonlyAttribute + public var speed: Double? +} diff --git a/Sources/DOMKit/WebIDL/GeolocationPosition.swift b/Sources/DOMKit/WebIDL/GeolocationPosition.swift new file mode 100644 index 00000000..602fa788 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GeolocationPosition.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GeolocationPosition: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GeolocationPosition].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _coords = ReadonlyAttribute(jsObject: jsObject, name: Strings.coords) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var coords: GeolocationCoordinates + + @ReadonlyAttribute + public var timestamp: EpochTimeStamp +} diff --git a/Sources/DOMKit/WebIDL/GeolocationPositionError.swift b/Sources/DOMKit/WebIDL/GeolocationPositionError.swift new file mode 100644 index 00000000..0b197660 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GeolocationPositionError.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GeolocationPositionError: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GeolocationPositionError].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + self.jsObject = jsObject + } + + public static let PERMISSION_DENIED: UInt16 = 1 + + public static let POSITION_UNAVAILABLE: UInt16 = 2 + + public static let TIMEOUT: UInt16 = 3 + + @ReadonlyAttribute + public var code: UInt16 + + @ReadonlyAttribute + public var message: String +} diff --git a/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift b/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift new file mode 100644 index 00000000..ffea39de --- /dev/null +++ b/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GeolocationReadingValues: BridgedDictionary { + public convenience init(latitude: Double?, longitude: Double?, altitude: Double?, accuracy: Double?, altitudeAccuracy: Double?, heading: Double?, speed: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.latitude] = latitude.jsValue() + object[Strings.longitude] = longitude.jsValue() + object[Strings.altitude] = altitude.jsValue() + object[Strings.accuracy] = accuracy.jsValue() + object[Strings.altitudeAccuracy] = altitudeAccuracy.jsValue() + object[Strings.heading] = heading.jsValue() + object[Strings.speed] = speed.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _latitude = ReadWriteAttribute(jsObject: object, name: Strings.latitude) + _longitude = ReadWriteAttribute(jsObject: object, name: Strings.longitude) + _altitude = ReadWriteAttribute(jsObject: object, name: Strings.altitude) + _accuracy = ReadWriteAttribute(jsObject: object, name: Strings.accuracy) + _altitudeAccuracy = ReadWriteAttribute(jsObject: object, name: Strings.altitudeAccuracy) + _heading = ReadWriteAttribute(jsObject: object, name: Strings.heading) + _speed = ReadWriteAttribute(jsObject: object, name: Strings.speed) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var latitude: Double? + + @ReadWriteAttribute + public var longitude: Double? + + @ReadWriteAttribute + public var altitude: Double? + + @ReadWriteAttribute + public var accuracy: Double? + + @ReadWriteAttribute + public var altitudeAccuracy: Double? + + @ReadWriteAttribute + public var heading: Double? + + @ReadWriteAttribute + public var speed: Double? +} diff --git a/Sources/DOMKit/WebIDL/GeolocationSensor.swift b/Sources/DOMKit/WebIDL/GeolocationSensor.swift new file mode 100644 index 00000000..a699aa62 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GeolocationSensor.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GeolocationSensor: Sensor { + override public class var constructor: JSFunction { JSObject.global[Strings.GeolocationSensor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _latitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.latitude) + _longitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.longitude) + _altitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitude) + _accuracy = ReadonlyAttribute(jsObject: jsObject, name: Strings.accuracy) + _altitudeAccuracy = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitudeAccuracy) + _heading = ReadonlyAttribute(jsObject: jsObject, name: Strings.heading) + _speed = ReadonlyAttribute(jsObject: jsObject, name: Strings.speed) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: GeolocationSensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + public static func read(readOptions: ReadOptions? = nil) -> JSPromise { + constructor[Strings.read]!(readOptions?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func read(readOptions: ReadOptions? = nil) async throws -> GeolocationSensorReading { + let _promise: JSPromise = constructor[Strings.read]!(readOptions?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var latitude: Double? + + @ReadonlyAttribute + public var longitude: Double? + + @ReadonlyAttribute + public var altitude: Double? + + @ReadonlyAttribute + public var accuracy: Double? + + @ReadonlyAttribute + public var altitudeAccuracy: Double? + + @ReadonlyAttribute + public var heading: Double? + + @ReadonlyAttribute + public var speed: Double? +} diff --git a/Sources/DOMKit/WebIDL/GeolocationSensorOptions.swift b/Sources/DOMKit/WebIDL/GeolocationSensorOptions.swift new file mode 100644 index 00000000..6e2fae2b --- /dev/null +++ b/Sources/DOMKit/WebIDL/GeolocationSensorOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GeolocationSensorOptions: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift b/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift new file mode 100644 index 00000000..7997d50a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GeolocationSensorReading: BridgedDictionary { + public convenience init(timestamp: DOMHighResTimeStamp?, latitude: Double?, longitude: Double?, altitude: Double?, accuracy: Double?, altitudeAccuracy: Double?, heading: Double?, speed: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.timestamp] = timestamp.jsValue() + object[Strings.latitude] = latitude.jsValue() + object[Strings.longitude] = longitude.jsValue() + object[Strings.altitude] = altitude.jsValue() + object[Strings.accuracy] = accuracy.jsValue() + object[Strings.altitudeAccuracy] = altitudeAccuracy.jsValue() + object[Strings.heading] = heading.jsValue() + object[Strings.speed] = speed.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _latitude = ReadWriteAttribute(jsObject: object, name: Strings.latitude) + _longitude = ReadWriteAttribute(jsObject: object, name: Strings.longitude) + _altitude = ReadWriteAttribute(jsObject: object, name: Strings.altitude) + _accuracy = ReadWriteAttribute(jsObject: object, name: Strings.accuracy) + _altitudeAccuracy = ReadWriteAttribute(jsObject: object, name: Strings.altitudeAccuracy) + _heading = ReadWriteAttribute(jsObject: object, name: Strings.heading) + _speed = ReadWriteAttribute(jsObject: object, name: Strings.speed) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var timestamp: DOMHighResTimeStamp? + + @ReadWriteAttribute + public var latitude: Double? + + @ReadWriteAttribute + public var longitude: Double? + + @ReadWriteAttribute + public var altitude: Double? + + @ReadWriteAttribute + public var accuracy: Double? + + @ReadWriteAttribute + public var altitudeAccuracy: Double? + + @ReadWriteAttribute + public var heading: Double? + + @ReadWriteAttribute + public var speed: Double? +} diff --git a/Sources/DOMKit/WebIDL/GeometryUtils.swift b/Sources/DOMKit/WebIDL/GeometryUtils.swift new file mode 100644 index 00000000..37ae5df6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GeometryUtils.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol GeometryUtils: JSBridgedClass {} +public extension GeometryUtils { + func getBoxQuads(options: BoxQuadOptions? = nil) -> [DOMQuad] { + jsObject[Strings.getBoxQuads]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + func convertQuadFromNode(quad: DOMQuadInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { + jsObject[Strings.convertQuadFromNode]!(quad.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + func convertRectFromNode(rect: DOMRectReadOnly, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { + jsObject[Strings.convertRectFromNode]!(rect.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + func convertPointFromNode(point: DOMPointInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMPoint { + jsObject[Strings.convertPointFromNode]!(point.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/GetAnimationsOptions.swift b/Sources/DOMKit/WebIDL/GetAnimationsOptions.swift new file mode 100644 index 00000000..8672eb33 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GetAnimationsOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GetAnimationsOptions: BridgedDictionary { + public convenience init(subtree: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.subtree] = subtree.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _subtree = ReadWriteAttribute(jsObject: object, name: Strings.subtree) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var subtree: Bool +} diff --git a/Sources/DOMKit/WebIDL/GetNotificationOptions.swift b/Sources/DOMKit/WebIDL/GetNotificationOptions.swift new file mode 100644 index 00000000..fed00471 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GetNotificationOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GetNotificationOptions: BridgedDictionary { + public convenience init(tag: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.tag] = tag.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _tag = ReadWriteAttribute(jsObject: object, name: Strings.tag) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var tag: String +} diff --git a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift index 8e867878..e64c55b0 100644 --- a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift +++ b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class GetRootNodeOptions: BridgedDictionary { public convenience init(composed: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.composed] = composed.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GetSVGDocument.swift b/Sources/DOMKit/WebIDL/GetSVGDocument.swift new file mode 100644 index 00000000..d3992968 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GetSVGDocument.swift @@ -0,0 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol GetSVGDocument: JSBridgedClass {} +public extension GetSVGDocument { + func getSVGDocument() -> Document { + jsObject[Strings.getSVGDocument]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/Global.swift b/Sources/DOMKit/WebIDL/Global.swift new file mode 100644 index 00000000..6dd52977 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Global.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Global: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Global].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + self.jsObject = jsObject + } + + public convenience init(descriptor: GlobalDescriptor, v: JSValue? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(descriptor.jsValue(), v?.jsValue() ?? .undefined)) + } + + public func valueOf() -> JSValue { + jsObject[Strings.valueOf]!().fromJSValue()! + } + + @ReadWriteAttribute + public var value: JSValue +} diff --git a/Sources/DOMKit/WebIDL/GlobalDescriptor.swift b/Sources/DOMKit/WebIDL/GlobalDescriptor.swift new file mode 100644 index 00000000..a0fa578f --- /dev/null +++ b/Sources/DOMKit/WebIDL/GlobalDescriptor.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GlobalDescriptor: BridgedDictionary { + public convenience init(value: ValueType, mutable: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.value] = value.jsValue() + object[Strings.mutable] = mutable.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + _mutable = ReadWriteAttribute(jsObject: object, name: Strings.mutable) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var value: ValueType + + @ReadWriteAttribute + public var mutable: Bool +} diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index 865a18c8..a5397d74 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -5,6 +5,26 @@ import JavaScriptKit public protocol GlobalEventHandlers: JSBridgedClass {} public extension GlobalEventHandlers { + var onanimationstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] = newValue } + } + + var onanimationiteration: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] = newValue } + } + + var onanimationend: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] = newValue } + } + + var onanimationcancel: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] = newValue } + } + var onabort: EventHandler { get { ClosureAttribute.Optional1[Strings.onabort, in: jsObject] } set { ClosureAttribute.Optional1[Strings.onabort, in: jsObject] = newValue } @@ -344,4 +364,114 @@ public extension GlobalEventHandlers { get { ClosureAttribute.Optional1[Strings.onwheel, in: jsObject] } set { ClosureAttribute.Optional1[Strings.onwheel, in: jsObject] = newValue } } + + var onbeforexrselect: EventHandler { + get { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] = newValue } + } + + var ongotpointercapture: EventHandler { + get { ClosureAttribute.Optional1[Strings.ongotpointercapture, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ongotpointercapture, in: jsObject] = newValue } + } + + var onlostpointercapture: EventHandler { + get { ClosureAttribute.Optional1[Strings.onlostpointercapture, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onlostpointercapture, in: jsObject] = newValue } + } + + var onpointerdown: EventHandler { + get { ClosureAttribute.Optional1[Strings.onpointerdown, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpointerdown, in: jsObject] = newValue } + } + + var onpointermove: EventHandler { + get { ClosureAttribute.Optional1[Strings.onpointermove, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpointermove, in: jsObject] = newValue } + } + + var onpointerrawupdate: EventHandler { + get { ClosureAttribute.Optional1[Strings.onpointerrawupdate, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpointerrawupdate, in: jsObject] = newValue } + } + + var onpointerup: EventHandler { + get { ClosureAttribute.Optional1[Strings.onpointerup, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpointerup, in: jsObject] = newValue } + } + + var onpointercancel: EventHandler { + get { ClosureAttribute.Optional1[Strings.onpointercancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpointercancel, in: jsObject] = newValue } + } + + var onpointerover: EventHandler { + get { ClosureAttribute.Optional1[Strings.onpointerover, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpointerover, in: jsObject] = newValue } + } + + var onpointerout: EventHandler { + get { ClosureAttribute.Optional1[Strings.onpointerout, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpointerout, in: jsObject] = newValue } + } + + var onpointerenter: EventHandler { + get { ClosureAttribute.Optional1[Strings.onpointerenter, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpointerenter, in: jsObject] = newValue } + } + + var onpointerleave: EventHandler { + get { ClosureAttribute.Optional1[Strings.onpointerleave, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onpointerleave, in: jsObject] = newValue } + } + + var ontransitionrun: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] = newValue } + } + + var ontransitionstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontransitionstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontransitionstart, in: jsObject] = newValue } + } + + var ontransitionend: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontransitionend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontransitionend, in: jsObject] = newValue } + } + + var ontransitioncancel: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontransitioncancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontransitioncancel, in: jsObject] = newValue } + } + + var ontouchstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] = newValue } + } + + var ontouchend: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] = newValue } + } + + var ontouchmove: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] = newValue } + } + + var ontouchcancel: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] = newValue } + } + + var onselectstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] = newValue } + } + + var onselectionchange: EventHandler { + get { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] = newValue } + } } diff --git a/Sources/DOMKit/WebIDL/GravityReadingValues.swift b/Sources/DOMKit/WebIDL/GravityReadingValues.swift new file mode 100644 index 00000000..3b1c9368 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GravityReadingValues.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GravityReadingValues: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/GravitySensor.swift b/Sources/DOMKit/WebIDL/GravitySensor.swift new file mode 100644 index 00000000..22858d33 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GravitySensor.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GravitySensor: Accelerometer { + override public class var constructor: JSFunction { JSObject.global[Strings.GravitySensor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: AccelerometerSensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/GroupEffect.swift b/Sources/DOMKit/WebIDL/GroupEffect.swift new file mode 100644 index 00000000..e6ad8b7a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GroupEffect.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GroupEffect: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.GroupEffect].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _children = ReadonlyAttribute(jsObject: jsObject, name: Strings.children) + _firstChild = ReadonlyAttribute(jsObject: jsObject, name: Strings.firstChild) + _lastChild = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastChild) + self.jsObject = jsObject + } + + public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(children.jsValue(), timing?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var children: AnimationNodeList + + @ReadonlyAttribute + public var firstChild: AnimationEffect? + + @ReadonlyAttribute + public var lastChild: AnimationEffect? + + public func clone() -> Self { + jsObject[Strings.clone]!().fromJSValue()! + } + + public func prepend(effects: AnimationEffect...) { + _ = jsObject[Strings.prepend]!(effects.jsValue()) + } + + public func append(effects: AnimationEffect...) { + _ = jsObject[Strings.append]!(effects.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/Gyroscope.swift b/Sources/DOMKit/WebIDL/Gyroscope.swift new file mode 100644 index 00000000..f0fdfb6d --- /dev/null +++ b/Sources/DOMKit/WebIDL/Gyroscope.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Gyroscope: Sensor { + override public class var constructor: JSFunction { JSObject.global[Strings.Gyroscope].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(sensorOptions: GyroscopeSensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var x: Double? + + @ReadonlyAttribute + public var y: Double? + + @ReadonlyAttribute + public var z: Double? +} diff --git a/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift new file mode 100644 index 00000000..d9cc6e0a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum GyroscopeLocalCoordinateSystem: JSString, JSValueCompatible { + case device = "device" + case screen = "screen" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift b/Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift new file mode 100644 index 00000000..5d5a9634 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GyroscopeReadingValues: BridgedDictionary { + public convenience init(x: Double?, y: Double?, z: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.z] = z.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _z = ReadWriteAttribute(jsObject: object, name: Strings.z) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var x: Double? + + @ReadWriteAttribute + public var y: Double? + + @ReadWriteAttribute + public var z: Double? +} diff --git a/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift b/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift new file mode 100644 index 00000000..e7043e0b --- /dev/null +++ b/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class GyroscopeSensorOptions: BridgedDictionary { + public convenience init(referenceFrame: GyroscopeLocalCoordinateSystem) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.referenceFrame] = referenceFrame.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _referenceFrame = ReadWriteAttribute(jsObject: object, name: Strings.referenceFrame) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var referenceFrame: GyroscopeLocalCoordinateSystem +} diff --git a/Sources/DOMKit/WebIDL/HID.swift b/Sources/DOMKit/WebIDL/HID.swift new file mode 100644 index 00000000..d8b1a7c2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HID.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HID: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.HID].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var onconnect: EventHandler + + @ClosureAttribute.Optional1 + public var ondisconnect: EventHandler + + public func getDevices() -> JSPromise { + jsObject[Strings.getDevices]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDevices() async throws -> [HIDDevice] { + let _promise: JSPromise = jsObject[Strings.getDevices]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestDevice(options: HIDDeviceRequestOptions) -> JSPromise { + jsObject[Strings.requestDevice]!(options.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestDevice(options: HIDDeviceRequestOptions) async throws -> [HIDDevice] { + let _promise: JSPromise = jsObject[Strings.requestDevice]!(options.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift b/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift new file mode 100644 index 00000000..0bfc4f27 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDCollectionInfo: BridgedDictionary { + public convenience init(usagePage: UInt16, usage: UInt16, type: UInt8, children: [HIDCollectionInfo], inputReports: [HIDReportInfo], outputReports: [HIDReportInfo], featureReports: [HIDReportInfo]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.usagePage] = usagePage.jsValue() + object[Strings.usage] = usage.jsValue() + object[Strings.type] = type.jsValue() + object[Strings.children] = children.jsValue() + object[Strings.inputReports] = inputReports.jsValue() + object[Strings.outputReports] = outputReports.jsValue() + object[Strings.featureReports] = featureReports.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _usagePage = ReadWriteAttribute(jsObject: object, name: Strings.usagePage) + _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _children = ReadWriteAttribute(jsObject: object, name: Strings.children) + _inputReports = ReadWriteAttribute(jsObject: object, name: Strings.inputReports) + _outputReports = ReadWriteAttribute(jsObject: object, name: Strings.outputReports) + _featureReports = ReadWriteAttribute(jsObject: object, name: Strings.featureReports) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var usagePage: UInt16 + + @ReadWriteAttribute + public var usage: UInt16 + + @ReadWriteAttribute + public var type: UInt8 + + @ReadWriteAttribute + public var children: [HIDCollectionInfo] + + @ReadWriteAttribute + public var inputReports: [HIDReportInfo] + + @ReadWriteAttribute + public var outputReports: [HIDReportInfo] + + @ReadWriteAttribute + public var featureReports: [HIDReportInfo] +} diff --git a/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift b/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift new file mode 100644 index 00000000..0943001a --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDConnectionEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.HIDConnectionEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: HIDConnectionEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var device: HIDDevice +} diff --git a/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift b/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift new file mode 100644 index 00000000..84f03e3f --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDConnectionEventInit: BridgedDictionary { + public convenience init(device: HIDDevice) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.device] = device.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _device = ReadWriteAttribute(jsObject: object, name: Strings.device) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var device: HIDDevice +} diff --git a/Sources/DOMKit/WebIDL/HIDDevice.swift b/Sources/DOMKit/WebIDL/HIDDevice.swift new file mode 100644 index 00000000..ad4c148d --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDDevice.swift @@ -0,0 +1,96 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDDevice: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.HIDDevice].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _oninputreport = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oninputreport) + _opened = ReadonlyAttribute(jsObject: jsObject, name: Strings.opened) + _vendorId = ReadonlyAttribute(jsObject: jsObject, name: Strings.vendorId) + _productId = ReadonlyAttribute(jsObject: jsObject, name: Strings.productId) + _productName = ReadonlyAttribute(jsObject: jsObject, name: Strings.productName) + _collections = ReadonlyAttribute(jsObject: jsObject, name: Strings.collections) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var oninputreport: EventHandler + + @ReadonlyAttribute + public var opened: Bool + + @ReadonlyAttribute + public var vendorId: UInt16 + + @ReadonlyAttribute + public var productId: UInt16 + + @ReadonlyAttribute + public var productName: String + + @ReadonlyAttribute + public var collections: [HIDCollectionInfo] + + public func open() -> JSPromise { + jsObject[Strings.open]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func open() async throws { + let _promise: JSPromise = jsObject[Strings.open]!().fromJSValue()! + _ = try await _promise.get() + } + + public func close() -> JSPromise { + jsObject[Strings.close]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func close() async throws { + let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + _ = try await _promise.get() + } + + public func forget() -> JSPromise { + jsObject[Strings.forget]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func forget() async throws { + let _promise: JSPromise = jsObject[Strings.forget]!().fromJSValue()! + _ = try await _promise.get() + } + + public func sendReport(reportId: UInt8, data: BufferSource) -> JSPromise { + jsObject[Strings.sendReport]!(reportId.jsValue(), data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func sendReport(reportId: UInt8, data: BufferSource) async throws { + let _promise: JSPromise = jsObject[Strings.sendReport]!(reportId.jsValue(), data.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func sendFeatureReport(reportId: UInt8, data: BufferSource) -> JSPromise { + jsObject[Strings.sendFeatureReport]!(reportId.jsValue(), data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func sendFeatureReport(reportId: UInt8, data: BufferSource) async throws { + let _promise: JSPromise = jsObject[Strings.sendFeatureReport]!(reportId.jsValue(), data.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func receiveFeatureReport(reportId: UInt8) -> JSPromise { + jsObject[Strings.receiveFeatureReport]!(reportId.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func receiveFeatureReport(reportId: UInt8) async throws -> DataView { + let _promise: JSPromise = jsObject[Strings.receiveFeatureReport]!(reportId.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift b/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift new file mode 100644 index 00000000..9a38e4f0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDDeviceFilter: BridgedDictionary { + public convenience init(vendorId: UInt32, productId: UInt16, usagePage: UInt16, usage: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.vendorId] = vendorId.jsValue() + object[Strings.productId] = productId.jsValue() + object[Strings.usagePage] = usagePage.jsValue() + object[Strings.usage] = usage.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _vendorId = ReadWriteAttribute(jsObject: object, name: Strings.vendorId) + _productId = ReadWriteAttribute(jsObject: object, name: Strings.productId) + _usagePage = ReadWriteAttribute(jsObject: object, name: Strings.usagePage) + _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var vendorId: UInt32 + + @ReadWriteAttribute + public var productId: UInt16 + + @ReadWriteAttribute + public var usagePage: UInt16 + + @ReadWriteAttribute + public var usage: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift b/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift new file mode 100644 index 00000000..6a06cc05 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDDeviceRequestOptions: BridgedDictionary { + public convenience init(filters: [HIDDeviceFilter]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.filters] = filters.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var filters: [HIDDeviceFilter] +} diff --git a/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift b/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift new file mode 100644 index 00000000..04760fcc --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDInputReportEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.HIDInputReportEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) + _reportId = ReadonlyAttribute(jsObject: jsObject, name: Strings.reportId) + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: HIDInputReportEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var device: HIDDevice + + @ReadonlyAttribute + public var reportId: UInt8 + + @ReadonlyAttribute + public var data: DataView +} diff --git a/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift b/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift new file mode 100644 index 00000000..4d7d9b8e --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDInputReportEventInit: BridgedDictionary { + public convenience init(device: HIDDevice, reportId: UInt8, data: DataView) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.device] = device.jsValue() + object[Strings.reportId] = reportId.jsValue() + object[Strings.data] = data.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _device = ReadWriteAttribute(jsObject: object, name: Strings.device) + _reportId = ReadWriteAttribute(jsObject: object, name: Strings.reportId) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var device: HIDDevice + + @ReadWriteAttribute + public var reportId: UInt8 + + @ReadWriteAttribute + public var data: DataView +} diff --git a/Sources/DOMKit/WebIDL/HIDReportInfo.swift b/Sources/DOMKit/WebIDL/HIDReportInfo.swift new file mode 100644 index 00000000..47154280 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDReportInfo.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDReportInfo: BridgedDictionary { + public convenience init(reportId: UInt8, items: [HIDReportItem]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.reportId] = reportId.jsValue() + object[Strings.items] = items.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _reportId = ReadWriteAttribute(jsObject: object, name: Strings.reportId) + _items = ReadWriteAttribute(jsObject: object, name: Strings.items) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var reportId: UInt8 + + @ReadWriteAttribute + public var items: [HIDReportItem] +} diff --git a/Sources/DOMKit/WebIDL/HIDReportItem.swift b/Sources/DOMKit/WebIDL/HIDReportItem.swift new file mode 100644 index 00000000..aa0808d7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDReportItem.swift @@ -0,0 +1,155 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HIDReportItem: BridgedDictionary { + public convenience init(isAbsolute: Bool, isArray: Bool, isBufferedBytes: Bool, isConstant: Bool, isLinear: Bool, isRange: Bool, isVolatile: Bool, hasNull: Bool, hasPreferredState: Bool, wrap: Bool, usages: [UInt32], usageMinimum: UInt32, usageMaximum: UInt32, reportSize: UInt16, reportCount: UInt16, unitExponent: Int8, unitSystem: HIDUnitSystem, unitFactorLengthExponent: Int8, unitFactorMassExponent: Int8, unitFactorTimeExponent: Int8, unitFactorTemperatureExponent: Int8, unitFactorCurrentExponent: Int8, unitFactorLuminousIntensityExponent: Int8, logicalMinimum: Int32, logicalMaximum: Int32, physicalMinimum: Int32, physicalMaximum: Int32, strings: [String]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.isAbsolute] = isAbsolute.jsValue() + object[Strings.isArray] = isArray.jsValue() + object[Strings.isBufferedBytes] = isBufferedBytes.jsValue() + object[Strings.isConstant] = isConstant.jsValue() + object[Strings.isLinear] = isLinear.jsValue() + object[Strings.isRange] = isRange.jsValue() + object[Strings.isVolatile] = isVolatile.jsValue() + object[Strings.hasNull] = hasNull.jsValue() + object[Strings.hasPreferredState] = hasPreferredState.jsValue() + object[Strings.wrap] = wrap.jsValue() + object[Strings.usages] = usages.jsValue() + object[Strings.usageMinimum] = usageMinimum.jsValue() + object[Strings.usageMaximum] = usageMaximum.jsValue() + object[Strings.reportSize] = reportSize.jsValue() + object[Strings.reportCount] = reportCount.jsValue() + object[Strings.unitExponent] = unitExponent.jsValue() + object[Strings.unitSystem] = unitSystem.jsValue() + object[Strings.unitFactorLengthExponent] = unitFactorLengthExponent.jsValue() + object[Strings.unitFactorMassExponent] = unitFactorMassExponent.jsValue() + object[Strings.unitFactorTimeExponent] = unitFactorTimeExponent.jsValue() + object[Strings.unitFactorTemperatureExponent] = unitFactorTemperatureExponent.jsValue() + object[Strings.unitFactorCurrentExponent] = unitFactorCurrentExponent.jsValue() + object[Strings.unitFactorLuminousIntensityExponent] = unitFactorLuminousIntensityExponent.jsValue() + object[Strings.logicalMinimum] = logicalMinimum.jsValue() + object[Strings.logicalMaximum] = logicalMaximum.jsValue() + object[Strings.physicalMinimum] = physicalMinimum.jsValue() + object[Strings.physicalMaximum] = physicalMaximum.jsValue() + object[Strings.strings] = strings.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _isAbsolute = ReadWriteAttribute(jsObject: object, name: Strings.isAbsolute) + _isArray = ReadWriteAttribute(jsObject: object, name: Strings.isArray) + _isBufferedBytes = ReadWriteAttribute(jsObject: object, name: Strings.isBufferedBytes) + _isConstant = ReadWriteAttribute(jsObject: object, name: Strings.isConstant) + _isLinear = ReadWriteAttribute(jsObject: object, name: Strings.isLinear) + _isRange = ReadWriteAttribute(jsObject: object, name: Strings.isRange) + _isVolatile = ReadWriteAttribute(jsObject: object, name: Strings.isVolatile) + _hasNull = ReadWriteAttribute(jsObject: object, name: Strings.hasNull) + _hasPreferredState = ReadWriteAttribute(jsObject: object, name: Strings.hasPreferredState) + _wrap = ReadWriteAttribute(jsObject: object, name: Strings.wrap) + _usages = ReadWriteAttribute(jsObject: object, name: Strings.usages) + _usageMinimum = ReadWriteAttribute(jsObject: object, name: Strings.usageMinimum) + _usageMaximum = ReadWriteAttribute(jsObject: object, name: Strings.usageMaximum) + _reportSize = ReadWriteAttribute(jsObject: object, name: Strings.reportSize) + _reportCount = ReadWriteAttribute(jsObject: object, name: Strings.reportCount) + _unitExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitExponent) + _unitSystem = ReadWriteAttribute(jsObject: object, name: Strings.unitSystem) + _unitFactorLengthExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorLengthExponent) + _unitFactorMassExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorMassExponent) + _unitFactorTimeExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorTimeExponent) + _unitFactorTemperatureExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorTemperatureExponent) + _unitFactorCurrentExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorCurrentExponent) + _unitFactorLuminousIntensityExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorLuminousIntensityExponent) + _logicalMinimum = ReadWriteAttribute(jsObject: object, name: Strings.logicalMinimum) + _logicalMaximum = ReadWriteAttribute(jsObject: object, name: Strings.logicalMaximum) + _physicalMinimum = ReadWriteAttribute(jsObject: object, name: Strings.physicalMinimum) + _physicalMaximum = ReadWriteAttribute(jsObject: object, name: Strings.physicalMaximum) + _strings = ReadWriteAttribute(jsObject: object, name: Strings.strings) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var isAbsolute: Bool + + @ReadWriteAttribute + public var isArray: Bool + + @ReadWriteAttribute + public var isBufferedBytes: Bool + + @ReadWriteAttribute + public var isConstant: Bool + + @ReadWriteAttribute + public var isLinear: Bool + + @ReadWriteAttribute + public var isRange: Bool + + @ReadWriteAttribute + public var isVolatile: Bool + + @ReadWriteAttribute + public var hasNull: Bool + + @ReadWriteAttribute + public var hasPreferredState: Bool + + @ReadWriteAttribute + public var wrap: Bool + + @ReadWriteAttribute + public var usages: [UInt32] + + @ReadWriteAttribute + public var usageMinimum: UInt32 + + @ReadWriteAttribute + public var usageMaximum: UInt32 + + @ReadWriteAttribute + public var reportSize: UInt16 + + @ReadWriteAttribute + public var reportCount: UInt16 + + @ReadWriteAttribute + public var unitExponent: Int8 + + @ReadWriteAttribute + public var unitSystem: HIDUnitSystem + + @ReadWriteAttribute + public var unitFactorLengthExponent: Int8 + + @ReadWriteAttribute + public var unitFactorMassExponent: Int8 + + @ReadWriteAttribute + public var unitFactorTimeExponent: Int8 + + @ReadWriteAttribute + public var unitFactorTemperatureExponent: Int8 + + @ReadWriteAttribute + public var unitFactorCurrentExponent: Int8 + + @ReadWriteAttribute + public var unitFactorLuminousIntensityExponent: Int8 + + @ReadWriteAttribute + public var logicalMinimum: Int32 + + @ReadWriteAttribute + public var logicalMaximum: Int32 + + @ReadWriteAttribute + public var physicalMinimum: Int32 + + @ReadWriteAttribute + public var physicalMaximum: Int32 + + @ReadWriteAttribute + public var strings: [String] +} diff --git a/Sources/DOMKit/WebIDL/HIDUnitSystem.swift b/Sources/DOMKit/WebIDL/HIDUnitSystem.swift new file mode 100644 index 00000000..2eb44d7a --- /dev/null +++ b/Sources/DOMKit/WebIDL/HIDUnitSystem.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum HIDUnitSystem: JSString, JSValueCompatible { + case none = "none" + case siLinear = "si-linear" + case siRotation = "si-rotation" + case englishLinear = "english-linear" + case englishRotation = "english-rotation" + case vendorDefined = "vendor-defined" + case reserved = "reserved" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift index d459c017..35744950 100644 --- a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLAllCollection: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.HTMLAllCollection.function! } + public class var constructor: JSFunction { JSObject.global[Strings.HTMLAllCollection].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift index ee3b0fbe..f93cdcd2 100644 --- a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift @@ -4,9 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { - override public class var constructor: JSFunction { JSObject.global.HTMLAnchorElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAnchorElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _attributionSourceId = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionSourceId) + _attributionDestination = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionDestination) + _attributionSourceEventId = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionSourceEventId) + _attributionReportTo = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionReportTo) + _attributionExpiry = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionExpiry) + _attributionSourcePriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionSourcePriority) + _registerAttributionSource = ReadWriteAttribute(jsObject: jsObject, name: Strings.registerAttributionSource) _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) _download = ReadWriteAttribute(jsObject: jsObject, name: Strings.download) _ping = ReadWriteAttribute(jsObject: jsObject, name: Strings.ping) @@ -24,6 +31,27 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { super.init(unsafelyWrapping: jsObject) } + @ReadWriteAttribute + public var attributionSourceId: UInt32 + + @ReadWriteAttribute + public var attributionDestination: String + + @ReadWriteAttribute + public var attributionSourceEventId: String + + @ReadWriteAttribute + public var attributionReportTo: String + + @ReadWriteAttribute + public var attributionExpiry: Int64 + + @ReadWriteAttribute + public var attributionSourcePriority: Int64 + + @ReadWriteAttribute + public var registerAttributionSource: Bool + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } diff --git a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift index 3c1c20f4..4feb14e8 100644 --- a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLAreaElement: HTMLElement, HTMLHyperlinkElementUtils { - override public class var constructor: JSFunction { JSObject.global.HTMLAreaElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAreaElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) diff --git a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift index 61322a9b..74d395be 100644 --- a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLAudioElement: HTMLMediaElement { - override public class var constructor: JSFunction { JSObject.global.HTMLAudioElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAudioElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/HTMLBRElement.swift b/Sources/DOMKit/WebIDL/HTMLBRElement.swift index 2fcfb7e8..bf58f45b 100644 --- a/Sources/DOMKit/WebIDL/HTMLBRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBRElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLBRElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLBRElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBRElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _clear = ReadWriteAttribute(jsObject: jsObject, name: Strings.clear) diff --git a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift index b013f289..3cfdb03a 100644 --- a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLBaseElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLBaseElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBaseElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _href = ReadWriteAttribute(jsObject: jsObject, name: Strings.href) diff --git a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift index 2c94047c..a3a735f9 100644 --- a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift @@ -4,9 +4,10 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLBodyElement: HTMLElement, WindowEventHandlers { - override public class var constructor: JSFunction { JSObject.global.HTMLBodyElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBodyElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _onorientationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onorientationchange) _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) _link = ReadWriteAttribute(jsObject: jsObject, name: Strings.link) _vLink = ReadWriteAttribute(jsObject: jsObject, name: Strings.vLink) @@ -16,6 +17,9 @@ public class HTMLBodyElement: HTMLElement, WindowEventHandlers { super.init(unsafelyWrapping: jsObject) } + @ClosureAttribute.Optional1 + public var onorientationchange: EventHandler + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift index bc7a7e8a..b10ca588 100644 --- a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLButtonElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLButtonElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLButtonElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index 838f3efd..31b345a4 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLCanvasElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLCanvasElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLCanvasElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) @@ -12,6 +12,10 @@ public class HTMLCanvasElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } + public func captureStream(frameRequestRate: Double? = nil) -> MediaStream { + jsObject[Strings.captureStream]!(frameRequestRate?.jsValue() ?? .undefined).fromJSValue()! + } + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } diff --git a/Sources/DOMKit/WebIDL/HTMLCollection.swift b/Sources/DOMKit/WebIDL/HTMLCollection.swift index f2b0e984..6a882bab 100644 --- a/Sources/DOMKit/WebIDL/HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLCollection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLCollection: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.HTMLCollection.function! } + public class var constructor: JSFunction { JSObject.global[Strings.HTMLCollection].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/HTMLDListElement.swift b/Sources/DOMKit/WebIDL/HTMLDListElement.swift index cef605dd..591d974c 100644 --- a/Sources/DOMKit/WebIDL/HTMLDListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDListElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDListElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLDListElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDListElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) diff --git a/Sources/DOMKit/WebIDL/HTMLDataElement.swift b/Sources/DOMKit/WebIDL/HTMLDataElement.swift index 461c9269..95b5321a 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDataElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLDataElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDataElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) diff --git a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift index 9b843631..8d7d4671 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDataListElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLDataListElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDataListElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _options = ReadonlyAttribute(jsObject: jsObject, name: Strings.options) diff --git a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift index 1a5b7b12..ae616fc1 100644 --- a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDetailsElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLDetailsElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDetailsElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _open = ReadWriteAttribute(jsObject: jsObject, name: Strings.open) diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift index 3f961e97..f067c02d 100644 --- a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDialogElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLDialogElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDialogElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _open = ReadWriteAttribute(jsObject: jsObject, name: Strings.open) diff --git a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift index ca7119e0..e29e61a0 100644 --- a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDirectoryElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLDirectoryElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDirectoryElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) diff --git a/Sources/DOMKit/WebIDL/HTMLDivElement.swift b/Sources/DOMKit/WebIDL/HTMLDivElement.swift index 8c58fb8d..6a53e6ed 100644 --- a/Sources/DOMKit/WebIDL/HTMLDivElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDivElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDivElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLDivElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDivElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 26fc2baa..2cf95ab6 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -3,10 +3,15 @@ import JavaScriptEventLoop import JavaScriptKit -public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement, ElementCSSInlineStyle { - override public class var constructor: JSFunction { JSObject.global.HTMLElement.function! } +public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _offsetParent = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetParent) + _offsetTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetTop) + _offsetLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetLeft) + _offsetWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetWidth) + _offsetHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetHeight) _title = ReadWriteAttribute(jsObject: jsObject, name: Strings.title) _lang = ReadWriteAttribute(jsObject: jsObject, name: Strings.lang) _translate = ReadWriteAttribute(jsObject: jsObject, name: Strings.translate) @@ -23,6 +28,21 @@ public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventH super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var offsetParent: Element? + + @ReadonlyAttribute + public var offsetTop: Int32 + + @ReadonlyAttribute + public var offsetLeft: Int32 + + @ReadonlyAttribute + public var offsetWidth: Int32 + + @ReadonlyAttribute + public var offsetHeight: Int32 + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } diff --git a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift index fe95169c..3d189c42 100644 --- a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLEmbedElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLEmbedElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLEmbedElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift index 17192326..190d3fb9 100644 --- a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFieldSetElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLFieldSetElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFieldSetElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) diff --git a/Sources/DOMKit/WebIDL/HTMLFontElement.swift b/Sources/DOMKit/WebIDL/HTMLFontElement.swift index 6efaeb06..35705ab9 100644 --- a/Sources/DOMKit/WebIDL/HTMLFontElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFontElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFontElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLFontElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFontElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _color = ReadWriteAttribute(jsObject: jsObject, name: Strings.color) diff --git a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift index c8dbc8e2..1a1fd391 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFormControlsCollection: HTMLCollection { - override public class var constructor: JSFunction { JSObject.global.HTMLFormControlsCollection.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFormControlsCollection].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index 1cfb5c4e..0d36eac2 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFormElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLFormElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFormElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _acceptCharset = ReadWriteAttribute(jsObject: jsObject, name: Strings.acceptCharset) diff --git a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift index 9bdd2826..d09fd6e8 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFrameElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLFrameElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFrameElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift index 8c87b631..de652fa0 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFrameSetElement: HTMLElement, WindowEventHandlers { - override public class var constructor: JSFunction { JSObject.global.HTMLFrameSetElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFrameSetElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cols = ReadWriteAttribute(jsObject: jsObject, name: Strings.cols) diff --git a/Sources/DOMKit/WebIDL/HTMLHRElement.swift b/Sources/DOMKit/WebIDL/HTMLHRElement.swift index d04976c3..ff15f0e5 100644 --- a/Sources/DOMKit/WebIDL/HTMLHRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHRElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLHRElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLHRElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHRElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) diff --git a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift index 16c56abd..3dcaeacc 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLHeadElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLHeadElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHeadElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift index e704a34d..6e38e2b5 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLHeadingElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLHeadingElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHeadingElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) diff --git a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift index ddec8557..c40ac636 100644 --- a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLHtmlElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLHtmlElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHtmlElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _version = ReadWriteAttribute(jsObject: jsObject, name: Strings.version) diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index b7773861..4624c948 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -4,9 +4,10 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLIFrameElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLIFrameElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLIFrameElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcdoc = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcdoc) _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) @@ -25,9 +26,14 @@ public class HTMLIFrameElement: HTMLElement { _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Strings.longDesc) _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginHeight) _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginWidth) + _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) + _csp = ReadWriteAttribute(jsObject: jsObject, name: Strings.csp) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var permissionsPolicy: PermissionsPolicy + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -89,4 +95,10 @@ public class HTMLIFrameElement: HTMLElement { @ReadWriteAttribute public var marginWidth: String + + @ReadWriteAttribute + public var fetchpriority: String + + @ReadWriteAttribute + public var csp: String } diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index 86a553b0..60527ae3 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -4,9 +4,11 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLImageElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLImageElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLImageElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcset = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcset) @@ -30,9 +32,16 @@ public class HTMLImageElement: HTMLElement { _vspace = ReadWriteAttribute(jsObject: jsObject, name: Strings.vspace) _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Strings.longDesc) _border = ReadWriteAttribute(jsObject: jsObject, name: Strings.border) + _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var x: Int32 + + @ReadonlyAttribute + public var y: Int32 + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -115,4 +124,7 @@ public class HTMLImageElement: HTMLElement { @ReadWriteAttribute public var border: String + + @ReadWriteAttribute + public var fetchpriority: String } diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index 60b57799..8b51bedf 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -4,9 +4,12 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLInputElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLInputElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLInputElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _webkitdirectory = ReadWriteAttribute(jsObject: jsObject, name: Strings.webkitdirectory) + _webkitEntries = ReadonlyAttribute(jsObject: jsObject, name: Strings.webkitEntries) + _capture = ReadWriteAttribute(jsObject: jsObject, name: Strings.capture) _accept = ReadWriteAttribute(jsObject: jsObject, name: Strings.accept) _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) @@ -55,6 +58,15 @@ public class HTMLInputElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } + @ReadWriteAttribute + public var webkitdirectory: Bool + + @ReadonlyAttribute + public var webkitEntries: [FileSystemEntry] + + @ReadWriteAttribute + public var capture: String + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } diff --git a/Sources/DOMKit/WebIDL/HTMLLIElement.swift b/Sources/DOMKit/WebIDL/HTMLLIElement.swift index 0f47f237..7171d8fb 100644 --- a/Sources/DOMKit/WebIDL/HTMLLIElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLIElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLLIElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLLIElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLIElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) diff --git a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift index 8f7c3bbd..de874502 100644 --- a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLLabelElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLLabelElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLabelElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) diff --git a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift index 48740c1c..e1243c59 100644 --- a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLLegendElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLLegendElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLegendElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) diff --git a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift index 713ce7ef..bbc3e1c5 100644 --- a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLLinkElement: HTMLElement, LinkStyle { - override public class var constructor: JSFunction { JSObject.global.HTMLLinkElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLinkElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _href = ReadWriteAttribute(jsObject: jsObject, name: Strings.href) @@ -25,6 +25,7 @@ public class HTMLLinkElement: HTMLElement, LinkStyle { _charset = ReadWriteAttribute(jsObject: jsObject, name: Strings.charset) _rev = ReadWriteAttribute(jsObject: jsObject, name: Strings.rev) _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) + _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) super.init(unsafelyWrapping: jsObject) } @@ -85,4 +86,7 @@ public class HTMLLinkElement: HTMLElement, LinkStyle { @ReadWriteAttribute public var target: String + + @ReadWriteAttribute + public var fetchpriority: String } diff --git a/Sources/DOMKit/WebIDL/HTMLMapElement.swift b/Sources/DOMKit/WebIDL/HTMLMapElement.swift index 42bc60b3..4f8e9612 100644 --- a/Sources/DOMKit/WebIDL/HTMLMapElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMapElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMapElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLMapElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMapElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift index 0b80ca1b..5698e70c 100644 --- a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMarqueeElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLMarqueeElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMarqueeElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _behavior = ReadWriteAttribute(jsObject: jsObject, name: Strings.behavior) diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index 374d08bb..1265f5ff 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -4,9 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMediaElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLMediaElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMediaElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _sinkId = ReadonlyAttribute(jsObject: jsObject, name: Strings.sinkId) + _mediaKeys = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaKeys) + _onencrypted = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onencrypted) + _onwaitingforkey = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onwaitingforkey) _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcObject = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcObject) @@ -35,9 +39,47 @@ public class HTMLMediaElement: HTMLElement { _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioTracks) _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoTracks) _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.textTracks) + _remote = ReadonlyAttribute(jsObject: jsObject, name: Strings.remote) + _disableRemotePlayback = ReadWriteAttribute(jsObject: jsObject, name: Strings.disableRemotePlayback) super.init(unsafelyWrapping: jsObject) } + public func captureStream() -> MediaStream { + jsObject[Strings.captureStream]!().fromJSValue()! + } + + @ReadonlyAttribute + public var sinkId: String + + public func setSinkId(sinkId: String) -> JSPromise { + jsObject[Strings.setSinkId]!(sinkId.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setSinkId(sinkId: String) async throws { + let _promise: JSPromise = jsObject[Strings.setSinkId]!(sinkId.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + @ReadonlyAttribute + public var mediaKeys: MediaKeys? + + @ClosureAttribute.Optional1 + public var onencrypted: EventHandler + + @ClosureAttribute.Optional1 + public var onwaitingforkey: EventHandler + + public func setMediaKeys(mediaKeys: MediaKeys?) -> JSPromise { + jsObject[Strings.setMediaKeys]!(mediaKeys.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setMediaKeys(mediaKeys: MediaKeys?) async throws { + let _promise: JSPromise = jsObject[Strings.setMediaKeys]!(mediaKeys.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + @ReadonlyAttribute public var error: MediaError? @@ -173,4 +215,10 @@ public class HTMLMediaElement: HTMLElement { public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { jsObject[Strings.addTextTrack]!(kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined).fromJSValue()! } + + @ReadonlyAttribute + public var remote: RemotePlayback + + @ReadWriteAttribute + public var disableRemotePlayback: Bool } diff --git a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift index 4342606c..d4bb4511 100644 --- a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMenuElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLMenuElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMenuElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) diff --git a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift index 123fbcb7..a64ed56e 100644 --- a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMetaElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLMetaElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMetaElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift index d00415d9..b55d1e87 100644 --- a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMeterElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLMeterElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMeterElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) diff --git a/Sources/DOMKit/WebIDL/HTMLModElement.swift b/Sources/DOMKit/WebIDL/HTMLModElement.swift index ad7a789d..852ac19d 100644 --- a/Sources/DOMKit/WebIDL/HTMLModElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLModElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLModElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLModElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLModElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cite = ReadWriteAttribute(jsObject: jsObject, name: Strings.cite) diff --git a/Sources/DOMKit/WebIDL/HTMLOListElement.swift b/Sources/DOMKit/WebIDL/HTMLOListElement.swift index c73f5cfc..bf6586b8 100644 --- a/Sources/DOMKit/WebIDL/HTMLOListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOListElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOListElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLOListElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOListElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _reversed = ReadWriteAttribute(jsObject: jsObject, name: Strings.reversed) diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift index bf79ec77..11bc24d5 100644 --- a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLObjectElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLObjectElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLObjectElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift index 66c3f481..e59c8668 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOptGroupElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLOptGroupElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOptGroupElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) diff --git a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift index efd04e95..c4db0b18 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOptionElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLOptionElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOptionElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift index 8d71ebb8..8572b645 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOptionsCollection: HTMLCollection { - override public class var constructor: JSFunction { JSObject.global.HTMLOptionsCollection.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOptionsCollection].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadWriteAttribute(jsObject: jsObject, name: Strings.length) diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift index a46adbe3..f8f21a70 100644 --- a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOutputElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLOutputElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOutputElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _htmlFor = ReadonlyAttribute(jsObject: jsObject, name: Strings.htmlFor) diff --git a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift index 2efd3f3f..37350847 100644 --- a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLParagraphElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLParagraphElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLParagraphElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) diff --git a/Sources/DOMKit/WebIDL/HTMLParamElement.swift b/Sources/DOMKit/WebIDL/HTMLParamElement.swift index 621fbccb..1d0d636d 100644 --- a/Sources/DOMKit/WebIDL/HTMLParamElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParamElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLParamElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLParamElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLParamElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift index 01d29383..b1596736 100644 --- a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLPictureElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLPictureElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPictureElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift new file mode 100644 index 00000000..bb2274e1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HTMLPortalElement: HTMLElement { + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPortalElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var referrerPolicy: String + + public func activate(options: PortalActivateOptions? = nil) -> JSPromise { + jsObject[Strings.activate]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func activate(options: PortalActivateOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.activate]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + } + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ClosureAttribute.Optional1 + public var onmessageerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/HTMLPreElement.swift b/Sources/DOMKit/WebIDL/HTMLPreElement.swift index d6309f21..322d10ae 100644 --- a/Sources/DOMKit/WebIDL/HTMLPreElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPreElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLPreElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLPreElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPreElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) diff --git a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift index 4b7fb56d..a57c3def 100644 --- a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLProgressElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLProgressElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLProgressElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) diff --git a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift index d58e7a0d..9f2ae264 100644 --- a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLQuoteElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLQuoteElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLQuoteElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cite = ReadWriteAttribute(jsObject: jsObject, name: Strings.cite) diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift index 1c62ba1f..849861fa 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLScriptElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLScriptElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLScriptElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) @@ -20,6 +20,7 @@ public class HTMLScriptElement: HTMLElement { _charset = ReadWriteAttribute(jsObject: jsObject, name: Strings.charset) _event = ReadWriteAttribute(jsObject: jsObject, name: Strings.event) _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: Strings.htmlFor) + _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) super.init(unsafelyWrapping: jsObject) } @@ -69,4 +70,7 @@ public class HTMLScriptElement: HTMLElement { @ReadWriteAttribute public var htmlFor: String + + @ReadWriteAttribute + public var fetchpriority: String } diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index fe393159..e490b59e 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLSelectElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLSelectElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSelectElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index 5e34a069..88a9239c 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLSlotElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLSlotElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSlotElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift index 07f92e3b..405e9561 100644 --- a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLSourceElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLSourceElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSourceElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) diff --git a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift index b798e6c8..19832ba4 100644 --- a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLSpanElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLSpanElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSpanElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift index 9031f522..2b527259 100644 --- a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLStyleElement: HTMLElement, LinkStyle { - override public class var constructor: JSFunction { JSObject.global.HTMLStyleElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLStyleElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _media = ReadWriteAttribute(jsObject: jsObject, name: Strings.media) diff --git a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift index c5332e79..f7aac0aa 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableCaptionElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTableCaptionElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableCaptionElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) diff --git a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift index b383dca4..a1892204 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableCellElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTableCellElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableCellElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _colSpan = ReadWriteAttribute(jsObject: jsObject, name: Strings.colSpan) diff --git a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift index 98f3943d..d1dc0ca3 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableColElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTableColElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableColElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _span = ReadWriteAttribute(jsObject: jsObject, name: Strings.span) diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift index b72b19d1..1692ca71 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTableElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _caption = ReadWriteAttribute(jsObject: jsObject, name: Strings.caption) diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift index 3d7999f7..cdaa0b2f 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableRowElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTableRowElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableRowElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _rowIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.rowIndex) diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift index fa504b12..a2675263 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableSectionElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTableSectionElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableSectionElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _rows = ReadonlyAttribute(jsObject: jsObject, name: Strings.rows) diff --git a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift index 75a21a74..4d16b1d4 100644 --- a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTemplateElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTemplateElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTemplateElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _content = ReadonlyAttribute(jsObject: jsObject, name: Strings.content) diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift index 3243262b..9ab78748 100644 --- a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTextAreaElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTextAreaElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTextAreaElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) diff --git a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift index 3d81a58d..33b38c8c 100644 --- a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTimeElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTimeElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTimeElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _dateTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.dateTime) diff --git a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift index 5a40692b..ae8235b8 100644 --- a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTitleElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTitleElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTitleElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) diff --git a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift index 8c185931..1ec5ddca 100644 --- a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTrackElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLTrackElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTrackElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _kind = ReadWriteAttribute(jsObject: jsObject, name: Strings.kind) diff --git a/Sources/DOMKit/WebIDL/HTMLUListElement.swift b/Sources/DOMKit/WebIDL/HTMLUListElement.swift index d02107c7..8c266854 100644 --- a/Sources/DOMKit/WebIDL/HTMLUListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUListElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLUListElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLUListElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLUListElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) diff --git a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift index fd3cfcd9..63f6cb5e 100644 --- a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLUnknownElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global.HTMLUnknownElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLUnknownElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 14bb3df0..872e7bd5 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLVideoElement: HTMLMediaElement { - override public class var constructor: JSFunction { JSObject.global.HTMLVideoElement.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HTMLVideoElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) @@ -13,9 +13,25 @@ public class HTMLVideoElement: HTMLMediaElement { _videoHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoHeight) _poster = ReadWriteAttribute(jsObject: jsObject, name: Strings.poster) _playsInline = ReadWriteAttribute(jsObject: jsObject, name: Strings.playsInline) + _onenterpictureinpicture = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onenterpictureinpicture) + _onleavepictureinpicture = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onleavepictureinpicture) + _autoPictureInPicture = ReadWriteAttribute(jsObject: jsObject, name: Strings.autoPictureInPicture) + _disablePictureInPicture = ReadWriteAttribute(jsObject: jsObject, name: Strings.disablePictureInPicture) super.init(unsafelyWrapping: jsObject) } + public func requestVideoFrameCallback(callback: VideoFrameRequestCallback) -> UInt32 { + jsObject[Strings.requestVideoFrameCallback]!(callback.jsValue()).fromJSValue()! + } + + public func cancelVideoFrameCallback(handle: UInt32) { + _ = jsObject[Strings.cancelVideoFrameCallback]!(handle.jsValue()) + } + + public func getVideoPlaybackQuality() -> VideoPlaybackQuality { + jsObject[Strings.getVideoPlaybackQuality]!().fromJSValue()! + } + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -37,4 +53,26 @@ public class HTMLVideoElement: HTMLMediaElement { @ReadWriteAttribute public var playsInline: Bool + + public func requestPictureInPicture() -> JSPromise { + jsObject[Strings.requestPictureInPicture]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestPictureInPicture() async throws -> PictureInPictureWindow { + let _promise: JSPromise = jsObject[Strings.requestPictureInPicture]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onenterpictureinpicture: EventHandler + + @ClosureAttribute.Optional1 + public var onleavepictureinpicture: EventHandler + + @ReadWriteAttribute + public var autoPictureInPicture: Bool + + @ReadWriteAttribute + public var disablePictureInPicture: Bool } diff --git a/Sources/DOMKit/WebIDL/HardwareAcceleration.swift b/Sources/DOMKit/WebIDL/HardwareAcceleration.swift new file mode 100644 index 00000000..c3ad8dc5 --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/HashChangeEvent.swift b/Sources/DOMKit/WebIDL/HashChangeEvent.swift index 7c76751d..48c723a7 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HashChangeEvent: Event { - override public class var constructor: JSFunction { JSObject.global.HashChangeEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.HashChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _oldURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldURL) diff --git a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift index bc312d23..576c4a87 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class HashChangeEventInit: BridgedDictionary { public convenience init(oldURL: String, newURL: String) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.oldURL] = oldURL.jsValue() object[Strings.newURL] = newURL.jsValue() self.init(unsafelyWrapping: object) diff --git a/Sources/DOMKit/WebIDL/HdrMetadataType.swift b/Sources/DOMKit/WebIDL/HdrMetadataType.swift new file mode 100644 index 00000000..77dc70e2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HdrMetadataType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum HdrMetadataType: JSString, JSValueCompatible { + case smpteSt2086 = "smpteSt2086" + case smpteSt209410 = "smpteSt2094-10" + case smpteSt209440 = "smpteSt2094-40" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift index 03913300..8b09b51e 100644 --- a/Sources/DOMKit/WebIDL/Headers.swift +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Headers: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global.Headers.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Headers].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/Highlight.swift b/Sources/DOMKit/WebIDL/Highlight.swift new file mode 100644 index 00000000..7b599c48 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Highlight.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Highlight: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Highlight].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _priority = ReadWriteAttribute(jsObject: jsObject, name: Strings.priority) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + self.jsObject = jsObject + } + + public convenience init(initialRanges: AbstractRange...) { + self.init(unsafelyWrapping: Self.constructor.new(initialRanges.jsValue())) + } + + // XXX: make me Set-like! + + @ReadWriteAttribute + public var priority: Int32 + + @ReadWriteAttribute + public var type: HighlightType +} diff --git a/Sources/DOMKit/WebIDL/HighlightRegistry.swift b/Sources/DOMKit/WebIDL/HighlightRegistry.swift new file mode 100644 index 00000000..d9001985 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HighlightRegistry.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HighlightRegistry: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.HighlightRegistry].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/HighlightType.swift b/Sources/DOMKit/WebIDL/HighlightType.swift new file mode 100644 index 00000000..09d376ee --- /dev/null +++ b/Sources/DOMKit/WebIDL/HighlightType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum HighlightType: JSString, JSValueCompatible { + case highlight = "highlight" + case spellingError = "spelling-error" + case grammarError = "grammar-error" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/History.swift b/Sources/DOMKit/WebIDL/History.swift index 99719524..aa861f05 100644 --- a/Sources/DOMKit/WebIDL/History.swift +++ b/Sources/DOMKit/WebIDL/History.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class History: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.History.function! } + public class var constructor: JSFunction { JSObject.global[Strings.History].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/HkdfParams.swift b/Sources/DOMKit/WebIDL/HkdfParams.swift new file mode 100644 index 00000000..428822eb --- /dev/null +++ b/Sources/DOMKit/WebIDL/HkdfParams.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HkdfParams: BridgedDictionary { + public convenience init(hash: HashAlgorithmIdentifier, salt: BufferSource, info: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.hash] = hash.jsValue() + object[Strings.salt] = salt.jsValue() + object[Strings.info] = info.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + _salt = ReadWriteAttribute(jsObject: object, name: Strings.salt) + _info = ReadWriteAttribute(jsObject: object, name: Strings.info) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var hash: HashAlgorithmIdentifier + + @ReadWriteAttribute + public var salt: BufferSource + + @ReadWriteAttribute + public var info: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/HmacImportParams.swift b/Sources/DOMKit/WebIDL/HmacImportParams.swift new file mode 100644 index 00000000..0caefa96 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HmacImportParams.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HmacImportParams: BridgedDictionary { + public convenience init(hash: HashAlgorithmIdentifier, length: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.hash] = hash.jsValue() + object[Strings.length] = length.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var hash: HashAlgorithmIdentifier + + @ReadWriteAttribute + public var length: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift new file mode 100644 index 00000000..59487735 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HmacKeyAlgorithm: BridgedDictionary { + public convenience init(hash: KeyAlgorithm, length: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.hash] = hash.jsValue() + object[Strings.length] = length.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var hash: KeyAlgorithm + + @ReadWriteAttribute + public var length: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift b/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift new file mode 100644 index 00000000..97148ec8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class HmacKeyGenParams: BridgedDictionary { + public convenience init(hash: HashAlgorithmIdentifier, length: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.hash] = hash.jsValue() + object[Strings.length] = length.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var hash: HashAlgorithmIdentifier + + @ReadWriteAttribute + public var length: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/IDBCursor.swift b/Sources/DOMKit/WebIDL/IDBCursor.swift new file mode 100644 index 00000000..1de87002 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBCursor.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBCursor: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.IDBCursor].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) + _direction = ReadonlyAttribute(jsObject: jsObject, name: Strings.direction) + _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) + _primaryKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.primaryKey) + _request = ReadonlyAttribute(jsObject: jsObject, name: Strings.request) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var source: __UNSUPPORTED_UNION__ + + @ReadonlyAttribute + public var direction: IDBCursorDirection + + @ReadonlyAttribute + public var key: JSValue + + @ReadonlyAttribute + public var primaryKey: JSValue + + @ReadonlyAttribute + public var request: IDBRequest + + public func advance(count: UInt32) { + _ = jsObject[Strings.advance]!(count.jsValue()) + } + + public func continue (key: JSValue? = nil) -> Void { + _ = jsObject[Strings.continue]!(key?.jsValue() ?? .undefined) + } + + public func continuePrimaryKey(key: JSValue, primaryKey: JSValue) { + _ = jsObject[Strings.continuePrimaryKey]!(key.jsValue(), primaryKey.jsValue()) + } + + public func update(value: JSValue) -> IDBRequest { + jsObject[Strings.update]!(value.jsValue()).fromJSValue()! + } + + public func delete() -> IDBRequest { + jsObject[Strings.delete]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/IDBCursorDirection.swift b/Sources/DOMKit/WebIDL/IDBCursorDirection.swift new file mode 100644 index 00000000..c6e2af31 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBCursorDirection.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum IDBCursorDirection: JSString, JSValueCompatible { + case next = "next" + case nextunique = "nextunique" + case prev = "prev" + case prevunique = "prevunique" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/IDBCursorWithValue.swift b/Sources/DOMKit/WebIDL/IDBCursorWithValue.swift new file mode 100644 index 00000000..aa3899ab --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBCursorWithValue.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBCursorWithValue: IDBCursor { + override public class var constructor: JSFunction { JSObject.global[Strings.IDBCursorWithValue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var value: JSValue +} diff --git a/Sources/DOMKit/WebIDL/IDBDatabase.swift b/Sources/DOMKit/WebIDL/IDBDatabase.swift new file mode 100644 index 00000000..ceae0a00 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBDatabase.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBDatabase: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.IDBDatabase].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _version = ReadonlyAttribute(jsObject: jsObject, name: Strings.version) + _objectStoreNames = ReadonlyAttribute(jsObject: jsObject, name: Strings.objectStoreNames) + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) + _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onversionchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onversionchange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var version: UInt64 + + @ReadonlyAttribute + public var objectStoreNames: DOMStringList + + public func transaction(storeNames: __UNSUPPORTED_UNION__, mode: IDBTransactionMode? = nil, options: IDBTransactionOptions? = nil) -> IDBTransaction { + jsObject[Strings.transaction]!(storeNames.jsValue(), mode?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func close() { + _ = jsObject[Strings.close]!() + } + + public func createObjectStore(name: String, options: IDBObjectStoreParameters? = nil) -> IDBObjectStore { + jsObject[Strings.createObjectStore]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteObjectStore(name: String) { + _ = jsObject[Strings.deleteObjectStore]!(name.jsValue()) + } + + @ClosureAttribute.Optional1 + public var onabort: EventHandler + + @ClosureAttribute.Optional1 + public var onclose: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onversionchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift b/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift new file mode 100644 index 00000000..13bdf8a2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBDatabaseInfo: BridgedDictionary { + public convenience init(name: String, version: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.version] = version.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _version = ReadWriteAttribute(jsObject: object, name: Strings.version) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var version: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/IDBFactory.swift b/Sources/DOMKit/WebIDL/IDBFactory.swift new file mode 100644 index 00000000..c77d112a --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBFactory.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBFactory: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.IDBFactory].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func open(name: String, version: UInt64? = nil) -> IDBOpenDBRequest { + jsObject[Strings.open]!(name.jsValue(), version?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteDatabase(name: String) -> IDBOpenDBRequest { + jsObject[Strings.deleteDatabase]!(name.jsValue()).fromJSValue()! + } + + public func databases() -> JSPromise { + jsObject[Strings.databases]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func databases() async throws -> [IDBDatabaseInfo] { + let _promise: JSPromise = jsObject[Strings.databases]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func cmp(first: JSValue, second: JSValue) -> Int16 { + jsObject[Strings.cmp]!(first.jsValue(), second.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/IDBIndex.swift b/Sources/DOMKit/WebIDL/IDBIndex.swift new file mode 100644 index 00000000..cc95e4cf --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBIndex.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBIndex: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.IDBIndex].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _objectStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.objectStore) + _keyPath = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyPath) + _multiEntry = ReadonlyAttribute(jsObject: jsObject, name: Strings.multiEntry) + _unique = ReadonlyAttribute(jsObject: jsObject, name: Strings.unique) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var name: String + + @ReadonlyAttribute + public var objectStore: IDBObjectStore + + @ReadonlyAttribute + public var keyPath: JSValue + + @ReadonlyAttribute + public var multiEntry: Bool + + @ReadonlyAttribute + public var unique: Bool + + public func get(query: JSValue) -> IDBRequest { + jsObject[Strings.get]!(query.jsValue()).fromJSValue()! + } + + public func getKey(query: JSValue) -> IDBRequest { + jsObject[Strings.getKey]!(query.jsValue()).fromJSValue()! + } + + public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { + jsObject[Strings.getAll]!(query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined).fromJSValue()! + } + + public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { + jsObject[Strings.getAllKeys]!(query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined).fromJSValue()! + } + + public func count(query: JSValue? = nil) -> IDBRequest { + jsObject[Strings.count]!(query?.jsValue() ?? .undefined).fromJSValue()! + } + + public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { + jsObject[Strings.openCursor]!(query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined).fromJSValue()! + } + + public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { + jsObject[Strings.openKeyCursor]!(query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/IDBIndexParameters.swift b/Sources/DOMKit/WebIDL/IDBIndexParameters.swift new file mode 100644 index 00000000..510bd661 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBIndexParameters.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBIndexParameters: BridgedDictionary { + public convenience init(unique: Bool, multiEntry: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.unique] = unique.jsValue() + object[Strings.multiEntry] = multiEntry.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _unique = ReadWriteAttribute(jsObject: object, name: Strings.unique) + _multiEntry = ReadWriteAttribute(jsObject: object, name: Strings.multiEntry) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var unique: Bool + + @ReadWriteAttribute + public var multiEntry: Bool +} diff --git a/Sources/DOMKit/WebIDL/IDBKeyRange.swift b/Sources/DOMKit/WebIDL/IDBKeyRange.swift new file mode 100644 index 00000000..f4f6ea3e --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBKeyRange.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBKeyRange: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.IDBKeyRange].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _lower = ReadonlyAttribute(jsObject: jsObject, name: Strings.lower) + _upper = ReadonlyAttribute(jsObject: jsObject, name: Strings.upper) + _lowerOpen = ReadonlyAttribute(jsObject: jsObject, name: Strings.lowerOpen) + _upperOpen = ReadonlyAttribute(jsObject: jsObject, name: Strings.upperOpen) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var lower: JSValue + + @ReadonlyAttribute + public var upper: JSValue + + @ReadonlyAttribute + public var lowerOpen: Bool + + @ReadonlyAttribute + public var upperOpen: Bool + + public static func only(value: JSValue) -> Self { + constructor[Strings.only]!(value.jsValue()).fromJSValue()! + } + + public static func lowerBound(lower: JSValue, open: Bool? = nil) -> Self { + constructor[Strings.lowerBound]!(lower.jsValue(), open?.jsValue() ?? .undefined).fromJSValue()! + } + + public static func upperBound(upper: JSValue, open: Bool? = nil) -> Self { + constructor[Strings.upperBound]!(upper.jsValue(), open?.jsValue() ?? .undefined).fromJSValue()! + } + + public static func bound(lower: JSValue, upper: JSValue, lowerOpen: Bool? = nil, upperOpen: Bool? = nil) -> Self { + constructor[Strings.bound]!(lower.jsValue(), upper.jsValue(), lowerOpen?.jsValue() ?? .undefined, upperOpen?.jsValue() ?? .undefined).fromJSValue()! + } + + public func includes(key: JSValue) -> Bool { + jsObject[Strings.includes]!(key.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBObjectStore.swift new file mode 100644 index 00000000..7e2d25ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBObjectStore.swift @@ -0,0 +1,90 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBObjectStore: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.IDBObjectStore].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + _keyPath = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyPath) + _indexNames = ReadonlyAttribute(jsObject: jsObject, name: Strings.indexNames) + _transaction = ReadonlyAttribute(jsObject: jsObject, name: Strings.transaction) + _autoIncrement = ReadonlyAttribute(jsObject: jsObject, name: Strings.autoIncrement) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var name: String + + @ReadonlyAttribute + public var keyPath: JSValue + + @ReadonlyAttribute + public var indexNames: DOMStringList + + @ReadonlyAttribute + public var transaction: IDBTransaction + + @ReadonlyAttribute + public var autoIncrement: Bool + + public func put(value: JSValue, key: JSValue? = nil) -> IDBRequest { + jsObject[Strings.put]!(value.jsValue(), key?.jsValue() ?? .undefined).fromJSValue()! + } + + public func add(value: JSValue, key: JSValue? = nil) -> IDBRequest { + jsObject[Strings.add]!(value.jsValue(), key?.jsValue() ?? .undefined).fromJSValue()! + } + + public func delete(query: JSValue) -> IDBRequest { + jsObject[Strings.delete]!(query.jsValue()).fromJSValue()! + } + + public func clear() -> IDBRequest { + jsObject[Strings.clear]!().fromJSValue()! + } + + public func get(query: JSValue) -> IDBRequest { + jsObject[Strings.get]!(query.jsValue()).fromJSValue()! + } + + public func getKey(query: JSValue) -> IDBRequest { + jsObject[Strings.getKey]!(query.jsValue()).fromJSValue()! + } + + public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { + jsObject[Strings.getAll]!(query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined).fromJSValue()! + } + + public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { + jsObject[Strings.getAllKeys]!(query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined).fromJSValue()! + } + + public func count(query: JSValue? = nil) -> IDBRequest { + jsObject[Strings.count]!(query?.jsValue() ?? .undefined).fromJSValue()! + } + + public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { + jsObject[Strings.openCursor]!(query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined).fromJSValue()! + } + + public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { + jsObject[Strings.openKeyCursor]!(query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined).fromJSValue()! + } + + public func index(name: String) -> IDBIndex { + jsObject[Strings.index]!(name.jsValue()).fromJSValue()! + } + + public func createIndex(name: String, keyPath: __UNSUPPORTED_UNION__, options: IDBIndexParameters? = nil) -> IDBIndex { + jsObject[Strings.createIndex]!(name.jsValue(), keyPath.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func deleteIndex(name: String) { + _ = jsObject[Strings.deleteIndex]!(name.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift b/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift new file mode 100644 index 00000000..19027ace --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBObjectStoreParameters: BridgedDictionary { + public convenience init(keyPath: __UNSUPPORTED_UNION__?, autoIncrement: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.keyPath] = keyPath.jsValue() + object[Strings.autoIncrement] = autoIncrement.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _keyPath = ReadWriteAttribute(jsObject: object, name: Strings.keyPath) + _autoIncrement = ReadWriteAttribute(jsObject: object, name: Strings.autoIncrement) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var keyPath: __UNSUPPORTED_UNION__? + + @ReadWriteAttribute + public var autoIncrement: Bool +} diff --git a/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift b/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift new file mode 100644 index 00000000..279c0b6a --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBOpenDBRequest: IDBRequest { + override public class var constructor: JSFunction { JSObject.global[Strings.IDBOpenDBRequest].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onblocked = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onblocked) + _onupgradeneeded = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupgradeneeded) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var onblocked: EventHandler + + @ClosureAttribute.Optional1 + public var onupgradeneeded: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/IDBRequest.swift b/Sources/DOMKit/WebIDL/IDBRequest.swift new file mode 100644 index 00000000..8e704766 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBRequest.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBRequest: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.IDBRequest].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _result = ReadonlyAttribute(jsObject: jsObject, name: Strings.result) + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) + _transaction = ReadonlyAttribute(jsObject: jsObject, name: Strings.transaction) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _onsuccess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsuccess) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var result: JSValue + + @ReadonlyAttribute + public var error: DOMException? + + @ReadonlyAttribute + public var source: __UNSUPPORTED_UNION__? + + @ReadonlyAttribute + public var transaction: IDBTransaction? + + @ReadonlyAttribute + public var readyState: IDBRequestReadyState + + @ClosureAttribute.Optional1 + public var onsuccess: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift b/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift new file mode 100644 index 00000000..2f1b3929 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum IDBRequestReadyState: JSString, JSValueCompatible { + case pending = "pending" + case done = "done" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/IDBTransaction.swift b/Sources/DOMKit/WebIDL/IDBTransaction.swift new file mode 100644 index 00000000..3104faac --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBTransaction.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBTransaction: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.IDBTransaction].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _objectStoreNames = ReadonlyAttribute(jsObject: jsObject, name: Strings.objectStoreNames) + _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) + _durability = ReadonlyAttribute(jsObject: jsObject, name: Strings.durability) + _db = ReadonlyAttribute(jsObject: jsObject, name: Strings.db) + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) + _oncomplete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncomplete) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var objectStoreNames: DOMStringList + + @ReadonlyAttribute + public var mode: IDBTransactionMode + + @ReadonlyAttribute + public var durability: IDBTransactionDurability + + @ReadonlyAttribute + public var db: IDBDatabase + + @ReadonlyAttribute + public var error: DOMException? + + public func objectStore(name: String) -> IDBObjectStore { + jsObject[Strings.objectStore]!(name.jsValue()).fromJSValue()! + } + + public func commit() { + _ = jsObject[Strings.commit]!() + } + + public func abort() { + _ = jsObject[Strings.abort]!() + } + + @ClosureAttribute.Optional1 + public var onabort: EventHandler + + @ClosureAttribute.Optional1 + public var oncomplete: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift b/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift new file mode 100644 index 00000000..d55c1dd1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum IDBTransactionDurability: JSString, JSValueCompatible { + case `default` = "default" + case strict = "strict" + case relaxed = "relaxed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/IDBTransactionMode.swift b/Sources/DOMKit/WebIDL/IDBTransactionMode.swift new file mode 100644 index 00000000..ed0dea8e --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBTransactionMode.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum IDBTransactionMode: JSString, JSValueCompatible { + case readonly = "readonly" + case readwrite = "readwrite" + case versionchange = "versionchange" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/IDBTransactionOptions.swift b/Sources/DOMKit/WebIDL/IDBTransactionOptions.swift new file mode 100644 index 00000000..ade57d2d --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBTransactionOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBTransactionOptions: BridgedDictionary { + public convenience init(durability: IDBTransactionDurability) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.durability] = durability.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _durability = ReadWriteAttribute(jsObject: object, name: Strings.durability) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var durability: IDBTransactionDurability +} diff --git a/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift b/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift new file mode 100644 index 00000000..9633037f --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBVersionChangeEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.IDBVersionChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _oldVersion = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldVersion) + _newVersion = ReadonlyAttribute(jsObject: jsObject, name: Strings.newVersion) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: IDBVersionChangeEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var oldVersion: UInt64 + + @ReadonlyAttribute + public var newVersion: UInt64? +} diff --git a/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift b/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift new file mode 100644 index 00000000..246703ca --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IDBVersionChangeEventInit: BridgedDictionary { + public convenience init(oldVersion: UInt64, newVersion: UInt64?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.oldVersion] = oldVersion.jsValue() + object[Strings.newVersion] = newVersion.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _oldVersion = ReadWriteAttribute(jsObject: object, name: Strings.oldVersion) + _newVersion = ReadWriteAttribute(jsObject: object, name: Strings.newVersion) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var oldVersion: UInt64 + + @ReadWriteAttribute + public var newVersion: UInt64? +} diff --git a/Sources/DOMKit/WebIDL/IIRFilterNode.swift b/Sources/DOMKit/WebIDL/IIRFilterNode.swift new file mode 100644 index 00000000..6b6dc673 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IIRFilterNode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IIRFilterNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.IIRFilterNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: IIRFilterOptions) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options.jsValue())) + } + + public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { + _ = jsObject[Strings.getFrequencyResponse]!(frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/IIRFilterOptions.swift b/Sources/DOMKit/WebIDL/IIRFilterOptions.swift new file mode 100644 index 00000000..cb5cea81 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IIRFilterOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IIRFilterOptions: BridgedDictionary { + public convenience init(feedforward: [Double], feedback: [Double]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.feedforward] = feedforward.jsValue() + object[Strings.feedback] = feedback.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _feedforward = ReadWriteAttribute(jsObject: object, name: Strings.feedforward) + _feedback = ReadWriteAttribute(jsObject: object, name: Strings.feedback) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var feedforward: [Double] + + @ReadWriteAttribute + public var feedback: [Double] +} diff --git a/Sources/DOMKit/WebIDL/IdleDeadline.swift b/Sources/DOMKit/WebIDL/IdleDeadline.swift new file mode 100644 index 00000000..d2b8b1a5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IdleDeadline.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IdleDeadline: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.IdleDeadline].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _didTimeout = ReadonlyAttribute(jsObject: jsObject, name: Strings.didTimeout) + self.jsObject = jsObject + } + + public func timeRemaining() -> DOMHighResTimeStamp { + jsObject[Strings.timeRemaining]!().fromJSValue()! + } + + @ReadonlyAttribute + public var didTimeout: Bool +} diff --git a/Sources/DOMKit/WebIDL/IdleDetector.swift b/Sources/DOMKit/WebIDL/IdleDetector.swift new file mode 100644 index 00000000..a1712748 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IdleDetector.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IdleDetector: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.IdleDetector].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _userState = ReadonlyAttribute(jsObject: jsObject, name: Strings.userState) + _screenState = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenState) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var userState: UserIdleState? + + @ReadonlyAttribute + public var screenState: ScreenIdleState? + + @ClosureAttribute.Optional1 + public var onchange: EventHandler + + public static func requestPermission() -> JSPromise { + constructor[Strings.requestPermission]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func requestPermission() async throws -> PermissionState { + let _promise: JSPromise = constructor[Strings.requestPermission]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func start(options: IdleOptions? = nil) -> JSPromise { + jsObject[Strings.start]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func start(options: IdleOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.start]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/IdleOptions.swift b/Sources/DOMKit/WebIDL/IdleOptions.swift new file mode 100644 index 00000000..27f1366c --- /dev/null +++ b/Sources/DOMKit/WebIDL/IdleOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IdleOptions: BridgedDictionary { + public convenience init(threshold: UInt64, signal: AbortSignal) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.threshold] = threshold.jsValue() + object[Strings.signal] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _threshold = ReadWriteAttribute(jsObject: object, name: Strings.threshold) + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var threshold: UInt64 + + @ReadWriteAttribute + public var signal: AbortSignal +} diff --git a/Sources/DOMKit/WebIDL/IdleRequestOptions.swift b/Sources/DOMKit/WebIDL/IdleRequestOptions.swift new file mode 100644 index 00000000..7626d862 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IdleRequestOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IdleRequestOptions: BridgedDictionary { + public convenience init(timeout: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.timeout] = timeout.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var timeout: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/ImageBitmap.swift b/Sources/DOMKit/WebIDL/ImageBitmap.swift index 3f38248f..548abb68 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmap.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageBitmap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.ImageBitmap.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ImageBitmap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift index 453eb0b2..34edd096 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ImageBitmapOptions: BridgedDictionary { public convenience init(imageOrientation: ImageOrientation, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, resizeWidth: UInt32, resizeHeight: UInt32, resizeQuality: ResizeQuality) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.imageOrientation] = imageOrientation.jsValue() object[Strings.premultiplyAlpha] = premultiplyAlpha.jsValue() object[Strings.colorSpaceConversion] = colorSpaceConversion.jsValue() diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift index 6cbe889c..80ffb53e 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageBitmapRenderingContext: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.ImageBitmapRenderingContext.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ImageBitmapRenderingContext].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift index db66e2da..98cc21cc 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ImageBitmapRenderingContextSettings: BridgedDictionary { public convenience init(alpha: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.alpha] = alpha.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageCapture.swift b/Sources/DOMKit/WebIDL/ImageCapture.swift new file mode 100644 index 00000000..c079c54d --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageCapture.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageCapture: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ImageCapture].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) + self.jsObject = jsObject + } + + public convenience init(videoTrack: MediaStreamTrack) { + self.init(unsafelyWrapping: Self.constructor.new(videoTrack.jsValue())) + } + + public func takePhoto(photoSettings: PhotoSettings? = nil) -> JSPromise { + jsObject[Strings.takePhoto]!(photoSettings?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func takePhoto(photoSettings: PhotoSettings? = nil) async throws -> Blob { + let _promise: JSPromise = jsObject[Strings.takePhoto]!(photoSettings?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getPhotoCapabilities() -> JSPromise { + jsObject[Strings.getPhotoCapabilities]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getPhotoCapabilities() async throws -> PhotoCapabilities { + let _promise: JSPromise = jsObject[Strings.getPhotoCapabilities]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getPhotoSettings() -> JSPromise { + jsObject[Strings.getPhotoSettings]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getPhotoSettings() async throws -> PhotoSettings { + let _promise: JSPromise = jsObject[Strings.getPhotoSettings]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func grabFrame() -> JSPromise { + jsObject[Strings.grabFrame]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func grabFrame() async throws -> ImageBitmap { + let _promise: JSPromise = jsObject[Strings.grabFrame]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var track: MediaStreamTrack +} diff --git a/Sources/DOMKit/WebIDL/ImageData.swift b/Sources/DOMKit/WebIDL/ImageData.swift index 1731081e..d8ee1102 100644 --- a/Sources/DOMKit/WebIDL/ImageData.swift +++ b/Sources/DOMKit/WebIDL/ImageData.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageData: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.ImageData.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ImageData].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ImageDataSettings.swift b/Sources/DOMKit/WebIDL/ImageDataSettings.swift index 0ad4cc85..553ddd12 100644 --- a/Sources/DOMKit/WebIDL/ImageDataSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageDataSettings.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ImageDataSettings: BridgedDictionary { public convenience init(colorSpace: PredefinedColorSpace) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.colorSpace] = colorSpace.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift b/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift new file mode 100644 index 00000000..318a51b1 --- /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..aea45b6d --- /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..8e397600 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageDecoder.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageDecoder: JSBridgedClass { + 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 + } + + public convenience init(init: ImageDecoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadonlyAttribute + public var type: String + + @ReadonlyAttribute + public var complete: Bool + + @ReadonlyAttribute + public var completed: JSPromise + + @ReadonlyAttribute + public var tracks: ImageTrackList + + public func decode(options: ImageDecodeOptions? = nil) -> JSPromise { + jsObject[Strings.decode]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func decode(options: ImageDecodeOptions? = nil) async throws -> ImageDecodeResult { + let _promise: JSPromise = jsObject[Strings.decode]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func reset() { + _ = jsObject[Strings.reset]!() + } + + public func close() { + _ = jsObject[Strings.close]!() + } + + public static func isTypeSupported(type: String) -> JSPromise { + constructor[Strings.isTypeSupported]!(type.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func isTypeSupported(type: String) async throws -> Bool { + let _promise: JSPromise = constructor[Strings.isTypeSupported]!(type.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ImageDecoderInit.swift b/Sources/DOMKit/WebIDL/ImageDecoderInit.swift new file mode 100644 index 00000000..77a5fd4f --- /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/ImageEncodeOptions.swift b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift index d33cf5a5..250ebdb0 100644 --- a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ImageEncodeOptions: BridgedDictionary { public convenience init(type: String, quality: Double) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.type] = type.jsValue() object[Strings.quality] = quality.jsValue() self.init(unsafelyWrapping: object) diff --git a/Sources/DOMKit/WebIDL/ImageObject.swift b/Sources/DOMKit/WebIDL/ImageObject.swift new file mode 100644 index 00000000..f4660eea --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageObject.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageObject: BridgedDictionary { + public convenience init(src: String, sizes: String, type: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.src] = src.jsValue() + object[Strings.sizes] = sizes.jsValue() + object[Strings.type] = type.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _src = ReadWriteAttribute(jsObject: object, name: Strings.src) + _sizes = ReadWriteAttribute(jsObject: object, name: Strings.sizes) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var sizes: String + + @ReadWriteAttribute + public var type: String +} diff --git a/Sources/DOMKit/WebIDL/ImageResource.swift b/Sources/DOMKit/WebIDL/ImageResource.swift new file mode 100644 index 00000000..414a2e16 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageResource.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageResource: BridgedDictionary { + public convenience init(src: String, sizes: String, type: String, label: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.src] = src.jsValue() + object[Strings.sizes] = sizes.jsValue() + object[Strings.type] = type.jsValue() + object[Strings.label] = label.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _src = ReadWriteAttribute(jsObject: object, name: Strings.src) + _sizes = ReadWriteAttribute(jsObject: object, name: Strings.sizes) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _label = ReadWriteAttribute(jsObject: object, name: Strings.label) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var sizes: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var label: String +} diff --git a/Sources/DOMKit/WebIDL/ImageTrack.swift b/Sources/DOMKit/WebIDL/ImageTrack.swift new file mode 100644 index 00000000..52c362b1 --- /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 { + 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 = ClosureAttribute.Optional1(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 + + @ClosureAttribute.Optional1 + 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..1bdabdd6 --- /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 { + 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 + } + + 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/ImportExportKind.swift b/Sources/DOMKit/WebIDL/ImportExportKind.swift new file mode 100644 index 00000000..394385fd --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImportExportKind.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ImportExportKind: JSString, JSValueCompatible { + case function = "function" + case table = "table" + case memory = "memory" + case global = "global" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Ink.swift b/Sources/DOMKit/WebIDL/Ink.swift new file mode 100644 index 00000000..44a0359b --- /dev/null +++ b/Sources/DOMKit/WebIDL/Ink.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Ink: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Ink].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func requestPresenter(param: InkPresenterParam? = nil) -> JSPromise { + jsObject[Strings.requestPresenter]!(param?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestPresenter(param: InkPresenterParam? = nil) async throws -> InkPresenter { + let _promise: JSPromise = jsObject[Strings.requestPresenter]!(param?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/InkPresenter.swift b/Sources/DOMKit/WebIDL/InkPresenter.swift new file mode 100644 index 00000000..fbac8826 --- /dev/null +++ b/Sources/DOMKit/WebIDL/InkPresenter.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class InkPresenter: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.InkPresenter].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _presentationArea = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentationArea) + _expectedImprovement = ReadonlyAttribute(jsObject: jsObject, name: Strings.expectedImprovement) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var presentationArea: Element? + + @ReadonlyAttribute + public var expectedImprovement: UInt32 + + public func updateInkTrailStartPoint(event: PointerEvent, style: InkTrailStyle) { + _ = jsObject[Strings.updateInkTrailStartPoint]!(event.jsValue(), style.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/InkPresenterParam.swift b/Sources/DOMKit/WebIDL/InkPresenterParam.swift new file mode 100644 index 00000000..b34a6ffd --- /dev/null +++ b/Sources/DOMKit/WebIDL/InkPresenterParam.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class InkPresenterParam: BridgedDictionary { + public convenience init(presentationArea: Element?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.presentationArea] = presentationArea.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _presentationArea = ReadWriteAttribute(jsObject: object, name: Strings.presentationArea) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var presentationArea: Element? +} diff --git a/Sources/DOMKit/WebIDL/InkTrailStyle.swift b/Sources/DOMKit/WebIDL/InkTrailStyle.swift new file mode 100644 index 00000000..95fc960e --- /dev/null +++ b/Sources/DOMKit/WebIDL/InkTrailStyle.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class InkTrailStyle: BridgedDictionary { + public convenience init(color: String, diameter: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.color] = color.jsValue() + object[Strings.diameter] = diameter.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _color = ReadWriteAttribute(jsObject: object, name: Strings.color) + _diameter = ReadWriteAttribute(jsObject: object, name: Strings.diameter) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var color: String + + @ReadWriteAttribute + public var diameter: Double +} diff --git a/Sources/DOMKit/WebIDL/InnerHTML.swift b/Sources/DOMKit/WebIDL/InnerHTML.swift new file mode 100644 index 00000000..b709f2fc --- /dev/null +++ b/Sources/DOMKit/WebIDL/InnerHTML.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol InnerHTML: JSBridgedClass {} +public extension InnerHTML { + var innerHTML: String { + get { ReadWriteAttribute[Strings.innerHTML, in: jsObject] } + set { ReadWriteAttribute[Strings.innerHTML, in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift b/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift new file mode 100644 index 00000000..963c980b --- /dev/null +++ b/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class InputDeviceCapabilities: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.InputDeviceCapabilities].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _firesTouchEvents = ReadonlyAttribute(jsObject: jsObject, name: Strings.firesTouchEvents) + _pointerMovementScrolls = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointerMovementScrolls) + self.jsObject = jsObject + } + + public convenience init(deviceInitDict: InputDeviceCapabilitiesInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(deviceInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var firesTouchEvents: Bool + + @ReadonlyAttribute + public var pointerMovementScrolls: Bool +} diff --git a/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift b/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift new file mode 100644 index 00000000..76797619 --- /dev/null +++ b/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class InputDeviceCapabilitiesInit: BridgedDictionary { + public convenience init(firesTouchEvents: Bool, pointerMovementScrolls: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.firesTouchEvents] = firesTouchEvents.jsValue() + object[Strings.pointerMovementScrolls] = pointerMovementScrolls.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _firesTouchEvents = ReadWriteAttribute(jsObject: object, name: Strings.firesTouchEvents) + _pointerMovementScrolls = ReadWriteAttribute(jsObject: object, name: Strings.pointerMovementScrolls) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var firesTouchEvents: Bool + + @ReadWriteAttribute + public var pointerMovementScrolls: Bool +} diff --git a/Sources/DOMKit/WebIDL/InputDeviceInfo.swift b/Sources/DOMKit/WebIDL/InputDeviceInfo.swift new file mode 100644 index 00000000..4cf24461 --- /dev/null +++ b/Sources/DOMKit/WebIDL/InputDeviceInfo.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class InputDeviceInfo: MediaDeviceInfo { + override public class var constructor: JSFunction { JSObject.global[Strings.InputDeviceInfo].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func getCapabilities() -> MediaTrackCapabilities { + jsObject[Strings.getCapabilities]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index a6651413..029115b5 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -4,15 +4,23 @@ import JavaScriptEventLoop import JavaScriptKit public class InputEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global.InputEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.InputEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Strings.isComposing) _inputType = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputType) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var dataTransfer: DataTransfer? + + public func getTargetRanges() -> [StaticRange] { + jsObject[Strings.getTargetRanges]!().fromJSValue()! + } + public convenience init(type: String, eventInitDict: InputEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift index 5bf9ac58..8604dfca 100644 --- a/Sources/DOMKit/WebIDL/InputEventInit.swift +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -4,8 +4,10 @@ import JavaScriptEventLoop import JavaScriptKit public class InputEventInit: BridgedDictionary { - public convenience init(data: String?, isComposing: Bool, inputType: String) { - let object = JSObject.global.Object.function!.new() + public convenience init(dataTransfer: DataTransfer?, targetRanges: [StaticRange], data: String?, isComposing: Bool, inputType: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.dataTransfer] = dataTransfer.jsValue() + object[Strings.targetRanges] = targetRanges.jsValue() object[Strings.data] = data.jsValue() object[Strings.isComposing] = isComposing.jsValue() object[Strings.inputType] = inputType.jsValue() @@ -13,12 +15,20 @@ public class InputEventInit: BridgedDictionary { } public required init(unsafelyWrapping object: JSObject) { + _dataTransfer = ReadWriteAttribute(jsObject: object, name: Strings.dataTransfer) + _targetRanges = ReadWriteAttribute(jsObject: object, name: Strings.targetRanges) _data = ReadWriteAttribute(jsObject: object, name: Strings.data) _isComposing = ReadWriteAttribute(jsObject: object, name: Strings.isComposing) _inputType = ReadWriteAttribute(jsObject: object, name: Strings.inputType) super.init(unsafelyWrapping: object) } + @ReadWriteAttribute + public var dataTransfer: DataTransfer? + + @ReadWriteAttribute + public var targetRanges: [StaticRange] + @ReadWriteAttribute public var data: String? diff --git a/Sources/DOMKit/WebIDL/Instance.swift b/Sources/DOMKit/WebIDL/Instance.swift new file mode 100644 index 00000000..6af9d169 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Instance.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Instance: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Instance].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _exports = ReadonlyAttribute(jsObject: jsObject, name: Strings.exports) + self.jsObject = jsObject + } + + public convenience init(module: Module, importObject: JSObject? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(module.jsValue(), importObject?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var exports: JSObject +} diff --git a/Sources/DOMKit/WebIDL/InteractionCounts.swift b/Sources/DOMKit/WebIDL/InteractionCounts.swift new file mode 100644 index 00000000..d1f03dd8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/InteractionCounts.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class InteractionCounts: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.InteractionCounts].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/IntersectionObserver.swift b/Sources/DOMKit/WebIDL/IntersectionObserver.swift new file mode 100644 index 00000000..aeb55326 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IntersectionObserver.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IntersectionObserver: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.IntersectionObserver].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _root = ReadonlyAttribute(jsObject: jsObject, name: Strings.root) + _rootMargin = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootMargin) + _thresholds = ReadonlyAttribute(jsObject: jsObject, name: Strings.thresholds) + self.jsObject = jsObject + } + + public convenience init(callback: IntersectionObserverCallback, options: IntersectionObserverInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var root: __UNSUPPORTED_UNION__? + + @ReadonlyAttribute + public var rootMargin: String + + @ReadonlyAttribute + public var thresholds: [Double] + + public func observe(target: Element) { + _ = jsObject[Strings.observe]!(target.jsValue()) + } + + public func unobserve(target: Element) { + _ = jsObject[Strings.unobserve]!(target.jsValue()) + } + + public func disconnect() { + _ = jsObject[Strings.disconnect]!() + } + + public func takeRecords() -> [IntersectionObserverEntry] { + jsObject[Strings.takeRecords]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift b/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift new file mode 100644 index 00000000..4538e786 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IntersectionObserverEntry: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.IntersectionObserverEntry].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _time = ReadonlyAttribute(jsObject: jsObject, name: Strings.time) + _rootBounds = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootBounds) + _boundingClientRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingClientRect) + _intersectionRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.intersectionRect) + _isIntersecting = ReadonlyAttribute(jsObject: jsObject, name: Strings.isIntersecting) + _intersectionRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.intersectionRatio) + _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) + self.jsObject = jsObject + } + + public convenience init(intersectionObserverEntryInit: IntersectionObserverEntryInit) { + self.init(unsafelyWrapping: Self.constructor.new(intersectionObserverEntryInit.jsValue())) + } + + @ReadonlyAttribute + public var time: DOMHighResTimeStamp + + @ReadonlyAttribute + public var rootBounds: DOMRectReadOnly? + + @ReadonlyAttribute + public var boundingClientRect: DOMRectReadOnly + + @ReadonlyAttribute + public var intersectionRect: DOMRectReadOnly + + @ReadonlyAttribute + public var isIntersecting: Bool + + @ReadonlyAttribute + public var intersectionRatio: Double + + @ReadonlyAttribute + public var target: Element +} diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift b/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift new file mode 100644 index 00000000..2b96f7b3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IntersectionObserverEntryInit: BridgedDictionary { + public convenience init(time: DOMHighResTimeStamp, rootBounds: DOMRectInit?, boundingClientRect: DOMRectInit, intersectionRect: DOMRectInit, isIntersecting: Bool, intersectionRatio: Double, target: Element) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.time] = time.jsValue() + object[Strings.rootBounds] = rootBounds.jsValue() + object[Strings.boundingClientRect] = boundingClientRect.jsValue() + object[Strings.intersectionRect] = intersectionRect.jsValue() + object[Strings.isIntersecting] = isIntersecting.jsValue() + object[Strings.intersectionRatio] = intersectionRatio.jsValue() + object[Strings.target] = target.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _time = ReadWriteAttribute(jsObject: object, name: Strings.time) + _rootBounds = ReadWriteAttribute(jsObject: object, name: Strings.rootBounds) + _boundingClientRect = ReadWriteAttribute(jsObject: object, name: Strings.boundingClientRect) + _intersectionRect = ReadWriteAttribute(jsObject: object, name: Strings.intersectionRect) + _isIntersecting = ReadWriteAttribute(jsObject: object, name: Strings.isIntersecting) + _intersectionRatio = ReadWriteAttribute(jsObject: object, name: Strings.intersectionRatio) + _target = ReadWriteAttribute(jsObject: object, name: Strings.target) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var time: DOMHighResTimeStamp + + @ReadWriteAttribute + public var rootBounds: DOMRectInit? + + @ReadWriteAttribute + public var boundingClientRect: DOMRectInit + + @ReadWriteAttribute + public var intersectionRect: DOMRectInit + + @ReadWriteAttribute + public var isIntersecting: Bool + + @ReadWriteAttribute + public var intersectionRatio: Double + + @ReadWriteAttribute + public var target: Element +} diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift b/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift new file mode 100644 index 00000000..cd32c851 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IntersectionObserverInit: BridgedDictionary { + public convenience init(root: __UNSUPPORTED_UNION__?, rootMargin: String, threshold: __UNSUPPORTED_UNION__) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.root] = root.jsValue() + object[Strings.rootMargin] = rootMargin.jsValue() + object[Strings.threshold] = threshold.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _root = ReadWriteAttribute(jsObject: object, name: Strings.root) + _rootMargin = ReadWriteAttribute(jsObject: object, name: Strings.rootMargin) + _threshold = ReadWriteAttribute(jsObject: object, name: Strings.threshold) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var root: __UNSUPPORTED_UNION__? + + @ReadWriteAttribute + public var rootMargin: String + + @ReadWriteAttribute + public var threshold: __UNSUPPORTED_UNION__ +} diff --git a/Sources/DOMKit/WebIDL/InterventionReportBody.swift b/Sources/DOMKit/WebIDL/InterventionReportBody.swift new file mode 100644 index 00000000..f8a9f5b8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/InterventionReportBody.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class InterventionReportBody: ReportBody { + override public class var constructor: JSFunction { JSObject.global[Strings.InterventionReportBody].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) + _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) + _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) + super.init(unsafelyWrapping: jsObject) + } + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var message: String + + @ReadonlyAttribute + public var sourceFile: String? + + @ReadonlyAttribute + public var lineNumber: UInt32? + + @ReadonlyAttribute + public var columnNumber: UInt32? +} diff --git a/Sources/DOMKit/WebIDL/IntrinsicSizes.swift b/Sources/DOMKit/WebIDL/IntrinsicSizes.swift new file mode 100644 index 00000000..7de6b91f --- /dev/null +++ b/Sources/DOMKit/WebIDL/IntrinsicSizes.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IntrinsicSizes: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.IntrinsicSizes].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _minContentSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.minContentSize) + _maxContentSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxContentSize) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var minContentSize: Double + + @ReadonlyAttribute + public var maxContentSize: Double +} diff --git a/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift b/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift new file mode 100644 index 00000000..e76c005b --- /dev/null +++ b/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IntrinsicSizesResultOptions: BridgedDictionary { + public convenience init(maxContentSize: Double, minContentSize: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.maxContentSize] = maxContentSize.jsValue() + object[Strings.minContentSize] = minContentSize.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _maxContentSize = ReadWriteAttribute(jsObject: object, name: Strings.maxContentSize) + _minContentSize = ReadWriteAttribute(jsObject: object, name: Strings.minContentSize) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var maxContentSize: Double + + @ReadWriteAttribute + public var minContentSize: Double +} diff --git a/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift b/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift new file mode 100644 index 00000000..2e595936 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IsInputPendingOptions: BridgedDictionary { + public convenience init(includeContinuous: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.includeContinuous] = includeContinuous.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _includeContinuous = ReadWriteAttribute(jsObject: object, name: Strings.includeContinuous) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var includeContinuous: Bool +} diff --git a/Sources/DOMKit/WebIDL/IsVisibleOptions.swift b/Sources/DOMKit/WebIDL/IsVisibleOptions.swift new file mode 100644 index 00000000..2cf015a8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IsVisibleOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class IsVisibleOptions: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/ItemDetails.swift b/Sources/DOMKit/WebIDL/ItemDetails.swift new file mode 100644 index 00000000..d4fb2db8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ItemDetails.swift @@ -0,0 +1,70 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ItemDetails: BridgedDictionary { + public convenience init(itemId: String, title: String, price: PaymentCurrencyAmount, type: ItemType, description: String, iconURLs: [String], subscriptionPeriod: String, freeTrialPeriod: String, introductoryPrice: PaymentCurrencyAmount, introductoryPricePeriod: String, introductoryPriceCycles: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.itemId] = itemId.jsValue() + object[Strings.title] = title.jsValue() + object[Strings.price] = price.jsValue() + object[Strings.type] = type.jsValue() + object[Strings.description] = description.jsValue() + object[Strings.iconURLs] = iconURLs.jsValue() + object[Strings.subscriptionPeriod] = subscriptionPeriod.jsValue() + object[Strings.freeTrialPeriod] = freeTrialPeriod.jsValue() + object[Strings.introductoryPrice] = introductoryPrice.jsValue() + object[Strings.introductoryPricePeriod] = introductoryPricePeriod.jsValue() + object[Strings.introductoryPriceCycles] = introductoryPriceCycles.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _itemId = ReadWriteAttribute(jsObject: object, name: Strings.itemId) + _title = ReadWriteAttribute(jsObject: object, name: Strings.title) + _price = ReadWriteAttribute(jsObject: object, name: Strings.price) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _description = ReadWriteAttribute(jsObject: object, name: Strings.description) + _iconURLs = ReadWriteAttribute(jsObject: object, name: Strings.iconURLs) + _subscriptionPeriod = ReadWriteAttribute(jsObject: object, name: Strings.subscriptionPeriod) + _freeTrialPeriod = ReadWriteAttribute(jsObject: object, name: Strings.freeTrialPeriod) + _introductoryPrice = ReadWriteAttribute(jsObject: object, name: Strings.introductoryPrice) + _introductoryPricePeriod = ReadWriteAttribute(jsObject: object, name: Strings.introductoryPricePeriod) + _introductoryPriceCycles = ReadWriteAttribute(jsObject: object, name: Strings.introductoryPriceCycles) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var itemId: String + + @ReadWriteAttribute + public var title: String + + @ReadWriteAttribute + public var price: PaymentCurrencyAmount + + @ReadWriteAttribute + public var type: ItemType + + @ReadWriteAttribute + public var description: String + + @ReadWriteAttribute + public var iconURLs: [String] + + @ReadWriteAttribute + public var subscriptionPeriod: String + + @ReadWriteAttribute + public var freeTrialPeriod: String + + @ReadWriteAttribute + public var introductoryPrice: PaymentCurrencyAmount + + @ReadWriteAttribute + public var introductoryPricePeriod: String + + @ReadWriteAttribute + public var introductoryPriceCycles: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/ItemType.swift b/Sources/DOMKit/WebIDL/ItemType.swift new file mode 100644 index 00000000..3665558a --- /dev/null +++ b/Sources/DOMKit/WebIDL/ItemType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ItemType: JSString, JSValueCompatible { + case product = "product" + case subscription = "subscription" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift b/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift new file mode 100644 index 00000000..1c4210f2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum IterationCompositeOperation: JSString, JSValueCompatible { + case replace = "replace" + case accumulate = "accumulate" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/JsonWebKey.swift b/Sources/DOMKit/WebIDL/JsonWebKey.swift new file mode 100644 index 00000000..91348ba9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/JsonWebKey.swift @@ -0,0 +1,105 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class JsonWebKey: BridgedDictionary { + public convenience init(kty: String, use: String, key_ops: [String], alg: String, ext: Bool, crv: String, x: String, y: String, d: String, n: String, e: String, p: String, q: String, dp: String, dq: String, qi: String, oth: [RsaOtherPrimesInfo], k: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.kty] = kty.jsValue() + object[Strings.use] = use.jsValue() + object[Strings.key_ops] = key_ops.jsValue() + object[Strings.alg] = alg.jsValue() + object[Strings.ext] = ext.jsValue() + object[Strings.crv] = crv.jsValue() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.d] = d.jsValue() + object[Strings.n] = n.jsValue() + object[Strings.e] = e.jsValue() + object[Strings.p] = p.jsValue() + object[Strings.q] = q.jsValue() + object[Strings.dp] = dp.jsValue() + object[Strings.dq] = dq.jsValue() + object[Strings.qi] = qi.jsValue() + object[Strings.oth] = oth.jsValue() + object[Strings.k] = k.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _kty = ReadWriteAttribute(jsObject: object, name: Strings.kty) + _use = ReadWriteAttribute(jsObject: object, name: Strings.use) + _key_ops = ReadWriteAttribute(jsObject: object, name: Strings.key_ops) + _alg = ReadWriteAttribute(jsObject: object, name: Strings.alg) + _ext = ReadWriteAttribute(jsObject: object, name: Strings.ext) + _crv = ReadWriteAttribute(jsObject: object, name: Strings.crv) + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _d = ReadWriteAttribute(jsObject: object, name: Strings.d) + _n = ReadWriteAttribute(jsObject: object, name: Strings.n) + _e = ReadWriteAttribute(jsObject: object, name: Strings.e) + _p = ReadWriteAttribute(jsObject: object, name: Strings.p) + _q = ReadWriteAttribute(jsObject: object, name: Strings.q) + _dp = ReadWriteAttribute(jsObject: object, name: Strings.dp) + _dq = ReadWriteAttribute(jsObject: object, name: Strings.dq) + _qi = ReadWriteAttribute(jsObject: object, name: Strings.qi) + _oth = ReadWriteAttribute(jsObject: object, name: Strings.oth) + _k = ReadWriteAttribute(jsObject: object, name: Strings.k) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var kty: String + + @ReadWriteAttribute + public var use: String + + @ReadWriteAttribute + public var key_ops: [String] + + @ReadWriteAttribute + public var alg: String + + @ReadWriteAttribute + public var ext: Bool + + @ReadWriteAttribute + public var crv: String + + @ReadWriteAttribute + public var x: String + + @ReadWriteAttribute + public var y: String + + @ReadWriteAttribute + public var d: String + + @ReadWriteAttribute + public var n: String + + @ReadWriteAttribute + public var e: String + + @ReadWriteAttribute + public var p: String + + @ReadWriteAttribute + public var q: String + + @ReadWriteAttribute + public var dp: String + + @ReadWriteAttribute + public var dq: String + + @ReadWriteAttribute + public var qi: String + + @ReadWriteAttribute + public var oth: [RsaOtherPrimesInfo] + + @ReadWriteAttribute + public var k: String +} diff --git a/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift b/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift new file mode 100644 index 00000000..40108f07 --- /dev/null +++ b/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class KHR_parallel_shader_compile: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.KHR_parallel_shader_compile].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COMPLETION_STATUS_KHR: GLenum = 0x91B1 +} diff --git a/Sources/DOMKit/WebIDL/KeyAlgorithm.swift b/Sources/DOMKit/WebIDL/KeyAlgorithm.swift new file mode 100644 index 00000000..a3c3a16f --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyAlgorithm.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class KeyAlgorithm: BridgedDictionary { + public convenience init(name: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/KeyFormat.swift b/Sources/DOMKit/WebIDL/KeyFormat.swift new file mode 100644 index 00000000..697865c3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyFormat.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum KeyFormat: JSString, JSValueCompatible { + case raw = "raw" + case spki = "spki" + case pkcs8 = "pkcs8" + case jwk = "jwk" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift b/Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift new file mode 100644 index 00000000..b69f53f3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class KeySystemTrackConfiguration: BridgedDictionary { + public convenience init(robustness: String, encryptionScheme: String?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.robustness] = robustness.jsValue() + object[Strings.encryptionScheme] = encryptionScheme.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _robustness = ReadWriteAttribute(jsObject: object, name: Strings.robustness) + _encryptionScheme = ReadWriteAttribute(jsObject: object, name: Strings.encryptionScheme) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var robustness: String + + @ReadWriteAttribute + public var encryptionScheme: String? +} diff --git a/Sources/DOMKit/WebIDL/KeyType.swift b/Sources/DOMKit/WebIDL/KeyType.swift new file mode 100644 index 00000000..f74d75d0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum KeyType: JSString, JSValueCompatible { + case public = "public" + case private = "private" + case secret = "secret" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/KeyUsage.swift b/Sources/DOMKit/WebIDL/KeyUsage.swift new file mode 100644 index 00000000..bddff2e0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyUsage.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum KeyUsage: JSString, JSValueCompatible { + case encrypt = "encrypt" + case decrypt = "decrypt" + case sign = "sign" + case verify = "verify" + case deriveKey = "deriveKey" + case deriveBits = "deriveBits" + case wrapKey = "wrapKey" + case unwrapKey = "unwrapKey" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Keyboard.swift b/Sources/DOMKit/WebIDL/Keyboard.swift new file mode 100644 index 00000000..a8fd503e --- /dev/null +++ b/Sources/DOMKit/WebIDL/Keyboard.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Keyboard: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.Keyboard].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onlayoutchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onlayoutchange) + super.init(unsafelyWrapping: jsObject) + } + + public func lock(keyCodes: [String]? = nil) -> JSPromise { + jsObject[Strings.lock]!(keyCodes?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func lock(keyCodes: [String]? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.lock]!(keyCodes?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func unlock() { + _ = jsObject[Strings.unlock]!() + } + + public func getLayoutMap() -> JSPromise { + jsObject[Strings.getLayoutMap]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getLayoutMap() async throws -> KeyboardLayoutMap { + let _promise: JSPromise = jsObject[Strings.getLayoutMap]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onlayoutchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index 2096ceb6..09060553 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class KeyboardEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global.KeyboardEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.KeyboardEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) diff --git a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift index 2d1e3d25..afc8114b 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class KeyboardEventInit: BridgedDictionary { public convenience init(key: String, code: String, location: UInt32, repeat: Bool, isComposing: Bool, charCode: UInt32, keyCode: UInt32) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.key] = key.jsValue() object[Strings.code] = code.jsValue() object[Strings.location] = location.jsValue() diff --git a/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift b/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift new file mode 100644 index 00000000..dd935ea8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class KeyboardLayoutMap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.KeyboardLayoutMap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/KeyframeAnimationOptions.swift b/Sources/DOMKit/WebIDL/KeyframeAnimationOptions.swift new file mode 100644 index 00000000..342bef86 --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyframeAnimationOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class KeyframeAnimationOptions: BridgedDictionary { + public convenience init(id: String, timeline: AnimationTimeline?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.id] = id.jsValue() + object[Strings.timeline] = timeline.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _timeline = ReadWriteAttribute(jsObject: object, name: Strings.timeline) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var timeline: AnimationTimeline? +} diff --git a/Sources/DOMKit/WebIDL/KeyframeEffect.swift b/Sources/DOMKit/WebIDL/KeyframeEffect.swift new file mode 100644 index 00000000..79c3b807 --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyframeEffect.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class KeyframeEffect: AnimationEffect { + override public class var constructor: JSFunction { JSObject.global[Strings.KeyframeEffect].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _iterationComposite = ReadWriteAttribute(jsObject: jsObject, name: Strings.iterationComposite) + _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) + _pseudoElement = ReadWriteAttribute(jsObject: jsObject, name: Strings.pseudoElement) + _composite = ReadWriteAttribute(jsObject: jsObject, name: Strings.composite) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var iterationComposite: IterationCompositeOperation + + public convenience init(target: Element?, keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(target.jsValue(), keyframes.jsValue(), options?.jsValue() ?? .undefined)) + } + + public convenience init(source: KeyframeEffect) { + self.init(unsafelyWrapping: Self.constructor.new(source.jsValue())) + } + + @ReadWriteAttribute + public var target: Element? + + @ReadWriteAttribute + public var pseudoElement: String? + + @ReadWriteAttribute + public var composite: CompositeOperation + + public func getKeyframes() -> [JSObject] { + jsObject[Strings.getKeyframes]!().fromJSValue()! + } + + public func setKeyframes(keyframes: JSObject?) { + _ = jsObject[Strings.setKeyframes]!(keyframes.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift new file mode 100644 index 00000000..b0a790a7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class KeyframeEffectOptions: BridgedDictionary { + public convenience init(iterationComposite: IterationCompositeOperation, composite: CompositeOperation, pseudoElement: String?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.iterationComposite] = iterationComposite.jsValue() + object[Strings.composite] = composite.jsValue() + object[Strings.pseudoElement] = pseudoElement.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _iterationComposite = ReadWriteAttribute(jsObject: object, name: Strings.iterationComposite) + _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) + _pseudoElement = ReadWriteAttribute(jsObject: object, name: Strings.pseudoElement) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var iterationComposite: IterationCompositeOperation + + @ReadWriteAttribute + public var composite: CompositeOperation + + @ReadWriteAttribute + public var pseudoElement: String? +} diff --git a/Sources/DOMKit/WebIDL/Landmark.swift b/Sources/DOMKit/WebIDL/Landmark.swift new file mode 100644 index 00000000..7b3c4dbf --- /dev/null +++ b/Sources/DOMKit/WebIDL/Landmark.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Landmark: BridgedDictionary { + public convenience init(locations: [Point2D], type: LandmarkType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.locations] = locations.jsValue() + object[Strings.type] = type.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _locations = ReadWriteAttribute(jsObject: object, name: Strings.locations) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var locations: [Point2D] + + @ReadWriteAttribute + public var type: LandmarkType +} diff --git a/Sources/DOMKit/WebIDL/LandmarkType.swift b/Sources/DOMKit/WebIDL/LandmarkType.swift new file mode 100644 index 00000000..846d2987 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LandmarkType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum LandmarkType: JSString, JSValueCompatible { + case mouth = "mouth" + case eye = "eye" + case nose = "nose" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/LargeBlobSupport.swift b/Sources/DOMKit/WebIDL/LargeBlobSupport.swift new file mode 100644 index 00000000..bf017688 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LargeBlobSupport.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum LargeBlobSupport: JSString, JSValueCompatible { + case required = "required" + case preferred = "preferred" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift b/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift new file mode 100644 index 00000000..e7f88498 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LargestContentfulPaint: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.LargestContentfulPaint].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _renderTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderTime) + _loadTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadTime) + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _element = ReadonlyAttribute(jsObject: jsObject, name: Strings.element) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var renderTime: DOMHighResTimeStamp + + @ReadonlyAttribute + public var loadTime: DOMHighResTimeStamp + + @ReadonlyAttribute + public var size: UInt32 + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var element: Element? + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/LatencyMode.swift b/Sources/DOMKit/WebIDL/LatencyMode.swift new file mode 100644 index 00000000..16daa3bb --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/LayoutChild.swift b/Sources/DOMKit/WebIDL/LayoutChild.swift new file mode 100644 index 00000000..3e19e14f --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutChild.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LayoutChild: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.LayoutChild].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _styleMap = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleMap) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var styleMap: StylePropertyMapReadOnly + + public func intrinsicSizes() -> JSPromise { + jsObject[Strings.intrinsicSizes]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func intrinsicSizes() async throws -> IntrinsicSizes { + let _promise: JSPromise = jsObject[Strings.intrinsicSizes]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) -> JSPromise { + jsObject[Strings.layoutNextFragment]!(constraints.jsValue(), breakToken.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) async throws -> LayoutFragment { + let _promise: JSPromise = jsObject[Strings.layoutNextFragment]!(constraints.jsValue(), breakToken.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/LayoutConstraints.swift b/Sources/DOMKit/WebIDL/LayoutConstraints.swift new file mode 100644 index 00000000..92c289c6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutConstraints.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LayoutConstraints: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.LayoutConstraints].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _availableInlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.availableInlineSize) + _availableBlockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.availableBlockSize) + _fixedInlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.fixedInlineSize) + _fixedBlockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.fixedBlockSize) + _percentageInlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.percentageInlineSize) + _percentageBlockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.percentageBlockSize) + _blockFragmentationOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockFragmentationOffset) + _blockFragmentationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockFragmentationType) + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var availableInlineSize: Double + + @ReadonlyAttribute + public var availableBlockSize: Double + + @ReadonlyAttribute + public var fixedInlineSize: Double? + + @ReadonlyAttribute + public var fixedBlockSize: Double? + + @ReadonlyAttribute + public var percentageInlineSize: Double + + @ReadonlyAttribute + public var percentageBlockSize: Double + + @ReadonlyAttribute + public var blockFragmentationOffset: Double? + + @ReadonlyAttribute + public var blockFragmentationType: BlockFragmentationType + + @ReadonlyAttribute + public var data: JSValue +} diff --git a/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift b/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift new file mode 100644 index 00000000..83297aa2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LayoutConstraintsOptions: BridgedDictionary { + public convenience init(availableInlineSize: Double, availableBlockSize: Double, fixedInlineSize: Double, fixedBlockSize: Double, percentageInlineSize: Double, percentageBlockSize: Double, blockFragmentationOffset: Double, blockFragmentationType: BlockFragmentationType, data: JSValue) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.availableInlineSize] = availableInlineSize.jsValue() + object[Strings.availableBlockSize] = availableBlockSize.jsValue() + object[Strings.fixedInlineSize] = fixedInlineSize.jsValue() + object[Strings.fixedBlockSize] = fixedBlockSize.jsValue() + object[Strings.percentageInlineSize] = percentageInlineSize.jsValue() + object[Strings.percentageBlockSize] = percentageBlockSize.jsValue() + object[Strings.blockFragmentationOffset] = blockFragmentationOffset.jsValue() + object[Strings.blockFragmentationType] = blockFragmentationType.jsValue() + object[Strings.data] = data.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _availableInlineSize = ReadWriteAttribute(jsObject: object, name: Strings.availableInlineSize) + _availableBlockSize = ReadWriteAttribute(jsObject: object, name: Strings.availableBlockSize) + _fixedInlineSize = ReadWriteAttribute(jsObject: object, name: Strings.fixedInlineSize) + _fixedBlockSize = ReadWriteAttribute(jsObject: object, name: Strings.fixedBlockSize) + _percentageInlineSize = ReadWriteAttribute(jsObject: object, name: Strings.percentageInlineSize) + _percentageBlockSize = ReadWriteAttribute(jsObject: object, name: Strings.percentageBlockSize) + _blockFragmentationOffset = ReadWriteAttribute(jsObject: object, name: Strings.blockFragmentationOffset) + _blockFragmentationType = ReadWriteAttribute(jsObject: object, name: Strings.blockFragmentationType) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var availableInlineSize: Double + + @ReadWriteAttribute + public var availableBlockSize: Double + + @ReadWriteAttribute + public var fixedInlineSize: Double + + @ReadWriteAttribute + public var fixedBlockSize: Double + + @ReadWriteAttribute + public var percentageInlineSize: Double + + @ReadWriteAttribute + public var percentageBlockSize: Double + + @ReadWriteAttribute + public var blockFragmentationOffset: Double + + @ReadWriteAttribute + public var blockFragmentationType: BlockFragmentationType + + @ReadWriteAttribute + public var data: JSValue +} diff --git a/Sources/DOMKit/WebIDL/LayoutEdges.swift b/Sources/DOMKit/WebIDL/LayoutEdges.swift new file mode 100644 index 00000000..5339fe4b --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutEdges.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LayoutEdges: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.LayoutEdges].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _inlineStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineStart) + _inlineEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineEnd) + _blockStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockStart) + _blockEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockEnd) + _inline = ReadonlyAttribute(jsObject: jsObject, name: Strings.inline) + _block = ReadonlyAttribute(jsObject: jsObject, name: Strings.block) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var inlineStart: Double + + @ReadonlyAttribute + public var inlineEnd: Double + + @ReadonlyAttribute + public var blockStart: Double + + @ReadonlyAttribute + public var blockEnd: Double + + @ReadonlyAttribute + public var inline: Double + + @ReadonlyAttribute + public var block: Double +} diff --git a/Sources/DOMKit/WebIDL/LayoutFragment.swift b/Sources/DOMKit/WebIDL/LayoutFragment.swift new file mode 100644 index 00000000..4b92a6bc --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutFragment.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LayoutFragment: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.LayoutFragment].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _inlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineSize) + _blockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockSize) + _inlineOffset = ReadWriteAttribute(jsObject: jsObject, name: Strings.inlineOffset) + _blockOffset = ReadWriteAttribute(jsObject: jsObject, name: Strings.blockOffset) + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _breakToken = ReadonlyAttribute(jsObject: jsObject, name: Strings.breakToken) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var inlineSize: Double + + @ReadonlyAttribute + public var blockSize: Double + + @ReadWriteAttribute + public var inlineOffset: Double + + @ReadWriteAttribute + public var blockOffset: Double + + @ReadonlyAttribute + public var data: JSValue + + @ReadonlyAttribute + public var breakToken: ChildBreakToken? +} diff --git a/Sources/DOMKit/WebIDL/LayoutOptions.swift b/Sources/DOMKit/WebIDL/LayoutOptions.swift new file mode 100644 index 00000000..fcde2bde --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LayoutOptions: BridgedDictionary { + public convenience init(childDisplay: ChildDisplayType, sizing: LayoutSizingMode) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.childDisplay] = childDisplay.jsValue() + object[Strings.sizing] = sizing.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _childDisplay = ReadWriteAttribute(jsObject: object, name: Strings.childDisplay) + _sizing = ReadWriteAttribute(jsObject: object, name: Strings.sizing) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var childDisplay: ChildDisplayType + + @ReadWriteAttribute + public var sizing: LayoutSizingMode +} diff --git a/Sources/DOMKit/WebIDL/LayoutShift.swift b/Sources/DOMKit/WebIDL/LayoutShift.swift new file mode 100644 index 00000000..d03622fa --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutShift.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LayoutShift: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.LayoutShift].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + _hadRecentInput = ReadonlyAttribute(jsObject: jsObject, name: Strings.hadRecentInput) + _lastInputTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastInputTime) + _sources = ReadonlyAttribute(jsObject: jsObject, name: Strings.sources) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var value: Double + + @ReadonlyAttribute + public var hadRecentInput: Bool + + @ReadonlyAttribute + public var lastInputTime: DOMHighResTimeStamp + + @ReadonlyAttribute + public var sources: [LayoutShiftAttribution] + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift b/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift new file mode 100644 index 00000000..d3aa75fd --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LayoutShiftAttribution: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.LayoutShiftAttribution].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _node = ReadonlyAttribute(jsObject: jsObject, name: Strings.node) + _previousRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.previousRect) + _currentRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentRect) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var node: Node? + + @ReadonlyAttribute + public var previousRect: DOMRectReadOnly + + @ReadonlyAttribute + public var currentRect: DOMRectReadOnly +} diff --git a/Sources/DOMKit/WebIDL/LayoutSizingMode.swift b/Sources/DOMKit/WebIDL/LayoutSizingMode.swift new file mode 100644 index 00000000..2fd416da --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutSizingMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum LayoutSizingMode: JSString, JSValueCompatible { + case blockLike = "block-like" + case manual = "manual" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift new file mode 100644 index 00000000..7010e69d --- /dev/null +++ b/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LayoutWorkletGlobalScope: WorkletGlobalScope { + override public class var constructor: JSFunction { JSObject.global[Strings.LayoutWorkletGlobalScope].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func registerLayout(name: String, layoutCtor: VoidFunction) { + _ = jsObject[Strings.registerLayout]!(name.jsValue(), layoutCtor.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/LineAlignSetting.swift b/Sources/DOMKit/WebIDL/LineAlignSetting.swift new file mode 100644 index 00000000..4b1ed099 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LineAlignSetting.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum LineAlignSetting: JSString, JSValueCompatible { + case start = "start" + case center = "center" + case end = "end" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/LinearAccelerationReadingValues.swift b/Sources/DOMKit/WebIDL/LinearAccelerationReadingValues.swift new file mode 100644 index 00000000..af71982f --- /dev/null +++ b/Sources/DOMKit/WebIDL/LinearAccelerationReadingValues.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LinearAccelerationReadingValues: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift b/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift new file mode 100644 index 00000000..f6aebad2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LinearAccelerationSensor: Accelerometer { + override public class var constructor: JSFunction { JSObject.global[Strings.LinearAccelerationSensor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: AccelerometerSensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/Location.swift b/Sources/DOMKit/WebIDL/Location.swift index 5697cdb2..8a04552b 100644 --- a/Sources/DOMKit/WebIDL/Location.swift +++ b/Sources/DOMKit/WebIDL/Location.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Location: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.Location.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Location].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/Lock.swift b/Sources/DOMKit/WebIDL/Lock.swift new file mode 100644 index 00000000..d14ee62a --- /dev/null +++ b/Sources/DOMKit/WebIDL/Lock.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Lock: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Lock].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var mode: LockMode +} diff --git a/Sources/DOMKit/WebIDL/LockInfo.swift b/Sources/DOMKit/WebIDL/LockInfo.swift new file mode 100644 index 00000000..5108be0b --- /dev/null +++ b/Sources/DOMKit/WebIDL/LockInfo.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LockInfo: BridgedDictionary { + public convenience init(name: String, mode: LockMode, clientId: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.mode] = mode.jsValue() + object[Strings.clientId] = clientId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) + _clientId = ReadWriteAttribute(jsObject: object, name: Strings.clientId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var mode: LockMode + + @ReadWriteAttribute + public var clientId: String +} diff --git a/Sources/DOMKit/WebIDL/LockManager.swift b/Sources/DOMKit/WebIDL/LockManager.swift new file mode 100644 index 00000000..1dfa1c71 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LockManager.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LockManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.LockManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func request(name: String, callback: LockGrantedCallback) -> JSPromise { + jsObject[Strings.request]!(name.jsValue(), callback.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func request(name: String, callback: LockGrantedCallback) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.request]!(name.jsValue(), callback.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func request(name: String, options: LockOptions, callback: LockGrantedCallback) -> JSPromise { + jsObject[Strings.request]!(name.jsValue(), options.jsValue(), callback.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func request(name: String, options: LockOptions, callback: LockGrantedCallback) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.request]!(name.jsValue(), options.jsValue(), callback.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func query() -> JSPromise { + jsObject[Strings.query]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func query() async throws -> LockManagerSnapshot { + let _promise: JSPromise = jsObject[Strings.query]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift b/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift new file mode 100644 index 00000000..e89f71e5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LockManagerSnapshot: BridgedDictionary { + public convenience init(held: [LockInfo], pending: [LockInfo]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.held] = held.jsValue() + object[Strings.pending] = pending.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _held = ReadWriteAttribute(jsObject: object, name: Strings.held) + _pending = ReadWriteAttribute(jsObject: object, name: Strings.pending) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var held: [LockInfo] + + @ReadWriteAttribute + public var pending: [LockInfo] +} diff --git a/Sources/DOMKit/WebIDL/LockMode.swift b/Sources/DOMKit/WebIDL/LockMode.swift new file mode 100644 index 00000000..5a0624dc --- /dev/null +++ b/Sources/DOMKit/WebIDL/LockMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum LockMode: JSString, JSValueCompatible { + case shared = "shared" + case exclusive = "exclusive" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/LockOptions.swift b/Sources/DOMKit/WebIDL/LockOptions.swift new file mode 100644 index 00000000..d1612df4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/LockOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class LockOptions: BridgedDictionary { + public convenience init(mode: LockMode, ifAvailable: Bool, steal: Bool, signal: AbortSignal) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mode] = mode.jsValue() + object[Strings.ifAvailable] = ifAvailable.jsValue() + object[Strings.steal] = steal.jsValue() + object[Strings.signal] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) + _ifAvailable = ReadWriteAttribute(jsObject: object, name: Strings.ifAvailable) + _steal = ReadWriteAttribute(jsObject: object, name: Strings.steal) + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mode: LockMode + + @ReadWriteAttribute + public var ifAvailable: Bool + + @ReadWriteAttribute + public var steal: Bool + + @ReadWriteAttribute + public var signal: AbortSignal +} diff --git a/Sources/DOMKit/WebIDL/MIDIAccess.swift b/Sources/DOMKit/WebIDL/MIDIAccess.swift new file mode 100644 index 00000000..e186254d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIAccess.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIAccess: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.MIDIAccess].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _inputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputs) + _outputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.outputs) + _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + _sysexEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.sysexEnabled) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var inputs: MIDIInputMap + + @ReadonlyAttribute + public var outputs: MIDIOutputMap + + @ClosureAttribute.Optional1 + public var onstatechange: EventHandler + + @ReadonlyAttribute + public var sysexEnabled: Bool +} diff --git a/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift b/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift new file mode 100644 index 00000000..19a1b036 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIConnectionEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.MIDIConnectionEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: MIDIConnectionEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var port: MIDIPort +} diff --git a/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift b/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift new file mode 100644 index 00000000..ae3775b9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIConnectionEventInit: BridgedDictionary { + public convenience init(port: MIDIPort) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.port] = port.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _port = ReadWriteAttribute(jsObject: object, name: Strings.port) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var port: MIDIPort +} diff --git a/Sources/DOMKit/WebIDL/MIDIInput.swift b/Sources/DOMKit/WebIDL/MIDIInput.swift new file mode 100644 index 00000000..82db715f --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIInput.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIInput: MIDIPort { + override public class var constructor: JSFunction { JSObject.global[Strings.MIDIInput].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onmidimessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmidimessage) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var onmidimessage: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/MIDIInputMap.swift b/Sources/DOMKit/WebIDL/MIDIInputMap.swift new file mode 100644 index 00000000..cd64b65e --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIInputMap.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIInputMap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MIDIInputMap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift b/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift new file mode 100644 index 00000000..7ce4588f --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIMessageEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.MIDIMessageEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: MIDIMessageEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var data: Uint8Array +} diff --git a/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift b/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift new file mode 100644 index 00000000..5569e95e --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIMessageEventInit: BridgedDictionary { + public convenience init(data: Uint8Array) { + 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: Uint8Array +} diff --git a/Sources/DOMKit/WebIDL/MIDIOptions.swift b/Sources/DOMKit/WebIDL/MIDIOptions.swift new file mode 100644 index 00000000..62d317c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIOptions: BridgedDictionary { + public convenience init(sysex: Bool, software: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.sysex] = sysex.jsValue() + object[Strings.software] = software.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _sysex = ReadWriteAttribute(jsObject: object, name: Strings.sysex) + _software = ReadWriteAttribute(jsObject: object, name: Strings.software) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var sysex: Bool + + @ReadWriteAttribute + public var software: Bool +} diff --git a/Sources/DOMKit/WebIDL/MIDIOutput.swift b/Sources/DOMKit/WebIDL/MIDIOutput.swift new file mode 100644 index 00000000..cbce4a1d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIOutput.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIOutput: MIDIPort { + override public class var constructor: JSFunction { JSObject.global[Strings.MIDIOutput].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func send(data: [UInt8], timestamp: DOMHighResTimeStamp? = nil) { + _ = jsObject[Strings.send]!(data.jsValue(), timestamp?.jsValue() ?? .undefined) + } + + public func clear() { + _ = jsObject[Strings.clear]!() + } +} diff --git a/Sources/DOMKit/WebIDL/MIDIOutputMap.swift b/Sources/DOMKit/WebIDL/MIDIOutputMap.swift new file mode 100644 index 00000000..20c52336 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIOutputMap.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIOutputMap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MIDIOutputMap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/MIDIPort.swift b/Sources/DOMKit/WebIDL/MIDIPort.swift new file mode 100644 index 00000000..60603575 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIPort.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MIDIPort: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.MIDIPort].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _manufacturer = ReadonlyAttribute(jsObject: jsObject, name: Strings.manufacturer) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _version = ReadonlyAttribute(jsObject: jsObject, name: Strings.version) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _connection = ReadonlyAttribute(jsObject: jsObject, name: Strings.connection) + _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var manufacturer: String? + + @ReadonlyAttribute + public var name: String? + + @ReadonlyAttribute + public var type: MIDIPortType + + @ReadonlyAttribute + public var version: String? + + @ReadonlyAttribute + public var state: MIDIPortDeviceState + + @ReadonlyAttribute + public var connection: MIDIPortConnectionState + + @ClosureAttribute.Optional1 + public var onstatechange: EventHandler + + public func open() -> JSPromise { + jsObject[Strings.open]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func open() async throws -> MIDIPort { + let _promise: JSPromise = jsObject[Strings.open]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func close() -> JSPromise { + jsObject[Strings.close]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func close() async throws -> MIDIPort { + let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift b/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift new file mode 100644 index 00000000..d8b8ea0d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MIDIPortConnectionState: JSString, JSValueCompatible { + case open = "open" + case closed = "closed" + case pending = "pending" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift b/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift new file mode 100644 index 00000000..154e8b11 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MIDIPortDeviceState: JSString, JSValueCompatible { + case disconnected = "disconnected" + case connected = "connected" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MIDIPortType.swift b/Sources/DOMKit/WebIDL/MIDIPortType.swift new file mode 100644 index 00000000..a6e732ef --- /dev/null +++ b/Sources/DOMKit/WebIDL/MIDIPortType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MIDIPortType: JSString, JSValueCompatible { + case input = "input" + case output = "output" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ML.swift b/Sources/DOMKit/WebIDL/ML.swift new file mode 100644 index 00000000..5780affb --- /dev/null +++ b/Sources/DOMKit/WebIDL/ML.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ML: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ML].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func createContext(options: MLContextOptions? = nil) -> MLContext { + jsObject[Strings.createContext]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createContext(glContext: WebGLRenderingContext) -> MLContext { + jsObject[Strings.createContext]!(glContext.jsValue()).fromJSValue()! + } + + public func createContext(gpuDevice: GPUDevice) -> MLContext { + jsObject[Strings.createContext]!(gpuDevice.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MLAutoPad.swift b/Sources/DOMKit/WebIDL/MLAutoPad.swift new file mode 100644 index 00000000..1cb9b52e --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLAutoPad.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLAutoPad: JSString, JSValueCompatible { + case explicit = "explicit" + case sameUpper = "same-upper" + case sameLower = "same-lower" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift b/Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift new file mode 100644 index 00000000..0c561831 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLBatchNormalizationOptions: BridgedDictionary { + public convenience init(scale: MLOperand, bias: MLOperand, axis: Int32, epsilon: Float, activation: MLOperator) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.scale] = scale.jsValue() + object[Strings.bias] = bias.jsValue() + object[Strings.axis] = axis.jsValue() + object[Strings.epsilon] = epsilon.jsValue() + object[Strings.activation] = activation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _scale = ReadWriteAttribute(jsObject: object, name: Strings.scale) + _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) + _axis = ReadWriteAttribute(jsObject: object, name: Strings.axis) + _epsilon = ReadWriteAttribute(jsObject: object, name: Strings.epsilon) + _activation = ReadWriteAttribute(jsObject: object, name: Strings.activation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var scale: MLOperand + + @ReadWriteAttribute + public var bias: MLOperand + + @ReadWriteAttribute + public var axis: Int32 + + @ReadWriteAttribute + public var epsilon: Float + + @ReadWriteAttribute + public var activation: MLOperator +} diff --git a/Sources/DOMKit/WebIDL/MLBufferResourceView.swift b/Sources/DOMKit/WebIDL/MLBufferResourceView.swift new file mode 100644 index 00000000..ab78380f --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLBufferResourceView.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLBufferResourceView: BridgedDictionary { + public convenience init(resource: __UNSUPPORTED_UNION__, offset: UInt64, size: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.resource] = resource.jsValue() + object[Strings.offset] = offset.jsValue() + object[Strings.size] = size.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _resource = ReadWriteAttribute(jsObject: object, name: Strings.resource) + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + _size = ReadWriteAttribute(jsObject: object, name: Strings.size) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var resource: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var offset: UInt64 + + @ReadWriteAttribute + public var size: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/MLClampOptions.swift b/Sources/DOMKit/WebIDL/MLClampOptions.swift new file mode 100644 index 00000000..9c9ead0e --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLClampOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLClampOptions: BridgedDictionary { + public convenience init(minValue: Float, maxValue: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.minValue] = minValue.jsValue() + object[Strings.maxValue] = maxValue.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _minValue = ReadWriteAttribute(jsObject: object, name: Strings.minValue) + _maxValue = ReadWriteAttribute(jsObject: object, name: Strings.maxValue) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var minValue: Float + + @ReadWriteAttribute + public var maxValue: Float +} diff --git a/Sources/DOMKit/WebIDL/MLContext.swift b/Sources/DOMKit/WebIDL/MLContext.swift new file mode 100644 index 00000000..74e668db --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLContext.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLContext: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MLContext].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/MLContextOptions.swift b/Sources/DOMKit/WebIDL/MLContextOptions.swift new file mode 100644 index 00000000..f3261fef --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLContextOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLContextOptions: BridgedDictionary { + public convenience init(devicePreference: MLDevicePreference, powerPreference: MLPowerPreference) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.devicePreference] = devicePreference.jsValue() + object[Strings.powerPreference] = powerPreference.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _devicePreference = ReadWriteAttribute(jsObject: object, name: Strings.devicePreference) + _powerPreference = ReadWriteAttribute(jsObject: object, name: Strings.powerPreference) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var devicePreference: MLDevicePreference + + @ReadWriteAttribute + public var powerPreference: MLPowerPreference +} diff --git a/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift b/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift new file mode 100644 index 00000000..795dd9cd --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLConv2dFilterOperandLayout: JSString, JSValueCompatible { + case oihw = "oihw" + case hwio = "hwio" + case ohwi = "ohwi" + case ihwo = "ihwo" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLConv2dOptions.swift b/Sources/DOMKit/WebIDL/MLConv2dOptions.swift new file mode 100644 index 00000000..ab4a4322 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLConv2dOptions.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLConv2dOptions: BridgedDictionary { + public convenience init(padding: [Int32], strides: [Int32], dilations: [Int32], autoPad: MLAutoPad, groups: Int32, inputLayout: MLInputOperandLayout, filterLayout: MLConv2dFilterOperandLayout, bias: MLOperand, activation: MLOperator) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.padding] = padding.jsValue() + object[Strings.strides] = strides.jsValue() + object[Strings.dilations] = dilations.jsValue() + object[Strings.autoPad] = autoPad.jsValue() + object[Strings.groups] = groups.jsValue() + object[Strings.inputLayout] = inputLayout.jsValue() + object[Strings.filterLayout] = filterLayout.jsValue() + object[Strings.bias] = bias.jsValue() + object[Strings.activation] = activation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _padding = ReadWriteAttribute(jsObject: object, name: Strings.padding) + _strides = ReadWriteAttribute(jsObject: object, name: Strings.strides) + _dilations = ReadWriteAttribute(jsObject: object, name: Strings.dilations) + _autoPad = ReadWriteAttribute(jsObject: object, name: Strings.autoPad) + _groups = ReadWriteAttribute(jsObject: object, name: Strings.groups) + _inputLayout = ReadWriteAttribute(jsObject: object, name: Strings.inputLayout) + _filterLayout = ReadWriteAttribute(jsObject: object, name: Strings.filterLayout) + _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) + _activation = ReadWriteAttribute(jsObject: object, name: Strings.activation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var padding: [Int32] + + @ReadWriteAttribute + public var strides: [Int32] + + @ReadWriteAttribute + public var dilations: [Int32] + + @ReadWriteAttribute + public var autoPad: MLAutoPad + + @ReadWriteAttribute + public var groups: Int32 + + @ReadWriteAttribute + public var inputLayout: MLInputOperandLayout + + @ReadWriteAttribute + public var filterLayout: MLConv2dFilterOperandLayout + + @ReadWriteAttribute + public var bias: MLOperand + + @ReadWriteAttribute + public var activation: MLOperator +} diff --git a/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift b/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift new file mode 100644 index 00000000..7d3cb04d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLConvTranspose2dFilterOperandLayout: JSString, JSValueCompatible { + case iohw = "iohw" + case hwoi = "hwoi" + case ohwi = "ohwi" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift b/Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift new file mode 100644 index 00000000..4e7652be --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift @@ -0,0 +1,70 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLConvTranspose2dOptions: BridgedDictionary { + public convenience init(padding: [Int32], strides: [Int32], dilations: [Int32], outputPadding: [Int32], outputSizes: [Int32], autoPad: MLAutoPad, groups: Int32, inputLayout: MLInputOperandLayout, filterLayout: MLConvTranspose2dFilterOperandLayout, bias: MLOperand, activation: MLOperator) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.padding] = padding.jsValue() + object[Strings.strides] = strides.jsValue() + object[Strings.dilations] = dilations.jsValue() + object[Strings.outputPadding] = outputPadding.jsValue() + object[Strings.outputSizes] = outputSizes.jsValue() + object[Strings.autoPad] = autoPad.jsValue() + object[Strings.groups] = groups.jsValue() + object[Strings.inputLayout] = inputLayout.jsValue() + object[Strings.filterLayout] = filterLayout.jsValue() + object[Strings.bias] = bias.jsValue() + object[Strings.activation] = activation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _padding = ReadWriteAttribute(jsObject: object, name: Strings.padding) + _strides = ReadWriteAttribute(jsObject: object, name: Strings.strides) + _dilations = ReadWriteAttribute(jsObject: object, name: Strings.dilations) + _outputPadding = ReadWriteAttribute(jsObject: object, name: Strings.outputPadding) + _outputSizes = ReadWriteAttribute(jsObject: object, name: Strings.outputSizes) + _autoPad = ReadWriteAttribute(jsObject: object, name: Strings.autoPad) + _groups = ReadWriteAttribute(jsObject: object, name: Strings.groups) + _inputLayout = ReadWriteAttribute(jsObject: object, name: Strings.inputLayout) + _filterLayout = ReadWriteAttribute(jsObject: object, name: Strings.filterLayout) + _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) + _activation = ReadWriteAttribute(jsObject: object, name: Strings.activation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var padding: [Int32] + + @ReadWriteAttribute + public var strides: [Int32] + + @ReadWriteAttribute + public var dilations: [Int32] + + @ReadWriteAttribute + public var outputPadding: [Int32] + + @ReadWriteAttribute + public var outputSizes: [Int32] + + @ReadWriteAttribute + public var autoPad: MLAutoPad + + @ReadWriteAttribute + public var groups: Int32 + + @ReadWriteAttribute + public var inputLayout: MLInputOperandLayout + + @ReadWriteAttribute + public var filterLayout: MLConvTranspose2dFilterOperandLayout + + @ReadWriteAttribute + public var bias: MLOperand + + @ReadWriteAttribute + public var activation: MLOperator +} diff --git a/Sources/DOMKit/WebIDL/MLDevicePreference.swift b/Sources/DOMKit/WebIDL/MLDevicePreference.swift new file mode 100644 index 00000000..91d4d22f --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLDevicePreference.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLDevicePreference: JSString, JSValueCompatible { + case `default` = "default" + case gpu = "gpu" + case cpu = "cpu" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLEluOptions.swift b/Sources/DOMKit/WebIDL/MLEluOptions.swift new file mode 100644 index 00000000..41b8a4a9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLEluOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLEluOptions: BridgedDictionary { + public convenience init(alpha: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.alpha] = alpha.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var alpha: Float +} diff --git a/Sources/DOMKit/WebIDL/MLGemmOptions.swift b/Sources/DOMKit/WebIDL/MLGemmOptions.swift new file mode 100644 index 00000000..5166b974 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLGemmOptions.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLGemmOptions: BridgedDictionary { + public convenience init(c: MLOperand, alpha: Float, beta: Float, aTranspose: Bool, bTranspose: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.c] = c.jsValue() + object[Strings.alpha] = alpha.jsValue() + object[Strings.beta] = beta.jsValue() + object[Strings.aTranspose] = aTranspose.jsValue() + object[Strings.bTranspose] = bTranspose.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _c = ReadWriteAttribute(jsObject: object, name: Strings.c) + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) + _aTranspose = ReadWriteAttribute(jsObject: object, name: Strings.aTranspose) + _bTranspose = ReadWriteAttribute(jsObject: object, name: Strings.bTranspose) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var c: MLOperand + + @ReadWriteAttribute + public var alpha: Float + + @ReadWriteAttribute + public var beta: Float + + @ReadWriteAttribute + public var aTranspose: Bool + + @ReadWriteAttribute + public var bTranspose: Bool +} diff --git a/Sources/DOMKit/WebIDL/MLGraph.swift b/Sources/DOMKit/WebIDL/MLGraph.swift new file mode 100644 index 00000000..72f1f378 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLGraph.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLGraph: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MLGraph].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func compute(inputs: MLNamedInputs, outputs: MLNamedOutputs) { + _ = jsObject[Strings.compute]!(inputs.jsValue(), outputs.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift new file mode 100644 index 00000000..399428a3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift @@ -0,0 +1,318 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLGraphBuilder: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MLGraphBuilder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(context: MLContext) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue())) + } + + public func input(name: String, desc: MLOperandDescriptor) -> MLOperand { + jsObject[Strings.input]!(name.jsValue(), desc.jsValue()).fromJSValue()! + } + + public func constant(desc: MLOperandDescriptor, bufferView: MLBufferView) -> MLOperand { + jsObject[Strings.constant]!(desc.jsValue(), bufferView.jsValue()).fromJSValue()! + } + + public func constant(value: Double, type: MLOperandType? = nil) -> MLOperand { + jsObject[Strings.constant]!(value.jsValue(), type?.jsValue() ?? .undefined).fromJSValue()! + } + + public func build(outputs: MLNamedOperands) -> MLGraph { + jsObject[Strings.build]!(outputs.jsValue()).fromJSValue()! + } + + public func batchNormalization(input: MLOperand, mean: MLOperand, variance: MLOperand, options: MLBatchNormalizationOptions? = nil) -> MLOperand { + jsObject[Strings.batchNormalization]!(input.jsValue(), mean.jsValue(), variance.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func clamp(x: MLOperand, options: MLClampOptions? = nil) -> MLOperand { + jsObject[Strings.clamp]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func clamp(options: MLClampOptions? = nil) -> MLOperator { + jsObject[Strings.clamp]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func concat(inputs: [MLOperand], axis: Int32) -> MLOperand { + jsObject[Strings.concat]!(inputs.jsValue(), axis.jsValue()).fromJSValue()! + } + + public func conv2d(input: MLOperand, filter: MLOperand, options: MLConv2dOptions? = nil) -> MLOperand { + jsObject[Strings.conv2d]!(input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func convTranspose2d(input: MLOperand, filter: MLOperand, options: MLConvTranspose2dOptions? = nil) -> MLOperand { + jsObject[Strings.convTranspose2d]!(input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func add(a: MLOperand, b: MLOperand) -> MLOperand { + jsObject[Strings.add]!(a.jsValue(), b.jsValue()).fromJSValue()! + } + + public func sub(a: MLOperand, b: MLOperand) -> MLOperand { + jsObject[Strings.sub]!(a.jsValue(), b.jsValue()).fromJSValue()! + } + + public func mul(a: MLOperand, b: MLOperand) -> MLOperand { + jsObject[Strings.mul]!(a.jsValue(), b.jsValue()).fromJSValue()! + } + + public func div(a: MLOperand, b: MLOperand) -> MLOperand { + jsObject[Strings.div]!(a.jsValue(), b.jsValue()).fromJSValue()! + } + + public func max(a: MLOperand, b: MLOperand) -> MLOperand { + jsObject[Strings.max]!(a.jsValue(), b.jsValue()).fromJSValue()! + } + + public func min(a: MLOperand, b: MLOperand) -> MLOperand { + jsObject[Strings.min]!(a.jsValue(), b.jsValue()).fromJSValue()! + } + + public func pow(a: MLOperand, b: MLOperand) -> MLOperand { + jsObject[Strings.pow]!(a.jsValue(), b.jsValue()).fromJSValue()! + } + + public func abs(x: MLOperand) -> MLOperand { + jsObject[Strings.abs]!(x.jsValue()).fromJSValue()! + } + + public func ceil(x: MLOperand) -> MLOperand { + jsObject[Strings.ceil]!(x.jsValue()).fromJSValue()! + } + + public func cos(x: MLOperand) -> MLOperand { + jsObject[Strings.cos]!(x.jsValue()).fromJSValue()! + } + + public func exp(x: MLOperand) -> MLOperand { + jsObject[Strings.exp]!(x.jsValue()).fromJSValue()! + } + + public func floor(x: MLOperand) -> MLOperand { + jsObject[Strings.floor]!(x.jsValue()).fromJSValue()! + } + + public func log(x: MLOperand) -> MLOperand { + jsObject[Strings.log]!(x.jsValue()).fromJSValue()! + } + + public func neg(x: MLOperand) -> MLOperand { + jsObject[Strings.neg]!(x.jsValue()).fromJSValue()! + } + + public func sin(x: MLOperand) -> MLOperand { + jsObject[Strings.sin]!(x.jsValue()).fromJSValue()! + } + + public func tan(x: MLOperand) -> MLOperand { + jsObject[Strings.tan]!(x.jsValue()).fromJSValue()! + } + + public func elu(x: MLOperand, options: MLEluOptions? = nil) -> MLOperand { + jsObject[Strings.elu]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func elu(options: MLEluOptions? = nil) -> MLOperator { + jsObject[Strings.elu]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func gemm(a: MLOperand, b: MLOperand, options: MLGemmOptions? = nil) -> MLOperand { + jsObject[Strings.gemm]!(a.jsValue(), b.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func gru(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, steps: Int32, hiddenSize: Int32, options: MLGruOptions? = nil) -> [MLOperand] { + let _arg0 = input.jsValue() + let _arg1 = weight.jsValue() + let _arg2 = recurrentWeight.jsValue() + let _arg3 = steps.jsValue() + let _arg4 = hiddenSize.jsValue() + let _arg5 = options?.jsValue() ?? .undefined + return jsObject[Strings.gru]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + } + + public func gruCell(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, hiddenState: MLOperand, hiddenSize: Int32, options: MLGruCellOptions? = nil) -> MLOperand { + let _arg0 = input.jsValue() + let _arg1 = weight.jsValue() + let _arg2 = recurrentWeight.jsValue() + let _arg3 = hiddenState.jsValue() + let _arg4 = hiddenSize.jsValue() + let _arg5 = options?.jsValue() ?? .undefined + return jsObject[Strings.gruCell]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + } + + public func hardSigmoid(x: MLOperand, options: MLHardSigmoidOptions? = nil) -> MLOperand { + jsObject[Strings.hardSigmoid]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func hardSigmoid(options: MLHardSigmoidOptions? = nil) -> MLOperator { + jsObject[Strings.hardSigmoid]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func hardSwish(x: MLOperand) -> MLOperand { + jsObject[Strings.hardSwish]!(x.jsValue()).fromJSValue()! + } + + public func hardSwish() -> MLOperator { + jsObject[Strings.hardSwish]!().fromJSValue()! + } + + public func instanceNormalization(input: MLOperand, options: MLInstanceNormalizationOptions? = nil) -> MLOperand { + jsObject[Strings.instanceNormalization]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func leakyRelu(x: MLOperand, options: MLLeakyReluOptions? = nil) -> MLOperand { + jsObject[Strings.leakyRelu]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func leakyRelu(options: MLLeakyReluOptions? = nil) -> MLOperator { + jsObject[Strings.leakyRelu]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func matmul(a: MLOperand, b: MLOperand) -> MLOperand { + jsObject[Strings.matmul]!(a.jsValue(), b.jsValue()).fromJSValue()! + } + + public func linear(x: MLOperand, options: MLLinearOptions? = nil) -> MLOperand { + jsObject[Strings.linear]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func linear(options: MLLinearOptions? = nil) -> MLOperator { + jsObject[Strings.linear]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func pad(input: MLOperand, padding: MLOperand, options: MLPadOptions? = nil) -> MLOperand { + jsObject[Strings.pad]!(input.jsValue(), padding.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func averagePool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { + jsObject[Strings.averagePool2d]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func l2Pool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { + jsObject[Strings.l2Pool2d]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func maxPool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { + jsObject[Strings.maxPool2d]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceL1(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceL1]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceL2(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceL2]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceLogSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceLogSum]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceLogSumExp(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceLogSumExp]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceMax(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceMax]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceMean(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceMean]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceMin(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceMin]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceProduct(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceProduct]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceSum]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reduceSumSquare(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + jsObject[Strings.reduceSumSquare]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func relu(x: MLOperand) -> MLOperand { + jsObject[Strings.relu]!(x.jsValue()).fromJSValue()! + } + + public func relu() -> MLOperator { + jsObject[Strings.relu]!().fromJSValue()! + } + + public func resample2d(input: MLOperand, options: MLResample2dOptions? = nil) -> MLOperand { + jsObject[Strings.resample2d]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reshape(input: MLOperand, newShape: [Int32]) -> MLOperand { + jsObject[Strings.reshape]!(input.jsValue(), newShape.jsValue()).fromJSValue()! + } + + public func sigmoid(x: MLOperand) -> MLOperand { + jsObject[Strings.sigmoid]!(x.jsValue()).fromJSValue()! + } + + public func sigmoid() -> MLOperator { + jsObject[Strings.sigmoid]!().fromJSValue()! + } + + public func slice(input: MLOperand, starts: [Int32], sizes: [Int32], options: MLSliceOptions? = nil) -> MLOperand { + jsObject[Strings.slice]!(input.jsValue(), starts.jsValue(), sizes.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func softmax(x: MLOperand) -> MLOperand { + jsObject[Strings.softmax]!(x.jsValue()).fromJSValue()! + } + + public func softplus(x: MLOperand, options: MLSoftplusOptions? = nil) -> MLOperand { + jsObject[Strings.softplus]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func softplus(options: MLSoftplusOptions? = nil) -> MLOperator { + jsObject[Strings.softplus]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func softsign(x: MLOperand) -> MLOperand { + jsObject[Strings.softsign]!(x.jsValue()).fromJSValue()! + } + + public func softsign() -> MLOperator { + jsObject[Strings.softsign]!().fromJSValue()! + } + + public func split(input: MLOperand, splits: __UNSUPPORTED_UNION__, options: MLSplitOptions? = nil) -> [MLOperand] { + jsObject[Strings.split]!(input.jsValue(), splits.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func squeeze(input: MLOperand, options: MLSqueezeOptions? = nil) -> MLOperand { + jsObject[Strings.squeeze]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func tanh(x: MLOperand) -> MLOperand { + jsObject[Strings.tanh]!(x.jsValue()).fromJSValue()! + } + + public func tanh() -> MLOperator { + jsObject[Strings.tanh]!().fromJSValue()! + } + + public func transpose(input: MLOperand, options: MLTransposeOptions? = nil) -> MLOperand { + jsObject[Strings.transpose]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MLGruCellOptions.swift b/Sources/DOMKit/WebIDL/MLGruCellOptions.swift new file mode 100644 index 00000000..e3d86071 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLGruCellOptions.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLGruCellOptions: BridgedDictionary { + public convenience init(bias: MLOperand, recurrentBias: MLOperand, resetAfter: Bool, layout: MLRecurrentNetworkWeightLayout, activations: [MLOperator]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.bias] = bias.jsValue() + object[Strings.recurrentBias] = recurrentBias.jsValue() + object[Strings.resetAfter] = resetAfter.jsValue() + object[Strings.layout] = layout.jsValue() + object[Strings.activations] = activations.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) + _recurrentBias = ReadWriteAttribute(jsObject: object, name: Strings.recurrentBias) + _resetAfter = ReadWriteAttribute(jsObject: object, name: Strings.resetAfter) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + _activations = ReadWriteAttribute(jsObject: object, name: Strings.activations) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var bias: MLOperand + + @ReadWriteAttribute + public var recurrentBias: MLOperand + + @ReadWriteAttribute + public var resetAfter: Bool + + @ReadWriteAttribute + public var layout: MLRecurrentNetworkWeightLayout + + @ReadWriteAttribute + public var activations: [MLOperator] +} diff --git a/Sources/DOMKit/WebIDL/MLGruOptions.swift b/Sources/DOMKit/WebIDL/MLGruOptions.swift new file mode 100644 index 00000000..95894fc1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLGruOptions.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLGruOptions: BridgedDictionary { + public convenience init(bias: MLOperand, recurrentBias: MLOperand, initialHiddenState: MLOperand, resetAfter: Bool, returnSequence: Bool, direction: MLRecurrentNetworkDirection, layout: MLRecurrentNetworkWeightLayout, activations: [MLOperator]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.bias] = bias.jsValue() + object[Strings.recurrentBias] = recurrentBias.jsValue() + object[Strings.initialHiddenState] = initialHiddenState.jsValue() + object[Strings.resetAfter] = resetAfter.jsValue() + object[Strings.returnSequence] = returnSequence.jsValue() + object[Strings.direction] = direction.jsValue() + object[Strings.layout] = layout.jsValue() + object[Strings.activations] = activations.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) + _recurrentBias = ReadWriteAttribute(jsObject: object, name: Strings.recurrentBias) + _initialHiddenState = ReadWriteAttribute(jsObject: object, name: Strings.initialHiddenState) + _resetAfter = ReadWriteAttribute(jsObject: object, name: Strings.resetAfter) + _returnSequence = ReadWriteAttribute(jsObject: object, name: Strings.returnSequence) + _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + _activations = ReadWriteAttribute(jsObject: object, name: Strings.activations) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var bias: MLOperand + + @ReadWriteAttribute + public var recurrentBias: MLOperand + + @ReadWriteAttribute + public var initialHiddenState: MLOperand + + @ReadWriteAttribute + public var resetAfter: Bool + + @ReadWriteAttribute + public var returnSequence: Bool + + @ReadWriteAttribute + public var direction: MLRecurrentNetworkDirection + + @ReadWriteAttribute + public var layout: MLRecurrentNetworkWeightLayout + + @ReadWriteAttribute + public var activations: [MLOperator] +} diff --git a/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift b/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift new file mode 100644 index 00000000..c97adc5a --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLHardSigmoidOptions: BridgedDictionary { + public convenience init(alpha: Float, beta: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.alpha] = alpha.jsValue() + object[Strings.beta] = beta.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var alpha: Float + + @ReadWriteAttribute + public var beta: Float +} diff --git a/Sources/DOMKit/WebIDL/MLInput.swift b/Sources/DOMKit/WebIDL/MLInput.swift new file mode 100644 index 00000000..2476bf82 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLInput.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLInput: BridgedDictionary { + public convenience init(resource: MLResource, dimensions: [Int32]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.resource] = resource.jsValue() + object[Strings.dimensions] = dimensions.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _resource = ReadWriteAttribute(jsObject: object, name: Strings.resource) + _dimensions = ReadWriteAttribute(jsObject: object, name: Strings.dimensions) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var resource: MLResource + + @ReadWriteAttribute + public var dimensions: [Int32] +} diff --git a/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift b/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift new file mode 100644 index 00000000..331ea268 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLInputOperandLayout: JSString, JSValueCompatible { + case nchw = "nchw" + case nhwc = "nhwc" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift b/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift new file mode 100644 index 00000000..82c881f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLInstanceNormalizationOptions: BridgedDictionary { + public convenience init(scale: MLOperand, bias: MLOperand, epsilon: Float, layout: MLInputOperandLayout) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.scale] = scale.jsValue() + object[Strings.bias] = bias.jsValue() + object[Strings.epsilon] = epsilon.jsValue() + object[Strings.layout] = layout.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _scale = ReadWriteAttribute(jsObject: object, name: Strings.scale) + _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) + _epsilon = ReadWriteAttribute(jsObject: object, name: Strings.epsilon) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var scale: MLOperand + + @ReadWriteAttribute + public var bias: MLOperand + + @ReadWriteAttribute + public var epsilon: Float + + @ReadWriteAttribute + public var layout: MLInputOperandLayout +} diff --git a/Sources/DOMKit/WebIDL/MLInterpolationMode.swift b/Sources/DOMKit/WebIDL/MLInterpolationMode.swift new file mode 100644 index 00000000..56785f87 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLInterpolationMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLInterpolationMode: JSString, JSValueCompatible { + case nearestNeighbor = "nearest-neighbor" + case linear = "linear" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift b/Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift new file mode 100644 index 00000000..944f0458 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLLeakyReluOptions: BridgedDictionary { + public convenience init(alpha: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.alpha] = alpha.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var alpha: Float +} diff --git a/Sources/DOMKit/WebIDL/MLLinearOptions.swift b/Sources/DOMKit/WebIDL/MLLinearOptions.swift new file mode 100644 index 00000000..aa96774d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLLinearOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLLinearOptions: BridgedDictionary { + public convenience init(alpha: Float, beta: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.alpha] = alpha.jsValue() + object[Strings.beta] = beta.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var alpha: Float + + @ReadWriteAttribute + public var beta: Float +} diff --git a/Sources/DOMKit/WebIDL/MLOperand.swift b/Sources/DOMKit/WebIDL/MLOperand.swift new file mode 100644 index 00000000..31a5b5da --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLOperand.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLOperand: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MLOperand].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift b/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift new file mode 100644 index 00000000..fc4a6fa2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLOperandDescriptor: BridgedDictionary { + public convenience init(type: MLOperandType, dimensions: [Int32]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.dimensions] = dimensions.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _dimensions = ReadWriteAttribute(jsObject: object, name: Strings.dimensions) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: MLOperandType + + @ReadWriteAttribute + public var dimensions: [Int32] +} diff --git a/Sources/DOMKit/WebIDL/MLOperandType.swift b/Sources/DOMKit/WebIDL/MLOperandType.swift new file mode 100644 index 00000000..e64b0870 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLOperandType.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLOperandType: JSString, JSValueCompatible { + case float32 = "float32" + case float16 = "float16" + case int32 = "int32" + case uint32 = "uint32" + case int8 = "int8" + case uint8 = "uint8" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLOperator.swift b/Sources/DOMKit/WebIDL/MLOperator.swift new file mode 100644 index 00000000..cd8f130a --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLOperator.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLOperator: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MLOperator].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/MLPadOptions.swift b/Sources/DOMKit/WebIDL/MLPadOptions.swift new file mode 100644 index 00000000..d3b86f99 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLPadOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLPadOptions: BridgedDictionary { + public convenience init(mode: MLPaddingMode, value: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mode] = mode.jsValue() + object[Strings.value] = value.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mode: MLPaddingMode + + @ReadWriteAttribute + public var value: Float +} diff --git a/Sources/DOMKit/WebIDL/MLPaddingMode.swift b/Sources/DOMKit/WebIDL/MLPaddingMode.swift new file mode 100644 index 00000000..2995ca1c --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLPaddingMode.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLPaddingMode: JSString, JSValueCompatible { + case constant = "constant" + case edge = "edge" + case reflection = "reflection" + case symmetric = "symmetric" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLPool2dOptions.swift b/Sources/DOMKit/WebIDL/MLPool2dOptions.swift new file mode 100644 index 00000000..85a78ed8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLPool2dOptions.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLPool2dOptions: BridgedDictionary { + public convenience init(windowDimensions: [Int32], padding: [Int32], strides: [Int32], dilations: [Int32], autoPad: MLAutoPad, layout: MLInputOperandLayout, roundingType: MLRoundingType, outputSizes: [Int32]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.windowDimensions] = windowDimensions.jsValue() + object[Strings.padding] = padding.jsValue() + object[Strings.strides] = strides.jsValue() + object[Strings.dilations] = dilations.jsValue() + object[Strings.autoPad] = autoPad.jsValue() + object[Strings.layout] = layout.jsValue() + object[Strings.roundingType] = roundingType.jsValue() + object[Strings.outputSizes] = outputSizes.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _windowDimensions = ReadWriteAttribute(jsObject: object, name: Strings.windowDimensions) + _padding = ReadWriteAttribute(jsObject: object, name: Strings.padding) + _strides = ReadWriteAttribute(jsObject: object, name: Strings.strides) + _dilations = ReadWriteAttribute(jsObject: object, name: Strings.dilations) + _autoPad = ReadWriteAttribute(jsObject: object, name: Strings.autoPad) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + _roundingType = ReadWriteAttribute(jsObject: object, name: Strings.roundingType) + _outputSizes = ReadWriteAttribute(jsObject: object, name: Strings.outputSizes) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var windowDimensions: [Int32] + + @ReadWriteAttribute + public var padding: [Int32] + + @ReadWriteAttribute + public var strides: [Int32] + + @ReadWriteAttribute + public var dilations: [Int32] + + @ReadWriteAttribute + public var autoPad: MLAutoPad + + @ReadWriteAttribute + public var layout: MLInputOperandLayout + + @ReadWriteAttribute + public var roundingType: MLRoundingType + + @ReadWriteAttribute + public var outputSizes: [Int32] +} diff --git a/Sources/DOMKit/WebIDL/MLPowerPreference.swift b/Sources/DOMKit/WebIDL/MLPowerPreference.swift new file mode 100644 index 00000000..5e8dade8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLPowerPreference.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLPowerPreference: JSString, JSValueCompatible { + case `default` = "default" + case highPerformance = "high-performance" + case lowPower = "low-power" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift b/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift new file mode 100644 index 00000000..07ee3756 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLRecurrentNetworkDirection: JSString, JSValueCompatible { + case forward = "forward" + case backward = "backward" + case both = "both" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift b/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift new file mode 100644 index 00000000..fbdaf8f0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLRecurrentNetworkWeightLayout: JSString, JSValueCompatible { + case zrn = "zrn" + case rzn = "rzn" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLReduceOptions.swift b/Sources/DOMKit/WebIDL/MLReduceOptions.swift new file mode 100644 index 00000000..b0514afa --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLReduceOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLReduceOptions: BridgedDictionary { + public convenience init(axes: [Int32], keepDimensions: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.axes] = axes.jsValue() + object[Strings.keepDimensions] = keepDimensions.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _axes = ReadWriteAttribute(jsObject: object, name: Strings.axes) + _keepDimensions = ReadWriteAttribute(jsObject: object, name: Strings.keepDimensions) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var axes: [Int32] + + @ReadWriteAttribute + public var keepDimensions: Bool +} diff --git a/Sources/DOMKit/WebIDL/MLResample2dOptions.swift b/Sources/DOMKit/WebIDL/MLResample2dOptions.swift new file mode 100644 index 00000000..294d7f03 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLResample2dOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLResample2dOptions: BridgedDictionary { + public convenience init(mode: MLInterpolationMode, scales: [Float], sizes: [Int32], axes: [Int32]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mode] = mode.jsValue() + object[Strings.scales] = scales.jsValue() + object[Strings.sizes] = sizes.jsValue() + object[Strings.axes] = axes.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) + _scales = ReadWriteAttribute(jsObject: object, name: Strings.scales) + _sizes = ReadWriteAttribute(jsObject: object, name: Strings.sizes) + _axes = ReadWriteAttribute(jsObject: object, name: Strings.axes) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mode: MLInterpolationMode + + @ReadWriteAttribute + public var scales: [Float] + + @ReadWriteAttribute + public var sizes: [Int32] + + @ReadWriteAttribute + public var axes: [Int32] +} diff --git a/Sources/DOMKit/WebIDL/MLRoundingType.swift b/Sources/DOMKit/WebIDL/MLRoundingType.swift new file mode 100644 index 00000000..68dcb16c --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLRoundingType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MLRoundingType: JSString, JSValueCompatible { + case floor = "floor" + case ceil = "ceil" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MLSliceOptions.swift b/Sources/DOMKit/WebIDL/MLSliceOptions.swift new file mode 100644 index 00000000..0670c8c1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLSliceOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLSliceOptions: BridgedDictionary { + public convenience init(axes: [Int32]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.axes] = axes.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _axes = ReadWriteAttribute(jsObject: object, name: Strings.axes) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var axes: [Int32] +} diff --git a/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift b/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift new file mode 100644 index 00000000..47a9f53d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLSoftplusOptions: BridgedDictionary { + public convenience init(steepness: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.steepness] = steepness.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _steepness = ReadWriteAttribute(jsObject: object, name: Strings.steepness) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var steepness: Float +} diff --git a/Sources/DOMKit/WebIDL/MLSplitOptions.swift b/Sources/DOMKit/WebIDL/MLSplitOptions.swift new file mode 100644 index 00000000..dcf34261 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLSplitOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLSplitOptions: BridgedDictionary { + public convenience init(axis: Int32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.axis] = axis.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _axis = ReadWriteAttribute(jsObject: object, name: Strings.axis) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var axis: Int32 +} diff --git a/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift b/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift new file mode 100644 index 00000000..06662222 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLSqueezeOptions: BridgedDictionary { + public convenience init(axes: [Int32]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.axes] = axes.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _axes = ReadWriteAttribute(jsObject: object, name: Strings.axes) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var axes: [Int32] +} diff --git a/Sources/DOMKit/WebIDL/MLTransposeOptions.swift b/Sources/DOMKit/WebIDL/MLTransposeOptions.swift new file mode 100644 index 00000000..5d1e4d51 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLTransposeOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MLTransposeOptions: BridgedDictionary { + public convenience init(permutation: [Int32]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.permutation] = permutation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _permutation = ReadWriteAttribute(jsObject: object, name: Strings.permutation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var permutation: [Int32] +} diff --git a/Sources/DOMKit/WebIDL/Magnetometer.swift b/Sources/DOMKit/WebIDL/Magnetometer.swift new file mode 100644 index 00000000..a02ac8be --- /dev/null +++ b/Sources/DOMKit/WebIDL/Magnetometer.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Magnetometer: Sensor { + override public class var constructor: JSFunction { JSObject.global[Strings.Magnetometer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var x: Double? + + @ReadonlyAttribute + public var y: Double? + + @ReadonlyAttribute + public var z: Double? +} diff --git a/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift new file mode 100644 index 00000000..0e8d26c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MagnetometerLocalCoordinateSystem: JSString, JSValueCompatible { + case device = "device" + case screen = "screen" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift b/Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift new file mode 100644 index 00000000..645c91e6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MagnetometerReadingValues: BridgedDictionary { + public convenience init(x: Double?, y: Double?, z: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.z] = z.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _z = ReadWriteAttribute(jsObject: object, name: Strings.z) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var x: Double? + + @ReadWriteAttribute + public var y: Double? + + @ReadWriteAttribute + public var z: Double? +} diff --git a/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift b/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift new file mode 100644 index 00000000..cd558499 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MagnetometerSensorOptions: BridgedDictionary { + public convenience init(referenceFrame: MagnetometerLocalCoordinateSystem) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.referenceFrame] = referenceFrame.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _referenceFrame = ReadWriteAttribute(jsObject: object, name: Strings.referenceFrame) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var referenceFrame: MagnetometerLocalCoordinateSystem +} diff --git a/Sources/DOMKit/WebIDL/MathMLElement.swift b/Sources/DOMKit/WebIDL/MathMLElement.swift new file mode 100644 index 00000000..87ca6dbe --- /dev/null +++ b/Sources/DOMKit/WebIDL/MathMLElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MathMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, HTMLOrSVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.MathMLElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilities.swift b/Sources/DOMKit/WebIDL/MediaCapabilities.swift new file mode 100644 index 00000000..9982a90c --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaCapabilities.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaCapabilities: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MediaCapabilities].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func decodingInfo(configuration: MediaDecodingConfiguration) -> JSPromise { + jsObject[Strings.decodingInfo]!(configuration.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func decodingInfo(configuration: MediaDecodingConfiguration) async throws -> MediaCapabilitiesDecodingInfo { + let _promise: JSPromise = jsObject[Strings.decodingInfo]!(configuration.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func encodingInfo(configuration: MediaEncodingConfiguration) -> JSPromise { + jsObject[Strings.encodingInfo]!(configuration.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func encodingInfo(configuration: MediaEncodingConfiguration) async throws -> MediaCapabilitiesEncodingInfo { + let _promise: JSPromise = jsObject[Strings.encodingInfo]!(configuration.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift new file mode 100644 index 00000000..5d8149aa --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaCapabilitiesDecodingInfo: BridgedDictionary { + public convenience init(keySystemAccess: MediaKeySystemAccess, configuration: MediaDecodingConfiguration) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.keySystemAccess] = keySystemAccess.jsValue() + object[Strings.configuration] = configuration.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _keySystemAccess = ReadWriteAttribute(jsObject: object, name: Strings.keySystemAccess) + _configuration = ReadWriteAttribute(jsObject: object, name: Strings.configuration) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var keySystemAccess: MediaKeySystemAccess + + @ReadWriteAttribute + public var configuration: MediaDecodingConfiguration +} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift new file mode 100644 index 00000000..479c1f0d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaCapabilitiesEncodingInfo: BridgedDictionary { + public convenience init(configuration: MediaEncodingConfiguration) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.configuration] = configuration.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _configuration = ReadWriteAttribute(jsObject: object, name: Strings.configuration) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var configuration: MediaEncodingConfiguration +} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift new file mode 100644 index 00000000..58140ad3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaCapabilitiesInfo: BridgedDictionary { + public convenience init(supported: Bool, smooth: Bool, powerEfficient: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supported] = supported.jsValue() + object[Strings.smooth] = smooth.jsValue() + object[Strings.powerEfficient] = powerEfficient.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _smooth = ReadWriteAttribute(jsObject: object, name: Strings.smooth) + _powerEfficient = ReadWriteAttribute(jsObject: object, name: Strings.powerEfficient) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var supported: Bool + + @ReadWriteAttribute + public var smooth: Bool + + @ReadWriteAttribute + public var powerEfficient: Bool +} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift new file mode 100644 index 00000000..5df480ae --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaCapabilitiesKeySystemConfiguration: BridgedDictionary { + public convenience init(keySystem: String, initDataType: String, distinctiveIdentifier: MediaKeysRequirement, persistentState: MediaKeysRequirement, sessionTypes: [String], audio: KeySystemTrackConfiguration, video: KeySystemTrackConfiguration) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.keySystem] = keySystem.jsValue() + object[Strings.initDataType] = initDataType.jsValue() + object[Strings.distinctiveIdentifier] = distinctiveIdentifier.jsValue() + object[Strings.persistentState] = persistentState.jsValue() + object[Strings.sessionTypes] = sessionTypes.jsValue() + object[Strings.audio] = audio.jsValue() + object[Strings.video] = video.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _keySystem = ReadWriteAttribute(jsObject: object, name: Strings.keySystem) + _initDataType = ReadWriteAttribute(jsObject: object, name: Strings.initDataType) + _distinctiveIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.distinctiveIdentifier) + _persistentState = ReadWriteAttribute(jsObject: object, name: Strings.persistentState) + _sessionTypes = ReadWriteAttribute(jsObject: object, name: Strings.sessionTypes) + _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) + _video = ReadWriteAttribute(jsObject: object, name: Strings.video) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var keySystem: String + + @ReadWriteAttribute + public var initDataType: String + + @ReadWriteAttribute + public var distinctiveIdentifier: MediaKeysRequirement + + @ReadWriteAttribute + public var persistentState: MediaKeysRequirement + + @ReadWriteAttribute + public var sessionTypes: [String] + + @ReadWriteAttribute + public var audio: KeySystemTrackConfiguration + + @ReadWriteAttribute + public var video: KeySystemTrackConfiguration +} diff --git a/Sources/DOMKit/WebIDL/MediaConfiguration.swift b/Sources/DOMKit/WebIDL/MediaConfiguration.swift new file mode 100644 index 00000000..e165f949 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaConfiguration.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaConfiguration: BridgedDictionary { + public convenience init(video: VideoConfiguration, audio: AudioConfiguration) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.video] = video.jsValue() + object[Strings.audio] = audio.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _video = ReadWriteAttribute(jsObject: object, name: Strings.video) + _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var video: VideoConfiguration + + @ReadWriteAttribute + public var audio: AudioConfiguration +} diff --git a/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift b/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift new file mode 100644 index 00000000..71b12597 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaDecodingConfiguration: BridgedDictionary { + public convenience init(type: MediaDecodingType, keySystemConfiguration: MediaCapabilitiesKeySystemConfiguration) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.keySystemConfiguration] = keySystemConfiguration.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _keySystemConfiguration = ReadWriteAttribute(jsObject: object, name: Strings.keySystemConfiguration) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: MediaDecodingType + + @ReadWriteAttribute + public var keySystemConfiguration: MediaCapabilitiesKeySystemConfiguration +} diff --git a/Sources/DOMKit/WebIDL/MediaDecodingType.swift b/Sources/DOMKit/WebIDL/MediaDecodingType.swift new file mode 100644 index 00000000..8ab0a0db --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaDecodingType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaDecodingType: JSString, JSValueCompatible { + case file = "file" + case mediaSource = "media-source" + case webrtc = "webrtc" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift b/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift new file mode 100644 index 00000000..ea305c53 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaDeviceInfo: JSBridgedClass { + 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 + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MediaDeviceKind.swift b/Sources/DOMKit/WebIDL/MediaDeviceKind.swift new file mode 100644 index 00000000..59285654 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaDeviceKind.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaDeviceKind: JSString, JSValueCompatible { + case audioinput = "audioinput" + case audiooutput = "audiooutput" + case videoinput = "videoinput" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaDevices.swift b/Sources/DOMKit/WebIDL/MediaDevices.swift new file mode 100644 index 00000000..db13604c --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaDevices.swift @@ -0,0 +1,70 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaDevices: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaDevices].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _ondevicechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicechange) + super.init(unsafelyWrapping: jsObject) + } + + public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) -> JSPromise { + jsObject[Strings.getDisplayMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) async throws -> MediaStream { + let _promise: JSPromise = jsObject[Strings.getDisplayMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func selectAudioOutput(options: AudioOutputOptions? = nil) -> JSPromise { + jsObject[Strings.selectAudioOutput]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func selectAudioOutput(options: AudioOutputOptions? = nil) async throws -> MediaDeviceInfo { + let _promise: JSPromise = jsObject[Strings.selectAudioOutput]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func produceCropTarget(element: HTMLElement) -> JSPromise { + jsObject[Strings.produceCropTarget]!(element.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func produceCropTarget(element: HTMLElement) async throws -> CropTarget { + let _promise: JSPromise = jsObject[Strings.produceCropTarget]!(element.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var ondevicechange: EventHandler + + public func enumerateDevices() -> JSPromise { + jsObject[Strings.enumerateDevices]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func enumerateDevices() async throws -> [MediaDeviceInfo] { + let _promise: JSPromise = jsObject[Strings.enumerateDevices]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getSupportedConstraints() -> MediaTrackSupportedConstraints { + jsObject[Strings.getSupportedConstraints]!().fromJSValue()! + } + + public func getUserMedia(constraints: MediaStreamConstraints? = nil) -> JSPromise { + jsObject[Strings.getUserMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getUserMedia(constraints: MediaStreamConstraints? = nil) async throws -> MediaStream { + let _promise: JSPromise = jsObject[Strings.getUserMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift new file mode 100644 index 00000000..3b529935 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaElementAudioSourceNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaElementAudioSourceNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _mediaElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaElement) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: AudioContext, options: MediaElementAudioSourceOptions) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options.jsValue())) + } + + @ReadonlyAttribute + public var mediaElement: HTMLMediaElement +} diff --git a/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift b/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift new file mode 100644 index 00000000..fffaa9c0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaElementAudioSourceOptions: BridgedDictionary { + public convenience init(mediaElement: HTMLMediaElement) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mediaElement] = mediaElement.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mediaElement = ReadWriteAttribute(jsObject: object, name: Strings.mediaElement) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mediaElement: HTMLMediaElement +} diff --git a/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift b/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift new file mode 100644 index 00000000..87c18050 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaEncodingConfiguration: BridgedDictionary { + public convenience init(type: MediaEncodingType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: MediaEncodingType +} diff --git a/Sources/DOMKit/WebIDL/MediaEncodingType.swift b/Sources/DOMKit/WebIDL/MediaEncodingType.swift new file mode 100644 index 00000000..3313cc2e --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaEncodingType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaEncodingType: JSString, JSValueCompatible { + case record = "record" + case webrtc = "webrtc" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift b/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift new file mode 100644 index 00000000..6b826327 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaEncryptedEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaEncryptedEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _initDataType = ReadonlyAttribute(jsObject: jsObject, name: Strings.initDataType) + _initData = ReadonlyAttribute(jsObject: jsObject, name: Strings.initData) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: MediaEncryptedEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var initDataType: String + + @ReadonlyAttribute + public var initData: ArrayBuffer? +} diff --git a/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift b/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift new file mode 100644 index 00000000..d75429e7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaEncryptedEventInit: BridgedDictionary { + public convenience init(initDataType: String, initData: ArrayBuffer?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.initDataType] = initDataType.jsValue() + object[Strings.initData] = initData.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _initDataType = ReadWriteAttribute(jsObject: object, name: Strings.initDataType) + _initData = ReadWriteAttribute(jsObject: object, name: Strings.initData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var initDataType: String + + @ReadWriteAttribute + public var initData: ArrayBuffer? +} diff --git a/Sources/DOMKit/WebIDL/MediaError.swift b/Sources/DOMKit/WebIDL/MediaError.swift index 39024ff6..e3960907 100644 --- a/Sources/DOMKit/WebIDL/MediaError.swift +++ b/Sources/DOMKit/WebIDL/MediaError.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaError: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.MediaError.function! } + public class var constructor: JSFunction { JSObject.global[Strings.MediaError].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MediaImage.swift b/Sources/DOMKit/WebIDL/MediaImage.swift new file mode 100644 index 00000000..586829ee --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaImage.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaImage: BridgedDictionary { + public convenience init(src: String, sizes: String, type: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.src] = src.jsValue() + object[Strings.sizes] = sizes.jsValue() + object[Strings.type] = type.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _src = ReadWriteAttribute(jsObject: object, name: Strings.src) + _sizes = ReadWriteAttribute(jsObject: object, name: Strings.sizes) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var sizes: String + + @ReadWriteAttribute + public var type: String +} diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift new file mode 100644 index 00000000..b24eda4e --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaKeyMessageEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaKeyMessageEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _messageType = ReadonlyAttribute(jsObject: jsObject, name: Strings.messageType) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: MediaKeyMessageEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var messageType: MediaKeyMessageType + + @ReadonlyAttribute + public var message: ArrayBuffer +} diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift new file mode 100644 index 00000000..580d044b --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaKeyMessageEventInit: BridgedDictionary { + public convenience init(messageType: MediaKeyMessageType, message: ArrayBuffer) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.messageType] = messageType.jsValue() + object[Strings.message] = message.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _messageType = ReadWriteAttribute(jsObject: object, name: Strings.messageType) + _message = ReadWriteAttribute(jsObject: object, name: Strings.message) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var messageType: MediaKeyMessageType + + @ReadWriteAttribute + public var message: ArrayBuffer +} diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift new file mode 100644 index 00000000..4469c0f4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaKeyMessageType: JSString, JSValueCompatible { + case licenseRequest = "license-request" + case licenseRenewal = "license-renewal" + case licenseRelease = "license-release" + case individualizationRequest = "individualization-request" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaKeySession.swift b/Sources/DOMKit/WebIDL/MediaKeySession.swift new file mode 100644 index 00000000..8b125631 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeySession.swift @@ -0,0 +1,86 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaKeySession: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaKeySession].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _sessionId = ReadonlyAttribute(jsObject: jsObject, name: Strings.sessionId) + _expiration = ReadonlyAttribute(jsObject: jsObject, name: Strings.expiration) + _closed = ReadonlyAttribute(jsObject: jsObject, name: Strings.closed) + _keyStatuses = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyStatuses) + _onkeystatuseschange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onkeystatuseschange) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var sessionId: String + + @ReadonlyAttribute + public var expiration: Double + + @ReadonlyAttribute + public var closed: JSPromise + + @ReadonlyAttribute + public var keyStatuses: MediaKeyStatusMap + + @ClosureAttribute.Optional1 + public var onkeystatuseschange: EventHandler + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + public func generateRequest(initDataType: String, initData: BufferSource) -> JSPromise { + jsObject[Strings.generateRequest]!(initDataType.jsValue(), initData.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func generateRequest(initDataType: String, initData: BufferSource) async throws { + let _promise: JSPromise = jsObject[Strings.generateRequest]!(initDataType.jsValue(), initData.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func load(sessionId: String) -> JSPromise { + jsObject[Strings.load]!(sessionId.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func load(sessionId: String) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.load]!(sessionId.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func update(response: BufferSource) -> JSPromise { + jsObject[Strings.update]!(response.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func update(response: BufferSource) async throws { + let _promise: JSPromise = jsObject[Strings.update]!(response.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func close() -> JSPromise { + jsObject[Strings.close]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func close() async throws { + let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + _ = try await _promise.get() + } + + public func remove() -> JSPromise { + jsObject[Strings.remove]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func remove() async throws { + let _promise: JSPromise = jsObject[Strings.remove]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift b/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift new file mode 100644 index 00000000..9c57ca4f --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaKeySessionClosedReason: JSString, JSValueCompatible { + case internalError = "internal-error" + case closedByApplication = "closed-by-application" + case releaseAcknowledged = "release-acknowledged" + case hardwareContextReset = "hardware-context-reset" + case resourceEvicted = "resource-evicted" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaKeySessionType.swift b/Sources/DOMKit/WebIDL/MediaKeySessionType.swift new file mode 100644 index 00000000..7f86ad03 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeySessionType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaKeySessionType: JSString, JSValueCompatible { + case temporary = "temporary" + case persistentLicense = "persistent-license" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatus.swift b/Sources/DOMKit/WebIDL/MediaKeyStatus.swift new file mode 100644 index 00000000..bdbe3042 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeyStatus.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaKeyStatus: JSString, JSValueCompatible { + case usable = "usable" + case expired = "expired" + case released = "released" + case outputRestricted = "output-restricted" + case outputDownscaled = "output-downscaled" + case usableInFuture = "usable-in-future" + case statusPending = "status-pending" + case internalError = "internal-error" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift new file mode 100644 index 00000000..3545aba3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaKeyStatusMap: JSBridgedClass, Sequence { + public class var constructor: JSFunction { JSObject.global[Strings.MediaKeyStatusMap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + self.jsObject = jsObject + } + + public typealias Element = BufferSource + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + @ReadonlyAttribute + public var size: UInt32 + + public func has(keyId: BufferSource) -> Bool { + jsObject[Strings.has]!(keyId.jsValue()).fromJSValue()! + } + + public func get(keyId: BufferSource) -> __UNSUPPORTED_UNION__ { + jsObject[Strings.get]!(keyId.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift b/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift new file mode 100644 index 00000000..b9994f90 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaKeySystemAccess: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MediaKeySystemAccess].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _keySystem = ReadonlyAttribute(jsObject: jsObject, name: Strings.keySystem) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var keySystem: String + + public func getConfiguration() -> MediaKeySystemConfiguration { + jsObject[Strings.getConfiguration]!().fromJSValue()! + } + + public func createMediaKeys() -> JSPromise { + jsObject[Strings.createMediaKeys]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createMediaKeys() async throws -> MediaKeys { + let _promise: JSPromise = jsObject[Strings.createMediaKeys]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift b/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift new file mode 100644 index 00000000..305007e9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaKeySystemConfiguration: BridgedDictionary { + public convenience init(label: String, initDataTypes: [String], audioCapabilities: [MediaKeySystemMediaCapability], videoCapabilities: [MediaKeySystemMediaCapability], distinctiveIdentifier: MediaKeysRequirement, persistentState: MediaKeysRequirement, sessionTypes: [String]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.label] = label.jsValue() + object[Strings.initDataTypes] = initDataTypes.jsValue() + object[Strings.audioCapabilities] = audioCapabilities.jsValue() + object[Strings.videoCapabilities] = videoCapabilities.jsValue() + object[Strings.distinctiveIdentifier] = distinctiveIdentifier.jsValue() + object[Strings.persistentState] = persistentState.jsValue() + object[Strings.sessionTypes] = sessionTypes.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _label = ReadWriteAttribute(jsObject: object, name: Strings.label) + _initDataTypes = ReadWriteAttribute(jsObject: object, name: Strings.initDataTypes) + _audioCapabilities = ReadWriteAttribute(jsObject: object, name: Strings.audioCapabilities) + _videoCapabilities = ReadWriteAttribute(jsObject: object, name: Strings.videoCapabilities) + _distinctiveIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.distinctiveIdentifier) + _persistentState = ReadWriteAttribute(jsObject: object, name: Strings.persistentState) + _sessionTypes = ReadWriteAttribute(jsObject: object, name: Strings.sessionTypes) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var label: String + + @ReadWriteAttribute + public var initDataTypes: [String] + + @ReadWriteAttribute + public var audioCapabilities: [MediaKeySystemMediaCapability] + + @ReadWriteAttribute + public var videoCapabilities: [MediaKeySystemMediaCapability] + + @ReadWriteAttribute + public var distinctiveIdentifier: MediaKeysRequirement + + @ReadWriteAttribute + public var persistentState: MediaKeysRequirement + + @ReadWriteAttribute + public var sessionTypes: [String] +} diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift b/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift new file mode 100644 index 00000000..4f9d43a0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaKeySystemMediaCapability: BridgedDictionary { + public convenience init(contentType: String, encryptionScheme: String?, robustness: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.contentType] = contentType.jsValue() + object[Strings.encryptionScheme] = encryptionScheme.jsValue() + object[Strings.robustness] = robustness.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _contentType = ReadWriteAttribute(jsObject: object, name: Strings.contentType) + _encryptionScheme = ReadWriteAttribute(jsObject: object, name: Strings.encryptionScheme) + _robustness = ReadWriteAttribute(jsObject: object, name: Strings.robustness) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var contentType: String + + @ReadWriteAttribute + public var encryptionScheme: String? + + @ReadWriteAttribute + public var robustness: String +} diff --git a/Sources/DOMKit/WebIDL/MediaKeys.swift b/Sources/DOMKit/WebIDL/MediaKeys.swift new file mode 100644 index 00000000..71223fc8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeys.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaKeys: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MediaKeys].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func createSession(sessionType: MediaKeySessionType? = nil) -> MediaKeySession { + jsObject[Strings.createSession]!(sessionType?.jsValue() ?? .undefined).fromJSValue()! + } + + public func setServerCertificate(serverCertificate: BufferSource) -> JSPromise { + jsObject[Strings.setServerCertificate]!(serverCertificate.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setServerCertificate(serverCertificate: BufferSource) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.setServerCertificate]!(serverCertificate.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift b/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift new file mode 100644 index 00000000..18ceae7c --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaKeysRequirement: JSString, JSValueCompatible { + case required = "required" + case optional = "optional" + case notAllowed = "not-allowed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift index f41f5bd5..93bbb9c2 100644 --- a/Sources/DOMKit/WebIDL/MediaList.swift +++ b/Sources/DOMKit/WebIDL/MediaList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.MediaList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.MediaList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MediaMetadata.swift b/Sources/DOMKit/WebIDL/MediaMetadata.swift new file mode 100644 index 00000000..dbe2545e --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaMetadata.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaMetadata: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MediaMetadata].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _title = ReadWriteAttribute(jsObject: jsObject, name: Strings.title) + _artist = ReadWriteAttribute(jsObject: jsObject, name: Strings.artist) + _album = ReadWriteAttribute(jsObject: jsObject, name: Strings.album) + _artwork = ReadWriteAttribute(jsObject: jsObject, name: Strings.artwork) + self.jsObject = jsObject + } + + public convenience init(init: MediaMetadataInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var title: String + + @ReadWriteAttribute + public var artist: String + + @ReadWriteAttribute + public var album: String + + @ReadWriteAttribute + public var artwork: [MediaImage] +} diff --git a/Sources/DOMKit/WebIDL/MediaMetadataInit.swift b/Sources/DOMKit/WebIDL/MediaMetadataInit.swift new file mode 100644 index 00000000..54a56f54 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaMetadataInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaMetadataInit: BridgedDictionary { + public convenience init(title: String, artist: String, album: String, artwork: [MediaImage]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.title] = title.jsValue() + object[Strings.artist] = artist.jsValue() + object[Strings.album] = album.jsValue() + object[Strings.artwork] = artwork.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _title = ReadWriteAttribute(jsObject: object, name: Strings.title) + _artist = ReadWriteAttribute(jsObject: object, name: Strings.artist) + _album = ReadWriteAttribute(jsObject: object, name: Strings.album) + _artwork = ReadWriteAttribute(jsObject: object, name: Strings.artwork) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var title: String + + @ReadWriteAttribute + public var artist: String + + @ReadWriteAttribute + public var album: String + + @ReadWriteAttribute + public var artwork: [MediaImage] +} diff --git a/Sources/DOMKit/WebIDL/MediaPositionState.swift b/Sources/DOMKit/WebIDL/MediaPositionState.swift new file mode 100644 index 00000000..e0ff18b2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaPositionState.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaPositionState: BridgedDictionary { + public convenience init(duration: Double, playbackRate: Double, position: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.duration] = duration.jsValue() + object[Strings.playbackRate] = playbackRate.jsValue() + object[Strings.position] = position.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) + _position = ReadWriteAttribute(jsObject: object, name: Strings.position) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var duration: Double + + @ReadWriteAttribute + public var playbackRate: Double + + @ReadWriteAttribute + public var position: Double +} diff --git a/Sources/DOMKit/WebIDL/MediaQueryList.swift b/Sources/DOMKit/WebIDL/MediaQueryList.swift new file mode 100644 index 00000000..eaf021d0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaQueryList.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaQueryList: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaQueryList].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) + _matches = ReadonlyAttribute(jsObject: jsObject, name: Strings.matches) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var media: String + + @ReadonlyAttribute + public var matches: Bool + + public func addListener(callback: EventListener?) { + _ = jsObject[Strings.addListener]!(callback.jsValue()) + } + + public func removeListener(callback: EventListener?) { + _ = jsObject[Strings.removeListener]!(callback.jsValue()) + } + + @ClosureAttribute.Optional1 + public var onchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift b/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift new file mode 100644 index 00000000..8689fe59 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaQueryListEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaQueryListEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) + _matches = ReadonlyAttribute(jsObject: jsObject, name: Strings.matches) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: MediaQueryListEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var media: String + + @ReadonlyAttribute + public var matches: Bool +} diff --git a/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift b/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift new file mode 100644 index 00000000..57be2b9b --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaQueryListEventInit: BridgedDictionary { + public convenience init(media: String, matches: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.media] = media.jsValue() + object[Strings.matches] = matches.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _media = ReadWriteAttribute(jsObject: object, name: Strings.media) + _matches = ReadWriteAttribute(jsObject: object, name: Strings.matches) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var media: String + + @ReadWriteAttribute + public var matches: Bool +} diff --git a/Sources/DOMKit/WebIDL/MediaRecorder.swift b/Sources/DOMKit/WebIDL/MediaRecorder.swift new file mode 100644 index 00000000..98f2aa8f --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaRecorder.swift @@ -0,0 +1,88 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaRecorder: EventTarget { + 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 = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstart) + _onstop = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstop) + _ondataavailable = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondataavailable) + _onpause = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpause) + _onresume = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresume) + _onerror = ClosureAttribute.Optional1(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) + } + + public convenience init(stream: MediaStream, options: MediaRecorderOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var stream: MediaStream + + @ReadonlyAttribute + public var mimeType: String + + @ReadonlyAttribute + public var state: RecordingState + + @ClosureAttribute.Optional1 + public var onstart: EventHandler + + @ClosureAttribute.Optional1 + public var onstop: EventHandler + + @ClosureAttribute.Optional1 + public var ondataavailable: EventHandler + + @ClosureAttribute.Optional1 + public var onpause: EventHandler + + @ClosureAttribute.Optional1 + public var onresume: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ReadonlyAttribute + public var videoBitsPerSecond: UInt32 + + @ReadonlyAttribute + public var audioBitsPerSecond: UInt32 + + @ReadonlyAttribute + public var audioBitrateMode: BitrateMode + + public func start(timeslice: UInt32? = nil) { + _ = jsObject[Strings.start]!(timeslice?.jsValue() ?? .undefined) + } + + public func stop() { + _ = jsObject[Strings.stop]!() + } + + public func pause() { + _ = jsObject[Strings.pause]!() + } + + public func resume() { + _ = jsObject[Strings.resume]!() + } + + public func requestData() { + _ = jsObject[Strings.requestData]!() + } + + public static func isTypeSupported(type: String) -> Bool { + constructor[Strings.isTypeSupported]!(type.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift b/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift new file mode 100644 index 00000000..2d52ab16 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaRecorderErrorEvent: Event { + 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) + } + + public convenience init(type: String, eventInitDict: MediaRecorderErrorEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var error: DOMException +} diff --git a/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift b/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift new file mode 100644 index 00000000..20d908f4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift b/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift new file mode 100644 index 00000000..eb1919f7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/MediaSession.swift b/Sources/DOMKit/WebIDL/MediaSession.swift new file mode 100644 index 00000000..dee0c265 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaSession.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaSession: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MediaSession].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _metadata = ReadWriteAttribute(jsObject: jsObject, name: Strings.metadata) + _playbackState = ReadWriteAttribute(jsObject: jsObject, name: Strings.playbackState) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var metadata: MediaMetadata? + + @ReadWriteAttribute + public var playbackState: MediaSessionPlaybackState + + public func setActionHandler(action: MediaSessionAction, handler: MediaSessionActionHandler?) { + _ = jsObject[Strings.setActionHandler]!(action.jsValue(), handler.jsValue()) + } + + public func setPositionState(state: MediaPositionState? = nil) { + _ = jsObject[Strings.setPositionState]!(state?.jsValue() ?? .undefined) + } + + public func setMicrophoneActive(active: Bool) { + _ = jsObject[Strings.setMicrophoneActive]!(active.jsValue()) + } + + public func setCameraActive(active: Bool) { + _ = jsObject[Strings.setCameraActive]!(active.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/MediaSessionAction.swift b/Sources/DOMKit/WebIDL/MediaSessionAction.swift new file mode 100644 index 00000000..5bb7fa1f --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaSessionAction.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaSessionAction: JSString, JSValueCompatible { + case play = "play" + case pause = "pause" + case seekbackward = "seekbackward" + case seekforward = "seekforward" + case previoustrack = "previoustrack" + case nexttrack = "nexttrack" + case skipad = "skipad" + case stop = "stop" + case seekto = "seekto" + case togglemicrophone = "togglemicrophone" + case togglecamera = "togglecamera" + case hangup = "hangup" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift b/Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift new file mode 100644 index 00000000..cef092ec --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaSessionActionDetails: BridgedDictionary { + public convenience init(action: MediaSessionAction, seekOffset: Double?, seekTime: Double?, fastSeek: Bool?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.action] = action.jsValue() + object[Strings.seekOffset] = seekOffset.jsValue() + object[Strings.seekTime] = seekTime.jsValue() + object[Strings.fastSeek] = fastSeek.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _action = ReadWriteAttribute(jsObject: object, name: Strings.action) + _seekOffset = ReadWriteAttribute(jsObject: object, name: Strings.seekOffset) + _seekTime = ReadWriteAttribute(jsObject: object, name: Strings.seekTime) + _fastSeek = ReadWriteAttribute(jsObject: object, name: Strings.fastSeek) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var action: MediaSessionAction + + @ReadWriteAttribute + public var seekOffset: Double? + + @ReadWriteAttribute + public var seekTime: Double? + + @ReadWriteAttribute + public var fastSeek: Bool? +} diff --git a/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift b/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift new file mode 100644 index 00000000..a281c116 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaSessionPlaybackState: JSString, JSValueCompatible { + case none = "none" + case paused = "paused" + case playing = "playing" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaSettingsRange.swift b/Sources/DOMKit/WebIDL/MediaSettingsRange.swift new file mode 100644 index 00000000..46e65430 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaSettingsRange.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaSettingsRange: BridgedDictionary { + public convenience init(max: Double, min: Double, step: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.max] = max.jsValue() + object[Strings.min] = min.jsValue() + object[Strings.step] = step.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) + _step = ReadWriteAttribute(jsObject: object, name: Strings.step) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var max: Double + + @ReadWriteAttribute + public var min: Double + + @ReadWriteAttribute + public var step: Double +} diff --git a/Sources/DOMKit/WebIDL/MediaSource.swift b/Sources/DOMKit/WebIDL/MediaSource.swift new file mode 100644 index 00000000..5af72afc --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaSource.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaSource: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaSource].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _sourceBuffers = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffers) + _activeSourceBuffers = ReadonlyAttribute(jsObject: jsObject, name: Strings.activeSourceBuffers) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _duration = ReadWriteAttribute(jsObject: jsObject, name: Strings.duration) + _onsourceopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsourceopen) + _onsourceended = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsourceended) + _onsourceclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsourceclose) + _canConstructInDedicatedWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.canConstructInDedicatedWorker) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var sourceBuffers: SourceBufferList + + @ReadonlyAttribute + public var activeSourceBuffers: SourceBufferList + + @ReadonlyAttribute + public var readyState: ReadyState + + @ReadWriteAttribute + public var duration: Double + + @ClosureAttribute.Optional1 + public var onsourceopen: EventHandler + + @ClosureAttribute.Optional1 + public var onsourceended: EventHandler + + @ClosureAttribute.Optional1 + public var onsourceclose: EventHandler + + @ReadonlyAttribute + public var canConstructInDedicatedWorker: Bool + + public func addSourceBuffer(type: String) -> SourceBuffer { + jsObject[Strings.addSourceBuffer]!(type.jsValue()).fromJSValue()! + } + + public func removeSourceBuffer(sourceBuffer: SourceBuffer) { + _ = jsObject[Strings.removeSourceBuffer]!(sourceBuffer.jsValue()) + } + + public func endOfStream(error: EndOfStreamError? = nil) { + _ = jsObject[Strings.endOfStream]!(error?.jsValue() ?? .undefined) + } + + public func setLiveSeekableRange(start: Double, end: Double) { + _ = jsObject[Strings.setLiveSeekableRange]!(start.jsValue(), end.jsValue()) + } + + public func clearLiveSeekableRange() { + _ = jsObject[Strings.clearLiveSeekableRange]!() + } + + public static func isTypeSupported(type: String) -> Bool { + constructor[Strings.isTypeSupported]!(type.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/MediaStream.swift b/Sources/DOMKit/WebIDL/MediaStream.swift new file mode 100644 index 00000000..ffb1b491 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStream.swift @@ -0,0 +1,68 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStream: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaStream].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _active = ReadonlyAttribute(jsObject: jsObject, name: Strings.active) + _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddtrack) + _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovetrack) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + public convenience init(stream: MediaStream) { + self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue())) + } + + public convenience init(tracks: [MediaStreamTrack]) { + self.init(unsafelyWrapping: Self.constructor.new(tracks.jsValue())) + } + + @ReadonlyAttribute + public var id: String + + public func getAudioTracks() -> [MediaStreamTrack] { + jsObject[Strings.getAudioTracks]!().fromJSValue()! + } + + public func getVideoTracks() -> [MediaStreamTrack] { + jsObject[Strings.getVideoTracks]!().fromJSValue()! + } + + public func getTracks() -> [MediaStreamTrack] { + jsObject[Strings.getTracks]!().fromJSValue()! + } + + public func getTrackById(trackId: String) -> MediaStreamTrack? { + jsObject[Strings.getTrackById]!(trackId.jsValue()).fromJSValue()! + } + + public func addTrack(track: MediaStreamTrack) { + _ = jsObject[Strings.addTrack]!(track.jsValue()) + } + + public func removeTrack(track: MediaStreamTrack) { + _ = jsObject[Strings.removeTrack]!(track.jsValue()) + } + + public func clone() -> Self { + jsObject[Strings.clone]!().fromJSValue()! + } + + @ReadonlyAttribute + public var active: Bool + + @ClosureAttribute.Optional1 + public var onaddtrack: EventHandler + + @ClosureAttribute.Optional1 + public var onremovetrack: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift new file mode 100644 index 00000000..48f8a297 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamAudioDestinationNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamAudioDestinationNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _stream = ReadonlyAttribute(jsObject: jsObject, name: Strings.stream) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: AudioContext, options: AudioNodeOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var stream: MediaStream +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift new file mode 100644 index 00000000..40c5e835 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamAudioSourceNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamAudioSourceNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _mediaStream = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaStream) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: AudioContext, options: MediaStreamAudioSourceOptions) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options.jsValue())) + } + + @ReadonlyAttribute + public var mediaStream: MediaStream +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift new file mode 100644 index 00000000..5ac15938 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamAudioSourceOptions: BridgedDictionary { + public convenience init(mediaStream: MediaStream) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mediaStream] = mediaStream.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mediaStream = ReadWriteAttribute(jsObject: object, name: Strings.mediaStream) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mediaStream: MediaStream +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift new file mode 100644 index 00000000..47b2b01a --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamConstraints: BridgedDictionary { + public convenience init(preferCurrentTab: Bool, peerIdentity: String, video: __UNSUPPORTED_UNION__, audio: __UNSUPPORTED_UNION__) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.preferCurrentTab] = preferCurrentTab.jsValue() + object[Strings.peerIdentity] = peerIdentity.jsValue() + object[Strings.video] = video.jsValue() + object[Strings.audio] = audio.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _preferCurrentTab = ReadWriteAttribute(jsObject: object, name: Strings.preferCurrentTab) + _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) + _video = ReadWriteAttribute(jsObject: object, name: Strings.video) + _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var preferCurrentTab: Bool + + @ReadWriteAttribute + public var peerIdentity: String + + @ReadWriteAttribute + public var video: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var audio: __UNSUPPORTED_UNION__ +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift new file mode 100644 index 00000000..652ed602 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift @@ -0,0 +1,90 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamTrack: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrack].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _contentHint = ReadWriteAttribute(jsObject: jsObject, name: Strings.contentHint) + _isolated = ReadonlyAttribute(jsObject: jsObject, name: Strings.isolated) + _onisolationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onisolationchange) + _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 = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmute) + _onunmute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onunmute) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _onended = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onended) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var contentHint: String + + @ReadonlyAttribute + public var isolated: Bool + + @ClosureAttribute.Optional1 + public var onisolationchange: EventHandler + + @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 + + @ClosureAttribute.Optional1 + public var onmute: EventHandler + + @ClosureAttribute.Optional1 + public var onunmute: EventHandler + + @ReadonlyAttribute + public var readyState: MediaStreamTrackState + + @ClosureAttribute.Optional1 + public var onended: EventHandler + + public func clone() -> Self { + jsObject[Strings.clone]!().fromJSValue()! + } + + public func stop() { + _ = jsObject[Strings.stop]!() + } + + public func getCapabilities() -> MediaTrackCapabilities { + jsObject[Strings.getCapabilities]!().fromJSValue()! + } + + public func getConstraints() -> MediaTrackConstraints { + jsObject[Strings.getConstraints]!().fromJSValue()! + } + + public func getSettings() -> MediaTrackSettings { + jsObject[Strings.getSettings]!().fromJSValue()! + } + + public func applyConstraints(constraints: MediaTrackConstraints? = nil) -> JSPromise { + jsObject[Strings.applyConstraints]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func applyConstraints(constraints: MediaTrackConstraints? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.applyConstraints]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift new file mode 100644 index 00000000..4f868846 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamTrackAudioSourceNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackAudioSourceNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: AudioContext, options: MediaStreamTrackAudioSourceOptions) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options.jsValue())) + } +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift new file mode 100644 index 00000000..44407389 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamTrackAudioSourceOptions: BridgedDictionary { + public convenience init(mediaStreamTrack: MediaStreamTrack) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mediaStreamTrack] = mediaStreamTrack.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mediaStreamTrack = ReadWriteAttribute(jsObject: object, name: Strings.mediaStreamTrack) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mediaStreamTrack: MediaStreamTrack +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift new file mode 100644 index 00000000..49dde61b --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamTrackEvent: Event { + 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) + } + + public convenience init(type: String, eventInitDict: MediaStreamTrackEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var track: MediaStreamTrack +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift new file mode 100644 index 00000000..51a51a69 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift new file mode 100644 index 00000000..b22f23c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamTrackProcessor: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackProcessor].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _readable = ReadWriteAttribute(jsObject: jsObject, name: Strings.readable) + self.jsObject = jsObject + } + + public convenience init(init: MediaStreamTrackProcessorInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadWriteAttribute + public var readable: ReadableStream +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift new file mode 100644 index 00000000..05070da2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaStreamTrackProcessorInit: BridgedDictionary { + public convenience init(track: MediaStreamTrack, maxBufferSize: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.track] = track.jsValue() + object[Strings.maxBufferSize] = maxBufferSize.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _track = ReadWriteAttribute(jsObject: object, name: Strings.track) + _maxBufferSize = ReadWriteAttribute(jsObject: object, name: Strings.maxBufferSize) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var track: MediaStreamTrack + + @ReadWriteAttribute + public var maxBufferSize: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift new file mode 100644 index 00000000..1661678a --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MediaStreamTrackState: JSString, JSValueCompatible { + case live = "live" + case ended = "ended" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift new file mode 100644 index 00000000..119e9f98 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift @@ -0,0 +1,185 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaTrackCapabilities: BridgedDictionary { + public convenience init(whiteBalanceMode: [String], exposureMode: [String], focusMode: [String], exposureCompensation: MediaSettingsRange, exposureTime: MediaSettingsRange, colorTemperature: MediaSettingsRange, iso: MediaSettingsRange, brightness: MediaSettingsRange, contrast: MediaSettingsRange, saturation: MediaSettingsRange, sharpness: MediaSettingsRange, focusDistance: MediaSettingsRange, pan: MediaSettingsRange, tilt: MediaSettingsRange, zoom: MediaSettingsRange, torch: Bool, displaySurface: String, logicalSurface: Bool, cursor: [String], 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.whiteBalanceMode] = whiteBalanceMode.jsValue() + object[Strings.exposureMode] = exposureMode.jsValue() + object[Strings.focusMode] = focusMode.jsValue() + object[Strings.exposureCompensation] = exposureCompensation.jsValue() + object[Strings.exposureTime] = exposureTime.jsValue() + object[Strings.colorTemperature] = colorTemperature.jsValue() + object[Strings.iso] = iso.jsValue() + object[Strings.brightness] = brightness.jsValue() + object[Strings.contrast] = contrast.jsValue() + object[Strings.saturation] = saturation.jsValue() + object[Strings.sharpness] = sharpness.jsValue() + object[Strings.focusDistance] = focusDistance.jsValue() + object[Strings.pan] = pan.jsValue() + object[Strings.tilt] = tilt.jsValue() + object[Strings.zoom] = zoom.jsValue() + object[Strings.torch] = torch.jsValue() + object[Strings.displaySurface] = displaySurface.jsValue() + object[Strings.logicalSurface] = logicalSurface.jsValue() + object[Strings.cursor] = cursor.jsValue() + 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) { + _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) + _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) + _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) + _exposureCompensation = ReadWriteAttribute(jsObject: object, name: Strings.exposureCompensation) + _exposureTime = ReadWriteAttribute(jsObject: object, name: Strings.exposureTime) + _colorTemperature = ReadWriteAttribute(jsObject: object, name: Strings.colorTemperature) + _iso = ReadWriteAttribute(jsObject: object, name: Strings.iso) + _brightness = ReadWriteAttribute(jsObject: object, name: Strings.brightness) + _contrast = ReadWriteAttribute(jsObject: object, name: Strings.contrast) + _saturation = ReadWriteAttribute(jsObject: object, name: Strings.saturation) + _sharpness = ReadWriteAttribute(jsObject: object, name: Strings.sharpness) + _focusDistance = ReadWriteAttribute(jsObject: object, name: Strings.focusDistance) + _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) + _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) + _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) + _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) + _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) + _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) + _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) + _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 whiteBalanceMode: [String] + + @ReadWriteAttribute + public var exposureMode: [String] + + @ReadWriteAttribute + public var focusMode: [String] + + @ReadWriteAttribute + public var exposureCompensation: MediaSettingsRange + + @ReadWriteAttribute + public var exposureTime: MediaSettingsRange + + @ReadWriteAttribute + public var colorTemperature: MediaSettingsRange + + @ReadWriteAttribute + public var iso: MediaSettingsRange + + @ReadWriteAttribute + public var brightness: MediaSettingsRange + + @ReadWriteAttribute + public var contrast: MediaSettingsRange + + @ReadWriteAttribute + public var saturation: MediaSettingsRange + + @ReadWriteAttribute + public var sharpness: MediaSettingsRange + + @ReadWriteAttribute + public var focusDistance: MediaSettingsRange + + @ReadWriteAttribute + public var pan: MediaSettingsRange + + @ReadWriteAttribute + public var tilt: MediaSettingsRange + + @ReadWriteAttribute + public var zoom: MediaSettingsRange + + @ReadWriteAttribute + public var torch: Bool + + @ReadWriteAttribute + public var displaySurface: String + + @ReadWriteAttribute + public var logicalSurface: Bool + + @ReadWriteAttribute + public var cursor: [String] + + @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 +} diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift new file mode 100644 index 00000000..e0a7f281 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift @@ -0,0 +1,200 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaTrackConstraintSet: BridgedDictionary { + public convenience init(whiteBalanceMode: ConstrainDOMString, exposureMode: ConstrainDOMString, focusMode: ConstrainDOMString, pointsOfInterest: ConstrainPoint2D, exposureCompensation: ConstrainDouble, exposureTime: ConstrainDouble, colorTemperature: ConstrainDouble, iso: ConstrainDouble, brightness: ConstrainDouble, contrast: ConstrainDouble, saturation: ConstrainDouble, sharpness: ConstrainDouble, focusDistance: ConstrainDouble, pan: __UNSUPPORTED_UNION__, tilt: __UNSUPPORTED_UNION__, zoom: __UNSUPPORTED_UNION__, torch: ConstrainBoolean, displaySurface: ConstrainDOMString, logicalSurface: ConstrainBoolean, cursor: ConstrainDOMString, restrictOwnAudio: ConstrainBoolean, suppressLocalAudioPlayback: ConstrainBoolean, 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.whiteBalanceMode] = whiteBalanceMode.jsValue() + object[Strings.exposureMode] = exposureMode.jsValue() + object[Strings.focusMode] = focusMode.jsValue() + object[Strings.pointsOfInterest] = pointsOfInterest.jsValue() + object[Strings.exposureCompensation] = exposureCompensation.jsValue() + object[Strings.exposureTime] = exposureTime.jsValue() + object[Strings.colorTemperature] = colorTemperature.jsValue() + object[Strings.iso] = iso.jsValue() + object[Strings.brightness] = brightness.jsValue() + object[Strings.contrast] = contrast.jsValue() + object[Strings.saturation] = saturation.jsValue() + object[Strings.sharpness] = sharpness.jsValue() + object[Strings.focusDistance] = focusDistance.jsValue() + object[Strings.pan] = pan.jsValue() + object[Strings.tilt] = tilt.jsValue() + object[Strings.zoom] = zoom.jsValue() + object[Strings.torch] = torch.jsValue() + object[Strings.displaySurface] = displaySurface.jsValue() + object[Strings.logicalSurface] = logicalSurface.jsValue() + object[Strings.cursor] = cursor.jsValue() + object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue() + object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue() + 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) { + _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) + _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) + _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) + _pointsOfInterest = ReadWriteAttribute(jsObject: object, name: Strings.pointsOfInterest) + _exposureCompensation = ReadWriteAttribute(jsObject: object, name: Strings.exposureCompensation) + _exposureTime = ReadWriteAttribute(jsObject: object, name: Strings.exposureTime) + _colorTemperature = ReadWriteAttribute(jsObject: object, name: Strings.colorTemperature) + _iso = ReadWriteAttribute(jsObject: object, name: Strings.iso) + _brightness = ReadWriteAttribute(jsObject: object, name: Strings.brightness) + _contrast = ReadWriteAttribute(jsObject: object, name: Strings.contrast) + _saturation = ReadWriteAttribute(jsObject: object, name: Strings.saturation) + _sharpness = ReadWriteAttribute(jsObject: object, name: Strings.sharpness) + _focusDistance = ReadWriteAttribute(jsObject: object, name: Strings.focusDistance) + _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) + _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) + _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) + _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) + _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) + _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) + _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) + _restrictOwnAudio = ReadWriteAttribute(jsObject: object, name: Strings.restrictOwnAudio) + _suppressLocalAudioPlayback = ReadWriteAttribute(jsObject: object, name: Strings.suppressLocalAudioPlayback) + _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 whiteBalanceMode: ConstrainDOMString + + @ReadWriteAttribute + public var exposureMode: ConstrainDOMString + + @ReadWriteAttribute + public var focusMode: ConstrainDOMString + + @ReadWriteAttribute + public var pointsOfInterest: ConstrainPoint2D + + @ReadWriteAttribute + public var exposureCompensation: ConstrainDouble + + @ReadWriteAttribute + public var exposureTime: ConstrainDouble + + @ReadWriteAttribute + public var colorTemperature: ConstrainDouble + + @ReadWriteAttribute + public var iso: ConstrainDouble + + @ReadWriteAttribute + public var brightness: ConstrainDouble + + @ReadWriteAttribute + public var contrast: ConstrainDouble + + @ReadWriteAttribute + public var saturation: ConstrainDouble + + @ReadWriteAttribute + public var sharpness: ConstrainDouble + + @ReadWriteAttribute + public var focusDistance: ConstrainDouble + + @ReadWriteAttribute + public var pan: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var tilt: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var zoom: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var torch: ConstrainBoolean + + @ReadWriteAttribute + public var displaySurface: ConstrainDOMString + + @ReadWriteAttribute + public var logicalSurface: ConstrainBoolean + + @ReadWriteAttribute + public var cursor: ConstrainDOMString + + @ReadWriteAttribute + public var restrictOwnAudio: ConstrainBoolean + + @ReadWriteAttribute + public var suppressLocalAudioPlayback: ConstrainBoolean + + @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 +} diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift new file mode 100644 index 00000000..41b7299f --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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] +} diff --git a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift new file mode 100644 index 00000000..b81bf68d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift @@ -0,0 +1,195 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaTrackSettings: BridgedDictionary { + public convenience init(whiteBalanceMode: String, exposureMode: String, focusMode: String, pointsOfInterest: [Point2D], exposureCompensation: Double, exposureTime: Double, colorTemperature: Double, iso: Double, brightness: Double, contrast: Double, saturation: Double, sharpness: Double, focusDistance: Double, pan: Double, tilt: Double, zoom: Double, torch: Bool, displaySurface: String, logicalSurface: Bool, cursor: String, restrictOwnAudio: Bool, 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.whiteBalanceMode] = whiteBalanceMode.jsValue() + object[Strings.exposureMode] = exposureMode.jsValue() + object[Strings.focusMode] = focusMode.jsValue() + object[Strings.pointsOfInterest] = pointsOfInterest.jsValue() + object[Strings.exposureCompensation] = exposureCompensation.jsValue() + object[Strings.exposureTime] = exposureTime.jsValue() + object[Strings.colorTemperature] = colorTemperature.jsValue() + object[Strings.iso] = iso.jsValue() + object[Strings.brightness] = brightness.jsValue() + object[Strings.contrast] = contrast.jsValue() + object[Strings.saturation] = saturation.jsValue() + object[Strings.sharpness] = sharpness.jsValue() + object[Strings.focusDistance] = focusDistance.jsValue() + object[Strings.pan] = pan.jsValue() + object[Strings.tilt] = tilt.jsValue() + object[Strings.zoom] = zoom.jsValue() + object[Strings.torch] = torch.jsValue() + object[Strings.displaySurface] = displaySurface.jsValue() + object[Strings.logicalSurface] = logicalSurface.jsValue() + object[Strings.cursor] = cursor.jsValue() + object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue() + 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) { + _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) + _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) + _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) + _pointsOfInterest = ReadWriteAttribute(jsObject: object, name: Strings.pointsOfInterest) + _exposureCompensation = ReadWriteAttribute(jsObject: object, name: Strings.exposureCompensation) + _exposureTime = ReadWriteAttribute(jsObject: object, name: Strings.exposureTime) + _colorTemperature = ReadWriteAttribute(jsObject: object, name: Strings.colorTemperature) + _iso = ReadWriteAttribute(jsObject: object, name: Strings.iso) + _brightness = ReadWriteAttribute(jsObject: object, name: Strings.brightness) + _contrast = ReadWriteAttribute(jsObject: object, name: Strings.contrast) + _saturation = ReadWriteAttribute(jsObject: object, name: Strings.saturation) + _sharpness = ReadWriteAttribute(jsObject: object, name: Strings.sharpness) + _focusDistance = ReadWriteAttribute(jsObject: object, name: Strings.focusDistance) + _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) + _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) + _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) + _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) + _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) + _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) + _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) + _restrictOwnAudio = ReadWriteAttribute(jsObject: object, name: Strings.restrictOwnAudio) + _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 whiteBalanceMode: String + + @ReadWriteAttribute + public var exposureMode: String + + @ReadWriteAttribute + public var focusMode: String + + @ReadWriteAttribute + public var pointsOfInterest: [Point2D] + + @ReadWriteAttribute + public var exposureCompensation: Double + + @ReadWriteAttribute + public var exposureTime: Double + + @ReadWriteAttribute + public var colorTemperature: Double + + @ReadWriteAttribute + public var iso: Double + + @ReadWriteAttribute + public var brightness: Double + + @ReadWriteAttribute + public var contrast: Double + + @ReadWriteAttribute + public var saturation: Double + + @ReadWriteAttribute + public var sharpness: Double + + @ReadWriteAttribute + public var focusDistance: Double + + @ReadWriteAttribute + public var pan: Double + + @ReadWriteAttribute + public var tilt: Double + + @ReadWriteAttribute + public var zoom: Double + + @ReadWriteAttribute + public var torch: Bool + + @ReadWriteAttribute + public var displaySurface: String + + @ReadWriteAttribute + public var logicalSurface: Bool + + @ReadWriteAttribute + public var cursor: String + + @ReadWriteAttribute + public var restrictOwnAudio: Bool + + @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 +} diff --git a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift new file mode 100644 index 00000000..0b23641d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift @@ -0,0 +1,200 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MediaTrackSupportedConstraints: BridgedDictionary { + public convenience init(whiteBalanceMode: Bool, exposureMode: Bool, focusMode: Bool, pointsOfInterest: Bool, exposureCompensation: Bool, exposureTime: Bool, colorTemperature: Bool, iso: Bool, brightness: Bool, contrast: Bool, pan: Bool, saturation: Bool, sharpness: Bool, focusDistance: Bool, tilt: Bool, zoom: Bool, torch: Bool, displaySurface: Bool, logicalSurface: Bool, cursor: Bool, restrictOwnAudio: Bool, suppressLocalAudioPlayback: Bool, 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.whiteBalanceMode] = whiteBalanceMode.jsValue() + object[Strings.exposureMode] = exposureMode.jsValue() + object[Strings.focusMode] = focusMode.jsValue() + object[Strings.pointsOfInterest] = pointsOfInterest.jsValue() + object[Strings.exposureCompensation] = exposureCompensation.jsValue() + object[Strings.exposureTime] = exposureTime.jsValue() + object[Strings.colorTemperature] = colorTemperature.jsValue() + object[Strings.iso] = iso.jsValue() + object[Strings.brightness] = brightness.jsValue() + object[Strings.contrast] = contrast.jsValue() + object[Strings.pan] = pan.jsValue() + object[Strings.saturation] = saturation.jsValue() + object[Strings.sharpness] = sharpness.jsValue() + object[Strings.focusDistance] = focusDistance.jsValue() + object[Strings.tilt] = tilt.jsValue() + object[Strings.zoom] = zoom.jsValue() + object[Strings.torch] = torch.jsValue() + object[Strings.displaySurface] = displaySurface.jsValue() + object[Strings.logicalSurface] = logicalSurface.jsValue() + object[Strings.cursor] = cursor.jsValue() + object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue() + object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue() + 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) { + _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) + _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) + _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) + _pointsOfInterest = ReadWriteAttribute(jsObject: object, name: Strings.pointsOfInterest) + _exposureCompensation = ReadWriteAttribute(jsObject: object, name: Strings.exposureCompensation) + _exposureTime = ReadWriteAttribute(jsObject: object, name: Strings.exposureTime) + _colorTemperature = ReadWriteAttribute(jsObject: object, name: Strings.colorTemperature) + _iso = ReadWriteAttribute(jsObject: object, name: Strings.iso) + _brightness = ReadWriteAttribute(jsObject: object, name: Strings.brightness) + _contrast = ReadWriteAttribute(jsObject: object, name: Strings.contrast) + _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) + _saturation = ReadWriteAttribute(jsObject: object, name: Strings.saturation) + _sharpness = ReadWriteAttribute(jsObject: object, name: Strings.sharpness) + _focusDistance = ReadWriteAttribute(jsObject: object, name: Strings.focusDistance) + _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) + _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) + _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) + _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) + _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) + _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) + _restrictOwnAudio = ReadWriteAttribute(jsObject: object, name: Strings.restrictOwnAudio) + _suppressLocalAudioPlayback = ReadWriteAttribute(jsObject: object, name: Strings.suppressLocalAudioPlayback) + _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 whiteBalanceMode: Bool + + @ReadWriteAttribute + public var exposureMode: Bool + + @ReadWriteAttribute + public var focusMode: Bool + + @ReadWriteAttribute + public var pointsOfInterest: Bool + + @ReadWriteAttribute + public var exposureCompensation: Bool + + @ReadWriteAttribute + public var exposureTime: Bool + + @ReadWriteAttribute + public var colorTemperature: Bool + + @ReadWriteAttribute + public var iso: Bool + + @ReadWriteAttribute + public var brightness: Bool + + @ReadWriteAttribute + public var contrast: Bool + + @ReadWriteAttribute + public var pan: Bool + + @ReadWriteAttribute + public var saturation: Bool + + @ReadWriteAttribute + public var sharpness: Bool + + @ReadWriteAttribute + public var focusDistance: Bool + + @ReadWriteAttribute + public var tilt: Bool + + @ReadWriteAttribute + public var zoom: Bool + + @ReadWriteAttribute + public var torch: Bool + + @ReadWriteAttribute + public var displaySurface: Bool + + @ReadWriteAttribute + public var logicalSurface: Bool + + @ReadWriteAttribute + public var cursor: Bool + + @ReadWriteAttribute + public var restrictOwnAudio: Bool + + @ReadWriteAttribute + public var suppressLocalAudioPlayback: Bool + + @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 +} diff --git a/Sources/DOMKit/WebIDL/Memory.swift b/Sources/DOMKit/WebIDL/Memory.swift new file mode 100644 index 00000000..519d273d --- /dev/null +++ b/Sources/DOMKit/WebIDL/Memory.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Memory: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Memory].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _buffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.buffer) + self.jsObject = jsObject + } + + public convenience init(descriptor: MemoryDescriptor) { + self.init(unsafelyWrapping: Self.constructor.new(descriptor.jsValue())) + } + + public func grow(delta: UInt32) -> UInt32 { + jsObject[Strings.grow]!(delta.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var buffer: ArrayBuffer +} diff --git a/Sources/DOMKit/WebIDL/MemoryAttribution.swift b/Sources/DOMKit/WebIDL/MemoryAttribution.swift new file mode 100644 index 00000000..75212ae3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MemoryAttribution.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MemoryAttribution: BridgedDictionary { + public convenience init(url: String, container: MemoryAttributionContainer, scope: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.url] = url.jsValue() + object[Strings.container] = container.jsValue() + object[Strings.scope] = scope.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + _container = ReadWriteAttribute(jsObject: object, name: Strings.container) + _scope = ReadWriteAttribute(jsObject: object, name: Strings.scope) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var url: String + + @ReadWriteAttribute + public var container: MemoryAttributionContainer + + @ReadWriteAttribute + public var scope: String +} diff --git a/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift b/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift new file mode 100644 index 00000000..c28b66fd --- /dev/null +++ b/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MemoryAttributionContainer: BridgedDictionary { + public convenience init(id: String, src: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.id] = id.jsValue() + object[Strings.src] = src.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _src = ReadWriteAttribute(jsObject: object, name: Strings.src) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var src: String +} diff --git a/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift b/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift new file mode 100644 index 00000000..968f5b71 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MemoryBreakdownEntry: BridgedDictionary { + public convenience init(bytes: UInt64, attribution: [MemoryAttribution], types: [String]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.bytes] = bytes.jsValue() + object[Strings.attribution] = attribution.jsValue() + object[Strings.types] = types.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _bytes = ReadWriteAttribute(jsObject: object, name: Strings.bytes) + _attribution = ReadWriteAttribute(jsObject: object, name: Strings.attribution) + _types = ReadWriteAttribute(jsObject: object, name: Strings.types) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var bytes: UInt64 + + @ReadWriteAttribute + public var attribution: [MemoryAttribution] + + @ReadWriteAttribute + public var types: [String] +} diff --git a/Sources/DOMKit/WebIDL/MemoryDescriptor.swift b/Sources/DOMKit/WebIDL/MemoryDescriptor.swift new file mode 100644 index 00000000..67809d2e --- /dev/null +++ b/Sources/DOMKit/WebIDL/MemoryDescriptor.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MemoryDescriptor: BridgedDictionary { + public convenience init(initial: UInt32, maximum: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.initial] = initial.jsValue() + object[Strings.maximum] = maximum.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _initial = ReadWriteAttribute(jsObject: object, name: Strings.initial) + _maximum = ReadWriteAttribute(jsObject: object, name: Strings.maximum) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var initial: UInt32 + + @ReadWriteAttribute + public var maximum: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/MemoryMeasurement.swift b/Sources/DOMKit/WebIDL/MemoryMeasurement.swift new file mode 100644 index 00000000..44a93e91 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MemoryMeasurement.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MemoryMeasurement: BridgedDictionary { + public convenience init(bytes: UInt64, breakdown: [MemoryBreakdownEntry]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.bytes] = bytes.jsValue() + object[Strings.breakdown] = breakdown.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _bytes = ReadWriteAttribute(jsObject: object, name: Strings.bytes) + _breakdown = ReadWriteAttribute(jsObject: object, name: Strings.breakdown) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var bytes: UInt64 + + @ReadWriteAttribute + public var breakdown: [MemoryBreakdownEntry] +} diff --git a/Sources/DOMKit/WebIDL/MessageChannel.swift b/Sources/DOMKit/WebIDL/MessageChannel.swift index fc5f5e4a..477d7f6f 100644 --- a/Sources/DOMKit/WebIDL/MessageChannel.swift +++ b/Sources/DOMKit/WebIDL/MessageChannel.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MessageChannel: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.MessageChannel.function! } + public class var constructor: JSFunction { JSObject.global[Strings.MessageChannel].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift index 7ef0748f..d3e0bf9c 100644 --- a/Sources/DOMKit/WebIDL/MessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MessageEvent: Event { - override public class var constructor: JSFunction { JSObject.global.MessageEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.MessageEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) diff --git a/Sources/DOMKit/WebIDL/MessageEventInit.swift b/Sources/DOMKit/WebIDL/MessageEventInit.swift index 47707951..02a7a91a 100644 --- a/Sources/DOMKit/WebIDL/MessageEventInit.swift +++ b/Sources/DOMKit/WebIDL/MessageEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class MessageEventInit: BridgedDictionary { public convenience init(data: JSValue, origin: String, lastEventId: String, source: MessageEventSource?, ports: [MessagePort]) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.data] = data.jsValue() object[Strings.origin] = origin.jsValue() object[Strings.lastEventId] = lastEventId.jsValue() diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift index 98f5bd3b..bb196497 100644 --- a/Sources/DOMKit/WebIDL/MessagePort.swift +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MessagePort: EventTarget { - override public class var constructor: JSFunction { JSObject.global.MessagePort.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.MessagePort].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) diff --git a/Sources/DOMKit/WebIDL/MeteringMode.swift b/Sources/DOMKit/WebIDL/MeteringMode.swift new file mode 100644 index 00000000..030e5027 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MeteringMode.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MeteringMode: JSString, JSValueCompatible { + case none = "none" + case manual = "manual" + case singleShot = "single-shot" + case continuous = "continuous" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift new file mode 100644 index 00000000..2d27a8cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MidiPermissionDescriptor: BridgedDictionary { + public convenience init(sysex: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.sysex] = sysex.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _sysex = ReadWriteAttribute(jsObject: object, name: Strings.sysex) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var sysex: Bool +} diff --git a/Sources/DOMKit/WebIDL/MimeType.swift b/Sources/DOMKit/WebIDL/MimeType.swift index 28f25412..826f5c0a 100644 --- a/Sources/DOMKit/WebIDL/MimeType.swift +++ b/Sources/DOMKit/WebIDL/MimeType.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MimeType: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.MimeType.function! } + public class var constructor: JSFunction { JSObject.global[Strings.MimeType].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MimeTypeArray.swift b/Sources/DOMKit/WebIDL/MimeTypeArray.swift index 25ea90a0..edaa928d 100644 --- a/Sources/DOMKit/WebIDL/MimeTypeArray.swift +++ b/Sources/DOMKit/WebIDL/MimeTypeArray.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MimeTypeArray: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.MimeTypeArray.function! } + public class var constructor: JSFunction { JSObject.global[Strings.MimeTypeArray].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift b/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift new file mode 100644 index 00000000..5c38cebf --- /dev/null +++ b/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MockCameraConfiguration: BridgedDictionary { + public convenience init(defaultFrameRate: Double, facingMode: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.defaultFrameRate] = defaultFrameRate.jsValue() + object[Strings.facingMode] = facingMode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _defaultFrameRate = ReadWriteAttribute(jsObject: object, name: Strings.defaultFrameRate) + _facingMode = ReadWriteAttribute(jsObject: object, name: Strings.facingMode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var defaultFrameRate: Double + + @ReadWriteAttribute + public var facingMode: String +} diff --git a/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift b/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift new file mode 100644 index 00000000..aebbecae --- /dev/null +++ b/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MockCaptureDeviceConfiguration: BridgedDictionary { + public convenience init(label: String, deviceId: String, groupId: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.label] = label.jsValue() + object[Strings.deviceId] = deviceId.jsValue() + object[Strings.groupId] = groupId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _label = ReadWriteAttribute(jsObject: object, name: Strings.label) + _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) + _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var label: String + + @ReadWriteAttribute + public var deviceId: String + + @ReadWriteAttribute + public var groupId: String +} diff --git a/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift b/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift new file mode 100644 index 00000000..e08d060c --- /dev/null +++ b/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MockCapturePromptResult: JSString, JSValueCompatible { + case granted = "granted" + case denied = "denied" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift b/Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift new file mode 100644 index 00000000..3e7c49e2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MockCapturePromptResultConfiguration: BridgedDictionary { + public convenience init(getUserMedia: MockCapturePromptResult, getDisplayMedia: MockCapturePromptResult) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.getUserMedia] = getUserMedia.jsValue() + object[Strings.getDisplayMedia] = getDisplayMedia.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _getUserMedia = ReadWriteAttribute(jsObject: object, name: Strings.getUserMedia) + _getDisplayMedia = ReadWriteAttribute(jsObject: object, name: Strings.getDisplayMedia) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var getUserMedia: MockCapturePromptResult + + @ReadWriteAttribute + public var getDisplayMedia: MockCapturePromptResult +} diff --git a/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift b/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift new file mode 100644 index 00000000..504ed877 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MockMicrophoneConfiguration: BridgedDictionary { + public convenience init(defaultSampleRate: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.defaultSampleRate] = defaultSampleRate.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _defaultSampleRate = ReadWriteAttribute(jsObject: object, name: Strings.defaultSampleRate) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var defaultSampleRate: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/MockSensor.swift b/Sources/DOMKit/WebIDL/MockSensor.swift new file mode 100644 index 00000000..713e27a0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MockSensor.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MockSensor: BridgedDictionary { + public convenience init(maxSamplingFrequency: Double, minSamplingFrequency: Double, requestedSamplingFrequency: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.maxSamplingFrequency] = maxSamplingFrequency.jsValue() + object[Strings.minSamplingFrequency] = minSamplingFrequency.jsValue() + object[Strings.requestedSamplingFrequency] = requestedSamplingFrequency.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _maxSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.maxSamplingFrequency) + _minSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.minSamplingFrequency) + _requestedSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.requestedSamplingFrequency) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var maxSamplingFrequency: Double + + @ReadWriteAttribute + public var minSamplingFrequency: Double + + @ReadWriteAttribute + public var requestedSamplingFrequency: Double +} diff --git a/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift b/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift new file mode 100644 index 00000000..44205204 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MockSensorConfiguration: BridgedDictionary { + public convenience init(mockSensorType: MockSensorType, connected: Bool, maxSamplingFrequency: Double?, minSamplingFrequency: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mockSensorType] = mockSensorType.jsValue() + object[Strings.connected] = connected.jsValue() + object[Strings.maxSamplingFrequency] = maxSamplingFrequency.jsValue() + object[Strings.minSamplingFrequency] = minSamplingFrequency.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mockSensorType = ReadWriteAttribute(jsObject: object, name: Strings.mockSensorType) + _connected = ReadWriteAttribute(jsObject: object, name: Strings.connected) + _maxSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.maxSamplingFrequency) + _minSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.minSamplingFrequency) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mockSensorType: MockSensorType + + @ReadWriteAttribute + public var connected: Bool + + @ReadWriteAttribute + public var maxSamplingFrequency: Double? + + @ReadWriteAttribute + public var minSamplingFrequency: Double? +} diff --git a/Sources/DOMKit/WebIDL/MockSensorReadingValues.swift b/Sources/DOMKit/WebIDL/MockSensorReadingValues.swift new file mode 100644 index 00000000..7525ce5d --- /dev/null +++ b/Sources/DOMKit/WebIDL/MockSensorReadingValues.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MockSensorReadingValues: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/MockSensorType.swift b/Sources/DOMKit/WebIDL/MockSensorType.swift new file mode 100644 index 00000000..f20cdc71 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MockSensorType.swift @@ -0,0 +1,31 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum MockSensorType: JSString, JSValueCompatible { + case ambientLight = "ambient-light" + case accelerometer = "accelerometer" + case linearAcceleration = "linear-acceleration" + case gravity = "gravity" + case gyroscope = "gyroscope" + case magnetometer = "magnetometer" + case uncalibratedMagnetometer = "uncalibrated-magnetometer" + case absoluteOrientation = "absolute-orientation" + case relativeOrientation = "relative-orientation" + case geolocation = "geolocation" + case proximity = "proximity" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Module.swift b/Sources/DOMKit/WebIDL/Module.swift new file mode 100644 index 00000000..9ff48642 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Module.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Module: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Module].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(bytes: BufferSource) { + self.init(unsafelyWrapping: Self.constructor.new(bytes.jsValue())) + } + + public static func exports(moduleObject: Module) -> [ModuleExportDescriptor] { + constructor[Strings.exports]!(moduleObject.jsValue()).fromJSValue()! + } + + public static func imports(moduleObject: Module) -> [ModuleImportDescriptor] { + constructor[Strings.imports]!(moduleObject.jsValue()).fromJSValue()! + } + + public static func customSections(moduleObject: Module, sectionName: String) -> [ArrayBuffer] { + constructor[Strings.customSections]!(moduleObject.jsValue(), sectionName.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift b/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift new file mode 100644 index 00000000..3cfb04bf --- /dev/null +++ b/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ModuleExportDescriptor: BridgedDictionary { + public convenience init(name: String, kind: ImportExportKind) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.kind] = kind.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var kind: ImportExportKind +} diff --git a/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift b/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift new file mode 100644 index 00000000..e81eb254 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ModuleImportDescriptor: BridgedDictionary { + public convenience init(module: String, name: String, kind: ImportExportKind) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.module] = module.jsValue() + object[Strings.name] = name.jsValue() + object[Strings.kind] = kind.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _module = ReadWriteAttribute(jsObject: object, name: Strings.module) + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var module: String + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var kind: ImportExportKind +} diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index 6064c5c3..d5969832 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -4,9 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit public class MouseEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global.MouseEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.MouseEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _movementX = ReadonlyAttribute(jsObject: jsObject, name: Strings.movementX) + _movementY = ReadonlyAttribute(jsObject: jsObject, name: Strings.movementY) + _pageX = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageX) + _pageY = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageY) + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _offsetX = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetX) + _offsetY = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetY) _screenX = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenX) _screenY = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenY) _clientX = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientX) @@ -21,6 +29,30 @@ public class MouseEvent: UIEvent { super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var movementX: Double + + @ReadonlyAttribute + public var movementY: Double + + @ReadonlyAttribute + public var pageX: Double + + @ReadonlyAttribute + public var pageY: Double + + @ReadonlyAttribute + public var x: Double + + @ReadonlyAttribute + public var y: Double + + @ReadonlyAttribute + public var offsetX: Double + + @ReadonlyAttribute + public var offsetY: Double + public convenience init(type: String, eventInitDict: MouseEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } diff --git a/Sources/DOMKit/WebIDL/MouseEventInit.swift b/Sources/DOMKit/WebIDL/MouseEventInit.swift index 925934cc..032c83e2 100644 --- a/Sources/DOMKit/WebIDL/MouseEventInit.swift +++ b/Sources/DOMKit/WebIDL/MouseEventInit.swift @@ -4,8 +4,10 @@ import JavaScriptEventLoop import JavaScriptKit public class MouseEventInit: BridgedDictionary { - public convenience init(screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { - let object = JSObject.global.Object.function!.new() + public convenience init(movementX: Double, movementY: Double, screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.movementX] = movementX.jsValue() + object[Strings.movementY] = movementY.jsValue() object[Strings.screenX] = screenX.jsValue() object[Strings.screenY] = screenY.jsValue() object[Strings.clientX] = clientX.jsValue() @@ -17,6 +19,8 @@ public class MouseEventInit: BridgedDictionary { } public required init(unsafelyWrapping object: JSObject) { + _movementX = ReadWriteAttribute(jsObject: object, name: Strings.movementX) + _movementY = ReadWriteAttribute(jsObject: object, name: Strings.movementY) _screenX = ReadWriteAttribute(jsObject: object, name: Strings.screenX) _screenY = ReadWriteAttribute(jsObject: object, name: Strings.screenY) _clientX = ReadWriteAttribute(jsObject: object, name: Strings.clientX) @@ -27,6 +31,12 @@ public class MouseEventInit: BridgedDictionary { super.init(unsafelyWrapping: object) } + @ReadWriteAttribute + public var movementX: Double + + @ReadWriteAttribute + public var movementY: Double + @ReadWriteAttribute public var screenX: Int32 diff --git a/Sources/DOMKit/WebIDL/MultiCacheQueryOptions.swift b/Sources/DOMKit/WebIDL/MultiCacheQueryOptions.swift new file mode 100644 index 00000000..07f4abac --- /dev/null +++ b/Sources/DOMKit/WebIDL/MultiCacheQueryOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class MultiCacheQueryOptions: BridgedDictionary { + public convenience init(cacheName: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.cacheName] = cacheName.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _cacheName = ReadWriteAttribute(jsObject: object, name: Strings.cacheName) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var cacheName: String +} diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift index 7ed5b139..5ebb7996 100644 --- a/Sources/DOMKit/WebIDL/MutationEvent.swift +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MutationEvent: Event { - override public class var constructor: JSFunction { JSObject.global.MutationEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.MutationEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _relatedNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedNode) diff --git a/Sources/DOMKit/WebIDL/MutationObserver.swift b/Sources/DOMKit/WebIDL/MutationObserver.swift index 8fcc66cf..7a0d68e1 100644 --- a/Sources/DOMKit/WebIDL/MutationObserver.swift +++ b/Sources/DOMKit/WebIDL/MutationObserver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MutationObserver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.MutationObserver.function! } + public class var constructor: JSFunction { JSObject.global[Strings.MutationObserver].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MutationObserverInit.swift b/Sources/DOMKit/WebIDL/MutationObserverInit.swift index 6435f166..289eb900 100644 --- a/Sources/DOMKit/WebIDL/MutationObserverInit.swift +++ b/Sources/DOMKit/WebIDL/MutationObserverInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class MutationObserverInit: BridgedDictionary { public convenience init(childList: Bool, attributes: Bool, characterData: Bool, subtree: Bool, attributeOldValue: Bool, characterDataOldValue: Bool, attributeFilter: [String]) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.childList] = childList.jsValue() object[Strings.attributes] = attributes.jsValue() object[Strings.characterData] = characterData.jsValue() diff --git a/Sources/DOMKit/WebIDL/MutationRecord.swift b/Sources/DOMKit/WebIDL/MutationRecord.swift index cc66604a..9f783a39 100644 --- a/Sources/DOMKit/WebIDL/MutationRecord.swift +++ b/Sources/DOMKit/WebIDL/MutationRecord.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MutationRecord: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.MutationRecord.function! } + public class var constructor: JSFunction { JSObject.global[Strings.MutationRecord].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift b/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift new file mode 100644 index 00000000..b6e270f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFMakeReadOnlyOptions: BridgedDictionary { + public convenience init(signal: AbortSignal?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.signal] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var signal: AbortSignal? +} diff --git a/Sources/DOMKit/WebIDL/NDEFMessage.swift b/Sources/DOMKit/WebIDL/NDEFMessage.swift new file mode 100644 index 00000000..f4ed9e3b --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFMessage.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFMessage: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.NDEFMessage].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _records = ReadonlyAttribute(jsObject: jsObject, name: Strings.records) + self.jsObject = jsObject + } + + public convenience init(messageInit: NDEFMessageInit) { + self.init(unsafelyWrapping: Self.constructor.new(messageInit.jsValue())) + } + + @ReadonlyAttribute + public var records: [NDEFRecord] +} diff --git a/Sources/DOMKit/WebIDL/NDEFMessageInit.swift b/Sources/DOMKit/WebIDL/NDEFMessageInit.swift new file mode 100644 index 00000000..712af7cf --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFMessageInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFMessageInit: BridgedDictionary { + public convenience init(records: [NDEFRecordInit]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.records] = records.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _records = ReadWriteAttribute(jsObject: object, name: Strings.records) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var records: [NDEFRecordInit] +} diff --git a/Sources/DOMKit/WebIDL/NDEFReader.swift b/Sources/DOMKit/WebIDL/NDEFReader.swift new file mode 100644 index 00000000..976d8480 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFReader.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFReader: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.NDEFReader].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onreading = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreading) + _onreadingerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreadingerror) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ClosureAttribute.Optional1 + public var onreading: EventHandler + + @ClosureAttribute.Optional1 + public var onreadingerror: EventHandler + + public func scan(options: NDEFScanOptions? = nil) -> JSPromise { + jsObject[Strings.scan]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func scan(options: NDEFScanOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.scan]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) -> JSPromise { + jsObject[Strings.write]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.write]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) -> JSPromise { + jsObject[Strings.makeReadOnly]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.makeReadOnly]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift b/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift new file mode 100644 index 00000000..01327c0e --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFReadingEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.NDEFReadingEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _serialNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.serialNumber) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, readingEventInitDict: NDEFReadingEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), readingEventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var serialNumber: String + + @ReadonlyAttribute + public var message: NDEFMessage +} diff --git a/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift b/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift new file mode 100644 index 00000000..80241ae1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFReadingEventInit: BridgedDictionary { + public convenience init(serialNumber: String?, message: NDEFMessageInit) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.serialNumber] = serialNumber.jsValue() + object[Strings.message] = message.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _serialNumber = ReadWriteAttribute(jsObject: object, name: Strings.serialNumber) + _message = ReadWriteAttribute(jsObject: object, name: Strings.message) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var serialNumber: String? + + @ReadWriteAttribute + public var message: NDEFMessageInit +} diff --git a/Sources/DOMKit/WebIDL/NDEFRecord.swift b/Sources/DOMKit/WebIDL/NDEFRecord.swift new file mode 100644 index 00000000..daff7fc9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFRecord.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFRecord: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.NDEFRecord].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _recordType = ReadonlyAttribute(jsObject: jsObject, name: Strings.recordType) + _mediaType = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaType) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _encoding = ReadonlyAttribute(jsObject: jsObject, name: Strings.encoding) + _lang = ReadonlyAttribute(jsObject: jsObject, name: Strings.lang) + self.jsObject = jsObject + } + + public convenience init(recordInit: NDEFRecordInit) { + self.init(unsafelyWrapping: Self.constructor.new(recordInit.jsValue())) + } + + @ReadonlyAttribute + public var recordType: String + + @ReadonlyAttribute + public var mediaType: String? + + @ReadonlyAttribute + public var id: String? + + @ReadonlyAttribute + public var data: DataView? + + @ReadonlyAttribute + public var encoding: String? + + @ReadonlyAttribute + public var lang: String? + + public func toRecords() -> [NDEFRecord]? { + jsObject[Strings.toRecords]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/NDEFRecordInit.swift b/Sources/DOMKit/WebIDL/NDEFRecordInit.swift new file mode 100644 index 00000000..5b87c281 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFRecordInit.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFRecordInit: BridgedDictionary { + public convenience init(recordType: String, mediaType: String, id: String, encoding: String, lang: String, data: JSValue) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.recordType] = recordType.jsValue() + object[Strings.mediaType] = mediaType.jsValue() + object[Strings.id] = id.jsValue() + object[Strings.encoding] = encoding.jsValue() + object[Strings.lang] = lang.jsValue() + object[Strings.data] = data.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _recordType = ReadWriteAttribute(jsObject: object, name: Strings.recordType) + _mediaType = ReadWriteAttribute(jsObject: object, name: Strings.mediaType) + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _encoding = ReadWriteAttribute(jsObject: object, name: Strings.encoding) + _lang = ReadWriteAttribute(jsObject: object, name: Strings.lang) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var recordType: String + + @ReadWriteAttribute + public var mediaType: String + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var encoding: String + + @ReadWriteAttribute + public var lang: String + + @ReadWriteAttribute + public var data: JSValue +} diff --git a/Sources/DOMKit/WebIDL/NDEFScanOptions.swift b/Sources/DOMKit/WebIDL/NDEFScanOptions.swift new file mode 100644 index 00000000..c44f9748 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFScanOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFScanOptions: BridgedDictionary { + public convenience init(signal: AbortSignal) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.signal] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var signal: AbortSignal +} diff --git a/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift b/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift new file mode 100644 index 00000000..b3efe368 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NDEFWriteOptions: BridgedDictionary { + public convenience init(overwrite: Bool, signal: AbortSignal?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.overwrite] = overwrite.jsValue() + object[Strings.signal] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _overwrite = ReadWriteAttribute(jsObject: object, name: Strings.overwrite) + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var overwrite: Bool + + @ReadWriteAttribute + public var signal: AbortSignal? +} diff --git a/Sources/DOMKit/WebIDL/NamedFlow.swift b/Sources/DOMKit/WebIDL/NamedFlow.swift new file mode 100644 index 00000000..6b6a46b2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NamedFlow.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NamedFlow: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.NamedFlow].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _overset = ReadonlyAttribute(jsObject: jsObject, name: Strings.overset) + _firstEmptyRegionIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.firstEmptyRegionIndex) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var overset: Bool + + public func getRegions() -> [Element] { + jsObject[Strings.getRegions]!().fromJSValue()! + } + + @ReadonlyAttribute + public var firstEmptyRegionIndex: Int16 + + public func getContent() -> [Node] { + jsObject[Strings.getContent]!().fromJSValue()! + } + + public func getRegionsByContent(node: Node) -> [Element] { + jsObject[Strings.getRegionsByContent]!(node.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/NamedFlowMap.swift b/Sources/DOMKit/WebIDL/NamedFlowMap.swift new file mode 100644 index 00000000..fd5f3750 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NamedFlowMap.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NamedFlowMap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.NamedFlowMap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/NamedNodeMap.swift b/Sources/DOMKit/WebIDL/NamedNodeMap.swift index 5dd5fd51..505061a9 100644 --- a/Sources/DOMKit/WebIDL/NamedNodeMap.swift +++ b/Sources/DOMKit/WebIDL/NamedNodeMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NamedNodeMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.NamedNodeMap.function! } + public class var constructor: JSFunction { JSObject.global[Strings.NamedNodeMap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/NavigateEvent.swift b/Sources/DOMKit/WebIDL/NavigateEvent.swift new file mode 100644 index 00000000..bccceede --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigateEvent.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigateEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.NavigateEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _navigationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationType) + _destination = ReadonlyAttribute(jsObject: jsObject, name: Strings.destination) + _canTransition = ReadonlyAttribute(jsObject: jsObject, name: Strings.canTransition) + _userInitiated = ReadonlyAttribute(jsObject: jsObject, name: Strings.userInitiated) + _hashChange = ReadonlyAttribute(jsObject: jsObject, name: Strings.hashChange) + _signal = ReadonlyAttribute(jsObject: jsObject, name: Strings.signal) + _formData = ReadonlyAttribute(jsObject: jsObject, name: Strings.formData) + _info = ReadonlyAttribute(jsObject: jsObject, name: Strings.info) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInit: NavigateEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInit.jsValue())) + } + + @ReadonlyAttribute + public var navigationType: NavigationNavigationType + + @ReadonlyAttribute + public var destination: NavigationDestination + + @ReadonlyAttribute + public var canTransition: Bool + + @ReadonlyAttribute + public var userInitiated: Bool + + @ReadonlyAttribute + public var hashChange: Bool + + @ReadonlyAttribute + public var signal: AbortSignal + + @ReadonlyAttribute + public var formData: FormData? + + @ReadonlyAttribute + public var info: JSValue + + public func transitionWhile(newNavigationAction: JSPromise) { + _ = jsObject[Strings.transitionWhile]!(newNavigationAction.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/NavigateEventInit.swift b/Sources/DOMKit/WebIDL/NavigateEventInit.swift new file mode 100644 index 00000000..f9509528 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigateEventInit.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigateEventInit: BridgedDictionary { + public convenience init(navigationType: NavigationNavigationType, destination: NavigationDestination, canTransition: Bool, userInitiated: Bool, hashChange: Bool, signal: AbortSignal, formData: FormData?, info: JSValue) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.navigationType] = navigationType.jsValue() + object[Strings.destination] = destination.jsValue() + object[Strings.canTransition] = canTransition.jsValue() + object[Strings.userInitiated] = userInitiated.jsValue() + object[Strings.hashChange] = hashChange.jsValue() + object[Strings.signal] = signal.jsValue() + object[Strings.formData] = formData.jsValue() + object[Strings.info] = info.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _navigationType = ReadWriteAttribute(jsObject: object, name: Strings.navigationType) + _destination = ReadWriteAttribute(jsObject: object, name: Strings.destination) + _canTransition = ReadWriteAttribute(jsObject: object, name: Strings.canTransition) + _userInitiated = ReadWriteAttribute(jsObject: object, name: Strings.userInitiated) + _hashChange = ReadWriteAttribute(jsObject: object, name: Strings.hashChange) + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + _formData = ReadWriteAttribute(jsObject: object, name: Strings.formData) + _info = ReadWriteAttribute(jsObject: object, name: Strings.info) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var navigationType: NavigationNavigationType + + @ReadWriteAttribute + public var destination: NavigationDestination + + @ReadWriteAttribute + public var canTransition: Bool + + @ReadWriteAttribute + public var userInitiated: Bool + + @ReadWriteAttribute + public var hashChange: Bool + + @ReadWriteAttribute + public var signal: AbortSignal + + @ReadWriteAttribute + public var formData: FormData? + + @ReadWriteAttribute + public var info: JSValue +} diff --git a/Sources/DOMKit/WebIDL/Navigation.swift b/Sources/DOMKit/WebIDL/Navigation.swift new file mode 100644 index 00000000..0dad68ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/Navigation.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Navigation: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.Navigation].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _currentEntry = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentEntry) + _transition = ReadonlyAttribute(jsObject: jsObject, name: Strings.transition) + _canGoBack = ReadonlyAttribute(jsObject: jsObject, name: Strings.canGoBack) + _canGoForward = ReadonlyAttribute(jsObject: jsObject, name: Strings.canGoForward) + _onnavigate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigate) + _onnavigatesuccess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigatesuccess) + _onnavigateerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigateerror) + _oncurrententrychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncurrententrychange) + super.init(unsafelyWrapping: jsObject) + } + + public func entries() -> [NavigationHistoryEntry] { + jsObject[Strings.entries]!().fromJSValue()! + } + + @ReadonlyAttribute + public var currentEntry: NavigationHistoryEntry? + + public func updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions) { + _ = jsObject[Strings.updateCurrentEntry]!(options.jsValue()) + } + + @ReadonlyAttribute + public var transition: NavigationTransition? + + @ReadonlyAttribute + public var canGoBack: Bool + + @ReadonlyAttribute + public var canGoForward: Bool + + public func navigate(url: String, options: NavigationNavigateOptions? = nil) -> NavigationResult { + jsObject[Strings.navigate]!(url.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func reload(options: NavigationReloadOptions? = nil) -> NavigationResult { + jsObject[Strings.reload]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func traverseTo(key: String, options: NavigationOptions? = nil) -> NavigationResult { + jsObject[Strings.traverseTo]!(key.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func back(options: NavigationOptions? = nil) -> NavigationResult { + jsObject[Strings.back]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func forward(options: NavigationOptions? = nil) -> NavigationResult { + jsObject[Strings.forward]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onnavigate: EventHandler + + @ClosureAttribute.Optional1 + public var onnavigatesuccess: EventHandler + + @ClosureAttribute.Optional1 + public var onnavigateerror: EventHandler + + @ClosureAttribute.Optional1 + public var oncurrententrychange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift new file mode 100644 index 00000000..2298d090 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationCurrentEntryChangeEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.NavigationCurrentEntryChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _navigationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationType) + _from = ReadonlyAttribute(jsObject: jsObject, name: Strings.from) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInit: NavigationCurrentEntryChangeEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInit.jsValue())) + } + + @ReadonlyAttribute + public var navigationType: NavigationNavigationType? + + @ReadonlyAttribute + public var from: NavigationHistoryEntry +} diff --git a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift new file mode 100644 index 00000000..85ea6ea2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationCurrentEntryChangeEventInit: BridgedDictionary { + public convenience init(navigationType: NavigationNavigationType?, destination: NavigationHistoryEntry) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.navigationType] = navigationType.jsValue() + object[Strings.destination] = destination.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _navigationType = ReadWriteAttribute(jsObject: object, name: Strings.navigationType) + _destination = ReadWriteAttribute(jsObject: object, name: Strings.destination) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var navigationType: NavigationNavigationType? + + @ReadWriteAttribute + public var destination: NavigationHistoryEntry +} diff --git a/Sources/DOMKit/WebIDL/NavigationDestination.swift b/Sources/DOMKit/WebIDL/NavigationDestination.swift new file mode 100644 index 00000000..35f1c806 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationDestination.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationDestination: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.NavigationDestination].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) + _sameDocument = ReadonlyAttribute(jsObject: jsObject, name: Strings.sameDocument) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var key: String? + + @ReadonlyAttribute + public var id: String? + + @ReadonlyAttribute + public var index: Int64 + + @ReadonlyAttribute + public var sameDocument: Bool + + public func getState() -> JSValue { + jsObject[Strings.getState]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/NavigationEvent.swift b/Sources/DOMKit/WebIDL/NavigationEvent.swift new file mode 100644 index 00000000..3786eaba --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationEvent: UIEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.NavigationEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _dir = ReadonlyAttribute(jsObject: jsObject, name: Strings.dir) + _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedTarget) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: NavigationEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var dir: SpatialNavigationDirection + + @ReadonlyAttribute + public var relatedTarget: EventTarget? +} diff --git a/Sources/DOMKit/WebIDL/NavigationEventInit.swift b/Sources/DOMKit/WebIDL/NavigationEventInit.swift new file mode 100644 index 00000000..fa2c7a26 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationEventInit: BridgedDictionary { + public convenience init(dir: SpatialNavigationDirection, relatedTarget: EventTarget?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.dir] = dir.jsValue() + object[Strings.relatedTarget] = relatedTarget.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _dir = ReadWriteAttribute(jsObject: object, name: Strings.dir) + _relatedTarget = ReadWriteAttribute(jsObject: object, name: Strings.relatedTarget) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var dir: SpatialNavigationDirection + + @ReadWriteAttribute + public var relatedTarget: EventTarget? +} diff --git a/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift b/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift new file mode 100644 index 00000000..c23ca9c2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationHistoryEntry: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.NavigationHistoryEntry].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) + _sameDocument = ReadonlyAttribute(jsObject: jsObject, name: Strings.sameDocument) + _onnavigateto = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigateto) + _onnavigatefrom = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigatefrom) + _onfinish = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfinish) + _ondispose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondispose) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var url: String? + + @ReadonlyAttribute + public var key: String + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var index: Int64 + + @ReadonlyAttribute + public var sameDocument: Bool + + public func getState() -> JSValue { + jsObject[Strings.getState]!().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onnavigateto: EventHandler + + @ClosureAttribute.Optional1 + public var onnavigatefrom: EventHandler + + @ClosureAttribute.Optional1 + public var onfinish: EventHandler + + @ClosureAttribute.Optional1 + public var ondispose: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift b/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift new file mode 100644 index 00000000..043932aa --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationNavigateOptions: BridgedDictionary { + public convenience init(state: JSValue, replace: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.state] = state.jsValue() + object[Strings.replace] = replace.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _state = ReadWriteAttribute(jsObject: object, name: Strings.state) + _replace = ReadWriteAttribute(jsObject: object, name: Strings.replace) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var state: JSValue + + @ReadWriteAttribute + public var replace: Bool +} diff --git a/Sources/DOMKit/WebIDL/NavigationNavigationType.swift b/Sources/DOMKit/WebIDL/NavigationNavigationType.swift new file mode 100644 index 00000000..446bacb9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationNavigationType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum NavigationNavigationType: JSString, JSValueCompatible { + case reload = "reload" + case push = "push" + case replace = "replace" + case traverse = "traverse" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/NavigationOptions.swift b/Sources/DOMKit/WebIDL/NavigationOptions.swift new file mode 100644 index 00000000..f5142b9b --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationOptions: BridgedDictionary { + public convenience init(info: JSValue) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.info] = info.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _info = ReadWriteAttribute(jsObject: object, name: Strings.info) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var info: JSValue +} diff --git a/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift b/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift new file mode 100644 index 00000000..b92d2044 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationPreloadManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.NavigationPreloadManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func enable() -> JSPromise { + jsObject[Strings.enable]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func enable() async throws { + let _promise: JSPromise = jsObject[Strings.enable]!().fromJSValue()! + _ = try await _promise.get() + } + + public func disable() -> JSPromise { + jsObject[Strings.disable]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func disable() async throws { + let _promise: JSPromise = jsObject[Strings.disable]!().fromJSValue()! + _ = try await _promise.get() + } + + public func setHeaderValue(value: String) -> JSPromise { + jsObject[Strings.setHeaderValue]!(value.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setHeaderValue(value: String) async throws { + let _promise: JSPromise = jsObject[Strings.setHeaderValue]!(value.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func getState() -> JSPromise { + jsObject[Strings.getState]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getState() async throws -> NavigationPreloadState { + let _promise: JSPromise = jsObject[Strings.getState]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/NavigationPreloadState.swift b/Sources/DOMKit/WebIDL/NavigationPreloadState.swift new file mode 100644 index 00000000..e3bd0cc9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationPreloadState.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationPreloadState: BridgedDictionary { + public convenience init(enabled: Bool, headerValue: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.enabled] = enabled.jsValue() + object[Strings.headerValue] = headerValue.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _enabled = ReadWriteAttribute(jsObject: object, name: Strings.enabled) + _headerValue = ReadWriteAttribute(jsObject: object, name: Strings.headerValue) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var enabled: Bool + + @ReadWriteAttribute + public var headerValue: String +} diff --git a/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift b/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift new file mode 100644 index 00000000..0d1322f7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationReloadOptions: BridgedDictionary { + public convenience init(state: JSValue) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.state] = state.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _state = ReadWriteAttribute(jsObject: object, name: Strings.state) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var state: JSValue +} diff --git a/Sources/DOMKit/WebIDL/NavigationResult.swift b/Sources/DOMKit/WebIDL/NavigationResult.swift new file mode 100644 index 00000000..e235cc53 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationResult.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationResult: BridgedDictionary { + public convenience init(committed: JSPromise, finished: JSPromise) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.committed] = committed.jsValue() + object[Strings.finished] = finished.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _committed = ReadWriteAttribute(jsObject: object, name: Strings.committed) + _finished = ReadWriteAttribute(jsObject: object, name: Strings.finished) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var committed: JSPromise + + @ReadWriteAttribute + public var finished: JSPromise +} diff --git a/Sources/DOMKit/WebIDL/NavigationTimingType.swift b/Sources/DOMKit/WebIDL/NavigationTimingType.swift new file mode 100644 index 00000000..8b58377f --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationTimingType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum NavigationTimingType: JSString, JSValueCompatible { + case navigate = "navigate" + case reload = "reload" + case backForward = "back_forward" + case prerender = "prerender" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/NavigationTransition.swift b/Sources/DOMKit/WebIDL/NavigationTransition.swift new file mode 100644 index 00000000..2467d686 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationTransition.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationTransition: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.NavigationTransition].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _navigationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationType) + _from = ReadonlyAttribute(jsObject: jsObject, name: Strings.from) + _finished = ReadonlyAttribute(jsObject: jsObject, name: Strings.finished) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var navigationType: NavigationNavigationType + + @ReadonlyAttribute + public var from: NavigationHistoryEntry + + @ReadonlyAttribute + public var finished: JSPromise + + public func rollback(options: NavigationOptions? = nil) -> NavigationResult { + jsObject[Strings.rollback]!(options?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift b/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift new file mode 100644 index 00000000..81d6197a --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigationUpdateCurrentEntryOptions: BridgedDictionary { + public convenience init(state: JSValue) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.state] = state.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _state = ReadWriteAttribute(jsObject: object, name: Strings.state) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var state: JSValue +} diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index 40e14532..888d08a0 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -3,12 +3,206 @@ import JavaScriptEventLoop import JavaScriptKit -public class Navigator: JSBridgedClass, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware { - public class var constructor: JSFunction { JSObject.global.Navigator.function! } +public class Navigator: JSBridgedClass, NavigatorStorage, NavigatorDeviceMemory, NavigatorNetworkInformation, NavigatorML, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware, NavigatorFonts, NavigatorUA, NavigatorGPU, NavigatorBadge, NavigatorLocks, NavigatorAutomationInformation { + public class var constructor: JSFunction { JSObject.global[Strings.Navigator].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _contacts = ReadonlyAttribute(jsObject: jsObject, name: Strings.contacts) + _scheduling = ReadonlyAttribute(jsObject: jsObject, name: Strings.scheduling) + _mediaSession = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaSession) + _xr = ReadonlyAttribute(jsObject: jsObject, name: Strings.xr) + _bluetooth = ReadonlyAttribute(jsObject: jsObject, name: Strings.bluetooth) + _windowControlsOverlay = ReadonlyAttribute(jsObject: jsObject, name: Strings.windowControlsOverlay) + _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) + _ink = ReadonlyAttribute(jsObject: jsObject, name: Strings.ink) + _credentials = ReadonlyAttribute(jsObject: jsObject, name: Strings.credentials) + _hid = ReadonlyAttribute(jsObject: jsObject, name: Strings.hid) + _devicePosture = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePosture) + _geolocation = ReadonlyAttribute(jsObject: jsObject, name: Strings.geolocation) + _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) + _maxTouchPoints = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTouchPoints) + _wakeLock = ReadonlyAttribute(jsObject: jsObject, name: Strings.wakeLock) + _presentation = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentation) + _keyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyboard) + _clipboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipboard) + _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) + _serial = ReadonlyAttribute(jsObject: jsObject, name: Strings.serial) + _mediaDevices = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaDevices) + _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) + _virtualKeyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.virtualKeyboard) self.jsObject = jsObject } + + @ReadonlyAttribute + public var contacts: ContactsManager + + @ReadonlyAttribute + public var scheduling: Scheduling + + @ReadonlyAttribute + public var mediaSession: MediaSession + + public func getBattery() -> JSPromise { + jsObject[Strings.getBattery]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getBattery() async throws -> BatteryManager { + let _promise: JSPromise = jsObject[Strings.getBattery]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var xr: XRSystem + + public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { + jsObject[Strings.sendBeacon]!(url.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var bluetooth: Bluetooth + + @ReadonlyAttribute + public var windowControlsOverlay: WindowControlsOverlay + + @ReadonlyAttribute + public var permissions: Permissions + + @ReadonlyAttribute + public var ink: Ink + + @ReadonlyAttribute + public var credentials: CredentialsContainer + + @ReadonlyAttribute + public var hid: HID + + @ReadonlyAttribute + public var devicePosture: DevicePosture + + public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { + jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { + let _promise: JSPromise = jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var geolocation: Geolocation + + @ReadonlyAttribute + public var serviceWorker: ServiceWorkerContainer + + public func requestMIDIAccess(options: MIDIOptions? = nil) -> JSPromise { + jsObject[Strings.requestMIDIAccess]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestMIDIAccess(options: MIDIOptions? = nil) async throws -> MIDIAccess { + let _promise: JSPromise = jsObject[Strings.requestMIDIAccess]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getInstalledRelatedApps() -> JSPromise { + jsObject[Strings.getInstalledRelatedApps]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getInstalledRelatedApps() async throws -> [RelatedApplication] { + let _promise: JSPromise = jsObject[Strings.getInstalledRelatedApps]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var maxTouchPoints: Int32 + + @ReadonlyAttribute + public var wakeLock: WakeLock + + @ReadonlyAttribute + public var presentation: Presentation + + @ReadonlyAttribute + public var keyboard: Keyboard + + @ReadonlyAttribute + public var clipboard: Clipboard + + @ReadonlyAttribute + public var usb: USB + + public func setClientBadge(contents: UInt64? = nil) -> JSPromise { + jsObject[Strings.setClientBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setClientBadge(contents: UInt64? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.setClientBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func clearClientBadge() -> JSPromise { + jsObject[Strings.clearClientBadge]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func clearClientBadge() async throws { + let _promise: JSPromise = jsObject[Strings.clearClientBadge]!().fromJSValue()! + _ = try await _promise.get() + } + + public func getGamepads() -> [Gamepad?] { + jsObject[Strings.getGamepads]!().fromJSValue()! + } + + @ReadonlyAttribute + public var serial: Serial + + @ReadonlyAttribute + public var mediaDevices: MediaDevices + + public func getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback) { + _ = jsObject[Strings.getUserMedia]!(constraints.jsValue(), successCallback.jsValue(), errorCallback.jsValue()) + } + + @ReadonlyAttribute + public var mediaCapabilities: MediaCapabilities + + public func getAutoplayPolicy(type: AutoplayPolicyMediaType) -> AutoplayPolicy { + jsObject[Strings.getAutoplayPolicy]!(type.jsValue()).fromJSValue()! + } + + public func getAutoplayPolicy(element: HTMLMediaElement) -> AutoplayPolicy { + jsObject[Strings.getAutoplayPolicy]!(element.jsValue()).fromJSValue()! + } + + public func getAutoplayPolicy(context: AudioContext) -> AutoplayPolicy { + jsObject[Strings.getAutoplayPolicy]!(context.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var virtualKeyboard: VirtualKeyboard + + public func share(data: ShareData? = nil) -> JSPromise { + jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func share(data: ShareData? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func canShare(data: ShareData? = nil) -> Bool { + jsObject[Strings.canShare]!(data?.jsValue() ?? .undefined).fromJSValue()! + } + + public func vibrate(pattern: VibratePattern) -> Bool { + jsObject[Strings.vibrate]!(pattern.jsValue()).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift b/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift new file mode 100644 index 00000000..8b94eeed --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorAutomationInformation: JSBridgedClass {} +public extension NavigatorAutomationInformation { + var webdriver: Bool { ReadonlyAttribute[Strings.webdriver, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorBadge.swift b/Sources/DOMKit/WebIDL/NavigatorBadge.swift new file mode 100644 index 00000000..e99c4b63 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorBadge.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorBadge: JSBridgedClass {} +public extension NavigatorBadge { + func setAppBadge(contents: UInt64? = nil) -> JSPromise { + jsObject[Strings.setAppBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func setAppBadge(contents: UInt64? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.setAppBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + func clearAppBadge() -> JSPromise { + jsObject[Strings.clearAppBadge]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func clearAppBadge() async throws { + let _promise: JSPromise = jsObject[Strings.clearAppBadge]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift b/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift new file mode 100644 index 00000000..c1cbc40f --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorDeviceMemory: JSBridgedClass {} +public extension NavigatorDeviceMemory { + var deviceMemory: Double { ReadonlyAttribute[Strings.deviceMemory, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorFonts.swift b/Sources/DOMKit/WebIDL/NavigatorFonts.swift new file mode 100644 index 00000000..d79f83fb --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorFonts.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorFonts: JSBridgedClass {} +public extension NavigatorFonts { + var fonts: FontManager { ReadonlyAttribute[Strings.fonts, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorGPU.swift b/Sources/DOMKit/WebIDL/NavigatorGPU.swift new file mode 100644 index 00000000..8ed2e465 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorGPU.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorGPU: JSBridgedClass {} +public extension NavigatorGPU { + var gpu: GPU { ReadonlyAttribute[Strings.gpu, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorLocks.swift b/Sources/DOMKit/WebIDL/NavigatorLocks.swift new file mode 100644 index 00000000..6aa3845c --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorLocks.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorLocks: JSBridgedClass {} +public extension NavigatorLocks { + var locks: LockManager { ReadonlyAttribute[Strings.locks, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorML.swift b/Sources/DOMKit/WebIDL/NavigatorML.swift new file mode 100644 index 00000000..aa97f8d9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorML.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorML: JSBridgedClass {} +public extension NavigatorML { + var ml: ML { ReadonlyAttribute[Strings.ml, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift b/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift new file mode 100644 index 00000000..5f94bc72 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorNetworkInformation: JSBridgedClass {} +public extension NavigatorNetworkInformation { + var connection: NetworkInformation { ReadonlyAttribute[Strings.connection, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorStorage.swift b/Sources/DOMKit/WebIDL/NavigatorStorage.swift new file mode 100644 index 00000000..7861b9cd --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorStorage.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorStorage: JSBridgedClass {} +public extension NavigatorStorage { + var storage: StorageManager { ReadonlyAttribute[Strings.storage, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorUA.swift b/Sources/DOMKit/WebIDL/NavigatorUA.swift new file mode 100644 index 00000000..d4e53f1c --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorUA.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NavigatorUA: JSBridgedClass {} +public extension NavigatorUA { + var userAgentData: NavigatorUAData { ReadonlyAttribute[Strings.userAgentData, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift b/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift new file mode 100644 index 00000000..103751f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigatorUABrandVersion: BridgedDictionary { + public convenience init(brand: String, version: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.brand] = brand.jsValue() + object[Strings.version] = version.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _brand = ReadWriteAttribute(jsObject: object, name: Strings.brand) + _version = ReadWriteAttribute(jsObject: object, name: Strings.version) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var brand: String + + @ReadWriteAttribute + public var version: String +} diff --git a/Sources/DOMKit/WebIDL/NavigatorUAData.swift b/Sources/DOMKit/WebIDL/NavigatorUAData.swift new file mode 100644 index 00000000..c35f5cea --- /dev/null +++ b/Sources/DOMKit/WebIDL/NavigatorUAData.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NavigatorUAData: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.NavigatorUAData].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _brands = ReadonlyAttribute(jsObject: jsObject, name: Strings.brands) + _mobile = ReadonlyAttribute(jsObject: jsObject, name: Strings.mobile) + _platform = ReadonlyAttribute(jsObject: jsObject, name: Strings.platform) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var brands: [NavigatorUABrandVersion] + + @ReadonlyAttribute + public var mobile: Bool + + @ReadonlyAttribute + public var platform: String + + public func getHighEntropyValues(hints: [String]) -> JSPromise { + jsObject[Strings.getHighEntropyValues]!(hints.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getHighEntropyValues(hints: [String]) async throws -> UADataValues { + let _promise: JSPromise = jsObject[Strings.getHighEntropyValues]!(hints.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func toJSON() -> UALowEntropyJSON { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/NetworkInformation.swift b/Sources/DOMKit/WebIDL/NetworkInformation.swift new file mode 100644 index 00000000..f5fc398b --- /dev/null +++ b/Sources/DOMKit/WebIDL/NetworkInformation.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NetworkInformation: EventTarget, NetworkInformationSaveData { + override public class var constructor: JSFunction { JSObject.global[Strings.NetworkInformation].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _effectiveType = ReadonlyAttribute(jsObject: jsObject, name: Strings.effectiveType) + _downlinkMax = ReadonlyAttribute(jsObject: jsObject, name: Strings.downlinkMax) + _downlink = ReadonlyAttribute(jsObject: jsObject, name: Strings.downlink) + _rtt = ReadonlyAttribute(jsObject: jsObject, name: Strings.rtt) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var type: ConnectionType + + @ReadonlyAttribute + public var effectiveType: EffectiveConnectionType + + @ReadonlyAttribute + public var downlinkMax: Megabit + + @ReadonlyAttribute + public var downlink: Megabit + + @ReadonlyAttribute + public var rtt: Millisecond + + @ClosureAttribute.Optional1 + public var onchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift b/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift new file mode 100644 index 00000000..b87cbdc1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol NetworkInformationSaveData: JSBridgedClass {} +public extension NetworkInformationSaveData { + var saveData: Bool { ReadonlyAttribute[Strings.saveData, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/Node.swift b/Sources/DOMKit/WebIDL/Node.swift index 8589d301..6b7146c2 100644 --- a/Sources/DOMKit/WebIDL/Node.swift +++ b/Sources/DOMKit/WebIDL/Node.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Node: EventTarget { - override public class var constructor: JSFunction { JSObject.global.Node.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.Node].function! } public required init(unsafelyWrapping jsObject: JSObject) { _nodeType = ReadonlyAttribute(jsObject: jsObject, name: Strings.nodeType) diff --git a/Sources/DOMKit/WebIDL/NodeIterator.swift b/Sources/DOMKit/WebIDL/NodeIterator.swift index 4ea435f0..4aeee232 100644 --- a/Sources/DOMKit/WebIDL/NodeIterator.swift +++ b/Sources/DOMKit/WebIDL/NodeIterator.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NodeIterator: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.NodeIterator.function! } + public class var constructor: JSFunction { JSObject.global[Strings.NodeIterator].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/NodeList.swift b/Sources/DOMKit/WebIDL/NodeList.swift index 29b3276a..483eb63c 100644 --- a/Sources/DOMKit/WebIDL/NodeList.swift +++ b/Sources/DOMKit/WebIDL/NodeList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NodeList: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global.NodeList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.NodeList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/Notification.swift b/Sources/DOMKit/WebIDL/Notification.swift new file mode 100644 index 00000000..573bbd60 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Notification.swift @@ -0,0 +1,114 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Notification: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.Notification].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _permission = ReadonlyAttribute(jsObject: jsObject, name: Strings.permission) + _maxActions = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxActions) + _onclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclick) + _onshow = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onshow) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) + _title = ReadonlyAttribute(jsObject: jsObject, name: Strings.title) + _dir = ReadonlyAttribute(jsObject: jsObject, name: Strings.dir) + _lang = ReadonlyAttribute(jsObject: jsObject, name: Strings.lang) + _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) + _tag = ReadonlyAttribute(jsObject: jsObject, name: Strings.tag) + _image = ReadonlyAttribute(jsObject: jsObject, name: Strings.image) + _icon = ReadonlyAttribute(jsObject: jsObject, name: Strings.icon) + _badge = ReadonlyAttribute(jsObject: jsObject, name: Strings.badge) + _vibrate = ReadonlyAttribute(jsObject: jsObject, name: Strings.vibrate) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _renotify = ReadonlyAttribute(jsObject: jsObject, name: Strings.renotify) + _silent = ReadonlyAttribute(jsObject: jsObject, name: Strings.silent) + _requireInteraction = ReadonlyAttribute(jsObject: jsObject, name: Strings.requireInteraction) + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _actions = ReadonlyAttribute(jsObject: jsObject, name: Strings.actions) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(title: String, options: NotificationOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(title.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var permission: NotificationPermission + + public static func requestPermission(deprecatedCallback: NotificationPermissionCallback? = nil) -> JSPromise { + constructor[Strings.requestPermission]!(deprecatedCallback?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func requestPermission(deprecatedCallback: NotificationPermissionCallback? = nil) async throws -> NotificationPermission { + let _promise: JSPromise = constructor[Strings.requestPermission]!(deprecatedCallback?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var maxActions: UInt32 + + @ClosureAttribute.Optional1 + public var onclick: EventHandler + + @ClosureAttribute.Optional1 + public var onshow: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onclose: EventHandler + + @ReadonlyAttribute + public var title: String + + @ReadonlyAttribute + public var dir: NotificationDirection + + @ReadonlyAttribute + public var lang: String + + @ReadonlyAttribute + public var body: String + + @ReadonlyAttribute + public var tag: String + + @ReadonlyAttribute + public var image: String + + @ReadonlyAttribute + public var icon: String + + @ReadonlyAttribute + public var badge: String + + @ReadonlyAttribute + public var vibrate: [UInt32] + + @ReadonlyAttribute + public var timestamp: EpochTimeStamp + + @ReadonlyAttribute + public var renotify: Bool + + @ReadonlyAttribute + public var silent: Bool + + @ReadonlyAttribute + public var requireInteraction: Bool + + @ReadonlyAttribute + public var data: JSValue + + @ReadonlyAttribute + public var actions: [NotificationAction] + + public func close() { + _ = jsObject[Strings.close]!() + } +} diff --git a/Sources/DOMKit/WebIDL/NotificationAction.swift b/Sources/DOMKit/WebIDL/NotificationAction.swift new file mode 100644 index 00000000..18288571 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NotificationAction.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NotificationAction: BridgedDictionary { + public convenience init(action: String, title: String, icon: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.action] = action.jsValue() + object[Strings.title] = title.jsValue() + object[Strings.icon] = icon.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _action = ReadWriteAttribute(jsObject: object, name: Strings.action) + _title = ReadWriteAttribute(jsObject: object, name: Strings.title) + _icon = ReadWriteAttribute(jsObject: object, name: Strings.icon) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var action: String + + @ReadWriteAttribute + public var title: String + + @ReadWriteAttribute + public var icon: String +} diff --git a/Sources/DOMKit/WebIDL/NotificationDirection.swift b/Sources/DOMKit/WebIDL/NotificationDirection.swift new file mode 100644 index 00000000..9915468a --- /dev/null +++ b/Sources/DOMKit/WebIDL/NotificationDirection.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum NotificationDirection: JSString, JSValueCompatible { + case auto = "auto" + case ltr = "ltr" + case rtl = "rtl" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/NotificationEvent.swift b/Sources/DOMKit/WebIDL/NotificationEvent.swift new file mode 100644 index 00000000..0878614f --- /dev/null +++ b/Sources/DOMKit/WebIDL/NotificationEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NotificationEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.NotificationEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _notification = ReadonlyAttribute(jsObject: jsObject, name: Strings.notification) + _action = ReadonlyAttribute(jsObject: jsObject, name: Strings.action) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: NotificationEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var notification: Notification + + @ReadonlyAttribute + public var action: String +} diff --git a/Sources/DOMKit/WebIDL/NotificationEventInit.swift b/Sources/DOMKit/WebIDL/NotificationEventInit.swift new file mode 100644 index 00000000..0c160ce5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/NotificationEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NotificationEventInit: BridgedDictionary { + public convenience init(notification: Notification, action: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.notification] = notification.jsValue() + object[Strings.action] = action.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _notification = ReadWriteAttribute(jsObject: object, name: Strings.notification) + _action = ReadWriteAttribute(jsObject: object, name: Strings.action) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var notification: Notification + + @ReadWriteAttribute + public var action: String +} diff --git a/Sources/DOMKit/WebIDL/NotificationOptions.swift b/Sources/DOMKit/WebIDL/NotificationOptions.swift new file mode 100644 index 00000000..d3d43e9a --- /dev/null +++ b/Sources/DOMKit/WebIDL/NotificationOptions.swift @@ -0,0 +1,85 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class NotificationOptions: BridgedDictionary { + public convenience init(dir: NotificationDirection, lang: String, body: String, tag: String, image: String, icon: String, badge: String, vibrate: VibratePattern, timestamp: EpochTimeStamp, renotify: Bool, silent: Bool, requireInteraction: Bool, data: JSValue, actions: [NotificationAction]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.dir] = dir.jsValue() + object[Strings.lang] = lang.jsValue() + object[Strings.body] = body.jsValue() + object[Strings.tag] = tag.jsValue() + object[Strings.image] = image.jsValue() + object[Strings.icon] = icon.jsValue() + object[Strings.badge] = badge.jsValue() + object[Strings.vibrate] = vibrate.jsValue() + object[Strings.timestamp] = timestamp.jsValue() + object[Strings.renotify] = renotify.jsValue() + object[Strings.silent] = silent.jsValue() + object[Strings.requireInteraction] = requireInteraction.jsValue() + object[Strings.data] = data.jsValue() + object[Strings.actions] = actions.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _dir = ReadWriteAttribute(jsObject: object, name: Strings.dir) + _lang = ReadWriteAttribute(jsObject: object, name: Strings.lang) + _body = ReadWriteAttribute(jsObject: object, name: Strings.body) + _tag = ReadWriteAttribute(jsObject: object, name: Strings.tag) + _image = ReadWriteAttribute(jsObject: object, name: Strings.image) + _icon = ReadWriteAttribute(jsObject: object, name: Strings.icon) + _badge = ReadWriteAttribute(jsObject: object, name: Strings.badge) + _vibrate = ReadWriteAttribute(jsObject: object, name: Strings.vibrate) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _renotify = ReadWriteAttribute(jsObject: object, name: Strings.renotify) + _silent = ReadWriteAttribute(jsObject: object, name: Strings.silent) + _requireInteraction = ReadWriteAttribute(jsObject: object, name: Strings.requireInteraction) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + _actions = ReadWriteAttribute(jsObject: object, name: Strings.actions) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var dir: NotificationDirection + + @ReadWriteAttribute + public var lang: String + + @ReadWriteAttribute + public var body: String + + @ReadWriteAttribute + public var tag: String + + @ReadWriteAttribute + public var image: String + + @ReadWriteAttribute + public var icon: String + + @ReadWriteAttribute + public var badge: String + + @ReadWriteAttribute + public var vibrate: VibratePattern + + @ReadWriteAttribute + public var timestamp: EpochTimeStamp + + @ReadWriteAttribute + public var renotify: Bool + + @ReadWriteAttribute + public var silent: Bool + + @ReadWriteAttribute + public var requireInteraction: Bool + + @ReadWriteAttribute + public var data: JSValue + + @ReadWriteAttribute + public var actions: [NotificationAction] +} diff --git a/Sources/DOMKit/WebIDL/NotificationPermission.swift b/Sources/DOMKit/WebIDL/NotificationPermission.swift new file mode 100644 index 00000000..a90b68cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/NotificationPermission.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum NotificationPermission: JSString, JSValueCompatible { + case `default` = "default" + case denied = "denied" + case granted = "granted" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift b/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift new file mode 100644 index 00000000..99a90dce --- /dev/null +++ b/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OES_draw_buffers_indexed: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OES_draw_buffers_indexed].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func enableiOES(target: GLenum, index: GLuint) { + _ = jsObject[Strings.enableiOES]!(target.jsValue(), index.jsValue()) + } + + public func disableiOES(target: GLenum, index: GLuint) { + _ = jsObject[Strings.disableiOES]!(target.jsValue(), index.jsValue()) + } + + public func blendEquationiOES(buf: GLuint, mode: GLenum) { + _ = jsObject[Strings.blendEquationiOES]!(buf.jsValue(), mode.jsValue()) + } + + public func blendEquationSeparateiOES(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum) { + _ = jsObject[Strings.blendEquationSeparateiOES]!(buf.jsValue(), modeRGB.jsValue(), modeAlpha.jsValue()) + } + + public func blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum) { + _ = jsObject[Strings.blendFunciOES]!(buf.jsValue(), src.jsValue(), dst.jsValue()) + } + + public func blendFuncSeparateiOES(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { + _ = jsObject[Strings.blendFuncSeparateiOES]!(buf.jsValue(), srcRGB.jsValue(), dstRGB.jsValue(), srcAlpha.jsValue(), dstAlpha.jsValue()) + } + + public func colorMaskiOES(buf: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean) { + _ = jsObject[Strings.colorMaskiOES]!(buf.jsValue(), r.jsValue(), g.jsValue(), b.jsValue(), a.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/OES_element_index_uint.swift b/Sources/DOMKit/WebIDL/OES_element_index_uint.swift new file mode 100644 index 00000000..1b302edb --- /dev/null +++ b/Sources/DOMKit/WebIDL/OES_element_index_uint.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OES_element_index_uint: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OES_element_index_uint].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift b/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift new file mode 100644 index 00000000..77094fc1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OES_fbo_render_mipmap: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OES_fbo_render_mipmap].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift b/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift new file mode 100644 index 00000000..6b114d77 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OES_standard_derivatives: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OES_standard_derivatives].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum = 0x8B8B +} diff --git a/Sources/DOMKit/WebIDL/OES_texture_float.swift b/Sources/DOMKit/WebIDL/OES_texture_float.swift new file mode 100644 index 00000000..57ddcbb3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OES_texture_float.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OES_texture_float: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_float].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift b/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift new file mode 100644 index 00000000..ad8a43b4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OES_texture_float_linear: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_float_linear].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/OES_texture_half_float.swift b/Sources/DOMKit/WebIDL/OES_texture_half_float.swift new file mode 100644 index 00000000..f43939eb --- /dev/null +++ b/Sources/DOMKit/WebIDL/OES_texture_half_float.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OES_texture_half_float: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_half_float].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let HALF_FLOAT_OES: GLenum = 0x8D61 +} diff --git a/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift b/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift new file mode 100644 index 00000000..8a315698 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OES_texture_half_float_linear: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_half_float_linear].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift b/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift new file mode 100644 index 00000000..6d61bffc --- /dev/null +++ b/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OES_vertex_array_object: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OES_vertex_array_object].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let VERTEX_ARRAY_BINDING_OES: GLenum = 0x85B5 + + public func createVertexArrayOES() -> WebGLVertexArrayObjectOES? { + jsObject[Strings.createVertexArrayOES]!().fromJSValue()! + } + + public func deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { + _ = jsObject[Strings.deleteVertexArrayOES]!(arrayObject.jsValue()) + } + + public func isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) -> GLboolean { + jsObject[Strings.isVertexArrayOES]!(arrayObject.jsValue()).fromJSValue()! + } + + public func bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { + _ = jsObject[Strings.bindVertexArrayOES]!(arrayObject.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/OTPCredential.swift b/Sources/DOMKit/WebIDL/OTPCredential.swift new file mode 100644 index 00000000..9c342fd8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OTPCredential.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OTPCredential: Credential { + override public class var constructor: JSFunction { JSObject.global[Strings.OTPCredential].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var code: String +} diff --git a/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift new file mode 100644 index 00000000..f69226ec --- /dev/null +++ b/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OTPCredentialRequestOptions: BridgedDictionary { + public convenience init(transport: [OTPCredentialTransportType]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.transport] = transport.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _transport = ReadWriteAttribute(jsObject: object, name: Strings.transport) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var transport: [OTPCredentialTransportType] +} diff --git a/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift b/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift new file mode 100644 index 00000000..ec75db90 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum OTPCredentialTransportType: JSString, JSValueCompatible { + case sms = "sms" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/OVR_multiview2.swift b/Sources/DOMKit/WebIDL/OVR_multiview2.swift new file mode 100644 index 00000000..276d15a6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OVR_multiview2.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OVR_multiview2: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.OVR_multiview2].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: GLenum = 0x9630 + + public static let FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: GLenum = 0x9632 + + public static let MAX_VIEWS_OVR: GLenum = 0x9631 + + public static let FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: GLenum = 0x9633 + + public func framebufferTextureMultiviewOVR(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, baseViewIndex: GLint, numViews: GLsizei) { + let _arg0 = target.jsValue() + let _arg1 = attachment.jsValue() + let _arg2 = texture.jsValue() + let _arg3 = level.jsValue() + let _arg4 = baseViewIndex.jsValue() + let _arg5 = numViews.jsValue() + _ = jsObject[Strings.framebufferTextureMultiviewOVR]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } +} diff --git a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift new file mode 100644 index 00000000..d7b48ee9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OfflineAudioCompletionEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.OfflineAudioCompletionEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _renderedBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderedBuffer) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: OfflineAudioCompletionEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var renderedBuffer: AudioBuffer +} diff --git a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift new file mode 100644 index 00000000..68647689 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OfflineAudioCompletionEventInit: BridgedDictionary { + public convenience init(renderedBuffer: AudioBuffer) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.renderedBuffer] = renderedBuffer.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _renderedBuffer = ReadWriteAttribute(jsObject: object, name: Strings.renderedBuffer) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var renderedBuffer: AudioBuffer +} diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift new file mode 100644 index 00000000..7612cf19 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OfflineAudioContext: BaseAudioContext { + override public class var constructor: JSFunction { JSObject.global[Strings.OfflineAudioContext].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _oncomplete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncomplete) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(contextOptions: OfflineAudioContextOptions) { + self.init(unsafelyWrapping: Self.constructor.new(contextOptions.jsValue())) + } + + public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { + self.init(unsafelyWrapping: Self.constructor.new(numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue())) + } + + public func startRendering() -> JSPromise { + jsObject[Strings.startRendering]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func startRendering() async throws -> AudioBuffer { + let _promise: JSPromise = jsObject[Strings.startRendering]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func resume() -> JSPromise { + jsObject[Strings.resume]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func resume() async throws { + let _promise: JSPromise = jsObject[Strings.resume]!().fromJSValue()! + _ = try await _promise.get() + } + + public func suspend(suspendTime: Double) -> JSPromise { + jsObject[Strings.suspend]!(suspendTime.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func suspend(suspendTime: Double) async throws { + let _promise: JSPromise = jsObject[Strings.suspend]!(suspendTime.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + @ReadonlyAttribute + public var length: UInt32 + + @ClosureAttribute.Optional1 + public var oncomplete: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift b/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift new file mode 100644 index 00000000..8ad220dc --- /dev/null +++ b/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OfflineAudioContextOptions: BridgedDictionary { + public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.numberOfChannels] = numberOfChannels.jsValue() + object[Strings.length] = length.jsValue() + object[Strings.sampleRate] = sampleRate.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) + _length = ReadWriteAttribute(jsObject: object, name: Strings.length) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var numberOfChannels: UInt32 + + @ReadWriteAttribute + public var length: UInt32 + + @ReadWriteAttribute + public var sampleRate: Float +} diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift index e94f49bc..e347d6e1 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OffscreenCanvas: EventTarget { - override public class var constructor: JSFunction { JSObject.global.OffscreenCanvas.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.OffscreenCanvas].function! } public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift index f0522f4e..a92c808c 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OffscreenCanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { - public class var constructor: JSFunction { JSObject.global.OffscreenCanvasRenderingContext2D.function! } + public class var constructor: JSFunction { JSObject.global[Strings.OffscreenCanvasRenderingContext2D].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift b/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift new file mode 100644 index 00000000..dc859887 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OpenFilePickerOptions: BridgedDictionary { + public convenience init(multiple: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.multiple] = multiple.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _multiple = ReadWriteAttribute(jsObject: object, name: Strings.multiple) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var multiple: Bool +} diff --git a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift new file mode 100644 index 00000000..c74850a8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OptionalEffectTiming: BridgedDictionary { + public convenience init(playbackRate: Double, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: __UNSUPPORTED_UNION__, direction: PlaybackDirection, easing: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.playbackRate] = playbackRate.jsValue() + object[Strings.delay] = delay.jsValue() + object[Strings.endDelay] = endDelay.jsValue() + object[Strings.fill] = fill.jsValue() + object[Strings.iterationStart] = iterationStart.jsValue() + object[Strings.iterations] = iterations.jsValue() + object[Strings.duration] = duration.jsValue() + object[Strings.direction] = direction.jsValue() + object[Strings.easing] = easing.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) + _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) + _endDelay = ReadWriteAttribute(jsObject: object, name: Strings.endDelay) + _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) + _iterationStart = ReadWriteAttribute(jsObject: object, name: Strings.iterationStart) + _iterations = ReadWriteAttribute(jsObject: object, name: Strings.iterations) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) + _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var playbackRate: Double + + @ReadWriteAttribute + public var delay: Double + + @ReadWriteAttribute + public var endDelay: Double + + @ReadWriteAttribute + public var fill: FillMode + + @ReadWriteAttribute + public var iterationStart: Double + + @ReadWriteAttribute + public var iterations: Double + + @ReadWriteAttribute + public var duration: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var direction: PlaybackDirection + + @ReadWriteAttribute + public var easing: String +} diff --git a/Sources/DOMKit/WebIDL/OrientationLockType.swift b/Sources/DOMKit/WebIDL/OrientationLockType.swift new file mode 100644 index 00000000..56b0633d --- /dev/null +++ b/Sources/DOMKit/WebIDL/OrientationLockType.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum OrientationLockType: JSString, JSValueCompatible { + case any = "any" + case natural = "natural" + case landscape = "landscape" + case portrait = "portrait" + case portraitPrimary = "portrait-primary" + case portraitSecondary = "portrait-secondary" + case landscapePrimary = "landscape-primary" + case landscapeSecondary = "landscape-secondary" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/OrientationSensor.swift b/Sources/DOMKit/WebIDL/OrientationSensor.swift new file mode 100644 index 00000000..ceb6ca3a --- /dev/null +++ b/Sources/DOMKit/WebIDL/OrientationSensor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OrientationSensor: Sensor { + override public class var constructor: JSFunction { JSObject.global[Strings.OrientationSensor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _quaternion = ReadonlyAttribute(jsObject: jsObject, name: Strings.quaternion) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var quaternion: [Double]? + + public func populateMatrix(targetMatrix: RotationMatrixType) { + _ = jsObject[Strings.populateMatrix]!(targetMatrix.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift new file mode 100644 index 00000000..4e27a4bf --- /dev/null +++ b/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum OrientationSensorLocalCoordinateSystem: JSString, JSValueCompatible { + case device = "device" + case screen = "screen" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/OrientationSensorOptions.swift b/Sources/DOMKit/WebIDL/OrientationSensorOptions.swift new file mode 100644 index 00000000..2b31c3b7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OrientationSensorOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OrientationSensorOptions: BridgedDictionary { + public convenience init(referenceFrame: OrientationSensorLocalCoordinateSystem) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.referenceFrame] = referenceFrame.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _referenceFrame = ReadWriteAttribute(jsObject: object, name: Strings.referenceFrame) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var referenceFrame: OrientationSensorLocalCoordinateSystem +} diff --git a/Sources/DOMKit/WebIDL/OrientationType.swift b/Sources/DOMKit/WebIDL/OrientationType.swift new file mode 100644 index 00000000..0639da39 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OrientationType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum OrientationType: JSString, JSValueCompatible { + case portraitPrimary = "portrait-primary" + case portraitSecondary = "portrait-secondary" + case landscapePrimary = "landscape-primary" + case landscapeSecondary = "landscape-secondary" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/OscillatorNode.swift b/Sources/DOMKit/WebIDL/OscillatorNode.swift new file mode 100644 index 00000000..f93938f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OscillatorNode.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OscillatorNode: AudioScheduledSourceNode { + override public class var constructor: JSFunction { JSObject.global[Strings.OscillatorNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _frequency = ReadonlyAttribute(jsObject: jsObject, name: Strings.frequency) + _detune = ReadonlyAttribute(jsObject: jsObject, name: Strings.detune) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: OscillatorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var type: OscillatorType + + @ReadonlyAttribute + public var frequency: AudioParam + + @ReadonlyAttribute + public var detune: AudioParam + + public func setPeriodicWave(periodicWave: PeriodicWave) { + _ = jsObject[Strings.setPeriodicWave]!(periodicWave.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/OscillatorOptions.swift b/Sources/DOMKit/WebIDL/OscillatorOptions.swift new file mode 100644 index 00000000..754fb5eb --- /dev/null +++ b/Sources/DOMKit/WebIDL/OscillatorOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OscillatorOptions: BridgedDictionary { + public convenience init(type: OscillatorType, frequency: Float, detune: Float, periodicWave: PeriodicWave) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.frequency] = frequency.jsValue() + object[Strings.detune] = detune.jsValue() + object[Strings.periodicWave] = periodicWave.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) + _detune = ReadWriteAttribute(jsObject: object, name: Strings.detune) + _periodicWave = ReadWriteAttribute(jsObject: object, name: Strings.periodicWave) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: OscillatorType + + @ReadWriteAttribute + public var frequency: Float + + @ReadWriteAttribute + public var detune: Float + + @ReadWriteAttribute + public var periodicWave: PeriodicWave +} diff --git a/Sources/DOMKit/WebIDL/OscillatorType.swift b/Sources/DOMKit/WebIDL/OscillatorType.swift new file mode 100644 index 00000000..162bcb20 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OscillatorType.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum OscillatorType: JSString, JSValueCompatible { + case sine = "sine" + case square = "square" + case sawtooth = "sawtooth" + case triangle = "triangle" + case custom = "custom" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/OverSampleType.swift b/Sources/DOMKit/WebIDL/OverSampleType.swift new file mode 100644 index 00000000..0d0eacc4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OverSampleType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum OverSampleType: JSString, JSValueCompatible { + case none = "none" + case _2x = "2x" + case _4x = "4x" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/OverconstrainedError.swift b/Sources/DOMKit/WebIDL/OverconstrainedError.swift new file mode 100644 index 00000000..f1b10559 --- /dev/null +++ b/Sources/DOMKit/WebIDL/OverconstrainedError.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class OverconstrainedError: DOMException { + 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) + } + + public convenience init(constraint: String, message: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(constraint.jsValue(), message?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var constraint: String +} diff --git a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift index dd4fafc7..3ca180f5 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PageTransitionEvent: Event { - override public class var constructor: JSFunction { JSObject.global.PageTransitionEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.PageTransitionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _persisted = ReadonlyAttribute(jsObject: jsObject, name: Strings.persisted) diff --git a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift index 20b14465..3b271df0 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class PageTransitionEventInit: BridgedDictionary { public convenience init(persisted: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.persisted] = persisted.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift b/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift new file mode 100644 index 00000000..bf1f85cb --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaintRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasRect, CanvasDrawPath, CanvasDrawImage, CanvasPathDrawingStyles, CanvasPath { + public class var constructor: JSFunction { JSObject.global[Strings.PaintRenderingContext2D].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift new file mode 100644 index 00000000..36bcfe24 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaintRenderingContext2DSettings: BridgedDictionary { + public convenience init(alpha: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.alpha] = alpha.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var alpha: Bool +} diff --git a/Sources/DOMKit/WebIDL/PaintSize.swift b/Sources/DOMKit/WebIDL/PaintSize.swift new file mode 100644 index 00000000..2d3fea98 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaintSize.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaintSize: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PaintSize].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var width: Double + + @ReadonlyAttribute + public var height: Double +} diff --git a/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift new file mode 100644 index 00000000..d3248752 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaintWorkletGlobalScope: WorkletGlobalScope { + override public class var constructor: JSFunction { JSObject.global[Strings.PaintWorkletGlobalScope].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _devicePixelRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePixelRatio) + super.init(unsafelyWrapping: jsObject) + } + + public func registerPaint(name: String, paintCtor: VoidFunction) { + _ = jsObject[Strings.registerPaint]!(name.jsValue(), paintCtor.jsValue()) + } + + @ReadonlyAttribute + public var devicePixelRatio: Double +} diff --git a/Sources/DOMKit/WebIDL/PannerNode.swift b/Sources/DOMKit/WebIDL/PannerNode.swift new file mode 100644 index 00000000..54bb6d43 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PannerNode.swift @@ -0,0 +1,80 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PannerNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.PannerNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _panningModel = ReadWriteAttribute(jsObject: jsObject, name: Strings.panningModel) + _positionX = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionX) + _positionY = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionY) + _positionZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionZ) + _orientationX = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientationX) + _orientationY = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientationY) + _orientationZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientationZ) + _distanceModel = ReadWriteAttribute(jsObject: jsObject, name: Strings.distanceModel) + _refDistance = ReadWriteAttribute(jsObject: jsObject, name: Strings.refDistance) + _maxDistance = ReadWriteAttribute(jsObject: jsObject, name: Strings.maxDistance) + _rolloffFactor = ReadWriteAttribute(jsObject: jsObject, name: Strings.rolloffFactor) + _coneInnerAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.coneInnerAngle) + _coneOuterAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.coneOuterAngle) + _coneOuterGain = ReadWriteAttribute(jsObject: jsObject, name: Strings.coneOuterGain) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: PannerOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var panningModel: PanningModelType + + @ReadonlyAttribute + public var positionX: AudioParam + + @ReadonlyAttribute + public var positionY: AudioParam + + @ReadonlyAttribute + public var positionZ: AudioParam + + @ReadonlyAttribute + public var orientationX: AudioParam + + @ReadonlyAttribute + public var orientationY: AudioParam + + @ReadonlyAttribute + public var orientationZ: AudioParam + + @ReadWriteAttribute + public var distanceModel: DistanceModelType + + @ReadWriteAttribute + public var refDistance: Double + + @ReadWriteAttribute + public var maxDistance: Double + + @ReadWriteAttribute + public var rolloffFactor: Double + + @ReadWriteAttribute + public var coneInnerAngle: Double + + @ReadWriteAttribute + public var coneOuterAngle: Double + + @ReadWriteAttribute + public var coneOuterGain: Double + + public func setPosition(x: Float, y: Float, z: Float) { + _ = jsObject[Strings.setPosition]!(x.jsValue(), y.jsValue(), z.jsValue()) + } + + public func setOrientation(x: Float, y: Float, z: Float) { + _ = jsObject[Strings.setOrientation]!(x.jsValue(), y.jsValue(), z.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/PannerOptions.swift b/Sources/DOMKit/WebIDL/PannerOptions.swift new file mode 100644 index 00000000..cb9968f7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PannerOptions.swift @@ -0,0 +1,85 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PannerOptions: BridgedDictionary { + public convenience init(panningModel: PanningModelType, distanceModel: DistanceModelType, positionX: Float, positionY: Float, positionZ: Float, orientationX: Float, orientationY: Float, orientationZ: Float, refDistance: Double, maxDistance: Double, rolloffFactor: Double, coneInnerAngle: Double, coneOuterAngle: Double, coneOuterGain: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.panningModel] = panningModel.jsValue() + object[Strings.distanceModel] = distanceModel.jsValue() + object[Strings.positionX] = positionX.jsValue() + object[Strings.positionY] = positionY.jsValue() + object[Strings.positionZ] = positionZ.jsValue() + object[Strings.orientationX] = orientationX.jsValue() + object[Strings.orientationY] = orientationY.jsValue() + object[Strings.orientationZ] = orientationZ.jsValue() + object[Strings.refDistance] = refDistance.jsValue() + object[Strings.maxDistance] = maxDistance.jsValue() + object[Strings.rolloffFactor] = rolloffFactor.jsValue() + object[Strings.coneInnerAngle] = coneInnerAngle.jsValue() + object[Strings.coneOuterAngle] = coneOuterAngle.jsValue() + object[Strings.coneOuterGain] = coneOuterGain.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _panningModel = ReadWriteAttribute(jsObject: object, name: Strings.panningModel) + _distanceModel = ReadWriteAttribute(jsObject: object, name: Strings.distanceModel) + _positionX = ReadWriteAttribute(jsObject: object, name: Strings.positionX) + _positionY = ReadWriteAttribute(jsObject: object, name: Strings.positionY) + _positionZ = ReadWriteAttribute(jsObject: object, name: Strings.positionZ) + _orientationX = ReadWriteAttribute(jsObject: object, name: Strings.orientationX) + _orientationY = ReadWriteAttribute(jsObject: object, name: Strings.orientationY) + _orientationZ = ReadWriteAttribute(jsObject: object, name: Strings.orientationZ) + _refDistance = ReadWriteAttribute(jsObject: object, name: Strings.refDistance) + _maxDistance = ReadWriteAttribute(jsObject: object, name: Strings.maxDistance) + _rolloffFactor = ReadWriteAttribute(jsObject: object, name: Strings.rolloffFactor) + _coneInnerAngle = ReadWriteAttribute(jsObject: object, name: Strings.coneInnerAngle) + _coneOuterAngle = ReadWriteAttribute(jsObject: object, name: Strings.coneOuterAngle) + _coneOuterGain = ReadWriteAttribute(jsObject: object, name: Strings.coneOuterGain) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var panningModel: PanningModelType + + @ReadWriteAttribute + public var distanceModel: DistanceModelType + + @ReadWriteAttribute + public var positionX: Float + + @ReadWriteAttribute + public var positionY: Float + + @ReadWriteAttribute + public var positionZ: Float + + @ReadWriteAttribute + public var orientationX: Float + + @ReadWriteAttribute + public var orientationY: Float + + @ReadWriteAttribute + public var orientationZ: Float + + @ReadWriteAttribute + public var refDistance: Double + + @ReadWriteAttribute + public var maxDistance: Double + + @ReadWriteAttribute + public var rolloffFactor: Double + + @ReadWriteAttribute + public var coneInnerAngle: Double + + @ReadWriteAttribute + public var coneOuterAngle: Double + + @ReadWriteAttribute + public var coneOuterGain: Double +} diff --git a/Sources/DOMKit/WebIDL/PanningModelType.swift b/Sources/DOMKit/WebIDL/PanningModelType.swift new file mode 100644 index 00000000..bc9e3131 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PanningModelType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PanningModelType: JSString, JSValueCompatible { + case equalpower = "equalpower" + case hRTF = "HRTF" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ParityType.swift b/Sources/DOMKit/WebIDL/ParityType.swift new file mode 100644 index 00000000..a90ec594 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ParityType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ParityType: JSString, JSValueCompatible { + case none = "none" + case even = "even" + case odd = "odd" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/PasswordCredential.swift b/Sources/DOMKit/WebIDL/PasswordCredential.swift new file mode 100644 index 00000000..4a93e68f --- /dev/null +++ b/Sources/DOMKit/WebIDL/PasswordCredential.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PasswordCredential: Credential, CredentialUserData { + override public class var constructor: JSFunction { JSObject.global[Strings.PasswordCredential].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _password = ReadonlyAttribute(jsObject: jsObject, name: Strings.password) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(form: HTMLFormElement) { + self.init(unsafelyWrapping: Self.constructor.new(form.jsValue())) + } + + public convenience init(data: PasswordCredentialData) { + self.init(unsafelyWrapping: Self.constructor.new(data.jsValue())) + } + + @ReadonlyAttribute + public var password: String +} diff --git a/Sources/DOMKit/WebIDL/PasswordCredentialData.swift b/Sources/DOMKit/WebIDL/PasswordCredentialData.swift new file mode 100644 index 00000000..fba6045a --- /dev/null +++ b/Sources/DOMKit/WebIDL/PasswordCredentialData.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PasswordCredentialData: BridgedDictionary { + public convenience init(name: String, iconURL: String, origin: String, password: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.iconURL] = iconURL.jsValue() + object[Strings.origin] = origin.jsValue() + object[Strings.password] = password.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _iconURL = ReadWriteAttribute(jsObject: object, name: Strings.iconURL) + _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) + _password = ReadWriteAttribute(jsObject: object, name: Strings.password) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var iconURL: String + + @ReadWriteAttribute + public var origin: String + + @ReadWriteAttribute + public var password: String +} diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index 651a3e4c..e2447d36 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Path2D: JSBridgedClass, CanvasPath { - public class var constructor: JSFunction { JSObject.global.Path2D.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Path2D].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/PaymentComplete.swift b/Sources/DOMKit/WebIDL/PaymentComplete.swift new file mode 100644 index 00000000..3902599c --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentComplete.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PaymentComplete: JSString, JSValueCompatible { + case fail = "fail" + case success = "success" + case unknown = "unknown" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift b/Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift new file mode 100644 index 00000000..98d8bdcf --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentCredentialInstrument: BridgedDictionary { + public convenience init(displayName: String, icon: String, iconMustBeShown: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.displayName] = displayName.jsValue() + object[Strings.icon] = icon.jsValue() + object[Strings.iconMustBeShown] = iconMustBeShown.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _displayName = ReadWriteAttribute(jsObject: object, name: Strings.displayName) + _icon = ReadWriteAttribute(jsObject: object, name: Strings.icon) + _iconMustBeShown = ReadWriteAttribute(jsObject: object, name: Strings.iconMustBeShown) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var displayName: String + + @ReadWriteAttribute + public var icon: String + + @ReadWriteAttribute + public var iconMustBeShown: Bool +} diff --git a/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift b/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift new file mode 100644 index 00000000..06a6d2ec --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentCurrencyAmount: BridgedDictionary { + public convenience init(currency: String, value: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.currency] = currency.jsValue() + object[Strings.value] = value.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _currency = ReadWriteAttribute(jsObject: object, name: Strings.currency) + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var currency: String + + @ReadWriteAttribute + public var value: String +} diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift b/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift new file mode 100644 index 00000000..9817eb69 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentDetailsBase: BridgedDictionary { + public convenience init(displayItems: [PaymentItem], modifiers: [PaymentDetailsModifier]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.displayItems] = displayItems.jsValue() + object[Strings.modifiers] = modifiers.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _displayItems = ReadWriteAttribute(jsObject: object, name: Strings.displayItems) + _modifiers = ReadWriteAttribute(jsObject: object, name: Strings.modifiers) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var displayItems: [PaymentItem] + + @ReadWriteAttribute + public var modifiers: [PaymentDetailsModifier] +} diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift b/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift new file mode 100644 index 00000000..ac3aeb46 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentDetailsInit: BridgedDictionary { + public convenience init(id: String, total: PaymentItem) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.id] = id.jsValue() + object[Strings.total] = total.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _total = ReadWriteAttribute(jsObject: object, name: Strings.total) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var total: PaymentItem +} diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift b/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift new file mode 100644 index 00000000..46fe6d87 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentDetailsModifier: BridgedDictionary { + public convenience init(supportedMethods: String, total: PaymentItem, additionalDisplayItems: [PaymentItem], data: JSObject) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supportedMethods] = supportedMethods.jsValue() + object[Strings.total] = total.jsValue() + object[Strings.additionalDisplayItems] = additionalDisplayItems.jsValue() + object[Strings.data] = data.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _supportedMethods = ReadWriteAttribute(jsObject: object, name: Strings.supportedMethods) + _total = ReadWriteAttribute(jsObject: object, name: Strings.total) + _additionalDisplayItems = ReadWriteAttribute(jsObject: object, name: Strings.additionalDisplayItems) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var supportedMethods: String + + @ReadWriteAttribute + public var total: PaymentItem + + @ReadWriteAttribute + public var additionalDisplayItems: [PaymentItem] + + @ReadWriteAttribute + public var data: JSObject +} diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift b/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift new file mode 100644 index 00000000..93a3c5a6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentDetailsUpdate: BridgedDictionary { + public convenience init(total: PaymentItem, paymentMethodErrors: JSObject) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.total] = total.jsValue() + object[Strings.paymentMethodErrors] = paymentMethodErrors.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _total = ReadWriteAttribute(jsObject: object, name: Strings.total) + _paymentMethodErrors = ReadWriteAttribute(jsObject: object, name: Strings.paymentMethodErrors) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var total: PaymentItem + + @ReadWriteAttribute + public var paymentMethodErrors: JSObject +} diff --git a/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift b/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift new file mode 100644 index 00000000..1ca526cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentHandlerResponse: BridgedDictionary { + public convenience init(methodName: String, details: JSObject) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.methodName] = methodName.jsValue() + object[Strings.details] = details.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _methodName = ReadWriteAttribute(jsObject: object, name: Strings.methodName) + _details = ReadWriteAttribute(jsObject: object, name: Strings.details) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var methodName: String + + @ReadWriteAttribute + public var details: JSObject +} diff --git a/Sources/DOMKit/WebIDL/PaymentInstrument.swift b/Sources/DOMKit/WebIDL/PaymentInstrument.swift new file mode 100644 index 00000000..f3ac37ee --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentInstrument.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentInstrument: BridgedDictionary { + public convenience init(name: String, icons: [ImageObject], method: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.icons] = icons.jsValue() + object[Strings.method] = method.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _icons = ReadWriteAttribute(jsObject: object, name: Strings.icons) + _method = ReadWriteAttribute(jsObject: object, name: Strings.method) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var icons: [ImageObject] + + @ReadWriteAttribute + public var method: String +} diff --git a/Sources/DOMKit/WebIDL/PaymentInstruments.swift b/Sources/DOMKit/WebIDL/PaymentInstruments.swift new file mode 100644 index 00000000..2e342ca9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentInstruments.swift @@ -0,0 +1,74 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentInstruments: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PaymentInstruments].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func delete(instrumentKey: String) -> JSPromise { + jsObject[Strings.delete]!(instrumentKey.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func delete(instrumentKey: String) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.delete]!(instrumentKey.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func get(instrumentKey: String) -> JSPromise { + jsObject[Strings.get]!(instrumentKey.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func get(instrumentKey: String) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.get]!(instrumentKey.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func keys() -> JSPromise { + jsObject[Strings.keys]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func keys() async throws -> [String] { + let _promise: JSPromise = jsObject[Strings.keys]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func has(instrumentKey: String) -> JSPromise { + jsObject[Strings.has]!(instrumentKey.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func has(instrumentKey: String) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.has]!(instrumentKey.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func set(instrumentKey: String, details: PaymentInstrument) -> JSPromise { + jsObject[Strings.set]!(instrumentKey.jsValue(), details.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func set(instrumentKey: String, details: PaymentInstrument) async throws { + let _promise: JSPromise = jsObject[Strings.set]!(instrumentKey.jsValue(), details.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func clear() -> JSPromise { + jsObject[Strings.clear]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func clear() async throws { + let _promise: JSPromise = jsObject[Strings.clear]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/PaymentItem.swift b/Sources/DOMKit/WebIDL/PaymentItem.swift new file mode 100644 index 00000000..75664a54 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentItem.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentItem: BridgedDictionary { + public convenience init(label: String, amount: PaymentCurrencyAmount, pending: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.label] = label.jsValue() + object[Strings.amount] = amount.jsValue() + object[Strings.pending] = pending.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _label = ReadWriteAttribute(jsObject: object, name: Strings.label) + _amount = ReadWriteAttribute(jsObject: object, name: Strings.amount) + _pending = ReadWriteAttribute(jsObject: object, name: Strings.pending) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var label: String + + @ReadWriteAttribute + public var amount: PaymentCurrencyAmount + + @ReadWriteAttribute + public var pending: Bool +} diff --git a/Sources/DOMKit/WebIDL/PaymentManager.swift b/Sources/DOMKit/WebIDL/PaymentManager.swift new file mode 100644 index 00000000..3ce36894 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentManager.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PaymentManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _instruments = ReadonlyAttribute(jsObject: jsObject, name: Strings.instruments) + _userHint = ReadWriteAttribute(jsObject: jsObject, name: Strings.userHint) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var instruments: PaymentInstruments + + @ReadWriteAttribute + public var userHint: String +} diff --git a/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift b/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift new file mode 100644 index 00000000..363bdc23 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentMethodChangeEvent: PaymentRequestUpdateEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.PaymentMethodChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _methodName = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodName) + _methodDetails = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodDetails) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PaymentMethodChangeEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var methodName: String + + @ReadonlyAttribute + public var methodDetails: JSObject? +} diff --git a/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift b/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift new file mode 100644 index 00000000..2e894a7b --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentMethodChangeEventInit: BridgedDictionary { + public convenience init(methodName: String, methodDetails: JSObject?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.methodName] = methodName.jsValue() + object[Strings.methodDetails] = methodDetails.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _methodName = ReadWriteAttribute(jsObject: object, name: Strings.methodName) + _methodDetails = ReadWriteAttribute(jsObject: object, name: Strings.methodDetails) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var methodName: String + + @ReadWriteAttribute + public var methodDetails: JSObject? +} diff --git a/Sources/DOMKit/WebIDL/PaymentMethodData.swift b/Sources/DOMKit/WebIDL/PaymentMethodData.swift new file mode 100644 index 00000000..b64697c3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentMethodData.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentMethodData: BridgedDictionary { + public convenience init(supportedMethods: String, data: JSObject) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supportedMethods] = supportedMethods.jsValue() + object[Strings.data] = data.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _supportedMethods = ReadWriteAttribute(jsObject: object, name: Strings.supportedMethods) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var supportedMethods: String + + @ReadWriteAttribute + public var data: JSObject +} diff --git a/Sources/DOMKit/WebIDL/PaymentRequest.swift b/Sources/DOMKit/WebIDL/PaymentRequest.swift new file mode 100644 index 00000000..308ca402 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentRequest.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentRequest: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequest].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _onpaymentmethodchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpaymentmethodchange) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(methodData: [PaymentMethodData], details: PaymentDetailsInit) { + self.init(unsafelyWrapping: Self.constructor.new(methodData.jsValue(), details.jsValue())) + } + + public func show(detailsPromise: JSPromise? = nil) -> JSPromise { + jsObject[Strings.show]!(detailsPromise?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func show(detailsPromise: JSPromise? = nil) async throws -> PaymentResponse { + let _promise: JSPromise = jsObject[Strings.show]!(detailsPromise?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func abort() -> JSPromise { + jsObject[Strings.abort]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func abort() async throws { + let _promise: JSPromise = jsObject[Strings.abort]!().fromJSValue()! + _ = try await _promise.get() + } + + public func canMakePayment() -> JSPromise { + jsObject[Strings.canMakePayment]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func canMakePayment() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.canMakePayment]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var id: String + + @ClosureAttribute.Optional1 + public var onpaymentmethodchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift b/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift new file mode 100644 index 00000000..baff20bb --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentRequestDetailsUpdate: BridgedDictionary { + public convenience init(error: String, total: PaymentCurrencyAmount, modifiers: [PaymentDetailsModifier], paymentMethodErrors: JSObject) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.error] = error.jsValue() + object[Strings.total] = total.jsValue() + object[Strings.modifiers] = modifiers.jsValue() + object[Strings.paymentMethodErrors] = paymentMethodErrors.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _error = ReadWriteAttribute(jsObject: object, name: Strings.error) + _total = ReadWriteAttribute(jsObject: object, name: Strings.total) + _modifiers = ReadWriteAttribute(jsObject: object, name: Strings.modifiers) + _paymentMethodErrors = ReadWriteAttribute(jsObject: object, name: Strings.paymentMethodErrors) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var error: String + + @ReadWriteAttribute + public var total: PaymentCurrencyAmount + + @ReadWriteAttribute + public var modifiers: [PaymentDetailsModifier] + + @ReadWriteAttribute + public var paymentMethodErrors: JSObject +} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift new file mode 100644 index 00000000..816cc01b --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentRequestEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequestEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _topOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.topOrigin) + _paymentRequestOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentRequestOrigin) + _paymentRequestId = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentRequestId) + _methodData = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodData) + _total = ReadonlyAttribute(jsObject: jsObject, name: Strings.total) + _modifiers = ReadonlyAttribute(jsObject: jsObject, name: Strings.modifiers) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PaymentRequestEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var topOrigin: String + + @ReadonlyAttribute + public var paymentRequestOrigin: String + + @ReadonlyAttribute + public var paymentRequestId: String + + @ReadonlyAttribute + public var methodData: [PaymentMethodData] + + @ReadonlyAttribute + public var total: JSObject + + @ReadonlyAttribute + public var modifiers: [PaymentDetailsModifier] + + public func openWindow(url: String) -> JSPromise { + jsObject[Strings.openWindow]!(url.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func openWindow(url: String) async throws -> WindowClient? { + let _promise: JSPromise = jsObject[Strings.openWindow]!(url.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) -> JSPromise { + jsObject[Strings.changePaymentMethod]!(methodName.jsValue(), methodDetails?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) async throws -> PaymentRequestDetailsUpdate? { + let _promise: JSPromise = jsObject[Strings.changePaymentMethod]!(methodName.jsValue(), methodDetails?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func respondWith(handlerResponsePromise: JSPromise) { + _ = jsObject[Strings.respondWith]!(handlerResponsePromise.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift b/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift new file mode 100644 index 00000000..43ad5559 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentRequestEventInit: BridgedDictionary { + public convenience init(topOrigin: String, paymentRequestOrigin: String, paymentRequestId: String, methodData: [PaymentMethodData], total: PaymentCurrencyAmount, modifiers: [PaymentDetailsModifier]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.topOrigin] = topOrigin.jsValue() + object[Strings.paymentRequestOrigin] = paymentRequestOrigin.jsValue() + object[Strings.paymentRequestId] = paymentRequestId.jsValue() + object[Strings.methodData] = methodData.jsValue() + object[Strings.total] = total.jsValue() + object[Strings.modifiers] = modifiers.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _topOrigin = ReadWriteAttribute(jsObject: object, name: Strings.topOrigin) + _paymentRequestOrigin = ReadWriteAttribute(jsObject: object, name: Strings.paymentRequestOrigin) + _paymentRequestId = ReadWriteAttribute(jsObject: object, name: Strings.paymentRequestId) + _methodData = ReadWriteAttribute(jsObject: object, name: Strings.methodData) + _total = ReadWriteAttribute(jsObject: object, name: Strings.total) + _modifiers = ReadWriteAttribute(jsObject: object, name: Strings.modifiers) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var topOrigin: String + + @ReadWriteAttribute + public var paymentRequestOrigin: String + + @ReadWriteAttribute + public var paymentRequestId: String + + @ReadWriteAttribute + public var methodData: [PaymentMethodData] + + @ReadWriteAttribute + public var total: PaymentCurrencyAmount + + @ReadWriteAttribute + public var modifiers: [PaymentDetailsModifier] +} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift new file mode 100644 index 00000000..c384e263 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentRequestUpdateEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequestUpdateEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PaymentRequestUpdateEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + public func updateWith(detailsPromise: JSPromise) { + _ = jsObject[Strings.updateWith]!(detailsPromise.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEventInit.swift b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEventInit.swift new file mode 100644 index 00000000..71136493 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEventInit.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentRequestUpdateEventInit: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/PaymentResponse.swift b/Sources/DOMKit/WebIDL/PaymentResponse.swift new file mode 100644 index 00000000..93a86f7b --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentResponse.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentResponse: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.PaymentResponse].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _requestId = ReadonlyAttribute(jsObject: jsObject, name: Strings.requestId) + _methodName = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodName) + _details = ReadonlyAttribute(jsObject: jsObject, name: Strings.details) + super.init(unsafelyWrapping: jsObject) + } + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + @ReadonlyAttribute + public var requestId: String + + @ReadonlyAttribute + public var methodName: String + + @ReadonlyAttribute + public var details: JSObject + + public func complete(result: PaymentComplete? = nil) -> JSPromise { + jsObject[Strings.complete]!(result?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func complete(result: PaymentComplete? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.complete]!(result?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func retry(errorFields: PaymentValidationErrors? = nil) -> JSPromise { + jsObject[Strings.retry]!(errorFields?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func retry(errorFields: PaymentValidationErrors? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.retry]!(errorFields?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift b/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift new file mode 100644 index 00000000..d4030bb5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PaymentValidationErrors: BridgedDictionary { + public convenience init(error: String, paymentMethod: JSObject) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.error] = error.jsValue() + object[Strings.paymentMethod] = paymentMethod.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _error = ReadWriteAttribute(jsObject: object, name: Strings.error) + _paymentMethod = ReadWriteAttribute(jsObject: object, name: Strings.paymentMethod) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var error: String + + @ReadWriteAttribute + public var paymentMethod: JSObject +} diff --git a/Sources/DOMKit/WebIDL/Pbkdf2Params.swift b/Sources/DOMKit/WebIDL/Pbkdf2Params.swift new file mode 100644 index 00000000..4fc86742 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Pbkdf2Params.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Pbkdf2Params: BridgedDictionary { + public convenience init(salt: BufferSource, iterations: UInt32, hash: HashAlgorithmIdentifier) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.salt] = salt.jsValue() + object[Strings.iterations] = iterations.jsValue() + object[Strings.hash] = hash.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _salt = ReadWriteAttribute(jsObject: object, name: Strings.salt) + _iterations = ReadWriteAttribute(jsObject: object, name: Strings.iterations) + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var salt: BufferSource + + @ReadWriteAttribute + public var iterations: UInt32 + + @ReadWriteAttribute + public var hash: HashAlgorithmIdentifier +} diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index 686089c1..7b9ff210 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -4,13 +4,51 @@ import JavaScriptEventLoop import JavaScriptKit public class Performance: EventTarget { - override public class var constructor: JSFunction { JSObject.global.Performance.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.Performance].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _onresourcetimingbufferfull = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresourcetimingbufferfull) + _timing = ReadonlyAttribute(jsObject: jsObject, name: Strings.timing) + _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeOrigin) + _eventCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.eventCounts) + _interactionCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionCounts) super.init(unsafelyWrapping: jsObject) } + public func mark(markName: String, markOptions: PerformanceMarkOptions? = nil) -> PerformanceMark { + jsObject[Strings.mark]!(markName.jsValue(), markOptions?.jsValue() ?? .undefined).fromJSValue()! + } + + public func clearMarks(markName: String? = nil) { + _ = jsObject[Strings.clearMarks]!(markName?.jsValue() ?? .undefined) + } + + public func measure(measureName: String, startOrMeasureOptions: __UNSUPPORTED_UNION__? = nil, endMark: String? = nil) -> PerformanceMeasure { + jsObject[Strings.measure]!(measureName.jsValue(), startOrMeasureOptions?.jsValue() ?? .undefined, endMark?.jsValue() ?? .undefined).fromJSValue()! + } + + public func clearMeasures(measureName: String? = nil) { + _ = jsObject[Strings.clearMeasures]!(measureName?.jsValue() ?? .undefined) + } + + public func clearResourceTimings() { + _ = jsObject[Strings.clearResourceTimings]!() + } + + public func setResourceTimingBufferSize(maxSize: UInt32) { + _ = jsObject[Strings.setResourceTimingBufferSize]!(maxSize.jsValue()) + } + + @ClosureAttribute.Optional1 + public var onresourcetimingbufferfull: EventHandler + + @ReadonlyAttribute + public var timing: PerformanceTiming + + @ReadonlyAttribute + public var navigation: PerformanceNavigation + public func now() -> DOMHighResTimeStamp { jsObject[Strings.now]!().fromJSValue()! } @@ -21,4 +59,32 @@ public class Performance: EventTarget { public func toJSON() -> JSObject { jsObject[Strings.toJSON]!().fromJSValue()! } + + @ReadonlyAttribute + public var eventCounts: EventCounts + + @ReadonlyAttribute + public var interactionCounts: InteractionCounts + + public func measureUserAgentSpecificMemory() -> JSPromise { + jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { + let _promise: JSPromise = jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getEntries() -> PerformanceEntryList { + jsObject[Strings.getEntries]!().fromJSValue()! + } + + public func getEntriesByType(type: String) -> PerformanceEntryList { + jsObject[Strings.getEntriesByType]!(type.jsValue()).fromJSValue()! + } + + public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { + jsObject[Strings.getEntriesByName]!(name.jsValue(), type?.jsValue() ?? .undefined).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift b/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift new file mode 100644 index 00000000..687f8962 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceElementTiming: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceElementTiming].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _renderTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderTime) + _loadTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadTime) + _intersectionRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.intersectionRect) + _identifier = ReadonlyAttribute(jsObject: jsObject, name: Strings.identifier) + _naturalWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.naturalWidth) + _naturalHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.naturalHeight) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _element = ReadonlyAttribute(jsObject: jsObject, name: Strings.element) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var renderTime: DOMHighResTimeStamp + + @ReadonlyAttribute + public var loadTime: DOMHighResTimeStamp + + @ReadonlyAttribute + public var intersectionRect: DOMRectReadOnly + + @ReadonlyAttribute + public var identifier: String + + @ReadonlyAttribute + public var naturalWidth: UInt32 + + @ReadonlyAttribute + public var naturalHeight: UInt32 + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var element: Element? + + @ReadonlyAttribute + public var url: String + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceEntry.swift b/Sources/DOMKit/WebIDL/PerformanceEntry.swift new file mode 100644 index 00000000..8067ed70 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceEntry.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceEntry: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PerformanceEntry].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _entryType = ReadonlyAttribute(jsObject: jsObject, name: Strings.entryType) + _startTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.startTime) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var entryType: String + + @ReadonlyAttribute + public var startTime: DOMHighResTimeStamp + + @ReadonlyAttribute + public var duration: DOMHighResTimeStamp + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift b/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift new file mode 100644 index 00000000..12dc737f --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceEventTiming: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceEventTiming].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _processingStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.processingStart) + _processingEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.processingEnd) + _cancelable = ReadonlyAttribute(jsObject: jsObject, name: Strings.cancelable) + _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) + _interactionId = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionId) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var processingStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var processingEnd: DOMHighResTimeStamp + + @ReadonlyAttribute + public var cancelable: Bool + + @ReadonlyAttribute + public var target: Node? + + @ReadonlyAttribute + public var interactionId: UInt64 + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift b/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift new file mode 100644 index 00000000..b3087e7e --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceLongTaskTiming: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceLongTaskTiming].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _attribution = ReadonlyAttribute(jsObject: jsObject, name: Strings.attribution) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var attribution: [TaskAttributionTiming] + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceMark.swift b/Sources/DOMKit/WebIDL/PerformanceMark.swift new file mode 100644 index 00000000..e609ef4f --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceMark.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceMark: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceMark].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(markName: String, markOptions: PerformanceMarkOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(markName.jsValue(), markOptions?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var detail: JSValue +} diff --git a/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift b/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift new file mode 100644 index 00000000..1d5c909f --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceMarkOptions: BridgedDictionary { + public convenience init(detail: JSValue, startTime: DOMHighResTimeStamp) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.detail] = detail.jsValue() + object[Strings.startTime] = startTime.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _detail = ReadWriteAttribute(jsObject: object, name: Strings.detail) + _startTime = ReadWriteAttribute(jsObject: object, name: Strings.startTime) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var detail: JSValue + + @ReadWriteAttribute + public var startTime: DOMHighResTimeStamp +} diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasure.swift b/Sources/DOMKit/WebIDL/PerformanceMeasure.swift new file mode 100644 index 00000000..438a361f --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceMeasure.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceMeasure: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceMeasure].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var detail: JSValue +} diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift new file mode 100644 index 00000000..b0f971c2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceMeasureOptions: BridgedDictionary { + public convenience init(detail: JSValue, start: __UNSUPPORTED_UNION__, duration: DOMHighResTimeStamp, end: __UNSUPPORTED_UNION__) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.detail] = detail.jsValue() + object[Strings.start] = start.jsValue() + object[Strings.duration] = duration.jsValue() + object[Strings.end] = end.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _detail = ReadWriteAttribute(jsObject: object, name: Strings.detail) + _start = ReadWriteAttribute(jsObject: object, name: Strings.start) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _end = ReadWriteAttribute(jsObject: object, name: Strings.end) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var detail: JSValue + + @ReadWriteAttribute + public var start: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var duration: DOMHighResTimeStamp + + @ReadWriteAttribute + public var end: __UNSUPPORTED_UNION__ +} diff --git a/Sources/DOMKit/WebIDL/PerformanceNavigation.swift b/Sources/DOMKit/WebIDL/PerformanceNavigation.swift new file mode 100644 index 00000000..2cc4ef59 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceNavigation.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceNavigation: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PerformanceNavigation].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _redirectCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectCount) + self.jsObject = jsObject + } + + public static let TYPE_NAVIGATE: UInt16 = 0 + + public static let TYPE_RELOAD: UInt16 = 1 + + public static let TYPE_BACK_FORWARD: UInt16 = 2 + + public static let TYPE_RESERVED: UInt16 = 255 + + @ReadonlyAttribute + public var type: UInt16 + + @ReadonlyAttribute + public var redirectCount: UInt16 + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift b/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift new file mode 100644 index 00000000..e7574120 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceNavigationTiming: PerformanceResourceTiming { + override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceNavigationTiming].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _unloadEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.unloadEventStart) + _unloadEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.unloadEventEnd) + _domInteractive = ReadonlyAttribute(jsObject: jsObject, name: Strings.domInteractive) + _domContentLoadedEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.domContentLoadedEventStart) + _domContentLoadedEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.domContentLoadedEventEnd) + _domComplete = ReadonlyAttribute(jsObject: jsObject, name: Strings.domComplete) + _loadEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadEventStart) + _loadEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadEventEnd) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _redirectCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectCount) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var unloadEventStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var unloadEventEnd: DOMHighResTimeStamp + + @ReadonlyAttribute + public var domInteractive: DOMHighResTimeStamp + + @ReadonlyAttribute + public var domContentLoadedEventStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var domContentLoadedEventEnd: DOMHighResTimeStamp + + @ReadonlyAttribute + public var domComplete: DOMHighResTimeStamp + + @ReadonlyAttribute + public var loadEventStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var loadEventEnd: DOMHighResTimeStamp + + @ReadonlyAttribute + public var type: NavigationTimingType + + @ReadonlyAttribute + public var redirectCount: UInt16 + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceObserver.swift b/Sources/DOMKit/WebIDL/PerformanceObserver.swift new file mode 100644 index 00000000..c097c34a --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceObserver.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceObserver: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PerformanceObserver].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _supportedEntryTypes = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedEntryTypes) + self.jsObject = jsObject + } + + public convenience init(callback: PerformanceObserverCallback) { + self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue())) + } + + public func observe(options: PerformanceObserverInit? = nil) { + _ = jsObject[Strings.observe]!(options?.jsValue() ?? .undefined) + } + + public func disconnect() { + _ = jsObject[Strings.disconnect]!() + } + + public func takeRecords() -> PerformanceEntryList { + jsObject[Strings.takeRecords]!().fromJSValue()! + } + + @ReadonlyAttribute + public var supportedEntryTypes: [String] +} diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift b/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift new file mode 100644 index 00000000..a9862713 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceObserverCallbackOptions: BridgedDictionary { + public convenience init(droppedEntriesCount: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.droppedEntriesCount] = droppedEntriesCount.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _droppedEntriesCount = ReadWriteAttribute(jsObject: object, name: Strings.droppedEntriesCount) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var droppedEntriesCount: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift b/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift new file mode 100644 index 00000000..ea733f35 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceObserverEntryList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PerformanceObserverEntryList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func getEntries() -> PerformanceEntryList { + jsObject[Strings.getEntries]!().fromJSValue()! + } + + public func getEntriesByType(type: String) -> PerformanceEntryList { + jsObject[Strings.getEntriesByType]!(type.jsValue()).fromJSValue()! + } + + public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { + jsObject[Strings.getEntriesByName]!(name.jsValue(), type?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift b/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift new file mode 100644 index 00000000..95590581 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceObserverInit: BridgedDictionary { + public convenience init(durationThreshold: DOMHighResTimeStamp, entryTypes: [String], type: String, buffered: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.durationThreshold] = durationThreshold.jsValue() + object[Strings.entryTypes] = entryTypes.jsValue() + object[Strings.type] = type.jsValue() + object[Strings.buffered] = buffered.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _durationThreshold = ReadWriteAttribute(jsObject: object, name: Strings.durationThreshold) + _entryTypes = ReadWriteAttribute(jsObject: object, name: Strings.entryTypes) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _buffered = ReadWriteAttribute(jsObject: object, name: Strings.buffered) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var durationThreshold: DOMHighResTimeStamp + + @ReadWriteAttribute + public var entryTypes: [String] + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var buffered: Bool +} diff --git a/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift b/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift new file mode 100644 index 00000000..023cb736 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformancePaintTiming: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.PerformancePaintTiming].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift b/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift new file mode 100644 index 00000000..78ad408e --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift @@ -0,0 +1,88 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceResourceTiming: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceResourceTiming].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _serverTiming = ReadonlyAttribute(jsObject: jsObject, name: Strings.serverTiming) + _initiatorType = ReadonlyAttribute(jsObject: jsObject, name: Strings.initiatorType) + _nextHopProtocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.nextHopProtocol) + _workerStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.workerStart) + _redirectStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectStart) + _redirectEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectEnd) + _fetchStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.fetchStart) + _domainLookupStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.domainLookupStart) + _domainLookupEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.domainLookupEnd) + _connectStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectStart) + _connectEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectEnd) + _secureConnectionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.secureConnectionStart) + _requestStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.requestStart) + _responseStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseStart) + _responseEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseEnd) + _transferSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.transferSize) + _encodedBodySize = ReadonlyAttribute(jsObject: jsObject, name: Strings.encodedBodySize) + _decodedBodySize = ReadonlyAttribute(jsObject: jsObject, name: Strings.decodedBodySize) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var serverTiming: [PerformanceServerTiming] + + @ReadonlyAttribute + public var initiatorType: String + + @ReadonlyAttribute + public var nextHopProtocol: String + + @ReadonlyAttribute + public var workerStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var redirectStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var redirectEnd: DOMHighResTimeStamp + + @ReadonlyAttribute + public var fetchStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var domainLookupStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var domainLookupEnd: DOMHighResTimeStamp + + @ReadonlyAttribute + public var connectStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var connectEnd: DOMHighResTimeStamp + + @ReadonlyAttribute + public var secureConnectionStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var requestStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var responseStart: DOMHighResTimeStamp + + @ReadonlyAttribute + public var responseEnd: DOMHighResTimeStamp + + @ReadonlyAttribute + public var transferSize: UInt64 + + @ReadonlyAttribute + public var encodedBodySize: UInt64 + + @ReadonlyAttribute + public var decodedBodySize: UInt64 + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift b/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift new file mode 100644 index 00000000..be8be52e --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceServerTiming: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PerformanceServerTiming].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _description = ReadonlyAttribute(jsObject: jsObject, name: Strings.description) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var duration: DOMHighResTimeStamp + + @ReadonlyAttribute + public var description: String + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PerformanceTiming.swift b/Sources/DOMKit/WebIDL/PerformanceTiming.swift new file mode 100644 index 00000000..9b768f29 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceTiming.swift @@ -0,0 +1,102 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PerformanceTiming: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PerformanceTiming].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _navigationStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationStart) + _unloadEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.unloadEventStart) + _unloadEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.unloadEventEnd) + _redirectStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectStart) + _redirectEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectEnd) + _fetchStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.fetchStart) + _domainLookupStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.domainLookupStart) + _domainLookupEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.domainLookupEnd) + _connectStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectStart) + _connectEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectEnd) + _secureConnectionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.secureConnectionStart) + _requestStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.requestStart) + _responseStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseStart) + _responseEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseEnd) + _domLoading = ReadonlyAttribute(jsObject: jsObject, name: Strings.domLoading) + _domInteractive = ReadonlyAttribute(jsObject: jsObject, name: Strings.domInteractive) + _domContentLoadedEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.domContentLoadedEventStart) + _domContentLoadedEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.domContentLoadedEventEnd) + _domComplete = ReadonlyAttribute(jsObject: jsObject, name: Strings.domComplete) + _loadEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadEventStart) + _loadEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadEventEnd) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var navigationStart: UInt64 + + @ReadonlyAttribute + public var unloadEventStart: UInt64 + + @ReadonlyAttribute + public var unloadEventEnd: UInt64 + + @ReadonlyAttribute + public var redirectStart: UInt64 + + @ReadonlyAttribute + public var redirectEnd: UInt64 + + @ReadonlyAttribute + public var fetchStart: UInt64 + + @ReadonlyAttribute + public var domainLookupStart: UInt64 + + @ReadonlyAttribute + public var domainLookupEnd: UInt64 + + @ReadonlyAttribute + public var connectStart: UInt64 + + @ReadonlyAttribute + public var connectEnd: UInt64 + + @ReadonlyAttribute + public var secureConnectionStart: UInt64 + + @ReadonlyAttribute + public var requestStart: UInt64 + + @ReadonlyAttribute + public var responseStart: UInt64 + + @ReadonlyAttribute + public var responseEnd: UInt64 + + @ReadonlyAttribute + public var domLoading: UInt64 + + @ReadonlyAttribute + public var domInteractive: UInt64 + + @ReadonlyAttribute + public var domContentLoadedEventStart: UInt64 + + @ReadonlyAttribute + public var domContentLoadedEventEnd: UInt64 + + @ReadonlyAttribute + public var domComplete: UInt64 + + @ReadonlyAttribute + public var loadEventStart: UInt64 + + @ReadonlyAttribute + public var loadEventEnd: UInt64 + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift b/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift new file mode 100644 index 00000000..62e92235 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PeriodicSyncEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.PeriodicSyncEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _tag = ReadonlyAttribute(jsObject: jsObject, name: Strings.tag) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, init: PeriodicSyncEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + } + + @ReadonlyAttribute + public var tag: String +} diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift b/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift new file mode 100644 index 00000000..99f354c4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PeriodicSyncEventInit: BridgedDictionary { + public convenience init(tag: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.tag] = tag.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _tag = ReadWriteAttribute(jsObject: object, name: Strings.tag) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var tag: String +} diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift b/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift new file mode 100644 index 00000000..a8122aed --- /dev/null +++ b/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PeriodicSyncManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PeriodicSyncManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func register(tag: String, options: BackgroundSyncOptions? = nil) -> JSPromise { + jsObject[Strings.register]!(tag.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func register(tag: String, options: BackgroundSyncOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.register]!(tag.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func getTags() -> JSPromise { + jsObject[Strings.getTags]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getTags() async throws -> [String] { + let _promise: JSPromise = jsObject[Strings.getTags]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func unregister(tag: String) -> JSPromise { + jsObject[Strings.unregister]!(tag.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func unregister(tag: String) async throws { + let _promise: JSPromise = jsObject[Strings.unregister]!(tag.jsValue()).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/PeriodicWave.swift b/Sources/DOMKit/WebIDL/PeriodicWave.swift new file mode 100644 index 00000000..5309e2ae --- /dev/null +++ b/Sources/DOMKit/WebIDL/PeriodicWave.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PeriodicWave: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PeriodicWave].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(context: BaseAudioContext, options: PeriodicWaveOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift b/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift new file mode 100644 index 00000000..1c559abe --- /dev/null +++ b/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PeriodicWaveConstraints: BridgedDictionary { + public convenience init(disableNormalization: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.disableNormalization] = disableNormalization.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _disableNormalization = ReadWriteAttribute(jsObject: object, name: Strings.disableNormalization) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var disableNormalization: Bool +} diff --git a/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift b/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift new file mode 100644 index 00000000..d99e88be --- /dev/null +++ b/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PeriodicWaveOptions: BridgedDictionary { + public convenience init(real: [Float], imag: [Float]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.real] = real.jsValue() + object[Strings.imag] = imag.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _real = ReadWriteAttribute(jsObject: object, name: Strings.real) + _imag = ReadWriteAttribute(jsObject: object, name: Strings.imag) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var real: [Float] + + @ReadWriteAttribute + public var imag: [Float] +} diff --git a/Sources/DOMKit/WebIDL/PermissionDescriptor.swift b/Sources/DOMKit/WebIDL/PermissionDescriptor.swift new file mode 100644 index 00000000..f57973fc --- /dev/null +++ b/Sources/DOMKit/WebIDL/PermissionDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PermissionDescriptor: BridgedDictionary { + public convenience init(name: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/PermissionSetParameters.swift b/Sources/DOMKit/WebIDL/PermissionSetParameters.swift new file mode 100644 index 00000000..09f0411c --- /dev/null +++ b/Sources/DOMKit/WebIDL/PermissionSetParameters.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PermissionSetParameters: BridgedDictionary { + public convenience init(descriptor: PermissionDescriptor, state: PermissionState, oneRealm: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.descriptor] = descriptor.jsValue() + object[Strings.state] = state.jsValue() + object[Strings.oneRealm] = oneRealm.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _descriptor = ReadWriteAttribute(jsObject: object, name: Strings.descriptor) + _state = ReadWriteAttribute(jsObject: object, name: Strings.state) + _oneRealm = ReadWriteAttribute(jsObject: object, name: Strings.oneRealm) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var descriptor: PermissionDescriptor + + @ReadWriteAttribute + public var state: PermissionState + + @ReadWriteAttribute + public var oneRealm: Bool +} diff --git a/Sources/DOMKit/WebIDL/PermissionState.swift b/Sources/DOMKit/WebIDL/PermissionState.swift new file mode 100644 index 00000000..e78319cf --- /dev/null +++ b/Sources/DOMKit/WebIDL/PermissionState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PermissionState: JSString, JSValueCompatible { + case granted = "granted" + case denied = "denied" + case prompt = "prompt" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/PermissionStatus.swift b/Sources/DOMKit/WebIDL/PermissionStatus.swift new file mode 100644 index 00000000..d11b2eb3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PermissionStatus.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PermissionStatus: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.PermissionStatus].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var state: PermissionState + + @ReadonlyAttribute + public var name: String + + @ClosureAttribute.Optional1 + public var onchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/Permissions.swift b/Sources/DOMKit/WebIDL/Permissions.swift new file mode 100644 index 00000000..c5b26a34 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Permissions.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Permissions: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Permissions].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func query(permissionDesc: JSObject) -> JSPromise { + jsObject[Strings.query]!(permissionDesc.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func query(permissionDesc: JSObject) async throws -> PermissionStatus { + let _promise: JSPromise = jsObject[Strings.query]!(permissionDesc.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func revoke(permissionDesc: JSObject) -> JSPromise { + jsObject[Strings.revoke]!(permissionDesc.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func revoke(permissionDesc: JSObject) async throws -> PermissionStatus { + let _promise: JSPromise = jsObject[Strings.revoke]!(permissionDesc.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func request(permissionDesc: JSObject) -> JSPromise { + jsObject[Strings.request]!(permissionDesc.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func request(permissionDesc: JSObject) async throws -> PermissionStatus { + let _promise: JSPromise = jsObject[Strings.request]!(permissionDesc.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PermissionsPolicy.swift b/Sources/DOMKit/WebIDL/PermissionsPolicy.swift new file mode 100644 index 00000000..fe14f767 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PermissionsPolicy.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PermissionsPolicy: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PermissionsPolicy].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func allowsFeature(feature: String, origin: String? = nil) -> Bool { + jsObject[Strings.allowsFeature]!(feature.jsValue(), origin?.jsValue() ?? .undefined).fromJSValue()! + } + + public func features() -> [String] { + jsObject[Strings.features]!().fromJSValue()! + } + + public func allowedFeatures() -> [String] { + jsObject[Strings.allowedFeatures]!().fromJSValue()! + } + + public func getAllowlistForFeature(feature: String) -> [String] { + jsObject[Strings.getAllowlistForFeature]!(feature.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift b/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift new file mode 100644 index 00000000..1f781aa8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PermissionsPolicyViolationReportBody: ReportBody { + override public class var constructor: JSFunction { JSObject.global[Strings.PermissionsPolicyViolationReportBody].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _featureId = ReadonlyAttribute(jsObject: jsObject, name: Strings.featureId) + _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) + _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) + _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) + _disposition = ReadonlyAttribute(jsObject: jsObject, name: Strings.disposition) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var featureId: String + + @ReadonlyAttribute + public var sourceFile: String? + + @ReadonlyAttribute + public var lineNumber: Int32? + + @ReadonlyAttribute + public var columnNumber: Int32? + + @ReadonlyAttribute + public var disposition: String +} diff --git a/Sources/DOMKit/WebIDL/PhotoCapabilities.swift b/Sources/DOMKit/WebIDL/PhotoCapabilities.swift new file mode 100644 index 00000000..ed2f3ae6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PhotoCapabilities.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PhotoCapabilities: BridgedDictionary { + public convenience init(redEyeReduction: RedEyeReduction, imageHeight: MediaSettingsRange, imageWidth: MediaSettingsRange, fillLightMode: [FillLightMode]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.redEyeReduction] = redEyeReduction.jsValue() + object[Strings.imageHeight] = imageHeight.jsValue() + object[Strings.imageWidth] = imageWidth.jsValue() + object[Strings.fillLightMode] = fillLightMode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _redEyeReduction = ReadWriteAttribute(jsObject: object, name: Strings.redEyeReduction) + _imageHeight = ReadWriteAttribute(jsObject: object, name: Strings.imageHeight) + _imageWidth = ReadWriteAttribute(jsObject: object, name: Strings.imageWidth) + _fillLightMode = ReadWriteAttribute(jsObject: object, name: Strings.fillLightMode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var redEyeReduction: RedEyeReduction + + @ReadWriteAttribute + public var imageHeight: MediaSettingsRange + + @ReadWriteAttribute + public var imageWidth: MediaSettingsRange + + @ReadWriteAttribute + public var fillLightMode: [FillLightMode] +} diff --git a/Sources/DOMKit/WebIDL/PhotoSettings.swift b/Sources/DOMKit/WebIDL/PhotoSettings.swift new file mode 100644 index 00000000..dc4f4972 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PhotoSettings.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PhotoSettings: BridgedDictionary { + public convenience init(fillLightMode: FillLightMode, imageHeight: Double, imageWidth: Double, redEyeReduction: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.fillLightMode] = fillLightMode.jsValue() + object[Strings.imageHeight] = imageHeight.jsValue() + object[Strings.imageWidth] = imageWidth.jsValue() + object[Strings.redEyeReduction] = redEyeReduction.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _fillLightMode = ReadWriteAttribute(jsObject: object, name: Strings.fillLightMode) + _imageHeight = ReadWriteAttribute(jsObject: object, name: Strings.imageHeight) + _imageWidth = ReadWriteAttribute(jsObject: object, name: Strings.imageWidth) + _redEyeReduction = ReadWriteAttribute(jsObject: object, name: Strings.redEyeReduction) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var fillLightMode: FillLightMode + + @ReadWriteAttribute + public var imageHeight: Double + + @ReadWriteAttribute + public var imageWidth: Double + + @ReadWriteAttribute + public var redEyeReduction: Bool +} diff --git a/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift b/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift new file mode 100644 index 00000000..fa54505e --- /dev/null +++ b/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PictureInPictureEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.PictureInPictureEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _pictureInPictureWindow = ReadonlyAttribute(jsObject: jsObject, name: Strings.pictureInPictureWindow) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PictureInPictureEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var pictureInPictureWindow: PictureInPictureWindow +} diff --git a/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift b/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift new file mode 100644 index 00000000..af307ef9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PictureInPictureEventInit: BridgedDictionary { + public convenience init(pictureInPictureWindow: PictureInPictureWindow) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.pictureInPictureWindow] = pictureInPictureWindow.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _pictureInPictureWindow = ReadWriteAttribute(jsObject: object, name: Strings.pictureInPictureWindow) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var pictureInPictureWindow: PictureInPictureWindow +} diff --git a/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift b/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift new file mode 100644 index 00000000..4343f4ef --- /dev/null +++ b/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PictureInPictureWindow: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.PictureInPictureWindow].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _onresize = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresize) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var width: Int32 + + @ReadonlyAttribute + public var height: Int32 + + @ClosureAttribute.Optional1 + public var onresize: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/PlaneLayout.swift b/Sources/DOMKit/WebIDL/PlaneLayout.swift new file mode 100644 index 00000000..c460bc99 --- /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/PlaybackDirection.swift b/Sources/DOMKit/WebIDL/PlaybackDirection.swift new file mode 100644 index 00000000..63e727d3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PlaybackDirection.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PlaybackDirection: JSString, JSValueCompatible { + case normal = "normal" + case reverse = "reverse" + case alternate = "alternate" + case alternateReverse = "alternate-reverse" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Plugin.swift b/Sources/DOMKit/WebIDL/Plugin.swift index 882849f2..d92b871c 100644 --- a/Sources/DOMKit/WebIDL/Plugin.swift +++ b/Sources/DOMKit/WebIDL/Plugin.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Plugin: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.Plugin.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Plugin].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/PluginArray.swift b/Sources/DOMKit/WebIDL/PluginArray.swift index 6d7e0717..1204e492 100644 --- a/Sources/DOMKit/WebIDL/PluginArray.swift +++ b/Sources/DOMKit/WebIDL/PluginArray.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PluginArray: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.PluginArray.function! } + public class var constructor: JSFunction { JSObject.global[Strings.PluginArray].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/Point2D.swift b/Sources/DOMKit/WebIDL/Point2D.swift new file mode 100644 index 00000000..340d9d32 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Point2D.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Point2D: BridgedDictionary { + public convenience init(x: Double, y: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var x: Double + + @ReadWriteAttribute + public var y: Double +} diff --git a/Sources/DOMKit/WebIDL/PointerEvent.swift b/Sources/DOMKit/WebIDL/PointerEvent.swift new file mode 100644 index 00000000..01763389 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PointerEvent.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PointerEvent: MouseEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.PointerEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _pointerId = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointerId) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _pressure = ReadonlyAttribute(jsObject: jsObject, name: Strings.pressure) + _tangentialPressure = ReadonlyAttribute(jsObject: jsObject, name: Strings.tangentialPressure) + _tiltX = ReadonlyAttribute(jsObject: jsObject, name: Strings.tiltX) + _tiltY = ReadonlyAttribute(jsObject: jsObject, name: Strings.tiltY) + _twist = ReadonlyAttribute(jsObject: jsObject, name: Strings.twist) + _altitudeAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitudeAngle) + _azimuthAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.azimuthAngle) + _pointerType = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointerType) + _isPrimary = ReadonlyAttribute(jsObject: jsObject, name: Strings.isPrimary) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PointerEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var pointerId: Int32 + + @ReadonlyAttribute + public var width: Double + + @ReadonlyAttribute + public var height: Double + + @ReadonlyAttribute + public var pressure: Float + + @ReadonlyAttribute + public var tangentialPressure: Float + + @ReadonlyAttribute + public var tiltX: Int32 + + @ReadonlyAttribute + public var tiltY: Int32 + + @ReadonlyAttribute + public var twist: Int32 + + @ReadonlyAttribute + public var altitudeAngle: Double + + @ReadonlyAttribute + public var azimuthAngle: Double + + @ReadonlyAttribute + public var pointerType: String + + @ReadonlyAttribute + public var isPrimary: Bool + + public func getCoalescedEvents() -> [PointerEvent] { + jsObject[Strings.getCoalescedEvents]!().fromJSValue()! + } + + public func getPredictedEvents() -> [PointerEvent] { + jsObject[Strings.getPredictedEvents]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PointerEventInit.swift b/Sources/DOMKit/WebIDL/PointerEventInit.swift new file mode 100644 index 00000000..4820bd17 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PointerEventInit.swift @@ -0,0 +1,85 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PointerEventInit: BridgedDictionary { + public convenience init(pointerId: Int32, width: Double, height: Double, pressure: Float, tangentialPressure: Float, tiltX: Int32, tiltY: Int32, twist: Int32, altitudeAngle: Double, azimuthAngle: Double, pointerType: String, isPrimary: Bool, coalescedEvents: [PointerEvent], predictedEvents: [PointerEvent]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.pointerId] = pointerId.jsValue() + object[Strings.width] = width.jsValue() + object[Strings.height] = height.jsValue() + object[Strings.pressure] = pressure.jsValue() + object[Strings.tangentialPressure] = tangentialPressure.jsValue() + object[Strings.tiltX] = tiltX.jsValue() + object[Strings.tiltY] = tiltY.jsValue() + object[Strings.twist] = twist.jsValue() + object[Strings.altitudeAngle] = altitudeAngle.jsValue() + object[Strings.azimuthAngle] = azimuthAngle.jsValue() + object[Strings.pointerType] = pointerType.jsValue() + object[Strings.isPrimary] = isPrimary.jsValue() + object[Strings.coalescedEvents] = coalescedEvents.jsValue() + object[Strings.predictedEvents] = predictedEvents.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _pointerId = ReadWriteAttribute(jsObject: object, name: Strings.pointerId) + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _pressure = ReadWriteAttribute(jsObject: object, name: Strings.pressure) + _tangentialPressure = ReadWriteAttribute(jsObject: object, name: Strings.tangentialPressure) + _tiltX = ReadWriteAttribute(jsObject: object, name: Strings.tiltX) + _tiltY = ReadWriteAttribute(jsObject: object, name: Strings.tiltY) + _twist = ReadWriteAttribute(jsObject: object, name: Strings.twist) + _altitudeAngle = ReadWriteAttribute(jsObject: object, name: Strings.altitudeAngle) + _azimuthAngle = ReadWriteAttribute(jsObject: object, name: Strings.azimuthAngle) + _pointerType = ReadWriteAttribute(jsObject: object, name: Strings.pointerType) + _isPrimary = ReadWriteAttribute(jsObject: object, name: Strings.isPrimary) + _coalescedEvents = ReadWriteAttribute(jsObject: object, name: Strings.coalescedEvents) + _predictedEvents = ReadWriteAttribute(jsObject: object, name: Strings.predictedEvents) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var pointerId: Int32 + + @ReadWriteAttribute + public var width: Double + + @ReadWriteAttribute + public var height: Double + + @ReadWriteAttribute + public var pressure: Float + + @ReadWriteAttribute + public var tangentialPressure: Float + + @ReadWriteAttribute + public var tiltX: Int32 + + @ReadWriteAttribute + public var tiltY: Int32 + + @ReadWriteAttribute + public var twist: Int32 + + @ReadWriteAttribute + public var altitudeAngle: Double + + @ReadWriteAttribute + public var azimuthAngle: Double + + @ReadWriteAttribute + public var pointerType: String + + @ReadWriteAttribute + public var isPrimary: Bool + + @ReadWriteAttribute + public var coalescedEvents: [PointerEvent] + + @ReadWriteAttribute + public var predictedEvents: [PointerEvent] +} diff --git a/Sources/DOMKit/WebIDL/PopStateEvent.swift b/Sources/DOMKit/WebIDL/PopStateEvent.swift index a4b39644..e3427a19 100644 --- a/Sources/DOMKit/WebIDL/PopStateEvent.swift +++ b/Sources/DOMKit/WebIDL/PopStateEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PopStateEvent: Event { - override public class var constructor: JSFunction { JSObject.global.PopStateEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.PopStateEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) diff --git a/Sources/DOMKit/WebIDL/PopStateEventInit.swift b/Sources/DOMKit/WebIDL/PopStateEventInit.swift index 35ae24da..fe1de0c0 100644 --- a/Sources/DOMKit/WebIDL/PopStateEventInit.swift +++ b/Sources/DOMKit/WebIDL/PopStateEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class PopStateEventInit: BridgedDictionary { public convenience init(state: JSValue) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.state] = state.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift new file mode 100644 index 00000000..b72b40d1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PortalActivateEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.PortalActivateEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PortalActivateEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var data: JSValue + + public func adoptPredecessor() -> HTMLPortalElement { + jsObject[Strings.adoptPredecessor]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift b/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift new file mode 100644 index 00000000..94edbc81 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PortalActivateEventInit: BridgedDictionary { + public convenience init(data: JSValue) { + 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: JSValue +} diff --git a/Sources/DOMKit/WebIDL/PortalActivateOptions.swift b/Sources/DOMKit/WebIDL/PortalActivateOptions.swift new file mode 100644 index 00000000..9d3c8720 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PortalActivateOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PortalActivateOptions: BridgedDictionary { + public convenience init(data: JSValue) { + 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: JSValue +} diff --git a/Sources/DOMKit/WebIDL/PortalHost.swift b/Sources/DOMKit/WebIDL/PortalHost.swift new file mode 100644 index 00000000..faf04bdd --- /dev/null +++ b/Sources/DOMKit/WebIDL/PortalHost.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PortalHost: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.PortalHost].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + super.init(unsafelyWrapping: jsObject) + } + + public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + } + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ClosureAttribute.Optional1 + public var onmessageerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/PositionAlignSetting.swift b/Sources/DOMKit/WebIDL/PositionAlignSetting.swift new file mode 100644 index 00000000..dae1213b --- /dev/null +++ b/Sources/DOMKit/WebIDL/PositionAlignSetting.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PositionAlignSetting: JSString, JSValueCompatible { + case lineLeft = "line-left" + case center = "center" + case lineRight = "line-right" + case auto = "auto" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/PositionOptions.swift b/Sources/DOMKit/WebIDL/PositionOptions.swift new file mode 100644 index 00000000..95ffc138 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PositionOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PositionOptions: BridgedDictionary { + public convenience init(enableHighAccuracy: Bool, timeout: UInt32, maximumAge: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.enableHighAccuracy] = enableHighAccuracy.jsValue() + object[Strings.timeout] = timeout.jsValue() + object[Strings.maximumAge] = maximumAge.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _enableHighAccuracy = ReadWriteAttribute(jsObject: object, name: Strings.enableHighAccuracy) + _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) + _maximumAge = ReadWriteAttribute(jsObject: object, name: Strings.maximumAge) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var enableHighAccuracy: Bool + + @ReadWriteAttribute + public var timeout: UInt32 + + @ReadWriteAttribute + public var maximumAge: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/Presentation.swift b/Sources/DOMKit/WebIDL/Presentation.swift new file mode 100644 index 00000000..a3698087 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Presentation.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Presentation: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Presentation].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _defaultRequest = ReadWriteAttribute(jsObject: jsObject, name: Strings.defaultRequest) + _receiver = ReadonlyAttribute(jsObject: jsObject, name: Strings.receiver) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var defaultRequest: PresentationRequest? + + @ReadonlyAttribute + public var receiver: PresentationReceiver? +} diff --git a/Sources/DOMKit/WebIDL/PresentationAvailability.swift b/Sources/DOMKit/WebIDL/PresentationAvailability.swift new file mode 100644 index 00000000..6d702610 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationAvailability.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PresentationAvailability: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.PresentationAvailability].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var value: Bool + + @ClosureAttribute.Optional1 + public var onchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/PresentationConnection.swift b/Sources/DOMKit/WebIDL/PresentationConnection.swift new file mode 100644 index 00000000..fa59f510 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationConnection.swift @@ -0,0 +1,68 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PresentationConnection: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnection].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) + _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) + _onterminate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onterminate) + _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var state: PresentationConnectionState + + public func close() { + _ = jsObject[Strings.close]!() + } + + public func terminate() { + _ = jsObject[Strings.terminate]!() + } + + @ClosureAttribute.Optional1 + public var onconnect: EventHandler + + @ClosureAttribute.Optional1 + public var onclose: EventHandler + + @ClosureAttribute.Optional1 + public var onterminate: EventHandler + + @ReadWriteAttribute + public var binaryType: BinaryType + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + public func send(message: String) { + _ = jsObject[Strings.send]!(message.jsValue()) + } + + public func send(data: Blob) { + _ = jsObject[Strings.send]!(data.jsValue()) + } + + public func send(data: ArrayBuffer) { + _ = jsObject[Strings.send]!(data.jsValue()) + } + + public func send(data: ArrayBufferView) { + _ = jsObject[Strings.send]!(data.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift new file mode 100644 index 00000000..88c3799a --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PresentationConnectionAvailableEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionAvailableEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _connection = ReadonlyAttribute(jsObject: jsObject, name: Strings.connection) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PresentationConnectionAvailableEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var connection: PresentationConnection +} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift new file mode 100644 index 00000000..221a24b2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PresentationConnectionAvailableEventInit: BridgedDictionary { + public convenience init(connection: PresentationConnection) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.connection] = connection.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _connection = ReadWriteAttribute(jsObject: object, name: Strings.connection) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var connection: PresentationConnection +} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift new file mode 100644 index 00000000..2d404824 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PresentationConnectionCloseEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionCloseEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PresentationConnectionCloseEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var reason: PresentationConnectionCloseReason + + @ReadonlyAttribute + public var message: String +} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift new file mode 100644 index 00000000..49608e58 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PresentationConnectionCloseEventInit: BridgedDictionary { + public convenience init(reason: PresentationConnectionCloseReason, message: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.reason] = reason.jsValue() + object[Strings.message] = message.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _reason = ReadWriteAttribute(jsObject: object, name: Strings.reason) + _message = ReadWriteAttribute(jsObject: object, name: Strings.message) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var reason: PresentationConnectionCloseReason + + @ReadWriteAttribute + public var message: String +} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift new file mode 100644 index 00000000..51ed4f29 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PresentationConnectionCloseReason: JSString, JSValueCompatible { + case error = "error" + case closed = "closed" + case wentaway = "wentaway" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionList.swift b/Sources/DOMKit/WebIDL/PresentationConnectionList.swift new file mode 100644 index 00000000..0f64b3b3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationConnectionList.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PresentationConnectionList: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionList].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _connections = ReadonlyAttribute(jsObject: jsObject, name: Strings.connections) + _onconnectionavailable = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnectionavailable) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var connections: [PresentationConnection] + + @ClosureAttribute.Optional1 + public var onconnectionavailable: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionState.swift b/Sources/DOMKit/WebIDL/PresentationConnectionState.swift new file mode 100644 index 00000000..e7a78f29 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationConnectionState.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PresentationConnectionState: JSString, JSValueCompatible { + case connecting = "connecting" + case connected = "connected" + case closed = "closed" + case terminated = "terminated" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/PresentationReceiver.swift b/Sources/DOMKit/WebIDL/PresentationReceiver.swift new file mode 100644 index 00000000..6bf2540c --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationReceiver.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PresentationReceiver: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PresentationReceiver].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _connectionList = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectionList) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var connectionList: JSPromise +} diff --git a/Sources/DOMKit/WebIDL/PresentationRequest.swift b/Sources/DOMKit/WebIDL/PresentationRequest.swift new file mode 100644 index 00000000..9c0a7bd3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationRequest.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PresentationRequest: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.PresentationRequest].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onconnectionavailable = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnectionavailable) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(url: String) { + self.init(unsafelyWrapping: Self.constructor.new(url.jsValue())) + } + + public convenience init(urls: [String]) { + self.init(unsafelyWrapping: Self.constructor.new(urls.jsValue())) + } + + public func start() -> JSPromise { + jsObject[Strings.start]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func start() async throws -> PresentationConnection { + let _promise: JSPromise = jsObject[Strings.start]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func reconnect(presentationId: String) -> JSPromise { + jsObject[Strings.reconnect]!(presentationId.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func reconnect(presentationId: String) async throws -> PresentationConnection { + let _promise: JSPromise = jsObject[Strings.reconnect]!(presentationId.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getAvailability() -> JSPromise { + jsObject[Strings.getAvailability]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getAvailability() async throws -> PresentationAvailability { + let _promise: JSPromise = jsObject[Strings.getAvailability]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onconnectionavailable: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/PresentationStyle.swift b/Sources/DOMKit/WebIDL/PresentationStyle.swift new file mode 100644 index 00000000..ec65cf4e --- /dev/null +++ b/Sources/DOMKit/WebIDL/PresentationStyle.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PresentationStyle: JSString, JSValueCompatible { + case unspecified = "unspecified" + case inline = "inline" + case attachment = "attachment" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift index 482ac7cd..f0bfad9e 100644 --- a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift +++ b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ProcessingInstruction: CharacterData, LinkStyle { - override public class var constructor: JSFunction { JSObject.global.ProcessingInstruction.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.ProcessingInstruction].function! } public required init(unsafelyWrapping jsObject: JSObject) { _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) diff --git a/Sources/DOMKit/WebIDL/Profiler.swift b/Sources/DOMKit/WebIDL/Profiler.swift new file mode 100644 index 00000000..a7969b96 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Profiler.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Profiler: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.Profiler].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _sampleInterval = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleInterval) + _stopped = ReadonlyAttribute(jsObject: jsObject, name: Strings.stopped) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var sampleInterval: DOMHighResTimeStamp + + @ReadonlyAttribute + public var stopped: Bool + + public convenience init(options: ProfilerInitOptions) { + self.init(unsafelyWrapping: Self.constructor.new(options.jsValue())) + } + + public func stop() -> JSPromise { + jsObject[Strings.stop]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func stop() async throws -> ProfilerTrace { + let _promise: JSPromise = jsObject[Strings.stop]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ProfilerFrame.swift b/Sources/DOMKit/WebIDL/ProfilerFrame.swift new file mode 100644 index 00000000..38607f2b --- /dev/null +++ b/Sources/DOMKit/WebIDL/ProfilerFrame.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ProfilerFrame: BridgedDictionary { + public convenience init(name: String, resourceId: UInt64, line: UInt64, column: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.resourceId] = resourceId.jsValue() + object[Strings.line] = line.jsValue() + object[Strings.column] = column.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _resourceId = ReadWriteAttribute(jsObject: object, name: Strings.resourceId) + _line = ReadWriteAttribute(jsObject: object, name: Strings.line) + _column = ReadWriteAttribute(jsObject: object, name: Strings.column) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var resourceId: UInt64 + + @ReadWriteAttribute + public var line: UInt64 + + @ReadWriteAttribute + public var column: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift b/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift new file mode 100644 index 00000000..651ef46d --- /dev/null +++ b/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ProfilerInitOptions: BridgedDictionary { + public convenience init(sampleInterval: DOMHighResTimeStamp, maxBufferSize: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.sampleInterval] = sampleInterval.jsValue() + object[Strings.maxBufferSize] = maxBufferSize.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _sampleInterval = ReadWriteAttribute(jsObject: object, name: Strings.sampleInterval) + _maxBufferSize = ReadWriteAttribute(jsObject: object, name: Strings.maxBufferSize) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var sampleInterval: DOMHighResTimeStamp + + @ReadWriteAttribute + public var maxBufferSize: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/ProfilerSample.swift b/Sources/DOMKit/WebIDL/ProfilerSample.swift new file mode 100644 index 00000000..a3a4505b --- /dev/null +++ b/Sources/DOMKit/WebIDL/ProfilerSample.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ProfilerSample: BridgedDictionary { + public convenience init(timestamp: DOMHighResTimeStamp, stackId: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.timestamp] = timestamp.jsValue() + object[Strings.stackId] = stackId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _stackId = ReadWriteAttribute(jsObject: object, name: Strings.stackId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var timestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var stackId: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/ProfilerStack.swift b/Sources/DOMKit/WebIDL/ProfilerStack.swift new file mode 100644 index 00000000..d0fb1d95 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ProfilerStack.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ProfilerStack: BridgedDictionary { + public convenience init(parentId: UInt64, frameId: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.parentId] = parentId.jsValue() + object[Strings.frameId] = frameId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _parentId = ReadWriteAttribute(jsObject: object, name: Strings.parentId) + _frameId = ReadWriteAttribute(jsObject: object, name: Strings.frameId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var parentId: UInt64 + + @ReadWriteAttribute + public var frameId: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/ProfilerTrace.swift b/Sources/DOMKit/WebIDL/ProfilerTrace.swift new file mode 100644 index 00000000..cb0bcf11 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ProfilerTrace.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ProfilerTrace: BridgedDictionary { + public convenience init(resources: [ProfilerResource], frames: [ProfilerFrame], stacks: [ProfilerStack], samples: [ProfilerSample]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.resources] = resources.jsValue() + object[Strings.frames] = frames.jsValue() + object[Strings.stacks] = stacks.jsValue() + object[Strings.samples] = samples.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _resources = ReadWriteAttribute(jsObject: object, name: Strings.resources) + _frames = ReadWriteAttribute(jsObject: object, name: Strings.frames) + _stacks = ReadWriteAttribute(jsObject: object, name: Strings.stacks) + _samples = ReadWriteAttribute(jsObject: object, name: Strings.samples) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var resources: [ProfilerResource] + + @ReadWriteAttribute + public var frames: [ProfilerFrame] + + @ReadWriteAttribute + public var stacks: [ProfilerStack] + + @ReadWriteAttribute + public var samples: [ProfilerSample] +} diff --git a/Sources/DOMKit/WebIDL/ProgressEvent.swift b/Sources/DOMKit/WebIDL/ProgressEvent.swift index 65d9fd66..8c29310b 100644 --- a/Sources/DOMKit/WebIDL/ProgressEvent.swift +++ b/Sources/DOMKit/WebIDL/ProgressEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ProgressEvent: Event { - override public class var constructor: JSFunction { JSObject.global.ProgressEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.ProgressEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _lengthComputable = ReadonlyAttribute(jsObject: jsObject, name: Strings.lengthComputable) diff --git a/Sources/DOMKit/WebIDL/ProgressEventInit.swift b/Sources/DOMKit/WebIDL/ProgressEventInit.swift index 27fab936..f1042f3b 100644 --- a/Sources/DOMKit/WebIDL/ProgressEventInit.swift +++ b/Sources/DOMKit/WebIDL/ProgressEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ProgressEventInit: BridgedDictionary { public convenience init(lengthComputable: Bool, loaded: UInt64, total: UInt64) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.lengthComputable] = lengthComputable.jsValue() object[Strings.loaded] = loaded.jsValue() object[Strings.total] = total.jsValue() diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift index e28f557f..802aeb96 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PromiseRejectionEvent: Event { - override public class var constructor: JSFunction { JSObject.global.PromiseRejectionEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.PromiseRejectionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _promise = ReadonlyAttribute(jsObject: jsObject, name: Strings.promise) diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift index 788e8196..1cb30e9c 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class PromiseRejectionEventInit: BridgedDictionary { public convenience init(promise: JSPromise, reason: JSValue) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.promise] = promise.jsValue() object[Strings.reason] = reason.jsValue() self.init(unsafelyWrapping: object) diff --git a/Sources/DOMKit/WebIDL/PromptResponseObject.swift b/Sources/DOMKit/WebIDL/PromptResponseObject.swift new file mode 100644 index 00000000..3c7d6077 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PromptResponseObject.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PromptResponseObject: BridgedDictionary { + public convenience init(userChoice: AppBannerPromptOutcome) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.userChoice] = userChoice.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _userChoice = ReadWriteAttribute(jsObject: object, name: Strings.userChoice) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var userChoice: AppBannerPromptOutcome +} diff --git a/Sources/DOMKit/WebIDL/PropertyDefinition.swift b/Sources/DOMKit/WebIDL/PropertyDefinition.swift new file mode 100644 index 00000000..b99c0ca6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PropertyDefinition.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PropertyDefinition: BridgedDictionary { + public convenience init(name: String, syntax: String, inherits: Bool, initialValue: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + object[Strings.syntax] = syntax.jsValue() + object[Strings.inherits] = inherits.jsValue() + object[Strings.initialValue] = initialValue.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + _syntax = ReadWriteAttribute(jsObject: object, name: Strings.syntax) + _inherits = ReadWriteAttribute(jsObject: object, name: Strings.inherits) + _initialValue = ReadWriteAttribute(jsObject: object, name: Strings.initialValue) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String + + @ReadWriteAttribute + public var syntax: String + + @ReadWriteAttribute + public var inherits: Bool + + @ReadWriteAttribute + public var initialValue: String +} diff --git a/Sources/DOMKit/WebIDL/ProximityReadingValues.swift b/Sources/DOMKit/WebIDL/ProximityReadingValues.swift new file mode 100644 index 00000000..c6d02257 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ProximityReadingValues.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ProximityReadingValues: BridgedDictionary { + public convenience init(distance: Double?, max: Double?, near: Bool?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.distance] = distance.jsValue() + object[Strings.max] = max.jsValue() + object[Strings.near] = near.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _distance = ReadWriteAttribute(jsObject: object, name: Strings.distance) + _max = ReadWriteAttribute(jsObject: object, name: Strings.max) + _near = ReadWriteAttribute(jsObject: object, name: Strings.near) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var distance: Double? + + @ReadWriteAttribute + public var max: Double? + + @ReadWriteAttribute + public var near: Bool? +} diff --git a/Sources/DOMKit/WebIDL/ProximitySensor.swift b/Sources/DOMKit/WebIDL/ProximitySensor.swift new file mode 100644 index 00000000..387625c4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ProximitySensor.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ProximitySensor: Sensor { + override public class var constructor: JSFunction { JSObject.global[Strings.ProximitySensor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _distance = ReadonlyAttribute(jsObject: jsObject, name: Strings.distance) + _max = ReadonlyAttribute(jsObject: jsObject, name: Strings.max) + _near = ReadonlyAttribute(jsObject: jsObject, name: Strings.near) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(sensorOptions: SensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var distance: Double? + + @ReadonlyAttribute + public var max: Double? + + @ReadonlyAttribute + public var near: Bool? +} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredential.swift b/Sources/DOMKit/WebIDL/PublicKeyCredential.swift new file mode 100644 index 00000000..462749ce --- /dev/null +++ b/Sources/DOMKit/WebIDL/PublicKeyCredential.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PublicKeyCredential: Credential { + override public class var constructor: JSFunction { JSObject.global[Strings.PublicKeyCredential].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _rawId = ReadonlyAttribute(jsObject: jsObject, name: Strings.rawId) + _response = ReadonlyAttribute(jsObject: jsObject, name: Strings.response) + _authenticatorAttachment = ReadonlyAttribute(jsObject: jsObject, name: Strings.authenticatorAttachment) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var rawId: ArrayBuffer + + @ReadonlyAttribute + public var response: AuthenticatorResponse + + @ReadonlyAttribute + public var authenticatorAttachment: String? + + public func getClientExtensionResults() -> AuthenticationExtensionsClientOutputs { + jsObject[Strings.getClientExtensionResults]!().fromJSValue()! + } + + public static func isUserVerifyingPlatformAuthenticatorAvailable() -> JSPromise { + constructor[Strings.isUserVerifyingPlatformAuthenticatorAvailable]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func isUserVerifyingPlatformAuthenticatorAvailable() async throws -> Bool { + let _promise: JSPromise = constructor[Strings.isUserVerifyingPlatformAuthenticatorAvailable]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift new file mode 100644 index 00000000..9e1ff1ca --- /dev/null +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PublicKeyCredentialCreationOptions: BridgedDictionary { + public convenience init(rp: PublicKeyCredentialRpEntity, user: PublicKeyCredentialUserEntity, challenge: BufferSource, pubKeyCredParams: [PublicKeyCredentialParameters], timeout: UInt32, excludeCredentials: [PublicKeyCredentialDescriptor], authenticatorSelection: AuthenticatorSelectionCriteria, attestation: String, extensions: AuthenticationExtensionsClientInputs) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.rp] = rp.jsValue() + object[Strings.user] = user.jsValue() + object[Strings.challenge] = challenge.jsValue() + object[Strings.pubKeyCredParams] = pubKeyCredParams.jsValue() + object[Strings.timeout] = timeout.jsValue() + object[Strings.excludeCredentials] = excludeCredentials.jsValue() + object[Strings.authenticatorSelection] = authenticatorSelection.jsValue() + object[Strings.attestation] = attestation.jsValue() + object[Strings.extensions] = extensions.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _rp = ReadWriteAttribute(jsObject: object, name: Strings.rp) + _user = ReadWriteAttribute(jsObject: object, name: Strings.user) + _challenge = ReadWriteAttribute(jsObject: object, name: Strings.challenge) + _pubKeyCredParams = ReadWriteAttribute(jsObject: object, name: Strings.pubKeyCredParams) + _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) + _excludeCredentials = ReadWriteAttribute(jsObject: object, name: Strings.excludeCredentials) + _authenticatorSelection = ReadWriteAttribute(jsObject: object, name: Strings.authenticatorSelection) + _attestation = ReadWriteAttribute(jsObject: object, name: Strings.attestation) + _extensions = ReadWriteAttribute(jsObject: object, name: Strings.extensions) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var rp: PublicKeyCredentialRpEntity + + @ReadWriteAttribute + public var user: PublicKeyCredentialUserEntity + + @ReadWriteAttribute + public var challenge: BufferSource + + @ReadWriteAttribute + public var pubKeyCredParams: [PublicKeyCredentialParameters] + + @ReadWriteAttribute + public var timeout: UInt32 + + @ReadWriteAttribute + public var excludeCredentials: [PublicKeyCredentialDescriptor] + + @ReadWriteAttribute + public var authenticatorSelection: AuthenticatorSelectionCriteria + + @ReadWriteAttribute + public var attestation: String + + @ReadWriteAttribute + public var extensions: AuthenticationExtensionsClientInputs +} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift new file mode 100644 index 00000000..636654c5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PublicKeyCredentialDescriptor: BridgedDictionary { + public convenience init(type: String, id: BufferSource, transports: [String]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.id] = id.jsValue() + object[Strings.transports] = transports.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _transports = ReadWriteAttribute(jsObject: object, name: Strings.transports) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var id: BufferSource + + @ReadWriteAttribute + public var transports: [String] +} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift new file mode 100644 index 00000000..11a09a3e --- /dev/null +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PublicKeyCredentialEntity: BridgedDictionary { + public convenience init(name: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.name] = name.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift new file mode 100644 index 00000000..ccaf8b08 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PublicKeyCredentialParameters: BridgedDictionary { + public convenience init(type: String, alg: COSEAlgorithmIdentifier) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.alg] = alg.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _alg = ReadWriteAttribute(jsObject: object, name: Strings.alg) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var alg: COSEAlgorithmIdentifier +} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift new file mode 100644 index 00000000..b31d9ee0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PublicKeyCredentialRequestOptions: BridgedDictionary { + public convenience init(challenge: BufferSource, timeout: UInt32, rpId: String, allowCredentials: [PublicKeyCredentialDescriptor], userVerification: String, extensions: AuthenticationExtensionsClientInputs) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.challenge] = challenge.jsValue() + object[Strings.timeout] = timeout.jsValue() + object[Strings.rpId] = rpId.jsValue() + object[Strings.allowCredentials] = allowCredentials.jsValue() + object[Strings.userVerification] = userVerification.jsValue() + object[Strings.extensions] = extensions.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _challenge = ReadWriteAttribute(jsObject: object, name: Strings.challenge) + _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) + _rpId = ReadWriteAttribute(jsObject: object, name: Strings.rpId) + _allowCredentials = ReadWriteAttribute(jsObject: object, name: Strings.allowCredentials) + _userVerification = ReadWriteAttribute(jsObject: object, name: Strings.userVerification) + _extensions = ReadWriteAttribute(jsObject: object, name: Strings.extensions) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var challenge: BufferSource + + @ReadWriteAttribute + public var timeout: UInt32 + + @ReadWriteAttribute + public var rpId: String + + @ReadWriteAttribute + public var allowCredentials: [PublicKeyCredentialDescriptor] + + @ReadWriteAttribute + public var userVerification: String + + @ReadWriteAttribute + public var extensions: AuthenticationExtensionsClientInputs +} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift new file mode 100644 index 00000000..3878d13d --- /dev/null +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PublicKeyCredentialRpEntity: BridgedDictionary { + public convenience init(id: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.id] = id.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var id: String +} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift new file mode 100644 index 00000000..2f38b05b --- /dev/null +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PublicKeyCredentialType: JSString, JSValueCompatible { + case publicKey = "public-key" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift new file mode 100644 index 00000000..75837e95 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PublicKeyCredentialUserEntity: BridgedDictionary { + public convenience init(id: BufferSource, displayName: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.id] = id.jsValue() + object[Strings.displayName] = displayName.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _displayName = ReadWriteAttribute(jsObject: object, name: Strings.displayName) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var id: BufferSource + + @ReadWriteAttribute + public var displayName: String +} diff --git a/Sources/DOMKit/WebIDL/PurchaseDetails.swift b/Sources/DOMKit/WebIDL/PurchaseDetails.swift new file mode 100644 index 00000000..563db34e --- /dev/null +++ b/Sources/DOMKit/WebIDL/PurchaseDetails.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PurchaseDetails: BridgedDictionary { + public convenience init(itemId: String, purchaseToken: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.itemId] = itemId.jsValue() + object[Strings.purchaseToken] = purchaseToken.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _itemId = ReadWriteAttribute(jsObject: object, name: Strings.itemId) + _purchaseToken = ReadWriteAttribute(jsObject: object, name: Strings.purchaseToken) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var itemId: String + + @ReadWriteAttribute + public var purchaseToken: String +} diff --git a/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift b/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift new file mode 100644 index 00000000..bc297e13 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum PushEncryptionKeyName: JSString, JSValueCompatible { + case p256dh = "p256dh" + case auth = "auth" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/PushEvent.swift b/Sources/DOMKit/WebIDL/PushEvent.swift new file mode 100644 index 00000000..79d8c37f --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.PushEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PushEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var data: PushMessageData? +} diff --git a/Sources/DOMKit/WebIDL/PushEventInit.swift b/Sources/DOMKit/WebIDL/PushEventInit.swift new file mode 100644 index 00000000..e7c1f0ce --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushEventInit: BridgedDictionary { + public convenience init(data: PushMessageDataInit) { + 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: PushMessageDataInit +} diff --git a/Sources/DOMKit/WebIDL/PushManager.swift b/Sources/DOMKit/WebIDL/PushManager.swift new file mode 100644 index 00000000..01d296d6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushManager.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PushManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _supportedContentEncodings = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedContentEncodings) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var supportedContentEncodings: [String] + + public func subscribe(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { + jsObject[Strings.subscribe]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func subscribe(options: PushSubscriptionOptionsInit? = nil) async throws -> PushSubscription { + let _promise: JSPromise = jsObject[Strings.subscribe]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getSubscription() -> JSPromise { + jsObject[Strings.getSubscription]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getSubscription() async throws -> PushSubscription? { + let _promise: JSPromise = jsObject[Strings.getSubscription]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func permissionState(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { + jsObject[Strings.permissionState]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func permissionState(options: PushSubscriptionOptionsInit? = nil) async throws -> PermissionState { + let _promise: JSPromise = jsObject[Strings.permissionState]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PushMessageData.swift b/Sources/DOMKit/WebIDL/PushMessageData.swift new file mode 100644 index 00000000..79655b0f --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushMessageData.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushMessageData: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PushMessageData].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func arrayBuffer() -> ArrayBuffer { + jsObject[Strings.arrayBuffer]!().fromJSValue()! + } + + public func blob() -> Blob { + jsObject[Strings.blob]!().fromJSValue()! + } + + public func json() -> JSValue { + jsObject[Strings.json]!().fromJSValue()! + } + + public func text() -> String { + jsObject[Strings.text]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift new file mode 100644 index 00000000..f288c5eb --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushPermissionDescriptor: BridgedDictionary { + public convenience init(userVisibleOnly: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.userVisibleOnly] = userVisibleOnly.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _userVisibleOnly = ReadWriteAttribute(jsObject: object, name: Strings.userVisibleOnly) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var userVisibleOnly: Bool +} diff --git a/Sources/DOMKit/WebIDL/PushSubscription.swift b/Sources/DOMKit/WebIDL/PushSubscription.swift new file mode 100644 index 00000000..80ff1748 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushSubscription.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushSubscription: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PushSubscription].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _endpoint = ReadonlyAttribute(jsObject: jsObject, name: Strings.endpoint) + _expirationTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.expirationTime) + _options = ReadonlyAttribute(jsObject: jsObject, name: Strings.options) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var endpoint: String + + @ReadonlyAttribute + public var expirationTime: EpochTimeStamp? + + @ReadonlyAttribute + public var options: PushSubscriptionOptions + + public func getKey(name: PushEncryptionKeyName) -> ArrayBuffer? { + jsObject[Strings.getKey]!(name.jsValue()).fromJSValue()! + } + + public func unsubscribe() -> JSPromise { + jsObject[Strings.unsubscribe]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func unsubscribe() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.unsubscribe]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func toJSON() -> PushSubscriptionJSON { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift new file mode 100644 index 00000000..19742e6d --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushSubscriptionChangeEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.PushSubscriptionChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _newSubscription = ReadonlyAttribute(jsObject: jsObject, name: Strings.newSubscription) + _oldSubscription = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldSubscription) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: PushSubscriptionChangeEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var newSubscription: PushSubscription? + + @ReadonlyAttribute + public var oldSubscription: PushSubscription? +} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift new file mode 100644 index 00000000..42497552 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushSubscriptionChangeEventInit: BridgedDictionary { + public convenience init(newSubscription: PushSubscription, oldSubscription: PushSubscription) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.newSubscription] = newSubscription.jsValue() + object[Strings.oldSubscription] = oldSubscription.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _newSubscription = ReadWriteAttribute(jsObject: object, name: Strings.newSubscription) + _oldSubscription = ReadWriteAttribute(jsObject: object, name: Strings.oldSubscription) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var newSubscription: PushSubscription + + @ReadWriteAttribute + public var oldSubscription: PushSubscription +} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift b/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift new file mode 100644 index 00000000..e6c0196c --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushSubscriptionJSON: BridgedDictionary { + public convenience init(endpoint: String, expirationTime: EpochTimeStamp?, keys: [String: String]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.endpoint] = endpoint.jsValue() + object[Strings.expirationTime] = expirationTime.jsValue() + object[Strings.keys] = keys.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _endpoint = ReadWriteAttribute(jsObject: object, name: Strings.endpoint) + _expirationTime = ReadWriteAttribute(jsObject: object, name: Strings.expirationTime) + _keys = ReadWriteAttribute(jsObject: object, name: Strings.keys) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var endpoint: String + + @ReadWriteAttribute + public var expirationTime: EpochTimeStamp? + + @ReadWriteAttribute + public var keys: [String: String] +} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift b/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift new file mode 100644 index 00000000..2ac54865 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushSubscriptionOptions: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.PushSubscriptionOptions].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _userVisibleOnly = ReadonlyAttribute(jsObject: jsObject, name: Strings.userVisibleOnly) + _applicationServerKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.applicationServerKey) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var userVisibleOnly: Bool + + @ReadonlyAttribute + public var applicationServerKey: ArrayBuffer? +} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift b/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift new file mode 100644 index 00000000..d31e8bf9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PushSubscriptionOptionsInit: BridgedDictionary { + public convenience init(userVisibleOnly: Bool, applicationServerKey: __UNSUPPORTED_UNION__?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.userVisibleOnly] = userVisibleOnly.jsValue() + object[Strings.applicationServerKey] = applicationServerKey.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _userVisibleOnly = ReadWriteAttribute(jsObject: object, name: Strings.userVisibleOnly) + _applicationServerKey = ReadWriteAttribute(jsObject: object, name: Strings.applicationServerKey) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var userVisibleOnly: Bool + + @ReadWriteAttribute + public var applicationServerKey: __UNSUPPORTED_UNION__? +} diff --git a/Sources/DOMKit/WebIDL/QueryOptions.swift b/Sources/DOMKit/WebIDL/QueryOptions.swift new file mode 100644 index 00000000..4bd24aea --- /dev/null +++ b/Sources/DOMKit/WebIDL/QueryOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class QueryOptions: BridgedDictionary { + public convenience init(select: [String]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.select] = select.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _select = ReadWriteAttribute(jsObject: object, name: Strings.select) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var select: [String] +} diff --git a/Sources/DOMKit/WebIDL/QueuingStrategy.swift b/Sources/DOMKit/WebIDL/QueuingStrategy.swift index f057ec1a..17616d2d 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategy.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class QueuingStrategy: BridgedDictionary { public convenience init(highWaterMark: Double, size: @escaping QueuingStrategySize) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.highWaterMark] = highWaterMark.jsValue() ClosureAttribute.Required1[Strings.size, in: object] = size self.init(unsafelyWrapping: object) diff --git a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift index 83941e9b..feba7921 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class QueuingStrategyInit: BridgedDictionary { public convenience init(highWaterMark: Double) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.highWaterMark] = highWaterMark.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCAnswerOptions.swift b/Sources/DOMKit/WebIDL/RTCAnswerOptions.swift new file mode 100644 index 00000000..23bdbb74 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCAnswerOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCAnswerOptions: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCAudioHandlerStats.swift b/Sources/DOMKit/WebIDL/RTCAudioHandlerStats.swift new file mode 100644 index 00000000..07e3c6aa --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCAudioHandlerStats.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCAudioHandlerStats: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCAudioReceiverStats.swift b/Sources/DOMKit/WebIDL/RTCAudioReceiverStats.swift new file mode 100644 index 00000000..7f7208dc --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCAudioReceiverStats.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCAudioReceiverStats: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift b/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift new file mode 100644 index 00000000..ae64158e --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCAudioSenderStats: BridgedDictionary { + public convenience init(mediaSourceId: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mediaSourceId] = mediaSourceId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mediaSourceId = ReadWriteAttribute(jsObject: object, name: Strings.mediaSourceId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mediaSourceId: String +} diff --git a/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift b/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift new file mode 100644 index 00000000..57f70e0f --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCAudioSourceStats: BridgedDictionary { + public convenience init(audioLevel: Double, totalAudioEnergy: Double, totalSamplesDuration: Double, echoReturnLoss: Double, echoReturnLossEnhancement: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.audioLevel] = audioLevel.jsValue() + object[Strings.totalAudioEnergy] = totalAudioEnergy.jsValue() + object[Strings.totalSamplesDuration] = totalSamplesDuration.jsValue() + object[Strings.echoReturnLoss] = echoReturnLoss.jsValue() + object[Strings.echoReturnLossEnhancement] = echoReturnLossEnhancement.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _audioLevel = ReadWriteAttribute(jsObject: object, name: Strings.audioLevel) + _totalAudioEnergy = ReadWriteAttribute(jsObject: object, name: Strings.totalAudioEnergy) + _totalSamplesDuration = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesDuration) + _echoReturnLoss = ReadWriteAttribute(jsObject: object, name: Strings.echoReturnLoss) + _echoReturnLossEnhancement = ReadWriteAttribute(jsObject: object, name: Strings.echoReturnLossEnhancement) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var audioLevel: Double + + @ReadWriteAttribute + public var totalAudioEnergy: Double + + @ReadWriteAttribute + public var totalSamplesDuration: Double + + @ReadWriteAttribute + public var echoReturnLoss: Double + + @ReadWriteAttribute + public var echoReturnLossEnhancement: Double +} diff --git a/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift b/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift new file mode 100644 index 00000000..17700a11 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCBundlePolicy: JSString, JSValueCompatible { + case balanced = "balanced" + case maxCompat = "max-compat" + case maxBundle = "max-bundle" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCCertificate.swift b/Sources/DOMKit/WebIDL/RTCCertificate.swift new file mode 100644 index 00000000..4113b82a --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCCertificate.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCCertificate: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCCertificate].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _expires = ReadonlyAttribute(jsObject: jsObject, name: Strings.expires) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var expires: EpochTimeStamp + + public func getFingerprints() -> [RTCDtlsFingerprint] { + jsObject[Strings.getFingerprints]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift b/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift new file mode 100644 index 00000000..8635062c --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCCertificateExpiration: BridgedDictionary { + public convenience init(expires: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.expires] = expires.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _expires = ReadWriteAttribute(jsObject: object, name: Strings.expires) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var expires: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/RTCCertificateStats.swift b/Sources/DOMKit/WebIDL/RTCCertificateStats.swift new file mode 100644 index 00000000..64c5cc16 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCCertificateStats.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCCertificateStats: BridgedDictionary { + public convenience init(fingerprint: String, fingerprintAlgorithm: String, base64Certificate: String, issuerCertificateId: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.fingerprint] = fingerprint.jsValue() + object[Strings.fingerprintAlgorithm] = fingerprintAlgorithm.jsValue() + object[Strings.base64Certificate] = base64Certificate.jsValue() + object[Strings.issuerCertificateId] = issuerCertificateId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _fingerprint = ReadWriteAttribute(jsObject: object, name: Strings.fingerprint) + _fingerprintAlgorithm = ReadWriteAttribute(jsObject: object, name: Strings.fingerprintAlgorithm) + _base64Certificate = ReadWriteAttribute(jsObject: object, name: Strings.base64Certificate) + _issuerCertificateId = ReadWriteAttribute(jsObject: object, name: Strings.issuerCertificateId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var fingerprint: String + + @ReadWriteAttribute + public var fingerprintAlgorithm: String + + @ReadWriteAttribute + public var base64Certificate: String + + @ReadWriteAttribute + public var issuerCertificateId: String +} diff --git a/Sources/DOMKit/WebIDL/RTCCodecStats.swift b/Sources/DOMKit/WebIDL/RTCCodecStats.swift new file mode 100644 index 00000000..23ee29f4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCCodecStats.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCCodecStats: BridgedDictionary { + public convenience init(payloadType: UInt32, codecType: RTCCodecType, transportId: String, mimeType: String, clockRate: UInt32, channels: UInt32, sdpFmtpLine: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.payloadType] = payloadType.jsValue() + object[Strings.codecType] = codecType.jsValue() + object[Strings.transportId] = transportId.jsValue() + object[Strings.mimeType] = mimeType.jsValue() + object[Strings.clockRate] = clockRate.jsValue() + object[Strings.channels] = channels.jsValue() + object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _payloadType = ReadWriteAttribute(jsObject: object, name: Strings.payloadType) + _codecType = ReadWriteAttribute(jsObject: object, name: Strings.codecType) + _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) + _mimeType = ReadWriteAttribute(jsObject: object, name: Strings.mimeType) + _clockRate = ReadWriteAttribute(jsObject: object, name: Strings.clockRate) + _channels = ReadWriteAttribute(jsObject: object, name: Strings.channels) + _sdpFmtpLine = ReadWriteAttribute(jsObject: object, name: Strings.sdpFmtpLine) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var payloadType: UInt32 + + @ReadWriteAttribute + public var codecType: RTCCodecType + + @ReadWriteAttribute + public var transportId: String + + @ReadWriteAttribute + public var mimeType: String + + @ReadWriteAttribute + public var clockRate: UInt32 + + @ReadWriteAttribute + public var channels: UInt32 + + @ReadWriteAttribute + public var sdpFmtpLine: String +} diff --git a/Sources/DOMKit/WebIDL/RTCCodecType.swift b/Sources/DOMKit/WebIDL/RTCCodecType.swift new file mode 100644 index 00000000..208b875c --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCCodecType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCCodecType: JSString, JSValueCompatible { + case encode = "encode" + case decode = "decode" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCConfiguration.swift b/Sources/DOMKit/WebIDL/RTCConfiguration.swift new file mode 100644 index 00000000..86c23818 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCConfiguration.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCConfiguration: BridgedDictionary { + public convenience init(iceServers: [RTCIceServer], iceTransportPolicy: RTCIceTransportPolicy, bundlePolicy: RTCBundlePolicy, rtcpMuxPolicy: RTCRtcpMuxPolicy, certificates: [RTCCertificate], iceCandidatePoolSize: UInt8, peerIdentity: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.iceServers] = iceServers.jsValue() + object[Strings.iceTransportPolicy] = iceTransportPolicy.jsValue() + object[Strings.bundlePolicy] = bundlePolicy.jsValue() + object[Strings.rtcpMuxPolicy] = rtcpMuxPolicy.jsValue() + object[Strings.certificates] = certificates.jsValue() + object[Strings.iceCandidatePoolSize] = iceCandidatePoolSize.jsValue() + object[Strings.peerIdentity] = peerIdentity.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _iceServers = ReadWriteAttribute(jsObject: object, name: Strings.iceServers) + _iceTransportPolicy = ReadWriteAttribute(jsObject: object, name: Strings.iceTransportPolicy) + _bundlePolicy = ReadWriteAttribute(jsObject: object, name: Strings.bundlePolicy) + _rtcpMuxPolicy = ReadWriteAttribute(jsObject: object, name: Strings.rtcpMuxPolicy) + _certificates = ReadWriteAttribute(jsObject: object, name: Strings.certificates) + _iceCandidatePoolSize = ReadWriteAttribute(jsObject: object, name: Strings.iceCandidatePoolSize) + _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var iceServers: [RTCIceServer] + + @ReadWriteAttribute + public var iceTransportPolicy: RTCIceTransportPolicy + + @ReadWriteAttribute + public var bundlePolicy: RTCBundlePolicy + + @ReadWriteAttribute + public var rtcpMuxPolicy: RTCRtcpMuxPolicy + + @ReadWriteAttribute + public var certificates: [RTCCertificate] + + @ReadWriteAttribute + public var iceCandidatePoolSize: UInt8 + + @ReadWriteAttribute + public var peerIdentity: String +} diff --git a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift new file mode 100644 index 00000000..a6c11b1a --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDTMFSender: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCDTMFSender].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _ontonechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontonechange) + _canInsertDTMF = ReadonlyAttribute(jsObject: jsObject, name: Strings.canInsertDTMF) + _toneBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.toneBuffer) + super.init(unsafelyWrapping: jsObject) + } + + public func insertDTMF(tones: String, duration: UInt32? = nil, interToneGap: UInt32? = nil) { + _ = jsObject[Strings.insertDTMF]!(tones.jsValue(), duration?.jsValue() ?? .undefined, interToneGap?.jsValue() ?? .undefined) + } + + @ClosureAttribute.Optional1 + public var ontonechange: EventHandler + + @ReadonlyAttribute + public var canInsertDTMF: Bool + + @ReadonlyAttribute + public var toneBuffer: String +} diff --git a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift new file mode 100644 index 00000000..171b8342 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDTMFToneChangeEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCDTMFToneChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _tone = ReadonlyAttribute(jsObject: jsObject, name: Strings.tone) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: RTCDTMFToneChangeEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var tone: String +} diff --git a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift new file mode 100644 index 00000000..b4683f79 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDTMFToneChangeEventInit: BridgedDictionary { + public convenience init(tone: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.tone] = tone.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _tone = ReadWriteAttribute(jsObject: object, name: Strings.tone) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var tone: String +} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannel.swift b/Sources/DOMKit/WebIDL/RTCDataChannel.swift new file mode 100644 index 00000000..5029b734 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDataChannel.swift @@ -0,0 +1,104 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDataChannel: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCDataChannel].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) + _ordered = ReadonlyAttribute(jsObject: jsObject, name: Strings.ordered) + _maxPacketLifeTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxPacketLifeTime) + _maxRetransmits = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxRetransmits) + _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) + _negotiated = ReadonlyAttribute(jsObject: jsObject, name: Strings.negotiated) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _bufferedAmount = ReadonlyAttribute(jsObject: jsObject, name: Strings.bufferedAmount) + _bufferedAmountLowThreshold = ReadWriteAttribute(jsObject: jsObject, name: Strings.bufferedAmountLowThreshold) + _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onopen) + _onbufferedamountlow = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbufferedamountlow) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onclosing = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclosing) + _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) + _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var label: String + + @ReadonlyAttribute + public var ordered: Bool + + @ReadonlyAttribute + public var maxPacketLifeTime: UInt16? + + @ReadonlyAttribute + public var maxRetransmits: UInt16? + + @ReadonlyAttribute + public var `protocol`: String + + @ReadonlyAttribute + public var negotiated: Bool + + @ReadonlyAttribute + public var id: UInt16? + + @ReadonlyAttribute + public var readyState: RTCDataChannelState + + @ReadonlyAttribute + public var bufferedAmount: UInt32 + + @ReadWriteAttribute + public var bufferedAmountLowThreshold: UInt32 + + @ClosureAttribute.Optional1 + public var onopen: EventHandler + + @ClosureAttribute.Optional1 + public var onbufferedamountlow: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onclosing: EventHandler + + @ClosureAttribute.Optional1 + public var onclose: EventHandler + + public func close() { + _ = jsObject[Strings.close]!() + } + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ReadWriteAttribute + public var binaryType: BinaryType + + public func send(data: String) { + _ = jsObject[Strings.send]!(data.jsValue()) + } + + public func send(data: Blob) { + _ = jsObject[Strings.send]!(data.jsValue()) + } + + public func send(data: ArrayBuffer) { + _ = jsObject[Strings.send]!(data.jsValue()) + } + + public func send(data: ArrayBufferView) { + _ = jsObject[Strings.send]!(data.jsValue()) + } + + @ReadonlyAttribute + public var priority: RTCPriorityType +} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift b/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift new file mode 100644 index 00000000..3be248d9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDataChannelEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCDataChannelEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _channel = ReadonlyAttribute(jsObject: jsObject, name: Strings.channel) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: RTCDataChannelEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var channel: RTCDataChannel +} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift b/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift new file mode 100644 index 00000000..46b9d10c --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDataChannelEventInit: BridgedDictionary { + public convenience init(channel: RTCDataChannel) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.channel] = channel.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _channel = ReadWriteAttribute(jsObject: object, name: Strings.channel) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var channel: RTCDataChannel +} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift b/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift new file mode 100644 index 00000000..404e110e --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDataChannelInit: BridgedDictionary { + public convenience init(ordered: Bool, maxPacketLifeTime: UInt16, maxRetransmits: UInt16, protocol: String, negotiated: Bool, id: UInt16, priority: RTCPriorityType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.ordered] = ordered.jsValue() + object[Strings.maxPacketLifeTime] = maxPacketLifeTime.jsValue() + object[Strings.maxRetransmits] = maxRetransmits.jsValue() + object[Strings.protocol] = `protocol`.jsValue() + object[Strings.negotiated] = negotiated.jsValue() + object[Strings.id] = id.jsValue() + object[Strings.priority] = priority.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _ordered = ReadWriteAttribute(jsObject: object, name: Strings.ordered) + _maxPacketLifeTime = ReadWriteAttribute(jsObject: object, name: Strings.maxPacketLifeTime) + _maxRetransmits = ReadWriteAttribute(jsObject: object, name: Strings.maxRetransmits) + _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) + _negotiated = ReadWriteAttribute(jsObject: object, name: Strings.negotiated) + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var ordered: Bool + + @ReadWriteAttribute + public var maxPacketLifeTime: UInt16 + + @ReadWriteAttribute + public var maxRetransmits: UInt16 + + @ReadWriteAttribute + public var `protocol`: String + + @ReadWriteAttribute + public var negotiated: Bool + + @ReadWriteAttribute + public var id: UInt16 + + @ReadWriteAttribute + public var priority: RTCPriorityType +} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelState.swift b/Sources/DOMKit/WebIDL/RTCDataChannelState.swift new file mode 100644 index 00000000..2bc0265d --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDataChannelState.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCDataChannelState: JSString, JSValueCompatible { + case connecting = "connecting" + case open = "open" + case closing = "closing" + case closed = "closed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelStats.swift b/Sources/DOMKit/WebIDL/RTCDataChannelStats.swift new file mode 100644 index 00000000..213c24b9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDataChannelStats.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDataChannelStats: BridgedDictionary { + public convenience init(label: String, protocol: String, dataChannelIdentifier: UInt16, state: RTCDataChannelState, messagesSent: UInt32, bytesSent: UInt64, messagesReceived: UInt32, bytesReceived: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.label] = label.jsValue() + object[Strings.protocol] = `protocol`.jsValue() + object[Strings.dataChannelIdentifier] = dataChannelIdentifier.jsValue() + object[Strings.state] = state.jsValue() + object[Strings.messagesSent] = messagesSent.jsValue() + object[Strings.bytesSent] = bytesSent.jsValue() + object[Strings.messagesReceived] = messagesReceived.jsValue() + object[Strings.bytesReceived] = bytesReceived.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _label = ReadWriteAttribute(jsObject: object, name: Strings.label) + _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) + _dataChannelIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelIdentifier) + _state = ReadWriteAttribute(jsObject: object, name: Strings.state) + _messagesSent = ReadWriteAttribute(jsObject: object, name: Strings.messagesSent) + _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) + _messagesReceived = ReadWriteAttribute(jsObject: object, name: Strings.messagesReceived) + _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var label: String + + @ReadWriteAttribute + public var `protocol`: String + + @ReadWriteAttribute + public var dataChannelIdentifier: UInt16 + + @ReadWriteAttribute + public var state: RTCDataChannelState + + @ReadWriteAttribute + public var messagesSent: UInt32 + + @ReadWriteAttribute + public var bytesSent: UInt64 + + @ReadWriteAttribute + public var messagesReceived: UInt32 + + @ReadWriteAttribute + public var bytesReceived: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift b/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift new file mode 100644 index 00000000..6c1b0f05 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCDegradationPreference: JSString, JSValueCompatible { + case maintainFramerate = "maintain-framerate" + case maintainResolution = "maintain-resolution" + case balanced = "balanced" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift b/Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift new file mode 100644 index 00000000..3c2f2afa --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDtlsFingerprint: BridgedDictionary { + public convenience init(algorithm: String, value: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.algorithm] = algorithm.jsValue() + object[Strings.value] = value.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _algorithm = ReadWriteAttribute(jsObject: object, name: Strings.algorithm) + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var algorithm: String + + @ReadWriteAttribute + public var value: String +} diff --git a/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift b/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift new file mode 100644 index 00000000..bb3a15c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCDtlsTransport: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCDtlsTransport].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _iceTransport = ReadonlyAttribute(jsObject: jsObject, name: Strings.iceTransport) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var iceTransport: RTCIceTransport + + @ReadonlyAttribute + public var state: RTCDtlsTransportState + + public func getRemoteCertificates() -> [ArrayBuffer] { + jsObject[Strings.getRemoteCertificates]!().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onstatechange: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift b/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift new file mode 100644 index 00000000..0c161975 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCDtlsTransportState: JSString, JSValueCompatible { + case new = "new" + case connecting = "connecting" + case connected = "connected" + case closed = "closed" + case failed = "failed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift new file mode 100644 index 00000000..f03d8e45 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCEncodedAudioFrame: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCEncodedAudioFrame].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var timestamp: UInt64 + + @ReadWriteAttribute + public var data: ArrayBuffer + + public func getMetadata() -> RTCEncodedAudioFrameMetadata { + jsObject[Strings.getMetadata]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift new file mode 100644 index 00000000..6fc10043 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCEncodedAudioFrameMetadata: BridgedDictionary { + public convenience init(synchronizationSource: Int32, payloadType: UInt8, contributingSources: [Int32]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.synchronizationSource] = synchronizationSource.jsValue() + object[Strings.payloadType] = payloadType.jsValue() + object[Strings.contributingSources] = contributingSources.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _synchronizationSource = ReadWriteAttribute(jsObject: object, name: Strings.synchronizationSource) + _payloadType = ReadWriteAttribute(jsObject: object, name: Strings.payloadType) + _contributingSources = ReadWriteAttribute(jsObject: object, name: Strings.contributingSources) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var synchronizationSource: Int32 + + @ReadWriteAttribute + public var payloadType: UInt8 + + @ReadWriteAttribute + public var contributingSources: [Int32] +} diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift new file mode 100644 index 00000000..2eb349f2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCEncodedVideoFrame: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCEncodedVideoFrame].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) + _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var type: RTCEncodedVideoFrameType + + @ReadonlyAttribute + public var timestamp: UInt64 + + @ReadWriteAttribute + public var data: ArrayBuffer + + public func getMetadata() -> RTCEncodedVideoFrameMetadata { + jsObject[Strings.getMetadata]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift new file mode 100644 index 00000000..279747a1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCEncodedVideoFrameMetadata: BridgedDictionary { + public convenience init(frameId: Int64, dependencies: [Int64], width: UInt16, height: UInt16, spatialIndex: Int32, temporalIndex: Int32, synchronizationSource: Int32, payloadType: UInt8, contributingSources: [Int32]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.frameId] = frameId.jsValue() + object[Strings.dependencies] = dependencies.jsValue() + object[Strings.width] = width.jsValue() + object[Strings.height] = height.jsValue() + object[Strings.spatialIndex] = spatialIndex.jsValue() + object[Strings.temporalIndex] = temporalIndex.jsValue() + object[Strings.synchronizationSource] = synchronizationSource.jsValue() + object[Strings.payloadType] = payloadType.jsValue() + object[Strings.contributingSources] = contributingSources.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _frameId = ReadWriteAttribute(jsObject: object, name: Strings.frameId) + _dependencies = ReadWriteAttribute(jsObject: object, name: Strings.dependencies) + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _spatialIndex = ReadWriteAttribute(jsObject: object, name: Strings.spatialIndex) + _temporalIndex = ReadWriteAttribute(jsObject: object, name: Strings.temporalIndex) + _synchronizationSource = ReadWriteAttribute(jsObject: object, name: Strings.synchronizationSource) + _payloadType = ReadWriteAttribute(jsObject: object, name: Strings.payloadType) + _contributingSources = ReadWriteAttribute(jsObject: object, name: Strings.contributingSources) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var frameId: Int64 + + @ReadWriteAttribute + public var dependencies: [Int64] + + @ReadWriteAttribute + public var width: UInt16 + + @ReadWriteAttribute + public var height: UInt16 + + @ReadWriteAttribute + public var spatialIndex: Int32 + + @ReadWriteAttribute + public var temporalIndex: Int32 + + @ReadWriteAttribute + public var synchronizationSource: Int32 + + @ReadWriteAttribute + public var payloadType: UInt8 + + @ReadWriteAttribute + public var contributingSources: [Int32] +} diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift new file mode 100644 index 00000000..9a68f40e --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCEncodedVideoFrameType: JSString, JSValueCompatible { + case empty = "empty" + case key = "key" + case delta = "delta" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCError.swift b/Sources/DOMKit/WebIDL/RTCError.swift new file mode 100644 index 00000000..1e4a70da --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCError.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCError: DOMException { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCError].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _errorDetail = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorDetail) + _sdpLineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.sdpLineNumber) + _sctpCauseCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.sctpCauseCode) + _receivedAlert = ReadonlyAttribute(jsObject: jsObject, name: Strings.receivedAlert) + _sentAlert = ReadonlyAttribute(jsObject: jsObject, name: Strings.sentAlert) + _httpRequestStatusCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.httpRequestStatusCode) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(init: RTCErrorInit, message: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue(), message?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var errorDetail: RTCErrorDetailType + + @ReadonlyAttribute + public var sdpLineNumber: Int32? + + @ReadonlyAttribute + public var sctpCauseCode: Int32? + + @ReadonlyAttribute + public var receivedAlert: UInt32? + + @ReadonlyAttribute + public var sentAlert: UInt32? + + @ReadonlyAttribute + public var httpRequestStatusCode: Int32? +} diff --git a/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift b/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift new file mode 100644 index 00000000..b42e3b42 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCErrorDetailType: JSString, JSValueCompatible { + case dataChannelFailure = "data-channel-failure" + case dtlsFailure = "dtls-failure" + case fingerprintFailure = "fingerprint-failure" + case sctpFailure = "sctp-failure" + case sdpSyntaxError = "sdp-syntax-error" + case hardwareEncoderNotAvailable = "hardware-encoder-not-available" + case hardwareEncoderError = "hardware-encoder-error" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift b/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift new file mode 100644 index 00000000..5c4c2ef0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCErrorDetailTypeIdp: JSString, JSValueCompatible { + case idpBadScriptFailure = "idp-bad-script-failure" + case idpExecutionFailure = "idp-execution-failure" + case idpLoadFailure = "idp-load-failure" + case idpNeedLogin = "idp-need-login" + case idpTimeout = "idp-timeout" + case idpTlsFailure = "idp-tls-failure" + case idpTokenExpired = "idp-token-expired" + case idpTokenInvalid = "idp-token-invalid" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCErrorEvent.swift new file mode 100644 index 00000000..b293a54b --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCErrorEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCErrorEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCErrorEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: RTCErrorEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var error: RTCError +} diff --git a/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift b/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift new file mode 100644 index 00000000..ef778cbf --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCErrorEventInit: BridgedDictionary { + public convenience init(error: RTCError) { + 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: RTCError +} diff --git a/Sources/DOMKit/WebIDL/RTCErrorInit.swift b/Sources/DOMKit/WebIDL/RTCErrorInit.swift new file mode 100644 index 00000000..83b4b463 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCErrorInit.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCErrorInit: BridgedDictionary { + public convenience init(errorDetail: RTCErrorDetailType, sdpLineNumber: Int32, sctpCauseCode: Int32, receivedAlert: UInt32, sentAlert: UInt32, httpRequestStatusCode: Int32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.errorDetail] = errorDetail.jsValue() + object[Strings.sdpLineNumber] = sdpLineNumber.jsValue() + object[Strings.sctpCauseCode] = sctpCauseCode.jsValue() + object[Strings.receivedAlert] = receivedAlert.jsValue() + object[Strings.sentAlert] = sentAlert.jsValue() + object[Strings.httpRequestStatusCode] = httpRequestStatusCode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _errorDetail = ReadWriteAttribute(jsObject: object, name: Strings.errorDetail) + _sdpLineNumber = ReadWriteAttribute(jsObject: object, name: Strings.sdpLineNumber) + _sctpCauseCode = ReadWriteAttribute(jsObject: object, name: Strings.sctpCauseCode) + _receivedAlert = ReadWriteAttribute(jsObject: object, name: Strings.receivedAlert) + _sentAlert = ReadWriteAttribute(jsObject: object, name: Strings.sentAlert) + _httpRequestStatusCode = ReadWriteAttribute(jsObject: object, name: Strings.httpRequestStatusCode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var errorDetail: RTCErrorDetailType + + @ReadWriteAttribute + public var sdpLineNumber: Int32 + + @ReadWriteAttribute + public var sctpCauseCode: Int32 + + @ReadWriteAttribute + public var receivedAlert: UInt32 + + @ReadWriteAttribute + public var sentAlert: UInt32 + + @ReadWriteAttribute + public var httpRequestStatusCode: Int32 +} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift new file mode 100644 index 00000000..f2d2531e --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift @@ -0,0 +1,78 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceCandidate: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCIceCandidate].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _candidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.candidate) + _sdpMid = ReadonlyAttribute(jsObject: jsObject, name: Strings.sdpMid) + _sdpMLineIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.sdpMLineIndex) + _foundation = ReadonlyAttribute(jsObject: jsObject, name: Strings.foundation) + _component = ReadonlyAttribute(jsObject: jsObject, name: Strings.component) + _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) + _address = ReadonlyAttribute(jsObject: jsObject, name: Strings.address) + _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) + _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _tcpType = ReadonlyAttribute(jsObject: jsObject, name: Strings.tcpType) + _relatedAddress = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedAddress) + _relatedPort = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedPort) + _usernameFragment = ReadonlyAttribute(jsObject: jsObject, name: Strings.usernameFragment) + self.jsObject = jsObject + } + + public convenience init(candidateInitDict: RTCIceCandidateInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(candidateInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var candidate: String + + @ReadonlyAttribute + public var sdpMid: String? + + @ReadonlyAttribute + public var sdpMLineIndex: UInt16? + + @ReadonlyAttribute + public var foundation: String? + + @ReadonlyAttribute + public var component: RTCIceComponent? + + @ReadonlyAttribute + public var priority: UInt32? + + @ReadonlyAttribute + public var address: String? + + @ReadonlyAttribute + public var `protocol`: RTCIceProtocol? + + @ReadonlyAttribute + public var port: UInt16? + + @ReadonlyAttribute + public var type: RTCIceCandidateType? + + @ReadonlyAttribute + public var tcpType: RTCIceTcpCandidateType? + + @ReadonlyAttribute + public var relatedAddress: String? + + @ReadonlyAttribute + public var relatedPort: UInt16? + + @ReadonlyAttribute + public var usernameFragment: String? + + public func toJSON() -> RTCIceCandidateInit { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift new file mode 100644 index 00000000..2c96981c --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceCandidateInit: BridgedDictionary { + public convenience init(candidate: String, sdpMid: String?, sdpMLineIndex: UInt16?, usernameFragment: String?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.candidate] = candidate.jsValue() + object[Strings.sdpMid] = sdpMid.jsValue() + object[Strings.sdpMLineIndex] = sdpMLineIndex.jsValue() + object[Strings.usernameFragment] = usernameFragment.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _candidate = ReadWriteAttribute(jsObject: object, name: Strings.candidate) + _sdpMid = ReadWriteAttribute(jsObject: object, name: Strings.sdpMid) + _sdpMLineIndex = ReadWriteAttribute(jsObject: object, name: Strings.sdpMLineIndex) + _usernameFragment = ReadWriteAttribute(jsObject: object, name: Strings.usernameFragment) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var candidate: String + + @ReadWriteAttribute + public var sdpMid: String? + + @ReadWriteAttribute + public var sdpMLineIndex: UInt16? + + @ReadWriteAttribute + public var usernameFragment: String? +} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift b/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift new file mode 100644 index 00000000..01f3891e --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceCandidatePair: BridgedDictionary { + public convenience init(local: RTCIceCandidate, remote: RTCIceCandidate) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.local] = local.jsValue() + object[Strings.remote] = remote.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _local = ReadWriteAttribute(jsObject: object, name: Strings.local) + _remote = ReadWriteAttribute(jsObject: object, name: Strings.remote) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var local: RTCIceCandidate + + @ReadWriteAttribute + public var remote: RTCIceCandidate +} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift b/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift new file mode 100644 index 00000000..36c8562c --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift @@ -0,0 +1,175 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceCandidatePairStats: BridgedDictionary { + public convenience init(transportId: String, localCandidateId: String, remoteCandidateId: String, state: RTCStatsIceCandidatePairState, nominated: Bool, packetsSent: UInt64, packetsReceived: UInt64, bytesSent: UInt64, bytesReceived: UInt64, lastPacketSentTimestamp: DOMHighResTimeStamp, lastPacketReceivedTimestamp: DOMHighResTimeStamp, firstRequestTimestamp: DOMHighResTimeStamp, lastRequestTimestamp: DOMHighResTimeStamp, lastResponseTimestamp: DOMHighResTimeStamp, totalRoundTripTime: Double, currentRoundTripTime: Double, availableOutgoingBitrate: Double, availableIncomingBitrate: Double, circuitBreakerTriggerCount: UInt32, requestsReceived: UInt64, requestsSent: UInt64, responsesReceived: UInt64, responsesSent: UInt64, retransmissionsReceived: UInt64, retransmissionsSent: UInt64, consentRequestsSent: UInt64, consentExpiredTimestamp: DOMHighResTimeStamp, packetsDiscardedOnSend: UInt32, bytesDiscardedOnSend: UInt64, requestBytesSent: UInt64, consentRequestBytesSent: UInt64, responseBytesSent: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.transportId] = transportId.jsValue() + object[Strings.localCandidateId] = localCandidateId.jsValue() + object[Strings.remoteCandidateId] = remoteCandidateId.jsValue() + object[Strings.state] = state.jsValue() + object[Strings.nominated] = nominated.jsValue() + object[Strings.packetsSent] = packetsSent.jsValue() + object[Strings.packetsReceived] = packetsReceived.jsValue() + object[Strings.bytesSent] = bytesSent.jsValue() + object[Strings.bytesReceived] = bytesReceived.jsValue() + object[Strings.lastPacketSentTimestamp] = lastPacketSentTimestamp.jsValue() + object[Strings.lastPacketReceivedTimestamp] = lastPacketReceivedTimestamp.jsValue() + object[Strings.firstRequestTimestamp] = firstRequestTimestamp.jsValue() + object[Strings.lastRequestTimestamp] = lastRequestTimestamp.jsValue() + object[Strings.lastResponseTimestamp] = lastResponseTimestamp.jsValue() + object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue() + object[Strings.currentRoundTripTime] = currentRoundTripTime.jsValue() + object[Strings.availableOutgoingBitrate] = availableOutgoingBitrate.jsValue() + object[Strings.availableIncomingBitrate] = availableIncomingBitrate.jsValue() + object[Strings.circuitBreakerTriggerCount] = circuitBreakerTriggerCount.jsValue() + object[Strings.requestsReceived] = requestsReceived.jsValue() + object[Strings.requestsSent] = requestsSent.jsValue() + object[Strings.responsesReceived] = responsesReceived.jsValue() + object[Strings.responsesSent] = responsesSent.jsValue() + object[Strings.retransmissionsReceived] = retransmissionsReceived.jsValue() + object[Strings.retransmissionsSent] = retransmissionsSent.jsValue() + object[Strings.consentRequestsSent] = consentRequestsSent.jsValue() + object[Strings.consentExpiredTimestamp] = consentExpiredTimestamp.jsValue() + object[Strings.packetsDiscardedOnSend] = packetsDiscardedOnSend.jsValue() + object[Strings.bytesDiscardedOnSend] = bytesDiscardedOnSend.jsValue() + object[Strings.requestBytesSent] = requestBytesSent.jsValue() + object[Strings.consentRequestBytesSent] = consentRequestBytesSent.jsValue() + object[Strings.responseBytesSent] = responseBytesSent.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) + _localCandidateId = ReadWriteAttribute(jsObject: object, name: Strings.localCandidateId) + _remoteCandidateId = ReadWriteAttribute(jsObject: object, name: Strings.remoteCandidateId) + _state = ReadWriteAttribute(jsObject: object, name: Strings.state) + _nominated = ReadWriteAttribute(jsObject: object, name: Strings.nominated) + _packetsSent = ReadWriteAttribute(jsObject: object, name: Strings.packetsSent) + _packetsReceived = ReadWriteAttribute(jsObject: object, name: Strings.packetsReceived) + _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) + _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) + _lastPacketSentTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastPacketSentTimestamp) + _lastPacketReceivedTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastPacketReceivedTimestamp) + _firstRequestTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.firstRequestTimestamp) + _lastRequestTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastRequestTimestamp) + _lastResponseTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastResponseTimestamp) + _totalRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.totalRoundTripTime) + _currentRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.currentRoundTripTime) + _availableOutgoingBitrate = ReadWriteAttribute(jsObject: object, name: Strings.availableOutgoingBitrate) + _availableIncomingBitrate = ReadWriteAttribute(jsObject: object, name: Strings.availableIncomingBitrate) + _circuitBreakerTriggerCount = ReadWriteAttribute(jsObject: object, name: Strings.circuitBreakerTriggerCount) + _requestsReceived = ReadWriteAttribute(jsObject: object, name: Strings.requestsReceived) + _requestsSent = ReadWriteAttribute(jsObject: object, name: Strings.requestsSent) + _responsesReceived = ReadWriteAttribute(jsObject: object, name: Strings.responsesReceived) + _responsesSent = ReadWriteAttribute(jsObject: object, name: Strings.responsesSent) + _retransmissionsReceived = ReadWriteAttribute(jsObject: object, name: Strings.retransmissionsReceived) + _retransmissionsSent = ReadWriteAttribute(jsObject: object, name: Strings.retransmissionsSent) + _consentRequestsSent = ReadWriteAttribute(jsObject: object, name: Strings.consentRequestsSent) + _consentExpiredTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.consentExpiredTimestamp) + _packetsDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.packetsDiscardedOnSend) + _bytesDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.bytesDiscardedOnSend) + _requestBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.requestBytesSent) + _consentRequestBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.consentRequestBytesSent) + _responseBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.responseBytesSent) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var transportId: String + + @ReadWriteAttribute + public var localCandidateId: String + + @ReadWriteAttribute + public var remoteCandidateId: String + + @ReadWriteAttribute + public var state: RTCStatsIceCandidatePairState + + @ReadWriteAttribute + public var nominated: Bool + + @ReadWriteAttribute + public var packetsSent: UInt64 + + @ReadWriteAttribute + public var packetsReceived: UInt64 + + @ReadWriteAttribute + public var bytesSent: UInt64 + + @ReadWriteAttribute + public var bytesReceived: UInt64 + + @ReadWriteAttribute + public var lastPacketSentTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var lastPacketReceivedTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var firstRequestTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var lastRequestTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var lastResponseTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var totalRoundTripTime: Double + + @ReadWriteAttribute + public var currentRoundTripTime: Double + + @ReadWriteAttribute + public var availableOutgoingBitrate: Double + + @ReadWriteAttribute + public var availableIncomingBitrate: Double + + @ReadWriteAttribute + public var circuitBreakerTriggerCount: UInt32 + + @ReadWriteAttribute + public var requestsReceived: UInt64 + + @ReadWriteAttribute + public var requestsSent: UInt64 + + @ReadWriteAttribute + public var responsesReceived: UInt64 + + @ReadWriteAttribute + public var responsesSent: UInt64 + + @ReadWriteAttribute + public var retransmissionsReceived: UInt64 + + @ReadWriteAttribute + public var retransmissionsSent: UInt64 + + @ReadWriteAttribute + public var consentRequestsSent: UInt64 + + @ReadWriteAttribute + public var consentExpiredTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var packetsDiscardedOnSend: UInt32 + + @ReadWriteAttribute + public var bytesDiscardedOnSend: UInt64 + + @ReadWriteAttribute + public var requestBytesSent: UInt64 + + @ReadWriteAttribute + public var consentRequestBytesSent: UInt64 + + @ReadWriteAttribute + public var responseBytesSent: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift new file mode 100644 index 00000000..0486e846 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceCandidateStats: BridgedDictionary { + public convenience init(transportId: String, address: String?, port: Int32, protocol: String, candidateType: RTCIceCandidateType, priority: Int32, url: String, relayProtocol: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.transportId] = transportId.jsValue() + object[Strings.address] = address.jsValue() + object[Strings.port] = port.jsValue() + object[Strings.protocol] = `protocol`.jsValue() + object[Strings.candidateType] = candidateType.jsValue() + object[Strings.priority] = priority.jsValue() + object[Strings.url] = url.jsValue() + object[Strings.relayProtocol] = relayProtocol.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) + _address = ReadWriteAttribute(jsObject: object, name: Strings.address) + _port = ReadWriteAttribute(jsObject: object, name: Strings.port) + _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) + _candidateType = ReadWriteAttribute(jsObject: object, name: Strings.candidateType) + _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + _relayProtocol = ReadWriteAttribute(jsObject: object, name: Strings.relayProtocol) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var transportId: String + + @ReadWriteAttribute + public var address: String? + + @ReadWriteAttribute + public var port: Int32 + + @ReadWriteAttribute + public var `protocol`: String + + @ReadWriteAttribute + public var candidateType: RTCIceCandidateType + + @ReadWriteAttribute + public var priority: Int32 + + @ReadWriteAttribute + public var url: String + + @ReadWriteAttribute + public var relayProtocol: String +} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift new file mode 100644 index 00000000..cee743aa --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceCandidateType: JSString, JSValueCompatible { + case host = "host" + case srflx = "srflx" + case prflx = "prflx" + case relay = "relay" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceComponent.swift b/Sources/DOMKit/WebIDL/RTCIceComponent.swift new file mode 100644 index 00000000..6148d036 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceComponent.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceComponent: JSString, JSValueCompatible { + case rtp = "rtp" + case rtcp = "rtcp" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift b/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift new file mode 100644 index 00000000..91cec9f3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceConnectionState: JSString, JSValueCompatible { + case closed = "closed" + case failed = "failed" + case disconnected = "disconnected" + case new = "new" + case checking = "checking" + case completed = "completed" + case connected = "connected" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift b/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift new file mode 100644 index 00000000..a627df68 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceCredentialType: JSString, JSValueCompatible { + case password = "password" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift b/Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift new file mode 100644 index 00000000..6bd0dd03 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceGatherOptions: BridgedDictionary { + public convenience init(gatherPolicy: RTCIceTransportPolicy, iceServers: [RTCIceServer]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.gatherPolicy] = gatherPolicy.jsValue() + object[Strings.iceServers] = iceServers.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _gatherPolicy = ReadWriteAttribute(jsObject: object, name: Strings.gatherPolicy) + _iceServers = ReadWriteAttribute(jsObject: object, name: Strings.iceServers) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var gatherPolicy: RTCIceTransportPolicy + + @ReadWriteAttribute + public var iceServers: [RTCIceServer] +} diff --git a/Sources/DOMKit/WebIDL/RTCIceGathererState.swift b/Sources/DOMKit/WebIDL/RTCIceGathererState.swift new file mode 100644 index 00000000..b20a0808 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceGathererState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceGathererState: JSString, JSValueCompatible { + case new = "new" + case gathering = "gathering" + case complete = "complete" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift b/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift new file mode 100644 index 00000000..0adc7eec --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceGatheringState: JSString, JSValueCompatible { + case new = "new" + case gathering = "gathering" + case complete = "complete" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceParameters.swift b/Sources/DOMKit/WebIDL/RTCIceParameters.swift new file mode 100644 index 00000000..4eb5cd4e --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceParameters.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceParameters: BridgedDictionary { + public convenience init(usernameFragment: String, password: String, iceLite: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.usernameFragment] = usernameFragment.jsValue() + object[Strings.password] = password.jsValue() + object[Strings.iceLite] = iceLite.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _usernameFragment = ReadWriteAttribute(jsObject: object, name: Strings.usernameFragment) + _password = ReadWriteAttribute(jsObject: object, name: Strings.password) + _iceLite = ReadWriteAttribute(jsObject: object, name: Strings.iceLite) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var usernameFragment: String + + @ReadWriteAttribute + public var password: String + + @ReadWriteAttribute + public var iceLite: Bool +} diff --git a/Sources/DOMKit/WebIDL/RTCIceProtocol.swift b/Sources/DOMKit/WebIDL/RTCIceProtocol.swift new file mode 100644 index 00000000..638c8af0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceProtocol.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceProtocol: JSString, JSValueCompatible { + case udp = "udp" + case tcp = "tcp" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceRole.swift b/Sources/DOMKit/WebIDL/RTCIceRole.swift new file mode 100644 index 00000000..2205993a --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceRole.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceRole: JSString, JSValueCompatible { + case unknown = "unknown" + case controlling = "controlling" + case controlled = "controlled" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceServer.swift b/Sources/DOMKit/WebIDL/RTCIceServer.swift new file mode 100644 index 00000000..5cd5108d --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceServer.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceServer: BridgedDictionary { + public convenience init(urls: __UNSUPPORTED_UNION__, username: String, credential: String, credentialType: RTCIceCredentialType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.urls] = urls.jsValue() + object[Strings.username] = username.jsValue() + object[Strings.credential] = credential.jsValue() + object[Strings.credentialType] = credentialType.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _urls = ReadWriteAttribute(jsObject: object, name: Strings.urls) + _username = ReadWriteAttribute(jsObject: object, name: Strings.username) + _credential = ReadWriteAttribute(jsObject: object, name: Strings.credential) + _credentialType = ReadWriteAttribute(jsObject: object, name: Strings.credentialType) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var urls: __UNSUPPORTED_UNION__ + + @ReadWriteAttribute + public var username: String + + @ReadWriteAttribute + public var credential: String + + @ReadWriteAttribute + public var credentialType: RTCIceCredentialType +} diff --git a/Sources/DOMKit/WebIDL/RTCIceServerStats.swift b/Sources/DOMKit/WebIDL/RTCIceServerStats.swift new file mode 100644 index 00000000..6d743123 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceServerStats.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceServerStats: BridgedDictionary { + public convenience init(url: String, port: Int32, relayProtocol: String, totalRequestsSent: UInt32, totalResponsesReceived: UInt32, totalRoundTripTime: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.url] = url.jsValue() + object[Strings.port] = port.jsValue() + object[Strings.relayProtocol] = relayProtocol.jsValue() + object[Strings.totalRequestsSent] = totalRequestsSent.jsValue() + object[Strings.totalResponsesReceived] = totalResponsesReceived.jsValue() + object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + _port = ReadWriteAttribute(jsObject: object, name: Strings.port) + _relayProtocol = ReadWriteAttribute(jsObject: object, name: Strings.relayProtocol) + _totalRequestsSent = ReadWriteAttribute(jsObject: object, name: Strings.totalRequestsSent) + _totalResponsesReceived = ReadWriteAttribute(jsObject: object, name: Strings.totalResponsesReceived) + _totalRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.totalRoundTripTime) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var url: String + + @ReadWriteAttribute + public var port: Int32 + + @ReadWriteAttribute + public var relayProtocol: String + + @ReadWriteAttribute + public var totalRequestsSent: UInt32 + + @ReadWriteAttribute + public var totalResponsesReceived: UInt32 + + @ReadWriteAttribute + public var totalRoundTripTime: Double +} diff --git a/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift b/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift new file mode 100644 index 00000000..584d3636 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceTcpCandidateType: JSString, JSValueCompatible { + case active = "active" + case passive = "passive" + case so = "so" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceTransport.swift b/Sources/DOMKit/WebIDL/RTCIceTransport.swift new file mode 100644 index 00000000..13535937 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceTransport.swift @@ -0,0 +1,88 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIceTransport: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCIceTransport].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _role = ReadonlyAttribute(jsObject: jsObject, name: Strings.role) + _component = ReadonlyAttribute(jsObject: jsObject, name: Strings.component) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _gatheringState = ReadonlyAttribute(jsObject: jsObject, name: Strings.gatheringState) + _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + _ongatheringstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ongatheringstatechange) + _onselectedcandidatepairchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onselectedcandidatepairchange) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onicecandidate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicecandidate) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var role: RTCIceRole + + @ReadonlyAttribute + public var component: RTCIceComponent + + @ReadonlyAttribute + public var state: RTCIceTransportState + + @ReadonlyAttribute + public var gatheringState: RTCIceGathererState + + public func getLocalCandidates() -> [RTCIceCandidate] { + jsObject[Strings.getLocalCandidates]!().fromJSValue()! + } + + public func getRemoteCandidates() -> [RTCIceCandidate] { + jsObject[Strings.getRemoteCandidates]!().fromJSValue()! + } + + public func getSelectedCandidatePair() -> RTCIceCandidatePair? { + jsObject[Strings.getSelectedCandidatePair]!().fromJSValue()! + } + + public func getLocalParameters() -> RTCIceParameters? { + jsObject[Strings.getLocalParameters]!().fromJSValue()! + } + + public func getRemoteParameters() -> RTCIceParameters? { + jsObject[Strings.getRemoteParameters]!().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onstatechange: EventHandler + + @ClosureAttribute.Optional1 + public var ongatheringstatechange: EventHandler + + @ClosureAttribute.Optional1 + public var onselectedcandidatepairchange: EventHandler + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + public func gather(options: RTCIceGatherOptions? = nil) { + _ = jsObject[Strings.gather]!(options?.jsValue() ?? .undefined) + } + + public func start(remoteParameters: RTCIceParameters? = nil, role: RTCIceRole? = nil) { + _ = jsObject[Strings.start]!(remoteParameters?.jsValue() ?? .undefined, role?.jsValue() ?? .undefined) + } + + public func stop() { + _ = jsObject[Strings.stop]!() + } + + public func addRemoteCandidate(remoteCandidate: RTCIceCandidateInit? = nil) { + _ = jsObject[Strings.addRemoteCandidate]!(remoteCandidate?.jsValue() ?? .undefined) + } + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onicecandidate: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift b/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift new file mode 100644 index 00000000..e72d4952 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceTransportPolicy: JSString, JSValueCompatible { + case relay = "relay" + case all = "all" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIceTransportState.swift b/Sources/DOMKit/WebIDL/RTCIceTransportState.swift new file mode 100644 index 00000000..778296f2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIceTransportState.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCIceTransportState: JSString, JSValueCompatible { + case new = "new" + case checking = "checking" + case connected = "connected" + case completed = "completed" + case disconnected = "disconnected" + case failed = "failed" + case closed = "closed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift b/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift new file mode 100644 index 00000000..4a752f71 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIdentityAssertion: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityAssertion].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _idp = ReadWriteAttribute(jsObject: jsObject, name: Strings.idp) + _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) + self.jsObject = jsObject + } + + public convenience init(idp: String, name: String) { + self.init(unsafelyWrapping: Self.constructor.new(idp.jsValue(), name.jsValue())) + } + + @ReadWriteAttribute + public var idp: String + + @ReadWriteAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift b/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift new file mode 100644 index 00000000..535a9923 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIdentityAssertionResult: BridgedDictionary { + public convenience init(idp: RTCIdentityProviderDetails, assertion: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.idp] = idp.jsValue() + object[Strings.assertion] = assertion.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _idp = ReadWriteAttribute(jsObject: object, name: Strings.idp) + _assertion = ReadWriteAttribute(jsObject: object, name: Strings.assertion) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var idp: RTCIdentityProviderDetails + + @ReadWriteAttribute + public var assertion: String +} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift b/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift new file mode 100644 index 00000000..239e43b1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIdentityProvider: BridgedDictionary { + public convenience init(generateAssertion: @escaping GenerateAssertionCallback, validateAssertion: @escaping ValidateAssertionCallback) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute.Required3[Strings.generateAssertion, in: object] = generateAssertion + ClosureAttribute.Required2[Strings.validateAssertion, in: object] = validateAssertion + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _generateAssertion = ClosureAttribute.Required3(jsObject: object, name: Strings.generateAssertion) + _validateAssertion = ClosureAttribute.Required2(jsObject: object, name: Strings.validateAssertion) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute.Required3 + public var generateAssertion: GenerateAssertionCallback + + @ClosureAttribute.Required2 + public var validateAssertion: ValidateAssertionCallback +} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift new file mode 100644 index 00000000..b5d743c4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIdentityProviderDetails: BridgedDictionary { + public convenience init(domain: String, protocol: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.domain] = domain.jsValue() + object[Strings.protocol] = `protocol`.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _domain = ReadWriteAttribute(jsObject: object, name: Strings.domain) + _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var domain: String + + @ReadWriteAttribute + public var `protocol`: String +} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift new file mode 100644 index 00000000..5375e384 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIdentityProviderGlobalScope: WorkerGlobalScope { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityProviderGlobalScope].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _rtcIdentityProvider = ReadonlyAttribute(jsObject: jsObject, name: Strings.rtcIdentityProvider) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var rtcIdentityProvider: RTCIdentityProviderRegistrar +} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift new file mode 100644 index 00000000..f93633aa --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIdentityProviderOptions: BridgedDictionary { + public convenience init(protocol: String, usernameHint: String, peerIdentity: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.protocol] = `protocol`.jsValue() + object[Strings.usernameHint] = usernameHint.jsValue() + object[Strings.peerIdentity] = peerIdentity.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) + _usernameHint = ReadWriteAttribute(jsObject: object, name: Strings.usernameHint) + _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var `protocol`: String + + @ReadWriteAttribute + public var usernameHint: String + + @ReadWriteAttribute + public var peerIdentity: String +} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift new file mode 100644 index 00000000..e75e26e9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIdentityProviderRegistrar: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityProviderRegistrar].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func register(idp: RTCIdentityProvider) { + _ = jsObject[Strings.register]!(idp.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift b/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift new file mode 100644 index 00000000..aec714d4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCIdentityValidationResult: BridgedDictionary { + public convenience init(identity: String, contents: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.identity] = identity.jsValue() + object[Strings.contents] = contents.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _identity = ReadWriteAttribute(jsObject: object, name: Strings.identity) + _contents = ReadWriteAttribute(jsObject: object, name: Strings.contents) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var identity: String + + @ReadWriteAttribute + public var contents: String +} diff --git a/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift new file mode 100644 index 00000000..91387a08 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift @@ -0,0 +1,235 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCInboundRtpStreamStats: BridgedDictionary { + public convenience init(receiverId: String, remoteId: String, framesDecoded: UInt32, keyFramesDecoded: UInt32, frameWidth: UInt32, frameHeight: UInt32, frameBitDepth: UInt32, framesPerSecond: Double, qpSum: UInt64, totalDecodeTime: Double, totalInterFrameDelay: Double, totalSquaredInterFrameDelay: Double, voiceActivityFlag: Bool, lastPacketReceivedTimestamp: DOMHighResTimeStamp, averageRtcpInterval: Double, headerBytesReceived: UInt64, fecPacketsReceived: UInt64, fecPacketsDiscarded: UInt64, bytesReceived: UInt64, packetsFailedDecryption: UInt64, packetsDuplicated: UInt64, perDscpPacketsReceived: [String: UInt64], nackCount: UInt32, firCount: UInt32, pliCount: UInt32, sliCount: UInt32, totalProcessingDelay: Double, estimatedPlayoutTimestamp: DOMHighResTimeStamp, jitterBufferDelay: Double, jitterBufferEmittedCount: UInt64, totalSamplesReceived: UInt64, totalSamplesDecoded: UInt64, samplesDecodedWithSilk: UInt64, samplesDecodedWithCelt: UInt64, concealedSamples: UInt64, silentConcealedSamples: UInt64, concealmentEvents: UInt64, insertedSamplesForDeceleration: UInt64, removedSamplesForAcceleration: UInt64, audioLevel: Double, totalAudioEnergy: Double, totalSamplesDuration: Double, framesReceived: UInt32, decoderImplementation: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.receiverId] = receiverId.jsValue() + object[Strings.remoteId] = remoteId.jsValue() + object[Strings.framesDecoded] = framesDecoded.jsValue() + object[Strings.keyFramesDecoded] = keyFramesDecoded.jsValue() + object[Strings.frameWidth] = frameWidth.jsValue() + object[Strings.frameHeight] = frameHeight.jsValue() + object[Strings.frameBitDepth] = frameBitDepth.jsValue() + object[Strings.framesPerSecond] = framesPerSecond.jsValue() + object[Strings.qpSum] = qpSum.jsValue() + object[Strings.totalDecodeTime] = totalDecodeTime.jsValue() + object[Strings.totalInterFrameDelay] = totalInterFrameDelay.jsValue() + object[Strings.totalSquaredInterFrameDelay] = totalSquaredInterFrameDelay.jsValue() + object[Strings.voiceActivityFlag] = voiceActivityFlag.jsValue() + object[Strings.lastPacketReceivedTimestamp] = lastPacketReceivedTimestamp.jsValue() + object[Strings.averageRtcpInterval] = averageRtcpInterval.jsValue() + object[Strings.headerBytesReceived] = headerBytesReceived.jsValue() + object[Strings.fecPacketsReceived] = fecPacketsReceived.jsValue() + object[Strings.fecPacketsDiscarded] = fecPacketsDiscarded.jsValue() + object[Strings.bytesReceived] = bytesReceived.jsValue() + object[Strings.packetsFailedDecryption] = packetsFailedDecryption.jsValue() + object[Strings.packetsDuplicated] = packetsDuplicated.jsValue() + object[Strings.perDscpPacketsReceived] = perDscpPacketsReceived.jsValue() + object[Strings.nackCount] = nackCount.jsValue() + object[Strings.firCount] = firCount.jsValue() + object[Strings.pliCount] = pliCount.jsValue() + object[Strings.sliCount] = sliCount.jsValue() + object[Strings.totalProcessingDelay] = totalProcessingDelay.jsValue() + object[Strings.estimatedPlayoutTimestamp] = estimatedPlayoutTimestamp.jsValue() + object[Strings.jitterBufferDelay] = jitterBufferDelay.jsValue() + object[Strings.jitterBufferEmittedCount] = jitterBufferEmittedCount.jsValue() + object[Strings.totalSamplesReceived] = totalSamplesReceived.jsValue() + object[Strings.totalSamplesDecoded] = totalSamplesDecoded.jsValue() + object[Strings.samplesDecodedWithSilk] = samplesDecodedWithSilk.jsValue() + object[Strings.samplesDecodedWithCelt] = samplesDecodedWithCelt.jsValue() + object[Strings.concealedSamples] = concealedSamples.jsValue() + object[Strings.silentConcealedSamples] = silentConcealedSamples.jsValue() + object[Strings.concealmentEvents] = concealmentEvents.jsValue() + object[Strings.insertedSamplesForDeceleration] = insertedSamplesForDeceleration.jsValue() + object[Strings.removedSamplesForAcceleration] = removedSamplesForAcceleration.jsValue() + object[Strings.audioLevel] = audioLevel.jsValue() + object[Strings.totalAudioEnergy] = totalAudioEnergy.jsValue() + object[Strings.totalSamplesDuration] = totalSamplesDuration.jsValue() + object[Strings.framesReceived] = framesReceived.jsValue() + object[Strings.decoderImplementation] = decoderImplementation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _receiverId = ReadWriteAttribute(jsObject: object, name: Strings.receiverId) + _remoteId = ReadWriteAttribute(jsObject: object, name: Strings.remoteId) + _framesDecoded = ReadWriteAttribute(jsObject: object, name: Strings.framesDecoded) + _keyFramesDecoded = ReadWriteAttribute(jsObject: object, name: Strings.keyFramesDecoded) + _frameWidth = ReadWriteAttribute(jsObject: object, name: Strings.frameWidth) + _frameHeight = ReadWriteAttribute(jsObject: object, name: Strings.frameHeight) + _frameBitDepth = ReadWriteAttribute(jsObject: object, name: Strings.frameBitDepth) + _framesPerSecond = ReadWriteAttribute(jsObject: object, name: Strings.framesPerSecond) + _qpSum = ReadWriteAttribute(jsObject: object, name: Strings.qpSum) + _totalDecodeTime = ReadWriteAttribute(jsObject: object, name: Strings.totalDecodeTime) + _totalInterFrameDelay = ReadWriteAttribute(jsObject: object, name: Strings.totalInterFrameDelay) + _totalSquaredInterFrameDelay = ReadWriteAttribute(jsObject: object, name: Strings.totalSquaredInterFrameDelay) + _voiceActivityFlag = ReadWriteAttribute(jsObject: object, name: Strings.voiceActivityFlag) + _lastPacketReceivedTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastPacketReceivedTimestamp) + _averageRtcpInterval = ReadWriteAttribute(jsObject: object, name: Strings.averageRtcpInterval) + _headerBytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.headerBytesReceived) + _fecPacketsReceived = ReadWriteAttribute(jsObject: object, name: Strings.fecPacketsReceived) + _fecPacketsDiscarded = ReadWriteAttribute(jsObject: object, name: Strings.fecPacketsDiscarded) + _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) + _packetsFailedDecryption = ReadWriteAttribute(jsObject: object, name: Strings.packetsFailedDecryption) + _packetsDuplicated = ReadWriteAttribute(jsObject: object, name: Strings.packetsDuplicated) + _perDscpPacketsReceived = ReadWriteAttribute(jsObject: object, name: Strings.perDscpPacketsReceived) + _nackCount = ReadWriteAttribute(jsObject: object, name: Strings.nackCount) + _firCount = ReadWriteAttribute(jsObject: object, name: Strings.firCount) + _pliCount = ReadWriteAttribute(jsObject: object, name: Strings.pliCount) + _sliCount = ReadWriteAttribute(jsObject: object, name: Strings.sliCount) + _totalProcessingDelay = ReadWriteAttribute(jsObject: object, name: Strings.totalProcessingDelay) + _estimatedPlayoutTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.estimatedPlayoutTimestamp) + _jitterBufferDelay = ReadWriteAttribute(jsObject: object, name: Strings.jitterBufferDelay) + _jitterBufferEmittedCount = ReadWriteAttribute(jsObject: object, name: Strings.jitterBufferEmittedCount) + _totalSamplesReceived = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesReceived) + _totalSamplesDecoded = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesDecoded) + _samplesDecodedWithSilk = ReadWriteAttribute(jsObject: object, name: Strings.samplesDecodedWithSilk) + _samplesDecodedWithCelt = ReadWriteAttribute(jsObject: object, name: Strings.samplesDecodedWithCelt) + _concealedSamples = ReadWriteAttribute(jsObject: object, name: Strings.concealedSamples) + _silentConcealedSamples = ReadWriteAttribute(jsObject: object, name: Strings.silentConcealedSamples) + _concealmentEvents = ReadWriteAttribute(jsObject: object, name: Strings.concealmentEvents) + _insertedSamplesForDeceleration = ReadWriteAttribute(jsObject: object, name: Strings.insertedSamplesForDeceleration) + _removedSamplesForAcceleration = ReadWriteAttribute(jsObject: object, name: Strings.removedSamplesForAcceleration) + _audioLevel = ReadWriteAttribute(jsObject: object, name: Strings.audioLevel) + _totalAudioEnergy = ReadWriteAttribute(jsObject: object, name: Strings.totalAudioEnergy) + _totalSamplesDuration = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesDuration) + _framesReceived = ReadWriteAttribute(jsObject: object, name: Strings.framesReceived) + _decoderImplementation = ReadWriteAttribute(jsObject: object, name: Strings.decoderImplementation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var receiverId: String + + @ReadWriteAttribute + public var remoteId: String + + @ReadWriteAttribute + public var framesDecoded: UInt32 + + @ReadWriteAttribute + public var keyFramesDecoded: UInt32 + + @ReadWriteAttribute + public var frameWidth: UInt32 + + @ReadWriteAttribute + public var frameHeight: UInt32 + + @ReadWriteAttribute + public var frameBitDepth: UInt32 + + @ReadWriteAttribute + public var framesPerSecond: Double + + @ReadWriteAttribute + public var qpSum: UInt64 + + @ReadWriteAttribute + public var totalDecodeTime: Double + + @ReadWriteAttribute + public var totalInterFrameDelay: Double + + @ReadWriteAttribute + public var totalSquaredInterFrameDelay: Double + + @ReadWriteAttribute + public var voiceActivityFlag: Bool + + @ReadWriteAttribute + public var lastPacketReceivedTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var averageRtcpInterval: Double + + @ReadWriteAttribute + public var headerBytesReceived: UInt64 + + @ReadWriteAttribute + public var fecPacketsReceived: UInt64 + + @ReadWriteAttribute + public var fecPacketsDiscarded: UInt64 + + @ReadWriteAttribute + public var bytesReceived: UInt64 + + @ReadWriteAttribute + public var packetsFailedDecryption: UInt64 + + @ReadWriteAttribute + public var packetsDuplicated: UInt64 + + @ReadWriteAttribute + public var perDscpPacketsReceived: [String: UInt64] + + @ReadWriteAttribute + public var nackCount: UInt32 + + @ReadWriteAttribute + public var firCount: UInt32 + + @ReadWriteAttribute + public var pliCount: UInt32 + + @ReadWriteAttribute + public var sliCount: UInt32 + + @ReadWriteAttribute + public var totalProcessingDelay: Double + + @ReadWriteAttribute + public var estimatedPlayoutTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var jitterBufferDelay: Double + + @ReadWriteAttribute + public var jitterBufferEmittedCount: UInt64 + + @ReadWriteAttribute + public var totalSamplesReceived: UInt64 + + @ReadWriteAttribute + public var totalSamplesDecoded: UInt64 + + @ReadWriteAttribute + public var samplesDecodedWithSilk: UInt64 + + @ReadWriteAttribute + public var samplesDecodedWithCelt: UInt64 + + @ReadWriteAttribute + public var concealedSamples: UInt64 + + @ReadWriteAttribute + public var silentConcealedSamples: UInt64 + + @ReadWriteAttribute + public var concealmentEvents: UInt64 + + @ReadWriteAttribute + public var insertedSamplesForDeceleration: UInt64 + + @ReadWriteAttribute + public var removedSamplesForAcceleration: UInt64 + + @ReadWriteAttribute + public var audioLevel: Double + + @ReadWriteAttribute + public var totalAudioEnergy: Double + + @ReadWriteAttribute + public var totalSamplesDuration: Double + + @ReadWriteAttribute + public var framesReceived: UInt32 + + @ReadWriteAttribute + public var decoderImplementation: String +} diff --git a/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift b/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift new file mode 100644 index 00000000..424a131b --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCInsertableStreams: 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/RTCLocalSessionDescriptionInit.swift b/Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift new file mode 100644 index 00000000..ddd02fe4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCLocalSessionDescriptionInit: BridgedDictionary { + public convenience init(type: RTCSdpType, sdp: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.sdp] = sdp.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _sdp = ReadWriteAttribute(jsObject: object, name: Strings.sdp) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: RTCSdpType + + @ReadWriteAttribute + public var sdp: String +} diff --git a/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift b/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift new file mode 100644 index 00000000..3f5d1158 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCMediaHandlerStats: BridgedDictionary { + public convenience init(trackIdentifier: String, ended: Bool, kind: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.trackIdentifier] = trackIdentifier.jsValue() + object[Strings.ended] = ended.jsValue() + object[Strings.kind] = kind.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _trackIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.trackIdentifier) + _ended = ReadWriteAttribute(jsObject: object, name: Strings.ended) + _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var trackIdentifier: String + + @ReadWriteAttribute + public var ended: Bool + + @ReadWriteAttribute + public var kind: String +} diff --git a/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift b/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift new file mode 100644 index 00000000..d25bd041 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCMediaSourceStats: BridgedDictionary { + public convenience init(trackIdentifier: String, kind: String, relayedSource: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.trackIdentifier] = trackIdentifier.jsValue() + object[Strings.kind] = kind.jsValue() + object[Strings.relayedSource] = relayedSource.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _trackIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.trackIdentifier) + _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) + _relayedSource = ReadWriteAttribute(jsObject: object, name: Strings.relayedSource) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var trackIdentifier: String + + @ReadWriteAttribute + public var kind: String + + @ReadWriteAttribute + public var relayedSource: Bool +} diff --git a/Sources/DOMKit/WebIDL/RTCOfferAnswerOptions.swift b/Sources/DOMKit/WebIDL/RTCOfferAnswerOptions.swift new file mode 100644 index 00000000..9dae63ca --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCOfferAnswerOptions.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCOfferAnswerOptions: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCOfferOptions.swift b/Sources/DOMKit/WebIDL/RTCOfferOptions.swift new file mode 100644 index 00000000..f36f5da7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCOfferOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCOfferOptions: BridgedDictionary { + public convenience init(iceRestart: Bool, offerToReceiveAudio: Bool, offerToReceiveVideo: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.iceRestart] = iceRestart.jsValue() + object[Strings.offerToReceiveAudio] = offerToReceiveAudio.jsValue() + object[Strings.offerToReceiveVideo] = offerToReceiveVideo.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _iceRestart = ReadWriteAttribute(jsObject: object, name: Strings.iceRestart) + _offerToReceiveAudio = ReadWriteAttribute(jsObject: object, name: Strings.offerToReceiveAudio) + _offerToReceiveVideo = ReadWriteAttribute(jsObject: object, name: Strings.offerToReceiveVideo) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var iceRestart: Bool + + @ReadWriteAttribute + public var offerToReceiveAudio: Bool + + @ReadWriteAttribute + public var offerToReceiveVideo: Bool +} diff --git a/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift new file mode 100644 index 00000000..da377663 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift @@ -0,0 +1,215 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCOutboundRtpStreamStats: BridgedDictionary { + public convenience init(rtxSsrc: UInt32, mediaSourceId: String, senderId: String, remoteId: String, rid: String, lastPacketSentTimestamp: DOMHighResTimeStamp, headerBytesSent: UInt64, packetsDiscardedOnSend: UInt32, bytesDiscardedOnSend: UInt64, fecPacketsSent: UInt32, retransmittedPacketsSent: UInt64, retransmittedBytesSent: UInt64, targetBitrate: Double, totalEncodedBytesTarget: UInt64, frameWidth: UInt32, frameHeight: UInt32, frameBitDepth: UInt32, framesPerSecond: Double, framesSent: UInt32, hugeFramesSent: UInt32, framesEncoded: UInt32, keyFramesEncoded: UInt32, framesDiscardedOnSend: UInt32, qpSum: UInt64, totalSamplesSent: UInt64, samplesEncodedWithSilk: UInt64, samplesEncodedWithCelt: UInt64, voiceActivityFlag: Bool, totalEncodeTime: Double, totalPacketSendDelay: Double, averageRtcpInterval: Double, qualityLimitationReason: RTCQualityLimitationReason, qualityLimitationDurations: [String: Double], qualityLimitationResolutionChanges: UInt32, perDscpPacketsSent: [String: UInt64], nackCount: UInt32, firCount: UInt32, pliCount: UInt32, sliCount: UInt32, encoderImplementation: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.rtxSsrc] = rtxSsrc.jsValue() + object[Strings.mediaSourceId] = mediaSourceId.jsValue() + object[Strings.senderId] = senderId.jsValue() + object[Strings.remoteId] = remoteId.jsValue() + object[Strings.rid] = rid.jsValue() + object[Strings.lastPacketSentTimestamp] = lastPacketSentTimestamp.jsValue() + object[Strings.headerBytesSent] = headerBytesSent.jsValue() + object[Strings.packetsDiscardedOnSend] = packetsDiscardedOnSend.jsValue() + object[Strings.bytesDiscardedOnSend] = bytesDiscardedOnSend.jsValue() + object[Strings.fecPacketsSent] = fecPacketsSent.jsValue() + object[Strings.retransmittedPacketsSent] = retransmittedPacketsSent.jsValue() + object[Strings.retransmittedBytesSent] = retransmittedBytesSent.jsValue() + object[Strings.targetBitrate] = targetBitrate.jsValue() + object[Strings.totalEncodedBytesTarget] = totalEncodedBytesTarget.jsValue() + object[Strings.frameWidth] = frameWidth.jsValue() + object[Strings.frameHeight] = frameHeight.jsValue() + object[Strings.frameBitDepth] = frameBitDepth.jsValue() + object[Strings.framesPerSecond] = framesPerSecond.jsValue() + object[Strings.framesSent] = framesSent.jsValue() + object[Strings.hugeFramesSent] = hugeFramesSent.jsValue() + object[Strings.framesEncoded] = framesEncoded.jsValue() + object[Strings.keyFramesEncoded] = keyFramesEncoded.jsValue() + object[Strings.framesDiscardedOnSend] = framesDiscardedOnSend.jsValue() + object[Strings.qpSum] = qpSum.jsValue() + object[Strings.totalSamplesSent] = totalSamplesSent.jsValue() + object[Strings.samplesEncodedWithSilk] = samplesEncodedWithSilk.jsValue() + object[Strings.samplesEncodedWithCelt] = samplesEncodedWithCelt.jsValue() + object[Strings.voiceActivityFlag] = voiceActivityFlag.jsValue() + object[Strings.totalEncodeTime] = totalEncodeTime.jsValue() + object[Strings.totalPacketSendDelay] = totalPacketSendDelay.jsValue() + object[Strings.averageRtcpInterval] = averageRtcpInterval.jsValue() + object[Strings.qualityLimitationReason] = qualityLimitationReason.jsValue() + object[Strings.qualityLimitationDurations] = qualityLimitationDurations.jsValue() + object[Strings.qualityLimitationResolutionChanges] = qualityLimitationResolutionChanges.jsValue() + object[Strings.perDscpPacketsSent] = perDscpPacketsSent.jsValue() + object[Strings.nackCount] = nackCount.jsValue() + object[Strings.firCount] = firCount.jsValue() + object[Strings.pliCount] = pliCount.jsValue() + object[Strings.sliCount] = sliCount.jsValue() + object[Strings.encoderImplementation] = encoderImplementation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _rtxSsrc = ReadWriteAttribute(jsObject: object, name: Strings.rtxSsrc) + _mediaSourceId = ReadWriteAttribute(jsObject: object, name: Strings.mediaSourceId) + _senderId = ReadWriteAttribute(jsObject: object, name: Strings.senderId) + _remoteId = ReadWriteAttribute(jsObject: object, name: Strings.remoteId) + _rid = ReadWriteAttribute(jsObject: object, name: Strings.rid) + _lastPacketSentTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastPacketSentTimestamp) + _headerBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.headerBytesSent) + _packetsDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.packetsDiscardedOnSend) + _bytesDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.bytesDiscardedOnSend) + _fecPacketsSent = ReadWriteAttribute(jsObject: object, name: Strings.fecPacketsSent) + _retransmittedPacketsSent = ReadWriteAttribute(jsObject: object, name: Strings.retransmittedPacketsSent) + _retransmittedBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.retransmittedBytesSent) + _targetBitrate = ReadWriteAttribute(jsObject: object, name: Strings.targetBitrate) + _totalEncodedBytesTarget = ReadWriteAttribute(jsObject: object, name: Strings.totalEncodedBytesTarget) + _frameWidth = ReadWriteAttribute(jsObject: object, name: Strings.frameWidth) + _frameHeight = ReadWriteAttribute(jsObject: object, name: Strings.frameHeight) + _frameBitDepth = ReadWriteAttribute(jsObject: object, name: Strings.frameBitDepth) + _framesPerSecond = ReadWriteAttribute(jsObject: object, name: Strings.framesPerSecond) + _framesSent = ReadWriteAttribute(jsObject: object, name: Strings.framesSent) + _hugeFramesSent = ReadWriteAttribute(jsObject: object, name: Strings.hugeFramesSent) + _framesEncoded = ReadWriteAttribute(jsObject: object, name: Strings.framesEncoded) + _keyFramesEncoded = ReadWriteAttribute(jsObject: object, name: Strings.keyFramesEncoded) + _framesDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.framesDiscardedOnSend) + _qpSum = ReadWriteAttribute(jsObject: object, name: Strings.qpSum) + _totalSamplesSent = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesSent) + _samplesEncodedWithSilk = ReadWriteAttribute(jsObject: object, name: Strings.samplesEncodedWithSilk) + _samplesEncodedWithCelt = ReadWriteAttribute(jsObject: object, name: Strings.samplesEncodedWithCelt) + _voiceActivityFlag = ReadWriteAttribute(jsObject: object, name: Strings.voiceActivityFlag) + _totalEncodeTime = ReadWriteAttribute(jsObject: object, name: Strings.totalEncodeTime) + _totalPacketSendDelay = ReadWriteAttribute(jsObject: object, name: Strings.totalPacketSendDelay) + _averageRtcpInterval = ReadWriteAttribute(jsObject: object, name: Strings.averageRtcpInterval) + _qualityLimitationReason = ReadWriteAttribute(jsObject: object, name: Strings.qualityLimitationReason) + _qualityLimitationDurations = ReadWriteAttribute(jsObject: object, name: Strings.qualityLimitationDurations) + _qualityLimitationResolutionChanges = ReadWriteAttribute(jsObject: object, name: Strings.qualityLimitationResolutionChanges) + _perDscpPacketsSent = ReadWriteAttribute(jsObject: object, name: Strings.perDscpPacketsSent) + _nackCount = ReadWriteAttribute(jsObject: object, name: Strings.nackCount) + _firCount = ReadWriteAttribute(jsObject: object, name: Strings.firCount) + _pliCount = ReadWriteAttribute(jsObject: object, name: Strings.pliCount) + _sliCount = ReadWriteAttribute(jsObject: object, name: Strings.sliCount) + _encoderImplementation = ReadWriteAttribute(jsObject: object, name: Strings.encoderImplementation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var rtxSsrc: UInt32 + + @ReadWriteAttribute + public var mediaSourceId: String + + @ReadWriteAttribute + public var senderId: String + + @ReadWriteAttribute + public var remoteId: String + + @ReadWriteAttribute + public var rid: String + + @ReadWriteAttribute + public var lastPacketSentTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var headerBytesSent: UInt64 + + @ReadWriteAttribute + public var packetsDiscardedOnSend: UInt32 + + @ReadWriteAttribute + public var bytesDiscardedOnSend: UInt64 + + @ReadWriteAttribute + public var fecPacketsSent: UInt32 + + @ReadWriteAttribute + public var retransmittedPacketsSent: UInt64 + + @ReadWriteAttribute + public var retransmittedBytesSent: UInt64 + + @ReadWriteAttribute + public var targetBitrate: Double + + @ReadWriteAttribute + public var totalEncodedBytesTarget: UInt64 + + @ReadWriteAttribute + public var frameWidth: UInt32 + + @ReadWriteAttribute + public var frameHeight: UInt32 + + @ReadWriteAttribute + public var frameBitDepth: UInt32 + + @ReadWriteAttribute + public var framesPerSecond: Double + + @ReadWriteAttribute + public var framesSent: UInt32 + + @ReadWriteAttribute + public var hugeFramesSent: UInt32 + + @ReadWriteAttribute + public var framesEncoded: UInt32 + + @ReadWriteAttribute + public var keyFramesEncoded: UInt32 + + @ReadWriteAttribute + public var framesDiscardedOnSend: UInt32 + + @ReadWriteAttribute + public var qpSum: UInt64 + + @ReadWriteAttribute + public var totalSamplesSent: UInt64 + + @ReadWriteAttribute + public var samplesEncodedWithSilk: UInt64 + + @ReadWriteAttribute + public var samplesEncodedWithCelt: UInt64 + + @ReadWriteAttribute + public var voiceActivityFlag: Bool + + @ReadWriteAttribute + public var totalEncodeTime: Double + + @ReadWriteAttribute + public var totalPacketSendDelay: Double + + @ReadWriteAttribute + public var averageRtcpInterval: Double + + @ReadWriteAttribute + public var qualityLimitationReason: RTCQualityLimitationReason + + @ReadWriteAttribute + public var qualityLimitationDurations: [String: Double] + + @ReadWriteAttribute + public var qualityLimitationResolutionChanges: UInt32 + + @ReadWriteAttribute + public var perDscpPacketsSent: [String: UInt64] + + @ReadWriteAttribute + public var nackCount: UInt32 + + @ReadWriteAttribute + public var firCount: UInt32 + + @ReadWriteAttribute + public var pliCount: UInt32 + + @ReadWriteAttribute + public var sliCount: UInt32 + + @ReadWriteAttribute + public var encoderImplementation: String +} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift new file mode 100644 index 00000000..971f0ea5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift @@ -0,0 +1,290 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCPeerConnection: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnection].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _localDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.localDescription) + _currentLocalDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentLocalDescription) + _pendingLocalDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.pendingLocalDescription) + _remoteDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.remoteDescription) + _currentRemoteDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentRemoteDescription) + _pendingRemoteDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.pendingRemoteDescription) + _signalingState = ReadonlyAttribute(jsObject: jsObject, name: Strings.signalingState) + _iceGatheringState = ReadonlyAttribute(jsObject: jsObject, name: Strings.iceGatheringState) + _iceConnectionState = ReadonlyAttribute(jsObject: jsObject, name: Strings.iceConnectionState) + _connectionState = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectionState) + _canTrickleIceCandidates = ReadonlyAttribute(jsObject: jsObject, name: Strings.canTrickleIceCandidates) + _onnegotiationneeded = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnegotiationneeded) + _onicecandidate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicecandidate) + _onicecandidateerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicecandidateerror) + _onsignalingstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsignalingstatechange) + _oniceconnectionstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oniceconnectionstatechange) + _onicegatheringstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicegatheringstatechange) + _onconnectionstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnectionstatechange) + _ontrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontrack) + _sctp = ReadonlyAttribute(jsObject: jsObject, name: Strings.sctp) + _ondatachannel = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondatachannel) + _peerIdentity = ReadonlyAttribute(jsObject: jsObject, name: Strings.peerIdentity) + _idpLoginUrl = ReadonlyAttribute(jsObject: jsObject, name: Strings.idpLoginUrl) + _idpErrorInfo = ReadonlyAttribute(jsObject: jsObject, name: Strings.idpErrorInfo) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(configuration: RTCConfiguration? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(configuration?.jsValue() ?? .undefined)) + } + + public func createOffer(options: RTCOfferOptions? = nil) -> JSPromise { + jsObject[Strings.createOffer]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createOffer(options: RTCOfferOptions? = nil) async throws -> RTCSessionDescriptionInit { + let _promise: JSPromise = jsObject[Strings.createOffer]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func createAnswer(options: RTCAnswerOptions? = nil) -> JSPromise { + jsObject[Strings.createAnswer]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createAnswer(options: RTCAnswerOptions? = nil) async throws -> RTCSessionDescriptionInit { + let _promise: JSPromise = jsObject[Strings.createAnswer]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func setLocalDescription(description: RTCLocalSessionDescriptionInit? = nil) -> JSPromise { + jsObject[Strings.setLocalDescription]!(description?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setLocalDescription(description: RTCLocalSessionDescriptionInit? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.setLocalDescription]!(description?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + @ReadonlyAttribute + public var localDescription: RTCSessionDescription? + + @ReadonlyAttribute + public var currentLocalDescription: RTCSessionDescription? + + @ReadonlyAttribute + public var pendingLocalDescription: RTCSessionDescription? + + public func setRemoteDescription(description: RTCSessionDescriptionInit) -> JSPromise { + jsObject[Strings.setRemoteDescription]!(description.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setRemoteDescription(description: RTCSessionDescriptionInit) async throws { + let _promise: JSPromise = jsObject[Strings.setRemoteDescription]!(description.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + @ReadonlyAttribute + public var remoteDescription: RTCSessionDescription? + + @ReadonlyAttribute + public var currentRemoteDescription: RTCSessionDescription? + + @ReadonlyAttribute + public var pendingRemoteDescription: RTCSessionDescription? + + public func addIceCandidate(candidate: RTCIceCandidateInit? = nil) -> JSPromise { + jsObject[Strings.addIceCandidate]!(candidate?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func addIceCandidate(candidate: RTCIceCandidateInit? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.addIceCandidate]!(candidate?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + @ReadonlyAttribute + public var signalingState: RTCSignalingState + + @ReadonlyAttribute + public var iceGatheringState: RTCIceGatheringState + + @ReadonlyAttribute + public var iceConnectionState: RTCIceConnectionState + + @ReadonlyAttribute + public var connectionState: RTCPeerConnectionState + + @ReadonlyAttribute + public var canTrickleIceCandidates: Bool? + + public func restartIce() { + _ = jsObject[Strings.restartIce]!() + } + + public func getConfiguration() -> RTCConfiguration { + jsObject[Strings.getConfiguration]!().fromJSValue()! + } + + public func setConfiguration(configuration: RTCConfiguration? = nil) { + _ = jsObject[Strings.setConfiguration]!(configuration?.jsValue() ?? .undefined) + } + + public func close() { + _ = jsObject[Strings.close]!() + } + + @ClosureAttribute.Optional1 + public var onnegotiationneeded: EventHandler + + @ClosureAttribute.Optional1 + public var onicecandidate: EventHandler + + @ClosureAttribute.Optional1 + public var onicecandidateerror: EventHandler + + @ClosureAttribute.Optional1 + public var onsignalingstatechange: EventHandler + + @ClosureAttribute.Optional1 + public var oniceconnectionstatechange: EventHandler + + @ClosureAttribute.Optional1 + public var onicegatheringstatechange: EventHandler + + @ClosureAttribute.Optional1 + public var onconnectionstatechange: EventHandler + + public func createOffer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback, options: RTCOfferOptions? = nil) -> JSPromise { + jsObject[Strings.createOffer]!(successCallback.jsValue(), failureCallback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createOffer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback, options: RTCOfferOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.createOffer]!(successCallback.jsValue(), failureCallback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func setLocalDescription(description: RTCLocalSessionDescriptionInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) -> JSPromise { + jsObject[Strings.setLocalDescription]!(description.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setLocalDescription(description: RTCLocalSessionDescriptionInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) async throws { + let _promise: JSPromise = jsObject[Strings.setLocalDescription]!(description.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func createAnswer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback) -> JSPromise { + jsObject[Strings.createAnswer]!(successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createAnswer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback) async throws { + let _promise: JSPromise = jsObject[Strings.createAnswer]!(successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func setRemoteDescription(description: RTCSessionDescriptionInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) -> JSPromise { + jsObject[Strings.setRemoteDescription]!(description.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setRemoteDescription(description: RTCSessionDescriptionInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) async throws { + let _promise: JSPromise = jsObject[Strings.setRemoteDescription]!(description.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func addIceCandidate(candidate: RTCIceCandidateInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) -> JSPromise { + jsObject[Strings.addIceCandidate]!(candidate.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func addIceCandidate(candidate: RTCIceCandidateInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) async throws { + let _promise: JSPromise = jsObject[Strings.addIceCandidate]!(candidate.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) -> JSPromise { + constructor[Strings.generateCertificate]!(keygenAlgorithm.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) async throws -> RTCCertificate { + let _promise: JSPromise = constructor[Strings.generateCertificate]!(keygenAlgorithm.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getSenders() -> [RTCRtpSender] { + jsObject[Strings.getSenders]!().fromJSValue()! + } + + public func getReceivers() -> [RTCRtpReceiver] { + jsObject[Strings.getReceivers]!().fromJSValue()! + } + + public func getTransceivers() -> [RTCRtpTransceiver] { + jsObject[Strings.getTransceivers]!().fromJSValue()! + } + + public func addTrack(track: MediaStreamTrack, streams: MediaStream...) -> RTCRtpSender { + jsObject[Strings.addTrack]!(track.jsValue(), streams.jsValue()).fromJSValue()! + } + + public func removeTrack(sender: RTCRtpSender) { + _ = jsObject[Strings.removeTrack]!(sender.jsValue()) + } + + public func addTransceiver(trackOrKind: __UNSUPPORTED_UNION__, init: RTCRtpTransceiverInit? = nil) -> RTCRtpTransceiver { + jsObject[Strings.addTransceiver]!(trackOrKind.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var ontrack: EventHandler + + @ReadonlyAttribute + public var sctp: RTCSctpTransport? + + public func createDataChannel(label: String, dataChannelDict: RTCDataChannelInit? = nil) -> RTCDataChannel { + jsObject[Strings.createDataChannel]!(label.jsValue(), dataChannelDict?.jsValue() ?? .undefined).fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var ondatachannel: EventHandler + + public func getStats(selector: MediaStreamTrack? = nil) -> JSPromise { + jsObject[Strings.getStats]!(selector?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getStats(selector: MediaStreamTrack? = nil) async throws -> RTCStatsReport { + let _promise: JSPromise = jsObject[Strings.getStats]!(selector?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func setIdentityProvider(provider: String, options: RTCIdentityProviderOptions? = nil) { + _ = jsObject[Strings.setIdentityProvider]!(provider.jsValue(), options?.jsValue() ?? .undefined) + } + + public func getIdentityAssertion() -> JSPromise { + jsObject[Strings.getIdentityAssertion]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getIdentityAssertion() async throws -> String { + let _promise: JSPromise = jsObject[Strings.getIdentityAssertion]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var peerIdentity: JSPromise + + @ReadonlyAttribute + public var idpLoginUrl: String? + + @ReadonlyAttribute + public var idpErrorInfo: String? +} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift new file mode 100644 index 00000000..eaf75240 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCPeerConnectionIceErrorEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnectionIceErrorEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _address = ReadonlyAttribute(jsObject: jsObject, name: Strings.address) + _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _errorCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorCode) + _errorText = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorText) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: RTCPeerConnectionIceErrorEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var address: String? + + @ReadonlyAttribute + public var port: UInt16? + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var errorCode: UInt16 + + @ReadonlyAttribute + public var errorText: String +} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift new file mode 100644 index 00000000..9f3ce0b9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCPeerConnectionIceErrorEventInit: BridgedDictionary { + public convenience init(address: String?, port: UInt16?, url: String, errorCode: UInt16, errorText: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.address] = address.jsValue() + object[Strings.port] = port.jsValue() + object[Strings.url] = url.jsValue() + object[Strings.errorCode] = errorCode.jsValue() + object[Strings.errorText] = errorText.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _address = ReadWriteAttribute(jsObject: object, name: Strings.address) + _port = ReadWriteAttribute(jsObject: object, name: Strings.port) + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + _errorCode = ReadWriteAttribute(jsObject: object, name: Strings.errorCode) + _errorText = ReadWriteAttribute(jsObject: object, name: Strings.errorText) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var address: String? + + @ReadWriteAttribute + public var port: UInt16? + + @ReadWriteAttribute + public var url: String + + @ReadWriteAttribute + public var errorCode: UInt16 + + @ReadWriteAttribute + public var errorText: String +} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift new file mode 100644 index 00000000..fbf44eef --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCPeerConnectionIceEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnectionIceEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _candidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.candidate) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: RTCPeerConnectionIceEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var candidate: RTCIceCandidate? + + @ReadonlyAttribute + public var url: String? +} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift new file mode 100644 index 00000000..b07a70ac --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCPeerConnectionIceEventInit: BridgedDictionary { + public convenience init(candidate: RTCIceCandidate?, url: String?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.candidate] = candidate.jsValue() + object[Strings.url] = url.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _candidate = ReadWriteAttribute(jsObject: object, name: Strings.candidate) + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var candidate: RTCIceCandidate? + + @ReadWriteAttribute + public var url: String? +} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift new file mode 100644 index 00000000..42b569f7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCPeerConnectionState: JSString, JSValueCompatible { + case closed = "closed" + case failed = "failed" + case disconnected = "disconnected" + case new = "new" + case connecting = "connecting" + case connected = "connected" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift new file mode 100644 index 00000000..99592479 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCPeerConnectionStats: BridgedDictionary { + public convenience init(dataChannelsOpened: UInt32, dataChannelsClosed: UInt32, dataChannelsRequested: UInt32, dataChannelsAccepted: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.dataChannelsOpened] = dataChannelsOpened.jsValue() + object[Strings.dataChannelsClosed] = dataChannelsClosed.jsValue() + object[Strings.dataChannelsRequested] = dataChannelsRequested.jsValue() + object[Strings.dataChannelsAccepted] = dataChannelsAccepted.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _dataChannelsOpened = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelsOpened) + _dataChannelsClosed = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelsClosed) + _dataChannelsRequested = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelsRequested) + _dataChannelsAccepted = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelsAccepted) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var dataChannelsOpened: UInt32 + + @ReadWriteAttribute + public var dataChannelsClosed: UInt32 + + @ReadWriteAttribute + public var dataChannelsRequested: UInt32 + + @ReadWriteAttribute + public var dataChannelsAccepted: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/RTCPriorityType.swift b/Sources/DOMKit/WebIDL/RTCPriorityType.swift new file mode 100644 index 00000000..7a1b4c2c --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCPriorityType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCPriorityType: JSString, JSValueCompatible { + case veryLow = "very-low" + case low = "low" + case medium = "medium" + case high = "high" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift b/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift new file mode 100644 index 00000000..8a308ba5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCQualityLimitationReason: JSString, JSValueCompatible { + case none = "none" + case cpu = "cpu" + case bandwidth = "bandwidth" + case other = "other" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift new file mode 100644 index 00000000..8fe210ac --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift @@ -0,0 +1,95 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCReceivedRtpStreamStats: BridgedDictionary { + public convenience init(packetsReceived: UInt64, packetsLost: Int64, jitter: Double, packetsDiscarded: UInt64, packetsRepaired: UInt64, burstPacketsLost: UInt64, burstPacketsDiscarded: UInt64, burstLossCount: UInt32, burstDiscardCount: UInt32, burstLossRate: Double, burstDiscardRate: Double, gapLossRate: Double, gapDiscardRate: Double, framesDropped: UInt32, partialFramesLost: UInt32, fullFramesLost: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.packetsReceived] = packetsReceived.jsValue() + object[Strings.packetsLost] = packetsLost.jsValue() + object[Strings.jitter] = jitter.jsValue() + object[Strings.packetsDiscarded] = packetsDiscarded.jsValue() + object[Strings.packetsRepaired] = packetsRepaired.jsValue() + object[Strings.burstPacketsLost] = burstPacketsLost.jsValue() + object[Strings.burstPacketsDiscarded] = burstPacketsDiscarded.jsValue() + object[Strings.burstLossCount] = burstLossCount.jsValue() + object[Strings.burstDiscardCount] = burstDiscardCount.jsValue() + object[Strings.burstLossRate] = burstLossRate.jsValue() + object[Strings.burstDiscardRate] = burstDiscardRate.jsValue() + object[Strings.gapLossRate] = gapLossRate.jsValue() + object[Strings.gapDiscardRate] = gapDiscardRate.jsValue() + object[Strings.framesDropped] = framesDropped.jsValue() + object[Strings.partialFramesLost] = partialFramesLost.jsValue() + object[Strings.fullFramesLost] = fullFramesLost.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _packetsReceived = ReadWriteAttribute(jsObject: object, name: Strings.packetsReceived) + _packetsLost = ReadWriteAttribute(jsObject: object, name: Strings.packetsLost) + _jitter = ReadWriteAttribute(jsObject: object, name: Strings.jitter) + _packetsDiscarded = ReadWriteAttribute(jsObject: object, name: Strings.packetsDiscarded) + _packetsRepaired = ReadWriteAttribute(jsObject: object, name: Strings.packetsRepaired) + _burstPacketsLost = ReadWriteAttribute(jsObject: object, name: Strings.burstPacketsLost) + _burstPacketsDiscarded = ReadWriteAttribute(jsObject: object, name: Strings.burstPacketsDiscarded) + _burstLossCount = ReadWriteAttribute(jsObject: object, name: Strings.burstLossCount) + _burstDiscardCount = ReadWriteAttribute(jsObject: object, name: Strings.burstDiscardCount) + _burstLossRate = ReadWriteAttribute(jsObject: object, name: Strings.burstLossRate) + _burstDiscardRate = ReadWriteAttribute(jsObject: object, name: Strings.burstDiscardRate) + _gapLossRate = ReadWriteAttribute(jsObject: object, name: Strings.gapLossRate) + _gapDiscardRate = ReadWriteAttribute(jsObject: object, name: Strings.gapDiscardRate) + _framesDropped = ReadWriteAttribute(jsObject: object, name: Strings.framesDropped) + _partialFramesLost = ReadWriteAttribute(jsObject: object, name: Strings.partialFramesLost) + _fullFramesLost = ReadWriteAttribute(jsObject: object, name: Strings.fullFramesLost) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var packetsReceived: UInt64 + + @ReadWriteAttribute + public var packetsLost: Int64 + + @ReadWriteAttribute + public var jitter: Double + + @ReadWriteAttribute + public var packetsDiscarded: UInt64 + + @ReadWriteAttribute + public var packetsRepaired: UInt64 + + @ReadWriteAttribute + public var burstPacketsLost: UInt64 + + @ReadWriteAttribute + public var burstPacketsDiscarded: UInt64 + + @ReadWriteAttribute + public var burstLossCount: UInt32 + + @ReadWriteAttribute + public var burstDiscardCount: UInt32 + + @ReadWriteAttribute + public var burstLossRate: Double + + @ReadWriteAttribute + public var burstDiscardRate: Double + + @ReadWriteAttribute + public var gapLossRate: Double + + @ReadWriteAttribute + public var gapDiscardRate: Double + + @ReadWriteAttribute + public var framesDropped: UInt32 + + @ReadWriteAttribute + public var partialFramesLost: UInt32 + + @ReadWriteAttribute + public var fullFramesLost: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift new file mode 100644 index 00000000..b3f76f46 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRemoteInboundRtpStreamStats: BridgedDictionary { + public convenience init(localId: String, roundTripTime: Double, totalRoundTripTime: Double, fractionLost: Double, reportsReceived: UInt64, roundTripTimeMeasurements: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.localId] = localId.jsValue() + object[Strings.roundTripTime] = roundTripTime.jsValue() + object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue() + object[Strings.fractionLost] = fractionLost.jsValue() + object[Strings.reportsReceived] = reportsReceived.jsValue() + object[Strings.roundTripTimeMeasurements] = roundTripTimeMeasurements.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _localId = ReadWriteAttribute(jsObject: object, name: Strings.localId) + _roundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.roundTripTime) + _totalRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.totalRoundTripTime) + _fractionLost = ReadWriteAttribute(jsObject: object, name: Strings.fractionLost) + _reportsReceived = ReadWriteAttribute(jsObject: object, name: Strings.reportsReceived) + _roundTripTimeMeasurements = ReadWriteAttribute(jsObject: object, name: Strings.roundTripTimeMeasurements) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var localId: String + + @ReadWriteAttribute + public var roundTripTime: Double + + @ReadWriteAttribute + public var totalRoundTripTime: Double + + @ReadWriteAttribute + public var fractionLost: Double + + @ReadWriteAttribute + public var reportsReceived: UInt64 + + @ReadWriteAttribute + public var roundTripTimeMeasurements: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift new file mode 100644 index 00000000..a66ff4d7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRemoteOutboundRtpStreamStats: BridgedDictionary { + public convenience init(localId: String, remoteTimestamp: DOMHighResTimeStamp, reportsSent: UInt64, roundTripTime: Double, totalRoundTripTime: Double, roundTripTimeMeasurements: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.localId] = localId.jsValue() + object[Strings.remoteTimestamp] = remoteTimestamp.jsValue() + object[Strings.reportsSent] = reportsSent.jsValue() + object[Strings.roundTripTime] = roundTripTime.jsValue() + object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue() + object[Strings.roundTripTimeMeasurements] = roundTripTimeMeasurements.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _localId = ReadWriteAttribute(jsObject: object, name: Strings.localId) + _remoteTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.remoteTimestamp) + _reportsSent = ReadWriteAttribute(jsObject: object, name: Strings.reportsSent) + _roundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.roundTripTime) + _totalRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.totalRoundTripTime) + _roundTripTimeMeasurements = ReadWriteAttribute(jsObject: object, name: Strings.roundTripTimeMeasurements) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var localId: String + + @ReadWriteAttribute + public var remoteTimestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var reportsSent: UInt64 + + @ReadWriteAttribute + public var roundTripTime: Double + + @ReadWriteAttribute + public var totalRoundTripTime: Double + + @ReadWriteAttribute + public var roundTripTimeMeasurements: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift b/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift new file mode 100644 index 00000000..07045ba6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCRtcpMuxPolicy: JSString, JSValueCompatible { + case require = "require" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCRtcpParameters.swift b/Sources/DOMKit/WebIDL/RTCRtcpParameters.swift new file mode 100644 index 00000000..fee47629 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtcpParameters.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtcpParameters: BridgedDictionary { + public convenience init(cname: String, reducedSize: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.cname] = cname.jsValue() + object[Strings.reducedSize] = reducedSize.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _cname = ReadWriteAttribute(jsObject: object, name: Strings.cname) + _reducedSize = ReadWriteAttribute(jsObject: object, name: Strings.reducedSize) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var cname: String + + @ReadWriteAttribute + public var reducedSize: Bool +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift b/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift new file mode 100644 index 00000000..578c8f23 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpCapabilities: BridgedDictionary { + public convenience init(codecs: [RTCRtpCodecCapability], headerExtensions: [RTCRtpHeaderExtensionCapability]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.codecs] = codecs.jsValue() + object[Strings.headerExtensions] = headerExtensions.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _codecs = ReadWriteAttribute(jsObject: object, name: Strings.codecs) + _headerExtensions = ReadWriteAttribute(jsObject: object, name: Strings.headerExtensions) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var codecs: [RTCRtpCodecCapability] + + @ReadWriteAttribute + public var headerExtensions: [RTCRtpHeaderExtensionCapability] +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift b/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift new file mode 100644 index 00000000..796aca22 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpCodecCapability: BridgedDictionary { + public convenience init(mimeType: String, clockRate: UInt32, channels: UInt16, sdpFmtpLine: String, scalabilityModes: [String]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mimeType] = mimeType.jsValue() + object[Strings.clockRate] = clockRate.jsValue() + object[Strings.channels] = channels.jsValue() + object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue() + object[Strings.scalabilityModes] = scalabilityModes.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mimeType = ReadWriteAttribute(jsObject: object, name: Strings.mimeType) + _clockRate = ReadWriteAttribute(jsObject: object, name: Strings.clockRate) + _channels = ReadWriteAttribute(jsObject: object, name: Strings.channels) + _sdpFmtpLine = ReadWriteAttribute(jsObject: object, name: Strings.sdpFmtpLine) + _scalabilityModes = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityModes) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mimeType: String + + @ReadWriteAttribute + public var clockRate: UInt32 + + @ReadWriteAttribute + public var channels: UInt16 + + @ReadWriteAttribute + public var sdpFmtpLine: String + + @ReadWriteAttribute + public var scalabilityModes: [String] +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift new file mode 100644 index 00000000..47b6c9aa --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpCodecParameters: BridgedDictionary { + public convenience init(payloadType: UInt8, mimeType: String, clockRate: UInt32, channels: UInt16, sdpFmtpLine: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.payloadType] = payloadType.jsValue() + object[Strings.mimeType] = mimeType.jsValue() + object[Strings.clockRate] = clockRate.jsValue() + object[Strings.channels] = channels.jsValue() + object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _payloadType = ReadWriteAttribute(jsObject: object, name: Strings.payloadType) + _mimeType = ReadWriteAttribute(jsObject: object, name: Strings.mimeType) + _clockRate = ReadWriteAttribute(jsObject: object, name: Strings.clockRate) + _channels = ReadWriteAttribute(jsObject: object, name: Strings.channels) + _sdpFmtpLine = ReadWriteAttribute(jsObject: object, name: Strings.sdpFmtpLine) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var payloadType: UInt8 + + @ReadWriteAttribute + public var mimeType: String + + @ReadWriteAttribute + public var clockRate: UInt32 + + @ReadWriteAttribute + public var channels: UInt16 + + @ReadWriteAttribute + public var sdpFmtpLine: String +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift new file mode 100644 index 00000000..bf00495c --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpCodingParameters: BridgedDictionary { + public convenience init(rid: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.rid] = rid.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _rid = ReadWriteAttribute(jsObject: object, name: Strings.rid) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var rid: String +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift b/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift new file mode 100644 index 00000000..61ed00ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpContributingSource: BridgedDictionary { + public convenience init(timestamp: DOMHighResTimeStamp, source: UInt32, audioLevel: Double, rtpTimestamp: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.timestamp] = timestamp.jsValue() + object[Strings.source] = source.jsValue() + object[Strings.audioLevel] = audioLevel.jsValue() + object[Strings.rtpTimestamp] = rtpTimestamp.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _source = ReadWriteAttribute(jsObject: object, name: Strings.source) + _audioLevel = ReadWriteAttribute(jsObject: object, name: Strings.audioLevel) + _rtpTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.rtpTimestamp) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var timestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var source: UInt32 + + @ReadWriteAttribute + public var audioLevel: Double + + @ReadWriteAttribute + public var rtpTimestamp: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift b/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift new file mode 100644 index 00000000..56fec3c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpContributingSourceStats: BridgedDictionary { + public convenience init(contributorSsrc: UInt32, inboundRtpStreamId: String, packetsContributedTo: UInt32, audioLevel: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.contributorSsrc] = contributorSsrc.jsValue() + object[Strings.inboundRtpStreamId] = inboundRtpStreamId.jsValue() + object[Strings.packetsContributedTo] = packetsContributedTo.jsValue() + object[Strings.audioLevel] = audioLevel.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _contributorSsrc = ReadWriteAttribute(jsObject: object, name: Strings.contributorSsrc) + _inboundRtpStreamId = ReadWriteAttribute(jsObject: object, name: Strings.inboundRtpStreamId) + _packetsContributedTo = ReadWriteAttribute(jsObject: object, name: Strings.packetsContributedTo) + _audioLevel = ReadWriteAttribute(jsObject: object, name: Strings.audioLevel) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var contributorSsrc: UInt32 + + @ReadWriteAttribute + public var inboundRtpStreamId: String + + @ReadWriteAttribute + public var packetsContributedTo: UInt32 + + @ReadWriteAttribute + public var audioLevel: Double +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpDecodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpDecodingParameters.swift new file mode 100644 index 00000000..494b3f96 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpDecodingParameters.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpDecodingParameters: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift new file mode 100644 index 00000000..5ff1a31d --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpEncodingParameters: BridgedDictionary { + public convenience init(active: Bool, maxBitrate: UInt32, scaleResolutionDownBy: Double, priority: RTCPriorityType, networkPriority: RTCPriorityType, scalabilityMode: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.active] = active.jsValue() + object[Strings.maxBitrate] = maxBitrate.jsValue() + object[Strings.scaleResolutionDownBy] = scaleResolutionDownBy.jsValue() + object[Strings.priority] = priority.jsValue() + object[Strings.networkPriority] = networkPriority.jsValue() + object[Strings.scalabilityMode] = scalabilityMode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _active = ReadWriteAttribute(jsObject: object, name: Strings.active) + _maxBitrate = ReadWriteAttribute(jsObject: object, name: Strings.maxBitrate) + _scaleResolutionDownBy = ReadWriteAttribute(jsObject: object, name: Strings.scaleResolutionDownBy) + _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) + _networkPriority = ReadWriteAttribute(jsObject: object, name: Strings.networkPriority) + _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var active: Bool + + @ReadWriteAttribute + public var maxBitrate: UInt32 + + @ReadWriteAttribute + public var scaleResolutionDownBy: Double + + @ReadWriteAttribute + public var priority: RTCPriorityType + + @ReadWriteAttribute + public var networkPriority: RTCPriorityType + + @ReadWriteAttribute + public var scalabilityMode: String +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift new file mode 100644 index 00000000..15bbd74d --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpHeaderExtensionCapability: BridgedDictionary { + public convenience init(uri: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.uri] = uri.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _uri = ReadWriteAttribute(jsObject: object, name: Strings.uri) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var uri: String +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift new file mode 100644 index 00000000..f2cff9cd --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpHeaderExtensionParameters: BridgedDictionary { + public convenience init(uri: String, id: UInt16, encrypted: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.uri] = uri.jsValue() + object[Strings.id] = id.jsValue() + object[Strings.encrypted] = encrypted.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _uri = ReadWriteAttribute(jsObject: object, name: Strings.uri) + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _encrypted = ReadWriteAttribute(jsObject: object, name: Strings.encrypted) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var uri: String + + @ReadWriteAttribute + public var id: UInt16 + + @ReadWriteAttribute + public var encrypted: Bool +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpParameters.swift new file mode 100644 index 00000000..ab4f20f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpParameters.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpParameters: BridgedDictionary { + public convenience init(headerExtensions: [RTCRtpHeaderExtensionParameters], rtcp: RTCRtcpParameters, codecs: [RTCRtpCodecParameters]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.headerExtensions] = headerExtensions.jsValue() + object[Strings.rtcp] = rtcp.jsValue() + object[Strings.codecs] = codecs.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _headerExtensions = ReadWriteAttribute(jsObject: object, name: Strings.headerExtensions) + _rtcp = ReadWriteAttribute(jsObject: object, name: Strings.rtcp) + _codecs = ReadWriteAttribute(jsObject: object, name: Strings.codecs) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var headerExtensions: [RTCRtpHeaderExtensionParameters] + + @ReadWriteAttribute + public var rtcp: RTCRtcpParameters + + @ReadWriteAttribute + public var codecs: [RTCRtpCodecParameters] +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpReceiveParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpReceiveParameters.swift new file mode 100644 index 00000000..564f62d6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpReceiveParameters.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpReceiveParameters: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift new file mode 100644 index 00000000..e104bc48 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpReceiver: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpReceiver].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) + _transport = ReadonlyAttribute(jsObject: jsObject, name: Strings.transport) + _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var track: MediaStreamTrack + + @ReadonlyAttribute + public var transport: RTCDtlsTransport? + + public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { + constructor[Strings.getCapabilities]!(kind.jsValue()).fromJSValue()! + } + + public func getParameters() -> RTCRtpReceiveParameters { + jsObject[Strings.getParameters]!().fromJSValue()! + } + + public func getContributingSources() -> [RTCRtpContributingSource] { + jsObject[Strings.getContributingSources]!().fromJSValue()! + } + + public func getSynchronizationSources() -> [RTCRtpSynchronizationSource] { + jsObject[Strings.getSynchronizationSources]!().fromJSValue()! + } + + public func getStats() -> JSPromise { + jsObject[Strings.getStats]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getStats() async throws -> RTCStatsReport { + let _promise: JSPromise = jsObject[Strings.getStats]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadWriteAttribute + public var transform: RTCRtpTransform? +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift new file mode 100644 index 00000000..db93f640 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpScriptTransform: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpScriptTransform].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(worker: Worker, options: JSValue? = nil, transfer: [JSObject]? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(worker.jsValue(), options?.jsValue() ?? .undefined, transfer?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift new file mode 100644 index 00000000..2564474e --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpScriptTransformer: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpScriptTransformer].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) + _options = ReadonlyAttribute(jsObject: jsObject, name: Strings.options) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var readable: ReadableStream + + @ReadonlyAttribute + public var writable: WritableStream + + @ReadonlyAttribute + public var options: JSValue + + public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { + jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func generateKeyFrame(rids: [String]? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func sendKeyFrameRequest() -> JSPromise { + jsObject[Strings.sendKeyFrameRequest]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func sendKeyFrameRequest() async throws { + let _promise: JSPromise = jsObject[Strings.sendKeyFrameRequest]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift new file mode 100644 index 00000000..e89d9da5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpSendParameters: BridgedDictionary { + public convenience init(degradationPreference: RTCDegradationPreference, transactionId: String, encodings: [RTCRtpEncodingParameters]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.degradationPreference] = degradationPreference.jsValue() + object[Strings.transactionId] = transactionId.jsValue() + object[Strings.encodings] = encodings.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _degradationPreference = ReadWriteAttribute(jsObject: object, name: Strings.degradationPreference) + _transactionId = ReadWriteAttribute(jsObject: object, name: Strings.transactionId) + _encodings = ReadWriteAttribute(jsObject: object, name: Strings.encodings) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var degradationPreference: RTCDegradationPreference + + @ReadWriteAttribute + public var transactionId: String + + @ReadWriteAttribute + public var encodings: [RTCRtpEncodingParameters] +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpSender.swift b/Sources/DOMKit/WebIDL/RTCRtpSender.swift new file mode 100644 index 00000000..1f4d8e48 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpSender.swift @@ -0,0 +1,82 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpSender: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpSender].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) + _transport = ReadonlyAttribute(jsObject: jsObject, name: Strings.transport) + _dtmf = ReadonlyAttribute(jsObject: jsObject, name: Strings.dtmf) + _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var track: MediaStreamTrack? + + @ReadonlyAttribute + public var transport: RTCDtlsTransport? + + public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { + constructor[Strings.getCapabilities]!(kind.jsValue()).fromJSValue()! + } + + public func setParameters(parameters: RTCRtpSendParameters) -> JSPromise { + jsObject[Strings.setParameters]!(parameters.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setParameters(parameters: RTCRtpSendParameters) async throws { + let _promise: JSPromise = jsObject[Strings.setParameters]!(parameters.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func getParameters() -> RTCRtpSendParameters { + jsObject[Strings.getParameters]!().fromJSValue()! + } + + public func replaceTrack(withTrack: MediaStreamTrack?) -> JSPromise { + jsObject[Strings.replaceTrack]!(withTrack.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func replaceTrack(withTrack: MediaStreamTrack?) async throws { + let _promise: JSPromise = jsObject[Strings.replaceTrack]!(withTrack.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func setStreams(streams: MediaStream...) { + _ = jsObject[Strings.setStreams]!(streams.jsValue()) + } + + public func getStats() -> JSPromise { + jsObject[Strings.getStats]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getStats() async throws -> RTCStatsReport { + let _promise: JSPromise = jsObject[Strings.getStats]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var dtmf: RTCDTMFSender? + + @ReadWriteAttribute + public var transform: RTCRtpTransform? + + public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { + jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func generateKeyFrame(rids: [String]? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift new file mode 100644 index 00000000..585b65cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpStreamStats: BridgedDictionary { + public convenience init(ssrc: UInt32, kind: String, transportId: String, codecId: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.ssrc] = ssrc.jsValue() + object[Strings.kind] = kind.jsValue() + object[Strings.transportId] = transportId.jsValue() + object[Strings.codecId] = codecId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _ssrc = ReadWriteAttribute(jsObject: object, name: Strings.ssrc) + _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) + _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) + _codecId = ReadWriteAttribute(jsObject: object, name: Strings.codecId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var ssrc: UInt32 + + @ReadWriteAttribute + public var kind: String + + @ReadWriteAttribute + public var transportId: String + + @ReadWriteAttribute + public var codecId: String +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpSynchronizationSource.swift b/Sources/DOMKit/WebIDL/RTCRtpSynchronizationSource.swift new file mode 100644 index 00000000..daa41f00 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpSynchronizationSource.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpSynchronizationSource: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift new file mode 100644 index 00000000..094115e7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpTransceiver: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpTransceiver].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _mid = ReadonlyAttribute(jsObject: jsObject, name: Strings.mid) + _sender = ReadonlyAttribute(jsObject: jsObject, name: Strings.sender) + _receiver = ReadonlyAttribute(jsObject: jsObject, name: Strings.receiver) + _direction = ReadWriteAttribute(jsObject: jsObject, name: Strings.direction) + _currentDirection = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentDirection) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var mid: String? + + @ReadonlyAttribute + public var sender: RTCRtpSender + + @ReadonlyAttribute + public var receiver: RTCRtpReceiver + + @ReadWriteAttribute + public var direction: RTCRtpTransceiverDirection + + @ReadonlyAttribute + public var currentDirection: RTCRtpTransceiverDirection? + + public func stop() { + _ = jsObject[Strings.stop]!() + } + + public func setCodecPreferences(codecs: [RTCRtpCodecCapability]) { + _ = jsObject[Strings.setCodecPreferences]!(codecs.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift new file mode 100644 index 00000000..34f7c804 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCRtpTransceiverDirection: JSString, JSValueCompatible { + case sendrecv = "sendrecv" + case sendonly = "sendonly" + case recvonly = "recvonly" + case inactive = "inactive" + case stopped = "stopped" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift new file mode 100644 index 00000000..62010f76 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpTransceiverInit: BridgedDictionary { + public convenience init(direction: RTCRtpTransceiverDirection, streams: [MediaStream], sendEncodings: [RTCRtpEncodingParameters]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.direction] = direction.jsValue() + object[Strings.streams] = streams.jsValue() + object[Strings.sendEncodings] = sendEncodings.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) + _streams = ReadWriteAttribute(jsObject: object, name: Strings.streams) + _sendEncodings = ReadWriteAttribute(jsObject: object, name: Strings.sendEncodings) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var direction: RTCRtpTransceiverDirection + + @ReadWriteAttribute + public var streams: [MediaStream] + + @ReadWriteAttribute + public var sendEncodings: [RTCRtpEncodingParameters] +} diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift new file mode 100644 index 00000000..edaab7df --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCRtpTransceiverStats: BridgedDictionary { + public convenience init(senderId: String, receiverId: String, mid: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.senderId] = senderId.jsValue() + object[Strings.receiverId] = receiverId.jsValue() + object[Strings.mid] = mid.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _senderId = ReadWriteAttribute(jsObject: object, name: Strings.senderId) + _receiverId = ReadWriteAttribute(jsObject: object, name: Strings.receiverId) + _mid = ReadWriteAttribute(jsObject: object, name: Strings.mid) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var senderId: String + + @ReadWriteAttribute + public var receiverId: String + + @ReadWriteAttribute + public var mid: String +} diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransport.swift b/Sources/DOMKit/WebIDL/RTCSctpTransport.swift new file mode 100644 index 00000000..806c0f9d --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCSctpTransport.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCSctpTransport: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCSctpTransport].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _transport = ReadonlyAttribute(jsObject: jsObject, name: Strings.transport) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _maxMessageSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxMessageSize) + _maxChannels = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxChannels) + _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var transport: RTCDtlsTransport + + @ReadonlyAttribute + public var state: RTCSctpTransportState + + @ReadonlyAttribute + public var maxMessageSize: Double + + @ReadonlyAttribute + public var maxChannels: UInt16? + + @ClosureAttribute.Optional1 + public var onstatechange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift b/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift new file mode 100644 index 00000000..2d7128dc --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCSctpTransportState: JSString, JSValueCompatible { + case connecting = "connecting" + case connected = "connected" + case closed = "closed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift b/Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift new file mode 100644 index 00000000..916ea820 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCSctpTransportStats: BridgedDictionary { + public convenience init(transportId: String, smoothedRoundTripTime: Double, congestionWindow: UInt32, receiverWindow: UInt32, mtu: UInt32, unackData: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.transportId] = transportId.jsValue() + object[Strings.smoothedRoundTripTime] = smoothedRoundTripTime.jsValue() + object[Strings.congestionWindow] = congestionWindow.jsValue() + object[Strings.receiverWindow] = receiverWindow.jsValue() + object[Strings.mtu] = mtu.jsValue() + object[Strings.unackData] = unackData.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) + _smoothedRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.smoothedRoundTripTime) + _congestionWindow = ReadWriteAttribute(jsObject: object, name: Strings.congestionWindow) + _receiverWindow = ReadWriteAttribute(jsObject: object, name: Strings.receiverWindow) + _mtu = ReadWriteAttribute(jsObject: object, name: Strings.mtu) + _unackData = ReadWriteAttribute(jsObject: object, name: Strings.unackData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var transportId: String + + @ReadWriteAttribute + public var smoothedRoundTripTime: Double + + @ReadWriteAttribute + public var congestionWindow: UInt32 + + @ReadWriteAttribute + public var receiverWindow: UInt32 + + @ReadWriteAttribute + public var mtu: UInt32 + + @ReadWriteAttribute + public var unackData: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/RTCSdpType.swift b/Sources/DOMKit/WebIDL/RTCSdpType.swift new file mode 100644 index 00000000..4c9a0ea6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCSdpType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCSdpType: JSString, JSValueCompatible { + case offer = "offer" + case pranswer = "pranswer" + case answer = "answer" + case rollback = "rollback" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift new file mode 100644 index 00000000..3d0232f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCSentRtpStreamStats: BridgedDictionary { + public convenience init(packetsSent: UInt32, bytesSent: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.packetsSent] = packetsSent.jsValue() + object[Strings.bytesSent] = bytesSent.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _packetsSent = ReadWriteAttribute(jsObject: object, name: Strings.packetsSent) + _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var packetsSent: UInt32 + + @ReadWriteAttribute + public var bytesSent: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift new file mode 100644 index 00000000..ed44310c --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCSessionDescription: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCSessionDescription].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _sdp = ReadonlyAttribute(jsObject: jsObject, name: Strings.sdp) + self.jsObject = jsObject + } + + public convenience init(descriptionInitDict: RTCSessionDescriptionInit) { + self.init(unsafelyWrapping: Self.constructor.new(descriptionInitDict.jsValue())) + } + + @ReadonlyAttribute + public var type: RTCSdpType + + @ReadonlyAttribute + public var sdp: String + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift b/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift new file mode 100644 index 00000000..b17c7081 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCSessionDescriptionInit: BridgedDictionary { + public convenience init(type: RTCSdpType, sdp: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.sdp] = sdp.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _sdp = ReadWriteAttribute(jsObject: object, name: Strings.sdp) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: RTCSdpType + + @ReadWriteAttribute + public var sdp: String +} diff --git a/Sources/DOMKit/WebIDL/RTCSignalingState.swift b/Sources/DOMKit/WebIDL/RTCSignalingState.swift new file mode 100644 index 00000000..f909a070 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCSignalingState.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCSignalingState: JSString, JSValueCompatible { + case stable = "stable" + case haveLocalOffer = "have-local-offer" + case haveRemoteOffer = "have-remote-offer" + case haveLocalPranswer = "have-local-pranswer" + case haveRemotePranswer = "have-remote-pranswer" + case closed = "closed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCStats.swift b/Sources/DOMKit/WebIDL/RTCStats.swift new file mode 100644 index 00000000..a0aaedd0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCStats.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCStats: BridgedDictionary { + public convenience init(timestamp: DOMHighResTimeStamp, type: RTCStatsType, id: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.timestamp] = timestamp.jsValue() + object[Strings.type] = type.jsValue() + object[Strings.id] = id.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var timestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var type: RTCStatsType + + @ReadWriteAttribute + public var id: String +} diff --git a/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift b/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift new file mode 100644 index 00000000..20e1ae73 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCStatsIceCandidatePairState: JSString, JSValueCompatible { + case frozen = "frozen" + case waiting = "waiting" + case inProgress = "in-progress" + case failed = "failed" + case succeeded = "succeeded" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCStatsReport.swift b/Sources/DOMKit/WebIDL/RTCStatsReport.swift new file mode 100644 index 00000000..b0dc4758 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCStatsReport.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCStatsReport: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.RTCStatsReport].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Map-like! +} diff --git a/Sources/DOMKit/WebIDL/RTCStatsType.swift b/Sources/DOMKit/WebIDL/RTCStatsType.swift new file mode 100644 index 00000000..1715dbf5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCStatsType.swift @@ -0,0 +1,41 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RTCStatsType: JSString, JSValueCompatible { + case codec = "codec" + case inboundRtp = "inbound-rtp" + case outboundRtp = "outbound-rtp" + case remoteInboundRtp = "remote-inbound-rtp" + case remoteOutboundRtp = "remote-outbound-rtp" + case mediaSource = "media-source" + case csrc = "csrc" + case peerConnection = "peer-connection" + case dataChannel = "data-channel" + case stream = "stream" + case track = "track" + case transceiver = "transceiver" + case sender = "sender" + case receiver = "receiver" + case transport = "transport" + case sctpTransport = "sctp-transport" + case candidatePair = "candidate-pair" + case localCandidate = "local-candidate" + case remoteCandidate = "remote-candidate" + case certificate = "certificate" + case iceServer = "ice-server" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RTCTrackEvent.swift b/Sources/DOMKit/WebIDL/RTCTrackEvent.swift new file mode 100644 index 00000000..04a7c8d5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCTrackEvent.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCTrackEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCTrackEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _receiver = ReadonlyAttribute(jsObject: jsObject, name: Strings.receiver) + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) + _streams = ReadonlyAttribute(jsObject: jsObject, name: Strings.streams) + _transceiver = ReadonlyAttribute(jsObject: jsObject, name: Strings.transceiver) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: RTCTrackEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var receiver: RTCRtpReceiver + + @ReadonlyAttribute + public var track: MediaStreamTrack + + @ReadonlyAttribute + public var streams: [MediaStream] + + @ReadonlyAttribute + public var transceiver: RTCRtpTransceiver +} diff --git a/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift b/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift new file mode 100644 index 00000000..afaedfe2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCTrackEventInit: BridgedDictionary { + public convenience init(receiver: RTCRtpReceiver, track: MediaStreamTrack, streams: [MediaStream], transceiver: RTCRtpTransceiver) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.receiver] = receiver.jsValue() + object[Strings.track] = track.jsValue() + object[Strings.streams] = streams.jsValue() + object[Strings.transceiver] = transceiver.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _receiver = ReadWriteAttribute(jsObject: object, name: Strings.receiver) + _track = ReadWriteAttribute(jsObject: object, name: Strings.track) + _streams = ReadWriteAttribute(jsObject: object, name: Strings.streams) + _transceiver = ReadWriteAttribute(jsObject: object, name: Strings.transceiver) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var receiver: RTCRtpReceiver + + @ReadWriteAttribute + public var track: MediaStreamTrack + + @ReadWriteAttribute + public var streams: [MediaStream] + + @ReadWriteAttribute + public var transceiver: RTCRtpTransceiver +} diff --git a/Sources/DOMKit/WebIDL/RTCTransformEvent.swift b/Sources/DOMKit/WebIDL/RTCTransformEvent.swift new file mode 100644 index 00000000..2f0f6f36 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCTransformEvent.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCTransformEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.RTCTransformEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _transformer = ReadonlyAttribute(jsObject: jsObject, name: Strings.transformer) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var transformer: RTCRtpScriptTransformer +} diff --git a/Sources/DOMKit/WebIDL/RTCTransportStats.swift b/Sources/DOMKit/WebIDL/RTCTransportStats.swift new file mode 100644 index 00000000..3fbab231 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCTransportStats.swift @@ -0,0 +1,100 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCTransportStats: BridgedDictionary { + public convenience init(packetsSent: UInt64, packetsReceived: UInt64, bytesSent: UInt64, bytesReceived: UInt64, rtcpTransportStatsId: String, iceRole: RTCIceRole, iceLocalUsernameFragment: String, dtlsState: RTCDtlsTransportState, iceState: RTCIceTransportState, selectedCandidatePairId: String, localCertificateId: String, remoteCertificateId: String, tlsVersion: String, dtlsCipher: String, srtpCipher: String, tlsGroup: String, selectedCandidatePairChanges: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.packetsSent] = packetsSent.jsValue() + object[Strings.packetsReceived] = packetsReceived.jsValue() + object[Strings.bytesSent] = bytesSent.jsValue() + object[Strings.bytesReceived] = bytesReceived.jsValue() + object[Strings.rtcpTransportStatsId] = rtcpTransportStatsId.jsValue() + object[Strings.iceRole] = iceRole.jsValue() + object[Strings.iceLocalUsernameFragment] = iceLocalUsernameFragment.jsValue() + object[Strings.dtlsState] = dtlsState.jsValue() + object[Strings.iceState] = iceState.jsValue() + object[Strings.selectedCandidatePairId] = selectedCandidatePairId.jsValue() + object[Strings.localCertificateId] = localCertificateId.jsValue() + object[Strings.remoteCertificateId] = remoteCertificateId.jsValue() + object[Strings.tlsVersion] = tlsVersion.jsValue() + object[Strings.dtlsCipher] = dtlsCipher.jsValue() + object[Strings.srtpCipher] = srtpCipher.jsValue() + object[Strings.tlsGroup] = tlsGroup.jsValue() + object[Strings.selectedCandidatePairChanges] = selectedCandidatePairChanges.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _packetsSent = ReadWriteAttribute(jsObject: object, name: Strings.packetsSent) + _packetsReceived = ReadWriteAttribute(jsObject: object, name: Strings.packetsReceived) + _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) + _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) + _rtcpTransportStatsId = ReadWriteAttribute(jsObject: object, name: Strings.rtcpTransportStatsId) + _iceRole = ReadWriteAttribute(jsObject: object, name: Strings.iceRole) + _iceLocalUsernameFragment = ReadWriteAttribute(jsObject: object, name: Strings.iceLocalUsernameFragment) + _dtlsState = ReadWriteAttribute(jsObject: object, name: Strings.dtlsState) + _iceState = ReadWriteAttribute(jsObject: object, name: Strings.iceState) + _selectedCandidatePairId = ReadWriteAttribute(jsObject: object, name: Strings.selectedCandidatePairId) + _localCertificateId = ReadWriteAttribute(jsObject: object, name: Strings.localCertificateId) + _remoteCertificateId = ReadWriteAttribute(jsObject: object, name: Strings.remoteCertificateId) + _tlsVersion = ReadWriteAttribute(jsObject: object, name: Strings.tlsVersion) + _dtlsCipher = ReadWriteAttribute(jsObject: object, name: Strings.dtlsCipher) + _srtpCipher = ReadWriteAttribute(jsObject: object, name: Strings.srtpCipher) + _tlsGroup = ReadWriteAttribute(jsObject: object, name: Strings.tlsGroup) + _selectedCandidatePairChanges = ReadWriteAttribute(jsObject: object, name: Strings.selectedCandidatePairChanges) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var packetsSent: UInt64 + + @ReadWriteAttribute + public var packetsReceived: UInt64 + + @ReadWriteAttribute + public var bytesSent: UInt64 + + @ReadWriteAttribute + public var bytesReceived: UInt64 + + @ReadWriteAttribute + public var rtcpTransportStatsId: String + + @ReadWriteAttribute + public var iceRole: RTCIceRole + + @ReadWriteAttribute + public var iceLocalUsernameFragment: String + + @ReadWriteAttribute + public var dtlsState: RTCDtlsTransportState + + @ReadWriteAttribute + public var iceState: RTCIceTransportState + + @ReadWriteAttribute + public var selectedCandidatePairId: String + + @ReadWriteAttribute + public var localCertificateId: String + + @ReadWriteAttribute + public var remoteCertificateId: String + + @ReadWriteAttribute + public var tlsVersion: String + + @ReadWriteAttribute + public var dtlsCipher: String + + @ReadWriteAttribute + public var srtpCipher: String + + @ReadWriteAttribute + public var tlsGroup: String + + @ReadWriteAttribute + public var selectedCandidatePairChanges: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/RTCVideoHandlerStats.swift b/Sources/DOMKit/WebIDL/RTCVideoHandlerStats.swift new file mode 100644 index 00000000..34b5e39a --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCVideoHandlerStats.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCVideoHandlerStats: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCVideoReceiverStats.swift b/Sources/DOMKit/WebIDL/RTCVideoReceiverStats.swift new file mode 100644 index 00000000..00ad618f --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCVideoReceiverStats.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCVideoReceiverStats: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift b/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift new file mode 100644 index 00000000..d8a5724e --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCVideoSenderStats: BridgedDictionary { + public convenience init(mediaSourceId: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mediaSourceId] = mediaSourceId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mediaSourceId = ReadWriteAttribute(jsObject: object, name: Strings.mediaSourceId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mediaSourceId: String +} diff --git a/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift b/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift new file mode 100644 index 00000000..17a049a0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RTCVideoSourceStats: BridgedDictionary { + public convenience init(width: UInt32, height: UInt32, bitDepth: UInt32, frames: UInt32, framesPerSecond: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.width] = width.jsValue() + object[Strings.height] = height.jsValue() + object[Strings.bitDepth] = bitDepth.jsValue() + object[Strings.frames] = frames.jsValue() + object[Strings.framesPerSecond] = framesPerSecond.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) + _bitDepth = ReadWriteAttribute(jsObject: object, name: Strings.bitDepth) + _frames = ReadWriteAttribute(jsObject: object, name: Strings.frames) + _framesPerSecond = ReadWriteAttribute(jsObject: object, name: Strings.framesPerSecond) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var width: UInt32 + + @ReadWriteAttribute + public var height: UInt32 + + @ReadWriteAttribute + public var bitDepth: UInt32 + + @ReadWriteAttribute + public var frames: UInt32 + + @ReadWriteAttribute + public var framesPerSecond: Double +} diff --git a/Sources/DOMKit/WebIDL/RadioNodeList.swift b/Sources/DOMKit/WebIDL/RadioNodeList.swift index d68c1809..777c20c2 100644 --- a/Sources/DOMKit/WebIDL/RadioNodeList.swift +++ b/Sources/DOMKit/WebIDL/RadioNodeList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RadioNodeList: NodeList { - override public class var constructor: JSFunction { JSObject.global.RadioNodeList.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.RadioNodeList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 863d42f2..aee21fa2 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Range: AbstractRange { - override public class var constructor: JSFunction { JSObject.global.Range.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.Range].function! } public required init(unsafelyWrapping jsObject: JSObject) { _commonAncestorContainer = ReadonlyAttribute(jsObject: jsObject, name: Strings.commonAncestorContainer) @@ -109,4 +109,16 @@ public class Range: AbstractRange { public var description: String { jsObject[Strings.toString]!().fromJSValue()! } + + public func getClientRects() -> DOMRectList { + jsObject[Strings.getClientRects]!().fromJSValue()! + } + + public func getBoundingClientRect() -> DOMRect { + jsObject[Strings.getBoundingClientRect]!().fromJSValue()! + } + + public func createContextualFragment(fragment: String) -> DocumentFragment { + jsObject[Strings.createContextualFragment]!(fragment.jsValue()).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/ReadOptions.swift b/Sources/DOMKit/WebIDL/ReadOptions.swift new file mode 100644 index 00000000..55e68472 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReadOptions: BridgedDictionary { + public convenience init(signal: AbortSignal?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.signal] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var signal: AbortSignal? +} diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift index 7aaccee3..db4f1427 100644 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableByteStreamController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.ReadableByteStreamController.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ReadableByteStreamController].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ReadableStream.swift b/Sources/DOMKit/WebIDL/ReadableStream.swift index d0d0fd09..eb6fdb25 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStream: JSBridgedClass, AsyncSequence { - public class var constructor: JSFunction { JSObject.global.ReadableStream.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ReadableStream].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift index 392a2b5e..4f79cba6 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ReadableStreamBYOBReadResult: BridgedDictionary { public convenience init(value: __UNSUPPORTED_UNION__, done: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.value] = value.jsValue() object[Strings.done] = done.jsValue() self.init(unsafelyWrapping: object) diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift index 291b6171..2fddadd5 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericReader { - public class var constructor: JSFunction { JSObject.global.ReadableStreamBYOBReader.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamBYOBReader].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift index 44adb09a..eade9471 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamBYOBRequest: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.ReadableStreamBYOBRequest.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamBYOBRequest].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift index 9658e5ca..e61f6f58 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamDefaultController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.ReadableStreamDefaultController.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamDefaultController].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift index 4c440ddb..348a0186 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ReadableStreamDefaultReadResult: BridgedDictionary { public convenience init(value: JSValue, done: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.value] = value.jsValue() object[Strings.done] = done.jsValue() self.init(unsafelyWrapping: object) diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift index 680fe760..62bdf83f 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericReader { - public class var constructor: JSFunction { JSObject.global.ReadableStreamDefaultReader.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamDefaultReader].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift index c387b3cd..0c8f5e17 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ReadableStreamGetReaderOptions: BridgedDictionary { public convenience init(mode: ReadableStreamReaderMode) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.mode] = mode.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift index 5dd18f1a..2860743b 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ReadableStreamIteratorOptions: BridgedDictionary { public convenience init(preventCancel: Bool) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.preventCancel] = preventCancel.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift index 5adcd54f..71f36327 100644 --- a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift +++ b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ReadableWritablePair: BridgedDictionary { public convenience init(readable: ReadableStream, writable: WritableStream) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.readable] = readable.jsValue() object[Strings.writable] = writable.jsValue() self.init(unsafelyWrapping: object) diff --git a/Sources/DOMKit/WebIDL/ReadyState.swift b/Sources/DOMKit/WebIDL/ReadyState.swift new file mode 100644 index 00000000..bd5e3fb6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadyState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ReadyState: JSString, JSValueCompatible { + case closed = "closed" + case open = "open" + case ended = "ended" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RecordingState.swift b/Sources/DOMKit/WebIDL/RecordingState.swift new file mode 100644 index 00000000..ac9f91b0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RecordingState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RecordingState: JSString, JSValueCompatible { + case inactive = "inactive" + case recording = "recording" + case paused = "paused" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/RedEyeReduction.swift b/Sources/DOMKit/WebIDL/RedEyeReduction.swift new file mode 100644 index 00000000..fdc3edd5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RedEyeReduction.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RedEyeReduction: JSString, JSValueCompatible { + case never = "never" + case always = "always" + case controllable = "controllable" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Region.swift b/Sources/DOMKit/WebIDL/Region.swift new file mode 100644 index 00000000..0ab9775d --- /dev/null +++ b/Sources/DOMKit/WebIDL/Region.swift @@ -0,0 +1,13 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Region: JSBridgedClass {} +public extension Region { + var regionOverset: String { ReadonlyAttribute[Strings.regionOverset, in: jsObject] } + + func getRegionFlowRanges() -> [Range]? { + jsObject[Strings.getRegionFlowRanges]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/RegistrationOptions.swift b/Sources/DOMKit/WebIDL/RegistrationOptions.swift new file mode 100644 index 00000000..853c81b4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RegistrationOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RegistrationOptions: BridgedDictionary { + public convenience init(scope: String, type: WorkerType, updateViaCache: ServiceWorkerUpdateViaCache) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.scope] = scope.jsValue() + object[Strings.type] = type.jsValue() + object[Strings.updateViaCache] = updateViaCache.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _scope = ReadWriteAttribute(jsObject: object, name: Strings.scope) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _updateViaCache = ReadWriteAttribute(jsObject: object, name: Strings.updateViaCache) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var scope: String + + @ReadWriteAttribute + public var type: WorkerType + + @ReadWriteAttribute + public var updateViaCache: ServiceWorkerUpdateViaCache +} diff --git a/Sources/DOMKit/WebIDL/RelatedApplication.swift b/Sources/DOMKit/WebIDL/RelatedApplication.swift new file mode 100644 index 00000000..f97664b0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RelatedApplication.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RelatedApplication: BridgedDictionary { + public convenience init(platform: String, url: String, id: String, version: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.platform] = platform.jsValue() + object[Strings.url] = url.jsValue() + object[Strings.id] = id.jsValue() + object[Strings.version] = version.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _platform = ReadWriteAttribute(jsObject: object, name: Strings.platform) + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + _version = ReadWriteAttribute(jsObject: object, name: Strings.version) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var platform: String + + @ReadWriteAttribute + public var url: String + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var version: String +} diff --git a/Sources/DOMKit/WebIDL/RelativeOrientationReadingValues.swift b/Sources/DOMKit/WebIDL/RelativeOrientationReadingValues.swift new file mode 100644 index 00000000..e53f1403 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RelativeOrientationReadingValues.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RelativeOrientationReadingValues: BridgedDictionary { + public convenience init() { + let object = JSObject.global[Strings.Object].function!.new() + + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + super.init(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift b/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift new file mode 100644 index 00000000..613b4931 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RelativeOrientationSensor: OrientationSensor { + override public class var constructor: JSFunction { JSObject.global[Strings.RelativeOrientationSensor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(sensorOptions: OrientationSensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/RemotePlayback.swift b/Sources/DOMKit/WebIDL/RemotePlayback.swift new file mode 100644 index 00000000..f865e6e5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RemotePlayback.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RemotePlayback: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.RemotePlayback].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _onconnecting = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnecting) + _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + super.init(unsafelyWrapping: jsObject) + } + + public func watchAvailability(callback: RemotePlaybackAvailabilityCallback) -> JSPromise { + jsObject[Strings.watchAvailability]!(callback.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func watchAvailability(callback: RemotePlaybackAvailabilityCallback) async throws -> Int32 { + let _promise: JSPromise = jsObject[Strings.watchAvailability]!(callback.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func cancelWatchAvailability(id: Int32? = nil) -> JSPromise { + jsObject[Strings.cancelWatchAvailability]!(id?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func cancelWatchAvailability(id: Int32? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.cancelWatchAvailability]!(id?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + @ReadonlyAttribute + public var state: RemotePlaybackState + + @ClosureAttribute.Optional1 + public var onconnecting: EventHandler + + @ClosureAttribute.Optional1 + public var onconnect: EventHandler + + @ClosureAttribute.Optional1 + public var ondisconnect: EventHandler + + public func prompt() -> JSPromise { + jsObject[Strings.prompt]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func prompt() async throws { + let _promise: JSPromise = jsObject[Strings.prompt]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/RemotePlaybackState.swift b/Sources/DOMKit/WebIDL/RemotePlaybackState.swift new file mode 100644 index 00000000..baf8f905 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RemotePlaybackState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum RemotePlaybackState: JSString, JSValueCompatible { + case connecting = "connecting" + case connected = "connected" + case disconnected = "disconnected" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Report.swift b/Sources/DOMKit/WebIDL/Report.swift new file mode 100644 index 00000000..033cf31d --- /dev/null +++ b/Sources/DOMKit/WebIDL/Report.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Report: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Report].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) + self.jsObject = jsObject + } + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + @ReadonlyAttribute + public var type: String + + @ReadonlyAttribute + public var url: String + + @ReadonlyAttribute + public var body: ReportBody? +} diff --git a/Sources/DOMKit/WebIDL/ReportBody.swift b/Sources/DOMKit/WebIDL/ReportBody.swift new file mode 100644 index 00000000..4877c97a --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReportBody.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReportBody: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ReportBody].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ReportingObserver.swift b/Sources/DOMKit/WebIDL/ReportingObserver.swift new file mode 100644 index 00000000..c4cda0aa --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReportingObserver.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReportingObserver: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ReportingObserver].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(callback: ReportingObserverCallback, options: ReportingObserverOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue(), options?.jsValue() ?? .undefined)) + } + + public func observe() { + _ = jsObject[Strings.observe]!() + } + + public func disconnect() { + _ = jsObject[Strings.disconnect]!() + } + + public func takeRecords() -> ReportList { + jsObject[Strings.takeRecords]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift b/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift new file mode 100644 index 00000000..1a4ff9cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ReportingObserverOptions: BridgedDictionary { + public convenience init(types: [String], buffered: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.types] = types.jsValue() + object[Strings.buffered] = buffered.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _types = ReadWriteAttribute(jsObject: object, name: Strings.types) + _buffered = ReadWriteAttribute(jsObject: object, name: Strings.buffered) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var types: [String] + + @ReadWriteAttribute + public var buffered: Bool +} diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift index 8ae70943..a96bed1d 100644 --- a/Sources/DOMKit/WebIDL/Request.swift +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Request: JSBridgedClass, Body { - public class var constructor: JSFunction { JSObject.global.Request.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Request].function! } public let jsObject: JSObject @@ -24,6 +24,7 @@ public class Request: JSBridgedClass, Body { _isReloadNavigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.isReloadNavigation) _isHistoryNavigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.isHistoryNavigation) _signal = ReadonlyAttribute(jsObject: jsObject, name: Strings.signal) + _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) self.jsObject = jsObject } @@ -79,4 +80,7 @@ public class Request: JSBridgedClass, Body { public func clone() -> Self { jsObject[Strings.clone]!().fromJSValue()! } + + @ReadonlyAttribute + public var priority: FetchPriority } diff --git a/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift b/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift new file mode 100644 index 00000000..3e6e7058 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RequestDeviceOptions: BridgedDictionary { + public convenience init(filters: [BluetoothLEScanFilterInit], optionalServices: [BluetoothServiceUUID], optionalManufacturerData: [UInt16], acceptAllDevices: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.filters] = filters.jsValue() + object[Strings.optionalServices] = optionalServices.jsValue() + object[Strings.optionalManufacturerData] = optionalManufacturerData.jsValue() + object[Strings.acceptAllDevices] = acceptAllDevices.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) + _optionalServices = ReadWriteAttribute(jsObject: object, name: Strings.optionalServices) + _optionalManufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.optionalManufacturerData) + _acceptAllDevices = ReadWriteAttribute(jsObject: object, name: Strings.acceptAllDevices) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var filters: [BluetoothLEScanFilterInit] + + @ReadWriteAttribute + public var optionalServices: [BluetoothServiceUUID] + + @ReadWriteAttribute + public var optionalManufacturerData: [UInt16] + + @ReadWriteAttribute + public var acceptAllDevices: Bool +} diff --git a/Sources/DOMKit/WebIDL/RequestInit.swift b/Sources/DOMKit/WebIDL/RequestInit.swift index d7270c36..054f4e39 100644 --- a/Sources/DOMKit/WebIDL/RequestInit.swift +++ b/Sources/DOMKit/WebIDL/RequestInit.swift @@ -4,8 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class RequestInit: BridgedDictionary { - public convenience init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue) { - let object = JSObject.global.Object.function!.new() + public convenience init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue, priority: FetchPriority) { + let object = JSObject.global[Strings.Object].function!.new() object[Strings.method] = method.jsValue() object[Strings.headers] = headers.jsValue() object[Strings.body] = body.jsValue() @@ -19,6 +19,7 @@ public class RequestInit: BridgedDictionary { object[Strings.keepalive] = keepalive.jsValue() object[Strings.signal] = signal.jsValue() object[Strings.window] = window.jsValue() + object[Strings.priority] = priority.jsValue() self.init(unsafelyWrapping: object) } @@ -36,6 +37,7 @@ public class RequestInit: BridgedDictionary { _keepalive = ReadWriteAttribute(jsObject: object, name: Strings.keepalive) _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) _window = ReadWriteAttribute(jsObject: object, name: Strings.window) + _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) super.init(unsafelyWrapping: object) } @@ -77,4 +79,7 @@ public class RequestInit: BridgedDictionary { @ReadWriteAttribute public var window: JSValue + + @ReadWriteAttribute + public var priority: FetchPriority } diff --git a/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift b/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift new file mode 100644 index 00000000..663dedd5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ResidentKeyRequirement: JSString, JSValueCompatible { + case discouraged = "discouraged" + case preferred = "preferred" + case required = "required" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ResizeObserver.swift b/Sources/DOMKit/WebIDL/ResizeObserver.swift new file mode 100644 index 00000000..348c14da --- /dev/null +++ b/Sources/DOMKit/WebIDL/ResizeObserver.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ResizeObserver: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserver].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(callback: ResizeObserverCallback) { + self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue())) + } + + public func observe(target: Element, options: ResizeObserverOptions? = nil) { + _ = jsObject[Strings.observe]!(target.jsValue(), options?.jsValue() ?? .undefined) + } + + public func unobserve(target: Element) { + _ = jsObject[Strings.unobserve]!(target.jsValue()) + } + + public func disconnect() { + _ = jsObject[Strings.disconnect]!() + } +} diff --git a/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift b/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift new file mode 100644 index 00000000..9f918318 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ResizeObserverBoxOptions: JSString, JSValueCompatible { + case borderBox = "border-box" + case contentBox = "content-box" + case devicePixelContentBox = "device-pixel-content-box" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ResizeObserverEntry.swift b/Sources/DOMKit/WebIDL/ResizeObserverEntry.swift new file mode 100644 index 00000000..9d75b067 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ResizeObserverEntry.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ResizeObserverEntry: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserverEntry].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) + _contentRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentRect) + _borderBoxSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.borderBoxSize) + _contentBoxSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentBoxSize) + _devicePixelContentBoxSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePixelContentBoxSize) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var target: Element + + @ReadonlyAttribute + public var contentRect: DOMRectReadOnly + + @ReadonlyAttribute + public var borderBoxSize: [ResizeObserverSize] + + @ReadonlyAttribute + public var contentBoxSize: [ResizeObserverSize] + + @ReadonlyAttribute + public var devicePixelContentBoxSize: [ResizeObserverSize] +} diff --git a/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift b/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift new file mode 100644 index 00000000..c28b64cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ResizeObserverOptions: BridgedDictionary { + public convenience init(box: ResizeObserverBoxOptions) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.box] = box.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _box = ReadWriteAttribute(jsObject: object, name: Strings.box) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var box: ResizeObserverBoxOptions +} diff --git a/Sources/DOMKit/WebIDL/ResizeObserverSize.swift b/Sources/DOMKit/WebIDL/ResizeObserverSize.swift new file mode 100644 index 00000000..95931caa --- /dev/null +++ b/Sources/DOMKit/WebIDL/ResizeObserverSize.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ResizeObserverSize: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserverSize].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _inlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineSize) + _blockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockSize) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var inlineSize: Double + + @ReadonlyAttribute + public var blockSize: Double +} diff --git a/Sources/DOMKit/WebIDL/Response.swift b/Sources/DOMKit/WebIDL/Response.swift index 3e8f04cc..65b9042e 100644 --- a/Sources/DOMKit/WebIDL/Response.swift +++ b/Sources/DOMKit/WebIDL/Response.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Response: JSBridgedClass, Body { - public class var constructor: JSFunction { JSObject.global.Response.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Response].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ResponseInit.swift b/Sources/DOMKit/WebIDL/ResponseInit.swift index 1d543363..1ddc700c 100644 --- a/Sources/DOMKit/WebIDL/ResponseInit.swift +++ b/Sources/DOMKit/WebIDL/ResponseInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ResponseInit: BridgedDictionary { public convenience init(status: UInt16, statusText: String, headers: HeadersInit) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.status] = status.jsValue() object[Strings.statusText] = statusText.jsValue() object[Strings.headers] = headers.jsValue() diff --git a/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift b/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift new file mode 100644 index 00000000..541cf8fd --- /dev/null +++ b/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RsaHashedImportParams: BridgedDictionary { + public convenience init(hash: HashAlgorithmIdentifier) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.hash] = hash.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var hash: HashAlgorithmIdentifier +} diff --git a/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift new file mode 100644 index 00000000..ec8531e9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RsaHashedKeyAlgorithm: BridgedDictionary { + public convenience init(hash: KeyAlgorithm) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.hash] = hash.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var hash: KeyAlgorithm +} diff --git a/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift b/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift new file mode 100644 index 00000000..749e154a --- /dev/null +++ b/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RsaHashedKeyGenParams: BridgedDictionary { + public convenience init(hash: HashAlgorithmIdentifier) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.hash] = hash.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var hash: HashAlgorithmIdentifier +} diff --git a/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift new file mode 100644 index 00000000..52d0203a --- /dev/null +++ b/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RsaKeyAlgorithm: BridgedDictionary { + public convenience init(modulusLength: UInt32, publicExponent: BigInteger) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.modulusLength] = modulusLength.jsValue() + object[Strings.publicExponent] = publicExponent.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _modulusLength = ReadWriteAttribute(jsObject: object, name: Strings.modulusLength) + _publicExponent = ReadWriteAttribute(jsObject: object, name: Strings.publicExponent) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var modulusLength: UInt32 + + @ReadWriteAttribute + public var publicExponent: BigInteger +} diff --git a/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift b/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift new file mode 100644 index 00000000..7984b7fc --- /dev/null +++ b/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RsaKeyGenParams: BridgedDictionary { + public convenience init(modulusLength: UInt32, publicExponent: BigInteger) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.modulusLength] = modulusLength.jsValue() + object[Strings.publicExponent] = publicExponent.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _modulusLength = ReadWriteAttribute(jsObject: object, name: Strings.modulusLength) + _publicExponent = ReadWriteAttribute(jsObject: object, name: Strings.publicExponent) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var modulusLength: UInt32 + + @ReadWriteAttribute + public var publicExponent: BigInteger +} diff --git a/Sources/DOMKit/WebIDL/RsaOaepParams.swift b/Sources/DOMKit/WebIDL/RsaOaepParams.swift new file mode 100644 index 00000000..d6e300bf --- /dev/null +++ b/Sources/DOMKit/WebIDL/RsaOaepParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RsaOaepParams: BridgedDictionary { + public convenience init(label: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.label] = label.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _label = ReadWriteAttribute(jsObject: object, name: Strings.label) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var label: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift b/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift new file mode 100644 index 00000000..720b2eba --- /dev/null +++ b/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RsaOtherPrimesInfo: BridgedDictionary { + public convenience init(r: String, d: String, t: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.r] = r.jsValue() + object[Strings.d] = d.jsValue() + object[Strings.t] = t.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _r = ReadWriteAttribute(jsObject: object, name: Strings.r) + _d = ReadWriteAttribute(jsObject: object, name: Strings.d) + _t = ReadWriteAttribute(jsObject: object, name: Strings.t) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var r: String + + @ReadWriteAttribute + public var d: String + + @ReadWriteAttribute + public var t: String +} diff --git a/Sources/DOMKit/WebIDL/RsaPssParams.swift b/Sources/DOMKit/WebIDL/RsaPssParams.swift new file mode 100644 index 00000000..03270afd --- /dev/null +++ b/Sources/DOMKit/WebIDL/RsaPssParams.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class RsaPssParams: BridgedDictionary { + public convenience init(saltLength: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.saltLength] = saltLength.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _saltLength = ReadWriteAttribute(jsObject: object, name: Strings.saltLength) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var saltLength: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/SFrameTransform.swift b/Sources/DOMKit/WebIDL/SFrameTransform.swift new file mode 100644 index 00000000..fbfa1188 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SFrameTransform.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SFrameTransform: JSBridgedClass, GenericTransformStream { + public class var constructor: JSFunction { JSObject.global[Strings.SFrameTransform].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + self.jsObject = jsObject + } + + public convenience init(options: SFrameTransformOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) -> JSPromise { + jsObject[Strings.setEncryptionKey]!(key.jsValue(), keyID?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.setEncryptionKey]!(key.jsValue(), keyID?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var onerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift new file mode 100644 index 00000000..ff16a18c --- /dev/null +++ b/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SFrameTransformErrorEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.SFrameTransformErrorEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _errorType = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorType) + _keyID = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyID) + _frame = ReadonlyAttribute(jsObject: jsObject, name: Strings.frame) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: SFrameTransformErrorEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var errorType: SFrameTransformErrorEventType + + @ReadonlyAttribute + public var keyID: CryptoKeyID? + + @ReadonlyAttribute + public var frame: JSValue +} diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift new file mode 100644 index 00000000..2c6a40ed --- /dev/null +++ b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SFrameTransformErrorEventInit: BridgedDictionary { + public convenience init(errorType: SFrameTransformErrorEventType, frame: JSValue, keyID: CryptoKeyID?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.errorType] = errorType.jsValue() + object[Strings.frame] = frame.jsValue() + object[Strings.keyID] = keyID.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _errorType = ReadWriteAttribute(jsObject: object, name: Strings.errorType) + _frame = ReadWriteAttribute(jsObject: object, name: Strings.frame) + _keyID = ReadWriteAttribute(jsObject: object, name: Strings.keyID) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var errorType: SFrameTransformErrorEventType + + @ReadWriteAttribute + public var frame: JSValue + + @ReadWriteAttribute + public var keyID: CryptoKeyID? +} diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift new file mode 100644 index 00000000..987f448d --- /dev/null +++ b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum SFrameTransformErrorEventType: JSString, JSValueCompatible { + case authentication = "authentication" + case keyID = "keyID" + case syntax = "syntax" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/SFrameTransformOptions.swift b/Sources/DOMKit/WebIDL/SFrameTransformOptions.swift new file mode 100644 index 00000000..58c613fa --- /dev/null +++ b/Sources/DOMKit/WebIDL/SFrameTransformOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SFrameTransformOptions: BridgedDictionary { + public convenience init(role: SFrameTransformRole) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.role] = role.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _role = ReadWriteAttribute(jsObject: object, name: Strings.role) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var role: SFrameTransformRole +} diff --git a/Sources/DOMKit/WebIDL/SFrameTransformRole.swift b/Sources/DOMKit/WebIDL/SFrameTransformRole.swift new file mode 100644 index 00000000..d05b8e59 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SFrameTransformRole.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum SFrameTransformRole: JSString, JSValueCompatible { + case encrypt = "encrypt" + case decrypt = "decrypt" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/SVGAElement.swift b/Sources/DOMKit/WebIDL/SVGAElement.swift new file mode 100644 index 00000000..a18efa3c --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAElement.swift @@ -0,0 +1,88 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAElement: SVGGraphicsElement, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGAElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) + _download = ReadWriteAttribute(jsObject: jsObject, name: Strings.download) + _ping = ReadWriteAttribute(jsObject: jsObject, name: Strings.ping) + _rel = ReadWriteAttribute(jsObject: jsObject, name: Strings.rel) + _relList = ReadonlyAttribute(jsObject: jsObject, name: Strings.relList) + _hreflang = ReadWriteAttribute(jsObject: jsObject, name: Strings.hreflang) + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) + _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) + _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) + _hash = ReadWriteAttribute(jsObject: jsObject, name: Strings.hash) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var target: SVGAnimatedString + + @ReadWriteAttribute + public var download: String + + @ReadWriteAttribute + public var ping: String + + @ReadWriteAttribute + public var rel: String + + @ReadonlyAttribute + public var relList: DOMTokenList + + @ReadWriteAttribute + public var hreflang: String + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var text: String + + @ReadWriteAttribute + public var referrerPolicy: String + + @ReadonlyAttribute + 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 + + @ReadWriteAttribute + public var hash: String +} diff --git a/Sources/DOMKit/WebIDL/SVGAngle.swift b/Sources/DOMKit/WebIDL/SVGAngle.swift new file mode 100644 index 00000000..6e836548 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAngle.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAngle: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAngle].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _unitType = ReadonlyAttribute(jsObject: jsObject, name: Strings.unitType) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _valueInSpecifiedUnits = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueInSpecifiedUnits) + _valueAsString = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueAsString) + self.jsObject = jsObject + } + + public static let SVG_ANGLETYPE_UNKNOWN: UInt16 = 0 + + public static let SVG_ANGLETYPE_UNSPECIFIED: UInt16 = 1 + + public static let SVG_ANGLETYPE_DEG: UInt16 = 2 + + public static let SVG_ANGLETYPE_RAD: UInt16 = 3 + + public static let SVG_ANGLETYPE_GRAD: UInt16 = 4 + + @ReadonlyAttribute + public var unitType: UInt16 + + @ReadWriteAttribute + public var value: Float + + @ReadWriteAttribute + public var valueInSpecifiedUnits: Float + + @ReadWriteAttribute + public var valueAsString: String + + public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { + _ = jsObject[Strings.newValueSpecifiedUnits]!(unitType.jsValue(), valueInSpecifiedUnits.jsValue()) + } + + public func convertToSpecifiedUnits(unitType: UInt16) { + _ = jsObject[Strings.convertToSpecifiedUnits]!(unitType.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimateElement.swift b/Sources/DOMKit/WebIDL/SVGAnimateElement.swift new file mode 100644 index 00000000..ba63dd1f --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimateElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimateElement: SVGAnimationElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift b/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift new file mode 100644 index 00000000..83bfbc32 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimateMotionElement: SVGAnimationElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateMotionElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift b/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift new file mode 100644 index 00000000..e81c989a --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimateTransformElement: SVGAnimationElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateTransformElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift b/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift new file mode 100644 index 00000000..87b2d9f3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedAngle: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedAngle].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var baseVal: SVGAngle + + @ReadonlyAttribute + public var animVal: SVGAngle +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift b/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift new file mode 100644 index 00000000..98c77d67 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedBoolean: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedBoolean].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var baseVal: Bool + + @ReadonlyAttribute + public var animVal: Bool +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift b/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift new file mode 100644 index 00000000..95a137d5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedEnumeration: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedEnumeration].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var baseVal: UInt16 + + @ReadonlyAttribute + public var animVal: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift b/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift new file mode 100644 index 00000000..242a2d86 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedInteger: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedInteger].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var baseVal: Int32 + + @ReadonlyAttribute + public var animVal: Int32 +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift b/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift new file mode 100644 index 00000000..c654e395 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedLength: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedLength].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var baseVal: SVGLength + + @ReadonlyAttribute + public var animVal: SVGLength +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift b/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift new file mode 100644 index 00000000..d67764f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedLengthList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedLengthList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var baseVal: SVGLengthList + + @ReadonlyAttribute + public var animVal: SVGLengthList +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift b/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift new file mode 100644 index 00000000..856b5e42 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedNumber: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedNumber].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var baseVal: Float + + @ReadonlyAttribute + public var animVal: Float +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift b/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift new file mode 100644 index 00000000..6051fd3c --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedNumberList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedNumberList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var baseVal: SVGNumberList + + @ReadonlyAttribute + public var animVal: SVGNumberList +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift b/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift new file mode 100644 index 00000000..e652dc9d --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift @@ -0,0 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol SVGAnimatedPoints: JSBridgedClass {} +public extension SVGAnimatedPoints { + var points: SVGPointList { ReadonlyAttribute[Strings.points, in: jsObject] } + + var animatedPoints: SVGPointList { ReadonlyAttribute[Strings.animatedPoints, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift b/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift new file mode 100644 index 00000000..da97ac17 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedPreserveAspectRatio: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedPreserveAspectRatio].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var baseVal: SVGPreserveAspectRatio + + @ReadonlyAttribute + public var animVal: SVGPreserveAspectRatio +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift b/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift new file mode 100644 index 00000000..f2ce18de --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedRect: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedRect].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var baseVal: DOMRect + + @ReadonlyAttribute + public var animVal: DOMRectReadOnly +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedString.swift b/Sources/DOMKit/WebIDL/SVGAnimatedString.swift new file mode 100644 index 00000000..6d1730f4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedString.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedString: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedString].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var baseVal: String + + @ReadonlyAttribute + public var animVal: String +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift b/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift new file mode 100644 index 00000000..87d77df2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimatedTransformList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedTransformList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) + _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var baseVal: SVGTransformList + + @ReadonlyAttribute + public var animVal: SVGTransformList +} diff --git a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift new file mode 100644 index 00000000..153eff9b --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift @@ -0,0 +1,56 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGAnimationElement: SVGElement, SVGTests { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimationElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _targetElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetElement) + _onbegin = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbegin) + _onend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onend) + _onrepeat = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrepeat) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var targetElement: SVGElement? + + @ClosureAttribute.Optional1 + public var onbegin: EventHandler + + @ClosureAttribute.Optional1 + public var onend: EventHandler + + @ClosureAttribute.Optional1 + public var onrepeat: EventHandler + + public func getStartTime() -> Float { + jsObject[Strings.getStartTime]!().fromJSValue()! + } + + public func getCurrentTime() -> Float { + jsObject[Strings.getCurrentTime]!().fromJSValue()! + } + + public func getSimpleDuration() -> Float { + jsObject[Strings.getSimpleDuration]!().fromJSValue()! + } + + public func beginElement() { + _ = jsObject[Strings.beginElement]!() + } + + public func beginElementAt(offset: Float) { + _ = jsObject[Strings.beginElementAt]!(offset.jsValue()) + } + + public func endElement() { + _ = jsObject[Strings.endElement]!() + } + + public func endElementAt(offset: Float) { + _ = jsObject[Strings.endElementAt]!(offset.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift b/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift new file mode 100644 index 00000000..87a274ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGBoundingBoxOptions: BridgedDictionary { + public convenience init(fill: Bool, stroke: Bool, markers: Bool, clipped: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.fill] = fill.jsValue() + object[Strings.stroke] = stroke.jsValue() + object[Strings.markers] = markers.jsValue() + object[Strings.clipped] = clipped.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) + _stroke = ReadWriteAttribute(jsObject: object, name: Strings.stroke) + _markers = ReadWriteAttribute(jsObject: object, name: Strings.markers) + _clipped = ReadWriteAttribute(jsObject: object, name: Strings.clipped) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var fill: Bool + + @ReadWriteAttribute + public var stroke: Bool + + @ReadWriteAttribute + public var markers: Bool + + @ReadWriteAttribute + public var clipped: Bool +} diff --git a/Sources/DOMKit/WebIDL/SVGCircleElement.swift b/Sources/DOMKit/WebIDL/SVGCircleElement.swift new file mode 100644 index 00000000..3dfa3cec --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGCircleElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGCircleElement: SVGGeometryElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGCircleElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _cx = ReadonlyAttribute(jsObject: jsObject, name: Strings.cx) + _cy = ReadonlyAttribute(jsObject: jsObject, name: Strings.cy) + _r = ReadonlyAttribute(jsObject: jsObject, name: Strings.r) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var cx: SVGAnimatedLength + + @ReadonlyAttribute + public var cy: SVGAnimatedLength + + @ReadonlyAttribute + public var r: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGClipPathElement.swift b/Sources/DOMKit/WebIDL/SVGClipPathElement.swift new file mode 100644 index 00000000..0834c5a0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGClipPathElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGClipPathElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGClipPathElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _clipPathUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipPathUnits) + _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var clipPathUnits: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var transform: SVGAnimatedTransformList +} diff --git a/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift b/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift new file mode 100644 index 00000000..65fbd1d4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGComponentTransferFunctionElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGComponentTransferFunctionElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _tableValues = ReadonlyAttribute(jsObject: jsObject, name: Strings.tableValues) + _slope = ReadonlyAttribute(jsObject: jsObject, name: Strings.slope) + _intercept = ReadonlyAttribute(jsObject: jsObject, name: Strings.intercept) + _amplitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.amplitude) + _exponent = ReadonlyAttribute(jsObject: jsObject, name: Strings.exponent) + _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: UInt16 = 0 + + public static let SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: UInt16 = 1 + + public static let SVG_FECOMPONENTTRANSFER_TYPE_TABLE: UInt16 = 2 + + public static let SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: UInt16 = 3 + + public static let SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: UInt16 = 4 + + public static let SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: UInt16 = 5 + + @ReadonlyAttribute + public var type: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var tableValues: SVGAnimatedNumberList + + @ReadonlyAttribute + public var slope: SVGAnimatedNumber + + @ReadonlyAttribute + public var intercept: SVGAnimatedNumber + + @ReadonlyAttribute + public var amplitude: SVGAnimatedNumber + + @ReadonlyAttribute + public var exponent: SVGAnimatedNumber + + @ReadonlyAttribute + public var offset: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGDefsElement.swift b/Sources/DOMKit/WebIDL/SVGDefsElement.swift new file mode 100644 index 00000000..d1965c14 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGDefsElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGDefsElement: SVGGraphicsElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGDefsElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGDescElement.swift b/Sources/DOMKit/WebIDL/SVGDescElement.swift new file mode 100644 index 00000000..89b42185 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGDescElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGDescElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGDescElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGDiscardElement.swift b/Sources/DOMKit/WebIDL/SVGDiscardElement.swift new file mode 100644 index 00000000..92c1d8eb --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGDiscardElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGDiscardElement: SVGAnimationElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGDiscardElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGElement.swift b/Sources/DOMKit/WebIDL/SVGElement.swift new file mode 100644 index 00000000..3841869b --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _className = ReadonlyAttribute(jsObject: jsObject, name: Strings.className) + _ownerSVGElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerSVGElement) + _viewportElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.viewportElement) + super.init(unsafelyWrapping: jsObject) + } + + private var _className: ReadonlyAttribute + override public var className: SVGAnimatedString { _className.wrappedValue } + + @ReadonlyAttribute + public var ownerSVGElement: SVGSVGElement? + + @ReadonlyAttribute + public var viewportElement: SVGElement? +} diff --git a/Sources/DOMKit/WebIDL/SVGElementInstance.swift b/Sources/DOMKit/WebIDL/SVGElementInstance.swift new file mode 100644 index 00000000..691aa610 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGElementInstance.swift @@ -0,0 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol SVGElementInstance: JSBridgedClass {} +public extension SVGElementInstance { + var correspondingElement: SVGElement? { ReadonlyAttribute[Strings.correspondingElement, in: jsObject] } + + var correspondingUseElement: SVGUseElement? { ReadonlyAttribute[Strings.correspondingUseElement, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/SVGEllipseElement.swift b/Sources/DOMKit/WebIDL/SVGEllipseElement.swift new file mode 100644 index 00000000..bc2f9342 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGEllipseElement.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGEllipseElement: SVGGeometryElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGEllipseElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _cx = ReadonlyAttribute(jsObject: jsObject, name: Strings.cx) + _cy = ReadonlyAttribute(jsObject: jsObject, name: Strings.cy) + _rx = ReadonlyAttribute(jsObject: jsObject, name: Strings.rx) + _ry = ReadonlyAttribute(jsObject: jsObject, name: Strings.ry) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var cx: SVGAnimatedLength + + @ReadonlyAttribute + public var cy: SVGAnimatedLength + + @ReadonlyAttribute + public var rx: SVGAnimatedLength + + @ReadonlyAttribute + public var ry: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift b/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift new file mode 100644 index 00000000..ae22e455 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEBlendElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEBlendElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _in2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in2) + _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_FEBLEND_MODE_UNKNOWN: UInt16 = 0 + + public static let SVG_FEBLEND_MODE_NORMAL: UInt16 = 1 + + public static let SVG_FEBLEND_MODE_MULTIPLY: UInt16 = 2 + + public static let SVG_FEBLEND_MODE_SCREEN: UInt16 = 3 + + public static let SVG_FEBLEND_MODE_DARKEN: UInt16 = 4 + + public static let SVG_FEBLEND_MODE_LIGHTEN: UInt16 = 5 + + public static let SVG_FEBLEND_MODE_OVERLAY: UInt16 = 6 + + public static let SVG_FEBLEND_MODE_COLOR_DODGE: UInt16 = 7 + + public static let SVG_FEBLEND_MODE_COLOR_BURN: UInt16 = 8 + + public static let SVG_FEBLEND_MODE_HARD_LIGHT: UInt16 = 9 + + public static let SVG_FEBLEND_MODE_SOFT_LIGHT: UInt16 = 10 + + public static let SVG_FEBLEND_MODE_DIFFERENCE: UInt16 = 11 + + public static let SVG_FEBLEND_MODE_EXCLUSION: UInt16 = 12 + + public static let SVG_FEBLEND_MODE_HUE: UInt16 = 13 + + public static let SVG_FEBLEND_MODE_SATURATION: UInt16 = 14 + + public static let SVG_FEBLEND_MODE_COLOR: UInt16 = 15 + + public static let SVG_FEBLEND_MODE_LUMINOSITY: UInt16 = 16 + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var in2: SVGAnimatedString + + @ReadonlyAttribute + public var mode: SVGAnimatedEnumeration +} diff --git a/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift b/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift new file mode 100644 index 00000000..c0b34522 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEColorMatrixElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEColorMatrixElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_FECOLORMATRIX_TYPE_UNKNOWN: UInt16 = 0 + + public static let SVG_FECOLORMATRIX_TYPE_MATRIX: UInt16 = 1 + + public static let SVG_FECOLORMATRIX_TYPE_SATURATE: UInt16 = 2 + + public static let SVG_FECOLORMATRIX_TYPE_HUEROTATE: UInt16 = 3 + + public static let SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: UInt16 = 4 + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var type: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var values: SVGAnimatedNumberList +} diff --git a/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift b/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift new file mode 100644 index 00000000..9052cf0c --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEComponentTransferElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEComponentTransferElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var in1: SVGAnimatedString +} diff --git a/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift b/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift new file mode 100644 index 00000000..47db0142 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFECompositeElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFECompositeElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _in2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in2) + _operator = ReadonlyAttribute(jsObject: jsObject, name: Strings.operator) + _k1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.k1) + _k2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.k2) + _k3 = ReadonlyAttribute(jsObject: jsObject, name: Strings.k3) + _k4 = ReadonlyAttribute(jsObject: jsObject, name: Strings.k4) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_FECOMPOSITE_OPERATOR_UNKNOWN: UInt16 = 0 + + public static let SVG_FECOMPOSITE_OPERATOR_OVER: UInt16 = 1 + + public static let SVG_FECOMPOSITE_OPERATOR_IN: UInt16 = 2 + + public static let SVG_FECOMPOSITE_OPERATOR_OUT: UInt16 = 3 + + public static let SVG_FECOMPOSITE_OPERATOR_ATOP: UInt16 = 4 + + public static let SVG_FECOMPOSITE_OPERATOR_XOR: UInt16 = 5 + + public static let SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: UInt16 = 6 + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var in2: SVGAnimatedString + + @ReadonlyAttribute + public var operator: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var k1: SVGAnimatedNumber + + @ReadonlyAttribute + public var k2: SVGAnimatedNumber + + @ReadonlyAttribute + public var k3: SVGAnimatedNumber + + @ReadonlyAttribute + public var k4: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift b/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift new file mode 100644 index 00000000..babf1ada --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift @@ -0,0 +1,68 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEConvolveMatrixElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEConvolveMatrixElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _orderX = ReadonlyAttribute(jsObject: jsObject, name: Strings.orderX) + _orderY = ReadonlyAttribute(jsObject: jsObject, name: Strings.orderY) + _kernelMatrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelMatrix) + _divisor = ReadonlyAttribute(jsObject: jsObject, name: Strings.divisor) + _bias = ReadonlyAttribute(jsObject: jsObject, name: Strings.bias) + _targetX = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetX) + _targetY = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetY) + _edgeMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.edgeMode) + _kernelUnitLengthX = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthX) + _kernelUnitLengthY = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthY) + _preserveAlpha = ReadonlyAttribute(jsObject: jsObject, name: Strings.preserveAlpha) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_EDGEMODE_UNKNOWN: UInt16 = 0 + + public static let SVG_EDGEMODE_DUPLICATE: UInt16 = 1 + + public static let SVG_EDGEMODE_WRAP: UInt16 = 2 + + public static let SVG_EDGEMODE_NONE: UInt16 = 3 + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var orderX: SVGAnimatedInteger + + @ReadonlyAttribute + public var orderY: SVGAnimatedInteger + + @ReadonlyAttribute + public var kernelMatrix: SVGAnimatedNumberList + + @ReadonlyAttribute + public var divisor: SVGAnimatedNumber + + @ReadonlyAttribute + public var bias: SVGAnimatedNumber + + @ReadonlyAttribute + public var targetX: SVGAnimatedInteger + + @ReadonlyAttribute + public var targetY: SVGAnimatedInteger + + @ReadonlyAttribute + public var edgeMode: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var kernelUnitLengthX: SVGAnimatedNumber + + @ReadonlyAttribute + public var kernelUnitLengthY: SVGAnimatedNumber + + @ReadonlyAttribute + public var preserveAlpha: SVGAnimatedBoolean +} diff --git a/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift b/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift new file mode 100644 index 00000000..da5e2d0c --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEDiffuseLightingElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDiffuseLightingElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _surfaceScale = ReadonlyAttribute(jsObject: jsObject, name: Strings.surfaceScale) + _diffuseConstant = ReadonlyAttribute(jsObject: jsObject, name: Strings.diffuseConstant) + _kernelUnitLengthX = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthX) + _kernelUnitLengthY = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthY) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var surfaceScale: SVGAnimatedNumber + + @ReadonlyAttribute + public var diffuseConstant: SVGAnimatedNumber + + @ReadonlyAttribute + public var kernelUnitLengthX: SVGAnimatedNumber + + @ReadonlyAttribute + public var kernelUnitLengthY: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift b/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift new file mode 100644 index 00000000..efb98fe6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEDisplacementMapElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDisplacementMapElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _in2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in2) + _scale = ReadonlyAttribute(jsObject: jsObject, name: Strings.scale) + _xChannelSelector = ReadonlyAttribute(jsObject: jsObject, name: Strings.xChannelSelector) + _yChannelSelector = ReadonlyAttribute(jsObject: jsObject, name: Strings.yChannelSelector) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_CHANNEL_UNKNOWN: UInt16 = 0 + + public static let SVG_CHANNEL_R: UInt16 = 1 + + public static let SVG_CHANNEL_G: UInt16 = 2 + + public static let SVG_CHANNEL_B: UInt16 = 3 + + public static let SVG_CHANNEL_A: UInt16 = 4 + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var in2: SVGAnimatedString + + @ReadonlyAttribute + public var scale: SVGAnimatedNumber + + @ReadonlyAttribute + public var xChannelSelector: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var yChannelSelector: SVGAnimatedEnumeration +} diff --git a/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift b/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift new file mode 100644 index 00000000..c893fd9f --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEDistantLightElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDistantLightElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _azimuth = ReadonlyAttribute(jsObject: jsObject, name: Strings.azimuth) + _elevation = ReadonlyAttribute(jsObject: jsObject, name: Strings.elevation) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var azimuth: SVGAnimatedNumber + + @ReadonlyAttribute + public var elevation: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift b/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift new file mode 100644 index 00000000..f56e81db --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEDropShadowElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDropShadowElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _dx = ReadonlyAttribute(jsObject: jsObject, name: Strings.dx) + _dy = ReadonlyAttribute(jsObject: jsObject, name: Strings.dy) + _stdDeviationX = ReadonlyAttribute(jsObject: jsObject, name: Strings.stdDeviationX) + _stdDeviationY = ReadonlyAttribute(jsObject: jsObject, name: Strings.stdDeviationY) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var dx: SVGAnimatedNumber + + @ReadonlyAttribute + public var dy: SVGAnimatedNumber + + @ReadonlyAttribute + public var stdDeviationX: SVGAnimatedNumber + + @ReadonlyAttribute + public var stdDeviationY: SVGAnimatedNumber + + public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { + _ = jsObject[Strings.setStdDeviation]!(stdDeviationX.jsValue(), stdDeviationY.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift b/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift new file mode 100644 index 00000000..6af1a2ab --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEFloodElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFloodElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift new file mode 100644 index 00000000..3bf08468 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEFuncAElement: SVGComponentTransferFunctionElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncAElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift new file mode 100644 index 00000000..afebc3a8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEFuncBElement: SVGComponentTransferFunctionElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncBElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift new file mode 100644 index 00000000..2b30b27e --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEFuncGElement: SVGComponentTransferFunctionElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncGElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift new file mode 100644 index 00000000..f2f6ae3a --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEFuncRElement: SVGComponentTransferFunctionElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncRElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift b/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift new file mode 100644 index 00000000..273825a7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEGaussianBlurElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEGaussianBlurElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _stdDeviationX = ReadonlyAttribute(jsObject: jsObject, name: Strings.stdDeviationX) + _stdDeviationY = ReadonlyAttribute(jsObject: jsObject, name: Strings.stdDeviationY) + _edgeMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.edgeMode) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_EDGEMODE_UNKNOWN: UInt16 = 0 + + public static let SVG_EDGEMODE_DUPLICATE: UInt16 = 1 + + public static let SVG_EDGEMODE_WRAP: UInt16 = 2 + + public static let SVG_EDGEMODE_NONE: UInt16 = 3 + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var stdDeviationX: SVGAnimatedNumber + + @ReadonlyAttribute + public var stdDeviationY: SVGAnimatedNumber + + @ReadonlyAttribute + public var edgeMode: SVGAnimatedEnumeration + + public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { + _ = jsObject[Strings.setStdDeviation]!(stdDeviationX.jsValue(), stdDeviationY.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGFEImageElement.swift b/Sources/DOMKit/WebIDL/SVGFEImageElement.swift new file mode 100644 index 00000000..becf588a --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEImageElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEImageElement: SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEImageElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _preserveAspectRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.preserveAspectRatio) + _crossOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.crossOrigin) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var preserveAspectRatio: SVGAnimatedPreserveAspectRatio + + @ReadonlyAttribute + public var crossOrigin: SVGAnimatedString +} diff --git a/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift b/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift new file mode 100644 index 00000000..59fdf83d --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEMergeElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMergeElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift b/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift new file mode 100644 index 00000000..93f6cdac --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEMergeNodeElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMergeNodeElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var in1: SVGAnimatedString +} diff --git a/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift b/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift new file mode 100644 index 00000000..dad229a4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEMorphologyElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMorphologyElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _operator = ReadonlyAttribute(jsObject: jsObject, name: Strings.operator) + _radiusX = ReadonlyAttribute(jsObject: jsObject, name: Strings.radiusX) + _radiusY = ReadonlyAttribute(jsObject: jsObject, name: Strings.radiusY) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_MORPHOLOGY_OPERATOR_UNKNOWN: UInt16 = 0 + + public static let SVG_MORPHOLOGY_OPERATOR_ERODE: UInt16 = 1 + + public static let SVG_MORPHOLOGY_OPERATOR_DILATE: UInt16 = 2 + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var operator: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var radiusX: SVGAnimatedNumber + + @ReadonlyAttribute + public var radiusY: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift b/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift new file mode 100644 index 00000000..81bc9064 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEOffsetElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEOffsetElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _dx = ReadonlyAttribute(jsObject: jsObject, name: Strings.dx) + _dy = ReadonlyAttribute(jsObject: jsObject, name: Strings.dy) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var dx: SVGAnimatedNumber + + @ReadonlyAttribute + public var dy: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift b/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift new file mode 100644 index 00000000..7a2b5f91 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFEPointLightElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEPointLightElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var x: SVGAnimatedNumber + + @ReadonlyAttribute + public var y: SVGAnimatedNumber + + @ReadonlyAttribute + public var z: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift b/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift new file mode 100644 index 00000000..9c0bfef1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFESpecularLightingElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFESpecularLightingElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + _surfaceScale = ReadonlyAttribute(jsObject: jsObject, name: Strings.surfaceScale) + _specularConstant = ReadonlyAttribute(jsObject: jsObject, name: Strings.specularConstant) + _specularExponent = ReadonlyAttribute(jsObject: jsObject, name: Strings.specularExponent) + _kernelUnitLengthX = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthX) + _kernelUnitLengthY = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthY) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var in1: SVGAnimatedString + + @ReadonlyAttribute + public var surfaceScale: SVGAnimatedNumber + + @ReadonlyAttribute + public var specularConstant: SVGAnimatedNumber + + @ReadonlyAttribute + public var specularExponent: SVGAnimatedNumber + + @ReadonlyAttribute + public var kernelUnitLengthX: SVGAnimatedNumber + + @ReadonlyAttribute + public var kernelUnitLengthY: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift b/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift new file mode 100644 index 00000000..756805bd --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFESpotLightElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFESpotLightElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) + _pointsAtX = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointsAtX) + _pointsAtY = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointsAtY) + _pointsAtZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointsAtZ) + _specularExponent = ReadonlyAttribute(jsObject: jsObject, name: Strings.specularExponent) + _limitingConeAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.limitingConeAngle) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var x: SVGAnimatedNumber + + @ReadonlyAttribute + public var y: SVGAnimatedNumber + + @ReadonlyAttribute + public var z: SVGAnimatedNumber + + @ReadonlyAttribute + public var pointsAtX: SVGAnimatedNumber + + @ReadonlyAttribute + public var pointsAtY: SVGAnimatedNumber + + @ReadonlyAttribute + public var pointsAtZ: SVGAnimatedNumber + + @ReadonlyAttribute + public var specularExponent: SVGAnimatedNumber + + @ReadonlyAttribute + public var limitingConeAngle: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGFETileElement.swift b/Sources/DOMKit/WebIDL/SVGFETileElement.swift new file mode 100644 index 00000000..528ad11b --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFETileElement.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFETileElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFETileElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var in1: SVGAnimatedString +} diff --git a/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift b/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift new file mode 100644 index 00000000..4a1c6519 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFETurbulenceElement: SVGElement, SVGFilterPrimitiveStandardAttributes { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFETurbulenceElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _baseFrequencyX = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseFrequencyX) + _baseFrequencyY = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseFrequencyY) + _numOctaves = ReadonlyAttribute(jsObject: jsObject, name: Strings.numOctaves) + _seed = ReadonlyAttribute(jsObject: jsObject, name: Strings.seed) + _stitchTiles = ReadonlyAttribute(jsObject: jsObject, name: Strings.stitchTiles) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_TURBULENCE_TYPE_UNKNOWN: UInt16 = 0 + + public static let SVG_TURBULENCE_TYPE_FRACTALNOISE: UInt16 = 1 + + public static let SVG_TURBULENCE_TYPE_TURBULENCE: UInt16 = 2 + + public static let SVG_STITCHTYPE_UNKNOWN: UInt16 = 0 + + public static let SVG_STITCHTYPE_STITCH: UInt16 = 1 + + public static let SVG_STITCHTYPE_NOSTITCH: UInt16 = 2 + + @ReadonlyAttribute + public var baseFrequencyX: SVGAnimatedNumber + + @ReadonlyAttribute + public var baseFrequencyY: SVGAnimatedNumber + + @ReadonlyAttribute + public var numOctaves: SVGAnimatedInteger + + @ReadonlyAttribute + public var seed: SVGAnimatedNumber + + @ReadonlyAttribute + public var stitchTiles: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var type: SVGAnimatedEnumeration +} diff --git a/Sources/DOMKit/WebIDL/SVGFilterElement.swift b/Sources/DOMKit/WebIDL/SVGFilterElement.swift new file mode 100644 index 00000000..6f1c3a31 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFilterElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGFilterElement: SVGElement, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGFilterElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _filterUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.filterUnits) + _primitiveUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.primitiveUnits) + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var filterUnits: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var primitiveUnits: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var x: SVGAnimatedLength + + @ReadonlyAttribute + public var y: SVGAnimatedLength + + @ReadonlyAttribute + public var width: SVGAnimatedLength + + @ReadonlyAttribute + public var height: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift b/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift new file mode 100644 index 00000000..f7bd5bfb --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift @@ -0,0 +1,17 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol SVGFilterPrimitiveStandardAttributes: JSBridgedClass {} +public extension SVGFilterPrimitiveStandardAttributes { + var x: SVGAnimatedLength { ReadonlyAttribute[Strings.x, in: jsObject] } + + var y: SVGAnimatedLength { ReadonlyAttribute[Strings.y, in: jsObject] } + + var width: SVGAnimatedLength { ReadonlyAttribute[Strings.width, in: jsObject] } + + var height: SVGAnimatedLength { ReadonlyAttribute[Strings.height, in: jsObject] } + + var result: SVGAnimatedString { ReadonlyAttribute[Strings.result, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift b/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift new file mode 100644 index 00000000..eb970826 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift @@ -0,0 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol SVGFitToViewBox: JSBridgedClass {} +public extension SVGFitToViewBox { + var viewBox: SVGAnimatedRect { ReadonlyAttribute[Strings.viewBox, in: jsObject] } + + var preserveAspectRatio: SVGAnimatedPreserveAspectRatio { ReadonlyAttribute[Strings.preserveAspectRatio, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift b/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift new file mode 100644 index 00000000..e351908b --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGForeignObjectElement: SVGGraphicsElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGForeignObjectElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var x: SVGAnimatedLength + + @ReadonlyAttribute + public var y: SVGAnimatedLength + + @ReadonlyAttribute + public var width: SVGAnimatedLength + + @ReadonlyAttribute + public var height: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGGElement.swift b/Sources/DOMKit/WebIDL/SVGGElement.swift new file mode 100644 index 00000000..ef630034 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGGElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGGElement: SVGGraphicsElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGGElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGGeometryElement.swift b/Sources/DOMKit/WebIDL/SVGGeometryElement.swift new file mode 100644 index 00000000..73a55d4f --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGGeometryElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGGeometryElement: SVGGraphicsElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGGeometryElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _pathLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.pathLength) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var pathLength: SVGAnimatedNumber + + public func isPointInFill(point: DOMPointInit? = nil) -> Bool { + jsObject[Strings.isPointInFill]!(point?.jsValue() ?? .undefined).fromJSValue()! + } + + public func isPointInStroke(point: DOMPointInit? = nil) -> Bool { + jsObject[Strings.isPointInStroke]!(point?.jsValue() ?? .undefined).fromJSValue()! + } + + public func getTotalLength() -> Float { + jsObject[Strings.getTotalLength]!().fromJSValue()! + } + + public func getPointAtLength(distance: Float) -> DOMPoint { + jsObject[Strings.getPointAtLength]!(distance.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SVGGradientElement.swift b/Sources/DOMKit/WebIDL/SVGGradientElement.swift new file mode 100644 index 00000000..f12b8d38 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGGradientElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGGradientElement: SVGElement, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGGradientElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _gradientUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.gradientUnits) + _gradientTransform = ReadonlyAttribute(jsObject: jsObject, name: Strings.gradientTransform) + _spreadMethod = ReadonlyAttribute(jsObject: jsObject, name: Strings.spreadMethod) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_SPREADMETHOD_UNKNOWN: UInt16 = 0 + + public static let SVG_SPREADMETHOD_PAD: UInt16 = 1 + + public static let SVG_SPREADMETHOD_REFLECT: UInt16 = 2 + + public static let SVG_SPREADMETHOD_REPEAT: UInt16 = 3 + + @ReadonlyAttribute + public var gradientUnits: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var gradientTransform: SVGAnimatedTransformList + + @ReadonlyAttribute + public var spreadMethod: SVGAnimatedEnumeration +} diff --git a/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift b/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift new file mode 100644 index 00000000..dc9b7601 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGGraphicsElement: SVGElement, SVGTests { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGGraphicsElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var transform: SVGAnimatedTransformList + + public func getBBox(options: SVGBoundingBoxOptions? = nil) -> DOMRect { + jsObject[Strings.getBBox]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func getCTM() -> DOMMatrix? { + jsObject[Strings.getCTM]!().fromJSValue()! + } + + public func getScreenCTM() -> DOMMatrix? { + jsObject[Strings.getScreenCTM]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SVGImageElement.swift b/Sources/DOMKit/WebIDL/SVGImageElement.swift new file mode 100644 index 00000000..a45dea7d --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGImageElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGImageElement: SVGGraphicsElement, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGImageElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _preserveAspectRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.preserveAspectRatio) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Strings.crossOrigin) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var x: SVGAnimatedLength + + @ReadonlyAttribute + public var y: SVGAnimatedLength + + @ReadonlyAttribute + public var width: SVGAnimatedLength + + @ReadonlyAttribute + public var height: SVGAnimatedLength + + @ReadonlyAttribute + public var preserveAspectRatio: SVGAnimatedPreserveAspectRatio + + @ReadWriteAttribute + public var crossOrigin: String? +} diff --git a/Sources/DOMKit/WebIDL/SVGLength.swift b/Sources/DOMKit/WebIDL/SVGLength.swift new file mode 100644 index 00000000..229dfbf9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGLength.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGLength: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGLength].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _unitType = ReadonlyAttribute(jsObject: jsObject, name: Strings.unitType) + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + _valueInSpecifiedUnits = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueInSpecifiedUnits) + _valueAsString = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueAsString) + self.jsObject = jsObject + } + + public static let SVG_LENGTHTYPE_UNKNOWN: UInt16 = 0 + + public static let SVG_LENGTHTYPE_NUMBER: UInt16 = 1 + + public static let SVG_LENGTHTYPE_PERCENTAGE: UInt16 = 2 + + public static let SVG_LENGTHTYPE_EMS: UInt16 = 3 + + public static let SVG_LENGTHTYPE_EXS: UInt16 = 4 + + public static let SVG_LENGTHTYPE_PX: UInt16 = 5 + + public static let SVG_LENGTHTYPE_CM: UInt16 = 6 + + public static let SVG_LENGTHTYPE_MM: UInt16 = 7 + + public static let SVG_LENGTHTYPE_IN: UInt16 = 8 + + public static let SVG_LENGTHTYPE_PT: UInt16 = 9 + + public static let SVG_LENGTHTYPE_PC: UInt16 = 10 + + @ReadonlyAttribute + public var unitType: UInt16 + + @ReadWriteAttribute + public var value: Float + + @ReadWriteAttribute + public var valueInSpecifiedUnits: Float + + @ReadWriteAttribute + public var valueAsString: String + + public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { + _ = jsObject[Strings.newValueSpecifiedUnits]!(unitType.jsValue(), valueInSpecifiedUnits.jsValue()) + } + + public func convertToSpecifiedUnits(unitType: UInt16) { + _ = jsObject[Strings.convertToSpecifiedUnits]!(unitType.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGLengthList.swift b/Sources/DOMKit/WebIDL/SVGLengthList.swift new file mode 100644 index 00000000..9eb5f99a --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGLengthList.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGLengthList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGLengthList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + @ReadonlyAttribute + public var numberOfItems: UInt32 + + public func clear() { + _ = jsObject[Strings.clear]!() + } + + public func initialize(newItem: SVGLength) -> SVGLength { + jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + } + + public subscript(key: Int) -> SVGLength { + jsObject[key].fromJSValue()! + } + + public func insertItemBefore(newItem: SVGLength, index: UInt32) -> SVGLength { + jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func replaceItem(newItem: SVGLength, index: UInt32) -> SVGLength { + jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func removeItem(index: UInt32) -> SVGLength { + jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + } + + public func appendItem(newItem: SVGLength) -> SVGLength { + jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + } + + // XXX: unsupported setter for keys of type UInt32 +} diff --git a/Sources/DOMKit/WebIDL/SVGLineElement.swift b/Sources/DOMKit/WebIDL/SVGLineElement.swift new file mode 100644 index 00000000..26d302cc --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGLineElement.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGLineElement: SVGGeometryElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGLineElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x1) + _y1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.y1) + _x2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x2) + _y2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.y2) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var x1: SVGAnimatedLength + + @ReadonlyAttribute + public var y1: SVGAnimatedLength + + @ReadonlyAttribute + public var x2: SVGAnimatedLength + + @ReadonlyAttribute + public var y2: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift b/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift new file mode 100644 index 00000000..6a970f06 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGLinearGradientElement: SVGGradientElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGLinearGradientElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x1) + _y1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.y1) + _x2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x2) + _y2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.y2) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var x1: SVGAnimatedLength + + @ReadonlyAttribute + public var y1: SVGAnimatedLength + + @ReadonlyAttribute + public var x2: SVGAnimatedLength + + @ReadonlyAttribute + public var y2: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGMPathElement.swift b/Sources/DOMKit/WebIDL/SVGMPathElement.swift new file mode 100644 index 00000000..71889f06 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGMPathElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGMPathElement: SVGElement, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGMPathElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGMarkerElement.swift b/Sources/DOMKit/WebIDL/SVGMarkerElement.swift new file mode 100644 index 00000000..7aeb4652 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGMarkerElement.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGMarkerElement: SVGElement, SVGFitToViewBox { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGMarkerElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _refX = ReadonlyAttribute(jsObject: jsObject, name: Strings.refX) + _refY = ReadonlyAttribute(jsObject: jsObject, name: Strings.refY) + _markerUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.markerUnits) + _markerWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.markerWidth) + _markerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.markerHeight) + _orientType = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientType) + _orientAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientAngle) + _orient = ReadWriteAttribute(jsObject: jsObject, name: Strings.orient) + super.init(unsafelyWrapping: jsObject) + } + + public static let SVG_MARKERUNITS_UNKNOWN: UInt16 = 0 + + public static let SVG_MARKERUNITS_USERSPACEONUSE: UInt16 = 1 + + public static let SVG_MARKERUNITS_STROKEWIDTH: UInt16 = 2 + + public static let SVG_MARKER_ORIENT_UNKNOWN: UInt16 = 0 + + public static let SVG_MARKER_ORIENT_AUTO: UInt16 = 1 + + public static let SVG_MARKER_ORIENT_ANGLE: UInt16 = 2 + + @ReadonlyAttribute + public var refX: SVGAnimatedLength + + @ReadonlyAttribute + public var refY: SVGAnimatedLength + + @ReadonlyAttribute + public var markerUnits: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var markerWidth: SVGAnimatedLength + + @ReadonlyAttribute + public var markerHeight: SVGAnimatedLength + + @ReadonlyAttribute + public var orientType: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var orientAngle: SVGAnimatedAngle + + @ReadWriteAttribute + public var orient: String + + public func setOrientToAuto() { + _ = jsObject[Strings.setOrientToAuto]!() + } + + public func setOrientToAngle(angle: SVGAngle) { + _ = jsObject[Strings.setOrientToAngle]!(angle.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGMaskElement.swift b/Sources/DOMKit/WebIDL/SVGMaskElement.swift new file mode 100644 index 00000000..2dc4e79b --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGMaskElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGMaskElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGMaskElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _maskUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.maskUnits) + _maskContentUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.maskContentUnits) + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var maskUnits: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var maskContentUnits: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var x: SVGAnimatedLength + + @ReadonlyAttribute + public var y: SVGAnimatedLength + + @ReadonlyAttribute + public var width: SVGAnimatedLength + + @ReadonlyAttribute + public var height: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGMetadataElement.swift b/Sources/DOMKit/WebIDL/SVGMetadataElement.swift new file mode 100644 index 00000000..575f43d0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGMetadataElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGMetadataElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGMetadataElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGNumber.swift b/Sources/DOMKit/WebIDL/SVGNumber.swift new file mode 100644 index 00000000..129e062d --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGNumber.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGNumber: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGNumber].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var value: Float +} diff --git a/Sources/DOMKit/WebIDL/SVGNumberList.swift b/Sources/DOMKit/WebIDL/SVGNumberList.swift new file mode 100644 index 00000000..1a71a562 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGNumberList.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGNumberList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGNumberList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + @ReadonlyAttribute + public var numberOfItems: UInt32 + + public func clear() { + _ = jsObject[Strings.clear]!() + } + + public func initialize(newItem: SVGNumber) -> SVGNumber { + jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + } + + public subscript(key: Int) -> SVGNumber { + jsObject[key].fromJSValue()! + } + + public func insertItemBefore(newItem: SVGNumber, index: UInt32) -> SVGNumber { + jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func replaceItem(newItem: SVGNumber, index: UInt32) -> SVGNumber { + jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func removeItem(index: UInt32) -> SVGNumber { + jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + } + + public func appendItem(newItem: SVGNumber) -> SVGNumber { + jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + } + + // XXX: unsupported setter for keys of type UInt32 +} diff --git a/Sources/DOMKit/WebIDL/SVGPathElement.swift b/Sources/DOMKit/WebIDL/SVGPathElement.swift new file mode 100644 index 00000000..38bd115a --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGPathElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGPathElement: SVGGeometryElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGPathElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGPatternElement.swift b/Sources/DOMKit/WebIDL/SVGPatternElement.swift new file mode 100644 index 00000000..4fe8573f --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGPatternElement.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGPatternElement: SVGElement, SVGFitToViewBox, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGPatternElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _patternUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.patternUnits) + _patternContentUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.patternContentUnits) + _patternTransform = ReadonlyAttribute(jsObject: jsObject, name: Strings.patternTransform) + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var patternUnits: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var patternContentUnits: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var patternTransform: SVGAnimatedTransformList + + @ReadonlyAttribute + public var x: SVGAnimatedLength + + @ReadonlyAttribute + public var y: SVGAnimatedLength + + @ReadonlyAttribute + public var width: SVGAnimatedLength + + @ReadonlyAttribute + public var height: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGPointList.swift b/Sources/DOMKit/WebIDL/SVGPointList.swift new file mode 100644 index 00000000..783a92f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGPointList.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGPointList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGPointList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + @ReadonlyAttribute + public var numberOfItems: UInt32 + + public func clear() { + _ = jsObject[Strings.clear]!() + } + + public func initialize(newItem: DOMPoint) -> DOMPoint { + jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + } + + public subscript(key: Int) -> DOMPoint { + jsObject[key].fromJSValue()! + } + + public func insertItemBefore(newItem: DOMPoint, index: UInt32) -> DOMPoint { + jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func replaceItem(newItem: DOMPoint, index: UInt32) -> DOMPoint { + jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func removeItem(index: UInt32) -> DOMPoint { + jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + } + + public func appendItem(newItem: DOMPoint) -> DOMPoint { + jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + } + + // XXX: unsupported setter for keys of type UInt32 +} diff --git a/Sources/DOMKit/WebIDL/SVGPolygonElement.swift b/Sources/DOMKit/WebIDL/SVGPolygonElement.swift new file mode 100644 index 00000000..ebc02247 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGPolygonElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGPolygonElement: SVGGeometryElement, SVGAnimatedPoints { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGPolygonElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGPolylineElement.swift b/Sources/DOMKit/WebIDL/SVGPolylineElement.swift new file mode 100644 index 00000000..23d6b323 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGPolylineElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGPolylineElement: SVGGeometryElement, SVGAnimatedPoints { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGPolylineElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift b/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift new file mode 100644 index 00000000..347b9a4c --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGPreserveAspectRatio: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGPreserveAspectRatio].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _meetOrSlice = ReadWriteAttribute(jsObject: jsObject, name: Strings.meetOrSlice) + self.jsObject = jsObject + } + + public static let SVG_PRESERVEASPECTRATIO_UNKNOWN: UInt16 = 0 + + public static let SVG_PRESERVEASPECTRATIO_NONE: UInt16 = 1 + + public static let SVG_PRESERVEASPECTRATIO_XMINYMIN: UInt16 = 2 + + public static let SVG_PRESERVEASPECTRATIO_XMIDYMIN: UInt16 = 3 + + public static let SVG_PRESERVEASPECTRATIO_XMAXYMIN: UInt16 = 4 + + public static let SVG_PRESERVEASPECTRATIO_XMINYMID: UInt16 = 5 + + public static let SVG_PRESERVEASPECTRATIO_XMIDYMID: UInt16 = 6 + + public static let SVG_PRESERVEASPECTRATIO_XMAXYMID: UInt16 = 7 + + public static let SVG_PRESERVEASPECTRATIO_XMINYMAX: UInt16 = 8 + + public static let SVG_PRESERVEASPECTRATIO_XMIDYMAX: UInt16 = 9 + + public static let SVG_PRESERVEASPECTRATIO_XMAXYMAX: UInt16 = 10 + + public static let SVG_MEETORSLICE_UNKNOWN: UInt16 = 0 + + public static let SVG_MEETORSLICE_MEET: UInt16 = 1 + + public static let SVG_MEETORSLICE_SLICE: UInt16 = 2 + + @ReadWriteAttribute + public var align: UInt16 + + @ReadWriteAttribute + public var meetOrSlice: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift b/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift new file mode 100644 index 00000000..66e6c3a4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGRadialGradientElement: SVGGradientElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGRadialGradientElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _cx = ReadonlyAttribute(jsObject: jsObject, name: Strings.cx) + _cy = ReadonlyAttribute(jsObject: jsObject, name: Strings.cy) + _r = ReadonlyAttribute(jsObject: jsObject, name: Strings.r) + _fx = ReadonlyAttribute(jsObject: jsObject, name: Strings.fx) + _fy = ReadonlyAttribute(jsObject: jsObject, name: Strings.fy) + _fr = ReadonlyAttribute(jsObject: jsObject, name: Strings.fr) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var cx: SVGAnimatedLength + + @ReadonlyAttribute + public var cy: SVGAnimatedLength + + @ReadonlyAttribute + public var r: SVGAnimatedLength + + @ReadonlyAttribute + public var fx: SVGAnimatedLength + + @ReadonlyAttribute + public var fy: SVGAnimatedLength + + @ReadonlyAttribute + public var fr: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGRectElement.swift b/Sources/DOMKit/WebIDL/SVGRectElement.swift new file mode 100644 index 00000000..1e0fbc73 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGRectElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGRectElement: SVGGeometryElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGRectElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _rx = ReadonlyAttribute(jsObject: jsObject, name: Strings.rx) + _ry = ReadonlyAttribute(jsObject: jsObject, name: Strings.ry) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var x: SVGAnimatedLength + + @ReadonlyAttribute + public var y: SVGAnimatedLength + + @ReadonlyAttribute + public var width: SVGAnimatedLength + + @ReadonlyAttribute + public var height: SVGAnimatedLength + + @ReadonlyAttribute + public var rx: SVGAnimatedLength + + @ReadonlyAttribute + public var ry: SVGAnimatedLength +} diff --git a/Sources/DOMKit/WebIDL/SVGSVGElement.swift b/Sources/DOMKit/WebIDL/SVGSVGElement.swift new file mode 100644 index 00000000..7783b4fd --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGSVGElement.swift @@ -0,0 +1,128 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHandlers { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGSVGElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _currentScale = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentScale) + _currentTranslate = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTranslate) + super.init(unsafelyWrapping: jsObject) + } + + public func pauseAnimations() { + _ = jsObject[Strings.pauseAnimations]!() + } + + public func unpauseAnimations() { + _ = jsObject[Strings.unpauseAnimations]!() + } + + public func animationsPaused() -> Bool { + jsObject[Strings.animationsPaused]!().fromJSValue()! + } + + public func getCurrentTime() -> Float { + jsObject[Strings.getCurrentTime]!().fromJSValue()! + } + + public func setCurrentTime(seconds: Float) { + _ = jsObject[Strings.setCurrentTime]!(seconds.jsValue()) + } + + @ReadonlyAttribute + public var x: SVGAnimatedLength + + @ReadonlyAttribute + public var y: SVGAnimatedLength + + @ReadonlyAttribute + public var width: SVGAnimatedLength + + @ReadonlyAttribute + public var height: SVGAnimatedLength + + @ReadWriteAttribute + public var currentScale: Float + + @ReadonlyAttribute + public var currentTranslate: DOMPointReadOnly + + public func getIntersectionList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { + jsObject[Strings.getIntersectionList]!(rect.jsValue(), referenceElement.jsValue()).fromJSValue()! + } + + public func getEnclosureList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { + jsObject[Strings.getEnclosureList]!(rect.jsValue(), referenceElement.jsValue()).fromJSValue()! + } + + public func checkIntersection(element: SVGElement, rect: DOMRectReadOnly) -> Bool { + jsObject[Strings.checkIntersection]!(element.jsValue(), rect.jsValue()).fromJSValue()! + } + + public func checkEnclosure(element: SVGElement, rect: DOMRectReadOnly) -> Bool { + jsObject[Strings.checkEnclosure]!(element.jsValue(), rect.jsValue()).fromJSValue()! + } + + public func deselectAll() { + _ = jsObject[Strings.deselectAll]!() + } + + public func createSVGNumber() -> SVGNumber { + jsObject[Strings.createSVGNumber]!().fromJSValue()! + } + + public func createSVGLength() -> SVGLength { + jsObject[Strings.createSVGLength]!().fromJSValue()! + } + + public func createSVGAngle() -> SVGAngle { + jsObject[Strings.createSVGAngle]!().fromJSValue()! + } + + public func createSVGPoint() -> DOMPoint { + jsObject[Strings.createSVGPoint]!().fromJSValue()! + } + + public func createSVGMatrix() -> DOMMatrix { + jsObject[Strings.createSVGMatrix]!().fromJSValue()! + } + + public func createSVGRect() -> DOMRect { + jsObject[Strings.createSVGRect]!().fromJSValue()! + } + + public func createSVGTransform() -> SVGTransform { + jsObject[Strings.createSVGTransform]!().fromJSValue()! + } + + public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { + jsObject[Strings.createSVGTransformFromMatrix]!(matrix?.jsValue() ?? .undefined).fromJSValue()! + } + + public func getElementById(elementId: String) -> Element { + jsObject[Strings.getElementById]!(elementId.jsValue()).fromJSValue()! + } + + public func suspendRedraw(maxWaitMilliseconds: UInt32) -> UInt32 { + jsObject[Strings.suspendRedraw]!(maxWaitMilliseconds.jsValue()).fromJSValue()! + } + + public func unsuspendRedraw(suspendHandleID: UInt32) { + _ = jsObject[Strings.unsuspendRedraw]!(suspendHandleID.jsValue()) + } + + public func unsuspendRedrawAll() { + _ = jsObject[Strings.unsuspendRedrawAll]!() + } + + public func forceRedraw() { + _ = jsObject[Strings.forceRedraw]!() + } +} diff --git a/Sources/DOMKit/WebIDL/SVGScriptElement.swift b/Sources/DOMKit/WebIDL/SVGScriptElement.swift new file mode 100644 index 00000000..e53ed4ec --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGScriptElement.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGScriptElement: SVGElement, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGScriptElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Strings.crossOrigin) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var crossOrigin: String? +} diff --git a/Sources/DOMKit/WebIDL/SVGSetElement.swift b/Sources/DOMKit/WebIDL/SVGSetElement.swift new file mode 100644 index 00000000..08b215da --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGSetElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGSetElement: SVGAnimationElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGSetElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGStopElement.swift b/Sources/DOMKit/WebIDL/SVGStopElement.swift new file mode 100644 index 00000000..51cf8868 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGStopElement.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGStopElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGStopElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var offset: SVGAnimatedNumber +} diff --git a/Sources/DOMKit/WebIDL/SVGStringList.swift b/Sources/DOMKit/WebIDL/SVGStringList.swift new file mode 100644 index 00000000..27ddd147 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGStringList.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGStringList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGStringList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + @ReadonlyAttribute + public var numberOfItems: UInt32 + + public func clear() { + _ = jsObject[Strings.clear]!() + } + + public func initialize(newItem: String) -> String { + jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + } + + public subscript(key: Int) -> String { + jsObject[key].fromJSValue()! + } + + public func insertItemBefore(newItem: String, index: UInt32) -> String { + jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func replaceItem(newItem: String, index: UInt32) -> String { + jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func removeItem(index: UInt32) -> String { + jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + } + + public func appendItem(newItem: String) -> String { + jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + } + + // XXX: unsupported setter for keys of type UInt32 +} diff --git a/Sources/DOMKit/WebIDL/SVGStyleElement.swift b/Sources/DOMKit/WebIDL/SVGStyleElement.swift new file mode 100644 index 00000000..079041e5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGStyleElement.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGStyleElement: SVGElement, LinkStyle { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGStyleElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) + _media = ReadWriteAttribute(jsObject: jsObject, name: Strings.media) + _title = ReadWriteAttribute(jsObject: jsObject, name: Strings.title) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var media: String + + @ReadWriteAttribute + public var title: String +} diff --git a/Sources/DOMKit/WebIDL/SVGSwitchElement.swift b/Sources/DOMKit/WebIDL/SVGSwitchElement.swift new file mode 100644 index 00000000..037d4c95 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGSwitchElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGSwitchElement: SVGGraphicsElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGSwitchElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGSymbolElement.swift b/Sources/DOMKit/WebIDL/SVGSymbolElement.swift new file mode 100644 index 00000000..94e45c51 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGSymbolElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGSymbolElement: SVGGraphicsElement, SVGFitToViewBox { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGSymbolElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGTSpanElement.swift b/Sources/DOMKit/WebIDL/SVGTSpanElement.swift new file mode 100644 index 00000000..5068cf19 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGTSpanElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGTSpanElement: SVGTextPositioningElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGTSpanElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGTests.swift b/Sources/DOMKit/WebIDL/SVGTests.swift new file mode 100644 index 00000000..4a235197 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGTests.swift @@ -0,0 +1,11 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol SVGTests: JSBridgedClass {} +public extension SVGTests { + var requiredExtensions: SVGStringList { ReadonlyAttribute[Strings.requiredExtensions, in: jsObject] } + + var systemLanguage: SVGStringList { ReadonlyAttribute[Strings.systemLanguage, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/SVGTextContentElement.swift b/Sources/DOMKit/WebIDL/SVGTextContentElement.swift new file mode 100644 index 00000000..68917e2c --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGTextContentElement.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGTextContentElement: SVGGraphicsElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextContentElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _textLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.textLength) + _lengthAdjust = ReadonlyAttribute(jsObject: jsObject, name: Strings.lengthAdjust) + super.init(unsafelyWrapping: jsObject) + } + + public static let LENGTHADJUST_UNKNOWN: UInt16 = 0 + + public static let LENGTHADJUST_SPACING: UInt16 = 1 + + public static let LENGTHADJUST_SPACINGANDGLYPHS: UInt16 = 2 + + @ReadonlyAttribute + public var textLength: SVGAnimatedLength + + @ReadonlyAttribute + public var lengthAdjust: SVGAnimatedEnumeration + + public func getNumberOfChars() -> Int32 { + jsObject[Strings.getNumberOfChars]!().fromJSValue()! + } + + public func getComputedTextLength() -> Float { + jsObject[Strings.getComputedTextLength]!().fromJSValue()! + } + + public func getSubStringLength(charnum: UInt32, nchars: UInt32) -> Float { + jsObject[Strings.getSubStringLength]!(charnum.jsValue(), nchars.jsValue()).fromJSValue()! + } + + public func getStartPositionOfChar(charnum: UInt32) -> DOMPoint { + jsObject[Strings.getStartPositionOfChar]!(charnum.jsValue()).fromJSValue()! + } + + public func getEndPositionOfChar(charnum: UInt32) -> DOMPoint { + jsObject[Strings.getEndPositionOfChar]!(charnum.jsValue()).fromJSValue()! + } + + public func getExtentOfChar(charnum: UInt32) -> DOMRect { + jsObject[Strings.getExtentOfChar]!(charnum.jsValue()).fromJSValue()! + } + + public func getRotationOfChar(charnum: UInt32) -> Float { + jsObject[Strings.getRotationOfChar]!(charnum.jsValue()).fromJSValue()! + } + + public func getCharNumAtPosition(point: DOMPointInit? = nil) -> Int32 { + jsObject[Strings.getCharNumAtPosition]!(point?.jsValue() ?? .undefined).fromJSValue()! + } + + public func selectSubString(charnum: UInt32, nchars: UInt32) { + _ = jsObject[Strings.selectSubString]!(charnum.jsValue(), nchars.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGTextElement.swift b/Sources/DOMKit/WebIDL/SVGTextElement.swift new file mode 100644 index 00000000..bc5646c8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGTextElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGTextElement: SVGTextPositioningElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGTextPathElement.swift b/Sources/DOMKit/WebIDL/SVGTextPathElement.swift new file mode 100644 index 00000000..eb00b3f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGTextPathElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGTextPathElement: SVGTextContentElement, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextPathElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _startOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.startOffset) + _method = ReadonlyAttribute(jsObject: jsObject, name: Strings.method) + _spacing = ReadonlyAttribute(jsObject: jsObject, name: Strings.spacing) + super.init(unsafelyWrapping: jsObject) + } + + public static let TEXTPATH_METHODTYPE_UNKNOWN: UInt16 = 0 + + public static let TEXTPATH_METHODTYPE_ALIGN: UInt16 = 1 + + public static let TEXTPATH_METHODTYPE_STRETCH: UInt16 = 2 + + public static let TEXTPATH_SPACINGTYPE_UNKNOWN: UInt16 = 0 + + public static let TEXTPATH_SPACINGTYPE_AUTO: UInt16 = 1 + + public static let TEXTPATH_SPACINGTYPE_EXACT: UInt16 = 2 + + @ReadonlyAttribute + public var startOffset: SVGAnimatedLength + + @ReadonlyAttribute + public var method: SVGAnimatedEnumeration + + @ReadonlyAttribute + public var spacing: SVGAnimatedEnumeration +} diff --git a/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift b/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift new file mode 100644 index 00000000..fdd87072 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGTextPositioningElement: SVGTextContentElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextPositioningElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _dx = ReadonlyAttribute(jsObject: jsObject, name: Strings.dx) + _dy = ReadonlyAttribute(jsObject: jsObject, name: Strings.dy) + _rotate = ReadonlyAttribute(jsObject: jsObject, name: Strings.rotate) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var x: SVGAnimatedLengthList + + @ReadonlyAttribute + public var y: SVGAnimatedLengthList + + @ReadonlyAttribute + public var dx: SVGAnimatedLengthList + + @ReadonlyAttribute + public var dy: SVGAnimatedLengthList + + @ReadonlyAttribute + public var rotate: SVGAnimatedNumberList +} diff --git a/Sources/DOMKit/WebIDL/SVGTitleElement.swift b/Sources/DOMKit/WebIDL/SVGTitleElement.swift new file mode 100644 index 00000000..716e750f --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGTitleElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGTitleElement: SVGElement { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGTitleElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGTransform.swift b/Sources/DOMKit/WebIDL/SVGTransform.swift new file mode 100644 index 00000000..fa30e5e1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGTransform.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGTransform: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGTransform].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _matrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.matrix) + _angle = ReadonlyAttribute(jsObject: jsObject, name: Strings.angle) + self.jsObject = jsObject + } + + public static let SVG_TRANSFORM_UNKNOWN: UInt16 = 0 + + public static let SVG_TRANSFORM_MATRIX: UInt16 = 1 + + public static let SVG_TRANSFORM_TRANSLATE: UInt16 = 2 + + public static let SVG_TRANSFORM_SCALE: UInt16 = 3 + + public static let SVG_TRANSFORM_ROTATE: UInt16 = 4 + + public static let SVG_TRANSFORM_SKEWX: UInt16 = 5 + + public static let SVG_TRANSFORM_SKEWY: UInt16 = 6 + + @ReadonlyAttribute + public var type: UInt16 + + @ReadonlyAttribute + public var matrix: DOMMatrix + + @ReadonlyAttribute + public var angle: Float + + public func setMatrix(matrix: DOMMatrix2DInit? = nil) { + _ = jsObject[Strings.setMatrix]!(matrix?.jsValue() ?? .undefined) + } + + public func setTranslate(tx: Float, ty: Float) { + _ = jsObject[Strings.setTranslate]!(tx.jsValue(), ty.jsValue()) + } + + public func setScale(sx: Float, sy: Float) { + _ = jsObject[Strings.setScale]!(sx.jsValue(), sy.jsValue()) + } + + public func setRotate(angle: Float, cx: Float, cy: Float) { + _ = jsObject[Strings.setRotate]!(angle.jsValue(), cx.jsValue(), cy.jsValue()) + } + + public func setSkewX(angle: Float) { + _ = jsObject[Strings.setSkewX]!(angle.jsValue()) + } + + public func setSkewY(angle: Float) { + _ = jsObject[Strings.setSkewY]!(angle.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGTransformList.swift b/Sources/DOMKit/WebIDL/SVGTransformList.swift new file mode 100644 index 00000000..d47c8102 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGTransformList.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGTransformList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGTransformList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + @ReadonlyAttribute + public var numberOfItems: UInt32 + + public func clear() { + _ = jsObject[Strings.clear]!() + } + + public func initialize(newItem: SVGTransform) -> SVGTransform { + jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + } + + public subscript(key: Int) -> SVGTransform { + jsObject[key].fromJSValue()! + } + + public func insertItemBefore(newItem: SVGTransform, index: UInt32) -> SVGTransform { + jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func replaceItem(newItem: SVGTransform, index: UInt32) -> SVGTransform { + jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + } + + public func removeItem(index: UInt32) -> SVGTransform { + jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + } + + public func appendItem(newItem: SVGTransform) -> SVGTransform { + jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + } + + // XXX: unsupported setter for keys of type UInt32 + + public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { + jsObject[Strings.createSVGTransformFromMatrix]!(matrix?.jsValue() ?? .undefined).fromJSValue()! + } + + public func consolidate() -> SVGTransform? { + jsObject[Strings.consolidate]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SVGURIReference.swift b/Sources/DOMKit/WebIDL/SVGURIReference.swift new file mode 100644 index 00000000..79105bd9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGURIReference.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol SVGURIReference: JSBridgedClass {} +public extension SVGURIReference { + var href: SVGAnimatedString { ReadonlyAttribute[Strings.href, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/SVGUnitTypes.swift b/Sources/DOMKit/WebIDL/SVGUnitTypes.swift new file mode 100644 index 00000000..6efc8975 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGUnitTypes.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGUnitTypes: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SVGUnitTypes].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let SVG_UNIT_TYPE_UNKNOWN: UInt16 = 0 + + public static let SVG_UNIT_TYPE_USERSPACEONUSE: UInt16 = 1 + + public static let SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: UInt16 = 2 +} diff --git a/Sources/DOMKit/WebIDL/SVGUseElement.swift b/Sources/DOMKit/WebIDL/SVGUseElement.swift new file mode 100644 index 00000000..911e2ad7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGUseElement.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGUseElement: SVGGraphicsElement, SVGURIReference { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGUseElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _instanceRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.instanceRoot) + _animatedInstanceRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.animatedInstanceRoot) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var x: SVGAnimatedLength + + @ReadonlyAttribute + public var y: SVGAnimatedLength + + @ReadonlyAttribute + public var width: SVGAnimatedLength + + @ReadonlyAttribute + public var height: SVGAnimatedLength + + @ReadonlyAttribute + public var instanceRoot: SVGElement? + + @ReadonlyAttribute + public var animatedInstanceRoot: SVGElement? +} diff --git a/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift b/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift new file mode 100644 index 00000000..4f244233 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGUseElementShadowRoot: ShadowRoot { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGUseElementShadowRoot].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/SVGViewElement.swift b/Sources/DOMKit/WebIDL/SVGViewElement.swift new file mode 100644 index 00000000..1e4a6a1b --- /dev/null +++ b/Sources/DOMKit/WebIDL/SVGViewElement.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SVGViewElement: SVGElement, SVGFitToViewBox { + override public class var constructor: JSFunction { JSObject.global[Strings.SVGViewElement].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/Sanitizer.swift b/Sources/DOMKit/WebIDL/Sanitizer.swift new file mode 100644 index 00000000..473c79af --- /dev/null +++ b/Sources/DOMKit/WebIDL/Sanitizer.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Sanitizer: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Sanitizer].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(config: SanitizerConfig? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(config?.jsValue() ?? .undefined)) + } + + public func sanitize(input: __UNSUPPORTED_UNION__) -> DocumentFragment { + jsObject[Strings.sanitize]!(input.jsValue()).fromJSValue()! + } + + public func sanitizeFor(element: String, input: String) -> Element? { + jsObject[Strings.sanitizeFor]!(element.jsValue(), input.jsValue()).fromJSValue()! + } + + public func getConfiguration() -> SanitizerConfig { + jsObject[Strings.getConfiguration]!().fromJSValue()! + } + + public static func getDefaultConfiguration() -> SanitizerConfig { + constructor[Strings.getDefaultConfiguration]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SanitizerConfig.swift b/Sources/DOMKit/WebIDL/SanitizerConfig.swift new file mode 100644 index 00000000..b4ea5f92 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SanitizerConfig.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SanitizerConfig: BridgedDictionary { + public convenience init(allowElements: [String], blockElements: [String], dropElements: [String], allowAttributes: AttributeMatchList, dropAttributes: AttributeMatchList, allowCustomElements: Bool, allowComments: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.allowElements] = allowElements.jsValue() + object[Strings.blockElements] = blockElements.jsValue() + object[Strings.dropElements] = dropElements.jsValue() + object[Strings.allowAttributes] = allowAttributes.jsValue() + object[Strings.dropAttributes] = dropAttributes.jsValue() + object[Strings.allowCustomElements] = allowCustomElements.jsValue() + object[Strings.allowComments] = allowComments.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _allowElements = ReadWriteAttribute(jsObject: object, name: Strings.allowElements) + _blockElements = ReadWriteAttribute(jsObject: object, name: Strings.blockElements) + _dropElements = ReadWriteAttribute(jsObject: object, name: Strings.dropElements) + _allowAttributes = ReadWriteAttribute(jsObject: object, name: Strings.allowAttributes) + _dropAttributes = ReadWriteAttribute(jsObject: object, name: Strings.dropAttributes) + _allowCustomElements = ReadWriteAttribute(jsObject: object, name: Strings.allowCustomElements) + _allowComments = ReadWriteAttribute(jsObject: object, name: Strings.allowComments) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var allowElements: [String] + + @ReadWriteAttribute + public var blockElements: [String] + + @ReadWriteAttribute + public var dropElements: [String] + + @ReadWriteAttribute + public var allowAttributes: AttributeMatchList + + @ReadWriteAttribute + public var dropAttributes: AttributeMatchList + + @ReadWriteAttribute + public var allowCustomElements: Bool + + @ReadWriteAttribute + public var allowComments: Bool +} diff --git a/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift b/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift new file mode 100644 index 00000000..aae7c142 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SaveFilePickerOptions: BridgedDictionary { + public convenience init(suggestedName: String?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.suggestedName] = suggestedName.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _suggestedName = ReadWriteAttribute(jsObject: object, name: Strings.suggestedName) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var suggestedName: String? +} diff --git a/Sources/DOMKit/WebIDL/Scheduler.swift b/Sources/DOMKit/WebIDL/Scheduler.swift new file mode 100644 index 00000000..9e964993 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Scheduler.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Scheduler: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Scheduler].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func postTask(callback: SchedulerPostTaskCallback, options: SchedulerPostTaskOptions? = nil) -> JSPromise { + jsObject[Strings.postTask]!(callback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func postTask(callback: SchedulerPostTaskCallback, options: SchedulerPostTaskOptions? = nil) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.postTask]!(callback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift b/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift new file mode 100644 index 00000000..7da77566 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SchedulerPostTaskOptions: BridgedDictionary { + public convenience init(signal: AbortSignal, priority: TaskPriority, delay: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.signal] = signal.jsValue() + object[Strings.priority] = priority.jsValue() + object[Strings.delay] = delay.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) + _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var signal: AbortSignal + + @ReadWriteAttribute + public var priority: TaskPriority + + @ReadWriteAttribute + public var delay: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/Scheduling.swift b/Sources/DOMKit/WebIDL/Scheduling.swift new file mode 100644 index 00000000..9c5fdf54 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Scheduling.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Scheduling: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Scheduling].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func isInputPending(isInputPendingOptions: IsInputPendingOptions? = nil) -> Bool { + jsObject[Strings.isInputPending]!(isInputPendingOptions?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/Screen.swift b/Sources/DOMKit/WebIDL/Screen.swift new file mode 100644 index 00000000..ea8152f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Screen.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Screen: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Screen].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _availWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.availWidth) + _availHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.availHeight) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _colorDepth = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorDepth) + _pixelDepth = ReadonlyAttribute(jsObject: jsObject, name: Strings.pixelDepth) + _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var availWidth: Int32 + + @ReadonlyAttribute + public var availHeight: Int32 + + @ReadonlyAttribute + public var width: Int32 + + @ReadonlyAttribute + public var height: Int32 + + @ReadonlyAttribute + public var colorDepth: UInt32 + + @ReadonlyAttribute + public var pixelDepth: UInt32 + + @ReadonlyAttribute + public var orientation: ScreenOrientation +} diff --git a/Sources/DOMKit/WebIDL/ScreenIdleState.swift b/Sources/DOMKit/WebIDL/ScreenIdleState.swift new file mode 100644 index 00000000..42897520 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScreenIdleState.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ScreenIdleState: JSString, JSValueCompatible { + case locked = "locked" + case unlocked = "unlocked" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ScreenOrientation.swift b/Sources/DOMKit/WebIDL/ScreenOrientation.swift new file mode 100644 index 00000000..be3361df --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScreenOrientation.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ScreenOrientation: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.ScreenOrientation].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _angle = ReadonlyAttribute(jsObject: jsObject, name: Strings.angle) + _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + super.init(unsafelyWrapping: jsObject) + } + + public func lock(orientation: OrientationLockType) -> JSPromise { + jsObject[Strings.lock]!(orientation.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func lock(orientation: OrientationLockType) async throws { + let _promise: JSPromise = jsObject[Strings.lock]!(orientation.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func unlock() { + _ = jsObject[Strings.unlock]!() + } + + @ReadonlyAttribute + public var type: OrientationType + + @ReadonlyAttribute + public var angle: UInt16 + + @ClosureAttribute.Optional1 + public var onchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift b/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift new file mode 100644 index 00000000..68e5514a --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ScriptProcessorNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.ScriptProcessorNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onaudioprocess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaudioprocess) + _bufferSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.bufferSize) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var onaudioprocess: EventHandler + + @ReadonlyAttribute + public var bufferSize: Int32 +} diff --git a/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift b/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift new file mode 100644 index 00000000..9824649e --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ScriptingPolicyReportBody: ReportBody { + override public class var constructor: JSFunction { JSObject.global[Strings.ScriptingPolicyReportBody].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _violationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.violationType) + _violationURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.violationURL) + _violationSample = ReadonlyAttribute(jsObject: jsObject, name: Strings.violationSample) + _lineno = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineno) + _colno = ReadonlyAttribute(jsObject: jsObject, name: Strings.colno) + super.init(unsafelyWrapping: jsObject) + } + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + @ReadonlyAttribute + public var violationType: String + + @ReadonlyAttribute + public var violationURL: String? + + @ReadonlyAttribute + public var violationSample: String? + + @ReadonlyAttribute + public var lineno: UInt32 + + @ReadonlyAttribute + public var colno: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift b/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift new file mode 100644 index 00000000..1975b316 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ScriptingPolicyViolationType: JSString, JSValueCompatible { + case externalScript = "externalScript" + case inlineScript = "inlineScript" + case inlineEventHandler = "inlineEventHandler" + case eval = "eval" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ScrollBehavior.swift b/Sources/DOMKit/WebIDL/ScrollBehavior.swift new file mode 100644 index 00000000..017c72d4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollBehavior.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ScrollBehavior: JSString, JSValueCompatible { + case auto = "auto" + case smooth = "smooth" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ScrollDirection.swift b/Sources/DOMKit/WebIDL/ScrollDirection.swift new file mode 100644 index 00000000..54dc49da --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollDirection.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ScrollDirection: JSString, JSValueCompatible { + case block = "block" + case inline = "inline" + case horizontal = "horizontal" + case vertical = "vertical" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift b/Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift new file mode 100644 index 00000000..bf1338c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ScrollIntoViewOptions: BridgedDictionary { + public convenience init(block: ScrollLogicalPosition, inline: ScrollLogicalPosition) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.block] = block.jsValue() + object[Strings.inline] = inline.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _block = ReadWriteAttribute(jsObject: object, name: Strings.block) + _inline = ReadWriteAttribute(jsObject: object, name: Strings.inline) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var block: ScrollLogicalPosition + + @ReadWriteAttribute + public var inline: ScrollLogicalPosition +} diff --git a/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift b/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift new file mode 100644 index 00000000..4c5bb5a5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ScrollLogicalPosition: JSString, JSValueCompatible { + case start = "start" + case center = "center" + case end = "end" + case nearest = "nearest" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ScrollOptions.swift b/Sources/DOMKit/WebIDL/ScrollOptions.swift new file mode 100644 index 00000000..deed638a --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ScrollOptions: BridgedDictionary { + public convenience init(behavior: ScrollBehavior) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.behavior] = behavior.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _behavior = ReadWriteAttribute(jsObject: object, name: Strings.behavior) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var behavior: ScrollBehavior +} diff --git a/Sources/DOMKit/WebIDL/ScrollSetting.swift b/Sources/DOMKit/WebIDL/ScrollSetting.swift new file mode 100644 index 00000000..263b9675 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollSetting.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ScrollSetting: JSString, JSValueCompatible { + case _empty = "" + case up = "up" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ScrollTimeline.swift b/Sources/DOMKit/WebIDL/ScrollTimeline.swift new file mode 100644 index 00000000..5e4b1baa --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollTimeline.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ScrollTimeline: AnimationTimeline { + override public class var constructor: JSFunction { JSObject.global[Strings.ScrollTimeline].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) + _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) + _scrollOffsets = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollOffsets) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: ScrollTimelineOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var source: Element? + + @ReadonlyAttribute + public var orientation: ScrollDirection + + @ReadonlyAttribute + public var scrollOffsets: [ScrollTimelineOffset] +} diff --git a/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift b/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift new file mode 100644 index 00000000..0cd98a95 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ScrollTimelineAutoKeyword: JSString, JSValueCompatible { + case auto = "auto" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift b/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift new file mode 100644 index 00000000..459c7a53 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ScrollTimelineOptions: BridgedDictionary { + public convenience init(source: Element?, orientation: ScrollDirection, scrollOffsets: [ScrollTimelineOffset]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.source] = source.jsValue() + object[Strings.orientation] = orientation.jsValue() + object[Strings.scrollOffsets] = scrollOffsets.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _source = ReadWriteAttribute(jsObject: object, name: Strings.source) + _orientation = ReadWriteAttribute(jsObject: object, name: Strings.orientation) + _scrollOffsets = ReadWriteAttribute(jsObject: object, name: Strings.scrollOffsets) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var source: Element? + + @ReadWriteAttribute + public var orientation: ScrollDirection + + @ReadWriteAttribute + public var scrollOffsets: [ScrollTimelineOffset] +} diff --git a/Sources/DOMKit/WebIDL/ScrollToOptions.swift b/Sources/DOMKit/WebIDL/ScrollToOptions.swift new file mode 100644 index 00000000..1dd0cfc8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ScrollToOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ScrollToOptions: BridgedDictionary { + public convenience init(left: Double, top: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.left] = left.jsValue() + object[Strings.top] = top.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _left = ReadWriteAttribute(jsObject: object, name: Strings.left) + _top = ReadWriteAttribute(jsObject: object, name: Strings.top) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var left: Double + + @ReadWriteAttribute + public var top: Double +} diff --git a/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift b/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift new file mode 100644 index 00000000..dfe64864 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SecurePaymentConfirmationRequest: BridgedDictionary { + public convenience init(challenge: BufferSource, rpId: String, credentialIds: [BufferSource], instrument: PaymentCredentialInstrument, timeout: UInt32, payeeOrigin: String, extensions: AuthenticationExtensionsClientInputs) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.challenge] = challenge.jsValue() + object[Strings.rpId] = rpId.jsValue() + object[Strings.credentialIds] = credentialIds.jsValue() + object[Strings.instrument] = instrument.jsValue() + object[Strings.timeout] = timeout.jsValue() + object[Strings.payeeOrigin] = payeeOrigin.jsValue() + object[Strings.extensions] = extensions.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _challenge = ReadWriteAttribute(jsObject: object, name: Strings.challenge) + _rpId = ReadWriteAttribute(jsObject: object, name: Strings.rpId) + _credentialIds = ReadWriteAttribute(jsObject: object, name: Strings.credentialIds) + _instrument = ReadWriteAttribute(jsObject: object, name: Strings.instrument) + _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) + _payeeOrigin = ReadWriteAttribute(jsObject: object, name: Strings.payeeOrigin) + _extensions = ReadWriteAttribute(jsObject: object, name: Strings.extensions) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var challenge: BufferSource + + @ReadWriteAttribute + public var rpId: String + + @ReadWriteAttribute + public var credentialIds: [BufferSource] + + @ReadWriteAttribute + public var instrument: PaymentCredentialInstrument + + @ReadWriteAttribute + public var timeout: UInt32 + + @ReadWriteAttribute + public var payeeOrigin: String + + @ReadWriteAttribute + public var extensions: AuthenticationExtensionsClientInputs +} diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift new file mode 100644 index 00000000..d660e808 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SecurityPolicyViolationEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.SecurityPolicyViolationEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _documentURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURI) + _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) + _blockedURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockedURI) + _effectiveDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.effectiveDirective) + _violatedDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.violatedDirective) + _originalPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.originalPolicy) + _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) + _sample = ReadonlyAttribute(jsObject: jsObject, name: Strings.sample) + _disposition = ReadonlyAttribute(jsObject: jsObject, name: Strings.disposition) + _statusCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusCode) + _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) + _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: SecurityPolicyViolationEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var documentURI: String + + @ReadonlyAttribute + public var referrer: String + + @ReadonlyAttribute + public var blockedURI: String + + @ReadonlyAttribute + public var effectiveDirective: String + + @ReadonlyAttribute + public var violatedDirective: String + + @ReadonlyAttribute + public var originalPolicy: String + + @ReadonlyAttribute + public var sourceFile: String + + @ReadonlyAttribute + public var sample: String + + @ReadonlyAttribute + public var disposition: SecurityPolicyViolationEventDisposition + + @ReadonlyAttribute + public var statusCode: UInt16 + + @ReadonlyAttribute + public var lineNumber: UInt32 + + @ReadonlyAttribute + public var columnNumber: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift new file mode 100644 index 00000000..03a7bda6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum SecurityPolicyViolationEventDisposition: JSString, JSValueCompatible { + case enforce = "enforce" + case report = "report" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift new file mode 100644 index 00000000..9bdaa9ee --- /dev/null +++ b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift @@ -0,0 +1,75 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SecurityPolicyViolationEventInit: BridgedDictionary { + public convenience init(documentURI: String, referrer: String, blockedURI: String, violatedDirective: String, effectiveDirective: String, originalPolicy: String, sourceFile: String, sample: String, disposition: SecurityPolicyViolationEventDisposition, statusCode: UInt16, lineNumber: UInt32, columnNumber: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.documentURI] = documentURI.jsValue() + object[Strings.referrer] = referrer.jsValue() + object[Strings.blockedURI] = blockedURI.jsValue() + object[Strings.violatedDirective] = violatedDirective.jsValue() + object[Strings.effectiveDirective] = effectiveDirective.jsValue() + object[Strings.originalPolicy] = originalPolicy.jsValue() + object[Strings.sourceFile] = sourceFile.jsValue() + object[Strings.sample] = sample.jsValue() + object[Strings.disposition] = disposition.jsValue() + object[Strings.statusCode] = statusCode.jsValue() + object[Strings.lineNumber] = lineNumber.jsValue() + object[Strings.columnNumber] = columnNumber.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _documentURI = ReadWriteAttribute(jsObject: object, name: Strings.documentURI) + _referrer = ReadWriteAttribute(jsObject: object, name: Strings.referrer) + _blockedURI = ReadWriteAttribute(jsObject: object, name: Strings.blockedURI) + _violatedDirective = ReadWriteAttribute(jsObject: object, name: Strings.violatedDirective) + _effectiveDirective = ReadWriteAttribute(jsObject: object, name: Strings.effectiveDirective) + _originalPolicy = ReadWriteAttribute(jsObject: object, name: Strings.originalPolicy) + _sourceFile = ReadWriteAttribute(jsObject: object, name: Strings.sourceFile) + _sample = ReadWriteAttribute(jsObject: object, name: Strings.sample) + _disposition = ReadWriteAttribute(jsObject: object, name: Strings.disposition) + _statusCode = ReadWriteAttribute(jsObject: object, name: Strings.statusCode) + _lineNumber = ReadWriteAttribute(jsObject: object, name: Strings.lineNumber) + _columnNumber = ReadWriteAttribute(jsObject: object, name: Strings.columnNumber) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var documentURI: String + + @ReadWriteAttribute + public var referrer: String + + @ReadWriteAttribute + public var blockedURI: String + + @ReadWriteAttribute + public var violatedDirective: String + + @ReadWriteAttribute + public var effectiveDirective: String + + @ReadWriteAttribute + public var originalPolicy: String + + @ReadWriteAttribute + public var sourceFile: String + + @ReadWriteAttribute + public var sample: String + + @ReadWriteAttribute + public var disposition: SecurityPolicyViolationEventDisposition + + @ReadWriteAttribute + public var statusCode: UInt16 + + @ReadWriteAttribute + public var lineNumber: UInt32 + + @ReadWriteAttribute + public var columnNumber: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/Selection.swift b/Sources/DOMKit/WebIDL/Selection.swift new file mode 100644 index 00000000..f76794f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Selection.swift @@ -0,0 +1,102 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Selection: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Selection].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _anchorNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchorNode) + _anchorOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchorOffset) + _focusNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.focusNode) + _focusOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.focusOffset) + _isCollapsed = ReadonlyAttribute(jsObject: jsObject, name: Strings.isCollapsed) + _rangeCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeCount) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var anchorNode: Node? + + @ReadonlyAttribute + public var anchorOffset: UInt32 + + @ReadonlyAttribute + public var focusNode: Node? + + @ReadonlyAttribute + public var focusOffset: UInt32 + + @ReadonlyAttribute + public var isCollapsed: Bool + + @ReadonlyAttribute + public var rangeCount: UInt32 + + @ReadonlyAttribute + public var type: String + + public func getRangeAt(index: UInt32) -> Range { + jsObject[Strings.getRangeAt]!(index.jsValue()).fromJSValue()! + } + + public func addRange(range: Range) { + _ = jsObject[Strings.addRange]!(range.jsValue()) + } + + public func removeRange(range: Range) { + _ = jsObject[Strings.removeRange]!(range.jsValue()) + } + + public func removeAllRanges() { + _ = jsObject[Strings.removeAllRanges]!() + } + + public func empty() { + _ = jsObject[Strings.empty]!() + } + + public func collapse(node: Node?, offset: UInt32? = nil) { + _ = jsObject[Strings.collapse]!(node.jsValue(), offset?.jsValue() ?? .undefined) + } + + public func setPosition(node: Node?, offset: UInt32? = nil) { + _ = jsObject[Strings.setPosition]!(node.jsValue(), offset?.jsValue() ?? .undefined) + } + + public func collapseToStart() { + _ = jsObject[Strings.collapseToStart]!() + } + + public func collapseToEnd() { + _ = jsObject[Strings.collapseToEnd]!() + } + + public func extend(node: Node, offset: UInt32? = nil) { + _ = jsObject[Strings.extend]!(node.jsValue(), offset?.jsValue() ?? .undefined) + } + + public func setBaseAndExtent(anchorNode: Node, anchorOffset: UInt32, focusNode: Node, focusOffset: UInt32) { + _ = jsObject[Strings.setBaseAndExtent]!(anchorNode.jsValue(), anchorOffset.jsValue(), focusNode.jsValue(), focusOffset.jsValue()) + } + + public func selectAllChildren(node: Node) { + _ = jsObject[Strings.selectAllChildren]!(node.jsValue()) + } + + public func deleteFromDocument() { + _ = jsObject[Strings.deleteFromDocument]!() + } + + public func containsNode(node: Node, allowPartialContainment: Bool? = nil) -> Bool { + jsObject[Strings.containsNode]!(node.jsValue(), allowPartialContainment?.jsValue() ?? .undefined).fromJSValue()! + } + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/Sensor.swift b/Sources/DOMKit/WebIDL/Sensor.swift new file mode 100644 index 00000000..c550ec84 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Sensor.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Sensor: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.Sensor].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _activated = ReadonlyAttribute(jsObject: jsObject, name: Strings.activated) + _hasReading = ReadonlyAttribute(jsObject: jsObject, name: Strings.hasReading) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _onreading = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreading) + _onactivate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onactivate) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var activated: Bool + + @ReadonlyAttribute + public var hasReading: Bool + + @ReadonlyAttribute + public var timestamp: DOMHighResTimeStamp? + + public func start() { + _ = jsObject[Strings.start]!() + } + + public func stop() { + _ = jsObject[Strings.stop]!() + } + + @ClosureAttribute.Optional1 + public var onreading: EventHandler + + @ClosureAttribute.Optional1 + public var onactivate: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/SensorErrorEvent.swift b/Sources/DOMKit/WebIDL/SensorErrorEvent.swift new file mode 100644 index 00000000..02de1367 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SensorErrorEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SensorErrorEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.SensorErrorEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, errorEventInitDict: SensorErrorEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), errorEventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var error: DOMException +} diff --git a/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift b/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift new file mode 100644 index 00000000..1c30af1d --- /dev/null +++ b/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SensorErrorEventInit: 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 +} diff --git a/Sources/DOMKit/WebIDL/SensorOptions.swift b/Sources/DOMKit/WebIDL/SensorOptions.swift new file mode 100644 index 00000000..8e8fe16f --- /dev/null +++ b/Sources/DOMKit/WebIDL/SensorOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SensorOptions: BridgedDictionary { + public convenience init(frequency: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.frequency] = frequency.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var frequency: Double +} diff --git a/Sources/DOMKit/WebIDL/SequenceEffect.swift b/Sources/DOMKit/WebIDL/SequenceEffect.swift new file mode 100644 index 00000000..76879a3c --- /dev/null +++ b/Sources/DOMKit/WebIDL/SequenceEffect.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SequenceEffect: GroupEffect { + override public class var constructor: JSFunction { JSObject.global[Strings.SequenceEffect].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(children.jsValue(), timing?.jsValue() ?? .undefined)) + } + + override public func clone() -> Self { + jsObject[Strings.clone]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/Serial.swift b/Sources/DOMKit/WebIDL/Serial.swift new file mode 100644 index 00000000..64751a30 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Serial.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Serial: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.Serial].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var onconnect: EventHandler + + @ClosureAttribute.Optional1 + public var ondisconnect: EventHandler + + public func getPorts() -> JSPromise { + jsObject[Strings.getPorts]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getPorts() async throws -> [SerialPort] { + let _promise: JSPromise = jsObject[Strings.getPorts]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestPort(options: SerialPortRequestOptions? = nil) -> JSPromise { + jsObject[Strings.requestPort]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestPort(options: SerialPortRequestOptions? = nil) async throws -> SerialPort { + let _promise: JSPromise = jsObject[Strings.requestPort]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SerialInputSignals.swift b/Sources/DOMKit/WebIDL/SerialInputSignals.swift new file mode 100644 index 00000000..80d52d13 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SerialInputSignals.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SerialInputSignals: BridgedDictionary { + public convenience init(dataCarrierDetect: Bool, clearToSend: Bool, ringIndicator: Bool, dataSetReady: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.dataCarrierDetect] = dataCarrierDetect.jsValue() + object[Strings.clearToSend] = clearToSend.jsValue() + object[Strings.ringIndicator] = ringIndicator.jsValue() + object[Strings.dataSetReady] = dataSetReady.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _dataCarrierDetect = ReadWriteAttribute(jsObject: object, name: Strings.dataCarrierDetect) + _clearToSend = ReadWriteAttribute(jsObject: object, name: Strings.clearToSend) + _ringIndicator = ReadWriteAttribute(jsObject: object, name: Strings.ringIndicator) + _dataSetReady = ReadWriteAttribute(jsObject: object, name: Strings.dataSetReady) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var dataCarrierDetect: Bool + + @ReadWriteAttribute + public var clearToSend: Bool + + @ReadWriteAttribute + public var ringIndicator: Bool + + @ReadWriteAttribute + public var dataSetReady: Bool +} diff --git a/Sources/DOMKit/WebIDL/SerialOptions.swift b/Sources/DOMKit/WebIDL/SerialOptions.swift new file mode 100644 index 00000000..7a9b9566 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SerialOptions.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SerialOptions: BridgedDictionary { + public convenience init(baudRate: UInt32, dataBits: UInt8, stopBits: UInt8, parity: ParityType, bufferSize: UInt32, flowControl: FlowControlType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.baudRate] = baudRate.jsValue() + object[Strings.dataBits] = dataBits.jsValue() + object[Strings.stopBits] = stopBits.jsValue() + object[Strings.parity] = parity.jsValue() + object[Strings.bufferSize] = bufferSize.jsValue() + object[Strings.flowControl] = flowControl.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _baudRate = ReadWriteAttribute(jsObject: object, name: Strings.baudRate) + _dataBits = ReadWriteAttribute(jsObject: object, name: Strings.dataBits) + _stopBits = ReadWriteAttribute(jsObject: object, name: Strings.stopBits) + _parity = ReadWriteAttribute(jsObject: object, name: Strings.parity) + _bufferSize = ReadWriteAttribute(jsObject: object, name: Strings.bufferSize) + _flowControl = ReadWriteAttribute(jsObject: object, name: Strings.flowControl) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var baudRate: UInt32 + + @ReadWriteAttribute + public var dataBits: UInt8 + + @ReadWriteAttribute + public var stopBits: UInt8 + + @ReadWriteAttribute + public var parity: ParityType + + @ReadWriteAttribute + public var bufferSize: UInt32 + + @ReadWriteAttribute + public var flowControl: FlowControlType +} diff --git a/Sources/DOMKit/WebIDL/SerialOutputSignals.swift b/Sources/DOMKit/WebIDL/SerialOutputSignals.swift new file mode 100644 index 00000000..787d552d --- /dev/null +++ b/Sources/DOMKit/WebIDL/SerialOutputSignals.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SerialOutputSignals: BridgedDictionary { + public convenience init(dataTerminalReady: Bool, requestToSend: Bool, break _: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.dataTerminalReady] = dataTerminalReady.jsValue() + object[Strings.requestToSend] = requestToSend.jsValue() + object[Strings.break] = break .jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _dataTerminalReady = ReadWriteAttribute(jsObject: object, name: Strings.dataTerminalReady) + _requestToSend = ReadWriteAttribute(jsObject: object, name: Strings.requestToSend) + _break = ReadWriteAttribute(jsObject: object, name: Strings.break) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var dataTerminalReady: Bool + + @ReadWriteAttribute + public var requestToSend: Bool + + @ReadWriteAttribute + public var break: Bool +} diff --git a/Sources/DOMKit/WebIDL/SerialPort.swift b/Sources/DOMKit/WebIDL/SerialPort.swift new file mode 100644 index 00000000..67acf43a --- /dev/null +++ b/Sources/DOMKit/WebIDL/SerialPort.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SerialPort: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.SerialPort].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + _readable = ReadonlyAttribute(jsObject: jsObject, name: Strings.readable) + _writable = ReadonlyAttribute(jsObject: jsObject, name: Strings.writable) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var onconnect: EventHandler + + @ClosureAttribute.Optional1 + public var ondisconnect: EventHandler + + @ReadonlyAttribute + public var readable: ReadableStream + + @ReadonlyAttribute + public var writable: WritableStream + + public func getInfo() -> SerialPortInfo { + jsObject[Strings.getInfo]!().fromJSValue()! + } + + public func open(options: SerialOptions) -> JSPromise { + jsObject[Strings.open]!(options.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func open(options: SerialOptions) async throws { + let _promise: JSPromise = jsObject[Strings.open]!(options.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func setSignals(signals: SerialOutputSignals? = nil) -> JSPromise { + jsObject[Strings.setSignals]!(signals?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setSignals(signals: SerialOutputSignals? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.setSignals]!(signals?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func getSignals() -> JSPromise { + jsObject[Strings.getSignals]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getSignals() async throws -> SerialInputSignals { + let _promise: JSPromise = jsObject[Strings.getSignals]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func close() -> JSPromise { + jsObject[Strings.close]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func close() async throws { + let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/SerialPortFilter.swift b/Sources/DOMKit/WebIDL/SerialPortFilter.swift new file mode 100644 index 00000000..1e5b049f --- /dev/null +++ b/Sources/DOMKit/WebIDL/SerialPortFilter.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SerialPortFilter: BridgedDictionary { + public convenience init(usbVendorId: UInt16, usbProductId: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.usbVendorId] = usbVendorId.jsValue() + object[Strings.usbProductId] = usbProductId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _usbVendorId = ReadWriteAttribute(jsObject: object, name: Strings.usbVendorId) + _usbProductId = ReadWriteAttribute(jsObject: object, name: Strings.usbProductId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var usbVendorId: UInt16 + + @ReadWriteAttribute + public var usbProductId: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/SerialPortInfo.swift b/Sources/DOMKit/WebIDL/SerialPortInfo.swift new file mode 100644 index 00000000..931ef2cb --- /dev/null +++ b/Sources/DOMKit/WebIDL/SerialPortInfo.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SerialPortInfo: BridgedDictionary { + public convenience init(usbVendorId: UInt16, usbProductId: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.usbVendorId] = usbVendorId.jsValue() + object[Strings.usbProductId] = usbProductId.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _usbVendorId = ReadWriteAttribute(jsObject: object, name: Strings.usbVendorId) + _usbProductId = ReadWriteAttribute(jsObject: object, name: Strings.usbProductId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var usbVendorId: UInt16 + + @ReadWriteAttribute + public var usbProductId: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift b/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift new file mode 100644 index 00000000..2d5c2715 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SerialPortRequestOptions: BridgedDictionary { + public convenience init(filters: [SerialPortFilter]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.filters] = filters.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var filters: [SerialPortFilter] +} diff --git a/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift b/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift new file mode 100644 index 00000000..48357e5e --- /dev/null +++ b/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol ServiceEventHandlers: JSBridgedClass {} +public extension ServiceEventHandlers { + var onserviceadded: EventHandler { + get { ClosureAttribute.Optional1[Strings.onserviceadded, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onserviceadded, in: jsObject] = newValue } + } + + var onservicechanged: EventHandler { + get { ClosureAttribute.Optional1[Strings.onservicechanged, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onservicechanged, in: jsObject] = newValue } + } + + var onserviceremoved: EventHandler { + get { ClosureAttribute.Optional1[Strings.onserviceremoved, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onserviceremoved, in: jsObject] = newValue } + } +} diff --git a/Sources/DOMKit/WebIDL/ServiceWorker.swift b/Sources/DOMKit/WebIDL/ServiceWorker.swift new file mode 100644 index 00000000..33b4c453 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ServiceWorker.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ServiceWorker: EventTarget, AbstractWorker { + override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorker].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _scriptURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.scriptURL) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var scriptURL: String + + @ReadonlyAttribute + public var state: ServiceWorkerState + + public func postMessage(message: JSValue, transfer: [JSObject]) { + _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) + } + + public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + } + + @ClosureAttribute.Optional1 + public var onstatechange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift new file mode 100644 index 00000000..76200fbb --- /dev/null +++ b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift @@ -0,0 +1,66 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ServiceWorkerContainer: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerContainer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _controller = ReadonlyAttribute(jsObject: jsObject, name: Strings.controller) + _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) + _oncontrollerchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontrollerchange) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var controller: ServiceWorker? + + @ReadonlyAttribute + public var ready: JSPromise + + public func register(scriptURL: String, options: RegistrationOptions? = nil) -> JSPromise { + jsObject[Strings.register]!(scriptURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func register(scriptURL: String, options: RegistrationOptions? = nil) async throws -> ServiceWorkerRegistration { + let _promise: JSPromise = jsObject[Strings.register]!(scriptURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getRegistration(clientURL: String? = nil) -> JSPromise { + jsObject[Strings.getRegistration]!(clientURL?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getRegistration(clientURL: String? = nil) async throws -> __UNSUPPORTED_UNION__ { + let _promise: JSPromise = jsObject[Strings.getRegistration]!(clientURL?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getRegistrations() -> JSPromise { + jsObject[Strings.getRegistrations]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getRegistrations() async throws -> [ServiceWorkerRegistration] { + let _promise: JSPromise = jsObject[Strings.getRegistrations]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func startMessages() { + _ = jsObject[Strings.startMessages]!() + } + + @ClosureAttribute.Optional1 + public var oncontrollerchange: EventHandler + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ClosureAttribute.Optional1 + public var onmessageerror: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift new file mode 100644 index 00000000..c0c219c3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift @@ -0,0 +1,114 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ServiceWorkerGlobalScope: WorkerGlobalScope { + override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerGlobalScope].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) + _oncookiechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncookiechange) + _onperiodicsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onperiodicsync) + _onnotificationclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnotificationclick) + _onnotificationclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnotificationclose) + _onsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsync) + _onbackgroundfetchsuccess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchsuccess) + _onbackgroundfetchfail = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchfail) + _onbackgroundfetchabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchabort) + _onbackgroundfetchclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchclick) + _oncanmakepayment = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncanmakepayment) + _onpaymentrequest = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpaymentrequest) + _clients = ReadonlyAttribute(jsObject: jsObject, name: Strings.clients) + _registration = ReadonlyAttribute(jsObject: jsObject, name: Strings.registration) + _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) + _oninstall = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oninstall) + _onactivate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onactivate) + _onfetch = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfetch) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _onpush = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpush) + _onpushsubscriptionchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpushsubscriptionchange) + _oncontentdelete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontentdelete) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var cookieStore: CookieStore + + @ClosureAttribute.Optional1 + public var oncookiechange: EventHandler + + @ClosureAttribute.Optional1 + public var onperiodicsync: EventHandler + + @ClosureAttribute.Optional1 + public var onnotificationclick: EventHandler + + @ClosureAttribute.Optional1 + public var onnotificationclose: EventHandler + + @ClosureAttribute.Optional1 + public var onsync: EventHandler + + @ClosureAttribute.Optional1 + public var onbackgroundfetchsuccess: EventHandler + + @ClosureAttribute.Optional1 + public var onbackgroundfetchfail: EventHandler + + @ClosureAttribute.Optional1 + public var onbackgroundfetchabort: EventHandler + + @ClosureAttribute.Optional1 + public var onbackgroundfetchclick: EventHandler + + @ClosureAttribute.Optional1 + public var oncanmakepayment: EventHandler + + @ClosureAttribute.Optional1 + public var onpaymentrequest: EventHandler + + @ReadonlyAttribute + public var clients: Clients + + @ReadonlyAttribute + public var registration: ServiceWorkerRegistration + + @ReadonlyAttribute + public var serviceWorker: ServiceWorker + + public func skipWaiting() -> JSPromise { + jsObject[Strings.skipWaiting]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func skipWaiting() async throws { + let _promise: JSPromise = jsObject[Strings.skipWaiting]!().fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var oninstall: EventHandler + + @ClosureAttribute.Optional1 + public var onactivate: EventHandler + + @ClosureAttribute.Optional1 + public var onfetch: EventHandler + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ClosureAttribute.Optional1 + public var onmessageerror: EventHandler + + @ClosureAttribute.Optional1 + public var onpush: EventHandler + + @ClosureAttribute.Optional1 + public var onpushsubscriptionchange: EventHandler + + @ClosureAttribute.Optional1 + public var oncontentdelete: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift new file mode 100644 index 00000000..52c81099 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift @@ -0,0 +1,108 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ServiceWorkerRegistration: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerRegistration].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _cookies = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookies) + _periodicSync = ReadonlyAttribute(jsObject: jsObject, name: Strings.periodicSync) + _sync = ReadonlyAttribute(jsObject: jsObject, name: Strings.sync) + _backgroundFetch = ReadonlyAttribute(jsObject: jsObject, name: Strings.backgroundFetch) + _paymentManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentManager) + _installing = ReadonlyAttribute(jsObject: jsObject, name: Strings.installing) + _waiting = ReadonlyAttribute(jsObject: jsObject, name: Strings.waiting) + _active = ReadonlyAttribute(jsObject: jsObject, name: Strings.active) + _navigationPreload = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationPreload) + _scope = ReadonlyAttribute(jsObject: jsObject, name: Strings.scope) + _updateViaCache = ReadonlyAttribute(jsObject: jsObject, name: Strings.updateViaCache) + _onupdatefound = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupdatefound) + _pushManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.pushManager) + _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var cookies: CookieStoreManager + + @ReadonlyAttribute + public var periodicSync: PeriodicSyncManager + + public func showNotification(title: String, options: NotificationOptions? = nil) -> JSPromise { + jsObject[Strings.showNotification]!(title.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showNotification(title: String, options: NotificationOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.showNotification]!(title.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func getNotifications(filter: GetNotificationOptions? = nil) -> JSPromise { + jsObject[Strings.getNotifications]!(filter?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getNotifications(filter: GetNotificationOptions? = nil) async throws -> [Notification] { + let _promise: JSPromise = jsObject[Strings.getNotifications]!(filter?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var sync: SyncManager + + @ReadonlyAttribute + public var backgroundFetch: BackgroundFetchManager + + @ReadonlyAttribute + public var paymentManager: PaymentManager + + @ReadonlyAttribute + public var installing: ServiceWorker? + + @ReadonlyAttribute + public var waiting: ServiceWorker? + + @ReadonlyAttribute + public var active: ServiceWorker? + + @ReadonlyAttribute + public var navigationPreload: NavigationPreloadManager + + @ReadonlyAttribute + public var scope: String + + @ReadonlyAttribute + public var updateViaCache: ServiceWorkerUpdateViaCache + + public func update() -> JSPromise { + jsObject[Strings.update]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func update() async throws { + let _promise: JSPromise = jsObject[Strings.update]!().fromJSValue()! + _ = try await _promise.get() + } + + public func unregister() -> JSPromise { + jsObject[Strings.unregister]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func unregister() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.unregister]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onupdatefound: EventHandler + + @ReadonlyAttribute + public var pushManager: PushManager + + @ReadonlyAttribute + public var index: ContentIndex +} diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerState.swift b/Sources/DOMKit/WebIDL/ServiceWorkerState.swift new file mode 100644 index 00000000..3bd8c395 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ServiceWorkerState.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ServiceWorkerState: JSString, JSValueCompatible { + case parsed = "parsed" + case installing = "installing" + case installed = "installed" + case activating = "activating" + case activated = "activated" + case redundant = "redundant" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift b/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift new file mode 100644 index 00000000..0f50c1b5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ServiceWorkerUpdateViaCache: JSString, JSValueCompatible { + case imports = "imports" + case all = "all" + case none = "none" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/SetHTMLOptions.swift b/Sources/DOMKit/WebIDL/SetHTMLOptions.swift new file mode 100644 index 00000000..27aaf147 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SetHTMLOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SetHTMLOptions: BridgedDictionary { + public convenience init(sanitizer: Sanitizer) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.sanitizer] = sanitizer.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _sanitizer = ReadWriteAttribute(jsObject: object, name: Strings.sanitizer) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var sanitizer: Sanitizer +} diff --git a/Sources/DOMKit/WebIDL/ShadowAnimation.swift b/Sources/DOMKit/WebIDL/ShadowAnimation.swift new file mode 100644 index 00000000..d4693a19 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ShadowAnimation.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ShadowAnimation: Animation { + override public class var constructor: JSFunction { JSObject.global[Strings.ShadowAnimation].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _sourceAnimation = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceAnimation) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(source: Animation, newTarget: __UNSUPPORTED_UNION__) { + self.init(unsafelyWrapping: Self.constructor.new(source.jsValue(), newTarget.jsValue())) + } + + @ReadonlyAttribute + public var sourceAnimation: Animation +} diff --git a/Sources/DOMKit/WebIDL/ShadowRoot.swift b/Sources/DOMKit/WebIDL/ShadowRoot.swift index 47dfdae9..6751754f 100644 --- a/Sources/DOMKit/WebIDL/ShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/ShadowRoot.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class ShadowRoot: DocumentFragment, DocumentOrShadowRoot { - override public class var constructor: JSFunction { JSObject.global.ShadowRoot.function! } +public class ShadowRoot: DocumentFragment, DocumentOrShadowRoot, InnerHTML { + override public class var constructor: JSFunction { JSObject.global[Strings.ShadowRoot].function! } public required init(unsafelyWrapping jsObject: JSObject) { _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) diff --git a/Sources/DOMKit/WebIDL/ShadowRootInit.swift b/Sources/DOMKit/WebIDL/ShadowRootInit.swift index f69210da..f422ea0e 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootInit.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class ShadowRootInit: BridgedDictionary { public convenience init(mode: ShadowRootMode, delegatesFocus: Bool, slotAssignment: SlotAssignmentMode) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.mode] = mode.jsValue() object[Strings.delegatesFocus] = delegatesFocus.jsValue() object[Strings.slotAssignment] = slotAssignment.jsValue() diff --git a/Sources/DOMKit/WebIDL/ShareData.swift b/Sources/DOMKit/WebIDL/ShareData.swift new file mode 100644 index 00000000..727f7037 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ShareData.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ShareData: BridgedDictionary { + public convenience init(files: [File], title: String, text: String, url: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.files] = files.jsValue() + object[Strings.title] = title.jsValue() + object[Strings.text] = text.jsValue() + object[Strings.url] = url.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _files = ReadWriteAttribute(jsObject: object, name: Strings.files) + _title = ReadWriteAttribute(jsObject: object, name: Strings.title) + _text = ReadWriteAttribute(jsObject: object, name: Strings.text) + _url = ReadWriteAttribute(jsObject: object, name: Strings.url) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var files: [File] + + @ReadWriteAttribute + public var title: String + + @ReadWriteAttribute + public var text: String + + @ReadWriteAttribute + public var url: String +} diff --git a/Sources/DOMKit/WebIDL/SharedWorker.swift b/Sources/DOMKit/WebIDL/SharedWorker.swift index a9ab36a1..2607f548 100644 --- a/Sources/DOMKit/WebIDL/SharedWorker.swift +++ b/Sources/DOMKit/WebIDL/SharedWorker.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SharedWorker: EventTarget, AbstractWorker { - override public class var constructor: JSFunction { JSObject.global.SharedWorker.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.SharedWorker].function! } public required init(unsafelyWrapping jsObject: JSObject) { _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift index 58a516c9..099f59b3 100644 --- a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SharedWorkerGlobalScope: WorkerGlobalScope { - override public class var constructor: JSFunction { JSObject.global.SharedWorkerGlobalScope.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.SharedWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/SourceBuffer.swift b/Sources/DOMKit/WebIDL/SourceBuffer.swift new file mode 100644 index 00000000..bb8924ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/SourceBuffer.swift @@ -0,0 +1,84 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SourceBuffer: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.SourceBuffer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _mode = ReadWriteAttribute(jsObject: jsObject, name: Strings.mode) + _updating = ReadonlyAttribute(jsObject: jsObject, name: Strings.updating) + _buffered = ReadonlyAttribute(jsObject: jsObject, name: Strings.buffered) + _timestampOffset = ReadWriteAttribute(jsObject: jsObject, name: Strings.timestampOffset) + _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioTracks) + _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoTracks) + _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.textTracks) + _appendWindowStart = ReadWriteAttribute(jsObject: jsObject, name: Strings.appendWindowStart) + _appendWindowEnd = ReadWriteAttribute(jsObject: jsObject, name: Strings.appendWindowEnd) + _onupdatestart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupdatestart) + _onupdate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupdate) + _onupdateend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupdateend) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var mode: AppendMode + + @ReadonlyAttribute + public var updating: Bool + + @ReadonlyAttribute + public var buffered: TimeRanges + + @ReadWriteAttribute + public var timestampOffset: Double + + @ReadonlyAttribute + public var audioTracks: AudioTrackList + + @ReadonlyAttribute + public var videoTracks: VideoTrackList + + @ReadonlyAttribute + public var textTracks: TextTrackList + + @ReadWriteAttribute + public var appendWindowStart: Double + + @ReadWriteAttribute + public var appendWindowEnd: Double + + @ClosureAttribute.Optional1 + public var onupdatestart: EventHandler + + @ClosureAttribute.Optional1 + public var onupdate: EventHandler + + @ClosureAttribute.Optional1 + public var onupdateend: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onabort: EventHandler + + public func appendBuffer(data: BufferSource) { + _ = jsObject[Strings.appendBuffer]!(data.jsValue()) + } + + public func abort() { + _ = jsObject[Strings.abort]!() + } + + public func changeType(type: String) { + _ = jsObject[Strings.changeType]!(type.jsValue()) + } + + public func remove(start: Double, end: Double) { + _ = jsObject[Strings.remove]!(start.jsValue(), end.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/SourceBufferList.swift b/Sources/DOMKit/WebIDL/SourceBufferList.swift new file mode 100644 index 00000000..08d6a025 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SourceBufferList.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SourceBufferList: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.SourceBufferList].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _onaddsourcebuffer = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddsourcebuffer) + _onremovesourcebuffer = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovesourcebuffer) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var length: UInt32 + + @ClosureAttribute.Optional1 + public var onaddsourcebuffer: EventHandler + + @ClosureAttribute.Optional1 + public var onremovesourcebuffer: EventHandler + + public subscript(key: Int) -> SourceBuffer { + jsObject[key].fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift b/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift new file mode 100644 index 00000000..bec6993d --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum SpatialNavigationDirection: JSString, JSValueCompatible { + case up = "up" + case down = "down" + case left = "left" + case right = "right" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift b/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift new file mode 100644 index 00000000..8a6ad550 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpatialNavigationSearchOptions: BridgedDictionary { + public convenience init(candidates: [Node]?, container: Node?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.candidates] = candidates.jsValue() + object[Strings.container] = container.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _candidates = ReadWriteAttribute(jsObject: object, name: Strings.candidates) + _container = ReadWriteAttribute(jsObject: object, name: Strings.container) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var candidates: [Node]? + + @ReadWriteAttribute + public var container: Node? +} diff --git a/Sources/DOMKit/WebIDL/SpeechGrammar.swift b/Sources/DOMKit/WebIDL/SpeechGrammar.swift new file mode 100644 index 00000000..c462f5ba --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechGrammar.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechGrammar: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SpeechGrammar].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) + _weight = ReadWriteAttribute(jsObject: jsObject, name: Strings.weight) + self.jsObject = jsObject + } + + @ReadWriteAttribute + public var src: String + + @ReadWriteAttribute + public var weight: Float +} diff --git a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift new file mode 100644 index 00000000..b1703962 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechGrammarList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SpeechGrammarList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> SpeechGrammar { + jsObject[key].fromJSValue()! + } + + public func addFromURI(src: String, weight: Float? = nil) { + _ = jsObject[Strings.addFromURI]!(src.jsValue(), weight?.jsValue() ?? .undefined) + } + + public func addFromString(string: String, weight: Float? = nil) { + _ = jsObject[Strings.addFromString]!(string.jsValue(), weight?.jsValue() ?? .undefined) + } +} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognition.swift b/Sources/DOMKit/WebIDL/SpeechRecognition.swift new file mode 100644 index 00000000..a5c2128a --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechRecognition.swift @@ -0,0 +1,92 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechRecognition: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognition].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _grammars = ReadWriteAttribute(jsObject: jsObject, name: Strings.grammars) + _lang = ReadWriteAttribute(jsObject: jsObject, name: Strings.lang) + _continuous = ReadWriteAttribute(jsObject: jsObject, name: Strings.continuous) + _interimResults = ReadWriteAttribute(jsObject: jsObject, name: Strings.interimResults) + _maxAlternatives = ReadWriteAttribute(jsObject: jsObject, name: Strings.maxAlternatives) + _onaudiostart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaudiostart) + _onsoundstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsoundstart) + _onspeechstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onspeechstart) + _onspeechend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onspeechend) + _onsoundend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsoundend) + _onaudioend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaudioend) + _onresult = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresult) + _onnomatch = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnomatch) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstart) + _onend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onend) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var grammars: SpeechGrammarList + + @ReadWriteAttribute + public var lang: String + + @ReadWriteAttribute + public var continuous: Bool + + @ReadWriteAttribute + public var interimResults: Bool + + @ReadWriteAttribute + public var maxAlternatives: UInt32 + + public func start() { + _ = jsObject[Strings.start]!() + } + + public func stop() { + _ = jsObject[Strings.stop]!() + } + + public func abort() { + _ = jsObject[Strings.abort]!() + } + + @ClosureAttribute.Optional1 + public var onaudiostart: EventHandler + + @ClosureAttribute.Optional1 + public var onsoundstart: EventHandler + + @ClosureAttribute.Optional1 + public var onspeechstart: EventHandler + + @ClosureAttribute.Optional1 + public var onspeechend: EventHandler + + @ClosureAttribute.Optional1 + public var onsoundend: EventHandler + + @ClosureAttribute.Optional1 + public var onaudioend: EventHandler + + @ClosureAttribute.Optional1 + public var onresult: EventHandler + + @ClosureAttribute.Optional1 + public var onnomatch: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onstart: EventHandler + + @ClosureAttribute.Optional1 + public var onend: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift new file mode 100644 index 00000000..aafa0121 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechRecognitionAlternative: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionAlternative].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _transcript = ReadonlyAttribute(jsObject: jsObject, name: Strings.transcript) + _confidence = ReadonlyAttribute(jsObject: jsObject, name: Strings.confidence) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var transcript: String + + @ReadonlyAttribute + public var confidence: Float +} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift new file mode 100644 index 00000000..cb71df05 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum SpeechRecognitionErrorCode: JSString, JSValueCompatible { + case noSpeech = "no-speech" + case aborted = "aborted" + case audioCapture = "audio-capture" + case network = "network" + case notAllowed = "not-allowed" + case serviceNotAllowed = "service-not-allowed" + case badGrammar = "bad-grammar" + case languageNotSupported = "language-not-supported" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift new file mode 100644 index 00000000..6f2c3edc --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechRecognitionErrorEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionErrorEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: SpeechRecognitionErrorEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var error: SpeechRecognitionErrorCode + + @ReadonlyAttribute + public var message: String +} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift new file mode 100644 index 00000000..307ef924 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechRecognitionErrorEventInit: BridgedDictionary { + public convenience init(error: SpeechRecognitionErrorCode, message: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.error] = error.jsValue() + object[Strings.message] = message.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _error = ReadWriteAttribute(jsObject: object, name: Strings.error) + _message = ReadWriteAttribute(jsObject: object, name: Strings.message) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var error: SpeechRecognitionErrorCode + + @ReadWriteAttribute + public var message: String +} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift new file mode 100644 index 00000000..6b0c1598 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechRecognitionEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _resultIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.resultIndex) + _results = ReadonlyAttribute(jsObject: jsObject, name: Strings.results) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: SpeechRecognitionEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var resultIndex: UInt32 + + @ReadonlyAttribute + public var results: SpeechRecognitionResultList +} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift new file mode 100644 index 00000000..26e5b81e --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechRecognitionEventInit: BridgedDictionary { + public convenience init(resultIndex: UInt32, results: SpeechRecognitionResultList) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.resultIndex] = resultIndex.jsValue() + object[Strings.results] = results.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _resultIndex = ReadWriteAttribute(jsObject: object, name: Strings.resultIndex) + _results = ReadWriteAttribute(jsObject: object, name: Strings.results) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var resultIndex: UInt32 + + @ReadWriteAttribute + public var results: SpeechRecognitionResultList +} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift new file mode 100644 index 00000000..5b2d2766 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechRecognitionResult: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionResult].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _isFinal = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFinal) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> SpeechRecognitionAlternative { + jsObject[key].fromJSValue()! + } + + @ReadonlyAttribute + public var isFinal: Bool +} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift new file mode 100644 index 00000000..acc20956 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechRecognitionResultList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionResultList].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 + + public subscript(key: Int) -> SpeechRecognitionResult { + jsObject[key].fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift new file mode 100644 index 00000000..9cb8a2e2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechSynthesis: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesis].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _pending = ReadonlyAttribute(jsObject: jsObject, name: Strings.pending) + _speaking = ReadonlyAttribute(jsObject: jsObject, name: Strings.speaking) + _paused = ReadonlyAttribute(jsObject: jsObject, name: Strings.paused) + _onvoiceschanged = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onvoiceschanged) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var pending: Bool + + @ReadonlyAttribute + public var speaking: Bool + + @ReadonlyAttribute + public var paused: Bool + + @ClosureAttribute.Optional1 + public var onvoiceschanged: EventHandler + + public func speak(utterance: SpeechSynthesisUtterance) { + _ = jsObject[Strings.speak]!(utterance.jsValue()) + } + + public func cancel() { + _ = jsObject[Strings.cancel]!() + } + + public func pause() { + _ = jsObject[Strings.pause]!() + } + + public func resume() { + _ = jsObject[Strings.resume]!() + } + + public func getVoices() -> [SpeechSynthesisVoice] { + jsObject[Strings.getVoices]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift new file mode 100644 index 00000000..17fef334 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum SpeechSynthesisErrorCode: JSString, JSValueCompatible { + case canceled = "canceled" + case interrupted = "interrupted" + case audioBusy = "audio-busy" + case audioHardware = "audio-hardware" + case network = "network" + case synthesisUnavailable = "synthesis-unavailable" + case synthesisFailed = "synthesis-failed" + case languageUnavailable = "language-unavailable" + case voiceUnavailable = "voice-unavailable" + case textTooLong = "text-too-long" + case invalidArgument = "invalid-argument" + case notAllowed = "not-allowed" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift new file mode 100644 index 00000000..ca11a410 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechSynthesisErrorEvent: SpeechSynthesisEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisErrorEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: SpeechSynthesisErrorEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var error: SpeechSynthesisErrorCode +} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift new file mode 100644 index 00000000..a5321a32 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechSynthesisErrorEventInit: BridgedDictionary { + public convenience init(error: SpeechSynthesisErrorCode) { + 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: SpeechSynthesisErrorCode +} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift new file mode 100644 index 00000000..2921f8ff --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechSynthesisEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _utterance = ReadonlyAttribute(jsObject: jsObject, name: Strings.utterance) + _charIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.charIndex) + _charLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.charLength) + _elapsedTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.elapsedTime) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: SpeechSynthesisEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var utterance: SpeechSynthesisUtterance + + @ReadonlyAttribute + public var charIndex: UInt32 + + @ReadonlyAttribute + public var charLength: UInt32 + + @ReadonlyAttribute + public var elapsedTime: Float + + @ReadonlyAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift new file mode 100644 index 00000000..ae75c8b6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechSynthesisEventInit: BridgedDictionary { + public convenience init(utterance: SpeechSynthesisUtterance, charIndex: UInt32, charLength: UInt32, elapsedTime: Float, name: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.utterance] = utterance.jsValue() + object[Strings.charIndex] = charIndex.jsValue() + object[Strings.charLength] = charLength.jsValue() + object[Strings.elapsedTime] = elapsedTime.jsValue() + object[Strings.name] = name.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _utterance = ReadWriteAttribute(jsObject: object, name: Strings.utterance) + _charIndex = ReadWriteAttribute(jsObject: object, name: Strings.charIndex) + _charLength = ReadWriteAttribute(jsObject: object, name: Strings.charLength) + _elapsedTime = ReadWriteAttribute(jsObject: object, name: Strings.elapsedTime) + _name = ReadWriteAttribute(jsObject: object, name: Strings.name) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var utterance: SpeechSynthesisUtterance + + @ReadWriteAttribute + public var charIndex: UInt32 + + @ReadWriteAttribute + public var charLength: UInt32 + + @ReadWriteAttribute + public var elapsedTime: Float + + @ReadWriteAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift new file mode 100644 index 00000000..9bf77255 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift @@ -0,0 +1,68 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechSynthesisUtterance: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisUtterance].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) + _lang = ReadWriteAttribute(jsObject: jsObject, name: Strings.lang) + _voice = ReadWriteAttribute(jsObject: jsObject, name: Strings.voice) + _volume = ReadWriteAttribute(jsObject: jsObject, name: Strings.volume) + _rate = ReadWriteAttribute(jsObject: jsObject, name: Strings.rate) + _pitch = ReadWriteAttribute(jsObject: jsObject, name: Strings.pitch) + _onstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstart) + _onend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onend) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onpause = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpause) + _onresume = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresume) + _onmark = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmark) + _onboundary = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onboundary) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(text: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(text?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var text: String + + @ReadWriteAttribute + public var lang: String + + @ReadWriteAttribute + public var voice: SpeechSynthesisVoice? + + @ReadWriteAttribute + public var volume: Float + + @ReadWriteAttribute + public var rate: Float + + @ReadWriteAttribute + public var pitch: Float + + @ClosureAttribute.Optional1 + public var onstart: EventHandler + + @ClosureAttribute.Optional1 + public var onend: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onpause: EventHandler + + @ClosureAttribute.Optional1 + public var onresume: EventHandler + + @ClosureAttribute.Optional1 + public var onmark: EventHandler + + @ClosureAttribute.Optional1 + public var onboundary: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift new file mode 100644 index 00000000..224f5db7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SpeechSynthesisVoice: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisVoice].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _voiceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.voiceURI) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _lang = ReadonlyAttribute(jsObject: jsObject, name: Strings.lang) + _localService = ReadonlyAttribute(jsObject: jsObject, name: Strings.localService) + _default = ReadonlyAttribute(jsObject: jsObject, name: Strings.default) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var voiceURI: String + + @ReadonlyAttribute + public var name: String + + @ReadonlyAttribute + public var lang: String + + @ReadonlyAttribute + public var localService: Bool + + @ReadonlyAttribute + public var `default`: Bool +} diff --git a/Sources/DOMKit/WebIDL/StaticRange.swift b/Sources/DOMKit/WebIDL/StaticRange.swift index 63a88d45..84ef8e5b 100644 --- a/Sources/DOMKit/WebIDL/StaticRange.swift +++ b/Sources/DOMKit/WebIDL/StaticRange.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class StaticRange: AbstractRange { - override public class var constructor: JSFunction { JSObject.global.StaticRange.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.StaticRange].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/StaticRangeInit.swift b/Sources/DOMKit/WebIDL/StaticRangeInit.swift index 1c05fc14..f85585a7 100644 --- a/Sources/DOMKit/WebIDL/StaticRangeInit.swift +++ b/Sources/DOMKit/WebIDL/StaticRangeInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class StaticRangeInit: BridgedDictionary { public convenience init(startContainer: Node, startOffset: UInt32, endContainer: Node, endOffset: UInt32) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.startContainer] = startContainer.jsValue() object[Strings.startOffset] = startOffset.jsValue() object[Strings.endContainer] = endContainer.jsValue() diff --git a/Sources/DOMKit/WebIDL/StereoPannerNode.swift b/Sources/DOMKit/WebIDL/StereoPannerNode.swift new file mode 100644 index 00000000..5039db82 --- /dev/null +++ b/Sources/DOMKit/WebIDL/StereoPannerNode.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StereoPannerNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.StereoPannerNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _pan = ReadonlyAttribute(jsObject: jsObject, name: Strings.pan) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: StereoPannerOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var pan: AudioParam +} diff --git a/Sources/DOMKit/WebIDL/StereoPannerOptions.swift b/Sources/DOMKit/WebIDL/StereoPannerOptions.swift new file mode 100644 index 00000000..5b21aed8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/StereoPannerOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StereoPannerOptions: BridgedDictionary { + public convenience init(pan: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.pan] = pan.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var pan: Float +} diff --git a/Sources/DOMKit/WebIDL/Storage.swift b/Sources/DOMKit/WebIDL/Storage.swift index 2acb5ed0..8b97a17d 100644 --- a/Sources/DOMKit/WebIDL/Storage.swift +++ b/Sources/DOMKit/WebIDL/Storage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Storage: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.Storage.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Storage].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/StorageEstimate.swift b/Sources/DOMKit/WebIDL/StorageEstimate.swift new file mode 100644 index 00000000..999adf1d --- /dev/null +++ b/Sources/DOMKit/WebIDL/StorageEstimate.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StorageEstimate: BridgedDictionary { + public convenience init(usage: UInt64, quota: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.usage] = usage.jsValue() + object[Strings.quota] = quota.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) + _quota = ReadWriteAttribute(jsObject: object, name: Strings.quota) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var usage: UInt64 + + @ReadWriteAttribute + public var quota: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift index faeaa503..7d0e43ca 100644 --- a/Sources/DOMKit/WebIDL/StorageEvent.swift +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class StorageEvent: Event { - override public class var constructor: JSFunction { JSObject.global.StorageEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.StorageEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) diff --git a/Sources/DOMKit/WebIDL/StorageEventInit.swift b/Sources/DOMKit/WebIDL/StorageEventInit.swift index 560b2c3e..91dac5dd 100644 --- a/Sources/DOMKit/WebIDL/StorageEventInit.swift +++ b/Sources/DOMKit/WebIDL/StorageEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class StorageEventInit: BridgedDictionary { public convenience init(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.key] = key.jsValue() object[Strings.oldValue] = oldValue.jsValue() object[Strings.newValue] = newValue.jsValue() diff --git a/Sources/DOMKit/WebIDL/StorageManager.swift b/Sources/DOMKit/WebIDL/StorageManager.swift new file mode 100644 index 00000000..a29bfca2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/StorageManager.swift @@ -0,0 +1,54 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StorageManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.StorageManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func persisted() -> JSPromise { + jsObject[Strings.persisted]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func persisted() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.persisted]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func persist() -> JSPromise { + jsObject[Strings.persist]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func persist() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.persist]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func estimate() -> JSPromise { + jsObject[Strings.estimate]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func estimate() async throws -> StorageEstimate { + let _promise: JSPromise = jsObject[Strings.estimate]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getDirectory() -> JSPromise { + jsObject[Strings.getDirectory]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDirectory() async throws -> FileSystemDirectoryHandle { + let _promise: JSPromise = jsObject[Strings.getDirectory]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift index 738cd57c..e2176195 100644 --- a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift +++ b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class StreamPipeOptions: BridgedDictionary { public convenience init(preventClose: Bool, preventAbort: Bool, preventCancel: Bool, signal: AbortSignal) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.preventClose] = preventClose.jsValue() object[Strings.preventAbort] = preventAbort.jsValue() object[Strings.preventCancel] = preventCancel.jsValue() diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index d3cd53f9..80381f54 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -5,60 +5,1168 @@ import JavaScriptKit enum Strings { static let _self: JSString = "self" + static let ANGLE_instanced_arrays: JSString = "ANGLE_instanced_arrays" + static let AbortController: JSString = "AbortController" + static let AbortSignal: JSString = "AbortSignal" + static let AbsoluteOrientationSensor: JSString = "AbsoluteOrientationSensor" + static let AbstractRange: JSString = "AbstractRange" + static let Accelerometer: JSString = "Accelerometer" static let AddSearchProvider: JSString = "AddSearchProvider" + static let AmbientLightSensor: JSString = "AmbientLightSensor" + static let AnalyserNode: JSString = "AnalyserNode" + static let Animation: JSString = "Animation" + static let AnimationEffect: JSString = "AnimationEffect" + static let AnimationEvent: JSString = "AnimationEvent" + static let AnimationNodeList: JSString = "AnimationNodeList" + static let AnimationPlaybackEvent: JSString = "AnimationPlaybackEvent" + static let AnimationTimeline: JSString = "AnimationTimeline" + static let AnimationWorkletGlobalScope: JSString = "AnimationWorkletGlobalScope" + static let Attr: JSString = "Attr" + static let AttributionReporting: JSString = "AttributionReporting" + static let AudioBuffer: JSString = "AudioBuffer" + static let AudioBufferSourceNode: JSString = "AudioBufferSourceNode" + static let AudioContext: JSString = "AudioContext" + static let AudioData: JSString = "AudioData" + static let AudioDecoder: JSString = "AudioDecoder" + static let AudioDestinationNode: JSString = "AudioDestinationNode" + static let AudioEncoder: JSString = "AudioEncoder" + static let AudioListener: JSString = "AudioListener" + static let AudioNode: JSString = "AudioNode" + static let AudioParam: JSString = "AudioParam" + static let AudioParamMap: JSString = "AudioParamMap" + static let AudioProcessingEvent: JSString = "AudioProcessingEvent" + static let AudioScheduledSourceNode: JSString = "AudioScheduledSourceNode" + static let AudioTrack: JSString = "AudioTrack" + static let AudioTrackList: JSString = "AudioTrackList" + static let AudioWorklet: JSString = "AudioWorklet" + static let AudioWorkletGlobalScope: JSString = "AudioWorkletGlobalScope" + static let AudioWorkletNode: JSString = "AudioWorkletNode" + static let AudioWorkletProcessor: JSString = "AudioWorkletProcessor" + static let AuthenticatorAssertionResponse: JSString = "AuthenticatorAssertionResponse" + static let AuthenticatorAttestationResponse: JSString = "AuthenticatorAttestationResponse" + static let AuthenticatorResponse: JSString = "AuthenticatorResponse" + static let BackgroundFetchEvent: JSString = "BackgroundFetchEvent" + static let BackgroundFetchManager: JSString = "BackgroundFetchManager" + static let BackgroundFetchRecord: JSString = "BackgroundFetchRecord" + static let BackgroundFetchRegistration: JSString = "BackgroundFetchRegistration" + static let BackgroundFetchUpdateUIEvent: JSString = "BackgroundFetchUpdateUIEvent" + static let BarProp: JSString = "BarProp" + static let BarcodeDetector: JSString = "BarcodeDetector" + static let BaseAudioContext: JSString = "BaseAudioContext" + static let Baseline: JSString = "Baseline" + static let BatteryManager: JSString = "BatteryManager" + static let BeforeInstallPromptEvent: JSString = "BeforeInstallPromptEvent" + static let BeforeUnloadEvent: JSString = "BeforeUnloadEvent" + static let BiquadFilterNode: JSString = "BiquadFilterNode" + static let Blob: JSString = "Blob" + static let BlobEvent: JSString = "BlobEvent" + static let Bluetooth: JSString = "Bluetooth" + static let BluetoothAdvertisingEvent: JSString = "BluetoothAdvertisingEvent" + static let BluetoothCharacteristicProperties: JSString = "BluetoothCharacteristicProperties" + static let BluetoothDevice: JSString = "BluetoothDevice" + static let BluetoothManufacturerDataMap: JSString = "BluetoothManufacturerDataMap" + static let BluetoothPermissionResult: JSString = "BluetoothPermissionResult" + static let BluetoothRemoteGATTCharacteristic: JSString = "BluetoothRemoteGATTCharacteristic" + static let BluetoothRemoteGATTDescriptor: JSString = "BluetoothRemoteGATTDescriptor" + static let BluetoothRemoteGATTServer: JSString = "BluetoothRemoteGATTServer" + static let BluetoothRemoteGATTService: JSString = "BluetoothRemoteGATTService" + static let BluetoothServiceDataMap: JSString = "BluetoothServiceDataMap" + static let BluetoothUUID: JSString = "BluetoothUUID" + static let BreakToken: JSString = "BreakToken" + static let BroadcastChannel: JSString = "BroadcastChannel" + static let BrowserCaptureMediaStreamTrack: JSString = "BrowserCaptureMediaStreamTrack" + static let ByteLengthQueuingStrategy: JSString = "ByteLengthQueuingStrategy" + static let CDATASection: JSString = "CDATASection" + static let CSPViolationReportBody: JSString = "CSPViolationReportBody" + static let CSS: JSString = "CSS" + static let CSSAnimation: JSString = "CSSAnimation" + static let CSSColor: JSString = "CSSColor" + static let CSSColorValue: JSString = "CSSColorValue" + static let CSSConditionRule: JSString = "CSSConditionRule" + static let CSSContainerRule: JSString = "CSSContainerRule" + static let CSSCounterStyleRule: JSString = "CSSCounterStyleRule" + static let CSSFontFaceRule: JSString = "CSSFontFaceRule" + static let CSSFontFeatureValuesMap: JSString = "CSSFontFeatureValuesMap" + static let CSSFontFeatureValuesRule: JSString = "CSSFontFeatureValuesRule" + static let CSSFontPaletteValuesRule: JSString = "CSSFontPaletteValuesRule" + static let CSSGroupingRule: JSString = "CSSGroupingRule" + static let CSSHSL: JSString = "CSSHSL" + static let CSSHWB: JSString = "CSSHWB" + static let CSSImageValue: JSString = "CSSImageValue" + static let CSSImportRule: JSString = "CSSImportRule" + static let CSSKeyframeRule: JSString = "CSSKeyframeRule" + static let CSSKeyframesRule: JSString = "CSSKeyframesRule" + static let CSSKeywordValue: JSString = "CSSKeywordValue" + static let CSSLCH: JSString = "CSSLCH" + static let CSSLab: JSString = "CSSLab" + static let CSSLayerBlockRule: JSString = "CSSLayerBlockRule" + static let CSSLayerStatementRule: JSString = "CSSLayerStatementRule" + static let CSSMarginRule: JSString = "CSSMarginRule" + static let CSSMathClamp: JSString = "CSSMathClamp" + static let CSSMathInvert: JSString = "CSSMathInvert" + static let CSSMathMax: JSString = "CSSMathMax" + static let CSSMathMin: JSString = "CSSMathMin" + static let CSSMathNegate: JSString = "CSSMathNegate" + static let CSSMathProduct: JSString = "CSSMathProduct" + static let CSSMathSum: JSString = "CSSMathSum" + static let CSSMathValue: JSString = "CSSMathValue" + static let CSSMatrixComponent: JSString = "CSSMatrixComponent" + static let CSSMediaRule: JSString = "CSSMediaRule" + static let CSSNamespaceRule: JSString = "CSSNamespaceRule" + static let CSSNestingRule: JSString = "CSSNestingRule" + static let CSSNumericArray: JSString = "CSSNumericArray" + static let CSSNumericValue: JSString = "CSSNumericValue" + static let CSSOKLCH: JSString = "CSSOKLCH" + static let CSSOKLab: JSString = "CSSOKLab" + static let CSSPageRule: JSString = "CSSPageRule" + static let CSSParserAtRule: JSString = "CSSParserAtRule" + static let CSSParserBlock: JSString = "CSSParserBlock" + static let CSSParserDeclaration: JSString = "CSSParserDeclaration" + static let CSSParserFunction: JSString = "CSSParserFunction" + static let CSSParserQualifiedRule: JSString = "CSSParserQualifiedRule" + static let CSSParserRule: JSString = "CSSParserRule" + static let CSSParserValue: JSString = "CSSParserValue" + static let CSSPerspective: JSString = "CSSPerspective" + static let CSSPropertyRule: JSString = "CSSPropertyRule" + static let CSSPseudoElement: JSString = "CSSPseudoElement" + static let CSSRGB: JSString = "CSSRGB" + static let CSSRotate: JSString = "CSSRotate" + static let CSSRule: JSString = "CSSRule" + static let CSSRuleList: JSString = "CSSRuleList" + static let CSSScale: JSString = "CSSScale" + static let CSSScrollTimelineRule: JSString = "CSSScrollTimelineRule" + static let CSSSkew: JSString = "CSSSkew" + static let CSSSkewX: JSString = "CSSSkewX" + static let CSSSkewY: JSString = "CSSSkewY" + static let CSSStyleDeclaration: JSString = "CSSStyleDeclaration" + static let CSSStyleRule: JSString = "CSSStyleRule" + static let CSSStyleSheet: JSString = "CSSStyleSheet" + static let CSSStyleValue: JSString = "CSSStyleValue" + static let CSSSupportsRule: JSString = "CSSSupportsRule" + static let CSSTransformComponent: JSString = "CSSTransformComponent" + static let CSSTransformValue: JSString = "CSSTransformValue" + static let CSSTransition: JSString = "CSSTransition" + static let CSSTranslate: JSString = "CSSTranslate" + static let CSSUnitValue: JSString = "CSSUnitValue" + static let CSSUnparsedValue: JSString = "CSSUnparsedValue" + static let CSSVariableReferenceValue: JSString = "CSSVariableReferenceValue" + static let CSSViewportRule: JSString = "CSSViewportRule" + static let Cache: JSString = "Cache" + static let CacheStorage: JSString = "CacheStorage" + static let CanMakePaymentEvent: JSString = "CanMakePaymentEvent" + static let CanvasCaptureMediaStreamTrack: JSString = "CanvasCaptureMediaStreamTrack" + static let CanvasFilter: JSString = "CanvasFilter" + static let CanvasGradient: JSString = "CanvasGradient" + static let CanvasPattern: JSString = "CanvasPattern" + static let CanvasRenderingContext2D: JSString = "CanvasRenderingContext2D" + static let CaretPosition: JSString = "CaretPosition" + static let ChannelMergerNode: JSString = "ChannelMergerNode" + static let ChannelSplitterNode: JSString = "ChannelSplitterNode" + static let CharacterBoundsUpdateEvent: JSString = "CharacterBoundsUpdateEvent" + static let CharacterData: JSString = "CharacterData" + static let ChildBreakToken: JSString = "ChildBreakToken" + static let Client: JSString = "Client" + static let Clients: JSString = "Clients" + static let Clipboard: JSString = "Clipboard" + static let ClipboardEvent: JSString = "ClipboardEvent" + static let ClipboardItem: JSString = "ClipboardItem" + static let CloseEvent: JSString = "CloseEvent" + static let CloseWatcher: JSString = "CloseWatcher" + static let Comment: JSString = "Comment" + static let CompositionEvent: JSString = "CompositionEvent" + static let CompressionStream: JSString = "CompressionStream" + static let ComputePressureObserver: JSString = "ComputePressureObserver" + static let ConstantSourceNode: JSString = "ConstantSourceNode" + static let ContactAddress: JSString = "ContactAddress" + static let ContactsManager: JSString = "ContactsManager" + static let ContentIndex: JSString = "ContentIndex" + static let ContentIndexEvent: JSString = "ContentIndexEvent" + static let ConvolverNode: JSString = "ConvolverNode" + static let CookieChangeEvent: JSString = "CookieChangeEvent" + static let CookieStore: JSString = "CookieStore" + static let CookieStoreManager: JSString = "CookieStoreManager" + static let CountQueuingStrategy: JSString = "CountQueuingStrategy" + static let CrashReportBody: JSString = "CrashReportBody" + static let Credential: JSString = "Credential" + static let CredentialsContainer: JSString = "CredentialsContainer" + static let CropTarget: JSString = "CropTarget" + static let Crypto: JSString = "Crypto" + static let CryptoKey: JSString = "CryptoKey" + static let CustomElementRegistry: JSString = "CustomElementRegistry" + static let CustomEvent: JSString = "CustomEvent" + static let CustomStateSet: JSString = "CustomStateSet" + static let DOMException: JSString = "DOMException" + static let DOMImplementation: JSString = "DOMImplementation" + static let DOMMatrix: JSString = "DOMMatrix" + static let DOMMatrixReadOnly: JSString = "DOMMatrixReadOnly" + static let DOMParser: JSString = "DOMParser" + static let DOMPoint: JSString = "DOMPoint" + static let DOMPointReadOnly: JSString = "DOMPointReadOnly" + static let DOMQuad: JSString = "DOMQuad" + static let DOMRect: JSString = "DOMRect" + static let DOMRectList: JSString = "DOMRectList" + static let DOMRectReadOnly: JSString = "DOMRectReadOnly" + static let DOMStringList: JSString = "DOMStringList" + static let DOMStringMap: JSString = "DOMStringMap" + static let DOMTokenList: JSString = "DOMTokenList" + static let DataCue: JSString = "DataCue" + static let DataTransfer: JSString = "DataTransfer" + static let DataTransferItem: JSString = "DataTransferItem" + static let DataTransferItemList: JSString = "DataTransferItemList" + static let DecompressionStream: JSString = "DecompressionStream" + static let DedicatedWorkerGlobalScope: JSString = "DedicatedWorkerGlobalScope" + static let DelayNode: JSString = "DelayNode" + static let DeprecationReportBody: JSString = "DeprecationReportBody" + static let DeviceMotionEvent: JSString = "DeviceMotionEvent" + static let DeviceMotionEventAcceleration: JSString = "DeviceMotionEventAcceleration" + static let DeviceMotionEventRotationRate: JSString = "DeviceMotionEventRotationRate" + static let DeviceOrientationEvent: JSString = "DeviceOrientationEvent" + static let DevicePosture: JSString = "DevicePosture" + static let DigitalGoodsService: JSString = "DigitalGoodsService" + static let Document: JSString = "Document" + static let DocumentFragment: JSString = "DocumentFragment" + static let DocumentTimeline: JSString = "DocumentTimeline" + static let DocumentType: JSString = "DocumentType" + static let DragEvent: JSString = "DragEvent" + static let DynamicsCompressorNode: JSString = "DynamicsCompressorNode" + static let EXT_blend_minmax: JSString = "EXT_blend_minmax" + static let EXT_clip_cull_distance: JSString = "EXT_clip_cull_distance" + static let EXT_color_buffer_float: JSString = "EXT_color_buffer_float" + static let EXT_color_buffer_half_float: JSString = "EXT_color_buffer_half_float" + static let EXT_disjoint_timer_query: JSString = "EXT_disjoint_timer_query" + static let EXT_disjoint_timer_query_webgl2: JSString = "EXT_disjoint_timer_query_webgl2" + static let EXT_float_blend: JSString = "EXT_float_blend" + static let EXT_frag_depth: JSString = "EXT_frag_depth" + static let EXT_sRGB: JSString = "EXT_sRGB" + static let EXT_shader_texture_lod: JSString = "EXT_shader_texture_lod" + static let EXT_texture_compression_bptc: JSString = "EXT_texture_compression_bptc" + static let EXT_texture_compression_rgtc: JSString = "EXT_texture_compression_rgtc" + static let EXT_texture_filter_anisotropic: JSString = "EXT_texture_filter_anisotropic" + static let EXT_texture_norm16: JSString = "EXT_texture_norm16" + static let EditContext: JSString = "EditContext" + static let Element: JSString = "Element" + static let ElementInternals: JSString = "ElementInternals" + static let EncodedAudioChunk: JSString = "EncodedAudioChunk" + static let EncodedVideoChunk: JSString = "EncodedVideoChunk" + static let ErrorEvent: JSString = "ErrorEvent" + static let Event: JSString = "Event" + static let EventCounts: JSString = "EventCounts" + static let EventSource: JSString = "EventSource" + static let EventTarget: JSString = "EventTarget" + static let ExtendableCookieChangeEvent: JSString = "ExtendableCookieChangeEvent" + static let ExtendableEvent: JSString = "ExtendableEvent" + static let ExtendableMessageEvent: JSString = "ExtendableMessageEvent" + static let External: JSString = "External" + static let EyeDropper: JSString = "EyeDropper" + static let FaceDetector: JSString = "FaceDetector" + static let FederatedCredential: JSString = "FederatedCredential" + static let FetchEvent: JSString = "FetchEvent" + static let File: JSString = "File" + static let FileList: JSString = "FileList" + static let FileReader: JSString = "FileReader" + static let FileReaderSync: JSString = "FileReaderSync" + static let FileSystem: JSString = "FileSystem" + static let FileSystemDirectoryEntry: JSString = "FileSystemDirectoryEntry" + static let FileSystemDirectoryHandle: JSString = "FileSystemDirectoryHandle" + static let FileSystemDirectoryReader: JSString = "FileSystemDirectoryReader" + static let FileSystemEntry: JSString = "FileSystemEntry" + static let FileSystemFileEntry: JSString = "FileSystemFileEntry" + static let FileSystemFileHandle: JSString = "FileSystemFileHandle" + static let FileSystemHandle: JSString = "FileSystemHandle" + static let FileSystemWritableFileStream: JSString = "FileSystemWritableFileStream" + static let FocusEvent: JSString = "FocusEvent" + static let Font: JSString = "Font" + static let FontFace: JSString = "FontFace" + static let FontFaceFeatures: JSString = "FontFaceFeatures" + static let FontFacePalette: JSString = "FontFacePalette" + static let FontFacePalettes: JSString = "FontFacePalettes" + static let FontFaceSet: JSString = "FontFaceSet" + static let FontFaceSetLoadEvent: JSString = "FontFaceSetLoadEvent" + static let FontFaceVariationAxis: JSString = "FontFaceVariationAxis" + static let FontFaceVariations: JSString = "FontFaceVariations" + static let FontManager: JSString = "FontManager" + static let FontMetadata: JSString = "FontMetadata" + static let FontMetrics: JSString = "FontMetrics" + static let FormData: JSString = "FormData" + static let FormDataEvent: JSString = "FormDataEvent" + static let FragmentDirective: JSString = "FragmentDirective" + static let FragmentResult: JSString = "FragmentResult" + static let GPU: JSString = "GPU" + static let GPUAdapter: JSString = "GPUAdapter" + static let GPUBindGroup: JSString = "GPUBindGroup" + static let GPUBindGroupLayout: JSString = "GPUBindGroupLayout" + static let GPUBuffer: JSString = "GPUBuffer" + static let GPUBufferUsage: JSString = "GPUBufferUsage" + static let GPUCanvasContext: JSString = "GPUCanvasContext" + static let GPUColorWrite: JSString = "GPUColorWrite" + static let GPUCommandBuffer: JSString = "GPUCommandBuffer" + static let GPUCommandEncoder: JSString = "GPUCommandEncoder" + static let GPUCompilationInfo: JSString = "GPUCompilationInfo" + static let GPUCompilationMessage: JSString = "GPUCompilationMessage" + static let GPUComputePassEncoder: JSString = "GPUComputePassEncoder" + static let GPUComputePipeline: JSString = "GPUComputePipeline" + static let GPUDevice: JSString = "GPUDevice" + static let GPUDeviceLostInfo: JSString = "GPUDeviceLostInfo" + static let GPUExternalTexture: JSString = "GPUExternalTexture" + static let GPUMapMode: JSString = "GPUMapMode" + static let GPUOutOfMemoryError: JSString = "GPUOutOfMemoryError" + static let GPUPipelineLayout: JSString = "GPUPipelineLayout" + static let GPUQuerySet: JSString = "GPUQuerySet" + static let GPUQueue: JSString = "GPUQueue" + static let GPURenderBundle: JSString = "GPURenderBundle" + static let GPURenderBundleEncoder: JSString = "GPURenderBundleEncoder" + static let GPURenderPassEncoder: JSString = "GPURenderPassEncoder" + static let GPURenderPipeline: JSString = "GPURenderPipeline" + static let GPUSampler: JSString = "GPUSampler" + static let GPUShaderModule: JSString = "GPUShaderModule" + static let GPUShaderStage: JSString = "GPUShaderStage" + static let GPUSupportedFeatures: JSString = "GPUSupportedFeatures" + static let GPUSupportedLimits: JSString = "GPUSupportedLimits" + static let GPUTexture: JSString = "GPUTexture" + static let GPUTextureUsage: JSString = "GPUTextureUsage" + static let GPUTextureView: JSString = "GPUTextureView" + static let GPUUncapturedErrorEvent: JSString = "GPUUncapturedErrorEvent" + static let GPUValidationError: JSString = "GPUValidationError" + static let GainNode: JSString = "GainNode" + static let Gamepad: JSString = "Gamepad" + static let GamepadButton: JSString = "GamepadButton" + static let GamepadEvent: JSString = "GamepadEvent" + static let GamepadHapticActuator: JSString = "GamepadHapticActuator" + static let GamepadPose: JSString = "GamepadPose" + static let GamepadTouch: JSString = "GamepadTouch" + static let Geolocation: JSString = "Geolocation" + static let GeolocationCoordinates: JSString = "GeolocationCoordinates" + static let GeolocationPosition: JSString = "GeolocationPosition" + static let GeolocationPositionError: JSString = "GeolocationPositionError" + static let GeolocationSensor: JSString = "GeolocationSensor" + static let Global: JSString = "Global" + static let GravitySensor: JSString = "GravitySensor" + static let GroupEffect: JSString = "GroupEffect" + static let Gyroscope: JSString = "Gyroscope" + static let HID: JSString = "HID" + static let HIDConnectionEvent: JSString = "HIDConnectionEvent" + static let HIDDevice: JSString = "HIDDevice" + static let HIDInputReportEvent: JSString = "HIDInputReportEvent" + static let HTMLAllCollection: JSString = "HTMLAllCollection" + static let HTMLAnchorElement: JSString = "HTMLAnchorElement" + static let HTMLAreaElement: JSString = "HTMLAreaElement" + static let HTMLAudioElement: JSString = "HTMLAudioElement" + static let HTMLBRElement: JSString = "HTMLBRElement" + static let HTMLBaseElement: JSString = "HTMLBaseElement" + static let HTMLBodyElement: JSString = "HTMLBodyElement" + static let HTMLButtonElement: JSString = "HTMLButtonElement" + static let HTMLCanvasElement: JSString = "HTMLCanvasElement" + static let HTMLCollection: JSString = "HTMLCollection" + static let HTMLDListElement: JSString = "HTMLDListElement" + static let HTMLDataElement: JSString = "HTMLDataElement" + static let HTMLDataListElement: JSString = "HTMLDataListElement" + static let HTMLDetailsElement: JSString = "HTMLDetailsElement" + static let HTMLDialogElement: JSString = "HTMLDialogElement" + static let HTMLDirectoryElement: JSString = "HTMLDirectoryElement" + static let HTMLDivElement: JSString = "HTMLDivElement" + static let HTMLElement: JSString = "HTMLElement" + static let HTMLEmbedElement: JSString = "HTMLEmbedElement" + static let HTMLFieldSetElement: JSString = "HTMLFieldSetElement" + static let HTMLFontElement: JSString = "HTMLFontElement" + static let HTMLFormControlsCollection: JSString = "HTMLFormControlsCollection" + static let HTMLFormElement: JSString = "HTMLFormElement" + static let HTMLFrameElement: JSString = "HTMLFrameElement" + static let HTMLFrameSetElement: JSString = "HTMLFrameSetElement" + static let HTMLHRElement: JSString = "HTMLHRElement" + static let HTMLHeadElement: JSString = "HTMLHeadElement" + static let HTMLHeadingElement: JSString = "HTMLHeadingElement" + static let HTMLHtmlElement: JSString = "HTMLHtmlElement" + static let HTMLIFrameElement: JSString = "HTMLIFrameElement" + static let HTMLImageElement: JSString = "HTMLImageElement" + static let HTMLInputElement: JSString = "HTMLInputElement" + static let HTMLLIElement: JSString = "HTMLLIElement" + static let HTMLLabelElement: JSString = "HTMLLabelElement" + static let HTMLLegendElement: JSString = "HTMLLegendElement" + static let HTMLLinkElement: JSString = "HTMLLinkElement" + static let HTMLMapElement: JSString = "HTMLMapElement" + static let HTMLMarqueeElement: JSString = "HTMLMarqueeElement" + static let HTMLMediaElement: JSString = "HTMLMediaElement" + static let HTMLMenuElement: JSString = "HTMLMenuElement" + static let HTMLMetaElement: JSString = "HTMLMetaElement" + static let HTMLMeterElement: JSString = "HTMLMeterElement" + static let HTMLModElement: JSString = "HTMLModElement" + static let HTMLOListElement: JSString = "HTMLOListElement" + static let HTMLObjectElement: JSString = "HTMLObjectElement" + static let HTMLOptGroupElement: JSString = "HTMLOptGroupElement" + static let HTMLOptionElement: JSString = "HTMLOptionElement" + static let HTMLOptionsCollection: JSString = "HTMLOptionsCollection" + static let HTMLOutputElement: JSString = "HTMLOutputElement" + static let HTMLParagraphElement: JSString = "HTMLParagraphElement" + static let HTMLParamElement: JSString = "HTMLParamElement" + static let HTMLPictureElement: JSString = "HTMLPictureElement" + static let HTMLPortalElement: JSString = "HTMLPortalElement" + static let HTMLPreElement: JSString = "HTMLPreElement" + static let HTMLProgressElement: JSString = "HTMLProgressElement" + static let HTMLQuoteElement: JSString = "HTMLQuoteElement" + static let HTMLScriptElement: JSString = "HTMLScriptElement" + static let HTMLSelectElement: JSString = "HTMLSelectElement" + static let HTMLSlotElement: JSString = "HTMLSlotElement" + static let HTMLSourceElement: JSString = "HTMLSourceElement" + static let HTMLSpanElement: JSString = "HTMLSpanElement" + static let HTMLStyleElement: JSString = "HTMLStyleElement" + static let HTMLTableCaptionElement: JSString = "HTMLTableCaptionElement" + static let HTMLTableCellElement: JSString = "HTMLTableCellElement" + static let HTMLTableColElement: JSString = "HTMLTableColElement" + static let HTMLTableElement: JSString = "HTMLTableElement" + static let HTMLTableRowElement: JSString = "HTMLTableRowElement" + static let HTMLTableSectionElement: JSString = "HTMLTableSectionElement" + static let HTMLTemplateElement: JSString = "HTMLTemplateElement" + static let HTMLTextAreaElement: JSString = "HTMLTextAreaElement" + static let HTMLTimeElement: JSString = "HTMLTimeElement" + static let HTMLTitleElement: JSString = "HTMLTitleElement" + static let HTMLTrackElement: JSString = "HTMLTrackElement" + static let HTMLUListElement: JSString = "HTMLUListElement" + static let HTMLUnknownElement: JSString = "HTMLUnknownElement" + static let HTMLVideoElement: JSString = "HTMLVideoElement" + static let HashChangeEvent: JSString = "HashChangeEvent" + static let Headers: JSString = "Headers" + static let Highlight: JSString = "Highlight" + static let HighlightRegistry: JSString = "HighlightRegistry" + static let History: JSString = "History" + static let Hz: JSString = "Hz" + static let IDBCursor: JSString = "IDBCursor" + static let IDBCursorWithValue: JSString = "IDBCursorWithValue" + static let IDBDatabase: JSString = "IDBDatabase" + static let IDBFactory: JSString = "IDBFactory" + static let IDBIndex: JSString = "IDBIndex" + static let IDBKeyRange: JSString = "IDBKeyRange" + static let IDBObjectStore: JSString = "IDBObjectStore" + static let IDBOpenDBRequest: JSString = "IDBOpenDBRequest" + static let IDBRequest: JSString = "IDBRequest" + static let IDBTransaction: JSString = "IDBTransaction" + static let IDBVersionChangeEvent: JSString = "IDBVersionChangeEvent" + static let IIRFilterNode: JSString = "IIRFilterNode" + static let IdleDeadline: JSString = "IdleDeadline" + static let IdleDetector: JSString = "IdleDetector" + static let ImageBitmap: JSString = "ImageBitmap" + static let ImageBitmapRenderingContext: JSString = "ImageBitmapRenderingContext" + static let ImageCapture: JSString = "ImageCapture" + static let ImageData: JSString = "ImageData" + static let ImageDecoder: JSString = "ImageDecoder" + static let ImageTrack: JSString = "ImageTrack" + static let ImageTrackList: JSString = "ImageTrackList" + static let Ink: JSString = "Ink" + static let InkPresenter: JSString = "InkPresenter" + static let InputDeviceCapabilities: JSString = "InputDeviceCapabilities" + static let InputDeviceInfo: JSString = "InputDeviceInfo" + static let InputEvent: JSString = "InputEvent" + static let Instance: JSString = "Instance" + static let InteractionCounts: JSString = "InteractionCounts" + static let IntersectionObserver: JSString = "IntersectionObserver" + static let IntersectionObserverEntry: JSString = "IntersectionObserverEntry" + static let InterventionReportBody: JSString = "InterventionReportBody" + static let IntrinsicSizes: JSString = "IntrinsicSizes" static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" + static let KHR_parallel_shader_compile: JSString = "KHR_parallel_shader_compile" + static let Keyboard: JSString = "Keyboard" + static let KeyboardEvent: JSString = "KeyboardEvent" + static let KeyboardLayoutMap: JSString = "KeyboardLayoutMap" + static let KeyframeEffect: JSString = "KeyframeEffect" + static let LargestContentfulPaint: JSString = "LargestContentfulPaint" + static let LayoutChild: JSString = "LayoutChild" + static let LayoutConstraints: JSString = "LayoutConstraints" + static let LayoutEdges: JSString = "LayoutEdges" + static let LayoutFragment: JSString = "LayoutFragment" + static let LayoutShift: JSString = "LayoutShift" + static let LayoutShiftAttribution: JSString = "LayoutShiftAttribution" + static let LayoutWorkletGlobalScope: JSString = "LayoutWorkletGlobalScope" + static let LinearAccelerationSensor: JSString = "LinearAccelerationSensor" + static let Location: JSString = "Location" + static let Lock: JSString = "Lock" + static let LockManager: JSString = "LockManager" + static let MIDIAccess: JSString = "MIDIAccess" + static let MIDIConnectionEvent: JSString = "MIDIConnectionEvent" + static let MIDIInput: JSString = "MIDIInput" + static let MIDIInputMap: JSString = "MIDIInputMap" + static let MIDIMessageEvent: JSString = "MIDIMessageEvent" + static let MIDIOutput: JSString = "MIDIOutput" + static let MIDIOutputMap: JSString = "MIDIOutputMap" + static let MIDIPort: JSString = "MIDIPort" + static let ML: JSString = "ML" + static let MLContext: JSString = "MLContext" + static let MLGraph: JSString = "MLGraph" + static let MLGraphBuilder: JSString = "MLGraphBuilder" + static let MLOperand: JSString = "MLOperand" + static let MLOperator: JSString = "MLOperator" + static let Magnetometer: JSString = "Magnetometer" + static let MathMLElement: JSString = "MathMLElement" + static let MediaCapabilities: JSString = "MediaCapabilities" + static let MediaDeviceInfo: JSString = "MediaDeviceInfo" + static let MediaDevices: JSString = "MediaDevices" + static let MediaElementAudioSourceNode: JSString = "MediaElementAudioSourceNode" + static let MediaEncryptedEvent: JSString = "MediaEncryptedEvent" + static let MediaError: JSString = "MediaError" + static let MediaKeyMessageEvent: JSString = "MediaKeyMessageEvent" + static let MediaKeySession: JSString = "MediaKeySession" + static let MediaKeyStatusMap: JSString = "MediaKeyStatusMap" + static let MediaKeySystemAccess: JSString = "MediaKeySystemAccess" + static let MediaKeys: JSString = "MediaKeys" + static let MediaList: JSString = "MediaList" + static let MediaMetadata: JSString = "MediaMetadata" + static let MediaQueryList: JSString = "MediaQueryList" + static let MediaQueryListEvent: JSString = "MediaQueryListEvent" + static let MediaRecorder: JSString = "MediaRecorder" + static let MediaRecorderErrorEvent: JSString = "MediaRecorderErrorEvent" + static let MediaSession: JSString = "MediaSession" + static let MediaSource: JSString = "MediaSource" + static let MediaStream: JSString = "MediaStream" + static let MediaStreamAudioDestinationNode: JSString = "MediaStreamAudioDestinationNode" + static let MediaStreamAudioSourceNode: JSString = "MediaStreamAudioSourceNode" + static let MediaStreamTrack: JSString = "MediaStreamTrack" + static let MediaStreamTrackAudioSourceNode: JSString = "MediaStreamTrackAudioSourceNode" + static let MediaStreamTrackEvent: JSString = "MediaStreamTrackEvent" + static let MediaStreamTrackProcessor: JSString = "MediaStreamTrackProcessor" + static let Memory: JSString = "Memory" + static let MessageChannel: JSString = "MessageChannel" + static let MessageEvent: JSString = "MessageEvent" + static let MessagePort: JSString = "MessagePort" + static let MimeType: JSString = "MimeType" + static let MimeTypeArray: JSString = "MimeTypeArray" + static let Module: JSString = "Module" + static let MouseEvent: JSString = "MouseEvent" + static let MutationEvent: JSString = "MutationEvent" + static let MutationObserver: JSString = "MutationObserver" + static let MutationRecord: JSString = "MutationRecord" + static let NDEFMessage: JSString = "NDEFMessage" + static let NDEFReader: JSString = "NDEFReader" + static let NDEFReadingEvent: JSString = "NDEFReadingEvent" + static let NDEFRecord: JSString = "NDEFRecord" + static let NamedFlow: JSString = "NamedFlow" + static let NamedFlowMap: JSString = "NamedFlowMap" + static let NamedNodeMap: JSString = "NamedNodeMap" + static let NavigateEvent: JSString = "NavigateEvent" + static let Navigation: JSString = "Navigation" + static let NavigationCurrentEntryChangeEvent: JSString = "NavigationCurrentEntryChangeEvent" + static let NavigationDestination: JSString = "NavigationDestination" + static let NavigationEvent: JSString = "NavigationEvent" + static let NavigationHistoryEntry: JSString = "NavigationHistoryEntry" + static let NavigationPreloadManager: JSString = "NavigationPreloadManager" + static let NavigationTransition: JSString = "NavigationTransition" + static let Navigator: JSString = "Navigator" + static let NavigatorUAData: JSString = "NavigatorUAData" + static let NetworkInformation: JSString = "NetworkInformation" + static let Node: JSString = "Node" + static let NodeIterator: JSString = "NodeIterator" + static let NodeList: JSString = "NodeList" + static let Notification: JSString = "Notification" + static let NotificationEvent: JSString = "NotificationEvent" + static let OES_draw_buffers_indexed: JSString = "OES_draw_buffers_indexed" + static let OES_element_index_uint: JSString = "OES_element_index_uint" + static let OES_fbo_render_mipmap: JSString = "OES_fbo_render_mipmap" + static let OES_standard_derivatives: JSString = "OES_standard_derivatives" + static let OES_texture_float: JSString = "OES_texture_float" + static let OES_texture_float_linear: JSString = "OES_texture_float_linear" + static let OES_texture_half_float: JSString = "OES_texture_half_float" + static let OES_texture_half_float_linear: JSString = "OES_texture_half_float_linear" + static let OES_vertex_array_object: JSString = "OES_vertex_array_object" + static let OTPCredential: JSString = "OTPCredential" + static let OVR_multiview2: JSString = "OVR_multiview2" + static let Object: JSString = "Object" + static let OfflineAudioCompletionEvent: JSString = "OfflineAudioCompletionEvent" + static let OfflineAudioContext: JSString = "OfflineAudioContext" + static let OffscreenCanvas: JSString = "OffscreenCanvas" + static let OffscreenCanvasRenderingContext2D: JSString = "OffscreenCanvasRenderingContext2D" + static let OrientationSensor: JSString = "OrientationSensor" + static let OscillatorNode: JSString = "OscillatorNode" + static let OverconstrainedError: JSString = "OverconstrainedError" + static let PageTransitionEvent: JSString = "PageTransitionEvent" + static let PaintRenderingContext2D: JSString = "PaintRenderingContext2D" + static let PaintSize: JSString = "PaintSize" + static let PaintWorkletGlobalScope: JSString = "PaintWorkletGlobalScope" + static let PannerNode: JSString = "PannerNode" + static let PasswordCredential: JSString = "PasswordCredential" + static let Path2D: JSString = "Path2D" + static let PaymentInstruments: JSString = "PaymentInstruments" + static let PaymentManager: JSString = "PaymentManager" + static let PaymentMethodChangeEvent: JSString = "PaymentMethodChangeEvent" + static let PaymentRequest: JSString = "PaymentRequest" + static let PaymentRequestEvent: JSString = "PaymentRequestEvent" + static let PaymentRequestUpdateEvent: JSString = "PaymentRequestUpdateEvent" + static let PaymentResponse: JSString = "PaymentResponse" + static let Performance: JSString = "Performance" + static let PerformanceElementTiming: JSString = "PerformanceElementTiming" + static let PerformanceEntry: JSString = "PerformanceEntry" + static let PerformanceEventTiming: JSString = "PerformanceEventTiming" + static let PerformanceLongTaskTiming: JSString = "PerformanceLongTaskTiming" + static let PerformanceMark: JSString = "PerformanceMark" + static let PerformanceMeasure: JSString = "PerformanceMeasure" + static let PerformanceNavigation: JSString = "PerformanceNavigation" + static let PerformanceNavigationTiming: JSString = "PerformanceNavigationTiming" + static let PerformanceObserver: JSString = "PerformanceObserver" + static let PerformanceObserverEntryList: JSString = "PerformanceObserverEntryList" + static let PerformancePaintTiming: JSString = "PerformancePaintTiming" + static let PerformanceResourceTiming: JSString = "PerformanceResourceTiming" + static let PerformanceServerTiming: JSString = "PerformanceServerTiming" + static let PerformanceTiming: JSString = "PerformanceTiming" + static let PeriodicSyncEvent: JSString = "PeriodicSyncEvent" + static let PeriodicSyncManager: JSString = "PeriodicSyncManager" + static let PeriodicWave: JSString = "PeriodicWave" + static let PermissionStatus: JSString = "PermissionStatus" + static let Permissions: JSString = "Permissions" + static let PermissionsPolicy: JSString = "PermissionsPolicy" + static let PermissionsPolicyViolationReportBody: JSString = "PermissionsPolicyViolationReportBody" + static let PictureInPictureEvent: JSString = "PictureInPictureEvent" + static let PictureInPictureWindow: JSString = "PictureInPictureWindow" + static let Plugin: JSString = "Plugin" + static let PluginArray: JSString = "PluginArray" + static let PointerEvent: JSString = "PointerEvent" + static let PopStateEvent: JSString = "PopStateEvent" + static let PortalActivateEvent: JSString = "PortalActivateEvent" + static let PortalHost: JSString = "PortalHost" + static let Presentation: JSString = "Presentation" + static let PresentationAvailability: JSString = "PresentationAvailability" + static let PresentationConnection: JSString = "PresentationConnection" + static let PresentationConnectionAvailableEvent: JSString = "PresentationConnectionAvailableEvent" + static let PresentationConnectionCloseEvent: JSString = "PresentationConnectionCloseEvent" + static let PresentationConnectionList: JSString = "PresentationConnectionList" + static let PresentationReceiver: JSString = "PresentationReceiver" + static let PresentationRequest: JSString = "PresentationRequest" + static let ProcessingInstruction: JSString = "ProcessingInstruction" + static let Profiler: JSString = "Profiler" + static let ProgressEvent: JSString = "ProgressEvent" + static let PromiseRejectionEvent: JSString = "PromiseRejectionEvent" + static let ProximitySensor: JSString = "ProximitySensor" + static let PublicKeyCredential: JSString = "PublicKeyCredential" + static let PushEvent: JSString = "PushEvent" + static let PushManager: JSString = "PushManager" + static let PushMessageData: JSString = "PushMessageData" + static let PushSubscription: JSString = "PushSubscription" + static let PushSubscriptionChangeEvent: JSString = "PushSubscriptionChangeEvent" + static let PushSubscriptionOptions: JSString = "PushSubscriptionOptions" + static let Q: JSString = "Q" + static let RTCCertificate: JSString = "RTCCertificate" + static let RTCDTMFSender: JSString = "RTCDTMFSender" + static let RTCDTMFToneChangeEvent: JSString = "RTCDTMFToneChangeEvent" + static let RTCDataChannel: JSString = "RTCDataChannel" + static let RTCDataChannelEvent: JSString = "RTCDataChannelEvent" + static let RTCDtlsTransport: JSString = "RTCDtlsTransport" + static let RTCEncodedAudioFrame: JSString = "RTCEncodedAudioFrame" + static let RTCEncodedVideoFrame: JSString = "RTCEncodedVideoFrame" + static let RTCError: JSString = "RTCError" + static let RTCErrorEvent: JSString = "RTCErrorEvent" + static let RTCIceCandidate: JSString = "RTCIceCandidate" + static let RTCIceTransport: JSString = "RTCIceTransport" + static let RTCIdentityAssertion: JSString = "RTCIdentityAssertion" + static let RTCIdentityProviderGlobalScope: JSString = "RTCIdentityProviderGlobalScope" + static let RTCIdentityProviderRegistrar: JSString = "RTCIdentityProviderRegistrar" + static let RTCPeerConnection: JSString = "RTCPeerConnection" + static let RTCPeerConnectionIceErrorEvent: JSString = "RTCPeerConnectionIceErrorEvent" + static let RTCPeerConnectionIceEvent: JSString = "RTCPeerConnectionIceEvent" + static let RTCRtpReceiver: JSString = "RTCRtpReceiver" + static let RTCRtpScriptTransform: JSString = "RTCRtpScriptTransform" + static let RTCRtpScriptTransformer: JSString = "RTCRtpScriptTransformer" + static let RTCRtpSender: JSString = "RTCRtpSender" + static let RTCRtpTransceiver: JSString = "RTCRtpTransceiver" + static let RTCSctpTransport: JSString = "RTCSctpTransport" + static let RTCSessionDescription: JSString = "RTCSessionDescription" + static let RTCStatsReport: JSString = "RTCStatsReport" + static let RTCTrackEvent: JSString = "RTCTrackEvent" + static let RTCTransformEvent: JSString = "RTCTransformEvent" + static let RadioNodeList: JSString = "RadioNodeList" + static let Range: JSString = "Range" + static let ReadableByteStreamController: JSString = "ReadableByteStreamController" + static let ReadableStream: JSString = "ReadableStream" + static let ReadableStreamBYOBReader: JSString = "ReadableStreamBYOBReader" + static let ReadableStreamBYOBRequest: JSString = "ReadableStreamBYOBRequest" + static let ReadableStreamDefaultController: JSString = "ReadableStreamDefaultController" + static let ReadableStreamDefaultReader: JSString = "ReadableStreamDefaultReader" + static let RelativeOrientationSensor: JSString = "RelativeOrientationSensor" + static let RemotePlayback: JSString = "RemotePlayback" + static let Report: JSString = "Report" + static let ReportBody: JSString = "ReportBody" + static let ReportingObserver: JSString = "ReportingObserver" + static let Request: JSString = "Request" + static let ResizeObserver: JSString = "ResizeObserver" + static let ResizeObserverEntry: JSString = "ResizeObserverEntry" + static let ResizeObserverSize: JSString = "ResizeObserverSize" + static let Response: JSString = "Response" + static let SFrameTransform: JSString = "SFrameTransform" + static let SFrameTransformErrorEvent: JSString = "SFrameTransformErrorEvent" + static let SVGAElement: JSString = "SVGAElement" + static let SVGAngle: JSString = "SVGAngle" + static let SVGAnimateElement: JSString = "SVGAnimateElement" + static let SVGAnimateMotionElement: JSString = "SVGAnimateMotionElement" + static let SVGAnimateTransformElement: JSString = "SVGAnimateTransformElement" + static let SVGAnimatedAngle: JSString = "SVGAnimatedAngle" + static let SVGAnimatedBoolean: JSString = "SVGAnimatedBoolean" + static let SVGAnimatedEnumeration: JSString = "SVGAnimatedEnumeration" + static let SVGAnimatedInteger: JSString = "SVGAnimatedInteger" + static let SVGAnimatedLength: JSString = "SVGAnimatedLength" + static let SVGAnimatedLengthList: JSString = "SVGAnimatedLengthList" + static let SVGAnimatedNumber: JSString = "SVGAnimatedNumber" + static let SVGAnimatedNumberList: JSString = "SVGAnimatedNumberList" + static let SVGAnimatedPreserveAspectRatio: JSString = "SVGAnimatedPreserveAspectRatio" + static let SVGAnimatedRect: JSString = "SVGAnimatedRect" + static let SVGAnimatedString: JSString = "SVGAnimatedString" + static let SVGAnimatedTransformList: JSString = "SVGAnimatedTransformList" + static let SVGAnimationElement: JSString = "SVGAnimationElement" + static let SVGCircleElement: JSString = "SVGCircleElement" + static let SVGClipPathElement: JSString = "SVGClipPathElement" + static let SVGComponentTransferFunctionElement: JSString = "SVGComponentTransferFunctionElement" + static let SVGDefsElement: JSString = "SVGDefsElement" + static let SVGDescElement: JSString = "SVGDescElement" + static let SVGDiscardElement: JSString = "SVGDiscardElement" + static let SVGElement: JSString = "SVGElement" + static let SVGEllipseElement: JSString = "SVGEllipseElement" + static let SVGFEBlendElement: JSString = "SVGFEBlendElement" + static let SVGFEColorMatrixElement: JSString = "SVGFEColorMatrixElement" + static let SVGFEComponentTransferElement: JSString = "SVGFEComponentTransferElement" + static let SVGFECompositeElement: JSString = "SVGFECompositeElement" + static let SVGFEConvolveMatrixElement: JSString = "SVGFEConvolveMatrixElement" + static let SVGFEDiffuseLightingElement: JSString = "SVGFEDiffuseLightingElement" + static let SVGFEDisplacementMapElement: JSString = "SVGFEDisplacementMapElement" + static let SVGFEDistantLightElement: JSString = "SVGFEDistantLightElement" + static let SVGFEDropShadowElement: JSString = "SVGFEDropShadowElement" + static let SVGFEFloodElement: JSString = "SVGFEFloodElement" + static let SVGFEFuncAElement: JSString = "SVGFEFuncAElement" + static let SVGFEFuncBElement: JSString = "SVGFEFuncBElement" + static let SVGFEFuncGElement: JSString = "SVGFEFuncGElement" + static let SVGFEFuncRElement: JSString = "SVGFEFuncRElement" + static let SVGFEGaussianBlurElement: JSString = "SVGFEGaussianBlurElement" + static let SVGFEImageElement: JSString = "SVGFEImageElement" + static let SVGFEMergeElement: JSString = "SVGFEMergeElement" + static let SVGFEMergeNodeElement: JSString = "SVGFEMergeNodeElement" + static let SVGFEMorphologyElement: JSString = "SVGFEMorphologyElement" + static let SVGFEOffsetElement: JSString = "SVGFEOffsetElement" + static let SVGFEPointLightElement: JSString = "SVGFEPointLightElement" + static let SVGFESpecularLightingElement: JSString = "SVGFESpecularLightingElement" + static let SVGFESpotLightElement: JSString = "SVGFESpotLightElement" + static let SVGFETileElement: JSString = "SVGFETileElement" + static let SVGFETurbulenceElement: JSString = "SVGFETurbulenceElement" + static let SVGFilterElement: JSString = "SVGFilterElement" + static let SVGForeignObjectElement: JSString = "SVGForeignObjectElement" + static let SVGGElement: JSString = "SVGGElement" + static let SVGGeometryElement: JSString = "SVGGeometryElement" + static let SVGGradientElement: JSString = "SVGGradientElement" + static let SVGGraphicsElement: JSString = "SVGGraphicsElement" + static let SVGImageElement: JSString = "SVGImageElement" + static let SVGLength: JSString = "SVGLength" + static let SVGLengthList: JSString = "SVGLengthList" + static let SVGLineElement: JSString = "SVGLineElement" + static let SVGLinearGradientElement: JSString = "SVGLinearGradientElement" + static let SVGMPathElement: JSString = "SVGMPathElement" + static let SVGMarkerElement: JSString = "SVGMarkerElement" + static let SVGMaskElement: JSString = "SVGMaskElement" + static let SVGMetadataElement: JSString = "SVGMetadataElement" + static let SVGNumber: JSString = "SVGNumber" + static let SVGNumberList: JSString = "SVGNumberList" + static let SVGPathElement: JSString = "SVGPathElement" + static let SVGPatternElement: JSString = "SVGPatternElement" + static let SVGPointList: JSString = "SVGPointList" + static let SVGPolygonElement: JSString = "SVGPolygonElement" + static let SVGPolylineElement: JSString = "SVGPolylineElement" + static let SVGPreserveAspectRatio: JSString = "SVGPreserveAspectRatio" + static let SVGRadialGradientElement: JSString = "SVGRadialGradientElement" + static let SVGRectElement: JSString = "SVGRectElement" + static let SVGSVGElement: JSString = "SVGSVGElement" + static let SVGScriptElement: JSString = "SVGScriptElement" + static let SVGSetElement: JSString = "SVGSetElement" + static let SVGStopElement: JSString = "SVGStopElement" + static let SVGStringList: JSString = "SVGStringList" + static let SVGStyleElement: JSString = "SVGStyleElement" + static let SVGSwitchElement: JSString = "SVGSwitchElement" + static let SVGSymbolElement: JSString = "SVGSymbolElement" + static let SVGTSpanElement: JSString = "SVGTSpanElement" + static let SVGTextContentElement: JSString = "SVGTextContentElement" + static let SVGTextElement: JSString = "SVGTextElement" + static let SVGTextPathElement: JSString = "SVGTextPathElement" + static let SVGTextPositioningElement: JSString = "SVGTextPositioningElement" + static let SVGTitleElement: JSString = "SVGTitleElement" + static let SVGTransform: JSString = "SVGTransform" + static let SVGTransformList: JSString = "SVGTransformList" + static let SVGUnitTypes: JSString = "SVGUnitTypes" + static let SVGUseElement: JSString = "SVGUseElement" + static let SVGUseElementShadowRoot: JSString = "SVGUseElementShadowRoot" + static let SVGViewElement: JSString = "SVGViewElement" + static let Sanitizer: JSString = "Sanitizer" + static let Scheduler: JSString = "Scheduler" + static let Scheduling: JSString = "Scheduling" + static let Screen: JSString = "Screen" + static let ScreenOrientation: JSString = "ScreenOrientation" + static let ScriptProcessorNode: JSString = "ScriptProcessorNode" + static let ScriptingPolicyReportBody: JSString = "ScriptingPolicyReportBody" + static let ScrollTimeline: JSString = "ScrollTimeline" + static let SecurityPolicyViolationEvent: JSString = "SecurityPolicyViolationEvent" + static let Selection: JSString = "Selection" + static let Sensor: JSString = "Sensor" + static let SensorErrorEvent: JSString = "SensorErrorEvent" + static let SequenceEffect: JSString = "SequenceEffect" + static let Serial: JSString = "Serial" + static let SerialPort: JSString = "SerialPort" + static let ServiceWorker: JSString = "ServiceWorker" + static let ServiceWorkerContainer: JSString = "ServiceWorkerContainer" + static let ServiceWorkerGlobalScope: JSString = "ServiceWorkerGlobalScope" + static let ServiceWorkerRegistration: JSString = "ServiceWorkerRegistration" + static let ShadowAnimation: JSString = "ShadowAnimation" + static let ShadowRoot: JSString = "ShadowRoot" + static let SharedWorker: JSString = "SharedWorker" + static let SharedWorkerGlobalScope: JSString = "SharedWorkerGlobalScope" + static let SourceBuffer: JSString = "SourceBuffer" + static let SourceBufferList: JSString = "SourceBufferList" + static let SpeechGrammar: JSString = "SpeechGrammar" + static let SpeechGrammarList: JSString = "SpeechGrammarList" + static let SpeechRecognition: JSString = "SpeechRecognition" + static let SpeechRecognitionAlternative: JSString = "SpeechRecognitionAlternative" + static let SpeechRecognitionErrorEvent: JSString = "SpeechRecognitionErrorEvent" + static let SpeechRecognitionEvent: JSString = "SpeechRecognitionEvent" + static let SpeechRecognitionResult: JSString = "SpeechRecognitionResult" + static let SpeechRecognitionResultList: JSString = "SpeechRecognitionResultList" + static let SpeechSynthesis: JSString = "SpeechSynthesis" + static let SpeechSynthesisErrorEvent: JSString = "SpeechSynthesisErrorEvent" + static let SpeechSynthesisEvent: JSString = "SpeechSynthesisEvent" + static let SpeechSynthesisUtterance: JSString = "SpeechSynthesisUtterance" + static let SpeechSynthesisVoice: JSString = "SpeechSynthesisVoice" + static let StaticRange: JSString = "StaticRange" + static let StereoPannerNode: JSString = "StereoPannerNode" + static let Storage: JSString = "Storage" + static let StorageEvent: JSString = "StorageEvent" + static let StorageManager: JSString = "StorageManager" + static let StylePropertyMap: JSString = "StylePropertyMap" + static let StylePropertyMapReadOnly: JSString = "StylePropertyMapReadOnly" + static let StyleSheet: JSString = "StyleSheet" + static let StyleSheetList: JSString = "StyleSheetList" + static let SubmitEvent: JSString = "SubmitEvent" + static let SubtleCrypto: JSString = "SubtleCrypto" + static let SyncEvent: JSString = "SyncEvent" + static let SyncManager: JSString = "SyncManager" + static let Table: JSString = "Table" + static let TaskAttributionTiming: JSString = "TaskAttributionTiming" + static let TaskController: JSString = "TaskController" + static let TaskPriorityChangeEvent: JSString = "TaskPriorityChangeEvent" + static let TaskSignal: JSString = "TaskSignal" + static let TestUtils: JSString = "TestUtils" + static let Text: JSString = "Text" + static let TextDecoder: JSString = "TextDecoder" + static let TextDecoderStream: JSString = "TextDecoderStream" + static let TextDetector: JSString = "TextDetector" + static let TextEncoder: JSString = "TextEncoder" + static let TextEncoderStream: JSString = "TextEncoderStream" + static let TextFormat: JSString = "TextFormat" + static let TextFormatUpdateEvent: JSString = "TextFormatUpdateEvent" + static let TextMetrics: JSString = "TextMetrics" + static let TextTrack: JSString = "TextTrack" + static let TextTrackCue: JSString = "TextTrackCue" + static let TextTrackCueList: JSString = "TextTrackCueList" + static let TextTrackList: JSString = "TextTrackList" + static let TextUpdateEvent: JSString = "TextUpdateEvent" + static let TimeEvent: JSString = "TimeEvent" + static let TimeRanges: JSString = "TimeRanges" + static let Touch: JSString = "Touch" + static let TouchEvent: JSString = "TouchEvent" + static let TouchList: JSString = "TouchList" + static let TrackEvent: JSString = "TrackEvent" + static let TransformStream: JSString = "TransformStream" + static let TransformStreamDefaultController: JSString = "TransformStreamDefaultController" + static let TransitionEvent: JSString = "TransitionEvent" + static let TreeWalker: JSString = "TreeWalker" + static let TrustedHTML: JSString = "TrustedHTML" + static let TrustedScript: JSString = "TrustedScript" + static let TrustedScriptURL: JSString = "TrustedScriptURL" + static let TrustedTypePolicy: JSString = "TrustedTypePolicy" + static let TrustedTypePolicyFactory: JSString = "TrustedTypePolicyFactory" + static let UIEvent: JSString = "UIEvent" static let URL: JSString = "URL" + static let URLPattern: JSString = "URLPattern" + static let URLSearchParams: JSString = "URLSearchParams" + static let USB: JSString = "USB" + static let USBAlternateInterface: JSString = "USBAlternateInterface" + static let USBConfiguration: JSString = "USBConfiguration" + static let USBConnectionEvent: JSString = "USBConnectionEvent" + static let USBDevice: JSString = "USBDevice" + static let USBEndpoint: JSString = "USBEndpoint" + static let USBInTransferResult: JSString = "USBInTransferResult" + static let USBInterface: JSString = "USBInterface" + static let USBIsochronousInTransferPacket: JSString = "USBIsochronousInTransferPacket" + static let USBIsochronousInTransferResult: JSString = "USBIsochronousInTransferResult" + static let USBIsochronousOutTransferPacket: JSString = "USBIsochronousOutTransferPacket" + static let USBIsochronousOutTransferResult: JSString = "USBIsochronousOutTransferResult" + static let USBOutTransferResult: JSString = "USBOutTransferResult" + static let USBPermissionResult: JSString = "USBPermissionResult" + static let UncalibratedMagnetometer: JSString = "UncalibratedMagnetometer" + static let VTTCue: JSString = "VTTCue" + static let VTTRegion: JSString = "VTTRegion" + static let ValidityState: JSString = "ValidityState" + static let ValueEvent: JSString = "ValueEvent" + static let VideoColorSpace: JSString = "VideoColorSpace" + static let VideoDecoder: JSString = "VideoDecoder" + static let VideoEncoder: JSString = "VideoEncoder" + static let VideoFrame: JSString = "VideoFrame" + static let VideoPlaybackQuality: JSString = "VideoPlaybackQuality" + static let VideoTrack: JSString = "VideoTrack" + static let VideoTrackGenerator: JSString = "VideoTrackGenerator" + static let VideoTrackList: JSString = "VideoTrackList" + static let VirtualKeyboard: JSString = "VirtualKeyboard" + static let VisualViewport: JSString = "VisualViewport" + static let WEBGL_blend_equation_advanced_coherent: JSString = "WEBGL_blend_equation_advanced_coherent" + static let WEBGL_color_buffer_float: JSString = "WEBGL_color_buffer_float" + static let WEBGL_compressed_texture_astc: JSString = "WEBGL_compressed_texture_astc" + static let WEBGL_compressed_texture_etc: JSString = "WEBGL_compressed_texture_etc" + static let WEBGL_compressed_texture_etc1: JSString = "WEBGL_compressed_texture_etc1" + static let WEBGL_compressed_texture_pvrtc: JSString = "WEBGL_compressed_texture_pvrtc" + static let WEBGL_compressed_texture_s3tc: JSString = "WEBGL_compressed_texture_s3tc" + static let WEBGL_compressed_texture_s3tc_srgb: JSString = "WEBGL_compressed_texture_s3tc_srgb" + static let WEBGL_debug_renderer_info: JSString = "WEBGL_debug_renderer_info" + static let WEBGL_debug_shaders: JSString = "WEBGL_debug_shaders" + static let WEBGL_depth_texture: JSString = "WEBGL_depth_texture" + static let WEBGL_draw_buffers: JSString = "WEBGL_draw_buffers" + static let WEBGL_draw_instanced_base_vertex_base_instance: JSString = "WEBGL_draw_instanced_base_vertex_base_instance" + static let WEBGL_lose_context: JSString = "WEBGL_lose_context" + static let WEBGL_multi_draw: JSString = "WEBGL_multi_draw" + static let WEBGL_multi_draw_instanced_base_vertex_base_instance: JSString = "WEBGL_multi_draw_instanced_base_vertex_base_instance" + static let WakeLock: JSString = "WakeLock" + static let WakeLockSentinel: JSString = "WakeLockSentinel" + static let WaveShaperNode: JSString = "WaveShaperNode" + static let WebAssembly: JSString = "WebAssembly" + static let WebGL2RenderingContext: JSString = "WebGL2RenderingContext" + static let WebGLActiveInfo: JSString = "WebGLActiveInfo" + static let WebGLBuffer: JSString = "WebGLBuffer" + static let WebGLContextEvent: JSString = "WebGLContextEvent" + static let WebGLFramebuffer: JSString = "WebGLFramebuffer" + static let WebGLObject: JSString = "WebGLObject" + static let WebGLProgram: JSString = "WebGLProgram" + static let WebGLQuery: JSString = "WebGLQuery" + static let WebGLRenderbuffer: JSString = "WebGLRenderbuffer" + static let WebGLRenderingContext: JSString = "WebGLRenderingContext" + static let WebGLSampler: JSString = "WebGLSampler" + static let WebGLShader: JSString = "WebGLShader" + static let WebGLShaderPrecisionFormat: JSString = "WebGLShaderPrecisionFormat" + static let WebGLSync: JSString = "WebGLSync" + static let WebGLTexture: JSString = "WebGLTexture" + static let WebGLTimerQueryEXT: JSString = "WebGLTimerQueryEXT" + static let WebGLTransformFeedback: JSString = "WebGLTransformFeedback" + static let WebGLUniformLocation: JSString = "WebGLUniformLocation" + static let WebGLVertexArrayObject: JSString = "WebGLVertexArrayObject" + static let WebGLVertexArrayObjectOES: JSString = "WebGLVertexArrayObjectOES" + static let WebSocket: JSString = "WebSocket" + static let WebTransport: JSString = "WebTransport" + static let WebTransportBidirectionalStream: JSString = "WebTransportBidirectionalStream" + static let WebTransportDatagramDuplexStream: JSString = "WebTransportDatagramDuplexStream" + static let WebTransportError: JSString = "WebTransportError" + static let WheelEvent: JSString = "WheelEvent" + static let Window: JSString = "Window" + static let WindowClient: JSString = "WindowClient" + static let WindowControlsOverlay: JSString = "WindowControlsOverlay" + static let WindowControlsOverlayGeometryChangeEvent: JSString = "WindowControlsOverlayGeometryChangeEvent" + static let Worker: JSString = "Worker" + static let WorkerGlobalScope: JSString = "WorkerGlobalScope" + static let WorkerLocation: JSString = "WorkerLocation" + static let WorkerNavigator: JSString = "WorkerNavigator" + static let Worklet: JSString = "Worklet" + static let WorkletAnimation: JSString = "WorkletAnimation" + static let WorkletAnimationEffect: JSString = "WorkletAnimationEffect" + static let WorkletGlobalScope: JSString = "WorkletGlobalScope" + static let WorkletGroupEffect: JSString = "WorkletGroupEffect" + static let WritableStream: JSString = "WritableStream" + static let WritableStreamDefaultController: JSString = "WritableStreamDefaultController" + static let WritableStreamDefaultWriter: JSString = "WritableStreamDefaultWriter" + static let XMLDocument: JSString = "XMLDocument" + static let XMLHttpRequest: JSString = "XMLHttpRequest" + static let XMLHttpRequestEventTarget: JSString = "XMLHttpRequestEventTarget" + static let XMLHttpRequestUpload: JSString = "XMLHttpRequestUpload" + static let XMLSerializer: JSString = "XMLSerializer" + static let XPathEvaluator: JSString = "XPathEvaluator" + static let XPathExpression: JSString = "XPathExpression" + static let XPathResult: JSString = "XPathResult" + static let XRAnchor: JSString = "XRAnchor" + static let XRAnchorSet: JSString = "XRAnchorSet" + static let XRBoundedReferenceSpace: JSString = "XRBoundedReferenceSpace" + static let XRCPUDepthInformation: JSString = "XRCPUDepthInformation" + static let XRCompositionLayer: JSString = "XRCompositionLayer" + static let XRCubeLayer: JSString = "XRCubeLayer" + static let XRCylinderLayer: JSString = "XRCylinderLayer" + static let XRDepthInformation: JSString = "XRDepthInformation" + static let XREquirectLayer: JSString = "XREquirectLayer" + static let XRFrame: JSString = "XRFrame" + static let XRHand: JSString = "XRHand" + static let XRHitTestResult: JSString = "XRHitTestResult" + static let XRHitTestSource: JSString = "XRHitTestSource" + static let XRInputSource: JSString = "XRInputSource" + static let XRInputSourceArray: JSString = "XRInputSourceArray" + static let XRInputSourceEvent: JSString = "XRInputSourceEvent" + static let XRInputSourcesChangeEvent: JSString = "XRInputSourcesChangeEvent" + static let XRJointPose: JSString = "XRJointPose" + static let XRJointSpace: JSString = "XRJointSpace" + static let XRLayer: JSString = "XRLayer" + static let XRLayerEvent: JSString = "XRLayerEvent" + static let XRLightEstimate: JSString = "XRLightEstimate" + static let XRLightProbe: JSString = "XRLightProbe" + static let XRMediaBinding: JSString = "XRMediaBinding" + static let XRPermissionStatus: JSString = "XRPermissionStatus" + static let XRPose: JSString = "XRPose" + static let XRProjectionLayer: JSString = "XRProjectionLayer" + static let XRQuadLayer: JSString = "XRQuadLayer" + static let XRRay: JSString = "XRRay" + static let XRReferenceSpace: JSString = "XRReferenceSpace" + static let XRReferenceSpaceEvent: JSString = "XRReferenceSpaceEvent" + static let XRRenderState: JSString = "XRRenderState" + static let XRRigidTransform: JSString = "XRRigidTransform" + static let XRSession: JSString = "XRSession" + static let XRSessionEvent: JSString = "XRSessionEvent" + static let XRSpace: JSString = "XRSpace" + static let XRSubImage: JSString = "XRSubImage" + static let XRSystem: JSString = "XRSystem" + static let XRTransientInputHitTestResult: JSString = "XRTransientInputHitTestResult" + static let XRTransientInputHitTestSource: JSString = "XRTransientInputHitTestSource" + static let XRView: JSString = "XRView" + static let XRViewerPose: JSString = "XRViewerPose" + static let XRViewport: JSString = "XRViewport" + static let XRWebGLBinding: JSString = "XRWebGLBinding" + static let XRWebGLDepthInformation: JSString = "XRWebGLDepthInformation" + static let XRWebGLLayer: JSString = "XRWebGLLayer" + static let XRWebGLSubImage: JSString = "XRWebGLSubImage" + static let XSLTProcessor: JSString = "XSLTProcessor" static let a: JSString = "a" static let aLink: JSString = "aLink" + static let aTranspose: JSString = "aTranspose" static let abbr: JSString = "abbr" static let abort: JSString = "abort" static let aborted: JSString = "aborted" + static let abs: JSString = "abs" + static let absolute: JSString = "absolute" + static let acceleration: JSString = "acceleration" + static let accelerationIncludingGravity: JSString = "accelerationIncludingGravity" static let accept: JSString = "accept" + static let acceptAllDevices: JSString = "acceptAllDevices" static let acceptCharset: JSString = "acceptCharset" + static let access: JSString = "access" static let accessKey: JSString = "accessKey" static let accessKeyLabel: JSString = "accessKeyLabel" + static let accuracy: JSString = "accuracy" static let action: JSString = "action" + static let actions: JSString = "actions" + static let activate: JSString = "activate" + static let activated: JSString = "activated" + static let activation: JSString = "activation" + static let activations: JSString = "activations" + static let active: JSString = "active" static let activeCues: JSString = "activeCues" + static let activeDuration: JSString = "activeDuration" static let activeElement: JSString = "activeElement" + static let activeSourceBuffers: JSString = "activeSourceBuffers" + static let activeTexture: JSString = "activeTexture" static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" static let actualBoundingBoxRight: JSString = "actualBoundingBoxRight" static let add: JSString = "add" + static let addAll: JSString = "addAll" static let addColorStop: JSString = "addColorStop" static let addCue: JSString = "addCue" + static let addFromString: JSString = "addFromString" + static let addFromURI: JSString = "addFromURI" + static let addIceCandidate: JSString = "addIceCandidate" + static let addListener: JSString = "addListener" static let addModule: JSString = "addModule" static let addPath: JSString = "addPath" + static let addRange: JSString = "addRange" + static let addRemoteCandidate: JSString = "addRemoteCandidate" static let addRule: JSString = "addRule" + static let addSourceBuffer: JSString = "addSourceBuffer" static let addTextTrack: JSString = "addTextTrack" + static let addTrack: JSString = "addTrack" + static let addTransceiver: JSString = "addTransceiver" + static let added: JSString = "added" static let addedNodes: JSString = "addedNodes" + static let additionalData: JSString = "additionalData" + static let additionalDisplayItems: JSString = "additionalDisplayItems" + static let additiveSymbols: JSString = "additiveSymbols" + static let address: JSString = "address" + static let addressLine: JSString = "addressLine" + static let addressModeU: JSString = "addressModeU" + static let addressModeV: JSString = "addressModeV" + static let addressModeW: JSString = "addressModeW" static let adoptNode: JSString = "adoptNode" + static let adoptPredecessor: JSString = "adoptPredecessor" static let adoptedStyleSheets: JSString = "adoptedStyleSheets" + static let advance: JSString = "advance" + static let advanced: JSString = "advanced" + static let advances: JSString = "advances" static let after: JSString = "after" + static let album: JSString = "album" static let alert: JSString = "alert" + static let alg: JSString = "alg" + static let algorithm: JSString = "algorithm" static let align: JSString = "align" static let alinkColor: JSString = "alinkColor" static let all: JSString = "all" + static let allocationSize: JSString = "allocationSize" static let allow: JSString = "allow" + static let allowAttributes: JSString = "allowAttributes" + static let allowComments: JSString = "allowComments" + static let allowCredentials: JSString = "allowCredentials" + static let allowCustomElements: JSString = "allowCustomElements" + static let allowElements: JSString = "allowElements" static let allowFullscreen: JSString = "allowFullscreen" + static let allowPooling: JSString = "allowPooling" + static let allowWithoutGesture: JSString = "allowWithoutGesture" + static let allowedDevices: JSString = "allowedDevices" + static let allowedFeatures: JSString = "allowedFeatures" + static let allowedManufacturerData: JSString = "allowedManufacturerData" + static let allowedServices: JSString = "allowedServices" + static let allowsFeature: JSString = "allowsFeature" static let alpha: JSString = "alpha" + static let alphaSideData: JSString = "alphaSideData" + static let alphaToCoverageEnabled: JSString = "alphaToCoverageEnabled" static let alphabeticBaseline: JSString = "alphabeticBaseline" static let alt: JSString = "alt" static let altKey: JSString = "altKey" + static let alternate: JSString = "alternate" + static let alternateSetting: JSString = "alternateSetting" + static let alternates: JSString = "alternates" + static let altitude: JSString = "altitude" + static let altitudeAccuracy: JSString = "altitudeAccuracy" + static let altitudeAngle: JSString = "altitudeAngle" + static let amount: JSString = "amount" + static let amplitude: JSString = "amplitude" static let ancestorOrigins: JSString = "ancestorOrigins" + static let anchorNode: JSString = "anchorNode" + static let anchorOffset: JSString = "anchorOffset" + static let anchorSpace: JSString = "anchorSpace" static let anchors: JSString = "anchors" + static let angle: JSString = "angle" + static let angularAcceleration: JSString = "angularAcceleration" + static let angularVelocity: JSString = "angularVelocity" + static let animVal: JSString = "animVal" + static let animate: JSString = "animate" + static let animated: JSString = "animated" + static let animatedInstanceRoot: JSString = "animatedInstanceRoot" + static let animatedPoints: JSString = "animatedPoints" + static let animationName: JSString = "animationName" + static let animationWorklet: JSString = "animationWorklet" + static let animationsPaused: JSString = "animationsPaused" + static let animatorName: JSString = "animatorName" + static let annotation: JSString = "annotation" + static let antialias: JSString = "antialias" + static let anticipatedRemoval: JSString = "anticipatedRemoval" static let appCodeName: JSString = "appCodeName" static let appName: JSString = "appName" static let appVersion: JSString = "appVersion" + static let appearance: JSString = "appearance" static let append: JSString = "append" + static let appendBuffer: JSString = "appendBuffer" static let appendChild: JSString = "appendChild" static let appendData: JSString = "appendData" + static let appendItem: JSString = "appendItem" static let appendMedium: JSString = "appendMedium" + static let appendRule: JSString = "appendRule" + static let appendWindowEnd: JSString = "appendWindowEnd" + static let appendWindowStart: JSString = "appendWindowStart" + static let appid: JSString = "appid" + static let appidExclude: JSString = "appidExclude" static let applets: JSString = "applets" + static let applicationServerKey: JSString = "applicationServerKey" + static let applyConstraints: JSString = "applyConstraints" static let arc: JSString = "arc" static let arcTo: JSString = "arcTo" + static let architecture: JSString = "architecture" static let archive: JSString = "archive" static let areas: JSString = "areas" + static let args: JSString = "args" static let ariaAtomic: JSString = "ariaAtomic" static let ariaAutoComplete: JSString = "ariaAutoComplete" static let ariaBusy: JSString = "ariaBusy" @@ -100,294 +1208,1129 @@ enum Strings { static let ariaValueNow: JSString = "ariaValueNow" static let ariaValueText: JSString = "ariaValueText" static let arrayBuffer: JSString = "arrayBuffer" + static let arrayLayerCount: JSString = "arrayLayerCount" + static let arrayStride: JSString = "arrayStride" + static let artist: JSString = "artist" + static let artwork: JSString = "artwork" static let `as`: JSString = "as" + static let ascentOverride: JSString = "ascentOverride" + static let aspect: JSString = "aspect" + static let aspectRatio: JSString = "aspectRatio" static let assert: JSString = "assert" + static let assertion: JSString = "assertion" static let assign: JSString = "assign" static let assignedElements: JSString = "assignedElements" static let assignedNodes: JSString = "assignedNodes" static let assignedSlot: JSString = "assignedSlot" static let async: JSString = "async" + static let atRules: JSString = "atRules" static let atob: JSString = "atob" static let attachInternals: JSString = "attachInternals" + static let attachShader: JSString = "attachShader" static let attachShadow: JSString = "attachShadow" + static let attachedElements: JSString = "attachedElements" + static let attack: JSString = "attack" + static let attestation: JSString = "attestation" + static let attestationObject: JSString = "attestationObject" static let attrChange: JSString = "attrChange" static let attrName: JSString = "attrName" static let attributeFilter: JSString = "attributeFilter" static let attributeName: JSString = "attributeName" static let attributeNamespace: JSString = "attributeNamespace" static let attributeOldValue: JSString = "attributeOldValue" + static let attributeStyleMap: JSString = "attributeStyleMap" static let attributes: JSString = "attributes" + static let attribution: JSString = "attribution" + static let attributionDestination: JSString = "attributionDestination" + static let attributionExpiry: JSString = "attributionExpiry" + static let attributionReportTo: JSString = "attributionReportTo" + static let attributionReporting: JSString = "attributionReporting" + static let attributionSourceEventId: JSString = "attributionSourceEventId" + static let attributionSourceId: JSString = "attributionSourceId" + static let attributionSourcePriority: JSString = "attributionSourcePriority" + static let audio: JSString = "audio" + static let audioBitrateMode: JSString = "audioBitrateMode" + static let audioBitsPerSecond: JSString = "audioBitsPerSecond" + static let audioCapabilities: JSString = "audioCapabilities" + static let audioLevel: JSString = "audioLevel" static let audioTracks: JSString = "audioTracks" + static let audioWorklet: JSString = "audioWorklet" + static let authenticatedSignedWrites: JSString = "authenticatedSignedWrites" + static let authenticatorAttachment: JSString = "authenticatorAttachment" + static let authenticatorData: JSString = "authenticatorData" + static let authenticatorSelection: JSString = "authenticatorSelection" static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" + static let autoBlockSize: JSString = "autoBlockSize" + static let autoGainControl: JSString = "autoGainControl" + static let autoIncrement: JSString = "autoIncrement" + static let autoPad: JSString = "autoPad" + static let autoPictureInPicture: JSString = "autoPictureInPicture" static let autocapitalize: JSString = "autocapitalize" static let autocomplete: JSString = "autocomplete" static let autofocus: JSString = "autofocus" + static let automationRate: JSString = "automationRate" static let autoplay: JSString = "autoplay" + static let availHeight: JSString = "availHeight" + static let availWidth: JSString = "availWidth" + static let availableBlockSize: JSString = "availableBlockSize" + static let availableIncomingBitrate: JSString = "availableIncomingBitrate" + static let availableInlineSize: JSString = "availableInlineSize" + static let availableOutgoingBitrate: JSString = "availableOutgoingBitrate" + static let averagePool2d: JSString = "averagePool2d" + static let averageRtcpInterval: JSString = "averageRtcpInterval" + static let ax: JSString = "ax" + static let axes: JSString = "axes" static let axis: JSString = "axis" + static let axisTag: JSString = "axisTag" + static let ay: JSString = "ay" + static let azimuth: JSString = "azimuth" + static let azimuthAngle: JSString = "azimuthAngle" static let b: JSString = "b" + static let bTranspose: JSString = "bTranspose" static let back: JSString = "back" static let background: JSString = "background" + static let backgroundColor: JSString = "backgroundColor" + static let backgroundFetch: JSString = "backgroundFetch" static let badInput: JSString = "badInput" + static let badge: JSString = "badge" + static let base64Certificate: JSString = "base64Certificate" + static let baseArrayLayer: JSString = "baseArrayLayer" + static let baseFrequencyX: JSString = "baseFrequencyX" + static let baseFrequencyY: JSString = "baseFrequencyY" + static let baseLatency: JSString = "baseLatency" + static let baseLayer: JSString = "baseLayer" + static let baseMipLevel: JSString = "baseMipLevel" + static let basePalette: JSString = "basePalette" static let baseURI: JSString = "baseURI" static let baseURL: JSString = "baseURL" + static let baseVal: JSString = "baseVal" + static let baselines: JSString = "baselines" + static let batchNormalization: JSString = "batchNormalization" + static let baudRate: JSString = "baudRate" static let before: JSString = "before" + static let beginComputePass: JSString = "beginComputePass" + static let beginElement: JSString = "beginElement" + static let beginElementAt: JSString = "beginElementAt" + static let beginOcclusionQuery: JSString = "beginOcclusionQuery" static let beginPath: JSString = "beginPath" + static let beginQuery: JSString = "beginQuery" + static let beginQueryEXT: JSString = "beginQueryEXT" + static let beginRenderPass: JSString = "beginRenderPass" + static let beginTransformFeedback: JSString = "beginTransformFeedback" static let behavior: JSString = "behavior" + static let beta: JSString = "beta" static let bezierCurveTo: JSString = "bezierCurveTo" static let bgColor: JSString = "bgColor" + static let bias: JSString = "bias" + static let binaryType: JSString = "binaryType" + static let bindAttribLocation: JSString = "bindAttribLocation" + static let bindBuffer: JSString = "bindBuffer" + static let bindBufferBase: JSString = "bindBufferBase" + static let bindBufferRange: JSString = "bindBufferRange" + static let bindFramebuffer: JSString = "bindFramebuffer" + static let bindGroupLayouts: JSString = "bindGroupLayouts" + static let bindRenderbuffer: JSString = "bindRenderbuffer" + static let bindSampler: JSString = "bindSampler" + static let bindTexture: JSString = "bindTexture" + static let bindTransformFeedback: JSString = "bindTransformFeedback" + static let bindVertexArray: JSString = "bindVertexArray" + static let bindVertexArrayOES: JSString = "bindVertexArrayOES" + static let binding: JSString = "binding" + static let bitDepth: JSString = "bitDepth" + static let bitness: JSString = "bitness" + static let bitrate: JSString = "bitrate" + static let bitrateMode: JSString = "bitrateMode" + static let bitsPerSecond: JSString = "bitsPerSecond" + static let blend: JSString = "blend" + static let blendColor: JSString = "blendColor" + static let blendEquation: JSString = "blendEquation" + static let blendEquationSeparate: JSString = "blendEquationSeparate" + static let blendEquationSeparateiOES: JSString = "blendEquationSeparateiOES" + static let blendEquationiOES: JSString = "blendEquationiOES" + static let blendFunc: JSString = "blendFunc" + static let blendFuncSeparate: JSString = "blendFuncSeparate" + static let blendFuncSeparateiOES: JSString = "blendFuncSeparateiOES" + static let blendFunciOES: JSString = "blendFunciOES" + static let blendTextureSourceAlpha: JSString = "blendTextureSourceAlpha" + static let blitFramebuffer: JSString = "blitFramebuffer" static let blob: JSString = "blob" + static let block: JSString = "block" + static let blockElements: JSString = "blockElements" + static let blockEnd: JSString = "blockEnd" + static let blockFragmentationOffset: JSString = "blockFragmentationOffset" + static let blockFragmentationType: JSString = "blockFragmentationType" + static let blockOffset: JSString = "blockOffset" + static let blockSize: JSString = "blockSize" + static let blockStart: JSString = "blockStart" + static let blockedURI: JSString = "blockedURI" + static let blockedURL: JSString = "blockedURL" static let blocking: JSString = "blocking" + static let bluetooth: JSString = "bluetooth" static let blur: JSString = "blur" static let body: JSString = "body" static let bodyUsed: JSString = "bodyUsed" static let booleanValue: JSString = "booleanValue" static let border: JSString = "border" + static let borderBoxSize: JSString = "borderBoxSize" static let bottom: JSString = "bottom" + static let bound: JSString = "bound" + static let boundingBox: JSString = "boundingBox" + static let boundingBoxAscent: JSString = "boundingBoxAscent" + static let boundingBoxDescent: JSString = "boundingBoxDescent" + static let boundingBoxLeft: JSString = "boundingBoxLeft" + static let boundingBoxRight: JSString = "boundingBoxRight" + static let boundingClientRect: JSString = "boundingClientRect" + static let boundingRect: JSString = "boundingRect" + static let boundsGeometry: JSString = "boundsGeometry" + static let box: JSString = "box" + static let brand: JSString = "brand" + static let brands: JSString = "brands" + static let break: JSString = "break" + static let breakToken: JSString = "breakToken" + static let breakType: JSString = "breakType" + static let breakdown: JSString = "breakdown" + static let brightness: JSString = "brightness" + static let broadcast: JSString = "broadcast" static let btoa: JSString = "btoa" static let bubbles: JSString = "bubbles" + static let buffer: JSString = "buffer" + static let bufferData: JSString = "bufferData" + static let bufferSize: JSString = "bufferSize" + static let bufferSubData: JSString = "bufferSubData" static let buffered: JSString = "buffered" + static let bufferedAmount: JSString = "bufferedAmount" + static let bufferedAmountLowThreshold: JSString = "bufferedAmountLowThreshold" + static let buffers: JSString = "buffers" + static let build: JSString = "build" + static let bundlePolicy: JSString = "bundlePolicy" + static let burstDiscardCount: JSString = "burstDiscardCount" + static let burstDiscardRate: JSString = "burstDiscardRate" + static let burstLossCount: JSString = "burstLossCount" + static let burstLossRate: JSString = "burstLossRate" + static let burstPacketsDiscarded: JSString = "burstPacketsDiscarded" + static let burstPacketsLost: JSString = "burstPacketsLost" static let button: JSString = "button" static let buttons: JSString = "buttons" static let byobRequest: JSString = "byobRequest" + static let byteLength: JSString = "byteLength" + static let bytes: JSString = "bytes" + static let bytesDiscardedOnSend: JSString = "bytesDiscardedOnSend" + static let bytesPerRow: JSString = "bytesPerRow" + static let bytesReceived: JSString = "bytesReceived" + static let bytesSent: JSString = "bytesSent" + static let bytesWritten: JSString = "bytesWritten" static let c: JSString = "c" static let cache: JSString = "cache" + static let cacheName: JSString = "cacheName" + static let caches: JSString = "caches" + static let canConstructInDedicatedWorker: JSString = "canConstructInDedicatedWorker" + static let canGoBack: JSString = "canGoBack" + static let canGoForward: JSString = "canGoForward" + static let canInsertDTMF: JSString = "canInsertDTMF" + static let canMakePayment: JSString = "canMakePayment" static let canPlayType: JSString = "canPlayType" + static let canShare: JSString = "canShare" + static let canTransition: JSString = "canTransition" + static let canTrickleIceCandidates: JSString = "canTrickleIceCandidates" static let cancel: JSString = "cancel" + static let cancelAndHoldAtTime: JSString = "cancelAndHoldAtTime" static let cancelAnimationFrame: JSString = "cancelAnimationFrame" static let cancelBubble: JSString = "cancelBubble" + static let cancelIdleCallback: JSString = "cancelIdleCallback" + static let cancelScheduledValues: JSString = "cancelScheduledValues" + static let cancelVideoFrameCallback: JSString = "cancelVideoFrameCallback" + static let cancelWatchAvailability: JSString = "cancelWatchAvailability" static let cancelable: JSString = "cancelable" + static let candidate: JSString = "candidate" + static let candidateType: JSString = "candidateType" + static let candidates: JSString = "candidates" + static let canonicalUUID: JSString = "canonicalUUID" static let canvas: JSString = "canvas" static let caption: JSString = "caption" static let capture: JSString = "capture" static let captureEvents: JSString = "captureEvents" + static let captureStream: JSString = "captureStream" + static let captureTime: JSString = "captureTime" + static let caretPositionFromPoint: JSString = "caretPositionFromPoint" + static let category: JSString = "category" + static let ceil: JSString = "ceil" static let cellIndex: JSString = "cellIndex" static let cellPadding: JSString = "cellPadding" static let cellSpacing: JSString = "cellSpacing" static let cells: JSString = "cells" + static let centralAngle: JSString = "centralAngle" + static let centralHorizontalAngle: JSString = "centralHorizontalAngle" + static let certificates: JSString = "certificates" static let ch: JSString = "ch" static let chOff: JSString = "chOff" + static let challenge: JSString = "challenge" + static let changePaymentMethod: JSString = "changePaymentMethod" + static let changeType: JSString = "changeType" + static let changed: JSString = "changed" + static let changedTouches: JSString = "changedTouches" + static let channel: JSString = "channel" + static let channelCount: JSString = "channelCount" + static let channelCountMode: JSString = "channelCountMode" + static let channelInterpretation: JSString = "channelInterpretation" + static let channels: JSString = "channels" static let charCode: JSString = "charCode" + static let charIndex: JSString = "charIndex" + static let charLength: JSString = "charLength" + static let characterBounds: JSString = "characterBounds" + static let characterBoundsRangeStart: JSString = "characterBoundsRangeStart" static let characterData: JSString = "characterData" static let characterDataOldValue: JSString = "characterDataOldValue" static let characterSet: JSString = "characterSet" + static let characterVariant: JSString = "characterVariant" + static let characteristic: JSString = "characteristic" + static let charging: JSString = "charging" + static let chargingTime: JSString = "chargingTime" static let charset: JSString = "charset" + static let check: JSString = "check" + static let checkEnclosure: JSString = "checkEnclosure" + static let checkFramebufferStatus: JSString = "checkFramebufferStatus" + static let checkIntersection: JSString = "checkIntersection" static let checkValidity: JSString = "checkValidity" static let checked: JSString = "checked" + static let child: JSString = "child" + static let childBreakTokens: JSString = "childBreakTokens" + static let childDisplay: JSString = "childDisplay" static let childElementCount: JSString = "childElementCount" + static let childFragments: JSString = "childFragments" static let childList: JSString = "childList" static let childNodes: JSString = "childNodes" static let children: JSString = "children" + static let chromaticAberrationCorrection: JSString = "chromaticAberrationCorrection" + static let circuitBreakerTriggerCount: JSString = "circuitBreakerTriggerCount" static let cite: JSString = "cite" + static let city: JSString = "city" + static let claim: JSString = "claim" + static let claimInterface: JSString = "claimInterface" + static let claimed: JSString = "claimed" + static let clamp: JSString = "clamp" + static let classCode: JSString = "classCode" static let classList: JSString = "classList" static let className: JSString = "className" static let clear: JSString = "clear" + static let clearAppBadge: JSString = "clearAppBadge" + static let clearBuffer: JSString = "clearBuffer" + static let clearBufferfi: JSString = "clearBufferfi" + static let clearBufferfv: JSString = "clearBufferfv" + static let clearBufferiv: JSString = "clearBufferiv" + static let clearBufferuiv: JSString = "clearBufferuiv" + static let clearClientBadge: JSString = "clearClientBadge" + static let clearColor: JSString = "clearColor" static let clearData: JSString = "clearData" + static let clearDepth: JSString = "clearDepth" + static let clearHalt: JSString = "clearHalt" static let clearInterval: JSString = "clearInterval" + static let clearLiveSeekableRange: JSString = "clearLiveSeekableRange" + static let clearMarks: JSString = "clearMarks" + static let clearMeasures: JSString = "clearMeasures" static let clearParameters: JSString = "clearParameters" static let clearRect: JSString = "clearRect" + static let clearResourceTimings: JSString = "clearResourceTimings" + static let clearStencil: JSString = "clearStencil" static let clearTimeout: JSString = "clearTimeout" + static let clearToSend: JSString = "clearToSend" + static let clearValue: JSString = "clearValue" + static let clearWatch: JSString = "clearWatch" static let click: JSString = "click" + static let clientDataJSON: JSString = "clientDataJSON" + static let clientHeight: JSString = "clientHeight" + static let clientId: JSString = "clientId" static let clientInformation: JSString = "clientInformation" + static let clientLeft: JSString = "clientLeft" + static let clientTop: JSString = "clientTop" + static let clientWaitSync: JSString = "clientWaitSync" + static let clientWidth: JSString = "clientWidth" static let clientX: JSString = "clientX" static let clientY: JSString = "clientY" + static let clients: JSString = "clients" static let clip: JSString = "clip" + static let clipPathUnits: JSString = "clipPathUnits" + static let clipboard: JSString = "clipboard" + static let clipboardData: JSString = "clipboardData" + static let clipped: JSString = "clipped" + static let clockRate: JSString = "clockRate" static let clone: JSString = "clone" static let cloneContents: JSString = "cloneContents" static let cloneNode: JSString = "cloneNode" static let cloneRange: JSString = "cloneRange" static let close: JSString = "close" + static let closeCode: JSString = "closeCode" static let closePath: JSString = "closePath" static let closed: JSString = "closed" static let closest: JSString = "closest" + static let cm: JSString = "cm" + static let cmp: JSString = "cmp" + static let cname: JSString = "cname" + static let coalescedEvents: JSString = "coalescedEvents" static let code: JSString = "code" static let codeBase: JSString = "codeBase" static let codeType: JSString = "codeType" + static let codec: JSString = "codec" + static let codecId: JSString = "codecId" + static let codecType: JSString = "codecType" + static let codecs: JSString = "codecs" + static let codedHeight: JSString = "codedHeight" + static let codedRect: JSString = "codedRect" + static let codedWidth: JSString = "codedWidth" static let colSpan: JSString = "colSpan" static let collapse: JSString = "collapse" + static let collapseToEnd: JSString = "collapseToEnd" + static let collapseToStart: JSString = "collapseToStart" static let collapsed: JSString = "collapsed" + static let collections: JSString = "collections" static let colno: JSString = "colno" static let color: JSString = "color" + static let colorAttachments: JSString = "colorAttachments" + static let colorDepth: JSString = "colorDepth" + static let colorFormat: JSString = "colorFormat" + static let colorFormats: JSString = "colorFormats" + static let colorGamut: JSString = "colorGamut" + static let colorMask: JSString = "colorMask" + static let colorMaskiOES: JSString = "colorMaskiOES" static let colorSpace: JSString = "colorSpace" static let colorSpaceConversion: JSString = "colorSpaceConversion" + static let colorTemperature: JSString = "colorTemperature" + static let colorTexture: JSString = "colorTexture" static let cols: JSString = "cols" + static let column: JSString = "column" + static let columnNumber: JSString = "columnNumber" static let commit: JSString = "commit" + static let commitStyles: JSString = "commitStyles" + static let committed: JSString = "committed" static let commonAncestorContainer: JSString = "commonAncestorContainer" static let compact: JSString = "compact" + static let companyIdentifier: JSString = "companyIdentifier" + static let compare: JSString = "compare" static let compareBoundaryPoints: JSString = "compareBoundaryPoints" static let compareDocumentPosition: JSString = "compareDocumentPosition" static let comparePoint: JSString = "comparePoint" static let compatMode: JSString = "compatMode" + static let compilationInfo: JSString = "compilationInfo" + static let compile: JSString = "compile" + static let compileShader: JSString = "compileShader" + static let compileStreaming: JSString = "compileStreaming" static let complete: JSString = "complete" + static let completeFramesOnly: JSString = "completeFramesOnly" + static let completed: JSString = "completed" + static let component: JSString = "component" static let composed: JSString = "composed" static let composedPath: JSString = "composedPath" + static let composite: JSString = "composite" + static let compositingAlphaMode: JSString = "compositingAlphaMode" + static let compositionEnd: JSString = "compositionEnd" + static let compositionRangeEnd: JSString = "compositionRangeEnd" + static let compositionRangeStart: JSString = "compositionRangeStart" + static let compositionStart: JSString = "compositionStart" + static let compressedTexImage2D: JSString = "compressedTexImage2D" + static let compressedTexImage3D: JSString = "compressedTexImage3D" + static let compressedTexSubImage2D: JSString = "compressedTexSubImage2D" + static let compressedTexSubImage3D: JSString = "compressedTexSubImage3D" + static let compute: JSString = "compute" + static let computedOffset: JSString = "computedOffset" + static let computedStyleMap: JSString = "computedStyleMap" + static let concat: JSString = "concat" + static let concealedSamples: JSString = "concealedSamples" + static let concealmentEvents: JSString = "concealmentEvents" static let conditionText: JSString = "conditionText" + static let coneInnerAngle: JSString = "coneInnerAngle" + static let coneOuterAngle: JSString = "coneOuterAngle" + static let coneOuterGain: JSString = "coneOuterGain" + static let confidence: JSString = "confidence" + static let config: JSString = "config" + static let configuration: JSString = "configuration" + static let configurationName: JSString = "configurationName" + static let configurationValue: JSString = "configurationValue" + static let configurations: JSString = "configurations" + static let configure: JSString = "configure" static let confirm: JSString = "confirm" + static let congestionWindow: JSString = "congestionWindow" + static let connect: JSString = "connect" + static let connectEnd: JSString = "connectEnd" + static let connectStart: JSString = "connectStart" + static let connected: JSString = "connected" + static let connection: JSString = "connection" + static let connectionList: JSString = "connectionList" + static let connectionState: JSString = "connectionState" + static let connections: JSString = "connections" + static let consentExpiredTimestamp: JSString = "consentExpiredTimestamp" + static let consentRequestBytesSent: JSString = "consentRequestBytesSent" + static let consentRequestsSent: JSString = "consentRequestsSent" + static let console: JSString = "console" + static let consolidate: JSString = "consolidate" + static let constant: JSString = "constant" + static let constants: JSString = "constants" + static let constraint: JSString = "constraint" + static let consume: JSString = "consume" + static let contacts: JSString = "contacts" + static let container: JSString = "container" + static let containerId: JSString = "containerId" + static let containerName: JSString = "containerName" + static let containerSrc: JSString = "containerSrc" + static let containerType: JSString = "containerType" static let contains: JSString = "contains" + static let containsNode: JSString = "containsNode" static let content: JSString = "content" + static let contentBoxSize: JSString = "contentBoxSize" static let contentDocument: JSString = "contentDocument" static let contentEditable: JSString = "contentEditable" + static let contentHint: JSString = "contentHint" + static let contentRect: JSString = "contentRect" static let contentType: JSString = "contentType" static let contentWindow: JSString = "contentWindow" + static let contents: JSString = "contents" + static let context: JSString = "context" + static let contextTime: JSString = "contextTime" + static let continue: JSString = "continue" + static let continuePrimaryKey: JSString = "continuePrimaryKey" + static let continuous: JSString = "continuous" + static let contrast: JSString = "contrast" + static let contributingSources: JSString = "contributingSources" + static let contributorSsrc: JSString = "contributorSsrc" static let control: JSString = "control" + static let controlBound: JSString = "controlBound" + static let controlTransferIn: JSString = "controlTransferIn" + static let controlTransferOut: JSString = "controlTransferOut" + static let controller: JSString = "controller" static let controls: JSString = "controls" + static let conv2d: JSString = "conv2d" + static let convTranspose2d: JSString = "convTranspose2d" + static let convertPointFromNode: JSString = "convertPointFromNode" + static let convertQuadFromNode: JSString = "convertQuadFromNode" + static let convertRectFromNode: JSString = "convertRectFromNode" static let convertToBlob: JSString = "convertToBlob" + static let convertToSpecifiedUnits: JSString = "convertToSpecifiedUnits" static let cookie: JSString = "cookie" static let cookieEnabled: JSString = "cookieEnabled" + static let cookieStore: JSString = "cookieStore" + static let cookies: JSString = "cookies" static let coords: JSString = "coords" + static let copyBufferSubData: JSString = "copyBufferSubData" + static let copyBufferToBuffer: JSString = "copyBufferToBuffer" + static let copyBufferToTexture: JSString = "copyBufferToTexture" + static let copyExternalImageToTexture: JSString = "copyExternalImageToTexture" + static let copyFromChannel: JSString = "copyFromChannel" + static let copyTexImage2D: JSString = "copyTexImage2D" + static let copyTexSubImage2D: JSString = "copyTexSubImage2D" + static let copyTexSubImage3D: JSString = "copyTexSubImage3D" + static let copyTextureToBuffer: JSString = "copyTextureToBuffer" + static let copyTextureToTexture: JSString = "copyTextureToTexture" + static let copyTo: JSString = "copyTo" + static let copyToChannel: JSString = "copyToChannel" + static let cornerPoints: JSString = "cornerPoints" + static let correspondingElement: JSString = "correspondingElement" + static let correspondingUseElement: JSString = "correspondingUseElement" + static let corruptedVideoFrames: JSString = "corruptedVideoFrames" + static let cos: JSString = "cos" static let count: JSString = "count" static let countReset: JSString = "countReset" + static let counter: JSString = "counter" + static let country: JSString = "country" + static let cqb: JSString = "cqb" + static let cqh: JSString = "cqh" + static let cqi: JSString = "cqi" + static let cqmax: JSString = "cqmax" + static let cqmin: JSString = "cqmin" + static let cqw: JSString = "cqw" + static let create: JSString = "create" + static let createAnalyser: JSString = "createAnalyser" + static let createAnchor: JSString = "createAnchor" + static let createAnswer: JSString = "createAnswer" static let createAttribute: JSString = "createAttribute" static let createAttributeNS: JSString = "createAttributeNS" + static let createBidirectionalStream: JSString = "createBidirectionalStream" + static let createBindGroup: JSString = "createBindGroup" + static let createBindGroupLayout: JSString = "createBindGroupLayout" + static let createBiquadFilter: JSString = "createBiquadFilter" + static let createBuffer: JSString = "createBuffer" + static let createBufferSource: JSString = "createBufferSource" static let createCDATASection: JSString = "createCDATASection" static let createCaption: JSString = "createCaption" + static let createChannelMerger: JSString = "createChannelMerger" + static let createChannelSplitter: JSString = "createChannelSplitter" + static let createCommandEncoder: JSString = "createCommandEncoder" static let createComment: JSString = "createComment" + static let createComputePipeline: JSString = "createComputePipeline" + static let createComputePipelineAsync: JSString = "createComputePipelineAsync" static let createConicGradient: JSString = "createConicGradient" + static let createConstantSource: JSString = "createConstantSource" + static let createContext: JSString = "createContext" + static let createContextualFragment: JSString = "createContextualFragment" + static let createConvolver: JSString = "createConvolver" + static let createCubeLayer: JSString = "createCubeLayer" + static let createCylinderLayer: JSString = "createCylinderLayer" + static let createDataChannel: JSString = "createDataChannel" + static let createDelay: JSString = "createDelay" static let createDocument: JSString = "createDocument" static let createDocumentFragment: JSString = "createDocumentFragment" static let createDocumentType: JSString = "createDocumentType" + static let createDynamicsCompressor: JSString = "createDynamicsCompressor" static let createElement: JSString = "createElement" static let createElementNS: JSString = "createElementNS" + static let createEquirectLayer: JSString = "createEquirectLayer" static let createEvent: JSString = "createEvent" + static let createFramebuffer: JSString = "createFramebuffer" + static let createGain: JSString = "createGain" + static let createHTML: JSString = "createHTML" static let createHTMLDocument: JSString = "createHTMLDocument" + static let createIIRFilter: JSString = "createIIRFilter" static let createImageBitmap: JSString = "createImageBitmap" static let createImageData: JSString = "createImageData" + static let createIndex: JSString = "createIndex" static let createLinearGradient: JSString = "createLinearGradient" + static let createMediaElementSource: JSString = "createMediaElementSource" + static let createMediaKeys: JSString = "createMediaKeys" + static let createMediaStreamDestination: JSString = "createMediaStreamDestination" + static let createMediaStreamSource: JSString = "createMediaStreamSource" + static let createMediaStreamTrackSource: JSString = "createMediaStreamTrackSource" + static let createObjectStore: JSString = "createObjectStore" static let createObjectURL: JSString = "createObjectURL" + static let createOffer: JSString = "createOffer" + static let createOscillator: JSString = "createOscillator" + static let createPanner: JSString = "createPanner" static let createPattern: JSString = "createPattern" + static let createPeriodicWave: JSString = "createPeriodicWave" + static let createPipelineLayout: JSString = "createPipelineLayout" + static let createPolicy: JSString = "createPolicy" static let createProcessingInstruction: JSString = "createProcessingInstruction" + static let createProgram: JSString = "createProgram" + static let createProjectionLayer: JSString = "createProjectionLayer" + static let createQuadLayer: JSString = "createQuadLayer" + static let createQuery: JSString = "createQuery" + static let createQueryEXT: JSString = "createQueryEXT" + static let createQuerySet: JSString = "createQuerySet" static let createRadialGradient: JSString = "createRadialGradient" static let createRange: JSString = "createRange" + static let createReader: JSString = "createReader" + static let createRenderBundleEncoder: JSString = "createRenderBundleEncoder" + static let createRenderPipeline: JSString = "createRenderPipeline" + static let createRenderPipelineAsync: JSString = "createRenderPipelineAsync" + static let createRenderbuffer: JSString = "createRenderbuffer" + static let createSVGAngle: JSString = "createSVGAngle" + static let createSVGLength: JSString = "createSVGLength" + static let createSVGMatrix: JSString = "createSVGMatrix" + static let createSVGNumber: JSString = "createSVGNumber" + static let createSVGPoint: JSString = "createSVGPoint" + static let createSVGRect: JSString = "createSVGRect" + static let createSVGTransform: JSString = "createSVGTransform" + static let createSVGTransformFromMatrix: JSString = "createSVGTransformFromMatrix" + static let createSampler: JSString = "createSampler" + static let createScript: JSString = "createScript" + static let createScriptProcessor: JSString = "createScriptProcessor" + static let createScriptURL: JSString = "createScriptURL" + static let createSession: JSString = "createSession" + static let createShader: JSString = "createShader" + static let createShaderModule: JSString = "createShaderModule" + static let createStereoPanner: JSString = "createStereoPanner" static let createTBody: JSString = "createTBody" static let createTFoot: JSString = "createTFoot" static let createTHead: JSString = "createTHead" static let createTextNode: JSString = "createTextNode" + static let createTexture: JSString = "createTexture" + static let createTransformFeedback: JSString = "createTransformFeedback" + static let createUnidirectionalStream: JSString = "createUnidirectionalStream" + static let createVertexArray: JSString = "createVertexArray" + static let createVertexArrayOES: JSString = "createVertexArrayOES" + static let createView: JSString = "createView" + static let createWaveShaper: JSString = "createWaveShaper" + static let createWritable: JSString = "createWritable" + static let creationTime: JSString = "creationTime" + static let credProps: JSString = "credProps" + static let credential: JSString = "credential" + static let credentialIds: JSString = "credentialIds" + static let credentialType: JSString = "credentialType" static let credentials: JSString = "credentials" + static let cropTo: JSString = "cropTo" static let crossOrigin: JSString = "crossOrigin" static let crossOriginIsolated: JSString = "crossOriginIsolated" + static let crv: JSString = "crv" + static let crypto: JSString = "crypto" + static let csp: JSString = "csp" static let cssFloat: JSString = "cssFloat" static let cssRules: JSString = "cssRules" static let cssText: JSString = "cssText" static let ctrlKey: JSString = "ctrlKey" static let cues: JSString = "cues" + static let cullFace: JSString = "cullFace" + static let cullMode: JSString = "cullMode" + static let currency: JSString = "currency" + static let currentDirection: JSString = "currentDirection" + static let currentEntry: JSString = "currentEntry" + static let currentFrame: JSString = "currentFrame" + static let currentIteration: JSString = "currentIteration" + static let currentLocalDescription: JSString = "currentLocalDescription" static let currentNode: JSString = "currentNode" + static let currentRect: JSString = "currentRect" + static let currentRemoteDescription: JSString = "currentRemoteDescription" + static let currentRoundTripTime: JSString = "currentRoundTripTime" + static let currentScale: JSString = "currentScale" static let currentScript: JSString = "currentScript" static let currentSrc: JSString = "currentSrc" static let currentTarget: JSString = "currentTarget" static let currentTime: JSString = "currentTime" + static let currentTranslate: JSString = "currentTranslate" + static let cursor: JSString = "cursor" + static let curve: JSString = "curve" static let customElements: JSString = "customElements" static let customError: JSString = "customError" + static let customSections: JSString = "customSections" + static let cx: JSString = "cx" + static let cy: JSString = "cy" static let d: JSString = "d" static let data: JSString = "data" + static let dataBits: JSString = "dataBits" + static let dataCarrierDetect: JSString = "dataCarrierDetect" + static let dataChannelIdentifier: JSString = "dataChannelIdentifier" + static let dataChannelsAccepted: JSString = "dataChannelsAccepted" + static let dataChannelsClosed: JSString = "dataChannelsClosed" + static let dataChannelsOpened: JSString = "dataChannelsOpened" + static let dataChannelsRequested: JSString = "dataChannelsRequested" + static let dataFormatPreference: JSString = "dataFormatPreference" + static let dataPrefix: JSString = "dataPrefix" + static let dataSetReady: JSString = "dataSetReady" + static let dataTerminalReady: JSString = "dataTerminalReady" static let dataTransfer: JSString = "dataTransfer" + static let databases: JSString = "databases" + static let datagrams: JSString = "datagrams" static let dataset: JSString = "dataset" static let dateTime: JSString = "dateTime" + static let db: JSString = "db" static let debug: JSString = "debug" static let declare: JSString = "declare" static let decode: JSString = "decode" + static let decodeAudioData: JSString = "decodeAudioData" + static let decodeQueueSize: JSString = "decodeQueueSize" + static let decodedBodySize: JSString = "decodedBodySize" + static let decoderConfig: JSString = "decoderConfig" + static let decoderImplementation: JSString = "decoderImplementation" static let decoding: JSString = "decoding" + static let decodingInfo: JSString = "decodingInfo" + static let decrypt: JSString = "decrypt" static let `default`: JSString = "default" static let defaultChecked: JSString = "defaultChecked" + static let defaultFrameRate: JSString = "defaultFrameRate" static let defaultMuted: JSString = "defaultMuted" static let defaultPlaybackRate: JSString = "defaultPlaybackRate" + static let defaultPolicy: JSString = "defaultPolicy" static let defaultPrevented: JSString = "defaultPrevented" + static let defaultQueue: JSString = "defaultQueue" + static let defaultRequest: JSString = "defaultRequest" + static let defaultSampleRate: JSString = "defaultSampleRate" static let defaultSelected: JSString = "defaultSelected" static let defaultValue: JSString = "defaultValue" static let defaultView: JSString = "defaultView" static let `defer`: JSString = "defer" + static let deg: JSString = "deg" + static let degradationPreference: JSString = "degradationPreference" + static let delay: JSString = "delay" + static let delayTime: JSString = "delayTime" static let delegatesFocus: JSString = "delegatesFocus" static let delete: JSString = "delete" + static let deleteBuffer: JSString = "deleteBuffer" static let deleteCaption: JSString = "deleteCaption" static let deleteCell: JSString = "deleteCell" static let deleteContents: JSString = "deleteContents" static let deleteData: JSString = "deleteData" + static let deleteDatabase: JSString = "deleteDatabase" + static let deleteFramebuffer: JSString = "deleteFramebuffer" + static let deleteFromDocument: JSString = "deleteFromDocument" + static let deleteIndex: JSString = "deleteIndex" static let deleteMedium: JSString = "deleteMedium" + static let deleteObjectStore: JSString = "deleteObjectStore" + static let deleteProgram: JSString = "deleteProgram" + static let deleteQuery: JSString = "deleteQuery" + static let deleteQueryEXT: JSString = "deleteQueryEXT" + static let deleteRenderbuffer: JSString = "deleteRenderbuffer" static let deleteRow: JSString = "deleteRow" static let deleteRule: JSString = "deleteRule" + static let deleteSampler: JSString = "deleteSampler" + static let deleteShader: JSString = "deleteShader" + static let deleteSync: JSString = "deleteSync" static let deleteTFoot: JSString = "deleteTFoot" static let deleteTHead: JSString = "deleteTHead" + static let deleteTexture: JSString = "deleteTexture" + static let deleteTransformFeedback: JSString = "deleteTransformFeedback" + static let deleteVertexArray: JSString = "deleteVertexArray" + static let deleteVertexArrayOES: JSString = "deleteVertexArrayOES" + static let deleted: JSString = "deleted" static let deltaMode: JSString = "deltaMode" static let deltaX: JSString = "deltaX" static let deltaY: JSString = "deltaY" static let deltaZ: JSString = "deltaZ" + static let dependencies: JSString = "dependencies" + static let dependentLocality: JSString = "dependentLocality" + static let depth: JSString = "depth" + static let depthBias: JSString = "depthBias" + static let depthBiasClamp: JSString = "depthBiasClamp" + static let depthBiasSlopeScale: JSString = "depthBiasSlopeScale" + static let depthClearValue: JSString = "depthClearValue" + static let depthCompare: JSString = "depthCompare" + static let depthDataFormat: JSString = "depthDataFormat" + static let depthFailOp: JSString = "depthFailOp" + static let depthFar: JSString = "depthFar" + static let depthFormat: JSString = "depthFormat" + static let depthFunc: JSString = "depthFunc" + static let depthLoadOp: JSString = "depthLoadOp" + static let depthMask: JSString = "depthMask" + static let depthNear: JSString = "depthNear" + static let depthOrArrayLayers: JSString = "depthOrArrayLayers" + static let depthRange: JSString = "depthRange" + static let depthReadOnly: JSString = "depthReadOnly" + static let depthSensing: JSString = "depthSensing" + static let depthStencil: JSString = "depthStencil" + static let depthStencilAttachment: JSString = "depthStencilAttachment" + static let depthStencilFormat: JSString = "depthStencilFormat" + static let depthStencilTexture: JSString = "depthStencilTexture" + static let depthStoreOp: JSString = "depthStoreOp" + static let depthUsage: JSString = "depthUsage" + static let depthWriteEnabled: JSString = "depthWriteEnabled" + static let deriveBits: JSString = "deriveBits" + static let deriveKey: JSString = "deriveKey" + static let descentOverride: JSString = "descentOverride" static let description: JSString = "description" + static let descriptor: JSString = "descriptor" + static let deselectAll: JSString = "deselectAll" static let designMode: JSString = "designMode" + static let desiredHeight: JSString = "desiredHeight" static let desiredSize: JSString = "desiredSize" + static let desiredWidth: JSString = "desiredWidth" static let destination: JSString = "destination" + static let destroy: JSString = "destroy" static let desynchronized: JSString = "desynchronized" static let detach: JSString = "detach" + static let detachShader: JSString = "detachShader" static let detail: JSString = "detail" + static let details: JSString = "details" + static let detect: JSString = "detect" + static let detune: JSString = "detune" + static let device: JSString = "device" + static let deviceClass: JSString = "deviceClass" + static let deviceId: JSString = "deviceId" + static let deviceMemory: JSString = "deviceMemory" + static let devicePixelContentBoxSize: JSString = "devicePixelContentBoxSize" + static let devicePixelRatio: JSString = "devicePixelRatio" + static let devicePosture: JSString = "devicePosture" + static let devicePreference: JSString = "devicePreference" + static let deviceProtocol: JSString = "deviceProtocol" + static let deviceSubclass: JSString = "deviceSubclass" + static let deviceVersionMajor: JSString = "deviceVersionMajor" + static let deviceVersionMinor: JSString = "deviceVersionMinor" + static let deviceVersionSubminor: JSString = "deviceVersionSubminor" + static let devices: JSString = "devices" + static let diameter: JSString = "diameter" + static let didTimeout: JSString = "didTimeout" + static let diffuseConstant: JSString = "diffuseConstant" + static let digest: JSString = "digest" + static let dilations: JSString = "dilations" + static let dimension: JSString = "dimension" + static let dimensions: JSString = "dimensions" static let dir: JSString = "dir" static let dirName: JSString = "dirName" static let direction: JSString = "direction" static let dirxml: JSString = "dirxml" + static let disable: JSString = "disable" + static let disableNormalization: JSString = "disableNormalization" + static let disablePictureInPicture: JSString = "disablePictureInPicture" + static let disableRemotePlayback: JSString = "disableRemotePlayback" + static let disableVertexAttribArray: JSString = "disableVertexAttribArray" static let disabled: JSString = "disabled" + static let disableiOES: JSString = "disableiOES" + static let dischargingTime: JSString = "dischargingTime" static let disconnect: JSString = "disconnect" + static let dispatch: JSString = "dispatch" static let dispatchEvent: JSString = "dispatchEvent" + static let dispatchIndirect: JSString = "dispatchIndirect" + static let display: JSString = "display" + static let displayAspectHeight: JSString = "displayAspectHeight" + static let displayAspectWidth: JSString = "displayAspectWidth" + static let displayHeight: JSString = "displayHeight" + static let displayItems: JSString = "displayItems" + static let displayName: JSString = "displayName" + static let displaySurface: JSString = "displaySurface" + static let displayWidth: JSString = "displayWidth" + static let disposition: JSString = "disposition" + static let distance: JSString = "distance" + static let distanceModel: JSString = "distanceModel" + static let distinctiveIdentifier: JSString = "distinctiveIdentifier" + static let div: JSString = "div" + static let divisor: JSString = "divisor" static let doctype: JSString = "doctype" static let document: JSString = "document" static let documentElement: JSString = "documentElement" static let documentURI: JSString = "documentURI" + static let documentURL: JSString = "documentURL" + static let domComplete: JSString = "domComplete" + static let domContentLoadedEventEnd: JSString = "domContentLoadedEventEnd" + static let domContentLoadedEventStart: JSString = "domContentLoadedEventStart" + static let domInteractive: JSString = "domInteractive" + static let domLoading: JSString = "domLoading" + static let domOverlay: JSString = "domOverlay" + static let domOverlayState: JSString = "domOverlayState" static let domain: JSString = "domain" + static let domainLookupEnd: JSString = "domainLookupEnd" + static let domainLookupStart: JSString = "domainLookupStart" + static let dominantBaseline: JSString = "dominantBaseline" static let done: JSString = "done" + static let downlink: JSString = "downlink" + static let downlinkMax: JSString = "downlinkMax" static let download: JSString = "download" + static let downloadTotal: JSString = "downloadTotal" + static let downloaded: JSString = "downloaded" + static let dp: JSString = "dp" + static let dpcm: JSString = "dpcm" + static let dpi: JSString = "dpi" + static let dppx: JSString = "dppx" + static let dq: JSString = "dq" static let draggable: JSString = "draggable" + static let draw: JSString = "draw" + static let drawArrays: JSString = "drawArrays" + static let drawArraysInstanced: JSString = "drawArraysInstanced" + static let drawArraysInstancedANGLE: JSString = "drawArraysInstancedANGLE" + static let drawArraysInstancedBaseInstanceWEBGL: JSString = "drawArraysInstancedBaseInstanceWEBGL" + static let drawBuffers: JSString = "drawBuffers" + static let drawBuffersWEBGL: JSString = "drawBuffersWEBGL" + static let drawElements: JSString = "drawElements" + static let drawElementsInstanced: JSString = "drawElementsInstanced" + static let drawElementsInstancedANGLE: JSString = "drawElementsInstancedANGLE" + static let drawElementsInstancedBaseVertexBaseInstanceWEBGL: JSString = "drawElementsInstancedBaseVertexBaseInstanceWEBGL" static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded" static let drawImage: JSString = "drawImage" + static let drawIndexed: JSString = "drawIndexed" + static let drawIndexedIndirect: JSString = "drawIndexedIndirect" + static let drawIndirect: JSString = "drawIndirect" + static let drawRangeElements: JSString = "drawRangeElements" + static let drawingBufferHeight: JSString = "drawingBufferHeight" + static let drawingBufferWidth: JSString = "drawingBufferWidth" + static let dropAttributes: JSString = "dropAttributes" static let dropEffect: JSString = "dropEffect" + static let dropElements: JSString = "dropElements" + static let droppedEntriesCount: JSString = "droppedEntriesCount" + static let droppedVideoFrames: JSString = "droppedVideoFrames" + static let dstFactor: JSString = "dstFactor" + static let dtlsCipher: JSString = "dtlsCipher" + static let dtlsState: JSString = "dtlsState" + static let dtmf: JSString = "dtmf" + static let durability: JSString = "durability" static let duration: JSString = "duration" + static let durationThreshold: JSString = "durationThreshold" + static let dvb: JSString = "dvb" + static let dvh: JSString = "dvh" + static let dvi: JSString = "dvi" + static let dvmax: JSString = "dvmax" + static let dvmin: JSString = "dvmin" + static let dvw: JSString = "dvw" + static let dx: JSString = "dx" + static let dy: JSString = "dy" static let e: JSString = "e" + static let easing: JSString = "easing" + static let echoCancellation: JSString = "echoCancellation" + static let echoReturnLoss: JSString = "echoReturnLoss" + static let echoReturnLossEnhancement: JSString = "echoReturnLossEnhancement" + static let edge: JSString = "edge" + static let edgeMode: JSString = "edgeMode" + static let editContext: JSString = "editContext" + static let effect: JSString = "effect" static let effectAllowed: JSString = "effectAllowed" + static let effectiveDirective: JSString = "effectiveDirective" + static let effectiveType: JSString = "effectiveType" + static let elapsedTime: JSString = "elapsedTime" + static let element: JSString = "element" + static let elementFromPoint: JSString = "elementFromPoint" + static let elementSources: JSString = "elementSources" + static let elementTiming: JSString = "elementTiming" static let elements: JSString = "elements" + static let elementsFromPoint: JSString = "elementsFromPoint" + static let elevation: JSString = "elevation" static let ellipse: JSString = "ellipse" + static let elu: JSString = "elu" + static let em: JSString = "em" static let emHeightAscent: JSString = "emHeightAscent" static let emHeightDescent: JSString = "emHeightDescent" + static let email: JSString = "email" static let embeds: JSString = "embeds" + static let empty: JSString = "empty" + static let emptyHTML: JSString = "emptyHTML" + static let emptyScript: JSString = "emptyScript" + static let emulatedPosition: JSString = "emulatedPosition" + static let enable: JSString = "enable" + static let enableHighAccuracy: JSString = "enableHighAccuracy" + static let enableVertexAttribArray: JSString = "enableVertexAttribArray" static let enabled: JSString = "enabled" static let enabledPlugin: JSString = "enabledPlugin" + static let enableiOES: JSString = "enableiOES" + static let encode: JSString = "encode" + static let encodeInto: JSString = "encodeInto" + static let encodeQueueSize: JSString = "encodeQueueSize" + static let encodedBodySize: JSString = "encodedBodySize" + static let encoderImplementation: JSString = "encoderImplementation" static let encoding: JSString = "encoding" + static let encodingInfo: JSString = "encodingInfo" + static let encodings: JSString = "encodings" + static let encrypt: JSString = "encrypt" + static let encrypted: JSString = "encrypted" + static let encryptionScheme: JSString = "encryptionScheme" static let enctype: JSString = "enctype" static let end: JSString = "end" static let endContainer: JSString = "endContainer" + static let endDelay: JSString = "endDelay" + static let endElement: JSString = "endElement" + static let endElementAt: JSString = "endElementAt" + static let endOcclusionQuery: JSString = "endOcclusionQuery" + static let endOfStream: JSString = "endOfStream" static let endOffset: JSString = "endOffset" + static let endQuery: JSString = "endQuery" + static let endQueryEXT: JSString = "endQueryEXT" static let endTime: JSString = "endTime" + static let endTransformFeedback: JSString = "endTransformFeedback" static let ended: JSString = "ended" static let endings: JSString = "endings" + static let endpoint: JSString = "endpoint" + static let endpointNumber: JSString = "endpointNumber" + static let endpoints: JSString = "endpoints" static let enqueue: JSString = "enqueue" static let enterKeyHint: JSString = "enterKeyHint" + static let entityTypes: JSString = "entityTypes" + static let entries: JSString = "entries" + static let entryPoint: JSString = "entryPoint" + static let entryType: JSString = "entryType" + static let entryTypes: JSString = "entryTypes" + static let enumerateDevices: JSString = "enumerateDevices" + static let environmentBlendMode: JSString = "environmentBlendMode" + static let epsilon: JSString = "epsilon" + static let equals: JSString = "equals" static let error: JSString = "error" + static let errorCode: JSString = "errorCode" + static let errorDetail: JSString = "errorDetail" + static let errorText: JSString = "errorText" + static let errorType: JSString = "errorType" static let escape: JSString = "escape" + static let estimate: JSString = "estimate" + static let estimatedPlayoutTimestamp: JSString = "estimatedPlayoutTimestamp" static let evaluate: JSString = "evaluate" static let event: JSString = "event" + static let eventCounts: JSString = "eventCounts" static let eventPhase: JSString = "eventPhase" + static let ex: JSString = "ex" + static let exact: JSString = "exact" + static let excludeAcceptAllOption: JSString = "excludeAcceptAllOption" + static let excludeCredentials: JSString = "excludeCredentials" + static let exclusive: JSString = "exclusive" + static let exec: JSString = "exec" static let execCommand: JSString = "execCommand" + static let executeBundles: JSString = "executeBundles" + static let exitFullscreen: JSString = "exitFullscreen" + static let exitPictureInPicture: JSString = "exitPictureInPicture" + static let exitPointerLock: JSString = "exitPointerLock" + static let exp: JSString = "exp" + static let expectedDisplayTime: JSString = "expectedDisplayTime" + static let expectedImprovement: JSString = "expectedImprovement" + static let expiration: JSString = "expiration" + static let expirationTime: JSString = "expirationTime" + static let expired: JSString = "expired" + static let expires: JSString = "expires" + static let exponent: JSString = "exponent" + static let exponentialRampToValueAtTime: JSString = "exponentialRampToValueAtTime" + static let exportKey: JSString = "exportKey" + static let exports: JSString = "exports" + static let exposureCompensation: JSString = "exposureCompensation" + static let exposureMode: JSString = "exposureMode" + static let exposureTime: JSString = "exposureTime" + static let ext: JSString = "ext" + static let extend: JSString = "extend" static let extends: JSString = "extends" + static let extensions: JSString = "extensions" static let external: JSString = "external" + static let externalTexture: JSString = "externalTexture" static let extractContents: JSString = "extractContents" + static let extractable: JSString = "extractable" + static let eye: JSString = "eye" static let f: JSString = "f" static let face: JSString = "face" + static let facingMode: JSString = "facingMode" + static let factors: JSString = "factors" + static let failIfMajorPerformanceCaveat: JSString = "failIfMajorPerformanceCaveat" + static let failOp: JSString = "failOp" + static let failureReason: JSString = "failureReason" + static let fallback: JSString = "fallback" + static let family: JSString = "family" + static let fastMode: JSString = "fastMode" static let fastSeek: JSString = "fastSeek" + static let fatal: JSString = "fatal" + static let featureId: JSString = "featureId" + static let featureReports: JSString = "featureReports" + static let featureSettings: JSString = "featureSettings" + static let features: JSString = "features" + static let fecPacketsDiscarded: JSString = "fecPacketsDiscarded" + static let fecPacketsReceived: JSString = "fecPacketsReceived" + static let fecPacketsSent: JSString = "fecPacketsSent" + static let federated: JSString = "federated" + static let feedback: JSString = "feedback" + static let feedforward: JSString = "feedforward" + static let fenceSync: JSString = "fenceSync" static let fetch: JSString = "fetch" + static let fetchStart: JSString = "fetchStart" + static let fetchpriority: JSString = "fetchpriority" + static let fftSize: JSString = "fftSize" static let fgColor: JSString = "fgColor" + static let file: JSString = "file" static let filename: JSString = "filename" static let files: JSString = "files" + static let filesystem: JSString = "filesystem" static let fill: JSString = "fill" + static let fillJointRadii: JSString = "fillJointRadii" + static let fillLightMode: JSString = "fillLightMode" + static let fillPoses: JSString = "fillPoses" static let fillRect: JSString = "fillRect" static let fillStyle: JSString = "fillStyle" static let fillText: JSString = "fillText" static let filter: JSString = "filter" + static let filterLayout: JSString = "filterLayout" + static let filterUnits: JSString = "filterUnits" + static let filters: JSString = "filters" + static let findRule: JSString = "findRule" + static let fingerprint: JSString = "fingerprint" + static let fingerprintAlgorithm: JSString = "fingerprintAlgorithm" + static let finish: JSString = "finish" + static let finished: JSString = "finished" + static let firCount: JSString = "firCount" + static let firesTouchEvents: JSString = "firesTouchEvents" static let firstChild: JSString = "firstChild" static let firstElementChild: JSString = "firstElementChild" + static let firstEmptyRegionIndex: JSString = "firstEmptyRegionIndex" + static let firstRequestTimestamp: JSString = "firstRequestTimestamp" + static let fixedBlockSize: JSString = "fixedBlockSize" + static let fixedFoveation: JSString = "fixedFoveation" + static let fixedInlineSize: JSString = "fixedInlineSize" static let flatten: JSString = "flatten" + static let flex: JSString = "flex" static let flipX: JSString = "flipX" static let flipY: JSString = "flipY" + static let floor: JSString = "floor" + static let flowControl: JSString = "flowControl" static let flush: JSString = "flush" static let focus: JSString = "focus" + static let focusDistance: JSString = "focusDistance" + static let focusMode: JSString = "focusMode" + static let focusNode: JSString = "focusNode" + static let focusOffset: JSString = "focusOffset" + static let focusableAreas: JSString = "focusableAreas" + static let focused: JSString = "focused" static let font: JSString = "font" static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" static let fontBoundingBoxDescent: JSString = "fontBoundingBoxDescent" + static let fontFamily: JSString = "fontFamily" static let fontKerning: JSString = "fontKerning" static let fontStretch: JSString = "fontStretch" static let fontVariantCaps: JSString = "fontVariantCaps" + static let fontfaces: JSString = "fontfaces" + static let fonts: JSString = "fonts" + static let force: JSString = "force" + static let forceFallbackAdapter: JSString = "forceFallbackAdapter" + static let forceRedraw: JSString = "forceRedraw" + static let forget: JSString = "forget" static let form: JSString = "form" static let formAction: JSString = "formAction" static let formData: JSString = "formData" @@ -395,75 +2338,381 @@ enum Strings { static let formMethod: JSString = "formMethod" static let formNoValidate: JSString = "formNoValidate" static let formTarget: JSString = "formTarget" + static let format: JSString = "format" + static let formats: JSString = "formats" static let forms: JSString = "forms" static let forward: JSString = "forward" + static let forwardX: JSString = "forwardX" + static let forwardY: JSString = "forwardY" + static let forwardZ: JSString = "forwardZ" + static let foundation: JSString = "foundation" + static let fr: JSString = "fr" + static let fractionLost: JSString = "fractionLost" + static let fragment: JSString = "fragment" + static let fragmentDirective: JSString = "fragmentDirective" static let frame: JSString = "frame" + static let frameBitDepth: JSString = "frameBitDepth" static let frameBorder: JSString = "frameBorder" + static let frameCount: JSString = "frameCount" static let frameElement: JSString = "frameElement" + static let frameHeight: JSString = "frameHeight" + static let frameId: JSString = "frameId" + static let frameIndex: JSString = "frameIndex" + static let frameOffset: JSString = "frameOffset" + static let frameRate: JSString = "frameRate" + static let frameType: JSString = "frameType" + static let frameWidth: JSString = "frameWidth" + static let framebuffer: JSString = "framebuffer" + static let framebufferHeight: JSString = "framebufferHeight" + static let framebufferRenderbuffer: JSString = "framebufferRenderbuffer" + static let framebufferScaleFactor: JSString = "framebufferScaleFactor" + static let framebufferTexture2D: JSString = "framebufferTexture2D" + static let framebufferTextureLayer: JSString = "framebufferTextureLayer" + static let framebufferTextureMultiviewOVR: JSString = "framebufferTextureMultiviewOVR" + static let framebufferWidth: JSString = "framebufferWidth" + static let framerate: JSString = "framerate" static let frames: JSString = "frames" + static let framesDecoded: JSString = "framesDecoded" + static let framesDiscardedOnSend: JSString = "framesDiscardedOnSend" + static let framesDropped: JSString = "framesDropped" + static let framesEncoded: JSString = "framesEncoded" + static let framesPerSecond: JSString = "framesPerSecond" + static let framesReceived: JSString = "framesReceived" + static let framesSent: JSString = "framesSent" + static let freeTrialPeriod: JSString = "freeTrialPeriod" + static let frequency: JSString = "frequency" + static let frequencyBinCount: JSString = "frequencyBinCount" + static let from: JSString = "from" + static let fromBox: JSString = "fromBox" static let fromFloat32Array: JSString = "fromFloat32Array" static let fromFloat64Array: JSString = "fromFloat64Array" + static let fromLiteral: JSString = "fromLiteral" static let fromMatrix: JSString = "fromMatrix" static let fromPoint: JSString = "fromPoint" static let fromQuad: JSString = "fromQuad" static let fromRect: JSString = "fromRect" + static let frontFace: JSString = "frontFace" + static let fullFramesLost: JSString = "fullFramesLost" + static let fullName: JSString = "fullName" + static let fullPath: JSString = "fullPath" + static let fullRange: JSString = "fullRange" + static let fullVersionList: JSString = "fullVersionList" + static let fullscreen: JSString = "fullscreen" + static let fullscreenElement: JSString = "fullscreenElement" + static let fullscreenEnabled: JSString = "fullscreenEnabled" + static let fx: JSString = "fx" + static let fy: JSString = "fy" + static let g: JSString = "g" + static let gain: JSString = "gain" + static let gamepad: JSString = "gamepad" + static let gamma: JSString = "gamma" + static let gapDiscardRate: JSString = "gapDiscardRate" + static let gapLossRate: JSString = "gapLossRate" + static let gather: JSString = "gather" + static let gatherPolicy: JSString = "gatherPolicy" + static let gatheringState: JSString = "gatheringState" + static let gatt: JSString = "gatt" + static let gc: JSString = "gc" + static let gemm: JSString = "gemm" + static let generateAssertion: JSString = "generateAssertion" + static let generateCertificate: JSString = "generateCertificate" + static let generateKey: JSString = "generateKey" + static let generateKeyFrame: JSString = "generateKeyFrame" + static let generateMipmap: JSString = "generateMipmap" + static let generateRequest: JSString = "generateRequest" + static let geolocation: JSString = "geolocation" static let get: JSString = "get" + static let getActiveAttrib: JSString = "getActiveAttrib" + static let getActiveUniform: JSString = "getActiveUniform" + static let getActiveUniformBlockName: JSString = "getActiveUniformBlockName" + static let getActiveUniformBlockParameter: JSString = "getActiveUniformBlockParameter" + static let getActiveUniforms: JSString = "getActiveUniforms" static let getAll: JSString = "getAll" + static let getAllKeys: JSString = "getAllKeys" static let getAllResponseHeaders: JSString = "getAllResponseHeaders" + static let getAllowlistForFeature: JSString = "getAllowlistForFeature" + static let getAnimations: JSString = "getAnimations" static let getAsFile: JSString = "getAsFile" + static let getAsFileSystemHandle: JSString = "getAsFileSystemHandle" + static let getAttachedShaders: JSString = "getAttachedShaders" + static let getAttribLocation: JSString = "getAttribLocation" static let getAttribute: JSString = "getAttribute" static let getAttributeNS: JSString = "getAttributeNS" static let getAttributeNames: JSString = "getAttributeNames" static let getAttributeNode: JSString = "getAttributeNode" static let getAttributeNodeNS: JSString = "getAttributeNodeNS" + static let getAttributeType: JSString = "getAttributeType" + static let getAudioTracks: JSString = "getAudioTracks" + static let getAuthenticatorData: JSString = "getAuthenticatorData" + static let getAutoplayPolicy: JSString = "getAutoplayPolicy" + static let getAvailability: JSString = "getAvailability" + static let getBBox: JSString = "getBBox" + static let getBattery: JSString = "getBattery" + static let getBindGroupLayout: JSString = "getBindGroupLayout" + static let getBoundingClientRect: JSString = "getBoundingClientRect" static let getBounds: JSString = "getBounds" + static let getBoxQuads: JSString = "getBoxQuads" + static let getBufferParameter: JSString = "getBufferParameter" + static let getBufferSubData: JSString = "getBufferSubData" + static let getByteFrequencyData: JSString = "getByteFrequencyData" + static let getByteTimeDomainData: JSString = "getByteTimeDomainData" + static let getCTM: JSString = "getCTM" + static let getCapabilities: JSString = "getCapabilities" + static let getChannelData: JSString = "getChannelData" + static let getCharNumAtPosition: JSString = "getCharNumAtPosition" + static let getCharacteristic: JSString = "getCharacteristic" + static let getCharacteristics: JSString = "getCharacteristics" + static let getChildren: JSString = "getChildren" + static let getClientExtensionResults: JSString = "getClientExtensionResults" + static let getClientRect: JSString = "getClientRect" + static let getClientRects: JSString = "getClientRects" + static let getCoalescedEvents: JSString = "getCoalescedEvents" static let getComputedStyle: JSString = "getComputedStyle" + static let getComputedTextLength: JSString = "getComputedTextLength" + static let getComputedTiming: JSString = "getComputedTiming" + static let getConfiguration: JSString = "getConfiguration" + static let getConstraints: JSString = "getConstraints" + static let getContent: JSString = "getContent" static let getContext: JSString = "getContext" static let getContextAttributes: JSString = "getContextAttributes" + static let getContributingSources: JSString = "getContributingSources" + static let getCueAsHTML: JSString = "getCueAsHTML" static let getCueById: JSString = "getCueById" + static let getCurrentPosition: JSString = "getCurrentPosition" + static let getCurrentTexture: JSString = "getCurrentTexture" + static let getCurrentTime: JSString = "getCurrentTime" static let getData: JSString = "getData" + static let getDefaultConfiguration: JSString = "getDefaultConfiguration" + static let getDepthInMeters: JSString = "getDepthInMeters" + static let getDepthInformation: JSString = "getDepthInformation" + static let getDescriptor: JSString = "getDescriptor" + static let getDescriptors: JSString = "getDescriptors" + static let getDetails: JSString = "getDetails" + static let getDevices: JSString = "getDevices" + static let getDigitalGoodsService: JSString = "getDigitalGoodsService" + static let getDirectory: JSString = "getDirectory" + static let getDirectoryHandle: JSString = "getDirectoryHandle" + static let getDisplayMedia: JSString = "getDisplayMedia" static let getElementById: JSString = "getElementById" static let getElementsByClassName: JSString = "getElementsByClassName" static let getElementsByName: JSString = "getElementsByName" static let getElementsByTagName: JSString = "getElementsByTagName" static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" + static let getEnclosureList: JSString = "getEnclosureList" + static let getEndPositionOfChar: JSString = "getEndPositionOfChar" + static let getEntries: JSString = "getEntries" + static let getEntriesByName: JSString = "getEntriesByName" + static let getEntriesByType: JSString = "getEntriesByType" + static let getError: JSString = "getError" + static let getExtension: JSString = "getExtension" + static let getExtentOfChar: JSString = "getExtentOfChar" + static let getFile: JSString = "getFile" + static let getFileHandle: JSString = "getFileHandle" + static let getFingerprints: JSString = "getFingerprints" + static let getFloatFrequencyData: JSString = "getFloatFrequencyData" + static let getFloatTimeDomainData: JSString = "getFloatTimeDomainData" + static let getFragDataLocation: JSString = "getFragDataLocation" + static let getFramebufferAttachmentParameter: JSString = "getFramebufferAttachmentParameter" + static let getFrequencyResponse: JSString = "getFrequencyResponse" + static let getGamepads: JSString = "getGamepads" + static let getHighEntropyValues: JSString = "getHighEntropyValues" + static let getHitTestResults: JSString = "getHitTestResults" + static let getHitTestResultsForTransientInput: JSString = "getHitTestResultsForTransientInput" + static let getIdentityAssertion: JSString = "getIdentityAssertion" + static let getIds: JSString = "getIds" static let getImageData: JSString = "getImageData" + static let getIncludedService: JSString = "getIncludedService" + static let getIncludedServices: JSString = "getIncludedServices" + static let getIndexedParameter: JSString = "getIndexedParameter" + static let getInfo: JSString = "getInfo" + static let getInstalledRelatedApps: JSString = "getInstalledRelatedApps" + static let getInternalformatParameter: JSString = "getInternalformatParameter" + static let getIntersectionList: JSString = "getIntersectionList" + static let getJointPose: JSString = "getJointPose" + static let getKey: JSString = "getKey" + static let getKeyframes: JSString = "getKeyframes" + static let getLayoutMap: JSString = "getLayoutMap" + static let getLightEstimate: JSString = "getLightEstimate" static let getLineDash: JSString = "getLineDash" + static let getLocalCandidates: JSString = "getLocalCandidates" + static let getLocalParameters: JSString = "getLocalParameters" + static let getMappedRange: JSString = "getMappedRange" + static let getMetadata: JSString = "getMetadata" static let getModifierState: JSString = "getModifierState" static let getNamedItemNS: JSString = "getNamedItemNS" + static let getNativeFramebufferScaleFactor: JSString = "getNativeFramebufferScaleFactor" + static let getNotifications: JSString = "getNotifications" + static let getNumberOfChars: JSString = "getNumberOfChars" + static let getOffsetReferenceSpace: JSString = "getOffsetReferenceSpace" + static let getOutputTimestamp: JSString = "getOutputTimestamp" static let getParameter: JSString = "getParameter" + static let getParameters: JSString = "getParameters" + static let getParent: JSString = "getParent" + static let getPhotoCapabilities: JSString = "getPhotoCapabilities" + static let getPhotoSettings: JSString = "getPhotoSettings" + static let getPointAtLength: JSString = "getPointAtLength" + static let getPorts: JSString = "getPorts" + static let getPose: JSString = "getPose" + static let getPredictedEvents: JSString = "getPredictedEvents" + static let getPreferredFormat: JSString = "getPreferredFormat" + static let getPrimaryService: JSString = "getPrimaryService" + static let getPrimaryServices: JSString = "getPrimaryServices" + static let getProgramInfoLog: JSString = "getProgramInfoLog" + static let getProgramParameter: JSString = "getProgramParameter" + static let getProperties: JSString = "getProperties" static let getPropertyPriority: JSString = "getPropertyPriority" + static let getPropertyType: JSString = "getPropertyType" static let getPropertyValue: JSString = "getPropertyValue" + static let getPublicKey: JSString = "getPublicKey" + static let getPublicKeyAlgorithm: JSString = "getPublicKeyAlgorithm" + static let getQuery: JSString = "getQuery" + static let getQueryEXT: JSString = "getQueryEXT" + static let getQueryObjectEXT: JSString = "getQueryObjectEXT" + static let getQueryParameter: JSString = "getQueryParameter" + static let getRandomValues: JSString = "getRandomValues" + static let getRangeAt: JSString = "getRangeAt" static let getReader: JSString = "getReader" + static let getReceivers: JSString = "getReceivers" + static let getReflectionCubeMap: JSString = "getReflectionCubeMap" + static let getRegionFlowRanges: JSString = "getRegionFlowRanges" + static let getRegions: JSString = "getRegions" + static let getRegionsByContent: JSString = "getRegionsByContent" + static let getRegistration: JSString = "getRegistration" + static let getRegistrations: JSString = "getRegistrations" + static let getRemoteCandidates: JSString = "getRemoteCandidates" + static let getRemoteCertificates: JSString = "getRemoteCertificates" + static let getRemoteParameters: JSString = "getRemoteParameters" + static let getRenderbufferParameter: JSString = "getRenderbufferParameter" static let getResponseHeader: JSString = "getResponseHeader" static let getRootNode: JSString = "getRootNode" + static let getRotationOfChar: JSString = "getRotationOfChar" static let getSVGDocument: JSString = "getSVGDocument" + static let getSamplerParameter: JSString = "getSamplerParameter" + static let getScreenCTM: JSString = "getScreenCTM" + static let getSelectedCandidatePair: JSString = "getSelectedCandidatePair" + static let getSelection: JSString = "getSelection" + static let getSenders: JSString = "getSenders" + static let getService: JSString = "getService" + static let getSettings: JSString = "getSettings" + static let getShaderInfoLog: JSString = "getShaderInfoLog" + static let getShaderParameter: JSString = "getShaderParameter" + static let getShaderPrecisionFormat: JSString = "getShaderPrecisionFormat" + static let getShaderSource: JSString = "getShaderSource" + static let getSignals: JSString = "getSignals" + static let getSimpleDuration: JSString = "getSimpleDuration" + static let getSpatialNavigationContainer: JSString = "getSpatialNavigationContainer" static let getStartDate: JSString = "getStartDate" + static let getStartPositionOfChar: JSString = "getStartPositionOfChar" + static let getStartTime: JSString = "getStartTime" + static let getState: JSString = "getState" + static let getStats: JSString = "getStats" + static let getSubImage: JSString = "getSubImage" + static let getSubStringLength: JSString = "getSubStringLength" + static let getSubscription: JSString = "getSubscription" + static let getSubscriptions: JSString = "getSubscriptions" + static let getSupportedConstraints: JSString = "getSupportedConstraints" + static let getSupportedExtensions: JSString = "getSupportedExtensions" + static let getSupportedFormats: JSString = "getSupportedFormats" + static let getSupportedProfiles: JSString = "getSupportedProfiles" + static let getSyncParameter: JSString = "getSyncParameter" + static let getSynchronizationSources: JSString = "getSynchronizationSources" + static let getTags: JSString = "getTags" + static let getTargetRanges: JSString = "getTargetRanges" + static let getTexParameter: JSString = "getTexParameter" + static let getTextFormats: JSString = "getTextFormats" + static let getTiming: JSString = "getTiming" + static let getTitlebarAreaRect: JSString = "getTitlebarAreaRect" + static let getTotalLength: JSString = "getTotalLength" static let getTrackById: JSString = "getTrackById" + static let getTracks: JSString = "getTracks" + static let getTransceivers: JSString = "getTransceivers" static let getTransform: JSString = "getTransform" + static let getTransformFeedbackVarying: JSString = "getTransformFeedbackVarying" + static let getTranslatedShaderSource: JSString = "getTranslatedShaderSource" + static let getTransports: JSString = "getTransports" + static let getType: JSString = "getType" + static let getUniform: JSString = "getUniform" + static let getUniformBlockIndex: JSString = "getUniformBlockIndex" + static let getUniformIndices: JSString = "getUniformIndices" + static let getUniformLocation: JSString = "getUniformLocation" + static let getUserMedia: JSString = "getUserMedia" + static let getVertexAttrib: JSString = "getVertexAttrib" + static let getVertexAttribOffset: JSString = "getVertexAttribOffset" + static let getVideoPlaybackQuality: JSString = "getVideoPlaybackQuality" + static let getVideoTracks: JSString = "getVideoTracks" + static let getViewSubImage: JSString = "getViewSubImage" + static let getViewerPose: JSString = "getViewerPose" + static let getViewport: JSString = "getViewport" + static let getVoices: JSString = "getVoices" static let getWriter: JSString = "getWriter" static let globalAlpha: JSString = "globalAlpha" static let globalCompositeOperation: JSString = "globalCompositeOperation" + static let glyphsRendered: JSString = "glyphsRendered" static let go: JSString = "go" + static let gpu: JSString = "gpu" + static let grabFrame: JSString = "grabFrame" + static let grad: JSString = "grad" + static let gradientTransform: JSString = "gradientTransform" + static let gradientUnits: JSString = "gradientUnits" + static let grammars: JSString = "grammars" + static let granted: JSString = "granted" + static let gripSpace: JSString = "gripSpace" static let group: JSString = "group" static let groupCollapsed: JSString = "groupCollapsed" static let groupEnd: JSString = "groupEnd" + static let groupId: JSString = "groupId" + static let groups: JSString = "groups" + static let grow: JSString = "grow" + static let gru: JSString = "gru" + static let gruCell: JSString = "gruCell" + static let h: JSString = "h" + static let hadRecentInput: JSString = "hadRecentInput" + static let hand: JSString = "hand" + static let handedness: JSString = "handedness" + static let handle: JSString = "handle" + static let handled: JSString = "handled" static let hangingBaseline: JSString = "hangingBaseline" + static let hapticActuators: JSString = "hapticActuators" + static let hardSigmoid: JSString = "hardSigmoid" + static let hardSwish: JSString = "hardSwish" + static let hardwareAcceleration: JSString = "hardwareAcceleration" static let hardwareConcurrency: JSString = "hardwareConcurrency" static let has: JSString = "has" + static let hasAlphaChannel: JSString = "hasAlphaChannel" static let hasAttribute: JSString = "hasAttribute" static let hasAttributeNS: JSString = "hasAttributeNS" static let hasAttributes: JSString = "hasAttributes" static let hasChildNodes: JSString = "hasChildNodes" + static let hasDynamicOffset: JSString = "hasDynamicOffset" static let hasFeature: JSString = "hasFeature" static let hasFocus: JSString = "hasFocus" + static let hasNull: JSString = "hasNull" + static let hasOrientation: JSString = "hasOrientation" + static let hasPointerCapture: JSString = "hasPointerCapture" + static let hasPosition: JSString = "hasPosition" + static let hasPreferredState: JSString = "hasPreferredState" + static let hasReading: JSString = "hasReading" + static let hasStorageAccess: JSString = "hasStorageAccess" static let hash: JSString = "hash" + static let hashChange: JSString = "hashChange" + static let hdrMetadataType: JSString = "hdrMetadataType" static let head: JSString = "head" + static let headerBytesReceived: JSString = "headerBytesReceived" + static let headerBytesSent: JSString = "headerBytesSent" + static let headerExtensions: JSString = "headerExtensions" + static let headerValue: JSString = "headerValue" static let headers: JSString = "headers" + static let heading: JSString = "heading" static let height: JSString = "height" + static let held: JSString = "held" + static let hid: JSString = "hid" static let hidden: JSString = "hidden" + static let hide: JSString = "hide" static let high: JSString = "high" static let highWaterMark: JSString = "highWaterMark" + static let highlights: JSString = "highlights" + static let hint: JSString = "hint" + static let hints: JSString = "hints" static let history: JSString = "history" static let host: JSString = "host" static let hostname: JSString = "hostname" @@ -472,114 +2721,389 @@ enum Strings { static let hspace: JSString = "hspace" static let htmlFor: JSString = "htmlFor" static let httpEquiv: JSString = "httpEquiv" + static let httpRequestStatusCode: JSString = "httpRequestStatusCode" + static let hugeFramesSent: JSString = "hugeFramesSent" + static let ic: JSString = "ic" + static let iceCandidatePoolSize: JSString = "iceCandidatePoolSize" + static let iceConnectionState: JSString = "iceConnectionState" + static let iceGatheringState: JSString = "iceGatheringState" + static let iceLite: JSString = "iceLite" + static let iceLocalUsernameFragment: JSString = "iceLocalUsernameFragment" + static let iceRestart: JSString = "iceRestart" + static let iceRole: JSString = "iceRole" + static let iceServers: JSString = "iceServers" + static let iceState: JSString = "iceState" + static let iceTransport: JSString = "iceTransport" + static let iceTransportPolicy: JSString = "iceTransportPolicy" + static let icon: JSString = "icon" + static let iconMustBeShown: JSString = "iconMustBeShown" + static let iconURL: JSString = "iconURL" + static let iconURLs: JSString = "iconURLs" + static let icons: JSString = "icons" static let id: JSString = "id" + static let ideal: JSString = "ideal" + static let identifier: JSString = "identifier" + static let identity: JSString = "identity" static let ideographicBaseline: JSString = "ideographicBaseline" + static let idp: JSString = "idp" + static let idpErrorInfo: JSString = "idpErrorInfo" + static let idpLoginUrl: JSString = "idpLoginUrl" + static let ifAvailable: JSString = "ifAvailable" + static let ignoreBOM: JSString = "ignoreBOM" + static let ignoreDepthValues: JSString = "ignoreDepthValues" + static let ignoreMethod: JSString = "ignoreMethod" + static let ignoreSearch: JSString = "ignoreSearch" + static let ignoreVary: JSString = "ignoreVary" + static let illuminance: JSString = "illuminance" + static let imag: JSString = "imag" + static let image: JSString = "image" + static let imageHeight: JSString = "imageHeight" + static let imageIndex: JSString = "imageIndex" static let imageOrientation: JSString = "imageOrientation" static let imageSizes: JSString = "imageSizes" static let imageSmoothingEnabled: JSString = "imageSmoothingEnabled" static let imageSmoothingQuality: JSString = "imageSmoothingQuality" static let imageSrcset: JSString = "imageSrcset" + static let imageWidth: JSString = "imageWidth" static let images: JSString = "images" static let implementation: JSString = "implementation" + static let importExternalTexture: JSString = "importExternalTexture" + static let importKey: JSString = "importKey" static let importNode: JSString = "importNode" static let importScripts: JSString = "importScripts" static let importStylesheet: JSString = "importStylesheet" + static let imports: JSString = "imports" + static let in: JSString = "in" + static let in1: JSString = "in1" + static let in2: JSString = "in2" static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" + static let inboundRtpStreamId: JSString = "inboundRtpStreamId" + static let includeContinuous: JSString = "includeContinuous" + static let includeUncontrolled: JSString = "includeUncontrolled" + static let includes: JSString = "includes" + static let incomingBidirectionalStreams: JSString = "incomingBidirectionalStreams" + static let incomingHighWaterMark: JSString = "incomingHighWaterMark" + static let incomingMaxAge: JSString = "incomingMaxAge" + static let incomingUnidirectionalStreams: JSString = "incomingUnidirectionalStreams" static let indeterminate: JSString = "indeterminate" static let index: JSString = "index" + static let indexNames: JSString = "indexNames" + static let indexedDB: JSString = "indexedDB" + static let indicate: JSString = "indicate" static let inert: JSString = "inert" static let info: JSString = "info" + static let inherits: JSString = "inherits" static let initCompositionEvent: JSString = "initCompositionEvent" static let initCustomEvent: JSString = "initCustomEvent" + static let initData: JSString = "initData" + static let initDataType: JSString = "initDataType" + static let initDataTypes: JSString = "initDataTypes" static let initEvent: JSString = "initEvent" static let initKeyboardEvent: JSString = "initKeyboardEvent" static let initMessageEvent: JSString = "initMessageEvent" static let initMouseEvent: JSString = "initMouseEvent" static let initMutationEvent: JSString = "initMutationEvent" static let initStorageEvent: JSString = "initStorageEvent" + static let initTimeEvent: JSString = "initTimeEvent" static let initUIEvent: JSString = "initUIEvent" + static let initial: JSString = "initial" + static let initialHiddenState: JSString = "initialHiddenState" + static let initialValue: JSString = "initialValue" + static let initialize: JSString = "initialize" + static let initiatorType: JSString = "initiatorType" + static let ink: JSString = "ink" + static let inline: JSString = "inline" + static let inlineEnd: JSString = "inlineEnd" + static let inlineOffset: JSString = "inlineOffset" + static let inlineSize: JSString = "inlineSize" + static let inlineStart: JSString = "inlineStart" + static let inlineVerticalFieldOfView: JSString = "inlineVerticalFieldOfView" + static let innerHTML: JSString = "innerHTML" + static let innerHeight: JSString = "innerHeight" static let innerText: JSString = "innerText" + static let innerWidth: JSString = "innerWidth" + static let input: JSString = "input" + static let inputBuffer: JSString = "inputBuffer" static let inputEncoding: JSString = "inputEncoding" + static let inputLayout: JSString = "inputLayout" static let inputMode: JSString = "inputMode" + static let inputReports: JSString = "inputReports" + static let inputSource: JSString = "inputSource" + static let inputSources: JSString = "inputSources" static let inputType: JSString = "inputType" + static let inputs: JSString = "inputs" static let insertAdjacentElement: JSString = "insertAdjacentElement" + static let insertAdjacentHTML: JSString = "insertAdjacentHTML" static let insertAdjacentText: JSString = "insertAdjacentText" static let insertBefore: JSString = "insertBefore" static let insertCell: JSString = "insertCell" + static let insertDTMF: JSString = "insertDTMF" static let insertData: JSString = "insertData" + static let insertDebugMarker: JSString = "insertDebugMarker" + static let insertItemBefore: JSString = "insertItemBefore" static let insertNode: JSString = "insertNode" static let insertRow: JSString = "insertRow" static let insertRule: JSString = "insertRule" + static let insertedSamplesForDeceleration: JSString = "insertedSamplesForDeceleration" + static let installing: JSString = "installing" + static let instance: JSString = "instance" + static let instanceNormalization: JSString = "instanceNormalization" + static let instanceRoot: JSString = "instanceRoot" + static let instantiate: JSString = "instantiate" + static let instantiateStreaming: JSString = "instantiateStreaming" + static let instrument: JSString = "instrument" + static let instruments: JSString = "instruments" static let integrity: JSString = "integrity" + static let interactionCounts: JSString = "interactionCounts" + static let interactionId: JSString = "interactionId" + static let interactionMode: JSString = "interactionMode" + static let intercept: JSString = "intercept" + static let interfaceClass: JSString = "interfaceClass" + static let interfaceName: JSString = "interfaceName" + static let interfaceNumber: JSString = "interfaceNumber" + static let interfaceProtocol: JSString = "interfaceProtocol" + static let interfaceSubclass: JSString = "interfaceSubclass" + static let interfaces: JSString = "interfaces" + static let interimResults: JSString = "interimResults" + static let intersectionRatio: JSString = "intersectionRatio" + static let intersectionRect: JSString = "intersectionRect" static let intersectsNode: JSString = "intersectsNode" + static let interval: JSString = "interval" + static let intrinsicSizes: JSString = "intrinsicSizes" + static let introductoryPrice: JSString = "introductoryPrice" + static let introductoryPriceCycles: JSString = "introductoryPriceCycles" + static let introductoryPricePeriod: JSString = "introductoryPricePeriod" static let invalidIteratorState: JSString = "invalidIteratorState" + static let invalidateFramebuffer: JSString = "invalidateFramebuffer" + static let invalidateSubFramebuffer: JSString = "invalidateSubFramebuffer" static let inverse: JSString = "inverse" static let invertSelf: JSString = "invertSelf" + static let invertStereo: JSString = "invertStereo" static let `is`: JSString = "is" static let is2D: JSString = "is2D" + static let isAbsolute: JSString = "isAbsolute" + static let isArray: JSString = "isArray" + static let isBuffer: JSString = "isBuffer" + static let isBufferedBytes: JSString = "isBufferedBytes" + static let isCollapsed: JSString = "isCollapsed" static let isComposing: JSString = "isComposing" + static let isConditionalMediationAvailable: JSString = "isConditionalMediationAvailable" + static let isConfigSupported: JSString = "isConfigSupported" static let isConnected: JSString = "isConnected" + static let isConstant: JSString = "isConstant" static let isContentEditable: JSString = "isContentEditable" static let isContextLost: JSString = "isContextLost" static let isDefaultNamespace: JSString = "isDefaultNamespace" + static let isDirectory: JSString = "isDirectory" + static let isEnabled: JSString = "isEnabled" static let isEqualNode: JSString = "isEqualNode" + static let isFallbackAdapter: JSString = "isFallbackAdapter" + static let isFile: JSString = "isFile" + static let isFinal: JSString = "isFinal" + static let isFirstPersonObserver: JSString = "isFirstPersonObserver" + static let isFramebuffer: JSString = "isFramebuffer" + static let isHTML: JSString = "isHTML" static let isHistoryNavigation: JSString = "isHistoryNavigation" static let isIdentity: JSString = "isIdentity" + static let isInComposition: JSString = "isInComposition" + static let isInputPending: JSString = "isInputPending" + static let isIntersecting: JSString = "isIntersecting" + static let isLinear: JSString = "isLinear" static let isMap: JSString = "isMap" + static let isPayment: JSString = "isPayment" + static let isPointInFill: JSString = "isPointInFill" static let isPointInPath: JSString = "isPointInPath" static let isPointInRange: JSString = "isPointInRange" static let isPointInStroke: JSString = "isPointInStroke" + static let isPrimary: JSString = "isPrimary" + static let isProgram: JSString = "isProgram" + static let isQuery: JSString = "isQuery" + static let isQueryEXT: JSString = "isQueryEXT" + static let isRange: JSString = "isRange" static let isReloadNavigation: JSString = "isReloadNavigation" + static let isRenderbuffer: JSString = "isRenderbuffer" + static let isSameEntry: JSString = "isSameEntry" static let isSameNode: JSString = "isSameNode" + static let isSampler: JSString = "isSampler" + static let isScript: JSString = "isScript" + static let isScriptURL: JSString = "isScriptURL" static let isSecureContext: JSString = "isSecureContext" + static let isSessionSupported: JSString = "isSessionSupported" + static let isShader: JSString = "isShader" + static let isStatic: JSString = "isStatic" + static let isSync: JSString = "isSync" + static let isTexture: JSString = "isTexture" + static let isTransformFeedback: JSString = "isTransformFeedback" static let isTrusted: JSString = "isTrusted" + static let isTypeSupported: JSString = "isTypeSupported" + static let isUserVerifyingPlatformAuthenticatorAvailable: JSString = "isUserVerifyingPlatformAuthenticatorAvailable" + static let isVertexArray: JSString = "isVertexArray" + static let isVertexArrayOES: JSString = "isVertexArrayOES" + static let isVisible: JSString = "isVisible" + static let isVolatile: JSString = "isVolatile" + static let iso: JSString = "iso" + static let isochronousTransferIn: JSString = "isochronousTransferIn" + static let isochronousTransferOut: JSString = "isochronousTransferOut" + static let isolated: JSString = "isolated" + static let issuerCertificateId: JSString = "issuerCertificateId" static let item: JSString = "item" + static let itemId: JSString = "itemId" static let items: JSString = "items" static let iterateNext: JSString = "iterateNext" + static let iterationComposite: JSString = "iterationComposite" + static let iterationStart: JSString = "iterationStart" + static let iterations: JSString = "iterations" + static let iv: JSString = "iv" static let javaEnabled: JSString = "javaEnabled" + static let jitter: JSString = "jitter" + static let jitterBufferDelay: JSString = "jitterBufferDelay" + static let jitterBufferEmittedCount: JSString = "jitterBufferEmittedCount" + static let jointName: JSString = "jointName" static let json: JSString = "json" + static let k: JSString = "k" + static let k1: JSString = "k1" + static let k2: JSString = "k2" + static let k3: JSString = "k3" + static let k4: JSString = "k4" + static let kHz: JSString = "kHz" + static let keepDimensions: JSString = "keepDimensions" + static let keepExistingData: JSString = "keepExistingData" static let keepalive: JSString = "keepalive" + static let kernelMatrix: JSString = "kernelMatrix" + static let kernelUnitLengthX: JSString = "kernelUnitLengthX" + static let kernelUnitLengthY: JSString = "kernelUnitLengthY" static let key: JSString = "key" static let keyCode: JSString = "keyCode" + static let keyFrame: JSString = "keyFrame" + static let keyFramesDecoded: JSString = "keyFramesDecoded" + static let keyFramesEncoded: JSString = "keyFramesEncoded" + static let keyID: JSString = "keyID" + static let keyPath: JSString = "keyPath" + static let keyStatuses: JSString = "keyStatuses" + static let keySystem: JSString = "keySystem" + static let keySystemAccess: JSString = "keySystemAccess" + static let keySystemConfiguration: JSString = "keySystemConfiguration" + static let keyText: JSString = "keyText" + static let key_ops: JSString = "key_ops" + static let keyboard: JSString = "keyboard" + static let keys: JSString = "keys" static let kind: JSString = "kind" + static let knee: JSString = "knee" + static let kty: JSString = "kty" + static let l: JSString = "l" + static let l2Pool2d: JSString = "l2Pool2d" static let label: JSString = "label" static let labels: JSString = "labels" + static let landmarks: JSString = "landmarks" static let lang: JSString = "lang" static let language: JSString = "language" static let languages: JSString = "languages" + static let largeBlob: JSString = "largeBlob" + static let lastChance: JSString = "lastChance" static let lastChild: JSString = "lastChild" static let lastElementChild: JSString = "lastElementChild" static let lastEventId: JSString = "lastEventId" + static let lastInputTime: JSString = "lastInputTime" static let lastModified: JSString = "lastModified" + static let lastPacketReceivedTimestamp: JSString = "lastPacketReceivedTimestamp" + static let lastPacketSentTimestamp: JSString = "lastPacketSentTimestamp" + static let lastRequestTimestamp: JSString = "lastRequestTimestamp" + static let lastResponseTimestamp: JSString = "lastResponseTimestamp" + static let latency: JSString = "latency" + static let latencyHint: JSString = "latencyHint" + static let latencyMode: JSString = "latencyMode" + static let latitude: JSString = "latitude" + static let layer: JSString = "layer" + static let layerName: JSString = "layerName" + static let layers: JSString = "layers" + static let layout: JSString = "layout" + static let layoutNextFragment: JSString = "layoutNextFragment" + static let layoutWorklet: JSString = "layoutWorklet" + static let leakyRelu: JSString = "leakyRelu" static let left: JSString = "left" static let length: JSString = "length" + static let lengthAdjust: JSString = "lengthAdjust" static let lengthComputable: JSString = "lengthComputable" static let letterSpacing: JSString = "letterSpacing" + static let level: JSString = "level" + static let lh: JSString = "lh" + static let lifecycleState: JSString = "lifecycleState" + static let limitingConeAngle: JSString = "limitingConeAngle" + static let limits: JSString = "limits" + static let line: JSString = "line" + static let lineAlign: JSString = "lineAlign" static let lineCap: JSString = "lineCap" static let lineDashOffset: JSString = "lineDashOffset" + static let lineGapOverride: JSString = "lineGapOverride" static let lineJoin: JSString = "lineJoin" + static let lineNum: JSString = "lineNum" + static let lineNumber: JSString = "lineNumber" + static let linePos: JSString = "linePos" static let lineTo: JSString = "lineTo" static let lineWidth: JSString = "lineWidth" + static let linear: JSString = "linear" + static let linearAcceleration: JSString = "linearAcceleration" + static let linearRampToValueAtTime: JSString = "linearRampToValueAtTime" + static let linearVelocity: JSString = "linearVelocity" static let lineno: JSString = "lineno" + static let lines: JSString = "lines" static let link: JSString = "link" static let linkColor: JSString = "linkColor" + static let linkProgram: JSString = "linkProgram" static let links: JSString = "links" static let list: JSString = "list" + static let listPurchaseHistory: JSString = "listPurchaseHistory" + static let listPurchases: JSString = "listPurchases" + static let listener: JSString = "listener" static let load: JSString = "load" + static let loadEventEnd: JSString = "loadEventEnd" + static let loadEventStart: JSString = "loadEventStart" + static let loadOp: JSString = "loadOp" + static let loadTime: JSString = "loadTime" static let loaded: JSString = "loaded" static let loading: JSString = "loading" + static let local: JSString = "local" + static let localCandidateId: JSString = "localCandidateId" + static let localCertificateId: JSString = "localCertificateId" + static let localDescription: JSString = "localDescription" + static let localId: JSString = "localId" static let localName: JSString = "localName" + static let localService: JSString = "localService" static let localStorage: JSString = "localStorage" + static let localTime: JSString = "localTime" static let location: JSString = "location" static let locationbar: JSString = "locationbar" + static let locations: JSString = "locations" + static let lock: JSString = "lock" static let locked: JSString = "locked" + static let locks: JSString = "locks" + static let lodMaxClamp: JSString = "lodMaxClamp" + static let lodMinClamp: JSString = "lodMinClamp" static let log: JSString = "log" + static let logicalMaximum: JSString = "logicalMaximum" + static let logicalMinimum: JSString = "logicalMinimum" + static let logicalSurface: JSString = "logicalSurface" static let longDesc: JSString = "longDesc" + static let longitude: JSString = "longitude" static let lookupNamespaceURI: JSString = "lookupNamespaceURI" static let lookupPrefix: JSString = "lookupPrefix" static let loop: JSString = "loop" + static let loopEnd: JSString = "loopEnd" + static let loopStart: JSString = "loopStart" + static let loseContext: JSString = "loseContext" + static let lost: JSString = "lost" static let low: JSString = "low" + static let lower: JSString = "lower" + static let lowerBound: JSString = "lowerBound" + static let lowerOpen: JSString = "lowerOpen" + static let lowerVerticalAngle: JSString = "lowerVerticalAngle" static let lowsrc: JSString = "lowsrc" + static let lvb: JSString = "lvb" + static let lvh: JSString = "lvh" + static let lvi: JSString = "lvi" + static let lvmax: JSString = "lvmax" + static let lvmin: JSString = "lvmin" + static let lvw: JSString = "lvw" static let m11: JSString = "m11" static let m12: JSString = "m12" static let m13: JSString = "m13" @@ -596,24 +3120,139 @@ enum Strings { static let m42: JSString = "m42" static let m43: JSString = "m43" static let m44: JSString = "m44" + static let magFilter: JSString = "magFilter" + static let makeReadOnly: JSString = "makeReadOnly" + static let makeXRCompatible: JSString = "makeXRCompatible" + static let manufacturer: JSString = "manufacturer" + static let manufacturerData: JSString = "manufacturerData" + static let manufacturerName: JSString = "manufacturerName" + static let mapAsync: JSString = "mapAsync" + static let mappedAtCreation: JSString = "mappedAtCreation" + static let mapping: JSString = "mapping" static let marginHeight: JSString = "marginHeight" static let marginWidth: JSString = "marginWidth" + static let mark: JSString = "mark" + static let markerHeight: JSString = "markerHeight" + static let markerUnits: JSString = "markerUnits" + static let markerWidth: JSString = "markerWidth" + static let markers: JSString = "markers" + static let mask: JSString = "mask" + static let maskContentUnits: JSString = "maskContentUnits" + static let maskUnits: JSString = "maskUnits" + static let match: JSString = "match" + static let matchAll: JSString = "matchAll" + static let matchMedia: JSString = "matchMedia" static let matches: JSString = "matches" + static let matmul: JSString = "matmul" + static let matrix: JSString = "matrix" static let matrixTransform: JSString = "matrixTransform" static let max: JSString = "max" + static let maxActions: JSString = "maxActions" + static let maxAlternatives: JSString = "maxAlternatives" + static let maxAnisotropy: JSString = "maxAnisotropy" + static let maxBindGroups: JSString = "maxBindGroups" + static let maxBitrate: JSString = "maxBitrate" + static let maxBufferSize: JSString = "maxBufferSize" + static let maxChannelCount: JSString = "maxChannelCount" + static let maxChannels: JSString = "maxChannels" + static let maxComputeInvocationsPerWorkgroup: JSString = "maxComputeInvocationsPerWorkgroup" + static let maxComputeWorkgroupSizeX: JSString = "maxComputeWorkgroupSizeX" + static let maxComputeWorkgroupSizeY: JSString = "maxComputeWorkgroupSizeY" + static let maxComputeWorkgroupSizeZ: JSString = "maxComputeWorkgroupSizeZ" + static let maxComputeWorkgroupStorageSize: JSString = "maxComputeWorkgroupStorageSize" + static let maxComputeWorkgroupsPerDimension: JSString = "maxComputeWorkgroupsPerDimension" + static let maxContentSize: JSString = "maxContentSize" + static let maxDatagramSize: JSString = "maxDatagramSize" + static let maxDecibels: JSString = "maxDecibels" + static let maxDelayTime: JSString = "maxDelayTime" + static let maxDetectedFaces: JSString = "maxDetectedFaces" + static let maxDistance: JSString = "maxDistance" + static let maxDynamicStorageBuffersPerPipelineLayout: JSString = "maxDynamicStorageBuffersPerPipelineLayout" + static let maxDynamicUniformBuffersPerPipelineLayout: JSString = "maxDynamicUniformBuffersPerPipelineLayout" + static let maxInterStageShaderComponents: JSString = "maxInterStageShaderComponents" static let maxLength: JSString = "maxLength" + static let maxMessageSize: JSString = "maxMessageSize" + static let maxPacketLifeTime: JSString = "maxPacketLifeTime" + static let maxPool2d: JSString = "maxPool2d" + static let maxRetransmits: JSString = "maxRetransmits" + static let maxSampledTexturesPerShaderStage: JSString = "maxSampledTexturesPerShaderStage" + static let maxSamplersPerShaderStage: JSString = "maxSamplersPerShaderStage" + static let maxSamplingFrequency: JSString = "maxSamplingFrequency" + static let maxStorageBufferBindingSize: JSString = "maxStorageBufferBindingSize" + static let maxStorageBuffersPerShaderStage: JSString = "maxStorageBuffersPerShaderStage" + static let maxStorageTexturesPerShaderStage: JSString = "maxStorageTexturesPerShaderStage" + static let maxTextureArrayLayers: JSString = "maxTextureArrayLayers" + static let maxTextureDimension1D: JSString = "maxTextureDimension1D" + static let maxTextureDimension2D: JSString = "maxTextureDimension2D" + static let maxTextureDimension3D: JSString = "maxTextureDimension3D" + static let maxTouchPoints: JSString = "maxTouchPoints" + static let maxUniformBufferBindingSize: JSString = "maxUniformBufferBindingSize" + static let maxUniformBuffersPerShaderStage: JSString = "maxUniformBuffersPerShaderStage" + static let maxValue: JSString = "maxValue" + static let maxVertexAttributes: JSString = "maxVertexAttributes" + static let maxVertexBufferArrayStride: JSString = "maxVertexBufferArrayStride" + static let maxVertexBuffers: JSString = "maxVertexBuffers" + static let maximum: JSString = "maximum" + static let maximumAge: JSString = "maximumAge" + static let maximumValue: JSString = "maximumValue" + static let mayUseGATT: JSString = "mayUseGATT" + static let measure: JSString = "measure" + static let measureElement: JSString = "measureElement" static let measureText: JSString = "measureText" + static let measureUserAgentSpecificMemory: JSString = "measureUserAgentSpecificMemory" static let media: JSString = "media" + static let mediaCapabilities: JSString = "mediaCapabilities" + static let mediaDevices: JSString = "mediaDevices" + static let mediaElement: JSString = "mediaElement" + static let mediaKeys: JSString = "mediaKeys" + static let mediaSession: JSString = "mediaSession" + static let mediaSourceId: JSString = "mediaSourceId" + static let mediaStream: JSString = "mediaStream" + static let mediaStreamTrack: JSString = "mediaStreamTrack" static let mediaText: JSString = "mediaText" + static let mediaTime: JSString = "mediaTime" + static let mediaType: JSString = "mediaType" + static let mediation: JSString = "mediation" + static let meetOrSlice: JSString = "meetOrSlice" static let menubar: JSString = "menubar" static let message: JSString = "message" + static let messageType: JSString = "messageType" + static let messages: JSString = "messages" + static let messagesReceived: JSString = "messagesReceived" + static let messagesSent: JSString = "messagesSent" static let metaKey: JSString = "metaKey" + static let metadata: JSString = "metadata" static let method: JSString = "method" + static let methodData: JSString = "methodData" + static let methodDetails: JSString = "methodDetails" + static let methodName: JSString = "methodName" + static let mid: JSString = "mid" + static let mimeType: JSString = "mimeType" static let mimeTypes: JSString = "mimeTypes" static let min: JSString = "min" + static let minBindingSize: JSString = "minBindingSize" + static let minContentSize: JSString = "minContentSize" + static let minDecibels: JSString = "minDecibels" + static let minFilter: JSString = "minFilter" + static let minInterval: JSString = "minInterval" static let minLength: JSString = "minLength" + static let minRtt: JSString = "minRtt" + static let minSamplingFrequency: JSString = "minSamplingFrequency" + static let minStorageBufferOffsetAlignment: JSString = "minStorageBufferOffsetAlignment" + static let minUniformBufferOffsetAlignment: JSString = "minUniformBufferOffsetAlignment" + static let minValue: JSString = "minValue" + static let minimumValue: JSString = "minimumValue" + static let mipLevel: JSString = "mipLevel" + static let mipLevelCount: JSString = "mipLevelCount" + static let mipLevels: JSString = "mipLevels" + static let mipmapFilter: JSString = "mipmapFilter" static let miterLimit: JSString = "miterLimit" + static let ml: JSString = "ml" + static let mm: JSString = "mm" + static let mobile: JSString = "mobile" + static let mockSensorType: JSString = "mockSensorType" static let mode: JSString = "mode" + static let model: JSString = "model" static let modifierAltGraph: JSString = "modifierAltGraph" static let modifierCapsLock: JSString = "modifierCapsLock" static let modifierFn: JSString = "modifierFn" @@ -624,21 +3263,63 @@ enum Strings { static let modifierSuper: JSString = "modifierSuper" static let modifierSymbol: JSString = "modifierSymbol" static let modifierSymbolLock: JSString = "modifierSymbolLock" + static let modifiers: JSString = "modifiers" + static let module: JSString = "module" + static let modulusLength: JSString = "modulusLength" + static let moveBy: JSString = "moveBy" static let moveTo: JSString = "moveTo" + static let movementX: JSString = "movementX" + static let movementY: JSString = "movementY" + static let ms: JSString = "ms" + static let mtu: JSString = "mtu" + static let mul: JSString = "mul" + static let multiDrawArraysInstancedBaseInstanceWEBGL: JSString = "multiDrawArraysInstancedBaseInstanceWEBGL" + static let multiDrawArraysInstancedWEBGL: JSString = "multiDrawArraysInstancedWEBGL" + static let multiDrawArraysWEBGL: JSString = "multiDrawArraysWEBGL" + static let multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL: JSString = "multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL" + static let multiDrawElementsInstancedWEBGL: JSString = "multiDrawElementsInstancedWEBGL" + static let multiDrawElementsWEBGL: JSString = "multiDrawElementsWEBGL" + static let multiEntry: JSString = "multiEntry" static let multiple: JSString = "multiple" static let multiply: JSString = "multiply" static let multiplySelf: JSString = "multiplySelf" + static let multisample: JSString = "multisample" + static let multisampled: JSString = "multisampled" + static let mutable: JSString = "mutable" static let muted: JSString = "muted" + static let n: JSString = "n" + static let nackCount: JSString = "nackCount" static let name: JSString = "name" + static let nameList: JSString = "nameList" + static let namePrefix: JSString = "namePrefix" + static let namedCurve: JSString = "namedCurve" + static let namedFlows: JSString = "namedFlows" static let namedItem: JSString = "namedItem" static let namespaceURI: JSString = "namespaceURI" + static let nativeProjectionScaleFactor: JSString = "nativeProjectionScaleFactor" static let naturalHeight: JSString = "naturalHeight" static let naturalWidth: JSString = "naturalWidth" + static let navigate: JSString = "navigate" + static let navigation: JSString = "navigation" + static let navigationPreload: JSString = "navigationPreload" + static let navigationStart: JSString = "navigationStart" + static let navigationType: JSString = "navigationType" + static let navigationUI: JSString = "navigationUI" static let navigator: JSString = "navigator" + static let near: JSString = "near" + static let needsRedraw: JSString = "needsRedraw" + static let neg: JSString = "neg" + static let negative: JSString = "negative" + static let negotiated: JSString = "negotiated" + static let networkPriority: JSString = "networkPriority" static let networkState: JSString = "networkState" + static let newSubscription: JSString = "newSubscription" static let newURL: JSString = "newURL" static let newValue: JSString = "newValue" + static let newValueSpecifiedUnits: JSString = "newValueSpecifiedUnits" + static let newVersion: JSString = "newVersion" static let nextElementSibling: JSString = "nextElementSibling" + static let nextHopProtocol: JSString = "nextHopProtocol" static let nextNode: JSString = "nextNode" static let nextSibling: JSString = "nextSibling" static let noHref: JSString = "noHref" @@ -647,40 +3328,122 @@ enum Strings { static let noShade: JSString = "noShade" static let noValidate: JSString = "noValidate" static let noWrap: JSString = "noWrap" + static let node: JSString = "node" static let nodeName: JSString = "nodeName" static let nodeType: JSString = "nodeType" static let nodeValue: JSString = "nodeValue" + static let noiseSuppression: JSString = "noiseSuppression" + static let nominated: JSString = "nominated" static let nonce: JSString = "nonce" + static let normDepthBufferFromNormView: JSString = "normDepthBufferFromNormView" static let normalize: JSString = "normalize" + static let notification: JSString = "notification" + static let notify: JSString = "notify" static let now: JSString = "now" + static let numIncomingStreamsCreated: JSString = "numIncomingStreamsCreated" + static let numOctaves: JSString = "numOctaves" + static let numOutgoingStreamsCreated: JSString = "numOutgoingStreamsCreated" + static let numReceivedDatagramsDropped: JSString = "numReceivedDatagramsDropped" + static let number: JSString = "number" + static let numberOfChannels: JSString = "numberOfChannels" + static let numberOfFrames: JSString = "numberOfFrames" + static let numberOfInputs: JSString = "numberOfInputs" + static let numberOfItems: JSString = "numberOfItems" + static let numberOfOutputs: JSString = "numberOfOutputs" static let numberValue: JSString = "numberValue" + static let objectStore: JSString = "objectStore" + static let objectStoreNames: JSString = "objectStoreNames" static let observe: JSString = "observe" + static let occlusionQuerySet: JSString = "occlusionQuerySet" + static let offerToReceiveAudio: JSString = "offerToReceiveAudio" + static let offerToReceiveVideo: JSString = "offerToReceiveVideo" + static let offset: JSString = "offset" + static let offsetHeight: JSString = "offsetHeight" + static let offsetLeft: JSString = "offsetLeft" + static let offsetNode: JSString = "offsetNode" + static let offsetParent: JSString = "offsetParent" + static let offsetRay: JSString = "offsetRay" + static let offsetTop: JSString = "offsetTop" + static let offsetWidth: JSString = "offsetWidth" + static let offsetX: JSString = "offsetX" + static let offsetY: JSString = "offsetY" static let ok: JSString = "ok" + static let oldSubscription: JSString = "oldSubscription" static let oldURL: JSString = "oldURL" static let oldValue: JSString = "oldValue" + static let oldVersion: JSString = "oldVersion" static let onLine: JSString = "onLine" + static let onSubmittedWorkDone: JSString = "onSubmittedWorkDone" static let onabort: JSString = "onabort" + static let onactivate: JSString = "onactivate" + static let onaddsourcebuffer: JSString = "onaddsourcebuffer" static let onaddtrack: JSString = "onaddtrack" + static let onadvertisementreceived: JSString = "onadvertisementreceived" static let onafterprint: JSString = "onafterprint" + static let onanimationcancel: JSString = "onanimationcancel" + static let onanimationend: JSString = "onanimationend" + static let onanimationiteration: JSString = "onanimationiteration" + static let onanimationstart: JSString = "onanimationstart" + static let onappinstalled: JSString = "onappinstalled" + static let onaudioend: JSString = "onaudioend" + static let onaudioprocess: JSString = "onaudioprocess" + static let onaudiostart: JSString = "onaudiostart" static let onauxclick: JSString = "onauxclick" + static let onavailabilitychanged: JSString = "onavailabilitychanged" + static let onbackgroundfetchabort: JSString = "onbackgroundfetchabort" + static let onbackgroundfetchclick: JSString = "onbackgroundfetchclick" + static let onbackgroundfetchfail: JSString = "onbackgroundfetchfail" + static let onbackgroundfetchsuccess: JSString = "onbackgroundfetchsuccess" + static let onbeforeinstallprompt: JSString = "onbeforeinstallprompt" static let onbeforeprint: JSString = "onbeforeprint" static let onbeforeunload: JSString = "onbeforeunload" + static let onbeforexrselect: JSString = "onbeforexrselect" + static let onbegin: JSString = "onbegin" + static let onblocked: JSString = "onblocked" static let onblur: JSString = "onblur" + static let onboundary: JSString = "onboundary" + static let onbufferedamountlow: JSString = "onbufferedamountlow" static let oncancel: JSString = "oncancel" + static let oncanmakepayment: JSString = "oncanmakepayment" static let oncanplay: JSString = "oncanplay" static let oncanplaythrough: JSString = "oncanplaythrough" static let once: JSString = "once" static let onchange: JSString = "onchange" + static let oncharacterboundsupdate: JSString = "oncharacterboundsupdate" + static let oncharacteristicvaluechanged: JSString = "oncharacteristicvaluechanged" + static let onchargingchange: JSString = "onchargingchange" + static let onchargingtimechange: JSString = "onchargingtimechange" static let onclick: JSString = "onclick" static let onclose: JSString = "onclose" + static let onclosing: JSString = "onclosing" + static let oncompassneedscalibration: JSString = "oncompassneedscalibration" + static let oncomplete: JSString = "oncomplete" + static let oncompositionend: JSString = "oncompositionend" + static let oncompositionstart: JSString = "oncompositionstart" static let onconnect: JSString = "onconnect" + static let onconnecting: JSString = "onconnecting" + static let onconnectionavailable: JSString = "onconnectionavailable" + static let onconnectionstatechange: JSString = "onconnectionstatechange" + static let oncontentdelete: JSString = "oncontentdelete" static let oncontextlost: JSString = "oncontextlost" static let oncontextmenu: JSString = "oncontextmenu" static let oncontextrestored: JSString = "oncontextrestored" + static let oncontrollerchange: JSString = "oncontrollerchange" + static let oncookiechange: JSString = "oncookiechange" static let oncopy: JSString = "oncopy" static let oncuechange: JSString = "oncuechange" + static let oncurrententrychange: JSString = "oncurrententrychange" static let oncut: JSString = "oncut" + static let ondataavailable: JSString = "ondataavailable" + static let ondatachannel: JSString = "ondatachannel" static let ondblclick: JSString = "ondblclick" + static let ondevicechange: JSString = "ondevicechange" + static let ondevicemotion: JSString = "ondevicemotion" + static let ondeviceorientation: JSString = "ondeviceorientation" + static let ondeviceorientationabsolute: JSString = "ondeviceorientationabsolute" + static let ondischargingtimechange: JSString = "ondischargingtimechange" + static let ondisconnect: JSString = "ondisconnect" + static let ondispose: JSString = "ondispose" static let ondrag: JSString = "ondrag" static let ondragend: JSString = "ondragend" static let ondragenter: JSString = "ondragenter" @@ -689,27 +3452,62 @@ enum Strings { static let ondragstart: JSString = "ondragstart" static let ondrop: JSString = "ondrop" static let ondurationchange: JSString = "ondurationchange" + static let oneRealm: JSString = "oneRealm" static let onemptied: JSString = "onemptied" + static let onencrypted: JSString = "onencrypted" + static let onend: JSString = "onend" static let onended: JSString = "onended" static let onenter: JSString = "onenter" + static let onenterpictureinpicture: JSString = "onenterpictureinpicture" static let onerror: JSString = "onerror" static let onexit: JSString = "onexit" + static let onfetch: JSString = "onfetch" + static let onfinish: JSString = "onfinish" static let onfocus: JSString = "onfocus" static let onformdata: JSString = "onformdata" + static let onframeratechange: JSString = "onframeratechange" + static let onfreeze: JSString = "onfreeze" + static let onfullscreenchange: JSString = "onfullscreenchange" + static let onfullscreenerror: JSString = "onfullscreenerror" + static let ongamepadconnected: JSString = "ongamepadconnected" + static let ongamepaddisconnected: JSString = "ongamepaddisconnected" + static let ongatheringstatechange: JSString = "ongatheringstatechange" + static let ongattserverdisconnected: JSString = "ongattserverdisconnected" + static let ongeometrychange: JSString = "ongeometrychange" + static let ongotpointercapture: JSString = "ongotpointercapture" static let onhashchange: JSString = "onhashchange" + static let onicecandidate: JSString = "onicecandidate" + static let onicecandidateerror: JSString = "onicecandidateerror" + static let oniceconnectionstatechange: JSString = "oniceconnectionstatechange" + static let onicegatheringstatechange: JSString = "onicegatheringstatechange" static let oninput: JSString = "oninput" + static let oninputreport: JSString = "oninputreport" + static let oninputsourceschange: JSString = "oninputsourceschange" + static let oninstall: JSString = "oninstall" static let oninvalid: JSString = "oninvalid" + static let onisolationchange: JSString = "onisolationchange" static let onkeydown: JSString = "onkeydown" static let onkeypress: JSString = "onkeypress" + static let onkeystatuseschange: JSString = "onkeystatuseschange" static let onkeyup: JSString = "onkeyup" static let onlanguagechange: JSString = "onlanguagechange" + static let onlayoutchange: JSString = "onlayoutchange" + static let onleavepictureinpicture: JSString = "onleavepictureinpicture" + static let onlevelchange: JSString = "onlevelchange" static let onload: JSString = "onload" static let onloadeddata: JSString = "onloadeddata" static let onloadedmetadata: JSString = "onloadedmetadata" static let onloadend: JSString = "onloadend" + static let onloading: JSString = "onloading" + static let onloadingdone: JSString = "onloadingdone" + static let onloadingerror: JSString = "onloadingerror" static let onloadstart: JSString = "onloadstart" + static let onlostpointercapture: JSString = "onlostpointercapture" + static let only: JSString = "only" + static let onmark: JSString = "onmark" static let onmessage: JSString = "onmessage" static let onmessageerror: JSString = "onmessageerror" + static let onmidimessage: JSString = "onmidimessage" static let onmousedown: JSString = "onmousedown" static let onmouseenter: JSString = "onmouseenter" static let onmouseleave: JSString = "onmouseleave" @@ -717,453 +3515,1630 @@ enum Strings { static let onmouseout: JSString = "onmouseout" static let onmouseover: JSString = "onmouseover" static let onmouseup: JSString = "onmouseup" + static let onmute: JSString = "onmute" + static let onnavigate: JSString = "onnavigate" + static let onnavigateerror: JSString = "onnavigateerror" + static let onnavigatefrom: JSString = "onnavigatefrom" + static let onnavigatesuccess: JSString = "onnavigatesuccess" + static let onnavigateto: JSString = "onnavigateto" + static let onnegotiationneeded: JSString = "onnegotiationneeded" + static let onnomatch: JSString = "onnomatch" + static let onnotificationclick: JSString = "onnotificationclick" + static let onnotificationclose: JSString = "onnotificationclose" static let onoffline: JSString = "onoffline" static let ononline: JSString = "ononline" static let onopen: JSString = "onopen" + static let onorientationchange: JSString = "onorientationchange" static let onpagehide: JSString = "onpagehide" static let onpageshow: JSString = "onpageshow" static let onpaste: JSString = "onpaste" static let onpause: JSString = "onpause" + static let onpaymentmethodchange: JSString = "onpaymentmethodchange" + static let onpaymentrequest: JSString = "onpaymentrequest" + static let onperiodicsync: JSString = "onperiodicsync" static let onplay: JSString = "onplay" static let onplaying: JSString = "onplaying" + static let onpointercancel: JSString = "onpointercancel" + static let onpointerdown: JSString = "onpointerdown" + static let onpointerenter: JSString = "onpointerenter" + static let onpointerleave: JSString = "onpointerleave" + static let onpointerlockchange: JSString = "onpointerlockchange" + static let onpointerlockerror: JSString = "onpointerlockerror" + static let onpointermove: JSString = "onpointermove" + static let onpointerout: JSString = "onpointerout" + static let onpointerover: JSString = "onpointerover" + static let onpointerrawupdate: JSString = "onpointerrawupdate" + static let onpointerup: JSString = "onpointerup" static let onpopstate: JSString = "onpopstate" + static let onportalactivate: JSString = "onportalactivate" + static let onprioritychange: JSString = "onprioritychange" + static let onprocessorerror: JSString = "onprocessorerror" static let onprogress: JSString = "onprogress" + static let onpush: JSString = "onpush" + static let onpushsubscriptionchange: JSString = "onpushsubscriptionchange" static let onratechange: JSString = "onratechange" + static let onreading: JSString = "onreading" + static let onreadingerror: JSString = "onreadingerror" static let onreadystatechange: JSString = "onreadystatechange" + static let onredraw: JSString = "onredraw" + static let onreflectionchange: JSString = "onreflectionchange" static let onrejectionhandled: JSString = "onrejectionhandled" + static let onrelease: JSString = "onrelease" + static let onremove: JSString = "onremove" + static let onremovesourcebuffer: JSString = "onremovesourcebuffer" static let onremovetrack: JSString = "onremovetrack" + static let onrepeat: JSString = "onrepeat" static let onreset: JSString = "onreset" static let onresize: JSString = "onresize" + static let onresourcetimingbufferfull: JSString = "onresourcetimingbufferfull" + static let onresult: JSString = "onresult" + static let onresume: JSString = "onresume" + static let onrtctransform: JSString = "onrtctransform" static let onscroll: JSString = "onscroll" static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" static let onseeked: JSString = "onseeked" static let onseeking: JSString = "onseeking" static let onselect: JSString = "onselect" + static let onselectedcandidatepairchange: JSString = "onselectedcandidatepairchange" + static let onselectend: JSString = "onselectend" + static let onselectionchange: JSString = "onselectionchange" + static let onselectstart: JSString = "onselectstart" + static let onserviceadded: JSString = "onserviceadded" + static let onservicechanged: JSString = "onservicechanged" + static let onserviceremoved: JSString = "onserviceremoved" + static let onshow: JSString = "onshow" + static let onsignalingstatechange: JSString = "onsignalingstatechange" static let onslotchange: JSString = "onslotchange" + static let onsoundend: JSString = "onsoundend" + static let onsoundstart: JSString = "onsoundstart" + static let onsourceclose: JSString = "onsourceclose" + static let onsourceended: JSString = "onsourceended" + static let onsourceopen: JSString = "onsourceopen" + static let onspeechend: JSString = "onspeechend" + static let onspeechstart: JSString = "onspeechstart" + static let onsqueeze: JSString = "onsqueeze" + static let onsqueezeend: JSString = "onsqueezeend" + static let onsqueezestart: JSString = "onsqueezestart" static let onstalled: JSString = "onstalled" + static let onstart: JSString = "onstart" + static let onstatechange: JSString = "onstatechange" + static let onstop: JSString = "onstop" static let onstorage: JSString = "onstorage" static let onsubmit: JSString = "onsubmit" + static let onsuccess: JSString = "onsuccess" static let onsuspend: JSString = "onsuspend" + static let onsync: JSString = "onsync" + static let onterminate: JSString = "onterminate" + static let ontextformatupdate: JSString = "ontextformatupdate" + static let ontextupdate: JSString = "ontextupdate" static let ontimeout: JSString = "ontimeout" static let ontimeupdate: JSString = "ontimeupdate" static let ontoggle: JSString = "ontoggle" + static let ontonechange: JSString = "ontonechange" + static let ontouchcancel: JSString = "ontouchcancel" + static let ontouchend: JSString = "ontouchend" + static let ontouchmove: JSString = "ontouchmove" + static let ontouchstart: JSString = "ontouchstart" + static let ontrack: JSString = "ontrack" + static let ontransitioncancel: JSString = "ontransitioncancel" + static let ontransitionend: JSString = "ontransitionend" + static let ontransitionrun: JSString = "ontransitionrun" + static let ontransitionstart: JSString = "ontransitionstart" + static let onuncapturederror: JSString = "onuncapturederror" static let onunhandledrejection: JSString = "onunhandledrejection" static let onunload: JSString = "onunload" + static let onunmute: JSString = "onunmute" + static let onupdate: JSString = "onupdate" + static let onupdateend: JSString = "onupdateend" + static let onupdatefound: JSString = "onupdatefound" + static let onupdatestart: JSString = "onupdatestart" + static let onupgradeneeded: JSString = "onupgradeneeded" + static let onversionchange: JSString = "onversionchange" static let onvisibilitychange: JSString = "onvisibilitychange" + static let onvoiceschanged: JSString = "onvoiceschanged" static let onvolumechange: JSString = "onvolumechange" static let onwaiting: JSString = "onwaiting" + static let onwaitingforkey: JSString = "onwaitingforkey" static let onwebkitanimationend: JSString = "onwebkitanimationend" static let onwebkitanimationiteration: JSString = "onwebkitanimationiteration" static let onwebkitanimationstart: JSString = "onwebkitanimationstart" static let onwebkittransitionend: JSString = "onwebkittransitionend" static let onwheel: JSString = "onwheel" static let open: JSString = "open" + static let openCursor: JSString = "openCursor" + static let openKeyCursor: JSString = "openKeyCursor" + static let openWindow: JSString = "openWindow" + static let opened: JSString = "opened" static let opener: JSString = "opener" + static let operation: JSString = "operation" + static let operator: JSString = "operator" + static let optimizeForLatency: JSString = "optimizeForLatency" static let optimum: JSString = "optimum" + static let optionalFeatures: JSString = "optionalFeatures" + static let optionalManufacturerData: JSString = "optionalManufacturerData" + static let optionalServices: JSString = "optionalServices" static let options: JSString = "options" + static let orderX: JSString = "orderX" + static let orderY: JSString = "orderY" + static let ordered: JSString = "ordered" + static let organization: JSString = "organization" + static let orient: JSString = "orient" + static let orientAngle: JSString = "orientAngle" + static let orientType: JSString = "orientType" + static let orientation: JSString = "orientation" + static let orientationX: JSString = "orientationX" + static let orientationY: JSString = "orientationY" + static let orientationZ: JSString = "orientationZ" static let origin: JSString = "origin" static let originAgentCluster: JSString = "originAgentCluster" + static let originPolicyIds: JSString = "originPolicyIds" + static let originTime: JSString = "originTime" + static let originalPolicy: JSString = "originalPolicy" + static let ornaments: JSString = "ornaments" static let oscpu: JSString = "oscpu" + static let oth: JSString = "oth" + static let otp: JSString = "otp" + static let outerHTML: JSString = "outerHTML" + static let outerHeight: JSString = "outerHeight" static let outerText: JSString = "outerText" + static let outerWidth: JSString = "outerWidth" + static let outgoingHighWaterMark: JSString = "outgoingHighWaterMark" + static let outgoingMaxAge: JSString = "outgoingMaxAge" + static let output: JSString = "output" + static let outputBuffer: JSString = "outputBuffer" + static let outputChannelCount: JSString = "outputChannelCount" + static let outputLatency: JSString = "outputLatency" + static let outputPadding: JSString = "outputPadding" + static let outputReports: JSString = "outputReports" + static let outputSizes: JSString = "outputSizes" + static let outputs: JSString = "outputs" + static let overlaysContent: JSString = "overlaysContent" + static let overrideColors: JSString = "overrideColors" static let overrideMimeType: JSString = "overrideMimeType" + static let oversample: JSString = "oversample" + static let overset: JSString = "overset" + static let overwrite: JSString = "overwrite" static let ownerDocument: JSString = "ownerDocument" static let ownerElement: JSString = "ownerElement" static let ownerNode: JSString = "ownerNode" static let ownerRule: JSString = "ownerRule" + static let ownerSVGElement: JSString = "ownerSVGElement" + static let p: JSString = "p" static let p1: JSString = "p1" static let p2: JSString = "p2" static let p3: JSString = "p3" static let p4: JSString = "p4" + static let packetSize: JSString = "packetSize" + static let packets: JSString = "packets" + static let packetsContributedTo: JSString = "packetsContributedTo" + static let packetsDiscarded: JSString = "packetsDiscarded" + static let packetsDiscardedOnSend: JSString = "packetsDiscardedOnSend" + static let packetsDuplicated: JSString = "packetsDuplicated" + static let packetsFailedDecryption: JSString = "packetsFailedDecryption" + static let packetsLost: JSString = "packetsLost" + static let packetsReceived: JSString = "packetsReceived" + static let packetsRepaired: JSString = "packetsRepaired" + static let packetsSent: JSString = "packetsSent" + static let pad: JSString = "pad" + static let padding: JSString = "padding" + static let pageLeft: JSString = "pageLeft" + static let pageTop: JSString = "pageTop" + static let pageX: JSString = "pageX" + static let pageXOffset: JSString = "pageXOffset" + static let pageY: JSString = "pageY" + static let pageYOffset: JSString = "pageYOffset" + static let paintWorklet: JSString = "paintWorklet" + static let palettes: JSString = "palettes" + static let pan: JSString = "pan" + static let panTiltZoom: JSString = "panTiltZoom" + static let panningModel: JSString = "panningModel" + static let parameterData: JSString = "parameterData" + static let parameters: JSString = "parameters" static let parent: JSString = "parent" static let parentElement: JSString = "parentElement" + static let parentId: JSString = "parentId" static let parentNode: JSString = "parentNode" static let parentRule: JSString = "parentRule" static let parentStyleSheet: JSString = "parentStyleSheet" + static let parity: JSString = "parity" + static let parse: JSString = "parse" + static let parseAll: JSString = "parseAll" + static let parseCommaValueList: JSString = "parseCommaValueList" + static let parseDeclaration: JSString = "parseDeclaration" + static let parseDeclarationList: JSString = "parseDeclarationList" static let parseFromString: JSString = "parseFromString" + static let parseRule: JSString = "parseRule" + static let parseRuleList: JSString = "parseRuleList" + static let parseStylesheet: JSString = "parseStylesheet" + static let parseValue: JSString = "parseValue" + static let parseValueList: JSString = "parseValueList" + static let part: JSString = "part" + static let partialFramesLost: JSString = "partialFramesLost" + static let passOp: JSString = "passOp" static let passive: JSString = "passive" static let password: JSString = "password" + static let path: JSString = "path" + static let pathLength: JSString = "pathLength" static let pathname: JSString = "pathname" static let pattern: JSString = "pattern" + static let patternContentUnits: JSString = "patternContentUnits" static let patternMismatch: JSString = "patternMismatch" + static let patternTransform: JSString = "patternTransform" + static let patternUnits: JSString = "patternUnits" static let pause: JSString = "pause" + static let pauseAnimations: JSString = "pauseAnimations" static let pauseOnExit: JSString = "pauseOnExit" + static let pauseTransformFeedback: JSString = "pauseTransformFeedback" static let paused: JSString = "paused" + static let payeeOrigin: JSString = "payeeOrigin" + static let payloadType: JSString = "payloadType" + static let payment: JSString = "payment" + static let paymentManager: JSString = "paymentManager" + static let paymentMethod: JSString = "paymentMethod" + static let paymentMethodErrors: JSString = "paymentMethodErrors" + static let paymentRequestId: JSString = "paymentRequestId" + static let paymentRequestOrigin: JSString = "paymentRequestOrigin" + static let pc: JSString = "pc" static let pdfViewerEnabled: JSString = "pdfViewerEnabled" + static let peerIdentity: JSString = "peerIdentity" + static let pending: JSString = "pending" + static let pendingLocalDescription: JSString = "pendingLocalDescription" + static let pendingRemoteDescription: JSString = "pendingRemoteDescription" + static let perDscpPacketsReceived: JSString = "perDscpPacketsReceived" + static let perDscpPacketsSent: JSString = "perDscpPacketsSent" + static let percent: JSString = "percent" + static let percentHint: JSString = "percentHint" + static let percentageBlockSize: JSString = "percentageBlockSize" + static let percentageInlineSize: JSString = "percentageInlineSize" static let performance: JSString = "performance" + static let performanceTime: JSString = "performanceTime" + static let periodicSync: JSString = "periodicSync" + static let periodicWave: JSString = "periodicWave" + static let permission: JSString = "permission" + static let permissionState: JSString = "permissionState" + static let permissions: JSString = "permissions" + static let permissionsPolicy: JSString = "permissionsPolicy" + static let permutation: JSString = "permutation" + static let persist: JSString = "persist" static let persisted: JSString = "persisted" + static let persistentState: JSString = "persistentState" static let personalbar: JSString = "personalbar" + static let phase: JSString = "phase" + static let phone: JSString = "phone" + static let physicalMaximum: JSString = "physicalMaximum" + static let physicalMinimum: JSString = "physicalMinimum" + static let pictureInPictureElement: JSString = "pictureInPictureElement" + static let pictureInPictureEnabled: JSString = "pictureInPictureEnabled" + static let pictureInPictureWindow: JSString = "pictureInPictureWindow" static let ping: JSString = "ping" static let pipeThrough: JSString = "pipeThrough" static let pipeTo: JSString = "pipeTo" + static let pitch: JSString = "pitch" + static let pixelDepth: JSString = "pixelDepth" + static let pixelStorei: JSString = "pixelStorei" static let placeholder: JSString = "placeholder" + static let planeIndex: JSString = "planeIndex" static let platform: JSString = "platform" + static let platformVersion: JSString = "platformVersion" static let play: JSString = "play" + static let playState: JSString = "playState" static let playbackRate: JSString = "playbackRate" + static let playbackState: JSString = "playbackState" + static let playbackTime: JSString = "playbackTime" static let played: JSString = "played" static let playsInline: JSString = "playsInline" + static let pliCount: JSString = "pliCount" static let plugins: JSString = "plugins" static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" + static let pointerId: JSString = "pointerId" + static let pointerLockElement: JSString = "pointerLockElement" + static let pointerMovementScrolls: JSString = "pointerMovementScrolls" + static let pointerType: JSString = "pointerType" + static let points: JSString = "points" + static let pointsAtX: JSString = "pointsAtX" + static let pointsAtY: JSString = "pointsAtY" + static let pointsAtZ: JSString = "pointsAtZ" + static let pointsOfInterest: JSString = "pointsOfInterest" + static let polygonOffset: JSString = "polygonOffset" + static let popDebugGroup: JSString = "popDebugGroup" + static let popErrorScope: JSString = "popErrorScope" + static let populateMatrix: JSString = "populateMatrix" static let port: JSString = "port" static let port1: JSString = "port1" static let port2: JSString = "port2" + static let portalHost: JSString = "portalHost" static let ports: JSString = "ports" + static let pose: JSString = "pose" static let position: JSString = "position" + static let positionAlign: JSString = "positionAlign" + static let positionX: JSString = "positionX" + static let positionY: JSString = "positionY" + static let positionZ: JSString = "positionZ" static let postMessage: JSString = "postMessage" + static let postTask: JSString = "postTask" + static let postalCode: JSString = "postalCode" static let poster: JSString = "poster" + static let postscriptName: JSString = "postscriptName" + static let pow: JSString = "pow" + static let powerEfficient: JSString = "powerEfficient" + static let powerPreference: JSString = "powerPreference" static let preMultiplySelf: JSString = "preMultiplySelf" + static let precision: JSString = "precision" + static let predictedDisplayTime: JSString = "predictedDisplayTime" + static let predictedEvents: JSString = "predictedEvents" + static let preferAnimation: JSString = "preferAnimation" + static let preferCurrentTab: JSString = "preferCurrentTab" + static let preferredReflectionFormat: JSString = "preferredReflectionFormat" static let prefix: JSString = "prefix" static let preload: JSString = "preload" + static let preloadResponse: JSString = "preloadResponse" + static let prelude: JSString = "prelude" + static let premultipliedAlpha: JSString = "premultipliedAlpha" static let premultiplyAlpha: JSString = "premultiplyAlpha" static let prepend: JSString = "prepend" + static let presentation: JSString = "presentation" + static let presentationArea: JSString = "presentationArea" + static let presentationStyle: JSString = "presentationStyle" + static let presentationTime: JSString = "presentationTime" + static let presentedFrames: JSString = "presentedFrames" + static let preserveAlpha: JSString = "preserveAlpha" + static let preserveAspectRatio: JSString = "preserveAspectRatio" + static let preserveDrawingBuffer: JSString = "preserveDrawingBuffer" static let preservesPitch: JSString = "preservesPitch" + static let pressed: JSString = "pressed" + static let pressure: JSString = "pressure" static let prevValue: JSString = "prevValue" static let preventAbort: JSString = "preventAbort" static let preventCancel: JSString = "preventCancel" static let preventClose: JSString = "preventClose" static let preventDefault: JSString = "preventDefault" static let preventScroll: JSString = "preventScroll" + static let preventSilentAccess: JSString = "preventSilentAccess" static let previousElementSibling: JSString = "previousElementSibling" static let previousNode: JSString = "previousNode" + static let previousPriority: JSString = "previousPriority" + static let previousRect: JSString = "previousRect" static let previousSibling: JSString = "previousSibling" + static let price: JSString = "price" + static let primaries: JSString = "primaries" + static let primaryKey: JSString = "primaryKey" + static let primaryLightDirection: JSString = "primaryLightDirection" + static let primaryLightIntensity: JSString = "primaryLightIntensity" + static let primitive: JSString = "primitive" + static let primitiveUnits: JSString = "primitiveUnits" static let print: JSString = "print" + static let priority: JSString = "priority" + static let privateKey: JSString = "privateKey" + static let probeSpace: JSString = "probeSpace" + static let processingDuration: JSString = "processingDuration" + static let processingEnd: JSString = "processingEnd" + static let processingStart: JSString = "processingStart" + static let processorOptions: JSString = "processorOptions" + static let produceCropTarget: JSString = "produceCropTarget" static let product: JSString = "product" + static let productId: JSString = "productId" + static let productName: JSString = "productName" static let productSub: JSString = "productSub" + static let profile: JSString = "profile" + static let profiles: JSString = "profiles" + static let progress: JSString = "progress" + static let projectionMatrix: JSString = "projectionMatrix" static let promise: JSString = "promise" static let prompt: JSString = "prompt" + static let properties: JSString = "properties" + static let propertyName: JSString = "propertyName" static let `protocol`: JSString = "protocol" + static let protocolCode: JSString = "protocolCode" + static let protocols: JSString = "protocols" + static let provider: JSString = "provider" + static let providers: JSString = "providers" + static let pseudo: JSString = "pseudo" + static let pseudoElement: JSString = "pseudoElement" + static let pt: JSString = "pt" + static let pubKeyCredParams: JSString = "pubKeyCredParams" + static let public: JSString = "public" + static let publicExponent: JSString = "publicExponent" static let publicId: JSString = "publicId" + static let publicKey: JSString = "publicKey" static let pull: JSString = "pull" + static let pulse: JSString = "pulse" + static let purchaseToken: JSString = "purchaseToken" + static let pushDebugGroup: JSString = "pushDebugGroup" + static let pushErrorScope: JSString = "pushErrorScope" + static let pushManager: JSString = "pushManager" static let pushState: JSString = "pushState" + static let put: JSString = "put" static let putImageData: JSString = "putImageData" + static let px: JSString = "px" + static let q: JSString = "q" + static let qi: JSString = "qi" + static let qpSum: JSString = "qpSum" static let quadraticCurveTo: JSString = "quadraticCurveTo" static let quality: JSString = "quality" + static let qualityLimitationDurations: JSString = "qualityLimitationDurations" + static let qualityLimitationReason: JSString = "qualityLimitationReason" + static let qualityLimitationResolutionChanges: JSString = "qualityLimitationResolutionChanges" + static let quaternion: JSString = "quaternion" + static let query: JSString = "query" static let queryCommandEnabled: JSString = "queryCommandEnabled" static let queryCommandIndeterm: JSString = "queryCommandIndeterm" static let queryCommandState: JSString = "queryCommandState" static let queryCommandSupported: JSString = "queryCommandSupported" static let queryCommandValue: JSString = "queryCommandValue" + static let queryCounterEXT: JSString = "queryCounterEXT" + static let queryIndex: JSString = "queryIndex" + static let queryPermission: JSString = "queryPermission" static let querySelector: JSString = "querySelector" static let querySelectorAll: JSString = "querySelectorAll" + static let querySet: JSString = "querySet" + static let queue: JSString = "queue" + static let quota: JSString = "quota" + static let r: JSString = "r" + static let rad: JSString = "rad" + static let radius: JSString = "radius" + static let radiusX: JSString = "radiusX" + static let radiusY: JSString = "radiusY" + static let randomUUID: JSString = "randomUUID" + static let range: JSString = "range" + static let rangeCount: JSString = "rangeCount" + static let rangeEnd: JSString = "rangeEnd" + static let rangeMax: JSString = "rangeMax" + static let rangeMin: JSString = "rangeMin" static let rangeOverflow: JSString = "rangeOverflow" + static let rangeStart: JSString = "rangeStart" static let rangeUnderflow: JSString = "rangeUnderflow" + static let rate: JSString = "rate" + static let ratio: JSString = "ratio" + static let rawId: JSString = "rawId" + static let rawValue: JSString = "rawValue" + static let rawValueToMeters: JSString = "rawValueToMeters" static let read: JSString = "read" static let readAsArrayBuffer: JSString = "readAsArrayBuffer" static let readAsBinaryString: JSString = "readAsBinaryString" static let readAsDataURL: JSString = "readAsDataURL" static let readAsText: JSString = "readAsText" + static let readBuffer: JSString = "readBuffer" + static let readEntries: JSString = "readEntries" static let readOnly: JSString = "readOnly" + static let readPixels: JSString = "readPixels" + static let readText: JSString = "readText" + static let readValue: JSString = "readValue" static let readable: JSString = "readable" static let readableType: JSString = "readableType" static let ready: JSString = "ready" static let readyState: JSString = "readyState" + static let real: JSString = "real" static let reason: JSString = "reason" + static let receiveFeatureReport: JSString = "receiveFeatureReport" + static let receiveTime: JSString = "receiveTime" + static let receivedAlert: JSString = "receivedAlert" + static let receiver: JSString = "receiver" + static let receiverId: JSString = "receiverId" + static let receiverWindow: JSString = "receiverWindow" + static let recipient: JSString = "recipient" + static let recommendedViewportScale: JSString = "recommendedViewportScale" + static let reconnect: JSString = "reconnect" + static let recordType: JSString = "recordType" + static let records: JSString = "records" + static let recordsAvailable: JSString = "recordsAvailable" static let rect: JSString = "rect" + static let recurrentBias: JSString = "recurrentBias" + static let recursive: JSString = "recursive" + static let redEyeReduction: JSString = "redEyeReduction" static let redirect: JSString = "redirect" + static let redirectCount: JSString = "redirectCount" + static let redirectEnd: JSString = "redirectEnd" + static let redirectStart: JSString = "redirectStart" static let redirected: JSString = "redirected" + static let reduceL1: JSString = "reduceL1" + static let reduceL2: JSString = "reduceL2" + static let reduceLogSum: JSString = "reduceLogSum" + static let reduceLogSumExp: JSString = "reduceLogSumExp" + static let reduceMax: JSString = "reduceMax" + static let reduceMean: JSString = "reduceMean" + static let reduceMin: JSString = "reduceMin" + static let reduceProduct: JSString = "reduceProduct" + static let reduceSum: JSString = "reduceSum" + static let reduceSumSquare: JSString = "reduceSumSquare" + static let reducedSize: JSString = "reducedSize" + static let reduction: JSString = "reduction" + static let refDistance: JSString = "refDistance" + static let refX: JSString = "refX" + static let refY: JSString = "refY" + static let referenceFrame: JSString = "referenceFrame" static let referenceNode: JSString = "referenceNode" + static let referenceSpace: JSString = "referenceSpace" static let referrer: JSString = "referrer" static let referrerPolicy: JSString = "referrerPolicy" + static let referringDevice: JSString = "referringDevice" + static let reflectionFormat: JSString = "reflectionFormat" static let refresh: JSString = "refresh" + static let region: JSString = "region" + static let regionAnchorX: JSString = "regionAnchorX" + static let regionAnchorY: JSString = "regionAnchorY" + static let regionOverset: JSString = "regionOverset" + static let register: JSString = "register" + static let registerAnimator: JSString = "registerAnimator" + static let registerAttributionSource: JSString = "registerAttributionSource" + static let registerLayout: JSString = "registerLayout" + static let registerPaint: JSString = "registerPaint" + static let registerProcessor: JSString = "registerProcessor" + static let registerProperty: JSString = "registerProperty" static let registerProtocolHandler: JSString = "registerProtocolHandler" + static let registration: JSString = "registration" static let rel: JSString = "rel" static let relList: JSString = "relList" + static let relatedAddress: JSString = "relatedAddress" static let relatedNode: JSString = "relatedNode" + static let relatedPort: JSString = "relatedPort" static let relatedTarget: JSString = "relatedTarget" + static let relativeTo: JSString = "relativeTo" + static let relayProtocol: JSString = "relayProtocol" + static let relayedSource: JSString = "relayedSource" + static let release: JSString = "release" static let releaseEvents: JSString = "releaseEvents" + static let releaseInterface: JSString = "releaseInterface" static let releaseLock: JSString = "releaseLock" + static let releasePointerCapture: JSString = "releasePointerCapture" + static let released: JSString = "released" + static let reliableWrite: JSString = "reliableWrite" static let reload: JSString = "reload" + static let relu: JSString = "relu" + static let rem: JSString = "rem" + static let remote: JSString = "remote" + static let remoteCandidateId: JSString = "remoteCandidateId" + static let remoteCertificateId: JSString = "remoteCertificateId" + static let remoteDescription: JSString = "remoteDescription" + static let remoteId: JSString = "remoteId" + static let remoteTimestamp: JSString = "remoteTimestamp" static let remove: JSString = "remove" + static let removeAllRanges: JSString = "removeAllRanges" static let removeAttribute: JSString = "removeAttribute" static let removeAttributeNS: JSString = "removeAttributeNS" static let removeAttributeNode: JSString = "removeAttributeNode" static let removeChild: JSString = "removeChild" static let removeCue: JSString = "removeCue" + static let removeEntry: JSString = "removeEntry" + static let removeItem: JSString = "removeItem" + static let removeListener: JSString = "removeListener" static let removeNamedItem: JSString = "removeNamedItem" static let removeNamedItemNS: JSString = "removeNamedItemNS" static let removeParameter: JSString = "removeParameter" static let removeProperty: JSString = "removeProperty" + static let removeRange: JSString = "removeRange" static let removeRule: JSString = "removeRule" + static let removeSourceBuffer: JSString = "removeSourceBuffer" + static let removeTrack: JSString = "removeTrack" + static let removed: JSString = "removed" static let removedNodes: JSString = "removedNodes" + static let removedSamplesForAcceleration: JSString = "removedSamplesForAcceleration" + static let renderState: JSString = "renderState" + static let renderTime: JSString = "renderTime" + static let renderbufferStorage: JSString = "renderbufferStorage" + static let renderbufferStorageMultisample: JSString = "renderbufferStorageMultisample" + static let renderedBuffer: JSString = "renderedBuffer" + static let renotify: JSString = "renotify" static let `repeat`: JSString = "repeat" + static let repetitionCount: JSString = "repetitionCount" static let replace: JSString = "replace" static let replaceChild: JSString = "replaceChild" static let replaceChildren: JSString = "replaceChildren" static let replaceData: JSString = "replaceData" + static let replaceItem: JSString = "replaceItem" static let replaceState: JSString = "replaceState" static let replaceSync: JSString = "replaceSync" + static let replaceTrack: JSString = "replaceTrack" static let replaceWith: JSString = "replaceWith" + static let replacesClientId: JSString = "replacesClientId" + static let reportCount: JSString = "reportCount" static let reportError: JSString = "reportError" + static let reportId: JSString = "reportId" + static let reportSize: JSString = "reportSize" static let reportValidity: JSString = "reportValidity" + static let reportsReceived: JSString = "reportsReceived" + static let reportsSent: JSString = "reportsSent" + static let request: JSString = "request" + static let requestAdapter: JSString = "requestAdapter" + static let requestAnimationFrame: JSString = "requestAnimationFrame" + static let requestBytesSent: JSString = "requestBytesSent" + static let requestData: JSString = "requestData" + static let requestDevice: JSString = "requestDevice" + static let requestFrame: JSString = "requestFrame" + static let requestFullscreen: JSString = "requestFullscreen" + static let requestHitTestSource: JSString = "requestHitTestSource" + static let requestHitTestSourceForTransientInput: JSString = "requestHitTestSourceForTransientInput" + static let requestId: JSString = "requestId" + static let requestIdleCallback: JSString = "requestIdleCallback" + static let requestLightProbe: JSString = "requestLightProbe" + static let requestMIDIAccess: JSString = "requestMIDIAccess" + static let requestMediaKeySystemAccess: JSString = "requestMediaKeySystemAccess" + static let requestPermission: JSString = "requestPermission" + static let requestPictureInPicture: JSString = "requestPictureInPicture" + static let requestPointerLock: JSString = "requestPointerLock" + static let requestPort: JSString = "requestPort" + static let requestPresenter: JSString = "requestPresenter" + static let requestReferenceSpace: JSString = "requestReferenceSpace" + static let requestSession: JSString = "requestSession" + static let requestStart: JSString = "requestStart" + static let requestStorageAccess: JSString = "requestStorageAccess" static let requestSubmit: JSString = "requestSubmit" + static let requestToSend: JSString = "requestToSend" + static let requestType: JSString = "requestType" + static let requestVideoFrameCallback: JSString = "requestVideoFrameCallback" + static let requestViewportScale: JSString = "requestViewportScale" + static let requestedSamplingFrequency: JSString = "requestedSamplingFrequency" + static let requestsReceived: JSString = "requestsReceived" + static let requestsSent: JSString = "requestsSent" + static let requireInteraction: JSString = "requireInteraction" + static let requireResidentKey: JSString = "requireResidentKey" static let required: JSString = "required" + static let requiredExtensions: JSString = "requiredExtensions" + static let requiredFeatures: JSString = "requiredFeatures" + static let requiredLimits: JSString = "requiredLimits" + static let resample2d: JSString = "resample2d" static let reset: JSString = "reset" + static let resetAfter: JSString = "resetAfter" static let resetTransform: JSString = "resetTransform" + static let reshape: JSString = "reshape" + static let residentKey: JSString = "residentKey" + static let resizeBy: JSString = "resizeBy" static let resizeHeight: JSString = "resizeHeight" + static let resizeMode: JSString = "resizeMode" static let resizeQuality: JSString = "resizeQuality" + static let resizeTo: JSString = "resizeTo" static let resizeWidth: JSString = "resizeWidth" + static let resolution: JSString = "resolution" + static let resolve: JSString = "resolve" + static let resolveQuerySet: JSString = "resolveQuerySet" + static let resolveTarget: JSString = "resolveTarget" + static let resource: JSString = "resource" + static let resourceId: JSString = "resourceId" + static let resources: JSString = "resources" static let respond: JSString = "respond" + static let respondWith: JSString = "respondWith" static let respondWithNewView: JSString = "respondWithNewView" static let response: JSString = "response" + static let responseBytesSent: JSString = "responseBytesSent" + static let responseEnd: JSString = "responseEnd" + static let responseReady: JSString = "responseReady" + static let responseStart: JSString = "responseStart" static let responseText: JSString = "responseText" static let responseType: JSString = "responseType" static let responseURL: JSString = "responseURL" static let responseXML: JSString = "responseXML" + static let responsesReceived: JSString = "responsesReceived" + static let responsesSent: JSString = "responsesSent" + static let restartIce: JSString = "restartIce" static let restore: JSString = "restore" + static let restoreContext: JSString = "restoreContext" + static let restrictOwnAudio: JSString = "restrictOwnAudio" static let result: JSString = "result" + static let resultIndex: JSString = "resultIndex" static let resultType: JSString = "resultType" + static let resultingClientId: JSString = "resultingClientId" + static let results: JSString = "results" + static let resume: JSString = "resume" + static let resumeTransformFeedback: JSString = "resumeTransformFeedback" + static let retransmissionsReceived: JSString = "retransmissionsReceived" + static let retransmissionsSent: JSString = "retransmissionsSent" + static let retransmittedBytesSent: JSString = "retransmittedBytesSent" + static let retransmittedPacketsSent: JSString = "retransmittedPacketsSent" + static let retry: JSString = "retry" + static let returnSequence: JSString = "returnSequence" static let returnValue: JSString = "returnValue" static let rev: JSString = "rev" + static let reverse: JSString = "reverse" static let reversed: JSString = "reversed" + static let revoke: JSString = "revoke" static let revokeObjectURL: JSString = "revokeObjectURL" + static let rid: JSString = "rid" static let right: JSString = "right" + static let ringIndicator: JSString = "ringIndicator" + static let rk: JSString = "rk" + static let rlh: JSString = "rlh" + static let robustness: JSString = "robustness" static let role: JSString = "role" + static let rollback: JSString = "rollback" + static let rolloffFactor: JSString = "rolloffFactor" static let root: JSString = "root" + static let rootBounds: JSString = "rootBounds" + static let rootElement: JSString = "rootElement" + static let rootMargin: JSString = "rootMargin" static let rotate: JSString = "rotate" static let rotateAxisAngle: JSString = "rotateAxisAngle" static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" static let rotateFromVector: JSString = "rotateFromVector" static let rotateFromVectorSelf: JSString = "rotateFromVectorSelf" static let rotateSelf: JSString = "rotateSelf" + static let rotationAngle: JSString = "rotationAngle" + static let rotationRate: JSString = "rotationRate" static let roundRect: JSString = "roundRect" + static let roundTripTime: JSString = "roundTripTime" + static let roundTripTimeMeasurements: JSString = "roundTripTimeMeasurements" + static let roundingType: JSString = "roundingType" static let rowIndex: JSString = "rowIndex" static let rowSpan: JSString = "rowSpan" static let rows: JSString = "rows" + static let rowsPerImage: JSString = "rowsPerImage" + static let rp: JSString = "rp" + static let rpId: JSString = "rpId" + static let rssi: JSString = "rssi" + static let rtcIdentityProvider: JSString = "rtcIdentityProvider" + static let rtcp: JSString = "rtcp" + static let rtcpMuxPolicy: JSString = "rtcpMuxPolicy" + static let rtcpTransportStatsId: JSString = "rtcpTransportStatsId" + static let rtpTimestamp: JSString = "rtpTimestamp" + static let rtt: JSString = "rtt" + static let rttVariation: JSString = "rttVariation" + static let rtxSsrc: JSString = "rtxSsrc" static let rules: JSString = "rules" + static let rx: JSString = "rx" + static let ry: JSString = "ry" + static let s: JSString = "s" + static let sRGBHex: JSString = "sRGBHex" + static let salt: JSString = "salt" + static let saltLength: JSString = "saltLength" + static let sameDocument: JSString = "sameDocument" + static let sameSite: JSString = "sameSite" + static let sample: JSString = "sample" + static let sampleCount: JSString = "sampleCount" + static let sampleCoverage: JSString = "sampleCoverage" + static let sampleInterval: JSString = "sampleInterval" + static let sampleRate: JSString = "sampleRate" + static let sampleSize: JSString = "sampleSize" + static let sampleType: JSString = "sampleType" + static let sampler: JSString = "sampler" + static let samplerParameterf: JSString = "samplerParameterf" + static let samplerParameteri: JSString = "samplerParameteri" + static let samplerate: JSString = "samplerate" + static let samples: JSString = "samples" + static let samplesDecodedWithCelt: JSString = "samplesDecodedWithCelt" + static let samplesDecodedWithSilk: JSString = "samplesDecodedWithSilk" + static let samplesEncodedWithCelt: JSString = "samplesEncodedWithCelt" + static let samplesEncodedWithSilk: JSString = "samplesEncodedWithSilk" static let sandbox: JSString = "sandbox" + static let sanitize: JSString = "sanitize" + static let sanitizeFor: JSString = "sanitizeFor" + static let sanitizer: JSString = "sanitizer" + static let saturation: JSString = "saturation" static let save: JSString = "save" + static let saveData: JSString = "saveData" + static let scalabilityMode: JSString = "scalabilityMode" + static let scalabilityModes: JSString = "scalabilityModes" static let scale: JSString = "scale" static let scale3d: JSString = "scale3d" static let scale3dSelf: JSString = "scale3dSelf" + static let scaleFactor: JSString = "scaleFactor" static let scaleNonUniform: JSString = "scaleNonUniform" + static let scaleResolutionDownBy: JSString = "scaleResolutionDownBy" static let scaleSelf: JSString = "scaleSelf" + static let scales: JSString = "scales" + static let scan: JSString = "scan" + static let scheduler: JSString = "scheduler" + static let scheduling: JSString = "scheduling" static let scheme: JSString = "scheme" + static let scissor: JSString = "scissor" static let scope: JSString = "scope" + static let screen: JSString = "screen" + static let screenLeft: JSString = "screenLeft" + static let screenState: JSString = "screenState" + static let screenTop: JSString = "screenTop" static let screenX: JSString = "screenX" static let screenY: JSString = "screenY" + static let scriptURL: JSString = "scriptURL" static let scripts: JSString = "scripts" + static let scroll: JSString = "scroll" static let scrollAmount: JSString = "scrollAmount" + static let scrollBy: JSString = "scrollBy" static let scrollDelay: JSString = "scrollDelay" + static let scrollHeight: JSString = "scrollHeight" + static let scrollIntoView: JSString = "scrollIntoView" + static let scrollLeft: JSString = "scrollLeft" + static let scrollOffsets: JSString = "scrollOffsets" static let scrollPathIntoView: JSString = "scrollPathIntoView" static let scrollRestoration: JSString = "scrollRestoration" + static let scrollTo: JSString = "scrollTo" + static let scrollTop: JSString = "scrollTop" + static let scrollWidth: JSString = "scrollWidth" + static let scrollX: JSString = "scrollX" + static let scrollY: JSString = "scrollY" static let scrollbars: JSString = "scrollbars" static let scrolling: JSString = "scrolling" + static let scrollingElement: JSString = "scrollingElement" + static let sctp: JSString = "sctp" + static let sctpCauseCode: JSString = "sctpCauseCode" + static let sdp: JSString = "sdp" + static let sdpFmtpLine: JSString = "sdpFmtpLine" + static let sdpLineNumber: JSString = "sdpLineNumber" + static let sdpMLineIndex: JSString = "sdpMLineIndex" + static let sdpMid: JSString = "sdpMid" static let search: JSString = "search" + static let searchParams: JSString = "searchParams" static let sectionRowIndex: JSString = "sectionRowIndex" + static let secure: JSString = "secure" + static let secureConnectionStart: JSString = "secureConnectionStart" + static let seed: JSString = "seed" + static let seek: JSString = "seek" + static let seekOffset: JSString = "seekOffset" + static let seekTime: JSString = "seekTime" static let seekable: JSString = "seekable" static let seeking: JSString = "seeking" + static let segments: JSString = "segments" static let select: JSString = "select" + static let selectAllChildren: JSString = "selectAllChildren" + static let selectAlternateInterface: JSString = "selectAlternateInterface" + static let selectAudioOutput: JSString = "selectAudioOutput" + static let selectConfiguration: JSString = "selectConfiguration" static let selectNode: JSString = "selectNode" static let selectNodeContents: JSString = "selectNodeContents" + static let selectSubString: JSString = "selectSubString" static let selected: JSString = "selected" + static let selectedCandidatePairChanges: JSString = "selectedCandidatePairChanges" + static let selectedCandidatePairId: JSString = "selectedCandidatePairId" static let selectedIndex: JSString = "selectedIndex" static let selectedOptions: JSString = "selectedOptions" + static let selectedTrack: JSString = "selectedTrack" + static let selectionBound: JSString = "selectionBound" static let selectionDirection: JSString = "selectionDirection" static let selectionEnd: JSString = "selectionEnd" static let selectionStart: JSString = "selectionStart" static let selectorText: JSString = "selectorText" static let send: JSString = "send" + static let sendBeacon: JSString = "sendBeacon" + static let sendEncodings: JSString = "sendEncodings" + static let sendFeatureReport: JSString = "sendFeatureReport" + static let sendKeyFrameRequest: JSString = "sendKeyFrameRequest" + static let sendReport: JSString = "sendReport" + static let sender: JSString = "sender" + static let senderId: JSString = "senderId" + static let sentAlert: JSString = "sentAlert" + static let serial: JSString = "serial" + static let serialNumber: JSString = "serialNumber" + static let serializeToString: JSString = "serializeToString" + static let serverCertificateHashes: JSString = "serverCertificateHashes" + static let serverTiming: JSString = "serverTiming" + static let service: JSString = "service" + static let serviceData: JSString = "serviceData" + static let serviceWorker: JSString = "serviceWorker" + static let services: JSString = "services" + static let session: JSString = "session" + static let sessionId: JSString = "sessionId" static let sessionStorage: JSString = "sessionStorage" + static let sessionTypes: JSString = "sessionTypes" static let set: JSString = "set" + static let setActionHandler: JSString = "setActionHandler" + static let setAppBadge: JSString = "setAppBadge" static let setAttribute: JSString = "setAttribute" static let setAttributeNS: JSString = "setAttributeNS" static let setAttributeNode: JSString = "setAttributeNode" static let setAttributeNodeNS: JSString = "setAttributeNodeNS" + static let setBaseAndExtent: JSString = "setBaseAndExtent" + static let setBindGroup: JSString = "setBindGroup" + static let setBlendConstant: JSString = "setBlendConstant" + static let setCameraActive: JSString = "setCameraActive" + static let setClientBadge: JSString = "setClientBadge" + static let setCodecPreferences: JSString = "setCodecPreferences" + static let setConfiguration: JSString = "setConfiguration" + static let setCurrentTime: JSString = "setCurrentTime" static let setCustomValidity: JSString = "setCustomValidity" static let setData: JSString = "setData" static let setDragImage: JSString = "setDragImage" + static let setEncryptionKey: JSString = "setEncryptionKey" static let setEnd: JSString = "setEnd" static let setEndAfter: JSString = "setEndAfter" static let setEndBefore: JSString = "setEndBefore" static let setFormValue: JSString = "setFormValue" + static let setHTML: JSString = "setHTML" + static let setHeaderValue: JSString = "setHeaderValue" + static let setIdentityProvider: JSString = "setIdentityProvider" + static let setIndexBuffer: JSString = "setIndexBuffer" static let setInterval: JSString = "setInterval" + static let setKeyframes: JSString = "setKeyframes" static let setLineDash: JSString = "setLineDash" + static let setLiveSeekableRange: JSString = "setLiveSeekableRange" + static let setLocalDescription: JSString = "setLocalDescription" + static let setMatrix: JSString = "setMatrix" static let setMatrixValue: JSString = "setMatrixValue" + static let setMediaKeys: JSString = "setMediaKeys" + static let setMicrophoneActive: JSString = "setMicrophoneActive" static let setNamedItem: JSString = "setNamedItem" static let setNamedItemNS: JSString = "setNamedItemNS" + static let setOrientToAngle: JSString = "setOrientToAngle" + static let setOrientToAuto: JSString = "setOrientToAuto" + static let setOrientation: JSString = "setOrientation" static let setParameter: JSString = "setParameter" + static let setParameters: JSString = "setParameters" + static let setPeriodicWave: JSString = "setPeriodicWave" + static let setPipeline: JSString = "setPipeline" + static let setPointerCapture: JSString = "setPointerCapture" + static let setPosition: JSString = "setPosition" + static let setPositionState: JSString = "setPositionState" + static let setPriority: JSString = "setPriority" static let setProperty: JSString = "setProperty" static let setRangeText: JSString = "setRangeText" + static let setRemoteDescription: JSString = "setRemoteDescription" static let setRequestHeader: JSString = "setRequestHeader" + static let setResourceTimingBufferSize: JSString = "setResourceTimingBufferSize" + static let setRotate: JSString = "setRotate" + static let setScale: JSString = "setScale" + static let setScissorRect: JSString = "setScissorRect" static let setSelectionRange: JSString = "setSelectionRange" + static let setServerCertificate: JSString = "setServerCertificate" + static let setSignals: JSString = "setSignals" + static let setSinkId: JSString = "setSinkId" + static let setSkewX: JSString = "setSkewX" + static let setSkewY: JSString = "setSkewY" static let setStart: JSString = "setStart" static let setStartAfter: JSString = "setStartAfter" static let setStartBefore: JSString = "setStartBefore" + static let setStdDeviation: JSString = "setStdDeviation" + static let setStencilReference: JSString = "setStencilReference" + static let setStreams: JSString = "setStreams" + static let setTargetAtTime: JSString = "setTargetAtTime" static let setTimeout: JSString = "setTimeout" static let setTransform: JSString = "setTransform" + static let setTranslate: JSString = "setTranslate" static let setValidity: JSString = "setValidity" + static let setValueAtTime: JSString = "setValueAtTime" + static let setValueCurveAtTime: JSString = "setValueCurveAtTime" + static let setVertexBuffer: JSString = "setVertexBuffer" + static let setViewport: JSString = "setViewport" + static let shaderLocation: JSString = "shaderLocation" + static let shaderSource: JSString = "shaderSource" static let shadowBlur: JSString = "shadowBlur" static let shadowColor: JSString = "shadowColor" static let shadowOffsetX: JSString = "shadowOffsetX" static let shadowOffsetY: JSString = "shadowOffsetY" static let shadowRoot: JSString = "shadowRoot" static let shape: JSString = "shape" + static let share: JSString = "share" + static let sharpness: JSString = "sharpness" static let sheet: JSString = "sheet" static let shiftKey: JSString = "shiftKey" static let show: JSString = "show" + static let showDirectoryPicker: JSString = "showDirectoryPicker" static let showModal: JSString = "showModal" + static let showNotification: JSString = "showNotification" + static let showOpenFilePicker: JSString = "showOpenFilePicker" static let showPicker: JSString = "showPicker" + static let showSaveFilePicker: JSString = "showSaveFilePicker" + static let sigmoid: JSString = "sigmoid" + static let sign: JSString = "sign" static let signal: JSString = "signal" + static let signalingState: JSString = "signalingState" + static let signature: JSString = "signature" + static let silent: JSString = "silent" + static let silentConcealedSamples: JSString = "silentConcealedSamples" + static let sin: JSString = "sin" static let singleNodeValue: JSString = "singleNodeValue" + static let sinkId: JSString = "sinkId" static let size: JSString = "size" static let sizes: JSString = "sizes" + static let sizing: JSString = "sizing" static let skewX: JSString = "skewX" static let skewXSelf: JSString = "skewXSelf" static let skewY: JSString = "skewY" static let skewYSelf: JSString = "skewYSelf" + static let skipWaiting: JSString = "skipWaiting" + static let sliCount: JSString = "sliCount" static let slice: JSString = "slice" + static let slope: JSString = "slope" static let slot: JSString = "slot" static let slotAssignment: JSString = "slotAssignment" + static let smooth: JSString = "smooth" + static let smoothedRoundTripTime: JSString = "smoothedRoundTripTime" + static let smoothedRtt: JSString = "smoothedRtt" + static let smoothingTimeConstant: JSString = "smoothingTimeConstant" + static let snapToLines: JSString = "snapToLines" static let snapshotItem: JSString = "snapshotItem" static let snapshotLength: JSString = "snapshotLength" + static let softmax: JSString = "softmax" + static let softplus: JSString = "softplus" + static let softsign: JSString = "softsign" + static let software: JSString = "software" + static let sort: JSString = "sort" + static let sortingCode: JSString = "sortingCode" static let source: JSString = "source" + static let sourceAnimation: JSString = "sourceAnimation" + static let sourceBuffer: JSString = "sourceBuffer" + static let sourceBuffers: JSString = "sourceBuffers" + static let sourceCapabilities: JSString = "sourceCapabilities" + static let sourceFile: JSString = "sourceFile" + static let sourceMap: JSString = "sourceMap" + static let sources: JSString = "sources" + static let space: JSString = "space" + static let spacing: JSString = "spacing" static let span: JSString = "span" + static let spatialIndex: JSString = "spatialIndex" + static let spatialNavigationSearch: JSString = "spatialNavigationSearch" + static let spatialRendering: JSString = "spatialRendering" + static let speak: JSString = "speak" + static let speakAs: JSString = "speakAs" + static let speaking: JSString = "speaking" static let specified: JSString = "specified" + static let specularConstant: JSString = "specularConstant" + static let specularExponent: JSString = "specularExponent" + static let speechSynthesis: JSString = "speechSynthesis" + static let speed: JSString = "speed" static let spellcheck: JSString = "spellcheck" + static let sphericalHarmonicsCoefficients: JSString = "sphericalHarmonicsCoefficients" + static let split: JSString = "split" static let splitText: JSString = "splitText" + static let spreadMethod: JSString = "spreadMethod" + static let squeeze: JSString = "squeeze" static let src: JSString = "src" static let srcElement: JSString = "srcElement" + static let srcFactor: JSString = "srcFactor" static let srcObject: JSString = "srcObject" static let srcdoc: JSString = "srcdoc" static let srclang: JSString = "srclang" static let srcset: JSString = "srcset" + static let srtpCipher: JSString = "srtpCipher" + static let ssrc: JSString = "ssrc" + static let stackId: JSString = "stackId" + static let stacks: JSString = "stacks" static let standby: JSString = "standby" static let start: JSString = "start" static let startContainer: JSString = "startContainer" + static let startIn: JSString = "startIn" + static let startMessages: JSString = "startMessages" + static let startNotifications: JSString = "startNotifications" static let startOffset: JSString = "startOffset" + static let startRendering: JSString = "startRendering" static let startTime: JSString = "startTime" static let state: JSString = "state" + static let states: JSString = "states" static let status: JSString = "status" + static let statusCode: JSString = "statusCode" + static let statusMessage: JSString = "statusMessage" static let statusText: JSString = "statusText" static let statusbar: JSString = "statusbar" + static let stdDeviationX: JSString = "stdDeviationX" + static let stdDeviationY: JSString = "stdDeviationY" + static let steal: JSString = "steal" + static let steepness: JSString = "steepness" + static let stencil: JSString = "stencil" + static let stencilBack: JSString = "stencilBack" + static let stencilClearValue: JSString = "stencilClearValue" + static let stencilFront: JSString = "stencilFront" + static let stencilFunc: JSString = "stencilFunc" + static let stencilFuncSeparate: JSString = "stencilFuncSeparate" + static let stencilLoadOp: JSString = "stencilLoadOp" + static let stencilMask: JSString = "stencilMask" + static let stencilMaskSeparate: JSString = "stencilMaskSeparate" + static let stencilOp: JSString = "stencilOp" + static let stencilOpSeparate: JSString = "stencilOpSeparate" + static let stencilReadMask: JSString = "stencilReadMask" + static let stencilReadOnly: JSString = "stencilReadOnly" + static let stencilStoreOp: JSString = "stencilStoreOp" + static let stencilWriteMask: JSString = "stencilWriteMask" static let step: JSString = "step" static let stepDown: JSString = "stepDown" static let stepMismatch: JSString = "stepMismatch" + static let stepMode: JSString = "stepMode" static let stepUp: JSString = "stepUp" + static let stitchTiles: JSString = "stitchTiles" static let stop: JSString = "stop" + static let stopBits: JSString = "stopBits" static let stopImmediatePropagation: JSString = "stopImmediatePropagation" + static let stopNotifications: JSString = "stopNotifications" static let stopPropagation: JSString = "stopPropagation" + static let stopped: JSString = "stopped" + static let storage: JSString = "storage" static let storageArea: JSString = "storageArea" + static let storageTexture: JSString = "storageTexture" + static let store: JSString = "store" + static let storeOp: JSString = "storeOp" static let stream: JSString = "stream" + static let streamErrorCode: JSString = "streamErrorCode" + static let streams: JSString = "streams" + static let stretch: JSString = "stretch" + static let stride: JSString = "stride" + static let strides: JSString = "strides" static let stringValue: JSString = "stringValue" + static let strings: JSString = "strings" + static let stripIndexFormat: JSString = "stripIndexFormat" static let stroke: JSString = "stroke" static let strokeRect: JSString = "strokeRect" static let strokeStyle: JSString = "strokeStyle" static let strokeText: JSString = "strokeText" static let structuredClone: JSString = "structuredClone" static let style: JSString = "style" + static let styleMap: JSString = "styleMap" static let styleSheet: JSString = "styleSheet" static let styleSheets: JSString = "styleSheets" + static let styleset: JSString = "styleset" + static let stylistic: JSString = "stylistic" + static let sub: JSString = "sub" + static let subclassCode: JSString = "subclassCode" static let submit: JSString = "submit" static let submitter: JSString = "submitter" + static let subscribe: JSString = "subscribe" + static let subscriptionPeriod: JSString = "subscriptionPeriod" static let substringData: JSString = "substringData" + static let subtle: JSString = "subtle" static let subtree: JSString = "subtree" + static let suffix: JSString = "suffix" static let suffixes: JSString = "suffixes" + static let suggestedName: JSString = "suggestedName" static let summary: JSString = "summary" + static let support: JSString = "support" + static let supported: JSString = "supported" + static let supportedContentEncodings: JSString = "supportedContentEncodings" + static let supportedEntryTypes: JSString = "supportedEntryTypes" + static let supportedFrameRates: JSString = "supportedFrameRates" + static let supportedMethods: JSString = "supportedMethods" + static let supportedSources: JSString = "supportedSources" static let supports: JSString = "supports" + static let suppressLocalAudioPlayback: JSString = "suppressLocalAudioPlayback" + static let surfaceDimensions: JSString = "surfaceDimensions" + static let surfaceId: JSString = "surfaceId" + static let surfaceScale: JSString = "surfaceScale" static let surroundContents: JSString = "surroundContents" + static let suspend: JSString = "suspend" + static let suspendRedraw: JSString = "suspendRedraw" + static let svb: JSString = "svb" + static let svc: JSString = "svc" + static let svh: JSString = "svh" + static let svi: JSString = "svi" + static let svmax: JSString = "svmax" + static let svmin: JSString = "svmin" + static let svw: JSString = "svw" + static let swash: JSString = "swash" + static let symbols: JSString = "symbols" + static let sync: JSString = "sync" + static let synchronizationSource: JSString = "synchronizationSource" + static let syntax: JSString = "syntax" + static let sysex: JSString = "sysex" + static let sysexEnabled: JSString = "sysexEnabled" + static let system: JSString = "system" static let systemId: JSString = "systemId" + static let systemLanguage: JSString = "systemLanguage" + static let t: JSString = "t" static let tBodies: JSString = "tBodies" static let tFoot: JSString = "tFoot" static let tHead: JSString = "tHead" static let tabIndex: JSString = "tabIndex" static let table: JSString = "table" + static let tableValues: JSString = "tableValues" + static let tag: JSString = "tag" + static let tagLength: JSString = "tagLength" static let tagName: JSString = "tagName" static let taintEnabled: JSString = "taintEnabled" + static let takePhoto: JSString = "takePhoto" static let takeRecords: JSString = "takeRecords" + static let tan: JSString = "tan" + static let tangentialPressure: JSString = "tangentialPressure" + static let tanh: JSString = "tanh" static let target: JSString = "target" + static let targetBitrate: JSString = "targetBitrate" + static let targetElement: JSString = "targetElement" static let targetOrigin: JSString = "targetOrigin" + static let targetRanges: JSString = "targetRanges" + static let targetRayMode: JSString = "targetRayMode" + static let targetRaySpace: JSString = "targetRaySpace" + static let targetTouches: JSString = "targetTouches" + static let targetX: JSString = "targetX" + static let targetY: JSString = "targetY" + static let targets: JSString = "targets" + static let tcpType: JSString = "tcpType" static let tee: JSString = "tee" + static let tel: JSString = "tel" + static let temporalIndex: JSString = "temporalIndex" + static let temporalLayerId: JSString = "temporalLayerId" static let terminate: JSString = "terminate" + static let test: JSString = "test" + static let texImage2D: JSString = "texImage2D" + static let texImage3D: JSString = "texImage3D" + static let texParameterf: JSString = "texParameterf" + static let texParameteri: JSString = "texParameteri" + static let texStorage2D: JSString = "texStorage2D" + static let texStorage3D: JSString = "texStorage3D" + static let texSubImage2D: JSString = "texSubImage2D" + static let texSubImage3D: JSString = "texSubImage3D" static let text: JSString = "text" static let textAlign: JSString = "textAlign" static let textBaseline: JSString = "textBaseline" + static let textColor: JSString = "textColor" static let textContent: JSString = "textContent" + static let textFormats: JSString = "textFormats" static let textLength: JSString = "textLength" static let textRendering: JSString = "textRendering" static let textTracks: JSString = "textTracks" + static let texture: JSString = "texture" + static let textureArrayLength: JSString = "textureArrayLength" + static let textureHeight: JSString = "textureHeight" + static let textureType: JSString = "textureType" + static let textureWidth: JSString = "textureWidth" + static let threshold: JSString = "threshold" + static let thresholds: JSString = "thresholds" static let throwIfAborted: JSString = "throwIfAborted" + static let tilt: JSString = "tilt" + static let tiltX: JSString = "tiltX" + static let tiltY: JSString = "tiltY" static let time: JSString = "time" static let timeEnd: JSString = "timeEnd" static let timeLog: JSString = "timeLog" static let timeOrigin: JSString = "timeOrigin" + static let timeRemaining: JSString = "timeRemaining" static let timeStamp: JSString = "timeStamp" + static let timecode: JSString = "timecode" + static let timeline: JSString = "timeline" + static let timelineTime: JSString = "timelineTime" static let timeout: JSString = "timeout" + static let timestamp: JSString = "timestamp" + static let timestampOffset: JSString = "timestampOffset" + static let timestampWrites: JSString = "timestampWrites" + static let timing: JSString = "timing" static let title: JSString = "title" + static let titlebarAreaRect: JSString = "titlebarAreaRect" + static let tlsGroup: JSString = "tlsGroup" + static let tlsVersion: JSString = "tlsVersion" + static let to: JSString = "to" + static let toBox: JSString = "toBox" static let toDataURL: JSString = "toDataURL" static let toFloat32Array: JSString = "toFloat32Array" static let toFloat64Array: JSString = "toFloat64Array" static let toJSON: JSString = "toJSON" + static let toMatrix: JSString = "toMatrix" + static let toRecords: JSString = "toRecords" static let toString: JSString = "toString" + static let toSum: JSString = "toSum" static let toggle: JSString = "toggle" static let toggleAttribute: JSString = "toggleAttribute" + static let tone: JSString = "tone" + static let toneBuffer: JSString = "toneBuffer" static let tooLong: JSString = "tooLong" static let tooShort: JSString = "tooShort" static let toolbar: JSString = "toolbar" static let top: JSString = "top" + static let topOrigin: JSString = "topOrigin" + static let topology: JSString = "topology" + static let torch: JSString = "torch" static let total: JSString = "total" + static let totalAudioEnergy: JSString = "totalAudioEnergy" + static let totalDecodeTime: JSString = "totalDecodeTime" + static let totalEncodeTime: JSString = "totalEncodeTime" + static let totalEncodedBytesTarget: JSString = "totalEncodedBytesTarget" + static let totalInterFrameDelay: JSString = "totalInterFrameDelay" + static let totalPacketSendDelay: JSString = "totalPacketSendDelay" + static let totalProcessingDelay: JSString = "totalProcessingDelay" + static let totalRequestsSent: JSString = "totalRequestsSent" + static let totalResponsesReceived: JSString = "totalResponsesReceived" + static let totalRoundTripTime: JSString = "totalRoundTripTime" + static let totalSamplesDecoded: JSString = "totalSamplesDecoded" + static let totalSamplesDuration: JSString = "totalSamplesDuration" + static let totalSamplesReceived: JSString = "totalSamplesReceived" + static let totalSamplesSent: JSString = "totalSamplesSent" + static let totalSquaredInterFrameDelay: JSString = "totalSquaredInterFrameDelay" + static let totalVideoFrames: JSString = "totalVideoFrames" + static let touchEvents: JSString = "touchEvents" + static let touchId: JSString = "touchId" + static let touchType: JSString = "touchType" + static let touched: JSString = "touched" + static let touches: JSString = "touches" static let trace: JSString = "trace" static let track: JSString = "track" + static let trackIdentifier: JSString = "trackIdentifier" + static let trackedAnchors: JSString = "trackedAnchors" + static let tracks: JSString = "tracks" + static let transaction: JSString = "transaction" + static let transactionId: JSString = "transactionId" + static let transceiver: JSString = "transceiver" + static let transcript: JSString = "transcript" static let transfer: JSString = "transfer" static let transferControlToOffscreen: JSString = "transferControlToOffscreen" static let transferFromImageBitmap: JSString = "transferFromImageBitmap" + static let transferFunction: JSString = "transferFunction" + static let transferIn: JSString = "transferIn" + static let transferOut: JSString = "transferOut" + static let transferSize: JSString = "transferSize" static let transferToImageBitmap: JSString = "transferToImageBitmap" static let transform: JSString = "transform" + static let transformFeedbackVaryings: JSString = "transformFeedbackVaryings" static let transformPoint: JSString = "transformPoint" static let transformToDocument: JSString = "transformToDocument" static let transformToFragment: JSString = "transformToFragment" + static let transformer: JSString = "transformer" + static let transition: JSString = "transition" + static let transitionProperty: JSString = "transitionProperty" + static let transitionWhile: JSString = "transitionWhile" static let translate: JSString = "translate" static let translateSelf: JSString = "translateSelf" + static let transport: JSString = "transport" + static let transportId: JSString = "transportId" + static let transports: JSString = "transports" + static let transpose: JSString = "transpose" + static let traverseTo: JSString = "traverseTo" static let trueSpeed: JSString = "trueSpeed" + static let truncate: JSString = "truncate" + static let trustedTypes: JSString = "trustedTypes" + static let turn: JSString = "turn" + static let twist: JSString = "twist" + static let txPower: JSString = "txPower" static let type: JSString = "type" static let typeMismatch: JSString = "typeMismatch" static let types: JSString = "types" + static let uaFullVersion: JSString = "uaFullVersion" + static let unackData: JSString = "unackData" + static let unclippedDepth: JSString = "unclippedDepth" + static let unconfigure: JSString = "unconfigure" + static let underlineColor: JSString = "underlineColor" + static let underlineStyle: JSString = "underlineStyle" + static let underlineThickness: JSString = "underlineThickness" + static let unicodeRange: JSString = "unicodeRange" + static let uniform1f: JSString = "uniform1f" + static let uniform1fv: JSString = "uniform1fv" + static let uniform1i: JSString = "uniform1i" + static let uniform1iv: JSString = "uniform1iv" + static let uniform1ui: JSString = "uniform1ui" + static let uniform1uiv: JSString = "uniform1uiv" + static let uniform2f: JSString = "uniform2f" + static let uniform2fv: JSString = "uniform2fv" + static let uniform2i: JSString = "uniform2i" + static let uniform2iv: JSString = "uniform2iv" + static let uniform2ui: JSString = "uniform2ui" + static let uniform2uiv: JSString = "uniform2uiv" + static let uniform3f: JSString = "uniform3f" + static let uniform3fv: JSString = "uniform3fv" + static let uniform3i: JSString = "uniform3i" + static let uniform3iv: JSString = "uniform3iv" + static let uniform3ui: JSString = "uniform3ui" + static let uniform3uiv: JSString = "uniform3uiv" + static let uniform4f: JSString = "uniform4f" + static let uniform4fv: JSString = "uniform4fv" + static let uniform4i: JSString = "uniform4i" + static let uniform4iv: JSString = "uniform4iv" + static let uniform4ui: JSString = "uniform4ui" + static let uniform4uiv: JSString = "uniform4uiv" + static let uniformBlockBinding: JSString = "uniformBlockBinding" + static let uniformMatrix2fv: JSString = "uniformMatrix2fv" + static let uniformMatrix2x3fv: JSString = "uniformMatrix2x3fv" + static let uniformMatrix2x4fv: JSString = "uniformMatrix2x4fv" + static let uniformMatrix3fv: JSString = "uniformMatrix3fv" + static let uniformMatrix3x2fv: JSString = "uniformMatrix3x2fv" + static let uniformMatrix3x4fv: JSString = "uniformMatrix3x4fv" + static let uniformMatrix4fv: JSString = "uniformMatrix4fv" + static let uniformMatrix4x2fv: JSString = "uniformMatrix4x2fv" + static let uniformMatrix4x3fv: JSString = "uniformMatrix4x3fv" + static let unique: JSString = "unique" + static let unit: JSString = "unit" + static let unitExponent: JSString = "unitExponent" + static let unitFactorCurrentExponent: JSString = "unitFactorCurrentExponent" + static let unitFactorLengthExponent: JSString = "unitFactorLengthExponent" + static let unitFactorLuminousIntensityExponent: JSString = "unitFactorLuminousIntensityExponent" + static let unitFactorMassExponent: JSString = "unitFactorMassExponent" + static let unitFactorTemperatureExponent: JSString = "unitFactorTemperatureExponent" + static let unitFactorTimeExponent: JSString = "unitFactorTimeExponent" + static let unitSystem: JSString = "unitSystem" + static let unitType: JSString = "unitType" + static let unloadEventEnd: JSString = "unloadEventEnd" + static let unloadEventStart: JSString = "unloadEventStart" + static let unlock: JSString = "unlock" + static let unmap: JSString = "unmap" + static let unobserve: JSString = "unobserve" + static let unpauseAnimations: JSString = "unpauseAnimations" + static let unregister: JSString = "unregister" static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" + static let unsubscribe: JSString = "unsubscribe" + static let unsuspendRedraw: JSString = "unsuspendRedraw" + static let unsuspendRedrawAll: JSString = "unsuspendRedrawAll" + static let unwrapKey: JSString = "unwrapKey" + static let upX: JSString = "upX" + static let upY: JSString = "upY" + static let upZ: JSString = "upZ" + static let update: JSString = "update" + static let updateCharacterBounds: JSString = "updateCharacterBounds" + static let updateControlBound: JSString = "updateControlBound" + static let updateCurrentEntry: JSString = "updateCurrentEntry" + static let updateInkTrailStartPoint: JSString = "updateInkTrailStartPoint" + static let updatePlaybackRate: JSString = "updatePlaybackRate" + static let updateRangeEnd: JSString = "updateRangeEnd" + static let updateRangeStart: JSString = "updateRangeStart" + static let updateRenderState: JSString = "updateRenderState" + static let updateSelection: JSString = "updateSelection" + static let updateSelectionBound: JSString = "updateSelectionBound" + static let updateTargetFrameRate: JSString = "updateTargetFrameRate" + static let updateText: JSString = "updateText" + static let updateTiming: JSString = "updateTiming" + static let updateUI: JSString = "updateUI" + static let updateViaCache: JSString = "updateViaCache" + static let updateWith: JSString = "updateWith" + static let updating: JSString = "updating" static let upgrade: JSString = "upgrade" static let upload: JSString = "upload" + static let uploadTotal: JSString = "uploadTotal" + static let uploaded: JSString = "uploaded" + static let upper: JSString = "upper" + static let upperBound: JSString = "upperBound" + static let upperOpen: JSString = "upperOpen" + static let upperVerticalAngle: JSString = "upperVerticalAngle" + static let uri: JSString = "uri" static let url: JSString = "url" + static let urls: JSString = "urls" + static let usableWithDarkBackground: JSString = "usableWithDarkBackground" + static let usableWithLightBackground: JSString = "usableWithLightBackground" + static let usage: JSString = "usage" + static let usageMaximum: JSString = "usageMaximum" + static let usageMinimum: JSString = "usageMinimum" + static let usagePage: JSString = "usagePage" + static let usagePreference: JSString = "usagePreference" + static let usages: JSString = "usages" + static let usb: JSString = "usb" + static let usbProductId: JSString = "usbProductId" + static let usbVendorId: JSString = "usbVendorId" + static let usbVersionMajor: JSString = "usbVersionMajor" + static let usbVersionMinor: JSString = "usbVersionMinor" + static let usbVersionSubminor: JSString = "usbVersionSubminor" + static let use: JSString = "use" static let useMap: JSString = "useMap" + static let useProgram: JSString = "useProgram" + static let user: JSString = "user" static let userAgent: JSString = "userAgent" + static let userAgentData: JSString = "userAgentData" + static let userChoice: JSString = "userChoice" + static let userHandle: JSString = "userHandle" + static let userHint: JSString = "userHint" + static let userInitiated: JSString = "userInitiated" + static let userState: JSString = "userState" + static let userVerification: JSString = "userVerification" + static let userVisibleOnly: JSString = "userVisibleOnly" static let username: JSString = "username" + static let usernameFragment: JSString = "usernameFragment" + static let usernameHint: JSString = "usernameHint" + static let usesDepthValues: JSString = "usesDepthValues" + static let utterance: JSString = "utterance" + static let uuid: JSString = "uuid" + static let uuids: JSString = "uuids" + static let uvm: JSString = "uvm" static let vAlign: JSString = "vAlign" static let vLink: JSString = "vLink" static let valid: JSString = "valid" + static let validate: JSString = "validate" + static let validateAssertion: JSString = "validateAssertion" + static let validateProgram: JSString = "validateProgram" static let validationMessage: JSString = "validationMessage" static let validity: JSString = "validity" static let value: JSString = "value" static let valueAsDate: JSString = "valueAsDate" static let valueAsNumber: JSString = "valueAsNumber" + static let valueAsString: JSString = "valueAsString" + static let valueInSpecifiedUnits: JSString = "valueInSpecifiedUnits" static let valueMissing: JSString = "valueMissing" + static let valueOf: JSString = "valueOf" static let valueType: JSString = "valueType" + static let values: JSString = "values" + static let variable: JSString = "variable" + static let variant: JSString = "variant" + static let variationSettings: JSString = "variationSettings" + static let variations: JSString = "variations" + static let vb: JSString = "vb" static let vendor: JSString = "vendor" + static let vendorId: JSString = "vendorId" static let vendorSub: JSString = "vendorSub" + static let verify: JSString = "verify" static let version: JSString = "version" + static let vertex: JSString = "vertex" + static let vertexAttrib1f: JSString = "vertexAttrib1f" + static let vertexAttrib1fv: JSString = "vertexAttrib1fv" + static let vertexAttrib2f: JSString = "vertexAttrib2f" + static let vertexAttrib2fv: JSString = "vertexAttrib2fv" + static let vertexAttrib3f: JSString = "vertexAttrib3f" + static let vertexAttrib3fv: JSString = "vertexAttrib3fv" + static let vertexAttrib4f: JSString = "vertexAttrib4f" + static let vertexAttrib4fv: JSString = "vertexAttrib4fv" + static let vertexAttribDivisor: JSString = "vertexAttribDivisor" + static let vertexAttribDivisorANGLE: JSString = "vertexAttribDivisorANGLE" + static let vertexAttribI4i: JSString = "vertexAttribI4i" + static let vertexAttribI4iv: JSString = "vertexAttribI4iv" + static let vertexAttribI4ui: JSString = "vertexAttribI4ui" + static let vertexAttribI4uiv: JSString = "vertexAttribI4uiv" + static let vertexAttribIPointer: JSString = "vertexAttribIPointer" + static let vertexAttribPointer: JSString = "vertexAttribPointer" + static let vertical: JSString = "vertical" + static let vh: JSString = "vh" + static let vi: JSString = "vi" + static let vibrate: JSString = "vibrate" + static let video: JSString = "video" + static let videoBitsPerSecond: JSString = "videoBitsPerSecond" + static let videoCapabilities: JSString = "videoCapabilities" static let videoHeight: JSString = "videoHeight" static let videoTracks: JSString = "videoTracks" static let videoWidth: JSString = "videoWidth" static let view: JSString = "view" + static let viewBox: JSString = "viewBox" + static let viewDimension: JSString = "viewDimension" + static let viewFormats: JSString = "viewFormats" + static let viewPixelHeight: JSString = "viewPixelHeight" + static let viewPixelWidth: JSString = "viewPixelWidth" + static let viewport: JSString = "viewport" + static let viewportAnchorX: JSString = "viewportAnchorX" + static let viewportAnchorY: JSString = "viewportAnchorY" + static let viewportElement: JSString = "viewportElement" + static let views: JSString = "views" + static let violatedDirective: JSString = "violatedDirective" + static let violationSample: JSString = "violationSample" + static let violationType: JSString = "violationType" + static let violationURL: JSString = "violationURL" + static let virtualKeyboard: JSString = "virtualKeyboard" + static let virtualKeyboardPolicy: JSString = "virtualKeyboardPolicy" + static let visibility: JSString = "visibility" static let visibilityState: JSString = "visibilityState" static let visible: JSString = "visible" + static let visibleRect: JSString = "visibleRect" + static let visualViewport: JSString = "visualViewport" static let vlinkColor: JSString = "vlinkColor" + static let vmax: JSString = "vmax" + static let vmin: JSString = "vmin" + static let voice: JSString = "voice" + static let voiceActivityFlag: JSString = "voiceActivityFlag" + static let voiceURI: JSString = "voiceURI" static let volume: JSString = "volume" static let vspace: JSString = "vspace" + static let vw: JSString = "vw" static let w: JSString = "w" + static let waitSync: JSString = "waitSync" + static let waitUntil: JSString = "waitUntil" + static let waiting: JSString = "waiting" + static let wakeLock: JSString = "wakeLock" static let warn: JSString = "warn" + static let wasClean: JSString = "wasClean" + static let wasDiscarded: JSString = "wasDiscarded" + static let watchAdvertisements: JSString = "watchAdvertisements" + static let watchAvailability: JSString = "watchAvailability" + static let watchPosition: JSString = "watchPosition" + static let watchingAdvertisements: JSString = "watchingAdvertisements" + static let webdriver: JSString = "webdriver" + static let webkitEntries: JSString = "webkitEntries" + static let webkitGetAsEntry: JSString = "webkitGetAsEntry" static let webkitMatchesSelector: JSString = "webkitMatchesSelector" + static let webkitRelativePath: JSString = "webkitRelativePath" + static let webkitdirectory: JSString = "webkitdirectory" + static let weight: JSString = "weight" static let whatToShow: JSString = "whatToShow" static let which: JSString = "which" + static let whiteBalanceMode: JSString = "whiteBalanceMode" static let wholeText: JSString = "wholeText" static let width: JSString = "width" static let willReadFrequently: JSString = "willReadFrequently" static let willValidate: JSString = "willValidate" static let window: JSString = "window" + static let windowControlsOverlay: JSString = "windowControlsOverlay" + static let windowDimensions: JSString = "windowDimensions" static let withCredentials: JSString = "withCredentials" static let wordSpacing: JSString = "wordSpacing" + static let workerStart: JSString = "workerStart" + static let wow64: JSString = "wow64" static let wrap: JSString = "wrap" + static let wrapKey: JSString = "wrapKey" static let writable: JSString = "writable" + static let writableAuxiliaries: JSString = "writableAuxiliaries" static let writableType: JSString = "writableType" static let write: JSString = "write" + static let writeBuffer: JSString = "writeBuffer" + static let writeMask: JSString = "writeMask" + static let writeText: JSString = "writeText" + static let writeTexture: JSString = "writeTexture" + static let writeTimestamp: JSString = "writeTimestamp" + static let writeValue: JSString = "writeValue" + static let writeValueWithResponse: JSString = "writeValueWithResponse" + static let writeValueWithoutResponse: JSString = "writeValueWithoutResponse" + static let writeWithoutResponse: JSString = "writeWithoutResponse" static let writeln: JSString = "writeln" + static let written: JSString = "written" static let x: JSString = "x" + static let x1: JSString = "x1" + static let x2: JSString = "x2" + static let xBias: JSString = "xBias" + static let xChannelSelector: JSString = "xChannelSelector" + static let xr: JSString = "xr" + static let xrCompatible: JSString = "xrCompatible" static let y: JSString = "y" + static let y1: JSString = "y1" + static let y2: JSString = "y2" + static let yBias: JSString = "yBias" + static let yChannelSelector: JSString = "yChannelSelector" static let z: JSString = "z" + static let zBias: JSString = "zBias" + static let zoom: JSString = "zoom" } diff --git a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift index ebace7bd..32ac8512 100644 --- a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift +++ b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class StructuredSerializeOptions: BridgedDictionary { public convenience init(transfer: [JSObject]) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.transfer] = transfer.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StylePropertyMap.swift b/Sources/DOMKit/WebIDL/StylePropertyMap.swift new file mode 100644 index 00000000..e5c430f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/StylePropertyMap.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StylePropertyMap: StylePropertyMapReadOnly { + override public class var constructor: JSFunction { JSObject.global[Strings.StylePropertyMap].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public func set(property: String, values: __UNSUPPORTED_UNION__...) { + _ = jsObject[Strings.set]!(property.jsValue(), values.jsValue()) + } + + public func append(property: String, values: __UNSUPPORTED_UNION__...) { + _ = jsObject[Strings.append]!(property.jsValue(), values.jsValue()) + } + + public func delete(property: String) { + _ = jsObject[Strings.delete]!(property.jsValue()) + } + + public func clear() { + _ = jsObject[Strings.clear]!() + } +} diff --git a/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift b/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift new file mode 100644 index 00000000..3b70b36a --- /dev/null +++ b/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class StylePropertyMapReadOnly: JSBridgedClass, Sequence { + public class var constructor: JSFunction { JSObject.global[Strings.StylePropertyMapReadOnly].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + self.jsObject = jsObject + } + + public typealias Element = String + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + public func get(property: String) -> JSValue { + jsObject[Strings.get]!(property.jsValue()).fromJSValue()! + } + + public func getAll(property: String) -> [CSSStyleValue] { + jsObject[Strings.getAll]!(property.jsValue()).fromJSValue()! + } + + public func has(property: String) -> Bool { + jsObject[Strings.has]!(property.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var size: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/StyleSheet.swift b/Sources/DOMKit/WebIDL/StyleSheet.swift index b706f27b..afe15ddf 100644 --- a/Sources/DOMKit/WebIDL/StyleSheet.swift +++ b/Sources/DOMKit/WebIDL/StyleSheet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class StyleSheet: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.StyleSheet.function! } + public class var constructor: JSFunction { JSObject.global[Strings.StyleSheet].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/StyleSheetList.swift b/Sources/DOMKit/WebIDL/StyleSheetList.swift index 41054c22..80b0e04f 100644 --- a/Sources/DOMKit/WebIDL/StyleSheetList.swift +++ b/Sources/DOMKit/WebIDL/StyleSheetList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class StyleSheetList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.StyleSheetList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.StyleSheetList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SubmitEvent.swift b/Sources/DOMKit/WebIDL/SubmitEvent.swift index 3e7752be..3dc2c333 100644 --- a/Sources/DOMKit/WebIDL/SubmitEvent.swift +++ b/Sources/DOMKit/WebIDL/SubmitEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SubmitEvent: Event { - override public class var constructor: JSFunction { JSObject.global.SubmitEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.SubmitEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _submitter = ReadonlyAttribute(jsObject: jsObject, name: Strings.submitter) diff --git a/Sources/DOMKit/WebIDL/SubmitEventInit.swift b/Sources/DOMKit/WebIDL/SubmitEventInit.swift index 23cb1bcf..d9317868 100644 --- a/Sources/DOMKit/WebIDL/SubmitEventInit.swift +++ b/Sources/DOMKit/WebIDL/SubmitEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class SubmitEventInit: BridgedDictionary { public convenience init(submitter: HTMLElement?) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.submitter] = submitter.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SubtleCrypto.swift b/Sources/DOMKit/WebIDL/SubtleCrypto.swift new file mode 100644 index 00000000..e5543c41 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SubtleCrypto.swift @@ -0,0 +1,148 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SubtleCrypto: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SubtleCrypto].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { + jsObject[Strings.encrypt]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.encrypt]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { + jsObject[Strings.decrypt]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.decrypt]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { + jsObject[Strings.sign]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.sign]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) -> JSPromise { + jsObject[Strings.verify]!(algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.verify]!(algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) -> JSPromise { + jsObject[Strings.digest]!(algorithm.jsValue(), data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.digest]!(algorithm.jsValue(), data.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { + jsObject[Strings.generateKey]!(algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.generateKey]!(algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { + jsObject[Strings.deriveKey]!(algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.deriveKey]!(algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) -> JSPromise { + jsObject[Strings.deriveBits]!(algorithm.jsValue(), baseKey.jsValue(), length.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) async throws -> ArrayBuffer { + let _promise: JSPromise = jsObject[Strings.deriveBits]!(algorithm.jsValue(), baseKey.jsValue(), length.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { + jsObject[Strings.importKey]!(format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { + let _promise: JSPromise = jsObject[Strings.importKey]!(format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func exportKey(format: KeyFormat, key: CryptoKey) -> JSPromise { + jsObject[Strings.exportKey]!(format.jsValue(), key.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func exportKey(format: KeyFormat, key: CryptoKey) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.exportKey]!(format.jsValue(), key.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) -> JSPromise { + jsObject[Strings.wrapKey]!(format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) async throws -> JSValue { + let _promise: JSPromise = jsObject[Strings.wrapKey]!(format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { + let _arg0 = format.jsValue() + let _arg1 = wrappedKey.jsValue() + let _arg2 = unwrappingKey.jsValue() + let _arg3 = unwrapAlgorithm.jsValue() + let _arg4 = unwrappedKeyAlgorithm.jsValue() + let _arg5 = extractable.jsValue() + let _arg6 = keyUsages.jsValue() + return jsObject[Strings.unwrapKey]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { + let _arg0 = format.jsValue() + let _arg1 = wrappedKey.jsValue() + let _arg2 = unwrappingKey.jsValue() + let _arg3 = unwrapAlgorithm.jsValue() + let _arg4 = unwrappedKeyAlgorithm.jsValue() + let _arg5 = extractable.jsValue() + let _arg6 = keyUsages.jsValue() + let _promise: JSPromise = jsObject[Strings.unwrapKey]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift b/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift new file mode 100644 index 00000000..fa4b7930 --- /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/SyncEvent.swift b/Sources/DOMKit/WebIDL/SyncEvent.swift new file mode 100644 index 00000000..6694f481 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SyncEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SyncEvent: ExtendableEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.SyncEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _tag = ReadonlyAttribute(jsObject: jsObject, name: Strings.tag) + _lastChance = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastChance) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, init: SyncEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + } + + @ReadonlyAttribute + public var tag: String + + @ReadonlyAttribute + public var lastChance: Bool +} diff --git a/Sources/DOMKit/WebIDL/SyncEventInit.swift b/Sources/DOMKit/WebIDL/SyncEventInit.swift new file mode 100644 index 00000000..4c213c91 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SyncEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SyncEventInit: BridgedDictionary { + public convenience init(tag: String, lastChance: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.tag] = tag.jsValue() + object[Strings.lastChance] = lastChance.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _tag = ReadWriteAttribute(jsObject: object, name: Strings.tag) + _lastChance = ReadWriteAttribute(jsObject: object, name: Strings.lastChance) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var tag: String + + @ReadWriteAttribute + public var lastChance: Bool +} diff --git a/Sources/DOMKit/WebIDL/SyncManager.swift b/Sources/DOMKit/WebIDL/SyncManager.swift new file mode 100644 index 00000000..d1b9589c --- /dev/null +++ b/Sources/DOMKit/WebIDL/SyncManager.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SyncManager: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.SyncManager].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func register(tag: String) -> JSPromise { + jsObject[Strings.register]!(tag.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func register(tag: String) async throws { + let _promise: JSPromise = jsObject[Strings.register]!(tag.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func getTags() -> JSPromise { + jsObject[Strings.getTags]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getTags() async throws -> [String] { + let _promise: JSPromise = jsObject[Strings.getTags]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/Table.swift b/Sources/DOMKit/WebIDL/Table.swift new file mode 100644 index 00000000..7e467aa6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Table.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Table: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Table].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + self.jsObject = jsObject + } + + public convenience init(descriptor: TableDescriptor, value: JSValue? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(descriptor.jsValue(), value?.jsValue() ?? .undefined)) + } + + public func grow(delta: UInt32, value: JSValue? = nil) -> UInt32 { + jsObject[Strings.grow]!(delta.jsValue(), value?.jsValue() ?? .undefined).fromJSValue()! + } + + public func get(index: UInt32) -> JSValue { + jsObject[Strings.get]!(index.jsValue()).fromJSValue()! + } + + public func set(index: UInt32, value: JSValue? = nil) { + _ = jsObject[Strings.set]!(index.jsValue(), value?.jsValue() ?? .undefined) + } + + @ReadonlyAttribute + public var length: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/TableDescriptor.swift b/Sources/DOMKit/WebIDL/TableDescriptor.swift new file mode 100644 index 00000000..1af7f679 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TableDescriptor.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TableDescriptor: BridgedDictionary { + public convenience init(element: TableKind, initial: UInt32, maximum: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.element] = element.jsValue() + object[Strings.initial] = initial.jsValue() + object[Strings.maximum] = maximum.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _element = ReadWriteAttribute(jsObject: object, name: Strings.element) + _initial = ReadWriteAttribute(jsObject: object, name: Strings.initial) + _maximum = ReadWriteAttribute(jsObject: object, name: Strings.maximum) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var element: TableKind + + @ReadWriteAttribute + public var initial: UInt32 + + @ReadWriteAttribute + public var maximum: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/TableKind.swift b/Sources/DOMKit/WebIDL/TableKind.swift new file mode 100644 index 00000000..fcacdbcb --- /dev/null +++ b/Sources/DOMKit/WebIDL/TableKind.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TableKind: JSString, JSValueCompatible { + case externref = "externref" + case anyfunc = "anyfunc" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift b/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift new file mode 100644 index 00000000..411ca578 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TaskAttributionTiming: PerformanceEntry { + override public class var constructor: JSFunction { JSObject.global[Strings.TaskAttributionTiming].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _containerType = ReadonlyAttribute(jsObject: jsObject, name: Strings.containerType) + _containerSrc = ReadonlyAttribute(jsObject: jsObject, name: Strings.containerSrc) + _containerId = ReadonlyAttribute(jsObject: jsObject, name: Strings.containerId) + _containerName = ReadonlyAttribute(jsObject: jsObject, name: Strings.containerName) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var containerType: String + + @ReadonlyAttribute + public var containerSrc: String + + @ReadonlyAttribute + public var containerId: String + + @ReadonlyAttribute + public var containerName: String + + override public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TaskController.swift b/Sources/DOMKit/WebIDL/TaskController.swift new file mode 100644 index 00000000..d3f7c9ac --- /dev/null +++ b/Sources/DOMKit/WebIDL/TaskController.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TaskController: AbortController { + override public class var constructor: JSFunction { JSObject.global[Strings.TaskController].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(init: TaskControllerInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + } + + public func setPriority(priority: TaskPriority) { + _ = jsObject[Strings.setPriority]!(priority.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/TaskControllerInit.swift b/Sources/DOMKit/WebIDL/TaskControllerInit.swift new file mode 100644 index 00000000..50d9222d --- /dev/null +++ b/Sources/DOMKit/WebIDL/TaskControllerInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TaskControllerInit: BridgedDictionary { + public convenience init(priority: TaskPriority) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.priority] = priority.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var priority: TaskPriority +} diff --git a/Sources/DOMKit/WebIDL/TaskPriority.swift b/Sources/DOMKit/WebIDL/TaskPriority.swift new file mode 100644 index 00000000..52a26b98 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TaskPriority.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TaskPriority: JSString, JSValueCompatible { + case userBlocking = "user-blocking" + case userVisible = "user-visible" + case background = "background" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift b/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift new file mode 100644 index 00000000..e3d5cf28 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TaskPriorityChangeEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.TaskPriorityChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _previousPriority = ReadonlyAttribute(jsObject: jsObject, name: Strings.previousPriority) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, priorityChangeEventInitDict: TaskPriorityChangeEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), priorityChangeEventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var previousPriority: TaskPriority +} diff --git a/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift b/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift new file mode 100644 index 00000000..a87fcdb5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TaskPriorityChangeEventInit: BridgedDictionary { + public convenience init(previousPriority: TaskPriority) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.previousPriority] = previousPriority.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _previousPriority = ReadWriteAttribute(jsObject: object, name: Strings.previousPriority) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var previousPriority: TaskPriority +} diff --git a/Sources/DOMKit/WebIDL/TaskSignal.swift b/Sources/DOMKit/WebIDL/TaskSignal.swift new file mode 100644 index 00000000..2704cda5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TaskSignal.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TaskSignal: AbortSignal { + override public class var constructor: JSFunction { JSObject.global[Strings.TaskSignal].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) + _onprioritychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprioritychange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var priority: TaskPriority + + @ClosureAttribute.Optional1 + public var onprioritychange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/TestUtils.swift b/Sources/DOMKit/WebIDL/TestUtils.swift new file mode 100644 index 00000000..fde68d52 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TestUtils.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TestUtils { + public static var jsObject: JSObject { + JSObject.global.[Strings.TestUtils].object! + } + + public static func gc() -> JSPromise { + JSObject.global.[Strings.TestUtils].object![Strings.gc]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func gc() async throws { + let _promise: JSPromise = JSObject.global.[Strings.TestUtils].object![Strings.gc]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index adcb7d87..0479d7ea 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class Text: CharacterData, Slottable { - override public class var constructor: JSFunction { JSObject.global.Text.function! } +public class Text: CharacterData, Slottable, GeometryUtils { + override public class var constructor: JSFunction { JSObject.global[Strings.Text].function! } public required init(unsafelyWrapping jsObject: JSObject) { _wholeText = ReadonlyAttribute(jsObject: jsObject, name: Strings.wholeText) diff --git a/Sources/DOMKit/WebIDL/TextDecodeOptions.swift b/Sources/DOMKit/WebIDL/TextDecodeOptions.swift new file mode 100644 index 00000000..da758b45 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextDecodeOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextDecodeOptions: BridgedDictionary { + public convenience init(stream: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.stream] = stream.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _stream = ReadWriteAttribute(jsObject: object, name: Strings.stream) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var stream: Bool +} diff --git a/Sources/DOMKit/WebIDL/TextDecoder.swift b/Sources/DOMKit/WebIDL/TextDecoder.swift new file mode 100644 index 00000000..524fd36c --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextDecoder.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextDecoder: JSBridgedClass, TextDecoderCommon { + public class var constructor: JSFunction { JSObject.global[Strings.TextDecoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined)) + } + + public func decode(input: BufferSource? = nil, options: TextDecodeOptions? = nil) -> String { + jsObject[Strings.decode]!(input?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TextDecoderCommon.swift b/Sources/DOMKit/WebIDL/TextDecoderCommon.swift new file mode 100644 index 00000000..53fe5707 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextDecoderCommon.swift @@ -0,0 +1,13 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol TextDecoderCommon: JSBridgedClass {} +public extension TextDecoderCommon { + var encoding: String { ReadonlyAttribute[Strings.encoding, in: jsObject] } + + var fatal: Bool { ReadonlyAttribute[Strings.fatal, in: jsObject] } + + var ignoreBOM: Bool { ReadonlyAttribute[Strings.ignoreBOM, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/TextDecoderOptions.swift b/Sources/DOMKit/WebIDL/TextDecoderOptions.swift new file mode 100644 index 00000000..d1f37b1d --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextDecoderOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextDecoderOptions: BridgedDictionary { + public convenience init(fatal: Bool, ignoreBOM: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.fatal] = fatal.jsValue() + object[Strings.ignoreBOM] = ignoreBOM.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _fatal = ReadWriteAttribute(jsObject: object, name: Strings.fatal) + _ignoreBOM = ReadWriteAttribute(jsObject: object, name: Strings.ignoreBOM) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var fatal: Bool + + @ReadWriteAttribute + public var ignoreBOM: Bool +} diff --git a/Sources/DOMKit/WebIDL/TextDecoderStream.swift b/Sources/DOMKit/WebIDL/TextDecoderStream.swift new file mode 100644 index 00000000..e2ac77ac --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextDecoderStream.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextDecoderStream: JSBridgedClass, TextDecoderCommon, GenericTransformStream { + public class var constructor: JSFunction { JSObject.global[Strings.TextDecoderStream].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined)) + } +} diff --git a/Sources/DOMKit/WebIDL/TextDetector.swift b/Sources/DOMKit/WebIDL/TextDetector.swift new file mode 100644 index 00000000..46f485bf --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextDetector.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextDetector: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.TextDetector].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + public func detect(image: ImageBitmapSource) -> JSPromise { + jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func detect(image: ImageBitmapSource) async throws -> [DetectedText] { + let _promise: JSPromise = jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TextEncoder.swift b/Sources/DOMKit/WebIDL/TextEncoder.swift new file mode 100644 index 00000000..f85a557a --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextEncoder.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextEncoder: JSBridgedClass, TextEncoderCommon { + public class var constructor: JSFunction { JSObject.global[Strings.TextEncoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + public func encode(input: String? = nil) -> Uint8Array { + jsObject[Strings.encode]!(input?.jsValue() ?? .undefined).fromJSValue()! + } + + public func encodeInto(source: String, destination: Uint8Array) -> TextEncoderEncodeIntoResult { + jsObject[Strings.encodeInto]!(source.jsValue(), destination.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TextEncoderCommon.swift b/Sources/DOMKit/WebIDL/TextEncoderCommon.swift new file mode 100644 index 00000000..94710a84 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextEncoderCommon.swift @@ -0,0 +1,9 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol TextEncoderCommon: JSBridgedClass {} +public extension TextEncoderCommon { + var encoding: String { ReadonlyAttribute[Strings.encoding, in: jsObject] } +} diff --git a/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift b/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift new file mode 100644 index 00000000..a27918b0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextEncoderEncodeIntoResult: BridgedDictionary { + public convenience init(read: UInt64, written: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.read] = read.jsValue() + object[Strings.written] = written.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _read = ReadWriteAttribute(jsObject: object, name: Strings.read) + _written = ReadWriteAttribute(jsObject: object, name: Strings.written) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var read: UInt64 + + @ReadWriteAttribute + public var written: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/TextEncoderStream.swift b/Sources/DOMKit/WebIDL/TextEncoderStream.swift new file mode 100644 index 00000000..0c871a9d --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextEncoderStream.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextEncoderStream: JSBridgedClass, TextEncoderCommon, GenericTransformStream { + public class var constructor: JSFunction { JSObject.global[Strings.TextEncoderStream].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } +} diff --git a/Sources/DOMKit/WebIDL/TextFormat.swift b/Sources/DOMKit/WebIDL/TextFormat.swift new file mode 100644 index 00000000..834bfeb5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextFormat.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextFormat: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.TextFormat].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _rangeStart = ReadWriteAttribute(jsObject: jsObject, name: Strings.rangeStart) + _rangeEnd = ReadWriteAttribute(jsObject: jsObject, name: Strings.rangeEnd) + _textColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.textColor) + _backgroundColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.backgroundColor) + _underlineStyle = ReadWriteAttribute(jsObject: jsObject, name: Strings.underlineStyle) + _underlineThickness = ReadWriteAttribute(jsObject: jsObject, name: Strings.underlineThickness) + _underlineColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.underlineColor) + self.jsObject = jsObject + } + + public convenience init(options: TextFormatInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var rangeStart: UInt32 + + @ReadWriteAttribute + public var rangeEnd: UInt32 + + @ReadWriteAttribute + public var textColor: String + + @ReadWriteAttribute + public var backgroundColor: String + + @ReadWriteAttribute + public var underlineStyle: String + + @ReadWriteAttribute + public var underlineThickness: String + + @ReadWriteAttribute + public var underlineColor: String +} diff --git a/Sources/DOMKit/WebIDL/TextFormatInit.swift b/Sources/DOMKit/WebIDL/TextFormatInit.swift new file mode 100644 index 00000000..abdd4996 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextFormatInit.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextFormatInit: BridgedDictionary { + public convenience init(rangeStart: UInt32, rangeEnd: UInt32, textColor: String, backgroundColor: String, underlineStyle: String, underlineThickness: String, underlineColor: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.rangeStart] = rangeStart.jsValue() + object[Strings.rangeEnd] = rangeEnd.jsValue() + object[Strings.textColor] = textColor.jsValue() + object[Strings.backgroundColor] = backgroundColor.jsValue() + object[Strings.underlineStyle] = underlineStyle.jsValue() + object[Strings.underlineThickness] = underlineThickness.jsValue() + object[Strings.underlineColor] = underlineColor.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _rangeStart = ReadWriteAttribute(jsObject: object, name: Strings.rangeStart) + _rangeEnd = ReadWriteAttribute(jsObject: object, name: Strings.rangeEnd) + _textColor = ReadWriteAttribute(jsObject: object, name: Strings.textColor) + _backgroundColor = ReadWriteAttribute(jsObject: object, name: Strings.backgroundColor) + _underlineStyle = ReadWriteAttribute(jsObject: object, name: Strings.underlineStyle) + _underlineThickness = ReadWriteAttribute(jsObject: object, name: Strings.underlineThickness) + _underlineColor = ReadWriteAttribute(jsObject: object, name: Strings.underlineColor) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var rangeStart: UInt32 + + @ReadWriteAttribute + public var rangeEnd: UInt32 + + @ReadWriteAttribute + public var textColor: String + + @ReadWriteAttribute + public var backgroundColor: String + + @ReadWriteAttribute + public var underlineStyle: String + + @ReadWriteAttribute + public var underlineThickness: String + + @ReadWriteAttribute + public var underlineColor: String +} diff --git a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift new file mode 100644 index 00000000..4d7262b4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextFormatUpdateEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.TextFormatUpdateEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: TextFormatUpdateEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + public func getTextFormats() -> [TextFormat] { + jsObject[Strings.getTextFormats]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift b/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift new file mode 100644 index 00000000..7f8edc73 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextFormatUpdateEventInit: BridgedDictionary { + public convenience init(textFormats: [TextFormat]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.textFormats] = textFormats.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _textFormats = ReadWriteAttribute(jsObject: object, name: Strings.textFormats) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var textFormats: [TextFormat] +} diff --git a/Sources/DOMKit/WebIDL/TextMetrics.swift b/Sources/DOMKit/WebIDL/TextMetrics.swift index 41a2d74e..eab83a85 100644 --- a/Sources/DOMKit/WebIDL/TextMetrics.swift +++ b/Sources/DOMKit/WebIDL/TextMetrics.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextMetrics: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.TextMetrics.function! } + public class var constructor: JSFunction { JSObject.global[Strings.TextMetrics].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index f4a59987..66535b43 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -4,9 +4,10 @@ import JavaScriptEventLoop import JavaScriptKit public class TextTrack: EventTarget { - override public class var constructor: JSFunction { JSObject.global.TextTrack.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.TextTrack].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) @@ -19,6 +20,9 @@ public class TextTrack: EventTarget { super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var sourceBuffer: SourceBuffer? + @ReadonlyAttribute public var kind: TextTrackKind diff --git a/Sources/DOMKit/WebIDL/TextTrackCue.swift b/Sources/DOMKit/WebIDL/TextTrackCue.swift index e90191ef..f1c7b0be 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCue.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextTrackCue: EventTarget { - override public class var constructor: JSFunction { JSObject.global.TextTrackCue.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.TextTrackCue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) diff --git a/Sources/DOMKit/WebIDL/TextTrackCueList.swift b/Sources/DOMKit/WebIDL/TextTrackCueList.swift index 4dc6df71..923f5dfd 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCueList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCueList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextTrackCueList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.TextTrackCueList.function! } + public class var constructor: JSFunction { JSObject.global[Strings.TextTrackCueList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift index 08aace39..e987f967 100644 --- a/Sources/DOMKit/WebIDL/TextTrackList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextTrackList: EventTarget { - override public class var constructor: JSFunction { JSObject.global.TextTrackList.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.TextTrackList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) diff --git a/Sources/DOMKit/WebIDL/TextUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextUpdateEvent.swift new file mode 100644 index 00000000..8264efdb --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextUpdateEvent.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextUpdateEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.TextUpdateEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _updateRangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.updateRangeStart) + _updateRangeEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.updateRangeEnd) + _text = ReadonlyAttribute(jsObject: jsObject, name: Strings.text) + _selectionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionStart) + _selectionEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionEnd) + _compositionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.compositionStart) + _compositionEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.compositionEnd) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(options: TextUpdateEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var updateRangeStart: UInt32 + + @ReadonlyAttribute + public var updateRangeEnd: UInt32 + + @ReadonlyAttribute + public var text: String + + @ReadonlyAttribute + public var selectionStart: UInt32 + + @ReadonlyAttribute + public var selectionEnd: UInt32 + + @ReadonlyAttribute + public var compositionStart: UInt32 + + @ReadonlyAttribute + public var compositionEnd: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift b/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift new file mode 100644 index 00000000..03b9b419 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TextUpdateEventInit: BridgedDictionary { + public convenience init(updateRangeStart: UInt32, updateRangeEnd: UInt32, text: String, selectionStart: UInt32, selectionEnd: UInt32, compositionStart: UInt32, compositionEnd: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.updateRangeStart] = updateRangeStart.jsValue() + object[Strings.updateRangeEnd] = updateRangeEnd.jsValue() + object[Strings.text] = text.jsValue() + object[Strings.selectionStart] = selectionStart.jsValue() + object[Strings.selectionEnd] = selectionEnd.jsValue() + object[Strings.compositionStart] = compositionStart.jsValue() + object[Strings.compositionEnd] = compositionEnd.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _updateRangeStart = ReadWriteAttribute(jsObject: object, name: Strings.updateRangeStart) + _updateRangeEnd = ReadWriteAttribute(jsObject: object, name: Strings.updateRangeEnd) + _text = ReadWriteAttribute(jsObject: object, name: Strings.text) + _selectionStart = ReadWriteAttribute(jsObject: object, name: Strings.selectionStart) + _selectionEnd = ReadWriteAttribute(jsObject: object, name: Strings.selectionEnd) + _compositionStart = ReadWriteAttribute(jsObject: object, name: Strings.compositionStart) + _compositionEnd = ReadWriteAttribute(jsObject: object, name: Strings.compositionEnd) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var updateRangeStart: UInt32 + + @ReadWriteAttribute + public var updateRangeEnd: UInt32 + + @ReadWriteAttribute + public var text: String + + @ReadWriteAttribute + public var selectionStart: UInt32 + + @ReadWriteAttribute + public var selectionEnd: UInt32 + + @ReadWriteAttribute + public var compositionStart: UInt32 + + @ReadWriteAttribute + public var compositionEnd: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/TimeEvent.swift b/Sources/DOMKit/WebIDL/TimeEvent.swift new file mode 100644 index 00000000..3a55ec83 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TimeEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TimeEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.TimeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _view = ReadonlyAttribute(jsObject: jsObject, name: Strings.view) + _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var view: WindowProxy? + + @ReadonlyAttribute + public var detail: Int32 + + public func initTimeEvent(typeArg: String, viewArg: Window?, detailArg: Int32) { + _ = jsObject[Strings.initTimeEvent]!(typeArg.jsValue(), viewArg.jsValue(), detailArg.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/TimeRanges.swift b/Sources/DOMKit/WebIDL/TimeRanges.swift index 12fd7529..b65092e4 100644 --- a/Sources/DOMKit/WebIDL/TimeRanges.swift +++ b/Sources/DOMKit/WebIDL/TimeRanges.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TimeRanges: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.TimeRanges.function! } + public class var constructor: JSFunction { JSObject.global[Strings.TimeRanges].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/TimelinePhase.swift b/Sources/DOMKit/WebIDL/TimelinePhase.swift new file mode 100644 index 00000000..0c68f14c --- /dev/null +++ b/Sources/DOMKit/WebIDL/TimelinePhase.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TimelinePhase: JSString, JSValueCompatible { + case inactive = "inactive" + case before = "before" + case active = "active" + case after = "after" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/TokenBinding.swift b/Sources/DOMKit/WebIDL/TokenBinding.swift new file mode 100644 index 00000000..b2dc049a --- /dev/null +++ b/Sources/DOMKit/WebIDL/TokenBinding.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TokenBinding: BridgedDictionary { + public convenience init(status: String, id: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.status] = status.jsValue() + object[Strings.id] = id.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _status = ReadWriteAttribute(jsObject: object, name: Strings.status) + _id = ReadWriteAttribute(jsObject: object, name: Strings.id) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var status: String + + @ReadWriteAttribute + public var id: String +} diff --git a/Sources/DOMKit/WebIDL/TokenBindingStatus.swift b/Sources/DOMKit/WebIDL/TokenBindingStatus.swift new file mode 100644 index 00000000..f15b69f0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TokenBindingStatus.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TokenBindingStatus: JSString, JSValueCompatible { + case present = "present" + case supported = "supported" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/Touch.swift b/Sources/DOMKit/WebIDL/Touch.swift new file mode 100644 index 00000000..75dfce60 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Touch.swift @@ -0,0 +1,78 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class Touch: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.Touch].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _identifier = ReadonlyAttribute(jsObject: jsObject, name: Strings.identifier) + _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) + _screenX = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenX) + _screenY = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenY) + _clientX = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientX) + _clientY = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientY) + _pageX = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageX) + _pageY = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageY) + _radiusX = ReadonlyAttribute(jsObject: jsObject, name: Strings.radiusX) + _radiusY = ReadonlyAttribute(jsObject: jsObject, name: Strings.radiusY) + _rotationAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.rotationAngle) + _force = ReadonlyAttribute(jsObject: jsObject, name: Strings.force) + _altitudeAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitudeAngle) + _azimuthAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.azimuthAngle) + _touchType = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchType) + self.jsObject = jsObject + } + + public convenience init(touchInitDict: TouchInit) { + self.init(unsafelyWrapping: Self.constructor.new(touchInitDict.jsValue())) + } + + @ReadonlyAttribute + public var identifier: Int32 + + @ReadonlyAttribute + public var target: EventTarget + + @ReadonlyAttribute + public var screenX: Double + + @ReadonlyAttribute + public var screenY: Double + + @ReadonlyAttribute + public var clientX: Double + + @ReadonlyAttribute + public var clientY: Double + + @ReadonlyAttribute + public var pageX: Double + + @ReadonlyAttribute + public var pageY: Double + + @ReadonlyAttribute + public var radiusX: Float + + @ReadonlyAttribute + public var radiusY: Float + + @ReadonlyAttribute + public var rotationAngle: Float + + @ReadonlyAttribute + public var force: Float + + @ReadonlyAttribute + public var altitudeAngle: Float + + @ReadonlyAttribute + public var azimuthAngle: Float + + @ReadonlyAttribute + public var touchType: TouchType +} diff --git a/Sources/DOMKit/WebIDL/TouchEvent.swift b/Sources/DOMKit/WebIDL/TouchEvent.swift new file mode 100644 index 00000000..eb4a8e53 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TouchEvent.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TouchEvent: UIEvent { + override public class var constructor: JSFunction { JSObject.global[Strings.TouchEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _touches = ReadonlyAttribute(jsObject: jsObject, name: Strings.touches) + _targetTouches = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetTouches) + _changedTouches = ReadonlyAttribute(jsObject: jsObject, name: Strings.changedTouches) + _altKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.altKey) + _metaKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.metaKey) + _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.ctrlKey) + _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.shiftKey) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: TouchEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var touches: TouchList + + @ReadonlyAttribute + public var targetTouches: TouchList + + @ReadonlyAttribute + public var changedTouches: TouchList + + @ReadonlyAttribute + public var altKey: Bool + + @ReadonlyAttribute + public var metaKey: Bool + + @ReadonlyAttribute + public var ctrlKey: Bool + + @ReadonlyAttribute + public var shiftKey: Bool +} diff --git a/Sources/DOMKit/WebIDL/TouchEventInit.swift b/Sources/DOMKit/WebIDL/TouchEventInit.swift new file mode 100644 index 00000000..0b580bea --- /dev/null +++ b/Sources/DOMKit/WebIDL/TouchEventInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TouchEventInit: BridgedDictionary { + public convenience init(touches: [Touch], targetTouches: [Touch], changedTouches: [Touch]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.touches] = touches.jsValue() + object[Strings.targetTouches] = targetTouches.jsValue() + object[Strings.changedTouches] = changedTouches.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _touches = ReadWriteAttribute(jsObject: object, name: Strings.touches) + _targetTouches = ReadWriteAttribute(jsObject: object, name: Strings.targetTouches) + _changedTouches = ReadWriteAttribute(jsObject: object, name: Strings.changedTouches) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var touches: [Touch] + + @ReadWriteAttribute + public var targetTouches: [Touch] + + @ReadWriteAttribute + public var changedTouches: [Touch] +} diff --git a/Sources/DOMKit/WebIDL/TouchInit.swift b/Sources/DOMKit/WebIDL/TouchInit.swift new file mode 100644 index 00000000..562d6f18 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TouchInit.swift @@ -0,0 +1,90 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TouchInit: BridgedDictionary { + public convenience init(identifier: Int32, target: EventTarget, clientX: Double, clientY: Double, screenX: Double, screenY: Double, pageX: Double, pageY: Double, radiusX: Float, radiusY: Float, rotationAngle: Float, force: Float, altitudeAngle: Double, azimuthAngle: Double, touchType: TouchType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.identifier] = identifier.jsValue() + object[Strings.target] = target.jsValue() + object[Strings.clientX] = clientX.jsValue() + object[Strings.clientY] = clientY.jsValue() + object[Strings.screenX] = screenX.jsValue() + object[Strings.screenY] = screenY.jsValue() + object[Strings.pageX] = pageX.jsValue() + object[Strings.pageY] = pageY.jsValue() + object[Strings.radiusX] = radiusX.jsValue() + object[Strings.radiusY] = radiusY.jsValue() + object[Strings.rotationAngle] = rotationAngle.jsValue() + object[Strings.force] = force.jsValue() + object[Strings.altitudeAngle] = altitudeAngle.jsValue() + object[Strings.azimuthAngle] = azimuthAngle.jsValue() + object[Strings.touchType] = touchType.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _identifier = ReadWriteAttribute(jsObject: object, name: Strings.identifier) + _target = ReadWriteAttribute(jsObject: object, name: Strings.target) + _clientX = ReadWriteAttribute(jsObject: object, name: Strings.clientX) + _clientY = ReadWriteAttribute(jsObject: object, name: Strings.clientY) + _screenX = ReadWriteAttribute(jsObject: object, name: Strings.screenX) + _screenY = ReadWriteAttribute(jsObject: object, name: Strings.screenY) + _pageX = ReadWriteAttribute(jsObject: object, name: Strings.pageX) + _pageY = ReadWriteAttribute(jsObject: object, name: Strings.pageY) + _radiusX = ReadWriteAttribute(jsObject: object, name: Strings.radiusX) + _radiusY = ReadWriteAttribute(jsObject: object, name: Strings.radiusY) + _rotationAngle = ReadWriteAttribute(jsObject: object, name: Strings.rotationAngle) + _force = ReadWriteAttribute(jsObject: object, name: Strings.force) + _altitudeAngle = ReadWriteAttribute(jsObject: object, name: Strings.altitudeAngle) + _azimuthAngle = ReadWriteAttribute(jsObject: object, name: Strings.azimuthAngle) + _touchType = ReadWriteAttribute(jsObject: object, name: Strings.touchType) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var identifier: Int32 + + @ReadWriteAttribute + public var target: EventTarget + + @ReadWriteAttribute + public var clientX: Double + + @ReadWriteAttribute + public var clientY: Double + + @ReadWriteAttribute + public var screenX: Double + + @ReadWriteAttribute + public var screenY: Double + + @ReadWriteAttribute + public var pageX: Double + + @ReadWriteAttribute + public var pageY: Double + + @ReadWriteAttribute + public var radiusX: Float + + @ReadWriteAttribute + public var radiusY: Float + + @ReadWriteAttribute + public var rotationAngle: Float + + @ReadWriteAttribute + public var force: Float + + @ReadWriteAttribute + public var altitudeAngle: Double + + @ReadWriteAttribute + public var azimuthAngle: Double + + @ReadWriteAttribute + public var touchType: TouchType +} diff --git a/Sources/DOMKit/WebIDL/TouchList.swift b/Sources/DOMKit/WebIDL/TouchList.swift new file mode 100644 index 00000000..5f97e238 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TouchList.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TouchList: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.TouchList].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 + + public subscript(key: Int) -> Touch? { + jsObject[key].fromJSValue() + } +} diff --git a/Sources/DOMKit/WebIDL/TouchType.swift b/Sources/DOMKit/WebIDL/TouchType.swift new file mode 100644 index 00000000..3c67f38f --- /dev/null +++ b/Sources/DOMKit/WebIDL/TouchType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TouchType: JSString, JSValueCompatible { + case direct = "direct" + case stylus = "stylus" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/TrackEvent.swift b/Sources/DOMKit/WebIDL/TrackEvent.swift index 891a39a1..792ed70e 100644 --- a/Sources/DOMKit/WebIDL/TrackEvent.swift +++ b/Sources/DOMKit/WebIDL/TrackEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TrackEvent: Event { - override public class var constructor: JSFunction { JSObject.global.TrackEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.TrackEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) diff --git a/Sources/DOMKit/WebIDL/TrackEventInit.swift b/Sources/DOMKit/WebIDL/TrackEventInit.swift index ab9cf461..61d8cc80 100644 --- a/Sources/DOMKit/WebIDL/TrackEventInit.swift +++ b/Sources/DOMKit/WebIDL/TrackEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class TrackEventInit: BridgedDictionary { public convenience init(track: __UNSUPPORTED_UNION__?) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.track] = track.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift b/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift new file mode 100644 index 00000000..65a46c92 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TransactionAutomationMode: JSString, JSValueCompatible { + case none = "none" + case autoaccept = "autoaccept" + case autoreject = "autoreject" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/TransferFunction.swift b/Sources/DOMKit/WebIDL/TransferFunction.swift new file mode 100644 index 00000000..d2dec1cb --- /dev/null +++ b/Sources/DOMKit/WebIDL/TransferFunction.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum TransferFunction: JSString, JSValueCompatible { + case srgb = "srgb" + case pq = "pq" + case hlg = "hlg" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/TransformStream.swift b/Sources/DOMKit/WebIDL/TransformStream.swift index f885f3c3..2744d4e0 100644 --- a/Sources/DOMKit/WebIDL/TransformStream.swift +++ b/Sources/DOMKit/WebIDL/TransformStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TransformStream: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.TransformStream.function! } + public class var constructor: JSFunction { JSObject.global[Strings.TransformStream].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift index 830b48fe..795c6578 100644 --- a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TransformStreamDefaultController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.TransformStreamDefaultController.function! } + public class var constructor: JSFunction { JSObject.global[Strings.TransformStreamDefaultController].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/Transformer.swift b/Sources/DOMKit/WebIDL/Transformer.swift index d93f280a..8d785c75 100644 --- a/Sources/DOMKit/WebIDL/Transformer.swift +++ b/Sources/DOMKit/WebIDL/Transformer.swift @@ -5,7 +5,7 @@ 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.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() ClosureAttribute.Required1[Strings.start, in: object] = start ClosureAttribute.Required2[Strings.transform, in: object] = transform ClosureAttribute.Required1[Strings.flush, in: object] = flush diff --git a/Sources/DOMKit/WebIDL/TransitionEvent.swift b/Sources/DOMKit/WebIDL/TransitionEvent.swift new file mode 100644 index 00000000..02c705fa --- /dev/null +++ b/Sources/DOMKit/WebIDL/TransitionEvent.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TransitionEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.TransitionEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _propertyName = ReadonlyAttribute(jsObject: jsObject, name: Strings.propertyName) + _elapsedTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.elapsedTime) + _pseudoElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.pseudoElement) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, transitionEventInitDict: TransitionEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), transitionEventInitDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var propertyName: String + + @ReadonlyAttribute + public var elapsedTime: Double + + @ReadonlyAttribute + public var pseudoElement: String +} diff --git a/Sources/DOMKit/WebIDL/TransitionEventInit.swift b/Sources/DOMKit/WebIDL/TransitionEventInit.swift new file mode 100644 index 00000000..cc24ff96 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TransitionEventInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TransitionEventInit: BridgedDictionary { + public convenience init(propertyName: String, elapsedTime: Double, pseudoElement: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.propertyName] = propertyName.jsValue() + object[Strings.elapsedTime] = elapsedTime.jsValue() + object[Strings.pseudoElement] = pseudoElement.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _propertyName = ReadWriteAttribute(jsObject: object, name: Strings.propertyName) + _elapsedTime = ReadWriteAttribute(jsObject: object, name: Strings.elapsedTime) + _pseudoElement = ReadWriteAttribute(jsObject: object, name: Strings.pseudoElement) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var propertyName: String + + @ReadWriteAttribute + public var elapsedTime: Double + + @ReadWriteAttribute + public var pseudoElement: String +} diff --git a/Sources/DOMKit/WebIDL/TreeWalker.swift b/Sources/DOMKit/WebIDL/TreeWalker.swift index 731a6ae6..68a5f0c2 100644 --- a/Sources/DOMKit/WebIDL/TreeWalker.swift +++ b/Sources/DOMKit/WebIDL/TreeWalker.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TreeWalker: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.TreeWalker.function! } + public class var constructor: JSFunction { JSObject.global[Strings.TreeWalker].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/TrustedHTML.swift b/Sources/DOMKit/WebIDL/TrustedHTML.swift new file mode 100644 index 00000000..fb37781f --- /dev/null +++ b/Sources/DOMKit/WebIDL/TrustedHTML.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TrustedHTML: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.TrustedHTML].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } + + public func toJSON() -> String { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + public static func fromLiteral(templateStringsArray: JSObject) -> Self { + constructor[Strings.fromLiteral]!(templateStringsArray.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TrustedScript.swift b/Sources/DOMKit/WebIDL/TrustedScript.swift new file mode 100644 index 00000000..67c2ddee --- /dev/null +++ b/Sources/DOMKit/WebIDL/TrustedScript.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TrustedScript: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.TrustedScript].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } + + public func toJSON() -> String { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + public static func fromLiteral(templateStringsArray: JSObject) -> Self { + constructor[Strings.fromLiteral]!(templateStringsArray.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TrustedScriptURL.swift b/Sources/DOMKit/WebIDL/TrustedScriptURL.swift new file mode 100644 index 00000000..0cc8d14a --- /dev/null +++ b/Sources/DOMKit/WebIDL/TrustedScriptURL.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TrustedScriptURL: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.TrustedScriptURL].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } + + public func toJSON() -> String { + jsObject[Strings.toJSON]!().fromJSValue()! + } + + public static func fromLiteral(templateStringsArray: JSObject) -> Self { + constructor[Strings.fromLiteral]!(templateStringsArray.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift new file mode 100644 index 00000000..a78af7da --- /dev/null +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TrustedTypePolicy: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.TrustedTypePolicy].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var name: String + + public func createHTML(input: String, arguments: JSValue...) -> TrustedHTML { + jsObject[Strings.createHTML]!(input.jsValue(), arguments.jsValue()).fromJSValue()! + } + + public func createScript(input: String, arguments: JSValue...) -> TrustedScript { + jsObject[Strings.createScript]!(input.jsValue(), arguments.jsValue()).fromJSValue()! + } + + public func createScriptURL(input: String, arguments: JSValue...) -> TrustedScriptURL { + jsObject[Strings.createScriptURL]!(input.jsValue(), arguments.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift new file mode 100644 index 00000000..f63c4721 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TrustedTypePolicyFactory: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.TrustedTypePolicyFactory].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _emptyHTML = ReadonlyAttribute(jsObject: jsObject, name: Strings.emptyHTML) + _emptyScript = ReadonlyAttribute(jsObject: jsObject, name: Strings.emptyScript) + _defaultPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.defaultPolicy) + self.jsObject = jsObject + } + + public func createPolicy(policyName: String, policyOptions: TrustedTypePolicyOptions? = nil) -> TrustedTypePolicy { + jsObject[Strings.createPolicy]!(policyName.jsValue(), policyOptions?.jsValue() ?? .undefined).fromJSValue()! + } + + public func isHTML(value: JSValue) -> Bool { + jsObject[Strings.isHTML]!(value.jsValue()).fromJSValue()! + } + + public func isScript(value: JSValue) -> Bool { + jsObject[Strings.isScript]!(value.jsValue()).fromJSValue()! + } + + public func isScriptURL(value: JSValue) -> Bool { + jsObject[Strings.isScriptURL]!(value.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var emptyHTML: TrustedHTML + + @ReadonlyAttribute + public var emptyScript: TrustedScript + + public func getAttributeType(tagName: String, attribute: String, elementNs: String? = nil, attrNs: String? = nil) -> String? { + jsObject[Strings.getAttributeType]!(tagName.jsValue(), attribute.jsValue(), elementNs?.jsValue() ?? .undefined, attrNs?.jsValue() ?? .undefined).fromJSValue()! + } + + public func getPropertyType(tagName: String, property: String, elementNs: String? = nil) -> String? { + jsObject[Strings.getPropertyType]!(tagName.jsValue(), property.jsValue(), elementNs?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var defaultPolicy: TrustedTypePolicy? +} diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift new file mode 100644 index 00000000..e22f2b5d --- /dev/null +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class TrustedTypePolicyOptions: BridgedDictionary { + public convenience init(createHTML: @escaping CreateHTMLCallback?, createScript: @escaping CreateScriptCallback?, createScriptURL: @escaping CreateScriptURLCallback?) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute.Required2[Strings.createHTML, in: object] = createHTML + ClosureAttribute.Required2[Strings.createScript, in: object] = createScript + ClosureAttribute.Required2[Strings.createScriptURL, in: object] = createScriptURL + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _createHTML = ClosureAttribute.Required2(jsObject: object, name: Strings.createHTML) + _createScript = ClosureAttribute.Required2(jsObject: object, name: Strings.createScript) + _createScriptURL = ClosureAttribute.Required2(jsObject: object, name: Strings.createScriptURL) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute.Required2 + public var createHTML: CreateHTMLCallback? + + @ClosureAttribute.Required2 + public var createScript: CreateScriptCallback? + + @ClosureAttribute.Required2 + public var createScriptURL: CreateScriptURLCallback? +} diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index 9c1b3f80..098f2781 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -3,8 +3,80 @@ import JavaScriptEventLoop import JavaScriptKit +public typealias CookieList = [CookieListItem] +public typealias HeadersInit = __UNSUPPORTED_UNION__ +public typealias XMLHttpRequestBodyInit = __UNSUPPORTED_UNION__ +public typealias BodyInit = __UNSUPPORTED_UNION__ +public typealias RequestInfo = __UNSUPPORTED_UNION__ +public typealias HTMLString = String +public typealias ScriptString = String +public typealias ScriptURLString = String +public typealias TrustedType = __UNSUPPORTED_UNION__ +public typealias BlobPart = __UNSUPPORTED_UNION__ +public typealias XRWebGLRenderingContext = __UNSUPPORTED_UNION__ +public typealias CSSStringSource = __UNSUPPORTED_UNION__ +public typealias CSSToken = __UNSUPPORTED_UNION__ +public typealias ReportList = [Report] +public typealias ReadableStreamReader = __UNSUPPORTED_UNION__ +public typealias ReadableStreamController = __UNSUPPORTED_UNION__ +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 TexImageSource = __UNSUPPORTED_UNION__ +public typealias Float32List = __UNSUPPORTED_UNION__ +public typealias Int32List = __UNSUPPORTED_UNION__ +public typealias UUID = String +public typealias BluetoothServiceUUID = __UNSUPPORTED_UNION__ +public typealias BluetoothCharacteristicUUID = __UNSUPPORTED_UNION__ +public typealias BluetoothDescriptorUUID = __UNSUPPORTED_UNION__ public typealias DOMHighResTimeStamp = Double public typealias EpochTimeStamp = UInt64 +public typealias FileSystemWriteChunkType = __UNSUPPORTED_UNION__ +public typealias StartInDirectory = __UNSUPPORTED_UNION__ +public typealias GeometryNode = __UNSUPPORTED_UNION__ +public typealias ConstrainPoint2D = __UNSUPPORTED_UNION__ +public typealias PasswordCredentialInit = __UNSUPPORTED_UNION__ +public typealias RotationMatrixType = __UNSUPPORTED_UNION__ +public typealias AlgorithmIdentifier = __UNSUPPORTED_UNION__ +public typealias HashAlgorithmIdentifier = AlgorithmIdentifier +public typealias BigInteger = Uint8Array +public typealias NamedCurve = String +public typealias NDEFMessageSource = __UNSUPPORTED_UNION__ +public typealias BinaryData = __UNSUPPORTED_UNION__ +public typealias ArrayBufferView = __UNSUPPORTED_UNION__ +public typealias BufferSource = __UNSUPPORTED_UNION__ +public typealias DOMTimeStamp = UInt64 +public typealias GLuint64EXT = UInt64 +public typealias Megabit = Double +public typealias Millisecond = UInt64 +public typealias CSSUnparsedSegment = __UNSUPPORTED_UNION__ +public typealias CSSKeywordish = __UNSUPPORTED_UNION__ +public typealias CSSNumberish = __UNSUPPORTED_UNION__ +public typealias CSSPerspectiveValue = __UNSUPPORTED_UNION__ +public typealias CSSColorRGBComp = __UNSUPPORTED_UNION__ +public typealias CSSColorPercent = __UNSUPPORTED_UNION__ +public typealias CSSColorNumber = __UNSUPPORTED_UNION__ +public typealias CSSColorAngle = __UNSUPPORTED_UNION__ +public typealias ContainerBasedOffset = __UNSUPPORTED_UNION__ +public typealias ScrollTimelineOffset = __UNSUPPORTED_UNION__ +public typealias PerformanceEntryList = [PerformanceEntry] +public typealias LineAndPositionSetting = __UNSUPPORTED_UNION__ +public typealias MLNamedOperands = [String: MLOperand] +public typealias MLBufferView = __UNSUPPORTED_UNION__ +public typealias MLResource = __UNSUPPORTED_UNION__ +public typealias MLNamedInputs = [String: __UNSUPPORTED_UNION__] +public typealias MLNamedOutputs = [String: MLResource] public typealias HTMLOrSVGScriptElement = __UNSUPPORTED_UNION__ public typealias MediaProvider = __UNSUPPORTED_UNION__ public typealias RenderingContext = __UNSUPPORTED_UNION__ @@ -18,26 +90,63 @@ public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? public typealias TimerHandler = __UNSUPPORTED_UNION__ public typealias ImageBitmapSource = __UNSUPPORTED_UNION__ public typealias MessageEventSource = __UNSUPPORTED_UNION__ -public typealias BlobPart = __UNSUPPORTED_UNION__ -public typealias ArrayBufferView = __UNSUPPORTED_UNION__ -public typealias BufferSource = __UNSUPPORTED_UNION__ -public typealias DOMTimeStamp = UInt64 -public typealias HeadersInit = __UNSUPPORTED_UNION__ -public typealias XMLHttpRequestBodyInit = __UNSUPPORTED_UNION__ -public typealias BodyInit = __UNSUPPORTED_UNION__ -public typealias RequestInfo = __UNSUPPORTED_UNION__ +public typealias GLint64 = Int64 +public typealias GLuint64 = UInt64 +public typealias Uint32List = __UNSUPPORTED_UNION__ +public typealias AttributeMatchList = [String: [String]] +public typealias ClipboardItemData = JSPromise +public typealias ClipboardItems = [ClipboardItem] public typealias FormDataEntryValue = __UNSUPPORTED_UNION__ -public typealias ReadableStreamReader = __UNSUPPORTED_UNION__ -public typealias ReadableStreamController = __UNSUPPORTED_UNION__ +public typealias RTCRtpTransform = __UNSUPPORTED_UNION__ +public typealias SmallCryptoKeyID = UInt64 +public typealias CryptoKeyID = __UNSUPPORTED_UNION__ +public typealias GPUBufferUsageFlags = UInt32 +public typealias GPUMapModeFlags = UInt32 +public typealias GPUTextureUsageFlags = UInt32 +public typealias GPUShaderStageFlags = UInt32 +public typealias GPUBindingResource = __UNSUPPORTED_UNION__ +public typealias GPUPipelineConstantValue = Double +public typealias GPUColorWriteFlags = UInt32 +public typealias GPUComputePassTimestampWrites = [GPUComputePassTimestampWrite] +public typealias GPURenderPassTimestampWrites = [GPURenderPassTimestampWrite] +public typealias GPUError = __UNSUPPORTED_UNION__ +public typealias GPUBufferDynamicOffset = UInt32 +public typealias GPUStencilValue = UInt32 +public typealias GPUSampleMask = UInt32 +public typealias GPUDepthBias = Int32 +public typealias GPUSize64 = UInt64 +public typealias GPUIntegerCoordinate = UInt32 +public typealias GPUIndex32 = UInt32 +public typealias GPUSize32 = UInt32 +public typealias GPUSignedOffset32 = Int32 +public typealias GPUFlagsConstant = UInt32 +public typealias GPUColor = __UNSUPPORTED_UNION__ +public typealias GPUOrigin2D = __UNSUPPORTED_UNION__ +public typealias GPUOrigin3D = __UNSUPPORTED_UNION__ +public typealias GPUExtent3D = __UNSUPPORTED_UNION__ +public typealias ConstrainULong = __UNSUPPORTED_UNION__ +public typealias ConstrainDouble = __UNSUPPORTED_UNION__ +public typealias ConstrainBoolean = __UNSUPPORTED_UNION__ +public typealias ConstrainDOMString = __UNSUPPORTED_UNION__ +public typealias ProfilerResource = String +public typealias URLPatternInput = __UNSUPPORTED_UNION__ +public typealias PushMessageDataInit = __UNSUPPORTED_UNION__ +public typealias COSEAlgorithmIdentifier = Int32 +public typealias UvmEntry = [UInt32] +public typealias UvmEntries = [UvmEntry] +public typealias VibratePattern = __UNSUPPORTED_UNION__ +public typealias ImageBufferSource = __UNSUPPORTED_UNION__ +public typealias IdleRequestCallback = (IdleDeadline) -> Void +public typealias EffectCallback = (Double?, __UNSUPPORTED_UNION__, Animation) -> Void +public typealias MediaSessionActionHandler = (MediaSessionActionDetails) -> Void +public typealias VideoFrameRequestCallback = (DOMHighResTimeStamp, VideoFrameMetadata) -> Void +public typealias ResizeObserverCallback = ([ResizeObserverEntry], ResizeObserver) -> Void public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void -public typealias BlobCallback = (Blob?) -> Void -public typealias CustomElementConstructor = () -> HTMLElement -public typealias FunctionStringCallback = (String) -> Void -public typealias EventHandlerNonNull = (Event) -> JSValue -public typealias OnErrorEventHandlerNonNull = (__UNSUPPORTED_UNION__, String, UInt32, UInt32, JSValue) -> JSValue -public typealias OnBeforeUnloadEventHandlerNonNull = (Event) -> String? -public typealias FrameRequestCallback = (DOMHighResTimeStamp) -> Void -public typealias VoidFunction = () -> Void +public typealias CreateHTMLCallback = (String, JSValue...) -> String +public typealias CreateScriptCallback = (String, JSValue...) -> String +public typealias CreateScriptURLCallback = (String, JSValue...) -> String +public typealias XRFrameRequestCallback = (DOMHighResTimeStamp, XRFrame) -> Void +public typealias ReportingObserverCallback = ([Report], ReportingObserver) -> Void public typealias UnderlyingSourceStartCallback = (ReadableStreamController) -> JSValue public typealias UnderlyingSourcePullCallback = (ReadableStreamController) -> JSPromise public typealias UnderlyingSourceCancelCallback = (JSValue) -> JSPromise @@ -49,3 +158,40 @@ public typealias TransformerStartCallback = (TransformStreamDefaultController) - public typealias TransformerFlushCallback = (TransformStreamDefaultController) -> JSPromise public typealias TransformerTransformCallback = (JSValue, TransformStreamDefaultController) -> JSPromise public typealias QueuingStrategySize = (JSValue) -> Double +public typealias NotificationPermissionCallback = (NotificationPermission) -> Void +public typealias ErrorCallback = (DOMException) -> Void +public typealias FileSystemEntryCallback = (FileSystemEntry) -> Void +public typealias FileSystemEntriesCallback = ([FileSystemEntry]) -> Void +public typealias FileCallback = (File) -> Void +public typealias RTCPeerConnectionErrorCallback = (DOMException) -> Void +public typealias RTCSessionDescriptionCallback = (RTCSessionDescriptionInit) -> Void +public typealias DecodeErrorCallback = (DOMException) -> Void +public typealias DecodeSuccessCallback = (AudioBuffer) -> Void +public typealias AudioWorkletProcessorConstructor = (JSObject) -> AudioWorkletProcessor +public typealias AudioWorkletProcessCallback = ([[Float32Array]], [[Float32Array]], JSObject) -> Bool +public typealias VoidFunction = () -> Void +public typealias PositionCallback = (GeolocationPosition) -> Void +public typealias PositionErrorCallback = (GeolocationPositionError) -> Void +public typealias PerformanceObserverCallback = (PerformanceObserverEntryList, PerformanceObserver, PerformanceObserverCallbackOptions) -> Void +public typealias AnimatorInstanceConstructor = (JSValue, JSValue) -> JSValue +public typealias ComputePressureUpdateCallback = ([ComputePressureRecord], ComputePressureObserver) -> Void +public typealias IntersectionObserverCallback = ([IntersectionObserverEntry], IntersectionObserver) -> Void +public typealias BlobCallback = (Blob?) -> Void +public typealias CustomElementConstructor = () -> HTMLElement +public typealias FunctionStringCallback = (String) -> Void +public typealias EventHandlerNonNull = (Event) -> JSValue +public typealias OnErrorEventHandlerNonNull = (__UNSUPPORTED_UNION__, String, UInt32, UInt32, JSValue) -> JSValue +public typealias OnBeforeUnloadEventHandlerNonNull = (Event) -> String? +public typealias FrameRequestCallback = (DOMHighResTimeStamp) -> Void +public typealias SchedulerPostTaskCallback = () -> JSValue +public typealias GenerateAssertionCallback = (String, String, RTCIdentityProviderOptions) -> JSPromise +public typealias ValidateAssertionCallback = (String, String) -> JSPromise +public typealias NavigatorUserMediaSuccessCallback = (MediaStream) -> Void +public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void +public typealias RemotePlaybackAvailabilityCallback = (Bool) -> Void +public typealias LockGrantedCallback = (Lock?) -> JSPromise +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 diff --git a/Sources/DOMKit/WebIDL/UADataValues.swift b/Sources/DOMKit/WebIDL/UADataValues.swift new file mode 100644 index 00000000..e75eb0d8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/UADataValues.swift @@ -0,0 +1,65 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class UADataValues: BridgedDictionary { + public convenience init(brands: [NavigatorUABrandVersion], mobile: Bool, architecture: String, bitness: String, model: String, platform: String, platformVersion: String, uaFullVersion: String, wow64: Bool, fullVersionList: [NavigatorUABrandVersion]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.brands] = brands.jsValue() + object[Strings.mobile] = mobile.jsValue() + object[Strings.architecture] = architecture.jsValue() + object[Strings.bitness] = bitness.jsValue() + object[Strings.model] = model.jsValue() + object[Strings.platform] = platform.jsValue() + object[Strings.platformVersion] = platformVersion.jsValue() + object[Strings.uaFullVersion] = uaFullVersion.jsValue() + object[Strings.wow64] = wow64.jsValue() + object[Strings.fullVersionList] = fullVersionList.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _brands = ReadWriteAttribute(jsObject: object, name: Strings.brands) + _mobile = ReadWriteAttribute(jsObject: object, name: Strings.mobile) + _architecture = ReadWriteAttribute(jsObject: object, name: Strings.architecture) + _bitness = ReadWriteAttribute(jsObject: object, name: Strings.bitness) + _model = ReadWriteAttribute(jsObject: object, name: Strings.model) + _platform = ReadWriteAttribute(jsObject: object, name: Strings.platform) + _platformVersion = ReadWriteAttribute(jsObject: object, name: Strings.platformVersion) + _uaFullVersion = ReadWriteAttribute(jsObject: object, name: Strings.uaFullVersion) + _wow64 = ReadWriteAttribute(jsObject: object, name: Strings.wow64) + _fullVersionList = ReadWriteAttribute(jsObject: object, name: Strings.fullVersionList) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var brands: [NavigatorUABrandVersion] + + @ReadWriteAttribute + public var mobile: Bool + + @ReadWriteAttribute + public var architecture: String + + @ReadWriteAttribute + public var bitness: String + + @ReadWriteAttribute + public var model: String + + @ReadWriteAttribute + public var platform: String + + @ReadWriteAttribute + public var platformVersion: String + + @ReadWriteAttribute + public var uaFullVersion: String + + @ReadWriteAttribute + public var wow64: Bool + + @ReadWriteAttribute + public var fullVersionList: [NavigatorUABrandVersion] +} diff --git a/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift b/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift new file mode 100644 index 00000000..33e5dac2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class UALowEntropyJSON: BridgedDictionary { + public convenience init(brands: [NavigatorUABrandVersion], mobile: Bool, platform: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.brands] = brands.jsValue() + object[Strings.mobile] = mobile.jsValue() + object[Strings.platform] = platform.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _brands = ReadWriteAttribute(jsObject: object, name: Strings.brands) + _mobile = ReadWriteAttribute(jsObject: object, name: Strings.mobile) + _platform = ReadWriteAttribute(jsObject: object, name: Strings.platform) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var brands: [NavigatorUABrandVersion] + + @ReadWriteAttribute + public var mobile: Bool + + @ReadWriteAttribute + public var platform: String +} diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index ab1dc140..144871e1 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -4,15 +4,19 @@ import JavaScriptEventLoop import JavaScriptKit public class UIEvent: Event { - override public class var constructor: JSFunction { JSObject.global.UIEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.UIEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _sourceCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceCapabilities) _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) } + @ReadonlyAttribute + public var sourceCapabilities: InputDeviceCapabilities? + public convenience init(type: String, eventInitDict: UIEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } diff --git a/Sources/DOMKit/WebIDL/UIEventInit.swift b/Sources/DOMKit/WebIDL/UIEventInit.swift index fd161f65..7d98368a 100644 --- a/Sources/DOMKit/WebIDL/UIEventInit.swift +++ b/Sources/DOMKit/WebIDL/UIEventInit.swift @@ -4,8 +4,9 @@ import JavaScriptEventLoop import JavaScriptKit public class UIEventInit: BridgedDictionary { - public convenience init(view: Window?, detail: Int32, which: UInt32) { - let object = JSObject.global.Object.function!.new() + public convenience init(sourceCapabilities: InputDeviceCapabilities?, view: Window?, detail: Int32, which: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.sourceCapabilities] = sourceCapabilities.jsValue() object[Strings.view] = view.jsValue() object[Strings.detail] = detail.jsValue() object[Strings.which] = which.jsValue() @@ -13,12 +14,16 @@ public class UIEventInit: BridgedDictionary { } public required init(unsafelyWrapping object: JSObject) { + _sourceCapabilities = ReadWriteAttribute(jsObject: object, name: Strings.sourceCapabilities) _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 sourceCapabilities: InputDeviceCapabilities? + @ReadWriteAttribute public var view: Window? diff --git a/Sources/DOMKit/WebIDL/ULongRange.swift b/Sources/DOMKit/WebIDL/ULongRange.swift new file mode 100644 index 00000000..10d39171 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ULongRange.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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 +} diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index d107adf0..5257eebf 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -4,11 +4,23 @@ import JavaScriptEventLoop import JavaScriptKit public class URL: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.URL.function! } + public class var constructor: JSFunction { JSObject.global[Strings.URL].function! } public let jsObject: JSObject 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 } @@ -19,4 +31,48 @@ public class URL: JSBridgedClass { public static func revokeObjectURL(url: String) { _ = constructor[Strings.revokeObjectURL]!(url.jsValue()) } + + public convenience init(url: String, base: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), base?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var href: String + + @ReadonlyAttribute + 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 searchParams: URLSearchParams + + @ReadWriteAttribute + public var hash: String + + public func toJSON() -> String { + jsObject[Strings.toJSON]!().fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/URLPattern.swift b/Sources/DOMKit/WebIDL/URLPattern.swift new file mode 100644 index 00000000..8db10776 --- /dev/null +++ b/Sources/DOMKit/WebIDL/URLPattern.swift @@ -0,0 +1,58 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class URLPattern: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.URLPattern].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) + _username = ReadonlyAttribute(jsObject: jsObject, name: Strings.username) + _password = ReadonlyAttribute(jsObject: jsObject, name: Strings.password) + _hostname = ReadonlyAttribute(jsObject: jsObject, name: Strings.hostname) + _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) + _pathname = ReadonlyAttribute(jsObject: jsObject, name: Strings.pathname) + _search = ReadonlyAttribute(jsObject: jsObject, name: Strings.search) + _hash = ReadonlyAttribute(jsObject: jsObject, name: Strings.hash) + self.jsObject = jsObject + } + + public convenience init(input: URLPatternInput? = nil, baseURL: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined)) + } + + public func test(input: URLPatternInput? = nil, baseURL: String? = nil) -> Bool { + jsObject[Strings.test]!(input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined).fromJSValue()! + } + + public func exec(input: URLPatternInput? = nil, baseURL: String? = nil) -> URLPatternResult? { + jsObject[Strings.exec]!(input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var `protocol`: String + + @ReadonlyAttribute + public var username: String + + @ReadonlyAttribute + public var password: String + + @ReadonlyAttribute + public var hostname: String + + @ReadonlyAttribute + public var port: String + + @ReadonlyAttribute + public var pathname: String + + @ReadonlyAttribute + public var search: String + + @ReadonlyAttribute + public var hash: String +} diff --git a/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift b/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift new file mode 100644 index 00000000..1edc7d65 --- /dev/null +++ b/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class URLPatternComponentResult: BridgedDictionary { + public convenience init(input: String, groups: [String: __UNSUPPORTED_UNION__]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.input] = input.jsValue() + object[Strings.groups] = groups.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _input = ReadWriteAttribute(jsObject: object, name: Strings.input) + _groups = ReadWriteAttribute(jsObject: object, name: Strings.groups) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var input: String + + @ReadWriteAttribute + public var groups: [String: __UNSUPPORTED_UNION__] +} diff --git a/Sources/DOMKit/WebIDL/URLPatternInit.swift b/Sources/DOMKit/WebIDL/URLPatternInit.swift new file mode 100644 index 00000000..ca2ceadb --- /dev/null +++ b/Sources/DOMKit/WebIDL/URLPatternInit.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class URLPatternInit: BridgedDictionary { + public convenience init(protocol: String, username: String, password: String, hostname: String, port: String, pathname: String, search: String, hash: String, baseURL: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.protocol] = `protocol`.jsValue() + object[Strings.username] = username.jsValue() + object[Strings.password] = password.jsValue() + object[Strings.hostname] = hostname.jsValue() + object[Strings.port] = port.jsValue() + object[Strings.pathname] = pathname.jsValue() + object[Strings.search] = search.jsValue() + object[Strings.hash] = hash.jsValue() + object[Strings.baseURL] = baseURL.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) + _username = ReadWriteAttribute(jsObject: object, name: Strings.username) + _password = ReadWriteAttribute(jsObject: object, name: Strings.password) + _hostname = ReadWriteAttribute(jsObject: object, name: Strings.hostname) + _port = ReadWriteAttribute(jsObject: object, name: Strings.port) + _pathname = ReadWriteAttribute(jsObject: object, name: Strings.pathname) + _search = ReadWriteAttribute(jsObject: object, name: Strings.search) + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + _baseURL = ReadWriteAttribute(jsObject: object, name: Strings.baseURL) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var `protocol`: String + + @ReadWriteAttribute + public var username: String + + @ReadWriteAttribute + public var password: String + + @ReadWriteAttribute + public var hostname: String + + @ReadWriteAttribute + public var port: String + + @ReadWriteAttribute + public var pathname: String + + @ReadWriteAttribute + public var search: String + + @ReadWriteAttribute + public var hash: String + + @ReadWriteAttribute + public var baseURL: String +} diff --git a/Sources/DOMKit/WebIDL/URLPatternResult.swift b/Sources/DOMKit/WebIDL/URLPatternResult.swift new file mode 100644 index 00000000..87c68abf --- /dev/null +++ b/Sources/DOMKit/WebIDL/URLPatternResult.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class URLPatternResult: BridgedDictionary { + public convenience init(inputs: [URLPatternInput], protocol: URLPatternComponentResult, username: URLPatternComponentResult, password: URLPatternComponentResult, hostname: URLPatternComponentResult, port: URLPatternComponentResult, pathname: URLPatternComponentResult, search: URLPatternComponentResult, hash: URLPatternComponentResult) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.inputs] = inputs.jsValue() + object[Strings.protocol] = `protocol`.jsValue() + object[Strings.username] = username.jsValue() + object[Strings.password] = password.jsValue() + object[Strings.hostname] = hostname.jsValue() + object[Strings.port] = port.jsValue() + object[Strings.pathname] = pathname.jsValue() + object[Strings.search] = search.jsValue() + object[Strings.hash] = hash.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _inputs = ReadWriteAttribute(jsObject: object, name: Strings.inputs) + _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) + _username = ReadWriteAttribute(jsObject: object, name: Strings.username) + _password = ReadWriteAttribute(jsObject: object, name: Strings.password) + _hostname = ReadWriteAttribute(jsObject: object, name: Strings.hostname) + _port = ReadWriteAttribute(jsObject: object, name: Strings.port) + _pathname = ReadWriteAttribute(jsObject: object, name: Strings.pathname) + _search = ReadWriteAttribute(jsObject: object, name: Strings.search) + _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var inputs: [URLPatternInput] + + @ReadWriteAttribute + public var `protocol`: URLPatternComponentResult + + @ReadWriteAttribute + public var username: URLPatternComponentResult + + @ReadWriteAttribute + public var password: URLPatternComponentResult + + @ReadWriteAttribute + public var hostname: URLPatternComponentResult + + @ReadWriteAttribute + public var port: URLPatternComponentResult + + @ReadWriteAttribute + public var pathname: URLPatternComponentResult + + @ReadWriteAttribute + public var search: URLPatternComponentResult + + @ReadWriteAttribute + public var hash: URLPatternComponentResult +} diff --git a/Sources/DOMKit/WebIDL/URLSearchParams.swift b/Sources/DOMKit/WebIDL/URLSearchParams.swift new file mode 100644 index 00000000..2fb1ff8a --- /dev/null +++ b/Sources/DOMKit/WebIDL/URLSearchParams.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class URLSearchParams: JSBridgedClass, Sequence { + public class var constructor: JSFunction { JSObject.global[Strings.URLSearchParams].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(init: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + } + + public func append(name: String, value: String) { + _ = jsObject[Strings.append]!(name.jsValue(), value.jsValue()) + } + + public func delete(name: String) { + _ = jsObject[Strings.delete]!(name.jsValue()) + } + + public func get(name: String) -> String? { + jsObject[Strings.get]!(name.jsValue()).fromJSValue()! + } + + public func getAll(name: String) -> [String] { + jsObject[Strings.getAll]!(name.jsValue()).fromJSValue()! + } + + public func has(name: String) -> Bool { + jsObject[Strings.has]!(name.jsValue()).fromJSValue()! + } + + public func set(name: String, value: String) { + _ = jsObject[Strings.set]!(name.jsValue(), value.jsValue()) + } + + public func sort() { + _ = jsObject[Strings.sort]!() + } + + public typealias Element = String + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + public var description: String { + jsObject[Strings.toString]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/USB.swift b/Sources/DOMKit/WebIDL/USB.swift new file mode 100644 index 00000000..ec0405c3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USB.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USB: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.USB].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute.Optional1 + public var onconnect: EventHandler + + @ClosureAttribute.Optional1 + public var ondisconnect: EventHandler + + public func getDevices() -> JSPromise { + jsObject[Strings.getDevices]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDevices() async throws -> [USBDevice] { + let _promise: JSPromise = jsObject[Strings.getDevices]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestDevice(options: USBDeviceRequestOptions) -> JSPromise { + jsObject[Strings.requestDevice]!(options.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestDevice(options: USBDeviceRequestOptions) async throws -> USBDevice { + let _promise: JSPromise = jsObject[Strings.requestDevice]!(options.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/USBAlternateInterface.swift b/Sources/DOMKit/WebIDL/USBAlternateInterface.swift new file mode 100644 index 00000000..c2e6084b --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBAlternateInterface.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBAlternateInterface: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBAlternateInterface].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _alternateSetting = ReadonlyAttribute(jsObject: jsObject, name: Strings.alternateSetting) + _interfaceClass = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceClass) + _interfaceSubclass = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceSubclass) + _interfaceProtocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceProtocol) + _interfaceName = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceName) + _endpoints = ReadonlyAttribute(jsObject: jsObject, name: Strings.endpoints) + self.jsObject = jsObject + } + + public convenience init(deviceInterface: USBInterface, alternateSetting: UInt8) { + self.init(unsafelyWrapping: Self.constructor.new(deviceInterface.jsValue(), alternateSetting.jsValue())) + } + + @ReadonlyAttribute + public var alternateSetting: UInt8 + + @ReadonlyAttribute + public var interfaceClass: UInt8 + + @ReadonlyAttribute + public var interfaceSubclass: UInt8 + + @ReadonlyAttribute + public var interfaceProtocol: UInt8 + + @ReadonlyAttribute + public var interfaceName: String? + + @ReadonlyAttribute + public var endpoints: [USBEndpoint] +} diff --git a/Sources/DOMKit/WebIDL/USBConfiguration.swift b/Sources/DOMKit/WebIDL/USBConfiguration.swift new file mode 100644 index 00000000..b4a3297f --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBConfiguration.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBConfiguration: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBConfiguration].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _configurationValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.configurationValue) + _configurationName = ReadonlyAttribute(jsObject: jsObject, name: Strings.configurationName) + _interfaces = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaces) + self.jsObject = jsObject + } + + public convenience init(device: USBDevice, configurationValue: UInt8) { + self.init(unsafelyWrapping: Self.constructor.new(device.jsValue(), configurationValue.jsValue())) + } + + @ReadonlyAttribute + public var configurationValue: UInt8 + + @ReadonlyAttribute + public var configurationName: String? + + @ReadonlyAttribute + public var interfaces: [USBInterface] +} diff --git a/Sources/DOMKit/WebIDL/USBConnectionEvent.swift b/Sources/DOMKit/WebIDL/USBConnectionEvent.swift new file mode 100644 index 00000000..2fd641bd --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBConnectionEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBConnectionEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.USBConnectionEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: USBConnectionEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var device: USBDevice +} diff --git a/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift b/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift new file mode 100644 index 00000000..7e7d012f --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBConnectionEventInit: BridgedDictionary { + public convenience init(device: USBDevice) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.device] = device.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _device = ReadWriteAttribute(jsObject: object, name: Strings.device) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var device: USBDevice +} diff --git a/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift b/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift new file mode 100644 index 00000000..2899d04c --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBControlTransferParameters: BridgedDictionary { + public convenience init(requestType: USBRequestType, recipient: USBRecipient, request: UInt8, value: UInt16, index: UInt16) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.requestType] = requestType.jsValue() + object[Strings.recipient] = recipient.jsValue() + object[Strings.request] = request.jsValue() + object[Strings.value] = value.jsValue() + object[Strings.index] = index.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _requestType = ReadWriteAttribute(jsObject: object, name: Strings.requestType) + _recipient = ReadWriteAttribute(jsObject: object, name: Strings.recipient) + _request = ReadWriteAttribute(jsObject: object, name: Strings.request) + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + _index = ReadWriteAttribute(jsObject: object, name: Strings.index) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var requestType: USBRequestType + + @ReadWriteAttribute + public var recipient: USBRecipient + + @ReadWriteAttribute + public var request: UInt8 + + @ReadWriteAttribute + public var value: UInt16 + + @ReadWriteAttribute + public var index: UInt16 +} diff --git a/Sources/DOMKit/WebIDL/USBDevice.swift b/Sources/DOMKit/WebIDL/USBDevice.swift new file mode 100644 index 00000000..1f010dad --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBDevice.swift @@ -0,0 +1,232 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBDevice: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBDevice].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _usbVersionMajor = ReadonlyAttribute(jsObject: jsObject, name: Strings.usbVersionMajor) + _usbVersionMinor = ReadonlyAttribute(jsObject: jsObject, name: Strings.usbVersionMinor) + _usbVersionSubminor = ReadonlyAttribute(jsObject: jsObject, name: Strings.usbVersionSubminor) + _deviceClass = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceClass) + _deviceSubclass = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceSubclass) + _deviceProtocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceProtocol) + _vendorId = ReadonlyAttribute(jsObject: jsObject, name: Strings.vendorId) + _productId = ReadonlyAttribute(jsObject: jsObject, name: Strings.productId) + _deviceVersionMajor = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceVersionMajor) + _deviceVersionMinor = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceVersionMinor) + _deviceVersionSubminor = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceVersionSubminor) + _manufacturerName = ReadonlyAttribute(jsObject: jsObject, name: Strings.manufacturerName) + _productName = ReadonlyAttribute(jsObject: jsObject, name: Strings.productName) + _serialNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.serialNumber) + _configuration = ReadonlyAttribute(jsObject: jsObject, name: Strings.configuration) + _configurations = ReadonlyAttribute(jsObject: jsObject, name: Strings.configurations) + _opened = ReadonlyAttribute(jsObject: jsObject, name: Strings.opened) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var usbVersionMajor: UInt8 + + @ReadonlyAttribute + public var usbVersionMinor: UInt8 + + @ReadonlyAttribute + public var usbVersionSubminor: UInt8 + + @ReadonlyAttribute + public var deviceClass: UInt8 + + @ReadonlyAttribute + public var deviceSubclass: UInt8 + + @ReadonlyAttribute + public var deviceProtocol: UInt8 + + @ReadonlyAttribute + public var vendorId: UInt16 + + @ReadonlyAttribute + public var productId: UInt16 + + @ReadonlyAttribute + public var deviceVersionMajor: UInt8 + + @ReadonlyAttribute + public var deviceVersionMinor: UInt8 + + @ReadonlyAttribute + public var deviceVersionSubminor: UInt8 + + @ReadonlyAttribute + public var manufacturerName: String? + + @ReadonlyAttribute + public var productName: String? + + @ReadonlyAttribute + public var serialNumber: String? + + @ReadonlyAttribute + public var configuration: USBConfiguration? + + @ReadonlyAttribute + public var configurations: [USBConfiguration] + + @ReadonlyAttribute + public var opened: Bool + + public func open() -> JSPromise { + jsObject[Strings.open]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func open() async throws { + let _promise: JSPromise = jsObject[Strings.open]!().fromJSValue()! + _ = try await _promise.get() + } + + public func close() -> JSPromise { + jsObject[Strings.close]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func close() async throws { + let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + _ = try await _promise.get() + } + + public func forget() -> JSPromise { + jsObject[Strings.forget]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func forget() async throws { + let _promise: JSPromise = jsObject[Strings.forget]!().fromJSValue()! + _ = try await _promise.get() + } + + public func selectConfiguration(configurationValue: UInt8) -> JSPromise { + jsObject[Strings.selectConfiguration]!(configurationValue.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func selectConfiguration(configurationValue: UInt8) async throws { + let _promise: JSPromise = jsObject[Strings.selectConfiguration]!(configurationValue.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func claimInterface(interfaceNumber: UInt8) -> JSPromise { + jsObject[Strings.claimInterface]!(interfaceNumber.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func claimInterface(interfaceNumber: UInt8) async throws { + let _promise: JSPromise = jsObject[Strings.claimInterface]!(interfaceNumber.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func releaseInterface(interfaceNumber: UInt8) -> JSPromise { + jsObject[Strings.releaseInterface]!(interfaceNumber.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func releaseInterface(interfaceNumber: UInt8) async throws { + let _promise: JSPromise = jsObject[Strings.releaseInterface]!(interfaceNumber.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) -> JSPromise { + jsObject[Strings.selectAlternateInterface]!(interfaceNumber.jsValue(), alternateSetting.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) async throws { + let _promise: JSPromise = jsObject[Strings.selectAlternateInterface]!(interfaceNumber.jsValue(), alternateSetting.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) -> JSPromise { + jsObject[Strings.controlTransferIn]!(setup.jsValue(), length.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) async throws -> USBInTransferResult { + let _promise: JSPromise = jsObject[Strings.controlTransferIn]!(setup.jsValue(), length.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) -> JSPromise { + jsObject[Strings.controlTransferOut]!(setup.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) async throws -> USBOutTransferResult { + let _promise: JSPromise = jsObject[Strings.controlTransferOut]!(setup.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func clearHalt(direction: USBDirection, endpointNumber: UInt8) -> JSPromise { + jsObject[Strings.clearHalt]!(direction.jsValue(), endpointNumber.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func clearHalt(direction: USBDirection, endpointNumber: UInt8) async throws { + let _promise: JSPromise = jsObject[Strings.clearHalt]!(direction.jsValue(), endpointNumber.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func transferIn(endpointNumber: UInt8, length: UInt32) -> JSPromise { + jsObject[Strings.transferIn]!(endpointNumber.jsValue(), length.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func transferIn(endpointNumber: UInt8, length: UInt32) async throws -> USBInTransferResult { + let _promise: JSPromise = jsObject[Strings.transferIn]!(endpointNumber.jsValue(), length.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func transferOut(endpointNumber: UInt8, data: BufferSource) -> JSPromise { + jsObject[Strings.transferOut]!(endpointNumber.jsValue(), data.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func transferOut(endpointNumber: UInt8, data: BufferSource) async throws -> USBOutTransferResult { + let _promise: JSPromise = jsObject[Strings.transferOut]!(endpointNumber.jsValue(), data.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) -> JSPromise { + jsObject[Strings.isochronousTransferIn]!(endpointNumber.jsValue(), packetLengths.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) async throws -> USBIsochronousInTransferResult { + let _promise: JSPromise = jsObject[Strings.isochronousTransferIn]!(endpointNumber.jsValue(), packetLengths.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) -> JSPromise { + jsObject[Strings.isochronousTransferOut]!(endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) async throws -> USBIsochronousOutTransferResult { + let _promise: JSPromise = jsObject[Strings.isochronousTransferOut]!(endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func reset() -> JSPromise { + jsObject[Strings.reset]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func reset() async throws { + let _promise: JSPromise = jsObject[Strings.reset]!().fromJSValue()! + _ = try await _promise.get() + } +} diff --git a/Sources/DOMKit/WebIDL/USBDeviceFilter.swift b/Sources/DOMKit/WebIDL/USBDeviceFilter.swift new file mode 100644 index 00000000..abf01e2e --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBDeviceFilter.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBDeviceFilter: BridgedDictionary { + public convenience init(vendorId: UInt16, productId: UInt16, classCode: UInt8, subclassCode: UInt8, protocolCode: UInt8, serialNumber: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.vendorId] = vendorId.jsValue() + object[Strings.productId] = productId.jsValue() + object[Strings.classCode] = classCode.jsValue() + object[Strings.subclassCode] = subclassCode.jsValue() + object[Strings.protocolCode] = protocolCode.jsValue() + object[Strings.serialNumber] = serialNumber.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _vendorId = ReadWriteAttribute(jsObject: object, name: Strings.vendorId) + _productId = ReadWriteAttribute(jsObject: object, name: Strings.productId) + _classCode = ReadWriteAttribute(jsObject: object, name: Strings.classCode) + _subclassCode = ReadWriteAttribute(jsObject: object, name: Strings.subclassCode) + _protocolCode = ReadWriteAttribute(jsObject: object, name: Strings.protocolCode) + _serialNumber = ReadWriteAttribute(jsObject: object, name: Strings.serialNumber) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var vendorId: UInt16 + + @ReadWriteAttribute + public var productId: UInt16 + + @ReadWriteAttribute + public var classCode: UInt8 + + @ReadWriteAttribute + public var subclassCode: UInt8 + + @ReadWriteAttribute + public var protocolCode: UInt8 + + @ReadWriteAttribute + public var serialNumber: String +} diff --git a/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift b/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift new file mode 100644 index 00000000..855ead0d --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBDeviceRequestOptions: BridgedDictionary { + public convenience init(filters: [USBDeviceFilter]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.filters] = filters.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var filters: [USBDeviceFilter] +} diff --git a/Sources/DOMKit/WebIDL/USBDirection.swift b/Sources/DOMKit/WebIDL/USBDirection.swift new file mode 100644 index 00000000..18092b3b --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBDirection.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum USBDirection: JSString, JSValueCompatible { + case in = "in" + case out = "out" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/USBEndpoint.swift b/Sources/DOMKit/WebIDL/USBEndpoint.swift new file mode 100644 index 00000000..a2b4aa74 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBEndpoint.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBEndpoint: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBEndpoint].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _endpointNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.endpointNumber) + _direction = ReadonlyAttribute(jsObject: jsObject, name: Strings.direction) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _packetSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.packetSize) + self.jsObject = jsObject + } + + public convenience init(alternate: USBAlternateInterface, endpointNumber: UInt8, direction: USBDirection) { + self.init(unsafelyWrapping: Self.constructor.new(alternate.jsValue(), endpointNumber.jsValue(), direction.jsValue())) + } + + @ReadonlyAttribute + public var endpointNumber: UInt8 + + @ReadonlyAttribute + public var direction: USBDirection + + @ReadonlyAttribute + public var type: USBEndpointType + + @ReadonlyAttribute + public var packetSize: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/USBEndpointType.swift b/Sources/DOMKit/WebIDL/USBEndpointType.swift new file mode 100644 index 00000000..d4869024 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBEndpointType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum USBEndpointType: JSString, JSValueCompatible { + case bulk = "bulk" + case interrupt = "interrupt" + case isochronous = "isochronous" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/USBInTransferResult.swift b/Sources/DOMKit/WebIDL/USBInTransferResult.swift new file mode 100644 index 00000000..fd919b22 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBInTransferResult.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBInTransferResult: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBInTransferResult].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) + self.jsObject = jsObject + } + + public convenience init(status: USBTransferStatus, data: DataView? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(status.jsValue(), data?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var data: DataView? + + @ReadonlyAttribute + public var status: USBTransferStatus +} diff --git a/Sources/DOMKit/WebIDL/USBInterface.swift b/Sources/DOMKit/WebIDL/USBInterface.swift new file mode 100644 index 00000000..a6542d94 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBInterface.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBInterface: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBInterface].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _interfaceNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceNumber) + _alternate = ReadonlyAttribute(jsObject: jsObject, name: Strings.alternate) + _alternates = ReadonlyAttribute(jsObject: jsObject, name: Strings.alternates) + _claimed = ReadonlyAttribute(jsObject: jsObject, name: Strings.claimed) + self.jsObject = jsObject + } + + public convenience init(configuration: USBConfiguration, interfaceNumber: UInt8) { + self.init(unsafelyWrapping: Self.constructor.new(configuration.jsValue(), interfaceNumber.jsValue())) + } + + @ReadonlyAttribute + public var interfaceNumber: UInt8 + + @ReadonlyAttribute + public var alternate: USBAlternateInterface + + @ReadonlyAttribute + public var alternates: [USBAlternateInterface] + + @ReadonlyAttribute + public var claimed: Bool +} diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift new file mode 100644 index 00000000..d5db43e0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBIsochronousInTransferPacket: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousInTransferPacket].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) + self.jsObject = jsObject + } + + public convenience init(status: USBTransferStatus, data: DataView? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(status.jsValue(), data?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var data: DataView? + + @ReadonlyAttribute + public var status: USBTransferStatus +} diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift new file mode 100644 index 00000000..7abea45f --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBIsochronousInTransferResult: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousInTransferResult].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _packets = ReadonlyAttribute(jsObject: jsObject, name: Strings.packets) + self.jsObject = jsObject + } + + public convenience init(packets: [USBIsochronousInTransferPacket], data: DataView? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(packets.jsValue(), data?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var data: DataView? + + @ReadonlyAttribute + public var packets: [USBIsochronousInTransferPacket] +} diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift new file mode 100644 index 00000000..48fae591 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBIsochronousOutTransferPacket: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousOutTransferPacket].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _bytesWritten = ReadonlyAttribute(jsObject: jsObject, name: Strings.bytesWritten) + _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) + self.jsObject = jsObject + } + + public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(status.jsValue(), bytesWritten?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var bytesWritten: UInt32 + + @ReadonlyAttribute + public var status: USBTransferStatus +} diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift new file mode 100644 index 00000000..14618fd2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBIsochronousOutTransferResult: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousOutTransferResult].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _packets = ReadonlyAttribute(jsObject: jsObject, name: Strings.packets) + self.jsObject = jsObject + } + + public convenience init(packets: [USBIsochronousOutTransferPacket]) { + self.init(unsafelyWrapping: Self.constructor.new(packets.jsValue())) + } + + @ReadonlyAttribute + public var packets: [USBIsochronousOutTransferPacket] +} diff --git a/Sources/DOMKit/WebIDL/USBOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBOutTransferResult.swift new file mode 100644 index 00000000..8c91ae0d --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBOutTransferResult.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBOutTransferResult: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.USBOutTransferResult].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _bytesWritten = ReadonlyAttribute(jsObject: jsObject, name: Strings.bytesWritten) + _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) + self.jsObject = jsObject + } + + public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(status.jsValue(), bytesWritten?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var bytesWritten: UInt32 + + @ReadonlyAttribute + public var status: USBTransferStatus +} diff --git a/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift new file mode 100644 index 00000000..5273766f --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBPermissionDescriptor: BridgedDictionary { + public convenience init(filters: [USBDeviceFilter]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.filters] = filters.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var filters: [USBDeviceFilter] +} diff --git a/Sources/DOMKit/WebIDL/USBPermissionResult.swift b/Sources/DOMKit/WebIDL/USBPermissionResult.swift new file mode 100644 index 00000000..62bcdae3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBPermissionResult.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBPermissionResult: PermissionStatus { + override public class var constructor: JSFunction { JSObject.global[Strings.USBPermissionResult].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _devices = ReadWriteAttribute(jsObject: jsObject, name: Strings.devices) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var devices: [USBDevice] +} diff --git a/Sources/DOMKit/WebIDL/USBPermissionStorage.swift b/Sources/DOMKit/WebIDL/USBPermissionStorage.swift new file mode 100644 index 00000000..2ba1d6cd --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBPermissionStorage.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class USBPermissionStorage: BridgedDictionary { + public convenience init(allowedDevices: [AllowedUSBDevice]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.allowedDevices] = allowedDevices.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _allowedDevices = ReadWriteAttribute(jsObject: object, name: Strings.allowedDevices) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var allowedDevices: [AllowedUSBDevice] +} diff --git a/Sources/DOMKit/WebIDL/USBRecipient.swift b/Sources/DOMKit/WebIDL/USBRecipient.swift new file mode 100644 index 00000000..28477646 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBRecipient.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum USBRecipient: JSString, JSValueCompatible { + case device = "device" + case interface = "interface" + case endpoint = "endpoint" + case other = "other" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/USBRequestType.swift b/Sources/DOMKit/WebIDL/USBRequestType.swift new file mode 100644 index 00000000..05c1ddce --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBRequestType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum USBRequestType: JSString, JSValueCompatible { + case standard = "standard" + case `class` = "class" + case vendor = "vendor" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/USBTransferStatus.swift b/Sources/DOMKit/WebIDL/USBTransferStatus.swift new file mode 100644 index 00000000..6f4acef4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/USBTransferStatus.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum USBTransferStatus: JSString, JSValueCompatible { + case ok = "ok" + case stall = "stall" + case babble = "babble" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift b/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift new file mode 100644 index 00000000..3f95eed7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class UncalibratedMagnetometer: Sensor { + override public class var constructor: JSFunction { JSObject.global[Strings.UncalibratedMagnetometer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) + _xBias = ReadonlyAttribute(jsObject: jsObject, name: Strings.xBias) + _yBias = ReadonlyAttribute(jsObject: jsObject, name: Strings.yBias) + _zBias = ReadonlyAttribute(jsObject: jsObject, name: Strings.zBias) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var x: Double? + + @ReadonlyAttribute + public var y: Double? + + @ReadonlyAttribute + public var z: Double? + + @ReadonlyAttribute + public var xBias: Double? + + @ReadonlyAttribute + public var yBias: Double? + + @ReadonlyAttribute + public var zBias: Double? +} diff --git a/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift b/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift new file mode 100644 index 00000000..802aa3f7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class UncalibratedMagnetometerReadingValues: BridgedDictionary { + public convenience init(x: Double?, y: Double?, z: Double?, xBias: Double?, yBias: Double?, zBias: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.z] = z.jsValue() + object[Strings.xBias] = xBias.jsValue() + object[Strings.yBias] = yBias.jsValue() + object[Strings.zBias] = zBias.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _z = ReadWriteAttribute(jsObject: object, name: Strings.z) + _xBias = ReadWriteAttribute(jsObject: object, name: Strings.xBias) + _yBias = ReadWriteAttribute(jsObject: object, name: Strings.yBias) + _zBias = ReadWriteAttribute(jsObject: object, name: Strings.zBias) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var x: Double? + + @ReadWriteAttribute + public var y: Double? + + @ReadWriteAttribute + public var z: Double? + + @ReadWriteAttribute + public var xBias: Double? + + @ReadWriteAttribute + public var yBias: Double? + + @ReadWriteAttribute + public var zBias: Double? +} diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift index e8fa13ab..5d8596d0 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSink.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSink.swift @@ -5,7 +5,7 @@ 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.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() ClosureAttribute.Required1[Strings.start, in: object] = start ClosureAttribute.Required2[Strings.write, in: object] = write ClosureAttribute.Required0[Strings.close, in: object] = close diff --git a/Sources/DOMKit/WebIDL/UnderlyingSource.swift b/Sources/DOMKit/WebIDL/UnderlyingSource.swift index eb36bc46..6e08def6 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSource.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSource.swift @@ -5,7 +5,7 @@ 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.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() ClosureAttribute.Required1[Strings.start, in: object] = start ClosureAttribute.Required1[Strings.pull, in: object] = pull ClosureAttribute.Required1[Strings.cancel, in: object] = cancel diff --git a/Sources/DOMKit/WebIDL/UserIdleState.swift b/Sources/DOMKit/WebIDL/UserIdleState.swift new file mode 100644 index 00000000..afb1ea15 --- /dev/null +++ b/Sources/DOMKit/WebIDL/UserIdleState.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum UserIdleState: JSString, JSValueCompatible { + case active = "active" + case idle = "idle" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift b/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift new file mode 100644 index 00000000..1146eb6f --- /dev/null +++ b/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum UserVerificationRequirement: JSString, JSValueCompatible { + case required = "required" + case preferred = "preferred" + case discouraged = "discouraged" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/VTTCue.swift b/Sources/DOMKit/WebIDL/VTTCue.swift new file mode 100644 index 00000000..d7c3f49f --- /dev/null +++ b/Sources/DOMKit/WebIDL/VTTCue.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VTTCue: TextTrackCue { + override public class var constructor: JSFunction { JSObject.global[Strings.VTTCue].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _region = ReadWriteAttribute(jsObject: jsObject, name: Strings.region) + _vertical = ReadWriteAttribute(jsObject: jsObject, name: Strings.vertical) + _snapToLines = ReadWriteAttribute(jsObject: jsObject, name: Strings.snapToLines) + _line = ReadWriteAttribute(jsObject: jsObject, name: Strings.line) + _lineAlign = ReadWriteAttribute(jsObject: jsObject, name: Strings.lineAlign) + _position = ReadWriteAttribute(jsObject: jsObject, name: Strings.position) + _positionAlign = ReadWriteAttribute(jsObject: jsObject, name: Strings.positionAlign) + _size = ReadWriteAttribute(jsObject: jsObject, name: Strings.size) + _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) + _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(startTime: Double, endTime: Double, text: String) { + self.init(unsafelyWrapping: Self.constructor.new(startTime.jsValue(), endTime.jsValue(), text.jsValue())) + } + + @ReadWriteAttribute + public var region: VTTRegion? + + @ReadWriteAttribute + public var vertical: DirectionSetting + + @ReadWriteAttribute + public var snapToLines: Bool + + @ReadWriteAttribute + public var line: LineAndPositionSetting + + @ReadWriteAttribute + public var lineAlign: LineAlignSetting + + @ReadWriteAttribute + public var position: LineAndPositionSetting + + @ReadWriteAttribute + public var positionAlign: PositionAlignSetting + + @ReadWriteAttribute + public var size: Double + + @ReadWriteAttribute + public var align: AlignSetting + + @ReadWriteAttribute + public var text: String + + public func getCueAsHTML() -> DocumentFragment { + jsObject[Strings.getCueAsHTML]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/VTTRegion.swift b/Sources/DOMKit/WebIDL/VTTRegion.swift new file mode 100644 index 00000000..821fbda5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VTTRegion.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VTTRegion: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.VTTRegion].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadWriteAttribute(jsObject: jsObject, name: Strings.id) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _lines = ReadWriteAttribute(jsObject: jsObject, name: Strings.lines) + _regionAnchorX = ReadWriteAttribute(jsObject: jsObject, name: Strings.regionAnchorX) + _regionAnchorY = ReadWriteAttribute(jsObject: jsObject, name: Strings.regionAnchorY) + _viewportAnchorX = ReadWriteAttribute(jsObject: jsObject, name: Strings.viewportAnchorX) + _viewportAnchorY = ReadWriteAttribute(jsObject: jsObject, name: Strings.viewportAnchorY) + _scroll = ReadWriteAttribute(jsObject: jsObject, name: Strings.scroll) + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadWriteAttribute + public var id: String + + @ReadWriteAttribute + public var width: Double + + @ReadWriteAttribute + public var lines: UInt32 + + @ReadWriteAttribute + public var regionAnchorX: Double + + @ReadWriteAttribute + public var regionAnchorY: Double + + @ReadWriteAttribute + public var viewportAnchorX: Double + + @ReadWriteAttribute + public var viewportAnchorY: Double + + @ReadWriteAttribute + public var scroll: ScrollSetting +} diff --git a/Sources/DOMKit/WebIDL/ValidityState.swift b/Sources/DOMKit/WebIDL/ValidityState.swift index 0f0e5af0..9a39cb94 100644 --- a/Sources/DOMKit/WebIDL/ValidityState.swift +++ b/Sources/DOMKit/WebIDL/ValidityState.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ValidityState: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.ValidityState.function! } + public class var constructor: JSFunction { JSObject.global[Strings.ValidityState].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift index b97cd7c3..9cc09b1c 100644 --- a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift +++ b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift @@ -5,7 +5,7 @@ import JavaScriptKit 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.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.valueMissing] = valueMissing.jsValue() object[Strings.typeMismatch] = typeMismatch.jsValue() object[Strings.patternMismatch] = patternMismatch.jsValue() diff --git a/Sources/DOMKit/WebIDL/ValueEvent.swift b/Sources/DOMKit/WebIDL/ValueEvent.swift new file mode 100644 index 00000000..b766c688 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ValueEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ValueEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.ValueEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, initDict: ValueEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), initDict?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var value: JSValue +} diff --git a/Sources/DOMKit/WebIDL/ValueEventInit.swift b/Sources/DOMKit/WebIDL/ValueEventInit.swift new file mode 100644 index 00000000..5f5c047a --- /dev/null +++ b/Sources/DOMKit/WebIDL/ValueEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ValueEventInit: BridgedDictionary { + public convenience init(value: JSValue) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.value] = value.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var value: JSValue +} diff --git a/Sources/DOMKit/WebIDL/ValueType.swift b/Sources/DOMKit/WebIDL/ValueType.swift new file mode 100644 index 00000000..bcbfdbe8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ValueType.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum ValueType: JSString, JSValueCompatible { + case i32 = "i32" + case i64 = "i64" + case f32 = "f32" + case f64 = "f64" + case v128 = "v128" + case externref = "externref" + case anyfunc = "anyfunc" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift b/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift new file mode 100644 index 00000000..e0fc2c03 --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/VideoColorSpace.swift b/Sources/DOMKit/WebIDL/VideoColorSpace.swift new file mode 100644 index 00000000..317b9fb9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoColorSpace.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoColorSpace: JSBridgedClass { + 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 + } + + public convenience init(init: VideoColorSpaceInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var primaries: VideoColorPrimaries? + + @ReadonlyAttribute + public var transfer: VideoTransferCharacteristics? + + @ReadonlyAttribute + public var matrix: VideoMatrixCoefficients? + + @ReadonlyAttribute + public var fullRange: Bool? + + public func toJSON() -> VideoColorSpaceInit { + jsObject[Strings.toJSON]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift b/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift new file mode 100644 index 00000000..f8074aa7 --- /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/VideoConfiguration.swift b/Sources/DOMKit/WebIDL/VideoConfiguration.swift new file mode 100644 index 00000000..da32c0fe --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoConfiguration.swift @@ -0,0 +1,65 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoConfiguration: BridgedDictionary { + public convenience init(contentType: String, width: UInt32, height: UInt32, bitrate: UInt64, framerate: Double, hasAlphaChannel: Bool, hdrMetadataType: HdrMetadataType, colorGamut: ColorGamut, transferFunction: TransferFunction, scalabilityMode: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.contentType] = contentType.jsValue() + object[Strings.width] = width.jsValue() + object[Strings.height] = height.jsValue() + object[Strings.bitrate] = bitrate.jsValue() + object[Strings.framerate] = framerate.jsValue() + object[Strings.hasAlphaChannel] = hasAlphaChannel.jsValue() + object[Strings.hdrMetadataType] = hdrMetadataType.jsValue() + object[Strings.colorGamut] = colorGamut.jsValue() + object[Strings.transferFunction] = transferFunction.jsValue() + object[Strings.scalabilityMode] = scalabilityMode.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _contentType = ReadWriteAttribute(jsObject: object, name: Strings.contentType) + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) + _framerate = ReadWriteAttribute(jsObject: object, name: Strings.framerate) + _hasAlphaChannel = ReadWriteAttribute(jsObject: object, name: Strings.hasAlphaChannel) + _hdrMetadataType = ReadWriteAttribute(jsObject: object, name: Strings.hdrMetadataType) + _colorGamut = ReadWriteAttribute(jsObject: object, name: Strings.colorGamut) + _transferFunction = ReadWriteAttribute(jsObject: object, name: Strings.transferFunction) + _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var contentType: String + + @ReadWriteAttribute + public var width: UInt32 + + @ReadWriteAttribute + public var height: UInt32 + + @ReadWriteAttribute + public var bitrate: UInt64 + + @ReadWriteAttribute + public var framerate: Double + + @ReadWriteAttribute + public var hasAlphaChannel: Bool + + @ReadWriteAttribute + public var hdrMetadataType: HdrMetadataType + + @ReadWriteAttribute + public var colorGamut: ColorGamut + + @ReadWriteAttribute + public var transferFunction: TransferFunction + + @ReadWriteAttribute + public var scalabilityMode: String +} diff --git a/Sources/DOMKit/WebIDL/VideoDecoder.swift b/Sources/DOMKit/WebIDL/VideoDecoder.swift new file mode 100644 index 00000000..2221c97d --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoDecoder.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoDecoder: JSBridgedClass { + 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 convenience init(init: VideoDecoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadonlyAttribute + public var state: CodecState + + @ReadonlyAttribute + public var decodeQueueSize: UInt32 + + public func configure(config: VideoDecoderConfig) { + _ = jsObject[Strings.configure]!(config.jsValue()) + } + + public func decode(chunk: EncodedVideoChunk) { + _ = jsObject[Strings.decode]!(chunk.jsValue()) + } + + public func flush() -> JSPromise { + jsObject[Strings.flush]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func flush() async throws { + let _promise: JSPromise = jsObject[Strings.flush]!().fromJSValue()! + _ = try await _promise.get() + } + + public func reset() { + _ = jsObject[Strings.reset]!() + } + + public func close() { + _ = jsObject[Strings.close]!() + } + + public static func isConfigSupported(config: VideoDecoderConfig) -> JSPromise { + constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func isConfigSupported(config: VideoDecoderConfig) async throws -> VideoDecoderSupport { + let _promise: JSPromise = constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift b/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift new file mode 100644 index 00000000..63a3ec8c --- /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..025cfc71 --- /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() + ClosureAttribute.Required1[Strings.output, in: object] = output + ClosureAttribute.Required1[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute.Required1(jsObject: object, name: Strings.output) + _error = ClosureAttribute.Required1(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute.Required1 + public var output: VideoFrameOutputCallback + + @ClosureAttribute.Required1 + public var error: WebCodecsErrorCallback +} diff --git a/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift b/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift new file mode 100644 index 00000000..daff0dce --- /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..0e160e71 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoEncoder.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoEncoder: JSBridgedClass { + 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 + } + + public convenience init(init: VideoEncoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + } + + @ReadonlyAttribute + public var state: CodecState + + @ReadonlyAttribute + public var encodeQueueSize: UInt32 + + public func configure(config: VideoEncoderConfig) { + _ = jsObject[Strings.configure]!(config.jsValue()) + } + + public func encode(frame: VideoFrame, options: VideoEncoderEncodeOptions? = nil) { + _ = jsObject[Strings.encode]!(frame.jsValue(), options?.jsValue() ?? .undefined) + } + + public func flush() -> JSPromise { + jsObject[Strings.flush]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func flush() async throws { + let _promise: JSPromise = jsObject[Strings.flush]!().fromJSValue()! + _ = try await _promise.get() + } + + public func reset() { + _ = jsObject[Strings.reset]!() + } + + public func close() { + _ = jsObject[Strings.close]!() + } + + public static func isConfigSupported(config: VideoEncoderConfig) -> JSPromise { + constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func isConfigSupported(config: VideoEncoderConfig) async throws -> VideoEncoderSupport { + let _promise: JSPromise = constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift b/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift new file mode 100644 index 00000000..794148f9 --- /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..8620f890 --- /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..d79ef2a3 --- /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() + ClosureAttribute.Required2[Strings.output, in: object] = output + ClosureAttribute.Required1[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute.Required2(jsObject: object, name: Strings.output) + _error = ClosureAttribute.Required1(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute.Required2 + public var output: EncodedVideoChunkOutputCallback + + @ClosureAttribute.Required1 + public var error: WebCodecsErrorCallback +} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift b/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift new file mode 100644 index 00000000..b5dcf628 --- /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/VideoFacingModeEnum.swift b/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift new file mode 100644 index 00000000..fa5a1c01 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum VideoFacingModeEnum: JSString, JSValueCompatible { + case user = "user" + case environment = "environment" + case left = "left" + case right = "right" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/VideoFrame.swift b/Sources/DOMKit/WebIDL/VideoFrame.swift new file mode 100644 index 00000000..6f32b12a --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoFrame.swift @@ -0,0 +1,84 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoFrame: JSBridgedClass { + 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 + } + + public convenience init(image: CanvasImageSource, init: VideoFrameInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(image.jsValue(), `init`?.jsValue() ?? .undefined)) + } + + public convenience init(data: BufferSource, init: VideoFrameBufferInit) { + self.init(unsafelyWrapping: Self.constructor.new(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 + + public func allocationSize(options: VideoFrameCopyToOptions? = nil) -> UInt32 { + jsObject[Strings.allocationSize]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) -> JSPromise { + jsObject[Strings.copyTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) async throws -> [PlaneLayout] { + let _promise: JSPromise = jsObject[Strings.copyTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func clone() -> Self { + jsObject[Strings.clone]!().fromJSValue()! + } + + public func close() { + _ = jsObject[Strings.close]!() + } +} diff --git a/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift b/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift new file mode 100644 index 00000000..b0f356fc --- /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..1652e6bf --- /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..e6846570 --- /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/VideoFrameMetadata.swift b/Sources/DOMKit/WebIDL/VideoFrameMetadata.swift new file mode 100644 index 00000000..8f7ea359 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoFrameMetadata.swift @@ -0,0 +1,65 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoFrameMetadata: BridgedDictionary { + public convenience init(presentationTime: DOMHighResTimeStamp, expectedDisplayTime: DOMHighResTimeStamp, width: UInt32, height: UInt32, mediaTime: Double, presentedFrames: UInt32, processingDuration: Double, captureTime: DOMHighResTimeStamp, receiveTime: DOMHighResTimeStamp, rtpTimestamp: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.presentationTime] = presentationTime.jsValue() + object[Strings.expectedDisplayTime] = expectedDisplayTime.jsValue() + object[Strings.width] = width.jsValue() + object[Strings.height] = height.jsValue() + object[Strings.mediaTime] = mediaTime.jsValue() + object[Strings.presentedFrames] = presentedFrames.jsValue() + object[Strings.processingDuration] = processingDuration.jsValue() + object[Strings.captureTime] = captureTime.jsValue() + object[Strings.receiveTime] = receiveTime.jsValue() + object[Strings.rtpTimestamp] = rtpTimestamp.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _presentationTime = ReadWriteAttribute(jsObject: object, name: Strings.presentationTime) + _expectedDisplayTime = ReadWriteAttribute(jsObject: object, name: Strings.expectedDisplayTime) + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _mediaTime = ReadWriteAttribute(jsObject: object, name: Strings.mediaTime) + _presentedFrames = ReadWriteAttribute(jsObject: object, name: Strings.presentedFrames) + _processingDuration = ReadWriteAttribute(jsObject: object, name: Strings.processingDuration) + _captureTime = ReadWriteAttribute(jsObject: object, name: Strings.captureTime) + _receiveTime = ReadWriteAttribute(jsObject: object, name: Strings.receiveTime) + _rtpTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.rtpTimestamp) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var presentationTime: DOMHighResTimeStamp + + @ReadWriteAttribute + public var expectedDisplayTime: DOMHighResTimeStamp + + @ReadWriteAttribute + public var width: UInt32 + + @ReadWriteAttribute + public var height: UInt32 + + @ReadWriteAttribute + public var mediaTime: Double + + @ReadWriteAttribute + public var presentedFrames: UInt32 + + @ReadWriteAttribute + public var processingDuration: Double + + @ReadWriteAttribute + public var captureTime: DOMHighResTimeStamp + + @ReadWriteAttribute + public var receiveTime: DOMHighResTimeStamp + + @ReadWriteAttribute + public var rtpTimestamp: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift b/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift new file mode 100644 index 00000000..c0511c7c --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/VideoPixelFormat.swift b/Sources/DOMKit/WebIDL/VideoPixelFormat.swift new file mode 100644 index 00000000..16bd76e5 --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift b/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift new file mode 100644 index 00000000..53fc1ef7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoPlaybackQuality: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.VideoPlaybackQuality].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _creationTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.creationTime) + _droppedVideoFrames = ReadonlyAttribute(jsObject: jsObject, name: Strings.droppedVideoFrames) + _totalVideoFrames = ReadonlyAttribute(jsObject: jsObject, name: Strings.totalVideoFrames) + _corruptedVideoFrames = ReadonlyAttribute(jsObject: jsObject, name: Strings.corruptedVideoFrames) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var creationTime: DOMHighResTimeStamp + + @ReadonlyAttribute + public var droppedVideoFrames: UInt32 + + @ReadonlyAttribute + public var totalVideoFrames: UInt32 + + @ReadonlyAttribute + public var corruptedVideoFrames: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift b/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift new file mode 100644 index 00000000..1757b1bc --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum VideoResizeModeEnum: JSString, JSValueCompatible { + case none = "none" + case cropAndScale = "crop-and-scale" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/VideoTrack.swift b/Sources/DOMKit/WebIDL/VideoTrack.swift index 2bd49efd..dc42e3bd 100644 --- a/Sources/DOMKit/WebIDL/VideoTrack.swift +++ b/Sources/DOMKit/WebIDL/VideoTrack.swift @@ -4,11 +4,12 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoTrack: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.VideoTrack.function! } + public class var constructor: JSFunction { JSObject.global[Strings.VideoTrack].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) @@ -17,6 +18,9 @@ public class VideoTrack: JSBridgedClass { self.jsObject = jsObject } + @ReadonlyAttribute + public var sourceBuffer: SourceBuffer? + @ReadonlyAttribute public var id: String diff --git a/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift b/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift new file mode 100644 index 00000000..a72f302a --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoTrackGenerator: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackGenerator].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _writable = ReadonlyAttribute(jsObject: jsObject, name: Strings.writable) + _muted = ReadWriteAttribute(jsObject: jsObject, name: Strings.muted) + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + @ReadonlyAttribute + public var writable: WritableStream + + @ReadWriteAttribute + public var muted: Bool + + @ReadonlyAttribute + public var track: MediaStreamTrack +} diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift index 763a574b..0d3ba7e6 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackList.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoTrackList: EventTarget { - override public class var constructor: JSFunction { JSObject.global.VideoTrackList.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) diff --git a/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift b/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift new file mode 100644 index 00000000..6c392b0b --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/VirtualKeyboard.swift b/Sources/DOMKit/WebIDL/VirtualKeyboard.swift new file mode 100644 index 00000000..77d8356e --- /dev/null +++ b/Sources/DOMKit/WebIDL/VirtualKeyboard.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VirtualKeyboard: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.VirtualKeyboard].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _boundingRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingRect) + _overlaysContent = ReadWriteAttribute(jsObject: jsObject, name: Strings.overlaysContent) + _ongeometrychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ongeometrychange) + super.init(unsafelyWrapping: jsObject) + } + + public func show() { + _ = jsObject[Strings.show]!() + } + + public func hide() { + _ = jsObject[Strings.hide]!() + } + + @ReadonlyAttribute + public var boundingRect: DOMRect + + @ReadWriteAttribute + public var overlaysContent: Bool + + @ClosureAttribute.Optional1 + public var ongeometrychange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/VisualViewport.swift b/Sources/DOMKit/WebIDL/VisualViewport.swift new file mode 100644 index 00000000..e1bbd111 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VisualViewport.swift @@ -0,0 +1,52 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VisualViewport: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.VisualViewport].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _offsetLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetLeft) + _offsetTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetTop) + _pageLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageLeft) + _pageTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageTop) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _scale = ReadonlyAttribute(jsObject: jsObject, name: Strings.scale) + _segments = ReadonlyAttribute(jsObject: jsObject, name: Strings.segments) + _onresize = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresize) + _onscroll = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onscroll) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var offsetLeft: Double + + @ReadonlyAttribute + public var offsetTop: Double + + @ReadonlyAttribute + public var pageLeft: Double + + @ReadonlyAttribute + public var pageTop: Double + + @ReadonlyAttribute + public var width: Double + + @ReadonlyAttribute + public var height: Double + + @ReadonlyAttribute + public var scale: Double + + @ReadonlyAttribute + public var segments: [DOMRect]? + + @ClosureAttribute.Optional1 + public var onresize: EventHandler + + @ClosureAttribute.Optional1 + public var onscroll: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift b/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift new file mode 100644 index 00000000..1b2f348f --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_blend_equation_advanced_coherent: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_blend_equation_advanced_coherent].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let MULTIPLY: GLenum = 0x9294 + + public static let SCREEN: GLenum = 0x9295 + + public static let OVERLAY: GLenum = 0x9296 + + public static let DARKEN: GLenum = 0x9297 + + public static let LIGHTEN: GLenum = 0x9298 + + public static let COLORDODGE: GLenum = 0x9299 + + public static let COLORBURN: GLenum = 0x929A + + public static let HARDLIGHT: GLenum = 0x929B + + public static let SOFTLIGHT: GLenum = 0x929C + + public static let DIFFERENCE: GLenum = 0x929E + + public static let EXCLUSION: GLenum = 0x92A0 + + public static let HSL_HUE: GLenum = 0x92AD + + public static let HSL_SATURATION: GLenum = 0x92AE + + public static let HSL_COLOR: GLenum = 0x92AF + + public static let HSL_LUMINOSITY: GLenum = 0x92B0 +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift b/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift new file mode 100644 index 00000000..b2b6dc76 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_color_buffer_float: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_color_buffer_float].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let RGBA32F_EXT: GLenum = 0x8814 + + public static let FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum = 0x8211 + + public static let UNSIGNED_NORMALIZED_EXT: GLenum = 0x8C17 +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift new file mode 100644 index 00000000..5034ca2e --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift @@ -0,0 +1,74 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_compressed_texture_astc: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_astc].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum = 0x93B0 + + public static let COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum = 0x93B1 + + public static let COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum = 0x93B2 + + public static let COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum = 0x93B3 + + public static let COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum = 0x93B4 + + public static let COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum = 0x93B5 + + public static let COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum = 0x93B6 + + public static let COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum = 0x93B7 + + public static let COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum = 0x93B8 + + public static let COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum = 0x93B9 + + public static let COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum = 0x93BA + + public static let COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum = 0x93BB + + public static let COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum = 0x93BC + + public static let COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum = 0x93BD + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum = 0x93D0 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum = 0x93D1 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum = 0x93D2 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum = 0x93D3 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum = 0x93D4 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum = 0x93D5 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum = 0x93D6 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum = 0x93D7 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum = 0x93D8 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum = 0x93D9 + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum = 0x93DA + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum = 0x93DB + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum = 0x93DC + + public static let COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum = 0x93DD + + public func getSupportedProfiles() -> [String] { + jsObject[Strings.getSupportedProfiles]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift new file mode 100644 index 00000000..669b4350 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_compressed_texture_etc: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_etc].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COMPRESSED_R11_EAC: GLenum = 0x9270 + + public static let COMPRESSED_SIGNED_R11_EAC: GLenum = 0x9271 + + public static let COMPRESSED_RG11_EAC: GLenum = 0x9272 + + public static let COMPRESSED_SIGNED_RG11_EAC: GLenum = 0x9273 + + public static let COMPRESSED_RGB8_ETC2: GLenum = 0x9274 + + public static let COMPRESSED_SRGB8_ETC2: GLenum = 0x9275 + + public static let COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum = 0x9276 + + public static let COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum = 0x9277 + + public static let COMPRESSED_RGBA8_ETC2_EAC: GLenum = 0x9278 + + public static let COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: GLenum = 0x9279 +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift new file mode 100644 index 00000000..1607ad4c --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_compressed_texture_etc1: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_etc1].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COMPRESSED_RGB_ETC1_WEBGL: GLenum = 0x8D64 +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift new file mode 100644 index 00000000..047006f7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_compressed_texture_pvrtc: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_pvrtc].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COMPRESSED_RGB_PVRTC_4BPPV1_IMG: GLenum = 0x8C00 + + public static let COMPRESSED_RGB_PVRTC_2BPPV1_IMG: GLenum = 0x8C01 + + public static let COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: GLenum = 0x8C02 + + public static let COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: GLenum = 0x8C03 +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift new file mode 100644 index 00000000..5cd5ea9d --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_compressed_texture_s3tc: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_s3tc].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum = 0x83F0 + + public static let COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum = 0x83F1 + + public static let COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum = 0x83F2 + + public static let COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum = 0x83F3 +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift new file mode 100644 index 00000000..3db3753c --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_compressed_texture_s3tc_srgb: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_s3tc_srgb].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum = 0x8C4C + + public static let COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum = 0x8C4D + + public static let COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum = 0x8C4E + + public static let COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum = 0x8C4F +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift b/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift new file mode 100644 index 00000000..9430453b --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_debug_renderer_info: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_debug_renderer_info].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let UNMASKED_VENDOR_WEBGL: GLenum = 0x9245 + + public static let UNMASKED_RENDERER_WEBGL: GLenum = 0x9246 +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift b/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift new file mode 100644 index 00000000..e2859f5b --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_debug_shaders: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_debug_shaders].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func getTranslatedShaderSource(shader: WebGLShader) -> String { + jsObject[Strings.getTranslatedShaderSource]!(shader.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift b/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift new file mode 100644 index 00000000..a830b9e0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_depth_texture: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_depth_texture].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let UNSIGNED_INT_24_8_WEBGL: GLenum = 0x84FA +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift new file mode 100644 index 00000000..08547d58 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift @@ -0,0 +1,86 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_draw_buffers: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_draw_buffers].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static let COLOR_ATTACHMENT0_WEBGL: GLenum = 0x8CE0 + + public static let COLOR_ATTACHMENT1_WEBGL: GLenum = 0x8CE1 + + public static let COLOR_ATTACHMENT2_WEBGL: GLenum = 0x8CE2 + + public static let COLOR_ATTACHMENT3_WEBGL: GLenum = 0x8CE3 + + public static let COLOR_ATTACHMENT4_WEBGL: GLenum = 0x8CE4 + + public static let COLOR_ATTACHMENT5_WEBGL: GLenum = 0x8CE5 + + public static let COLOR_ATTACHMENT6_WEBGL: GLenum = 0x8CE6 + + public static let COLOR_ATTACHMENT7_WEBGL: GLenum = 0x8CE7 + + public static let COLOR_ATTACHMENT8_WEBGL: GLenum = 0x8CE8 + + public static let COLOR_ATTACHMENT9_WEBGL: GLenum = 0x8CE9 + + public static let COLOR_ATTACHMENT10_WEBGL: GLenum = 0x8CEA + + public static let COLOR_ATTACHMENT11_WEBGL: GLenum = 0x8CEB + + public static let COLOR_ATTACHMENT12_WEBGL: GLenum = 0x8CEC + + public static let COLOR_ATTACHMENT13_WEBGL: GLenum = 0x8CED + + public static let COLOR_ATTACHMENT14_WEBGL: GLenum = 0x8CEE + + public static let COLOR_ATTACHMENT15_WEBGL: GLenum = 0x8CEF + + public static let DRAW_BUFFER0_WEBGL: GLenum = 0x8825 + + public static let DRAW_BUFFER1_WEBGL: GLenum = 0x8826 + + public static let DRAW_BUFFER2_WEBGL: GLenum = 0x8827 + + public static let DRAW_BUFFER3_WEBGL: GLenum = 0x8828 + + public static let DRAW_BUFFER4_WEBGL: GLenum = 0x8829 + + public static let DRAW_BUFFER5_WEBGL: GLenum = 0x882A + + public static let DRAW_BUFFER6_WEBGL: GLenum = 0x882B + + public static let DRAW_BUFFER7_WEBGL: GLenum = 0x882C + + public static let DRAW_BUFFER8_WEBGL: GLenum = 0x882D + + public static let DRAW_BUFFER9_WEBGL: GLenum = 0x882E + + public static let DRAW_BUFFER10_WEBGL: GLenum = 0x882F + + public static let DRAW_BUFFER11_WEBGL: GLenum = 0x8830 + + public static let DRAW_BUFFER12_WEBGL: GLenum = 0x8831 + + public static let DRAW_BUFFER13_WEBGL: GLenum = 0x8832 + + public static let DRAW_BUFFER14_WEBGL: GLenum = 0x8833 + + public static let DRAW_BUFFER15_WEBGL: GLenum = 0x8834 + + public static let MAX_COLOR_ATTACHMENTS_WEBGL: GLenum = 0x8CDF + + public static let MAX_DRAW_BUFFERS_WEBGL: GLenum = 0x8824 + + public func drawBuffersWEBGL(buffers: [GLenum]) { + _ = jsObject[Strings.drawBuffersWEBGL]!(buffers.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift new file mode 100644 index 00000000..dc79938a --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift @@ -0,0 +1,29 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_draw_instanced_base_vertex_base_instance: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_draw_instanced_base_vertex_base_instance].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func drawArraysInstancedBaseInstanceWEBGL(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei, baseInstance: GLuint) { + _ = jsObject[Strings.drawArraysInstancedBaseInstanceWEBGL]!(mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue(), baseInstance.jsValue()) + } + + public func drawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei, baseVertex: GLint, baseInstance: GLuint) { + let _arg0 = mode.jsValue() + let _arg1 = count.jsValue() + let _arg2 = type.jsValue() + let _arg3 = offset.jsValue() + let _arg4 = instanceCount.jsValue() + let _arg5 = baseVertex.jsValue() + let _arg6 = baseInstance.jsValue() + _ = jsObject[Strings.drawElementsInstancedBaseVertexBaseInstanceWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + } +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift b/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift new file mode 100644 index 00000000..2e821ede --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_lose_context: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_lose_context].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func loseContext() { + _ = jsObject[Strings.loseContext]!() + } + + public func restoreContext() { + _ = jsObject[Strings.restoreContext]!() + } +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift new file mode 100644 index 00000000..b59829d4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_multi_draw: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_multi_draw].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func multiDrawArraysWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, drawcount: GLsizei) { + let _arg0 = mode.jsValue() + let _arg1 = firstsList.jsValue() + let _arg2 = firstsOffset.jsValue() + let _arg3 = countsList.jsValue() + let _arg4 = countsOffset.jsValue() + let _arg5 = drawcount.jsValue() + _ = jsObject[Strings.multiDrawArraysWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + public func multiDrawElementsWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, drawcount: GLsizei) { + let _arg0 = mode.jsValue() + let _arg1 = countsList.jsValue() + let _arg2 = countsOffset.jsValue() + let _arg3 = type.jsValue() + let _arg4 = offsetsList.jsValue() + let _arg5 = offsetsOffset.jsValue() + let _arg6 = drawcount.jsValue() + _ = jsObject[Strings.multiDrawElementsWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + } + + public func multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { + let _arg0 = mode.jsValue() + let _arg1 = firstsList.jsValue() + let _arg2 = firstsOffset.jsValue() + let _arg3 = countsList.jsValue() + let _arg4 = countsOffset.jsValue() + let _arg5 = instanceCountsList.jsValue() + let _arg6 = instanceCountsOffset.jsValue() + let _arg7 = drawcount.jsValue() + _ = jsObject[Strings.multiDrawArraysInstancedWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + } + + public func multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { + let _arg0 = mode.jsValue() + let _arg1 = countsList.jsValue() + let _arg2 = countsOffset.jsValue() + let _arg3 = type.jsValue() + let _arg4 = offsetsList.jsValue() + let _arg5 = offsetsOffset.jsValue() + let _arg6 = instanceCountsList.jsValue() + let _arg7 = instanceCountsOffset.jsValue() + let _arg8 = drawcount.jsValue() + _ = jsObject[Strings.multiDrawElementsInstancedWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift new file mode 100644 index 00000000..36b1b5b2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_multi_draw_instanced_base_vertex_base_instance].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func multiDrawArraysInstancedBaseInstanceWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, baseInstancesList: __UNSUPPORTED_UNION__, baseInstancesOffset: GLuint, drawCount: GLsizei) { + let _arg0 = mode.jsValue() + let _arg1 = firstsList.jsValue() + let _arg2 = firstsOffset.jsValue() + let _arg3 = countsList.jsValue() + let _arg4 = countsOffset.jsValue() + let _arg5 = instanceCountsList.jsValue() + let _arg6 = instanceCountsOffset.jsValue() + let _arg7 = baseInstancesList.jsValue() + let _arg8 = baseInstancesOffset.jsValue() + let _arg9 = drawCount.jsValue() + _ = jsObject[Strings.multiDrawArraysInstancedBaseInstanceWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + } + + public func multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, baseVerticesList: __UNSUPPORTED_UNION__, baseVerticesOffset: GLuint, baseInstancesList: __UNSUPPORTED_UNION__, baseInstancesOffset: GLuint, drawCount: GLsizei) { + let _arg0 = mode.jsValue() + let _arg1 = countsList.jsValue() + let _arg2 = countsOffset.jsValue() + let _arg3 = type.jsValue() + let _arg4 = offsetsList.jsValue() + let _arg5 = offsetsOffset.jsValue() + let _arg6 = instanceCountsList.jsValue() + let _arg7 = instanceCountsOffset.jsValue() + let _arg8 = baseVerticesList.jsValue() + let _arg9 = baseVerticesOffset.jsValue() + let _arg10 = baseInstancesList.jsValue() + let _arg11 = baseInstancesOffset.jsValue() + let _arg12 = drawCount.jsValue() + _ = jsObject[Strings.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12) + } +} diff --git a/Sources/DOMKit/WebIDL/WakeLock.swift b/Sources/DOMKit/WebIDL/WakeLock.swift new file mode 100644 index 00000000..2307513f --- /dev/null +++ b/Sources/DOMKit/WebIDL/WakeLock.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WakeLock: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WakeLock].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func request(type: WakeLockType? = nil) -> JSPromise { + jsObject[Strings.request]!(type?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func request(type: WakeLockType? = nil) async throws -> WakeLockSentinel { + let _promise: JSPromise = jsObject[Strings.request]!(type?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift new file mode 100644 index 00000000..aaeb54d4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WakeLockSentinel: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.WakeLockSentinel].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _released = ReadonlyAttribute(jsObject: jsObject, name: Strings.released) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _onrelease = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrelease) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var released: Bool + + @ReadonlyAttribute + public var type: WakeLockType + + public func release() -> JSPromise { + jsObject[Strings.release]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func release() async throws { + let _promise: JSPromise = jsObject[Strings.release]!().fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var onrelease: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/WakeLockType.swift b/Sources/DOMKit/WebIDL/WakeLockType.swift new file mode 100644 index 00000000..5b78d2f1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WakeLockType.swift @@ -0,0 +1,21 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum WakeLockType: JSString, JSValueCompatible { + case screen = "screen" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift b/Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift new file mode 100644 index 00000000..7e09651f --- /dev/null +++ b/Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WatchAdvertisementsOptions: BridgedDictionary { + public convenience init(signal: AbortSignal) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.signal] = signal.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var signal: AbortSignal +} diff --git a/Sources/DOMKit/WebIDL/WaveShaperNode.swift b/Sources/DOMKit/WebIDL/WaveShaperNode.swift new file mode 100644 index 00000000..721740ee --- /dev/null +++ b/Sources/DOMKit/WebIDL/WaveShaperNode.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WaveShaperNode: AudioNode { + override public class var constructor: JSFunction { JSObject.global[Strings.WaveShaperNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _curve = ReadWriteAttribute(jsObject: jsObject, name: Strings.curve) + _oversample = ReadWriteAttribute(jsObject: jsObject, name: Strings.oversample) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(context: BaseAudioContext, options: WaveShaperOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + } + + @ReadWriteAttribute + public var curve: Float32Array? + + @ReadWriteAttribute + public var oversample: OverSampleType +} diff --git a/Sources/DOMKit/WebIDL/WaveShaperOptions.swift b/Sources/DOMKit/WebIDL/WaveShaperOptions.swift new file mode 100644 index 00000000..8c37f26b --- /dev/null +++ b/Sources/DOMKit/WebIDL/WaveShaperOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WaveShaperOptions: BridgedDictionary { + public convenience init(curve: [Float], oversample: OverSampleType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.curve] = curve.jsValue() + object[Strings.oversample] = oversample.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _curve = ReadWriteAttribute(jsObject: object, name: Strings.curve) + _oversample = ReadWriteAttribute(jsObject: object, name: Strings.oversample) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var curve: [Float] + + @ReadWriteAttribute + public var oversample: OverSampleType +} diff --git a/Sources/DOMKit/WebIDL/WebAssembly.swift b/Sources/DOMKit/WebIDL/WebAssembly.swift new file mode 100644 index 00000000..50a5ed04 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebAssembly.swift @@ -0,0 +1,64 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum WebAssembly { + public static var jsObject: JSObject { + JSObject.global.[Strings.WebAssembly].object! + } + + public static func compileStreaming(source: JSPromise) -> JSPromise { + JSObject.global.[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func compileStreaming(source: JSPromise) async throws -> Module { + let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) -> JSPromise { + JSObject.global.[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { + let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public static func validate(bytes: BufferSource) -> Bool { + JSObject.global.[Strings.WebAssembly].object![Strings.validate]!(bytes.jsValue()).fromJSValue()! + } + + public static func compile(bytes: BufferSource) -> JSPromise { + JSObject.global.[Strings.WebAssembly].object![Strings.compile]!(bytes.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func compile(bytes: BufferSource) async throws -> Module { + let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.compile]!(bytes.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) -> JSPromise { + JSObject.global.[Strings.WebAssembly].object![Strings.instantiate]!(bytes.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { + let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.instantiate]!(bytes.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) -> JSPromise { + JSObject.global.[Strings.WebAssembly].object![Strings.instantiate]!(moduleObject.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) async throws -> Instance { + let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.instantiate]!(moduleObject.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift b/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift new file mode 100644 index 00000000..0b546ffa --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebAssemblyInstantiatedSource: BridgedDictionary { + public convenience init(module: Module, instance: Instance) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.module] = module.jsValue() + object[Strings.instance] = instance.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _module = ReadWriteAttribute(jsObject: object, name: Strings.module) + _instance = ReadWriteAttribute(jsObject: object, name: Strings.instance) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var module: Module + + @ReadWriteAttribute + public var instance: Instance +} diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift new file mode 100644 index 00000000..91b1aa97 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGL2RenderingContext: JSBridgedClass, WebGLRenderingContextBase, WebGL2RenderingContextBase, WebGL2RenderingContextOverloads { + public class var constructor: JSFunction { JSObject.global[Strings.WebGL2RenderingContext].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift new file mode 100644 index 00000000..961338b5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift @@ -0,0 +1,1067 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol WebGL2RenderingContextBase: JSBridgedClass {} +public extension WebGL2RenderingContextBase { + static let READ_BUFFER: GLenum = 0x0C02 + + static let UNPACK_ROW_LENGTH: GLenum = 0x0CF2 + + static let UNPACK_SKIP_ROWS: GLenum = 0x0CF3 + + static let UNPACK_SKIP_PIXELS: GLenum = 0x0CF4 + + static let PACK_ROW_LENGTH: GLenum = 0x0D02 + + static let PACK_SKIP_ROWS: GLenum = 0x0D03 + + static let PACK_SKIP_PIXELS: GLenum = 0x0D04 + + static let COLOR: GLenum = 0x1800 + + static let DEPTH: GLenum = 0x1801 + + static let STENCIL: GLenum = 0x1802 + + static let RED: GLenum = 0x1903 + + static let RGB8: GLenum = 0x8051 + + static let RGBA8: GLenum = 0x8058 + + static let RGB10_A2: GLenum = 0x8059 + + static let TEXTURE_BINDING_3D: GLenum = 0x806A + + static let UNPACK_SKIP_IMAGES: GLenum = 0x806D + + static let UNPACK_IMAGE_HEIGHT: GLenum = 0x806E + + static let TEXTURE_3D: GLenum = 0x806F + + static let TEXTURE_WRAP_R: GLenum = 0x8072 + + static let MAX_3D_TEXTURE_SIZE: GLenum = 0x8073 + + static let UNSIGNED_INT_2_10_10_10_REV: GLenum = 0x8368 + + static let MAX_ELEMENTS_VERTICES: GLenum = 0x80E8 + + static let MAX_ELEMENTS_INDICES: GLenum = 0x80E9 + + static let TEXTURE_MIN_LOD: GLenum = 0x813A + + static let TEXTURE_MAX_LOD: GLenum = 0x813B + + static let TEXTURE_BASE_LEVEL: GLenum = 0x813C + + static let TEXTURE_MAX_LEVEL: GLenum = 0x813D + + static let MIN: GLenum = 0x8007 + + static let MAX: GLenum = 0x8008 + + static let DEPTH_COMPONENT24: GLenum = 0x81A6 + + static let MAX_TEXTURE_LOD_BIAS: GLenum = 0x84FD + + static let TEXTURE_COMPARE_MODE: GLenum = 0x884C + + static let TEXTURE_COMPARE_FUNC: GLenum = 0x884D + + static let CURRENT_QUERY: GLenum = 0x8865 + + static let QUERY_RESULT: GLenum = 0x8866 + + static let QUERY_RESULT_AVAILABLE: GLenum = 0x8867 + + static let STREAM_READ: GLenum = 0x88E1 + + static let STREAM_COPY: GLenum = 0x88E2 + + static let STATIC_READ: GLenum = 0x88E5 + + static let STATIC_COPY: GLenum = 0x88E6 + + static let DYNAMIC_READ: GLenum = 0x88E9 + + static let DYNAMIC_COPY: GLenum = 0x88EA + + static let MAX_DRAW_BUFFERS: GLenum = 0x8824 + + static let DRAW_BUFFER0: GLenum = 0x8825 + + static let DRAW_BUFFER1: GLenum = 0x8826 + + static let DRAW_BUFFER2: GLenum = 0x8827 + + static let DRAW_BUFFER3: GLenum = 0x8828 + + static let DRAW_BUFFER4: GLenum = 0x8829 + + static let DRAW_BUFFER5: GLenum = 0x882A + + static let DRAW_BUFFER6: GLenum = 0x882B + + static let DRAW_BUFFER7: GLenum = 0x882C + + static let DRAW_BUFFER8: GLenum = 0x882D + + static let DRAW_BUFFER9: GLenum = 0x882E + + static let DRAW_BUFFER10: GLenum = 0x882F + + static let DRAW_BUFFER11: GLenum = 0x8830 + + static let DRAW_BUFFER12: GLenum = 0x8831 + + static let DRAW_BUFFER13: GLenum = 0x8832 + + static let DRAW_BUFFER14: GLenum = 0x8833 + + static let DRAW_BUFFER15: GLenum = 0x8834 + + static let MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum = 0x8B49 + + static let MAX_VERTEX_UNIFORM_COMPONENTS: GLenum = 0x8B4A + + static let SAMPLER_3D: GLenum = 0x8B5F + + static let SAMPLER_2D_SHADOW: GLenum = 0x8B62 + + static let FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum = 0x8B8B + + static let PIXEL_PACK_BUFFER: GLenum = 0x88EB + + static let PIXEL_UNPACK_BUFFER: GLenum = 0x88EC + + static let PIXEL_PACK_BUFFER_BINDING: GLenum = 0x88ED + + static let PIXEL_UNPACK_BUFFER_BINDING: GLenum = 0x88EF + + static let FLOAT_MAT2x3: GLenum = 0x8B65 + + static let FLOAT_MAT2x4: GLenum = 0x8B66 + + static let FLOAT_MAT3x2: GLenum = 0x8B67 + + static let FLOAT_MAT3x4: GLenum = 0x8B68 + + static let FLOAT_MAT4x2: GLenum = 0x8B69 + + static let FLOAT_MAT4x3: GLenum = 0x8B6A + + static let SRGB: GLenum = 0x8C40 + + static let SRGB8: GLenum = 0x8C41 + + static let SRGB8_ALPHA8: GLenum = 0x8C43 + + static let COMPARE_REF_TO_TEXTURE: GLenum = 0x884E + + static let RGBA32F: GLenum = 0x8814 + + static let RGB32F: GLenum = 0x8815 + + static let RGBA16F: GLenum = 0x881A + + static let RGB16F: GLenum = 0x881B + + static let VERTEX_ATTRIB_ARRAY_INTEGER: GLenum = 0x88FD + + static let MAX_ARRAY_TEXTURE_LAYERS: GLenum = 0x88FF + + static let MIN_PROGRAM_TEXEL_OFFSET: GLenum = 0x8904 + + static let MAX_PROGRAM_TEXEL_OFFSET: GLenum = 0x8905 + + static let MAX_VARYING_COMPONENTS: GLenum = 0x8B4B + + static let TEXTURE_2D_ARRAY: GLenum = 0x8C1A + + static let TEXTURE_BINDING_2D_ARRAY: GLenum = 0x8C1D + + static let R11F_G11F_B10F: GLenum = 0x8C3A + + static let UNSIGNED_INT_10F_11F_11F_REV: GLenum = 0x8C3B + + static let RGB9_E5: GLenum = 0x8C3D + + static let UNSIGNED_INT_5_9_9_9_REV: GLenum = 0x8C3E + + static let TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum = 0x8C7F + + static let MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum = 0x8C80 + + static let TRANSFORM_FEEDBACK_VARYINGS: GLenum = 0x8C83 + + static let TRANSFORM_FEEDBACK_BUFFER_START: GLenum = 0x8C84 + + static let TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum = 0x8C85 + + static let TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum = 0x8C88 + + static let RASTERIZER_DISCARD: GLenum = 0x8C89 + + static let MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum = 0x8C8A + + static let MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum = 0x8C8B + + static let INTERLEAVED_ATTRIBS: GLenum = 0x8C8C + + static let SEPARATE_ATTRIBS: GLenum = 0x8C8D + + static let TRANSFORM_FEEDBACK_BUFFER: GLenum = 0x8C8E + + static let TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum = 0x8C8F + + static let RGBA32UI: GLenum = 0x8D70 + + static let RGB32UI: GLenum = 0x8D71 + + static let RGBA16UI: GLenum = 0x8D76 + + static let RGB16UI: GLenum = 0x8D77 + + static let RGBA8UI: GLenum = 0x8D7C + + static let RGB8UI: GLenum = 0x8D7D + + static let RGBA32I: GLenum = 0x8D82 + + static let RGB32I: GLenum = 0x8D83 + + static let RGBA16I: GLenum = 0x8D88 + + static let RGB16I: GLenum = 0x8D89 + + static let RGBA8I: GLenum = 0x8D8E + + static let RGB8I: GLenum = 0x8D8F + + static let RED_INTEGER: GLenum = 0x8D94 + + static let RGB_INTEGER: GLenum = 0x8D98 + + static let RGBA_INTEGER: GLenum = 0x8D99 + + static let SAMPLER_2D_ARRAY: GLenum = 0x8DC1 + + static let SAMPLER_2D_ARRAY_SHADOW: GLenum = 0x8DC4 + + static let SAMPLER_CUBE_SHADOW: GLenum = 0x8DC5 + + static let UNSIGNED_INT_VEC2: GLenum = 0x8DC6 + + static let UNSIGNED_INT_VEC3: GLenum = 0x8DC7 + + static let UNSIGNED_INT_VEC4: GLenum = 0x8DC8 + + static let INT_SAMPLER_2D: GLenum = 0x8DCA + + static let INT_SAMPLER_3D: GLenum = 0x8DCB + + static let INT_SAMPLER_CUBE: GLenum = 0x8DCC + + static let INT_SAMPLER_2D_ARRAY: GLenum = 0x8DCF + + static let UNSIGNED_INT_SAMPLER_2D: GLenum = 0x8DD2 + + static let UNSIGNED_INT_SAMPLER_3D: GLenum = 0x8DD3 + + static let UNSIGNED_INT_SAMPLER_CUBE: GLenum = 0x8DD4 + + static let UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum = 0x8DD7 + + static let DEPTH_COMPONENT32F: GLenum = 0x8CAC + + static let DEPTH32F_STENCIL8: GLenum = 0x8CAD + + static let FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum = 0x8DAD + + static let FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum = 0x8210 + + static let FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum = 0x8211 + + static let FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum = 0x8212 + + static let FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum = 0x8213 + + static let FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum = 0x8214 + + static let FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum = 0x8215 + + static let FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum = 0x8216 + + static let FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum = 0x8217 + + static let FRAMEBUFFER_DEFAULT: GLenum = 0x8218 + + static let UNSIGNED_INT_24_8: GLenum = 0x84FA + + static let DEPTH24_STENCIL8: GLenum = 0x88F0 + + static let UNSIGNED_NORMALIZED: GLenum = 0x8C17 + + static let DRAW_FRAMEBUFFER_BINDING: GLenum = 0x8CA6 + + static let READ_FRAMEBUFFER: GLenum = 0x8CA8 + + static let DRAW_FRAMEBUFFER: GLenum = 0x8CA9 + + static let READ_FRAMEBUFFER_BINDING: GLenum = 0x8CAA + + static let RENDERBUFFER_SAMPLES: GLenum = 0x8CAB + + static let FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum = 0x8CD4 + + static let MAX_COLOR_ATTACHMENTS: GLenum = 0x8CDF + + static let COLOR_ATTACHMENT1: GLenum = 0x8CE1 + + static let COLOR_ATTACHMENT2: GLenum = 0x8CE2 + + static let COLOR_ATTACHMENT3: GLenum = 0x8CE3 + + static let COLOR_ATTACHMENT4: GLenum = 0x8CE4 + + static let COLOR_ATTACHMENT5: GLenum = 0x8CE5 + + static let COLOR_ATTACHMENT6: GLenum = 0x8CE6 + + static let COLOR_ATTACHMENT7: GLenum = 0x8CE7 + + static let COLOR_ATTACHMENT8: GLenum = 0x8CE8 + + static let COLOR_ATTACHMENT9: GLenum = 0x8CE9 + + static let COLOR_ATTACHMENT10: GLenum = 0x8CEA + + static let COLOR_ATTACHMENT11: GLenum = 0x8CEB + + static let COLOR_ATTACHMENT12: GLenum = 0x8CEC + + static let COLOR_ATTACHMENT13: GLenum = 0x8CED + + static let COLOR_ATTACHMENT14: GLenum = 0x8CEE + + static let COLOR_ATTACHMENT15: GLenum = 0x8CEF + + static let FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum = 0x8D56 + + static let MAX_SAMPLES: GLenum = 0x8D57 + + static let HALF_FLOAT: GLenum = 0x140B + + static let RG: GLenum = 0x8227 + + static let RG_INTEGER: GLenum = 0x8228 + + static let R8: GLenum = 0x8229 + + static let RG8: GLenum = 0x822B + + static let R16F: GLenum = 0x822D + + static let R32F: GLenum = 0x822E + + static let RG16F: GLenum = 0x822F + + static let RG32F: GLenum = 0x8230 + + static let R8I: GLenum = 0x8231 + + static let R8UI: GLenum = 0x8232 + + static let R16I: GLenum = 0x8233 + + static let R16UI: GLenum = 0x8234 + + static let R32I: GLenum = 0x8235 + + static let R32UI: GLenum = 0x8236 + + static let RG8I: GLenum = 0x8237 + + static let RG8UI: GLenum = 0x8238 + + static let RG16I: GLenum = 0x8239 + + static let RG16UI: GLenum = 0x823A + + static let RG32I: GLenum = 0x823B + + static let RG32UI: GLenum = 0x823C + + static let VERTEX_ARRAY_BINDING: GLenum = 0x85B5 + + static let R8_SNORM: GLenum = 0x8F94 + + static let RG8_SNORM: GLenum = 0x8F95 + + static let RGB8_SNORM: GLenum = 0x8F96 + + static let RGBA8_SNORM: GLenum = 0x8F97 + + static let SIGNED_NORMALIZED: GLenum = 0x8F9C + + static let COPY_READ_BUFFER: GLenum = 0x8F36 + + static let COPY_WRITE_BUFFER: GLenum = 0x8F37 + + static let COPY_READ_BUFFER_BINDING: GLenum = 0x8F36 + + static let COPY_WRITE_BUFFER_BINDING: GLenum = 0x8F37 + + static let UNIFORM_BUFFER: GLenum = 0x8A11 + + static let UNIFORM_BUFFER_BINDING: GLenum = 0x8A28 + + static let UNIFORM_BUFFER_START: GLenum = 0x8A29 + + static let UNIFORM_BUFFER_SIZE: GLenum = 0x8A2A + + static let MAX_VERTEX_UNIFORM_BLOCKS: GLenum = 0x8A2B + + static let MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum = 0x8A2D + + static let MAX_COMBINED_UNIFORM_BLOCKS: GLenum = 0x8A2E + + static let MAX_UNIFORM_BUFFER_BINDINGS: GLenum = 0x8A2F + + static let MAX_UNIFORM_BLOCK_SIZE: GLenum = 0x8A30 + + static let MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum = 0x8A31 + + static let MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum = 0x8A33 + + static let UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum = 0x8A34 + + static let ACTIVE_UNIFORM_BLOCKS: GLenum = 0x8A36 + + static let UNIFORM_TYPE: GLenum = 0x8A37 + + static let UNIFORM_SIZE: GLenum = 0x8A38 + + static let UNIFORM_BLOCK_INDEX: GLenum = 0x8A3A + + static let UNIFORM_OFFSET: GLenum = 0x8A3B + + static let UNIFORM_ARRAY_STRIDE: GLenum = 0x8A3C + + static let UNIFORM_MATRIX_STRIDE: GLenum = 0x8A3D + + static let UNIFORM_IS_ROW_MAJOR: GLenum = 0x8A3E + + static let UNIFORM_BLOCK_BINDING: GLenum = 0x8A3F + + static let UNIFORM_BLOCK_DATA_SIZE: GLenum = 0x8A40 + + static let UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum = 0x8A42 + + static let UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum = 0x8A43 + + static let UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum = 0x8A44 + + static let UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum = 0x8A46 + + static let INVALID_INDEX: GLenum = 0xFFFF_FFFF + + static let MAX_VERTEX_OUTPUT_COMPONENTS: GLenum = 0x9122 + + static let MAX_FRAGMENT_INPUT_COMPONENTS: GLenum = 0x9125 + + static let MAX_SERVER_WAIT_TIMEOUT: GLenum = 0x9111 + + static let OBJECT_TYPE: GLenum = 0x9112 + + static let SYNC_CONDITION: GLenum = 0x9113 + + static let SYNC_STATUS: GLenum = 0x9114 + + static let SYNC_FLAGS: GLenum = 0x9115 + + static let SYNC_FENCE: GLenum = 0x9116 + + static let SYNC_GPU_COMMANDS_COMPLETE: GLenum = 0x9117 + + static let UNSIGNALED: GLenum = 0x9118 + + static let SIGNALED: GLenum = 0x9119 + + static let ALREADY_SIGNALED: GLenum = 0x911A + + static let TIMEOUT_EXPIRED: GLenum = 0x911B + + static let CONDITION_SATISFIED: GLenum = 0x911C + + static let WAIT_FAILED: GLenum = 0x911D + + static let SYNC_FLUSH_COMMANDS_BIT: GLenum = 0x0000_0001 + + static let VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum = 0x88FE + + static let ANY_SAMPLES_PASSED: GLenum = 0x8C2F + + static let ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum = 0x8D6A + + static let SAMPLER_BINDING: GLenum = 0x8919 + + static let RGB10_A2UI: GLenum = 0x906F + + static let INT_2_10_10_10_REV: GLenum = 0x8D9F + + static let TRANSFORM_FEEDBACK: GLenum = 0x8E22 + + static let TRANSFORM_FEEDBACK_PAUSED: GLenum = 0x8E23 + + static let TRANSFORM_FEEDBACK_ACTIVE: GLenum = 0x8E24 + + static let TRANSFORM_FEEDBACK_BINDING: GLenum = 0x8E25 + + static let TEXTURE_IMMUTABLE_FORMAT: GLenum = 0x912F + + static let MAX_ELEMENT_INDEX: GLenum = 0x8D6B + + static let TEXTURE_IMMUTABLE_LEVELS: GLenum = 0x82DF + + static let TIMEOUT_IGNORED: GLint64 = -1 + + static let MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum = 0x9247 + + func copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) { + _ = jsObject[Strings.copyBufferSubData]!(readTarget.jsValue(), writeTarget.jsValue(), readOffset.jsValue(), writeOffset.jsValue(), size.jsValue()) + } + + func getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset: GLuint? = nil, length: GLuint? = nil) { + _ = jsObject[Strings.getBufferSubData]!(target.jsValue(), srcByteOffset.jsValue(), dstBuffer.jsValue(), dstOffset?.jsValue() ?? .undefined, length?.jsValue() ?? .undefined) + } + + func blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum) { + let _arg0 = srcX0.jsValue() + let _arg1 = srcY0.jsValue() + let _arg2 = srcX1.jsValue() + let _arg3 = srcY1.jsValue() + let _arg4 = dstX0.jsValue() + let _arg5 = dstY0.jsValue() + let _arg6 = dstX1.jsValue() + let _arg7 = dstY1.jsValue() + let _arg8 = mask.jsValue() + let _arg9 = filter.jsValue() + _ = jsObject[Strings.blitFramebuffer]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + } + + func framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, layer: GLint) { + _ = jsObject[Strings.framebufferTextureLayer]!(target.jsValue(), attachment.jsValue(), texture.jsValue(), level.jsValue(), layer.jsValue()) + } + + func invalidateFramebuffer(target: GLenum, attachments: [GLenum]) { + _ = jsObject[Strings.invalidateFramebuffer]!(target.jsValue(), attachments.jsValue()) + } + + func invalidateSubFramebuffer(target: GLenum, attachments: [GLenum], x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + let _arg0 = target.jsValue() + let _arg1 = attachments.jsValue() + let _arg2 = x.jsValue() + let _arg3 = y.jsValue() + let _arg4 = width.jsValue() + let _arg5 = height.jsValue() + _ = jsObject[Strings.invalidateSubFramebuffer]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + func readBuffer(src: GLenum) { + _ = jsObject[Strings.readBuffer]!(src.jsValue()) + } + + func getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum) -> JSValue { + jsObject[Strings.getInternalformatParameter]!(target.jsValue(), internalformat.jsValue(), pname.jsValue()).fromJSValue()! + } + + func renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { + _ = jsObject[Strings.renderbufferStorageMultisample]!(target.jsValue(), samples.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()) + } + + func texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { + _ = jsObject[Strings.texStorage2D]!(target.jsValue(), levels.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()) + } + + func texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) { + let _arg0 = target.jsValue() + let _arg1 = levels.jsValue() + let _arg2 = internalformat.jsValue() + let _arg3 = width.jsValue() + let _arg4 = height.jsValue() + let _arg5 = depth.jsValue() + _ = jsObject[Strings.texStorage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = internalformat.jsValue() + let _arg3 = width.jsValue() + let _arg4 = height.jsValue() + let _arg5 = depth.jsValue() + let _arg6 = border.jsValue() + let _arg7 = format.jsValue() + let _arg8 = type.jsValue() + let _arg9 = pboOffset.jsValue() + _ = jsObject[Strings.texImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + } + + func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = internalformat.jsValue() + let _arg3 = width.jsValue() + let _arg4 = height.jsValue() + let _arg5 = depth.jsValue() + let _arg6 = border.jsValue() + let _arg7 = format.jsValue() + let _arg8 = type.jsValue() + let _arg9 = source.jsValue() + _ = jsObject[Strings.texImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + } + + func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView?) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = internalformat.jsValue() + let _arg3 = width.jsValue() + let _arg4 = height.jsValue() + let _arg5 = depth.jsValue() + let _arg6 = border.jsValue() + let _arg7 = format.jsValue() + let _arg8 = type.jsValue() + let _arg9 = srcData.jsValue() + _ = jsObject[Strings.texImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + } + + func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = internalformat.jsValue() + let _arg3 = width.jsValue() + let _arg4 = height.jsValue() + let _arg5 = depth.jsValue() + let _arg6 = border.jsValue() + let _arg7 = format.jsValue() + let _arg8 = type.jsValue() + let _arg9 = srcData.jsValue() + let _arg10 = srcOffset.jsValue() + _ = jsObject[Strings.texImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10) + } + + func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = xoffset.jsValue() + let _arg3 = yoffset.jsValue() + let _arg4 = zoffset.jsValue() + let _arg5 = width.jsValue() + let _arg6 = height.jsValue() + let _arg7 = depth.jsValue() + let _arg8 = format.jsValue() + let _arg9 = type.jsValue() + let _arg10 = pboOffset.jsValue() + _ = jsObject[Strings.texSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10) + } + + func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = xoffset.jsValue() + let _arg3 = yoffset.jsValue() + let _arg4 = zoffset.jsValue() + let _arg5 = width.jsValue() + let _arg6 = height.jsValue() + let _arg7 = depth.jsValue() + let _arg8 = format.jsValue() + let _arg9 = type.jsValue() + let _arg10 = source.jsValue() + _ = jsObject[Strings.texSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10) + } + + func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView?, srcOffset: GLuint? = nil) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = xoffset.jsValue() + let _arg3 = yoffset.jsValue() + let _arg4 = zoffset.jsValue() + let _arg5 = width.jsValue() + let _arg6 = height.jsValue() + let _arg7 = depth.jsValue() + let _arg8 = format.jsValue() + let _arg9 = type.jsValue() + let _arg10 = srcData.jsValue() + let _arg11 = srcOffset?.jsValue() ?? .undefined + _ = jsObject[Strings.texSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11) + } + + func copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: 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 = zoffset.jsValue() + let _arg5 = x.jsValue() + let _arg6 = y.jsValue() + let _arg7 = width.jsValue() + let _arg8 = height.jsValue() + _ = jsObject[Strings.copyTexSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = internalformat.jsValue() + let _arg3 = width.jsValue() + let _arg4 = height.jsValue() + let _arg5 = depth.jsValue() + let _arg6 = border.jsValue() + let _arg7 = imageSize.jsValue() + let _arg8 = offset.jsValue() + _ = jsObject[Strings.compressedTexImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = internalformat.jsValue() + let _arg3 = width.jsValue() + let _arg4 = height.jsValue() + let _arg5 = depth.jsValue() + let _arg6 = border.jsValue() + let _arg7 = srcData.jsValue() + let _arg8 = srcOffset?.jsValue() ?? .undefined + let _arg9 = srcLengthOverride?.jsValue() ?? .undefined + _ = jsObject[Strings.compressedTexImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + } + + func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = xoffset.jsValue() + let _arg3 = yoffset.jsValue() + let _arg4 = zoffset.jsValue() + let _arg5 = width.jsValue() + let _arg6 = height.jsValue() + let _arg7 = depth.jsValue() + let _arg8 = format.jsValue() + let _arg9 = imageSize.jsValue() + let _arg10 = offset.jsValue() + _ = jsObject[Strings.compressedTexSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10) + } + + func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + let _arg0 = target.jsValue() + let _arg1 = level.jsValue() + let _arg2 = xoffset.jsValue() + let _arg3 = yoffset.jsValue() + let _arg4 = zoffset.jsValue() + let _arg5 = width.jsValue() + let _arg6 = height.jsValue() + let _arg7 = depth.jsValue() + let _arg8 = format.jsValue() + let _arg9 = srcData.jsValue() + let _arg10 = srcOffset?.jsValue() ?? .undefined + let _arg11 = srcLengthOverride?.jsValue() ?? .undefined + _ = jsObject[Strings.compressedTexSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11) + } + + func getFragDataLocation(program: WebGLProgram, name: String) -> GLint { + jsObject[Strings.getFragDataLocation]!(program.jsValue(), name.jsValue()).fromJSValue()! + } + + func uniform1ui(location: WebGLUniformLocation?, v0: GLuint) { + _ = jsObject[Strings.uniform1ui]!(location.jsValue(), v0.jsValue()) + } + + func uniform2ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint) { + _ = jsObject[Strings.uniform2ui]!(location.jsValue(), v0.jsValue(), v1.jsValue()) + } + + func uniform3ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint) { + _ = jsObject[Strings.uniform3ui]!(location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue()) + } + + func uniform4ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) { + _ = jsObject[Strings.uniform4ui]!(location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue(), v3.jsValue()) + } + + func uniform1uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform1uiv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform2uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform2uiv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform3uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform3uiv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform4uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform4uiv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniformMatrix3x2fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniformMatrix4x2fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniformMatrix2x3fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniformMatrix4x3fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniformMatrix2x4fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniformMatrix3x4fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) { + _ = jsObject[Strings.vertexAttribI4i]!(index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + } + + func vertexAttribI4iv(index: GLuint, values: Int32List) { + _ = jsObject[Strings.vertexAttribI4iv]!(index.jsValue(), values.jsValue()) + } + + func vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) { + _ = jsObject[Strings.vertexAttribI4ui]!(index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + } + + func vertexAttribI4uiv(index: GLuint, values: Uint32List) { + _ = jsObject[Strings.vertexAttribI4uiv]!(index.jsValue(), values.jsValue()) + } + + func vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr) { + _ = jsObject[Strings.vertexAttribIPointer]!(index.jsValue(), size.jsValue(), type.jsValue(), stride.jsValue(), offset.jsValue()) + } + + func vertexAttribDivisor(index: GLuint, divisor: GLuint) { + _ = jsObject[Strings.vertexAttribDivisor]!(index.jsValue(), divisor.jsValue()) + } + + func drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) { + _ = jsObject[Strings.drawArraysInstanced]!(mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue()) + } + + func drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) { + _ = jsObject[Strings.drawElementsInstanced]!(mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), instanceCount.jsValue()) + } + + func drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr) { + let _arg0 = mode.jsValue() + let _arg1 = start.jsValue() + let _arg2 = end.jsValue() + let _arg3 = count.jsValue() + let _arg4 = type.jsValue() + let _arg5 = offset.jsValue() + _ = jsObject[Strings.drawRangeElements]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + func drawBuffers(buffers: [GLenum]) { + _ = jsObject[Strings.drawBuffers]!(buffers.jsValue()) + } + + func clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset: GLuint? = nil) { + _ = jsObject[Strings.clearBufferfv]!(buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined) + } + + func clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset: GLuint? = nil) { + _ = jsObject[Strings.clearBufferiv]!(buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined) + } + + func clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset: GLuint? = nil) { + _ = jsObject[Strings.clearBufferuiv]!(buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined) + } + + func clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) { + _ = jsObject[Strings.clearBufferfi]!(buffer.jsValue(), drawbuffer.jsValue(), depth.jsValue(), stencil.jsValue()) + } + + func createQuery() -> WebGLQuery? { + jsObject[Strings.createQuery]!().fromJSValue()! + } + + func deleteQuery(query: WebGLQuery?) { + _ = jsObject[Strings.deleteQuery]!(query.jsValue()) + } + + func isQuery(query: WebGLQuery?) -> GLboolean { + jsObject[Strings.isQuery]!(query.jsValue()).fromJSValue()! + } + + func beginQuery(target: GLenum, query: WebGLQuery) { + _ = jsObject[Strings.beginQuery]!(target.jsValue(), query.jsValue()) + } + + func endQuery(target: GLenum) { + _ = jsObject[Strings.endQuery]!(target.jsValue()) + } + + func getQuery(target: GLenum, pname: GLenum) -> WebGLQuery? { + jsObject[Strings.getQuery]!(target.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getQueryParameter(query: WebGLQuery, pname: GLenum) -> JSValue { + jsObject[Strings.getQueryParameter]!(query.jsValue(), pname.jsValue()).fromJSValue()! + } + + func createSampler() -> WebGLSampler? { + jsObject[Strings.createSampler]!().fromJSValue()! + } + + func deleteSampler(sampler: WebGLSampler?) { + _ = jsObject[Strings.deleteSampler]!(sampler.jsValue()) + } + + func isSampler(sampler: WebGLSampler?) -> GLboolean { + jsObject[Strings.isSampler]!(sampler.jsValue()).fromJSValue()! + } + + func bindSampler(unit: GLuint, sampler: WebGLSampler?) { + _ = jsObject[Strings.bindSampler]!(unit.jsValue(), sampler.jsValue()) + } + + func samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint) { + _ = jsObject[Strings.samplerParameteri]!(sampler.jsValue(), pname.jsValue(), param.jsValue()) + } + + func samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat) { + _ = jsObject[Strings.samplerParameterf]!(sampler.jsValue(), pname.jsValue(), param.jsValue()) + } + + func getSamplerParameter(sampler: WebGLSampler, pname: GLenum) -> JSValue { + jsObject[Strings.getSamplerParameter]!(sampler.jsValue(), pname.jsValue()).fromJSValue()! + } + + func fenceSync(condition: GLenum, flags: GLbitfield) -> WebGLSync? { + jsObject[Strings.fenceSync]!(condition.jsValue(), flags.jsValue()).fromJSValue()! + } + + func isSync(sync: WebGLSync?) -> GLboolean { + jsObject[Strings.isSync]!(sync.jsValue()).fromJSValue()! + } + + func deleteSync(sync: WebGLSync?) { + _ = jsObject[Strings.deleteSync]!(sync.jsValue()) + } + + func clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64) -> GLenum { + jsObject[Strings.clientWaitSync]!(sync.jsValue(), flags.jsValue(), timeout.jsValue()).fromJSValue()! + } + + func waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64) { + _ = jsObject[Strings.waitSync]!(sync.jsValue(), flags.jsValue(), timeout.jsValue()) + } + + func getSyncParameter(sync: WebGLSync, pname: GLenum) -> JSValue { + jsObject[Strings.getSyncParameter]!(sync.jsValue(), pname.jsValue()).fromJSValue()! + } + + func createTransformFeedback() -> WebGLTransformFeedback? { + jsObject[Strings.createTransformFeedback]!().fromJSValue()! + } + + func deleteTransformFeedback(tf: WebGLTransformFeedback?) { + _ = jsObject[Strings.deleteTransformFeedback]!(tf.jsValue()) + } + + func isTransformFeedback(tf: WebGLTransformFeedback?) -> GLboolean { + jsObject[Strings.isTransformFeedback]!(tf.jsValue()).fromJSValue()! + } + + func bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback?) { + _ = jsObject[Strings.bindTransformFeedback]!(target.jsValue(), tf.jsValue()) + } + + func beginTransformFeedback(primitiveMode: GLenum) { + _ = jsObject[Strings.beginTransformFeedback]!(primitiveMode.jsValue()) + } + + func endTransformFeedback() { + _ = jsObject[Strings.endTransformFeedback]!() + } + + func transformFeedbackVaryings(program: WebGLProgram, varyings: [String], bufferMode: GLenum) { + _ = jsObject[Strings.transformFeedbackVaryings]!(program.jsValue(), varyings.jsValue(), bufferMode.jsValue()) + } + + func getTransformFeedbackVarying(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + jsObject[Strings.getTransformFeedbackVarying]!(program.jsValue(), index.jsValue()).fromJSValue()! + } + + func pauseTransformFeedback() { + _ = jsObject[Strings.pauseTransformFeedback]!() + } + + func resumeTransformFeedback() { + _ = jsObject[Strings.resumeTransformFeedback]!() + } + + func bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer?) { + _ = jsObject[Strings.bindBufferBase]!(target.jsValue(), index.jsValue(), buffer.jsValue()) + } + + func bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer?, offset: GLintptr, size: GLsizeiptr) { + _ = jsObject[Strings.bindBufferRange]!(target.jsValue(), index.jsValue(), buffer.jsValue(), offset.jsValue(), size.jsValue()) + } + + func getIndexedParameter(target: GLenum, index: GLuint) -> JSValue { + jsObject[Strings.getIndexedParameter]!(target.jsValue(), index.jsValue()).fromJSValue()! + } + + func getUniformIndices(program: WebGLProgram, uniformNames: [String]) -> [GLuint]? { + jsObject[Strings.getUniformIndices]!(program.jsValue(), uniformNames.jsValue()).fromJSValue()! + } + + func getActiveUniforms(program: WebGLProgram, uniformIndices: [GLuint], pname: GLenum) -> JSValue { + jsObject[Strings.getActiveUniforms]!(program.jsValue(), uniformIndices.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getUniformBlockIndex(program: WebGLProgram, uniformBlockName: String) -> GLuint { + jsObject[Strings.getUniformBlockIndex]!(program.jsValue(), uniformBlockName.jsValue()).fromJSValue()! + } + + func getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum) -> JSValue { + jsObject[Strings.getActiveUniformBlockParameter]!(program.jsValue(), uniformBlockIndex.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint) -> String? { + jsObject[Strings.getActiveUniformBlockName]!(program.jsValue(), uniformBlockIndex.jsValue()).fromJSValue()! + } + + func uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint) { + _ = jsObject[Strings.uniformBlockBinding]!(program.jsValue(), uniformBlockIndex.jsValue(), uniformBlockBinding.jsValue()) + } + + func createVertexArray() -> WebGLVertexArrayObject? { + jsObject[Strings.createVertexArray]!().fromJSValue()! + } + + func deleteVertexArray(vertexArray: WebGLVertexArrayObject?) { + _ = jsObject[Strings.deleteVertexArray]!(vertexArray.jsValue()) + } + + func isVertexArray(vertexArray: WebGLVertexArrayObject?) -> GLboolean { + jsObject[Strings.isVertexArray]!(vertexArray.jsValue()).fromJSValue()! + } + + func bindVertexArray(array: WebGLVertexArrayObject?) { + _ = jsObject[Strings.bindVertexArray]!(array.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift new file mode 100644 index 00000000..81489fe8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift @@ -0,0 +1,284 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol WebGL2RenderingContextOverloads: JSBridgedClass {} +public extension WebGL2RenderingContextOverloads { + func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { + _ = jsObject[Strings.bufferData]!(target.jsValue(), size.jsValue(), usage.jsValue()) + } + + func bufferData(target: GLenum, srcData: BufferSource?, usage: GLenum) { + _ = jsObject[Strings.bufferData]!(target.jsValue(), srcData.jsValue(), usage.jsValue()) + } + + func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource) { + _ = jsObject[Strings.bufferSubData]!(target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue()) + } + + func bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length: GLuint? = nil) { + _ = jsObject[Strings.bufferData]!(target.jsValue(), srcData.jsValue(), usage.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined) + } + + func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length: GLuint? = nil) { + _ = jsObject[Strings.bufferSubData]!(target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined) + } + + 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() + _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + 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() + _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + 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() + _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + 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() + _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + } + + func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { + 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 = pboOffset.jsValue() + _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + 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 = source.jsValue() + _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { + 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 = srcData.jsValue() + let _arg9 = srcOffset.jsValue() + _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + } + + func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { + 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 = pboOffset.jsValue() + _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { + 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 = source.jsValue() + _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { + 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 = srcData.jsValue() + let _arg9 = srcOffset.jsValue() + _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + } + + func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { + 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 = imageSize.jsValue() + let _arg7 = offset.jsValue() + _ = jsObject[Strings.compressedTexImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + } + + func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + 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 = srcData.jsValue() + let _arg7 = srcOffset?.jsValue() ?? .undefined + let _arg8 = srcLengthOverride?.jsValue() ?? .undefined + _ = jsObject[Strings.compressedTexImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { + 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 = imageSize.jsValue() + let _arg8 = offset.jsValue() + _ = jsObject[Strings.compressedTexSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + 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 = srcData.jsValue() + let _arg8 = srcOffset?.jsValue() ?? .undefined + let _arg9 = srcLengthOverride?.jsValue() ?? .undefined + _ = jsObject[Strings.compressedTexSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + } + + func uniform1fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform1fv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform2fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform2fv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform3fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform3fv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform4fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform4fv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform1iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform1iv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform2iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform2iv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform3iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform3iv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniform4iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniform4iv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniformMatrix2fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniformMatrix3fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + _ = jsObject[Strings.uniformMatrix4fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + } + + func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: 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 = dstData.jsValue() + _ = jsObject[Strings.readPixels]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + } + + func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr) { + 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 = offset.jsValue() + _ = jsObject[Strings.readPixels]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + } + + func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint) { + 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 = dstData.jsValue() + let _arg7 = dstOffset.jsValue() + _ = jsObject[Strings.readPixels]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift b/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift new file mode 100644 index 00000000..7be633a6 --- /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 { + 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..43dcc746 --- /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 { + 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..f9e806d1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift @@ -0,0 +1,65 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLContextAttributes: BridgedDictionary { + public convenience init(xrCompatible: Bool, 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.xrCompatible] = xrCompatible.jsValue() + 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) { + _xrCompatible = ReadWriteAttribute(jsObject: object, name: Strings.xrCompatible) + _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 xrCompatible: Bool + + @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..9439f116 --- /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 { + 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) + } + + public convenience init(type: String, eventInit: WebGLContextEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(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..78bd7cda --- /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..5fe76b5f --- /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 { + 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..2257f5c5 --- /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 { + 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..ed882ccf --- /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" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/WebGLProgram.swift b/Sources/DOMKit/WebIDL/WebGLProgram.swift new file mode 100644 index 00000000..2d4bdb31 --- /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 { + 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/WebGLQuery.swift b/Sources/DOMKit/WebIDL/WebGLQuery.swift new file mode 100644 index 00000000..94ee3dc9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLQuery.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLQuery: WebGLObject { + override public class var constructor: JSFunction { JSObject.global[Strings.WebGLQuery].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..b87c8c7f --- /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 { + 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..875e0c10 --- /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 { + 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..bd32bdd6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift @@ -0,0 +1,1109 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol WebGLRenderingContextBase: JSBridgedClass {} +public extension WebGLRenderingContextBase { + func makeXRCompatible() -> JSPromise { + jsObject[Strings.makeXRCompatible]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func makeXRCompatible() async throws { + let _promise: JSPromise = jsObject[Strings.makeXRCompatible]!().fromJSValue()! + _ = try await _promise.get() + } + + static let DEPTH_BUFFER_BIT: GLenum = 0x0000_0100 + + static let STENCIL_BUFFER_BIT: GLenum = 0x0000_0400 + + static let COLOR_BUFFER_BIT: GLenum = 0x0000_4000 + + static let POINTS: GLenum = 0x0000 + + static let LINES: GLenum = 0x0001 + + static let LINE_LOOP: GLenum = 0x0002 + + static let LINE_STRIP: GLenum = 0x0003 + + static let TRIANGLES: GLenum = 0x0004 + + static let TRIANGLE_STRIP: GLenum = 0x0005 + + static let TRIANGLE_FAN: GLenum = 0x0006 + + static let ZERO: GLenum = 0 + + static let ONE: GLenum = 1 + + static let SRC_COLOR: GLenum = 0x0300 + + static let ONE_MINUS_SRC_COLOR: GLenum = 0x0301 + + static let SRC_ALPHA: GLenum = 0x0302 + + static let ONE_MINUS_SRC_ALPHA: GLenum = 0x0303 + + static let DST_ALPHA: GLenum = 0x0304 + + static let ONE_MINUS_DST_ALPHA: GLenum = 0x0305 + + static let DST_COLOR: GLenum = 0x0306 + + static let ONE_MINUS_DST_COLOR: GLenum = 0x0307 + + static let SRC_ALPHA_SATURATE: GLenum = 0x0308 + + static let FUNC_ADD: GLenum = 0x8006 + + static let BLEND_EQUATION: GLenum = 0x8009 + + static let BLEND_EQUATION_RGB: GLenum = 0x8009 + + static let BLEND_EQUATION_ALPHA: GLenum = 0x883D + + static let FUNC_SUBTRACT: GLenum = 0x800A + + static let FUNC_REVERSE_SUBTRACT: GLenum = 0x800B + + static let BLEND_DST_RGB: GLenum = 0x80C8 + + static let BLEND_SRC_RGB: GLenum = 0x80C9 + + static let BLEND_DST_ALPHA: GLenum = 0x80CA + + static let BLEND_SRC_ALPHA: GLenum = 0x80CB + + static let CONSTANT_COLOR: GLenum = 0x8001 + + static let ONE_MINUS_CONSTANT_COLOR: GLenum = 0x8002 + + static let CONSTANT_ALPHA: GLenum = 0x8003 + + static let ONE_MINUS_CONSTANT_ALPHA: GLenum = 0x8004 + + static let BLEND_COLOR: GLenum = 0x8005 + + static let ARRAY_BUFFER: GLenum = 0x8892 + + static let ELEMENT_ARRAY_BUFFER: GLenum = 0x8893 + + static let ARRAY_BUFFER_BINDING: GLenum = 0x8894 + + static let ELEMENT_ARRAY_BUFFER_BINDING: GLenum = 0x8895 + + static let STREAM_DRAW: GLenum = 0x88E0 + + static let STATIC_DRAW: GLenum = 0x88E4 + + static let DYNAMIC_DRAW: GLenum = 0x88E8 + + static let BUFFER_SIZE: GLenum = 0x8764 + + static let BUFFER_USAGE: GLenum = 0x8765 + + static let CURRENT_VERTEX_ATTRIB: GLenum = 0x8626 + + static let FRONT: GLenum = 0x0404 + + static let BACK: GLenum = 0x0405 + + static let FRONT_AND_BACK: GLenum = 0x0408 + + static let CULL_FACE: GLenum = 0x0B44 + + static let BLEND: GLenum = 0x0BE2 + + static let DITHER: GLenum = 0x0BD0 + + static let STENCIL_TEST: GLenum = 0x0B90 + + static let DEPTH_TEST: GLenum = 0x0B71 + + static let SCISSOR_TEST: GLenum = 0x0C11 + + static let POLYGON_OFFSET_FILL: GLenum = 0x8037 + + static let SAMPLE_ALPHA_TO_COVERAGE: GLenum = 0x809E + + static let SAMPLE_COVERAGE: GLenum = 0x80A0 + + static let NO_ERROR: GLenum = 0 + + static let INVALID_ENUM: GLenum = 0x0500 + + static let INVALID_VALUE: GLenum = 0x0501 + + static let INVALID_OPERATION: GLenum = 0x0502 + + static let OUT_OF_MEMORY: GLenum = 0x0505 + + static let CW: GLenum = 0x0900 + + static let CCW: GLenum = 0x0901 + + static let LINE_WIDTH: GLenum = 0x0B21 + + static let ALIASED_POINT_SIZE_RANGE: GLenum = 0x846D + + static let ALIASED_LINE_WIDTH_RANGE: GLenum = 0x846E + + static let CULL_FACE_MODE: GLenum = 0x0B45 + + static let FRONT_FACE: GLenum = 0x0B46 + + static let DEPTH_RANGE: GLenum = 0x0B70 + + static let DEPTH_WRITEMASK: GLenum = 0x0B72 + + static let DEPTH_CLEAR_VALUE: GLenum = 0x0B73 + + static let DEPTH_FUNC: GLenum = 0x0B74 + + static let STENCIL_CLEAR_VALUE: GLenum = 0x0B91 + + static let STENCIL_FUNC: GLenum = 0x0B92 + + static let STENCIL_FAIL: GLenum = 0x0B94 + + static let STENCIL_PASS_DEPTH_FAIL: GLenum = 0x0B95 + + static let STENCIL_PASS_DEPTH_PASS: GLenum = 0x0B96 + + static let STENCIL_REF: GLenum = 0x0B97 + + static let STENCIL_VALUE_MASK: GLenum = 0x0B93 + + static let STENCIL_WRITEMASK: GLenum = 0x0B98 + + static let STENCIL_BACK_FUNC: GLenum = 0x8800 + + static let STENCIL_BACK_FAIL: GLenum = 0x8801 + + static let STENCIL_BACK_PASS_DEPTH_FAIL: GLenum = 0x8802 + + static let STENCIL_BACK_PASS_DEPTH_PASS: GLenum = 0x8803 + + static let STENCIL_BACK_REF: GLenum = 0x8CA3 + + static let STENCIL_BACK_VALUE_MASK: GLenum = 0x8CA4 + + static let STENCIL_BACK_WRITEMASK: GLenum = 0x8CA5 + + static let VIEWPORT: GLenum = 0x0BA2 + + static let SCISSOR_BOX: GLenum = 0x0C10 + + static let COLOR_CLEAR_VALUE: GLenum = 0x0C22 + + static let COLOR_WRITEMASK: GLenum = 0x0C23 + + static let UNPACK_ALIGNMENT: GLenum = 0x0CF5 + + static let PACK_ALIGNMENT: GLenum = 0x0D05 + + static let MAX_TEXTURE_SIZE: GLenum = 0x0D33 + + static let MAX_VIEWPORT_DIMS: GLenum = 0x0D3A + + static let SUBPIXEL_BITS: GLenum = 0x0D50 + + static let RED_BITS: GLenum = 0x0D52 + + static let GREEN_BITS: GLenum = 0x0D53 + + static let BLUE_BITS: GLenum = 0x0D54 + + static let ALPHA_BITS: GLenum = 0x0D55 + + static let DEPTH_BITS: GLenum = 0x0D56 + + static let STENCIL_BITS: GLenum = 0x0D57 + + static let POLYGON_OFFSET_UNITS: GLenum = 0x2A00 + + static let POLYGON_OFFSET_FACTOR: GLenum = 0x8038 + + static let TEXTURE_BINDING_2D: GLenum = 0x8069 + + static let SAMPLE_BUFFERS: GLenum = 0x80A8 + + static let SAMPLES: GLenum = 0x80A9 + + static let SAMPLE_COVERAGE_VALUE: GLenum = 0x80AA + + static let SAMPLE_COVERAGE_INVERT: GLenum = 0x80AB + + static let COMPRESSED_TEXTURE_FORMATS: GLenum = 0x86A3 + + static let DONT_CARE: GLenum = 0x1100 + + static let FASTEST: GLenum = 0x1101 + + static let NICEST: GLenum = 0x1102 + + static let GENERATE_MIPMAP_HINT: GLenum = 0x8192 + + static let BYTE: GLenum = 0x1400 + + static let UNSIGNED_BYTE: GLenum = 0x1401 + + static let SHORT: GLenum = 0x1402 + + static let UNSIGNED_SHORT: GLenum = 0x1403 + + static let INT: GLenum = 0x1404 + + static let UNSIGNED_INT: GLenum = 0x1405 + + static let FLOAT: GLenum = 0x1406 + + static let DEPTH_COMPONENT: GLenum = 0x1902 + + static let ALPHA: GLenum = 0x1906 + + static let RGB: GLenum = 0x1907 + + static let RGBA: GLenum = 0x1908 + + static let LUMINANCE: GLenum = 0x1909 + + static let LUMINANCE_ALPHA: GLenum = 0x190A + + static let UNSIGNED_SHORT_4_4_4_4: GLenum = 0x8033 + + static let UNSIGNED_SHORT_5_5_5_1: GLenum = 0x8034 + + static let UNSIGNED_SHORT_5_6_5: GLenum = 0x8363 + + static let FRAGMENT_SHADER: GLenum = 0x8B30 + + static let VERTEX_SHADER: GLenum = 0x8B31 + + static let MAX_VERTEX_ATTRIBS: GLenum = 0x8869 + + static let MAX_VERTEX_UNIFORM_VECTORS: GLenum = 0x8DFB + + static let MAX_VARYING_VECTORS: GLenum = 0x8DFC + + static let MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum = 0x8B4D + + static let MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum = 0x8B4C + + static let MAX_TEXTURE_IMAGE_UNITS: GLenum = 0x8872 + + static let MAX_FRAGMENT_UNIFORM_VECTORS: GLenum = 0x8DFD + + static let SHADER_TYPE: GLenum = 0x8B4F + + static let DELETE_STATUS: GLenum = 0x8B80 + + static let LINK_STATUS: GLenum = 0x8B82 + + static let VALIDATE_STATUS: GLenum = 0x8B83 + + static let ATTACHED_SHADERS: GLenum = 0x8B85 + + static let ACTIVE_UNIFORMS: GLenum = 0x8B86 + + static let ACTIVE_ATTRIBUTES: GLenum = 0x8B89 + + static let SHADING_LANGUAGE_VERSION: GLenum = 0x8B8C + + static let CURRENT_PROGRAM: GLenum = 0x8B8D + + static let NEVER: GLenum = 0x0200 + + static let LESS: GLenum = 0x0201 + + static let EQUAL: GLenum = 0x0202 + + static let LEQUAL: GLenum = 0x0203 + + static let GREATER: GLenum = 0x0204 + + static let NOTEQUAL: GLenum = 0x0205 + + static let GEQUAL: GLenum = 0x0206 + + static let ALWAYS: GLenum = 0x0207 + + static let KEEP: GLenum = 0x1E00 + + static let REPLACE: GLenum = 0x1E01 + + static let INCR: GLenum = 0x1E02 + + static let DECR: GLenum = 0x1E03 + + static let INVERT: GLenum = 0x150A + + static let INCR_WRAP: GLenum = 0x8507 + + static let DECR_WRAP: GLenum = 0x8508 + + static let VENDOR: GLenum = 0x1F00 + + static let RENDERER: GLenum = 0x1F01 + + static let VERSION: GLenum = 0x1F02 + + static let NEAREST: GLenum = 0x2600 + + static let LINEAR: GLenum = 0x2601 + + static let NEAREST_MIPMAP_NEAREST: GLenum = 0x2700 + + static let LINEAR_MIPMAP_NEAREST: GLenum = 0x2701 + + static let NEAREST_MIPMAP_LINEAR: GLenum = 0x2702 + + static let LINEAR_MIPMAP_LINEAR: GLenum = 0x2703 + + static let TEXTURE_MAG_FILTER: GLenum = 0x2800 + + static let TEXTURE_MIN_FILTER: GLenum = 0x2801 + + static let TEXTURE_WRAP_S: GLenum = 0x2802 + + static let TEXTURE_WRAP_T: GLenum = 0x2803 + + static let TEXTURE_2D: GLenum = 0x0DE1 + + static let TEXTURE: GLenum = 0x1702 + + static let TEXTURE_CUBE_MAP: GLenum = 0x8513 + + static let TEXTURE_BINDING_CUBE_MAP: GLenum = 0x8514 + + static let TEXTURE_CUBE_MAP_POSITIVE_X: GLenum = 0x8515 + + static let TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum = 0x8516 + + static let TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum = 0x8517 + + static let TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum = 0x8518 + + static let TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum = 0x8519 + + static let TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum = 0x851A + + static let MAX_CUBE_MAP_TEXTURE_SIZE: GLenum = 0x851C + + static let TEXTURE0: GLenum = 0x84C0 + + static let TEXTURE1: GLenum = 0x84C1 + + static let TEXTURE2: GLenum = 0x84C2 + + static let TEXTURE3: GLenum = 0x84C3 + + static let TEXTURE4: GLenum = 0x84C4 + + static let TEXTURE5: GLenum = 0x84C5 + + static let TEXTURE6: GLenum = 0x84C6 + + static let TEXTURE7: GLenum = 0x84C7 + + static let TEXTURE8: GLenum = 0x84C8 + + static let TEXTURE9: GLenum = 0x84C9 + + static let TEXTURE10: GLenum = 0x84CA + + static let TEXTURE11: GLenum = 0x84CB + + static let TEXTURE12: GLenum = 0x84CC + + static let TEXTURE13: GLenum = 0x84CD + + static let TEXTURE14: GLenum = 0x84CE + + static let TEXTURE15: GLenum = 0x84CF + + static let TEXTURE16: GLenum = 0x84D0 + + static let TEXTURE17: GLenum = 0x84D1 + + static let TEXTURE18: GLenum = 0x84D2 + + static let TEXTURE19: GLenum = 0x84D3 + + static let TEXTURE20: GLenum = 0x84D4 + + static let TEXTURE21: GLenum = 0x84D5 + + static let TEXTURE22: GLenum = 0x84D6 + + static let TEXTURE23: GLenum = 0x84D7 + + static let TEXTURE24: GLenum = 0x84D8 + + static let TEXTURE25: GLenum = 0x84D9 + + static let TEXTURE26: GLenum = 0x84DA + + static let TEXTURE27: GLenum = 0x84DB + + static let TEXTURE28: GLenum = 0x84DC + + static let TEXTURE29: GLenum = 0x84DD + + static let TEXTURE30: GLenum = 0x84DE + + static let TEXTURE31: GLenum = 0x84DF + + static let ACTIVE_TEXTURE: GLenum = 0x84E0 + + static let REPEAT: GLenum = 0x2901 + + static let CLAMP_TO_EDGE: GLenum = 0x812F + + static let MIRRORED_REPEAT: GLenum = 0x8370 + + static let FLOAT_VEC2: GLenum = 0x8B50 + + static let FLOAT_VEC3: GLenum = 0x8B51 + + static let FLOAT_VEC4: GLenum = 0x8B52 + + static let INT_VEC2: GLenum = 0x8B53 + + static let INT_VEC3: GLenum = 0x8B54 + + static let INT_VEC4: GLenum = 0x8B55 + + static let BOOL: GLenum = 0x8B56 + + static let BOOL_VEC2: GLenum = 0x8B57 + + static let BOOL_VEC3: GLenum = 0x8B58 + + static let BOOL_VEC4: GLenum = 0x8B59 + + static let FLOAT_MAT2: GLenum = 0x8B5A + + static let FLOAT_MAT3: GLenum = 0x8B5B + + static let FLOAT_MAT4: GLenum = 0x8B5C + + static let SAMPLER_2D: GLenum = 0x8B5E + + static let SAMPLER_CUBE: GLenum = 0x8B60 + + static let VERTEX_ATTRIB_ARRAY_ENABLED: GLenum = 0x8622 + + static let VERTEX_ATTRIB_ARRAY_SIZE: GLenum = 0x8623 + + static let VERTEX_ATTRIB_ARRAY_STRIDE: GLenum = 0x8624 + + static let VERTEX_ATTRIB_ARRAY_TYPE: GLenum = 0x8625 + + static let VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum = 0x886A + + static let VERTEX_ATTRIB_ARRAY_POINTER: GLenum = 0x8645 + + static let VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum = 0x889F + + static let IMPLEMENTATION_COLOR_READ_TYPE: GLenum = 0x8B9A + + static let IMPLEMENTATION_COLOR_READ_FORMAT: GLenum = 0x8B9B + + static let COMPILE_STATUS: GLenum = 0x8B81 + + static let LOW_FLOAT: GLenum = 0x8DF0 + + static let MEDIUM_FLOAT: GLenum = 0x8DF1 + + static let HIGH_FLOAT: GLenum = 0x8DF2 + + static let LOW_INT: GLenum = 0x8DF3 + + static let MEDIUM_INT: GLenum = 0x8DF4 + + static let HIGH_INT: GLenum = 0x8DF5 + + static let FRAMEBUFFER: GLenum = 0x8D40 + + static let RENDERBUFFER: GLenum = 0x8D41 + + static let RGBA4: GLenum = 0x8056 + + static let RGB5_A1: GLenum = 0x8057 + + static let RGB565: GLenum = 0x8D62 + + static let DEPTH_COMPONENT16: GLenum = 0x81A5 + + static let STENCIL_INDEX8: GLenum = 0x8D48 + + static let DEPTH_STENCIL: GLenum = 0x84F9 + + static let RENDERBUFFER_WIDTH: GLenum = 0x8D42 + + static let RENDERBUFFER_HEIGHT: GLenum = 0x8D43 + + static let RENDERBUFFER_INTERNAL_FORMAT: GLenum = 0x8D44 + + static let RENDERBUFFER_RED_SIZE: GLenum = 0x8D50 + + static let RENDERBUFFER_GREEN_SIZE: GLenum = 0x8D51 + + static let RENDERBUFFER_BLUE_SIZE: GLenum = 0x8D52 + + static let RENDERBUFFER_ALPHA_SIZE: GLenum = 0x8D53 + + static let RENDERBUFFER_DEPTH_SIZE: GLenum = 0x8D54 + + static let RENDERBUFFER_STENCIL_SIZE: GLenum = 0x8D55 + + static let FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum = 0x8CD0 + + static let FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum = 0x8CD1 + + static let FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum = 0x8CD2 + + static let FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum = 0x8CD3 + + static let COLOR_ATTACHMENT0: GLenum = 0x8CE0 + + static let DEPTH_ATTACHMENT: GLenum = 0x8D00 + + static let STENCIL_ATTACHMENT: GLenum = 0x8D20 + + static let DEPTH_STENCIL_ATTACHMENT: GLenum = 0x821A + + static let NONE: GLenum = 0 + + static let FRAMEBUFFER_COMPLETE: GLenum = 0x8CD5 + + static let FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum = 0x8CD6 + + static let FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum = 0x8CD7 + + static let FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum = 0x8CD9 + + static let FRAMEBUFFER_UNSUPPORTED: GLenum = 0x8CDD + + static let FRAMEBUFFER_BINDING: GLenum = 0x8CA6 + + static let RENDERBUFFER_BINDING: GLenum = 0x8CA7 + + static let MAX_RENDERBUFFER_SIZE: GLenum = 0x84E8 + + static let INVALID_FRAMEBUFFER_OPERATION: GLenum = 0x0506 + + static let UNPACK_FLIP_Y_WEBGL: GLenum = 0x9240 + + static let UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum = 0x9241 + + static let CONTEXT_LOST_WEBGL: GLenum = 0x9242 + + static let UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum = 0x9243 + + static let BROWSER_DEFAULT_WEBGL: GLenum = 0x9244 + + var canvas: __UNSUPPORTED_UNION__ { ReadonlyAttribute[Strings.canvas, in: jsObject] } + + var drawingBufferWidth: GLsizei { ReadonlyAttribute[Strings.drawingBufferWidth, in: jsObject] } + + var drawingBufferHeight: GLsizei { ReadonlyAttribute[Strings.drawingBufferHeight, in: jsObject] } + + func getContextAttributes() -> WebGLContextAttributes? { + jsObject[Strings.getContextAttributes]!().fromJSValue()! + } + + func isContextLost() -> Bool { + jsObject[Strings.isContextLost]!().fromJSValue()! + } + + func getSupportedExtensions() -> [String]? { + jsObject[Strings.getSupportedExtensions]!().fromJSValue()! + } + + func getExtension(name: String) -> JSObject? { + jsObject[Strings.getExtension]!(name.jsValue()).fromJSValue()! + } + + func activeTexture(texture: GLenum) { + _ = jsObject[Strings.activeTexture]!(texture.jsValue()) + } + + func attachShader(program: WebGLProgram, shader: WebGLShader) { + _ = jsObject[Strings.attachShader]!(program.jsValue(), shader.jsValue()) + } + + func bindAttribLocation(program: WebGLProgram, index: GLuint, name: String) { + _ = jsObject[Strings.bindAttribLocation]!(program.jsValue(), index.jsValue(), name.jsValue()) + } + + func bindBuffer(target: GLenum, buffer: WebGLBuffer?) { + _ = jsObject[Strings.bindBuffer]!(target.jsValue(), buffer.jsValue()) + } + + func bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer?) { + _ = jsObject[Strings.bindFramebuffer]!(target.jsValue(), framebuffer.jsValue()) + } + + func bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer?) { + _ = jsObject[Strings.bindRenderbuffer]!(target.jsValue(), renderbuffer.jsValue()) + } + + func bindTexture(target: GLenum, texture: WebGLTexture?) { + _ = jsObject[Strings.bindTexture]!(target.jsValue(), texture.jsValue()) + } + + func blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { + _ = jsObject[Strings.blendColor]!(red.jsValue(), green.jsValue(), blue.jsValue(), alpha.jsValue()) + } + + func blendEquation(mode: GLenum) { + _ = jsObject[Strings.blendEquation]!(mode.jsValue()) + } + + func blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) { + _ = jsObject[Strings.blendEquationSeparate]!(modeRGB.jsValue(), modeAlpha.jsValue()) + } + + func blendFunc(sfactor: GLenum, dfactor: GLenum) { + _ = jsObject[Strings.blendFunc]!(sfactor.jsValue(), dfactor.jsValue()) + } + + func blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { + _ = jsObject[Strings.blendFuncSeparate]!(srcRGB.jsValue(), dstRGB.jsValue(), srcAlpha.jsValue(), dstAlpha.jsValue()) + } + + func checkFramebufferStatus(target: GLenum) -> GLenum { + jsObject[Strings.checkFramebufferStatus]!(target.jsValue()).fromJSValue()! + } + + func clear(mask: GLbitfield) { + _ = jsObject[Strings.clear]!(mask.jsValue()) + } + + func clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { + _ = jsObject[Strings.clearColor]!(red.jsValue(), green.jsValue(), blue.jsValue(), alpha.jsValue()) + } + + func clearDepth(depth: GLclampf) { + _ = jsObject[Strings.clearDepth]!(depth.jsValue()) + } + + func clearStencil(s: GLint) { + _ = jsObject[Strings.clearStencil]!(s.jsValue()) + } + + func colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) { + _ = jsObject[Strings.colorMask]!(red.jsValue(), green.jsValue(), blue.jsValue(), alpha.jsValue()) + } + + func compileShader(shader: WebGLShader) { + _ = jsObject[Strings.compileShader]!(shader.jsValue()) + } + + 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() + _ = jsObject[Strings.copyTexImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + } + + 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() + _ = jsObject[Strings.copyTexSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + } + + func createBuffer() -> WebGLBuffer? { + jsObject[Strings.createBuffer]!().fromJSValue()! + } + + func createFramebuffer() -> WebGLFramebuffer? { + jsObject[Strings.createFramebuffer]!().fromJSValue()! + } + + func createProgram() -> WebGLProgram? { + jsObject[Strings.createProgram]!().fromJSValue()! + } + + func createRenderbuffer() -> WebGLRenderbuffer? { + jsObject[Strings.createRenderbuffer]!().fromJSValue()! + } + + func createShader(type: GLenum) -> WebGLShader? { + jsObject[Strings.createShader]!(type.jsValue()).fromJSValue()! + } + + func createTexture() -> WebGLTexture? { + jsObject[Strings.createTexture]!().fromJSValue()! + } + + func cullFace(mode: GLenum) { + _ = jsObject[Strings.cullFace]!(mode.jsValue()) + } + + func deleteBuffer(buffer: WebGLBuffer?) { + _ = jsObject[Strings.deleteBuffer]!(buffer.jsValue()) + } + + func deleteFramebuffer(framebuffer: WebGLFramebuffer?) { + _ = jsObject[Strings.deleteFramebuffer]!(framebuffer.jsValue()) + } + + func deleteProgram(program: WebGLProgram?) { + _ = jsObject[Strings.deleteProgram]!(program.jsValue()) + } + + func deleteRenderbuffer(renderbuffer: WebGLRenderbuffer?) { + _ = jsObject[Strings.deleteRenderbuffer]!(renderbuffer.jsValue()) + } + + func deleteShader(shader: WebGLShader?) { + _ = jsObject[Strings.deleteShader]!(shader.jsValue()) + } + + func deleteTexture(texture: WebGLTexture?) { + _ = jsObject[Strings.deleteTexture]!(texture.jsValue()) + } + + func depthFunc(func: GLenum) { + _ = jsObject[Strings.depthFunc]!(`func`.jsValue()) + } + + func depthMask(flag: GLboolean) { + _ = jsObject[Strings.depthMask]!(flag.jsValue()) + } + + func depthRange(zNear: GLclampf, zFar: GLclampf) { + _ = jsObject[Strings.depthRange]!(zNear.jsValue(), zFar.jsValue()) + } + + func detachShader(program: WebGLProgram, shader: WebGLShader) { + _ = jsObject[Strings.detachShader]!(program.jsValue(), shader.jsValue()) + } + + func disable(cap: GLenum) { + _ = jsObject[Strings.disable]!(cap.jsValue()) + } + + func disableVertexAttribArray(index: GLuint) { + _ = jsObject[Strings.disableVertexAttribArray]!(index.jsValue()) + } + + func drawArrays(mode: GLenum, first: GLint, count: GLsizei) { + _ = jsObject[Strings.drawArrays]!(mode.jsValue(), first.jsValue(), count.jsValue()) + } + + func drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr) { + _ = jsObject[Strings.drawElements]!(mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue()) + } + + func enable(cap: GLenum) { + _ = jsObject[Strings.enable]!(cap.jsValue()) + } + + func enableVertexAttribArray(index: GLuint) { + _ = jsObject[Strings.enableVertexAttribArray]!(index.jsValue()) + } + + func finish() { + _ = jsObject[Strings.finish]!() + } + + func flush() { + _ = jsObject[Strings.flush]!() + } + + func framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer?) { + _ = jsObject[Strings.framebufferRenderbuffer]!(target.jsValue(), attachment.jsValue(), renderbuffertarget.jsValue(), renderbuffer.jsValue()) + } + + func framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture?, level: GLint) { + _ = jsObject[Strings.framebufferTexture2D]!(target.jsValue(), attachment.jsValue(), textarget.jsValue(), texture.jsValue(), level.jsValue()) + } + + func frontFace(mode: GLenum) { + _ = jsObject[Strings.frontFace]!(mode.jsValue()) + } + + func generateMipmap(target: GLenum) { + _ = jsObject[Strings.generateMipmap]!(target.jsValue()) + } + + func getActiveAttrib(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + jsObject[Strings.getActiveAttrib]!(program.jsValue(), index.jsValue()).fromJSValue()! + } + + func getActiveUniform(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + jsObject[Strings.getActiveUniform]!(program.jsValue(), index.jsValue()).fromJSValue()! + } + + func getAttachedShaders(program: WebGLProgram) -> [WebGLShader]? { + jsObject[Strings.getAttachedShaders]!(program.jsValue()).fromJSValue()! + } + + func getAttribLocation(program: WebGLProgram, name: String) -> GLint { + jsObject[Strings.getAttribLocation]!(program.jsValue(), name.jsValue()).fromJSValue()! + } + + func getBufferParameter(target: GLenum, pname: GLenum) -> JSValue { + jsObject[Strings.getBufferParameter]!(target.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getParameter(pname: GLenum) -> JSValue { + jsObject[Strings.getParameter]!(pname.jsValue()).fromJSValue()! + } + + func getError() -> GLenum { + jsObject[Strings.getError]!().fromJSValue()! + } + + func getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum) -> JSValue { + jsObject[Strings.getFramebufferAttachmentParameter]!(target.jsValue(), attachment.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getProgramParameter(program: WebGLProgram, pname: GLenum) -> JSValue { + jsObject[Strings.getProgramParameter]!(program.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getProgramInfoLog(program: WebGLProgram) -> String? { + jsObject[Strings.getProgramInfoLog]!(program.jsValue()).fromJSValue()! + } + + func getRenderbufferParameter(target: GLenum, pname: GLenum) -> JSValue { + jsObject[Strings.getRenderbufferParameter]!(target.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getShaderParameter(shader: WebGLShader, pname: GLenum) -> JSValue { + jsObject[Strings.getShaderParameter]!(shader.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) -> WebGLShaderPrecisionFormat? { + jsObject[Strings.getShaderPrecisionFormat]!(shadertype.jsValue(), precisiontype.jsValue()).fromJSValue()! + } + + func getShaderInfoLog(shader: WebGLShader) -> String? { + jsObject[Strings.getShaderInfoLog]!(shader.jsValue()).fromJSValue()! + } + + func getShaderSource(shader: WebGLShader) -> String? { + jsObject[Strings.getShaderSource]!(shader.jsValue()).fromJSValue()! + } + + func getTexParameter(target: GLenum, pname: GLenum) -> JSValue { + jsObject[Strings.getTexParameter]!(target.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getUniform(program: WebGLProgram, location: WebGLUniformLocation) -> JSValue { + jsObject[Strings.getUniform]!(program.jsValue(), location.jsValue()).fromJSValue()! + } + + func getUniformLocation(program: WebGLProgram, name: String) -> WebGLUniformLocation? { + jsObject[Strings.getUniformLocation]!(program.jsValue(), name.jsValue()).fromJSValue()! + } + + func getVertexAttrib(index: GLuint, pname: GLenum) -> JSValue { + jsObject[Strings.getVertexAttrib]!(index.jsValue(), pname.jsValue()).fromJSValue()! + } + + func getVertexAttribOffset(index: GLuint, pname: GLenum) -> GLintptr { + jsObject[Strings.getVertexAttribOffset]!(index.jsValue(), pname.jsValue()).fromJSValue()! + } + + func hint(target: GLenum, mode: GLenum) { + _ = jsObject[Strings.hint]!(target.jsValue(), mode.jsValue()) + } + + func isBuffer(buffer: WebGLBuffer?) -> GLboolean { + jsObject[Strings.isBuffer]!(buffer.jsValue()).fromJSValue()! + } + + func isEnabled(cap: GLenum) -> GLboolean { + jsObject[Strings.isEnabled]!(cap.jsValue()).fromJSValue()! + } + + func isFramebuffer(framebuffer: WebGLFramebuffer?) -> GLboolean { + jsObject[Strings.isFramebuffer]!(framebuffer.jsValue()).fromJSValue()! + } + + func isProgram(program: WebGLProgram?) -> GLboolean { + jsObject[Strings.isProgram]!(program.jsValue()).fromJSValue()! + } + + func isRenderbuffer(renderbuffer: WebGLRenderbuffer?) -> GLboolean { + jsObject[Strings.isRenderbuffer]!(renderbuffer.jsValue()).fromJSValue()! + } + + func isShader(shader: WebGLShader?) -> GLboolean { + jsObject[Strings.isShader]!(shader.jsValue()).fromJSValue()! + } + + func isTexture(texture: WebGLTexture?) -> GLboolean { + jsObject[Strings.isTexture]!(texture.jsValue()).fromJSValue()! + } + + func lineWidth(width: GLfloat) { + _ = jsObject[Strings.lineWidth]!(width.jsValue()) + } + + func linkProgram(program: WebGLProgram) { + _ = jsObject[Strings.linkProgram]!(program.jsValue()) + } + + func pixelStorei(pname: GLenum, param: GLint) { + _ = jsObject[Strings.pixelStorei]!(pname.jsValue(), param.jsValue()) + } + + func polygonOffset(factor: GLfloat, units: GLfloat) { + _ = jsObject[Strings.polygonOffset]!(factor.jsValue(), units.jsValue()) + } + + func renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) { + _ = jsObject[Strings.renderbufferStorage]!(target.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()) + } + + func sampleCoverage(value: GLclampf, invert: GLboolean) { + _ = jsObject[Strings.sampleCoverage]!(value.jsValue(), invert.jsValue()) + } + + func scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + _ = jsObject[Strings.scissor]!(x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()) + } + + func shaderSource(shader: WebGLShader, source: String) { + _ = jsObject[Strings.shaderSource]!(shader.jsValue(), source.jsValue()) + } + + func stencilFunc(func: GLenum, ref: GLint, mask: GLuint) { + _ = jsObject[Strings.stencilFunc]!(`func`.jsValue(), ref.jsValue(), mask.jsValue()) + } + + func stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint) { + _ = jsObject[Strings.stencilFuncSeparate]!(face.jsValue(), `func`.jsValue(), ref.jsValue(), mask.jsValue()) + } + + func stencilMask(mask: GLuint) { + _ = jsObject[Strings.stencilMask]!(mask.jsValue()) + } + + func stencilMaskSeparate(face: GLenum, mask: GLuint) { + _ = jsObject[Strings.stencilMaskSeparate]!(face.jsValue(), mask.jsValue()) + } + + func stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) { + _ = jsObject[Strings.stencilOp]!(fail.jsValue(), zfail.jsValue(), zpass.jsValue()) + } + + func stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) { + _ = jsObject[Strings.stencilOpSeparate]!(face.jsValue(), fail.jsValue(), zfail.jsValue(), zpass.jsValue()) + } + + func texParameterf(target: GLenum, pname: GLenum, param: GLfloat) { + _ = jsObject[Strings.texParameterf]!(target.jsValue(), pname.jsValue(), param.jsValue()) + } + + func texParameteri(target: GLenum, pname: GLenum, param: GLint) { + _ = jsObject[Strings.texParameteri]!(target.jsValue(), pname.jsValue(), param.jsValue()) + } + + func uniform1f(location: WebGLUniformLocation?, x: GLfloat) { + _ = jsObject[Strings.uniform1f]!(location.jsValue(), x.jsValue()) + } + + func uniform2f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat) { + _ = jsObject[Strings.uniform2f]!(location.jsValue(), x.jsValue(), y.jsValue()) + } + + func uniform3f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat) { + _ = jsObject[Strings.uniform3f]!(location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue()) + } + + func uniform4f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { + _ = jsObject[Strings.uniform4f]!(location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + } + + func uniform1i(location: WebGLUniformLocation?, x: GLint) { + _ = jsObject[Strings.uniform1i]!(location.jsValue(), x.jsValue()) + } + + func uniform2i(location: WebGLUniformLocation?, x: GLint, y: GLint) { + _ = jsObject[Strings.uniform2i]!(location.jsValue(), x.jsValue(), y.jsValue()) + } + + func uniform3i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint) { + _ = jsObject[Strings.uniform3i]!(location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue()) + } + + func uniform4i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint, w: GLint) { + _ = jsObject[Strings.uniform4i]!(location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + } + + func useProgram(program: WebGLProgram?) { + _ = jsObject[Strings.useProgram]!(program.jsValue()) + } + + func validateProgram(program: WebGLProgram) { + _ = jsObject[Strings.validateProgram]!(program.jsValue()) + } + + func vertexAttrib1f(index: GLuint, x: GLfloat) { + _ = jsObject[Strings.vertexAttrib1f]!(index.jsValue(), x.jsValue()) + } + + func vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat) { + _ = jsObject[Strings.vertexAttrib2f]!(index.jsValue(), x.jsValue(), y.jsValue()) + } + + func vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) { + _ = jsObject[Strings.vertexAttrib3f]!(index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue()) + } + + func vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { + _ = jsObject[Strings.vertexAttrib4f]!(index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + } + + func vertexAttrib1fv(index: GLuint, values: Float32List) { + _ = jsObject[Strings.vertexAttrib1fv]!(index.jsValue(), values.jsValue()) + } + + func vertexAttrib2fv(index: GLuint, values: Float32List) { + _ = jsObject[Strings.vertexAttrib2fv]!(index.jsValue(), values.jsValue()) + } + + func vertexAttrib3fv(index: GLuint, values: Float32List) { + _ = jsObject[Strings.vertexAttrib3fv]!(index.jsValue(), values.jsValue()) + } + + func vertexAttrib4fv(index: GLuint, values: Float32List) { + _ = jsObject[Strings.vertexAttrib4fv]!(index.jsValue(), values.jsValue()) + } + + 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() + _ = jsObject[Strings.vertexAttribPointer]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + func viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + _ = jsObject[Strings.viewport]!(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..d4512bbb --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift @@ -0,0 +1,144 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol WebGLRenderingContextOverloads: JSBridgedClass {} +public extension WebGLRenderingContextOverloads { + func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { + _ = jsObject[Strings.bufferData]!(target.jsValue(), size.jsValue(), usage.jsValue()) + } + + func bufferData(target: GLenum, data: BufferSource?, usage: GLenum) { + _ = jsObject[Strings.bufferData]!(target.jsValue(), data.jsValue(), usage.jsValue()) + } + + func bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource) { + _ = jsObject[Strings.bufferSubData]!(target.jsValue(), offset.jsValue(), data.jsValue()) + } + + 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() + _ = jsObject[Strings.compressedTexImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + } + + 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() + _ = jsObject[Strings.compressedTexSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + } + + 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() + _ = jsObject[Strings.readPixels]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + } + + 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() + _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + 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() + _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + } + + 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() + _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + } + + 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() + _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + } + + func uniform1fv(location: WebGLUniformLocation?, v: Float32List) { + _ = jsObject[Strings.uniform1fv]!(location.jsValue(), v.jsValue()) + } + + func uniform2fv(location: WebGLUniformLocation?, v: Float32List) { + _ = jsObject[Strings.uniform2fv]!(location.jsValue(), v.jsValue()) + } + + func uniform3fv(location: WebGLUniformLocation?, v: Float32List) { + _ = jsObject[Strings.uniform3fv]!(location.jsValue(), v.jsValue()) + } + + func uniform4fv(location: WebGLUniformLocation?, v: Float32List) { + _ = jsObject[Strings.uniform4fv]!(location.jsValue(), v.jsValue()) + } + + func uniform1iv(location: WebGLUniformLocation?, v: Int32List) { + _ = jsObject[Strings.uniform1iv]!(location.jsValue(), v.jsValue()) + } + + func uniform2iv(location: WebGLUniformLocation?, v: Int32List) { + _ = jsObject[Strings.uniform2iv]!(location.jsValue(), v.jsValue()) + } + + func uniform3iv(location: WebGLUniformLocation?, v: Int32List) { + _ = jsObject[Strings.uniform3iv]!(location.jsValue(), v.jsValue()) + } + + func uniform4iv(location: WebGLUniformLocation?, v: Int32List) { + _ = jsObject[Strings.uniform4iv]!(location.jsValue(), v.jsValue()) + } + + func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + _ = jsObject[Strings.uniformMatrix2fv]!(location.jsValue(), transpose.jsValue(), value.jsValue()) + } + + func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + _ = jsObject[Strings.uniformMatrix3fv]!(location.jsValue(), transpose.jsValue(), value.jsValue()) + } + + func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + _ = jsObject[Strings.uniformMatrix4fv]!(location.jsValue(), transpose.jsValue(), value.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLSampler.swift b/Sources/DOMKit/WebIDL/WebGLSampler.swift new file mode 100644 index 00000000..74c9c22a --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLSampler.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLSampler: WebGLObject { + override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSampler].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLShader.swift b/Sources/DOMKit/WebIDL/WebGLShader.swift new file mode 100644 index 00000000..2d41208f --- /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 { + 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..45663ba6 --- /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 { + 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/WebGLSync.swift b/Sources/DOMKit/WebIDL/WebGLSync.swift new file mode 100644 index 00000000..3208a1ac --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLSync.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLSync: WebGLObject { + override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSync].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLTexture.swift b/Sources/DOMKit/WebIDL/WebGLTexture.swift new file mode 100644 index 00000000..050b4385 --- /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 { + 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/WebGLTimerQueryEXT.swift b/Sources/DOMKit/WebIDL/WebGLTimerQueryEXT.swift new file mode 100644 index 00000000..1ecad79e --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLTimerQueryEXT.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLTimerQueryEXT: WebGLObject { + override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTimerQueryEXT].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift b/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift new file mode 100644 index 00000000..b37734f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLTransformFeedback: WebGLObject { + override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTransformFeedback].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..75948c14 --- /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 { + 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/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift b/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift new file mode 100644 index 00000000..8c667d5b --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLVertexArrayObject: WebGLObject { + override public class var constructor: JSFunction { JSObject.global[Strings.WebGLVertexArrayObject].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift b/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift new file mode 100644 index 00000000..c14384b7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLVertexArrayObjectOES: WebGLObject { + override public class var constructor: JSFunction { JSObject.global[Strings.WebGLVertexArrayObjectOES].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebSocket.swift b/Sources/DOMKit/WebIDL/WebSocket.swift new file mode 100644 index 00000000..0706f117 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebSocket.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebSocket: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.WebSocket].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _bufferedAmount = ReadonlyAttribute(jsObject: jsObject, name: Strings.bufferedAmount) + _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onopen) + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) + _extensions = ReadonlyAttribute(jsObject: jsObject, name: Strings.extensions) + _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) + _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(url: String, protocols: __UNSUPPORTED_UNION__? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), protocols?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var url: String + + public static let CONNECTING: UInt16 = 0 + + public static let OPEN: UInt16 = 1 + + public static let CLOSING: UInt16 = 2 + + public static let CLOSED: UInt16 = 3 + + @ReadonlyAttribute + public var readyState: UInt16 + + @ReadonlyAttribute + public var bufferedAmount: UInt64 + + @ClosureAttribute.Optional1 + public var onopen: EventHandler + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onclose: EventHandler + + @ReadonlyAttribute + public var extensions: String + + @ReadonlyAttribute + public var `protocol`: String + + public func close(code: UInt16? = nil, reason: String? = nil) { + _ = jsObject[Strings.close]!(code?.jsValue() ?? .undefined, reason?.jsValue() ?? .undefined) + } + + @ClosureAttribute.Optional1 + public var onmessage: EventHandler + + @ReadWriteAttribute + public var binaryType: BinaryType + + public func send(data: __UNSUPPORTED_UNION__) { + _ = jsObject[Strings.send]!(data.jsValue()) + } +} diff --git a/Sources/DOMKit/WebIDL/WebTransport.swift b/Sources/DOMKit/WebIDL/WebTransport.swift new file mode 100644 index 00000000..5747cd65 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransport.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebTransport: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WebTransport].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) + _closed = ReadonlyAttribute(jsObject: jsObject, name: Strings.closed) + _datagrams = ReadonlyAttribute(jsObject: jsObject, name: Strings.datagrams) + _incomingBidirectionalStreams = ReadonlyAttribute(jsObject: jsObject, name: Strings.incomingBidirectionalStreams) + _incomingUnidirectionalStreams = ReadonlyAttribute(jsObject: jsObject, name: Strings.incomingUnidirectionalStreams) + self.jsObject = jsObject + } + + public convenience init(url: String, options: WebTransportOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), options?.jsValue() ?? .undefined)) + } + + public func getStats() -> JSPromise { + jsObject[Strings.getStats]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getStats() async throws -> WebTransportStats { + let _promise: JSPromise = jsObject[Strings.getStats]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var ready: JSPromise + + @ReadonlyAttribute + public var closed: JSPromise + + public func close(closeInfo: WebTransportCloseInfo? = nil) { + _ = jsObject[Strings.close]!(closeInfo?.jsValue() ?? .undefined) + } + + @ReadonlyAttribute + public var datagrams: WebTransportDatagramDuplexStream + + public func createBidirectionalStream() -> JSPromise { + jsObject[Strings.createBidirectionalStream]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createBidirectionalStream() async throws -> WebTransportBidirectionalStream { + let _promise: JSPromise = jsObject[Strings.createBidirectionalStream]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var incomingBidirectionalStreams: ReadableStream + + public func createUnidirectionalStream() -> JSPromise { + jsObject[Strings.createUnidirectionalStream]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createUnidirectionalStream() async throws -> WritableStream { + let _promise: JSPromise = jsObject[Strings.createUnidirectionalStream]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var incomingUnidirectionalStreams: ReadableStream +} diff --git a/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift b/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift new file mode 100644 index 00000000..d4f351a0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebTransportBidirectionalStream: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WebTransportBidirectionalStream].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 + } + + @ReadonlyAttribute + public var readable: ReadableStream + + @ReadonlyAttribute + public var writable: WritableStream +} diff --git a/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift b/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift new file mode 100644 index 00000000..fcede81d --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebTransportCloseInfo: BridgedDictionary { + public convenience init(closeCode: UInt32, reason: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.closeCode] = closeCode.jsValue() + object[Strings.reason] = reason.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _closeCode = ReadWriteAttribute(jsObject: object, name: Strings.closeCode) + _reason = ReadWriteAttribute(jsObject: object, name: Strings.reason) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var closeCode: UInt32 + + @ReadWriteAttribute + public var reason: String +} diff --git a/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift b/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift new file mode 100644 index 00000000..a3908148 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebTransportDatagramDuplexStream: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WebTransportDatagramDuplexStream].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) + _maxDatagramSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxDatagramSize) + _incomingMaxAge = ReadWriteAttribute(jsObject: jsObject, name: Strings.incomingMaxAge) + _outgoingMaxAge = ReadWriteAttribute(jsObject: jsObject, name: Strings.outgoingMaxAge) + _incomingHighWaterMark = ReadWriteAttribute(jsObject: jsObject, name: Strings.incomingHighWaterMark) + _outgoingHighWaterMark = ReadWriteAttribute(jsObject: jsObject, name: Strings.outgoingHighWaterMark) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var readable: ReadableStream + + @ReadonlyAttribute + public var writable: WritableStream + + @ReadonlyAttribute + public var maxDatagramSize: UInt32 + + @ReadWriteAttribute + public var incomingMaxAge: Double? + + @ReadWriteAttribute + public var outgoingMaxAge: Double? + + @ReadWriteAttribute + public var incomingHighWaterMark: Int32 + + @ReadWriteAttribute + public var outgoingHighWaterMark: Int32 +} diff --git a/Sources/DOMKit/WebIDL/WebTransportError.swift b/Sources/DOMKit/WebIDL/WebTransportError.swift new file mode 100644 index 00000000..0f0cbcdf --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransportError.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebTransportError: DOMException { + override public class var constructor: JSFunction { JSObject.global[Strings.WebTransportError].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) + _streamErrorCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.streamErrorCode) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(init: WebTransportErrorInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var source: WebTransportErrorSource + + @ReadonlyAttribute + public var streamErrorCode: UInt8? +} diff --git a/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift b/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift new file mode 100644 index 00000000..2a71f0f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebTransportErrorInit: BridgedDictionary { + public convenience init(streamErrorCode: UInt8, message: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.streamErrorCode] = streamErrorCode.jsValue() + object[Strings.message] = message.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _streamErrorCode = ReadWriteAttribute(jsObject: object, name: Strings.streamErrorCode) + _message = ReadWriteAttribute(jsObject: object, name: Strings.message) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var streamErrorCode: UInt8 + + @ReadWriteAttribute + public var message: String +} diff --git a/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift b/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift new file mode 100644 index 00000000..14ac3025 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum WebTransportErrorSource: JSString, JSValueCompatible { + case stream = "stream" + case session = "session" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/WebTransportHash.swift b/Sources/DOMKit/WebIDL/WebTransportHash.swift new file mode 100644 index 00000000..2ed984ae --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransportHash.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebTransportHash: BridgedDictionary { + public convenience init(algorithm: String, value: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.algorithm] = algorithm.jsValue() + object[Strings.value] = value.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _algorithm = ReadWriteAttribute(jsObject: object, name: Strings.algorithm) + _value = ReadWriteAttribute(jsObject: object, name: Strings.value) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var algorithm: String + + @ReadWriteAttribute + public var value: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/WebTransportOptions.swift b/Sources/DOMKit/WebIDL/WebTransportOptions.swift new file mode 100644 index 00000000..9eb6d3c1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransportOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebTransportOptions: BridgedDictionary { + public convenience init(allowPooling: Bool, serverCertificateHashes: [WebTransportHash]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.allowPooling] = allowPooling.jsValue() + object[Strings.serverCertificateHashes] = serverCertificateHashes.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _allowPooling = ReadWriteAttribute(jsObject: object, name: Strings.allowPooling) + _serverCertificateHashes = ReadWriteAttribute(jsObject: object, name: Strings.serverCertificateHashes) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var allowPooling: Bool + + @ReadWriteAttribute + public var serverCertificateHashes: [WebTransportHash] +} diff --git a/Sources/DOMKit/WebIDL/WebTransportStats.swift b/Sources/DOMKit/WebIDL/WebTransportStats.swift new file mode 100644 index 00000000..4b5c34ae --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebTransportStats.swift @@ -0,0 +1,75 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebTransportStats: BridgedDictionary { + public convenience init(timestamp: DOMHighResTimeStamp, bytesSent: UInt64, packetsSent: UInt64, packetsLost: UInt64, numOutgoingStreamsCreated: UInt32, numIncomingStreamsCreated: UInt32, bytesReceived: UInt64, packetsReceived: UInt64, smoothedRtt: DOMHighResTimeStamp, rttVariation: DOMHighResTimeStamp, minRtt: DOMHighResTimeStamp, numReceivedDatagramsDropped: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.timestamp] = timestamp.jsValue() + object[Strings.bytesSent] = bytesSent.jsValue() + object[Strings.packetsSent] = packetsSent.jsValue() + object[Strings.packetsLost] = packetsLost.jsValue() + object[Strings.numOutgoingStreamsCreated] = numOutgoingStreamsCreated.jsValue() + object[Strings.numIncomingStreamsCreated] = numIncomingStreamsCreated.jsValue() + object[Strings.bytesReceived] = bytesReceived.jsValue() + object[Strings.packetsReceived] = packetsReceived.jsValue() + object[Strings.smoothedRtt] = smoothedRtt.jsValue() + object[Strings.rttVariation] = rttVariation.jsValue() + object[Strings.minRtt] = minRtt.jsValue() + object[Strings.numReceivedDatagramsDropped] = numReceivedDatagramsDropped.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) + _packetsSent = ReadWriteAttribute(jsObject: object, name: Strings.packetsSent) + _packetsLost = ReadWriteAttribute(jsObject: object, name: Strings.packetsLost) + _numOutgoingStreamsCreated = ReadWriteAttribute(jsObject: object, name: Strings.numOutgoingStreamsCreated) + _numIncomingStreamsCreated = ReadWriteAttribute(jsObject: object, name: Strings.numIncomingStreamsCreated) + _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) + _packetsReceived = ReadWriteAttribute(jsObject: object, name: Strings.packetsReceived) + _smoothedRtt = ReadWriteAttribute(jsObject: object, name: Strings.smoothedRtt) + _rttVariation = ReadWriteAttribute(jsObject: object, name: Strings.rttVariation) + _minRtt = ReadWriteAttribute(jsObject: object, name: Strings.minRtt) + _numReceivedDatagramsDropped = ReadWriteAttribute(jsObject: object, name: Strings.numReceivedDatagramsDropped) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var timestamp: DOMHighResTimeStamp + + @ReadWriteAttribute + public var bytesSent: UInt64 + + @ReadWriteAttribute + public var packetsSent: UInt64 + + @ReadWriteAttribute + public var packetsLost: UInt64 + + @ReadWriteAttribute + public var numOutgoingStreamsCreated: UInt32 + + @ReadWriteAttribute + public var numIncomingStreamsCreated: UInt32 + + @ReadWriteAttribute + public var bytesReceived: UInt64 + + @ReadWriteAttribute + public var packetsReceived: UInt64 + + @ReadWriteAttribute + public var smoothedRtt: DOMHighResTimeStamp + + @ReadWriteAttribute + public var rttVariation: DOMHighResTimeStamp + + @ReadWriteAttribute + public var minRtt: DOMHighResTimeStamp + + @ReadWriteAttribute + public var numReceivedDatagramsDropped: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/WellKnownDirectory.swift b/Sources/DOMKit/WebIDL/WellKnownDirectory.swift new file mode 100644 index 00000000..31fda146 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WellKnownDirectory.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum WellKnownDirectory: JSString, JSValueCompatible { + case desktop = "desktop" + case documents = "documents" + case downloads = "downloads" + case music = "music" + case pictures = "pictures" + case videos = "videos" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/WheelEvent.swift b/Sources/DOMKit/WebIDL/WheelEvent.swift index a9f93b3c..4e22ef59 100644 --- a/Sources/DOMKit/WebIDL/WheelEvent.swift +++ b/Sources/DOMKit/WebIDL/WheelEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WheelEvent: MouseEvent { - override public class var constructor: JSFunction { JSObject.global.WheelEvent.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.WheelEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _deltaX = ReadonlyAttribute(jsObject: jsObject, name: Strings.deltaX) diff --git a/Sources/DOMKit/WebIDL/WheelEventInit.swift b/Sources/DOMKit/WebIDL/WheelEventInit.swift index 5d0ea665..e27237ae 100644 --- a/Sources/DOMKit/WebIDL/WheelEventInit.swift +++ b/Sources/DOMKit/WebIDL/WheelEventInit.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class WheelEventInit: BridgedDictionary { public convenience init(deltaX: Double, deltaY: Double, deltaZ: Double, deltaMode: UInt32) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.deltaX] = deltaX.jsValue() object[Strings.deltaY] = deltaY.jsValue() object[Strings.deltaZ] = deltaZ.jsValue() diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 3944100d..49b56fe6 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -4,10 +4,33 @@ import JavaScriptEventLoop import JavaScriptKit public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, WindowOrWorkerGlobalScope, AnimationFrameProvider, WindowSessionStorage, WindowLocalStorage { - override public class var constructor: JSFunction { JSObject.global.Window.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.Window].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) + _onorientationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onorientationchange) + _speechSynthesis = ReadonlyAttribute(jsObject: jsObject, name: Strings.speechSynthesis) + _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) _event = ReadonlyAttribute(jsObject: jsObject, name: Strings.event) + _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) + _onappinstalled = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onappinstalled) + _onbeforeinstallprompt = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbeforeinstallprompt) + _screen = ReadonlyAttribute(jsObject: jsObject, name: Strings.screen) + _innerWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.innerWidth) + _innerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.innerHeight) + _scrollX = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollX) + _pageXOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageXOffset) + _scrollY = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollY) + _pageYOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageYOffset) + _screenX = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenX) + _screenLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenLeft) + _screenY = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenY) + _screenTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenTop) + _outerWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.outerWidth) + _outerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.outerHeight) + _devicePixelRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePixelRatio) + _attributionReporting = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributionReporting) + _visualViewport = ReadonlyAttribute(jsObject: jsObject, name: Strings.visualViewport) _window = ReadonlyAttribute(jsObject: jsObject, name: Strings.window) _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) _document = ReadonlyAttribute(jsObject: jsObject, name: Strings.document) @@ -33,12 +56,182 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind _clientInformation = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientInformation) _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: Strings.originAgentCluster) _external = ReadonlyAttribute(jsObject: jsObject, name: Strings.external) + _portalHost = ReadonlyAttribute(jsObject: jsObject, name: Strings.portalHost) + _ondeviceorientation = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientation) + _ondeviceorientationabsolute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientationabsolute) + _oncompassneedscalibration = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompassneedscalibration) + _ondevicemotion = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicemotion) super.init(unsafelyWrapping: jsObject) } + public func requestIdleCallback(callback: IdleRequestCallback, options: IdleRequestOptions? = nil) -> UInt32 { + jsObject[Strings.requestIdleCallback]!(callback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func cancelIdleCallback(handle: UInt32) { + _ = jsObject[Strings.cancelIdleCallback]!(handle.jsValue()) + } + + @ReadonlyAttribute + public var orientation: Int16 + + @ClosureAttribute.Optional1 + public var onorientationchange: EventHandler + + @ReadonlyAttribute + public var speechSynthesis: SpeechSynthesis + + @ReadonlyAttribute + public var cookieStore: CookieStore + @ReadonlyAttribute public var event: __UNSUPPORTED_UNION__ + @ReadonlyAttribute + public var navigation: Navigation + + @ClosureAttribute.Optional1 + public var onappinstalled: EventHandler + + @ClosureAttribute.Optional1 + public var onbeforeinstallprompt: EventHandler + + public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { + jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { + let _promise: JSPromise = jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { + jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { + let _promise: JSPromise = jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { + jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { + let _promise: JSPromise = jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func matchMedia(query: String) -> MediaQueryList { + jsObject[Strings.matchMedia]!(query.jsValue()).fromJSValue()! + } + + @ReadonlyAttribute + public var screen: Screen + + public func moveTo(x: Int32, y: Int32) { + _ = jsObject[Strings.moveTo]!(x.jsValue(), y.jsValue()) + } + + public func moveBy(x: Int32, y: Int32) { + _ = jsObject[Strings.moveBy]!(x.jsValue(), y.jsValue()) + } + + public func resizeTo(width: Int32, height: Int32) { + _ = jsObject[Strings.resizeTo]!(width.jsValue(), height.jsValue()) + } + + public func resizeBy(x: Int32, y: Int32) { + _ = jsObject[Strings.resizeBy]!(x.jsValue(), y.jsValue()) + } + + @ReadonlyAttribute + public var innerWidth: Int32 + + @ReadonlyAttribute + public var innerHeight: Int32 + + @ReadonlyAttribute + public var scrollX: Double + + @ReadonlyAttribute + public var pageXOffset: Double + + @ReadonlyAttribute + public var scrollY: Double + + @ReadonlyAttribute + public var pageYOffset: Double + + public func scroll(options: ScrollToOptions? = nil) { + _ = jsObject[Strings.scroll]!(options?.jsValue() ?? .undefined) + } + + public func scroll(x: Double, y: Double) { + _ = jsObject[Strings.scroll]!(x.jsValue(), y.jsValue()) + } + + public func scrollTo(options: ScrollToOptions? = nil) { + _ = jsObject[Strings.scrollTo]!(options?.jsValue() ?? .undefined) + } + + public func scrollTo(x: Double, y: Double) { + _ = jsObject[Strings.scrollTo]!(x.jsValue(), y.jsValue()) + } + + public func scrollBy(options: ScrollToOptions? = nil) { + _ = jsObject[Strings.scrollBy]!(options?.jsValue() ?? .undefined) + } + + public func scrollBy(x: Double, y: Double) { + _ = jsObject[Strings.scrollBy]!(x.jsValue(), y.jsValue()) + } + + @ReadonlyAttribute + public var screenX: Int32 + + @ReadonlyAttribute + public var screenLeft: Int32 + + @ReadonlyAttribute + public var screenY: Int32 + + @ReadonlyAttribute + public var screenTop: Int32 + + @ReadonlyAttribute + public var outerWidth: Int32 + + @ReadonlyAttribute + public var outerHeight: Int32 + + @ReadonlyAttribute + public var devicePixelRatio: Double + + @ReadonlyAttribute + public var attributionReporting: AttributionReporting + + public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { + jsObject[Strings.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var visualViewport: VisualViewport + + public func getDigitalGoodsService(serviceProvider: String) -> JSPromise { + jsObject[Strings.getDigitalGoodsService]!(serviceProvider.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDigitalGoodsService(serviceProvider: String) async throws -> DigitalGoodsService { + let _promise: JSPromise = jsObject[Strings.getDigitalGoodsService]!(serviceProvider.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + @ReadonlyAttribute public var window: WindowProxy @@ -174,7 +367,26 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var external: External - public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { - jsObject[Strings.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! + @ReadonlyAttribute + public var portalHost: PortalHost? + + @ClosureAttribute.Optional1 + public var ondeviceorientation: EventHandler + + @ClosureAttribute.Optional1 + public var ondeviceorientationabsolute: EventHandler + + @ClosureAttribute.Optional1 + public var oncompassneedscalibration: EventHandler + + @ClosureAttribute.Optional1 + public var ondevicemotion: EventHandler + + public func getSelection() -> Selection? { + jsObject[Strings.getSelection]!().fromJSValue()! + } + + public func navigate(dir: SpatialNavigationDirection) { + _ = jsObject[Strings.navigate]!(dir.jsValue()) } } diff --git a/Sources/DOMKit/WebIDL/WindowClient.swift b/Sources/DOMKit/WebIDL/WindowClient.swift new file mode 100644 index 00000000..a73fb758 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WindowClient.swift @@ -0,0 +1,44 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WindowClient: Client { + override public class var constructor: JSFunction { JSObject.global[Strings.WindowClient].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibilityState) + _focused = ReadonlyAttribute(jsObject: jsObject, name: Strings.focused) + _ancestorOrigins = ReadonlyAttribute(jsObject: jsObject, name: Strings.ancestorOrigins) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var visibilityState: DocumentVisibilityState + + @ReadonlyAttribute + public var focused: Bool + + @ReadonlyAttribute + public var ancestorOrigins: [String] + + public func focus() -> JSPromise { + jsObject[Strings.focus]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func focus() async throws -> WindowClient { + let _promise: JSPromise = jsObject[Strings.focus]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func navigate(url: String) -> JSPromise { + jsObject[Strings.navigate]!(url.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func navigate(url: String) async throws -> WindowClient? { + let _promise: JSPromise = jsObject[Strings.navigate]!(url.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift new file mode 100644 index 00000000..604689e3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WindowControlsOverlay: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.WindowControlsOverlay].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _visible = ReadonlyAttribute(jsObject: jsObject, name: Strings.visible) + _ongeometrychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ongeometrychange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var visible: Bool + + public func getTitlebarAreaRect() -> DOMRect { + jsObject[Strings.getTitlebarAreaRect]!().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var ongeometrychange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift new file mode 100644 index 00000000..13e67555 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WindowControlsOverlayGeometryChangeEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.WindowControlsOverlayGeometryChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _titlebarAreaRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.titlebarAreaRect) + _visible = ReadonlyAttribute(jsObject: jsObject, name: Strings.visible) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: WindowControlsOverlayGeometryChangeEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var titlebarAreaRect: DOMRect + + @ReadonlyAttribute + public var visible: Bool +} diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift new file mode 100644 index 00000000..2a4a9840 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WindowControlsOverlayGeometryChangeEventInit: BridgedDictionary { + public convenience init(titlebarAreaRect: DOMRect, visible: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.titlebarAreaRect] = titlebarAreaRect.jsValue() + object[Strings.visible] = visible.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _titlebarAreaRect = ReadWriteAttribute(jsObject: object, name: Strings.titlebarAreaRect) + _visible = ReadWriteAttribute(jsObject: object, name: Strings.visible) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var titlebarAreaRect: DOMRect + + @ReadWriteAttribute + public var visible: Bool +} diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index d3da4258..316a34ac 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -84,4 +84,19 @@ public extension WindowEventHandlers { get { ClosureAttribute.Optional1[Strings.onunload, in: jsObject] } set { ClosureAttribute.Optional1[Strings.onunload, in: jsObject] = newValue } } + + var onportalactivate: EventHandler { + get { ClosureAttribute.Optional1[Strings.onportalactivate, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onportalactivate, in: jsObject] = newValue } + } + + var ongamepadconnected: EventHandler { + get { ClosureAttribute.Optional1[Strings.ongamepadconnected, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ongamepadconnected, in: jsObject] = newValue } + } + + var ongamepaddisconnected: EventHandler { + get { ClosureAttribute.Optional1[Strings.ongamepaddisconnected, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ongamepaddisconnected, in: jsObject] = newValue } + } } diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index 3c7f9f8f..bfb91310 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -5,8 +5,28 @@ import JavaScriptKit public protocol WindowOrWorkerGlobalScope: JSBridgedClass {} public extension WindowOrWorkerGlobalScope { + func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { + jsObject[Strings.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func fetch(input: RequestInfo, init: RequestInit? = nil) async throws -> Response { + let _promise: JSPromise = jsObject[Strings.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + var trustedTypes: TrustedTypePolicyFactory { ReadonlyAttribute[Strings.trustedTypes, in: jsObject] } + + var originPolicyIds: [String] { ReadonlyAttribute[Strings.originPolicyIds, in: jsObject] } + var performance: Performance { ReadonlyAttribute[Strings.performance, in: jsObject] } + var crypto: Crypto { ReadonlyAttribute[Strings.crypto, in: jsObject] } + + var caches: CacheStorage { ReadonlyAttribute[Strings.caches, in: jsObject] } + + var indexedDB: IDBFactory { ReadonlyAttribute[Strings.indexedDB, in: jsObject] } + var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } var isSecureContext: Bool { ReadonlyAttribute[Strings.isSecureContext, in: jsObject] } @@ -79,13 +99,5 @@ public extension WindowOrWorkerGlobalScope { jsObject[Strings.structuredClone]!(value.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } - func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { - jsObject[Strings.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func fetch(input: RequestInfo, init: RequestInit? = nil) async throws -> Response { - let _promise: JSPromise = jsObject[Strings.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + var scheduler: Scheduler { ReadonlyAttribute[Strings.scheduler, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift index 8f7c420d..fb328d2b 100644 --- a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift +++ b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class WindowPostMessageOptions: BridgedDictionary { public convenience init(targetOrigin: String) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.targetOrigin] = targetOrigin.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index e05166ac..559dd24e 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Worker: EventTarget, AbstractWorker { - override public class var constructor: JSFunction { JSObject.global.Worker.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.Worker].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index fdcecbb0..f93d024c 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -3,8 +3,8 @@ import JavaScriptEventLoop import JavaScriptKit -public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope { - override public class var constructor: JSFunction { JSObject.global.WorkerGlobalScope.function! } +public class WorkerGlobalScope: EventTarget, FontFaceSource, WindowOrWorkerGlobalScope { + override public class var constructor: JSFunction { JSObject.global[Strings.WorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) diff --git a/Sources/DOMKit/WebIDL/WorkerLocation.swift b/Sources/DOMKit/WebIDL/WorkerLocation.swift index ac8aa25b..4006e45d 100644 --- a/Sources/DOMKit/WebIDL/WorkerLocation.swift +++ b/Sources/DOMKit/WebIDL/WorkerLocation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkerLocation: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.WorkerLocation.function! } + public class var constructor: JSFunction { JSObject.global[Strings.WorkerLocation].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WorkerNavigator.swift b/Sources/DOMKit/WebIDL/WorkerNavigator.swift index 3f859040..552c936d 100644 --- a/Sources/DOMKit/WebIDL/WorkerNavigator.swift +++ b/Sources/DOMKit/WebIDL/WorkerNavigator.swift @@ -3,12 +3,32 @@ import JavaScriptEventLoop import JavaScriptKit -public class WorkerNavigator: JSBridgedClass, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware { - public class var constructor: JSFunction { JSObject.global.WorkerNavigator.function! } +public class WorkerNavigator: JSBridgedClass, NavigatorStorage, NavigatorDeviceMemory, NavigatorNetworkInformation, NavigatorML, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware, NavigatorUA, NavigatorGPU, NavigatorBadge, NavigatorLocks { + public class var constructor: JSFunction { JSObject.global[Strings.WorkerNavigator].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) + _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) + _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) + _serial = ReadonlyAttribute(jsObject: jsObject, name: Strings.serial) + _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) self.jsObject = jsObject } + + @ReadonlyAttribute + public var permissions: Permissions + + @ReadonlyAttribute + public var serviceWorker: ServiceWorkerContainer + + @ReadonlyAttribute + public var usb: USB + + @ReadonlyAttribute + public var serial: Serial + + @ReadonlyAttribute + public var mediaCapabilities: MediaCapabilities } diff --git a/Sources/DOMKit/WebIDL/WorkerOptions.swift b/Sources/DOMKit/WebIDL/WorkerOptions.swift index 547ac4db..75157849 100644 --- a/Sources/DOMKit/WebIDL/WorkerOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkerOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class WorkerOptions: BridgedDictionary { public convenience init(type: WorkerType, credentials: RequestCredentials, name: String) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.type] = type.jsValue() object[Strings.credentials] = credentials.jsValue() object[Strings.name] = name.jsValue() diff --git a/Sources/DOMKit/WebIDL/Worklet.swift b/Sources/DOMKit/WebIDL/Worklet.swift index c45fc7bf..abff847d 100644 --- a/Sources/DOMKit/WebIDL/Worklet.swift +++ b/Sources/DOMKit/WebIDL/Worklet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Worklet: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.Worklet.function! } + public class var constructor: JSFunction { JSObject.global[Strings.Worklet].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WorkletAnimation.swift b/Sources/DOMKit/WebIDL/WorkletAnimation.swift new file mode 100644 index 00000000..d3ec2ec7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkletAnimation.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WorkletAnimation: Animation { + override public class var constructor: JSFunction { JSObject.global[Strings.WorkletAnimation].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _animatorName = ReadonlyAttribute(jsObject: jsObject, name: Strings.animatorName) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(animatorName: String, effects: __UNSUPPORTED_UNION__? = nil, timeline: AnimationTimeline? = nil, options: JSValue? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(animatorName.jsValue(), effects?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var animatorName: String +} diff --git a/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift b/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift new file mode 100644 index 00000000..a09be43d --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WorkletAnimationEffect: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WorkletAnimationEffect].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _localTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.localTime) + self.jsObject = jsObject + } + + public func getTiming() -> EffectTiming { + jsObject[Strings.getTiming]!().fromJSValue()! + } + + public func getComputedTiming() -> ComputedEffectTiming { + jsObject[Strings.getComputedTiming]!().fromJSValue()! + } + + @ReadWriteAttribute + public var localTime: Double? +} diff --git a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift index 1deddd8d..59a0339a 100644 --- a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkletGlobalScope: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.WorkletGlobalScope.function! } + public class var constructor: JSFunction { JSObject.global[Strings.WorkletGlobalScope].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift b/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift new file mode 100644 index 00000000..7b93d712 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WorkletGroupEffect: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.WorkletGroupEffect].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func getChildren() -> [WorkletAnimationEffect] { + jsObject[Strings.getChildren]!().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/WorkletOptions.swift b/Sources/DOMKit/WebIDL/WorkletOptions.swift index 838dc1f0..b188889f 100644 --- a/Sources/DOMKit/WebIDL/WorkletOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkletOptions.swift @@ -5,7 +5,7 @@ import JavaScriptKit public class WorkletOptions: BridgedDictionary { public convenience init(credentials: RequestCredentials) { - let object = JSObject.global.Object.function!.new() + let object = JSObject.global[Strings.Object].function!.new() object[Strings.credentials] = credentials.jsValue() self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift index 02ccf7cf..578e6a8d 100644 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WritableStream: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.WritableStream.function! } + public class var constructor: JSFunction { JSObject.global[Strings.WritableStream].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift index 57780c2f..e1b6dbe7 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WritableStreamDefaultController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.WritableStreamDefaultController.function! } + public class var constructor: JSFunction { JSObject.global[Strings.WritableStreamDefaultController].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift index 240861f0..d718565e 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WritableStreamDefaultWriter: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.WritableStreamDefaultWriter.function! } + public class var constructor: JSFunction { JSObject.global[Strings.WritableStreamDefaultWriter].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WriteCommandType.swift b/Sources/DOMKit/WebIDL/WriteCommandType.swift new file mode 100644 index 00000000..ac9d4462 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WriteCommandType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum WriteCommandType: JSString, JSValueCompatible { + case write = "write" + case seek = "seek" + case truncate = "truncate" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/WriteParams.swift b/Sources/DOMKit/WebIDL/WriteParams.swift new file mode 100644 index 00000000..7d75164b --- /dev/null +++ b/Sources/DOMKit/WebIDL/WriteParams.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WriteParams: BridgedDictionary { + public convenience init(type: WriteCommandType, size: UInt64?, position: UInt64?, data: __UNSUPPORTED_UNION__?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + object[Strings.size] = size.jsValue() + object[Strings.position] = position.jsValue() + object[Strings.data] = data.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _size = ReadWriteAttribute(jsObject: object, name: Strings.size) + _position = ReadWriteAttribute(jsObject: object, name: Strings.position) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: WriteCommandType + + @ReadWriteAttribute + public var size: UInt64? + + @ReadWriteAttribute + public var position: UInt64? + + @ReadWriteAttribute + public var data: __UNSUPPORTED_UNION__? +} diff --git a/Sources/DOMKit/WebIDL/XMLDocument.swift b/Sources/DOMKit/WebIDL/XMLDocument.swift index acb045e7..4b90ce5e 100644 --- a/Sources/DOMKit/WebIDL/XMLDocument.swift +++ b/Sources/DOMKit/WebIDL/XMLDocument.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XMLDocument: Document { - override public class var constructor: JSFunction { JSObject.global.XMLDocument.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.XMLDocument].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index f96f71b4..dec13ef4 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XMLHttpRequest: XMLHttpRequestEventTarget { - override public class var constructor: JSFunction { JSObject.global.XMLHttpRequest.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequest].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreadystatechange) diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift index cc05ab7b..31a46b8a 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XMLHttpRequestEventTarget: EventTarget { - override public class var constructor: JSFunction { JSObject.global.XMLHttpRequestEventTarget.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequestEventTarget].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadstart) diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift index dfd38b44..324401df 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XMLHttpRequestUpload: XMLHttpRequestEventTarget { - override public class var constructor: JSFunction { JSObject.global.XMLHttpRequestUpload.function! } + override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequestUpload].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/XMLSerializer.swift b/Sources/DOMKit/WebIDL/XMLSerializer.swift new file mode 100644 index 00000000..e49dcf4a --- /dev/null +++ b/Sources/DOMKit/WebIDL/XMLSerializer.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XMLSerializer: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XMLSerializer].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + public func serializeToString(root: Node) -> String { + jsObject[Strings.serializeToString]!(root.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XPathEvaluator.swift b/Sources/DOMKit/WebIDL/XPathEvaluator.swift index 98be6b9d..bf8664f3 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluator.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluator.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XPathEvaluator: JSBridgedClass, XPathEvaluatorBase { - public class var constructor: JSFunction { JSObject.global.XPathEvaluator.function! } + public class var constructor: JSFunction { JSObject.global[Strings.XPathEvaluator].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XPathExpression.swift b/Sources/DOMKit/WebIDL/XPathExpression.swift index 02c0faab..ee2ca76f 100644 --- a/Sources/DOMKit/WebIDL/XPathExpression.swift +++ b/Sources/DOMKit/WebIDL/XPathExpression.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XPathExpression: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.XPathExpression.function! } + public class var constructor: JSFunction { JSObject.global[Strings.XPathExpression].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XPathResult.swift b/Sources/DOMKit/WebIDL/XPathResult.swift index dc0c6b17..a8626b0d 100644 --- a/Sources/DOMKit/WebIDL/XPathResult.swift +++ b/Sources/DOMKit/WebIDL/XPathResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XPathResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.XPathResult.function! } + public class var constructor: JSFunction { JSObject.global[Strings.XPathResult].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRAnchor.swift b/Sources/DOMKit/WebIDL/XRAnchor.swift new file mode 100644 index 00000000..4cb8a54c --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRAnchor.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRAnchor: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRAnchor].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _anchorSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchorSpace) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var anchorSpace: XRSpace + + public func delete() { + _ = jsObject[Strings.delete]!() + } +} diff --git a/Sources/DOMKit/WebIDL/XRAnchorSet.swift b/Sources/DOMKit/WebIDL/XRAnchorSet.swift new file mode 100644 index 00000000..663dd0c3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRAnchorSet.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRAnchorSet: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRAnchorSet].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + // XXX: make me Set-like! +} diff --git a/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift b/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift new file mode 100644 index 00000000..ab600f31 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRBoundedReferenceSpace: XRReferenceSpace { + override public class var constructor: JSFunction { JSObject.global[Strings.XRBoundedReferenceSpace].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _boundsGeometry = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundsGeometry) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var boundsGeometry: [DOMPointReadOnly] +} diff --git a/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift b/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift new file mode 100644 index 00000000..b71b2ade --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRCPUDepthInformation: XRDepthInformation { + override public class var constructor: JSFunction { JSObject.global[Strings.XRCPUDepthInformation].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var data: ArrayBuffer + + public func getDepthInMeters(x: Float, y: Float) -> Float { + jsObject[Strings.getDepthInMeters]!(x.jsValue(), y.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XRCompositionLayer.swift b/Sources/DOMKit/WebIDL/XRCompositionLayer.swift new file mode 100644 index 00000000..1b261e49 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRCompositionLayer.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRCompositionLayer: XRLayer { + override public class var constructor: JSFunction { JSObject.global[Strings.XRCompositionLayer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _layout = ReadonlyAttribute(jsObject: jsObject, name: Strings.layout) + _blendTextureSourceAlpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.blendTextureSourceAlpha) + _chromaticAberrationCorrection = ReadWriteAttribute(jsObject: jsObject, name: Strings.chromaticAberrationCorrection) + _mipLevels = ReadonlyAttribute(jsObject: jsObject, name: Strings.mipLevels) + _needsRedraw = ReadonlyAttribute(jsObject: jsObject, name: Strings.needsRedraw) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var layout: XRLayerLayout + + @ReadWriteAttribute + public var blendTextureSourceAlpha: Bool + + @ReadWriteAttribute + public var chromaticAberrationCorrection: Bool? + + @ReadonlyAttribute + public var mipLevels: UInt32 + + @ReadonlyAttribute + public var needsRedraw: Bool + + public func destroy() { + _ = jsObject[Strings.destroy]!() + } +} diff --git a/Sources/DOMKit/WebIDL/XRCubeLayer.swift b/Sources/DOMKit/WebIDL/XRCubeLayer.swift new file mode 100644 index 00000000..86328e7c --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRCubeLayer.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRCubeLayer: XRCompositionLayer { + override public class var constructor: JSFunction { JSObject.global[Strings.XRCubeLayer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) + _orientation = ReadWriteAttribute(jsObject: jsObject, name: Strings.orientation) + _onredraw = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onredraw) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var space: XRSpace + + @ReadWriteAttribute + public var orientation: DOMPointReadOnly + + @ClosureAttribute.Optional1 + public var onredraw: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift b/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift new file mode 100644 index 00000000..c97feb38 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRCubeLayerInit: BridgedDictionary { + public convenience init(orientation: DOMPointReadOnly?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.orientation] = orientation.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _orientation = ReadWriteAttribute(jsObject: object, name: Strings.orientation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var orientation: DOMPointReadOnly? +} diff --git a/Sources/DOMKit/WebIDL/XRCylinderLayer.swift b/Sources/DOMKit/WebIDL/XRCylinderLayer.swift new file mode 100644 index 00000000..a6a24d51 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRCylinderLayer.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRCylinderLayer: XRCompositionLayer { + override public class var constructor: JSFunction { JSObject.global[Strings.XRCylinderLayer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) + _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) + _radius = ReadWriteAttribute(jsObject: jsObject, name: Strings.radius) + _centralAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.centralAngle) + _aspectRatio = ReadWriteAttribute(jsObject: jsObject, name: Strings.aspectRatio) + _onredraw = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onredraw) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var space: XRSpace + + @ReadWriteAttribute + public var transform: XRRigidTransform + + @ReadWriteAttribute + public var radius: Float + + @ReadWriteAttribute + public var centralAngle: Float + + @ReadWriteAttribute + public var aspectRatio: Float + + @ClosureAttribute.Optional1 + public var onredraw: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift b/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift new file mode 100644 index 00000000..5c888df4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRCylinderLayerInit: BridgedDictionary { + public convenience init(textureType: XRTextureType, transform: XRRigidTransform?, radius: Float, centralAngle: Float, aspectRatio: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.textureType] = textureType.jsValue() + object[Strings.transform] = transform.jsValue() + object[Strings.radius] = radius.jsValue() + object[Strings.centralAngle] = centralAngle.jsValue() + object[Strings.aspectRatio] = aspectRatio.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _textureType = ReadWriteAttribute(jsObject: object, name: Strings.textureType) + _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) + _radius = ReadWriteAttribute(jsObject: object, name: Strings.radius) + _centralAngle = ReadWriteAttribute(jsObject: object, name: Strings.centralAngle) + _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var textureType: XRTextureType + + @ReadWriteAttribute + public var transform: XRRigidTransform? + + @ReadWriteAttribute + public var radius: Float + + @ReadWriteAttribute + public var centralAngle: Float + + @ReadWriteAttribute + public var aspectRatio: Float +} diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift new file mode 100644 index 00000000..da7355c9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRDOMOverlayInit: BridgedDictionary { + public convenience init(root: Element) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.root] = root.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _root = ReadWriteAttribute(jsObject: object, name: Strings.root) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var root: Element +} diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift new file mode 100644 index 00000000..16aedf17 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRDOMOverlayState: BridgedDictionary { + public convenience init(type: XRDOMOverlayType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: XRDOMOverlayType +} diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift new file mode 100644 index 00000000..d125588b --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRDOMOverlayType: JSString, JSValueCompatible { + case screen = "screen" + case floating = "floating" + case headLocked = "head-locked" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift b/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift new file mode 100644 index 00000000..6dcfabfd --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRDepthDataFormat: JSString, JSValueCompatible { + case luminanceAlpha = "luminance-alpha" + case float32 = "float32" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRDepthInformation.swift b/Sources/DOMKit/WebIDL/XRDepthInformation.swift new file mode 100644 index 00000000..83f5a9b7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRDepthInformation.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRDepthInformation: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRDepthInformation].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + _normDepthBufferFromNormView = ReadonlyAttribute(jsObject: jsObject, name: Strings.normDepthBufferFromNormView) + _rawValueToMeters = ReadonlyAttribute(jsObject: jsObject, name: Strings.rawValueToMeters) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var width: UInt32 + + @ReadonlyAttribute + public var height: UInt32 + + @ReadonlyAttribute + public var normDepthBufferFromNormView: XRRigidTransform + + @ReadonlyAttribute + public var rawValueToMeters: Float +} diff --git a/Sources/DOMKit/WebIDL/XRDepthStateInit.swift b/Sources/DOMKit/WebIDL/XRDepthStateInit.swift new file mode 100644 index 00000000..31f85f30 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRDepthStateInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRDepthStateInit: BridgedDictionary { + public convenience init(usagePreference: [XRDepthUsage], dataFormatPreference: [XRDepthDataFormat]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.usagePreference] = usagePreference.jsValue() + object[Strings.dataFormatPreference] = dataFormatPreference.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _usagePreference = ReadWriteAttribute(jsObject: object, name: Strings.usagePreference) + _dataFormatPreference = ReadWriteAttribute(jsObject: object, name: Strings.dataFormatPreference) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var usagePreference: [XRDepthUsage] + + @ReadWriteAttribute + public var dataFormatPreference: [XRDepthDataFormat] +} diff --git a/Sources/DOMKit/WebIDL/XRDepthUsage.swift b/Sources/DOMKit/WebIDL/XRDepthUsage.swift new file mode 100644 index 00000000..f949fca4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRDepthUsage.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRDepthUsage: JSString, JSValueCompatible { + case cpuOptimized = "cpu-optimized" + case gpuOptimized = "gpu-optimized" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift b/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift new file mode 100644 index 00000000..f1f4f8fe --- /dev/null +++ b/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XREnvironmentBlendMode: JSString, JSValueCompatible { + case opaque = "opaque" + case alphaBlend = "alpha-blend" + case additive = "additive" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XREquirectLayer.swift b/Sources/DOMKit/WebIDL/XREquirectLayer.swift new file mode 100644 index 00000000..86ce4f71 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XREquirectLayer.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XREquirectLayer: XRCompositionLayer { + override public class var constructor: JSFunction { JSObject.global[Strings.XREquirectLayer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) + _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) + _radius = ReadWriteAttribute(jsObject: jsObject, name: Strings.radius) + _centralHorizontalAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.centralHorizontalAngle) + _upperVerticalAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.upperVerticalAngle) + _lowerVerticalAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.lowerVerticalAngle) + _onredraw = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onredraw) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var space: XRSpace + + @ReadWriteAttribute + public var transform: XRRigidTransform + + @ReadWriteAttribute + public var radius: Float + + @ReadWriteAttribute + public var centralHorizontalAngle: Float + + @ReadWriteAttribute + public var upperVerticalAngle: Float + + @ReadWriteAttribute + public var lowerVerticalAngle: Float + + @ClosureAttribute.Optional1 + public var onredraw: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift b/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift new file mode 100644 index 00000000..f669bd06 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XREquirectLayerInit: BridgedDictionary { + public convenience init(textureType: XRTextureType, transform: XRRigidTransform?, radius: Float, centralHorizontalAngle: Float, upperVerticalAngle: Float, lowerVerticalAngle: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.textureType] = textureType.jsValue() + object[Strings.transform] = transform.jsValue() + object[Strings.radius] = radius.jsValue() + object[Strings.centralHorizontalAngle] = centralHorizontalAngle.jsValue() + object[Strings.upperVerticalAngle] = upperVerticalAngle.jsValue() + object[Strings.lowerVerticalAngle] = lowerVerticalAngle.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _textureType = ReadWriteAttribute(jsObject: object, name: Strings.textureType) + _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) + _radius = ReadWriteAttribute(jsObject: object, name: Strings.radius) + _centralHorizontalAngle = ReadWriteAttribute(jsObject: object, name: Strings.centralHorizontalAngle) + _upperVerticalAngle = ReadWriteAttribute(jsObject: object, name: Strings.upperVerticalAngle) + _lowerVerticalAngle = ReadWriteAttribute(jsObject: object, name: Strings.lowerVerticalAngle) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var textureType: XRTextureType + + @ReadWriteAttribute + public var transform: XRRigidTransform? + + @ReadWriteAttribute + public var radius: Float + + @ReadWriteAttribute + public var centralHorizontalAngle: Float + + @ReadWriteAttribute + public var upperVerticalAngle: Float + + @ReadWriteAttribute + public var lowerVerticalAngle: Float +} diff --git a/Sources/DOMKit/WebIDL/XREye.swift b/Sources/DOMKit/WebIDL/XREye.swift new file mode 100644 index 00000000..af03e97a --- /dev/null +++ b/Sources/DOMKit/WebIDL/XREye.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XREye: JSString, JSValueCompatible { + case none = "none" + case left = "left" + case right = "right" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRFrame.swift b/Sources/DOMKit/WebIDL/XRFrame.swift new file mode 100644 index 00000000..19c2393b --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRFrame.swift @@ -0,0 +1,72 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRFrame: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRFrame].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _session = ReadonlyAttribute(jsObject: jsObject, name: Strings.session) + _predictedDisplayTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.predictedDisplayTime) + _trackedAnchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.trackedAnchors) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var session: XRSession + + @ReadonlyAttribute + public var predictedDisplayTime: DOMHighResTimeStamp + + public func getViewerPose(referenceSpace: XRReferenceSpace) -> XRViewerPose? { + jsObject[Strings.getViewerPose]!(referenceSpace.jsValue()).fromJSValue()! + } + + public func getPose(space: XRSpace, baseSpace: XRSpace) -> XRPose? { + jsObject[Strings.getPose]!(space.jsValue(), baseSpace.jsValue()).fromJSValue()! + } + + public func getJointPose(joint: XRJointSpace, baseSpace: XRSpace) -> XRJointPose? { + jsObject[Strings.getJointPose]!(joint.jsValue(), baseSpace.jsValue()).fromJSValue()! + } + + public func fillJointRadii(jointSpaces: [XRJointSpace], radii: Float32Array) -> Bool { + jsObject[Strings.fillJointRadii]!(jointSpaces.jsValue(), radii.jsValue()).fromJSValue()! + } + + public func fillPoses(spaces: [XRSpace], baseSpace: XRSpace, transforms: Float32Array) -> Bool { + jsObject[Strings.fillPoses]!(spaces.jsValue(), baseSpace.jsValue(), transforms.jsValue()).fromJSValue()! + } + + public func createAnchor(pose: XRRigidTransform, space: XRSpace) -> JSPromise { + jsObject[Strings.createAnchor]!(pose.jsValue(), space.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createAnchor(pose: XRRigidTransform, space: XRSpace) async throws -> XRAnchor { + let _promise: JSPromise = jsObject[Strings.createAnchor]!(pose.jsValue(), space.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var trackedAnchors: XRAnchorSet + + public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { + jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! + } + + public func getLightEstimate(lightProbe: XRLightProbe) -> XRLightEstimate? { + jsObject[Strings.getLightEstimate]!(lightProbe.jsValue()).fromJSValue()! + } + + public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { + jsObject[Strings.getHitTestResults]!(hitTestSource.jsValue()).fromJSValue()! + } + + public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { + jsObject[Strings.getHitTestResultsForTransientInput]!(hitTestSource.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XRHand.swift b/Sources/DOMKit/WebIDL/XRHand.swift new file mode 100644 index 00000000..cd9fccdf --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRHand.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRHand: JSBridgedClass, Sequence { + public class var constructor: JSFunction { JSObject.global[Strings.XRHand].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + self.jsObject = jsObject + } + + public typealias Element = XRHandJoint + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + @ReadonlyAttribute + public var size: UInt32 + + public func get(key: XRHandJoint) -> XRJointSpace { + jsObject[Strings.get]!(key.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XRHandJoint.swift b/Sources/DOMKit/WebIDL/XRHandJoint.swift new file mode 100644 index 00000000..e0821578 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRHandJoint.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRHandJoint: JSString, JSValueCompatible { + case wrist = "wrist" + case thumbMetacarpal = "thumb-metacarpal" + case thumbPhalanxProximal = "thumb-phalanx-proximal" + case thumbPhalanxDistal = "thumb-phalanx-distal" + case thumbTip = "thumb-tip" + case indexFingerMetacarpal = "index-finger-metacarpal" + case indexFingerPhalanxProximal = "index-finger-phalanx-proximal" + case indexFingerPhalanxIntermediate = "index-finger-phalanx-intermediate" + case indexFingerPhalanxDistal = "index-finger-phalanx-distal" + case indexFingerTip = "index-finger-tip" + case middleFingerMetacarpal = "middle-finger-metacarpal" + case middleFingerPhalanxProximal = "middle-finger-phalanx-proximal" + case middleFingerPhalanxIntermediate = "middle-finger-phalanx-intermediate" + case middleFingerPhalanxDistal = "middle-finger-phalanx-distal" + case middleFingerTip = "middle-finger-tip" + case ringFingerMetacarpal = "ring-finger-metacarpal" + case ringFingerPhalanxProximal = "ring-finger-phalanx-proximal" + case ringFingerPhalanxIntermediate = "ring-finger-phalanx-intermediate" + case ringFingerPhalanxDistal = "ring-finger-phalanx-distal" + case ringFingerTip = "ring-finger-tip" + case pinkyFingerMetacarpal = "pinky-finger-metacarpal" + case pinkyFingerPhalanxProximal = "pinky-finger-phalanx-proximal" + case pinkyFingerPhalanxIntermediate = "pinky-finger-phalanx-intermediate" + case pinkyFingerPhalanxDistal = "pinky-finger-phalanx-distal" + case pinkyFingerTip = "pinky-finger-tip" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRHandedness.swift b/Sources/DOMKit/WebIDL/XRHandedness.swift new file mode 100644 index 00000000..4ea70351 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRHandedness.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRHandedness: JSString, JSValueCompatible { + case none = "none" + case left = "left" + case right = "right" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift b/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift new file mode 100644 index 00000000..e7fcd739 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRHitTestOptionsInit: BridgedDictionary { + public convenience init(space: XRSpace, entityTypes: [XRHitTestTrackableType], offsetRay: XRRay) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.space] = space.jsValue() + object[Strings.entityTypes] = entityTypes.jsValue() + object[Strings.offsetRay] = offsetRay.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _space = ReadWriteAttribute(jsObject: object, name: Strings.space) + _entityTypes = ReadWriteAttribute(jsObject: object, name: Strings.entityTypes) + _offsetRay = ReadWriteAttribute(jsObject: object, name: Strings.offsetRay) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var space: XRSpace + + @ReadWriteAttribute + public var entityTypes: [XRHitTestTrackableType] + + @ReadWriteAttribute + public var offsetRay: XRRay +} diff --git a/Sources/DOMKit/WebIDL/XRHitTestResult.swift b/Sources/DOMKit/WebIDL/XRHitTestResult.swift new file mode 100644 index 00000000..5d50ee54 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRHitTestResult.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRHitTestResult: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRHitTestResult].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func createAnchor() -> JSPromise { + jsObject[Strings.createAnchor]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func createAnchor() async throws -> XRAnchor { + let _promise: JSPromise = jsObject[Strings.createAnchor]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getPose(baseSpace: XRSpace) -> XRPose? { + jsObject[Strings.getPose]!(baseSpace.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XRHitTestSource.swift b/Sources/DOMKit/WebIDL/XRHitTestSource.swift new file mode 100644 index 00000000..63595ed0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRHitTestSource.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRHitTestSource: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRHitTestSource].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func cancel() { + _ = jsObject[Strings.cancel]!() + } +} diff --git a/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift b/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift new file mode 100644 index 00000000..110d2733 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRHitTestTrackableType: JSString, JSValueCompatible { + case point = "point" + case plane = "plane" + case mesh = "mesh" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRInputSource.swift b/Sources/DOMKit/WebIDL/XRInputSource.swift new file mode 100644 index 00000000..f74135ae --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRInputSource.swift @@ -0,0 +1,42 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRInputSource: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRInputSource].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _handedness = ReadonlyAttribute(jsObject: jsObject, name: Strings.handedness) + _targetRayMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetRayMode) + _targetRaySpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetRaySpace) + _gripSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.gripSpace) + _profiles = ReadonlyAttribute(jsObject: jsObject, name: Strings.profiles) + _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) + _gamepad = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamepad) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var handedness: XRHandedness + + @ReadonlyAttribute + public var targetRayMode: XRTargetRayMode + + @ReadonlyAttribute + public var targetRaySpace: XRSpace + + @ReadonlyAttribute + public var gripSpace: XRSpace? + + @ReadonlyAttribute + public var profiles: [String] + + @ReadonlyAttribute + public var hand: XRHand? + + @ReadonlyAttribute + public var gamepad: Gamepad? +} diff --git a/Sources/DOMKit/WebIDL/XRInputSourceArray.swift b/Sources/DOMKit/WebIDL/XRInputSourceArray.swift new file mode 100644 index 00000000..ae4b7dcd --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRInputSourceArray.swift @@ -0,0 +1,27 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRInputSourceArray: JSBridgedClass, Sequence { + public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourceArray].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + self.jsObject = jsObject + } + + public typealias Element = XRInputSource + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + @ReadonlyAttribute + public var length: UInt32 + + public subscript(key: Int) -> XRInputSource { + jsObject[key].fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift new file mode 100644 index 00000000..d2700ee4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRInputSourceEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourceEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _frame = ReadonlyAttribute(jsObject: jsObject, name: Strings.frame) + _inputSource = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputSource) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: XRInputSourceEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var frame: XRFrame + + @ReadonlyAttribute + public var inputSource: XRInputSource +} diff --git a/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift b/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift new file mode 100644 index 00000000..0ce27145 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRInputSourceEventInit: BridgedDictionary { + public convenience init(frame: XRFrame, inputSource: XRInputSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.frame] = frame.jsValue() + object[Strings.inputSource] = inputSource.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _frame = ReadWriteAttribute(jsObject: object, name: Strings.frame) + _inputSource = ReadWriteAttribute(jsObject: object, name: Strings.inputSource) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var frame: XRFrame + + @ReadWriteAttribute + public var inputSource: XRInputSource +} diff --git a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift new file mode 100644 index 00000000..2470306f --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRInputSourcesChangeEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourcesChangeEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _session = ReadonlyAttribute(jsObject: jsObject, name: Strings.session) + _added = ReadonlyAttribute(jsObject: jsObject, name: Strings.added) + _removed = ReadonlyAttribute(jsObject: jsObject, name: Strings.removed) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: XRInputSourcesChangeEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var session: XRSession + + @ReadonlyAttribute + public var added: [XRInputSource] + + @ReadonlyAttribute + public var removed: [XRInputSource] +} diff --git a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift new file mode 100644 index 00000000..fc951723 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRInputSourcesChangeEventInit: BridgedDictionary { + public convenience init(session: XRSession, added: [XRInputSource], removed: [XRInputSource]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.session] = session.jsValue() + object[Strings.added] = added.jsValue() + object[Strings.removed] = removed.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _session = ReadWriteAttribute(jsObject: object, name: Strings.session) + _added = ReadWriteAttribute(jsObject: object, name: Strings.added) + _removed = ReadWriteAttribute(jsObject: object, name: Strings.removed) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var session: XRSession + + @ReadWriteAttribute + public var added: [XRInputSource] + + @ReadWriteAttribute + public var removed: [XRInputSource] +} diff --git a/Sources/DOMKit/WebIDL/XRInteractionMode.swift b/Sources/DOMKit/WebIDL/XRInteractionMode.swift new file mode 100644 index 00000000..ab979bb0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRInteractionMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRInteractionMode: JSString, JSValueCompatible { + case screenSpace = "screen-space" + case worldSpace = "world-space" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRJointPose.swift b/Sources/DOMKit/WebIDL/XRJointPose.swift new file mode 100644 index 00000000..fd8cca8b --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRJointPose.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRJointPose: XRPose { + override public class var constructor: JSFunction { JSObject.global[Strings.XRJointPose].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _radius = ReadonlyAttribute(jsObject: jsObject, name: Strings.radius) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var radius: Float +} diff --git a/Sources/DOMKit/WebIDL/XRJointSpace.swift b/Sources/DOMKit/WebIDL/XRJointSpace.swift new file mode 100644 index 00000000..d3db86d3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRJointSpace.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRJointSpace: XRSpace { + override public class var constructor: JSFunction { JSObject.global[Strings.XRJointSpace].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _jointName = ReadonlyAttribute(jsObject: jsObject, name: Strings.jointName) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var jointName: XRHandJoint +} diff --git a/Sources/DOMKit/WebIDL/XRLayer.swift b/Sources/DOMKit/WebIDL/XRLayer.swift new file mode 100644 index 00000000..5ace3b45 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRLayer.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRLayer: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.XRLayer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/XRLayerEvent.swift b/Sources/DOMKit/WebIDL/XRLayerEvent.swift new file mode 100644 index 00000000..45a9c880 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRLayerEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRLayerEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.XRLayerEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _layer = ReadonlyAttribute(jsObject: jsObject, name: Strings.layer) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: XRLayerEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var layer: XRLayer +} diff --git a/Sources/DOMKit/WebIDL/XRLayerEventInit.swift b/Sources/DOMKit/WebIDL/XRLayerEventInit.swift new file mode 100644 index 00000000..f4d52de5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRLayerEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRLayerEventInit: BridgedDictionary { + public convenience init(layer: XRLayer) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.layer] = layer.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _layer = ReadWriteAttribute(jsObject: object, name: Strings.layer) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var layer: XRLayer +} diff --git a/Sources/DOMKit/WebIDL/XRLayerInit.swift b/Sources/DOMKit/WebIDL/XRLayerInit.swift new file mode 100644 index 00000000..f7bac833 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRLayerInit.swift @@ -0,0 +1,55 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRLayerInit: BridgedDictionary { + public convenience init(space: XRSpace, colorFormat: GLenum, depthFormat: GLenum?, mipLevels: UInt32, viewPixelWidth: UInt32, viewPixelHeight: UInt32, layout: XRLayerLayout, isStatic: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.space] = space.jsValue() + object[Strings.colorFormat] = colorFormat.jsValue() + object[Strings.depthFormat] = depthFormat.jsValue() + object[Strings.mipLevels] = mipLevels.jsValue() + object[Strings.viewPixelWidth] = viewPixelWidth.jsValue() + object[Strings.viewPixelHeight] = viewPixelHeight.jsValue() + object[Strings.layout] = layout.jsValue() + object[Strings.isStatic] = isStatic.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _space = ReadWriteAttribute(jsObject: object, name: Strings.space) + _colorFormat = ReadWriteAttribute(jsObject: object, name: Strings.colorFormat) + _depthFormat = ReadWriteAttribute(jsObject: object, name: Strings.depthFormat) + _mipLevels = ReadWriteAttribute(jsObject: object, name: Strings.mipLevels) + _viewPixelWidth = ReadWriteAttribute(jsObject: object, name: Strings.viewPixelWidth) + _viewPixelHeight = ReadWriteAttribute(jsObject: object, name: Strings.viewPixelHeight) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + _isStatic = ReadWriteAttribute(jsObject: object, name: Strings.isStatic) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var space: XRSpace + + @ReadWriteAttribute + public var colorFormat: GLenum + + @ReadWriteAttribute + public var depthFormat: GLenum? + + @ReadWriteAttribute + public var mipLevels: UInt32 + + @ReadWriteAttribute + public var viewPixelWidth: UInt32 + + @ReadWriteAttribute + public var viewPixelHeight: UInt32 + + @ReadWriteAttribute + public var layout: XRLayerLayout + + @ReadWriteAttribute + public var isStatic: Bool +} diff --git a/Sources/DOMKit/WebIDL/XRLayerLayout.swift b/Sources/DOMKit/WebIDL/XRLayerLayout.swift new file mode 100644 index 00000000..6d380e42 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRLayerLayout.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRLayerLayout: JSString, JSValueCompatible { + case `default` = "default" + case mono = "mono" + case stereo = "stereo" + case stereoLeftRight = "stereo-left-right" + case stereoTopBottom = "stereo-top-bottom" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRLightEstimate.swift b/Sources/DOMKit/WebIDL/XRLightEstimate.swift new file mode 100644 index 00000000..dd58d186 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRLightEstimate.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRLightEstimate: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRLightEstimate].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _sphericalHarmonicsCoefficients = ReadonlyAttribute(jsObject: jsObject, name: Strings.sphericalHarmonicsCoefficients) + _primaryLightDirection = ReadonlyAttribute(jsObject: jsObject, name: Strings.primaryLightDirection) + _primaryLightIntensity = ReadonlyAttribute(jsObject: jsObject, name: Strings.primaryLightIntensity) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var sphericalHarmonicsCoefficients: Float32Array + + @ReadonlyAttribute + public var primaryLightDirection: DOMPointReadOnly + + @ReadonlyAttribute + public var primaryLightIntensity: DOMPointReadOnly +} diff --git a/Sources/DOMKit/WebIDL/XRLightProbe.swift b/Sources/DOMKit/WebIDL/XRLightProbe.swift new file mode 100644 index 00000000..fc146987 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRLightProbe.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRLightProbe: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.XRLightProbe].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _probeSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.probeSpace) + _onreflectionchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreflectionchange) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var probeSpace: XRSpace + + @ClosureAttribute.Optional1 + public var onreflectionchange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/XRLightProbeInit.swift b/Sources/DOMKit/WebIDL/XRLightProbeInit.swift new file mode 100644 index 00000000..f1a089c8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRLightProbeInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRLightProbeInit: BridgedDictionary { + public convenience init(reflectionFormat: XRReflectionFormat) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.reflectionFormat] = reflectionFormat.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _reflectionFormat = ReadWriteAttribute(jsObject: object, name: Strings.reflectionFormat) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var reflectionFormat: XRReflectionFormat +} diff --git a/Sources/DOMKit/WebIDL/XRMediaBinding.swift b/Sources/DOMKit/WebIDL/XRMediaBinding.swift new file mode 100644 index 00000000..b5409e2e --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRMediaBinding.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRMediaBinding: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRMediaBinding].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public convenience init(session: XRSession) { + self.init(unsafelyWrapping: Self.constructor.new(session.jsValue())) + } + + public func createQuadLayer(video: HTMLVideoElement, init: XRMediaQuadLayerInit? = nil) -> XRQuadLayer { + jsObject[Strings.createQuadLayer]!(video.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createCylinderLayer(video: HTMLVideoElement, init: XRMediaCylinderLayerInit? = nil) -> XRCylinderLayer { + jsObject[Strings.createCylinderLayer]!(video.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createEquirectLayer(video: HTMLVideoElement, init: XRMediaEquirectLayerInit? = nil) -> XREquirectLayer { + jsObject[Strings.createEquirectLayer]!(video.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift new file mode 100644 index 00000000..febfd610 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRMediaCylinderLayerInit: BridgedDictionary { + public convenience init(transform: XRRigidTransform?, radius: Float, centralAngle: Float, aspectRatio: Float?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.transform] = transform.jsValue() + object[Strings.radius] = radius.jsValue() + object[Strings.centralAngle] = centralAngle.jsValue() + object[Strings.aspectRatio] = aspectRatio.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) + _radius = ReadWriteAttribute(jsObject: object, name: Strings.radius) + _centralAngle = ReadWriteAttribute(jsObject: object, name: Strings.centralAngle) + _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var transform: XRRigidTransform? + + @ReadWriteAttribute + public var radius: Float + + @ReadWriteAttribute + public var centralAngle: Float + + @ReadWriteAttribute + public var aspectRatio: Float? +} diff --git a/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift new file mode 100644 index 00000000..e79d02d2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRMediaEquirectLayerInit: BridgedDictionary { + public convenience init(transform: XRRigidTransform?, radius: Float, centralHorizontalAngle: Float, upperVerticalAngle: Float, lowerVerticalAngle: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.transform] = transform.jsValue() + object[Strings.radius] = radius.jsValue() + object[Strings.centralHorizontalAngle] = centralHorizontalAngle.jsValue() + object[Strings.upperVerticalAngle] = upperVerticalAngle.jsValue() + object[Strings.lowerVerticalAngle] = lowerVerticalAngle.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) + _radius = ReadWriteAttribute(jsObject: object, name: Strings.radius) + _centralHorizontalAngle = ReadWriteAttribute(jsObject: object, name: Strings.centralHorizontalAngle) + _upperVerticalAngle = ReadWriteAttribute(jsObject: object, name: Strings.upperVerticalAngle) + _lowerVerticalAngle = ReadWriteAttribute(jsObject: object, name: Strings.lowerVerticalAngle) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var transform: XRRigidTransform? + + @ReadWriteAttribute + public var radius: Float + + @ReadWriteAttribute + public var centralHorizontalAngle: Float + + @ReadWriteAttribute + public var upperVerticalAngle: Float + + @ReadWriteAttribute + public var lowerVerticalAngle: Float +} diff --git a/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift new file mode 100644 index 00000000..9d02733a --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRMediaLayerInit: BridgedDictionary { + public convenience init(space: XRSpace, layout: XRLayerLayout, invertStereo: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.space] = space.jsValue() + object[Strings.layout] = layout.jsValue() + object[Strings.invertStereo] = invertStereo.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _space = ReadWriteAttribute(jsObject: object, name: Strings.space) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + _invertStereo = ReadWriteAttribute(jsObject: object, name: Strings.invertStereo) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var space: XRSpace + + @ReadWriteAttribute + public var layout: XRLayerLayout + + @ReadWriteAttribute + public var invertStereo: Bool +} diff --git a/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift new file mode 100644 index 00000000..1a7d8824 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRMediaQuadLayerInit: BridgedDictionary { + public convenience init(transform: XRRigidTransform?, width: Float?, height: Float?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.transform] = transform.jsValue() + object[Strings.width] = width.jsValue() + object[Strings.height] = height.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var transform: XRRigidTransform? + + @ReadWriteAttribute + public var width: Float? + + @ReadWriteAttribute + public var height: Float? +} diff --git a/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift new file mode 100644 index 00000000..8ed7b94f --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRPermissionDescriptor: BridgedDictionary { + public convenience init(mode: XRSessionMode, requiredFeatures: [JSValue], optionalFeatures: [JSValue]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mode] = mode.jsValue() + object[Strings.requiredFeatures] = requiredFeatures.jsValue() + object[Strings.optionalFeatures] = optionalFeatures.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) + _requiredFeatures = ReadWriteAttribute(jsObject: object, name: Strings.requiredFeatures) + _optionalFeatures = ReadWriteAttribute(jsObject: object, name: Strings.optionalFeatures) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mode: XRSessionMode + + @ReadWriteAttribute + public var requiredFeatures: [JSValue] + + @ReadWriteAttribute + public var optionalFeatures: [JSValue] +} diff --git a/Sources/DOMKit/WebIDL/XRPermissionStatus.swift b/Sources/DOMKit/WebIDL/XRPermissionStatus.swift new file mode 100644 index 00000000..9f2be4bb --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRPermissionStatus.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRPermissionStatus: PermissionStatus { + override public class var constructor: JSFunction { JSObject.global[Strings.XRPermissionStatus].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _granted = ReadWriteAttribute(jsObject: jsObject, name: Strings.granted) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var granted: [JSValue] +} diff --git a/Sources/DOMKit/WebIDL/XRPose.swift b/Sources/DOMKit/WebIDL/XRPose.swift new file mode 100644 index 00000000..6e7fc526 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRPose.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRPose: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRPose].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) + _linearVelocity = ReadonlyAttribute(jsObject: jsObject, name: Strings.linearVelocity) + _angularVelocity = ReadonlyAttribute(jsObject: jsObject, name: Strings.angularVelocity) + _emulatedPosition = ReadonlyAttribute(jsObject: jsObject, name: Strings.emulatedPosition) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var transform: XRRigidTransform + + @ReadonlyAttribute + public var linearVelocity: DOMPointReadOnly? + + @ReadonlyAttribute + public var angularVelocity: DOMPointReadOnly? + + @ReadonlyAttribute + public var emulatedPosition: Bool +} diff --git a/Sources/DOMKit/WebIDL/XRProjectionLayer.swift b/Sources/DOMKit/WebIDL/XRProjectionLayer.swift new file mode 100644 index 00000000..3a73049e --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRProjectionLayer.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRProjectionLayer: XRCompositionLayer { + override public class var constructor: JSFunction { JSObject.global[Strings.XRProjectionLayer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _textureWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureWidth) + _textureHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureHeight) + _textureArrayLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureArrayLength) + _ignoreDepthValues = ReadonlyAttribute(jsObject: jsObject, name: Strings.ignoreDepthValues) + _fixedFoveation = ReadWriteAttribute(jsObject: jsObject, name: Strings.fixedFoveation) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var textureWidth: UInt32 + + @ReadonlyAttribute + public var textureHeight: UInt32 + + @ReadonlyAttribute + public var textureArrayLength: UInt32 + + @ReadonlyAttribute + public var ignoreDepthValues: Bool + + @ReadWriteAttribute + public var fixedFoveation: Float? +} diff --git a/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift b/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift new file mode 100644 index 00000000..3daf7132 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRProjectionLayerInit: BridgedDictionary { + public convenience init(textureType: XRTextureType, colorFormat: GLenum, depthFormat: GLenum, scaleFactor: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.textureType] = textureType.jsValue() + object[Strings.colorFormat] = colorFormat.jsValue() + object[Strings.depthFormat] = depthFormat.jsValue() + object[Strings.scaleFactor] = scaleFactor.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _textureType = ReadWriteAttribute(jsObject: object, name: Strings.textureType) + _colorFormat = ReadWriteAttribute(jsObject: object, name: Strings.colorFormat) + _depthFormat = ReadWriteAttribute(jsObject: object, name: Strings.depthFormat) + _scaleFactor = ReadWriteAttribute(jsObject: object, name: Strings.scaleFactor) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var textureType: XRTextureType + + @ReadWriteAttribute + public var colorFormat: GLenum + + @ReadWriteAttribute + public var depthFormat: GLenum + + @ReadWriteAttribute + public var scaleFactor: Double +} diff --git a/Sources/DOMKit/WebIDL/XRQuadLayer.swift b/Sources/DOMKit/WebIDL/XRQuadLayer.swift new file mode 100644 index 00000000..95d3d5a1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRQuadLayer.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRQuadLayer: XRCompositionLayer { + override public class var constructor: JSFunction { JSObject.global[Strings.XRQuadLayer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) + _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) + _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) + _onredraw = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onredraw) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var space: XRSpace + + @ReadWriteAttribute + public var transform: XRRigidTransform + + @ReadWriteAttribute + public var width: Float + + @ReadWriteAttribute + public var height: Float + + @ClosureAttribute.Optional1 + public var onredraw: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift b/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift new file mode 100644 index 00000000..a45cad8f --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRQuadLayerInit: BridgedDictionary { + public convenience init(textureType: XRTextureType, transform: XRRigidTransform?, width: Float, height: Float) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.textureType] = textureType.jsValue() + object[Strings.transform] = transform.jsValue() + object[Strings.width] = width.jsValue() + object[Strings.height] = height.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _textureType = ReadWriteAttribute(jsObject: object, name: Strings.textureType) + _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var textureType: XRTextureType + + @ReadWriteAttribute + public var transform: XRRigidTransform? + + @ReadWriteAttribute + public var width: Float + + @ReadWriteAttribute + public var height: Float +} diff --git a/Sources/DOMKit/WebIDL/XRRay.swift b/Sources/DOMKit/WebIDL/XRRay.swift new file mode 100644 index 00000000..b00f24c2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRRay.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRRay: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRRay].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _origin = ReadonlyAttribute(jsObject: jsObject, name: Strings.origin) + _direction = ReadonlyAttribute(jsObject: jsObject, name: Strings.direction) + _matrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.matrix) + self.jsObject = jsObject + } + + public convenience init(origin: DOMPointInit? = nil, direction: XRRayDirectionInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(origin?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined)) + } + + public convenience init(transform: XRRigidTransform) { + self.init(unsafelyWrapping: Self.constructor.new(transform.jsValue())) + } + + @ReadonlyAttribute + public var origin: DOMPointReadOnly + + @ReadonlyAttribute + public var direction: DOMPointReadOnly + + @ReadonlyAttribute + public var matrix: Float32Array +} diff --git a/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift b/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift new file mode 100644 index 00000000..f85e1d5b --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRRayDirectionInit: BridgedDictionary { + public convenience init(x: Double, y: Double, z: Double, w: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.x] = x.jsValue() + object[Strings.y] = y.jsValue() + object[Strings.z] = z.jsValue() + object[Strings.w] = w.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _x = ReadWriteAttribute(jsObject: object, name: Strings.x) + _y = ReadWriteAttribute(jsObject: object, name: Strings.y) + _z = ReadWriteAttribute(jsObject: object, name: Strings.z) + _w = ReadWriteAttribute(jsObject: object, name: Strings.w) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var x: Double + + @ReadWriteAttribute + public var y: Double + + @ReadWriteAttribute + public var z: Double + + @ReadWriteAttribute + public var w: Double +} diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift new file mode 100644 index 00000000..5b4b918b --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRReferenceSpace: XRSpace { + override public class var constructor: JSFunction { JSObject.global[Strings.XRReferenceSpace].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _onreset = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreset) + super.init(unsafelyWrapping: jsObject) + } + + public func getOffsetReferenceSpace(originOffset: XRRigidTransform) -> Self { + jsObject[Strings.getOffsetReferenceSpace]!(originOffset.jsValue()).fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var onreset: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift new file mode 100644 index 00000000..adce0a1a --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRReferenceSpaceEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.XRReferenceSpaceEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _referenceSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.referenceSpace) + _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: XRReferenceSpaceEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var referenceSpace: XRReferenceSpace + + @ReadonlyAttribute + public var transform: XRRigidTransform? +} diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift new file mode 100644 index 00000000..f122cd2d --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRReferenceSpaceEventInit: BridgedDictionary { + public convenience init(referenceSpace: XRReferenceSpace, transform: XRRigidTransform?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.referenceSpace] = referenceSpace.jsValue() + object[Strings.transform] = transform.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _referenceSpace = ReadWriteAttribute(jsObject: object, name: Strings.referenceSpace) + _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var referenceSpace: XRReferenceSpace + + @ReadWriteAttribute + public var transform: XRRigidTransform? +} diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift new file mode 100644 index 00000000..aa1a609e --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRReferenceSpaceType: JSString, JSValueCompatible { + case viewer = "viewer" + case local = "local" + case localFloor = "local-floor" + case boundedFloor = "bounded-floor" + case unbounded = "unbounded" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRReflectionFormat.swift b/Sources/DOMKit/WebIDL/XRReflectionFormat.swift new file mode 100644 index 00000000..0bffc077 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRReflectionFormat.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRReflectionFormat: JSString, JSValueCompatible { + case srgba8 = "srgba8" + case rgba16f = "rgba16f" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRRenderState.swift b/Sources/DOMKit/WebIDL/XRRenderState.swift new file mode 100644 index 00000000..a3fa71f4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRRenderState.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRRenderState: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRRenderState].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _depthNear = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthNear) + _depthFar = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthFar) + _inlineVerticalFieldOfView = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineVerticalFieldOfView) + _baseLayer = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseLayer) + _layers = ReadonlyAttribute(jsObject: jsObject, name: Strings.layers) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var depthNear: Double + + @ReadonlyAttribute + public var depthFar: Double + + @ReadonlyAttribute + public var inlineVerticalFieldOfView: Double? + + @ReadonlyAttribute + public var baseLayer: XRWebGLLayer? + + @ReadonlyAttribute + public var layers: [XRLayer] +} diff --git a/Sources/DOMKit/WebIDL/XRRenderStateInit.swift b/Sources/DOMKit/WebIDL/XRRenderStateInit.swift new file mode 100644 index 00000000..b36642bc --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRRenderStateInit.swift @@ -0,0 +1,40 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRRenderStateInit: BridgedDictionary { + public convenience init(depthNear: Double, depthFar: Double, inlineVerticalFieldOfView: Double, baseLayer: XRWebGLLayer?, layers: [XRLayer]?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.depthNear] = depthNear.jsValue() + object[Strings.depthFar] = depthFar.jsValue() + object[Strings.inlineVerticalFieldOfView] = inlineVerticalFieldOfView.jsValue() + object[Strings.baseLayer] = baseLayer.jsValue() + object[Strings.layers] = layers.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _depthNear = ReadWriteAttribute(jsObject: object, name: Strings.depthNear) + _depthFar = ReadWriteAttribute(jsObject: object, name: Strings.depthFar) + _inlineVerticalFieldOfView = ReadWriteAttribute(jsObject: object, name: Strings.inlineVerticalFieldOfView) + _baseLayer = ReadWriteAttribute(jsObject: object, name: Strings.baseLayer) + _layers = ReadWriteAttribute(jsObject: object, name: Strings.layers) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var depthNear: Double + + @ReadWriteAttribute + public var depthFar: Double + + @ReadWriteAttribute + public var inlineVerticalFieldOfView: Double + + @ReadWriteAttribute + public var baseLayer: XRWebGLLayer? + + @ReadWriteAttribute + public var layers: [XRLayer]? +} diff --git a/Sources/DOMKit/WebIDL/XRRigidTransform.swift b/Sources/DOMKit/WebIDL/XRRigidTransform.swift new file mode 100644 index 00000000..e05fd1ae --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRRigidTransform.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRRigidTransform: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRRigidTransform].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _position = ReadonlyAttribute(jsObject: jsObject, name: Strings.position) + _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) + _matrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.matrix) + _inverse = ReadonlyAttribute(jsObject: jsObject, name: Strings.inverse) + self.jsObject = jsObject + } + + public convenience init(position: DOMPointInit? = nil, orientation: DOMPointInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(position?.jsValue() ?? .undefined, orientation?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var position: DOMPointReadOnly + + @ReadonlyAttribute + public var orientation: DOMPointReadOnly + + @ReadonlyAttribute + public var matrix: Float32Array + + @ReadonlyAttribute + public var inverse: XRRigidTransform +} diff --git a/Sources/DOMKit/WebIDL/XRSession.swift b/Sources/DOMKit/WebIDL/XRSession.swift new file mode 100644 index 00000000..e61956e3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRSession.swift @@ -0,0 +1,168 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRSession: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.XRSession].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibilityState) + _frameRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameRate) + _supportedFrameRates = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedFrameRates) + _renderState = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderState) + _inputSources = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputSources) + _onend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onend) + _oninputsourceschange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oninputsourceschange) + _onselect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onselect) + _onselectstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onselectstart) + _onselectend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onselectend) + _onsqueeze = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsqueeze) + _onsqueezestart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsqueezestart) + _onsqueezeend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsqueezeend) + _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onvisibilitychange) + _onframeratechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onframeratechange) + _domOverlayState = ReadonlyAttribute(jsObject: jsObject, name: Strings.domOverlayState) + _depthUsage = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthUsage) + _depthDataFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthDataFormat) + _environmentBlendMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.environmentBlendMode) + _interactionMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionMode) + _preferredReflectionFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.preferredReflectionFormat) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var visibilityState: XRVisibilityState + + @ReadonlyAttribute + public var frameRate: Float? + + @ReadonlyAttribute + public var supportedFrameRates: Float32Array? + + @ReadonlyAttribute + public var renderState: XRRenderState + + @ReadonlyAttribute + public var inputSources: XRInputSourceArray + + public func updateRenderState(state: XRRenderStateInit? = nil) { + _ = jsObject[Strings.updateRenderState]!(state?.jsValue() ?? .undefined) + } + + public func updateTargetFrameRate(rate: Float) -> JSPromise { + jsObject[Strings.updateTargetFrameRate]!(rate.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func updateTargetFrameRate(rate: Float) async throws { + let _promise: JSPromise = jsObject[Strings.updateTargetFrameRate]!(rate.jsValue()).fromJSValue()! + _ = try await _promise.get() + } + + public func requestReferenceSpace(type: XRReferenceSpaceType) -> JSPromise { + jsObject[Strings.requestReferenceSpace]!(type.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestReferenceSpace(type: XRReferenceSpaceType) async throws -> XRReferenceSpace { + let _promise: JSPromise = jsObject[Strings.requestReferenceSpace]!(type.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestAnimationFrame(callback: XRFrameRequestCallback) -> UInt32 { + jsObject[Strings.requestAnimationFrame]!(callback.jsValue()).fromJSValue()! + } + + public func cancelAnimationFrame(handle: UInt32) { + _ = jsObject[Strings.cancelAnimationFrame]!(handle.jsValue()) + } + + public func end() -> JSPromise { + jsObject[Strings.end]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func end() async throws { + let _promise: JSPromise = jsObject[Strings.end]!().fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var onend: EventHandler + + @ClosureAttribute.Optional1 + public var oninputsourceschange: EventHandler + + @ClosureAttribute.Optional1 + public var onselect: EventHandler + + @ClosureAttribute.Optional1 + public var onselectstart: EventHandler + + @ClosureAttribute.Optional1 + public var onselectend: EventHandler + + @ClosureAttribute.Optional1 + public var onsqueeze: EventHandler + + @ClosureAttribute.Optional1 + public var onsqueezestart: EventHandler + + @ClosureAttribute.Optional1 + public var onsqueezeend: EventHandler + + @ClosureAttribute.Optional1 + public var onvisibilitychange: EventHandler + + @ClosureAttribute.Optional1 + public var onframeratechange: EventHandler + + @ReadonlyAttribute + public var domOverlayState: XRDOMOverlayState? + + @ReadonlyAttribute + public var depthUsage: XRDepthUsage + + @ReadonlyAttribute + public var depthDataFormat: XRDepthDataFormat + + @ReadonlyAttribute + public var environmentBlendMode: XREnvironmentBlendMode + + @ReadonlyAttribute + public var interactionMode: XRInteractionMode + + public func requestLightProbe(options: XRLightProbeInit? = nil) -> JSPromise { + jsObject[Strings.requestLightProbe]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestLightProbe(options: XRLightProbeInit? = nil) async throws -> XRLightProbe { + let _promise: JSPromise = jsObject[Strings.requestLightProbe]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var preferredReflectionFormat: XRReflectionFormat + + public func requestHitTestSource(options: XRHitTestOptionsInit) -> JSPromise { + jsObject[Strings.requestHitTestSource]!(options.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestHitTestSource(options: XRHitTestOptionsInit) async throws -> XRHitTestSource { + let _promise: JSPromise = jsObject[Strings.requestHitTestSource]!(options.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) -> JSPromise { + jsObject[Strings.requestHitTestSourceForTransientInput]!(options.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) async throws -> XRTransientInputHitTestSource { + let _promise: JSPromise = jsObject[Strings.requestHitTestSourceForTransientInput]!(options.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XRSessionEvent.swift b/Sources/DOMKit/WebIDL/XRSessionEvent.swift new file mode 100644 index 00000000..a73e458d --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRSessionEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRSessionEvent: Event { + override public class var constructor: JSFunction { JSObject.global[Strings.XRSessionEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _session = ReadonlyAttribute(jsObject: jsObject, name: Strings.session) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(type: String, eventInitDict: XRSessionEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + } + + @ReadonlyAttribute + public var session: XRSession +} diff --git a/Sources/DOMKit/WebIDL/XRSessionEventInit.swift b/Sources/DOMKit/WebIDL/XRSessionEventInit.swift new file mode 100644 index 00000000..5fe3cfb0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRSessionEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRSessionEventInit: BridgedDictionary { + public convenience init(session: XRSession) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.session] = session.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _session = ReadWriteAttribute(jsObject: object, name: Strings.session) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var session: XRSession +} diff --git a/Sources/DOMKit/WebIDL/XRSessionInit.swift b/Sources/DOMKit/WebIDL/XRSessionInit.swift new file mode 100644 index 00000000..69472c24 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRSessionInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRSessionInit: BridgedDictionary { + public convenience init(requiredFeatures: [JSValue], optionalFeatures: [JSValue], domOverlay: XRDOMOverlayInit?, depthSensing: XRDepthStateInit) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.requiredFeatures] = requiredFeatures.jsValue() + object[Strings.optionalFeatures] = optionalFeatures.jsValue() + object[Strings.domOverlay] = domOverlay.jsValue() + object[Strings.depthSensing] = depthSensing.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _requiredFeatures = ReadWriteAttribute(jsObject: object, name: Strings.requiredFeatures) + _optionalFeatures = ReadWriteAttribute(jsObject: object, name: Strings.optionalFeatures) + _domOverlay = ReadWriteAttribute(jsObject: object, name: Strings.domOverlay) + _depthSensing = ReadWriteAttribute(jsObject: object, name: Strings.depthSensing) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var requiredFeatures: [JSValue] + + @ReadWriteAttribute + public var optionalFeatures: [JSValue] + + @ReadWriteAttribute + public var domOverlay: XRDOMOverlayInit? + + @ReadWriteAttribute + public var depthSensing: XRDepthStateInit +} diff --git a/Sources/DOMKit/WebIDL/XRSessionMode.swift b/Sources/DOMKit/WebIDL/XRSessionMode.swift new file mode 100644 index 00000000..1d4866d2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRSessionMode.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRSessionMode: JSString, JSValueCompatible { + case inline = "inline" + case immersiveVr = "immersive-vr" + case immersiveAr = "immersive-ar" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift new file mode 100644 index 00000000..9d046304 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRSessionSupportedPermissionDescriptor: BridgedDictionary { + public convenience init(mode: XRSessionMode) { + 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: XRSessionMode +} diff --git a/Sources/DOMKit/WebIDL/XRSpace.swift b/Sources/DOMKit/WebIDL/XRSpace.swift new file mode 100644 index 00000000..0f29a617 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRSpace.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRSpace: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.XRSpace].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/XRSubImage.swift b/Sources/DOMKit/WebIDL/XRSubImage.swift new file mode 100644 index 00000000..564ebb73 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRSubImage.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRSubImage: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRSubImage].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _viewport = ReadonlyAttribute(jsObject: jsObject, name: Strings.viewport) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var viewport: XRViewport +} diff --git a/Sources/DOMKit/WebIDL/XRSystem.swift b/Sources/DOMKit/WebIDL/XRSystem.swift new file mode 100644 index 00000000..16d64305 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRSystem.swift @@ -0,0 +1,36 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRSystem: EventTarget { + override public class var constructor: JSFunction { JSObject.global[Strings.XRSystem].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _ondevicechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicechange) + super.init(unsafelyWrapping: jsObject) + } + + public func isSessionSupported(mode: XRSessionMode) -> JSPromise { + jsObject[Strings.isSessionSupported]!(mode.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func isSessionSupported(mode: XRSessionMode) async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.isSessionSupported]!(mode.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) -> JSPromise { + jsObject[Strings.requestSession]!(mode.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) async throws -> XRSession { + let _promise: JSPromise = jsObject[Strings.requestSession]!(mode.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ClosureAttribute.Optional1 + public var ondevicechange: EventHandler +} diff --git a/Sources/DOMKit/WebIDL/XRTargetRayMode.swift b/Sources/DOMKit/WebIDL/XRTargetRayMode.swift new file mode 100644 index 00000000..75f62c9a --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRTargetRayMode.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRTargetRayMode: JSString, JSValueCompatible { + case gaze = "gaze" + case trackedPointer = "tracked-pointer" + case screen = "screen" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRTextureType.swift b/Sources/DOMKit/WebIDL/XRTextureType.swift new file mode 100644 index 00000000..178a2372 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRTextureType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRTextureType: JSString, JSValueCompatible { + case texture = "texture" + case textureArray = "texture-array" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift new file mode 100644 index 00000000..954388ba --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRTransientInputHitTestOptionsInit: BridgedDictionary { + public convenience init(profile: String, entityTypes: [XRHitTestTrackableType], offsetRay: XRRay) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.profile] = profile.jsValue() + object[Strings.entityTypes] = entityTypes.jsValue() + object[Strings.offsetRay] = offsetRay.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _profile = ReadWriteAttribute(jsObject: object, name: Strings.profile) + _entityTypes = ReadWriteAttribute(jsObject: object, name: Strings.entityTypes) + _offsetRay = ReadWriteAttribute(jsObject: object, name: Strings.offsetRay) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var profile: String + + @ReadWriteAttribute + public var entityTypes: [XRHitTestTrackableType] + + @ReadWriteAttribute + public var offsetRay: XRRay +} diff --git a/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift new file mode 100644 index 00000000..491cd589 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRTransientInputHitTestResult: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRTransientInputHitTestResult].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _inputSource = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputSource) + _results = ReadonlyAttribute(jsObject: jsObject, name: Strings.results) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var inputSource: XRInputSource + + @ReadonlyAttribute + public var results: [XRHitTestResult] +} diff --git a/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift new file mode 100644 index 00000000..09feb644 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift @@ -0,0 +1,18 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRTransientInputHitTestSource: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRTransientInputHitTestSource].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public func cancel() { + _ = jsObject[Strings.cancel]!() + } +} diff --git a/Sources/DOMKit/WebIDL/XRView.swift b/Sources/DOMKit/WebIDL/XRView.swift new file mode 100644 index 00000000..d1ff6289 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRView.swift @@ -0,0 +1,38 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRView: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRView].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _eye = ReadonlyAttribute(jsObject: jsObject, name: Strings.eye) + _projectionMatrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.projectionMatrix) + _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) + _recommendedViewportScale = ReadonlyAttribute(jsObject: jsObject, name: Strings.recommendedViewportScale) + _isFirstPersonObserver = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFirstPersonObserver) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var eye: XREye + + @ReadonlyAttribute + public var projectionMatrix: Float32Array + + @ReadonlyAttribute + public var transform: XRRigidTransform + + @ReadonlyAttribute + public var recommendedViewportScale: Double? + + public func requestViewportScale(scale: Double?) { + _ = jsObject[Strings.requestViewportScale]!(scale.jsValue()) + } + + @ReadonlyAttribute + public var isFirstPersonObserver: Bool +} diff --git a/Sources/DOMKit/WebIDL/XRViewerPose.swift b/Sources/DOMKit/WebIDL/XRViewerPose.swift new file mode 100644 index 00000000..a0c5f8f5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRViewerPose.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRViewerPose: XRPose { + override public class var constructor: JSFunction { JSObject.global[Strings.XRViewerPose].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _views = ReadonlyAttribute(jsObject: jsObject, name: Strings.views) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var views: [XRView] +} diff --git a/Sources/DOMKit/WebIDL/XRViewport.swift b/Sources/DOMKit/WebIDL/XRViewport.swift new file mode 100644 index 00000000..a1cf5808 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRViewport.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRViewport: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRViewport].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) + _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) + _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) + _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var x: Int32 + + @ReadonlyAttribute + public var y: Int32 + + @ReadonlyAttribute + public var width: Int32 + + @ReadonlyAttribute + public var height: Int32 +} diff --git a/Sources/DOMKit/WebIDL/XRVisibilityState.swift b/Sources/DOMKit/WebIDL/XRVisibilityState.swift new file mode 100644 index 00000000..7b5d9e76 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRVisibilityState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum XRVisibilityState: JSString, JSValueCompatible { + case visible = "visible" + case visibleBlurred = "visible-blurred" + case hidden = "hidden" + + public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + public func jsValue() -> JSValue { rawValue.jsValue() } +} diff --git a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift new file mode 100644 index 00000000..2ea7f805 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRWebGLBinding: JSBridgedClass { + public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLBinding].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _nativeProjectionScaleFactor = ReadonlyAttribute(jsObject: jsObject, name: Strings.nativeProjectionScaleFactor) + _usesDepthValues = ReadonlyAttribute(jsObject: jsObject, name: Strings.usesDepthValues) + self.jsObject = jsObject + } + + public convenience init(session: XRSession, context: XRWebGLRenderingContext) { + self.init(unsafelyWrapping: Self.constructor.new(session.jsValue(), context.jsValue())) + } + + @ReadonlyAttribute + public var nativeProjectionScaleFactor: Double + + @ReadonlyAttribute + public var usesDepthValues: Bool + + public func createProjectionLayer(init: XRProjectionLayerInit? = nil) -> XRProjectionLayer { + jsObject[Strings.createProjectionLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createQuadLayer(init: XRQuadLayerInit? = nil) -> XRQuadLayer { + jsObject[Strings.createQuadLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createCylinderLayer(init: XRCylinderLayerInit? = nil) -> XRCylinderLayer { + jsObject[Strings.createCylinderLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createEquirectLayer(init: XREquirectLayerInit? = nil) -> XREquirectLayer { + jsObject[Strings.createEquirectLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + } + + public func createCubeLayer(init: XRCubeLayerInit? = nil) -> XRCubeLayer { + jsObject[Strings.createCubeLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + } + + public func getSubImage(layer: XRCompositionLayer, frame: XRFrame, eye: XREye? = nil) -> XRWebGLSubImage { + jsObject[Strings.getSubImage]!(layer.jsValue(), frame.jsValue(), eye?.jsValue() ?? .undefined).fromJSValue()! + } + + public func getViewSubImage(layer: XRProjectionLayer, view: XRView) -> XRWebGLSubImage { + jsObject[Strings.getViewSubImage]!(layer.jsValue(), view.jsValue()).fromJSValue()! + } + + public func getDepthInformation(view: XRView) -> XRWebGLDepthInformation? { + jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! + } + + public func getReflectionCubeMap(lightProbe: XRLightProbe) -> WebGLTexture? { + jsObject[Strings.getReflectionCubeMap]!(lightProbe.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift b/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift new file mode 100644 index 00000000..ef469b50 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift @@ -0,0 +1,16 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRWebGLDepthInformation: XRDepthInformation { + override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLDepthInformation].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _texture = ReadonlyAttribute(jsObject: jsObject, name: Strings.texture) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var texture: WebGLTexture +} diff --git a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift new file mode 100644 index 00000000..97ca0a02 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift @@ -0,0 +1,48 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRWebGLLayer: XRLayer { + override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLLayer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _antialias = ReadonlyAttribute(jsObject: jsObject, name: Strings.antialias) + _ignoreDepthValues = ReadonlyAttribute(jsObject: jsObject, name: Strings.ignoreDepthValues) + _fixedFoveation = ReadWriteAttribute(jsObject: jsObject, name: Strings.fixedFoveation) + _framebuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.framebuffer) + _framebufferWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.framebufferWidth) + _framebufferHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.framebufferHeight) + super.init(unsafelyWrapping: jsObject) + } + + public convenience init(session: XRSession, context: XRWebGLRenderingContext, layerInit: XRWebGLLayerInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(session.jsValue(), context.jsValue(), layerInit?.jsValue() ?? .undefined)) + } + + @ReadonlyAttribute + public var antialias: Bool + + @ReadonlyAttribute + public var ignoreDepthValues: Bool + + @ReadWriteAttribute + public var fixedFoveation: Float? + + @ReadonlyAttribute + public var framebuffer: WebGLFramebuffer? + + @ReadonlyAttribute + public var framebufferWidth: UInt32 + + @ReadonlyAttribute + public var framebufferHeight: UInt32 + + public func getViewport(view: XRView) -> XRViewport? { + jsObject[Strings.getViewport]!(view.jsValue()).fromJSValue()! + } + + public static func getNativeFramebufferScaleFactor(session: XRSession) -> Double { + constructor[Strings.getNativeFramebufferScaleFactor]!(session.jsValue()).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift b/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift new file mode 100644 index 00000000..4b736f78 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRWebGLLayerInit: BridgedDictionary { + public convenience init(antialias: Bool, depth: Bool, stencil: Bool, alpha: Bool, ignoreDepthValues: Bool, framebufferScaleFactor: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.antialias] = antialias.jsValue() + object[Strings.depth] = depth.jsValue() + object[Strings.stencil] = stencil.jsValue() + object[Strings.alpha] = alpha.jsValue() + object[Strings.ignoreDepthValues] = ignoreDepthValues.jsValue() + object[Strings.framebufferScaleFactor] = framebufferScaleFactor.jsValue() + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _antialias = ReadWriteAttribute(jsObject: object, name: Strings.antialias) + _depth = ReadWriteAttribute(jsObject: object, name: Strings.depth) + _stencil = ReadWriteAttribute(jsObject: object, name: Strings.stencil) + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _ignoreDepthValues = ReadWriteAttribute(jsObject: object, name: Strings.ignoreDepthValues) + _framebufferScaleFactor = ReadWriteAttribute(jsObject: object, name: Strings.framebufferScaleFactor) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var antialias: Bool + + @ReadWriteAttribute + public var depth: Bool + + @ReadWriteAttribute + public var stencil: Bool + + @ReadWriteAttribute + public var alpha: Bool + + @ReadWriteAttribute + public var ignoreDepthValues: Bool + + @ReadWriteAttribute + public var framebufferScaleFactor: Double +} diff --git a/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift b/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift new file mode 100644 index 00000000..af908b39 --- /dev/null +++ b/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class XRWebGLSubImage: XRSubImage { + override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLSubImage].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _colorTexture = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorTexture) + _depthStencilTexture = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthStencilTexture) + _imageIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.imageIndex) + _textureWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureWidth) + _textureHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureHeight) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var colorTexture: WebGLTexture + + @ReadonlyAttribute + public var depthStencilTexture: WebGLTexture? + + @ReadonlyAttribute + public var imageIndex: UInt32? + + @ReadonlyAttribute + public var textureWidth: UInt32 + + @ReadonlyAttribute + public var textureHeight: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift index 778bbac8..dc3a85ac 100644 --- a/Sources/DOMKit/WebIDL/XSLTProcessor.swift +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XSLTProcessor: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.XSLTProcessor.function! } + public class var constructor: JSFunction { JSObject.global[Strings.XSLTProcessor].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index 94570882..bb19ada6 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -5,82 +5,82 @@ import JavaScriptKit public enum console { public static var jsObject: JSObject { - JSObject.global.console.object! + JSObject.global.[Strings.console].object! } public static func assert(condition: Bool? = nil, data: JSValue...) { - _ = JSObject.global.console.object![Strings.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) } public static func clear() { - _ = JSObject.global.console.object![Strings.clear]!() + _ = JSObject.global.[Strings.console].object![Strings.clear]!() } public static func debug(data: JSValue...) { - _ = JSObject.global.console.object![Strings.debug]!(data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.debug]!(data.jsValue()) } public static func error(data: JSValue...) { - _ = JSObject.global.console.object![Strings.error]!(data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.error]!(data.jsValue()) } public static func info(data: JSValue...) { - _ = JSObject.global.console.object![Strings.info]!(data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.info]!(data.jsValue()) } public static func log(data: JSValue...) { - _ = JSObject.global.console.object![Strings.log]!(data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.log]!(data.jsValue()) } public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { - _ = JSObject.global.console.object![Strings.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) + _ = JSObject.global.[Strings.console].object![Strings.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) } public static func trace(data: JSValue...) { - _ = JSObject.global.console.object![Strings.trace]!(data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.trace]!(data.jsValue()) } public static func warn(data: JSValue...) { - _ = JSObject.global.console.object![Strings.warn]!(data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.warn]!(data.jsValue()) } public static func dir(item: JSValue? = nil, options: JSObject? = nil) { - _ = JSObject.global.console.object![Strings.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) + _ = JSObject.global.[Strings.console].object![Strings.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) } public static func dirxml(data: JSValue...) { - _ = JSObject.global.console.object![Strings.dirxml]!(data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.dirxml]!(data.jsValue()) } public static func count(label: String? = nil) { - _ = JSObject.global.console.object![Strings.count]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.[Strings.console].object![Strings.count]!(label?.jsValue() ?? .undefined) } public static func countReset(label: String? = nil) { - _ = JSObject.global.console.object![Strings.countReset]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.[Strings.console].object![Strings.countReset]!(label?.jsValue() ?? .undefined) } public static func group(data: JSValue...) { - _ = JSObject.global.console.object![Strings.group]!(data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.group]!(data.jsValue()) } public static func groupCollapsed(data: JSValue...) { - _ = JSObject.global.console.object![Strings.groupCollapsed]!(data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.groupCollapsed]!(data.jsValue()) } public static func groupEnd() { - _ = JSObject.global.console.object![Strings.groupEnd]!() + _ = JSObject.global.[Strings.console].object![Strings.groupEnd]!() } public static func time(label: String? = nil) { - _ = JSObject.global.console.object![Strings.time]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.[Strings.console].object![Strings.time]!(label?.jsValue() ?? .undefined) } public static func timeLog(label: String? = nil, data: JSValue...) { - _ = JSObject.global.console.object![Strings.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) + _ = JSObject.global.[Strings.console].object![Strings.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) } public static func timeEnd(label: String? = nil) { - _ = JSObject.global.console.object![Strings.timeEnd]!(label?.jsValue() ?? .undefined) + _ = JSObject.global.[Strings.console].object![Strings.timeEnd]!(label?.jsValue() ?? .undefined) } } diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index dd431ca1..c3fc20f7 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -27,10 +27,7 @@ enum IDLBuilder { } static func generateIDLBindings(idl: [String: GenericCollection]) throws { - let declarations = [ - "dom", "hr-time", "html", "console", "FileAPI", "geometry", "webidl", "fetch", "xhr", - "referrer-policy", "uievents", "wai-aria", "cssom", "css-conditional", "streams", - ].flatMap { idl[$0]!.array } + let declarations = idl.values.flatMap { $0.array } let merged = DeclarationMerger.merge(declarations: declarations) for (i, node) in merged.declarations.enumerated() { guard let nameNode = Mirror(reflecting: node).children.first(where: { $0.label == "name" }), diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 990aa09d..b364925c 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -21,8 +21,8 @@ extension IDLAttribute: SwiftRepresentable, Initializable { } var swiftRepresentation: SwiftSource { - assert(!Context.static) if Context.override { + assert(!Context.static) // can't do property wrappers on override declarations return """ private var \(wrapperName): \(idlType.propertyWrapper(readonly: readonly))<\(idlType)> @@ -31,14 +31,14 @@ extension IDLAttribute: SwiftRepresentable, Initializable { \(readonly ? "" : "set { \(wrapperName).wrappedValue = newValue }") } """ - } else if Context.constructor == nil { + } else if Context.constructor == nil || Context.static { // can't do property wrappers on extensions let setter: SwiftSource = """ set { \(idlType.propertyWrapper(readonly: readonly))[\(Context.source(for: name)), in: jsObject] = newValue } """ return """ - public var \(name): \(idlType) { + public\(raw: Context.static ? " static" : "") var \(name): \(idlType) { get { \(idlType.propertyWrapper(readonly: readonly))[\(Context.source(for: name)), in: jsObject] } \(readonly ? "" : setter) } @@ -219,6 +219,22 @@ extension MergedInterface: SwiftRepresentable { } } +extension IDLMapLikeDeclaration: SwiftRepresentable, Initializable { + var swiftRepresentation: SwiftSource { + "// XXX: make me Map-like!" + } + + var initializer: SwiftSource? { nil } +} + +extension IDLSetLikeDeclaration: SwiftRepresentable, Initializable { + var swiftRepresentation: SwiftSource { + "// XXX: make me Set-like!" + } + + var initializer: SwiftSource? { nil } +} + extension MergedMixin: SwiftRepresentable { var swiftRepresentation: SwiftSource { Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name)")) { @@ -419,8 +435,20 @@ extension AsyncOperation: SwiftRepresentable, Initializable { // covered by non-async operation return "" } - assert(operation.special.isEmpty) - if Context.override, Context.static { + switch operation.special { + case "static": + return Context.withState(.static(this: "constructor", className: Context.className)) { + defaultRepresentation + } + case "": + return defaultRepresentation + default: + fatalError("Unexpected special async operation of type \(operation.special)") + } + } + + var defaultRepresentation: SwiftSource { + if Context.override, Context.static || operation.special == "static" { return """ // XXX: illegal static override // \(operation.nameAndParams) async -> \(returnType) @@ -457,12 +485,15 @@ extension IDLType: SwiftRepresentable { "ByteString": "String", "object": "JSObject", "undefined": "Void", - "float": "Float", - "double": "Double", + "float": "Float", // must not be +/-.infinity or .nan + "unrestricted float": "Float", + "double": "Double", // must not be +/-.infinity or .nan "unrestricted double": "Double", + "octet": "UInt8", "unsigned short": "UInt16", "unsigned long": "UInt32", "unsigned long long": "UInt64", + "byte": "Int8", "short": "Int16", "long": "Int32", "long long": "Int64", From 43ff31e31a8d2a515079e4ec392913715c9d1750 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 10:05:47 -0400 Subject: [PATCH 091/124] Refactor ECMAScript folder into more files --- Sources/DOMKit/ECMAScript/Attributes.swift | 39 +++++++ .../DOMKit/ECMAScript/BridgedDictionary.swift | 24 +++++ Sources/DOMKit/ECMAScript/Iterators.swift | 40 +++++++ Sources/DOMKit/ECMAScript/Support.swift | 102 ------------------ 4 files changed, 103 insertions(+), 102 deletions(-) create mode 100644 Sources/DOMKit/ECMAScript/Attributes.swift create mode 100644 Sources/DOMKit/ECMAScript/BridgedDictionary.swift create mode 100644 Sources/DOMKit/ECMAScript/Iterators.swift diff --git a/Sources/DOMKit/ECMAScript/Attributes.swift b/Sources/DOMKit/ECMAScript/Attributes.swift new file mode 100644 index 00000000..2a9dfb87 --- /dev/null +++ b/Sources/DOMKit/ECMAScript/Attributes.swift @@ -0,0 +1,39 @@ +import JavaScriptKit + +@propertyWrapper public struct ReadWriteAttribute { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString + + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: Wrapped { + get { ReadWriteAttribute[name, in: jsObject] } + set { ReadWriteAttribute[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> Wrapped { + get { jsObject[name].fromJSValue()! } + set { jsObject[name] = newValue.jsValue() } + } +} + +@propertyWrapper public struct ReadonlyAttribute { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString + + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: Wrapped { + ReadonlyAttribute[name, in: jsObject] + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> Wrapped { + jsObject[name].fromJSValue()! + } +} diff --git a/Sources/DOMKit/ECMAScript/BridgedDictionary.swift b/Sources/DOMKit/ECMAScript/BridgedDictionary.swift new file mode 100644 index 00000000..3ef5b12c --- /dev/null +++ b/Sources/DOMKit/ECMAScript/BridgedDictionary.swift @@ -0,0 +1,24 @@ +import JavaScriptKit + +public class BridgedDictionary: JSValueCompatible { + public let jsObject: JSObject + + public func jsValue() -> JSValue { + jsObject.jsValue() + } + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + public static func construct(from value: JSValue) -> Self? { + if let object = value.object { + return Self.construct(from: object) + } + return nil + } + + public static func construct(from object: JSObject) -> Self? { + Self(unsafelyWrapping: object) + } +} diff --git a/Sources/DOMKit/ECMAScript/Iterators.swift b/Sources/DOMKit/ECMAScript/Iterators.swift new file mode 100644 index 00000000..8e329f7b --- /dev/null +++ b/Sources/DOMKit/ECMAScript/Iterators.swift @@ -0,0 +1,40 @@ +import JavaScriptKit + +public class ValueIterableIterator: IteratorProtocol + where SequenceType.Element: ConstructibleFromJSValue +{ + private var index: Int = 0 + private let iterator: JSObject + + public init(sequence: SequenceType) { + // TODO: fetch the actual symbol + iterator = sequence.jsObject[JSObject.global.Symbol.object!.iterator.string!]!().object! + } + + public func next() -> SequenceType.Element? { + defer { index += 1 } + let value = iterator.next!() + guard value != .undefined else { + return nil + } + + return value.fromJSValue() + } +} + +@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) +public class ValueIterableAsyncIterator: AsyncIteratorProtocol + where SequenceType.Element: ConstructibleFromJSValue +{ + private var index: Int = 0 + private let sequence: SequenceType + + public init(sequence: SequenceType) { + self.sequence = sequence + } + + public func next() async -> SequenceType.Element? { + // TODO: implement + nil + } +} diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 0e7c9bdb..85ce807e 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -1,7 +1,3 @@ -// -// Created by Manuel Burghard. Licensed unter MIT. -// - import JavaScriptKit /* TODO: fix this */ @@ -15,104 +11,6 @@ public extension HTMLElement { } } -public class BridgedDictionary: JSValueCompatible { - public let jsObject: JSObject - - public func jsValue() -> JSValue { - jsObject.jsValue() - } - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static func construct(from value: JSValue) -> Self? { - if let object = value.object { - return Self.construct(from: object) - } - return nil - } - - public static func construct(from object: JSObject) -> Self? { - Self(unsafelyWrapping: object) - } -} - public let globalThis = Window(from: JSObject.global.jsValue())! public typealias Uint8ClampedArray = JSUInt8ClampedArray - -@propertyWrapper public struct ReadWriteAttribute { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString - - public init(jsObject: JSObject, name: JSString) { - self.jsObject = jsObject - self.name = name - } - - @inlinable public var wrappedValue: Wrapped { - get { ReadWriteAttribute[name, in: jsObject] } - set { ReadWriteAttribute[name, in: jsObject] = newValue } - } - - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> Wrapped { - get { jsObject[name].fromJSValue()! } - set { jsObject[name] = newValue.jsValue() } - } -} - -@propertyWrapper public struct ReadonlyAttribute { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString - - public init(jsObject: JSObject, name: JSString) { - self.jsObject = jsObject - self.name = name - } - - @inlinable public var wrappedValue: Wrapped { - ReadonlyAttribute[name, in: jsObject] - } - - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> Wrapped { - jsObject[name].fromJSValue()! - } -} - -public class ValueIterableIterator: IteratorProtocol where SequenceType.Element: ConstructibleFromJSValue { - private var index: Int = 0 - private let iterator: JSObject - - public init(sequence: SequenceType) { - // TODO: fetch the actual symbol - iterator = sequence.jsObject[JSObject.global.Symbol.object!.iterator.string!]!().object! - } - - public func next() -> SequenceType.Element? { - defer { index += 1 } - let value = iterator.next!() - guard value != .undefined else { - return nil - } - - return value.fromJSValue() - } -} - -@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) -public class ValueIterableAsyncIterator: AsyncIteratorProtocol - where SequenceType.Element: ConstructibleFromJSValue -{ - private var index: Int = 0 - private let sequence: SequenceType - - public init(sequence: SequenceType) { - self.sequence = sequence - } - - public func next() async -> SequenceType.Element? { - // TODO: implement - nil - } -} From 819b4672e03bffd154a9c95d70ef345c1953d521 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 10:28:33 -0400 Subject: [PATCH 092/124] Fix typos, ignore a bunch of types --- Sources/WebIDLToSwift/IDLBuilder.swift | 50 ++++++++++++++++--- .../WebIDLToSwift/SwiftRepresentation.swift | 25 ++++++---- .../WebIDL+SwiftRepresentation.swift | 2 +- 3 files changed, 60 insertions(+), 17 deletions(-) diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index c3fc20f7..27bea91e 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -27,7 +27,7 @@ enum IDLBuilder { } static func generateIDLBindings(idl: [String: GenericCollection]) throws { - let declarations = idl.values.flatMap { $0.array } + let declarations = idl.values.flatMap(\.array) let merged = DeclarationMerger.merge(declarations: declarations) for (i, node) in merged.declarations.enumerated() { guard let nameNode = Mirror(reflecting: node).children.first(where: { $0.label == "name" }), @@ -39,20 +39,56 @@ enum IDLBuilder { interfaces: merged.interfaces, ignored: [ // functions as parameters are unsupported - "EventTarget": ["addEventListener", "removeEventListener"], - "HTMLCanvasElement": ["toBlob"], "AnimationFrameProvider": ["requestAnimationFrame"], + "AnimationWorkletGlobalScope": ["registerAnimator"], + "AudioWorkletGlobalScope": ["registerProcessor"], + "BaseAudioContext": ["decodeAudioData"], + "ComputePressureObserver": [""], "DataTransferItem": ["getAsString"], - "WindowOrWorkerGlobalScope": ["queueMicrotask"], + "FileSystemDirectoryEntry": ["getFile", "getDirectory"], + "FileSystemDirectoryReader": ["readEntries"], + "FileSystemEntry": ["getParent"], + "FileSystemFileEntry": ["file"], + "Geolocation": ["getCurrentPosition", "watchPosition"], + "HTMLCanvasElement": ["toBlob"], + "HTMLVideoElement": ["requestVideoFrameCallback"], + "IntersectionObserver": [""], + "LayoutWorkletGlobalScope": ["registerLayout"], + "LockManager": ["request"], + "MediaSession": ["setActionHandler"], "MutationObserver": [""], + "Navigator": ["getUserMedia"], + "Notification": ["requestPermission"], + "PaintWorkletGlobalScope": ["registerPaint"], + "PerformanceObserver": [""], + "RemotePlayback": ["watchAvailability"], + "ReportingObserver": [""], + "ResizeObserver": [""], + "RTCPeerConnection": ["createOffer", "setLocalDescription", "createAnswer", "setRemoteDescription", "addIceCandidate"], + "Scheduler": ["postTask"], + "Window": ["requestIdleCallback"], + "WindowOrWorkerGlobalScope": ["queueMicrotask"], + "XRSession": ["requestAnimationFrame"], + // Void-returning functions are unsupported + "AudioDecoderInit": ["", "output", "error"], + "AudioEncoderInit": ["", "output", "error"], + "VideoDecoderInit": [" ", "output", "error"], + "VideoEncoderInit": ["", "output", "error"], + // variadic functions are unsupported + "TrustedTypePolicyOptions": ["", "createHTML", "createScript", "createScriptURL"], // functions as return types are unsupported "CustomElementRegistry": ["define", "whenDefined"], // NodeFilter "Document": ["createNodeIterator", "createTreeWalker"], - "TreeWalker": ["filter"], "NodeIterator": ["filter"], - // invalid overload in Swift + "TreeWalker": ["filter"], + // EventListener + "EventTarget": ["addEventListener", "removeEventListener"], + "MediaQueryList": ["addListener", "removeListener"], + // invalid override in Swift "BeforeUnloadEvent": ["returnValue"], + "CSSColor": ["colorSpace"], + "SVGElement": ["className"], // XPathNSResolver "XPathEvaluatorBase": ["createExpression", "createNSResolver", "evaluate"], ], @@ -85,7 +121,7 @@ enum IDLBuilder { let stringsContent: SwiftSource = """ enum Strings { static let _self: JSString = "self" - \(lines: strings.map { "static let \($0): JSString = \(quoted: $0)" }) + \(lines: strings.map { "static let `\(raw: $0)`: JSString = \(quoted: $0)" }) } """ diff --git a/Sources/WebIDLToSwift/SwiftRepresentation.swift b/Sources/WebIDLToSwift/SwiftRepresentation.swift index 8bc01594..e7b87c09 100644 --- a/Sources/WebIDLToSwift/SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/SwiftRepresentation.swift @@ -15,20 +15,27 @@ func toSwift(_ value: T) -> SwiftSource { extension String: SwiftRepresentable { private static let swiftKeywords: Set = [ - "init", - "where", - "protocol", - "struct", + "as", + "break", "class", + "continue", + "default", + "defer", "enum", "func", - "static", + "in", + "init", + "internal", "is", - "as", - "default", - "defer", - "self", + "operator", + "private", + "protocol", + "public", "repeat", + "self", + "static", + "struct", + "where", ] var swiftRepresentation: SwiftSource { diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index b364925c..9dba7e80 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -302,7 +302,7 @@ extension IDLIterableDeclaration: SwiftRepresentable, Initializable { extension MergedNamespace: SwiftRepresentable { var swiftRepresentation: SwiftSource { - let this: SwiftSource = "JSObject.global.[\(Context.source(for: name))].object!" + let this: SwiftSource = "JSObject.global[\(Context.source(for: name))].object!" let body = Context.withState(.static(this: this, inClass: false, className: "\(name)")) { members.map(toSwift).joined(separator: "\n\n") } From cbd9bf1e147b5cad846672eb6a5202c5c3a889e3 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 10:30:07 -0400 Subject: [PATCH 093/124] update generated files --- Sources/DOMKit/WebIDL/Animation.swift | 16 +- Sources/DOMKit/WebIDL/AnimationEffect.swift | 24 +- Sources/DOMKit/WebIDL/AnimationTimeline.swift | 14 +- .../WebIDL/AnimationWorkletGlobalScope.swift | 4 +- .../WebIDL/AudioWorkletGlobalScope.swift | 4 +- .../WebIDL/AuthenticatorTransport.swift | 2 +- Sources/DOMKit/WebIDL/BaseAudioContext.swift | 10 +- Sources/DOMKit/WebIDL/CSS.swift | 250 +++++++++--------- Sources/DOMKit/WebIDL/CSSColor.swift | 7 +- Sources/DOMKit/WebIDL/CSSImportRule.swift | 8 +- Sources/DOMKit/WebIDL/CSSMathValue.swift | 2 +- Sources/DOMKit/WebIDL/CSSRule.swift | 8 +- Sources/DOMKit/WebIDL/CSSStyleRule.swift | 22 +- Sources/DOMKit/WebIDL/Client.swift | 8 +- .../WebIDL/ComputePressureObserver.swift | 4 +- .../DOMKit/WebIDL/ComputedEffectTiming.swift | 22 +- Sources/DOMKit/WebIDL/DataTransferItem.swift | 20 +- .../WebIDL/DedicatedWorkerGlobalScope.swift | 8 +- Sources/DOMKit/WebIDL/Document.swift | 128 ++++----- .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 20 +- .../DOMKit/WebIDL/EcdhKeyDeriveParams.swift | 6 +- Sources/DOMKit/WebIDL/EffectTiming.swift | 22 +- Sources/DOMKit/WebIDL/Element.swift | 94 +++---- .../DOMKit/WebIDL/ElementCSSInlineStyle.swift | 4 +- .../WebIDL/FileSystemDirectoryEntry.swift | 8 +- .../WebIDL/FileSystemDirectoryReader.swift | 4 +- Sources/DOMKit/WebIDL/FileSystemEntry.swift | 4 +- .../DOMKit/WebIDL/FileSystemFileEntry.swift | 4 +- Sources/DOMKit/WebIDL/GPUBufferUsage.swift | 2 +- Sources/DOMKit/WebIDL/GPUColorWrite.swift | 2 +- Sources/DOMKit/WebIDL/GPUMapMode.swift | 2 +- Sources/DOMKit/WebIDL/GPUShaderStage.swift | 2 +- Sources/DOMKit/WebIDL/GPUTextureUsage.swift | 2 +- Sources/DOMKit/WebIDL/Gamepad.swift | 30 +-- Sources/DOMKit/WebIDL/Geolocation.swift | 8 +- .../DOMKit/WebIDL/GlobalEventHandlers.swift | 118 ++++----- Sources/DOMKit/WebIDL/HTMLElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 24 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 12 +- Sources/DOMKit/WebIDL/IDBCursor.swift | 2 +- Sources/DOMKit/WebIDL/InputEvent.swift | 16 +- Sources/DOMKit/WebIDL/InputEventInit.swift | 20 +- .../DOMKit/WebIDL/IntersectionObserver.swift | 4 +- Sources/DOMKit/WebIDL/KeyType.swift | 4 +- Sources/DOMKit/WebIDL/KeyframeEffect.swift | 8 +- .../DOMKit/WebIDL/KeyframeEffectOptions.swift | 12 +- .../WebIDL/LayoutWorkletGlobalScope.swift | 4 +- Sources/DOMKit/WebIDL/LockManager.swift | 20 +- Sources/DOMKit/WebIDL/MathMLElement.swift | 2 +- Sources/DOMKit/WebIDL/MediaDevices.swift | 20 +- Sources/DOMKit/WebIDL/MediaQueryList.swift | 8 +- Sources/DOMKit/WebIDL/MediaSession.swift | 4 +- .../WebIDL/MediaStreamConstraints.swift | 18 +- Sources/DOMKit/WebIDL/MediaStreamTrack.swift | 24 +- .../WebIDL/MediaTrackCapabilities.swift | 130 ++++----- .../WebIDL/MediaTrackConstraintSet.swift | 136 +++++----- .../DOMKit/WebIDL/MediaTrackSettings.swift | 134 +++++----- .../MediaTrackSupportedConstraints.swift | 136 +++++----- Sources/DOMKit/WebIDL/Navigator.swift | 192 +++++++------- Sources/DOMKit/WebIDL/Notification.swift | 10 +- .../DOMKit/WebIDL/OptionalEffectTiming.swift | 12 +- .../WebIDL/PaintWorkletGlobalScope.swift | 4 +- Sources/DOMKit/WebIDL/Performance.swift | 62 ++--- .../DOMKit/WebIDL/PerformanceObserver.swift | 4 +- Sources/DOMKit/WebIDL/Permissions.swift | 20 +- Sources/DOMKit/WebIDL/RTCIceParameters.swift | 12 +- Sources/DOMKit/WebIDL/RTCIceTransport.swift | 56 ++-- Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 100 ++----- .../WebIDL/RTCRtpEncodingParameters.swift | 12 +- Sources/DOMKit/WebIDL/RTCRtpReceiver.swift | 8 +- Sources/DOMKit/WebIDL/RTCRtpSender.swift | 28 +- Sources/DOMKit/WebIDL/RemotePlayback.swift | 10 +- Sources/DOMKit/WebIDL/ReportingObserver.swift | 4 +- Sources/DOMKit/WebIDL/ResizeObserver.swift | 4 +- Sources/DOMKit/WebIDL/SVGElement.swift | 6 +- .../DOMKit/WebIDL/SVGFECompositeElement.swift | 2 +- .../WebIDL/SVGFEMorphologyElement.swift | 2 +- Sources/DOMKit/WebIDL/Scheduler.swift | 10 +- .../DOMKit/WebIDL/SerialOutputSignals.swift | 6 +- .../WebIDL/ServiceWorkerGlobalScope.swift | 56 ++-- .../WebIDL/ServiceWorkerRegistration.swift | 38 +-- Sources/DOMKit/WebIDL/Strings.swift | 32 +-- Sources/DOMKit/WebIDL/TestUtils.swift | 6 +- Sources/DOMKit/WebIDL/Typedefs.swift | 218 +++++++-------- Sources/DOMKit/WebIDL/URL.swift | 16 +- Sources/DOMKit/WebIDL/USBDirection.swift | 2 +- Sources/DOMKit/WebIDL/WebAssembly.swift | 24 +- .../WebIDL/WebGLContextAttributes.swift | 12 +- .../WebIDL/WebGLRenderingContextBase.swift | 20 +- Sources/DOMKit/WebIDL/Window.swift | 160 +++++------ .../DOMKit/WebIDL/WindowEventHandlers.swift | 20 +- .../WebIDL/WindowOrWorkerGlobalScope.swift | 12 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 2 +- Sources/DOMKit/WebIDL/WorkerNavigator.swift | 14 +- Sources/DOMKit/WebIDL/XRFrame.swift | 36 +-- Sources/DOMKit/WebIDL/XRHitTestResult.swift | 8 +- Sources/DOMKit/WebIDL/XRInputSource.swift | 6 +- Sources/DOMKit/WebIDL/XRRenderState.swift | 8 +- Sources/DOMKit/WebIDL/XRSession.swift | 52 ++-- Sources/DOMKit/WebIDL/XRSessionInit.swift | 10 +- Sources/DOMKit/WebIDL/console.swift | 40 +-- 103 files changed, 1418 insertions(+), 1587 deletions(-) diff --git a/Sources/DOMKit/WebIDL/Animation.swift b/Sources/DOMKit/WebIDL/Animation.swift index de6e4e1c..447bc269 100644 --- a/Sources/DOMKit/WebIDL/Animation.swift +++ b/Sources/DOMKit/WebIDL/Animation.swift @@ -7,8 +7,6 @@ public class Animation: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.Animation].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _startTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.startTime) - _currentTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentTime) _id = ReadWriteAttribute(jsObject: jsObject, name: Strings.id) _effect = ReadWriteAttribute(jsObject: jsObject, name: Strings.effect) _timeline = ReadWriteAttribute(jsObject: jsObject, name: Strings.timeline) @@ -21,15 +19,11 @@ public class Animation: EventTarget { _onfinish = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfinish) _oncancel = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncancel) _onremove = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremove) + _startTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.startTime) + _currentTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentTime) super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var startTime: CSSNumberish? - - @ReadWriteAttribute - public var currentTime: CSSNumberish? - public convenience init(effect: AnimationEffect? = nil, timeline: AnimationTimeline? = nil) { self.init(unsafelyWrapping: Self.constructor.new(effect?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined)) } @@ -101,4 +95,10 @@ public class Animation: EventTarget { public func commitStyles() { _ = jsObject[Strings.commitStyles]!() } + + @ReadWriteAttribute + public var startTime: CSSNumberish? + + @ReadWriteAttribute + public var currentTime: CSSNumberish? } diff --git a/Sources/DOMKit/WebIDL/AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect.swift index 643370c2..0d53aac5 100644 --- a/Sources/DOMKit/WebIDL/AnimationEffect.swift +++ b/Sources/DOMKit/WebIDL/AnimationEffect.swift @@ -15,6 +15,18 @@ public class AnimationEffect: JSBridgedClass { self.jsObject = jsObject } + public func getTiming() -> EffectTiming { + jsObject[Strings.getTiming]!().fromJSValue()! + } + + public func getComputedTiming() -> ComputedEffectTiming { + jsObject[Strings.getComputedTiming]!().fromJSValue()! + } + + public func updateTiming(timing: OptionalEffectTiming? = nil) { + _ = jsObject[Strings.updateTiming]!(timing?.jsValue() ?? .undefined) + } + @ReadonlyAttribute public var parent: GroupEffect? @@ -39,16 +51,4 @@ public class AnimationEffect: JSBridgedClass { public func remove() { _ = jsObject[Strings.remove]!() } - - public func getTiming() -> EffectTiming { - jsObject[Strings.getTiming]!().fromJSValue()! - } - - public func getComputedTiming() -> ComputedEffectTiming { - jsObject[Strings.getComputedTiming]!().fromJSValue()! - } - - public func updateTiming(timing: OptionalEffectTiming? = nil) { - _ = jsObject[Strings.updateTiming]!(timing?.jsValue() ?? .undefined) - } } diff --git a/Sources/DOMKit/WebIDL/AnimationTimeline.swift b/Sources/DOMKit/WebIDL/AnimationTimeline.swift index 34c8bc8d..c249f34c 100644 --- a/Sources/DOMKit/WebIDL/AnimationTimeline.swift +++ b/Sources/DOMKit/WebIDL/AnimationTimeline.swift @@ -9,22 +9,22 @@ public class AnimationTimeline: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) _phase = ReadonlyAttribute(jsObject: jsObject, name: Strings.phase) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) self.jsObject = jsObject } + @ReadonlyAttribute + public var currentTime: Double? + + @ReadonlyAttribute + public var phase: TimelinePhase + @ReadonlyAttribute public var duration: CSSNumberish? public func play(effect: AnimationEffect? = nil) -> Animation { jsObject[Strings.play]!(effect?.jsValue() ?? .undefined).fromJSValue()! } - - @ReadonlyAttribute - public var currentTime: Double? - - @ReadonlyAttribute - public var phase: TimelinePhase } diff --git a/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift index 9bd26ae1..d1d060aa 100644 --- a/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift @@ -10,7 +10,5 @@ public class AnimationWorkletGlobalScope: WorkletGlobalScope { super.init(unsafelyWrapping: jsObject) } - public func registerAnimator(name: String, animatorCtor: AnimatorInstanceConstructor) { - _ = jsObject[Strings.registerAnimator]!(name.jsValue(), animatorCtor.jsValue()) - } + // XXX: member 'registerAnimator' is ignored } diff --git a/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift index 92cdd5a6..6acd31c9 100644 --- a/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift @@ -13,9 +13,7 @@ public class AudioWorkletGlobalScope: WorkletGlobalScope { super.init(unsafelyWrapping: jsObject) } - public func registerProcessor(name: String, processorCtor: AudioWorkletProcessorConstructor) { - _ = jsObject[Strings.registerProcessor]!(name.jsValue(), processorCtor.jsValue()) - } + // XXX: member 'registerProcessor' is ignored @ReadonlyAttribute public var currentFrame: UInt64 diff --git a/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift b/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift index c27f68e9..94bb29d7 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift @@ -7,7 +7,7 @@ public enum AuthenticatorTransport: JSString, JSValueCompatible { case usb = "usb" case nfc = "nfc" case ble = "ble" - case internal = "internal" + case `internal` = "internal" public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { diff --git a/Sources/DOMKit/WebIDL/BaseAudioContext.swift b/Sources/DOMKit/WebIDL/BaseAudioContext.swift index b4fc6c64..63ad0fdb 100644 --- a/Sources/DOMKit/WebIDL/BaseAudioContext.swift +++ b/Sources/DOMKit/WebIDL/BaseAudioContext.swift @@ -110,13 +110,7 @@ public class BaseAudioContext: EventTarget { jsObject[Strings.createWaveShaper]!().fromJSValue()! } - public func decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback? = nil, errorCallback: DecodeErrorCallback? = nil) -> JSPromise { - jsObject[Strings.decodeAudioData]!(audioData.jsValue(), successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'decodeAudioData' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback? = nil, errorCallback: DecodeErrorCallback? = nil) async throws -> AudioBuffer { - let _promise: JSPromise = jsObject[Strings.decodeAudioData]!(audioData.jsValue(), successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + // XXX: member 'decodeAudioData' is ignored } diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index d6d01966..031103f7 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -5,320 +5,320 @@ import JavaScriptKit public enum CSS { public static var jsObject: JSObject { - JSObject.global.[Strings.CSS].object! + JSObject.global[Strings.CSS].object! } - public static func registerProperty(definition: PropertyDefinition) { - _ = JSObject.global.[Strings.CSS].object![Strings.registerProperty]!(definition.jsValue()) - } - - public static func supports(property: String, value: String) -> Bool { - JSObject.global.[Strings.CSS].object![Strings.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! - } + public static var paintWorklet: Worklet { ReadonlyAttribute[Strings.paintWorklet, in: jsObject] } - public static func supports(conditionText: String) -> Bool { - JSObject.global.[Strings.CSS].object![Strings.supports]!(conditionText.jsValue()).fromJSValue()! - } + public static var layoutWorklet: Worklet { ReadonlyAttribute[Strings.layoutWorklet, in: jsObject] } public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - JSObject.global.[Strings.CSS].object![Strings.parseStylesheet]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.parseStylesheet]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { - let _promise: JSPromise = JSObject.global.[Strings.CSS].object![Strings.parseStylesheet]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.CSS].object![Strings.parseStylesheet]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - JSObject.global.[Strings.CSS].object![Strings.parseRuleList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.parseRuleList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { - let _promise: JSPromise = JSObject.global.[Strings.CSS].object![Strings.parseRuleList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.CSS].object![Strings.parseRuleList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - JSObject.global.[Strings.CSS].object![Strings.parseRule]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.parseRule]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> CSSParserRule { - let _promise: JSPromise = JSObject.global.[Strings.CSS].object![Strings.parseRule]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.CSS].object![Strings.parseRule]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - JSObject.global.[Strings.CSS].object![Strings.parseDeclarationList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.parseDeclarationList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { - let _promise: JSPromise = JSObject.global.[Strings.CSS].object![Strings.parseDeclarationList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.CSS].object![Strings.parseDeclarationList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func parseDeclaration(css: String, options: CSSParserOptions? = nil) -> CSSParserDeclaration { - JSObject.global.[Strings.CSS].object![Strings.parseDeclaration]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.parseDeclaration]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } public static func parseValue(css: String) -> CSSToken { - JSObject.global.[Strings.CSS].object![Strings.parseValue]!(css.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.parseValue]!(css.jsValue()).fromJSValue()! } public static func parseValueList(css: String) -> [CSSToken] { - JSObject.global.[Strings.CSS].object![Strings.parseValueList]!(css.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.parseValueList]!(css.jsValue()).fromJSValue()! } public static func parseCommaValueList(css: String) -> [[CSSToken]] { - JSObject.global.[Strings.CSS].object![Strings.parseCommaValueList]!(css.jsValue()).fromJSValue()! - } - - public static var elementSources: JSValue { ReadonlyAttribute[Strings.elementSources, in: jsObject] } - - public static var layoutWorklet: Worklet { ReadonlyAttribute[Strings.layoutWorklet, in: jsObject] } - - public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } - - public static func escape(ident: String) -> String { - JSObject.global.[Strings.CSS].object![Strings.escape]!(ident.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.parseCommaValueList]!(css.jsValue()).fromJSValue()! } public static func number(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.number]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.number]!(value.jsValue()).fromJSValue()! } public static func percent(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.percent]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.percent]!(value.jsValue()).fromJSValue()! } public static func em(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.em]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.em]!(value.jsValue()).fromJSValue()! } public static func ex(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.ex]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.ex]!(value.jsValue()).fromJSValue()! } public static func ch(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.ch]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.ch]!(value.jsValue()).fromJSValue()! } public static func ic(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.ic]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.ic]!(value.jsValue()).fromJSValue()! } public static func rem(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.rem]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.rem]!(value.jsValue()).fromJSValue()! } public static func lh(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.lh]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.lh]!(value.jsValue()).fromJSValue()! } public static func rlh(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.rlh]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.rlh]!(value.jsValue()).fromJSValue()! } public static func vw(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.vw]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.vw]!(value.jsValue()).fromJSValue()! } public static func vh(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.vh]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.vh]!(value.jsValue()).fromJSValue()! } public static func vi(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.vi]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.vi]!(value.jsValue()).fromJSValue()! } public static func vb(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.vb]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.vb]!(value.jsValue()).fromJSValue()! } public static func vmin(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.vmin]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.vmin]!(value.jsValue()).fromJSValue()! } public static func vmax(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.vmax]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.vmax]!(value.jsValue()).fromJSValue()! } public static func svw(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.svw]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.svw]!(value.jsValue()).fromJSValue()! } public static func svh(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.svh]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.svh]!(value.jsValue()).fromJSValue()! } public static func svi(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.svi]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.svi]!(value.jsValue()).fromJSValue()! } public static func svb(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.svb]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.svb]!(value.jsValue()).fromJSValue()! } public static func svmin(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.svmin]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.svmin]!(value.jsValue()).fromJSValue()! } public static func svmax(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.svmax]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.svmax]!(value.jsValue()).fromJSValue()! } public static func lvw(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.lvw]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.lvw]!(value.jsValue()).fromJSValue()! } public static func lvh(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.lvh]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.lvh]!(value.jsValue()).fromJSValue()! } public static func lvi(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.lvi]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.lvi]!(value.jsValue()).fromJSValue()! } public static func lvb(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.lvb]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.lvb]!(value.jsValue()).fromJSValue()! } public static func lvmin(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.lvmin]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.lvmin]!(value.jsValue()).fromJSValue()! } public static func lvmax(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.lvmax]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.lvmax]!(value.jsValue()).fromJSValue()! } public static func dvw(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.dvw]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.dvw]!(value.jsValue()).fromJSValue()! } public static func dvh(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.dvh]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.dvh]!(value.jsValue()).fromJSValue()! } public static func dvi(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.dvi]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.dvi]!(value.jsValue()).fromJSValue()! } public static func dvb(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.dvb]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.dvb]!(value.jsValue()).fromJSValue()! } public static func dvmin(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.dvmin]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.dvmin]!(value.jsValue()).fromJSValue()! } public static func dvmax(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.dvmax]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.dvmax]!(value.jsValue()).fromJSValue()! } public static func cqw(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.cqw]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.cqw]!(value.jsValue()).fromJSValue()! } public static func cqh(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.cqh]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.cqh]!(value.jsValue()).fromJSValue()! } public static func cqi(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.cqi]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.cqi]!(value.jsValue()).fromJSValue()! } public static func cqb(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.cqb]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.cqb]!(value.jsValue()).fromJSValue()! } public static func cqmin(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.cqmin]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.cqmin]!(value.jsValue()).fromJSValue()! } public static func cqmax(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.cqmax]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.cqmax]!(value.jsValue()).fromJSValue()! } public static func cm(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.cm]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.cm]!(value.jsValue()).fromJSValue()! } public static func mm(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.mm]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.mm]!(value.jsValue()).fromJSValue()! } public static func Q(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.Q]!(value.jsValue()).fromJSValue()! + JSObject.global[Strings.CSS].object![Strings.Q]!(value.jsValue()).fromJSValue()! + } + + public static func `in`(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.in]!(value.jsValue()).fromJSValue()! + } + + public static func pt(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.pt]!(value.jsValue()).fromJSValue()! + } + + public static func pc(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.pc]!(value.jsValue()).fromJSValue()! + } + + public static func px(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.px]!(value.jsValue()).fromJSValue()! + } + + public static func deg(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.deg]!(value.jsValue()).fromJSValue()! } - public static func in (value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.in]!(value.jsValue()).fromJSValue()! - } + public static func grad(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.grad]!(value.jsValue()).fromJSValue()! + } - public static func pt(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.pt]!(value.jsValue()).fromJSValue()! - } + public static func rad(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.rad]!(value.jsValue()).fromJSValue()! + } - public static func pc(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.pc]!(value.jsValue()).fromJSValue()! - } + public static func turn(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.turn]!(value.jsValue()).fromJSValue()! + } - public static func px(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.px]!(value.jsValue()).fromJSValue()! - } + public static func s(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.s]!(value.jsValue()).fromJSValue()! + } - public static func deg(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.deg]!(value.jsValue()).fromJSValue()! - } + public static func ms(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.ms]!(value.jsValue()).fromJSValue()! + } - public static func grad(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.grad]!(value.jsValue()).fromJSValue()! - } + public static func Hz(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.Hz]!(value.jsValue()).fromJSValue()! + } - public static func rad(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.rad]!(value.jsValue()).fromJSValue()! - } + public static func kHz(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.kHz]!(value.jsValue()).fromJSValue()! + } - public static func turn(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.turn]!(value.jsValue()).fromJSValue()! - } + public static func dpi(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.dpi]!(value.jsValue()).fromJSValue()! + } - public static func s(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.s]!(value.jsValue()).fromJSValue()! - } + public static func dpcm(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.dpcm]!(value.jsValue()).fromJSValue()! + } - public static func ms(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.ms]!(value.jsValue()).fromJSValue()! - } + public static func dppx(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.dppx]!(value.jsValue()).fromJSValue()! + } - public static func Hz(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.Hz]!(value.jsValue()).fromJSValue()! - } + public static func fr(value: Double) -> CSSUnitValue { + JSObject.global[Strings.CSS].object![Strings.fr]!(value.jsValue()).fromJSValue()! + } - public static func kHz(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.kHz]!(value.jsValue()).fromJSValue()! - } + public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } - public static func dpi(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.dpi]!(value.jsValue()).fromJSValue()! - } + public static var animationWorklet: Worklet { ReadonlyAttribute[Strings.animationWorklet, in: jsObject] } - public static func dpcm(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.dpcm]!(value.jsValue()).fromJSValue()! - } + public static func supports(property: String, value: String) -> Bool { + JSObject.global[Strings.CSS].object![Strings.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! + } - public static func dppx(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.dppx]!(value.jsValue()).fromJSValue()! - } + public static func supports(conditionText: String) -> Bool { + JSObject.global[Strings.CSS].object![Strings.supports]!(conditionText.jsValue()).fromJSValue()! + } - public static func fr(value: Double) -> CSSUnitValue { - JSObject.global.[Strings.CSS].object![Strings.fr]!(value.jsValue()).fromJSValue()! - } + public static var elementSources: JSValue { ReadonlyAttribute[Strings.elementSources, in: jsObject] } - public static var animationWorklet: Worklet { ReadonlyAttribute[Strings.animationWorklet, in: jsObject] } + public static func registerProperty(definition: PropertyDefinition) { + _ = JSObject.global[Strings.CSS].object![Strings.registerProperty]!(definition.jsValue()) + } - public static var paintWorklet: Worklet { ReadonlyAttribute[Strings.paintWorklet, in: jsObject] } + public static func escape(ident: String) -> String { + JSObject.global[Strings.CSS].object![Strings.escape]!(ident.jsValue()).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/CSSColor.swift b/Sources/DOMKit/WebIDL/CSSColor.swift index 48a917df..0ac4cc2c 100644 --- a/Sources/DOMKit/WebIDL/CSSColor.swift +++ b/Sources/DOMKit/WebIDL/CSSColor.swift @@ -7,7 +7,6 @@ public class CSSColor: CSSColorValue { override public class var constructor: JSFunction { JSObject.global[Strings.CSSColor].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _colorSpace = ReadWriteAttribute(jsObject: jsObject, name: Strings.colorSpace) _channels = ReadWriteAttribute(jsObject: jsObject, name: Strings.channels) _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) super.init(unsafelyWrapping: jsObject) @@ -17,11 +16,7 @@ public class CSSColor: CSSColorValue { self.init(unsafelyWrapping: Self.constructor.new(colorSpace.jsValue(), channels.jsValue(), alpha?.jsValue() ?? .undefined)) } - private var _colorSpace: ReadWriteAttribute - override public var colorSpace: CSSKeywordish { - get { _colorSpace.wrappedValue } - set { _colorSpace.wrappedValue = newValue } - } + // XXX: member 'colorSpace' is ignored @ReadWriteAttribute public var channels: [CSSColorPercent] diff --git a/Sources/DOMKit/WebIDL/CSSImportRule.swift b/Sources/DOMKit/WebIDL/CSSImportRule.swift index 260ba76a..30ac95ca 100644 --- a/Sources/DOMKit/WebIDL/CSSImportRule.swift +++ b/Sources/DOMKit/WebIDL/CSSImportRule.swift @@ -7,13 +7,16 @@ public class CSSImportRule: CSSRule { override public class var constructor: JSFunction { JSObject.global[Strings.CSSImportRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _layerName = ReadonlyAttribute(jsObject: jsObject, name: Strings.layerName) _href = ReadonlyAttribute(jsObject: jsObject, name: Strings.href) _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) _styleSheet = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleSheet) - _layerName = ReadonlyAttribute(jsObject: jsObject, name: Strings.layerName) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var layerName: String? + @ReadonlyAttribute public var href: String @@ -22,7 +25,4 @@ public class CSSImportRule: CSSRule { @ReadonlyAttribute public var styleSheet: CSSStyleSheet - - @ReadonlyAttribute - public var layerName: String? } diff --git a/Sources/DOMKit/WebIDL/CSSMathValue.swift b/Sources/DOMKit/WebIDL/CSSMathValue.swift index 31ebe083..499ecc51 100644 --- a/Sources/DOMKit/WebIDL/CSSMathValue.swift +++ b/Sources/DOMKit/WebIDL/CSSMathValue.swift @@ -12,5 +12,5 @@ public class CSSMathValue: CSSNumericValue { } @ReadonlyAttribute - public var operator: CSSMathOperator + public var `operator`: CSSMathOperator } diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift index 3cccc5fc..f9f6b33a 100644 --- a/Sources/DOMKit/WebIDL/CSSRule.swift +++ b/Sources/DOMKit/WebIDL/CSSRule.swift @@ -16,14 +16,16 @@ public class CSSRule: JSBridgedClass { self.jsObject = jsObject } + public static let FONT_FEATURE_VALUES_RULE: UInt16 = 14 + + public static let VIEWPORT_RULE: UInt16 = 15 + public static let SUPPORTS_RULE: UInt16 = 12 public static let KEYFRAMES_RULE: UInt16 = 7 public static let KEYFRAME_RULE: UInt16 = 8 - public static let FONT_FEATURE_VALUES_RULE: UInt16 = 14 - @ReadWriteAttribute public var cssText: String @@ -52,7 +54,5 @@ public class CSSRule: JSBridgedClass { public static let NAMESPACE_RULE: UInt16 = 10 - public static let VIEWPORT_RULE: UInt16 = 15 - public static let COUNTER_STYLE_RULE: UInt16 = 11 } diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift index c0ebc90f..8c1b4dc1 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -7,13 +7,22 @@ public class CSSStyleRule: CSSRule { override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) + _styleMap = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleMap) _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - _styleMap = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleMap) + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var styleMap: StylePropertyMap + + @ReadWriteAttribute + public var selectorText: String + + @ReadonlyAttribute + public var style: CSSStyleDeclaration + @ReadonlyAttribute public var cssRules: CSSRuleList @@ -24,13 +33,4 @@ public class CSSStyleRule: CSSRule { public func deleteRule(index: UInt32) { _ = jsObject[Strings.deleteRule]!(index.jsValue()) } - - @ReadWriteAttribute - public var selectorText: String - - @ReadonlyAttribute - public var style: CSSStyleDeclaration - - @ReadonlyAttribute - public var styleMap: StylePropertyMap } diff --git a/Sources/DOMKit/WebIDL/Client.swift b/Sources/DOMKit/WebIDL/Client.swift index bcc64716..9c860c83 100644 --- a/Sources/DOMKit/WebIDL/Client.swift +++ b/Sources/DOMKit/WebIDL/Client.swift @@ -9,14 +9,17 @@ public class Client: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _lifecycleState = ReadonlyAttribute(jsObject: jsObject, name: Strings.lifecycleState) _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) _frameType = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameType) _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _lifecycleState = ReadonlyAttribute(jsObject: jsObject, name: Strings.lifecycleState) self.jsObject = jsObject } + @ReadonlyAttribute + public var lifecycleState: ClientLifecycleState + @ReadonlyAttribute public var url: String @@ -36,7 +39,4 @@ public class Client: JSBridgedClass { public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } - - @ReadonlyAttribute - public var lifecycleState: ClientLifecycleState } diff --git a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift index 3f45b6ee..1fc00bf4 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift @@ -13,9 +13,7 @@ public class ComputePressureObserver: JSBridgedClass { self.jsObject = jsObject } - public convenience init(callback: ComputePressureUpdateCallback, options: ComputePressureObserverOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue(), options?.jsValue() ?? .undefined)) - } + // XXX: constructor is ignored public func observe(source: ComputePressureSource) { _ = jsObject[Strings.observe]!(source.jsValue()) diff --git a/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift index e91a4365..36bf95fb 100644 --- a/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift +++ b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift @@ -4,42 +4,42 @@ import JavaScriptEventLoop import JavaScriptKit public class ComputedEffectTiming: BridgedDictionary { - public convenience init(startTime: CSSNumberish, endTime: CSSNumberish, activeDuration: CSSNumberish, localTime: CSSNumberish?, progress: Double?, currentIteration: Double?) { + public convenience init(progress: Double?, currentIteration: Double?, startTime: CSSNumberish, endTime: CSSNumberish, activeDuration: CSSNumberish, localTime: CSSNumberish?) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.progress] = progress.jsValue() + object[Strings.currentIteration] = currentIteration.jsValue() object[Strings.startTime] = startTime.jsValue() object[Strings.endTime] = endTime.jsValue() object[Strings.activeDuration] = activeDuration.jsValue() object[Strings.localTime] = localTime.jsValue() - 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) _startTime = ReadWriteAttribute(jsObject: object, name: Strings.startTime) _endTime = ReadWriteAttribute(jsObject: object, name: Strings.endTime) _activeDuration = ReadWriteAttribute(jsObject: object, name: Strings.activeDuration) _localTime = ReadWriteAttribute(jsObject: object, name: Strings.localTime) - _progress = ReadWriteAttribute(jsObject: object, name: Strings.progress) - _currentIteration = ReadWriteAttribute(jsObject: object, name: Strings.currentIteration) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var startTime: CSSNumberish + public var progress: Double? @ReadWriteAttribute - public var endTime: CSSNumberish + public var currentIteration: Double? @ReadWriteAttribute - public var activeDuration: CSSNumberish + public var startTime: CSSNumberish @ReadWriteAttribute - public var localTime: CSSNumberish? + public var endTime: CSSNumberish @ReadWriteAttribute - public var progress: Double? + public var activeDuration: CSSNumberish @ReadWriteAttribute - public var currentIteration: Double? + public var localTime: CSSNumberish? } diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index 506a87a2..c2277fe6 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -18,16 +18,6 @@ public class DataTransferItem: JSBridgedClass { jsObject[Strings.webkitGetAsEntry]!().fromJSValue()! } - public func getAsFileSystemHandle() -> JSPromise { - jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getAsFileSystemHandle() async throws -> FileSystemHandle? { - let _promise: JSPromise = jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! - return try await _promise.get().fromJSValue()! - } - @ReadonlyAttribute public var kind: String @@ -39,4 +29,14 @@ public class DataTransferItem: JSBridgedClass { public func getAsFile() -> File? { jsObject[Strings.getAsFile]!().fromJSValue()! } + + public func getAsFileSystemHandle() -> JSPromise { + jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getAsFileSystemHandle() async throws -> FileSystemHandle? { + let _promise: JSPromise = jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index aed3881d..38336a95 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -7,13 +7,16 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid override public class var constructor: JSFunction { JSObject.global[Strings.DedicatedWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _onrtctransform = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrtctransform) _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) - _onrtctransform = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrtctransform) super.init(unsafelyWrapping: jsObject) } + @ClosureAttribute.Optional1 + public var onrtctransform: EventHandler + @ReadonlyAttribute public var name: String @@ -34,7 +37,4 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid @ClosureAttribute.Optional1 public var onmessageerror: EventHandler - - @ClosureAttribute.Optional1 - public var onrtctransform: EventHandler } diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 7581b45b..732ec5a3 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -3,10 +3,17 @@ import JavaScriptEventLoop import JavaScriptKit -public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GeometryUtils, FontFaceSource, GlobalEventHandlers, DocumentAndElementEventHandlers { +public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GeometryUtils, GlobalEventHandlers, DocumentAndElementEventHandlers, FontFaceSource { override public class var constructor: JSFunction { JSObject.global[Strings.Document].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _fragmentDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.fragmentDirective) + _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) + _namedFlows = ReadonlyAttribute(jsObject: jsObject, name: Strings.namedFlows) + _fullscreenEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreenEnabled) + _fullscreen = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreen) + _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) + _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) _implementation = ReadonlyAttribute(jsObject: jsObject, name: Strings.implementation) _URL = ReadonlyAttribute(jsObject: jsObject, name: Strings.URL) _documentURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURI) @@ -20,7 +27,8 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN _onpointerlockchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockchange) _onpointerlockerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockerror) _scrollingElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollingElement) - _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) + _timeline = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeline) + _rootElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootElement) _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) _domain = ReadWriteAttribute(jsObject: jsObject, name: Strings.domain) _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) @@ -52,21 +60,19 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN _anchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchors) _applets = ReadonlyAttribute(jsObject: jsObject, name: Strings.applets) _all = ReadonlyAttribute(jsObject: jsObject, name: Strings.all) - _fragmentDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.fragmentDirective) - _timeline = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeline) - _namedFlows = ReadonlyAttribute(jsObject: jsObject, name: Strings.namedFlows) - _rootElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootElement) _pictureInPictureEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.pictureInPictureEnabled) _onfreeze = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfreeze) _onresume = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresume) _wasDiscarded = ReadonlyAttribute(jsObject: jsObject, name: Strings.wasDiscarded) - _fullscreenEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreenEnabled) - _fullscreen = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreen) - _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) - _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var fragmentDirective: FragmentDirective + + @ReadonlyAttribute + public var permissionsPolicy: PermissionsPolicy + public func measureElement(element: Element) -> FontMetrics { jsObject[Strings.measureElement]!(element.jsValue()).fromJSValue()! } @@ -75,6 +81,35 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN jsObject[Strings.measureText]!(text.jsValue(), styleMap.jsValue()).fromJSValue()! } + @ReadonlyAttribute + public var namedFlows: NamedFlowMap + + @ReadonlyAttribute + public var fullscreenEnabled: Bool + + @ReadonlyAttribute + public var fullscreen: Bool + + public func exitFullscreen() -> JSPromise { + jsObject[Strings.exitFullscreen]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func exitFullscreen() async throws { + let _promise: JSPromise = jsObject[Strings.exitFullscreen]!().fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var onfullscreenchange: EventHandler + + @ClosureAttribute.Optional1 + public var onfullscreenerror: EventHandler + + public func getSelection() -> Selection? { + jsObject[Strings.getSelection]!().fromJSValue()! + } + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -203,27 +238,10 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN public var scrollingElement: Element? @ReadonlyAttribute - public var permissionsPolicy: PermissionsPolicy - - public func hasStorageAccess() -> JSPromise { - jsObject[Strings.hasStorageAccess]!().fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func hasStorageAccess() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.hasStorageAccess]!().fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - public func requestStorageAccess() -> JSPromise { - jsObject[Strings.requestStorageAccess]!().fromJSValue()! - } + public var timeline: DocumentTimeline - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestStorageAccess() async throws { - let _promise: JSPromise = jsObject[Strings.requestStorageAccess]!().fromJSValue()! - _ = try await _promise.get() - } + @ReadonlyAttribute + public var rootElement: SVGSVGElement? @ReadonlyAttribute public var location: Location? @@ -386,17 +404,25 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN @ReadonlyAttribute public var all: HTMLAllCollection - @ReadonlyAttribute - public var fragmentDirective: FragmentDirective + public func hasStorageAccess() -> JSPromise { + jsObject[Strings.hasStorageAccess]!().fromJSValue()! + } - @ReadonlyAttribute - public var timeline: DocumentTimeline + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func hasStorageAccess() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.hasStorageAccess]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } - @ReadonlyAttribute - public var namedFlows: NamedFlowMap + public func requestStorageAccess() -> JSPromise { + jsObject[Strings.requestStorageAccess]!().fromJSValue()! + } - @ReadonlyAttribute - public var rootElement: SVGSVGElement? + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestStorageAccess() async throws { + let _promise: JSPromise = jsObject[Strings.requestStorageAccess]!().fromJSValue()! + _ = try await _promise.get() + } @ReadonlyAttribute public var pictureInPictureEnabled: Bool @@ -419,30 +445,4 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN @ReadonlyAttribute public var wasDiscarded: Bool - - public func getSelection() -> Selection? { - jsObject[Strings.getSelection]!().fromJSValue()! - } - - @ReadonlyAttribute - public var fullscreenEnabled: Bool - - @ReadonlyAttribute - public var fullscreen: Bool - - public func exitFullscreen() -> JSPromise { - jsObject[Strings.exitFullscreen]!().fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func exitFullscreen() async throws { - let _promise: JSPromise = jsObject[Strings.exitFullscreen]!().fromJSValue()! - _ = try await _promise.get() - } - - @ClosureAttribute.Optional1 - public var onfullscreenchange: EventHandler - - @ClosureAttribute.Optional1 - public var onfullscreenerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index 0f1e3cb6..822430f7 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol DocumentOrShadowRoot: JSBridgedClass {} public extension DocumentOrShadowRoot { - var pointerLockElement: Element? { ReadonlyAttribute[Strings.pointerLockElement, in: jsObject] } - - var styleSheets: StyleSheetList { ReadonlyAttribute[Strings.styleSheets, in: jsObject] } - - var adoptedStyleSheets: [CSSStyleSheet] { - get { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] } - set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } - } + var fullscreenElement: Element? { ReadonlyAttribute[Strings.fullscreenElement, in: jsObject] } - var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } + var pointerLockElement: Element? { ReadonlyAttribute[Strings.pointerLockElement, in: jsObject] } func getAnimations() -> [Animation] { jsObject[Strings.getAnimations]!().fromJSValue()! } + var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } + var pictureInPictureElement: Element? { ReadonlyAttribute[Strings.pictureInPictureElement, in: jsObject] } - var fullscreenElement: Element? { ReadonlyAttribute[Strings.fullscreenElement, in: jsObject] } + var styleSheets: StyleSheetList { ReadonlyAttribute[Strings.styleSheets, in: jsObject] } + + var adoptedStyleSheets: [CSSStyleSheet] { + get { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] } + set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } + } } diff --git a/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift b/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift index 979a2dd4..a2548abc 100644 --- a/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift +++ b/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift @@ -4,9 +4,9 @@ import JavaScriptEventLoop import JavaScriptKit public class EcdhKeyDeriveParams: BridgedDictionary { - public convenience init(public _: CryptoKey) { + public convenience init(public: CryptoKey) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.public] = public .jsValue() + object[Strings.public] = `public`.jsValue() self.init(unsafelyWrapping: object) } @@ -16,5 +16,5 @@ public class EcdhKeyDeriveParams: BridgedDictionary { } @ReadWriteAttribute - public var public: CryptoKey + public var `public`: CryptoKey } diff --git a/Sources/DOMKit/WebIDL/EffectTiming.swift b/Sources/DOMKit/WebIDL/EffectTiming.swift index e418897f..21e37c53 100644 --- a/Sources/DOMKit/WebIDL/EffectTiming.swift +++ b/Sources/DOMKit/WebIDL/EffectTiming.swift @@ -4,10 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class EffectTiming: BridgedDictionary { - public convenience init(playbackRate: Double, duration: __UNSUPPORTED_UNION__, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String) { + public convenience init(delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String, playbackRate: Double, duration: __UNSUPPORTED_UNION__) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.playbackRate] = playbackRate.jsValue() - object[Strings.duration] = duration.jsValue() object[Strings.delay] = delay.jsValue() object[Strings.endDelay] = endDelay.jsValue() object[Strings.fill] = fill.jsValue() @@ -15,12 +13,12 @@ public class EffectTiming: BridgedDictionary { object[Strings.iterations] = iterations.jsValue() object[Strings.direction] = direction.jsValue() object[Strings.easing] = easing.jsValue() + object[Strings.playbackRate] = playbackRate.jsValue() + object[Strings.duration] = duration.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) - _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) _endDelay = ReadWriteAttribute(jsObject: object, name: Strings.endDelay) _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) @@ -28,15 +26,11 @@ public class EffectTiming: BridgedDictionary { _iterations = ReadWriteAttribute(jsObject: object, name: Strings.iterations) _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) + _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var playbackRate: Double - - @ReadWriteAttribute - public var duration: __UNSUPPORTED_UNION__ - @ReadWriteAttribute public var delay: Double @@ -57,4 +51,10 @@ public class EffectTiming: BridgedDictionary { @ReadWriteAttribute public var easing: String + + @ReadWriteAttribute + public var playbackRate: Double + + @ReadWriteAttribute + public var duration: __UNSUPPORTED_UNION__ } diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index c5478522..ea746b15 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -3,10 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit -public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin, GeometryUtils, Animatable, Region, InnerHTML { +public class Element: Node, Region, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, GeometryUtils, ARIAMixin, Animatable, InnerHTML { override public class var constructor: JSFunction { JSObject.global[Strings.Element].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _elementTiming = ReadWriteAttribute(jsObject: jsObject, name: Strings.elementTiming) + _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) + _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) + _part = ReadonlyAttribute(jsObject: jsObject, name: Strings.part) _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) _prefix = ReadonlyAttribute(jsObject: jsObject, name: Strings.prefix) _localName = ReadonlyAttribute(jsObject: jsObject, name: Strings.localName) @@ -17,7 +21,6 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo _slot = ReadWriteAttribute(jsObject: jsObject, name: Strings.slot) _attributes = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributes) _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) - _editContext = ReadWriteAttribute(jsObject: jsObject, name: Strings.editContext) _scrollTop = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollTop) _scrollLeft = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollLeft) _scrollWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollWidth) @@ -26,14 +29,41 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo _clientLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientLeft) _clientWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientWidth) _clientHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientHeight) - _part = ReadonlyAttribute(jsObject: jsObject, name: Strings.part) - _elementTiming = ReadWriteAttribute(jsObject: jsObject, name: Strings.elementTiming) _outerHTML = ReadWriteAttribute(jsObject: jsObject, name: Strings.outerHTML) - _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) - _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) + _editContext = ReadWriteAttribute(jsObject: jsObject, name: Strings.editContext) super.init(unsafelyWrapping: jsObject) } + public func pseudo(type: String) -> CSSPseudoElement? { + jsObject[Strings.pseudo]!(type.jsValue()).fromJSValue()! + } + + public func computedStyleMap() -> StylePropertyMapReadOnly { + jsObject[Strings.computedStyleMap]!().fromJSValue()! + } + + @ReadWriteAttribute + public var elementTiming: String + + public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { + jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestFullscreen(options: FullscreenOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + @ClosureAttribute.Optional1 + public var onfullscreenchange: EventHandler + + @ClosureAttribute.Optional1 + public var onfullscreenerror: EventHandler + + @ReadonlyAttribute + public var part: DOMTokenList + @ReadonlyAttribute public var namespaceURI: String? @@ -164,13 +194,14 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo _ = jsObject[Strings.insertAdjacentText]!(`where`.jsValue(), data.jsValue()) } + public func setHTML(input: String, options: SetHTMLOptions? = nil) { + _ = jsObject[Strings.setHTML]!(input.jsValue(), options?.jsValue() ?? .undefined) + } + public func requestPointerLock() { _ = jsObject[Strings.requestPointerLock]!() } - @ReadWriteAttribute - public var editContext: EditContext? - public func getClientRects() -> DOMRectList { jsObject[Strings.getClientRects]!().fromJSValue()! } @@ -235,13 +266,16 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo @ReadonlyAttribute public var clientHeight: Int32 - @ReadonlyAttribute - public var part: DOMTokenList + @ReadWriteAttribute + public var outerHTML: String - public func computedStyleMap() -> StylePropertyMapReadOnly { - jsObject[Strings.computedStyleMap]!().fromJSValue()! + public func insertAdjacentHTML(position: String, text: String) { + _ = jsObject[Strings.insertAdjacentHTML]!(position.jsValue(), text.jsValue()) } + @ReadWriteAttribute + public var editContext: EditContext? + public func setPointerCapture(pointerId: Int32) { _ = jsObject[Strings.setPointerCapture]!(pointerId.jsValue()) } @@ -254,40 +288,6 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo jsObject[Strings.hasPointerCapture]!(pointerId.jsValue()).fromJSValue()! } - public func setHTML(input: String, options: SetHTMLOptions? = nil) { - _ = jsObject[Strings.setHTML]!(input.jsValue(), options?.jsValue() ?? .undefined) - } - - public func pseudo(type: String) -> CSSPseudoElement? { - jsObject[Strings.pseudo]!(type.jsValue()).fromJSValue()! - } - - @ReadWriteAttribute - public var elementTiming: String - - @ReadWriteAttribute - public var outerHTML: String - - public func insertAdjacentHTML(position: String, text: String) { - _ = jsObject[Strings.insertAdjacentHTML]!(position.jsValue(), text.jsValue()) - } - - public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { - jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestFullscreen(options: FullscreenOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() - } - - @ClosureAttribute.Optional1 - public var onfullscreenchange: EventHandler - - @ClosureAttribute.Optional1 - public var onfullscreenerror: EventHandler - public func getSpatialNavigationContainer() -> Node { jsObject[Strings.getSpatialNavigationContainer]!().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift index 0eea662c..cd592728 100644 --- a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift +++ b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol ElementCSSInlineStyle: JSBridgedClass {} public extension ElementCSSInlineStyle { - var style: CSSStyleDeclaration { ReadonlyAttribute[Strings.style, in: jsObject] } - var attributeStyleMap: StylePropertyMap { ReadonlyAttribute[Strings.attributeStyleMap, in: jsObject] } + + var style: CSSStyleDeclaration { ReadonlyAttribute[Strings.style, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift index ce834c3c..3622a861 100644 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift @@ -14,11 +14,7 @@ public class FileSystemDirectoryEntry: FileSystemEntry { jsObject[Strings.createReader]!().fromJSValue()! } - public func getFile(path: String? = nil, options: FileSystemFlags? = nil, successCallback: FileSystemEntryCallback? = nil, errorCallback: ErrorCallback? = nil) { - _ = jsObject[Strings.getFile]!(path?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined, successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined) - } + // XXX: member 'getFile' is ignored - public func getDirectory(path: String? = nil, options: FileSystemFlags? = nil, successCallback: FileSystemEntryCallback? = nil, errorCallback: ErrorCallback? = nil) { - _ = jsObject[Strings.getDirectory]!(path?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined, successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined) - } + // XXX: member 'getDirectory' is ignored } diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift index b94cb599..4789093d 100644 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift @@ -12,7 +12,5 @@ public class FileSystemDirectoryReader: JSBridgedClass { self.jsObject = jsObject } - public func readEntries(successCallback: FileSystemEntriesCallback, errorCallback: ErrorCallback? = nil) { - _ = jsObject[Strings.readEntries]!(successCallback.jsValue(), errorCallback?.jsValue() ?? .undefined) - } + // XXX: member 'readEntries' is ignored } diff --git a/Sources/DOMKit/WebIDL/FileSystemEntry.swift b/Sources/DOMKit/WebIDL/FileSystemEntry.swift index 197ec7d0..295352db 100644 --- a/Sources/DOMKit/WebIDL/FileSystemEntry.swift +++ b/Sources/DOMKit/WebIDL/FileSystemEntry.swift @@ -32,7 +32,5 @@ public class FileSystemEntry: JSBridgedClass { @ReadonlyAttribute public var filesystem: FileSystem - public func getParent(successCallback: FileSystemEntryCallback? = nil, errorCallback: ErrorCallback? = nil) { - _ = jsObject[Strings.getParent]!(successCallback?.jsValue() ?? .undefined, errorCallback?.jsValue() ?? .undefined) - } + // XXX: member 'getParent' is ignored } diff --git a/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift b/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift index 435b9bf6..a057dabf 100644 --- a/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift +++ b/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift @@ -10,7 +10,5 @@ public class FileSystemFileEntry: FileSystemEntry { super.init(unsafelyWrapping: jsObject) } - public func file(successCallback: FileCallback, errorCallback: ErrorCallback? = nil) { - _ = jsObject[Strings.file]!(successCallback.jsValue(), errorCallback?.jsValue() ?? .undefined) - } + // XXX: member 'file' is ignored } diff --git a/Sources/DOMKit/WebIDL/GPUBufferUsage.swift b/Sources/DOMKit/WebIDL/GPUBufferUsage.swift index f15122f0..19f24ee7 100644 --- a/Sources/DOMKit/WebIDL/GPUBufferUsage.swift +++ b/Sources/DOMKit/WebIDL/GPUBufferUsage.swift @@ -5,7 +5,7 @@ import JavaScriptKit public enum GPUBufferUsage { public static var jsObject: JSObject { - JSObject.global.[Strings.GPUBufferUsage].object! + JSObject.global[Strings.GPUBufferUsage].object! } public static let MAP_READ: GPUFlagsConstant = 0x0001 diff --git a/Sources/DOMKit/WebIDL/GPUColorWrite.swift b/Sources/DOMKit/WebIDL/GPUColorWrite.swift index 6127c126..300ca9a4 100644 --- a/Sources/DOMKit/WebIDL/GPUColorWrite.swift +++ b/Sources/DOMKit/WebIDL/GPUColorWrite.swift @@ -5,7 +5,7 @@ import JavaScriptKit public enum GPUColorWrite { public static var jsObject: JSObject { - JSObject.global.[Strings.GPUColorWrite].object! + JSObject.global[Strings.GPUColorWrite].object! } public static let RED: GPUFlagsConstant = 0x1 diff --git a/Sources/DOMKit/WebIDL/GPUMapMode.swift b/Sources/DOMKit/WebIDL/GPUMapMode.swift index ef0fd29b..efb6b83c 100644 --- a/Sources/DOMKit/WebIDL/GPUMapMode.swift +++ b/Sources/DOMKit/WebIDL/GPUMapMode.swift @@ -5,7 +5,7 @@ import JavaScriptKit public enum GPUMapMode { public static var jsObject: JSObject { - JSObject.global.[Strings.GPUMapMode].object! + JSObject.global[Strings.GPUMapMode].object! } public static let READ: GPUFlagsConstant = 0x0001 diff --git a/Sources/DOMKit/WebIDL/GPUShaderStage.swift b/Sources/DOMKit/WebIDL/GPUShaderStage.swift index bb57f0e2..cb86ea17 100644 --- a/Sources/DOMKit/WebIDL/GPUShaderStage.swift +++ b/Sources/DOMKit/WebIDL/GPUShaderStage.swift @@ -5,7 +5,7 @@ import JavaScriptKit public enum GPUShaderStage { public static var jsObject: JSObject { - JSObject.global.[Strings.GPUShaderStage].object! + JSObject.global[Strings.GPUShaderStage].object! } public static let VERTEX: GPUFlagsConstant = 0x1 diff --git a/Sources/DOMKit/WebIDL/GPUTextureUsage.swift b/Sources/DOMKit/WebIDL/GPUTextureUsage.swift index b346f48c..0f496028 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureUsage.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureUsage.swift @@ -5,7 +5,7 @@ import JavaScriptKit public enum GPUTextureUsage { public static var jsObject: JSObject { - JSObject.global.[Strings.GPUTextureUsage].object! + JSObject.global[Strings.GPUTextureUsage].object! } public static let COPY_SRC: GPUFlagsConstant = 0x01 diff --git a/Sources/DOMKit/WebIDL/Gamepad.swift b/Sources/DOMKit/WebIDL/Gamepad.swift index 66829d13..cdd39ed1 100644 --- a/Sources/DOMKit/WebIDL/Gamepad.swift +++ b/Sources/DOMKit/WebIDL/Gamepad.swift @@ -9,10 +9,6 @@ public class Gamepad: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) - _hapticActuators = ReadonlyAttribute(jsObject: jsObject, name: Strings.hapticActuators) - _pose = ReadonlyAttribute(jsObject: jsObject, name: Strings.pose) - _touchEvents = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchEvents) _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) _connected = ReadonlyAttribute(jsObject: jsObject, name: Strings.connected) @@ -20,39 +16,43 @@ public class Gamepad: JSBridgedClass { _mapping = ReadonlyAttribute(jsObject: jsObject, name: Strings.mapping) _axes = ReadonlyAttribute(jsObject: jsObject, name: Strings.axes) _buttons = ReadonlyAttribute(jsObject: jsObject, name: Strings.buttons) + _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) + _hapticActuators = ReadonlyAttribute(jsObject: jsObject, name: Strings.hapticActuators) + _pose = ReadonlyAttribute(jsObject: jsObject, name: Strings.pose) + _touchEvents = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchEvents) self.jsObject = jsObject } @ReadonlyAttribute - public var hand: GamepadHand + public var id: String @ReadonlyAttribute - public var hapticActuators: [GamepadHapticActuator] + public var index: Int32 @ReadonlyAttribute - public var pose: GamepadPose? + public var connected: Bool @ReadonlyAttribute - public var touchEvents: [GamepadTouch]? + public var timestamp: DOMHighResTimeStamp @ReadonlyAttribute - public var id: String + public var mapping: GamepadMappingType @ReadonlyAttribute - public var index: Int32 + public var axes: [Double] @ReadonlyAttribute - public var connected: Bool + public var buttons: [GamepadButton] @ReadonlyAttribute - public var timestamp: DOMHighResTimeStamp + public var hand: GamepadHand @ReadonlyAttribute - public var mapping: GamepadMappingType + public var hapticActuators: [GamepadHapticActuator] @ReadonlyAttribute - public var axes: [Double] + public var pose: GamepadPose? @ReadonlyAttribute - public var buttons: [GamepadButton] + public var touchEvents: [GamepadTouch]? } diff --git a/Sources/DOMKit/WebIDL/Geolocation.swift b/Sources/DOMKit/WebIDL/Geolocation.swift index b0ddbcdd..1524b6f6 100644 --- a/Sources/DOMKit/WebIDL/Geolocation.swift +++ b/Sources/DOMKit/WebIDL/Geolocation.swift @@ -12,13 +12,9 @@ public class Geolocation: JSBridgedClass { self.jsObject = jsObject } - public func getCurrentPosition(successCallback: PositionCallback, errorCallback: PositionErrorCallback? = nil, options: PositionOptions? = nil) { - _ = jsObject[Strings.getCurrentPosition]!(successCallback.jsValue(), errorCallback?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) - } + // XXX: member 'getCurrentPosition' is ignored - public func watchPosition(successCallback: PositionCallback, errorCallback: PositionErrorCallback? = nil, options: PositionOptions? = nil) -> Int32 { - jsObject[Strings.watchPosition]!(successCallback.jsValue(), errorCallback?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'watchPosition' is ignored public func clearWatch(watchId: Int32) { _ = jsObject[Strings.clearWatch]!(watchId.jsValue()) diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index a5397d74..2ec6bcc5 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -5,24 +5,59 @@ import JavaScriptKit public protocol GlobalEventHandlers: JSBridgedClass {} public extension GlobalEventHandlers { - var onanimationstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] = newValue } + var ontransitionrun: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] = newValue } } - var onanimationiteration: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] = newValue } + var ontransitionstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontransitionstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontransitionstart, in: jsObject] = newValue } } - var onanimationend: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] = newValue } + var ontransitionend: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontransitionend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontransitionend, in: jsObject] = newValue } } - var onanimationcancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] = newValue } + var ontransitioncancel: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontransitioncancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontransitioncancel, in: jsObject] = newValue } + } + + var onselectstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] = newValue } + } + + var onselectionchange: EventHandler { + get { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] = newValue } + } + + var onbeforexrselect: EventHandler { + get { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] = newValue } + } + + var ontouchstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] = newValue } + } + + var ontouchend: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] = newValue } + } + + var ontouchmove: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] = newValue } + } + + var ontouchcancel: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] = newValue } } var onabort: EventHandler { @@ -365,11 +400,6 @@ public extension GlobalEventHandlers { set { ClosureAttribute.Optional1[Strings.onwheel, in: jsObject] = newValue } } - var onbeforexrselect: EventHandler { - get { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] = newValue } - } - var ongotpointercapture: EventHandler { get { ClosureAttribute.Optional1[Strings.ongotpointercapture, in: jsObject] } set { ClosureAttribute.Optional1[Strings.ongotpointercapture, in: jsObject] = newValue } @@ -425,53 +455,23 @@ public extension GlobalEventHandlers { set { ClosureAttribute.Optional1[Strings.onpointerleave, in: jsObject] = newValue } } - var ontransitionrun: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] = newValue } - } - - var ontransitionstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontransitionstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontransitionstart, in: jsObject] = newValue } - } - - var ontransitionend: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontransitionend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontransitionend, in: jsObject] = newValue } - } - - var ontransitioncancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontransitioncancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontransitioncancel, in: jsObject] = newValue } - } - - var ontouchstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] = newValue } - } - - var ontouchend: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] = newValue } - } - - var ontouchmove: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] = newValue } + var onanimationstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] = newValue } } - var ontouchcancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] = newValue } + var onanimationiteration: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] = newValue } } - var onselectstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] = newValue } + var onanimationend: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] = newValue } } - var onselectionchange: EventHandler { - get { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] = newValue } + var onanimationcancel: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 2cf95ab6..137a4f63 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement { +public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement, ElementCSSInlineStyle { override public class var constructor: JSFunction { JSObject.global[Strings.HTMLElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index 4624c948..ed4b361f 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -8,6 +8,7 @@ public class HTMLIFrameElement: HTMLElement { public required init(unsafelyWrapping jsObject: JSObject) { _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) + _csp = ReadWriteAttribute(jsObject: jsObject, name: Strings.csp) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcdoc = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcdoc) _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) @@ -27,13 +28,15 @@ public class HTMLIFrameElement: HTMLElement { _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginHeight) _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginWidth) _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) - _csp = ReadWriteAttribute(jsObject: jsObject, name: Strings.csp) super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute public var permissionsPolicy: PermissionsPolicy + @ReadWriteAttribute + public var csp: String + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -98,7 +101,4 @@ public class HTMLIFrameElement: HTMLElement { @ReadWriteAttribute public var fetchpriority: String - - @ReadWriteAttribute - public var csp: String } diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index 8b51bedf..7feea4cc 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -7,9 +7,9 @@ public class HTMLInputElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global[Strings.HTMLInputElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _capture = ReadWriteAttribute(jsObject: jsObject, name: Strings.capture) _webkitdirectory = ReadWriteAttribute(jsObject: jsObject, name: Strings.webkitdirectory) _webkitEntries = ReadonlyAttribute(jsObject: jsObject, name: Strings.webkitEntries) - _capture = ReadWriteAttribute(jsObject: jsObject, name: Strings.capture) _accept = ReadWriteAttribute(jsObject: jsObject, name: Strings.accept) _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) @@ -58,15 +58,15 @@ public class HTMLInputElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } + @ReadWriteAttribute + public var capture: String + @ReadWriteAttribute public var webkitdirectory: Bool @ReadonlyAttribute public var webkitEntries: [FileSystemEntry] - @ReadWriteAttribute - public var capture: String - public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index 1265f5ff..59e500b1 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -11,6 +11,8 @@ public class HTMLMediaElement: HTMLElement { _mediaKeys = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaKeys) _onencrypted = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onencrypted) _onwaitingforkey = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onwaitingforkey) + _remote = ReadonlyAttribute(jsObject: jsObject, name: Strings.remote) + _disableRemotePlayback = ReadWriteAttribute(jsObject: jsObject, name: Strings.disableRemotePlayback) _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcObject = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcObject) @@ -39,15 +41,9 @@ public class HTMLMediaElement: HTMLElement { _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioTracks) _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoTracks) _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.textTracks) - _remote = ReadonlyAttribute(jsObject: jsObject, name: Strings.remote) - _disableRemotePlayback = ReadWriteAttribute(jsObject: jsObject, name: Strings.disableRemotePlayback) super.init(unsafelyWrapping: jsObject) } - public func captureStream() -> MediaStream { - jsObject[Strings.captureStream]!().fromJSValue()! - } - @ReadonlyAttribute public var sinkId: String @@ -80,6 +76,16 @@ public class HTMLMediaElement: HTMLElement { _ = try await _promise.get() } + public func captureStream() -> MediaStream { + jsObject[Strings.captureStream]!().fromJSValue()! + } + + @ReadonlyAttribute + public var remote: RemotePlayback + + @ReadWriteAttribute + public var disableRemotePlayback: Bool + @ReadonlyAttribute public var error: MediaError? @@ -215,10 +221,4 @@ public class HTMLMediaElement: HTMLElement { public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { jsObject[Strings.addTextTrack]!(kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined).fromJSValue()! } - - @ReadonlyAttribute - public var remote: RemotePlayback - - @ReadWriteAttribute - public var disableRemotePlayback: Bool } diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 872e7bd5..90b86939 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -20,18 +20,12 @@ public class HTMLVideoElement: HTMLMediaElement { super.init(unsafelyWrapping: jsObject) } - public func requestVideoFrameCallback(callback: VideoFrameRequestCallback) -> UInt32 { - jsObject[Strings.requestVideoFrameCallback]!(callback.jsValue()).fromJSValue()! - } + // XXX: member 'requestVideoFrameCallback' is ignored public func cancelVideoFrameCallback(handle: UInt32) { _ = jsObject[Strings.cancelVideoFrameCallback]!(handle.jsValue()) } - public func getVideoPlaybackQuality() -> VideoPlaybackQuality { - jsObject[Strings.getVideoPlaybackQuality]!().fromJSValue()! - } - public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -54,6 +48,10 @@ public class HTMLVideoElement: HTMLMediaElement { @ReadWriteAttribute public var playsInline: Bool + public func getVideoPlaybackQuality() -> VideoPlaybackQuality { + jsObject[Strings.getVideoPlaybackQuality]!().fromJSValue()! + } + public func requestPictureInPicture() -> JSPromise { jsObject[Strings.requestPictureInPicture]!().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IDBCursor.swift b/Sources/DOMKit/WebIDL/IDBCursor.swift index 1de87002..530d364b 100644 --- a/Sources/DOMKit/WebIDL/IDBCursor.swift +++ b/Sources/DOMKit/WebIDL/IDBCursor.swift @@ -36,7 +36,7 @@ public class IDBCursor: JSBridgedClass { _ = jsObject[Strings.advance]!(count.jsValue()) } - public func continue (key: JSValue? = nil) -> Void { + public func `continue`(key: JSValue? = nil) { _ = jsObject[Strings.continue]!(key?.jsValue() ?? .undefined) } diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index 029115b5..c6717f90 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -7,20 +7,13 @@ public class InputEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global[Strings.InputEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Strings.isComposing) _inputType = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputType) + _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var dataTransfer: DataTransfer? - - public func getTargetRanges() -> [StaticRange] { - jsObject[Strings.getTargetRanges]!().fromJSValue()! - } - public convenience init(type: String, eventInitDict: InputEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } @@ -33,4 +26,11 @@ public class InputEvent: UIEvent { @ReadonlyAttribute public var inputType: String + + @ReadonlyAttribute + public var dataTransfer: DataTransfer? + + public func getTargetRanges() -> [StaticRange] { + jsObject[Strings.getTargetRanges]!().fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift index 8604dfca..5d6095b8 100644 --- a/Sources/DOMKit/WebIDL/InputEventInit.swift +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -4,37 +4,37 @@ import JavaScriptEventLoop import JavaScriptKit public class InputEventInit: BridgedDictionary { - public convenience init(dataTransfer: DataTransfer?, targetRanges: [StaticRange], data: String?, isComposing: Bool, inputType: String) { + public convenience init(data: String?, isComposing: Bool, inputType: String, dataTransfer: DataTransfer?, targetRanges: [StaticRange]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataTransfer] = dataTransfer.jsValue() - object[Strings.targetRanges] = targetRanges.jsValue() object[Strings.data] = data.jsValue() object[Strings.isComposing] = isComposing.jsValue() object[Strings.inputType] = inputType.jsValue() + object[Strings.dataTransfer] = dataTransfer.jsValue() + object[Strings.targetRanges] = targetRanges.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _dataTransfer = ReadWriteAttribute(jsObject: object, name: Strings.dataTransfer) - _targetRanges = ReadWriteAttribute(jsObject: object, name: Strings.targetRanges) _data = ReadWriteAttribute(jsObject: object, name: Strings.data) _isComposing = ReadWriteAttribute(jsObject: object, name: Strings.isComposing) _inputType = ReadWriteAttribute(jsObject: object, name: Strings.inputType) + _dataTransfer = ReadWriteAttribute(jsObject: object, name: Strings.dataTransfer) + _targetRanges = ReadWriteAttribute(jsObject: object, name: Strings.targetRanges) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var dataTransfer: DataTransfer? + public var data: String? @ReadWriteAttribute - public var targetRanges: [StaticRange] + public var isComposing: Bool @ReadWriteAttribute - public var data: String? + public var inputType: String @ReadWriteAttribute - public var isComposing: Bool + public var dataTransfer: DataTransfer? @ReadWriteAttribute - public var inputType: String + public var targetRanges: [StaticRange] } diff --git a/Sources/DOMKit/WebIDL/IntersectionObserver.swift b/Sources/DOMKit/WebIDL/IntersectionObserver.swift index aeb55326..178e84ac 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserver.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserver.swift @@ -15,9 +15,7 @@ public class IntersectionObserver: JSBridgedClass { self.jsObject = jsObject } - public convenience init(callback: IntersectionObserverCallback, options: IntersectionObserverInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue(), options?.jsValue() ?? .undefined)) - } + // XXX: constructor is ignored @ReadonlyAttribute public var root: __UNSUPPORTED_UNION__? diff --git a/Sources/DOMKit/WebIDL/KeyType.swift b/Sources/DOMKit/WebIDL/KeyType.swift index f74d75d0..3baa4053 100644 --- a/Sources/DOMKit/WebIDL/KeyType.swift +++ b/Sources/DOMKit/WebIDL/KeyType.swift @@ -4,8 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public enum KeyType: JSString, JSValueCompatible { - case public = "public" - case private = "private" + case `public` = "public" + case `private` = "private" case secret = "secret" public static func construct(from jsValue: JSValue) -> Self? { diff --git a/Sources/DOMKit/WebIDL/KeyframeEffect.swift b/Sources/DOMKit/WebIDL/KeyframeEffect.swift index 79c3b807..ee54bb23 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffect.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffect.swift @@ -7,16 +7,13 @@ public class KeyframeEffect: AnimationEffect { override public class var constructor: JSFunction { JSObject.global[Strings.KeyframeEffect].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _iterationComposite = ReadWriteAttribute(jsObject: jsObject, name: Strings.iterationComposite) _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) _pseudoElement = ReadWriteAttribute(jsObject: jsObject, name: Strings.pseudoElement) _composite = ReadWriteAttribute(jsObject: jsObject, name: Strings.composite) + _iterationComposite = ReadWriteAttribute(jsObject: jsObject, name: Strings.iterationComposite) super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var iterationComposite: IterationCompositeOperation - public convenience init(target: Element?, keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(target.jsValue(), keyframes.jsValue(), options?.jsValue() ?? .undefined)) } @@ -41,4 +38,7 @@ public class KeyframeEffect: AnimationEffect { public func setKeyframes(keyframes: JSObject?) { _ = jsObject[Strings.setKeyframes]!(keyframes.jsValue()) } + + @ReadWriteAttribute + public var iterationComposite: IterationCompositeOperation } diff --git a/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift index b0a790a7..ed6ae740 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift @@ -4,27 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class KeyframeEffectOptions: BridgedDictionary { - public convenience init(iterationComposite: IterationCompositeOperation, composite: CompositeOperation, pseudoElement: String?) { + public convenience init(composite: CompositeOperation, pseudoElement: String?, iterationComposite: IterationCompositeOperation) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iterationComposite] = iterationComposite.jsValue() object[Strings.composite] = composite.jsValue() object[Strings.pseudoElement] = pseudoElement.jsValue() + object[Strings.iterationComposite] = iterationComposite.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _iterationComposite = ReadWriteAttribute(jsObject: object, name: Strings.iterationComposite) _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) _pseudoElement = ReadWriteAttribute(jsObject: object, name: Strings.pseudoElement) + _iterationComposite = ReadWriteAttribute(jsObject: object, name: Strings.iterationComposite) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var iterationComposite: IterationCompositeOperation - @ReadWriteAttribute public var composite: CompositeOperation @ReadWriteAttribute public var pseudoElement: String? + + @ReadWriteAttribute + public var iterationComposite: IterationCompositeOperation } diff --git a/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift index 7010e69d..ff92a5ef 100644 --- a/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift @@ -10,7 +10,5 @@ public class LayoutWorkletGlobalScope: WorkletGlobalScope { super.init(unsafelyWrapping: jsObject) } - public func registerLayout(name: String, layoutCtor: VoidFunction) { - _ = jsObject[Strings.registerLayout]!(name.jsValue(), layoutCtor.jsValue()) - } + // XXX: member 'registerLayout' is ignored } diff --git a/Sources/DOMKit/WebIDL/LockManager.swift b/Sources/DOMKit/WebIDL/LockManager.swift index 1dfa1c71..6f785275 100644 --- a/Sources/DOMKit/WebIDL/LockManager.swift +++ b/Sources/DOMKit/WebIDL/LockManager.swift @@ -12,25 +12,13 @@ public class LockManager: JSBridgedClass { self.jsObject = jsObject } - public func request(name: String, callback: LockGrantedCallback) -> JSPromise { - jsObject[Strings.request]!(name.jsValue(), callback.jsValue()).fromJSValue()! - } + // XXX: member 'request' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func request(name: String, callback: LockGrantedCallback) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.request]!(name.jsValue(), callback.jsValue()).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + // XXX: member 'request' is ignored - public func request(name: String, options: LockOptions, callback: LockGrantedCallback) -> JSPromise { - jsObject[Strings.request]!(name.jsValue(), options.jsValue(), callback.jsValue()).fromJSValue()! - } + // XXX: member 'request' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func request(name: String, options: LockOptions, callback: LockGrantedCallback) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.request]!(name.jsValue(), options.jsValue(), callback.jsValue()).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + // XXX: member 'request' is ignored public func query() -> JSPromise { jsObject[Strings.query]!().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/MathMLElement.swift b/Sources/DOMKit/WebIDL/MathMLElement.swift index 87ca6dbe..e5e650bc 100644 --- a/Sources/DOMKit/WebIDL/MathMLElement.swift +++ b/Sources/DOMKit/WebIDL/MathMLElement.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class MathMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, HTMLOrSVGElement { +public class MathMLElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, HTMLOrSVGElement, ElementCSSInlineStyle { override public class var constructor: JSFunction { JSObject.global[Strings.MathMLElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/MediaDevices.swift b/Sources/DOMKit/WebIDL/MediaDevices.swift index db13604c..2f6a8101 100644 --- a/Sources/DOMKit/WebIDL/MediaDevices.swift +++ b/Sources/DOMKit/WebIDL/MediaDevices.swift @@ -11,16 +11,6 @@ public class MediaDevices: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) -> JSPromise { - jsObject[Strings.getDisplayMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) async throws -> MediaStream { - let _promise: JSPromise = jsObject[Strings.getDisplayMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - public func selectAudioOutput(options: AudioOutputOptions? = nil) -> JSPromise { jsObject[Strings.selectAudioOutput]!(options?.jsValue() ?? .undefined).fromJSValue()! } @@ -67,4 +57,14 @@ public class MediaDevices: EventTarget { let _promise: JSPromise = jsObject[Strings.getUserMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } + + public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) -> JSPromise { + jsObject[Strings.getDisplayMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) async throws -> MediaStream { + let _promise: JSPromise = jsObject[Strings.getDisplayMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/MediaQueryList.swift b/Sources/DOMKit/WebIDL/MediaQueryList.swift index eaf021d0..4192c205 100644 --- a/Sources/DOMKit/WebIDL/MediaQueryList.swift +++ b/Sources/DOMKit/WebIDL/MediaQueryList.swift @@ -19,13 +19,9 @@ public class MediaQueryList: EventTarget { @ReadonlyAttribute public var matches: Bool - public func addListener(callback: EventListener?) { - _ = jsObject[Strings.addListener]!(callback.jsValue()) - } + // XXX: member 'addListener' is ignored - public func removeListener(callback: EventListener?) { - _ = jsObject[Strings.removeListener]!(callback.jsValue()) - } + // XXX: member 'removeListener' is ignored @ClosureAttribute.Optional1 public var onchange: EventHandler diff --git a/Sources/DOMKit/WebIDL/MediaSession.swift b/Sources/DOMKit/WebIDL/MediaSession.swift index dee0c265..d6780e7f 100644 --- a/Sources/DOMKit/WebIDL/MediaSession.swift +++ b/Sources/DOMKit/WebIDL/MediaSession.swift @@ -20,9 +20,7 @@ public class MediaSession: JSBridgedClass { @ReadWriteAttribute public var playbackState: MediaSessionPlaybackState - public func setActionHandler(action: MediaSessionAction, handler: MediaSessionActionHandler?) { - _ = jsObject[Strings.setActionHandler]!(action.jsValue(), handler.jsValue()) - } + // XXX: member 'setActionHandler' is ignored public func setPositionState(state: MediaPositionState? = nil) { _ = jsObject[Strings.setPositionState]!(state?.jsValue() ?? .undefined) diff --git a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift index 47b2b01a..efae2985 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift @@ -4,32 +4,32 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamConstraints: BridgedDictionary { - public convenience init(preferCurrentTab: Bool, peerIdentity: String, video: __UNSUPPORTED_UNION__, audio: __UNSUPPORTED_UNION__) { + public convenience init(video: __UNSUPPORTED_UNION__, audio: __UNSUPPORTED_UNION__, peerIdentity: String, preferCurrentTab: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.preferCurrentTab] = preferCurrentTab.jsValue() - object[Strings.peerIdentity] = peerIdentity.jsValue() object[Strings.video] = video.jsValue() object[Strings.audio] = audio.jsValue() + object[Strings.peerIdentity] = peerIdentity.jsValue() + object[Strings.preferCurrentTab] = preferCurrentTab.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _preferCurrentTab = ReadWriteAttribute(jsObject: object, name: Strings.preferCurrentTab) - _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) _video = ReadWriteAttribute(jsObject: object, name: Strings.video) _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) + _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) + _preferCurrentTab = ReadWriteAttribute(jsObject: object, name: Strings.preferCurrentTab) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var preferCurrentTab: Bool + public var video: __UNSUPPORTED_UNION__ @ReadWriteAttribute - public var peerIdentity: String + public var audio: __UNSUPPORTED_UNION__ @ReadWriteAttribute - public var video: __UNSUPPORTED_UNION__ + public var peerIdentity: String @ReadWriteAttribute - public var audio: __UNSUPPORTED_UNION__ + public var preferCurrentTab: Bool } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift index 652ed602..aabd8137 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift @@ -7,9 +7,6 @@ public class MediaStreamTrack: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrack].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _contentHint = ReadWriteAttribute(jsObject: jsObject, name: Strings.contentHint) - _isolated = ReadonlyAttribute(jsObject: jsObject, name: Strings.isolated) - _onisolationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onisolationchange) _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) @@ -19,18 +16,12 @@ public class MediaStreamTrack: EventTarget { _onunmute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onunmute) _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) _onended = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onended) + _contentHint = ReadWriteAttribute(jsObject: jsObject, name: Strings.contentHint) + _isolated = ReadonlyAttribute(jsObject: jsObject, name: Strings.isolated) + _onisolationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onisolationchange) super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var contentHint: String - - @ReadonlyAttribute - public var isolated: Bool - - @ClosureAttribute.Optional1 - public var onisolationchange: EventHandler - @ReadonlyAttribute public var kind: String @@ -87,4 +78,13 @@ public class MediaStreamTrack: EventTarget { let _promise: JSPromise = jsObject[Strings.applyConstraints]!(constraints?.jsValue() ?? .undefined).fromJSValue()! _ = try await _promise.get() } + + @ReadWriteAttribute + public var contentHint: String + + @ReadonlyAttribute + public var isolated: Bool + + @ClosureAttribute.Optional1 + public var onisolationchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift index 119e9f98..2e2b32d7 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift @@ -4,8 +4,23 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaTrackCapabilities: BridgedDictionary { - public convenience init(whiteBalanceMode: [String], exposureMode: [String], focusMode: [String], exposureCompensation: MediaSettingsRange, exposureTime: MediaSettingsRange, colorTemperature: MediaSettingsRange, iso: MediaSettingsRange, brightness: MediaSettingsRange, contrast: MediaSettingsRange, saturation: MediaSettingsRange, sharpness: MediaSettingsRange, focusDistance: MediaSettingsRange, pan: MediaSettingsRange, tilt: MediaSettingsRange, zoom: MediaSettingsRange, torch: Bool, displaySurface: String, logicalSurface: Bool, cursor: [String], 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) { + 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, whiteBalanceMode: [String], exposureMode: [String], focusMode: [String], exposureCompensation: MediaSettingsRange, exposureTime: MediaSettingsRange, colorTemperature: MediaSettingsRange, iso: MediaSettingsRange, brightness: MediaSettingsRange, contrast: MediaSettingsRange, saturation: MediaSettingsRange, sharpness: MediaSettingsRange, focusDistance: MediaSettingsRange, pan: MediaSettingsRange, tilt: MediaSettingsRange, zoom: MediaSettingsRange, torch: Bool, displaySurface: String, logicalSurface: Bool, cursor: [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() object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() object[Strings.exposureMode] = exposureMode.jsValue() object[Strings.focusMode] = focusMode.jsValue() @@ -25,25 +40,25 @@ public class MediaTrackCapabilities: BridgedDictionary { object[Strings.displaySurface] = displaySurface.jsValue() object[Strings.logicalSurface] = logicalSurface.jsValue() object[Strings.cursor] = cursor.jsValue() - 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) _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) @@ -63,123 +78,108 @@ public class MediaTrackCapabilities: BridgedDictionary { _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) - _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 whiteBalanceMode: [String] + public var width: ULongRange @ReadWriteAttribute - public var exposureMode: [String] + public var height: ULongRange @ReadWriteAttribute - public var focusMode: [String] + public var aspectRatio: DoubleRange @ReadWriteAttribute - public var exposureCompensation: MediaSettingsRange + public var frameRate: DoubleRange @ReadWriteAttribute - public var exposureTime: MediaSettingsRange + public var facingMode: [String] @ReadWriteAttribute - public var colorTemperature: MediaSettingsRange + public var resizeMode: [String] @ReadWriteAttribute - public var iso: MediaSettingsRange + public var sampleRate: ULongRange @ReadWriteAttribute - public var brightness: MediaSettingsRange + public var sampleSize: ULongRange @ReadWriteAttribute - public var contrast: MediaSettingsRange + public var echoCancellation: [Bool] @ReadWriteAttribute - public var saturation: MediaSettingsRange + public var autoGainControl: [Bool] @ReadWriteAttribute - public var sharpness: MediaSettingsRange + public var noiseSuppression: [Bool] @ReadWriteAttribute - public var focusDistance: MediaSettingsRange + public var latency: DoubleRange @ReadWriteAttribute - public var pan: MediaSettingsRange + public var channelCount: ULongRange @ReadWriteAttribute - public var tilt: MediaSettingsRange + public var deviceId: String @ReadWriteAttribute - public var zoom: MediaSettingsRange + public var groupId: String @ReadWriteAttribute - public var torch: Bool + public var whiteBalanceMode: [String] @ReadWriteAttribute - public var displaySurface: String + public var exposureMode: [String] @ReadWriteAttribute - public var logicalSurface: Bool + public var focusMode: [String] @ReadWriteAttribute - public var cursor: [String] + public var exposureCompensation: MediaSettingsRange @ReadWriteAttribute - public var width: ULongRange + public var exposureTime: MediaSettingsRange @ReadWriteAttribute - public var height: ULongRange + public var colorTemperature: MediaSettingsRange @ReadWriteAttribute - public var aspectRatio: DoubleRange + public var iso: MediaSettingsRange @ReadWriteAttribute - public var frameRate: DoubleRange + public var brightness: MediaSettingsRange @ReadWriteAttribute - public var facingMode: [String] + public var contrast: MediaSettingsRange @ReadWriteAttribute - public var resizeMode: [String] + public var saturation: MediaSettingsRange @ReadWriteAttribute - public var sampleRate: ULongRange + public var sharpness: MediaSettingsRange @ReadWriteAttribute - public var sampleSize: ULongRange + public var focusDistance: MediaSettingsRange @ReadWriteAttribute - public var echoCancellation: [Bool] + public var pan: MediaSettingsRange @ReadWriteAttribute - public var autoGainControl: [Bool] + public var tilt: MediaSettingsRange @ReadWriteAttribute - public var noiseSuppression: [Bool] + public var zoom: MediaSettingsRange @ReadWriteAttribute - public var latency: DoubleRange + public var torch: Bool @ReadWriteAttribute - public var channelCount: ULongRange + public var displaySurface: String @ReadWriteAttribute - public var deviceId: String + public var logicalSurface: Bool @ReadWriteAttribute - public var groupId: String + public var cursor: [String] } diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift index e0a7f281..b2dce09b 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift @@ -4,8 +4,23 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaTrackConstraintSet: BridgedDictionary { - public convenience init(whiteBalanceMode: ConstrainDOMString, exposureMode: ConstrainDOMString, focusMode: ConstrainDOMString, pointsOfInterest: ConstrainPoint2D, exposureCompensation: ConstrainDouble, exposureTime: ConstrainDouble, colorTemperature: ConstrainDouble, iso: ConstrainDouble, brightness: ConstrainDouble, contrast: ConstrainDouble, saturation: ConstrainDouble, sharpness: ConstrainDouble, focusDistance: ConstrainDouble, pan: __UNSUPPORTED_UNION__, tilt: __UNSUPPORTED_UNION__, zoom: __UNSUPPORTED_UNION__, torch: ConstrainBoolean, displaySurface: ConstrainDOMString, logicalSurface: ConstrainBoolean, cursor: ConstrainDOMString, restrictOwnAudio: ConstrainBoolean, suppressLocalAudioPlayback: ConstrainBoolean, 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) { + 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, whiteBalanceMode: ConstrainDOMString, exposureMode: ConstrainDOMString, focusMode: ConstrainDOMString, pointsOfInterest: ConstrainPoint2D, exposureCompensation: ConstrainDouble, exposureTime: ConstrainDouble, colorTemperature: ConstrainDouble, iso: ConstrainDouble, brightness: ConstrainDouble, contrast: ConstrainDouble, saturation: ConstrainDouble, sharpness: ConstrainDouble, focusDistance: ConstrainDouble, pan: __UNSUPPORTED_UNION__, tilt: __UNSUPPORTED_UNION__, zoom: __UNSUPPORTED_UNION__, torch: ConstrainBoolean, displaySurface: ConstrainDOMString, logicalSurface: ConstrainBoolean, cursor: ConstrainDOMString, restrictOwnAudio: ConstrainBoolean, suppressLocalAudioPlayback: ConstrainBoolean) { 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() object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() object[Strings.exposureMode] = exposureMode.jsValue() object[Strings.focusMode] = focusMode.jsValue() @@ -28,25 +43,25 @@ public class MediaTrackConstraintSet: BridgedDictionary { object[Strings.cursor] = cursor.jsValue() object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue() object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue() - 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) _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) @@ -69,132 +84,117 @@ public class MediaTrackConstraintSet: BridgedDictionary { _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) _restrictOwnAudio = ReadWriteAttribute(jsObject: object, name: Strings.restrictOwnAudio) _suppressLocalAudioPlayback = ReadWriteAttribute(jsObject: object, name: Strings.suppressLocalAudioPlayback) - _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 whiteBalanceMode: ConstrainDOMString + public var width: ConstrainULong @ReadWriteAttribute - public var exposureMode: ConstrainDOMString + public var height: ConstrainULong @ReadWriteAttribute - public var focusMode: ConstrainDOMString + public var aspectRatio: ConstrainDouble @ReadWriteAttribute - public var pointsOfInterest: ConstrainPoint2D + public var frameRate: ConstrainDouble @ReadWriteAttribute - public var exposureCompensation: ConstrainDouble + public var facingMode: ConstrainDOMString @ReadWriteAttribute - public var exposureTime: ConstrainDouble + public var resizeMode: ConstrainDOMString @ReadWriteAttribute - public var colorTemperature: ConstrainDouble + public var sampleRate: ConstrainULong @ReadWriteAttribute - public var iso: ConstrainDouble + public var sampleSize: ConstrainULong @ReadWriteAttribute - public var brightness: ConstrainDouble + public var echoCancellation: ConstrainBoolean @ReadWriteAttribute - public var contrast: ConstrainDouble + public var autoGainControl: ConstrainBoolean @ReadWriteAttribute - public var saturation: ConstrainDouble + public var noiseSuppression: ConstrainBoolean @ReadWriteAttribute - public var sharpness: ConstrainDouble + public var latency: ConstrainDouble @ReadWriteAttribute - public var focusDistance: ConstrainDouble + public var channelCount: ConstrainULong @ReadWriteAttribute - public var pan: __UNSUPPORTED_UNION__ + public var deviceId: ConstrainDOMString @ReadWriteAttribute - public var tilt: __UNSUPPORTED_UNION__ + public var groupId: ConstrainDOMString @ReadWriteAttribute - public var zoom: __UNSUPPORTED_UNION__ + public var whiteBalanceMode: ConstrainDOMString @ReadWriteAttribute - public var torch: ConstrainBoolean + public var exposureMode: ConstrainDOMString @ReadWriteAttribute - public var displaySurface: ConstrainDOMString + public var focusMode: ConstrainDOMString @ReadWriteAttribute - public var logicalSurface: ConstrainBoolean + public var pointsOfInterest: ConstrainPoint2D @ReadWriteAttribute - public var cursor: ConstrainDOMString + public var exposureCompensation: ConstrainDouble @ReadWriteAttribute - public var restrictOwnAudio: ConstrainBoolean + public var exposureTime: ConstrainDouble @ReadWriteAttribute - public var suppressLocalAudioPlayback: ConstrainBoolean + public var colorTemperature: ConstrainDouble @ReadWriteAttribute - public var width: ConstrainULong + public var iso: ConstrainDouble @ReadWriteAttribute - public var height: ConstrainULong + public var brightness: ConstrainDouble @ReadWriteAttribute - public var aspectRatio: ConstrainDouble + public var contrast: ConstrainDouble @ReadWriteAttribute - public var frameRate: ConstrainDouble + public var saturation: ConstrainDouble @ReadWriteAttribute - public var facingMode: ConstrainDOMString + public var sharpness: ConstrainDouble @ReadWriteAttribute - public var resizeMode: ConstrainDOMString + public var focusDistance: ConstrainDouble @ReadWriteAttribute - public var sampleRate: ConstrainULong + public var pan: __UNSUPPORTED_UNION__ @ReadWriteAttribute - public var sampleSize: ConstrainULong + public var tilt: __UNSUPPORTED_UNION__ @ReadWriteAttribute - public var echoCancellation: ConstrainBoolean + public var zoom: __UNSUPPORTED_UNION__ @ReadWriteAttribute - public var autoGainControl: ConstrainBoolean + public var torch: ConstrainBoolean @ReadWriteAttribute - public var noiseSuppression: ConstrainBoolean + public var displaySurface: ConstrainDOMString @ReadWriteAttribute - public var latency: ConstrainDouble + public var logicalSurface: ConstrainBoolean @ReadWriteAttribute - public var channelCount: ConstrainULong + public var cursor: ConstrainDOMString @ReadWriteAttribute - public var deviceId: ConstrainDOMString + public var restrictOwnAudio: ConstrainBoolean @ReadWriteAttribute - public var groupId: ConstrainDOMString + public var suppressLocalAudioPlayback: ConstrainBoolean } diff --git a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift index b81bf68d..ee4f6612 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift @@ -4,8 +4,23 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaTrackSettings: BridgedDictionary { - public convenience init(whiteBalanceMode: String, exposureMode: String, focusMode: String, pointsOfInterest: [Point2D], exposureCompensation: Double, exposureTime: Double, colorTemperature: Double, iso: Double, brightness: Double, contrast: Double, saturation: Double, sharpness: Double, focusDistance: Double, pan: Double, tilt: Double, zoom: Double, torch: Bool, displaySurface: String, logicalSurface: Bool, cursor: String, restrictOwnAudio: Bool, 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) { + 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, whiteBalanceMode: String, exposureMode: String, focusMode: String, pointsOfInterest: [Point2D], exposureCompensation: Double, exposureTime: Double, colorTemperature: Double, iso: Double, brightness: Double, contrast: Double, saturation: Double, sharpness: Double, focusDistance: Double, pan: Double, tilt: Double, zoom: Double, torch: Bool, displaySurface: String, logicalSurface: Bool, cursor: String, restrictOwnAudio: 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() object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() object[Strings.exposureMode] = exposureMode.jsValue() object[Strings.focusMode] = focusMode.jsValue() @@ -27,25 +42,25 @@ public class MediaTrackSettings: BridgedDictionary { object[Strings.logicalSurface] = logicalSurface.jsValue() object[Strings.cursor] = cursor.jsValue() object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue() - 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) _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) @@ -67,129 +82,114 @@ public class MediaTrackSettings: BridgedDictionary { _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) _restrictOwnAudio = ReadWriteAttribute(jsObject: object, name: Strings.restrictOwnAudio) - _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 whiteBalanceMode: String + public var width: Int32 @ReadWriteAttribute - public var exposureMode: String + public var height: Int32 @ReadWriteAttribute - public var focusMode: String + public var aspectRatio: Double @ReadWriteAttribute - public var pointsOfInterest: [Point2D] + public var frameRate: Double @ReadWriteAttribute - public var exposureCompensation: Double + public var facingMode: String @ReadWriteAttribute - public var exposureTime: Double + public var resizeMode: String @ReadWriteAttribute - public var colorTemperature: Double + public var sampleRate: Int32 @ReadWriteAttribute - public var iso: Double + public var sampleSize: Int32 @ReadWriteAttribute - public var brightness: Double + public var echoCancellation: Bool @ReadWriteAttribute - public var contrast: Double + public var autoGainControl: Bool @ReadWriteAttribute - public var saturation: Double + public var noiseSuppression: Bool @ReadWriteAttribute - public var sharpness: Double + public var latency: Double @ReadWriteAttribute - public var focusDistance: Double + public var channelCount: Int32 @ReadWriteAttribute - public var pan: Double + public var deviceId: String @ReadWriteAttribute - public var tilt: Double + public var groupId: String @ReadWriteAttribute - public var zoom: Double + public var whiteBalanceMode: String @ReadWriteAttribute - public var torch: Bool + public var exposureMode: String @ReadWriteAttribute - public var displaySurface: String + public var focusMode: String @ReadWriteAttribute - public var logicalSurface: Bool + public var pointsOfInterest: [Point2D] @ReadWriteAttribute - public var cursor: String + public var exposureCompensation: Double @ReadWriteAttribute - public var restrictOwnAudio: Bool + public var exposureTime: Double @ReadWriteAttribute - public var width: Int32 + public var colorTemperature: Double @ReadWriteAttribute - public var height: Int32 + public var iso: Double @ReadWriteAttribute - public var aspectRatio: Double + public var brightness: Double @ReadWriteAttribute - public var frameRate: Double + public var contrast: Double @ReadWriteAttribute - public var facingMode: String + public var saturation: Double @ReadWriteAttribute - public var resizeMode: String + public var sharpness: Double @ReadWriteAttribute - public var sampleRate: Int32 + public var focusDistance: Double @ReadWriteAttribute - public var sampleSize: Int32 + public var pan: Double @ReadWriteAttribute - public var echoCancellation: Bool + public var tilt: Double @ReadWriteAttribute - public var autoGainControl: Bool + public var zoom: Double @ReadWriteAttribute - public var noiseSuppression: Bool + public var torch: Bool @ReadWriteAttribute - public var latency: Double + public var displaySurface: String @ReadWriteAttribute - public var channelCount: Int32 + public var logicalSurface: Bool @ReadWriteAttribute - public var deviceId: String + public var cursor: String @ReadWriteAttribute - public var groupId: String + public var restrictOwnAudio: Bool } diff --git a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift index 0b23641d..bea9c722 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift @@ -4,8 +4,23 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaTrackSupportedConstraints: BridgedDictionary { - public convenience init(whiteBalanceMode: Bool, exposureMode: Bool, focusMode: Bool, pointsOfInterest: Bool, exposureCompensation: Bool, exposureTime: Bool, colorTemperature: Bool, iso: Bool, brightness: Bool, contrast: Bool, pan: Bool, saturation: Bool, sharpness: Bool, focusDistance: Bool, tilt: Bool, zoom: Bool, torch: Bool, displaySurface: Bool, logicalSurface: Bool, cursor: Bool, restrictOwnAudio: Bool, suppressLocalAudioPlayback: Bool, 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) { + 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, whiteBalanceMode: Bool, exposureMode: Bool, focusMode: Bool, pointsOfInterest: Bool, exposureCompensation: Bool, exposureTime: Bool, colorTemperature: Bool, iso: Bool, brightness: Bool, contrast: Bool, pan: Bool, saturation: Bool, sharpness: Bool, focusDistance: Bool, tilt: Bool, zoom: Bool, torch: Bool, displaySurface: Bool, logicalSurface: Bool, cursor: Bool, restrictOwnAudio: Bool, suppressLocalAudioPlayback: 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() object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() object[Strings.exposureMode] = exposureMode.jsValue() object[Strings.focusMode] = focusMode.jsValue() @@ -28,25 +43,25 @@ public class MediaTrackSupportedConstraints: BridgedDictionary { object[Strings.cursor] = cursor.jsValue() object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue() object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue() - 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) _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) @@ -69,132 +84,117 @@ public class MediaTrackSupportedConstraints: BridgedDictionary { _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) _restrictOwnAudio = ReadWriteAttribute(jsObject: object, name: Strings.restrictOwnAudio) _suppressLocalAudioPlayback = ReadWriteAttribute(jsObject: object, name: Strings.suppressLocalAudioPlayback) - _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 whiteBalanceMode: Bool + public var width: Bool @ReadWriteAttribute - public var exposureMode: Bool + public var height: Bool @ReadWriteAttribute - public var focusMode: Bool + public var aspectRatio: Bool @ReadWriteAttribute - public var pointsOfInterest: Bool + public var frameRate: Bool @ReadWriteAttribute - public var exposureCompensation: Bool + public var facingMode: Bool @ReadWriteAttribute - public var exposureTime: Bool + public var resizeMode: Bool @ReadWriteAttribute - public var colorTemperature: Bool + public var sampleRate: Bool @ReadWriteAttribute - public var iso: Bool + public var sampleSize: Bool @ReadWriteAttribute - public var brightness: Bool + public var echoCancellation: Bool @ReadWriteAttribute - public var contrast: Bool + public var autoGainControl: Bool @ReadWriteAttribute - public var pan: Bool + public var noiseSuppression: Bool @ReadWriteAttribute - public var saturation: Bool + public var latency: Bool @ReadWriteAttribute - public var sharpness: Bool + public var channelCount: Bool @ReadWriteAttribute - public var focusDistance: Bool + public var deviceId: Bool @ReadWriteAttribute - public var tilt: Bool + public var groupId: Bool @ReadWriteAttribute - public var zoom: Bool + public var whiteBalanceMode: Bool @ReadWriteAttribute - public var torch: Bool + public var exposureMode: Bool @ReadWriteAttribute - public var displaySurface: Bool + public var focusMode: Bool @ReadWriteAttribute - public var logicalSurface: Bool + public var pointsOfInterest: Bool @ReadWriteAttribute - public var cursor: Bool + public var exposureCompensation: Bool @ReadWriteAttribute - public var restrictOwnAudio: Bool + public var exposureTime: Bool @ReadWriteAttribute - public var suppressLocalAudioPlayback: Bool + public var colorTemperature: Bool @ReadWriteAttribute - public var width: Bool + public var iso: Bool @ReadWriteAttribute - public var height: Bool + public var brightness: Bool @ReadWriteAttribute - public var aspectRatio: Bool + public var contrast: Bool @ReadWriteAttribute - public var frameRate: Bool + public var pan: Bool @ReadWriteAttribute - public var facingMode: Bool + public var saturation: Bool @ReadWriteAttribute - public var resizeMode: Bool + public var sharpness: Bool @ReadWriteAttribute - public var sampleRate: Bool + public var focusDistance: Bool @ReadWriteAttribute - public var sampleSize: Bool + public var tilt: Bool @ReadWriteAttribute - public var echoCancellation: Bool + public var zoom: Bool @ReadWriteAttribute - public var autoGainControl: Bool + public var torch: Bool @ReadWriteAttribute - public var noiseSuppression: Bool + public var displaySurface: Bool @ReadWriteAttribute - public var latency: Bool + public var logicalSurface: Bool @ReadWriteAttribute - public var channelCount: Bool + public var cursor: Bool @ReadWriteAttribute - public var deviceId: Bool + public var restrictOwnAudio: Bool @ReadWriteAttribute - public var groupId: Bool + public var suppressLocalAudioPlayback: Bool } diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index 888d08a0..b133da65 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -3,101 +3,122 @@ import JavaScriptEventLoop import JavaScriptKit -public class Navigator: JSBridgedClass, NavigatorStorage, NavigatorDeviceMemory, NavigatorNetworkInformation, NavigatorML, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware, NavigatorFonts, NavigatorUA, NavigatorGPU, NavigatorBadge, NavigatorLocks, NavigatorAutomationInformation { +public class Navigator: JSBridgedClass, NavigatorLocks, NavigatorAutomationInformation, NavigatorML, NavigatorDeviceMemory, NavigatorStorage, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware, NavigatorFonts, NavigatorBadge, NavigatorNetworkInformation, NavigatorUA { public class var constructor: JSFunction { JSObject.global[Strings.Navigator].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _contacts = ReadonlyAttribute(jsObject: jsObject, name: Strings.contacts) - _scheduling = ReadonlyAttribute(jsObject: jsObject, name: Strings.scheduling) - _mediaSession = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaSession) - _xr = ReadonlyAttribute(jsObject: jsObject, name: Strings.xr) + _presentation = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentation) + _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) + _credentials = ReadonlyAttribute(jsObject: jsObject, name: Strings.credentials) + _clipboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipboard) _bluetooth = ReadonlyAttribute(jsObject: jsObject, name: Strings.bluetooth) + _mediaDevices = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaDevices) + _xr = ReadonlyAttribute(jsObject: jsObject, name: Strings.xr) + _scheduling = ReadonlyAttribute(jsObject: jsObject, name: Strings.scheduling) + _keyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyboard) _windowControlsOverlay = ReadonlyAttribute(jsObject: jsObject, name: Strings.windowControlsOverlay) - _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) _ink = ReadonlyAttribute(jsObject: jsObject, name: Strings.ink) - _credentials = ReadonlyAttribute(jsObject: jsObject, name: Strings.credentials) - _hid = ReadonlyAttribute(jsObject: jsObject, name: Strings.hid) - _devicePosture = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePosture) - _geolocation = ReadonlyAttribute(jsObject: jsObject, name: Strings.geolocation) - _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) - _maxTouchPoints = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTouchPoints) + _mediaSession = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaSession) _wakeLock = ReadonlyAttribute(jsObject: jsObject, name: Strings.wakeLock) - _presentation = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentation) - _keyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyboard) - _clipboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipboard) - _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) _serial = ReadonlyAttribute(jsObject: jsObject, name: Strings.serial) - _mediaDevices = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaDevices) + _maxTouchPoints = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTouchPoints) _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) + _contacts = ReadonlyAttribute(jsObject: jsObject, name: Strings.contacts) + _geolocation = ReadonlyAttribute(jsObject: jsObject, name: Strings.geolocation) + _hid = ReadonlyAttribute(jsObject: jsObject, name: Strings.hid) _virtualKeyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.virtualKeyboard) + _devicePosture = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePosture) + _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) + _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) self.jsObject = jsObject } - @ReadonlyAttribute - public var contacts: ContactsManager + public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { + jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { + let _promise: JSPromise = jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func getAutoplayPolicy(type: AutoplayPolicyMediaType) -> AutoplayPolicy { + jsObject[Strings.getAutoplayPolicy]!(type.jsValue()).fromJSValue()! + } + + public func getAutoplayPolicy(element: HTMLMediaElement) -> AutoplayPolicy { + jsObject[Strings.getAutoplayPolicy]!(element.jsValue()).fromJSValue()! + } + + public func getAutoplayPolicy(context: AudioContext) -> AutoplayPolicy { + jsObject[Strings.getAutoplayPolicy]!(context.jsValue()).fromJSValue()! + } @ReadonlyAttribute - public var scheduling: Scheduling + public var presentation: Presentation @ReadonlyAttribute - public var mediaSession: MediaSession + public var permissions: Permissions - public func getBattery() -> JSPromise { - jsObject[Strings.getBattery]!().fromJSValue()! + public func share(data: ShareData? = nil) -> JSPromise { + jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getBattery() async throws -> BatteryManager { - let _promise: JSPromise = jsObject[Strings.getBattery]!().fromJSValue()! - return try await _promise.get().fromJSValue()! + public func share(data: ShareData? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func canShare(data: ShareData? = nil) -> Bool { + jsObject[Strings.canShare]!(data?.jsValue() ?? .undefined).fromJSValue()! } @ReadonlyAttribute - public var xr: XRSystem + public var credentials: CredentialsContainer - public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { - jsObject[Strings.sendBeacon]!(url.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! - } + @ReadonlyAttribute + public var clipboard: Clipboard @ReadonlyAttribute public var bluetooth: Bluetooth @ReadonlyAttribute - public var windowControlsOverlay: WindowControlsOverlay + public var mediaDevices: MediaDevices + + // XXX: member 'getUserMedia' is ignored @ReadonlyAttribute - public var permissions: Permissions + public var xr: XRSystem @ReadonlyAttribute - public var ink: Ink + public var scheduling: Scheduling @ReadonlyAttribute - public var credentials: CredentialsContainer + public var keyboard: Keyboard @ReadonlyAttribute - public var hid: HID + public var windowControlsOverlay: WindowControlsOverlay @ReadonlyAttribute - public var devicePosture: DevicePosture + public var ink: Ink - public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { - jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + @ReadonlyAttribute + public var mediaSession: MediaSession + + public func getInstalledRelatedApps() -> JSPromise { + jsObject[Strings.getInstalledRelatedApps]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { - let _promise: JSPromise = jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + public func getInstalledRelatedApps() async throws -> [RelatedApplication] { + let _promise: JSPromise = jsObject[Strings.getInstalledRelatedApps]!().fromJSValue()! return try await _promise.get().fromJSValue()! } - @ReadonlyAttribute - public var geolocation: Geolocation - - @ReadonlyAttribute - public var serviceWorker: ServiceWorkerContainer - public func requestMIDIAccess(options: MIDIOptions? = nil) -> JSPromise { jsObject[Strings.requestMIDIAccess]!(options?.jsValue() ?? .undefined).fromJSValue()! } @@ -108,33 +129,25 @@ public class Navigator: JSBridgedClass, NavigatorStorage, NavigatorDeviceMemory, return try await _promise.get().fromJSValue()! } - public func getInstalledRelatedApps() -> JSPromise { - jsObject[Strings.getInstalledRelatedApps]!().fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getInstalledRelatedApps() async throws -> [RelatedApplication] { - let _promise: JSPromise = jsObject[Strings.getInstalledRelatedApps]!().fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @ReadonlyAttribute - public var maxTouchPoints: Int32 - @ReadonlyAttribute public var wakeLock: WakeLock - @ReadonlyAttribute - public var presentation: Presentation + public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { + jsObject[Strings.sendBeacon]!(url.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! + } @ReadonlyAttribute - public var keyboard: Keyboard + public var serial: Serial + + public func getGamepads() -> [Gamepad?] { + jsObject[Strings.getGamepads]!().fromJSValue()! + } @ReadonlyAttribute - public var clipboard: Clipboard + public var maxTouchPoints: Int32 @ReadonlyAttribute - public var usb: USB + public var mediaCapabilities: MediaCapabilities public func setClientBadge(contents: UInt64? = nil) -> JSPromise { jsObject[Strings.setClientBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! @@ -156,53 +169,38 @@ public class Navigator: JSBridgedClass, NavigatorStorage, NavigatorDeviceMemory, _ = try await _promise.get() } - public func getGamepads() -> [Gamepad?] { - jsObject[Strings.getGamepads]!().fromJSValue()! - } - @ReadonlyAttribute - public var serial: Serial + public var contacts: ContactsManager @ReadonlyAttribute - public var mediaDevices: MediaDevices - - public func getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback) { - _ = jsObject[Strings.getUserMedia]!(constraints.jsValue(), successCallback.jsValue(), errorCallback.jsValue()) - } + public var geolocation: Geolocation @ReadonlyAttribute - public var mediaCapabilities: MediaCapabilities - - public func getAutoplayPolicy(type: AutoplayPolicyMediaType) -> AutoplayPolicy { - jsObject[Strings.getAutoplayPolicy]!(type.jsValue()).fromJSValue()! - } + public var hid: HID - public func getAutoplayPolicy(element: HTMLMediaElement) -> AutoplayPolicy { - jsObject[Strings.getAutoplayPolicy]!(element.jsValue()).fromJSValue()! - } + @ReadonlyAttribute + public var virtualKeyboard: VirtualKeyboard - public func getAutoplayPolicy(context: AudioContext) -> AutoplayPolicy { - jsObject[Strings.getAutoplayPolicy]!(context.jsValue()).fromJSValue()! - } + @ReadonlyAttribute + public var devicePosture: DevicePosture @ReadonlyAttribute - public var virtualKeyboard: VirtualKeyboard + public var serviceWorker: ServiceWorkerContainer - public func share(data: ShareData? = nil) -> JSPromise { - jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! - } + @ReadonlyAttribute + public var usb: USB - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func share(data: ShareData? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() + public func vibrate(pattern: VibratePattern) -> Bool { + jsObject[Strings.vibrate]!(pattern.jsValue()).fromJSValue()! } - public func canShare(data: ShareData? = nil) -> Bool { - jsObject[Strings.canShare]!(data?.jsValue() ?? .undefined).fromJSValue()! + public func getBattery() -> JSPromise { + jsObject[Strings.getBattery]!().fromJSValue()! } - public func vibrate(pattern: VibratePattern) -> Bool { - jsObject[Strings.vibrate]!(pattern.jsValue()).fromJSValue()! + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getBattery() async throws -> BatteryManager { + let _promise: JSPromise = jsObject[Strings.getBattery]!().fromJSValue()! + return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Notification.swift b/Sources/DOMKit/WebIDL/Notification.swift index 573bbd60..b045353c 100644 --- a/Sources/DOMKit/WebIDL/Notification.swift +++ b/Sources/DOMKit/WebIDL/Notification.swift @@ -38,15 +38,9 @@ public class Notification: EventTarget { @ReadonlyAttribute public var permission: NotificationPermission - public static func requestPermission(deprecatedCallback: NotificationPermissionCallback? = nil) -> JSPromise { - constructor[Strings.requestPermission]!(deprecatedCallback?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'requestPermission' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func requestPermission(deprecatedCallback: NotificationPermissionCallback? = nil) async throws -> NotificationPermission { - let _promise: JSPromise = constructor[Strings.requestPermission]!(deprecatedCallback?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + // XXX: member 'requestPermission' is ignored @ReadonlyAttribute public var maxActions: UInt32 diff --git a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift index c74850a8..208b6dfb 100644 --- a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift +++ b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift @@ -4,9 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class OptionalEffectTiming: BridgedDictionary { - public convenience init(playbackRate: Double, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: __UNSUPPORTED_UNION__, direction: PlaybackDirection, easing: String) { + public convenience init(delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: __UNSUPPORTED_UNION__, direction: PlaybackDirection, easing: String, playbackRate: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.playbackRate] = playbackRate.jsValue() object[Strings.delay] = delay.jsValue() object[Strings.endDelay] = endDelay.jsValue() object[Strings.fill] = fill.jsValue() @@ -15,11 +14,11 @@ public class OptionalEffectTiming: BridgedDictionary { object[Strings.duration] = duration.jsValue() object[Strings.direction] = direction.jsValue() object[Strings.easing] = easing.jsValue() + object[Strings.playbackRate] = playbackRate.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) _endDelay = ReadWriteAttribute(jsObject: object, name: Strings.endDelay) _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) @@ -28,12 +27,10 @@ public class OptionalEffectTiming: BridgedDictionary { _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) + _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var playbackRate: Double - @ReadWriteAttribute public var delay: Double @@ -57,4 +54,7 @@ public class OptionalEffectTiming: BridgedDictionary { @ReadWriteAttribute public var easing: String + + @ReadWriteAttribute + public var playbackRate: Double } diff --git a/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift index d3248752..3cf02459 100644 --- a/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift @@ -11,9 +11,7 @@ public class PaintWorkletGlobalScope: WorkletGlobalScope { super.init(unsafelyWrapping: jsObject) } - public func registerPaint(name: String, paintCtor: VoidFunction) { - _ = jsObject[Strings.registerPaint]!(name.jsValue(), paintCtor.jsValue()) - } + // XXX: member 'registerPaint' is ignored @ReadonlyAttribute public var devicePixelRatio: Double diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index 7b9ff210..b1258016 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -7,12 +7,12 @@ public class Performance: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.Performance].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _eventCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.eventCounts) + _interactionCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionCounts) _onresourcetimingbufferfull = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresourcetimingbufferfull) + _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeOrigin) _timing = ReadonlyAttribute(jsObject: jsObject, name: Strings.timing) _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) - _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeOrigin) - _eventCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.eventCounts) - _interactionCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionCounts) super.init(unsafelyWrapping: jsObject) } @@ -32,6 +32,24 @@ public class Performance: EventTarget { _ = jsObject[Strings.clearMeasures]!(measureName?.jsValue() ?? .undefined) } + @ReadonlyAttribute + public var eventCounts: EventCounts + + @ReadonlyAttribute + public var interactionCounts: InteractionCounts + + public func getEntries() -> PerformanceEntryList { + jsObject[Strings.getEntries]!().fromJSValue()! + } + + public func getEntriesByType(type: String) -> PerformanceEntryList { + jsObject[Strings.getEntriesByType]!(type.jsValue()).fromJSValue()! + } + + public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { + jsObject[Strings.getEntriesByName]!(name.jsValue(), type?.jsValue() ?? .undefined).fromJSValue()! + } + public func clearResourceTimings() { _ = jsObject[Strings.clearResourceTimings]!() } @@ -43,11 +61,15 @@ public class Performance: EventTarget { @ClosureAttribute.Optional1 public var onresourcetimingbufferfull: EventHandler - @ReadonlyAttribute - public var timing: PerformanceTiming + public func measureUserAgentSpecificMemory() -> JSPromise { + jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! + } - @ReadonlyAttribute - public var navigation: PerformanceNavigation + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { + let _promise: JSPromise = jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } public func now() -> DOMHighResTimeStamp { jsObject[Strings.now]!().fromJSValue()! @@ -61,30 +83,8 @@ public class Performance: EventTarget { } @ReadonlyAttribute - public var eventCounts: EventCounts + public var timing: PerformanceTiming @ReadonlyAttribute - public var interactionCounts: InteractionCounts - - public func measureUserAgentSpecificMemory() -> JSPromise { - jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { - let _promise: JSPromise = jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - public func getEntries() -> PerformanceEntryList { - jsObject[Strings.getEntries]!().fromJSValue()! - } - - public func getEntriesByType(type: String) -> PerformanceEntryList { - jsObject[Strings.getEntriesByType]!(type.jsValue()).fromJSValue()! - } - - public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { - jsObject[Strings.getEntriesByName]!(name.jsValue(), type?.jsValue() ?? .undefined).fromJSValue()! - } + public var navigation: PerformanceNavigation } diff --git a/Sources/DOMKit/WebIDL/PerformanceObserver.swift b/Sources/DOMKit/WebIDL/PerformanceObserver.swift index c097c34a..4ae25b66 100644 --- a/Sources/DOMKit/WebIDL/PerformanceObserver.swift +++ b/Sources/DOMKit/WebIDL/PerformanceObserver.swift @@ -13,9 +13,7 @@ public class PerformanceObserver: JSBridgedClass { self.jsObject = jsObject } - public convenience init(callback: PerformanceObserverCallback) { - self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue())) - } + // XXX: constructor is ignored public func observe(options: PerformanceObserverInit? = nil) { _ = jsObject[Strings.observe]!(options?.jsValue() ?? .undefined) diff --git a/Sources/DOMKit/WebIDL/Permissions.swift b/Sources/DOMKit/WebIDL/Permissions.swift index c5b26a34..13317a0c 100644 --- a/Sources/DOMKit/WebIDL/Permissions.swift +++ b/Sources/DOMKit/WebIDL/Permissions.swift @@ -12,6 +12,16 @@ public class Permissions: JSBridgedClass { self.jsObject = jsObject } + public func request(permissionDesc: JSObject) -> JSPromise { + jsObject[Strings.request]!(permissionDesc.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func request(permissionDesc: JSObject) async throws -> PermissionStatus { + let _promise: JSPromise = jsObject[Strings.request]!(permissionDesc.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + public func query(permissionDesc: JSObject) -> JSPromise { jsObject[Strings.query]!(permissionDesc.jsValue()).fromJSValue()! } @@ -31,14 +41,4 @@ public class Permissions: JSBridgedClass { let _promise: JSPromise = jsObject[Strings.revoke]!(permissionDesc.jsValue()).fromJSValue()! return try await _promise.get().fromJSValue()! } - - public func request(permissionDesc: JSObject) -> JSPromise { - jsObject[Strings.request]!(permissionDesc.jsValue()).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func request(permissionDesc: JSObject) async throws -> PermissionStatus { - let _promise: JSPromise = jsObject[Strings.request]!(permissionDesc.jsValue()).fromJSValue()! - return try await _promise.get().fromJSValue()! - } } diff --git a/Sources/DOMKit/WebIDL/RTCIceParameters.swift b/Sources/DOMKit/WebIDL/RTCIceParameters.swift index 4eb5cd4e..e382c98c 100644 --- a/Sources/DOMKit/WebIDL/RTCIceParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCIceParameters.swift @@ -4,27 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCIceParameters: BridgedDictionary { - public convenience init(usernameFragment: String, password: String, iceLite: Bool) { + public convenience init(iceLite: Bool, usernameFragment: String, password: String) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.iceLite] = iceLite.jsValue() object[Strings.usernameFragment] = usernameFragment.jsValue() object[Strings.password] = password.jsValue() - object[Strings.iceLite] = iceLite.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _iceLite = ReadWriteAttribute(jsObject: object, name: Strings.iceLite) _usernameFragment = ReadWriteAttribute(jsObject: object, name: Strings.usernameFragment) _password = ReadWriteAttribute(jsObject: object, name: Strings.password) - _iceLite = ReadWriteAttribute(jsObject: object, name: Strings.iceLite) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var usernameFragment: String + public var iceLite: Bool @ReadWriteAttribute - public var password: String + public var usernameFragment: String @ReadWriteAttribute - public var iceLite: Bool + public var password: String } diff --git a/Sources/DOMKit/WebIDL/RTCIceTransport.swift b/Sources/DOMKit/WebIDL/RTCIceTransport.swift index 13535937..4a582887 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransport.swift @@ -7,6 +7,8 @@ public class RTCIceTransport: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.RTCIceTransport].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onicecandidate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicecandidate) _role = ReadonlyAttribute(jsObject: jsObject, name: Strings.role) _component = ReadonlyAttribute(jsObject: jsObject, name: Strings.component) _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) @@ -14,11 +16,35 @@ public class RTCIceTransport: EventTarget { _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) _ongatheringstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ongatheringstatechange) _onselectedcandidatepairchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onselectedcandidatepairchange) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onicecandidate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicecandidate) super.init(unsafelyWrapping: jsObject) } + public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new()) + } + + public func gather(options: RTCIceGatherOptions? = nil) { + _ = jsObject[Strings.gather]!(options?.jsValue() ?? .undefined) + } + + public func start(remoteParameters: RTCIceParameters? = nil, role: RTCIceRole? = nil) { + _ = jsObject[Strings.start]!(remoteParameters?.jsValue() ?? .undefined, role?.jsValue() ?? .undefined) + } + + public func stop() { + _ = jsObject[Strings.stop]!() + } + + public func addRemoteCandidate(remoteCandidate: RTCIceCandidateInit? = nil) { + _ = jsObject[Strings.addRemoteCandidate]!(remoteCandidate?.jsValue() ?? .undefined) + } + + @ClosureAttribute.Optional1 + public var onerror: EventHandler + + @ClosureAttribute.Optional1 + public var onicecandidate: EventHandler + @ReadonlyAttribute public var role: RTCIceRole @@ -59,30 +85,4 @@ public class RTCIceTransport: EventTarget { @ClosureAttribute.Optional1 public var onselectedcandidatepairchange: EventHandler - - public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) - } - - public func gather(options: RTCIceGatherOptions? = nil) { - _ = jsObject[Strings.gather]!(options?.jsValue() ?? .undefined) - } - - public func start(remoteParameters: RTCIceParameters? = nil, role: RTCIceRole? = nil) { - _ = jsObject[Strings.start]!(remoteParameters?.jsValue() ?? .undefined, role?.jsValue() ?? .undefined) - } - - public func stop() { - _ = jsObject[Strings.stop]!() - } - - public func addRemoteCandidate(remoteCandidate: RTCIceCandidateInit? = nil) { - _ = jsObject[Strings.addRemoteCandidate]!(remoteCandidate?.jsValue() ?? .undefined) - } - - @ClosureAttribute.Optional1 - public var onerror: EventHandler - - @ClosureAttribute.Optional1 - public var onicecandidate: EventHandler } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift index 971f0ea5..23218940 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift @@ -38,35 +38,17 @@ public class RTCPeerConnection: EventTarget { self.init(unsafelyWrapping: Self.constructor.new(configuration?.jsValue() ?? .undefined)) } - public func createOffer(options: RTCOfferOptions? = nil) -> JSPromise { - jsObject[Strings.createOffer]!(options?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'createOffer' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createOffer(options: RTCOfferOptions? = nil) async throws -> RTCSessionDescriptionInit { - let _promise: JSPromise = jsObject[Strings.createOffer]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + // XXX: member 'createOffer' is ignored - public func createAnswer(options: RTCAnswerOptions? = nil) -> JSPromise { - jsObject[Strings.createAnswer]!(options?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'createAnswer' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createAnswer(options: RTCAnswerOptions? = nil) async throws -> RTCSessionDescriptionInit { - let _promise: JSPromise = jsObject[Strings.createAnswer]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + // XXX: member 'createAnswer' is ignored - public func setLocalDescription(description: RTCLocalSessionDescriptionInit? = nil) -> JSPromise { - jsObject[Strings.setLocalDescription]!(description?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'setLocalDescription' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setLocalDescription(description: RTCLocalSessionDescriptionInit? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.setLocalDescription]!(description?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() - } + // XXX: member 'setLocalDescription' is ignored @ReadonlyAttribute public var localDescription: RTCSessionDescription? @@ -77,15 +59,9 @@ public class RTCPeerConnection: EventTarget { @ReadonlyAttribute public var pendingLocalDescription: RTCSessionDescription? - public func setRemoteDescription(description: RTCSessionDescriptionInit) -> JSPromise { - jsObject[Strings.setRemoteDescription]!(description.jsValue()).fromJSValue()! - } + // XXX: member 'setRemoteDescription' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setRemoteDescription(description: RTCSessionDescriptionInit) async throws { - let _promise: JSPromise = jsObject[Strings.setRemoteDescription]!(description.jsValue()).fromJSValue()! - _ = try await _promise.get() - } + // XXX: member 'setRemoteDescription' is ignored @ReadonlyAttribute public var remoteDescription: RTCSessionDescription? @@ -96,15 +72,9 @@ public class RTCPeerConnection: EventTarget { @ReadonlyAttribute public var pendingRemoteDescription: RTCSessionDescription? - public func addIceCandidate(candidate: RTCIceCandidateInit? = nil) -> JSPromise { - jsObject[Strings.addIceCandidate]!(candidate?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'addIceCandidate' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func addIceCandidate(candidate: RTCIceCandidateInit? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.addIceCandidate]!(candidate?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() - } + // XXX: member 'addIceCandidate' is ignored @ReadonlyAttribute public var signalingState: RTCSignalingState @@ -158,55 +128,25 @@ public class RTCPeerConnection: EventTarget { @ClosureAttribute.Optional1 public var onconnectionstatechange: EventHandler - public func createOffer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback, options: RTCOfferOptions? = nil) -> JSPromise { - jsObject[Strings.createOffer]!(successCallback.jsValue(), failureCallback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'createOffer' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createOffer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback, options: RTCOfferOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.createOffer]!(successCallback.jsValue(), failureCallback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() - } + // XXX: member 'createOffer' is ignored - public func setLocalDescription(description: RTCLocalSessionDescriptionInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) -> JSPromise { - jsObject[Strings.setLocalDescription]!(description.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! - } + // XXX: member 'setLocalDescription' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setLocalDescription(description: RTCLocalSessionDescriptionInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) async throws { - let _promise: JSPromise = jsObject[Strings.setLocalDescription]!(description.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! - _ = try await _promise.get() - } + // XXX: member 'setLocalDescription' is ignored - public func createAnswer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback) -> JSPromise { - jsObject[Strings.createAnswer]!(successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! - } + // XXX: member 'createAnswer' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createAnswer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback) async throws { - let _promise: JSPromise = jsObject[Strings.createAnswer]!(successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! - _ = try await _promise.get() - } + // XXX: member 'createAnswer' is ignored - public func setRemoteDescription(description: RTCSessionDescriptionInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) -> JSPromise { - jsObject[Strings.setRemoteDescription]!(description.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! - } + // XXX: member 'setRemoteDescription' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setRemoteDescription(description: RTCSessionDescriptionInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) async throws { - let _promise: JSPromise = jsObject[Strings.setRemoteDescription]!(description.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! - _ = try await _promise.get() - } + // XXX: member 'setRemoteDescription' is ignored - public func addIceCandidate(candidate: RTCIceCandidateInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) -> JSPromise { - jsObject[Strings.addIceCandidate]!(candidate.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! - } + // XXX: member 'addIceCandidate' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func addIceCandidate(candidate: RTCIceCandidateInit, successCallback: VoidFunction, failureCallback: RTCPeerConnectionErrorCallback) async throws { - let _promise: JSPromise = jsObject[Strings.addIceCandidate]!(candidate.jsValue(), successCallback.jsValue(), failureCallback.jsValue()).fromJSValue()! - _ = try await _promise.get() - } + // XXX: member 'addIceCandidate' is ignored public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) -> JSPromise { constructor[Strings.generateCertificate]!(keygenAlgorithm.jsValue()).fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift index 5ff1a31d..9cc18f23 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCRtpEncodingParameters: BridgedDictionary { - public convenience init(active: Bool, maxBitrate: UInt32, scaleResolutionDownBy: Double, priority: RTCPriorityType, networkPriority: RTCPriorityType, scalabilityMode: String) { + public convenience init(active: Bool, maxBitrate: UInt32, scaleResolutionDownBy: Double, scalabilityMode: String, priority: RTCPriorityType, networkPriority: RTCPriorityType) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.active] = active.jsValue() object[Strings.maxBitrate] = maxBitrate.jsValue() object[Strings.scaleResolutionDownBy] = scaleResolutionDownBy.jsValue() + object[Strings.scalabilityMode] = scalabilityMode.jsValue() object[Strings.priority] = priority.jsValue() object[Strings.networkPriority] = networkPriority.jsValue() - object[Strings.scalabilityMode] = scalabilityMode.jsValue() self.init(unsafelyWrapping: object) } @@ -19,9 +19,9 @@ public class RTCRtpEncodingParameters: BridgedDictionary { _active = ReadWriteAttribute(jsObject: object, name: Strings.active) _maxBitrate = ReadWriteAttribute(jsObject: object, name: Strings.maxBitrate) _scaleResolutionDownBy = ReadWriteAttribute(jsObject: object, name: Strings.scaleResolutionDownBy) + _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) _networkPriority = ReadWriteAttribute(jsObject: object, name: Strings.networkPriority) - _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) super.init(unsafelyWrapping: object) } @@ -35,11 +35,11 @@ public class RTCRtpEncodingParameters: BridgedDictionary { public var scaleResolutionDownBy: Double @ReadWriteAttribute - public var priority: RTCPriorityType + public var scalabilityMode: String @ReadWriteAttribute - public var networkPriority: RTCPriorityType + public var priority: RTCPriorityType @ReadWriteAttribute - public var scalabilityMode: String + public var networkPriority: RTCPriorityType } diff --git a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift index e104bc48..52dcedb8 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift @@ -9,12 +9,15 @@ public class RTCRtpReceiver: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) _transport = ReadonlyAttribute(jsObject: jsObject, name: Strings.transport) - _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) self.jsObject = jsObject } + @ReadWriteAttribute + public var transform: RTCRtpTransform? + @ReadonlyAttribute public var track: MediaStreamTrack @@ -46,7 +49,4 @@ public class RTCRtpReceiver: JSBridgedClass { let _promise: JSPromise = jsObject[Strings.getStats]!().fromJSValue()! return try await _promise.get().fromJSValue()! } - - @ReadWriteAttribute - public var transform: RTCRtpTransform? } diff --git a/Sources/DOMKit/WebIDL/RTCRtpSender.swift b/Sources/DOMKit/WebIDL/RTCRtpSender.swift index 1f4d8e48..1776109c 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpSender.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpSender.swift @@ -9,13 +9,26 @@ public class RTCRtpSender: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) _transport = ReadonlyAttribute(jsObject: jsObject, name: Strings.transport) _dtmf = ReadonlyAttribute(jsObject: jsObject, name: Strings.dtmf) - _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) self.jsObject = jsObject } + @ReadWriteAttribute + public var transform: RTCRtpTransform? + + public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { + jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func generateKeyFrame(rids: [String]? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + @ReadonlyAttribute public var track: MediaStreamTrack? @@ -66,17 +79,4 @@ public class RTCRtpSender: JSBridgedClass { @ReadonlyAttribute public var dtmf: RTCDTMFSender? - - @ReadWriteAttribute - public var transform: RTCRtpTransform? - - public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { - jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func generateKeyFrame(rids: [String]? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() - } } diff --git a/Sources/DOMKit/WebIDL/RemotePlayback.swift b/Sources/DOMKit/WebIDL/RemotePlayback.swift index f865e6e5..bd7dcde8 100644 --- a/Sources/DOMKit/WebIDL/RemotePlayback.swift +++ b/Sources/DOMKit/WebIDL/RemotePlayback.swift @@ -14,15 +14,9 @@ public class RemotePlayback: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func watchAvailability(callback: RemotePlaybackAvailabilityCallback) -> JSPromise { - jsObject[Strings.watchAvailability]!(callback.jsValue()).fromJSValue()! - } + // XXX: member 'watchAvailability' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func watchAvailability(callback: RemotePlaybackAvailabilityCallback) async throws -> Int32 { - let _promise: JSPromise = jsObject[Strings.watchAvailability]!(callback.jsValue()).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + // XXX: member 'watchAvailability' is ignored public func cancelWatchAvailability(id: Int32? = nil) -> JSPromise { jsObject[Strings.cancelWatchAvailability]!(id?.jsValue() ?? .undefined).fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ReportingObserver.swift b/Sources/DOMKit/WebIDL/ReportingObserver.swift index c4cda0aa..93b26bbb 100644 --- a/Sources/DOMKit/WebIDL/ReportingObserver.swift +++ b/Sources/DOMKit/WebIDL/ReportingObserver.swift @@ -12,9 +12,7 @@ public class ReportingObserver: JSBridgedClass { self.jsObject = jsObject } - public convenience init(callback: ReportingObserverCallback, options: ReportingObserverOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue(), options?.jsValue() ?? .undefined)) - } + // XXX: constructor is ignored public func observe() { _ = jsObject[Strings.observe]!() diff --git a/Sources/DOMKit/WebIDL/ResizeObserver.swift b/Sources/DOMKit/WebIDL/ResizeObserver.swift index 348c14da..cf3ef9be 100644 --- a/Sources/DOMKit/WebIDL/ResizeObserver.swift +++ b/Sources/DOMKit/WebIDL/ResizeObserver.swift @@ -12,9 +12,7 @@ public class ResizeObserver: JSBridgedClass { self.jsObject = jsObject } - public convenience init(callback: ResizeObserverCallback) { - self.init(unsafelyWrapping: Self.constructor.new(callback.jsValue())) - } + // XXX: constructor is ignored public func observe(target: Element, options: ResizeObserverOptions? = nil) { _ = jsObject[Strings.observe]!(target.jsValue(), options?.jsValue() ?? .undefined) diff --git a/Sources/DOMKit/WebIDL/SVGElement.swift b/Sources/DOMKit/WebIDL/SVGElement.swift index 3841869b..f48f7449 100644 --- a/Sources/DOMKit/WebIDL/SVGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGElement.swift @@ -3,18 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public class SVGElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement { +public class SVGElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement, ElementCSSInlineStyle { override public class var constructor: JSFunction { JSObject.global[Strings.SVGElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _className = ReadonlyAttribute(jsObject: jsObject, name: Strings.className) _ownerSVGElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerSVGElement) _viewportElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.viewportElement) super.init(unsafelyWrapping: jsObject) } - private var _className: ReadonlyAttribute - override public var className: SVGAnimatedString { _className.wrappedValue } + // XXX: member 'className' is ignored @ReadonlyAttribute public var ownerSVGElement: SVGSVGElement? diff --git a/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift b/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift index 47db0142..50f9e866 100644 --- a/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift @@ -38,7 +38,7 @@ public class SVGFECompositeElement: SVGElement, SVGFilterPrimitiveStandardAttrib public var in2: SVGAnimatedString @ReadonlyAttribute - public var operator: SVGAnimatedEnumeration + public var `operator`: SVGAnimatedEnumeration @ReadonlyAttribute public var k1: SVGAnimatedNumber diff --git a/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift b/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift index dad229a4..abe0bece 100644 --- a/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift @@ -24,7 +24,7 @@ public class SVGFEMorphologyElement: SVGElement, SVGFilterPrimitiveStandardAttri public var in1: SVGAnimatedString @ReadonlyAttribute - public var operator: SVGAnimatedEnumeration + public var `operator`: SVGAnimatedEnumeration @ReadonlyAttribute public var radiusX: SVGAnimatedNumber diff --git a/Sources/DOMKit/WebIDL/Scheduler.swift b/Sources/DOMKit/WebIDL/Scheduler.swift index 9e964993..838c287c 100644 --- a/Sources/DOMKit/WebIDL/Scheduler.swift +++ b/Sources/DOMKit/WebIDL/Scheduler.swift @@ -12,13 +12,7 @@ public class Scheduler: JSBridgedClass { self.jsObject = jsObject } - public func postTask(callback: SchedulerPostTaskCallback, options: SchedulerPostTaskOptions? = nil) -> JSPromise { - jsObject[Strings.postTask]!(callback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'postTask' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func postTask(callback: SchedulerPostTaskCallback, options: SchedulerPostTaskOptions? = nil) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.postTask]!(callback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + // XXX: member 'postTask' is ignored } diff --git a/Sources/DOMKit/WebIDL/SerialOutputSignals.swift b/Sources/DOMKit/WebIDL/SerialOutputSignals.swift index 787d552d..8edf9379 100644 --- a/Sources/DOMKit/WebIDL/SerialOutputSignals.swift +++ b/Sources/DOMKit/WebIDL/SerialOutputSignals.swift @@ -4,11 +4,11 @@ import JavaScriptEventLoop import JavaScriptKit public class SerialOutputSignals: BridgedDictionary { - public convenience init(dataTerminalReady: Bool, requestToSend: Bool, break _: Bool) { + public convenience init(dataTerminalReady: Bool, requestToSend: Bool, break: Bool) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.dataTerminalReady] = dataTerminalReady.jsValue() object[Strings.requestToSend] = requestToSend.jsValue() - object[Strings.break] = break .jsValue() + object[Strings.break] = `break`.jsValue() self.init(unsafelyWrapping: object) } @@ -26,5 +26,5 @@ public class SerialOutputSignals: BridgedDictionary { public var requestToSend: Bool @ReadWriteAttribute - public var break: Bool + public var `break`: Bool } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift index c0c219c3..086438ea 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift @@ -7,18 +7,21 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) - _oncookiechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncookiechange) - _onperiodicsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onperiodicsync) _onnotificationclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnotificationclick) _onnotificationclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnotificationclose) + _onperiodicsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onperiodicsync) + _oncanmakepayment = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncanmakepayment) + _onpaymentrequest = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpaymentrequest) + _oncontentdelete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontentdelete) + _onpush = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpush) + _onpushsubscriptionchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpushsubscriptionchange) + _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) + _oncookiechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncookiechange) _onsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsync) _onbackgroundfetchsuccess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchsuccess) _onbackgroundfetchfail = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchfail) _onbackgroundfetchabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchabort) _onbackgroundfetchclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchclick) - _oncanmakepayment = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncanmakepayment) - _onpaymentrequest = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpaymentrequest) _clients = ReadonlyAttribute(jsObject: jsObject, name: Strings.clients) _registration = ReadonlyAttribute(jsObject: jsObject, name: Strings.registration) _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) @@ -27,26 +30,38 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { _onfetch = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfetch) _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) - _onpush = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpush) - _onpushsubscriptionchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpushsubscriptionchange) - _oncontentdelete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontentdelete) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var cookieStore: CookieStore + @ClosureAttribute.Optional1 + public var onnotificationclick: EventHandler @ClosureAttribute.Optional1 - public var oncookiechange: EventHandler + public var onnotificationclose: EventHandler @ClosureAttribute.Optional1 public var onperiodicsync: EventHandler @ClosureAttribute.Optional1 - public var onnotificationclick: EventHandler + public var oncanmakepayment: EventHandler @ClosureAttribute.Optional1 - public var onnotificationclose: EventHandler + public var onpaymentrequest: EventHandler + + @ClosureAttribute.Optional1 + public var oncontentdelete: EventHandler + + @ClosureAttribute.Optional1 + public var onpush: EventHandler + + @ClosureAttribute.Optional1 + public var onpushsubscriptionchange: EventHandler + + @ReadonlyAttribute + public var cookieStore: CookieStore + + @ClosureAttribute.Optional1 + public var oncookiechange: EventHandler @ClosureAttribute.Optional1 public var onsync: EventHandler @@ -63,12 +78,6 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { @ClosureAttribute.Optional1 public var onbackgroundfetchclick: EventHandler - @ClosureAttribute.Optional1 - public var oncanmakepayment: EventHandler - - @ClosureAttribute.Optional1 - public var onpaymentrequest: EventHandler - @ReadonlyAttribute public var clients: Clients @@ -102,13 +111,4 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { @ClosureAttribute.Optional1 public var onmessageerror: EventHandler - - @ClosureAttribute.Optional1 - public var onpush: EventHandler - - @ClosureAttribute.Optional1 - public var onpushsubscriptionchange: EventHandler - - @ClosureAttribute.Optional1 - public var oncontentdelete: EventHandler } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift index 52c81099..33324a7b 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift @@ -7,11 +7,13 @@ public class ServiceWorkerRegistration: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerRegistration].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _cookies = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookies) _periodicSync = ReadonlyAttribute(jsObject: jsObject, name: Strings.periodicSync) + _paymentManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentManager) + _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) + _pushManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.pushManager) + _cookies = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookies) _sync = ReadonlyAttribute(jsObject: jsObject, name: Strings.sync) _backgroundFetch = ReadonlyAttribute(jsObject: jsObject, name: Strings.backgroundFetch) - _paymentManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentManager) _installing = ReadonlyAttribute(jsObject: jsObject, name: Strings.installing) _waiting = ReadonlyAttribute(jsObject: jsObject, name: Strings.waiting) _active = ReadonlyAttribute(jsObject: jsObject, name: Strings.active) @@ -19,17 +21,9 @@ public class ServiceWorkerRegistration: EventTarget { _scope = ReadonlyAttribute(jsObject: jsObject, name: Strings.scope) _updateViaCache = ReadonlyAttribute(jsObject: jsObject, name: Strings.updateViaCache) _onupdatefound = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupdatefound) - _pushManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.pushManager) - _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var cookies: CookieStoreManager - - @ReadonlyAttribute - public var periodicSync: PeriodicSyncManager - public func showNotification(title: String, options: NotificationOptions? = nil) -> JSPromise { jsObject[Strings.showNotification]!(title.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @@ -51,13 +45,25 @@ public class ServiceWorkerRegistration: EventTarget { } @ReadonlyAttribute - public var sync: SyncManager + public var periodicSync: PeriodicSyncManager @ReadonlyAttribute - public var backgroundFetch: BackgroundFetchManager + public var paymentManager: PaymentManager @ReadonlyAttribute - public var paymentManager: PaymentManager + public var index: ContentIndex + + @ReadonlyAttribute + public var pushManager: PushManager + + @ReadonlyAttribute + public var cookies: CookieStoreManager + + @ReadonlyAttribute + public var sync: SyncManager + + @ReadonlyAttribute + public var backgroundFetch: BackgroundFetchManager @ReadonlyAttribute public var installing: ServiceWorker? @@ -99,10 +105,4 @@ public class ServiceWorkerRegistration: EventTarget { @ClosureAttribute.Optional1 public var onupdatefound: EventHandler - - @ReadonlyAttribute - public var pushManager: PushManager - - @ReadonlyAttribute - public var index: ContentIndex } diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index 80381f54..ae9aee25 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -1059,8 +1059,6 @@ enum Strings { static let addCue: JSString = "addCue" static let addFromString: JSString = "addFromString" static let addFromURI: JSString = "addFromURI" - static let addIceCandidate: JSString = "addIceCandidate" - static let addListener: JSString = "addListener" static let addModule: JSString = "addModule" static let addPath: JSString = "addPath" static let addRange: JSString = "addRange" @@ -1385,7 +1383,7 @@ enum Strings { static let box: JSString = "box" static let brand: JSString = "brand" static let brands: JSString = "brands" - static let break: JSString = "break" + static let `break`: JSString = "break" static let breakToken: JSString = "breakToken" static let breakType: JSString = "breakType" static let breakdown: JSString = "breakdown" @@ -1684,7 +1682,7 @@ enum Strings { static let contents: JSString = "contents" static let context: JSString = "context" static let contextTime: JSString = "contextTime" - static let continue: JSString = "continue" + static let `continue`: JSString = "continue" static let continuePrimaryKey: JSString = "continuePrimaryKey" static let continuous: JSString = "continuous" static let contrast: JSString = "contrast" @@ -1738,7 +1736,6 @@ enum Strings { static let create: JSString = "create" static let createAnalyser: JSString = "createAnalyser" static let createAnchor: JSString = "createAnchor" - static let createAnswer: JSString = "createAnswer" static let createAttribute: JSString = "createAttribute" static let createAttributeNS: JSString = "createAttributeNS" static let createBidirectionalStream: JSString = "createBidirectionalStream" @@ -1788,7 +1785,6 @@ enum Strings { static let createMediaStreamTrackSource: JSString = "createMediaStreamTrackSource" static let createObjectStore: JSString = "createObjectStore" static let createObjectURL: JSString = "createObjectURL" - static let createOffer: JSString = "createOffer" static let createOscillator: JSString = "createOscillator" static let createPanner: JSString = "createPanner" static let createPattern: JSString = "createPattern" @@ -1901,7 +1897,6 @@ enum Strings { static let debug: JSString = "debug" static let declare: JSString = "declare" static let decode: JSString = "decode" - static let decodeAudioData: JSString = "decodeAudioData" static let decodeQueueSize: JSString = "decodeQueueSize" static let decodedBodySize: JSString = "decodedBodySize" static let decoderConfig: JSString = "decoderConfig" @@ -2275,7 +2270,6 @@ enum Strings { static let fetchpriority: JSString = "fetchpriority" static let fftSize: JSString = "fftSize" static let fgColor: JSString = "fgColor" - static let file: JSString = "file" static let filename: JSString = "filename" static let files: JSString = "files" static let filesystem: JSString = "filesystem" @@ -2478,7 +2472,6 @@ enum Strings { static let getContributingSources: JSString = "getContributingSources" static let getCueAsHTML: JSString = "getCueAsHTML" static let getCueById: JSString = "getCueById" - static let getCurrentPosition: JSString = "getCurrentPosition" static let getCurrentTexture: JSString = "getCurrentTexture" static let getCurrentTime: JSString = "getCurrentTime" static let getData: JSString = "getData" @@ -2547,7 +2540,6 @@ enum Strings { static let getOutputTimestamp: JSString = "getOutputTimestamp" static let getParameter: JSString = "getParameter" static let getParameters: JSString = "getParameters" - static let getParent: JSString = "getParent" static let getPhotoCapabilities: JSString = "getPhotoCapabilities" static let getPhotoSettings: JSString = "getPhotoSettings" static let getPointAtLength: JSString = "getPointAtLength" @@ -2773,7 +2765,7 @@ enum Strings { static let importScripts: JSString = "importScripts" static let importStylesheet: JSString = "importStylesheet" static let imports: JSString = "imports" - static let in: JSString = "in" + static let `in`: JSString = "in" static let in1: JSString = "in1" static let in2: JSString = "in2" static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" @@ -3651,7 +3643,7 @@ enum Strings { static let opened: JSString = "opened" static let opener: JSString = "opener" static let operation: JSString = "operation" - static let operator: JSString = "operator" + static let `operator`: JSString = "operator" static let optimizeForLatency: JSString = "optimizeForLatency" static let optimum: JSString = "optimum" static let optionalFeatures: JSString = "optionalFeatures" @@ -3855,7 +3847,6 @@ enum Strings { static let positionY: JSString = "positionY" static let positionZ: JSString = "positionZ" static let postMessage: JSString = "postMessage" - static let postTask: JSString = "postTask" static let postalCode: JSString = "postalCode" static let poster: JSString = "poster" static let postscriptName: JSString = "postscriptName" @@ -3936,7 +3927,7 @@ enum Strings { static let pseudoElement: JSString = "pseudoElement" static let pt: JSString = "pt" static let pubKeyCredParams: JSString = "pubKeyCredParams" - static let public: JSString = "public" + static let `public`: JSString = "public" static let publicExponent: JSString = "publicExponent" static let publicId: JSString = "publicId" static let publicKey: JSString = "publicKey" @@ -3998,7 +3989,6 @@ enum Strings { static let readAsDataURL: JSString = "readAsDataURL" static let readAsText: JSString = "readAsText" static let readBuffer: JSString = "readBuffer" - static let readEntries: JSString = "readEntries" static let readOnly: JSString = "readOnly" static let readPixels: JSString = "readPixels" static let readText: JSString = "readText" @@ -4058,11 +4048,7 @@ enum Strings { static let regionAnchorY: JSString = "regionAnchorY" static let regionOverset: JSString = "regionOverset" static let register: JSString = "register" - static let registerAnimator: JSString = "registerAnimator" static let registerAttributionSource: JSString = "registerAttributionSource" - static let registerLayout: JSString = "registerLayout" - static let registerPaint: JSString = "registerPaint" - static let registerProcessor: JSString = "registerProcessor" static let registerProperty: JSString = "registerProperty" static let registerProtocolHandler: JSString = "registerProtocolHandler" static let registration: JSString = "registration" @@ -4100,7 +4086,6 @@ enum Strings { static let removeCue: JSString = "removeCue" static let removeEntry: JSString = "removeEntry" static let removeItem: JSString = "removeItem" - static let removeListener: JSString = "removeListener" static let removeNamedItem: JSString = "removeNamedItem" static let removeNamedItemNS: JSString = "removeNamedItemNS" static let removeParameter: JSString = "removeParameter" @@ -4139,7 +4124,6 @@ enum Strings { static let reportsSent: JSString = "reportsSent" static let request: JSString = "request" static let requestAdapter: JSString = "requestAdapter" - static let requestAnimationFrame: JSString = "requestAnimationFrame" static let requestBytesSent: JSString = "requestBytesSent" static let requestData: JSString = "requestData" static let requestDevice: JSString = "requestDevice" @@ -4164,7 +4148,6 @@ enum Strings { static let requestSubmit: JSString = "requestSubmit" static let requestToSend: JSString = "requestToSend" static let requestType: JSString = "requestType" - static let requestVideoFrameCallback: JSString = "requestVideoFrameCallback" static let requestViewportScale: JSString = "requestViewportScale" static let requestedSamplingFrequency: JSString = "requestedSamplingFrequency" static let requestsReceived: JSString = "requestsReceived" @@ -4406,7 +4389,6 @@ enum Strings { static let sessionStorage: JSString = "sessionStorage" static let sessionTypes: JSString = "sessionTypes" static let set: JSString = "set" - static let setActionHandler: JSString = "setActionHandler" static let setAppBadge: JSString = "setAppBadge" static let setAttribute: JSString = "setAttribute" static let setAttributeNS: JSString = "setAttributeNS" @@ -4436,7 +4418,6 @@ enum Strings { static let setKeyframes: JSString = "setKeyframes" static let setLineDash: JSString = "setLineDash" static let setLiveSeekableRange: JSString = "setLiveSeekableRange" - static let setLocalDescription: JSString = "setLocalDescription" static let setMatrix: JSString = "setMatrix" static let setMatrixValue: JSString = "setMatrixValue" static let setMediaKeys: JSString = "setMediaKeys" @@ -4456,7 +4437,6 @@ enum Strings { static let setPriority: JSString = "setPriority" static let setProperty: JSString = "setProperty" static let setRangeText: JSString = "setRangeText" - static let setRemoteDescription: JSString = "setRemoteDescription" static let setRequestHeader: JSString = "setRequestHeader" static let setResourceTimingBufferSize: JSString = "setResourceTimingBufferSize" static let setRotate: JSString = "setRotate" @@ -5085,8 +5065,6 @@ enum Strings { static let wasClean: JSString = "wasClean" static let wasDiscarded: JSString = "wasDiscarded" static let watchAdvertisements: JSString = "watchAdvertisements" - static let watchAvailability: JSString = "watchAvailability" - static let watchPosition: JSString = "watchPosition" static let watchingAdvertisements: JSString = "watchingAdvertisements" static let webdriver: JSString = "webdriver" static let webkitEntries: JSString = "webkitEntries" diff --git a/Sources/DOMKit/WebIDL/TestUtils.swift b/Sources/DOMKit/WebIDL/TestUtils.swift index fde68d52..ccf2ead4 100644 --- a/Sources/DOMKit/WebIDL/TestUtils.swift +++ b/Sources/DOMKit/WebIDL/TestUtils.swift @@ -5,16 +5,16 @@ import JavaScriptKit public enum TestUtils { public static var jsObject: JSObject { - JSObject.global.[Strings.TestUtils].object! + JSObject.global[Strings.TestUtils].object! } public static func gc() -> JSPromise { - JSObject.global.[Strings.TestUtils].object![Strings.gc]!().fromJSValue()! + JSObject.global[Strings.TestUtils].object![Strings.gc]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func gc() async throws { - let _promise: JSPromise = JSObject.global.[Strings.TestUtils].object![Strings.gc]!().fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.TestUtils].object![Strings.gc]!().fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index 098f2781..5f767aa5 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -3,22 +3,15 @@ import JavaScriptEventLoop import JavaScriptKit -public typealias CookieList = [CookieListItem] +public typealias RotationMatrixType = __UNSUPPORTED_UNION__ +public typealias RTCRtpTransform = __UNSUPPORTED_UNION__ +public typealias SmallCryptoKeyID = UInt64 +public typealias CryptoKeyID = __UNSUPPORTED_UNION__ +public typealias LineAndPositionSetting = __UNSUPPORTED_UNION__ public typealias HeadersInit = __UNSUPPORTED_UNION__ public typealias XMLHttpRequestBodyInit = __UNSUPPORTED_UNION__ public typealias BodyInit = __UNSUPPORTED_UNION__ public typealias RequestInfo = __UNSUPPORTED_UNION__ -public typealias HTMLString = String -public typealias ScriptString = String -public typealias ScriptURLString = String -public typealias TrustedType = __UNSUPPORTED_UNION__ -public typealias BlobPart = __UNSUPPORTED_UNION__ -public typealias XRWebGLRenderingContext = __UNSUPPORTED_UNION__ -public typealias CSSStringSource = __UNSUPPORTED_UNION__ -public typealias CSSToken = __UNSUPPORTED_UNION__ -public typealias ReportList = [Report] -public typealias ReadableStreamReader = __UNSUPPORTED_UNION__ -public typealias ReadableStreamController = __UNSUPPORTED_UNION__ public typealias GLenum = UInt32 public typealias GLboolean = Bool public typealias GLbitfield = UInt32 @@ -36,30 +29,8 @@ public typealias GLclampf = Float public typealias TexImageSource = __UNSUPPORTED_UNION__ public typealias Float32List = __UNSUPPORTED_UNION__ public typealias Int32List = __UNSUPPORTED_UNION__ -public typealias UUID = String -public typealias BluetoothServiceUUID = __UNSUPPORTED_UNION__ -public typealias BluetoothCharacteristicUUID = __UNSUPPORTED_UNION__ -public typealias BluetoothDescriptorUUID = __UNSUPPORTED_UNION__ -public typealias DOMHighResTimeStamp = Double -public typealias EpochTimeStamp = UInt64 -public typealias FileSystemWriteChunkType = __UNSUPPORTED_UNION__ -public typealias StartInDirectory = __UNSUPPORTED_UNION__ -public typealias GeometryNode = __UNSUPPORTED_UNION__ -public typealias ConstrainPoint2D = __UNSUPPORTED_UNION__ -public typealias PasswordCredentialInit = __UNSUPPORTED_UNION__ -public typealias RotationMatrixType = __UNSUPPORTED_UNION__ -public typealias AlgorithmIdentifier = __UNSUPPORTED_UNION__ -public typealias HashAlgorithmIdentifier = AlgorithmIdentifier -public typealias BigInteger = Uint8Array -public typealias NamedCurve = String -public typealias NDEFMessageSource = __UNSUPPORTED_UNION__ -public typealias BinaryData = __UNSUPPORTED_UNION__ -public typealias ArrayBufferView = __UNSUPPORTED_UNION__ -public typealias BufferSource = __UNSUPPORTED_UNION__ -public typealias DOMTimeStamp = UInt64 -public typealias GLuint64EXT = UInt64 -public typealias Megabit = Double -public typealias Millisecond = UInt64 +public typealias CSSStringSource = __UNSUPPORTED_UNION__ +public typealias CSSToken = __UNSUPPORTED_UNION__ public typealias CSSUnparsedSegment = __UNSUPPORTED_UNION__ public typealias CSSKeywordish = __UNSUPPORTED_UNION__ public typealias CSSNumberish = __UNSUPPORTED_UNION__ @@ -68,38 +39,51 @@ public typealias CSSColorRGBComp = __UNSUPPORTED_UNION__ public typealias CSSColorPercent = __UNSUPPORTED_UNION__ public typealias CSSColorNumber = __UNSUPPORTED_UNION__ public typealias CSSColorAngle = __UNSUPPORTED_UNION__ -public typealias ContainerBasedOffset = __UNSUPPORTED_UNION__ -public typealias ScrollTimelineOffset = __UNSUPPORTED_UNION__ +public typealias PasswordCredentialInit = __UNSUPPORTED_UNION__ +public typealias ClipboardItemData = JSPromise +public typealias ClipboardItems = [ClipboardItem] +public typealias UUID = String +public typealias BluetoothServiceUUID = __UNSUPPORTED_UNION__ +public typealias BluetoothCharacteristicUUID = __UNSUPPORTED_UNION__ +public typealias BluetoothDescriptorUUID = __UNSUPPORTED_UNION__ +public typealias ConstrainULong = __UNSUPPORTED_UNION__ +public typealias ConstrainDouble = __UNSUPPORTED_UNION__ +public typealias ConstrainBoolean = __UNSUPPORTED_UNION__ +public typealias ConstrainDOMString = __UNSUPPORTED_UNION__ +public typealias XRWebGLRenderingContext = __UNSUPPORTED_UNION__ +public typealias HTMLString = String +public typealias ScriptString = String +public typealias ScriptURLString = String +public typealias TrustedType = __UNSUPPORTED_UNION__ +public typealias FormDataEntryValue = __UNSUPPORTED_UNION__ public typealias PerformanceEntryList = [PerformanceEntry] -public typealias LineAndPositionSetting = __UNSUPPORTED_UNION__ +public typealias ConstrainPoint2D = __UNSUPPORTED_UNION__ +public typealias AttributeMatchList = [String: [String]] +public typealias GeometryNode = __UNSUPPORTED_UNION__ +public typealias ImageBufferSource = __UNSUPPORTED_UNION__ +public typealias GLuint64EXT = UInt64 public typealias MLNamedOperands = [String: MLOperand] public typealias MLBufferView = __UNSUPPORTED_UNION__ public typealias MLResource = __UNSUPPORTED_UNION__ public typealias MLNamedInputs = [String: __UNSUPPORTED_UNION__] public typealias MLNamedOutputs = [String: MLResource] -public typealias HTMLOrSVGScriptElement = __UNSUPPORTED_UNION__ -public typealias MediaProvider = __UNSUPPORTED_UNION__ -public typealias RenderingContext = __UNSUPPORTED_UNION__ -public typealias HTMLOrSVGImageElement = __UNSUPPORTED_UNION__ -public typealias CanvasImageSource = __UNSUPPORTED_UNION__ -public typealias CanvasFilterInput = [String: JSValue] -public typealias OffscreenRenderingContext = __UNSUPPORTED_UNION__ -public typealias EventHandler = EventHandlerNonNull? -public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? -public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? -public typealias TimerHandler = __UNSUPPORTED_UNION__ -public typealias ImageBitmapSource = __UNSUPPORTED_UNION__ -public typealias MessageEventSource = __UNSUPPORTED_UNION__ -public typealias GLint64 = Int64 -public typealias GLuint64 = UInt64 -public typealias Uint32List = __UNSUPPORTED_UNION__ -public typealias AttributeMatchList = [String: [String]] -public typealias ClipboardItemData = JSPromise -public typealias ClipboardItems = [ClipboardItem] -public typealias FormDataEntryValue = __UNSUPPORTED_UNION__ -public typealias RTCRtpTransform = __UNSUPPORTED_UNION__ -public typealias SmallCryptoKeyID = UInt64 -public typealias CryptoKeyID = __UNSUPPORTED_UNION__ +public typealias URLPatternInput = __UNSUPPORTED_UNION__ +public typealias ContainerBasedOffset = __UNSUPPORTED_UNION__ +public typealias ScrollTimelineOffset = __UNSUPPORTED_UNION__ +public typealias DOMHighResTimeStamp = Double +public typealias EpochTimeStamp = UInt64 +public typealias PushMessageDataInit = __UNSUPPORTED_UNION__ +public typealias ProfilerResource = String +public typealias ReportList = [Report] +public typealias CookieList = [CookieListItem] +public typealias BlobPart = __UNSUPPORTED_UNION__ +public typealias COSEAlgorithmIdentifier = Int32 +public typealias UvmEntry = [UInt32] +public typealias UvmEntries = [UvmEntry] +public typealias AlgorithmIdentifier = __UNSUPPORTED_UNION__ +public typealias HashAlgorithmIdentifier = AlgorithmIdentifier +public typealias BigInteger = Uint8Array +public typealias NamedCurve = String public typealias GPUBufferUsageFlags = UInt32 public typealias GPUMapModeFlags = UInt32 public typealias GPUTextureUsageFlags = UInt32 @@ -124,29 +108,70 @@ public typealias GPUColor = __UNSUPPORTED_UNION__ public typealias GPUOrigin2D = __UNSUPPORTED_UNION__ public typealias GPUOrigin3D = __UNSUPPORTED_UNION__ public typealias GPUExtent3D = __UNSUPPORTED_UNION__ -public typealias ConstrainULong = __UNSUPPORTED_UNION__ -public typealias ConstrainDouble = __UNSUPPORTED_UNION__ -public typealias ConstrainBoolean = __UNSUPPORTED_UNION__ -public typealias ConstrainDOMString = __UNSUPPORTED_UNION__ -public typealias ProfilerResource = String -public typealias URLPatternInput = __UNSUPPORTED_UNION__ -public typealias PushMessageDataInit = __UNSUPPORTED_UNION__ -public typealias COSEAlgorithmIdentifier = Int32 -public typealias UvmEntry = [UInt32] -public typealias UvmEntries = [UvmEntry] +public typealias HTMLOrSVGScriptElement = __UNSUPPORTED_UNION__ +public typealias MediaProvider = __UNSUPPORTED_UNION__ +public typealias RenderingContext = __UNSUPPORTED_UNION__ +public typealias HTMLOrSVGImageElement = __UNSUPPORTED_UNION__ +public typealias CanvasImageSource = __UNSUPPORTED_UNION__ +public typealias CanvasFilterInput = [String: JSValue] +public typealias OffscreenRenderingContext = __UNSUPPORTED_UNION__ +public typealias EventHandler = EventHandlerNonNull? +public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? +public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? +public typealias TimerHandler = __UNSUPPORTED_UNION__ +public typealias ImageBitmapSource = __UNSUPPORTED_UNION__ +public typealias MessageEventSource = __UNSUPPORTED_UNION__ +public typealias GLint64 = Int64 +public typealias GLuint64 = UInt64 +public typealias Uint32List = __UNSUPPORTED_UNION__ +public typealias BinaryData = __UNSUPPORTED_UNION__ +public typealias ReadableStreamReader = __UNSUPPORTED_UNION__ +public typealias ReadableStreamController = __UNSUPPORTED_UNION__ +public typealias NDEFMessageSource = __UNSUPPORTED_UNION__ +public typealias Megabit = Double +public typealias Millisecond = UInt64 +public typealias FileSystemWriteChunkType = __UNSUPPORTED_UNION__ +public typealias StartInDirectory = __UNSUPPORTED_UNION__ +public typealias ArrayBufferView = __UNSUPPORTED_UNION__ +public typealias BufferSource = __UNSUPPORTED_UNION__ +public typealias DOMTimeStamp = UInt64 public typealias VibratePattern = __UNSUPPORTED_UNION__ -public typealias ImageBufferSource = __UNSUPPORTED_UNION__ -public typealias IdleRequestCallback = (IdleDeadline) -> Void -public typealias EffectCallback = (Double?, __UNSUPPORTED_UNION__, Animation) -> Void -public typealias MediaSessionActionHandler = (MediaSessionActionDetails) -> Void +public typealias LockGrantedCallback = (Lock?) -> JSPromise public typealias VideoFrameRequestCallback = (DOMHighResTimeStamp, VideoFrameMetadata) -> Void -public typealias ResizeObserverCallback = ([ResizeObserverEntry], ResizeObserver) -> Void -public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void +public typealias NavigatorUserMediaSuccessCallback = (MediaStream) -> Void +public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void +public typealias XRFrameRequestCallback = (DOMHighResTimeStamp, XRFrame) -> Void +public typealias NotificationPermissionCallback = (NotificationPermission) -> Void public typealias CreateHTMLCallback = (String, JSValue...) -> String public typealias CreateScriptCallback = (String, JSValue...) -> String public typealias CreateScriptURLCallback = (String, JSValue...) -> String -public typealias XRFrameRequestCallback = (DOMHighResTimeStamp, XRFrame) -> Void +public typealias PerformanceObserverCallback = (PerformanceObserverEntryList, PerformanceObserver, PerformanceObserverCallbackOptions) -> Void +public typealias RemotePlaybackAvailabilityCallback = (Bool) -> Void +public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void +public typealias MediaSessionActionHandler = (MediaSessionActionDetails) -> 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 typealias RTCPeerConnectionErrorCallback = (DOMException) -> Void +public typealias RTCSessionDescriptionCallback = (RTCSessionDescriptionInit) -> Void +public typealias ComputePressureUpdateCallback = ([ComputePressureRecord], ComputePressureObserver) -> Void public typealias ReportingObserverCallback = ([Report], ReportingObserver) -> Void +public typealias ResizeObserverCallback = ([ResizeObserverEntry], ResizeObserver) -> Void +public typealias AnimatorInstanceConstructor = (JSValue, JSValue) -> JSValue +public typealias ErrorCallback = (DOMException) -> Void +public typealias FileSystemEntryCallback = (FileSystemEntry) -> Void +public typealias FileSystemEntriesCallback = ([FileSystemEntry]) -> Void +public typealias FileCallback = (File) -> Void +public typealias SchedulerPostTaskCallback = () -> JSValue +public typealias BlobCallback = (Blob?) -> Void +public typealias CustomElementConstructor = () -> HTMLElement +public typealias FunctionStringCallback = (String) -> Void +public typealias EventHandlerNonNull = (Event) -> JSValue +public typealias OnErrorEventHandlerNonNull = (__UNSUPPORTED_UNION__, String, UInt32, UInt32, JSValue) -> JSValue +public typealias OnBeforeUnloadEventHandlerNonNull = (Event) -> String? +public typealias FrameRequestCallback = (DOMHighResTimeStamp) -> Void public typealias UnderlyingSourceStartCallback = (ReadableStreamController) -> JSValue public typealias UnderlyingSourcePullCallback = (ReadableStreamController) -> JSPromise public typealias UnderlyingSourceCancelCallback = (JSValue) -> JSPromise @@ -158,40 +183,15 @@ public typealias TransformerStartCallback = (TransformStreamDefaultController) - public typealias TransformerFlushCallback = (TransformStreamDefaultController) -> JSPromise public typealias TransformerTransformCallback = (JSValue, TransformStreamDefaultController) -> JSPromise public typealias QueuingStrategySize = (JSValue) -> Double -public typealias NotificationPermissionCallback = (NotificationPermission) -> Void -public typealias ErrorCallback = (DOMException) -> Void -public typealias FileSystemEntryCallback = (FileSystemEntry) -> Void -public typealias FileSystemEntriesCallback = ([FileSystemEntry]) -> Void -public typealias FileCallback = (File) -> Void -public typealias RTCPeerConnectionErrorCallback = (DOMException) -> Void -public typealias RTCSessionDescriptionCallback = (RTCSessionDescriptionInit) -> Void public typealias DecodeErrorCallback = (DOMException) -> Void public typealias DecodeSuccessCallback = (AudioBuffer) -> Void public typealias AudioWorkletProcessorConstructor = (JSObject) -> AudioWorkletProcessor public typealias AudioWorkletProcessCallback = ([[Float32Array]], [[Float32Array]], JSObject) -> Bool -public typealias VoidFunction = () -> Void +public typealias GenerateAssertionCallback = (String, String, RTCIdentityProviderOptions) -> JSPromise +public typealias ValidateAssertionCallback = (String, String) -> JSPromise public typealias PositionCallback = (GeolocationPosition) -> Void public typealias PositionErrorCallback = (GeolocationPositionError) -> Void -public typealias PerformanceObserverCallback = (PerformanceObserverEntryList, PerformanceObserver, PerformanceObserverCallbackOptions) -> Void -public typealias AnimatorInstanceConstructor = (JSValue, JSValue) -> JSValue -public typealias ComputePressureUpdateCallback = ([ComputePressureRecord], ComputePressureObserver) -> Void public typealias IntersectionObserverCallback = ([IntersectionObserverEntry], IntersectionObserver) -> Void -public typealias BlobCallback = (Blob?) -> Void -public typealias CustomElementConstructor = () -> HTMLElement -public typealias FunctionStringCallback = (String) -> Void -public typealias EventHandlerNonNull = (Event) -> JSValue -public typealias OnErrorEventHandlerNonNull = (__UNSUPPORTED_UNION__, String, UInt32, UInt32, JSValue) -> JSValue -public typealias OnBeforeUnloadEventHandlerNonNull = (Event) -> String? -public typealias FrameRequestCallback = (DOMHighResTimeStamp) -> Void -public typealias SchedulerPostTaskCallback = () -> JSValue -public typealias GenerateAssertionCallback = (String, String, RTCIdentityProviderOptions) -> JSPromise -public typealias ValidateAssertionCallback = (String, String) -> JSPromise -public typealias NavigatorUserMediaSuccessCallback = (MediaStream) -> Void -public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void -public typealias RemotePlaybackAvailabilityCallback = (Bool) -> Void -public typealias LockGrantedCallback = (Lock?) -> JSPromise -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 typealias VoidFunction = () -> Void +public typealias EffectCallback = (Double?, __UNSUPPORTED_UNION__, Animation) -> Void +public typealias IdleRequestCallback = (IdleDeadline) -> Void diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index 5257eebf..837a531b 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -24,14 +24,6 @@ public class URL: JSBridgedClass { self.jsObject = jsObject } - public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { - constructor[Strings.createObjectURL]!(obj.jsValue()).fromJSValue()! - } - - public static func revokeObjectURL(url: String) { - _ = constructor[Strings.revokeObjectURL]!(url.jsValue()) - } - public convenience init(url: String, base: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), base?.jsValue() ?? .undefined)) } @@ -75,4 +67,12 @@ public class URL: JSBridgedClass { public func toJSON() -> String { jsObject[Strings.toJSON]!().fromJSValue()! } + + public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { + constructor[Strings.createObjectURL]!(obj.jsValue()).fromJSValue()! + } + + public static func revokeObjectURL(url: String) { + _ = constructor[Strings.revokeObjectURL]!(url.jsValue()) + } } diff --git a/Sources/DOMKit/WebIDL/USBDirection.swift b/Sources/DOMKit/WebIDL/USBDirection.swift index 18092b3b..47ba1493 100644 --- a/Sources/DOMKit/WebIDL/USBDirection.swift +++ b/Sources/DOMKit/WebIDL/USBDirection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public enum USBDirection: JSString, JSValueCompatible { - case in = "in" + case `in` = "in" case out = "out" public static func construct(from jsValue: JSValue) -> Self? { diff --git a/Sources/DOMKit/WebIDL/WebAssembly.swift b/Sources/DOMKit/WebIDL/WebAssembly.swift index 50a5ed04..a3e22f0f 100644 --- a/Sources/DOMKit/WebIDL/WebAssembly.swift +++ b/Sources/DOMKit/WebIDL/WebAssembly.swift @@ -5,60 +5,60 @@ import JavaScriptKit public enum WebAssembly { public static var jsObject: JSObject { - JSObject.global.[Strings.WebAssembly].object! + JSObject.global[Strings.WebAssembly].object! } public static func compileStreaming(source: JSPromise) -> JSPromise { - JSObject.global.[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! + JSObject.global[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func compileStreaming(source: JSPromise) async throws -> Module { - let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) -> JSPromise { - JSObject.global.[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + JSObject.global[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { - let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func validate(bytes: BufferSource) -> Bool { - JSObject.global.[Strings.WebAssembly].object![Strings.validate]!(bytes.jsValue()).fromJSValue()! + JSObject.global[Strings.WebAssembly].object![Strings.validate]!(bytes.jsValue()).fromJSValue()! } public static func compile(bytes: BufferSource) -> JSPromise { - JSObject.global.[Strings.WebAssembly].object![Strings.compile]!(bytes.jsValue()).fromJSValue()! + JSObject.global[Strings.WebAssembly].object![Strings.compile]!(bytes.jsValue()).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func compile(bytes: BufferSource) async throws -> Module { - let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.compile]!(bytes.jsValue()).fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.compile]!(bytes.jsValue()).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) -> JSPromise { - JSObject.global.[Strings.WebAssembly].object![Strings.instantiate]!(bytes.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + JSObject.global[Strings.WebAssembly].object![Strings.instantiate]!(bytes.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { - let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.instantiate]!(bytes.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.instantiate]!(bytes.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) -> JSPromise { - JSObject.global.[Strings.WebAssembly].object![Strings.instantiate]!(moduleObject.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + JSObject.global[Strings.WebAssembly].object![Strings.instantiate]!(moduleObject.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) async throws -> Instance { - let _promise: JSPromise = JSObject.global.[Strings.WebAssembly].object![Strings.instantiate]!(moduleObject.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.instantiate]!(moduleObject.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift b/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift index f9e806d1..b3e2fdda 100644 --- a/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift +++ b/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift @@ -4,9 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLContextAttributes: BridgedDictionary { - public convenience init(xrCompatible: Bool, alpha: Bool, depth: Bool, stencil: Bool, antialias: Bool, premultipliedAlpha: Bool, preserveDrawingBuffer: Bool, powerPreference: WebGLPowerPreference, failIfMajorPerformanceCaveat: Bool, desynchronized: Bool) { + public convenience init(alpha: Bool, depth: Bool, stencil: Bool, antialias: Bool, premultipliedAlpha: Bool, preserveDrawingBuffer: Bool, powerPreference: WebGLPowerPreference, failIfMajorPerformanceCaveat: Bool, desynchronized: Bool, xrCompatible: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.xrCompatible] = xrCompatible.jsValue() object[Strings.alpha] = alpha.jsValue() object[Strings.depth] = depth.jsValue() object[Strings.stencil] = stencil.jsValue() @@ -16,11 +15,11 @@ public class WebGLContextAttributes: BridgedDictionary { object[Strings.powerPreference] = powerPreference.jsValue() object[Strings.failIfMajorPerformanceCaveat] = failIfMajorPerformanceCaveat.jsValue() object[Strings.desynchronized] = desynchronized.jsValue() + object[Strings.xrCompatible] = xrCompatible.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _xrCompatible = ReadWriteAttribute(jsObject: object, name: Strings.xrCompatible) _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) _depth = ReadWriteAttribute(jsObject: object, name: Strings.depth) _stencil = ReadWriteAttribute(jsObject: object, name: Strings.stencil) @@ -30,12 +29,10 @@ public class WebGLContextAttributes: BridgedDictionary { _powerPreference = ReadWriteAttribute(jsObject: object, name: Strings.powerPreference) _failIfMajorPerformanceCaveat = ReadWriteAttribute(jsObject: object, name: Strings.failIfMajorPerformanceCaveat) _desynchronized = ReadWriteAttribute(jsObject: object, name: Strings.desynchronized) + _xrCompatible = ReadWriteAttribute(jsObject: object, name: Strings.xrCompatible) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var xrCompatible: Bool - @ReadWriteAttribute public var alpha: Bool @@ -62,4 +59,7 @@ public class WebGLContextAttributes: BridgedDictionary { @ReadWriteAttribute public var desynchronized: Bool + + @ReadWriteAttribute + public var xrCompatible: Bool } diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift index bd32bdd6..806b45c0 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift @@ -5,16 +5,6 @@ import JavaScriptKit public protocol WebGLRenderingContextBase: JSBridgedClass {} public extension WebGLRenderingContextBase { - func makeXRCompatible() -> JSPromise { - jsObject[Strings.makeXRCompatible]!().fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func makeXRCompatible() async throws { - let _promise: JSPromise = jsObject[Strings.makeXRCompatible]!().fromJSValue()! - _ = try await _promise.get() - } - static let DEPTH_BUFFER_BIT: GLenum = 0x0000_0100 static let STENCIL_BUFFER_BIT: GLenum = 0x0000_0400 @@ -1106,4 +1096,14 @@ public extension WebGLRenderingContextBase { func viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { _ = jsObject[Strings.viewport]!(x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()) } + + func makeXRCompatible() -> JSPromise { + jsObject[Strings.makeXRCompatible]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + func makeXRCompatible() async throws { + let _promise: JSPromise = jsObject[Strings.makeXRCompatible]!().fromJSValue()! + _ = try await _promise.get() + } } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 49b56fe6..b21e6d20 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -7,14 +7,13 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind override public class var constructor: JSFunction { JSObject.global[Strings.Window].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _ondeviceorientation = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientation) + _ondeviceorientationabsolute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientationabsolute) + _oncompassneedscalibration = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompassneedscalibration) + _ondevicemotion = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicemotion) _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) _onorientationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onorientationchange) - _speechSynthesis = ReadonlyAttribute(jsObject: jsObject, name: Strings.speechSynthesis) - _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) _event = ReadonlyAttribute(jsObject: jsObject, name: Strings.event) - _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) - _onappinstalled = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onappinstalled) - _onbeforeinstallprompt = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbeforeinstallprompt) _screen = ReadonlyAttribute(jsObject: jsObject, name: Strings.screen) _innerWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.innerWidth) _innerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.innerHeight) @@ -30,7 +29,10 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind _outerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.outerHeight) _devicePixelRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePixelRatio) _attributionReporting = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributionReporting) - _visualViewport = ReadonlyAttribute(jsObject: jsObject, name: Strings.visualViewport) + _speechSynthesis = ReadonlyAttribute(jsObject: jsObject, name: Strings.speechSynthesis) + _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) + _onappinstalled = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onappinstalled) + _onbeforeinstallprompt = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbeforeinstallprompt) _window = ReadonlyAttribute(jsObject: jsObject, name: Strings.window) _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) _document = ReadonlyAttribute(jsObject: jsObject, name: Strings.document) @@ -57,74 +59,35 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: Strings.originAgentCluster) _external = ReadonlyAttribute(jsObject: jsObject, name: Strings.external) _portalHost = ReadonlyAttribute(jsObject: jsObject, name: Strings.portalHost) - _ondeviceorientation = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientation) - _ondeviceorientationabsolute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientationabsolute) - _oncompassneedscalibration = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompassneedscalibration) - _ondevicemotion = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicemotion) + _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) + _visualViewport = ReadonlyAttribute(jsObject: jsObject, name: Strings.visualViewport) super.init(unsafelyWrapping: jsObject) } - public func requestIdleCallback(callback: IdleRequestCallback, options: IdleRequestOptions? = nil) -> UInt32 { - jsObject[Strings.requestIdleCallback]!(callback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - } - - public func cancelIdleCallback(handle: UInt32) { - _ = jsObject[Strings.cancelIdleCallback]!(handle.jsValue()) - } - - @ReadonlyAttribute - public var orientation: Int16 - @ClosureAttribute.Optional1 - public var onorientationchange: EventHandler - - @ReadonlyAttribute - public var speechSynthesis: SpeechSynthesis - - @ReadonlyAttribute - public var cookieStore: CookieStore - - @ReadonlyAttribute - public var event: __UNSUPPORTED_UNION__ - - @ReadonlyAttribute - public var navigation: Navigation + public var ondeviceorientation: EventHandler @ClosureAttribute.Optional1 - public var onappinstalled: EventHandler + public var ondeviceorientationabsolute: EventHandler @ClosureAttribute.Optional1 - public var onbeforeinstallprompt: EventHandler - - public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { - jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - } + public var oncompassneedscalibration: EventHandler - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { - let _promise: JSPromise = jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + @ClosureAttribute.Optional1 + public var ondevicemotion: EventHandler - public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { - jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - } + @ReadonlyAttribute + public var orientation: Int16 - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { - let _promise: JSPromise = jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + @ClosureAttribute.Optional1 + public var onorientationchange: EventHandler - public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { - jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + public func getSelection() -> Selection? { + jsObject[Strings.getSelection]!().fromJSValue()! } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { - let _promise: JSPromise = jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + @ReadonlyAttribute + public var event: __UNSUPPORTED_UNION__ public func matchMedia(query: String) -> MediaQueryList { jsObject[Strings.matchMedia]!(query.jsValue()).fromJSValue()! @@ -212,16 +175,6 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var devicePixelRatio: Double - @ReadonlyAttribute - public var attributionReporting: AttributionReporting - - public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { - jsObject[Strings.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! - } - - @ReadonlyAttribute - public var visualViewport: VisualViewport - public func getDigitalGoodsService(serviceProvider: String) -> JSPromise { jsObject[Strings.getDigitalGoodsService]!(serviceProvider.jsValue()).fromJSValue()! } @@ -232,6 +185,21 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind return try await _promise.get().fromJSValue()! } + @ReadonlyAttribute + public var attributionReporting: AttributionReporting + + @ReadonlyAttribute + public var speechSynthesis: SpeechSynthesis + + @ReadonlyAttribute + public var cookieStore: CookieStore + + @ClosureAttribute.Optional1 + public var onappinstalled: EventHandler + + @ClosureAttribute.Optional1 + public var onbeforeinstallprompt: EventHandler + @ReadonlyAttribute public var window: WindowProxy @@ -370,23 +338,55 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var portalHost: PortalHost? - @ClosureAttribute.Optional1 - public var ondeviceorientation: EventHandler + public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { + jsObject[Strings.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! + } - @ClosureAttribute.Optional1 - public var ondeviceorientationabsolute: EventHandler + public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { + jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + } - @ClosureAttribute.Optional1 - public var oncompassneedscalibration: EventHandler + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { + let _promise: JSPromise = jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } - @ClosureAttribute.Optional1 - public var ondevicemotion: EventHandler + public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { + jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + } - public func getSelection() -> Selection? { - jsObject[Strings.getSelection]!().fromJSValue()! + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { + let _promise: JSPromise = jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { + jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { + let _promise: JSPromise = jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! } public func navigate(dir: SpatialNavigationDirection) { _ = jsObject[Strings.navigate]!(dir.jsValue()) } + + @ReadonlyAttribute + public var navigation: Navigation + + @ReadonlyAttribute + public var visualViewport: VisualViewport + + public func requestIdleCallback(callback: IdleRequestCallback, options: IdleRequestOptions? = nil) -> UInt32 { + jsObject[Strings.requestIdleCallback]!(callback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + + public func cancelIdleCallback(handle: UInt32) { + _ = jsObject[Strings.cancelIdleCallback]!(handle.jsValue()) + } } diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index 316a34ac..98ffe4f6 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -5,6 +5,16 @@ import JavaScriptKit public protocol WindowEventHandlers: JSBridgedClass {} public extension WindowEventHandlers { + var ongamepadconnected: EventHandler { + get { ClosureAttribute.Optional1[Strings.ongamepadconnected, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ongamepadconnected, in: jsObject] = newValue } + } + + var ongamepaddisconnected: EventHandler { + get { ClosureAttribute.Optional1[Strings.ongamepaddisconnected, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ongamepaddisconnected, in: jsObject] = newValue } + } + var onafterprint: EventHandler { get { ClosureAttribute.Optional1[Strings.onafterprint, in: jsObject] } set { ClosureAttribute.Optional1[Strings.onafterprint, in: jsObject] = newValue } @@ -89,14 +99,4 @@ public extension WindowEventHandlers { get { ClosureAttribute.Optional1[Strings.onportalactivate, in: jsObject] } set { ClosureAttribute.Optional1[Strings.onportalactivate, in: jsObject] = newValue } } - - var ongamepadconnected: EventHandler { - get { ClosureAttribute.Optional1[Strings.ongamepadconnected, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ongamepadconnected, in: jsObject] = newValue } - } - - var ongamepaddisconnected: EventHandler { - get { ClosureAttribute.Optional1[Strings.ongamepaddisconnected, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ongamepaddisconnected, in: jsObject] = newValue } - } } diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index bfb91310..d6e3b013 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -15,17 +15,15 @@ public extension WindowOrWorkerGlobalScope { return try await _promise.get().fromJSValue()! } - var trustedTypes: TrustedTypePolicyFactory { ReadonlyAttribute[Strings.trustedTypes, in: jsObject] } + var indexedDB: IDBFactory { ReadonlyAttribute[Strings.indexedDB, in: jsObject] } - var originPolicyIds: [String] { ReadonlyAttribute[Strings.originPolicyIds, in: jsObject] } + var trustedTypes: TrustedTypePolicyFactory { ReadonlyAttribute[Strings.trustedTypes, in: jsObject] } var performance: Performance { ReadonlyAttribute[Strings.performance, in: jsObject] } var crypto: Crypto { ReadonlyAttribute[Strings.crypto, in: jsObject] } - var caches: CacheStorage { ReadonlyAttribute[Strings.caches, in: jsObject] } - - var indexedDB: IDBFactory { ReadonlyAttribute[Strings.indexedDB, in: jsObject] } + var scheduler: Scheduler { ReadonlyAttribute[Strings.scheduler, in: jsObject] } var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } @@ -99,5 +97,7 @@ public extension WindowOrWorkerGlobalScope { jsObject[Strings.structuredClone]!(value.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } - var scheduler: Scheduler { ReadonlyAttribute[Strings.scheduler, in: jsObject] } + var originPolicyIds: [String] { ReadonlyAttribute[Strings.originPolicyIds, in: jsObject] } + + var caches: CacheStorage { ReadonlyAttribute[Strings.caches, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index f93d024c..3e4c639e 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class WorkerGlobalScope: EventTarget, FontFaceSource, WindowOrWorkerGlobalScope { +public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope, FontFaceSource { override public class var constructor: JSFunction { JSObject.global[Strings.WorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/WorkerNavigator.swift b/Sources/DOMKit/WebIDL/WorkerNavigator.swift index 552c936d..305d8dc6 100644 --- a/Sources/DOMKit/WebIDL/WorkerNavigator.swift +++ b/Sources/DOMKit/WebIDL/WorkerNavigator.swift @@ -3,17 +3,17 @@ import JavaScriptEventLoop import JavaScriptKit -public class WorkerNavigator: JSBridgedClass, NavigatorStorage, NavigatorDeviceMemory, NavigatorNetworkInformation, NavigatorML, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware, NavigatorUA, NavigatorGPU, NavigatorBadge, NavigatorLocks { +public class WorkerNavigator: JSBridgedClass, NavigatorLocks, NavigatorML, NavigatorDeviceMemory, NavigatorStorage, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware, NavigatorBadge, NavigatorNetworkInformation, NavigatorUA { public class var constructor: JSFunction { JSObject.global[Strings.WorkerNavigator].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) - _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) - _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) _serial = ReadonlyAttribute(jsObject: jsObject, name: Strings.serial) _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) + _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) + _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) self.jsObject = jsObject } @@ -21,14 +21,14 @@ public class WorkerNavigator: JSBridgedClass, NavigatorStorage, NavigatorDeviceM public var permissions: Permissions @ReadonlyAttribute - public var serviceWorker: ServiceWorkerContainer + public var serial: Serial @ReadonlyAttribute - public var usb: USB + public var mediaCapabilities: MediaCapabilities @ReadonlyAttribute - public var serial: Serial + public var serviceWorker: ServiceWorkerContainer @ReadonlyAttribute - public var mediaCapabilities: MediaCapabilities + public var usb: USB } diff --git a/Sources/DOMKit/WebIDL/XRFrame.swift b/Sources/DOMKit/WebIDL/XRFrame.swift index 19c2393b..78569a65 100644 --- a/Sources/DOMKit/WebIDL/XRFrame.swift +++ b/Sources/DOMKit/WebIDL/XRFrame.swift @@ -15,6 +15,14 @@ public class XRFrame: JSBridgedClass { self.jsObject = jsObject } + public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { + jsObject[Strings.getHitTestResults]!(hitTestSource.jsValue()).fromJSValue()! + } + + public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { + jsObject[Strings.getHitTestResultsForTransientInput]!(hitTestSource.jsValue()).fromJSValue()! + } + @ReadonlyAttribute public var session: XRSession @@ -29,16 +37,8 @@ public class XRFrame: JSBridgedClass { jsObject[Strings.getPose]!(space.jsValue(), baseSpace.jsValue()).fromJSValue()! } - public func getJointPose(joint: XRJointSpace, baseSpace: XRSpace) -> XRJointPose? { - jsObject[Strings.getJointPose]!(joint.jsValue(), baseSpace.jsValue()).fromJSValue()! - } - - public func fillJointRadii(jointSpaces: [XRJointSpace], radii: Float32Array) -> Bool { - jsObject[Strings.fillJointRadii]!(jointSpaces.jsValue(), radii.jsValue()).fromJSValue()! - } - - public func fillPoses(spaces: [XRSpace], baseSpace: XRSpace, transforms: Float32Array) -> Bool { - jsObject[Strings.fillPoses]!(spaces.jsValue(), baseSpace.jsValue(), transforms.jsValue()).fromJSValue()! + public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { + jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! } public func createAnchor(pose: XRRigidTransform, space: XRSpace) -> JSPromise { @@ -54,19 +54,19 @@ public class XRFrame: JSBridgedClass { @ReadonlyAttribute public var trackedAnchors: XRAnchorSet - public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { - jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! + public func getJointPose(joint: XRJointSpace, baseSpace: XRSpace) -> XRJointPose? { + jsObject[Strings.getJointPose]!(joint.jsValue(), baseSpace.jsValue()).fromJSValue()! } - public func getLightEstimate(lightProbe: XRLightProbe) -> XRLightEstimate? { - jsObject[Strings.getLightEstimate]!(lightProbe.jsValue()).fromJSValue()! + public func fillJointRadii(jointSpaces: [XRJointSpace], radii: Float32Array) -> Bool { + jsObject[Strings.fillJointRadii]!(jointSpaces.jsValue(), radii.jsValue()).fromJSValue()! } - public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { - jsObject[Strings.getHitTestResults]!(hitTestSource.jsValue()).fromJSValue()! + public func fillPoses(spaces: [XRSpace], baseSpace: XRSpace, transforms: Float32Array) -> Bool { + jsObject[Strings.fillPoses]!(spaces.jsValue(), baseSpace.jsValue(), transforms.jsValue()).fromJSValue()! } - public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { - jsObject[Strings.getHitTestResultsForTransientInput]!(hitTestSource.jsValue()).fromJSValue()! + public func getLightEstimate(lightProbe: XRLightProbe) -> XRLightEstimate? { + jsObject[Strings.getLightEstimate]!(lightProbe.jsValue()).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRHitTestResult.swift b/Sources/DOMKit/WebIDL/XRHitTestResult.swift index 5d50ee54..458508f2 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestResult.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestResult.swift @@ -12,6 +12,10 @@ public class XRHitTestResult: JSBridgedClass { self.jsObject = jsObject } + public func getPose(baseSpace: XRSpace) -> XRPose? { + jsObject[Strings.getPose]!(baseSpace.jsValue()).fromJSValue()! + } + public func createAnchor() -> JSPromise { jsObject[Strings.createAnchor]!().fromJSValue()! } @@ -21,8 +25,4 @@ public class XRHitTestResult: JSBridgedClass { let _promise: JSPromise = jsObject[Strings.createAnchor]!().fromJSValue()! return try await _promise.get().fromJSValue()! } - - public func getPose(baseSpace: XRSpace) -> XRPose? { - jsObject[Strings.getPose]!(baseSpace.jsValue()).fromJSValue()! - } } diff --git a/Sources/DOMKit/WebIDL/XRInputSource.swift b/Sources/DOMKit/WebIDL/XRInputSource.swift index f74135ae..9c17e046 100644 --- a/Sources/DOMKit/WebIDL/XRInputSource.swift +++ b/Sources/DOMKit/WebIDL/XRInputSource.swift @@ -14,8 +14,8 @@ public class XRInputSource: JSBridgedClass { _targetRaySpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetRaySpace) _gripSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.gripSpace) _profiles = ReadonlyAttribute(jsObject: jsObject, name: Strings.profiles) - _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) _gamepad = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamepad) + _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) self.jsObject = jsObject } @@ -35,8 +35,8 @@ public class XRInputSource: JSBridgedClass { public var profiles: [String] @ReadonlyAttribute - public var hand: XRHand? + public var gamepad: Gamepad? @ReadonlyAttribute - public var gamepad: Gamepad? + public var hand: XRHand? } diff --git a/Sources/DOMKit/WebIDL/XRRenderState.swift b/Sources/DOMKit/WebIDL/XRRenderState.swift index a3fa71f4..24af19c7 100644 --- a/Sources/DOMKit/WebIDL/XRRenderState.swift +++ b/Sources/DOMKit/WebIDL/XRRenderState.swift @@ -9,14 +9,17 @@ public class XRRenderState: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _layers = ReadonlyAttribute(jsObject: jsObject, name: Strings.layers) _depthNear = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthNear) _depthFar = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthFar) _inlineVerticalFieldOfView = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineVerticalFieldOfView) _baseLayer = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseLayer) - _layers = ReadonlyAttribute(jsObject: jsObject, name: Strings.layers) self.jsObject = jsObject } + @ReadonlyAttribute + public var layers: [XRLayer] + @ReadonlyAttribute public var depthNear: Double @@ -28,7 +31,4 @@ public class XRRenderState: JSBridgedClass { @ReadonlyAttribute public var baseLayer: XRWebGLLayer? - - @ReadonlyAttribute - public var layers: [XRLayer] } diff --git a/Sources/DOMKit/WebIDL/XRSession.swift b/Sources/DOMKit/WebIDL/XRSession.swift index e61956e3..4f3a138c 100644 --- a/Sources/DOMKit/WebIDL/XRSession.swift +++ b/Sources/DOMKit/WebIDL/XRSession.swift @@ -22,15 +22,35 @@ public class XRSession: EventTarget { _onsqueezeend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsqueezeend) _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onvisibilitychange) _onframeratechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onframeratechange) - _domOverlayState = ReadonlyAttribute(jsObject: jsObject, name: Strings.domOverlayState) _depthUsage = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthUsage) _depthDataFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthDataFormat) + _domOverlayState = ReadonlyAttribute(jsObject: jsObject, name: Strings.domOverlayState) _environmentBlendMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.environmentBlendMode) _interactionMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionMode) _preferredReflectionFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.preferredReflectionFormat) super.init(unsafelyWrapping: jsObject) } + public func requestHitTestSource(options: XRHitTestOptionsInit) -> JSPromise { + jsObject[Strings.requestHitTestSource]!(options.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestHitTestSource(options: XRHitTestOptionsInit) async throws -> XRHitTestSource { + let _promise: JSPromise = jsObject[Strings.requestHitTestSource]!(options.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) -> JSPromise { + jsObject[Strings.requestHitTestSourceForTransientInput]!(options.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) async throws -> XRTransientInputHitTestSource { + let _promise: JSPromise = jsObject[Strings.requestHitTestSourceForTransientInput]!(options.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + @ReadonlyAttribute public var visibilityState: XRVisibilityState @@ -70,9 +90,7 @@ public class XRSession: EventTarget { return try await _promise.get().fromJSValue()! } - public func requestAnimationFrame(callback: XRFrameRequestCallback) -> UInt32 { - jsObject[Strings.requestAnimationFrame]!(callback.jsValue()).fromJSValue()! - } + // XXX: member 'requestAnimationFrame' is ignored public func cancelAnimationFrame(handle: UInt32) { _ = jsObject[Strings.cancelAnimationFrame]!(handle.jsValue()) @@ -118,15 +136,15 @@ public class XRSession: EventTarget { @ClosureAttribute.Optional1 public var onframeratechange: EventHandler - @ReadonlyAttribute - public var domOverlayState: XRDOMOverlayState? - @ReadonlyAttribute public var depthUsage: XRDepthUsage @ReadonlyAttribute public var depthDataFormat: XRDepthDataFormat + @ReadonlyAttribute + public var domOverlayState: XRDOMOverlayState? + @ReadonlyAttribute public var environmentBlendMode: XREnvironmentBlendMode @@ -145,24 +163,4 @@ public class XRSession: EventTarget { @ReadonlyAttribute public var preferredReflectionFormat: XRReflectionFormat - - public func requestHitTestSource(options: XRHitTestOptionsInit) -> JSPromise { - jsObject[Strings.requestHitTestSource]!(options.jsValue()).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestHitTestSource(options: XRHitTestOptionsInit) async throws -> XRHitTestSource { - let _promise: JSPromise = jsObject[Strings.requestHitTestSource]!(options.jsValue()).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) -> JSPromise { - jsObject[Strings.requestHitTestSourceForTransientInput]!(options.jsValue()).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) async throws -> XRTransientInputHitTestSource { - let _promise: JSPromise = jsObject[Strings.requestHitTestSourceForTransientInput]!(options.jsValue()).fromJSValue()! - return try await _promise.get().fromJSValue()! - } } diff --git a/Sources/DOMKit/WebIDL/XRSessionInit.swift b/Sources/DOMKit/WebIDL/XRSessionInit.swift index 69472c24..e5f176ae 100644 --- a/Sources/DOMKit/WebIDL/XRSessionInit.swift +++ b/Sources/DOMKit/WebIDL/XRSessionInit.swift @@ -4,20 +4,20 @@ import JavaScriptEventLoop import JavaScriptKit public class XRSessionInit: BridgedDictionary { - public convenience init(requiredFeatures: [JSValue], optionalFeatures: [JSValue], domOverlay: XRDOMOverlayInit?, depthSensing: XRDepthStateInit) { + public convenience init(requiredFeatures: [JSValue], optionalFeatures: [JSValue], depthSensing: XRDepthStateInit, domOverlay: XRDOMOverlayInit?) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.requiredFeatures] = requiredFeatures.jsValue() object[Strings.optionalFeatures] = optionalFeatures.jsValue() - object[Strings.domOverlay] = domOverlay.jsValue() object[Strings.depthSensing] = depthSensing.jsValue() + object[Strings.domOverlay] = domOverlay.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { _requiredFeatures = ReadWriteAttribute(jsObject: object, name: Strings.requiredFeatures) _optionalFeatures = ReadWriteAttribute(jsObject: object, name: Strings.optionalFeatures) - _domOverlay = ReadWriteAttribute(jsObject: object, name: Strings.domOverlay) _depthSensing = ReadWriteAttribute(jsObject: object, name: Strings.depthSensing) + _domOverlay = ReadWriteAttribute(jsObject: object, name: Strings.domOverlay) super.init(unsafelyWrapping: object) } @@ -28,8 +28,8 @@ public class XRSessionInit: BridgedDictionary { public var optionalFeatures: [JSValue] @ReadWriteAttribute - public var domOverlay: XRDOMOverlayInit? + public var depthSensing: XRDepthStateInit @ReadWriteAttribute - public var depthSensing: XRDepthStateInit + public var domOverlay: XRDOMOverlayInit? } diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index bb19ada6..e4645dc2 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -5,82 +5,82 @@ import JavaScriptKit public enum console { public static var jsObject: JSObject { - JSObject.global.[Strings.console].object! + JSObject.global[Strings.console].object! } public static func assert(condition: Bool? = nil, data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) } public static func clear() { - _ = JSObject.global.[Strings.console].object![Strings.clear]!() + _ = JSObject.global[Strings.console].object![Strings.clear]!() } public static func debug(data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.debug]!(data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.debug]!(data.jsValue()) } public static func error(data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.error]!(data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.error]!(data.jsValue()) } public static func info(data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.info]!(data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.info]!(data.jsValue()) } public static func log(data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.log]!(data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.log]!(data.jsValue()) } public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { - _ = JSObject.global.[Strings.console].object![Strings.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) + _ = JSObject.global[Strings.console].object![Strings.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) } public static func trace(data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.trace]!(data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.trace]!(data.jsValue()) } public static func warn(data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.warn]!(data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.warn]!(data.jsValue()) } public static func dir(item: JSValue? = nil, options: JSObject? = nil) { - _ = JSObject.global.[Strings.console].object![Strings.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) + _ = JSObject.global[Strings.console].object![Strings.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) } public static func dirxml(data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.dirxml]!(data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.dirxml]!(data.jsValue()) } public static func count(label: String? = nil) { - _ = JSObject.global.[Strings.console].object![Strings.count]!(label?.jsValue() ?? .undefined) + _ = JSObject.global[Strings.console].object![Strings.count]!(label?.jsValue() ?? .undefined) } public static func countReset(label: String? = nil) { - _ = JSObject.global.[Strings.console].object![Strings.countReset]!(label?.jsValue() ?? .undefined) + _ = JSObject.global[Strings.console].object![Strings.countReset]!(label?.jsValue() ?? .undefined) } public static func group(data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.group]!(data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.group]!(data.jsValue()) } public static func groupCollapsed(data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.groupCollapsed]!(data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.groupCollapsed]!(data.jsValue()) } public static func groupEnd() { - _ = JSObject.global.[Strings.console].object![Strings.groupEnd]!() + _ = JSObject.global[Strings.console].object![Strings.groupEnd]!() } public static func time(label: String? = nil) { - _ = JSObject.global.[Strings.console].object![Strings.time]!(label?.jsValue() ?? .undefined) + _ = JSObject.global[Strings.console].object![Strings.time]!(label?.jsValue() ?? .undefined) } public static func timeLog(label: String? = nil, data: JSValue...) { - _ = JSObject.global.[Strings.console].object![Strings.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) + _ = JSObject.global[Strings.console].object![Strings.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) } public static func timeEnd(label: String? = nil) { - _ = JSObject.global.[Strings.console].object![Strings.timeEnd]!(label?.jsValue() ?? .undefined) + _ = JSObject.global[Strings.console].object![Strings.timeEnd]!(label?.jsValue() ?? .undefined) } } From fc48330717bffa81e327165dbb7139dd4ad6ea8f Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 10:39:56 -0400 Subject: [PATCH 094/124] Pick a fixed order of loading in the specs --- Sources/DOMKit/WebIDL/Animation.swift | 16 +- Sources/DOMKit/WebIDL/AnimationEffect.swift | 24 +- Sources/DOMKit/WebIDL/AnimationTimeline.swift | 14 +- Sources/DOMKit/WebIDL/AudioTrack.swift | 8 +- Sources/DOMKit/WebIDL/CSS.swift | 38 +-- Sources/DOMKit/WebIDL/CSSRule.swift | 12 +- Sources/DOMKit/WebIDL/CSSStyleRule.swift | 20 +- .../DOMKit/WebIDL/ComputedEffectTiming.swift | 22 +- Sources/DOMKit/WebIDL/DataTransferItem.swift | 20 +- .../WebIDL/DedicatedWorkerGlobalScope.swift | 8 +- Sources/DOMKit/WebIDL/Document.swift | 170 ++++++------- .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 18 +- Sources/DOMKit/WebIDL/EffectTiming.swift | 22 +- Sources/DOMKit/WebIDL/Element.swift | 216 ++++++++--------- Sources/DOMKit/WebIDL/Gamepad.swift | 30 +-- .../DOMKit/WebIDL/GlobalEventHandlers.swift | 94 ++++---- Sources/DOMKit/WebIDL/HTMLAnchorElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 24 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 12 +- Sources/DOMKit/WebIDL/InputEvent.swift | 16 +- Sources/DOMKit/WebIDL/InputEventInit.swift | 20 +- Sources/DOMKit/WebIDL/KeyframeEffect.swift | 8 +- .../DOMKit/WebIDL/KeyframeEffectOptions.swift | 12 +- Sources/DOMKit/WebIDL/MathMLElement.swift | 2 +- .../WebIDL/MediaStreamConstraints.swift | 10 +- .../WebIDL/MediaTrackCapabilities.swift | 124 +++++----- .../WebIDL/MediaTrackConstraintSet.swift | 126 +++++----- .../DOMKit/WebIDL/MediaTrackSettings.swift | 126 +++++----- .../MediaTrackSupportedConstraints.swift | 126 +++++----- Sources/DOMKit/WebIDL/MouseEvent.swift | 16 +- Sources/DOMKit/WebIDL/Navigator.swift | 206 ++++++++-------- .../DOMKit/WebIDL/OptionalEffectTiming.swift | 12 +- Sources/DOMKit/WebIDL/Performance.swift | 64 ++--- .../WebIDL/PerformanceResourceTiming.swift | 8 +- Sources/DOMKit/WebIDL/Permissions.swift | 16 +- Sources/DOMKit/WebIDL/RTCConfiguration.swift | 12 +- Sources/DOMKit/WebIDL/RTCDataChannel.swift | 8 +- .../DOMKit/WebIDL/RTCDataChannelInit.swift | 12 +- Sources/DOMKit/WebIDL/RTCError.swift | 8 +- Sources/DOMKit/WebIDL/RTCErrorInit.swift | 12 +- Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 52 ++-- .../DOMKit/WebIDL/RTCRtpCodecCapability.swift | 12 +- .../WebIDL/RTCRtpEncodingParameters.swift | 26 +- Sources/DOMKit/WebIDL/Range.swift | 24 +- Sources/DOMKit/WebIDL/SVGSVGElement.swift | 40 ++-- .../WebIDL/ServiceWorkerGlobalScope.swift | 50 ++-- .../WebIDL/ServiceWorkerRegistration.swift | 36 +-- Sources/DOMKit/WebIDL/ShadowRoot.swift | 2 +- Sources/DOMKit/WebIDL/StorageManager.swift | 20 +- Sources/DOMKit/WebIDL/Strings.swift | 1 - Sources/DOMKit/WebIDL/Text.swift | 2 +- Sources/DOMKit/WebIDL/TextTrack.swift | 8 +- Sources/DOMKit/WebIDL/Typedefs.swift | 226 +++++++++--------- Sources/DOMKit/WebIDL/URL.swift | 16 +- Sources/DOMKit/WebIDL/VideoTrack.swift | 8 +- Sources/DOMKit/WebIDL/WebAssembly.swift | 40 ++-- Sources/DOMKit/WebIDL/Window.swift | 146 ++++++----- .../WebIDL/WindowOrWorkerGlobalScope.swift | 16 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 2 +- Sources/DOMKit/WebIDL/WorkerNavigator.swift | 10 +- Sources/DOMKit/WebIDL/XRFrame.swift | 54 ++--- Sources/DOMKit/WebIDL/XRHitTestResult.swift | 8 +- Sources/DOMKit/WebIDL/XRInputSource.swift | 16 +- Sources/DOMKit/WebIDL/XRRenderState.swift | 8 +- Sources/DOMKit/WebIDL/XRSession.swift | 68 +++--- Sources/DOMKit/WebIDL/XRSessionInit.swift | 18 +- Sources/DOMKit/WebIDL/XRView.swift | 8 +- Sources/DOMKit/WebIDL/XRWebGLBinding.swift | 16 +- Sources/WebIDLToSwift/IDLBuilder.swift | 4 +- Sources/WebIDLToSwift/IDLParser.swift | 4 +- parse-idl/parse-all.js | 2 +- 75 files changed, 1343 insertions(+), 1346 deletions(-) diff --git a/Sources/DOMKit/WebIDL/Animation.swift b/Sources/DOMKit/WebIDL/Animation.swift index 447bc269..de6e4e1c 100644 --- a/Sources/DOMKit/WebIDL/Animation.swift +++ b/Sources/DOMKit/WebIDL/Animation.swift @@ -7,6 +7,8 @@ public class Animation: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.Animation].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _startTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.startTime) + _currentTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentTime) _id = ReadWriteAttribute(jsObject: jsObject, name: Strings.id) _effect = ReadWriteAttribute(jsObject: jsObject, name: Strings.effect) _timeline = ReadWriteAttribute(jsObject: jsObject, name: Strings.timeline) @@ -19,11 +21,15 @@ public class Animation: EventTarget { _onfinish = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfinish) _oncancel = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncancel) _onremove = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremove) - _startTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.startTime) - _currentTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentTime) super.init(unsafelyWrapping: jsObject) } + @ReadWriteAttribute + public var startTime: CSSNumberish? + + @ReadWriteAttribute + public var currentTime: CSSNumberish? + public convenience init(effect: AnimationEffect? = nil, timeline: AnimationTimeline? = nil) { self.init(unsafelyWrapping: Self.constructor.new(effect?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined)) } @@ -95,10 +101,4 @@ public class Animation: EventTarget { public func commitStyles() { _ = jsObject[Strings.commitStyles]!() } - - @ReadWriteAttribute - public var startTime: CSSNumberish? - - @ReadWriteAttribute - public var currentTime: CSSNumberish? } diff --git a/Sources/DOMKit/WebIDL/AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect.swift index 0d53aac5..643370c2 100644 --- a/Sources/DOMKit/WebIDL/AnimationEffect.swift +++ b/Sources/DOMKit/WebIDL/AnimationEffect.swift @@ -15,18 +15,6 @@ public class AnimationEffect: JSBridgedClass { self.jsObject = jsObject } - public func getTiming() -> EffectTiming { - jsObject[Strings.getTiming]!().fromJSValue()! - } - - public func getComputedTiming() -> ComputedEffectTiming { - jsObject[Strings.getComputedTiming]!().fromJSValue()! - } - - public func updateTiming(timing: OptionalEffectTiming? = nil) { - _ = jsObject[Strings.updateTiming]!(timing?.jsValue() ?? .undefined) - } - @ReadonlyAttribute public var parent: GroupEffect? @@ -51,4 +39,16 @@ public class AnimationEffect: JSBridgedClass { public func remove() { _ = jsObject[Strings.remove]!() } + + public func getTiming() -> EffectTiming { + jsObject[Strings.getTiming]!().fromJSValue()! + } + + public func getComputedTiming() -> ComputedEffectTiming { + jsObject[Strings.getComputedTiming]!().fromJSValue()! + } + + public func updateTiming(timing: OptionalEffectTiming? = nil) { + _ = jsObject[Strings.updateTiming]!(timing?.jsValue() ?? .undefined) + } } diff --git a/Sources/DOMKit/WebIDL/AnimationTimeline.swift b/Sources/DOMKit/WebIDL/AnimationTimeline.swift index c249f34c..34c8bc8d 100644 --- a/Sources/DOMKit/WebIDL/AnimationTimeline.swift +++ b/Sources/DOMKit/WebIDL/AnimationTimeline.swift @@ -9,22 +9,22 @@ public class AnimationTimeline: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) _phase = ReadonlyAttribute(jsObject: jsObject, name: Strings.phase) - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) self.jsObject = jsObject } - @ReadonlyAttribute - public var currentTime: Double? - - @ReadonlyAttribute - public var phase: TimelinePhase - @ReadonlyAttribute public var duration: CSSNumberish? public func play(effect: AnimationEffect? = nil) -> Animation { jsObject[Strings.play]!(effect?.jsValue() ?? .undefined).fromJSValue()! } + + @ReadonlyAttribute + public var currentTime: Double? + + @ReadonlyAttribute + public var phase: TimelinePhase } diff --git a/Sources/DOMKit/WebIDL/AudioTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack.swift index 87dab07f..d08e9ad6 100644 --- a/Sources/DOMKit/WebIDL/AudioTrack.swift +++ b/Sources/DOMKit/WebIDL/AudioTrack.swift @@ -9,18 +9,15 @@ public class AudioTrack: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) _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) + _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) self.jsObject = jsObject } - @ReadonlyAttribute - public var sourceBuffer: SourceBuffer? - @ReadonlyAttribute public var id: String @@ -35,4 +32,7 @@ public class AudioTrack: JSBridgedClass { @ReadWriteAttribute public var enabled: Bool + + @ReadonlyAttribute + public var sourceBuffer: SourceBuffer? } diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index 031103f7..6a6d038a 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -8,10 +8,24 @@ public enum CSS { JSObject.global[Strings.CSS].object! } - public static var paintWorklet: Worklet { ReadonlyAttribute[Strings.paintWorklet, in: jsObject] } + public static var animationWorklet: Worklet { ReadonlyAttribute[Strings.animationWorklet, in: jsObject] } + + public static func supports(property: String, value: String) -> Bool { + JSObject.global[Strings.CSS].object![Strings.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! + } + + public static func supports(conditionText: String) -> Bool { + JSObject.global[Strings.CSS].object![Strings.supports]!(conditionText.jsValue()).fromJSValue()! + } + + public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } + + public static var elementSources: JSValue { ReadonlyAttribute[Strings.elementSources, in: jsObject] } public static var layoutWorklet: Worklet { ReadonlyAttribute[Strings.layoutWorklet, in: jsObject] } + public static var paintWorklet: Worklet { ReadonlyAttribute[Strings.paintWorklet, in: jsObject] } + public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { JSObject.global[Strings.CSS].object![Strings.parseStylesheet]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @@ -68,6 +82,10 @@ public enum CSS { JSObject.global[Strings.CSS].object![Strings.parseCommaValueList]!(css.jsValue()).fromJSValue()! } + public static func registerProperty(definition: PropertyDefinition) { + _ = JSObject.global[Strings.CSS].object![Strings.registerProperty]!(definition.jsValue()) + } + public static func number(value: Double) -> CSSUnitValue { JSObject.global[Strings.CSS].object![Strings.number]!(value.jsValue()).fromJSValue()! } @@ -300,24 +318,6 @@ public enum CSS { JSObject.global[Strings.CSS].object![Strings.fr]!(value.jsValue()).fromJSValue()! } - public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } - - public static var animationWorklet: Worklet { ReadonlyAttribute[Strings.animationWorklet, in: jsObject] } - - public static func supports(property: String, value: String) -> Bool { - JSObject.global[Strings.CSS].object![Strings.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! - } - - public static func supports(conditionText: String) -> Bool { - JSObject.global[Strings.CSS].object![Strings.supports]!(conditionText.jsValue()).fromJSValue()! - } - - public static var elementSources: JSValue { ReadonlyAttribute[Strings.elementSources, in: jsObject] } - - public static func registerProperty(definition: PropertyDefinition) { - _ = JSObject.global[Strings.CSS].object![Strings.registerProperty]!(definition.jsValue()) - } - public static func escape(ident: String) -> String { JSObject.global[Strings.CSS].object![Strings.escape]!(ident.jsValue()).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift index f9f6b33a..9e9dfe6f 100644 --- a/Sources/DOMKit/WebIDL/CSSRule.swift +++ b/Sources/DOMKit/WebIDL/CSSRule.swift @@ -16,15 +16,17 @@ public class CSSRule: JSBridgedClass { self.jsObject = jsObject } - public static let FONT_FEATURE_VALUES_RULE: UInt16 = 14 + public static let KEYFRAMES_RULE: UInt16 = 7 - public static let VIEWPORT_RULE: UInt16 = 15 + public static let KEYFRAME_RULE: UInt16 = 8 public static let SUPPORTS_RULE: UInt16 = 12 - public static let KEYFRAMES_RULE: UInt16 = 7 + public static let COUNTER_STYLE_RULE: UInt16 = 11 - public static let KEYFRAME_RULE: UInt16 = 8 + public static let VIEWPORT_RULE: UInt16 = 15 + + public static let FONT_FEATURE_VALUES_RULE: UInt16 = 14 @ReadWriteAttribute public var cssText: String @@ -53,6 +55,4 @@ public class CSSRule: JSBridgedClass { public static let MARGIN_RULE: UInt16 = 9 public static let NAMESPACE_RULE: UInt16 = 10 - - public static let COUNTER_STYLE_RULE: UInt16 = 11 } diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift index 8c1b4dc1..2655ea97 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -7,22 +7,13 @@ public class CSSStyleRule: CSSRule { override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) _styleMap = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleMap) _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var styleMap: StylePropertyMap - - @ReadWriteAttribute - public var selectorText: String - - @ReadonlyAttribute - public var style: CSSStyleDeclaration - @ReadonlyAttribute public var cssRules: CSSRuleList @@ -33,4 +24,13 @@ public class CSSStyleRule: CSSRule { public func deleteRule(index: UInt32) { _ = jsObject[Strings.deleteRule]!(index.jsValue()) } + + @ReadonlyAttribute + public var styleMap: StylePropertyMap + + @ReadWriteAttribute + public var selectorText: String + + @ReadonlyAttribute + public var style: CSSStyleDeclaration } diff --git a/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift index 36bf95fb..e91a4365 100644 --- a/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift +++ b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift @@ -4,33 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class ComputedEffectTiming: BridgedDictionary { - public convenience init(progress: Double?, currentIteration: Double?, startTime: CSSNumberish, endTime: CSSNumberish, activeDuration: CSSNumberish, localTime: CSSNumberish?) { + public convenience init(startTime: CSSNumberish, endTime: CSSNumberish, activeDuration: CSSNumberish, localTime: CSSNumberish?, progress: Double?, currentIteration: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.progress] = progress.jsValue() - object[Strings.currentIteration] = currentIteration.jsValue() object[Strings.startTime] = startTime.jsValue() object[Strings.endTime] = endTime.jsValue() object[Strings.activeDuration] = activeDuration.jsValue() object[Strings.localTime] = localTime.jsValue() + 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) _startTime = ReadWriteAttribute(jsObject: object, name: Strings.startTime) _endTime = ReadWriteAttribute(jsObject: object, name: Strings.endTime) _activeDuration = ReadWriteAttribute(jsObject: object, name: Strings.activeDuration) _localTime = ReadWriteAttribute(jsObject: object, name: Strings.localTime) + _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? - @ReadWriteAttribute public var startTime: CSSNumberish @@ -42,4 +36,10 @@ public class ComputedEffectTiming: BridgedDictionary { @ReadWriteAttribute public var localTime: CSSNumberish? + + @ReadWriteAttribute + public var progress: Double? + + @ReadWriteAttribute + public var currentIteration: Double? } diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index c2277fe6..506a87a2 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -18,6 +18,16 @@ public class DataTransferItem: JSBridgedClass { jsObject[Strings.webkitGetAsEntry]!().fromJSValue()! } + public func getAsFileSystemHandle() -> JSPromise { + jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getAsFileSystemHandle() async throws -> FileSystemHandle? { + let _promise: JSPromise = jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + @ReadonlyAttribute public var kind: String @@ -29,14 +39,4 @@ public class DataTransferItem: JSBridgedClass { public func getAsFile() -> File? { jsObject[Strings.getAsFile]!().fromJSValue()! } - - public func getAsFileSystemHandle() -> JSPromise { - jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getAsFileSystemHandle() async throws -> FileSystemHandle? { - let _promise: JSPromise = jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! - return try await _promise.get().fromJSValue()! - } } diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index 38336a95..aed3881d 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -7,16 +7,13 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid override public class var constructor: JSFunction { JSObject.global[Strings.DedicatedWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onrtctransform = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrtctransform) _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _onrtctransform = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrtctransform) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 - public var onrtctransform: EventHandler - @ReadonlyAttribute public var name: String @@ -37,4 +34,7 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid @ClosureAttribute.Optional1 public var onmessageerror: EventHandler + + @ClosureAttribute.Optional1 + public var onrtctransform: EventHandler } diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 732ec5a3..bdc05647 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -3,17 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GeometryUtils, GlobalEventHandlers, DocumentAndElementEventHandlers, FontFaceSource { +public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { override public class var constructor: JSFunction { JSObject.global[Strings.Document].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _fragmentDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.fragmentDirective) - _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) + _rootElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootElement) _namedFlows = ReadonlyAttribute(jsObject: jsObject, name: Strings.namedFlows) - _fullscreenEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreenEnabled) - _fullscreen = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreen) - _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) - _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) + _scrollingElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollingElement) _implementation = ReadonlyAttribute(jsObject: jsObject, name: Strings.implementation) _URL = ReadonlyAttribute(jsObject: jsObject, name: Strings.URL) _documentURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURI) @@ -24,11 +20,10 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN _contentType = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentType) _doctype = ReadonlyAttribute(jsObject: jsObject, name: Strings.doctype) _documentElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentElement) - _onpointerlockchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockchange) - _onpointerlockerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockerror) - _scrollingElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollingElement) - _timeline = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeline) - _rootElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootElement) + _fullscreenEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreenEnabled) + _fullscreen = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreen) + _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) + _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) _domain = ReadWriteAttribute(jsObject: jsObject, name: Strings.domain) _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) @@ -60,56 +55,39 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN _anchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchors) _applets = ReadonlyAttribute(jsObject: jsObject, name: Strings.applets) _all = ReadonlyAttribute(jsObject: jsObject, name: Strings.all) - _pictureInPictureEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.pictureInPictureEnabled) _onfreeze = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfreeze) _onresume = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresume) _wasDiscarded = ReadonlyAttribute(jsObject: jsObject, name: Strings.wasDiscarded) + _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) + _pictureInPictureEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.pictureInPictureEnabled) + _onpointerlockchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockchange) + _onpointerlockerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockerror) + _fragmentDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.fragmentDirective) + _timeline = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeline) super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute - public var fragmentDirective: FragmentDirective - - @ReadonlyAttribute - public var permissionsPolicy: PermissionsPolicy - - public func measureElement(element: Element) -> FontMetrics { - jsObject[Strings.measureElement]!(element.jsValue()).fromJSValue()! - } - - public func measureText(text: String, styleMap: StylePropertyMapReadOnly) -> FontMetrics { - jsObject[Strings.measureText]!(text.jsValue(), styleMap.jsValue()).fromJSValue()! - } + public var rootElement: SVGSVGElement? @ReadonlyAttribute public var namedFlows: NamedFlowMap - @ReadonlyAttribute - public var fullscreenEnabled: Bool - - @ReadonlyAttribute - public var fullscreen: Bool - - public func exitFullscreen() -> JSPromise { - jsObject[Strings.exitFullscreen]!().fromJSValue()! + public func elementFromPoint(x: Double, y: Double) -> Element? { + jsObject[Strings.elementFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func exitFullscreen() async throws { - let _promise: JSPromise = jsObject[Strings.exitFullscreen]!().fromJSValue()! - _ = try await _promise.get() + public func elementsFromPoint(x: Double, y: Double) -> [Element] { + jsObject[Strings.elementsFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! } - @ClosureAttribute.Optional1 - public var onfullscreenchange: EventHandler - - @ClosureAttribute.Optional1 - public var onfullscreenerror: EventHandler - - public func getSelection() -> Selection? { - jsObject[Strings.getSelection]!().fromJSValue()! + public func caretPositionFromPoint(x: Double, y: Double) -> CaretPosition? { + jsObject[Strings.caretPositionFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! } + @ReadonlyAttribute + public var scrollingElement: Element? + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -212,36 +190,35 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN // XXX: member 'createTreeWalker' is ignored - @ClosureAttribute.Optional1 - public var onpointerlockchange: EventHandler - - @ClosureAttribute.Optional1 - public var onpointerlockerror: EventHandler - - public func exitPointerLock() { - _ = jsObject[Strings.exitPointerLock]!() + public func measureElement(element: Element) -> FontMetrics { + jsObject[Strings.measureElement]!(element.jsValue()).fromJSValue()! } - public func elementFromPoint(x: Double, y: Double) -> Element? { - jsObject[Strings.elementFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! + public func measureText(text: String, styleMap: StylePropertyMapReadOnly) -> FontMetrics { + jsObject[Strings.measureText]!(text.jsValue(), styleMap.jsValue()).fromJSValue()! } - public func elementsFromPoint(x: Double, y: Double) -> [Element] { - jsObject[Strings.elementsFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! - } + @ReadonlyAttribute + public var fullscreenEnabled: Bool - public func caretPositionFromPoint(x: Double, y: Double) -> CaretPosition? { - jsObject[Strings.caretPositionFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! + @ReadonlyAttribute + public var fullscreen: Bool + + public func exitFullscreen() -> JSPromise { + jsObject[Strings.exitFullscreen]!().fromJSValue()! } - @ReadonlyAttribute - public var scrollingElement: Element? + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func exitFullscreen() async throws { + let _promise: JSPromise = jsObject[Strings.exitFullscreen]!().fromJSValue()! + _ = try await _promise.get() + } - @ReadonlyAttribute - public var timeline: DocumentTimeline + @ClosureAttribute.Optional1 + public var onfullscreenchange: EventHandler - @ReadonlyAttribute - public var rootElement: SVGSVGElement? + @ClosureAttribute.Optional1 + public var onfullscreenerror: EventHandler @ReadonlyAttribute public var location: Location? @@ -404,25 +381,17 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN @ReadonlyAttribute public var all: HTMLAllCollection - public func hasStorageAccess() -> JSPromise { - jsObject[Strings.hasStorageAccess]!().fromJSValue()! - } + @ClosureAttribute.Optional1 + public var onfreeze: EventHandler - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func hasStorageAccess() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.hasStorageAccess]!().fromJSValue()! - return try await _promise.get().fromJSValue()! - } + @ClosureAttribute.Optional1 + public var onresume: EventHandler - public func requestStorageAccess() -> JSPromise { - jsObject[Strings.requestStorageAccess]!().fromJSValue()! - } + @ReadonlyAttribute + public var wasDiscarded: Bool - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestStorageAccess() async throws { - let _promise: JSPromise = jsObject[Strings.requestStorageAccess]!().fromJSValue()! - _ = try await _promise.get() - } + @ReadonlyAttribute + public var permissionsPolicy: PermissionsPolicy @ReadonlyAttribute public var pictureInPictureEnabled: Bool @@ -438,11 +407,42 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN } @ClosureAttribute.Optional1 - public var onfreeze: EventHandler + public var onpointerlockchange: EventHandler @ClosureAttribute.Optional1 - public var onresume: EventHandler + public var onpointerlockerror: EventHandler + + public func exitPointerLock() { + _ = jsObject[Strings.exitPointerLock]!() + } @ReadonlyAttribute - public var wasDiscarded: Bool + public var fragmentDirective: FragmentDirective + + public func getSelection() -> Selection? { + jsObject[Strings.getSelection]!().fromJSValue()! + } + + public func hasStorageAccess() -> JSPromise { + jsObject[Strings.hasStorageAccess]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func hasStorageAccess() async throws -> Bool { + let _promise: JSPromise = jsObject[Strings.hasStorageAccess]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func requestStorageAccess() -> JSPromise { + jsObject[Strings.requestStorageAccess]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestStorageAccess() async throws { + let _promise: JSPromise = jsObject[Strings.requestStorageAccess]!().fromJSValue()! + _ = try await _promise.get() + } + + @ReadonlyAttribute + public var timeline: DocumentTimeline } diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index 822430f7..1b94a74b 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol DocumentOrShadowRoot: JSBridgedClass {} public extension DocumentOrShadowRoot { - var fullscreenElement: Element? { ReadonlyAttribute[Strings.fullscreenElement, in: jsObject] } - - var pointerLockElement: Element? { ReadonlyAttribute[Strings.pointerLockElement, in: jsObject] } + var styleSheets: StyleSheetList { ReadonlyAttribute[Strings.styleSheets, in: jsObject] } - func getAnimations() -> [Animation] { - jsObject[Strings.getAnimations]!().fromJSValue()! + var adoptedStyleSheets: [CSSStyleSheet] { + get { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] } + set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } } + var fullscreenElement: Element? { ReadonlyAttribute[Strings.fullscreenElement, in: jsObject] } + var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } var pictureInPictureElement: Element? { ReadonlyAttribute[Strings.pictureInPictureElement, in: jsObject] } - var styleSheets: StyleSheetList { ReadonlyAttribute[Strings.styleSheets, in: jsObject] } + var pointerLockElement: Element? { ReadonlyAttribute[Strings.pointerLockElement, in: jsObject] } - var adoptedStyleSheets: [CSSStyleSheet] { - get { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] } - set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } + func getAnimations() -> [Animation] { + jsObject[Strings.getAnimations]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/EffectTiming.swift b/Sources/DOMKit/WebIDL/EffectTiming.swift index 21e37c53..e418897f 100644 --- a/Sources/DOMKit/WebIDL/EffectTiming.swift +++ b/Sources/DOMKit/WebIDL/EffectTiming.swift @@ -4,8 +4,10 @@ import JavaScriptEventLoop import JavaScriptKit public class EffectTiming: BridgedDictionary { - public convenience init(delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String, playbackRate: Double, duration: __UNSUPPORTED_UNION__) { + public convenience init(playbackRate: Double, duration: __UNSUPPORTED_UNION__, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.playbackRate] = playbackRate.jsValue() + object[Strings.duration] = duration.jsValue() object[Strings.delay] = delay.jsValue() object[Strings.endDelay] = endDelay.jsValue() object[Strings.fill] = fill.jsValue() @@ -13,12 +15,12 @@ public class EffectTiming: BridgedDictionary { object[Strings.iterations] = iterations.jsValue() object[Strings.direction] = direction.jsValue() object[Strings.easing] = easing.jsValue() - object[Strings.playbackRate] = playbackRate.jsValue() - object[Strings.duration] = duration.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) _endDelay = ReadWriteAttribute(jsObject: object, name: Strings.endDelay) _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) @@ -26,11 +28,15 @@ public class EffectTiming: BridgedDictionary { _iterations = ReadWriteAttribute(jsObject: object, name: Strings.iterations) _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) - _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) - _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) super.init(unsafelyWrapping: object) } + @ReadWriteAttribute + public var playbackRate: Double + + @ReadWriteAttribute + public var duration: __UNSUPPORTED_UNION__ + @ReadWriteAttribute public var delay: Double @@ -51,10 +57,4 @@ public class EffectTiming: BridgedDictionary { @ReadWriteAttribute public var easing: String - - @ReadWriteAttribute - public var playbackRate: Double - - @ReadWriteAttribute - public var duration: __UNSUPPORTED_UNION__ } diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index ea746b15..4ff0582c 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -3,14 +3,20 @@ import JavaScriptEventLoop import JavaScriptKit -public class Element: Node, Region, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, GeometryUtils, ARIAMixin, Animatable, InnerHTML { +public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin, Animatable { override public class var constructor: JSFunction { JSObject.global[Strings.Element].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _elementTiming = ReadWriteAttribute(jsObject: jsObject, name: Strings.elementTiming) - _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) - _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) + _outerHTML = ReadWriteAttribute(jsObject: jsObject, name: Strings.outerHTML) _part = ReadonlyAttribute(jsObject: jsObject, name: Strings.part) + _scrollTop = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollTop) + _scrollLeft = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollLeft) + _scrollWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollWidth) + _scrollHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollHeight) + _clientTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientTop) + _clientLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientLeft) + _clientWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientWidth) + _clientHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientHeight) _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) _prefix = ReadonlyAttribute(jsObject: jsObject, name: Strings.prefix) _localName = ReadonlyAttribute(jsObject: jsObject, name: Strings.localName) @@ -21,48 +27,106 @@ public class Element: Node, Region, ParentNode, NonDocumentTypeChildNode, ChildN _slot = ReadWriteAttribute(jsObject: jsObject, name: Strings.slot) _attributes = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributes) _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) - _scrollTop = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollTop) - _scrollLeft = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollLeft) - _scrollWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollWidth) - _scrollHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollHeight) - _clientTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientTop) - _clientLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientLeft) - _clientWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientWidth) - _clientHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientHeight) - _outerHTML = ReadWriteAttribute(jsObject: jsObject, name: Strings.outerHTML) _editContext = ReadWriteAttribute(jsObject: jsObject, name: Strings.editContext) + _elementTiming = ReadWriteAttribute(jsObject: jsObject, name: Strings.elementTiming) + _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) + _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) super.init(unsafelyWrapping: jsObject) } + @ReadWriteAttribute + public var outerHTML: String + + public func insertAdjacentHTML(position: String, text: String) { + _ = jsObject[Strings.insertAdjacentHTML]!(position.jsValue(), text.jsValue()) + } + + public func getSpatialNavigationContainer() -> Node { + jsObject[Strings.getSpatialNavigationContainer]!().fromJSValue()! + } + + public func focusableAreas(option: FocusableAreasOption? = nil) -> [Node] { + jsObject[Strings.focusableAreas]!(option?.jsValue() ?? .undefined).fromJSValue()! + } + + public func spatialNavigationSearch(dir: SpatialNavigationDirection, options: SpatialNavigationSearchOptions? = nil) -> Node? { + jsObject[Strings.spatialNavigationSearch]!(dir.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + } + public func pseudo(type: String) -> CSSPseudoElement? { jsObject[Strings.pseudo]!(type.jsValue()).fromJSValue()! } + @ReadonlyAttribute + public var part: DOMTokenList + public func computedStyleMap() -> StylePropertyMapReadOnly { jsObject[Strings.computedStyleMap]!().fromJSValue()! } - @ReadWriteAttribute - public var elementTiming: String + public func getClientRects() -> DOMRectList { + jsObject[Strings.getClientRects]!().fromJSValue()! + } - public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { - jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! + public func getBoundingClientRect() -> DOMRect { + jsObject[Strings.getBoundingClientRect]!().fromJSValue()! } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestFullscreen(options: FullscreenOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() + public func isVisible(options: IsVisibleOptions? = nil) -> Bool { + jsObject[Strings.isVisible]!(options?.jsValue() ?? .undefined).fromJSValue()! } - @ClosureAttribute.Optional1 - public var onfullscreenchange: EventHandler + public func scrollIntoView(arg: __UNSUPPORTED_UNION__? = nil) { + _ = jsObject[Strings.scrollIntoView]!(arg?.jsValue() ?? .undefined) + } - @ClosureAttribute.Optional1 - public var onfullscreenerror: EventHandler + public func scroll(options: ScrollToOptions? = nil) { + _ = jsObject[Strings.scroll]!(options?.jsValue() ?? .undefined) + } + + public func scroll(x: Double, y: Double) { + _ = jsObject[Strings.scroll]!(x.jsValue(), y.jsValue()) + } + + public func scrollTo(options: ScrollToOptions? = nil) { + _ = jsObject[Strings.scrollTo]!(options?.jsValue() ?? .undefined) + } + + public func scrollTo(x: Double, y: Double) { + _ = jsObject[Strings.scrollTo]!(x.jsValue(), y.jsValue()) + } + + public func scrollBy(options: ScrollToOptions? = nil) { + _ = jsObject[Strings.scrollBy]!(options?.jsValue() ?? .undefined) + } + + public func scrollBy(x: Double, y: Double) { + _ = jsObject[Strings.scrollBy]!(x.jsValue(), y.jsValue()) + } + + @ReadWriteAttribute + public var scrollTop: Double + + @ReadWriteAttribute + public var scrollLeft: Double @ReadonlyAttribute - public var part: DOMTokenList + public var scrollWidth: Int32 + + @ReadonlyAttribute + public var scrollHeight: Int32 + + @ReadonlyAttribute + public var clientTop: Int32 + + @ReadonlyAttribute + public var clientLeft: Int32 + + @ReadonlyAttribute + public var clientWidth: Int32 + + @ReadonlyAttribute + public var clientHeight: Int32 @ReadonlyAttribute public var namespaceURI: String? @@ -194,87 +258,27 @@ public class Element: Node, Region, ParentNode, NonDocumentTypeChildNode, ChildN _ = jsObject[Strings.insertAdjacentText]!(`where`.jsValue(), data.jsValue()) } - public func setHTML(input: String, options: SetHTMLOptions? = nil) { - _ = jsObject[Strings.setHTML]!(input.jsValue(), options?.jsValue() ?? .undefined) - } - - public func requestPointerLock() { - _ = jsObject[Strings.requestPointerLock]!() - } - - public func getClientRects() -> DOMRectList { - jsObject[Strings.getClientRects]!().fromJSValue()! - } - - public func getBoundingClientRect() -> DOMRect { - jsObject[Strings.getBoundingClientRect]!().fromJSValue()! - } - - public func isVisible(options: IsVisibleOptions? = nil) -> Bool { - jsObject[Strings.isVisible]!(options?.jsValue() ?? .undefined).fromJSValue()! - } - - public func scrollIntoView(arg: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Strings.scrollIntoView]!(arg?.jsValue() ?? .undefined) - } - - public func scroll(options: ScrollToOptions? = nil) { - _ = jsObject[Strings.scroll]!(options?.jsValue() ?? .undefined) - } - - public func scroll(x: Double, y: Double) { - _ = jsObject[Strings.scroll]!(x.jsValue(), y.jsValue()) - } - - public func scrollTo(options: ScrollToOptions? = nil) { - _ = jsObject[Strings.scrollTo]!(options?.jsValue() ?? .undefined) - } - - public func scrollTo(x: Double, y: Double) { - _ = jsObject[Strings.scrollTo]!(x.jsValue(), y.jsValue()) - } - - public func scrollBy(options: ScrollToOptions? = nil) { - _ = jsObject[Strings.scrollBy]!(options?.jsValue() ?? .undefined) - } - - public func scrollBy(x: Double, y: Double) { - _ = jsObject[Strings.scrollBy]!(x.jsValue(), y.jsValue()) - } - @ReadWriteAttribute - public var scrollTop: Double + public var editContext: EditContext? @ReadWriteAttribute - public var scrollLeft: Double - - @ReadonlyAttribute - public var scrollWidth: Int32 - - @ReadonlyAttribute - public var scrollHeight: Int32 - - @ReadonlyAttribute - public var clientTop: Int32 - - @ReadonlyAttribute - public var clientLeft: Int32 - - @ReadonlyAttribute - public var clientWidth: Int32 - - @ReadonlyAttribute - public var clientHeight: Int32 + public var elementTiming: String - @ReadWriteAttribute - public var outerHTML: String + public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { + jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! + } - public func insertAdjacentHTML(position: String, text: String) { - _ = jsObject[Strings.insertAdjacentHTML]!(position.jsValue(), text.jsValue()) + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestFullscreen(options: FullscreenOptions? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() } - @ReadWriteAttribute - public var editContext: EditContext? + @ClosureAttribute.Optional1 + public var onfullscreenchange: EventHandler + + @ClosureAttribute.Optional1 + public var onfullscreenerror: EventHandler public func setPointerCapture(pointerId: Int32) { _ = jsObject[Strings.setPointerCapture]!(pointerId.jsValue()) @@ -288,15 +292,11 @@ public class Element: Node, Region, ParentNode, NonDocumentTypeChildNode, ChildN jsObject[Strings.hasPointerCapture]!(pointerId.jsValue()).fromJSValue()! } - public func getSpatialNavigationContainer() -> Node { - jsObject[Strings.getSpatialNavigationContainer]!().fromJSValue()! - } - - public func focusableAreas(option: FocusableAreasOption? = nil) -> [Node] { - jsObject[Strings.focusableAreas]!(option?.jsValue() ?? .undefined).fromJSValue()! + public func requestPointerLock() { + _ = jsObject[Strings.requestPointerLock]!() } - public func spatialNavigationSearch(dir: SpatialNavigationDirection, options: SpatialNavigationSearchOptions? = nil) -> Node? { - jsObject[Strings.spatialNavigationSearch]!(dir.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + public func setHTML(input: String, options: SetHTMLOptions? = nil) { + _ = jsObject[Strings.setHTML]!(input.jsValue(), options?.jsValue() ?? .undefined) } } diff --git a/Sources/DOMKit/WebIDL/Gamepad.swift b/Sources/DOMKit/WebIDL/Gamepad.swift index cdd39ed1..66829d13 100644 --- a/Sources/DOMKit/WebIDL/Gamepad.swift +++ b/Sources/DOMKit/WebIDL/Gamepad.swift @@ -9,6 +9,10 @@ public class Gamepad: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) + _hapticActuators = ReadonlyAttribute(jsObject: jsObject, name: Strings.hapticActuators) + _pose = ReadonlyAttribute(jsObject: jsObject, name: Strings.pose) + _touchEvents = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchEvents) _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) _connected = ReadonlyAttribute(jsObject: jsObject, name: Strings.connected) @@ -16,43 +20,39 @@ public class Gamepad: JSBridgedClass { _mapping = ReadonlyAttribute(jsObject: jsObject, name: Strings.mapping) _axes = ReadonlyAttribute(jsObject: jsObject, name: Strings.axes) _buttons = ReadonlyAttribute(jsObject: jsObject, name: Strings.buttons) - _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) - _hapticActuators = ReadonlyAttribute(jsObject: jsObject, name: Strings.hapticActuators) - _pose = ReadonlyAttribute(jsObject: jsObject, name: Strings.pose) - _touchEvents = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchEvents) self.jsObject = jsObject } @ReadonlyAttribute - public var id: String + public var hand: GamepadHand @ReadonlyAttribute - public var index: Int32 + public var hapticActuators: [GamepadHapticActuator] @ReadonlyAttribute - public var connected: Bool + public var pose: GamepadPose? @ReadonlyAttribute - public var timestamp: DOMHighResTimeStamp + public var touchEvents: [GamepadTouch]? @ReadonlyAttribute - public var mapping: GamepadMappingType + public var id: String @ReadonlyAttribute - public var axes: [Double] + public var index: Int32 @ReadonlyAttribute - public var buttons: [GamepadButton] + public var connected: Bool @ReadonlyAttribute - public var hand: GamepadHand + public var timestamp: DOMHighResTimeStamp @ReadonlyAttribute - public var hapticActuators: [GamepadHapticActuator] + public var mapping: GamepadMappingType @ReadonlyAttribute - public var pose: GamepadPose? + public var axes: [Double] @ReadonlyAttribute - public var touchEvents: [GamepadTouch]? + public var buttons: [GamepadButton] } diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index 2ec6bcc5..d4de471b 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -5,6 +5,26 @@ import JavaScriptKit public protocol GlobalEventHandlers: JSBridgedClass {} public extension GlobalEventHandlers { + var onanimationstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] = newValue } + } + + var onanimationiteration: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] = newValue } + } + + var onanimationend: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] = newValue } + } + + var onanimationcancel: EventHandler { + get { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] = newValue } + } + var ontransitionrun: EventHandler { get { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] } set { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] = newValue } @@ -25,41 +45,6 @@ public extension GlobalEventHandlers { set { ClosureAttribute.Optional1[Strings.ontransitioncancel, in: jsObject] = newValue } } - var onselectstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] = newValue } - } - - var onselectionchange: EventHandler { - get { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] = newValue } - } - - var onbeforexrselect: EventHandler { - get { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] = newValue } - } - - var ontouchstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] = newValue } - } - - var ontouchend: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] = newValue } - } - - var ontouchmove: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] = newValue } - } - - var ontouchcancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] = newValue } - } - var onabort: EventHandler { get { ClosureAttribute.Optional1[Strings.onabort, in: jsObject] } set { ClosureAttribute.Optional1[Strings.onabort, in: jsObject] = newValue } @@ -455,23 +440,38 @@ public extension GlobalEventHandlers { set { ClosureAttribute.Optional1[Strings.onpointerleave, in: jsObject] = newValue } } - var onanimationstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] = newValue } + var onselectstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] = newValue } } - var onanimationiteration: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] = newValue } + var onselectionchange: EventHandler { + get { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] = newValue } } - var onanimationend: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] = newValue } + var ontouchstart: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] = newValue } } - var onanimationcancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] = newValue } + var ontouchend: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] = newValue } + } + + var ontouchmove: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] = newValue } + } + + var ontouchcancel: EventHandler { + get { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] = newValue } + } + + var onbeforexrselect: EventHandler { + get { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] } + set { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift index f93cdcd2..af72551c 100644 --- a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift @@ -7,7 +7,6 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAnchorElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _attributionSourceId = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionSourceId) _attributionDestination = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionDestination) _attributionSourceEventId = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionSourceEventId) _attributionReportTo = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionReportTo) @@ -28,12 +27,10 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) _rev = ReadWriteAttribute(jsObject: jsObject, name: Strings.rev) _shape = ReadWriteAttribute(jsObject: jsObject, name: Strings.shape) + _attributionSourceId = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionSourceId) super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var attributionSourceId: UInt32 - @ReadWriteAttribute public var attributionDestination: String @@ -97,4 +94,7 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { @ReadWriteAttribute public var shape: String + + @ReadWriteAttribute + public var attributionSourceId: UInt32 } diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index 31b345a4..3e3e22e9 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -12,10 +12,6 @@ public class HTMLCanvasElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public func captureStream(frameRequestRate: Double? = nil) -> MediaStream { - jsObject[Strings.captureStream]!(frameRequestRate?.jsValue() ?? .undefined).fromJSValue()! - } - public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -39,4 +35,8 @@ public class HTMLCanvasElement: HTMLElement { public func transferControlToOffscreen() -> OffscreenCanvas { jsObject[Strings.transferControlToOffscreen]!().fromJSValue()! } + + public func captureStream(frameRequestRate: Double? = nil) -> MediaStream { + jsObject[Strings.captureStream]!(frameRequestRate?.jsValue() ?? .undefined).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 137a4f63..2cf95ab6 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement, ElementCSSInlineStyle { +public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement { override public class var constructor: JSFunction { JSObject.global[Strings.HTMLElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index ed4b361f..00aafb65 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -7,7 +7,6 @@ public class HTMLIFrameElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global[Strings.HTMLIFrameElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) _csp = ReadWriteAttribute(jsObject: jsObject, name: Strings.csp) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcdoc = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcdoc) @@ -27,13 +26,11 @@ public class HTMLIFrameElement: HTMLElement { _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Strings.longDesc) _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginHeight) _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginWidth) + _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var permissionsPolicy: PermissionsPolicy - @ReadWriteAttribute public var csp: String @@ -99,6 +96,9 @@ public class HTMLIFrameElement: HTMLElement { @ReadWriteAttribute public var marginWidth: String + @ReadonlyAttribute + public var permissionsPolicy: PermissionsPolicy + @ReadWriteAttribute public var fetchpriority: String } diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index 7feea4cc..8b51bedf 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -7,9 +7,9 @@ public class HTMLInputElement: HTMLElement { override public class var constructor: JSFunction { JSObject.global[Strings.HTMLInputElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _capture = ReadWriteAttribute(jsObject: jsObject, name: Strings.capture) _webkitdirectory = ReadWriteAttribute(jsObject: jsObject, name: Strings.webkitdirectory) _webkitEntries = ReadonlyAttribute(jsObject: jsObject, name: Strings.webkitEntries) + _capture = ReadWriteAttribute(jsObject: jsObject, name: Strings.capture) _accept = ReadWriteAttribute(jsObject: jsObject, name: Strings.accept) _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) @@ -58,15 +58,15 @@ public class HTMLInputElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var capture: String - @ReadWriteAttribute public var webkitdirectory: Bool @ReadonlyAttribute public var webkitEntries: [FileSystemEntry] + @ReadWriteAttribute + public var capture: String + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index 59e500b1..1e24b914 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -11,8 +11,6 @@ public class HTMLMediaElement: HTMLElement { _mediaKeys = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaKeys) _onencrypted = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onencrypted) _onwaitingforkey = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onwaitingforkey) - _remote = ReadonlyAttribute(jsObject: jsObject, name: Strings.remote) - _disableRemotePlayback = ReadWriteAttribute(jsObject: jsObject, name: Strings.disableRemotePlayback) _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcObject = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcObject) @@ -41,6 +39,8 @@ public class HTMLMediaElement: HTMLElement { _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioTracks) _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoTracks) _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.textTracks) + _remote = ReadonlyAttribute(jsObject: jsObject, name: Strings.remote) + _disableRemotePlayback = ReadWriteAttribute(jsObject: jsObject, name: Strings.disableRemotePlayback) super.init(unsafelyWrapping: jsObject) } @@ -76,16 +76,6 @@ public class HTMLMediaElement: HTMLElement { _ = try await _promise.get() } - public func captureStream() -> MediaStream { - jsObject[Strings.captureStream]!().fromJSValue()! - } - - @ReadonlyAttribute - public var remote: RemotePlayback - - @ReadWriteAttribute - public var disableRemotePlayback: Bool - @ReadonlyAttribute public var error: MediaError? @@ -221,4 +211,14 @@ public class HTMLMediaElement: HTMLElement { public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { jsObject[Strings.addTextTrack]!(kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined).fromJSValue()! } + + public func captureStream() -> MediaStream { + jsObject[Strings.captureStream]!().fromJSValue()! + } + + @ReadonlyAttribute + public var remote: RemotePlayback + + @ReadWriteAttribute + public var disableRemotePlayback: Bool } diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 90b86939..068645de 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -20,12 +20,6 @@ public class HTMLVideoElement: HTMLMediaElement { super.init(unsafelyWrapping: jsObject) } - // XXX: member 'requestVideoFrameCallback' is ignored - - public func cancelVideoFrameCallback(handle: UInt32) { - _ = jsObject[Strings.cancelVideoFrameCallback]!(handle.jsValue()) - } - public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -73,4 +67,10 @@ public class HTMLVideoElement: HTMLMediaElement { @ReadWriteAttribute public var disablePictureInPicture: Bool + + // XXX: member 'requestVideoFrameCallback' is ignored + + public func cancelVideoFrameCallback(handle: UInt32) { + _ = jsObject[Strings.cancelVideoFrameCallback]!(handle.jsValue()) + } } diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index c6717f90..029115b5 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -7,13 +7,20 @@ public class InputEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global[Strings.InputEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Strings.isComposing) _inputType = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputType) - _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var dataTransfer: DataTransfer? + + public func getTargetRanges() -> [StaticRange] { + jsObject[Strings.getTargetRanges]!().fromJSValue()! + } + public convenience init(type: String, eventInitDict: InputEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } @@ -26,11 +33,4 @@ public class InputEvent: UIEvent { @ReadonlyAttribute public var inputType: String - - @ReadonlyAttribute - public var dataTransfer: DataTransfer? - - public func getTargetRanges() -> [StaticRange] { - jsObject[Strings.getTargetRanges]!().fromJSValue()! - } } diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift index 5d6095b8..8604dfca 100644 --- a/Sources/DOMKit/WebIDL/InputEventInit.swift +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -4,37 +4,37 @@ import JavaScriptEventLoop import JavaScriptKit public class InputEventInit: BridgedDictionary { - public convenience init(data: String?, isComposing: Bool, inputType: String, dataTransfer: DataTransfer?, targetRanges: [StaticRange]) { + public convenience init(dataTransfer: DataTransfer?, targetRanges: [StaticRange], data: String?, isComposing: Bool, inputType: String) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.dataTransfer] = dataTransfer.jsValue() + object[Strings.targetRanges] = targetRanges.jsValue() object[Strings.data] = data.jsValue() object[Strings.isComposing] = isComposing.jsValue() object[Strings.inputType] = inputType.jsValue() - object[Strings.dataTransfer] = dataTransfer.jsValue() - object[Strings.targetRanges] = targetRanges.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _dataTransfer = ReadWriteAttribute(jsObject: object, name: Strings.dataTransfer) + _targetRanges = ReadWriteAttribute(jsObject: object, name: Strings.targetRanges) _data = ReadWriteAttribute(jsObject: object, name: Strings.data) _isComposing = ReadWriteAttribute(jsObject: object, name: Strings.isComposing) _inputType = ReadWriteAttribute(jsObject: object, name: Strings.inputType) - _dataTransfer = ReadWriteAttribute(jsObject: object, name: Strings.dataTransfer) - _targetRanges = ReadWriteAttribute(jsObject: object, name: Strings.targetRanges) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var data: String? + public var dataTransfer: DataTransfer? @ReadWriteAttribute - public var isComposing: Bool + public var targetRanges: [StaticRange] @ReadWriteAttribute - public var inputType: String + public var data: String? @ReadWriteAttribute - public var dataTransfer: DataTransfer? + public var isComposing: Bool @ReadWriteAttribute - public var targetRanges: [StaticRange] + public var inputType: String } diff --git a/Sources/DOMKit/WebIDL/KeyframeEffect.swift b/Sources/DOMKit/WebIDL/KeyframeEffect.swift index ee54bb23..79c3b807 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffect.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffect.swift @@ -7,13 +7,16 @@ public class KeyframeEffect: AnimationEffect { override public class var constructor: JSFunction { JSObject.global[Strings.KeyframeEffect].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _iterationComposite = ReadWriteAttribute(jsObject: jsObject, name: Strings.iterationComposite) _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) _pseudoElement = ReadWriteAttribute(jsObject: jsObject, name: Strings.pseudoElement) _composite = ReadWriteAttribute(jsObject: jsObject, name: Strings.composite) - _iterationComposite = ReadWriteAttribute(jsObject: jsObject, name: Strings.iterationComposite) super.init(unsafelyWrapping: jsObject) } + @ReadWriteAttribute + public var iterationComposite: IterationCompositeOperation + public convenience init(target: Element?, keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(target.jsValue(), keyframes.jsValue(), options?.jsValue() ?? .undefined)) } @@ -38,7 +41,4 @@ public class KeyframeEffect: AnimationEffect { public func setKeyframes(keyframes: JSObject?) { _ = jsObject[Strings.setKeyframes]!(keyframes.jsValue()) } - - @ReadWriteAttribute - public var iterationComposite: IterationCompositeOperation } diff --git a/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift index ed6ae740..b0a790a7 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift @@ -4,27 +4,27 @@ import JavaScriptEventLoop import JavaScriptKit public class KeyframeEffectOptions: BridgedDictionary { - public convenience init(composite: CompositeOperation, pseudoElement: String?, iterationComposite: IterationCompositeOperation) { + public convenience init(iterationComposite: IterationCompositeOperation, composite: CompositeOperation, pseudoElement: String?) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.iterationComposite] = iterationComposite.jsValue() object[Strings.composite] = composite.jsValue() object[Strings.pseudoElement] = pseudoElement.jsValue() - object[Strings.iterationComposite] = iterationComposite.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _iterationComposite = ReadWriteAttribute(jsObject: object, name: Strings.iterationComposite) _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) _pseudoElement = ReadWriteAttribute(jsObject: object, name: Strings.pseudoElement) - _iterationComposite = ReadWriteAttribute(jsObject: object, name: Strings.iterationComposite) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var composite: CompositeOperation + public var iterationComposite: IterationCompositeOperation @ReadWriteAttribute - public var pseudoElement: String? + public var composite: CompositeOperation @ReadWriteAttribute - public var iterationComposite: IterationCompositeOperation + public var pseudoElement: String? } diff --git a/Sources/DOMKit/WebIDL/MathMLElement.swift b/Sources/DOMKit/WebIDL/MathMLElement.swift index e5e650bc..87ca6dbe 100644 --- a/Sources/DOMKit/WebIDL/MathMLElement.swift +++ b/Sources/DOMKit/WebIDL/MathMLElement.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class MathMLElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, HTMLOrSVGElement, ElementCSSInlineStyle { +public class MathMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, HTMLOrSVGElement { override public class var constructor: JSFunction { JSObject.global[Strings.MathMLElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift index efae2985..35683670 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift @@ -4,20 +4,20 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamConstraints: BridgedDictionary { - public convenience init(video: __UNSUPPORTED_UNION__, audio: __UNSUPPORTED_UNION__, peerIdentity: String, preferCurrentTab: Bool) { + public convenience init(video: __UNSUPPORTED_UNION__, audio: __UNSUPPORTED_UNION__, preferCurrentTab: Bool, peerIdentity: String) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.video] = video.jsValue() object[Strings.audio] = audio.jsValue() - object[Strings.peerIdentity] = peerIdentity.jsValue() object[Strings.preferCurrentTab] = preferCurrentTab.jsValue() + object[Strings.peerIdentity] = peerIdentity.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { _video = ReadWriteAttribute(jsObject: object, name: Strings.video) _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) - _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) _preferCurrentTab = ReadWriteAttribute(jsObject: object, name: Strings.preferCurrentTab) + _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) super.init(unsafelyWrapping: object) } @@ -28,8 +28,8 @@ public class MediaStreamConstraints: BridgedDictionary { public var audio: __UNSUPPORTED_UNION__ @ReadWriteAttribute - public var peerIdentity: String + public var preferCurrentTab: Bool @ReadWriteAttribute - public var preferCurrentTab: Bool + public var peerIdentity: String } diff --git a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift index 2e2b32d7..01e3d2d2 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift @@ -4,23 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit 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, whiteBalanceMode: [String], exposureMode: [String], focusMode: [String], exposureCompensation: MediaSettingsRange, exposureTime: MediaSettingsRange, colorTemperature: MediaSettingsRange, iso: MediaSettingsRange, brightness: MediaSettingsRange, contrast: MediaSettingsRange, saturation: MediaSettingsRange, sharpness: MediaSettingsRange, focusDistance: MediaSettingsRange, pan: MediaSettingsRange, tilt: MediaSettingsRange, zoom: MediaSettingsRange, torch: Bool, displaySurface: String, logicalSurface: Bool, cursor: [String]) { + public convenience init(whiteBalanceMode: [String], exposureMode: [String], focusMode: [String], exposureCompensation: MediaSettingsRange, exposureTime: MediaSettingsRange, colorTemperature: MediaSettingsRange, iso: MediaSettingsRange, brightness: MediaSettingsRange, contrast: MediaSettingsRange, saturation: MediaSettingsRange, sharpness: MediaSettingsRange, focusDistance: MediaSettingsRange, pan: MediaSettingsRange, tilt: MediaSettingsRange, zoom: MediaSettingsRange, torch: Bool, 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, displaySurface: String, logicalSurface: Bool, cursor: [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() object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() object[Strings.exposureMode] = exposureMode.jsValue() object[Strings.focusMode] = focusMode.jsValue() @@ -37,6 +22,21 @@ public class MediaTrackCapabilities: BridgedDictionary { object[Strings.tilt] = tilt.jsValue() object[Strings.zoom] = zoom.jsValue() object[Strings.torch] = torch.jsValue() + 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() object[Strings.displaySurface] = displaySurface.jsValue() object[Strings.logicalSurface] = logicalSurface.jsValue() object[Strings.cursor] = cursor.jsValue() @@ -44,21 +44,6 @@ public class MediaTrackCapabilities: BridgedDictionary { } 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) _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) @@ -75,6 +60,21 @@ public class MediaTrackCapabilities: BridgedDictionary { _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) + _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) _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) @@ -82,97 +82,97 @@ public class MediaTrackCapabilities: BridgedDictionary { } @ReadWriteAttribute - public var width: ULongRange + public var whiteBalanceMode: [String] @ReadWriteAttribute - public var height: ULongRange + public var exposureMode: [String] @ReadWriteAttribute - public var aspectRatio: DoubleRange + public var focusMode: [String] @ReadWriteAttribute - public var frameRate: DoubleRange + public var exposureCompensation: MediaSettingsRange @ReadWriteAttribute - public var facingMode: [String] + public var exposureTime: MediaSettingsRange @ReadWriteAttribute - public var resizeMode: [String] + public var colorTemperature: MediaSettingsRange @ReadWriteAttribute - public var sampleRate: ULongRange + public var iso: MediaSettingsRange @ReadWriteAttribute - public var sampleSize: ULongRange + public var brightness: MediaSettingsRange @ReadWriteAttribute - public var echoCancellation: [Bool] + public var contrast: MediaSettingsRange @ReadWriteAttribute - public var autoGainControl: [Bool] + public var saturation: MediaSettingsRange @ReadWriteAttribute - public var noiseSuppression: [Bool] + public var sharpness: MediaSettingsRange @ReadWriteAttribute - public var latency: DoubleRange + public var focusDistance: MediaSettingsRange @ReadWriteAttribute - public var channelCount: ULongRange + public var pan: MediaSettingsRange @ReadWriteAttribute - public var deviceId: String + public var tilt: MediaSettingsRange @ReadWriteAttribute - public var groupId: String + public var zoom: MediaSettingsRange @ReadWriteAttribute - public var whiteBalanceMode: [String] + public var torch: Bool @ReadWriteAttribute - public var exposureMode: [String] + public var width: ULongRange @ReadWriteAttribute - public var focusMode: [String] + public var height: ULongRange @ReadWriteAttribute - public var exposureCompensation: MediaSettingsRange + public var aspectRatio: DoubleRange @ReadWriteAttribute - public var exposureTime: MediaSettingsRange + public var frameRate: DoubleRange @ReadWriteAttribute - public var colorTemperature: MediaSettingsRange + public var facingMode: [String] @ReadWriteAttribute - public var iso: MediaSettingsRange + public var resizeMode: [String] @ReadWriteAttribute - public var brightness: MediaSettingsRange + public var sampleRate: ULongRange @ReadWriteAttribute - public var contrast: MediaSettingsRange + public var sampleSize: ULongRange @ReadWriteAttribute - public var saturation: MediaSettingsRange + public var echoCancellation: [Bool] @ReadWriteAttribute - public var sharpness: MediaSettingsRange + public var autoGainControl: [Bool] @ReadWriteAttribute - public var focusDistance: MediaSettingsRange + public var noiseSuppression: [Bool] @ReadWriteAttribute - public var pan: MediaSettingsRange + public var latency: DoubleRange @ReadWriteAttribute - public var tilt: MediaSettingsRange + public var channelCount: ULongRange @ReadWriteAttribute - public var zoom: MediaSettingsRange + public var deviceId: String @ReadWriteAttribute - public var torch: Bool + public var groupId: String @ReadWriteAttribute public var displaySurface: String diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift index b2dce09b..8250abbb 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift @@ -4,23 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit 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, whiteBalanceMode: ConstrainDOMString, exposureMode: ConstrainDOMString, focusMode: ConstrainDOMString, pointsOfInterest: ConstrainPoint2D, exposureCompensation: ConstrainDouble, exposureTime: ConstrainDouble, colorTemperature: ConstrainDouble, iso: ConstrainDouble, brightness: ConstrainDouble, contrast: ConstrainDouble, saturation: ConstrainDouble, sharpness: ConstrainDouble, focusDistance: ConstrainDouble, pan: __UNSUPPORTED_UNION__, tilt: __UNSUPPORTED_UNION__, zoom: __UNSUPPORTED_UNION__, torch: ConstrainBoolean, displaySurface: ConstrainDOMString, logicalSurface: ConstrainBoolean, cursor: ConstrainDOMString, restrictOwnAudio: ConstrainBoolean, suppressLocalAudioPlayback: ConstrainBoolean) { + public convenience init(whiteBalanceMode: ConstrainDOMString, exposureMode: ConstrainDOMString, focusMode: ConstrainDOMString, pointsOfInterest: ConstrainPoint2D, exposureCompensation: ConstrainDouble, exposureTime: ConstrainDouble, colorTemperature: ConstrainDouble, iso: ConstrainDouble, brightness: ConstrainDouble, contrast: ConstrainDouble, saturation: ConstrainDouble, sharpness: ConstrainDouble, focusDistance: ConstrainDouble, pan: __UNSUPPORTED_UNION__, tilt: __UNSUPPORTED_UNION__, zoom: __UNSUPPORTED_UNION__, torch: ConstrainBoolean, 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, displaySurface: ConstrainDOMString, logicalSurface: ConstrainBoolean, cursor: ConstrainDOMString, restrictOwnAudio: ConstrainBoolean, suppressLocalAudioPlayback: ConstrainBoolean) { 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() object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() object[Strings.exposureMode] = exposureMode.jsValue() object[Strings.focusMode] = focusMode.jsValue() @@ -38,6 +23,21 @@ public class MediaTrackConstraintSet: BridgedDictionary { object[Strings.tilt] = tilt.jsValue() object[Strings.zoom] = zoom.jsValue() object[Strings.torch] = torch.jsValue() + 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() object[Strings.displaySurface] = displaySurface.jsValue() object[Strings.logicalSurface] = logicalSurface.jsValue() object[Strings.cursor] = cursor.jsValue() @@ -47,21 +47,6 @@ public class MediaTrackConstraintSet: BridgedDictionary { } 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) _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) @@ -79,6 +64,21 @@ public class MediaTrackConstraintSet: BridgedDictionary { _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) + _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) _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) @@ -88,100 +88,100 @@ public class MediaTrackConstraintSet: BridgedDictionary { } @ReadWriteAttribute - public var width: ConstrainULong + public var whiteBalanceMode: ConstrainDOMString @ReadWriteAttribute - public var height: ConstrainULong + public var exposureMode: ConstrainDOMString @ReadWriteAttribute - public var aspectRatio: ConstrainDouble + public var focusMode: ConstrainDOMString @ReadWriteAttribute - public var frameRate: ConstrainDouble + public var pointsOfInterest: ConstrainPoint2D @ReadWriteAttribute - public var facingMode: ConstrainDOMString + public var exposureCompensation: ConstrainDouble @ReadWriteAttribute - public var resizeMode: ConstrainDOMString + public var exposureTime: ConstrainDouble @ReadWriteAttribute - public var sampleRate: ConstrainULong + public var colorTemperature: ConstrainDouble @ReadWriteAttribute - public var sampleSize: ConstrainULong + public var iso: ConstrainDouble @ReadWriteAttribute - public var echoCancellation: ConstrainBoolean + public var brightness: ConstrainDouble @ReadWriteAttribute - public var autoGainControl: ConstrainBoolean + public var contrast: ConstrainDouble @ReadWriteAttribute - public var noiseSuppression: ConstrainBoolean + public var saturation: ConstrainDouble @ReadWriteAttribute - public var latency: ConstrainDouble + public var sharpness: ConstrainDouble @ReadWriteAttribute - public var channelCount: ConstrainULong + public var focusDistance: ConstrainDouble @ReadWriteAttribute - public var deviceId: ConstrainDOMString + public var pan: __UNSUPPORTED_UNION__ @ReadWriteAttribute - public var groupId: ConstrainDOMString + public var tilt: __UNSUPPORTED_UNION__ @ReadWriteAttribute - public var whiteBalanceMode: ConstrainDOMString + public var zoom: __UNSUPPORTED_UNION__ @ReadWriteAttribute - public var exposureMode: ConstrainDOMString + public var torch: ConstrainBoolean @ReadWriteAttribute - public var focusMode: ConstrainDOMString + public var width: ConstrainULong @ReadWriteAttribute - public var pointsOfInterest: ConstrainPoint2D + public var height: ConstrainULong @ReadWriteAttribute - public var exposureCompensation: ConstrainDouble + public var aspectRatio: ConstrainDouble @ReadWriteAttribute - public var exposureTime: ConstrainDouble + public var frameRate: ConstrainDouble @ReadWriteAttribute - public var colorTemperature: ConstrainDouble + public var facingMode: ConstrainDOMString @ReadWriteAttribute - public var iso: ConstrainDouble + public var resizeMode: ConstrainDOMString @ReadWriteAttribute - public var brightness: ConstrainDouble + public var sampleRate: ConstrainULong @ReadWriteAttribute - public var contrast: ConstrainDouble + public var sampleSize: ConstrainULong @ReadWriteAttribute - public var saturation: ConstrainDouble + public var echoCancellation: ConstrainBoolean @ReadWriteAttribute - public var sharpness: ConstrainDouble + public var autoGainControl: ConstrainBoolean @ReadWriteAttribute - public var focusDistance: ConstrainDouble + public var noiseSuppression: ConstrainBoolean @ReadWriteAttribute - public var pan: __UNSUPPORTED_UNION__ + public var latency: ConstrainDouble @ReadWriteAttribute - public var tilt: __UNSUPPORTED_UNION__ + public var channelCount: ConstrainULong @ReadWriteAttribute - public var zoom: __UNSUPPORTED_UNION__ + public var deviceId: ConstrainDOMString @ReadWriteAttribute - public var torch: ConstrainBoolean + public var groupId: ConstrainDOMString @ReadWriteAttribute public var displaySurface: ConstrainDOMString diff --git a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift index ee4f6612..8a6d3b24 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift @@ -4,23 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit 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, whiteBalanceMode: String, exposureMode: String, focusMode: String, pointsOfInterest: [Point2D], exposureCompensation: Double, exposureTime: Double, colorTemperature: Double, iso: Double, brightness: Double, contrast: Double, saturation: Double, sharpness: Double, focusDistance: Double, pan: Double, tilt: Double, zoom: Double, torch: Bool, displaySurface: String, logicalSurface: Bool, cursor: String, restrictOwnAudio: Bool) { + public convenience init(whiteBalanceMode: String, exposureMode: String, focusMode: String, pointsOfInterest: [Point2D], exposureCompensation: Double, exposureTime: Double, colorTemperature: Double, iso: Double, brightness: Double, contrast: Double, saturation: Double, sharpness: Double, focusDistance: Double, pan: Double, tilt: Double, zoom: Double, torch: Bool, 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, displaySurface: String, logicalSurface: Bool, cursor: String, restrictOwnAudio: 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() object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() object[Strings.exposureMode] = exposureMode.jsValue() object[Strings.focusMode] = focusMode.jsValue() @@ -38,6 +23,21 @@ public class MediaTrackSettings: BridgedDictionary { object[Strings.tilt] = tilt.jsValue() object[Strings.zoom] = zoom.jsValue() object[Strings.torch] = torch.jsValue() + 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() object[Strings.displaySurface] = displaySurface.jsValue() object[Strings.logicalSurface] = logicalSurface.jsValue() object[Strings.cursor] = cursor.jsValue() @@ -46,21 +46,6 @@ public class MediaTrackSettings: BridgedDictionary { } 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) _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) @@ -78,6 +63,21 @@ public class MediaTrackSettings: BridgedDictionary { _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) + _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) _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) @@ -86,100 +86,100 @@ public class MediaTrackSettings: BridgedDictionary { } @ReadWriteAttribute - public var width: Int32 + public var whiteBalanceMode: String @ReadWriteAttribute - public var height: Int32 + public var exposureMode: String @ReadWriteAttribute - public var aspectRatio: Double + public var focusMode: String @ReadWriteAttribute - public var frameRate: Double + public var pointsOfInterest: [Point2D] @ReadWriteAttribute - public var facingMode: String + public var exposureCompensation: Double @ReadWriteAttribute - public var resizeMode: String + public var exposureTime: Double @ReadWriteAttribute - public var sampleRate: Int32 + public var colorTemperature: Double @ReadWriteAttribute - public var sampleSize: Int32 + public var iso: Double @ReadWriteAttribute - public var echoCancellation: Bool + public var brightness: Double @ReadWriteAttribute - public var autoGainControl: Bool + public var contrast: Double @ReadWriteAttribute - public var noiseSuppression: Bool + public var saturation: Double @ReadWriteAttribute - public var latency: Double + public var sharpness: Double @ReadWriteAttribute - public var channelCount: Int32 + public var focusDistance: Double @ReadWriteAttribute - public var deviceId: String + public var pan: Double @ReadWriteAttribute - public var groupId: String + public var tilt: Double @ReadWriteAttribute - public var whiteBalanceMode: String + public var zoom: Double @ReadWriteAttribute - public var exposureMode: String + public var torch: Bool @ReadWriteAttribute - public var focusMode: String + public var width: Int32 @ReadWriteAttribute - public var pointsOfInterest: [Point2D] + public var height: Int32 @ReadWriteAttribute - public var exposureCompensation: Double + public var aspectRatio: Double @ReadWriteAttribute - public var exposureTime: Double + public var frameRate: Double @ReadWriteAttribute - public var colorTemperature: Double + public var facingMode: String @ReadWriteAttribute - public var iso: Double + public var resizeMode: String @ReadWriteAttribute - public var brightness: Double + public var sampleRate: Int32 @ReadWriteAttribute - public var contrast: Double + public var sampleSize: Int32 @ReadWriteAttribute - public var saturation: Double + public var echoCancellation: Bool @ReadWriteAttribute - public var sharpness: Double + public var autoGainControl: Bool @ReadWriteAttribute - public var focusDistance: Double + public var noiseSuppression: Bool @ReadWriteAttribute - public var pan: Double + public var latency: Double @ReadWriteAttribute - public var tilt: Double + public var channelCount: Int32 @ReadWriteAttribute - public var zoom: Double + public var deviceId: String @ReadWriteAttribute - public var torch: Bool + public var groupId: String @ReadWriteAttribute public var displaySurface: String diff --git a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift index bea9c722..9911b6eb 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift @@ -4,23 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit 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, whiteBalanceMode: Bool, exposureMode: Bool, focusMode: Bool, pointsOfInterest: Bool, exposureCompensation: Bool, exposureTime: Bool, colorTemperature: Bool, iso: Bool, brightness: Bool, contrast: Bool, pan: Bool, saturation: Bool, sharpness: Bool, focusDistance: Bool, tilt: Bool, zoom: Bool, torch: Bool, displaySurface: Bool, logicalSurface: Bool, cursor: Bool, restrictOwnAudio: Bool, suppressLocalAudioPlayback: Bool) { + public convenience init(whiteBalanceMode: Bool, exposureMode: Bool, focusMode: Bool, pointsOfInterest: Bool, exposureCompensation: Bool, exposureTime: Bool, colorTemperature: Bool, iso: Bool, brightness: Bool, contrast: Bool, pan: Bool, saturation: Bool, sharpness: Bool, focusDistance: Bool, tilt: Bool, zoom: Bool, torch: Bool, 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, displaySurface: Bool, logicalSurface: Bool, cursor: Bool, restrictOwnAudio: Bool, suppressLocalAudioPlayback: 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() object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() object[Strings.exposureMode] = exposureMode.jsValue() object[Strings.focusMode] = focusMode.jsValue() @@ -38,6 +23,21 @@ public class MediaTrackSupportedConstraints: BridgedDictionary { object[Strings.tilt] = tilt.jsValue() object[Strings.zoom] = zoom.jsValue() object[Strings.torch] = torch.jsValue() + 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() object[Strings.displaySurface] = displaySurface.jsValue() object[Strings.logicalSurface] = logicalSurface.jsValue() object[Strings.cursor] = cursor.jsValue() @@ -47,21 +47,6 @@ public class MediaTrackSupportedConstraints: BridgedDictionary { } 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) _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) @@ -79,6 +64,21 @@ public class MediaTrackSupportedConstraints: BridgedDictionary { _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) + _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) _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) @@ -88,100 +88,100 @@ public class MediaTrackSupportedConstraints: BridgedDictionary { } @ReadWriteAttribute - public var width: Bool + public var whiteBalanceMode: Bool @ReadWriteAttribute - public var height: Bool + public var exposureMode: Bool @ReadWriteAttribute - public var aspectRatio: Bool + public var focusMode: Bool @ReadWriteAttribute - public var frameRate: Bool + public var pointsOfInterest: Bool @ReadWriteAttribute - public var facingMode: Bool + public var exposureCompensation: Bool @ReadWriteAttribute - public var resizeMode: Bool + public var exposureTime: Bool @ReadWriteAttribute - public var sampleRate: Bool + public var colorTemperature: Bool @ReadWriteAttribute - public var sampleSize: Bool + public var iso: Bool @ReadWriteAttribute - public var echoCancellation: Bool + public var brightness: Bool @ReadWriteAttribute - public var autoGainControl: Bool + public var contrast: Bool @ReadWriteAttribute - public var noiseSuppression: Bool + public var pan: Bool @ReadWriteAttribute - public var latency: Bool + public var saturation: Bool @ReadWriteAttribute - public var channelCount: Bool + public var sharpness: Bool @ReadWriteAttribute - public var deviceId: Bool + public var focusDistance: Bool @ReadWriteAttribute - public var groupId: Bool + public var tilt: Bool @ReadWriteAttribute - public var whiteBalanceMode: Bool + public var zoom: Bool @ReadWriteAttribute - public var exposureMode: Bool + public var torch: Bool @ReadWriteAttribute - public var focusMode: Bool + public var width: Bool @ReadWriteAttribute - public var pointsOfInterest: Bool + public var height: Bool @ReadWriteAttribute - public var exposureCompensation: Bool + public var aspectRatio: Bool @ReadWriteAttribute - public var exposureTime: Bool + public var frameRate: Bool @ReadWriteAttribute - public var colorTemperature: Bool + public var facingMode: Bool @ReadWriteAttribute - public var iso: Bool + public var resizeMode: Bool @ReadWriteAttribute - public var brightness: Bool + public var sampleRate: Bool @ReadWriteAttribute - public var contrast: Bool + public var sampleSize: Bool @ReadWriteAttribute - public var pan: Bool + public var echoCancellation: Bool @ReadWriteAttribute - public var saturation: Bool + public var autoGainControl: Bool @ReadWriteAttribute - public var sharpness: Bool + public var noiseSuppression: Bool @ReadWriteAttribute - public var focusDistance: Bool + public var latency: Bool @ReadWriteAttribute - public var tilt: Bool + public var channelCount: Bool @ReadWriteAttribute - public var zoom: Bool + public var deviceId: Bool @ReadWriteAttribute - public var torch: Bool + public var groupId: Bool @ReadWriteAttribute public var displaySurface: Bool diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index d5969832..e09f17d4 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -7,14 +7,14 @@ public class MouseEvent: UIEvent { override public class var constructor: JSFunction { JSObject.global[Strings.MouseEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _movementX = ReadonlyAttribute(jsObject: jsObject, name: Strings.movementX) - _movementY = ReadonlyAttribute(jsObject: jsObject, name: Strings.movementY) _pageX = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageX) _pageY = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageY) _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) _offsetX = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetX) _offsetY = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetY) + _movementX = ReadonlyAttribute(jsObject: jsObject, name: Strings.movementX) + _movementY = ReadonlyAttribute(jsObject: jsObject, name: Strings.movementY) _screenX = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenX) _screenY = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenY) _clientX = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientX) @@ -29,12 +29,6 @@ public class MouseEvent: UIEvent { super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var movementX: Double - - @ReadonlyAttribute - public var movementY: Double - @ReadonlyAttribute public var pageX: Double @@ -53,6 +47,12 @@ public class MouseEvent: UIEvent { @ReadonlyAttribute public var offsetY: Double + @ReadonlyAttribute + public var movementX: Double + + @ReadonlyAttribute + public var movementY: Double + public convenience init(type: String, eventInitDict: MouseEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) } diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index b133da65..f9195bdd 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -3,48 +3,38 @@ import JavaScriptEventLoop import JavaScriptKit -public class Navigator: JSBridgedClass, NavigatorLocks, NavigatorAutomationInformation, NavigatorML, NavigatorDeviceMemory, NavigatorStorage, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware, NavigatorFonts, NavigatorBadge, NavigatorNetworkInformation, NavigatorUA { +public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware, NavigatorFonts, NavigatorNetworkInformation, NavigatorStorage, NavigatorUA, NavigatorLocks, NavigatorAutomationInformation, NavigatorGPU, NavigatorML { public class var constructor: JSFunction { JSObject.global[Strings.Navigator].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _presentation = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentation) - _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) - _credentials = ReadonlyAttribute(jsObject: jsObject, name: Strings.credentials) _clipboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipboard) - _bluetooth = ReadonlyAttribute(jsObject: jsObject, name: Strings.bluetooth) - _mediaDevices = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaDevices) - _xr = ReadonlyAttribute(jsObject: jsObject, name: Strings.xr) + _contacts = ReadonlyAttribute(jsObject: jsObject, name: Strings.contacts) + _credentials = ReadonlyAttribute(jsObject: jsObject, name: Strings.credentials) + _devicePosture = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePosture) + _geolocation = ReadonlyAttribute(jsObject: jsObject, name: Strings.geolocation) + _ink = ReadonlyAttribute(jsObject: jsObject, name: Strings.ink) _scheduling = ReadonlyAttribute(jsObject: jsObject, name: Strings.scheduling) _keyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyboard) - _windowControlsOverlay = ReadonlyAttribute(jsObject: jsObject, name: Strings.windowControlsOverlay) - _ink = ReadonlyAttribute(jsObject: jsObject, name: Strings.ink) + _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) + _mediaDevices = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaDevices) _mediaSession = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaSession) + _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) + _maxTouchPoints = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTouchPoints) + _presentation = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentation) _wakeLock = ReadonlyAttribute(jsObject: jsObject, name: Strings.wakeLock) _serial = ReadonlyAttribute(jsObject: jsObject, name: Strings.serial) - _maxTouchPoints = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTouchPoints) - _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) - _contacts = ReadonlyAttribute(jsObject: jsObject, name: Strings.contacts) - _geolocation = ReadonlyAttribute(jsObject: jsObject, name: Strings.geolocation) - _hid = ReadonlyAttribute(jsObject: jsObject, name: Strings.hid) - _virtualKeyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.virtualKeyboard) - _devicePosture = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePosture) _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) + _virtualKeyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.virtualKeyboard) + _bluetooth = ReadonlyAttribute(jsObject: jsObject, name: Strings.bluetooth) + _hid = ReadonlyAttribute(jsObject: jsObject, name: Strings.hid) _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) + _xr = ReadonlyAttribute(jsObject: jsObject, name: Strings.xr) + _windowControlsOverlay = ReadonlyAttribute(jsObject: jsObject, name: Strings.windowControlsOverlay) self.jsObject = jsObject } - public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { - jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { - let _promise: JSPromise = jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - public func getAutoplayPolicy(type: AutoplayPolicyMediaType) -> AutoplayPolicy { jsObject[Strings.getAutoplayPolicy]!(type.jsValue()).fromJSValue()! } @@ -57,57 +47,68 @@ public class Navigator: JSBridgedClass, NavigatorLocks, NavigatorAutomationInfor jsObject[Strings.getAutoplayPolicy]!(context.jsValue()).fromJSValue()! } - @ReadonlyAttribute - public var presentation: Presentation + public func setClientBadge(contents: UInt64? = nil) -> JSPromise { + jsObject[Strings.setClientBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + } - @ReadonlyAttribute - public var permissions: Permissions + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func setClientBadge(contents: UInt64? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.setClientBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } - public func share(data: ShareData? = nil) -> JSPromise { - jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! + public func clearClientBadge() -> JSPromise { + jsObject[Strings.clearClientBadge]!().fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func share(data: ShareData? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! + public func clearClientBadge() async throws { + let _promise: JSPromise = jsObject[Strings.clearClientBadge]!().fromJSValue()! _ = try await _promise.get() } - public func canShare(data: ShareData? = nil) -> Bool { - jsObject[Strings.canShare]!(data?.jsValue() ?? .undefined).fromJSValue()! + public func getBattery() -> JSPromise { + jsObject[Strings.getBattery]!().fromJSValue()! } - @ReadonlyAttribute - public var credentials: CredentialsContainer + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getBattery() async throws -> BatteryManager { + let _promise: JSPromise = jsObject[Strings.getBattery]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } - @ReadonlyAttribute - public var clipboard: Clipboard + public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { + jsObject[Strings.sendBeacon]!(url.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! + } @ReadonlyAttribute - public var bluetooth: Bluetooth + public var clipboard: Clipboard @ReadonlyAttribute - public var mediaDevices: MediaDevices - - // XXX: member 'getUserMedia' is ignored + public var contacts: ContactsManager @ReadonlyAttribute - public var xr: XRSystem + public var credentials: CredentialsContainer @ReadonlyAttribute - public var scheduling: Scheduling + public var devicePosture: DevicePosture - @ReadonlyAttribute - public var keyboard: Keyboard + public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { + jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + } - @ReadonlyAttribute - public var windowControlsOverlay: WindowControlsOverlay + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { + let _promise: JSPromise = jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } - @ReadonlyAttribute - public var ink: Ink + public func getGamepads() -> [Gamepad?] { + jsObject[Strings.getGamepads]!().fromJSValue()! + } @ReadonlyAttribute - public var mediaSession: MediaSession + public var geolocation: Geolocation public func getInstalledRelatedApps() -> JSPromise { jsObject[Strings.getInstalledRelatedApps]!().fromJSValue()! @@ -119,88 +120,87 @@ public class Navigator: JSBridgedClass, NavigatorLocks, NavigatorAutomationInfor return try await _promise.get().fromJSValue()! } - public func requestMIDIAccess(options: MIDIOptions? = nil) -> JSPromise { - jsObject[Strings.requestMIDIAccess]!(options?.jsValue() ?? .undefined).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestMIDIAccess(options: MIDIOptions? = nil) async throws -> MIDIAccess { - let _promise: JSPromise = jsObject[Strings.requestMIDIAccess]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - @ReadonlyAttribute - public var wakeLock: WakeLock - - public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { - jsObject[Strings.sendBeacon]!(url.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! - } + public var ink: Ink @ReadonlyAttribute - public var serial: Serial - - public func getGamepads() -> [Gamepad?] { - jsObject[Strings.getGamepads]!().fromJSValue()! - } + public var scheduling: Scheduling @ReadonlyAttribute - public var maxTouchPoints: Int32 + public var keyboard: Keyboard @ReadonlyAttribute public var mediaCapabilities: MediaCapabilities - public func setClientBadge(contents: UInt64? = nil) -> JSPromise { - jsObject[Strings.setClientBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setClientBadge(contents: UInt64? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.setClientBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! - _ = try await _promise.get() - } - - public func clearClientBadge() -> JSPromise { - jsObject[Strings.clearClientBadge]!().fromJSValue()! - } + @ReadonlyAttribute + public var mediaDevices: MediaDevices - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func clearClientBadge() async throws { - let _promise: JSPromise = jsObject[Strings.clearClientBadge]!().fromJSValue()! - _ = try await _promise.get() - } + // XXX: member 'getUserMedia' is ignored @ReadonlyAttribute - public var contacts: ContactsManager + public var mediaSession: MediaSession @ReadonlyAttribute - public var geolocation: Geolocation + public var permissions: Permissions @ReadonlyAttribute - public var hid: HID + public var maxTouchPoints: Int32 @ReadonlyAttribute - public var virtualKeyboard: VirtualKeyboard + public var presentation: Presentation @ReadonlyAttribute - public var devicePosture: DevicePosture + public var wakeLock: WakeLock @ReadonlyAttribute - public var serviceWorker: ServiceWorkerContainer + public var serial: Serial @ReadonlyAttribute - public var usb: USB + public var serviceWorker: ServiceWorkerContainer public func vibrate(pattern: VibratePattern) -> Bool { jsObject[Strings.vibrate]!(pattern.jsValue()).fromJSValue()! } - public func getBattery() -> JSPromise { - jsObject[Strings.getBattery]!().fromJSValue()! + @ReadonlyAttribute + public var virtualKeyboard: VirtualKeyboard + + @ReadonlyAttribute + public var bluetooth: Bluetooth + + public func share(data: ShareData? = nil) -> JSPromise { + jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getBattery() async throws -> BatteryManager { - let _promise: JSPromise = jsObject[Strings.getBattery]!().fromJSValue()! + public func share(data: ShareData? = nil) async throws { + let _promise: JSPromise = jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! + _ = try await _promise.get() + } + + public func canShare(data: ShareData? = nil) -> Bool { + jsObject[Strings.canShare]!(data?.jsValue() ?? .undefined).fromJSValue()! + } + + @ReadonlyAttribute + public var hid: HID + + public func requestMIDIAccess(options: MIDIOptions? = nil) -> JSPromise { + jsObject[Strings.requestMIDIAccess]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestMIDIAccess(options: MIDIOptions? = nil) async throws -> MIDIAccess { + let _promise: JSPromise = jsObject[Strings.requestMIDIAccess]!(options?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } + + @ReadonlyAttribute + public var usb: USB + + @ReadonlyAttribute + public var xr: XRSystem + + @ReadonlyAttribute + public var windowControlsOverlay: WindowControlsOverlay } diff --git a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift index 208b6dfb..c74850a8 100644 --- a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift +++ b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift @@ -4,8 +4,9 @@ import JavaScriptEventLoop import JavaScriptKit public class OptionalEffectTiming: BridgedDictionary { - public convenience init(delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: __UNSUPPORTED_UNION__, direction: PlaybackDirection, easing: String, playbackRate: Double) { + public convenience init(playbackRate: Double, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: __UNSUPPORTED_UNION__, direction: PlaybackDirection, easing: String) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.playbackRate] = playbackRate.jsValue() object[Strings.delay] = delay.jsValue() object[Strings.endDelay] = endDelay.jsValue() object[Strings.fill] = fill.jsValue() @@ -14,11 +15,11 @@ public class OptionalEffectTiming: BridgedDictionary { object[Strings.duration] = duration.jsValue() object[Strings.direction] = direction.jsValue() object[Strings.easing] = easing.jsValue() - object[Strings.playbackRate] = playbackRate.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) _endDelay = ReadWriteAttribute(jsObject: object, name: Strings.endDelay) _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) @@ -27,10 +28,12 @@ public class OptionalEffectTiming: BridgedDictionary { _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) - _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) super.init(unsafelyWrapping: object) } + @ReadWriteAttribute + public var playbackRate: Double + @ReadWriteAttribute public var delay: Double @@ -54,7 +57,4 @@ public class OptionalEffectTiming: BridgedDictionary { @ReadWriteAttribute public var easing: String - - @ReadWriteAttribute - public var playbackRate: Double } diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index b1258016..e529f5f2 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -9,34 +9,45 @@ public class Performance: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _eventCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.eventCounts) _interactionCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionCounts) - _onresourcetimingbufferfull = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresourcetimingbufferfull) _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeOrigin) _timing = ReadonlyAttribute(jsObject: jsObject, name: Strings.timing) _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) + _onresourcetimingbufferfull = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresourcetimingbufferfull) super.init(unsafelyWrapping: jsObject) } - public func mark(markName: String, markOptions: PerformanceMarkOptions? = nil) -> PerformanceMark { - jsObject[Strings.mark]!(markName.jsValue(), markOptions?.jsValue() ?? .undefined).fromJSValue()! - } + @ReadonlyAttribute + public var eventCounts: EventCounts - public func clearMarks(markName: String? = nil) { - _ = jsObject[Strings.clearMarks]!(markName?.jsValue() ?? .undefined) - } + @ReadonlyAttribute + public var interactionCounts: InteractionCounts - public func measure(measureName: String, startOrMeasureOptions: __UNSUPPORTED_UNION__? = nil, endMark: String? = nil) -> PerformanceMeasure { - jsObject[Strings.measure]!(measureName.jsValue(), startOrMeasureOptions?.jsValue() ?? .undefined, endMark?.jsValue() ?? .undefined).fromJSValue()! + public func now() -> DOMHighResTimeStamp { + jsObject[Strings.now]!().fromJSValue()! } - public func clearMeasures(measureName: String? = nil) { - _ = jsObject[Strings.clearMeasures]!(measureName?.jsValue() ?? .undefined) + @ReadonlyAttribute + public var timeOrigin: DOMHighResTimeStamp + + public func toJSON() -> JSObject { + jsObject[Strings.toJSON]!().fromJSValue()! } @ReadonlyAttribute - public var eventCounts: EventCounts + public var timing: PerformanceTiming @ReadonlyAttribute - public var interactionCounts: InteractionCounts + public var navigation: PerformanceNavigation + + public func measureUserAgentSpecificMemory() -> JSPromise { + jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { + let _promise: JSPromise = jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } public func getEntries() -> PerformanceEntryList { jsObject[Strings.getEntries]!().fromJSValue()! @@ -61,30 +72,19 @@ public class Performance: EventTarget { @ClosureAttribute.Optional1 public var onresourcetimingbufferfull: EventHandler - public func measureUserAgentSpecificMemory() -> JSPromise { - jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! + public func mark(markName: String, markOptions: PerformanceMarkOptions? = nil) -> PerformanceMark { + jsObject[Strings.mark]!(markName.jsValue(), markOptions?.jsValue() ?? .undefined).fromJSValue()! } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { - let _promise: JSPromise = jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! - return try await _promise.get().fromJSValue()! + public func clearMarks(markName: String? = nil) { + _ = jsObject[Strings.clearMarks]!(markName?.jsValue() ?? .undefined) } - public func now() -> DOMHighResTimeStamp { - jsObject[Strings.now]!().fromJSValue()! + public func measure(measureName: String, startOrMeasureOptions: __UNSUPPORTED_UNION__? = nil, endMark: String? = nil) -> PerformanceMeasure { + jsObject[Strings.measure]!(measureName.jsValue(), startOrMeasureOptions?.jsValue() ?? .undefined, endMark?.jsValue() ?? .undefined).fromJSValue()! } - @ReadonlyAttribute - public var timeOrigin: DOMHighResTimeStamp - - public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + public func clearMeasures(measureName: String? = nil) { + _ = jsObject[Strings.clearMeasures]!(measureName?.jsValue() ?? .undefined) } - - @ReadonlyAttribute - public var timing: PerformanceTiming - - @ReadonlyAttribute - public var navigation: PerformanceNavigation } diff --git a/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift b/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift index 78ad408e..cbfbf698 100644 --- a/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift @@ -7,7 +7,6 @@ public class PerformanceResourceTiming: PerformanceEntry { override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceResourceTiming].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _serverTiming = ReadonlyAttribute(jsObject: jsObject, name: Strings.serverTiming) _initiatorType = ReadonlyAttribute(jsObject: jsObject, name: Strings.initiatorType) _nextHopProtocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.nextHopProtocol) _workerStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.workerStart) @@ -25,12 +24,10 @@ public class PerformanceResourceTiming: PerformanceEntry { _transferSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.transferSize) _encodedBodySize = ReadonlyAttribute(jsObject: jsObject, name: Strings.encodedBodySize) _decodedBodySize = ReadonlyAttribute(jsObject: jsObject, name: Strings.decodedBodySize) + _serverTiming = ReadonlyAttribute(jsObject: jsObject, name: Strings.serverTiming) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var serverTiming: [PerformanceServerTiming] - @ReadonlyAttribute public var initiatorType: String @@ -85,4 +82,7 @@ public class PerformanceResourceTiming: PerformanceEntry { override public func toJSON() -> JSObject { jsObject[Strings.toJSON]!().fromJSValue()! } + + @ReadonlyAttribute + public var serverTiming: [PerformanceServerTiming] } diff --git a/Sources/DOMKit/WebIDL/Permissions.swift b/Sources/DOMKit/WebIDL/Permissions.swift index 13317a0c..9b7de54f 100644 --- a/Sources/DOMKit/WebIDL/Permissions.swift +++ b/Sources/DOMKit/WebIDL/Permissions.swift @@ -22,23 +22,23 @@ public class Permissions: JSBridgedClass { return try await _promise.get().fromJSValue()! } - public func query(permissionDesc: JSObject) -> JSPromise { - jsObject[Strings.query]!(permissionDesc.jsValue()).fromJSValue()! + public func revoke(permissionDesc: JSObject) -> JSPromise { + jsObject[Strings.revoke]!(permissionDesc.jsValue()).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func query(permissionDesc: JSObject) async throws -> PermissionStatus { - let _promise: JSPromise = jsObject[Strings.query]!(permissionDesc.jsValue()).fromJSValue()! + public func revoke(permissionDesc: JSObject) async throws -> PermissionStatus { + let _promise: JSPromise = jsObject[Strings.revoke]!(permissionDesc.jsValue()).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func revoke(permissionDesc: JSObject) -> JSPromise { - jsObject[Strings.revoke]!(permissionDesc.jsValue()).fromJSValue()! + public func query(permissionDesc: JSObject) -> JSPromise { + jsObject[Strings.query]!(permissionDesc.jsValue()).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func revoke(permissionDesc: JSObject) async throws -> PermissionStatus { - let _promise: JSPromise = jsObject[Strings.revoke]!(permissionDesc.jsValue()).fromJSValue()! + public func query(permissionDesc: JSObject) async throws -> PermissionStatus { + let _promise: JSPromise = jsObject[Strings.query]!(permissionDesc.jsValue()).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCConfiguration.swift b/Sources/DOMKit/WebIDL/RTCConfiguration.swift index 86c23818..1408aa47 100644 --- a/Sources/DOMKit/WebIDL/RTCConfiguration.swift +++ b/Sources/DOMKit/WebIDL/RTCConfiguration.swift @@ -4,29 +4,32 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCConfiguration: BridgedDictionary { - public convenience init(iceServers: [RTCIceServer], iceTransportPolicy: RTCIceTransportPolicy, bundlePolicy: RTCBundlePolicy, rtcpMuxPolicy: RTCRtcpMuxPolicy, certificates: [RTCCertificate], iceCandidatePoolSize: UInt8, peerIdentity: String) { + public convenience init(peerIdentity: String, iceServers: [RTCIceServer], iceTransportPolicy: RTCIceTransportPolicy, bundlePolicy: RTCBundlePolicy, rtcpMuxPolicy: RTCRtcpMuxPolicy, certificates: [RTCCertificate], iceCandidatePoolSize: UInt8) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.peerIdentity] = peerIdentity.jsValue() object[Strings.iceServers] = iceServers.jsValue() object[Strings.iceTransportPolicy] = iceTransportPolicy.jsValue() object[Strings.bundlePolicy] = bundlePolicy.jsValue() object[Strings.rtcpMuxPolicy] = rtcpMuxPolicy.jsValue() object[Strings.certificates] = certificates.jsValue() object[Strings.iceCandidatePoolSize] = iceCandidatePoolSize.jsValue() - object[Strings.peerIdentity] = peerIdentity.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) _iceServers = ReadWriteAttribute(jsObject: object, name: Strings.iceServers) _iceTransportPolicy = ReadWriteAttribute(jsObject: object, name: Strings.iceTransportPolicy) _bundlePolicy = ReadWriteAttribute(jsObject: object, name: Strings.bundlePolicy) _rtcpMuxPolicy = ReadWriteAttribute(jsObject: object, name: Strings.rtcpMuxPolicy) _certificates = ReadWriteAttribute(jsObject: object, name: Strings.certificates) _iceCandidatePoolSize = ReadWriteAttribute(jsObject: object, name: Strings.iceCandidatePoolSize) - _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) super.init(unsafelyWrapping: object) } + @ReadWriteAttribute + public var peerIdentity: String + @ReadWriteAttribute public var iceServers: [RTCIceServer] @@ -44,7 +47,4 @@ public class RTCConfiguration: BridgedDictionary { @ReadWriteAttribute public var iceCandidatePoolSize: UInt8 - - @ReadWriteAttribute - public var peerIdentity: String } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannel.swift b/Sources/DOMKit/WebIDL/RTCDataChannel.swift index 5029b734..e20ce8ba 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannel.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannel.swift @@ -7,6 +7,7 @@ public class RTCDataChannel: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.RTCDataChannel].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) _ordered = ReadonlyAttribute(jsObject: jsObject, name: Strings.ordered) _maxPacketLifeTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxPacketLifeTime) @@ -24,10 +25,12 @@ public class RTCDataChannel: EventTarget { _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) - _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var priority: RTCPriorityType + @ReadonlyAttribute public var label: String @@ -98,7 +101,4 @@ public class RTCDataChannel: EventTarget { public func send(data: ArrayBufferView) { _ = jsObject[Strings.send]!(data.jsValue()) } - - @ReadonlyAttribute - public var priority: RTCPriorityType } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift b/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift index 404e110e..d360c854 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift @@ -4,29 +4,32 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCDataChannelInit: BridgedDictionary { - public convenience init(ordered: Bool, maxPacketLifeTime: UInt16, maxRetransmits: UInt16, protocol: String, negotiated: Bool, id: UInt16, priority: RTCPriorityType) { + public convenience init(priority: RTCPriorityType, ordered: Bool, maxPacketLifeTime: UInt16, maxRetransmits: UInt16, protocol: String, negotiated: Bool, id: UInt16) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.priority] = priority.jsValue() object[Strings.ordered] = ordered.jsValue() object[Strings.maxPacketLifeTime] = maxPacketLifeTime.jsValue() object[Strings.maxRetransmits] = maxRetransmits.jsValue() object[Strings.protocol] = `protocol`.jsValue() object[Strings.negotiated] = negotiated.jsValue() object[Strings.id] = id.jsValue() - object[Strings.priority] = priority.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) _ordered = ReadWriteAttribute(jsObject: object, name: Strings.ordered) _maxPacketLifeTime = ReadWriteAttribute(jsObject: object, name: Strings.maxPacketLifeTime) _maxRetransmits = ReadWriteAttribute(jsObject: object, name: Strings.maxRetransmits) _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) _negotiated = ReadWriteAttribute(jsObject: object, name: Strings.negotiated) _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) super.init(unsafelyWrapping: object) } + @ReadWriteAttribute + public var priority: RTCPriorityType + @ReadWriteAttribute public var ordered: Bool @@ -44,7 +47,4 @@ public class RTCDataChannelInit: BridgedDictionary { @ReadWriteAttribute public var id: UInt16 - - @ReadWriteAttribute - public var priority: RTCPriorityType } diff --git a/Sources/DOMKit/WebIDL/RTCError.swift b/Sources/DOMKit/WebIDL/RTCError.swift index 1e4a70da..e671b694 100644 --- a/Sources/DOMKit/WebIDL/RTCError.swift +++ b/Sources/DOMKit/WebIDL/RTCError.swift @@ -7,15 +7,18 @@ public class RTCError: DOMException { override public class var constructor: JSFunction { JSObject.global[Strings.RTCError].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _httpRequestStatusCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.httpRequestStatusCode) _errorDetail = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorDetail) _sdpLineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.sdpLineNumber) _sctpCauseCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.sctpCauseCode) _receivedAlert = ReadonlyAttribute(jsObject: jsObject, name: Strings.receivedAlert) _sentAlert = ReadonlyAttribute(jsObject: jsObject, name: Strings.sentAlert) - _httpRequestStatusCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.httpRequestStatusCode) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var httpRequestStatusCode: Int32? + public convenience init(init: RTCErrorInit, message: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue(), message?.jsValue() ?? .undefined)) } @@ -34,7 +37,4 @@ public class RTCError: DOMException { @ReadonlyAttribute public var sentAlert: UInt32? - - @ReadonlyAttribute - public var httpRequestStatusCode: Int32? } diff --git a/Sources/DOMKit/WebIDL/RTCErrorInit.swift b/Sources/DOMKit/WebIDL/RTCErrorInit.swift index 83b4b463..f2808b80 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorInit.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorInit.swift @@ -4,27 +4,30 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCErrorInit: BridgedDictionary { - public convenience init(errorDetail: RTCErrorDetailType, sdpLineNumber: Int32, sctpCauseCode: Int32, receivedAlert: UInt32, sentAlert: UInt32, httpRequestStatusCode: Int32) { + public convenience init(httpRequestStatusCode: Int32, errorDetail: RTCErrorDetailType, sdpLineNumber: Int32, sctpCauseCode: Int32, receivedAlert: UInt32, sentAlert: UInt32) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.httpRequestStatusCode] = httpRequestStatusCode.jsValue() object[Strings.errorDetail] = errorDetail.jsValue() object[Strings.sdpLineNumber] = sdpLineNumber.jsValue() object[Strings.sctpCauseCode] = sctpCauseCode.jsValue() object[Strings.receivedAlert] = receivedAlert.jsValue() object[Strings.sentAlert] = sentAlert.jsValue() - object[Strings.httpRequestStatusCode] = httpRequestStatusCode.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _httpRequestStatusCode = ReadWriteAttribute(jsObject: object, name: Strings.httpRequestStatusCode) _errorDetail = ReadWriteAttribute(jsObject: object, name: Strings.errorDetail) _sdpLineNumber = ReadWriteAttribute(jsObject: object, name: Strings.sdpLineNumber) _sctpCauseCode = ReadWriteAttribute(jsObject: object, name: Strings.sctpCauseCode) _receivedAlert = ReadWriteAttribute(jsObject: object, name: Strings.receivedAlert) _sentAlert = ReadWriteAttribute(jsObject: object, name: Strings.sentAlert) - _httpRequestStatusCode = ReadWriteAttribute(jsObject: object, name: Strings.httpRequestStatusCode) super.init(unsafelyWrapping: object) } + @ReadWriteAttribute + public var httpRequestStatusCode: Int32 + @ReadWriteAttribute public var errorDetail: RTCErrorDetailType @@ -39,7 +42,4 @@ public class RTCErrorInit: BridgedDictionary { @ReadWriteAttribute public var sentAlert: UInt32 - - @ReadWriteAttribute - public var httpRequestStatusCode: Int32 } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift index 23218940..d6c1b8fc 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift @@ -7,6 +7,9 @@ public class RTCPeerConnection: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnection].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _peerIdentity = ReadonlyAttribute(jsObject: jsObject, name: Strings.peerIdentity) + _idpLoginUrl = ReadonlyAttribute(jsObject: jsObject, name: Strings.idpLoginUrl) + _idpErrorInfo = ReadonlyAttribute(jsObject: jsObject, name: Strings.idpErrorInfo) _localDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.localDescription) _currentLocalDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentLocalDescription) _pendingLocalDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.pendingLocalDescription) @@ -28,12 +31,32 @@ public class RTCPeerConnection: EventTarget { _ontrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontrack) _sctp = ReadonlyAttribute(jsObject: jsObject, name: Strings.sctp) _ondatachannel = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondatachannel) - _peerIdentity = ReadonlyAttribute(jsObject: jsObject, name: Strings.peerIdentity) - _idpLoginUrl = ReadonlyAttribute(jsObject: jsObject, name: Strings.idpLoginUrl) - _idpErrorInfo = ReadonlyAttribute(jsObject: jsObject, name: Strings.idpErrorInfo) super.init(unsafelyWrapping: jsObject) } + public func setIdentityProvider(provider: String, options: RTCIdentityProviderOptions? = nil) { + _ = jsObject[Strings.setIdentityProvider]!(provider.jsValue(), options?.jsValue() ?? .undefined) + } + + public func getIdentityAssertion() -> JSPromise { + jsObject[Strings.getIdentityAssertion]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getIdentityAssertion() async throws -> String { + let _promise: JSPromise = jsObject[Strings.getIdentityAssertion]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var peerIdentity: JSPromise + + @ReadonlyAttribute + public var idpLoginUrl: String? + + @ReadonlyAttribute + public var idpErrorInfo: String? + public convenience init(configuration: RTCConfiguration? = nil) { self.init(unsafelyWrapping: Self.constructor.new(configuration?.jsValue() ?? .undefined)) } @@ -204,27 +227,4 @@ public class RTCPeerConnection: EventTarget { let _promise: JSPromise = jsObject[Strings.getStats]!(selector?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } - - public func setIdentityProvider(provider: String, options: RTCIdentityProviderOptions? = nil) { - _ = jsObject[Strings.setIdentityProvider]!(provider.jsValue(), options?.jsValue() ?? .undefined) - } - - public func getIdentityAssertion() -> JSPromise { - jsObject[Strings.getIdentityAssertion]!().fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getIdentityAssertion() async throws -> String { - let _promise: JSPromise = jsObject[Strings.getIdentityAssertion]!().fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @ReadonlyAttribute - public var peerIdentity: JSPromise - - @ReadonlyAttribute - public var idpLoginUrl: String? - - @ReadonlyAttribute - public var idpErrorInfo: String? } diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift b/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift index 796aca22..757be743 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift @@ -4,25 +4,28 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCRtpCodecCapability: BridgedDictionary { - public convenience init(mimeType: String, clockRate: UInt32, channels: UInt16, sdpFmtpLine: String, scalabilityModes: [String]) { + public convenience init(scalabilityModes: [String], mimeType: String, clockRate: UInt32, channels: UInt16, sdpFmtpLine: String) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.scalabilityModes] = scalabilityModes.jsValue() object[Strings.mimeType] = mimeType.jsValue() object[Strings.clockRate] = clockRate.jsValue() object[Strings.channels] = channels.jsValue() object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue() - object[Strings.scalabilityModes] = scalabilityModes.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _scalabilityModes = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityModes) _mimeType = ReadWriteAttribute(jsObject: object, name: Strings.mimeType) _clockRate = ReadWriteAttribute(jsObject: object, name: Strings.clockRate) _channels = ReadWriteAttribute(jsObject: object, name: Strings.channels) _sdpFmtpLine = ReadWriteAttribute(jsObject: object, name: Strings.sdpFmtpLine) - _scalabilityModes = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityModes) super.init(unsafelyWrapping: object) } + @ReadWriteAttribute + public var scalabilityModes: [String] + @ReadWriteAttribute public var mimeType: String @@ -34,7 +37,4 @@ public class RTCRtpCodecCapability: BridgedDictionary { @ReadWriteAttribute public var sdpFmtpLine: String - - @ReadWriteAttribute - public var scalabilityModes: [String] } diff --git a/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift index 9cc18f23..8abdf5b4 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift @@ -4,42 +4,42 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCRtpEncodingParameters: BridgedDictionary { - public convenience init(active: Bool, maxBitrate: UInt32, scaleResolutionDownBy: Double, scalabilityMode: String, priority: RTCPriorityType, networkPriority: RTCPriorityType) { + public convenience init(priority: RTCPriorityType, networkPriority: RTCPriorityType, scalabilityMode: String, active: Bool, maxBitrate: UInt32, scaleResolutionDownBy: Double) { let object = JSObject.global[Strings.Object].function!.new() + object[Strings.priority] = priority.jsValue() + object[Strings.networkPriority] = networkPriority.jsValue() + object[Strings.scalabilityMode] = scalabilityMode.jsValue() object[Strings.active] = active.jsValue() object[Strings.maxBitrate] = maxBitrate.jsValue() object[Strings.scaleResolutionDownBy] = scaleResolutionDownBy.jsValue() - object[Strings.scalabilityMode] = scalabilityMode.jsValue() - object[Strings.priority] = priority.jsValue() - object[Strings.networkPriority] = networkPriority.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { + _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) + _networkPriority = ReadWriteAttribute(jsObject: object, name: Strings.networkPriority) + _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) _active = ReadWriteAttribute(jsObject: object, name: Strings.active) _maxBitrate = ReadWriteAttribute(jsObject: object, name: Strings.maxBitrate) _scaleResolutionDownBy = ReadWriteAttribute(jsObject: object, name: Strings.scaleResolutionDownBy) - _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) - _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) - _networkPriority = ReadWriteAttribute(jsObject: object, name: Strings.networkPriority) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var active: Bool + public var priority: RTCPriorityType @ReadWriteAttribute - public var maxBitrate: UInt32 + public var networkPriority: RTCPriorityType @ReadWriteAttribute - public var scaleResolutionDownBy: Double + public var scalabilityMode: String @ReadWriteAttribute - public var scalabilityMode: String + public var active: Bool @ReadWriteAttribute - public var priority: RTCPriorityType + public var maxBitrate: UInt32 @ReadWriteAttribute - public var networkPriority: RTCPriorityType + public var scaleResolutionDownBy: Double } diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index aee21fa2..821d7a7f 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -11,6 +11,18 @@ public class Range: AbstractRange { super.init(unsafelyWrapping: jsObject) } + public func createContextualFragment(fragment: String) -> DocumentFragment { + jsObject[Strings.createContextualFragment]!(fragment.jsValue()).fromJSValue()! + } + + public func getClientRects() -> DOMRectList { + jsObject[Strings.getClientRects]!().fromJSValue()! + } + + public func getBoundingClientRect() -> DOMRect { + jsObject[Strings.getBoundingClientRect]!().fromJSValue()! + } + public convenience init() { self.init(unsafelyWrapping: Self.constructor.new()) } @@ -109,16 +121,4 @@ public class Range: AbstractRange { public var description: String { jsObject[Strings.toString]!().fromJSValue()! } - - public func getClientRects() -> DOMRectList { - jsObject[Strings.getClientRects]!().fromJSValue()! - } - - public func getBoundingClientRect() -> DOMRect { - jsObject[Strings.getBoundingClientRect]!().fromJSValue()! - } - - public func createContextualFragment(fragment: String) -> DocumentFragment { - jsObject[Strings.createContextualFragment]!(fragment.jsValue()).fromJSValue()! - } } diff --git a/Sources/DOMKit/WebIDL/SVGSVGElement.swift b/Sources/DOMKit/WebIDL/SVGSVGElement.swift index 7783b4fd..a7428739 100644 --- a/Sources/DOMKit/WebIDL/SVGSVGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGSVGElement.swift @@ -16,26 +16,6 @@ public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHand super.init(unsafelyWrapping: jsObject) } - public func pauseAnimations() { - _ = jsObject[Strings.pauseAnimations]!() - } - - public func unpauseAnimations() { - _ = jsObject[Strings.unpauseAnimations]!() - } - - public func animationsPaused() -> Bool { - jsObject[Strings.animationsPaused]!().fromJSValue()! - } - - public func getCurrentTime() -> Float { - jsObject[Strings.getCurrentTime]!().fromJSValue()! - } - - public func setCurrentTime(seconds: Float) { - _ = jsObject[Strings.setCurrentTime]!(seconds.jsValue()) - } - @ReadonlyAttribute public var x: SVGAnimatedLength @@ -125,4 +105,24 @@ public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHand public func forceRedraw() { _ = jsObject[Strings.forceRedraw]!() } + + public func pauseAnimations() { + _ = jsObject[Strings.pauseAnimations]!() + } + + public func unpauseAnimations() { + _ = jsObject[Strings.unpauseAnimations]!() + } + + public func animationsPaused() -> Bool { + jsObject[Strings.animationsPaused]!().fromJSValue()! + } + + public func getCurrentTime() -> Float { + jsObject[Strings.getCurrentTime]!().fromJSValue()! + } + + public func setCurrentTime(seconds: Float) { + _ = jsObject[Strings.setCurrentTime]!(seconds.jsValue()) + } } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift index 086438ea..6363f010 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift @@ -7,21 +7,21 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _onbackgroundfetchsuccess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchsuccess) + _onbackgroundfetchfail = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchfail) + _onbackgroundfetchabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchabort) + _onbackgroundfetchclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchclick) + _onsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsync) + _oncontentdelete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontentdelete) + _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) + _oncookiechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncookiechange) _onnotificationclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnotificationclick) _onnotificationclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnotificationclose) - _onperiodicsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onperiodicsync) _oncanmakepayment = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncanmakepayment) _onpaymentrequest = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpaymentrequest) - _oncontentdelete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontentdelete) + _onperiodicsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onperiodicsync) _onpush = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpush) _onpushsubscriptionchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpushsubscriptionchange) - _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) - _oncookiechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncookiechange) - _onsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsync) - _onbackgroundfetchsuccess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchsuccess) - _onbackgroundfetchfail = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchfail) - _onbackgroundfetchabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchabort) - _onbackgroundfetchclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchclick) _clients = ReadonlyAttribute(jsObject: jsObject, name: Strings.clients) _registration = ReadonlyAttribute(jsObject: jsObject, name: Strings.registration) _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) @@ -34,29 +34,23 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { } @ClosureAttribute.Optional1 - public var onnotificationclick: EventHandler + public var onbackgroundfetchsuccess: EventHandler @ClosureAttribute.Optional1 - public var onnotificationclose: EventHandler + public var onbackgroundfetchfail: EventHandler @ClosureAttribute.Optional1 - public var onperiodicsync: EventHandler + public var onbackgroundfetchabort: EventHandler @ClosureAttribute.Optional1 - public var oncanmakepayment: EventHandler + public var onbackgroundfetchclick: EventHandler @ClosureAttribute.Optional1 - public var onpaymentrequest: EventHandler + public var onsync: EventHandler @ClosureAttribute.Optional1 public var oncontentdelete: EventHandler - @ClosureAttribute.Optional1 - public var onpush: EventHandler - - @ClosureAttribute.Optional1 - public var onpushsubscriptionchange: EventHandler - @ReadonlyAttribute public var cookieStore: CookieStore @@ -64,19 +58,25 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { public var oncookiechange: EventHandler @ClosureAttribute.Optional1 - public var onsync: EventHandler + public var onnotificationclick: EventHandler @ClosureAttribute.Optional1 - public var onbackgroundfetchsuccess: EventHandler + public var onnotificationclose: EventHandler @ClosureAttribute.Optional1 - public var onbackgroundfetchfail: EventHandler + public var oncanmakepayment: EventHandler @ClosureAttribute.Optional1 - public var onbackgroundfetchabort: EventHandler + public var onpaymentrequest: EventHandler @ClosureAttribute.Optional1 - public var onbackgroundfetchclick: EventHandler + public var onperiodicsync: EventHandler + + @ClosureAttribute.Optional1 + public var onpush: EventHandler + + @ClosureAttribute.Optional1 + public var onpushsubscriptionchange: EventHandler @ReadonlyAttribute public var clients: Clients diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift index 33324a7b..d0d14653 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift @@ -7,13 +7,13 @@ public class ServiceWorkerRegistration: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerRegistration].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _periodicSync = ReadonlyAttribute(jsObject: jsObject, name: Strings.periodicSync) - _paymentManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentManager) + _backgroundFetch = ReadonlyAttribute(jsObject: jsObject, name: Strings.backgroundFetch) + _sync = ReadonlyAttribute(jsObject: jsObject, name: Strings.sync) _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) - _pushManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.pushManager) _cookies = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookies) - _sync = ReadonlyAttribute(jsObject: jsObject, name: Strings.sync) - _backgroundFetch = ReadonlyAttribute(jsObject: jsObject, name: Strings.backgroundFetch) + _paymentManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentManager) + _periodicSync = ReadonlyAttribute(jsObject: jsObject, name: Strings.periodicSync) + _pushManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.pushManager) _installing = ReadonlyAttribute(jsObject: jsObject, name: Strings.installing) _waiting = ReadonlyAttribute(jsObject: jsObject, name: Strings.waiting) _active = ReadonlyAttribute(jsObject: jsObject, name: Strings.active) @@ -24,6 +24,18 @@ public class ServiceWorkerRegistration: EventTarget { super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var backgroundFetch: BackgroundFetchManager + + @ReadonlyAttribute + public var sync: SyncManager + + @ReadonlyAttribute + public var index: ContentIndex + + @ReadonlyAttribute + public var cookies: CookieStoreManager + public func showNotification(title: String, options: NotificationOptions? = nil) -> JSPromise { jsObject[Strings.showNotification]!(title.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! } @@ -44,27 +56,15 @@ public class ServiceWorkerRegistration: EventTarget { return try await _promise.get().fromJSValue()! } - @ReadonlyAttribute - public var periodicSync: PeriodicSyncManager - @ReadonlyAttribute public var paymentManager: PaymentManager @ReadonlyAttribute - public var index: ContentIndex + public var periodicSync: PeriodicSyncManager @ReadonlyAttribute public var pushManager: PushManager - @ReadonlyAttribute - public var cookies: CookieStoreManager - - @ReadonlyAttribute - public var sync: SyncManager - - @ReadonlyAttribute - public var backgroundFetch: BackgroundFetchManager - @ReadonlyAttribute public var installing: ServiceWorker? diff --git a/Sources/DOMKit/WebIDL/ShadowRoot.swift b/Sources/DOMKit/WebIDL/ShadowRoot.swift index 6751754f..2385ead7 100644 --- a/Sources/DOMKit/WebIDL/ShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/ShadowRoot.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class ShadowRoot: DocumentFragment, DocumentOrShadowRoot, InnerHTML { +public class ShadowRoot: DocumentFragment, InnerHTML, DocumentOrShadowRoot { override public class var constructor: JSFunction { JSObject.global[Strings.ShadowRoot].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/StorageManager.swift b/Sources/DOMKit/WebIDL/StorageManager.swift index a29bfca2..8b73805e 100644 --- a/Sources/DOMKit/WebIDL/StorageManager.swift +++ b/Sources/DOMKit/WebIDL/StorageManager.swift @@ -12,6 +12,16 @@ public class StorageManager: JSBridgedClass { self.jsObject = jsObject } + public func getDirectory() -> JSPromise { + jsObject[Strings.getDirectory]!().fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func getDirectory() async throws -> FileSystemDirectoryHandle { + let _promise: JSPromise = jsObject[Strings.getDirectory]!().fromJSValue()! + return try await _promise.get().fromJSValue()! + } + public func persisted() -> JSPromise { jsObject[Strings.persisted]!().fromJSValue()! } @@ -41,14 +51,4 @@ public class StorageManager: JSBridgedClass { let _promise: JSPromise = jsObject[Strings.estimate]!().fromJSValue()! return try await _promise.get().fromJSValue()! } - - public func getDirectory() -> JSPromise { - jsObject[Strings.getDirectory]!().fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDirectory() async throws -> FileSystemDirectoryHandle { - let _promise: JSPromise = jsObject[Strings.getDirectory]!().fromJSValue()! - return try await _promise.get().fromJSValue()! - } } diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index ae9aee25..de1c01ac 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -4132,7 +4132,6 @@ enum Strings { static let requestHitTestSource: JSString = "requestHitTestSource" static let requestHitTestSourceForTransientInput: JSString = "requestHitTestSourceForTransientInput" static let requestId: JSString = "requestId" - static let requestIdleCallback: JSString = "requestIdleCallback" static let requestLightProbe: JSString = "requestLightProbe" static let requestMIDIAccess: JSString = "requestMIDIAccess" static let requestMediaKeySystemAccess: JSString = "requestMediaKeySystemAccess" diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index 0479d7ea..c64515c4 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class Text: CharacterData, Slottable, GeometryUtils { +public class Text: CharacterData, GeometryUtils, Slottable { override public class var constructor: JSFunction { JSObject.global[Strings.Text].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index 66535b43..1ec8b6b1 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -7,7 +7,6 @@ public class TextTrack: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.TextTrack].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) @@ -17,12 +16,10 @@ public class TextTrack: EventTarget { _cues = ReadonlyAttribute(jsObject: jsObject, name: Strings.cues) _activeCues = ReadonlyAttribute(jsObject: jsObject, name: Strings.activeCues) _oncuechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncuechange) + _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var sourceBuffer: SourceBuffer? - @ReadonlyAttribute public var kind: TextTrackKind @@ -57,4 +54,7 @@ public class TextTrack: EventTarget { @ClosureAttribute.Optional1 public var oncuechange: EventHandler + + @ReadonlyAttribute + public var sourceBuffer: SourceBuffer? } diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index 5f767aa5..b9204598 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -3,32 +3,17 @@ import JavaScriptEventLoop import JavaScriptKit -public typealias RotationMatrixType = __UNSUPPORTED_UNION__ -public typealias RTCRtpTransform = __UNSUPPORTED_UNION__ -public typealias SmallCryptoKeyID = UInt64 -public typealias CryptoKeyID = __UNSUPPORTED_UNION__ -public typealias LineAndPositionSetting = __UNSUPPORTED_UNION__ -public typealias HeadersInit = __UNSUPPORTED_UNION__ -public typealias XMLHttpRequestBodyInit = __UNSUPPORTED_UNION__ -public typealias BodyInit = __UNSUPPORTED_UNION__ -public typealias RequestInfo = __UNSUPPORTED_UNION__ -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 TexImageSource = __UNSUPPORTED_UNION__ -public typealias Float32List = __UNSUPPORTED_UNION__ -public typealias Int32List = __UNSUPPORTED_UNION__ +public typealias GLuint64EXT = UInt64 +public typealias BlobPart = __UNSUPPORTED_UNION__ +public typealias AlgorithmIdentifier = __UNSUPPORTED_UNION__ +public typealias HashAlgorithmIdentifier = AlgorithmIdentifier +public typealias BigInteger = Uint8Array +public typealias NamedCurve = String +public typealias ClipboardItemData = JSPromise +public typealias ClipboardItems = [ClipboardItem] +public typealias CookieList = [CookieListItem] +public typealias PasswordCredentialInit = __UNSUPPORTED_UNION__ +public typealias BinaryData = __UNSUPPORTED_UNION__ public typealias CSSStringSource = __UNSUPPORTED_UNION__ public typealias CSSToken = __UNSUPPORTED_UNION__ public typealias CSSUnparsedSegment = __UNSUPPORTED_UNION__ @@ -39,51 +24,80 @@ public typealias CSSColorRGBComp = __UNSUPPORTED_UNION__ public typealias CSSColorPercent = __UNSUPPORTED_UNION__ public typealias CSSColorNumber = __UNSUPPORTED_UNION__ public typealias CSSColorAngle = __UNSUPPORTED_UNION__ -public typealias PasswordCredentialInit = __UNSUPPORTED_UNION__ -public typealias ClipboardItemData = JSPromise -public typealias ClipboardItems = [ClipboardItem] -public typealias UUID = String -public typealias BluetoothServiceUUID = __UNSUPPORTED_UNION__ -public typealias BluetoothCharacteristicUUID = __UNSUPPORTED_UNION__ -public typealias BluetoothDescriptorUUID = __UNSUPPORTED_UNION__ +public typealias GeometryNode = __UNSUPPORTED_UNION__ +public typealias HeadersInit = __UNSUPPORTED_UNION__ +public typealias XMLHttpRequestBodyInit = __UNSUPPORTED_UNION__ +public typealias BodyInit = __UNSUPPORTED_UNION__ +public typealias RequestInfo = __UNSUPPORTED_UNION__ +public typealias FileSystemWriteChunkType = __UNSUPPORTED_UNION__ +public typealias StartInDirectory = __UNSUPPORTED_UNION__ +public typealias DOMHighResTimeStamp = Double +public typealias EpochTimeStamp = UInt64 +public typealias HTMLOrSVGScriptElement = __UNSUPPORTED_UNION__ +public typealias MediaProvider = __UNSUPPORTED_UNION__ +public typealias RenderingContext = __UNSUPPORTED_UNION__ +public typealias HTMLOrSVGImageElement = __UNSUPPORTED_UNION__ +public typealias CanvasImageSource = __UNSUPPORTED_UNION__ +public typealias CanvasFilterInput = [String: JSValue] +public typealias OffscreenRenderingContext = __UNSUPPORTED_UNION__ +public typealias EventHandler = EventHandlerNonNull? +public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? +public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? +public typealias TimerHandler = __UNSUPPORTED_UNION__ +public typealias ImageBitmapSource = __UNSUPPORTED_UNION__ +public typealias MessageEventSource = __UNSUPPORTED_UNION__ +public typealias ConstrainPoint2D = __UNSUPPORTED_UNION__ +public typealias ProfilerResource = String public typealias ConstrainULong = __UNSUPPORTED_UNION__ public typealias ConstrainDouble = __UNSUPPORTED_UNION__ public typealias ConstrainBoolean = __UNSUPPORTED_UNION__ public typealias ConstrainDOMString = __UNSUPPORTED_UNION__ -public typealias XRWebGLRenderingContext = __UNSUPPORTED_UNION__ +public typealias Megabit = Double +public typealias Millisecond = UInt64 +public typealias RotationMatrixType = __UNSUPPORTED_UNION__ +public typealias PerformanceEntryList = [PerformanceEntry] +public typealias PushMessageDataInit = __UNSUPPORTED_UNION__ +public typealias ReportList = [Report] +public typealias AttributeMatchList = [String: [String]] +public typealias ContainerBasedOffset = __UNSUPPORTED_UNION__ +public typealias ScrollTimelineOffset = __UNSUPPORTED_UNION__ +public typealias ReadableStreamReader = __UNSUPPORTED_UNION__ +public typealias ReadableStreamController = __UNSUPPORTED_UNION__ public typealias HTMLString = String public typealias ScriptString = String public typealias ScriptURLString = String public typealias TrustedType = __UNSUPPORTED_UNION__ -public typealias FormDataEntryValue = __UNSUPPORTED_UNION__ -public typealias PerformanceEntryList = [PerformanceEntry] -public typealias ConstrainPoint2D = __UNSUPPORTED_UNION__ -public typealias AttributeMatchList = [String: [String]] -public typealias GeometryNode = __UNSUPPORTED_UNION__ -public typealias ImageBufferSource = __UNSUPPORTED_UNION__ -public typealias GLuint64EXT = UInt64 -public typealias MLNamedOperands = [String: MLOperand] -public typealias MLBufferView = __UNSUPPORTED_UNION__ -public typealias MLResource = __UNSUPPORTED_UNION__ -public typealias MLNamedInputs = [String: __UNSUPPORTED_UNION__] -public typealias MLNamedOutputs = [String: MLResource] public typealias URLPatternInput = __UNSUPPORTED_UNION__ -public typealias ContainerBasedOffset = __UNSUPPORTED_UNION__ -public typealias ScrollTimelineOffset = __UNSUPPORTED_UNION__ -public typealias DOMHighResTimeStamp = Double -public typealias EpochTimeStamp = UInt64 -public typealias PushMessageDataInit = __UNSUPPORTED_UNION__ -public typealias ProfilerResource = String -public typealias ReportList = [Report] -public typealias CookieList = [CookieListItem] -public typealias BlobPart = __UNSUPPORTED_UNION__ +public typealias VibratePattern = __UNSUPPORTED_UNION__ +public typealias UUID = String +public typealias BluetoothServiceUUID = __UNSUPPORTED_UNION__ +public typealias BluetoothCharacteristicUUID = __UNSUPPORTED_UNION__ +public typealias BluetoothDescriptorUUID = __UNSUPPORTED_UNION__ +public typealias NDEFMessageSource = __UNSUPPORTED_UNION__ public typealias COSEAlgorithmIdentifier = Int32 public typealias UvmEntry = [UInt32] public typealias UvmEntries = [UvmEntry] -public typealias AlgorithmIdentifier = __UNSUPPORTED_UNION__ -public typealias HashAlgorithmIdentifier = AlgorithmIdentifier -public typealias BigInteger = Uint8Array -public typealias NamedCurve = String +public typealias ImageBufferSource = __UNSUPPORTED_UNION__ +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 TexImageSource = __UNSUPPORTED_UNION__ +public typealias Float32List = __UNSUPPORTED_UNION__ +public typealias Int32List = __UNSUPPORTED_UNION__ +public typealias GLint64 = Int64 +public typealias GLuint64 = UInt64 +public typealias Uint32List = __UNSUPPORTED_UNION__ public typealias GPUBufferUsageFlags = UInt32 public typealias GPUMapModeFlags = UInt32 public typealias GPUTextureUsageFlags = UInt32 @@ -108,63 +122,29 @@ public typealias GPUColor = __UNSUPPORTED_UNION__ public typealias GPUOrigin2D = __UNSUPPORTED_UNION__ public typealias GPUOrigin3D = __UNSUPPORTED_UNION__ public typealias GPUExtent3D = __UNSUPPORTED_UNION__ -public typealias HTMLOrSVGScriptElement = __UNSUPPORTED_UNION__ -public typealias MediaProvider = __UNSUPPORTED_UNION__ -public typealias RenderingContext = __UNSUPPORTED_UNION__ -public typealias HTMLOrSVGImageElement = __UNSUPPORTED_UNION__ -public typealias CanvasImageSource = __UNSUPPORTED_UNION__ -public typealias CanvasFilterInput = [String: JSValue] -public typealias OffscreenRenderingContext = __UNSUPPORTED_UNION__ -public typealias EventHandler = EventHandlerNonNull? -public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? -public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? -public typealias TimerHandler = __UNSUPPORTED_UNION__ -public typealias ImageBitmapSource = __UNSUPPORTED_UNION__ -public typealias MessageEventSource = __UNSUPPORTED_UNION__ -public typealias GLint64 = Int64 -public typealias GLuint64 = UInt64 -public typealias Uint32List = __UNSUPPORTED_UNION__ -public typealias BinaryData = __UNSUPPORTED_UNION__ -public typealias ReadableStreamReader = __UNSUPPORTED_UNION__ -public typealias ReadableStreamController = __UNSUPPORTED_UNION__ -public typealias NDEFMessageSource = __UNSUPPORTED_UNION__ -public typealias Megabit = Double -public typealias Millisecond = UInt64 -public typealias FileSystemWriteChunkType = __UNSUPPORTED_UNION__ -public typealias StartInDirectory = __UNSUPPORTED_UNION__ public typealias ArrayBufferView = __UNSUPPORTED_UNION__ public typealias BufferSource = __UNSUPPORTED_UNION__ public typealias DOMTimeStamp = UInt64 -public typealias VibratePattern = __UNSUPPORTED_UNION__ -public typealias LockGrantedCallback = (Lock?) -> JSPromise -public typealias VideoFrameRequestCallback = (DOMHighResTimeStamp, VideoFrameMetadata) -> Void -public typealias NavigatorUserMediaSuccessCallback = (MediaStream) -> Void -public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void -public typealias XRFrameRequestCallback = (DOMHighResTimeStamp, XRFrame) -> Void -public typealias NotificationPermissionCallback = (NotificationPermission) -> Void -public typealias CreateHTMLCallback = (String, JSValue...) -> String -public typealias CreateScriptCallback = (String, JSValue...) -> String -public typealias CreateScriptURLCallback = (String, JSValue...) -> String -public typealias PerformanceObserverCallback = (PerformanceObserverEntryList, PerformanceObserver, PerformanceObserverCallbackOptions) -> Void -public typealias RemotePlaybackAvailabilityCallback = (Bool) -> Void -public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void -public typealias MediaSessionActionHandler = (MediaSessionActionDetails) -> 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 typealias RTCPeerConnectionErrorCallback = (DOMException) -> Void -public typealias RTCSessionDescriptionCallback = (RTCSessionDescriptionInit) -> Void +public typealias MLNamedOperands = [String: MLOperand] +public typealias MLBufferView = __UNSUPPORTED_UNION__ +public typealias MLResource = __UNSUPPORTED_UNION__ +public typealias MLNamedInputs = [String: __UNSUPPORTED_UNION__] +public typealias MLNamedOutputs = [String: MLResource] +public typealias RTCRtpTransform = __UNSUPPORTED_UNION__ +public typealias SmallCryptoKeyID = UInt64 +public typealias CryptoKeyID = __UNSUPPORTED_UNION__ +public typealias LineAndPositionSetting = __UNSUPPORTED_UNION__ +public typealias XRWebGLRenderingContext = __UNSUPPORTED_UNION__ +public typealias FormDataEntryValue = __UNSUPPORTED_UNION__ public typealias ComputePressureUpdateCallback = ([ComputePressureRecord], ComputePressureObserver) -> Void -public typealias ReportingObserverCallback = ([Report], ReportingObserver) -> Void -public typealias ResizeObserverCallback = ([ResizeObserverEntry], ResizeObserver) -> Void public typealias AnimatorInstanceConstructor = (JSValue, JSValue) -> JSValue +public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void public typealias ErrorCallback = (DOMException) -> Void public typealias FileSystemEntryCallback = (FileSystemEntry) -> Void public typealias FileSystemEntriesCallback = ([FileSystemEntry]) -> Void public typealias FileCallback = (File) -> Void -public typealias SchedulerPostTaskCallback = () -> JSValue +public typealias PositionCallback = (GeolocationPosition) -> Void +public typealias PositionErrorCallback = (GeolocationPositionError) -> Void public typealias BlobCallback = (Blob?) -> Void public typealias CustomElementConstructor = () -> HTMLElement public typealias FunctionStringCallback = (String) -> Void @@ -172,6 +152,17 @@ public typealias EventHandlerNonNull = (Event) -> JSValue public typealias OnErrorEventHandlerNonNull = (__UNSUPPORTED_UNION__, String, UInt32, UInt32, JSValue) -> JSValue public typealias OnBeforeUnloadEventHandlerNonNull = (Event) -> String? public typealias FrameRequestCallback = (DOMHighResTimeStamp) -> Void +public typealias IntersectionObserverCallback = ([IntersectionObserverEntry], IntersectionObserver) -> Void +public typealias NavigatorUserMediaSuccessCallback = (MediaStream) -> Void +public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void +public typealias MediaSessionActionHandler = (MediaSessionActionDetails) -> Void +public typealias NotificationPermissionCallback = (NotificationPermission) -> Void +public typealias PerformanceObserverCallback = (PerformanceObserverEntryList, PerformanceObserver, PerformanceObserverCallbackOptions) -> Void +public typealias RemotePlaybackAvailabilityCallback = (Bool) -> Void +public typealias ReportingObserverCallback = ([Report], ReportingObserver) -> Void +public typealias IdleRequestCallback = (IdleDeadline) -> Void +public typealias ResizeObserverCallback = ([ResizeObserverEntry], ResizeObserver) -> Void +public typealias SchedulerPostTaskCallback = () -> JSValue public typealias UnderlyingSourceStartCallback = (ReadableStreamController) -> JSValue public typealias UnderlyingSourcePullCallback = (ReadableStreamController) -> JSPromise public typealias UnderlyingSourceCancelCallback = (JSValue) -> JSPromise @@ -183,15 +174,24 @@ public typealias TransformerStartCallback = (TransformStreamDefaultController) - public typealias TransformerFlushCallback = (TransformStreamDefaultController) -> JSPromise public typealias TransformerTransformCallback = (JSValue, TransformStreamDefaultController) -> JSPromise public typealias QueuingStrategySize = (JSValue) -> Double +public typealias CreateHTMLCallback = (String, JSValue...) -> String +public typealias CreateScriptCallback = (String, JSValue...) -> String +public typealias CreateScriptURLCallback = (String, JSValue...) -> String +public typealias VideoFrameRequestCallback = (DOMHighResTimeStamp, VideoFrameMetadata) -> Void +public typealias EffectCallback = (Double?, __UNSUPPORTED_UNION__, Animation) -> Void +public typealias LockGrantedCallback = (Lock?) -> JSPromise public typealias DecodeErrorCallback = (DOMException) -> Void public typealias DecodeSuccessCallback = (AudioBuffer) -> Void public typealias AudioWorkletProcessorConstructor = (JSObject) -> AudioWorkletProcessor public typealias AudioWorkletProcessCallback = ([[Float32Array]], [[Float32Array]], JSObject) -> Bool +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 typealias VoidFunction = () -> Void public typealias GenerateAssertionCallback = (String, String, RTCIdentityProviderOptions) -> JSPromise public typealias ValidateAssertionCallback = (String, String) -> JSPromise -public typealias PositionCallback = (GeolocationPosition) -> Void -public typealias PositionErrorCallback = (GeolocationPositionError) -> Void -public typealias IntersectionObserverCallback = ([IntersectionObserverEntry], IntersectionObserver) -> Void -public typealias VoidFunction = () -> Void -public typealias EffectCallback = (Double?, __UNSUPPORTED_UNION__, Animation) -> Void -public typealias IdleRequestCallback = (IdleDeadline) -> Void +public typealias RTCPeerConnectionErrorCallback = (DOMException) -> Void +public typealias RTCSessionDescriptionCallback = (RTCSessionDescriptionInit) -> Void +public typealias XRFrameRequestCallback = (DOMHighResTimeStamp, XRFrame) -> Void diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index 837a531b..5257eebf 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -24,6 +24,14 @@ public class URL: JSBridgedClass { self.jsObject = jsObject } + public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { + constructor[Strings.createObjectURL]!(obj.jsValue()).fromJSValue()! + } + + public static func revokeObjectURL(url: String) { + _ = constructor[Strings.revokeObjectURL]!(url.jsValue()) + } + public convenience init(url: String, base: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), base?.jsValue() ?? .undefined)) } @@ -67,12 +75,4 @@ public class URL: JSBridgedClass { public func toJSON() -> String { jsObject[Strings.toJSON]!().fromJSValue()! } - - public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { - constructor[Strings.createObjectURL]!(obj.jsValue()).fromJSValue()! - } - - public static func revokeObjectURL(url: String) { - _ = constructor[Strings.revokeObjectURL]!(url.jsValue()) - } } diff --git a/Sources/DOMKit/WebIDL/VideoTrack.swift b/Sources/DOMKit/WebIDL/VideoTrack.swift index dc42e3bd..74076918 100644 --- a/Sources/DOMKit/WebIDL/VideoTrack.swift +++ b/Sources/DOMKit/WebIDL/VideoTrack.swift @@ -9,18 +9,15 @@ public class VideoTrack: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) _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) + _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) self.jsObject = jsObject } - @ReadonlyAttribute - public var sourceBuffer: SourceBuffer? - @ReadonlyAttribute public var id: String @@ -35,4 +32,7 @@ public class VideoTrack: JSBridgedClass { @ReadWriteAttribute public var selected: Bool + + @ReadonlyAttribute + public var sourceBuffer: SourceBuffer? } diff --git a/Sources/DOMKit/WebIDL/WebAssembly.swift b/Sources/DOMKit/WebIDL/WebAssembly.swift index a3e22f0f..7e955997 100644 --- a/Sources/DOMKit/WebIDL/WebAssembly.swift +++ b/Sources/DOMKit/WebIDL/WebAssembly.swift @@ -8,26 +8,6 @@ public enum WebAssembly { JSObject.global[Strings.WebAssembly].object! } - public static func compileStreaming(source: JSPromise) -> JSPromise { - JSObject.global[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func compileStreaming(source: JSPromise) async throws -> Module { - let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) -> JSPromise { - JSObject.global[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { - let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - public static func validate(bytes: BufferSource) -> Bool { JSObject.global[Strings.WebAssembly].object![Strings.validate]!(bytes.jsValue()).fromJSValue()! } @@ -61,4 +41,24 @@ public enum WebAssembly { let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.instantiate]!(moduleObject.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! return try await _promise.get().fromJSValue()! } + + public static func compileStreaming(source: JSPromise) -> JSPromise { + JSObject.global[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func compileStreaming(source: JSPromise) async throws -> Module { + let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) -> JSPromise { + JSObject.global[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { + let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index b21e6d20..8c6bf331 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -7,13 +7,10 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind override public class var constructor: JSFunction { JSObject.global[Strings.Window].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _ondeviceorientation = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientation) - _ondeviceorientationabsolute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientationabsolute) - _oncompassneedscalibration = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompassneedscalibration) - _ondevicemotion = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicemotion) _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) _onorientationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onorientationchange) - _event = ReadonlyAttribute(jsObject: jsObject, name: Strings.event) + _attributionReporting = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributionReporting) + _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) _screen = ReadonlyAttribute(jsObject: jsObject, name: Strings.screen) _innerWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.innerWidth) _innerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.innerHeight) @@ -28,11 +25,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind _outerWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.outerWidth) _outerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.outerHeight) _devicePixelRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePixelRatio) - _attributionReporting = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributionReporting) - _speechSynthesis = ReadonlyAttribute(jsObject: jsObject, name: Strings.speechSynthesis) - _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) - _onappinstalled = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onappinstalled) - _onbeforeinstallprompt = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbeforeinstallprompt) + _event = ReadonlyAttribute(jsObject: jsObject, name: Strings.event) _window = ReadonlyAttribute(jsObject: jsObject, name: Strings.window) _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) _document = ReadonlyAttribute(jsObject: jsObject, name: Strings.document) @@ -58,36 +51,34 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind _clientInformation = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientInformation) _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: Strings.originAgentCluster) _external = ReadonlyAttribute(jsObject: jsObject, name: Strings.external) - _portalHost = ReadonlyAttribute(jsObject: jsObject, name: Strings.portalHost) + _onappinstalled = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onappinstalled) + _onbeforeinstallprompt = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbeforeinstallprompt) _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) + _ondeviceorientation = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientation) + _ondeviceorientationabsolute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientationabsolute) + _oncompassneedscalibration = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompassneedscalibration) + _ondevicemotion = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicemotion) + _portalHost = ReadonlyAttribute(jsObject: jsObject, name: Strings.portalHost) + _speechSynthesis = ReadonlyAttribute(jsObject: jsObject, name: Strings.speechSynthesis) _visualViewport = ReadonlyAttribute(jsObject: jsObject, name: Strings.visualViewport) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 - public var ondeviceorientation: EventHandler - - @ClosureAttribute.Optional1 - public var ondeviceorientationabsolute: EventHandler - - @ClosureAttribute.Optional1 - public var oncompassneedscalibration: EventHandler - - @ClosureAttribute.Optional1 - public var ondevicemotion: EventHandler - @ReadonlyAttribute public var orientation: Int16 @ClosureAttribute.Optional1 public var onorientationchange: EventHandler - public func getSelection() -> Selection? { - jsObject[Strings.getSelection]!().fromJSValue()! - } + @ReadonlyAttribute + public var attributionReporting: AttributionReporting @ReadonlyAttribute - public var event: __UNSUPPORTED_UNION__ + public var cookieStore: CookieStore + + public func navigate(dir: SpatialNavigationDirection) { + _ = jsObject[Strings.navigate]!(dir.jsValue()) + } public func matchMedia(query: String) -> MediaQueryList { jsObject[Strings.matchMedia]!(query.jsValue()).fromJSValue()! @@ -175,6 +166,10 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var devicePixelRatio: Double + public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { + jsObject[Strings.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! + } + public func getDigitalGoodsService(serviceProvider: String) -> JSPromise { jsObject[Strings.getDigitalGoodsService]!(serviceProvider.jsValue()).fromJSValue()! } @@ -186,19 +181,37 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind } @ReadonlyAttribute - public var attributionReporting: AttributionReporting + public var event: __UNSUPPORTED_UNION__ - @ReadonlyAttribute - public var speechSynthesis: SpeechSynthesis + public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { + jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + } - @ReadonlyAttribute - public var cookieStore: CookieStore + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { + let _promise: JSPromise = jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } - @ClosureAttribute.Optional1 - public var onappinstalled: EventHandler + public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { + jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + } - @ClosureAttribute.Optional1 - public var onbeforeinstallprompt: EventHandler + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { + let _promise: JSPromise = jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { + jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { + let _promise: JSPromise = jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } @ReadonlyAttribute public var window: WindowProxy @@ -335,58 +348,43 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var external: External + @ClosureAttribute.Optional1 + public var onappinstalled: EventHandler + + @ClosureAttribute.Optional1 + public var onbeforeinstallprompt: EventHandler + @ReadonlyAttribute - public var portalHost: PortalHost? + public var navigation: Navigation - public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { - jsObject[Strings.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! - } + @ClosureAttribute.Optional1 + public var ondeviceorientation: EventHandler - public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { - jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - } + @ClosureAttribute.Optional1 + public var ondeviceorientationabsolute: EventHandler - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { - let _promise: JSPromise = jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + @ClosureAttribute.Optional1 + public var oncompassneedscalibration: EventHandler - public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { - jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - } + @ClosureAttribute.Optional1 + public var ondevicemotion: EventHandler - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { - let _promise: JSPromise = jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } + @ReadonlyAttribute + public var portalHost: PortalHost? - public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { - jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - } + // XXX: member 'requestIdleCallback' is ignored - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { - let _promise: JSPromise = jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! + public func cancelIdleCallback(handle: UInt32) { + _ = jsObject[Strings.cancelIdleCallback]!(handle.jsValue()) } - public func navigate(dir: SpatialNavigationDirection) { - _ = jsObject[Strings.navigate]!(dir.jsValue()) + public func getSelection() -> Selection? { + jsObject[Strings.getSelection]!().fromJSValue()! } @ReadonlyAttribute - public var navigation: Navigation + public var speechSynthesis: SpeechSynthesis @ReadonlyAttribute public var visualViewport: VisualViewport - - public func requestIdleCallback(callback: IdleRequestCallback, options: IdleRequestOptions? = nil) -> UInt32 { - jsObject[Strings.requestIdleCallback]!(callback.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! - } - - public func cancelIdleCallback(handle: UInt32) { - _ = jsObject[Strings.cancelIdleCallback]!(handle.jsValue()) - } } diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index d6e3b013..fc156d30 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -5,6 +5,10 @@ import JavaScriptKit public protocol WindowOrWorkerGlobalScope: JSBridgedClass {} public extension WindowOrWorkerGlobalScope { + var indexedDB: IDBFactory { ReadonlyAttribute[Strings.indexedDB, in: jsObject] } + + var crypto: Crypto { ReadonlyAttribute[Strings.crypto, in: jsObject] } + func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { jsObject[Strings.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! } @@ -15,16 +19,8 @@ public extension WindowOrWorkerGlobalScope { return try await _promise.get().fromJSValue()! } - var indexedDB: IDBFactory { ReadonlyAttribute[Strings.indexedDB, in: jsObject] } - - var trustedTypes: TrustedTypePolicyFactory { ReadonlyAttribute[Strings.trustedTypes, in: jsObject] } - var performance: Performance { ReadonlyAttribute[Strings.performance, in: jsObject] } - var crypto: Crypto { ReadonlyAttribute[Strings.crypto, in: jsObject] } - - var scheduler: Scheduler { ReadonlyAttribute[Strings.scheduler, in: jsObject] } - var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } var isSecureContext: Bool { ReadonlyAttribute[Strings.isSecureContext, in: jsObject] } @@ -99,5 +95,9 @@ public extension WindowOrWorkerGlobalScope { var originPolicyIds: [String] { ReadonlyAttribute[Strings.originPolicyIds, in: jsObject] } + var scheduler: Scheduler { ReadonlyAttribute[Strings.scheduler, in: jsObject] } + var caches: CacheStorage { ReadonlyAttribute[Strings.caches, in: jsObject] } + + var trustedTypes: TrustedTypePolicyFactory { ReadonlyAttribute[Strings.trustedTypes, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index 3e4c639e..f93d024c 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class WorkerGlobalScope: EventTarget, WindowOrWorkerGlobalScope, FontFaceSource { +public class WorkerGlobalScope: EventTarget, FontFaceSource, WindowOrWorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global[Strings.WorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/WorkerNavigator.swift b/Sources/DOMKit/WebIDL/WorkerNavigator.swift index 305d8dc6..100dfc77 100644 --- a/Sources/DOMKit/WebIDL/WorkerNavigator.swift +++ b/Sources/DOMKit/WebIDL/WorkerNavigator.swift @@ -3,28 +3,28 @@ import JavaScriptEventLoop import JavaScriptKit -public class WorkerNavigator: JSBridgedClass, NavigatorLocks, NavigatorML, NavigatorDeviceMemory, NavigatorStorage, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware, NavigatorBadge, NavigatorNetworkInformation, NavigatorUA { +public class WorkerNavigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware, NavigatorNetworkInformation, NavigatorStorage, NavigatorUA, NavigatorLocks, NavigatorGPU, NavigatorML { public class var constructor: JSFunction { JSObject.global[Strings.WorkerNavigator].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) _serial = ReadonlyAttribute(jsObject: jsObject, name: Strings.serial) - _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) self.jsObject = jsObject } @ReadonlyAttribute - public var permissions: Permissions + public var mediaCapabilities: MediaCapabilities @ReadonlyAttribute - public var serial: Serial + public var permissions: Permissions @ReadonlyAttribute - public var mediaCapabilities: MediaCapabilities + public var serial: Serial @ReadonlyAttribute public var serviceWorker: ServiceWorkerContainer diff --git a/Sources/DOMKit/WebIDL/XRFrame.swift b/Sources/DOMKit/WebIDL/XRFrame.swift index 78569a65..d6bf81dd 100644 --- a/Sources/DOMKit/WebIDL/XRFrame.swift +++ b/Sources/DOMKit/WebIDL/XRFrame.swift @@ -9,38 +9,12 @@ public class XRFrame: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _trackedAnchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.trackedAnchors) _session = ReadonlyAttribute(jsObject: jsObject, name: Strings.session) _predictedDisplayTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.predictedDisplayTime) - _trackedAnchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.trackedAnchors) self.jsObject = jsObject } - public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { - jsObject[Strings.getHitTestResults]!(hitTestSource.jsValue()).fromJSValue()! - } - - public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { - jsObject[Strings.getHitTestResultsForTransientInput]!(hitTestSource.jsValue()).fromJSValue()! - } - - @ReadonlyAttribute - public var session: XRSession - - @ReadonlyAttribute - public var predictedDisplayTime: DOMHighResTimeStamp - - public func getViewerPose(referenceSpace: XRReferenceSpace) -> XRViewerPose? { - jsObject[Strings.getViewerPose]!(referenceSpace.jsValue()).fromJSValue()! - } - - public func getPose(space: XRSpace, baseSpace: XRSpace) -> XRPose? { - jsObject[Strings.getPose]!(space.jsValue(), baseSpace.jsValue()).fromJSValue()! - } - - public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { - jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! - } - public func createAnchor(pose: XRRigidTransform, space: XRSpace) -> JSPromise { jsObject[Strings.createAnchor]!(pose.jsValue(), space.jsValue()).fromJSValue()! } @@ -54,6 +28,10 @@ public class XRFrame: JSBridgedClass { @ReadonlyAttribute public var trackedAnchors: XRAnchorSet + public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { + jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! + } + public func getJointPose(joint: XRJointSpace, baseSpace: XRSpace) -> XRJointPose? { jsObject[Strings.getJointPose]!(joint.jsValue(), baseSpace.jsValue()).fromJSValue()! } @@ -66,7 +44,29 @@ public class XRFrame: JSBridgedClass { jsObject[Strings.fillPoses]!(spaces.jsValue(), baseSpace.jsValue(), transforms.jsValue()).fromJSValue()! } + public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { + jsObject[Strings.getHitTestResults]!(hitTestSource.jsValue()).fromJSValue()! + } + + public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { + jsObject[Strings.getHitTestResultsForTransientInput]!(hitTestSource.jsValue()).fromJSValue()! + } + public func getLightEstimate(lightProbe: XRLightProbe) -> XRLightEstimate? { jsObject[Strings.getLightEstimate]!(lightProbe.jsValue()).fromJSValue()! } + + @ReadonlyAttribute + public var session: XRSession + + @ReadonlyAttribute + public var predictedDisplayTime: DOMHighResTimeStamp + + public func getViewerPose(referenceSpace: XRReferenceSpace) -> XRViewerPose? { + jsObject[Strings.getViewerPose]!(referenceSpace.jsValue()).fromJSValue()! + } + + public func getPose(space: XRSpace, baseSpace: XRSpace) -> XRPose? { + jsObject[Strings.getPose]!(space.jsValue(), baseSpace.jsValue()).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/XRHitTestResult.swift b/Sources/DOMKit/WebIDL/XRHitTestResult.swift index 458508f2..5d50ee54 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestResult.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestResult.swift @@ -12,10 +12,6 @@ public class XRHitTestResult: JSBridgedClass { self.jsObject = jsObject } - public func getPose(baseSpace: XRSpace) -> XRPose? { - jsObject[Strings.getPose]!(baseSpace.jsValue()).fromJSValue()! - } - public func createAnchor() -> JSPromise { jsObject[Strings.createAnchor]!().fromJSValue()! } @@ -25,4 +21,8 @@ public class XRHitTestResult: JSBridgedClass { let _promise: JSPromise = jsObject[Strings.createAnchor]!().fromJSValue()! return try await _promise.get().fromJSValue()! } + + public func getPose(baseSpace: XRSpace) -> XRPose? { + jsObject[Strings.getPose]!(baseSpace.jsValue()).fromJSValue()! + } } diff --git a/Sources/DOMKit/WebIDL/XRInputSource.swift b/Sources/DOMKit/WebIDL/XRInputSource.swift index 9c17e046..b75d2320 100644 --- a/Sources/DOMKit/WebIDL/XRInputSource.swift +++ b/Sources/DOMKit/WebIDL/XRInputSource.swift @@ -9,16 +9,22 @@ public class XRInputSource: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _gamepad = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamepad) + _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) _handedness = ReadonlyAttribute(jsObject: jsObject, name: Strings.handedness) _targetRayMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetRayMode) _targetRaySpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetRaySpace) _gripSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.gripSpace) _profiles = ReadonlyAttribute(jsObject: jsObject, name: Strings.profiles) - _gamepad = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamepad) - _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) self.jsObject = jsObject } + @ReadonlyAttribute + public var gamepad: Gamepad? + + @ReadonlyAttribute + public var hand: XRHand? + @ReadonlyAttribute public var handedness: XRHandedness @@ -33,10 +39,4 @@ public class XRInputSource: JSBridgedClass { @ReadonlyAttribute public var profiles: [String] - - @ReadonlyAttribute - public var gamepad: Gamepad? - - @ReadonlyAttribute - public var hand: XRHand? } diff --git a/Sources/DOMKit/WebIDL/XRRenderState.swift b/Sources/DOMKit/WebIDL/XRRenderState.swift index 24af19c7..a3fa71f4 100644 --- a/Sources/DOMKit/WebIDL/XRRenderState.swift +++ b/Sources/DOMKit/WebIDL/XRRenderState.swift @@ -9,17 +9,14 @@ public class XRRenderState: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _layers = ReadonlyAttribute(jsObject: jsObject, name: Strings.layers) _depthNear = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthNear) _depthFar = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthFar) _inlineVerticalFieldOfView = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineVerticalFieldOfView) _baseLayer = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseLayer) + _layers = ReadonlyAttribute(jsObject: jsObject, name: Strings.layers) self.jsObject = jsObject } - @ReadonlyAttribute - public var layers: [XRLayer] - @ReadonlyAttribute public var depthNear: Double @@ -31,4 +28,7 @@ public class XRRenderState: JSBridgedClass { @ReadonlyAttribute public var baseLayer: XRWebGLLayer? + + @ReadonlyAttribute + public var layers: [XRLayer] } diff --git a/Sources/DOMKit/WebIDL/XRSession.swift b/Sources/DOMKit/WebIDL/XRSession.swift index 4f3a138c..0438b989 100644 --- a/Sources/DOMKit/WebIDL/XRSession.swift +++ b/Sources/DOMKit/WebIDL/XRSession.swift @@ -7,6 +7,12 @@ public class XRSession: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.XRSession].function! } public required init(unsafelyWrapping jsObject: JSObject) { + _environmentBlendMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.environmentBlendMode) + _interactionMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionMode) + _depthUsage = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthUsage) + _depthDataFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthDataFormat) + _domOverlayState = ReadonlyAttribute(jsObject: jsObject, name: Strings.domOverlayState) + _preferredReflectionFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.preferredReflectionFormat) _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibilityState) _frameRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameRate) _supportedFrameRates = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedFrameRates) @@ -22,15 +28,24 @@ public class XRSession: EventTarget { _onsqueezeend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsqueezeend) _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onvisibilitychange) _onframeratechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onframeratechange) - _depthUsage = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthUsage) - _depthDataFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthDataFormat) - _domOverlayState = ReadonlyAttribute(jsObject: jsObject, name: Strings.domOverlayState) - _environmentBlendMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.environmentBlendMode) - _interactionMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionMode) - _preferredReflectionFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.preferredReflectionFormat) super.init(unsafelyWrapping: jsObject) } + @ReadonlyAttribute + public var environmentBlendMode: XREnvironmentBlendMode + + @ReadonlyAttribute + public var interactionMode: XRInteractionMode + + @ReadonlyAttribute + public var depthUsage: XRDepthUsage + + @ReadonlyAttribute + public var depthDataFormat: XRDepthDataFormat + + @ReadonlyAttribute + public var domOverlayState: XRDOMOverlayState? + public func requestHitTestSource(options: XRHitTestOptionsInit) -> JSPromise { jsObject[Strings.requestHitTestSource]!(options.jsValue()).fromJSValue()! } @@ -51,6 +66,19 @@ public class XRSession: EventTarget { return try await _promise.get().fromJSValue()! } + public func requestLightProbe(options: XRLightProbeInit? = nil) -> JSPromise { + jsObject[Strings.requestLightProbe]!(options?.jsValue() ?? .undefined).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + public func requestLightProbe(options: XRLightProbeInit? = nil) async throws -> XRLightProbe { + let _promise: JSPromise = jsObject[Strings.requestLightProbe]!(options?.jsValue() ?? .undefined).fromJSValue()! + return try await _promise.get().fromJSValue()! + } + + @ReadonlyAttribute + public var preferredReflectionFormat: XRReflectionFormat + @ReadonlyAttribute public var visibilityState: XRVisibilityState @@ -135,32 +163,4 @@ public class XRSession: EventTarget { @ClosureAttribute.Optional1 public var onframeratechange: EventHandler - - @ReadonlyAttribute - public var depthUsage: XRDepthUsage - - @ReadonlyAttribute - public var depthDataFormat: XRDepthDataFormat - - @ReadonlyAttribute - public var domOverlayState: XRDOMOverlayState? - - @ReadonlyAttribute - public var environmentBlendMode: XREnvironmentBlendMode - - @ReadonlyAttribute - public var interactionMode: XRInteractionMode - - public func requestLightProbe(options: XRLightProbeInit? = nil) -> JSPromise { - jsObject[Strings.requestLightProbe]!(options?.jsValue() ?? .undefined).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestLightProbe(options: XRLightProbeInit? = nil) async throws -> XRLightProbe { - let _promise: JSPromise = jsObject[Strings.requestLightProbe]!(options?.jsValue() ?? .undefined).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @ReadonlyAttribute - public var preferredReflectionFormat: XRReflectionFormat } diff --git a/Sources/DOMKit/WebIDL/XRSessionInit.swift b/Sources/DOMKit/WebIDL/XRSessionInit.swift index e5f176ae..2ea5e3c5 100644 --- a/Sources/DOMKit/WebIDL/XRSessionInit.swift +++ b/Sources/DOMKit/WebIDL/XRSessionInit.swift @@ -4,32 +4,32 @@ import JavaScriptEventLoop import JavaScriptKit public class XRSessionInit: BridgedDictionary { - public convenience init(requiredFeatures: [JSValue], optionalFeatures: [JSValue], depthSensing: XRDepthStateInit, domOverlay: XRDOMOverlayInit?) { + public convenience init(depthSensing: XRDepthStateInit, domOverlay: XRDOMOverlayInit?, requiredFeatures: [JSValue], optionalFeatures: [JSValue]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.requiredFeatures] = requiredFeatures.jsValue() - object[Strings.optionalFeatures] = optionalFeatures.jsValue() object[Strings.depthSensing] = depthSensing.jsValue() object[Strings.domOverlay] = domOverlay.jsValue() + object[Strings.requiredFeatures] = requiredFeatures.jsValue() + object[Strings.optionalFeatures] = optionalFeatures.jsValue() self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _requiredFeatures = ReadWriteAttribute(jsObject: object, name: Strings.requiredFeatures) - _optionalFeatures = ReadWriteAttribute(jsObject: object, name: Strings.optionalFeatures) _depthSensing = ReadWriteAttribute(jsObject: object, name: Strings.depthSensing) _domOverlay = ReadWriteAttribute(jsObject: object, name: Strings.domOverlay) + _requiredFeatures = ReadWriteAttribute(jsObject: object, name: Strings.requiredFeatures) + _optionalFeatures = ReadWriteAttribute(jsObject: object, name: Strings.optionalFeatures) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var requiredFeatures: [JSValue] + public var depthSensing: XRDepthStateInit @ReadWriteAttribute - public var optionalFeatures: [JSValue] + public var domOverlay: XRDOMOverlayInit? @ReadWriteAttribute - public var depthSensing: XRDepthStateInit + public var requiredFeatures: [JSValue] @ReadWriteAttribute - public var domOverlay: XRDOMOverlayInit? + public var optionalFeatures: [JSValue] } diff --git a/Sources/DOMKit/WebIDL/XRView.swift b/Sources/DOMKit/WebIDL/XRView.swift index d1ff6289..6a74bb31 100644 --- a/Sources/DOMKit/WebIDL/XRView.swift +++ b/Sources/DOMKit/WebIDL/XRView.swift @@ -9,14 +9,17 @@ public class XRView: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _isFirstPersonObserver = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFirstPersonObserver) _eye = ReadonlyAttribute(jsObject: jsObject, name: Strings.eye) _projectionMatrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.projectionMatrix) _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) _recommendedViewportScale = ReadonlyAttribute(jsObject: jsObject, name: Strings.recommendedViewportScale) - _isFirstPersonObserver = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFirstPersonObserver) self.jsObject = jsObject } + @ReadonlyAttribute + public var isFirstPersonObserver: Bool + @ReadonlyAttribute public var eye: XREye @@ -32,7 +35,4 @@ public class XRView: JSBridgedClass { public func requestViewportScale(scale: Double?) { _ = jsObject[Strings.requestViewportScale]!(scale.jsValue()) } - - @ReadonlyAttribute - public var isFirstPersonObserver: Bool } diff --git a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift index 2ea7f805..4de48ec2 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift @@ -14,6 +14,14 @@ public class XRWebGLBinding: JSBridgedClass { self.jsObject = jsObject } + public func getDepthInformation(view: XRView) -> XRWebGLDepthInformation? { + jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! + } + + public func getReflectionCubeMap(lightProbe: XRLightProbe) -> WebGLTexture? { + jsObject[Strings.getReflectionCubeMap]!(lightProbe.jsValue()).fromJSValue()! + } + public convenience init(session: XRSession, context: XRWebGLRenderingContext) { self.init(unsafelyWrapping: Self.constructor.new(session.jsValue(), context.jsValue())) } @@ -51,12 +59,4 @@ public class XRWebGLBinding: JSBridgedClass { public func getViewSubImage(layer: XRProjectionLayer, view: XRView) -> XRWebGLSubImage { jsObject[Strings.getViewSubImage]!(layer.jsValue(), view.jsValue()).fromJSValue()! } - - public func getDepthInformation(view: XRView) -> XRWebGLDepthInformation? { - jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! - } - - public func getReflectionCubeMap(lightProbe: XRLightProbe) -> WebGLTexture? { - jsObject[Strings.getReflectionCubeMap]!(lightProbe.jsValue()).fromJSValue()! - } } diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 27bea91e..af15402a 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -26,8 +26,8 @@ enum IDLBuilder { } } - static func generateIDLBindings(idl: [String: GenericCollection]) throws { - let declarations = idl.values.flatMap(\.array) + static func generateIDLBindings(idl: [GenericCollection]) throws { + let declarations = idl.flatMap(\.array) let merged = DeclarationMerger.merge(declarations: declarations) for (i, node) in merged.declarations.enumerated() { guard let nameNode = Mirror(reflecting: node).children.first(where: { $0.label == "name" }), diff --git a/Sources/WebIDLToSwift/IDLParser.swift b/Sources/WebIDLToSwift/IDLParser.swift index eab40d7b..aa409c7d 100644 --- a/Sources/WebIDLToSwift/IDLParser.swift +++ b/Sources/WebIDLToSwift/IDLParser.swift @@ -16,9 +16,9 @@ enum IDLParser { return pipe.fileHandleForReading.readDataToEndOfFile() } - static func parseIDL() throws -> [String: GenericCollection] { + static func parseIDL() throws -> [GenericCollection] { let data = getJSONData() print("Building IDL struct tree...") - return try JSONDecoder().decode([String: GenericCollection].self, from: data) + return try JSONDecoder().decode([GenericCollection].self, from: data) } } diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js index c8b46674..ba3e659c 100644 --- a/parse-idl/parse-all.js +++ b/parse-idl/parse-all.js @@ -2,4 +2,4 @@ import { parseAll } from "@webref/idl"; import fs from "node:fs/promises"; const parsedFiles = await parseAll(); -console.log(JSON.stringify(parsedFiles, null, 2)); +console.log(JSON.stringify(Object.values(parsedFiles), null, 2)); From c8189078c44729a033ce32471cccff96cd92d79c Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 10:46:20 -0400 Subject: [PATCH 095/124] Refactor ClosureAttribute code --- Sources/DOMKit/WebIDL/AbortSignal.swift | 4 +- Sources/DOMKit/WebIDL/AbstractWorker.swift | 4 +- Sources/DOMKit/WebIDL/Animation.swift | 12 +- Sources/DOMKit/WebIDL/AudioDecoderInit.swift | 12 +- Sources/DOMKit/WebIDL/AudioEncoderInit.swift | 12 +- .../WebIDL/AudioScheduledSourceNode.swift | 4 +- Sources/DOMKit/WebIDL/AudioTrackList.swift | 12 +- Sources/DOMKit/WebIDL/AudioWorkletNode.swift | 4 +- .../WebIDL/BackgroundFetchRegistration.swift | 4 +- Sources/DOMKit/WebIDL/BaseAudioContext.swift | 4 +- Sources/DOMKit/WebIDL/BatteryManager.swift | 16 +- Sources/DOMKit/WebIDL/Bluetooth.swift | 4 +- .../WebIDL/BluetoothDeviceEventHandlers.swift | 8 +- Sources/DOMKit/WebIDL/BroadcastChannel.swift | 8 +- .../WebIDL/CharacteristicEventHandlers.swift | 4 +- Sources/DOMKit/WebIDL/CloseWatcher.swift | 8 +- Sources/DOMKit/WebIDL/ClosureAttribute.swift | 496 +++++++++--------- Sources/DOMKit/WebIDL/CookieStore.swift | 4 +- .../WebIDL/DedicatedWorkerGlobalScope.swift | 12 +- Sources/DOMKit/WebIDL/DevicePosture.swift | 4 +- Sources/DOMKit/WebIDL/Document.swift | 32 +- .../DocumentAndElementEventHandlers.swift | 12 +- Sources/DOMKit/WebIDL/EditContext.swift | 20 +- Sources/DOMKit/WebIDL/Element.swift | 8 +- Sources/DOMKit/WebIDL/EventSource.swift | 12 +- Sources/DOMKit/WebIDL/FileReader.swift | 24 +- Sources/DOMKit/WebIDL/FontFaceSet.swift | 12 +- Sources/DOMKit/WebIDL/GPUDevice.swift | 4 +- .../DOMKit/WebIDL/GlobalEventHandlers.swift | 376 ++++++------- Sources/DOMKit/WebIDL/HID.swift | 8 +- Sources/DOMKit/WebIDL/HIDDevice.swift | 4 +- Sources/DOMKit/WebIDL/HTMLBodyElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLPortalElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 8 +- Sources/DOMKit/WebIDL/IDBDatabase.swift | 16 +- Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift | 8 +- Sources/DOMKit/WebIDL/IDBRequest.swift | 8 +- Sources/DOMKit/WebIDL/IDBTransaction.swift | 12 +- Sources/DOMKit/WebIDL/IdleDetector.swift | 4 +- Sources/DOMKit/WebIDL/ImageTrack.swift | 4 +- Sources/DOMKit/WebIDL/Keyboard.swift | 4 +- Sources/DOMKit/WebIDL/MIDIAccess.swift | 4 +- Sources/DOMKit/WebIDL/MIDIInput.swift | 4 +- Sources/DOMKit/WebIDL/MIDIPort.swift | 4 +- Sources/DOMKit/WebIDL/MediaDevices.swift | 4 +- Sources/DOMKit/WebIDL/MediaKeySession.swift | 8 +- Sources/DOMKit/WebIDL/MediaQueryList.swift | 4 +- Sources/DOMKit/WebIDL/MediaRecorder.swift | 24 +- Sources/DOMKit/WebIDL/MediaSource.swift | 12 +- Sources/DOMKit/WebIDL/MediaStream.swift | 8 +- Sources/DOMKit/WebIDL/MediaStreamTrack.swift | 16 +- Sources/DOMKit/WebIDL/MessagePort.swift | 8 +- Sources/DOMKit/WebIDL/NDEFReader.swift | 8 +- Sources/DOMKit/WebIDL/Navigation.swift | 16 +- .../WebIDL/NavigationHistoryEntry.swift | 16 +- .../DOMKit/WebIDL/NetworkInformation.swift | 4 +- Sources/DOMKit/WebIDL/Notification.swift | 16 +- .../DOMKit/WebIDL/OfflineAudioContext.swift | 4 +- Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 8 +- Sources/DOMKit/WebIDL/PaymentRequest.swift | 4 +- Sources/DOMKit/WebIDL/Performance.swift | 4 +- Sources/DOMKit/WebIDL/PermissionStatus.swift | 4 +- .../WebIDL/PictureInPictureWindow.swift | 4 +- Sources/DOMKit/WebIDL/PortalHost.swift | 8 +- .../WebIDL/PresentationAvailability.swift | 4 +- .../WebIDL/PresentationConnection.swift | 16 +- .../WebIDL/PresentationConnectionList.swift | 4 +- .../DOMKit/WebIDL/PresentationRequest.swift | 4 +- Sources/DOMKit/WebIDL/QueuingStrategy.swift | 6 +- Sources/DOMKit/WebIDL/RTCDTMFSender.swift | 4 +- Sources/DOMKit/WebIDL/RTCDataChannel.swift | 24 +- Sources/DOMKit/WebIDL/RTCDtlsTransport.swift | 8 +- Sources/DOMKit/WebIDL/RTCIceTransport.swift | 20 +- .../DOMKit/WebIDL/RTCIdentityProvider.swift | 12 +- Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 36 +- Sources/DOMKit/WebIDL/RTCSctpTransport.swift | 4 +- Sources/DOMKit/WebIDL/RemotePlayback.swift | 12 +- Sources/DOMKit/WebIDL/SFrameTransform.swift | 4 +- .../DOMKit/WebIDL/SVGAnimationElement.swift | 12 +- Sources/DOMKit/WebIDL/ScreenOrientation.swift | 4 +- .../DOMKit/WebIDL/ScriptProcessorNode.swift | 4 +- Sources/DOMKit/WebIDL/Sensor.swift | 12 +- Sources/DOMKit/WebIDL/Serial.swift | 8 +- Sources/DOMKit/WebIDL/SerialPort.swift | 8 +- .../DOMKit/WebIDL/ServiceEventHandlers.swift | 12 +- Sources/DOMKit/WebIDL/ServiceWorker.swift | 4 +- .../WebIDL/ServiceWorkerContainer.swift | 12 +- .../WebIDL/ServiceWorkerGlobalScope.swift | 76 +-- .../WebIDL/ServiceWorkerRegistration.swift | 4 +- Sources/DOMKit/WebIDL/ShadowRoot.swift | 4 +- .../WebIDL/SharedWorkerGlobalScope.swift | 4 +- Sources/DOMKit/WebIDL/SourceBuffer.swift | 20 +- Sources/DOMKit/WebIDL/SourceBufferList.swift | 8 +- Sources/DOMKit/WebIDL/SpeechRecognition.swift | 44 +- Sources/DOMKit/WebIDL/SpeechSynthesis.swift | 4 +- .../WebIDL/SpeechSynthesisUtterance.swift | 28 +- Sources/DOMKit/WebIDL/TaskSignal.swift | 4 +- Sources/DOMKit/WebIDL/TextTrack.swift | 4 +- Sources/DOMKit/WebIDL/TextTrackCue.swift | 8 +- Sources/DOMKit/WebIDL/TextTrackList.swift | 12 +- Sources/DOMKit/WebIDL/Transformer.swift | 18 +- .../WebIDL/TrustedTypePolicyOptions.swift | 18 +- Sources/DOMKit/WebIDL/USB.swift | 8 +- Sources/DOMKit/WebIDL/UnderlyingSink.swift | 24 +- Sources/DOMKit/WebIDL/UnderlyingSource.swift | 18 +- Sources/DOMKit/WebIDL/VideoDecoderInit.swift | 12 +- Sources/DOMKit/WebIDL/VideoEncoderInit.swift | 12 +- Sources/DOMKit/WebIDL/VideoTrackList.swift | 12 +- Sources/DOMKit/WebIDL/VirtualKeyboard.swift | 4 +- Sources/DOMKit/WebIDL/VisualViewport.swift | 8 +- Sources/DOMKit/WebIDL/WakeLockSentinel.swift | 4 +- Sources/DOMKit/WebIDL/WebSocket.swift | 16 +- Sources/DOMKit/WebIDL/Window.swift | 28 +- .../DOMKit/WebIDL/WindowControlsOverlay.swift | 4 +- .../DOMKit/WebIDL/WindowEventHandlers.swift | 76 +-- Sources/DOMKit/WebIDL/Worker.swift | 8 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 24 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 4 +- .../WebIDL/XMLHttpRequestEventTarget.swift | 28 +- Sources/DOMKit/WebIDL/XRCubeLayer.swift | 4 +- Sources/DOMKit/WebIDL/XRCylinderLayer.swift | 4 +- Sources/DOMKit/WebIDL/XREquirectLayer.swift | 4 +- Sources/DOMKit/WebIDL/XRLightProbe.swift | 4 +- Sources/DOMKit/WebIDL/XRQuadLayer.swift | 4 +- Sources/DOMKit/WebIDL/XRReferenceSpace.swift | 4 +- Sources/DOMKit/WebIDL/XRSession.swift | 40 +- Sources/DOMKit/WebIDL/XRSystem.swift | 4 +- ...ureWrappers.swift => ClosurePattern.swift} | 12 +- Sources/WebIDLToSwift/Context.swift | 2 +- Sources/WebIDLToSwift/IDLBuilder.swift | 9 +- .../WebIDL+SwiftRepresentation.swift | 7 +- 132 files changed, 1145 insertions(+), 1157 deletions(-) rename Sources/WebIDLToSwift/{ClosureWrappers.swift => ClosurePattern.swift} (90%) diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index 50d0e34f..bc0649cc 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -9,7 +9,7 @@ public class AbortSignal: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _aborted = ReadonlyAttribute(jsObject: jsObject, name: Strings.aborted) _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) + _onabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onabort) super.init(unsafelyWrapping: jsObject) } @@ -31,6 +31,6 @@ public class AbortSignal: EventTarget { _ = jsObject[Strings.throwIfAborted]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onabort: EventHandler } diff --git a/Sources/DOMKit/WebIDL/AbstractWorker.swift b/Sources/DOMKit/WebIDL/AbstractWorker.swift index 3fee6853..259c373a 100644 --- a/Sources/DOMKit/WebIDL/AbstractWorker.swift +++ b/Sources/DOMKit/WebIDL/AbstractWorker.swift @@ -6,7 +6,7 @@ import JavaScriptKit public protocol AbstractWorker: JSBridgedClass {} public extension AbstractWorker { var onerror: EventHandler { - get { ClosureAttribute.Optional1[Strings.onerror, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onerror, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onerror, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onerror, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/Animation.swift b/Sources/DOMKit/WebIDL/Animation.swift index de6e4e1c..0c063c10 100644 --- a/Sources/DOMKit/WebIDL/Animation.swift +++ b/Sources/DOMKit/WebIDL/Animation.swift @@ -18,9 +18,9 @@ public class Animation: EventTarget { _pending = ReadonlyAttribute(jsObject: jsObject, name: Strings.pending) _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) _finished = ReadonlyAttribute(jsObject: jsObject, name: Strings.finished) - _onfinish = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfinish) - _oncancel = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncancel) - _onremove = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremove) + _onfinish = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfinish) + _oncancel = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncancel) + _onremove = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremove) super.init(unsafelyWrapping: jsObject) } @@ -61,13 +61,13 @@ public class Animation: EventTarget { @ReadonlyAttribute public var finished: JSPromise - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onfinish: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncancel: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onremove: EventHandler public func cancel() { diff --git a/Sources/DOMKit/WebIDL/AudioDecoderInit.swift b/Sources/DOMKit/WebIDL/AudioDecoderInit.swift index 893662e9..a3eb3df6 100644 --- a/Sources/DOMKit/WebIDL/AudioDecoderInit.swift +++ b/Sources/DOMKit/WebIDL/AudioDecoderInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class AudioDecoderInit: BridgedDictionary { public convenience init(output: @escaping AudioDataOutputCallback, error: @escaping WebCodecsErrorCallback) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute.Required1[Strings.output, in: object] = output - ClosureAttribute.Required1[Strings.error, in: object] = error + ClosureAttribute1[Strings.output, in: object] = output + ClosureAttribute1[Strings.error, in: object] = error self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute.Required1(jsObject: object, name: Strings.output) - _error = ClosureAttribute.Required1(jsObject: object, name: Strings.error) + _output = ClosureAttribute1(jsObject: object, name: Strings.output) + _error = ClosureAttribute1(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } - @ClosureAttribute.Required1 + @ClosureAttribute1 public var output: AudioDataOutputCallback - @ClosureAttribute.Required1 + @ClosureAttribute1 public var error: WebCodecsErrorCallback } diff --git a/Sources/DOMKit/WebIDL/AudioEncoderInit.swift b/Sources/DOMKit/WebIDL/AudioEncoderInit.swift index 76d2f55d..f3e36064 100644 --- a/Sources/DOMKit/WebIDL/AudioEncoderInit.swift +++ b/Sources/DOMKit/WebIDL/AudioEncoderInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class AudioEncoderInit: BridgedDictionary { public convenience init(output: @escaping EncodedAudioChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute.Required2[Strings.output, in: object] = output - ClosureAttribute.Required1[Strings.error, in: object] = error + ClosureAttribute2[Strings.output, in: object] = output + ClosureAttribute1[Strings.error, in: object] = error self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute.Required2(jsObject: object, name: Strings.output) - _error = ClosureAttribute.Required1(jsObject: object, name: Strings.error) + _output = ClosureAttribute2(jsObject: object, name: Strings.output) + _error = ClosureAttribute1(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } - @ClosureAttribute.Required2 + @ClosureAttribute2 public var output: EncodedAudioChunkOutputCallback - @ClosureAttribute.Required1 + @ClosureAttribute1 public var error: WebCodecsErrorCallback } diff --git a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift index c2dcfb14..3a77662f 100644 --- a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift +++ b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift @@ -7,11 +7,11 @@ public class AudioScheduledSourceNode: AudioNode { override public class var constructor: JSFunction { JSObject.global[Strings.AudioScheduledSourceNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onended = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onended) + _onended = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onended) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onended: EventHandler public func start(when: Double? = nil) { diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift index cbea3426..5d0a8d30 100644 --- a/Sources/DOMKit/WebIDL/AudioTrackList.swift +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -8,9 +8,9 @@ public class AudioTrackList: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddtrack) - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovetrack) + _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) } @@ -25,12 +25,12 @@ public class AudioTrackList: EventTarget { jsObject[Strings.getTrackById]!(id.jsValue()).fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onaddtrack: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onremovetrack: EventHandler } diff --git a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift index b33b6500..32c38177 100644 --- a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift +++ b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift @@ -9,7 +9,7 @@ public class AudioWorkletNode: AudioNode { public required init(unsafelyWrapping jsObject: JSObject) { _parameters = ReadonlyAttribute(jsObject: jsObject, name: Strings.parameters) _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) - _onprocessorerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprocessorerror) + _onprocessorerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onprocessorerror) super.init(unsafelyWrapping: jsObject) } @@ -23,6 +23,6 @@ public class AudioWorkletNode: AudioNode { @ReadonlyAttribute public var port: MessagePort - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onprocessorerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift index 9cdd9bc9..1ff20dd2 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift @@ -15,7 +15,7 @@ public class BackgroundFetchRegistration: EventTarget { _result = ReadonlyAttribute(jsObject: jsObject, name: Strings.result) _failureReason = ReadonlyAttribute(jsObject: jsObject, name: Strings.failureReason) _recordsAvailable = ReadonlyAttribute(jsObject: jsObject, name: Strings.recordsAvailable) - _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprogress) + _onprogress = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onprogress) super.init(unsafelyWrapping: jsObject) } @@ -43,7 +43,7 @@ public class BackgroundFetchRegistration: EventTarget { @ReadonlyAttribute public var recordsAvailable: Bool - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onprogress: EventHandler public func abort() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/BaseAudioContext.swift b/Sources/DOMKit/WebIDL/BaseAudioContext.swift index 63ad0fdb..7a5641bc 100644 --- a/Sources/DOMKit/WebIDL/BaseAudioContext.swift +++ b/Sources/DOMKit/WebIDL/BaseAudioContext.swift @@ -13,7 +13,7 @@ public class BaseAudioContext: EventTarget { _listener = ReadonlyAttribute(jsObject: jsObject, name: Strings.listener) _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) _audioWorklet = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioWorklet) - _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) super.init(unsafelyWrapping: jsObject) } @@ -35,7 +35,7 @@ public class BaseAudioContext: EventTarget { @ReadonlyAttribute public var audioWorklet: AudioWorklet - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstatechange: EventHandler public func createAnalyser() -> AnalyserNode { diff --git a/Sources/DOMKit/WebIDL/BatteryManager.swift b/Sources/DOMKit/WebIDL/BatteryManager.swift index c636dbf8..3c34299e 100644 --- a/Sources/DOMKit/WebIDL/BatteryManager.swift +++ b/Sources/DOMKit/WebIDL/BatteryManager.swift @@ -11,10 +11,10 @@ public class BatteryManager: EventTarget { _chargingTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.chargingTime) _dischargingTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.dischargingTime) _level = ReadonlyAttribute(jsObject: jsObject, name: Strings.level) - _onchargingchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchargingchange) - _onchargingtimechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchargingtimechange) - _ondischargingtimechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondischargingtimechange) - _onlevelchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onlevelchange) + _onchargingchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchargingchange) + _onchargingtimechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchargingtimechange) + _ondischargingtimechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondischargingtimechange) + _onlevelchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onlevelchange) super.init(unsafelyWrapping: jsObject) } @@ -30,15 +30,15 @@ public class BatteryManager: EventTarget { @ReadonlyAttribute public var level: Double - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchargingchange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchargingtimechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondischargingtimechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onlevelchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/Bluetooth.swift b/Sources/DOMKit/WebIDL/Bluetooth.swift index 375d8bf5..235d3d15 100644 --- a/Sources/DOMKit/WebIDL/Bluetooth.swift +++ b/Sources/DOMKit/WebIDL/Bluetooth.swift @@ -7,7 +7,7 @@ public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, Characteristi override public class var constructor: JSFunction { JSObject.global[Strings.Bluetooth].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onavailabilitychanged = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onavailabilitychanged) + _onavailabilitychanged = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onavailabilitychanged) _referringDevice = ReadonlyAttribute(jsObject: jsObject, name: Strings.referringDevice) super.init(unsafelyWrapping: jsObject) } @@ -22,7 +22,7 @@ public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, Characteristi return try await _promise.get().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onavailabilitychanged: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift b/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift index 399afe91..a6b7bb89 100644 --- a/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift @@ -6,12 +6,12 @@ import JavaScriptKit public protocol BluetoothDeviceEventHandlers: JSBridgedClass {} public extension BluetoothDeviceEventHandlers { var onadvertisementreceived: EventHandler { - get { ClosureAttribute.Optional1[Strings.onadvertisementreceived, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onadvertisementreceived, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onadvertisementreceived, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onadvertisementreceived, in: jsObject] = newValue } } var ongattserverdisconnected: EventHandler { - get { ClosureAttribute.Optional1[Strings.ongattserverdisconnected, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ongattserverdisconnected, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ongattserverdisconnected, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ongattserverdisconnected, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index 1c9ff18f..47ccc831 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -8,8 +8,8 @@ public class BroadcastChannel: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -28,9 +28,9 @@ public class BroadcastChannel: EventTarget { _ = jsObject[Strings.close]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessageerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift b/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift index 2b219ca2..18e311e2 100644 --- a/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift @@ -6,7 +6,7 @@ import JavaScriptKit public protocol CharacteristicEventHandlers: JSBridgedClass {} public extension CharacteristicEventHandlers { var oncharacteristicvaluechanged: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncharacteristicvaluechanged, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncharacteristicvaluechanged, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncharacteristicvaluechanged, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncharacteristicvaluechanged, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CloseWatcher.swift b/Sources/DOMKit/WebIDL/CloseWatcher.swift index c4533fb1..c91b0004 100644 --- a/Sources/DOMKit/WebIDL/CloseWatcher.swift +++ b/Sources/DOMKit/WebIDL/CloseWatcher.swift @@ -7,8 +7,8 @@ public class CloseWatcher: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.CloseWatcher].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _oncancel = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncancel) - _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) + _oncancel = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncancel) + _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) super.init(unsafelyWrapping: jsObject) } @@ -24,9 +24,9 @@ public class CloseWatcher: EventTarget { _ = jsObject[Strings.close]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncancel: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onclose: EventHandler } diff --git a/Sources/DOMKit/WebIDL/ClosureAttribute.swift b/Sources/DOMKit/WebIDL/ClosureAttribute.swift index 5f61e7ba..b4b6ce59 100644 --- a/Sources/DOMKit/WebIDL/ClosureAttribute.swift +++ b/Sources/DOMKit/WebIDL/ClosureAttribute.swift @@ -4,327 +4,321 @@ import JavaScriptEventLoop import JavaScriptKit /* variadic generics please */ -public enum ClosureAttribute { - // MARK: Required closures - - @propertyWrapper public final class Required0 - where ReturnType: JSValueCompatible - { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString - - public init(jsObject: JSObject, name: JSString) { - self.jsObject = jsObject - self.name = name - } +@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 var wrappedValue: () -> ReturnType { - get { Required0[name, in: jsObject] } - set { Required0[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 { - let function = jsObject[name].function! - return { function().fromJSValue()! } + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (() -> ReturnType)? { + get { + guard let function = jsObject[name].function else { + return nil } - set { + return { function().fromJSValue()! } + } + set { + if let newValue = newValue { jsObject[name] = JSClosure { _ in newValue().jsValue() }.jsValue() + } else { + jsObject[name] = .null } } } +} - @propertyWrapper public final class Required1 - where A0: JSValueCompatible, ReturnType: JSValueCompatible - { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString +@propertyWrapper public final class ClosureAttribute1 + where A0: JSValueCompatible, ReturnType: JSValueCompatible +{ + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: JSString) { - self.jsObject = jsObject - self.name = name - } + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } - @inlinable public var wrappedValue: (A0) -> ReturnType { - get { Required1[name, in: jsObject] } - set { Required1[name, in: jsObject] = newValue } - } + @inlinable public var wrappedValue: (A0) -> ReturnType { + get { ClosureAttribute1[name, in: jsObject] } + set { ClosureAttribute1[name, in: jsObject] = newValue } + } - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0) -> ReturnType { - get { - let function = jsObject[name].function! - return { function($0.jsValue()).fromJSValue()! } - } - set { - jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!).jsValue() - }.jsValue() - } + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0) -> ReturnType { + get { + let function = jsObject[name].function! + return { function($0.jsValue()).fromJSValue()! } + } + set { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!).jsValue() + }.jsValue() } } +} - @propertyWrapper public final class Required2 - where A0: JSValueCompatible, A1: JSValueCompatible, ReturnType: JSValueCompatible - { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString +@propertyWrapper public final class ClosureAttribute1Optional + where A0: JSValueCompatible, ReturnType: JSValueCompatible +{ + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: JSString) { - self.jsObject = jsObject - self.name = name - } + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } - @inlinable public var wrappedValue: (A0, A1) -> ReturnType { - get { Required2[name, in: jsObject] } - set { Required2[name, in: jsObject] = newValue } - } + @inlinable public var wrappedValue: ((A0) -> ReturnType)? { + get { ClosureAttribute1Optional[name, in: jsObject] } + set { ClosureAttribute1Optional[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()! } + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0) -> ReturnType)? { + get { + guard let function = jsObject[name].function else { + return nil } - set { + return { function($0.jsValue()).fromJSValue()! } + } + set { + if let newValue = newValue { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!).jsValue() + newValue($0[0].fromJSValue()!).jsValue() }.jsValue() + } else { + jsObject[name] = .null } } } +} - @propertyWrapper public final class Required3 - where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, ReturnType: JSValueCompatible - { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString +@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 - } + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } - @inlinable public var wrappedValue: (A0, A1, A2) -> ReturnType { - get { Required3[name, in: jsObject] } - set { Required3[name, in: jsObject] = newValue } - } + @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, A2) -> ReturnType { - get { - let function = jsObject[name].function! - return { function($0.jsValue(), $1.jsValue(), $2.jsValue()).fromJSValue()! } - } - set { - jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue() - }.jsValue() - } + @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 Required5 - where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible - { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString +@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 - } + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } - @inlinable public var wrappedValue: (A0, A1, A2, A3, A4) -> ReturnType { - get { Required5[name, in: jsObject] } - set { Required5[name, in: jsObject] = newValue } - } + @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, A2, A3, A4) -> ReturnType { - get { - let function = jsObject[name].function! - return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1) -> ReturnType)? { + get { + guard let function = jsObject[name].function else { + return nil } - set { + return { function($0.jsValue(), $1.jsValue()).fromJSValue()! } + } + set { + if let newValue = newValue { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue() + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!).jsValue() }.jsValue() + } else { + jsObject[name] = .null } } } +} - // MARK: - Optional closures +@propertyWrapper public final class ClosureAttribute3 + where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, ReturnType: JSValueCompatible +{ + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString - @propertyWrapper public final class Optional0 - where ReturnType: JSValueCompatible - { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } - public init(jsObject: JSObject, name: JSString) { - self.jsObject = jsObject - self.name = name - } + @inlinable public var wrappedValue: (A0, A1, A2) -> ReturnType { + get { ClosureAttribute3[name, in: jsObject] } + set { ClosureAttribute3[name, in: jsObject] = newValue } + } - @inlinable public var wrappedValue: (() -> ReturnType)? { - get { Optional0[name, in: jsObject] } - set { Optional0[name, in: jsObject] = newValue } + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2) -> ReturnType { + get { + let function = jsObject[name].function! + return { function($0.jsValue(), $1.jsValue(), $2.jsValue()).fromJSValue()! } } - - @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 - } - } + set { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue() + }.jsValue() } } +} - @propertyWrapper public final class Optional1 - where A0: JSValueCompatible, ReturnType: JSValueCompatible - { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString +@propertyWrapper public final class ClosureAttribute3Optional + where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, ReturnType: JSValueCompatible +{ + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: JSString) { - self.jsObject = jsObject - self.name = name - } + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } - @inlinable public var wrappedValue: ((A0) -> ReturnType)? { - get { Optional1[name, in: jsObject] } - set { Optional1[name, in: jsObject] = newValue } - } + @inlinable public var wrappedValue: ((A0, A1, A2) -> ReturnType)? { + get { ClosureAttribute3Optional[name, in: jsObject] } + set { ClosureAttribute3Optional[name, in: jsObject] = newValue } + } - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0) -> ReturnType)? { - get { - guard let function = jsObject[name].function else { - return nil - } - return { function($0.jsValue()).fromJSValue()! } + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1, A2) -> ReturnType)? { + get { + guard let function = jsObject[name].function else { + return nil } - set { - if let newValue = newValue { - jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject[name] = .null - } + return { function($0.jsValue(), $1.jsValue(), $2.jsValue()).fromJSValue()! } + } + set { + if let newValue = newValue { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue() + }.jsValue() + } else { + jsObject[name] = .null } } } +} - @propertyWrapper public final class Optional2 - 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 { Optional2[name, in: jsObject] } - set { Optional2[name, in: jsObject] = newValue } - } +@propertyWrapper public final class ClosureAttribute5 + where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible +{ + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString - @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 - } - } - } + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name } - @propertyWrapper public final class Optional3 - where A0: JSValueCompatible, A1: JSValueCompatible, A2: 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, A2, A3, A4) -> ReturnType { + get { ClosureAttribute5[name, in: jsObject] } + set { ClosureAttribute5[name, in: jsObject] = newValue } + } - @inlinable public var wrappedValue: ((A0, A1, A2) -> ReturnType)? { - get { Optional3[name, in: jsObject] } - set { Optional3[name, in: jsObject] = newValue } + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2, A3, A4) -> ReturnType { + get { + let function = jsObject[name].function! + return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } } - - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1, A2) -> ReturnType)? { - get { - guard let function = jsObject[name].function else { - return nil - } - return { function($0.jsValue(), $1.jsValue(), $2.jsValue()).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject[name] = .null - } - } + set { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue() + }.jsValue() } } +} - @propertyWrapper public final class Optional5 - where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible - { - @usableFromInline let jsObject: JSObject - @usableFromInline let name: JSString +@propertyWrapper public final class ClosureAttribute5Optional + where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible +{ + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString - public init(jsObject: JSObject, name: JSString) { - self.jsObject = jsObject - self.name = name - } + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } - @inlinable public var wrappedValue: ((A0, A1, A2, A3, A4) -> ReturnType)? { - get { Optional5[name, in: jsObject] } - set { Optional5[name, in: jsObject] = newValue } - } + @inlinable public var wrappedValue: ((A0, A1, A2, A3, A4) -> ReturnType)? { + get { ClosureAttribute5Optional[name, in: jsObject] } + set { ClosureAttribute5Optional[name, in: jsObject] = newValue } + } - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1, A2, A3, A4) -> ReturnType)? { - get { - guard let function = jsObject[name].function else { - return nil - } - return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1, A2, A3, A4) -> ReturnType)? { + get { + guard let function = jsObject[name].function else { + return nil } - set { - if let newValue = newValue { - jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue() - }.jsValue() - } else { - jsObject[name] = .null - } + return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } + } + set { + if let newValue = newValue { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue() + }.jsValue() + } else { + jsObject[name] = .null } } } diff --git a/Sources/DOMKit/WebIDL/CookieStore.swift b/Sources/DOMKit/WebIDL/CookieStore.swift index 4630151f..4aff6120 100644 --- a/Sources/DOMKit/WebIDL/CookieStore.swift +++ b/Sources/DOMKit/WebIDL/CookieStore.swift @@ -7,7 +7,7 @@ public class CookieStore: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.CookieStore].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) super.init(unsafelyWrapping: jsObject) } @@ -91,6 +91,6 @@ public class CookieStore: EventTarget { _ = try await _promise.get() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index aed3881d..70db06ab 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -8,9 +8,9 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) - _onrtctransform = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrtctransform) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) + _onrtctransform = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onrtctransform) super.init(unsafelyWrapping: jsObject) } @@ -29,12 +29,12 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid _ = jsObject[Strings.close]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessageerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onrtctransform: EventHandler } diff --git a/Sources/DOMKit/WebIDL/DevicePosture.swift b/Sources/DOMKit/WebIDL/DevicePosture.swift index 1b61b848..a7aa08b2 100644 --- a/Sources/DOMKit/WebIDL/DevicePosture.swift +++ b/Sources/DOMKit/WebIDL/DevicePosture.swift @@ -8,13 +8,13 @@ public class DevicePosture: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute public var type: DevicePostureType - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index bdc05647..264823e7 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -22,8 +22,8 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode _documentElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentElement) _fullscreenEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreenEnabled) _fullscreen = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreen) - _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) - _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) + _onfullscreenchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfullscreenchange) + _onfullscreenerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfullscreenerror) _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) _domain = ReadWriteAttribute(jsObject: jsObject, name: Strings.domain) _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) @@ -45,8 +45,8 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode _designMode = ReadWriteAttribute(jsObject: jsObject, name: Strings.designMode) _hidden = ReadonlyAttribute(jsObject: jsObject, name: Strings.hidden) _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibilityState) - _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreadystatechange) - _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onvisibilitychange) + _onreadystatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreadystatechange) + _onvisibilitychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onvisibilitychange) _fgColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.fgColor) _linkColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.linkColor) _vlinkColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.vlinkColor) @@ -55,13 +55,13 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode _anchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchors) _applets = ReadonlyAttribute(jsObject: jsObject, name: Strings.applets) _all = ReadonlyAttribute(jsObject: jsObject, name: Strings.all) - _onfreeze = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfreeze) - _onresume = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresume) + _onfreeze = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfreeze) + _onresume = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresume) _wasDiscarded = ReadonlyAttribute(jsObject: jsObject, name: Strings.wasDiscarded) _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) _pictureInPictureEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.pictureInPictureEnabled) - _onpointerlockchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockchange) - _onpointerlockerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpointerlockerror) + _onpointerlockchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpointerlockchange) + _onpointerlockerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpointerlockerror) _fragmentDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.fragmentDirective) _timeline = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeline) super.init(unsafelyWrapping: jsObject) @@ -214,10 +214,10 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode _ = try await _promise.get() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onfullscreenchange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onfullscreenerror: EventHandler @ReadonlyAttribute @@ -339,10 +339,10 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var visibilityState: DocumentVisibilityState - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onreadystatechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onvisibilitychange: EventHandler @ReadWriteAttribute @@ -381,10 +381,10 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var all: HTMLAllCollection - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onfreeze: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onresume: EventHandler @ReadonlyAttribute @@ -406,10 +406,10 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode _ = try await _promise.get() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onpointerlockchange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onpointerlockerror: EventHandler public func exitPointerLock() { diff --git a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift index 8c000a0e..ecdb3ea4 100644 --- a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift @@ -6,17 +6,17 @@ import JavaScriptKit public protocol DocumentAndElementEventHandlers: JSBridgedClass {} public extension DocumentAndElementEventHandlers { var oncopy: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncopy, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncopy, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncopy, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncopy, in: jsObject] = newValue } } var oncut: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncut, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncut, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncut, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncut, in: jsObject] = newValue } } var onpaste: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpaste, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpaste, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpaste, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpaste, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/EditContext.swift b/Sources/DOMKit/WebIDL/EditContext.swift index df2878c6..3d51a7d2 100644 --- a/Sources/DOMKit/WebIDL/EditContext.swift +++ b/Sources/DOMKit/WebIDL/EditContext.swift @@ -16,11 +16,11 @@ public class EditContext: EventTarget { _controlBound = ReadonlyAttribute(jsObject: jsObject, name: Strings.controlBound) _selectionBound = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionBound) _characterBoundsRangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.characterBoundsRangeStart) - _ontextupdate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontextupdate) - _ontextformatupdate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontextformatupdate) - _oncharacterboundsupdate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncharacterboundsupdate) - _oncompositionstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompositionstart) - _oncompositionend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompositionend) + _ontextupdate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontextupdate) + _ontextformatupdate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontextformatupdate) + _oncharacterboundsupdate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncharacterboundsupdate) + _oncompositionstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncompositionstart) + _oncompositionend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncompositionend) super.init(unsafelyWrapping: jsObject) } @@ -83,18 +83,18 @@ public class EditContext: EventTarget { jsObject[Strings.characterBounds]!().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ontextupdate: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ontextformatupdate: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncharacterboundsupdate: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncompositionstart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncompositionend: EventHandler } diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index 4ff0582c..fbd518e7 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -29,8 +29,8 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) _editContext = ReadWriteAttribute(jsObject: jsObject, name: Strings.editContext) _elementTiming = ReadWriteAttribute(jsObject: jsObject, name: Strings.elementTiming) - _onfullscreenchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenchange) - _onfullscreenerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfullscreenerror) + _onfullscreenchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfullscreenchange) + _onfullscreenerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfullscreenerror) super.init(unsafelyWrapping: jsObject) } @@ -274,10 +274,10 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc _ = try await _promise.get() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onfullscreenchange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onfullscreenerror: EventHandler public func setPointerCapture(pointerId: Int32) { diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index caea0f0a..4248bb07 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -10,9 +10,9 @@ public class EventSource: EventTarget { _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) _withCredentials = ReadonlyAttribute(jsObject: jsObject, name: Strings.withCredentials) _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) - _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onopen) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onopen = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onopen) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) super.init(unsafelyWrapping: jsObject) } @@ -35,13 +35,13 @@ public class EventSource: EventTarget { @ReadonlyAttribute public var readyState: UInt16 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onopen: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler public func close() { diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index beb092fc..7d7e6728 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -10,12 +10,12 @@ public class FileReader: EventTarget { _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) _result = ReadonlyAttribute(jsObject: jsObject, name: Strings.result) _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) - _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadstart) - _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprogress) - _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onload) - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadend) + _onloadstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloadstart) + _onprogress = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onprogress) + _onload = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onload) + _onabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onabort) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onloadend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloadend) super.init(unsafelyWrapping: jsObject) } @@ -58,21 +58,21 @@ public class FileReader: EventTarget { @ReadonlyAttribute public var error: DOMException? - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onloadstart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onprogress: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onload: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onabort: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onloadend: EventHandler } diff --git a/Sources/DOMKit/WebIDL/FontFaceSet.swift b/Sources/DOMKit/WebIDL/FontFaceSet.swift index d65d3872..383a9f26 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSet.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSet.swift @@ -7,9 +7,9 @@ public class FontFaceSet: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.FontFaceSet].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onloading = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloading) - _onloadingdone = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadingdone) - _onloadingerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadingerror) + _onloading = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloading) + _onloadingdone = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloadingdone) + _onloadingerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloadingerror) _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) super.init(unsafelyWrapping: jsObject) @@ -33,13 +33,13 @@ public class FontFaceSet: EventTarget { _ = jsObject[Strings.clear]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onloading: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onloadingdone: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onloadingerror: EventHandler public func load(font: String, text: String? = nil) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/GPUDevice.swift b/Sources/DOMKit/WebIDL/GPUDevice.swift index 9b8d2e3a..07922b83 100644 --- a/Sources/DOMKit/WebIDL/GPUDevice.swift +++ b/Sources/DOMKit/WebIDL/GPUDevice.swift @@ -11,7 +11,7 @@ public class GPUDevice: EventTarget, GPUObjectBase { _limits = ReadonlyAttribute(jsObject: jsObject, name: Strings.limits) _queue = ReadonlyAttribute(jsObject: jsObject, name: Strings.queue) _lost = ReadonlyAttribute(jsObject: jsObject, name: Strings.lost) - _onuncapturederror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onuncapturederror) + _onuncapturederror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onuncapturederror) super.init(unsafelyWrapping: jsObject) } @@ -117,6 +117,6 @@ public class GPUDevice: EventTarget, GPUObjectBase { return try await _promise.get().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onuncapturederror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index d4de471b..f3359b6f 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -6,472 +6,472 @@ import JavaScriptKit public protocol GlobalEventHandlers: JSBridgedClass {} public extension GlobalEventHandlers { var onanimationstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationstart, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onanimationstart, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onanimationstart, in: jsObject] = newValue } } var onanimationiteration: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationiteration, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onanimationiteration, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onanimationiteration, in: jsObject] = newValue } } var onanimationend: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationend, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onanimationend, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onanimationend, in: jsObject] = newValue } } var onanimationcancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onanimationcancel, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onanimationcancel, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onanimationcancel, in: jsObject] = newValue } } var ontransitionrun: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontransitionrun, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontransitionrun, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontransitionrun, in: jsObject] = newValue } } var ontransitionstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontransitionstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontransitionstart, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontransitionstart, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontransitionstart, in: jsObject] = newValue } } var ontransitionend: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontransitionend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontransitionend, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontransitionend, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontransitionend, in: jsObject] = newValue } } var ontransitioncancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontransitioncancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontransitioncancel, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontransitioncancel, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontransitioncancel, in: jsObject] = newValue } } var onabort: EventHandler { - get { ClosureAttribute.Optional1[Strings.onabort, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onabort, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onabort, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onabort, in: jsObject] = newValue } } var onauxclick: EventHandler { - get { ClosureAttribute.Optional1[Strings.onauxclick, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onauxclick, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onauxclick, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onauxclick, in: jsObject] = newValue } } var onblur: EventHandler { - get { ClosureAttribute.Optional1[Strings.onblur, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onblur, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onblur, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onblur, in: jsObject] = newValue } } var oncancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncancel, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncancel, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncancel, in: jsObject] = newValue } } var oncanplay: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncanplay, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncanplay, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncanplay, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncanplay, in: jsObject] = newValue } } var oncanplaythrough: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncanplaythrough, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncanplaythrough, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncanplaythrough, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncanplaythrough, in: jsObject] = newValue } } var onchange: EventHandler { - get { ClosureAttribute.Optional1[Strings.onchange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onchange, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onchange, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onchange, in: jsObject] = newValue } } var onclick: EventHandler { - get { ClosureAttribute.Optional1[Strings.onclick, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onclick, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onclick, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onclick, in: jsObject] = newValue } } var onclose: EventHandler { - get { ClosureAttribute.Optional1[Strings.onclose, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onclose, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onclose, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onclose, in: jsObject] = newValue } } var oncontextlost: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncontextlost, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncontextlost, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncontextlost, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncontextlost, in: jsObject] = newValue } } var oncontextmenu: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncontextmenu, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncontextmenu, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncontextmenu, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncontextmenu, in: jsObject] = newValue } } var oncontextrestored: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncontextrestored, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncontextrestored, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncontextrestored, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncontextrestored, in: jsObject] = newValue } } var oncuechange: EventHandler { - get { ClosureAttribute.Optional1[Strings.oncuechange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oncuechange, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oncuechange, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oncuechange, in: jsObject] = newValue } } var ondblclick: EventHandler { - get { ClosureAttribute.Optional1[Strings.ondblclick, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ondblclick, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ondblclick, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ondblclick, in: jsObject] = newValue } } var ondrag: EventHandler { - get { ClosureAttribute.Optional1[Strings.ondrag, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ondrag, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ondrag, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ondrag, in: jsObject] = newValue } } var ondragend: EventHandler { - get { ClosureAttribute.Optional1[Strings.ondragend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ondragend, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ondragend, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ondragend, in: jsObject] = newValue } } var ondragenter: EventHandler { - get { ClosureAttribute.Optional1[Strings.ondragenter, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ondragenter, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ondragenter, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ondragenter, in: jsObject] = newValue } } var ondragleave: EventHandler { - get { ClosureAttribute.Optional1[Strings.ondragleave, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ondragleave, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ondragleave, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ondragleave, in: jsObject] = newValue } } var ondragover: EventHandler { - get { ClosureAttribute.Optional1[Strings.ondragover, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ondragover, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ondragover, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ondragover, in: jsObject] = newValue } } var ondragstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.ondragstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ondragstart, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ondragstart, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ondragstart, in: jsObject] = newValue } } var ondrop: EventHandler { - get { ClosureAttribute.Optional1[Strings.ondrop, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ondrop, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ondrop, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ondrop, in: jsObject] = newValue } } var ondurationchange: EventHandler { - get { ClosureAttribute.Optional1[Strings.ondurationchange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ondurationchange, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ondurationchange, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ondurationchange, in: jsObject] = newValue } } var onemptied: EventHandler { - get { ClosureAttribute.Optional1[Strings.onemptied, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onemptied, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onemptied, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onemptied, in: jsObject] = newValue } } var onended: EventHandler { - get { ClosureAttribute.Optional1[Strings.onended, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onended, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onended, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onended, in: jsObject] = newValue } } var onerror: OnErrorEventHandler { - get { ClosureAttribute.Optional5[Strings.onerror, in: jsObject] } - set { ClosureAttribute.Optional5[Strings.onerror, in: jsObject] = newValue } + get { ClosureAttribute5Optional[Strings.onerror, in: jsObject] } + set { ClosureAttribute5Optional[Strings.onerror, in: jsObject] = newValue } } var onfocus: EventHandler { - get { ClosureAttribute.Optional1[Strings.onfocus, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onfocus, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onfocus, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onfocus, in: jsObject] = newValue } } var onformdata: EventHandler { - get { ClosureAttribute.Optional1[Strings.onformdata, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onformdata, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onformdata, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onformdata, in: jsObject] = newValue } } var oninput: EventHandler { - get { ClosureAttribute.Optional1[Strings.oninput, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oninput, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oninput, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oninput, in: jsObject] = newValue } } var oninvalid: EventHandler { - get { ClosureAttribute.Optional1[Strings.oninvalid, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.oninvalid, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.oninvalid, in: jsObject] } + set { ClosureAttribute1Optional[Strings.oninvalid, in: jsObject] = newValue } } var onkeydown: EventHandler { - get { ClosureAttribute.Optional1[Strings.onkeydown, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onkeydown, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onkeydown, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onkeydown, in: jsObject] = newValue } } var onkeypress: EventHandler { - get { ClosureAttribute.Optional1[Strings.onkeypress, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onkeypress, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onkeypress, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onkeypress, in: jsObject] = newValue } } var onkeyup: EventHandler { - get { ClosureAttribute.Optional1[Strings.onkeyup, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onkeyup, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onkeyup, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onkeyup, in: jsObject] = newValue } } var onload: EventHandler { - get { ClosureAttribute.Optional1[Strings.onload, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onload, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onload, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onload, in: jsObject] = newValue } } var onloadeddata: EventHandler { - get { ClosureAttribute.Optional1[Strings.onloadeddata, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onloadeddata, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onloadeddata, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onloadeddata, in: jsObject] = newValue } } var onloadedmetadata: EventHandler { - get { ClosureAttribute.Optional1[Strings.onloadedmetadata, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onloadedmetadata, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onloadedmetadata, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onloadedmetadata, in: jsObject] = newValue } } var onloadstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.onloadstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onloadstart, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onloadstart, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onloadstart, in: jsObject] = newValue } } var onmousedown: EventHandler { - get { ClosureAttribute.Optional1[Strings.onmousedown, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onmousedown, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onmousedown, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onmousedown, in: jsObject] = newValue } } var onmouseenter: EventHandler { - get { ClosureAttribute.Optional1[Strings.onmouseenter, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onmouseenter, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onmouseenter, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onmouseenter, in: jsObject] = newValue } } var onmouseleave: EventHandler { - get { ClosureAttribute.Optional1[Strings.onmouseleave, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onmouseleave, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onmouseleave, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onmouseleave, in: jsObject] = newValue } } var onmousemove: EventHandler { - get { ClosureAttribute.Optional1[Strings.onmousemove, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onmousemove, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onmousemove, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onmousemove, in: jsObject] = newValue } } var onmouseout: EventHandler { - get { ClosureAttribute.Optional1[Strings.onmouseout, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onmouseout, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onmouseout, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onmouseout, in: jsObject] = newValue } } var onmouseover: EventHandler { - get { ClosureAttribute.Optional1[Strings.onmouseover, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onmouseover, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onmouseover, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onmouseover, in: jsObject] = newValue } } var onmouseup: EventHandler { - get { ClosureAttribute.Optional1[Strings.onmouseup, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onmouseup, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onmouseup, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onmouseup, in: jsObject] = newValue } } var onpause: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpause, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpause, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpause, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpause, in: jsObject] = newValue } } var onplay: EventHandler { - get { ClosureAttribute.Optional1[Strings.onplay, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onplay, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onplay, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onplay, in: jsObject] = newValue } } var onplaying: EventHandler { - get { ClosureAttribute.Optional1[Strings.onplaying, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onplaying, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onplaying, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onplaying, in: jsObject] = newValue } } var onprogress: EventHandler { - get { ClosureAttribute.Optional1[Strings.onprogress, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onprogress, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onprogress, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onprogress, in: jsObject] = newValue } } var onratechange: EventHandler { - get { ClosureAttribute.Optional1[Strings.onratechange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onratechange, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onratechange, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onratechange, in: jsObject] = newValue } } var onreset: EventHandler { - get { ClosureAttribute.Optional1[Strings.onreset, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onreset, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onreset, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onreset, in: jsObject] = newValue } } var onresize: EventHandler { - get { ClosureAttribute.Optional1[Strings.onresize, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onresize, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onresize, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onresize, in: jsObject] = newValue } } var onscroll: EventHandler { - get { ClosureAttribute.Optional1[Strings.onscroll, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onscroll, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onscroll, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onscroll, in: jsObject] = newValue } } var onsecuritypolicyviolation: EventHandler { - get { ClosureAttribute.Optional1[Strings.onsecuritypolicyviolation, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onsecuritypolicyviolation, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onsecuritypolicyviolation, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onsecuritypolicyviolation, in: jsObject] = newValue } } var onseeked: EventHandler { - get { ClosureAttribute.Optional1[Strings.onseeked, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onseeked, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onseeked, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onseeked, in: jsObject] = newValue } } var onseeking: EventHandler { - get { ClosureAttribute.Optional1[Strings.onseeking, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onseeking, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onseeking, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onseeking, in: jsObject] = newValue } } var onselect: EventHandler { - get { ClosureAttribute.Optional1[Strings.onselect, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onselect, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onselect, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onselect, in: jsObject] = newValue } } var onslotchange: EventHandler { - get { ClosureAttribute.Optional1[Strings.onslotchange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onslotchange, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onslotchange, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onslotchange, in: jsObject] = newValue } } var onstalled: EventHandler { - get { ClosureAttribute.Optional1[Strings.onstalled, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onstalled, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onstalled, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onstalled, in: jsObject] = newValue } } var onsubmit: EventHandler { - get { ClosureAttribute.Optional1[Strings.onsubmit, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onsubmit, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onsubmit, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onsubmit, in: jsObject] = newValue } } var onsuspend: EventHandler { - get { ClosureAttribute.Optional1[Strings.onsuspend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onsuspend, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onsuspend, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onsuspend, in: jsObject] = newValue } } var ontimeupdate: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontimeupdate, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontimeupdate, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontimeupdate, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontimeupdate, in: jsObject] = newValue } } var ontoggle: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontoggle, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontoggle, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontoggle, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontoggle, in: jsObject] = newValue } } var onvolumechange: EventHandler { - get { ClosureAttribute.Optional1[Strings.onvolumechange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onvolumechange, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onvolumechange, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onvolumechange, in: jsObject] = newValue } } var onwaiting: EventHandler { - get { ClosureAttribute.Optional1[Strings.onwaiting, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onwaiting, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onwaiting, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onwaiting, in: jsObject] = newValue } } var onwebkitanimationend: EventHandler { - get { ClosureAttribute.Optional1[Strings.onwebkitanimationend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onwebkitanimationend, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onwebkitanimationend, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onwebkitanimationend, in: jsObject] = newValue } } var onwebkitanimationiteration: EventHandler { - get { ClosureAttribute.Optional1[Strings.onwebkitanimationiteration, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onwebkitanimationiteration, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onwebkitanimationiteration, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onwebkitanimationiteration, in: jsObject] = newValue } } var onwebkitanimationstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.onwebkitanimationstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onwebkitanimationstart, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onwebkitanimationstart, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onwebkitanimationstart, in: jsObject] = newValue } } var onwebkittransitionend: EventHandler { - get { ClosureAttribute.Optional1[Strings.onwebkittransitionend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onwebkittransitionend, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onwebkittransitionend, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onwebkittransitionend, in: jsObject] = newValue } } var onwheel: EventHandler { - get { ClosureAttribute.Optional1[Strings.onwheel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onwheel, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onwheel, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onwheel, in: jsObject] = newValue } } var ongotpointercapture: EventHandler { - get { ClosureAttribute.Optional1[Strings.ongotpointercapture, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ongotpointercapture, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ongotpointercapture, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ongotpointercapture, in: jsObject] = newValue } } var onlostpointercapture: EventHandler { - get { ClosureAttribute.Optional1[Strings.onlostpointercapture, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onlostpointercapture, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onlostpointercapture, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onlostpointercapture, in: jsObject] = newValue } } var onpointerdown: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpointerdown, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpointerdown, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpointerdown, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpointerdown, in: jsObject] = newValue } } var onpointermove: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpointermove, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpointermove, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpointermove, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpointermove, in: jsObject] = newValue } } var onpointerrawupdate: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpointerrawupdate, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpointerrawupdate, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpointerrawupdate, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpointerrawupdate, in: jsObject] = newValue } } var onpointerup: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpointerup, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpointerup, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpointerup, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpointerup, in: jsObject] = newValue } } var onpointercancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpointercancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpointercancel, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpointercancel, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpointercancel, in: jsObject] = newValue } } var onpointerover: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpointerover, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpointerover, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpointerover, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpointerover, in: jsObject] = newValue } } var onpointerout: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpointerout, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpointerout, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpointerout, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpointerout, in: jsObject] = newValue } } var onpointerenter: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpointerenter, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpointerenter, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpointerenter, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpointerenter, in: jsObject] = newValue } } var onpointerleave: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpointerleave, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpointerleave, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpointerleave, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpointerleave, in: jsObject] = newValue } } var onselectstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onselectstart, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onselectstart, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onselectstart, in: jsObject] = newValue } } var onselectionchange: EventHandler { - get { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onselectionchange, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onselectionchange, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onselectionchange, in: jsObject] = newValue } } var ontouchstart: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchstart, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontouchstart, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontouchstart, in: jsObject] = newValue } } var ontouchend: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchend, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontouchend, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontouchend, in: jsObject] = newValue } } var ontouchmove: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchmove, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontouchmove, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontouchmove, in: jsObject] = newValue } } var ontouchcancel: EventHandler { - get { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ontouchcancel, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ontouchcancel, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ontouchcancel, in: jsObject] = newValue } } var onbeforexrselect: EventHandler { - get { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onbeforexrselect, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onbeforexrselect, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onbeforexrselect, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/HID.swift b/Sources/DOMKit/WebIDL/HID.swift index d8b1a7c2..ac7b8a90 100644 --- a/Sources/DOMKit/WebIDL/HID.swift +++ b/Sources/DOMKit/WebIDL/HID.swift @@ -7,15 +7,15 @@ public class HID: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.HID].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnect: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondisconnect: EventHandler public func getDevices() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/HIDDevice.swift b/Sources/DOMKit/WebIDL/HIDDevice.swift index ad4c148d..0fd217c8 100644 --- a/Sources/DOMKit/WebIDL/HIDDevice.swift +++ b/Sources/DOMKit/WebIDL/HIDDevice.swift @@ -7,7 +7,7 @@ public class HIDDevice: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.HIDDevice].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _oninputreport = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oninputreport) + _oninputreport = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oninputreport) _opened = ReadonlyAttribute(jsObject: jsObject, name: Strings.opened) _vendorId = ReadonlyAttribute(jsObject: jsObject, name: Strings.vendorId) _productId = ReadonlyAttribute(jsObject: jsObject, name: Strings.productId) @@ -16,7 +16,7 @@ public class HIDDevice: EventTarget { super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oninputreport: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift index a3a735f9..5faeb143 100644 --- a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift @@ -7,7 +7,7 @@ public class HTMLBodyElement: HTMLElement, WindowEventHandlers { override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBodyElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onorientationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onorientationchange) + _onorientationchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onorientationchange) _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) _link = ReadWriteAttribute(jsObject: jsObject, name: Strings.link) _vLink = ReadWriteAttribute(jsObject: jsObject, name: Strings.vLink) @@ -17,7 +17,7 @@ public class HTMLBodyElement: HTMLElement, WindowEventHandlers { super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onorientationchange: EventHandler public convenience init() { diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index 1e24b914..95841cac 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -9,8 +9,8 @@ public class HTMLMediaElement: HTMLElement { public required init(unsafelyWrapping jsObject: JSObject) { _sinkId = ReadonlyAttribute(jsObject: jsObject, name: Strings.sinkId) _mediaKeys = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaKeys) - _onencrypted = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onencrypted) - _onwaitingforkey = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onwaitingforkey) + _onencrypted = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onencrypted) + _onwaitingforkey = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onwaitingforkey) _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcObject = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcObject) @@ -60,10 +60,10 @@ public class HTMLMediaElement: HTMLElement { @ReadonlyAttribute public var mediaKeys: MediaKeys? - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onencrypted: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onwaitingforkey: EventHandler public func setMediaKeys(mediaKeys: MediaKeys?) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift index bb2274e1..409c7ae0 100644 --- a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift @@ -9,8 +9,8 @@ public class HTMLPortalElement: HTMLElement { public required init(unsafelyWrapping jsObject: JSObject) { _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -38,9 +38,9 @@ public class HTMLPortalElement: HTMLElement { _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessageerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 068645de..3ac009c9 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -13,8 +13,8 @@ public class HTMLVideoElement: HTMLMediaElement { _videoHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoHeight) _poster = ReadWriteAttribute(jsObject: jsObject, name: Strings.poster) _playsInline = ReadWriteAttribute(jsObject: jsObject, name: Strings.playsInline) - _onenterpictureinpicture = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onenterpictureinpicture) - _onleavepictureinpicture = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onleavepictureinpicture) + _onenterpictureinpicture = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onenterpictureinpicture) + _onleavepictureinpicture = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onleavepictureinpicture) _autoPictureInPicture = ReadWriteAttribute(jsObject: jsObject, name: Strings.autoPictureInPicture) _disablePictureInPicture = ReadWriteAttribute(jsObject: jsObject, name: Strings.disablePictureInPicture) super.init(unsafelyWrapping: jsObject) @@ -56,10 +56,10 @@ public class HTMLVideoElement: HTMLMediaElement { return try await _promise.get().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onenterpictureinpicture: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onleavepictureinpicture: EventHandler @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/IDBDatabase.swift b/Sources/DOMKit/WebIDL/IDBDatabase.swift index ceae0a00..edd22798 100644 --- a/Sources/DOMKit/WebIDL/IDBDatabase.swift +++ b/Sources/DOMKit/WebIDL/IDBDatabase.swift @@ -10,10 +10,10 @@ public class IDBDatabase: EventTarget { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) _version = ReadonlyAttribute(jsObject: jsObject, name: Strings.version) _objectStoreNames = ReadonlyAttribute(jsObject: jsObject, name: Strings.objectStoreNames) - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) - _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onversionchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onversionchange) + _onabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onabort) + _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onversionchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onversionchange) super.init(unsafelyWrapping: jsObject) } @@ -42,15 +42,15 @@ public class IDBDatabase: EventTarget { _ = jsObject[Strings.deleteObjectStore]!(name.jsValue()) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onabort: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onclose: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onversionchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift b/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift index 279c0b6a..93943d90 100644 --- a/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift +++ b/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift @@ -7,14 +7,14 @@ public class IDBOpenDBRequest: IDBRequest { override public class var constructor: JSFunction { JSObject.global[Strings.IDBOpenDBRequest].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onblocked = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onblocked) - _onupgradeneeded = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupgradeneeded) + _onblocked = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onblocked) + _onupgradeneeded = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onupgradeneeded) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onblocked: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onupgradeneeded: EventHandler } diff --git a/Sources/DOMKit/WebIDL/IDBRequest.swift b/Sources/DOMKit/WebIDL/IDBRequest.swift index 8e704766..38c1dada 100644 --- a/Sources/DOMKit/WebIDL/IDBRequest.swift +++ b/Sources/DOMKit/WebIDL/IDBRequest.swift @@ -12,8 +12,8 @@ public class IDBRequest: EventTarget { _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) _transaction = ReadonlyAttribute(jsObject: jsObject, name: Strings.transaction) _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) - _onsuccess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsuccess) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onsuccess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsuccess) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) super.init(unsafelyWrapping: jsObject) } @@ -32,9 +32,9 @@ public class IDBRequest: EventTarget { @ReadonlyAttribute public var readyState: IDBRequestReadyState - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsuccess: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/IDBTransaction.swift b/Sources/DOMKit/WebIDL/IDBTransaction.swift index 3104faac..2071f59b 100644 --- a/Sources/DOMKit/WebIDL/IDBTransaction.swift +++ b/Sources/DOMKit/WebIDL/IDBTransaction.swift @@ -12,9 +12,9 @@ public class IDBTransaction: EventTarget { _durability = ReadonlyAttribute(jsObject: jsObject, name: Strings.durability) _db = ReadonlyAttribute(jsObject: jsObject, name: Strings.db) _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) - _oncomplete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncomplete) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onabort) + _oncomplete = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncomplete) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) super.init(unsafelyWrapping: jsObject) } @@ -45,12 +45,12 @@ public class IDBTransaction: EventTarget { _ = jsObject[Strings.abort]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onabort: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncomplete: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/IdleDetector.swift b/Sources/DOMKit/WebIDL/IdleDetector.swift index a1712748..abd5e009 100644 --- a/Sources/DOMKit/WebIDL/IdleDetector.swift +++ b/Sources/DOMKit/WebIDL/IdleDetector.swift @@ -9,7 +9,7 @@ public class IdleDetector: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _userState = ReadonlyAttribute(jsObject: jsObject, name: Strings.userState) _screenState = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenState) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) super.init(unsafelyWrapping: jsObject) } @@ -23,7 +23,7 @@ public class IdleDetector: EventTarget { @ReadonlyAttribute public var screenState: ScreenIdleState? - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler public static func requestPermission() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/ImageTrack.swift b/Sources/DOMKit/WebIDL/ImageTrack.swift index 52c362b1..634f2a06 100644 --- a/Sources/DOMKit/WebIDL/ImageTrack.swift +++ b/Sources/DOMKit/WebIDL/ImageTrack.swift @@ -10,7 +10,7 @@ public class ImageTrack: EventTarget { _animated = ReadonlyAttribute(jsObject: jsObject, name: Strings.animated) _frameCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameCount) _repetitionCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.repetitionCount) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) super.init(unsafelyWrapping: jsObject) } @@ -24,7 +24,7 @@ public class ImageTrack: EventTarget { @ReadonlyAttribute public var repetitionCount: Float - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/Keyboard.swift b/Sources/DOMKit/WebIDL/Keyboard.swift index a8fd503e..71407e98 100644 --- a/Sources/DOMKit/WebIDL/Keyboard.swift +++ b/Sources/DOMKit/WebIDL/Keyboard.swift @@ -7,7 +7,7 @@ public class Keyboard: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.Keyboard].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onlayoutchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onlayoutchange) + _onlayoutchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onlayoutchange) super.init(unsafelyWrapping: jsObject) } @@ -35,6 +35,6 @@ public class Keyboard: EventTarget { return try await _promise.get().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onlayoutchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/MIDIAccess.swift b/Sources/DOMKit/WebIDL/MIDIAccess.swift index e186254d..139dacc8 100644 --- a/Sources/DOMKit/WebIDL/MIDIAccess.swift +++ b/Sources/DOMKit/WebIDL/MIDIAccess.swift @@ -9,7 +9,7 @@ public class MIDIAccess: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _inputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputs) _outputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.outputs) - _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) _sysexEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.sysexEnabled) super.init(unsafelyWrapping: jsObject) } @@ -20,7 +20,7 @@ public class MIDIAccess: EventTarget { @ReadonlyAttribute public var outputs: MIDIOutputMap - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstatechange: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MIDIInput.swift b/Sources/DOMKit/WebIDL/MIDIInput.swift index 82db715f..b527d608 100644 --- a/Sources/DOMKit/WebIDL/MIDIInput.swift +++ b/Sources/DOMKit/WebIDL/MIDIInput.swift @@ -7,10 +7,10 @@ public class MIDIInput: MIDIPort { override public class var constructor: JSFunction { JSObject.global[Strings.MIDIInput].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onmidimessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmidimessage) + _onmidimessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmidimessage) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmidimessage: EventHandler } diff --git a/Sources/DOMKit/WebIDL/MIDIPort.swift b/Sources/DOMKit/WebIDL/MIDIPort.swift index 60603575..b77b5412 100644 --- a/Sources/DOMKit/WebIDL/MIDIPort.swift +++ b/Sources/DOMKit/WebIDL/MIDIPort.swift @@ -14,7 +14,7 @@ public class MIDIPort: EventTarget { _version = ReadonlyAttribute(jsObject: jsObject, name: Strings.version) _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) _connection = ReadonlyAttribute(jsObject: jsObject, name: Strings.connection) - _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) super.init(unsafelyWrapping: jsObject) } @@ -39,7 +39,7 @@ public class MIDIPort: EventTarget { @ReadonlyAttribute public var connection: MIDIPortConnectionState - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstatechange: EventHandler public func open() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/MediaDevices.swift b/Sources/DOMKit/WebIDL/MediaDevices.swift index 2f6a8101..2af82caa 100644 --- a/Sources/DOMKit/WebIDL/MediaDevices.swift +++ b/Sources/DOMKit/WebIDL/MediaDevices.swift @@ -7,7 +7,7 @@ public class MediaDevices: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.MediaDevices].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _ondevicechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicechange) + _ondevicechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondevicechange) super.init(unsafelyWrapping: jsObject) } @@ -31,7 +31,7 @@ public class MediaDevices: EventTarget { return try await _promise.get().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondevicechange: EventHandler public func enumerateDevices() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/MediaKeySession.swift b/Sources/DOMKit/WebIDL/MediaKeySession.swift index 8b125631..8b08887d 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySession.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySession.swift @@ -11,8 +11,8 @@ public class MediaKeySession: EventTarget { _expiration = ReadonlyAttribute(jsObject: jsObject, name: Strings.expiration) _closed = ReadonlyAttribute(jsObject: jsObject, name: Strings.closed) _keyStatuses = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyStatuses) - _onkeystatuseschange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onkeystatuseschange) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onkeystatuseschange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onkeystatuseschange) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) super.init(unsafelyWrapping: jsObject) } @@ -28,10 +28,10 @@ public class MediaKeySession: EventTarget { @ReadonlyAttribute public var keyStatuses: MediaKeyStatusMap - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onkeystatuseschange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler public func generateRequest(initDataType: String, initData: BufferSource) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/MediaQueryList.swift b/Sources/DOMKit/WebIDL/MediaQueryList.swift index 4192c205..dbbebd56 100644 --- a/Sources/DOMKit/WebIDL/MediaQueryList.swift +++ b/Sources/DOMKit/WebIDL/MediaQueryList.swift @@ -9,7 +9,7 @@ public class MediaQueryList: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) _matches = ReadonlyAttribute(jsObject: jsObject, name: Strings.matches) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) super.init(unsafelyWrapping: jsObject) } @@ -23,6 +23,6 @@ public class MediaQueryList: EventTarget { // XXX: member 'removeListener' is ignored - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/MediaRecorder.swift b/Sources/DOMKit/WebIDL/MediaRecorder.swift index 98f2aa8f..774d5378 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorder.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorder.swift @@ -10,12 +10,12 @@ public class MediaRecorder: EventTarget { _stream = ReadonlyAttribute(jsObject: jsObject, name: Strings.stream) _mimeType = ReadonlyAttribute(jsObject: jsObject, name: Strings.mimeType) _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _onstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstart) - _onstop = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstop) - _ondataavailable = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondataavailable) - _onpause = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpause) - _onresume = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresume) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _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) @@ -35,22 +35,22 @@ public class MediaRecorder: EventTarget { @ReadonlyAttribute public var state: RecordingState - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstop: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondataavailable: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onpause: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onresume: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaSource.swift b/Sources/DOMKit/WebIDL/MediaSource.swift index 5af72afc..36432de4 100644 --- a/Sources/DOMKit/WebIDL/MediaSource.swift +++ b/Sources/DOMKit/WebIDL/MediaSource.swift @@ -11,9 +11,9 @@ public class MediaSource: EventTarget { _activeSourceBuffers = ReadonlyAttribute(jsObject: jsObject, name: Strings.activeSourceBuffers) _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) _duration = ReadWriteAttribute(jsObject: jsObject, name: Strings.duration) - _onsourceopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsourceopen) - _onsourceended = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsourceended) - _onsourceclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsourceclose) + _onsourceopen = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsourceopen) + _onsourceended = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsourceended) + _onsourceclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsourceclose) _canConstructInDedicatedWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.canConstructInDedicatedWorker) super.init(unsafelyWrapping: jsObject) } @@ -34,13 +34,13 @@ public class MediaSource: EventTarget { @ReadWriteAttribute public var duration: Double - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsourceopen: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsourceended: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsourceclose: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStream.swift b/Sources/DOMKit/WebIDL/MediaStream.swift index ffb1b491..4bd60b46 100644 --- a/Sources/DOMKit/WebIDL/MediaStream.swift +++ b/Sources/DOMKit/WebIDL/MediaStream.swift @@ -9,8 +9,8 @@ public class MediaStream: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) _active = ReadonlyAttribute(jsObject: jsObject, name: Strings.active) - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddtrack) - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovetrack) + _onaddtrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddtrack) + _onremovetrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovetrack) super.init(unsafelyWrapping: jsObject) } @@ -60,9 +60,9 @@ public class MediaStream: EventTarget { @ReadonlyAttribute public var active: Bool - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onaddtrack: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onremovetrack: EventHandler } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift index aabd8137..1fb0bea2 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift @@ -12,13 +12,13 @@ public class MediaStreamTrack: EventTarget { _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) _enabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.enabled) _muted = ReadonlyAttribute(jsObject: jsObject, name: Strings.muted) - _onmute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmute) - _onunmute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onunmute) + _onmute = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmute) + _onunmute = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onunmute) _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) - _onended = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onended) + _onended = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onended) _contentHint = ReadWriteAttribute(jsObject: jsObject, name: Strings.contentHint) _isolated = ReadonlyAttribute(jsObject: jsObject, name: Strings.isolated) - _onisolationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onisolationchange) + _onisolationchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onisolationchange) super.init(unsafelyWrapping: jsObject) } @@ -37,16 +37,16 @@ public class MediaStreamTrack: EventTarget { @ReadonlyAttribute public var muted: Bool - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmute: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onunmute: EventHandler @ReadonlyAttribute public var readyState: MediaStreamTrackState - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onended: EventHandler public func clone() -> Self { @@ -85,6 +85,6 @@ public class MediaStreamTrack: EventTarget { @ReadonlyAttribute public var isolated: Bool - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onisolationchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift index bb196497..80e199a0 100644 --- a/Sources/DOMKit/WebIDL/MessagePort.swift +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -7,8 +7,8 @@ public class MessagePort: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.MessagePort].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -28,9 +28,9 @@ public class MessagePort: EventTarget { _ = jsObject[Strings.close]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessageerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/NDEFReader.swift b/Sources/DOMKit/WebIDL/NDEFReader.swift index 976d8480..f486d39f 100644 --- a/Sources/DOMKit/WebIDL/NDEFReader.swift +++ b/Sources/DOMKit/WebIDL/NDEFReader.swift @@ -7,8 +7,8 @@ public class NDEFReader: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.NDEFReader].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onreading = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreading) - _onreadingerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreadingerror) + _onreading = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreading) + _onreadingerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreadingerror) super.init(unsafelyWrapping: jsObject) } @@ -16,10 +16,10 @@ public class NDEFReader: EventTarget { self.init(unsafelyWrapping: Self.constructor.new()) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onreading: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onreadingerror: EventHandler public func scan(options: NDEFScanOptions? = nil) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/Navigation.swift b/Sources/DOMKit/WebIDL/Navigation.swift index 0dad68ff..58f4146c 100644 --- a/Sources/DOMKit/WebIDL/Navigation.swift +++ b/Sources/DOMKit/WebIDL/Navigation.swift @@ -11,10 +11,10 @@ public class Navigation: EventTarget { _transition = ReadonlyAttribute(jsObject: jsObject, name: Strings.transition) _canGoBack = ReadonlyAttribute(jsObject: jsObject, name: Strings.canGoBack) _canGoForward = ReadonlyAttribute(jsObject: jsObject, name: Strings.canGoForward) - _onnavigate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigate) - _onnavigatesuccess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigatesuccess) - _onnavigateerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigateerror) - _oncurrententrychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncurrententrychange) + _onnavigate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigate) + _onnavigatesuccess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigatesuccess) + _onnavigateerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigateerror) + _oncurrententrychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncurrententrychange) super.init(unsafelyWrapping: jsObject) } @@ -58,15 +58,15 @@ public class Navigation: EventTarget { jsObject[Strings.forward]!(options?.jsValue() ?? .undefined).fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onnavigate: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onnavigatesuccess: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onnavigateerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncurrententrychange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift b/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift index c23ca9c2..3c0810c3 100644 --- a/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift +++ b/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift @@ -12,10 +12,10 @@ public class NavigationHistoryEntry: EventTarget { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) _sameDocument = ReadonlyAttribute(jsObject: jsObject, name: Strings.sameDocument) - _onnavigateto = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigateto) - _onnavigatefrom = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnavigatefrom) - _onfinish = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfinish) - _ondispose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondispose) + _onnavigateto = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigateto) + _onnavigatefrom = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigatefrom) + _onfinish = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfinish) + _ondispose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondispose) super.init(unsafelyWrapping: jsObject) } @@ -38,15 +38,15 @@ public class NavigationHistoryEntry: EventTarget { jsObject[Strings.getState]!().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onnavigateto: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onnavigatefrom: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onfinish: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondispose: EventHandler } diff --git a/Sources/DOMKit/WebIDL/NetworkInformation.swift b/Sources/DOMKit/WebIDL/NetworkInformation.swift index f5fc398b..7e961e21 100644 --- a/Sources/DOMKit/WebIDL/NetworkInformation.swift +++ b/Sources/DOMKit/WebIDL/NetworkInformation.swift @@ -12,7 +12,7 @@ public class NetworkInformation: EventTarget, NetworkInformationSaveData { _downlinkMax = ReadonlyAttribute(jsObject: jsObject, name: Strings.downlinkMax) _downlink = ReadonlyAttribute(jsObject: jsObject, name: Strings.downlink) _rtt = ReadonlyAttribute(jsObject: jsObject, name: Strings.rtt) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) super.init(unsafelyWrapping: jsObject) } @@ -31,6 +31,6 @@ public class NetworkInformation: EventTarget, NetworkInformationSaveData { @ReadonlyAttribute public var rtt: Millisecond - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/Notification.swift b/Sources/DOMKit/WebIDL/Notification.swift index b045353c..8c88f7a9 100644 --- a/Sources/DOMKit/WebIDL/Notification.swift +++ b/Sources/DOMKit/WebIDL/Notification.swift @@ -9,10 +9,10 @@ public class Notification: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _permission = ReadonlyAttribute(jsObject: jsObject, name: Strings.permission) _maxActions = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxActions) - _onclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclick) - _onshow = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onshow) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) + _onclick = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclick) + _onshow = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onshow) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) _title = ReadonlyAttribute(jsObject: jsObject, name: Strings.title) _dir = ReadonlyAttribute(jsObject: jsObject, name: Strings.dir) _lang = ReadonlyAttribute(jsObject: jsObject, name: Strings.lang) @@ -45,16 +45,16 @@ public class Notification: EventTarget { @ReadonlyAttribute public var maxActions: UInt32 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onclick: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onshow: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onclose: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift index 7612cf19..1bf64fe7 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift @@ -8,7 +8,7 @@ public class OfflineAudioContext: BaseAudioContext { public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _oncomplete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncomplete) + _oncomplete = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncomplete) super.init(unsafelyWrapping: jsObject) } @@ -53,6 +53,6 @@ public class OfflineAudioContext: BaseAudioContext { @ReadonlyAttribute public var length: UInt32 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncomplete: EventHandler } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift index e347d6e1..baafbc04 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -9,8 +9,8 @@ public class OffscreenCanvas: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) - _oncontextlost = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontextlost) - _oncontextrestored = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontextrestored) + _oncontextlost = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncontextlost) + _oncontextrestored = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncontextrestored) super.init(unsafelyWrapping: jsObject) } @@ -42,9 +42,9 @@ public class OffscreenCanvas: EventTarget { return try await _promise.get().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncontextlost: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncontextrestored: EventHandler } diff --git a/Sources/DOMKit/WebIDL/PaymentRequest.swift b/Sources/DOMKit/WebIDL/PaymentRequest.swift index 308ca402..6be5c3d5 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequest.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequest.swift @@ -8,7 +8,7 @@ public class PaymentRequest: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _onpaymentmethodchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpaymentmethodchange) + _onpaymentmethodchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpaymentmethodchange) super.init(unsafelyWrapping: jsObject) } @@ -49,6 +49,6 @@ public class PaymentRequest: EventTarget { @ReadonlyAttribute public var id: String - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onpaymentmethodchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index e529f5f2..243007d8 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -12,7 +12,7 @@ public class Performance: EventTarget { _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeOrigin) _timing = ReadonlyAttribute(jsObject: jsObject, name: Strings.timing) _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) - _onresourcetimingbufferfull = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresourcetimingbufferfull) + _onresourcetimingbufferfull = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresourcetimingbufferfull) super.init(unsafelyWrapping: jsObject) } @@ -69,7 +69,7 @@ public class Performance: EventTarget { _ = jsObject[Strings.setResourceTimingBufferSize]!(maxSize.jsValue()) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onresourcetimingbufferfull: EventHandler public func mark(markName: String, markOptions: PerformanceMarkOptions? = nil) -> PerformanceMark { diff --git a/Sources/DOMKit/WebIDL/PermissionStatus.swift b/Sources/DOMKit/WebIDL/PermissionStatus.swift index d11b2eb3..47c7eb42 100644 --- a/Sources/DOMKit/WebIDL/PermissionStatus.swift +++ b/Sources/DOMKit/WebIDL/PermissionStatus.swift @@ -9,7 +9,7 @@ public class PermissionStatus: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) super.init(unsafelyWrapping: jsObject) } @@ -19,6 +19,6 @@ public class PermissionStatus: EventTarget { @ReadonlyAttribute public var name: String - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift b/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift index 4343f4ef..bf9d3fde 100644 --- a/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift +++ b/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift @@ -9,7 +9,7 @@ public class PictureInPictureWindow: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _onresize = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresize) + _onresize = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresize) super.init(unsafelyWrapping: jsObject) } @@ -19,6 +19,6 @@ public class PictureInPictureWindow: EventTarget { @ReadonlyAttribute public var height: Int32 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onresize: EventHandler } diff --git a/Sources/DOMKit/WebIDL/PortalHost.swift b/Sources/DOMKit/WebIDL/PortalHost.swift index faf04bdd..18b0ddd3 100644 --- a/Sources/DOMKit/WebIDL/PortalHost.swift +++ b/Sources/DOMKit/WebIDL/PortalHost.swift @@ -7,8 +7,8 @@ public class PortalHost: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.PortalHost].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -16,9 +16,9 @@ public class PortalHost: EventTarget { _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessageerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/PresentationAvailability.swift b/Sources/DOMKit/WebIDL/PresentationAvailability.swift index 6d702610..d78ae070 100644 --- a/Sources/DOMKit/WebIDL/PresentationAvailability.swift +++ b/Sources/DOMKit/WebIDL/PresentationAvailability.swift @@ -8,13 +8,13 @@ public class PresentationAvailability: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute public var value: Bool - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/PresentationConnection.swift b/Sources/DOMKit/WebIDL/PresentationConnection.swift index fa59f510..b3217e47 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnection.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnection.swift @@ -10,11 +10,11 @@ public class PresentationConnection: EventTarget { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) - _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) - _onterminate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onterminate) + _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) + _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) + _onterminate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onterminate) _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) super.init(unsafelyWrapping: jsObject) } @@ -35,19 +35,19 @@ public class PresentationConnection: EventTarget { _ = jsObject[Strings.terminate]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnect: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onclose: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onterminate: EventHandler @ReadWriteAttribute public var binaryType: BinaryType - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler public func send(message: String) { diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionList.swift b/Sources/DOMKit/WebIDL/PresentationConnectionList.swift index 0f64b3b3..146d0546 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionList.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionList.swift @@ -8,13 +8,13 @@ public class PresentationConnectionList: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _connections = ReadonlyAttribute(jsObject: jsObject, name: Strings.connections) - _onconnectionavailable = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnectionavailable) + _onconnectionavailable = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnectionavailable) super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute public var connections: [PresentationConnection] - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnectionavailable: EventHandler } diff --git a/Sources/DOMKit/WebIDL/PresentationRequest.swift b/Sources/DOMKit/WebIDL/PresentationRequest.swift index 9c0a7bd3..a5aa7af6 100644 --- a/Sources/DOMKit/WebIDL/PresentationRequest.swift +++ b/Sources/DOMKit/WebIDL/PresentationRequest.swift @@ -7,7 +7,7 @@ public class PresentationRequest: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.PresentationRequest].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onconnectionavailable = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnectionavailable) + _onconnectionavailable = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnectionavailable) super.init(unsafelyWrapping: jsObject) } @@ -49,6 +49,6 @@ public class PresentationRequest: EventTarget { return try await _promise.get().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnectionavailable: EventHandler } diff --git a/Sources/DOMKit/WebIDL/QueuingStrategy.swift b/Sources/DOMKit/WebIDL/QueuingStrategy.swift index 17616d2d..e4ed122d 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategy.swift @@ -7,19 +7,19 @@ 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() - ClosureAttribute.Required1[Strings.size, in: object] = size + ClosureAttribute1[Strings.size, in: object] = size self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { _highWaterMark = ReadWriteAttribute(jsObject: object, name: Strings.highWaterMark) - _size = ClosureAttribute.Required1(jsObject: object, name: Strings.size) + _size = ClosureAttribute1(jsObject: object, name: Strings.size) super.init(unsafelyWrapping: object) } @ReadWriteAttribute public var highWaterMark: Double - @ClosureAttribute.Required1 + @ClosureAttribute1 public var size: QueuingStrategySize } diff --git a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift index a6c11b1a..3ff5112f 100644 --- a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift +++ b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift @@ -7,7 +7,7 @@ public class RTCDTMFSender: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.RTCDTMFSender].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _ontonechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontonechange) + _ontonechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontonechange) _canInsertDTMF = ReadonlyAttribute(jsObject: jsObject, name: Strings.canInsertDTMF) _toneBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.toneBuffer) super.init(unsafelyWrapping: jsObject) @@ -17,7 +17,7 @@ public class RTCDTMFSender: EventTarget { _ = jsObject[Strings.insertDTMF]!(tones.jsValue(), duration?.jsValue() ?? .undefined, interToneGap?.jsValue() ?? .undefined) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ontonechange: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCDataChannel.swift b/Sources/DOMKit/WebIDL/RTCDataChannel.swift index e20ce8ba..1fa1400b 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannel.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannel.swift @@ -18,12 +18,12 @@ public class RTCDataChannel: EventTarget { _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) _bufferedAmount = ReadonlyAttribute(jsObject: jsObject, name: Strings.bufferedAmount) _bufferedAmountLowThreshold = ReadWriteAttribute(jsObject: jsObject, name: Strings.bufferedAmountLowThreshold) - _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onopen) - _onbufferedamountlow = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbufferedamountlow) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onclosing = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclosing) - _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onopen = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onopen) + _onbufferedamountlow = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbufferedamountlow) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onclosing = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclosing) + _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) super.init(unsafelyWrapping: jsObject) } @@ -61,26 +61,26 @@ public class RTCDataChannel: EventTarget { @ReadWriteAttribute public var bufferedAmountLowThreshold: UInt32 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onopen: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onbufferedamountlow: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onclosing: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onclose: EventHandler public func close() { _ = jsObject[Strings.close]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift b/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift index bb3a15c7..0d92b62e 100644 --- a/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift @@ -9,8 +9,8 @@ public class RTCDtlsTransport: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _iceTransport = ReadonlyAttribute(jsObject: jsObject, name: Strings.iceTransport) _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) super.init(unsafelyWrapping: jsObject) } @@ -24,9 +24,9 @@ public class RTCDtlsTransport: EventTarget { jsObject[Strings.getRemoteCertificates]!().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstatechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/RTCIceTransport.swift b/Sources/DOMKit/WebIDL/RTCIceTransport.swift index 4a582887..3a193739 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransport.swift @@ -7,15 +7,15 @@ public class RTCIceTransport: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.RTCIceTransport].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onicecandidate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicecandidate) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onicecandidate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onicecandidate) _role = ReadonlyAttribute(jsObject: jsObject, name: Strings.role) _component = ReadonlyAttribute(jsObject: jsObject, name: Strings.component) _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) _gatheringState = ReadonlyAttribute(jsObject: jsObject, name: Strings.gatheringState) - _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) - _ongatheringstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ongatheringstatechange) - _onselectedcandidatepairchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onselectedcandidatepairchange) + _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) + _ongatheringstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ongatheringstatechange) + _onselectedcandidatepairchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onselectedcandidatepairchange) super.init(unsafelyWrapping: jsObject) } @@ -39,10 +39,10 @@ public class RTCIceTransport: EventTarget { _ = jsObject[Strings.addRemoteCandidate]!(remoteCandidate?.jsValue() ?? .undefined) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onicecandidate: EventHandler @ReadonlyAttribute @@ -77,12 +77,12 @@ public class RTCIceTransport: EventTarget { jsObject[Strings.getRemoteParameters]!().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstatechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ongatheringstatechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onselectedcandidatepairchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift b/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift index 239e43b1..cae9ad6f 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class RTCIdentityProvider: BridgedDictionary { public convenience init(generateAssertion: @escaping GenerateAssertionCallback, validateAssertion: @escaping ValidateAssertionCallback) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute.Required3[Strings.generateAssertion, in: object] = generateAssertion - ClosureAttribute.Required2[Strings.validateAssertion, in: object] = validateAssertion + ClosureAttribute3[Strings.generateAssertion, in: object] = generateAssertion + ClosureAttribute2[Strings.validateAssertion, in: object] = validateAssertion self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _generateAssertion = ClosureAttribute.Required3(jsObject: object, name: Strings.generateAssertion) - _validateAssertion = ClosureAttribute.Required2(jsObject: object, name: Strings.validateAssertion) + _generateAssertion = ClosureAttribute3(jsObject: object, name: Strings.generateAssertion) + _validateAssertion = ClosureAttribute2(jsObject: object, name: Strings.validateAssertion) super.init(unsafelyWrapping: object) } - @ClosureAttribute.Required3 + @ClosureAttribute3 public var generateAssertion: GenerateAssertionCallback - @ClosureAttribute.Required2 + @ClosureAttribute2 public var validateAssertion: ValidateAssertionCallback } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift index d6c1b8fc..bf36aa0f 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift @@ -21,16 +21,16 @@ public class RTCPeerConnection: EventTarget { _iceConnectionState = ReadonlyAttribute(jsObject: jsObject, name: Strings.iceConnectionState) _connectionState = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectionState) _canTrickleIceCandidates = ReadonlyAttribute(jsObject: jsObject, name: Strings.canTrickleIceCandidates) - _onnegotiationneeded = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnegotiationneeded) - _onicecandidate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicecandidate) - _onicecandidateerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicecandidateerror) - _onsignalingstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsignalingstatechange) - _oniceconnectionstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oniceconnectionstatechange) - _onicegatheringstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onicegatheringstatechange) - _onconnectionstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnectionstatechange) - _ontrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontrack) + _onnegotiationneeded = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnegotiationneeded) + _onicecandidate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onicecandidate) + _onicecandidateerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onicecandidateerror) + _onsignalingstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsignalingstatechange) + _oniceconnectionstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oniceconnectionstatechange) + _onicegatheringstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onicegatheringstatechange) + _onconnectionstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnectionstatechange) + _ontrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontrack) _sctp = ReadonlyAttribute(jsObject: jsObject, name: Strings.sctp) - _ondatachannel = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondatachannel) + _ondatachannel = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondatachannel) super.init(unsafelyWrapping: jsObject) } @@ -130,25 +130,25 @@ public class RTCPeerConnection: EventTarget { _ = jsObject[Strings.close]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onnegotiationneeded: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onicecandidate: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onicecandidateerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsignalingstatechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oniceconnectionstatechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onicegatheringstatechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnectionstatechange: EventHandler // XXX: member 'createOffer' is ignored @@ -205,7 +205,7 @@ public class RTCPeerConnection: EventTarget { jsObject[Strings.addTransceiver]!(trackOrKind.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ontrack: EventHandler @ReadonlyAttribute @@ -215,7 +215,7 @@ public class RTCPeerConnection: EventTarget { jsObject[Strings.createDataChannel]!(label.jsValue(), dataChannelDict?.jsValue() ?? .undefined).fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondatachannel: EventHandler public func getStats(selector: MediaStreamTrack? = nil) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransport.swift b/Sources/DOMKit/WebIDL/RTCSctpTransport.swift index 806c0f9d..35daba02 100644 --- a/Sources/DOMKit/WebIDL/RTCSctpTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCSctpTransport.swift @@ -11,7 +11,7 @@ public class RTCSctpTransport: EventTarget { _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) _maxMessageSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxMessageSize) _maxChannels = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxChannels) - _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) super.init(unsafelyWrapping: jsObject) } @@ -27,6 +27,6 @@ public class RTCSctpTransport: EventTarget { @ReadonlyAttribute public var maxChannels: UInt16? - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstatechange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/RemotePlayback.swift b/Sources/DOMKit/WebIDL/RemotePlayback.swift index bd7dcde8..249ce54d 100644 --- a/Sources/DOMKit/WebIDL/RemotePlayback.swift +++ b/Sources/DOMKit/WebIDL/RemotePlayback.swift @@ -8,9 +8,9 @@ public class RemotePlayback: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _onconnecting = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnecting) - _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + _onconnecting = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnecting) + _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) super.init(unsafelyWrapping: jsObject) } @@ -31,13 +31,13 @@ public class RemotePlayback: EventTarget { @ReadonlyAttribute public var state: RemotePlaybackState - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnecting: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnect: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondisconnect: EventHandler public func prompt() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/SFrameTransform.swift b/Sources/DOMKit/WebIDL/SFrameTransform.swift index fbfa1188..287e59fb 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransform.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransform.swift @@ -9,7 +9,7 @@ public class SFrameTransform: JSBridgedClass, GenericTransformStream { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) self.jsObject = jsObject } @@ -27,6 +27,6 @@ public class SFrameTransform: JSBridgedClass, GenericTransformStream { _ = try await _promise.get() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift index 153eff9b..72c2d815 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift @@ -8,22 +8,22 @@ public class SVGAnimationElement: SVGElement, SVGTests { public required init(unsafelyWrapping jsObject: JSObject) { _targetElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetElement) - _onbegin = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbegin) - _onend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onend) - _onrepeat = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrepeat) + _onbegin = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbegin) + _onend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onend) + _onrepeat = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onrepeat) super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute public var targetElement: SVGElement? - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onbegin: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onend: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onrepeat: EventHandler public func getStartTime() -> Float { diff --git a/Sources/DOMKit/WebIDL/ScreenOrientation.swift b/Sources/DOMKit/WebIDL/ScreenOrientation.swift index be3361df..bc86eb84 100644 --- a/Sources/DOMKit/WebIDL/ScreenOrientation.swift +++ b/Sources/DOMKit/WebIDL/ScreenOrientation.swift @@ -9,7 +9,7 @@ public class ScreenOrientation: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) _angle = ReadonlyAttribute(jsObject: jsObject, name: Strings.angle) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) super.init(unsafelyWrapping: jsObject) } @@ -33,6 +33,6 @@ public class ScreenOrientation: EventTarget { @ReadonlyAttribute public var angle: UInt16 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift b/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift index 68e5514a..112b6191 100644 --- a/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift +++ b/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift @@ -7,12 +7,12 @@ public class ScriptProcessorNode: AudioNode { override public class var constructor: JSFunction { JSObject.global[Strings.ScriptProcessorNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onaudioprocess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaudioprocess) + _onaudioprocess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaudioprocess) _bufferSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.bufferSize) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onaudioprocess: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Sensor.swift b/Sources/DOMKit/WebIDL/Sensor.swift index c550ec84..c8a0cc9f 100644 --- a/Sources/DOMKit/WebIDL/Sensor.swift +++ b/Sources/DOMKit/WebIDL/Sensor.swift @@ -10,9 +10,9 @@ public class Sensor: EventTarget { _activated = ReadonlyAttribute(jsObject: jsObject, name: Strings.activated) _hasReading = ReadonlyAttribute(jsObject: jsObject, name: Strings.hasReading) _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - _onreading = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreading) - _onactivate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onactivate) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) + _onreading = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreading) + _onactivate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onactivate) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) super.init(unsafelyWrapping: jsObject) } @@ -33,12 +33,12 @@ public class Sensor: EventTarget { _ = jsObject[Strings.stop]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onreading: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onactivate: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/Serial.swift b/Sources/DOMKit/WebIDL/Serial.swift index 64751a30..6f76a798 100644 --- a/Sources/DOMKit/WebIDL/Serial.swift +++ b/Sources/DOMKit/WebIDL/Serial.swift @@ -7,15 +7,15 @@ public class Serial: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.Serial].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnect: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondisconnect: EventHandler public func getPorts() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/SerialPort.swift b/Sources/DOMKit/WebIDL/SerialPort.swift index 67acf43a..3e5d50ff 100644 --- a/Sources/DOMKit/WebIDL/SerialPort.swift +++ b/Sources/DOMKit/WebIDL/SerialPort.swift @@ -7,17 +7,17 @@ public class SerialPort: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.SerialPort].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) _readable = ReadonlyAttribute(jsObject: jsObject, name: Strings.readable) _writable = ReadonlyAttribute(jsObject: jsObject, name: Strings.writable) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnect: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondisconnect: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift b/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift index 48357e5e..f01605ab 100644 --- a/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift @@ -6,17 +6,17 @@ import JavaScriptKit public protocol ServiceEventHandlers: JSBridgedClass {} public extension ServiceEventHandlers { var onserviceadded: EventHandler { - get { ClosureAttribute.Optional1[Strings.onserviceadded, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onserviceadded, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onserviceadded, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onserviceadded, in: jsObject] = newValue } } var onservicechanged: EventHandler { - get { ClosureAttribute.Optional1[Strings.onservicechanged, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onservicechanged, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onservicechanged, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onservicechanged, in: jsObject] = newValue } } var onserviceremoved: EventHandler { - get { ClosureAttribute.Optional1[Strings.onserviceremoved, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onserviceremoved, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onserviceremoved, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onserviceremoved, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/ServiceWorker.swift b/Sources/DOMKit/WebIDL/ServiceWorker.swift index 33b4c453..5716ecda 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorker.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorker.swift @@ -9,7 +9,7 @@ public class ServiceWorker: EventTarget, AbstractWorker { public required init(unsafelyWrapping jsObject: JSObject) { _scriptURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.scriptURL) _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _onstatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstatechange) + _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) super.init(unsafelyWrapping: jsObject) } @@ -27,6 +27,6 @@ public class ServiceWorker: EventTarget, AbstractWorker { _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstatechange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift index 76200fbb..b724ba53 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift @@ -9,9 +9,9 @@ public class ServiceWorkerContainer: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _controller = ReadonlyAttribute(jsObject: jsObject, name: Strings.controller) _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) - _oncontrollerchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontrollerchange) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _oncontrollerchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncontrollerchange) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -55,12 +55,12 @@ public class ServiceWorkerContainer: EventTarget { _ = jsObject[Strings.startMessages]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncontrollerchange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessageerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift index 6363f010..5abb4c51 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift @@ -7,75 +7,75 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onbackgroundfetchsuccess = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchsuccess) - _onbackgroundfetchfail = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchfail) - _onbackgroundfetchabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchabort) - _onbackgroundfetchclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbackgroundfetchclick) - _onsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsync) - _oncontentdelete = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncontentdelete) + _onbackgroundfetchsuccess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbackgroundfetchsuccess) + _onbackgroundfetchfail = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbackgroundfetchfail) + _onbackgroundfetchabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbackgroundfetchabort) + _onbackgroundfetchclick = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbackgroundfetchclick) + _onsync = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsync) + _oncontentdelete = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncontentdelete) _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) - _oncookiechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncookiechange) - _onnotificationclick = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnotificationclick) - _onnotificationclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnotificationclose) - _oncanmakepayment = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncanmakepayment) - _onpaymentrequest = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpaymentrequest) - _onperiodicsync = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onperiodicsync) - _onpush = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpush) - _onpushsubscriptionchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpushsubscriptionchange) + _oncookiechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncookiechange) + _onnotificationclick = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnotificationclick) + _onnotificationclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnotificationclose) + _oncanmakepayment = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncanmakepayment) + _onpaymentrequest = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpaymentrequest) + _onperiodicsync = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onperiodicsync) + _onpush = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpush) + _onpushsubscriptionchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpushsubscriptionchange) _clients = ReadonlyAttribute(jsObject: jsObject, name: Strings.clients) _registration = ReadonlyAttribute(jsObject: jsObject, name: Strings.registration) _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) - _oninstall = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oninstall) - _onactivate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onactivate) - _onfetch = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onfetch) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _oninstall = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oninstall) + _onactivate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onactivate) + _onfetch = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfetch) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onbackgroundfetchsuccess: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onbackgroundfetchfail: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onbackgroundfetchabort: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onbackgroundfetchclick: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsync: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncontentdelete: EventHandler @ReadonlyAttribute public var cookieStore: CookieStore - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncookiechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onnotificationclick: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onnotificationclose: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncanmakepayment: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onpaymentrequest: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onperiodicsync: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onpush: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onpushsubscriptionchange: EventHandler @ReadonlyAttribute @@ -97,18 +97,18 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { _ = try await _promise.get() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oninstall: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onactivate: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onfetch: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessageerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift index d0d14653..9858f1e8 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift @@ -20,7 +20,7 @@ public class ServiceWorkerRegistration: EventTarget { _navigationPreload = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationPreload) _scope = ReadonlyAttribute(jsObject: jsObject, name: Strings.scope) _updateViaCache = ReadonlyAttribute(jsObject: jsObject, name: Strings.updateViaCache) - _onupdatefound = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupdatefound) + _onupdatefound = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onupdatefound) super.init(unsafelyWrapping: jsObject) } @@ -103,6 +103,6 @@ public class ServiceWorkerRegistration: EventTarget { return try await _promise.get().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onupdatefound: EventHandler } diff --git a/Sources/DOMKit/WebIDL/ShadowRoot.swift b/Sources/DOMKit/WebIDL/ShadowRoot.swift index 2385ead7..f82fff85 100644 --- a/Sources/DOMKit/WebIDL/ShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/ShadowRoot.swift @@ -11,7 +11,7 @@ public class ShadowRoot: DocumentFragment, InnerHTML, DocumentOrShadowRoot { _delegatesFocus = ReadonlyAttribute(jsObject: jsObject, name: Strings.delegatesFocus) _slotAssignment = ReadonlyAttribute(jsObject: jsObject, name: Strings.slotAssignment) _host = ReadonlyAttribute(jsObject: jsObject, name: Strings.host) - _onslotchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onslotchange) + _onslotchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onslotchange) super.init(unsafelyWrapping: jsObject) } @@ -27,6 +27,6 @@ public class ShadowRoot: DocumentFragment, InnerHTML, DocumentOrShadowRoot { @ReadonlyAttribute public var host: Element - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onslotchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift index 099f59b3..bffd68d9 100644 --- a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift @@ -8,7 +8,7 @@ public class SharedWorkerGlobalScope: WorkerGlobalScope { public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) + _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) super.init(unsafelyWrapping: jsObject) } @@ -19,6 +19,6 @@ public class SharedWorkerGlobalScope: WorkerGlobalScope { _ = jsObject[Strings.close]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnect: EventHandler } diff --git a/Sources/DOMKit/WebIDL/SourceBuffer.swift b/Sources/DOMKit/WebIDL/SourceBuffer.swift index bb8924ff..49b4de17 100644 --- a/Sources/DOMKit/WebIDL/SourceBuffer.swift +++ b/Sources/DOMKit/WebIDL/SourceBuffer.swift @@ -16,11 +16,11 @@ public class SourceBuffer: EventTarget { _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.textTracks) _appendWindowStart = ReadWriteAttribute(jsObject: jsObject, name: Strings.appendWindowStart) _appendWindowEnd = ReadWriteAttribute(jsObject: jsObject, name: Strings.appendWindowEnd) - _onupdatestart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupdatestart) - _onupdate = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupdate) - _onupdateend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onupdateend) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) + _onupdatestart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onupdatestart) + _onupdate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onupdate) + _onupdateend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onupdateend) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onabort) super.init(unsafelyWrapping: jsObject) } @@ -51,19 +51,19 @@ public class SourceBuffer: EventTarget { @ReadWriteAttribute public var appendWindowEnd: Double - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onupdatestart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onupdate: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onupdateend: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onabort: EventHandler public func appendBuffer(data: BufferSource) { diff --git a/Sources/DOMKit/WebIDL/SourceBufferList.swift b/Sources/DOMKit/WebIDL/SourceBufferList.swift index 08d6a025..b59ec548 100644 --- a/Sources/DOMKit/WebIDL/SourceBufferList.swift +++ b/Sources/DOMKit/WebIDL/SourceBufferList.swift @@ -8,18 +8,18 @@ public class SourceBufferList: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _onaddsourcebuffer = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddsourcebuffer) - _onremovesourcebuffer = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovesourcebuffer) + _onaddsourcebuffer = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddsourcebuffer) + _onremovesourcebuffer = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovesourcebuffer) super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute public var length: UInt32 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onaddsourcebuffer: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onremovesourcebuffer: EventHandler public subscript(key: Int) -> SourceBuffer { diff --git a/Sources/DOMKit/WebIDL/SpeechRecognition.swift b/Sources/DOMKit/WebIDL/SpeechRecognition.swift index a5c2128a..07fd0eb0 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognition.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognition.swift @@ -12,17 +12,17 @@ public class SpeechRecognition: EventTarget { _continuous = ReadWriteAttribute(jsObject: jsObject, name: Strings.continuous) _interimResults = ReadWriteAttribute(jsObject: jsObject, name: Strings.interimResults) _maxAlternatives = ReadWriteAttribute(jsObject: jsObject, name: Strings.maxAlternatives) - _onaudiostart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaudiostart) - _onsoundstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsoundstart) - _onspeechstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onspeechstart) - _onspeechend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onspeechend) - _onsoundend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsoundend) - _onaudioend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaudioend) - _onresult = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresult) - _onnomatch = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onnomatch) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstart) - _onend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onend) + _onaudiostart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaudiostart) + _onsoundstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsoundstart) + _onspeechstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onspeechstart) + _onspeechend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onspeechend) + _onsoundend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsoundend) + _onaudioend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaudioend) + _onresult = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresult) + _onnomatch = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnomatch) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstart) + _onend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onend) super.init(unsafelyWrapping: jsObject) } @@ -57,36 +57,36 @@ public class SpeechRecognition: EventTarget { _ = jsObject[Strings.abort]!() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onaudiostart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsoundstart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onspeechstart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onspeechend: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsoundend: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onaudioend: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onresult: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onnomatch: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onend: EventHandler } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift index 9cb8a2e2..cd7212fb 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift @@ -10,7 +10,7 @@ public class SpeechSynthesis: EventTarget { _pending = ReadonlyAttribute(jsObject: jsObject, name: Strings.pending) _speaking = ReadonlyAttribute(jsObject: jsObject, name: Strings.speaking) _paused = ReadonlyAttribute(jsObject: jsObject, name: Strings.paused) - _onvoiceschanged = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onvoiceschanged) + _onvoiceschanged = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onvoiceschanged) super.init(unsafelyWrapping: jsObject) } @@ -23,7 +23,7 @@ public class SpeechSynthesis: EventTarget { @ReadonlyAttribute public var paused: Bool - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onvoiceschanged: EventHandler public func speak(utterance: SpeechSynthesisUtterance) { diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift index 9bf77255..70b80113 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift @@ -13,13 +13,13 @@ public class SpeechSynthesisUtterance: EventTarget { _volume = ReadWriteAttribute(jsObject: jsObject, name: Strings.volume) _rate = ReadWriteAttribute(jsObject: jsObject, name: Strings.rate) _pitch = ReadWriteAttribute(jsObject: jsObject, name: Strings.pitch) - _onstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onstart) - _onend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onend) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onpause = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onpause) - _onresume = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresume) - _onmark = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmark) - _onboundary = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onboundary) + _onstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstart) + _onend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onend) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onpause = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpause) + _onresume = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresume) + _onmark = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmark) + _onboundary = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onboundary) super.init(unsafelyWrapping: jsObject) } @@ -45,24 +45,24 @@ public class SpeechSynthesisUtterance: EventTarget { @ReadWriteAttribute public var pitch: Float - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onstart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onend: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onpause: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onresume: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmark: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onboundary: EventHandler } diff --git a/Sources/DOMKit/WebIDL/TaskSignal.swift b/Sources/DOMKit/WebIDL/TaskSignal.swift index 2704cda5..a9170fd0 100644 --- a/Sources/DOMKit/WebIDL/TaskSignal.swift +++ b/Sources/DOMKit/WebIDL/TaskSignal.swift @@ -8,13 +8,13 @@ public class TaskSignal: AbortSignal { public required init(unsafelyWrapping jsObject: JSObject) { _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) - _onprioritychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprioritychange) + _onprioritychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onprioritychange) super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute public var priority: TaskPriority - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onprioritychange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index 1ec8b6b1..5b01b992 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -15,7 +15,7 @@ public class TextTrack: EventTarget { _mode = ReadWriteAttribute(jsObject: jsObject, name: Strings.mode) _cues = ReadonlyAttribute(jsObject: jsObject, name: Strings.cues) _activeCues = ReadonlyAttribute(jsObject: jsObject, name: Strings.activeCues) - _oncuechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncuechange) + _oncuechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncuechange) _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) super.init(unsafelyWrapping: jsObject) } @@ -52,7 +52,7 @@ public class TextTrack: EventTarget { _ = jsObject[Strings.removeCue]!(cue.jsValue()) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncuechange: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TextTrackCue.swift b/Sources/DOMKit/WebIDL/TextTrackCue.swift index f1c7b0be..77aedc42 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCue.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCue.swift @@ -12,8 +12,8 @@ public class TextTrackCue: EventTarget { _startTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.startTime) _endTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.endTime) _pauseOnExit = ReadWriteAttribute(jsObject: jsObject, name: Strings.pauseOnExit) - _onenter = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onenter) - _onexit = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onexit) + _onenter = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onenter) + _onexit = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onexit) super.init(unsafelyWrapping: jsObject) } @@ -32,9 +32,9 @@ public class TextTrackCue: EventTarget { @ReadWriteAttribute public var pauseOnExit: Bool - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onenter: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onexit: EventHandler } diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift index e987f967..93fb5e70 100644 --- a/Sources/DOMKit/WebIDL/TextTrackList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -8,9 +8,9 @@ public class TextTrackList: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddtrack) - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovetrack) + _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) } @@ -25,12 +25,12 @@ public class TextTrackList: EventTarget { jsObject[Strings.getTrackById]!(id.jsValue()).fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onaddtrack: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onremovetrack: EventHandler } diff --git a/Sources/DOMKit/WebIDL/Transformer.swift b/Sources/DOMKit/WebIDL/Transformer.swift index 8d785c75..fbf0fd83 100644 --- a/Sources/DOMKit/WebIDL/Transformer.swift +++ b/Sources/DOMKit/WebIDL/Transformer.swift @@ -6,30 +6,30 @@ 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() - ClosureAttribute.Required1[Strings.start, in: object] = start - ClosureAttribute.Required2[Strings.transform, in: object] = transform - ClosureAttribute.Required1[Strings.flush, in: object] = flush + 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 = ClosureAttribute.Required1(jsObject: object, name: Strings.start) - _transform = ClosureAttribute.Required2(jsObject: object, name: Strings.transform) - _flush = ClosureAttribute.Required1(jsObject: object, name: Strings.flush) + _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) } - @ClosureAttribute.Required1 + @ClosureAttribute1 public var start: TransformerStartCallback - @ClosureAttribute.Required2 + @ClosureAttribute2 public var transform: TransformerTransformCallback - @ClosureAttribute.Required1 + @ClosureAttribute1 public var flush: TransformerFlushCallback @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift index e22f2b5d..2198b802 100644 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift @@ -6,25 +6,25 @@ import JavaScriptKit public class TrustedTypePolicyOptions: BridgedDictionary { public convenience init(createHTML: @escaping CreateHTMLCallback?, createScript: @escaping CreateScriptCallback?, createScriptURL: @escaping CreateScriptURLCallback?) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute.Required2[Strings.createHTML, in: object] = createHTML - ClosureAttribute.Required2[Strings.createScript, in: object] = createScript - ClosureAttribute.Required2[Strings.createScriptURL, in: object] = createScriptURL + ClosureAttribute2[Strings.createHTML, in: object] = createHTML + ClosureAttribute2[Strings.createScript, in: object] = createScript + ClosureAttribute2[Strings.createScriptURL, in: object] = createScriptURL self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _createHTML = ClosureAttribute.Required2(jsObject: object, name: Strings.createHTML) - _createScript = ClosureAttribute.Required2(jsObject: object, name: Strings.createScript) - _createScriptURL = ClosureAttribute.Required2(jsObject: object, name: Strings.createScriptURL) + _createHTML = ClosureAttribute2(jsObject: object, name: Strings.createHTML) + _createScript = ClosureAttribute2(jsObject: object, name: Strings.createScript) + _createScriptURL = ClosureAttribute2(jsObject: object, name: Strings.createScriptURL) super.init(unsafelyWrapping: object) } - @ClosureAttribute.Required2 + @ClosureAttribute2 public var createHTML: CreateHTMLCallback? - @ClosureAttribute.Required2 + @ClosureAttribute2 public var createScript: CreateScriptCallback? - @ClosureAttribute.Required2 + @ClosureAttribute2 public var createScriptURL: CreateScriptURLCallback? } diff --git a/Sources/DOMKit/WebIDL/USB.swift b/Sources/DOMKit/WebIDL/USB.swift index ec0405c3..ba29f4a6 100644 --- a/Sources/DOMKit/WebIDL/USB.swift +++ b/Sources/DOMKit/WebIDL/USB.swift @@ -7,15 +7,15 @@ public class USB: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.USB].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondisconnect) + _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) + _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onconnect: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondisconnect: EventHandler public func getDevices() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift index 5d8596d0..db20ec64 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSink.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSink.swift @@ -6,33 +6,33 @@ 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() - ClosureAttribute.Required1[Strings.start, in: object] = start - ClosureAttribute.Required2[Strings.write, in: object] = write - ClosureAttribute.Required0[Strings.close, in: object] = close - ClosureAttribute.Required1[Strings.abort, in: object] = abort + 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 = ClosureAttribute.Required1(jsObject: object, name: Strings.start) - _write = ClosureAttribute.Required2(jsObject: object, name: Strings.write) - _close = ClosureAttribute.Required0(jsObject: object, name: Strings.close) - _abort = ClosureAttribute.Required1(jsObject: object, name: Strings.abort) + _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) } - @ClosureAttribute.Required1 + @ClosureAttribute1 public var start: UnderlyingSinkStartCallback - @ClosureAttribute.Required2 + @ClosureAttribute2 public var write: UnderlyingSinkWriteCallback - @ClosureAttribute.Required0 + @ClosureAttribute0 public var close: UnderlyingSinkCloseCallback - @ClosureAttribute.Required1 + @ClosureAttribute1 public var abort: UnderlyingSinkAbortCallback @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/UnderlyingSource.swift b/Sources/DOMKit/WebIDL/UnderlyingSource.swift index 6e08def6..fc9b2772 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSource.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSource.swift @@ -6,30 +6,30 @@ 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() - ClosureAttribute.Required1[Strings.start, in: object] = start - ClosureAttribute.Required1[Strings.pull, in: object] = pull - ClosureAttribute.Required1[Strings.cancel, in: object] = cancel + 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 = ClosureAttribute.Required1(jsObject: object, name: Strings.start) - _pull = ClosureAttribute.Required1(jsObject: object, name: Strings.pull) - _cancel = ClosureAttribute.Required1(jsObject: object, name: Strings.cancel) + _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) } - @ClosureAttribute.Required1 + @ClosureAttribute1 public var start: UnderlyingSourceStartCallback - @ClosureAttribute.Required1 + @ClosureAttribute1 public var pull: UnderlyingSourcePullCallback - @ClosureAttribute.Required1 + @ClosureAttribute1 public var cancel: UnderlyingSourceCancelCallback @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/VideoDecoderInit.swift b/Sources/DOMKit/WebIDL/VideoDecoderInit.swift index 025cfc71..b5834087 100644 --- a/Sources/DOMKit/WebIDL/VideoDecoderInit.swift +++ b/Sources/DOMKit/WebIDL/VideoDecoderInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class VideoDecoderInit: BridgedDictionary { public convenience init(output: @escaping VideoFrameOutputCallback, error: @escaping WebCodecsErrorCallback) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute.Required1[Strings.output, in: object] = output - ClosureAttribute.Required1[Strings.error, in: object] = error + ClosureAttribute1[Strings.output, in: object] = output + ClosureAttribute1[Strings.error, in: object] = error self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute.Required1(jsObject: object, name: Strings.output) - _error = ClosureAttribute.Required1(jsObject: object, name: Strings.error) + _output = ClosureAttribute1(jsObject: object, name: Strings.output) + _error = ClosureAttribute1(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } - @ClosureAttribute.Required1 + @ClosureAttribute1 public var output: VideoFrameOutputCallback - @ClosureAttribute.Required1 + @ClosureAttribute1 public var error: WebCodecsErrorCallback } diff --git a/Sources/DOMKit/WebIDL/VideoEncoderInit.swift b/Sources/DOMKit/WebIDL/VideoEncoderInit.swift index d79ef2a3..82b361c3 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoderInit.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoderInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class VideoEncoderInit: BridgedDictionary { public convenience init(output: @escaping EncodedVideoChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute.Required2[Strings.output, in: object] = output - ClosureAttribute.Required1[Strings.error, in: object] = error + ClosureAttribute2[Strings.output, in: object] = output + ClosureAttribute1[Strings.error, in: object] = error self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute.Required2(jsObject: object, name: Strings.output) - _error = ClosureAttribute.Required1(jsObject: object, name: Strings.error) + _output = ClosureAttribute2(jsObject: object, name: Strings.output) + _error = ClosureAttribute1(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } - @ClosureAttribute.Required2 + @ClosureAttribute2 public var output: EncodedVideoChunkOutputCallback - @ClosureAttribute.Required1 + @ClosureAttribute1 public var error: WebCodecsErrorCallback } diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift index 0d3ba7e6..a46c9046 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackList.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -9,9 +9,9 @@ public class VideoTrackList: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedIndex) - _onchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onchange) - _onaddtrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onaddtrack) - _onremovetrack = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onremovetrack) + _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) } @@ -29,12 +29,12 @@ public class VideoTrackList: EventTarget { @ReadonlyAttribute public var selectedIndex: Int32 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onchange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onaddtrack: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onremovetrack: EventHandler } diff --git a/Sources/DOMKit/WebIDL/VirtualKeyboard.swift b/Sources/DOMKit/WebIDL/VirtualKeyboard.swift index 77d8356e..afeaa704 100644 --- a/Sources/DOMKit/WebIDL/VirtualKeyboard.swift +++ b/Sources/DOMKit/WebIDL/VirtualKeyboard.swift @@ -9,7 +9,7 @@ public class VirtualKeyboard: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _boundingRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingRect) _overlaysContent = ReadWriteAttribute(jsObject: jsObject, name: Strings.overlaysContent) - _ongeometrychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ongeometrychange) + _ongeometrychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ongeometrychange) super.init(unsafelyWrapping: jsObject) } @@ -27,6 +27,6 @@ public class VirtualKeyboard: EventTarget { @ReadWriteAttribute public var overlaysContent: Bool - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ongeometrychange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/VisualViewport.swift b/Sources/DOMKit/WebIDL/VisualViewport.swift index e1bbd111..8b87f4c2 100644 --- a/Sources/DOMKit/WebIDL/VisualViewport.swift +++ b/Sources/DOMKit/WebIDL/VisualViewport.swift @@ -15,8 +15,8 @@ public class VisualViewport: EventTarget { _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) _scale = ReadonlyAttribute(jsObject: jsObject, name: Strings.scale) _segments = ReadonlyAttribute(jsObject: jsObject, name: Strings.segments) - _onresize = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onresize) - _onscroll = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onscroll) + _onresize = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresize) + _onscroll = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onscroll) super.init(unsafelyWrapping: jsObject) } @@ -44,9 +44,9 @@ public class VisualViewport: EventTarget { @ReadonlyAttribute public var segments: [DOMRect]? - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onresize: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onscroll: EventHandler } diff --git a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift index aaeb54d4..2616b120 100644 --- a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift +++ b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift @@ -9,7 +9,7 @@ public class WakeLockSentinel: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _released = ReadonlyAttribute(jsObject: jsObject, name: Strings.released) _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _onrelease = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrelease) + _onrelease = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onrelease) super.init(unsafelyWrapping: jsObject) } @@ -29,6 +29,6 @@ public class WakeLockSentinel: EventTarget { _ = try await _promise.get() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onrelease: EventHandler } diff --git a/Sources/DOMKit/WebIDL/WebSocket.swift b/Sources/DOMKit/WebIDL/WebSocket.swift index 0706f117..79137559 100644 --- a/Sources/DOMKit/WebIDL/WebSocket.swift +++ b/Sources/DOMKit/WebIDL/WebSocket.swift @@ -10,12 +10,12 @@ public class WebSocket: EventTarget { _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) _bufferedAmount = ReadonlyAttribute(jsObject: jsObject, name: Strings.bufferedAmount) - _onopen = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onopen) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onclose = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onclose) + _onopen = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onopen) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) _extensions = ReadonlyAttribute(jsObject: jsObject, name: Strings.extensions) _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) super.init(unsafelyWrapping: jsObject) } @@ -41,13 +41,13 @@ public class WebSocket: EventTarget { @ReadonlyAttribute public var bufferedAmount: UInt64 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onopen: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onclose: EventHandler @ReadonlyAttribute @@ -60,7 +60,7 @@ public class WebSocket: EventTarget { _ = jsObject[Strings.close]!(code?.jsValue() ?? .undefined, reason?.jsValue() ?? .undefined) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 8c6bf331..2d0057b5 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -8,7 +8,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public required init(unsafelyWrapping jsObject: JSObject) { _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) - _onorientationchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onorientationchange) + _onorientationchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onorientationchange) _attributionReporting = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributionReporting) _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) _screen = ReadonlyAttribute(jsObject: jsObject, name: Strings.screen) @@ -51,13 +51,13 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind _clientInformation = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientInformation) _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: Strings.originAgentCluster) _external = ReadonlyAttribute(jsObject: jsObject, name: Strings.external) - _onappinstalled = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onappinstalled) - _onbeforeinstallprompt = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onbeforeinstallprompt) + _onappinstalled = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onappinstalled) + _onbeforeinstallprompt = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbeforeinstallprompt) _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) - _ondeviceorientation = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientation) - _ondeviceorientationabsolute = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondeviceorientationabsolute) - _oncompassneedscalibration = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oncompassneedscalibration) - _ondevicemotion = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicemotion) + _ondeviceorientation = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondeviceorientation) + _ondeviceorientationabsolute = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondeviceorientationabsolute) + _oncompassneedscalibration = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncompassneedscalibration) + _ondevicemotion = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondevicemotion) _portalHost = ReadonlyAttribute(jsObject: jsObject, name: Strings.portalHost) _speechSynthesis = ReadonlyAttribute(jsObject: jsObject, name: Strings.speechSynthesis) _visualViewport = ReadonlyAttribute(jsObject: jsObject, name: Strings.visualViewport) @@ -67,7 +67,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var orientation: Int16 - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onorientationchange: EventHandler @ReadonlyAttribute @@ -348,25 +348,25 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var external: External - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onappinstalled: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onbeforeinstallprompt: EventHandler @ReadonlyAttribute public var navigation: Navigation - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondeviceorientation: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondeviceorientationabsolute: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oncompassneedscalibration: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondevicemotion: EventHandler @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift index 604689e3..919f581d 100644 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift @@ -8,7 +8,7 @@ public class WindowControlsOverlay: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _visible = ReadonlyAttribute(jsObject: jsObject, name: Strings.visible) - _ongeometrychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ongeometrychange) + _ongeometrychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ongeometrychange) super.init(unsafelyWrapping: jsObject) } @@ -19,6 +19,6 @@ public class WindowControlsOverlay: EventTarget { jsObject[Strings.getTitlebarAreaRect]!().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ongeometrychange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index 98ffe4f6..52eb6527 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -6,97 +6,97 @@ import JavaScriptKit public protocol WindowEventHandlers: JSBridgedClass {} public extension WindowEventHandlers { var ongamepadconnected: EventHandler { - get { ClosureAttribute.Optional1[Strings.ongamepadconnected, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ongamepadconnected, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] = newValue } } var ongamepaddisconnected: EventHandler { - get { ClosureAttribute.Optional1[Strings.ongamepaddisconnected, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ongamepaddisconnected, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ongamepaddisconnected, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ongamepaddisconnected, in: jsObject] = newValue } } var onafterprint: EventHandler { - get { ClosureAttribute.Optional1[Strings.onafterprint, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onafterprint, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onafterprint, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onafterprint, in: jsObject] = newValue } } var onbeforeprint: EventHandler { - get { ClosureAttribute.Optional1[Strings.onbeforeprint, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onbeforeprint, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onbeforeprint, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onbeforeprint, in: jsObject] = newValue } } var onbeforeunload: OnBeforeUnloadEventHandler { - get { ClosureAttribute.Optional1[Strings.onbeforeunload, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onbeforeunload, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onbeforeunload, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onbeforeunload, in: jsObject] = newValue } } var onhashchange: EventHandler { - get { ClosureAttribute.Optional1[Strings.onhashchange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onhashchange, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onhashchange, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onhashchange, in: jsObject] = newValue } } var onlanguagechange: EventHandler { - get { ClosureAttribute.Optional1[Strings.onlanguagechange, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onlanguagechange, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onlanguagechange, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onlanguagechange, in: jsObject] = newValue } } var onmessage: EventHandler { - get { ClosureAttribute.Optional1[Strings.onmessage, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onmessage, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onmessage, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onmessage, in: jsObject] = newValue } } var onmessageerror: EventHandler { - get { ClosureAttribute.Optional1[Strings.onmessageerror, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onmessageerror, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onmessageerror, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onmessageerror, in: jsObject] = newValue } } var onoffline: EventHandler { - get { ClosureAttribute.Optional1[Strings.onoffline, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onoffline, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onoffline, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onoffline, in: jsObject] = newValue } } var ononline: EventHandler { - get { ClosureAttribute.Optional1[Strings.ononline, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.ononline, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.ononline, in: jsObject] } + set { ClosureAttribute1Optional[Strings.ononline, in: jsObject] = newValue } } var onpagehide: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpagehide, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpagehide, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpagehide, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpagehide, in: jsObject] = newValue } } var onpageshow: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpageshow, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpageshow, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpageshow, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpageshow, in: jsObject] = newValue } } var onpopstate: EventHandler { - get { ClosureAttribute.Optional1[Strings.onpopstate, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onpopstate, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onpopstate, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onpopstate, in: jsObject] = newValue } } var onrejectionhandled: EventHandler { - get { ClosureAttribute.Optional1[Strings.onrejectionhandled, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onrejectionhandled, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onrejectionhandled, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onrejectionhandled, in: jsObject] = newValue } } var onstorage: EventHandler { - get { ClosureAttribute.Optional1[Strings.onstorage, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onstorage, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onstorage, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onstorage, in: jsObject] = newValue } } var onunhandledrejection: EventHandler { - get { ClosureAttribute.Optional1[Strings.onunhandledrejection, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onunhandledrejection, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onunhandledrejection, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onunhandledrejection, in: jsObject] = newValue } } var onunload: EventHandler { - get { ClosureAttribute.Optional1[Strings.onunload, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onunload, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onunload, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onunload, in: jsObject] = newValue } } var onportalactivate: EventHandler { - get { ClosureAttribute.Optional1[Strings.onportalactivate, in: jsObject] } - set { ClosureAttribute.Optional1[Strings.onportalactivate, in: jsObject] = newValue } + get { ClosureAttribute1Optional[Strings.onportalactivate, in: jsObject] } + set { ClosureAttribute1Optional[Strings.onportalactivate, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index 559dd24e..7c1c7be9 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -7,8 +7,8 @@ public class Worker: EventTarget, AbstractWorker { override public class var constructor: JSFunction { JSObject.global[Strings.Worker].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onmessage = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onmessageerror) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) super.init(unsafelyWrapping: jsObject) } @@ -28,9 +28,9 @@ public class Worker: EventTarget, AbstractWorker { _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessage: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onmessageerror: EventHandler } diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index f93d024c..880013e5 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -10,12 +10,12 @@ public class WorkerGlobalScope: EventTarget, FontFaceSource, WindowOrWorkerGloba _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) _navigator = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigator) - _onerror = ClosureAttribute.Optional5(jsObject: jsObject, name: Strings.onerror) - _onlanguagechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onlanguagechange) - _onoffline = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onoffline) - _ononline = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ononline) - _onrejectionhandled = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onrejectionhandled) - _onunhandledrejection = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onunhandledrejection) + _onerror = ClosureAttribute5Optional(jsObject: jsObject, name: Strings.onerror) + _onlanguagechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onlanguagechange) + _onoffline = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onoffline) + _ononline = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ononline) + _onrejectionhandled = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onrejectionhandled) + _onunhandledrejection = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onunhandledrejection) super.init(unsafelyWrapping: jsObject) } @@ -32,21 +32,21 @@ public class WorkerGlobalScope: EventTarget, FontFaceSource, WindowOrWorkerGloba _ = jsObject[Strings.importScripts]!(urls.jsValue()) } - @ClosureAttribute.Optional5 + @ClosureAttribute5Optional public var onerror: OnErrorEventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onlanguagechange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onoffline: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ononline: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onrejectionhandled: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onunhandledrejection: EventHandler } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index dec13ef4..ee7294be 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -7,7 +7,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequest].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onreadystatechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreadystatechange) + _onreadystatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreadystatechange) _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) _timeout = ReadWriteAttribute(jsObject: jsObject, name: Strings.timeout) _withCredentials = ReadWriteAttribute(jsObject: jsObject, name: Strings.withCredentials) @@ -26,7 +26,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { self.init(unsafelyWrapping: Self.constructor.new()) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onreadystatechange: EventHandler public static let UNSENT: UInt16 = 0 diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift index 31a46b8a..d55db1f0 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift @@ -7,34 +7,34 @@ public class XMLHttpRequestEventTarget: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequestEventTarget].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onloadstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadstart) - _onprogress = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onprogress) - _onabort = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onabort) - _onerror = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onerror) - _onload = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onload) - _ontimeout = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ontimeout) - _onloadend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onloadend) + _onloadstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloadstart) + _onprogress = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onprogress) + _onabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onabort) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _onload = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onload) + _ontimeout = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontimeout) + _onloadend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloadend) super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onloadstart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onprogress: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onabort: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onerror: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onload: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ontimeout: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onloadend: EventHandler } diff --git a/Sources/DOMKit/WebIDL/XRCubeLayer.swift b/Sources/DOMKit/WebIDL/XRCubeLayer.swift index 86328e7c..ea470713 100644 --- a/Sources/DOMKit/WebIDL/XRCubeLayer.swift +++ b/Sources/DOMKit/WebIDL/XRCubeLayer.swift @@ -9,7 +9,7 @@ public class XRCubeLayer: XRCompositionLayer { public required init(unsafelyWrapping jsObject: JSObject) { _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) _orientation = ReadWriteAttribute(jsObject: jsObject, name: Strings.orientation) - _onredraw = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onredraw) + _onredraw = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onredraw) super.init(unsafelyWrapping: jsObject) } @@ -19,6 +19,6 @@ public class XRCubeLayer: XRCompositionLayer { @ReadWriteAttribute public var orientation: DOMPointReadOnly - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onredraw: EventHandler } diff --git a/Sources/DOMKit/WebIDL/XRCylinderLayer.swift b/Sources/DOMKit/WebIDL/XRCylinderLayer.swift index a6a24d51..179be2b8 100644 --- a/Sources/DOMKit/WebIDL/XRCylinderLayer.swift +++ b/Sources/DOMKit/WebIDL/XRCylinderLayer.swift @@ -12,7 +12,7 @@ public class XRCylinderLayer: XRCompositionLayer { _radius = ReadWriteAttribute(jsObject: jsObject, name: Strings.radius) _centralAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.centralAngle) _aspectRatio = ReadWriteAttribute(jsObject: jsObject, name: Strings.aspectRatio) - _onredraw = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onredraw) + _onredraw = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onredraw) super.init(unsafelyWrapping: jsObject) } @@ -31,6 +31,6 @@ public class XRCylinderLayer: XRCompositionLayer { @ReadWriteAttribute public var aspectRatio: Float - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onredraw: EventHandler } diff --git a/Sources/DOMKit/WebIDL/XREquirectLayer.swift b/Sources/DOMKit/WebIDL/XREquirectLayer.swift index 86ce4f71..c161f741 100644 --- a/Sources/DOMKit/WebIDL/XREquirectLayer.swift +++ b/Sources/DOMKit/WebIDL/XREquirectLayer.swift @@ -13,7 +13,7 @@ public class XREquirectLayer: XRCompositionLayer { _centralHorizontalAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.centralHorizontalAngle) _upperVerticalAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.upperVerticalAngle) _lowerVerticalAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.lowerVerticalAngle) - _onredraw = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onredraw) + _onredraw = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onredraw) super.init(unsafelyWrapping: jsObject) } @@ -35,6 +35,6 @@ public class XREquirectLayer: XRCompositionLayer { @ReadWriteAttribute public var lowerVerticalAngle: Float - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onredraw: EventHandler } diff --git a/Sources/DOMKit/WebIDL/XRLightProbe.swift b/Sources/DOMKit/WebIDL/XRLightProbe.swift index fc146987..fc1e00eb 100644 --- a/Sources/DOMKit/WebIDL/XRLightProbe.swift +++ b/Sources/DOMKit/WebIDL/XRLightProbe.swift @@ -8,13 +8,13 @@ public class XRLightProbe: EventTarget { public required init(unsafelyWrapping jsObject: JSObject) { _probeSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.probeSpace) - _onreflectionchange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreflectionchange) + _onreflectionchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreflectionchange) super.init(unsafelyWrapping: jsObject) } @ReadonlyAttribute public var probeSpace: XRSpace - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onreflectionchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/XRQuadLayer.swift b/Sources/DOMKit/WebIDL/XRQuadLayer.swift index 95d3d5a1..eb6b6148 100644 --- a/Sources/DOMKit/WebIDL/XRQuadLayer.swift +++ b/Sources/DOMKit/WebIDL/XRQuadLayer.swift @@ -11,7 +11,7 @@ public class XRQuadLayer: XRCompositionLayer { _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) - _onredraw = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onredraw) + _onredraw = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onredraw) super.init(unsafelyWrapping: jsObject) } @@ -27,6 +27,6 @@ public class XRQuadLayer: XRCompositionLayer { @ReadWriteAttribute public var height: Float - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onredraw: EventHandler } diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift index 5b4b918b..6ca4eb69 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift @@ -7,7 +7,7 @@ public class XRReferenceSpace: XRSpace { override public class var constructor: JSFunction { JSObject.global[Strings.XRReferenceSpace].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onreset = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onreset) + _onreset = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreset) super.init(unsafelyWrapping: jsObject) } @@ -15,6 +15,6 @@ public class XRReferenceSpace: XRSpace { jsObject[Strings.getOffsetReferenceSpace]!(originOffset.jsValue()).fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onreset: EventHandler } diff --git a/Sources/DOMKit/WebIDL/XRSession.swift b/Sources/DOMKit/WebIDL/XRSession.swift index 0438b989..c84ff387 100644 --- a/Sources/DOMKit/WebIDL/XRSession.swift +++ b/Sources/DOMKit/WebIDL/XRSession.swift @@ -18,16 +18,16 @@ public class XRSession: EventTarget { _supportedFrameRates = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedFrameRates) _renderState = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderState) _inputSources = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputSources) - _onend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onend) - _oninputsourceschange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.oninputsourceschange) - _onselect = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onselect) - _onselectstart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onselectstart) - _onselectend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onselectend) - _onsqueeze = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsqueeze) - _onsqueezestart = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsqueezestart) - _onsqueezeend = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onsqueezeend) - _onvisibilitychange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onvisibilitychange) - _onframeratechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.onframeratechange) + _onend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onend) + _oninputsourceschange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oninputsourceschange) + _onselect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onselect) + _onselectstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onselectstart) + _onselectend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onselectend) + _onsqueeze = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsqueeze) + _onsqueezestart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsqueezestart) + _onsqueezeend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsqueezeend) + _onvisibilitychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onvisibilitychange) + _onframeratechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onframeratechange) super.init(unsafelyWrapping: jsObject) } @@ -134,33 +134,33 @@ public class XRSession: EventTarget { _ = try await _promise.get() } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onend: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var oninputsourceschange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onselect: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onselectstart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onselectend: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsqueeze: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsqueezestart: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onsqueezeend: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onvisibilitychange: EventHandler - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var onframeratechange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/XRSystem.swift b/Sources/DOMKit/WebIDL/XRSystem.swift index 16d64305..1d5f708a 100644 --- a/Sources/DOMKit/WebIDL/XRSystem.swift +++ b/Sources/DOMKit/WebIDL/XRSystem.swift @@ -7,7 +7,7 @@ public class XRSystem: EventTarget { override public class var constructor: JSFunction { JSObject.global[Strings.XRSystem].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _ondevicechange = ClosureAttribute.Optional1(jsObject: jsObject, name: Strings.ondevicechange) + _ondevicechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondevicechange) super.init(unsafelyWrapping: jsObject) } @@ -31,6 +31,6 @@ public class XRSystem: EventTarget { return try await _promise.get().fromJSValue()! } - @ClosureAttribute.Optional1 + @ClosureAttribute1Optional public var ondevicechange: EventHandler } diff --git a/Sources/WebIDLToSwift/ClosureWrappers.swift b/Sources/WebIDLToSwift/ClosurePattern.swift similarity index 90% rename from Sources/WebIDLToSwift/ClosureWrappers.swift rename to Sources/WebIDLToSwift/ClosurePattern.swift index 2188f127..611b4298 100644 --- a/Sources/WebIDLToSwift/ClosureWrappers.swift +++ b/Sources/WebIDLToSwift/ClosurePattern.swift @@ -1,13 +1,13 @@ -struct ClosureWrapper: SwiftRepresentable, Equatable { +struct ClosurePattern: SwiftRepresentable, Equatable, Hashable, Comparable { + static func < (lhs: ClosurePattern, rhs: ClosurePattern) -> Bool { + lhs.name.source < rhs.name.source + } + let nullable: Bool let argCount: Int var name: SwiftSource { - if nullable { - return "Optional\(String(argCount))" - } else { - return "Required\(String(argCount))" - } + "ClosureAttribute\(String(argCount))\(nullable ? "Optional" : "")" } var indexes: [String] { (0 ..< argCount).map(String.init) } diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index 0195cf4f..36e0ac0a 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -2,7 +2,7 @@ enum Context { private(set) static var current = State() - static var requiredClosureArgCounts: Set = [] + static var closurePatterns: Set = [] private(set) static var strings: Set = ["toString"] static func source(for name: String) -> SwiftSource { diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index af15402a..e03ae8d5 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -101,16 +101,9 @@ enum IDLBuilder { } static func generateClosureTypes() throws { - let argCounts = Context.requiredClosureArgCounts.sorted() let closureTypesContent: SwiftSource = """ /* variadic generics please */ - public enum ClosureAttribute { - // MARK: Required closures - \(lines: argCounts.map { ClosureWrapper(nullable: false, argCount: $0).swiftRepresentation }) - - // MARK: - Optional closures - \(lines: argCounts.map { ClosureWrapper(nullable: true, argCount: $0).swiftRepresentation }) - } + \(lines: Context.closurePatterns.sorted().map(\.swiftRepresentation)) """ try writeFile(named: "ClosureAttribute", content: closureTypesContent.source) diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 9dba7e80..878a72f2 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -140,7 +140,8 @@ extension IDLEnum: SwiftRepresentable { extension IDLCallback: SwiftRepresentable { var swiftRepresentation: SwiftSource { - Context.requiredClosureArgCounts.insert(arguments.count) + Context.closurePatterns.insert(ClosurePattern(nullable: false, argCount: arguments.count)) + Context.closurePatterns.insert(ClosurePattern(nullable: true, argCount: arguments.count)) return """ public typealias \(name) = (\(sequence: arguments.map { "\($0.idlType)\($0.variadic ? "..." : "")" @@ -560,14 +561,14 @@ extension IDLType: SwiftRepresentable { if case let .single(name) = value { let readonlyComment: SwiftSource = readonly ? " /* XXX: should be readonly! */ " : "" if let callback = Context.types[name] as? IDLCallback { - return "ClosureAttribute.Required\(String(callback.arguments.count))\(readonlyComment)" + return "ClosureAttribute\(String(callback.arguments.count))\(readonlyComment)" } if let ref = Context.types[name] as? IDLTypedef, case let .single(name) = ref.idlType.value, let callback = Context.types[name] as? IDLCallback { assert(ref.idlType.nullable) - return "ClosureAttribute.Optional\(String(callback.arguments.count))\(readonlyComment)" + return "ClosureAttribute\(String(callback.arguments.count))Optional\(readonlyComment)" } } From 0544fde16d93918cb353e2dbcc485896c584cf14 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 11:04:08 -0400 Subject: [PATCH 096/124] Add support for void-returning closures --- Sources/DOMKit/WebIDL/AudioDecoderInit.swift | 12 +- Sources/DOMKit/WebIDL/AudioEncoderInit.swift | 12 +- Sources/DOMKit/WebIDL/ClosureAttribute.swift | 260 ++++++++++++++++++ Sources/DOMKit/WebIDL/VideoDecoderInit.swift | 12 +- Sources/DOMKit/WebIDL/VideoEncoderInit.swift | 12 +- Sources/WebIDLToSwift/ClosurePattern.swift | 40 ++- Sources/WebIDLToSwift/IDLBuilder.swift | 5 - .../WebIDL+SwiftRepresentation.swift | 16 +- 8 files changed, 328 insertions(+), 41 deletions(-) diff --git a/Sources/DOMKit/WebIDL/AudioDecoderInit.swift b/Sources/DOMKit/WebIDL/AudioDecoderInit.swift index a3eb3df6..b98e0449 100644 --- a/Sources/DOMKit/WebIDL/AudioDecoderInit.swift +++ b/Sources/DOMKit/WebIDL/AudioDecoderInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class AudioDecoderInit: BridgedDictionary { public convenience init(output: @escaping AudioDataOutputCallback, error: @escaping WebCodecsErrorCallback) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute1[Strings.output, in: object] = output - ClosureAttribute1[Strings.error, in: object] = error + ClosureAttribute1Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute1(jsObject: object, name: Strings.output) - _error = ClosureAttribute1(jsObject: object, name: Strings.error) + _output = ClosureAttribute1Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } - @ClosureAttribute1 + @ClosureAttribute1Void public var output: AudioDataOutputCallback - @ClosureAttribute1 + @ClosureAttribute1Void public var error: WebCodecsErrorCallback } diff --git a/Sources/DOMKit/WebIDL/AudioEncoderInit.swift b/Sources/DOMKit/WebIDL/AudioEncoderInit.swift index f3e36064..550e8415 100644 --- a/Sources/DOMKit/WebIDL/AudioEncoderInit.swift +++ b/Sources/DOMKit/WebIDL/AudioEncoderInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class AudioEncoderInit: BridgedDictionary { public convenience init(output: @escaping EncodedAudioChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute2[Strings.output, in: object] = output - ClosureAttribute1[Strings.error, in: object] = error + ClosureAttribute2Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute2(jsObject: object, name: Strings.output) - _error = ClosureAttribute1(jsObject: object, name: Strings.error) + _output = ClosureAttribute2Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } - @ClosureAttribute2 + @ClosureAttribute2Void public var output: EncodedAudioChunkOutputCallback - @ClosureAttribute1 + @ClosureAttribute1Void public var error: WebCodecsErrorCallback } diff --git a/Sources/DOMKit/WebIDL/ClosureAttribute.swift b/Sources/DOMKit/WebIDL/ClosureAttribute.swift index b4b6ce59..549790e5 100644 --- a/Sources/DOMKit/WebIDL/ClosureAttribute.swift +++ b/Sources/DOMKit/WebIDL/ClosureAttribute.swift @@ -68,6 +68,68 @@ import JavaScriptKit } } +@propertyWrapper public final class ClosureAttribute0OptionalVoid { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString + + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: (() -> Void)? { + get { ClosureAttribute0OptionalVoid[name, in: jsObject] } + set { ClosureAttribute0OptionalVoid[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (() -> Void)? { + get { + guard let function = jsObject[name].function else { + return nil + } + return { function() } + } + set { + if let newValue = newValue { + jsObject[name] = JSClosure { _ in + newValue() + return .undefined + }.jsValue() + } else { + jsObject[name] = .null + } + } + } +} + +@propertyWrapper public final class ClosureAttribute0Void { + @usableFromInline let jsObject: JSObject + @usableFromInline let name: JSString + + public init(jsObject: JSObject, name: JSString) { + self.jsObject = jsObject + self.name = name + } + + @inlinable public var wrappedValue: () -> Void { + get { ClosureAttribute0Void[name, in: jsObject] } + set { ClosureAttribute0Void[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> () -> Void { + get { + let function = jsObject[name].function! + return { function() } + } + set { + jsObject[name] = JSClosure { _ in + newValue() + return .undefined + }.jsValue() + } + } +} + @propertyWrapper public final class ClosureAttribute1 where A0: JSValueCompatible, ReturnType: JSValueCompatible { @@ -132,6 +194,72 @@ import JavaScriptKit } } +@propertyWrapper public final class ClosureAttribute1OptionalVoid + where A0: 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) -> Void)? { + get { ClosureAttribute1OptionalVoid[name, in: jsObject] } + set { ClosureAttribute1OptionalVoid[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0) -> Void)? { + get { + guard let function = jsObject[name].function else { + return nil + } + return { function($0.jsValue()) } + } + set { + if let newValue = newValue { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!) + return .undefined + }.jsValue() + } else { + jsObject[name] = .null + } + } + } +} + +@propertyWrapper public final class ClosureAttribute1Void + where A0: 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) -> Void { + get { ClosureAttribute1Void[name, in: jsObject] } + set { ClosureAttribute1Void[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0) -> Void { + get { + let function = jsObject[name].function! + return { function($0.jsValue()) } + } + set { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!) + return .undefined + }.jsValue() + } + } +} + @propertyWrapper public final class ClosureAttribute2 where A0: JSValueCompatible, A1: JSValueCompatible, ReturnType: JSValueCompatible { @@ -196,6 +324,72 @@ import JavaScriptKit } } +@propertyWrapper public final class ClosureAttribute2OptionalVoid + where A0: JSValueCompatible, A1: 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) -> Void)? { + get { ClosureAttribute2OptionalVoid[name, in: jsObject] } + set { ClosureAttribute2OptionalVoid[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1) -> Void)? { + get { + guard let function = jsObject[name].function else { + return nil + } + return { function($0.jsValue(), $1.jsValue()) } + } + set { + if let newValue = newValue { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!) + return .undefined + }.jsValue() + } else { + jsObject[name] = .null + } + } + } +} + +@propertyWrapper public final class ClosureAttribute2Void + where A0: JSValueCompatible, A1: 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) -> Void { + get { ClosureAttribute2Void[name, in: jsObject] } + set { ClosureAttribute2Void[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1) -> Void { + get { + let function = jsObject[name].function! + return { function($0.jsValue(), $1.jsValue()) } + } + set { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!) + return .undefined + }.jsValue() + } + } +} + @propertyWrapper public final class ClosureAttribute3 where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, ReturnType: JSValueCompatible { @@ -260,6 +454,72 @@ import JavaScriptKit } } +@propertyWrapper public final class ClosureAttribute3OptionalVoid + where A0: JSValueCompatible, A1: JSValueCompatible, A2: 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, A2) -> Void)? { + get { ClosureAttribute3OptionalVoid[name, in: jsObject] } + set { ClosureAttribute3OptionalVoid[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1, A2) -> Void)? { + get { + guard let function = jsObject[name].function else { + return nil + } + return { function($0.jsValue(), $1.jsValue(), $2.jsValue()) } + } + set { + if let newValue = newValue { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!) + return .undefined + }.jsValue() + } else { + jsObject[name] = .null + } + } + } +} + +@propertyWrapper public final class ClosureAttribute3Void + where A0: JSValueCompatible, A1: JSValueCompatible, A2: 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, A2) -> Void { + get { ClosureAttribute3Void[name, in: jsObject] } + set { ClosureAttribute3Void[name, in: jsObject] = newValue } + } + + @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2) -> Void { + get { + let function = jsObject[name].function! + return { function($0.jsValue(), $1.jsValue(), $2.jsValue()) } + } + set { + jsObject[name] = JSClosure { + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!) + return .undefined + }.jsValue() + } + } +} + @propertyWrapper public final class ClosureAttribute5 where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible { diff --git a/Sources/DOMKit/WebIDL/VideoDecoderInit.swift b/Sources/DOMKit/WebIDL/VideoDecoderInit.swift index b5834087..0614f47e 100644 --- a/Sources/DOMKit/WebIDL/VideoDecoderInit.swift +++ b/Sources/DOMKit/WebIDL/VideoDecoderInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class VideoDecoderInit: BridgedDictionary { public convenience init(output: @escaping VideoFrameOutputCallback, error: @escaping WebCodecsErrorCallback) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute1[Strings.output, in: object] = output - ClosureAttribute1[Strings.error, in: object] = error + ClosureAttribute1Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute1(jsObject: object, name: Strings.output) - _error = ClosureAttribute1(jsObject: object, name: Strings.error) + _output = ClosureAttribute1Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } - @ClosureAttribute1 + @ClosureAttribute1Void public var output: VideoFrameOutputCallback - @ClosureAttribute1 + @ClosureAttribute1Void public var error: WebCodecsErrorCallback } diff --git a/Sources/DOMKit/WebIDL/VideoEncoderInit.swift b/Sources/DOMKit/WebIDL/VideoEncoderInit.swift index 82b361c3..f9859e1b 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoderInit.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoderInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class VideoEncoderInit: BridgedDictionary { public convenience init(output: @escaping EncodedVideoChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute2[Strings.output, in: object] = output - ClosureAttribute1[Strings.error, in: object] = error + ClosureAttribute2Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute2(jsObject: object, name: Strings.output) - _error = ClosureAttribute1(jsObject: object, name: Strings.error) + _output = ClosureAttribute2Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } - @ClosureAttribute2 + @ClosureAttribute2Void public var output: EncodedVideoChunkOutputCallback - @ClosureAttribute1 + @ClosureAttribute1Void public var error: WebCodecsErrorCallback } diff --git a/Sources/WebIDLToSwift/ClosurePattern.swift b/Sources/WebIDLToSwift/ClosurePattern.swift index 611b4298..2ece2931 100644 --- a/Sources/WebIDLToSwift/ClosurePattern.swift +++ b/Sources/WebIDLToSwift/ClosurePattern.swift @@ -4,20 +4,21 @@ struct ClosurePattern: SwiftRepresentable, Equatable, Hashable, Comparable { } let nullable: Bool + let void: Bool let argCount: Int var name: SwiftSource { - "ClosureAttribute\(String(argCount))\(nullable ? "Optional" : "")" + "ClosureAttribute\(String(argCount))\(nullable ? "Optional" : "")\(void ? "Void" : "")" } var indexes: [String] { (0 ..< argCount).map(String.init) } private var typeNames: [SwiftSource] { - indexes.map { "A\($0)" } + ["ReturnType"] + indexes.map { "A\($0)" } + (void ? [] : ["ReturnType"]) } private var closureType: SwiftSource { - let closure: SwiftSource = "(\(sequence: typeNames.dropLast())) -> ReturnType" + let closure: SwiftSource = "(\(sequence: Array(typeNames.prefix(argCount)))) -> \(void ? "Void" : "ReturnType")" return nullable ? "(\(closure))?" : closure } @@ -32,16 +33,33 @@ struct ClosurePattern: SwiftRepresentable, Equatable, Hashable, Comparable { } else { getFunction = "let function = jsObject[name].function!" } + let call: SwiftSource = "function(\(sequence: indexes.map { "$\($0).jsValue()" }))" + let closureBody: SwiftSource + if void { + closureBody = call + } else { + closureBody = "\(call).fromJSValue()!" + } return """ \(getFunction) - return { function(\(sequence: indexes.map { "$\($0).jsValue()" })).fromJSValue()! } + return { \(closureBody) } """ } private var setter: SwiftSource { + let call: SwiftSource = "newValue(\(sequence: indexes.map { "$0[\($0)].fromJSValue()!" }))" + let body: SwiftSource + if void { + body = """ + \(call) + return .undefined + """ + } else { + body = "\(call).jsValue()" + } let setClosure: SwiftSource = """ jsObject[name] = JSClosure { \(argCount == 0 ? "_ in" : "") - newValue(\(sequence: indexes.map { "$0[\($0)].fromJSValue()!" })).jsValue() + \(body) }.jsValue() """ @@ -58,11 +76,17 @@ struct ClosurePattern: SwiftRepresentable, Equatable, Hashable, Comparable { } } + var typeParams: SwiftSource { + if typeNames.isEmpty { return "" } + return """ + <\(sequence: typeNames)> + where \(sequence: typeNames.map { "\($0): JSValueCompatible" }) + """ + } + var swiftRepresentation: SwiftSource { """ - @propertyWrapper public final class \(name)<\(sequence: typeNames)> - where \(sequence: typeNames.map { "\($0): JSValueCompatible" }) - { + @propertyWrapper public final class \(name)\(typeParams) { @usableFromInline let jsObject: JSObject @usableFromInline let name: JSString diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index e03ae8d5..04c25b5d 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -69,11 +69,6 @@ enum IDLBuilder { "Window": ["requestIdleCallback"], "WindowOrWorkerGlobalScope": ["queueMicrotask"], "XRSession": ["requestAnimationFrame"], - // Void-returning functions are unsupported - "AudioDecoderInit": ["", "output", "error"], - "AudioEncoderInit": ["", "output", "error"], - "VideoDecoderInit": [" ", "output", "error"], - "VideoEncoderInit": ["", "output", "error"], // variadic functions are unsupported "TrustedTypePolicyOptions": ["", "createHTML", "createScript", "createScriptURL"], // functions as return types are unsupported diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 878a72f2..4616d16b 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -140,8 +140,9 @@ extension IDLEnum: SwiftRepresentable { extension IDLCallback: SwiftRepresentable { var swiftRepresentation: SwiftSource { - Context.closurePatterns.insert(ClosurePattern(nullable: false, argCount: arguments.count)) - Context.closurePatterns.insert(ClosurePattern(nullable: true, argCount: arguments.count)) + let isVoid = idlType.swiftRepresentation == "Void" + Context.closurePatterns.insert(ClosurePattern(nullable: false, void: isVoid, argCount: arguments.count)) + Context.closurePatterns.insert(ClosurePattern(nullable: true, void: isVoid, argCount: arguments.count)) return """ public typealias \(name) = (\(sequence: arguments.map { "\($0.idlType)\($0.variadic ? "..." : "")" @@ -561,14 +562,14 @@ extension IDLType: SwiftRepresentable { if case let .single(name) = value { let readonlyComment: SwiftSource = readonly ? " /* XXX: should be readonly! */ " : "" if let callback = Context.types[name] as? IDLCallback { - return "ClosureAttribute\(String(callback.arguments.count))\(readonlyComment)" + return "\(closureWrapper(callback, optional: false))\(readonlyComment)" } if let ref = Context.types[name] as? IDLTypedef, case let .single(name) = ref.idlType.value, let callback = Context.types[name] as? IDLCallback { assert(ref.idlType.nullable) - return "ClosureAttribute\(String(callback.arguments.count))Optional\(readonlyComment)" + return "\(closureWrapper(callback, optional: true))\(readonlyComment)" } } @@ -578,6 +579,13 @@ extension IDLType: SwiftRepresentable { return "ReadWriteAttribute" } } + + private func closureWrapper(_ callback: IDLCallback, optional: Bool) -> SwiftSource { + let void: SwiftSource = callback.idlType.swiftRepresentation == "Void" ? "Void" : "" + let optional: SwiftSource = optional ? "Optional" : "" + let argCount = String(callback.arguments.count) + return "ClosureAttribute\(argCount)\(optional)\(void)" + } } extension IDLTypedef: SwiftRepresentable { From cfd9f7930013d750b3d0eefcb353b9a3839cf7d9 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 11:37:06 -0400 Subject: [PATCH 097/124] Correctly handle variadic method parameters --- .../WebIDL/ANGLE_instanced_arrays.swift | 9 +- Sources/DOMKit/WebIDL/AbortController.swift | 3 +- Sources/DOMKit/WebIDL/AbortSignal.swift | 9 +- Sources/DOMKit/WebIDL/AnalyserNode.swift | 12 +- Sources/DOMKit/WebIDL/Animatable.swift | 6 +- Sources/DOMKit/WebIDL/Animation.swift | 24 +- Sources/DOMKit/WebIDL/AnimationEffect.swift | 21 +- .../WebIDL/AnimationFrameProvider.swift | 3 +- Sources/DOMKit/WebIDL/AnimationTimeline.swift | 3 +- .../DOMKit/WebIDL/AttributionReporting.swift | 6 +- Sources/DOMKit/WebIDL/AudioBuffer.swift | 9 +- .../DOMKit/WebIDL/AudioBufferSourceNode.swift | 3 +- Sources/DOMKit/WebIDL/AudioContext.swift | 33 +- Sources/DOMKit/WebIDL/AudioData.swift | 12 +- Sources/DOMKit/WebIDL/AudioDecoder.swift | 24 +- Sources/DOMKit/WebIDL/AudioEncoder.swift | 24 +- Sources/DOMKit/WebIDL/AudioListener.swift | 6 +- Sources/DOMKit/WebIDL/AudioNode.swift | 27 +- Sources/DOMKit/WebIDL/AudioParam.swift | 21 +- .../WebIDL/AudioScheduledSourceNode.swift | 6 +- Sources/DOMKit/WebIDL/AudioTrackList.swift | 3 +- .../AuthenticatorAttestationResponse.swift | 12 +- .../WebIDL/BackgroundFetchManager.swift | 18 +- .../WebIDL/BackgroundFetchRegistration.swift | 18 +- .../WebIDL/BackgroundFetchUpdateUIEvent.swift | 6 +- Sources/DOMKit/WebIDL/BarcodeDetector.swift | 12 +- Sources/DOMKit/WebIDL/BaseAudioContext.swift | 54 ++- .../WebIDL/BeforeInstallPromptEvent.swift | 6 +- Sources/DOMKit/WebIDL/BiquadFilterNode.swift | 3 +- Sources/DOMKit/WebIDL/Blob.swift | 18 +- Sources/DOMKit/WebIDL/Bluetooth.swift | 18 +- Sources/DOMKit/WebIDL/BluetoothDevice.swift | 6 +- .../BluetoothRemoteGATTCharacteristic.swift | 48 ++- .../BluetoothRemoteGATTDescriptor.swift | 12 +- .../WebIDL/BluetoothRemoteGATTServer.swift | 21 +- .../WebIDL/BluetoothRemoteGATTService.swift | 24 +- Sources/DOMKit/WebIDL/BluetoothUUID.swift | 12 +- Sources/DOMKit/WebIDL/Body.swift | 30 +- Sources/DOMKit/WebIDL/BroadcastChannel.swift | 6 +- .../BrowserCaptureMediaStreamTrack.swift | 9 +- Sources/DOMKit/WebIDL/CSS.swift | 222 +++++++---- Sources/DOMKit/WebIDL/CSSColorValue.swift | 3 +- .../WebIDL/CSSFontFeatureValuesMap.swift | 3 +- Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSKeyframesRule.swift | 9 +- Sources/DOMKit/WebIDL/CSSNestingRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSNumericValue.swift | 30 +- Sources/DOMKit/WebIDL/CSSPseudoElement.swift | 3 +- .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 12 +- Sources/DOMKit/WebIDL/CSSStyleRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 21 +- Sources/DOMKit/WebIDL/CSSStyleValue.swift | 6 +- .../DOMKit/WebIDL/CSSTransformComponent.swift | 3 +- Sources/DOMKit/WebIDL/CSSTransformValue.swift | 3 +- Sources/DOMKit/WebIDL/Cache.swift | 42 +- Sources/DOMKit/WebIDL/CacheStorage.swift | 30 +- .../DOMKit/WebIDL/CanMakePaymentEvent.swift | 3 +- .../CanvasCaptureMediaStreamTrack.swift | 3 +- Sources/DOMKit/WebIDL/CanvasDrawImage.swift | 9 +- Sources/DOMKit/WebIDL/CanvasDrawPath.swift | 33 +- .../WebIDL/CanvasFillStrokeStyles.swift | 12 +- Sources/DOMKit/WebIDL/CanvasGradient.swift | 3 +- Sources/DOMKit/WebIDL/CanvasImageData.swift | 15 +- Sources/DOMKit/WebIDL/CanvasPath.swift | 30 +- .../WebIDL/CanvasPathDrawingStyles.swift | 6 +- Sources/DOMKit/WebIDL/CanvasPattern.swift | 3 +- Sources/DOMKit/WebIDL/CanvasRect.swift | 9 +- .../WebIDL/CanvasRenderingContext2D.swift | 3 +- Sources/DOMKit/WebIDL/CanvasState.swift | 12 +- Sources/DOMKit/WebIDL/CanvasText.swift | 9 +- Sources/DOMKit/WebIDL/CanvasTransform.swift | 24 +- .../DOMKit/WebIDL/CanvasUserInterface.swift | 12 +- Sources/DOMKit/WebIDL/CaretPosition.swift | 3 +- Sources/DOMKit/WebIDL/CharacterData.swift | 15 +- Sources/DOMKit/WebIDL/ChildNode.swift | 12 +- Sources/DOMKit/WebIDL/Client.swift | 6 +- Sources/DOMKit/WebIDL/Clients.swift | 24 +- Sources/DOMKit/WebIDL/Clipboard.swift | 24 +- Sources/DOMKit/WebIDL/ClipboardItem.swift | 6 +- Sources/DOMKit/WebIDL/CloseWatcher.swift | 6 +- Sources/DOMKit/WebIDL/CompositionEvent.swift | 3 +- .../WebIDL/ComputePressureObserver.swift | 18 +- Sources/DOMKit/WebIDL/ContactAddress.swift | 3 +- Sources/DOMKit/WebIDL/ContactsManager.swift | 12 +- Sources/DOMKit/WebIDL/ContentIndex.swift | 18 +- Sources/DOMKit/WebIDL/CookieStore.swift | 48 ++- .../DOMKit/WebIDL/CookieStoreManager.swift | 18 +- Sources/DOMKit/WebIDL/CrashReportBody.swift | 3 +- Sources/DOMKit/WebIDL/Credential.swift | 3 +- .../DOMKit/WebIDL/CredentialsContainer.swift | 24 +- Sources/DOMKit/WebIDL/Crypto.swift | 6 +- .../DOMKit/WebIDL/CustomElementRegistry.swift | 6 +- Sources/DOMKit/WebIDL/CustomEvent.swift | 3 +- Sources/DOMKit/WebIDL/CustomStateSet.swift | 3 +- Sources/DOMKit/WebIDL/DOMImplementation.swift | 12 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 36 +- Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 60 ++- Sources/DOMKit/WebIDL/DOMParser.swift | 3 +- Sources/DOMKit/WebIDL/DOMPointReadOnly.swift | 9 +- Sources/DOMKit/WebIDL/DOMQuad.swift | 12 +- Sources/DOMKit/WebIDL/DOMRectReadOnly.swift | 6 +- Sources/DOMKit/WebIDL/DOMStringList.swift | 3 +- Sources/DOMKit/WebIDL/DOMTokenList.swift | 18 +- Sources/DOMKit/WebIDL/DataTransfer.swift | 12 +- Sources/DOMKit/WebIDL/DataTransferItem.swift | 12 +- .../DOMKit/WebIDL/DataTransferItemList.swift | 12 +- .../WebIDL/DedicatedWorkerGlobalScope.swift | 9 +- .../DOMKit/WebIDL/DeprecationReportBody.swift | 3 +- Sources/DOMKit/WebIDL/DeviceMotionEvent.swift | 6 +- .../WebIDL/DeviceOrientationEvent.swift | 6 +- .../DOMKit/WebIDL/DigitalGoodsService.swift | 24 +- Sources/DOMKit/WebIDL/Document.swift | 141 ++++--- .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 3 +- .../WebIDL/EXT_disjoint_timer_query.swift | 24 +- .../EXT_disjoint_timer_query_webgl2.swift | 3 +- Sources/DOMKit/WebIDL/EditContext.swift | 21 +- Sources/DOMKit/WebIDL/Element.swift | 144 ++++--- Sources/DOMKit/WebIDL/ElementInternals.swift | 12 +- Sources/DOMKit/WebIDL/EncodedAudioChunk.swift | 3 +- Sources/DOMKit/WebIDL/EncodedVideoChunk.swift | 3 +- Sources/DOMKit/WebIDL/Event.swift | 15 +- Sources/DOMKit/WebIDL/EventSource.swift | 3 +- Sources/DOMKit/WebIDL/EventTarget.swift | 3 +- Sources/DOMKit/WebIDL/ExtendableEvent.swift | 3 +- Sources/DOMKit/WebIDL/External.swift | 6 +- Sources/DOMKit/WebIDL/EyeDropper.swift | 6 +- Sources/DOMKit/WebIDL/FaceDetector.swift | 6 +- Sources/DOMKit/WebIDL/FetchEvent.swift | 3 +- Sources/DOMKit/WebIDL/FileReader.swift | 15 +- Sources/DOMKit/WebIDL/FileReaderSync.swift | 12 +- .../WebIDL/FileSystemDirectoryEntry.swift | 3 +- .../WebIDL/FileSystemDirectoryHandle.swift | 24 +- .../DOMKit/WebIDL/FileSystemFileHandle.swift | 12 +- Sources/DOMKit/WebIDL/FileSystemHandle.swift | 18 +- .../WebIDL/FileSystemWritableFileStream.swift | 18 +- Sources/DOMKit/WebIDL/FontFace.swift | 6 +- Sources/DOMKit/WebIDL/FontFaceSet.swift | 18 +- Sources/DOMKit/WebIDL/FontManager.swift | 6 +- Sources/DOMKit/WebIDL/FontMetadata.swift | 6 +- Sources/DOMKit/WebIDL/FormData.swift | 24 +- Sources/DOMKit/WebIDL/GPU.swift | 6 +- Sources/DOMKit/WebIDL/GPUAdapter.swift | 6 +- Sources/DOMKit/WebIDL/GPUBuffer.swift | 15 +- Sources/DOMKit/WebIDL/GPUCanvasContext.swift | 12 +- Sources/DOMKit/WebIDL/GPUCommandEncoder.swift | 30 +- .../DOMKit/WebIDL/GPUComputePassEncoder.swift | 12 +- .../DOMKit/WebIDL/GPUDebugCommandsMixin.swift | 9 +- Sources/DOMKit/WebIDL/GPUDevice.swift | 63 ++- Sources/DOMKit/WebIDL/GPUPipelineBase.swift | 3 +- .../WebIDL/GPUProgrammablePassEncoder.swift | 6 +- Sources/DOMKit/WebIDL/GPUQuerySet.swift | 3 +- Sources/DOMKit/WebIDL/GPUQueue.swift | 18 +- .../WebIDL/GPURenderBundleEncoder.swift | 3 +- .../DOMKit/WebIDL/GPURenderEncoderBase.swift | 21 +- .../DOMKit/WebIDL/GPURenderPassEncoder.swift | 24 +- Sources/DOMKit/WebIDL/GPUShaderModule.swift | 6 +- Sources/DOMKit/WebIDL/GPUTexture.swift | 6 +- .../DOMKit/WebIDL/GamepadHapticActuator.swift | 6 +- Sources/DOMKit/WebIDL/Geolocation.swift | 3 +- Sources/DOMKit/WebIDL/GeolocationSensor.swift | 6 +- Sources/DOMKit/WebIDL/GeometryUtils.swift | 12 +- Sources/DOMKit/WebIDL/GetSVGDocument.swift | 3 +- Sources/DOMKit/WebIDL/Global.swift | 3 +- Sources/DOMKit/WebIDL/GroupEffect.swift | 9 +- Sources/DOMKit/WebIDL/HID.swift | 12 +- Sources/DOMKit/WebIDL/HIDDevice.swift | 36 +- Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 3 +- Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 12 +- Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLEmbedElement.swift | 3 +- .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLFormElement.swift | 15 +- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 3 +- Sources/DOMKit/WebIDL/HTMLImageElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 30 +- .../DOMKit/WebIDL/HTMLMarqueeElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 39 +- Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 12 +- .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 6 +- Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLPortalElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 3 +- Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 21 +- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 9 +- Sources/DOMKit/WebIDL/HTMLTableElement.swift | 27 +- .../DOMKit/WebIDL/HTMLTableRowElement.swift | 6 +- .../WebIDL/HTMLTableSectionElement.swift | 6 +- .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 21 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 12 +- Sources/DOMKit/WebIDL/Headers.swift | 15 +- Sources/DOMKit/WebIDL/History.swift | 15 +- Sources/DOMKit/WebIDL/IDBCursor.swift | 15 +- Sources/DOMKit/WebIDL/IDBDatabase.swift | 12 +- Sources/DOMKit/WebIDL/IDBFactory.swift | 15 +- Sources/DOMKit/WebIDL/IDBIndex.swift | 21 +- Sources/DOMKit/WebIDL/IDBKeyRange.swift | 15 +- Sources/DOMKit/WebIDL/IDBObjectStore.swift | 42 +- Sources/DOMKit/WebIDL/IDBTransaction.swift | 9 +- Sources/DOMKit/WebIDL/IIRFilterNode.swift | 3 +- Sources/DOMKit/WebIDL/IdleDeadline.swift | 3 +- Sources/DOMKit/WebIDL/IdleDetector.swift | 12 +- Sources/DOMKit/WebIDL/ImageBitmap.swift | 3 +- .../WebIDL/ImageBitmapRenderingContext.swift | 3 +- Sources/DOMKit/WebIDL/ImageCapture.swift | 24 +- Sources/DOMKit/WebIDL/ImageDecoder.swift | 18 +- Sources/DOMKit/WebIDL/Ink.swift | 6 +- Sources/DOMKit/WebIDL/InkPresenter.swift | 3 +- Sources/DOMKit/WebIDL/InputDeviceInfo.swift | 3 +- Sources/DOMKit/WebIDL/InputEvent.swift | 3 +- .../DOMKit/WebIDL/IntersectionObserver.swift | 12 +- .../WebIDL/InterventionReportBody.swift | 3 +- Sources/DOMKit/WebIDL/Keyboard.swift | 15 +- Sources/DOMKit/WebIDL/KeyboardEvent.swift | 6 +- Sources/DOMKit/WebIDL/KeyframeEffect.swift | 6 +- .../WebIDL/LargestContentfulPaint.swift | 3 +- Sources/DOMKit/WebIDL/LayoutChild.swift | 12 +- Sources/DOMKit/WebIDL/LayoutShift.swift | 3 +- Sources/DOMKit/WebIDL/Location.swift | 9 +- Sources/DOMKit/WebIDL/LockManager.swift | 6 +- Sources/DOMKit/WebIDL/MIDIOutput.swift | 6 +- Sources/DOMKit/WebIDL/MIDIPort.swift | 12 +- Sources/DOMKit/WebIDL/ML.swift | 9 +- Sources/DOMKit/WebIDL/MLGraph.swift | 3 +- Sources/DOMKit/WebIDL/MLGraphBuilder.swift | 216 +++++++---- Sources/DOMKit/WebIDL/MediaCapabilities.swift | 12 +- Sources/DOMKit/WebIDL/MediaDeviceInfo.swift | 3 +- Sources/DOMKit/WebIDL/MediaDevices.swift | 33 +- Sources/DOMKit/WebIDL/MediaKeySession.swift | 30 +- Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift | 6 +- .../DOMKit/WebIDL/MediaKeySystemAccess.swift | 9 +- Sources/DOMKit/WebIDL/MediaKeys.swift | 9 +- Sources/DOMKit/WebIDL/MediaList.swift | 6 +- Sources/DOMKit/WebIDL/MediaRecorder.swift | 18 +- Sources/DOMKit/WebIDL/MediaSession.swift | 9 +- Sources/DOMKit/WebIDL/MediaSource.swift | 18 +- Sources/DOMKit/WebIDL/MediaStream.swift | 21 +- Sources/DOMKit/WebIDL/MediaStreamTrack.swift | 21 +- Sources/DOMKit/WebIDL/Memory.swift | 3 +- Sources/DOMKit/WebIDL/MessageEvent.swift | 3 +- Sources/DOMKit/WebIDL/MessagePort.swift | 12 +- Sources/DOMKit/WebIDL/Module.swift | 9 +- Sources/DOMKit/WebIDL/MouseEvent.swift | 6 +- Sources/DOMKit/WebIDL/MutationEvent.swift | 3 +- Sources/DOMKit/WebIDL/MutationObserver.swift | 9 +- Sources/DOMKit/WebIDL/NDEFReader.swift | 18 +- Sources/DOMKit/WebIDL/NDEFRecord.swift | 3 +- Sources/DOMKit/WebIDL/NamedFlow.swift | 9 +- Sources/DOMKit/WebIDL/NamedNodeMap.swift | 15 +- Sources/DOMKit/WebIDL/NavigateEvent.swift | 3 +- Sources/DOMKit/WebIDL/Navigation.swift | 21 +- .../DOMKit/WebIDL/NavigationDestination.swift | 3 +- .../WebIDL/NavigationHistoryEntry.swift | 3 +- .../WebIDL/NavigationPreloadManager.swift | 24 +- .../DOMKit/WebIDL/NavigationTransition.swift | 3 +- Sources/DOMKit/WebIDL/Navigator.swift | 63 ++- Sources/DOMKit/WebIDL/NavigatorBadge.swift | 12 +- .../DOMKit/WebIDL/NavigatorContentUtils.swift | 6 +- Sources/DOMKit/WebIDL/NavigatorID.swift | 3 +- Sources/DOMKit/WebIDL/NavigatorPlugins.swift | 3 +- Sources/DOMKit/WebIDL/NavigatorUAData.swift | 9 +- Sources/DOMKit/WebIDL/Node.swift | 45 ++- Sources/DOMKit/WebIDL/NodeIterator.swift | 9 +- .../DOMKit/WebIDL/NonElementParentNode.swift | 3 +- Sources/DOMKit/WebIDL/Notification.swift | 3 +- .../WebIDL/OES_draw_buffers_indexed.swift | 21 +- .../WebIDL/OES_vertex_array_object.swift | 12 +- Sources/DOMKit/WebIDL/OVR_multiview2.swift | 3 +- .../DOMKit/WebIDL/OfflineAudioContext.swift | 18 +- Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 12 +- .../OffscreenCanvasRenderingContext2D.swift | 3 +- Sources/DOMKit/WebIDL/OrientationSensor.swift | 3 +- Sources/DOMKit/WebIDL/OscillatorNode.swift | 3 +- Sources/DOMKit/WebIDL/PannerNode.swift | 6 +- Sources/DOMKit/WebIDL/ParentNode.swift | 15 +- Sources/DOMKit/WebIDL/Path2D.swift | 3 +- .../DOMKit/WebIDL/PaymentInstruments.swift | 36 +- Sources/DOMKit/WebIDL/PaymentRequest.swift | 18 +- .../DOMKit/WebIDL/PaymentRequestEvent.swift | 15 +- .../WebIDL/PaymentRequestUpdateEvent.swift | 3 +- Sources/DOMKit/WebIDL/PaymentResponse.swift | 15 +- Sources/DOMKit/WebIDL/Performance.swift | 39 +- .../WebIDL/PerformanceElementTiming.swift | 3 +- Sources/DOMKit/WebIDL/PerformanceEntry.swift | 3 +- .../WebIDL/PerformanceEventTiming.swift | 3 +- .../WebIDL/PerformanceLongTaskTiming.swift | 3 +- .../DOMKit/WebIDL/PerformanceNavigation.swift | 3 +- .../WebIDL/PerformanceNavigationTiming.swift | 3 +- .../DOMKit/WebIDL/PerformanceObserver.swift | 9 +- .../WebIDL/PerformanceObserverEntryList.swift | 9 +- .../WebIDL/PerformanceResourceTiming.swift | 3 +- .../WebIDL/PerformanceServerTiming.swift | 3 +- Sources/DOMKit/WebIDL/PerformanceTiming.swift | 3 +- .../DOMKit/WebIDL/PeriodicSyncManager.swift | 18 +- Sources/DOMKit/WebIDL/Permissions.swift | 18 +- Sources/DOMKit/WebIDL/PermissionsPolicy.swift | 12 +- Sources/DOMKit/WebIDL/PluginArray.swift | 3 +- Sources/DOMKit/WebIDL/PointerEvent.swift | 6 +- .../DOMKit/WebIDL/PortalActivateEvent.swift | 3 +- Sources/DOMKit/WebIDL/PortalHost.swift | 3 +- .../WebIDL/PresentationConnection.swift | 18 +- .../DOMKit/WebIDL/PresentationRequest.swift | 18 +- Sources/DOMKit/WebIDL/Profiler.swift | 6 +- .../DOMKit/WebIDL/PublicKeyCredential.swift | 9 +- Sources/DOMKit/WebIDL/PushManager.swift | 18 +- Sources/DOMKit/WebIDL/PushMessageData.swift | 12 +- Sources/DOMKit/WebIDL/PushSubscription.swift | 12 +- Sources/DOMKit/WebIDL/RTCCertificate.swift | 3 +- Sources/DOMKit/WebIDL/RTCDTMFSender.swift | 3 +- Sources/DOMKit/WebIDL/RTCDataChannel.swift | 15 +- Sources/DOMKit/WebIDL/RTCDtlsTransport.swift | 3 +- .../DOMKit/WebIDL/RTCEncodedAudioFrame.swift | 3 +- .../DOMKit/WebIDL/RTCEncodedVideoFrame.swift | 3 +- Sources/DOMKit/WebIDL/RTCIceCandidate.swift | 3 +- Sources/DOMKit/WebIDL/RTCIceTransport.swift | 27 +- .../WebIDL/RTCIdentityProviderRegistrar.swift | 3 +- Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 54 ++- Sources/DOMKit/WebIDL/RTCRtpReceiver.swift | 18 +- .../WebIDL/RTCRtpScriptTransformer.swift | 12 +- Sources/DOMKit/WebIDL/RTCRtpSender.swift | 33 +- Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift | 6 +- .../DOMKit/WebIDL/RTCSessionDescription.swift | 3 +- Sources/DOMKit/WebIDL/Range.swift | 69 ++-- .../WebIDL/ReadableByteStreamController.swift | 9 +- Sources/DOMKit/WebIDL/ReadableStream.swift | 21 +- .../WebIDL/ReadableStreamBYOBReader.swift | 9 +- .../WebIDL/ReadableStreamBYOBRequest.swift | 6 +- .../ReadableStreamDefaultController.swift | 9 +- .../WebIDL/ReadableStreamDefaultReader.swift | 9 +- .../WebIDL/ReadableStreamGenericReader.swift | 6 +- Sources/DOMKit/WebIDL/Region.swift | 3 +- Sources/DOMKit/WebIDL/RemotePlayback.swift | 12 +- Sources/DOMKit/WebIDL/Report.swift | 3 +- Sources/DOMKit/WebIDL/ReportBody.swift | 3 +- Sources/DOMKit/WebIDL/ReportingObserver.swift | 9 +- Sources/DOMKit/WebIDL/Request.swift | 3 +- Sources/DOMKit/WebIDL/ResizeObserver.swift | 9 +- Sources/DOMKit/WebIDL/Response.swift | 9 +- Sources/DOMKit/WebIDL/SFrameTransform.swift | 6 +- Sources/DOMKit/WebIDL/SVGAngle.swift | 6 +- .../DOMKit/WebIDL/SVGAnimationElement.swift | 21 +- .../WebIDL/SVGFEDropShadowElement.swift | 3 +- .../WebIDL/SVGFEGaussianBlurElement.swift | 3 +- .../DOMKit/WebIDL/SVGGeometryElement.swift | 12 +- .../DOMKit/WebIDL/SVGGraphicsElement.swift | 9 +- Sources/DOMKit/WebIDL/SVGLength.swift | 6 +- Sources/DOMKit/WebIDL/SVGLengthList.swift | 18 +- Sources/DOMKit/WebIDL/SVGMarkerElement.swift | 6 +- Sources/DOMKit/WebIDL/SVGNumberList.swift | 18 +- Sources/DOMKit/WebIDL/SVGPointList.swift | 18 +- Sources/DOMKit/WebIDL/SVGSVGElement.swift | 69 ++-- Sources/DOMKit/WebIDL/SVGStringList.swift | 18 +- .../DOMKit/WebIDL/SVGTextContentElement.swift | 27 +- Sources/DOMKit/WebIDL/SVGTransform.swift | 18 +- Sources/DOMKit/WebIDL/SVGTransformList.swift | 24 +- Sources/DOMKit/WebIDL/Sanitizer.swift | 12 +- Sources/DOMKit/WebIDL/Scheduling.swift | 3 +- Sources/DOMKit/WebIDL/ScreenOrientation.swift | 9 +- .../WebIDL/ScriptingPolicyReportBody.swift | 3 +- Sources/DOMKit/WebIDL/Selection.swift | 42 +- Sources/DOMKit/WebIDL/Sensor.swift | 6 +- Sources/DOMKit/WebIDL/SequenceEffect.swift | 3 +- Sources/DOMKit/WebIDL/Serial.swift | 12 +- Sources/DOMKit/WebIDL/SerialPort.swift | 27 +- Sources/DOMKit/WebIDL/ServiceWorker.swift | 6 +- .../WebIDL/ServiceWorkerContainer.swift | 21 +- .../WebIDL/ServiceWorkerGlobalScope.swift | 6 +- .../WebIDL/ServiceWorkerRegistration.swift | 24 +- .../WebIDL/SharedWorkerGlobalScope.swift | 3 +- Sources/DOMKit/WebIDL/SourceBuffer.swift | 12 +- Sources/DOMKit/WebIDL/SpeechGrammarList.swift | 6 +- Sources/DOMKit/WebIDL/SpeechRecognition.swift | 9 +- Sources/DOMKit/WebIDL/SpeechSynthesis.swift | 15 +- Sources/DOMKit/WebIDL/Storage.swift | 6 +- Sources/DOMKit/WebIDL/StorageEvent.swift | 3 +- Sources/DOMKit/WebIDL/StorageManager.swift | 24 +- Sources/DOMKit/WebIDL/StylePropertyMap.swift | 12 +- .../WebIDL/StylePropertyMapReadOnly.swift | 9 +- Sources/DOMKit/WebIDL/SubtleCrypto.swift | 72 ++-- Sources/DOMKit/WebIDL/SyncManager.swift | 12 +- Sources/DOMKit/WebIDL/Table.swift | 9 +- .../DOMKit/WebIDL/TaskAttributionTiming.swift | 3 +- Sources/DOMKit/WebIDL/TaskController.swift | 3 +- Sources/DOMKit/WebIDL/TestUtils.swift | 6 +- Sources/DOMKit/WebIDL/Text.swift | 3 +- Sources/DOMKit/WebIDL/TextDecoder.swift | 3 +- Sources/DOMKit/WebIDL/TextDetector.swift | 6 +- Sources/DOMKit/WebIDL/TextEncoder.swift | 6 +- .../DOMKit/WebIDL/TextFormatUpdateEvent.swift | 3 +- Sources/DOMKit/WebIDL/TextTrack.swift | 6 +- Sources/DOMKit/WebIDL/TextTrackCueList.swift | 3 +- Sources/DOMKit/WebIDL/TextTrackList.swift | 3 +- Sources/DOMKit/WebIDL/TimeEvent.swift | 3 +- Sources/DOMKit/WebIDL/TimeRanges.swift | 6 +- .../TransformStreamDefaultController.swift | 9 +- Sources/DOMKit/WebIDL/TreeWalker.swift | 21 +- Sources/DOMKit/WebIDL/TrustedHTML.swift | 6 +- Sources/DOMKit/WebIDL/TrustedScript.swift | 6 +- Sources/DOMKit/WebIDL/TrustedScriptURL.swift | 6 +- Sources/DOMKit/WebIDL/TrustedTypePolicy.swift | 9 +- .../WebIDL/TrustedTypePolicyFactory.swift | 18 +- Sources/DOMKit/WebIDL/UIEvent.swift | 3 +- Sources/DOMKit/WebIDL/URL.swift | 9 +- Sources/DOMKit/WebIDL/URLPattern.swift | 6 +- Sources/DOMKit/WebIDL/URLSearchParams.swift | 21 +- Sources/DOMKit/WebIDL/USB.swift | 12 +- Sources/DOMKit/WebIDL/USBDevice.swift | 90 +++-- Sources/DOMKit/WebIDL/VTTCue.swift | 3 +- Sources/DOMKit/WebIDL/VideoColorSpace.swift | 3 +- Sources/DOMKit/WebIDL/VideoDecoder.swift | 24 +- Sources/DOMKit/WebIDL/VideoEncoder.swift | 24 +- Sources/DOMKit/WebIDL/VideoFrame.swift | 15 +- Sources/DOMKit/WebIDL/VideoTrackList.swift | 3 +- Sources/DOMKit/WebIDL/VirtualKeyboard.swift | 6 +- .../WEBGL_compressed_texture_astc.swift | 3 +- .../DOMKit/WebIDL/WEBGL_debug_shaders.swift | 3 +- .../DOMKit/WebIDL/WEBGL_draw_buffers.swift | 3 +- ..._instanced_base_vertex_base_instance.swift | 6 +- .../DOMKit/WebIDL/WEBGL_lose_context.swift | 6 +- Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift | 12 +- ..._instanced_base_vertex_base_instance.swift | 6 +- Sources/DOMKit/WebIDL/WakeLock.swift | 6 +- Sources/DOMKit/WebIDL/WakeLockSentinel.swift | 6 +- Sources/DOMKit/WebIDL/WebAssembly.swift | 33 +- .../WebIDL/WebGL2RenderingContextBase.swift | 285 +++++++++----- .../WebGL2RenderingContextOverloads.swift | 99 +++-- .../WebIDL/WebGLRenderingContextBase.swift | 360 ++++++++++++------ .../WebGLRenderingContextOverloads.swift | 63 ++- Sources/DOMKit/WebIDL/WebSocket.swift | 6 +- Sources/DOMKit/WebIDL/WebTransport.swift | 21 +- Sources/DOMKit/WebIDL/Window.swift | 111 ++++-- Sources/DOMKit/WebIDL/WindowClient.swift | 12 +- .../DOMKit/WebIDL/WindowControlsOverlay.swift | 3 +- .../WebIDL/WindowOrWorkerGlobalScope.swift | 42 +- Sources/DOMKit/WebIDL/Worker.swift | 9 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 3 +- Sources/DOMKit/WebIDL/Worklet.swift | 6 +- .../WebIDL/WorkletAnimationEffect.swift | 6 +- .../DOMKit/WebIDL/WorkletGroupEffect.swift | 3 +- Sources/DOMKit/WebIDL/WritableStream.swift | 15 +- .../WritableStreamDefaultController.swift | 3 +- .../WebIDL/WritableStreamDefaultWriter.swift | 21 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 24 +- Sources/DOMKit/WebIDL/XMLSerializer.swift | 3 +- Sources/DOMKit/WebIDL/XPathExpression.swift | 3 +- Sources/DOMKit/WebIDL/XPathResult.swift | 6 +- Sources/DOMKit/WebIDL/XRAnchor.swift | 3 +- .../DOMKit/WebIDL/XRCPUDepthInformation.swift | 3 +- .../DOMKit/WebIDL/XRCompositionLayer.swift | 3 +- Sources/DOMKit/WebIDL/XRFrame.swift | 33 +- Sources/DOMKit/WebIDL/XRHand.swift | 3 +- Sources/DOMKit/WebIDL/XRHitTestResult.swift | 9 +- Sources/DOMKit/WebIDL/XRHitTestSource.swift | 3 +- Sources/DOMKit/WebIDL/XRMediaBinding.swift | 9 +- Sources/DOMKit/WebIDL/XRReferenceSpace.swift | 3 +- Sources/DOMKit/WebIDL/XRSession.swift | 42 +- Sources/DOMKit/WebIDL/XRSystem.swift | 12 +- .../XRTransientInputHitTestSource.swift | 3 +- Sources/DOMKit/WebIDL/XRView.swift | 3 +- Sources/DOMKit/WebIDL/XRWebGLBinding.swift | 27 +- Sources/DOMKit/WebIDL/XRWebGLLayer.swift | 6 +- Sources/DOMKit/WebIDL/XSLTProcessor.swift | 24 +- Sources/DOMKit/WebIDL/console.swift | 57 ++- .../WebIDL+SwiftRepresentation.swift | 22 +- 466 files changed, 4804 insertions(+), 2394 deletions(-) diff --git a/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift b/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift index 50992b5e..70b82c9b 100644 --- a/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift +++ b/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift @@ -15,14 +15,17 @@ public class ANGLE_instanced_arrays: JSBridgedClass { public static let VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum = 0x88FE public func drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) { - _ = jsObject[Strings.drawArraysInstancedANGLE]!(mode.jsValue(), first.jsValue(), count.jsValue(), primcount.jsValue()) + let this = jsObject + _ = this[Strings.drawArraysInstancedANGLE].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue(), primcount.jsValue()]) } public func drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei) { - _ = jsObject[Strings.drawElementsInstancedANGLE]!(mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), primcount.jsValue()) + let this = jsObject + _ = this[Strings.drawElementsInstancedANGLE].function!(this: this, arguments: [mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), primcount.jsValue()]) } public func vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint) { - _ = jsObject[Strings.vertexAttribDivisorANGLE]!(index.jsValue(), divisor.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttribDivisorANGLE].function!(this: this, arguments: [index.jsValue(), divisor.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index 7850a5a2..d756212b 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -21,6 +21,7 @@ public class AbortController: JSBridgedClass { public var signal: AbortSignal public func abort(reason: JSValue? = nil) { - _ = jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index bc0649cc..1d4c072d 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -14,11 +14,13 @@ public class AbortSignal: EventTarget { } public static func abort(reason: JSValue? = nil) -> Self { - constructor[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! } public static func timeout(milliseconds: UInt64) -> Self { - constructor[Strings.timeout]!(milliseconds.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.timeout].function!(this: this, arguments: [milliseconds.jsValue()]).fromJSValue()! } @ReadonlyAttribute @@ -28,7 +30,8 @@ public class AbortSignal: EventTarget { public var reason: JSValue public func throwIfAborted() { - _ = jsObject[Strings.throwIfAborted]!() + let this = jsObject + _ = this[Strings.throwIfAborted].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/AnalyserNode.swift b/Sources/DOMKit/WebIDL/AnalyserNode.swift index bf1cc757..ea98ad88 100644 --- a/Sources/DOMKit/WebIDL/AnalyserNode.swift +++ b/Sources/DOMKit/WebIDL/AnalyserNode.swift @@ -20,19 +20,23 @@ public class AnalyserNode: AudioNode { } public func getFloatFrequencyData(array: Float32Array) { - _ = jsObject[Strings.getFloatFrequencyData]!(array.jsValue()) + let this = jsObject + _ = this[Strings.getFloatFrequencyData].function!(this: this, arguments: [array.jsValue()]) } public func getByteFrequencyData(array: Uint8Array) { - _ = jsObject[Strings.getByteFrequencyData]!(array.jsValue()) + let this = jsObject + _ = this[Strings.getByteFrequencyData].function!(this: this, arguments: [array.jsValue()]) } public func getFloatTimeDomainData(array: Float32Array) { - _ = jsObject[Strings.getFloatTimeDomainData]!(array.jsValue()) + let this = jsObject + _ = this[Strings.getFloatTimeDomainData].function!(this: this, arguments: [array.jsValue()]) } public func getByteTimeDomainData(array: Uint8Array) { - _ = jsObject[Strings.getByteTimeDomainData]!(array.jsValue()) + let this = jsObject + _ = this[Strings.getByteTimeDomainData].function!(this: this, arguments: [array.jsValue()]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/Animatable.swift b/Sources/DOMKit/WebIDL/Animatable.swift index aecfdb4e..81ebd41d 100644 --- a/Sources/DOMKit/WebIDL/Animatable.swift +++ b/Sources/DOMKit/WebIDL/Animatable.swift @@ -6,10 +6,12 @@ import JavaScriptKit public protocol Animatable: JSBridgedClass {} public extension Animatable { func animate(keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) -> Animation { - jsObject[Strings.animate]!(keyframes.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.animate].function!(this: this, arguments: [keyframes.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } func getAnimations(options: GetAnimationsOptions? = nil) -> [Animation] { - jsObject[Strings.getAnimations]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getAnimations].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Animation.swift b/Sources/DOMKit/WebIDL/Animation.swift index 0c063c10..6a310363 100644 --- a/Sources/DOMKit/WebIDL/Animation.swift +++ b/Sources/DOMKit/WebIDL/Animation.swift @@ -71,34 +71,42 @@ public class Animation: EventTarget { public var onremove: EventHandler public func cancel() { - _ = jsObject[Strings.cancel]!() + let this = jsObject + _ = this[Strings.cancel].function!(this: this, arguments: []) } public func finish() { - _ = jsObject[Strings.finish]!() + let this = jsObject + _ = this[Strings.finish].function!(this: this, arguments: []) } public func play() { - _ = jsObject[Strings.play]!() + let this = jsObject + _ = this[Strings.play].function!(this: this, arguments: []) } public func pause() { - _ = jsObject[Strings.pause]!() + let this = jsObject + _ = this[Strings.pause].function!(this: this, arguments: []) } public func updatePlaybackRate(playbackRate: Double) { - _ = jsObject[Strings.updatePlaybackRate]!(playbackRate.jsValue()) + let this = jsObject + _ = this[Strings.updatePlaybackRate].function!(this: this, arguments: [playbackRate.jsValue()]) } public func reverse() { - _ = jsObject[Strings.reverse]!() + let this = jsObject + _ = this[Strings.reverse].function!(this: this, arguments: []) } public func persist() { - _ = jsObject[Strings.persist]!() + let this = jsObject + _ = this[Strings.persist].function!(this: this, arguments: []) } public func commitStyles() { - _ = jsObject[Strings.commitStyles]!() + let this = jsObject + _ = this[Strings.commitStyles].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect.swift index 643370c2..287e4c8d 100644 --- a/Sources/DOMKit/WebIDL/AnimationEffect.swift +++ b/Sources/DOMKit/WebIDL/AnimationEffect.swift @@ -25,30 +25,37 @@ public class AnimationEffect: JSBridgedClass { public var nextSibling: AnimationEffect? public func before(effects: AnimationEffect...) { - _ = jsObject[Strings.before]!(effects.jsValue()) + let this = jsObject + _ = this[Strings.before].function!(this: this, arguments: effects.map { $0.jsValue() }) } public func after(effects: AnimationEffect...) { - _ = jsObject[Strings.after]!(effects.jsValue()) + let this = jsObject + _ = this[Strings.after].function!(this: this, arguments: effects.map { $0.jsValue() }) } public func replace(effects: AnimationEffect...) { - _ = jsObject[Strings.replace]!(effects.jsValue()) + let this = jsObject + _ = this[Strings.replace].function!(this: this, arguments: effects.map { $0.jsValue() }) } public func remove() { - _ = jsObject[Strings.remove]!() + let this = jsObject + _ = this[Strings.remove].function!(this: this, arguments: []) } public func getTiming() -> EffectTiming { - jsObject[Strings.getTiming]!().fromJSValue()! + let this = jsObject + return this[Strings.getTiming].function!(this: this, arguments: []).fromJSValue()! } public func getComputedTiming() -> ComputedEffectTiming { - jsObject[Strings.getComputedTiming]!().fromJSValue()! + let this = jsObject + return this[Strings.getComputedTiming].function!(this: this, arguments: []).fromJSValue()! } public func updateTiming(timing: OptionalEffectTiming? = nil) { - _ = jsObject[Strings.updateTiming]!(timing?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.updateTiming].function!(this: this, arguments: [timing?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift index ee1d927b..68a7c4a8 100644 --- a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift +++ b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift @@ -8,6 +8,7 @@ public extension AnimationFrameProvider { // XXX: method 'requestAnimationFrame' is ignored func cancelAnimationFrame(handle: UInt32) { - _ = jsObject[Strings.cancelAnimationFrame]!(handle.jsValue()) + let this = jsObject + _ = this[Strings.cancelAnimationFrame].function!(this: this, arguments: [handle.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/AnimationTimeline.swift b/Sources/DOMKit/WebIDL/AnimationTimeline.swift index 34c8bc8d..9a918ecf 100644 --- a/Sources/DOMKit/WebIDL/AnimationTimeline.swift +++ b/Sources/DOMKit/WebIDL/AnimationTimeline.swift @@ -19,7 +19,8 @@ public class AnimationTimeline: JSBridgedClass { public var duration: CSSNumberish? public func play(effect: AnimationEffect? = nil) -> Animation { - jsObject[Strings.play]!(effect?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.play].function!(this: this, arguments: [effect?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AttributionReporting.swift b/Sources/DOMKit/WebIDL/AttributionReporting.swift index 67de0db3..c92c8354 100644 --- a/Sources/DOMKit/WebIDL/AttributionReporting.swift +++ b/Sources/DOMKit/WebIDL/AttributionReporting.swift @@ -13,12 +13,14 @@ public class AttributionReporting: JSBridgedClass { } public func registerAttributionSource(params: AttributionSourceParams) -> JSPromise { - jsObject[Strings.registerAttributionSource]!(params.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func registerAttributionSource(params: AttributionSourceParams) async throws { - let _promise: JSPromise = jsObject[Strings.registerAttributionSource]!(params.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue()]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/AudioBuffer.swift b/Sources/DOMKit/WebIDL/AudioBuffer.swift index 4db4630b..9a240249 100644 --- a/Sources/DOMKit/WebIDL/AudioBuffer.swift +++ b/Sources/DOMKit/WebIDL/AudioBuffer.swift @@ -33,14 +33,17 @@ public class AudioBuffer: JSBridgedClass { public var numberOfChannels: UInt32 public func getChannelData(channel: UInt32) -> Float32Array { - jsObject[Strings.getChannelData]!(channel.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getChannelData].function!(this: this, arguments: [channel.jsValue()]).fromJSValue()! } public func copyFromChannel(destination: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { - _ = jsObject[Strings.copyFromChannel]!(destination.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.copyFromChannel].function!(this: this, arguments: [destination.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined]) } public func copyToChannel(source: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { - _ = jsObject[Strings.copyToChannel]!(source.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.copyToChannel].function!(this: this, arguments: [source.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift index 4fc1b59a..f8e8e98a 100644 --- a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift +++ b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift @@ -39,6 +39,7 @@ public class AudioBufferSourceNode: AudioScheduledSourceNode { public var loopEnd: Double override public func start(when: Double? = nil, offset: Double? = nil, duration: Double? = nil) { - _ = jsObject[Strings.start]!(when?.jsValue() ?? .undefined, offset?.jsValue() ?? .undefined, duration?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.start].function!(this: this, arguments: [when?.jsValue() ?? .undefined, offset?.jsValue() ?? .undefined, duration?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/AudioContext.swift b/Sources/DOMKit/WebIDL/AudioContext.swift index d102b5d6..97e0dfa5 100644 --- a/Sources/DOMKit/WebIDL/AudioContext.swift +++ b/Sources/DOMKit/WebIDL/AudioContext.swift @@ -23,52 +23,63 @@ public class AudioContext: BaseAudioContext { public var outputLatency: Double public func getOutputTimestamp() -> AudioTimestamp { - jsObject[Strings.getOutputTimestamp]!().fromJSValue()! + let this = jsObject + return this[Strings.getOutputTimestamp].function!(this: this, arguments: []).fromJSValue()! } public func resume() -> JSPromise { - jsObject[Strings.resume]!().fromJSValue()! + let this = jsObject + return this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func resume() async throws { - let _promise: JSPromise = jsObject[Strings.resume]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func suspend() -> JSPromise { - jsObject[Strings.suspend]!().fromJSValue()! + let this = jsObject + return this[Strings.suspend].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func suspend() async throws { - let _promise: JSPromise = jsObject[Strings.suspend]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.suspend].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject[Strings.close]!().fromJSValue()! + 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, *) public func close() async throws { - let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func createMediaElementSource(mediaElement: HTMLMediaElement) -> MediaElementAudioSourceNode { - jsObject[Strings.createMediaElementSource]!(mediaElement.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createMediaElementSource].function!(this: this, arguments: [mediaElement.jsValue()]).fromJSValue()! } public func createMediaStreamSource(mediaStream: MediaStream) -> MediaStreamAudioSourceNode { - jsObject[Strings.createMediaStreamSource]!(mediaStream.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createMediaStreamSource].function!(this: this, arguments: [mediaStream.jsValue()]).fromJSValue()! } public func createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack) -> MediaStreamTrackAudioSourceNode { - jsObject[Strings.createMediaStreamTrackSource]!(mediaStreamTrack.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createMediaStreamTrackSource].function!(this: this, arguments: [mediaStreamTrack.jsValue()]).fromJSValue()! } public func createMediaStreamDestination() -> MediaStreamAudioDestinationNode { - jsObject[Strings.createMediaStreamDestination]!().fromJSValue()! + let this = jsObject + return this[Strings.createMediaStreamDestination].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/AudioData.swift b/Sources/DOMKit/WebIDL/AudioData.swift index f7568b18..bdc11a73 100644 --- a/Sources/DOMKit/WebIDL/AudioData.swift +++ b/Sources/DOMKit/WebIDL/AudioData.swift @@ -41,18 +41,22 @@ public class AudioData: JSBridgedClass { public var timestamp: Int64 public func allocationSize(options: AudioDataCopyToOptions) -> UInt32 { - jsObject[Strings.allocationSize]!(options.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.allocationSize].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } public func copyTo(destination: BufferSource, options: AudioDataCopyToOptions) { - _ = jsObject[Strings.copyTo]!(destination.jsValue(), options.jsValue()) + let this = jsObject + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue(), options.jsValue()]) } public func clone() -> Self { - jsObject[Strings.clone]!().fromJSValue()! + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/AudioDecoder.swift b/Sources/DOMKit/WebIDL/AudioDecoder.swift index 2afeec16..1f6147ae 100644 --- a/Sources/DOMKit/WebIDL/AudioDecoder.swift +++ b/Sources/DOMKit/WebIDL/AudioDecoder.swift @@ -25,38 +25,46 @@ public class AudioDecoder: JSBridgedClass { public var decodeQueueSize: UInt32 public func configure(config: AudioDecoderConfig) { - _ = jsObject[Strings.configure]!(config.jsValue()) + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) } public func decode(chunk: EncodedAudioChunk) { - _ = jsObject[Strings.decode]!(chunk.jsValue()) + let this = jsObject + _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue()]) } public func flush() -> JSPromise { - jsObject[Strings.flush]!().fromJSValue()! + 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, *) public func flush() async throws { - let _promise: JSPromise = jsObject[Strings.flush]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func reset() { - _ = jsObject[Strings.reset]!() + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public static func isConfigSupported(config: AudioDecoderConfig) -> JSPromise { - constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + 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, *) public static func isConfigSupported(config: AudioDecoderConfig) async throws -> AudioDecoderSupport { - let _promise: JSPromise = constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/AudioEncoder.swift b/Sources/DOMKit/WebIDL/AudioEncoder.swift index 41653c8f..ae42233c 100644 --- a/Sources/DOMKit/WebIDL/AudioEncoder.swift +++ b/Sources/DOMKit/WebIDL/AudioEncoder.swift @@ -25,38 +25,46 @@ public class AudioEncoder: JSBridgedClass { public var encodeQueueSize: UInt32 public func configure(config: AudioEncoderConfig) { - _ = jsObject[Strings.configure]!(config.jsValue()) + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) } public func encode(data: AudioData) { - _ = jsObject[Strings.encode]!(data.jsValue()) + let this = jsObject + _ = this[Strings.encode].function!(this: this, arguments: [data.jsValue()]) } public func flush() -> JSPromise { - jsObject[Strings.flush]!().fromJSValue()! + 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, *) public func flush() async throws { - let _promise: JSPromise = jsObject[Strings.flush]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func reset() { - _ = jsObject[Strings.reset]!() + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public static func isConfigSupported(config: AudioEncoderConfig) -> JSPromise { - constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + 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, *) public static func isConfigSupported(config: AudioEncoderConfig) async throws -> AudioEncoderSupport { - let _promise: JSPromise = constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/AudioListener.swift b/Sources/DOMKit/WebIDL/AudioListener.swift index 9900dae1..95c4b809 100644 --- a/Sources/DOMKit/WebIDL/AudioListener.swift +++ b/Sources/DOMKit/WebIDL/AudioListener.swift @@ -49,7 +49,8 @@ public class AudioListener: JSBridgedClass { public var upZ: AudioParam public func setPosition(x: Float, y: Float, z: Float) { - _ = jsObject[Strings.setPosition]!(x.jsValue(), y.jsValue(), z.jsValue()) + let this = jsObject + _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue(), y.jsValue(), z.jsValue()]) } public func setOrientation(x: Float, y: Float, z: Float, xUp: Float, yUp: Float, zUp: Float) { @@ -59,6 +60,7 @@ public class AudioListener: JSBridgedClass { let _arg3 = xUp.jsValue() let _arg4 = yUp.jsValue() let _arg5 = zUp.jsValue() - _ = jsObject[Strings.setOrientation]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.setOrientation].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } } diff --git a/Sources/DOMKit/WebIDL/AudioNode.swift b/Sources/DOMKit/WebIDL/AudioNode.swift index 6b7ba555..6e743553 100644 --- a/Sources/DOMKit/WebIDL/AudioNode.swift +++ b/Sources/DOMKit/WebIDL/AudioNode.swift @@ -17,39 +17,48 @@ public class AudioNode: EventTarget { } public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self { - jsObject[Strings.connect]!(destinationNode.jsValue(), output?.jsValue() ?? .undefined, input?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.connect].function!(this: this, arguments: [destinationNode.jsValue(), output?.jsValue() ?? .undefined, input?.jsValue() ?? .undefined]).fromJSValue()! } public func connect(destinationParam: AudioParam, output: UInt32? = nil) { - _ = jsObject[Strings.connect]!(destinationParam.jsValue(), output?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.connect].function!(this: this, arguments: [destinationParam.jsValue(), output?.jsValue() ?? .undefined]) } public func disconnect() { - _ = jsObject[Strings.disconnect]!() + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: []) } public func disconnect(output: UInt32) { - _ = jsObject[Strings.disconnect]!(output.jsValue()) + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: [output.jsValue()]) } public func disconnect(destinationNode: AudioNode) { - _ = jsObject[Strings.disconnect]!(destinationNode.jsValue()) + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue()]) } public func disconnect(destinationNode: AudioNode, output: UInt32) { - _ = jsObject[Strings.disconnect]!(destinationNode.jsValue(), output.jsValue()) + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue(), output.jsValue()]) } public func disconnect(destinationNode: AudioNode, output: UInt32, input: UInt32) { - _ = jsObject[Strings.disconnect]!(destinationNode.jsValue(), output.jsValue(), input.jsValue()) + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue(), output.jsValue(), input.jsValue()]) } public func disconnect(destinationParam: AudioParam) { - _ = jsObject[Strings.disconnect]!(destinationParam.jsValue()) + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue()]) } public func disconnect(destinationParam: AudioParam, output: UInt32) { - _ = jsObject[Strings.disconnect]!(destinationParam.jsValue(), output.jsValue()) + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue(), output.jsValue()]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioParam.swift b/Sources/DOMKit/WebIDL/AudioParam.swift index 24818772..683ef39f 100644 --- a/Sources/DOMKit/WebIDL/AudioParam.swift +++ b/Sources/DOMKit/WebIDL/AudioParam.swift @@ -33,30 +33,37 @@ public class AudioParam: JSBridgedClass { public var maxValue: Float public func setValueAtTime(value: Float, startTime: Double) -> Self { - jsObject[Strings.setValueAtTime]!(value.jsValue(), startTime.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setValueAtTime].function!(this: this, arguments: [value.jsValue(), startTime.jsValue()]).fromJSValue()! } public func linearRampToValueAtTime(value: Float, endTime: Double) -> Self { - jsObject[Strings.linearRampToValueAtTime]!(value.jsValue(), endTime.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.linearRampToValueAtTime].function!(this: this, arguments: [value.jsValue(), endTime.jsValue()]).fromJSValue()! } public func exponentialRampToValueAtTime(value: Float, endTime: Double) -> Self { - jsObject[Strings.exponentialRampToValueAtTime]!(value.jsValue(), endTime.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.exponentialRampToValueAtTime].function!(this: this, arguments: [value.jsValue(), endTime.jsValue()]).fromJSValue()! } public func setTargetAtTime(target: Float, startTime: Double, timeConstant: Float) -> Self { - jsObject[Strings.setTargetAtTime]!(target.jsValue(), startTime.jsValue(), timeConstant.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setTargetAtTime].function!(this: this, arguments: [target.jsValue(), startTime.jsValue(), timeConstant.jsValue()]).fromJSValue()! } public func setValueCurveAtTime(values: [Float], startTime: Double, duration: Double) -> Self { - jsObject[Strings.setValueCurveAtTime]!(values.jsValue(), startTime.jsValue(), duration.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setValueCurveAtTime].function!(this: this, arguments: [values.jsValue(), startTime.jsValue(), duration.jsValue()]).fromJSValue()! } public func cancelScheduledValues(cancelTime: Double) -> Self { - jsObject[Strings.cancelScheduledValues]!(cancelTime.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.cancelScheduledValues].function!(this: this, arguments: [cancelTime.jsValue()]).fromJSValue()! } public func cancelAndHoldAtTime(cancelTime: Double) -> Self { - jsObject[Strings.cancelAndHoldAtTime]!(cancelTime.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.cancelAndHoldAtTime].function!(this: this, arguments: [cancelTime.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift index 3a77662f..395df971 100644 --- a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift +++ b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift @@ -15,10 +15,12 @@ public class AudioScheduledSourceNode: AudioNode { public var onended: EventHandler public func start(when: Double? = nil) { - _ = jsObject[Strings.start]!(when?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.start].function!(this: this, arguments: [when?.jsValue() ?? .undefined]) } public func stop(when: Double? = nil) { - _ = jsObject[Strings.stop]!(when?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: [when?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift index 5d0a8d30..2aeeef1f 100644 --- a/Sources/DOMKit/WebIDL/AudioTrackList.swift +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -22,7 +22,8 @@ public class AudioTrackList: EventTarget { } public func getTrackById(id: String) -> AudioTrack? { - jsObject[Strings.getTrackById]!(id.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift index bc60bbb1..299c5ef0 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift @@ -15,18 +15,22 @@ public class AuthenticatorAttestationResponse: AuthenticatorResponse { public var attestationObject: ArrayBuffer public func getTransports() -> [String] { - jsObject[Strings.getTransports]!().fromJSValue()! + let this = jsObject + return this[Strings.getTransports].function!(this: this, arguments: []).fromJSValue()! } public func getAuthenticatorData() -> ArrayBuffer { - jsObject[Strings.getAuthenticatorData]!().fromJSValue()! + let this = jsObject + return this[Strings.getAuthenticatorData].function!(this: this, arguments: []).fromJSValue()! } public func getPublicKey() -> ArrayBuffer? { - jsObject[Strings.getPublicKey]!().fromJSValue()! + let this = jsObject + return this[Strings.getPublicKey].function!(this: this, arguments: []).fromJSValue()! } public func getPublicKeyAlgorithm() -> COSEAlgorithmIdentifier { - jsObject[Strings.getPublicKeyAlgorithm]!().fromJSValue()! + let this = jsObject + return this[Strings.getPublicKeyAlgorithm].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift index 288a158c..74096b9e 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift @@ -13,32 +13,38 @@ public class BackgroundFetchManager: JSBridgedClass { } public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) -> JSPromise { - jsObject[Strings.fetch]!(id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.fetch].function!(this: this, arguments: [id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) async throws -> BackgroundFetchRegistration { - let _promise: JSPromise = jsObject[Strings.fetch]!(id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func get(id: String) -> JSPromise { - jsObject[Strings.get]!(id.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func get(id: String) async throws -> BackgroundFetchRegistration? { - let _promise: JSPromise = jsObject[Strings.get]!(id.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getIds() -> JSPromise { - jsObject[Strings.getIds]!().fromJSValue()! + let this = jsObject + return this[Strings.getIds].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getIds() async throws -> [String] { - let _promise: JSPromise = jsObject[Strings.getIds]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getIds].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift index 1ff20dd2..73b28be1 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift @@ -47,32 +47,38 @@ public class BackgroundFetchRegistration: EventTarget { public var onprogress: EventHandler public func abort() -> JSPromise { - jsObject[Strings.abort]!().fromJSValue()! + let this = jsObject + return this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.abort]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func match(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { - jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> BackgroundFetchRecord { - let _promise: JSPromise = jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { - jsObject[Strings.matchAll]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [BackgroundFetchRecord] { - let _promise: JSPromise = jsObject[Strings.matchAll]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift b/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift index 261027f2..5df1a1cb 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift @@ -15,12 +15,14 @@ public class BackgroundFetchUpdateUIEvent: BackgroundFetchEvent { } public func updateUI(options: BackgroundFetchUIOptions? = nil) -> JSPromise { - jsObject[Strings.updateUI]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.updateUI].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func updateUI(options: BackgroundFetchUIOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.updateUI]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.updateUI].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/BarcodeDetector.swift b/Sources/DOMKit/WebIDL/BarcodeDetector.swift index 9506b226..18540513 100644 --- a/Sources/DOMKit/WebIDL/BarcodeDetector.swift +++ b/Sources/DOMKit/WebIDL/BarcodeDetector.swift @@ -17,22 +17,26 @@ public class BarcodeDetector: JSBridgedClass { } public static func getSupportedFormats() -> JSPromise { - constructor[Strings.getSupportedFormats]!().fromJSValue()! + let this = constructor + return this[Strings.getSupportedFormats].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func getSupportedFormats() async throws -> [BarcodeFormat] { - let _promise: JSPromise = constructor[Strings.getSupportedFormats]!().fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.getSupportedFormats].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func detect(image: ImageBitmapSource) -> JSPromise { - jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func detect(image: ImageBitmapSource) async throws -> [DetectedBarcode] { - let _promise: JSPromise = jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BaseAudioContext.swift b/Sources/DOMKit/WebIDL/BaseAudioContext.swift index 7a5641bc..f1144701 100644 --- a/Sources/DOMKit/WebIDL/BaseAudioContext.swift +++ b/Sources/DOMKit/WebIDL/BaseAudioContext.swift @@ -39,75 +39,93 @@ public class BaseAudioContext: EventTarget { public var onstatechange: EventHandler public func createAnalyser() -> AnalyserNode { - jsObject[Strings.createAnalyser]!().fromJSValue()! + let this = jsObject + return this[Strings.createAnalyser].function!(this: this, arguments: []).fromJSValue()! } public func createBiquadFilter() -> BiquadFilterNode { - jsObject[Strings.createBiquadFilter]!().fromJSValue()! + let this = jsObject + return this[Strings.createBiquadFilter].function!(this: this, arguments: []).fromJSValue()! } public func createBuffer(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) -> AudioBuffer { - jsObject[Strings.createBuffer]!(numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createBuffer].function!(this: this, arguments: [numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue()]).fromJSValue()! } public func createBufferSource() -> AudioBufferSourceNode { - jsObject[Strings.createBufferSource]!().fromJSValue()! + let this = jsObject + return this[Strings.createBufferSource].function!(this: this, arguments: []).fromJSValue()! } public func createChannelMerger(numberOfInputs: UInt32? = nil) -> ChannelMergerNode { - jsObject[Strings.createChannelMerger]!(numberOfInputs?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createChannelMerger].function!(this: this, arguments: [numberOfInputs?.jsValue() ?? .undefined]).fromJSValue()! } public func createChannelSplitter(numberOfOutputs: UInt32? = nil) -> ChannelSplitterNode { - jsObject[Strings.createChannelSplitter]!(numberOfOutputs?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createChannelSplitter].function!(this: this, arguments: [numberOfOutputs?.jsValue() ?? .undefined]).fromJSValue()! } public func createConstantSource() -> ConstantSourceNode { - jsObject[Strings.createConstantSource]!().fromJSValue()! + let this = jsObject + return this[Strings.createConstantSource].function!(this: this, arguments: []).fromJSValue()! } public func createConvolver() -> ConvolverNode { - jsObject[Strings.createConvolver]!().fromJSValue()! + let this = jsObject + return this[Strings.createConvolver].function!(this: this, arguments: []).fromJSValue()! } public func createDelay(maxDelayTime: Double? = nil) -> DelayNode { - jsObject[Strings.createDelay]!(maxDelayTime?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createDelay].function!(this: this, arguments: [maxDelayTime?.jsValue() ?? .undefined]).fromJSValue()! } public func createDynamicsCompressor() -> DynamicsCompressorNode { - jsObject[Strings.createDynamicsCompressor]!().fromJSValue()! + let this = jsObject + return this[Strings.createDynamicsCompressor].function!(this: this, arguments: []).fromJSValue()! } public func createGain() -> GainNode { - jsObject[Strings.createGain]!().fromJSValue()! + let this = jsObject + return this[Strings.createGain].function!(this: this, arguments: []).fromJSValue()! } public func createIIRFilter(feedforward: [Double], feedback: [Double]) -> IIRFilterNode { - jsObject[Strings.createIIRFilter]!(feedforward.jsValue(), feedback.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createIIRFilter].function!(this: this, arguments: [feedforward.jsValue(), feedback.jsValue()]).fromJSValue()! } public func createOscillator() -> OscillatorNode { - jsObject[Strings.createOscillator]!().fromJSValue()! + let this = jsObject + return this[Strings.createOscillator].function!(this: this, arguments: []).fromJSValue()! } public func createPanner() -> PannerNode { - jsObject[Strings.createPanner]!().fromJSValue()! + let this = jsObject + return this[Strings.createPanner].function!(this: this, arguments: []).fromJSValue()! } public func createPeriodicWave(real: [Float], imag: [Float], constraints: PeriodicWaveConstraints? = nil) -> PeriodicWave { - jsObject[Strings.createPeriodicWave]!(real.jsValue(), imag.jsValue(), constraints?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createPeriodicWave].function!(this: this, arguments: [real.jsValue(), imag.jsValue(), constraints?.jsValue() ?? .undefined]).fromJSValue()! } public func createScriptProcessor(bufferSize: UInt32? = nil, numberOfInputChannels: UInt32? = nil, numberOfOutputChannels: UInt32? = nil) -> ScriptProcessorNode { - jsObject[Strings.createScriptProcessor]!(bufferSize?.jsValue() ?? .undefined, numberOfInputChannels?.jsValue() ?? .undefined, numberOfOutputChannels?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createScriptProcessor].function!(this: this, arguments: [bufferSize?.jsValue() ?? .undefined, numberOfInputChannels?.jsValue() ?? .undefined, numberOfOutputChannels?.jsValue() ?? .undefined]).fromJSValue()! } public func createStereoPanner() -> StereoPannerNode { - jsObject[Strings.createStereoPanner]!().fromJSValue()! + let this = jsObject + return this[Strings.createStereoPanner].function!(this: this, arguments: []).fromJSValue()! } public func createWaveShaper() -> WaveShaperNode { - jsObject[Strings.createWaveShaper]!().fromJSValue()! + let this = jsObject + return this[Strings.createWaveShaper].function!(this: this, arguments: []).fromJSValue()! } // XXX: member 'decodeAudioData' is ignored diff --git a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift index ef1911fd..b43f5d44 100644 --- a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift +++ b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift @@ -15,12 +15,14 @@ public class BeforeInstallPromptEvent: Event { } public func prompt() -> JSPromise { - jsObject[Strings.prompt]!().fromJSValue()! + let this = jsObject + return this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func prompt() async throws -> PromptResponseObject { - let _promise: JSPromise = jsObject[Strings.prompt]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift index 1bc09324..bb72e984 100644 --- a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift +++ b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift @@ -35,6 +35,7 @@ public class BiquadFilterNode: AudioNode { public var gain: AudioParam public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { - _ = jsObject[Strings.getFrequencyResponse]!(frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()) + let this = jsObject + _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index 8d6fded9..634ba989 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -25,30 +25,36 @@ public class Blob: JSBridgedClass { public var type: String public func slice(start: Int64? = nil, end: Int64? = nil, contentType: String? = nil) -> Self { - jsObject[Strings.slice]!(start?.jsValue() ?? .undefined, end?.jsValue() ?? .undefined, contentType?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.slice].function!(this: this, arguments: [start?.jsValue() ?? .undefined, end?.jsValue() ?? .undefined, contentType?.jsValue() ?? .undefined]).fromJSValue()! } public func stream() -> ReadableStream { - jsObject[Strings.stream]!().fromJSValue()! + let this = jsObject + return this[Strings.stream].function!(this: this, arguments: []).fromJSValue()! } public func text() -> JSPromise { - jsObject[Strings.text]!().fromJSValue()! + 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, *) public func text() async throws -> String { - let _promise: JSPromise = jsObject[Strings.text]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func arrayBuffer() -> JSPromise { - jsObject[Strings.arrayBuffer]!().fromJSValue()! + let this = jsObject + return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func arrayBuffer() async throws -> ArrayBuffer { - let _promise: JSPromise = jsObject[Strings.arrayBuffer]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Bluetooth.swift b/Sources/DOMKit/WebIDL/Bluetooth.swift index 235d3d15..cdb98021 100644 --- a/Sources/DOMKit/WebIDL/Bluetooth.swift +++ b/Sources/DOMKit/WebIDL/Bluetooth.swift @@ -13,12 +13,14 @@ public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, Characteristi } public func getAvailability() -> JSPromise { - jsObject[Strings.getAvailability]!().fromJSValue()! + let this = jsObject + return this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getAvailability() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.getAvailability]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -29,22 +31,26 @@ public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, Characteristi public var referringDevice: BluetoothDevice? public func getDevices() -> JSPromise { - jsObject[Strings.getDevices]!().fromJSValue()! + let this = jsObject + return this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDevices() async throws -> [BluetoothDevice] { - let _promise: JSPromise = jsObject[Strings.getDevices]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func requestDevice(options: RequestDeviceOptions? = nil) -> JSPromise { - jsObject[Strings.requestDevice]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestDevice(options: RequestDeviceOptions? = nil) async throws -> BluetoothDevice { - let _promise: JSPromise = jsObject[Strings.requestDevice]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BluetoothDevice.swift b/Sources/DOMKit/WebIDL/BluetoothDevice.swift index fee404cc..7e886778 100644 --- a/Sources/DOMKit/WebIDL/BluetoothDevice.swift +++ b/Sources/DOMKit/WebIDL/BluetoothDevice.swift @@ -24,12 +24,14 @@ public class BluetoothDevice: EventTarget, BluetoothDeviceEventHandlers, Charact public var gatt: BluetoothRemoteGATTServer? public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) -> JSPromise { - jsObject[Strings.watchAdvertisements]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.watchAdvertisements]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift index 692c9d14..3f93c269 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift @@ -27,82 +27,98 @@ public class BluetoothRemoteGATTCharacteristic: EventTarget, CharacteristicEvent public var value: DataView? public func getDescriptor(descriptor: BluetoothDescriptorUUID) -> JSPromise { - jsObject[Strings.getDescriptor]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDescriptor(descriptor: BluetoothDescriptorUUID) async throws -> BluetoothRemoteGATTDescriptor { - let _promise: JSPromise = jsObject[Strings.getDescriptor]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) -> JSPromise { - jsObject[Strings.getDescriptors]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) async throws -> [BluetoothRemoteGATTDescriptor] { - let _promise: JSPromise = jsObject[Strings.getDescriptors]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func readValue() -> JSPromise { - jsObject[Strings.readValue]!().fromJSValue()! + let this = jsObject + return this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func readValue() async throws -> DataView { - let _promise: JSPromise = jsObject[Strings.readValue]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func writeValue(value: BufferSource) -> JSPromise { - jsObject[Strings.writeValue]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func writeValue(value: BufferSource) async throws { - let _promise: JSPromise = jsObject[Strings.writeValue]!(value.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func writeValueWithResponse(value: BufferSource) -> JSPromise { - jsObject[Strings.writeValueWithResponse]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func writeValueWithResponse(value: BufferSource) async throws { - let _promise: JSPromise = jsObject[Strings.writeValueWithResponse]!(value.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func writeValueWithoutResponse(value: BufferSource) -> JSPromise { - jsObject[Strings.writeValueWithoutResponse]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func writeValueWithoutResponse(value: BufferSource) async throws { - let _promise: JSPromise = jsObject[Strings.writeValueWithoutResponse]!(value.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func startNotifications() -> JSPromise { - jsObject[Strings.startNotifications]!().fromJSValue()! + let this = jsObject + return this[Strings.startNotifications].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func startNotifications() async throws -> BluetoothRemoteGATTCharacteristic { - let _promise: JSPromise = jsObject[Strings.startNotifications]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.startNotifications].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func stopNotifications() -> JSPromise { - jsObject[Strings.stopNotifications]!().fromJSValue()! + let this = jsObject + return this[Strings.stopNotifications].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func stopNotifications() async throws -> BluetoothRemoteGATTCharacteristic { - let _promise: JSPromise = jsObject[Strings.stopNotifications]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.stopNotifications].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift index 56304d69..7d909617 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift @@ -25,22 +25,26 @@ public class BluetoothRemoteGATTDescriptor: JSBridgedClass { public var value: DataView? public func readValue() -> JSPromise { - jsObject[Strings.readValue]!().fromJSValue()! + let this = jsObject + return this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func readValue() async throws -> DataView { - let _promise: JSPromise = jsObject[Strings.readValue]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func writeValue(value: BufferSource) -> JSPromise { - jsObject[Strings.writeValue]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func writeValue(value: BufferSource) async throws { - let _promise: JSPromise = jsObject[Strings.writeValue]!(value.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift index 6dab1617..29f497ed 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift @@ -21,36 +21,43 @@ public class BluetoothRemoteGATTServer: JSBridgedClass { public var connected: Bool public func connect() -> JSPromise { - jsObject[Strings.connect]!().fromJSValue()! + let this = jsObject + return this[Strings.connect].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func connect() async throws -> BluetoothRemoteGATTServer { - let _promise: JSPromise = jsObject[Strings.connect]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.connect].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func disconnect() { - _ = jsObject[Strings.disconnect]!() + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: []) } public func getPrimaryService(service: BluetoothServiceUUID) -> JSPromise { - jsObject[Strings.getPrimaryService]!(service.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getPrimaryService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { - let _promise: JSPromise = jsObject[Strings.getPrimaryService]!(service.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getPrimaryServices(service: BluetoothServiceUUID? = nil) -> JSPromise { - jsObject[Strings.getPrimaryServices]!(service?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getPrimaryServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { - let _promise: JSPromise = jsObject[Strings.getPrimaryServices]!(service?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift index 75aed837..7d113865 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift @@ -23,42 +23,50 @@ public class BluetoothRemoteGATTService: EventTarget, CharacteristicEventHandler public var isPrimary: Bool public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) -> JSPromise { - jsObject[Strings.getCharacteristic]!(characteristic.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) async throws -> BluetoothRemoteGATTCharacteristic { - let _promise: JSPromise = jsObject[Strings.getCharacteristic]!(characteristic.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) -> JSPromise { - jsObject[Strings.getCharacteristics]!(characteristic?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) async throws -> [BluetoothRemoteGATTCharacteristic] { - let _promise: JSPromise = jsObject[Strings.getCharacteristics]!(characteristic?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getIncludedService(service: BluetoothServiceUUID) -> JSPromise { - jsObject[Strings.getIncludedService]!(service.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getIncludedService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { - let _promise: JSPromise = jsObject[Strings.getIncludedService]!(service.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getIncludedServices(service: BluetoothServiceUUID? = nil) -> JSPromise { - jsObject[Strings.getIncludedServices]!(service?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getIncludedServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { - let _promise: JSPromise = jsObject[Strings.getIncludedServices]!(service?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BluetoothUUID.swift b/Sources/DOMKit/WebIDL/BluetoothUUID.swift index 34c989f8..815910e2 100644 --- a/Sources/DOMKit/WebIDL/BluetoothUUID.swift +++ b/Sources/DOMKit/WebIDL/BluetoothUUID.swift @@ -13,18 +13,22 @@ public class BluetoothUUID: JSBridgedClass { } public static func getService(name: __UNSUPPORTED_UNION__) -> UUID { - constructor[Strings.getService]!(name.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.getService].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public static func getCharacteristic(name: __UNSUPPORTED_UNION__) -> UUID { - constructor[Strings.getCharacteristic]!(name.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.getCharacteristic].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public static func getDescriptor(name: __UNSUPPORTED_UNION__) -> UUID { - constructor[Strings.getDescriptor]!(name.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.getDescriptor].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public static func canonicalUUID(alias: UInt32) -> UUID { - constructor[Strings.canonicalUUID]!(alias.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.canonicalUUID].function!(this: this, arguments: [alias.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Body.swift b/Sources/DOMKit/WebIDL/Body.swift index 02034891..17c8593b 100644 --- a/Sources/DOMKit/WebIDL/Body.swift +++ b/Sources/DOMKit/WebIDL/Body.swift @@ -10,52 +10,62 @@ public extension Body { var bodyUsed: Bool { ReadonlyAttribute[Strings.bodyUsed, in: jsObject] } func arrayBuffer() -> JSPromise { - jsObject[Strings.arrayBuffer]!().fromJSValue()! + let this = jsObject + return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func arrayBuffer() async throws -> ArrayBuffer { - let _promise: JSPromise = jsObject[Strings.arrayBuffer]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } func blob() -> JSPromise { - jsObject[Strings.blob]!().fromJSValue()! + let this = jsObject + return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func blob() async throws -> Blob { - let _promise: JSPromise = jsObject[Strings.blob]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } func formData() -> JSPromise { - jsObject[Strings.formData]!().fromJSValue()! + let this = jsObject + return this[Strings.formData].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func formData() async throws -> FormData { - let _promise: JSPromise = jsObject[Strings.formData]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.formData].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } func json() -> JSPromise { - jsObject[Strings.json]!().fromJSValue()! + let this = jsObject + return this[Strings.json].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func json() async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.json]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.json].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } func text() -> JSPromise { - jsObject[Strings.text]!().fromJSValue()! + 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, *) func text() async throws -> String { - let _promise: JSPromise = jsObject[Strings.text]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index 47ccc831..87fd34e7 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -21,11 +21,13 @@ public class BroadcastChannel: EventTarget { public var name: String public func postMessage(message: JSValue) { - _ = jsObject[Strings.postMessage]!(message.jsValue()) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue()]) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift b/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift index fb865bb7..6a845539 100644 --- a/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift @@ -11,16 +11,19 @@ public class BrowserCaptureMediaStreamTrack: MediaStreamTrack { } public func cropTo(cropTarget: CropTarget?) -> JSPromise { - jsObject[Strings.cropTo]!(cropTarget.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func cropTo(cropTarget: CropTarget?) async throws { - let _promise: JSPromise = jsObject[Strings.cropTo]!(cropTarget.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue()]).fromJSValue()! _ = try await _promise.get() } override public func clone() -> Self { - jsObject[Strings.clone]!().fromJSValue()! + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index 6a6d038a..2d3cf756 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -11,11 +11,13 @@ public enum CSS { public static var animationWorklet: Worklet { ReadonlyAttribute[Strings.animationWorklet, in: jsObject] } public static func supports(property: String, value: String) -> Bool { - JSObject.global[Strings.CSS].object![Strings.supports]!(property.jsValue(), value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.supports].function!(this: this, arguments: [property.jsValue(), value.jsValue()]).fromJSValue()! } public static func supports(conditionText: String) -> Bool { - JSObject.global[Strings.CSS].object![Strings.supports]!(conditionText.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.supports].function!(this: this, arguments: [conditionText.jsValue()]).fromJSValue()! } public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } @@ -27,298 +29,370 @@ public enum CSS { public static var paintWorklet: Worklet { ReadonlyAttribute[Strings.paintWorklet, in: jsObject] } public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - JSObject.global[Strings.CSS].object![Strings.parseStylesheet]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { - let _promise: JSPromise = JSObject.global[Strings.CSS].object![Strings.parseStylesheet]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + let _promise: JSPromise = this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - JSObject.global[Strings.CSS].object![Strings.parseRuleList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { - let _promise: JSPromise = JSObject.global[Strings.CSS].object![Strings.parseRuleList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + let _promise: JSPromise = this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - JSObject.global[Strings.CSS].object![Strings.parseRule]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.parseRule].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> CSSParserRule { - let _promise: JSPromise = JSObject.global[Strings.CSS].object![Strings.parseRule]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + let _promise: JSPromise = this[Strings.parseRule].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - JSObject.global[Strings.CSS].object![Strings.parseDeclarationList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { - let _promise: JSPromise = JSObject.global[Strings.CSS].object![Strings.parseDeclarationList]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + let _promise: JSPromise = this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func parseDeclaration(css: String, options: CSSParserOptions? = nil) -> CSSParserDeclaration { - JSObject.global[Strings.CSS].object![Strings.parseDeclaration]!(css.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.parseDeclaration].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public static func parseValue(css: String) -> CSSToken { - JSObject.global[Strings.CSS].object![Strings.parseValue]!(css.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.parseValue].function!(this: this, arguments: [css.jsValue()]).fromJSValue()! } public static func parseValueList(css: String) -> [CSSToken] { - JSObject.global[Strings.CSS].object![Strings.parseValueList]!(css.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.parseValueList].function!(this: this, arguments: [css.jsValue()]).fromJSValue()! } public static func parseCommaValueList(css: String) -> [[CSSToken]] { - JSObject.global[Strings.CSS].object![Strings.parseCommaValueList]!(css.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.parseCommaValueList].function!(this: this, arguments: [css.jsValue()]).fromJSValue()! } public static func registerProperty(definition: PropertyDefinition) { - _ = JSObject.global[Strings.CSS].object![Strings.registerProperty]!(definition.jsValue()) + let this = JSObject.global[Strings.CSS].object! + _ = this[Strings.registerProperty].function!(this: this, arguments: [definition.jsValue()]) } public static func number(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.number]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.number].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func percent(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.percent]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.percent].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func em(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.em]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.em].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func ex(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.ex]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.ex].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func ch(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.ch]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.ch].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func ic(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.ic]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.ic].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func rem(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.rem]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.rem].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func lh(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.lh]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.lh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func rlh(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.rlh]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.rlh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func vw(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.vw]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.vw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func vh(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.vh]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.vh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func vi(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.vi]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.vi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func vb(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.vb]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.vb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func vmin(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.vmin]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.vmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func vmax(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.vmax]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.vmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func svw(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.svw]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.svw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func svh(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.svh]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.svh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func svi(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.svi]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.svi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func svb(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.svb]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.svb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func svmin(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.svmin]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.svmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func svmax(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.svmax]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.svmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func lvw(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.lvw]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.lvw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func lvh(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.lvh]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.lvh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func lvi(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.lvi]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.lvi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func lvb(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.lvb]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.lvb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func lvmin(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.lvmin]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.lvmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func lvmax(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.lvmax]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.lvmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func dvw(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.dvw]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.dvw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func dvh(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.dvh]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.dvh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func dvi(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.dvi]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.dvi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func dvb(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.dvb]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.dvb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func dvmin(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.dvmin]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.dvmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func dvmax(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.dvmax]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.dvmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func cqw(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.cqw]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.cqw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func cqh(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.cqh]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.cqh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func cqi(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.cqi]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.cqi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func cqb(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.cqb]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.cqb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func cqmin(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.cqmin]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.cqmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func cqmax(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.cqmax]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.cqmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func cm(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.cm]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.cm].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func mm(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.mm]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.mm].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func Q(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.Q]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.Q].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func `in`(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.in]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.in].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func pt(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.pt]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.pt].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func pc(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.pc]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.pc].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func px(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.px]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.px].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func deg(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.deg]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.deg].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func grad(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.grad]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.grad].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func rad(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.rad]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.rad].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func turn(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.turn]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.turn].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func s(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.s]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.s].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func ms(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.ms]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.ms].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func Hz(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.Hz]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.Hz].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func kHz(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.kHz]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.kHz].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func dpi(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.dpi]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.dpi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func dpcm(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.dpcm]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.dpcm].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func dppx(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.dppx]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.dppx].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func fr(value: Double) -> CSSUnitValue { - JSObject.global[Strings.CSS].object![Strings.fr]!(value.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.fr].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func escape(ident: String) -> String { - JSObject.global[Strings.CSS].object![Strings.escape]!(ident.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.CSS].object! + return this[Strings.escape].function!(this: this, arguments: [ident.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSColorValue.swift b/Sources/DOMKit/WebIDL/CSSColorValue.swift index 279b7309..be07b910 100644 --- a/Sources/DOMKit/WebIDL/CSSColorValue.swift +++ b/Sources/DOMKit/WebIDL/CSSColorValue.swift @@ -15,7 +15,8 @@ public class CSSColorValue: CSSStyleValue { public var colorSpace: CSSKeywordValue public func to(colorSpace: CSSKeywordish) -> Self { - jsObject[Strings.to]!(colorSpace.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.to].function!(this: this, arguments: [colorSpace.jsValue()]).fromJSValue()! } // XXX: illegal static override diff --git a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift index e3c5987c..08dd833b 100644 --- a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift +++ b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift @@ -15,6 +15,7 @@ public class CSSFontFeatureValuesMap: JSBridgedClass { // XXX: make me Map-like! public func set(featureValueName: String, values: __UNSUPPORTED_UNION__) { - _ = jsObject[Strings.set]!(featureValueName.jsValue(), values.jsValue()) + let this = jsObject + _ = this[Strings.set].function!(this: this, arguments: [featureValueName.jsValue(), values.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift index 2b0f997e..2f3d4c1a 100644 --- a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift @@ -15,10 +15,12 @@ public class CSSGroupingRule: CSSRule { public var cssRules: CSSRuleList public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - jsObject[Strings.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteRule(index: UInt32) { - _ = jsObject[Strings.deleteRule]!(index.jsValue()) + let this = jsObject + _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift b/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift index 526d2c3d..10259c89 100644 --- a/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift +++ b/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift @@ -19,14 +19,17 @@ public class CSSKeyframesRule: CSSRule { public var cssRules: CSSRuleList public func appendRule(rule: String) { - _ = jsObject[Strings.appendRule]!(rule.jsValue()) + let this = jsObject + _ = this[Strings.appendRule].function!(this: this, arguments: [rule.jsValue()]) } public func deleteRule(select: String) { - _ = jsObject[Strings.deleteRule]!(select.jsValue()) + let this = jsObject + _ = this[Strings.deleteRule].function!(this: this, arguments: [select.jsValue()]) } public func findRule(select: String) -> CSSKeyframeRule? { - jsObject[Strings.findRule]!(select.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.findRule].function!(this: this, arguments: [select.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSNestingRule.swift b/Sources/DOMKit/WebIDL/CSSNestingRule.swift index f40761f1..2abe8c5b 100644 --- a/Sources/DOMKit/WebIDL/CSSNestingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSNestingRule.swift @@ -23,10 +23,12 @@ public class CSSNestingRule: CSSRule { public var cssRules: CSSRuleList public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - jsObject[Strings.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteRule(index: UInt32) { - _ = jsObject[Strings.deleteRule]!(index.jsValue()) + let this = jsObject + _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue.swift b/Sources/DOMKit/WebIDL/CSSNumericValue.swift index fdba4a5c..3c79c31a 100644 --- a/Sources/DOMKit/WebIDL/CSSNumericValue.swift +++ b/Sources/DOMKit/WebIDL/CSSNumericValue.swift @@ -11,43 +11,53 @@ public class CSSNumericValue: CSSStyleValue { } public func add(values: CSSNumberish...) -> Self { - jsObject[Strings.add]!(values.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.add].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } public func sub(values: CSSNumberish...) -> Self { - jsObject[Strings.sub]!(values.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.sub].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } public func mul(values: CSSNumberish...) -> Self { - jsObject[Strings.mul]!(values.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.mul].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } public func div(values: CSSNumberish...) -> Self { - jsObject[Strings.div]!(values.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.div].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } public func min(values: CSSNumberish...) -> Self { - jsObject[Strings.min]!(values.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.min].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } public func max(values: CSSNumberish...) -> Self { - jsObject[Strings.max]!(values.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.max].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } public func equals(value: CSSNumberish...) -> Bool { - jsObject[Strings.equals]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.equals].function!(this: this, arguments: value.map { $0.jsValue() }).fromJSValue()! } public func to(unit: String) -> CSSUnitValue { - jsObject[Strings.to]!(unit.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.to].function!(this: this, arguments: [unit.jsValue()]).fromJSValue()! } public func toSum(units: String...) -> CSSMathSum { - jsObject[Strings.toSum]!(units.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.toSum].function!(this: this, arguments: units.map { $0.jsValue() }).fromJSValue()! } public func type() -> CSSNumericType { - jsObject[Strings.type]!().fromJSValue()! + let this = jsObject + return this[Strings.type].function!(this: this, arguments: []).fromJSValue()! } // XXX: illegal static override diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift index 45144b76..20338cdf 100644 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift @@ -23,6 +23,7 @@ public class CSSPseudoElement: EventTarget, GeometryUtils { public var parent: __UNSUPPORTED_UNION__ public func pseudo(type: String) -> CSSPseudoElement? { - jsObject[Strings.pseudo]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift index 532811c2..78d71700 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift @@ -27,19 +27,23 @@ public class CSSStyleDeclaration: JSBridgedClass { } public func getPropertyValue(property: String) -> String { - jsObject[Strings.getPropertyValue]!(property.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getPropertyValue].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } public func getPropertyPriority(property: String) -> String { - jsObject[Strings.getPropertyPriority]!(property.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getPropertyPriority].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } public func setProperty(property: String, value: String, priority: String? = nil) { - _ = jsObject[Strings.setProperty]!(property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setProperty].function!(this: this, arguments: [property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined]) } public func removeProperty(property: String) -> String { - jsObject[Strings.removeProperty]!(property.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeProperty].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift index 2655ea97..a057ad68 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -18,11 +18,13 @@ public class CSSStyleRule: CSSRule { public var cssRules: CSSRuleList public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - jsObject[Strings.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteRule(index: UInt32) { - _ = jsObject[Strings.deleteRule]!(index.jsValue()) + let this = jsObject + _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift index 3df9a26d..fd30e7d6 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -24,35 +24,42 @@ public class CSSStyleSheet: StyleSheet { public var cssRules: CSSRuleList public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - jsObject[Strings.insertRule]!(rule.jsValue(), index?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteRule(index: UInt32) { - _ = jsObject[Strings.deleteRule]!(index.jsValue()) + let this = jsObject + _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) } public func replace(text: String) -> JSPromise { - jsObject[Strings.replace]!(text.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.replace].function!(this: this, arguments: [text.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func replace(text: String) async throws -> CSSStyleSheet { - let _promise: JSPromise = jsObject[Strings.replace]!(text.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.replace].function!(this: this, arguments: [text.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func replaceSync(text: String) { - _ = jsObject[Strings.replaceSync]!(text.jsValue()) + let this = jsObject + _ = this[Strings.replaceSync].function!(this: this, arguments: [text.jsValue()]) } @ReadonlyAttribute public var rules: CSSRuleList public func addRule(selector: String? = nil, style: String? = nil, index: UInt32? = nil) -> Int32 { - jsObject[Strings.addRule]!(selector?.jsValue() ?? .undefined, style?.jsValue() ?? .undefined, index?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.addRule].function!(this: this, arguments: [selector?.jsValue() ?? .undefined, style?.jsValue() ?? .undefined, index?.jsValue() ?? .undefined]).fromJSValue()! } public func removeRule(index: UInt32? = nil) { - _ = jsObject[Strings.removeRule]!(index?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.removeRule].function!(this: this, arguments: [index?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/CSSStyleValue.swift b/Sources/DOMKit/WebIDL/CSSStyleValue.swift index 2c45aa13..23a14855 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleValue.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleValue.swift @@ -17,10 +17,12 @@ public class CSSStyleValue: JSBridgedClass { } public static func parse(property: String, cssText: String) -> Self { - constructor[Strings.parse]!(property.jsValue(), cssText.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.parse].function!(this: this, arguments: [property.jsValue(), cssText.jsValue()]).fromJSValue()! } public static func parseAll(property: String, cssText: String) -> [CSSStyleValue] { - constructor[Strings.parseAll]!(property.jsValue(), cssText.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.parseAll].function!(this: this, arguments: [property.jsValue(), cssText.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSTransformComponent.swift b/Sources/DOMKit/WebIDL/CSSTransformComponent.swift index e0ceb085..586d0c93 100644 --- a/Sources/DOMKit/WebIDL/CSSTransformComponent.swift +++ b/Sources/DOMKit/WebIDL/CSSTransformComponent.swift @@ -21,6 +21,7 @@ public class CSSTransformComponent: JSBridgedClass { public var is2D: Bool public func toMatrix() -> DOMMatrix { - jsObject[Strings.toMatrix]!().fromJSValue()! + let this = jsObject + return this[Strings.toMatrix].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSTransformValue.swift b/Sources/DOMKit/WebIDL/CSSTransformValue.swift index 8215f0e2..3eb7bdb2 100644 --- a/Sources/DOMKit/WebIDL/CSSTransformValue.swift +++ b/Sources/DOMKit/WebIDL/CSSTransformValue.swift @@ -34,6 +34,7 @@ public class CSSTransformValue: CSSStyleValue, Sequence { public var is2D: Bool public func toMatrix() -> DOMMatrix { - jsObject[Strings.toMatrix]!().fromJSValue()! + let this = jsObject + return this[Strings.toMatrix].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Cache.swift b/Sources/DOMKit/WebIDL/Cache.swift index b32dbcbb..015f44e7 100644 --- a/Sources/DOMKit/WebIDL/Cache.swift +++ b/Sources/DOMKit/WebIDL/Cache.swift @@ -13,72 +13,86 @@ public class Cache: JSBridgedClass { } public func match(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { - jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { - let _promise: JSPromise = jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { - jsObject[Strings.matchAll]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Response] { - let _promise: JSPromise = jsObject[Strings.matchAll]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func add(request: RequestInfo) -> JSPromise { - jsObject[Strings.add]!(request.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.add].function!(this: this, arguments: [request.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func add(request: RequestInfo) async throws { - let _promise: JSPromise = jsObject[Strings.add]!(request.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.add].function!(this: this, arguments: [request.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func addAll(requests: [RequestInfo]) -> JSPromise { - jsObject[Strings.addAll]!(requests.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.addAll].function!(this: this, arguments: [requests.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func addAll(requests: [RequestInfo]) async throws { - let _promise: JSPromise = jsObject[Strings.addAll]!(requests.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.addAll].function!(this: this, arguments: [requests.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func put(request: RequestInfo, response: Response) -> JSPromise { - jsObject[Strings.put]!(request.jsValue(), response.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.put].function!(this: this, arguments: [request.jsValue(), response.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func put(request: RequestInfo, response: Response) async throws { - let _promise: JSPromise = jsObject[Strings.put]!(request.jsValue(), response.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.put].function!(this: this, arguments: [request.jsValue(), response.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { - jsObject[Strings.delete]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.delete].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.delete]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { - jsObject[Strings.keys]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.keys].function!(this: this, arguments: [request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Request] { - let _promise: JSPromise = jsObject[Strings.keys]!(request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.keys].function!(this: this, arguments: [request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CacheStorage.swift b/Sources/DOMKit/WebIDL/CacheStorage.swift index 03dc978b..a61f83a0 100644 --- a/Sources/DOMKit/WebIDL/CacheStorage.swift +++ b/Sources/DOMKit/WebIDL/CacheStorage.swift @@ -13,52 +13,62 @@ public class CacheStorage: JSBridgedClass { } public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) -> JSPromise { - jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { - let _promise: JSPromise = jsObject[Strings.match]!(request.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func has(cacheName: String) -> JSPromise { - jsObject[Strings.has]!(cacheName.jsValue()).fromJSValue()! + 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, *) public func has(cacheName: String) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.has]!(cacheName.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.has].function!(this: this, arguments: [cacheName.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func open(cacheName: String) -> JSPromise { - jsObject[Strings.open]!(cacheName.jsValue()).fromJSValue()! + 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, *) public func open(cacheName: String) async throws -> Cache { - let _promise: JSPromise = jsObject[Strings.open]!(cacheName.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [cacheName.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func delete(cacheName: String) -> JSPromise { - jsObject[Strings.delete]!(cacheName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func delete(cacheName: String) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.delete]!(cacheName.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func keys() -> JSPromise { - jsObject[Strings.keys]!().fromJSValue()! + let this = jsObject + return this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func keys() async throws -> [String] { - let _promise: JSPromise = jsObject[Strings.keys]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift b/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift index 95d179ab..9ec5b0bf 100644 --- a/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift +++ b/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift @@ -27,6 +27,7 @@ public class CanMakePaymentEvent: ExtendableEvent { public var methodData: [PaymentMethodData] public func respondWith(canMakePaymentResponse: JSPromise) { - _ = jsObject[Strings.respondWith]!(canMakePaymentResponse.jsValue()) + let this = jsObject + _ = this[Strings.respondWith].function!(this: this, arguments: [canMakePaymentResponse.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift b/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift index d7c0cb64..13330725 100644 --- a/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift @@ -15,6 +15,7 @@ public class CanvasCaptureMediaStreamTrack: MediaStreamTrack { public var canvas: HTMLCanvasElement public func requestFrame() { - _ = jsObject[Strings.requestFrame]!() + let this = jsObject + _ = this[Strings.requestFrame].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift index 61809f5f..11aa7627 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift @@ -6,11 +6,13 @@ import JavaScriptKit public protocol CanvasDrawImage: JSBridgedClass {} public extension CanvasDrawImage { func drawImage(image: CanvasImageSource, dx: Double, dy: Double) { - _ = jsObject[Strings.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue()) + let this = jsObject + _ = this[Strings.drawImage].function!(this: this, arguments: [image.jsValue(), dx.jsValue(), dy.jsValue()]) } func drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double) { - _ = jsObject[Strings.drawImage]!(image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()) + let this = jsObject + _ = this[Strings.drawImage].function!(this: this, arguments: [image.jsValue(), dx.jsValue(), dy.jsValue(), dw.jsValue(), dh.jsValue()]) } func drawImage(image: CanvasImageSource, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { @@ -23,6 +25,7 @@ public extension CanvasDrawImage { let _arg6 = dy.jsValue() let _arg7 = dw.jsValue() let _arg8 = dh.jsValue() - _ = jsObject[Strings.drawImage]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.drawImage].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift index a5034ccd..9c329070 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift @@ -6,46 +6,57 @@ import JavaScriptKit public protocol CanvasDrawPath: JSBridgedClass {} public extension CanvasDrawPath { func beginPath() { - _ = jsObject[Strings.beginPath]!() + let this = jsObject + _ = this[Strings.beginPath].function!(this: this, arguments: []) } func fill(fillRule: CanvasFillRule? = nil) { - _ = jsObject[Strings.fill]!(fillRule?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.fill].function!(this: this, arguments: [fillRule?.jsValue() ?? .undefined]) } func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { - _ = jsObject[Strings.fill]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.fill].function!(this: this, arguments: [path.jsValue(), fillRule?.jsValue() ?? .undefined]) } func stroke() { - _ = jsObject[Strings.stroke]!() + let this = jsObject + _ = this[Strings.stroke].function!(this: this, arguments: []) } func stroke(path: Path2D) { - _ = jsObject[Strings.stroke]!(path.jsValue()) + let this = jsObject + _ = this[Strings.stroke].function!(this: this, arguments: [path.jsValue()]) } func clip(fillRule: CanvasFillRule? = nil) { - _ = jsObject[Strings.clip]!(fillRule?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clip].function!(this: this, arguments: [fillRule?.jsValue() ?? .undefined]) } func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { - _ = jsObject[Strings.clip]!(path.jsValue(), fillRule?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clip].function!(this: this, arguments: [path.jsValue(), fillRule?.jsValue() ?? .undefined]) } func isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { - jsObject[Strings.isPointInPath]!(x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.isPointInPath].function!(this: this, arguments: [x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined]).fromJSValue()! } func isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { - jsObject[Strings.isPointInPath]!(path.jsValue(), x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.isPointInPath].function!(this: this, arguments: [path.jsValue(), x.jsValue(), y.jsValue(), fillRule?.jsValue() ?? .undefined]).fromJSValue()! } func isPointInStroke(x: Double, y: Double) -> Bool { - jsObject[Strings.isPointInStroke]!(x.jsValue(), y.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isPointInStroke].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } func isPointInStroke(path: Path2D, x: Double, y: Double) -> Bool { - jsObject[Strings.isPointInStroke]!(path.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isPointInStroke].function!(this: this, arguments: [path.jsValue(), x.jsValue(), y.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift index ee82b6e1..637cb5f0 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift @@ -16,7 +16,8 @@ public extension CanvasFillStrokeStyles { } func createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double) -> CanvasGradient { - jsObject[Strings.createLinearGradient]!(x0.jsValue(), y0.jsValue(), x1.jsValue(), y1.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createLinearGradient].function!(this: this, arguments: [x0.jsValue(), y0.jsValue(), x1.jsValue(), y1.jsValue()]).fromJSValue()! } func createRadialGradient(x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double) -> CanvasGradient { @@ -26,14 +27,17 @@ public extension CanvasFillStrokeStyles { let _arg3 = x1.jsValue() let _arg4 = y1.jsValue() let _arg5 = r1.jsValue() - return jsObject[Strings.createRadialGradient]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + let this = jsObject + return this[Strings.createRadialGradient].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } func createConicGradient(startAngle: Double, x: Double, y: Double) -> CanvasGradient { - jsObject[Strings.createConicGradient]!(startAngle.jsValue(), x.jsValue(), y.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createConicGradient].function!(this: this, arguments: [startAngle.jsValue(), x.jsValue(), y.jsValue()]).fromJSValue()! } func createPattern(image: CanvasImageSource, repetition: String) -> CanvasPattern? { - jsObject[Strings.createPattern]!(image.jsValue(), repetition.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createPattern].function!(this: this, arguments: [image.jsValue(), repetition.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasGradient.swift b/Sources/DOMKit/WebIDL/CanvasGradient.swift index 5a7f2b18..e9af44a3 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient.swift @@ -13,6 +13,7 @@ public class CanvasGradient: JSBridgedClass { } public func addColorStop(offset: Double, color: String) { - _ = jsObject[Strings.addColorStop]!(offset.jsValue(), color.jsValue()) + let this = jsObject + _ = this[Strings.addColorStop].function!(this: this, arguments: [offset.jsValue(), color.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasImageData.swift b/Sources/DOMKit/WebIDL/CanvasImageData.swift index 7925cac9..e84d95b6 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageData.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageData.swift @@ -6,19 +6,23 @@ import JavaScriptKit public protocol CanvasImageData: JSBridgedClass {} public extension CanvasImageData { func createImageData(sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { - jsObject[Strings.createImageData]!(sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createImageData].function!(this: this, arguments: [sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined]).fromJSValue()! } func createImageData(imagedata: ImageData) -> ImageData { - jsObject[Strings.createImageData]!(imagedata.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createImageData].function!(this: this, arguments: [imagedata.jsValue()]).fromJSValue()! } func getImageData(sx: Int32, sy: Int32, sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { - jsObject[Strings.getImageData]!(sx.jsValue(), sy.jsValue(), sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getImageData].function!(this: this, arguments: [sx.jsValue(), sy.jsValue(), sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined]).fromJSValue()! } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { - _ = jsObject[Strings.putImageData]!(imagedata.jsValue(), dx.jsValue(), dy.jsValue()) + let this = jsObject + _ = this[Strings.putImageData].function!(this: this, arguments: [imagedata.jsValue(), dx.jsValue(), dy.jsValue()]) } func putImageData(imagedata: ImageData, dx: Int32, dy: Int32, dirtyX: Int32, dirtyY: Int32, dirtyWidth: Int32, dirtyHeight: Int32) { @@ -29,6 +33,7 @@ public extension CanvasImageData { let _arg4 = dirtyY.jsValue() let _arg5 = dirtyWidth.jsValue() let _arg6 = dirtyHeight.jsValue() - _ = jsObject[Strings.putImageData]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + let this = jsObject + _ = this[Strings.putImageData].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasPath.swift b/Sources/DOMKit/WebIDL/CanvasPath.swift index 8e4c001c..588a0fc3 100644 --- a/Sources/DOMKit/WebIDL/CanvasPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasPath.swift @@ -6,19 +6,23 @@ import JavaScriptKit public protocol CanvasPath: JSBridgedClass {} public extension CanvasPath { func closePath() { - _ = jsObject[Strings.closePath]!() + let this = jsObject + _ = this[Strings.closePath].function!(this: this, arguments: []) } func moveTo(x: Double, y: Double) { - _ = jsObject[Strings.moveTo]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } func lineTo(x: Double, y: Double) { - _ = jsObject[Strings.lineTo]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.lineTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } func quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double) { - _ = jsObject[Strings.quadraticCurveTo]!(cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.quadraticCurveTo].function!(this: this, arguments: [cpx.jsValue(), cpy.jsValue(), x.jsValue(), y.jsValue()]) } func bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double) { @@ -28,19 +32,23 @@ public extension CanvasPath { let _arg3 = cp2y.jsValue() let _arg4 = x.jsValue() let _arg5 = y.jsValue() - _ = jsObject[Strings.bezierCurveTo]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.bezierCurveTo].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) { - _ = jsObject[Strings.arcTo]!(x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()) + let this = jsObject + _ = this[Strings.arcTo].function!(this: this, arguments: [x1.jsValue(), y1.jsValue(), x2.jsValue(), y2.jsValue(), radius.jsValue()]) } func rect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Strings.rect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + let this = jsObject + _ = this[Strings.rect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()]) } func roundRect(x: Double, y: Double, w: Double, h: Double, radii: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Strings.roundRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.roundRect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined]) } func arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -50,7 +58,8 @@ public extension CanvasPath { let _arg3 = startAngle.jsValue() let _arg4 = endAngle.jsValue() let _arg5 = counterclockwise?.jsValue() ?? .undefined - _ = jsObject[Strings.arc]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.arc].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { @@ -62,6 +71,7 @@ public extension CanvasPath { let _arg5 = startAngle.jsValue() let _arg6 = endAngle.jsValue() let _arg7 = counterclockwise?.jsValue() ?? .undefined - _ = jsObject[Strings.ellipse]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.ellipse].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift index b1cd6b25..9c121819 100644 --- a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift @@ -26,11 +26,13 @@ public extension CanvasPathDrawingStyles { } func setLineDash(segments: [Double]) { - _ = jsObject[Strings.setLineDash]!(segments.jsValue()) + let this = jsObject + _ = this[Strings.setLineDash].function!(this: this, arguments: [segments.jsValue()]) } func getLineDash() -> [Double] { - jsObject[Strings.getLineDash]!().fromJSValue()! + let this = jsObject + return this[Strings.getLineDash].function!(this: this, arguments: []).fromJSValue()! } var lineDashOffset: Double { diff --git a/Sources/DOMKit/WebIDL/CanvasPattern.swift b/Sources/DOMKit/WebIDL/CanvasPattern.swift index 9903f9de..66e52564 100644 --- a/Sources/DOMKit/WebIDL/CanvasPattern.swift +++ b/Sources/DOMKit/WebIDL/CanvasPattern.swift @@ -13,6 +13,7 @@ public class CanvasPattern: JSBridgedClass { } public func setTransform(transform: DOMMatrix2DInit? = nil) { - _ = jsObject[Strings.setTransform]!(transform?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasRect.swift b/Sources/DOMKit/WebIDL/CanvasRect.swift index 6bf9205b..58c26aa3 100644 --- a/Sources/DOMKit/WebIDL/CanvasRect.swift +++ b/Sources/DOMKit/WebIDL/CanvasRect.swift @@ -6,14 +6,17 @@ import JavaScriptKit public protocol CanvasRect: JSBridgedClass {} public extension CanvasRect { func clearRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Strings.clearRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + let this = jsObject + _ = this[Strings.clearRect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()]) } func fillRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Strings.fillRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + let this = jsObject + _ = this[Strings.fillRect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()]) } func strokeRect(x: Double, y: Double, w: Double, h: Double) { - _ = jsObject[Strings.strokeRect]!(x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()) + let this = jsObject + _ = this[Strings.strokeRect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift index 036223eb..029f1130 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift @@ -17,6 +17,7 @@ public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransf public var canvas: HTMLCanvasElement public func getContextAttributes() -> CanvasRenderingContext2DSettings { - jsObject[Strings.getContextAttributes]!().fromJSValue()! + let this = jsObject + return this[Strings.getContextAttributes].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasState.swift b/Sources/DOMKit/WebIDL/CanvasState.swift index 6cc154be..5a434a9d 100644 --- a/Sources/DOMKit/WebIDL/CanvasState.swift +++ b/Sources/DOMKit/WebIDL/CanvasState.swift @@ -6,18 +6,22 @@ import JavaScriptKit public protocol CanvasState: JSBridgedClass {} public extension CanvasState { func save() { - _ = jsObject[Strings.save]!() + let this = jsObject + _ = this[Strings.save].function!(this: this, arguments: []) } func restore() { - _ = jsObject[Strings.restore]!() + let this = jsObject + _ = this[Strings.restore].function!(this: this, arguments: []) } func reset() { - _ = jsObject[Strings.reset]!() + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) } func isContextLost() -> Bool { - jsObject[Strings.isContextLost]!().fromJSValue()! + let this = jsObject + return this[Strings.isContextLost].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasText.swift b/Sources/DOMKit/WebIDL/CanvasText.swift index e3f3f80f..ff1b29b3 100644 --- a/Sources/DOMKit/WebIDL/CanvasText.swift +++ b/Sources/DOMKit/WebIDL/CanvasText.swift @@ -6,14 +6,17 @@ import JavaScriptKit public protocol CanvasText: JSBridgedClass {} public extension CanvasText { func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - _ = jsObject[Strings.fillText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.fillText].function!(this: this, arguments: [text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined]) } func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { - _ = jsObject[Strings.strokeText]!(text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.strokeText].function!(this: this, arguments: [text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined]) } func measureText(text: String) -> TextMetrics { - jsObject[Strings.measureText]!(text.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.measureText].function!(this: this, arguments: [text.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasTransform.swift b/Sources/DOMKit/WebIDL/CanvasTransform.swift index 597fec8a..e6948495 100644 --- a/Sources/DOMKit/WebIDL/CanvasTransform.swift +++ b/Sources/DOMKit/WebIDL/CanvasTransform.swift @@ -6,15 +6,18 @@ import JavaScriptKit public protocol CanvasTransform: JSBridgedClass {} public extension CanvasTransform { func scale(x: Double, y: Double) { - _ = jsObject[Strings.scale]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.scale].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } func rotate(angle: Double) { - _ = jsObject[Strings.rotate]!(angle.jsValue()) + let this = jsObject + _ = this[Strings.rotate].function!(this: this, arguments: [angle.jsValue()]) } func translate(x: Double, y: Double) { - _ = jsObject[Strings.translate]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.translate].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } func transform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { @@ -24,11 +27,13 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - _ = jsObject[Strings.transform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.transform].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func getTransform() -> DOMMatrix { - jsObject[Strings.getTransform]!().fromJSValue()! + let this = jsObject + return this[Strings.getTransform].function!(this: this, arguments: []).fromJSValue()! } func setTransform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { @@ -38,14 +43,17 @@ public extension CanvasTransform { let _arg3 = d.jsValue() let _arg4 = e.jsValue() let _arg5 = f.jsValue() - _ = jsObject[Strings.setTransform]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.setTransform].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func setTransform(transform: DOMMatrix2DInit? = nil) { - _ = jsObject[Strings.setTransform]!(transform?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue() ?? .undefined]) } func resetTransform() { - _ = jsObject[Strings.resetTransform]!() + let this = jsObject + _ = this[Strings.resetTransform].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift index c64641cd..9c5815a5 100644 --- a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift +++ b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift @@ -6,18 +6,22 @@ import JavaScriptKit public protocol CanvasUserInterface: JSBridgedClass {} public extension CanvasUserInterface { func drawFocusIfNeeded(element: Element) { - _ = jsObject[Strings.drawFocusIfNeeded]!(element.jsValue()) + let this = jsObject + _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [element.jsValue()]) } func drawFocusIfNeeded(path: Path2D, element: Element) { - _ = jsObject[Strings.drawFocusIfNeeded]!(path.jsValue(), element.jsValue()) + let this = jsObject + _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [path.jsValue(), element.jsValue()]) } func scrollPathIntoView() { - _ = jsObject[Strings.scrollPathIntoView]!() + let this = jsObject + _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: []) } func scrollPathIntoView(path: Path2D) { - _ = jsObject[Strings.scrollPathIntoView]!(path.jsValue()) + let this = jsObject + _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: [path.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/CaretPosition.swift b/Sources/DOMKit/WebIDL/CaretPosition.swift index 8f9dce26..9c5b6ff8 100644 --- a/Sources/DOMKit/WebIDL/CaretPosition.swift +++ b/Sources/DOMKit/WebIDL/CaretPosition.swift @@ -21,6 +21,7 @@ public class CaretPosition: JSBridgedClass { public var offset: UInt32 public func getClientRect() -> DOMRect? { - jsObject[Strings.getClientRect]!().fromJSValue()! + let this = jsObject + return this[Strings.getClientRect].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CharacterData.swift b/Sources/DOMKit/WebIDL/CharacterData.swift index 4ee2df6c..525d1968 100644 --- a/Sources/DOMKit/WebIDL/CharacterData.swift +++ b/Sources/DOMKit/WebIDL/CharacterData.swift @@ -19,22 +19,27 @@ public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { public var length: UInt32 public func substringData(offset: UInt32, count: UInt32) -> String { - jsObject[Strings.substringData]!(offset.jsValue(), count.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.substringData].function!(this: this, arguments: [offset.jsValue(), count.jsValue()]).fromJSValue()! } public func appendData(data: String) { - _ = jsObject[Strings.appendData]!(data.jsValue()) + let this = jsObject + _ = this[Strings.appendData].function!(this: this, arguments: [data.jsValue()]) } public func insertData(offset: UInt32, data: String) { - _ = jsObject[Strings.insertData]!(offset.jsValue(), data.jsValue()) + let this = jsObject + _ = this[Strings.insertData].function!(this: this, arguments: [offset.jsValue(), data.jsValue()]) } public func deleteData(offset: UInt32, count: UInt32) { - _ = jsObject[Strings.deleteData]!(offset.jsValue(), count.jsValue()) + let this = jsObject + _ = this[Strings.deleteData].function!(this: this, arguments: [offset.jsValue(), count.jsValue()]) } public func replaceData(offset: UInt32, count: UInt32, data: String) { - _ = jsObject[Strings.replaceData]!(offset.jsValue(), count.jsValue(), data.jsValue()) + let this = jsObject + _ = this[Strings.replaceData].function!(this: this, arguments: [offset.jsValue(), count.jsValue(), data.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/ChildNode.swift b/Sources/DOMKit/WebIDL/ChildNode.swift index 5d0ec263..6e8825f2 100644 --- a/Sources/DOMKit/WebIDL/ChildNode.swift +++ b/Sources/DOMKit/WebIDL/ChildNode.swift @@ -6,18 +6,22 @@ import JavaScriptKit public protocol ChildNode: JSBridgedClass {} public extension ChildNode { func before(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Strings.before]!(nodes.jsValue()) + let this = jsObject + _ = this[Strings.before].function!(this: this, arguments: nodes.map { $0.jsValue() }) } func after(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Strings.after]!(nodes.jsValue()) + let this = jsObject + _ = this[Strings.after].function!(this: this, arguments: nodes.map { $0.jsValue() }) } func replaceWith(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Strings.replaceWith]!(nodes.jsValue()) + let this = jsObject + _ = this[Strings.replaceWith].function!(this: this, arguments: nodes.map { $0.jsValue() }) } func remove() { - _ = jsObject[Strings.remove]!() + let this = jsObject + _ = this[Strings.remove].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/Client.swift b/Sources/DOMKit/WebIDL/Client.swift index 9c860c83..ea466e4f 100644 --- a/Sources/DOMKit/WebIDL/Client.swift +++ b/Sources/DOMKit/WebIDL/Client.swift @@ -33,10 +33,12 @@ public class Client: JSBridgedClass { public var type: ClientType public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/Clients.swift b/Sources/DOMKit/WebIDL/Clients.swift index 01f94c49..70436d78 100644 --- a/Sources/DOMKit/WebIDL/Clients.swift +++ b/Sources/DOMKit/WebIDL/Clients.swift @@ -13,42 +13,50 @@ public class Clients: JSBridgedClass { } public func get(id: String) -> JSPromise { - jsObject[Strings.get]!(id.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func get(id: String) async throws -> __UNSUPPORTED_UNION__ { - let _promise: JSPromise = jsObject[Strings.get]!(id.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func matchAll(options: ClientQueryOptions? = nil) -> JSPromise { - jsObject[Strings.matchAll]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.matchAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func matchAll(options: ClientQueryOptions? = nil) async throws -> [Client] { - let _promise: JSPromise = jsObject[Strings.matchAll]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func openWindow(url: String) -> JSPromise { - jsObject[Strings.openWindow]!(url.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func openWindow(url: String) async throws -> WindowClient? { - let _promise: JSPromise = jsObject[Strings.openWindow]!(url.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func claim() -> JSPromise { - jsObject[Strings.claim]!().fromJSValue()! + let this = jsObject + return this[Strings.claim].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func claim() async throws { - let _promise: JSPromise = jsObject[Strings.claim]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.claim].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/Clipboard.swift b/Sources/DOMKit/WebIDL/Clipboard.swift index f247347f..5d54d40c 100644 --- a/Sources/DOMKit/WebIDL/Clipboard.swift +++ b/Sources/DOMKit/WebIDL/Clipboard.swift @@ -11,42 +11,50 @@ public class Clipboard: EventTarget { } public func read() -> JSPromise { - jsObject[Strings.read]!().fromJSValue()! + 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, *) public func read() async throws -> ClipboardItems { - let _promise: JSPromise = jsObject[Strings.read]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func readText() -> JSPromise { - jsObject[Strings.readText]!().fromJSValue()! + let this = jsObject + return this[Strings.readText].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func readText() async throws -> String { - let _promise: JSPromise = jsObject[Strings.readText]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.readText].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func write(data: ClipboardItems) -> JSPromise { - jsObject[Strings.write]!(data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func write(data: ClipboardItems) async throws { - let _promise: JSPromise = jsObject[Strings.write]!(data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func writeText(data: String) -> JSPromise { - jsObject[Strings.writeText]!(data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.writeText].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func writeText(data: String) async throws { - let _promise: JSPromise = jsObject[Strings.writeText]!(data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.writeText].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/ClipboardItem.swift b/Sources/DOMKit/WebIDL/ClipboardItem.swift index 482893bd..9bc28634 100644 --- a/Sources/DOMKit/WebIDL/ClipboardItem.swift +++ b/Sources/DOMKit/WebIDL/ClipboardItem.swift @@ -25,12 +25,14 @@ public class ClipboardItem: JSBridgedClass { public var types: [String] public func getType(type: String) -> JSPromise { - jsObject[Strings.getType]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getType(type: String) async throws -> Blob { - let _promise: JSPromise = jsObject[Strings.getType]!(type.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CloseWatcher.swift b/Sources/DOMKit/WebIDL/CloseWatcher.swift index c91b0004..fac29741 100644 --- a/Sources/DOMKit/WebIDL/CloseWatcher.swift +++ b/Sources/DOMKit/WebIDL/CloseWatcher.swift @@ -17,11 +17,13 @@ public class CloseWatcher: EventTarget { } public func destroy() { - _ = jsObject[Strings.destroy]!() + let this = jsObject + _ = this[Strings.destroy].function!(this: this, arguments: []) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index cd6c8fea..b7a9a4c1 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -19,6 +19,7 @@ public class CompositionEvent: UIEvent { public var data: String public func initCompositionEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: WindowProxy? = nil, dataArg: String? = nil) { - _ = jsObject[Strings.initCompositionEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, dataArg?.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]) } } diff --git a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift index 1fc00bf4..7a4e96dc 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift @@ -16,31 +16,37 @@ public class ComputePressureObserver: JSBridgedClass { // XXX: constructor is ignored public func observe(source: ComputePressureSource) { - _ = jsObject[Strings.observe]!(source.jsValue()) + let this = jsObject + _ = this[Strings.observe].function!(this: this, arguments: [source.jsValue()]) } public func unobserve(source: ComputePressureSource) { - _ = jsObject[Strings.unobserve]!(source.jsValue()) + let this = jsObject + _ = this[Strings.unobserve].function!(this: this, arguments: [source.jsValue()]) } public func disconnect() { - _ = jsObject[Strings.disconnect]!() + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: []) } public func takeRecords() -> [ComputePressureRecord] { - jsObject[Strings.takeRecords]!().fromJSValue()! + let this = jsObject + return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute public var supportedSources: [ComputePressureSource] public static func requestPermission() -> JSPromise { - constructor[Strings.requestPermission]!().fromJSValue()! + let this = constructor + return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func requestPermission() async throws -> PermissionState { - let _promise: JSPromise = constructor[Strings.requestPermission]!().fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ContactAddress.swift b/Sources/DOMKit/WebIDL/ContactAddress.swift index e2c4db57..57e1a2ad 100644 --- a/Sources/DOMKit/WebIDL/ContactAddress.swift +++ b/Sources/DOMKit/WebIDL/ContactAddress.swift @@ -23,7 +23,8 @@ public class ContactAddress: JSBridgedClass { } public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ContactsManager.swift b/Sources/DOMKit/WebIDL/ContactsManager.swift index fd94bdfa..97cae3e8 100644 --- a/Sources/DOMKit/WebIDL/ContactsManager.swift +++ b/Sources/DOMKit/WebIDL/ContactsManager.swift @@ -13,22 +13,26 @@ public class ContactsManager: JSBridgedClass { } public func getProperties() -> JSPromise { - jsObject[Strings.getProperties]!().fromJSValue()! + let this = jsObject + return this[Strings.getProperties].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getProperties() async throws -> [ContactProperty] { - let _promise: JSPromise = jsObject[Strings.getProperties]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getProperties].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) -> JSPromise { - jsObject[Strings.select]!(properties.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.select].function!(this: this, arguments: [properties.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) async throws -> [ContactInfo] { - let _promise: JSPromise = jsObject[Strings.select]!(properties.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.select].function!(this: this, arguments: [properties.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ContentIndex.swift b/Sources/DOMKit/WebIDL/ContentIndex.swift index a733231c..8eacc376 100644 --- a/Sources/DOMKit/WebIDL/ContentIndex.swift +++ b/Sources/DOMKit/WebIDL/ContentIndex.swift @@ -13,32 +13,38 @@ public class ContentIndex: JSBridgedClass { } public func add(description: ContentDescription) -> JSPromise { - jsObject[Strings.add]!(description.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.add].function!(this: this, arguments: [description.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func add(description: ContentDescription) async throws { - let _promise: JSPromise = jsObject[Strings.add]!(description.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.add].function!(this: this, arguments: [description.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func delete(id: String) -> JSPromise { - jsObject[Strings.delete]!(id.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.delete].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func delete(id: String) async throws { - let _promise: JSPromise = jsObject[Strings.delete]!(id.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func getAll() -> JSPromise { - jsObject[Strings.getAll]!().fromJSValue()! + let this = jsObject + return this[Strings.getAll].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getAll() async throws -> [ContentDescription] { - let _promise: JSPromise = jsObject[Strings.getAll]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CookieStore.swift b/Sources/DOMKit/WebIDL/CookieStore.swift index 4aff6120..84d47621 100644 --- a/Sources/DOMKit/WebIDL/CookieStore.swift +++ b/Sources/DOMKit/WebIDL/CookieStore.swift @@ -12,82 +12,98 @@ public class CookieStore: EventTarget { } public func get(name: String) -> JSPromise { - jsObject[Strings.get]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func get(name: String) async throws -> CookieListItem? { - let _promise: JSPromise = jsObject[Strings.get]!(name.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func get(options: CookieStoreGetOptions? = nil) -> JSPromise { - jsObject[Strings.get]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func get(options: CookieStoreGetOptions? = nil) async throws -> CookieListItem? { - let _promise: JSPromise = jsObject[Strings.get]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getAll(name: String) -> JSPromise { - jsObject[Strings.getAll]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getAll(name: String) async throws -> CookieList { - let _promise: JSPromise = jsObject[Strings.getAll]!(name.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getAll(options: CookieStoreGetOptions? = nil) -> JSPromise { - jsObject[Strings.getAll]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getAll(options: CookieStoreGetOptions? = nil) async throws -> CookieList { - let _promise: JSPromise = jsObject[Strings.getAll]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func set(name: String, value: String) -> JSPromise { - jsObject[Strings.set]!(name.jsValue(), value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func set(name: String, value: String) async throws { - let _promise: JSPromise = jsObject[Strings.set]!(name.jsValue(), value.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func set(options: CookieInit) -> JSPromise { - jsObject[Strings.set]!(options.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.set].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func set(options: CookieInit) async throws { - let _promise: JSPromise = jsObject[Strings.set]!(options.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func delete(name: String) -> JSPromise { - jsObject[Strings.delete]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.delete].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func delete(name: String) async throws { - let _promise: JSPromise = jsObject[Strings.delete]!(name.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func delete(options: CookieStoreDeleteOptions) -> JSPromise { - jsObject[Strings.delete]!(options.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.delete].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func delete(options: CookieStoreDeleteOptions) async throws { - let _promise: JSPromise = jsObject[Strings.delete]!(options.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/CookieStoreManager.swift b/Sources/DOMKit/WebIDL/CookieStoreManager.swift index 8560cedd..94246e8a 100644 --- a/Sources/DOMKit/WebIDL/CookieStoreManager.swift +++ b/Sources/DOMKit/WebIDL/CookieStoreManager.swift @@ -13,32 +13,38 @@ public class CookieStoreManager: JSBridgedClass { } public func subscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { - jsObject[Strings.subscribe]!(subscriptions.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func subscribe(subscriptions: [CookieStoreGetOptions]) async throws { - let _promise: JSPromise = jsObject[Strings.subscribe]!(subscriptions.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func getSubscriptions() -> JSPromise { - jsObject[Strings.getSubscriptions]!().fromJSValue()! + let this = jsObject + return this[Strings.getSubscriptions].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getSubscriptions() async throws -> [CookieStoreGetOptions] { - let _promise: JSPromise = jsObject[Strings.getSubscriptions]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getSubscriptions].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func unsubscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { - jsObject[Strings.unsubscribe]!(subscriptions.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func unsubscribe(subscriptions: [CookieStoreGetOptions]) async throws { - let _promise: JSPromise = jsObject[Strings.unsubscribe]!(subscriptions.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/CrashReportBody.swift b/Sources/DOMKit/WebIDL/CrashReportBody.swift index 75118d13..69807fc4 100644 --- a/Sources/DOMKit/WebIDL/CrashReportBody.swift +++ b/Sources/DOMKit/WebIDL/CrashReportBody.swift @@ -12,7 +12,8 @@ public class CrashReportBody: ReportBody { } override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Credential.swift b/Sources/DOMKit/WebIDL/Credential.swift index bf751808..bc42c322 100644 --- a/Sources/DOMKit/WebIDL/Credential.swift +++ b/Sources/DOMKit/WebIDL/Credential.swift @@ -21,6 +21,7 @@ public class Credential: JSBridgedClass { public var type: String public static func isConditionalMediationAvailable() -> Bool { - constructor[Strings.isConditionalMediationAvailable]!().fromJSValue()! + let this = constructor + return this[Strings.isConditionalMediationAvailable].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CredentialsContainer.swift b/Sources/DOMKit/WebIDL/CredentialsContainer.swift index 8825c9da..d0259d16 100644 --- a/Sources/DOMKit/WebIDL/CredentialsContainer.swift +++ b/Sources/DOMKit/WebIDL/CredentialsContainer.swift @@ -13,42 +13,50 @@ public class CredentialsContainer: JSBridgedClass { } public func get(options: CredentialRequestOptions? = nil) -> JSPromise { - jsObject[Strings.get]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func get(options: CredentialRequestOptions? = nil) async throws -> Credential? { - let _promise: JSPromise = jsObject[Strings.get]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func store(credential: Credential) -> JSPromise { - jsObject[Strings.store]!(credential.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.store].function!(this: this, arguments: [credential.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func store(credential: Credential) async throws -> Credential { - let _promise: JSPromise = jsObject[Strings.store]!(credential.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.store].function!(this: this, arguments: [credential.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func create(options: CredentialCreationOptions? = nil) -> JSPromise { - jsObject[Strings.create]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.create].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func create(options: CredentialCreationOptions? = nil) async throws -> Credential? { - let _promise: JSPromise = jsObject[Strings.create]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.create].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func preventSilentAccess() -> JSPromise { - jsObject[Strings.preventSilentAccess]!().fromJSValue()! + let this = jsObject + return this[Strings.preventSilentAccess].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func preventSilentAccess() async throws { - let _promise: JSPromise = jsObject[Strings.preventSilentAccess]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.preventSilentAccess].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/Crypto.swift b/Sources/DOMKit/WebIDL/Crypto.swift index 1a2dfb06..a9a6eebc 100644 --- a/Sources/DOMKit/WebIDL/Crypto.swift +++ b/Sources/DOMKit/WebIDL/Crypto.swift @@ -17,10 +17,12 @@ public class Crypto: JSBridgedClass { public var subtle: SubtleCrypto public func getRandomValues(array: ArrayBufferView) -> ArrayBufferView { - jsObject[Strings.getRandomValues]!(array.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getRandomValues].function!(this: this, arguments: [array.jsValue()]).fromJSValue()! } public func randomUUID() -> String { - jsObject[Strings.randomUUID]!().fromJSValue()! + let this = jsObject + return this[Strings.randomUUID].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index 580bdb81..252b9d92 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -15,7 +15,8 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'define' is ignored public func get(name: String) -> __UNSUPPORTED_UNION__ { - jsObject[Strings.get]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } // XXX: member 'whenDefined' is ignored @@ -23,6 +24,7 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'whenDefined' is ignored public func upgrade(root: Node) { - _ = jsObject[Strings.upgrade]!(root.jsValue()) + let this = jsObject + _ = this[Strings.upgrade].function!(this: this, arguments: [root.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index f31072fa..2f458787 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -19,6 +19,7 @@ public class CustomEvent: Event { public var detail: JSValue public func initCustomEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, detail: JSValue? = nil) { - _ = jsObject[Strings.initCustomEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.initCustomEvent].function!(this: this, arguments: [type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/CustomStateSet.swift b/Sources/DOMKit/WebIDL/CustomStateSet.swift index 3f088adb..74ca1009 100644 --- a/Sources/DOMKit/WebIDL/CustomStateSet.swift +++ b/Sources/DOMKit/WebIDL/CustomStateSet.swift @@ -15,6 +15,7 @@ public class CustomStateSet: JSBridgedClass { // XXX: make me Set-like! public func add(value: String) { - _ = jsObject[Strings.add]!(value.jsValue()) + let this = jsObject + _ = this[Strings.add].function!(this: this, arguments: [value.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/DOMImplementation.swift b/Sources/DOMKit/WebIDL/DOMImplementation.swift index d04cefff..e3e7a43f 100644 --- a/Sources/DOMKit/WebIDL/DOMImplementation.swift +++ b/Sources/DOMKit/WebIDL/DOMImplementation.swift @@ -13,18 +13,22 @@ public class DOMImplementation: JSBridgedClass { } public func createDocumentType(qualifiedName: String, publicId: String, systemId: String) -> DocumentType { - jsObject[Strings.createDocumentType]!(qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createDocumentType].function!(this: this, arguments: [qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()]).fromJSValue()! } public func createDocument(namespace: String?, qualifiedName: String, doctype: DocumentType? = nil) -> XMLDocument { - jsObject[Strings.createDocument]!(namespace.jsValue(), qualifiedName.jsValue(), doctype?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createDocument].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), doctype?.jsValue() ?? .undefined]).fromJSValue()! } public func createHTMLDocument(title: String? = nil) -> Document { - jsObject[Strings.createHTMLDocument]!(title?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createHTMLDocument].function!(this: this, arguments: [title?.jsValue() ?? .undefined]).fromJSValue()! } public func hasFeature() -> Bool { - jsObject[Strings.hasFeature]!().fromJSValue()! + let this = jsObject + return this[Strings.hasFeature].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index 45b4e036..47c0f199 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -178,15 +178,18 @@ public class DOMMatrix: DOMMatrixReadOnly { } public func multiplySelf(other: DOMMatrixInit? = nil) -> Self { - jsObject[Strings.multiplySelf]!(other?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.multiplySelf].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } public func preMultiplySelf(other: DOMMatrixInit? = nil) -> Self { - jsObject[Strings.preMultiplySelf]!(other?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.preMultiplySelf].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } public func translateSelf(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> Self { - jsObject[Strings.translateSelf]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.translateSelf].function!(this: this, arguments: [tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined]).fromJSValue()! } public func scaleSelf(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { @@ -196,38 +199,47 @@ public class DOMMatrix: DOMMatrixReadOnly { let _arg3 = originX?.jsValue() ?? .undefined let _arg4 = originY?.jsValue() ?? .undefined let _arg5 = originZ?.jsValue() ?? .undefined - return jsObject[Strings.scaleSelf]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + let this = jsObject + return this[Strings.scaleSelf].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } public func scale3dSelf(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { - jsObject[Strings.scale3dSelf]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.scale3dSelf].function!(this: this, arguments: [scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined]).fromJSValue()! } public func rotateSelf(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> Self { - jsObject[Strings.rotateSelf]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.rotateSelf].function!(this: this, arguments: [rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined]).fromJSValue()! } public func rotateFromVectorSelf(x: Double? = nil, y: Double? = nil) -> Self { - jsObject[Strings.rotateFromVectorSelf]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.rotateFromVectorSelf].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined]).fromJSValue()! } public func rotateAxisAngleSelf(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> Self { - jsObject[Strings.rotateAxisAngleSelf]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.rotateAxisAngleSelf].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined]).fromJSValue()! } public func skewXSelf(sx: Double? = nil) -> Self { - jsObject[Strings.skewXSelf]!(sx?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.skewXSelf].function!(this: this, arguments: [sx?.jsValue() ?? .undefined]).fromJSValue()! } public func skewYSelf(sy: Double? = nil) -> Self { - jsObject[Strings.skewYSelf]!(sy?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.skewYSelf].function!(this: this, arguments: [sy?.jsValue() ?? .undefined]).fromJSValue()! } public func invertSelf() -> Self { - jsObject[Strings.invertSelf]!().fromJSValue()! + let this = jsObject + return this[Strings.invertSelf].function!(this: this, arguments: []).fromJSValue()! } public func setMatrixValue(transformList: String) -> Self { - jsObject[Strings.setMatrixValue]!(transformList.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setMatrixValue].function!(this: this, arguments: [transformList.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift index 52f94ecd..0e5aba1e 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -41,15 +41,18 @@ public class DOMMatrixReadOnly: JSBridgedClass { } public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self { - constructor[Strings.fromMatrix]!(other?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.fromMatrix].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } public static func fromFloat32Array(array32: Float32Array) -> Self { - constructor[Strings.fromFloat32Array]!(array32.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.fromFloat32Array].function!(this: this, arguments: [array32.jsValue()]).fromJSValue()! } public static func fromFloat64Array(array64: Float64Array) -> Self { - constructor[Strings.fromFloat64Array]!(array64.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.fromFloat64Array].function!(this: this, arguments: [array64.jsValue()]).fromJSValue()! } @ReadonlyAttribute @@ -125,7 +128,8 @@ public class DOMMatrixReadOnly: JSBridgedClass { public var isIdentity: Bool public func translate(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> DOMMatrix { - jsObject[Strings.translate]!(tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.translate].function!(this: this, arguments: [tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined]).fromJSValue()! } public func scale(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { @@ -135,63 +139,78 @@ public class DOMMatrixReadOnly: JSBridgedClass { let _arg3 = originX?.jsValue() ?? .undefined let _arg4 = originY?.jsValue() ?? .undefined let _arg5 = originZ?.jsValue() ?? .undefined - return jsObject[Strings.scale]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + let this = jsObject + return this[Strings.scale].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } public func scaleNonUniform(scaleX: Double? = nil, scaleY: Double? = nil) -> DOMMatrix { - jsObject[Strings.scaleNonUniform]!(scaleX?.jsValue() ?? .undefined, scaleY?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.scaleNonUniform].function!(this: this, arguments: [scaleX?.jsValue() ?? .undefined, scaleY?.jsValue() ?? .undefined]).fromJSValue()! } public func scale3d(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { - jsObject[Strings.scale3d]!(scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.scale3d].function!(this: this, arguments: [scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined]).fromJSValue()! } public func rotate(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> DOMMatrix { - jsObject[Strings.rotate]!(rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.rotate].function!(this: this, arguments: [rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined]).fromJSValue()! } public func rotateFromVector(x: Double? = nil, y: Double? = nil) -> DOMMatrix { - jsObject[Strings.rotateFromVector]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.rotateFromVector].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined]).fromJSValue()! } public func rotateAxisAngle(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> DOMMatrix { - jsObject[Strings.rotateAxisAngle]!(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.rotateAxisAngle].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined]).fromJSValue()! } public func skewX(sx: Double? = nil) -> DOMMatrix { - jsObject[Strings.skewX]!(sx?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.skewX].function!(this: this, arguments: [sx?.jsValue() ?? .undefined]).fromJSValue()! } public func skewY(sy: Double? = nil) -> DOMMatrix { - jsObject[Strings.skewY]!(sy?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.skewY].function!(this: this, arguments: [sy?.jsValue() ?? .undefined]).fromJSValue()! } public func multiply(other: DOMMatrixInit? = nil) -> DOMMatrix { - jsObject[Strings.multiply]!(other?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.multiply].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } public func flipX() -> DOMMatrix { - jsObject[Strings.flipX]!().fromJSValue()! + let this = jsObject + return this[Strings.flipX].function!(this: this, arguments: []).fromJSValue()! } public func flipY() -> DOMMatrix { - jsObject[Strings.flipY]!().fromJSValue()! + let this = jsObject + return this[Strings.flipY].function!(this: this, arguments: []).fromJSValue()! } public func inverse() -> DOMMatrix { - jsObject[Strings.inverse]!().fromJSValue()! + let this = jsObject + return this[Strings.inverse].function!(this: this, arguments: []).fromJSValue()! } public func transformPoint(point: DOMPointInit? = nil) -> DOMPoint { - jsObject[Strings.transformPoint]!(point?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.transformPoint].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! } public func toFloat32Array() -> Float32Array { - jsObject[Strings.toFloat32Array]!().fromJSValue()! + let this = jsObject + return this[Strings.toFloat32Array].function!(this: this, arguments: []).fromJSValue()! } public func toFloat64Array() -> Float64Array { - jsObject[Strings.toFloat64Array]!().fromJSValue()! + let this = jsObject + return this[Strings.toFloat64Array].function!(this: this, arguments: []).fromJSValue()! } public var description: String { @@ -199,6 +218,7 @@ public class DOMMatrixReadOnly: JSBridgedClass { } public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMParser.swift b/Sources/DOMKit/WebIDL/DOMParser.swift index 37be80d8..2a05b6ca 100644 --- a/Sources/DOMKit/WebIDL/DOMParser.swift +++ b/Sources/DOMKit/WebIDL/DOMParser.swift @@ -17,6 +17,7 @@ public class DOMParser: JSBridgedClass { } public func parseFromString(string: String, type: DOMParserSupportedType) -> Document { - jsObject[Strings.parseFromString]!(string.jsValue(), type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.parseFromString].function!(this: this, arguments: [string.jsValue(), type.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift index dc1ad91f..a3e932b7 100644 --- a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift @@ -21,7 +21,8 @@ public class DOMPointReadOnly: JSBridgedClass { } public static func fromPoint(other: DOMPointInit? = nil) -> Self { - constructor[Strings.fromPoint]!(other?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.fromPoint].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -37,10 +38,12 @@ public class DOMPointReadOnly: JSBridgedClass { public var w: Double public func matrixTransform(matrix: DOMMatrixInit? = nil) -> DOMPoint { - jsObject[Strings.matrixTransform]!(matrix?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.matrixTransform].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]).fromJSValue()! } public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMQuad.swift b/Sources/DOMKit/WebIDL/DOMQuad.swift index 73495706..b05c0aea 100644 --- a/Sources/DOMKit/WebIDL/DOMQuad.swift +++ b/Sources/DOMKit/WebIDL/DOMQuad.swift @@ -21,11 +21,13 @@ public class DOMQuad: JSBridgedClass { } public static func fromRect(other: DOMRectInit? = nil) -> Self { - constructor[Strings.fromRect]!(other?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.fromRect].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } public static func fromQuad(other: DOMQuadInit? = nil) -> Self { - constructor[Strings.fromQuad]!(other?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.fromQuad].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -41,10 +43,12 @@ public class DOMQuad: JSBridgedClass { public var p4: DOMPoint public func getBounds() -> DOMRect { - jsObject[Strings.getBounds]!().fromJSValue()! + let this = jsObject + return this[Strings.getBounds].function!(this: this, arguments: []).fromJSValue()! } public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift index 29389a75..58760e54 100644 --- a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift @@ -25,7 +25,8 @@ public class DOMRectReadOnly: JSBridgedClass { } public static func fromRect(other: DOMRectInit? = nil) -> Self { - constructor[Strings.fromRect]!(other?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.fromRect].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -53,6 +54,7 @@ public class DOMRectReadOnly: JSBridgedClass { public var left: Double public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMStringList.swift b/Sources/DOMKit/WebIDL/DOMStringList.swift index d85732f9..26a93531 100644 --- a/Sources/DOMKit/WebIDL/DOMStringList.swift +++ b/Sources/DOMKit/WebIDL/DOMStringList.swift @@ -21,6 +21,7 @@ public class DOMStringList: JSBridgedClass { } public func contains(string: String) -> Bool { - jsObject[Strings.contains]!(string.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.contains].function!(this: this, arguments: [string.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMTokenList.swift b/Sources/DOMKit/WebIDL/DOMTokenList.swift index 7f620aaa..fa2081ee 100644 --- a/Sources/DOMKit/WebIDL/DOMTokenList.swift +++ b/Sources/DOMKit/WebIDL/DOMTokenList.swift @@ -22,27 +22,33 @@ public class DOMTokenList: JSBridgedClass, Sequence { } public func contains(token: String) -> Bool { - jsObject[Strings.contains]!(token.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.contains].function!(this: this, arguments: [token.jsValue()]).fromJSValue()! } public func add(tokens: String...) { - _ = jsObject[Strings.add]!(tokens.jsValue()) + let this = jsObject + _ = this[Strings.add].function!(this: this, arguments: tokens.map { $0.jsValue() }) } public func remove(tokens: String...) { - _ = jsObject[Strings.remove]!(tokens.jsValue()) + let this = jsObject + _ = this[Strings.remove].function!(this: this, arguments: tokens.map { $0.jsValue() }) } public func toggle(token: String, force: Bool? = nil) -> Bool { - jsObject[Strings.toggle]!(token.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.toggle].function!(this: this, arguments: [token.jsValue(), force?.jsValue() ?? .undefined]).fromJSValue()! } public func replace(token: String, newToken: String) -> Bool { - jsObject[Strings.replace]!(token.jsValue(), newToken.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.replace].function!(this: this, arguments: [token.jsValue(), newToken.jsValue()]).fromJSValue()! } public func supports(token: String) -> Bool { - jsObject[Strings.supports]!(token.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.supports].function!(this: this, arguments: [token.jsValue()]).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift index 44b540a8..4820053f 100644 --- a/Sources/DOMKit/WebIDL/DataTransfer.swift +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -31,22 +31,26 @@ public class DataTransfer: JSBridgedClass { public var items: DataTransferItemList public func setDragImage(image: Element, x: Int32, y: Int32) { - _ = jsObject[Strings.setDragImage]!(image.jsValue(), x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.setDragImage].function!(this: this, arguments: [image.jsValue(), x.jsValue(), y.jsValue()]) } @ReadonlyAttribute public var types: [String] public func getData(format: String) -> String { - jsObject[Strings.getData]!(format.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getData].function!(this: this, arguments: [format.jsValue()]).fromJSValue()! } public func setData(format: String, data: String) { - _ = jsObject[Strings.setData]!(format.jsValue(), data.jsValue()) + let this = jsObject + _ = this[Strings.setData].function!(this: this, arguments: [format.jsValue(), data.jsValue()]) } public func clearData(format: String? = nil) { - _ = jsObject[Strings.clearData]!(format?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clearData].function!(this: this, arguments: [format?.jsValue() ?? .undefined]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index 506a87a2..2d6b70ef 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -15,16 +15,19 @@ public class DataTransferItem: JSBridgedClass { } public func webkitGetAsEntry() -> FileSystemEntry? { - jsObject[Strings.webkitGetAsEntry]!().fromJSValue()! + let this = jsObject + return this[Strings.webkitGetAsEntry].function!(this: this, arguments: []).fromJSValue()! } public func getAsFileSystemHandle() -> JSPromise { - jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! + let this = jsObject + return this[Strings.getAsFileSystemHandle].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getAsFileSystemHandle() async throws -> FileSystemHandle? { - let _promise: JSPromise = jsObject[Strings.getAsFileSystemHandle]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getAsFileSystemHandle].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -37,6 +40,7 @@ public class DataTransferItem: JSBridgedClass { // XXX: member 'getAsString' is ignored public func getAsFile() -> File? { - jsObject[Strings.getAsFile]!().fromJSValue()! + let this = jsObject + return this[Strings.getAsFile].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DataTransferItemList.swift b/Sources/DOMKit/WebIDL/DataTransferItemList.swift index b58b18e8..9129f55e 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItemList.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItemList.swift @@ -21,18 +21,22 @@ public class DataTransferItemList: JSBridgedClass { } public func add(data: String, type: String) -> DataTransferItem? { - jsObject[Strings.add]!(data.jsValue(), type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.add].function!(this: this, arguments: [data.jsValue(), type.jsValue()]).fromJSValue()! } public func add(data: File) -> DataTransferItem? { - jsObject[Strings.add]!(data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.add].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } public func remove(index: UInt32) { - _ = jsObject[Strings.remove]!(index.jsValue()) + let this = jsObject + _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue()]) } public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index 70db06ab..6698e647 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -18,15 +18,18 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid public var name: String public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/DeprecationReportBody.swift b/Sources/DOMKit/WebIDL/DeprecationReportBody.swift index 03601c95..906e90b8 100644 --- a/Sources/DOMKit/WebIDL/DeprecationReportBody.swift +++ b/Sources/DOMKit/WebIDL/DeprecationReportBody.swift @@ -17,7 +17,8 @@ public class DeprecationReportBody: ReportBody { } override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift index 21078163..59932255 100644 --- a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift +++ b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift @@ -31,12 +31,14 @@ public class DeviceMotionEvent: Event { public var interval: Double public static func requestPermission() -> JSPromise { - constructor[Strings.requestPermission]!().fromJSValue()! + let this = constructor + return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func requestPermission() async throws -> PermissionState { - let _promise: JSPromise = constructor[Strings.requestPermission]!().fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift index 6399a430..0d4995f8 100644 --- a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift +++ b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift @@ -31,12 +31,14 @@ public class DeviceOrientationEvent: Event { public var absolute: Bool public static func requestPermission() -> JSPromise { - constructor[Strings.requestPermission]!().fromJSValue()! + let this = constructor + return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func requestPermission() async throws -> PermissionState { - let _promise: JSPromise = constructor[Strings.requestPermission]!().fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DigitalGoodsService.swift b/Sources/DOMKit/WebIDL/DigitalGoodsService.swift index 9b72dd71..30435f79 100644 --- a/Sources/DOMKit/WebIDL/DigitalGoodsService.swift +++ b/Sources/DOMKit/WebIDL/DigitalGoodsService.swift @@ -13,42 +13,50 @@ public class DigitalGoodsService: JSBridgedClass { } public func getDetails(itemIds: [String]) -> JSPromise { - jsObject[Strings.getDetails]!(itemIds.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDetails(itemIds: [String]) async throws -> [ItemDetails] { - let _promise: JSPromise = jsObject[Strings.getDetails]!(itemIds.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func listPurchases() -> JSPromise { - jsObject[Strings.listPurchases]!().fromJSValue()! + let this = jsObject + return this[Strings.listPurchases].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func listPurchases() async throws -> [PurchaseDetails] { - let _promise: JSPromise = jsObject[Strings.listPurchases]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.listPurchases].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func listPurchaseHistory() -> JSPromise { - jsObject[Strings.listPurchaseHistory]!().fromJSValue()! + let this = jsObject + return this[Strings.listPurchaseHistory].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func listPurchaseHistory() async throws -> [PurchaseDetails] { - let _promise: JSPromise = jsObject[Strings.listPurchaseHistory]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.listPurchaseHistory].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func consume(purchaseToken: String) -> JSPromise { - jsObject[Strings.consume]!(purchaseToken.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func consume(purchaseToken: String) async throws { - let _promise: JSPromise = jsObject[Strings.consume]!(purchaseToken.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue()]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 264823e7..8db95baa 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -74,15 +74,18 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode public var namedFlows: NamedFlowMap public func elementFromPoint(x: Double, y: Double) -> Element? { - jsObject[Strings.elementFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.elementFromPoint].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } public func elementsFromPoint(x: Double, y: Double) -> [Element] { - jsObject[Strings.elementsFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.elementsFromPoint].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } public func caretPositionFromPoint(x: Double, y: Double) -> CaretPosition? { - jsObject[Strings.caretPositionFromPoint]!(x.jsValue(), y.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.caretPositionFromPoint].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } @ReadonlyAttribute @@ -123,67 +126,83 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode public var documentElement: Element? public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { - jsObject[Strings.getElementsByTagName]!(qualifiedName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getElementsByTagName].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { - jsObject[Strings.getElementsByTagNameNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getElementsByTagNameNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } public func getElementsByClassName(classNames: String) -> HTMLCollection { - jsObject[Strings.getElementsByClassName]!(classNames.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getElementsByClassName].function!(this: this, arguments: [classNames.jsValue()]).fromJSValue()! } public func createElement(localName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { - jsObject[Strings.createElement]!(localName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createElement].function!(this: this, arguments: [localName.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func createElementNS(namespace: String?, qualifiedName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { - jsObject[Strings.createElementNS]!(namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createElementNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func createDocumentFragment() -> DocumentFragment { - jsObject[Strings.createDocumentFragment]!().fromJSValue()! + let this = jsObject + return this[Strings.createDocumentFragment].function!(this: this, arguments: []).fromJSValue()! } public func createTextNode(data: String) -> Text { - jsObject[Strings.createTextNode]!(data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createTextNode].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } public func createCDATASection(data: String) -> CDATASection { - jsObject[Strings.createCDATASection]!(data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createCDATASection].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } public func createComment(data: String) -> Comment { - jsObject[Strings.createComment]!(data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createComment].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } public func createProcessingInstruction(target: String, data: String) -> ProcessingInstruction { - jsObject[Strings.createProcessingInstruction]!(target.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createProcessingInstruction].function!(this: this, arguments: [target.jsValue(), data.jsValue()]).fromJSValue()! } public func importNode(node: Node, deep: Bool? = nil) -> Node { - jsObject[Strings.importNode]!(node.jsValue(), deep?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.importNode].function!(this: this, arguments: [node.jsValue(), deep?.jsValue() ?? .undefined]).fromJSValue()! } public func adoptNode(node: Node) -> Node { - jsObject[Strings.adoptNode]!(node.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.adoptNode].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! } public func createAttribute(localName: String) -> Attr { - jsObject[Strings.createAttribute]!(localName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createAttribute].function!(this: this, arguments: [localName.jsValue()]).fromJSValue()! } public func createAttributeNS(namespace: String?, qualifiedName: String) -> Attr { - jsObject[Strings.createAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createAttributeNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue()]).fromJSValue()! } public func createEvent(interface: String) -> Event { - jsObject[Strings.createEvent]!(interface.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createEvent].function!(this: this, arguments: [interface.jsValue()]).fromJSValue()! } public func createRange() -> Range { - jsObject[Strings.createRange]!().fromJSValue()! + let this = jsObject + return this[Strings.createRange].function!(this: this, arguments: []).fromJSValue()! } // XXX: member 'createNodeIterator' is ignored @@ -191,11 +210,13 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode // XXX: member 'createTreeWalker' is ignored public func measureElement(element: Element) -> FontMetrics { - jsObject[Strings.measureElement]!(element.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.measureElement].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! } public func measureText(text: String, styleMap: StylePropertyMapReadOnly) -> FontMetrics { - jsObject[Strings.measureText]!(text.jsValue(), styleMap.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.measureText].function!(this: this, arguments: [text.jsValue(), styleMap.jsValue()]).fromJSValue()! } @ReadonlyAttribute @@ -205,12 +226,14 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode public var fullscreen: Bool public func exitFullscreen() -> JSPromise { - jsObject[Strings.exitFullscreen]!().fromJSValue()! + let this = jsObject + return this[Strings.exitFullscreen].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func exitFullscreen() async throws { - let _promise: JSPromise = jsObject[Strings.exitFullscreen]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.exitFullscreen].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } @@ -273,64 +296,77 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode public var scripts: HTMLCollection public func getElementsByName(elementName: String) -> NodeList { - jsObject[Strings.getElementsByName]!(elementName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getElementsByName].function!(this: this, arguments: [elementName.jsValue()]).fromJSValue()! } @ReadonlyAttribute public var currentScript: HTMLOrSVGScriptElement? public func open(unused1: String? = nil, unused2: String? = nil) -> Self { - jsObject[Strings.open]!(unused1?.jsValue() ?? .undefined, unused2?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.open].function!(this: this, arguments: [unused1?.jsValue() ?? .undefined, unused2?.jsValue() ?? .undefined]).fromJSValue()! } public func open(url: String, name: String, features: String) -> WindowProxy? { - jsObject[Strings.open]!(url.jsValue(), name.jsValue(), features.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.open].function!(this: this, arguments: [url.jsValue(), name.jsValue(), features.jsValue()]).fromJSValue()! } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public func write(text: String...) { - _ = jsObject[Strings.write]!(text.jsValue()) + let this = jsObject + _ = this[Strings.write].function!(this: this, arguments: text.map { $0.jsValue() }) } public func writeln(text: String...) { - _ = jsObject[Strings.writeln]!(text.jsValue()) + let this = jsObject + _ = this[Strings.writeln].function!(this: this, arguments: text.map { $0.jsValue() }) } @ReadonlyAttribute public var defaultView: WindowProxy? public func hasFocus() -> Bool { - jsObject[Strings.hasFocus]!().fromJSValue()! + let this = jsObject + return this[Strings.hasFocus].function!(this: this, arguments: []).fromJSValue()! } @ReadWriteAttribute public var designMode: String public func execCommand(commandId: String, showUI: Bool? = nil, value: String? = nil) -> Bool { - jsObject[Strings.execCommand]!(commandId.jsValue(), showUI?.jsValue() ?? .undefined, value?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.execCommand].function!(this: this, arguments: [commandId.jsValue(), showUI?.jsValue() ?? .undefined, value?.jsValue() ?? .undefined]).fromJSValue()! } public func queryCommandEnabled(commandId: String) -> Bool { - jsObject[Strings.queryCommandEnabled]!(commandId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.queryCommandEnabled].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } public func queryCommandIndeterm(commandId: String) -> Bool { - jsObject[Strings.queryCommandIndeterm]!(commandId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.queryCommandIndeterm].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } public func queryCommandState(commandId: String) -> Bool { - jsObject[Strings.queryCommandState]!(commandId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.queryCommandState].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } public func queryCommandSupported(commandId: String) -> Bool { - jsObject[Strings.queryCommandSupported]!(commandId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.queryCommandSupported].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } public func queryCommandValue(commandId: String) -> String { - jsObject[Strings.queryCommandValue]!(commandId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.queryCommandValue].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } @ReadonlyAttribute @@ -367,15 +403,18 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode public var applets: HTMLCollection public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } public func captureEvents() { - _ = jsObject[Strings.captureEvents]!() + let this = jsObject + _ = this[Strings.captureEvents].function!(this: this, arguments: []) } public func releaseEvents() { - _ = jsObject[Strings.releaseEvents]!() + let this = jsObject + _ = this[Strings.releaseEvents].function!(this: this, arguments: []) } @ReadonlyAttribute @@ -397,12 +436,14 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode public var pictureInPictureEnabled: Bool public func exitPictureInPicture() -> JSPromise { - jsObject[Strings.exitPictureInPicture]!().fromJSValue()! + let this = jsObject + return this[Strings.exitPictureInPicture].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func exitPictureInPicture() async throws { - let _promise: JSPromise = jsObject[Strings.exitPictureInPicture]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.exitPictureInPicture].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } @@ -413,33 +454,39 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode public var onpointerlockerror: EventHandler public func exitPointerLock() { - _ = jsObject[Strings.exitPointerLock]!() + let this = jsObject + _ = this[Strings.exitPointerLock].function!(this: this, arguments: []) } @ReadonlyAttribute public var fragmentDirective: FragmentDirective public func getSelection() -> Selection? { - jsObject[Strings.getSelection]!().fromJSValue()! + let this = jsObject + return this[Strings.getSelection].function!(this: this, arguments: []).fromJSValue()! } public func hasStorageAccess() -> JSPromise { - jsObject[Strings.hasStorageAccess]!().fromJSValue()! + let this = jsObject + return this[Strings.hasStorageAccess].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func hasStorageAccess() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.hasStorageAccess]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.hasStorageAccess].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func requestStorageAccess() -> JSPromise { - jsObject[Strings.requestStorageAccess]!().fromJSValue()! + let this = jsObject + return this[Strings.requestStorageAccess].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestStorageAccess() async throws { - let _promise: JSPromise = jsObject[Strings.requestStorageAccess]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestStorageAccess].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index 1b94a74b..fa75f535 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -21,6 +21,7 @@ public extension DocumentOrShadowRoot { var pointerLockElement: Element? { ReadonlyAttribute[Strings.pointerLockElement, in: jsObject] } func getAnimations() -> [Animation] { - jsObject[Strings.getAnimations]!().fromJSValue()! + let this = jsObject + return this[Strings.getAnimations].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift index 5d2f5b2d..d358b72a 100644 --- a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift +++ b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift @@ -27,34 +27,42 @@ public class EXT_disjoint_timer_query: JSBridgedClass { public static let GPU_DISJOINT_EXT: GLenum = 0x8FBB public func createQueryEXT() -> WebGLTimerQueryEXT? { - jsObject[Strings.createQueryEXT]!().fromJSValue()! + let this = jsObject + return this[Strings.createQueryEXT].function!(this: this, arguments: []).fromJSValue()! } public func deleteQueryEXT(query: WebGLTimerQueryEXT?) { - _ = jsObject[Strings.deleteQueryEXT]!(query.jsValue()) + let this = jsObject + _ = this[Strings.deleteQueryEXT].function!(this: this, arguments: [query.jsValue()]) } public func isQueryEXT(query: WebGLTimerQueryEXT?) -> Bool { - jsObject[Strings.isQueryEXT]!(query.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isQueryEXT].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } public func beginQueryEXT(target: GLenum, query: WebGLTimerQueryEXT) { - _ = jsObject[Strings.beginQueryEXT]!(target.jsValue(), query.jsValue()) + let this = jsObject + _ = this[Strings.beginQueryEXT].function!(this: this, arguments: [target.jsValue(), query.jsValue()]) } public func endQueryEXT(target: GLenum) { - _ = jsObject[Strings.endQueryEXT]!(target.jsValue()) + let this = jsObject + _ = this[Strings.endQueryEXT].function!(this: this, arguments: [target.jsValue()]) } public func queryCounterEXT(query: WebGLTimerQueryEXT, target: GLenum) { - _ = jsObject[Strings.queryCounterEXT]!(query.jsValue(), target.jsValue()) + let this = jsObject + _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue(), target.jsValue()]) } public func getQueryEXT(target: GLenum, pname: GLenum) -> JSValue { - jsObject[Strings.getQueryEXT]!(target.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getQueryEXT].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } public func getQueryObjectEXT(query: WebGLTimerQueryEXT, pname: GLenum) -> JSValue { - jsObject[Strings.getQueryObjectEXT]!(query.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getQueryObjectEXT].function!(this: this, arguments: [query.jsValue(), pname.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift index a0bc0ead..792da064 100644 --- a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift +++ b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift @@ -21,6 +21,7 @@ public class EXT_disjoint_timer_query_webgl2: JSBridgedClass { public static let GPU_DISJOINT_EXT: GLenum = 0x8FBB public func queryCounterEXT(query: WebGLQuery, target: GLenum) { - _ = jsObject[Strings.queryCounterEXT]!(query.jsValue(), target.jsValue()) + let this = jsObject + _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue(), target.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/EditContext.swift b/Sources/DOMKit/WebIDL/EditContext.swift index 3d51a7d2..5951a9c4 100644 --- a/Sources/DOMKit/WebIDL/EditContext.swift +++ b/Sources/DOMKit/WebIDL/EditContext.swift @@ -29,27 +29,33 @@ public class EditContext: EventTarget { } public func updateText(rangeStart: UInt32, rangeEnd: UInt32, text: String) { - _ = jsObject[Strings.updateText]!(rangeStart.jsValue(), rangeEnd.jsValue(), text.jsValue()) + let this = jsObject + _ = this[Strings.updateText].function!(this: this, arguments: [rangeStart.jsValue(), rangeEnd.jsValue(), text.jsValue()]) } public func updateSelection(start: UInt32, end: UInt32) { - _ = jsObject[Strings.updateSelection]!(start.jsValue(), end.jsValue()) + let this = jsObject + _ = this[Strings.updateSelection].function!(this: this, arguments: [start.jsValue(), end.jsValue()]) } public func updateControlBound(controlBound: DOMRect) { - _ = jsObject[Strings.updateControlBound]!(controlBound.jsValue()) + let this = jsObject + _ = this[Strings.updateControlBound].function!(this: this, arguments: [controlBound.jsValue()]) } public func updateSelectionBound(selectionBound: DOMRect) { - _ = jsObject[Strings.updateSelectionBound]!(selectionBound.jsValue()) + let this = jsObject + _ = this[Strings.updateSelectionBound].function!(this: this, arguments: [selectionBound.jsValue()]) } public func updateCharacterBounds(rangeStart: UInt32, characterBounds: [DOMRect]) { - _ = jsObject[Strings.updateCharacterBounds]!(rangeStart.jsValue(), characterBounds.jsValue()) + let this = jsObject + _ = this[Strings.updateCharacterBounds].function!(this: this, arguments: [rangeStart.jsValue(), characterBounds.jsValue()]) } public func attachedElements() -> [Element] { - jsObject[Strings.attachedElements]!().fromJSValue()! + let this = jsObject + return this[Strings.attachedElements].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute @@ -80,7 +86,8 @@ public class EditContext: EventTarget { public var characterBoundsRangeStart: UInt32 public func characterBounds() -> [DOMRect] { - jsObject[Strings.characterBounds]!().fromJSValue()! + let this = jsObject + return this[Strings.characterBounds].function!(this: this, arguments: []).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index fbd518e7..dac83237 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -38,70 +38,86 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc public var outerHTML: String public func insertAdjacentHTML(position: String, text: String) { - _ = jsObject[Strings.insertAdjacentHTML]!(position.jsValue(), text.jsValue()) + let this = jsObject + _ = this[Strings.insertAdjacentHTML].function!(this: this, arguments: [position.jsValue(), text.jsValue()]) } public func getSpatialNavigationContainer() -> Node { - jsObject[Strings.getSpatialNavigationContainer]!().fromJSValue()! + let this = jsObject + return this[Strings.getSpatialNavigationContainer].function!(this: this, arguments: []).fromJSValue()! } public func focusableAreas(option: FocusableAreasOption? = nil) -> [Node] { - jsObject[Strings.focusableAreas]!(option?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.focusableAreas].function!(this: this, arguments: [option?.jsValue() ?? .undefined]).fromJSValue()! } public func spatialNavigationSearch(dir: SpatialNavigationDirection, options: SpatialNavigationSearchOptions? = nil) -> Node? { - jsObject[Strings.spatialNavigationSearch]!(dir.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.spatialNavigationSearch].function!(this: this, arguments: [dir.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func pseudo(type: String) -> CSSPseudoElement? { - jsObject[Strings.pseudo]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } @ReadonlyAttribute public var part: DOMTokenList public func computedStyleMap() -> StylePropertyMapReadOnly { - jsObject[Strings.computedStyleMap]!().fromJSValue()! + let this = jsObject + return this[Strings.computedStyleMap].function!(this: this, arguments: []).fromJSValue()! } public func getClientRects() -> DOMRectList { - jsObject[Strings.getClientRects]!().fromJSValue()! + let this = jsObject + return this[Strings.getClientRects].function!(this: this, arguments: []).fromJSValue()! } public func getBoundingClientRect() -> DOMRect { - jsObject[Strings.getBoundingClientRect]!().fromJSValue()! + let this = jsObject + return this[Strings.getBoundingClientRect].function!(this: this, arguments: []).fromJSValue()! } public func isVisible(options: IsVisibleOptions? = nil) -> Bool { - jsObject[Strings.isVisible]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.isVisible].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func scrollIntoView(arg: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Strings.scrollIntoView]!(arg?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.scrollIntoView].function!(this: this, arguments: [arg?.jsValue() ?? .undefined]) } public func scroll(options: ScrollToOptions? = nil) { - _ = jsObject[Strings.scroll]!(options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } public func scroll(x: Double, y: Double) { - _ = jsObject[Strings.scroll]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } public func scrollTo(options: ScrollToOptions? = nil) { - _ = jsObject[Strings.scrollTo]!(options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } public func scrollTo(x: Double, y: Double) { - _ = jsObject[Strings.scrollTo]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } public func scrollBy(options: ScrollToOptions? = nil) { - _ = jsObject[Strings.scrollBy]!(options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } public func scrollBy(x: Double, y: Double) { - _ = jsObject[Strings.scrollBy]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } @ReadWriteAttribute @@ -153,109 +169,134 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc public var slot: String public func hasAttributes() -> Bool { - jsObject[Strings.hasAttributes]!().fromJSValue()! + let this = jsObject + return this[Strings.hasAttributes].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute public var attributes: NamedNodeMap public func getAttributeNames() -> [String] { - jsObject[Strings.getAttributeNames]!().fromJSValue()! + let this = jsObject + return this[Strings.getAttributeNames].function!(this: this, arguments: []).fromJSValue()! } public func getAttribute(qualifiedName: String) -> String? { - jsObject[Strings.getAttribute]!(qualifiedName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAttribute].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } public func getAttributeNS(namespace: String?, localName: String) -> String? { - jsObject[Strings.getAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAttributeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } public func setAttribute(qualifiedName: String, value: String) { - _ = jsObject[Strings.setAttribute]!(qualifiedName.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.setAttribute].function!(this: this, arguments: [qualifiedName.jsValue(), value.jsValue()]) } public func setAttributeNS(namespace: String?, qualifiedName: String, value: String) { - _ = jsObject[Strings.setAttributeNS]!(namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.setAttributeNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()]) } public func removeAttribute(qualifiedName: String) { - _ = jsObject[Strings.removeAttribute]!(qualifiedName.jsValue()) + let this = jsObject + _ = this[Strings.removeAttribute].function!(this: this, arguments: [qualifiedName.jsValue()]) } public func removeAttributeNS(namespace: String?, localName: String) { - _ = jsObject[Strings.removeAttributeNS]!(namespace.jsValue(), localName.jsValue()) + let this = jsObject + _ = this[Strings.removeAttributeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]) } public func toggleAttribute(qualifiedName: String, force: Bool? = nil) -> Bool { - jsObject[Strings.toggleAttribute]!(qualifiedName.jsValue(), force?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.toggleAttribute].function!(this: this, arguments: [qualifiedName.jsValue(), force?.jsValue() ?? .undefined]).fromJSValue()! } public func hasAttribute(qualifiedName: String) -> Bool { - jsObject[Strings.hasAttribute]!(qualifiedName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.hasAttribute].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } public func hasAttributeNS(namespace: String?, localName: String) -> Bool { - jsObject[Strings.hasAttributeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.hasAttributeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } public func getAttributeNode(qualifiedName: String) -> Attr? { - jsObject[Strings.getAttributeNode]!(qualifiedName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAttributeNode].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } public func getAttributeNodeNS(namespace: String?, localName: String) -> Attr? { - jsObject[Strings.getAttributeNodeNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAttributeNodeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } public func setAttributeNode(attr: Attr) -> Attr? { - jsObject[Strings.setAttributeNode]!(attr.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setAttributeNode].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } public func setAttributeNodeNS(attr: Attr) -> Attr? { - jsObject[Strings.setAttributeNodeNS]!(attr.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setAttributeNodeNS].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } public func removeAttributeNode(attr: Attr) -> Attr { - jsObject[Strings.removeAttributeNode]!(attr.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeAttributeNode].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } public func attachShadow(init: ShadowRootInit) -> ShadowRoot { - jsObject[Strings.attachShadow]!(`init`.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.attachShadow].function!(this: this, arguments: [`init`.jsValue()]).fromJSValue()! } @ReadonlyAttribute public var shadowRoot: ShadowRoot? public func closest(selectors: String) -> Element? { - jsObject[Strings.closest]!(selectors.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.closest].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } public func matches(selectors: String) -> Bool { - jsObject[Strings.matches]!(selectors.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.matches].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } public func webkitMatchesSelector(selectors: String) -> Bool { - jsObject[Strings.webkitMatchesSelector]!(selectors.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.webkitMatchesSelector].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { - jsObject[Strings.getElementsByTagName]!(qualifiedName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getElementsByTagName].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { - jsObject[Strings.getElementsByTagNameNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getElementsByTagNameNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } public func getElementsByClassName(classNames: String) -> HTMLCollection { - jsObject[Strings.getElementsByClassName]!(classNames.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getElementsByClassName].function!(this: this, arguments: [classNames.jsValue()]).fromJSValue()! } public func insertAdjacentElement(where: String, element: Element) -> Element? { - jsObject[Strings.insertAdjacentElement]!(`where`.jsValue(), element.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.insertAdjacentElement].function!(this: this, arguments: [`where`.jsValue(), element.jsValue()]).fromJSValue()! } public func insertAdjacentText(where: String, data: String) { - _ = jsObject[Strings.insertAdjacentText]!(`where`.jsValue(), data.jsValue()) + let this = jsObject + _ = this[Strings.insertAdjacentText].function!(this: this, arguments: [`where`.jsValue(), data.jsValue()]) } @ReadWriteAttribute @@ -265,12 +306,14 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc public var elementTiming: String public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { - jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestFullscreen(options: FullscreenOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.requestFullscreen]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } @@ -281,22 +324,27 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc public var onfullscreenerror: EventHandler public func setPointerCapture(pointerId: Int32) { - _ = jsObject[Strings.setPointerCapture]!(pointerId.jsValue()) + let this = jsObject + _ = this[Strings.setPointerCapture].function!(this: this, arguments: [pointerId.jsValue()]) } public func releasePointerCapture(pointerId: Int32) { - _ = jsObject[Strings.releasePointerCapture]!(pointerId.jsValue()) + let this = jsObject + _ = this[Strings.releasePointerCapture].function!(this: this, arguments: [pointerId.jsValue()]) } public func hasPointerCapture(pointerId: Int32) -> Bool { - jsObject[Strings.hasPointerCapture]!(pointerId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.hasPointerCapture].function!(this: this, arguments: [pointerId.jsValue()]).fromJSValue()! } public func requestPointerLock() { - _ = jsObject[Strings.requestPointerLock]!() + let this = jsObject + _ = this[Strings.requestPointerLock].function!(this: this, arguments: []) } public func setHTML(input: String, options: SetHTMLOptions? = nil) { - _ = jsObject[Strings.setHTML]!(input.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setHTML].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index 4769317f..f3827c2a 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -26,14 +26,16 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public var shadowRoot: ShadowRoot? public func setFormValue(value: __UNSUPPORTED_UNION__?, state: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Strings.setFormValue]!(value.jsValue(), state?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setFormValue].function!(this: this, arguments: [value.jsValue(), state?.jsValue() ?? .undefined]) } @ReadonlyAttribute public var form: HTMLFormElement? public func setValidity(flags: ValidityStateFlags? = nil, message: String? = nil, anchor: HTMLElement? = nil) { - _ = jsObject[Strings.setValidity]!(flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setValidity].function!(this: this, arguments: [flags?.jsValue() ?? .undefined, message?.jsValue() ?? .undefined, anchor?.jsValue() ?? .undefined]) } @ReadonlyAttribute @@ -46,11 +48,13 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Strings.checkValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Strings.reportValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift index 1c5c5281..7854d1c1 100644 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift @@ -33,6 +33,7 @@ public class EncodedAudioChunk: JSBridgedClass { public var byteLength: UInt32 public func copyTo(destination: BufferSource) { - _ = jsObject[Strings.copyTo]!(destination.jsValue()) + let this = jsObject + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift index 85d410bf..8c709d64 100644 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift @@ -33,6 +33,7 @@ public class EncodedVideoChunk: JSBridgedClass { public var byteLength: UInt32 public func copyTo(destination: BufferSource) { - _ = jsObject[Strings.copyTo]!(destination.jsValue()) + let this = jsObject + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index 0c984ab2..78a5c25f 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -42,7 +42,8 @@ public class Event: JSBridgedClass { public var currentTarget: EventTarget? public func composedPath() -> [EventTarget] { - jsObject[Strings.composedPath]!().fromJSValue()! + let this = jsObject + return this[Strings.composedPath].function!(this: this, arguments: []).fromJSValue()! } public static let NONE: UInt16 = 0 @@ -57,14 +58,16 @@ public class Event: JSBridgedClass { public var eventPhase: UInt16 public func stopPropagation() { - _ = jsObject[Strings.stopPropagation]!() + let this = jsObject + _ = this[Strings.stopPropagation].function!(this: this, arguments: []) } @ReadWriteAttribute public var cancelBubble: Bool public func stopImmediatePropagation() { - _ = jsObject[Strings.stopImmediatePropagation]!() + let this = jsObject + _ = this[Strings.stopImmediatePropagation].function!(this: this, arguments: []) } @ReadonlyAttribute @@ -77,7 +80,8 @@ public class Event: JSBridgedClass { public var returnValue: Bool public func preventDefault() { - _ = jsObject[Strings.preventDefault]!() + let this = jsObject + _ = this[Strings.preventDefault].function!(this: this, arguments: []) } @ReadonlyAttribute @@ -93,6 +97,7 @@ public class Event: JSBridgedClass { public var timeStamp: DOMHighResTimeStamp public func initEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil) { - _ = jsObject[Strings.initEvent]!(type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.initEvent].function!(this: this, arguments: [type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index 4248bb07..60ef37f4 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -45,6 +45,7 @@ public class EventSource: EventTarget { public var onerror: EventHandler public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/EventTarget.swift b/Sources/DOMKit/WebIDL/EventTarget.swift index 55943d32..4ad180af 100644 --- a/Sources/DOMKit/WebIDL/EventTarget.swift +++ b/Sources/DOMKit/WebIDL/EventTarget.swift @@ -21,6 +21,7 @@ public class EventTarget: JSBridgedClass { // XXX: member 'removeEventListener' is ignored public func dispatchEvent(event: Event) -> Bool { - jsObject[Strings.dispatchEvent]!(event.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.dispatchEvent].function!(this: this, arguments: [event.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ExtendableEvent.swift b/Sources/DOMKit/WebIDL/ExtendableEvent.swift index 6cd10038..4440e9f6 100644 --- a/Sources/DOMKit/WebIDL/ExtendableEvent.swift +++ b/Sources/DOMKit/WebIDL/ExtendableEvent.swift @@ -15,6 +15,7 @@ public class ExtendableEvent: Event { } public func waitUntil(f: JSPromise) { - _ = jsObject[Strings.waitUntil]!(f.jsValue()) + let this = jsObject + _ = this[Strings.waitUntil].function!(this: this, arguments: [f.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/External.swift b/Sources/DOMKit/WebIDL/External.swift index 6fe224ce..245f83b3 100644 --- a/Sources/DOMKit/WebIDL/External.swift +++ b/Sources/DOMKit/WebIDL/External.swift @@ -13,10 +13,12 @@ public class External: JSBridgedClass { } public func AddSearchProvider() { - _ = jsObject[Strings.AddSearchProvider]!() + let this = jsObject + _ = this[Strings.AddSearchProvider].function!(this: this, arguments: []) } public func IsSearchProviderInstalled() { - _ = jsObject[Strings.IsSearchProviderInstalled]!() + let this = jsObject + _ = this[Strings.IsSearchProviderInstalled].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/EyeDropper.swift b/Sources/DOMKit/WebIDL/EyeDropper.swift index d72805e3..34584f44 100644 --- a/Sources/DOMKit/WebIDL/EyeDropper.swift +++ b/Sources/DOMKit/WebIDL/EyeDropper.swift @@ -17,12 +17,14 @@ public class EyeDropper: JSBridgedClass { } public func open(options: ColorSelectionOptions? = nil) -> JSPromise { - jsObject[Strings.open]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.open].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func open(options: ColorSelectionOptions? = nil) async throws -> ColorSelectionResult { - let _promise: JSPromise = jsObject[Strings.open]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FaceDetector.swift b/Sources/DOMKit/WebIDL/FaceDetector.swift index af3ded3c..d7e0c128 100644 --- a/Sources/DOMKit/WebIDL/FaceDetector.swift +++ b/Sources/DOMKit/WebIDL/FaceDetector.swift @@ -17,12 +17,14 @@ public class FaceDetector: JSBridgedClass { } public func detect(image: ImageBitmapSource) -> JSPromise { - jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func detect(image: ImageBitmapSource) async throws -> [DetectedFace] { - let _promise: JSPromise = jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FetchEvent.swift b/Sources/DOMKit/WebIDL/FetchEvent.swift index 859df2e3..62dcc1d2 100644 --- a/Sources/DOMKit/WebIDL/FetchEvent.swift +++ b/Sources/DOMKit/WebIDL/FetchEvent.swift @@ -39,6 +39,7 @@ public class FetchEvent: ExtendableEvent { public var handled: JSPromise public func respondWith(r: JSPromise) { - _ = jsObject[Strings.respondWith]!(r.jsValue()) + let this = jsObject + _ = this[Strings.respondWith].function!(this: this, arguments: [r.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index 7d7e6728..27ff7029 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -24,23 +24,28 @@ public class FileReader: EventTarget { } public func readAsArrayBuffer(blob: Blob) { - _ = jsObject[Strings.readAsArrayBuffer]!(blob.jsValue()) + let this = jsObject + _ = this[Strings.readAsArrayBuffer].function!(this: this, arguments: [blob.jsValue()]) } public func readAsBinaryString(blob: Blob) { - _ = jsObject[Strings.readAsBinaryString]!(blob.jsValue()) + let this = jsObject + _ = this[Strings.readAsBinaryString].function!(this: this, arguments: [blob.jsValue()]) } public func readAsText(blob: Blob, encoding: String? = nil) { - _ = jsObject[Strings.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.readAsText].function!(this: this, arguments: [blob.jsValue(), encoding?.jsValue() ?? .undefined]) } public func readAsDataURL(blob: Blob) { - _ = jsObject[Strings.readAsDataURL]!(blob.jsValue()) + let this = jsObject + _ = this[Strings.readAsDataURL].function!(this: this, arguments: [blob.jsValue()]) } public func abort() { - _ = jsObject[Strings.abort]!() + let this = jsObject + _ = this[Strings.abort].function!(this: this, arguments: []) } public static let EMPTY: UInt16 = 0 diff --git a/Sources/DOMKit/WebIDL/FileReaderSync.swift b/Sources/DOMKit/WebIDL/FileReaderSync.swift index c5cf35de..0a57df8d 100644 --- a/Sources/DOMKit/WebIDL/FileReaderSync.swift +++ b/Sources/DOMKit/WebIDL/FileReaderSync.swift @@ -17,18 +17,22 @@ public class FileReaderSync: JSBridgedClass { } public func readAsArrayBuffer(blob: Blob) -> ArrayBuffer { - jsObject[Strings.readAsArrayBuffer]!(blob.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.readAsArrayBuffer].function!(this: this, arguments: [blob.jsValue()]).fromJSValue()! } public func readAsBinaryString(blob: Blob) -> String { - jsObject[Strings.readAsBinaryString]!(blob.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.readAsBinaryString].function!(this: this, arguments: [blob.jsValue()]).fromJSValue()! } public func readAsText(blob: Blob, encoding: String? = nil) -> String { - jsObject[Strings.readAsText]!(blob.jsValue(), encoding?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.readAsText].function!(this: this, arguments: [blob.jsValue(), encoding?.jsValue() ?? .undefined]).fromJSValue()! } public func readAsDataURL(blob: Blob) -> String { - jsObject[Strings.readAsDataURL]!(blob.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.readAsDataURL].function!(this: this, arguments: [blob.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift index 3622a861..09158b39 100644 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift @@ -11,7 +11,8 @@ public class FileSystemDirectoryEntry: FileSystemEntry { } public func createReader() -> FileSystemDirectoryReader { - jsObject[Strings.createReader]!().fromJSValue()! + let this = jsObject + return this[Strings.createReader].function!(this: this, arguments: []).fromJSValue()! } // XXX: member 'getFile' is ignored diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift index e4de9fbf..c906c7fa 100644 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift @@ -17,42 +17,50 @@ public class FileSystemDirectoryHandle: FileSystemHandle, AsyncSequence { } public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) -> JSPromise { - jsObject[Strings.getFileHandle]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) async throws -> FileSystemFileHandle { - let _promise: JSPromise = jsObject[Strings.getFileHandle]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) -> JSPromise { - jsObject[Strings.getDirectoryHandle]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) async throws -> FileSystemDirectoryHandle { - let _promise: JSPromise = jsObject[Strings.getDirectoryHandle]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) -> JSPromise { - jsObject[Strings.removeEntry]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.removeEntry]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func resolve(possibleDescendant: FileSystemHandle) -> JSPromise { - jsObject[Strings.resolve]!(possibleDescendant.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func resolve(possibleDescendant: FileSystemHandle) async throws -> [String]? { - let _promise: JSPromise = jsObject[Strings.resolve]!(possibleDescendant.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift b/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift index e5e9fe4c..5715eb0e 100644 --- a/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift +++ b/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift @@ -11,22 +11,26 @@ public class FileSystemFileHandle: FileSystemHandle { } public func getFile() -> JSPromise { - jsObject[Strings.getFile]!().fromJSValue()! + let this = jsObject + return this[Strings.getFile].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getFile() async throws -> File { - let _promise: JSPromise = jsObject[Strings.getFile]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getFile].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func createWritable(options: FileSystemCreateWritableOptions? = nil) -> JSPromise { - jsObject[Strings.createWritable]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func createWritable(options: FileSystemCreateWritableOptions? = nil) async throws -> FileSystemWritableFileStream { - let _promise: JSPromise = jsObject[Strings.createWritable]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FileSystemHandle.swift b/Sources/DOMKit/WebIDL/FileSystemHandle.swift index 9cc43c54..84303409 100644 --- a/Sources/DOMKit/WebIDL/FileSystemHandle.swift +++ b/Sources/DOMKit/WebIDL/FileSystemHandle.swift @@ -21,32 +21,38 @@ public class FileSystemHandle: JSBridgedClass { public var name: String public func isSameEntry(other: FileSystemHandle) -> JSPromise { - jsObject[Strings.isSameEntry]!(other.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func isSameEntry(other: FileSystemHandle) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.isSameEntry]!(other.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { - jsObject[Strings.queryPermission]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { - let _promise: JSPromise = jsObject[Strings.queryPermission]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { - jsObject[Strings.requestPermission]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { - let _promise: JSPromise = jsObject[Strings.requestPermission]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift b/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift index 0269b72a..e671e8c2 100644 --- a/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift +++ b/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift @@ -11,32 +11,38 @@ public class FileSystemWritableFileStream: WritableStream { } public func write(data: FileSystemWriteChunkType) -> JSPromise { - jsObject[Strings.write]!(data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func write(data: FileSystemWriteChunkType) async throws { - let _promise: JSPromise = jsObject[Strings.write]!(data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func seek(position: UInt64) -> JSPromise { - jsObject[Strings.seek]!(position.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.seek].function!(this: this, arguments: [position.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func seek(position: UInt64) async throws { - let _promise: JSPromise = jsObject[Strings.seek]!(position.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.seek].function!(this: this, arguments: [position.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func truncate(size: UInt64) -> JSPromise { - jsObject[Strings.truncate]!(size.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.truncate].function!(this: this, arguments: [size.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func truncate(size: UInt64) async throws { - let _promise: JSPromise = jsObject[Strings.truncate]!(size.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.truncate].function!(this: this, arguments: [size.jsValue()]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/FontFace.swift b/Sources/DOMKit/WebIDL/FontFace.swift index 195abc3b..18846528 100644 --- a/Sources/DOMKit/WebIDL/FontFace.swift +++ b/Sources/DOMKit/WebIDL/FontFace.swift @@ -73,12 +73,14 @@ public class FontFace: JSBridgedClass { public var status: FontFaceLoadStatus public func load() -> JSPromise { - jsObject[Strings.load]!().fromJSValue()! + let this = jsObject + return this[Strings.load].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func load() async throws -> FontFace { - let _promise: JSPromise = jsObject[Strings.load]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/FontFaceSet.swift b/Sources/DOMKit/WebIDL/FontFaceSet.swift index 383a9f26..804bd2e8 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSet.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSet.swift @@ -22,15 +22,18 @@ public class FontFaceSet: EventTarget { // XXX: make me Set-like! public func add(font: FontFace) -> Self { - jsObject[Strings.add]!(font.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.add].function!(this: this, arguments: [font.jsValue()]).fromJSValue()! } public func delete(font: FontFace) -> Bool { - jsObject[Strings.delete]!(font.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.delete].function!(this: this, arguments: [font.jsValue()]).fromJSValue()! } public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } @ClosureAttribute1Optional @@ -43,17 +46,20 @@ public class FontFaceSet: EventTarget { public var onloadingerror: EventHandler public func load(font: String, text: String? = nil) -> JSPromise { - jsObject[Strings.load]!(font.jsValue(), text?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.load].function!(this: this, arguments: [font.jsValue(), text?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func load(font: String, text: String? = nil) async throws -> [FontFace] { - let _promise: JSPromise = jsObject[Strings.load]!(font.jsValue(), text?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [font.jsValue(), text?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func check(font: String, text: String? = nil) -> Bool { - jsObject[Strings.check]!(font.jsValue(), text?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.check].function!(this: this, arguments: [font.jsValue(), text?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FontManager.swift b/Sources/DOMKit/WebIDL/FontManager.swift index 4a260da0..00d3fbd1 100644 --- a/Sources/DOMKit/WebIDL/FontManager.swift +++ b/Sources/DOMKit/WebIDL/FontManager.swift @@ -13,12 +13,14 @@ public class FontManager: JSBridgedClass { } public func query(options: QueryOptions? = nil) -> JSPromise { - jsObject[Strings.query]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.query].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func query(options: QueryOptions? = nil) async throws -> [FontMetadata] { - let _promise: JSPromise = jsObject[Strings.query]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FontMetadata.swift b/Sources/DOMKit/WebIDL/FontMetadata.swift index a83723c2..57afb5ba 100644 --- a/Sources/DOMKit/WebIDL/FontMetadata.swift +++ b/Sources/DOMKit/WebIDL/FontMetadata.swift @@ -17,12 +17,14 @@ public class FontMetadata: JSBridgedClass { } public func blob() -> JSPromise { - jsObject[Strings.blob]!().fromJSValue()! + let this = jsObject + return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func blob() async throws -> Blob { - let _promise: JSPromise = jsObject[Strings.blob]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index 7663fe4a..41a9efb3 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -17,35 +17,43 @@ public class FormData: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - _ = jsObject[Strings.append]!(name.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } public func append(name: String, blobValue: Blob, filename: String? = nil) { - _ = jsObject[Strings.append]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined]) } public func delete(name: String) { - _ = jsObject[Strings.delete]!(name.jsValue()) + let this = jsObject + _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]) } public func get(name: String) -> FormDataEntryValue? { - jsObject[Strings.get]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func getAll(name: String) -> [FormDataEntryValue] { - jsObject[Strings.getAll]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func has(name: String) -> Bool { - jsObject[Strings.has]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.has].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func set(name: String, value: String) { - _ = jsObject[Strings.set]!(name.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } public func set(name: String, blobValue: Blob, filename: String? = nil) { - _ = jsObject[Strings.set]!(name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined]) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/GPU.swift b/Sources/DOMKit/WebIDL/GPU.swift index ea617891..fe1dc602 100644 --- a/Sources/DOMKit/WebIDL/GPU.swift +++ b/Sources/DOMKit/WebIDL/GPU.swift @@ -13,12 +13,14 @@ public class GPU: JSBridgedClass { } public func requestAdapter(options: GPURequestAdapterOptions? = nil) -> JSPromise { - jsObject[Strings.requestAdapter]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestAdapter(options: GPURequestAdapterOptions? = nil) async throws -> GPUAdapter? { - let _promise: JSPromise = jsObject[Strings.requestAdapter]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUAdapter.swift b/Sources/DOMKit/WebIDL/GPUAdapter.swift index 51111602..b136a6f3 100644 --- a/Sources/DOMKit/WebIDL/GPUAdapter.swift +++ b/Sources/DOMKit/WebIDL/GPUAdapter.swift @@ -29,12 +29,14 @@ public class GPUAdapter: JSBridgedClass { public var isFallbackAdapter: Bool public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) -> JSPromise { - jsObject[Strings.requestDevice]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) async throws -> GPUDevice { - let _promise: JSPromise = jsObject[Strings.requestDevice]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUBuffer.swift b/Sources/DOMKit/WebIDL/GPUBuffer.swift index 0cb27c44..a1596d1a 100644 --- a/Sources/DOMKit/WebIDL/GPUBuffer.swift +++ b/Sources/DOMKit/WebIDL/GPUBuffer.swift @@ -13,24 +13,29 @@ public class GPUBuffer: JSBridgedClass, GPUObjectBase { } public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) -> JSPromise { - jsObject[Strings.mapAsync]!(mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.mapAsync]!(mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func getMappedRange(offset: GPUSize64? = nil, size: GPUSize64? = nil) -> ArrayBuffer { - jsObject[Strings.getMappedRange]!(offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getMappedRange].function!(this: this, arguments: [offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]).fromJSValue()! } public func unmap() { - _ = jsObject[Strings.unmap]!() + let this = jsObject + _ = this[Strings.unmap].function!(this: this, arguments: []) } public func destroy() { - _ = jsObject[Strings.destroy]!() + let this = jsObject + _ = this[Strings.destroy].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift index 102f0518..02219392 100644 --- a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift +++ b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift @@ -17,18 +17,22 @@ public class GPUCanvasContext: JSBridgedClass { public var canvas: __UNSUPPORTED_UNION__ public func configure(configuration: GPUCanvasConfiguration) { - _ = jsObject[Strings.configure]!(configuration.jsValue()) + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [configuration.jsValue()]) } public func unconfigure() { - _ = jsObject[Strings.unconfigure]!() + let this = jsObject + _ = this[Strings.unconfigure].function!(this: this, arguments: []) } public func getPreferredFormat(adapter: GPUAdapter) -> GPUTextureFormat { - jsObject[Strings.getPreferredFormat]!(adapter.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getPreferredFormat].function!(this: this, arguments: [adapter.jsValue()]).fromJSValue()! } public func getCurrentTexture() -> GPUTexture { - jsObject[Strings.getCurrentTexture]!().fromJSValue()! + let this = jsObject + return this[Strings.getCurrentTexture].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift b/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift index 53c87458..7134f90d 100644 --- a/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift @@ -13,42 +13,52 @@ public class GPUCommandEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, } public func beginRenderPass(descriptor: GPURenderPassDescriptor) -> GPURenderPassEncoder { - jsObject[Strings.beginRenderPass]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.beginRenderPass].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func beginComputePass(descriptor: GPUComputePassDescriptor? = nil) -> GPUComputePassEncoder { - jsObject[Strings.beginComputePass]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.beginComputePass].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } public func copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64) { - _ = jsObject[Strings.copyBufferToBuffer]!(source.jsValue(), sourceOffset.jsValue(), destination.jsValue(), destinationOffset.jsValue(), size.jsValue()) + let this = jsObject + _ = this[Strings.copyBufferToBuffer].function!(this: this, arguments: [source.jsValue(), sourceOffset.jsValue(), destination.jsValue(), destinationOffset.jsValue(), size.jsValue()]) } public func copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { - _ = jsObject[Strings.copyBufferToTexture]!(source.jsValue(), destination.jsValue(), copySize.jsValue()) + let this = jsObject + _ = this[Strings.copyBufferToTexture].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) } public func copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D) { - _ = jsObject[Strings.copyTextureToBuffer]!(source.jsValue(), destination.jsValue(), copySize.jsValue()) + let this = jsObject + _ = this[Strings.copyTextureToBuffer].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) } public func copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { - _ = jsObject[Strings.copyTextureToTexture]!(source.jsValue(), destination.jsValue(), copySize.jsValue()) + let this = jsObject + _ = this[Strings.copyTextureToTexture].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) } public func clearBuffer(buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { - _ = jsObject[Strings.clearBuffer]!(buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clearBuffer].function!(this: this, arguments: [buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) } public func writeTimestamp(querySet: GPUQuerySet, queryIndex: GPUSize32) { - _ = jsObject[Strings.writeTimestamp]!(querySet.jsValue(), queryIndex.jsValue()) + let this = jsObject + _ = this[Strings.writeTimestamp].function!(this: this, arguments: [querySet.jsValue(), queryIndex.jsValue()]) } public func resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64) { - _ = jsObject[Strings.resolveQuerySet]!(querySet.jsValue(), firstQuery.jsValue(), queryCount.jsValue(), destination.jsValue(), destinationOffset.jsValue()) + let this = jsObject + _ = this[Strings.resolveQuerySet].function!(this: this, arguments: [querySet.jsValue(), firstQuery.jsValue(), queryCount.jsValue(), destination.jsValue(), destinationOffset.jsValue()]) } public func finish(descriptor: GPUCommandBufferDescriptor? = nil) -> GPUCommandBuffer { - jsObject[Strings.finish]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift index 64d8f4ce..ab805156 100644 --- a/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift @@ -13,18 +13,22 @@ public class GPUComputePassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMi } public func setPipeline(pipeline: GPUComputePipeline) { - _ = jsObject[Strings.setPipeline]!(pipeline.jsValue()) + let this = jsObject + _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue()]) } public func dispatch(workgroupCountX: GPUSize32, workgroupCountY: GPUSize32? = nil, workgroupCountZ: GPUSize32? = nil) { - _ = jsObject[Strings.dispatch]!(workgroupCountX.jsValue(), workgroupCountY?.jsValue() ?? .undefined, workgroupCountZ?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.dispatch].function!(this: this, arguments: [workgroupCountX.jsValue(), workgroupCountY?.jsValue() ?? .undefined, workgroupCountZ?.jsValue() ?? .undefined]) } public func dispatchIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { - _ = jsObject[Strings.dispatchIndirect]!(indirectBuffer.jsValue(), indirectOffset.jsValue()) + let this = jsObject + _ = this[Strings.dispatchIndirect].function!(this: this, arguments: [indirectBuffer.jsValue(), indirectOffset.jsValue()]) } public func end() { - _ = jsObject[Strings.end]!() + let this = jsObject + _ = this[Strings.end].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift b/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift index 0c163888..4d92d88a 100644 --- a/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift +++ b/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift @@ -6,14 +6,17 @@ import JavaScriptKit public protocol GPUDebugCommandsMixin: JSBridgedClass {} public extension GPUDebugCommandsMixin { func pushDebugGroup(groupLabel: String) { - _ = jsObject[Strings.pushDebugGroup]!(groupLabel.jsValue()) + let this = jsObject + _ = this[Strings.pushDebugGroup].function!(this: this, arguments: [groupLabel.jsValue()]) } func popDebugGroup() { - _ = jsObject[Strings.popDebugGroup]!() + let this = jsObject + _ = this[Strings.popDebugGroup].function!(this: this, arguments: []) } func insertDebugMarker(markerLabel: String) { - _ = jsObject[Strings.insertDebugMarker]!(markerLabel.jsValue()) + let this = jsObject + _ = this[Strings.insertDebugMarker].function!(this: this, arguments: [markerLabel.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/GPUDevice.swift b/Sources/DOMKit/WebIDL/GPUDevice.swift index 07922b83..42b94132 100644 --- a/Sources/DOMKit/WebIDL/GPUDevice.swift +++ b/Sources/DOMKit/WebIDL/GPUDevice.swift @@ -25,95 +25,116 @@ public class GPUDevice: EventTarget, GPUObjectBase { public var queue: GPUQueue public func destroy() { - _ = jsObject[Strings.destroy]!() + let this = jsObject + _ = this[Strings.destroy].function!(this: this, arguments: []) } public func createBuffer(descriptor: GPUBufferDescriptor) -> GPUBuffer { - jsObject[Strings.createBuffer]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createBuffer].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createTexture(descriptor: GPUTextureDescriptor) -> GPUTexture { - jsObject[Strings.createTexture]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createTexture].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createSampler(descriptor: GPUSamplerDescriptor? = nil) -> GPUSampler { - jsObject[Strings.createSampler]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createSampler].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } public func importExternalTexture(descriptor: GPUExternalTextureDescriptor) -> GPUExternalTexture { - jsObject[Strings.importExternalTexture]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.importExternalTexture].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor) -> GPUBindGroupLayout { - jsObject[Strings.createBindGroupLayout]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createBindGroupLayout].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor) -> GPUPipelineLayout { - jsObject[Strings.createPipelineLayout]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createPipelineLayout].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createBindGroup(descriptor: GPUBindGroupDescriptor) -> GPUBindGroup { - jsObject[Strings.createBindGroup]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createBindGroup].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createShaderModule(descriptor: GPUShaderModuleDescriptor) -> GPUShaderModule { - jsObject[Strings.createShaderModule]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createShaderModule].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createComputePipeline(descriptor: GPUComputePipelineDescriptor) -> GPUComputePipeline { - jsObject[Strings.createComputePipeline]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createComputePipeline].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createRenderPipeline(descriptor: GPURenderPipelineDescriptor) -> GPURenderPipeline { - jsObject[Strings.createRenderPipeline]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createRenderPipeline].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) -> JSPromise { - jsObject[Strings.createComputePipelineAsync]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) async throws -> GPUComputePipeline { - let _promise: JSPromise = jsObject[Strings.createComputePipelineAsync]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) -> JSPromise { - jsObject[Strings.createRenderPipelineAsync]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) async throws -> GPURenderPipeline { - let _promise: JSPromise = jsObject[Strings.createRenderPipelineAsync]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func createCommandEncoder(descriptor: GPUCommandEncoderDescriptor? = nil) -> GPUCommandEncoder { - jsObject[Strings.createCommandEncoder]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createCommandEncoder].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } public func createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor) -> GPURenderBundleEncoder { - jsObject[Strings.createRenderBundleEncoder]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createRenderBundleEncoder].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } public func createQuerySet(descriptor: GPUQuerySetDescriptor) -> GPUQuerySet { - jsObject[Strings.createQuerySet]!(descriptor.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createQuerySet].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } @ReadonlyAttribute public var lost: JSPromise public func pushErrorScope(filter: GPUErrorFilter) { - _ = jsObject[Strings.pushErrorScope]!(filter.jsValue()) + let this = jsObject + _ = this[Strings.pushErrorScope].function!(this: this, arguments: [filter.jsValue()]) } public func popErrorScope() -> JSPromise { - jsObject[Strings.popErrorScope]!().fromJSValue()! + let this = jsObject + return this[Strings.popErrorScope].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func popErrorScope() async throws -> GPUError? { - let _promise: JSPromise = jsObject[Strings.popErrorScope]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.popErrorScope].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/GPUPipelineBase.swift b/Sources/DOMKit/WebIDL/GPUPipelineBase.swift index bae96dfc..66972fba 100644 --- a/Sources/DOMKit/WebIDL/GPUPipelineBase.swift +++ b/Sources/DOMKit/WebIDL/GPUPipelineBase.swift @@ -6,6 +6,7 @@ import JavaScriptKit public protocol GPUPipelineBase: JSBridgedClass {} public extension GPUPipelineBase { func getBindGroupLayout(index: UInt32) -> GPUBindGroupLayout { - jsObject[Strings.getBindGroupLayout]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getBindGroupLayout].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift index b4972b21..b63562eb 100644 --- a/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift @@ -6,10 +6,12 @@ import JavaScriptKit public protocol GPUProgrammablePassEncoder: JSBridgedClass {} public extension GPUProgrammablePassEncoder { func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets: [GPUBufferDynamicOffset]? = nil) { - _ = jsObject[Strings.setBindGroup]!(index.jsValue(), bindGroup.jsValue(), dynamicOffsets?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue(), bindGroup.jsValue(), dynamicOffsets?.jsValue() ?? .undefined]) } func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32) { - _ = jsObject[Strings.setBindGroup]!(index.jsValue(), bindGroup.jsValue(), dynamicOffsetsData.jsValue(), dynamicOffsetsDataStart.jsValue(), dynamicOffsetsDataLength.jsValue()) + let this = jsObject + _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue(), bindGroup.jsValue(), dynamicOffsetsData.jsValue(), dynamicOffsetsDataStart.jsValue(), dynamicOffsetsDataLength.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/GPUQuerySet.swift b/Sources/DOMKit/WebIDL/GPUQuerySet.swift index 0a4b2097..0b6bccf9 100644 --- a/Sources/DOMKit/WebIDL/GPUQuerySet.swift +++ b/Sources/DOMKit/WebIDL/GPUQuerySet.swift @@ -13,6 +13,7 @@ public class GPUQuerySet: JSBridgedClass, GPUObjectBase { } public func destroy() { - _ = jsObject[Strings.destroy]!() + let this = jsObject + _ = this[Strings.destroy].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/GPUQueue.swift b/Sources/DOMKit/WebIDL/GPUQueue.swift index 8ac00787..74192967 100644 --- a/Sources/DOMKit/WebIDL/GPUQueue.swift +++ b/Sources/DOMKit/WebIDL/GPUQueue.swift @@ -13,28 +13,34 @@ public class GPUQueue: JSBridgedClass, GPUObjectBase { } public func submit(commandBuffers: [GPUCommandBuffer]) { - _ = jsObject[Strings.submit]!(commandBuffers.jsValue()) + let this = jsObject + _ = this[Strings.submit].function!(this: this, arguments: [commandBuffers.jsValue()]) } public func onSubmittedWorkDone() -> JSPromise { - jsObject[Strings.onSubmittedWorkDone]!().fromJSValue()! + let this = jsObject + return this[Strings.onSubmittedWorkDone].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func onSubmittedWorkDone() async throws { - let _promise: JSPromise = jsObject[Strings.onSubmittedWorkDone]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.onSubmittedWorkDone].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: BufferSource, dataOffset: GPUSize64? = nil, size: GPUSize64? = nil) { - _ = jsObject[Strings.writeBuffer]!(buffer.jsValue(), bufferOffset.jsValue(), data.jsValue(), dataOffset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.writeBuffer].function!(this: this, arguments: [buffer.jsValue(), bufferOffset.jsValue(), data.jsValue(), dataOffset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) } public func writeTexture(destination: GPUImageCopyTexture, data: BufferSource, dataLayout: GPUImageDataLayout, size: GPUExtent3D) { - _ = jsObject[Strings.writeTexture]!(destination.jsValue(), data.jsValue(), dataLayout.jsValue(), size.jsValue()) + let this = jsObject + _ = this[Strings.writeTexture].function!(this: this, arguments: [destination.jsValue(), data.jsValue(), dataLayout.jsValue(), size.jsValue()]) } public func copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: GPUExtent3D) { - _ = jsObject[Strings.copyExternalImageToTexture]!(source.jsValue(), destination.jsValue(), copySize.jsValue()) + let this = jsObject + _ = this[Strings.copyExternalImageToTexture].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift index 4231323f..590f33ce 100644 --- a/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift @@ -13,6 +13,7 @@ public class GPURenderBundleEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsM } public func finish(descriptor: GPURenderBundleDescriptor? = nil) -> GPURenderBundle { - jsObject[Strings.finish]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift b/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift index 4faafa23..9152ef6a 100644 --- a/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift +++ b/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift @@ -6,30 +6,37 @@ import JavaScriptKit public protocol GPURenderEncoderBase: JSBridgedClass {} public extension GPURenderEncoderBase { func setPipeline(pipeline: GPURenderPipeline) { - _ = jsObject[Strings.setPipeline]!(pipeline.jsValue()) + let this = jsObject + _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue()]) } func setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset: GPUSize64? = nil, size: GPUSize64? = nil) { - _ = jsObject[Strings.setIndexBuffer]!(buffer.jsValue(), indexFormat.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setIndexBuffer].function!(this: this, arguments: [buffer.jsValue(), indexFormat.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) } func setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { - _ = jsObject[Strings.setVertexBuffer]!(slot.jsValue(), buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setVertexBuffer].function!(this: this, arguments: [slot.jsValue(), buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) } func draw(vertexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstVertex: GPUSize32? = nil, firstInstance: GPUSize32? = nil) { - _ = jsObject[Strings.draw]!(vertexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.draw].function!(this: this, arguments: [vertexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined]) } func drawIndexed(indexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstIndex: GPUSize32? = nil, baseVertex: GPUSignedOffset32? = nil, firstInstance: GPUSize32? = nil) { - _ = jsObject[Strings.drawIndexed]!(indexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstIndex?.jsValue() ?? .undefined, baseVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.drawIndexed].function!(this: this, arguments: [indexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstIndex?.jsValue() ?? .undefined, baseVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined]) } func drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { - _ = jsObject[Strings.drawIndirect]!(indirectBuffer.jsValue(), indirectOffset.jsValue()) + let this = jsObject + _ = this[Strings.drawIndirect].function!(this: this, arguments: [indirectBuffer.jsValue(), indirectOffset.jsValue()]) } func drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { - _ = jsObject[Strings.drawIndexedIndirect]!(indirectBuffer.jsValue(), indirectOffset.jsValue()) + let this = jsObject + _ = this[Strings.drawIndexedIndirect].function!(this: this, arguments: [indirectBuffer.jsValue(), indirectOffset.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift index 45f36685..e521682c 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift @@ -19,34 +19,42 @@ public class GPURenderPassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMix let _arg3 = height.jsValue() let _arg4 = minDepth.jsValue() let _arg5 = maxDepth.jsValue() - _ = jsObject[Strings.setViewport]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.setViewport].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } public func setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate) { - _ = jsObject[Strings.setScissorRect]!(x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()) + let this = jsObject + _ = this[Strings.setScissorRect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()]) } public func setBlendConstant(color: GPUColor) { - _ = jsObject[Strings.setBlendConstant]!(color.jsValue()) + let this = jsObject + _ = this[Strings.setBlendConstant].function!(this: this, arguments: [color.jsValue()]) } public func setStencilReference(reference: GPUStencilValue) { - _ = jsObject[Strings.setStencilReference]!(reference.jsValue()) + let this = jsObject + _ = this[Strings.setStencilReference].function!(this: this, arguments: [reference.jsValue()]) } public func beginOcclusionQuery(queryIndex: GPUSize32) { - _ = jsObject[Strings.beginOcclusionQuery]!(queryIndex.jsValue()) + let this = jsObject + _ = this[Strings.beginOcclusionQuery].function!(this: this, arguments: [queryIndex.jsValue()]) } public func endOcclusionQuery() { - _ = jsObject[Strings.endOcclusionQuery]!() + let this = jsObject + _ = this[Strings.endOcclusionQuery].function!(this: this, arguments: []) } public func executeBundles(bundles: [GPURenderBundle]) { - _ = jsObject[Strings.executeBundles]!(bundles.jsValue()) + let this = jsObject + _ = this[Strings.executeBundles].function!(this: this, arguments: [bundles.jsValue()]) } public func end() { - _ = jsObject[Strings.end]!() + let this = jsObject + _ = this[Strings.end].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/GPUShaderModule.swift b/Sources/DOMKit/WebIDL/GPUShaderModule.swift index 69764bb2..116001d8 100644 --- a/Sources/DOMKit/WebIDL/GPUShaderModule.swift +++ b/Sources/DOMKit/WebIDL/GPUShaderModule.swift @@ -13,12 +13,14 @@ public class GPUShaderModule: JSBridgedClass, GPUObjectBase { } public func compilationInfo() -> JSPromise { - jsObject[Strings.compilationInfo]!().fromJSValue()! + let this = jsObject + return this[Strings.compilationInfo].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func compilationInfo() async throws -> GPUCompilationInfo { - let _promise: JSPromise = jsObject[Strings.compilationInfo]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.compilationInfo].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUTexture.swift b/Sources/DOMKit/WebIDL/GPUTexture.swift index 67b6d01a..10531602 100644 --- a/Sources/DOMKit/WebIDL/GPUTexture.swift +++ b/Sources/DOMKit/WebIDL/GPUTexture.swift @@ -13,10 +13,12 @@ public class GPUTexture: JSBridgedClass, GPUObjectBase { } public func createView(descriptor: GPUTextureViewDescriptor? = nil) -> GPUTextureView { - jsObject[Strings.createView]!(descriptor?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createView].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } public func destroy() { - _ = jsObject[Strings.destroy]!() + let this = jsObject + _ = this[Strings.destroy].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift b/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift index 3f1a6cdd..f6aed33c 100644 --- a/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift +++ b/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift @@ -17,12 +17,14 @@ public class GamepadHapticActuator: JSBridgedClass { public var type: GamepadHapticActuatorType public func pulse(value: Double, duration: Double) -> JSPromise { - jsObject[Strings.pulse]!(value.jsValue(), duration.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.pulse].function!(this: this, arguments: [value.jsValue(), duration.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func pulse(value: Double, duration: Double) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.pulse]!(value.jsValue(), duration.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.pulse].function!(this: this, arguments: [value.jsValue(), duration.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Geolocation.swift b/Sources/DOMKit/WebIDL/Geolocation.swift index 1524b6f6..b0710a71 100644 --- a/Sources/DOMKit/WebIDL/Geolocation.swift +++ b/Sources/DOMKit/WebIDL/Geolocation.swift @@ -17,6 +17,7 @@ public class Geolocation: JSBridgedClass { // XXX: member 'watchPosition' is ignored public func clearWatch(watchId: Int32) { - _ = jsObject[Strings.clearWatch]!(watchId.jsValue()) + let this = jsObject + _ = this[Strings.clearWatch].function!(this: this, arguments: [watchId.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/GeolocationSensor.swift b/Sources/DOMKit/WebIDL/GeolocationSensor.swift index a699aa62..b6f7e175 100644 --- a/Sources/DOMKit/WebIDL/GeolocationSensor.swift +++ b/Sources/DOMKit/WebIDL/GeolocationSensor.swift @@ -22,12 +22,14 @@ public class GeolocationSensor: Sensor { } public static func read(readOptions: ReadOptions? = nil) -> JSPromise { - constructor[Strings.read]!(readOptions?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func read(readOptions: ReadOptions? = nil) async throws -> GeolocationSensorReading { - let _promise: JSPromise = constructor[Strings.read]!(readOptions?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/GeometryUtils.swift b/Sources/DOMKit/WebIDL/GeometryUtils.swift index 37ae5df6..ecacea3c 100644 --- a/Sources/DOMKit/WebIDL/GeometryUtils.swift +++ b/Sources/DOMKit/WebIDL/GeometryUtils.swift @@ -6,18 +6,22 @@ import JavaScriptKit public protocol GeometryUtils: JSBridgedClass {} public extension GeometryUtils { func getBoxQuads(options: BoxQuadOptions? = nil) -> [DOMQuad] { - jsObject[Strings.getBoxQuads]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getBoxQuads].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } func convertQuadFromNode(quad: DOMQuadInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { - jsObject[Strings.convertQuadFromNode]!(quad.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.convertQuadFromNode].function!(this: this, arguments: [quad.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } func convertRectFromNode(rect: DOMRectReadOnly, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { - jsObject[Strings.convertRectFromNode]!(rect.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.convertRectFromNode].function!(this: this, arguments: [rect.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } func convertPointFromNode(point: DOMPointInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMPoint { - jsObject[Strings.convertPointFromNode]!(point.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.convertPointFromNode].function!(this: this, arguments: [point.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GetSVGDocument.swift b/Sources/DOMKit/WebIDL/GetSVGDocument.swift index d3992968..8cb51a61 100644 --- a/Sources/DOMKit/WebIDL/GetSVGDocument.swift +++ b/Sources/DOMKit/WebIDL/GetSVGDocument.swift @@ -6,6 +6,7 @@ import JavaScriptKit public protocol GetSVGDocument: JSBridgedClass {} public extension GetSVGDocument { func getSVGDocument() -> Document { - jsObject[Strings.getSVGDocument]!().fromJSValue()! + let this = jsObject + return this[Strings.getSVGDocument].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Global.swift b/Sources/DOMKit/WebIDL/Global.swift index 6dd52977..ba7e6a5e 100644 --- a/Sources/DOMKit/WebIDL/Global.swift +++ b/Sources/DOMKit/WebIDL/Global.swift @@ -18,7 +18,8 @@ public class Global: JSBridgedClass { } public func valueOf() -> JSValue { - jsObject[Strings.valueOf]!().fromJSValue()! + let this = jsObject + return this[Strings.valueOf].function!(this: this, arguments: []).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/GroupEffect.swift b/Sources/DOMKit/WebIDL/GroupEffect.swift index e6ad8b7a..9ffe532d 100644 --- a/Sources/DOMKit/WebIDL/GroupEffect.swift +++ b/Sources/DOMKit/WebIDL/GroupEffect.swift @@ -29,14 +29,17 @@ public class GroupEffect: JSBridgedClass { public var lastChild: AnimationEffect? public func clone() -> Self { - jsObject[Strings.clone]!().fromJSValue()! + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } public func prepend(effects: AnimationEffect...) { - _ = jsObject[Strings.prepend]!(effects.jsValue()) + let this = jsObject + _ = this[Strings.prepend].function!(this: this, arguments: effects.map { $0.jsValue() }) } public func append(effects: AnimationEffect...) { - _ = jsObject[Strings.append]!(effects.jsValue()) + let this = jsObject + _ = this[Strings.append].function!(this: this, arguments: effects.map { $0.jsValue() }) } } diff --git a/Sources/DOMKit/WebIDL/HID.swift b/Sources/DOMKit/WebIDL/HID.swift index ac7b8a90..2e7bf687 100644 --- a/Sources/DOMKit/WebIDL/HID.swift +++ b/Sources/DOMKit/WebIDL/HID.swift @@ -19,22 +19,26 @@ public class HID: EventTarget { public var ondisconnect: EventHandler public func getDevices() -> JSPromise { - jsObject[Strings.getDevices]!().fromJSValue()! + let this = jsObject + return this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDevices() async throws -> [HIDDevice] { - let _promise: JSPromise = jsObject[Strings.getDevices]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func requestDevice(options: HIDDeviceRequestOptions) -> JSPromise { - jsObject[Strings.requestDevice]!(options.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestDevice(options: HIDDeviceRequestOptions) async throws -> [HIDDevice] { - let _promise: JSPromise = jsObject[Strings.requestDevice]!(options.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HIDDevice.swift b/Sources/DOMKit/WebIDL/HIDDevice.swift index 0fd217c8..60260d51 100644 --- a/Sources/DOMKit/WebIDL/HIDDevice.swift +++ b/Sources/DOMKit/WebIDL/HIDDevice.swift @@ -35,62 +35,74 @@ public class HIDDevice: EventTarget { public var collections: [HIDCollectionInfo] public func open() -> JSPromise { - jsObject[Strings.open]!().fromJSValue()! + let this = jsObject + return this[Strings.open].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func open() async throws { - let _promise: JSPromise = jsObject[Strings.open]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject[Strings.close]!().fromJSValue()! + 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, *) public func close() async throws { - let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func forget() -> JSPromise { - jsObject[Strings.forget]!().fromJSValue()! + let this = jsObject + return this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func forget() async throws { - let _promise: JSPromise = jsObject[Strings.forget]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func sendReport(reportId: UInt8, data: BufferSource) -> JSPromise { - jsObject[Strings.sendReport]!(reportId.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func sendReport(reportId: UInt8, data: BufferSource) async throws { - let _promise: JSPromise = jsObject[Strings.sendReport]!(reportId.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func sendFeatureReport(reportId: UInt8, data: BufferSource) -> JSPromise { - jsObject[Strings.sendFeatureReport]!(reportId.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func sendFeatureReport(reportId: UInt8, data: BufferSource) async throws { - let _promise: JSPromise = jsObject[Strings.sendFeatureReport]!(reportId.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func receiveFeatureReport(reportId: UInt8) -> JSPromise { - jsObject[Strings.receiveFeatureReport]!(reportId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func receiveFeatureReport(reportId: UInt8) async throws -> DataView { - let _promise: JSPromise = jsObject[Strings.receiveFeatureReport]!(reportId.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift index 35744950..bc628913 100644 --- a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -25,6 +25,7 @@ public class HTMLAllCollection: JSBridgedClass { } public func item(nameOrIndex: String? = nil) -> __UNSUPPORTED_UNION__? { - jsObject[Strings.item]!(nameOrIndex?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.item].function!(this: this, arguments: [nameOrIndex?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift index b10ca588..00db5cb6 100644 --- a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -68,15 +68,18 @@ public class HTMLButtonElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Strings.checkValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Strings.reportValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) + let this = jsObject + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index 3e3e22e9..ab09efb5 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -23,20 +23,24 @@ public class HTMLCanvasElement: HTMLElement { public var height: UInt32 public func getContext(contextId: String, options: JSValue? = nil) -> RenderingContext? { - jsObject[Strings.getContext]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getContext].function!(this: this, arguments: [contextId.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func toDataURL(type: String? = nil, quality: JSValue? = nil) -> String { - jsObject[Strings.toDataURL]!(type?.jsValue() ?? .undefined, quality?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.toDataURL].function!(this: this, arguments: [type?.jsValue() ?? .undefined, quality?.jsValue() ?? .undefined]).fromJSValue()! } // XXX: member 'toBlob' is ignored public func transferControlToOffscreen() -> OffscreenCanvas { - jsObject[Strings.transferControlToOffscreen]!().fromJSValue()! + let this = jsObject + return this[Strings.transferControlToOffscreen].function!(this: this, arguments: []).fromJSValue()! } public func captureStream(frameRequestRate: Double? = nil) -> MediaStream { - jsObject[Strings.captureStream]!(frameRequestRate?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.captureStream].function!(this: this, arguments: [frameRequestRate?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift index f067c02d..c0d51212 100644 --- a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -23,14 +23,17 @@ public class HTMLDialogElement: HTMLElement { public var returnValue: String public func show() { - _ = jsObject[Strings.show]!() + let this = jsObject + _ = this[Strings.show].function!(this: this, arguments: []) } public func showModal() { - _ = jsObject[Strings.showModal]!() + let this = jsObject + _ = this[Strings.showModal].function!(this: this, arguments: []) } public func close(returnValue: String? = nil) { - _ = jsObject[Strings.close]!(returnValue?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: [returnValue?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 2cf95ab6..8a04a703 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -66,7 +66,8 @@ public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, D public var inert: Bool public func click() { - _ = jsObject[Strings.click]!() + let this = jsObject + _ = this[Strings.click].function!(this: this, arguments: []) } @ReadWriteAttribute @@ -91,6 +92,7 @@ public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, D public var outerText: String public func attachInternals() -> ElementInternals { - jsObject[Strings.attachInternals]!().fromJSValue()! + let this = jsObject + return this[Strings.attachInternals].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift index 3d189c42..bcb31442 100644 --- a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift @@ -33,7 +33,8 @@ public class HTMLEmbedElement: HTMLElement { public var height: String public func getSVGDocument() -> Document? { - jsObject[Strings.getSVGDocument]!().fromJSValue()! + let this = jsObject + return this[Strings.getSVGDocument].function!(this: this, arguments: []).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift index 190d3fb9..8fbf1301 100644 --- a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -47,14 +47,17 @@ public class HTMLFieldSetElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Strings.checkValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Strings.reportValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) + let this = jsObject + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index 0d36eac2..c1b8e1ad 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -75,22 +75,27 @@ public class HTMLFormElement: HTMLElement { } public func submit() { - _ = jsObject[Strings.submit]!() + let this = jsObject + _ = this[Strings.submit].function!(this: this, arguments: []) } public func requestSubmit(submitter: HTMLElement? = nil) { - _ = jsObject[Strings.requestSubmit]!(submitter?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.requestSubmit].function!(this: this, arguments: [submitter?.jsValue() ?? .undefined]) } public func reset() { - _ = jsObject[Strings.reset]!() + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) } public func checkValidity() -> Bool { - jsObject[Strings.checkValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Strings.reportValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index 00aafb65..479459c7 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -75,7 +75,8 @@ public class HTMLIFrameElement: HTMLElement { public var contentWindow: WindowProxy? public func getSVGDocument() -> Document? { - jsObject[Strings.getSVGDocument]!().fromJSValue()! + let this = jsObject + return this[Strings.getSVGDocument].function!(this: this, arguments: []).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index 60527ae3..91bc1571 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -95,12 +95,14 @@ public class HTMLImageElement: HTMLElement { public var loading: String public func decode() -> JSPromise { - jsObject[Strings.decode]!().fromJSValue()! + let this = jsObject + return this[Strings.decode].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func decode() async throws { - let _promise: JSPromise = jsObject[Strings.decode]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.decode].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index 8b51bedf..2fbab19e 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -180,11 +180,13 @@ public class HTMLInputElement: HTMLElement { public var width: UInt32 public func stepUp(n: Int32? = nil) { - _ = jsObject[Strings.stepUp]!(n?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.stepUp].function!(this: this, arguments: [n?.jsValue() ?? .undefined]) } public func stepDown(n: Int32? = nil) { - _ = jsObject[Strings.stepDown]!(n?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.stepDown].function!(this: this, arguments: [n?.jsValue() ?? .undefined]) } @ReadonlyAttribute @@ -197,22 +199,26 @@ public class HTMLInputElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Strings.checkValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Strings.reportValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) + let this = jsObject + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } @ReadonlyAttribute public var labels: NodeList? public func select() { - _ = jsObject[Strings.select]!() + let this = jsObject + _ = this[Strings.select].function!(this: this, arguments: []) } @ReadWriteAttribute @@ -225,19 +231,23 @@ public class HTMLInputElement: HTMLElement { public var selectionDirection: String? public func setRangeText(replacement: String) { - _ = jsObject[Strings.setRangeText]!(replacement.jsValue()) + let this = jsObject + _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue()]) } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - _ = jsObject[Strings.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined]) } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - _ = jsObject[Strings.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setSelectionRange].function!(this: this, arguments: [start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined]) } public func showPicker() { - _ = jsObject[Strings.showPicker]!() + let this = jsObject + _ = this[Strings.showPicker].function!(this: this, arguments: []) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift index 5698e70c..2a1d0f55 100644 --- a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift @@ -59,10 +59,12 @@ public class HTMLMarqueeElement: HTMLElement { public var width: String public func start() { - _ = jsObject[Strings.start]!() + let this = jsObject + _ = this[Strings.start].function!(this: this, arguments: []) } public func stop() { - _ = jsObject[Strings.stop]!() + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index 95841cac..6617dfe4 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -48,12 +48,14 @@ public class HTMLMediaElement: HTMLElement { public var sinkId: String public func setSinkId(sinkId: String) -> JSPromise { - jsObject[Strings.setSinkId]!(sinkId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func setSinkId(sinkId: String) async throws { - let _promise: JSPromise = jsObject[Strings.setSinkId]!(sinkId.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue()]).fromJSValue()! _ = try await _promise.get() } @@ -67,12 +69,14 @@ public class HTMLMediaElement: HTMLElement { public var onwaitingforkey: EventHandler public func setMediaKeys(mediaKeys: MediaKeys?) -> JSPromise { - jsObject[Strings.setMediaKeys]!(mediaKeys.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func setMediaKeys(mediaKeys: MediaKeys?) async throws { - let _promise: JSPromise = jsObject[Strings.setMediaKeys]!(mediaKeys.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue()]).fromJSValue()! _ = try await _promise.get() } @@ -109,11 +113,13 @@ public class HTMLMediaElement: HTMLElement { public var buffered: TimeRanges public func load() { - _ = jsObject[Strings.load]!() + let this = jsObject + _ = this[Strings.load].function!(this: this, arguments: []) } public func canPlayType(type: String) -> CanPlayTypeResult { - jsObject[Strings.canPlayType]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.canPlayType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } public static let HAVE_NOTHING: UInt16 = 0 @@ -136,14 +142,16 @@ public class HTMLMediaElement: HTMLElement { public var currentTime: Double public func fastSeek(time: Double) { - _ = jsObject[Strings.fastSeek]!(time.jsValue()) + let this = jsObject + _ = this[Strings.fastSeek].function!(this: this, arguments: [time.jsValue()]) } @ReadonlyAttribute public var duration: Double public func getStartDate() -> JSObject { - jsObject[Strings.getStartDate]!().fromJSValue()! + let this = jsObject + return this[Strings.getStartDate].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute @@ -174,17 +182,20 @@ public class HTMLMediaElement: HTMLElement { public var loop: Bool public func play() -> JSPromise { - jsObject[Strings.play]!().fromJSValue()! + let this = jsObject + return this[Strings.play].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func play() async throws { - let _promise: JSPromise = jsObject[Strings.play]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.play].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func pause() { - _ = jsObject[Strings.pause]!() + let this = jsObject + _ = this[Strings.pause].function!(this: this, arguments: []) } @ReadWriteAttribute @@ -209,11 +220,13 @@ public class HTMLMediaElement: HTMLElement { public var textTracks: TextTrackList public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { - jsObject[Strings.addTextTrack]!(kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.addTextTrack].function!(this: this, arguments: [kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined]).fromJSValue()! } public func captureStream() -> MediaStream { - jsObject[Strings.captureStream]!().fromJSValue()! + let this = jsObject + return this[Strings.captureStream].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift index 11bc24d5..17a8d59d 100644 --- a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -61,7 +61,8 @@ public class HTMLObjectElement: HTMLElement { public var contentWindow: WindowProxy? public func getSVGDocument() -> Document? { - jsObject[Strings.getSVGDocument]!().fromJSValue()! + let this = jsObject + return this[Strings.getSVGDocument].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute @@ -74,15 +75,18 @@ public class HTMLObjectElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Strings.checkValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Strings.reportValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) + let this = jsObject + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift index 8572b645..18750be8 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -21,11 +21,13 @@ public class HTMLOptionsCollection: HTMLCollection { // XXX: unsupported setter for keys of type UInt32 public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Strings.add]!(element.jsValue(), before?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.add].function!(this: this, arguments: [element.jsValue(), before?.jsValue() ?? .undefined]) } public func remove(index: Int32) { - _ = jsObject[Strings.remove]!(index.jsValue()) + let this = jsObject + _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue()]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift index ef44bea9..3853b57c 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift @@ -23,10 +23,12 @@ public extension HTMLOrSVGElement { } func focus(options: FocusOptions? = nil) { - _ = jsObject[Strings.focus]!(options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.focus].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } func blur() { - _ = jsObject[Strings.blur]!() + let this = jsObject + _ = this[Strings.blur].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift index f8f21a70..b95cda9f 100644 --- a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -52,15 +52,18 @@ public class HTMLOutputElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Strings.checkValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Strings.reportValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) + let this = jsObject + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift index 409c7ae0..fccbd9c0 100644 --- a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift @@ -25,17 +25,20 @@ public class HTMLPortalElement: HTMLElement { public var referrerPolicy: String public func activate(options: PortalActivateOptions? = nil) -> JSPromise { - jsObject[Strings.activate]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.activate].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func activate(options: PortalActivateOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.activate]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.activate].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift index 849861fa..0dee69a4 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -59,7 +59,8 @@ public class HTMLScriptElement: HTMLElement { public var blocking: DOMTokenList public static func supports(type: String) -> Bool { - constructor[Strings.supports]!(type.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.supports].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index e490b59e..23824109 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -66,19 +66,23 @@ public class HTMLSelectElement: HTMLElement { } public func namedItem(name: String) -> HTMLOptionElement? { - jsObject[Strings.namedItem]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.namedItem].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Strings.add]!(element.jsValue(), before?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.add].function!(this: this, arguments: [element.jsValue(), before?.jsValue() ?? .undefined]) } public func remove() { - _ = jsObject[Strings.remove]!() + let this = jsObject + _ = this[Strings.remove].function!(this: this, arguments: []) } public func remove(index: Int32) { - _ = jsObject[Strings.remove]!(index.jsValue()) + let this = jsObject + _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue()]) } // XXX: unsupported setter for keys of type UInt32 @@ -102,15 +106,18 @@ public class HTMLSelectElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Strings.checkValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Strings.reportValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) + let this = jsObject + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index 88a9239c..0e7fe50e 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -19,14 +19,17 @@ public class HTMLSlotElement: HTMLElement { public var name: String public func assignedNodes(options: AssignedNodesOptions? = nil) -> [Node] { - jsObject[Strings.assignedNodes]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.assignedNodes].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func assignedElements(options: AssignedNodesOptions? = nil) -> [Element] { - jsObject[Strings.assignedElements]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.assignedElements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func assign(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Strings.assign]!(nodes.jsValue()) + let this = jsObject + _ = this[Strings.assign].function!(this: this, arguments: nodes.map { $0.jsValue() }) } } diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift index 1692ca71..69d66f3e 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -32,51 +32,60 @@ public class HTMLTableElement: HTMLElement { public var caption: HTMLTableCaptionElement? public func createCaption() -> HTMLTableCaptionElement { - jsObject[Strings.createCaption]!().fromJSValue()! + let this = jsObject + return this[Strings.createCaption].function!(this: this, arguments: []).fromJSValue()! } public func deleteCaption() { - _ = jsObject[Strings.deleteCaption]!() + let this = jsObject + _ = this[Strings.deleteCaption].function!(this: this, arguments: []) } @ReadWriteAttribute public var tHead: HTMLTableSectionElement? public func createTHead() -> HTMLTableSectionElement { - jsObject[Strings.createTHead]!().fromJSValue()! + let this = jsObject + return this[Strings.createTHead].function!(this: this, arguments: []).fromJSValue()! } public func deleteTHead() { - _ = jsObject[Strings.deleteTHead]!() + let this = jsObject + _ = this[Strings.deleteTHead].function!(this: this, arguments: []) } @ReadWriteAttribute public var tFoot: HTMLTableSectionElement? public func createTFoot() -> HTMLTableSectionElement { - jsObject[Strings.createTFoot]!().fromJSValue()! + let this = jsObject + return this[Strings.createTFoot].function!(this: this, arguments: []).fromJSValue()! } public func deleteTFoot() { - _ = jsObject[Strings.deleteTFoot]!() + let this = jsObject + _ = this[Strings.deleteTFoot].function!(this: this, arguments: []) } @ReadonlyAttribute public var tBodies: HTMLCollection public func createTBody() -> HTMLTableSectionElement { - jsObject[Strings.createTBody]!().fromJSValue()! + let this = jsObject + return this[Strings.createTBody].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute public var rows: HTMLCollection public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { - jsObject[Strings.insertRow]!(index?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.insertRow].function!(this: this, arguments: [index?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteRow(index: Int32) { - _ = jsObject[Strings.deleteRow]!(index.jsValue()) + let this = jsObject + _ = this[Strings.deleteRow].function!(this: this, arguments: [index.jsValue()]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift index cdaa0b2f..988b103c 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -32,11 +32,13 @@ public class HTMLTableRowElement: HTMLElement { public var cells: HTMLCollection public func insertCell(index: Int32? = nil) -> HTMLTableCellElement { - jsObject[Strings.insertCell]!(index?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.insertCell].function!(this: this, arguments: [index?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteCell(index: Int32) { - _ = jsObject[Strings.deleteCell]!(index.jsValue()) + let this = jsObject + _ = this[Strings.deleteCell].function!(this: this, arguments: [index.jsValue()]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift index a2675263..69978c32 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -23,11 +23,13 @@ public class HTMLTableSectionElement: HTMLElement { public var rows: HTMLCollection public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { - jsObject[Strings.insertRow]!(index?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.insertRow].function!(this: this, arguments: [index?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteRow(index: Int32) { - _ = jsObject[Strings.deleteRow]!(index.jsValue()) + let this = jsObject + _ = this[Strings.deleteRow].function!(this: this, arguments: [index.jsValue()]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift index 9ab78748..4d64c83e 100644 --- a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -99,22 +99,26 @@ public class HTMLTextAreaElement: HTMLElement { public var validationMessage: String public func checkValidity() -> Bool { - jsObject[Strings.checkValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } public func reportValidity() -> Bool { - jsObject[Strings.reportValidity]!().fromJSValue()! + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } public func setCustomValidity(error: String) { - _ = jsObject[Strings.setCustomValidity]!(error.jsValue()) + let this = jsObject + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } @ReadonlyAttribute public var labels: NodeList public func select() { - _ = jsObject[Strings.select]!() + let this = jsObject + _ = this[Strings.select].function!(this: this, arguments: []) } @ReadWriteAttribute @@ -127,14 +131,17 @@ public class HTMLTextAreaElement: HTMLElement { public var selectionDirection: String public func setRangeText(replacement: String) { - _ = jsObject[Strings.setRangeText]!(replacement.jsValue()) + let this = jsObject + _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue()]) } public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { - _ = jsObject[Strings.setRangeText]!(replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined]) } public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { - _ = jsObject[Strings.setSelectionRange]!(start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setSelectionRange].function!(this: this, arguments: [start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 3ac009c9..2702a6e7 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -43,16 +43,19 @@ public class HTMLVideoElement: HTMLMediaElement { public var playsInline: Bool public func getVideoPlaybackQuality() -> VideoPlaybackQuality { - jsObject[Strings.getVideoPlaybackQuality]!().fromJSValue()! + let this = jsObject + return this[Strings.getVideoPlaybackQuality].function!(this: this, arguments: []).fromJSValue()! } public func requestPictureInPicture() -> JSPromise { - jsObject[Strings.requestPictureInPicture]!().fromJSValue()! + let this = jsObject + return this[Strings.requestPictureInPicture].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestPictureInPicture() async throws -> PictureInPictureWindow { - let _promise: JSPromise = jsObject[Strings.requestPictureInPicture]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestPictureInPicture].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -71,6 +74,7 @@ public class HTMLVideoElement: HTMLMediaElement { // XXX: member 'requestVideoFrameCallback' is ignored public func cancelVideoFrameCallback(handle: UInt32) { - _ = jsObject[Strings.cancelVideoFrameCallback]!(handle.jsValue()) + let this = jsObject + _ = this[Strings.cancelVideoFrameCallback].function!(this: this, arguments: [handle.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift index 8b09b51e..9b90dd0b 100644 --- a/Sources/DOMKit/WebIDL/Headers.swift +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -17,23 +17,28 @@ public class Headers: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - _ = jsObject[Strings.append]!(name.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } public func delete(name: String) { - _ = jsObject[Strings.delete]!(name.jsValue()) + let this = jsObject + _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]) } public func get(name: String) -> String? { - jsObject[Strings.get]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func has(name: String) -> Bool { - jsObject[Strings.has]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.has].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func set(name: String, value: String) { - _ = jsObject[Strings.set]!(name.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/History.swift b/Sources/DOMKit/WebIDL/History.swift index aa861f05..89b66243 100644 --- a/Sources/DOMKit/WebIDL/History.swift +++ b/Sources/DOMKit/WebIDL/History.swift @@ -25,22 +25,27 @@ public class History: JSBridgedClass { public var state: JSValue public func go(delta: Int32? = nil) { - _ = jsObject[Strings.go]!(delta?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.go].function!(this: this, arguments: [delta?.jsValue() ?? .undefined]) } public func back() { - _ = jsObject[Strings.back]!() + let this = jsObject + _ = this[Strings.back].function!(this: this, arguments: []) } public func forward() { - _ = jsObject[Strings.forward]!() + let this = jsObject + _ = this[Strings.forward].function!(this: this, arguments: []) } public func pushState(data: JSValue, unused: String, url: String? = nil) { - _ = jsObject[Strings.pushState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.pushState].function!(this: this, arguments: [data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined]) } public func replaceState(data: JSValue, unused: String, url: String? = nil) { - _ = jsObject[Strings.replaceState]!(data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.replaceState].function!(this: this, arguments: [data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/IDBCursor.swift b/Sources/DOMKit/WebIDL/IDBCursor.swift index 530d364b..a92e5b91 100644 --- a/Sources/DOMKit/WebIDL/IDBCursor.swift +++ b/Sources/DOMKit/WebIDL/IDBCursor.swift @@ -33,22 +33,27 @@ public class IDBCursor: JSBridgedClass { public var request: IDBRequest public func advance(count: UInt32) { - _ = jsObject[Strings.advance]!(count.jsValue()) + let this = jsObject + _ = this[Strings.advance].function!(this: this, arguments: [count.jsValue()]) } public func `continue`(key: JSValue? = nil) { - _ = jsObject[Strings.continue]!(key?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.continue].function!(this: this, arguments: [key?.jsValue() ?? .undefined]) } public func continuePrimaryKey(key: JSValue, primaryKey: JSValue) { - _ = jsObject[Strings.continuePrimaryKey]!(key.jsValue(), primaryKey.jsValue()) + let this = jsObject + _ = this[Strings.continuePrimaryKey].function!(this: this, arguments: [key.jsValue(), primaryKey.jsValue()]) } public func update(value: JSValue) -> IDBRequest { - jsObject[Strings.update]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.update].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public func delete() -> IDBRequest { - jsObject[Strings.delete]!().fromJSValue()! + let this = jsObject + return this[Strings.delete].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/IDBDatabase.swift b/Sources/DOMKit/WebIDL/IDBDatabase.swift index edd22798..1a347b73 100644 --- a/Sources/DOMKit/WebIDL/IDBDatabase.swift +++ b/Sources/DOMKit/WebIDL/IDBDatabase.swift @@ -27,19 +27,23 @@ public class IDBDatabase: EventTarget { public var objectStoreNames: DOMStringList public func transaction(storeNames: __UNSUPPORTED_UNION__, mode: IDBTransactionMode? = nil, options: IDBTransactionOptions? = nil) -> IDBTransaction { - jsObject[Strings.transaction]!(storeNames.jsValue(), mode?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.transaction].function!(this: this, arguments: [storeNames.jsValue(), mode?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public func createObjectStore(name: String, options: IDBObjectStoreParameters? = nil) -> IDBObjectStore { - jsObject[Strings.createObjectStore]!(name.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createObjectStore].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteObjectStore(name: String) { - _ = jsObject[Strings.deleteObjectStore]!(name.jsValue()) + let this = jsObject + _ = this[Strings.deleteObjectStore].function!(this: this, arguments: [name.jsValue()]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/IDBFactory.swift b/Sources/DOMKit/WebIDL/IDBFactory.swift index c77d112a..6831d5e8 100644 --- a/Sources/DOMKit/WebIDL/IDBFactory.swift +++ b/Sources/DOMKit/WebIDL/IDBFactory.swift @@ -13,24 +13,29 @@ public class IDBFactory: JSBridgedClass { } public func open(name: String, version: UInt64? = nil) -> IDBOpenDBRequest { - jsObject[Strings.open]!(name.jsValue(), version?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.open].function!(this: this, arguments: [name.jsValue(), version?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteDatabase(name: String) -> IDBOpenDBRequest { - jsObject[Strings.deleteDatabase]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.deleteDatabase].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func databases() -> JSPromise { - jsObject[Strings.databases]!().fromJSValue()! + let this = jsObject + return this[Strings.databases].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func databases() async throws -> [IDBDatabaseInfo] { - let _promise: JSPromise = jsObject[Strings.databases]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.databases].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func cmp(first: JSValue, second: JSValue) -> Int16 { - jsObject[Strings.cmp]!(first.jsValue(), second.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.cmp].function!(this: this, arguments: [first.jsValue(), second.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/IDBIndex.swift b/Sources/DOMKit/WebIDL/IDBIndex.swift index cc95e4cf..e5c53cd9 100644 --- a/Sources/DOMKit/WebIDL/IDBIndex.swift +++ b/Sources/DOMKit/WebIDL/IDBIndex.swift @@ -33,30 +33,37 @@ public class IDBIndex: JSBridgedClass { public var unique: Bool public func get(query: JSValue) -> IDBRequest { - jsObject[Strings.get]!(query.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } public func getKey(query: JSValue) -> IDBRequest { - jsObject[Strings.getKey]!(query.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getKey].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { - jsObject[Strings.getAll]!(query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! } public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { - jsObject[Strings.getAllKeys]!(query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! } public func count(query: JSValue? = nil) -> IDBRequest { - jsObject[Strings.count]!(query?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.count].function!(this: this, arguments: [query?.jsValue() ?? .undefined]).fromJSValue()! } public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { - jsObject[Strings.openCursor]!(query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! } public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { - jsObject[Strings.openKeyCursor]!(query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/IDBKeyRange.swift b/Sources/DOMKit/WebIDL/IDBKeyRange.swift index f4f6ea3e..b967075e 100644 --- a/Sources/DOMKit/WebIDL/IDBKeyRange.swift +++ b/Sources/DOMKit/WebIDL/IDBKeyRange.swift @@ -29,22 +29,27 @@ public class IDBKeyRange: JSBridgedClass { public var upperOpen: Bool public static func only(value: JSValue) -> Self { - constructor[Strings.only]!(value.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.only].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public static func lowerBound(lower: JSValue, open: Bool? = nil) -> Self { - constructor[Strings.lowerBound]!(lower.jsValue(), open?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.lowerBound].function!(this: this, arguments: [lower.jsValue(), open?.jsValue() ?? .undefined]).fromJSValue()! } public static func upperBound(upper: JSValue, open: Bool? = nil) -> Self { - constructor[Strings.upperBound]!(upper.jsValue(), open?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.upperBound].function!(this: this, arguments: [upper.jsValue(), open?.jsValue() ?? .undefined]).fromJSValue()! } public static func bound(lower: JSValue, upper: JSValue, lowerOpen: Bool? = nil, upperOpen: Bool? = nil) -> Self { - constructor[Strings.bound]!(lower.jsValue(), upper.jsValue(), lowerOpen?.jsValue() ?? .undefined, upperOpen?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.bound].function!(this: this, arguments: [lower.jsValue(), upper.jsValue(), lowerOpen?.jsValue() ?? .undefined, upperOpen?.jsValue() ?? .undefined]).fromJSValue()! } public func includes(key: JSValue) -> Bool { - jsObject[Strings.includes]!(key.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.includes].function!(this: this, arguments: [key.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBObjectStore.swift index 7e2d25ff..e5730a07 100644 --- a/Sources/DOMKit/WebIDL/IDBObjectStore.swift +++ b/Sources/DOMKit/WebIDL/IDBObjectStore.swift @@ -33,58 +33,72 @@ public class IDBObjectStore: JSBridgedClass { public var autoIncrement: Bool public func put(value: JSValue, key: JSValue? = nil) -> IDBRequest { - jsObject[Strings.put]!(value.jsValue(), key?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.put].function!(this: this, arguments: [value.jsValue(), key?.jsValue() ?? .undefined]).fromJSValue()! } public func add(value: JSValue, key: JSValue? = nil) -> IDBRequest { - jsObject[Strings.add]!(value.jsValue(), key?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.add].function!(this: this, arguments: [value.jsValue(), key?.jsValue() ?? .undefined]).fromJSValue()! } public func delete(query: JSValue) -> IDBRequest { - jsObject[Strings.delete]!(query.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.delete].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } public func clear() -> IDBRequest { - jsObject[Strings.clear]!().fromJSValue()! + let this = jsObject + return this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! } public func get(query: JSValue) -> IDBRequest { - jsObject[Strings.get]!(query.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } public func getKey(query: JSValue) -> IDBRequest { - jsObject[Strings.getKey]!(query.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getKey].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { - jsObject[Strings.getAll]!(query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! } public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { - jsObject[Strings.getAllKeys]!(query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! } public func count(query: JSValue? = nil) -> IDBRequest { - jsObject[Strings.count]!(query?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.count].function!(this: this, arguments: [query?.jsValue() ?? .undefined]).fromJSValue()! } public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { - jsObject[Strings.openCursor]!(query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! } public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { - jsObject[Strings.openKeyCursor]!(query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! } public func index(name: String) -> IDBIndex { - jsObject[Strings.index]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.index].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func createIndex(name: String, keyPath: __UNSUPPORTED_UNION__, options: IDBIndexParameters? = nil) -> IDBIndex { - jsObject[Strings.createIndex]!(name.jsValue(), keyPath.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createIndex].function!(this: this, arguments: [name.jsValue(), keyPath.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func deleteIndex(name: String) { - _ = jsObject[Strings.deleteIndex]!(name.jsValue()) + let this = jsObject + _ = this[Strings.deleteIndex].function!(this: this, arguments: [name.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/IDBTransaction.swift b/Sources/DOMKit/WebIDL/IDBTransaction.swift index 2071f59b..29370ce7 100644 --- a/Sources/DOMKit/WebIDL/IDBTransaction.swift +++ b/Sources/DOMKit/WebIDL/IDBTransaction.swift @@ -34,15 +34,18 @@ public class IDBTransaction: EventTarget { public var error: DOMException? public func objectStore(name: String) -> IDBObjectStore { - jsObject[Strings.objectStore]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.objectStore].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func commit() { - _ = jsObject[Strings.commit]!() + let this = jsObject + _ = this[Strings.commit].function!(this: this, arguments: []) } public func abort() { - _ = jsObject[Strings.abort]!() + let this = jsObject + _ = this[Strings.abort].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/IIRFilterNode.swift b/Sources/DOMKit/WebIDL/IIRFilterNode.swift index 6b6dc673..b051e934 100644 --- a/Sources/DOMKit/WebIDL/IIRFilterNode.swift +++ b/Sources/DOMKit/WebIDL/IIRFilterNode.swift @@ -15,6 +15,7 @@ public class IIRFilterNode: AudioNode { } public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { - _ = jsObject[Strings.getFrequencyResponse]!(frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()) + let this = jsObject + _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/IdleDeadline.swift b/Sources/DOMKit/WebIDL/IdleDeadline.swift index d2b8b1a5..c6e3d785 100644 --- a/Sources/DOMKit/WebIDL/IdleDeadline.swift +++ b/Sources/DOMKit/WebIDL/IdleDeadline.swift @@ -14,7 +14,8 @@ public class IdleDeadline: JSBridgedClass { } public func timeRemaining() -> DOMHighResTimeStamp { - jsObject[Strings.timeRemaining]!().fromJSValue()! + let this = jsObject + return this[Strings.timeRemaining].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/IdleDetector.swift b/Sources/DOMKit/WebIDL/IdleDetector.swift index abd5e009..ca373f62 100644 --- a/Sources/DOMKit/WebIDL/IdleDetector.swift +++ b/Sources/DOMKit/WebIDL/IdleDetector.swift @@ -27,22 +27,26 @@ public class IdleDetector: EventTarget { public var onchange: EventHandler public static func requestPermission() -> JSPromise { - constructor[Strings.requestPermission]!().fromJSValue()! + let this = constructor + return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func requestPermission() async throws -> PermissionState { - let _promise: JSPromise = constructor[Strings.requestPermission]!().fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func start(options: IdleOptions? = nil) -> JSPromise { - jsObject[Strings.start]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.start].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func start(options: IdleOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.start]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.start].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmap.swift b/Sources/DOMKit/WebIDL/ImageBitmap.swift index 548abb68..9cda1920 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmap.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmap.swift @@ -21,6 +21,7 @@ public class ImageBitmap: JSBridgedClass { public var height: UInt32 public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift index 80ffb53e..3f35fc7c 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -17,6 +17,7 @@ public class ImageBitmapRenderingContext: JSBridgedClass { public var canvas: __UNSUPPORTED_UNION__ public func transferFromImageBitmap(bitmap: ImageBitmap?) { - _ = jsObject[Strings.transferFromImageBitmap]!(bitmap.jsValue()) + let this = jsObject + _ = this[Strings.transferFromImageBitmap].function!(this: this, arguments: [bitmap.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/ImageCapture.swift b/Sources/DOMKit/WebIDL/ImageCapture.swift index c079c54d..23fead84 100644 --- a/Sources/DOMKit/WebIDL/ImageCapture.swift +++ b/Sources/DOMKit/WebIDL/ImageCapture.swift @@ -18,42 +18,50 @@ public class ImageCapture: JSBridgedClass { } public func takePhoto(photoSettings: PhotoSettings? = nil) -> JSPromise { - jsObject[Strings.takePhoto]!(photoSettings?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func takePhoto(photoSettings: PhotoSettings? = nil) async throws -> Blob { - let _promise: JSPromise = jsObject[Strings.takePhoto]!(photoSettings?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getPhotoCapabilities() -> JSPromise { - jsObject[Strings.getPhotoCapabilities]!().fromJSValue()! + let this = jsObject + return this[Strings.getPhotoCapabilities].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getPhotoCapabilities() async throws -> PhotoCapabilities { - let _promise: JSPromise = jsObject[Strings.getPhotoCapabilities]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getPhotoCapabilities].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getPhotoSettings() -> JSPromise { - jsObject[Strings.getPhotoSettings]!().fromJSValue()! + let this = jsObject + return this[Strings.getPhotoSettings].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getPhotoSettings() async throws -> PhotoSettings { - let _promise: JSPromise = jsObject[Strings.getPhotoSettings]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getPhotoSettings].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func grabFrame() -> JSPromise { - jsObject[Strings.grabFrame]!().fromJSValue()! + let this = jsObject + return this[Strings.grabFrame].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func grabFrame() async throws -> ImageBitmap { - let _promise: JSPromise = jsObject[Strings.grabFrame]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.grabFrame].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ImageDecoder.swift b/Sources/DOMKit/WebIDL/ImageDecoder.swift index 8e397600..89294264 100644 --- a/Sources/DOMKit/WebIDL/ImageDecoder.swift +++ b/Sources/DOMKit/WebIDL/ImageDecoder.swift @@ -33,30 +33,36 @@ public class ImageDecoder: JSBridgedClass { public var tracks: ImageTrackList public func decode(options: ImageDecodeOptions? = nil) -> JSPromise { - jsObject[Strings.decode]!(options?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func decode(options: ImageDecodeOptions? = nil) async throws -> ImageDecodeResult { - let _promise: JSPromise = jsObject[Strings.decode]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.decode].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func reset() { - _ = jsObject[Strings.reset]!() + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public static func isTypeSupported(type: String) -> JSPromise { - constructor[Strings.isTypeSupported]!(type.jsValue()).fromJSValue()! + 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, *) public static func isTypeSupported(type: String) async throws -> Bool { - let _promise: JSPromise = constructor[Strings.isTypeSupported]!(type.jsValue()).fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Ink.swift b/Sources/DOMKit/WebIDL/Ink.swift index 44a0359b..0465c273 100644 --- a/Sources/DOMKit/WebIDL/Ink.swift +++ b/Sources/DOMKit/WebIDL/Ink.swift @@ -13,12 +13,14 @@ public class Ink: JSBridgedClass { } public func requestPresenter(param: InkPresenterParam? = nil) -> JSPromise { - jsObject[Strings.requestPresenter]!(param?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestPresenter(param: InkPresenterParam? = nil) async throws -> InkPresenter { - let _promise: JSPromise = jsObject[Strings.requestPresenter]!(param?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/InkPresenter.swift b/Sources/DOMKit/WebIDL/InkPresenter.swift index fbac8826..7b46c45d 100644 --- a/Sources/DOMKit/WebIDL/InkPresenter.swift +++ b/Sources/DOMKit/WebIDL/InkPresenter.swift @@ -21,6 +21,7 @@ public class InkPresenter: JSBridgedClass { public var expectedImprovement: UInt32 public func updateInkTrailStartPoint(event: PointerEvent, style: InkTrailStyle) { - _ = jsObject[Strings.updateInkTrailStartPoint]!(event.jsValue(), style.jsValue()) + let this = jsObject + _ = this[Strings.updateInkTrailStartPoint].function!(this: this, arguments: [event.jsValue(), style.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/InputDeviceInfo.swift b/Sources/DOMKit/WebIDL/InputDeviceInfo.swift index 4cf24461..4adadefb 100644 --- a/Sources/DOMKit/WebIDL/InputDeviceInfo.swift +++ b/Sources/DOMKit/WebIDL/InputDeviceInfo.swift @@ -11,6 +11,7 @@ public class InputDeviceInfo: MediaDeviceInfo { } public func getCapabilities() -> MediaTrackCapabilities { - jsObject[Strings.getCapabilities]!().fromJSValue()! + let this = jsObject + return this[Strings.getCapabilities].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index 029115b5..a59a3492 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -18,7 +18,8 @@ public class InputEvent: UIEvent { public var dataTransfer: DataTransfer? public func getTargetRanges() -> [StaticRange] { - jsObject[Strings.getTargetRanges]!().fromJSValue()! + let this = jsObject + return this[Strings.getTargetRanges].function!(this: this, arguments: []).fromJSValue()! } public convenience init(type: String, eventInitDict: InputEventInit? = nil) { diff --git a/Sources/DOMKit/WebIDL/IntersectionObserver.swift b/Sources/DOMKit/WebIDL/IntersectionObserver.swift index 178e84ac..28bde196 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserver.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserver.swift @@ -27,18 +27,22 @@ public class IntersectionObserver: JSBridgedClass { public var thresholds: [Double] public func observe(target: Element) { - _ = jsObject[Strings.observe]!(target.jsValue()) + let this = jsObject + _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue()]) } public func unobserve(target: Element) { - _ = jsObject[Strings.unobserve]!(target.jsValue()) + let this = jsObject + _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue()]) } public func disconnect() { - _ = jsObject[Strings.disconnect]!() + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: []) } public func takeRecords() -> [IntersectionObserverEntry] { - jsObject[Strings.takeRecords]!().fromJSValue()! + let this = jsObject + return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/InterventionReportBody.swift b/Sources/DOMKit/WebIDL/InterventionReportBody.swift index f8a9f5b8..b1947a21 100644 --- a/Sources/DOMKit/WebIDL/InterventionReportBody.swift +++ b/Sources/DOMKit/WebIDL/InterventionReportBody.swift @@ -16,7 +16,8 @@ public class InterventionReportBody: ReportBody { } override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Keyboard.swift b/Sources/DOMKit/WebIDL/Keyboard.swift index 71407e98..1f402347 100644 --- a/Sources/DOMKit/WebIDL/Keyboard.swift +++ b/Sources/DOMKit/WebIDL/Keyboard.swift @@ -12,26 +12,31 @@ public class Keyboard: EventTarget { } public func lock(keyCodes: [String]? = nil) -> JSPromise { - jsObject[Strings.lock]!(keyCodes?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func lock(keyCodes: [String]? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.lock]!(keyCodes?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func unlock() { - _ = jsObject[Strings.unlock]!() + let this = jsObject + _ = this[Strings.unlock].function!(this: this, arguments: []) } public func getLayoutMap() -> JSPromise { - jsObject[Strings.getLayoutMap]!().fromJSValue()! + let this = jsObject + return this[Strings.getLayoutMap].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getLayoutMap() async throws -> KeyboardLayoutMap { - let _promise: JSPromise = jsObject[Strings.getLayoutMap]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getLayoutMap].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index 09060553..b8ae2b3f 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -61,7 +61,8 @@ public class KeyboardEvent: UIEvent { public var isComposing: Bool public func getModifierState(keyArg: String) -> Bool { - jsObject[Strings.getModifierState]!(keyArg.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getModifierState].function!(this: this, arguments: [keyArg.jsValue()]).fromJSValue()! } public func initKeyboardEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, keyArg: String? = nil, locationArg: UInt32? = nil, ctrlKey: Bool? = nil, altKey: Bool? = nil, shiftKey: Bool? = nil, metaKey: Bool? = nil) { @@ -75,7 +76,8 @@ public class KeyboardEvent: UIEvent { let _arg7 = altKey?.jsValue() ?? .undefined let _arg8 = shiftKey?.jsValue() ?? .undefined let _arg9 = metaKey?.jsValue() ?? .undefined - _ = jsObject[Strings.initKeyboardEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.initKeyboardEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/KeyframeEffect.swift b/Sources/DOMKit/WebIDL/KeyframeEffect.swift index 79c3b807..9fd39a4d 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffect.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffect.swift @@ -35,10 +35,12 @@ public class KeyframeEffect: AnimationEffect { public var composite: CompositeOperation public func getKeyframes() -> [JSObject] { - jsObject[Strings.getKeyframes]!().fromJSValue()! + let this = jsObject + return this[Strings.getKeyframes].function!(this: this, arguments: []).fromJSValue()! } public func setKeyframes(keyframes: JSObject?) { - _ = jsObject[Strings.setKeyframes]!(keyframes.jsValue()) + let this = jsObject + _ = this[Strings.setKeyframes].function!(this: this, arguments: [keyframes.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift b/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift index e7f88498..aca30947 100644 --- a/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift +++ b/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift @@ -35,6 +35,7 @@ public class LargestContentfulPaint: PerformanceEntry { public var element: Element? override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/LayoutChild.swift b/Sources/DOMKit/WebIDL/LayoutChild.swift index 3e19e14f..fe5cac7c 100644 --- a/Sources/DOMKit/WebIDL/LayoutChild.swift +++ b/Sources/DOMKit/WebIDL/LayoutChild.swift @@ -17,22 +17,26 @@ public class LayoutChild: JSBridgedClass { public var styleMap: StylePropertyMapReadOnly public func intrinsicSizes() -> JSPromise { - jsObject[Strings.intrinsicSizes]!().fromJSValue()! + let this = jsObject + return this[Strings.intrinsicSizes].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func intrinsicSizes() async throws -> IntrinsicSizes { - let _promise: JSPromise = jsObject[Strings.intrinsicSizes]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.intrinsicSizes].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) -> JSPromise { - jsObject[Strings.layoutNextFragment]!(constraints.jsValue(), breakToken.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.layoutNextFragment].function!(this: this, arguments: [constraints.jsValue(), breakToken.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) async throws -> LayoutFragment { - let _promise: JSPromise = jsObject[Strings.layoutNextFragment]!(constraints.jsValue(), breakToken.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.layoutNextFragment].function!(this: this, arguments: [constraints.jsValue(), breakToken.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/LayoutShift.swift b/Sources/DOMKit/WebIDL/LayoutShift.swift index d03622fa..597d0d0e 100644 --- a/Sources/DOMKit/WebIDL/LayoutShift.swift +++ b/Sources/DOMKit/WebIDL/LayoutShift.swift @@ -27,6 +27,7 @@ public class LayoutShift: PerformanceEntry { public var sources: [LayoutShiftAttribution] override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Location.swift b/Sources/DOMKit/WebIDL/Location.swift index 8a04552b..078bb04a 100644 --- a/Sources/DOMKit/WebIDL/Location.swift +++ b/Sources/DOMKit/WebIDL/Location.swift @@ -50,15 +50,18 @@ public class Location: JSBridgedClass { public var hash: String public func assign(url: String) { - _ = jsObject[Strings.assign]!(url.jsValue()) + let this = jsObject + _ = this[Strings.assign].function!(this: this, arguments: [url.jsValue()]) } public func replace(url: String) { - _ = jsObject[Strings.replace]!(url.jsValue()) + let this = jsObject + _ = this[Strings.replace].function!(this: this, arguments: [url.jsValue()]) } public func reload() { - _ = jsObject[Strings.reload]!() + let this = jsObject + _ = this[Strings.reload].function!(this: this, arguments: []) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/LockManager.swift b/Sources/DOMKit/WebIDL/LockManager.swift index 6f785275..5bcf6ebd 100644 --- a/Sources/DOMKit/WebIDL/LockManager.swift +++ b/Sources/DOMKit/WebIDL/LockManager.swift @@ -21,12 +21,14 @@ public class LockManager: JSBridgedClass { // XXX: member 'request' is ignored public func query() -> JSPromise { - jsObject[Strings.query]!().fromJSValue()! + let this = jsObject + return this[Strings.query].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func query() async throws -> LockManagerSnapshot { - let _promise: JSPromise = jsObject[Strings.query]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MIDIOutput.swift b/Sources/DOMKit/WebIDL/MIDIOutput.swift index cbce4a1d..d3517842 100644 --- a/Sources/DOMKit/WebIDL/MIDIOutput.swift +++ b/Sources/DOMKit/WebIDL/MIDIOutput.swift @@ -11,10 +11,12 @@ public class MIDIOutput: MIDIPort { } public func send(data: [UInt8], timestamp: DOMHighResTimeStamp? = nil) { - _ = jsObject[Strings.send]!(data.jsValue(), timestamp?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue(), timestamp?.jsValue() ?? .undefined]) } public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/MIDIPort.swift b/Sources/DOMKit/WebIDL/MIDIPort.swift index b77b5412..bf97d2da 100644 --- a/Sources/DOMKit/WebIDL/MIDIPort.swift +++ b/Sources/DOMKit/WebIDL/MIDIPort.swift @@ -43,22 +43,26 @@ public class MIDIPort: EventTarget { public var onstatechange: EventHandler public func open() -> JSPromise { - jsObject[Strings.open]!().fromJSValue()! + let this = jsObject + return this[Strings.open].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func open() async throws -> MIDIPort { - let _promise: JSPromise = jsObject[Strings.open]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func close() -> JSPromise { - jsObject[Strings.close]!().fromJSValue()! + 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, *) public func close() async throws -> MIDIPort { - let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ML.swift b/Sources/DOMKit/WebIDL/ML.swift index 5780affb..fd30e8eb 100644 --- a/Sources/DOMKit/WebIDL/ML.swift +++ b/Sources/DOMKit/WebIDL/ML.swift @@ -13,14 +13,17 @@ public class ML: JSBridgedClass { } public func createContext(options: MLContextOptions? = nil) -> MLContext { - jsObject[Strings.createContext]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createContext].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func createContext(glContext: WebGLRenderingContext) -> MLContext { - jsObject[Strings.createContext]!(glContext.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createContext].function!(this: this, arguments: [glContext.jsValue()]).fromJSValue()! } public func createContext(gpuDevice: GPUDevice) -> MLContext { - jsObject[Strings.createContext]!(gpuDevice.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createContext].function!(this: this, arguments: [gpuDevice.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MLGraph.swift b/Sources/DOMKit/WebIDL/MLGraph.swift index 72f1f378..346af327 100644 --- a/Sources/DOMKit/WebIDL/MLGraph.swift +++ b/Sources/DOMKit/WebIDL/MLGraph.swift @@ -13,6 +13,7 @@ public class MLGraph: JSBridgedClass { } public func compute(inputs: MLNamedInputs, outputs: MLNamedOutputs) { - _ = jsObject[Strings.compute]!(inputs.jsValue(), outputs.jsValue()) + let this = jsObject + _ = this[Strings.compute].function!(this: this, arguments: [inputs.jsValue(), outputs.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift index 399428a3..a2dfd734 100644 --- a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift +++ b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift @@ -17,119 +17,148 @@ public class MLGraphBuilder: JSBridgedClass { } public func input(name: String, desc: MLOperandDescriptor) -> MLOperand { - jsObject[Strings.input]!(name.jsValue(), desc.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.input].function!(this: this, arguments: [name.jsValue(), desc.jsValue()]).fromJSValue()! } public func constant(desc: MLOperandDescriptor, bufferView: MLBufferView) -> MLOperand { - jsObject[Strings.constant]!(desc.jsValue(), bufferView.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.constant].function!(this: this, arguments: [desc.jsValue(), bufferView.jsValue()]).fromJSValue()! } public func constant(value: Double, type: MLOperandType? = nil) -> MLOperand { - jsObject[Strings.constant]!(value.jsValue(), type?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.constant].function!(this: this, arguments: [value.jsValue(), type?.jsValue() ?? .undefined]).fromJSValue()! } public func build(outputs: MLNamedOperands) -> MLGraph { - jsObject[Strings.build]!(outputs.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.build].function!(this: this, arguments: [outputs.jsValue()]).fromJSValue()! } public func batchNormalization(input: MLOperand, mean: MLOperand, variance: MLOperand, options: MLBatchNormalizationOptions? = nil) -> MLOperand { - jsObject[Strings.batchNormalization]!(input.jsValue(), mean.jsValue(), variance.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.batchNormalization].function!(this: this, arguments: [input.jsValue(), mean.jsValue(), variance.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func clamp(x: MLOperand, options: MLClampOptions? = nil) -> MLOperand { - jsObject[Strings.clamp]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.clamp].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func clamp(options: MLClampOptions? = nil) -> MLOperator { - jsObject[Strings.clamp]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.clamp].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func concat(inputs: [MLOperand], axis: Int32) -> MLOperand { - jsObject[Strings.concat]!(inputs.jsValue(), axis.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.concat].function!(this: this, arguments: [inputs.jsValue(), axis.jsValue()]).fromJSValue()! } public func conv2d(input: MLOperand, filter: MLOperand, options: MLConv2dOptions? = nil) -> MLOperand { - jsObject[Strings.conv2d]!(input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.conv2d].function!(this: this, arguments: [input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func convTranspose2d(input: MLOperand, filter: MLOperand, options: MLConvTranspose2dOptions? = nil) -> MLOperand { - jsObject[Strings.convTranspose2d]!(input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.convTranspose2d].function!(this: this, arguments: [input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func add(a: MLOperand, b: MLOperand) -> MLOperand { - jsObject[Strings.add]!(a.jsValue(), b.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.add].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } public func sub(a: MLOperand, b: MLOperand) -> MLOperand { - jsObject[Strings.sub]!(a.jsValue(), b.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.sub].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } public func mul(a: MLOperand, b: MLOperand) -> MLOperand { - jsObject[Strings.mul]!(a.jsValue(), b.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.mul].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } public func div(a: MLOperand, b: MLOperand) -> MLOperand { - jsObject[Strings.div]!(a.jsValue(), b.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.div].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } public func max(a: MLOperand, b: MLOperand) -> MLOperand { - jsObject[Strings.max]!(a.jsValue(), b.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.max].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } public func min(a: MLOperand, b: MLOperand) -> MLOperand { - jsObject[Strings.min]!(a.jsValue(), b.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.min].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } public func pow(a: MLOperand, b: MLOperand) -> MLOperand { - jsObject[Strings.pow]!(a.jsValue(), b.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.pow].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } public func abs(x: MLOperand) -> MLOperand { - jsObject[Strings.abs]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.abs].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func ceil(x: MLOperand) -> MLOperand { - jsObject[Strings.ceil]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.ceil].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func cos(x: MLOperand) -> MLOperand { - jsObject[Strings.cos]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.cos].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func exp(x: MLOperand) -> MLOperand { - jsObject[Strings.exp]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.exp].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func floor(x: MLOperand) -> MLOperand { - jsObject[Strings.floor]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.floor].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func log(x: MLOperand) -> MLOperand { - jsObject[Strings.log]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.log].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func neg(x: MLOperand) -> MLOperand { - jsObject[Strings.neg]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.neg].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func sin(x: MLOperand) -> MLOperand { - jsObject[Strings.sin]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.sin].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func tan(x: MLOperand) -> MLOperand { - jsObject[Strings.tan]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.tan].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func elu(x: MLOperand, options: MLEluOptions? = nil) -> MLOperand { - jsObject[Strings.elu]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.elu].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func elu(options: MLEluOptions? = nil) -> MLOperator { - jsObject[Strings.elu]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.elu].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func gemm(a: MLOperand, b: MLOperand, options: MLGemmOptions? = nil) -> MLOperand { - jsObject[Strings.gemm]!(a.jsValue(), b.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.gemm].function!(this: this, arguments: [a.jsValue(), b.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func gru(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, steps: Int32, hiddenSize: Int32, options: MLGruOptions? = nil) -> [MLOperand] { @@ -139,7 +168,8 @@ public class MLGraphBuilder: JSBridgedClass { let _arg3 = steps.jsValue() let _arg4 = hiddenSize.jsValue() let _arg5 = options?.jsValue() ?? .undefined - return jsObject[Strings.gru]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + let this = jsObject + return this[Strings.gru].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } public func gruCell(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, hiddenState: MLOperand, hiddenSize: Int32, options: MLGruCellOptions? = nil) -> MLOperand { @@ -149,170 +179,212 @@ public class MLGraphBuilder: JSBridgedClass { let _arg3 = hiddenState.jsValue() let _arg4 = hiddenSize.jsValue() let _arg5 = options?.jsValue() ?? .undefined - return jsObject[Strings.gruCell]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + let this = jsObject + return this[Strings.gruCell].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } public func hardSigmoid(x: MLOperand, options: MLHardSigmoidOptions? = nil) -> MLOperand { - jsObject[Strings.hardSigmoid]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.hardSigmoid].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func hardSigmoid(options: MLHardSigmoidOptions? = nil) -> MLOperator { - jsObject[Strings.hardSigmoid]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.hardSigmoid].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func hardSwish(x: MLOperand) -> MLOperand { - jsObject[Strings.hardSwish]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.hardSwish].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func hardSwish() -> MLOperator { - jsObject[Strings.hardSwish]!().fromJSValue()! + let this = jsObject + return this[Strings.hardSwish].function!(this: this, arguments: []).fromJSValue()! } public func instanceNormalization(input: MLOperand, options: MLInstanceNormalizationOptions? = nil) -> MLOperand { - jsObject[Strings.instanceNormalization]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.instanceNormalization].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func leakyRelu(x: MLOperand, options: MLLeakyReluOptions? = nil) -> MLOperand { - jsObject[Strings.leakyRelu]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.leakyRelu].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func leakyRelu(options: MLLeakyReluOptions? = nil) -> MLOperator { - jsObject[Strings.leakyRelu]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.leakyRelu].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func matmul(a: MLOperand, b: MLOperand) -> MLOperand { - jsObject[Strings.matmul]!(a.jsValue(), b.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.matmul].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } public func linear(x: MLOperand, options: MLLinearOptions? = nil) -> MLOperand { - jsObject[Strings.linear]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.linear].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func linear(options: MLLinearOptions? = nil) -> MLOperator { - jsObject[Strings.linear]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.linear].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func pad(input: MLOperand, padding: MLOperand, options: MLPadOptions? = nil) -> MLOperand { - jsObject[Strings.pad]!(input.jsValue(), padding.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.pad].function!(this: this, arguments: [input.jsValue(), padding.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func averagePool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { - jsObject[Strings.averagePool2d]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.averagePool2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func l2Pool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { - jsObject[Strings.l2Pool2d]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.l2Pool2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func maxPool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { - jsObject[Strings.maxPool2d]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.maxPool2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceL1(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceL1]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceL1].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceL2(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceL2]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceL2].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceLogSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceLogSum]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceLogSum].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceLogSumExp(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceLogSumExp]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceLogSumExp].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceMax(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceMax]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceMax].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceMean(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceMean]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceMean].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceMin(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceMin]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceMin].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceProduct(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceProduct]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceProduct].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceSum]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceSum].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reduceSumSquare(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - jsObject[Strings.reduceSumSquare]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reduceSumSquare].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func relu(x: MLOperand) -> MLOperand { - jsObject[Strings.relu]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.relu].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func relu() -> MLOperator { - jsObject[Strings.relu]!().fromJSValue()! + let this = jsObject + return this[Strings.relu].function!(this: this, arguments: []).fromJSValue()! } public func resample2d(input: MLOperand, options: MLResample2dOptions? = nil) -> MLOperand { - jsObject[Strings.resample2d]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.resample2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reshape(input: MLOperand, newShape: [Int32]) -> MLOperand { - jsObject[Strings.reshape]!(input.jsValue(), newShape.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.reshape].function!(this: this, arguments: [input.jsValue(), newShape.jsValue()]).fromJSValue()! } public func sigmoid(x: MLOperand) -> MLOperand { - jsObject[Strings.sigmoid]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.sigmoid].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func sigmoid() -> MLOperator { - jsObject[Strings.sigmoid]!().fromJSValue()! + let this = jsObject + return this[Strings.sigmoid].function!(this: this, arguments: []).fromJSValue()! } public func slice(input: MLOperand, starts: [Int32], sizes: [Int32], options: MLSliceOptions? = nil) -> MLOperand { - jsObject[Strings.slice]!(input.jsValue(), starts.jsValue(), sizes.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.slice].function!(this: this, arguments: [input.jsValue(), starts.jsValue(), sizes.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func softmax(x: MLOperand) -> MLOperand { - jsObject[Strings.softmax]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.softmax].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func softplus(x: MLOperand, options: MLSoftplusOptions? = nil) -> MLOperand { - jsObject[Strings.softplus]!(x.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.softplus].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func softplus(options: MLSoftplusOptions? = nil) -> MLOperator { - jsObject[Strings.softplus]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.softplus].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func softsign(x: MLOperand) -> MLOperand { - jsObject[Strings.softsign]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.softsign].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func softsign() -> MLOperator { - jsObject[Strings.softsign]!().fromJSValue()! + let this = jsObject + return this[Strings.softsign].function!(this: this, arguments: []).fromJSValue()! } public func split(input: MLOperand, splits: __UNSUPPORTED_UNION__, options: MLSplitOptions? = nil) -> [MLOperand] { - jsObject[Strings.split]!(input.jsValue(), splits.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.split].function!(this: this, arguments: [input.jsValue(), splits.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func squeeze(input: MLOperand, options: MLSqueezeOptions? = nil) -> MLOperand { - jsObject[Strings.squeeze]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.squeeze].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func tanh(x: MLOperand) -> MLOperand { - jsObject[Strings.tanh]!(x.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.tanh].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } public func tanh() -> MLOperator { - jsObject[Strings.tanh]!().fromJSValue()! + let this = jsObject + return this[Strings.tanh].function!(this: this, arguments: []).fromJSValue()! } public func transpose(input: MLOperand, options: MLTransposeOptions? = nil) -> MLOperand { - jsObject[Strings.transpose]!(input.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.transpose].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaCapabilities.swift b/Sources/DOMKit/WebIDL/MediaCapabilities.swift index 9982a90c..2124411e 100644 --- a/Sources/DOMKit/WebIDL/MediaCapabilities.swift +++ b/Sources/DOMKit/WebIDL/MediaCapabilities.swift @@ -13,22 +13,26 @@ public class MediaCapabilities: JSBridgedClass { } public func decodingInfo(configuration: MediaDecodingConfiguration) -> JSPromise { - jsObject[Strings.decodingInfo]!(configuration.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func decodingInfo(configuration: MediaDecodingConfiguration) async throws -> MediaCapabilitiesDecodingInfo { - let _promise: JSPromise = jsObject[Strings.decodingInfo]!(configuration.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func encodingInfo(configuration: MediaEncodingConfiguration) -> JSPromise { - jsObject[Strings.encodingInfo]!(configuration.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func encodingInfo(configuration: MediaEncodingConfiguration) async throws -> MediaCapabilitiesEncodingInfo { - let _promise: JSPromise = jsObject[Strings.encodingInfo]!(configuration.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift b/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift index ea305c53..0df92a63 100644 --- a/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift +++ b/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift @@ -29,6 +29,7 @@ public class MediaDeviceInfo: JSBridgedClass { public var groupId: String public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaDevices.swift b/Sources/DOMKit/WebIDL/MediaDevices.swift index 2af82caa..ea3a658f 100644 --- a/Sources/DOMKit/WebIDL/MediaDevices.swift +++ b/Sources/DOMKit/WebIDL/MediaDevices.swift @@ -12,22 +12,26 @@ public class MediaDevices: EventTarget { } public func selectAudioOutput(options: AudioOutputOptions? = nil) -> JSPromise { - jsObject[Strings.selectAudioOutput]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func selectAudioOutput(options: AudioOutputOptions? = nil) async throws -> MediaDeviceInfo { - let _promise: JSPromise = jsObject[Strings.selectAudioOutput]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func produceCropTarget(element: HTMLElement) -> JSPromise { - jsObject[Strings.produceCropTarget]!(element.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func produceCropTarget(element: HTMLElement) async throws -> CropTarget { - let _promise: JSPromise = jsObject[Strings.produceCropTarget]!(element.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -35,36 +39,43 @@ public class MediaDevices: EventTarget { public var ondevicechange: EventHandler public func enumerateDevices() -> JSPromise { - jsObject[Strings.enumerateDevices]!().fromJSValue()! + 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, *) public func enumerateDevices() async throws -> [MediaDeviceInfo] { - let _promise: JSPromise = jsObject[Strings.enumerateDevices]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.enumerateDevices].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getSupportedConstraints() -> MediaTrackSupportedConstraints { - jsObject[Strings.getSupportedConstraints]!().fromJSValue()! + let this = jsObject + return this[Strings.getSupportedConstraints].function!(this: this, arguments: []).fromJSValue()! } public func getUserMedia(constraints: MediaStreamConstraints? = nil) -> JSPromise { - jsObject[Strings.getUserMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func getUserMedia(constraints: MediaStreamConstraints? = nil) async throws -> MediaStream { - let _promise: JSPromise = jsObject[Strings.getUserMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getUserMedia].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) -> JSPromise { - jsObject[Strings.getDisplayMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) async throws -> MediaStream { - let _promise: JSPromise = jsObject[Strings.getDisplayMedia]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaKeySession.swift b/Sources/DOMKit/WebIDL/MediaKeySession.swift index 8b08887d..fceb1d24 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySession.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySession.swift @@ -35,52 +35,62 @@ public class MediaKeySession: EventTarget { public var onmessage: EventHandler public func generateRequest(initDataType: String, initData: BufferSource) -> JSPromise { - jsObject[Strings.generateRequest]!(initDataType.jsValue(), initData.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue(), initData.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func generateRequest(initDataType: String, initData: BufferSource) async throws { - let _promise: JSPromise = jsObject[Strings.generateRequest]!(initDataType.jsValue(), initData.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue(), initData.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func load(sessionId: String) -> JSPromise { - jsObject[Strings.load]!(sessionId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.load].function!(this: this, arguments: [sessionId.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func load(sessionId: String) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.load]!(sessionId.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [sessionId.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func update(response: BufferSource) -> JSPromise { - jsObject[Strings.update]!(response.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.update].function!(this: this, arguments: [response.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func update(response: BufferSource) async throws { - let _promise: JSPromise = jsObject[Strings.update]!(response.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.update].function!(this: this, arguments: [response.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject[Strings.close]!().fromJSValue()! + 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, *) public func close() async throws { - let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func remove() -> JSPromise { - jsObject[Strings.remove]!().fromJSValue()! + let this = jsObject + return this[Strings.remove].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func remove() async throws { - let _promise: JSPromise = jsObject[Strings.remove]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.remove].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift index 3545aba3..31b0ec4d 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift @@ -22,10 +22,12 @@ public class MediaKeyStatusMap: JSBridgedClass, Sequence { public var size: UInt32 public func has(keyId: BufferSource) -> Bool { - jsObject[Strings.has]!(keyId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.has].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! } public func get(keyId: BufferSource) -> __UNSUPPORTED_UNION__ { - jsObject[Strings.get]!(keyId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift b/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift index b9994f90..67a3063d 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift @@ -17,16 +17,19 @@ public class MediaKeySystemAccess: JSBridgedClass { public var keySystem: String public func getConfiguration() -> MediaKeySystemConfiguration { - jsObject[Strings.getConfiguration]!().fromJSValue()! + let this = jsObject + return this[Strings.getConfiguration].function!(this: this, arguments: []).fromJSValue()! } public func createMediaKeys() -> JSPromise { - jsObject[Strings.createMediaKeys]!().fromJSValue()! + let this = jsObject + return this[Strings.createMediaKeys].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func createMediaKeys() async throws -> MediaKeys { - let _promise: JSPromise = jsObject[Strings.createMediaKeys]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createMediaKeys].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaKeys.swift b/Sources/DOMKit/WebIDL/MediaKeys.swift index 71223fc8..7e3e1d05 100644 --- a/Sources/DOMKit/WebIDL/MediaKeys.swift +++ b/Sources/DOMKit/WebIDL/MediaKeys.swift @@ -13,16 +13,19 @@ public class MediaKeys: JSBridgedClass { } public func createSession(sessionType: MediaKeySessionType? = nil) -> MediaKeySession { - jsObject[Strings.createSession]!(sessionType?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createSession].function!(this: this, arguments: [sessionType?.jsValue() ?? .undefined]).fromJSValue()! } public func setServerCertificate(serverCertificate: BufferSource) -> JSPromise { - jsObject[Strings.setServerCertificate]!(serverCertificate.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func setServerCertificate(serverCertificate: BufferSource) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.setServerCertificate]!(serverCertificate.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift index 93bbb9c2..fe566a7f 100644 --- a/Sources/DOMKit/WebIDL/MediaList.swift +++ b/Sources/DOMKit/WebIDL/MediaList.swift @@ -25,10 +25,12 @@ public class MediaList: JSBridgedClass { } public func appendMedium(medium: String) { - _ = jsObject[Strings.appendMedium]!(medium.jsValue()) + let this = jsObject + _ = this[Strings.appendMedium].function!(this: this, arguments: [medium.jsValue()]) } public func deleteMedium(medium: String) { - _ = jsObject[Strings.deleteMedium]!(medium.jsValue()) + let this = jsObject + _ = this[Strings.deleteMedium].function!(this: this, arguments: [medium.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/MediaRecorder.swift b/Sources/DOMKit/WebIDL/MediaRecorder.swift index 774d5378..2076a5b1 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorder.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorder.swift @@ -63,26 +63,32 @@ public class MediaRecorder: EventTarget { public var audioBitrateMode: BitrateMode public func start(timeslice: UInt32? = nil) { - _ = jsObject[Strings.start]!(timeslice?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.start].function!(this: this, arguments: [timeslice?.jsValue() ?? .undefined]) } public func stop() { - _ = jsObject[Strings.stop]!() + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) } public func pause() { - _ = jsObject[Strings.pause]!() + let this = jsObject + _ = this[Strings.pause].function!(this: this, arguments: []) } public func resume() { - _ = jsObject[Strings.resume]!() + let this = jsObject + _ = this[Strings.resume].function!(this: this, arguments: []) } public func requestData() { - _ = jsObject[Strings.requestData]!() + let this = jsObject + _ = this[Strings.requestData].function!(this: this, arguments: []) } public static func isTypeSupported(type: String) -> Bool { - constructor[Strings.isTypeSupported]!(type.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaSession.swift b/Sources/DOMKit/WebIDL/MediaSession.swift index d6780e7f..b57a5c29 100644 --- a/Sources/DOMKit/WebIDL/MediaSession.swift +++ b/Sources/DOMKit/WebIDL/MediaSession.swift @@ -23,14 +23,17 @@ public class MediaSession: JSBridgedClass { // XXX: member 'setActionHandler' is ignored public func setPositionState(state: MediaPositionState? = nil) { - _ = jsObject[Strings.setPositionState]!(state?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setPositionState].function!(this: this, arguments: [state?.jsValue() ?? .undefined]) } public func setMicrophoneActive(active: Bool) { - _ = jsObject[Strings.setMicrophoneActive]!(active.jsValue()) + let this = jsObject + _ = this[Strings.setMicrophoneActive].function!(this: this, arguments: [active.jsValue()]) } public func setCameraActive(active: Bool) { - _ = jsObject[Strings.setCameraActive]!(active.jsValue()) + let this = jsObject + _ = this[Strings.setCameraActive].function!(this: this, arguments: [active.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/MediaSource.swift b/Sources/DOMKit/WebIDL/MediaSource.swift index 36432de4..2fe5382c 100644 --- a/Sources/DOMKit/WebIDL/MediaSource.swift +++ b/Sources/DOMKit/WebIDL/MediaSource.swift @@ -47,26 +47,32 @@ public class MediaSource: EventTarget { public var canConstructInDedicatedWorker: Bool public func addSourceBuffer(type: String) -> SourceBuffer { - jsObject[Strings.addSourceBuffer]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.addSourceBuffer].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } public func removeSourceBuffer(sourceBuffer: SourceBuffer) { - _ = jsObject[Strings.removeSourceBuffer]!(sourceBuffer.jsValue()) + let this = jsObject + _ = this[Strings.removeSourceBuffer].function!(this: this, arguments: [sourceBuffer.jsValue()]) } public func endOfStream(error: EndOfStreamError? = nil) { - _ = jsObject[Strings.endOfStream]!(error?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.endOfStream].function!(this: this, arguments: [error?.jsValue() ?? .undefined]) } public func setLiveSeekableRange(start: Double, end: Double) { - _ = jsObject[Strings.setLiveSeekableRange]!(start.jsValue(), end.jsValue()) + let this = jsObject + _ = this[Strings.setLiveSeekableRange].function!(this: this, arguments: [start.jsValue(), end.jsValue()]) } public func clearLiveSeekableRange() { - _ = jsObject[Strings.clearLiveSeekableRange]!() + let this = jsObject + _ = this[Strings.clearLiveSeekableRange].function!(this: this, arguments: []) } public static func isTypeSupported(type: String) -> Bool { - constructor[Strings.isTypeSupported]!(type.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaStream.swift b/Sources/DOMKit/WebIDL/MediaStream.swift index 4bd60b46..3d6d7287 100644 --- a/Sources/DOMKit/WebIDL/MediaStream.swift +++ b/Sources/DOMKit/WebIDL/MediaStream.swift @@ -30,31 +30,38 @@ public class MediaStream: EventTarget { public var id: String public func getAudioTracks() -> [MediaStreamTrack] { - jsObject[Strings.getAudioTracks]!().fromJSValue()! + let this = jsObject + return this[Strings.getAudioTracks].function!(this: this, arguments: []).fromJSValue()! } public func getVideoTracks() -> [MediaStreamTrack] { - jsObject[Strings.getVideoTracks]!().fromJSValue()! + let this = jsObject + return this[Strings.getVideoTracks].function!(this: this, arguments: []).fromJSValue()! } public func getTracks() -> [MediaStreamTrack] { - jsObject[Strings.getTracks]!().fromJSValue()! + let this = jsObject + return this[Strings.getTracks].function!(this: this, arguments: []).fromJSValue()! } public func getTrackById(trackId: String) -> MediaStreamTrack? { - jsObject[Strings.getTrackById]!(trackId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getTrackById].function!(this: this, arguments: [trackId.jsValue()]).fromJSValue()! } public func addTrack(track: MediaStreamTrack) { - _ = jsObject[Strings.addTrack]!(track.jsValue()) + let this = jsObject + _ = this[Strings.addTrack].function!(this: this, arguments: [track.jsValue()]) } public func removeTrack(track: MediaStreamTrack) { - _ = jsObject[Strings.removeTrack]!(track.jsValue()) + let this = jsObject + _ = this[Strings.removeTrack].function!(this: this, arguments: [track.jsValue()]) } public func clone() -> Self { - jsObject[Strings.clone]!().fromJSValue()! + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift index 1fb0bea2..0b8f8ed6 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift @@ -50,32 +50,39 @@ public class MediaStreamTrack: EventTarget { public var onended: EventHandler public func clone() -> Self { - jsObject[Strings.clone]!().fromJSValue()! + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } public func stop() { - _ = jsObject[Strings.stop]!() + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) } public func getCapabilities() -> MediaTrackCapabilities { - jsObject[Strings.getCapabilities]!().fromJSValue()! + let this = jsObject + return this[Strings.getCapabilities].function!(this: this, arguments: []).fromJSValue()! } public func getConstraints() -> MediaTrackConstraints { - jsObject[Strings.getConstraints]!().fromJSValue()! + let this = jsObject + return this[Strings.getConstraints].function!(this: this, arguments: []).fromJSValue()! } public func getSettings() -> MediaTrackSettings { - jsObject[Strings.getSettings]!().fromJSValue()! + let this = jsObject + return this[Strings.getSettings].function!(this: this, arguments: []).fromJSValue()! } public func applyConstraints(constraints: MediaTrackConstraints? = nil) -> JSPromise { - jsObject[Strings.applyConstraints]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func applyConstraints(constraints: MediaTrackConstraints? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.applyConstraints]!(constraints?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.applyConstraints].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/Memory.swift b/Sources/DOMKit/WebIDL/Memory.swift index 519d273d..401b7555 100644 --- a/Sources/DOMKit/WebIDL/Memory.swift +++ b/Sources/DOMKit/WebIDL/Memory.swift @@ -18,7 +18,8 @@ public class Memory: JSBridgedClass { } public func grow(delta: UInt32) -> UInt32 { - jsObject[Strings.grow]!(delta.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.grow].function!(this: this, arguments: [delta.jsValue()]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift index d3e0bf9c..afbd5c88 100644 --- a/Sources/DOMKit/WebIDL/MessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -43,6 +43,7 @@ public class MessageEvent: Event { let _arg5 = lastEventId?.jsValue() ?? .undefined let _arg6 = source?.jsValue() ?? .undefined let _arg7 = ports?.jsValue() ?? .undefined - _ = jsObject[Strings.initMessageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.initMessageEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } } diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift index 80e199a0..cb9b8f5c 100644 --- a/Sources/DOMKit/WebIDL/MessagePort.swift +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -13,19 +13,23 @@ public class MessagePort: EventTarget { } public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } public func start() { - _ = jsObject[Strings.start]!() + let this = jsObject + _ = this[Strings.start].function!(this: this, arguments: []) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/Module.swift b/Sources/DOMKit/WebIDL/Module.swift index 9ff48642..5def7ead 100644 --- a/Sources/DOMKit/WebIDL/Module.swift +++ b/Sources/DOMKit/WebIDL/Module.swift @@ -17,14 +17,17 @@ public class Module: JSBridgedClass { } public static func exports(moduleObject: Module) -> [ModuleExportDescriptor] { - constructor[Strings.exports]!(moduleObject.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.exports].function!(this: this, arguments: [moduleObject.jsValue()]).fromJSValue()! } public static func imports(moduleObject: Module) -> [ModuleImportDescriptor] { - constructor[Strings.imports]!(moduleObject.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.imports].function!(this: this, arguments: [moduleObject.jsValue()]).fromJSValue()! } public static func customSections(moduleObject: Module, sectionName: String) -> [ArrayBuffer] { - constructor[Strings.customSections]!(moduleObject.jsValue(), sectionName.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.customSections].function!(this: this, arguments: [moduleObject.jsValue(), sectionName.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index e09f17d4..286ee3b6 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -91,7 +91,8 @@ public class MouseEvent: UIEvent { public var relatedTarget: EventTarget? public func getModifierState(keyArg: String) -> Bool { - jsObject[Strings.getModifierState]!(keyArg.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getModifierState].function!(this: this, arguments: [keyArg.jsValue()]).fromJSValue()! } public func initMouseEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil, screenXArg: Int32? = nil, screenYArg: Int32? = nil, clientXArg: Int32? = nil, clientYArg: Int32? = nil, ctrlKeyArg: Bool? = nil, altKeyArg: Bool? = nil, shiftKeyArg: Bool? = nil, metaKeyArg: Bool? = nil, buttonArg: Int16? = nil, relatedTargetArg: EventTarget? = nil) { @@ -110,6 +111,7 @@ public class MouseEvent: UIEvent { let _arg12 = metaKeyArg?.jsValue() ?? .undefined let _arg13 = buttonArg?.jsValue() ?? .undefined let _arg14 = relatedTargetArg?.jsValue() ?? .undefined - _ = jsObject[Strings.initMouseEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14) + let this = jsObject + _ = this[Strings.initMouseEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14]) } } diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift index 5ebb7996..31c2fcf9 100644 --- a/Sources/DOMKit/WebIDL/MutationEvent.swift +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -45,6 +45,7 @@ public class MutationEvent: Event { let _arg5 = newValueArg?.jsValue() ?? .undefined let _arg6 = attrNameArg?.jsValue() ?? .undefined let _arg7 = attrChangeArg?.jsValue() ?? .undefined - _ = jsObject[Strings.initMutationEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.initMutationEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } } diff --git a/Sources/DOMKit/WebIDL/MutationObserver.swift b/Sources/DOMKit/WebIDL/MutationObserver.swift index 7a0d68e1..aeaab047 100644 --- a/Sources/DOMKit/WebIDL/MutationObserver.swift +++ b/Sources/DOMKit/WebIDL/MutationObserver.swift @@ -15,14 +15,17 @@ public class MutationObserver: JSBridgedClass { // XXX: constructor is ignored public func observe(target: Node, options: MutationObserverInit? = nil) { - _ = jsObject[Strings.observe]!(target.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue(), options?.jsValue() ?? .undefined]) } public func disconnect() { - _ = jsObject[Strings.disconnect]!() + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: []) } public func takeRecords() -> [MutationRecord] { - jsObject[Strings.takeRecords]!().fromJSValue()! + let this = jsObject + return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NDEFReader.swift b/Sources/DOMKit/WebIDL/NDEFReader.swift index f486d39f..2a219425 100644 --- a/Sources/DOMKit/WebIDL/NDEFReader.swift +++ b/Sources/DOMKit/WebIDL/NDEFReader.swift @@ -23,32 +23,38 @@ public class NDEFReader: EventTarget { public var onreadingerror: EventHandler public func scan(options: NDEFScanOptions? = nil) -> JSPromise { - jsObject[Strings.scan]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.scan].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func scan(options: NDEFScanOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.scan]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.scan].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) -> JSPromise { - jsObject[Strings.write]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.write].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.write]!(message.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) -> JSPromise { - jsObject[Strings.makeReadOnly]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.makeReadOnly]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/NDEFRecord.swift b/Sources/DOMKit/WebIDL/NDEFRecord.swift index daff7fc9..b49d7d02 100644 --- a/Sources/DOMKit/WebIDL/NDEFRecord.swift +++ b/Sources/DOMKit/WebIDL/NDEFRecord.swift @@ -41,6 +41,7 @@ public class NDEFRecord: JSBridgedClass { public var lang: String? public func toRecords() -> [NDEFRecord]? { - jsObject[Strings.toRecords]!().fromJSValue()! + let this = jsObject + return this[Strings.toRecords].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NamedFlow.swift b/Sources/DOMKit/WebIDL/NamedFlow.swift index 6b6a46b2..4fc5e671 100644 --- a/Sources/DOMKit/WebIDL/NamedFlow.swift +++ b/Sources/DOMKit/WebIDL/NamedFlow.swift @@ -20,17 +20,20 @@ public class NamedFlow: EventTarget { public var overset: Bool public func getRegions() -> [Element] { - jsObject[Strings.getRegions]!().fromJSValue()! + let this = jsObject + return this[Strings.getRegions].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute public var firstEmptyRegionIndex: Int16 public func getContent() -> [Node] { - jsObject[Strings.getContent]!().fromJSValue()! + let this = jsObject + return this[Strings.getContent].function!(this: this, arguments: []).fromJSValue()! } public func getRegionsByContent(node: Node) -> [Element] { - jsObject[Strings.getRegionsByContent]!(node.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getRegionsByContent].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NamedNodeMap.swift b/Sources/DOMKit/WebIDL/NamedNodeMap.swift index 505061a9..369cc9f7 100644 --- a/Sources/DOMKit/WebIDL/NamedNodeMap.swift +++ b/Sources/DOMKit/WebIDL/NamedNodeMap.swift @@ -25,22 +25,27 @@ public class NamedNodeMap: JSBridgedClass { } public func getNamedItemNS(namespace: String?, localName: String) -> Attr? { - jsObject[Strings.getNamedItemNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getNamedItemNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } public func setNamedItem(attr: Attr) -> Attr? { - jsObject[Strings.setNamedItem]!(attr.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setNamedItem].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } public func setNamedItemNS(attr: Attr) -> Attr? { - jsObject[Strings.setNamedItemNS]!(attr.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setNamedItemNS].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } public func removeNamedItem(qualifiedName: String) -> Attr { - jsObject[Strings.removeNamedItem]!(qualifiedName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeNamedItem].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } public func removeNamedItemNS(namespace: String?, localName: String) -> Attr { - jsObject[Strings.removeNamedItemNS]!(namespace.jsValue(), localName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeNamedItemNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NavigateEvent.swift b/Sources/DOMKit/WebIDL/NavigateEvent.swift index bccceede..1baaabc1 100644 --- a/Sources/DOMKit/WebIDL/NavigateEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigateEvent.swift @@ -47,6 +47,7 @@ public class NavigateEvent: Event { public var info: JSValue public func transitionWhile(newNavigationAction: JSPromise) { - _ = jsObject[Strings.transitionWhile]!(newNavigationAction.jsValue()) + let this = jsObject + _ = this[Strings.transitionWhile].function!(this: this, arguments: [newNavigationAction.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/Navigation.swift b/Sources/DOMKit/WebIDL/Navigation.swift index 58f4146c..7668e2e9 100644 --- a/Sources/DOMKit/WebIDL/Navigation.swift +++ b/Sources/DOMKit/WebIDL/Navigation.swift @@ -19,14 +19,16 @@ public class Navigation: EventTarget { } public func entries() -> [NavigationHistoryEntry] { - jsObject[Strings.entries]!().fromJSValue()! + let this = jsObject + return this[Strings.entries].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute public var currentEntry: NavigationHistoryEntry? public func updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions) { - _ = jsObject[Strings.updateCurrentEntry]!(options.jsValue()) + let this = jsObject + _ = this[Strings.updateCurrentEntry].function!(this: this, arguments: [options.jsValue()]) } @ReadonlyAttribute @@ -39,23 +41,28 @@ public class Navigation: EventTarget { public var canGoForward: Bool public func navigate(url: String, options: NavigationNavigateOptions? = nil) -> NavigationResult { - jsObject[Strings.navigate]!(url.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.navigate].function!(this: this, arguments: [url.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func reload(options: NavigationReloadOptions? = nil) -> NavigationResult { - jsObject[Strings.reload]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.reload].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func traverseTo(key: String, options: NavigationOptions? = nil) -> NavigationResult { - jsObject[Strings.traverseTo]!(key.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.traverseTo].function!(this: this, arguments: [key.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func back(options: NavigationOptions? = nil) -> NavigationResult { - jsObject[Strings.back]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.back].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func forward(options: NavigationOptions? = nil) -> NavigationResult { - jsObject[Strings.forward]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.forward].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/NavigationDestination.swift b/Sources/DOMKit/WebIDL/NavigationDestination.swift index 35f1c806..b3eeac41 100644 --- a/Sources/DOMKit/WebIDL/NavigationDestination.swift +++ b/Sources/DOMKit/WebIDL/NavigationDestination.swift @@ -33,6 +33,7 @@ public class NavigationDestination: JSBridgedClass { public var sameDocument: Bool public func getState() -> JSValue { - jsObject[Strings.getState]!().fromJSValue()! + let this = jsObject + return this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift b/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift index 3c0810c3..bb6532ca 100644 --- a/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift +++ b/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift @@ -35,7 +35,8 @@ public class NavigationHistoryEntry: EventTarget { public var sameDocument: Bool public func getState() -> JSValue { - jsObject[Strings.getState]!().fromJSValue()! + let this = jsObject + return this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift b/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift index b92d2044..717d4642 100644 --- a/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift +++ b/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift @@ -13,42 +13,50 @@ public class NavigationPreloadManager: JSBridgedClass { } public func enable() -> JSPromise { - jsObject[Strings.enable]!().fromJSValue()! + let this = jsObject + return this[Strings.enable].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func enable() async throws { - let _promise: JSPromise = jsObject[Strings.enable]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.enable].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func disable() -> JSPromise { - jsObject[Strings.disable]!().fromJSValue()! + let this = jsObject + return this[Strings.disable].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func disable() async throws { - let _promise: JSPromise = jsObject[Strings.disable]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.disable].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func setHeaderValue(value: String) -> JSPromise { - jsObject[Strings.setHeaderValue]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setHeaderValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func setHeaderValue(value: String) async throws { - let _promise: JSPromise = jsObject[Strings.setHeaderValue]!(value.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.setHeaderValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func getState() -> JSPromise { - jsObject[Strings.getState]!().fromJSValue()! + let this = jsObject + return this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getState() async throws -> NavigationPreloadState { - let _promise: JSPromise = jsObject[Strings.getState]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NavigationTransition.swift b/Sources/DOMKit/WebIDL/NavigationTransition.swift index 2467d686..3e46c701 100644 --- a/Sources/DOMKit/WebIDL/NavigationTransition.swift +++ b/Sources/DOMKit/WebIDL/NavigationTransition.swift @@ -25,6 +25,7 @@ public class NavigationTransition: JSBridgedClass { public var finished: JSPromise public func rollback(options: NavigationOptions? = nil) -> NavigationResult { - jsObject[Strings.rollback]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.rollback].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index f9195bdd..c0bc04fd 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -36,49 +36,59 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N } public func getAutoplayPolicy(type: AutoplayPolicyMediaType) -> AutoplayPolicy { - jsObject[Strings.getAutoplayPolicy]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } public func getAutoplayPolicy(element: HTMLMediaElement) -> AutoplayPolicy { - jsObject[Strings.getAutoplayPolicy]!(element.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! } public func getAutoplayPolicy(context: AudioContext) -> AutoplayPolicy { - jsObject[Strings.getAutoplayPolicy]!(context.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [context.jsValue()]).fromJSValue()! } public func setClientBadge(contents: UInt64? = nil) -> JSPromise { - jsObject[Strings.setClientBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func setClientBadge(contents: UInt64? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.setClientBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func clearClientBadge() -> JSPromise { - jsObject[Strings.clearClientBadge]!().fromJSValue()! + let this = jsObject + return this[Strings.clearClientBadge].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func clearClientBadge() async throws { - let _promise: JSPromise = jsObject[Strings.clearClientBadge]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.clearClientBadge].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func getBattery() -> JSPromise { - jsObject[Strings.getBattery]!().fromJSValue()! + let this = jsObject + return this[Strings.getBattery].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getBattery() async throws -> BatteryManager { - let _promise: JSPromise = jsObject[Strings.getBattery]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getBattery].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { - jsObject[Strings.sendBeacon]!(url.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.sendBeacon].function!(this: this, arguments: [url.jsValue(), data?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -94,29 +104,34 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N public var devicePosture: DevicePosture public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { - jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue(), supportedConfigurations.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { - let _promise: JSPromise = jsObject[Strings.requestMediaKeySystemAccess]!(keySystem.jsValue(), supportedConfigurations.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue(), supportedConfigurations.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getGamepads() -> [Gamepad?] { - jsObject[Strings.getGamepads]!().fromJSValue()! + let this = jsObject + return this[Strings.getGamepads].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute public var geolocation: Geolocation public func getInstalledRelatedApps() -> JSPromise { - jsObject[Strings.getInstalledRelatedApps]!().fromJSValue()! + let this = jsObject + return this[Strings.getInstalledRelatedApps].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getInstalledRelatedApps() async throws -> [RelatedApplication] { - let _promise: JSPromise = jsObject[Strings.getInstalledRelatedApps]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getInstalledRelatedApps].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -159,7 +174,8 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N public var serviceWorker: ServiceWorkerContainer public func vibrate(pattern: VibratePattern) -> Bool { - jsObject[Strings.vibrate]!(pattern.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.vibrate].function!(this: this, arguments: [pattern.jsValue()]).fromJSValue()! } @ReadonlyAttribute @@ -169,29 +185,34 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N public var bluetooth: Bluetooth public func share(data: ShareData? = nil) -> JSPromise { - jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.share].function!(this: this, arguments: [data?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func share(data: ShareData? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.share]!(data?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.share].function!(this: this, arguments: [data?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func canShare(data: ShareData? = nil) -> Bool { - jsObject[Strings.canShare]!(data?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.canShare].function!(this: this, arguments: [data?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute public var hid: HID public func requestMIDIAccess(options: MIDIOptions? = nil) -> JSPromise { - jsObject[Strings.requestMIDIAccess]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestMIDIAccess(options: MIDIOptions? = nil) async throws -> MIDIAccess { - let _promise: JSPromise = jsObject[Strings.requestMIDIAccess]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/NavigatorBadge.swift b/Sources/DOMKit/WebIDL/NavigatorBadge.swift index e99c4b63..2596064d 100644 --- a/Sources/DOMKit/WebIDL/NavigatorBadge.swift +++ b/Sources/DOMKit/WebIDL/NavigatorBadge.swift @@ -6,22 +6,26 @@ import JavaScriptKit public protocol NavigatorBadge: JSBridgedClass {} public extension NavigatorBadge { func setAppBadge(contents: UInt64? = nil) -> JSPromise { - jsObject[Strings.setAppBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func setAppBadge(contents: UInt64? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.setAppBadge]!(contents?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } func clearAppBadge() -> JSPromise { - jsObject[Strings.clearAppBadge]!().fromJSValue()! + let this = jsObject + return this[Strings.clearAppBadge].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func clearAppBadge() async throws { - let _promise: JSPromise = jsObject[Strings.clearAppBadge]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.clearAppBadge].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift index e5ae39fb..f6d01b9d 100644 --- a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift +++ b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift @@ -6,10 +6,12 @@ import JavaScriptKit public protocol NavigatorContentUtils: JSBridgedClass {} public extension NavigatorContentUtils { func registerProtocolHandler(scheme: String, url: String) { - _ = jsObject[Strings.registerProtocolHandler]!(scheme.jsValue(), url.jsValue()) + let this = jsObject + _ = this[Strings.registerProtocolHandler].function!(this: this, arguments: [scheme.jsValue(), url.jsValue()]) } func unregisterProtocolHandler(scheme: String, url: String) { - _ = jsObject[Strings.unregisterProtocolHandler]!(scheme.jsValue(), url.jsValue()) + let this = jsObject + _ = this[Strings.unregisterProtocolHandler].function!(this: this, arguments: [scheme.jsValue(), url.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/NavigatorID.swift b/Sources/DOMKit/WebIDL/NavigatorID.swift index 5d099c91..3f128934 100644 --- a/Sources/DOMKit/WebIDL/NavigatorID.swift +++ b/Sources/DOMKit/WebIDL/NavigatorID.swift @@ -24,7 +24,8 @@ public extension NavigatorID { var vendorSub: String { ReadonlyAttribute[Strings.vendorSub, in: jsObject] } func taintEnabled() -> Bool { - jsObject[Strings.taintEnabled]!().fromJSValue()! + let this = jsObject + return this[Strings.taintEnabled].function!(this: this, arguments: []).fromJSValue()! } var oscpu: String { ReadonlyAttribute[Strings.oscpu, in: jsObject] } diff --git a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift index 70d97440..691b9838 100644 --- a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift +++ b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift @@ -10,7 +10,8 @@ public extension NavigatorPlugins { var mimeTypes: MimeTypeArray { ReadonlyAttribute[Strings.mimeTypes, in: jsObject] } func javaEnabled() -> Bool { - jsObject[Strings.javaEnabled]!().fromJSValue()! + let this = jsObject + return this[Strings.javaEnabled].function!(this: this, arguments: []).fromJSValue()! } var pdfViewerEnabled: Bool { ReadonlyAttribute[Strings.pdfViewerEnabled, in: jsObject] } diff --git a/Sources/DOMKit/WebIDL/NavigatorUAData.swift b/Sources/DOMKit/WebIDL/NavigatorUAData.swift index c35f5cea..363c2e9e 100644 --- a/Sources/DOMKit/WebIDL/NavigatorUAData.swift +++ b/Sources/DOMKit/WebIDL/NavigatorUAData.swift @@ -25,16 +25,19 @@ public class NavigatorUAData: JSBridgedClass { public var platform: String public func getHighEntropyValues(hints: [String]) -> JSPromise { - jsObject[Strings.getHighEntropyValues]!(hints.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getHighEntropyValues(hints: [String]) async throws -> UADataValues { - let _promise: JSPromise = jsObject[Strings.getHighEntropyValues]!(hints.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func toJSON() -> UALowEntropyJSON { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Node.swift b/Sources/DOMKit/WebIDL/Node.swift index 6b7146c2..698c80cc 100644 --- a/Sources/DOMKit/WebIDL/Node.swift +++ b/Sources/DOMKit/WebIDL/Node.swift @@ -64,7 +64,8 @@ public class Node: EventTarget { public var ownerDocument: Document? public func getRootNode(options: GetRootNodeOptions? = nil) -> Self { - jsObject[Strings.getRootNode]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getRootNode].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -74,7 +75,8 @@ public class Node: EventTarget { public var parentElement: Element? public func hasChildNodes() -> Bool { - jsObject[Strings.hasChildNodes]!().fromJSValue()! + let this = jsObject + return this[Strings.hasChildNodes].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute @@ -99,19 +101,23 @@ public class Node: EventTarget { public var textContent: String? public func normalize() { - _ = jsObject[Strings.normalize]!() + let this = jsObject + _ = this[Strings.normalize].function!(this: this, arguments: []) } public func cloneNode(deep: Bool? = nil) -> Self { - jsObject[Strings.cloneNode]!(deep?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.cloneNode].function!(this: this, arguments: [deep?.jsValue() ?? .undefined]).fromJSValue()! } public func isEqualNode(otherNode: Node?) -> Bool { - jsObject[Strings.isEqualNode]!(otherNode.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isEqualNode].function!(this: this, arguments: [otherNode.jsValue()]).fromJSValue()! } public func isSameNode(otherNode: Node?) -> Bool { - jsObject[Strings.isSameNode]!(otherNode.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isSameNode].function!(this: this, arguments: [otherNode.jsValue()]).fromJSValue()! } public static let DOCUMENT_POSITION_DISCONNECTED: UInt16 = 0x01 @@ -127,38 +133,47 @@ public class Node: EventTarget { public static let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: UInt16 = 0x20 public func compareDocumentPosition(other: Node) -> UInt16 { - jsObject[Strings.compareDocumentPosition]!(other.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.compareDocumentPosition].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! } public func contains(other: Node?) -> Bool { - jsObject[Strings.contains]!(other.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.contains].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! } public func lookupPrefix(namespace: String?) -> String? { - jsObject[Strings.lookupPrefix]!(namespace.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.lookupPrefix].function!(this: this, arguments: [namespace.jsValue()]).fromJSValue()! } public func lookupNamespaceURI(prefix: String?) -> String? { - jsObject[Strings.lookupNamespaceURI]!(prefix.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.lookupNamespaceURI].function!(this: this, arguments: [prefix.jsValue()]).fromJSValue()! } public func isDefaultNamespace(namespace: String?) -> Bool { - jsObject[Strings.isDefaultNamespace]!(namespace.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isDefaultNamespace].function!(this: this, arguments: [namespace.jsValue()]).fromJSValue()! } public func insertBefore(node: Node, child: Node?) -> Self { - jsObject[Strings.insertBefore]!(node.jsValue(), child.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.insertBefore].function!(this: this, arguments: [node.jsValue(), child.jsValue()]).fromJSValue()! } public func appendChild(node: Node) -> Self { - jsObject[Strings.appendChild]!(node.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.appendChild].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! } public func replaceChild(node: Node, child: Node) -> Self { - jsObject[Strings.replaceChild]!(node.jsValue(), child.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.replaceChild].function!(this: this, arguments: [node.jsValue(), child.jsValue()]).fromJSValue()! } public func removeChild(child: Node) -> Self { - jsObject[Strings.removeChild]!(child.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeChild].function!(this: this, arguments: [child.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NodeIterator.swift b/Sources/DOMKit/WebIDL/NodeIterator.swift index 4aeee232..0258f743 100644 --- a/Sources/DOMKit/WebIDL/NodeIterator.swift +++ b/Sources/DOMKit/WebIDL/NodeIterator.swift @@ -31,14 +31,17 @@ public class NodeIterator: JSBridgedClass { // XXX: member 'filter' is ignored public func nextNode() -> Node? { - jsObject[Strings.nextNode]!().fromJSValue()! + let this = jsObject + return this[Strings.nextNode].function!(this: this, arguments: []).fromJSValue()! } public func previousNode() -> Node? { - jsObject[Strings.previousNode]!().fromJSValue()! + let this = jsObject + return this[Strings.previousNode].function!(this: this, arguments: []).fromJSValue()! } public func detach() { - _ = jsObject[Strings.detach]!() + let this = jsObject + _ = this[Strings.detach].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/NonElementParentNode.swift b/Sources/DOMKit/WebIDL/NonElementParentNode.swift index 6fb68a12..7194dd86 100644 --- a/Sources/DOMKit/WebIDL/NonElementParentNode.swift +++ b/Sources/DOMKit/WebIDL/NonElementParentNode.swift @@ -6,6 +6,7 @@ import JavaScriptKit public protocol NonElementParentNode: JSBridgedClass {} public extension NonElementParentNode { func getElementById(elementId: String) -> Element? { - jsObject[Strings.getElementById]!(elementId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getElementById].function!(this: this, arguments: [elementId.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Notification.swift b/Sources/DOMKit/WebIDL/Notification.swift index 8c88f7a9..f8390437 100644 --- a/Sources/DOMKit/WebIDL/Notification.swift +++ b/Sources/DOMKit/WebIDL/Notification.swift @@ -103,6 +103,7 @@ public class Notification: EventTarget { public var actions: [NotificationAction] public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift b/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift index 99a90dce..8941afff 100644 --- a/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift +++ b/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift @@ -13,30 +13,37 @@ public class OES_draw_buffers_indexed: JSBridgedClass { } public func enableiOES(target: GLenum, index: GLuint) { - _ = jsObject[Strings.enableiOES]!(target.jsValue(), index.jsValue()) + let this = jsObject + _ = this[Strings.enableiOES].function!(this: this, arguments: [target.jsValue(), index.jsValue()]) } public func disableiOES(target: GLenum, index: GLuint) { - _ = jsObject[Strings.disableiOES]!(target.jsValue(), index.jsValue()) + let this = jsObject + _ = this[Strings.disableiOES].function!(this: this, arguments: [target.jsValue(), index.jsValue()]) } public func blendEquationiOES(buf: GLuint, mode: GLenum) { - _ = jsObject[Strings.blendEquationiOES]!(buf.jsValue(), mode.jsValue()) + let this = jsObject + _ = this[Strings.blendEquationiOES].function!(this: this, arguments: [buf.jsValue(), mode.jsValue()]) } public func blendEquationSeparateiOES(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum) { - _ = jsObject[Strings.blendEquationSeparateiOES]!(buf.jsValue(), modeRGB.jsValue(), modeAlpha.jsValue()) + let this = jsObject + _ = this[Strings.blendEquationSeparateiOES].function!(this: this, arguments: [buf.jsValue(), modeRGB.jsValue(), modeAlpha.jsValue()]) } public func blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum) { - _ = jsObject[Strings.blendFunciOES]!(buf.jsValue(), src.jsValue(), dst.jsValue()) + let this = jsObject + _ = this[Strings.blendFunciOES].function!(this: this, arguments: [buf.jsValue(), src.jsValue(), dst.jsValue()]) } public func blendFuncSeparateiOES(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { - _ = jsObject[Strings.blendFuncSeparateiOES]!(buf.jsValue(), srcRGB.jsValue(), dstRGB.jsValue(), srcAlpha.jsValue(), dstAlpha.jsValue()) + let this = jsObject + _ = this[Strings.blendFuncSeparateiOES].function!(this: this, arguments: [buf.jsValue(), srcRGB.jsValue(), dstRGB.jsValue(), srcAlpha.jsValue(), dstAlpha.jsValue()]) } public func colorMaskiOES(buf: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean) { - _ = jsObject[Strings.colorMaskiOES]!(buf.jsValue(), r.jsValue(), g.jsValue(), b.jsValue(), a.jsValue()) + let this = jsObject + _ = this[Strings.colorMaskiOES].function!(this: this, arguments: [buf.jsValue(), r.jsValue(), g.jsValue(), b.jsValue(), a.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift b/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift index 6d61bffc..b011beed 100644 --- a/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift +++ b/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift @@ -15,18 +15,22 @@ public class OES_vertex_array_object: JSBridgedClass { public static let VERTEX_ARRAY_BINDING_OES: GLenum = 0x85B5 public func createVertexArrayOES() -> WebGLVertexArrayObjectOES? { - jsObject[Strings.createVertexArrayOES]!().fromJSValue()! + let this = jsObject + return this[Strings.createVertexArrayOES].function!(this: this, arguments: []).fromJSValue()! } public func deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { - _ = jsObject[Strings.deleteVertexArrayOES]!(arrayObject.jsValue()) + let this = jsObject + _ = this[Strings.deleteVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue()]) } public func isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) -> GLboolean { - jsObject[Strings.isVertexArrayOES]!(arrayObject.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue()]).fromJSValue()! } public func bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { - _ = jsObject[Strings.bindVertexArrayOES]!(arrayObject.jsValue()) + let this = jsObject + _ = this[Strings.bindVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/OVR_multiview2.swift b/Sources/DOMKit/WebIDL/OVR_multiview2.swift index 276d15a6..f3be8e80 100644 --- a/Sources/DOMKit/WebIDL/OVR_multiview2.swift +++ b/Sources/DOMKit/WebIDL/OVR_multiview2.swift @@ -27,6 +27,7 @@ public class OVR_multiview2: JSBridgedClass { let _arg3 = level.jsValue() let _arg4 = baseViewIndex.jsValue() let _arg5 = numViews.jsValue() - _ = jsObject[Strings.framebufferTextureMultiviewOVR]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.framebufferTextureMultiviewOVR].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } } diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift index 1bf64fe7..3a4111a1 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift @@ -21,32 +21,38 @@ public class OfflineAudioContext: BaseAudioContext { } public func startRendering() -> JSPromise { - jsObject[Strings.startRendering]!().fromJSValue()! + let this = jsObject + return this[Strings.startRendering].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func startRendering() async throws -> AudioBuffer { - let _promise: JSPromise = jsObject[Strings.startRendering]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.startRendering].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func resume() -> JSPromise { - jsObject[Strings.resume]!().fromJSValue()! + let this = jsObject + return this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func resume() async throws { - let _promise: JSPromise = jsObject[Strings.resume]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func suspend(suspendTime: Double) -> JSPromise { - jsObject[Strings.suspend]!(suspendTime.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func suspend(suspendTime: Double) async throws { - let _promise: JSPromise = jsObject[Strings.suspend]!(suspendTime.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue()]).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift index baafbc04..3d6ac04b 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -25,20 +25,24 @@ public class OffscreenCanvas: EventTarget { public var height: UInt64 public func getContext(contextId: OffscreenRenderingContextId, options: JSValue? = nil) -> OffscreenRenderingContext? { - jsObject[Strings.getContext]!(contextId.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getContext].function!(this: this, arguments: [contextId.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func transferToImageBitmap() -> ImageBitmap { - jsObject[Strings.transferToImageBitmap]!().fromJSValue()! + let this = jsObject + return this[Strings.transferToImageBitmap].function!(this: this, arguments: []).fromJSValue()! } public func convertToBlob(options: ImageEncodeOptions? = nil) -> JSPromise { - jsObject[Strings.convertToBlob]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.convertToBlob].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func convertToBlob(options: ImageEncodeOptions? = nil) async throws -> Blob { - let _promise: JSPromise = jsObject[Strings.convertToBlob]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.convertToBlob].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift index a92c808c..8bebfcf1 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift @@ -14,7 +14,8 @@ public class OffscreenCanvasRenderingContext2D: JSBridgedClass, CanvasState, Can } public func commit() { - _ = jsObject[Strings.commit]!() + let this = jsObject + _ = this[Strings.commit].function!(this: this, arguments: []) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/OrientationSensor.swift b/Sources/DOMKit/WebIDL/OrientationSensor.swift index ceb6ca3a..943402b9 100644 --- a/Sources/DOMKit/WebIDL/OrientationSensor.swift +++ b/Sources/DOMKit/WebIDL/OrientationSensor.swift @@ -15,6 +15,7 @@ public class OrientationSensor: Sensor { public var quaternion: [Double]? public func populateMatrix(targetMatrix: RotationMatrixType) { - _ = jsObject[Strings.populateMatrix]!(targetMatrix.jsValue()) + let this = jsObject + _ = this[Strings.populateMatrix].function!(this: this, arguments: [targetMatrix.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/OscillatorNode.swift b/Sources/DOMKit/WebIDL/OscillatorNode.swift index f93938f5..0bae167f 100644 --- a/Sources/DOMKit/WebIDL/OscillatorNode.swift +++ b/Sources/DOMKit/WebIDL/OscillatorNode.swift @@ -27,6 +27,7 @@ public class OscillatorNode: AudioScheduledSourceNode { public var detune: AudioParam public func setPeriodicWave(periodicWave: PeriodicWave) { - _ = jsObject[Strings.setPeriodicWave]!(periodicWave.jsValue()) + let this = jsObject + _ = this[Strings.setPeriodicWave].function!(this: this, arguments: [periodicWave.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/PannerNode.swift b/Sources/DOMKit/WebIDL/PannerNode.swift index 54bb6d43..66898721 100644 --- a/Sources/DOMKit/WebIDL/PannerNode.swift +++ b/Sources/DOMKit/WebIDL/PannerNode.swift @@ -71,10 +71,12 @@ public class PannerNode: AudioNode { public var coneOuterGain: Double public func setPosition(x: Float, y: Float, z: Float) { - _ = jsObject[Strings.setPosition]!(x.jsValue(), y.jsValue(), z.jsValue()) + let this = jsObject + _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue(), y.jsValue(), z.jsValue()]) } public func setOrientation(x: Float, y: Float, z: Float) { - _ = jsObject[Strings.setOrientation]!(x.jsValue(), y.jsValue(), z.jsValue()) + let this = jsObject + _ = this[Strings.setOrientation].function!(this: this, arguments: [x.jsValue(), y.jsValue(), z.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/ParentNode.swift b/Sources/DOMKit/WebIDL/ParentNode.swift index 9f1a4041..7dc59a09 100644 --- a/Sources/DOMKit/WebIDL/ParentNode.swift +++ b/Sources/DOMKit/WebIDL/ParentNode.swift @@ -14,22 +14,27 @@ public extension ParentNode { var childElementCount: UInt32 { ReadonlyAttribute[Strings.childElementCount, in: jsObject] } func prepend(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Strings.prepend]!(nodes.jsValue()) + let this = jsObject + _ = this[Strings.prepend].function!(this: this, arguments: nodes.map { $0.jsValue() }) } func append(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Strings.append]!(nodes.jsValue()) + let this = jsObject + _ = this[Strings.append].function!(this: this, arguments: nodes.map { $0.jsValue() }) } func replaceChildren(nodes: __UNSUPPORTED_UNION__...) { - _ = jsObject[Strings.replaceChildren]!(nodes.jsValue()) + let this = jsObject + _ = this[Strings.replaceChildren].function!(this: this, arguments: nodes.map { $0.jsValue() }) } func querySelector(selectors: String) -> Element? { - jsObject[Strings.querySelector]!(selectors.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.querySelector].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } func querySelectorAll(selectors: String) -> NodeList { - jsObject[Strings.querySelectorAll]!(selectors.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.querySelectorAll].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index e2447d36..0cd9d6ce 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -17,6 +17,7 @@ public class Path2D: JSBridgedClass, CanvasPath { } public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { - _ = jsObject[Strings.addPath]!(path.jsValue(), transform?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.addPath].function!(this: this, arguments: [path.jsValue(), transform?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/PaymentInstruments.swift b/Sources/DOMKit/WebIDL/PaymentInstruments.swift index 2e342ca9..466ec1ac 100644 --- a/Sources/DOMKit/WebIDL/PaymentInstruments.swift +++ b/Sources/DOMKit/WebIDL/PaymentInstruments.swift @@ -13,62 +13,74 @@ public class PaymentInstruments: JSBridgedClass { } public func delete(instrumentKey: String) -> JSPromise { - jsObject[Strings.delete]!(instrumentKey.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func delete(instrumentKey: String) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.delete]!(instrumentKey.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func get(instrumentKey: String) -> JSPromise { - jsObject[Strings.get]!(instrumentKey.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func get(instrumentKey: String) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.get]!(instrumentKey.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func keys() -> JSPromise { - jsObject[Strings.keys]!().fromJSValue()! + let this = jsObject + return this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func keys() async throws -> [String] { - let _promise: JSPromise = jsObject[Strings.keys]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func has(instrumentKey: String) -> JSPromise { - jsObject[Strings.has]!(instrumentKey.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func has(instrumentKey: String) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.has]!(instrumentKey.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func set(instrumentKey: String, details: PaymentInstrument) -> JSPromise { - jsObject[Strings.set]!(instrumentKey.jsValue(), details.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue(), details.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func set(instrumentKey: String, details: PaymentInstrument) async throws { - let _promise: JSPromise = jsObject[Strings.set]!(instrumentKey.jsValue(), details.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue(), details.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func clear() -> JSPromise { - jsObject[Strings.clear]!().fromJSValue()! + let this = jsObject + return this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func clear() async throws { - let _promise: JSPromise = jsObject[Strings.clear]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/PaymentRequest.swift b/Sources/DOMKit/WebIDL/PaymentRequest.swift index 6be5c3d5..371befed 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequest.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequest.swift @@ -17,32 +17,38 @@ public class PaymentRequest: EventTarget { } public func show(detailsPromise: JSPromise? = nil) -> JSPromise { - jsObject[Strings.show]!(detailsPromise?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func show(detailsPromise: JSPromise? = nil) async throws -> PaymentResponse { - let _promise: JSPromise = jsObject[Strings.show]!(detailsPromise?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func abort() -> JSPromise { - jsObject[Strings.abort]!().fromJSValue()! + let this = jsObject + return this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func abort() async throws { - let _promise: JSPromise = jsObject[Strings.abort]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func canMakePayment() -> JSPromise { - jsObject[Strings.canMakePayment]!().fromJSValue()! + let this = jsObject + return this[Strings.canMakePayment].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func canMakePayment() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.canMakePayment]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.canMakePayment].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift index 816cc01b..8685ed9e 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift @@ -39,26 +39,31 @@ public class PaymentRequestEvent: ExtendableEvent { public var modifiers: [PaymentDetailsModifier] public func openWindow(url: String) -> JSPromise { - jsObject[Strings.openWindow]!(url.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func openWindow(url: String) async throws -> WindowClient? { - let _promise: JSPromise = jsObject[Strings.openWindow]!(url.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) -> JSPromise { - jsObject[Strings.changePaymentMethod]!(methodName.jsValue(), methodDetails?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.changePaymentMethod].function!(this: this, arguments: [methodName.jsValue(), methodDetails?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) async throws -> PaymentRequestDetailsUpdate? { - let _promise: JSPromise = jsObject[Strings.changePaymentMethod]!(methodName.jsValue(), methodDetails?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.changePaymentMethod].function!(this: this, arguments: [methodName.jsValue(), methodDetails?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func respondWith(handlerResponsePromise: JSPromise) { - _ = jsObject[Strings.respondWith]!(handlerResponsePromise.jsValue()) + let this = jsObject + _ = this[Strings.respondWith].function!(this: this, arguments: [handlerResponsePromise.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift index c384e263..6d4827ed 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift @@ -15,6 +15,7 @@ public class PaymentRequestUpdateEvent: Event { } public func updateWith(detailsPromise: JSPromise) { - _ = jsObject[Strings.updateWith]!(detailsPromise.jsValue()) + let this = jsObject + _ = this[Strings.updateWith].function!(this: this, arguments: [detailsPromise.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/PaymentResponse.swift b/Sources/DOMKit/WebIDL/PaymentResponse.swift index 93a86f7b..60d1a3c5 100644 --- a/Sources/DOMKit/WebIDL/PaymentResponse.swift +++ b/Sources/DOMKit/WebIDL/PaymentResponse.swift @@ -14,7 +14,8 @@ public class PaymentResponse: EventTarget { } public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute @@ -27,22 +28,26 @@ public class PaymentResponse: EventTarget { public var details: JSObject public func complete(result: PaymentComplete? = nil) -> JSPromise { - jsObject[Strings.complete]!(result?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.complete].function!(this: this, arguments: [result?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func complete(result: PaymentComplete? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.complete]!(result?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.complete].function!(this: this, arguments: [result?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func retry(errorFields: PaymentValidationErrors? = nil) -> JSPromise { - jsObject[Strings.retry]!(errorFields?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func retry(errorFields: PaymentValidationErrors? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.retry]!(errorFields?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index 243007d8..9c30b892 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -23,14 +23,16 @@ public class Performance: EventTarget { public var interactionCounts: InteractionCounts public func now() -> DOMHighResTimeStamp { - jsObject[Strings.now]!().fromJSValue()! + let this = jsObject + return this[Strings.now].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute public var timeOrigin: DOMHighResTimeStamp public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute @@ -40,51 +42,62 @@ public class Performance: EventTarget { public var navigation: PerformanceNavigation public func measureUserAgentSpecificMemory() -> JSPromise { - jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! + let this = jsObject + return this[Strings.measureUserAgentSpecificMemory].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { - let _promise: JSPromise = jsObject[Strings.measureUserAgentSpecificMemory]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.measureUserAgentSpecificMemory].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getEntries() -> PerformanceEntryList { - jsObject[Strings.getEntries]!().fromJSValue()! + let this = jsObject + return this[Strings.getEntries].function!(this: this, arguments: []).fromJSValue()! } public func getEntriesByType(type: String) -> PerformanceEntryList { - jsObject[Strings.getEntriesByType]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { - jsObject[Strings.getEntriesByName]!(name.jsValue(), type?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue(), type?.jsValue() ?? .undefined]).fromJSValue()! } public func clearResourceTimings() { - _ = jsObject[Strings.clearResourceTimings]!() + let this = jsObject + _ = this[Strings.clearResourceTimings].function!(this: this, arguments: []) } public func setResourceTimingBufferSize(maxSize: UInt32) { - _ = jsObject[Strings.setResourceTimingBufferSize]!(maxSize.jsValue()) + let this = jsObject + _ = this[Strings.setResourceTimingBufferSize].function!(this: this, arguments: [maxSize.jsValue()]) } @ClosureAttribute1Optional public var onresourcetimingbufferfull: EventHandler public func mark(markName: String, markOptions: PerformanceMarkOptions? = nil) -> PerformanceMark { - jsObject[Strings.mark]!(markName.jsValue(), markOptions?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.mark].function!(this: this, arguments: [markName.jsValue(), markOptions?.jsValue() ?? .undefined]).fromJSValue()! } public func clearMarks(markName: String? = nil) { - _ = jsObject[Strings.clearMarks]!(markName?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clearMarks].function!(this: this, arguments: [markName?.jsValue() ?? .undefined]) } public func measure(measureName: String, startOrMeasureOptions: __UNSUPPORTED_UNION__? = nil, endMark: String? = nil) -> PerformanceMeasure { - jsObject[Strings.measure]!(measureName.jsValue(), startOrMeasureOptions?.jsValue() ?? .undefined, endMark?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.measure].function!(this: this, arguments: [measureName.jsValue(), startOrMeasureOptions?.jsValue() ?? .undefined, endMark?.jsValue() ?? .undefined]).fromJSValue()! } public func clearMeasures(measureName: String? = nil) { - _ = jsObject[Strings.clearMeasures]!(measureName?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clearMeasures].function!(this: this, arguments: [measureName?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift b/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift index 687f8962..80165c12 100644 --- a/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift @@ -47,6 +47,7 @@ public class PerformanceElementTiming: PerformanceEntry { public var url: String override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PerformanceEntry.swift b/Sources/DOMKit/WebIDL/PerformanceEntry.swift index 8067ed70..09e721c0 100644 --- a/Sources/DOMKit/WebIDL/PerformanceEntry.swift +++ b/Sources/DOMKit/WebIDL/PerformanceEntry.swift @@ -29,6 +29,7 @@ public class PerformanceEntry: JSBridgedClass { public var duration: DOMHighResTimeStamp public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift b/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift index 12dc737f..aaf22b98 100644 --- a/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift @@ -31,6 +31,7 @@ public class PerformanceEventTiming: PerformanceEntry { public var interactionId: UInt64 override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift b/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift index b3087e7e..dda9421e 100644 --- a/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift @@ -15,6 +15,7 @@ public class PerformanceLongTaskTiming: PerformanceEntry { public var attribution: [TaskAttributionTiming] override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PerformanceNavigation.swift b/Sources/DOMKit/WebIDL/PerformanceNavigation.swift index 2cc4ef59..a861efe3 100644 --- a/Sources/DOMKit/WebIDL/PerformanceNavigation.swift +++ b/Sources/DOMKit/WebIDL/PerformanceNavigation.swift @@ -29,6 +29,7 @@ public class PerformanceNavigation: JSBridgedClass { public var redirectCount: UInt16 public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift b/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift index e7574120..3ca38100 100644 --- a/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift @@ -51,6 +51,7 @@ public class PerformanceNavigationTiming: PerformanceResourceTiming { public var redirectCount: UInt16 override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PerformanceObserver.swift b/Sources/DOMKit/WebIDL/PerformanceObserver.swift index 4ae25b66..67d2570c 100644 --- a/Sources/DOMKit/WebIDL/PerformanceObserver.swift +++ b/Sources/DOMKit/WebIDL/PerformanceObserver.swift @@ -16,15 +16,18 @@ public class PerformanceObserver: JSBridgedClass { // XXX: constructor is ignored public func observe(options: PerformanceObserverInit? = nil) { - _ = jsObject[Strings.observe]!(options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.observe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } public func disconnect() { - _ = jsObject[Strings.disconnect]!() + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: []) } public func takeRecords() -> PerformanceEntryList { - jsObject[Strings.takeRecords]!().fromJSValue()! + let this = jsObject + return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift b/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift index ea733f35..de1ec84c 100644 --- a/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift +++ b/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift @@ -13,14 +13,17 @@ public class PerformanceObserverEntryList: JSBridgedClass { } public func getEntries() -> PerformanceEntryList { - jsObject[Strings.getEntries]!().fromJSValue()! + let this = jsObject + return this[Strings.getEntries].function!(this: this, arguments: []).fromJSValue()! } public func getEntriesByType(type: String) -> PerformanceEntryList { - jsObject[Strings.getEntriesByType]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { - jsObject[Strings.getEntriesByName]!(name.jsValue(), type?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue(), type?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift b/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift index cbfbf698..11abf652 100644 --- a/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift @@ -80,7 +80,8 @@ public class PerformanceResourceTiming: PerformanceEntry { public var decodedBodySize: UInt64 override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift b/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift index be8be52e..a3cccf9d 100644 --- a/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift @@ -25,6 +25,7 @@ public class PerformanceServerTiming: JSBridgedClass { public var description: String public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PerformanceTiming.swift b/Sources/DOMKit/WebIDL/PerformanceTiming.swift index 9b768f29..a20c12a1 100644 --- a/Sources/DOMKit/WebIDL/PerformanceTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceTiming.swift @@ -97,6 +97,7 @@ public class PerformanceTiming: JSBridgedClass { public var loadEventEnd: UInt64 public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift b/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift index a8122aed..7cfc9205 100644 --- a/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift +++ b/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift @@ -13,32 +13,38 @@ public class PeriodicSyncManager: JSBridgedClass { } public func register(tag: String, options: BackgroundSyncOptions? = nil) -> JSPromise { - jsObject[Strings.register]!(tag.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.register].function!(this: this, arguments: [tag.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func register(tag: String, options: BackgroundSyncOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.register]!(tag.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func getTags() -> JSPromise { - jsObject[Strings.getTags]!().fromJSValue()! + let this = jsObject + return this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getTags() async throws -> [String] { - let _promise: JSPromise = jsObject[Strings.getTags]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func unregister(tag: String) -> JSPromise { - jsObject[Strings.unregister]!(tag.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.unregister].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func unregister(tag: String) async throws { - let _promise: JSPromise = jsObject[Strings.unregister]!(tag.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.unregister].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/Permissions.swift b/Sources/DOMKit/WebIDL/Permissions.swift index 9b7de54f..b06a165e 100644 --- a/Sources/DOMKit/WebIDL/Permissions.swift +++ b/Sources/DOMKit/WebIDL/Permissions.swift @@ -13,32 +13,38 @@ public class Permissions: JSBridgedClass { } public func request(permissionDesc: JSObject) -> JSPromise { - jsObject[Strings.request]!(permissionDesc.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func request(permissionDesc: JSObject) async throws -> PermissionStatus { - let _promise: JSPromise = jsObject[Strings.request]!(permissionDesc.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func revoke(permissionDesc: JSObject) -> JSPromise { - jsObject[Strings.revoke]!(permissionDesc.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func revoke(permissionDesc: JSObject) async throws -> PermissionStatus { - let _promise: JSPromise = jsObject[Strings.revoke]!(permissionDesc.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func query(permissionDesc: JSObject) -> JSPromise { - jsObject[Strings.query]!(permissionDesc.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func query(permissionDesc: JSObject) async throws -> PermissionStatus { - let _promise: JSPromise = jsObject[Strings.query]!(permissionDesc.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PermissionsPolicy.swift b/Sources/DOMKit/WebIDL/PermissionsPolicy.swift index fe14f767..887f6d7d 100644 --- a/Sources/DOMKit/WebIDL/PermissionsPolicy.swift +++ b/Sources/DOMKit/WebIDL/PermissionsPolicy.swift @@ -13,18 +13,22 @@ public class PermissionsPolicy: JSBridgedClass { } public func allowsFeature(feature: String, origin: String? = nil) -> Bool { - jsObject[Strings.allowsFeature]!(feature.jsValue(), origin?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.allowsFeature].function!(this: this, arguments: [feature.jsValue(), origin?.jsValue() ?? .undefined]).fromJSValue()! } public func features() -> [String] { - jsObject[Strings.features]!().fromJSValue()! + let this = jsObject + return this[Strings.features].function!(this: this, arguments: []).fromJSValue()! } public func allowedFeatures() -> [String] { - jsObject[Strings.allowedFeatures]!().fromJSValue()! + let this = jsObject + return this[Strings.allowedFeatures].function!(this: this, arguments: []).fromJSValue()! } public func getAllowlistForFeature(feature: String) -> [String] { - jsObject[Strings.getAllowlistForFeature]!(feature.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAllowlistForFeature].function!(this: this, arguments: [feature.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PluginArray.swift b/Sources/DOMKit/WebIDL/PluginArray.swift index 1204e492..f23224a7 100644 --- a/Sources/DOMKit/WebIDL/PluginArray.swift +++ b/Sources/DOMKit/WebIDL/PluginArray.swift @@ -14,7 +14,8 @@ public class PluginArray: JSBridgedClass { } public func refresh() { - _ = jsObject[Strings.refresh]!() + let this = jsObject + _ = this[Strings.refresh].function!(this: this, arguments: []) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PointerEvent.swift b/Sources/DOMKit/WebIDL/PointerEvent.swift index 01763389..ae5af0f9 100644 --- a/Sources/DOMKit/WebIDL/PointerEvent.swift +++ b/Sources/DOMKit/WebIDL/PointerEvent.swift @@ -63,10 +63,12 @@ public class PointerEvent: MouseEvent { public var isPrimary: Bool public func getCoalescedEvents() -> [PointerEvent] { - jsObject[Strings.getCoalescedEvents]!().fromJSValue()! + let this = jsObject + return this[Strings.getCoalescedEvents].function!(this: this, arguments: []).fromJSValue()! } public func getPredictedEvents() -> [PointerEvent] { - jsObject[Strings.getPredictedEvents]!().fromJSValue()! + let this = jsObject + return this[Strings.getPredictedEvents].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift index b72b40d1..26db38cd 100644 --- a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift +++ b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift @@ -19,6 +19,7 @@ public class PortalActivateEvent: Event { public var data: JSValue public func adoptPredecessor() -> HTMLPortalElement { - jsObject[Strings.adoptPredecessor]!().fromJSValue()! + let this = jsObject + return this[Strings.adoptPredecessor].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PortalHost.swift b/Sources/DOMKit/WebIDL/PortalHost.swift index 18b0ddd3..aacc0ceb 100644 --- a/Sources/DOMKit/WebIDL/PortalHost.swift +++ b/Sources/DOMKit/WebIDL/PortalHost.swift @@ -13,7 +13,8 @@ public class PortalHost: EventTarget { } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/PresentationConnection.swift b/Sources/DOMKit/WebIDL/PresentationConnection.swift index b3217e47..6155d93f 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnection.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnection.swift @@ -28,11 +28,13 @@ public class PresentationConnection: EventTarget { public var state: PresentationConnectionState public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public func terminate() { - _ = jsObject[Strings.terminate]!() + let this = jsObject + _ = this[Strings.terminate].function!(this: this, arguments: []) } @ClosureAttribute1Optional @@ -51,18 +53,22 @@ public class PresentationConnection: EventTarget { public var onmessage: EventHandler public func send(message: String) { - _ = jsObject[Strings.send]!(message.jsValue()) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [message.jsValue()]) } public func send(data: Blob) { - _ = jsObject[Strings.send]!(data.jsValue()) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } public func send(data: ArrayBuffer) { - _ = jsObject[Strings.send]!(data.jsValue()) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } public func send(data: ArrayBufferView) { - _ = jsObject[Strings.send]!(data.jsValue()) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/PresentationRequest.swift b/Sources/DOMKit/WebIDL/PresentationRequest.swift index a5aa7af6..7fc741c2 100644 --- a/Sources/DOMKit/WebIDL/PresentationRequest.swift +++ b/Sources/DOMKit/WebIDL/PresentationRequest.swift @@ -20,32 +20,38 @@ public class PresentationRequest: EventTarget { } public func start() -> JSPromise { - jsObject[Strings.start]!().fromJSValue()! + let this = jsObject + return this[Strings.start].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func start() async throws -> PresentationConnection { - let _promise: JSPromise = jsObject[Strings.start]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.start].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func reconnect(presentationId: String) -> JSPromise { - jsObject[Strings.reconnect]!(presentationId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func reconnect(presentationId: String) async throws -> PresentationConnection { - let _promise: JSPromise = jsObject[Strings.reconnect]!(presentationId.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getAvailability() -> JSPromise { - jsObject[Strings.getAvailability]!().fromJSValue()! + let this = jsObject + return this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getAvailability() async throws -> PresentationAvailability { - let _promise: JSPromise = jsObject[Strings.getAvailability]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Profiler.swift b/Sources/DOMKit/WebIDL/Profiler.swift index a7969b96..2761f53a 100644 --- a/Sources/DOMKit/WebIDL/Profiler.swift +++ b/Sources/DOMKit/WebIDL/Profiler.swift @@ -23,12 +23,14 @@ public class Profiler: EventTarget { } public func stop() -> JSPromise { - jsObject[Strings.stop]!().fromJSValue()! + let this = jsObject + return this[Strings.stop].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func stop() async throws -> ProfilerTrace { - let _promise: JSPromise = jsObject[Strings.stop]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.stop].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredential.swift b/Sources/DOMKit/WebIDL/PublicKeyCredential.swift index 462749ce..d59690c4 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredential.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredential.swift @@ -23,16 +23,19 @@ public class PublicKeyCredential: Credential { public var authenticatorAttachment: String? public func getClientExtensionResults() -> AuthenticationExtensionsClientOutputs { - jsObject[Strings.getClientExtensionResults]!().fromJSValue()! + let this = jsObject + return this[Strings.getClientExtensionResults].function!(this: this, arguments: []).fromJSValue()! } public static func isUserVerifyingPlatformAuthenticatorAvailable() -> JSPromise { - constructor[Strings.isUserVerifyingPlatformAuthenticatorAvailable]!().fromJSValue()! + let this = constructor + return this[Strings.isUserVerifyingPlatformAuthenticatorAvailable].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func isUserVerifyingPlatformAuthenticatorAvailable() async throws -> Bool { - let _promise: JSPromise = constructor[Strings.isUserVerifyingPlatformAuthenticatorAvailable]!().fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.isUserVerifyingPlatformAuthenticatorAvailable].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PushManager.swift b/Sources/DOMKit/WebIDL/PushManager.swift index 01d296d6..c2439ff3 100644 --- a/Sources/DOMKit/WebIDL/PushManager.swift +++ b/Sources/DOMKit/WebIDL/PushManager.swift @@ -17,32 +17,38 @@ public class PushManager: JSBridgedClass { public var supportedContentEncodings: [String] public func subscribe(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { - jsObject[Strings.subscribe]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func subscribe(options: PushSubscriptionOptionsInit? = nil) async throws -> PushSubscription { - let _promise: JSPromise = jsObject[Strings.subscribe]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getSubscription() -> JSPromise { - jsObject[Strings.getSubscription]!().fromJSValue()! + let this = jsObject + return this[Strings.getSubscription].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getSubscription() async throws -> PushSubscription? { - let _promise: JSPromise = jsObject[Strings.getSubscription]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getSubscription].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func permissionState(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { - jsObject[Strings.permissionState]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func permissionState(options: PushSubscriptionOptionsInit? = nil) async throws -> PermissionState { - let _promise: JSPromise = jsObject[Strings.permissionState]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PushMessageData.swift b/Sources/DOMKit/WebIDL/PushMessageData.swift index 79655b0f..a8d39f7f 100644 --- a/Sources/DOMKit/WebIDL/PushMessageData.swift +++ b/Sources/DOMKit/WebIDL/PushMessageData.swift @@ -13,18 +13,22 @@ public class PushMessageData: JSBridgedClass { } public func arrayBuffer() -> ArrayBuffer { - jsObject[Strings.arrayBuffer]!().fromJSValue()! + let this = jsObject + return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! } public func blob() -> Blob { - jsObject[Strings.blob]!().fromJSValue()! + let this = jsObject + return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! } public func json() -> JSValue { - jsObject[Strings.json]!().fromJSValue()! + let this = jsObject + return this[Strings.json].function!(this: this, arguments: []).fromJSValue()! } public func text() -> String { - jsObject[Strings.text]!().fromJSValue()! + let this = jsObject + return this[Strings.text].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PushSubscription.swift b/Sources/DOMKit/WebIDL/PushSubscription.swift index 80ff1748..46e8353a 100644 --- a/Sources/DOMKit/WebIDL/PushSubscription.swift +++ b/Sources/DOMKit/WebIDL/PushSubscription.swift @@ -25,20 +25,24 @@ public class PushSubscription: JSBridgedClass { public var options: PushSubscriptionOptions public func getKey(name: PushEncryptionKeyName) -> ArrayBuffer? { - jsObject[Strings.getKey]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getKey].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func unsubscribe() -> JSPromise { - jsObject[Strings.unsubscribe]!().fromJSValue()! + let this = jsObject + return this[Strings.unsubscribe].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func unsubscribe() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.unsubscribe]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.unsubscribe].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func toJSON() -> PushSubscriptionJSON { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCCertificate.swift b/Sources/DOMKit/WebIDL/RTCCertificate.swift index 4113b82a..1497aff4 100644 --- a/Sources/DOMKit/WebIDL/RTCCertificate.swift +++ b/Sources/DOMKit/WebIDL/RTCCertificate.swift @@ -17,6 +17,7 @@ public class RTCCertificate: JSBridgedClass { public var expires: EpochTimeStamp public func getFingerprints() -> [RTCDtlsFingerprint] { - jsObject[Strings.getFingerprints]!().fromJSValue()! + let this = jsObject + return this[Strings.getFingerprints].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift index 3ff5112f..9e186ff0 100644 --- a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift +++ b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift @@ -14,7 +14,8 @@ public class RTCDTMFSender: EventTarget { } public func insertDTMF(tones: String, duration: UInt32? = nil, interToneGap: UInt32? = nil) { - _ = jsObject[Strings.insertDTMF]!(tones.jsValue(), duration?.jsValue() ?? .undefined, interToneGap?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.insertDTMF].function!(this: this, arguments: [tones.jsValue(), duration?.jsValue() ?? .undefined, interToneGap?.jsValue() ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/RTCDataChannel.swift b/Sources/DOMKit/WebIDL/RTCDataChannel.swift index 1fa1400b..b32eab17 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannel.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannel.swift @@ -77,7 +77,8 @@ public class RTCDataChannel: EventTarget { public var onclose: EventHandler public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } @ClosureAttribute1Optional @@ -87,18 +88,22 @@ public class RTCDataChannel: EventTarget { public var binaryType: BinaryType public func send(data: String) { - _ = jsObject[Strings.send]!(data.jsValue()) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } public func send(data: Blob) { - _ = jsObject[Strings.send]!(data.jsValue()) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } public func send(data: ArrayBuffer) { - _ = jsObject[Strings.send]!(data.jsValue()) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } public func send(data: ArrayBufferView) { - _ = jsObject[Strings.send]!(data.jsValue()) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift b/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift index 0d92b62e..7037554f 100644 --- a/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift @@ -21,7 +21,8 @@ public class RTCDtlsTransport: EventTarget { public var state: RTCDtlsTransportState public func getRemoteCertificates() -> [ArrayBuffer] { - jsObject[Strings.getRemoteCertificates]!().fromJSValue()! + let this = jsObject + return this[Strings.getRemoteCertificates].function!(this: this, arguments: []).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift index f03d8e45..1a87734e 100644 --- a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift +++ b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift @@ -21,6 +21,7 @@ public class RTCEncodedAudioFrame: JSBridgedClass { public var data: ArrayBuffer public func getMetadata() -> RTCEncodedAudioFrameMetadata { - jsObject[Strings.getMetadata]!().fromJSValue()! + let this = jsObject + return this[Strings.getMetadata].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift index 2eb349f2..7d0029ff 100644 --- a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift +++ b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift @@ -25,6 +25,7 @@ public class RTCEncodedVideoFrame: JSBridgedClass { public var data: ArrayBuffer public func getMetadata() -> RTCEncodedVideoFrameMetadata { - jsObject[Strings.getMetadata]!().fromJSValue()! + let this = jsObject + return this[Strings.getMetadata].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift index f2d2531e..87040382 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift @@ -73,6 +73,7 @@ public class RTCIceCandidate: JSBridgedClass { public var usernameFragment: String? public func toJSON() -> RTCIceCandidateInit { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCIceTransport.swift b/Sources/DOMKit/WebIDL/RTCIceTransport.swift index 3a193739..8e7b0a91 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransport.swift @@ -24,19 +24,23 @@ public class RTCIceTransport: EventTarget { } public func gather(options: RTCIceGatherOptions? = nil) { - _ = jsObject[Strings.gather]!(options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.gather].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } public func start(remoteParameters: RTCIceParameters? = nil, role: RTCIceRole? = nil) { - _ = jsObject[Strings.start]!(remoteParameters?.jsValue() ?? .undefined, role?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.start].function!(this: this, arguments: [remoteParameters?.jsValue() ?? .undefined, role?.jsValue() ?? .undefined]) } public func stop() { - _ = jsObject[Strings.stop]!() + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) } public func addRemoteCandidate(remoteCandidate: RTCIceCandidateInit? = nil) { - _ = jsObject[Strings.addRemoteCandidate]!(remoteCandidate?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.addRemoteCandidate].function!(this: this, arguments: [remoteCandidate?.jsValue() ?? .undefined]) } @ClosureAttribute1Optional @@ -58,23 +62,28 @@ public class RTCIceTransport: EventTarget { public var gatheringState: RTCIceGathererState public func getLocalCandidates() -> [RTCIceCandidate] { - jsObject[Strings.getLocalCandidates]!().fromJSValue()! + let this = jsObject + return this[Strings.getLocalCandidates].function!(this: this, arguments: []).fromJSValue()! } public func getRemoteCandidates() -> [RTCIceCandidate] { - jsObject[Strings.getRemoteCandidates]!().fromJSValue()! + let this = jsObject + return this[Strings.getRemoteCandidates].function!(this: this, arguments: []).fromJSValue()! } public func getSelectedCandidatePair() -> RTCIceCandidatePair? { - jsObject[Strings.getSelectedCandidatePair]!().fromJSValue()! + let this = jsObject + return this[Strings.getSelectedCandidatePair].function!(this: this, arguments: []).fromJSValue()! } public func getLocalParameters() -> RTCIceParameters? { - jsObject[Strings.getLocalParameters]!().fromJSValue()! + let this = jsObject + return this[Strings.getLocalParameters].function!(this: this, arguments: []).fromJSValue()! } public func getRemoteParameters() -> RTCIceParameters? { - jsObject[Strings.getRemoteParameters]!().fromJSValue()! + let this = jsObject + return this[Strings.getRemoteParameters].function!(this: this, arguments: []).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift index e75e26e9..3b76b3a7 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift @@ -13,6 +13,7 @@ public class RTCIdentityProviderRegistrar: JSBridgedClass { } public func register(idp: RTCIdentityProvider) { - _ = jsObject[Strings.register]!(idp.jsValue()) + let this = jsObject + _ = this[Strings.register].function!(this: this, arguments: [idp.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift index bf36aa0f..10d8257c 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift @@ -35,16 +35,19 @@ public class RTCPeerConnection: EventTarget { } public func setIdentityProvider(provider: String, options: RTCIdentityProviderOptions? = nil) { - _ = jsObject[Strings.setIdentityProvider]!(provider.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setIdentityProvider].function!(this: this, arguments: [provider.jsValue(), options?.jsValue() ?? .undefined]) } public func getIdentityAssertion() -> JSPromise { - jsObject[Strings.getIdentityAssertion]!().fromJSValue()! + let this = jsObject + return this[Strings.getIdentityAssertion].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getIdentityAssertion() async throws -> String { - let _promise: JSPromise = jsObject[Strings.getIdentityAssertion]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getIdentityAssertion].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -115,19 +118,23 @@ public class RTCPeerConnection: EventTarget { public var canTrickleIceCandidates: Bool? public func restartIce() { - _ = jsObject[Strings.restartIce]!() + let this = jsObject + _ = this[Strings.restartIce].function!(this: this, arguments: []) } public func getConfiguration() -> RTCConfiguration { - jsObject[Strings.getConfiguration]!().fromJSValue()! + let this = jsObject + return this[Strings.getConfiguration].function!(this: this, arguments: []).fromJSValue()! } public func setConfiguration(configuration: RTCConfiguration? = nil) { - _ = jsObject[Strings.setConfiguration]!(configuration?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setConfiguration].function!(this: this, arguments: [configuration?.jsValue() ?? .undefined]) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } @ClosureAttribute1Optional @@ -172,37 +179,45 @@ public class RTCPeerConnection: EventTarget { // XXX: member 'addIceCandidate' is ignored public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) -> JSPromise { - constructor[Strings.generateCertificate]!(keygenAlgorithm.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) async throws -> RTCCertificate { - let _promise: JSPromise = constructor[Strings.generateCertificate]!(keygenAlgorithm.jsValue()).fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getSenders() -> [RTCRtpSender] { - jsObject[Strings.getSenders]!().fromJSValue()! + let this = jsObject + return this[Strings.getSenders].function!(this: this, arguments: []).fromJSValue()! } public func getReceivers() -> [RTCRtpReceiver] { - jsObject[Strings.getReceivers]!().fromJSValue()! + let this = jsObject + return this[Strings.getReceivers].function!(this: this, arguments: []).fromJSValue()! } public func getTransceivers() -> [RTCRtpTransceiver] { - jsObject[Strings.getTransceivers]!().fromJSValue()! + let this = jsObject + return this[Strings.getTransceivers].function!(this: this, arguments: []).fromJSValue()! } public func addTrack(track: MediaStreamTrack, streams: MediaStream...) -> RTCRtpSender { - jsObject[Strings.addTrack]!(track.jsValue(), streams.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.addTrack].function!(this: this, arguments: [track.jsValue()] + streams.map { $0.jsValue() }).fromJSValue()! } public func removeTrack(sender: RTCRtpSender) { - _ = jsObject[Strings.removeTrack]!(sender.jsValue()) + let this = jsObject + _ = this[Strings.removeTrack].function!(this: this, arguments: [sender.jsValue()]) } public func addTransceiver(trackOrKind: __UNSUPPORTED_UNION__, init: RTCRtpTransceiverInit? = nil) -> RTCRtpTransceiver { - jsObject[Strings.addTransceiver]!(trackOrKind.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.addTransceiver].function!(this: this, arguments: [trackOrKind.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } @ClosureAttribute1Optional @@ -212,19 +227,22 @@ public class RTCPeerConnection: EventTarget { public var sctp: RTCSctpTransport? public func createDataChannel(label: String, dataChannelDict: RTCDataChannelInit? = nil) -> RTCDataChannel { - jsObject[Strings.createDataChannel]!(label.jsValue(), dataChannelDict?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createDataChannel].function!(this: this, arguments: [label.jsValue(), dataChannelDict?.jsValue() ?? .undefined]).fromJSValue()! } @ClosureAttribute1Optional public var ondatachannel: EventHandler public func getStats(selector: MediaStreamTrack? = nil) -> JSPromise { - jsObject[Strings.getStats]!(selector?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getStats(selector: MediaStreamTrack? = nil) async throws -> RTCStatsReport { - let _promise: JSPromise = jsObject[Strings.getStats]!(selector?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift index 52dcedb8..5d356130 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift @@ -25,28 +25,34 @@ public class RTCRtpReceiver: JSBridgedClass { public var transport: RTCDtlsTransport? public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { - constructor[Strings.getCapabilities]!(kind.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue()]).fromJSValue()! } public func getParameters() -> RTCRtpReceiveParameters { - jsObject[Strings.getParameters]!().fromJSValue()! + let this = jsObject + return this[Strings.getParameters].function!(this: this, arguments: []).fromJSValue()! } public func getContributingSources() -> [RTCRtpContributingSource] { - jsObject[Strings.getContributingSources]!().fromJSValue()! + let this = jsObject + return this[Strings.getContributingSources].function!(this: this, arguments: []).fromJSValue()! } public func getSynchronizationSources() -> [RTCRtpSynchronizationSource] { - jsObject[Strings.getSynchronizationSources]!().fromJSValue()! + let this = jsObject + return this[Strings.getSynchronizationSources].function!(this: this, arguments: []).fromJSValue()! } public func getStats() -> JSPromise { - jsObject[Strings.getStats]!().fromJSValue()! + let this = jsObject + return this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getStats() async throws -> RTCStatsReport { - let _promise: JSPromise = jsObject[Strings.getStats]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift index 2564474e..f3ae8996 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift @@ -25,22 +25,26 @@ public class RTCRtpScriptTransformer: JSBridgedClass { public var options: JSValue public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { - jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func generateKeyFrame(rids: [String]? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func sendKeyFrameRequest() -> JSPromise { - jsObject[Strings.sendKeyFrameRequest]!().fromJSValue()! + let this = jsObject + return this[Strings.sendKeyFrameRequest].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func sendKeyFrameRequest() async throws { - let _promise: JSPromise = jsObject[Strings.sendKeyFrameRequest]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.sendKeyFrameRequest].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/RTCRtpSender.swift b/Sources/DOMKit/WebIDL/RTCRtpSender.swift index 1776109c..31dd2e01 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpSender.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpSender.swift @@ -20,12 +20,14 @@ public class RTCRtpSender: JSBridgedClass { public var transform: RTCRtpTransform? public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { - jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func generateKeyFrame(rids: [String]? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.generateKeyFrame]!(rids?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } @@ -36,44 +38,53 @@ public class RTCRtpSender: JSBridgedClass { public var transport: RTCDtlsTransport? public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { - constructor[Strings.getCapabilities]!(kind.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue()]).fromJSValue()! } public func setParameters(parameters: RTCRtpSendParameters) -> JSPromise { - jsObject[Strings.setParameters]!(parameters.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func setParameters(parameters: RTCRtpSendParameters) async throws { - let _promise: JSPromise = jsObject[Strings.setParameters]!(parameters.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func getParameters() -> RTCRtpSendParameters { - jsObject[Strings.getParameters]!().fromJSValue()! + let this = jsObject + return this[Strings.getParameters].function!(this: this, arguments: []).fromJSValue()! } public func replaceTrack(withTrack: MediaStreamTrack?) -> JSPromise { - jsObject[Strings.replaceTrack]!(withTrack.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func replaceTrack(withTrack: MediaStreamTrack?) async throws { - let _promise: JSPromise = jsObject[Strings.replaceTrack]!(withTrack.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func setStreams(streams: MediaStream...) { - _ = jsObject[Strings.setStreams]!(streams.jsValue()) + let this = jsObject + _ = this[Strings.setStreams].function!(this: this, arguments: streams.map { $0.jsValue() }) } public func getStats() -> JSPromise { - jsObject[Strings.getStats]!().fromJSValue()! + let this = jsObject + return this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getStats() async throws -> RTCStatsReport { - let _promise: JSPromise = jsObject[Strings.getStats]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift index 094115e7..bacef299 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift @@ -33,10 +33,12 @@ public class RTCRtpTransceiver: JSBridgedClass { public var currentDirection: RTCRtpTransceiverDirection? public func stop() { - _ = jsObject[Strings.stop]!() + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) } public func setCodecPreferences(codecs: [RTCRtpCodecCapability]) { - _ = jsObject[Strings.setCodecPreferences]!(codecs.jsValue()) + let this = jsObject + _ = this[Strings.setCodecPreferences].function!(this: this, arguments: [codecs.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift index ed44310c..d39b9328 100644 --- a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift +++ b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift @@ -25,6 +25,7 @@ public class RTCSessionDescription: JSBridgedClass { public var sdp: String public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 821d7a7f..3dab8376 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -12,15 +12,18 @@ public class Range: AbstractRange { } public func createContextualFragment(fragment: String) -> DocumentFragment { - jsObject[Strings.createContextualFragment]!(fragment.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createContextualFragment].function!(this: this, arguments: [fragment.jsValue()]).fromJSValue()! } public func getClientRects() -> DOMRectList { - jsObject[Strings.getClientRects]!().fromJSValue()! + let this = jsObject + return this[Strings.getClientRects].function!(this: this, arguments: []).fromJSValue()! } public func getBoundingClientRect() -> DOMRect { - jsObject[Strings.getBoundingClientRect]!().fromJSValue()! + let this = jsObject + return this[Strings.getBoundingClientRect].function!(this: this, arguments: []).fromJSValue()! } public convenience init() { @@ -31,39 +34,48 @@ public class Range: AbstractRange { public var commonAncestorContainer: Node public func setStart(node: Node, offset: UInt32) { - _ = jsObject[Strings.setStart]!(node.jsValue(), offset.jsValue()) + let this = jsObject + _ = this[Strings.setStart].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]) } public func setEnd(node: Node, offset: UInt32) { - _ = jsObject[Strings.setEnd]!(node.jsValue(), offset.jsValue()) + let this = jsObject + _ = this[Strings.setEnd].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]) } public func setStartBefore(node: Node) { - _ = jsObject[Strings.setStartBefore]!(node.jsValue()) + let this = jsObject + _ = this[Strings.setStartBefore].function!(this: this, arguments: [node.jsValue()]) } public func setStartAfter(node: Node) { - _ = jsObject[Strings.setStartAfter]!(node.jsValue()) + let this = jsObject + _ = this[Strings.setStartAfter].function!(this: this, arguments: [node.jsValue()]) } public func setEndBefore(node: Node) { - _ = jsObject[Strings.setEndBefore]!(node.jsValue()) + let this = jsObject + _ = this[Strings.setEndBefore].function!(this: this, arguments: [node.jsValue()]) } public func setEndAfter(node: Node) { - _ = jsObject[Strings.setEndAfter]!(node.jsValue()) + let this = jsObject + _ = this[Strings.setEndAfter].function!(this: this, arguments: [node.jsValue()]) } public func collapse(toStart: Bool? = nil) { - _ = jsObject[Strings.collapse]!(toStart?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.collapse].function!(this: this, arguments: [toStart?.jsValue() ?? .undefined]) } public func selectNode(node: Node) { - _ = jsObject[Strings.selectNode]!(node.jsValue()) + let this = jsObject + _ = this[Strings.selectNode].function!(this: this, arguments: [node.jsValue()]) } public func selectNodeContents(node: Node) { - _ = jsObject[Strings.selectNodeContents]!(node.jsValue()) + let this = jsObject + _ = this[Strings.selectNodeContents].function!(this: this, arguments: [node.jsValue()]) } public static let START_TO_START: UInt16 = 0 @@ -75,47 +87,58 @@ public class Range: AbstractRange { public static let END_TO_START: UInt16 = 3 public func compareBoundaryPoints(how: UInt16, sourceRange: Range) -> Int16 { - jsObject[Strings.compareBoundaryPoints]!(how.jsValue(), sourceRange.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.compareBoundaryPoints].function!(this: this, arguments: [how.jsValue(), sourceRange.jsValue()]).fromJSValue()! } public func deleteContents() { - _ = jsObject[Strings.deleteContents]!() + let this = jsObject + _ = this[Strings.deleteContents].function!(this: this, arguments: []) } public func extractContents() -> DocumentFragment { - jsObject[Strings.extractContents]!().fromJSValue()! + let this = jsObject + return this[Strings.extractContents].function!(this: this, arguments: []).fromJSValue()! } public func cloneContents() -> DocumentFragment { - jsObject[Strings.cloneContents]!().fromJSValue()! + let this = jsObject + return this[Strings.cloneContents].function!(this: this, arguments: []).fromJSValue()! } public func insertNode(node: Node) { - _ = jsObject[Strings.insertNode]!(node.jsValue()) + let this = jsObject + _ = this[Strings.insertNode].function!(this: this, arguments: [node.jsValue()]) } public func surroundContents(newParent: Node) { - _ = jsObject[Strings.surroundContents]!(newParent.jsValue()) + let this = jsObject + _ = this[Strings.surroundContents].function!(this: this, arguments: [newParent.jsValue()]) } public func cloneRange() -> Self { - jsObject[Strings.cloneRange]!().fromJSValue()! + let this = jsObject + return this[Strings.cloneRange].function!(this: this, arguments: []).fromJSValue()! } public func detach() { - _ = jsObject[Strings.detach]!() + let this = jsObject + _ = this[Strings.detach].function!(this: this, arguments: []) } public func isPointInRange(node: Node, offset: UInt32) -> Bool { - jsObject[Strings.isPointInRange]!(node.jsValue(), offset.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isPointInRange].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]).fromJSValue()! } public func comparePoint(node: Node, offset: UInt32) -> Int16 { - jsObject[Strings.comparePoint]!(node.jsValue(), offset.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.comparePoint].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]).fromJSValue()! } public func intersectsNode(node: Node) -> Bool { - jsObject[Strings.intersectsNode]!(node.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.intersectsNode].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! } public var description: String { diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift index db4f1427..b7b5a34a 100644 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift @@ -21,14 +21,17 @@ public class ReadableByteStreamController: JSBridgedClass { public var desiredSize: Double? public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public func enqueue(chunk: ArrayBufferView) { - _ = jsObject[Strings.enqueue]!(chunk.jsValue()) + let this = jsObject + _ = this[Strings.enqueue].function!(this: this, arguments: [chunk.jsValue()]) } public func error(e: JSValue? = nil) { - _ = jsObject[Strings.error]!(e?.jsValue() ?? .undefined) + 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 index eb6fdb25..b27106a7 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -21,35 +21,42 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { public var locked: Bool public func cancel(reason: JSValue? = nil) -> JSPromise { - jsObject[Strings.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func cancel(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.cancel].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func getReader(options: ReadableStreamGetReaderOptions? = nil) -> ReadableStreamReader { - jsObject[Strings.getReader]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getReader].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func pipeThrough(transform: ReadableWritablePair, options: StreamPipeOptions? = nil) -> Self { - jsObject[Strings.pipeThrough]!(transform.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.pipeThrough].function!(this: this, arguments: [transform.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) -> JSPromise { - jsObject[Strings.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.pipeTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.pipeTo].function!(this: this, arguments: [destination.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func tee() -> [ReadableStream] { - jsObject[Strings.tee]!().fromJSValue()! + let this = jsObject + return this[Strings.tee].function!(this: this, arguments: []).fromJSValue()! } public typealias Element = JSValue diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift index 2fddadd5..e871b969 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -17,16 +17,19 @@ public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericRead } public func read(view: ArrayBufferView) -> JSPromise { - jsObject[Strings.read]!(view.jsValue()).fromJSValue()! + 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, *) public func read(view: ArrayBufferView) async throws -> ReadableStreamBYOBReadResult { - let _promise: JSPromise = jsObject[Strings.read]!(view.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func releaseLock() { - _ = jsObject[Strings.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 index eade9471..75f5cf6c 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift @@ -17,10 +17,12 @@ public class ReadableStreamBYOBRequest: JSBridgedClass { public var view: ArrayBufferView? public func respond(bytesWritten: UInt64) { - _ = jsObject[Strings.respond]!(bytesWritten.jsValue()) + let this = jsObject + _ = this[Strings.respond].function!(this: this, arguments: [bytesWritten.jsValue()]) } public func respondWithNewView(view: ArrayBufferView) { - _ = jsObject[Strings.respondWithNewView]!(view.jsValue()) + let this = jsObject + _ = this[Strings.respondWithNewView].function!(this: this, arguments: [view.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift index e61f6f58..dc3d592e 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift @@ -17,14 +17,17 @@ public class ReadableStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public func enqueue(chunk: JSValue? = nil) { - _ = jsObject[Strings.enqueue]!(chunk?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.enqueue].function!(this: this, arguments: [chunk?.jsValue() ?? .undefined]) } public func error(e: JSValue? = nil) { - _ = jsObject[Strings.error]!(e?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.error].function!(this: this, arguments: [e?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift index 62bdf83f..65d49c84 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -17,16 +17,19 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR } public func read() -> JSPromise { - jsObject[Strings.read]!().fromJSValue()! + 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, *) public func read() async throws -> ReadableStreamDefaultReadResult { - let _promise: JSPromise = jsObject[Strings.read]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func releaseLock() { - _ = jsObject[Strings.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 index aa63c91b..b8cfbbce 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift @@ -8,12 +8,14 @@ public extension ReadableStreamGenericReader { var closed: JSPromise { ReadonlyAttribute[Strings.closed, in: jsObject] } func cancel(reason: JSValue? = nil) -> JSPromise { - jsObject[Strings.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! + 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, *) func cancel(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.cancel]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.cancel].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/Region.swift b/Sources/DOMKit/WebIDL/Region.swift index 0ab9775d..c7b2a199 100644 --- a/Sources/DOMKit/WebIDL/Region.swift +++ b/Sources/DOMKit/WebIDL/Region.swift @@ -8,6 +8,7 @@ public extension Region { var regionOverset: String { ReadonlyAttribute[Strings.regionOverset, in: jsObject] } func getRegionFlowRanges() -> [Range]? { - jsObject[Strings.getRegionFlowRanges]!().fromJSValue()! + let this = jsObject + return this[Strings.getRegionFlowRanges].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RemotePlayback.swift b/Sources/DOMKit/WebIDL/RemotePlayback.swift index 249ce54d..17e38716 100644 --- a/Sources/DOMKit/WebIDL/RemotePlayback.swift +++ b/Sources/DOMKit/WebIDL/RemotePlayback.swift @@ -19,12 +19,14 @@ public class RemotePlayback: EventTarget { // XXX: member 'watchAvailability' is ignored public func cancelWatchAvailability(id: Int32? = nil) -> JSPromise { - jsObject[Strings.cancelWatchAvailability]!(id?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func cancelWatchAvailability(id: Int32? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.cancelWatchAvailability]!(id?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } @@ -41,12 +43,14 @@ public class RemotePlayback: EventTarget { public var ondisconnect: EventHandler public func prompt() -> JSPromise { - jsObject[Strings.prompt]!().fromJSValue()! + let this = jsObject + return this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func prompt() async throws { - let _promise: JSPromise = jsObject[Strings.prompt]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/Report.swift b/Sources/DOMKit/WebIDL/Report.swift index 033cf31d..19cc4d1d 100644 --- a/Sources/DOMKit/WebIDL/Report.swift +++ b/Sources/DOMKit/WebIDL/Report.swift @@ -16,7 +16,8 @@ public class Report: JSBridgedClass { } public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ReportBody.swift b/Sources/DOMKit/WebIDL/ReportBody.swift index 4877c97a..1d37b1ec 100644 --- a/Sources/DOMKit/WebIDL/ReportBody.swift +++ b/Sources/DOMKit/WebIDL/ReportBody.swift @@ -13,6 +13,7 @@ public class ReportBody: JSBridgedClass { } public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ReportingObserver.swift b/Sources/DOMKit/WebIDL/ReportingObserver.swift index 93b26bbb..52436af3 100644 --- a/Sources/DOMKit/WebIDL/ReportingObserver.swift +++ b/Sources/DOMKit/WebIDL/ReportingObserver.swift @@ -15,14 +15,17 @@ public class ReportingObserver: JSBridgedClass { // XXX: constructor is ignored public func observe() { - _ = jsObject[Strings.observe]!() + let this = jsObject + _ = this[Strings.observe].function!(this: this, arguments: []) } public func disconnect() { - _ = jsObject[Strings.disconnect]!() + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: []) } public func takeRecords() -> ReportList { - jsObject[Strings.takeRecords]!().fromJSValue()! + let this = jsObject + return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift index a96bed1d..22b254fc 100644 --- a/Sources/DOMKit/WebIDL/Request.swift +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -78,7 +78,8 @@ public class Request: JSBridgedClass, Body { public var signal: AbortSignal public func clone() -> Self { - jsObject[Strings.clone]!().fromJSValue()! + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ResizeObserver.swift b/Sources/DOMKit/WebIDL/ResizeObserver.swift index cf3ef9be..71190798 100644 --- a/Sources/DOMKit/WebIDL/ResizeObserver.swift +++ b/Sources/DOMKit/WebIDL/ResizeObserver.swift @@ -15,14 +15,17 @@ public class ResizeObserver: JSBridgedClass { // XXX: constructor is ignored public func observe(target: Element, options: ResizeObserverOptions? = nil) { - _ = jsObject[Strings.observe]!(target.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue(), options?.jsValue() ?? .undefined]) } public func unobserve(target: Element) { - _ = jsObject[Strings.unobserve]!(target.jsValue()) + let this = jsObject + _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue()]) } public func disconnect() { - _ = jsObject[Strings.disconnect]!() + let this = jsObject + _ = this[Strings.disconnect].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/Response.swift b/Sources/DOMKit/WebIDL/Response.swift index 65b9042e..318eac61 100644 --- a/Sources/DOMKit/WebIDL/Response.swift +++ b/Sources/DOMKit/WebIDL/Response.swift @@ -24,11 +24,13 @@ public class Response: JSBridgedClass, Body { } public static func error() -> Self { - constructor[Strings.error]!().fromJSValue()! + let this = constructor + return this[Strings.error].function!(this: this, arguments: []).fromJSValue()! } public static func redirect(url: String, status: UInt16? = nil) -> Self { - constructor[Strings.redirect]!(url.jsValue(), status?.jsValue() ?? .undefined).fromJSValue()! + let this = constructor + return this[Strings.redirect].function!(this: this, arguments: [url.jsValue(), status?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -53,6 +55,7 @@ public class Response: JSBridgedClass, Body { public var headers: Headers public func clone() -> Self { - jsObject[Strings.clone]!().fromJSValue()! + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SFrameTransform.swift b/Sources/DOMKit/WebIDL/SFrameTransform.swift index 287e59fb..94ffef85 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransform.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransform.swift @@ -18,12 +18,14 @@ public class SFrameTransform: JSBridgedClass, GenericTransformStream { } public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) -> JSPromise { - jsObject[Strings.setEncryptionKey]!(key.jsValue(), keyID?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue(), keyID?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.setEncryptionKey]!(key.jsValue(), keyID?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue(), keyID?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/SVGAngle.swift b/Sources/DOMKit/WebIDL/SVGAngle.swift index 6e836548..4fc5b7c0 100644 --- a/Sources/DOMKit/WebIDL/SVGAngle.swift +++ b/Sources/DOMKit/WebIDL/SVGAngle.swift @@ -39,10 +39,12 @@ public class SVGAngle: JSBridgedClass { public var valueAsString: String public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { - _ = jsObject[Strings.newValueSpecifiedUnits]!(unitType.jsValue(), valueInSpecifiedUnits.jsValue()) + let this = jsObject + _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue(), valueInSpecifiedUnits.jsValue()]) } public func convertToSpecifiedUnits(unitType: UInt16) { - _ = jsObject[Strings.convertToSpecifiedUnits]!(unitType.jsValue()) + let this = jsObject + _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift index 72c2d815..ca393a82 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift @@ -27,30 +27,37 @@ public class SVGAnimationElement: SVGElement, SVGTests { public var onrepeat: EventHandler public func getStartTime() -> Float { - jsObject[Strings.getStartTime]!().fromJSValue()! + let this = jsObject + return this[Strings.getStartTime].function!(this: this, arguments: []).fromJSValue()! } public func getCurrentTime() -> Float { - jsObject[Strings.getCurrentTime]!().fromJSValue()! + let this = jsObject + return this[Strings.getCurrentTime].function!(this: this, arguments: []).fromJSValue()! } public func getSimpleDuration() -> Float { - jsObject[Strings.getSimpleDuration]!().fromJSValue()! + let this = jsObject + return this[Strings.getSimpleDuration].function!(this: this, arguments: []).fromJSValue()! } public func beginElement() { - _ = jsObject[Strings.beginElement]!() + let this = jsObject + _ = this[Strings.beginElement].function!(this: this, arguments: []) } public func beginElementAt(offset: Float) { - _ = jsObject[Strings.beginElementAt]!(offset.jsValue()) + let this = jsObject + _ = this[Strings.beginElementAt].function!(this: this, arguments: [offset.jsValue()]) } public func endElement() { - _ = jsObject[Strings.endElement]!() + let this = jsObject + _ = this[Strings.endElement].function!(this: this, arguments: []) } public func endElementAt(offset: Float) { - _ = jsObject[Strings.endElementAt]!(offset.jsValue()) + let this = jsObject + _ = this[Strings.endElementAt].function!(this: this, arguments: [offset.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift b/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift index f56e81db..1c4a606d 100644 --- a/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift @@ -31,6 +31,7 @@ public class SVGFEDropShadowElement: SVGElement, SVGFilterPrimitiveStandardAttri public var stdDeviationY: SVGAnimatedNumber public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { - _ = jsObject[Strings.setStdDeviation]!(stdDeviationX.jsValue(), stdDeviationY.jsValue()) + let this = jsObject + _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue(), stdDeviationY.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift b/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift index 273825a7..17fd7e1e 100644 --- a/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift @@ -35,6 +35,7 @@ public class SVGFEGaussianBlurElement: SVGElement, SVGFilterPrimitiveStandardAtt public var edgeMode: SVGAnimatedEnumeration public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { - _ = jsObject[Strings.setStdDeviation]!(stdDeviationX.jsValue(), stdDeviationY.jsValue()) + let this = jsObject + _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue(), stdDeviationY.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SVGGeometryElement.swift b/Sources/DOMKit/WebIDL/SVGGeometryElement.swift index 73a55d4f..b7589afd 100644 --- a/Sources/DOMKit/WebIDL/SVGGeometryElement.swift +++ b/Sources/DOMKit/WebIDL/SVGGeometryElement.swift @@ -15,18 +15,22 @@ public class SVGGeometryElement: SVGGraphicsElement { public var pathLength: SVGAnimatedNumber public func isPointInFill(point: DOMPointInit? = nil) -> Bool { - jsObject[Strings.isPointInFill]!(point?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.isPointInFill].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! } public func isPointInStroke(point: DOMPointInit? = nil) -> Bool { - jsObject[Strings.isPointInStroke]!(point?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.isPointInStroke].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! } public func getTotalLength() -> Float { - jsObject[Strings.getTotalLength]!().fromJSValue()! + let this = jsObject + return this[Strings.getTotalLength].function!(this: this, arguments: []).fromJSValue()! } public func getPointAtLength(distance: Float) -> DOMPoint { - jsObject[Strings.getPointAtLength]!(distance.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getPointAtLength].function!(this: this, arguments: [distance.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift b/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift index dc9b7601..1c1f1d4a 100644 --- a/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift +++ b/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift @@ -15,14 +15,17 @@ public class SVGGraphicsElement: SVGElement, SVGTests { public var transform: SVGAnimatedTransformList public func getBBox(options: SVGBoundingBoxOptions? = nil) -> DOMRect { - jsObject[Strings.getBBox]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getBBox].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func getCTM() -> DOMMatrix? { - jsObject[Strings.getCTM]!().fromJSValue()! + let this = jsObject + return this[Strings.getCTM].function!(this: this, arguments: []).fromJSValue()! } public func getScreenCTM() -> DOMMatrix? { - jsObject[Strings.getScreenCTM]!().fromJSValue()! + let this = jsObject + return this[Strings.getScreenCTM].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SVGLength.swift b/Sources/DOMKit/WebIDL/SVGLength.swift index 229dfbf9..549e22cc 100644 --- a/Sources/DOMKit/WebIDL/SVGLength.swift +++ b/Sources/DOMKit/WebIDL/SVGLength.swift @@ -51,10 +51,12 @@ public class SVGLength: JSBridgedClass { public var valueAsString: String public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { - _ = jsObject[Strings.newValueSpecifiedUnits]!(unitType.jsValue(), valueInSpecifiedUnits.jsValue()) + let this = jsObject + _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue(), valueInSpecifiedUnits.jsValue()]) } public func convertToSpecifiedUnits(unitType: UInt16) { - _ = jsObject[Strings.convertToSpecifiedUnits]!(unitType.jsValue()) + let this = jsObject + _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SVGLengthList.swift b/Sources/DOMKit/WebIDL/SVGLengthList.swift index 9eb5f99a..db47e9d2 100644 --- a/Sources/DOMKit/WebIDL/SVGLengthList.swift +++ b/Sources/DOMKit/WebIDL/SVGLengthList.swift @@ -21,11 +21,13 @@ public class SVGLengthList: JSBridgedClass { public var numberOfItems: UInt32 public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } public func initialize(newItem: SVGLength) -> SVGLength { - jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } public subscript(key: Int) -> SVGLength { @@ -33,19 +35,23 @@ public class SVGLengthList: JSBridgedClass { } public func insertItemBefore(newItem: SVGLength, index: UInt32) -> SVGLength { - jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func replaceItem(newItem: SVGLength, index: UInt32) -> SVGLength { - jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func removeItem(index: UInt32) -> SVGLength { - jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } public func appendItem(newItem: SVGLength) -> SVGLength { - jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 diff --git a/Sources/DOMKit/WebIDL/SVGMarkerElement.swift b/Sources/DOMKit/WebIDL/SVGMarkerElement.swift index 7aeb4652..f919955e 100644 --- a/Sources/DOMKit/WebIDL/SVGMarkerElement.swift +++ b/Sources/DOMKit/WebIDL/SVGMarkerElement.swift @@ -55,10 +55,12 @@ public class SVGMarkerElement: SVGElement, SVGFitToViewBox { public var orient: String public func setOrientToAuto() { - _ = jsObject[Strings.setOrientToAuto]!() + let this = jsObject + _ = this[Strings.setOrientToAuto].function!(this: this, arguments: []) } public func setOrientToAngle(angle: SVGAngle) { - _ = jsObject[Strings.setOrientToAngle]!(angle.jsValue()) + let this = jsObject + _ = this[Strings.setOrientToAngle].function!(this: this, arguments: [angle.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SVGNumberList.swift b/Sources/DOMKit/WebIDL/SVGNumberList.swift index 1a71a562..e74ea8cc 100644 --- a/Sources/DOMKit/WebIDL/SVGNumberList.swift +++ b/Sources/DOMKit/WebIDL/SVGNumberList.swift @@ -21,11 +21,13 @@ public class SVGNumberList: JSBridgedClass { public var numberOfItems: UInt32 public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } public func initialize(newItem: SVGNumber) -> SVGNumber { - jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } public subscript(key: Int) -> SVGNumber { @@ -33,19 +35,23 @@ public class SVGNumberList: JSBridgedClass { } public func insertItemBefore(newItem: SVGNumber, index: UInt32) -> SVGNumber { - jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func replaceItem(newItem: SVGNumber, index: UInt32) -> SVGNumber { - jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func removeItem(index: UInt32) -> SVGNumber { - jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } public func appendItem(newItem: SVGNumber) -> SVGNumber { - jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 diff --git a/Sources/DOMKit/WebIDL/SVGPointList.swift b/Sources/DOMKit/WebIDL/SVGPointList.swift index 783a92f9..86100b53 100644 --- a/Sources/DOMKit/WebIDL/SVGPointList.swift +++ b/Sources/DOMKit/WebIDL/SVGPointList.swift @@ -21,11 +21,13 @@ public class SVGPointList: JSBridgedClass { public var numberOfItems: UInt32 public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } public func initialize(newItem: DOMPoint) -> DOMPoint { - jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } public subscript(key: Int) -> DOMPoint { @@ -33,19 +35,23 @@ public class SVGPointList: JSBridgedClass { } public func insertItemBefore(newItem: DOMPoint, index: UInt32) -> DOMPoint { - jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func replaceItem(newItem: DOMPoint, index: UInt32) -> DOMPoint { - jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func removeItem(index: UInt32) -> DOMPoint { - jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } public func appendItem(newItem: DOMPoint) -> DOMPoint { - jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 diff --git a/Sources/DOMKit/WebIDL/SVGSVGElement.swift b/Sources/DOMKit/WebIDL/SVGSVGElement.swift index a7428739..0ad174fa 100644 --- a/Sources/DOMKit/WebIDL/SVGSVGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGSVGElement.swift @@ -35,94 +35,117 @@ public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHand public var currentTranslate: DOMPointReadOnly public func getIntersectionList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { - jsObject[Strings.getIntersectionList]!(rect.jsValue(), referenceElement.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getIntersectionList].function!(this: this, arguments: [rect.jsValue(), referenceElement.jsValue()]).fromJSValue()! } public func getEnclosureList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { - jsObject[Strings.getEnclosureList]!(rect.jsValue(), referenceElement.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getEnclosureList].function!(this: this, arguments: [rect.jsValue(), referenceElement.jsValue()]).fromJSValue()! } public func checkIntersection(element: SVGElement, rect: DOMRectReadOnly) -> Bool { - jsObject[Strings.checkIntersection]!(element.jsValue(), rect.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.checkIntersection].function!(this: this, arguments: [element.jsValue(), rect.jsValue()]).fromJSValue()! } public func checkEnclosure(element: SVGElement, rect: DOMRectReadOnly) -> Bool { - jsObject[Strings.checkEnclosure]!(element.jsValue(), rect.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.checkEnclosure].function!(this: this, arguments: [element.jsValue(), rect.jsValue()]).fromJSValue()! } public func deselectAll() { - _ = jsObject[Strings.deselectAll]!() + let this = jsObject + _ = this[Strings.deselectAll].function!(this: this, arguments: []) } public func createSVGNumber() -> SVGNumber { - jsObject[Strings.createSVGNumber]!().fromJSValue()! + let this = jsObject + return this[Strings.createSVGNumber].function!(this: this, arguments: []).fromJSValue()! } public func createSVGLength() -> SVGLength { - jsObject[Strings.createSVGLength]!().fromJSValue()! + let this = jsObject + return this[Strings.createSVGLength].function!(this: this, arguments: []).fromJSValue()! } public func createSVGAngle() -> SVGAngle { - jsObject[Strings.createSVGAngle]!().fromJSValue()! + let this = jsObject + return this[Strings.createSVGAngle].function!(this: this, arguments: []).fromJSValue()! } public func createSVGPoint() -> DOMPoint { - jsObject[Strings.createSVGPoint]!().fromJSValue()! + let this = jsObject + return this[Strings.createSVGPoint].function!(this: this, arguments: []).fromJSValue()! } public func createSVGMatrix() -> DOMMatrix { - jsObject[Strings.createSVGMatrix]!().fromJSValue()! + let this = jsObject + return this[Strings.createSVGMatrix].function!(this: this, arguments: []).fromJSValue()! } public func createSVGRect() -> DOMRect { - jsObject[Strings.createSVGRect]!().fromJSValue()! + let this = jsObject + return this[Strings.createSVGRect].function!(this: this, arguments: []).fromJSValue()! } public func createSVGTransform() -> SVGTransform { - jsObject[Strings.createSVGTransform]!().fromJSValue()! + let this = jsObject + return this[Strings.createSVGTransform].function!(this: this, arguments: []).fromJSValue()! } public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { - jsObject[Strings.createSVGTransformFromMatrix]!(matrix?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]).fromJSValue()! } public func getElementById(elementId: String) -> Element { - jsObject[Strings.getElementById]!(elementId.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getElementById].function!(this: this, arguments: [elementId.jsValue()]).fromJSValue()! } public func suspendRedraw(maxWaitMilliseconds: UInt32) -> UInt32 { - jsObject[Strings.suspendRedraw]!(maxWaitMilliseconds.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.suspendRedraw].function!(this: this, arguments: [maxWaitMilliseconds.jsValue()]).fromJSValue()! } public func unsuspendRedraw(suspendHandleID: UInt32) { - _ = jsObject[Strings.unsuspendRedraw]!(suspendHandleID.jsValue()) + let this = jsObject + _ = this[Strings.unsuspendRedraw].function!(this: this, arguments: [suspendHandleID.jsValue()]) } public func unsuspendRedrawAll() { - _ = jsObject[Strings.unsuspendRedrawAll]!() + let this = jsObject + _ = this[Strings.unsuspendRedrawAll].function!(this: this, arguments: []) } public func forceRedraw() { - _ = jsObject[Strings.forceRedraw]!() + let this = jsObject + _ = this[Strings.forceRedraw].function!(this: this, arguments: []) } public func pauseAnimations() { - _ = jsObject[Strings.pauseAnimations]!() + let this = jsObject + _ = this[Strings.pauseAnimations].function!(this: this, arguments: []) } public func unpauseAnimations() { - _ = jsObject[Strings.unpauseAnimations]!() + let this = jsObject + _ = this[Strings.unpauseAnimations].function!(this: this, arguments: []) } public func animationsPaused() -> Bool { - jsObject[Strings.animationsPaused]!().fromJSValue()! + let this = jsObject + return this[Strings.animationsPaused].function!(this: this, arguments: []).fromJSValue()! } public func getCurrentTime() -> Float { - jsObject[Strings.getCurrentTime]!().fromJSValue()! + let this = jsObject + return this[Strings.getCurrentTime].function!(this: this, arguments: []).fromJSValue()! } public func setCurrentTime(seconds: Float) { - _ = jsObject[Strings.setCurrentTime]!(seconds.jsValue()) + let this = jsObject + _ = this[Strings.setCurrentTime].function!(this: this, arguments: [seconds.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SVGStringList.swift b/Sources/DOMKit/WebIDL/SVGStringList.swift index 27ddd147..d3995a2b 100644 --- a/Sources/DOMKit/WebIDL/SVGStringList.swift +++ b/Sources/DOMKit/WebIDL/SVGStringList.swift @@ -21,11 +21,13 @@ public class SVGStringList: JSBridgedClass { public var numberOfItems: UInt32 public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } public func initialize(newItem: String) -> String { - jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } public subscript(key: Int) -> String { @@ -33,19 +35,23 @@ public class SVGStringList: JSBridgedClass { } public func insertItemBefore(newItem: String, index: UInt32) -> String { - jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func replaceItem(newItem: String, index: UInt32) -> String { - jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func removeItem(index: UInt32) -> String { - jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } public func appendItem(newItem: String) -> String { - jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 diff --git a/Sources/DOMKit/WebIDL/SVGTextContentElement.swift b/Sources/DOMKit/WebIDL/SVGTextContentElement.swift index 68917e2c..b3e277f5 100644 --- a/Sources/DOMKit/WebIDL/SVGTextContentElement.swift +++ b/Sources/DOMKit/WebIDL/SVGTextContentElement.swift @@ -25,38 +25,47 @@ public class SVGTextContentElement: SVGGraphicsElement { public var lengthAdjust: SVGAnimatedEnumeration public func getNumberOfChars() -> Int32 { - jsObject[Strings.getNumberOfChars]!().fromJSValue()! + let this = jsObject + return this[Strings.getNumberOfChars].function!(this: this, arguments: []).fromJSValue()! } public func getComputedTextLength() -> Float { - jsObject[Strings.getComputedTextLength]!().fromJSValue()! + let this = jsObject + return this[Strings.getComputedTextLength].function!(this: this, arguments: []).fromJSValue()! } public func getSubStringLength(charnum: UInt32, nchars: UInt32) -> Float { - jsObject[Strings.getSubStringLength]!(charnum.jsValue(), nchars.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getSubStringLength].function!(this: this, arguments: [charnum.jsValue(), nchars.jsValue()]).fromJSValue()! } public func getStartPositionOfChar(charnum: UInt32) -> DOMPoint { - jsObject[Strings.getStartPositionOfChar]!(charnum.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getStartPositionOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! } public func getEndPositionOfChar(charnum: UInt32) -> DOMPoint { - jsObject[Strings.getEndPositionOfChar]!(charnum.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getEndPositionOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! } public func getExtentOfChar(charnum: UInt32) -> DOMRect { - jsObject[Strings.getExtentOfChar]!(charnum.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getExtentOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! } public func getRotationOfChar(charnum: UInt32) -> Float { - jsObject[Strings.getRotationOfChar]!(charnum.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getRotationOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! } public func getCharNumAtPosition(point: DOMPointInit? = nil) -> Int32 { - jsObject[Strings.getCharNumAtPosition]!(point?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getCharNumAtPosition].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! } public func selectSubString(charnum: UInt32, nchars: UInt32) { - _ = jsObject[Strings.selectSubString]!(charnum.jsValue(), nchars.jsValue()) + let this = jsObject + _ = this[Strings.selectSubString].function!(this: this, arguments: [charnum.jsValue(), nchars.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SVGTransform.swift b/Sources/DOMKit/WebIDL/SVGTransform.swift index fa30e5e1..dc4ff06b 100644 --- a/Sources/DOMKit/WebIDL/SVGTransform.swift +++ b/Sources/DOMKit/WebIDL/SVGTransform.swift @@ -39,26 +39,32 @@ public class SVGTransform: JSBridgedClass { public var angle: Float public func setMatrix(matrix: DOMMatrix2DInit? = nil) { - _ = jsObject[Strings.setMatrix]!(matrix?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setMatrix].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]) } public func setTranslate(tx: Float, ty: Float) { - _ = jsObject[Strings.setTranslate]!(tx.jsValue(), ty.jsValue()) + let this = jsObject + _ = this[Strings.setTranslate].function!(this: this, arguments: [tx.jsValue(), ty.jsValue()]) } public func setScale(sx: Float, sy: Float) { - _ = jsObject[Strings.setScale]!(sx.jsValue(), sy.jsValue()) + let this = jsObject + _ = this[Strings.setScale].function!(this: this, arguments: [sx.jsValue(), sy.jsValue()]) } public func setRotate(angle: Float, cx: Float, cy: Float) { - _ = jsObject[Strings.setRotate]!(angle.jsValue(), cx.jsValue(), cy.jsValue()) + let this = jsObject + _ = this[Strings.setRotate].function!(this: this, arguments: [angle.jsValue(), cx.jsValue(), cy.jsValue()]) } public func setSkewX(angle: Float) { - _ = jsObject[Strings.setSkewX]!(angle.jsValue()) + let this = jsObject + _ = this[Strings.setSkewX].function!(this: this, arguments: [angle.jsValue()]) } public func setSkewY(angle: Float) { - _ = jsObject[Strings.setSkewY]!(angle.jsValue()) + let this = jsObject + _ = this[Strings.setSkewY].function!(this: this, arguments: [angle.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SVGTransformList.swift b/Sources/DOMKit/WebIDL/SVGTransformList.swift index d47c8102..bdd37548 100644 --- a/Sources/DOMKit/WebIDL/SVGTransformList.swift +++ b/Sources/DOMKit/WebIDL/SVGTransformList.swift @@ -21,11 +21,13 @@ public class SVGTransformList: JSBridgedClass { public var numberOfItems: UInt32 public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } public func initialize(newItem: SVGTransform) -> SVGTransform { - jsObject[Strings.initialize]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } public subscript(key: Int) -> SVGTransform { @@ -33,28 +35,34 @@ public class SVGTransformList: JSBridgedClass { } public func insertItemBefore(newItem: SVGTransform, index: UInt32) -> SVGTransform { - jsObject[Strings.insertItemBefore]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func replaceItem(newItem: SVGTransform, index: UInt32) -> SVGTransform { - jsObject[Strings.replaceItem]!(newItem.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } public func removeItem(index: UInt32) -> SVGTransform { - jsObject[Strings.removeItem]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } public func appendItem(newItem: SVGTransform) -> SVGTransform { - jsObject[Strings.appendItem]!(newItem.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { - jsObject[Strings.createSVGTransformFromMatrix]!(matrix?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]).fromJSValue()! } public func consolidate() -> SVGTransform? { - jsObject[Strings.consolidate]!().fromJSValue()! + let this = jsObject + return this[Strings.consolidate].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Sanitizer.swift b/Sources/DOMKit/WebIDL/Sanitizer.swift index 473c79af..3e66ce20 100644 --- a/Sources/DOMKit/WebIDL/Sanitizer.swift +++ b/Sources/DOMKit/WebIDL/Sanitizer.swift @@ -17,18 +17,22 @@ public class Sanitizer: JSBridgedClass { } public func sanitize(input: __UNSUPPORTED_UNION__) -> DocumentFragment { - jsObject[Strings.sanitize]!(input.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.sanitize].function!(this: this, arguments: [input.jsValue()]).fromJSValue()! } public func sanitizeFor(element: String, input: String) -> Element? { - jsObject[Strings.sanitizeFor]!(element.jsValue(), input.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.sanitizeFor].function!(this: this, arguments: [element.jsValue(), input.jsValue()]).fromJSValue()! } public func getConfiguration() -> SanitizerConfig { - jsObject[Strings.getConfiguration]!().fromJSValue()! + let this = jsObject + return this[Strings.getConfiguration].function!(this: this, arguments: []).fromJSValue()! } public static func getDefaultConfiguration() -> SanitizerConfig { - constructor[Strings.getDefaultConfiguration]!().fromJSValue()! + let this = constructor + return this[Strings.getDefaultConfiguration].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Scheduling.swift b/Sources/DOMKit/WebIDL/Scheduling.swift index 9c5fdf54..916c2ad5 100644 --- a/Sources/DOMKit/WebIDL/Scheduling.swift +++ b/Sources/DOMKit/WebIDL/Scheduling.swift @@ -13,6 +13,7 @@ public class Scheduling: JSBridgedClass { } public func isInputPending(isInputPendingOptions: IsInputPendingOptions? = nil) -> Bool { - jsObject[Strings.isInputPending]!(isInputPendingOptions?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.isInputPending].function!(this: this, arguments: [isInputPendingOptions?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ScreenOrientation.swift b/Sources/DOMKit/WebIDL/ScreenOrientation.swift index bc86eb84..d8743543 100644 --- a/Sources/DOMKit/WebIDL/ScreenOrientation.swift +++ b/Sources/DOMKit/WebIDL/ScreenOrientation.swift @@ -14,17 +14,20 @@ public class ScreenOrientation: EventTarget { } public func lock(orientation: OrientationLockType) -> JSPromise { - jsObject[Strings.lock]!(orientation.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.lock].function!(this: this, arguments: [orientation.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func lock(orientation: OrientationLockType) async throws { - let _promise: JSPromise = jsObject[Strings.lock]!(orientation.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [orientation.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func unlock() { - _ = jsObject[Strings.unlock]!() + let this = jsObject + _ = this[Strings.unlock].function!(this: this, arguments: []) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift b/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift index 9824649e..9938be99 100644 --- a/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift +++ b/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift @@ -16,7 +16,8 @@ public class ScriptingPolicyReportBody: ReportBody { } override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Selection.swift b/Sources/DOMKit/WebIDL/Selection.swift index f76794f1..16909a18 100644 --- a/Sources/DOMKit/WebIDL/Selection.swift +++ b/Sources/DOMKit/WebIDL/Selection.swift @@ -41,59 +41,73 @@ public class Selection: JSBridgedClass { public var type: String public func getRangeAt(index: UInt32) -> Range { - jsObject[Strings.getRangeAt]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getRangeAt].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } public func addRange(range: Range) { - _ = jsObject[Strings.addRange]!(range.jsValue()) + let this = jsObject + _ = this[Strings.addRange].function!(this: this, arguments: [range.jsValue()]) } public func removeRange(range: Range) { - _ = jsObject[Strings.removeRange]!(range.jsValue()) + let this = jsObject + _ = this[Strings.removeRange].function!(this: this, arguments: [range.jsValue()]) } public func removeAllRanges() { - _ = jsObject[Strings.removeAllRanges]!() + let this = jsObject + _ = this[Strings.removeAllRanges].function!(this: this, arguments: []) } public func empty() { - _ = jsObject[Strings.empty]!() + let this = jsObject + _ = this[Strings.empty].function!(this: this, arguments: []) } public func collapse(node: Node?, offset: UInt32? = nil) { - _ = jsObject[Strings.collapse]!(node.jsValue(), offset?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.collapse].function!(this: this, arguments: [node.jsValue(), offset?.jsValue() ?? .undefined]) } public func setPosition(node: Node?, offset: UInt32? = nil) { - _ = jsObject[Strings.setPosition]!(node.jsValue(), offset?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.setPosition].function!(this: this, arguments: [node.jsValue(), offset?.jsValue() ?? .undefined]) } public func collapseToStart() { - _ = jsObject[Strings.collapseToStart]!() + let this = jsObject + _ = this[Strings.collapseToStart].function!(this: this, arguments: []) } public func collapseToEnd() { - _ = jsObject[Strings.collapseToEnd]!() + let this = jsObject + _ = this[Strings.collapseToEnd].function!(this: this, arguments: []) } public func extend(node: Node, offset: UInt32? = nil) { - _ = jsObject[Strings.extend]!(node.jsValue(), offset?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.extend].function!(this: this, arguments: [node.jsValue(), offset?.jsValue() ?? .undefined]) } public func setBaseAndExtent(anchorNode: Node, anchorOffset: UInt32, focusNode: Node, focusOffset: UInt32) { - _ = jsObject[Strings.setBaseAndExtent]!(anchorNode.jsValue(), anchorOffset.jsValue(), focusNode.jsValue(), focusOffset.jsValue()) + let this = jsObject + _ = this[Strings.setBaseAndExtent].function!(this: this, arguments: [anchorNode.jsValue(), anchorOffset.jsValue(), focusNode.jsValue(), focusOffset.jsValue()]) } public func selectAllChildren(node: Node) { - _ = jsObject[Strings.selectAllChildren]!(node.jsValue()) + let this = jsObject + _ = this[Strings.selectAllChildren].function!(this: this, arguments: [node.jsValue()]) } public func deleteFromDocument() { - _ = jsObject[Strings.deleteFromDocument]!() + let this = jsObject + _ = this[Strings.deleteFromDocument].function!(this: this, arguments: []) } public func containsNode(node: Node, allowPartialContainment: Bool? = nil) -> Bool { - jsObject[Strings.containsNode]!(node.jsValue(), allowPartialContainment?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.containsNode].function!(this: this, arguments: [node.jsValue(), allowPartialContainment?.jsValue() ?? .undefined]).fromJSValue()! } public var description: String { diff --git a/Sources/DOMKit/WebIDL/Sensor.swift b/Sources/DOMKit/WebIDL/Sensor.swift index c8a0cc9f..bf066fed 100644 --- a/Sources/DOMKit/WebIDL/Sensor.swift +++ b/Sources/DOMKit/WebIDL/Sensor.swift @@ -26,11 +26,13 @@ public class Sensor: EventTarget { public var timestamp: DOMHighResTimeStamp? public func start() { - _ = jsObject[Strings.start]!() + let this = jsObject + _ = this[Strings.start].function!(this: this, arguments: []) } public func stop() { - _ = jsObject[Strings.stop]!() + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/SequenceEffect.swift b/Sources/DOMKit/WebIDL/SequenceEffect.swift index 76879a3c..b195361b 100644 --- a/Sources/DOMKit/WebIDL/SequenceEffect.swift +++ b/Sources/DOMKit/WebIDL/SequenceEffect.swift @@ -15,6 +15,7 @@ public class SequenceEffect: GroupEffect { } override public func clone() -> Self { - jsObject[Strings.clone]!().fromJSValue()! + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Serial.swift b/Sources/DOMKit/WebIDL/Serial.swift index 6f76a798..82478bc3 100644 --- a/Sources/DOMKit/WebIDL/Serial.swift +++ b/Sources/DOMKit/WebIDL/Serial.swift @@ -19,22 +19,26 @@ public class Serial: EventTarget { public var ondisconnect: EventHandler public func getPorts() -> JSPromise { - jsObject[Strings.getPorts]!().fromJSValue()! + let this = jsObject + return this[Strings.getPorts].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getPorts() async throws -> [SerialPort] { - let _promise: JSPromise = jsObject[Strings.getPorts]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getPorts].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func requestPort(options: SerialPortRequestOptions? = nil) -> JSPromise { - jsObject[Strings.requestPort]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestPort(options: SerialPortRequestOptions? = nil) async throws -> SerialPort { - let _promise: JSPromise = jsObject[Strings.requestPort]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SerialPort.swift b/Sources/DOMKit/WebIDL/SerialPort.swift index 3e5d50ff..6583c5c8 100644 --- a/Sources/DOMKit/WebIDL/SerialPort.swift +++ b/Sources/DOMKit/WebIDL/SerialPort.swift @@ -27,46 +27,55 @@ public class SerialPort: EventTarget { public var writable: WritableStream public func getInfo() -> SerialPortInfo { - jsObject[Strings.getInfo]!().fromJSValue()! + let this = jsObject + return this[Strings.getInfo].function!(this: this, arguments: []).fromJSValue()! } public func open(options: SerialOptions) -> JSPromise { - jsObject[Strings.open]!(options.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.open].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func open(options: SerialOptions) async throws { - let _promise: JSPromise = jsObject[Strings.open]!(options.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func setSignals(signals: SerialOutputSignals? = nil) -> JSPromise { - jsObject[Strings.setSignals]!(signals?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func setSignals(signals: SerialOutputSignals? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.setSignals]!(signals?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func getSignals() -> JSPromise { - jsObject[Strings.getSignals]!().fromJSValue()! + let this = jsObject + return this[Strings.getSignals].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getSignals() async throws -> SerialInputSignals { - let _promise: JSPromise = jsObject[Strings.getSignals]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getSignals].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func close() -> JSPromise { - jsObject[Strings.close]!().fromJSValue()! + 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, *) public func close() async throws { - let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/ServiceWorker.swift b/Sources/DOMKit/WebIDL/ServiceWorker.swift index 5716ecda..3565c1af 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorker.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorker.swift @@ -20,11 +20,13 @@ public class ServiceWorker: EventTarget, AbstractWorker { public var state: ServiceWorkerState public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift index b724ba53..0a89175b 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift @@ -22,37 +22,44 @@ public class ServiceWorkerContainer: EventTarget { public var ready: JSPromise public func register(scriptURL: String, options: RegistrationOptions? = nil) -> JSPromise { - jsObject[Strings.register]!(scriptURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.register].function!(this: this, arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func register(scriptURL: String, options: RegistrationOptions? = nil) async throws -> ServiceWorkerRegistration { - let _promise: JSPromise = jsObject[Strings.register]!(scriptURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getRegistration(clientURL: String? = nil) -> JSPromise { - jsObject[Strings.getRegistration]!(clientURL?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getRegistration(clientURL: String? = nil) async throws -> __UNSUPPORTED_UNION__ { - let _promise: JSPromise = jsObject[Strings.getRegistration]!(clientURL?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getRegistrations() -> JSPromise { - jsObject[Strings.getRegistrations]!().fromJSValue()! + let this = jsObject + return this[Strings.getRegistrations].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getRegistrations() async throws -> [ServiceWorkerRegistration] { - let _promise: JSPromise = jsObject[Strings.getRegistrations]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getRegistrations].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func startMessages() { - _ = jsObject[Strings.startMessages]!() + let this = jsObject + _ = this[Strings.startMessages].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift index 5abb4c51..25ade41b 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift @@ -88,12 +88,14 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { public var serviceWorker: ServiceWorker public func skipWaiting() -> JSPromise { - jsObject[Strings.skipWaiting]!().fromJSValue()! + let this = jsObject + return this[Strings.skipWaiting].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func skipWaiting() async throws { - let _promise: JSPromise = jsObject[Strings.skipWaiting]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.skipWaiting].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift index 9858f1e8..eaae2f06 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift @@ -37,22 +37,26 @@ public class ServiceWorkerRegistration: EventTarget { public var cookies: CookieStoreManager public func showNotification(title: String, options: NotificationOptions? = nil) -> JSPromise { - jsObject[Strings.showNotification]!(title.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.showNotification].function!(this: this, arguments: [title.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func showNotification(title: String, options: NotificationOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.showNotification]!(title.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.showNotification].function!(this: this, arguments: [title.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func getNotifications(filter: GetNotificationOptions? = nil) -> JSPromise { - jsObject[Strings.getNotifications]!(filter?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getNotifications(filter: GetNotificationOptions? = nil) async throws -> [Notification] { - let _promise: JSPromise = jsObject[Strings.getNotifications]!(filter?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -84,22 +88,26 @@ public class ServiceWorkerRegistration: EventTarget { public var updateViaCache: ServiceWorkerUpdateViaCache public func update() -> JSPromise { - jsObject[Strings.update]!().fromJSValue()! + let this = jsObject + return this[Strings.update].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func update() async throws { - let _promise: JSPromise = jsObject[Strings.update]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.update].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func unregister() -> JSPromise { - jsObject[Strings.unregister]!().fromJSValue()! + let this = jsObject + return this[Strings.unregister].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func unregister() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.unregister]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.unregister].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift index bffd68d9..f6840bc4 100644 --- a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift @@ -16,7 +16,8 @@ public class SharedWorkerGlobalScope: WorkerGlobalScope { public var name: String public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/SourceBuffer.swift b/Sources/DOMKit/WebIDL/SourceBuffer.swift index 49b4de17..e9460ebd 100644 --- a/Sources/DOMKit/WebIDL/SourceBuffer.swift +++ b/Sources/DOMKit/WebIDL/SourceBuffer.swift @@ -67,18 +67,22 @@ public class SourceBuffer: EventTarget { public var onabort: EventHandler public func appendBuffer(data: BufferSource) { - _ = jsObject[Strings.appendBuffer]!(data.jsValue()) + let this = jsObject + _ = this[Strings.appendBuffer].function!(this: this, arguments: [data.jsValue()]) } public func abort() { - _ = jsObject[Strings.abort]!() + let this = jsObject + _ = this[Strings.abort].function!(this: this, arguments: []) } public func changeType(type: String) { - _ = jsObject[Strings.changeType]!(type.jsValue()) + let this = jsObject + _ = this[Strings.changeType].function!(this: this, arguments: [type.jsValue()]) } public func remove(start: Double, end: Double) { - _ = jsObject[Strings.remove]!(start.jsValue(), end.jsValue()) + let this = jsObject + _ = this[Strings.remove].function!(this: this, arguments: [start.jsValue(), end.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift index b1703962..555faddb 100644 --- a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift +++ b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift @@ -25,10 +25,12 @@ public class SpeechGrammarList: JSBridgedClass { } public func addFromURI(src: String, weight: Float? = nil) { - _ = jsObject[Strings.addFromURI]!(src.jsValue(), weight?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.addFromURI].function!(this: this, arguments: [src.jsValue(), weight?.jsValue() ?? .undefined]) } public func addFromString(string: String, weight: Float? = nil) { - _ = jsObject[Strings.addFromString]!(string.jsValue(), weight?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.addFromString].function!(this: this, arguments: [string.jsValue(), weight?.jsValue() ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognition.swift b/Sources/DOMKit/WebIDL/SpeechRecognition.swift index 07fd0eb0..beaee50e 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognition.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognition.swift @@ -46,15 +46,18 @@ public class SpeechRecognition: EventTarget { public var maxAlternatives: UInt32 public func start() { - _ = jsObject[Strings.start]!() + let this = jsObject + _ = this[Strings.start].function!(this: this, arguments: []) } public func stop() { - _ = jsObject[Strings.stop]!() + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) } public func abort() { - _ = jsObject[Strings.abort]!() + let this = jsObject + _ = this[Strings.abort].function!(this: this, arguments: []) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift index cd7212fb..e106960f 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift @@ -27,22 +27,27 @@ public class SpeechSynthesis: EventTarget { public var onvoiceschanged: EventHandler public func speak(utterance: SpeechSynthesisUtterance) { - _ = jsObject[Strings.speak]!(utterance.jsValue()) + let this = jsObject + _ = this[Strings.speak].function!(this: this, arguments: [utterance.jsValue()]) } public func cancel() { - _ = jsObject[Strings.cancel]!() + let this = jsObject + _ = this[Strings.cancel].function!(this: this, arguments: []) } public func pause() { - _ = jsObject[Strings.pause]!() + let this = jsObject + _ = this[Strings.pause].function!(this: this, arguments: []) } public func resume() { - _ = jsObject[Strings.resume]!() + let this = jsObject + _ = this[Strings.resume].function!(this: this, arguments: []) } public func getVoices() -> [SpeechSynthesisVoice] { - jsObject[Strings.getVoices]!().fromJSValue()! + let this = jsObject + return this[Strings.getVoices].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Storage.swift b/Sources/DOMKit/WebIDL/Storage.swift index 8b97a17d..6b56752e 100644 --- a/Sources/DOMKit/WebIDL/Storage.swift +++ b/Sources/DOMKit/WebIDL/Storage.swift @@ -17,7 +17,8 @@ public class Storage: JSBridgedClass { public var length: UInt32 public func key(index: UInt32) -> String? { - jsObject[Strings.key]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.key].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } public subscript(key: String) -> String? { @@ -29,6 +30,7 @@ public class Storage: JSBridgedClass { // XXX: unsupported deleter for keys of type String public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift index 7d0e43ca..9beb8840 100644 --- a/Sources/DOMKit/WebIDL/StorageEvent.swift +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -43,6 +43,7 @@ public class StorageEvent: Event { let _arg5 = newValue?.jsValue() ?? .undefined let _arg6 = url?.jsValue() ?? .undefined let _arg7 = storageArea?.jsValue() ?? .undefined - _ = jsObject[Strings.initStorageEvent]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.initStorageEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } } diff --git a/Sources/DOMKit/WebIDL/StorageManager.swift b/Sources/DOMKit/WebIDL/StorageManager.swift index 8b73805e..2cae3ba7 100644 --- a/Sources/DOMKit/WebIDL/StorageManager.swift +++ b/Sources/DOMKit/WebIDL/StorageManager.swift @@ -13,42 +13,50 @@ public class StorageManager: JSBridgedClass { } public func getDirectory() -> JSPromise { - jsObject[Strings.getDirectory]!().fromJSValue()! + let this = jsObject + return this[Strings.getDirectory].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDirectory() async throws -> FileSystemDirectoryHandle { - let _promise: JSPromise = jsObject[Strings.getDirectory]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDirectory].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func persisted() -> JSPromise { - jsObject[Strings.persisted]!().fromJSValue()! + let this = jsObject + return this[Strings.persisted].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func persisted() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.persisted]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.persisted].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func persist() -> JSPromise { - jsObject[Strings.persist]!().fromJSValue()! + let this = jsObject + return this[Strings.persist].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func persist() async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.persist]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.persist].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func estimate() -> JSPromise { - jsObject[Strings.estimate]!().fromJSValue()! + let this = jsObject + return this[Strings.estimate].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func estimate() async throws -> StorageEstimate { - let _promise: JSPromise = jsObject[Strings.estimate]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.estimate].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/StylePropertyMap.swift b/Sources/DOMKit/WebIDL/StylePropertyMap.swift index e5c430f9..bbda3a72 100644 --- a/Sources/DOMKit/WebIDL/StylePropertyMap.swift +++ b/Sources/DOMKit/WebIDL/StylePropertyMap.swift @@ -11,18 +11,22 @@ public class StylePropertyMap: StylePropertyMapReadOnly { } public func set(property: String, values: __UNSUPPORTED_UNION__...) { - _ = jsObject[Strings.set]!(property.jsValue(), values.jsValue()) + let this = jsObject + _ = this[Strings.set].function!(this: this, arguments: [property.jsValue()] + values.map { $0.jsValue() }) } public func append(property: String, values: __UNSUPPORTED_UNION__...) { - _ = jsObject[Strings.append]!(property.jsValue(), values.jsValue()) + let this = jsObject + _ = this[Strings.append].function!(this: this, arguments: [property.jsValue()] + values.map { $0.jsValue() }) } public func delete(property: String) { - _ = jsObject[Strings.delete]!(property.jsValue()) + let this = jsObject + _ = this[Strings.delete].function!(this: this, arguments: [property.jsValue()]) } public func clear() { - _ = jsObject[Strings.clear]!() + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift b/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift index 3b70b36a..46716468 100644 --- a/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift +++ b/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift @@ -19,15 +19,18 @@ public class StylePropertyMapReadOnly: JSBridgedClass, Sequence { } public func get(property: String) -> JSValue { - jsObject[Strings.get]!(property.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } public func getAll(property: String) -> [CSSStyleValue] { - jsObject[Strings.getAll]!(property.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAll].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } public func has(property: String) -> Bool { - jsObject[Strings.has]!(property.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.has].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SubtleCrypto.swift b/Sources/DOMKit/WebIDL/SubtleCrypto.swift index e5543c41..098c1f12 100644 --- a/Sources/DOMKit/WebIDL/SubtleCrypto.swift +++ b/Sources/DOMKit/WebIDL/SubtleCrypto.swift @@ -13,112 +13,134 @@ public class SubtleCrypto: JSBridgedClass { } public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { - jsObject[Strings.encrypt]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.encrypt]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { - jsObject[Strings.decrypt]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.decrypt]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { - jsObject[Strings.sign]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.sign]!(algorithm.jsValue(), key.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) -> JSPromise { - jsObject[Strings.verify]!(algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.verify]!(algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) -> JSPromise { - jsObject[Strings.digest]!(algorithm.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.digest]!(algorithm.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { - jsObject[Strings.generateKey]!(algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.generateKey]!(algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { - jsObject[Strings.deriveKey]!(algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.deriveKey]!(algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) -> JSPromise { - jsObject[Strings.deriveBits]!(algorithm.jsValue(), baseKey.jsValue(), length.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), length.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) async throws -> ArrayBuffer { - let _promise: JSPromise = jsObject[Strings.deriveBits]!(algorithm.jsValue(), baseKey.jsValue(), length.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), length.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { - jsObject[Strings.importKey]!(format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.importKey].function!(this: this, arguments: [format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { - let _promise: JSPromise = jsObject[Strings.importKey]!(format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.importKey].function!(this: this, arguments: [format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func exportKey(format: KeyFormat, key: CryptoKey) -> JSPromise { - jsObject[Strings.exportKey]!(format.jsValue(), key.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.exportKey].function!(this: this, arguments: [format.jsValue(), key.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func exportKey(format: KeyFormat, key: CryptoKey) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.exportKey]!(format.jsValue(), key.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.exportKey].function!(this: this, arguments: [format.jsValue(), key.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) -> JSPromise { - jsObject[Strings.wrapKey]!(format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) async throws -> JSValue { - let _promise: JSPromise = jsObject[Strings.wrapKey]!(format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -130,7 +152,8 @@ public class SubtleCrypto: JSBridgedClass { let _arg4 = unwrappedKeyAlgorithm.jsValue() let _arg5 = extractable.jsValue() let _arg6 = keyUsages.jsValue() - return jsObject[Strings.unwrapKey]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6).fromJSValue()! + let this = jsObject + return this[Strings.unwrapKey].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @@ -142,7 +165,8 @@ public class SubtleCrypto: JSBridgedClass { let _arg4 = unwrappedKeyAlgorithm.jsValue() let _arg5 = extractable.jsValue() let _arg6 = keyUsages.jsValue() - let _promise: JSPromise = jsObject[Strings.unwrapKey]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.unwrapKey].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SyncManager.swift b/Sources/DOMKit/WebIDL/SyncManager.swift index d1b9589c..c65f5d85 100644 --- a/Sources/DOMKit/WebIDL/SyncManager.swift +++ b/Sources/DOMKit/WebIDL/SyncManager.swift @@ -13,22 +13,26 @@ public class SyncManager: JSBridgedClass { } public func register(tag: String) -> JSPromise { - jsObject[Strings.register]!(tag.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.register].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func register(tag: String) async throws { - let _promise: JSPromise = jsObject[Strings.register]!(tag.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func getTags() -> JSPromise { - jsObject[Strings.getTags]!().fromJSValue()! + let this = jsObject + return this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getTags() async throws -> [String] { - let _promise: JSPromise = jsObject[Strings.getTags]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Table.swift b/Sources/DOMKit/WebIDL/Table.swift index 7e467aa6..caef1bf2 100644 --- a/Sources/DOMKit/WebIDL/Table.swift +++ b/Sources/DOMKit/WebIDL/Table.swift @@ -18,15 +18,18 @@ public class Table: JSBridgedClass { } public func grow(delta: UInt32, value: JSValue? = nil) -> UInt32 { - jsObject[Strings.grow]!(delta.jsValue(), value?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.grow].function!(this: this, arguments: [delta.jsValue(), value?.jsValue() ?? .undefined]).fromJSValue()! } public func get(index: UInt32) -> JSValue { - jsObject[Strings.get]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } public func set(index: UInt32, value: JSValue? = nil) { - _ = jsObject[Strings.set]!(index.jsValue(), value?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.set].function!(this: this, arguments: [index.jsValue(), value?.jsValue() ?? .undefined]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift b/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift index 411ca578..229ebb38 100644 --- a/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift +++ b/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift @@ -27,6 +27,7 @@ public class TaskAttributionTiming: PerformanceEntry { public var containerName: String override public func toJSON() -> JSObject { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TaskController.swift b/Sources/DOMKit/WebIDL/TaskController.swift index d3f7c9ac..c88262d9 100644 --- a/Sources/DOMKit/WebIDL/TaskController.swift +++ b/Sources/DOMKit/WebIDL/TaskController.swift @@ -15,6 +15,7 @@ public class TaskController: AbortController { } public func setPriority(priority: TaskPriority) { - _ = jsObject[Strings.setPriority]!(priority.jsValue()) + let this = jsObject + _ = this[Strings.setPriority].function!(this: this, arguments: [priority.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/TestUtils.swift b/Sources/DOMKit/WebIDL/TestUtils.swift index ccf2ead4..be0ba7a9 100644 --- a/Sources/DOMKit/WebIDL/TestUtils.swift +++ b/Sources/DOMKit/WebIDL/TestUtils.swift @@ -9,12 +9,14 @@ public enum TestUtils { } public static func gc() -> JSPromise { - JSObject.global[Strings.TestUtils].object![Strings.gc]!().fromJSValue()! + let this = JSObject.global[Strings.TestUtils].object! + return this[Strings.gc].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func gc() async throws { - let _promise: JSPromise = JSObject.global[Strings.TestUtils].object![Strings.gc]!().fromJSValue()! + let this = JSObject.global[Strings.TestUtils].object! + let _promise: JSPromise = this[Strings.gc].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index c64515c4..5bbf1e96 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -16,7 +16,8 @@ public class Text: CharacterData, GeometryUtils, Slottable { } public func splitText(offset: UInt32) -> Self { - jsObject[Strings.splitText]!(offset.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.splitText].function!(this: this, arguments: [offset.jsValue()]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TextDecoder.swift b/Sources/DOMKit/WebIDL/TextDecoder.swift index 524fd36c..de92ba3e 100644 --- a/Sources/DOMKit/WebIDL/TextDecoder.swift +++ b/Sources/DOMKit/WebIDL/TextDecoder.swift @@ -17,6 +17,7 @@ public class TextDecoder: JSBridgedClass, TextDecoderCommon { } public func decode(input: BufferSource? = nil, options: TextDecodeOptions? = nil) -> String { - jsObject[Strings.decode]!(input?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.decode].function!(this: this, arguments: [input?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextDetector.swift b/Sources/DOMKit/WebIDL/TextDetector.swift index 46f485bf..a2f36083 100644 --- a/Sources/DOMKit/WebIDL/TextDetector.swift +++ b/Sources/DOMKit/WebIDL/TextDetector.swift @@ -17,12 +17,14 @@ public class TextDetector: JSBridgedClass { } public func detect(image: ImageBitmapSource) -> JSPromise { - jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func detect(image: ImageBitmapSource) async throws -> [DetectedText] { - let _promise: JSPromise = jsObject[Strings.detect]!(image.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextEncoder.swift b/Sources/DOMKit/WebIDL/TextEncoder.swift index f85a557a..ebd960fb 100644 --- a/Sources/DOMKit/WebIDL/TextEncoder.swift +++ b/Sources/DOMKit/WebIDL/TextEncoder.swift @@ -17,10 +17,12 @@ public class TextEncoder: JSBridgedClass, TextEncoderCommon { } public func encode(input: String? = nil) -> Uint8Array { - jsObject[Strings.encode]!(input?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.encode].function!(this: this, arguments: [input?.jsValue() ?? .undefined]).fromJSValue()! } public func encodeInto(source: String, destination: Uint8Array) -> TextEncoderEncodeIntoResult { - jsObject[Strings.encodeInto]!(source.jsValue(), destination.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.encodeInto].function!(this: this, arguments: [source.jsValue(), destination.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift index 4d7262b4..a078b0d4 100644 --- a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift @@ -15,6 +15,7 @@ public class TextFormatUpdateEvent: Event { } public func getTextFormats() -> [TextFormat] { - jsObject[Strings.getTextFormats]!().fromJSValue()! + let this = jsObject + return this[Strings.getTextFormats].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index 5b01b992..7a250269 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -45,11 +45,13 @@ public class TextTrack: EventTarget { public var activeCues: TextTrackCueList? public func addCue(cue: TextTrackCue) { - _ = jsObject[Strings.addCue]!(cue.jsValue()) + let this = jsObject + _ = this[Strings.addCue].function!(this: this, arguments: [cue.jsValue()]) } public func removeCue(cue: TextTrackCue) { - _ = jsObject[Strings.removeCue]!(cue.jsValue()) + let this = jsObject + _ = this[Strings.removeCue].function!(this: this, arguments: [cue.jsValue()]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/TextTrackCueList.swift b/Sources/DOMKit/WebIDL/TextTrackCueList.swift index 923f5dfd..aaf57f06 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCueList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCueList.swift @@ -21,6 +21,7 @@ public class TextTrackCueList: JSBridgedClass { } public func getCueById(id: String) -> TextTrackCue? { - jsObject[Strings.getCueById]!(id.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getCueById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift index 93fb5e70..1c55ef90 100644 --- a/Sources/DOMKit/WebIDL/TextTrackList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -22,7 +22,8 @@ public class TextTrackList: EventTarget { } public func getTrackById(id: String) -> TextTrack? { - jsObject[Strings.getTrackById]!(id.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/TimeEvent.swift b/Sources/DOMKit/WebIDL/TimeEvent.swift index 3a55ec83..e6119db5 100644 --- a/Sources/DOMKit/WebIDL/TimeEvent.swift +++ b/Sources/DOMKit/WebIDL/TimeEvent.swift @@ -19,6 +19,7 @@ public class TimeEvent: Event { public var detail: Int32 public func initTimeEvent(typeArg: String, viewArg: Window?, detailArg: Int32) { - _ = jsObject[Strings.initTimeEvent]!(typeArg.jsValue(), viewArg.jsValue(), detailArg.jsValue()) + let this = jsObject + _ = this[Strings.initTimeEvent].function!(this: this, arguments: [typeArg.jsValue(), viewArg.jsValue(), detailArg.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/TimeRanges.swift b/Sources/DOMKit/WebIDL/TimeRanges.swift index b65092e4..2d0b36aa 100644 --- a/Sources/DOMKit/WebIDL/TimeRanges.swift +++ b/Sources/DOMKit/WebIDL/TimeRanges.swift @@ -17,10 +17,12 @@ public class TimeRanges: JSBridgedClass { public var length: UInt32 public func start(index: UInt32) -> Double { - jsObject[Strings.start]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.start].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } public func end(index: UInt32) -> Double { - jsObject[Strings.end]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.end].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift index 795c6578..c46dec08 100644 --- a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift @@ -17,14 +17,17 @@ public class TransformStreamDefaultController: JSBridgedClass { public var desiredSize: Double? public func enqueue(chunk: JSValue? = nil) { - _ = jsObject[Strings.enqueue]!(chunk?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.enqueue].function!(this: this, arguments: [chunk?.jsValue() ?? .undefined]) } public func error(reason: JSValue? = nil) { - _ = jsObject[Strings.error]!(reason?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.error].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]) } public func terminate() { - _ = jsObject[Strings.terminate]!() + let this = jsObject + _ = this[Strings.terminate].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/TreeWalker.swift b/Sources/DOMKit/WebIDL/TreeWalker.swift index 68a5f0c2..c836a365 100644 --- a/Sources/DOMKit/WebIDL/TreeWalker.swift +++ b/Sources/DOMKit/WebIDL/TreeWalker.swift @@ -27,30 +27,37 @@ public class TreeWalker: JSBridgedClass { public var currentNode: Node public func parentNode() -> Node? { - jsObject[Strings.parentNode]!().fromJSValue()! + let this = jsObject + return this[Strings.parentNode].function!(this: this, arguments: []).fromJSValue()! } public func firstChild() -> Node? { - jsObject[Strings.firstChild]!().fromJSValue()! + let this = jsObject + return this[Strings.firstChild].function!(this: this, arguments: []).fromJSValue()! } public func lastChild() -> Node? { - jsObject[Strings.lastChild]!().fromJSValue()! + let this = jsObject + return this[Strings.lastChild].function!(this: this, arguments: []).fromJSValue()! } public func previousSibling() -> Node? { - jsObject[Strings.previousSibling]!().fromJSValue()! + let this = jsObject + return this[Strings.previousSibling].function!(this: this, arguments: []).fromJSValue()! } public func nextSibling() -> Node? { - jsObject[Strings.nextSibling]!().fromJSValue()! + let this = jsObject + return this[Strings.nextSibling].function!(this: this, arguments: []).fromJSValue()! } public func previousNode() -> Node? { - jsObject[Strings.previousNode]!().fromJSValue()! + let this = jsObject + return this[Strings.previousNode].function!(this: this, arguments: []).fromJSValue()! } public func nextNode() -> Node? { - jsObject[Strings.nextNode]!().fromJSValue()! + let this = jsObject + return this[Strings.nextNode].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrustedHTML.swift b/Sources/DOMKit/WebIDL/TrustedHTML.swift index fb37781f..ebfcb6b3 100644 --- a/Sources/DOMKit/WebIDL/TrustedHTML.swift +++ b/Sources/DOMKit/WebIDL/TrustedHTML.swift @@ -17,10 +17,12 @@ public class TrustedHTML: JSBridgedClass { } public func toJSON() -> String { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } public static func fromLiteral(templateStringsArray: JSObject) -> Self { - constructor[Strings.fromLiteral]!(templateStringsArray.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrustedScript.swift b/Sources/DOMKit/WebIDL/TrustedScript.swift index 67c2ddee..aff9821d 100644 --- a/Sources/DOMKit/WebIDL/TrustedScript.swift +++ b/Sources/DOMKit/WebIDL/TrustedScript.swift @@ -17,10 +17,12 @@ public class TrustedScript: JSBridgedClass { } public func toJSON() -> String { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } public static func fromLiteral(templateStringsArray: JSObject) -> Self { - constructor[Strings.fromLiteral]!(templateStringsArray.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrustedScriptURL.swift b/Sources/DOMKit/WebIDL/TrustedScriptURL.swift index 0cc8d14a..f356ea07 100644 --- a/Sources/DOMKit/WebIDL/TrustedScriptURL.swift +++ b/Sources/DOMKit/WebIDL/TrustedScriptURL.swift @@ -17,10 +17,12 @@ public class TrustedScriptURL: JSBridgedClass { } public func toJSON() -> String { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } public static func fromLiteral(templateStringsArray: JSObject) -> Self { - constructor[Strings.fromLiteral]!(templateStringsArray.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift index a78af7da..1e72c340 100644 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift @@ -17,14 +17,17 @@ public class TrustedTypePolicy: JSBridgedClass { public var name: String public func createHTML(input: String, arguments: JSValue...) -> TrustedHTML { - jsObject[Strings.createHTML]!(input.jsValue(), arguments.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createHTML].function!(this: this, arguments: [input.jsValue()] + arguments.map { $0.jsValue() }).fromJSValue()! } public func createScript(input: String, arguments: JSValue...) -> TrustedScript { - jsObject[Strings.createScript]!(input.jsValue(), arguments.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createScript].function!(this: this, arguments: [input.jsValue()] + arguments.map { $0.jsValue() }).fromJSValue()! } public func createScriptURL(input: String, arguments: JSValue...) -> TrustedScriptURL { - jsObject[Strings.createScriptURL]!(input.jsValue(), arguments.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createScriptURL].function!(this: this, arguments: [input.jsValue()] + arguments.map { $0.jsValue() }).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift index f63c4721..bbaa1e0b 100644 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift @@ -16,19 +16,23 @@ public class TrustedTypePolicyFactory: JSBridgedClass { } public func createPolicy(policyName: String, policyOptions: TrustedTypePolicyOptions? = nil) -> TrustedTypePolicy { - jsObject[Strings.createPolicy]!(policyName.jsValue(), policyOptions?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createPolicy].function!(this: this, arguments: [policyName.jsValue(), policyOptions?.jsValue() ?? .undefined]).fromJSValue()! } public func isHTML(value: JSValue) -> Bool { - jsObject[Strings.isHTML]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isHTML].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public func isScript(value: JSValue) -> Bool { - jsObject[Strings.isScript]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isScript].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } public func isScriptURL(value: JSValue) -> Bool { - jsObject[Strings.isScriptURL]!(value.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isScriptURL].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @ReadonlyAttribute @@ -38,11 +42,13 @@ public class TrustedTypePolicyFactory: JSBridgedClass { public var emptyScript: TrustedScript public func getAttributeType(tagName: String, attribute: String, elementNs: String? = nil, attrNs: String? = nil) -> String? { - jsObject[Strings.getAttributeType]!(tagName.jsValue(), attribute.jsValue(), elementNs?.jsValue() ?? .undefined, attrNs?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getAttributeType].function!(this: this, arguments: [tagName.jsValue(), attribute.jsValue(), elementNs?.jsValue() ?? .undefined, attrNs?.jsValue() ?? .undefined]).fromJSValue()! } public func getPropertyType(tagName: String, property: String, elementNs: String? = nil) -> String? { - jsObject[Strings.getPropertyType]!(tagName.jsValue(), property.jsValue(), elementNs?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getPropertyType].function!(this: this, arguments: [tagName.jsValue(), property.jsValue(), elementNs?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index 144871e1..d25843f0 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -28,7 +28,8 @@ public class UIEvent: Event { public var detail: Int32 public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil) { - _ = jsObject[Strings.initUIEvent]!(typeArg.jsValue(), bubblesArg?.jsValue() ?? .undefined, cancelableArg?.jsValue() ?? .undefined, viewArg?.jsValue() ?? .undefined, detailArg?.jsValue() ?? .undefined) + 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 diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index 5257eebf..c0f5818c 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -25,11 +25,13 @@ public class URL: JSBridgedClass { } public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { - constructor[Strings.createObjectURL]!(obj.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.createObjectURL].function!(this: this, arguments: [obj.jsValue()]).fromJSValue()! } public static func revokeObjectURL(url: String) { - _ = constructor[Strings.revokeObjectURL]!(url.jsValue()) + let this = constructor + _ = this[Strings.revokeObjectURL].function!(this: this, arguments: [url.jsValue()]) } public convenience init(url: String, base: String? = nil) { @@ -73,6 +75,7 @@ public class URL: JSBridgedClass { public var hash: String public func toJSON() -> String { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/URLPattern.swift b/Sources/DOMKit/WebIDL/URLPattern.swift index 8db10776..da305681 100644 --- a/Sources/DOMKit/WebIDL/URLPattern.swift +++ b/Sources/DOMKit/WebIDL/URLPattern.swift @@ -25,11 +25,13 @@ public class URLPattern: JSBridgedClass { } public func test(input: URLPatternInput? = nil, baseURL: String? = nil) -> Bool { - jsObject[Strings.test]!(input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.test].function!(this: this, arguments: [input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined]).fromJSValue()! } public func exec(input: URLPatternInput? = nil, baseURL: String? = nil) -> URLPatternResult? { - jsObject[Strings.exec]!(input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.exec].function!(this: this, arguments: [input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/URLSearchParams.swift b/Sources/DOMKit/WebIDL/URLSearchParams.swift index 2fb1ff8a..f2a10120 100644 --- a/Sources/DOMKit/WebIDL/URLSearchParams.swift +++ b/Sources/DOMKit/WebIDL/URLSearchParams.swift @@ -17,31 +17,38 @@ public class URLSearchParams: JSBridgedClass, Sequence { } public func append(name: String, value: String) { - _ = jsObject[Strings.append]!(name.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } public func delete(name: String) { - _ = jsObject[Strings.delete]!(name.jsValue()) + let this = jsObject + _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]) } public func get(name: String) -> String? { - jsObject[Strings.get]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func getAll(name: String) -> [String] { - jsObject[Strings.getAll]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func has(name: String) -> Bool { - jsObject[Strings.has]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.has].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func set(name: String, value: String) { - _ = jsObject[Strings.set]!(name.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } public func sort() { - _ = jsObject[Strings.sort]!() + let this = jsObject + _ = this[Strings.sort].function!(this: this, arguments: []) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/USB.swift b/Sources/DOMKit/WebIDL/USB.swift index ba29f4a6..b00fb2c8 100644 --- a/Sources/DOMKit/WebIDL/USB.swift +++ b/Sources/DOMKit/WebIDL/USB.swift @@ -19,22 +19,26 @@ public class USB: EventTarget { public var ondisconnect: EventHandler public func getDevices() -> JSPromise { - jsObject[Strings.getDevices]!().fromJSValue()! + let this = jsObject + return this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDevices() async throws -> [USBDevice] { - let _promise: JSPromise = jsObject[Strings.getDevices]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func requestDevice(options: USBDeviceRequestOptions) -> JSPromise { - jsObject[Strings.requestDevice]!(options.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestDevice(options: USBDeviceRequestOptions) async throws -> USBDevice { - let _promise: JSPromise = jsObject[Strings.requestDevice]!(options.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/USBDevice.swift b/Sources/DOMKit/WebIDL/USBDevice.swift index 1f010dad..fdad1ae7 100644 --- a/Sources/DOMKit/WebIDL/USBDevice.swift +++ b/Sources/DOMKit/WebIDL/USBDevice.swift @@ -81,152 +81,182 @@ public class USBDevice: JSBridgedClass { public var opened: Bool public func open() -> JSPromise { - jsObject[Strings.open]!().fromJSValue()! + let this = jsObject + return this[Strings.open].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func open() async throws { - let _promise: JSPromise = jsObject[Strings.open]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject[Strings.close]!().fromJSValue()! + 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, *) public func close() async throws { - let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func forget() -> JSPromise { - jsObject[Strings.forget]!().fromJSValue()! + let this = jsObject + return this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func forget() async throws { - let _promise: JSPromise = jsObject[Strings.forget]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func selectConfiguration(configurationValue: UInt8) -> JSPromise { - jsObject[Strings.selectConfiguration]!(configurationValue.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func selectConfiguration(configurationValue: UInt8) async throws { - let _promise: JSPromise = jsObject[Strings.selectConfiguration]!(configurationValue.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func claimInterface(interfaceNumber: UInt8) -> JSPromise { - jsObject[Strings.claimInterface]!(interfaceNumber.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func claimInterface(interfaceNumber: UInt8) async throws { - let _promise: JSPromise = jsObject[Strings.claimInterface]!(interfaceNumber.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func releaseInterface(interfaceNumber: UInt8) -> JSPromise { - jsObject[Strings.releaseInterface]!(interfaceNumber.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func releaseInterface(interfaceNumber: UInt8) async throws { - let _promise: JSPromise = jsObject[Strings.releaseInterface]!(interfaceNumber.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) -> JSPromise { - jsObject[Strings.selectAlternateInterface]!(interfaceNumber.jsValue(), alternateSetting.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue(), alternateSetting.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) async throws { - let _promise: JSPromise = jsObject[Strings.selectAlternateInterface]!(interfaceNumber.jsValue(), alternateSetting.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue(), alternateSetting.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) -> JSPromise { - jsObject[Strings.controlTransferIn]!(setup.jsValue(), length.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue(), length.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) async throws -> USBInTransferResult { - let _promise: JSPromise = jsObject[Strings.controlTransferIn]!(setup.jsValue(), length.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue(), length.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) -> JSPromise { - jsObject[Strings.controlTransferOut]!(setup.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue(), data?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) async throws -> USBOutTransferResult { - let _promise: JSPromise = jsObject[Strings.controlTransferOut]!(setup.jsValue(), data?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue(), data?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func clearHalt(direction: USBDirection, endpointNumber: UInt8) -> JSPromise { - jsObject[Strings.clearHalt]!(direction.jsValue(), endpointNumber.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue(), endpointNumber.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func clearHalt(direction: USBDirection, endpointNumber: UInt8) async throws { - let _promise: JSPromise = jsObject[Strings.clearHalt]!(direction.jsValue(), endpointNumber.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue(), endpointNumber.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func transferIn(endpointNumber: UInt8, length: UInt32) -> JSPromise { - jsObject[Strings.transferIn]!(endpointNumber.jsValue(), length.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue(), length.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func transferIn(endpointNumber: UInt8, length: UInt32) async throws -> USBInTransferResult { - let _promise: JSPromise = jsObject[Strings.transferIn]!(endpointNumber.jsValue(), length.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue(), length.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func transferOut(endpointNumber: UInt8, data: BufferSource) -> JSPromise { - jsObject[Strings.transferOut]!(endpointNumber.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func transferOut(endpointNumber: UInt8, data: BufferSource) async throws -> USBOutTransferResult { - let _promise: JSPromise = jsObject[Strings.transferOut]!(endpointNumber.jsValue(), data.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) -> JSPromise { - jsObject[Strings.isochronousTransferIn]!(endpointNumber.jsValue(), packetLengths.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue(), packetLengths.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) async throws -> USBIsochronousInTransferResult { - let _promise: JSPromise = jsObject[Strings.isochronousTransferIn]!(endpointNumber.jsValue(), packetLengths.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue(), packetLengths.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) -> JSPromise { - jsObject[Strings.isochronousTransferOut]!(endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) async throws -> USBIsochronousOutTransferResult { - let _promise: JSPromise = jsObject[Strings.isochronousTransferOut]!(endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func reset() -> JSPromise { - jsObject[Strings.reset]!().fromJSValue()! + let this = jsObject + return this[Strings.reset].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func reset() async throws { - let _promise: JSPromise = jsObject[Strings.reset]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.reset].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/VTTCue.swift b/Sources/DOMKit/WebIDL/VTTCue.swift index d7c3f49f..998c9180 100644 --- a/Sources/DOMKit/WebIDL/VTTCue.swift +++ b/Sources/DOMKit/WebIDL/VTTCue.swift @@ -55,6 +55,7 @@ public class VTTCue: TextTrackCue { public var text: String public func getCueAsHTML() -> DocumentFragment { - jsObject[Strings.getCueAsHTML]!().fromJSValue()! + let this = jsObject + return this[Strings.getCueAsHTML].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/VideoColorSpace.swift b/Sources/DOMKit/WebIDL/VideoColorSpace.swift index 317b9fb9..cfa4441f 100644 --- a/Sources/DOMKit/WebIDL/VideoColorSpace.swift +++ b/Sources/DOMKit/WebIDL/VideoColorSpace.swift @@ -33,6 +33,7 @@ public class VideoColorSpace: JSBridgedClass { public var fullRange: Bool? public func toJSON() -> VideoColorSpaceInit { - jsObject[Strings.toJSON]!().fromJSValue()! + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/VideoDecoder.swift b/Sources/DOMKit/WebIDL/VideoDecoder.swift index 2221c97d..d9911c8a 100644 --- a/Sources/DOMKit/WebIDL/VideoDecoder.swift +++ b/Sources/DOMKit/WebIDL/VideoDecoder.swift @@ -25,38 +25,46 @@ public class VideoDecoder: JSBridgedClass { public var decodeQueueSize: UInt32 public func configure(config: VideoDecoderConfig) { - _ = jsObject[Strings.configure]!(config.jsValue()) + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) } public func decode(chunk: EncodedVideoChunk) { - _ = jsObject[Strings.decode]!(chunk.jsValue()) + let this = jsObject + _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue()]) } public func flush() -> JSPromise { - jsObject[Strings.flush]!().fromJSValue()! + 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, *) public func flush() async throws { - let _promise: JSPromise = jsObject[Strings.flush]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func reset() { - _ = jsObject[Strings.reset]!() + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public static func isConfigSupported(config: VideoDecoderConfig) -> JSPromise { - constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + 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, *) public static func isConfigSupported(config: VideoDecoderConfig) async throws -> VideoDecoderSupport { - let _promise: JSPromise = constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/VideoEncoder.swift b/Sources/DOMKit/WebIDL/VideoEncoder.swift index 0e160e71..994a9237 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoder.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoder.swift @@ -25,38 +25,46 @@ public class VideoEncoder: JSBridgedClass { public var encodeQueueSize: UInt32 public func configure(config: VideoEncoderConfig) { - _ = jsObject[Strings.configure]!(config.jsValue()) + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) } public func encode(frame: VideoFrame, options: VideoEncoderEncodeOptions? = nil) { - _ = jsObject[Strings.encode]!(frame.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.encode].function!(this: this, arguments: [frame.jsValue(), options?.jsValue() ?? .undefined]) } public func flush() -> JSPromise { - jsObject[Strings.flush]!().fromJSValue()! + 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, *) public func flush() async throws { - let _promise: JSPromise = jsObject[Strings.flush]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func reset() { - _ = jsObject[Strings.reset]!() + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } public static func isConfigSupported(config: VideoEncoderConfig) -> JSPromise { - constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + 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, *) public static func isConfigSupported(config: VideoEncoderConfig) async throws -> VideoEncoderSupport { - let _promise: JSPromise = constructor[Strings.isConfigSupported]!(config.jsValue()).fromJSValue()! + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/VideoFrame.swift b/Sources/DOMKit/WebIDL/VideoFrame.swift index 6f32b12a..03140357 100644 --- a/Sources/DOMKit/WebIDL/VideoFrame.swift +++ b/Sources/DOMKit/WebIDL/VideoFrame.swift @@ -61,24 +61,29 @@ public class VideoFrame: JSBridgedClass { public var colorSpace: VideoColorSpace public func allocationSize(options: VideoFrameCopyToOptions? = nil) -> UInt32 { - jsObject[Strings.allocationSize]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.allocationSize].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) -> JSPromise { - jsObject[Strings.copyTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) async throws -> [PlaneLayout] { - let _promise: JSPromise = jsObject[Strings.copyTo]!(destination.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func clone() -> Self { - jsObject[Strings.clone]!().fromJSValue()! + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift index a46c9046..ee221d1c 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackList.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -23,7 +23,8 @@ public class VideoTrackList: EventTarget { } public func getTrackById(id: String) -> VideoTrack? { - jsObject[Strings.getTrackById]!(id.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/VirtualKeyboard.swift b/Sources/DOMKit/WebIDL/VirtualKeyboard.swift index afeaa704..f9867aca 100644 --- a/Sources/DOMKit/WebIDL/VirtualKeyboard.swift +++ b/Sources/DOMKit/WebIDL/VirtualKeyboard.swift @@ -14,11 +14,13 @@ public class VirtualKeyboard: EventTarget { } public func show() { - _ = jsObject[Strings.show]!() + let this = jsObject + _ = this[Strings.show].function!(this: this, arguments: []) } public func hide() { - _ = jsObject[Strings.hide]!() + let this = jsObject + _ = this[Strings.hide].function!(this: this, arguments: []) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift index 5034ca2e..008acd49 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift @@ -69,6 +69,7 @@ public class WEBGL_compressed_texture_astc: JSBridgedClass { public static let COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum = 0x93DD public func getSupportedProfiles() -> [String] { - jsObject[Strings.getSupportedProfiles]!().fromJSValue()! + let this = jsObject + return this[Strings.getSupportedProfiles].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift b/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift index e2859f5b..9070a4ce 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift @@ -13,6 +13,7 @@ public class WEBGL_debug_shaders: JSBridgedClass { } public func getTranslatedShaderSource(shader: WebGLShader) -> String { - jsObject[Strings.getTranslatedShaderSource]!(shader.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getTranslatedShaderSource].function!(this: this, arguments: [shader.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift index 08547d58..0c94a406 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift @@ -81,6 +81,7 @@ public class WEBGL_draw_buffers: JSBridgedClass { public static let MAX_DRAW_BUFFERS_WEBGL: GLenum = 0x8824 public func drawBuffersWEBGL(buffers: [GLenum]) { - _ = jsObject[Strings.drawBuffersWEBGL]!(buffers.jsValue()) + let this = jsObject + _ = this[Strings.drawBuffersWEBGL].function!(this: this, arguments: [buffers.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift index dc79938a..3fb9c47d 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift @@ -13,7 +13,8 @@ public class WEBGL_draw_instanced_base_vertex_base_instance: JSBridgedClass { } public func drawArraysInstancedBaseInstanceWEBGL(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei, baseInstance: GLuint) { - _ = jsObject[Strings.drawArraysInstancedBaseInstanceWEBGL]!(mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue(), baseInstance.jsValue()) + let this = jsObject + _ = this[Strings.drawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue(), baseInstance.jsValue()]) } public func drawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei, baseVertex: GLint, baseInstance: GLuint) { @@ -24,6 +25,7 @@ public class WEBGL_draw_instanced_base_vertex_base_instance: JSBridgedClass { let _arg4 = instanceCount.jsValue() let _arg5 = baseVertex.jsValue() let _arg6 = baseInstance.jsValue() - _ = jsObject[Strings.drawElementsInstancedBaseVertexBaseInstanceWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + let this = jsObject + _ = this[Strings.drawElementsInstancedBaseVertexBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } } diff --git a/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift b/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift index 2e821ede..39f4de21 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift @@ -13,10 +13,12 @@ public class WEBGL_lose_context: JSBridgedClass { } public func loseContext() { - _ = jsObject[Strings.loseContext]!() + let this = jsObject + _ = this[Strings.loseContext].function!(this: this, arguments: []) } public func restoreContext() { - _ = jsObject[Strings.restoreContext]!() + let this = jsObject + _ = this[Strings.restoreContext].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift index b59829d4..fbab1ef3 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift @@ -19,7 +19,8 @@ public class WEBGL_multi_draw: JSBridgedClass { let _arg3 = countsList.jsValue() let _arg4 = countsOffset.jsValue() let _arg5 = drawcount.jsValue() - _ = jsObject[Strings.multiDrawArraysWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.multiDrawArraysWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } public func multiDrawElementsWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, drawcount: GLsizei) { @@ -30,7 +31,8 @@ public class WEBGL_multi_draw: JSBridgedClass { let _arg4 = offsetsList.jsValue() let _arg5 = offsetsOffset.jsValue() let _arg6 = drawcount.jsValue() - _ = jsObject[Strings.multiDrawElementsWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + let this = jsObject + _ = this[Strings.multiDrawElementsWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } public func multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { @@ -42,7 +44,8 @@ public class WEBGL_multi_draw: JSBridgedClass { let _arg5 = instanceCountsList.jsValue() let _arg6 = instanceCountsOffset.jsValue() let _arg7 = drawcount.jsValue() - _ = jsObject[Strings.multiDrawArraysInstancedWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.multiDrawArraysInstancedWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } public func multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { @@ -55,6 +58,7 @@ public class WEBGL_multi_draw: JSBridgedClass { let _arg6 = instanceCountsList.jsValue() let _arg7 = instanceCountsOffset.jsValue() let _arg8 = drawcount.jsValue() - _ = jsObject[Strings.multiDrawElementsInstancedWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.multiDrawElementsInstancedWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } } diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift index 36b1b5b2..2d994a59 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift @@ -23,7 +23,8 @@ public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClas let _arg7 = baseInstancesList.jsValue() let _arg8 = baseInstancesOffset.jsValue() let _arg9 = drawCount.jsValue() - _ = jsObject[Strings.multiDrawArraysInstancedBaseInstanceWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.multiDrawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } public func multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, baseVerticesList: __UNSUPPORTED_UNION__, baseVerticesOffset: GLuint, baseInstancesList: __UNSUPPORTED_UNION__, baseInstancesOffset: GLuint, drawCount: GLsizei) { @@ -40,6 +41,7 @@ public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClas let _arg10 = baseInstancesList.jsValue() let _arg11 = baseInstancesOffset.jsValue() let _arg12 = drawCount.jsValue() - _ = jsObject[Strings.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12) + let this = jsObject + _ = this[Strings.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12]) } } diff --git a/Sources/DOMKit/WebIDL/WakeLock.swift b/Sources/DOMKit/WebIDL/WakeLock.swift index 2307513f..9344b430 100644 --- a/Sources/DOMKit/WebIDL/WakeLock.swift +++ b/Sources/DOMKit/WebIDL/WakeLock.swift @@ -13,12 +13,14 @@ public class WakeLock: JSBridgedClass { } public func request(type: WakeLockType? = nil) -> JSPromise { - jsObject[Strings.request]!(type?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.request].function!(this: this, arguments: [type?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func request(type: WakeLockType? = nil) async throws -> WakeLockSentinel { - let _promise: JSPromise = jsObject[Strings.request]!(type?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [type?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift index 2616b120..b6e3da4b 100644 --- a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift +++ b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift @@ -20,12 +20,14 @@ public class WakeLockSentinel: EventTarget { public var type: WakeLockType public func release() -> JSPromise { - jsObject[Strings.release]!().fromJSValue()! + let this = jsObject + return this[Strings.release].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func release() async throws { - let _promise: JSPromise = jsObject[Strings.release]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.release].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/WebAssembly.swift b/Sources/DOMKit/WebIDL/WebAssembly.swift index 7e955997..f4394fa5 100644 --- a/Sources/DOMKit/WebIDL/WebAssembly.swift +++ b/Sources/DOMKit/WebIDL/WebAssembly.swift @@ -9,56 +9,67 @@ public enum WebAssembly { } public static func validate(bytes: BufferSource) -> Bool { - JSObject.global[Strings.WebAssembly].object![Strings.validate]!(bytes.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + return this[Strings.validate].function!(this: this, arguments: [bytes.jsValue()]).fromJSValue()! } public static func compile(bytes: BufferSource) -> JSPromise { - JSObject.global[Strings.WebAssembly].object![Strings.compile]!(bytes.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + return this[Strings.compile].function!(this: this, arguments: [bytes.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func compile(bytes: BufferSource) async throws -> Module { - let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.compile]!(bytes.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + let _promise: JSPromise = this[Strings.compile].function!(this: this, arguments: [bytes.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) -> JSPromise { - JSObject.global[Strings.WebAssembly].object![Strings.instantiate]!(bytes.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + return this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { - let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.instantiate]!(bytes.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) -> JSPromise { - JSObject.global[Strings.WebAssembly].object![Strings.instantiate]!(moduleObject.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + return this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) async throws -> Instance { - let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.instantiate]!(moduleObject.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func compileStreaming(source: JSPromise) -> JSPromise { - JSObject.global[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + return this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func compileStreaming(source: JSPromise) async throws -> Module { - let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.compileStreaming]!(source.jsValue()).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + let _promise: JSPromise = this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) -> JSPromise { - JSObject.global[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + return this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { - let _promise: JSPromise = JSObject.global[Strings.WebAssembly].object![Strings.instantiateStreaming]!(source.jsValue(), importObject?.jsValue() ?? .undefined).fromJSValue()! + let this = JSObject.global[Strings.WebAssembly].object! + let _promise: JSPromise = this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift index 961338b5..4db3df7d 100644 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift @@ -532,11 +532,13 @@ public extension WebGL2RenderingContextBase { static let MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum = 0x9247 func copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) { - _ = jsObject[Strings.copyBufferSubData]!(readTarget.jsValue(), writeTarget.jsValue(), readOffset.jsValue(), writeOffset.jsValue(), size.jsValue()) + let this = jsObject + _ = this[Strings.copyBufferSubData].function!(this: this, arguments: [readTarget.jsValue(), writeTarget.jsValue(), readOffset.jsValue(), writeOffset.jsValue(), size.jsValue()]) } func getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset: GLuint? = nil, length: GLuint? = nil) { - _ = jsObject[Strings.getBufferSubData]!(target.jsValue(), srcByteOffset.jsValue(), dstBuffer.jsValue(), dstOffset?.jsValue() ?? .undefined, length?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.getBufferSubData].function!(this: this, arguments: [target.jsValue(), srcByteOffset.jsValue(), dstBuffer.jsValue(), dstOffset?.jsValue() ?? .undefined, length?.jsValue() ?? .undefined]) } func blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum) { @@ -550,15 +552,18 @@ public extension WebGL2RenderingContextBase { let _arg7 = dstY1.jsValue() let _arg8 = mask.jsValue() let _arg9 = filter.jsValue() - _ = jsObject[Strings.blitFramebuffer]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.blitFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } func framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, layer: GLint) { - _ = jsObject[Strings.framebufferTextureLayer]!(target.jsValue(), attachment.jsValue(), texture.jsValue(), level.jsValue(), layer.jsValue()) + let this = jsObject + _ = this[Strings.framebufferTextureLayer].function!(this: this, arguments: [target.jsValue(), attachment.jsValue(), texture.jsValue(), level.jsValue(), layer.jsValue()]) } func invalidateFramebuffer(target: GLenum, attachments: [GLenum]) { - _ = jsObject[Strings.invalidateFramebuffer]!(target.jsValue(), attachments.jsValue()) + let this = jsObject + _ = this[Strings.invalidateFramebuffer].function!(this: this, arguments: [target.jsValue(), attachments.jsValue()]) } func invalidateSubFramebuffer(target: GLenum, attachments: [GLenum], x: GLint, y: GLint, width: GLsizei, height: GLsizei) { @@ -568,23 +573,28 @@ public extension WebGL2RenderingContextBase { let _arg3 = y.jsValue() let _arg4 = width.jsValue() let _arg5 = height.jsValue() - _ = jsObject[Strings.invalidateSubFramebuffer]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.invalidateSubFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func readBuffer(src: GLenum) { - _ = jsObject[Strings.readBuffer]!(src.jsValue()) + let this = jsObject + _ = this[Strings.readBuffer].function!(this: this, arguments: [src.jsValue()]) } func getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum) -> JSValue { - jsObject[Strings.getInternalformatParameter]!(target.jsValue(), internalformat.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getInternalformatParameter].function!(this: this, arguments: [target.jsValue(), internalformat.jsValue(), pname.jsValue()]).fromJSValue()! } func renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { - _ = jsObject[Strings.renderbufferStorageMultisample]!(target.jsValue(), samples.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()) + let this = jsObject + _ = this[Strings.renderbufferStorageMultisample].function!(this: this, arguments: [target.jsValue(), samples.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()]) } func texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { - _ = jsObject[Strings.texStorage2D]!(target.jsValue(), levels.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()) + let this = jsObject + _ = this[Strings.texStorage2D].function!(this: this, arguments: [target.jsValue(), levels.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()]) } func texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) { @@ -594,7 +604,8 @@ public extension WebGL2RenderingContextBase { let _arg3 = width.jsValue() let _arg4 = height.jsValue() let _arg5 = depth.jsValue() - _ = jsObject[Strings.texStorage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.texStorage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { @@ -608,7 +619,8 @@ public extension WebGL2RenderingContextBase { let _arg7 = format.jsValue() let _arg8 = type.jsValue() let _arg9 = pboOffset.jsValue() - _ = jsObject[Strings.texImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { @@ -622,7 +634,8 @@ public extension WebGL2RenderingContextBase { let _arg7 = format.jsValue() let _arg8 = type.jsValue() let _arg9 = source.jsValue() - _ = jsObject[Strings.texImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView?) { @@ -636,7 +649,8 @@ public extension WebGL2RenderingContextBase { let _arg7 = format.jsValue() let _arg8 = type.jsValue() let _arg9 = srcData.jsValue() - _ = jsObject[Strings.texImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { @@ -651,7 +665,8 @@ public extension WebGL2RenderingContextBase { let _arg8 = type.jsValue() let _arg9 = srcData.jsValue() let _arg10 = srcOffset.jsValue() - _ = jsObject[Strings.texImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10) + let this = jsObject + _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { @@ -666,7 +681,8 @@ public extension WebGL2RenderingContextBase { let _arg8 = format.jsValue() let _arg9 = type.jsValue() let _arg10 = pboOffset.jsValue() - _ = jsObject[Strings.texSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10) + let this = jsObject + _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { @@ -681,7 +697,8 @@ public extension WebGL2RenderingContextBase { let _arg8 = format.jsValue() let _arg9 = type.jsValue() let _arg10 = source.jsValue() - _ = jsObject[Strings.texSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10) + let this = jsObject + _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView?, srcOffset: GLuint? = nil) { @@ -697,7 +714,8 @@ public extension WebGL2RenderingContextBase { let _arg9 = type.jsValue() let _arg10 = srcData.jsValue() let _arg11 = srcOffset?.jsValue() ?? .undefined - _ = jsObject[Strings.texSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11) + let this = jsObject + _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) } func copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) { @@ -710,7 +728,8 @@ public extension WebGL2RenderingContextBase { let _arg6 = y.jsValue() let _arg7 = width.jsValue() let _arg8 = height.jsValue() - _ = jsObject[Strings.copyTexSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.copyTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { @@ -723,7 +742,8 @@ public extension WebGL2RenderingContextBase { let _arg6 = border.jsValue() let _arg7 = imageSize.jsValue() let _arg8 = offset.jsValue() - _ = jsObject[Strings.compressedTexImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { @@ -737,7 +757,8 @@ public extension WebGL2RenderingContextBase { let _arg7 = srcData.jsValue() let _arg8 = srcOffset?.jsValue() ?? .undefined let _arg9 = srcLengthOverride?.jsValue() ?? .undefined - _ = jsObject[Strings.compressedTexImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { @@ -752,7 +773,8 @@ public extension WebGL2RenderingContextBase { let _arg8 = format.jsValue() let _arg9 = imageSize.jsValue() let _arg10 = offset.jsValue() - _ = jsObject[Strings.compressedTexSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10) + let this = jsObject + _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { @@ -768,99 +790,123 @@ public extension WebGL2RenderingContextBase { let _arg9 = srcData.jsValue() let _arg10 = srcOffset?.jsValue() ?? .undefined let _arg11 = srcLengthOverride?.jsValue() ?? .undefined - _ = jsObject[Strings.compressedTexSubImage3D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11) + let this = jsObject + _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) } func getFragDataLocation(program: WebGLProgram, name: String) -> GLint { - jsObject[Strings.getFragDataLocation]!(program.jsValue(), name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getFragDataLocation].function!(this: this, arguments: [program.jsValue(), name.jsValue()]).fromJSValue()! } func uniform1ui(location: WebGLUniformLocation?, v0: GLuint) { - _ = jsObject[Strings.uniform1ui]!(location.jsValue(), v0.jsValue()) + let this = jsObject + _ = this[Strings.uniform1ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue()]) } func uniform2ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint) { - _ = jsObject[Strings.uniform2ui]!(location.jsValue(), v0.jsValue(), v1.jsValue()) + let this = jsObject + _ = this[Strings.uniform2ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue(), v1.jsValue()]) } func uniform3ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint) { - _ = jsObject[Strings.uniform3ui]!(location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue()) + let this = jsObject + _ = this[Strings.uniform3ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue()]) } func uniform4ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) { - _ = jsObject[Strings.uniform4ui]!(location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue(), v3.jsValue()) + let this = jsObject + _ = this[Strings.uniform4ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue(), v3.jsValue()]) } func uniform1uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform1uiv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform1uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform2uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform2uiv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform2uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform3uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform3uiv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform3uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform4uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform4uiv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform4uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniformMatrix3x2fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniformMatrix3x2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniformMatrix4x2fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniformMatrix4x2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniformMatrix2x3fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniformMatrix2x3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniformMatrix4x3fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniformMatrix4x3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniformMatrix2x4fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniformMatrix2x4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniformMatrix3x4fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniformMatrix3x4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) { - _ = jsObject[Strings.vertexAttribI4i]!(index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttribI4i].function!(this: this, arguments: [index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()]) } func vertexAttribI4iv(index: GLuint, values: Int32List) { - _ = jsObject[Strings.vertexAttribI4iv]!(index.jsValue(), values.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttribI4iv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } func vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) { - _ = jsObject[Strings.vertexAttribI4ui]!(index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttribI4ui].function!(this: this, arguments: [index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()]) } func vertexAttribI4uiv(index: GLuint, values: Uint32List) { - _ = jsObject[Strings.vertexAttribI4uiv]!(index.jsValue(), values.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttribI4uiv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } func vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr) { - _ = jsObject[Strings.vertexAttribIPointer]!(index.jsValue(), size.jsValue(), type.jsValue(), stride.jsValue(), offset.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttribIPointer].function!(this: this, arguments: [index.jsValue(), size.jsValue(), type.jsValue(), stride.jsValue(), offset.jsValue()]) } func vertexAttribDivisor(index: GLuint, divisor: GLuint) { - _ = jsObject[Strings.vertexAttribDivisor]!(index.jsValue(), divisor.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttribDivisor].function!(this: this, arguments: [index.jsValue(), divisor.jsValue()]) } func drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) { - _ = jsObject[Strings.drawArraysInstanced]!(mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue()) + let this = jsObject + _ = this[Strings.drawArraysInstanced].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue()]) } func drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) { - _ = jsObject[Strings.drawElementsInstanced]!(mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), instanceCount.jsValue()) + let this = jsObject + _ = this[Strings.drawElementsInstanced].function!(this: this, arguments: [mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), instanceCount.jsValue()]) } func drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr) { @@ -870,198 +916,247 @@ public extension WebGL2RenderingContextBase { let _arg3 = count.jsValue() let _arg4 = type.jsValue() let _arg5 = offset.jsValue() - _ = jsObject[Strings.drawRangeElements]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.drawRangeElements].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func drawBuffers(buffers: [GLenum]) { - _ = jsObject[Strings.drawBuffers]!(buffers.jsValue()) + let this = jsObject + _ = this[Strings.drawBuffers].function!(this: this, arguments: [buffers.jsValue()]) } func clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset: GLuint? = nil) { - _ = jsObject[Strings.clearBufferfv]!(buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clearBufferfv].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined]) } func clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset: GLuint? = nil) { - _ = jsObject[Strings.clearBufferiv]!(buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clearBufferiv].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined]) } func clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset: GLuint? = nil) { - _ = jsObject[Strings.clearBufferuiv]!(buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clearBufferuiv].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined]) } func clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) { - _ = jsObject[Strings.clearBufferfi]!(buffer.jsValue(), drawbuffer.jsValue(), depth.jsValue(), stencil.jsValue()) + let this = jsObject + _ = this[Strings.clearBufferfi].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), depth.jsValue(), stencil.jsValue()]) } func createQuery() -> WebGLQuery? { - jsObject[Strings.createQuery]!().fromJSValue()! + let this = jsObject + return this[Strings.createQuery].function!(this: this, arguments: []).fromJSValue()! } func deleteQuery(query: WebGLQuery?) { - _ = jsObject[Strings.deleteQuery]!(query.jsValue()) + let this = jsObject + _ = this[Strings.deleteQuery].function!(this: this, arguments: [query.jsValue()]) } func isQuery(query: WebGLQuery?) -> GLboolean { - jsObject[Strings.isQuery]!(query.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isQuery].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } func beginQuery(target: GLenum, query: WebGLQuery) { - _ = jsObject[Strings.beginQuery]!(target.jsValue(), query.jsValue()) + let this = jsObject + _ = this[Strings.beginQuery].function!(this: this, arguments: [target.jsValue(), query.jsValue()]) } func endQuery(target: GLenum) { - _ = jsObject[Strings.endQuery]!(target.jsValue()) + let this = jsObject + _ = this[Strings.endQuery].function!(this: this, arguments: [target.jsValue()]) } func getQuery(target: GLenum, pname: GLenum) -> WebGLQuery? { - jsObject[Strings.getQuery]!(target.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getQuery].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } func getQueryParameter(query: WebGLQuery, pname: GLenum) -> JSValue { - jsObject[Strings.getQueryParameter]!(query.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getQueryParameter].function!(this: this, arguments: [query.jsValue(), pname.jsValue()]).fromJSValue()! } func createSampler() -> WebGLSampler? { - jsObject[Strings.createSampler]!().fromJSValue()! + let this = jsObject + return this[Strings.createSampler].function!(this: this, arguments: []).fromJSValue()! } func deleteSampler(sampler: WebGLSampler?) { - _ = jsObject[Strings.deleteSampler]!(sampler.jsValue()) + let this = jsObject + _ = this[Strings.deleteSampler].function!(this: this, arguments: [sampler.jsValue()]) } func isSampler(sampler: WebGLSampler?) -> GLboolean { - jsObject[Strings.isSampler]!(sampler.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isSampler].function!(this: this, arguments: [sampler.jsValue()]).fromJSValue()! } func bindSampler(unit: GLuint, sampler: WebGLSampler?) { - _ = jsObject[Strings.bindSampler]!(unit.jsValue(), sampler.jsValue()) + let this = jsObject + _ = this[Strings.bindSampler].function!(this: this, arguments: [unit.jsValue(), sampler.jsValue()]) } func samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint) { - _ = jsObject[Strings.samplerParameteri]!(sampler.jsValue(), pname.jsValue(), param.jsValue()) + let this = jsObject + _ = this[Strings.samplerParameteri].function!(this: this, arguments: [sampler.jsValue(), pname.jsValue(), param.jsValue()]) } func samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat) { - _ = jsObject[Strings.samplerParameterf]!(sampler.jsValue(), pname.jsValue(), param.jsValue()) + let this = jsObject + _ = this[Strings.samplerParameterf].function!(this: this, arguments: [sampler.jsValue(), pname.jsValue(), param.jsValue()]) } func getSamplerParameter(sampler: WebGLSampler, pname: GLenum) -> JSValue { - jsObject[Strings.getSamplerParameter]!(sampler.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getSamplerParameter].function!(this: this, arguments: [sampler.jsValue(), pname.jsValue()]).fromJSValue()! } func fenceSync(condition: GLenum, flags: GLbitfield) -> WebGLSync? { - jsObject[Strings.fenceSync]!(condition.jsValue(), flags.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.fenceSync].function!(this: this, arguments: [condition.jsValue(), flags.jsValue()]).fromJSValue()! } func isSync(sync: WebGLSync?) -> GLboolean { - jsObject[Strings.isSync]!(sync.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isSync].function!(this: this, arguments: [sync.jsValue()]).fromJSValue()! } func deleteSync(sync: WebGLSync?) { - _ = jsObject[Strings.deleteSync]!(sync.jsValue()) + let this = jsObject + _ = this[Strings.deleteSync].function!(this: this, arguments: [sync.jsValue()]) } func clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64) -> GLenum { - jsObject[Strings.clientWaitSync]!(sync.jsValue(), flags.jsValue(), timeout.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.clientWaitSync].function!(this: this, arguments: [sync.jsValue(), flags.jsValue(), timeout.jsValue()]).fromJSValue()! } func waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64) { - _ = jsObject[Strings.waitSync]!(sync.jsValue(), flags.jsValue(), timeout.jsValue()) + let this = jsObject + _ = this[Strings.waitSync].function!(this: this, arguments: [sync.jsValue(), flags.jsValue(), timeout.jsValue()]) } func getSyncParameter(sync: WebGLSync, pname: GLenum) -> JSValue { - jsObject[Strings.getSyncParameter]!(sync.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getSyncParameter].function!(this: this, arguments: [sync.jsValue(), pname.jsValue()]).fromJSValue()! } func createTransformFeedback() -> WebGLTransformFeedback? { - jsObject[Strings.createTransformFeedback]!().fromJSValue()! + let this = jsObject + return this[Strings.createTransformFeedback].function!(this: this, arguments: []).fromJSValue()! } func deleteTransformFeedback(tf: WebGLTransformFeedback?) { - _ = jsObject[Strings.deleteTransformFeedback]!(tf.jsValue()) + let this = jsObject + _ = this[Strings.deleteTransformFeedback].function!(this: this, arguments: [tf.jsValue()]) } func isTransformFeedback(tf: WebGLTransformFeedback?) -> GLboolean { - jsObject[Strings.isTransformFeedback]!(tf.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isTransformFeedback].function!(this: this, arguments: [tf.jsValue()]).fromJSValue()! } func bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback?) { - _ = jsObject[Strings.bindTransformFeedback]!(target.jsValue(), tf.jsValue()) + let this = jsObject + _ = this[Strings.bindTransformFeedback].function!(this: this, arguments: [target.jsValue(), tf.jsValue()]) } func beginTransformFeedback(primitiveMode: GLenum) { - _ = jsObject[Strings.beginTransformFeedback]!(primitiveMode.jsValue()) + let this = jsObject + _ = this[Strings.beginTransformFeedback].function!(this: this, arguments: [primitiveMode.jsValue()]) } func endTransformFeedback() { - _ = jsObject[Strings.endTransformFeedback]!() + let this = jsObject + _ = this[Strings.endTransformFeedback].function!(this: this, arguments: []) } func transformFeedbackVaryings(program: WebGLProgram, varyings: [String], bufferMode: GLenum) { - _ = jsObject[Strings.transformFeedbackVaryings]!(program.jsValue(), varyings.jsValue(), bufferMode.jsValue()) + let this = jsObject + _ = this[Strings.transformFeedbackVaryings].function!(this: this, arguments: [program.jsValue(), varyings.jsValue(), bufferMode.jsValue()]) } func getTransformFeedbackVarying(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { - jsObject[Strings.getTransformFeedbackVarying]!(program.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getTransformFeedbackVarying].function!(this: this, arguments: [program.jsValue(), index.jsValue()]).fromJSValue()! } func pauseTransformFeedback() { - _ = jsObject[Strings.pauseTransformFeedback]!() + let this = jsObject + _ = this[Strings.pauseTransformFeedback].function!(this: this, arguments: []) } func resumeTransformFeedback() { - _ = jsObject[Strings.resumeTransformFeedback]!() + let this = jsObject + _ = this[Strings.resumeTransformFeedback].function!(this: this, arguments: []) } func bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer?) { - _ = jsObject[Strings.bindBufferBase]!(target.jsValue(), index.jsValue(), buffer.jsValue()) + let this = jsObject + _ = this[Strings.bindBufferBase].function!(this: this, arguments: [target.jsValue(), index.jsValue(), buffer.jsValue()]) } func bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer?, offset: GLintptr, size: GLsizeiptr) { - _ = jsObject[Strings.bindBufferRange]!(target.jsValue(), index.jsValue(), buffer.jsValue(), offset.jsValue(), size.jsValue()) + let this = jsObject + _ = this[Strings.bindBufferRange].function!(this: this, arguments: [target.jsValue(), index.jsValue(), buffer.jsValue(), offset.jsValue(), size.jsValue()]) } func getIndexedParameter(target: GLenum, index: GLuint) -> JSValue { - jsObject[Strings.getIndexedParameter]!(target.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getIndexedParameter].function!(this: this, arguments: [target.jsValue(), index.jsValue()]).fromJSValue()! } func getUniformIndices(program: WebGLProgram, uniformNames: [String]) -> [GLuint]? { - jsObject[Strings.getUniformIndices]!(program.jsValue(), uniformNames.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getUniformIndices].function!(this: this, arguments: [program.jsValue(), uniformNames.jsValue()]).fromJSValue()! } func getActiveUniforms(program: WebGLProgram, uniformIndices: [GLuint], pname: GLenum) -> JSValue { - jsObject[Strings.getActiveUniforms]!(program.jsValue(), uniformIndices.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getActiveUniforms].function!(this: this, arguments: [program.jsValue(), uniformIndices.jsValue(), pname.jsValue()]).fromJSValue()! } func getUniformBlockIndex(program: WebGLProgram, uniformBlockName: String) -> GLuint { - jsObject[Strings.getUniformBlockIndex]!(program.jsValue(), uniformBlockName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getUniformBlockIndex].function!(this: this, arguments: [program.jsValue(), uniformBlockName.jsValue()]).fromJSValue()! } func getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum) -> JSValue { - jsObject[Strings.getActiveUniformBlockParameter]!(program.jsValue(), uniformBlockIndex.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getActiveUniformBlockParameter].function!(this: this, arguments: [program.jsValue(), uniformBlockIndex.jsValue(), pname.jsValue()]).fromJSValue()! } func getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint) -> String? { - jsObject[Strings.getActiveUniformBlockName]!(program.jsValue(), uniformBlockIndex.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getActiveUniformBlockName].function!(this: this, arguments: [program.jsValue(), uniformBlockIndex.jsValue()]).fromJSValue()! } func uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint) { - _ = jsObject[Strings.uniformBlockBinding]!(program.jsValue(), uniformBlockIndex.jsValue(), uniformBlockBinding.jsValue()) + let this = jsObject + _ = this[Strings.uniformBlockBinding].function!(this: this, arguments: [program.jsValue(), uniformBlockIndex.jsValue(), uniformBlockBinding.jsValue()]) } func createVertexArray() -> WebGLVertexArrayObject? { - jsObject[Strings.createVertexArray]!().fromJSValue()! + let this = jsObject + return this[Strings.createVertexArray].function!(this: this, arguments: []).fromJSValue()! } func deleteVertexArray(vertexArray: WebGLVertexArrayObject?) { - _ = jsObject[Strings.deleteVertexArray]!(vertexArray.jsValue()) + let this = jsObject + _ = this[Strings.deleteVertexArray].function!(this: this, arguments: [vertexArray.jsValue()]) } func isVertexArray(vertexArray: WebGLVertexArrayObject?) -> GLboolean { - jsObject[Strings.isVertexArray]!(vertexArray.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isVertexArray].function!(this: this, arguments: [vertexArray.jsValue()]).fromJSValue()! } func bindVertexArray(array: WebGLVertexArrayObject?) { - _ = jsObject[Strings.bindVertexArray]!(array.jsValue()) + let this = jsObject + _ = this[Strings.bindVertexArray].function!(this: this, arguments: [array.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift index 81489fe8..7fae18a9 100644 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift @@ -6,23 +6,28 @@ import JavaScriptKit public protocol WebGL2RenderingContextOverloads: JSBridgedClass {} public extension WebGL2RenderingContextOverloads { func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { - _ = jsObject[Strings.bufferData]!(target.jsValue(), size.jsValue(), usage.jsValue()) + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue(), size.jsValue(), usage.jsValue()]) } func bufferData(target: GLenum, srcData: BufferSource?, usage: GLenum) { - _ = jsObject[Strings.bufferData]!(target.jsValue(), srcData.jsValue(), usage.jsValue()) + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue(), srcData.jsValue(), usage.jsValue()]) } func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource) { - _ = jsObject[Strings.bufferSubData]!(target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue()) + let this = jsObject + _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue()]) } func bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length: GLuint? = nil) { - _ = jsObject[Strings.bufferData]!(target.jsValue(), srcData.jsValue(), usage.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue(), srcData.jsValue(), usage.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined]) } func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length: GLuint? = nil) { - _ = jsObject[Strings.bufferSubData]!(target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined]) } func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { @@ -35,7 +40,8 @@ public extension WebGL2RenderingContextOverloads { let _arg6 = format.jsValue() let _arg7 = type.jsValue() let _arg8 = pixels.jsValue() - _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) { @@ -45,7 +51,8 @@ public extension WebGL2RenderingContextOverloads { let _arg3 = format.jsValue() let _arg4 = type.jsValue() let _arg5 = source.jsValue() - _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { @@ -58,7 +65,8 @@ public extension WebGL2RenderingContextOverloads { let _arg6 = format.jsValue() let _arg7 = type.jsValue() let _arg8 = pixels.jsValue() - _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource) { @@ -69,7 +77,8 @@ public extension WebGL2RenderingContextOverloads { let _arg4 = format.jsValue() let _arg5 = type.jsValue() let _arg6 = source.jsValue() - _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { @@ -82,7 +91,8 @@ public extension WebGL2RenderingContextOverloads { let _arg6 = format.jsValue() let _arg7 = type.jsValue() let _arg8 = pboOffset.jsValue() - _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { @@ -95,7 +105,8 @@ public extension WebGL2RenderingContextOverloads { let _arg6 = format.jsValue() let _arg7 = type.jsValue() let _arg8 = source.jsValue() - _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { @@ -109,7 +120,8 @@ public extension WebGL2RenderingContextOverloads { let _arg7 = type.jsValue() let _arg8 = srcData.jsValue() let _arg9 = srcOffset.jsValue() - _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { @@ -122,7 +134,8 @@ public extension WebGL2RenderingContextOverloads { let _arg6 = format.jsValue() let _arg7 = type.jsValue() let _arg8 = pboOffset.jsValue() - _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { @@ -135,7 +148,8 @@ public extension WebGL2RenderingContextOverloads { let _arg6 = format.jsValue() let _arg7 = type.jsValue() let _arg8 = source.jsValue() - _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { @@ -149,7 +163,8 @@ public extension WebGL2RenderingContextOverloads { let _arg7 = type.jsValue() let _arg8 = srcData.jsValue() let _arg9 = srcOffset.jsValue() - _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { @@ -161,7 +176,8 @@ public extension WebGL2RenderingContextOverloads { let _arg5 = border.jsValue() let _arg6 = imageSize.jsValue() let _arg7 = offset.jsValue() - _ = jsObject[Strings.compressedTexImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { @@ -174,7 +190,8 @@ public extension WebGL2RenderingContextOverloads { let _arg6 = srcData.jsValue() let _arg7 = srcOffset?.jsValue() ?? .undefined let _arg8 = srcLengthOverride?.jsValue() ?? .undefined - _ = jsObject[Strings.compressedTexImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { @@ -187,7 +204,8 @@ public extension WebGL2RenderingContextOverloads { let _arg6 = format.jsValue() let _arg7 = imageSize.jsValue() let _arg8 = offset.jsValue() - _ = jsObject[Strings.compressedTexSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { @@ -201,51 +219,63 @@ public extension WebGL2RenderingContextOverloads { let _arg7 = srcData.jsValue() let _arg8 = srcOffset?.jsValue() ?? .undefined let _arg9 = srcLengthOverride?.jsValue() ?? .undefined - _ = jsObject[Strings.compressedTexSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9) + let this = jsObject + _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } func uniform1fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform1fv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform2fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform2fv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform3fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform3fv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform4fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform4fv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform1iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform1iv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform2iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform2iv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform3iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform3iv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniform4iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniform4iv]!(location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniformMatrix2fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniformMatrix3fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - _ = jsObject[Strings.uniformMatrix4fv]!(location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView?) { @@ -256,7 +286,8 @@ public extension WebGL2RenderingContextOverloads { let _arg4 = format.jsValue() let _arg5 = type.jsValue() let _arg6 = dstData.jsValue() - _ = jsObject[Strings.readPixels]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + let this = jsObject + _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr) { @@ -267,7 +298,8 @@ public extension WebGL2RenderingContextOverloads { let _arg4 = format.jsValue() let _arg5 = type.jsValue() let _arg6 = offset.jsValue() - _ = jsObject[Strings.readPixels]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + let this = jsObject + _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint) { @@ -279,6 +311,7 @@ public extension WebGL2RenderingContextOverloads { let _arg5 = type.jsValue() let _arg6 = dstData.jsValue() let _arg7 = dstOffset.jsValue() - _ = jsObject[Strings.readPixels]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } } diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift index 806b45c0..16629fcb 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift @@ -604,95 +604,118 @@ public extension WebGLRenderingContextBase { var drawingBufferHeight: GLsizei { ReadonlyAttribute[Strings.drawingBufferHeight, in: jsObject] } func getContextAttributes() -> WebGLContextAttributes? { - jsObject[Strings.getContextAttributes]!().fromJSValue()! + let this = jsObject + return this[Strings.getContextAttributes].function!(this: this, arguments: []).fromJSValue()! } func isContextLost() -> Bool { - jsObject[Strings.isContextLost]!().fromJSValue()! + let this = jsObject + return this[Strings.isContextLost].function!(this: this, arguments: []).fromJSValue()! } func getSupportedExtensions() -> [String]? { - jsObject[Strings.getSupportedExtensions]!().fromJSValue()! + let this = jsObject + return this[Strings.getSupportedExtensions].function!(this: this, arguments: []).fromJSValue()! } func getExtension(name: String) -> JSObject? { - jsObject[Strings.getExtension]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getExtension].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } func activeTexture(texture: GLenum) { - _ = jsObject[Strings.activeTexture]!(texture.jsValue()) + let this = jsObject + _ = this[Strings.activeTexture].function!(this: this, arguments: [texture.jsValue()]) } func attachShader(program: WebGLProgram, shader: WebGLShader) { - _ = jsObject[Strings.attachShader]!(program.jsValue(), shader.jsValue()) + let this = jsObject + _ = this[Strings.attachShader].function!(this: this, arguments: [program.jsValue(), shader.jsValue()]) } func bindAttribLocation(program: WebGLProgram, index: GLuint, name: String) { - _ = jsObject[Strings.bindAttribLocation]!(program.jsValue(), index.jsValue(), name.jsValue()) + let this = jsObject + _ = this[Strings.bindAttribLocation].function!(this: this, arguments: [program.jsValue(), index.jsValue(), name.jsValue()]) } func bindBuffer(target: GLenum, buffer: WebGLBuffer?) { - _ = jsObject[Strings.bindBuffer]!(target.jsValue(), buffer.jsValue()) + let this = jsObject + _ = this[Strings.bindBuffer].function!(this: this, arguments: [target.jsValue(), buffer.jsValue()]) } func bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer?) { - _ = jsObject[Strings.bindFramebuffer]!(target.jsValue(), framebuffer.jsValue()) + let this = jsObject + _ = this[Strings.bindFramebuffer].function!(this: this, arguments: [target.jsValue(), framebuffer.jsValue()]) } func bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer?) { - _ = jsObject[Strings.bindRenderbuffer]!(target.jsValue(), renderbuffer.jsValue()) + let this = jsObject + _ = this[Strings.bindRenderbuffer].function!(this: this, arguments: [target.jsValue(), renderbuffer.jsValue()]) } func bindTexture(target: GLenum, texture: WebGLTexture?) { - _ = jsObject[Strings.bindTexture]!(target.jsValue(), texture.jsValue()) + let this = jsObject + _ = this[Strings.bindTexture].function!(this: this, arguments: [target.jsValue(), texture.jsValue()]) } func blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { - _ = jsObject[Strings.blendColor]!(red.jsValue(), green.jsValue(), blue.jsValue(), alpha.jsValue()) + let this = jsObject + _ = this[Strings.blendColor].function!(this: this, arguments: [red.jsValue(), green.jsValue(), blue.jsValue(), alpha.jsValue()]) } func blendEquation(mode: GLenum) { - _ = jsObject[Strings.blendEquation]!(mode.jsValue()) + let this = jsObject + _ = this[Strings.blendEquation].function!(this: this, arguments: [mode.jsValue()]) } func blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) { - _ = jsObject[Strings.blendEquationSeparate]!(modeRGB.jsValue(), modeAlpha.jsValue()) + let this = jsObject + _ = this[Strings.blendEquationSeparate].function!(this: this, arguments: [modeRGB.jsValue(), modeAlpha.jsValue()]) } func blendFunc(sfactor: GLenum, dfactor: GLenum) { - _ = jsObject[Strings.blendFunc]!(sfactor.jsValue(), dfactor.jsValue()) + let this = jsObject + _ = this[Strings.blendFunc].function!(this: this, arguments: [sfactor.jsValue(), dfactor.jsValue()]) } func blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { - _ = jsObject[Strings.blendFuncSeparate]!(srcRGB.jsValue(), dstRGB.jsValue(), srcAlpha.jsValue(), dstAlpha.jsValue()) + let this = jsObject + _ = this[Strings.blendFuncSeparate].function!(this: this, arguments: [srcRGB.jsValue(), dstRGB.jsValue(), srcAlpha.jsValue(), dstAlpha.jsValue()]) } func checkFramebufferStatus(target: GLenum) -> GLenum { - jsObject[Strings.checkFramebufferStatus]!(target.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.checkFramebufferStatus].function!(this: this, arguments: [target.jsValue()]).fromJSValue()! } func clear(mask: GLbitfield) { - _ = jsObject[Strings.clear]!(mask.jsValue()) + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: [mask.jsValue()]) } func clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { - _ = jsObject[Strings.clearColor]!(red.jsValue(), green.jsValue(), blue.jsValue(), alpha.jsValue()) + let this = jsObject + _ = this[Strings.clearColor].function!(this: this, arguments: [red.jsValue(), green.jsValue(), blue.jsValue(), alpha.jsValue()]) } func clearDepth(depth: GLclampf) { - _ = jsObject[Strings.clearDepth]!(depth.jsValue()) + let this = jsObject + _ = this[Strings.clearDepth].function!(this: this, arguments: [depth.jsValue()]) } func clearStencil(s: GLint) { - _ = jsObject[Strings.clearStencil]!(s.jsValue()) + let this = jsObject + _ = this[Strings.clearStencil].function!(this: this, arguments: [s.jsValue()]) } func colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) { - _ = jsObject[Strings.colorMask]!(red.jsValue(), green.jsValue(), blue.jsValue(), alpha.jsValue()) + let this = jsObject + _ = this[Strings.colorMask].function!(this: this, arguments: [red.jsValue(), green.jsValue(), blue.jsValue(), alpha.jsValue()]) } func compileShader(shader: WebGLShader) { - _ = jsObject[Strings.compileShader]!(shader.jsValue()) + let this = jsObject + _ = this[Strings.compileShader].function!(this: this, arguments: [shader.jsValue()]) } func copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) { @@ -704,7 +727,8 @@ public extension WebGLRenderingContextBase { let _arg5 = width.jsValue() let _arg6 = height.jsValue() let _arg7 = border.jsValue() - _ = jsObject[Strings.copyTexImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.copyTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } func copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) { @@ -716,371 +740,463 @@ public extension WebGLRenderingContextBase { let _arg5 = y.jsValue() let _arg6 = width.jsValue() let _arg7 = height.jsValue() - _ = jsObject[Strings.copyTexSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.copyTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } func createBuffer() -> WebGLBuffer? { - jsObject[Strings.createBuffer]!().fromJSValue()! + let this = jsObject + return this[Strings.createBuffer].function!(this: this, arguments: []).fromJSValue()! } func createFramebuffer() -> WebGLFramebuffer? { - jsObject[Strings.createFramebuffer]!().fromJSValue()! + let this = jsObject + return this[Strings.createFramebuffer].function!(this: this, arguments: []).fromJSValue()! } func createProgram() -> WebGLProgram? { - jsObject[Strings.createProgram]!().fromJSValue()! + let this = jsObject + return this[Strings.createProgram].function!(this: this, arguments: []).fromJSValue()! } func createRenderbuffer() -> WebGLRenderbuffer? { - jsObject[Strings.createRenderbuffer]!().fromJSValue()! + let this = jsObject + return this[Strings.createRenderbuffer].function!(this: this, arguments: []).fromJSValue()! } func createShader(type: GLenum) -> WebGLShader? { - jsObject[Strings.createShader]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createShader].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } func createTexture() -> WebGLTexture? { - jsObject[Strings.createTexture]!().fromJSValue()! + let this = jsObject + return this[Strings.createTexture].function!(this: this, arguments: []).fromJSValue()! } func cullFace(mode: GLenum) { - _ = jsObject[Strings.cullFace]!(mode.jsValue()) + let this = jsObject + _ = this[Strings.cullFace].function!(this: this, arguments: [mode.jsValue()]) } func deleteBuffer(buffer: WebGLBuffer?) { - _ = jsObject[Strings.deleteBuffer]!(buffer.jsValue()) + let this = jsObject + _ = this[Strings.deleteBuffer].function!(this: this, arguments: [buffer.jsValue()]) } func deleteFramebuffer(framebuffer: WebGLFramebuffer?) { - _ = jsObject[Strings.deleteFramebuffer]!(framebuffer.jsValue()) + let this = jsObject + _ = this[Strings.deleteFramebuffer].function!(this: this, arguments: [framebuffer.jsValue()]) } func deleteProgram(program: WebGLProgram?) { - _ = jsObject[Strings.deleteProgram]!(program.jsValue()) + let this = jsObject + _ = this[Strings.deleteProgram].function!(this: this, arguments: [program.jsValue()]) } func deleteRenderbuffer(renderbuffer: WebGLRenderbuffer?) { - _ = jsObject[Strings.deleteRenderbuffer]!(renderbuffer.jsValue()) + let this = jsObject + _ = this[Strings.deleteRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue()]) } func deleteShader(shader: WebGLShader?) { - _ = jsObject[Strings.deleteShader]!(shader.jsValue()) + let this = jsObject + _ = this[Strings.deleteShader].function!(this: this, arguments: [shader.jsValue()]) } func deleteTexture(texture: WebGLTexture?) { - _ = jsObject[Strings.deleteTexture]!(texture.jsValue()) + let this = jsObject + _ = this[Strings.deleteTexture].function!(this: this, arguments: [texture.jsValue()]) } func depthFunc(func: GLenum) { - _ = jsObject[Strings.depthFunc]!(`func`.jsValue()) + let this = jsObject + _ = this[Strings.depthFunc].function!(this: this, arguments: [`func`.jsValue()]) } func depthMask(flag: GLboolean) { - _ = jsObject[Strings.depthMask]!(flag.jsValue()) + let this = jsObject + _ = this[Strings.depthMask].function!(this: this, arguments: [flag.jsValue()]) } func depthRange(zNear: GLclampf, zFar: GLclampf) { - _ = jsObject[Strings.depthRange]!(zNear.jsValue(), zFar.jsValue()) + let this = jsObject + _ = this[Strings.depthRange].function!(this: this, arguments: [zNear.jsValue(), zFar.jsValue()]) } func detachShader(program: WebGLProgram, shader: WebGLShader) { - _ = jsObject[Strings.detachShader]!(program.jsValue(), shader.jsValue()) + let this = jsObject + _ = this[Strings.detachShader].function!(this: this, arguments: [program.jsValue(), shader.jsValue()]) } func disable(cap: GLenum) { - _ = jsObject[Strings.disable]!(cap.jsValue()) + let this = jsObject + _ = this[Strings.disable].function!(this: this, arguments: [cap.jsValue()]) } func disableVertexAttribArray(index: GLuint) { - _ = jsObject[Strings.disableVertexAttribArray]!(index.jsValue()) + let this = jsObject + _ = this[Strings.disableVertexAttribArray].function!(this: this, arguments: [index.jsValue()]) } func drawArrays(mode: GLenum, first: GLint, count: GLsizei) { - _ = jsObject[Strings.drawArrays]!(mode.jsValue(), first.jsValue(), count.jsValue()) + let this = jsObject + _ = this[Strings.drawArrays].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue()]) } func drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr) { - _ = jsObject[Strings.drawElements]!(mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue()) + let this = jsObject + _ = this[Strings.drawElements].function!(this: this, arguments: [mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue()]) } func enable(cap: GLenum) { - _ = jsObject[Strings.enable]!(cap.jsValue()) + let this = jsObject + _ = this[Strings.enable].function!(this: this, arguments: [cap.jsValue()]) } func enableVertexAttribArray(index: GLuint) { - _ = jsObject[Strings.enableVertexAttribArray]!(index.jsValue()) + let this = jsObject + _ = this[Strings.enableVertexAttribArray].function!(this: this, arguments: [index.jsValue()]) } func finish() { - _ = jsObject[Strings.finish]!() + let this = jsObject + _ = this[Strings.finish].function!(this: this, arguments: []) } func flush() { - _ = jsObject[Strings.flush]!() + let this = jsObject + _ = this[Strings.flush].function!(this: this, arguments: []) } func framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer?) { - _ = jsObject[Strings.framebufferRenderbuffer]!(target.jsValue(), attachment.jsValue(), renderbuffertarget.jsValue(), renderbuffer.jsValue()) + let this = jsObject + _ = this[Strings.framebufferRenderbuffer].function!(this: this, arguments: [target.jsValue(), attachment.jsValue(), renderbuffertarget.jsValue(), renderbuffer.jsValue()]) } func framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture?, level: GLint) { - _ = jsObject[Strings.framebufferTexture2D]!(target.jsValue(), attachment.jsValue(), textarget.jsValue(), texture.jsValue(), level.jsValue()) + let this = jsObject + _ = this[Strings.framebufferTexture2D].function!(this: this, arguments: [target.jsValue(), attachment.jsValue(), textarget.jsValue(), texture.jsValue(), level.jsValue()]) } func frontFace(mode: GLenum) { - _ = jsObject[Strings.frontFace]!(mode.jsValue()) + let this = jsObject + _ = this[Strings.frontFace].function!(this: this, arguments: [mode.jsValue()]) } func generateMipmap(target: GLenum) { - _ = jsObject[Strings.generateMipmap]!(target.jsValue()) + let this = jsObject + _ = this[Strings.generateMipmap].function!(this: this, arguments: [target.jsValue()]) } func getActiveAttrib(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { - jsObject[Strings.getActiveAttrib]!(program.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getActiveAttrib].function!(this: this, arguments: [program.jsValue(), index.jsValue()]).fromJSValue()! } func getActiveUniform(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { - jsObject[Strings.getActiveUniform]!(program.jsValue(), index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getActiveUniform].function!(this: this, arguments: [program.jsValue(), index.jsValue()]).fromJSValue()! } func getAttachedShaders(program: WebGLProgram) -> [WebGLShader]? { - jsObject[Strings.getAttachedShaders]!(program.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAttachedShaders].function!(this: this, arguments: [program.jsValue()]).fromJSValue()! } func getAttribLocation(program: WebGLProgram, name: String) -> GLint { - jsObject[Strings.getAttribLocation]!(program.jsValue(), name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getAttribLocation].function!(this: this, arguments: [program.jsValue(), name.jsValue()]).fromJSValue()! } func getBufferParameter(target: GLenum, pname: GLenum) -> JSValue { - jsObject[Strings.getBufferParameter]!(target.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getBufferParameter].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } func getParameter(pname: GLenum) -> JSValue { - jsObject[Strings.getParameter]!(pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getParameter].function!(this: this, arguments: [pname.jsValue()]).fromJSValue()! } func getError() -> GLenum { - jsObject[Strings.getError]!().fromJSValue()! + let this = jsObject + return this[Strings.getError].function!(this: this, arguments: []).fromJSValue()! } func getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum) -> JSValue { - jsObject[Strings.getFramebufferAttachmentParameter]!(target.jsValue(), attachment.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getFramebufferAttachmentParameter].function!(this: this, arguments: [target.jsValue(), attachment.jsValue(), pname.jsValue()]).fromJSValue()! } func getProgramParameter(program: WebGLProgram, pname: GLenum) -> JSValue { - jsObject[Strings.getProgramParameter]!(program.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getProgramParameter].function!(this: this, arguments: [program.jsValue(), pname.jsValue()]).fromJSValue()! } func getProgramInfoLog(program: WebGLProgram) -> String? { - jsObject[Strings.getProgramInfoLog]!(program.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getProgramInfoLog].function!(this: this, arguments: [program.jsValue()]).fromJSValue()! } func getRenderbufferParameter(target: GLenum, pname: GLenum) -> JSValue { - jsObject[Strings.getRenderbufferParameter]!(target.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getRenderbufferParameter].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } func getShaderParameter(shader: WebGLShader, pname: GLenum) -> JSValue { - jsObject[Strings.getShaderParameter]!(shader.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getShaderParameter].function!(this: this, arguments: [shader.jsValue(), pname.jsValue()]).fromJSValue()! } func getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) -> WebGLShaderPrecisionFormat? { - jsObject[Strings.getShaderPrecisionFormat]!(shadertype.jsValue(), precisiontype.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getShaderPrecisionFormat].function!(this: this, arguments: [shadertype.jsValue(), precisiontype.jsValue()]).fromJSValue()! } func getShaderInfoLog(shader: WebGLShader) -> String? { - jsObject[Strings.getShaderInfoLog]!(shader.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getShaderInfoLog].function!(this: this, arguments: [shader.jsValue()]).fromJSValue()! } func getShaderSource(shader: WebGLShader) -> String? { - jsObject[Strings.getShaderSource]!(shader.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getShaderSource].function!(this: this, arguments: [shader.jsValue()]).fromJSValue()! } func getTexParameter(target: GLenum, pname: GLenum) -> JSValue { - jsObject[Strings.getTexParameter]!(target.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getTexParameter].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } func getUniform(program: WebGLProgram, location: WebGLUniformLocation) -> JSValue { - jsObject[Strings.getUniform]!(program.jsValue(), location.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getUniform].function!(this: this, arguments: [program.jsValue(), location.jsValue()]).fromJSValue()! } func getUniformLocation(program: WebGLProgram, name: String) -> WebGLUniformLocation? { - jsObject[Strings.getUniformLocation]!(program.jsValue(), name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getUniformLocation].function!(this: this, arguments: [program.jsValue(), name.jsValue()]).fromJSValue()! } func getVertexAttrib(index: GLuint, pname: GLenum) -> JSValue { - jsObject[Strings.getVertexAttrib]!(index.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getVertexAttrib].function!(this: this, arguments: [index.jsValue(), pname.jsValue()]).fromJSValue()! } func getVertexAttribOffset(index: GLuint, pname: GLenum) -> GLintptr { - jsObject[Strings.getVertexAttribOffset]!(index.jsValue(), pname.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getVertexAttribOffset].function!(this: this, arguments: [index.jsValue(), pname.jsValue()]).fromJSValue()! } func hint(target: GLenum, mode: GLenum) { - _ = jsObject[Strings.hint]!(target.jsValue(), mode.jsValue()) + let this = jsObject + _ = this[Strings.hint].function!(this: this, arguments: [target.jsValue(), mode.jsValue()]) } func isBuffer(buffer: WebGLBuffer?) -> GLboolean { - jsObject[Strings.isBuffer]!(buffer.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isBuffer].function!(this: this, arguments: [buffer.jsValue()]).fromJSValue()! } func isEnabled(cap: GLenum) -> GLboolean { - jsObject[Strings.isEnabled]!(cap.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isEnabled].function!(this: this, arguments: [cap.jsValue()]).fromJSValue()! } func isFramebuffer(framebuffer: WebGLFramebuffer?) -> GLboolean { - jsObject[Strings.isFramebuffer]!(framebuffer.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isFramebuffer].function!(this: this, arguments: [framebuffer.jsValue()]).fromJSValue()! } func isProgram(program: WebGLProgram?) -> GLboolean { - jsObject[Strings.isProgram]!(program.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isProgram].function!(this: this, arguments: [program.jsValue()]).fromJSValue()! } func isRenderbuffer(renderbuffer: WebGLRenderbuffer?) -> GLboolean { - jsObject[Strings.isRenderbuffer]!(renderbuffer.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue()]).fromJSValue()! } func isShader(shader: WebGLShader?) -> GLboolean { - jsObject[Strings.isShader]!(shader.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isShader].function!(this: this, arguments: [shader.jsValue()]).fromJSValue()! } func isTexture(texture: WebGLTexture?) -> GLboolean { - jsObject[Strings.isTexture]!(texture.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isTexture].function!(this: this, arguments: [texture.jsValue()]).fromJSValue()! } func lineWidth(width: GLfloat) { - _ = jsObject[Strings.lineWidth]!(width.jsValue()) + let this = jsObject + _ = this[Strings.lineWidth].function!(this: this, arguments: [width.jsValue()]) } func linkProgram(program: WebGLProgram) { - _ = jsObject[Strings.linkProgram]!(program.jsValue()) + let this = jsObject + _ = this[Strings.linkProgram].function!(this: this, arguments: [program.jsValue()]) } func pixelStorei(pname: GLenum, param: GLint) { - _ = jsObject[Strings.pixelStorei]!(pname.jsValue(), param.jsValue()) + let this = jsObject + _ = this[Strings.pixelStorei].function!(this: this, arguments: [pname.jsValue(), param.jsValue()]) } func polygonOffset(factor: GLfloat, units: GLfloat) { - _ = jsObject[Strings.polygonOffset]!(factor.jsValue(), units.jsValue()) + let this = jsObject + _ = this[Strings.polygonOffset].function!(this: this, arguments: [factor.jsValue(), units.jsValue()]) } func renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) { - _ = jsObject[Strings.renderbufferStorage]!(target.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()) + let this = jsObject + _ = this[Strings.renderbufferStorage].function!(this: this, arguments: [target.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()]) } func sampleCoverage(value: GLclampf, invert: GLboolean) { - _ = jsObject[Strings.sampleCoverage]!(value.jsValue(), invert.jsValue()) + let this = jsObject + _ = this[Strings.sampleCoverage].function!(this: this, arguments: [value.jsValue(), invert.jsValue()]) } func scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { - _ = jsObject[Strings.scissor]!(x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()) + let this = jsObject + _ = this[Strings.scissor].function!(this: this, arguments: [x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()]) } func shaderSource(shader: WebGLShader, source: String) { - _ = jsObject[Strings.shaderSource]!(shader.jsValue(), source.jsValue()) + let this = jsObject + _ = this[Strings.shaderSource].function!(this: this, arguments: [shader.jsValue(), source.jsValue()]) } func stencilFunc(func: GLenum, ref: GLint, mask: GLuint) { - _ = jsObject[Strings.stencilFunc]!(`func`.jsValue(), ref.jsValue(), mask.jsValue()) + let this = jsObject + _ = this[Strings.stencilFunc].function!(this: this, arguments: [`func`.jsValue(), ref.jsValue(), mask.jsValue()]) } func stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint) { - _ = jsObject[Strings.stencilFuncSeparate]!(face.jsValue(), `func`.jsValue(), ref.jsValue(), mask.jsValue()) + let this = jsObject + _ = this[Strings.stencilFuncSeparate].function!(this: this, arguments: [face.jsValue(), `func`.jsValue(), ref.jsValue(), mask.jsValue()]) } func stencilMask(mask: GLuint) { - _ = jsObject[Strings.stencilMask]!(mask.jsValue()) + let this = jsObject + _ = this[Strings.stencilMask].function!(this: this, arguments: [mask.jsValue()]) } func stencilMaskSeparate(face: GLenum, mask: GLuint) { - _ = jsObject[Strings.stencilMaskSeparate]!(face.jsValue(), mask.jsValue()) + let this = jsObject + _ = this[Strings.stencilMaskSeparate].function!(this: this, arguments: [face.jsValue(), mask.jsValue()]) } func stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) { - _ = jsObject[Strings.stencilOp]!(fail.jsValue(), zfail.jsValue(), zpass.jsValue()) + let this = jsObject + _ = this[Strings.stencilOp].function!(this: this, arguments: [fail.jsValue(), zfail.jsValue(), zpass.jsValue()]) } func stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) { - _ = jsObject[Strings.stencilOpSeparate]!(face.jsValue(), fail.jsValue(), zfail.jsValue(), zpass.jsValue()) + let this = jsObject + _ = this[Strings.stencilOpSeparate].function!(this: this, arguments: [face.jsValue(), fail.jsValue(), zfail.jsValue(), zpass.jsValue()]) } func texParameterf(target: GLenum, pname: GLenum, param: GLfloat) { - _ = jsObject[Strings.texParameterf]!(target.jsValue(), pname.jsValue(), param.jsValue()) + let this = jsObject + _ = this[Strings.texParameterf].function!(this: this, arguments: [target.jsValue(), pname.jsValue(), param.jsValue()]) } func texParameteri(target: GLenum, pname: GLenum, param: GLint) { - _ = jsObject[Strings.texParameteri]!(target.jsValue(), pname.jsValue(), param.jsValue()) + let this = jsObject + _ = this[Strings.texParameteri].function!(this: this, arguments: [target.jsValue(), pname.jsValue(), param.jsValue()]) } func uniform1f(location: WebGLUniformLocation?, x: GLfloat) { - _ = jsObject[Strings.uniform1f]!(location.jsValue(), x.jsValue()) + let this = jsObject + _ = this[Strings.uniform1f].function!(this: this, arguments: [location.jsValue(), x.jsValue()]) } func uniform2f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat) { - _ = jsObject[Strings.uniform2f]!(location.jsValue(), x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.uniform2f].function!(this: this, arguments: [location.jsValue(), x.jsValue(), y.jsValue()]) } func uniform3f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat) { - _ = jsObject[Strings.uniform3f]!(location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue()) + let this = jsObject + _ = this[Strings.uniform3f].function!(this: this, arguments: [location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue()]) } func uniform4f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { - _ = jsObject[Strings.uniform4f]!(location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + let this = jsObject + _ = this[Strings.uniform4f].function!(this: this, arguments: [location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()]) } func uniform1i(location: WebGLUniformLocation?, x: GLint) { - _ = jsObject[Strings.uniform1i]!(location.jsValue(), x.jsValue()) + let this = jsObject + _ = this[Strings.uniform1i].function!(this: this, arguments: [location.jsValue(), x.jsValue()]) } func uniform2i(location: WebGLUniformLocation?, x: GLint, y: GLint) { - _ = jsObject[Strings.uniform2i]!(location.jsValue(), x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.uniform2i].function!(this: this, arguments: [location.jsValue(), x.jsValue(), y.jsValue()]) } func uniform3i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint) { - _ = jsObject[Strings.uniform3i]!(location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue()) + let this = jsObject + _ = this[Strings.uniform3i].function!(this: this, arguments: [location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue()]) } func uniform4i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint, w: GLint) { - _ = jsObject[Strings.uniform4i]!(location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + let this = jsObject + _ = this[Strings.uniform4i].function!(this: this, arguments: [location.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()]) } func useProgram(program: WebGLProgram?) { - _ = jsObject[Strings.useProgram]!(program.jsValue()) + let this = jsObject + _ = this[Strings.useProgram].function!(this: this, arguments: [program.jsValue()]) } func validateProgram(program: WebGLProgram) { - _ = jsObject[Strings.validateProgram]!(program.jsValue()) + let this = jsObject + _ = this[Strings.validateProgram].function!(this: this, arguments: [program.jsValue()]) } func vertexAttrib1f(index: GLuint, x: GLfloat) { - _ = jsObject[Strings.vertexAttrib1f]!(index.jsValue(), x.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttrib1f].function!(this: this, arguments: [index.jsValue(), x.jsValue()]) } func vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat) { - _ = jsObject[Strings.vertexAttrib2f]!(index.jsValue(), x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttrib2f].function!(this: this, arguments: [index.jsValue(), x.jsValue(), y.jsValue()]) } func vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) { - _ = jsObject[Strings.vertexAttrib3f]!(index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttrib3f].function!(this: this, arguments: [index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue()]) } func vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { - _ = jsObject[Strings.vertexAttrib4f]!(index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttrib4f].function!(this: this, arguments: [index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()]) } func vertexAttrib1fv(index: GLuint, values: Float32List) { - _ = jsObject[Strings.vertexAttrib1fv]!(index.jsValue(), values.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttrib1fv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } func vertexAttrib2fv(index: GLuint, values: Float32List) { - _ = jsObject[Strings.vertexAttrib2fv]!(index.jsValue(), values.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttrib2fv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } func vertexAttrib3fv(index: GLuint, values: Float32List) { - _ = jsObject[Strings.vertexAttrib3fv]!(index.jsValue(), values.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttrib3fv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } func vertexAttrib4fv(index: GLuint, values: Float32List) { - _ = jsObject[Strings.vertexAttrib4fv]!(index.jsValue(), values.jsValue()) + let this = jsObject + _ = this[Strings.vertexAttrib4fv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } func vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) { @@ -1090,20 +1206,24 @@ public extension WebGLRenderingContextBase { let _arg3 = normalized.jsValue() let _arg4 = stride.jsValue() let _arg5 = offset.jsValue() - _ = jsObject[Strings.vertexAttribPointer]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.vertexAttribPointer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { - _ = jsObject[Strings.viewport]!(x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()) + let this = jsObject + _ = this[Strings.viewport].function!(this: this, arguments: [x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()]) } func makeXRCompatible() -> JSPromise { - jsObject[Strings.makeXRCompatible]!().fromJSValue()! + let this = jsObject + return this[Strings.makeXRCompatible].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func makeXRCompatible() async throws { - let _promise: JSPromise = jsObject[Strings.makeXRCompatible]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.makeXRCompatible].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift index d4512bbb..28348933 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift @@ -6,15 +6,18 @@ import JavaScriptKit public protocol WebGLRenderingContextOverloads: JSBridgedClass {} public extension WebGLRenderingContextOverloads { func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { - _ = jsObject[Strings.bufferData]!(target.jsValue(), size.jsValue(), usage.jsValue()) + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue(), size.jsValue(), usage.jsValue()]) } func bufferData(target: GLenum, data: BufferSource?, usage: GLenum) { - _ = jsObject[Strings.bufferData]!(target.jsValue(), data.jsValue(), usage.jsValue()) + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue(), data.jsValue(), usage.jsValue()]) } func bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource) { - _ = jsObject[Strings.bufferSubData]!(target.jsValue(), offset.jsValue(), data.jsValue()) + let this = jsObject + _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue(), offset.jsValue(), data.jsValue()]) } func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) { @@ -25,7 +28,8 @@ public extension WebGLRenderingContextOverloads { let _arg4 = height.jsValue() let _arg5 = border.jsValue() let _arg6 = data.jsValue() - _ = jsObject[Strings.compressedTexImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + let this = jsObject + _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) { @@ -37,7 +41,8 @@ public extension WebGLRenderingContextOverloads { let _arg5 = height.jsValue() let _arg6 = format.jsValue() let _arg7 = data.jsValue() - _ = jsObject[Strings.compressedTexSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) + let this = jsObject + _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { @@ -48,7 +53,8 @@ public extension WebGLRenderingContextOverloads { let _arg4 = format.jsValue() let _arg5 = type.jsValue() let _arg6 = pixels.jsValue() - _ = jsObject[Strings.readPixels]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + let this = jsObject + _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { @@ -61,7 +67,8 @@ public extension WebGLRenderingContextOverloads { let _arg6 = format.jsValue() let _arg7 = type.jsValue() let _arg8 = pixels.jsValue() - _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) { @@ -71,7 +78,8 @@ public extension WebGLRenderingContextOverloads { let _arg3 = format.jsValue() let _arg4 = type.jsValue() let _arg5 = source.jsValue() - _ = jsObject[Strings.texImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5) + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { @@ -84,7 +92,8 @@ public extension WebGLRenderingContextOverloads { let _arg6 = format.jsValue() let _arg7 = type.jsValue() let _arg8 = pixels.jsValue() - _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource) { @@ -95,50 +104,62 @@ public extension WebGLRenderingContextOverloads { let _arg4 = format.jsValue() let _arg5 = type.jsValue() let _arg6 = source.jsValue() - _ = jsObject[Strings.texSubImage2D]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } func uniform1fv(location: WebGLUniformLocation?, v: Float32List) { - _ = jsObject[Strings.uniform1fv]!(location.jsValue(), v.jsValue()) + let this = jsObject + _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } func uniform2fv(location: WebGLUniformLocation?, v: Float32List) { - _ = jsObject[Strings.uniform2fv]!(location.jsValue(), v.jsValue()) + let this = jsObject + _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } func uniform3fv(location: WebGLUniformLocation?, v: Float32List) { - _ = jsObject[Strings.uniform3fv]!(location.jsValue(), v.jsValue()) + let this = jsObject + _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } func uniform4fv(location: WebGLUniformLocation?, v: Float32List) { - _ = jsObject[Strings.uniform4fv]!(location.jsValue(), v.jsValue()) + let this = jsObject + _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } func uniform1iv(location: WebGLUniformLocation?, v: Int32List) { - _ = jsObject[Strings.uniform1iv]!(location.jsValue(), v.jsValue()) + let this = jsObject + _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } func uniform2iv(location: WebGLUniformLocation?, v: Int32List) { - _ = jsObject[Strings.uniform2iv]!(location.jsValue(), v.jsValue()) + let this = jsObject + _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } func uniform3iv(location: WebGLUniformLocation?, v: Int32List) { - _ = jsObject[Strings.uniform3iv]!(location.jsValue(), v.jsValue()) + let this = jsObject + _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } func uniform4iv(location: WebGLUniformLocation?, v: Int32List) { - _ = jsObject[Strings.uniform4iv]!(location.jsValue(), v.jsValue()) + let this = jsObject + _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { - _ = jsObject[Strings.uniformMatrix2fv]!(location.jsValue(), transpose.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), value.jsValue()]) } func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { - _ = jsObject[Strings.uniformMatrix3fv]!(location.jsValue(), transpose.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), value.jsValue()]) } func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { - _ = jsObject[Strings.uniformMatrix4fv]!(location.jsValue(), transpose.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), value.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/WebSocket.swift b/Sources/DOMKit/WebIDL/WebSocket.swift index 79137559..2fc82bed 100644 --- a/Sources/DOMKit/WebIDL/WebSocket.swift +++ b/Sources/DOMKit/WebIDL/WebSocket.swift @@ -57,7 +57,8 @@ public class WebSocket: EventTarget { public var `protocol`: String public func close(code: UInt16? = nil, reason: String? = nil) { - _ = jsObject[Strings.close]!(code?.jsValue() ?? .undefined, reason?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: [code?.jsValue() ?? .undefined, reason?.jsValue() ?? .undefined]) } @ClosureAttribute1Optional @@ -67,6 +68,7 @@ public class WebSocket: EventTarget { public var binaryType: BinaryType public func send(data: __UNSUPPORTED_UNION__) { - _ = jsObject[Strings.send]!(data.jsValue()) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/WebTransport.swift b/Sources/DOMKit/WebIDL/WebTransport.swift index 5747cd65..781605a1 100644 --- a/Sources/DOMKit/WebIDL/WebTransport.swift +++ b/Sources/DOMKit/WebIDL/WebTransport.swift @@ -22,12 +22,14 @@ public class WebTransport: JSBridgedClass { } public func getStats() -> JSPromise { - jsObject[Strings.getStats]!().fromJSValue()! + let this = jsObject + return this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getStats() async throws -> WebTransportStats { - let _promise: JSPromise = jsObject[Strings.getStats]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -38,19 +40,22 @@ public class WebTransport: JSBridgedClass { public var closed: JSPromise public func close(closeInfo: WebTransportCloseInfo? = nil) { - _ = jsObject[Strings.close]!(closeInfo?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: [closeInfo?.jsValue() ?? .undefined]) } @ReadonlyAttribute public var datagrams: WebTransportDatagramDuplexStream public func createBidirectionalStream() -> JSPromise { - jsObject[Strings.createBidirectionalStream]!().fromJSValue()! + let this = jsObject + return this[Strings.createBidirectionalStream].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func createBidirectionalStream() async throws -> WebTransportBidirectionalStream { - let _promise: JSPromise = jsObject[Strings.createBidirectionalStream]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createBidirectionalStream].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -58,12 +63,14 @@ public class WebTransport: JSBridgedClass { public var incomingBidirectionalStreams: ReadableStream public func createUnidirectionalStream() -> JSPromise { - jsObject[Strings.createUnidirectionalStream]!().fromJSValue()! + let this = jsObject + return this[Strings.createUnidirectionalStream].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func createUnidirectionalStream() async throws -> WritableStream { - let _promise: JSPromise = jsObject[Strings.createUnidirectionalStream]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createUnidirectionalStream].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 2d0057b5..6a17e8a1 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -77,30 +77,36 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var cookieStore: CookieStore public func navigate(dir: SpatialNavigationDirection) { - _ = jsObject[Strings.navigate]!(dir.jsValue()) + let this = jsObject + _ = this[Strings.navigate].function!(this: this, arguments: [dir.jsValue()]) } public func matchMedia(query: String) -> MediaQueryList { - jsObject[Strings.matchMedia]!(query.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.matchMedia].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } @ReadonlyAttribute public var screen: Screen public func moveTo(x: Int32, y: Int32) { - _ = jsObject[Strings.moveTo]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } public func moveBy(x: Int32, y: Int32) { - _ = jsObject[Strings.moveBy]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.moveBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } public func resizeTo(width: Int32, height: Int32) { - _ = jsObject[Strings.resizeTo]!(width.jsValue(), height.jsValue()) + let this = jsObject + _ = this[Strings.resizeTo].function!(this: this, arguments: [width.jsValue(), height.jsValue()]) } public func resizeBy(x: Int32, y: Int32) { - _ = jsObject[Strings.resizeBy]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.resizeBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } @ReadonlyAttribute @@ -122,27 +128,33 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var pageYOffset: Double public func scroll(options: ScrollToOptions? = nil) { - _ = jsObject[Strings.scroll]!(options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } public func scroll(x: Double, y: Double) { - _ = jsObject[Strings.scroll]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } public func scrollTo(options: ScrollToOptions? = nil) { - _ = jsObject[Strings.scrollTo]!(options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } public func scrollTo(x: Double, y: Double) { - _ = jsObject[Strings.scrollTo]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } public func scrollBy(options: ScrollToOptions? = nil) { - _ = jsObject[Strings.scrollBy]!(options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } public func scrollBy(x: Double, y: Double) { - _ = jsObject[Strings.scrollBy]!(x.jsValue(), y.jsValue()) + let this = jsObject + _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } @ReadonlyAttribute @@ -167,16 +179,19 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var devicePixelRatio: Double public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { - jsObject[Strings.getComputedStyle]!(elt.jsValue(), pseudoElt?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getComputedStyle].function!(this: this, arguments: [elt.jsValue(), pseudoElt?.jsValue() ?? .undefined]).fromJSValue()! } public func getDigitalGoodsService(serviceProvider: String) -> JSPromise { - jsObject[Strings.getDigitalGoodsService]!(serviceProvider.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func getDigitalGoodsService(serviceProvider: String) async throws -> DigitalGoodsService { - let _promise: JSPromise = jsObject[Strings.getDigitalGoodsService]!(serviceProvider.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -184,32 +199,38 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var event: __UNSUPPORTED_UNION__ public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { - jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { - let _promise: JSPromise = jsObject[Strings.showOpenFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { - jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { - let _promise: JSPromise = jsObject[Strings.showSaveFilePicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { - jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { - let _promise: JSPromise = jsObject[Strings.showDirectoryPicker]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -256,22 +277,26 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var status: String public func close() { - _ = jsObject[Strings.close]!() + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } @ReadonlyAttribute public var closed: Bool public func stop() { - _ = jsObject[Strings.stop]!() + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) } public func focus() { - _ = jsObject[Strings.focus]!() + let this = jsObject + _ = this[Strings.focus].function!(this: this, arguments: []) } public func blur() { - _ = jsObject[Strings.blur]!() + let this = jsObject + _ = this[Strings.blur].function!(this: this, arguments: []) } @ReadonlyAttribute @@ -293,7 +318,8 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var frameElement: Element? public func open(url: String? = nil, target: String? = nil, features: String? = nil) -> WindowProxy? { - jsObject[Strings.open]!(url?.jsValue() ?? .undefined, target?.jsValue() ?? .undefined, features?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.open].function!(this: this, arguments: [url?.jsValue() ?? .undefined, target?.jsValue() ?? .undefined, features?.jsValue() ?? .undefined]).fromJSValue()! } public subscript(key: String) -> JSObject { @@ -310,39 +336,48 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind public var originAgentCluster: Bool public func alert() { - _ = jsObject[Strings.alert]!() + let this = jsObject + _ = this[Strings.alert].function!(this: this, arguments: []) } public func alert(message: String) { - _ = jsObject[Strings.alert]!(message.jsValue()) + let this = jsObject + _ = this[Strings.alert].function!(this: this, arguments: [message.jsValue()]) } public func confirm(message: String? = nil) -> Bool { - jsObject[Strings.confirm]!(message?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.confirm].function!(this: this, arguments: [message?.jsValue() ?? .undefined]).fromJSValue()! } public func prompt(message: String? = nil, default: String? = nil) -> String? { - jsObject[Strings.prompt]!(message?.jsValue() ?? .undefined, `default`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.prompt].function!(this: this, arguments: [message?.jsValue() ?? .undefined, `default`?.jsValue() ?? .undefined]).fromJSValue()! } public func print() { - _ = jsObject[Strings.print]!() + let this = jsObject + _ = this[Strings.print].function!(this: this, arguments: []) } public func postMessage(message: JSValue, targetOrigin: String, transfer: [JSObject]? = nil) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined]) } public func postMessage(message: JSValue, options: WindowPostMessageOptions? = nil) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } public func captureEvents() { - _ = jsObject[Strings.captureEvents]!() + let this = jsObject + _ = this[Strings.captureEvents].function!(this: this, arguments: []) } public func releaseEvents() { - _ = jsObject[Strings.releaseEvents]!() + let this = jsObject + _ = this[Strings.releaseEvents].function!(this: this, arguments: []) } @ReadonlyAttribute @@ -375,11 +410,13 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind // XXX: member 'requestIdleCallback' is ignored public func cancelIdleCallback(handle: UInt32) { - _ = jsObject[Strings.cancelIdleCallback]!(handle.jsValue()) + let this = jsObject + _ = this[Strings.cancelIdleCallback].function!(this: this, arguments: [handle.jsValue()]) } public func getSelection() -> Selection? { - jsObject[Strings.getSelection]!().fromJSValue()! + let this = jsObject + return this[Strings.getSelection].function!(this: this, arguments: []).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WindowClient.swift b/Sources/DOMKit/WebIDL/WindowClient.swift index a73fb758..22aaab32 100644 --- a/Sources/DOMKit/WebIDL/WindowClient.swift +++ b/Sources/DOMKit/WebIDL/WindowClient.swift @@ -23,22 +23,26 @@ public class WindowClient: Client { public var ancestorOrigins: [String] public func focus() -> JSPromise { - jsObject[Strings.focus]!().fromJSValue()! + let this = jsObject + return this[Strings.focus].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func focus() async throws -> WindowClient { - let _promise: JSPromise = jsObject[Strings.focus]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.focus].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func navigate(url: String) -> JSPromise { - jsObject[Strings.navigate]!(url.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.navigate].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func navigate(url: String) async throws -> WindowClient? { - let _promise: JSPromise = jsObject[Strings.navigate]!(url.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.navigate].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift index 919f581d..2fb4c280 100644 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift @@ -16,7 +16,8 @@ public class WindowControlsOverlay: EventTarget { public var visible: Bool public func getTitlebarAreaRect() -> DOMRect { - jsObject[Strings.getTitlebarAreaRect]!().fromJSValue()! + let this = jsObject + return this[Strings.getTitlebarAreaRect].function!(this: this, arguments: []).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index fc156d30..125982bd 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -10,12 +10,14 @@ public extension WindowOrWorkerGlobalScope { var crypto: Crypto { ReadonlyAttribute[Strings.crypto, in: jsObject] } func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { - jsObject[Strings.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.fetch].function!(this: this, arguments: [input.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func fetch(input: RequestInfo, init: RequestInit? = nil) async throws -> Response { - let _promise: JSPromise = jsObject[Strings.fetch]!(input.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [input.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -28,42 +30,51 @@ public extension WindowOrWorkerGlobalScope { var crossOriginIsolated: Bool { ReadonlyAttribute[Strings.crossOriginIsolated, in: jsObject] } func reportError(e: JSValue) { - _ = jsObject[Strings.reportError]!(e.jsValue()) + let this = jsObject + _ = this[Strings.reportError].function!(this: this, arguments: [e.jsValue()]) } func btoa(data: String) -> String { - jsObject[Strings.btoa]!(data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.btoa].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } func atob(data: String) -> String { - jsObject[Strings.atob]!(data.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.atob].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } func setTimeout(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { - jsObject[Strings.setTimeout]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setTimeout].function!(this: this, arguments: [handler.jsValue(), timeout?.jsValue() ?? .undefined] + arguments.map { $0.jsValue() }).fromJSValue()! } func clearTimeout(id: Int32? = nil) { - _ = jsObject[Strings.clearTimeout]!(id?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clearTimeout].function!(this: this, arguments: [id?.jsValue() ?? .undefined]) } func setInterval(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { - jsObject[Strings.setInterval]!(handler.jsValue(), timeout?.jsValue() ?? .undefined, arguments.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.setInterval].function!(this: this, arguments: [handler.jsValue(), timeout?.jsValue() ?? .undefined] + arguments.map { $0.jsValue() }).fromJSValue()! } func clearInterval(id: Int32? = nil) { - _ = jsObject[Strings.clearInterval]!(id?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.clearInterval].function!(this: this, arguments: [id?.jsValue() ?? .undefined]) } // XXX: method 'queueMicrotask' is ignored func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) -> JSPromise { - jsObject[Strings.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createImageBitmap].function!(this: this, arguments: [image.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { - let _promise: JSPromise = jsObject[Strings.createImageBitmap]!(image.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createImageBitmap].function!(this: this, arguments: [image.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -74,7 +85,8 @@ public extension WindowOrWorkerGlobalScope { let _arg3 = sw.jsValue() let _arg4 = sh.jsValue() let _arg5 = options?.jsValue() ?? .undefined - return jsObject[Strings.createImageBitmap]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + let this = jsObject + return this[Strings.createImageBitmap].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @@ -85,12 +97,14 @@ public extension WindowOrWorkerGlobalScope { let _arg3 = sw.jsValue() let _arg4 = sh.jsValue() let _arg5 = options?.jsValue() ?? .undefined - let _promise: JSPromise = jsObject[Strings.createImageBitmap]!(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createImageBitmap].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! return try await _promise.get().fromJSValue()! } func structuredClone(value: JSValue, options: StructuredSerializeOptions? = nil) -> JSValue { - jsObject[Strings.structuredClone]!(value.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.structuredClone].function!(this: this, arguments: [value.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } var originPolicyIds: [String] { ReadonlyAttribute[Strings.originPolicyIds, in: jsObject] } diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index 7c1c7be9..f80f1a8d 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -17,15 +17,18 @@ public class Worker: EventTarget, AbstractWorker { } public func terminate() { - _ = jsObject[Strings.terminate]!() + let this = jsObject + _ = this[Strings.terminate].function!(this: this, arguments: []) } public func postMessage(message: JSValue, transfer: [JSObject]) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), transfer.jsValue()) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - _ = jsObject[Strings.postMessage]!(message.jsValue(), options?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index 880013e5..9d73fedc 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -29,7 +29,8 @@ public class WorkerGlobalScope: EventTarget, FontFaceSource, WindowOrWorkerGloba public var navigator: WorkerNavigator public func importScripts(urls: String...) { - _ = jsObject[Strings.importScripts]!(urls.jsValue()) + let this = jsObject + _ = this[Strings.importScripts].function!(this: this, arguments: urls.map { $0.jsValue() }) } @ClosureAttribute5Optional diff --git a/Sources/DOMKit/WebIDL/Worklet.swift b/Sources/DOMKit/WebIDL/Worklet.swift index abff847d..d23fe1f0 100644 --- a/Sources/DOMKit/WebIDL/Worklet.swift +++ b/Sources/DOMKit/WebIDL/Worklet.swift @@ -13,12 +13,14 @@ public class Worklet: JSBridgedClass { } public func addModule(moduleURL: String, options: WorkletOptions? = nil) -> JSPromise { - jsObject[Strings.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.addModule].function!(this: this, arguments: [moduleURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func addModule(moduleURL: String, options: WorkletOptions? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.addModule]!(moduleURL.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.addModule].function!(this: this, arguments: [moduleURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift b/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift index a09be43d..c7833f7f 100644 --- a/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift +++ b/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift @@ -14,11 +14,13 @@ public class WorkletAnimationEffect: JSBridgedClass { } public func getTiming() -> EffectTiming { - jsObject[Strings.getTiming]!().fromJSValue()! + let this = jsObject + return this[Strings.getTiming].function!(this: this, arguments: []).fromJSValue()! } public func getComputedTiming() -> ComputedEffectTiming { - jsObject[Strings.getComputedTiming]!().fromJSValue()! + let this = jsObject + return this[Strings.getComputedTiming].function!(this: this, arguments: []).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift b/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift index 7b93d712..e614cb75 100644 --- a/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift +++ b/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift @@ -13,6 +13,7 @@ public class WorkletGroupEffect: JSBridgedClass { } public func getChildren() -> [WorkletAnimationEffect] { - jsObject[Strings.getChildren]!().fromJSValue()! + let this = jsObject + return this[Strings.getChildren].function!(this: this, arguments: []).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift index 578e6a8d..8c996bea 100644 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -21,26 +21,31 @@ public class WritableStream: JSBridgedClass { public var locked: Bool public func abort(reason: JSValue? = nil) -> JSPromise { - jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func abort(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject[Strings.close]!().fromJSValue()! + 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, *) public func close() async throws { - let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func getWriter() -> WritableStreamDefaultWriter { - jsObject[Strings.getWriter]!().fromJSValue()! + 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 index e1b6dbe7..da49d5f5 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift @@ -17,6 +17,7 @@ public class WritableStreamDefaultController: JSBridgedClass { public var signal: AbortSignal public func error(e: JSValue? = nil) { - _ = jsObject[Strings.error]!(e?.jsValue() ?? .undefined) + 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 index d718565e..364f7543 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -29,36 +29,43 @@ public class WritableStreamDefaultWriter: JSBridgedClass { public var ready: JSPromise public func abort(reason: JSValue? = nil) -> JSPromise { - jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func abort(reason: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.abort]!(reason?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } public func close() -> JSPromise { - jsObject[Strings.close]!().fromJSValue()! + 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, *) public func close() async throws { - let _promise: JSPromise = jsObject[Strings.close]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } public func releaseLock() { - _ = jsObject[Strings.releaseLock]!() + let this = jsObject + _ = this[Strings.releaseLock].function!(this: this, arguments: []) } public func write(chunk: JSValue? = nil) -> JSPromise { - jsObject[Strings.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + 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, *) public func write(chunk: JSValue? = nil) async throws { - let _promise: JSPromise = jsObject[Strings.write]!(chunk?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [chunk?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index ee7294be..bc290224 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -43,15 +43,18 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var readyState: UInt16 public func open(method: String, url: String) { - _ = jsObject[Strings.open]!(method.jsValue(), url.jsValue()) + let this = jsObject + _ = this[Strings.open].function!(this: this, arguments: [method.jsValue(), url.jsValue()]) } public func open(method: String, url: String, async: Bool, username: String? = nil, password: String? = nil) { - _ = jsObject[Strings.open]!(method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.open].function!(this: this, arguments: [method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined]) } public func setRequestHeader(name: String, value: String) { - _ = jsObject[Strings.setRequestHeader]!(name.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.setRequestHeader].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } @ReadWriteAttribute @@ -64,11 +67,13 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var upload: XMLHttpRequestUpload public func send(body: __UNSUPPORTED_UNION__? = nil) { - _ = jsObject[Strings.send]!(body?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.send].function!(this: this, arguments: [body?.jsValue() ?? .undefined]) } public func abort() { - _ = jsObject[Strings.abort]!() + let this = jsObject + _ = this[Strings.abort].function!(this: this, arguments: []) } @ReadonlyAttribute @@ -81,15 +86,18 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { public var statusText: String public func getResponseHeader(name: String) -> String? { - jsObject[Strings.getResponseHeader]!(name.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getResponseHeader].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } public func getAllResponseHeaders() -> String { - jsObject[Strings.getAllResponseHeaders]!().fromJSValue()! + let this = jsObject + return this[Strings.getAllResponseHeaders].function!(this: this, arguments: []).fromJSValue()! } public func overrideMimeType(mime: String) { - _ = jsObject[Strings.overrideMimeType]!(mime.jsValue()) + let this = jsObject + _ = this[Strings.overrideMimeType].function!(this: this, arguments: [mime.jsValue()]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/XMLSerializer.swift b/Sources/DOMKit/WebIDL/XMLSerializer.swift index e49dcf4a..96aab106 100644 --- a/Sources/DOMKit/WebIDL/XMLSerializer.swift +++ b/Sources/DOMKit/WebIDL/XMLSerializer.swift @@ -17,6 +17,7 @@ public class XMLSerializer: JSBridgedClass { } public func serializeToString(root: Node) -> String { - jsObject[Strings.serializeToString]!(root.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.serializeToString].function!(this: this, arguments: [root.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XPathExpression.swift b/Sources/DOMKit/WebIDL/XPathExpression.swift index ee2ca76f..465c5094 100644 --- a/Sources/DOMKit/WebIDL/XPathExpression.swift +++ b/Sources/DOMKit/WebIDL/XPathExpression.swift @@ -13,6 +13,7 @@ public class XPathExpression: JSBridgedClass { } public func evaluate(contextNode: Node, type: UInt16? = nil, result: XPathResult? = nil) -> XPathResult { - jsObject[Strings.evaluate]!(contextNode.jsValue(), type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.evaluate].function!(this: this, arguments: [contextNode.jsValue(), type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XPathResult.swift b/Sources/DOMKit/WebIDL/XPathResult.swift index a8626b0d..bb70e65b 100644 --- a/Sources/DOMKit/WebIDL/XPathResult.swift +++ b/Sources/DOMKit/WebIDL/XPathResult.swift @@ -61,10 +61,12 @@ public class XPathResult: JSBridgedClass { public var snapshotLength: UInt32 public func iterateNext() -> Node? { - jsObject[Strings.iterateNext]!().fromJSValue()! + let this = jsObject + return this[Strings.iterateNext].function!(this: this, arguments: []).fromJSValue()! } public func snapshotItem(index: UInt32) -> Node? { - jsObject[Strings.snapshotItem]!(index.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.snapshotItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRAnchor.swift b/Sources/DOMKit/WebIDL/XRAnchor.swift index 4cb8a54c..d3bda1ce 100644 --- a/Sources/DOMKit/WebIDL/XRAnchor.swift +++ b/Sources/DOMKit/WebIDL/XRAnchor.swift @@ -17,6 +17,7 @@ public class XRAnchor: JSBridgedClass { public var anchorSpace: XRSpace public func delete() { - _ = jsObject[Strings.delete]!() + let this = jsObject + _ = this[Strings.delete].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift b/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift index b71b2ade..e8f008ae 100644 --- a/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift +++ b/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift @@ -15,6 +15,7 @@ public class XRCPUDepthInformation: XRDepthInformation { public var data: ArrayBuffer public func getDepthInMeters(x: Float, y: Float) -> Float { - jsObject[Strings.getDepthInMeters]!(x.jsValue(), y.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getDepthInMeters].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRCompositionLayer.swift b/Sources/DOMKit/WebIDL/XRCompositionLayer.swift index 1b261e49..db72c67e 100644 --- a/Sources/DOMKit/WebIDL/XRCompositionLayer.swift +++ b/Sources/DOMKit/WebIDL/XRCompositionLayer.swift @@ -31,6 +31,7 @@ public class XRCompositionLayer: XRLayer { public var needsRedraw: Bool public func destroy() { - _ = jsObject[Strings.destroy]!() + let this = jsObject + _ = this[Strings.destroy].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/XRFrame.swift b/Sources/DOMKit/WebIDL/XRFrame.swift index d6bf81dd..e597773d 100644 --- a/Sources/DOMKit/WebIDL/XRFrame.swift +++ b/Sources/DOMKit/WebIDL/XRFrame.swift @@ -16,12 +16,14 @@ public class XRFrame: JSBridgedClass { } public func createAnchor(pose: XRRigidTransform, space: XRSpace) -> JSPromise { - jsObject[Strings.createAnchor]!(pose.jsValue(), space.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue(), space.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func createAnchor(pose: XRRigidTransform, space: XRSpace) async throws -> XRAnchor { - let _promise: JSPromise = jsObject[Strings.createAnchor]!(pose.jsValue(), space.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue(), space.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -29,31 +31,38 @@ public class XRFrame: JSBridgedClass { public var trackedAnchors: XRAnchorSet public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { - jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! } public func getJointPose(joint: XRJointSpace, baseSpace: XRSpace) -> XRJointPose? { - jsObject[Strings.getJointPose]!(joint.jsValue(), baseSpace.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getJointPose].function!(this: this, arguments: [joint.jsValue(), baseSpace.jsValue()]).fromJSValue()! } public func fillJointRadii(jointSpaces: [XRJointSpace], radii: Float32Array) -> Bool { - jsObject[Strings.fillJointRadii]!(jointSpaces.jsValue(), radii.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.fillJointRadii].function!(this: this, arguments: [jointSpaces.jsValue(), radii.jsValue()]).fromJSValue()! } public func fillPoses(spaces: [XRSpace], baseSpace: XRSpace, transforms: Float32Array) -> Bool { - jsObject[Strings.fillPoses]!(spaces.jsValue(), baseSpace.jsValue(), transforms.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.fillPoses].function!(this: this, arguments: [spaces.jsValue(), baseSpace.jsValue(), transforms.jsValue()]).fromJSValue()! } public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { - jsObject[Strings.getHitTestResults]!(hitTestSource.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getHitTestResults].function!(this: this, arguments: [hitTestSource.jsValue()]).fromJSValue()! } public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { - jsObject[Strings.getHitTestResultsForTransientInput]!(hitTestSource.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getHitTestResultsForTransientInput].function!(this: this, arguments: [hitTestSource.jsValue()]).fromJSValue()! } public func getLightEstimate(lightProbe: XRLightProbe) -> XRLightEstimate? { - jsObject[Strings.getLightEstimate]!(lightProbe.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getLightEstimate].function!(this: this, arguments: [lightProbe.jsValue()]).fromJSValue()! } @ReadonlyAttribute @@ -63,10 +72,12 @@ public class XRFrame: JSBridgedClass { public var predictedDisplayTime: DOMHighResTimeStamp public func getViewerPose(referenceSpace: XRReferenceSpace) -> XRViewerPose? { - jsObject[Strings.getViewerPose]!(referenceSpace.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getViewerPose].function!(this: this, arguments: [referenceSpace.jsValue()]).fromJSValue()! } public func getPose(space: XRSpace, baseSpace: XRSpace) -> XRPose? { - jsObject[Strings.getPose]!(space.jsValue(), baseSpace.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getPose].function!(this: this, arguments: [space.jsValue(), baseSpace.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRHand.swift b/Sources/DOMKit/WebIDL/XRHand.swift index cd9fccdf..3e8549eb 100644 --- a/Sources/DOMKit/WebIDL/XRHand.swift +++ b/Sources/DOMKit/WebIDL/XRHand.swift @@ -22,6 +22,7 @@ public class XRHand: JSBridgedClass, Sequence { public var size: UInt32 public func get(key: XRHandJoint) -> XRJointSpace { - jsObject[Strings.get]!(key.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [key.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRHitTestResult.swift b/Sources/DOMKit/WebIDL/XRHitTestResult.swift index 5d50ee54..94fc044a 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestResult.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestResult.swift @@ -13,16 +13,19 @@ public class XRHitTestResult: JSBridgedClass { } public func createAnchor() -> JSPromise { - jsObject[Strings.createAnchor]!().fromJSValue()! + let this = jsObject + return this[Strings.createAnchor].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func createAnchor() async throws -> XRAnchor { - let _promise: JSPromise = jsObject[Strings.createAnchor]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.createAnchor].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } public func getPose(baseSpace: XRSpace) -> XRPose? { - jsObject[Strings.getPose]!(baseSpace.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getPose].function!(this: this, arguments: [baseSpace.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRHitTestSource.swift b/Sources/DOMKit/WebIDL/XRHitTestSource.swift index 63595ed0..f23be4fc 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestSource.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestSource.swift @@ -13,6 +13,7 @@ public class XRHitTestSource: JSBridgedClass { } public func cancel() { - _ = jsObject[Strings.cancel]!() + let this = jsObject + _ = this[Strings.cancel].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/XRMediaBinding.swift b/Sources/DOMKit/WebIDL/XRMediaBinding.swift index b5409e2e..53a81cec 100644 --- a/Sources/DOMKit/WebIDL/XRMediaBinding.swift +++ b/Sources/DOMKit/WebIDL/XRMediaBinding.swift @@ -17,14 +17,17 @@ public class XRMediaBinding: JSBridgedClass { } public func createQuadLayer(video: HTMLVideoElement, init: XRMediaQuadLayerInit? = nil) -> XRQuadLayer { - jsObject[Strings.createQuadLayer]!(video.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createQuadLayer].function!(this: this, arguments: [video.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } public func createCylinderLayer(video: HTMLVideoElement, init: XRMediaCylinderLayerInit? = nil) -> XRCylinderLayer { - jsObject[Strings.createCylinderLayer]!(video.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createCylinderLayer].function!(this: this, arguments: [video.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } public func createEquirectLayer(video: HTMLVideoElement, init: XRMediaEquirectLayerInit? = nil) -> XREquirectLayer { - jsObject[Strings.createEquirectLayer]!(video.jsValue(), `init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createEquirectLayer].function!(this: this, arguments: [video.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift index 6ca4eb69..8daebf25 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift @@ -12,7 +12,8 @@ public class XRReferenceSpace: XRSpace { } public func getOffsetReferenceSpace(originOffset: XRRigidTransform) -> Self { - jsObject[Strings.getOffsetReferenceSpace]!(originOffset.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getOffsetReferenceSpace].function!(this: this, arguments: [originOffset.jsValue()]).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/XRSession.swift b/Sources/DOMKit/WebIDL/XRSession.swift index c84ff387..6284b447 100644 --- a/Sources/DOMKit/WebIDL/XRSession.swift +++ b/Sources/DOMKit/WebIDL/XRSession.swift @@ -47,32 +47,38 @@ public class XRSession: EventTarget { public var domOverlayState: XRDOMOverlayState? public func requestHitTestSource(options: XRHitTestOptionsInit) -> JSPromise { - jsObject[Strings.requestHitTestSource]!(options.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestHitTestSource(options: XRHitTestOptionsInit) async throws -> XRHitTestSource { - let _promise: JSPromise = jsObject[Strings.requestHitTestSource]!(options.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) -> JSPromise { - jsObject[Strings.requestHitTestSourceForTransientInput]!(options.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) async throws -> XRTransientInputHitTestSource { - let _promise: JSPromise = jsObject[Strings.requestHitTestSourceForTransientInput]!(options.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func requestLightProbe(options: XRLightProbeInit? = nil) -> JSPromise { - jsObject[Strings.requestLightProbe]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestLightProbe(options: XRLightProbeInit? = nil) async throws -> XRLightProbe { - let _promise: JSPromise = jsObject[Strings.requestLightProbe]!(options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } @@ -95,42 +101,50 @@ public class XRSession: EventTarget { public var inputSources: XRInputSourceArray public func updateRenderState(state: XRRenderStateInit? = nil) { - _ = jsObject[Strings.updateRenderState]!(state?.jsValue() ?? .undefined) + let this = jsObject + _ = this[Strings.updateRenderState].function!(this: this, arguments: [state?.jsValue() ?? .undefined]) } public func updateTargetFrameRate(rate: Float) -> JSPromise { - jsObject[Strings.updateTargetFrameRate]!(rate.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func updateTargetFrameRate(rate: Float) async throws { - let _promise: JSPromise = jsObject[Strings.updateTargetFrameRate]!(rate.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue()]).fromJSValue()! _ = try await _promise.get() } public func requestReferenceSpace(type: XRReferenceSpaceType) -> JSPromise { - jsObject[Strings.requestReferenceSpace]!(type.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestReferenceSpace(type: XRReferenceSpaceType) async throws -> XRReferenceSpace { - let _promise: JSPromise = jsObject[Strings.requestReferenceSpace]!(type.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } // XXX: member 'requestAnimationFrame' is ignored public func cancelAnimationFrame(handle: UInt32) { - _ = jsObject[Strings.cancelAnimationFrame]!(handle.jsValue()) + let this = jsObject + _ = this[Strings.cancelAnimationFrame].function!(this: this, arguments: [handle.jsValue()]) } public func end() -> JSPromise { - jsObject[Strings.end]!().fromJSValue()! + let this = jsObject + return this[Strings.end].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func end() async throws { - let _promise: JSPromise = jsObject[Strings.end]!().fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.end].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } diff --git a/Sources/DOMKit/WebIDL/XRSystem.swift b/Sources/DOMKit/WebIDL/XRSystem.swift index 1d5f708a..e110a913 100644 --- a/Sources/DOMKit/WebIDL/XRSystem.swift +++ b/Sources/DOMKit/WebIDL/XRSystem.swift @@ -12,22 +12,26 @@ public class XRSystem: EventTarget { } public func isSessionSupported(mode: XRSessionMode) -> JSPromise { - jsObject[Strings.isSessionSupported]!(mode.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func isSessionSupported(mode: XRSessionMode) async throws -> Bool { - let _promise: JSPromise = jsObject[Strings.isSessionSupported]!(mode.jsValue()).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) -> JSPromise { - jsObject[Strings.requestSession]!(mode.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) async throws -> XRSession { - let _promise: JSPromise = jsObject[Strings.requestSession]!(mode.jsValue(), options?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + let _promise: JSPromise = this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift index 09feb644..61231dc9 100644 --- a/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift +++ b/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift @@ -13,6 +13,7 @@ public class XRTransientInputHitTestSource: JSBridgedClass { } public func cancel() { - _ = jsObject[Strings.cancel]!() + let this = jsObject + _ = this[Strings.cancel].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/XRView.swift b/Sources/DOMKit/WebIDL/XRView.swift index 6a74bb31..9d800a42 100644 --- a/Sources/DOMKit/WebIDL/XRView.swift +++ b/Sources/DOMKit/WebIDL/XRView.swift @@ -33,6 +33,7 @@ public class XRView: JSBridgedClass { public var recommendedViewportScale: Double? public func requestViewportScale(scale: Double?) { - _ = jsObject[Strings.requestViewportScale]!(scale.jsValue()) + let this = jsObject + _ = this[Strings.requestViewportScale].function!(this: this, arguments: [scale.jsValue()]) } } diff --git a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift index 4de48ec2..1651dc53 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift @@ -15,11 +15,13 @@ public class XRWebGLBinding: JSBridgedClass { } public func getDepthInformation(view: XRView) -> XRWebGLDepthInformation? { - jsObject[Strings.getDepthInformation]!(view.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! } public func getReflectionCubeMap(lightProbe: XRLightProbe) -> WebGLTexture? { - jsObject[Strings.getReflectionCubeMap]!(lightProbe.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getReflectionCubeMap].function!(this: this, arguments: [lightProbe.jsValue()]).fromJSValue()! } public convenience init(session: XRSession, context: XRWebGLRenderingContext) { @@ -33,30 +35,37 @@ public class XRWebGLBinding: JSBridgedClass { public var usesDepthValues: Bool public func createProjectionLayer(init: XRProjectionLayerInit? = nil) -> XRProjectionLayer { - jsObject[Strings.createProjectionLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createProjectionLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } public func createQuadLayer(init: XRQuadLayerInit? = nil) -> XRQuadLayer { - jsObject[Strings.createQuadLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createQuadLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } public func createCylinderLayer(init: XRCylinderLayerInit? = nil) -> XRCylinderLayer { - jsObject[Strings.createCylinderLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createCylinderLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } public func createEquirectLayer(init: XREquirectLayerInit? = nil) -> XREquirectLayer { - jsObject[Strings.createEquirectLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createEquirectLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } public func createCubeLayer(init: XRCubeLayerInit? = nil) -> XRCubeLayer { - jsObject[Strings.createCubeLayer]!(`init`?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.createCubeLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } public func getSubImage(layer: XRCompositionLayer, frame: XRFrame, eye: XREye? = nil) -> XRWebGLSubImage { - jsObject[Strings.getSubImage]!(layer.jsValue(), frame.jsValue(), eye?.jsValue() ?? .undefined).fromJSValue()! + let this = jsObject + return this[Strings.getSubImage].function!(this: this, arguments: [layer.jsValue(), frame.jsValue(), eye?.jsValue() ?? .undefined]).fromJSValue()! } public func getViewSubImage(layer: XRProjectionLayer, view: XRView) -> XRWebGLSubImage { - jsObject[Strings.getViewSubImage]!(layer.jsValue(), view.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getViewSubImage].function!(this: this, arguments: [layer.jsValue(), view.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift index 97ca0a02..372e542a 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift @@ -39,10 +39,12 @@ public class XRWebGLLayer: XRLayer { public var framebufferHeight: UInt32 public func getViewport(view: XRView) -> XRViewport? { - jsObject[Strings.getViewport]!(view.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getViewport].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! } public static func getNativeFramebufferScaleFactor(session: XRSession) -> Double { - constructor[Strings.getNativeFramebufferScaleFactor]!(session.jsValue()).fromJSValue()! + let this = constructor + return this[Strings.getNativeFramebufferScaleFactor].function!(this: this, arguments: [session.jsValue()]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift index dc3a85ac..80f4fdb4 100644 --- a/Sources/DOMKit/WebIDL/XSLTProcessor.swift +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -17,34 +17,42 @@ public class XSLTProcessor: JSBridgedClass { } public func importStylesheet(style: Node) { - _ = jsObject[Strings.importStylesheet]!(style.jsValue()) + let this = jsObject + _ = this[Strings.importStylesheet].function!(this: this, arguments: [style.jsValue()]) } public func transformToFragment(source: Node, output: Document) -> DocumentFragment { - jsObject[Strings.transformToFragment]!(source.jsValue(), output.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.transformToFragment].function!(this: this, arguments: [source.jsValue(), output.jsValue()]).fromJSValue()! } public func transformToDocument(source: Node) -> Document { - jsObject[Strings.transformToDocument]!(source.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.transformToDocument].function!(this: this, arguments: [source.jsValue()]).fromJSValue()! } public func setParameter(namespaceURI: String, localName: String, value: JSValue) { - _ = jsObject[Strings.setParameter]!(namespaceURI.jsValue(), localName.jsValue(), value.jsValue()) + let this = jsObject + _ = this[Strings.setParameter].function!(this: this, arguments: [namespaceURI.jsValue(), localName.jsValue(), value.jsValue()]) } public func getParameter(namespaceURI: String, localName: String) -> JSValue { - jsObject[Strings.getParameter]!(namespaceURI.jsValue(), localName.jsValue()).fromJSValue()! + let this = jsObject + return this[Strings.getParameter].function!(this: this, arguments: [namespaceURI.jsValue(), localName.jsValue()]).fromJSValue()! } public func removeParameter(namespaceURI: String, localName: String) { - _ = jsObject[Strings.removeParameter]!(namespaceURI.jsValue(), localName.jsValue()) + let this = jsObject + _ = this[Strings.removeParameter].function!(this: this, arguments: [namespaceURI.jsValue(), localName.jsValue()]) } public func clearParameters() { - _ = jsObject[Strings.clearParameters]!() + let this = jsObject + _ = this[Strings.clearParameters].function!(this: this, arguments: []) } public func reset() { - _ = jsObject[Strings.reset]!() + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) } } diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index e4645dc2..7039ac0c 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -9,78 +9,97 @@ public enum console { } public static func assert(condition: Bool? = nil, data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.assert]!(condition?.jsValue() ?? .undefined, data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.assert].function!(this: this, arguments: [condition?.jsValue() ?? .undefined] + data.map { $0.jsValue() }) } public static func clear() { - _ = JSObject.global[Strings.console].object![Strings.clear]!() + let this = JSObject.global[Strings.console].object! + _ = this[Strings.clear].function!(this: this, arguments: []) } public static func debug(data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.debug]!(data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.debug].function!(this: this, arguments: data.map { $0.jsValue() }) } public static func error(data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.error]!(data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.error].function!(this: this, arguments: data.map { $0.jsValue() }) } public static func info(data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.info]!(data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.info].function!(this: this, arguments: data.map { $0.jsValue() }) } public static func log(data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.log]!(data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.log].function!(this: this, arguments: data.map { $0.jsValue() }) } public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { - _ = JSObject.global[Strings.console].object![Strings.table]!(tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.table].function!(this: this, arguments: [tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined]) } public static func trace(data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.trace]!(data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.trace].function!(this: this, arguments: data.map { $0.jsValue() }) } public static func warn(data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.warn]!(data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.warn].function!(this: this, arguments: data.map { $0.jsValue() }) } public static func dir(item: JSValue? = nil, options: JSObject? = nil) { - _ = JSObject.global[Strings.console].object![Strings.dir]!(item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.dir].function!(this: this, arguments: [item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]) } public static func dirxml(data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.dirxml]!(data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.dirxml].function!(this: this, arguments: data.map { $0.jsValue() }) } public static func count(label: String? = nil) { - _ = JSObject.global[Strings.console].object![Strings.count]!(label?.jsValue() ?? .undefined) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.count].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) } public static func countReset(label: String? = nil) { - _ = JSObject.global[Strings.console].object![Strings.countReset]!(label?.jsValue() ?? .undefined) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.countReset].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) } public static func group(data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.group]!(data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.group].function!(this: this, arguments: data.map { $0.jsValue() }) } public static func groupCollapsed(data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.groupCollapsed]!(data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.groupCollapsed].function!(this: this, arguments: data.map { $0.jsValue() }) } public static func groupEnd() { - _ = JSObject.global[Strings.console].object![Strings.groupEnd]!() + let this = JSObject.global[Strings.console].object! + _ = this[Strings.groupEnd].function!(this: this, arguments: []) } public static func time(label: String? = nil) { - _ = JSObject.global[Strings.console].object![Strings.time]!(label?.jsValue() ?? .undefined) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.time].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) } public static func timeLog(label: String? = nil, data: JSValue...) { - _ = JSObject.global[Strings.console].object![Strings.timeLog]!(label?.jsValue() ?? .undefined, data.jsValue()) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.timeLog].function!(this: this, arguments: [label?.jsValue() ?? .undefined] + data.map { $0.jsValue() }) } public static func timeEnd(label: String? = nil) { - _ = JSObject.global[Strings.console].object![Strings.timeEnd]!(label?.jsValue() ?? .undefined) + let this = JSObject.global[Strings.console].object! + _ = this[Strings.timeEnd].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 4616d16b..efe3f036 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -365,6 +365,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { fileprivate var defaultBody: (prep: SwiftSource, call: SwiftSource) { let args: [SwiftSource] let prep: [SwiftSource] + assert(arguments.dropLast().allSatisfy { !$0.variadic }) if arguments.count <= 5 { args = arguments.map { arg in if arg.optional { @@ -385,9 +386,26 @@ extension IDLOperation: SwiftRepresentable, Initializable { } } + let argsArray: SwiftSource + if let last = arguments.last, last.variadic { + // TODO: handle optional variadics (if necessary?) + let variadic: SwiftSource = "\(last.name).map { $0.jsValue() }" + if args.count > 1 { + argsArray = "[\(sequence: args.dropLast())] + \(variadic)" + } else { + argsArray = variadic + } + } else { + argsArray = "[\(sequence: args)]" + } + + let function: SwiftSource = "this[\(Context.source(for: name))].function!" return ( - prep: "\(lines: prep)", - call: "\(Context.this)[\(Context.source(for: name))]!(\(sequence: args))" + prep: """ + \(lines: prep) + let this = \(Context.this) + """, + call: "\(function)(this: this, arguments: \(argsArray))" ) } From 72463cfc9a357b9773d9d79e06c7b0b10a1ceaff Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 11:40:42 -0400 Subject: [PATCH 098/124] Also handle variadic constructors --- Sources/DOMKit/WebIDL/AbortController.swift | 2 +- .../WebIDL/AbsoluteOrientationSensor.swift | 2 +- Sources/DOMKit/WebIDL/Accelerometer.swift | 2 +- .../DOMKit/WebIDL/AmbientLightSensor.swift | 2 +- Sources/DOMKit/WebIDL/AnalyserNode.swift | 2 +- Sources/DOMKit/WebIDL/Animation.swift | 2 +- Sources/DOMKit/WebIDL/AnimationEvent.swift | 2 +- .../WebIDL/AnimationPlaybackEvent.swift | 2 +- Sources/DOMKit/WebIDL/AudioBuffer.swift | 2 +- .../DOMKit/WebIDL/AudioBufferSourceNode.swift | 2 +- Sources/DOMKit/WebIDL/AudioContext.swift | 2 +- Sources/DOMKit/WebIDL/AudioData.swift | 2 +- Sources/DOMKit/WebIDL/AudioDecoder.swift | 2 +- Sources/DOMKit/WebIDL/AudioEncoder.swift | 2 +- .../DOMKit/WebIDL/AudioProcessingEvent.swift | 2 +- Sources/DOMKit/WebIDL/AudioWorkletNode.swift | 2 +- .../DOMKit/WebIDL/AudioWorkletProcessor.swift | 2 +- .../DOMKit/WebIDL/BackgroundFetchEvent.swift | 2 +- .../WebIDL/BackgroundFetchUpdateUIEvent.swift | 2 +- Sources/DOMKit/WebIDL/BarcodeDetector.swift | 2 +- .../WebIDL/BeforeInstallPromptEvent.swift | 2 +- Sources/DOMKit/WebIDL/BiquadFilterNode.swift | 2 +- Sources/DOMKit/WebIDL/Blob.swift | 2 +- Sources/DOMKit/WebIDL/BlobEvent.swift | 2 +- .../WebIDL/BluetoothAdvertisingEvent.swift | 2 +- Sources/DOMKit/WebIDL/BroadcastChannel.swift | 2 +- .../WebIDL/ByteLengthQueuingStrategy.swift | 2 +- Sources/DOMKit/WebIDL/CSSColor.swift | 2 +- Sources/DOMKit/WebIDL/CSSHSL.swift | 2 +- Sources/DOMKit/WebIDL/CSSHWB.swift | 2 +- Sources/DOMKit/WebIDL/CSSKeywordValue.swift | 2 +- Sources/DOMKit/WebIDL/CSSLCH.swift | 2 +- Sources/DOMKit/WebIDL/CSSLab.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathClamp.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathInvert.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathMax.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathMin.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathNegate.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathProduct.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathSum.swift | 2 +- .../DOMKit/WebIDL/CSSMatrixComponent.swift | 2 +- Sources/DOMKit/WebIDL/CSSOKLCH.swift | 2 +- Sources/DOMKit/WebIDL/CSSOKLab.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserAtRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserBlock.swift | 2 +- .../DOMKit/WebIDL/CSSParserDeclaration.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserFunction.swift | 2 +- .../WebIDL/CSSParserQualifiedRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSPerspective.swift | 2 +- Sources/DOMKit/WebIDL/CSSRGB.swift | 2 +- Sources/DOMKit/WebIDL/CSSRotate.swift | 4 ++-- Sources/DOMKit/WebIDL/CSSScale.swift | 2 +- Sources/DOMKit/WebIDL/CSSSkew.swift | 2 +- Sources/DOMKit/WebIDL/CSSSkewX.swift | 2 +- Sources/DOMKit/WebIDL/CSSSkewY.swift | 2 +- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 2 +- Sources/DOMKit/WebIDL/CSSTransformValue.swift | 2 +- Sources/DOMKit/WebIDL/CSSTranslate.swift | 2 +- Sources/DOMKit/WebIDL/CSSUnitValue.swift | 2 +- Sources/DOMKit/WebIDL/CSSUnparsedValue.swift | 2 +- .../WebIDL/CSSVariableReferenceValue.swift | 2 +- .../DOMKit/WebIDL/CanMakePaymentEvent.swift | 2 +- Sources/DOMKit/WebIDL/CanvasFilter.swift | 2 +- Sources/DOMKit/WebIDL/ChannelMergerNode.swift | 2 +- .../DOMKit/WebIDL/ChannelSplitterNode.swift | 2 +- .../WebIDL/CharacterBoundsUpdateEvent.swift | 2 +- Sources/DOMKit/WebIDL/ClipboardEvent.swift | 2 +- Sources/DOMKit/WebIDL/ClipboardItem.swift | 2 +- Sources/DOMKit/WebIDL/CloseEvent.swift | 2 +- Sources/DOMKit/WebIDL/CloseWatcher.swift | 2 +- Sources/DOMKit/WebIDL/Comment.swift | 2 +- Sources/DOMKit/WebIDL/CompositionEvent.swift | 2 +- Sources/DOMKit/WebIDL/CompressionStream.swift | 2 +- .../DOMKit/WebIDL/ConstantSourceNode.swift | 2 +- Sources/DOMKit/WebIDL/ContentIndexEvent.swift | 2 +- Sources/DOMKit/WebIDL/ConvolverNode.swift | 2 +- Sources/DOMKit/WebIDL/CookieChangeEvent.swift | 2 +- .../DOMKit/WebIDL/CountQueuingStrategy.swift | 2 +- Sources/DOMKit/WebIDL/CustomEvent.swift | 2 +- Sources/DOMKit/WebIDL/DOMException.swift | 2 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 2 +- Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 2 +- Sources/DOMKit/WebIDL/DOMParser.swift | 2 +- Sources/DOMKit/WebIDL/DOMPoint.swift | 2 +- Sources/DOMKit/WebIDL/DOMPointReadOnly.swift | 2 +- Sources/DOMKit/WebIDL/DOMQuad.swift | 2 +- Sources/DOMKit/WebIDL/DOMRect.swift | 2 +- Sources/DOMKit/WebIDL/DOMRectReadOnly.swift | 2 +- Sources/DOMKit/WebIDL/DataCue.swift | 2 +- Sources/DOMKit/WebIDL/DataTransfer.swift | 2 +- .../DOMKit/WebIDL/DecompressionStream.swift | 2 +- Sources/DOMKit/WebIDL/DelayNode.swift | 2 +- Sources/DOMKit/WebIDL/DeviceMotionEvent.swift | 2 +- .../WebIDL/DeviceOrientationEvent.swift | 2 +- Sources/DOMKit/WebIDL/Document.swift | 2 +- Sources/DOMKit/WebIDL/DocumentFragment.swift | 2 +- Sources/DOMKit/WebIDL/DocumentTimeline.swift | 2 +- Sources/DOMKit/WebIDL/DragEvent.swift | 2 +- .../WebIDL/DynamicsCompressorNode.swift | 2 +- Sources/DOMKit/WebIDL/EditContext.swift | 2 +- Sources/DOMKit/WebIDL/EncodedAudioChunk.swift | 2 +- Sources/DOMKit/WebIDL/EncodedVideoChunk.swift | 2 +- Sources/DOMKit/WebIDL/ErrorEvent.swift | 2 +- Sources/DOMKit/WebIDL/Event.swift | 2 +- Sources/DOMKit/WebIDL/EventSource.swift | 2 +- Sources/DOMKit/WebIDL/EventTarget.swift | 2 +- .../WebIDL/ExtendableCookieChangeEvent.swift | 2 +- Sources/DOMKit/WebIDL/ExtendableEvent.swift | 2 +- .../WebIDL/ExtendableMessageEvent.swift | 2 +- Sources/DOMKit/WebIDL/EyeDropper.swift | 2 +- Sources/DOMKit/WebIDL/FaceDetector.swift | 2 +- .../DOMKit/WebIDL/FederatedCredential.swift | 2 +- Sources/DOMKit/WebIDL/FetchEvent.swift | 2 +- Sources/DOMKit/WebIDL/File.swift | 2 +- Sources/DOMKit/WebIDL/FileReader.swift | 2 +- Sources/DOMKit/WebIDL/FileReaderSync.swift | 2 +- Sources/DOMKit/WebIDL/FocusEvent.swift | 2 +- Sources/DOMKit/WebIDL/FontFace.swift | 2 +- Sources/DOMKit/WebIDL/FontFaceSet.swift | 2 +- .../DOMKit/WebIDL/FontFaceSetLoadEvent.swift | 2 +- Sources/DOMKit/WebIDL/FormData.swift | 2 +- Sources/DOMKit/WebIDL/FormDataEvent.swift | 2 +- Sources/DOMKit/WebIDL/FragmentResult.swift | 2 +- .../DOMKit/WebIDL/GPUOutOfMemoryError.swift | 2 +- .../WebIDL/GPUUncapturedErrorEvent.swift | 2 +- .../DOMKit/WebIDL/GPUValidationError.swift | 2 +- Sources/DOMKit/WebIDL/GainNode.swift | 2 +- Sources/DOMKit/WebIDL/GamepadEvent.swift | 2 +- Sources/DOMKit/WebIDL/GeolocationSensor.swift | 2 +- Sources/DOMKit/WebIDL/Global.swift | 2 +- Sources/DOMKit/WebIDL/GravitySensor.swift | 2 +- Sources/DOMKit/WebIDL/GroupEffect.swift | 2 +- Sources/DOMKit/WebIDL/Gyroscope.swift | 2 +- .../DOMKit/WebIDL/HIDConnectionEvent.swift | 2 +- .../DOMKit/WebIDL/HIDInputReportEvent.swift | 2 +- Sources/DOMKit/WebIDL/HTMLAnchorElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLAreaElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLAudioElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLBRElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLBaseElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLBodyElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLDListElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLDataElement.swift | 2 +- .../DOMKit/WebIDL/HTMLDataListElement.swift | 2 +- .../DOMKit/WebIDL/HTMLDetailsElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 2 +- .../DOMKit/WebIDL/HTMLDirectoryElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLDivElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLEmbedElement.swift | 2 +- .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFontElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFormElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFrameElement.swift | 2 +- .../DOMKit/WebIDL/HTMLFrameSetElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLHRElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLHeadElement.swift | 2 +- .../DOMKit/WebIDL/HTMLHeadingElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLHtmlElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLImageElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLLIElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLLabelElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLLegendElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLLinkElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLMapElement.swift | 2 +- .../DOMKit/WebIDL/HTMLMarqueeElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLMenuElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLMetaElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLMeterElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLModElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLOListElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 2 +- .../DOMKit/WebIDL/HTMLOptGroupElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLOptionElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 2 +- .../DOMKit/WebIDL/HTMLParagraphElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLParamElement.swift | 2 +- .../DOMKit/WebIDL/HTMLPictureElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLPortalElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLPreElement.swift | 2 +- .../DOMKit/WebIDL/HTMLProgressElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLQuoteElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSourceElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSpanElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLStyleElement.swift | 2 +- .../WebIDL/HTMLTableCaptionElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTableCellElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTableColElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLTableElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTableRowElement.swift | 2 +- .../WebIDL/HTMLTableSectionElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTemplateElement.swift | 2 +- .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLTimeElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLTitleElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLTrackElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLUListElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 2 +- Sources/DOMKit/WebIDL/HashChangeEvent.swift | 2 +- Sources/DOMKit/WebIDL/Headers.swift | 2 +- Sources/DOMKit/WebIDL/Highlight.swift | 2 +- .../DOMKit/WebIDL/IDBVersionChangeEvent.swift | 2 +- Sources/DOMKit/WebIDL/IIRFilterNode.swift | 2 +- Sources/DOMKit/WebIDL/IdleDetector.swift | 2 +- Sources/DOMKit/WebIDL/ImageCapture.swift | 2 +- Sources/DOMKit/WebIDL/ImageData.swift | 4 ++-- Sources/DOMKit/WebIDL/ImageDecoder.swift | 2 +- .../WebIDL/InputDeviceCapabilities.swift | 2 +- Sources/DOMKit/WebIDL/InputEvent.swift | 2 +- Sources/DOMKit/WebIDL/Instance.swift | 2 +- .../WebIDL/IntersectionObserverEntry.swift | 2 +- Sources/DOMKit/WebIDL/KeyboardEvent.swift | 2 +- Sources/DOMKit/WebIDL/KeyframeEffect.swift | 4 ++-- .../WebIDL/LinearAccelerationSensor.swift | 2 +- .../DOMKit/WebIDL/MIDIConnectionEvent.swift | 2 +- Sources/DOMKit/WebIDL/MIDIMessageEvent.swift | 2 +- Sources/DOMKit/WebIDL/MLGraphBuilder.swift | 2 +- Sources/DOMKit/WebIDL/Magnetometer.swift | 2 +- .../WebIDL/MediaElementAudioSourceNode.swift | 2 +- .../DOMKit/WebIDL/MediaEncryptedEvent.swift | 2 +- .../DOMKit/WebIDL/MediaKeyMessageEvent.swift | 2 +- Sources/DOMKit/WebIDL/MediaMetadata.swift | 2 +- .../DOMKit/WebIDL/MediaQueryListEvent.swift | 2 +- Sources/DOMKit/WebIDL/MediaRecorder.swift | 2 +- .../WebIDL/MediaRecorderErrorEvent.swift | 2 +- Sources/DOMKit/WebIDL/MediaSource.swift | 2 +- Sources/DOMKit/WebIDL/MediaStream.swift | 6 +++--- .../MediaStreamAudioDestinationNode.swift | 2 +- .../WebIDL/MediaStreamAudioSourceNode.swift | 2 +- .../MediaStreamTrackAudioSourceNode.swift | 2 +- .../DOMKit/WebIDL/MediaStreamTrackEvent.swift | 2 +- .../WebIDL/MediaStreamTrackProcessor.swift | 2 +- Sources/DOMKit/WebIDL/Memory.swift | 2 +- Sources/DOMKit/WebIDL/MessageChannel.swift | 2 +- Sources/DOMKit/WebIDL/MessageEvent.swift | 2 +- Sources/DOMKit/WebIDL/Module.swift | 2 +- Sources/DOMKit/WebIDL/MouseEvent.swift | 2 +- Sources/DOMKit/WebIDL/NDEFMessage.swift | 2 +- Sources/DOMKit/WebIDL/NDEFReader.swift | 2 +- Sources/DOMKit/WebIDL/NDEFReadingEvent.swift | 2 +- Sources/DOMKit/WebIDL/NDEFRecord.swift | 2 +- Sources/DOMKit/WebIDL/NavigateEvent.swift | 2 +- .../NavigationCurrentEntryChangeEvent.swift | 2 +- Sources/DOMKit/WebIDL/NavigationEvent.swift | 2 +- Sources/DOMKit/WebIDL/Notification.swift | 2 +- Sources/DOMKit/WebIDL/NotificationEvent.swift | 2 +- .../WebIDL/OfflineAudioCompletionEvent.swift | 2 +- .../DOMKit/WebIDL/OfflineAudioContext.swift | 4 ++-- Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 2 +- Sources/DOMKit/WebIDL/OscillatorNode.swift | 2 +- .../DOMKit/WebIDL/OverconstrainedError.swift | 2 +- .../DOMKit/WebIDL/PageTransitionEvent.swift | 2 +- Sources/DOMKit/WebIDL/PannerNode.swift | 2 +- .../DOMKit/WebIDL/PasswordCredential.swift | 4 ++-- Sources/DOMKit/WebIDL/Path2D.swift | 2 +- .../WebIDL/PaymentMethodChangeEvent.swift | 2 +- Sources/DOMKit/WebIDL/PaymentRequest.swift | 2 +- .../DOMKit/WebIDL/PaymentRequestEvent.swift | 2 +- .../WebIDL/PaymentRequestUpdateEvent.swift | 2 +- Sources/DOMKit/WebIDL/PerformanceMark.swift | 2 +- Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift | 2 +- Sources/DOMKit/WebIDL/PeriodicWave.swift | 2 +- .../DOMKit/WebIDL/PictureInPictureEvent.swift | 2 +- Sources/DOMKit/WebIDL/PointerEvent.swift | 2 +- Sources/DOMKit/WebIDL/PopStateEvent.swift | 2 +- .../DOMKit/WebIDL/PortalActivateEvent.swift | 2 +- ...PresentationConnectionAvailableEvent.swift | 2 +- .../PresentationConnectionCloseEvent.swift | 2 +- .../DOMKit/WebIDL/PresentationRequest.swift | 4 ++-- Sources/DOMKit/WebIDL/Profiler.swift | 2 +- Sources/DOMKit/WebIDL/ProgressEvent.swift | 2 +- .../DOMKit/WebIDL/PromiseRejectionEvent.swift | 2 +- Sources/DOMKit/WebIDL/ProximitySensor.swift | 2 +- Sources/DOMKit/WebIDL/PushEvent.swift | 2 +- .../WebIDL/PushSubscriptionChangeEvent.swift | 2 +- .../WebIDL/RTCDTMFToneChangeEvent.swift | 2 +- .../DOMKit/WebIDL/RTCDataChannelEvent.swift | 2 +- Sources/DOMKit/WebIDL/RTCError.swift | 2 +- Sources/DOMKit/WebIDL/RTCErrorEvent.swift | 2 +- Sources/DOMKit/WebIDL/RTCIceCandidate.swift | 2 +- Sources/DOMKit/WebIDL/RTCIceTransport.swift | 2 +- .../DOMKit/WebIDL/RTCIdentityAssertion.swift | 2 +- Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 2 +- .../RTCPeerConnectionIceErrorEvent.swift | 2 +- .../WebIDL/RTCPeerConnectionIceEvent.swift | 2 +- .../DOMKit/WebIDL/RTCRtpScriptTransform.swift | 2 +- .../DOMKit/WebIDL/RTCSessionDescription.swift | 2 +- Sources/DOMKit/WebIDL/RTCTrackEvent.swift | 2 +- Sources/DOMKit/WebIDL/Range.swift | 2 +- Sources/DOMKit/WebIDL/ReadableStream.swift | 2 +- .../WebIDL/ReadableStreamBYOBReader.swift | 2 +- .../WebIDL/ReadableStreamDefaultReader.swift | 2 +- .../WebIDL/RelativeOrientationSensor.swift | 2 +- Sources/DOMKit/WebIDL/Request.swift | 2 +- Sources/DOMKit/WebIDL/Response.swift | 2 +- Sources/DOMKit/WebIDL/SFrameTransform.swift | 2 +- .../WebIDL/SFrameTransformErrorEvent.swift | 2 +- Sources/DOMKit/WebIDL/Sanitizer.swift | 2 +- Sources/DOMKit/WebIDL/ScrollTimeline.swift | 2 +- .../WebIDL/SecurityPolicyViolationEvent.swift | 2 +- Sources/DOMKit/WebIDL/SensorErrorEvent.swift | 2 +- Sources/DOMKit/WebIDL/SequenceEffect.swift | 2 +- Sources/DOMKit/WebIDL/ShadowAnimation.swift | 2 +- Sources/DOMKit/WebIDL/SharedWorker.swift | 2 +- Sources/DOMKit/WebIDL/SpeechGrammarList.swift | 2 +- Sources/DOMKit/WebIDL/SpeechRecognition.swift | 2 +- .../WebIDL/SpeechRecognitionErrorEvent.swift | 2 +- .../WebIDL/SpeechRecognitionEvent.swift | 2 +- .../WebIDL/SpeechSynthesisErrorEvent.swift | 2 +- .../DOMKit/WebIDL/SpeechSynthesisEvent.swift | 2 +- .../WebIDL/SpeechSynthesisUtterance.swift | 2 +- Sources/DOMKit/WebIDL/StaticRange.swift | 2 +- Sources/DOMKit/WebIDL/StereoPannerNode.swift | 2 +- Sources/DOMKit/WebIDL/StorageEvent.swift | 2 +- Sources/DOMKit/WebIDL/SubmitEvent.swift | 2 +- Sources/DOMKit/WebIDL/SyncEvent.swift | 2 +- Sources/DOMKit/WebIDL/Table.swift | 2 +- Sources/DOMKit/WebIDL/TaskController.swift | 2 +- .../WebIDL/TaskPriorityChangeEvent.swift | 2 +- Sources/DOMKit/WebIDL/Text.swift | 2 +- Sources/DOMKit/WebIDL/TextDecoder.swift | 2 +- Sources/DOMKit/WebIDL/TextDecoderStream.swift | 2 +- Sources/DOMKit/WebIDL/TextDetector.swift | 2 +- Sources/DOMKit/WebIDL/TextEncoder.swift | 2 +- Sources/DOMKit/WebIDL/TextEncoderStream.swift | 2 +- Sources/DOMKit/WebIDL/TextFormat.swift | 2 +- .../DOMKit/WebIDL/TextFormatUpdateEvent.swift | 2 +- Sources/DOMKit/WebIDL/TextUpdateEvent.swift | 2 +- Sources/DOMKit/WebIDL/Touch.swift | 2 +- Sources/DOMKit/WebIDL/TouchEvent.swift | 2 +- Sources/DOMKit/WebIDL/TrackEvent.swift | 2 +- Sources/DOMKit/WebIDL/TransformStream.swift | 2 +- Sources/DOMKit/WebIDL/TransitionEvent.swift | 2 +- Sources/DOMKit/WebIDL/UIEvent.swift | 2 +- Sources/DOMKit/WebIDL/URL.swift | 2 +- Sources/DOMKit/WebIDL/URLPattern.swift | 2 +- Sources/DOMKit/WebIDL/URLSearchParams.swift | 2 +- .../DOMKit/WebIDL/USBAlternateInterface.swift | 2 +- Sources/DOMKit/WebIDL/USBConfiguration.swift | 2 +- .../DOMKit/WebIDL/USBConnectionEvent.swift | 2 +- Sources/DOMKit/WebIDL/USBEndpoint.swift | 2 +- .../DOMKit/WebIDL/USBInTransferResult.swift | 2 +- Sources/DOMKit/WebIDL/USBInterface.swift | 2 +- .../USBIsochronousInTransferPacket.swift | 2 +- .../USBIsochronousInTransferResult.swift | 2 +- .../USBIsochronousOutTransferPacket.swift | 2 +- .../USBIsochronousOutTransferResult.swift | 2 +- .../DOMKit/WebIDL/USBOutTransferResult.swift | 2 +- .../WebIDL/UncalibratedMagnetometer.swift | 2 +- Sources/DOMKit/WebIDL/VTTCue.swift | 2 +- Sources/DOMKit/WebIDL/VTTRegion.swift | 2 +- Sources/DOMKit/WebIDL/ValueEvent.swift | 2 +- Sources/DOMKit/WebIDL/VideoColorSpace.swift | 2 +- Sources/DOMKit/WebIDL/VideoDecoder.swift | 2 +- Sources/DOMKit/WebIDL/VideoEncoder.swift | 2 +- Sources/DOMKit/WebIDL/VideoFrame.swift | 4 ++-- .../DOMKit/WebIDL/VideoTrackGenerator.swift | 2 +- Sources/DOMKit/WebIDL/WaveShaperNode.swift | 2 +- Sources/DOMKit/WebIDL/WebGLContextEvent.swift | 2 +- Sources/DOMKit/WebIDL/WebSocket.swift | 2 +- Sources/DOMKit/WebIDL/WebTransport.swift | 2 +- Sources/DOMKit/WebIDL/WebTransportError.swift | 2 +- Sources/DOMKit/WebIDL/WheelEvent.swift | 2 +- ...owControlsOverlayGeometryChangeEvent.swift | 2 +- Sources/DOMKit/WebIDL/Worker.swift | 2 +- Sources/DOMKit/WebIDL/WorkletAnimation.swift | 2 +- Sources/DOMKit/WebIDL/WritableStream.swift | 2 +- .../WebIDL/WritableStreamDefaultWriter.swift | 2 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 2 +- Sources/DOMKit/WebIDL/XMLSerializer.swift | 2 +- Sources/DOMKit/WebIDL/XPathEvaluator.swift | 2 +- .../DOMKit/WebIDL/XRInputSourceEvent.swift | 2 +- .../WebIDL/XRInputSourcesChangeEvent.swift | 2 +- Sources/DOMKit/WebIDL/XRLayerEvent.swift | 2 +- Sources/DOMKit/WebIDL/XRMediaBinding.swift | 2 +- Sources/DOMKit/WebIDL/XRRay.swift | 4 ++-- .../DOMKit/WebIDL/XRReferenceSpaceEvent.swift | 2 +- Sources/DOMKit/WebIDL/XRRigidTransform.swift | 2 +- Sources/DOMKit/WebIDL/XRSessionEvent.swift | 2 +- Sources/DOMKit/WebIDL/XRWebGLBinding.swift | 2 +- Sources/DOMKit/WebIDL/XRWebGLLayer.swift | 2 +- Sources/DOMKit/WebIDL/XSLTProcessor.swift | 2 +- .../WebIDL+SwiftRepresentation.swift | 21 +++++++++++++++---- 390 files changed, 416 insertions(+), 403 deletions(-) diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index d756212b..02a32f44 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -14,7 +14,7 @@ public class AbortController: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift b/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift index aa0fd95a..0c1f2b5f 100644 --- a/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift +++ b/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift @@ -11,6 +11,6 @@ public class AbsoluteOrientationSensor: OrientationSensor { } public convenience init(sensorOptions: OrientationSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/Accelerometer.swift b/Sources/DOMKit/WebIDL/Accelerometer.swift index 279d9a56..12f0bea5 100644 --- a/Sources/DOMKit/WebIDL/Accelerometer.swift +++ b/Sources/DOMKit/WebIDL/Accelerometer.swift @@ -14,7 +14,7 @@ public class Accelerometer: Sensor { } public convenience init(options: AccelerometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AmbientLightSensor.swift b/Sources/DOMKit/WebIDL/AmbientLightSensor.swift index 09ded714..de4e6837 100644 --- a/Sources/DOMKit/WebIDL/AmbientLightSensor.swift +++ b/Sources/DOMKit/WebIDL/AmbientLightSensor.swift @@ -12,7 +12,7 @@ public class AmbientLightSensor: Sensor { } public convenience init(sensorOptions: SensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AnalyserNode.swift b/Sources/DOMKit/WebIDL/AnalyserNode.swift index ea98ad88..68e07212 100644 --- a/Sources/DOMKit/WebIDL/AnalyserNode.swift +++ b/Sources/DOMKit/WebIDL/AnalyserNode.swift @@ -16,7 +16,7 @@ public class AnalyserNode: AudioNode { } public convenience init(context: BaseAudioContext, options: AnalyserOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } public func getFloatFrequencyData(array: Float32Array) { diff --git a/Sources/DOMKit/WebIDL/Animation.swift b/Sources/DOMKit/WebIDL/Animation.swift index 6a310363..c60942e0 100644 --- a/Sources/DOMKit/WebIDL/Animation.swift +++ b/Sources/DOMKit/WebIDL/Animation.swift @@ -31,7 +31,7 @@ public class Animation: EventTarget { public var currentTime: CSSNumberish? public convenience init(effect: AnimationEffect? = nil, timeline: AnimationTimeline? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(effect?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [effect?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/AnimationEvent.swift b/Sources/DOMKit/WebIDL/AnimationEvent.swift index 1a625947..362ed071 100644 --- a/Sources/DOMKit/WebIDL/AnimationEvent.swift +++ b/Sources/DOMKit/WebIDL/AnimationEvent.swift @@ -14,7 +14,7 @@ public class AnimationEvent: Event { } public convenience init(type: String, animationEventInitDict: AnimationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), animationEventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), animationEventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift b/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift index 21ec8aa8..20467d31 100644 --- a/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift +++ b/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift @@ -13,7 +13,7 @@ public class AnimationPlaybackEvent: Event { } public convenience init(type: String, eventInitDict: AnimationPlaybackEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioBuffer.swift b/Sources/DOMKit/WebIDL/AudioBuffer.swift index 9a240249..05051415 100644 --- a/Sources/DOMKit/WebIDL/AudioBuffer.swift +++ b/Sources/DOMKit/WebIDL/AudioBuffer.swift @@ -17,7 +17,7 @@ public class AudioBuffer: JSBridgedClass { } public convenience init(options: AudioBufferOptions) { - self.init(unsafelyWrapping: Self.constructor.new(options.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift index f8e8e98a..9898ad17 100644 --- a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift +++ b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift @@ -17,7 +17,7 @@ public class AudioBufferSourceNode: AudioScheduledSourceNode { } public convenience init(context: BaseAudioContext, options: AudioBufferSourceOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/AudioContext.swift b/Sources/DOMKit/WebIDL/AudioContext.swift index 97e0dfa5..ce10cfe9 100644 --- a/Sources/DOMKit/WebIDL/AudioContext.swift +++ b/Sources/DOMKit/WebIDL/AudioContext.swift @@ -13,7 +13,7 @@ public class AudioContext: BaseAudioContext { } public convenience init(contextOptions: AudioContextOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(contextOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioData.swift b/Sources/DOMKit/WebIDL/AudioData.swift index bdc11a73..d0d71e88 100644 --- a/Sources/DOMKit/WebIDL/AudioData.swift +++ b/Sources/DOMKit/WebIDL/AudioData.swift @@ -19,7 +19,7 @@ public class AudioData: JSBridgedClass { } public convenience init(init: AudioDataInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioDecoder.swift b/Sources/DOMKit/WebIDL/AudioDecoder.swift index 1f6147ae..fa698c5d 100644 --- a/Sources/DOMKit/WebIDL/AudioDecoder.swift +++ b/Sources/DOMKit/WebIDL/AudioDecoder.swift @@ -15,7 +15,7 @@ public class AudioDecoder: JSBridgedClass { } public convenience init(init: AudioDecoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioEncoder.swift b/Sources/DOMKit/WebIDL/AudioEncoder.swift index ae42233c..e26e3bc3 100644 --- a/Sources/DOMKit/WebIDL/AudioEncoder.swift +++ b/Sources/DOMKit/WebIDL/AudioEncoder.swift @@ -15,7 +15,7 @@ public class AudioEncoder: JSBridgedClass { } public convenience init(init: AudioEncoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift b/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift index f8c04faa..c5e6fa58 100644 --- a/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift +++ b/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift @@ -14,7 +14,7 @@ public class AudioProcessingEvent: Event { } public convenience init(type: String, eventInitDict: AudioProcessingEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift index 32c38177..3cbdbfa1 100644 --- a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift +++ b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift @@ -14,7 +14,7 @@ public class AudioWorkletNode: AudioNode { } public convenience init(context: BaseAudioContext, name: String, options: AudioWorkletNodeOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), name.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), name.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift b/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift index a3391e67..31b5ec61 100644 --- a/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift +++ b/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift @@ -14,7 +14,7 @@ public class AudioWorkletProcessor: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift b/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift index 2522b01d..8d748b05 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift @@ -12,7 +12,7 @@ public class BackgroundFetchEvent: ExtendableEvent { } public convenience init(type: String, init: BackgroundFetchEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift b/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift index 5df1a1cb..09873098 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift @@ -11,7 +11,7 @@ public class BackgroundFetchUpdateUIEvent: BackgroundFetchEvent { } public convenience init(type: String, init: BackgroundFetchEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } public func updateUI(options: BackgroundFetchUIOptions? = nil) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/BarcodeDetector.swift b/Sources/DOMKit/WebIDL/BarcodeDetector.swift index 18540513..a127bad2 100644 --- a/Sources/DOMKit/WebIDL/BarcodeDetector.swift +++ b/Sources/DOMKit/WebIDL/BarcodeDetector.swift @@ -13,7 +13,7 @@ public class BarcodeDetector: JSBridgedClass { } public convenience init(barcodeDetectorOptions: BarcodeDetectorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(barcodeDetectorOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [barcodeDetectorOptions?.jsValue() ?? .undefined])) } public static func getSupportedFormats() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift index b43f5d44..e4dd160b 100644 --- a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift +++ b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift @@ -11,7 +11,7 @@ public class BeforeInstallPromptEvent: Event { } public convenience init(type: String, eventInitDict: EventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } public func prompt() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift index bb72e984..06ae5319 100644 --- a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift +++ b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift @@ -16,7 +16,7 @@ public class BiquadFilterNode: AudioNode { } public convenience init(context: BaseAudioContext, options: BiquadFilterOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index 634ba989..10dbfb41 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -15,7 +15,7 @@ public class Blob: JSBridgedClass { } public convenience init(blobParts: [BlobPart]? = nil, options: BlobPropertyBag? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(blobParts?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [blobParts?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/BlobEvent.swift b/Sources/DOMKit/WebIDL/BlobEvent.swift index fad322b7..22231ed7 100644 --- a/Sources/DOMKit/WebIDL/BlobEvent.swift +++ b/Sources/DOMKit/WebIDL/BlobEvent.swift @@ -13,7 +13,7 @@ public class BlobEvent: Event { } public convenience init(type: String, eventInitDict: BlobEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift index 474ac0a9..1ca2bbe8 100644 --- a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift +++ b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift @@ -19,7 +19,7 @@ public class BluetoothAdvertisingEvent: Event { } public convenience init(type: String, init: BluetoothAdvertisingEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index 87fd34e7..e5c13f11 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -14,7 +14,7 @@ public class BroadcastChannel: EventTarget { } public convenience init(name: String) { - self.init(unsafelyWrapping: Self.constructor.new(name.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift index 8501e922..5e149045 100644 --- a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift @@ -15,7 +15,7 @@ public class ByteLengthQueuingStrategy: JSBridgedClass { } public convenience init(init: QueuingStrategyInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSColor.swift b/Sources/DOMKit/WebIDL/CSSColor.swift index 0ac4cc2c..c60ac7b4 100644 --- a/Sources/DOMKit/WebIDL/CSSColor.swift +++ b/Sources/DOMKit/WebIDL/CSSColor.swift @@ -13,7 +13,7 @@ public class CSSColor: CSSColorValue { } public convenience init(colorSpace: CSSKeywordish, channels: [CSSColorPercent], alpha: CSSNumberish? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(colorSpace.jsValue(), channels.jsValue(), alpha?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [colorSpace.jsValue(), channels.jsValue(), alpha?.jsValue() ?? .undefined])) } // XXX: member 'colorSpace' is ignored diff --git a/Sources/DOMKit/WebIDL/CSSHSL.swift b/Sources/DOMKit/WebIDL/CSSHSL.swift index 78ddae5d..56a66722 100644 --- a/Sources/DOMKit/WebIDL/CSSHSL.swift +++ b/Sources/DOMKit/WebIDL/CSSHSL.swift @@ -15,7 +15,7 @@ public class CSSHSL: CSSColorValue { } public convenience init(h: CSSColorAngle, s: CSSColorPercent, l: CSSColorPercent, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(h.jsValue(), s.jsValue(), l.jsValue(), alpha?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue(), s.jsValue(), l.jsValue(), alpha?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSHWB.swift b/Sources/DOMKit/WebIDL/CSSHWB.swift index 2c5be80b..e4f94571 100644 --- a/Sources/DOMKit/WebIDL/CSSHWB.swift +++ b/Sources/DOMKit/WebIDL/CSSHWB.swift @@ -15,7 +15,7 @@ public class CSSHWB: CSSColorValue { } public convenience init(h: CSSNumericValue, w: CSSNumberish, b: CSSNumberish, alpha: CSSNumberish? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(h.jsValue(), w.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue(), w.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSKeywordValue.swift b/Sources/DOMKit/WebIDL/CSSKeywordValue.swift index 70ad6918..4a42654c 100644 --- a/Sources/DOMKit/WebIDL/CSSKeywordValue.swift +++ b/Sources/DOMKit/WebIDL/CSSKeywordValue.swift @@ -12,7 +12,7 @@ public class CSSKeywordValue: CSSStyleValue { } public convenience init(value: String) { - self.init(unsafelyWrapping: Self.constructor.new(value.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSLCH.swift b/Sources/DOMKit/WebIDL/CSSLCH.swift index 8b681f5d..a522b741 100644 --- a/Sources/DOMKit/WebIDL/CSSLCH.swift +++ b/Sources/DOMKit/WebIDL/CSSLCH.swift @@ -15,7 +15,7 @@ public class CSSLCH: CSSColorValue { } public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSLab.swift b/Sources/DOMKit/WebIDL/CSSLab.swift index 5e3a3ef4..e3c8df89 100644 --- a/Sources/DOMKit/WebIDL/CSSLab.swift +++ b/Sources/DOMKit/WebIDL/CSSLab.swift @@ -15,7 +15,7 @@ public class CSSLab: CSSColorValue { } public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathClamp.swift b/Sources/DOMKit/WebIDL/CSSMathClamp.swift index e13c7d2c..f0da81f4 100644 --- a/Sources/DOMKit/WebIDL/CSSMathClamp.swift +++ b/Sources/DOMKit/WebIDL/CSSMathClamp.swift @@ -14,7 +14,7 @@ public class CSSMathClamp: CSSMathValue { } public convenience init(lower: CSSNumberish, value: CSSNumberish, upper: CSSNumberish) { - self.init(unsafelyWrapping: Self.constructor.new(lower.jsValue(), value.jsValue(), upper.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [lower.jsValue(), value.jsValue(), upper.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathInvert.swift b/Sources/DOMKit/WebIDL/CSSMathInvert.swift index dfe5d44f..9a94184b 100644 --- a/Sources/DOMKit/WebIDL/CSSMathInvert.swift +++ b/Sources/DOMKit/WebIDL/CSSMathInvert.swift @@ -12,7 +12,7 @@ public class CSSMathInvert: CSSMathValue { } public convenience init(arg: CSSNumberish) { - self.init(unsafelyWrapping: Self.constructor.new(arg.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathMax.swift b/Sources/DOMKit/WebIDL/CSSMathMax.swift index 6ff5f486..ba651c70 100644 --- a/Sources/DOMKit/WebIDL/CSSMathMax.swift +++ b/Sources/DOMKit/WebIDL/CSSMathMax.swift @@ -12,7 +12,7 @@ public class CSSMathMax: CSSMathValue { } public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(args.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathMin.swift b/Sources/DOMKit/WebIDL/CSSMathMin.swift index d7c208e2..bb48e94f 100644 --- a/Sources/DOMKit/WebIDL/CSSMathMin.swift +++ b/Sources/DOMKit/WebIDL/CSSMathMin.swift @@ -12,7 +12,7 @@ public class CSSMathMin: CSSMathValue { } public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(args.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathNegate.swift b/Sources/DOMKit/WebIDL/CSSMathNegate.swift index e0f7c3e7..74608062 100644 --- a/Sources/DOMKit/WebIDL/CSSMathNegate.swift +++ b/Sources/DOMKit/WebIDL/CSSMathNegate.swift @@ -12,7 +12,7 @@ public class CSSMathNegate: CSSMathValue { } public convenience init(arg: CSSNumberish) { - self.init(unsafelyWrapping: Self.constructor.new(arg.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathProduct.swift b/Sources/DOMKit/WebIDL/CSSMathProduct.swift index 2b4bb9ff..0b05bbb7 100644 --- a/Sources/DOMKit/WebIDL/CSSMathProduct.swift +++ b/Sources/DOMKit/WebIDL/CSSMathProduct.swift @@ -12,7 +12,7 @@ public class CSSMathProduct: CSSMathValue { } public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(args.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathSum.swift b/Sources/DOMKit/WebIDL/CSSMathSum.swift index 1e945ac8..2f58862e 100644 --- a/Sources/DOMKit/WebIDL/CSSMathSum.swift +++ b/Sources/DOMKit/WebIDL/CSSMathSum.swift @@ -12,7 +12,7 @@ public class CSSMathSum: CSSMathValue { } public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(args.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift b/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift index 283e7b08..55d3e27d 100644 --- a/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift +++ b/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift @@ -12,7 +12,7 @@ public class CSSMatrixComponent: CSSTransformComponent { } public convenience init(matrix: DOMMatrixReadOnly, options: CSSMatrixComponentOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(matrix.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [matrix.jsValue(), options?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSOKLCH.swift b/Sources/DOMKit/WebIDL/CSSOKLCH.swift index e1182c88..2377b182 100644 --- a/Sources/DOMKit/WebIDL/CSSOKLCH.swift +++ b/Sources/DOMKit/WebIDL/CSSOKLCH.swift @@ -15,7 +15,7 @@ public class CSSOKLCH: CSSColorValue { } public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSOKLab.swift b/Sources/DOMKit/WebIDL/CSSOKLab.swift index 95c67393..bc0326f9 100644 --- a/Sources/DOMKit/WebIDL/CSSOKLab.swift +++ b/Sources/DOMKit/WebIDL/CSSOKLab.swift @@ -15,7 +15,7 @@ public class CSSOKLab: CSSColorValue { } public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserAtRule.swift b/Sources/DOMKit/WebIDL/CSSParserAtRule.swift index 916e74b6..70342177 100644 --- a/Sources/DOMKit/WebIDL/CSSParserAtRule.swift +++ b/Sources/DOMKit/WebIDL/CSSParserAtRule.swift @@ -14,7 +14,7 @@ public class CSSParserAtRule: CSSParserRule { } public convenience init(name: String, prelude: [CSSToken], body: [CSSParserRule]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(name.jsValue(), prelude.jsValue(), body?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), prelude.jsValue(), body?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserBlock.swift b/Sources/DOMKit/WebIDL/CSSParserBlock.swift index ef349d8c..6f791d44 100644 --- a/Sources/DOMKit/WebIDL/CSSParserBlock.swift +++ b/Sources/DOMKit/WebIDL/CSSParserBlock.swift @@ -13,7 +13,7 @@ public class CSSParserBlock: CSSParserValue { } public convenience init(name: String, body: [CSSParserValue]) { - self.init(unsafelyWrapping: Self.constructor.new(name.jsValue(), body.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), body.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift b/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift index 9d84a746..a4656aa0 100644 --- a/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift @@ -13,7 +13,7 @@ public class CSSParserDeclaration: CSSParserRule { } public convenience init(name: String, body: [CSSParserRule]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(name.jsValue(), body?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), body?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserFunction.swift b/Sources/DOMKit/WebIDL/CSSParserFunction.swift index b74c36f3..41b77428 100644 --- a/Sources/DOMKit/WebIDL/CSSParserFunction.swift +++ b/Sources/DOMKit/WebIDL/CSSParserFunction.swift @@ -13,7 +13,7 @@ public class CSSParserFunction: CSSParserValue { } public convenience init(name: String, args: [[CSSParserValue]]) { - self.init(unsafelyWrapping: Self.constructor.new(name.jsValue(), args.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), args.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift b/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift index 23fe62d4..5e5144d7 100644 --- a/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift +++ b/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift @@ -13,7 +13,7 @@ public class CSSParserQualifiedRule: CSSParserRule { } public convenience init(prelude: [CSSToken], body: [CSSParserRule]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(prelude.jsValue(), body?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [prelude.jsValue(), body?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSPerspective.swift b/Sources/DOMKit/WebIDL/CSSPerspective.swift index 54d085c1..27c854d0 100644 --- a/Sources/DOMKit/WebIDL/CSSPerspective.swift +++ b/Sources/DOMKit/WebIDL/CSSPerspective.swift @@ -12,7 +12,7 @@ public class CSSPerspective: CSSTransformComponent { } public convenience init(length: CSSPerspectiveValue) { - self.init(unsafelyWrapping: Self.constructor.new(length.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [length.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSRGB.swift b/Sources/DOMKit/WebIDL/CSSRGB.swift index 6a263ad2..d8de6839 100644 --- a/Sources/DOMKit/WebIDL/CSSRGB.swift +++ b/Sources/DOMKit/WebIDL/CSSRGB.swift @@ -15,7 +15,7 @@ public class CSSRGB: CSSColorValue { } public convenience init(r: CSSColorRGBComp, g: CSSColorRGBComp, b: CSSColorRGBComp, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(r.jsValue(), g.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [r.jsValue(), g.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSRotate.swift b/Sources/DOMKit/WebIDL/CSSRotate.swift index 66d62a7e..059d7e45 100644 --- a/Sources/DOMKit/WebIDL/CSSRotate.swift +++ b/Sources/DOMKit/WebIDL/CSSRotate.swift @@ -15,11 +15,11 @@ public class CSSRotate: CSSTransformComponent { } public convenience init(angle: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(angle.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [angle.jsValue()])) } public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish, angle: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(x.jsValue(), y.jsValue(), z.jsValue(), angle.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue(), y.jsValue(), z.jsValue(), angle.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSScale.swift b/Sources/DOMKit/WebIDL/CSSScale.swift index 7e4fdb1e..68e39630 100644 --- a/Sources/DOMKit/WebIDL/CSSScale.swift +++ b/Sources/DOMKit/WebIDL/CSSScale.swift @@ -14,7 +14,7 @@ public class CSSScale: CSSTransformComponent { } public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSSkew.swift b/Sources/DOMKit/WebIDL/CSSSkew.swift index bb77d06f..86f76750 100644 --- a/Sources/DOMKit/WebIDL/CSSSkew.swift +++ b/Sources/DOMKit/WebIDL/CSSSkew.swift @@ -13,7 +13,7 @@ public class CSSSkew: CSSTransformComponent { } public convenience init(ax: CSSNumericValue, ay: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(ax.jsValue(), ay.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue(), ay.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSSkewX.swift b/Sources/DOMKit/WebIDL/CSSSkewX.swift index ccd6dc7b..888156cf 100644 --- a/Sources/DOMKit/WebIDL/CSSSkewX.swift +++ b/Sources/DOMKit/WebIDL/CSSSkewX.swift @@ -12,7 +12,7 @@ public class CSSSkewX: CSSTransformComponent { } public convenience init(ax: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(ax.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSSkewY.swift b/Sources/DOMKit/WebIDL/CSSSkewY.swift index a8789f2b..09efc024 100644 --- a/Sources/DOMKit/WebIDL/CSSSkewY.swift +++ b/Sources/DOMKit/WebIDL/CSSSkewY.swift @@ -12,7 +12,7 @@ public class CSSSkewY: CSSTransformComponent { } public convenience init(ay: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(ay.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [ay.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift index fd30e7d6..69c8ec15 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -14,7 +14,7 @@ public class CSSStyleSheet: StyleSheet { } public convenience init(options: CSSStyleSheetInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSTransformValue.swift b/Sources/DOMKit/WebIDL/CSSTransformValue.swift index 3eb7bdb2..ca9d8221 100644 --- a/Sources/DOMKit/WebIDL/CSSTransformValue.swift +++ b/Sources/DOMKit/WebIDL/CSSTransformValue.swift @@ -13,7 +13,7 @@ public class CSSTransformValue: CSSStyleValue, Sequence { } public convenience init(transforms: [CSSTransformComponent]) { - self.init(unsafelyWrapping: Self.constructor.new(transforms.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [transforms.jsValue()])) } public typealias Element = CSSTransformComponent diff --git a/Sources/DOMKit/WebIDL/CSSTranslate.swift b/Sources/DOMKit/WebIDL/CSSTranslate.swift index 55cd10c5..0c5b3a38 100644 --- a/Sources/DOMKit/WebIDL/CSSTranslate.swift +++ b/Sources/DOMKit/WebIDL/CSSTranslate.swift @@ -14,7 +14,7 @@ public class CSSTranslate: CSSTransformComponent { } public convenience init(x: CSSNumericValue, y: CSSNumericValue, z: CSSNumericValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSUnitValue.swift b/Sources/DOMKit/WebIDL/CSSUnitValue.swift index 576de37b..ae1507d1 100644 --- a/Sources/DOMKit/WebIDL/CSSUnitValue.swift +++ b/Sources/DOMKit/WebIDL/CSSUnitValue.swift @@ -13,7 +13,7 @@ public class CSSUnitValue: CSSNumericValue { } public convenience init(value: Double, unit: String) { - self.init(unsafelyWrapping: Self.constructor.new(value.jsValue(), unit.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue(), unit.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift b/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift index 7153fbaa..34a42ad7 100644 --- a/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift +++ b/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift @@ -12,7 +12,7 @@ public class CSSUnparsedValue: CSSStyleValue, Sequence { } public convenience init(members: [CSSUnparsedSegment]) { - self.init(unsafelyWrapping: Self.constructor.new(members.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [members.jsValue()])) } public typealias Element = CSSUnparsedSegment diff --git a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift index 6d7b1f09..89ad1f32 100644 --- a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift +++ b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift @@ -15,7 +15,7 @@ public class CSSVariableReferenceValue: JSBridgedClass { } public convenience init(variable: String, fallback: CSSUnparsedValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(variable.jsValue(), fallback?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [variable.jsValue(), fallback?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift b/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift index 9ec5b0bf..26bd7f29 100644 --- a/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift +++ b/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift @@ -14,7 +14,7 @@ public class CanMakePaymentEvent: ExtendableEvent { } public convenience init(type: String, eventInitDict: CanMakePaymentEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CanvasFilter.swift b/Sources/DOMKit/WebIDL/CanvasFilter.swift index c796e198..ddef3625 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilter.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilter.swift @@ -13,6 +13,6 @@ public class CanvasFilter: JSBridgedClass { } public convenience init(filters: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(filters?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [filters?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/ChannelMergerNode.swift b/Sources/DOMKit/WebIDL/ChannelMergerNode.swift index ef442c74..e946e3fc 100644 --- a/Sources/DOMKit/WebIDL/ChannelMergerNode.swift +++ b/Sources/DOMKit/WebIDL/ChannelMergerNode.swift @@ -11,6 +11,6 @@ public class ChannelMergerNode: AudioNode { } public convenience init(context: BaseAudioContext, options: ChannelMergerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift b/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift index a1d8d979..a713bb77 100644 --- a/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift +++ b/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift @@ -11,6 +11,6 @@ public class ChannelSplitterNode: AudioNode { } public convenience init(context: BaseAudioContext, options: ChannelSplitterOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift index d8bec0e1..249c10df 100644 --- a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift @@ -13,7 +13,7 @@ public class CharacterBoundsUpdateEvent: Event { } public convenience init(options: CharacterBoundsUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ClipboardEvent.swift b/Sources/DOMKit/WebIDL/ClipboardEvent.swift index deb61442..cb483475 100644 --- a/Sources/DOMKit/WebIDL/ClipboardEvent.swift +++ b/Sources/DOMKit/WebIDL/ClipboardEvent.swift @@ -12,7 +12,7 @@ public class ClipboardEvent: Event { } public convenience init(type: String, eventInitDict: ClipboardEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ClipboardItem.swift b/Sources/DOMKit/WebIDL/ClipboardItem.swift index 9bc28634..4cfab85a 100644 --- a/Sources/DOMKit/WebIDL/ClipboardItem.swift +++ b/Sources/DOMKit/WebIDL/ClipboardItem.swift @@ -15,7 +15,7 @@ public class ClipboardItem: JSBridgedClass { } public convenience init(items: [String: ClipboardItemData], options: ClipboardItemOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(items.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [items.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CloseEvent.swift b/Sources/DOMKit/WebIDL/CloseEvent.swift index 6d7aff31..5e6118ad 100644 --- a/Sources/DOMKit/WebIDL/CloseEvent.swift +++ b/Sources/DOMKit/WebIDL/CloseEvent.swift @@ -14,7 +14,7 @@ public class CloseEvent: Event { } public convenience init(type: String, eventInitDict: CloseEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CloseWatcher.swift b/Sources/DOMKit/WebIDL/CloseWatcher.swift index fac29741..a41bf87e 100644 --- a/Sources/DOMKit/WebIDL/CloseWatcher.swift +++ b/Sources/DOMKit/WebIDL/CloseWatcher.swift @@ -13,7 +13,7 @@ public class CloseWatcher: EventTarget { } public convenience init(options: CloseWatcherOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } public func destroy() { diff --git a/Sources/DOMKit/WebIDL/Comment.swift b/Sources/DOMKit/WebIDL/Comment.swift index 3a3cc62d..1c1e2eda 100644 --- a/Sources/DOMKit/WebIDL/Comment.swift +++ b/Sources/DOMKit/WebIDL/Comment.swift @@ -11,6 +11,6 @@ public class Comment: CharacterData { } public convenience init(data: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(data?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index b7a9a4c1..4e9c2cba 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -12,7 +12,7 @@ public class CompositionEvent: UIEvent { } public convenience init(type: String, eventInitDict: CompositionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CompressionStream.swift b/Sources/DOMKit/WebIDL/CompressionStream.swift index ebf9fb7d..cdbec0a0 100644 --- a/Sources/DOMKit/WebIDL/CompressionStream.swift +++ b/Sources/DOMKit/WebIDL/CompressionStream.swift @@ -13,6 +13,6 @@ public class CompressionStream: JSBridgedClass, GenericTransformStream { } public convenience init(format: String) { - self.init(unsafelyWrapping: Self.constructor.new(format.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue()])) } } diff --git a/Sources/DOMKit/WebIDL/ConstantSourceNode.swift b/Sources/DOMKit/WebIDL/ConstantSourceNode.swift index e53b9e9d..3f0d7d69 100644 --- a/Sources/DOMKit/WebIDL/ConstantSourceNode.swift +++ b/Sources/DOMKit/WebIDL/ConstantSourceNode.swift @@ -12,7 +12,7 @@ public class ConstantSourceNode: AudioScheduledSourceNode { } public convenience init(context: BaseAudioContext, options: ConstantSourceOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ContentIndexEvent.swift b/Sources/DOMKit/WebIDL/ContentIndexEvent.swift index be0c1842..fccbbb8c 100644 --- a/Sources/DOMKit/WebIDL/ContentIndexEvent.swift +++ b/Sources/DOMKit/WebIDL/ContentIndexEvent.swift @@ -12,7 +12,7 @@ public class ContentIndexEvent: ExtendableEvent { } public convenience init(type: String, init: ContentIndexEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ConvolverNode.swift b/Sources/DOMKit/WebIDL/ConvolverNode.swift index 068b41a5..e41a729d 100644 --- a/Sources/DOMKit/WebIDL/ConvolverNode.swift +++ b/Sources/DOMKit/WebIDL/ConvolverNode.swift @@ -13,7 +13,7 @@ public class ConvolverNode: AudioNode { } public convenience init(context: BaseAudioContext, options: ConvolverOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CookieChangeEvent.swift b/Sources/DOMKit/WebIDL/CookieChangeEvent.swift index f2fe3c68..a48279b8 100644 --- a/Sources/DOMKit/WebIDL/CookieChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/CookieChangeEvent.swift @@ -13,7 +13,7 @@ public class CookieChangeEvent: Event { } public convenience init(type: String, eventInitDict: CookieChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift index 676ed834..23abb282 100644 --- a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift @@ -15,7 +15,7 @@ public class CountQueuingStrategy: JSBridgedClass { } public convenience init(init: QueuingStrategyInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index 2f458787..7c1c7021 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -12,7 +12,7 @@ public class CustomEvent: Event { } public convenience init(type: String, eventInitDict: CustomEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DOMException.swift b/Sources/DOMKit/WebIDL/DOMException.swift index a2223c42..9453e464 100644 --- a/Sources/DOMKit/WebIDL/DOMException.swift +++ b/Sources/DOMKit/WebIDL/DOMException.swift @@ -16,7 +16,7 @@ public class DOMException: JSBridgedClass { } public convenience init(message: String? = nil, name: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(message?.jsValue() ?? .undefined, name?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [message?.jsValue() ?? .undefined, name?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index 47c0f199..e80029b1 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -33,7 +33,7 @@ public class DOMMatrix: DOMMatrixReadOnly { } public convenience init(init: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } // XXX: illegal static override diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift index 0e5aba1e..28950a42 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -37,7 +37,7 @@ public class DOMMatrixReadOnly: JSBridgedClass { } public convenience init(init: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self { diff --git a/Sources/DOMKit/WebIDL/DOMParser.swift b/Sources/DOMKit/WebIDL/DOMParser.swift index 2a05b6ca..47805989 100644 --- a/Sources/DOMKit/WebIDL/DOMParser.swift +++ b/Sources/DOMKit/WebIDL/DOMParser.swift @@ -13,7 +13,7 @@ public class DOMParser: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public func parseFromString(string: String, type: DOMParserSupportedType) -> Document { diff --git a/Sources/DOMKit/WebIDL/DOMPoint.swift b/Sources/DOMKit/WebIDL/DOMPoint.swift index c8e29bc1..9cc9d0bf 100644 --- a/Sources/DOMKit/WebIDL/DOMPoint.swift +++ b/Sources/DOMKit/WebIDL/DOMPoint.swift @@ -15,7 +15,7 @@ public class DOMPoint: DOMPointReadOnly { } public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined])) } // XXX: illegal static override diff --git a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift index a3e932b7..37df0738 100644 --- a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift @@ -17,7 +17,7 @@ public class DOMPointReadOnly: JSBridgedClass { } public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined])) } public static func fromPoint(other: DOMPointInit? = nil) -> Self { diff --git a/Sources/DOMKit/WebIDL/DOMQuad.swift b/Sources/DOMKit/WebIDL/DOMQuad.swift index b05c0aea..b07eb8f5 100644 --- a/Sources/DOMKit/WebIDL/DOMQuad.swift +++ b/Sources/DOMKit/WebIDL/DOMQuad.swift @@ -17,7 +17,7 @@ public class DOMQuad: JSBridgedClass { } public convenience init(p1: DOMPointInit? = nil, p2: DOMPointInit? = nil, p3: DOMPointInit? = nil, p4: DOMPointInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(p1?.jsValue() ?? .undefined, p2?.jsValue() ?? .undefined, p3?.jsValue() ?? .undefined, p4?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [p1?.jsValue() ?? .undefined, p2?.jsValue() ?? .undefined, p3?.jsValue() ?? .undefined, p4?.jsValue() ?? .undefined])) } public static func fromRect(other: DOMRectInit? = nil) -> Self { diff --git a/Sources/DOMKit/WebIDL/DOMRect.swift b/Sources/DOMKit/WebIDL/DOMRect.swift index 3212774e..283dfce1 100644 --- a/Sources/DOMKit/WebIDL/DOMRect.swift +++ b/Sources/DOMKit/WebIDL/DOMRect.swift @@ -15,7 +15,7 @@ public class DOMRect: DOMRectReadOnly { } public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined])) } // XXX: illegal static override diff --git a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift index 58760e54..40619ca7 100644 --- a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift @@ -21,7 +21,7 @@ public class DOMRectReadOnly: JSBridgedClass { } public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined])) } public static func fromRect(other: DOMRectInit? = nil) -> Self { diff --git a/Sources/DOMKit/WebIDL/DataCue.swift b/Sources/DOMKit/WebIDL/DataCue.swift index a0be4ccc..1cec4275 100644 --- a/Sources/DOMKit/WebIDL/DataCue.swift +++ b/Sources/DOMKit/WebIDL/DataCue.swift @@ -13,7 +13,7 @@ public class DataCue: TextTrackCue { } public convenience init(startTime: Double, endTime: Double, value: JSValue, type: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(startTime.jsValue(), endTime.jsValue(), value.jsValue(), type?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue(), endTime.jsValue(), value.jsValue(), type?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift index 4820053f..7bd0646b 100644 --- a/Sources/DOMKit/WebIDL/DataTransfer.swift +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -18,7 +18,7 @@ public class DataTransfer: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DecompressionStream.swift b/Sources/DOMKit/WebIDL/DecompressionStream.swift index 2c13f02c..db0136c2 100644 --- a/Sources/DOMKit/WebIDL/DecompressionStream.swift +++ b/Sources/DOMKit/WebIDL/DecompressionStream.swift @@ -13,6 +13,6 @@ public class DecompressionStream: JSBridgedClass, GenericTransformStream { } public convenience init(format: String) { - self.init(unsafelyWrapping: Self.constructor.new(format.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue()])) } } diff --git a/Sources/DOMKit/WebIDL/DelayNode.swift b/Sources/DOMKit/WebIDL/DelayNode.swift index d9d0b37e..052b2d0b 100644 --- a/Sources/DOMKit/WebIDL/DelayNode.swift +++ b/Sources/DOMKit/WebIDL/DelayNode.swift @@ -12,7 +12,7 @@ public class DelayNode: AudioNode { } public convenience init(context: BaseAudioContext, options: DelayOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift index 59932255..2125c8f6 100644 --- a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift +++ b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift @@ -15,7 +15,7 @@ public class DeviceMotionEvent: Event { } public convenience init(type: String, eventInitDict: DeviceMotionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift index 0d4995f8..f0f8fa99 100644 --- a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift +++ b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift @@ -15,7 +15,7 @@ public class DeviceOrientationEvent: Event { } public convenience init(type: String, eventInitDict: DeviceOrientationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 8db95baa..2d4fdfad 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -92,7 +92,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode public var scrollingElement: Element? public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DocumentFragment.swift b/Sources/DOMKit/WebIDL/DocumentFragment.swift index 99f37e39..e3661620 100644 --- a/Sources/DOMKit/WebIDL/DocumentFragment.swift +++ b/Sources/DOMKit/WebIDL/DocumentFragment.swift @@ -11,6 +11,6 @@ public class DocumentFragment: Node, NonElementParentNode, ParentNode { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/DocumentTimeline.swift b/Sources/DOMKit/WebIDL/DocumentTimeline.swift index f0f5385d..16c9f60f 100644 --- a/Sources/DOMKit/WebIDL/DocumentTimeline.swift +++ b/Sources/DOMKit/WebIDL/DocumentTimeline.swift @@ -11,6 +11,6 @@ public class DocumentTimeline: AnimationTimeline { } public convenience init(options: DocumentTimelineOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/DragEvent.swift b/Sources/DOMKit/WebIDL/DragEvent.swift index a71c2fd2..b18e6faa 100644 --- a/Sources/DOMKit/WebIDL/DragEvent.swift +++ b/Sources/DOMKit/WebIDL/DragEvent.swift @@ -12,7 +12,7 @@ public class DragEvent: MouseEvent { } public convenience init(type: String, eventInitDict: DragEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift b/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift index 26a1771a..f43b6b1d 100644 --- a/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift +++ b/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift @@ -17,7 +17,7 @@ public class DynamicsCompressorNode: AudioNode { } public convenience init(context: BaseAudioContext, options: DynamicsCompressorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EditContext.swift b/Sources/DOMKit/WebIDL/EditContext.swift index 5951a9c4..7ca42419 100644 --- a/Sources/DOMKit/WebIDL/EditContext.swift +++ b/Sources/DOMKit/WebIDL/EditContext.swift @@ -25,7 +25,7 @@ public class EditContext: EventTarget { } public convenience init(options: EditContextInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } public func updateText(rangeStart: UInt32, rangeEnd: UInt32, text: String) { diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift index 7854d1c1..8415fe0d 100644 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift @@ -17,7 +17,7 @@ public class EncodedAudioChunk: JSBridgedClass { } public convenience init(init: EncodedAudioChunkInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift index 8c709d64..65ea368e 100644 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift @@ -17,7 +17,7 @@ public class EncodedVideoChunk: JSBridgedClass { } public convenience init(init: EncodedVideoChunkInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ErrorEvent.swift b/Sources/DOMKit/WebIDL/ErrorEvent.swift index 91148499..2619019e 100644 --- a/Sources/DOMKit/WebIDL/ErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/ErrorEvent.swift @@ -16,7 +16,7 @@ public class ErrorEvent: Event { } public convenience init(type: String, eventInitDict: ErrorEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index 78a5c25f..c40af9e0 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -26,7 +26,7 @@ public class Event: JSBridgedClass { } public convenience init(type: String, eventInitDict: EventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index 60ef37f4..2f3770e4 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -17,7 +17,7 @@ public class EventSource: EventTarget { } public convenience init(url: String, eventSourceInitDict: EventSourceInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), eventSourceInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), eventSourceInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EventTarget.swift b/Sources/DOMKit/WebIDL/EventTarget.swift index 4ad180af..a6f01834 100644 --- a/Sources/DOMKit/WebIDL/EventTarget.swift +++ b/Sources/DOMKit/WebIDL/EventTarget.swift @@ -13,7 +13,7 @@ public class EventTarget: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } // XXX: member 'addEventListener' is ignored diff --git a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift index 66a7e54f..57dbc9ea 100644 --- a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift @@ -13,7 +13,7 @@ public class ExtendableCookieChangeEvent: ExtendableEvent { } public convenience init(type: String, eventInitDict: ExtendableCookieChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ExtendableEvent.swift b/Sources/DOMKit/WebIDL/ExtendableEvent.swift index 4440e9f6..40bc3add 100644 --- a/Sources/DOMKit/WebIDL/ExtendableEvent.swift +++ b/Sources/DOMKit/WebIDL/ExtendableEvent.swift @@ -11,7 +11,7 @@ public class ExtendableEvent: Event { } public convenience init(type: String, eventInitDict: ExtendableEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } public func waitUntil(f: JSPromise) { diff --git a/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift b/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift index b4806b9b..cd4ff0e0 100644 --- a/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift +++ b/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift @@ -16,7 +16,7 @@ public class ExtendableMessageEvent: ExtendableEvent { } public convenience init(type: String, eventInitDict: ExtendableMessageEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EyeDropper.swift b/Sources/DOMKit/WebIDL/EyeDropper.swift index 34584f44..eadac4ba 100644 --- a/Sources/DOMKit/WebIDL/EyeDropper.swift +++ b/Sources/DOMKit/WebIDL/EyeDropper.swift @@ -13,7 +13,7 @@ public class EyeDropper: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public func open(options: ColorSelectionOptions? = nil) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/FaceDetector.swift b/Sources/DOMKit/WebIDL/FaceDetector.swift index d7e0c128..ca6e9819 100644 --- a/Sources/DOMKit/WebIDL/FaceDetector.swift +++ b/Sources/DOMKit/WebIDL/FaceDetector.swift @@ -13,7 +13,7 @@ public class FaceDetector: JSBridgedClass { } public convenience init(faceDetectorOptions: FaceDetectorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(faceDetectorOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [faceDetectorOptions?.jsValue() ?? .undefined])) } public func detect(image: ImageBitmapSource) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/FederatedCredential.swift b/Sources/DOMKit/WebIDL/FederatedCredential.swift index 0e2fc3d0..e92ee39f 100644 --- a/Sources/DOMKit/WebIDL/FederatedCredential.swift +++ b/Sources/DOMKit/WebIDL/FederatedCredential.swift @@ -13,7 +13,7 @@ public class FederatedCredential: Credential, CredentialUserData { } public convenience init(data: FederatedCredentialInit) { - self.init(unsafelyWrapping: Self.constructor.new(data.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FetchEvent.swift b/Sources/DOMKit/WebIDL/FetchEvent.swift index 62dcc1d2..e4cb1131 100644 --- a/Sources/DOMKit/WebIDL/FetchEvent.swift +++ b/Sources/DOMKit/WebIDL/FetchEvent.swift @@ -17,7 +17,7 @@ public class FetchEvent: ExtendableEvent { } public convenience init(type: String, eventInitDict: FetchEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/File.swift b/Sources/DOMKit/WebIDL/File.swift index 8ce7277a..53444f77 100644 --- a/Sources/DOMKit/WebIDL/File.swift +++ b/Sources/DOMKit/WebIDL/File.swift @@ -14,7 +14,7 @@ public class File: Blob { } public convenience init(fileBits: [BlobPart], fileName: String, options: FilePropertyBag? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(fileBits.jsValue(), fileName.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [fileBits.jsValue(), fileName.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index 27ff7029..b051902b 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -20,7 +20,7 @@ public class FileReader: EventTarget { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public func readAsArrayBuffer(blob: Blob) { diff --git a/Sources/DOMKit/WebIDL/FileReaderSync.swift b/Sources/DOMKit/WebIDL/FileReaderSync.swift index 0a57df8d..7bf85c24 100644 --- a/Sources/DOMKit/WebIDL/FileReaderSync.swift +++ b/Sources/DOMKit/WebIDL/FileReaderSync.swift @@ -13,7 +13,7 @@ public class FileReaderSync: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public func readAsArrayBuffer(blob: Blob) -> ArrayBuffer { diff --git a/Sources/DOMKit/WebIDL/FocusEvent.swift b/Sources/DOMKit/WebIDL/FocusEvent.swift index 0bfe3b4c..34b4b2c2 100644 --- a/Sources/DOMKit/WebIDL/FocusEvent.swift +++ b/Sources/DOMKit/WebIDL/FocusEvent.swift @@ -12,7 +12,7 @@ public class FocusEvent: UIEvent { } public convenience init(type: String, eventInitDict: FocusEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FontFace.swift b/Sources/DOMKit/WebIDL/FontFace.swift index 18846528..5bc411bc 100644 --- a/Sources/DOMKit/WebIDL/FontFace.swift +++ b/Sources/DOMKit/WebIDL/FontFace.swift @@ -30,7 +30,7 @@ public class FontFace: JSBridgedClass { } public convenience init(family: String, source: __UNSUPPORTED_UNION__, descriptors: FontFaceDescriptors? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(family.jsValue(), source.jsValue(), descriptors?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [family.jsValue(), source.jsValue(), descriptors?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/FontFaceSet.swift b/Sources/DOMKit/WebIDL/FontFaceSet.swift index 804bd2e8..c88639aa 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSet.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSet.swift @@ -16,7 +16,7 @@ public class FontFaceSet: EventTarget { } public convenience init(initialFaces: [FontFace]) { - self.init(unsafelyWrapping: Self.constructor.new(initialFaces.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [initialFaces.jsValue()])) } // XXX: make me Set-like! diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift index 16f06669..f68d10a8 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift @@ -12,7 +12,7 @@ public class FontFaceSetLoadEvent: Event { } public convenience init(type: String, eventInitDict: FontFaceSetLoadEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index 41a9efb3..10941615 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -13,7 +13,7 @@ public class FormData: JSBridgedClass, Sequence { } public convenience init(form: HTMLFormElement? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(form?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [form?.jsValue() ?? .undefined])) } public func append(name: String, value: String) { diff --git a/Sources/DOMKit/WebIDL/FormDataEvent.swift b/Sources/DOMKit/WebIDL/FormDataEvent.swift index 43417a4f..7a7b8e76 100644 --- a/Sources/DOMKit/WebIDL/FormDataEvent.swift +++ b/Sources/DOMKit/WebIDL/FormDataEvent.swift @@ -12,7 +12,7 @@ public class FormDataEvent: Event { } public convenience init(type: String, eventInitDict: FormDataEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FragmentResult.swift b/Sources/DOMKit/WebIDL/FragmentResult.swift index e4f29c0a..a868a44f 100644 --- a/Sources/DOMKit/WebIDL/FragmentResult.swift +++ b/Sources/DOMKit/WebIDL/FragmentResult.swift @@ -15,7 +15,7 @@ public class FragmentResult: JSBridgedClass { } public convenience init(options: FragmentResultOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift b/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift index df85d8fd..612d0ea0 100644 --- a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift +++ b/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift @@ -13,6 +13,6 @@ public class GPUOutOfMemoryError: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift index 2f8aacca..4afc0156 100644 --- a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift @@ -12,7 +12,7 @@ public class GPUUncapturedErrorEvent: Event { } public convenience init(type: String, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), gpuUncapturedErrorEventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), gpuUncapturedErrorEventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GPUValidationError.swift b/Sources/DOMKit/WebIDL/GPUValidationError.swift index 115e6fa7..6d0b4b66 100644 --- a/Sources/DOMKit/WebIDL/GPUValidationError.swift +++ b/Sources/DOMKit/WebIDL/GPUValidationError.swift @@ -14,7 +14,7 @@ public class GPUValidationError: JSBridgedClass { } public convenience init(message: String) { - self.init(unsafelyWrapping: Self.constructor.new(message.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [message.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GainNode.swift b/Sources/DOMKit/WebIDL/GainNode.swift index e2f526cd..b886d480 100644 --- a/Sources/DOMKit/WebIDL/GainNode.swift +++ b/Sources/DOMKit/WebIDL/GainNode.swift @@ -12,7 +12,7 @@ public class GainNode: AudioNode { } public convenience init(context: BaseAudioContext, options: GainOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GamepadEvent.swift b/Sources/DOMKit/WebIDL/GamepadEvent.swift index 76f4f140..75b3b364 100644 --- a/Sources/DOMKit/WebIDL/GamepadEvent.swift +++ b/Sources/DOMKit/WebIDL/GamepadEvent.swift @@ -12,7 +12,7 @@ public class GamepadEvent: Event { } public convenience init(type: String, eventInitDict: GamepadEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GeolocationSensor.swift b/Sources/DOMKit/WebIDL/GeolocationSensor.swift index b6f7e175..560deb84 100644 --- a/Sources/DOMKit/WebIDL/GeolocationSensor.swift +++ b/Sources/DOMKit/WebIDL/GeolocationSensor.swift @@ -18,7 +18,7 @@ public class GeolocationSensor: Sensor { } public convenience init(options: GeolocationSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } public static func read(readOptions: ReadOptions? = nil) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/Global.swift b/Sources/DOMKit/WebIDL/Global.swift index ba7e6a5e..0cc49e86 100644 --- a/Sources/DOMKit/WebIDL/Global.swift +++ b/Sources/DOMKit/WebIDL/Global.swift @@ -14,7 +14,7 @@ public class Global: JSBridgedClass { } public convenience init(descriptor: GlobalDescriptor, v: JSValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(descriptor.jsValue(), v?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue(), v?.jsValue() ?? .undefined])) } public func valueOf() -> JSValue { diff --git a/Sources/DOMKit/WebIDL/GravitySensor.swift b/Sources/DOMKit/WebIDL/GravitySensor.swift index 22858d33..575f4ce8 100644 --- a/Sources/DOMKit/WebIDL/GravitySensor.swift +++ b/Sources/DOMKit/WebIDL/GravitySensor.swift @@ -11,6 +11,6 @@ public class GravitySensor: Accelerometer { } public convenience init(options: AccelerometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/GroupEffect.swift b/Sources/DOMKit/WebIDL/GroupEffect.swift index 9ffe532d..36c0b024 100644 --- a/Sources/DOMKit/WebIDL/GroupEffect.swift +++ b/Sources/DOMKit/WebIDL/GroupEffect.swift @@ -16,7 +16,7 @@ public class GroupEffect: JSBridgedClass { } public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(children.jsValue(), timing?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue(), timing?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Gyroscope.swift b/Sources/DOMKit/WebIDL/Gyroscope.swift index f0fdfb6d..d3a7f5a4 100644 --- a/Sources/DOMKit/WebIDL/Gyroscope.swift +++ b/Sources/DOMKit/WebIDL/Gyroscope.swift @@ -14,7 +14,7 @@ public class Gyroscope: Sensor { } public convenience init(sensorOptions: GyroscopeSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift b/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift index 0943001a..aa83544e 100644 --- a/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift +++ b/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift @@ -12,7 +12,7 @@ public class HIDConnectionEvent: Event { } public convenience init(type: String, eventInitDict: HIDConnectionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift b/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift index 04760fcc..fabdbf88 100644 --- a/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift +++ b/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift @@ -14,7 +14,7 @@ public class HIDInputReportEvent: Event { } public convenience init(type: String, eventInitDict: HIDInputReportEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift index af72551c..16ecf36d 100644 --- a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift @@ -50,7 +50,7 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { public var registerAttributionSource: Bool public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift index 4feb14e8..d2564e59 100644 --- a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift @@ -21,7 +21,7 @@ public class HTMLAreaElement: HTMLElement, HTMLHyperlinkElementUtils { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift index 74d395be..8638b264 100644 --- a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift @@ -11,6 +11,6 @@ public class HTMLAudioElement: HTMLMediaElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/HTMLBRElement.swift b/Sources/DOMKit/WebIDL/HTMLBRElement.swift index bf58f45b..140e7703 100644 --- a/Sources/DOMKit/WebIDL/HTMLBRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBRElement.swift @@ -12,7 +12,7 @@ public class HTMLBRElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift index 3cfdb03a..f59cd977 100644 --- a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift @@ -13,7 +13,7 @@ public class HTMLBaseElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift index 5faeb143..06f11db5 100644 --- a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift @@ -21,7 +21,7 @@ public class HTMLBodyElement: HTMLElement, WindowEventHandlers { public var onorientationchange: EventHandler public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift index 00db5cb6..6730b437 100644 --- a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -25,7 +25,7 @@ public class HTMLButtonElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index ab09efb5..e258ba7c 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -13,7 +13,7 @@ public class HTMLCanvasElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLDListElement.swift b/Sources/DOMKit/WebIDL/HTMLDListElement.swift index 591d974c..ac4b33a3 100644 --- a/Sources/DOMKit/WebIDL/HTMLDListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDListElement.swift @@ -12,7 +12,7 @@ public class HTMLDListElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLDataElement.swift b/Sources/DOMKit/WebIDL/HTMLDataElement.swift index 95b5321a..793d0838 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataElement.swift @@ -12,7 +12,7 @@ public class HTMLDataElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift index 8d7d4671..b81e211a 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift @@ -12,7 +12,7 @@ public class HTMLDataListElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift index ae616fc1..7a7c6e69 100644 --- a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift @@ -12,7 +12,7 @@ public class HTMLDetailsElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift index c0d51212..3d50fbaf 100644 --- a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -13,7 +13,7 @@ public class HTMLDialogElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift index e29e61a0..d0fc52c5 100644 --- a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift @@ -12,7 +12,7 @@ public class HTMLDirectoryElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLDivElement.swift b/Sources/DOMKit/WebIDL/HTMLDivElement.swift index 6a53e6ed..343e2d86 100644 --- a/Sources/DOMKit/WebIDL/HTMLDivElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDivElement.swift @@ -12,7 +12,7 @@ public class HTMLDivElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 8a04a703..355e5398 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -44,7 +44,7 @@ public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, D public var offsetHeight: Int32 public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift index bcb31442..a25fa7ac 100644 --- a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift @@ -17,7 +17,7 @@ public class HTMLEmbedElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift index 8fbf1301..9940e6e4 100644 --- a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -19,7 +19,7 @@ public class HTMLFieldSetElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLFontElement.swift b/Sources/DOMKit/WebIDL/HTMLFontElement.swift index 35705ab9..d62b84ed 100644 --- a/Sources/DOMKit/WebIDL/HTMLFontElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFontElement.swift @@ -14,7 +14,7 @@ public class HTMLFontElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index c1b8e1ad..4fda36eb 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -24,7 +24,7 @@ public class HTMLFormElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift index d09fd6e8..6d4f8801 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift @@ -21,7 +21,7 @@ public class HTMLFrameElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift index de652fa0..763b5112 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift @@ -13,7 +13,7 @@ public class HTMLFrameSetElement: HTMLElement, WindowEventHandlers { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLHRElement.swift b/Sources/DOMKit/WebIDL/HTMLHRElement.swift index ff15f0e5..db6538e4 100644 --- a/Sources/DOMKit/WebIDL/HTMLHRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHRElement.swift @@ -16,7 +16,7 @@ public class HTMLHRElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift index 3dcaeacc..eab63c43 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift @@ -11,6 +11,6 @@ public class HTMLHeadElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift index 6e38e2b5..53885f0a 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift @@ -12,7 +12,7 @@ public class HTMLHeadingElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift index c40ac636..f10821b2 100644 --- a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift @@ -12,7 +12,7 @@ public class HTMLHtmlElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index 479459c7..ebcc9d02 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -35,7 +35,7 @@ public class HTMLIFrameElement: HTMLElement { public var csp: String public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index 91bc1571..1b55f05f 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -43,7 +43,7 @@ public class HTMLImageElement: HTMLElement { public var y: Int32 public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index 2fbab19e..da90e148 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -68,7 +68,7 @@ public class HTMLInputElement: HTMLElement { public var capture: String public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLLIElement.swift b/Sources/DOMKit/WebIDL/HTMLLIElement.swift index 7171d8fb..5423cf81 100644 --- a/Sources/DOMKit/WebIDL/HTMLLIElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLIElement.swift @@ -13,7 +13,7 @@ public class HTMLLIElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift index de874502..393a390e 100644 --- a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift @@ -14,7 +14,7 @@ public class HTMLLabelElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift index e1243c59..add0602d 100644 --- a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift @@ -13,7 +13,7 @@ public class HTMLLegendElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift index bbc3e1c5..706dc47d 100644 --- a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift @@ -30,7 +30,7 @@ public class HTMLLinkElement: HTMLElement, LinkStyle { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLMapElement.swift b/Sources/DOMKit/WebIDL/HTMLMapElement.swift index 4f8e9612..4aa4e82e 100644 --- a/Sources/DOMKit/WebIDL/HTMLMapElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMapElement.swift @@ -13,7 +13,7 @@ public class HTMLMapElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift index 2a1d0f55..b4f682eb 100644 --- a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift @@ -22,7 +22,7 @@ public class HTMLMarqueeElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift index d4bb4511..759f9a04 100644 --- a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift @@ -12,7 +12,7 @@ public class HTMLMenuElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift index a64ed56e..1cf7e31a 100644 --- a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift @@ -16,7 +16,7 @@ public class HTMLMetaElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift index b55d1e87..03302c26 100644 --- a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift @@ -18,7 +18,7 @@ public class HTMLMeterElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLModElement.swift b/Sources/DOMKit/WebIDL/HTMLModElement.swift index 852ac19d..8f718aea 100644 --- a/Sources/DOMKit/WebIDL/HTMLModElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLModElement.swift @@ -13,7 +13,7 @@ public class HTMLModElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOListElement.swift b/Sources/DOMKit/WebIDL/HTMLOListElement.swift index bf6586b8..c4c9a236 100644 --- a/Sources/DOMKit/WebIDL/HTMLOListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOListElement.swift @@ -15,7 +15,7 @@ public class HTMLOListElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift index 17a8d59d..75a48dc8 100644 --- a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -33,7 +33,7 @@ public class HTMLObjectElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift index e59c8668..b31dd183 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift @@ -13,7 +13,7 @@ public class HTMLOptGroupElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift index c4db0b18..8e4b9a80 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift @@ -19,7 +19,7 @@ public class HTMLOptionElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift index b95cda9f..9473c2ce 100644 --- a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -21,7 +21,7 @@ public class HTMLOutputElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift index 37350847..9141cc30 100644 --- a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift @@ -12,7 +12,7 @@ public class HTMLParagraphElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLParamElement.swift b/Sources/DOMKit/WebIDL/HTMLParamElement.swift index 1d0d636d..ebb1f0b4 100644 --- a/Sources/DOMKit/WebIDL/HTMLParamElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParamElement.swift @@ -15,7 +15,7 @@ public class HTMLParamElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift index b1596736..6f6c8898 100644 --- a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift @@ -11,6 +11,6 @@ public class HTMLPictureElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift index fccbd9c0..308f20aa 100644 --- a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift @@ -15,7 +15,7 @@ public class HTMLPortalElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLPreElement.swift b/Sources/DOMKit/WebIDL/HTMLPreElement.swift index 322d10ae..f409b7d4 100644 --- a/Sources/DOMKit/WebIDL/HTMLPreElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPreElement.swift @@ -12,7 +12,7 @@ public class HTMLPreElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift index a57c3def..6b157fbd 100644 --- a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift @@ -15,7 +15,7 @@ public class HTMLProgressElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift index 9f2ae264..ba97282f 100644 --- a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift @@ -12,7 +12,7 @@ public class HTMLQuoteElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift index 0dee69a4..ddeb459d 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -25,7 +25,7 @@ public class HTMLScriptElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index 23824109..b6344302 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -28,7 +28,7 @@ public class HTMLSelectElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index 0e7fe50e..6d54db1f 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -12,7 +12,7 @@ public class HTMLSlotElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift index 405e9561..77f2f237 100644 --- a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift @@ -18,7 +18,7 @@ public class HTMLSourceElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift index 19832ba4..fbdf0b54 100644 --- a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift @@ -11,6 +11,6 @@ public class HTMLSpanElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift index 2b527259..9faa5601 100644 --- a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift @@ -14,7 +14,7 @@ public class HTMLStyleElement: HTMLElement, LinkStyle { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift index f7aac0aa..e280f8c9 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift @@ -12,7 +12,7 @@ public class HTMLTableCaptionElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift index a1892204..e6b17aca 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift @@ -26,7 +26,7 @@ public class HTMLTableCellElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift index d1dc0ca3..e58c4de8 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift @@ -17,7 +17,7 @@ public class HTMLTableColElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift index 69d66f3e..81934e79 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -25,7 +25,7 @@ public class HTMLTableElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift index 988b103c..bac2527f 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -19,7 +19,7 @@ public class HTMLTableRowElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift index 69978c32..30a551a8 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -16,7 +16,7 @@ public class HTMLTableSectionElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift index 4d16b1d4..3cca7679 100644 --- a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift @@ -12,7 +12,7 @@ public class HTMLTemplateElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift index 4d64c83e..97cfdcd3 100644 --- a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -35,7 +35,7 @@ public class HTMLTextAreaElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift index 33b38c8c..9dbe58d8 100644 --- a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift @@ -12,7 +12,7 @@ public class HTMLTimeElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift index ae8235b8..37811dd5 100644 --- a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift @@ -12,7 +12,7 @@ public class HTMLTitleElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift index 1ec5ddca..4f0b260e 100644 --- a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift @@ -18,7 +18,7 @@ public class HTMLTrackElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLUListElement.swift b/Sources/DOMKit/WebIDL/HTMLUListElement.swift index 8c266854..bbf04bf8 100644 --- a/Sources/DOMKit/WebIDL/HTMLUListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUListElement.swift @@ -13,7 +13,7 @@ public class HTMLUListElement: HTMLElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 2702a6e7..19f9ee64 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -21,7 +21,7 @@ public class HTMLVideoElement: HTMLMediaElement { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HashChangeEvent.swift b/Sources/DOMKit/WebIDL/HashChangeEvent.swift index 48c723a7..5d2a5ece 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEvent.swift @@ -13,7 +13,7 @@ public class HashChangeEvent: Event { } public convenience init(type: String, eventInitDict: HashChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift index 9b90dd0b..894b7f08 100644 --- a/Sources/DOMKit/WebIDL/Headers.swift +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -13,7 +13,7 @@ public class Headers: JSBridgedClass, Sequence { } public convenience init(init: HeadersInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } public func append(name: String, value: String) { diff --git a/Sources/DOMKit/WebIDL/Highlight.swift b/Sources/DOMKit/WebIDL/Highlight.swift index 7b599c48..a9e223fd 100644 --- a/Sources/DOMKit/WebIDL/Highlight.swift +++ b/Sources/DOMKit/WebIDL/Highlight.swift @@ -15,7 +15,7 @@ public class Highlight: JSBridgedClass { } public convenience init(initialRanges: AbstractRange...) { - self.init(unsafelyWrapping: Self.constructor.new(initialRanges.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: initialRanges.map { $0.jsValue() })) } // XXX: make me Set-like! diff --git a/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift b/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift index 9633037f..562a2338 100644 --- a/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift @@ -13,7 +13,7 @@ public class IDBVersionChangeEvent: Event { } public convenience init(type: String, eventInitDict: IDBVersionChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/IIRFilterNode.swift b/Sources/DOMKit/WebIDL/IIRFilterNode.swift index b051e934..438f304f 100644 --- a/Sources/DOMKit/WebIDL/IIRFilterNode.swift +++ b/Sources/DOMKit/WebIDL/IIRFilterNode.swift @@ -11,7 +11,7 @@ public class IIRFilterNode: AudioNode { } public convenience init(context: BaseAudioContext, options: IIRFilterOptions) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) } public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { diff --git a/Sources/DOMKit/WebIDL/IdleDetector.swift b/Sources/DOMKit/WebIDL/IdleDetector.swift index ca373f62..32b4a84a 100644 --- a/Sources/DOMKit/WebIDL/IdleDetector.swift +++ b/Sources/DOMKit/WebIDL/IdleDetector.swift @@ -14,7 +14,7 @@ public class IdleDetector: EventTarget { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ImageCapture.swift b/Sources/DOMKit/WebIDL/ImageCapture.swift index 23fead84..be06815a 100644 --- a/Sources/DOMKit/WebIDL/ImageCapture.swift +++ b/Sources/DOMKit/WebIDL/ImageCapture.swift @@ -14,7 +14,7 @@ public class ImageCapture: JSBridgedClass { } public convenience init(videoTrack: MediaStreamTrack) { - self.init(unsafelyWrapping: Self.constructor.new(videoTrack.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [videoTrack.jsValue()])) } public func takePhoto(photoSettings: PhotoSettings? = nil) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/ImageData.swift b/Sources/DOMKit/WebIDL/ImageData.swift index d8ee1102..8501e905 100644 --- a/Sources/DOMKit/WebIDL/ImageData.swift +++ b/Sources/DOMKit/WebIDL/ImageData.swift @@ -17,11 +17,11 @@ public class ImageData: JSBridgedClass { } public convenience init(sw: UInt32, sh: UInt32, settings: ImageDataSettings? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined])) } public convenience init(data: Uint8ClampedArray, sw: UInt32, sh: UInt32? = nil, settings: ImageDataSettings? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(data.jsValue(), sw.jsValue(), sh?.jsValue() ?? .undefined, settings?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue(), sw.jsValue(), sh?.jsValue() ?? .undefined, settings?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ImageDecoder.swift b/Sources/DOMKit/WebIDL/ImageDecoder.swift index 89294264..9a8963eb 100644 --- a/Sources/DOMKit/WebIDL/ImageDecoder.swift +++ b/Sources/DOMKit/WebIDL/ImageDecoder.swift @@ -17,7 +17,7 @@ public class ImageDecoder: JSBridgedClass { } public convenience init(init: ImageDecoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift b/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift index 963c980b..b2ca736b 100644 --- a/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift +++ b/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift @@ -15,7 +15,7 @@ public class InputDeviceCapabilities: JSBridgedClass { } public convenience init(deviceInitDict: InputDeviceCapabilitiesInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(deviceInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index a59a3492..266ca794 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -23,7 +23,7 @@ public class InputEvent: UIEvent { } public convenience init(type: String, eventInitDict: InputEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Instance.swift b/Sources/DOMKit/WebIDL/Instance.swift index 6af9d169..9be31e8f 100644 --- a/Sources/DOMKit/WebIDL/Instance.swift +++ b/Sources/DOMKit/WebIDL/Instance.swift @@ -14,7 +14,7 @@ public class Instance: JSBridgedClass { } public convenience init(module: Module, importObject: JSObject? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(module.jsValue(), importObject?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [module.jsValue(), importObject?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift b/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift index 4538e786..9ffa9806 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift @@ -20,7 +20,7 @@ public class IntersectionObserverEntry: JSBridgedClass { } public convenience init(intersectionObserverEntryInit: IntersectionObserverEntryInit) { - self.init(unsafelyWrapping: Self.constructor.new(intersectionObserverEntryInit.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [intersectionObserverEntryInit.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index b8ae2b3f..39a83c59 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -22,7 +22,7 @@ public class KeyboardEvent: UIEvent { } public convenience init(type: String, eventInitDict: KeyboardEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } public static let DOM_KEY_LOCATION_STANDARD: UInt32 = 0x00 diff --git a/Sources/DOMKit/WebIDL/KeyframeEffect.swift b/Sources/DOMKit/WebIDL/KeyframeEffect.swift index 9fd39a4d..3a948a40 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffect.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffect.swift @@ -18,11 +18,11 @@ public class KeyframeEffect: AnimationEffect { public var iterationComposite: IterationCompositeOperation public convenience init(target: Element?, keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(target.jsValue(), keyframes.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [target.jsValue(), keyframes.jsValue(), options?.jsValue() ?? .undefined])) } public convenience init(source: KeyframeEffect) { - self.init(unsafelyWrapping: Self.constructor.new(source.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift b/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift index f6aebad2..9da9bbc1 100644 --- a/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift +++ b/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift @@ -11,6 +11,6 @@ public class LinearAccelerationSensor: Accelerometer { } public convenience init(options: AccelerometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift b/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift index 19a1b036..8a5e4ce2 100644 --- a/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift +++ b/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift @@ -12,7 +12,7 @@ public class MIDIConnectionEvent: Event { } public convenience init(type: String, eventInitDict: MIDIConnectionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift b/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift index 7ce4588f..e67135b6 100644 --- a/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift @@ -12,7 +12,7 @@ public class MIDIMessageEvent: Event { } public convenience init(type: String, eventInitDict: MIDIMessageEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift index a2dfd734..0fc99b11 100644 --- a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift +++ b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift @@ -13,7 +13,7 @@ public class MLGraphBuilder: JSBridgedClass { } public convenience init(context: MLContext) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue()])) } public func input(name: String, desc: MLOperandDescriptor) -> MLOperand { diff --git a/Sources/DOMKit/WebIDL/Magnetometer.swift b/Sources/DOMKit/WebIDL/Magnetometer.swift index a02ac8be..cf630ff6 100644 --- a/Sources/DOMKit/WebIDL/Magnetometer.swift +++ b/Sources/DOMKit/WebIDL/Magnetometer.swift @@ -14,7 +14,7 @@ public class Magnetometer: Sensor { } public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift index 3b529935..f0bc10c6 100644 --- a/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift +++ b/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift @@ -12,7 +12,7 @@ public class MediaElementAudioSourceNode: AudioNode { } public convenience init(context: AudioContext, options: MediaElementAudioSourceOptions) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift b/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift index 6b826327..48fe7a6d 100644 --- a/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift @@ -13,7 +13,7 @@ public class MediaEncryptedEvent: Event { } public convenience init(type: String, eventInitDict: MediaEncryptedEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift index b24eda4e..c4e3ee12 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift @@ -13,7 +13,7 @@ public class MediaKeyMessageEvent: Event { } public convenience init(type: String, eventInitDict: MediaKeyMessageEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaMetadata.swift b/Sources/DOMKit/WebIDL/MediaMetadata.swift index dbe2545e..567736fe 100644 --- a/Sources/DOMKit/WebIDL/MediaMetadata.swift +++ b/Sources/DOMKit/WebIDL/MediaMetadata.swift @@ -17,7 +17,7 @@ public class MediaMetadata: JSBridgedClass { } public convenience init(init: MediaMetadataInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift b/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift index 8689fe59..91027d22 100644 --- a/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift @@ -13,7 +13,7 @@ public class MediaQueryListEvent: Event { } public convenience init(type: String, eventInitDict: MediaQueryListEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaRecorder.swift b/Sources/DOMKit/WebIDL/MediaRecorder.swift index 2076a5b1..80cc48b9 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorder.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorder.swift @@ -23,7 +23,7 @@ public class MediaRecorder: EventTarget { } public convenience init(stream: MediaStream, options: MediaRecorderOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift b/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift index 2d52ab16..600e653a 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift @@ -12,7 +12,7 @@ public class MediaRecorderErrorEvent: Event { } public convenience init(type: String, eventInitDict: MediaRecorderErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaSource.swift b/Sources/DOMKit/WebIDL/MediaSource.swift index 2fe5382c..a784540f 100644 --- a/Sources/DOMKit/WebIDL/MediaSource.swift +++ b/Sources/DOMKit/WebIDL/MediaSource.swift @@ -19,7 +19,7 @@ public class MediaSource: EventTarget { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStream.swift b/Sources/DOMKit/WebIDL/MediaStream.swift index 3d6d7287..230533a0 100644 --- a/Sources/DOMKit/WebIDL/MediaStream.swift +++ b/Sources/DOMKit/WebIDL/MediaStream.swift @@ -15,15 +15,15 @@ public class MediaStream: EventTarget { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public convenience init(stream: MediaStream) { - self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) } public convenience init(tracks: [MediaStreamTrack]) { - self.init(unsafelyWrapping: Self.constructor.new(tracks.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [tracks.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift index 48f8a297..39756616 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift @@ -12,7 +12,7 @@ public class MediaStreamAudioDestinationNode: AudioNode { } public convenience init(context: AudioContext, options: AudioNodeOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift index 40c5e835..cc22efa1 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift @@ -12,7 +12,7 @@ public class MediaStreamAudioSourceNode: AudioNode { } public convenience init(context: AudioContext, options: MediaStreamAudioSourceOptions) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift index 4f868846..531c2bd5 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift @@ -11,6 +11,6 @@ public class MediaStreamTrackAudioSourceNode: AudioNode { } public convenience init(context: AudioContext, options: MediaStreamTrackAudioSourceOptions) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) } } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift index 49dde61b..a3354c87 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift @@ -12,7 +12,7 @@ public class MediaStreamTrackEvent: Event { } public convenience init(type: String, eventInitDict: MediaStreamTrackEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift index b22f23c7..f371c691 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift @@ -14,7 +14,7 @@ public class MediaStreamTrackProcessor: JSBridgedClass { } public convenience init(init: MediaStreamTrackProcessorInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/Memory.swift b/Sources/DOMKit/WebIDL/Memory.swift index 401b7555..5ef148df 100644 --- a/Sources/DOMKit/WebIDL/Memory.swift +++ b/Sources/DOMKit/WebIDL/Memory.swift @@ -14,7 +14,7 @@ public class Memory: JSBridgedClass { } public convenience init(descriptor: MemoryDescriptor) { - self.init(unsafelyWrapping: Self.constructor.new(descriptor.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue()])) } public func grow(delta: UInt32) -> UInt32 { diff --git a/Sources/DOMKit/WebIDL/MessageChannel.swift b/Sources/DOMKit/WebIDL/MessageChannel.swift index 477d7f6f..d22a3f7c 100644 --- a/Sources/DOMKit/WebIDL/MessageChannel.swift +++ b/Sources/DOMKit/WebIDL/MessageChannel.swift @@ -15,7 +15,7 @@ public class MessageChannel: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift index afbd5c88..fb9e31fa 100644 --- a/Sources/DOMKit/WebIDL/MessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -16,7 +16,7 @@ public class MessageEvent: Event { } public convenience init(type: String, eventInitDict: MessageEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Module.swift b/Sources/DOMKit/WebIDL/Module.swift index 5def7ead..cd7303c4 100644 --- a/Sources/DOMKit/WebIDL/Module.swift +++ b/Sources/DOMKit/WebIDL/Module.swift @@ -13,7 +13,7 @@ public class Module: JSBridgedClass { } public convenience init(bytes: BufferSource) { - self.init(unsafelyWrapping: Self.constructor.new(bytes.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [bytes.jsValue()])) } public static func exports(moduleObject: Module) -> [ModuleExportDescriptor] { diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index 286ee3b6..5880c516 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -54,7 +54,7 @@ public class MouseEvent: UIEvent { public var movementY: Double public convenience init(type: String, eventInitDict: MouseEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NDEFMessage.swift b/Sources/DOMKit/WebIDL/NDEFMessage.swift index f4ed9e3b..eba2d85b 100644 --- a/Sources/DOMKit/WebIDL/NDEFMessage.swift +++ b/Sources/DOMKit/WebIDL/NDEFMessage.swift @@ -14,7 +14,7 @@ public class NDEFMessage: JSBridgedClass { } public convenience init(messageInit: NDEFMessageInit) { - self.init(unsafelyWrapping: Self.constructor.new(messageInit.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [messageInit.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NDEFReader.swift b/Sources/DOMKit/WebIDL/NDEFReader.swift index 2a219425..bbb51474 100644 --- a/Sources/DOMKit/WebIDL/NDEFReader.swift +++ b/Sources/DOMKit/WebIDL/NDEFReader.swift @@ -13,7 +13,7 @@ public class NDEFReader: EventTarget { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift b/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift index 01327c0e..b9a06fe7 100644 --- a/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift +++ b/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift @@ -13,7 +13,7 @@ public class NDEFReadingEvent: Event { } public convenience init(type: String, readingEventInitDict: NDEFReadingEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), readingEventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), readingEventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NDEFRecord.swift b/Sources/DOMKit/WebIDL/NDEFRecord.swift index b49d7d02..5a1d8df4 100644 --- a/Sources/DOMKit/WebIDL/NDEFRecord.swift +++ b/Sources/DOMKit/WebIDL/NDEFRecord.swift @@ -19,7 +19,7 @@ public class NDEFRecord: JSBridgedClass { } public convenience init(recordInit: NDEFRecordInit) { - self.init(unsafelyWrapping: Self.constructor.new(recordInit.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [recordInit.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NavigateEvent.swift b/Sources/DOMKit/WebIDL/NavigateEvent.swift index 1baaabc1..21ae0cd8 100644 --- a/Sources/DOMKit/WebIDL/NavigateEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigateEvent.swift @@ -19,7 +19,7 @@ public class NavigateEvent: Event { } public convenience init(type: String, eventInit: NavigateEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInit.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInit.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift index 2298d090..14cd1c73 100644 --- a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift @@ -13,7 +13,7 @@ public class NavigationCurrentEntryChangeEvent: Event { } public convenience init(type: String, eventInit: NavigationCurrentEntryChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInit.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInit.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NavigationEvent.swift b/Sources/DOMKit/WebIDL/NavigationEvent.swift index 3786eaba..551f5958 100644 --- a/Sources/DOMKit/WebIDL/NavigationEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigationEvent.swift @@ -13,7 +13,7 @@ public class NavigationEvent: UIEvent { } public convenience init(type: String, eventInitDict: NavigationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Notification.swift b/Sources/DOMKit/WebIDL/Notification.swift index f8390437..cfbbc09b 100644 --- a/Sources/DOMKit/WebIDL/Notification.swift +++ b/Sources/DOMKit/WebIDL/Notification.swift @@ -32,7 +32,7 @@ public class Notification: EventTarget { } public convenience init(title: String, options: NotificationOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(title.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [title.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NotificationEvent.swift b/Sources/DOMKit/WebIDL/NotificationEvent.swift index 0878614f..eab93d62 100644 --- a/Sources/DOMKit/WebIDL/NotificationEvent.swift +++ b/Sources/DOMKit/WebIDL/NotificationEvent.swift @@ -13,7 +13,7 @@ public class NotificationEvent: ExtendableEvent { } public convenience init(type: String, eventInitDict: NotificationEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift index d7b48ee9..c4319072 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift @@ -12,7 +12,7 @@ public class OfflineAudioCompletionEvent: Event { } public convenience init(type: String, eventInitDict: OfflineAudioCompletionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift index 3a4111a1..d78bc25a 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift @@ -13,11 +13,11 @@ public class OfflineAudioContext: BaseAudioContext { } public convenience init(contextOptions: OfflineAudioContextOptions) { - self.init(unsafelyWrapping: Self.constructor.new(contextOptions.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions.jsValue()])) } public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { - self.init(unsafelyWrapping: Self.constructor.new(numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue()])) } public func startRendering() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift index 3d6ac04b..8c2ad9e6 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -15,7 +15,7 @@ public class OffscreenCanvas: EventTarget { } public convenience init(width: UInt64, height: UInt64) { - self.init(unsafelyWrapping: Self.constructor.new(width.jsValue(), height.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [width.jsValue(), height.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/OscillatorNode.swift b/Sources/DOMKit/WebIDL/OscillatorNode.swift index 0bae167f..db87504f 100644 --- a/Sources/DOMKit/WebIDL/OscillatorNode.swift +++ b/Sources/DOMKit/WebIDL/OscillatorNode.swift @@ -14,7 +14,7 @@ public class OscillatorNode: AudioScheduledSourceNode { } public convenience init(context: BaseAudioContext, options: OscillatorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/OverconstrainedError.swift b/Sources/DOMKit/WebIDL/OverconstrainedError.swift index f1b10559..efae7fd2 100644 --- a/Sources/DOMKit/WebIDL/OverconstrainedError.swift +++ b/Sources/DOMKit/WebIDL/OverconstrainedError.swift @@ -12,7 +12,7 @@ public class OverconstrainedError: DOMException { } public convenience init(constraint: String, message: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(constraint.jsValue(), message?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [constraint.jsValue(), message?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift index 3ca180f5..fda527ac 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift @@ -12,7 +12,7 @@ public class PageTransitionEvent: Event { } public convenience init(type: String, eventInitDict: PageTransitionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PannerNode.swift b/Sources/DOMKit/WebIDL/PannerNode.swift index 66898721..962f22ae 100644 --- a/Sources/DOMKit/WebIDL/PannerNode.swift +++ b/Sources/DOMKit/WebIDL/PannerNode.swift @@ -25,7 +25,7 @@ public class PannerNode: AudioNode { } public convenience init(context: BaseAudioContext, options: PannerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/PasswordCredential.swift b/Sources/DOMKit/WebIDL/PasswordCredential.swift index 4a93e68f..bddb48d1 100644 --- a/Sources/DOMKit/WebIDL/PasswordCredential.swift +++ b/Sources/DOMKit/WebIDL/PasswordCredential.swift @@ -12,11 +12,11 @@ public class PasswordCredential: Credential, CredentialUserData { } public convenience init(form: HTMLFormElement) { - self.init(unsafelyWrapping: Self.constructor.new(form.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [form.jsValue()])) } public convenience init(data: PasswordCredentialData) { - self.init(unsafelyWrapping: Self.constructor.new(data.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index 0cd9d6ce..531e9f40 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -13,7 +13,7 @@ public class Path2D: JSBridgedClass, CanvasPath { } public convenience init(path: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(path?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [path?.jsValue() ?? .undefined])) } public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { diff --git a/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift b/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift index 363bdc23..681e2d36 100644 --- a/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift @@ -13,7 +13,7 @@ public class PaymentMethodChangeEvent: PaymentRequestUpdateEvent { } public convenience init(type: String, eventInitDict: PaymentMethodChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PaymentRequest.swift b/Sources/DOMKit/WebIDL/PaymentRequest.swift index 371befed..9c40d8b4 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequest.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequest.swift @@ -13,7 +13,7 @@ public class PaymentRequest: EventTarget { } public convenience init(methodData: [PaymentMethodData], details: PaymentDetailsInit) { - self.init(unsafelyWrapping: Self.constructor.new(methodData.jsValue(), details.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [methodData.jsValue(), details.jsValue()])) } public func show(detailsPromise: JSPromise? = nil) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift index 8685ed9e..a57a0f58 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift @@ -17,7 +17,7 @@ public class PaymentRequestEvent: ExtendableEvent { } public convenience init(type: String, eventInitDict: PaymentRequestEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift index 6d4827ed..e86b0254 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift @@ -11,7 +11,7 @@ public class PaymentRequestUpdateEvent: Event { } public convenience init(type: String, eventInitDict: PaymentRequestUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } public func updateWith(detailsPromise: JSPromise) { diff --git a/Sources/DOMKit/WebIDL/PerformanceMark.swift b/Sources/DOMKit/WebIDL/PerformanceMark.swift index e609ef4f..e51e2c3a 100644 --- a/Sources/DOMKit/WebIDL/PerformanceMark.swift +++ b/Sources/DOMKit/WebIDL/PerformanceMark.swift @@ -12,7 +12,7 @@ public class PerformanceMark: PerformanceEntry { } public convenience init(markName: String, markOptions: PerformanceMarkOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(markName.jsValue(), markOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [markName.jsValue(), markOptions?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift b/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift index 62e92235..a1ad12dd 100644 --- a/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift +++ b/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift @@ -12,7 +12,7 @@ public class PeriodicSyncEvent: ExtendableEvent { } public convenience init(type: String, init: PeriodicSyncEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PeriodicWave.swift b/Sources/DOMKit/WebIDL/PeriodicWave.swift index 5309e2ae..e4e8e594 100644 --- a/Sources/DOMKit/WebIDL/PeriodicWave.swift +++ b/Sources/DOMKit/WebIDL/PeriodicWave.swift @@ -13,6 +13,6 @@ public class PeriodicWave: JSBridgedClass { } public convenience init(context: BaseAudioContext, options: PeriodicWaveOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift b/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift index fa54505e..43fe0608 100644 --- a/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift +++ b/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift @@ -12,7 +12,7 @@ public class PictureInPictureEvent: Event { } public convenience init(type: String, eventInitDict: PictureInPictureEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PointerEvent.swift b/Sources/DOMKit/WebIDL/PointerEvent.swift index ae5af0f9..9a7e98df 100644 --- a/Sources/DOMKit/WebIDL/PointerEvent.swift +++ b/Sources/DOMKit/WebIDL/PointerEvent.swift @@ -23,7 +23,7 @@ public class PointerEvent: MouseEvent { } public convenience init(type: String, eventInitDict: PointerEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PopStateEvent.swift b/Sources/DOMKit/WebIDL/PopStateEvent.swift index e3427a19..a3e99cd0 100644 --- a/Sources/DOMKit/WebIDL/PopStateEvent.swift +++ b/Sources/DOMKit/WebIDL/PopStateEvent.swift @@ -12,7 +12,7 @@ public class PopStateEvent: Event { } public convenience init(type: String, eventInitDict: PopStateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift index 26db38cd..7a9bf137 100644 --- a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift +++ b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift @@ -12,7 +12,7 @@ public class PortalActivateEvent: Event { } public convenience init(type: String, eventInitDict: PortalActivateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift index 88c3799a..ba2dfac9 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift @@ -12,7 +12,7 @@ public class PresentationConnectionAvailableEvent: Event { } public convenience init(type: String, eventInitDict: PresentationConnectionAvailableEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift index 2d404824..09650da9 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift @@ -13,7 +13,7 @@ public class PresentationConnectionCloseEvent: Event { } public convenience init(type: String, eventInitDict: PresentationConnectionCloseEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PresentationRequest.swift b/Sources/DOMKit/WebIDL/PresentationRequest.swift index 7fc741c2..b6b558b4 100644 --- a/Sources/DOMKit/WebIDL/PresentationRequest.swift +++ b/Sources/DOMKit/WebIDL/PresentationRequest.swift @@ -12,11 +12,11 @@ public class PresentationRequest: EventTarget { } public convenience init(url: String) { - self.init(unsafelyWrapping: Self.constructor.new(url.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue()])) } public convenience init(urls: [String]) { - self.init(unsafelyWrapping: Self.constructor.new(urls.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [urls.jsValue()])) } public func start() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/Profiler.swift b/Sources/DOMKit/WebIDL/Profiler.swift index 2761f53a..65bf3b5a 100644 --- a/Sources/DOMKit/WebIDL/Profiler.swift +++ b/Sources/DOMKit/WebIDL/Profiler.swift @@ -19,7 +19,7 @@ public class Profiler: EventTarget { public var stopped: Bool public convenience init(options: ProfilerInitOptions) { - self.init(unsafelyWrapping: Self.constructor.new(options.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue()])) } public func stop() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/ProgressEvent.swift b/Sources/DOMKit/WebIDL/ProgressEvent.swift index 8c29310b..b58073ae 100644 --- a/Sources/DOMKit/WebIDL/ProgressEvent.swift +++ b/Sources/DOMKit/WebIDL/ProgressEvent.swift @@ -14,7 +14,7 @@ public class ProgressEvent: Event { } public convenience init(type: String, eventInitDict: ProgressEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift index 802aeb96..62c74c6b 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift @@ -13,7 +13,7 @@ public class PromiseRejectionEvent: Event { } public convenience init(type: String, eventInitDict: PromiseRejectionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ProximitySensor.swift b/Sources/DOMKit/WebIDL/ProximitySensor.swift index 387625c4..dd77bb00 100644 --- a/Sources/DOMKit/WebIDL/ProximitySensor.swift +++ b/Sources/DOMKit/WebIDL/ProximitySensor.swift @@ -14,7 +14,7 @@ public class ProximitySensor: Sensor { } public convenience init(sensorOptions: SensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PushEvent.swift b/Sources/DOMKit/WebIDL/PushEvent.swift index 79d8c37f..334f9658 100644 --- a/Sources/DOMKit/WebIDL/PushEvent.swift +++ b/Sources/DOMKit/WebIDL/PushEvent.swift @@ -12,7 +12,7 @@ public class PushEvent: ExtendableEvent { } public convenience init(type: String, eventInitDict: PushEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift index 19742e6d..4b255a90 100644 --- a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift @@ -13,7 +13,7 @@ public class PushSubscriptionChangeEvent: ExtendableEvent { } public convenience init(type: String, eventInitDict: PushSubscriptionChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift index 171b8342..87611d9f 100644 --- a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift @@ -12,7 +12,7 @@ public class RTCDTMFToneChangeEvent: Event { } public convenience init(type: String, eventInitDict: RTCDTMFToneChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift b/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift index 3be248d9..803f53c4 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift @@ -12,7 +12,7 @@ public class RTCDataChannelEvent: Event { } public convenience init(type: String, eventInitDict: RTCDataChannelEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCError.swift b/Sources/DOMKit/WebIDL/RTCError.swift index e671b694..234fea76 100644 --- a/Sources/DOMKit/WebIDL/RTCError.swift +++ b/Sources/DOMKit/WebIDL/RTCError.swift @@ -20,7 +20,7 @@ public class RTCError: DOMException { public var httpRequestStatusCode: Int32? public convenience init(init: RTCErrorInit, message: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue(), message?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue(), message?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCErrorEvent.swift index b293a54b..7ae49d81 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorEvent.swift @@ -12,7 +12,7 @@ public class RTCErrorEvent: Event { } public convenience init(type: String, eventInitDict: RTCErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift index 87040382..8081ad46 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift @@ -27,7 +27,7 @@ public class RTCIceCandidate: JSBridgedClass { } public convenience init(candidateInitDict: RTCIceCandidateInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(candidateInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [candidateInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCIceTransport.swift b/Sources/DOMKit/WebIDL/RTCIceTransport.swift index 8e7b0a91..c8eb263f 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransport.swift @@ -20,7 +20,7 @@ public class RTCIceTransport: EventTarget { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public func gather(options: RTCIceGatherOptions? = nil) { diff --git a/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift b/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift index 4a752f71..e80ed4fc 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift @@ -15,7 +15,7 @@ public class RTCIdentityAssertion: JSBridgedClass { } public convenience init(idp: String, name: String) { - self.init(unsafelyWrapping: Self.constructor.new(idp.jsValue(), name.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [idp.jsValue(), name.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift index 10d8257c..f6677794 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift @@ -61,7 +61,7 @@ public class RTCPeerConnection: EventTarget { public var idpErrorInfo: String? public convenience init(configuration: RTCConfiguration? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(configuration?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration?.jsValue() ?? .undefined])) } // XXX: member 'createOffer' is ignored diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift index eaf75240..72c83081 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift @@ -16,7 +16,7 @@ public class RTCPeerConnectionIceErrorEvent: Event { } public convenience init(type: String, eventInitDict: RTCPeerConnectionIceErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift index fbf44eef..7c617b68 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift @@ -13,7 +13,7 @@ public class RTCPeerConnectionIceEvent: Event { } public convenience init(type: String, eventInitDict: RTCPeerConnectionIceEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift index db93f640..9bdf3866 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift @@ -13,6 +13,6 @@ public class RTCRtpScriptTransform: JSBridgedClass { } public convenience init(worker: Worker, options: JSValue? = nil, transfer: [JSObject]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(worker.jsValue(), options?.jsValue() ?? .undefined, transfer?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [worker.jsValue(), options?.jsValue() ?? .undefined, transfer?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift index d39b9328..a0f812ed 100644 --- a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift +++ b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift @@ -15,7 +15,7 @@ public class RTCSessionDescription: JSBridgedClass { } public convenience init(descriptionInitDict: RTCSessionDescriptionInit) { - self.init(unsafelyWrapping: Self.constructor.new(descriptionInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptionInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCTrackEvent.swift b/Sources/DOMKit/WebIDL/RTCTrackEvent.swift index 04a7c8d5..748e7a9b 100644 --- a/Sources/DOMKit/WebIDL/RTCTrackEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCTrackEvent.swift @@ -15,7 +15,7 @@ public class RTCTrackEvent: Event { } public convenience init(type: String, eventInitDict: RTCTrackEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 3dab8376..e19240f3 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -27,7 +27,7 @@ public class Range: AbstractRange { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ReadableStream.swift b/Sources/DOMKit/WebIDL/ReadableStream.swift index b27106a7..34a6d0b0 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -14,7 +14,7 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { } public convenience init(underlyingSource: JSObject? = nil, strategy: QueuingStrategy? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(underlyingSource?.jsValue() ?? .undefined, strategy?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [underlyingSource?.jsValue() ?? .undefined, strategy?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift index e871b969..5c6e0b76 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -13,7 +13,7 @@ public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericRead } public convenience init(stream: ReadableStream) { - self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) } public func read(view: ArrayBufferView) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift index 65d49c84..73593a6d 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -13,7 +13,7 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR } public convenience init(stream: ReadableStream) { - self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) } public func read() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift b/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift index 613b4931..fe402b89 100644 --- a/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift +++ b/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift @@ -11,6 +11,6 @@ public class RelativeOrientationSensor: OrientationSensor { } public convenience init(sensorOptions: OrientationSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift index 22b254fc..7bd42c99 100644 --- a/Sources/DOMKit/WebIDL/Request.swift +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -29,7 +29,7 @@ public class Request: JSBridgedClass, Body { } public convenience init(input: RequestInfo, init: RequestInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(input.jsValue(), `init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [input.jsValue(), `init`?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Response.swift b/Sources/DOMKit/WebIDL/Response.swift index 318eac61..6f683511 100644 --- a/Sources/DOMKit/WebIDL/Response.swift +++ b/Sources/DOMKit/WebIDL/Response.swift @@ -20,7 +20,7 @@ public class Response: JSBridgedClass, Body { } public convenience init(body: BodyInit? = nil, init: ResponseInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(body?.jsValue() ?? .undefined, `init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [body?.jsValue() ?? .undefined, `init`?.jsValue() ?? .undefined])) } public static func error() -> Self { diff --git a/Sources/DOMKit/WebIDL/SFrameTransform.swift b/Sources/DOMKit/WebIDL/SFrameTransform.swift index 94ffef85..582b30da 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransform.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransform.swift @@ -14,7 +14,7 @@ public class SFrameTransform: JSBridgedClass, GenericTransformStream { } public convenience init(options: SFrameTransformOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift index ff16a18c..13ea8f2a 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift @@ -14,7 +14,7 @@ public class SFrameTransformErrorEvent: Event { } public convenience init(type: String, eventInitDict: SFrameTransformErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Sanitizer.swift b/Sources/DOMKit/WebIDL/Sanitizer.swift index 3e66ce20..98aebad1 100644 --- a/Sources/DOMKit/WebIDL/Sanitizer.swift +++ b/Sources/DOMKit/WebIDL/Sanitizer.swift @@ -13,7 +13,7 @@ public class Sanitizer: JSBridgedClass { } public convenience init(config: SanitizerConfig? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(config?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [config?.jsValue() ?? .undefined])) } public func sanitize(input: __UNSUPPORTED_UNION__) -> DocumentFragment { diff --git a/Sources/DOMKit/WebIDL/ScrollTimeline.swift b/Sources/DOMKit/WebIDL/ScrollTimeline.swift index 5e4b1baa..ba862e70 100644 --- a/Sources/DOMKit/WebIDL/ScrollTimeline.swift +++ b/Sources/DOMKit/WebIDL/ScrollTimeline.swift @@ -14,7 +14,7 @@ public class ScrollTimeline: AnimationTimeline { } public convenience init(options: ScrollTimelineOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift index d660e808..11682fd8 100644 --- a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift +++ b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift @@ -23,7 +23,7 @@ public class SecurityPolicyViolationEvent: Event { } public convenience init(type: String, eventInitDict: SecurityPolicyViolationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SensorErrorEvent.swift b/Sources/DOMKit/WebIDL/SensorErrorEvent.swift index 02de1367..da22fbb7 100644 --- a/Sources/DOMKit/WebIDL/SensorErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SensorErrorEvent.swift @@ -12,7 +12,7 @@ public class SensorErrorEvent: Event { } public convenience init(type: String, errorEventInitDict: SensorErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), errorEventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), errorEventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SequenceEffect.swift b/Sources/DOMKit/WebIDL/SequenceEffect.swift index b195361b..8410c752 100644 --- a/Sources/DOMKit/WebIDL/SequenceEffect.swift +++ b/Sources/DOMKit/WebIDL/SequenceEffect.swift @@ -11,7 +11,7 @@ public class SequenceEffect: GroupEffect { } public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(children.jsValue(), timing?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue(), timing?.jsValue() ?? .undefined])) } override public func clone() -> Self { diff --git a/Sources/DOMKit/WebIDL/ShadowAnimation.swift b/Sources/DOMKit/WebIDL/ShadowAnimation.swift index d4693a19..d7af4587 100644 --- a/Sources/DOMKit/WebIDL/ShadowAnimation.swift +++ b/Sources/DOMKit/WebIDL/ShadowAnimation.swift @@ -12,7 +12,7 @@ public class ShadowAnimation: Animation { } public convenience init(source: Animation, newTarget: __UNSUPPORTED_UNION__) { - self.init(unsafelyWrapping: Self.constructor.new(source.jsValue(), newTarget.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue(), newTarget.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SharedWorker.swift b/Sources/DOMKit/WebIDL/SharedWorker.swift index 2607f548..986ff6b6 100644 --- a/Sources/DOMKit/WebIDL/SharedWorker.swift +++ b/Sources/DOMKit/WebIDL/SharedWorker.swift @@ -12,7 +12,7 @@ public class SharedWorker: EventTarget, AbstractWorker { } public convenience init(scriptURL: String, options: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(scriptURL.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift index 555faddb..1a1844b3 100644 --- a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift +++ b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift @@ -14,7 +14,7 @@ public class SpeechGrammarList: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechRecognition.swift b/Sources/DOMKit/WebIDL/SpeechRecognition.swift index beaee50e..59c2a9d6 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognition.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognition.swift @@ -27,7 +27,7 @@ public class SpeechRecognition: EventTarget { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift index 6f2c3edc..4f9de7e7 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift @@ -13,7 +13,7 @@ public class SpeechRecognitionErrorEvent: Event { } public convenience init(type: String, eventInitDict: SpeechRecognitionErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift index 6b0c1598..8b9a8ab0 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift @@ -13,7 +13,7 @@ public class SpeechRecognitionEvent: Event { } public convenience init(type: String, eventInitDict: SpeechRecognitionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift index ca11a410..9ab811c2 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift @@ -12,7 +12,7 @@ public class SpeechSynthesisErrorEvent: SpeechSynthesisEvent { } public convenience init(type: String, eventInitDict: SpeechSynthesisErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift index 2921f8ff..362415cd 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift @@ -16,7 +16,7 @@ public class SpeechSynthesisEvent: Event { } public convenience init(type: String, eventInitDict: SpeechSynthesisEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift index 70b80113..f269ce92 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift @@ -24,7 +24,7 @@ public class SpeechSynthesisUtterance: EventTarget { } public convenience init(text: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(text?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [text?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/StaticRange.swift b/Sources/DOMKit/WebIDL/StaticRange.swift index 84ef8e5b..8d8a5741 100644 --- a/Sources/DOMKit/WebIDL/StaticRange.swift +++ b/Sources/DOMKit/WebIDL/StaticRange.swift @@ -11,6 +11,6 @@ public class StaticRange: AbstractRange { } public convenience init(init: StaticRangeInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } } diff --git a/Sources/DOMKit/WebIDL/StereoPannerNode.swift b/Sources/DOMKit/WebIDL/StereoPannerNode.swift index 5039db82..e2d4b4ac 100644 --- a/Sources/DOMKit/WebIDL/StereoPannerNode.swift +++ b/Sources/DOMKit/WebIDL/StereoPannerNode.swift @@ -12,7 +12,7 @@ public class StereoPannerNode: AudioNode { } public convenience init(context: BaseAudioContext, options: StereoPannerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift index 9beb8840..de4eeb28 100644 --- a/Sources/DOMKit/WebIDL/StorageEvent.swift +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -16,7 +16,7 @@ public class StorageEvent: Event { } public convenience init(type: String, eventInitDict: StorageEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SubmitEvent.swift b/Sources/DOMKit/WebIDL/SubmitEvent.swift index 3dc2c333..06ecafc9 100644 --- a/Sources/DOMKit/WebIDL/SubmitEvent.swift +++ b/Sources/DOMKit/WebIDL/SubmitEvent.swift @@ -12,7 +12,7 @@ public class SubmitEvent: Event { } public convenience init(type: String, eventInitDict: SubmitEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SyncEvent.swift b/Sources/DOMKit/WebIDL/SyncEvent.swift index 6694f481..7340cde7 100644 --- a/Sources/DOMKit/WebIDL/SyncEvent.swift +++ b/Sources/DOMKit/WebIDL/SyncEvent.swift @@ -13,7 +13,7 @@ public class SyncEvent: ExtendableEvent { } public convenience init(type: String, init: SyncEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), `init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Table.swift b/Sources/DOMKit/WebIDL/Table.swift index caef1bf2..756bf115 100644 --- a/Sources/DOMKit/WebIDL/Table.swift +++ b/Sources/DOMKit/WebIDL/Table.swift @@ -14,7 +14,7 @@ public class Table: JSBridgedClass { } public convenience init(descriptor: TableDescriptor, value: JSValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(descriptor.jsValue(), value?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue(), value?.jsValue() ?? .undefined])) } public func grow(delta: UInt32, value: JSValue? = nil) -> UInt32 { diff --git a/Sources/DOMKit/WebIDL/TaskController.swift b/Sources/DOMKit/WebIDL/TaskController.swift index c88262d9..7f637582 100644 --- a/Sources/DOMKit/WebIDL/TaskController.swift +++ b/Sources/DOMKit/WebIDL/TaskController.swift @@ -11,7 +11,7 @@ public class TaskController: AbortController { } public convenience init(init: TaskControllerInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } public func setPriority(priority: TaskPriority) { diff --git a/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift b/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift index e3d5cf28..447fd041 100644 --- a/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift @@ -12,7 +12,7 @@ public class TaskPriorityChangeEvent: Event { } public convenience init(type: String, priorityChangeEventInitDict: TaskPriorityChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), priorityChangeEventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), priorityChangeEventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index 5bbf1e96..8bcd9390 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -12,7 +12,7 @@ public class Text: CharacterData, GeometryUtils, Slottable { } public convenience init(data: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(data?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue() ?? .undefined])) } public func splitText(offset: UInt32) -> Self { diff --git a/Sources/DOMKit/WebIDL/TextDecoder.swift b/Sources/DOMKit/WebIDL/TextDecoder.swift index de92ba3e..50ab851d 100644 --- a/Sources/DOMKit/WebIDL/TextDecoder.swift +++ b/Sources/DOMKit/WebIDL/TextDecoder.swift @@ -13,7 +13,7 @@ public class TextDecoder: JSBridgedClass, TextDecoderCommon { } public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) } public func decode(input: BufferSource? = nil, options: TextDecodeOptions? = nil) -> String { diff --git a/Sources/DOMKit/WebIDL/TextDecoderStream.swift b/Sources/DOMKit/WebIDL/TextDecoderStream.swift index e2ac77ac..8816a807 100644 --- a/Sources/DOMKit/WebIDL/TextDecoderStream.swift +++ b/Sources/DOMKit/WebIDL/TextDecoderStream.swift @@ -13,6 +13,6 @@ public class TextDecoderStream: JSBridgedClass, TextDecoderCommon, GenericTransf } public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/TextDetector.swift b/Sources/DOMKit/WebIDL/TextDetector.swift index a2f36083..08efa2af 100644 --- a/Sources/DOMKit/WebIDL/TextDetector.swift +++ b/Sources/DOMKit/WebIDL/TextDetector.swift @@ -13,7 +13,7 @@ public class TextDetector: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public func detect(image: ImageBitmapSource) -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/TextEncoder.swift b/Sources/DOMKit/WebIDL/TextEncoder.swift index ebd960fb..24d0a481 100644 --- a/Sources/DOMKit/WebIDL/TextEncoder.swift +++ b/Sources/DOMKit/WebIDL/TextEncoder.swift @@ -13,7 +13,7 @@ public class TextEncoder: JSBridgedClass, TextEncoderCommon { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public func encode(input: String? = nil) -> Uint8Array { diff --git a/Sources/DOMKit/WebIDL/TextEncoderStream.swift b/Sources/DOMKit/WebIDL/TextEncoderStream.swift index 0c871a9d..fbc30dab 100644 --- a/Sources/DOMKit/WebIDL/TextEncoderStream.swift +++ b/Sources/DOMKit/WebIDL/TextEncoderStream.swift @@ -13,6 +13,6 @@ public class TextEncoderStream: JSBridgedClass, TextEncoderCommon, GenericTransf } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/TextFormat.swift b/Sources/DOMKit/WebIDL/TextFormat.swift index 834bfeb5..5df2a4c7 100644 --- a/Sources/DOMKit/WebIDL/TextFormat.swift +++ b/Sources/DOMKit/WebIDL/TextFormat.swift @@ -20,7 +20,7 @@ public class TextFormat: JSBridgedClass { } public convenience init(options: TextFormatInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift index a078b0d4..5774f435 100644 --- a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift @@ -11,7 +11,7 @@ public class TextFormatUpdateEvent: Event { } public convenience init(options: TextFormatUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } public func getTextFormats() -> [TextFormat] { diff --git a/Sources/DOMKit/WebIDL/TextUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextUpdateEvent.swift index 8264efdb..d99e959c 100644 --- a/Sources/DOMKit/WebIDL/TextUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/TextUpdateEvent.swift @@ -18,7 +18,7 @@ public class TextUpdateEvent: Event { } public convenience init(options: TextUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Touch.swift b/Sources/DOMKit/WebIDL/Touch.swift index 75dfce60..1e18a12d 100644 --- a/Sources/DOMKit/WebIDL/Touch.swift +++ b/Sources/DOMKit/WebIDL/Touch.swift @@ -28,7 +28,7 @@ public class Touch: JSBridgedClass { } public convenience init(touchInitDict: TouchInit) { - self.init(unsafelyWrapping: Self.constructor.new(touchInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [touchInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TouchEvent.swift b/Sources/DOMKit/WebIDL/TouchEvent.swift index eb4a8e53..d4934d98 100644 --- a/Sources/DOMKit/WebIDL/TouchEvent.swift +++ b/Sources/DOMKit/WebIDL/TouchEvent.swift @@ -18,7 +18,7 @@ public class TouchEvent: UIEvent { } public convenience init(type: String, eventInitDict: TouchEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TrackEvent.swift b/Sources/DOMKit/WebIDL/TrackEvent.swift index 792ed70e..219488b2 100644 --- a/Sources/DOMKit/WebIDL/TrackEvent.swift +++ b/Sources/DOMKit/WebIDL/TrackEvent.swift @@ -12,7 +12,7 @@ public class TrackEvent: Event { } public convenience init(type: String, eventInitDict: TrackEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TransformStream.swift b/Sources/DOMKit/WebIDL/TransformStream.swift index 2744d4e0..2daecfd7 100644 --- a/Sources/DOMKit/WebIDL/TransformStream.swift +++ b/Sources/DOMKit/WebIDL/TransformStream.swift @@ -15,7 +15,7 @@ public class TransformStream: JSBridgedClass { } public convenience init(transformer: JSObject? = nil, writableStrategy: QueuingStrategy? = nil, readableStrategy: QueuingStrategy? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(transformer?.jsValue() ?? .undefined, writableStrategy?.jsValue() ?? .undefined, readableStrategy?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [transformer?.jsValue() ?? .undefined, writableStrategy?.jsValue() ?? .undefined, readableStrategy?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TransitionEvent.swift b/Sources/DOMKit/WebIDL/TransitionEvent.swift index 02c705fa..5e29169c 100644 --- a/Sources/DOMKit/WebIDL/TransitionEvent.swift +++ b/Sources/DOMKit/WebIDL/TransitionEvent.swift @@ -14,7 +14,7 @@ public class TransitionEvent: Event { } public convenience init(type: String, transitionEventInitDict: TransitionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), transitionEventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), transitionEventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index d25843f0..f2ac77ac 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -18,7 +18,7 @@ public class UIEvent: Event { public var sourceCapabilities: InputDeviceCapabilities? public convenience init(type: String, eventInitDict: UIEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index c0f5818c..f49fa24e 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -35,7 +35,7 @@ public class URL: JSBridgedClass { } public convenience init(url: String, base: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), base?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), base?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/URLPattern.swift b/Sources/DOMKit/WebIDL/URLPattern.swift index da305681..fed5b256 100644 --- a/Sources/DOMKit/WebIDL/URLPattern.swift +++ b/Sources/DOMKit/WebIDL/URLPattern.swift @@ -21,7 +21,7 @@ public class URLPattern: JSBridgedClass { } public convenience init(input: URLPatternInput? = nil, baseURL: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined])) } public func test(input: URLPatternInput? = nil, baseURL: String? = nil) -> Bool { diff --git a/Sources/DOMKit/WebIDL/URLSearchParams.swift b/Sources/DOMKit/WebIDL/URLSearchParams.swift index f2a10120..73aae18d 100644 --- a/Sources/DOMKit/WebIDL/URLSearchParams.swift +++ b/Sources/DOMKit/WebIDL/URLSearchParams.swift @@ -13,7 +13,7 @@ public class URLSearchParams: JSBridgedClass, Sequence { } public convenience init(init: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } public func append(name: String, value: String) { diff --git a/Sources/DOMKit/WebIDL/USBAlternateInterface.swift b/Sources/DOMKit/WebIDL/USBAlternateInterface.swift index c2e6084b..4ec425ef 100644 --- a/Sources/DOMKit/WebIDL/USBAlternateInterface.swift +++ b/Sources/DOMKit/WebIDL/USBAlternateInterface.swift @@ -19,7 +19,7 @@ public class USBAlternateInterface: JSBridgedClass { } public convenience init(deviceInterface: USBInterface, alternateSetting: UInt8) { - self.init(unsafelyWrapping: Self.constructor.new(deviceInterface.jsValue(), alternateSetting.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInterface.jsValue(), alternateSetting.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBConfiguration.swift b/Sources/DOMKit/WebIDL/USBConfiguration.swift index b4a3297f..76ddf6fb 100644 --- a/Sources/DOMKit/WebIDL/USBConfiguration.swift +++ b/Sources/DOMKit/WebIDL/USBConfiguration.swift @@ -16,7 +16,7 @@ public class USBConfiguration: JSBridgedClass { } public convenience init(device: USBDevice, configurationValue: UInt8) { - self.init(unsafelyWrapping: Self.constructor.new(device.jsValue(), configurationValue.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [device.jsValue(), configurationValue.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBConnectionEvent.swift b/Sources/DOMKit/WebIDL/USBConnectionEvent.swift index 2fd641bd..aff344fd 100644 --- a/Sources/DOMKit/WebIDL/USBConnectionEvent.swift +++ b/Sources/DOMKit/WebIDL/USBConnectionEvent.swift @@ -12,7 +12,7 @@ public class USBConnectionEvent: Event { } public convenience init(type: String, eventInitDict: USBConnectionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBEndpoint.swift b/Sources/DOMKit/WebIDL/USBEndpoint.swift index a2b4aa74..e14ac2a3 100644 --- a/Sources/DOMKit/WebIDL/USBEndpoint.swift +++ b/Sources/DOMKit/WebIDL/USBEndpoint.swift @@ -17,7 +17,7 @@ public class USBEndpoint: JSBridgedClass { } public convenience init(alternate: USBAlternateInterface, endpointNumber: UInt8, direction: USBDirection) { - self.init(unsafelyWrapping: Self.constructor.new(alternate.jsValue(), endpointNumber.jsValue(), direction.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [alternate.jsValue(), endpointNumber.jsValue(), direction.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBInTransferResult.swift b/Sources/DOMKit/WebIDL/USBInTransferResult.swift index fd919b22..4ec891eb 100644 --- a/Sources/DOMKit/WebIDL/USBInTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBInTransferResult.swift @@ -15,7 +15,7 @@ public class USBInTransferResult: JSBridgedClass { } public convenience init(status: USBTransferStatus, data: DataView? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(status.jsValue(), data?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), data?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBInterface.swift b/Sources/DOMKit/WebIDL/USBInterface.swift index a6542d94..241f8295 100644 --- a/Sources/DOMKit/WebIDL/USBInterface.swift +++ b/Sources/DOMKit/WebIDL/USBInterface.swift @@ -17,7 +17,7 @@ public class USBInterface: JSBridgedClass { } public convenience init(configuration: USBConfiguration, interfaceNumber: UInt8) { - self.init(unsafelyWrapping: Self.constructor.new(configuration.jsValue(), interfaceNumber.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration.jsValue(), interfaceNumber.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift index d5db43e0..21296be6 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift @@ -15,7 +15,7 @@ public class USBIsochronousInTransferPacket: JSBridgedClass { } public convenience init(status: USBTransferStatus, data: DataView? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(status.jsValue(), data?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), data?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift index 7abea45f..dd102dac 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift @@ -15,7 +15,7 @@ public class USBIsochronousInTransferResult: JSBridgedClass { } public convenience init(packets: [USBIsochronousInTransferPacket], data: DataView? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(packets.jsValue(), data?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue(), data?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift index 48fae591..b0d5dde0 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift @@ -15,7 +15,7 @@ public class USBIsochronousOutTransferPacket: JSBridgedClass { } public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(status.jsValue(), bytesWritten?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), bytesWritten?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift index 14618fd2..101cca8f 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift @@ -14,7 +14,7 @@ public class USBIsochronousOutTransferResult: JSBridgedClass { } public convenience init(packets: [USBIsochronousOutTransferPacket]) { - self.init(unsafelyWrapping: Self.constructor.new(packets.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBOutTransferResult.swift index 8c91ae0d..e8fff6c1 100644 --- a/Sources/DOMKit/WebIDL/USBOutTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBOutTransferResult.swift @@ -15,7 +15,7 @@ public class USBOutTransferResult: JSBridgedClass { } public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(status.jsValue(), bytesWritten?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), bytesWritten?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift b/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift index 3f95eed7..64a4eb1f 100644 --- a/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift +++ b/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift @@ -17,7 +17,7 @@ public class UncalibratedMagnetometer: Sensor { } public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(sensorOptions?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/VTTCue.swift b/Sources/DOMKit/WebIDL/VTTCue.swift index 998c9180..ce48fa16 100644 --- a/Sources/DOMKit/WebIDL/VTTCue.swift +++ b/Sources/DOMKit/WebIDL/VTTCue.swift @@ -21,7 +21,7 @@ public class VTTCue: TextTrackCue { } public convenience init(startTime: Double, endTime: Double, text: String) { - self.init(unsafelyWrapping: Self.constructor.new(startTime.jsValue(), endTime.jsValue(), text.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue(), endTime.jsValue(), text.jsValue()])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/VTTRegion.swift b/Sources/DOMKit/WebIDL/VTTRegion.swift index 821fbda5..8d44e280 100644 --- a/Sources/DOMKit/WebIDL/VTTRegion.swift +++ b/Sources/DOMKit/WebIDL/VTTRegion.swift @@ -21,7 +21,7 @@ public class VTTRegion: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ValueEvent.swift b/Sources/DOMKit/WebIDL/ValueEvent.swift index b766c688..224f41b2 100644 --- a/Sources/DOMKit/WebIDL/ValueEvent.swift +++ b/Sources/DOMKit/WebIDL/ValueEvent.swift @@ -12,7 +12,7 @@ public class ValueEvent: Event { } public convenience init(type: String, initDict: ValueEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), initDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), initDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/VideoColorSpace.swift b/Sources/DOMKit/WebIDL/VideoColorSpace.swift index cfa4441f..8c3e7cb2 100644 --- a/Sources/DOMKit/WebIDL/VideoColorSpace.swift +++ b/Sources/DOMKit/WebIDL/VideoColorSpace.swift @@ -17,7 +17,7 @@ public class VideoColorSpace: JSBridgedClass { } public convenience init(init: VideoColorSpaceInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/VideoDecoder.swift b/Sources/DOMKit/WebIDL/VideoDecoder.swift index d9911c8a..32184399 100644 --- a/Sources/DOMKit/WebIDL/VideoDecoder.swift +++ b/Sources/DOMKit/WebIDL/VideoDecoder.swift @@ -15,7 +15,7 @@ public class VideoDecoder: JSBridgedClass { } public convenience init(init: VideoDecoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/VideoEncoder.swift b/Sources/DOMKit/WebIDL/VideoEncoder.swift index 994a9237..0e8c4f26 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoder.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoder.swift @@ -15,7 +15,7 @@ public class VideoEncoder: JSBridgedClass { } public convenience init(init: VideoEncoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(`init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/VideoFrame.swift b/Sources/DOMKit/WebIDL/VideoFrame.swift index 03140357..932ec96d 100644 --- a/Sources/DOMKit/WebIDL/VideoFrame.swift +++ b/Sources/DOMKit/WebIDL/VideoFrame.swift @@ -23,11 +23,11 @@ public class VideoFrame: JSBridgedClass { } public convenience init(image: CanvasImageSource, init: VideoFrameInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(image.jsValue(), `init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [image.jsValue(), `init`?.jsValue() ?? .undefined])) } public convenience init(data: BufferSource, init: VideoFrameBufferInit) { - self.init(unsafelyWrapping: Self.constructor.new(data.jsValue(), `init`.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue(), `init`.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift b/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift index a72f302a..aae9d046 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift @@ -16,7 +16,7 @@ public class VideoTrackGenerator: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WaveShaperNode.swift b/Sources/DOMKit/WebIDL/WaveShaperNode.swift index 721740ee..26c1fbc3 100644 --- a/Sources/DOMKit/WebIDL/WaveShaperNode.swift +++ b/Sources/DOMKit/WebIDL/WaveShaperNode.swift @@ -13,7 +13,7 @@ public class WaveShaperNode: AudioNode { } public convenience init(context: BaseAudioContext, options: WaveShaperOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(context.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/WebGLContextEvent.swift b/Sources/DOMKit/WebIDL/WebGLContextEvent.swift index 9439f116..ba5e89d6 100644 --- a/Sources/DOMKit/WebIDL/WebGLContextEvent.swift +++ b/Sources/DOMKit/WebIDL/WebGLContextEvent.swift @@ -12,7 +12,7 @@ public class WebGLContextEvent: Event { } public convenience init(type: String, eventInit: WebGLContextEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInit?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInit?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WebSocket.swift b/Sources/DOMKit/WebIDL/WebSocket.swift index 2fc82bed..5e04e953 100644 --- a/Sources/DOMKit/WebIDL/WebSocket.swift +++ b/Sources/DOMKit/WebIDL/WebSocket.swift @@ -21,7 +21,7 @@ public class WebSocket: EventTarget { } public convenience init(url: String, protocols: __UNSUPPORTED_UNION__? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), protocols?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), protocols?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WebTransport.swift b/Sources/DOMKit/WebIDL/WebTransport.swift index 781605a1..f1d41111 100644 --- a/Sources/DOMKit/WebIDL/WebTransport.swift +++ b/Sources/DOMKit/WebIDL/WebTransport.swift @@ -18,7 +18,7 @@ public class WebTransport: JSBridgedClass { } public convenience init(url: String, options: WebTransportOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(url.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), options?.jsValue() ?? .undefined])) } public func getStats() -> JSPromise { diff --git a/Sources/DOMKit/WebIDL/WebTransportError.swift b/Sources/DOMKit/WebIDL/WebTransportError.swift index 0f0cbcdf..68b25bad 100644 --- a/Sources/DOMKit/WebIDL/WebTransportError.swift +++ b/Sources/DOMKit/WebIDL/WebTransportError.swift @@ -13,7 +13,7 @@ public class WebTransportError: DOMException { } public convenience init(init: WebTransportErrorInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(`init`?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WheelEvent.swift b/Sources/DOMKit/WebIDL/WheelEvent.swift index 4e22ef59..0fc4fb72 100644 --- a/Sources/DOMKit/WebIDL/WheelEvent.swift +++ b/Sources/DOMKit/WebIDL/WheelEvent.swift @@ -15,7 +15,7 @@ public class WheelEvent: MouseEvent { } public convenience init(type: String, eventInitDict: WheelEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } public static let DOM_DELTA_PIXEL: UInt32 = 0x00 diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift index 13e67555..f19fc667 100644 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift @@ -13,7 +13,7 @@ public class WindowControlsOverlayGeometryChangeEvent: Event { } public convenience init(type: String, eventInitDict: WindowControlsOverlayGeometryChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index f80f1a8d..3b801f15 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -13,7 +13,7 @@ public class Worker: EventTarget, AbstractWorker { } public convenience init(scriptURL: String, options: WorkerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(scriptURL.jsValue(), options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined])) } public func terminate() { diff --git a/Sources/DOMKit/WebIDL/WorkletAnimation.swift b/Sources/DOMKit/WebIDL/WorkletAnimation.swift index d3ec2ec7..03cfb3c9 100644 --- a/Sources/DOMKit/WebIDL/WorkletAnimation.swift +++ b/Sources/DOMKit/WebIDL/WorkletAnimation.swift @@ -12,7 +12,7 @@ public class WorkletAnimation: Animation { } public convenience init(animatorName: String, effects: __UNSUPPORTED_UNION__? = nil, timeline: AnimationTimeline? = nil, options: JSValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(animatorName.jsValue(), effects?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [animatorName.jsValue(), effects?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift index 8c996bea..3fa32f16 100644 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -14,7 +14,7 @@ public class WritableStream: JSBridgedClass { } public convenience init(underlyingSink: JSObject? = nil, strategy: QueuingStrategy? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(underlyingSink?.jsValue() ?? .undefined, strategy?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [underlyingSink?.jsValue() ?? .undefined, strategy?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift index 364f7543..db957e0b 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -16,7 +16,7 @@ public class WritableStreamDefaultWriter: JSBridgedClass { } public convenience init(stream: WritableStream) { - self.init(unsafelyWrapping: Self.constructor.new(stream.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index bc290224..10d907ff 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -23,7 +23,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/XMLSerializer.swift b/Sources/DOMKit/WebIDL/XMLSerializer.swift index 96aab106..ba740348 100644 --- a/Sources/DOMKit/WebIDL/XMLSerializer.swift +++ b/Sources/DOMKit/WebIDL/XMLSerializer.swift @@ -13,7 +13,7 @@ public class XMLSerializer: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public func serializeToString(root: Node) -> String { diff --git a/Sources/DOMKit/WebIDL/XPathEvaluator.swift b/Sources/DOMKit/WebIDL/XPathEvaluator.swift index bf8664f3..e37dee14 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluator.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluator.swift @@ -13,6 +13,6 @@ public class XPathEvaluator: JSBridgedClass, XPathEvaluatorBase { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift index d2700ee4..21d08a06 100644 --- a/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift +++ b/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift @@ -13,7 +13,7 @@ public class XRInputSourceEvent: Event { } public convenience init(type: String, eventInitDict: XRInputSourceEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift index 2470306f..2eefd65b 100644 --- a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift @@ -14,7 +14,7 @@ public class XRInputSourcesChangeEvent: Event { } public convenience init(type: String, eventInitDict: XRInputSourcesChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRLayerEvent.swift b/Sources/DOMKit/WebIDL/XRLayerEvent.swift index 45a9c880..196e4d9c 100644 --- a/Sources/DOMKit/WebIDL/XRLayerEvent.swift +++ b/Sources/DOMKit/WebIDL/XRLayerEvent.swift @@ -12,7 +12,7 @@ public class XRLayerEvent: Event { } public convenience init(type: String, eventInitDict: XRLayerEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRMediaBinding.swift b/Sources/DOMKit/WebIDL/XRMediaBinding.swift index 53a81cec..b64a96db 100644 --- a/Sources/DOMKit/WebIDL/XRMediaBinding.swift +++ b/Sources/DOMKit/WebIDL/XRMediaBinding.swift @@ -13,7 +13,7 @@ public class XRMediaBinding: JSBridgedClass { } public convenience init(session: XRSession) { - self.init(unsafelyWrapping: Self.constructor.new(session.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue()])) } public func createQuadLayer(video: HTMLVideoElement, init: XRMediaQuadLayerInit? = nil) -> XRQuadLayer { diff --git a/Sources/DOMKit/WebIDL/XRRay.swift b/Sources/DOMKit/WebIDL/XRRay.swift index b00f24c2..b6876e79 100644 --- a/Sources/DOMKit/WebIDL/XRRay.swift +++ b/Sources/DOMKit/WebIDL/XRRay.swift @@ -16,11 +16,11 @@ public class XRRay: JSBridgedClass { } public convenience init(origin: DOMPointInit? = nil, direction: XRRayDirectionInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(origin?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [origin?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined])) } public convenience init(transform: XRRigidTransform) { - self.init(unsafelyWrapping: Self.constructor.new(transform.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [transform.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift index adce0a1a..af2a308e 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift @@ -13,7 +13,7 @@ public class XRReferenceSpaceEvent: Event { } public convenience init(type: String, eventInitDict: XRReferenceSpaceEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRRigidTransform.swift b/Sources/DOMKit/WebIDL/XRRigidTransform.swift index e05fd1ae..3c9e212d 100644 --- a/Sources/DOMKit/WebIDL/XRRigidTransform.swift +++ b/Sources/DOMKit/WebIDL/XRRigidTransform.swift @@ -17,7 +17,7 @@ public class XRRigidTransform: JSBridgedClass { } public convenience init(position: DOMPointInit? = nil, orientation: DOMPointInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(position?.jsValue() ?? .undefined, orientation?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [position?.jsValue() ?? .undefined, orientation?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRSessionEvent.swift b/Sources/DOMKit/WebIDL/XRSessionEvent.swift index a73e458d..55fda402 100644 --- a/Sources/DOMKit/WebIDL/XRSessionEvent.swift +++ b/Sources/DOMKit/WebIDL/XRSessionEvent.swift @@ -12,7 +12,7 @@ public class XRSessionEvent: Event { } public convenience init(type: String, eventInitDict: XRSessionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(type.jsValue(), eventInitDict.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift index 1651dc53..f1016ed3 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift @@ -25,7 +25,7 @@ public class XRWebGLBinding: JSBridgedClass { } public convenience init(session: XRSession, context: XRWebGLRenderingContext) { - self.init(unsafelyWrapping: Self.constructor.new(session.jsValue(), context.jsValue())) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue(), context.jsValue()])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift index 372e542a..fb627438 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift @@ -17,7 +17,7 @@ public class XRWebGLLayer: XRLayer { } public convenience init(session: XRSession, context: XRWebGLRenderingContext, layerInit: XRWebGLLayerInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(session.jsValue(), context.jsValue(), layerInit?.jsValue() ?? .undefined)) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue(), context.jsValue(), layerInit?.jsValue() ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift index 80f4fdb4..68fbdf34 100644 --- a/Sources/DOMKit/WebIDL/XSLTProcessor.swift +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -13,7 +13,7 @@ public class XSLTProcessor: JSBridgedClass { } public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new()) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } public func importStylesheet(style: Node) { diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index efe3f036..6d43e164 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -263,15 +263,28 @@ extension IDLConstant: SwiftRepresentable, Initializable { extension IDLConstructor: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { assert(!Context.static) + assert(arguments.dropLast().allSatisfy { !$0.variadic }) if Context.ignored[Context.className.source]?.contains("") ?? false { return "// XXX: constructor is ignored" } let args: [SwiftSource] = arguments.map { "\($0.name)\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" } + let argsArray: SwiftSource + if let last = arguments.last, last.variadic { + // TODO: handle optional variadics (if necessary?) + let variadic: SwiftSource = "\(last.name).map { $0.jsValue() }" + if args.count == 1 { + argsArray = variadic + } else { + argsArray = "[\(sequence: args.dropLast())] + \(variadic)" + } + } else { + argsArray = "[\(sequence: args)]" + } return """ public convenience init(\(sequence: arguments.map(\.swiftRepresentation))) { - self.init(unsafelyWrapping: Self.constructor.new(\(sequence: args))) + self.init(unsafelyWrapping: Self.constructor.new(arguments: \(argsArray))) } """ } @@ -390,10 +403,10 @@ extension IDLOperation: SwiftRepresentable, Initializable { if let last = arguments.last, last.variadic { // TODO: handle optional variadics (if necessary?) let variadic: SwiftSource = "\(last.name).map { $0.jsValue() }" - if args.count > 1 { - argsArray = "[\(sequence: args.dropLast())] + \(variadic)" - } else { + if args.count == 1 { argsArray = variadic + } else { + argsArray = "[\(sequence: args.dropLast())] + \(variadic)" } } else { argsArray = "[\(sequence: args)]" From 47d99df98ac5012084089f859e7b20a64f20ed16 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 11:49:31 -0400 Subject: [PATCH 099/124] Fix constants on protocol extensions --- .../WebIDL/WebGL2RenderingContextBase.swift | 526 ++++++++-------- .../WebIDL/WebGLRenderingContextBase.swift | 592 +++++++++--------- Sources/WebIDLToSwift/Context.swift | 9 +- Sources/WebIDLToSwift/IDLBuilder.swift | 2 - .../WebIDL+SwiftRepresentation.swift | 15 +- 5 files changed, 578 insertions(+), 566 deletions(-) diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift index 4db3df7d..8e98756a 100644 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift @@ -5,531 +5,531 @@ import JavaScriptKit public protocol WebGL2RenderingContextBase: JSBridgedClass {} public extension WebGL2RenderingContextBase { - static let READ_BUFFER: GLenum = 0x0C02 + static var READ_BUFFER: GLenum { 0x0C02 } - static let UNPACK_ROW_LENGTH: GLenum = 0x0CF2 + static var UNPACK_ROW_LENGTH: GLenum { 0x0CF2 } - static let UNPACK_SKIP_ROWS: GLenum = 0x0CF3 + static var UNPACK_SKIP_ROWS: GLenum { 0x0CF3 } - static let UNPACK_SKIP_PIXELS: GLenum = 0x0CF4 + static var UNPACK_SKIP_PIXELS: GLenum { 0x0CF4 } - static let PACK_ROW_LENGTH: GLenum = 0x0D02 + static var PACK_ROW_LENGTH: GLenum { 0x0D02 } - static let PACK_SKIP_ROWS: GLenum = 0x0D03 + static var PACK_SKIP_ROWS: GLenum { 0x0D03 } - static let PACK_SKIP_PIXELS: GLenum = 0x0D04 + static var PACK_SKIP_PIXELS: GLenum { 0x0D04 } - static let COLOR: GLenum = 0x1800 + static var COLOR: GLenum { 0x1800 } - static let DEPTH: GLenum = 0x1801 + static var DEPTH: GLenum { 0x1801 } - static let STENCIL: GLenum = 0x1802 + static var STENCIL: GLenum { 0x1802 } - static let RED: GLenum = 0x1903 + static var RED: GLenum { 0x1903 } - static let RGB8: GLenum = 0x8051 + static var RGB8: GLenum { 0x8051 } - static let RGBA8: GLenum = 0x8058 + static var RGBA8: GLenum { 0x8058 } - static let RGB10_A2: GLenum = 0x8059 + static var RGB10_A2: GLenum { 0x8059 } - static let TEXTURE_BINDING_3D: GLenum = 0x806A + static var TEXTURE_BINDING_3D: GLenum { 0x806A } - static let UNPACK_SKIP_IMAGES: GLenum = 0x806D + static var UNPACK_SKIP_IMAGES: GLenum { 0x806D } - static let UNPACK_IMAGE_HEIGHT: GLenum = 0x806E + static var UNPACK_IMAGE_HEIGHT: GLenum { 0x806E } - static let TEXTURE_3D: GLenum = 0x806F + static var TEXTURE_3D: GLenum { 0x806F } - static let TEXTURE_WRAP_R: GLenum = 0x8072 + static var TEXTURE_WRAP_R: GLenum { 0x8072 } - static let MAX_3D_TEXTURE_SIZE: GLenum = 0x8073 + static var MAX_3D_TEXTURE_SIZE: GLenum { 0x8073 } - static let UNSIGNED_INT_2_10_10_10_REV: GLenum = 0x8368 + static var UNSIGNED_INT_2_10_10_10_REV: GLenum { 0x8368 } - static let MAX_ELEMENTS_VERTICES: GLenum = 0x80E8 + static var MAX_ELEMENTS_VERTICES: GLenum { 0x80E8 } - static let MAX_ELEMENTS_INDICES: GLenum = 0x80E9 + static var MAX_ELEMENTS_INDICES: GLenum { 0x80E9 } - static let TEXTURE_MIN_LOD: GLenum = 0x813A + static var TEXTURE_MIN_LOD: GLenum { 0x813A } - static let TEXTURE_MAX_LOD: GLenum = 0x813B + static var TEXTURE_MAX_LOD: GLenum { 0x813B } - static let TEXTURE_BASE_LEVEL: GLenum = 0x813C + static var TEXTURE_BASE_LEVEL: GLenum { 0x813C } - static let TEXTURE_MAX_LEVEL: GLenum = 0x813D + static var TEXTURE_MAX_LEVEL: GLenum { 0x813D } - static let MIN: GLenum = 0x8007 + static var MIN: GLenum { 0x8007 } - static let MAX: GLenum = 0x8008 + static var MAX: GLenum { 0x8008 } - static let DEPTH_COMPONENT24: GLenum = 0x81A6 + static var DEPTH_COMPONENT24: GLenum { 0x81A6 } - static let MAX_TEXTURE_LOD_BIAS: GLenum = 0x84FD + static var MAX_TEXTURE_LOD_BIAS: GLenum { 0x84FD } - static let TEXTURE_COMPARE_MODE: GLenum = 0x884C + static var TEXTURE_COMPARE_MODE: GLenum { 0x884C } - static let TEXTURE_COMPARE_FUNC: GLenum = 0x884D + static var TEXTURE_COMPARE_FUNC: GLenum { 0x884D } - static let CURRENT_QUERY: GLenum = 0x8865 + static var CURRENT_QUERY: GLenum { 0x8865 } - static let QUERY_RESULT: GLenum = 0x8866 + static var QUERY_RESULT: GLenum { 0x8866 } - static let QUERY_RESULT_AVAILABLE: GLenum = 0x8867 + static var QUERY_RESULT_AVAILABLE: GLenum { 0x8867 } - static let STREAM_READ: GLenum = 0x88E1 + static var STREAM_READ: GLenum { 0x88E1 } - static let STREAM_COPY: GLenum = 0x88E2 + static var STREAM_COPY: GLenum { 0x88E2 } - static let STATIC_READ: GLenum = 0x88E5 + static var STATIC_READ: GLenum { 0x88E5 } - static let STATIC_COPY: GLenum = 0x88E6 + static var STATIC_COPY: GLenum { 0x88E6 } - static let DYNAMIC_READ: GLenum = 0x88E9 + static var DYNAMIC_READ: GLenum { 0x88E9 } - static let DYNAMIC_COPY: GLenum = 0x88EA + static var DYNAMIC_COPY: GLenum { 0x88EA } - static let MAX_DRAW_BUFFERS: GLenum = 0x8824 + static var MAX_DRAW_BUFFERS: GLenum { 0x8824 } - static let DRAW_BUFFER0: GLenum = 0x8825 + static var DRAW_BUFFER0: GLenum { 0x8825 } - static let DRAW_BUFFER1: GLenum = 0x8826 + static var DRAW_BUFFER1: GLenum { 0x8826 } - static let DRAW_BUFFER2: GLenum = 0x8827 + static var DRAW_BUFFER2: GLenum { 0x8827 } - static let DRAW_BUFFER3: GLenum = 0x8828 + static var DRAW_BUFFER3: GLenum { 0x8828 } - static let DRAW_BUFFER4: GLenum = 0x8829 + static var DRAW_BUFFER4: GLenum { 0x8829 } - static let DRAW_BUFFER5: GLenum = 0x882A + static var DRAW_BUFFER5: GLenum { 0x882A } - static let DRAW_BUFFER6: GLenum = 0x882B + static var DRAW_BUFFER6: GLenum { 0x882B } - static let DRAW_BUFFER7: GLenum = 0x882C + static var DRAW_BUFFER7: GLenum { 0x882C } - static let DRAW_BUFFER8: GLenum = 0x882D + static var DRAW_BUFFER8: GLenum { 0x882D } - static let DRAW_BUFFER9: GLenum = 0x882E + static var DRAW_BUFFER9: GLenum { 0x882E } - static let DRAW_BUFFER10: GLenum = 0x882F + static var DRAW_BUFFER10: GLenum { 0x882F } - static let DRAW_BUFFER11: GLenum = 0x8830 + static var DRAW_BUFFER11: GLenum { 0x8830 } - static let DRAW_BUFFER12: GLenum = 0x8831 + static var DRAW_BUFFER12: GLenum { 0x8831 } - static let DRAW_BUFFER13: GLenum = 0x8832 + static var DRAW_BUFFER13: GLenum { 0x8832 } - static let DRAW_BUFFER14: GLenum = 0x8833 + static var DRAW_BUFFER14: GLenum { 0x8833 } - static let DRAW_BUFFER15: GLenum = 0x8834 + static var DRAW_BUFFER15: GLenum { 0x8834 } - static let MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum = 0x8B49 + static var MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8B49 } - static let MAX_VERTEX_UNIFORM_COMPONENTS: GLenum = 0x8B4A + static var MAX_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8B4A } - static let SAMPLER_3D: GLenum = 0x8B5F + static var SAMPLER_3D: GLenum { 0x8B5F } - static let SAMPLER_2D_SHADOW: GLenum = 0x8B62 + static var SAMPLER_2D_SHADOW: GLenum { 0x8B62 } - static let FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum = 0x8B8B + static var FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum { 0x8B8B } - static let PIXEL_PACK_BUFFER: GLenum = 0x88EB + static var PIXEL_PACK_BUFFER: GLenum { 0x88EB } - static let PIXEL_UNPACK_BUFFER: GLenum = 0x88EC + static var PIXEL_UNPACK_BUFFER: GLenum { 0x88EC } - static let PIXEL_PACK_BUFFER_BINDING: GLenum = 0x88ED + static var PIXEL_PACK_BUFFER_BINDING: GLenum { 0x88ED } - static let PIXEL_UNPACK_BUFFER_BINDING: GLenum = 0x88EF + static var PIXEL_UNPACK_BUFFER_BINDING: GLenum { 0x88EF } - static let FLOAT_MAT2x3: GLenum = 0x8B65 + static var FLOAT_MAT2x3: GLenum { 0x8B65 } - static let FLOAT_MAT2x4: GLenum = 0x8B66 + static var FLOAT_MAT2x4: GLenum { 0x8B66 } - static let FLOAT_MAT3x2: GLenum = 0x8B67 + static var FLOAT_MAT3x2: GLenum { 0x8B67 } - static let FLOAT_MAT3x4: GLenum = 0x8B68 + static var FLOAT_MAT3x4: GLenum { 0x8B68 } - static let FLOAT_MAT4x2: GLenum = 0x8B69 + static var FLOAT_MAT4x2: GLenum { 0x8B69 } - static let FLOAT_MAT4x3: GLenum = 0x8B6A + static var FLOAT_MAT4x3: GLenum { 0x8B6A } - static let SRGB: GLenum = 0x8C40 + static var SRGB: GLenum { 0x8C40 } - static let SRGB8: GLenum = 0x8C41 + static var SRGB8: GLenum { 0x8C41 } - static let SRGB8_ALPHA8: GLenum = 0x8C43 + static var SRGB8_ALPHA8: GLenum { 0x8C43 } - static let COMPARE_REF_TO_TEXTURE: GLenum = 0x884E + static var COMPARE_REF_TO_TEXTURE: GLenum { 0x884E } - static let RGBA32F: GLenum = 0x8814 + static var RGBA32F: GLenum { 0x8814 } - static let RGB32F: GLenum = 0x8815 + static var RGB32F: GLenum { 0x8815 } - static let RGBA16F: GLenum = 0x881A + static var RGBA16F: GLenum { 0x881A } - static let RGB16F: GLenum = 0x881B + static var RGB16F: GLenum { 0x881B } - static let VERTEX_ATTRIB_ARRAY_INTEGER: GLenum = 0x88FD + static var VERTEX_ATTRIB_ARRAY_INTEGER: GLenum { 0x88FD } - static let MAX_ARRAY_TEXTURE_LAYERS: GLenum = 0x88FF + static var MAX_ARRAY_TEXTURE_LAYERS: GLenum { 0x88FF } - static let MIN_PROGRAM_TEXEL_OFFSET: GLenum = 0x8904 + static var MIN_PROGRAM_TEXEL_OFFSET: GLenum { 0x8904 } - static let MAX_PROGRAM_TEXEL_OFFSET: GLenum = 0x8905 + static var MAX_PROGRAM_TEXEL_OFFSET: GLenum { 0x8905 } - static let MAX_VARYING_COMPONENTS: GLenum = 0x8B4B + static var MAX_VARYING_COMPONENTS: GLenum { 0x8B4B } - static let TEXTURE_2D_ARRAY: GLenum = 0x8C1A + static var TEXTURE_2D_ARRAY: GLenum { 0x8C1A } - static let TEXTURE_BINDING_2D_ARRAY: GLenum = 0x8C1D + static var TEXTURE_BINDING_2D_ARRAY: GLenum { 0x8C1D } - static let R11F_G11F_B10F: GLenum = 0x8C3A + static var R11F_G11F_B10F: GLenum { 0x8C3A } - static let UNSIGNED_INT_10F_11F_11F_REV: GLenum = 0x8C3B + static var UNSIGNED_INT_10F_11F_11F_REV: GLenum { 0x8C3B } - static let RGB9_E5: GLenum = 0x8C3D + static var RGB9_E5: GLenum { 0x8C3D } - static let UNSIGNED_INT_5_9_9_9_REV: GLenum = 0x8C3E + static var UNSIGNED_INT_5_9_9_9_REV: GLenum { 0x8C3E } - static let TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum = 0x8C7F + static var TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum { 0x8C7F } - static let MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum = 0x8C80 + static var MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum { 0x8C80 } - static let TRANSFORM_FEEDBACK_VARYINGS: GLenum = 0x8C83 + static var TRANSFORM_FEEDBACK_VARYINGS: GLenum { 0x8C83 } - static let TRANSFORM_FEEDBACK_BUFFER_START: GLenum = 0x8C84 + static var TRANSFORM_FEEDBACK_BUFFER_START: GLenum { 0x8C84 } - static let TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum = 0x8C85 + static var TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum { 0x8C85 } - static let TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum = 0x8C88 + static var TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum { 0x8C88 } - static let RASTERIZER_DISCARD: GLenum = 0x8C89 + static var RASTERIZER_DISCARD: GLenum { 0x8C89 } - static let MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum = 0x8C8A + static var MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum { 0x8C8A } - static let MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum = 0x8C8B + static var MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum { 0x8C8B } - static let INTERLEAVED_ATTRIBS: GLenum = 0x8C8C + static var INTERLEAVED_ATTRIBS: GLenum { 0x8C8C } - static let SEPARATE_ATTRIBS: GLenum = 0x8C8D + static var SEPARATE_ATTRIBS: GLenum { 0x8C8D } - static let TRANSFORM_FEEDBACK_BUFFER: GLenum = 0x8C8E + static var TRANSFORM_FEEDBACK_BUFFER: GLenum { 0x8C8E } - static let TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum = 0x8C8F + static var TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum { 0x8C8F } - static let RGBA32UI: GLenum = 0x8D70 + static var RGBA32UI: GLenum { 0x8D70 } - static let RGB32UI: GLenum = 0x8D71 + static var RGB32UI: GLenum { 0x8D71 } - static let RGBA16UI: GLenum = 0x8D76 + static var RGBA16UI: GLenum { 0x8D76 } - static let RGB16UI: GLenum = 0x8D77 + static var RGB16UI: GLenum { 0x8D77 } - static let RGBA8UI: GLenum = 0x8D7C + static var RGBA8UI: GLenum { 0x8D7C } - static let RGB8UI: GLenum = 0x8D7D + static var RGB8UI: GLenum { 0x8D7D } - static let RGBA32I: GLenum = 0x8D82 + static var RGBA32I: GLenum { 0x8D82 } - static let RGB32I: GLenum = 0x8D83 + static var RGB32I: GLenum { 0x8D83 } - static let RGBA16I: GLenum = 0x8D88 + static var RGBA16I: GLenum { 0x8D88 } - static let RGB16I: GLenum = 0x8D89 + static var RGB16I: GLenum { 0x8D89 } - static let RGBA8I: GLenum = 0x8D8E + static var RGBA8I: GLenum { 0x8D8E } - static let RGB8I: GLenum = 0x8D8F + static var RGB8I: GLenum { 0x8D8F } - static let RED_INTEGER: GLenum = 0x8D94 + static var RED_INTEGER: GLenum { 0x8D94 } - static let RGB_INTEGER: GLenum = 0x8D98 + static var RGB_INTEGER: GLenum { 0x8D98 } - static let RGBA_INTEGER: GLenum = 0x8D99 + static var RGBA_INTEGER: GLenum { 0x8D99 } - static let SAMPLER_2D_ARRAY: GLenum = 0x8DC1 + static var SAMPLER_2D_ARRAY: GLenum { 0x8DC1 } - static let SAMPLER_2D_ARRAY_SHADOW: GLenum = 0x8DC4 + static var SAMPLER_2D_ARRAY_SHADOW: GLenum { 0x8DC4 } - static let SAMPLER_CUBE_SHADOW: GLenum = 0x8DC5 + static var SAMPLER_CUBE_SHADOW: GLenum { 0x8DC5 } - static let UNSIGNED_INT_VEC2: GLenum = 0x8DC6 + static var UNSIGNED_INT_VEC2: GLenum { 0x8DC6 } - static let UNSIGNED_INT_VEC3: GLenum = 0x8DC7 + static var UNSIGNED_INT_VEC3: GLenum { 0x8DC7 } - static let UNSIGNED_INT_VEC4: GLenum = 0x8DC8 + static var UNSIGNED_INT_VEC4: GLenum { 0x8DC8 } - static let INT_SAMPLER_2D: GLenum = 0x8DCA + static var INT_SAMPLER_2D: GLenum { 0x8DCA } - static let INT_SAMPLER_3D: GLenum = 0x8DCB + static var INT_SAMPLER_3D: GLenum { 0x8DCB } - static let INT_SAMPLER_CUBE: GLenum = 0x8DCC + static var INT_SAMPLER_CUBE: GLenum { 0x8DCC } - static let INT_SAMPLER_2D_ARRAY: GLenum = 0x8DCF + static var INT_SAMPLER_2D_ARRAY: GLenum { 0x8DCF } - static let UNSIGNED_INT_SAMPLER_2D: GLenum = 0x8DD2 + static var UNSIGNED_INT_SAMPLER_2D: GLenum { 0x8DD2 } - static let UNSIGNED_INT_SAMPLER_3D: GLenum = 0x8DD3 + static var UNSIGNED_INT_SAMPLER_3D: GLenum { 0x8DD3 } - static let UNSIGNED_INT_SAMPLER_CUBE: GLenum = 0x8DD4 + static var UNSIGNED_INT_SAMPLER_CUBE: GLenum { 0x8DD4 } - static let UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum = 0x8DD7 + static var UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum { 0x8DD7 } - static let DEPTH_COMPONENT32F: GLenum = 0x8CAC + static var DEPTH_COMPONENT32F: GLenum { 0x8CAC } - static let DEPTH32F_STENCIL8: GLenum = 0x8CAD + static var DEPTH32F_STENCIL8: GLenum { 0x8CAD } - static let FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum = 0x8DAD + static var FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum { 0x8DAD } - static let FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum = 0x8210 + static var FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum { 0x8210 } - static let FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum = 0x8211 + static var FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum { 0x8211 } - static let FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum = 0x8212 + static var FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum { 0x8212 } - static let FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum = 0x8213 + static var FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum { 0x8213 } - static let FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum = 0x8214 + static var FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum { 0x8214 } - static let FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum = 0x8215 + static var FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum { 0x8215 } - static let FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum = 0x8216 + static var FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum { 0x8216 } - static let FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum = 0x8217 + static var FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum { 0x8217 } - static let FRAMEBUFFER_DEFAULT: GLenum = 0x8218 + static var FRAMEBUFFER_DEFAULT: GLenum { 0x8218 } - static let UNSIGNED_INT_24_8: GLenum = 0x84FA + static var UNSIGNED_INT_24_8: GLenum { 0x84FA } - static let DEPTH24_STENCIL8: GLenum = 0x88F0 + static var DEPTH24_STENCIL8: GLenum { 0x88F0 } - static let UNSIGNED_NORMALIZED: GLenum = 0x8C17 + static var UNSIGNED_NORMALIZED: GLenum { 0x8C17 } - static let DRAW_FRAMEBUFFER_BINDING: GLenum = 0x8CA6 + static var DRAW_FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } - static let READ_FRAMEBUFFER: GLenum = 0x8CA8 + static var READ_FRAMEBUFFER: GLenum { 0x8CA8 } - static let DRAW_FRAMEBUFFER: GLenum = 0x8CA9 + static var DRAW_FRAMEBUFFER: GLenum { 0x8CA9 } - static let READ_FRAMEBUFFER_BINDING: GLenum = 0x8CAA + static var READ_FRAMEBUFFER_BINDING: GLenum { 0x8CAA } - static let RENDERBUFFER_SAMPLES: GLenum = 0x8CAB + static var RENDERBUFFER_SAMPLES: GLenum { 0x8CAB } - static let FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum = 0x8CD4 + static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum { 0x8CD4 } - static let MAX_COLOR_ATTACHMENTS: GLenum = 0x8CDF + static var MAX_COLOR_ATTACHMENTS: GLenum { 0x8CDF } - static let COLOR_ATTACHMENT1: GLenum = 0x8CE1 + static var COLOR_ATTACHMENT1: GLenum { 0x8CE1 } - static let COLOR_ATTACHMENT2: GLenum = 0x8CE2 + static var COLOR_ATTACHMENT2: GLenum { 0x8CE2 } - static let COLOR_ATTACHMENT3: GLenum = 0x8CE3 + static var COLOR_ATTACHMENT3: GLenum { 0x8CE3 } - static let COLOR_ATTACHMENT4: GLenum = 0x8CE4 + static var COLOR_ATTACHMENT4: GLenum { 0x8CE4 } - static let COLOR_ATTACHMENT5: GLenum = 0x8CE5 + static var COLOR_ATTACHMENT5: GLenum { 0x8CE5 } - static let COLOR_ATTACHMENT6: GLenum = 0x8CE6 + static var COLOR_ATTACHMENT6: GLenum { 0x8CE6 } - static let COLOR_ATTACHMENT7: GLenum = 0x8CE7 + static var COLOR_ATTACHMENT7: GLenum { 0x8CE7 } - static let COLOR_ATTACHMENT8: GLenum = 0x8CE8 + static var COLOR_ATTACHMENT8: GLenum { 0x8CE8 } - static let COLOR_ATTACHMENT9: GLenum = 0x8CE9 + static var COLOR_ATTACHMENT9: GLenum { 0x8CE9 } - static let COLOR_ATTACHMENT10: GLenum = 0x8CEA + static var COLOR_ATTACHMENT10: GLenum { 0x8CEA } - static let COLOR_ATTACHMENT11: GLenum = 0x8CEB + static var COLOR_ATTACHMENT11: GLenum { 0x8CEB } - static let COLOR_ATTACHMENT12: GLenum = 0x8CEC + static var COLOR_ATTACHMENT12: GLenum { 0x8CEC } - static let COLOR_ATTACHMENT13: GLenum = 0x8CED + static var COLOR_ATTACHMENT13: GLenum { 0x8CED } - static let COLOR_ATTACHMENT14: GLenum = 0x8CEE + static var COLOR_ATTACHMENT14: GLenum { 0x8CEE } - static let COLOR_ATTACHMENT15: GLenum = 0x8CEF + static var COLOR_ATTACHMENT15: GLenum { 0x8CEF } - static let FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum = 0x8D56 + static var FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum { 0x8D56 } - static let MAX_SAMPLES: GLenum = 0x8D57 + static var MAX_SAMPLES: GLenum { 0x8D57 } - static let HALF_FLOAT: GLenum = 0x140B + static var HALF_FLOAT: GLenum { 0x140B } - static let RG: GLenum = 0x8227 + static var RG: GLenum { 0x8227 } - static let RG_INTEGER: GLenum = 0x8228 + static var RG_INTEGER: GLenum { 0x8228 } - static let R8: GLenum = 0x8229 + static var R8: GLenum { 0x8229 } - static let RG8: GLenum = 0x822B + static var RG8: GLenum { 0x822B } - static let R16F: GLenum = 0x822D + static var R16F: GLenum { 0x822D } - static let R32F: GLenum = 0x822E + static var R32F: GLenum { 0x822E } - static let RG16F: GLenum = 0x822F + static var RG16F: GLenum { 0x822F } - static let RG32F: GLenum = 0x8230 + static var RG32F: GLenum { 0x8230 } - static let R8I: GLenum = 0x8231 + static var R8I: GLenum { 0x8231 } - static let R8UI: GLenum = 0x8232 + static var R8UI: GLenum { 0x8232 } - static let R16I: GLenum = 0x8233 + static var R16I: GLenum { 0x8233 } - static let R16UI: GLenum = 0x8234 + static var R16UI: GLenum { 0x8234 } - static let R32I: GLenum = 0x8235 + static var R32I: GLenum { 0x8235 } - static let R32UI: GLenum = 0x8236 + static var R32UI: GLenum { 0x8236 } - static let RG8I: GLenum = 0x8237 + static var RG8I: GLenum { 0x8237 } - static let RG8UI: GLenum = 0x8238 + static var RG8UI: GLenum { 0x8238 } - static let RG16I: GLenum = 0x8239 + static var RG16I: GLenum { 0x8239 } - static let RG16UI: GLenum = 0x823A + static var RG16UI: GLenum { 0x823A } - static let RG32I: GLenum = 0x823B + static var RG32I: GLenum { 0x823B } - static let RG32UI: GLenum = 0x823C + static var RG32UI: GLenum { 0x823C } - static let VERTEX_ARRAY_BINDING: GLenum = 0x85B5 + static var VERTEX_ARRAY_BINDING: GLenum { 0x85B5 } - static let R8_SNORM: GLenum = 0x8F94 + static var R8_SNORM: GLenum { 0x8F94 } - static let RG8_SNORM: GLenum = 0x8F95 + static var RG8_SNORM: GLenum { 0x8F95 } - static let RGB8_SNORM: GLenum = 0x8F96 + static var RGB8_SNORM: GLenum { 0x8F96 } - static let RGBA8_SNORM: GLenum = 0x8F97 + static var RGBA8_SNORM: GLenum { 0x8F97 } - static let SIGNED_NORMALIZED: GLenum = 0x8F9C + static var SIGNED_NORMALIZED: GLenum { 0x8F9C } - static let COPY_READ_BUFFER: GLenum = 0x8F36 + static var COPY_READ_BUFFER: GLenum { 0x8F36 } - static let COPY_WRITE_BUFFER: GLenum = 0x8F37 + static var COPY_WRITE_BUFFER: GLenum { 0x8F37 } - static let COPY_READ_BUFFER_BINDING: GLenum = 0x8F36 + static var COPY_READ_BUFFER_BINDING: GLenum { 0x8F36 } - static let COPY_WRITE_BUFFER_BINDING: GLenum = 0x8F37 + static var COPY_WRITE_BUFFER_BINDING: GLenum { 0x8F37 } - static let UNIFORM_BUFFER: GLenum = 0x8A11 + static var UNIFORM_BUFFER: GLenum { 0x8A11 } - static let UNIFORM_BUFFER_BINDING: GLenum = 0x8A28 + static var UNIFORM_BUFFER_BINDING: GLenum { 0x8A28 } - static let UNIFORM_BUFFER_START: GLenum = 0x8A29 + static var UNIFORM_BUFFER_START: GLenum { 0x8A29 } - static let UNIFORM_BUFFER_SIZE: GLenum = 0x8A2A + static var UNIFORM_BUFFER_SIZE: GLenum { 0x8A2A } - static let MAX_VERTEX_UNIFORM_BLOCKS: GLenum = 0x8A2B + static var MAX_VERTEX_UNIFORM_BLOCKS: GLenum { 0x8A2B } - static let MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum = 0x8A2D + static var MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum { 0x8A2D } - static let MAX_COMBINED_UNIFORM_BLOCKS: GLenum = 0x8A2E + static var MAX_COMBINED_UNIFORM_BLOCKS: GLenum { 0x8A2E } - static let MAX_UNIFORM_BUFFER_BINDINGS: GLenum = 0x8A2F + static var MAX_UNIFORM_BUFFER_BINDINGS: GLenum { 0x8A2F } - static let MAX_UNIFORM_BLOCK_SIZE: GLenum = 0x8A30 + static var MAX_UNIFORM_BLOCK_SIZE: GLenum { 0x8A30 } - static let MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum = 0x8A31 + static var MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8A31 } - static let MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum = 0x8A33 + static var MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8A33 } - static let UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum = 0x8A34 + static var UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum { 0x8A34 } - static let ACTIVE_UNIFORM_BLOCKS: GLenum = 0x8A36 + static var ACTIVE_UNIFORM_BLOCKS: GLenum { 0x8A36 } - static let UNIFORM_TYPE: GLenum = 0x8A37 + static var UNIFORM_TYPE: GLenum { 0x8A37 } - static let UNIFORM_SIZE: GLenum = 0x8A38 + static var UNIFORM_SIZE: GLenum { 0x8A38 } - static let UNIFORM_BLOCK_INDEX: GLenum = 0x8A3A + static var UNIFORM_BLOCK_INDEX: GLenum { 0x8A3A } - static let UNIFORM_OFFSET: GLenum = 0x8A3B + static var UNIFORM_OFFSET: GLenum { 0x8A3B } - static let UNIFORM_ARRAY_STRIDE: GLenum = 0x8A3C + static var UNIFORM_ARRAY_STRIDE: GLenum { 0x8A3C } - static let UNIFORM_MATRIX_STRIDE: GLenum = 0x8A3D + static var UNIFORM_MATRIX_STRIDE: GLenum { 0x8A3D } - static let UNIFORM_IS_ROW_MAJOR: GLenum = 0x8A3E + static var UNIFORM_IS_ROW_MAJOR: GLenum { 0x8A3E } - static let UNIFORM_BLOCK_BINDING: GLenum = 0x8A3F + static var UNIFORM_BLOCK_BINDING: GLenum { 0x8A3F } - static let UNIFORM_BLOCK_DATA_SIZE: GLenum = 0x8A40 + static var UNIFORM_BLOCK_DATA_SIZE: GLenum { 0x8A40 } - static let UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum = 0x8A42 + static var UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum { 0x8A42 } - static let UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum = 0x8A43 + static var UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum { 0x8A43 } - static let UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum = 0x8A44 + static var UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum { 0x8A44 } - static let UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum = 0x8A46 + static var UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum { 0x8A46 } - static let INVALID_INDEX: GLenum = 0xFFFF_FFFF + static var INVALID_INDEX: GLenum { 0xFFFF_FFFF } - static let MAX_VERTEX_OUTPUT_COMPONENTS: GLenum = 0x9122 + static var MAX_VERTEX_OUTPUT_COMPONENTS: GLenum { 0x9122 } - static let MAX_FRAGMENT_INPUT_COMPONENTS: GLenum = 0x9125 + static var MAX_FRAGMENT_INPUT_COMPONENTS: GLenum { 0x9125 } - static let MAX_SERVER_WAIT_TIMEOUT: GLenum = 0x9111 + static var MAX_SERVER_WAIT_TIMEOUT: GLenum { 0x9111 } - static let OBJECT_TYPE: GLenum = 0x9112 + static var OBJECT_TYPE: GLenum { 0x9112 } - static let SYNC_CONDITION: GLenum = 0x9113 + static var SYNC_CONDITION: GLenum { 0x9113 } - static let SYNC_STATUS: GLenum = 0x9114 + static var SYNC_STATUS: GLenum { 0x9114 } - static let SYNC_FLAGS: GLenum = 0x9115 + static var SYNC_FLAGS: GLenum { 0x9115 } - static let SYNC_FENCE: GLenum = 0x9116 + static var SYNC_FENCE: GLenum { 0x9116 } - static let SYNC_GPU_COMMANDS_COMPLETE: GLenum = 0x9117 + static var SYNC_GPU_COMMANDS_COMPLETE: GLenum { 0x9117 } - static let UNSIGNALED: GLenum = 0x9118 + static var UNSIGNALED: GLenum { 0x9118 } - static let SIGNALED: GLenum = 0x9119 + static var SIGNALED: GLenum { 0x9119 } - static let ALREADY_SIGNALED: GLenum = 0x911A + static var ALREADY_SIGNALED: GLenum { 0x911A } - static let TIMEOUT_EXPIRED: GLenum = 0x911B + static var TIMEOUT_EXPIRED: GLenum { 0x911B } - static let CONDITION_SATISFIED: GLenum = 0x911C + static var CONDITION_SATISFIED: GLenum { 0x911C } - static let WAIT_FAILED: GLenum = 0x911D + static var WAIT_FAILED: GLenum { 0x911D } - static let SYNC_FLUSH_COMMANDS_BIT: GLenum = 0x0000_0001 + static var SYNC_FLUSH_COMMANDS_BIT: GLenum { 0x0000_0001 } - static let VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum = 0x88FE + static var VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum { 0x88FE } - static let ANY_SAMPLES_PASSED: GLenum = 0x8C2F + static var ANY_SAMPLES_PASSED: GLenum { 0x8C2F } - static let ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum = 0x8D6A + static var ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum { 0x8D6A } - static let SAMPLER_BINDING: GLenum = 0x8919 + static var SAMPLER_BINDING: GLenum { 0x8919 } - static let RGB10_A2UI: GLenum = 0x906F + static var RGB10_A2UI: GLenum { 0x906F } - static let INT_2_10_10_10_REV: GLenum = 0x8D9F + static var INT_2_10_10_10_REV: GLenum { 0x8D9F } - static let TRANSFORM_FEEDBACK: GLenum = 0x8E22 + static var TRANSFORM_FEEDBACK: GLenum { 0x8E22 } - static let TRANSFORM_FEEDBACK_PAUSED: GLenum = 0x8E23 + static var TRANSFORM_FEEDBACK_PAUSED: GLenum { 0x8E23 } - static let TRANSFORM_FEEDBACK_ACTIVE: GLenum = 0x8E24 + static var TRANSFORM_FEEDBACK_ACTIVE: GLenum { 0x8E24 } - static let TRANSFORM_FEEDBACK_BINDING: GLenum = 0x8E25 + static var TRANSFORM_FEEDBACK_BINDING: GLenum { 0x8E25 } - static let TEXTURE_IMMUTABLE_FORMAT: GLenum = 0x912F + static var TEXTURE_IMMUTABLE_FORMAT: GLenum { 0x912F } - static let MAX_ELEMENT_INDEX: GLenum = 0x8D6B + static var MAX_ELEMENT_INDEX: GLenum { 0x8D6B } - static let TEXTURE_IMMUTABLE_LEVELS: GLenum = 0x82DF + static var TEXTURE_IMMUTABLE_LEVELS: GLenum { 0x82DF } - static let TIMEOUT_IGNORED: GLint64 = -1 + static var TIMEOUT_IGNORED: GLint64 { -1 } - static let MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum = 0x9247 + static var MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum { 0x9247 } func copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) { let this = jsObject diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift index 16629fcb..dc95a975 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift @@ -5,597 +5,597 @@ import JavaScriptKit public protocol WebGLRenderingContextBase: JSBridgedClass {} public extension WebGLRenderingContextBase { - static let DEPTH_BUFFER_BIT: GLenum = 0x0000_0100 + static var DEPTH_BUFFER_BIT: GLenum { 0x0000_0100 } - static let STENCIL_BUFFER_BIT: GLenum = 0x0000_0400 + static var STENCIL_BUFFER_BIT: GLenum { 0x0000_0400 } - static let COLOR_BUFFER_BIT: GLenum = 0x0000_4000 + static var COLOR_BUFFER_BIT: GLenum { 0x0000_4000 } - static let POINTS: GLenum = 0x0000 + static var POINTS: GLenum { 0x0000 } - static let LINES: GLenum = 0x0001 + static var LINES: GLenum { 0x0001 } - static let LINE_LOOP: GLenum = 0x0002 + static var LINE_LOOP: GLenum { 0x0002 } - static let LINE_STRIP: GLenum = 0x0003 + static var LINE_STRIP: GLenum { 0x0003 } - static let TRIANGLES: GLenum = 0x0004 + static var TRIANGLES: GLenum { 0x0004 } - static let TRIANGLE_STRIP: GLenum = 0x0005 + static var TRIANGLE_STRIP: GLenum { 0x0005 } - static let TRIANGLE_FAN: GLenum = 0x0006 + static var TRIANGLE_FAN: GLenum { 0x0006 } - static let ZERO: GLenum = 0 + static var ZERO: GLenum { 0 } - static let ONE: GLenum = 1 + static var ONE: GLenum { 1 } - static let SRC_COLOR: GLenum = 0x0300 + static var SRC_COLOR: GLenum { 0x0300 } - static let ONE_MINUS_SRC_COLOR: GLenum = 0x0301 + static var ONE_MINUS_SRC_COLOR: GLenum { 0x0301 } - static let SRC_ALPHA: GLenum = 0x0302 + static var SRC_ALPHA: GLenum { 0x0302 } - static let ONE_MINUS_SRC_ALPHA: GLenum = 0x0303 + static var ONE_MINUS_SRC_ALPHA: GLenum { 0x0303 } - static let DST_ALPHA: GLenum = 0x0304 + static var DST_ALPHA: GLenum { 0x0304 } - static let ONE_MINUS_DST_ALPHA: GLenum = 0x0305 + static var ONE_MINUS_DST_ALPHA: GLenum { 0x0305 } - static let DST_COLOR: GLenum = 0x0306 + static var DST_COLOR: GLenum { 0x0306 } - static let ONE_MINUS_DST_COLOR: GLenum = 0x0307 + static var ONE_MINUS_DST_COLOR: GLenum { 0x0307 } - static let SRC_ALPHA_SATURATE: GLenum = 0x0308 + static var SRC_ALPHA_SATURATE: GLenum { 0x0308 } - static let FUNC_ADD: GLenum = 0x8006 + static var FUNC_ADD: GLenum { 0x8006 } - static let BLEND_EQUATION: GLenum = 0x8009 + static var BLEND_EQUATION: GLenum { 0x8009 } - static let BLEND_EQUATION_RGB: GLenum = 0x8009 + static var BLEND_EQUATION_RGB: GLenum { 0x8009 } - static let BLEND_EQUATION_ALPHA: GLenum = 0x883D + static var BLEND_EQUATION_ALPHA: GLenum { 0x883D } - static let FUNC_SUBTRACT: GLenum = 0x800A + static var FUNC_SUBTRACT: GLenum { 0x800A } - static let FUNC_REVERSE_SUBTRACT: GLenum = 0x800B + static var FUNC_REVERSE_SUBTRACT: GLenum { 0x800B } - static let BLEND_DST_RGB: GLenum = 0x80C8 + static var BLEND_DST_RGB: GLenum { 0x80C8 } - static let BLEND_SRC_RGB: GLenum = 0x80C9 + static var BLEND_SRC_RGB: GLenum { 0x80C9 } - static let BLEND_DST_ALPHA: GLenum = 0x80CA + static var BLEND_DST_ALPHA: GLenum { 0x80CA } - static let BLEND_SRC_ALPHA: GLenum = 0x80CB + static var BLEND_SRC_ALPHA: GLenum { 0x80CB } - static let CONSTANT_COLOR: GLenum = 0x8001 + static var CONSTANT_COLOR: GLenum { 0x8001 } - static let ONE_MINUS_CONSTANT_COLOR: GLenum = 0x8002 + static var ONE_MINUS_CONSTANT_COLOR: GLenum { 0x8002 } - static let CONSTANT_ALPHA: GLenum = 0x8003 + static var CONSTANT_ALPHA: GLenum { 0x8003 } - static let ONE_MINUS_CONSTANT_ALPHA: GLenum = 0x8004 + static var ONE_MINUS_CONSTANT_ALPHA: GLenum { 0x8004 } - static let BLEND_COLOR: GLenum = 0x8005 + static var BLEND_COLOR: GLenum { 0x8005 } - static let ARRAY_BUFFER: GLenum = 0x8892 + static var ARRAY_BUFFER: GLenum { 0x8892 } - static let ELEMENT_ARRAY_BUFFER: GLenum = 0x8893 + static var ELEMENT_ARRAY_BUFFER: GLenum { 0x8893 } - static let ARRAY_BUFFER_BINDING: GLenum = 0x8894 + static var ARRAY_BUFFER_BINDING: GLenum { 0x8894 } - static let ELEMENT_ARRAY_BUFFER_BINDING: GLenum = 0x8895 + static var ELEMENT_ARRAY_BUFFER_BINDING: GLenum { 0x8895 } - static let STREAM_DRAW: GLenum = 0x88E0 + static var STREAM_DRAW: GLenum { 0x88E0 } - static let STATIC_DRAW: GLenum = 0x88E4 + static var STATIC_DRAW: GLenum { 0x88E4 } - static let DYNAMIC_DRAW: GLenum = 0x88E8 + static var DYNAMIC_DRAW: GLenum { 0x88E8 } - static let BUFFER_SIZE: GLenum = 0x8764 + static var BUFFER_SIZE: GLenum { 0x8764 } - static let BUFFER_USAGE: GLenum = 0x8765 + static var BUFFER_USAGE: GLenum { 0x8765 } - static let CURRENT_VERTEX_ATTRIB: GLenum = 0x8626 + static var CURRENT_VERTEX_ATTRIB: GLenum { 0x8626 } - static let FRONT: GLenum = 0x0404 + static var FRONT: GLenum { 0x0404 } - static let BACK: GLenum = 0x0405 + static var BACK: GLenum { 0x0405 } - static let FRONT_AND_BACK: GLenum = 0x0408 + static var FRONT_AND_BACK: GLenum { 0x0408 } - static let CULL_FACE: GLenum = 0x0B44 + static var CULL_FACE: GLenum { 0x0B44 } - static let BLEND: GLenum = 0x0BE2 + static var BLEND: GLenum { 0x0BE2 } - static let DITHER: GLenum = 0x0BD0 + static var DITHER: GLenum { 0x0BD0 } - static let STENCIL_TEST: GLenum = 0x0B90 + static var STENCIL_TEST: GLenum { 0x0B90 } - static let DEPTH_TEST: GLenum = 0x0B71 + static var DEPTH_TEST: GLenum { 0x0B71 } - static let SCISSOR_TEST: GLenum = 0x0C11 + static var SCISSOR_TEST: GLenum { 0x0C11 } - static let POLYGON_OFFSET_FILL: GLenum = 0x8037 + static var POLYGON_OFFSET_FILL: GLenum { 0x8037 } - static let SAMPLE_ALPHA_TO_COVERAGE: GLenum = 0x809E + static var SAMPLE_ALPHA_TO_COVERAGE: GLenum { 0x809E } - static let SAMPLE_COVERAGE: GLenum = 0x80A0 + static var SAMPLE_COVERAGE: GLenum { 0x80A0 } - static let NO_ERROR: GLenum = 0 + static var NO_ERROR: GLenum { 0 } - static let INVALID_ENUM: GLenum = 0x0500 + static var INVALID_ENUM: GLenum { 0x0500 } - static let INVALID_VALUE: GLenum = 0x0501 + static var INVALID_VALUE: GLenum { 0x0501 } - static let INVALID_OPERATION: GLenum = 0x0502 + static var INVALID_OPERATION: GLenum { 0x0502 } - static let OUT_OF_MEMORY: GLenum = 0x0505 + static var OUT_OF_MEMORY: GLenum { 0x0505 } - static let CW: GLenum = 0x0900 + static var CW: GLenum { 0x0900 } - static let CCW: GLenum = 0x0901 + static var CCW: GLenum { 0x0901 } - static let LINE_WIDTH: GLenum = 0x0B21 + static var LINE_WIDTH: GLenum { 0x0B21 } - static let ALIASED_POINT_SIZE_RANGE: GLenum = 0x846D + static var ALIASED_POINT_SIZE_RANGE: GLenum { 0x846D } - static let ALIASED_LINE_WIDTH_RANGE: GLenum = 0x846E + static var ALIASED_LINE_WIDTH_RANGE: GLenum { 0x846E } - static let CULL_FACE_MODE: GLenum = 0x0B45 + static var CULL_FACE_MODE: GLenum { 0x0B45 } - static let FRONT_FACE: GLenum = 0x0B46 + static var FRONT_FACE: GLenum { 0x0B46 } - static let DEPTH_RANGE: GLenum = 0x0B70 + static var DEPTH_RANGE: GLenum { 0x0B70 } - static let DEPTH_WRITEMASK: GLenum = 0x0B72 + static var DEPTH_WRITEMASK: GLenum { 0x0B72 } - static let DEPTH_CLEAR_VALUE: GLenum = 0x0B73 + static var DEPTH_CLEAR_VALUE: GLenum { 0x0B73 } - static let DEPTH_FUNC: GLenum = 0x0B74 + static var DEPTH_FUNC: GLenum { 0x0B74 } - static let STENCIL_CLEAR_VALUE: GLenum = 0x0B91 + static var STENCIL_CLEAR_VALUE: GLenum { 0x0B91 } - static let STENCIL_FUNC: GLenum = 0x0B92 + static var STENCIL_FUNC: GLenum { 0x0B92 } - static let STENCIL_FAIL: GLenum = 0x0B94 + static var STENCIL_FAIL: GLenum { 0x0B94 } - static let STENCIL_PASS_DEPTH_FAIL: GLenum = 0x0B95 + static var STENCIL_PASS_DEPTH_FAIL: GLenum { 0x0B95 } - static let STENCIL_PASS_DEPTH_PASS: GLenum = 0x0B96 + static var STENCIL_PASS_DEPTH_PASS: GLenum { 0x0B96 } - static let STENCIL_REF: GLenum = 0x0B97 + static var STENCIL_REF: GLenum { 0x0B97 } - static let STENCIL_VALUE_MASK: GLenum = 0x0B93 + static var STENCIL_VALUE_MASK: GLenum { 0x0B93 } - static let STENCIL_WRITEMASK: GLenum = 0x0B98 + static var STENCIL_WRITEMASK: GLenum { 0x0B98 } - static let STENCIL_BACK_FUNC: GLenum = 0x8800 + static var STENCIL_BACK_FUNC: GLenum { 0x8800 } - static let STENCIL_BACK_FAIL: GLenum = 0x8801 + static var STENCIL_BACK_FAIL: GLenum { 0x8801 } - static let STENCIL_BACK_PASS_DEPTH_FAIL: GLenum = 0x8802 + static var STENCIL_BACK_PASS_DEPTH_FAIL: GLenum { 0x8802 } - static let STENCIL_BACK_PASS_DEPTH_PASS: GLenum = 0x8803 + static var STENCIL_BACK_PASS_DEPTH_PASS: GLenum { 0x8803 } - static let STENCIL_BACK_REF: GLenum = 0x8CA3 + static var STENCIL_BACK_REF: GLenum { 0x8CA3 } - static let STENCIL_BACK_VALUE_MASK: GLenum = 0x8CA4 + static var STENCIL_BACK_VALUE_MASK: GLenum { 0x8CA4 } - static let STENCIL_BACK_WRITEMASK: GLenum = 0x8CA5 + static var STENCIL_BACK_WRITEMASK: GLenum { 0x8CA5 } - static let VIEWPORT: GLenum = 0x0BA2 + static var VIEWPORT: GLenum { 0x0BA2 } - static let SCISSOR_BOX: GLenum = 0x0C10 + static var SCISSOR_BOX: GLenum { 0x0C10 } - static let COLOR_CLEAR_VALUE: GLenum = 0x0C22 + static var COLOR_CLEAR_VALUE: GLenum { 0x0C22 } - static let COLOR_WRITEMASK: GLenum = 0x0C23 + static var COLOR_WRITEMASK: GLenum { 0x0C23 } - static let UNPACK_ALIGNMENT: GLenum = 0x0CF5 + static var UNPACK_ALIGNMENT: GLenum { 0x0CF5 } - static let PACK_ALIGNMENT: GLenum = 0x0D05 + static var PACK_ALIGNMENT: GLenum { 0x0D05 } - static let MAX_TEXTURE_SIZE: GLenum = 0x0D33 + static var MAX_TEXTURE_SIZE: GLenum { 0x0D33 } - static let MAX_VIEWPORT_DIMS: GLenum = 0x0D3A + static var MAX_VIEWPORT_DIMS: GLenum { 0x0D3A } - static let SUBPIXEL_BITS: GLenum = 0x0D50 + static var SUBPIXEL_BITS: GLenum { 0x0D50 } - static let RED_BITS: GLenum = 0x0D52 + static var RED_BITS: GLenum { 0x0D52 } - static let GREEN_BITS: GLenum = 0x0D53 + static var GREEN_BITS: GLenum { 0x0D53 } - static let BLUE_BITS: GLenum = 0x0D54 + static var BLUE_BITS: GLenum { 0x0D54 } - static let ALPHA_BITS: GLenum = 0x0D55 + static var ALPHA_BITS: GLenum { 0x0D55 } - static let DEPTH_BITS: GLenum = 0x0D56 + static var DEPTH_BITS: GLenum { 0x0D56 } - static let STENCIL_BITS: GLenum = 0x0D57 + static var STENCIL_BITS: GLenum { 0x0D57 } - static let POLYGON_OFFSET_UNITS: GLenum = 0x2A00 + static var POLYGON_OFFSET_UNITS: GLenum { 0x2A00 } - static let POLYGON_OFFSET_FACTOR: GLenum = 0x8038 + static var POLYGON_OFFSET_FACTOR: GLenum { 0x8038 } - static let TEXTURE_BINDING_2D: GLenum = 0x8069 + static var TEXTURE_BINDING_2D: GLenum { 0x8069 } - static let SAMPLE_BUFFERS: GLenum = 0x80A8 + static var SAMPLE_BUFFERS: GLenum { 0x80A8 } - static let SAMPLES: GLenum = 0x80A9 + static var SAMPLES: GLenum { 0x80A9 } - static let SAMPLE_COVERAGE_VALUE: GLenum = 0x80AA + static var SAMPLE_COVERAGE_VALUE: GLenum { 0x80AA } - static let SAMPLE_COVERAGE_INVERT: GLenum = 0x80AB + static var SAMPLE_COVERAGE_INVERT: GLenum { 0x80AB } - static let COMPRESSED_TEXTURE_FORMATS: GLenum = 0x86A3 + static var COMPRESSED_TEXTURE_FORMATS: GLenum { 0x86A3 } - static let DONT_CARE: GLenum = 0x1100 + static var DONT_CARE: GLenum { 0x1100 } - static let FASTEST: GLenum = 0x1101 + static var FASTEST: GLenum { 0x1101 } - static let NICEST: GLenum = 0x1102 + static var NICEST: GLenum { 0x1102 } - static let GENERATE_MIPMAP_HINT: GLenum = 0x8192 + static var GENERATE_MIPMAP_HINT: GLenum { 0x8192 } - static let BYTE: GLenum = 0x1400 + static var BYTE: GLenum { 0x1400 } - static let UNSIGNED_BYTE: GLenum = 0x1401 + static var UNSIGNED_BYTE: GLenum { 0x1401 } - static let SHORT: GLenum = 0x1402 + static var SHORT: GLenum { 0x1402 } - static let UNSIGNED_SHORT: GLenum = 0x1403 + static var UNSIGNED_SHORT: GLenum { 0x1403 } - static let INT: GLenum = 0x1404 + static var INT: GLenum { 0x1404 } - static let UNSIGNED_INT: GLenum = 0x1405 + static var UNSIGNED_INT: GLenum { 0x1405 } - static let FLOAT: GLenum = 0x1406 + static var FLOAT: GLenum { 0x1406 } - static let DEPTH_COMPONENT: GLenum = 0x1902 + static var DEPTH_COMPONENT: GLenum { 0x1902 } - static let ALPHA: GLenum = 0x1906 + static var ALPHA: GLenum { 0x1906 } - static let RGB: GLenum = 0x1907 + static var RGB: GLenum { 0x1907 } - static let RGBA: GLenum = 0x1908 + static var RGBA: GLenum { 0x1908 } - static let LUMINANCE: GLenum = 0x1909 + static var LUMINANCE: GLenum { 0x1909 } - static let LUMINANCE_ALPHA: GLenum = 0x190A + static var LUMINANCE_ALPHA: GLenum { 0x190A } - static let UNSIGNED_SHORT_4_4_4_4: GLenum = 0x8033 + static var UNSIGNED_SHORT_4_4_4_4: GLenum { 0x8033 } - static let UNSIGNED_SHORT_5_5_5_1: GLenum = 0x8034 + static var UNSIGNED_SHORT_5_5_5_1: GLenum { 0x8034 } - static let UNSIGNED_SHORT_5_6_5: GLenum = 0x8363 + static var UNSIGNED_SHORT_5_6_5: GLenum { 0x8363 } - static let FRAGMENT_SHADER: GLenum = 0x8B30 + static var FRAGMENT_SHADER: GLenum { 0x8B30 } - static let VERTEX_SHADER: GLenum = 0x8B31 + static var VERTEX_SHADER: GLenum { 0x8B31 } - static let MAX_VERTEX_ATTRIBS: GLenum = 0x8869 + static var MAX_VERTEX_ATTRIBS: GLenum { 0x8869 } - static let MAX_VERTEX_UNIFORM_VECTORS: GLenum = 0x8DFB + static var MAX_VERTEX_UNIFORM_VECTORS: GLenum { 0x8DFB } - static let MAX_VARYING_VECTORS: GLenum = 0x8DFC + static var MAX_VARYING_VECTORS: GLenum { 0x8DFC } - static let MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum = 0x8B4D + static var MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4D } - static let MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum = 0x8B4C + static var MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4C } - static let MAX_TEXTURE_IMAGE_UNITS: GLenum = 0x8872 + static var MAX_TEXTURE_IMAGE_UNITS: GLenum { 0x8872 } - static let MAX_FRAGMENT_UNIFORM_VECTORS: GLenum = 0x8DFD + static var MAX_FRAGMENT_UNIFORM_VECTORS: GLenum { 0x8DFD } - static let SHADER_TYPE: GLenum = 0x8B4F + static var SHADER_TYPE: GLenum { 0x8B4F } - static let DELETE_STATUS: GLenum = 0x8B80 + static var DELETE_STATUS: GLenum { 0x8B80 } - static let LINK_STATUS: GLenum = 0x8B82 + static var LINK_STATUS: GLenum { 0x8B82 } - static let VALIDATE_STATUS: GLenum = 0x8B83 + static var VALIDATE_STATUS: GLenum { 0x8B83 } - static let ATTACHED_SHADERS: GLenum = 0x8B85 + static var ATTACHED_SHADERS: GLenum { 0x8B85 } - static let ACTIVE_UNIFORMS: GLenum = 0x8B86 + static var ACTIVE_UNIFORMS: GLenum { 0x8B86 } - static let ACTIVE_ATTRIBUTES: GLenum = 0x8B89 + static var ACTIVE_ATTRIBUTES: GLenum { 0x8B89 } - static let SHADING_LANGUAGE_VERSION: GLenum = 0x8B8C + static var SHADING_LANGUAGE_VERSION: GLenum { 0x8B8C } - static let CURRENT_PROGRAM: GLenum = 0x8B8D + static var CURRENT_PROGRAM: GLenum { 0x8B8D } - static let NEVER: GLenum = 0x0200 + static var NEVER: GLenum { 0x0200 } - static let LESS: GLenum = 0x0201 + static var LESS: GLenum { 0x0201 } - static let EQUAL: GLenum = 0x0202 + static var EQUAL: GLenum { 0x0202 } - static let LEQUAL: GLenum = 0x0203 + static var LEQUAL: GLenum { 0x0203 } - static let GREATER: GLenum = 0x0204 + static var GREATER: GLenum { 0x0204 } - static let NOTEQUAL: GLenum = 0x0205 + static var NOTEQUAL: GLenum { 0x0205 } - static let GEQUAL: GLenum = 0x0206 + static var GEQUAL: GLenum { 0x0206 } - static let ALWAYS: GLenum = 0x0207 + static var ALWAYS: GLenum { 0x0207 } - static let KEEP: GLenum = 0x1E00 + static var KEEP: GLenum { 0x1E00 } - static let REPLACE: GLenum = 0x1E01 + static var REPLACE: GLenum { 0x1E01 } - static let INCR: GLenum = 0x1E02 + static var INCR: GLenum { 0x1E02 } - static let DECR: GLenum = 0x1E03 + static var DECR: GLenum { 0x1E03 } - static let INVERT: GLenum = 0x150A + static var INVERT: GLenum { 0x150A } - static let INCR_WRAP: GLenum = 0x8507 + static var INCR_WRAP: GLenum { 0x8507 } - static let DECR_WRAP: GLenum = 0x8508 + static var DECR_WRAP: GLenum { 0x8508 } - static let VENDOR: GLenum = 0x1F00 + static var VENDOR: GLenum { 0x1F00 } - static let RENDERER: GLenum = 0x1F01 + static var RENDERER: GLenum { 0x1F01 } - static let VERSION: GLenum = 0x1F02 + static var VERSION: GLenum { 0x1F02 } - static let NEAREST: GLenum = 0x2600 + static var NEAREST: GLenum { 0x2600 } - static let LINEAR: GLenum = 0x2601 + static var LINEAR: GLenum { 0x2601 } - static let NEAREST_MIPMAP_NEAREST: GLenum = 0x2700 + static var NEAREST_MIPMAP_NEAREST: GLenum { 0x2700 } - static let LINEAR_MIPMAP_NEAREST: GLenum = 0x2701 + static var LINEAR_MIPMAP_NEAREST: GLenum { 0x2701 } - static let NEAREST_MIPMAP_LINEAR: GLenum = 0x2702 + static var NEAREST_MIPMAP_LINEAR: GLenum { 0x2702 } - static let LINEAR_MIPMAP_LINEAR: GLenum = 0x2703 + static var LINEAR_MIPMAP_LINEAR: GLenum { 0x2703 } - static let TEXTURE_MAG_FILTER: GLenum = 0x2800 + static var TEXTURE_MAG_FILTER: GLenum { 0x2800 } - static let TEXTURE_MIN_FILTER: GLenum = 0x2801 + static var TEXTURE_MIN_FILTER: GLenum { 0x2801 } - static let TEXTURE_WRAP_S: GLenum = 0x2802 + static var TEXTURE_WRAP_S: GLenum { 0x2802 } - static let TEXTURE_WRAP_T: GLenum = 0x2803 + static var TEXTURE_WRAP_T: GLenum { 0x2803 } - static let TEXTURE_2D: GLenum = 0x0DE1 + static var TEXTURE_2D: GLenum { 0x0DE1 } - static let TEXTURE: GLenum = 0x1702 + static var TEXTURE: GLenum { 0x1702 } - static let TEXTURE_CUBE_MAP: GLenum = 0x8513 + static var TEXTURE_CUBE_MAP: GLenum { 0x8513 } - static let TEXTURE_BINDING_CUBE_MAP: GLenum = 0x8514 + static var TEXTURE_BINDING_CUBE_MAP: GLenum { 0x8514 } - static let TEXTURE_CUBE_MAP_POSITIVE_X: GLenum = 0x8515 + static var TEXTURE_CUBE_MAP_POSITIVE_X: GLenum { 0x8515 } - static let TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum = 0x8516 + static var TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum { 0x8516 } - static let TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum = 0x8517 + static var TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum { 0x8517 } - static let TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum = 0x8518 + static var TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum { 0x8518 } - static let TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum = 0x8519 + static var TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum { 0x8519 } - static let TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum = 0x851A + static var TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum { 0x851A } - static let MAX_CUBE_MAP_TEXTURE_SIZE: GLenum = 0x851C + static var MAX_CUBE_MAP_TEXTURE_SIZE: GLenum { 0x851C } - static let TEXTURE0: GLenum = 0x84C0 + static var TEXTURE0: GLenum { 0x84C0 } - static let TEXTURE1: GLenum = 0x84C1 + static var TEXTURE1: GLenum { 0x84C1 } - static let TEXTURE2: GLenum = 0x84C2 + static var TEXTURE2: GLenum { 0x84C2 } - static let TEXTURE3: GLenum = 0x84C3 + static var TEXTURE3: GLenum { 0x84C3 } - static let TEXTURE4: GLenum = 0x84C4 + static var TEXTURE4: GLenum { 0x84C4 } - static let TEXTURE5: GLenum = 0x84C5 + static var TEXTURE5: GLenum { 0x84C5 } - static let TEXTURE6: GLenum = 0x84C6 + static var TEXTURE6: GLenum { 0x84C6 } - static let TEXTURE7: GLenum = 0x84C7 + static var TEXTURE7: GLenum { 0x84C7 } - static let TEXTURE8: GLenum = 0x84C8 + static var TEXTURE8: GLenum { 0x84C8 } - static let TEXTURE9: GLenum = 0x84C9 + static var TEXTURE9: GLenum { 0x84C9 } - static let TEXTURE10: GLenum = 0x84CA + static var TEXTURE10: GLenum { 0x84CA } - static let TEXTURE11: GLenum = 0x84CB + static var TEXTURE11: GLenum { 0x84CB } - static let TEXTURE12: GLenum = 0x84CC + static var TEXTURE12: GLenum { 0x84CC } - static let TEXTURE13: GLenum = 0x84CD + static var TEXTURE13: GLenum { 0x84CD } - static let TEXTURE14: GLenum = 0x84CE + static var TEXTURE14: GLenum { 0x84CE } - static let TEXTURE15: GLenum = 0x84CF + static var TEXTURE15: GLenum { 0x84CF } - static let TEXTURE16: GLenum = 0x84D0 + static var TEXTURE16: GLenum { 0x84D0 } - static let TEXTURE17: GLenum = 0x84D1 + static var TEXTURE17: GLenum { 0x84D1 } - static let TEXTURE18: GLenum = 0x84D2 + static var TEXTURE18: GLenum { 0x84D2 } - static let TEXTURE19: GLenum = 0x84D3 + static var TEXTURE19: GLenum { 0x84D3 } - static let TEXTURE20: GLenum = 0x84D4 + static var TEXTURE20: GLenum { 0x84D4 } - static let TEXTURE21: GLenum = 0x84D5 + static var TEXTURE21: GLenum { 0x84D5 } - static let TEXTURE22: GLenum = 0x84D6 + static var TEXTURE22: GLenum { 0x84D6 } - static let TEXTURE23: GLenum = 0x84D7 + static var TEXTURE23: GLenum { 0x84D7 } - static let TEXTURE24: GLenum = 0x84D8 + static var TEXTURE24: GLenum { 0x84D8 } - static let TEXTURE25: GLenum = 0x84D9 + static var TEXTURE25: GLenum { 0x84D9 } - static let TEXTURE26: GLenum = 0x84DA + static var TEXTURE26: GLenum { 0x84DA } - static let TEXTURE27: GLenum = 0x84DB + static var TEXTURE27: GLenum { 0x84DB } - static let TEXTURE28: GLenum = 0x84DC + static var TEXTURE28: GLenum { 0x84DC } - static let TEXTURE29: GLenum = 0x84DD + static var TEXTURE29: GLenum { 0x84DD } - static let TEXTURE30: GLenum = 0x84DE + static var TEXTURE30: GLenum { 0x84DE } - static let TEXTURE31: GLenum = 0x84DF + static var TEXTURE31: GLenum { 0x84DF } - static let ACTIVE_TEXTURE: GLenum = 0x84E0 + static var ACTIVE_TEXTURE: GLenum { 0x84E0 } - static let REPEAT: GLenum = 0x2901 + static var REPEAT: GLenum { 0x2901 } - static let CLAMP_TO_EDGE: GLenum = 0x812F + static var CLAMP_TO_EDGE: GLenum { 0x812F } - static let MIRRORED_REPEAT: GLenum = 0x8370 + static var MIRRORED_REPEAT: GLenum { 0x8370 } - static let FLOAT_VEC2: GLenum = 0x8B50 + static var FLOAT_VEC2: GLenum { 0x8B50 } - static let FLOAT_VEC3: GLenum = 0x8B51 + static var FLOAT_VEC3: GLenum { 0x8B51 } - static let FLOAT_VEC4: GLenum = 0x8B52 + static var FLOAT_VEC4: GLenum { 0x8B52 } - static let INT_VEC2: GLenum = 0x8B53 + static var INT_VEC2: GLenum { 0x8B53 } - static let INT_VEC3: GLenum = 0x8B54 + static var INT_VEC3: GLenum { 0x8B54 } - static let INT_VEC4: GLenum = 0x8B55 + static var INT_VEC4: GLenum { 0x8B55 } - static let BOOL: GLenum = 0x8B56 + static var BOOL: GLenum { 0x8B56 } - static let BOOL_VEC2: GLenum = 0x8B57 + static var BOOL_VEC2: GLenum { 0x8B57 } - static let BOOL_VEC3: GLenum = 0x8B58 + static var BOOL_VEC3: GLenum { 0x8B58 } - static let BOOL_VEC4: GLenum = 0x8B59 + static var BOOL_VEC4: GLenum { 0x8B59 } - static let FLOAT_MAT2: GLenum = 0x8B5A + static var FLOAT_MAT2: GLenum { 0x8B5A } - static let FLOAT_MAT3: GLenum = 0x8B5B + static var FLOAT_MAT3: GLenum { 0x8B5B } - static let FLOAT_MAT4: GLenum = 0x8B5C + static var FLOAT_MAT4: GLenum { 0x8B5C } - static let SAMPLER_2D: GLenum = 0x8B5E + static var SAMPLER_2D: GLenum { 0x8B5E } - static let SAMPLER_CUBE: GLenum = 0x8B60 + static var SAMPLER_CUBE: GLenum { 0x8B60 } - static let VERTEX_ATTRIB_ARRAY_ENABLED: GLenum = 0x8622 + static var VERTEX_ATTRIB_ARRAY_ENABLED: GLenum { 0x8622 } - static let VERTEX_ATTRIB_ARRAY_SIZE: GLenum = 0x8623 + static var VERTEX_ATTRIB_ARRAY_SIZE: GLenum { 0x8623 } - static let VERTEX_ATTRIB_ARRAY_STRIDE: GLenum = 0x8624 + static var VERTEX_ATTRIB_ARRAY_STRIDE: GLenum { 0x8624 } - static let VERTEX_ATTRIB_ARRAY_TYPE: GLenum = 0x8625 + static var VERTEX_ATTRIB_ARRAY_TYPE: GLenum { 0x8625 } - static let VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum = 0x886A + static var VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum { 0x886A } - static let VERTEX_ATTRIB_ARRAY_POINTER: GLenum = 0x8645 + static var VERTEX_ATTRIB_ARRAY_POINTER: GLenum { 0x8645 } - static let VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum = 0x889F + static var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum { 0x889F } - static let IMPLEMENTATION_COLOR_READ_TYPE: GLenum = 0x8B9A + static var IMPLEMENTATION_COLOR_READ_TYPE: GLenum { 0x8B9A } - static let IMPLEMENTATION_COLOR_READ_FORMAT: GLenum = 0x8B9B + static var IMPLEMENTATION_COLOR_READ_FORMAT: GLenum { 0x8B9B } - static let COMPILE_STATUS: GLenum = 0x8B81 + static var COMPILE_STATUS: GLenum { 0x8B81 } - static let LOW_FLOAT: GLenum = 0x8DF0 + static var LOW_FLOAT: GLenum { 0x8DF0 } - static let MEDIUM_FLOAT: GLenum = 0x8DF1 + static var MEDIUM_FLOAT: GLenum { 0x8DF1 } - static let HIGH_FLOAT: GLenum = 0x8DF2 + static var HIGH_FLOAT: GLenum { 0x8DF2 } - static let LOW_INT: GLenum = 0x8DF3 + static var LOW_INT: GLenum { 0x8DF3 } - static let MEDIUM_INT: GLenum = 0x8DF4 + static var MEDIUM_INT: GLenum { 0x8DF4 } - static let HIGH_INT: GLenum = 0x8DF5 + static var HIGH_INT: GLenum { 0x8DF5 } - static let FRAMEBUFFER: GLenum = 0x8D40 + static var FRAMEBUFFER: GLenum { 0x8D40 } - static let RENDERBUFFER: GLenum = 0x8D41 + static var RENDERBUFFER: GLenum { 0x8D41 } - static let RGBA4: GLenum = 0x8056 + static var RGBA4: GLenum { 0x8056 } - static let RGB5_A1: GLenum = 0x8057 + static var RGB5_A1: GLenum { 0x8057 } - static let RGB565: GLenum = 0x8D62 + static var RGB565: GLenum { 0x8D62 } - static let DEPTH_COMPONENT16: GLenum = 0x81A5 + static var DEPTH_COMPONENT16: GLenum { 0x81A5 } - static let STENCIL_INDEX8: GLenum = 0x8D48 + static var STENCIL_INDEX8: GLenum { 0x8D48 } - static let DEPTH_STENCIL: GLenum = 0x84F9 + static var DEPTH_STENCIL: GLenum { 0x84F9 } - static let RENDERBUFFER_WIDTH: GLenum = 0x8D42 + static var RENDERBUFFER_WIDTH: GLenum { 0x8D42 } - static let RENDERBUFFER_HEIGHT: GLenum = 0x8D43 + static var RENDERBUFFER_HEIGHT: GLenum { 0x8D43 } - static let RENDERBUFFER_INTERNAL_FORMAT: GLenum = 0x8D44 + static var RENDERBUFFER_INTERNAL_FORMAT: GLenum { 0x8D44 } - static let RENDERBUFFER_RED_SIZE: GLenum = 0x8D50 + static var RENDERBUFFER_RED_SIZE: GLenum { 0x8D50 } - static let RENDERBUFFER_GREEN_SIZE: GLenum = 0x8D51 + static var RENDERBUFFER_GREEN_SIZE: GLenum { 0x8D51 } - static let RENDERBUFFER_BLUE_SIZE: GLenum = 0x8D52 + static var RENDERBUFFER_BLUE_SIZE: GLenum { 0x8D52 } - static let RENDERBUFFER_ALPHA_SIZE: GLenum = 0x8D53 + static var RENDERBUFFER_ALPHA_SIZE: GLenum { 0x8D53 } - static let RENDERBUFFER_DEPTH_SIZE: GLenum = 0x8D54 + static var RENDERBUFFER_DEPTH_SIZE: GLenum { 0x8D54 } - static let RENDERBUFFER_STENCIL_SIZE: GLenum = 0x8D55 + static var RENDERBUFFER_STENCIL_SIZE: GLenum { 0x8D55 } - static let FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum = 0x8CD0 + static var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum { 0x8CD0 } - static let FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum = 0x8CD1 + static var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum { 0x8CD1 } - static let FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum = 0x8CD2 + static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum { 0x8CD2 } - static let FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum = 0x8CD3 + static var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum { 0x8CD3 } - static let COLOR_ATTACHMENT0: GLenum = 0x8CE0 + static var COLOR_ATTACHMENT0: GLenum { 0x8CE0 } - static let DEPTH_ATTACHMENT: GLenum = 0x8D00 + static var DEPTH_ATTACHMENT: GLenum { 0x8D00 } - static let STENCIL_ATTACHMENT: GLenum = 0x8D20 + static var STENCIL_ATTACHMENT: GLenum { 0x8D20 } - static let DEPTH_STENCIL_ATTACHMENT: GLenum = 0x821A + static var DEPTH_STENCIL_ATTACHMENT: GLenum { 0x821A } - static let NONE: GLenum = 0 + static var NONE: GLenum { 0 } - static let FRAMEBUFFER_COMPLETE: GLenum = 0x8CD5 + static var FRAMEBUFFER_COMPLETE: GLenum { 0x8CD5 } - static let FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum = 0x8CD6 + static var FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum { 0x8CD6 } - static let FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum = 0x8CD7 + static var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum { 0x8CD7 } - static let FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum = 0x8CD9 + static var FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum { 0x8CD9 } - static let FRAMEBUFFER_UNSUPPORTED: GLenum = 0x8CDD + static var FRAMEBUFFER_UNSUPPORTED: GLenum { 0x8CDD } - static let FRAMEBUFFER_BINDING: GLenum = 0x8CA6 + static var FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } - static let RENDERBUFFER_BINDING: GLenum = 0x8CA7 + static var RENDERBUFFER_BINDING: GLenum { 0x8CA7 } - static let MAX_RENDERBUFFER_SIZE: GLenum = 0x84E8 + static var MAX_RENDERBUFFER_SIZE: GLenum { 0x84E8 } - static let INVALID_FRAMEBUFFER_OPERATION: GLenum = 0x0506 + static var INVALID_FRAMEBUFFER_OPERATION: GLenum { 0x0506 } - static let UNPACK_FLIP_Y_WEBGL: GLenum = 0x9240 + static var UNPACK_FLIP_Y_WEBGL: GLenum { 0x9240 } - static let UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum = 0x9241 + static var UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum { 0x9241 } - static let CONTEXT_LOST_WEBGL: GLenum = 0x9242 + static var CONTEXT_LOST_WEBGL: GLenum { 0x9242 } - static let UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum = 0x9243 + static var UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum { 0x9243 } - static let BROWSER_DEFAULT_WEBGL: GLenum = 0x9244 + static var BROWSER_DEFAULT_WEBGL: GLenum { 0x9244 } var canvas: __UNSUPPORTED_UNION__ { ReadonlyAttribute[Strings.canvas, in: jsObject] } diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index 36e0ac0a..a2e2e9ef 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -40,6 +40,7 @@ enum Context { private(set) var ignored: [String: Set]! private(set) var types: [String: IDLTypealias]! private(set) var override = false + private(set) var inProtocol = false static func `static`(this: SwiftSource, inClass: Bool = Context.inClass, className: SwiftSource) -> Self { var newState = Context.current @@ -50,11 +51,17 @@ enum Context { return newState } - static func instance(constructor: SwiftSource?, this: SwiftSource, className: SwiftSource) -> Self { + static func instance( + constructor: SwiftSource?, + this: SwiftSource, + className: SwiftSource, + inProtocol: Bool = Context.inProtocol + ) -> Self { var newState = Context.current newState.static = false newState.constructor = constructor newState.this = this + newState.inProtocol = inProtocol newState.className = className return newState } diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 04c25b5d..a7fafb82 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -69,8 +69,6 @@ enum IDLBuilder { "Window": ["requestIdleCallback"], "WindowOrWorkerGlobalScope": ["queueMicrotask"], "XRSession": ["requestAnimationFrame"], - // variadic functions are unsupported - "TrustedTypePolicyOptions": ["", "createHTML", "createScript", "createScriptURL"], // functions as return types are unsupported "CustomElementRegistry": ["define", "whenDefined"], // NodeFilter diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 6d43e164..cb55f181 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -239,7 +239,7 @@ extension IDLSetLikeDeclaration: SwiftRepresentable, Initializable { extension MergedMixin: SwiftRepresentable { var swiftRepresentation: SwiftSource { - Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name)")) { + Context.withState(.instance(constructor: nil, this: "jsObject", className: "\(name)", inProtocol: true)) { """ public protocol \(name): JSBridgedClass {} public extension \(name) { @@ -252,9 +252,16 @@ extension MergedMixin: SwiftRepresentable { extension IDLConstant: SwiftRepresentable, Initializable { var swiftRepresentation: SwiftSource { - """ - public static let \(name): \(idlType) = \(value) - """ + if Context.inProtocol { + // Static stored properties not supported in protocol extensions + return """ + public static var \(name): \(idlType) { \(value) } + """ + } else { + return """ + public static let \(name): \(idlType) = \(value) + """ + } } var initializer: SwiftSource? { nil } From 8a367b320dee0d27159ffc15f4e127db85e14981 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 12:12:13 -0400 Subject: [PATCH 100/124] Make things inlinable --- .../WebIDL/ANGLE_instanced_arrays.swift | 8 +- Sources/DOMKit/WebIDL/ARIAMixin.swift | 82 +- Sources/DOMKit/WebIDL/AbortController.swift | 6 +- Sources/DOMKit/WebIDL/AbortSignal.swift | 8 +- .../WebIDL/AbsoluteOrientationSensor.swift | 4 +- Sources/DOMKit/WebIDL/AbstractRange.swift | 2 +- Sources/DOMKit/WebIDL/AbstractWorker.swift | 2 +- Sources/DOMKit/WebIDL/Accelerometer.swift | 4 +- .../AccelerometerLocalCoordinateSystem.swift | 6 +- Sources/DOMKit/WebIDL/AlignSetting.swift | 6 +- Sources/DOMKit/WebIDL/AlphaOption.swift | 6 +- .../DOMKit/WebIDL/AmbientLightSensor.swift | 4 +- Sources/DOMKit/WebIDL/AnalyserNode.swift | 12 +- Sources/DOMKit/WebIDL/Animatable.swift | 4 +- Sources/DOMKit/WebIDL/Animation.swift | 20 +- Sources/DOMKit/WebIDL/AnimationEffect.swift | 16 +- Sources/DOMKit/WebIDL/AnimationEvent.swift | 4 +- .../WebIDL/AnimationFrameProvider.swift | 2 +- Sources/DOMKit/WebIDL/AnimationNodeList.swift | 4 +- .../DOMKit/WebIDL/AnimationPlayState.swift | 6 +- .../WebIDL/AnimationPlaybackEvent.swift | 4 +- .../DOMKit/WebIDL/AnimationReplaceState.swift | 6 +- Sources/DOMKit/WebIDL/AnimationTimeline.swift | 4 +- .../WebIDL/AnimationWorkletGlobalScope.swift | 2 +- .../WebIDL/AppBannerPromptOutcome.swift | 6 +- Sources/DOMKit/WebIDL/AppendMode.swift | 6 +- .../AttestationConveyancePreference.swift | 6 +- Sources/DOMKit/WebIDL/Attr.swift | 2 +- .../DOMKit/WebIDL/AttributionReporting.swift | 6 +- Sources/DOMKit/WebIDL/AudioBuffer.swift | 10 +- .../DOMKit/WebIDL/AudioBufferSourceNode.swift | 6 +- Sources/DOMKit/WebIDL/AudioContext.swift | 26 +- .../WebIDL/AudioContextLatencyCategory.swift | 6 +- Sources/DOMKit/WebIDL/AudioContextState.swift | 6 +- Sources/DOMKit/WebIDL/AudioData.swift | 12 +- Sources/DOMKit/WebIDL/AudioDecoder.swift | 20 +- .../DOMKit/WebIDL/AudioDestinationNode.swift | 2 +- Sources/DOMKit/WebIDL/AudioEncoder.swift | 20 +- Sources/DOMKit/WebIDL/AudioListener.swift | 6 +- Sources/DOMKit/WebIDL/AudioNode.swift | 20 +- Sources/DOMKit/WebIDL/AudioParam.swift | 16 +- Sources/DOMKit/WebIDL/AudioParamMap.swift | 2 +- .../DOMKit/WebIDL/AudioProcessingEvent.swift | 4 +- Sources/DOMKit/WebIDL/AudioSampleFormat.swift | 6 +- .../WebIDL/AudioScheduledSourceNode.swift | 6 +- Sources/DOMKit/WebIDL/AudioTrack.swift | 2 +- Sources/DOMKit/WebIDL/AudioTrackList.swift | 6 +- Sources/DOMKit/WebIDL/AudioWorklet.swift | 2 +- .../WebIDL/AudioWorkletGlobalScope.swift | 2 +- Sources/DOMKit/WebIDL/AudioWorkletNode.swift | 4 +- .../DOMKit/WebIDL/AudioWorkletProcessor.swift | 4 +- .../AuthenticatorAssertionResponse.swift | 2 +- .../WebIDL/AuthenticatorAttachment.swift | 6 +- .../AuthenticatorAttestationResponse.swift | 10 +- .../DOMKit/WebIDL/AuthenticatorResponse.swift | 2 +- .../WebIDL/AuthenticatorTransport.swift | 6 +- Sources/DOMKit/WebIDL/AutoKeyword.swift | 6 +- Sources/DOMKit/WebIDL/AutomationRate.swift | 6 +- Sources/DOMKit/WebIDL/AutoplayPolicy.swift | 6 +- .../WebIDL/AutoplayPolicyMediaType.swift | 6 +- .../DOMKit/WebIDL/BackgroundFetchEvent.swift | 4 +- .../WebIDL/BackgroundFetchFailureReason.swift | 6 +- .../WebIDL/BackgroundFetchManager.swift | 14 +- .../DOMKit/WebIDL/BackgroundFetchRecord.swift | 2 +- .../WebIDL/BackgroundFetchRegistration.swift | 14 +- .../DOMKit/WebIDL/BackgroundFetchResult.swift | 6 +- .../WebIDL/BackgroundFetchUpdateUIEvent.swift | 8 +- Sources/DOMKit/WebIDL/BarProp.swift | 2 +- Sources/DOMKit/WebIDL/BarcodeDetector.swift | 12 +- Sources/DOMKit/WebIDL/BarcodeFormat.swift | 6 +- Sources/DOMKit/WebIDL/BaseAudioContext.swift | 38 +- Sources/DOMKit/WebIDL/Baseline.swift | 2 +- Sources/DOMKit/WebIDL/BatteryManager.swift | 2 +- .../WebIDL/BeforeInstallPromptEvent.swift | 8 +- Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift | 2 +- Sources/DOMKit/WebIDL/BinaryType.swift | 6 +- Sources/DOMKit/WebIDL/BiquadFilterNode.swift | 6 +- Sources/DOMKit/WebIDL/BiquadFilterType.swift | 6 +- Sources/DOMKit/WebIDL/BitrateMode.swift | 6 +- Sources/DOMKit/WebIDL/Blob.swift | 16 +- Sources/DOMKit/WebIDL/BlobEvent.swift | 4 +- .../WebIDL/BlockFragmentationType.swift | 6 +- Sources/DOMKit/WebIDL/Bluetooth.swift | 14 +- .../WebIDL/BluetoothAdvertisingEvent.swift | 4 +- .../BluetoothCharacteristicProperties.swift | 2 +- Sources/DOMKit/WebIDL/BluetoothDevice.swift | 6 +- .../WebIDL/BluetoothDeviceEventHandlers.swift | 4 +- .../WebIDL/BluetoothManufacturerDataMap.swift | 2 +- .../WebIDL/BluetoothPermissionResult.swift | 2 +- .../BluetoothRemoteGATTCharacteristic.swift | 34 +- .../BluetoothRemoteGATTDescriptor.swift | 10 +- .../WebIDL/BluetoothRemoteGATTServer.swift | 16 +- .../WebIDL/BluetoothRemoteGATTService.swift | 18 +- .../WebIDL/BluetoothServiceDataMap.swift | 2 +- Sources/DOMKit/WebIDL/BluetoothUUID.swift | 10 +- Sources/DOMKit/WebIDL/Body.swift | 24 +- Sources/DOMKit/WebIDL/BreakToken.swift | 2 +- Sources/DOMKit/WebIDL/BreakType.swift | 6 +- Sources/DOMKit/WebIDL/BroadcastChannel.swift | 8 +- .../BrowserCaptureMediaStreamTrack.swift | 8 +- .../WebIDL/ByteLengthQueuingStrategy.swift | 4 +- Sources/DOMKit/WebIDL/CDATASection.swift | 2 +- .../WebIDL/CSPViolationReportBody.swift | 2 +- Sources/DOMKit/WebIDL/CSS.swift | 160 +- Sources/DOMKit/WebIDL/CSSAnimation.swift | 2 +- Sources/DOMKit/WebIDL/CSSBoxType.swift | 6 +- Sources/DOMKit/WebIDL/CSSColor.swift | 4 +- Sources/DOMKit/WebIDL/CSSColorValue.swift | 4 +- Sources/DOMKit/WebIDL/CSSConditionRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSContainerRule.swift | 2 +- .../DOMKit/WebIDL/CSSCounterStyleRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSFontFaceRule.swift | 2 +- .../WebIDL/CSSFontFeatureValuesMap.swift | 4 +- .../WebIDL/CSSFontFeatureValuesRule.swift | 2 +- .../WebIDL/CSSFontPaletteValuesRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSHSL.swift | 4 +- Sources/DOMKit/WebIDL/CSSHWB.swift | 4 +- Sources/DOMKit/WebIDL/CSSImageValue.swift | 2 +- Sources/DOMKit/WebIDL/CSSImportRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSKeyframeRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSKeyframesRule.swift | 8 +- Sources/DOMKit/WebIDL/CSSKeywordValue.swift | 4 +- Sources/DOMKit/WebIDL/CSSLCH.swift | 4 +- Sources/DOMKit/WebIDL/CSSLab.swift | 4 +- Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift | 2 +- .../DOMKit/WebIDL/CSSLayerStatementRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSMarginRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathClamp.swift | 4 +- Sources/DOMKit/WebIDL/CSSMathInvert.swift | 4 +- Sources/DOMKit/WebIDL/CSSMathMax.swift | 4 +- Sources/DOMKit/WebIDL/CSSMathMin.swift | 4 +- Sources/DOMKit/WebIDL/CSSMathNegate.swift | 4 +- Sources/DOMKit/WebIDL/CSSMathOperator.swift | 6 +- Sources/DOMKit/WebIDL/CSSMathProduct.swift | 4 +- Sources/DOMKit/WebIDL/CSSMathSum.swift | 4 +- Sources/DOMKit/WebIDL/CSSMathValue.swift | 2 +- .../DOMKit/WebIDL/CSSMatrixComponent.swift | 4 +- Sources/DOMKit/WebIDL/CSSMediaRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSNamespaceRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSNestingRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSNumericArray.swift | 4 +- .../DOMKit/WebIDL/CSSNumericBaseType.swift | 6 +- Sources/DOMKit/WebIDL/CSSNumericValue.swift | 22 +- Sources/DOMKit/WebIDL/CSSOKLCH.swift | 4 +- Sources/DOMKit/WebIDL/CSSOKLab.swift | 4 +- Sources/DOMKit/WebIDL/CSSPageRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserAtRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSParserBlock.swift | 6 +- .../DOMKit/WebIDL/CSSParserDeclaration.swift | 6 +- Sources/DOMKit/WebIDL/CSSParserFunction.swift | 6 +- .../WebIDL/CSSParserQualifiedRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSParserRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserValue.swift | 2 +- Sources/DOMKit/WebIDL/CSSPerspective.swift | 4 +- Sources/DOMKit/WebIDL/CSSPropertyRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSPseudoElement.swift | 4 +- Sources/DOMKit/WebIDL/CSSRGB.swift | 4 +- Sources/DOMKit/WebIDL/CSSRotate.swift | 6 +- Sources/DOMKit/WebIDL/CSSRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSRuleList.swift | 4 +- Sources/DOMKit/WebIDL/CSSScale.swift | 4 +- .../DOMKit/WebIDL/CSSScrollTimelineRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSSkew.swift | 4 +- Sources/DOMKit/WebIDL/CSSSkewX.swift | 4 +- Sources/DOMKit/WebIDL/CSSSkewY.swift | 4 +- .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 12 +- Sources/DOMKit/WebIDL/CSSStyleRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 18 +- Sources/DOMKit/WebIDL/CSSStyleValue.swift | 8 +- Sources/DOMKit/WebIDL/CSSSupportsRule.swift | 2 +- .../DOMKit/WebIDL/CSSTransformComponent.swift | 6 +- Sources/DOMKit/WebIDL/CSSTransformValue.swift | 8 +- Sources/DOMKit/WebIDL/CSSTransition.swift | 2 +- Sources/DOMKit/WebIDL/CSSTranslate.swift | 4 +- Sources/DOMKit/WebIDL/CSSUnitValue.swift | 4 +- Sources/DOMKit/WebIDL/CSSUnparsedValue.swift | 6 +- .../WebIDL/CSSVariableReferenceValue.swift | 4 +- Sources/DOMKit/WebIDL/CSSViewportRule.swift | 2 +- Sources/DOMKit/WebIDL/Cache.swift | 30 +- Sources/DOMKit/WebIDL/CacheStorage.swift | 22 +- .../DOMKit/WebIDL/CanMakePaymentEvent.swift | 6 +- Sources/DOMKit/WebIDL/CanPlayTypeResult.swift | 6 +- .../CanvasCaptureMediaStreamTrack.swift | 4 +- Sources/DOMKit/WebIDL/CanvasCompositing.swift | 4 +- Sources/DOMKit/WebIDL/CanvasDirection.swift | 6 +- Sources/DOMKit/WebIDL/CanvasDrawImage.swift | 6 +- Sources/DOMKit/WebIDL/CanvasDrawPath.swift | 22 +- Sources/DOMKit/WebIDL/CanvasFillRule.swift | 6 +- .../WebIDL/CanvasFillStrokeStyles.swift | 12 +- Sources/DOMKit/WebIDL/CanvasFilter.swift | 4 +- Sources/DOMKit/WebIDL/CanvasFilters.swift | 2 +- Sources/DOMKit/WebIDL/CanvasFontKerning.swift | 6 +- Sources/DOMKit/WebIDL/CanvasFontStretch.swift | 6 +- .../DOMKit/WebIDL/CanvasFontVariantCaps.swift | 6 +- Sources/DOMKit/WebIDL/CanvasGradient.swift | 4 +- Sources/DOMKit/WebIDL/CanvasImageData.swift | 10 +- .../DOMKit/WebIDL/CanvasImageSmoothing.swift | 4 +- Sources/DOMKit/WebIDL/CanvasLineCap.swift | 6 +- Sources/DOMKit/WebIDL/CanvasLineJoin.swift | 6 +- Sources/DOMKit/WebIDL/CanvasPath.swift | 20 +- .../WebIDL/CanvasPathDrawingStyles.swift | 14 +- Sources/DOMKit/WebIDL/CanvasPattern.swift | 4 +- Sources/DOMKit/WebIDL/CanvasRect.swift | 6 +- .../WebIDL/CanvasRenderingContext2D.swift | 4 +- .../DOMKit/WebIDL/CanvasShadowStyles.swift | 8 +- Sources/DOMKit/WebIDL/CanvasState.swift | 8 +- Sources/DOMKit/WebIDL/CanvasText.swift | 6 +- Sources/DOMKit/WebIDL/CanvasTextAlign.swift | 6 +- .../DOMKit/WebIDL/CanvasTextBaseline.swift | 6 +- .../WebIDL/CanvasTextDrawingStyles.swift | 20 +- .../DOMKit/WebIDL/CanvasTextRendering.swift | 6 +- Sources/DOMKit/WebIDL/CanvasTransform.swift | 16 +- .../DOMKit/WebIDL/CanvasUserInterface.swift | 8 +- Sources/DOMKit/WebIDL/CaretPosition.swift | 4 +- Sources/DOMKit/WebIDL/ChannelCountMode.swift | 6 +- .../DOMKit/WebIDL/ChannelInterpretation.swift | 6 +- Sources/DOMKit/WebIDL/ChannelMergerNode.swift | 4 +- .../DOMKit/WebIDL/ChannelSplitterNode.swift | 4 +- .../WebIDL/CharacterBoundsUpdateEvent.swift | 4 +- Sources/DOMKit/WebIDL/CharacterData.swift | 12 +- .../WebIDL/CharacteristicEventHandlers.swift | 2 +- Sources/DOMKit/WebIDL/ChildBreakToken.swift | 2 +- Sources/DOMKit/WebIDL/ChildDisplayType.swift | 6 +- Sources/DOMKit/WebIDL/ChildNode.swift | 8 +- Sources/DOMKit/WebIDL/Client.swift | 6 +- .../DOMKit/WebIDL/ClientLifecycleState.swift | 6 +- Sources/DOMKit/WebIDL/ClientType.swift | 6 +- Sources/DOMKit/WebIDL/Clients.swift | 18 +- Sources/DOMKit/WebIDL/Clipboard.swift | 18 +- Sources/DOMKit/WebIDL/ClipboardEvent.swift | 4 +- Sources/DOMKit/WebIDL/ClipboardItem.swift | 8 +- Sources/DOMKit/WebIDL/CloseEvent.swift | 4 +- Sources/DOMKit/WebIDL/CloseWatcher.swift | 8 +- Sources/DOMKit/WebIDL/CodecState.swift | 6 +- Sources/DOMKit/WebIDL/ColorGamut.swift | 6 +- .../DOMKit/WebIDL/ColorSpaceConversion.swift | 6 +- Sources/DOMKit/WebIDL/Comment.swift | 4 +- .../DOMKit/WebIDL/CompositeOperation.swift | 6 +- .../WebIDL/CompositeOperationOrAuto.swift | 6 +- Sources/DOMKit/WebIDL/CompositionEvent.swift | 6 +- Sources/DOMKit/WebIDL/CompressionStream.swift | 4 +- .../DOMKit/WebIDL/ComputePressureFactor.swift | 6 +- .../WebIDL/ComputePressureObserver.swift | 14 +- .../DOMKit/WebIDL/ComputePressureSource.swift | 6 +- .../DOMKit/WebIDL/ComputePressureState.swift | 6 +- Sources/DOMKit/WebIDL/ConnectionType.swift | 6 +- .../DOMKit/WebIDL/ConstantSourceNode.swift | 4 +- Sources/DOMKit/WebIDL/ContactAddress.swift | 4 +- Sources/DOMKit/WebIDL/ContactProperty.swift | 6 +- Sources/DOMKit/WebIDL/ContactsManager.swift | 10 +- Sources/DOMKit/WebIDL/ContentCategory.swift | 6 +- Sources/DOMKit/WebIDL/ContentIndex.swift | 14 +- Sources/DOMKit/WebIDL/ContentIndexEvent.swift | 4 +- Sources/DOMKit/WebIDL/ConvolverNode.swift | 4 +- Sources/DOMKit/WebIDL/CookieChangeEvent.swift | 4 +- Sources/DOMKit/WebIDL/CookieSameSite.swift | 6 +- Sources/DOMKit/WebIDL/CookieStore.swift | 34 +- .../DOMKit/WebIDL/CookieStoreManager.swift | 14 +- .../DOMKit/WebIDL/CountQueuingStrategy.swift | 4 +- Sources/DOMKit/WebIDL/CrashReportBody.swift | 4 +- Sources/DOMKit/WebIDL/Credential.swift | 4 +- .../CredentialMediationRequirement.swift | 6 +- .../DOMKit/WebIDL/CredentialUserData.swift | 4 +- .../DOMKit/WebIDL/CredentialsContainer.swift | 18 +- Sources/DOMKit/WebIDL/CropTarget.swift | 2 +- Sources/DOMKit/WebIDL/Crypto.swift | 6 +- Sources/DOMKit/WebIDL/CryptoKey.swift | 2 +- .../WebIDL/CursorCaptureConstraint.swift | 6 +- .../DOMKit/WebIDL/CustomElementRegistry.swift | 6 +- Sources/DOMKit/WebIDL/CustomEvent.swift | 6 +- Sources/DOMKit/WebIDL/CustomStateSet.swift | 4 +- Sources/DOMKit/WebIDL/DOMException.swift | 4 +- Sources/DOMKit/WebIDL/DOMImplementation.swift | 10 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 116 +- Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 46 +- Sources/DOMKit/WebIDL/DOMParser.swift | 6 +- .../WebIDL/DOMParserSupportedType.swift | 6 +- Sources/DOMKit/WebIDL/DOMPoint.swift | 20 +- Sources/DOMKit/WebIDL/DOMPointReadOnly.swift | 10 +- Sources/DOMKit/WebIDL/DOMQuad.swift | 12 +- Sources/DOMKit/WebIDL/DOMRect.swift | 20 +- Sources/DOMKit/WebIDL/DOMRectList.swift | 4 +- Sources/DOMKit/WebIDL/DOMRectReadOnly.swift | 8 +- Sources/DOMKit/WebIDL/DOMStringList.swift | 6 +- Sources/DOMKit/WebIDL/DOMStringMap.swift | 4 +- Sources/DOMKit/WebIDL/DOMTokenList.swift | 16 +- Sources/DOMKit/WebIDL/DataCue.swift | 4 +- Sources/DOMKit/WebIDL/DataTransfer.swift | 12 +- Sources/DOMKit/WebIDL/DataTransferItem.swift | 10 +- .../DOMKit/WebIDL/DataTransferItemList.swift | 12 +- .../DOMKit/WebIDL/DecompressionStream.swift | 4 +- .../WebIDL/DedicatedWorkerGlobalScope.swift | 8 +- Sources/DOMKit/WebIDL/DelayNode.swift | 4 +- .../DOMKit/WebIDL/DeprecationReportBody.swift | 4 +- Sources/DOMKit/WebIDL/DeviceMotionEvent.swift | 8 +- .../DeviceMotionEventAcceleration.swift | 2 +- .../DeviceMotionEventRotationRate.swift | 2 +- .../WebIDL/DeviceOrientationEvent.swift | 8 +- Sources/DOMKit/WebIDL/DevicePosture.swift | 2 +- Sources/DOMKit/WebIDL/DevicePostureType.swift | 6 +- .../DOMKit/WebIDL/DigitalGoodsService.swift | 18 +- Sources/DOMKit/WebIDL/DirectionSetting.swift | 6 +- .../WebIDL/DisplayCaptureSurfaceType.swift | 6 +- Sources/DOMKit/WebIDL/DistanceModelType.swift | 6 +- Sources/DOMKit/WebIDL/Document.swift | 100 +- .../DocumentAndElementEventHandlers.swift | 6 +- Sources/DOMKit/WebIDL/DocumentFragment.swift | 4 +- .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 14 +- .../DOMKit/WebIDL/DocumentReadyState.swift | 6 +- Sources/DOMKit/WebIDL/DocumentTimeline.swift | 4 +- Sources/DOMKit/WebIDL/DocumentType.swift | 2 +- .../WebIDL/DocumentVisibilityState.swift | 6 +- Sources/DOMKit/WebIDL/DragEvent.swift | 4 +- .../WebIDL/DynamicsCompressorNode.swift | 4 +- Sources/DOMKit/WebIDL/EXT_blend_minmax.swift | 2 +- .../WebIDL/EXT_clip_cull_distance.swift | 2 +- .../WebIDL/EXT_color_buffer_float.swift | 2 +- .../WebIDL/EXT_color_buffer_half_float.swift | 2 +- .../WebIDL/EXT_disjoint_timer_query.swift | 18 +- .../EXT_disjoint_timer_query_webgl2.swift | 4 +- Sources/DOMKit/WebIDL/EXT_float_blend.swift | 2 +- Sources/DOMKit/WebIDL/EXT_frag_depth.swift | 2 +- Sources/DOMKit/WebIDL/EXT_sRGB.swift | 2 +- .../WebIDL/EXT_shader_texture_lod.swift | 2 +- .../WebIDL/EXT_texture_compression_bptc.swift | 2 +- .../WebIDL/EXT_texture_compression_rgtc.swift | 2 +- .../EXT_texture_filter_anisotropic.swift | 2 +- .../DOMKit/WebIDL/EXT_texture_norm16.swift | 2 +- Sources/DOMKit/WebIDL/Edge.swift | 6 +- Sources/DOMKit/WebIDL/EditContext.swift | 18 +- .../WebIDL/EffectiveConnectionType.swift | 6 +- Sources/DOMKit/WebIDL/Element.swift | 98 +- .../DOMKit/WebIDL/ElementCSSInlineStyle.swift | 4 +- .../WebIDL/ElementContentEditable.swift | 10 +- Sources/DOMKit/WebIDL/ElementInternals.swift | 10 +- Sources/DOMKit/WebIDL/EncodedAudioChunk.swift | 6 +- .../DOMKit/WebIDL/EncodedAudioChunkType.swift | 6 +- Sources/DOMKit/WebIDL/EncodedVideoChunk.swift | 6 +- .../DOMKit/WebIDL/EncodedVideoChunkType.swift | 6 +- Sources/DOMKit/WebIDL/EndOfStreamError.swift | 6 +- Sources/DOMKit/WebIDL/EndingType.swift | 6 +- Sources/DOMKit/WebIDL/ErrorEvent.swift | 4 +- Sources/DOMKit/WebIDL/Event.swift | 14 +- Sources/DOMKit/WebIDL/EventCounts.swift | 2 +- Sources/DOMKit/WebIDL/EventSource.swift | 6 +- Sources/DOMKit/WebIDL/EventTarget.swift | 6 +- .../WebIDL/ExtendableCookieChangeEvent.swift | 4 +- Sources/DOMKit/WebIDL/ExtendableEvent.swift | 6 +- .../WebIDL/ExtendableMessageEvent.swift | 4 +- Sources/DOMKit/WebIDL/External.swift | 6 +- Sources/DOMKit/WebIDL/EyeDropper.swift | 8 +- Sources/DOMKit/WebIDL/FaceDetector.swift | 8 +- .../DOMKit/WebIDL/FederatedCredential.swift | 4 +- Sources/DOMKit/WebIDL/FetchEvent.swift | 6 +- Sources/DOMKit/WebIDL/FetchPriority.swift | 6 +- Sources/DOMKit/WebIDL/File.swift | 4 +- Sources/DOMKit/WebIDL/FileList.swift | 4 +- Sources/DOMKit/WebIDL/FileReader.swift | 14 +- Sources/DOMKit/WebIDL/FileReaderSync.swift | 12 +- Sources/DOMKit/WebIDL/FileSystem.swift | 2 +- .../WebIDL/FileSystemDirectoryEntry.swift | 4 +- .../WebIDL/FileSystemDirectoryHandle.swift | 18 +- .../WebIDL/FileSystemDirectoryReader.swift | 2 +- Sources/DOMKit/WebIDL/FileSystemEntry.swift | 2 +- .../DOMKit/WebIDL/FileSystemFileEntry.swift | 2 +- .../DOMKit/WebIDL/FileSystemFileHandle.swift | 10 +- Sources/DOMKit/WebIDL/FileSystemHandle.swift | 14 +- .../DOMKit/WebIDL/FileSystemHandleKind.swift | 6 +- .../WebIDL/FileSystemPermissionMode.swift | 6 +- .../WebIDL/FileSystemWritableFileStream.swift | 14 +- Sources/DOMKit/WebIDL/FillLightMode.swift | 6 +- Sources/DOMKit/WebIDL/FillMode.swift | 6 +- Sources/DOMKit/WebIDL/FlowControlType.swift | 6 +- Sources/DOMKit/WebIDL/FocusEvent.swift | 4 +- .../WebIDL/FocusableAreaSearchMode.swift | 6 +- Sources/DOMKit/WebIDL/Font.swift | 2 +- Sources/DOMKit/WebIDL/FontFace.swift | 8 +- Sources/DOMKit/WebIDL/FontFaceFeatures.swift | 2 +- .../DOMKit/WebIDL/FontFaceLoadStatus.swift | 6 +- Sources/DOMKit/WebIDL/FontFacePalette.swift | 4 +- Sources/DOMKit/WebIDL/FontFacePalettes.swift | 4 +- Sources/DOMKit/WebIDL/FontFaceSet.swift | 16 +- .../DOMKit/WebIDL/FontFaceSetLoadEvent.swift | 4 +- .../DOMKit/WebIDL/FontFaceSetLoadStatus.swift | 6 +- Sources/DOMKit/WebIDL/FontFaceSource.swift | 2 +- .../DOMKit/WebIDL/FontFaceVariationAxis.swift | 2 +- .../DOMKit/WebIDL/FontFaceVariations.swift | 2 +- Sources/DOMKit/WebIDL/FontManager.swift | 6 +- Sources/DOMKit/WebIDL/FontMetadata.swift | 6 +- Sources/DOMKit/WebIDL/FontMetrics.swift | 2 +- Sources/DOMKit/WebIDL/FormData.swift | 20 +- Sources/DOMKit/WebIDL/FormDataEvent.swift | 4 +- Sources/DOMKit/WebIDL/FragmentDirective.swift | 2 +- Sources/DOMKit/WebIDL/FragmentResult.swift | 4 +- Sources/DOMKit/WebIDL/FrameType.swift | 6 +- .../WebIDL/FullscreenNavigationUI.swift | 6 +- Sources/DOMKit/WebIDL/GPU.swift | 6 +- Sources/DOMKit/WebIDL/GPUAdapter.swift | 6 +- Sources/DOMKit/WebIDL/GPUAddressMode.swift | 6 +- Sources/DOMKit/WebIDL/GPUBindGroup.swift | 2 +- .../DOMKit/WebIDL/GPUBindGroupLayout.swift | 2 +- Sources/DOMKit/WebIDL/GPUBlendFactor.swift | 6 +- Sources/DOMKit/WebIDL/GPUBlendOperation.swift | 6 +- Sources/DOMKit/WebIDL/GPUBuffer.swift | 12 +- .../DOMKit/WebIDL/GPUBufferBindingType.swift | 6 +- Sources/DOMKit/WebIDL/GPUBufferUsage.swift | 2 +- .../GPUCanvasCompositingAlphaMode.swift | 6 +- Sources/DOMKit/WebIDL/GPUCanvasContext.swift | 10 +- Sources/DOMKit/WebIDL/GPUColorWrite.swift | 2 +- Sources/DOMKit/WebIDL/GPUCommandBuffer.swift | 2 +- Sources/DOMKit/WebIDL/GPUCommandEncoder.swift | 22 +- .../DOMKit/WebIDL/GPUCompareFunction.swift | 6 +- .../DOMKit/WebIDL/GPUCompilationInfo.swift | 2 +- .../DOMKit/WebIDL/GPUCompilationMessage.swift | 2 +- .../WebIDL/GPUCompilationMessageType.swift | 6 +- .../DOMKit/WebIDL/GPUComputePassEncoder.swift | 10 +- .../GPUComputePassTimestampLocation.swift | 6 +- .../DOMKit/WebIDL/GPUComputePipeline.swift | 2 +- Sources/DOMKit/WebIDL/GPUCullMode.swift | 6 +- .../DOMKit/WebIDL/GPUDebugCommandsMixin.swift | 6 +- Sources/DOMKit/WebIDL/GPUDevice.swift | 44 +- Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift | 2 +- .../DOMKit/WebIDL/GPUDeviceLostReason.swift | 6 +- Sources/DOMKit/WebIDL/GPUErrorFilter.swift | 6 +- .../DOMKit/WebIDL/GPUExternalTexture.swift | 2 +- Sources/DOMKit/WebIDL/GPUFeatureName.swift | 6 +- Sources/DOMKit/WebIDL/GPUFilterMode.swift | 6 +- Sources/DOMKit/WebIDL/GPUFrontFace.swift | 6 +- Sources/DOMKit/WebIDL/GPUIndexFormat.swift | 6 +- Sources/DOMKit/WebIDL/GPULoadOp.swift | 6 +- Sources/DOMKit/WebIDL/GPUMapMode.swift | 2 +- .../DOMKit/WebIDL/GPUMipmapFilterMode.swift | 6 +- Sources/DOMKit/WebIDL/GPUObjectBase.swift | 2 +- .../DOMKit/WebIDL/GPUOutOfMemoryError.swift | 4 +- Sources/DOMKit/WebIDL/GPUPipelineBase.swift | 2 +- Sources/DOMKit/WebIDL/GPUPipelineLayout.swift | 2 +- .../DOMKit/WebIDL/GPUPowerPreference.swift | 6 +- .../WebIDL/GPUPredefinedColorSpace.swift | 6 +- .../DOMKit/WebIDL/GPUPrimitiveTopology.swift | 6 +- .../WebIDL/GPUProgrammablePassEncoder.swift | 4 +- Sources/DOMKit/WebIDL/GPUQuerySet.swift | 4 +- Sources/DOMKit/WebIDL/GPUQueryType.swift | 6 +- Sources/DOMKit/WebIDL/GPUQueue.swift | 14 +- Sources/DOMKit/WebIDL/GPURenderBundle.swift | 2 +- .../WebIDL/GPURenderBundleEncoder.swift | 4 +- .../DOMKit/WebIDL/GPURenderEncoderBase.swift | 14 +- .../DOMKit/WebIDL/GPURenderPassEncoder.swift | 18 +- .../GPURenderPassTimestampLocation.swift | 6 +- Sources/DOMKit/WebIDL/GPURenderPipeline.swift | 2 +- Sources/DOMKit/WebIDL/GPUSampler.swift | 2 +- .../DOMKit/WebIDL/GPUSamplerBindingType.swift | 6 +- Sources/DOMKit/WebIDL/GPUShaderModule.swift | 6 +- Sources/DOMKit/WebIDL/GPUShaderStage.swift | 2 +- .../DOMKit/WebIDL/GPUStencilOperation.swift | 6 +- .../WebIDL/GPUStorageTextureAccess.swift | 6 +- Sources/DOMKit/WebIDL/GPUStoreOp.swift | 6 +- .../DOMKit/WebIDL/GPUSupportedFeatures.swift | 2 +- .../DOMKit/WebIDL/GPUSupportedLimits.swift | 2 +- Sources/DOMKit/WebIDL/GPUTexture.swift | 6 +- Sources/DOMKit/WebIDL/GPUTextureAspect.swift | 6 +- .../DOMKit/WebIDL/GPUTextureDimension.swift | 6 +- Sources/DOMKit/WebIDL/GPUTextureFormat.swift | 6 +- .../DOMKit/WebIDL/GPUTextureSampleType.swift | 6 +- Sources/DOMKit/WebIDL/GPUTextureUsage.swift | 2 +- Sources/DOMKit/WebIDL/GPUTextureView.swift | 2 +- .../WebIDL/GPUTextureViewDimension.swift | 6 +- .../WebIDL/GPUUncapturedErrorEvent.swift | 4 +- .../DOMKit/WebIDL/GPUValidationError.swift | 4 +- Sources/DOMKit/WebIDL/GPUVertexFormat.swift | 6 +- Sources/DOMKit/WebIDL/GPUVertexStepMode.swift | 6 +- Sources/DOMKit/WebIDL/GainNode.swift | 4 +- Sources/DOMKit/WebIDL/Gamepad.swift | 2 +- Sources/DOMKit/WebIDL/GamepadButton.swift | 2 +- Sources/DOMKit/WebIDL/GamepadEvent.swift | 4 +- Sources/DOMKit/WebIDL/GamepadHand.swift | 6 +- .../DOMKit/WebIDL/GamepadHapticActuator.swift | 6 +- .../WebIDL/GamepadHapticActuatorType.swift | 6 +- .../DOMKit/WebIDL/GamepadMappingType.swift | 6 +- Sources/DOMKit/WebIDL/GamepadPose.swift | 2 +- Sources/DOMKit/WebIDL/GamepadTouch.swift | 2 +- .../WebIDL/GenericTransformStream.swift | 4 +- Sources/DOMKit/WebIDL/Geolocation.swift | 4 +- .../WebIDL/GeolocationCoordinates.swift | 2 +- .../DOMKit/WebIDL/GeolocationPosition.swift | 2 +- .../WebIDL/GeolocationPositionError.swift | 2 +- Sources/DOMKit/WebIDL/GeolocationSensor.swift | 8 +- Sources/DOMKit/WebIDL/GeometryUtils.swift | 8 +- Sources/DOMKit/WebIDL/GetSVGDocument.swift | 2 +- Sources/DOMKit/WebIDL/Global.swift | 6 +- .../DOMKit/WebIDL/GlobalEventHandlers.swift | 188 +- Sources/DOMKit/WebIDL/GravitySensor.swift | 4 +- Sources/DOMKit/WebIDL/GroupEffect.swift | 10 +- Sources/DOMKit/WebIDL/Gyroscope.swift | 4 +- .../GyroscopeLocalCoordinateSystem.swift | 6 +- Sources/DOMKit/WebIDL/HID.swift | 10 +- .../DOMKit/WebIDL/HIDConnectionEvent.swift | 4 +- Sources/DOMKit/WebIDL/HIDDevice.swift | 26 +- .../DOMKit/WebIDL/HIDInputReportEvent.swift | 4 +- Sources/DOMKit/WebIDL/HIDUnitSystem.swift | 6 +- Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 8 +- Sources/DOMKit/WebIDL/HTMLAnchorElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLAreaElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLAudioElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLBRElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLBaseElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLBodyElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 10 +- Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 12 +- Sources/DOMKit/WebIDL/HTMLCollection.swift | 6 +- Sources/DOMKit/WebIDL/HTMLDListElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLDataElement.swift | 4 +- .../DOMKit/WebIDL/HTMLDataListElement.swift | 4 +- .../DOMKit/WebIDL/HTMLDetailsElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 10 +- .../DOMKit/WebIDL/HTMLDirectoryElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLDivElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLEmbedElement.swift | 6 +- .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 10 +- Sources/DOMKit/WebIDL/HTMLFontElement.swift | 4 +- .../WebIDL/HTMLFormControlsCollection.swift | 4 +- Sources/DOMKit/WebIDL/HTMLFormElement.swift | 18 +- Sources/DOMKit/WebIDL/HTMLFrameElement.swift | 4 +- .../DOMKit/WebIDL/HTMLFrameSetElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLHRElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLHeadElement.swift | 4 +- .../DOMKit/WebIDL/HTMLHeadingElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLHtmlElement.swift | 4 +- .../WebIDL/HTMLHyperlinkElementUtils.swift | 22 +- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLImageElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 24 +- Sources/DOMKit/WebIDL/HTMLLIElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLLabelElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLLegendElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLLinkElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLMapElement.swift | 4 +- .../DOMKit/WebIDL/HTMLMarqueeElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 28 +- Sources/DOMKit/WebIDL/HTMLMenuElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLMetaElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLMeterElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLModElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLOListElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 12 +- .../DOMKit/WebIDL/HTMLOptGroupElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLOptionElement.swift | 4 +- .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 10 +- Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift | 12 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 10 +- .../DOMKit/WebIDL/HTMLParagraphElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLParamElement.swift | 4 +- .../DOMKit/WebIDL/HTMLPictureElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLPortalElement.swift | 10 +- Sources/DOMKit/WebIDL/HTMLPreElement.swift | 4 +- .../DOMKit/WebIDL/HTMLProgressElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLQuoteElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 20 +- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 10 +- Sources/DOMKit/WebIDL/HTMLSourceElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLSpanElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLStyleElement.swift | 4 +- .../WebIDL/HTMLTableCaptionElement.swift | 4 +- .../DOMKit/WebIDL/HTMLTableCellElement.swift | 4 +- .../DOMKit/WebIDL/HTMLTableColElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLTableElement.swift | 22 +- .../DOMKit/WebIDL/HTMLTableRowElement.swift | 8 +- .../WebIDL/HTMLTableSectionElement.swift | 8 +- .../DOMKit/WebIDL/HTMLTemplateElement.swift | 4 +- .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 18 +- Sources/DOMKit/WebIDL/HTMLTimeElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLTitleElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLTrackElement.swift | 4 +- Sources/DOMKit/WebIDL/HTMLUListElement.swift | 4 +- .../DOMKit/WebIDL/HTMLUnknownElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 12 +- .../DOMKit/WebIDL/HardwareAcceleration.swift | 6 +- Sources/DOMKit/WebIDL/HashChangeEvent.swift | 4 +- Sources/DOMKit/WebIDL/HdrMetadataType.swift | 6 +- Sources/DOMKit/WebIDL/Headers.swift | 14 +- Sources/DOMKit/WebIDL/Highlight.swift | 4 +- Sources/DOMKit/WebIDL/HighlightRegistry.swift | 2 +- Sources/DOMKit/WebIDL/HighlightType.swift | 6 +- Sources/DOMKit/WebIDL/History.swift | 12 +- Sources/DOMKit/WebIDL/IDBCursor.swift | 12 +- .../DOMKit/WebIDL/IDBCursorDirection.swift | 6 +- .../DOMKit/WebIDL/IDBCursorWithValue.swift | 2 +- Sources/DOMKit/WebIDL/IDBDatabase.swift | 10 +- Sources/DOMKit/WebIDL/IDBFactory.swift | 12 +- Sources/DOMKit/WebIDL/IDBIndex.swift | 16 +- Sources/DOMKit/WebIDL/IDBKeyRange.swift | 12 +- Sources/DOMKit/WebIDL/IDBObjectStore.swift | 30 +- Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift | 2 +- Sources/DOMKit/WebIDL/IDBRequest.swift | 2 +- .../DOMKit/WebIDL/IDBRequestReadyState.swift | 6 +- Sources/DOMKit/WebIDL/IDBTransaction.swift | 8 +- .../WebIDL/IDBTransactionDurability.swift | 6 +- .../DOMKit/WebIDL/IDBTransactionMode.swift | 6 +- .../DOMKit/WebIDL/IDBVersionChangeEvent.swift | 4 +- Sources/DOMKit/WebIDL/IIRFilterNode.swift | 6 +- Sources/DOMKit/WebIDL/IdleDeadline.swift | 4 +- Sources/DOMKit/WebIDL/IdleDetector.swift | 12 +- Sources/DOMKit/WebIDL/ImageBitmap.swift | 4 +- .../WebIDL/ImageBitmapRenderingContext.swift | 4 +- Sources/DOMKit/WebIDL/ImageCapture.swift | 20 +- Sources/DOMKit/WebIDL/ImageData.swift | 6 +- Sources/DOMKit/WebIDL/ImageDecoder.swift | 16 +- Sources/DOMKit/WebIDL/ImageOrientation.swift | 6 +- .../DOMKit/WebIDL/ImageSmoothingQuality.swift | 6 +- Sources/DOMKit/WebIDL/ImageTrack.swift | 2 +- Sources/DOMKit/WebIDL/ImageTrackList.swift | 4 +- Sources/DOMKit/WebIDL/ImportExportKind.swift | 6 +- Sources/DOMKit/WebIDL/Ink.swift | 6 +- Sources/DOMKit/WebIDL/InkPresenter.swift | 4 +- Sources/DOMKit/WebIDL/InnerHTML.swift | 2 +- .../WebIDL/InputDeviceCapabilities.swift | 4 +- Sources/DOMKit/WebIDL/InputDeviceInfo.swift | 4 +- Sources/DOMKit/WebIDL/InputEvent.swift | 6 +- Sources/DOMKit/WebIDL/Instance.swift | 4 +- Sources/DOMKit/WebIDL/InteractionCounts.swift | 2 +- .../DOMKit/WebIDL/IntersectionObserver.swift | 10 +- .../WebIDL/IntersectionObserverEntry.swift | 4 +- .../WebIDL/InterventionReportBody.swift | 4 +- Sources/DOMKit/WebIDL/IntrinsicSizes.swift | 2 +- Sources/DOMKit/WebIDL/ItemType.swift | 6 +- .../WebIDL/IterationCompositeOperation.swift | 6 +- .../WebIDL/KHR_parallel_shader_compile.swift | 2 +- Sources/DOMKit/WebIDL/KeyFormat.swift | 6 +- Sources/DOMKit/WebIDL/KeyType.swift | 6 +- Sources/DOMKit/WebIDL/KeyUsage.swift | 6 +- Sources/DOMKit/WebIDL/Keyboard.swift | 12 +- Sources/DOMKit/WebIDL/KeyboardEvent.swift | 8 +- Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift | 2 +- Sources/DOMKit/WebIDL/KeyframeEffect.swift | 10 +- Sources/DOMKit/WebIDL/LandmarkType.swift | 6 +- Sources/DOMKit/WebIDL/LargeBlobSupport.swift | 6 +- .../WebIDL/LargestContentfulPaint.swift | 4 +- Sources/DOMKit/WebIDL/LatencyMode.swift | 6 +- Sources/DOMKit/WebIDL/LayoutChild.swift | 10 +- Sources/DOMKit/WebIDL/LayoutConstraints.swift | 2 +- Sources/DOMKit/WebIDL/LayoutEdges.swift | 2 +- Sources/DOMKit/WebIDL/LayoutFragment.swift | 2 +- Sources/DOMKit/WebIDL/LayoutShift.swift | 4 +- .../WebIDL/LayoutShiftAttribution.swift | 2 +- Sources/DOMKit/WebIDL/LayoutSizingMode.swift | 6 +- .../WebIDL/LayoutWorkletGlobalScope.swift | 2 +- Sources/DOMKit/WebIDL/LineAlignSetting.swift | 6 +- .../WebIDL/LinearAccelerationSensor.swift | 4 +- Sources/DOMKit/WebIDL/LinkStyle.swift | 2 +- Sources/DOMKit/WebIDL/Location.swift | 8 +- Sources/DOMKit/WebIDL/Lock.swift | 2 +- Sources/DOMKit/WebIDL/LockManager.swift | 6 +- Sources/DOMKit/WebIDL/LockMode.swift | 6 +- Sources/DOMKit/WebIDL/MIDIAccess.swift | 2 +- .../DOMKit/WebIDL/MIDIConnectionEvent.swift | 4 +- Sources/DOMKit/WebIDL/MIDIInput.swift | 2 +- Sources/DOMKit/WebIDL/MIDIInputMap.swift | 2 +- Sources/DOMKit/WebIDL/MIDIMessageEvent.swift | 4 +- Sources/DOMKit/WebIDL/MIDIOutput.swift | 6 +- Sources/DOMKit/WebIDL/MIDIOutputMap.swift | 2 +- Sources/DOMKit/WebIDL/MIDIPort.swift | 10 +- .../WebIDL/MIDIPortConnectionState.swift | 6 +- .../DOMKit/WebIDL/MIDIPortDeviceState.swift | 6 +- Sources/DOMKit/WebIDL/MIDIPortType.swift | 6 +- Sources/DOMKit/WebIDL/ML.swift | 8 +- Sources/DOMKit/WebIDL/MLAutoPad.swift | 6 +- Sources/DOMKit/WebIDL/MLContext.swift | 2 +- .../WebIDL/MLConv2dFilterOperandLayout.swift | 6 +- ...MLConvTranspose2dFilterOperandLayout.swift | 6 +- .../DOMKit/WebIDL/MLDevicePreference.swift | 6 +- Sources/DOMKit/WebIDL/MLGraph.swift | 4 +- Sources/DOMKit/WebIDL/MLGraphBuilder.swift | 148 +- .../DOMKit/WebIDL/MLInputOperandLayout.swift | 6 +- .../DOMKit/WebIDL/MLInterpolationMode.swift | 6 +- Sources/DOMKit/WebIDL/MLOperand.swift | 2 +- Sources/DOMKit/WebIDL/MLOperandType.swift | 6 +- Sources/DOMKit/WebIDL/MLOperator.swift | 2 +- Sources/DOMKit/WebIDL/MLPaddingMode.swift | 6 +- Sources/DOMKit/WebIDL/MLPowerPreference.swift | 6 +- .../WebIDL/MLRecurrentNetworkDirection.swift | 6 +- .../MLRecurrentNetworkWeightLayout.swift | 6 +- Sources/DOMKit/WebIDL/MLRoundingType.swift | 6 +- Sources/DOMKit/WebIDL/Magnetometer.swift | 4 +- .../MagnetometerLocalCoordinateSystem.swift | 6 +- Sources/DOMKit/WebIDL/MathMLElement.swift | 2 +- Sources/DOMKit/WebIDL/MediaCapabilities.swift | 10 +- Sources/DOMKit/WebIDL/MediaDecodingType.swift | 6 +- Sources/DOMKit/WebIDL/MediaDeviceInfo.swift | 4 +- Sources/DOMKit/WebIDL/MediaDeviceKind.swift | 6 +- Sources/DOMKit/WebIDL/MediaDevices.swift | 24 +- .../WebIDL/MediaElementAudioSourceNode.swift | 4 +- Sources/DOMKit/WebIDL/MediaEncodingType.swift | 6 +- .../DOMKit/WebIDL/MediaEncryptedEvent.swift | 4 +- Sources/DOMKit/WebIDL/MediaError.swift | 2 +- .../DOMKit/WebIDL/MediaKeyMessageEvent.swift | 4 +- .../DOMKit/WebIDL/MediaKeyMessageType.swift | 6 +- Sources/DOMKit/WebIDL/MediaKeySession.swift | 22 +- .../WebIDL/MediaKeySessionClosedReason.swift | 6 +- .../DOMKit/WebIDL/MediaKeySessionType.swift | 6 +- Sources/DOMKit/WebIDL/MediaKeyStatus.swift | 6 +- Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift | 6 +- .../DOMKit/WebIDL/MediaKeySystemAccess.swift | 8 +- Sources/DOMKit/WebIDL/MediaKeys.swift | 8 +- .../DOMKit/WebIDL/MediaKeysRequirement.swift | 6 +- Sources/DOMKit/WebIDL/MediaList.swift | 8 +- Sources/DOMKit/WebIDL/MediaMetadata.swift | 4 +- Sources/DOMKit/WebIDL/MediaQueryList.swift | 2 +- .../DOMKit/WebIDL/MediaQueryListEvent.swift | 4 +- Sources/DOMKit/WebIDL/MediaRecorder.swift | 16 +- .../WebIDL/MediaRecorderErrorEvent.swift | 4 +- Sources/DOMKit/WebIDL/MediaSession.swift | 8 +- .../DOMKit/WebIDL/MediaSessionAction.swift | 6 +- .../WebIDL/MediaSessionPlaybackState.swift | 6 +- Sources/DOMKit/WebIDL/MediaSource.swift | 16 +- Sources/DOMKit/WebIDL/MediaStream.swift | 22 +- .../MediaStreamAudioDestinationNode.swift | 4 +- .../WebIDL/MediaStreamAudioSourceNode.swift | 4 +- Sources/DOMKit/WebIDL/MediaStreamTrack.swift | 16 +- .../MediaStreamTrackAudioSourceNode.swift | 4 +- .../DOMKit/WebIDL/MediaStreamTrackEvent.swift | 4 +- .../WebIDL/MediaStreamTrackProcessor.swift | 4 +- .../DOMKit/WebIDL/MediaStreamTrackState.swift | 6 +- Sources/DOMKit/WebIDL/Memory.swift | 6 +- Sources/DOMKit/WebIDL/MessageChannel.swift | 4 +- Sources/DOMKit/WebIDL/MessageEvent.swift | 6 +- Sources/DOMKit/WebIDL/MessagePort.swift | 10 +- Sources/DOMKit/WebIDL/MeteringMode.swift | 6 +- Sources/DOMKit/WebIDL/MimeType.swift | 2 +- Sources/DOMKit/WebIDL/MimeTypeArray.swift | 6 +- .../WebIDL/MockCapturePromptResult.swift | 6 +- Sources/DOMKit/WebIDL/MockSensorType.swift | 6 +- Sources/DOMKit/WebIDL/Module.swift | 10 +- Sources/DOMKit/WebIDL/MouseEvent.swift | 8 +- Sources/DOMKit/WebIDL/MutationEvent.swift | 4 +- Sources/DOMKit/WebIDL/MutationObserver.swift | 8 +- Sources/DOMKit/WebIDL/MutationRecord.swift | 2 +- Sources/DOMKit/WebIDL/NDEFMessage.swift | 4 +- Sources/DOMKit/WebIDL/NDEFReader.swift | 16 +- Sources/DOMKit/WebIDL/NDEFReadingEvent.swift | 4 +- Sources/DOMKit/WebIDL/NDEFRecord.swift | 6 +- Sources/DOMKit/WebIDL/NamedFlow.swift | 8 +- Sources/DOMKit/WebIDL/NamedFlowMap.swift | 2 +- Sources/DOMKit/WebIDL/NamedNodeMap.swift | 16 +- Sources/DOMKit/WebIDL/NavigateEvent.swift | 6 +- Sources/DOMKit/WebIDL/Navigation.swift | 16 +- .../NavigationCurrentEntryChangeEvent.swift | 4 +- .../DOMKit/WebIDL/NavigationDestination.swift | 4 +- Sources/DOMKit/WebIDL/NavigationEvent.swift | 4 +- .../WebIDL/NavigationHistoryEntry.swift | 4 +- .../WebIDL/NavigationNavigationType.swift | 6 +- .../WebIDL/NavigationPreloadManager.swift | 18 +- .../DOMKit/WebIDL/NavigationTimingType.swift | 6 +- .../DOMKit/WebIDL/NavigationTransition.swift | 4 +- Sources/DOMKit/WebIDL/Navigator.swift | 44 +- .../NavigatorAutomationInformation.swift | 2 +- Sources/DOMKit/WebIDL/NavigatorBadge.swift | 8 +- .../WebIDL/NavigatorConcurrentHardware.swift | 2 +- .../DOMKit/WebIDL/NavigatorContentUtils.swift | 4 +- Sources/DOMKit/WebIDL/NavigatorCookies.swift | 2 +- .../DOMKit/WebIDL/NavigatorDeviceMemory.swift | 2 +- Sources/DOMKit/WebIDL/NavigatorFonts.swift | 2 +- Sources/DOMKit/WebIDL/NavigatorGPU.swift | 2 +- Sources/DOMKit/WebIDL/NavigatorID.swift | 22 +- Sources/DOMKit/WebIDL/NavigatorLanguage.swift | 4 +- Sources/DOMKit/WebIDL/NavigatorLocks.swift | 2 +- Sources/DOMKit/WebIDL/NavigatorML.swift | 2 +- .../WebIDL/NavigatorNetworkInformation.swift | 2 +- Sources/DOMKit/WebIDL/NavigatorOnLine.swift | 2 +- Sources/DOMKit/WebIDL/NavigatorPlugins.swift | 8 +- Sources/DOMKit/WebIDL/NavigatorStorage.swift | 2 +- Sources/DOMKit/WebIDL/NavigatorUA.swift | 2 +- Sources/DOMKit/WebIDL/NavigatorUAData.swift | 8 +- .../DOMKit/WebIDL/NetworkInformation.swift | 2 +- .../WebIDL/NetworkInformationSaveData.swift | 2 +- Sources/DOMKit/WebIDL/Node.swift | 32 +- Sources/DOMKit/WebIDL/NodeIterator.swift | 8 +- Sources/DOMKit/WebIDL/NodeList.swift | 4 +- .../WebIDL/NonDocumentTypeChildNode.swift | 4 +- .../DOMKit/WebIDL/NonElementParentNode.swift | 2 +- Sources/DOMKit/WebIDL/Notification.swift | 6 +- .../DOMKit/WebIDL/NotificationDirection.swift | 6 +- Sources/DOMKit/WebIDL/NotificationEvent.swift | 4 +- .../WebIDL/NotificationPermission.swift | 6 +- .../WebIDL/OES_draw_buffers_indexed.swift | 16 +- .../WebIDL/OES_element_index_uint.swift | 2 +- .../DOMKit/WebIDL/OES_fbo_render_mipmap.swift | 2 +- .../WebIDL/OES_standard_derivatives.swift | 2 +- Sources/DOMKit/WebIDL/OES_texture_float.swift | 2 +- .../WebIDL/OES_texture_float_linear.swift | 2 +- .../WebIDL/OES_texture_half_float.swift | 2 +- .../OES_texture_half_float_linear.swift | 2 +- .../WebIDL/OES_vertex_array_object.swift | 10 +- Sources/DOMKit/WebIDL/OTPCredential.swift | 2 +- .../WebIDL/OTPCredentialTransportType.swift | 6 +- Sources/DOMKit/WebIDL/OVR_multiview2.swift | 4 +- .../WebIDL/OfflineAudioCompletionEvent.swift | 4 +- .../DOMKit/WebIDL/OfflineAudioContext.swift | 18 +- Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 12 +- .../OffscreenCanvasRenderingContext2D.swift | 4 +- .../WebIDL/OffscreenRenderingContextId.swift | 6 +- .../DOMKit/WebIDL/OrientationLockType.swift | 6 +- Sources/DOMKit/WebIDL/OrientationSensor.swift | 4 +- ...ientationSensorLocalCoordinateSystem.swift | 6 +- Sources/DOMKit/WebIDL/OrientationType.swift | 6 +- Sources/DOMKit/WebIDL/OscillatorNode.swift | 6 +- Sources/DOMKit/WebIDL/OscillatorType.swift | 6 +- Sources/DOMKit/WebIDL/OverSampleType.swift | 6 +- .../DOMKit/WebIDL/OverconstrainedError.swift | 4 +- .../DOMKit/WebIDL/PageTransitionEvent.swift | 4 +- .../WebIDL/PaintRenderingContext2D.swift | 2 +- Sources/DOMKit/WebIDL/PaintSize.swift | 2 +- .../WebIDL/PaintWorkletGlobalScope.swift | 2 +- Sources/DOMKit/WebIDL/PannerNode.swift | 8 +- Sources/DOMKit/WebIDL/PanningModelType.swift | 6 +- Sources/DOMKit/WebIDL/ParentNode.swift | 18 +- Sources/DOMKit/WebIDL/ParityType.swift | 6 +- .../DOMKit/WebIDL/PasswordCredential.swift | 6 +- Sources/DOMKit/WebIDL/Path2D.swift | 6 +- Sources/DOMKit/WebIDL/PaymentComplete.swift | 6 +- .../DOMKit/WebIDL/PaymentInstruments.swift | 26 +- Sources/DOMKit/WebIDL/PaymentManager.swift | 2 +- .../WebIDL/PaymentMethodChangeEvent.swift | 4 +- Sources/DOMKit/WebIDL/PaymentRequest.swift | 16 +- .../DOMKit/WebIDL/PaymentRequestEvent.swift | 14 +- .../WebIDL/PaymentRequestUpdateEvent.swift | 6 +- Sources/DOMKit/WebIDL/PaymentResponse.swift | 12 +- Sources/DOMKit/WebIDL/Performance.swift | 28 +- .../WebIDL/PerformanceElementTiming.swift | 4 +- Sources/DOMKit/WebIDL/PerformanceEntry.swift | 4 +- .../WebIDL/PerformanceEventTiming.swift | 4 +- .../WebIDL/PerformanceLongTaskTiming.swift | 4 +- Sources/DOMKit/WebIDL/PerformanceMark.swift | 4 +- .../DOMKit/WebIDL/PerformanceMeasure.swift | 2 +- .../DOMKit/WebIDL/PerformanceNavigation.swift | 4 +- .../WebIDL/PerformanceNavigationTiming.swift | 4 +- .../DOMKit/WebIDL/PerformanceObserver.swift | 8 +- .../WebIDL/PerformanceObserverEntryList.swift | 8 +- .../WebIDL/PerformancePaintTiming.swift | 2 +- .../WebIDL/PerformanceResourceTiming.swift | 4 +- .../WebIDL/PerformanceServerTiming.swift | 4 +- Sources/DOMKit/WebIDL/PerformanceTiming.swift | 4 +- Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift | 4 +- .../DOMKit/WebIDL/PeriodicSyncManager.swift | 14 +- Sources/DOMKit/WebIDL/PeriodicWave.swift | 4 +- Sources/DOMKit/WebIDL/PermissionState.swift | 6 +- Sources/DOMKit/WebIDL/PermissionStatus.swift | 2 +- Sources/DOMKit/WebIDL/Permissions.swift | 14 +- Sources/DOMKit/WebIDL/PermissionsPolicy.swift | 10 +- ...PermissionsPolicyViolationReportBody.swift | 2 +- .../DOMKit/WebIDL/PictureInPictureEvent.swift | 4 +- .../WebIDL/PictureInPictureWindow.swift | 2 +- Sources/DOMKit/WebIDL/PlaybackDirection.swift | 6 +- Sources/DOMKit/WebIDL/Plugin.swift | 6 +- Sources/DOMKit/WebIDL/PluginArray.swift | 8 +- Sources/DOMKit/WebIDL/PointerEvent.swift | 8 +- Sources/DOMKit/WebIDL/PopStateEvent.swift | 4 +- .../DOMKit/WebIDL/PortalActivateEvent.swift | 6 +- Sources/DOMKit/WebIDL/PortalHost.swift | 4 +- .../DOMKit/WebIDL/PositionAlignSetting.swift | 6 +- .../DOMKit/WebIDL/PredefinedColorSpace.swift | 6 +- Sources/DOMKit/WebIDL/PremultiplyAlpha.swift | 6 +- Sources/DOMKit/WebIDL/Presentation.swift | 2 +- .../WebIDL/PresentationAvailability.swift | 2 +- .../WebIDL/PresentationConnection.swift | 14 +- ...PresentationConnectionAvailableEvent.swift | 4 +- .../PresentationConnectionCloseEvent.swift | 4 +- .../PresentationConnectionCloseReason.swift | 6 +- .../WebIDL/PresentationConnectionList.swift | 2 +- .../WebIDL/PresentationConnectionState.swift | 6 +- .../DOMKit/WebIDL/PresentationReceiver.swift | 2 +- .../DOMKit/WebIDL/PresentationRequest.swift | 18 +- Sources/DOMKit/WebIDL/PresentationStyle.swift | 6 +- .../DOMKit/WebIDL/ProcessingInstruction.swift | 2 +- Sources/DOMKit/WebIDL/Profiler.swift | 8 +- Sources/DOMKit/WebIDL/ProgressEvent.swift | 4 +- .../DOMKit/WebIDL/PromiseRejectionEvent.swift | 4 +- Sources/DOMKit/WebIDL/ProximitySensor.swift | 4 +- .../DOMKit/WebIDL/PublicKeyCredential.swift | 8 +- .../WebIDL/PublicKeyCredentialType.swift | 6 +- .../DOMKit/WebIDL/PushEncryptionKeyName.swift | 6 +- Sources/DOMKit/WebIDL/PushEvent.swift | 4 +- Sources/DOMKit/WebIDL/PushManager.swift | 14 +- Sources/DOMKit/WebIDL/PushMessageData.swift | 10 +- Sources/DOMKit/WebIDL/PushSubscription.swift | 10 +- .../WebIDL/PushSubscriptionChangeEvent.swift | 4 +- .../WebIDL/PushSubscriptionOptions.swift | 2 +- Sources/DOMKit/WebIDL/RTCBundlePolicy.swift | 6 +- Sources/DOMKit/WebIDL/RTCCertificate.swift | 4 +- Sources/DOMKit/WebIDL/RTCCodecType.swift | 6 +- Sources/DOMKit/WebIDL/RTCDTMFSender.swift | 4 +- .../WebIDL/RTCDTMFToneChangeEvent.swift | 4 +- Sources/DOMKit/WebIDL/RTCDataChannel.swift | 12 +- .../DOMKit/WebIDL/RTCDataChannelEvent.swift | 4 +- .../DOMKit/WebIDL/RTCDataChannelState.swift | 6 +- .../WebIDL/RTCDegradationPreference.swift | 6 +- Sources/DOMKit/WebIDL/RTCDtlsTransport.swift | 4 +- .../DOMKit/WebIDL/RTCDtlsTransportState.swift | 6 +- .../DOMKit/WebIDL/RTCEncodedAudioFrame.swift | 4 +- .../DOMKit/WebIDL/RTCEncodedVideoFrame.swift | 4 +- .../WebIDL/RTCEncodedVideoFrameType.swift | 6 +- Sources/DOMKit/WebIDL/RTCError.swift | 4 +- .../DOMKit/WebIDL/RTCErrorDetailType.swift | 6 +- .../DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift | 6 +- Sources/DOMKit/WebIDL/RTCErrorEvent.swift | 4 +- Sources/DOMKit/WebIDL/RTCIceCandidate.swift | 6 +- .../DOMKit/WebIDL/RTCIceCandidateType.swift | 6 +- Sources/DOMKit/WebIDL/RTCIceComponent.swift | 6 +- .../DOMKit/WebIDL/RTCIceConnectionState.swift | 6 +- .../DOMKit/WebIDL/RTCIceCredentialType.swift | 6 +- .../DOMKit/WebIDL/RTCIceGathererState.swift | 6 +- .../DOMKit/WebIDL/RTCIceGatheringState.swift | 6 +- Sources/DOMKit/WebIDL/RTCIceProtocol.swift | 6 +- Sources/DOMKit/WebIDL/RTCIceRole.swift | 6 +- .../WebIDL/RTCIceTcpCandidateType.swift | 6 +- Sources/DOMKit/WebIDL/RTCIceTransport.swift | 22 +- .../DOMKit/WebIDL/RTCIceTransportPolicy.swift | 6 +- .../DOMKit/WebIDL/RTCIceTransportState.swift | 6 +- .../DOMKit/WebIDL/RTCIdentityAssertion.swift | 4 +- .../RTCIdentityProviderGlobalScope.swift | 2 +- .../WebIDL/RTCIdentityProviderRegistrar.swift | 4 +- Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 40 +- .../RTCPeerConnectionIceErrorEvent.swift | 4 +- .../WebIDL/RTCPeerConnectionIceEvent.swift | 4 +- .../WebIDL/RTCPeerConnectionState.swift | 6 +- Sources/DOMKit/WebIDL/RTCPriorityType.swift | 6 +- .../WebIDL/RTCQualityLimitationReason.swift | 6 +- Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift | 6 +- Sources/DOMKit/WebIDL/RTCRtpReceiver.swift | 14 +- .../DOMKit/WebIDL/RTCRtpScriptTransform.swift | 4 +- .../WebIDL/RTCRtpScriptTransformer.swift | 10 +- Sources/DOMKit/WebIDL/RTCRtpSender.swift | 24 +- Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift | 6 +- .../WebIDL/RTCRtpTransceiverDirection.swift | 6 +- Sources/DOMKit/WebIDL/RTCSctpTransport.swift | 2 +- .../DOMKit/WebIDL/RTCSctpTransportState.swift | 6 +- Sources/DOMKit/WebIDL/RTCSdpType.swift | 6 +- .../DOMKit/WebIDL/RTCSessionDescription.swift | 6 +- Sources/DOMKit/WebIDL/RTCSignalingState.swift | 6 +- .../RTCStatsIceCandidatePairState.swift | 6 +- Sources/DOMKit/WebIDL/RTCStatsReport.swift | 2 +- Sources/DOMKit/WebIDL/RTCStatsType.swift | 6 +- Sources/DOMKit/WebIDL/RTCTrackEvent.swift | 4 +- Sources/DOMKit/WebIDL/RTCTransformEvent.swift | 2 +- Sources/DOMKit/WebIDL/RadioNodeList.swift | 2 +- Sources/DOMKit/WebIDL/Range.swift | 52 +- .../WebIDL/ReadableByteStreamController.swift | 8 +- Sources/DOMKit/WebIDL/ReadableStream.swift | 18 +- .../WebIDL/ReadableStreamBYOBReader.swift | 10 +- .../WebIDL/ReadableStreamBYOBRequest.swift | 6 +- .../ReadableStreamDefaultController.swift | 8 +- .../WebIDL/ReadableStreamDefaultReader.swift | 10 +- .../WebIDL/ReadableStreamGenericReader.swift | 6 +- .../WebIDL/ReadableStreamReaderMode.swift | 6 +- .../DOMKit/WebIDL/ReadableStreamType.swift | 6 +- Sources/DOMKit/WebIDL/ReadyState.swift | 6 +- Sources/DOMKit/WebIDL/RecordingState.swift | 6 +- Sources/DOMKit/WebIDL/RedEyeReduction.swift | 6 +- Sources/DOMKit/WebIDL/ReferrerPolicy.swift | 6 +- Sources/DOMKit/WebIDL/Region.swift | 4 +- .../WebIDL/RelativeOrientationSensor.swift | 4 +- Sources/DOMKit/WebIDL/RemotePlayback.swift | 10 +- .../DOMKit/WebIDL/RemotePlaybackState.swift | 6 +- Sources/DOMKit/WebIDL/Report.swift | 4 +- Sources/DOMKit/WebIDL/ReportBody.swift | 4 +- Sources/DOMKit/WebIDL/ReportingObserver.swift | 8 +- Sources/DOMKit/WebIDL/Request.swift | 6 +- Sources/DOMKit/WebIDL/RequestCache.swift | 6 +- .../DOMKit/WebIDL/RequestCredentials.swift | 6 +- .../DOMKit/WebIDL/RequestDestination.swift | 6 +- Sources/DOMKit/WebIDL/RequestMode.swift | 6 +- Sources/DOMKit/WebIDL/RequestRedirect.swift | 6 +- .../WebIDL/ResidentKeyRequirement.swift | 6 +- Sources/DOMKit/WebIDL/ResizeObserver.swift | 8 +- .../WebIDL/ResizeObserverBoxOptions.swift | 6 +- .../DOMKit/WebIDL/ResizeObserverEntry.swift | 2 +- .../DOMKit/WebIDL/ResizeObserverSize.swift | 2 +- Sources/DOMKit/WebIDL/ResizeQuality.swift | 6 +- Sources/DOMKit/WebIDL/Response.swift | 10 +- Sources/DOMKit/WebIDL/ResponseType.swift | 6 +- Sources/DOMKit/WebIDL/SFrameTransform.swift | 8 +- .../WebIDL/SFrameTransformErrorEvent.swift | 4 +- .../SFrameTransformErrorEventType.swift | 6 +- .../DOMKit/WebIDL/SFrameTransformRole.swift | 6 +- Sources/DOMKit/WebIDL/SVGAElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGAngle.swift | 6 +- Sources/DOMKit/WebIDL/SVGAnimateElement.swift | 2 +- .../WebIDL/SVGAnimateMotionElement.swift | 2 +- .../WebIDL/SVGAnimateTransformElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift | 2 +- .../DOMKit/WebIDL/SVGAnimatedBoolean.swift | 2 +- .../WebIDL/SVGAnimatedEnumeration.swift | 2 +- .../DOMKit/WebIDL/SVGAnimatedInteger.swift | 2 +- Sources/DOMKit/WebIDL/SVGAnimatedLength.swift | 2 +- .../DOMKit/WebIDL/SVGAnimatedLengthList.swift | 2 +- Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift | 2 +- .../DOMKit/WebIDL/SVGAnimatedNumberList.swift | 2 +- Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift | 4 +- .../SVGAnimatedPreserveAspectRatio.swift | 2 +- Sources/DOMKit/WebIDL/SVGAnimatedRect.swift | 2 +- Sources/DOMKit/WebIDL/SVGAnimatedString.swift | 2 +- .../WebIDL/SVGAnimatedTransformList.swift | 2 +- .../DOMKit/WebIDL/SVGAnimationElement.swift | 16 +- Sources/DOMKit/WebIDL/SVGCircleElement.swift | 2 +- .../DOMKit/WebIDL/SVGClipPathElement.swift | 2 +- .../SVGComponentTransferFunctionElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGDefsElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGDescElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGDiscardElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGElement.swift | 2 +- .../DOMKit/WebIDL/SVGElementInstance.swift | 4 +- Sources/DOMKit/WebIDL/SVGEllipseElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGFEBlendElement.swift | 2 +- .../WebIDL/SVGFEColorMatrixElement.swift | 2 +- .../SVGFEComponentTransferElement.swift | 2 +- .../DOMKit/WebIDL/SVGFECompositeElement.swift | 2 +- .../WebIDL/SVGFEConvolveMatrixElement.swift | 2 +- .../WebIDL/SVGFEDiffuseLightingElement.swift | 2 +- .../WebIDL/SVGFEDisplacementMapElement.swift | 2 +- .../WebIDL/SVGFEDistantLightElement.swift | 2 +- .../WebIDL/SVGFEDropShadowElement.swift | 4 +- Sources/DOMKit/WebIDL/SVGFEFloodElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift | 2 +- .../WebIDL/SVGFEGaussianBlurElement.swift | 4 +- Sources/DOMKit/WebIDL/SVGFEImageElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGFEMergeElement.swift | 2 +- .../DOMKit/WebIDL/SVGFEMergeNodeElement.swift | 2 +- .../WebIDL/SVGFEMorphologyElement.swift | 2 +- .../DOMKit/WebIDL/SVGFEOffsetElement.swift | 2 +- .../WebIDL/SVGFEPointLightElement.swift | 2 +- .../WebIDL/SVGFESpecularLightingElement.swift | 2 +- .../DOMKit/WebIDL/SVGFESpotLightElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGFETileElement.swift | 2 +- .../WebIDL/SVGFETurbulenceElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGFilterElement.swift | 2 +- ...SVGFilterPrimitiveStandardAttributes.swift | 10 +- Sources/DOMKit/WebIDL/SVGFitToViewBox.swift | 4 +- .../WebIDL/SVGForeignObjectElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGGElement.swift | 2 +- .../DOMKit/WebIDL/SVGGeometryElement.swift | 10 +- .../DOMKit/WebIDL/SVGGradientElement.swift | 2 +- .../DOMKit/WebIDL/SVGGraphicsElement.swift | 8 +- Sources/DOMKit/WebIDL/SVGImageElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGLength.swift | 6 +- Sources/DOMKit/WebIDL/SVGLengthList.swift | 16 +- Sources/DOMKit/WebIDL/SVGLineElement.swift | 2 +- .../WebIDL/SVGLinearGradientElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGMPathElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGMarkerElement.swift | 6 +- Sources/DOMKit/WebIDL/SVGMaskElement.swift | 2 +- .../DOMKit/WebIDL/SVGMetadataElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGNumber.swift | 2 +- Sources/DOMKit/WebIDL/SVGNumberList.swift | 16 +- Sources/DOMKit/WebIDL/SVGPathElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGPatternElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGPointList.swift | 16 +- Sources/DOMKit/WebIDL/SVGPolygonElement.swift | 2 +- .../DOMKit/WebIDL/SVGPolylineElement.swift | 2 +- .../WebIDL/SVGPreserveAspectRatio.swift | 2 +- .../WebIDL/SVGRadialGradientElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGRectElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGSVGElement.swift | 48 +- Sources/DOMKit/WebIDL/SVGScriptElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGSetElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGStopElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGStringList.swift | 16 +- Sources/DOMKit/WebIDL/SVGStyleElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGSwitchElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGSymbolElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGTSpanElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGTests.swift | 4 +- .../DOMKit/WebIDL/SVGTextContentElement.swift | 20 +- Sources/DOMKit/WebIDL/SVGTextElement.swift | 2 +- .../DOMKit/WebIDL/SVGTextPathElement.swift | 2 +- .../WebIDL/SVGTextPositioningElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGTitleElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGTransform.swift | 14 +- Sources/DOMKit/WebIDL/SVGTransformList.swift | 20 +- Sources/DOMKit/WebIDL/SVGURIReference.swift | 2 +- Sources/DOMKit/WebIDL/SVGUnitTypes.swift | 2 +- Sources/DOMKit/WebIDL/SVGUseElement.swift | 2 +- .../WebIDL/SVGUseElementShadowRoot.swift | 2 +- Sources/DOMKit/WebIDL/SVGViewElement.swift | 2 +- Sources/DOMKit/WebIDL/Sanitizer.swift | 12 +- Sources/DOMKit/WebIDL/Scheduler.swift | 2 +- Sources/DOMKit/WebIDL/Scheduling.swift | 4 +- Sources/DOMKit/WebIDL/Screen.swift | 2 +- Sources/DOMKit/WebIDL/ScreenIdleState.swift | 6 +- Sources/DOMKit/WebIDL/ScreenOrientation.swift | 8 +- .../DOMKit/WebIDL/ScriptProcessorNode.swift | 2 +- .../WebIDL/ScriptingPolicyReportBody.swift | 4 +- .../WebIDL/ScriptingPolicyViolationType.swift | 6 +- Sources/DOMKit/WebIDL/ScrollBehavior.swift | 6 +- Sources/DOMKit/WebIDL/ScrollDirection.swift | 6 +- .../DOMKit/WebIDL/ScrollLogicalPosition.swift | 6 +- Sources/DOMKit/WebIDL/ScrollRestoration.swift | 6 +- Sources/DOMKit/WebIDL/ScrollSetting.swift | 6 +- Sources/DOMKit/WebIDL/ScrollTimeline.swift | 4 +- .../WebIDL/ScrollTimelineAutoKeyword.swift | 6 +- .../WebIDL/SecurityPolicyViolationEvent.swift | 4 +- ...urityPolicyViolationEventDisposition.swift | 6 +- Sources/DOMKit/WebIDL/Selection.swift | 32 +- Sources/DOMKit/WebIDL/SelectionMode.swift | 6 +- Sources/DOMKit/WebIDL/Sensor.swift | 6 +- Sources/DOMKit/WebIDL/SensorErrorEvent.swift | 4 +- Sources/DOMKit/WebIDL/SequenceEffect.swift | 6 +- Sources/DOMKit/WebIDL/Serial.swift | 10 +- Sources/DOMKit/WebIDL/SerialPort.swift | 20 +- .../DOMKit/WebIDL/ServiceEventHandlers.swift | 6 +- Sources/DOMKit/WebIDL/ServiceWorker.swift | 6 +- .../WebIDL/ServiceWorkerContainer.swift | 16 +- .../WebIDL/ServiceWorkerGlobalScope.swift | 6 +- .../WebIDL/ServiceWorkerRegistration.swift | 18 +- .../DOMKit/WebIDL/ServiceWorkerState.swift | 6 +- .../WebIDL/ServiceWorkerUpdateViaCache.swift | 6 +- Sources/DOMKit/WebIDL/ShadowAnimation.swift | 4 +- Sources/DOMKit/WebIDL/ShadowRoot.swift | 2 +- Sources/DOMKit/WebIDL/ShadowRootMode.swift | 6 +- Sources/DOMKit/WebIDL/SharedWorker.swift | 4 +- .../WebIDL/SharedWorkerGlobalScope.swift | 4 +- .../DOMKit/WebIDL/SlotAssignmentMode.swift | 6 +- Sources/DOMKit/WebIDL/Slottable.swift | 2 +- Sources/DOMKit/WebIDL/SourceBuffer.swift | 10 +- Sources/DOMKit/WebIDL/SourceBufferList.swift | 4 +- .../WebIDL/SpatialNavigationDirection.swift | 6 +- Sources/DOMKit/WebIDL/SpeechGrammar.swift | 2 +- Sources/DOMKit/WebIDL/SpeechGrammarList.swift | 10 +- Sources/DOMKit/WebIDL/SpeechRecognition.swift | 10 +- .../WebIDL/SpeechRecognitionAlternative.swift | 2 +- .../WebIDL/SpeechRecognitionErrorCode.swift | 6 +- .../WebIDL/SpeechRecognitionErrorEvent.swift | 4 +- .../WebIDL/SpeechRecognitionEvent.swift | 4 +- .../WebIDL/SpeechRecognitionResult.swift | 4 +- .../WebIDL/SpeechRecognitionResultList.swift | 4 +- Sources/DOMKit/WebIDL/SpeechSynthesis.swift | 12 +- .../WebIDL/SpeechSynthesisErrorCode.swift | 6 +- .../WebIDL/SpeechSynthesisErrorEvent.swift | 4 +- .../DOMKit/WebIDL/SpeechSynthesisEvent.swift | 4 +- .../WebIDL/SpeechSynthesisUtterance.swift | 4 +- .../DOMKit/WebIDL/SpeechSynthesisVoice.swift | 2 +- Sources/DOMKit/WebIDL/StaticRange.swift | 4 +- Sources/DOMKit/WebIDL/StereoPannerNode.swift | 4 +- Sources/DOMKit/WebIDL/Storage.swift | 8 +- Sources/DOMKit/WebIDL/StorageEvent.swift | 6 +- Sources/DOMKit/WebIDL/StorageManager.swift | 18 +- Sources/DOMKit/WebIDL/Strings.swift | 10228 ++++++++-------- Sources/DOMKit/WebIDL/StylePropertyMap.swift | 10 +- .../WebIDL/StylePropertyMapReadOnly.swift | 8 +- Sources/DOMKit/WebIDL/StyleSheet.swift | 2 +- Sources/DOMKit/WebIDL/StyleSheetList.swift | 4 +- Sources/DOMKit/WebIDL/SubmitEvent.swift | 4 +- Sources/DOMKit/WebIDL/SubtleCrypto.swift | 50 +- Sources/DOMKit/WebIDL/SyncEvent.swift | 4 +- Sources/DOMKit/WebIDL/SyncManager.swift | 10 +- Sources/DOMKit/WebIDL/Table.swift | 10 +- Sources/DOMKit/WebIDL/TableKind.swift | 6 +- .../DOMKit/WebIDL/TaskAttributionTiming.swift | 4 +- Sources/DOMKit/WebIDL/TaskController.swift | 6 +- Sources/DOMKit/WebIDL/TaskPriority.swift | 6 +- .../WebIDL/TaskPriorityChangeEvent.swift | 4 +- Sources/DOMKit/WebIDL/TaskSignal.swift | 2 +- Sources/DOMKit/WebIDL/TestUtils.swift | 6 +- Sources/DOMKit/WebIDL/Text.swift | 6 +- Sources/DOMKit/WebIDL/TextDecoder.swift | 6 +- Sources/DOMKit/WebIDL/TextDecoderCommon.swift | 6 +- Sources/DOMKit/WebIDL/TextDecoderStream.swift | 4 +- Sources/DOMKit/WebIDL/TextDetector.swift | 8 +- Sources/DOMKit/WebIDL/TextEncoder.swift | 8 +- Sources/DOMKit/WebIDL/TextEncoderCommon.swift | 2 +- Sources/DOMKit/WebIDL/TextEncoderStream.swift | 4 +- Sources/DOMKit/WebIDL/TextFormat.swift | 4 +- .../DOMKit/WebIDL/TextFormatUpdateEvent.swift | 6 +- Sources/DOMKit/WebIDL/TextMetrics.swift | 2 +- Sources/DOMKit/WebIDL/TextTrack.swift | 6 +- Sources/DOMKit/WebIDL/TextTrackCue.swift | 2 +- Sources/DOMKit/WebIDL/TextTrackCueList.swift | 6 +- Sources/DOMKit/WebIDL/TextTrackKind.swift | 6 +- Sources/DOMKit/WebIDL/TextTrackList.swift | 6 +- Sources/DOMKit/WebIDL/TextTrackMode.swift | 6 +- Sources/DOMKit/WebIDL/TextUpdateEvent.swift | 4 +- Sources/DOMKit/WebIDL/TimeEvent.swift | 4 +- Sources/DOMKit/WebIDL/TimeRanges.swift | 6 +- Sources/DOMKit/WebIDL/TimelinePhase.swift | 6 +- .../DOMKit/WebIDL/TokenBindingStatus.swift | 6 +- Sources/DOMKit/WebIDL/Touch.swift | 4 +- Sources/DOMKit/WebIDL/TouchEvent.swift | 4 +- Sources/DOMKit/WebIDL/TouchList.swift | 4 +- Sources/DOMKit/WebIDL/TouchType.swift | 6 +- Sources/DOMKit/WebIDL/TrackEvent.swift | 4 +- .../WebIDL/TransactionAutomationMode.swift | 6 +- Sources/DOMKit/WebIDL/TransferFunction.swift | 6 +- Sources/DOMKit/WebIDL/TransformStream.swift | 4 +- .../TransformStreamDefaultController.swift | 8 +- Sources/DOMKit/WebIDL/TransitionEvent.swift | 4 +- Sources/DOMKit/WebIDL/TreeWalker.swift | 16 +- Sources/DOMKit/WebIDL/TrustedHTML.swift | 8 +- Sources/DOMKit/WebIDL/TrustedScript.swift | 8 +- Sources/DOMKit/WebIDL/TrustedScriptURL.swift | 8 +- Sources/DOMKit/WebIDL/TrustedTypePolicy.swift | 8 +- .../WebIDL/TrustedTypePolicyFactory.swift | 14 +- Sources/DOMKit/WebIDL/UIEvent.swift | 6 +- Sources/DOMKit/WebIDL/URL.swift | 10 +- Sources/DOMKit/WebIDL/URLPattern.swift | 8 +- Sources/DOMKit/WebIDL/URLSearchParams.swift | 20 +- Sources/DOMKit/WebIDL/USB.swift | 10 +- .../DOMKit/WebIDL/USBAlternateInterface.swift | 4 +- Sources/DOMKit/WebIDL/USBConfiguration.swift | 4 +- .../DOMKit/WebIDL/USBConnectionEvent.swift | 4 +- Sources/DOMKit/WebIDL/USBDevice.swift | 62 +- Sources/DOMKit/WebIDL/USBDirection.swift | 6 +- Sources/DOMKit/WebIDL/USBEndpoint.swift | 4 +- Sources/DOMKit/WebIDL/USBEndpointType.swift | 6 +- .../DOMKit/WebIDL/USBInTransferResult.swift | 4 +- Sources/DOMKit/WebIDL/USBInterface.swift | 4 +- .../USBIsochronousInTransferPacket.swift | 4 +- .../USBIsochronousInTransferResult.swift | 4 +- .../USBIsochronousOutTransferPacket.swift | 4 +- .../USBIsochronousOutTransferResult.swift | 4 +- .../DOMKit/WebIDL/USBOutTransferResult.swift | 4 +- .../DOMKit/WebIDL/USBPermissionResult.swift | 2 +- Sources/DOMKit/WebIDL/USBRecipient.swift | 6 +- Sources/DOMKit/WebIDL/USBRequestType.swift | 6 +- Sources/DOMKit/WebIDL/USBTransferStatus.swift | 6 +- .../WebIDL/UncalibratedMagnetometer.swift | 4 +- Sources/DOMKit/WebIDL/UserIdleState.swift | 6 +- .../WebIDL/UserVerificationRequirement.swift | 6 +- Sources/DOMKit/WebIDL/VTTCue.swift | 6 +- Sources/DOMKit/WebIDL/VTTRegion.swift | 4 +- Sources/DOMKit/WebIDL/ValidityState.swift | 2 +- Sources/DOMKit/WebIDL/ValueEvent.swift | 4 +- Sources/DOMKit/WebIDL/ValueType.swift | 6 +- .../DOMKit/WebIDL/VideoColorPrimaries.swift | 6 +- Sources/DOMKit/WebIDL/VideoColorSpace.swift | 6 +- Sources/DOMKit/WebIDL/VideoDecoder.swift | 20 +- Sources/DOMKit/WebIDL/VideoEncoder.swift | 20 +- .../DOMKit/WebIDL/VideoFacingModeEnum.swift | 6 +- Sources/DOMKit/WebIDL/VideoFrame.swift | 16 +- .../WebIDL/VideoMatrixCoefficients.swift | 6 +- Sources/DOMKit/WebIDL/VideoPixelFormat.swift | 6 +- .../DOMKit/WebIDL/VideoPlaybackQuality.swift | 2 +- .../DOMKit/WebIDL/VideoResizeModeEnum.swift | 6 +- Sources/DOMKit/WebIDL/VideoTrack.swift | 2 +- .../DOMKit/WebIDL/VideoTrackGenerator.swift | 4 +- Sources/DOMKit/WebIDL/VideoTrackList.swift | 6 +- .../WebIDL/VideoTransferCharacteristics.swift | 6 +- Sources/DOMKit/WebIDL/VirtualKeyboard.swift | 6 +- Sources/DOMKit/WebIDL/VisualViewport.swift | 2 +- ...BGL_blend_equation_advanced_coherent.swift | 2 +- .../WebIDL/WEBGL_color_buffer_float.swift | 2 +- .../WEBGL_compressed_texture_astc.swift | 4 +- .../WebIDL/WEBGL_compressed_texture_etc.swift | 2 +- .../WEBGL_compressed_texture_etc1.swift | 2 +- .../WEBGL_compressed_texture_pvrtc.swift | 2 +- .../WEBGL_compressed_texture_s3tc.swift | 2 +- .../WEBGL_compressed_texture_s3tc_srgb.swift | 2 +- .../WebIDL/WEBGL_debug_renderer_info.swift | 2 +- .../DOMKit/WebIDL/WEBGL_debug_shaders.swift | 4 +- .../DOMKit/WebIDL/WEBGL_depth_texture.swift | 2 +- .../DOMKit/WebIDL/WEBGL_draw_buffers.swift | 4 +- ..._instanced_base_vertex_base_instance.swift | 6 +- .../DOMKit/WebIDL/WEBGL_lose_context.swift | 6 +- Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift | 10 +- ..._instanced_base_vertex_base_instance.swift | 6 +- Sources/DOMKit/WebIDL/WakeLock.swift | 6 +- Sources/DOMKit/WebIDL/WakeLockSentinel.swift | 6 +- Sources/DOMKit/WebIDL/WakeLockType.swift | 6 +- Sources/DOMKit/WebIDL/WaveShaperNode.swift | 4 +- Sources/DOMKit/WebIDL/WebAssembly.swift | 24 +- .../WebIDL/WebGL2RenderingContext.swift | 2 +- .../WebIDL/WebGL2RenderingContextBase.swift | 716 +- .../WebGL2RenderingContextOverloads.swift | 66 +- Sources/DOMKit/WebIDL/WebGLActiveInfo.swift | 2 +- Sources/DOMKit/WebIDL/WebGLBuffer.swift | 2 +- Sources/DOMKit/WebIDL/WebGLContextEvent.swift | 4 +- Sources/DOMKit/WebIDL/WebGLFramebuffer.swift | 2 +- Sources/DOMKit/WebIDL/WebGLObject.swift | 2 +- .../DOMKit/WebIDL/WebGLPowerPreference.swift | 6 +- Sources/DOMKit/WebIDL/WebGLProgram.swift | 2 +- Sources/DOMKit/WebIDL/WebGLQuery.swift | 2 +- Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift | 2 +- .../DOMKit/WebIDL/WebGLRenderingContext.swift | 2 +- .../WebIDL/WebGLRenderingContextBase.swift | 838 +- .../WebGLRenderingContextOverloads.swift | 42 +- Sources/DOMKit/WebIDL/WebGLSampler.swift | 2 +- Sources/DOMKit/WebIDL/WebGLShader.swift | 2 +- .../WebIDL/WebGLShaderPrecisionFormat.swift | 2 +- Sources/DOMKit/WebIDL/WebGLSync.swift | 2 +- Sources/DOMKit/WebIDL/WebGLTexture.swift | 2 +- .../DOMKit/WebIDL/WebGLTimerQueryEXT.swift | 2 +- .../WebIDL/WebGLTransformFeedback.swift | 2 +- .../DOMKit/WebIDL/WebGLUniformLocation.swift | 2 +- .../WebIDL/WebGLVertexArrayObject.swift | 2 +- .../WebIDL/WebGLVertexArrayObjectOES.swift | 2 +- Sources/DOMKit/WebIDL/WebSocket.swift | 8 +- Sources/DOMKit/WebIDL/WebTransport.swift | 18 +- .../WebTransportBidirectionalStream.swift | 2 +- .../WebTransportDatagramDuplexStream.swift | 2 +- Sources/DOMKit/WebIDL/WebTransportError.swift | 4 +- .../WebIDL/WebTransportErrorSource.swift | 6 +- .../DOMKit/WebIDL/WellKnownDirectory.swift | 6 +- Sources/DOMKit/WebIDL/WheelEvent.swift | 4 +- Sources/DOMKit/WebIDL/Window.swift | 78 +- Sources/DOMKit/WebIDL/WindowClient.swift | 10 +- .../DOMKit/WebIDL/WindowControlsOverlay.swift | 4 +- ...owControlsOverlayGeometryChangeEvent.swift | 4 +- .../DOMKit/WebIDL/WindowEventHandlers.swift | 38 +- .../DOMKit/WebIDL/WindowLocalStorage.swift | 2 +- .../WebIDL/WindowOrWorkerGlobalScope.swift | 48 +- .../DOMKit/WebIDL/WindowSessionStorage.swift | 2 +- Sources/DOMKit/WebIDL/Worker.swift | 10 +- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 4 +- Sources/DOMKit/WebIDL/WorkerLocation.swift | 2 +- Sources/DOMKit/WebIDL/WorkerNavigator.swift | 2 +- Sources/DOMKit/WebIDL/WorkerType.swift | 6 +- Sources/DOMKit/WebIDL/Worklet.swift | 6 +- Sources/DOMKit/WebIDL/WorkletAnimation.swift | 4 +- .../WebIDL/WorkletAnimationEffect.swift | 6 +- .../DOMKit/WebIDL/WorkletGlobalScope.swift | 2 +- .../DOMKit/WebIDL/WorkletGroupEffect.swift | 4 +- Sources/DOMKit/WebIDL/WritableStream.swift | 14 +- .../WritableStreamDefaultController.swift | 4 +- .../WebIDL/WritableStreamDefaultWriter.swift | 18 +- Sources/DOMKit/WebIDL/WriteCommandType.swift | 6 +- Sources/DOMKit/WebIDL/XMLDocument.swift | 2 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 20 +- .../WebIDL/XMLHttpRequestEventTarget.swift | 2 +- .../WebIDL/XMLHttpRequestResponseType.swift | 6 +- .../DOMKit/WebIDL/XMLHttpRequestUpload.swift | 2 +- Sources/DOMKit/WebIDL/XMLSerializer.swift | 6 +- Sources/DOMKit/WebIDL/XPathEvaluator.swift | 4 +- Sources/DOMKit/WebIDL/XPathExpression.swift | 4 +- Sources/DOMKit/WebIDL/XPathResult.swift | 6 +- Sources/DOMKit/WebIDL/XRAnchor.swift | 4 +- Sources/DOMKit/WebIDL/XRAnchorSet.swift | 2 +- .../WebIDL/XRBoundedReferenceSpace.swift | 2 +- .../DOMKit/WebIDL/XRCPUDepthInformation.swift | 4 +- .../DOMKit/WebIDL/XRCompositionLayer.swift | 4 +- Sources/DOMKit/WebIDL/XRCubeLayer.swift | 2 +- Sources/DOMKit/WebIDL/XRCylinderLayer.swift | 2 +- Sources/DOMKit/WebIDL/XRDOMOverlayType.swift | 6 +- Sources/DOMKit/WebIDL/XRDepthDataFormat.swift | 6 +- .../DOMKit/WebIDL/XRDepthInformation.swift | 2 +- Sources/DOMKit/WebIDL/XRDepthUsage.swift | 6 +- .../WebIDL/XREnvironmentBlendMode.swift | 6 +- Sources/DOMKit/WebIDL/XREquirectLayer.swift | 2 +- Sources/DOMKit/WebIDL/XREye.swift | 6 +- Sources/DOMKit/WebIDL/XRFrame.swift | 24 +- Sources/DOMKit/WebIDL/XRHand.swift | 4 +- Sources/DOMKit/WebIDL/XRHandJoint.swift | 6 +- Sources/DOMKit/WebIDL/XRHandedness.swift | 6 +- Sources/DOMKit/WebIDL/XRHitTestResult.swift | 8 +- Sources/DOMKit/WebIDL/XRHitTestSource.swift | 4 +- .../WebIDL/XRHitTestTrackableType.swift | 6 +- Sources/DOMKit/WebIDL/XRInputSource.swift | 2 +- .../DOMKit/WebIDL/XRInputSourceArray.swift | 4 +- .../DOMKit/WebIDL/XRInputSourceEvent.swift | 4 +- .../WebIDL/XRInputSourcesChangeEvent.swift | 4 +- Sources/DOMKit/WebIDL/XRInteractionMode.swift | 6 +- Sources/DOMKit/WebIDL/XRJointPose.swift | 2 +- Sources/DOMKit/WebIDL/XRJointSpace.swift | 2 +- Sources/DOMKit/WebIDL/XRLayer.swift | 2 +- Sources/DOMKit/WebIDL/XRLayerEvent.swift | 4 +- Sources/DOMKit/WebIDL/XRLayerLayout.swift | 6 +- Sources/DOMKit/WebIDL/XRLightEstimate.swift | 2 +- Sources/DOMKit/WebIDL/XRLightProbe.swift | 2 +- Sources/DOMKit/WebIDL/XRMediaBinding.swift | 10 +- .../DOMKit/WebIDL/XRPermissionStatus.swift | 2 +- Sources/DOMKit/WebIDL/XRPose.swift | 2 +- Sources/DOMKit/WebIDL/XRProjectionLayer.swift | 2 +- Sources/DOMKit/WebIDL/XRQuadLayer.swift | 2 +- Sources/DOMKit/WebIDL/XRRay.swift | 6 +- Sources/DOMKit/WebIDL/XRReferenceSpace.swift | 4 +- .../DOMKit/WebIDL/XRReferenceSpaceEvent.swift | 4 +- .../DOMKit/WebIDL/XRReferenceSpaceType.swift | 6 +- .../DOMKit/WebIDL/XRReflectionFormat.swift | 6 +- Sources/DOMKit/WebIDL/XRRenderState.swift | 2 +- Sources/DOMKit/WebIDL/XRRigidTransform.swift | 4 +- Sources/DOMKit/WebIDL/XRSession.swift | 30 +- Sources/DOMKit/WebIDL/XRSessionEvent.swift | 4 +- Sources/DOMKit/WebIDL/XRSessionMode.swift | 6 +- Sources/DOMKit/WebIDL/XRSpace.swift | 2 +- Sources/DOMKit/WebIDL/XRSubImage.swift | 2 +- Sources/DOMKit/WebIDL/XRSystem.swift | 10 +- Sources/DOMKit/WebIDL/XRTargetRayMode.swift | 6 +- Sources/DOMKit/WebIDL/XRTextureType.swift | 6 +- .../XRTransientInputHitTestResult.swift | 2 +- .../XRTransientInputHitTestSource.swift | 4 +- Sources/DOMKit/WebIDL/XRView.swift | 4 +- Sources/DOMKit/WebIDL/XRViewerPose.swift | 2 +- Sources/DOMKit/WebIDL/XRViewport.swift | 2 +- Sources/DOMKit/WebIDL/XRVisibilityState.swift | 6 +- Sources/DOMKit/WebIDL/XRWebGLBinding.swift | 22 +- .../WebIDL/XRWebGLDepthInformation.swift | 2 +- Sources/DOMKit/WebIDL/XRWebGLLayer.swift | 8 +- Sources/DOMKit/WebIDL/XRWebGLSubImage.swift | 2 +- Sources/DOMKit/WebIDL/XSLTProcessor.swift | 20 +- Sources/DOMKit/WebIDL/console.swift | 40 +- Sources/WebIDLToSwift/IDLBuilder.swift | 4 +- .../WebIDL+SwiftRepresentation.swift | 28 +- 1403 files changed, 10837 insertions(+), 10837 deletions(-) diff --git a/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift b/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift index 70b82c9b..22eaec64 100644 --- a/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift +++ b/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ANGLE_instanced_arrays: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ANGLE_instanced_arrays].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ANGLE_instanced_arrays].function! } public let jsObject: JSObject @@ -14,17 +14,17 @@ public class ANGLE_instanced_arrays: JSBridgedClass { public static let VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum = 0x88FE - public func drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) { + @inlinable public func drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) { let this = jsObject _ = this[Strings.drawArraysInstancedANGLE].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue(), primcount.jsValue()]) } - public func drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei) { + @inlinable public func drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei) { let this = jsObject _ = this[Strings.drawElementsInstancedANGLE].function!(this: this, arguments: [mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), primcount.jsValue()]) } - public func vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint) { + @inlinable public func vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint) { let this = jsObject _ = this[Strings.vertexAttribDivisorANGLE].function!(this: this, arguments: [index.jsValue(), divisor.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/ARIAMixin.swift b/Sources/DOMKit/WebIDL/ARIAMixin.swift index 18edb7e9..a0712417 100644 --- a/Sources/DOMKit/WebIDL/ARIAMixin.swift +++ b/Sources/DOMKit/WebIDL/ARIAMixin.swift @@ -5,207 +5,207 @@ import JavaScriptKit public protocol ARIAMixin: JSBridgedClass {} public extension ARIAMixin { - var role: String? { + @inlinable var role: String? { get { ReadWriteAttribute[Strings.role, in: jsObject] } set { ReadWriteAttribute[Strings.role, in: jsObject] = newValue } } - var ariaAtomic: String? { + @inlinable var ariaAtomic: String? { get { ReadWriteAttribute[Strings.ariaAtomic, in: jsObject] } set { ReadWriteAttribute[Strings.ariaAtomic, in: jsObject] = newValue } } - var ariaAutoComplete: String? { + @inlinable var ariaAutoComplete: String? { get { ReadWriteAttribute[Strings.ariaAutoComplete, in: jsObject] } set { ReadWriteAttribute[Strings.ariaAutoComplete, in: jsObject] = newValue } } - var ariaBusy: String? { + @inlinable var ariaBusy: String? { get { ReadWriteAttribute[Strings.ariaBusy, in: jsObject] } set { ReadWriteAttribute[Strings.ariaBusy, in: jsObject] = newValue } } - var ariaChecked: String? { + @inlinable var ariaChecked: String? { get { ReadWriteAttribute[Strings.ariaChecked, in: jsObject] } set { ReadWriteAttribute[Strings.ariaChecked, in: jsObject] = newValue } } - var ariaColCount: String? { + @inlinable var ariaColCount: String? { get { ReadWriteAttribute[Strings.ariaColCount, in: jsObject] } set { ReadWriteAttribute[Strings.ariaColCount, in: jsObject] = newValue } } - var ariaColIndex: String? { + @inlinable var ariaColIndex: String? { get { ReadWriteAttribute[Strings.ariaColIndex, in: jsObject] } set { ReadWriteAttribute[Strings.ariaColIndex, in: jsObject] = newValue } } - var ariaColIndexText: String? { + @inlinable var ariaColIndexText: String? { get { ReadWriteAttribute[Strings.ariaColIndexText, in: jsObject] } set { ReadWriteAttribute[Strings.ariaColIndexText, in: jsObject] = newValue } } - var ariaColSpan: String? { + @inlinable var ariaColSpan: String? { get { ReadWriteAttribute[Strings.ariaColSpan, in: jsObject] } set { ReadWriteAttribute[Strings.ariaColSpan, in: jsObject] = newValue } } - var ariaCurrent: String? { + @inlinable var ariaCurrent: String? { get { ReadWriteAttribute[Strings.ariaCurrent, in: jsObject] } set { ReadWriteAttribute[Strings.ariaCurrent, in: jsObject] = newValue } } - var ariaDescription: String? { + @inlinable var ariaDescription: String? { get { ReadWriteAttribute[Strings.ariaDescription, in: jsObject] } set { ReadWriteAttribute[Strings.ariaDescription, in: jsObject] = newValue } } - var ariaDisabled: String? { + @inlinable var ariaDisabled: String? { get { ReadWriteAttribute[Strings.ariaDisabled, in: jsObject] } set { ReadWriteAttribute[Strings.ariaDisabled, in: jsObject] = newValue } } - var ariaExpanded: String? { + @inlinable var ariaExpanded: String? { get { ReadWriteAttribute[Strings.ariaExpanded, in: jsObject] } set { ReadWriteAttribute[Strings.ariaExpanded, in: jsObject] = newValue } } - var ariaHasPopup: String? { + @inlinable var ariaHasPopup: String? { get { ReadWriteAttribute[Strings.ariaHasPopup, in: jsObject] } set { ReadWriteAttribute[Strings.ariaHasPopup, in: jsObject] = newValue } } - var ariaHidden: String? { + @inlinable var ariaHidden: String? { get { ReadWriteAttribute[Strings.ariaHidden, in: jsObject] } set { ReadWriteAttribute[Strings.ariaHidden, in: jsObject] = newValue } } - var ariaInvalid: String? { + @inlinable var ariaInvalid: String? { get { ReadWriteAttribute[Strings.ariaInvalid, in: jsObject] } set { ReadWriteAttribute[Strings.ariaInvalid, in: jsObject] = newValue } } - var ariaKeyShortcuts: String? { + @inlinable var ariaKeyShortcuts: String? { get { ReadWriteAttribute[Strings.ariaKeyShortcuts, in: jsObject] } set { ReadWriteAttribute[Strings.ariaKeyShortcuts, in: jsObject] = newValue } } - var ariaLabel: String? { + @inlinable var ariaLabel: String? { get { ReadWriteAttribute[Strings.ariaLabel, in: jsObject] } set { ReadWriteAttribute[Strings.ariaLabel, in: jsObject] = newValue } } - var ariaLevel: String? { + @inlinable var ariaLevel: String? { get { ReadWriteAttribute[Strings.ariaLevel, in: jsObject] } set { ReadWriteAttribute[Strings.ariaLevel, in: jsObject] = newValue } } - var ariaLive: String? { + @inlinable var ariaLive: String? { get { ReadWriteAttribute[Strings.ariaLive, in: jsObject] } set { ReadWriteAttribute[Strings.ariaLive, in: jsObject] = newValue } } - var ariaModal: String? { + @inlinable var ariaModal: String? { get { ReadWriteAttribute[Strings.ariaModal, in: jsObject] } set { ReadWriteAttribute[Strings.ariaModal, in: jsObject] = newValue } } - var ariaMultiLine: String? { + @inlinable var ariaMultiLine: String? { get { ReadWriteAttribute[Strings.ariaMultiLine, in: jsObject] } set { ReadWriteAttribute[Strings.ariaMultiLine, in: jsObject] = newValue } } - var ariaMultiSelectable: String? { + @inlinable var ariaMultiSelectable: String? { get { ReadWriteAttribute[Strings.ariaMultiSelectable, in: jsObject] } set { ReadWriteAttribute[Strings.ariaMultiSelectable, in: jsObject] = newValue } } - var ariaOrientation: String? { + @inlinable var ariaOrientation: String? { get { ReadWriteAttribute[Strings.ariaOrientation, in: jsObject] } set { ReadWriteAttribute[Strings.ariaOrientation, in: jsObject] = newValue } } - var ariaPlaceholder: String? { + @inlinable var ariaPlaceholder: String? { get { ReadWriteAttribute[Strings.ariaPlaceholder, in: jsObject] } set { ReadWriteAttribute[Strings.ariaPlaceholder, in: jsObject] = newValue } } - var ariaPosInSet: String? { + @inlinable var ariaPosInSet: String? { get { ReadWriteAttribute[Strings.ariaPosInSet, in: jsObject] } set { ReadWriteAttribute[Strings.ariaPosInSet, in: jsObject] = newValue } } - var ariaPressed: String? { + @inlinable var ariaPressed: String? { get { ReadWriteAttribute[Strings.ariaPressed, in: jsObject] } set { ReadWriteAttribute[Strings.ariaPressed, in: jsObject] = newValue } } - var ariaReadOnly: String? { + @inlinable var ariaReadOnly: String? { get { ReadWriteAttribute[Strings.ariaReadOnly, in: jsObject] } set { ReadWriteAttribute[Strings.ariaReadOnly, in: jsObject] = newValue } } - var ariaRequired: String? { + @inlinable var ariaRequired: String? { get { ReadWriteAttribute[Strings.ariaRequired, in: jsObject] } set { ReadWriteAttribute[Strings.ariaRequired, in: jsObject] = newValue } } - var ariaRoleDescription: String? { + @inlinable var ariaRoleDescription: String? { get { ReadWriteAttribute[Strings.ariaRoleDescription, in: jsObject] } set { ReadWriteAttribute[Strings.ariaRoleDescription, in: jsObject] = newValue } } - var ariaRowCount: String? { + @inlinable var ariaRowCount: String? { get { ReadWriteAttribute[Strings.ariaRowCount, in: jsObject] } set { ReadWriteAttribute[Strings.ariaRowCount, in: jsObject] = newValue } } - var ariaRowIndex: String? { + @inlinable var ariaRowIndex: String? { get { ReadWriteAttribute[Strings.ariaRowIndex, in: jsObject] } set { ReadWriteAttribute[Strings.ariaRowIndex, in: jsObject] = newValue } } - var ariaRowIndexText: String? { + @inlinable var ariaRowIndexText: String? { get { ReadWriteAttribute[Strings.ariaRowIndexText, in: jsObject] } set { ReadWriteAttribute[Strings.ariaRowIndexText, in: jsObject] = newValue } } - var ariaRowSpan: String? { + @inlinable var ariaRowSpan: String? { get { ReadWriteAttribute[Strings.ariaRowSpan, in: jsObject] } set { ReadWriteAttribute[Strings.ariaRowSpan, in: jsObject] = newValue } } - var ariaSelected: String? { + @inlinable var ariaSelected: String? { get { ReadWriteAttribute[Strings.ariaSelected, in: jsObject] } set { ReadWriteAttribute[Strings.ariaSelected, in: jsObject] = newValue } } - var ariaSetSize: String? { + @inlinable var ariaSetSize: String? { get { ReadWriteAttribute[Strings.ariaSetSize, in: jsObject] } set { ReadWriteAttribute[Strings.ariaSetSize, in: jsObject] = newValue } } - var ariaSort: String? { + @inlinable var ariaSort: String? { get { ReadWriteAttribute[Strings.ariaSort, in: jsObject] } set { ReadWriteAttribute[Strings.ariaSort, in: jsObject] = newValue } } - var ariaValueMax: String? { + @inlinable var ariaValueMax: String? { get { ReadWriteAttribute[Strings.ariaValueMax, in: jsObject] } set { ReadWriteAttribute[Strings.ariaValueMax, in: jsObject] = newValue } } - var ariaValueMin: String? { + @inlinable var ariaValueMin: String? { get { ReadWriteAttribute[Strings.ariaValueMin, in: jsObject] } set { ReadWriteAttribute[Strings.ariaValueMin, in: jsObject] = newValue } } - var ariaValueNow: String? { + @inlinable var ariaValueNow: String? { get { ReadWriteAttribute[Strings.ariaValueNow, in: jsObject] } set { ReadWriteAttribute[Strings.ariaValueNow, in: jsObject] = newValue } } - var ariaValueText: String? { + @inlinable var ariaValueText: String? { get { ReadWriteAttribute[Strings.ariaValueText, in: jsObject] } set { ReadWriteAttribute[Strings.ariaValueText, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index 02a32f44..28da04b0 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AbortController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AbortController].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AbortController].function! } public let jsObject: JSObject @@ -13,14 +13,14 @@ public class AbortController: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute public var signal: AbortSignal - public func abort(reason: JSValue? = nil) { + @inlinable public func abort(reason: JSValue? = nil) { let this = jsObject _ = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index 1d4c072d..64697946 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AbortSignal: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.AbortSignal].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AbortSignal].function! } public required init(unsafelyWrapping jsObject: JSObject) { _aborted = ReadonlyAttribute(jsObject: jsObject, name: Strings.aborted) @@ -13,12 +13,12 @@ public class AbortSignal: EventTarget { super.init(unsafelyWrapping: jsObject) } - public static func abort(reason: JSValue? = nil) -> Self { + @inlinable public static func abort(reason: JSValue? = nil) -> Self { let this = constructor return this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! } - public static func timeout(milliseconds: UInt64) -> Self { + @inlinable public static func timeout(milliseconds: UInt64) -> Self { let this = constructor return this[Strings.timeout].function!(this: this, arguments: [milliseconds.jsValue()]).fromJSValue()! } @@ -29,7 +29,7 @@ public class AbortSignal: EventTarget { @ReadonlyAttribute public var reason: JSValue - public func throwIfAborted() { + @inlinable public func throwIfAborted() { let this = jsObject _ = this[Strings.throwIfAborted].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift b/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift index 0c1f2b5f..f7c6806d 100644 --- a/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift +++ b/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class AbsoluteOrientationSensor: OrientationSensor { - override public class var constructor: JSFunction { JSObject.global[Strings.AbsoluteOrientationSensor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AbsoluteOrientationSensor].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(sensorOptions: OrientationSensorOptions? = nil) { + @inlinable public convenience init(sensorOptions: OrientationSensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/AbstractRange.swift b/Sources/DOMKit/WebIDL/AbstractRange.swift index 945317c3..8ef0573c 100644 --- a/Sources/DOMKit/WebIDL/AbstractRange.swift +++ b/Sources/DOMKit/WebIDL/AbstractRange.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AbstractRange: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AbstractRange].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AbstractRange].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/AbstractWorker.swift b/Sources/DOMKit/WebIDL/AbstractWorker.swift index 259c373a..121f2a7c 100644 --- a/Sources/DOMKit/WebIDL/AbstractWorker.swift +++ b/Sources/DOMKit/WebIDL/AbstractWorker.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol AbstractWorker: JSBridgedClass {} public extension AbstractWorker { - var onerror: EventHandler { + @inlinable var onerror: EventHandler { get { ClosureAttribute1Optional[Strings.onerror, in: jsObject] } set { ClosureAttribute1Optional[Strings.onerror, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/Accelerometer.swift b/Sources/DOMKit/WebIDL/Accelerometer.swift index 12f0bea5..d5ad6499 100644 --- a/Sources/DOMKit/WebIDL/Accelerometer.swift +++ b/Sources/DOMKit/WebIDL/Accelerometer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Accelerometer: Sensor { - override public class var constructor: JSFunction { JSObject.global[Strings.Accelerometer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Accelerometer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) @@ -13,7 +13,7 @@ public class Accelerometer: Sensor { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: AccelerometerSensorOptions? = nil) { + @inlinable public convenience init(options: AccelerometerSensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift index 932f7420..b0efea7f 100644 --- a/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift +++ b/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift @@ -7,16 +7,16 @@ public enum AccelerometerLocalCoordinateSystem: JSString, JSValueCompatible { case device = "device" case screen = "screen" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AlignSetting.swift b/Sources/DOMKit/WebIDL/AlignSetting.swift index 8b8ff979..5e6537dc 100644 --- a/Sources/DOMKit/WebIDL/AlignSetting.swift +++ b/Sources/DOMKit/WebIDL/AlignSetting.swift @@ -10,16 +10,16 @@ public enum AlignSetting: JSString, JSValueCompatible { case left = "left" case right = "right" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AlphaOption.swift b/Sources/DOMKit/WebIDL/AlphaOption.swift index 474e80dd..7ffacbc3 100644 --- a/Sources/DOMKit/WebIDL/AlphaOption.swift +++ b/Sources/DOMKit/WebIDL/AlphaOption.swift @@ -7,16 +7,16 @@ public enum AlphaOption: JSString, JSValueCompatible { case keep = "keep" case discard = "discard" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AmbientLightSensor.swift b/Sources/DOMKit/WebIDL/AmbientLightSensor.swift index de4e6837..b99f5e2a 100644 --- a/Sources/DOMKit/WebIDL/AmbientLightSensor.swift +++ b/Sources/DOMKit/WebIDL/AmbientLightSensor.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class AmbientLightSensor: Sensor { - override public class var constructor: JSFunction { JSObject.global[Strings.AmbientLightSensor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AmbientLightSensor].function! } public required init(unsafelyWrapping jsObject: JSObject) { _illuminance = ReadonlyAttribute(jsObject: jsObject, name: Strings.illuminance) super.init(unsafelyWrapping: jsObject) } - public convenience init(sensorOptions: SensorOptions? = nil) { + @inlinable public convenience init(sensorOptions: SensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/AnalyserNode.swift b/Sources/DOMKit/WebIDL/AnalyserNode.swift index 68e07212..f4d18b09 100644 --- a/Sources/DOMKit/WebIDL/AnalyserNode.swift +++ b/Sources/DOMKit/WebIDL/AnalyserNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AnalyserNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.AnalyserNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AnalyserNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _fftSize = ReadWriteAttribute(jsObject: jsObject, name: Strings.fftSize) @@ -15,26 +15,26 @@ public class AnalyserNode: AudioNode { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: AnalyserOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: AnalyserOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } - public func getFloatFrequencyData(array: Float32Array) { + @inlinable public func getFloatFrequencyData(array: Float32Array) { let this = jsObject _ = this[Strings.getFloatFrequencyData].function!(this: this, arguments: [array.jsValue()]) } - public func getByteFrequencyData(array: Uint8Array) { + @inlinable public func getByteFrequencyData(array: Uint8Array) { let this = jsObject _ = this[Strings.getByteFrequencyData].function!(this: this, arguments: [array.jsValue()]) } - public func getFloatTimeDomainData(array: Float32Array) { + @inlinable public func getFloatTimeDomainData(array: Float32Array) { let this = jsObject _ = this[Strings.getFloatTimeDomainData].function!(this: this, arguments: [array.jsValue()]) } - public func getByteTimeDomainData(array: Uint8Array) { + @inlinable public func getByteTimeDomainData(array: Uint8Array) { let this = jsObject _ = this[Strings.getByteTimeDomainData].function!(this: this, arguments: [array.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/Animatable.swift b/Sources/DOMKit/WebIDL/Animatable.swift index 81ebd41d..6b638675 100644 --- a/Sources/DOMKit/WebIDL/Animatable.swift +++ b/Sources/DOMKit/WebIDL/Animatable.swift @@ -5,12 +5,12 @@ import JavaScriptKit public protocol Animatable: JSBridgedClass {} public extension Animatable { - func animate(keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) -> Animation { + @inlinable func animate(keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) -> Animation { let this = jsObject return this[Strings.animate].function!(this: this, arguments: [keyframes.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - func getAnimations(options: GetAnimationsOptions? = nil) -> [Animation] { + @inlinable func getAnimations(options: GetAnimationsOptions? = nil) -> [Animation] { let this = jsObject return this[Strings.getAnimations].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Animation.swift b/Sources/DOMKit/WebIDL/Animation.swift index c60942e0..9dc6be1d 100644 --- a/Sources/DOMKit/WebIDL/Animation.swift +++ b/Sources/DOMKit/WebIDL/Animation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Animation: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Animation].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Animation].function! } public required init(unsafelyWrapping jsObject: JSObject) { _startTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.startTime) @@ -30,7 +30,7 @@ public class Animation: EventTarget { @ReadWriteAttribute public var currentTime: CSSNumberish? - public convenience init(effect: AnimationEffect? = nil, timeline: AnimationTimeline? = nil) { + @inlinable public convenience init(effect: AnimationEffect? = nil, timeline: AnimationTimeline? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [effect?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined])) } @@ -70,42 +70,42 @@ public class Animation: EventTarget { @ClosureAttribute1Optional public var onremove: EventHandler - public func cancel() { + @inlinable public func cancel() { let this = jsObject _ = this[Strings.cancel].function!(this: this, arguments: []) } - public func finish() { + @inlinable public func finish() { let this = jsObject _ = this[Strings.finish].function!(this: this, arguments: []) } - public func play() { + @inlinable public func play() { let this = jsObject _ = this[Strings.play].function!(this: this, arguments: []) } - public func pause() { + @inlinable public func pause() { let this = jsObject _ = this[Strings.pause].function!(this: this, arguments: []) } - public func updatePlaybackRate(playbackRate: Double) { + @inlinable public func updatePlaybackRate(playbackRate: Double) { let this = jsObject _ = this[Strings.updatePlaybackRate].function!(this: this, arguments: [playbackRate.jsValue()]) } - public func reverse() { + @inlinable public func reverse() { let this = jsObject _ = this[Strings.reverse].function!(this: this, arguments: []) } - public func persist() { + @inlinable public func persist() { let this = jsObject _ = this[Strings.persist].function!(this: this, arguments: []) } - public func commitStyles() { + @inlinable public func commitStyles() { let this = jsObject _ = this[Strings.commitStyles].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect.swift index 287e4c8d..5215d8cb 100644 --- a/Sources/DOMKit/WebIDL/AnimationEffect.swift +++ b/Sources/DOMKit/WebIDL/AnimationEffect.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AnimationEffect: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AnimationEffect].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AnimationEffect].function! } public let jsObject: JSObject @@ -24,37 +24,37 @@ public class AnimationEffect: JSBridgedClass { @ReadonlyAttribute public var nextSibling: AnimationEffect? - public func before(effects: AnimationEffect...) { + @inlinable public func before(effects: AnimationEffect...) { let this = jsObject _ = this[Strings.before].function!(this: this, arguments: effects.map { $0.jsValue() }) } - public func after(effects: AnimationEffect...) { + @inlinable public func after(effects: AnimationEffect...) { let this = jsObject _ = this[Strings.after].function!(this: this, arguments: effects.map { $0.jsValue() }) } - public func replace(effects: AnimationEffect...) { + @inlinable public func replace(effects: AnimationEffect...) { let this = jsObject _ = this[Strings.replace].function!(this: this, arguments: effects.map { $0.jsValue() }) } - public func remove() { + @inlinable public func remove() { let this = jsObject _ = this[Strings.remove].function!(this: this, arguments: []) } - public func getTiming() -> EffectTiming { + @inlinable public func getTiming() -> EffectTiming { let this = jsObject return this[Strings.getTiming].function!(this: this, arguments: []).fromJSValue()! } - public func getComputedTiming() -> ComputedEffectTiming { + @inlinable public func getComputedTiming() -> ComputedEffectTiming { let this = jsObject return this[Strings.getComputedTiming].function!(this: this, arguments: []).fromJSValue()! } - public func updateTiming(timing: OptionalEffectTiming? = nil) { + @inlinable public func updateTiming(timing: OptionalEffectTiming? = nil) { let this = jsObject _ = this[Strings.updateTiming].function!(this: this, arguments: [timing?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/AnimationEvent.swift b/Sources/DOMKit/WebIDL/AnimationEvent.swift index 362ed071..b3bc3343 100644 --- a/Sources/DOMKit/WebIDL/AnimationEvent.swift +++ b/Sources/DOMKit/WebIDL/AnimationEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AnimationEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.AnimationEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AnimationEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _animationName = ReadonlyAttribute(jsObject: jsObject, name: Strings.animationName) @@ -13,7 +13,7 @@ public class AnimationEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, animationEventInitDict: AnimationEventInit? = nil) { + @inlinable public convenience init(type: String, animationEventInitDict: AnimationEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), animationEventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift index 68a7c4a8..4dd53eae 100644 --- a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift +++ b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift @@ -7,7 +7,7 @@ public protocol AnimationFrameProvider: JSBridgedClass {} public extension AnimationFrameProvider { // XXX: method 'requestAnimationFrame' is ignored - func cancelAnimationFrame(handle: UInt32) { + @inlinable func cancelAnimationFrame(handle: UInt32) { let this = jsObject _ = this[Strings.cancelAnimationFrame].function!(this: this, arguments: [handle.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/AnimationNodeList.swift b/Sources/DOMKit/WebIDL/AnimationNodeList.swift index 56d329f9..f9c56e9e 100644 --- a/Sources/DOMKit/WebIDL/AnimationNodeList.swift +++ b/Sources/DOMKit/WebIDL/AnimationNodeList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AnimationNodeList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AnimationNodeList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AnimationNodeList].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class AnimationNodeList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> AnimationEffect? { + @inlinable public subscript(key: Int) -> AnimationEffect? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/AnimationPlayState.swift b/Sources/DOMKit/WebIDL/AnimationPlayState.swift index a409d86b..b270e919 100644 --- a/Sources/DOMKit/WebIDL/AnimationPlayState.swift +++ b/Sources/DOMKit/WebIDL/AnimationPlayState.swift @@ -9,16 +9,16 @@ public enum AnimationPlayState: JSString, JSValueCompatible { case paused = "paused" case finished = "finished" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift b/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift index 20467d31..2f66d482 100644 --- a/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift +++ b/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AnimationPlaybackEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.AnimationPlaybackEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AnimationPlaybackEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) @@ -12,7 +12,7 @@ public class AnimationPlaybackEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: AnimationPlaybackEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: AnimationPlaybackEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/AnimationReplaceState.swift b/Sources/DOMKit/WebIDL/AnimationReplaceState.swift index 4d76829f..c5521877 100644 --- a/Sources/DOMKit/WebIDL/AnimationReplaceState.swift +++ b/Sources/DOMKit/WebIDL/AnimationReplaceState.swift @@ -8,16 +8,16 @@ public enum AnimationReplaceState: JSString, JSValueCompatible { case removed = "removed" case persisted = "persisted" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AnimationTimeline.swift b/Sources/DOMKit/WebIDL/AnimationTimeline.swift index 9a918ecf..b78054b6 100644 --- a/Sources/DOMKit/WebIDL/AnimationTimeline.swift +++ b/Sources/DOMKit/WebIDL/AnimationTimeline.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AnimationTimeline: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AnimationTimeline].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AnimationTimeline].function! } public let jsObject: JSObject @@ -18,7 +18,7 @@ public class AnimationTimeline: JSBridgedClass { @ReadonlyAttribute public var duration: CSSNumberish? - public func play(effect: AnimationEffect? = nil) -> Animation { + @inlinable public func play(effect: AnimationEffect? = nil) -> Animation { let this = jsObject return this[Strings.play].function!(this: this, arguments: [effect?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift index d1d060aa..00580574 100644 --- a/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AnimationWorkletGlobalScope: WorkletGlobalScope { - override public class var constructor: JSFunction { JSObject.global[Strings.AnimationWorkletGlobalScope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AnimationWorkletGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift b/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift index 642ec2e4..c185e771 100644 --- a/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift +++ b/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift @@ -7,16 +7,16 @@ public enum AppBannerPromptOutcome: JSString, JSValueCompatible { case accepted = "accepted" case dismissed = "dismissed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AppendMode.swift b/Sources/DOMKit/WebIDL/AppendMode.swift index 3180d133..200aa692 100644 --- a/Sources/DOMKit/WebIDL/AppendMode.swift +++ b/Sources/DOMKit/WebIDL/AppendMode.swift @@ -7,16 +7,16 @@ public enum AppendMode: JSString, JSValueCompatible { case segments = "segments" case sequence = "sequence" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift b/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift index c880bd89..de35fa70 100644 --- a/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift +++ b/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift @@ -9,16 +9,16 @@ public enum AttestationConveyancePreference: JSString, JSValueCompatible { case direct = "direct" case enterprise = "enterprise" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Attr.swift b/Sources/DOMKit/WebIDL/Attr.swift index 3bd34214..226dfbea 100644 --- a/Sources/DOMKit/WebIDL/Attr.swift +++ b/Sources/DOMKit/WebIDL/Attr.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Attr: Node { - override public class var constructor: JSFunction { JSObject.global[Strings.Attr].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Attr].function! } public required init(unsafelyWrapping jsObject: JSObject) { _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) diff --git a/Sources/DOMKit/WebIDL/AttributionReporting.swift b/Sources/DOMKit/WebIDL/AttributionReporting.swift index c92c8354..ff0d4199 100644 --- a/Sources/DOMKit/WebIDL/AttributionReporting.swift +++ b/Sources/DOMKit/WebIDL/AttributionReporting.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AttributionReporting: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AttributionReporting].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AttributionReporting].function! } public let jsObject: JSObject @@ -12,13 +12,13 @@ public class AttributionReporting: JSBridgedClass { self.jsObject = jsObject } - public func registerAttributionSource(params: AttributionSourceParams) -> JSPromise { + @inlinable public func registerAttributionSource(params: AttributionSourceParams) -> JSPromise { let this = jsObject return this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func registerAttributionSource(params: AttributionSourceParams) async throws { + @inlinable public func registerAttributionSource(params: AttributionSourceParams) async throws { let this = jsObject let _promise: JSPromise = this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue()]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/AudioBuffer.swift b/Sources/DOMKit/WebIDL/AudioBuffer.swift index 05051415..ba5bbaeb 100644 --- a/Sources/DOMKit/WebIDL/AudioBuffer.swift +++ b/Sources/DOMKit/WebIDL/AudioBuffer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioBuffer: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AudioBuffer].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioBuffer].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class AudioBuffer: JSBridgedClass { self.jsObject = jsObject } - public convenience init(options: AudioBufferOptions) { + @inlinable public convenience init(options: AudioBufferOptions) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue()])) } @@ -32,17 +32,17 @@ public class AudioBuffer: JSBridgedClass { @ReadonlyAttribute public var numberOfChannels: UInt32 - public func getChannelData(channel: UInt32) -> Float32Array { + @inlinable public func getChannelData(channel: UInt32) -> Float32Array { let this = jsObject return this[Strings.getChannelData].function!(this: this, arguments: [channel.jsValue()]).fromJSValue()! } - public func copyFromChannel(destination: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { + @inlinable public func copyFromChannel(destination: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { let this = jsObject _ = this[Strings.copyFromChannel].function!(this: this, arguments: [destination.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined]) } - public func copyToChannel(source: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { + @inlinable public func copyToChannel(source: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { let this = jsObject _ = this[Strings.copyToChannel].function!(this: this, arguments: [source.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift index 9898ad17..16cc702d 100644 --- a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift +++ b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioBufferSourceNode: AudioScheduledSourceNode { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioBufferSourceNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioBufferSourceNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _buffer = ReadWriteAttribute(jsObject: jsObject, name: Strings.buffer) @@ -16,7 +16,7 @@ public class AudioBufferSourceNode: AudioScheduledSourceNode { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: AudioBufferSourceOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: AudioBufferSourceOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @@ -38,7 +38,7 @@ public class AudioBufferSourceNode: AudioScheduledSourceNode { @ReadWriteAttribute public var loopEnd: Double - override public func start(when: Double? = nil, offset: Double? = nil, duration: Double? = nil) { + @inlinable override public func start(when: Double? = nil, offset: Double? = nil, duration: Double? = nil) { let this = jsObject _ = this[Strings.start].function!(this: this, arguments: [when?.jsValue() ?? .undefined, offset?.jsValue() ?? .undefined, duration?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/AudioContext.swift b/Sources/DOMKit/WebIDL/AudioContext.swift index ce10cfe9..74ea8db4 100644 --- a/Sources/DOMKit/WebIDL/AudioContext.swift +++ b/Sources/DOMKit/WebIDL/AudioContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioContext: BaseAudioContext { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioContext].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioContext].function! } public required init(unsafelyWrapping jsObject: JSObject) { _baseLatency = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseLatency) @@ -12,7 +12,7 @@ public class AudioContext: BaseAudioContext { super.init(unsafelyWrapping: jsObject) } - public convenience init(contextOptions: AudioContextOptions? = nil) { + @inlinable public convenience init(contextOptions: AudioContextOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions?.jsValue() ?? .undefined])) } @@ -22,63 +22,63 @@ public class AudioContext: BaseAudioContext { @ReadonlyAttribute public var outputLatency: Double - public func getOutputTimestamp() -> AudioTimestamp { + @inlinable public func getOutputTimestamp() -> AudioTimestamp { let this = jsObject return this[Strings.getOutputTimestamp].function!(this: this, arguments: []).fromJSValue()! } - public func resume() -> JSPromise { + @inlinable public func resume() -> JSPromise { let this = jsObject return this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func resume() async throws { + @inlinable public func resume() async throws { let this = jsObject let _promise: JSPromise = this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func suspend() -> JSPromise { + @inlinable public func suspend() -> JSPromise { let this = jsObject return this[Strings.suspend].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func suspend() async throws { + @inlinable public func suspend() async throws { let this = jsObject let _promise: JSPromise = this[Strings.suspend].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func close() -> JSPromise { + @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, *) - public func close() async throws { + @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func createMediaElementSource(mediaElement: HTMLMediaElement) -> MediaElementAudioSourceNode { + @inlinable public func createMediaElementSource(mediaElement: HTMLMediaElement) -> MediaElementAudioSourceNode { let this = jsObject return this[Strings.createMediaElementSource].function!(this: this, arguments: [mediaElement.jsValue()]).fromJSValue()! } - public func createMediaStreamSource(mediaStream: MediaStream) -> MediaStreamAudioSourceNode { + @inlinable public func createMediaStreamSource(mediaStream: MediaStream) -> MediaStreamAudioSourceNode { let this = jsObject return this[Strings.createMediaStreamSource].function!(this: this, arguments: [mediaStream.jsValue()]).fromJSValue()! } - public func createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack) -> MediaStreamTrackAudioSourceNode { + @inlinable public func createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack) -> MediaStreamTrackAudioSourceNode { let this = jsObject return this[Strings.createMediaStreamTrackSource].function!(this: this, arguments: [mediaStreamTrack.jsValue()]).fromJSValue()! } - public func createMediaStreamDestination() -> MediaStreamAudioDestinationNode { + @inlinable public func createMediaStreamDestination() -> MediaStreamAudioDestinationNode { let this = jsObject return this[Strings.createMediaStreamDestination].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift index f6dbfabb..8843228d 100644 --- a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift +++ b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift @@ -8,16 +8,16 @@ public enum AudioContextLatencyCategory: JSString, JSValueCompatible { case interactive = "interactive" case playback = "playback" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AudioContextState.swift b/Sources/DOMKit/WebIDL/AudioContextState.swift index 9c629c3e..987634db 100644 --- a/Sources/DOMKit/WebIDL/AudioContextState.swift +++ b/Sources/DOMKit/WebIDL/AudioContextState.swift @@ -8,16 +8,16 @@ public enum AudioContextState: JSString, JSValueCompatible { case running = "running" case closed = "closed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AudioData.swift b/Sources/DOMKit/WebIDL/AudioData.swift index d0d71e88..b0df4f1b 100644 --- a/Sources/DOMKit/WebIDL/AudioData.swift +++ b/Sources/DOMKit/WebIDL/AudioData.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioData: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AudioData].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioData].function! } public let jsObject: JSObject @@ -18,7 +18,7 @@ public class AudioData: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: AudioDataInit) { + @inlinable public convenience init(init: AudioDataInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @@ -40,22 +40,22 @@ public class AudioData: JSBridgedClass { @ReadonlyAttribute public var timestamp: Int64 - public func allocationSize(options: AudioDataCopyToOptions) -> UInt32 { + @inlinable public func allocationSize(options: AudioDataCopyToOptions) -> UInt32 { let this = jsObject return this[Strings.allocationSize].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } - public func copyTo(destination: BufferSource, options: AudioDataCopyToOptions) { + @inlinable public func copyTo(destination: BufferSource, options: AudioDataCopyToOptions) { let this = jsObject _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue(), options.jsValue()]) } - public func clone() -> Self { + @inlinable public func clone() -> Self { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/AudioDecoder.swift b/Sources/DOMKit/WebIDL/AudioDecoder.swift index fa698c5d..f23a752e 100644 --- a/Sources/DOMKit/WebIDL/AudioDecoder.swift +++ b/Sources/DOMKit/WebIDL/AudioDecoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioDecoder: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AudioDecoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioDecoder].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class AudioDecoder: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: AudioDecoderInit) { + @inlinable public convenience init(init: AudioDecoderInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @@ -24,45 +24,45 @@ public class AudioDecoder: JSBridgedClass { @ReadonlyAttribute public var decodeQueueSize: UInt32 - public func configure(config: AudioDecoderConfig) { + @inlinable public func configure(config: AudioDecoderConfig) { let this = jsObject _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) } - public func decode(chunk: EncodedAudioChunk) { + @inlinable public func decode(chunk: EncodedAudioChunk) { let this = jsObject _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue()]) } - public func flush() -> JSPromise { + @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, *) - public func flush() async throws { + @inlinable public func flush() async throws { let this = jsObject let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func reset() { + @inlinable public func reset() { let this = jsObject _ = this[Strings.reset].function!(this: this, arguments: []) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public static func isConfigSupported(config: AudioDecoderConfig) -> JSPromise { + @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, *) - public static func isConfigSupported(config: AudioDecoderConfig) async throws -> AudioDecoderSupport { + @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.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/AudioDestinationNode.swift b/Sources/DOMKit/WebIDL/AudioDestinationNode.swift index 4f57b8d3..ff528202 100644 --- a/Sources/DOMKit/WebIDL/AudioDestinationNode.swift +++ b/Sources/DOMKit/WebIDL/AudioDestinationNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioDestinationNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioDestinationNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioDestinationNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _maxChannelCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxChannelCount) diff --git a/Sources/DOMKit/WebIDL/AudioEncoder.swift b/Sources/DOMKit/WebIDL/AudioEncoder.swift index e26e3bc3..33d2f9d6 100644 --- a/Sources/DOMKit/WebIDL/AudioEncoder.swift +++ b/Sources/DOMKit/WebIDL/AudioEncoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioEncoder: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AudioEncoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioEncoder].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class AudioEncoder: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: AudioEncoderInit) { + @inlinable public convenience init(init: AudioEncoderInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @@ -24,45 +24,45 @@ public class AudioEncoder: JSBridgedClass { @ReadonlyAttribute public var encodeQueueSize: UInt32 - public func configure(config: AudioEncoderConfig) { + @inlinable public func configure(config: AudioEncoderConfig) { let this = jsObject _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) } - public func encode(data: AudioData) { + @inlinable public func encode(data: AudioData) { let this = jsObject _ = this[Strings.encode].function!(this: this, arguments: [data.jsValue()]) } - public func flush() -> JSPromise { + @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, *) - public func flush() async throws { + @inlinable public func flush() async throws { let this = jsObject let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func reset() { + @inlinable public func reset() { let this = jsObject _ = this[Strings.reset].function!(this: this, arguments: []) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public static func isConfigSupported(config: AudioEncoderConfig) -> JSPromise { + @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, *) - public static func isConfigSupported(config: AudioEncoderConfig) async throws -> AudioEncoderSupport { + @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.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/AudioListener.swift b/Sources/DOMKit/WebIDL/AudioListener.swift index 95c4b809..e5c55859 100644 --- a/Sources/DOMKit/WebIDL/AudioListener.swift +++ b/Sources/DOMKit/WebIDL/AudioListener.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioListener: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AudioListener].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioListener].function! } public let jsObject: JSObject @@ -48,12 +48,12 @@ public class AudioListener: JSBridgedClass { @ReadonlyAttribute public var upZ: AudioParam - public func setPosition(x: Float, y: Float, z: Float) { + @inlinable public func setPosition(x: Float, y: Float, z: Float) { let this = jsObject _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue(), y.jsValue(), z.jsValue()]) } - public func setOrientation(x: Float, y: Float, z: Float, xUp: Float, yUp: Float, zUp: Float) { + @inlinable public func setOrientation(x: Float, y: Float, z: Float, xUp: Float, yUp: Float, zUp: Float) { let _arg0 = x.jsValue() let _arg1 = y.jsValue() let _arg2 = z.jsValue() diff --git a/Sources/DOMKit/WebIDL/AudioNode.swift b/Sources/DOMKit/WebIDL/AudioNode.swift index 6e743553..b4df68cb 100644 --- a/Sources/DOMKit/WebIDL/AudioNode.swift +++ b/Sources/DOMKit/WebIDL/AudioNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioNode: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _context = ReadonlyAttribute(jsObject: jsObject, name: Strings.context) @@ -16,47 +16,47 @@ public class AudioNode: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self { + @inlinable public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self { let this = jsObject return this[Strings.connect].function!(this: this, arguments: [destinationNode.jsValue(), output?.jsValue() ?? .undefined, input?.jsValue() ?? .undefined]).fromJSValue()! } - public func connect(destinationParam: AudioParam, output: UInt32? = nil) { + @inlinable public func connect(destinationParam: AudioParam, output: UInt32? = nil) { let this = jsObject _ = this[Strings.connect].function!(this: this, arguments: [destinationParam.jsValue(), output?.jsValue() ?? .undefined]) } - public func disconnect() { + @inlinable public func disconnect() { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: []) } - public func disconnect(output: UInt32) { + @inlinable public func disconnect(output: UInt32) { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: [output.jsValue()]) } - public func disconnect(destinationNode: AudioNode) { + @inlinable public func disconnect(destinationNode: AudioNode) { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue()]) } - public func disconnect(destinationNode: AudioNode, output: UInt32) { + @inlinable public func disconnect(destinationNode: AudioNode, output: UInt32) { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue(), output.jsValue()]) } - public func disconnect(destinationNode: AudioNode, output: UInt32, input: UInt32) { + @inlinable public func disconnect(destinationNode: AudioNode, output: UInt32, input: UInt32) { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue(), output.jsValue(), input.jsValue()]) } - public func disconnect(destinationParam: AudioParam) { + @inlinable public func disconnect(destinationParam: AudioParam) { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue()]) } - public func disconnect(destinationParam: AudioParam, output: UInt32) { + @inlinable public func disconnect(destinationParam: AudioParam, output: UInt32) { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue(), output.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/AudioParam.swift b/Sources/DOMKit/WebIDL/AudioParam.swift index 683ef39f..39098ce6 100644 --- a/Sources/DOMKit/WebIDL/AudioParam.swift +++ b/Sources/DOMKit/WebIDL/AudioParam.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioParam: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AudioParam].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioParam].function! } public let jsObject: JSObject @@ -32,37 +32,37 @@ public class AudioParam: JSBridgedClass { @ReadonlyAttribute public var maxValue: Float - public func setValueAtTime(value: Float, startTime: Double) -> Self { + @inlinable public func setValueAtTime(value: Float, startTime: Double) -> Self { let this = jsObject return this[Strings.setValueAtTime].function!(this: this, arguments: [value.jsValue(), startTime.jsValue()]).fromJSValue()! } - public func linearRampToValueAtTime(value: Float, endTime: Double) -> Self { + @inlinable public func linearRampToValueAtTime(value: Float, endTime: Double) -> Self { let this = jsObject return this[Strings.linearRampToValueAtTime].function!(this: this, arguments: [value.jsValue(), endTime.jsValue()]).fromJSValue()! } - public func exponentialRampToValueAtTime(value: Float, endTime: Double) -> Self { + @inlinable public func exponentialRampToValueAtTime(value: Float, endTime: Double) -> Self { let this = jsObject return this[Strings.exponentialRampToValueAtTime].function!(this: this, arguments: [value.jsValue(), endTime.jsValue()]).fromJSValue()! } - public func setTargetAtTime(target: Float, startTime: Double, timeConstant: Float) -> Self { + @inlinable public func setTargetAtTime(target: Float, startTime: Double, timeConstant: Float) -> Self { let this = jsObject return this[Strings.setTargetAtTime].function!(this: this, arguments: [target.jsValue(), startTime.jsValue(), timeConstant.jsValue()]).fromJSValue()! } - public func setValueCurveAtTime(values: [Float], startTime: Double, duration: Double) -> Self { + @inlinable public func setValueCurveAtTime(values: [Float], startTime: Double, duration: Double) -> Self { let this = jsObject return this[Strings.setValueCurveAtTime].function!(this: this, arguments: [values.jsValue(), startTime.jsValue(), duration.jsValue()]).fromJSValue()! } - public func cancelScheduledValues(cancelTime: Double) -> Self { + @inlinable public func cancelScheduledValues(cancelTime: Double) -> Self { let this = jsObject return this[Strings.cancelScheduledValues].function!(this: this, arguments: [cancelTime.jsValue()]).fromJSValue()! } - public func cancelAndHoldAtTime(cancelTime: Double) -> Self { + @inlinable public func cancelAndHoldAtTime(cancelTime: Double) -> Self { let this = jsObject return this[Strings.cancelAndHoldAtTime].function!(this: this, arguments: [cancelTime.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/AudioParamMap.swift b/Sources/DOMKit/WebIDL/AudioParamMap.swift index baf0a627..c9779693 100644 --- a/Sources/DOMKit/WebIDL/AudioParamMap.swift +++ b/Sources/DOMKit/WebIDL/AudioParamMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioParamMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AudioParamMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioParamMap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift b/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift index c5e6fa58..c5232573 100644 --- a/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift +++ b/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioProcessingEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioProcessingEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioProcessingEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _playbackTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.playbackTime) @@ -13,7 +13,7 @@ public class AudioProcessingEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: AudioProcessingEventInit) { + @inlinable public convenience init(type: String, eventInitDict: AudioProcessingEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/AudioSampleFormat.swift b/Sources/DOMKit/WebIDL/AudioSampleFormat.swift index 7bfc68b5..00db0aef 100644 --- a/Sources/DOMKit/WebIDL/AudioSampleFormat.swift +++ b/Sources/DOMKit/WebIDL/AudioSampleFormat.swift @@ -13,16 +13,16 @@ public enum AudioSampleFormat: JSString, JSValueCompatible { case s32Planar = "s32-planar" case f32Planar = "f32-planar" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift index 395df971..7cb9c47c 100644 --- a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift +++ b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioScheduledSourceNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioScheduledSourceNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioScheduledSourceNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onended = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onended) @@ -14,12 +14,12 @@ public class AudioScheduledSourceNode: AudioNode { @ClosureAttribute1Optional public var onended: EventHandler - public func start(when: Double? = nil) { + @inlinable public func start(when: Double? = nil) { let this = jsObject _ = this[Strings.start].function!(this: this, arguments: [when?.jsValue() ?? .undefined]) } - public func stop(when: Double? = nil) { + @inlinable public func stop(when: Double? = nil) { let this = jsObject _ = this[Strings.stop].function!(this: this, arguments: [when?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/AudioTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack.swift index d08e9ad6..a04c4ffb 100644 --- a/Sources/DOMKit/WebIDL/AudioTrack.swift +++ b/Sources/DOMKit/WebIDL/AudioTrack.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioTrack: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AudioTrack].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioTrack].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift index 2aeeef1f..fb83e18f 100644 --- a/Sources/DOMKit/WebIDL/AudioTrackList.swift +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioTrackList: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioTrackList].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioTrackList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) @@ -17,11 +17,11 @@ public class AudioTrackList: EventTarget { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> AudioTrack { + @inlinable public subscript(key: Int) -> AudioTrack { jsObject[key].fromJSValue()! } - public func getTrackById(id: String) -> AudioTrack? { + @inlinable public func getTrackById(id: String) -> AudioTrack? { let this = jsObject return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/AudioWorklet.swift b/Sources/DOMKit/WebIDL/AudioWorklet.swift index ce1e5999..7dd1321f 100644 --- a/Sources/DOMKit/WebIDL/AudioWorklet.swift +++ b/Sources/DOMKit/WebIDL/AudioWorklet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioWorklet: Worklet { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorklet].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorklet].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift index 6acd31c9..746a8f5c 100644 --- a/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioWorkletGlobalScope: WorkletGlobalScope { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletGlobalScope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _currentFrame = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentFrame) diff --git a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift index 3cbdbfa1..2203bcdb 100644 --- a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift +++ b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioWorkletNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _parameters = ReadonlyAttribute(jsObject: jsObject, name: Strings.parameters) @@ -13,7 +13,7 @@ public class AudioWorkletNode: AudioNode { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, name: String, options: AudioWorkletNodeOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, name: String, options: AudioWorkletNodeOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), name.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift b/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift index 31b5ec61..f75e446b 100644 --- a/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift +++ b/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioWorkletProcessor: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletProcessor].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletProcessor].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class AudioWorkletProcessor: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift index 112d23db..8332dbf6 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AuthenticatorAssertionResponse: AuthenticatorResponse { - override public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorAssertionResponse].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorAssertionResponse].function! } public required init(unsafelyWrapping jsObject: JSObject) { _authenticatorData = ReadonlyAttribute(jsObject: jsObject, name: Strings.authenticatorData) diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift b/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift index 07958805..aa871ca7 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift @@ -7,16 +7,16 @@ public enum AuthenticatorAttachment: JSString, JSValueCompatible { case platform = "platform" case crossPlatform = "cross-platform" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift index 299c5ef0..46c95741 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AuthenticatorAttestationResponse: AuthenticatorResponse { - override public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorAttestationResponse].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorAttestationResponse].function! } public required init(unsafelyWrapping jsObject: JSObject) { _attestationObject = ReadonlyAttribute(jsObject: jsObject, name: Strings.attestationObject) @@ -14,22 +14,22 @@ public class AuthenticatorAttestationResponse: AuthenticatorResponse { @ReadonlyAttribute public var attestationObject: ArrayBuffer - public func getTransports() -> [String] { + @inlinable public func getTransports() -> [String] { let this = jsObject return this[Strings.getTransports].function!(this: this, arguments: []).fromJSValue()! } - public func getAuthenticatorData() -> ArrayBuffer { + @inlinable public func getAuthenticatorData() -> ArrayBuffer { let this = jsObject return this[Strings.getAuthenticatorData].function!(this: this, arguments: []).fromJSValue()! } - public func getPublicKey() -> ArrayBuffer? { + @inlinable public func getPublicKey() -> ArrayBuffer? { let this = jsObject return this[Strings.getPublicKey].function!(this: this, arguments: []).fromJSValue()! } - public func getPublicKeyAlgorithm() -> COSEAlgorithmIdentifier { + @inlinable public func getPublicKeyAlgorithm() -> COSEAlgorithmIdentifier { let this = jsObject return this[Strings.getPublicKeyAlgorithm].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift index 18d026a6..b227a467 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AuthenticatorResponse: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorResponse].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorResponse].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift b/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift index 94bb29d7..df45d09b 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift @@ -9,16 +9,16 @@ public enum AuthenticatorTransport: JSString, JSValueCompatible { case ble = "ble" case `internal` = "internal" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AutoKeyword.swift b/Sources/DOMKit/WebIDL/AutoKeyword.swift index 0f171a2e..c5eda64f 100644 --- a/Sources/DOMKit/WebIDL/AutoKeyword.swift +++ b/Sources/DOMKit/WebIDL/AutoKeyword.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum AutoKeyword: JSString, JSValueCompatible { case auto = "auto" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AutomationRate.swift b/Sources/DOMKit/WebIDL/AutomationRate.swift index 53f0f478..379f9a00 100644 --- a/Sources/DOMKit/WebIDL/AutomationRate.swift +++ b/Sources/DOMKit/WebIDL/AutomationRate.swift @@ -7,16 +7,16 @@ public enum AutomationRate: JSString, JSValueCompatible { case aRate = "a-rate" case kRate = "k-rate" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AutoplayPolicy.swift b/Sources/DOMKit/WebIDL/AutoplayPolicy.swift index b56a357c..b34ac34c 100644 --- a/Sources/DOMKit/WebIDL/AutoplayPolicy.swift +++ b/Sources/DOMKit/WebIDL/AutoplayPolicy.swift @@ -8,16 +8,16 @@ public enum AutoplayPolicy: JSString, JSValueCompatible { case allowedMuted = "allowed-muted" case disallowed = "disallowed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift b/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift index 0408a209..ab83b495 100644 --- a/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift +++ b/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift @@ -7,16 +7,16 @@ public enum AutoplayPolicyMediaType: JSString, JSValueCompatible { case mediaelement = "mediaelement" case audiocontext = "audiocontext" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift b/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift index 8d748b05..6667d5ab 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class BackgroundFetchEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _registration = ReadonlyAttribute(jsObject: jsObject, name: Strings.registration) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, init: BackgroundFetchEventInit) { + @inlinable public convenience init(type: String, init: BackgroundFetchEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift b/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift index 760a4604..696b0ddd 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift @@ -11,16 +11,16 @@ public enum BackgroundFetchFailureReason: JSString, JSValueCompatible { case quotaExceeded = "quota-exceeded" case downloadTotalExceeded = "download-total-exceeded" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift index 74096b9e..4af5cb8d 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BackgroundFetchManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchManager].function! } public let jsObject: JSObject @@ -12,37 +12,37 @@ public class BackgroundFetchManager: JSBridgedClass { self.jsObject = jsObject } - public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) -> JSPromise { + @inlinable public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.fetch].function!(this: this, arguments: [id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) async throws -> BackgroundFetchRegistration { + @inlinable public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) async throws -> BackgroundFetchRegistration { let this = jsObject let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func get(id: String) -> JSPromise { + @inlinable public func get(id: String) -> JSPromise { let this = jsObject return this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func get(id: String) async throws -> BackgroundFetchRegistration? { + @inlinable public func get(id: String) async throws -> BackgroundFetchRegistration? { let this = jsObject let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getIds() -> JSPromise { + @inlinable public func getIds() -> JSPromise { let this = jsObject return this[Strings.getIds].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getIds() async throws -> [String] { + @inlinable public func getIds() async throws -> [String] { let this = jsObject let _promise: JSPromise = this[Strings.getIds].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift b/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift index c2f2c58d..41f588b2 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BackgroundFetchRecord: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchRecord].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchRecord].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift index 73b28be1..39b2db1a 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BackgroundFetchRegistration: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchRegistration].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchRegistration].function! } public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) @@ -46,37 +46,37 @@ public class BackgroundFetchRegistration: EventTarget { @ClosureAttribute1Optional public var onprogress: EventHandler - public func abort() -> JSPromise { + @inlinable public func abort() -> JSPromise { let this = jsObject return this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func abort() async throws -> Bool { + @inlinable public func abort() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func match(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { + @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()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> BackgroundFetchRecord { + @inlinable public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> BackgroundFetchRecord { let this = jsObject let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { + @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()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [BackgroundFetchRecord] { + @inlinable public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [BackgroundFetchRecord] { let this = jsObject let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift b/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift index fa223105..c3375df6 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift @@ -8,16 +8,16 @@ public enum BackgroundFetchResult: JSString, JSValueCompatible { case success = "success" case failure = "failure" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift b/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift index 09873098..90f4239a 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift @@ -4,23 +4,23 @@ import JavaScriptEventLoop import JavaScriptKit public class BackgroundFetchUpdateUIEvent: BackgroundFetchEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchUpdateUIEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchUpdateUIEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, init: BackgroundFetchEventInit) { + @inlinable public convenience init(type: String, init: BackgroundFetchEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } - public func updateUI(options: BackgroundFetchUIOptions? = nil) -> JSPromise { + @inlinable public func updateUI(options: BackgroundFetchUIOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.updateUI].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func updateUI(options: BackgroundFetchUIOptions? = nil) async throws { + @inlinable public func updateUI(options: BackgroundFetchUIOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.updateUI].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/BarProp.swift b/Sources/DOMKit/WebIDL/BarProp.swift index 3089eba0..23a2f8ad 100644 --- a/Sources/DOMKit/WebIDL/BarProp.swift +++ b/Sources/DOMKit/WebIDL/BarProp.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BarProp: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BarProp].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BarProp].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/BarcodeDetector.swift b/Sources/DOMKit/WebIDL/BarcodeDetector.swift index a127bad2..a54072d2 100644 --- a/Sources/DOMKit/WebIDL/BarcodeDetector.swift +++ b/Sources/DOMKit/WebIDL/BarcodeDetector.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BarcodeDetector: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BarcodeDetector].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BarcodeDetector].function! } public let jsObject: JSObject @@ -12,29 +12,29 @@ public class BarcodeDetector: JSBridgedClass { self.jsObject = jsObject } - public convenience init(barcodeDetectorOptions: BarcodeDetectorOptions? = nil) { + @inlinable public convenience init(barcodeDetectorOptions: BarcodeDetectorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [barcodeDetectorOptions?.jsValue() ?? .undefined])) } - public static func getSupportedFormats() -> JSPromise { + @inlinable public static func getSupportedFormats() -> JSPromise { let this = constructor return this[Strings.getSupportedFormats].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func getSupportedFormats() async throws -> [BarcodeFormat] { + @inlinable public static func getSupportedFormats() async throws -> [BarcodeFormat] { let this = constructor let _promise: JSPromise = this[Strings.getSupportedFormats].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func detect(image: ImageBitmapSource) -> JSPromise { + @inlinable public func detect(image: ImageBitmapSource) -> JSPromise { let this = jsObject return this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func detect(image: ImageBitmapSource) async throws -> [DetectedBarcode] { + @inlinable public func detect(image: ImageBitmapSource) async throws -> [DetectedBarcode] { let this = jsObject let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BarcodeFormat.swift b/Sources/DOMKit/WebIDL/BarcodeFormat.swift index 26cfc1c5..2eada70f 100644 --- a/Sources/DOMKit/WebIDL/BarcodeFormat.swift +++ b/Sources/DOMKit/WebIDL/BarcodeFormat.swift @@ -19,16 +19,16 @@ public enum BarcodeFormat: JSString, JSValueCompatible { case upcA = "upc_a" case upcE = "upc_e" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/BaseAudioContext.swift b/Sources/DOMKit/WebIDL/BaseAudioContext.swift index f1144701..7c0feb1b 100644 --- a/Sources/DOMKit/WebIDL/BaseAudioContext.swift +++ b/Sources/DOMKit/WebIDL/BaseAudioContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BaseAudioContext: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.BaseAudioContext].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BaseAudioContext].function! } public required init(unsafelyWrapping jsObject: JSObject) { _destination = ReadonlyAttribute(jsObject: jsObject, name: Strings.destination) @@ -38,92 +38,92 @@ public class BaseAudioContext: EventTarget { @ClosureAttribute1Optional public var onstatechange: EventHandler - public func createAnalyser() -> AnalyserNode { + @inlinable public func createAnalyser() -> AnalyserNode { let this = jsObject return this[Strings.createAnalyser].function!(this: this, arguments: []).fromJSValue()! } - public func createBiquadFilter() -> BiquadFilterNode { + @inlinable public func createBiquadFilter() -> BiquadFilterNode { let this = jsObject return this[Strings.createBiquadFilter].function!(this: this, arguments: []).fromJSValue()! } - public func createBuffer(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) -> AudioBuffer { + @inlinable public func createBuffer(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) -> AudioBuffer { let this = jsObject return this[Strings.createBuffer].function!(this: this, arguments: [numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue()]).fromJSValue()! } - public func createBufferSource() -> AudioBufferSourceNode { + @inlinable public func createBufferSource() -> AudioBufferSourceNode { let this = jsObject return this[Strings.createBufferSource].function!(this: this, arguments: []).fromJSValue()! } - public func createChannelMerger(numberOfInputs: UInt32? = nil) -> ChannelMergerNode { + @inlinable public func createChannelMerger(numberOfInputs: UInt32? = nil) -> ChannelMergerNode { let this = jsObject return this[Strings.createChannelMerger].function!(this: this, arguments: [numberOfInputs?.jsValue() ?? .undefined]).fromJSValue()! } - public func createChannelSplitter(numberOfOutputs: UInt32? = nil) -> ChannelSplitterNode { + @inlinable public func createChannelSplitter(numberOfOutputs: UInt32? = nil) -> ChannelSplitterNode { let this = jsObject return this[Strings.createChannelSplitter].function!(this: this, arguments: [numberOfOutputs?.jsValue() ?? .undefined]).fromJSValue()! } - public func createConstantSource() -> ConstantSourceNode { + @inlinable public func createConstantSource() -> ConstantSourceNode { let this = jsObject return this[Strings.createConstantSource].function!(this: this, arguments: []).fromJSValue()! } - public func createConvolver() -> ConvolverNode { + @inlinable public func createConvolver() -> ConvolverNode { let this = jsObject return this[Strings.createConvolver].function!(this: this, arguments: []).fromJSValue()! } - public func createDelay(maxDelayTime: Double? = nil) -> DelayNode { + @inlinable public func createDelay(maxDelayTime: Double? = nil) -> DelayNode { let this = jsObject return this[Strings.createDelay].function!(this: this, arguments: [maxDelayTime?.jsValue() ?? .undefined]).fromJSValue()! } - public func createDynamicsCompressor() -> DynamicsCompressorNode { + @inlinable public func createDynamicsCompressor() -> DynamicsCompressorNode { let this = jsObject return this[Strings.createDynamicsCompressor].function!(this: this, arguments: []).fromJSValue()! } - public func createGain() -> GainNode { + @inlinable public func createGain() -> GainNode { let this = jsObject return this[Strings.createGain].function!(this: this, arguments: []).fromJSValue()! } - public func createIIRFilter(feedforward: [Double], feedback: [Double]) -> IIRFilterNode { + @inlinable public func createIIRFilter(feedforward: [Double], feedback: [Double]) -> IIRFilterNode { let this = jsObject return this[Strings.createIIRFilter].function!(this: this, arguments: [feedforward.jsValue(), feedback.jsValue()]).fromJSValue()! } - public func createOscillator() -> OscillatorNode { + @inlinable public func createOscillator() -> OscillatorNode { let this = jsObject return this[Strings.createOscillator].function!(this: this, arguments: []).fromJSValue()! } - public func createPanner() -> PannerNode { + @inlinable public func createPanner() -> PannerNode { let this = jsObject return this[Strings.createPanner].function!(this: this, arguments: []).fromJSValue()! } - public func createPeriodicWave(real: [Float], imag: [Float], constraints: PeriodicWaveConstraints? = nil) -> PeriodicWave { + @inlinable public func createPeriodicWave(real: [Float], imag: [Float], constraints: PeriodicWaveConstraints? = nil) -> PeriodicWave { let this = jsObject return this[Strings.createPeriodicWave].function!(this: this, arguments: [real.jsValue(), imag.jsValue(), constraints?.jsValue() ?? .undefined]).fromJSValue()! } - public func createScriptProcessor(bufferSize: UInt32? = nil, numberOfInputChannels: UInt32? = nil, numberOfOutputChannels: UInt32? = nil) -> ScriptProcessorNode { + @inlinable public func createScriptProcessor(bufferSize: UInt32? = nil, numberOfInputChannels: UInt32? = nil, numberOfOutputChannels: UInt32? = nil) -> ScriptProcessorNode { let this = jsObject return this[Strings.createScriptProcessor].function!(this: this, arguments: [bufferSize?.jsValue() ?? .undefined, numberOfInputChannels?.jsValue() ?? .undefined, numberOfOutputChannels?.jsValue() ?? .undefined]).fromJSValue()! } - public func createStereoPanner() -> StereoPannerNode { + @inlinable public func createStereoPanner() -> StereoPannerNode { let this = jsObject return this[Strings.createStereoPanner].function!(this: this, arguments: []).fromJSValue()! } - public func createWaveShaper() -> WaveShaperNode { + @inlinable public func createWaveShaper() -> WaveShaperNode { let this = jsObject return this[Strings.createWaveShaper].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Baseline.swift b/Sources/DOMKit/WebIDL/Baseline.swift index 90b0e54f..3996a9cc 100644 --- a/Sources/DOMKit/WebIDL/Baseline.swift +++ b/Sources/DOMKit/WebIDL/Baseline.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Baseline: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Baseline].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Baseline].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/BatteryManager.swift b/Sources/DOMKit/WebIDL/BatteryManager.swift index 3c34299e..aaa66ee3 100644 --- a/Sources/DOMKit/WebIDL/BatteryManager.swift +++ b/Sources/DOMKit/WebIDL/BatteryManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BatteryManager: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.BatteryManager].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BatteryManager].function! } public required init(unsafelyWrapping jsObject: JSObject) { _charging = ReadonlyAttribute(jsObject: jsObject, name: Strings.charging) diff --git a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift index e4dd160b..2da8c025 100644 --- a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift +++ b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift @@ -4,23 +4,23 @@ import JavaScriptEventLoop import JavaScriptKit public class BeforeInstallPromptEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.BeforeInstallPromptEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BeforeInstallPromptEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: EventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: EventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } - public func prompt() -> JSPromise { + @inlinable public func prompt() -> JSPromise { let this = jsObject return this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func prompt() async throws -> PromptResponseObject { + @inlinable public func prompt() async throws -> PromptResponseObject { let this = jsObject let _promise: JSPromise = this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift index 10326891..2a0e7506 100644 --- a/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift +++ b/Sources/DOMKit/WebIDL/BeforeUnloadEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BeforeUnloadEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.BeforeUnloadEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BeforeUnloadEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/BinaryType.swift b/Sources/DOMKit/WebIDL/BinaryType.swift index 40d2bd76..c54e4b25 100644 --- a/Sources/DOMKit/WebIDL/BinaryType.swift +++ b/Sources/DOMKit/WebIDL/BinaryType.swift @@ -7,16 +7,16 @@ public enum BinaryType: JSString, JSValueCompatible { case blob = "blob" case arraybuffer = "arraybuffer" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift index 06ae5319..ae6e05e2 100644 --- a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift +++ b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BiquadFilterNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.BiquadFilterNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BiquadFilterNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) @@ -15,7 +15,7 @@ public class BiquadFilterNode: AudioNode { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: BiquadFilterOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: BiquadFilterOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @@ -34,7 +34,7 @@ public class BiquadFilterNode: AudioNode { @ReadonlyAttribute public var gain: AudioParam - public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { + @inlinable public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { let this = jsObject _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/BiquadFilterType.swift b/Sources/DOMKit/WebIDL/BiquadFilterType.swift index b7912a14..1d1c987f 100644 --- a/Sources/DOMKit/WebIDL/BiquadFilterType.swift +++ b/Sources/DOMKit/WebIDL/BiquadFilterType.swift @@ -13,16 +13,16 @@ public enum BiquadFilterType: JSString, JSValueCompatible { case notch = "notch" case allpass = "allpass" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/BitrateMode.swift b/Sources/DOMKit/WebIDL/BitrateMode.swift index 4b5af8c4..96f2f96f 100644 --- a/Sources/DOMKit/WebIDL/BitrateMode.swift +++ b/Sources/DOMKit/WebIDL/BitrateMode.swift @@ -7,16 +7,16 @@ public enum BitrateMode: JSString, JSValueCompatible { case constant = "constant" case variable = "variable" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index 10dbfb41..1b87e4e3 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Blob: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Blob].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Blob].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class Blob: JSBridgedClass { self.jsObject = jsObject } - public convenience init(blobParts: [BlobPart]? = nil, options: BlobPropertyBag? = nil) { + @inlinable public convenience init(blobParts: [BlobPart]? = nil, options: BlobPropertyBag? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [blobParts?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) } @@ -24,35 +24,35 @@ public class Blob: JSBridgedClass { @ReadonlyAttribute public var type: String - public func slice(start: Int64? = nil, end: Int64? = nil, contentType: String? = nil) -> Self { + @inlinable public func slice(start: Int64? = nil, end: Int64? = nil, contentType: String? = nil) -> Self { let this = jsObject return this[Strings.slice].function!(this: this, arguments: [start?.jsValue() ?? .undefined, end?.jsValue() ?? .undefined, contentType?.jsValue() ?? .undefined]).fromJSValue()! } - public func stream() -> ReadableStream { + @inlinable public func stream() -> ReadableStream { let this = jsObject return this[Strings.stream].function!(this: this, arguments: []).fromJSValue()! } - public func text() -> JSPromise { + @inlinable public 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, *) - public func text() async throws -> String { + @inlinable public func text() async throws -> String { let this = jsObject let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func arrayBuffer() -> JSPromise { + @inlinable public func arrayBuffer() -> JSPromise { let this = jsObject return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func arrayBuffer() async throws -> ArrayBuffer { + @inlinable public func arrayBuffer() async throws -> ArrayBuffer { let this = jsObject let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BlobEvent.swift b/Sources/DOMKit/WebIDL/BlobEvent.swift index 22231ed7..ab84bddc 100644 --- a/Sources/DOMKit/WebIDL/BlobEvent.swift +++ b/Sources/DOMKit/WebIDL/BlobEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BlobEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.BlobEvent].function! } + @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) @@ -12,7 +12,7 @@ public class BlobEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: BlobEventInit) { + @inlinable public convenience init(type: String, eventInitDict: BlobEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/BlockFragmentationType.swift b/Sources/DOMKit/WebIDL/BlockFragmentationType.swift index 026dac3d..577f34db 100644 --- a/Sources/DOMKit/WebIDL/BlockFragmentationType.swift +++ b/Sources/DOMKit/WebIDL/BlockFragmentationType.swift @@ -9,16 +9,16 @@ public enum BlockFragmentationType: JSString, JSValueCompatible { case column = "column" case region = "region" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Bluetooth.swift b/Sources/DOMKit/WebIDL/Bluetooth.swift index cdb98021..49ac3400 100644 --- a/Sources/DOMKit/WebIDL/Bluetooth.swift +++ b/Sources/DOMKit/WebIDL/Bluetooth.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, CharacteristicEventHandlers, ServiceEventHandlers { - override public class var constructor: JSFunction { JSObject.global[Strings.Bluetooth].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Bluetooth].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onavailabilitychanged = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onavailabilitychanged) @@ -12,13 +12,13 @@ public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, Characteristi super.init(unsafelyWrapping: jsObject) } - public func getAvailability() -> JSPromise { + @inlinable public func getAvailability() -> JSPromise { let this = jsObject return this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getAvailability() async throws -> Bool { + @inlinable public func getAvailability() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -30,25 +30,25 @@ public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, Characteristi @ReadonlyAttribute public var referringDevice: BluetoothDevice? - public func getDevices() -> JSPromise { + @inlinable public func getDevices() -> JSPromise { let this = jsObject return this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDevices() async throws -> [BluetoothDevice] { + @inlinable public func getDevices() async throws -> [BluetoothDevice] { let this = jsObject let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func requestDevice(options: RequestDeviceOptions? = nil) -> JSPromise { + @inlinable public func requestDevice(options: RequestDeviceOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestDevice(options: RequestDeviceOptions? = nil) async throws -> BluetoothDevice { + @inlinable public func requestDevice(options: RequestDeviceOptions? = nil) async throws -> BluetoothDevice { let this = jsObject let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift index 1ca2bbe8..253add24 100644 --- a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift +++ b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothAdvertisingEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothAdvertisingEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothAdvertisingEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) @@ -18,7 +18,7 @@ public class BluetoothAdvertisingEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, init: BluetoothAdvertisingEventInit) { + @inlinable public convenience init(type: String, init: BluetoothAdvertisingEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift b/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift index 24a4b341..d566cb08 100644 --- a/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift +++ b/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothCharacteristicProperties: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BluetoothCharacteristicProperties].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothCharacteristicProperties].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/BluetoothDevice.swift b/Sources/DOMKit/WebIDL/BluetoothDevice.swift index 7e886778..227ee7fc 100644 --- a/Sources/DOMKit/WebIDL/BluetoothDevice.swift +++ b/Sources/DOMKit/WebIDL/BluetoothDevice.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothDevice: EventTarget, BluetoothDeviceEventHandlers, CharacteristicEventHandlers, ServiceEventHandlers { - override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothDevice].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothDevice].function! } public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) @@ -23,13 +23,13 @@ public class BluetoothDevice: EventTarget, BluetoothDeviceEventHandlers, Charact @ReadonlyAttribute public var gatt: BluetoothRemoteGATTServer? - public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) -> JSPromise { + @inlinable public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) async throws { + @inlinable public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift b/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift index a6b7bb89..47920640 100644 --- a/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift @@ -5,12 +5,12 @@ import JavaScriptKit public protocol BluetoothDeviceEventHandlers: JSBridgedClass {} public extension BluetoothDeviceEventHandlers { - var onadvertisementreceived: EventHandler { + @inlinable var onadvertisementreceived: EventHandler { get { ClosureAttribute1Optional[Strings.onadvertisementreceived, in: jsObject] } set { ClosureAttribute1Optional[Strings.onadvertisementreceived, in: jsObject] = newValue } } - var ongattserverdisconnected: EventHandler { + @inlinable var ongattserverdisconnected: EventHandler { get { ClosureAttribute1Optional[Strings.ongattserverdisconnected, in: jsObject] } set { ClosureAttribute1Optional[Strings.ongattserverdisconnected, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift index 8f75d821..8638913f 100644 --- a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift +++ b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothManufacturerDataMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BluetoothManufacturerDataMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothManufacturerDataMap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift b/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift index d217b3a4..d7433ff2 100644 --- a/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift +++ b/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothPermissionResult: PermissionStatus { - override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothPermissionResult].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothPermissionResult].function! } public required init(unsafelyWrapping jsObject: JSObject) { _devices = ReadWriteAttribute(jsObject: jsObject, name: Strings.devices) diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift index 3f93c269..c08322cb 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothRemoteGATTCharacteristic: EventTarget, CharacteristicEventHandlers { - override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTCharacteristic].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTCharacteristic].function! } public required init(unsafelyWrapping jsObject: JSObject) { _service = ReadonlyAttribute(jsObject: jsObject, name: Strings.service) @@ -26,97 +26,97 @@ public class BluetoothRemoteGATTCharacteristic: EventTarget, CharacteristicEvent @ReadonlyAttribute public var value: DataView? - public func getDescriptor(descriptor: BluetoothDescriptorUUID) -> JSPromise { + @inlinable public func getDescriptor(descriptor: BluetoothDescriptorUUID) -> JSPromise { let this = jsObject return this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDescriptor(descriptor: BluetoothDescriptorUUID) async throws -> BluetoothRemoteGATTDescriptor { + @inlinable public func getDescriptor(descriptor: BluetoothDescriptorUUID) async throws -> BluetoothRemoteGATTDescriptor { let this = jsObject let _promise: JSPromise = this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) -> JSPromise { + @inlinable public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) -> JSPromise { let this = jsObject return this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) async throws -> [BluetoothRemoteGATTDescriptor] { + @inlinable public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) async throws -> [BluetoothRemoteGATTDescriptor] { let this = jsObject let _promise: JSPromise = this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func readValue() -> JSPromise { + @inlinable public func readValue() -> JSPromise { let this = jsObject return this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func readValue() async throws -> DataView { + @inlinable public func readValue() async throws -> DataView { let this = jsObject let _promise: JSPromise = this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func writeValue(value: BufferSource) -> JSPromise { + @inlinable public func writeValue(value: BufferSource) -> JSPromise { let this = jsObject return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func writeValue(value: BufferSource) async throws { + @inlinable public func writeValue(value: BufferSource) async throws { let this = jsObject let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func writeValueWithResponse(value: BufferSource) -> JSPromise { + @inlinable public func writeValueWithResponse(value: BufferSource) -> JSPromise { let this = jsObject return this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func writeValueWithResponse(value: BufferSource) async throws { + @inlinable public func writeValueWithResponse(value: BufferSource) async throws { let this = jsObject let _promise: JSPromise = this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func writeValueWithoutResponse(value: BufferSource) -> JSPromise { + @inlinable public func writeValueWithoutResponse(value: BufferSource) -> JSPromise { let this = jsObject return this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func writeValueWithoutResponse(value: BufferSource) async throws { + @inlinable public func writeValueWithoutResponse(value: BufferSource) async throws { let this = jsObject let _promise: JSPromise = this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func startNotifications() -> JSPromise { + @inlinable public func startNotifications() -> JSPromise { let this = jsObject return this[Strings.startNotifications].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func startNotifications() async throws -> BluetoothRemoteGATTCharacteristic { + @inlinable public func startNotifications() async throws -> BluetoothRemoteGATTCharacteristic { let this = jsObject let _promise: JSPromise = this[Strings.startNotifications].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func stopNotifications() -> JSPromise { + @inlinable public func stopNotifications() -> JSPromise { let this = jsObject return this[Strings.stopNotifications].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func stopNotifications() async throws -> BluetoothRemoteGATTCharacteristic { + @inlinable public func stopNotifications() async throws -> BluetoothRemoteGATTCharacteristic { let this = jsObject let _promise: JSPromise = this[Strings.stopNotifications].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift index 7d909617..212582dc 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothRemoteGATTDescriptor: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTDescriptor].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTDescriptor].function! } public let jsObject: JSObject @@ -24,25 +24,25 @@ public class BluetoothRemoteGATTDescriptor: JSBridgedClass { @ReadonlyAttribute public var value: DataView? - public func readValue() -> JSPromise { + @inlinable public func readValue() -> JSPromise { let this = jsObject return this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func readValue() async throws -> DataView { + @inlinable public func readValue() async throws -> DataView { let this = jsObject let _promise: JSPromise = this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func writeValue(value: BufferSource) -> JSPromise { + @inlinable public func writeValue(value: BufferSource) -> JSPromise { let this = jsObject return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func writeValue(value: BufferSource) async throws { + @inlinable public func writeValue(value: BufferSource) async throws { let this = jsObject let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift index 29f497ed..3572b00a 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothRemoteGATTServer: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTServer].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTServer].function! } public let jsObject: JSObject @@ -20,42 +20,42 @@ public class BluetoothRemoteGATTServer: JSBridgedClass { @ReadonlyAttribute public var connected: Bool - public func connect() -> JSPromise { + @inlinable public func connect() -> JSPromise { let this = jsObject return this[Strings.connect].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func connect() async throws -> BluetoothRemoteGATTServer { + @inlinable public func connect() async throws -> BluetoothRemoteGATTServer { let this = jsObject let _promise: JSPromise = this[Strings.connect].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func disconnect() { + @inlinable public func disconnect() { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: []) } - public func getPrimaryService(service: BluetoothServiceUUID) -> JSPromise { + @inlinable public func getPrimaryService(service: BluetoothServiceUUID) -> JSPromise { let this = jsObject return this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getPrimaryService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { + @inlinable public func getPrimaryService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { let this = jsObject let _promise: JSPromise = this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getPrimaryServices(service: BluetoothServiceUUID? = nil) -> JSPromise { + @inlinable public func getPrimaryServices(service: BluetoothServiceUUID? = nil) -> JSPromise { let this = jsObject return this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getPrimaryServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { + @inlinable public func getPrimaryServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { let this = jsObject let _promise: JSPromise = this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift index 7d113865..dc7a74c0 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothRemoteGATTService: EventTarget, CharacteristicEventHandlers, ServiceEventHandlers { - override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTService].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTService].function! } public required init(unsafelyWrapping jsObject: JSObject) { _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) @@ -22,49 +22,49 @@ public class BluetoothRemoteGATTService: EventTarget, CharacteristicEventHandler @ReadonlyAttribute public var isPrimary: Bool - public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) -> JSPromise { + @inlinable public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) -> JSPromise { let this = jsObject return this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) async throws -> BluetoothRemoteGATTCharacteristic { + @inlinable public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) async throws -> BluetoothRemoteGATTCharacteristic { let this = jsObject let _promise: JSPromise = this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) -> JSPromise { + @inlinable public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) -> JSPromise { let this = jsObject return this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) async throws -> [BluetoothRemoteGATTCharacteristic] { + @inlinable public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) async throws -> [BluetoothRemoteGATTCharacteristic] { let this = jsObject let _promise: JSPromise = this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getIncludedService(service: BluetoothServiceUUID) -> JSPromise { + @inlinable public func getIncludedService(service: BluetoothServiceUUID) -> JSPromise { let this = jsObject return this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getIncludedService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { + @inlinable public func getIncludedService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { let this = jsObject let _promise: JSPromise = this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getIncludedServices(service: BluetoothServiceUUID? = nil) -> JSPromise { + @inlinable public func getIncludedServices(service: BluetoothServiceUUID? = nil) -> JSPromise { let this = jsObject return this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getIncludedServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { + @inlinable public func getIncludedServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { let this = jsObject let _promise: JSPromise = this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift b/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift index 25f44901..a72017a6 100644 --- a/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift +++ b/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothServiceDataMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BluetoothServiceDataMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothServiceDataMap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/BluetoothUUID.swift b/Sources/DOMKit/WebIDL/BluetoothUUID.swift index 815910e2..7a306c65 100644 --- a/Sources/DOMKit/WebIDL/BluetoothUUID.swift +++ b/Sources/DOMKit/WebIDL/BluetoothUUID.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothUUID: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BluetoothUUID].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothUUID].function! } public let jsObject: JSObject @@ -12,22 +12,22 @@ public class BluetoothUUID: JSBridgedClass { self.jsObject = jsObject } - public static func getService(name: __UNSUPPORTED_UNION__) -> UUID { + @inlinable public static func getService(name: __UNSUPPORTED_UNION__) -> UUID { let this = constructor return this[Strings.getService].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public static func getCharacteristic(name: __UNSUPPORTED_UNION__) -> UUID { + @inlinable public static func getCharacteristic(name: __UNSUPPORTED_UNION__) -> UUID { let this = constructor return this[Strings.getCharacteristic].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public static func getDescriptor(name: __UNSUPPORTED_UNION__) -> UUID { + @inlinable public static func getDescriptor(name: __UNSUPPORTED_UNION__) -> UUID { let this = constructor return this[Strings.getDescriptor].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public static func canonicalUUID(alias: UInt32) -> UUID { + @inlinable public static func canonicalUUID(alias: UInt32) -> UUID { let this = constructor return this[Strings.canonicalUUID].function!(this: this, arguments: [alias.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Body.swift b/Sources/DOMKit/WebIDL/Body.swift index 17c8593b..34d41949 100644 --- a/Sources/DOMKit/WebIDL/Body.swift +++ b/Sources/DOMKit/WebIDL/Body.swift @@ -5,65 +5,65 @@ import JavaScriptKit public protocol Body: JSBridgedClass {} public extension Body { - var body: ReadableStream? { ReadonlyAttribute[Strings.body, in: jsObject] } + @inlinable var body: ReadableStream? { ReadonlyAttribute[Strings.body, in: jsObject] } - var bodyUsed: Bool { ReadonlyAttribute[Strings.bodyUsed, in: jsObject] } + @inlinable var bodyUsed: Bool { ReadonlyAttribute[Strings.bodyUsed, in: jsObject] } - func arrayBuffer() -> JSPromise { + @inlinable func arrayBuffer() -> JSPromise { let this = jsObject return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func arrayBuffer() async throws -> ArrayBuffer { + @inlinable func arrayBuffer() async throws -> ArrayBuffer { let this = jsObject let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - func blob() -> JSPromise { + @inlinable func blob() -> JSPromise { let this = jsObject return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func blob() async throws -> Blob { + @inlinable func blob() async throws -> Blob { let this = jsObject let _promise: JSPromise = this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - func formData() -> JSPromise { + @inlinable func formData() -> JSPromise { let this = jsObject return this[Strings.formData].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func formData() async throws -> FormData { + @inlinable func formData() async throws -> FormData { let this = jsObject let _promise: JSPromise = this[Strings.formData].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - func json() -> JSPromise { + @inlinable func json() -> JSPromise { let this = jsObject return this[Strings.json].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func json() async throws -> JSValue { + @inlinable func json() async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.json].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - func text() -> JSPromise { + @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, *) - func text() async throws -> String { + @inlinable func text() async throws -> String { let this = jsObject let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BreakToken.swift b/Sources/DOMKit/WebIDL/BreakToken.swift index 2b672ce2..e53a05e6 100644 --- a/Sources/DOMKit/WebIDL/BreakToken.swift +++ b/Sources/DOMKit/WebIDL/BreakToken.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BreakToken: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.BreakToken].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BreakToken].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/BreakType.swift b/Sources/DOMKit/WebIDL/BreakType.swift index f31b54be..9a1cdebc 100644 --- a/Sources/DOMKit/WebIDL/BreakType.swift +++ b/Sources/DOMKit/WebIDL/BreakType.swift @@ -10,16 +10,16 @@ public enum BreakType: JSString, JSValueCompatible { case page = "page" case region = "region" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index e5c13f11..6cc3f433 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BroadcastChannel: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.BroadcastChannel].function! } + @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) @@ -13,19 +13,19 @@ public class BroadcastChannel: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(name: String) { + @inlinable public convenience init(name: String) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue()])) } @ReadonlyAttribute public var name: String - public func postMessage(message: JSValue) { + @inlinable public func postMessage(message: JSValue) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue()]) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift b/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift index 6a845539..54af6c54 100644 --- a/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift @@ -4,25 +4,25 @@ import JavaScriptEventLoop import JavaScriptKit public class BrowserCaptureMediaStreamTrack: MediaStreamTrack { - override public class var constructor: JSFunction { JSObject.global[Strings.BrowserCaptureMediaStreamTrack].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BrowserCaptureMediaStreamTrack].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public func cropTo(cropTarget: CropTarget?) -> JSPromise { + @inlinable public func cropTo(cropTarget: CropTarget?) -> JSPromise { let this = jsObject return this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func cropTo(cropTarget: CropTarget?) async throws { + @inlinable public func cropTo(cropTarget: CropTarget?) async throws { let this = jsObject let _promise: JSPromise = this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue()]).fromJSValue()! _ = try await _promise.get() } - override public func clone() -> Self { + @inlinable override public func clone() -> Self { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift index 5e149045..eff373f0 100644 --- a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ByteLengthQueuingStrategy: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ByteLengthQueuingStrategy].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ByteLengthQueuingStrategy].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class ByteLengthQueuingStrategy: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: QueuingStrategyInit) { + @inlinable public convenience init(init: QueuingStrategyInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CDATASection.swift b/Sources/DOMKit/WebIDL/CDATASection.swift index 619ad62b..99b6d27f 100644 --- a/Sources/DOMKit/WebIDL/CDATASection.swift +++ b/Sources/DOMKit/WebIDL/CDATASection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CDATASection: Text { - override public class var constructor: JSFunction { JSObject.global[Strings.CDATASection].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CDATASection].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift b/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift index f710bfbb..b0a33963 100644 --- a/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift +++ b/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSPViolationReportBody: ReportBody { - override public class var constructor: JSFunction { JSObject.global[Strings.CSPViolationReportBody].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSPViolationReportBody].function! } public required init(unsafelyWrapping jsObject: JSObject) { _documentURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURL) diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index 2d3cf756..7053ed14 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -4,394 +4,394 @@ import JavaScriptEventLoop import JavaScriptKit public enum CSS { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { JSObject.global[Strings.CSS].object! } - public static var animationWorklet: Worklet { ReadonlyAttribute[Strings.animationWorklet, in: jsObject] } + @inlinable public static var animationWorklet: Worklet { ReadonlyAttribute[Strings.animationWorklet, in: jsObject] } - public static func supports(property: String, value: String) -> Bool { + @inlinable public static func supports(property: String, value: String) -> Bool { let this = JSObject.global[Strings.CSS].object! return this[Strings.supports].function!(this: this, arguments: [property.jsValue(), value.jsValue()]).fromJSValue()! } - public static func supports(conditionText: String) -> Bool { + @inlinable public static func supports(conditionText: String) -> Bool { let this = JSObject.global[Strings.CSS].object! return this[Strings.supports].function!(this: this, arguments: [conditionText.jsValue()]).fromJSValue()! } - public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } + @inlinable public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } - public static var elementSources: JSValue { ReadonlyAttribute[Strings.elementSources, in: jsObject] } + @inlinable public static var elementSources: JSValue { ReadonlyAttribute[Strings.elementSources, in: jsObject] } - public static var layoutWorklet: Worklet { ReadonlyAttribute[Strings.layoutWorklet, in: jsObject] } + @inlinable public static var layoutWorklet: Worklet { ReadonlyAttribute[Strings.layoutWorklet, in: jsObject] } - public static var paintWorklet: Worklet { ReadonlyAttribute[Strings.paintWorklet, in: jsObject] } + @inlinable public static var paintWorklet: Worklet { ReadonlyAttribute[Strings.paintWorklet, in: jsObject] } - public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { + @inlinable public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { let this = JSObject.global[Strings.CSS].object! return this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { + @inlinable public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { let this = JSObject.global[Strings.CSS].object! let _promise: JSPromise = this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { + @inlinable public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { let this = JSObject.global[Strings.CSS].object! return this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { + @inlinable public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { let this = JSObject.global[Strings.CSS].object! let _promise: JSPromise = this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { + @inlinable public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { let this = JSObject.global[Strings.CSS].object! return this[Strings.parseRule].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> CSSParserRule { + @inlinable public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> CSSParserRule { let this = JSObject.global[Strings.CSS].object! let _promise: JSPromise = this[Strings.parseRule].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { + @inlinable public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { let this = JSObject.global[Strings.CSS].object! return this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { + @inlinable public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { let this = JSObject.global[Strings.CSS].object! let _promise: JSPromise = this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public static func parseDeclaration(css: String, options: CSSParserOptions? = nil) -> CSSParserDeclaration { + @inlinable public static func parseDeclaration(css: String, options: CSSParserOptions? = nil) -> CSSParserDeclaration { let this = JSObject.global[Strings.CSS].object! return this[Strings.parseDeclaration].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public static func parseValue(css: String) -> CSSToken { + @inlinable public static func parseValue(css: String) -> CSSToken { let this = JSObject.global[Strings.CSS].object! return this[Strings.parseValue].function!(this: this, arguments: [css.jsValue()]).fromJSValue()! } - public static func parseValueList(css: String) -> [CSSToken] { + @inlinable public static func parseValueList(css: String) -> [CSSToken] { let this = JSObject.global[Strings.CSS].object! return this[Strings.parseValueList].function!(this: this, arguments: [css.jsValue()]).fromJSValue()! } - public static func parseCommaValueList(css: String) -> [[CSSToken]] { + @inlinable public static func parseCommaValueList(css: String) -> [[CSSToken]] { let this = JSObject.global[Strings.CSS].object! return this[Strings.parseCommaValueList].function!(this: this, arguments: [css.jsValue()]).fromJSValue()! } - public static func registerProperty(definition: PropertyDefinition) { + @inlinable public static func registerProperty(definition: PropertyDefinition) { let this = JSObject.global[Strings.CSS].object! _ = this[Strings.registerProperty].function!(this: this, arguments: [definition.jsValue()]) } - public static func number(value: Double) -> CSSUnitValue { + @inlinable public static func number(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.number].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func percent(value: Double) -> CSSUnitValue { + @inlinable public static func percent(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.percent].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func em(value: Double) -> CSSUnitValue { + @inlinable public static func em(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.em].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func ex(value: Double) -> CSSUnitValue { + @inlinable public static func ex(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.ex].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func ch(value: Double) -> CSSUnitValue { + @inlinable public static func ch(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.ch].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func ic(value: Double) -> CSSUnitValue { + @inlinable public static func ic(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.ic].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func rem(value: Double) -> CSSUnitValue { + @inlinable public static func rem(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.rem].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func lh(value: Double) -> CSSUnitValue { + @inlinable public static func lh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.lh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func rlh(value: Double) -> CSSUnitValue { + @inlinable public static func rlh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.rlh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func vw(value: Double) -> CSSUnitValue { + @inlinable public static func vw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.vw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func vh(value: Double) -> CSSUnitValue { + @inlinable public static func vh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.vh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func vi(value: Double) -> CSSUnitValue { + @inlinable public static func vi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.vi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func vb(value: Double) -> CSSUnitValue { + @inlinable public static func vb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.vb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func vmin(value: Double) -> CSSUnitValue { + @inlinable public static func vmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.vmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func vmax(value: Double) -> CSSUnitValue { + @inlinable public static func vmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.vmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func svw(value: Double) -> CSSUnitValue { + @inlinable public static func svw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.svw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func svh(value: Double) -> CSSUnitValue { + @inlinable public static func svh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.svh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func svi(value: Double) -> CSSUnitValue { + @inlinable public static func svi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.svi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func svb(value: Double) -> CSSUnitValue { + @inlinable public static func svb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.svb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func svmin(value: Double) -> CSSUnitValue { + @inlinable public static func svmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.svmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func svmax(value: Double) -> CSSUnitValue { + @inlinable public static func svmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.svmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func lvw(value: Double) -> CSSUnitValue { + @inlinable public static func lvw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.lvw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func lvh(value: Double) -> CSSUnitValue { + @inlinable public static func lvh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.lvh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func lvi(value: Double) -> CSSUnitValue { + @inlinable public static func lvi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.lvi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func lvb(value: Double) -> CSSUnitValue { + @inlinable public static func lvb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.lvb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func lvmin(value: Double) -> CSSUnitValue { + @inlinable public static func lvmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.lvmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func lvmax(value: Double) -> CSSUnitValue { + @inlinable public static func lvmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.lvmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func dvw(value: Double) -> CSSUnitValue { + @inlinable public static func dvw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.dvw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func dvh(value: Double) -> CSSUnitValue { + @inlinable public static func dvh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.dvh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func dvi(value: Double) -> CSSUnitValue { + @inlinable public static func dvi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.dvi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func dvb(value: Double) -> CSSUnitValue { + @inlinable public static func dvb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.dvb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func dvmin(value: Double) -> CSSUnitValue { + @inlinable public static func dvmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.dvmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func dvmax(value: Double) -> CSSUnitValue { + @inlinable public static func dvmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.dvmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func cqw(value: Double) -> CSSUnitValue { + @inlinable public static func cqw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.cqw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func cqh(value: Double) -> CSSUnitValue { + @inlinable public static func cqh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.cqh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func cqi(value: Double) -> CSSUnitValue { + @inlinable public static func cqi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.cqi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func cqb(value: Double) -> CSSUnitValue { + @inlinable public static func cqb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.cqb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func cqmin(value: Double) -> CSSUnitValue { + @inlinable public static func cqmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.cqmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func cqmax(value: Double) -> CSSUnitValue { + @inlinable public static func cqmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.cqmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func cm(value: Double) -> CSSUnitValue { + @inlinable public static func cm(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.cm].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func mm(value: Double) -> CSSUnitValue { + @inlinable public static func mm(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.mm].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func Q(value: Double) -> CSSUnitValue { + @inlinable public static func Q(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.Q].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func `in`(value: Double) -> CSSUnitValue { + @inlinable public static func `in`(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.in].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func pt(value: Double) -> CSSUnitValue { + @inlinable public static func pt(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.pt].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func pc(value: Double) -> CSSUnitValue { + @inlinable public static func pc(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.pc].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func px(value: Double) -> CSSUnitValue { + @inlinable public static func px(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.px].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func deg(value: Double) -> CSSUnitValue { + @inlinable public static func deg(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.deg].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func grad(value: Double) -> CSSUnitValue { + @inlinable public static func grad(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.grad].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func rad(value: Double) -> CSSUnitValue { + @inlinable public static func rad(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.rad].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func turn(value: Double) -> CSSUnitValue { + @inlinable public static func turn(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.turn].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func s(value: Double) -> CSSUnitValue { + @inlinable public static func s(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.s].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func ms(value: Double) -> CSSUnitValue { + @inlinable public static func ms(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.ms].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func Hz(value: Double) -> CSSUnitValue { + @inlinable public static func Hz(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.Hz].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func kHz(value: Double) -> CSSUnitValue { + @inlinable public static func kHz(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.kHz].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func dpi(value: Double) -> CSSUnitValue { + @inlinable public static func dpi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.dpi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func dpcm(value: Double) -> CSSUnitValue { + @inlinable public static func dpcm(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.dpcm].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func dppx(value: Double) -> CSSUnitValue { + @inlinable public static func dppx(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.dppx].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func fr(value: Double) -> CSSUnitValue { + @inlinable public static func fr(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! return this[Strings.fr].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func escape(ident: String) -> String { + @inlinable public static func escape(ident: String) -> String { let this = JSObject.global[Strings.CSS].object! return this[Strings.escape].function!(this: this, arguments: [ident.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSAnimation.swift b/Sources/DOMKit/WebIDL/CSSAnimation.swift index 3fab1761..a355f7a2 100644 --- a/Sources/DOMKit/WebIDL/CSSAnimation.swift +++ b/Sources/DOMKit/WebIDL/CSSAnimation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSAnimation: Animation { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSAnimation].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSAnimation].function! } public required init(unsafelyWrapping jsObject: JSObject) { _animationName = ReadonlyAttribute(jsObject: jsObject, name: Strings.animationName) diff --git a/Sources/DOMKit/WebIDL/CSSBoxType.swift b/Sources/DOMKit/WebIDL/CSSBoxType.swift index bbb32fe0..fc284b44 100644 --- a/Sources/DOMKit/WebIDL/CSSBoxType.swift +++ b/Sources/DOMKit/WebIDL/CSSBoxType.swift @@ -9,16 +9,16 @@ public enum CSSBoxType: JSString, JSValueCompatible { case padding = "padding" case content = "content" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CSSColor.swift b/Sources/DOMKit/WebIDL/CSSColor.swift index c60ac7b4..09ada61a 100644 --- a/Sources/DOMKit/WebIDL/CSSColor.swift +++ b/Sources/DOMKit/WebIDL/CSSColor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSColor: CSSColorValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSColor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSColor].function! } public required init(unsafelyWrapping jsObject: JSObject) { _channels = ReadWriteAttribute(jsObject: jsObject, name: Strings.channels) @@ -12,7 +12,7 @@ public class CSSColor: CSSColorValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(colorSpace: CSSKeywordish, channels: [CSSColorPercent], alpha: CSSNumberish? = nil) { + @inlinable public convenience init(colorSpace: CSSKeywordish, channels: [CSSColorPercent], alpha: CSSNumberish? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [colorSpace.jsValue(), channels.jsValue(), alpha?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSColorValue.swift b/Sources/DOMKit/WebIDL/CSSColorValue.swift index be07b910..2c63ecee 100644 --- a/Sources/DOMKit/WebIDL/CSSColorValue.swift +++ b/Sources/DOMKit/WebIDL/CSSColorValue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSColorValue: CSSStyleValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSColorValue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSColorValue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorSpace) @@ -14,7 +14,7 @@ public class CSSColorValue: CSSStyleValue { @ReadonlyAttribute public var colorSpace: CSSKeywordValue - public func to(colorSpace: CSSKeywordish) -> Self { + @inlinable public func to(colorSpace: CSSKeywordish) -> Self { let this = jsObject return this[Strings.to].function!(this: this, arguments: [colorSpace.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSConditionRule.swift b/Sources/DOMKit/WebIDL/CSSConditionRule.swift index d447606e..fff74130 100644 --- a/Sources/DOMKit/WebIDL/CSSConditionRule.swift +++ b/Sources/DOMKit/WebIDL/CSSConditionRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSConditionRule: CSSGroupingRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSConditionRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSConditionRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _conditionText = ReadWriteAttribute(jsObject: jsObject, name: Strings.conditionText) diff --git a/Sources/DOMKit/WebIDL/CSSContainerRule.swift b/Sources/DOMKit/WebIDL/CSSContainerRule.swift index 54be31f1..b5e9f661 100644 --- a/Sources/DOMKit/WebIDL/CSSContainerRule.swift +++ b/Sources/DOMKit/WebIDL/CSSContainerRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSContainerRule: CSSConditionRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSContainerRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSContainerRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift b/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift index 6b0d644a..8acb2627 100644 --- a/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSCounterStyleRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSCounterStyleRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSCounterStyleRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift b/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift index 76272661..46432814 100644 --- a/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift +++ b/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSFontFaceRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFaceRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFaceRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) diff --git a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift index 08dd833b..b476a082 100644 --- a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift +++ b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSFontFeatureValuesMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFeatureValuesMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFeatureValuesMap].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class CSSFontFeatureValuesMap: JSBridgedClass { // XXX: make me Map-like! - public func set(featureValueName: String, values: __UNSUPPORTED_UNION__) { + @inlinable public func set(featureValueName: String, values: __UNSUPPORTED_UNION__) { let this = jsObject _ = this[Strings.set].function!(this: this, arguments: [featureValueName.jsValue(), values.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift index 21e7f83d..bd06fede 100644 --- a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift +++ b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSFontFeatureValuesRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFeatureValuesRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFeatureValuesRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _fontFamily = ReadWriteAttribute(jsObject: jsObject, name: Strings.fontFamily) diff --git a/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift b/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift index 7c57366a..72904770 100644 --- a/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift +++ b/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSFontPaletteValuesRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontPaletteValuesRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontPaletteValuesRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift index 2f3d4c1a..b852fb67 100644 --- a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSGroupingRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSGroupingRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSGroupingRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) @@ -14,12 +14,12 @@ public class CSSGroupingRule: CSSRule { @ReadonlyAttribute public var cssRules: CSSRuleList - public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { + @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { let this = jsObject return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteRule(index: UInt32) { + @inlinable public func deleteRule(index: UInt32) { let this = jsObject _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/CSSHSL.swift b/Sources/DOMKit/WebIDL/CSSHSL.swift index 56a66722..24da7747 100644 --- a/Sources/DOMKit/WebIDL/CSSHSL.swift +++ b/Sources/DOMKit/WebIDL/CSSHSL.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSHSL: CSSColorValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSHSL].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSHSL].function! } public required init(unsafelyWrapping jsObject: JSObject) { _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) @@ -14,7 +14,7 @@ public class CSSHSL: CSSColorValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(h: CSSColorAngle, s: CSSColorPercent, l: CSSColorPercent, alpha: CSSColorPercent? = nil) { + @inlinable public convenience init(h: CSSColorAngle, s: CSSColorPercent, l: CSSColorPercent, alpha: CSSColorPercent? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue(), s.jsValue(), l.jsValue(), alpha?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSHWB.swift b/Sources/DOMKit/WebIDL/CSSHWB.swift index e4f94571..8d7da682 100644 --- a/Sources/DOMKit/WebIDL/CSSHWB.swift +++ b/Sources/DOMKit/WebIDL/CSSHWB.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSHWB: CSSColorValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSHWB].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSHWB].function! } public required init(unsafelyWrapping jsObject: JSObject) { _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) @@ -14,7 +14,7 @@ public class CSSHWB: CSSColorValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(h: CSSNumericValue, w: CSSNumberish, b: CSSNumberish, alpha: CSSNumberish? = nil) { + @inlinable public convenience init(h: CSSNumericValue, w: CSSNumberish, b: CSSNumberish, alpha: CSSNumberish? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue(), w.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSImageValue.swift b/Sources/DOMKit/WebIDL/CSSImageValue.swift index f1f1a293..a7e7ad55 100644 --- a/Sources/DOMKit/WebIDL/CSSImageValue.swift +++ b/Sources/DOMKit/WebIDL/CSSImageValue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSImageValue: CSSStyleValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSImageValue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSImageValue].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/CSSImportRule.swift b/Sources/DOMKit/WebIDL/CSSImportRule.swift index 30ac95ca..e9bbc83f 100644 --- a/Sources/DOMKit/WebIDL/CSSImportRule.swift +++ b/Sources/DOMKit/WebIDL/CSSImportRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSImportRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSImportRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSImportRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _layerName = ReadonlyAttribute(jsObject: jsObject, name: Strings.layerName) diff --git a/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift b/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift index bad39e4f..8daab413 100644 --- a/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift +++ b/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSKeyframeRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeyframeRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeyframeRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _keyText = ReadWriteAttribute(jsObject: jsObject, name: Strings.keyText) diff --git a/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift b/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift index 10259c89..e568e972 100644 --- a/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift +++ b/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSKeyframesRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeyframesRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeyframesRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) @@ -18,17 +18,17 @@ public class CSSKeyframesRule: CSSRule { @ReadonlyAttribute public var cssRules: CSSRuleList - public func appendRule(rule: String) { + @inlinable public func appendRule(rule: String) { let this = jsObject _ = this[Strings.appendRule].function!(this: this, arguments: [rule.jsValue()]) } - public func deleteRule(select: String) { + @inlinable public func deleteRule(select: String) { let this = jsObject _ = this[Strings.deleteRule].function!(this: this, arguments: [select.jsValue()]) } - public func findRule(select: String) -> CSSKeyframeRule? { + @inlinable public func findRule(select: String) -> CSSKeyframeRule? { let this = jsObject return this[Strings.findRule].function!(this: this, arguments: [select.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSKeywordValue.swift b/Sources/DOMKit/WebIDL/CSSKeywordValue.swift index 4a42654c..3f667a37 100644 --- a/Sources/DOMKit/WebIDL/CSSKeywordValue.swift +++ b/Sources/DOMKit/WebIDL/CSSKeywordValue.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSKeywordValue: CSSStyleValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeywordValue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeywordValue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) super.init(unsafelyWrapping: jsObject) } - public convenience init(value: String) { + @inlinable public convenience init(value: String) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSLCH.swift b/Sources/DOMKit/WebIDL/CSSLCH.swift index a522b741..830e0b59 100644 --- a/Sources/DOMKit/WebIDL/CSSLCH.swift +++ b/Sources/DOMKit/WebIDL/CSSLCH.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSLCH: CSSColorValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSLCH].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSLCH].function! } public required init(unsafelyWrapping jsObject: JSObject) { _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) @@ -14,7 +14,7 @@ public class CSSLCH: CSSColorValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { + @inlinable public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSLab.swift b/Sources/DOMKit/WebIDL/CSSLab.swift index e3c8df89..2599486e 100644 --- a/Sources/DOMKit/WebIDL/CSSLab.swift +++ b/Sources/DOMKit/WebIDL/CSSLab.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSLab: CSSColorValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSLab].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSLab].function! } public required init(unsafelyWrapping jsObject: JSObject) { _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) @@ -14,7 +14,7 @@ public class CSSLab: CSSColorValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { + @inlinable public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift b/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift index 15a7ab17..18874c84 100644 --- a/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift +++ b/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSLayerBlockRule: CSSGroupingRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSLayerBlockRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSLayerBlockRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift b/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift index c6a75cff..18d05b95 100644 --- a/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift +++ b/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSLayerStatementRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSLayerStatementRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSLayerStatementRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _nameList = ReadonlyAttribute(jsObject: jsObject, name: Strings.nameList) diff --git a/Sources/DOMKit/WebIDL/CSSMarginRule.swift b/Sources/DOMKit/WebIDL/CSSMarginRule.swift index 8be75104..d36e5ec7 100644 --- a/Sources/DOMKit/WebIDL/CSSMarginRule.swift +++ b/Sources/DOMKit/WebIDL/CSSMarginRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMarginRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMarginRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMarginRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/CSSMathClamp.swift b/Sources/DOMKit/WebIDL/CSSMathClamp.swift index f0da81f4..a12a31cd 100644 --- a/Sources/DOMKit/WebIDL/CSSMathClamp.swift +++ b/Sources/DOMKit/WebIDL/CSSMathClamp.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMathClamp: CSSMathValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathClamp].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathClamp].function! } public required init(unsafelyWrapping jsObject: JSObject) { _lower = ReadonlyAttribute(jsObject: jsObject, name: Strings.lower) @@ -13,7 +13,7 @@ public class CSSMathClamp: CSSMathValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(lower: CSSNumberish, value: CSSNumberish, upper: CSSNumberish) { + @inlinable public convenience init(lower: CSSNumberish, value: CSSNumberish, upper: CSSNumberish) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [lower.jsValue(), value.jsValue(), upper.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSMathInvert.swift b/Sources/DOMKit/WebIDL/CSSMathInvert.swift index 9a94184b..ca4e06f4 100644 --- a/Sources/DOMKit/WebIDL/CSSMathInvert.swift +++ b/Sources/DOMKit/WebIDL/CSSMathInvert.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMathInvert: CSSMathValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathInvert].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathInvert].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) super.init(unsafelyWrapping: jsObject) } - public convenience init(arg: CSSNumberish) { + @inlinable public convenience init(arg: CSSNumberish) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSMathMax.swift b/Sources/DOMKit/WebIDL/CSSMathMax.swift index ba651c70..0698147b 100644 --- a/Sources/DOMKit/WebIDL/CSSMathMax.swift +++ b/Sources/DOMKit/WebIDL/CSSMathMax.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMathMax: CSSMathValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathMax].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathMax].function! } public required init(unsafelyWrapping jsObject: JSObject) { _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) super.init(unsafelyWrapping: jsObject) } - public convenience init(args: CSSNumberish...) { + @inlinable public convenience init(args: CSSNumberish...) { self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) } diff --git a/Sources/DOMKit/WebIDL/CSSMathMin.swift b/Sources/DOMKit/WebIDL/CSSMathMin.swift index bb48e94f..afd4d10f 100644 --- a/Sources/DOMKit/WebIDL/CSSMathMin.swift +++ b/Sources/DOMKit/WebIDL/CSSMathMin.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMathMin: CSSMathValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathMin].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathMin].function! } public required init(unsafelyWrapping jsObject: JSObject) { _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) super.init(unsafelyWrapping: jsObject) } - public convenience init(args: CSSNumberish...) { + @inlinable public convenience init(args: CSSNumberish...) { self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) } diff --git a/Sources/DOMKit/WebIDL/CSSMathNegate.swift b/Sources/DOMKit/WebIDL/CSSMathNegate.swift index 74608062..0bf9b49a 100644 --- a/Sources/DOMKit/WebIDL/CSSMathNegate.swift +++ b/Sources/DOMKit/WebIDL/CSSMathNegate.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMathNegate: CSSMathValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathNegate].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathNegate].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) super.init(unsafelyWrapping: jsObject) } - public convenience init(arg: CSSNumberish) { + @inlinable public convenience init(arg: CSSNumberish) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSMathOperator.swift b/Sources/DOMKit/WebIDL/CSSMathOperator.swift index 10d6e51d..461280d6 100644 --- a/Sources/DOMKit/WebIDL/CSSMathOperator.swift +++ b/Sources/DOMKit/WebIDL/CSSMathOperator.swift @@ -12,16 +12,16 @@ public enum CSSMathOperator: JSString, JSValueCompatible { case max = "max" case clamp = "clamp" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CSSMathProduct.swift b/Sources/DOMKit/WebIDL/CSSMathProduct.swift index 0b05bbb7..72fc5257 100644 --- a/Sources/DOMKit/WebIDL/CSSMathProduct.swift +++ b/Sources/DOMKit/WebIDL/CSSMathProduct.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMathProduct: CSSMathValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathProduct].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathProduct].function! } public required init(unsafelyWrapping jsObject: JSObject) { _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) super.init(unsafelyWrapping: jsObject) } - public convenience init(args: CSSNumberish...) { + @inlinable public convenience init(args: CSSNumberish...) { self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) } diff --git a/Sources/DOMKit/WebIDL/CSSMathSum.swift b/Sources/DOMKit/WebIDL/CSSMathSum.swift index 2f58862e..0d41a262 100644 --- a/Sources/DOMKit/WebIDL/CSSMathSum.swift +++ b/Sources/DOMKit/WebIDL/CSSMathSum.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMathSum: CSSMathValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathSum].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathSum].function! } public required init(unsafelyWrapping jsObject: JSObject) { _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) super.init(unsafelyWrapping: jsObject) } - public convenience init(args: CSSNumberish...) { + @inlinable public convenience init(args: CSSNumberish...) { self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) } diff --git a/Sources/DOMKit/WebIDL/CSSMathValue.swift b/Sources/DOMKit/WebIDL/CSSMathValue.swift index 499ecc51..c4ebac83 100644 --- a/Sources/DOMKit/WebIDL/CSSMathValue.swift +++ b/Sources/DOMKit/WebIDL/CSSMathValue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMathValue: CSSNumericValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathValue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathValue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _operator = ReadonlyAttribute(jsObject: jsObject, name: Strings.operator) diff --git a/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift b/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift index 55d3e27d..1fdc89ef 100644 --- a/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift +++ b/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMatrixComponent: CSSTransformComponent { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMatrixComponent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMatrixComponent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _matrix = ReadWriteAttribute(jsObject: jsObject, name: Strings.matrix) super.init(unsafelyWrapping: jsObject) } - public convenience init(matrix: DOMMatrixReadOnly, options: CSSMatrixComponentOptions? = nil) { + @inlinable public convenience init(matrix: DOMMatrixReadOnly, options: CSSMatrixComponentOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [matrix.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSMediaRule.swift b/Sources/DOMKit/WebIDL/CSSMediaRule.swift index a0efc30b..ef223a08 100644 --- a/Sources/DOMKit/WebIDL/CSSMediaRule.swift +++ b/Sources/DOMKit/WebIDL/CSSMediaRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSMediaRule: CSSConditionRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSMediaRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMediaRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) diff --git a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift index aa6633cf..83b63037 100644 --- a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift +++ b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSNamespaceRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSNamespaceRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSNamespaceRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) diff --git a/Sources/DOMKit/WebIDL/CSSNestingRule.swift b/Sources/DOMKit/WebIDL/CSSNestingRule.swift index 2abe8c5b..31fe9716 100644 --- a/Sources/DOMKit/WebIDL/CSSNestingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSNestingRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSNestingRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSNestingRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSNestingRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) @@ -22,12 +22,12 @@ public class CSSNestingRule: CSSRule { @ReadonlyAttribute public var cssRules: CSSRuleList - public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { + @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { let this = jsObject return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteRule(index: UInt32) { + @inlinable public func deleteRule(index: UInt32) { let this = jsObject _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/CSSNumericArray.swift b/Sources/DOMKit/WebIDL/CSSNumericArray.swift index a5478781..a9e2a345 100644 --- a/Sources/DOMKit/WebIDL/CSSNumericArray.swift +++ b/Sources/DOMKit/WebIDL/CSSNumericArray.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSNumericArray: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.CSSNumericArray].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSNumericArray].function! } public let jsObject: JSObject @@ -21,7 +21,7 @@ public class CSSNumericArray: JSBridgedClass, Sequence { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> CSSNumericValue { + @inlinable public subscript(key: Int) -> CSSNumericValue { jsObject[key].fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift b/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift index 8364a77d..3cf974e3 100644 --- a/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift +++ b/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift @@ -12,16 +12,16 @@ public enum CSSNumericBaseType: JSString, JSValueCompatible { case flex = "flex" case percent = "percent" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue.swift b/Sources/DOMKit/WebIDL/CSSNumericValue.swift index 3c79c31a..33913c0c 100644 --- a/Sources/DOMKit/WebIDL/CSSNumericValue.swift +++ b/Sources/DOMKit/WebIDL/CSSNumericValue.swift @@ -4,58 +4,58 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSNumericValue: CSSStyleValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSNumericValue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSNumericValue].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public func add(values: CSSNumberish...) -> Self { + @inlinable public func add(values: CSSNumberish...) -> Self { let this = jsObject return this[Strings.add].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } - public func sub(values: CSSNumberish...) -> Self { + @inlinable public func sub(values: CSSNumberish...) -> Self { let this = jsObject return this[Strings.sub].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } - public func mul(values: CSSNumberish...) -> Self { + @inlinable public func mul(values: CSSNumberish...) -> Self { let this = jsObject return this[Strings.mul].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } - public func div(values: CSSNumberish...) -> Self { + @inlinable public func div(values: CSSNumberish...) -> Self { let this = jsObject return this[Strings.div].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } - public func min(values: CSSNumberish...) -> Self { + @inlinable public func min(values: CSSNumberish...) -> Self { let this = jsObject return this[Strings.min].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } - public func max(values: CSSNumberish...) -> Self { + @inlinable public func max(values: CSSNumberish...) -> Self { let this = jsObject return this[Strings.max].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! } - public func equals(value: CSSNumberish...) -> Bool { + @inlinable public func equals(value: CSSNumberish...) -> Bool { let this = jsObject return this[Strings.equals].function!(this: this, arguments: value.map { $0.jsValue() }).fromJSValue()! } - public func to(unit: String) -> CSSUnitValue { + @inlinable public func to(unit: String) -> CSSUnitValue { let this = jsObject return this[Strings.to].function!(this: this, arguments: [unit.jsValue()]).fromJSValue()! } - public func toSum(units: String...) -> CSSMathSum { + @inlinable public func toSum(units: String...) -> CSSMathSum { let this = jsObject return this[Strings.toSum].function!(this: this, arguments: units.map { $0.jsValue() }).fromJSValue()! } - public func type() -> CSSNumericType { + @inlinable public func type() -> CSSNumericType { let this = jsObject return this[Strings.type].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSOKLCH.swift b/Sources/DOMKit/WebIDL/CSSOKLCH.swift index 2377b182..2ba372be 100644 --- a/Sources/DOMKit/WebIDL/CSSOKLCH.swift +++ b/Sources/DOMKit/WebIDL/CSSOKLCH.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSOKLCH: CSSColorValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSOKLCH].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSOKLCH].function! } public required init(unsafelyWrapping jsObject: JSObject) { _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) @@ -14,7 +14,7 @@ public class CSSOKLCH: CSSColorValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { + @inlinable public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSOKLab.swift b/Sources/DOMKit/WebIDL/CSSOKLab.swift index bc0326f9..50449458 100644 --- a/Sources/DOMKit/WebIDL/CSSOKLab.swift +++ b/Sources/DOMKit/WebIDL/CSSOKLab.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSOKLab: CSSColorValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSOKLab].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSOKLab].function! } public required init(unsafelyWrapping jsObject: JSObject) { _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) @@ -14,7 +14,7 @@ public class CSSOKLab: CSSColorValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { + @inlinable public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSPageRule.swift b/Sources/DOMKit/WebIDL/CSSPageRule.swift index 23c8c868..2755c719 100644 --- a/Sources/DOMKit/WebIDL/CSSPageRule.swift +++ b/Sources/DOMKit/WebIDL/CSSPageRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSPageRule: CSSGroupingRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSPageRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPageRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) diff --git a/Sources/DOMKit/WebIDL/CSSParserAtRule.swift b/Sources/DOMKit/WebIDL/CSSParserAtRule.swift index 70342177..2050a82c 100644 --- a/Sources/DOMKit/WebIDL/CSSParserAtRule.swift +++ b/Sources/DOMKit/WebIDL/CSSParserAtRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSParserAtRule: CSSParserRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserAtRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserAtRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) @@ -13,7 +13,7 @@ public class CSSParserAtRule: CSSParserRule { super.init(unsafelyWrapping: jsObject) } - public convenience init(name: String, prelude: [CSSToken], body: [CSSParserRule]? = nil) { + @inlinable public convenience init(name: String, prelude: [CSSToken], body: [CSSParserRule]? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), prelude.jsValue(), body?.jsValue() ?? .undefined])) } @@ -26,7 +26,7 @@ public class CSSParserAtRule: CSSParserRule { @ReadonlyAttribute public var body: [CSSParserRule]? - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSParserBlock.swift b/Sources/DOMKit/WebIDL/CSSParserBlock.swift index 6f791d44..152027e9 100644 --- a/Sources/DOMKit/WebIDL/CSSParserBlock.swift +++ b/Sources/DOMKit/WebIDL/CSSParserBlock.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSParserBlock: CSSParserValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserBlock].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserBlock].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) @@ -12,7 +12,7 @@ public class CSSParserBlock: CSSParserValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(name: String, body: [CSSParserValue]) { + @inlinable public convenience init(name: String, body: [CSSParserValue]) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), body.jsValue()])) } @@ -22,7 +22,7 @@ public class CSSParserBlock: CSSParserValue { @ReadonlyAttribute public var body: [CSSParserValue] - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift b/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift index a4656aa0..251293a0 100644 --- a/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSParserDeclaration: CSSParserRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserDeclaration].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserDeclaration].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) @@ -12,7 +12,7 @@ public class CSSParserDeclaration: CSSParserRule { super.init(unsafelyWrapping: jsObject) } - public convenience init(name: String, body: [CSSParserRule]? = nil) { + @inlinable public convenience init(name: String, body: [CSSParserRule]? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), body?.jsValue() ?? .undefined])) } @@ -22,7 +22,7 @@ public class CSSParserDeclaration: CSSParserRule { @ReadonlyAttribute public var body: [CSSParserValue] - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSParserFunction.swift b/Sources/DOMKit/WebIDL/CSSParserFunction.swift index 41b77428..0272e5b7 100644 --- a/Sources/DOMKit/WebIDL/CSSParserFunction.swift +++ b/Sources/DOMKit/WebIDL/CSSParserFunction.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSParserFunction: CSSParserValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserFunction].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserFunction].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) @@ -12,7 +12,7 @@ public class CSSParserFunction: CSSParserValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(name: String, args: [[CSSParserValue]]) { + @inlinable public convenience init(name: String, args: [[CSSParserValue]]) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), args.jsValue()])) } @@ -22,7 +22,7 @@ public class CSSParserFunction: CSSParserValue { @ReadonlyAttribute public var args: [[CSSParserValue]] - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift b/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift index 5e5144d7..87a6dc40 100644 --- a/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift +++ b/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSParserQualifiedRule: CSSParserRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserQualifiedRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserQualifiedRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _prelude = ReadonlyAttribute(jsObject: jsObject, name: Strings.prelude) @@ -12,7 +12,7 @@ public class CSSParserQualifiedRule: CSSParserRule { super.init(unsafelyWrapping: jsObject) } - public convenience init(prelude: [CSSToken], body: [CSSParserRule]? = nil) { + @inlinable public convenience init(prelude: [CSSToken], body: [CSSParserRule]? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [prelude.jsValue(), body?.jsValue() ?? .undefined])) } @@ -22,7 +22,7 @@ public class CSSParserQualifiedRule: CSSParserRule { @ReadonlyAttribute public var body: [CSSParserRule] - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSParserRule.swift b/Sources/DOMKit/WebIDL/CSSParserRule.swift index 9295c737..e3f9f3d2 100644 --- a/Sources/DOMKit/WebIDL/CSSParserRule.swift +++ b/Sources/DOMKit/WebIDL/CSSParserRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSParserRule: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CSSParserRule].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSParserRule].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CSSParserValue.swift b/Sources/DOMKit/WebIDL/CSSParserValue.swift index d152bbd5..05eb303d 100644 --- a/Sources/DOMKit/WebIDL/CSSParserValue.swift +++ b/Sources/DOMKit/WebIDL/CSSParserValue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSParserValue: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CSSParserValue].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSParserValue].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CSSPerspective.swift b/Sources/DOMKit/WebIDL/CSSPerspective.swift index 27c854d0..5cea4e8b 100644 --- a/Sources/DOMKit/WebIDL/CSSPerspective.swift +++ b/Sources/DOMKit/WebIDL/CSSPerspective.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSPerspective: CSSTransformComponent { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSPerspective].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPerspective].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadWriteAttribute(jsObject: jsObject, name: Strings.length) super.init(unsafelyWrapping: jsObject) } - public convenience init(length: CSSPerspectiveValue) { + @inlinable public convenience init(length: CSSPerspectiveValue) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [length.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSPropertyRule.swift b/Sources/DOMKit/WebIDL/CSSPropertyRule.swift index 4ed90e52..4a885f36 100644 --- a/Sources/DOMKit/WebIDL/CSSPropertyRule.swift +++ b/Sources/DOMKit/WebIDL/CSSPropertyRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSPropertyRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSPropertyRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPropertyRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift index 20338cdf..f2362544 100644 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSPseudoElement: EventTarget, GeometryUtils { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSPseudoElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPseudoElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) @@ -22,7 +22,7 @@ public class CSSPseudoElement: EventTarget, GeometryUtils { @ReadonlyAttribute public var parent: __UNSUPPORTED_UNION__ - public func pseudo(type: String) -> CSSPseudoElement? { + @inlinable public func pseudo(type: String) -> CSSPseudoElement? { let this = jsObject return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSRGB.swift b/Sources/DOMKit/WebIDL/CSSRGB.swift index d8de6839..0f8ff205 100644 --- a/Sources/DOMKit/WebIDL/CSSRGB.swift +++ b/Sources/DOMKit/WebIDL/CSSRGB.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSRGB: CSSColorValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSRGB].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSRGB].function! } public required init(unsafelyWrapping jsObject: JSObject) { _r = ReadWriteAttribute(jsObject: jsObject, name: Strings.r) @@ -14,7 +14,7 @@ public class CSSRGB: CSSColorValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(r: CSSColorRGBComp, g: CSSColorRGBComp, b: CSSColorRGBComp, alpha: CSSColorPercent? = nil) { + @inlinable public convenience init(r: CSSColorRGBComp, g: CSSColorRGBComp, b: CSSColorRGBComp, alpha: CSSColorPercent? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [r.jsValue(), g.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSRotate.swift b/Sources/DOMKit/WebIDL/CSSRotate.swift index 059d7e45..482c5781 100644 --- a/Sources/DOMKit/WebIDL/CSSRotate.swift +++ b/Sources/DOMKit/WebIDL/CSSRotate.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSRotate: CSSTransformComponent { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSRotate].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSRotate].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) @@ -14,11 +14,11 @@ public class CSSRotate: CSSTransformComponent { super.init(unsafelyWrapping: jsObject) } - public convenience init(angle: CSSNumericValue) { + @inlinable public convenience init(angle: CSSNumericValue) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [angle.jsValue()])) } - public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish, angle: CSSNumericValue) { + @inlinable public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish, angle: CSSNumericValue) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue(), y.jsValue(), z.jsValue(), angle.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift index 9e9dfe6f..92c4ad12 100644 --- a/Sources/DOMKit/WebIDL/CSSRule.swift +++ b/Sources/DOMKit/WebIDL/CSSRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSRule: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CSSRule].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSRule].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CSSRuleList.swift b/Sources/DOMKit/WebIDL/CSSRuleList.swift index 6ec4a8c4..bbfcbcb8 100644 --- a/Sources/DOMKit/WebIDL/CSSRuleList.swift +++ b/Sources/DOMKit/WebIDL/CSSRuleList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSRuleList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CSSRuleList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSRuleList].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class CSSRuleList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: Int) -> CSSRule? { + @inlinable public subscript(key: Int) -> CSSRule? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/CSSScale.swift b/Sources/DOMKit/WebIDL/CSSScale.swift index 68e39630..99ab4f1c 100644 --- a/Sources/DOMKit/WebIDL/CSSScale.swift +++ b/Sources/DOMKit/WebIDL/CSSScale.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSScale: CSSTransformComponent { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSScale].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSScale].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) @@ -13,7 +13,7 @@ public class CSSScale: CSSTransformComponent { super.init(unsafelyWrapping: jsObject) } - public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish? = nil) { + @inlinable public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift b/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift index b446d43e..53c5ed86 100644 --- a/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift +++ b/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSScrollTimelineRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSScrollTimelineRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSScrollTimelineRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/CSSSkew.swift b/Sources/DOMKit/WebIDL/CSSSkew.swift index 86f76750..1336ecde 100644 --- a/Sources/DOMKit/WebIDL/CSSSkew.swift +++ b/Sources/DOMKit/WebIDL/CSSSkew.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSSkew: CSSTransformComponent { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkew].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkew].function! } public required init(unsafelyWrapping jsObject: JSObject) { _ax = ReadWriteAttribute(jsObject: jsObject, name: Strings.ax) @@ -12,7 +12,7 @@ public class CSSSkew: CSSTransformComponent { super.init(unsafelyWrapping: jsObject) } - public convenience init(ax: CSSNumericValue, ay: CSSNumericValue) { + @inlinable public convenience init(ax: CSSNumericValue, ay: CSSNumericValue) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue(), ay.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSSkewX.swift b/Sources/DOMKit/WebIDL/CSSSkewX.swift index 888156cf..733d15a0 100644 --- a/Sources/DOMKit/WebIDL/CSSSkewX.swift +++ b/Sources/DOMKit/WebIDL/CSSSkewX.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSSkewX: CSSTransformComponent { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkewX].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkewX].function! } public required init(unsafelyWrapping jsObject: JSObject) { _ax = ReadWriteAttribute(jsObject: jsObject, name: Strings.ax) super.init(unsafelyWrapping: jsObject) } - public convenience init(ax: CSSNumericValue) { + @inlinable public convenience init(ax: CSSNumericValue) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSSkewY.swift b/Sources/DOMKit/WebIDL/CSSSkewY.swift index 09efc024..10f4a385 100644 --- a/Sources/DOMKit/WebIDL/CSSSkewY.swift +++ b/Sources/DOMKit/WebIDL/CSSSkewY.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSSkewY: CSSTransformComponent { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkewY].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkewY].function! } public required init(unsafelyWrapping jsObject: JSObject) { _ay = ReadWriteAttribute(jsObject: jsObject, name: Strings.ay) super.init(unsafelyWrapping: jsObject) } - public convenience init(ay: CSSNumericValue) { + @inlinable public convenience init(ay: CSSNumericValue) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [ay.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift index 78d71700..548ad66d 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleDeclaration: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleDeclaration].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleDeclaration].function! } public let jsObject: JSObject @@ -22,26 +22,26 @@ public class CSSStyleDeclaration: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> String { + @inlinable public subscript(key: Int) -> String { jsObject[key].fromJSValue()! } - public func getPropertyValue(property: String) -> String { + @inlinable public func getPropertyValue(property: String) -> String { let this = jsObject return this[Strings.getPropertyValue].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } - public func getPropertyPriority(property: String) -> String { + @inlinable public func getPropertyPriority(property: String) -> String { let this = jsObject return this[Strings.getPropertyPriority].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } - public func setProperty(property: String, value: String, priority: String? = nil) { + @inlinable public func setProperty(property: String, value: String, priority: String? = nil) { let this = jsObject _ = this[Strings.setProperty].function!(this: this, arguments: [property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined]) } - public func removeProperty(property: String) -> String { + @inlinable public func removeProperty(property: String) -> String { let this = jsObject return this[Strings.removeProperty].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift index a057ad68..fa156e5e 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) @@ -17,12 +17,12 @@ public class CSSStyleRule: CSSRule { @ReadonlyAttribute public var cssRules: CSSRuleList - public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { + @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { let this = jsObject return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteRule(index: UInt32) { + @inlinable public func deleteRule(index: UInt32) { let this = jsObject _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift index 69c8ec15..fc3ea941 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleSheet: StyleSheet { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleSheet].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleSheet].function! } public required init(unsafelyWrapping jsObject: JSObject) { _ownerRule = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerRule) @@ -13,7 +13,7 @@ public class CSSStyleSheet: StyleSheet { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: CSSStyleSheetInit? = nil) { + @inlinable public convenience init(options: CSSStyleSheetInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } @@ -23,29 +23,29 @@ public class CSSStyleSheet: StyleSheet { @ReadonlyAttribute public var cssRules: CSSRuleList - public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { + @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { let this = jsObject return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteRule(index: UInt32) { + @inlinable public func deleteRule(index: UInt32) { let this = jsObject _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) } - public func replace(text: String) -> JSPromise { + @inlinable public func replace(text: String) -> JSPromise { let this = jsObject return this[Strings.replace].function!(this: this, arguments: [text.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func replace(text: String) async throws -> CSSStyleSheet { + @inlinable public func replace(text: String) async throws -> CSSStyleSheet { let this = jsObject let _promise: JSPromise = this[Strings.replace].function!(this: this, arguments: [text.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func replaceSync(text: String) { + @inlinable public func replaceSync(text: String) { let this = jsObject _ = this[Strings.replaceSync].function!(this: this, arguments: [text.jsValue()]) } @@ -53,12 +53,12 @@ public class CSSStyleSheet: StyleSheet { @ReadonlyAttribute public var rules: CSSRuleList - public func addRule(selector: String? = nil, style: String? = nil, index: UInt32? = nil) -> Int32 { + @inlinable public func addRule(selector: String? = nil, style: String? = nil, index: UInt32? = nil) -> Int32 { let this = jsObject return this[Strings.addRule].function!(this: this, arguments: [selector?.jsValue() ?? .undefined, style?.jsValue() ?? .undefined, index?.jsValue() ?? .undefined]).fromJSValue()! } - public func removeRule(index: UInt32? = nil) { + @inlinable public func removeRule(index: UInt32? = nil) { let this = jsObject _ = this[Strings.removeRule].function!(this: this, arguments: [index?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/CSSStyleValue.swift b/Sources/DOMKit/WebIDL/CSSStyleValue.swift index 23a14855..2e98853f 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleValue.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleValue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleValue: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleValue].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleValue].function! } public let jsObject: JSObject @@ -12,16 +12,16 @@ public class CSSStyleValue: JSBridgedClass { self.jsObject = jsObject } - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } - public static func parse(property: String, cssText: String) -> Self { + @inlinable public static func parse(property: String, cssText: String) -> Self { let this = constructor return this[Strings.parse].function!(this: this, arguments: [property.jsValue(), cssText.jsValue()]).fromJSValue()! } - public static func parseAll(property: String, cssText: String) -> [CSSStyleValue] { + @inlinable public static func parseAll(property: String, cssText: String) -> [CSSStyleValue] { let this = constructor return this[Strings.parseAll].function!(this: this, arguments: [property.jsValue(), cssText.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift index e3c09e1e..eac26957 100644 --- a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift +++ b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSSupportsRule: CSSConditionRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSSupportsRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSSupportsRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/CSSTransformComponent.swift b/Sources/DOMKit/WebIDL/CSSTransformComponent.swift index 586d0c93..21d3f324 100644 --- a/Sources/DOMKit/WebIDL/CSSTransformComponent.swift +++ b/Sources/DOMKit/WebIDL/CSSTransformComponent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSTransformComponent: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CSSTransformComponent].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSTransformComponent].function! } public let jsObject: JSObject @@ -13,14 +13,14 @@ public class CSSTransformComponent: JSBridgedClass { self.jsObject = jsObject } - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } @ReadWriteAttribute public var is2D: Bool - public func toMatrix() -> DOMMatrix { + @inlinable public func toMatrix() -> DOMMatrix { let this = jsObject return this[Strings.toMatrix].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSTransformValue.swift b/Sources/DOMKit/WebIDL/CSSTransformValue.swift index ca9d8221..14e811db 100644 --- a/Sources/DOMKit/WebIDL/CSSTransformValue.swift +++ b/Sources/DOMKit/WebIDL/CSSTransformValue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSTransformValue: CSSStyleValue, Sequence { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSTransformValue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSTransformValue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) @@ -12,7 +12,7 @@ public class CSSTransformValue: CSSStyleValue, Sequence { super.init(unsafelyWrapping: jsObject) } - public convenience init(transforms: [CSSTransformComponent]) { + @inlinable public convenience init(transforms: [CSSTransformComponent]) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [transforms.jsValue()])) } @@ -24,7 +24,7 @@ public class CSSTransformValue: CSSStyleValue, Sequence { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> CSSTransformComponent { + @inlinable public subscript(key: Int) -> CSSTransformComponent { jsObject[key].fromJSValue()! } @@ -33,7 +33,7 @@ public class CSSTransformValue: CSSStyleValue, Sequence { @ReadonlyAttribute public var is2D: Bool - public func toMatrix() -> DOMMatrix { + @inlinable public func toMatrix() -> DOMMatrix { let this = jsObject return this[Strings.toMatrix].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSTransition.swift b/Sources/DOMKit/WebIDL/CSSTransition.swift index 193cbc25..cbb7e83b 100644 --- a/Sources/DOMKit/WebIDL/CSSTransition.swift +++ b/Sources/DOMKit/WebIDL/CSSTransition.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSTransition: Animation { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSTransition].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSTransition].function! } public required init(unsafelyWrapping jsObject: JSObject) { _transitionProperty = ReadonlyAttribute(jsObject: jsObject, name: Strings.transitionProperty) diff --git a/Sources/DOMKit/WebIDL/CSSTranslate.swift b/Sources/DOMKit/WebIDL/CSSTranslate.swift index 0c5b3a38..fca65c3b 100644 --- a/Sources/DOMKit/WebIDL/CSSTranslate.swift +++ b/Sources/DOMKit/WebIDL/CSSTranslate.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSTranslate: CSSTransformComponent { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSTranslate].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSTranslate].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) @@ -13,7 +13,7 @@ public class CSSTranslate: CSSTransformComponent { super.init(unsafelyWrapping: jsObject) } - public convenience init(x: CSSNumericValue, y: CSSNumericValue, z: CSSNumericValue? = nil) { + @inlinable public convenience init(x: CSSNumericValue, y: CSSNumericValue, z: CSSNumericValue? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSUnitValue.swift b/Sources/DOMKit/WebIDL/CSSUnitValue.swift index ae1507d1..94113942 100644 --- a/Sources/DOMKit/WebIDL/CSSUnitValue.swift +++ b/Sources/DOMKit/WebIDL/CSSUnitValue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSUnitValue: CSSNumericValue { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSUnitValue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSUnitValue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) @@ -12,7 +12,7 @@ public class CSSUnitValue: CSSNumericValue { super.init(unsafelyWrapping: jsObject) } - public convenience init(value: Double, unit: String) { + @inlinable public convenience init(value: Double, unit: String) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue(), unit.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift b/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift index 34a42ad7..ec985fe6 100644 --- a/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift +++ b/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSUnparsedValue: CSSStyleValue, Sequence { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSUnparsedValue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSUnparsedValue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) super.init(unsafelyWrapping: jsObject) } - public convenience init(members: [CSSUnparsedSegment]) { + @inlinable public convenience init(members: [CSSUnparsedSegment]) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [members.jsValue()])) } @@ -23,7 +23,7 @@ public class CSSUnparsedValue: CSSStyleValue, Sequence { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> CSSUnparsedSegment { + @inlinable public subscript(key: Int) -> CSSUnparsedSegment { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift index 89ad1f32..cc44f312 100644 --- a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift +++ b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSVariableReferenceValue: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CSSVariableReferenceValue].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSVariableReferenceValue].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class CSSVariableReferenceValue: JSBridgedClass { self.jsObject = jsObject } - public convenience init(variable: String, fallback: CSSUnparsedValue? = nil) { + @inlinable public convenience init(variable: String, fallback: CSSUnparsedValue? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [variable.jsValue(), fallback?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CSSViewportRule.swift b/Sources/DOMKit/WebIDL/CSSViewportRule.swift index b0a4a89a..8fbd9f47 100644 --- a/Sources/DOMKit/WebIDL/CSSViewportRule.swift +++ b/Sources/DOMKit/WebIDL/CSSViewportRule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSViewportRule: CSSRule { - override public class var constructor: JSFunction { JSObject.global[Strings.CSSViewportRule].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSViewportRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) diff --git a/Sources/DOMKit/WebIDL/Cache.swift b/Sources/DOMKit/WebIDL/Cache.swift index 015f44e7..104d0fee 100644 --- a/Sources/DOMKit/WebIDL/Cache.swift +++ b/Sources/DOMKit/WebIDL/Cache.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Cache: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Cache].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Cache].function! } public let jsObject: JSObject @@ -12,85 +12,85 @@ public class Cache: JSBridgedClass { self.jsObject = jsObject } - public func match(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { + @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()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { + @inlinable public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { let this = jsObject let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { + @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()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Response] { + @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.get().fromJSValue()! } - public func add(request: RequestInfo) -> JSPromise { + @inlinable public func add(request: RequestInfo) -> JSPromise { let this = jsObject return this[Strings.add].function!(this: this, arguments: [request.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func add(request: RequestInfo) async throws { + @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.get() } - public func addAll(requests: [RequestInfo]) -> JSPromise { + @inlinable public func addAll(requests: [RequestInfo]) -> JSPromise { let this = jsObject return this[Strings.addAll].function!(this: this, arguments: [requests.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func addAll(requests: [RequestInfo]) async throws { + @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.get() } - public func put(request: RequestInfo, response: Response) -> JSPromise { + @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()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func put(request: RequestInfo, response: Response) async throws { + @inlinable public func put(request: RequestInfo, response: Response) async throws { let this = jsObject let _promise: JSPromise = this[Strings.put].function!(this: this, arguments: [request.jsValue(), response.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { + @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()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> Bool { + @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.get().fromJSValue()! } - public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { + @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()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Request] { + @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.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/CacheStorage.swift b/Sources/DOMKit/WebIDL/CacheStorage.swift index a61f83a0..5a6d395d 100644 --- a/Sources/DOMKit/WebIDL/CacheStorage.swift +++ b/Sources/DOMKit/WebIDL/CacheStorage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CacheStorage: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CacheStorage].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CacheStorage].function! } public let jsObject: JSObject @@ -12,61 +12,61 @@ public class CacheStorage: JSBridgedClass { self.jsObject = jsObject } - public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) -> JSPromise { + @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, *) - public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { + @inlinable public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { let this = jsObject let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func has(cacheName: String) -> JSPromise { + @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, *) - public func has(cacheName: String) async throws -> Bool { + @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.get().fromJSValue()! } - public func open(cacheName: String) -> JSPromise { + @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, *) - public func open(cacheName: String) async throws -> Cache { + @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.get().fromJSValue()! } - public func delete(cacheName: String) -> JSPromise { + @inlinable public func delete(cacheName: String) -> JSPromise { let this = jsObject return this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func delete(cacheName: String) async throws -> Bool { + @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.get().fromJSValue()! } - public func keys() -> JSPromise { + @inlinable public func keys() -> JSPromise { let this = jsObject return this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func keys() async throws -> [String] { + @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.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift b/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift index 26bd7f29..9ff82131 100644 --- a/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift +++ b/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanMakePaymentEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.CanMakePaymentEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CanMakePaymentEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _topOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.topOrigin) @@ -13,7 +13,7 @@ public class CanMakePaymentEvent: ExtendableEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: CanMakePaymentEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: CanMakePaymentEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -26,7 +26,7 @@ public class CanMakePaymentEvent: ExtendableEvent { @ReadonlyAttribute public var methodData: [PaymentMethodData] - public func respondWith(canMakePaymentResponse: JSPromise) { + @inlinable public func respondWith(canMakePaymentResponse: JSPromise) { let this = jsObject _ = this[Strings.respondWith].function!(this: this, arguments: [canMakePaymentResponse.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift index 3b4868b3..bbd981e5 100644 --- a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift +++ b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift @@ -8,16 +8,16 @@ public enum CanPlayTypeResult: JSString, JSValueCompatible { case maybe = "maybe" case probably = "probably" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift b/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift index 13330725..f2a014b7 100644 --- a/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasCaptureMediaStreamTrack: MediaStreamTrack { - override public class var constructor: JSFunction { JSObject.global[Strings.CanvasCaptureMediaStreamTrack].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CanvasCaptureMediaStreamTrack].function! } public required init(unsafelyWrapping jsObject: JSObject) { _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) @@ -14,7 +14,7 @@ public class CanvasCaptureMediaStreamTrack: MediaStreamTrack { @ReadonlyAttribute public var canvas: HTMLCanvasElement - public func requestFrame() { + @inlinable public func requestFrame() { let this = jsObject _ = this[Strings.requestFrame].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/CanvasCompositing.swift b/Sources/DOMKit/WebIDL/CanvasCompositing.swift index f9de503f..dc2d61d5 100644 --- a/Sources/DOMKit/WebIDL/CanvasCompositing.swift +++ b/Sources/DOMKit/WebIDL/CanvasCompositing.swift @@ -5,12 +5,12 @@ import JavaScriptKit public protocol CanvasCompositing: JSBridgedClass {} public extension CanvasCompositing { - var globalAlpha: Double { + @inlinable var globalAlpha: Double { get { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] } set { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] = newValue } } - var globalCompositeOperation: String { + @inlinable var globalCompositeOperation: String { get { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] } set { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasDirection.swift b/Sources/DOMKit/WebIDL/CanvasDirection.swift index 183c4fa1..9a1b9239 100644 --- a/Sources/DOMKit/WebIDL/CanvasDirection.swift +++ b/Sources/DOMKit/WebIDL/CanvasDirection.swift @@ -8,16 +8,16 @@ public enum CanvasDirection: JSString, JSValueCompatible { case rtl = "rtl" case inherit = "inherit" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift index 11aa7627..c5bc5baa 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift @@ -5,17 +5,17 @@ import JavaScriptKit public protocol CanvasDrawImage: JSBridgedClass {} public extension CanvasDrawImage { - func drawImage(image: CanvasImageSource, dx: Double, dy: Double) { + @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()]) } - func drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double) { + @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()]) } - func drawImage(image: CanvasImageSource, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { + @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() diff --git a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift index 9c329070..c2df685f 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift @@ -5,57 +5,57 @@ import JavaScriptKit public protocol CanvasDrawPath: JSBridgedClass {} public extension CanvasDrawPath { - func beginPath() { + @inlinable func beginPath() { let this = jsObject _ = this[Strings.beginPath].function!(this: this, arguments: []) } - func fill(fillRule: CanvasFillRule? = nil) { + @inlinable func fill(fillRule: CanvasFillRule? = nil) { let this = jsObject _ = this[Strings.fill].function!(this: this, arguments: [fillRule?.jsValue() ?? .undefined]) } - func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { + @inlinable func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { let this = jsObject _ = this[Strings.fill].function!(this: this, arguments: [path.jsValue(), fillRule?.jsValue() ?? .undefined]) } - func stroke() { + @inlinable func stroke() { let this = jsObject _ = this[Strings.stroke].function!(this: this, arguments: []) } - func stroke(path: Path2D) { + @inlinable func stroke(path: Path2D) { let this = jsObject _ = this[Strings.stroke].function!(this: this, arguments: [path.jsValue()]) } - func clip(fillRule: CanvasFillRule? = nil) { + @inlinable func clip(fillRule: CanvasFillRule? = nil) { let this = jsObject _ = this[Strings.clip].function!(this: this, arguments: [fillRule?.jsValue() ?? .undefined]) } - func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { + @inlinable func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { let this = jsObject _ = this[Strings.clip].function!(this: this, arguments: [path.jsValue(), fillRule?.jsValue() ?? .undefined]) } - func isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { + @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()! } - func isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { + @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()! } - func isPointInStroke(x: Double, y: Double) -> Bool { + @inlinable func isPointInStroke(x: Double, y: Double) -> Bool { let this = jsObject return this[Strings.isPointInStroke].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } - func isPointInStroke(path: Path2D, x: Double, y: Double) -> Bool { + @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()! } diff --git a/Sources/DOMKit/WebIDL/CanvasFillRule.swift b/Sources/DOMKit/WebIDL/CanvasFillRule.swift index 9d4bfb49..cabb6896 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillRule.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillRule.swift @@ -7,16 +7,16 @@ public enum CanvasFillRule: JSString, JSValueCompatible { case nonzero = "nonzero" case evenodd = "evenodd" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift index 637cb5f0..1b10c2e0 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol CanvasFillStrokeStyles: JSBridgedClass {} public extension CanvasFillStrokeStyles { - var strokeStyle: __UNSUPPORTED_UNION__ { + @inlinable var strokeStyle: __UNSUPPORTED_UNION__ { get { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] } set { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] = newValue } } - var fillStyle: __UNSUPPORTED_UNION__ { + @inlinable var fillStyle: __UNSUPPORTED_UNION__ { get { ReadWriteAttribute[Strings.fillStyle, in: jsObject] } set { ReadWriteAttribute[Strings.fillStyle, in: jsObject] = newValue } } - func createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double) -> CanvasGradient { + @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()! } - func createRadialGradient(x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double) -> CanvasGradient { + @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() @@ -31,12 +31,12 @@ public extension CanvasFillStrokeStyles { return this[Strings.createRadialGradient].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } - func createConicGradient(startAngle: Double, x: Double, y: Double) -> CanvasGradient { + @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()! } - func createPattern(image: CanvasImageSource, repetition: String) -> CanvasPattern? { + @inlinable func createPattern(image: CanvasImageSource, repetition: String) -> CanvasPattern? { let this = jsObject return this[Strings.createPattern].function!(this: this, arguments: [image.jsValue(), repetition.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CanvasFilter.swift b/Sources/DOMKit/WebIDL/CanvasFilter.swift index ddef3625..b72b43e4 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilter.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilter.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasFilter: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CanvasFilter].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasFilter].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class CanvasFilter: JSBridgedClass { self.jsObject = jsObject } - public convenience init(filters: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(filters: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [filters?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/CanvasFilters.swift b/Sources/DOMKit/WebIDL/CanvasFilters.swift index 4786890a..d054dda5 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilters.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilters.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol CanvasFilters: JSBridgedClass {} public extension CanvasFilters { - var filter: __UNSUPPORTED_UNION__ { + @inlinable var filter: __UNSUPPORTED_UNION__ { get { ReadWriteAttribute[Strings.filter, in: jsObject] } set { ReadWriteAttribute[Strings.filter, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift index 6d4c1cba..4c1769bc 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift @@ -8,16 +8,16 @@ public enum CanvasFontKerning: JSString, JSValueCompatible { case normal = "normal" case none = "none" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift index f65fec62..1ff0b73f 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift @@ -14,16 +14,16 @@ public enum CanvasFontStretch: JSString, JSValueCompatible { case extraExpanded = "extra-expanded" case ultraExpanded = "ultra-expanded" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift index 6df5135e..6d0ab6af 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift @@ -12,16 +12,16 @@ public enum CanvasFontVariantCaps: JSString, JSValueCompatible { case unicase = "unicase" case titlingCaps = "titling-caps" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasGradient.swift b/Sources/DOMKit/WebIDL/CanvasGradient.swift index e9af44a3..6298e35c 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasGradient: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CanvasGradient].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasGradient].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class CanvasGradient: JSBridgedClass { self.jsObject = jsObject } - public func addColorStop(offset: Double, color: String) { + @inlinable public func addColorStop(offset: Double, color: String) { let this = jsObject _ = this[Strings.addColorStop].function!(this: this, arguments: [offset.jsValue(), color.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/CanvasImageData.swift b/Sources/DOMKit/WebIDL/CanvasImageData.swift index e84d95b6..864a6391 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageData.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageData.swift @@ -5,27 +5,27 @@ import JavaScriptKit public protocol CanvasImageData: JSBridgedClass {} public extension CanvasImageData { - func createImageData(sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { + @inlinable func createImageData(sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { let this = jsObject return this[Strings.createImageData].function!(this: this, arguments: [sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined]).fromJSValue()! } - func createImageData(imagedata: ImageData) -> ImageData { + @inlinable func createImageData(imagedata: ImageData) -> ImageData { let this = jsObject return this[Strings.createImageData].function!(this: this, arguments: [imagedata.jsValue()]).fromJSValue()! } - func getImageData(sx: Int32, sy: Int32, sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { + @inlinable func getImageData(sx: Int32, sy: Int32, sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { let this = jsObject return this[Strings.getImageData].function!(this: this, arguments: [sx.jsValue(), sy.jsValue(), sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined]).fromJSValue()! } - func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { + @inlinable func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { let this = jsObject _ = this[Strings.putImageData].function!(this: this, arguments: [imagedata.jsValue(), dx.jsValue(), dy.jsValue()]) } - func putImageData(imagedata: ImageData, dx: Int32, dy: Int32, dirtyX: Int32, dirtyY: Int32, dirtyWidth: Int32, dirtyHeight: Int32) { + @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() diff --git a/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift index b9d5a820..c38809ff 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift @@ -5,12 +5,12 @@ import JavaScriptKit public protocol CanvasImageSmoothing: JSBridgedClass {} public extension CanvasImageSmoothing { - var imageSmoothingEnabled: Bool { + @inlinable var imageSmoothingEnabled: Bool { get { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] } set { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] = newValue } } - var imageSmoothingQuality: ImageSmoothingQuality { + @inlinable var imageSmoothingQuality: ImageSmoothingQuality { get { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] } set { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasLineCap.swift b/Sources/DOMKit/WebIDL/CanvasLineCap.swift index 4e1efebb..2de2bc12 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineCap.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineCap.swift @@ -8,16 +8,16 @@ public enum CanvasLineCap: JSString, JSValueCompatible { case round = "round" case square = "square" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift index 07082df1..7bce0ede 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift @@ -8,16 +8,16 @@ public enum CanvasLineJoin: JSString, JSValueCompatible { case bevel = "bevel" case miter = "miter" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasPath.swift b/Sources/DOMKit/WebIDL/CanvasPath.swift index 588a0fc3..1ddc9c07 100644 --- a/Sources/DOMKit/WebIDL/CanvasPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasPath.swift @@ -5,27 +5,27 @@ import JavaScriptKit public protocol CanvasPath: JSBridgedClass {} public extension CanvasPath { - func closePath() { + @inlinable func closePath() { let this = jsObject _ = this[Strings.closePath].function!(this: this, arguments: []) } - func moveTo(x: Double, y: Double) { + @inlinable func moveTo(x: Double, y: Double) { let this = jsObject _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - func lineTo(x: Double, y: Double) { + @inlinable func lineTo(x: Double, y: Double) { let this = jsObject _ = this[Strings.lineTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - func quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double) { + @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()]) } - func bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double) { + @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() @@ -36,22 +36,22 @@ public extension CanvasPath { _ = this[Strings.bezierCurveTo].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) { + @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()]) } - func rect(x: Double, y: Double, w: Double, h: Double) { + @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()]) } - func roundRect(x: Double, y: Double, w: Double, h: Double, radii: __UNSUPPORTED_UNION__? = nil) { + @inlinable func roundRect(x: Double, y: Double, w: Double, h: Double, radii: __UNSUPPORTED_UNION__? = nil) { let this = jsObject _ = this[Strings.roundRect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue(), radii?.jsValue() ?? .undefined]) } - func arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { + @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() @@ -62,7 +62,7 @@ public extension CanvasPath { _ = this[Strings.arc].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = 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() diff --git a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift index 9c121819..1bb5288d 100644 --- a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift @@ -5,37 +5,37 @@ import JavaScriptKit public protocol CanvasPathDrawingStyles: JSBridgedClass {} public extension CanvasPathDrawingStyles { - var lineWidth: Double { + @inlinable var lineWidth: Double { get { ReadWriteAttribute[Strings.lineWidth, in: jsObject] } set { ReadWriteAttribute[Strings.lineWidth, in: jsObject] = newValue } } - var lineCap: CanvasLineCap { + @inlinable var lineCap: CanvasLineCap { get { ReadWriteAttribute[Strings.lineCap, in: jsObject] } set { ReadWriteAttribute[Strings.lineCap, in: jsObject] = newValue } } - var lineJoin: CanvasLineJoin { + @inlinable var lineJoin: CanvasLineJoin { get { ReadWriteAttribute[Strings.lineJoin, in: jsObject] } set { ReadWriteAttribute[Strings.lineJoin, in: jsObject] = newValue } } - var miterLimit: Double { + @inlinable var miterLimit: Double { get { ReadWriteAttribute[Strings.miterLimit, in: jsObject] } set { ReadWriteAttribute[Strings.miterLimit, in: jsObject] = newValue } } - func setLineDash(segments: [Double]) { + @inlinable func setLineDash(segments: [Double]) { let this = jsObject _ = this[Strings.setLineDash].function!(this: this, arguments: [segments.jsValue()]) } - func getLineDash() -> [Double] { + @inlinable func getLineDash() -> [Double] { let this = jsObject return this[Strings.getLineDash].function!(this: this, arguments: []).fromJSValue()! } - var lineDashOffset: Double { + @inlinable var lineDashOffset: Double { get { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] } set { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasPattern.swift b/Sources/DOMKit/WebIDL/CanvasPattern.swift index 66e52564..282e0213 100644 --- a/Sources/DOMKit/WebIDL/CanvasPattern.swift +++ b/Sources/DOMKit/WebIDL/CanvasPattern.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasPattern: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CanvasPattern].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasPattern].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class CanvasPattern: JSBridgedClass { self.jsObject = jsObject } - public func setTransform(transform: DOMMatrix2DInit? = nil) { + @inlinable public func setTransform(transform: DOMMatrix2DInit? = nil) { let this = jsObject _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/CanvasRect.swift b/Sources/DOMKit/WebIDL/CanvasRect.swift index 58c26aa3..2f905353 100644 --- a/Sources/DOMKit/WebIDL/CanvasRect.swift +++ b/Sources/DOMKit/WebIDL/CanvasRect.swift @@ -5,17 +5,17 @@ import JavaScriptKit public protocol CanvasRect: JSBridgedClass {} public extension CanvasRect { - func clearRect(x: Double, y: Double, w: Double, h: Double) { + @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()]) } - func fillRect(x: Double, y: Double, w: Double, h: Double) { + @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()]) } - func strokeRect(x: Double, y: Double, w: Double, h: Double) { + @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()]) } diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift index 029f1130..0c962e81 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { - public class var constructor: JSFunction { JSObject.global[Strings.CanvasRenderingContext2D].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasRenderingContext2D].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransf @ReadonlyAttribute public var canvas: HTMLCanvasElement - public func getContextAttributes() -> CanvasRenderingContext2DSettings { + @inlinable public func getContextAttributes() -> CanvasRenderingContext2DSettings { let this = jsObject return this[Strings.getContextAttributes].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift index 2257c8f3..d6aa3bd3 100644 --- a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol CanvasShadowStyles: JSBridgedClass {} public extension CanvasShadowStyles { - var shadowOffsetX: Double { + @inlinable var shadowOffsetX: Double { get { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] } set { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] = newValue } } - var shadowOffsetY: Double { + @inlinable var shadowOffsetY: Double { get { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] } set { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] = newValue } } - var shadowBlur: Double { + @inlinable var shadowBlur: Double { get { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] } set { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] = newValue } } - var shadowColor: String { + @inlinable var shadowColor: String { get { ReadWriteAttribute[Strings.shadowColor, in: jsObject] } set { ReadWriteAttribute[Strings.shadowColor, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasState.swift b/Sources/DOMKit/WebIDL/CanvasState.swift index 5a434a9d..f8e914dc 100644 --- a/Sources/DOMKit/WebIDL/CanvasState.swift +++ b/Sources/DOMKit/WebIDL/CanvasState.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol CanvasState: JSBridgedClass {} public extension CanvasState { - func save() { + @inlinable func save() { let this = jsObject _ = this[Strings.save].function!(this: this, arguments: []) } - func restore() { + @inlinable func restore() { let this = jsObject _ = this[Strings.restore].function!(this: this, arguments: []) } - func reset() { + @inlinable func reset() { let this = jsObject _ = this[Strings.reset].function!(this: this, arguments: []) } - func isContextLost() -> Bool { + @inlinable func isContextLost() -> Bool { let this = jsObject return this[Strings.isContextLost].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CanvasText.swift b/Sources/DOMKit/WebIDL/CanvasText.swift index ff1b29b3..f68bc36c 100644 --- a/Sources/DOMKit/WebIDL/CanvasText.swift +++ b/Sources/DOMKit/WebIDL/CanvasText.swift @@ -5,17 +5,17 @@ import JavaScriptKit public protocol CanvasText: JSBridgedClass {} public extension CanvasText { - func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { + @inlinable func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { let this = jsObject _ = this[Strings.fillText].function!(this: this, arguments: [text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined]) } - func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { + @inlinable func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { let this = jsObject _ = this[Strings.strokeText].function!(this: this, arguments: [text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined]) } - func measureText(text: String) -> TextMetrics { + @inlinable func measureText(text: String) -> TextMetrics { let this = jsObject return this[Strings.measureText].function!(this: this, arguments: [text.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift index 0f5277dc..2bdd6660 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift @@ -10,16 +10,16 @@ public enum CanvasTextAlign: JSString, JSValueCompatible { case right = "right" case center = "center" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift index c7d38447..e6fdb197 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift @@ -11,16 +11,16 @@ public enum CanvasTextBaseline: JSString, JSValueCompatible { case ideographic = "ideographic" case bottom = "bottom" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift index 011c1563..1f0fbd00 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift @@ -5,52 +5,52 @@ import JavaScriptKit public protocol CanvasTextDrawingStyles: JSBridgedClass {} public extension CanvasTextDrawingStyles { - var font: String { + @inlinable var font: String { get { ReadWriteAttribute[Strings.font, in: jsObject] } set { ReadWriteAttribute[Strings.font, in: jsObject] = newValue } } - var textAlign: CanvasTextAlign { + @inlinable var textAlign: CanvasTextAlign { get { ReadWriteAttribute[Strings.textAlign, in: jsObject] } set { ReadWriteAttribute[Strings.textAlign, in: jsObject] = newValue } } - var textBaseline: CanvasTextBaseline { + @inlinable var textBaseline: CanvasTextBaseline { get { ReadWriteAttribute[Strings.textBaseline, in: jsObject] } set { ReadWriteAttribute[Strings.textBaseline, in: jsObject] = newValue } } - var direction: CanvasDirection { + @inlinable var direction: CanvasDirection { get { ReadWriteAttribute[Strings.direction, in: jsObject] } set { ReadWriteAttribute[Strings.direction, in: jsObject] = newValue } } - var letterSpacing: String { + @inlinable var letterSpacing: String { get { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] } set { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] = newValue } } - var fontKerning: CanvasFontKerning { + @inlinable var fontKerning: CanvasFontKerning { get { ReadWriteAttribute[Strings.fontKerning, in: jsObject] } set { ReadWriteAttribute[Strings.fontKerning, in: jsObject] = newValue } } - var fontStretch: CanvasFontStretch { + @inlinable var fontStretch: CanvasFontStretch { get { ReadWriteAttribute[Strings.fontStretch, in: jsObject] } set { ReadWriteAttribute[Strings.fontStretch, in: jsObject] = newValue } } - var fontVariantCaps: CanvasFontVariantCaps { + @inlinable var fontVariantCaps: CanvasFontVariantCaps { get { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] } set { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] = newValue } } - var textRendering: CanvasTextRendering { + @inlinable var textRendering: CanvasTextRendering { get { ReadWriteAttribute[Strings.textRendering, in: jsObject] } set { ReadWriteAttribute[Strings.textRendering, in: jsObject] = newValue } } - var wordSpacing: String { + @inlinable var wordSpacing: String { get { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] } set { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift index 164e4ee6..7fa14436 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift @@ -9,16 +9,16 @@ public enum CanvasTextRendering: JSString, JSValueCompatible { case optimizeLegibility = "optimizeLegibility" case geometricPrecision = "geometricPrecision" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CanvasTransform.swift b/Sources/DOMKit/WebIDL/CanvasTransform.swift index e6948495..0328f9cb 100644 --- a/Sources/DOMKit/WebIDL/CanvasTransform.swift +++ b/Sources/DOMKit/WebIDL/CanvasTransform.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol CanvasTransform: JSBridgedClass {} public extension CanvasTransform { - func scale(x: Double, y: Double) { + @inlinable func scale(x: Double, y: Double) { let this = jsObject _ = this[Strings.scale].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - func rotate(angle: Double) { + @inlinable func rotate(angle: Double) { let this = jsObject _ = this[Strings.rotate].function!(this: this, arguments: [angle.jsValue()]) } - func translate(x: Double, y: Double) { + @inlinable func translate(x: Double, y: Double) { let this = jsObject _ = this[Strings.translate].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - func transform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { + @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() @@ -31,12 +31,12 @@ public extension CanvasTransform { _ = this[Strings.transform].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func getTransform() -> DOMMatrix { + @inlinable func getTransform() -> DOMMatrix { let this = jsObject return this[Strings.getTransform].function!(this: this, arguments: []).fromJSValue()! } - func setTransform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { + @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() @@ -47,12 +47,12 @@ public extension CanvasTransform { _ = this[Strings.setTransform].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func setTransform(transform: DOMMatrix2DInit? = nil) { + @inlinable func setTransform(transform: DOMMatrix2DInit? = nil) { let this = jsObject _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue() ?? .undefined]) } - func resetTransform() { + @inlinable func resetTransform() { let this = jsObject _ = this[Strings.resetTransform].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift index 9c5815a5..0c328b02 100644 --- a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift +++ b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol CanvasUserInterface: JSBridgedClass {} public extension CanvasUserInterface { - func drawFocusIfNeeded(element: Element) { + @inlinable func drawFocusIfNeeded(element: Element) { let this = jsObject _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [element.jsValue()]) } - func drawFocusIfNeeded(path: Path2D, element: Element) { + @inlinable func drawFocusIfNeeded(path: Path2D, element: Element) { let this = jsObject _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [path.jsValue(), element.jsValue()]) } - func scrollPathIntoView() { + @inlinable func scrollPathIntoView() { let this = jsObject _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: []) } - func scrollPathIntoView(path: Path2D) { + @inlinable func scrollPathIntoView(path: Path2D) { let this = jsObject _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: [path.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/CaretPosition.swift b/Sources/DOMKit/WebIDL/CaretPosition.swift index 9c5b6ff8..385d49ef 100644 --- a/Sources/DOMKit/WebIDL/CaretPosition.swift +++ b/Sources/DOMKit/WebIDL/CaretPosition.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CaretPosition: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CaretPosition].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CaretPosition].function! } public let jsObject: JSObject @@ -20,7 +20,7 @@ public class CaretPosition: JSBridgedClass { @ReadonlyAttribute public var offset: UInt32 - public func getClientRect() -> DOMRect? { + @inlinable public func getClientRect() -> DOMRect? { let this = jsObject return this[Strings.getClientRect].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ChannelCountMode.swift b/Sources/DOMKit/WebIDL/ChannelCountMode.swift index 19d0f422..c6eaa2eb 100644 --- a/Sources/DOMKit/WebIDL/ChannelCountMode.swift +++ b/Sources/DOMKit/WebIDL/ChannelCountMode.swift @@ -8,16 +8,16 @@ public enum ChannelCountMode: JSString, JSValueCompatible { case clampedMax = "clamped-max" case explicit = "explicit" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ChannelInterpretation.swift b/Sources/DOMKit/WebIDL/ChannelInterpretation.swift index 72fd9c42..dc6df9b3 100644 --- a/Sources/DOMKit/WebIDL/ChannelInterpretation.swift +++ b/Sources/DOMKit/WebIDL/ChannelInterpretation.swift @@ -7,16 +7,16 @@ public enum ChannelInterpretation: JSString, JSValueCompatible { case speakers = "speakers" case discrete = "discrete" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ChannelMergerNode.swift b/Sources/DOMKit/WebIDL/ChannelMergerNode.swift index e946e3fc..697bbd65 100644 --- a/Sources/DOMKit/WebIDL/ChannelMergerNode.swift +++ b/Sources/DOMKit/WebIDL/ChannelMergerNode.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class ChannelMergerNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.ChannelMergerNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ChannelMergerNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: ChannelMergerOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: ChannelMergerOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift b/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift index a713bb77..4fafe994 100644 --- a/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift +++ b/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class ChannelSplitterNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.ChannelSplitterNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ChannelSplitterNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: ChannelSplitterOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: ChannelSplitterOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift index 249c10df..8e5d5ad6 100644 --- a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CharacterBoundsUpdateEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.CharacterBoundsUpdateEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CharacterBoundsUpdateEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _rangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeStart) @@ -12,7 +12,7 @@ public class CharacterBoundsUpdateEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: CharacterBoundsUpdateEventInit? = nil) { + @inlinable public convenience init(options: CharacterBoundsUpdateEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CharacterData.swift b/Sources/DOMKit/WebIDL/CharacterData.swift index 525d1968..000d46b6 100644 --- a/Sources/DOMKit/WebIDL/CharacterData.swift +++ b/Sources/DOMKit/WebIDL/CharacterData.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { - override public class var constructor: JSFunction { JSObject.global[Strings.CharacterData].function! } + @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) @@ -18,27 +18,27 @@ public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { @ReadonlyAttribute public var length: UInt32 - public func substringData(offset: UInt32, count: UInt32) -> String { + @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 func appendData(data: String) { + @inlinable public func appendData(data: String) { let this = jsObject _ = this[Strings.appendData].function!(this: this, arguments: [data.jsValue()]) } - public func insertData(offset: UInt32, data: String) { + @inlinable public func insertData(offset: UInt32, data: String) { let this = jsObject _ = this[Strings.insertData].function!(this: this, arguments: [offset.jsValue(), data.jsValue()]) } - public func deleteData(offset: UInt32, count: UInt32) { + @inlinable public func deleteData(offset: UInt32, count: UInt32) { let this = jsObject _ = this[Strings.deleteData].function!(this: this, arguments: [offset.jsValue(), count.jsValue()]) } - public func replaceData(offset: UInt32, count: UInt32, data: String) { + @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()]) } diff --git a/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift b/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift index 18e311e2..66749dc6 100644 --- a/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol CharacteristicEventHandlers: JSBridgedClass {} public extension CharacteristicEventHandlers { - var oncharacteristicvaluechanged: EventHandler { + @inlinable var oncharacteristicvaluechanged: EventHandler { get { ClosureAttribute1Optional[Strings.oncharacteristicvaluechanged, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncharacteristicvaluechanged, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/ChildBreakToken.swift b/Sources/DOMKit/WebIDL/ChildBreakToken.swift index 14bd49b0..9b033b2a 100644 --- a/Sources/DOMKit/WebIDL/ChildBreakToken.swift +++ b/Sources/DOMKit/WebIDL/ChildBreakToken.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ChildBreakToken: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ChildBreakToken].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ChildBreakToken].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ChildDisplayType.swift b/Sources/DOMKit/WebIDL/ChildDisplayType.swift index dd67107e..ece86988 100644 --- a/Sources/DOMKit/WebIDL/ChildDisplayType.swift +++ b/Sources/DOMKit/WebIDL/ChildDisplayType.swift @@ -7,16 +7,16 @@ public enum ChildDisplayType: JSString, JSValueCompatible { case block = "block" case normal = "normal" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ChildNode.swift b/Sources/DOMKit/WebIDL/ChildNode.swift index 6e8825f2..743043bd 100644 --- a/Sources/DOMKit/WebIDL/ChildNode.swift +++ b/Sources/DOMKit/WebIDL/ChildNode.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol ChildNode: JSBridgedClass {} public extension ChildNode { - func before(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func before(nodes: __UNSUPPORTED_UNION__...) { let this = jsObject _ = this[Strings.before].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - func after(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func after(nodes: __UNSUPPORTED_UNION__...) { let this = jsObject _ = this[Strings.after].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - func replaceWith(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func replaceWith(nodes: __UNSUPPORTED_UNION__...) { let this = jsObject _ = this[Strings.replaceWith].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - func remove() { + @inlinable func remove() { let this = jsObject _ = this[Strings.remove].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/Client.swift b/Sources/DOMKit/WebIDL/Client.swift index ea466e4f..4691ef8b 100644 --- a/Sources/DOMKit/WebIDL/Client.swift +++ b/Sources/DOMKit/WebIDL/Client.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Client: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Client].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Client].function! } public let jsObject: JSObject @@ -32,12 +32,12 @@ public class Client: JSBridgedClass { @ReadonlyAttribute public var type: ClientType - public func postMessage(message: JSValue, transfer: [JSObject]) { + @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } - public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/ClientLifecycleState.swift b/Sources/DOMKit/WebIDL/ClientLifecycleState.swift index 0d01d9b4..a00231ff 100644 --- a/Sources/DOMKit/WebIDL/ClientLifecycleState.swift +++ b/Sources/DOMKit/WebIDL/ClientLifecycleState.swift @@ -7,16 +7,16 @@ public enum ClientLifecycleState: JSString, JSValueCompatible { case active = "active" case frozen = "frozen" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ClientType.swift b/Sources/DOMKit/WebIDL/ClientType.swift index 017ddf49..3e393706 100644 --- a/Sources/DOMKit/WebIDL/ClientType.swift +++ b/Sources/DOMKit/WebIDL/ClientType.swift @@ -9,16 +9,16 @@ public enum ClientType: JSString, JSValueCompatible { case sharedworker = "sharedworker" case all = "all" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Clients.swift b/Sources/DOMKit/WebIDL/Clients.swift index 70436d78..2f2f9224 100644 --- a/Sources/DOMKit/WebIDL/Clients.swift +++ b/Sources/DOMKit/WebIDL/Clients.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Clients: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Clients].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Clients].function! } public let jsObject: JSObject @@ -12,49 +12,49 @@ public class Clients: JSBridgedClass { self.jsObject = jsObject } - public func get(id: String) -> JSPromise { + @inlinable public func get(id: String) -> JSPromise { let this = jsObject return this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func get(id: String) async throws -> __UNSUPPORTED_UNION__ { + @inlinable public func get(id: String) async throws -> __UNSUPPORTED_UNION__ { let this = jsObject let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func matchAll(options: ClientQueryOptions? = nil) -> JSPromise { + @inlinable public func matchAll(options: ClientQueryOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.matchAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func matchAll(options: ClientQueryOptions? = nil) async throws -> [Client] { + @inlinable public func matchAll(options: ClientQueryOptions? = nil) async throws -> [Client] { let this = jsObject let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func openWindow(url: String) -> JSPromise { + @inlinable public func openWindow(url: String) -> JSPromise { let this = jsObject return this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func openWindow(url: String) async throws -> WindowClient? { + @inlinable public func openWindow(url: String) async throws -> WindowClient? { let this = jsObject let _promise: JSPromise = this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func claim() -> JSPromise { + @inlinable public func claim() -> JSPromise { let this = jsObject return this[Strings.claim].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func claim() async throws { + @inlinable public func claim() async throws { let this = jsObject let _promise: JSPromise = this[Strings.claim].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/Clipboard.swift b/Sources/DOMKit/WebIDL/Clipboard.swift index 5d54d40c..8dfc276a 100644 --- a/Sources/DOMKit/WebIDL/Clipboard.swift +++ b/Sources/DOMKit/WebIDL/Clipboard.swift @@ -4,55 +4,55 @@ import JavaScriptEventLoop import JavaScriptKit public class Clipboard: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Clipboard].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Clipboard].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public func read() -> JSPromise { + @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, *) - public func read() async throws -> ClipboardItems { + @inlinable public func read() async throws -> ClipboardItems { let this = jsObject let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func readText() -> JSPromise { + @inlinable public func readText() -> JSPromise { let this = jsObject return this[Strings.readText].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func readText() async throws -> String { + @inlinable public func readText() async throws -> String { let this = jsObject let _promise: JSPromise = this[Strings.readText].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func write(data: ClipboardItems) -> JSPromise { + @inlinable public func write(data: ClipboardItems) -> JSPromise { let this = jsObject return this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func write(data: ClipboardItems) async throws { + @inlinable public func write(data: ClipboardItems) async throws { let this = jsObject let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func writeText(data: String) -> JSPromise { + @inlinable public func writeText(data: String) -> JSPromise { let this = jsObject return this[Strings.writeText].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func writeText(data: String) async throws { + @inlinable public func writeText(data: String) async throws { let this = jsObject let _promise: JSPromise = this[Strings.writeText].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/ClipboardEvent.swift b/Sources/DOMKit/WebIDL/ClipboardEvent.swift index cb483475..dc9bd6cf 100644 --- a/Sources/DOMKit/WebIDL/ClipboardEvent.swift +++ b/Sources/DOMKit/WebIDL/ClipboardEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ClipboardEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.ClipboardEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ClipboardEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _clipboardData = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipboardData) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: ClipboardEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: ClipboardEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/ClipboardItem.swift b/Sources/DOMKit/WebIDL/ClipboardItem.swift index 4cfab85a..7c9f5d24 100644 --- a/Sources/DOMKit/WebIDL/ClipboardItem.swift +++ b/Sources/DOMKit/WebIDL/ClipboardItem.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ClipboardItem: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ClipboardItem].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ClipboardItem].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class ClipboardItem: JSBridgedClass { self.jsObject = jsObject } - public convenience init(items: [String: ClipboardItemData], options: ClipboardItemOptions? = nil) { + @inlinable public convenience init(items: [String: ClipboardItemData], options: ClipboardItemOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [items.jsValue(), options?.jsValue() ?? .undefined])) } @@ -24,13 +24,13 @@ public class ClipboardItem: JSBridgedClass { @ReadonlyAttribute public var types: [String] - public func getType(type: String) -> JSPromise { + @inlinable public func getType(type: String) -> JSPromise { let this = jsObject return this[Strings.getType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getType(type: String) async throws -> Blob { + @inlinable public func getType(type: String) async throws -> Blob { let this = jsObject let _promise: JSPromise = this[Strings.getType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/CloseEvent.swift b/Sources/DOMKit/WebIDL/CloseEvent.swift index 5e6118ad..7247a465 100644 --- a/Sources/DOMKit/WebIDL/CloseEvent.swift +++ b/Sources/DOMKit/WebIDL/CloseEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CloseEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.CloseEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CloseEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _wasClean = ReadonlyAttribute(jsObject: jsObject, name: Strings.wasClean) @@ -13,7 +13,7 @@ public class CloseEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: CloseEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: CloseEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CloseWatcher.swift b/Sources/DOMKit/WebIDL/CloseWatcher.swift index a41bf87e..68123f81 100644 --- a/Sources/DOMKit/WebIDL/CloseWatcher.swift +++ b/Sources/DOMKit/WebIDL/CloseWatcher.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CloseWatcher: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.CloseWatcher].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CloseWatcher].function! } public required init(unsafelyWrapping jsObject: JSObject) { _oncancel = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncancel) @@ -12,16 +12,16 @@ public class CloseWatcher: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: CloseWatcherOptions? = nil) { + @inlinable public convenience init(options: CloseWatcherOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } - public func destroy() { + @inlinable public func destroy() { let this = jsObject _ = this[Strings.destroy].function!(this: this, arguments: []) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/CodecState.swift b/Sources/DOMKit/WebIDL/CodecState.swift index 4bdbf93e..39f712f4 100644 --- a/Sources/DOMKit/WebIDL/CodecState.swift +++ b/Sources/DOMKit/WebIDL/CodecState.swift @@ -8,16 +8,16 @@ public enum CodecState: JSString, JSValueCompatible { case configured = "configured" case closed = "closed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ColorGamut.swift b/Sources/DOMKit/WebIDL/ColorGamut.swift index 2d733050..d48b6518 100644 --- a/Sources/DOMKit/WebIDL/ColorGamut.swift +++ b/Sources/DOMKit/WebIDL/ColorGamut.swift @@ -8,16 +8,16 @@ public enum ColorGamut: JSString, JSValueCompatible { case p3 = "p3" case rec2020 = "rec2020" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift index 3273a619..942df651 100644 --- a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift +++ b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift @@ -7,16 +7,16 @@ public enum ColorSpaceConversion: JSString, JSValueCompatible { case none = "none" case `default` = "default" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Comment.swift b/Sources/DOMKit/WebIDL/Comment.swift index 1c1e2eda..dd801419 100644 --- a/Sources/DOMKit/WebIDL/Comment.swift +++ b/Sources/DOMKit/WebIDL/Comment.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class Comment: CharacterData { - override public class var constructor: JSFunction { JSObject.global[Strings.Comment].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Comment].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(data: String? = nil) { + @inlinable public convenience init(data: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/CompositeOperation.swift b/Sources/DOMKit/WebIDL/CompositeOperation.swift index ce31f3aa..805dcac0 100644 --- a/Sources/DOMKit/WebIDL/CompositeOperation.swift +++ b/Sources/DOMKit/WebIDL/CompositeOperation.swift @@ -8,16 +8,16 @@ public enum CompositeOperation: JSString, JSValueCompatible { case add = "add" case accumulate = "accumulate" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift index 73679c54..a75afd54 100644 --- a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift +++ b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift @@ -9,16 +9,16 @@ public enum CompositeOperationOrAuto: JSString, JSValueCompatible { case accumulate = "accumulate" case auto = "auto" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index 4e9c2cba..515ecf64 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -4,21 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class CompositionEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.CompositionEvent].function! } + @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) } - public convenience init(type: String, eventInitDict: CompositionEventInit? = nil) { + @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 - public func initCompositionEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: WindowProxy? = nil, dataArg: String? = nil) { + @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]) } diff --git a/Sources/DOMKit/WebIDL/CompressionStream.swift b/Sources/DOMKit/WebIDL/CompressionStream.swift index cdbec0a0..c8a63130 100644 --- a/Sources/DOMKit/WebIDL/CompressionStream.swift +++ b/Sources/DOMKit/WebIDL/CompressionStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CompressionStream: JSBridgedClass, GenericTransformStream { - public class var constructor: JSFunction { JSObject.global[Strings.CompressionStream].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CompressionStream].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class CompressionStream: JSBridgedClass, GenericTransformStream { self.jsObject = jsObject } - public convenience init(format: String) { + @inlinable public convenience init(format: String) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue()])) } } diff --git a/Sources/DOMKit/WebIDL/ComputePressureFactor.swift b/Sources/DOMKit/WebIDL/ComputePressureFactor.swift index 337fc722..9a579442 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureFactor.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureFactor.swift @@ -7,16 +7,16 @@ public enum ComputePressureFactor: JSString, JSValueCompatible { case thermal = "thermal" case powerSupply = "power-supply" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift index 7a4e96dc..ec732707 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ComputePressureObserver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ComputePressureObserver].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ComputePressureObserver].function! } public let jsObject: JSObject @@ -15,22 +15,22 @@ public class ComputePressureObserver: JSBridgedClass { // XXX: constructor is ignored - public func observe(source: ComputePressureSource) { + @inlinable public func observe(source: ComputePressureSource) { let this = jsObject _ = this[Strings.observe].function!(this: this, arguments: [source.jsValue()]) } - public func unobserve(source: ComputePressureSource) { + @inlinable public func unobserve(source: ComputePressureSource) { let this = jsObject _ = this[Strings.unobserve].function!(this: this, arguments: [source.jsValue()]) } - public func disconnect() { + @inlinable public func disconnect() { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: []) } - public func takeRecords() -> [ComputePressureRecord] { + @inlinable public func takeRecords() -> [ComputePressureRecord] { let this = jsObject return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } @@ -38,13 +38,13 @@ public class ComputePressureObserver: JSBridgedClass { @ReadonlyAttribute public var supportedSources: [ComputePressureSource] - public static func requestPermission() -> JSPromise { + @inlinable public static func requestPermission() -> JSPromise { let this = constructor return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func requestPermission() async throws -> PermissionState { + @inlinable public static func requestPermission() async throws -> PermissionState { let this = constructor let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ComputePressureSource.swift b/Sources/DOMKit/WebIDL/ComputePressureSource.swift index 84276a5e..cbcd3471 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureSource.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureSource.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum ComputePressureSource: JSString, JSValueCompatible { case cpu = "cpu" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ComputePressureState.swift b/Sources/DOMKit/WebIDL/ComputePressureState.swift index 70ad1f99..73b97cf2 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureState.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureState.swift @@ -9,16 +9,16 @@ public enum ComputePressureState: JSString, JSValueCompatible { case serious = "serious" case critical = "critical" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ConnectionType.swift b/Sources/DOMKit/WebIDL/ConnectionType.swift index 28222503..29abeeac 100644 --- a/Sources/DOMKit/WebIDL/ConnectionType.swift +++ b/Sources/DOMKit/WebIDL/ConnectionType.swift @@ -14,16 +14,16 @@ public enum ConnectionType: JSString, JSValueCompatible { case wifi = "wifi" case wimax = "wimax" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ConstantSourceNode.swift b/Sources/DOMKit/WebIDL/ConstantSourceNode.swift index 3f0d7d69..937234b2 100644 --- a/Sources/DOMKit/WebIDL/ConstantSourceNode.swift +++ b/Sources/DOMKit/WebIDL/ConstantSourceNode.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ConstantSourceNode: AudioScheduledSourceNode { - override public class var constructor: JSFunction { JSObject.global[Strings.ConstantSourceNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ConstantSourceNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: ConstantSourceOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: ConstantSourceOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/ContactAddress.swift b/Sources/DOMKit/WebIDL/ContactAddress.swift index 57e1a2ad..a77a7492 100644 --- a/Sources/DOMKit/WebIDL/ContactAddress.swift +++ b/Sources/DOMKit/WebIDL/ContactAddress.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ContactAddress: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ContactAddress].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ContactAddress].function! } public let jsObject: JSObject @@ -22,7 +22,7 @@ public class ContactAddress: JSBridgedClass { self.jsObject = jsObject } - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ContactProperty.swift b/Sources/DOMKit/WebIDL/ContactProperty.swift index b57de34f..2608d4ea 100644 --- a/Sources/DOMKit/WebIDL/ContactProperty.swift +++ b/Sources/DOMKit/WebIDL/ContactProperty.swift @@ -10,16 +10,16 @@ public enum ContactProperty: JSString, JSValueCompatible { case name = "name" case tel = "tel" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ContactsManager.swift b/Sources/DOMKit/WebIDL/ContactsManager.swift index 97cae3e8..725fa1e0 100644 --- a/Sources/DOMKit/WebIDL/ContactsManager.swift +++ b/Sources/DOMKit/WebIDL/ContactsManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ContactsManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ContactsManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ContactsManager].function! } public let jsObject: JSObject @@ -12,25 +12,25 @@ public class ContactsManager: JSBridgedClass { self.jsObject = jsObject } - public func getProperties() -> JSPromise { + @inlinable public func getProperties() -> JSPromise { let this = jsObject return this[Strings.getProperties].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getProperties() async throws -> [ContactProperty] { + @inlinable public func getProperties() async throws -> [ContactProperty] { let this = jsObject let _promise: JSPromise = this[Strings.getProperties].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) -> JSPromise { + @inlinable public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.select].function!(this: this, arguments: [properties.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) async throws -> [ContactInfo] { + @inlinable public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) async throws -> [ContactInfo] { let this = jsObject let _promise: JSPromise = this[Strings.select].function!(this: this, arguments: [properties.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ContentCategory.swift b/Sources/DOMKit/WebIDL/ContentCategory.swift index 5655585d..2c1428c7 100644 --- a/Sources/DOMKit/WebIDL/ContentCategory.swift +++ b/Sources/DOMKit/WebIDL/ContentCategory.swift @@ -10,16 +10,16 @@ public enum ContentCategory: JSString, JSValueCompatible { case video = "video" case audio = "audio" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ContentIndex.swift b/Sources/DOMKit/WebIDL/ContentIndex.swift index 8eacc376..597f9d9e 100644 --- a/Sources/DOMKit/WebIDL/ContentIndex.swift +++ b/Sources/DOMKit/WebIDL/ContentIndex.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ContentIndex: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ContentIndex].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ContentIndex].function! } public let jsObject: JSObject @@ -12,37 +12,37 @@ public class ContentIndex: JSBridgedClass { self.jsObject = jsObject } - public func add(description: ContentDescription) -> JSPromise { + @inlinable public func add(description: ContentDescription) -> JSPromise { let this = jsObject return this[Strings.add].function!(this: this, arguments: [description.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func add(description: ContentDescription) async throws { + @inlinable public func add(description: ContentDescription) async throws { let this = jsObject let _promise: JSPromise = this[Strings.add].function!(this: this, arguments: [description.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func delete(id: String) -> JSPromise { + @inlinable public func delete(id: String) -> JSPromise { let this = jsObject return this[Strings.delete].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func delete(id: String) async throws { + @inlinable public func delete(id: String) async throws { let this = jsObject let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func getAll() -> JSPromise { + @inlinable public func getAll() -> JSPromise { let this = jsObject return this[Strings.getAll].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getAll() async throws -> [ContentDescription] { + @inlinable public func getAll() async throws -> [ContentDescription] { let this = jsObject let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ContentIndexEvent.swift b/Sources/DOMKit/WebIDL/ContentIndexEvent.swift index fccbbb8c..b2006d40 100644 --- a/Sources/DOMKit/WebIDL/ContentIndexEvent.swift +++ b/Sources/DOMKit/WebIDL/ContentIndexEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ContentIndexEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.ContentIndexEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ContentIndexEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, init: ContentIndexEventInit) { + @inlinable public convenience init(type: String, init: ContentIndexEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/ConvolverNode.swift b/Sources/DOMKit/WebIDL/ConvolverNode.swift index e41a729d..8c59f544 100644 --- a/Sources/DOMKit/WebIDL/ConvolverNode.swift +++ b/Sources/DOMKit/WebIDL/ConvolverNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ConvolverNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.ConvolverNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ConvolverNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _buffer = ReadWriteAttribute(jsObject: jsObject, name: Strings.buffer) @@ -12,7 +12,7 @@ public class ConvolverNode: AudioNode { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: ConvolverOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: ConvolverOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CookieChangeEvent.swift b/Sources/DOMKit/WebIDL/CookieChangeEvent.swift index a48279b8..c891a26b 100644 --- a/Sources/DOMKit/WebIDL/CookieChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/CookieChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CookieChangeEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.CookieChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CookieChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _changed = ReadonlyAttribute(jsObject: jsObject, name: Strings.changed) @@ -12,7 +12,7 @@ public class CookieChangeEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: CookieChangeEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: CookieChangeEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/CookieSameSite.swift b/Sources/DOMKit/WebIDL/CookieSameSite.swift index ecdc8cdc..bd010a46 100644 --- a/Sources/DOMKit/WebIDL/CookieSameSite.swift +++ b/Sources/DOMKit/WebIDL/CookieSameSite.swift @@ -8,16 +8,16 @@ public enum CookieSameSite: JSString, JSValueCompatible { case lax = "lax" case none = "none" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CookieStore.swift b/Sources/DOMKit/WebIDL/CookieStore.swift index 84d47621..58e9a9a1 100644 --- a/Sources/DOMKit/WebIDL/CookieStore.swift +++ b/Sources/DOMKit/WebIDL/CookieStore.swift @@ -4,104 +4,104 @@ import JavaScriptEventLoop import JavaScriptKit public class CookieStore: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.CookieStore].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CookieStore].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) super.init(unsafelyWrapping: jsObject) } - public func get(name: String) -> JSPromise { + @inlinable public func get(name: String) -> JSPromise { let this = jsObject return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func get(name: String) async throws -> CookieListItem? { + @inlinable public func get(name: String) async throws -> CookieListItem? { let this = jsObject let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func get(options: CookieStoreGetOptions? = nil) -> JSPromise { + @inlinable public func get(options: CookieStoreGetOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func get(options: CookieStoreGetOptions? = nil) async throws -> CookieListItem? { + @inlinable public func get(options: CookieStoreGetOptions? = nil) async throws -> CookieListItem? { let this = jsObject let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getAll(name: String) -> JSPromise { + @inlinable public func getAll(name: String) -> JSPromise { let this = jsObject return this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getAll(name: String) async throws -> CookieList { + @inlinable public func getAll(name: String) async throws -> CookieList { let this = jsObject let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getAll(options: CookieStoreGetOptions? = nil) -> JSPromise { + @inlinable public func getAll(options: CookieStoreGetOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.getAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getAll(options: CookieStoreGetOptions? = nil) async throws -> CookieList { + @inlinable public func getAll(options: CookieStoreGetOptions? = nil) async throws -> CookieList { let this = jsObject let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func set(name: String, value: String) -> JSPromise { + @inlinable public func set(name: String, value: String) -> JSPromise { let this = jsObject return this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func set(name: String, value: String) async throws { + @inlinable public func set(name: String, value: String) async throws { let this = jsObject let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func set(options: CookieInit) -> JSPromise { + @inlinable public func set(options: CookieInit) -> JSPromise { let this = jsObject return this[Strings.set].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func set(options: CookieInit) async throws { + @inlinable public func set(options: CookieInit) async throws { let this = jsObject let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func delete(name: String) -> JSPromise { + @inlinable public func delete(name: String) -> JSPromise { let this = jsObject return this[Strings.delete].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func delete(name: String) async throws { + @inlinable public func delete(name: String) async throws { let this = jsObject let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func delete(options: CookieStoreDeleteOptions) -> JSPromise { + @inlinable public func delete(options: CookieStoreDeleteOptions) -> JSPromise { let this = jsObject return this[Strings.delete].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func delete(options: CookieStoreDeleteOptions) async throws { + @inlinable public func delete(options: CookieStoreDeleteOptions) async throws { let this = jsObject let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/CookieStoreManager.swift b/Sources/DOMKit/WebIDL/CookieStoreManager.swift index 94246e8a..50867061 100644 --- a/Sources/DOMKit/WebIDL/CookieStoreManager.swift +++ b/Sources/DOMKit/WebIDL/CookieStoreManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CookieStoreManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CookieStoreManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CookieStoreManager].function! } public let jsObject: JSObject @@ -12,37 +12,37 @@ public class CookieStoreManager: JSBridgedClass { self.jsObject = jsObject } - public func subscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { + @inlinable public func subscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { let this = jsObject return this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func subscribe(subscriptions: [CookieStoreGetOptions]) async throws { + @inlinable public func subscribe(subscriptions: [CookieStoreGetOptions]) async throws { let this = jsObject let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func getSubscriptions() -> JSPromise { + @inlinable public func getSubscriptions() -> JSPromise { let this = jsObject return this[Strings.getSubscriptions].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getSubscriptions() async throws -> [CookieStoreGetOptions] { + @inlinable public func getSubscriptions() async throws -> [CookieStoreGetOptions] { let this = jsObject let _promise: JSPromise = this[Strings.getSubscriptions].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func unsubscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { + @inlinable public func unsubscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { let this = jsObject return this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func unsubscribe(subscriptions: [CookieStoreGetOptions]) async throws { + @inlinable public func unsubscribe(subscriptions: [CookieStoreGetOptions]) async throws { let this = jsObject let _promise: JSPromise = this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift index 23abb282..2713a5c9 100644 --- a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CountQueuingStrategy: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CountQueuingStrategy].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CountQueuingStrategy].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class CountQueuingStrategy: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: QueuingStrategyInit) { + @inlinable public convenience init(init: QueuingStrategyInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/CrashReportBody.swift b/Sources/DOMKit/WebIDL/CrashReportBody.swift index 69807fc4..c417fa1c 100644 --- a/Sources/DOMKit/WebIDL/CrashReportBody.swift +++ b/Sources/DOMKit/WebIDL/CrashReportBody.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class CrashReportBody: ReportBody { - override public class var constructor: JSFunction { JSObject.global[Strings.CrashReportBody].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CrashReportBody].function! } public required init(unsafelyWrapping jsObject: JSObject) { _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) super.init(unsafelyWrapping: jsObject) } - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Credential.swift b/Sources/DOMKit/WebIDL/Credential.swift index bc42c322..35e62e21 100644 --- a/Sources/DOMKit/WebIDL/Credential.swift +++ b/Sources/DOMKit/WebIDL/Credential.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Credential: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Credential].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Credential].function! } public let jsObject: JSObject @@ -20,7 +20,7 @@ public class Credential: JSBridgedClass { @ReadonlyAttribute public var type: String - public static func isConditionalMediationAvailable() -> Bool { + @inlinable public static func isConditionalMediationAvailable() -> Bool { let this = constructor return this[Strings.isConditionalMediationAvailable].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift b/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift index 1e0296d9..e14cdb7d 100644 --- a/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift +++ b/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift @@ -9,16 +9,16 @@ public enum CredentialMediationRequirement: JSString, JSValueCompatible { case conditional = "conditional" case required = "required" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CredentialUserData.swift b/Sources/DOMKit/WebIDL/CredentialUserData.swift index 83d9b47c..a1f77b07 100644 --- a/Sources/DOMKit/WebIDL/CredentialUserData.swift +++ b/Sources/DOMKit/WebIDL/CredentialUserData.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol CredentialUserData: JSBridgedClass {} public extension CredentialUserData { - var name: String { ReadonlyAttribute[Strings.name, in: jsObject] } + @inlinable var name: String { ReadonlyAttribute[Strings.name, in: jsObject] } - var iconURL: String { ReadonlyAttribute[Strings.iconURL, in: jsObject] } + @inlinable var iconURL: String { ReadonlyAttribute[Strings.iconURL, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/CredentialsContainer.swift b/Sources/DOMKit/WebIDL/CredentialsContainer.swift index d0259d16..f536c1f3 100644 --- a/Sources/DOMKit/WebIDL/CredentialsContainer.swift +++ b/Sources/DOMKit/WebIDL/CredentialsContainer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CredentialsContainer: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CredentialsContainer].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CredentialsContainer].function! } public let jsObject: JSObject @@ -12,49 +12,49 @@ public class CredentialsContainer: JSBridgedClass { self.jsObject = jsObject } - public func get(options: CredentialRequestOptions? = nil) -> JSPromise { + @inlinable public func get(options: CredentialRequestOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func get(options: CredentialRequestOptions? = nil) async throws -> Credential? { + @inlinable public func get(options: CredentialRequestOptions? = nil) async throws -> Credential? { let this = jsObject let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func store(credential: Credential) -> JSPromise { + @inlinable public func store(credential: Credential) -> JSPromise { let this = jsObject return this[Strings.store].function!(this: this, arguments: [credential.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func store(credential: Credential) async throws -> Credential { + @inlinable public func store(credential: Credential) async throws -> Credential { let this = jsObject let _promise: JSPromise = this[Strings.store].function!(this: this, arguments: [credential.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func create(options: CredentialCreationOptions? = nil) -> JSPromise { + @inlinable public func create(options: CredentialCreationOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.create].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func create(options: CredentialCreationOptions? = nil) async throws -> Credential? { + @inlinable public func create(options: CredentialCreationOptions? = nil) async throws -> Credential? { let this = jsObject let _promise: JSPromise = this[Strings.create].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func preventSilentAccess() -> JSPromise { + @inlinable public func preventSilentAccess() -> JSPromise { let this = jsObject return this[Strings.preventSilentAccess].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func preventSilentAccess() async throws { + @inlinable public func preventSilentAccess() async throws { let this = jsObject let _promise: JSPromise = this[Strings.preventSilentAccess].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/CropTarget.swift b/Sources/DOMKit/WebIDL/CropTarget.swift index 62d4fc47..5cff81a7 100644 --- a/Sources/DOMKit/WebIDL/CropTarget.swift +++ b/Sources/DOMKit/WebIDL/CropTarget.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CropTarget: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CropTarget].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CropTarget].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/Crypto.swift b/Sources/DOMKit/WebIDL/Crypto.swift index a9a6eebc..df9830f2 100644 --- a/Sources/DOMKit/WebIDL/Crypto.swift +++ b/Sources/DOMKit/WebIDL/Crypto.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Crypto: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Crypto].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Crypto].function! } public let jsObject: JSObject @@ -16,12 +16,12 @@ public class Crypto: JSBridgedClass { @ReadonlyAttribute public var subtle: SubtleCrypto - public func getRandomValues(array: ArrayBufferView) -> ArrayBufferView { + @inlinable public func getRandomValues(array: ArrayBufferView) -> ArrayBufferView { let this = jsObject return this[Strings.getRandomValues].function!(this: this, arguments: [array.jsValue()]).fromJSValue()! } - public func randomUUID() -> String { + @inlinable public func randomUUID() -> String { let this = jsObject return this[Strings.randomUUID].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/CryptoKey.swift b/Sources/DOMKit/WebIDL/CryptoKey.swift index 7b782d17..e7ba2153 100644 --- a/Sources/DOMKit/WebIDL/CryptoKey.swift +++ b/Sources/DOMKit/WebIDL/CryptoKey.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CryptoKey: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CryptoKey].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CryptoKey].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift b/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift index dc240429..72067551 100644 --- a/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift +++ b/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift @@ -8,16 +8,16 @@ public enum CursorCaptureConstraint: JSString, JSValueCompatible { case always = "always" case motion = "motion" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index 252b9d92..0e35b096 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CustomElementRegistry: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CustomElementRegistry].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CustomElementRegistry].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'define' is ignored - public func get(name: String) -> __UNSUPPORTED_UNION__ { + @inlinable public func get(name: String) -> __UNSUPPORTED_UNION__ { let this = jsObject return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } @@ -23,7 +23,7 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'whenDefined' is ignored - public func upgrade(root: Node) { + @inlinable public func upgrade(root: Node) { let this = jsObject _ = this[Strings.upgrade].function!(this: this, arguments: [root.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index 7c1c7021..2e85b04f 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -4,21 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class CustomEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.CustomEvent].function! } + @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 convenience init(type: String, eventInitDict: CustomEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: CustomEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute public var detail: JSValue - public func initCustomEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, detail: JSValue? = nil) { + @inlinable public func initCustomEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, detail: JSValue? = nil) { let this = jsObject _ = this[Strings.initCustomEvent].function!(this: this, arguments: [type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/CustomStateSet.swift b/Sources/DOMKit/WebIDL/CustomStateSet.swift index 74ca1009..bb2924b2 100644 --- a/Sources/DOMKit/WebIDL/CustomStateSet.swift +++ b/Sources/DOMKit/WebIDL/CustomStateSet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CustomStateSet: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.CustomStateSet].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CustomStateSet].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class CustomStateSet: JSBridgedClass { // XXX: make me Set-like! - public func add(value: String) { + @inlinable public func add(value: String) { let this = jsObject _ = this[Strings.add].function!(this: this, arguments: [value.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/DOMException.swift b/Sources/DOMKit/WebIDL/DOMException.swift index 9453e464..97fa9294 100644 --- a/Sources/DOMKit/WebIDL/DOMException.swift +++ b/Sources/DOMKit/WebIDL/DOMException.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMException: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMException].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMException].function! } public let jsObject: JSObject @@ -15,7 +15,7 @@ public class DOMException: JSBridgedClass { self.jsObject = jsObject } - public convenience init(message: String? = nil, name: String? = nil) { + @inlinable public convenience init(message: String? = nil, name: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [message?.jsValue() ?? .undefined, name?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/DOMImplementation.swift b/Sources/DOMKit/WebIDL/DOMImplementation.swift index e3e7a43f..e219cbfc 100644 --- a/Sources/DOMKit/WebIDL/DOMImplementation.swift +++ b/Sources/DOMKit/WebIDL/DOMImplementation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMImplementation: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMImplementation].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMImplementation].function! } public let jsObject: JSObject @@ -12,22 +12,22 @@ public class DOMImplementation: JSBridgedClass { self.jsObject = jsObject } - public func createDocumentType(qualifiedName: String, publicId: String, systemId: String) -> DocumentType { + @inlinable public func createDocumentType(qualifiedName: String, publicId: String, systemId: String) -> DocumentType { let this = jsObject return this[Strings.createDocumentType].function!(this: this, arguments: [qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()]).fromJSValue()! } - public func createDocument(namespace: String?, qualifiedName: String, doctype: DocumentType? = nil) -> XMLDocument { + @inlinable public func createDocument(namespace: String?, qualifiedName: String, doctype: DocumentType? = nil) -> XMLDocument { let this = jsObject return this[Strings.createDocument].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), doctype?.jsValue() ?? .undefined]).fromJSValue()! } - public func createHTMLDocument(title: String? = nil) -> Document { + @inlinable public func createHTMLDocument(title: String? = nil) -> Document { let this = jsObject return this[Strings.createHTMLDocument].function!(this: this, arguments: [title?.jsValue() ?? .undefined]).fromJSValue()! } - public func hasFeature() -> Bool { + @inlinable public func hasFeature() -> Bool { let this = jsObject return this[Strings.hasFeature].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index e80029b1..80d37663 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMMatrix: DOMMatrixReadOnly { - override public class var constructor: JSFunction { JSObject.global[Strings.DOMMatrix].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DOMMatrix].function! } public required init(unsafelyWrapping jsObject: JSObject) { _a = ReadWriteAttribute(jsObject: jsObject, name: Strings.a) @@ -32,7 +32,7 @@ public class DOMMatrix: DOMMatrixReadOnly { super.init(unsafelyWrapping: jsObject) } - public convenience init(init: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(init: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } @@ -45,154 +45,154 @@ public class DOMMatrix: DOMMatrixReadOnly { // XXX: illegal static override // override public static func fromFloat64Array(array64: Float64Array) -> Self - private var _a: ReadWriteAttribute - override public var a: Double { + @usableFromInline let _a: ReadWriteAttribute + @inlinable override public var a: Double { get { _a.wrappedValue } set { _a.wrappedValue = newValue } } - private var _b: ReadWriteAttribute - override public var b: Double { + @usableFromInline let _b: ReadWriteAttribute + @inlinable override public var b: Double { get { _b.wrappedValue } set { _b.wrappedValue = newValue } } - private var _c: ReadWriteAttribute - override public var c: Double { + @usableFromInline let _c: ReadWriteAttribute + @inlinable override public var c: Double { get { _c.wrappedValue } set { _c.wrappedValue = newValue } } - private var _d: ReadWriteAttribute - override public var d: Double { + @usableFromInline let _d: ReadWriteAttribute + @inlinable override public var d: Double { get { _d.wrappedValue } set { _d.wrappedValue = newValue } } - private var _e: ReadWriteAttribute - override public var e: Double { + @usableFromInline let _e: ReadWriteAttribute + @inlinable override public var e: Double { get { _e.wrappedValue } set { _e.wrappedValue = newValue } } - private var _f: ReadWriteAttribute - override public var f: Double { + @usableFromInline let _f: ReadWriteAttribute + @inlinable override public var f: Double { get { _f.wrappedValue } set { _f.wrappedValue = newValue } } - private var _m11: ReadWriteAttribute - override public var m11: Double { + @usableFromInline let _m11: ReadWriteAttribute + @inlinable override public var m11: Double { get { _m11.wrappedValue } set { _m11.wrappedValue = newValue } } - private var _m12: ReadWriteAttribute - override public var m12: Double { + @usableFromInline let _m12: ReadWriteAttribute + @inlinable override public var m12: Double { get { _m12.wrappedValue } set { _m12.wrappedValue = newValue } } - private var _m13: ReadWriteAttribute - override public var m13: Double { + @usableFromInline let _m13: ReadWriteAttribute + @inlinable override public var m13: Double { get { _m13.wrappedValue } set { _m13.wrappedValue = newValue } } - private var _m14: ReadWriteAttribute - override public var m14: Double { + @usableFromInline let _m14: ReadWriteAttribute + @inlinable override public var m14: Double { get { _m14.wrappedValue } set { _m14.wrappedValue = newValue } } - private var _m21: ReadWriteAttribute - override public var m21: Double { + @usableFromInline let _m21: ReadWriteAttribute + @inlinable override public var m21: Double { get { _m21.wrappedValue } set { _m21.wrappedValue = newValue } } - private var _m22: ReadWriteAttribute - override public var m22: Double { + @usableFromInline let _m22: ReadWriteAttribute + @inlinable override public var m22: Double { get { _m22.wrappedValue } set { _m22.wrappedValue = newValue } } - private var _m23: ReadWriteAttribute - override public var m23: Double { + @usableFromInline let _m23: ReadWriteAttribute + @inlinable override public var m23: Double { get { _m23.wrappedValue } set { _m23.wrappedValue = newValue } } - private var _m24: ReadWriteAttribute - override public var m24: Double { + @usableFromInline let _m24: ReadWriteAttribute + @inlinable override public var m24: Double { get { _m24.wrappedValue } set { _m24.wrappedValue = newValue } } - private var _m31: ReadWriteAttribute - override public var m31: Double { + @usableFromInline let _m31: ReadWriteAttribute + @inlinable override public var m31: Double { get { _m31.wrappedValue } set { _m31.wrappedValue = newValue } } - private var _m32: ReadWriteAttribute - override public var m32: Double { + @usableFromInline let _m32: ReadWriteAttribute + @inlinable override public var m32: Double { get { _m32.wrappedValue } set { _m32.wrappedValue = newValue } } - private var _m33: ReadWriteAttribute - override public var m33: Double { + @usableFromInline let _m33: ReadWriteAttribute + @inlinable override public var m33: Double { get { _m33.wrappedValue } set { _m33.wrappedValue = newValue } } - private var _m34: ReadWriteAttribute - override public var m34: Double { + @usableFromInline let _m34: ReadWriteAttribute + @inlinable override public var m34: Double { get { _m34.wrappedValue } set { _m34.wrappedValue = newValue } } - private var _m41: ReadWriteAttribute - override public var m41: Double { + @usableFromInline let _m41: ReadWriteAttribute + @inlinable override public var m41: Double { get { _m41.wrappedValue } set { _m41.wrappedValue = newValue } } - private var _m42: ReadWriteAttribute - override public var m42: Double { + @usableFromInline let _m42: ReadWriteAttribute + @inlinable override public var m42: Double { get { _m42.wrappedValue } set { _m42.wrappedValue = newValue } } - private var _m43: ReadWriteAttribute - override public var m43: Double { + @usableFromInline let _m43: ReadWriteAttribute + @inlinable override public var m43: Double { get { _m43.wrappedValue } set { _m43.wrappedValue = newValue } } - private var _m44: ReadWriteAttribute - override public var m44: Double { + @usableFromInline let _m44: ReadWriteAttribute + @inlinable override public var m44: Double { get { _m44.wrappedValue } set { _m44.wrappedValue = newValue } } - public func multiplySelf(other: DOMMatrixInit? = nil) -> Self { + @inlinable public func multiplySelf(other: DOMMatrixInit? = nil) -> Self { let this = jsObject return this[Strings.multiplySelf].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } - public func preMultiplySelf(other: DOMMatrixInit? = nil) -> Self { + @inlinable public func preMultiplySelf(other: DOMMatrixInit? = nil) -> Self { let this = jsObject return this[Strings.preMultiplySelf].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } - public func translateSelf(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> Self { + @inlinable public func translateSelf(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> Self { let this = jsObject return this[Strings.translateSelf].function!(this: this, arguments: [tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined]).fromJSValue()! } - public func scaleSelf(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { + @inlinable public func scaleSelf(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { let _arg0 = scaleX?.jsValue() ?? .undefined let _arg1 = scaleY?.jsValue() ?? .undefined let _arg2 = scaleZ?.jsValue() ?? .undefined @@ -203,42 +203,42 @@ public class DOMMatrix: DOMMatrixReadOnly { return this[Strings.scaleSelf].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } - public func scale3dSelf(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { + @inlinable public func scale3dSelf(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { let this = jsObject return this[Strings.scale3dSelf].function!(this: this, arguments: [scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined]).fromJSValue()! } - public func rotateSelf(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> Self { + @inlinable public func rotateSelf(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> Self { let this = jsObject return this[Strings.rotateSelf].function!(this: this, arguments: [rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined]).fromJSValue()! } - public func rotateFromVectorSelf(x: Double? = nil, y: Double? = nil) -> Self { + @inlinable public func rotateFromVectorSelf(x: Double? = nil, y: Double? = nil) -> Self { let this = jsObject return this[Strings.rotateFromVectorSelf].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined]).fromJSValue()! } - public func rotateAxisAngleSelf(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> Self { + @inlinable public func rotateAxisAngleSelf(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> Self { let this = jsObject return this[Strings.rotateAxisAngleSelf].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined]).fromJSValue()! } - public func skewXSelf(sx: Double? = nil) -> Self { + @inlinable public func skewXSelf(sx: Double? = nil) -> Self { let this = jsObject return this[Strings.skewXSelf].function!(this: this, arguments: [sx?.jsValue() ?? .undefined]).fromJSValue()! } - public func skewYSelf(sy: Double? = nil) -> Self { + @inlinable public func skewYSelf(sy: Double? = nil) -> Self { let this = jsObject return this[Strings.skewYSelf].function!(this: this, arguments: [sy?.jsValue() ?? .undefined]).fromJSValue()! } - public func invertSelf() -> Self { + @inlinable public func invertSelf() -> Self { let this = jsObject return this[Strings.invertSelf].function!(this: this, arguments: []).fromJSValue()! } - public func setMatrixValue(transformList: String) -> Self { + @inlinable public func setMatrixValue(transformList: String) -> Self { let this = jsObject return this[Strings.setMatrixValue].function!(this: this, arguments: [transformList.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift index 28950a42..b2d96cc9 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMMatrixReadOnly: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMMatrixReadOnly].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMMatrixReadOnly].function! } public let jsObject: JSObject @@ -36,21 +36,21 @@ public class DOMMatrixReadOnly: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(init: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } - public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self { + @inlinable public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self { let this = constructor return this[Strings.fromMatrix].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } - public static func fromFloat32Array(array32: Float32Array) -> Self { + @inlinable public static func fromFloat32Array(array32: Float32Array) -> Self { let this = constructor return this[Strings.fromFloat32Array].function!(this: this, arguments: [array32.jsValue()]).fromJSValue()! } - public static func fromFloat64Array(array64: Float64Array) -> Self { + @inlinable public static func fromFloat64Array(array64: Float64Array) -> Self { let this = constructor return this[Strings.fromFloat64Array].function!(this: this, arguments: [array64.jsValue()]).fromJSValue()! } @@ -127,12 +127,12 @@ public class DOMMatrixReadOnly: JSBridgedClass { @ReadonlyAttribute public var isIdentity: Bool - public func translate(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> DOMMatrix { + @inlinable public func translate(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> DOMMatrix { let this = jsObject return this[Strings.translate].function!(this: this, arguments: [tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined]).fromJSValue()! } - public func scale(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { + @inlinable public func scale(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { let _arg0 = scaleX?.jsValue() ?? .undefined let _arg1 = scaleY?.jsValue() ?? .undefined let _arg2 = scaleZ?.jsValue() ?? .undefined @@ -143,81 +143,81 @@ public class DOMMatrixReadOnly: JSBridgedClass { return this[Strings.scale].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } - public func scaleNonUniform(scaleX: Double? = nil, scaleY: Double? = nil) -> DOMMatrix { + @inlinable public func scaleNonUniform(scaleX: Double? = nil, scaleY: Double? = nil) -> DOMMatrix { let this = jsObject return this[Strings.scaleNonUniform].function!(this: this, arguments: [scaleX?.jsValue() ?? .undefined, scaleY?.jsValue() ?? .undefined]).fromJSValue()! } - public func scale3d(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { + @inlinable public func scale3d(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { let this = jsObject return this[Strings.scale3d].function!(this: this, arguments: [scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined]).fromJSValue()! } - public func rotate(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> DOMMatrix { + @inlinable public func rotate(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> DOMMatrix { let this = jsObject return this[Strings.rotate].function!(this: this, arguments: [rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined]).fromJSValue()! } - public func rotateFromVector(x: Double? = nil, y: Double? = nil) -> DOMMatrix { + @inlinable public func rotateFromVector(x: Double? = nil, y: Double? = nil) -> DOMMatrix { let this = jsObject return this[Strings.rotateFromVector].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined]).fromJSValue()! } - public func rotateAxisAngle(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> DOMMatrix { + @inlinable public func rotateAxisAngle(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> DOMMatrix { let this = jsObject return this[Strings.rotateAxisAngle].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined]).fromJSValue()! } - public func skewX(sx: Double? = nil) -> DOMMatrix { + @inlinable public func skewX(sx: Double? = nil) -> DOMMatrix { let this = jsObject return this[Strings.skewX].function!(this: this, arguments: [sx?.jsValue() ?? .undefined]).fromJSValue()! } - public func skewY(sy: Double? = nil) -> DOMMatrix { + @inlinable public func skewY(sy: Double? = nil) -> DOMMatrix { let this = jsObject return this[Strings.skewY].function!(this: this, arguments: [sy?.jsValue() ?? .undefined]).fromJSValue()! } - public func multiply(other: DOMMatrixInit? = nil) -> DOMMatrix { + @inlinable public func multiply(other: DOMMatrixInit? = nil) -> DOMMatrix { let this = jsObject return this[Strings.multiply].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } - public func flipX() -> DOMMatrix { + @inlinable public func flipX() -> DOMMatrix { let this = jsObject return this[Strings.flipX].function!(this: this, arguments: []).fromJSValue()! } - public func flipY() -> DOMMatrix { + @inlinable public func flipY() -> DOMMatrix { let this = jsObject return this[Strings.flipY].function!(this: this, arguments: []).fromJSValue()! } - public func inverse() -> DOMMatrix { + @inlinable public func inverse() -> DOMMatrix { let this = jsObject return this[Strings.inverse].function!(this: this, arguments: []).fromJSValue()! } - public func transformPoint(point: DOMPointInit? = nil) -> DOMPoint { + @inlinable public func transformPoint(point: DOMPointInit? = nil) -> DOMPoint { let this = jsObject return this[Strings.transformPoint].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! } - public func toFloat32Array() -> Float32Array { + @inlinable public func toFloat32Array() -> Float32Array { let this = jsObject return this[Strings.toFloat32Array].function!(this: this, arguments: []).fromJSValue()! } - public func toFloat64Array() -> Float64Array { + @inlinable public func toFloat64Array() -> Float64Array { let this = jsObject return this[Strings.toFloat64Array].function!(this: this, arguments: []).fromJSValue()! } - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMParser.swift b/Sources/DOMKit/WebIDL/DOMParser.swift index 47805989..08c98e51 100644 --- a/Sources/DOMKit/WebIDL/DOMParser.swift +++ b/Sources/DOMKit/WebIDL/DOMParser.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMParser: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMParser].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMParser].function! } public let jsObject: JSObject @@ -12,11 +12,11 @@ public class DOMParser: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public func parseFromString(string: String, type: DOMParserSupportedType) -> Document { + @inlinable public func parseFromString(string: String, type: DOMParserSupportedType) -> Document { let this = jsObject return this[Strings.parseFromString].function!(this: this, arguments: [string.jsValue(), type.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift index 019e2ca3..f1974c1a 100644 --- a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift +++ b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift @@ -10,16 +10,16 @@ public enum DOMParserSupportedType: JSString, JSValueCompatible { case applicationXhtmlXml = "application/xhtml+xml" case imageSvgXml = "image/svg+xml" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/DOMPoint.swift b/Sources/DOMKit/WebIDL/DOMPoint.swift index 9cc9d0bf..be3e681e 100644 --- a/Sources/DOMKit/WebIDL/DOMPoint.swift +++ b/Sources/DOMKit/WebIDL/DOMPoint.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMPoint: DOMPointReadOnly { - override public class var constructor: JSFunction { JSObject.global[Strings.DOMPoint].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DOMPoint].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) @@ -14,33 +14,33 @@ public class DOMPoint: DOMPointReadOnly { super.init(unsafelyWrapping: jsObject) } - public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { + @inlinable public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined])) } // XXX: illegal static override // override public static func fromPoint(other: DOMPointInit? = nil) -> Self - private var _x: ReadWriteAttribute - override public var x: Double { + @usableFromInline let _x: ReadWriteAttribute + @inlinable override public var x: Double { get { _x.wrappedValue } set { _x.wrappedValue = newValue } } - private var _y: ReadWriteAttribute - override public var y: Double { + @usableFromInline let _y: ReadWriteAttribute + @inlinable override public var y: Double { get { _y.wrappedValue } set { _y.wrappedValue = newValue } } - private var _z: ReadWriteAttribute - override public var z: Double { + @usableFromInline let _z: ReadWriteAttribute + @inlinable override public var z: Double { get { _z.wrappedValue } set { _z.wrappedValue = newValue } } - private var _w: ReadWriteAttribute - override public var w: Double { + @usableFromInline let _w: ReadWriteAttribute + @inlinable override public var w: Double { get { _w.wrappedValue } set { _w.wrappedValue = newValue } } diff --git a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift index 37df0738..4b9f1735 100644 --- a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMPointReadOnly: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMPointReadOnly].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMPointReadOnly].function! } public let jsObject: JSObject @@ -16,11 +16,11 @@ public class DOMPointReadOnly: JSBridgedClass { self.jsObject = jsObject } - public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { + @inlinable public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined])) } - public static func fromPoint(other: DOMPointInit? = nil) -> Self { + @inlinable public static func fromPoint(other: DOMPointInit? = nil) -> Self { let this = constructor return this[Strings.fromPoint].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } @@ -37,12 +37,12 @@ public class DOMPointReadOnly: JSBridgedClass { @ReadonlyAttribute public var w: Double - public func matrixTransform(matrix: DOMMatrixInit? = nil) -> DOMPoint { + @inlinable public func matrixTransform(matrix: DOMMatrixInit? = nil) -> DOMPoint { let this = jsObject return this[Strings.matrixTransform].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]).fromJSValue()! } - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMQuad.swift b/Sources/DOMKit/WebIDL/DOMQuad.swift index b07eb8f5..e2cc8d59 100644 --- a/Sources/DOMKit/WebIDL/DOMQuad.swift +++ b/Sources/DOMKit/WebIDL/DOMQuad.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMQuad: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMQuad].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMQuad].function! } public let jsObject: JSObject @@ -16,16 +16,16 @@ public class DOMQuad: JSBridgedClass { self.jsObject = jsObject } - public convenience init(p1: DOMPointInit? = nil, p2: DOMPointInit? = nil, p3: DOMPointInit? = nil, p4: DOMPointInit? = nil) { + @inlinable public convenience init(p1: DOMPointInit? = nil, p2: DOMPointInit? = nil, p3: DOMPointInit? = nil, p4: DOMPointInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [p1?.jsValue() ?? .undefined, p2?.jsValue() ?? .undefined, p3?.jsValue() ?? .undefined, p4?.jsValue() ?? .undefined])) } - public static func fromRect(other: DOMRectInit? = nil) -> Self { + @inlinable public static func fromRect(other: DOMRectInit? = nil) -> Self { let this = constructor return this[Strings.fromRect].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } - public static func fromQuad(other: DOMQuadInit? = nil) -> Self { + @inlinable public static func fromQuad(other: DOMQuadInit? = nil) -> Self { let this = constructor return this[Strings.fromQuad].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } @@ -42,12 +42,12 @@ public class DOMQuad: JSBridgedClass { @ReadonlyAttribute public var p4: DOMPoint - public func getBounds() -> DOMRect { + @inlinable public func getBounds() -> DOMRect { let this = jsObject return this[Strings.getBounds].function!(this: this, arguments: []).fromJSValue()! } - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMRect.swift b/Sources/DOMKit/WebIDL/DOMRect.swift index 283dfce1..79113a82 100644 --- a/Sources/DOMKit/WebIDL/DOMRect.swift +++ b/Sources/DOMKit/WebIDL/DOMRect.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMRect: DOMRectReadOnly { - override public class var constructor: JSFunction { JSObject.global[Strings.DOMRect].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DOMRect].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) @@ -14,33 +14,33 @@ public class DOMRect: DOMRectReadOnly { super.init(unsafelyWrapping: jsObject) } - public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { + @inlinable public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined])) } // XXX: illegal static override // override public static func fromRect(other: DOMRectInit? = nil) -> Self - private var _x: ReadWriteAttribute - override public var x: Double { + @usableFromInline let _x: ReadWriteAttribute + @inlinable override public var x: Double { get { _x.wrappedValue } set { _x.wrappedValue = newValue } } - private var _y: ReadWriteAttribute - override public var y: Double { + @usableFromInline let _y: ReadWriteAttribute + @inlinable override public var y: Double { get { _y.wrappedValue } set { _y.wrappedValue = newValue } } - private var _width: ReadWriteAttribute - override public var width: Double { + @usableFromInline let _width: ReadWriteAttribute + @inlinable override public var width: Double { get { _width.wrappedValue } set { _width.wrappedValue = newValue } } - private var _height: ReadWriteAttribute - override public var height: Double { + @usableFromInline let _height: ReadWriteAttribute + @inlinable override public var height: Double { get { _height.wrappedValue } set { _height.wrappedValue = newValue } } diff --git a/Sources/DOMKit/WebIDL/DOMRectList.swift b/Sources/DOMKit/WebIDL/DOMRectList.swift index 9ffefe9a..8884a007 100644 --- a/Sources/DOMKit/WebIDL/DOMRectList.swift +++ b/Sources/DOMKit/WebIDL/DOMRectList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMRectList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMRectList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMRectList].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class DOMRectList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> DOMRect? { + @inlinable public subscript(key: Int) -> DOMRect? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift index 40619ca7..bf63ce8a 100644 --- a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMRectReadOnly: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMRectReadOnly].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMRectReadOnly].function! } public let jsObject: JSObject @@ -20,11 +20,11 @@ public class DOMRectReadOnly: JSBridgedClass { self.jsObject = jsObject } - public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { + @inlinable public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined])) } - public static func fromRect(other: DOMRectInit? = nil) -> Self { + @inlinable public static func fromRect(other: DOMRectInit? = nil) -> Self { let this = constructor return this[Strings.fromRect].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! } @@ -53,7 +53,7 @@ public class DOMRectReadOnly: JSBridgedClass { @ReadonlyAttribute public var left: Double - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMStringList.swift b/Sources/DOMKit/WebIDL/DOMStringList.swift index 26a93531..22a49b1e 100644 --- a/Sources/DOMKit/WebIDL/DOMStringList.swift +++ b/Sources/DOMKit/WebIDL/DOMStringList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMStringList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMStringList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMStringList].function! } public let jsObject: JSObject @@ -16,11 +16,11 @@ public class DOMStringList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> String? { + @inlinable public subscript(key: Int) -> String? { jsObject[key].fromJSValue() } - public func contains(string: String) -> Bool { + @inlinable public func contains(string: String) -> Bool { let this = jsObject return this[Strings.contains].function!(this: this, arguments: [string.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMStringMap.swift b/Sources/DOMKit/WebIDL/DOMStringMap.swift index ec4a215a..ce5c6ab5 100644 --- a/Sources/DOMKit/WebIDL/DOMStringMap.swift +++ b/Sources/DOMKit/WebIDL/DOMStringMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMStringMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DOMStringMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMStringMap].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class DOMStringMap: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: String) -> String { + @inlinable public subscript(key: String) -> String { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMTokenList.swift b/Sources/DOMKit/WebIDL/DOMTokenList.swift index fa2081ee..70f8281b 100644 --- a/Sources/DOMKit/WebIDL/DOMTokenList.swift +++ b/Sources/DOMKit/WebIDL/DOMTokenList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DOMTokenList: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.DOMTokenList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DOMTokenList].function! } public let jsObject: JSObject @@ -17,36 +17,36 @@ public class DOMTokenList: JSBridgedClass, Sequence { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> String? { + @inlinable public subscript(key: Int) -> String? { jsObject[key].fromJSValue() } - public func contains(token: String) -> Bool { + @inlinable public func contains(token: String) -> Bool { let this = jsObject return this[Strings.contains].function!(this: this, arguments: [token.jsValue()]).fromJSValue()! } - public func add(tokens: String...) { + @inlinable public func add(tokens: String...) { let this = jsObject _ = this[Strings.add].function!(this: this, arguments: tokens.map { $0.jsValue() }) } - public func remove(tokens: String...) { + @inlinable public func remove(tokens: String...) { let this = jsObject _ = this[Strings.remove].function!(this: this, arguments: tokens.map { $0.jsValue() }) } - public func toggle(token: String, force: Bool? = nil) -> Bool { + @inlinable public func toggle(token: String, force: Bool? = nil) -> Bool { let this = jsObject return this[Strings.toggle].function!(this: this, arguments: [token.jsValue(), force?.jsValue() ?? .undefined]).fromJSValue()! } - public func replace(token: String, newToken: String) -> Bool { + @inlinable public func replace(token: String, newToken: String) -> Bool { let this = jsObject return this[Strings.replace].function!(this: this, arguments: [token.jsValue(), newToken.jsValue()]).fromJSValue()! } - public func supports(token: String) -> Bool { + @inlinable public func supports(token: String) -> Bool { let this = jsObject return this[Strings.supports].function!(this: this, arguments: [token.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DataCue.swift b/Sources/DOMKit/WebIDL/DataCue.swift index 1cec4275..07837fdf 100644 --- a/Sources/DOMKit/WebIDL/DataCue.swift +++ b/Sources/DOMKit/WebIDL/DataCue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DataCue: TextTrackCue { - override public class var constructor: JSFunction { JSObject.global[Strings.DataCue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DataCue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) @@ -12,7 +12,7 @@ public class DataCue: TextTrackCue { super.init(unsafelyWrapping: jsObject) } - public convenience init(startTime: Double, endTime: Double, value: JSValue, type: String? = nil) { + @inlinable public convenience init(startTime: Double, endTime: Double, value: JSValue, type: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue(), endTime.jsValue(), value.jsValue(), type?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift index 7bd0646b..2567cd76 100644 --- a/Sources/DOMKit/WebIDL/DataTransfer.swift +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DataTransfer: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DataTransfer].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DataTransfer].function! } public let jsObject: JSObject @@ -17,7 +17,7 @@ public class DataTransfer: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -30,7 +30,7 @@ public class DataTransfer: JSBridgedClass { @ReadonlyAttribute public var items: DataTransferItemList - public func setDragImage(image: Element, x: Int32, y: Int32) { + @inlinable public func setDragImage(image: Element, x: Int32, y: Int32) { let this = jsObject _ = this[Strings.setDragImage].function!(this: this, arguments: [image.jsValue(), x.jsValue(), y.jsValue()]) } @@ -38,17 +38,17 @@ public class DataTransfer: JSBridgedClass { @ReadonlyAttribute public var types: [String] - public func getData(format: String) -> String { + @inlinable public func getData(format: String) -> String { let this = jsObject return this[Strings.getData].function!(this: this, arguments: [format.jsValue()]).fromJSValue()! } - public func setData(format: String, data: String) { + @inlinable public func setData(format: String, data: String) { let this = jsObject _ = this[Strings.setData].function!(this: this, arguments: [format.jsValue(), data.jsValue()]) } - public func clearData(format: String? = nil) { + @inlinable public func clearData(format: String? = nil) { let this = jsObject _ = this[Strings.clearData].function!(this: this, arguments: [format?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index 2d6b70ef..753737de 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DataTransferItem: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DataTransferItem].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DataTransferItem].function! } public let jsObject: JSObject @@ -14,18 +14,18 @@ public class DataTransferItem: JSBridgedClass { self.jsObject = jsObject } - public func webkitGetAsEntry() -> FileSystemEntry? { + @inlinable public func webkitGetAsEntry() -> FileSystemEntry? { let this = jsObject return this[Strings.webkitGetAsEntry].function!(this: this, arguments: []).fromJSValue()! } - public func getAsFileSystemHandle() -> JSPromise { + @inlinable public func getAsFileSystemHandle() -> JSPromise { let this = jsObject return this[Strings.getAsFileSystemHandle].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getAsFileSystemHandle() async throws -> FileSystemHandle? { + @inlinable public func getAsFileSystemHandle() async throws -> FileSystemHandle? { let this = jsObject let _promise: JSPromise = this[Strings.getAsFileSystemHandle].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -39,7 +39,7 @@ public class DataTransferItem: JSBridgedClass { // XXX: member 'getAsString' is ignored - public func getAsFile() -> File? { + @inlinable public func getAsFile() -> File? { let this = jsObject return this[Strings.getAsFile].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DataTransferItemList.swift b/Sources/DOMKit/WebIDL/DataTransferItemList.swift index 9129f55e..48fe3d81 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItemList.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItemList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DataTransferItemList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DataTransferItemList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DataTransferItemList].function! } public let jsObject: JSObject @@ -16,26 +16,26 @@ public class DataTransferItemList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> DataTransferItem { + @inlinable public subscript(key: Int) -> DataTransferItem { jsObject[key].fromJSValue()! } - public func add(data: String, type: String) -> DataTransferItem? { + @inlinable public func add(data: String, type: String) -> DataTransferItem? { let this = jsObject return this[Strings.add].function!(this: this, arguments: [data.jsValue(), type.jsValue()]).fromJSValue()! } - public func add(data: File) -> DataTransferItem? { + @inlinable public func add(data: File) -> DataTransferItem? { let this = jsObject return this[Strings.add].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } - public func remove(index: UInt32) { + @inlinable public func remove(index: UInt32) { let this = jsObject _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue()]) } - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/DecompressionStream.swift b/Sources/DOMKit/WebIDL/DecompressionStream.swift index db0136c2..3603e556 100644 --- a/Sources/DOMKit/WebIDL/DecompressionStream.swift +++ b/Sources/DOMKit/WebIDL/DecompressionStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DecompressionStream: JSBridgedClass, GenericTransformStream { - public class var constructor: JSFunction { JSObject.global[Strings.DecompressionStream].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DecompressionStream].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class DecompressionStream: JSBridgedClass, GenericTransformStream { self.jsObject = jsObject } - public convenience init(format: String) { + @inlinable public convenience init(format: String) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue()])) } } diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift index 6698e647..54e0d630 100644 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvider { - override public class var constructor: JSFunction { JSObject.global[Strings.DedicatedWorkerGlobalScope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DedicatedWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) @@ -17,17 +17,17 @@ public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvid @ReadonlyAttribute public var name: String - public func postMessage(message: JSValue, transfer: [JSObject]) { + @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } - public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/DelayNode.swift b/Sources/DOMKit/WebIDL/DelayNode.swift index 052b2d0b..9ea06e52 100644 --- a/Sources/DOMKit/WebIDL/DelayNode.swift +++ b/Sources/DOMKit/WebIDL/DelayNode.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class DelayNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.DelayNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DelayNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _delayTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.delayTime) super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: DelayOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: DelayOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/DeprecationReportBody.swift b/Sources/DOMKit/WebIDL/DeprecationReportBody.swift index 906e90b8..ee44deb5 100644 --- a/Sources/DOMKit/WebIDL/DeprecationReportBody.swift +++ b/Sources/DOMKit/WebIDL/DeprecationReportBody.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DeprecationReportBody: ReportBody { - override public class var constructor: JSFunction { JSObject.global[Strings.DeprecationReportBody].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DeprecationReportBody].function! } public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) @@ -16,7 +16,7 @@ public class DeprecationReportBody: ReportBody { super.init(unsafelyWrapping: jsObject) } - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift index 2125c8f6..4a7ef2a4 100644 --- a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift +++ b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DeviceMotionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _acceleration = ReadonlyAttribute(jsObject: jsObject, name: Strings.acceleration) @@ -14,7 +14,7 @@ public class DeviceMotionEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: DeviceMotionEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: DeviceMotionEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -30,13 +30,13 @@ public class DeviceMotionEvent: Event { @ReadonlyAttribute public var interval: Double - public static func requestPermission() -> JSPromise { + @inlinable public static func requestPermission() -> JSPromise { let this = constructor return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func requestPermission() async throws -> PermissionState { + @inlinable public static func requestPermission() async throws -> PermissionState { let this = constructor let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift index 2b499413..3c9b148a 100644 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DeviceMotionEventAcceleration: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEventAcceleration].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEventAcceleration].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift index 595bfdbb..916ea7a8 100644 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DeviceMotionEventRotationRate: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEventRotationRate].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEventRotationRate].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift index f0f8fa99..cfd8338d 100644 --- a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift +++ b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DeviceOrientationEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.DeviceOrientationEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DeviceOrientationEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _alpha = ReadonlyAttribute(jsObject: jsObject, name: Strings.alpha) @@ -14,7 +14,7 @@ public class DeviceOrientationEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: DeviceOrientationEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: DeviceOrientationEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -30,13 +30,13 @@ public class DeviceOrientationEvent: Event { @ReadonlyAttribute public var absolute: Bool - public static func requestPermission() -> JSPromise { + @inlinable public static func requestPermission() -> JSPromise { let this = constructor return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func requestPermission() async throws -> PermissionState { + @inlinable public static func requestPermission() async throws -> PermissionState { let this = constructor let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/DevicePosture.swift b/Sources/DOMKit/WebIDL/DevicePosture.swift index a7aa08b2..5a318c1b 100644 --- a/Sources/DOMKit/WebIDL/DevicePosture.swift +++ b/Sources/DOMKit/WebIDL/DevicePosture.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DevicePosture: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.DevicePosture].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DevicePosture].function! } public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) diff --git a/Sources/DOMKit/WebIDL/DevicePostureType.swift b/Sources/DOMKit/WebIDL/DevicePostureType.swift index dedffc7c..55b542b6 100644 --- a/Sources/DOMKit/WebIDL/DevicePostureType.swift +++ b/Sources/DOMKit/WebIDL/DevicePostureType.swift @@ -8,16 +8,16 @@ public enum DevicePostureType: JSString, JSValueCompatible { case folded = "folded" case foldedOver = "folded-over" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/DigitalGoodsService.swift b/Sources/DOMKit/WebIDL/DigitalGoodsService.swift index 30435f79..be1211f3 100644 --- a/Sources/DOMKit/WebIDL/DigitalGoodsService.swift +++ b/Sources/DOMKit/WebIDL/DigitalGoodsService.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DigitalGoodsService: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.DigitalGoodsService].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DigitalGoodsService].function! } public let jsObject: JSObject @@ -12,49 +12,49 @@ public class DigitalGoodsService: JSBridgedClass { self.jsObject = jsObject } - public func getDetails(itemIds: [String]) -> JSPromise { + @inlinable public func getDetails(itemIds: [String]) -> JSPromise { let this = jsObject return this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDetails(itemIds: [String]) async throws -> [ItemDetails] { + @inlinable public func getDetails(itemIds: [String]) async throws -> [ItemDetails] { let this = jsObject let _promise: JSPromise = this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func listPurchases() -> JSPromise { + @inlinable public func listPurchases() -> JSPromise { let this = jsObject return this[Strings.listPurchases].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func listPurchases() async throws -> [PurchaseDetails] { + @inlinable public func listPurchases() async throws -> [PurchaseDetails] { let this = jsObject let _promise: JSPromise = this[Strings.listPurchases].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func listPurchaseHistory() -> JSPromise { + @inlinable public func listPurchaseHistory() -> JSPromise { let this = jsObject return this[Strings.listPurchaseHistory].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func listPurchaseHistory() async throws -> [PurchaseDetails] { + @inlinable public func listPurchaseHistory() async throws -> [PurchaseDetails] { let this = jsObject let _promise: JSPromise = this[Strings.listPurchaseHistory].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func consume(purchaseToken: String) -> JSPromise { + @inlinable public func consume(purchaseToken: String) -> JSPromise { let this = jsObject return this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func consume(purchaseToken: String) async throws { + @inlinable public func consume(purchaseToken: String) async throws { let this = jsObject let _promise: JSPromise = this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue()]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/DirectionSetting.swift b/Sources/DOMKit/WebIDL/DirectionSetting.swift index ac6f24c7..0b76fce4 100644 --- a/Sources/DOMKit/WebIDL/DirectionSetting.swift +++ b/Sources/DOMKit/WebIDL/DirectionSetting.swift @@ -8,16 +8,16 @@ public enum DirectionSetting: JSString, JSValueCompatible { case rl = "rl" case lr = "lr" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift b/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift index cc43ddf9..485a9b60 100644 --- a/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift +++ b/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift @@ -9,16 +9,16 @@ public enum DisplayCaptureSurfaceType: JSString, JSValueCompatible { case application = "application" case browser = "browser" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/DistanceModelType.swift b/Sources/DOMKit/WebIDL/DistanceModelType.swift index d09f08a5..0d13990b 100644 --- a/Sources/DOMKit/WebIDL/DistanceModelType.swift +++ b/Sources/DOMKit/WebIDL/DistanceModelType.swift @@ -8,16 +8,16 @@ public enum DistanceModelType: JSString, JSValueCompatible { case inverse = "inverse" case exponential = "exponential" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 2d4fdfad..5142fb2f 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { - override public class var constructor: JSFunction { JSObject.global[Strings.Document].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Document].function! } public required init(unsafelyWrapping jsObject: JSObject) { _rootElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootElement) @@ -73,17 +73,17 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var namedFlows: NamedFlowMap - public func elementFromPoint(x: Double, y: Double) -> Element? { + @inlinable public func elementFromPoint(x: Double, y: Double) -> Element? { let this = jsObject return this[Strings.elementFromPoint].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } - public func elementsFromPoint(x: Double, y: Double) -> [Element] { + @inlinable public func elementsFromPoint(x: Double, y: Double) -> [Element] { let this = jsObject return this[Strings.elementsFromPoint].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } - public func caretPositionFromPoint(x: Double, y: Double) -> CaretPosition? { + @inlinable public func caretPositionFromPoint(x: Double, y: Double) -> CaretPosition? { let this = jsObject return this[Strings.caretPositionFromPoint].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } @@ -91,7 +91,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var scrollingElement: Element? - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -125,82 +125,82 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var documentElement: Element? - public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { + @inlinable public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { let this = jsObject return this[Strings.getElementsByTagName].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } - public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { + @inlinable public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { let this = jsObject return this[Strings.getElementsByTagNameNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } - public func getElementsByClassName(classNames: String) -> HTMLCollection { + @inlinable public func getElementsByClassName(classNames: String) -> HTMLCollection { let this = jsObject return this[Strings.getElementsByClassName].function!(this: this, arguments: [classNames.jsValue()]).fromJSValue()! } - public func createElement(localName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { + @inlinable public func createElement(localName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { let this = jsObject return this[Strings.createElement].function!(this: this, arguments: [localName.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func createElementNS(namespace: String?, qualifiedName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { + @inlinable public func createElementNS(namespace: String?, qualifiedName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { let this = jsObject return this[Strings.createElementNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func createDocumentFragment() -> DocumentFragment { + @inlinable public func createDocumentFragment() -> DocumentFragment { let this = jsObject return this[Strings.createDocumentFragment].function!(this: this, arguments: []).fromJSValue()! } - public func createTextNode(data: String) -> Text { + @inlinable public func createTextNode(data: String) -> Text { let this = jsObject return this[Strings.createTextNode].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } - public func createCDATASection(data: String) -> CDATASection { + @inlinable public func createCDATASection(data: String) -> CDATASection { let this = jsObject return this[Strings.createCDATASection].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } - public func createComment(data: String) -> Comment { + @inlinable public func createComment(data: String) -> Comment { let this = jsObject return this[Strings.createComment].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } - public func createProcessingInstruction(target: String, data: String) -> ProcessingInstruction { + @inlinable public func createProcessingInstruction(target: String, data: String) -> ProcessingInstruction { let this = jsObject return this[Strings.createProcessingInstruction].function!(this: this, arguments: [target.jsValue(), data.jsValue()]).fromJSValue()! } - public func importNode(node: Node, deep: Bool? = nil) -> Node { + @inlinable public func importNode(node: Node, deep: Bool? = nil) -> Node { let this = jsObject return this[Strings.importNode].function!(this: this, arguments: [node.jsValue(), deep?.jsValue() ?? .undefined]).fromJSValue()! } - public func adoptNode(node: Node) -> Node { + @inlinable public func adoptNode(node: Node) -> Node { let this = jsObject return this[Strings.adoptNode].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! } - public func createAttribute(localName: String) -> Attr { + @inlinable public func createAttribute(localName: String) -> Attr { let this = jsObject return this[Strings.createAttribute].function!(this: this, arguments: [localName.jsValue()]).fromJSValue()! } - public func createAttributeNS(namespace: String?, qualifiedName: String) -> Attr { + @inlinable public func createAttributeNS(namespace: String?, qualifiedName: String) -> Attr { let this = jsObject return this[Strings.createAttributeNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue()]).fromJSValue()! } - public func createEvent(interface: String) -> Event { + @inlinable public func createEvent(interface: String) -> Event { let this = jsObject return this[Strings.createEvent].function!(this: this, arguments: [interface.jsValue()]).fromJSValue()! } - public func createRange() -> Range { + @inlinable public func createRange() -> Range { let this = jsObject return this[Strings.createRange].function!(this: this, arguments: []).fromJSValue()! } @@ -209,12 +209,12 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode // XXX: member 'createTreeWalker' is ignored - public func measureElement(element: Element) -> FontMetrics { + @inlinable public func measureElement(element: Element) -> FontMetrics { let this = jsObject return this[Strings.measureElement].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! } - public func measureText(text: String, styleMap: StylePropertyMapReadOnly) -> FontMetrics { + @inlinable public func measureText(text: String, styleMap: StylePropertyMapReadOnly) -> FontMetrics { let this = jsObject return this[Strings.measureText].function!(this: this, arguments: [text.jsValue(), styleMap.jsValue()]).fromJSValue()! } @@ -225,13 +225,13 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var fullscreen: Bool - public func exitFullscreen() -> JSPromise { + @inlinable public func exitFullscreen() -> JSPromise { let this = jsObject return this[Strings.exitFullscreen].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func exitFullscreen() async throws { + @inlinable public func exitFullscreen() async throws { let this = jsObject let _promise: JSPromise = this[Strings.exitFullscreen].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() @@ -261,7 +261,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var readyState: DocumentReadyState - public subscript(key: String) -> JSObject { + @inlinable public subscript(key: String) -> JSObject { jsObject[key].fromJSValue()! } @@ -295,7 +295,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var scripts: HTMLCollection - public func getElementsByName(elementName: String) -> NodeList { + @inlinable public func getElementsByName(elementName: String) -> NodeList { let this = jsObject return this[Strings.getElementsByName].function!(this: this, arguments: [elementName.jsValue()]).fromJSValue()! } @@ -303,27 +303,27 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var currentScript: HTMLOrSVGScriptElement? - public func open(unused1: String? = nil, unused2: String? = nil) -> Self { + @inlinable public func open(unused1: String? = nil, unused2: String? = nil) -> Self { let this = jsObject return this[Strings.open].function!(this: this, arguments: [unused1?.jsValue() ?? .undefined, unused2?.jsValue() ?? .undefined]).fromJSValue()! } - public func open(url: String, name: String, features: String) -> WindowProxy? { + @inlinable public func open(url: String, name: String, features: String) -> WindowProxy? { let this = jsObject return this[Strings.open].function!(this: this, arguments: [url.jsValue(), name.jsValue(), features.jsValue()]).fromJSValue()! } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public func write(text: String...) { + @inlinable public func write(text: String...) { let this = jsObject _ = this[Strings.write].function!(this: this, arguments: text.map { $0.jsValue() }) } - public func writeln(text: String...) { + @inlinable public func writeln(text: String...) { let this = jsObject _ = this[Strings.writeln].function!(this: this, arguments: text.map { $0.jsValue() }) } @@ -331,7 +331,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var defaultView: WindowProxy? - public func hasFocus() -> Bool { + @inlinable public func hasFocus() -> Bool { let this = jsObject return this[Strings.hasFocus].function!(this: this, arguments: []).fromJSValue()! } @@ -339,32 +339,32 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadWriteAttribute public var designMode: String - public func execCommand(commandId: String, showUI: Bool? = nil, value: String? = nil) -> Bool { + @inlinable public func execCommand(commandId: String, showUI: Bool? = nil, value: String? = nil) -> Bool { let this = jsObject return this[Strings.execCommand].function!(this: this, arguments: [commandId.jsValue(), showUI?.jsValue() ?? .undefined, value?.jsValue() ?? .undefined]).fromJSValue()! } - public func queryCommandEnabled(commandId: String) -> Bool { + @inlinable public func queryCommandEnabled(commandId: String) -> Bool { let this = jsObject return this[Strings.queryCommandEnabled].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } - public func queryCommandIndeterm(commandId: String) -> Bool { + @inlinable public func queryCommandIndeterm(commandId: String) -> Bool { let this = jsObject return this[Strings.queryCommandIndeterm].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } - public func queryCommandState(commandId: String) -> Bool { + @inlinable public func queryCommandState(commandId: String) -> Bool { let this = jsObject return this[Strings.queryCommandState].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } - public func queryCommandSupported(commandId: String) -> Bool { + @inlinable public func queryCommandSupported(commandId: String) -> Bool { let this = jsObject return this[Strings.queryCommandSupported].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } - public func queryCommandValue(commandId: String) -> String { + @inlinable public func queryCommandValue(commandId: String) -> String { let this = jsObject return this[Strings.queryCommandValue].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! } @@ -402,17 +402,17 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var applets: HTMLCollection - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } - public func captureEvents() { + @inlinable public func captureEvents() { let this = jsObject _ = this[Strings.captureEvents].function!(this: this, arguments: []) } - public func releaseEvents() { + @inlinable public func releaseEvents() { let this = jsObject _ = this[Strings.releaseEvents].function!(this: this, arguments: []) } @@ -435,13 +435,13 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var pictureInPictureEnabled: Bool - public func exitPictureInPicture() -> JSPromise { + @inlinable public func exitPictureInPicture() -> JSPromise { let this = jsObject return this[Strings.exitPictureInPicture].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func exitPictureInPicture() async throws { + @inlinable public func exitPictureInPicture() async throws { let this = jsObject let _promise: JSPromise = this[Strings.exitPictureInPicture].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() @@ -453,7 +453,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ClosureAttribute1Optional public var onpointerlockerror: EventHandler - public func exitPointerLock() { + @inlinable public func exitPointerLock() { let this = jsObject _ = this[Strings.exitPointerLock].function!(this: this, arguments: []) } @@ -461,30 +461,30 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var fragmentDirective: FragmentDirective - public func getSelection() -> Selection? { + @inlinable public func getSelection() -> Selection? { let this = jsObject return this[Strings.getSelection].function!(this: this, arguments: []).fromJSValue()! } - public func hasStorageAccess() -> JSPromise { + @inlinable public func hasStorageAccess() -> JSPromise { let this = jsObject return this[Strings.hasStorageAccess].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func hasStorageAccess() async throws -> Bool { + @inlinable public func hasStorageAccess() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.hasStorageAccess].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func requestStorageAccess() -> JSPromise { + @inlinable public func requestStorageAccess() -> JSPromise { let this = jsObject return this[Strings.requestStorageAccess].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestStorageAccess() async throws { + @inlinable public func requestStorageAccess() async throws { let this = jsObject let _promise: JSPromise = this[Strings.requestStorageAccess].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift index ecdb3ea4..f55472ee 100644 --- a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift @@ -5,17 +5,17 @@ import JavaScriptKit public protocol DocumentAndElementEventHandlers: JSBridgedClass {} public extension DocumentAndElementEventHandlers { - var oncopy: EventHandler { + @inlinable var oncopy: EventHandler { get { ClosureAttribute1Optional[Strings.oncopy, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncopy, in: jsObject] = newValue } } - var oncut: EventHandler { + @inlinable var oncut: EventHandler { get { ClosureAttribute1Optional[Strings.oncut, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncut, in: jsObject] = newValue } } - var onpaste: EventHandler { + @inlinable var onpaste: EventHandler { get { ClosureAttribute1Optional[Strings.onpaste, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpaste, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/DocumentFragment.swift b/Sources/DOMKit/WebIDL/DocumentFragment.swift index e3661620..f8155865 100644 --- a/Sources/DOMKit/WebIDL/DocumentFragment.swift +++ b/Sources/DOMKit/WebIDL/DocumentFragment.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class DocumentFragment: Node, NonElementParentNode, ParentNode { - override public class var constructor: JSFunction { JSObject.global[Strings.DocumentFragment].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DocumentFragment].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index fa75f535..cc98f674 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol DocumentOrShadowRoot: JSBridgedClass {} public extension DocumentOrShadowRoot { - var styleSheets: StyleSheetList { ReadonlyAttribute[Strings.styleSheets, in: jsObject] } + @inlinable var styleSheets: StyleSheetList { ReadonlyAttribute[Strings.styleSheets, in: jsObject] } - var adoptedStyleSheets: [CSSStyleSheet] { + @inlinable var adoptedStyleSheets: [CSSStyleSheet] { get { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] } set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } } - var fullscreenElement: Element? { ReadonlyAttribute[Strings.fullscreenElement, in: jsObject] } + @inlinable var fullscreenElement: Element? { ReadonlyAttribute[Strings.fullscreenElement, in: jsObject] } - var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } + @inlinable var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } - var pictureInPictureElement: Element? { ReadonlyAttribute[Strings.pictureInPictureElement, in: jsObject] } + @inlinable var pictureInPictureElement: Element? { ReadonlyAttribute[Strings.pictureInPictureElement, in: jsObject] } - var pointerLockElement: Element? { ReadonlyAttribute[Strings.pointerLockElement, in: jsObject] } + @inlinable var pointerLockElement: Element? { ReadonlyAttribute[Strings.pointerLockElement, in: jsObject] } - func getAnimations() -> [Animation] { + @inlinable func getAnimations() -> [Animation] { let this = jsObject return this[Strings.getAnimations].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DocumentReadyState.swift b/Sources/DOMKit/WebIDL/DocumentReadyState.swift index e69ad4c9..0d368e16 100644 --- a/Sources/DOMKit/WebIDL/DocumentReadyState.swift +++ b/Sources/DOMKit/WebIDL/DocumentReadyState.swift @@ -8,16 +8,16 @@ public enum DocumentReadyState: JSString, JSValueCompatible { case interactive = "interactive" case complete = "complete" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/DocumentTimeline.swift b/Sources/DOMKit/WebIDL/DocumentTimeline.swift index 16c9f60f..f32ade2a 100644 --- a/Sources/DOMKit/WebIDL/DocumentTimeline.swift +++ b/Sources/DOMKit/WebIDL/DocumentTimeline.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class DocumentTimeline: AnimationTimeline { - override public class var constructor: JSFunction { JSObject.global[Strings.DocumentTimeline].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DocumentTimeline].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: DocumentTimelineOptions? = nil) { + @inlinable public convenience init(options: DocumentTimelineOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/DocumentType.swift b/Sources/DOMKit/WebIDL/DocumentType.swift index 5718c25c..c8969178 100644 --- a/Sources/DOMKit/WebIDL/DocumentType.swift +++ b/Sources/DOMKit/WebIDL/DocumentType.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DocumentType: Node, ChildNode { - override public class var constructor: JSFunction { JSObject.global[Strings.DocumentType].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DocumentType].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) diff --git a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift index 9f63b9f6..de18f2e0 100644 --- a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift +++ b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift @@ -7,16 +7,16 @@ public enum DocumentVisibilityState: JSString, JSValueCompatible { case visible = "visible" case hidden = "hidden" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/DragEvent.swift b/Sources/DOMKit/WebIDL/DragEvent.swift index b18e6faa..4fbcdd34 100644 --- a/Sources/DOMKit/WebIDL/DragEvent.swift +++ b/Sources/DOMKit/WebIDL/DragEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class DragEvent: MouseEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.DragEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DragEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: DragEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: DragEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift b/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift index f43b6b1d..91ecce9a 100644 --- a/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift +++ b/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DynamicsCompressorNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.DynamicsCompressorNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DynamicsCompressorNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _threshold = ReadonlyAttribute(jsObject: jsObject, name: Strings.threshold) @@ -16,7 +16,7 @@ public class DynamicsCompressorNode: AudioNode { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: DynamicsCompressorOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: DynamicsCompressorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift b/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift index 80bb0238..d5ac5a2c 100644 --- a/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift +++ b/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_blend_minmax: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_blend_minmax].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_blend_minmax].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift b/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift index 0f79c235..f52555be 100644 --- a/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift +++ b/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_clip_cull_distance: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_clip_cull_distance].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_clip_cull_distance].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift b/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift index d704efd9..fa0a6d85 100644 --- a/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift +++ b/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_color_buffer_float: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_color_buffer_float].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_color_buffer_float].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift b/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift index 111c927f..84010257 100644 --- a/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift +++ b/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_color_buffer_half_float: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_color_buffer_half_float].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_color_buffer_half_float].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift index d358b72a..15afc255 100644 --- a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift +++ b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_disjoint_timer_query: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_disjoint_timer_query].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_disjoint_timer_query].function! } public let jsObject: JSObject @@ -26,42 +26,42 @@ public class EXT_disjoint_timer_query: JSBridgedClass { public static let GPU_DISJOINT_EXT: GLenum = 0x8FBB - public func createQueryEXT() -> WebGLTimerQueryEXT? { + @inlinable public func createQueryEXT() -> WebGLTimerQueryEXT? { let this = jsObject return this[Strings.createQueryEXT].function!(this: this, arguments: []).fromJSValue()! } - public func deleteQueryEXT(query: WebGLTimerQueryEXT?) { + @inlinable public func deleteQueryEXT(query: WebGLTimerQueryEXT?) { let this = jsObject _ = this[Strings.deleteQueryEXT].function!(this: this, arguments: [query.jsValue()]) } - public func isQueryEXT(query: WebGLTimerQueryEXT?) -> Bool { + @inlinable public func isQueryEXT(query: WebGLTimerQueryEXT?) -> Bool { let this = jsObject return this[Strings.isQueryEXT].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } - public func beginQueryEXT(target: GLenum, query: WebGLTimerQueryEXT) { + @inlinable public func beginQueryEXT(target: GLenum, query: WebGLTimerQueryEXT) { let this = jsObject _ = this[Strings.beginQueryEXT].function!(this: this, arguments: [target.jsValue(), query.jsValue()]) } - public func endQueryEXT(target: GLenum) { + @inlinable public func endQueryEXT(target: GLenum) { let this = jsObject _ = this[Strings.endQueryEXT].function!(this: this, arguments: [target.jsValue()]) } - public func queryCounterEXT(query: WebGLTimerQueryEXT, target: GLenum) { + @inlinable public func queryCounterEXT(query: WebGLTimerQueryEXT, target: GLenum) { let this = jsObject _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue(), target.jsValue()]) } - public func getQueryEXT(target: GLenum, pname: GLenum) -> JSValue { + @inlinable public func getQueryEXT(target: GLenum, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getQueryEXT].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } - public func getQueryObjectEXT(query: WebGLTimerQueryEXT, pname: GLenum) -> JSValue { + @inlinable public func getQueryObjectEXT(query: WebGLTimerQueryEXT, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getQueryObjectEXT].function!(this: this, arguments: [query.jsValue(), pname.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift index 792da064..08a2bbe8 100644 --- a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift +++ b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_disjoint_timer_query_webgl2: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_disjoint_timer_query_webgl2].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_disjoint_timer_query_webgl2].function! } public let jsObject: JSObject @@ -20,7 +20,7 @@ public class EXT_disjoint_timer_query_webgl2: JSBridgedClass { public static let GPU_DISJOINT_EXT: GLenum = 0x8FBB - public func queryCounterEXT(query: WebGLQuery, target: GLenum) { + @inlinable public func queryCounterEXT(query: WebGLQuery, target: GLenum) { let this = jsObject _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue(), target.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/EXT_float_blend.swift b/Sources/DOMKit/WebIDL/EXT_float_blend.swift index 34a3eea5..e600de77 100644 --- a/Sources/DOMKit/WebIDL/EXT_float_blend.swift +++ b/Sources/DOMKit/WebIDL/EXT_float_blend.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_float_blend: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_float_blend].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_float_blend].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_frag_depth.swift b/Sources/DOMKit/WebIDL/EXT_frag_depth.swift index 2d590411..8090bc01 100644 --- a/Sources/DOMKit/WebIDL/EXT_frag_depth.swift +++ b/Sources/DOMKit/WebIDL/EXT_frag_depth.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_frag_depth: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_frag_depth].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_frag_depth].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_sRGB.swift b/Sources/DOMKit/WebIDL/EXT_sRGB.swift index bc1f5e66..d23f4cfe 100644 --- a/Sources/DOMKit/WebIDL/EXT_sRGB.swift +++ b/Sources/DOMKit/WebIDL/EXT_sRGB.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_sRGB: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_sRGB].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_sRGB].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift b/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift index 70b0e369..2001785e 100644 --- a/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift +++ b/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_shader_texture_lod: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_shader_texture_lod].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_shader_texture_lod].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift b/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift index 52714a67..d0b81315 100644 --- a/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift +++ b/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_texture_compression_bptc: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_compression_bptc].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_compression_bptc].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift b/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift index 70a69c79..b01c06ba 100644 --- a/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift +++ b/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_texture_compression_rgtc: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_compression_rgtc].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_compression_rgtc].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift b/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift index 56fb332d..f313993c 100644 --- a/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift +++ b/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_texture_filter_anisotropic: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_filter_anisotropic].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_filter_anisotropic].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift b/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift index 36a59a84..6b4af7db 100644 --- a/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift +++ b/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EXT_texture_norm16: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_norm16].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_norm16].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/Edge.swift b/Sources/DOMKit/WebIDL/Edge.swift index 0615fb2d..b506c928 100644 --- a/Sources/DOMKit/WebIDL/Edge.swift +++ b/Sources/DOMKit/WebIDL/Edge.swift @@ -7,16 +7,16 @@ public enum Edge: JSString, JSValueCompatible { case start = "start" case end = "end" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/EditContext.swift b/Sources/DOMKit/WebIDL/EditContext.swift index 7ca42419..14cec2a8 100644 --- a/Sources/DOMKit/WebIDL/EditContext.swift +++ b/Sources/DOMKit/WebIDL/EditContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EditContext: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.EditContext].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.EditContext].function! } public required init(unsafelyWrapping jsObject: JSObject) { _text = ReadonlyAttribute(jsObject: jsObject, name: Strings.text) @@ -24,36 +24,36 @@ public class EditContext: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: EditContextInit? = nil) { + @inlinable public convenience init(options: EditContextInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } - public func updateText(rangeStart: UInt32, rangeEnd: UInt32, text: String) { + @inlinable public func updateText(rangeStart: UInt32, rangeEnd: UInt32, text: String) { let this = jsObject _ = this[Strings.updateText].function!(this: this, arguments: [rangeStart.jsValue(), rangeEnd.jsValue(), text.jsValue()]) } - public func updateSelection(start: UInt32, end: UInt32) { + @inlinable public func updateSelection(start: UInt32, end: UInt32) { let this = jsObject _ = this[Strings.updateSelection].function!(this: this, arguments: [start.jsValue(), end.jsValue()]) } - public func updateControlBound(controlBound: DOMRect) { + @inlinable public func updateControlBound(controlBound: DOMRect) { let this = jsObject _ = this[Strings.updateControlBound].function!(this: this, arguments: [controlBound.jsValue()]) } - public func updateSelectionBound(selectionBound: DOMRect) { + @inlinable public func updateSelectionBound(selectionBound: DOMRect) { let this = jsObject _ = this[Strings.updateSelectionBound].function!(this: this, arguments: [selectionBound.jsValue()]) } - public func updateCharacterBounds(rangeStart: UInt32, characterBounds: [DOMRect]) { + @inlinable public func updateCharacterBounds(rangeStart: UInt32, characterBounds: [DOMRect]) { let this = jsObject _ = this[Strings.updateCharacterBounds].function!(this: this, arguments: [rangeStart.jsValue(), characterBounds.jsValue()]) } - public func attachedElements() -> [Element] { + @inlinable public func attachedElements() -> [Element] { let this = jsObject return this[Strings.attachedElements].function!(this: this, arguments: []).fromJSValue()! } @@ -85,7 +85,7 @@ public class EditContext: EventTarget { @ReadonlyAttribute public var characterBoundsRangeStart: UInt32 - public func characterBounds() -> [DOMRect] { + @inlinable public func characterBounds() -> [DOMRect] { let this = jsObject return this[Strings.characterBounds].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift b/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift index 10ae3f48..0de9fab7 100644 --- a/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift +++ b/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift @@ -9,16 +9,16 @@ public enum EffectiveConnectionType: JSString, JSValueCompatible { case _4g = "4g" case slow2g = "slow-2g" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index dac83237..17677b80 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin, Animatable { - override public class var constructor: JSFunction { JSObject.global[Strings.Element].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Element].function! } public required init(unsafelyWrapping jsObject: JSObject) { _outerHTML = ReadWriteAttribute(jsObject: jsObject, name: Strings.outerHTML) @@ -37,27 +37,27 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @ReadWriteAttribute public var outerHTML: String - public func insertAdjacentHTML(position: String, text: String) { + @inlinable public func insertAdjacentHTML(position: String, text: String) { let this = jsObject _ = this[Strings.insertAdjacentHTML].function!(this: this, arguments: [position.jsValue(), text.jsValue()]) } - public func getSpatialNavigationContainer() -> Node { + @inlinable public func getSpatialNavigationContainer() -> Node { let this = jsObject return this[Strings.getSpatialNavigationContainer].function!(this: this, arguments: []).fromJSValue()! } - public func focusableAreas(option: FocusableAreasOption? = nil) -> [Node] { + @inlinable public func focusableAreas(option: FocusableAreasOption? = nil) -> [Node] { let this = jsObject return this[Strings.focusableAreas].function!(this: this, arguments: [option?.jsValue() ?? .undefined]).fromJSValue()! } - public func spatialNavigationSearch(dir: SpatialNavigationDirection, options: SpatialNavigationSearchOptions? = nil) -> Node? { + @inlinable public func spatialNavigationSearch(dir: SpatialNavigationDirection, options: SpatialNavigationSearchOptions? = nil) -> Node? { let this = jsObject return this[Strings.spatialNavigationSearch].function!(this: this, arguments: [dir.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func pseudo(type: String) -> CSSPseudoElement? { + @inlinable public func pseudo(type: String) -> CSSPseudoElement? { let this = jsObject return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } @@ -65,57 +65,57 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @ReadonlyAttribute public var part: DOMTokenList - public func computedStyleMap() -> StylePropertyMapReadOnly { + @inlinable public func computedStyleMap() -> StylePropertyMapReadOnly { let this = jsObject return this[Strings.computedStyleMap].function!(this: this, arguments: []).fromJSValue()! } - public func getClientRects() -> DOMRectList { + @inlinable public func getClientRects() -> DOMRectList { let this = jsObject return this[Strings.getClientRects].function!(this: this, arguments: []).fromJSValue()! } - public func getBoundingClientRect() -> DOMRect { + @inlinable public func getBoundingClientRect() -> DOMRect { let this = jsObject return this[Strings.getBoundingClientRect].function!(this: this, arguments: []).fromJSValue()! } - public func isVisible(options: IsVisibleOptions? = nil) -> Bool { + @inlinable public func isVisible(options: IsVisibleOptions? = nil) -> Bool { let this = jsObject return this[Strings.isVisible].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func scrollIntoView(arg: __UNSUPPORTED_UNION__? = nil) { + @inlinable public func scrollIntoView(arg: __UNSUPPORTED_UNION__? = nil) { let this = jsObject _ = this[Strings.scrollIntoView].function!(this: this, arguments: [arg?.jsValue() ?? .undefined]) } - public func scroll(options: ScrollToOptions? = nil) { + @inlinable public func scroll(options: ScrollToOptions? = nil) { let this = jsObject _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } - public func scroll(x: Double, y: Double) { + @inlinable public func scroll(x: Double, y: Double) { let this = jsObject _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - public func scrollTo(options: ScrollToOptions? = nil) { + @inlinable public func scrollTo(options: ScrollToOptions? = nil) { let this = jsObject _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } - public func scrollTo(x: Double, y: Double) { + @inlinable public func scrollTo(x: Double, y: Double) { let this = jsObject _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - public func scrollBy(options: ScrollToOptions? = nil) { + @inlinable public func scrollBy(options: ScrollToOptions? = nil) { let this = jsObject _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } - public func scrollBy(x: Double, y: Double) { + @inlinable public func scrollBy(x: Double, y: Double) { let this = jsObject _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } @@ -168,7 +168,7 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @ReadWriteAttribute public var slot: String - public func hasAttributes() -> Bool { + @inlinable public func hasAttributes() -> Bool { let this = jsObject return this[Strings.hasAttributes].function!(this: this, arguments: []).fromJSValue()! } @@ -176,82 +176,82 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @ReadonlyAttribute public var attributes: NamedNodeMap - public func getAttributeNames() -> [String] { + @inlinable public func getAttributeNames() -> [String] { let this = jsObject return this[Strings.getAttributeNames].function!(this: this, arguments: []).fromJSValue()! } - public func getAttribute(qualifiedName: String) -> String? { + @inlinable public func getAttribute(qualifiedName: String) -> String? { let this = jsObject return this[Strings.getAttribute].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } - public func getAttributeNS(namespace: String?, localName: String) -> String? { + @inlinable public func getAttributeNS(namespace: String?, localName: String) -> String? { let this = jsObject return this[Strings.getAttributeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } - public func setAttribute(qualifiedName: String, value: String) { + @inlinable public func setAttribute(qualifiedName: String, value: String) { let this = jsObject _ = this[Strings.setAttribute].function!(this: this, arguments: [qualifiedName.jsValue(), value.jsValue()]) } - public func setAttributeNS(namespace: String?, qualifiedName: String, value: String) { + @inlinable public func setAttributeNS(namespace: String?, qualifiedName: String, value: String) { let this = jsObject _ = this[Strings.setAttributeNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()]) } - public func removeAttribute(qualifiedName: String) { + @inlinable public func removeAttribute(qualifiedName: String) { let this = jsObject _ = this[Strings.removeAttribute].function!(this: this, arguments: [qualifiedName.jsValue()]) } - public func removeAttributeNS(namespace: String?, localName: String) { + @inlinable public func removeAttributeNS(namespace: String?, localName: String) { let this = jsObject _ = this[Strings.removeAttributeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]) } - public func toggleAttribute(qualifiedName: String, force: Bool? = nil) -> Bool { + @inlinable public func toggleAttribute(qualifiedName: String, force: Bool? = nil) -> Bool { let this = jsObject return this[Strings.toggleAttribute].function!(this: this, arguments: [qualifiedName.jsValue(), force?.jsValue() ?? .undefined]).fromJSValue()! } - public func hasAttribute(qualifiedName: String) -> Bool { + @inlinable public func hasAttribute(qualifiedName: String) -> Bool { let this = jsObject return this[Strings.hasAttribute].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } - public func hasAttributeNS(namespace: String?, localName: String) -> Bool { + @inlinable public func hasAttributeNS(namespace: String?, localName: String) -> Bool { let this = jsObject return this[Strings.hasAttributeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } - public func getAttributeNode(qualifiedName: String) -> Attr? { + @inlinable public func getAttributeNode(qualifiedName: String) -> Attr? { let this = jsObject return this[Strings.getAttributeNode].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } - public func getAttributeNodeNS(namespace: String?, localName: String) -> Attr? { + @inlinable public func getAttributeNodeNS(namespace: String?, localName: String) -> Attr? { let this = jsObject return this[Strings.getAttributeNodeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } - public func setAttributeNode(attr: Attr) -> Attr? { + @inlinable public func setAttributeNode(attr: Attr) -> Attr? { let this = jsObject return this[Strings.setAttributeNode].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } - public func setAttributeNodeNS(attr: Attr) -> Attr? { + @inlinable public func setAttributeNodeNS(attr: Attr) -> Attr? { let this = jsObject return this[Strings.setAttributeNodeNS].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } - public func removeAttributeNode(attr: Attr) -> Attr { + @inlinable public func removeAttributeNode(attr: Attr) -> Attr { let this = jsObject return this[Strings.removeAttributeNode].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } - public func attachShadow(init: ShadowRootInit) -> ShadowRoot { + @inlinable public func attachShadow(init: ShadowRootInit) -> ShadowRoot { let this = jsObject return this[Strings.attachShadow].function!(this: this, arguments: [`init`.jsValue()]).fromJSValue()! } @@ -259,42 +259,42 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @ReadonlyAttribute public var shadowRoot: ShadowRoot? - public func closest(selectors: String) -> Element? { + @inlinable public func closest(selectors: String) -> Element? { let this = jsObject return this[Strings.closest].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } - public func matches(selectors: String) -> Bool { + @inlinable public func matches(selectors: String) -> Bool { let this = jsObject return this[Strings.matches].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } - public func webkitMatchesSelector(selectors: String) -> Bool { + @inlinable public func webkitMatchesSelector(selectors: String) -> Bool { let this = jsObject return this[Strings.webkitMatchesSelector].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } - public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { + @inlinable public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { let this = jsObject return this[Strings.getElementsByTagName].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } - public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { + @inlinable public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { let this = jsObject return this[Strings.getElementsByTagNameNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } - public func getElementsByClassName(classNames: String) -> HTMLCollection { + @inlinable public func getElementsByClassName(classNames: String) -> HTMLCollection { let this = jsObject return this[Strings.getElementsByClassName].function!(this: this, arguments: [classNames.jsValue()]).fromJSValue()! } - public func insertAdjacentElement(where: String, element: Element) -> Element? { + @inlinable public func insertAdjacentElement(where: String, element: Element) -> Element? { let this = jsObject return this[Strings.insertAdjacentElement].function!(this: this, arguments: [`where`.jsValue(), element.jsValue()]).fromJSValue()! } - public func insertAdjacentText(where: String, data: String) { + @inlinable public func insertAdjacentText(where: String, data: String) { let this = jsObject _ = this[Strings.insertAdjacentText].function!(this: this, arguments: [`where`.jsValue(), data.jsValue()]) } @@ -305,13 +305,13 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @ReadWriteAttribute public var elementTiming: String - public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { + @inlinable public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestFullscreen(options: FullscreenOptions? = nil) async throws { + @inlinable public func requestFullscreen(options: FullscreenOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() @@ -323,27 +323,27 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @ClosureAttribute1Optional public var onfullscreenerror: EventHandler - public func setPointerCapture(pointerId: Int32) { + @inlinable public func setPointerCapture(pointerId: Int32) { let this = jsObject _ = this[Strings.setPointerCapture].function!(this: this, arguments: [pointerId.jsValue()]) } - public func releasePointerCapture(pointerId: Int32) { + @inlinable public func releasePointerCapture(pointerId: Int32) { let this = jsObject _ = this[Strings.releasePointerCapture].function!(this: this, arguments: [pointerId.jsValue()]) } - public func hasPointerCapture(pointerId: Int32) -> Bool { + @inlinable public func hasPointerCapture(pointerId: Int32) -> Bool { let this = jsObject return this[Strings.hasPointerCapture].function!(this: this, arguments: [pointerId.jsValue()]).fromJSValue()! } - public func requestPointerLock() { + @inlinable public func requestPointerLock() { let this = jsObject _ = this[Strings.requestPointerLock].function!(this: this, arguments: []) } - public func setHTML(input: String, options: SetHTMLOptions? = nil) { + @inlinable public func setHTML(input: String, options: SetHTMLOptions? = nil) { let this = jsObject _ = this[Strings.setHTML].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift index cd592728..1efba9c5 100644 --- a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift +++ b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol ElementCSSInlineStyle: JSBridgedClass {} public extension ElementCSSInlineStyle { - var attributeStyleMap: StylePropertyMap { ReadonlyAttribute[Strings.attributeStyleMap, in: jsObject] } + @inlinable var attributeStyleMap: StylePropertyMap { ReadonlyAttribute[Strings.attributeStyleMap, in: jsObject] } - var style: CSSStyleDeclaration { ReadonlyAttribute[Strings.style, in: jsObject] } + @inlinable var style: CSSStyleDeclaration { ReadonlyAttribute[Strings.style, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/ElementContentEditable.swift b/Sources/DOMKit/WebIDL/ElementContentEditable.swift index bb06fcc7..8ace6787 100644 --- a/Sources/DOMKit/WebIDL/ElementContentEditable.swift +++ b/Sources/DOMKit/WebIDL/ElementContentEditable.swift @@ -5,24 +5,24 @@ import JavaScriptKit public protocol ElementContentEditable: JSBridgedClass {} public extension ElementContentEditable { - var contentEditable: String { + @inlinable var contentEditable: String { get { ReadWriteAttribute[Strings.contentEditable, in: jsObject] } set { ReadWriteAttribute[Strings.contentEditable, in: jsObject] = newValue } } - var enterKeyHint: String { + @inlinable var enterKeyHint: String { get { ReadWriteAttribute[Strings.enterKeyHint, in: jsObject] } set { ReadWriteAttribute[Strings.enterKeyHint, in: jsObject] = newValue } } - var isContentEditable: Bool { ReadonlyAttribute[Strings.isContentEditable, in: jsObject] } + @inlinable var isContentEditable: Bool { ReadonlyAttribute[Strings.isContentEditable, in: jsObject] } - var inputMode: String { + @inlinable var inputMode: String { get { ReadWriteAttribute[Strings.inputMode, in: jsObject] } set { ReadWriteAttribute[Strings.inputMode, in: jsObject] = newValue } } - var virtualKeyboardPolicy: String { + @inlinable var virtualKeyboardPolicy: String { get { ReadWriteAttribute[Strings.virtualKeyboardPolicy, in: jsObject] } set { ReadWriteAttribute[Strings.virtualKeyboardPolicy, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index f3827c2a..c3a1b217 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ElementInternals: JSBridgedClass, ARIAMixin { - public class var constructor: JSFunction { JSObject.global[Strings.ElementInternals].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ElementInternals].function! } public let jsObject: JSObject @@ -25,7 +25,7 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { @ReadonlyAttribute public var shadowRoot: ShadowRoot? - public func setFormValue(value: __UNSUPPORTED_UNION__?, state: __UNSUPPORTED_UNION__? = nil) { + @inlinable public func setFormValue(value: __UNSUPPORTED_UNION__?, state: __UNSUPPORTED_UNION__? = nil) { let this = jsObject _ = this[Strings.setFormValue].function!(this: this, arguments: [value.jsValue(), state?.jsValue() ?? .undefined]) } @@ -33,7 +33,7 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { @ReadonlyAttribute public var form: HTMLFormElement? - public func setValidity(flags: ValidityStateFlags? = nil, message: String? = nil, anchor: HTMLElement? = nil) { + @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]) } @@ -47,12 +47,12 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { @ReadonlyAttribute public var validationMessage: String - public func checkValidity() -> Bool { + @inlinable public func checkValidity() -> Bool { let this = jsObject return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } - public func reportValidity() -> Bool { + @inlinable public func reportValidity() -> Bool { let this = jsObject return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift index 8415fe0d..6115b76f 100644 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EncodedAudioChunk: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EncodedAudioChunk].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EncodedAudioChunk].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class EncodedAudioChunk: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: EncodedAudioChunkInit) { + @inlinable public convenience init(init: EncodedAudioChunkInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @@ -32,7 +32,7 @@ public class EncodedAudioChunk: JSBridgedClass { @ReadonlyAttribute public var byteLength: UInt32 - public func copyTo(destination: BufferSource) { + @inlinable public func copyTo(destination: BufferSource) { let this = jsObject _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift index 03291d0f..8570684d 100644 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift @@ -7,16 +7,16 @@ public enum EncodedAudioChunkType: JSString, JSValueCompatible { case key = "key" case delta = "delta" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift index 65ea368e..e2f6c52d 100644 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EncodedVideoChunk: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EncodedVideoChunk].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EncodedVideoChunk].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class EncodedVideoChunk: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: EncodedVideoChunkInit) { + @inlinable public convenience init(init: EncodedVideoChunkInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @@ -32,7 +32,7 @@ public class EncodedVideoChunk: JSBridgedClass { @ReadonlyAttribute public var byteLength: UInt32 - public func copyTo(destination: BufferSource) { + @inlinable public func copyTo(destination: BufferSource) { let this = jsObject _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift index 78a26d63..c316a37d 100644 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift @@ -7,16 +7,16 @@ public enum EncodedVideoChunkType: JSString, JSValueCompatible { case key = "key" case delta = "delta" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/EndOfStreamError.swift b/Sources/DOMKit/WebIDL/EndOfStreamError.swift index 676ac3ae..e9cc3d40 100644 --- a/Sources/DOMKit/WebIDL/EndOfStreamError.swift +++ b/Sources/DOMKit/WebIDL/EndOfStreamError.swift @@ -7,16 +7,16 @@ public enum EndOfStreamError: JSString, JSValueCompatible { case network = "network" case decode = "decode" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/EndingType.swift b/Sources/DOMKit/WebIDL/EndingType.swift index 6b49b44c..bd3af037 100644 --- a/Sources/DOMKit/WebIDL/EndingType.swift +++ b/Sources/DOMKit/WebIDL/EndingType.swift @@ -7,16 +7,16 @@ public enum EndingType: JSString, JSValueCompatible { case transparent = "transparent" case native = "native" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ErrorEvent.swift b/Sources/DOMKit/WebIDL/ErrorEvent.swift index 2619019e..954bd993 100644 --- a/Sources/DOMKit/WebIDL/ErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/ErrorEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ErrorEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.ErrorEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ErrorEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) @@ -15,7 +15,7 @@ public class ErrorEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: ErrorEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: ErrorEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index c40af9e0..1faf1f2e 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Event: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Event].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Event].function! } public let jsObject: JSObject @@ -25,7 +25,7 @@ public class Event: JSBridgedClass { self.jsObject = jsObject } - public convenience init(type: String, eventInitDict: EventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: EventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -41,7 +41,7 @@ public class Event: JSBridgedClass { @ReadonlyAttribute public var currentTarget: EventTarget? - public func composedPath() -> [EventTarget] { + @inlinable public func composedPath() -> [EventTarget] { let this = jsObject return this[Strings.composedPath].function!(this: this, arguments: []).fromJSValue()! } @@ -57,7 +57,7 @@ public class Event: JSBridgedClass { @ReadonlyAttribute public var eventPhase: UInt16 - public func stopPropagation() { + @inlinable public func stopPropagation() { let this = jsObject _ = this[Strings.stopPropagation].function!(this: this, arguments: []) } @@ -65,7 +65,7 @@ public class Event: JSBridgedClass { @ReadWriteAttribute public var cancelBubble: Bool - public func stopImmediatePropagation() { + @inlinable public func stopImmediatePropagation() { let this = jsObject _ = this[Strings.stopImmediatePropagation].function!(this: this, arguments: []) } @@ -79,7 +79,7 @@ public class Event: JSBridgedClass { @ReadWriteAttribute public var returnValue: Bool - public func preventDefault() { + @inlinable public func preventDefault() { let this = jsObject _ = this[Strings.preventDefault].function!(this: this, arguments: []) } @@ -96,7 +96,7 @@ public class Event: JSBridgedClass { @ReadonlyAttribute public var timeStamp: DOMHighResTimeStamp - public func initEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil) { + @inlinable public func initEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil) { let this = jsObject _ = this[Strings.initEvent].function!(this: this, arguments: [type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/EventCounts.swift b/Sources/DOMKit/WebIDL/EventCounts.swift index 1da05254..f3460b6f 100644 --- a/Sources/DOMKit/WebIDL/EventCounts.swift +++ b/Sources/DOMKit/WebIDL/EventCounts.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EventCounts: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EventCounts].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EventCounts].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index 2f3770e4..0ee701cb 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EventSource: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.EventSource].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.EventSource].function! } public required init(unsafelyWrapping jsObject: JSObject) { _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) @@ -16,7 +16,7 @@ public class EventSource: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(url: String, eventSourceInitDict: EventSourceInit? = nil) { + @inlinable public convenience init(url: String, eventSourceInitDict: EventSourceInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), eventSourceInitDict?.jsValue() ?? .undefined])) } @@ -44,7 +44,7 @@ public class EventSource: EventTarget { @ClosureAttribute1Optional public var onerror: EventHandler - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/EventTarget.swift b/Sources/DOMKit/WebIDL/EventTarget.swift index a6f01834..acca466a 100644 --- a/Sources/DOMKit/WebIDL/EventTarget.swift +++ b/Sources/DOMKit/WebIDL/EventTarget.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EventTarget: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EventTarget].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EventTarget].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class EventTarget: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -20,7 +20,7 @@ public class EventTarget: JSBridgedClass { // XXX: member 'removeEventListener' is ignored - public func dispatchEvent(event: Event) -> Bool { + @inlinable public func dispatchEvent(event: Event) -> Bool { let this = jsObject return this[Strings.dispatchEvent].function!(this: this, arguments: [event.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift index 57dbc9ea..b292ee01 100644 --- a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ExtendableCookieChangeEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableCookieChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableCookieChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _changed = ReadonlyAttribute(jsObject: jsObject, name: Strings.changed) @@ -12,7 +12,7 @@ public class ExtendableCookieChangeEvent: ExtendableEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: ExtendableCookieChangeEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: ExtendableCookieChangeEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/ExtendableEvent.swift b/Sources/DOMKit/WebIDL/ExtendableEvent.swift index 40bc3add..0c8d7bf2 100644 --- a/Sources/DOMKit/WebIDL/ExtendableEvent.swift +++ b/Sources/DOMKit/WebIDL/ExtendableEvent.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit public class ExtendableEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: ExtendableEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: ExtendableEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } - public func waitUntil(f: JSPromise) { + @inlinable public func waitUntil(f: JSPromise) { let this = jsObject _ = this[Strings.waitUntil].function!(this: this, arguments: [f.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift b/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift index cd4ff0e0..40fce31f 100644 --- a/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift +++ b/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ExtendableMessageEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableMessageEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableMessageEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) @@ -15,7 +15,7 @@ public class ExtendableMessageEvent: ExtendableEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: ExtendableMessageEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: ExtendableMessageEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/External.swift b/Sources/DOMKit/WebIDL/External.swift index 245f83b3..302e99da 100644 --- a/Sources/DOMKit/WebIDL/External.swift +++ b/Sources/DOMKit/WebIDL/External.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class External: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.External].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.External].function! } public let jsObject: JSObject @@ -12,12 +12,12 @@ public class External: JSBridgedClass { self.jsObject = jsObject } - public func AddSearchProvider() { + @inlinable public func AddSearchProvider() { let this = jsObject _ = this[Strings.AddSearchProvider].function!(this: this, arguments: []) } - public func IsSearchProviderInstalled() { + @inlinable public func IsSearchProviderInstalled() { let this = jsObject _ = this[Strings.IsSearchProviderInstalled].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/EyeDropper.swift b/Sources/DOMKit/WebIDL/EyeDropper.swift index eadac4ba..a530793b 100644 --- a/Sources/DOMKit/WebIDL/EyeDropper.swift +++ b/Sources/DOMKit/WebIDL/EyeDropper.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EyeDropper: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.EyeDropper].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EyeDropper].function! } public let jsObject: JSObject @@ -12,17 +12,17 @@ public class EyeDropper: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public func open(options: ColorSelectionOptions? = nil) -> JSPromise { + @inlinable public func open(options: ColorSelectionOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.open].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func open(options: ColorSelectionOptions? = nil) async throws -> ColorSelectionResult { + @inlinable public func open(options: ColorSelectionOptions? = nil) async throws -> ColorSelectionResult { let this = jsObject let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/FaceDetector.swift b/Sources/DOMKit/WebIDL/FaceDetector.swift index ca6e9819..de3174e6 100644 --- a/Sources/DOMKit/WebIDL/FaceDetector.swift +++ b/Sources/DOMKit/WebIDL/FaceDetector.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FaceDetector: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FaceDetector].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FaceDetector].function! } public let jsObject: JSObject @@ -12,17 +12,17 @@ public class FaceDetector: JSBridgedClass { self.jsObject = jsObject } - public convenience init(faceDetectorOptions: FaceDetectorOptions? = nil) { + @inlinable public convenience init(faceDetectorOptions: FaceDetectorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [faceDetectorOptions?.jsValue() ?? .undefined])) } - public func detect(image: ImageBitmapSource) -> JSPromise { + @inlinable public func detect(image: ImageBitmapSource) -> JSPromise { let this = jsObject return this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func detect(image: ImageBitmapSource) async throws -> [DetectedFace] { + @inlinable public func detect(image: ImageBitmapSource) async throws -> [DetectedFace] { let this = jsObject let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/FederatedCredential.swift b/Sources/DOMKit/WebIDL/FederatedCredential.swift index e92ee39f..4e706570 100644 --- a/Sources/DOMKit/WebIDL/FederatedCredential.swift +++ b/Sources/DOMKit/WebIDL/FederatedCredential.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FederatedCredential: Credential, CredentialUserData { - override public class var constructor: JSFunction { JSObject.global[Strings.FederatedCredential].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FederatedCredential].function! } public required init(unsafelyWrapping jsObject: JSObject) { _provider = ReadonlyAttribute(jsObject: jsObject, name: Strings.provider) @@ -12,7 +12,7 @@ public class FederatedCredential: Credential, CredentialUserData { super.init(unsafelyWrapping: jsObject) } - public convenience init(data: FederatedCredentialInit) { + @inlinable public convenience init(data: FederatedCredentialInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/FetchEvent.swift b/Sources/DOMKit/WebIDL/FetchEvent.swift index e4cb1131..af069a33 100644 --- a/Sources/DOMKit/WebIDL/FetchEvent.swift +++ b/Sources/DOMKit/WebIDL/FetchEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FetchEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.FetchEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FetchEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _request = ReadonlyAttribute(jsObject: jsObject, name: Strings.request) @@ -16,7 +16,7 @@ public class FetchEvent: ExtendableEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: FetchEventInit) { + @inlinable public convenience init(type: String, eventInitDict: FetchEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } @@ -38,7 +38,7 @@ public class FetchEvent: ExtendableEvent { @ReadonlyAttribute public var handled: JSPromise - public func respondWith(r: JSPromise) { + @inlinable public func respondWith(r: JSPromise) { let this = jsObject _ = this[Strings.respondWith].function!(this: this, arguments: [r.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/FetchPriority.swift b/Sources/DOMKit/WebIDL/FetchPriority.swift index fce522d5..7582e725 100644 --- a/Sources/DOMKit/WebIDL/FetchPriority.swift +++ b/Sources/DOMKit/WebIDL/FetchPriority.swift @@ -8,16 +8,16 @@ public enum FetchPriority: JSString, JSValueCompatible { case low = "low" case auto = "auto" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/File.swift b/Sources/DOMKit/WebIDL/File.swift index 53444f77..7f7b2881 100644 --- a/Sources/DOMKit/WebIDL/File.swift +++ b/Sources/DOMKit/WebIDL/File.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class File: Blob { - override public class var constructor: JSFunction { JSObject.global[Strings.File].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.File].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) @@ -13,7 +13,7 @@ public class File: Blob { super.init(unsafelyWrapping: jsObject) } - public convenience init(fileBits: [BlobPart], fileName: String, options: FilePropertyBag? = nil) { + @inlinable public convenience init(fileBits: [BlobPart], fileName: String, options: FilePropertyBag? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [fileBits.jsValue(), fileName.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/FileList.swift b/Sources/DOMKit/WebIDL/FileList.swift index 9ec7c077..6cab3da3 100644 --- a/Sources/DOMKit/WebIDL/FileList.swift +++ b/Sources/DOMKit/WebIDL/FileList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FileList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileList].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class FileList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: Int) -> File? { + @inlinable public subscript(key: Int) -> File? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index b051902b..ef22f890 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileReader: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.FileReader].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileReader].function! } public required init(unsafelyWrapping jsObject: JSObject) { _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) @@ -19,31 +19,31 @@ public class FileReader: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public func readAsArrayBuffer(blob: Blob) { + @inlinable public func readAsArrayBuffer(blob: Blob) { let this = jsObject _ = this[Strings.readAsArrayBuffer].function!(this: this, arguments: [blob.jsValue()]) } - public func readAsBinaryString(blob: Blob) { + @inlinable public func readAsBinaryString(blob: Blob) { let this = jsObject _ = this[Strings.readAsBinaryString].function!(this: this, arguments: [blob.jsValue()]) } - public func readAsText(blob: Blob, encoding: String? = nil) { + @inlinable public func readAsText(blob: Blob, encoding: String? = nil) { let this = jsObject _ = this[Strings.readAsText].function!(this: this, arguments: [blob.jsValue(), encoding?.jsValue() ?? .undefined]) } - public func readAsDataURL(blob: Blob) { + @inlinable public func readAsDataURL(blob: Blob) { let this = jsObject _ = this[Strings.readAsDataURL].function!(this: this, arguments: [blob.jsValue()]) } - public func abort() { + @inlinable public func abort() { let this = jsObject _ = this[Strings.abort].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/FileReaderSync.swift b/Sources/DOMKit/WebIDL/FileReaderSync.swift index 7bf85c24..081d2739 100644 --- a/Sources/DOMKit/WebIDL/FileReaderSync.swift +++ b/Sources/DOMKit/WebIDL/FileReaderSync.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileReaderSync: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FileReaderSync].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileReaderSync].function! } public let jsObject: JSObject @@ -12,26 +12,26 @@ public class FileReaderSync: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public func readAsArrayBuffer(blob: Blob) -> ArrayBuffer { + @inlinable public func readAsArrayBuffer(blob: Blob) -> ArrayBuffer { let this = jsObject return this[Strings.readAsArrayBuffer].function!(this: this, arguments: [blob.jsValue()]).fromJSValue()! } - public func readAsBinaryString(blob: Blob) -> String { + @inlinable public func readAsBinaryString(blob: Blob) -> String { let this = jsObject return this[Strings.readAsBinaryString].function!(this: this, arguments: [blob.jsValue()]).fromJSValue()! } - public func readAsText(blob: Blob, encoding: String? = nil) -> String { + @inlinable public func readAsText(blob: Blob, encoding: String? = nil) -> String { let this = jsObject return this[Strings.readAsText].function!(this: this, arguments: [blob.jsValue(), encoding?.jsValue() ?? .undefined]).fromJSValue()! } - public func readAsDataURL(blob: Blob) -> String { + @inlinable public func readAsDataURL(blob: Blob) -> String { let this = jsObject return this[Strings.readAsDataURL].function!(this: this, arguments: [blob.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/FileSystem.swift b/Sources/DOMKit/WebIDL/FileSystem.swift index 03ba5370..b5190fad 100644 --- a/Sources/DOMKit/WebIDL/FileSystem.swift +++ b/Sources/DOMKit/WebIDL/FileSystem.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileSystem: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FileSystem].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileSystem].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift index 09158b39..b3d1fa64 100644 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class FileSystemDirectoryEntry: FileSystemEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryEntry].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryEntry].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public func createReader() -> FileSystemDirectoryReader { + @inlinable public func createReader() -> FileSystemDirectoryReader { let this = jsObject return this[Strings.createReader].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift index c906c7fa..70ee92b0 100644 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileSystemDirectoryHandle: FileSystemHandle, AsyncSequence { - override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryHandle].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryHandle].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) @@ -16,49 +16,49 @@ public class FileSystemDirectoryHandle: FileSystemHandle, AsyncSequence { ValueIterableAsyncIterator(sequence: self) } - public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) -> JSPromise { + @inlinable public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) async throws -> FileSystemFileHandle { + @inlinable public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) async throws -> FileSystemFileHandle { let this = jsObject let _promise: JSPromise = this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) -> JSPromise { + @inlinable public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) async throws -> FileSystemDirectoryHandle { + @inlinable public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) async throws -> FileSystemDirectoryHandle { let this = jsObject let _promise: JSPromise = this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) -> JSPromise { + @inlinable public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) async throws { + @inlinable public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func resolve(possibleDescendant: FileSystemHandle) -> JSPromise { + @inlinable public func resolve(possibleDescendant: FileSystemHandle) -> JSPromise { let this = jsObject return this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func resolve(possibleDescendant: FileSystemHandle) async throws -> [String]? { + @inlinable public func resolve(possibleDescendant: FileSystemHandle) async throws -> [String]? { let this = jsObject let _promise: JSPromise = this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift index 4789093d..5c9d1450 100644 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileSystemDirectoryReader: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryReader].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryReader].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FileSystemEntry.swift b/Sources/DOMKit/WebIDL/FileSystemEntry.swift index 295352db..2abb672a 100644 --- a/Sources/DOMKit/WebIDL/FileSystemEntry.swift +++ b/Sources/DOMKit/WebIDL/FileSystemEntry.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileSystemEntry: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FileSystemEntry].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileSystemEntry].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift b/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift index a057dabf..207615ac 100644 --- a/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift +++ b/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileSystemFileEntry: FileSystemEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemFileEntry].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemFileEntry].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift b/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift index 5715eb0e..76366829 100644 --- a/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift +++ b/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift @@ -4,31 +4,31 @@ import JavaScriptEventLoop import JavaScriptKit public class FileSystemFileHandle: FileSystemHandle { - override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemFileHandle].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemFileHandle].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public func getFile() -> JSPromise { + @inlinable public func getFile() -> JSPromise { let this = jsObject return this[Strings.getFile].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getFile() async throws -> File { + @inlinable public func getFile() async throws -> File { let this = jsObject let _promise: JSPromise = this[Strings.getFile].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func createWritable(options: FileSystemCreateWritableOptions? = nil) -> JSPromise { + @inlinable public func createWritable(options: FileSystemCreateWritableOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createWritable(options: FileSystemCreateWritableOptions? = nil) async throws -> FileSystemWritableFileStream { + @inlinable public func createWritable(options: FileSystemCreateWritableOptions? = nil) async throws -> FileSystemWritableFileStream { let this = jsObject let _promise: JSPromise = this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/FileSystemHandle.swift b/Sources/DOMKit/WebIDL/FileSystemHandle.swift index 84303409..b9892fe2 100644 --- a/Sources/DOMKit/WebIDL/FileSystemHandle.swift +++ b/Sources/DOMKit/WebIDL/FileSystemHandle.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FileSystemHandle: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FileSystemHandle].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileSystemHandle].function! } public let jsObject: JSObject @@ -20,37 +20,37 @@ public class FileSystemHandle: JSBridgedClass { @ReadonlyAttribute public var name: String - public func isSameEntry(other: FileSystemHandle) -> JSPromise { + @inlinable public func isSameEntry(other: FileSystemHandle) -> JSPromise { let this = jsObject return this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func isSameEntry(other: FileSystemHandle) async throws -> Bool { + @inlinable public func isSameEntry(other: FileSystemHandle) async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { + @inlinable public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { let this = jsObject return this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { + @inlinable public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { let this = jsObject let _promise: JSPromise = this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { + @inlinable public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { let this = jsObject return this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { + @inlinable public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { let this = jsObject let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift b/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift index 8947defc..818682ce 100644 --- a/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift +++ b/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift @@ -7,16 +7,16 @@ public enum FileSystemHandleKind: JSString, JSValueCompatible { case file = "file" case directory = "directory" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift b/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift index c49475a5..745c2233 100644 --- a/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift +++ b/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift @@ -7,16 +7,16 @@ public enum FileSystemPermissionMode: JSString, JSValueCompatible { case read = "read" case readwrite = "readwrite" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift b/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift index e671e8c2..e614191a 100644 --- a/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift +++ b/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift @@ -4,43 +4,43 @@ import JavaScriptEventLoop import JavaScriptKit public class FileSystemWritableFileStream: WritableStream { - override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemWritableFileStream].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemWritableFileStream].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public func write(data: FileSystemWriteChunkType) -> JSPromise { + @inlinable public func write(data: FileSystemWriteChunkType) -> JSPromise { let this = jsObject return this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func write(data: FileSystemWriteChunkType) async throws { + @inlinable public func write(data: FileSystemWriteChunkType) async throws { let this = jsObject let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func seek(position: UInt64) -> JSPromise { + @inlinable public func seek(position: UInt64) -> JSPromise { let this = jsObject return this[Strings.seek].function!(this: this, arguments: [position.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func seek(position: UInt64) async throws { + @inlinable public func seek(position: UInt64) async throws { let this = jsObject let _promise: JSPromise = this[Strings.seek].function!(this: this, arguments: [position.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func truncate(size: UInt64) -> JSPromise { + @inlinable public func truncate(size: UInt64) -> JSPromise { let this = jsObject return this[Strings.truncate].function!(this: this, arguments: [size.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func truncate(size: UInt64) async throws { + @inlinable public func truncate(size: UInt64) async throws { let this = jsObject let _promise: JSPromise = this[Strings.truncate].function!(this: this, arguments: [size.jsValue()]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/FillLightMode.swift b/Sources/DOMKit/WebIDL/FillLightMode.swift index 0ee92607..9427ec70 100644 --- a/Sources/DOMKit/WebIDL/FillLightMode.swift +++ b/Sources/DOMKit/WebIDL/FillLightMode.swift @@ -8,16 +8,16 @@ public enum FillLightMode: JSString, JSValueCompatible { case off = "off" case flash = "flash" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/FillMode.swift b/Sources/DOMKit/WebIDL/FillMode.swift index 056e0014..b533c01d 100644 --- a/Sources/DOMKit/WebIDL/FillMode.swift +++ b/Sources/DOMKit/WebIDL/FillMode.swift @@ -10,16 +10,16 @@ public enum FillMode: JSString, JSValueCompatible { case both = "both" case auto = "auto" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/FlowControlType.swift b/Sources/DOMKit/WebIDL/FlowControlType.swift index 6355127c..d7346bd2 100644 --- a/Sources/DOMKit/WebIDL/FlowControlType.swift +++ b/Sources/DOMKit/WebIDL/FlowControlType.swift @@ -7,16 +7,16 @@ public enum FlowControlType: JSString, JSValueCompatible { case none = "none" case hardware = "hardware" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/FocusEvent.swift b/Sources/DOMKit/WebIDL/FocusEvent.swift index 34b4b2c2..67fbdffc 100644 --- a/Sources/DOMKit/WebIDL/FocusEvent.swift +++ b/Sources/DOMKit/WebIDL/FocusEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class FocusEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.FocusEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FocusEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedTarget) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: FocusEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: FocusEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift b/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift index d66080cd..7ce0efad 100644 --- a/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift +++ b/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift @@ -7,16 +7,16 @@ public enum FocusableAreaSearchMode: JSString, JSValueCompatible { case visible = "visible" case all = "all" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Font.swift b/Sources/DOMKit/WebIDL/Font.swift index 1460213e..c2ed5c89 100644 --- a/Sources/DOMKit/WebIDL/Font.swift +++ b/Sources/DOMKit/WebIDL/Font.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Font: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Font].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Font].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FontFace.swift b/Sources/DOMKit/WebIDL/FontFace.swift index 5bc411bc..571ce973 100644 --- a/Sources/DOMKit/WebIDL/FontFace.swift +++ b/Sources/DOMKit/WebIDL/FontFace.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontFace: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FontFace].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFace].function! } public let jsObject: JSObject @@ -29,7 +29,7 @@ public class FontFace: JSBridgedClass { self.jsObject = jsObject } - public convenience init(family: String, source: __UNSUPPORTED_UNION__, descriptors: FontFaceDescriptors? = nil) { + @inlinable public convenience init(family: String, source: __UNSUPPORTED_UNION__, descriptors: FontFaceDescriptors? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [family.jsValue(), source.jsValue(), descriptors?.jsValue() ?? .undefined])) } @@ -72,13 +72,13 @@ public class FontFace: JSBridgedClass { @ReadonlyAttribute public var status: FontFaceLoadStatus - public func load() -> JSPromise { + @inlinable public func load() -> JSPromise { let this = jsObject return this[Strings.load].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func load() async throws -> FontFace { + @inlinable public func load() async throws -> FontFace { let this = jsObject let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/FontFaceFeatures.swift b/Sources/DOMKit/WebIDL/FontFaceFeatures.swift index f732565d..6f11335d 100644 --- a/Sources/DOMKit/WebIDL/FontFaceFeatures.swift +++ b/Sources/DOMKit/WebIDL/FontFaceFeatures.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontFaceFeatures: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FontFaceFeatures].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFaceFeatures].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift b/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift index 9d9f98ad..25d22c07 100644 --- a/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift +++ b/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift @@ -9,16 +9,16 @@ public enum FontFaceLoadStatus: JSString, JSValueCompatible { case loaded = "loaded" case error = "error" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/FontFacePalette.swift b/Sources/DOMKit/WebIDL/FontFacePalette.swift index 6e01ef95..5296ef30 100644 --- a/Sources/DOMKit/WebIDL/FontFacePalette.swift +++ b/Sources/DOMKit/WebIDL/FontFacePalette.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontFacePalette: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.FontFacePalette].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFacePalette].function! } public let jsObject: JSObject @@ -23,7 +23,7 @@ public class FontFacePalette: JSBridgedClass, Sequence { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> String { + @inlinable public subscript(key: Int) -> String { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/FontFacePalettes.swift b/Sources/DOMKit/WebIDL/FontFacePalettes.swift index 77a5db5b..26e5db76 100644 --- a/Sources/DOMKit/WebIDL/FontFacePalettes.swift +++ b/Sources/DOMKit/WebIDL/FontFacePalettes.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontFacePalettes: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.FontFacePalettes].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFacePalettes].function! } public let jsObject: JSObject @@ -21,7 +21,7 @@ public class FontFacePalettes: JSBridgedClass, Sequence { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> FontFacePalette { + @inlinable public subscript(key: Int) -> FontFacePalette { jsObject[key].fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FontFaceSet.swift b/Sources/DOMKit/WebIDL/FontFaceSet.swift index c88639aa..3c2c9854 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSet.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontFaceSet: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.FontFaceSet].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FontFaceSet].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onloading = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloading) @@ -15,23 +15,23 @@ public class FontFaceSet: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(initialFaces: [FontFace]) { + @inlinable public convenience init(initialFaces: [FontFace]) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [initialFaces.jsValue()])) } // XXX: make me Set-like! - public func add(font: FontFace) -> Self { + @inlinable public func add(font: FontFace) -> Self { let this = jsObject return this[Strings.add].function!(this: this, arguments: [font.jsValue()]).fromJSValue()! } - public func delete(font: FontFace) -> Bool { + @inlinable public func delete(font: FontFace) -> Bool { let this = jsObject return this[Strings.delete].function!(this: this, arguments: [font.jsValue()]).fromJSValue()! } - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } @@ -45,19 +45,19 @@ public class FontFaceSet: EventTarget { @ClosureAttribute1Optional public var onloadingerror: EventHandler - public func load(font: String, text: String? = nil) -> JSPromise { + @inlinable public func load(font: String, text: String? = nil) -> JSPromise { let this = jsObject return this[Strings.load].function!(this: this, arguments: [font.jsValue(), text?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func load(font: String, text: String? = nil) async throws -> [FontFace] { + @inlinable public func load(font: String, text: String? = nil) async throws -> [FontFace] { let this = jsObject let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [font.jsValue(), text?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func check(font: String, text: String? = nil) -> Bool { + @inlinable public func check(font: String, text: String? = nil) -> Bool { let this = jsObject return this[Strings.check].function!(this: this, arguments: [font.jsValue(), text?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift index f68d10a8..4a893c1a 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class FontFaceSetLoadEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.FontFaceSetLoadEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FontFaceSetLoadEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _fontfaces = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontfaces) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: FontFaceSetLoadEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: FontFaceSetLoadEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift index 0ea10999..999dd065 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift @@ -7,16 +7,16 @@ public enum FontFaceSetLoadStatus: JSString, JSValueCompatible { case loading = "loading" case loaded = "loaded" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/FontFaceSource.swift b/Sources/DOMKit/WebIDL/FontFaceSource.swift index f2138572..407069d1 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSource.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSource.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol FontFaceSource: JSBridgedClass {} public extension FontFaceSource { - var fonts: FontFaceSet { ReadonlyAttribute[Strings.fonts, in: jsObject] } + @inlinable var fonts: FontFaceSet { ReadonlyAttribute[Strings.fonts, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift b/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift index 5f898646..4a2ca1ee 100644 --- a/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift +++ b/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontFaceVariationAxis: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FontFaceVariationAxis].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFaceVariationAxis].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FontFaceVariations.swift b/Sources/DOMKit/WebIDL/FontFaceVariations.swift index 289c7a31..205f9552 100644 --- a/Sources/DOMKit/WebIDL/FontFaceVariations.swift +++ b/Sources/DOMKit/WebIDL/FontFaceVariations.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontFaceVariations: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FontFaceVariations].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFaceVariations].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FontManager.swift b/Sources/DOMKit/WebIDL/FontManager.swift index 00d3fbd1..68bde960 100644 --- a/Sources/DOMKit/WebIDL/FontManager.swift +++ b/Sources/DOMKit/WebIDL/FontManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FontManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontManager].function! } public let jsObject: JSObject @@ -12,13 +12,13 @@ public class FontManager: JSBridgedClass { self.jsObject = jsObject } - public func query(options: QueryOptions? = nil) -> JSPromise { + @inlinable public func query(options: QueryOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.query].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func query(options: QueryOptions? = nil) async throws -> [FontMetadata] { + @inlinable public func query(options: QueryOptions? = nil) async throws -> [FontMetadata] { let this = jsObject let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/FontMetadata.swift b/Sources/DOMKit/WebIDL/FontMetadata.swift index 57afb5ba..faef1e91 100644 --- a/Sources/DOMKit/WebIDL/FontMetadata.swift +++ b/Sources/DOMKit/WebIDL/FontMetadata.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontMetadata: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FontMetadata].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontMetadata].function! } public let jsObject: JSObject @@ -16,13 +16,13 @@ public class FontMetadata: JSBridgedClass { self.jsObject = jsObject } - public func blob() -> JSPromise { + @inlinable public func blob() -> JSPromise { let this = jsObject return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func blob() async throws -> Blob { + @inlinable public func blob() async throws -> Blob { let this = jsObject let _promise: JSPromise = this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/FontMetrics.swift b/Sources/DOMKit/WebIDL/FontMetrics.swift index 2fca20d9..596f6abe 100644 --- a/Sources/DOMKit/WebIDL/FontMetrics.swift +++ b/Sources/DOMKit/WebIDL/FontMetrics.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FontMetrics: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FontMetrics].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontMetrics].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index 10941615..e5f699c4 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FormData: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.FormData].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FormData].function! } public let jsObject: JSObject @@ -12,46 +12,46 @@ public class FormData: JSBridgedClass, Sequence { self.jsObject = jsObject } - public convenience init(form: HTMLFormElement? = nil) { + @inlinable public convenience init(form: HTMLFormElement? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [form?.jsValue() ?? .undefined])) } - public func append(name: String, value: String) { + @inlinable public func append(name: String, value: String) { let this = jsObject _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } - public func append(name: String, blobValue: Blob, filename: String? = nil) { + @inlinable public func append(name: String, blobValue: Blob, filename: String? = nil) { let this = jsObject _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined]) } - public func delete(name: String) { + @inlinable public func delete(name: String) { let this = jsObject _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]) } - public func get(name: String) -> FormDataEntryValue? { + @inlinable public func get(name: String) -> FormDataEntryValue? { let this = jsObject return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func getAll(name: String) -> [FormDataEntryValue] { + @inlinable public func getAll(name: String) -> [FormDataEntryValue] { let this = jsObject return this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func has(name: String) -> Bool { + @inlinable public func has(name: String) -> Bool { let this = jsObject return this[Strings.has].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func set(name: String, value: String) { + @inlinable public func set(name: String, value: String) { let this = jsObject _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } - public func set(name: String, blobValue: Blob, filename: String? = nil) { + @inlinable public func set(name: String, blobValue: Blob, filename: String? = nil) { let this = jsObject _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/FormDataEvent.swift b/Sources/DOMKit/WebIDL/FormDataEvent.swift index 7a7b8e76..966d4e3e 100644 --- a/Sources/DOMKit/WebIDL/FormDataEvent.swift +++ b/Sources/DOMKit/WebIDL/FormDataEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class FormDataEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.FormDataEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FormDataEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _formData = ReadonlyAttribute(jsObject: jsObject, name: Strings.formData) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: FormDataEventInit) { + @inlinable public convenience init(type: String, eventInitDict: FormDataEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/FragmentDirective.swift b/Sources/DOMKit/WebIDL/FragmentDirective.swift index 87e01a23..0d1f537b 100644 --- a/Sources/DOMKit/WebIDL/FragmentDirective.swift +++ b/Sources/DOMKit/WebIDL/FragmentDirective.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FragmentDirective: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FragmentDirective].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FragmentDirective].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/FragmentResult.swift b/Sources/DOMKit/WebIDL/FragmentResult.swift index a868a44f..780968ac 100644 --- a/Sources/DOMKit/WebIDL/FragmentResult.swift +++ b/Sources/DOMKit/WebIDL/FragmentResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FragmentResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.FragmentResult].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FragmentResult].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class FragmentResult: JSBridgedClass { self.jsObject = jsObject } - public convenience init(options: FragmentResultOptions? = nil) { + @inlinable public convenience init(options: FragmentResultOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/FrameType.swift b/Sources/DOMKit/WebIDL/FrameType.swift index 28a618b2..7f67c36c 100644 --- a/Sources/DOMKit/WebIDL/FrameType.swift +++ b/Sources/DOMKit/WebIDL/FrameType.swift @@ -9,16 +9,16 @@ public enum FrameType: JSString, JSValueCompatible { case nested = "nested" case none = "none" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift b/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift index bf5ae7f5..c4916f36 100644 --- a/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift +++ b/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift @@ -8,16 +8,16 @@ public enum FullscreenNavigationUI: JSString, JSValueCompatible { case show = "show" case hide = "hide" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPU.swift b/Sources/DOMKit/WebIDL/GPU.swift index fe1dc602..2f3a3619 100644 --- a/Sources/DOMKit/WebIDL/GPU.swift +++ b/Sources/DOMKit/WebIDL/GPU.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPU: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPU].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPU].function! } public let jsObject: JSObject @@ -12,13 +12,13 @@ public class GPU: JSBridgedClass { self.jsObject = jsObject } - public func requestAdapter(options: GPURequestAdapterOptions? = nil) -> JSPromise { + @inlinable public func requestAdapter(options: GPURequestAdapterOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestAdapter(options: GPURequestAdapterOptions? = nil) async throws -> GPUAdapter? { + @inlinable public func requestAdapter(options: GPURequestAdapterOptions? = nil) async throws -> GPUAdapter? { let this = jsObject let _promise: JSPromise = this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/GPUAdapter.swift b/Sources/DOMKit/WebIDL/GPUAdapter.swift index b136a6f3..68ea4b24 100644 --- a/Sources/DOMKit/WebIDL/GPUAdapter.swift +++ b/Sources/DOMKit/WebIDL/GPUAdapter.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUAdapter: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPUAdapter].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUAdapter].function! } public let jsObject: JSObject @@ -28,13 +28,13 @@ public class GPUAdapter: JSBridgedClass { @ReadonlyAttribute public var isFallbackAdapter: Bool - public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) -> JSPromise { + @inlinable public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) -> JSPromise { let this = jsObject return this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) async throws -> GPUDevice { + @inlinable public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) async throws -> GPUDevice { let this = jsObject let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/GPUAddressMode.swift b/Sources/DOMKit/WebIDL/GPUAddressMode.swift index 6aecea51..db030589 100644 --- a/Sources/DOMKit/WebIDL/GPUAddressMode.swift +++ b/Sources/DOMKit/WebIDL/GPUAddressMode.swift @@ -8,16 +8,16 @@ public enum GPUAddressMode: JSString, JSValueCompatible { case `repeat` = "repeat" case mirrorRepeat = "mirror-repeat" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUBindGroup.swift b/Sources/DOMKit/WebIDL/GPUBindGroup.swift index 0aa1ba60..654e2600 100644 --- a/Sources/DOMKit/WebIDL/GPUBindGroup.swift +++ b/Sources/DOMKit/WebIDL/GPUBindGroup.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUBindGroup: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUBindGroup].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUBindGroup].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift b/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift index 5e6c2bd8..e675b689 100644 --- a/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift +++ b/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUBindGroupLayout: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUBindGroupLayout].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUBindGroupLayout].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUBlendFactor.swift b/Sources/DOMKit/WebIDL/GPUBlendFactor.swift index 4eb8b4cd..8b83ef47 100644 --- a/Sources/DOMKit/WebIDL/GPUBlendFactor.swift +++ b/Sources/DOMKit/WebIDL/GPUBlendFactor.swift @@ -18,16 +18,16 @@ public enum GPUBlendFactor: JSString, JSValueCompatible { case constant = "constant" case oneMinusConstant = "one-minus-constant" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUBlendOperation.swift b/Sources/DOMKit/WebIDL/GPUBlendOperation.swift index 014def01..a6f860f4 100644 --- a/Sources/DOMKit/WebIDL/GPUBlendOperation.swift +++ b/Sources/DOMKit/WebIDL/GPUBlendOperation.swift @@ -10,16 +10,16 @@ public enum GPUBlendOperation: JSString, JSValueCompatible { case min = "min" case max = "max" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUBuffer.swift b/Sources/DOMKit/WebIDL/GPUBuffer.swift index a1596d1a..601b5be3 100644 --- a/Sources/DOMKit/WebIDL/GPUBuffer.swift +++ b/Sources/DOMKit/WebIDL/GPUBuffer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUBuffer: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUBuffer].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUBuffer].function! } public let jsObject: JSObject @@ -12,29 +12,29 @@ public class GPUBuffer: JSBridgedClass, GPUObjectBase { self.jsObject = jsObject } - public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) -> JSPromise { + @inlinable public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) -> JSPromise { let this = jsObject return this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) async throws { + @inlinable public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func getMappedRange(offset: GPUSize64? = nil, size: GPUSize64? = nil) -> ArrayBuffer { + @inlinable public func getMappedRange(offset: GPUSize64? = nil, size: GPUSize64? = nil) -> ArrayBuffer { let this = jsObject return this[Strings.getMappedRange].function!(this: this, arguments: [offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]).fromJSValue()! } - public func unmap() { + @inlinable public func unmap() { let this = jsObject _ = this[Strings.unmap].function!(this: this, arguments: []) } - public func destroy() { + @inlinable public func destroy() { let this = jsObject _ = this[Strings.destroy].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift b/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift index d24a01ce..b3257eeb 100644 --- a/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift +++ b/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift @@ -8,16 +8,16 @@ public enum GPUBufferBindingType: JSString, JSValueCompatible { case storage = "storage" case readOnlyStorage = "read-only-storage" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUBufferUsage.swift b/Sources/DOMKit/WebIDL/GPUBufferUsage.swift index 19f24ee7..7ae5cc37 100644 --- a/Sources/DOMKit/WebIDL/GPUBufferUsage.swift +++ b/Sources/DOMKit/WebIDL/GPUBufferUsage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public enum GPUBufferUsage { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { JSObject.global[Strings.GPUBufferUsage].object! } diff --git a/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift b/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift index 4afa667f..a2d2310a 100644 --- a/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift +++ b/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift @@ -7,16 +7,16 @@ public enum GPUCanvasCompositingAlphaMode: JSString, JSValueCompatible { case opaque = "opaque" case premultiplied = "premultiplied" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift index 02219392..053b04e5 100644 --- a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift +++ b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUCanvasContext: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPUCanvasContext].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCanvasContext].function! } public let jsObject: JSObject @@ -16,22 +16,22 @@ public class GPUCanvasContext: JSBridgedClass { @ReadonlyAttribute public var canvas: __UNSUPPORTED_UNION__ - public func configure(configuration: GPUCanvasConfiguration) { + @inlinable public func configure(configuration: GPUCanvasConfiguration) { let this = jsObject _ = this[Strings.configure].function!(this: this, arguments: [configuration.jsValue()]) } - public func unconfigure() { + @inlinable public func unconfigure() { let this = jsObject _ = this[Strings.unconfigure].function!(this: this, arguments: []) } - public func getPreferredFormat(adapter: GPUAdapter) -> GPUTextureFormat { + @inlinable public func getPreferredFormat(adapter: GPUAdapter) -> GPUTextureFormat { let this = jsObject return this[Strings.getPreferredFormat].function!(this: this, arguments: [adapter.jsValue()]).fromJSValue()! } - public func getCurrentTexture() -> GPUTexture { + @inlinable public func getCurrentTexture() -> GPUTexture { let this = jsObject return this[Strings.getCurrentTexture].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/GPUColorWrite.swift b/Sources/DOMKit/WebIDL/GPUColorWrite.swift index 300ca9a4..406c02a3 100644 --- a/Sources/DOMKit/WebIDL/GPUColorWrite.swift +++ b/Sources/DOMKit/WebIDL/GPUColorWrite.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public enum GPUColorWrite { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { JSObject.global[Strings.GPUColorWrite].object! } diff --git a/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift b/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift index ac975fff..32bee860 100644 --- a/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift +++ b/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUCommandBuffer: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUCommandBuffer].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCommandBuffer].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift b/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift index 7134f90d..19ce6bef 100644 --- a/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUCommandEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin { - public class var constructor: JSFunction { JSObject.global[Strings.GPUCommandEncoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCommandEncoder].function! } public let jsObject: JSObject @@ -12,52 +12,52 @@ public class GPUCommandEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, self.jsObject = jsObject } - public func beginRenderPass(descriptor: GPURenderPassDescriptor) -> GPURenderPassEncoder { + @inlinable public func beginRenderPass(descriptor: GPURenderPassDescriptor) -> GPURenderPassEncoder { let this = jsObject return this[Strings.beginRenderPass].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func beginComputePass(descriptor: GPUComputePassDescriptor? = nil) -> GPUComputePassEncoder { + @inlinable public func beginComputePass(descriptor: GPUComputePassDescriptor? = nil) -> GPUComputePassEncoder { let this = jsObject return this[Strings.beginComputePass].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } - public func copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64) { + @inlinable public func copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64) { let this = jsObject _ = this[Strings.copyBufferToBuffer].function!(this: this, arguments: [source.jsValue(), sourceOffset.jsValue(), destination.jsValue(), destinationOffset.jsValue(), size.jsValue()]) } - public func copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { + @inlinable public func copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { let this = jsObject _ = this[Strings.copyBufferToTexture].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) } - public func copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D) { + @inlinable public func copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D) { let this = jsObject _ = this[Strings.copyTextureToBuffer].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) } - public func copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { + @inlinable public func copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { let this = jsObject _ = this[Strings.copyTextureToTexture].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) } - public func clearBuffer(buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { + @inlinable public func clearBuffer(buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { let this = jsObject _ = this[Strings.clearBuffer].function!(this: this, arguments: [buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) } - public func writeTimestamp(querySet: GPUQuerySet, queryIndex: GPUSize32) { + @inlinable public func writeTimestamp(querySet: GPUQuerySet, queryIndex: GPUSize32) { let this = jsObject _ = this[Strings.writeTimestamp].function!(this: this, arguments: [querySet.jsValue(), queryIndex.jsValue()]) } - public func resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64) { + @inlinable public func resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64) { let this = jsObject _ = this[Strings.resolveQuerySet].function!(this: this, arguments: [querySet.jsValue(), firstQuery.jsValue(), queryCount.jsValue(), destination.jsValue(), destinationOffset.jsValue()]) } - public func finish(descriptor: GPUCommandBufferDescriptor? = nil) -> GPUCommandBuffer { + @inlinable public func finish(descriptor: GPUCommandBufferDescriptor? = nil) -> GPUCommandBuffer { let this = jsObject return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/GPUCompareFunction.swift b/Sources/DOMKit/WebIDL/GPUCompareFunction.swift index 6e8388f6..f9c97590 100644 --- a/Sources/DOMKit/WebIDL/GPUCompareFunction.swift +++ b/Sources/DOMKit/WebIDL/GPUCompareFunction.swift @@ -13,16 +13,16 @@ public enum GPUCompareFunction: JSString, JSValueCompatible { case greaterEqual = "greater-equal" case always = "always" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUCompilationInfo.swift b/Sources/DOMKit/WebIDL/GPUCompilationInfo.swift index c30a254f..05ed76ff 100644 --- a/Sources/DOMKit/WebIDL/GPUCompilationInfo.swift +++ b/Sources/DOMKit/WebIDL/GPUCompilationInfo.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUCompilationInfo: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPUCompilationInfo].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCompilationInfo].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift b/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift index b1ad4065..5b7631b6 100644 --- a/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift +++ b/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUCompilationMessage: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPUCompilationMessage].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCompilationMessage].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift b/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift index aa3e03f5..74c09ccb 100644 --- a/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift +++ b/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift @@ -8,16 +8,16 @@ public enum GPUCompilationMessageType: JSString, JSValueCompatible { case warning = "warning" case info = "info" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift index ab805156..53de6a37 100644 --- a/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUComputePassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder { - public class var constructor: JSFunction { JSObject.global[Strings.GPUComputePassEncoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUComputePassEncoder].function! } public let jsObject: JSObject @@ -12,22 +12,22 @@ public class GPUComputePassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMi self.jsObject = jsObject } - public func setPipeline(pipeline: GPUComputePipeline) { + @inlinable public func setPipeline(pipeline: GPUComputePipeline) { let this = jsObject _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue()]) } - public func dispatch(workgroupCountX: GPUSize32, workgroupCountY: GPUSize32? = nil, workgroupCountZ: GPUSize32? = nil) { + @inlinable public func dispatch(workgroupCountX: GPUSize32, workgroupCountY: GPUSize32? = nil, workgroupCountZ: GPUSize32? = nil) { let this = jsObject _ = this[Strings.dispatch].function!(this: this, arguments: [workgroupCountX.jsValue(), workgroupCountY?.jsValue() ?? .undefined, workgroupCountZ?.jsValue() ?? .undefined]) } - public func dispatchIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { + @inlinable public func dispatchIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { let this = jsObject _ = this[Strings.dispatchIndirect].function!(this: this, arguments: [indirectBuffer.jsValue(), indirectOffset.jsValue()]) } - public func end() { + @inlinable public func end() { let this = jsObject _ = this[Strings.end].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift b/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift index 7bd4f416..4a1d0f6a 100644 --- a/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift +++ b/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift @@ -7,16 +7,16 @@ public enum GPUComputePassTimestampLocation: JSString, JSValueCompatible { case beginning = "beginning" case end = "end" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUComputePipeline.swift b/Sources/DOMKit/WebIDL/GPUComputePipeline.swift index ecacd7f3..4c59a3ad 100644 --- a/Sources/DOMKit/WebIDL/GPUComputePipeline.swift +++ b/Sources/DOMKit/WebIDL/GPUComputePipeline.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUComputePipeline: JSBridgedClass, GPUObjectBase, GPUPipelineBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUComputePipeline].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUComputePipeline].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUCullMode.swift b/Sources/DOMKit/WebIDL/GPUCullMode.swift index 1f6b5a25..0e3c8393 100644 --- a/Sources/DOMKit/WebIDL/GPUCullMode.swift +++ b/Sources/DOMKit/WebIDL/GPUCullMode.swift @@ -8,16 +8,16 @@ public enum GPUCullMode: JSString, JSValueCompatible { case front = "front" case back = "back" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift b/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift index 4d92d88a..6c4bda65 100644 --- a/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift +++ b/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift @@ -5,17 +5,17 @@ import JavaScriptKit public protocol GPUDebugCommandsMixin: JSBridgedClass {} public extension GPUDebugCommandsMixin { - func pushDebugGroup(groupLabel: String) { + @inlinable func pushDebugGroup(groupLabel: String) { let this = jsObject _ = this[Strings.pushDebugGroup].function!(this: this, arguments: [groupLabel.jsValue()]) } - func popDebugGroup() { + @inlinable func popDebugGroup() { let this = jsObject _ = this[Strings.popDebugGroup].function!(this: this, arguments: []) } - func insertDebugMarker(markerLabel: String) { + @inlinable func insertDebugMarker(markerLabel: String) { let this = jsObject _ = this[Strings.insertDebugMarker].function!(this: this, arguments: [markerLabel.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/GPUDevice.swift b/Sources/DOMKit/WebIDL/GPUDevice.swift index 42b94132..5b8b2aff 100644 --- a/Sources/DOMKit/WebIDL/GPUDevice.swift +++ b/Sources/DOMKit/WebIDL/GPUDevice.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUDevice: EventTarget, GPUObjectBase { - override public class var constructor: JSFunction { JSObject.global[Strings.GPUDevice].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GPUDevice].function! } public required init(unsafelyWrapping jsObject: JSObject) { _features = ReadonlyAttribute(jsObject: jsObject, name: Strings.features) @@ -24,96 +24,96 @@ public class GPUDevice: EventTarget, GPUObjectBase { @ReadonlyAttribute public var queue: GPUQueue - public func destroy() { + @inlinable public func destroy() { let this = jsObject _ = this[Strings.destroy].function!(this: this, arguments: []) } - public func createBuffer(descriptor: GPUBufferDescriptor) -> GPUBuffer { + @inlinable public func createBuffer(descriptor: GPUBufferDescriptor) -> GPUBuffer { let this = jsObject return this[Strings.createBuffer].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createTexture(descriptor: GPUTextureDescriptor) -> GPUTexture { + @inlinable public func createTexture(descriptor: GPUTextureDescriptor) -> GPUTexture { let this = jsObject return this[Strings.createTexture].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createSampler(descriptor: GPUSamplerDescriptor? = nil) -> GPUSampler { + @inlinable public func createSampler(descriptor: GPUSamplerDescriptor? = nil) -> GPUSampler { let this = jsObject return this[Strings.createSampler].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } - public func importExternalTexture(descriptor: GPUExternalTextureDescriptor) -> GPUExternalTexture { + @inlinable public func importExternalTexture(descriptor: GPUExternalTextureDescriptor) -> GPUExternalTexture { let this = jsObject return this[Strings.importExternalTexture].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor) -> GPUBindGroupLayout { + @inlinable public func createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor) -> GPUBindGroupLayout { let this = jsObject return this[Strings.createBindGroupLayout].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor) -> GPUPipelineLayout { + @inlinable public func createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor) -> GPUPipelineLayout { let this = jsObject return this[Strings.createPipelineLayout].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createBindGroup(descriptor: GPUBindGroupDescriptor) -> GPUBindGroup { + @inlinable public func createBindGroup(descriptor: GPUBindGroupDescriptor) -> GPUBindGroup { let this = jsObject return this[Strings.createBindGroup].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createShaderModule(descriptor: GPUShaderModuleDescriptor) -> GPUShaderModule { + @inlinable public func createShaderModule(descriptor: GPUShaderModuleDescriptor) -> GPUShaderModule { let this = jsObject return this[Strings.createShaderModule].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createComputePipeline(descriptor: GPUComputePipelineDescriptor) -> GPUComputePipeline { + @inlinable public func createComputePipeline(descriptor: GPUComputePipelineDescriptor) -> GPUComputePipeline { let this = jsObject return this[Strings.createComputePipeline].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createRenderPipeline(descriptor: GPURenderPipelineDescriptor) -> GPURenderPipeline { + @inlinable public func createRenderPipeline(descriptor: GPURenderPipelineDescriptor) -> GPURenderPipeline { let this = jsObject return this[Strings.createRenderPipeline].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) -> JSPromise { + @inlinable public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) -> JSPromise { let this = jsObject return this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) async throws -> GPUComputePipeline { + @inlinable public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) async throws -> GPUComputePipeline { let this = jsObject let _promise: JSPromise = this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) -> JSPromise { + @inlinable public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) -> JSPromise { let this = jsObject return this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) async throws -> GPURenderPipeline { + @inlinable public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) async throws -> GPURenderPipeline { let this = jsObject let _promise: JSPromise = this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func createCommandEncoder(descriptor: GPUCommandEncoderDescriptor? = nil) -> GPUCommandEncoder { + @inlinable public func createCommandEncoder(descriptor: GPUCommandEncoderDescriptor? = nil) -> GPUCommandEncoder { let this = jsObject return this[Strings.createCommandEncoder].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } - public func createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor) -> GPURenderBundleEncoder { + @inlinable public func createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor) -> GPURenderBundleEncoder { let this = jsObject return this[Strings.createRenderBundleEncoder].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } - public func createQuerySet(descriptor: GPUQuerySetDescriptor) -> GPUQuerySet { + @inlinable public func createQuerySet(descriptor: GPUQuerySetDescriptor) -> GPUQuerySet { let this = jsObject return this[Strings.createQuerySet].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! } @@ -121,18 +121,18 @@ public class GPUDevice: EventTarget, GPUObjectBase { @ReadonlyAttribute public var lost: JSPromise - public func pushErrorScope(filter: GPUErrorFilter) { + @inlinable public func pushErrorScope(filter: GPUErrorFilter) { let this = jsObject _ = this[Strings.pushErrorScope].function!(this: this, arguments: [filter.jsValue()]) } - public func popErrorScope() -> JSPromise { + @inlinable public func popErrorScope() -> JSPromise { let this = jsObject return this[Strings.popErrorScope].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func popErrorScope() async throws -> GPUError? { + @inlinable public func popErrorScope() async throws -> GPUError? { let this = jsObject let _promise: JSPromise = this[Strings.popErrorScope].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift index bc4ac9e3..de804eed 100644 --- a/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift +++ b/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUDeviceLostInfo: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPUDeviceLostInfo].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUDeviceLostInfo].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift index a99a2e9a..bf59bf81 100644 --- a/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift +++ b/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum GPUDeviceLostReason: JSString, JSValueCompatible { case destroyed = "destroyed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUErrorFilter.swift b/Sources/DOMKit/WebIDL/GPUErrorFilter.swift index c4481a00..4ec0dea9 100644 --- a/Sources/DOMKit/WebIDL/GPUErrorFilter.swift +++ b/Sources/DOMKit/WebIDL/GPUErrorFilter.swift @@ -7,16 +7,16 @@ public enum GPUErrorFilter: JSString, JSValueCompatible { case outOfMemory = "out-of-memory" case validation = "validation" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUExternalTexture.swift b/Sources/DOMKit/WebIDL/GPUExternalTexture.swift index 152e1090..73676354 100644 --- a/Sources/DOMKit/WebIDL/GPUExternalTexture.swift +++ b/Sources/DOMKit/WebIDL/GPUExternalTexture.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUExternalTexture: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUExternalTexture].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUExternalTexture].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUFeatureName.swift b/Sources/DOMKit/WebIDL/GPUFeatureName.swift index 3ab1f34f..e1c7f0f3 100644 --- a/Sources/DOMKit/WebIDL/GPUFeatureName.swift +++ b/Sources/DOMKit/WebIDL/GPUFeatureName.swift @@ -13,16 +13,16 @@ public enum GPUFeatureName: JSString, JSValueCompatible { case timestampQuery = "timestamp-query" case indirectFirstInstance = "indirect-first-instance" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUFilterMode.swift b/Sources/DOMKit/WebIDL/GPUFilterMode.swift index f3e5e2b4..ebbb95a5 100644 --- a/Sources/DOMKit/WebIDL/GPUFilterMode.swift +++ b/Sources/DOMKit/WebIDL/GPUFilterMode.swift @@ -7,16 +7,16 @@ public enum GPUFilterMode: JSString, JSValueCompatible { case nearest = "nearest" case linear = "linear" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUFrontFace.swift b/Sources/DOMKit/WebIDL/GPUFrontFace.swift index 721695c4..356e8657 100644 --- a/Sources/DOMKit/WebIDL/GPUFrontFace.swift +++ b/Sources/DOMKit/WebIDL/GPUFrontFace.swift @@ -7,16 +7,16 @@ public enum GPUFrontFace: JSString, JSValueCompatible { case ccw = "ccw" case cw = "cw" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUIndexFormat.swift b/Sources/DOMKit/WebIDL/GPUIndexFormat.swift index d04ba305..167f538a 100644 --- a/Sources/DOMKit/WebIDL/GPUIndexFormat.swift +++ b/Sources/DOMKit/WebIDL/GPUIndexFormat.swift @@ -7,16 +7,16 @@ public enum GPUIndexFormat: JSString, JSValueCompatible { case uint16 = "uint16" case uint32 = "uint32" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPULoadOp.swift b/Sources/DOMKit/WebIDL/GPULoadOp.swift index ee8f8c07..71809929 100644 --- a/Sources/DOMKit/WebIDL/GPULoadOp.swift +++ b/Sources/DOMKit/WebIDL/GPULoadOp.swift @@ -7,16 +7,16 @@ public enum GPULoadOp: JSString, JSValueCompatible { case load = "load" case clear = "clear" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUMapMode.swift b/Sources/DOMKit/WebIDL/GPUMapMode.swift index efb6b83c..689bb051 100644 --- a/Sources/DOMKit/WebIDL/GPUMapMode.swift +++ b/Sources/DOMKit/WebIDL/GPUMapMode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public enum GPUMapMode { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { JSObject.global[Strings.GPUMapMode].object! } diff --git a/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift b/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift index c95dcd47..fbf4f54b 100644 --- a/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift +++ b/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift @@ -7,16 +7,16 @@ public enum GPUMipmapFilterMode: JSString, JSValueCompatible { case nearest = "nearest" case linear = "linear" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUObjectBase.swift b/Sources/DOMKit/WebIDL/GPUObjectBase.swift index f67ba423..3aa206e4 100644 --- a/Sources/DOMKit/WebIDL/GPUObjectBase.swift +++ b/Sources/DOMKit/WebIDL/GPUObjectBase.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol GPUObjectBase: JSBridgedClass {} public extension GPUObjectBase { - var label: __UNSUPPORTED_UNION__ { + @inlinable var label: __UNSUPPORTED_UNION__ { get { ReadWriteAttribute[Strings.label, in: jsObject] } set { ReadWriteAttribute[Strings.label, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift b/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift index 612d0ea0..8280d900 100644 --- a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift +++ b/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUOutOfMemoryError: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPUOutOfMemoryError].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUOutOfMemoryError].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class GPUOutOfMemoryError: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/GPUPipelineBase.swift b/Sources/DOMKit/WebIDL/GPUPipelineBase.swift index 66972fba..4c79c110 100644 --- a/Sources/DOMKit/WebIDL/GPUPipelineBase.swift +++ b/Sources/DOMKit/WebIDL/GPUPipelineBase.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol GPUPipelineBase: JSBridgedClass {} public extension GPUPipelineBase { - func getBindGroupLayout(index: UInt32) -> GPUBindGroupLayout { + @inlinable func getBindGroupLayout(index: UInt32) -> GPUBindGroupLayout { let this = jsObject return this[Strings.getBindGroupLayout].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift b/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift index 6b376e13..099c4c5a 100644 --- a/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift +++ b/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUPipelineLayout: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUPipelineLayout].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUPipelineLayout].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUPowerPreference.swift b/Sources/DOMKit/WebIDL/GPUPowerPreference.swift index 520ce024..81d682a1 100644 --- a/Sources/DOMKit/WebIDL/GPUPowerPreference.swift +++ b/Sources/DOMKit/WebIDL/GPUPowerPreference.swift @@ -7,16 +7,16 @@ public enum GPUPowerPreference: JSString, JSValueCompatible { case lowPower = "low-power" case highPerformance = "high-performance" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift index 2a5464cc..411d74e0 100644 --- a/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift +++ b/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum GPUPredefinedColorSpace: JSString, JSValueCompatible { case srgb = "srgb" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift b/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift index 9cb8a8d4..37925367 100644 --- a/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift +++ b/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift @@ -10,16 +10,16 @@ public enum GPUPrimitiveTopology: JSString, JSValueCompatible { case triangleList = "triangle-list" case triangleStrip = "triangle-strip" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift index b63562eb..59e7be08 100644 --- a/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift @@ -5,12 +5,12 @@ import JavaScriptKit public protocol GPUProgrammablePassEncoder: JSBridgedClass {} public extension GPUProgrammablePassEncoder { - func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets: [GPUBufferDynamicOffset]? = nil) { + @inlinable func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets: [GPUBufferDynamicOffset]? = nil) { let this = jsObject _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue(), bindGroup.jsValue(), dynamicOffsets?.jsValue() ?? .undefined]) } - func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32) { + @inlinable func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32) { let this = jsObject _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue(), bindGroup.jsValue(), dynamicOffsetsData.jsValue(), dynamicOffsetsDataStart.jsValue(), dynamicOffsetsDataLength.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/GPUQuerySet.swift b/Sources/DOMKit/WebIDL/GPUQuerySet.swift index 0b6bccf9..2f5e208f 100644 --- a/Sources/DOMKit/WebIDL/GPUQuerySet.swift +++ b/Sources/DOMKit/WebIDL/GPUQuerySet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUQuerySet: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUQuerySet].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUQuerySet].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class GPUQuerySet: JSBridgedClass, GPUObjectBase { self.jsObject = jsObject } - public func destroy() { + @inlinable public func destroy() { let this = jsObject _ = this[Strings.destroy].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/GPUQueryType.swift b/Sources/DOMKit/WebIDL/GPUQueryType.swift index 12033db0..ebab69cb 100644 --- a/Sources/DOMKit/WebIDL/GPUQueryType.swift +++ b/Sources/DOMKit/WebIDL/GPUQueryType.swift @@ -7,16 +7,16 @@ public enum GPUQueryType: JSString, JSValueCompatible { case occlusion = "occlusion" case timestamp = "timestamp" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUQueue.swift b/Sources/DOMKit/WebIDL/GPUQueue.swift index 74192967..b986f302 100644 --- a/Sources/DOMKit/WebIDL/GPUQueue.swift +++ b/Sources/DOMKit/WebIDL/GPUQueue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUQueue: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUQueue].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUQueue].function! } public let jsObject: JSObject @@ -12,34 +12,34 @@ public class GPUQueue: JSBridgedClass, GPUObjectBase { self.jsObject = jsObject } - public func submit(commandBuffers: [GPUCommandBuffer]) { + @inlinable public func submit(commandBuffers: [GPUCommandBuffer]) { let this = jsObject _ = this[Strings.submit].function!(this: this, arguments: [commandBuffers.jsValue()]) } - public func onSubmittedWorkDone() -> JSPromise { + @inlinable public func onSubmittedWorkDone() -> JSPromise { let this = jsObject return this[Strings.onSubmittedWorkDone].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func onSubmittedWorkDone() async throws { + @inlinable public func onSubmittedWorkDone() async throws { let this = jsObject let _promise: JSPromise = this[Strings.onSubmittedWorkDone].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: BufferSource, dataOffset: GPUSize64? = nil, size: GPUSize64? = nil) { + @inlinable public func writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: BufferSource, dataOffset: GPUSize64? = nil, size: GPUSize64? = nil) { let this = jsObject _ = this[Strings.writeBuffer].function!(this: this, arguments: [buffer.jsValue(), bufferOffset.jsValue(), data.jsValue(), dataOffset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) } - public func writeTexture(destination: GPUImageCopyTexture, data: BufferSource, dataLayout: GPUImageDataLayout, size: GPUExtent3D) { + @inlinable public func writeTexture(destination: GPUImageCopyTexture, data: BufferSource, dataLayout: GPUImageDataLayout, size: GPUExtent3D) { let this = jsObject _ = this[Strings.writeTexture].function!(this: this, arguments: [destination.jsValue(), data.jsValue(), dataLayout.jsValue(), size.jsValue()]) } - public func copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: GPUExtent3D) { + @inlinable public func copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: GPUExtent3D) { let this = jsObject _ = this[Strings.copyExternalImageToTexture].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/GPURenderBundle.swift b/Sources/DOMKit/WebIDL/GPURenderBundle.swift index 61dc62fd..25dedd2a 100644 --- a/Sources/DOMKit/WebIDL/GPURenderBundle.swift +++ b/Sources/DOMKit/WebIDL/GPURenderBundle.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPURenderBundle: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPURenderBundle].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPURenderBundle].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift index 590f33ce..aba210a9 100644 --- a/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPURenderBundleEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder, GPURenderEncoderBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPURenderBundleEncoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPURenderBundleEncoder].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class GPURenderBundleEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsM self.jsObject = jsObject } - public func finish(descriptor: GPURenderBundleDescriptor? = nil) -> GPURenderBundle { + @inlinable public func finish(descriptor: GPURenderBundleDescriptor? = nil) -> GPURenderBundle { let this = jsObject return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift b/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift index 9152ef6a..43dbc3a1 100644 --- a/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift +++ b/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift @@ -5,37 +5,37 @@ import JavaScriptKit public protocol GPURenderEncoderBase: JSBridgedClass {} public extension GPURenderEncoderBase { - func setPipeline(pipeline: GPURenderPipeline) { + @inlinable func setPipeline(pipeline: GPURenderPipeline) { let this = jsObject _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue()]) } - func setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset: GPUSize64? = nil, size: GPUSize64? = nil) { + @inlinable func setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset: GPUSize64? = nil, size: GPUSize64? = nil) { let this = jsObject _ = this[Strings.setIndexBuffer].function!(this: this, arguments: [buffer.jsValue(), indexFormat.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) } - func setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { + @inlinable func setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { let this = jsObject _ = this[Strings.setVertexBuffer].function!(this: this, arguments: [slot.jsValue(), buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) } - func draw(vertexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstVertex: GPUSize32? = nil, firstInstance: GPUSize32? = nil) { + @inlinable func draw(vertexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstVertex: GPUSize32? = nil, firstInstance: GPUSize32? = nil) { let this = jsObject _ = this[Strings.draw].function!(this: this, arguments: [vertexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined]) } - func drawIndexed(indexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstIndex: GPUSize32? = nil, baseVertex: GPUSignedOffset32? = nil, firstInstance: GPUSize32? = nil) { + @inlinable func drawIndexed(indexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstIndex: GPUSize32? = nil, baseVertex: GPUSignedOffset32? = nil, firstInstance: GPUSize32? = nil) { let this = jsObject _ = this[Strings.drawIndexed].function!(this: this, arguments: [indexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstIndex?.jsValue() ?? .undefined, baseVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined]) } - func drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { + @inlinable func drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { let this = jsObject _ = this[Strings.drawIndirect].function!(this: this, arguments: [indirectBuffer.jsValue(), indirectOffset.jsValue()]) } - func drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { + @inlinable func drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { let this = jsObject _ = this[Strings.drawIndexedIndirect].function!(this: this, arguments: [indirectBuffer.jsValue(), indirectOffset.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift index e521682c..f217e0d4 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPURenderPassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder, GPURenderEncoderBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPURenderPassEncoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPURenderPassEncoder].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class GPURenderPassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMix self.jsObject = jsObject } - public func setViewport(x: Float, y: Float, width: Float, height: Float, minDepth: Float, maxDepth: Float) { + @inlinable public func setViewport(x: Float, y: Float, width: Float, height: Float, minDepth: Float, maxDepth: Float) { let _arg0 = x.jsValue() let _arg1 = y.jsValue() let _arg2 = width.jsValue() @@ -23,37 +23,37 @@ public class GPURenderPassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMix _ = this[Strings.setViewport].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - public func setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate) { + @inlinable public func setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate) { let this = jsObject _ = this[Strings.setScissorRect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()]) } - public func setBlendConstant(color: GPUColor) { + @inlinable public func setBlendConstant(color: GPUColor) { let this = jsObject _ = this[Strings.setBlendConstant].function!(this: this, arguments: [color.jsValue()]) } - public func setStencilReference(reference: GPUStencilValue) { + @inlinable public func setStencilReference(reference: GPUStencilValue) { let this = jsObject _ = this[Strings.setStencilReference].function!(this: this, arguments: [reference.jsValue()]) } - public func beginOcclusionQuery(queryIndex: GPUSize32) { + @inlinable public func beginOcclusionQuery(queryIndex: GPUSize32) { let this = jsObject _ = this[Strings.beginOcclusionQuery].function!(this: this, arguments: [queryIndex.jsValue()]) } - public func endOcclusionQuery() { + @inlinable public func endOcclusionQuery() { let this = jsObject _ = this[Strings.endOcclusionQuery].function!(this: this, arguments: []) } - public func executeBundles(bundles: [GPURenderBundle]) { + @inlinable public func executeBundles(bundles: [GPURenderBundle]) { let this = jsObject _ = this[Strings.executeBundles].function!(this: this, arguments: [bundles.jsValue()]) } - public func end() { + @inlinable public func end() { let this = jsObject _ = this[Strings.end].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift b/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift index 63ddc0dc..7b87559d 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift @@ -7,16 +7,16 @@ public enum GPURenderPassTimestampLocation: JSString, JSValueCompatible { case beginning = "beginning" case end = "end" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPURenderPipeline.swift b/Sources/DOMKit/WebIDL/GPURenderPipeline.swift index 82550d89..86bfd70c 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPipeline.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPipeline.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPURenderPipeline: JSBridgedClass, GPUObjectBase, GPUPipelineBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPURenderPipeline].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPURenderPipeline].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUSampler.swift b/Sources/DOMKit/WebIDL/GPUSampler.swift index 802f08c7..acfc0b81 100644 --- a/Sources/DOMKit/WebIDL/GPUSampler.swift +++ b/Sources/DOMKit/WebIDL/GPUSampler.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUSampler: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUSampler].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUSampler].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift b/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift index ebccb701..a259534e 100644 --- a/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift +++ b/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift @@ -8,16 +8,16 @@ public enum GPUSamplerBindingType: JSString, JSValueCompatible { case nonFiltering = "non-filtering" case comparison = "comparison" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUShaderModule.swift b/Sources/DOMKit/WebIDL/GPUShaderModule.swift index 116001d8..9819db15 100644 --- a/Sources/DOMKit/WebIDL/GPUShaderModule.swift +++ b/Sources/DOMKit/WebIDL/GPUShaderModule.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUShaderModule: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUShaderModule].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUShaderModule].function! } public let jsObject: JSObject @@ -12,13 +12,13 @@ public class GPUShaderModule: JSBridgedClass, GPUObjectBase { self.jsObject = jsObject } - public func compilationInfo() -> JSPromise { + @inlinable public func compilationInfo() -> JSPromise { let this = jsObject return this[Strings.compilationInfo].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func compilationInfo() async throws -> GPUCompilationInfo { + @inlinable public func compilationInfo() async throws -> GPUCompilationInfo { let this = jsObject let _promise: JSPromise = this[Strings.compilationInfo].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/GPUShaderStage.swift b/Sources/DOMKit/WebIDL/GPUShaderStage.swift index cb86ea17..6b91ef75 100644 --- a/Sources/DOMKit/WebIDL/GPUShaderStage.swift +++ b/Sources/DOMKit/WebIDL/GPUShaderStage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public enum GPUShaderStage { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { JSObject.global[Strings.GPUShaderStage].object! } diff --git a/Sources/DOMKit/WebIDL/GPUStencilOperation.swift b/Sources/DOMKit/WebIDL/GPUStencilOperation.swift index c36f970a..0c834ec5 100644 --- a/Sources/DOMKit/WebIDL/GPUStencilOperation.swift +++ b/Sources/DOMKit/WebIDL/GPUStencilOperation.swift @@ -13,16 +13,16 @@ public enum GPUStencilOperation: JSString, JSValueCompatible { case incrementWrap = "increment-wrap" case decrementWrap = "decrement-wrap" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift b/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift index df91bc95..989176b6 100644 --- a/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift +++ b/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum GPUStorageTextureAccess: JSString, JSValueCompatible { case writeOnly = "write-only" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUStoreOp.swift b/Sources/DOMKit/WebIDL/GPUStoreOp.swift index 9fcb8cec..faff8cd9 100644 --- a/Sources/DOMKit/WebIDL/GPUStoreOp.swift +++ b/Sources/DOMKit/WebIDL/GPUStoreOp.swift @@ -7,16 +7,16 @@ public enum GPUStoreOp: JSString, JSValueCompatible { case store = "store" case discard = "discard" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift b/Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift index a8357ed5..b30a044d 100644 --- a/Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift +++ b/Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUSupportedFeatures: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPUSupportedFeatures].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUSupportedFeatures].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift b/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift index 965837f0..83e01311 100644 --- a/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift +++ b/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUSupportedLimits: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPUSupportedLimits].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUSupportedLimits].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUTexture.swift b/Sources/DOMKit/WebIDL/GPUTexture.swift index 10531602..521c9f8f 100644 --- a/Sources/DOMKit/WebIDL/GPUTexture.swift +++ b/Sources/DOMKit/WebIDL/GPUTexture.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUTexture: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUTexture].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUTexture].function! } public let jsObject: JSObject @@ -12,12 +12,12 @@ public class GPUTexture: JSBridgedClass, GPUObjectBase { self.jsObject = jsObject } - public func createView(descriptor: GPUTextureViewDescriptor? = nil) -> GPUTextureView { + @inlinable public func createView(descriptor: GPUTextureViewDescriptor? = nil) -> GPUTextureView { let this = jsObject return this[Strings.createView].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! } - public func destroy() { + @inlinable public func destroy() { let this = jsObject _ = this[Strings.destroy].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/GPUTextureAspect.swift b/Sources/DOMKit/WebIDL/GPUTextureAspect.swift index 8a52d4c6..58e63114 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureAspect.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureAspect.swift @@ -8,16 +8,16 @@ public enum GPUTextureAspect: JSString, JSValueCompatible { case stencilOnly = "stencil-only" case depthOnly = "depth-only" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUTextureDimension.swift b/Sources/DOMKit/WebIDL/GPUTextureDimension.swift index 12d73f83..cc56a978 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureDimension.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureDimension.swift @@ -8,16 +8,16 @@ public enum GPUTextureDimension: JSString, JSValueCompatible { case _2d = "2d" case _3d = "3d" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUTextureFormat.swift b/Sources/DOMKit/WebIDL/GPUTextureFormat.swift index cfee9b01..14737992 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureFormat.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureFormat.swift @@ -100,16 +100,16 @@ public enum GPUTextureFormat: JSString, JSValueCompatible { case astc12x12Unorm = "astc-12x12-unorm" case astc12x12UnormSrgb = "astc-12x12-unorm-srgb" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift b/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift index f3709129..4f7dd59d 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift @@ -10,16 +10,16 @@ public enum GPUTextureSampleType: JSString, JSValueCompatible { case sint = "sint" case uint = "uint" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUTextureUsage.swift b/Sources/DOMKit/WebIDL/GPUTextureUsage.swift index 0f496028..aa4462b3 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureUsage.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureUsage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public enum GPUTextureUsage { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { JSObject.global[Strings.GPUTextureUsage].object! } diff --git a/Sources/DOMKit/WebIDL/GPUTextureView.swift b/Sources/DOMKit/WebIDL/GPUTextureView.swift index 6b08fa3b..2da5a848 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureView.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureView.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUTextureView: JSBridgedClass, GPUObjectBase { - public class var constructor: JSFunction { JSObject.global[Strings.GPUTextureView].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUTextureView].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift b/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift index efec5cbf..99f69dc6 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift @@ -11,16 +11,16 @@ public enum GPUTextureViewDimension: JSString, JSValueCompatible { case cubeArray = "cube-array" case _3d = "3d" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift index 4afc0156..ac8c9666 100644 --- a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUUncapturedErrorEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.GPUUncapturedErrorEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GPUUncapturedErrorEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit) { + @inlinable public convenience init(type: String, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), gpuUncapturedErrorEventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/GPUValidationError.swift b/Sources/DOMKit/WebIDL/GPUValidationError.swift index 6d0b4b66..8bcb1969 100644 --- a/Sources/DOMKit/WebIDL/GPUValidationError.swift +++ b/Sources/DOMKit/WebIDL/GPUValidationError.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUValidationError: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GPUValidationError].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUValidationError].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class GPUValidationError: JSBridgedClass { self.jsObject = jsObject } - public convenience init(message: String) { + @inlinable public convenience init(message: String) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [message.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/GPUVertexFormat.swift b/Sources/DOMKit/WebIDL/GPUVertexFormat.swift index df7930e0..09bfe333 100644 --- a/Sources/DOMKit/WebIDL/GPUVertexFormat.swift +++ b/Sources/DOMKit/WebIDL/GPUVertexFormat.swift @@ -35,16 +35,16 @@ public enum GPUVertexFormat: JSString, JSValueCompatible { case sint32x3 = "sint32x3" case sint32x4 = "sint32x4" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift b/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift index 696f7eb0..19132f65 100644 --- a/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift +++ b/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift @@ -7,16 +7,16 @@ public enum GPUVertexStepMode: JSString, JSValueCompatible { case vertex = "vertex" case instance = "instance" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GainNode.swift b/Sources/DOMKit/WebIDL/GainNode.swift index b886d480..577a35cd 100644 --- a/Sources/DOMKit/WebIDL/GainNode.swift +++ b/Sources/DOMKit/WebIDL/GainNode.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class GainNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.GainNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GainNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _gain = ReadonlyAttribute(jsObject: jsObject, name: Strings.gain) super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: GainOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: GainOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/Gamepad.swift b/Sources/DOMKit/WebIDL/Gamepad.swift index 66829d13..dc05eaa0 100644 --- a/Sources/DOMKit/WebIDL/Gamepad.swift +++ b/Sources/DOMKit/WebIDL/Gamepad.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Gamepad: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Gamepad].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Gamepad].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GamepadButton.swift b/Sources/DOMKit/WebIDL/GamepadButton.swift index d8101a99..7a7e05e4 100644 --- a/Sources/DOMKit/WebIDL/GamepadButton.swift +++ b/Sources/DOMKit/WebIDL/GamepadButton.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GamepadButton: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GamepadButton].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GamepadButton].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GamepadEvent.swift b/Sources/DOMKit/WebIDL/GamepadEvent.swift index 75b3b364..60632c36 100644 --- a/Sources/DOMKit/WebIDL/GamepadEvent.swift +++ b/Sources/DOMKit/WebIDL/GamepadEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class GamepadEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.GamepadEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GamepadEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _gamepad = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamepad) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: GamepadEventInit) { + @inlinable public convenience init(type: String, eventInitDict: GamepadEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/GamepadHand.swift b/Sources/DOMKit/WebIDL/GamepadHand.swift index 84775529..e76a6206 100644 --- a/Sources/DOMKit/WebIDL/GamepadHand.swift +++ b/Sources/DOMKit/WebIDL/GamepadHand.swift @@ -8,16 +8,16 @@ public enum GamepadHand: JSString, JSValueCompatible { case left = "left" case right = "right" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift b/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift index f6aed33c..4a07cf10 100644 --- a/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift +++ b/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GamepadHapticActuator: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GamepadHapticActuator].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GamepadHapticActuator].function! } public let jsObject: JSObject @@ -16,13 +16,13 @@ public class GamepadHapticActuator: JSBridgedClass { @ReadonlyAttribute public var type: GamepadHapticActuatorType - public func pulse(value: Double, duration: Double) -> JSPromise { + @inlinable public func pulse(value: Double, duration: Double) -> JSPromise { let this = jsObject return this[Strings.pulse].function!(this: this, arguments: [value.jsValue(), duration.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func pulse(value: Double, duration: Double) async throws -> Bool { + @inlinable public func pulse(value: Double, duration: Double) async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.pulse].function!(this: this, arguments: [value.jsValue(), duration.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift b/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift index fd6552e7..4fd1f112 100644 --- a/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift +++ b/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum GamepadHapticActuatorType: JSString, JSValueCompatible { case vibration = "vibration" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GamepadMappingType.swift b/Sources/DOMKit/WebIDL/GamepadMappingType.swift index e410b5ab..b8cd47d8 100644 --- a/Sources/DOMKit/WebIDL/GamepadMappingType.swift +++ b/Sources/DOMKit/WebIDL/GamepadMappingType.swift @@ -8,16 +8,16 @@ public enum GamepadMappingType: JSString, JSValueCompatible { case standard = "standard" case xrStandard = "xr-standard" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/GamepadPose.swift b/Sources/DOMKit/WebIDL/GamepadPose.swift index 3f085d20..de836c8a 100644 --- a/Sources/DOMKit/WebIDL/GamepadPose.swift +++ b/Sources/DOMKit/WebIDL/GamepadPose.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GamepadPose: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GamepadPose].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GamepadPose].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GamepadTouch.swift b/Sources/DOMKit/WebIDL/GamepadTouch.swift index a720cad5..206867c8 100644 --- a/Sources/DOMKit/WebIDL/GamepadTouch.swift +++ b/Sources/DOMKit/WebIDL/GamepadTouch.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GamepadTouch: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GamepadTouch].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GamepadTouch].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GenericTransformStream.swift b/Sources/DOMKit/WebIDL/GenericTransformStream.swift index 20704ef4..a5773286 100644 --- a/Sources/DOMKit/WebIDL/GenericTransformStream.swift +++ b/Sources/DOMKit/WebIDL/GenericTransformStream.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol GenericTransformStream: JSBridgedClass {} public extension GenericTransformStream { - var readable: ReadableStream { ReadonlyAttribute[Strings.readable, in: jsObject] } + @inlinable var readable: ReadableStream { ReadonlyAttribute[Strings.readable, in: jsObject] } - var writable: WritableStream { ReadonlyAttribute[Strings.writable, in: jsObject] } + @inlinable var writable: WritableStream { ReadonlyAttribute[Strings.writable, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Geolocation.swift b/Sources/DOMKit/WebIDL/Geolocation.swift index b0710a71..02c66e09 100644 --- a/Sources/DOMKit/WebIDL/Geolocation.swift +++ b/Sources/DOMKit/WebIDL/Geolocation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Geolocation: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Geolocation].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Geolocation].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class Geolocation: JSBridgedClass { // XXX: member 'watchPosition' is ignored - public func clearWatch(watchId: Int32) { + @inlinable public func clearWatch(watchId: Int32) { let this = jsObject _ = this[Strings.clearWatch].function!(this: this, arguments: [watchId.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift b/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift index cb62d0c9..4d9e52b2 100644 --- a/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift +++ b/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GeolocationCoordinates: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GeolocationCoordinates].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GeolocationCoordinates].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GeolocationPosition.swift b/Sources/DOMKit/WebIDL/GeolocationPosition.swift index 602fa788..0b479d22 100644 --- a/Sources/DOMKit/WebIDL/GeolocationPosition.swift +++ b/Sources/DOMKit/WebIDL/GeolocationPosition.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GeolocationPosition: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GeolocationPosition].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GeolocationPosition].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GeolocationPositionError.swift b/Sources/DOMKit/WebIDL/GeolocationPositionError.swift index 0b197660..455722eb 100644 --- a/Sources/DOMKit/WebIDL/GeolocationPositionError.swift +++ b/Sources/DOMKit/WebIDL/GeolocationPositionError.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GeolocationPositionError: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GeolocationPositionError].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GeolocationPositionError].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/GeolocationSensor.swift b/Sources/DOMKit/WebIDL/GeolocationSensor.swift index 560deb84..b1739770 100644 --- a/Sources/DOMKit/WebIDL/GeolocationSensor.swift +++ b/Sources/DOMKit/WebIDL/GeolocationSensor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GeolocationSensor: Sensor { - override public class var constructor: JSFunction { JSObject.global[Strings.GeolocationSensor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GeolocationSensor].function! } public required init(unsafelyWrapping jsObject: JSObject) { _latitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.latitude) @@ -17,17 +17,17 @@ public class GeolocationSensor: Sensor { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: GeolocationSensorOptions? = nil) { + @inlinable public convenience init(options: GeolocationSensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } - public static func read(readOptions: ReadOptions? = nil) -> JSPromise { + @inlinable public static func read(readOptions: ReadOptions? = nil) -> JSPromise { let this = constructor return this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func read(readOptions: ReadOptions? = nil) async throws -> GeolocationSensorReading { + @inlinable public static func read(readOptions: ReadOptions? = nil) async throws -> GeolocationSensorReading { let this = constructor let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/GeometryUtils.swift b/Sources/DOMKit/WebIDL/GeometryUtils.swift index ecacea3c..5daabbf4 100644 --- a/Sources/DOMKit/WebIDL/GeometryUtils.swift +++ b/Sources/DOMKit/WebIDL/GeometryUtils.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol GeometryUtils: JSBridgedClass {} public extension GeometryUtils { - func getBoxQuads(options: BoxQuadOptions? = nil) -> [DOMQuad] { + @inlinable func getBoxQuads(options: BoxQuadOptions? = nil) -> [DOMQuad] { let this = jsObject return this[Strings.getBoxQuads].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - func convertQuadFromNode(quad: DOMQuadInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { + @inlinable func convertQuadFromNode(quad: DOMQuadInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { let this = jsObject return this[Strings.convertQuadFromNode].function!(this: this, arguments: [quad.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - func convertRectFromNode(rect: DOMRectReadOnly, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { + @inlinable func convertRectFromNode(rect: DOMRectReadOnly, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { let this = jsObject return this[Strings.convertRectFromNode].function!(this: this, arguments: [rect.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - func convertPointFromNode(point: DOMPointInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMPoint { + @inlinable func convertPointFromNode(point: DOMPointInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMPoint { let this = jsObject return this[Strings.convertPointFromNode].function!(this: this, arguments: [point.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/GetSVGDocument.swift b/Sources/DOMKit/WebIDL/GetSVGDocument.swift index 8cb51a61..224ca574 100644 --- a/Sources/DOMKit/WebIDL/GetSVGDocument.swift +++ b/Sources/DOMKit/WebIDL/GetSVGDocument.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol GetSVGDocument: JSBridgedClass {} public extension GetSVGDocument { - func getSVGDocument() -> Document { + @inlinable func getSVGDocument() -> Document { let this = jsObject return this[Strings.getSVGDocument].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Global.swift b/Sources/DOMKit/WebIDL/Global.swift index 0cc49e86..51f209e8 100644 --- a/Sources/DOMKit/WebIDL/Global.swift +++ b/Sources/DOMKit/WebIDL/Global.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Global: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Global].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Global].function! } public let jsObject: JSObject @@ -13,11 +13,11 @@ public class Global: JSBridgedClass { self.jsObject = jsObject } - public convenience init(descriptor: GlobalDescriptor, v: JSValue? = nil) { + @inlinable public convenience init(descriptor: GlobalDescriptor, v: JSValue? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue(), v?.jsValue() ?? .undefined])) } - public func valueOf() -> JSValue { + @inlinable public func valueOf() -> JSValue { let this = jsObject return this[Strings.valueOf].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index f3359b6f..e589fb35 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -5,472 +5,472 @@ import JavaScriptKit public protocol GlobalEventHandlers: JSBridgedClass {} public extension GlobalEventHandlers { - var onanimationstart: EventHandler { + @inlinable var onanimationstart: EventHandler { get { ClosureAttribute1Optional[Strings.onanimationstart, in: jsObject] } set { ClosureAttribute1Optional[Strings.onanimationstart, in: jsObject] = newValue } } - var onanimationiteration: EventHandler { + @inlinable var onanimationiteration: EventHandler { get { ClosureAttribute1Optional[Strings.onanimationiteration, in: jsObject] } set { ClosureAttribute1Optional[Strings.onanimationiteration, in: jsObject] = newValue } } - var onanimationend: EventHandler { + @inlinable var onanimationend: EventHandler { get { ClosureAttribute1Optional[Strings.onanimationend, in: jsObject] } set { ClosureAttribute1Optional[Strings.onanimationend, in: jsObject] = newValue } } - var onanimationcancel: EventHandler { + @inlinable var onanimationcancel: EventHandler { get { ClosureAttribute1Optional[Strings.onanimationcancel, in: jsObject] } set { ClosureAttribute1Optional[Strings.onanimationcancel, in: jsObject] = newValue } } - var ontransitionrun: EventHandler { + @inlinable var ontransitionrun: EventHandler { get { ClosureAttribute1Optional[Strings.ontransitionrun, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontransitionrun, in: jsObject] = newValue } } - var ontransitionstart: EventHandler { + @inlinable var ontransitionstart: EventHandler { get { ClosureAttribute1Optional[Strings.ontransitionstart, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontransitionstart, in: jsObject] = newValue } } - var ontransitionend: EventHandler { + @inlinable var ontransitionend: EventHandler { get { ClosureAttribute1Optional[Strings.ontransitionend, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontransitionend, in: jsObject] = newValue } } - var ontransitioncancel: EventHandler { + @inlinable var ontransitioncancel: EventHandler { get { ClosureAttribute1Optional[Strings.ontransitioncancel, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontransitioncancel, in: jsObject] = newValue } } - var onabort: EventHandler { + @inlinable var onabort: EventHandler { get { ClosureAttribute1Optional[Strings.onabort, in: jsObject] } set { ClosureAttribute1Optional[Strings.onabort, in: jsObject] = newValue } } - var onauxclick: EventHandler { + @inlinable var onauxclick: EventHandler { get { ClosureAttribute1Optional[Strings.onauxclick, in: jsObject] } set { ClosureAttribute1Optional[Strings.onauxclick, in: jsObject] = newValue } } - var onblur: EventHandler { + @inlinable var onblur: EventHandler { get { ClosureAttribute1Optional[Strings.onblur, in: jsObject] } set { ClosureAttribute1Optional[Strings.onblur, in: jsObject] = newValue } } - var oncancel: EventHandler { + @inlinable var oncancel: EventHandler { get { ClosureAttribute1Optional[Strings.oncancel, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncancel, in: jsObject] = newValue } } - var oncanplay: EventHandler { + @inlinable var oncanplay: EventHandler { get { ClosureAttribute1Optional[Strings.oncanplay, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncanplay, in: jsObject] = newValue } } - var oncanplaythrough: EventHandler { + @inlinable var oncanplaythrough: EventHandler { get { ClosureAttribute1Optional[Strings.oncanplaythrough, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncanplaythrough, in: jsObject] = newValue } } - var onchange: EventHandler { + @inlinable var onchange: EventHandler { get { ClosureAttribute1Optional[Strings.onchange, in: jsObject] } set { ClosureAttribute1Optional[Strings.onchange, in: jsObject] = newValue } } - var onclick: EventHandler { + @inlinable var onclick: EventHandler { get { ClosureAttribute1Optional[Strings.onclick, in: jsObject] } set { ClosureAttribute1Optional[Strings.onclick, in: jsObject] = newValue } } - var onclose: EventHandler { + @inlinable var onclose: EventHandler { get { ClosureAttribute1Optional[Strings.onclose, in: jsObject] } set { ClosureAttribute1Optional[Strings.onclose, in: jsObject] = newValue } } - var oncontextlost: EventHandler { + @inlinable var oncontextlost: EventHandler { get { ClosureAttribute1Optional[Strings.oncontextlost, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncontextlost, in: jsObject] = newValue } } - var oncontextmenu: EventHandler { + @inlinable var oncontextmenu: EventHandler { get { ClosureAttribute1Optional[Strings.oncontextmenu, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncontextmenu, in: jsObject] = newValue } } - var oncontextrestored: EventHandler { + @inlinable var oncontextrestored: EventHandler { get { ClosureAttribute1Optional[Strings.oncontextrestored, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncontextrestored, in: jsObject] = newValue } } - var oncuechange: EventHandler { + @inlinable var oncuechange: EventHandler { get { ClosureAttribute1Optional[Strings.oncuechange, in: jsObject] } set { ClosureAttribute1Optional[Strings.oncuechange, in: jsObject] = newValue } } - var ondblclick: EventHandler { + @inlinable var ondblclick: EventHandler { get { ClosureAttribute1Optional[Strings.ondblclick, in: jsObject] } set { ClosureAttribute1Optional[Strings.ondblclick, in: jsObject] = newValue } } - var ondrag: EventHandler { + @inlinable var ondrag: EventHandler { get { ClosureAttribute1Optional[Strings.ondrag, in: jsObject] } set { ClosureAttribute1Optional[Strings.ondrag, in: jsObject] = newValue } } - var ondragend: EventHandler { + @inlinable var ondragend: EventHandler { get { ClosureAttribute1Optional[Strings.ondragend, in: jsObject] } set { ClosureAttribute1Optional[Strings.ondragend, in: jsObject] = newValue } } - var ondragenter: EventHandler { + @inlinable var ondragenter: EventHandler { get { ClosureAttribute1Optional[Strings.ondragenter, in: jsObject] } set { ClosureAttribute1Optional[Strings.ondragenter, in: jsObject] = newValue } } - var ondragleave: EventHandler { + @inlinable var ondragleave: EventHandler { get { ClosureAttribute1Optional[Strings.ondragleave, in: jsObject] } set { ClosureAttribute1Optional[Strings.ondragleave, in: jsObject] = newValue } } - var ondragover: EventHandler { + @inlinable var ondragover: EventHandler { get { ClosureAttribute1Optional[Strings.ondragover, in: jsObject] } set { ClosureAttribute1Optional[Strings.ondragover, in: jsObject] = newValue } } - var ondragstart: EventHandler { + @inlinable var ondragstart: EventHandler { get { ClosureAttribute1Optional[Strings.ondragstart, in: jsObject] } set { ClosureAttribute1Optional[Strings.ondragstart, in: jsObject] = newValue } } - var ondrop: EventHandler { + @inlinable var ondrop: EventHandler { get { ClosureAttribute1Optional[Strings.ondrop, in: jsObject] } set { ClosureAttribute1Optional[Strings.ondrop, in: jsObject] = newValue } } - var ondurationchange: EventHandler { + @inlinable var ondurationchange: EventHandler { get { ClosureAttribute1Optional[Strings.ondurationchange, in: jsObject] } set { ClosureAttribute1Optional[Strings.ondurationchange, in: jsObject] = newValue } } - var onemptied: EventHandler { + @inlinable var onemptied: EventHandler { get { ClosureAttribute1Optional[Strings.onemptied, in: jsObject] } set { ClosureAttribute1Optional[Strings.onemptied, in: jsObject] = newValue } } - var onended: EventHandler { + @inlinable var onended: EventHandler { get { ClosureAttribute1Optional[Strings.onended, in: jsObject] } set { ClosureAttribute1Optional[Strings.onended, in: jsObject] = newValue } } - var onerror: OnErrorEventHandler { + @inlinable var onerror: OnErrorEventHandler { get { ClosureAttribute5Optional[Strings.onerror, in: jsObject] } set { ClosureAttribute5Optional[Strings.onerror, in: jsObject] = newValue } } - var onfocus: EventHandler { + @inlinable var onfocus: EventHandler { get { ClosureAttribute1Optional[Strings.onfocus, in: jsObject] } set { ClosureAttribute1Optional[Strings.onfocus, in: jsObject] = newValue } } - var onformdata: EventHandler { + @inlinable var onformdata: EventHandler { get { ClosureAttribute1Optional[Strings.onformdata, in: jsObject] } set { ClosureAttribute1Optional[Strings.onformdata, in: jsObject] = newValue } } - var oninput: EventHandler { + @inlinable var oninput: EventHandler { get { ClosureAttribute1Optional[Strings.oninput, in: jsObject] } set { ClosureAttribute1Optional[Strings.oninput, in: jsObject] = newValue } } - var oninvalid: EventHandler { + @inlinable var oninvalid: EventHandler { get { ClosureAttribute1Optional[Strings.oninvalid, in: jsObject] } set { ClosureAttribute1Optional[Strings.oninvalid, in: jsObject] = newValue } } - var onkeydown: EventHandler { + @inlinable var onkeydown: EventHandler { get { ClosureAttribute1Optional[Strings.onkeydown, in: jsObject] } set { ClosureAttribute1Optional[Strings.onkeydown, in: jsObject] = newValue } } - var onkeypress: EventHandler { + @inlinable var onkeypress: EventHandler { get { ClosureAttribute1Optional[Strings.onkeypress, in: jsObject] } set { ClosureAttribute1Optional[Strings.onkeypress, in: jsObject] = newValue } } - var onkeyup: EventHandler { + @inlinable var onkeyup: EventHandler { get { ClosureAttribute1Optional[Strings.onkeyup, in: jsObject] } set { ClosureAttribute1Optional[Strings.onkeyup, in: jsObject] = newValue } } - var onload: EventHandler { + @inlinable var onload: EventHandler { get { ClosureAttribute1Optional[Strings.onload, in: jsObject] } set { ClosureAttribute1Optional[Strings.onload, in: jsObject] = newValue } } - var onloadeddata: EventHandler { + @inlinable var onloadeddata: EventHandler { get { ClosureAttribute1Optional[Strings.onloadeddata, in: jsObject] } set { ClosureAttribute1Optional[Strings.onloadeddata, in: jsObject] = newValue } } - var onloadedmetadata: EventHandler { + @inlinable var onloadedmetadata: EventHandler { get { ClosureAttribute1Optional[Strings.onloadedmetadata, in: jsObject] } set { ClosureAttribute1Optional[Strings.onloadedmetadata, in: jsObject] = newValue } } - var onloadstart: EventHandler { + @inlinable var onloadstart: EventHandler { get { ClosureAttribute1Optional[Strings.onloadstart, in: jsObject] } set { ClosureAttribute1Optional[Strings.onloadstart, in: jsObject] = newValue } } - var onmousedown: EventHandler { + @inlinable var onmousedown: EventHandler { get { ClosureAttribute1Optional[Strings.onmousedown, in: jsObject] } set { ClosureAttribute1Optional[Strings.onmousedown, in: jsObject] = newValue } } - var onmouseenter: EventHandler { + @inlinable var onmouseenter: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseenter, in: jsObject] } set { ClosureAttribute1Optional[Strings.onmouseenter, in: jsObject] = newValue } } - var onmouseleave: EventHandler { + @inlinable var onmouseleave: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseleave, in: jsObject] } set { ClosureAttribute1Optional[Strings.onmouseleave, in: jsObject] = newValue } } - var onmousemove: EventHandler { + @inlinable var onmousemove: EventHandler { get { ClosureAttribute1Optional[Strings.onmousemove, in: jsObject] } set { ClosureAttribute1Optional[Strings.onmousemove, in: jsObject] = newValue } } - var onmouseout: EventHandler { + @inlinable var onmouseout: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseout, in: jsObject] } set { ClosureAttribute1Optional[Strings.onmouseout, in: jsObject] = newValue } } - var onmouseover: EventHandler { + @inlinable var onmouseover: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseover, in: jsObject] } set { ClosureAttribute1Optional[Strings.onmouseover, in: jsObject] = newValue } } - var onmouseup: EventHandler { + @inlinable var onmouseup: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseup, in: jsObject] } set { ClosureAttribute1Optional[Strings.onmouseup, in: jsObject] = newValue } } - var onpause: EventHandler { + @inlinable var onpause: EventHandler { get { ClosureAttribute1Optional[Strings.onpause, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpause, in: jsObject] = newValue } } - var onplay: EventHandler { + @inlinable var onplay: EventHandler { get { ClosureAttribute1Optional[Strings.onplay, in: jsObject] } set { ClosureAttribute1Optional[Strings.onplay, in: jsObject] = newValue } } - var onplaying: EventHandler { + @inlinable var onplaying: EventHandler { get { ClosureAttribute1Optional[Strings.onplaying, in: jsObject] } set { ClosureAttribute1Optional[Strings.onplaying, in: jsObject] = newValue } } - var onprogress: EventHandler { + @inlinable var onprogress: EventHandler { get { ClosureAttribute1Optional[Strings.onprogress, in: jsObject] } set { ClosureAttribute1Optional[Strings.onprogress, in: jsObject] = newValue } } - var onratechange: EventHandler { + @inlinable var onratechange: EventHandler { get { ClosureAttribute1Optional[Strings.onratechange, in: jsObject] } set { ClosureAttribute1Optional[Strings.onratechange, in: jsObject] = newValue } } - var onreset: EventHandler { + @inlinable var onreset: EventHandler { get { ClosureAttribute1Optional[Strings.onreset, in: jsObject] } set { ClosureAttribute1Optional[Strings.onreset, in: jsObject] = newValue } } - var onresize: EventHandler { + @inlinable var onresize: EventHandler { get { ClosureAttribute1Optional[Strings.onresize, in: jsObject] } set { ClosureAttribute1Optional[Strings.onresize, in: jsObject] = newValue } } - var onscroll: EventHandler { + @inlinable var onscroll: EventHandler { get { ClosureAttribute1Optional[Strings.onscroll, in: jsObject] } set { ClosureAttribute1Optional[Strings.onscroll, in: jsObject] = newValue } } - var onsecuritypolicyviolation: EventHandler { + @inlinable var onsecuritypolicyviolation: EventHandler { get { ClosureAttribute1Optional[Strings.onsecuritypolicyviolation, in: jsObject] } set { ClosureAttribute1Optional[Strings.onsecuritypolicyviolation, in: jsObject] = newValue } } - var onseeked: EventHandler { + @inlinable var onseeked: EventHandler { get { ClosureAttribute1Optional[Strings.onseeked, in: jsObject] } set { ClosureAttribute1Optional[Strings.onseeked, in: jsObject] = newValue } } - var onseeking: EventHandler { + @inlinable var onseeking: EventHandler { get { ClosureAttribute1Optional[Strings.onseeking, in: jsObject] } set { ClosureAttribute1Optional[Strings.onseeking, in: jsObject] = newValue } } - var onselect: EventHandler { + @inlinable var onselect: EventHandler { get { ClosureAttribute1Optional[Strings.onselect, in: jsObject] } set { ClosureAttribute1Optional[Strings.onselect, in: jsObject] = newValue } } - var onslotchange: EventHandler { + @inlinable var onslotchange: EventHandler { get { ClosureAttribute1Optional[Strings.onslotchange, in: jsObject] } set { ClosureAttribute1Optional[Strings.onslotchange, in: jsObject] = newValue } } - var onstalled: EventHandler { + @inlinable var onstalled: EventHandler { get { ClosureAttribute1Optional[Strings.onstalled, in: jsObject] } set { ClosureAttribute1Optional[Strings.onstalled, in: jsObject] = newValue } } - var onsubmit: EventHandler { + @inlinable var onsubmit: EventHandler { get { ClosureAttribute1Optional[Strings.onsubmit, in: jsObject] } set { ClosureAttribute1Optional[Strings.onsubmit, in: jsObject] = newValue } } - var onsuspend: EventHandler { + @inlinable var onsuspend: EventHandler { get { ClosureAttribute1Optional[Strings.onsuspend, in: jsObject] } set { ClosureAttribute1Optional[Strings.onsuspend, in: jsObject] = newValue } } - var ontimeupdate: EventHandler { + @inlinable var ontimeupdate: EventHandler { get { ClosureAttribute1Optional[Strings.ontimeupdate, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontimeupdate, in: jsObject] = newValue } } - var ontoggle: EventHandler { + @inlinable var ontoggle: EventHandler { get { ClosureAttribute1Optional[Strings.ontoggle, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontoggle, in: jsObject] = newValue } } - var onvolumechange: EventHandler { + @inlinable var onvolumechange: EventHandler { get { ClosureAttribute1Optional[Strings.onvolumechange, in: jsObject] } set { ClosureAttribute1Optional[Strings.onvolumechange, in: jsObject] = newValue } } - var onwaiting: EventHandler { + @inlinable var onwaiting: EventHandler { get { ClosureAttribute1Optional[Strings.onwaiting, in: jsObject] } set { ClosureAttribute1Optional[Strings.onwaiting, in: jsObject] = newValue } } - var onwebkitanimationend: EventHandler { + @inlinable var onwebkitanimationend: EventHandler { get { ClosureAttribute1Optional[Strings.onwebkitanimationend, in: jsObject] } set { ClosureAttribute1Optional[Strings.onwebkitanimationend, in: jsObject] = newValue } } - var onwebkitanimationiteration: EventHandler { + @inlinable var onwebkitanimationiteration: EventHandler { get { ClosureAttribute1Optional[Strings.onwebkitanimationiteration, in: jsObject] } set { ClosureAttribute1Optional[Strings.onwebkitanimationiteration, in: jsObject] = newValue } } - var onwebkitanimationstart: EventHandler { + @inlinable var onwebkitanimationstart: EventHandler { get { ClosureAttribute1Optional[Strings.onwebkitanimationstart, in: jsObject] } set { ClosureAttribute1Optional[Strings.onwebkitanimationstart, in: jsObject] = newValue } } - var onwebkittransitionend: EventHandler { + @inlinable var onwebkittransitionend: EventHandler { get { ClosureAttribute1Optional[Strings.onwebkittransitionend, in: jsObject] } set { ClosureAttribute1Optional[Strings.onwebkittransitionend, in: jsObject] = newValue } } - var onwheel: EventHandler { + @inlinable var onwheel: EventHandler { get { ClosureAttribute1Optional[Strings.onwheel, in: jsObject] } set { ClosureAttribute1Optional[Strings.onwheel, in: jsObject] = newValue } } - var ongotpointercapture: EventHandler { + @inlinable var ongotpointercapture: EventHandler { get { ClosureAttribute1Optional[Strings.ongotpointercapture, in: jsObject] } set { ClosureAttribute1Optional[Strings.ongotpointercapture, in: jsObject] = newValue } } - var onlostpointercapture: EventHandler { + @inlinable var onlostpointercapture: EventHandler { get { ClosureAttribute1Optional[Strings.onlostpointercapture, in: jsObject] } set { ClosureAttribute1Optional[Strings.onlostpointercapture, in: jsObject] = newValue } } - var onpointerdown: EventHandler { + @inlinable var onpointerdown: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerdown, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpointerdown, in: jsObject] = newValue } } - var onpointermove: EventHandler { + @inlinable var onpointermove: EventHandler { get { ClosureAttribute1Optional[Strings.onpointermove, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpointermove, in: jsObject] = newValue } } - var onpointerrawupdate: EventHandler { + @inlinable var onpointerrawupdate: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerrawupdate, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpointerrawupdate, in: jsObject] = newValue } } - var onpointerup: EventHandler { + @inlinable var onpointerup: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerup, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpointerup, in: jsObject] = newValue } } - var onpointercancel: EventHandler { + @inlinable var onpointercancel: EventHandler { get { ClosureAttribute1Optional[Strings.onpointercancel, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpointercancel, in: jsObject] = newValue } } - var onpointerover: EventHandler { + @inlinable var onpointerover: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerover, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpointerover, in: jsObject] = newValue } } - var onpointerout: EventHandler { + @inlinable var onpointerout: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerout, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpointerout, in: jsObject] = newValue } } - var onpointerenter: EventHandler { + @inlinable var onpointerenter: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerenter, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpointerenter, in: jsObject] = newValue } } - var onpointerleave: EventHandler { + @inlinable var onpointerleave: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerleave, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpointerleave, in: jsObject] = newValue } } - var onselectstart: EventHandler { + @inlinable var onselectstart: EventHandler { get { ClosureAttribute1Optional[Strings.onselectstart, in: jsObject] } set { ClosureAttribute1Optional[Strings.onselectstart, in: jsObject] = newValue } } - var onselectionchange: EventHandler { + @inlinable var onselectionchange: EventHandler { get { ClosureAttribute1Optional[Strings.onselectionchange, in: jsObject] } set { ClosureAttribute1Optional[Strings.onselectionchange, in: jsObject] = newValue } } - var ontouchstart: EventHandler { + @inlinable var ontouchstart: EventHandler { get { ClosureAttribute1Optional[Strings.ontouchstart, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontouchstart, in: jsObject] = newValue } } - var ontouchend: EventHandler { + @inlinable var ontouchend: EventHandler { get { ClosureAttribute1Optional[Strings.ontouchend, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontouchend, in: jsObject] = newValue } } - var ontouchmove: EventHandler { + @inlinable var ontouchmove: EventHandler { get { ClosureAttribute1Optional[Strings.ontouchmove, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontouchmove, in: jsObject] = newValue } } - var ontouchcancel: EventHandler { + @inlinable var ontouchcancel: EventHandler { get { ClosureAttribute1Optional[Strings.ontouchcancel, in: jsObject] } set { ClosureAttribute1Optional[Strings.ontouchcancel, in: jsObject] = newValue } } - var onbeforexrselect: EventHandler { + @inlinable var onbeforexrselect: EventHandler { get { ClosureAttribute1Optional[Strings.onbeforexrselect, in: jsObject] } set { ClosureAttribute1Optional[Strings.onbeforexrselect, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/GravitySensor.swift b/Sources/DOMKit/WebIDL/GravitySensor.swift index 575f4ce8..65b0c163 100644 --- a/Sources/DOMKit/WebIDL/GravitySensor.swift +++ b/Sources/DOMKit/WebIDL/GravitySensor.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class GravitySensor: Accelerometer { - override public class var constructor: JSFunction { JSObject.global[Strings.GravitySensor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GravitySensor].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: AccelerometerSensorOptions? = nil) { + @inlinable public convenience init(options: AccelerometerSensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/GroupEffect.swift b/Sources/DOMKit/WebIDL/GroupEffect.swift index 36c0b024..515ad56b 100644 --- a/Sources/DOMKit/WebIDL/GroupEffect.swift +++ b/Sources/DOMKit/WebIDL/GroupEffect.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GroupEffect: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.GroupEffect].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GroupEffect].function! } public let jsObject: JSObject @@ -15,7 +15,7 @@ public class GroupEffect: JSBridgedClass { self.jsObject = jsObject } - public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue(), timing?.jsValue() ?? .undefined])) } @@ -28,17 +28,17 @@ public class GroupEffect: JSBridgedClass { @ReadonlyAttribute public var lastChild: AnimationEffect? - public func clone() -> Self { + @inlinable public func clone() -> Self { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } - public func prepend(effects: AnimationEffect...) { + @inlinable public func prepend(effects: AnimationEffect...) { let this = jsObject _ = this[Strings.prepend].function!(this: this, arguments: effects.map { $0.jsValue() }) } - public func append(effects: AnimationEffect...) { + @inlinable public func append(effects: AnimationEffect...) { let this = jsObject _ = this[Strings.append].function!(this: this, arguments: effects.map { $0.jsValue() }) } diff --git a/Sources/DOMKit/WebIDL/Gyroscope.swift b/Sources/DOMKit/WebIDL/Gyroscope.swift index d3a7f5a4..57a07195 100644 --- a/Sources/DOMKit/WebIDL/Gyroscope.swift +++ b/Sources/DOMKit/WebIDL/Gyroscope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Gyroscope: Sensor { - override public class var constructor: JSFunction { JSObject.global[Strings.Gyroscope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Gyroscope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) @@ -13,7 +13,7 @@ public class Gyroscope: Sensor { super.init(unsafelyWrapping: jsObject) } - public convenience init(sensorOptions: GyroscopeSensorOptions? = nil) { + @inlinable public convenience init(sensorOptions: GyroscopeSensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift index d9cc6e0a..129f623f 100644 --- a/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift +++ b/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift @@ -7,16 +7,16 @@ public enum GyroscopeLocalCoordinateSystem: JSString, JSValueCompatible { case device = "device" case screen = "screen" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/HID.swift b/Sources/DOMKit/WebIDL/HID.swift index 2e7bf687..c4ccc991 100644 --- a/Sources/DOMKit/WebIDL/HID.swift +++ b/Sources/DOMKit/WebIDL/HID.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HID: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.HID].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HID].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) @@ -18,25 +18,25 @@ public class HID: EventTarget { @ClosureAttribute1Optional public var ondisconnect: EventHandler - public func getDevices() -> JSPromise { + @inlinable public func getDevices() -> JSPromise { let this = jsObject return this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDevices() async throws -> [HIDDevice] { + @inlinable public func getDevices() async throws -> [HIDDevice] { let this = jsObject let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func requestDevice(options: HIDDeviceRequestOptions) -> JSPromise { + @inlinable public func requestDevice(options: HIDDeviceRequestOptions) -> JSPromise { let this = jsObject return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestDevice(options: HIDDeviceRequestOptions) async throws -> [HIDDevice] { + @inlinable public func requestDevice(options: HIDDeviceRequestOptions) async throws -> [HIDDevice] { let this = jsObject let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift b/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift index aa83544e..70a761ba 100644 --- a/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift +++ b/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HIDConnectionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.HIDConnectionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HIDConnectionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: HIDConnectionEventInit) { + @inlinable public convenience init(type: String, eventInitDict: HIDConnectionEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/HIDDevice.swift b/Sources/DOMKit/WebIDL/HIDDevice.swift index 60260d51..dd97f803 100644 --- a/Sources/DOMKit/WebIDL/HIDDevice.swift +++ b/Sources/DOMKit/WebIDL/HIDDevice.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HIDDevice: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.HIDDevice].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HIDDevice].function! } public required init(unsafelyWrapping jsObject: JSObject) { _oninputreport = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oninputreport) @@ -34,73 +34,73 @@ public class HIDDevice: EventTarget { @ReadonlyAttribute public var collections: [HIDCollectionInfo] - public func open() -> JSPromise { + @inlinable public func open() -> JSPromise { let this = jsObject return this[Strings.open].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func open() async throws { + @inlinable public func open() async throws { let this = jsObject let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func close() -> JSPromise { + @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, *) - public func close() async throws { + @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func forget() -> JSPromise { + @inlinable public func forget() -> JSPromise { let this = jsObject return this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func forget() async throws { + @inlinable public func forget() async throws { let this = jsObject let _promise: JSPromise = this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func sendReport(reportId: UInt8, data: BufferSource) -> JSPromise { + @inlinable public func sendReport(reportId: UInt8, data: BufferSource) -> JSPromise { let this = jsObject return this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func sendReport(reportId: UInt8, data: BufferSource) async throws { + @inlinable public func sendReport(reportId: UInt8, data: BufferSource) async throws { let this = jsObject let _promise: JSPromise = this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func sendFeatureReport(reportId: UInt8, data: BufferSource) -> JSPromise { + @inlinable public func sendFeatureReport(reportId: UInt8, data: BufferSource) -> JSPromise { let this = jsObject return this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func sendFeatureReport(reportId: UInt8, data: BufferSource) async throws { + @inlinable public func sendFeatureReport(reportId: UInt8, data: BufferSource) async throws { let this = jsObject let _promise: JSPromise = this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func receiveFeatureReport(reportId: UInt8) -> JSPromise { + @inlinable public func receiveFeatureReport(reportId: UInt8) -> JSPromise { let this = jsObject return this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func receiveFeatureReport(reportId: UInt8) async throws -> DataView { + @inlinable public func receiveFeatureReport(reportId: UInt8) async throws -> DataView { let this = jsObject let _promise: JSPromise = this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift b/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift index fabdbf88..bc72c45f 100644 --- a/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift +++ b/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HIDInputReportEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.HIDInputReportEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HIDInputReportEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) @@ -13,7 +13,7 @@ public class HIDInputReportEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: HIDInputReportEventInit) { + @inlinable public convenience init(type: String, eventInitDict: HIDInputReportEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/HIDUnitSystem.swift b/Sources/DOMKit/WebIDL/HIDUnitSystem.swift index 2eb44d7a..73101aea 100644 --- a/Sources/DOMKit/WebIDL/HIDUnitSystem.swift +++ b/Sources/DOMKit/WebIDL/HIDUnitSystem.swift @@ -12,16 +12,16 @@ public enum HIDUnitSystem: JSString, JSValueCompatible { case vendorDefined = "vendor-defined" case reserved = "reserved" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift index bc628913..efab9b12 100644 --- a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLAllCollection: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.HTMLAllCollection].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.HTMLAllCollection].function! } public let jsObject: JSObject @@ -16,15 +16,15 @@ public class HTMLAllCollection: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Element { + @inlinable public subscript(key: Int) -> Element { jsObject[key].fromJSValue()! } - public subscript(key: String) -> __UNSUPPORTED_UNION__? { + @inlinable public subscript(key: String) -> __UNSUPPORTED_UNION__? { jsObject[key].fromJSValue() } - public func item(nameOrIndex: String? = nil) -> __UNSUPPORTED_UNION__? { + @inlinable public func item(nameOrIndex: String? = nil) -> __UNSUPPORTED_UNION__? { let this = jsObject return this[Strings.item].function!(this: this, arguments: [nameOrIndex?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift index 16ecf36d..ba35dbfe 100644 --- a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAnchorElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAnchorElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _attributionDestination = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionDestination) @@ -49,7 +49,7 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { @ReadWriteAttribute public var registerAttributionSource: Bool - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift index d2564e59..edb88a62 100644 --- a/Sources/DOMKit/WebIDL/HTMLAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAreaElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLAreaElement: HTMLElement, HTMLHyperlinkElementUtils { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAreaElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAreaElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) @@ -20,7 +20,7 @@ public class HTMLAreaElement: HTMLElement, HTMLHyperlinkElementUtils { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift index 8638b264..18ef1c2d 100644 --- a/Sources/DOMKit/WebIDL/HTMLAudioElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAudioElement.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLAudioElement: HTMLMediaElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAudioElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAudioElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/HTMLBRElement.swift b/Sources/DOMKit/WebIDL/HTMLBRElement.swift index 140e7703..909dc0e8 100644 --- a/Sources/DOMKit/WebIDL/HTMLBRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBRElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLBRElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBRElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBRElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _clear = ReadWriteAttribute(jsObject: jsObject, name: Strings.clear) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift index f59cd977..706fd766 100644 --- a/Sources/DOMKit/WebIDL/HTMLBaseElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBaseElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLBaseElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBaseElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBaseElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _href = ReadWriteAttribute(jsObject: jsObject, name: Strings.href) @@ -12,7 +12,7 @@ public class HTMLBaseElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift index 06f11db5..e762c9cc 100644 --- a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLBodyElement: HTMLElement, WindowEventHandlers { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBodyElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBodyElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onorientationchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onorientationchange) @@ -20,7 +20,7 @@ public class HTMLBodyElement: HTMLElement, WindowEventHandlers { @ClosureAttribute1Optional public var onorientationchange: EventHandler - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift index 6730b437..248372bb 100644 --- a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLButtonElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLButtonElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLButtonElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) @@ -24,7 +24,7 @@ public class HTMLButtonElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -67,17 +67,17 @@ public class HTMLButtonElement: HTMLElement { @ReadonlyAttribute public var validationMessage: String - public func checkValidity() -> Bool { + @inlinable public func checkValidity() -> Bool { let this = jsObject return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } - public func reportValidity() -> Bool { + @inlinable public func reportValidity() -> Bool { let this = jsObject return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } - public func setCustomValidity(error: String) { + @inlinable public func setCustomValidity(error: String) { let this = jsObject _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index e258ba7c..3bba9f94 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLCanvasElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLCanvasElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLCanvasElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) @@ -12,7 +12,7 @@ public class HTMLCanvasElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -22,24 +22,24 @@ public class HTMLCanvasElement: HTMLElement { @ReadWriteAttribute public var height: UInt32 - public func getContext(contextId: String, options: JSValue? = nil) -> RenderingContext? { + @inlinable public func getContext(contextId: String, options: JSValue? = nil) -> RenderingContext? { let this = jsObject return this[Strings.getContext].function!(this: this, arguments: [contextId.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func toDataURL(type: String? = nil, quality: JSValue? = nil) -> String { + @inlinable public func toDataURL(type: String? = nil, quality: JSValue? = nil) -> String { let this = jsObject return this[Strings.toDataURL].function!(this: this, arguments: [type?.jsValue() ?? .undefined, quality?.jsValue() ?? .undefined]).fromJSValue()! } // XXX: member 'toBlob' is ignored - public func transferControlToOffscreen() -> OffscreenCanvas { + @inlinable public func transferControlToOffscreen() -> OffscreenCanvas { let this = jsObject return this[Strings.transferControlToOffscreen].function!(this: this, arguments: []).fromJSValue()! } - public func captureStream(frameRequestRate: Double? = nil) -> MediaStream { + @inlinable public func captureStream(frameRequestRate: Double? = nil) -> MediaStream { let this = jsObject return this[Strings.captureStream].function!(this: this, arguments: [frameRequestRate?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLCollection.swift b/Sources/DOMKit/WebIDL/HTMLCollection.swift index 6a882bab..4597482a 100644 --- a/Sources/DOMKit/WebIDL/HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLCollection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLCollection: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.HTMLCollection].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.HTMLCollection].function! } public let jsObject: JSObject @@ -16,11 +16,11 @@ public class HTMLCollection: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Element? { + @inlinable public subscript(key: Int) -> Element? { jsObject[key].fromJSValue() } - public subscript(key: String) -> Element? { + @inlinable public subscript(key: String) -> Element? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/HTMLDListElement.swift b/Sources/DOMKit/WebIDL/HTMLDListElement.swift index ac4b33a3..084fa859 100644 --- a/Sources/DOMKit/WebIDL/HTMLDListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDListElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDListElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDListElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDListElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLDataElement.swift b/Sources/DOMKit/WebIDL/HTMLDataElement.swift index 793d0838..7366bf0c 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDataElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDataElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDataElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift index b81e211a..84ec303e 100644 --- a/Sources/DOMKit/WebIDL/HTMLDataListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDataListElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDataListElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDataListElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDataListElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _options = ReadonlyAttribute(jsObject: jsObject, name: Strings.options) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift index 7a7c6e69..a0383357 100644 --- a/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDetailsElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDetailsElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDetailsElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDetailsElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _open = ReadWriteAttribute(jsObject: jsObject, name: Strings.open) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift index 3d50fbaf..f0db89fb 100644 --- a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDialogElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDialogElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDialogElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _open = ReadWriteAttribute(jsObject: jsObject, name: Strings.open) @@ -12,7 +12,7 @@ public class HTMLDialogElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -22,17 +22,17 @@ public class HTMLDialogElement: HTMLElement { @ReadWriteAttribute public var returnValue: String - public func show() { + @inlinable public func show() { let this = jsObject _ = this[Strings.show].function!(this: this, arguments: []) } - public func showModal() { + @inlinable public func showModal() { let this = jsObject _ = this[Strings.showModal].function!(this: this, arguments: []) } - public func close(returnValue: String? = nil) { + @inlinable public func close(returnValue: String? = nil) { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: [returnValue?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift index d0fc52c5..840849e5 100644 --- a/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDirectoryElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDirectoryElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDirectoryElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDirectoryElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLDivElement.swift b/Sources/DOMKit/WebIDL/HTMLDivElement.swift index 343e2d86..437437a4 100644 --- a/Sources/DOMKit/WebIDL/HTMLDivElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDivElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLDivElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDivElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLDivElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 355e5398..24d2acfb 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _offsetParent = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetParent) @@ -43,7 +43,7 @@ public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, D @ReadonlyAttribute public var offsetHeight: Int32 - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -65,7 +65,7 @@ public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, D @ReadWriteAttribute public var inert: Bool - public func click() { + @inlinable public func click() { let this = jsObject _ = this[Strings.click].function!(this: this, arguments: []) } @@ -91,7 +91,7 @@ public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, D @ReadWriteAttribute public var outerText: String - public func attachInternals() -> ElementInternals { + @inlinable public func attachInternals() -> ElementInternals { let this = jsObject return this[Strings.attachInternals].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift index a25fa7ac..e5f0d228 100644 --- a/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLEmbedElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLEmbedElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLEmbedElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLEmbedElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) @@ -16,7 +16,7 @@ public class HTMLEmbedElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -32,7 +32,7 @@ public class HTMLEmbedElement: HTMLElement { @ReadWriteAttribute public var height: String - public func getSVGDocument() -> Document? { + @inlinable public func getSVGDocument() -> Document? { let this = jsObject return this[Strings.getSVGDocument].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift index 9940e6e4..8d64a7cc 100644 --- a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFieldSetElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFieldSetElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFieldSetElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) @@ -18,7 +18,7 @@ public class HTMLFieldSetElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -46,17 +46,17 @@ public class HTMLFieldSetElement: HTMLElement { @ReadonlyAttribute public var validationMessage: String - public func checkValidity() -> Bool { + @inlinable public func checkValidity() -> Bool { let this = jsObject return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } - public func reportValidity() -> Bool { + @inlinable public func reportValidity() -> Bool { let this = jsObject return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } - public func setCustomValidity(error: String) { + @inlinable public func setCustomValidity(error: String) { let this = jsObject _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HTMLFontElement.swift b/Sources/DOMKit/WebIDL/HTMLFontElement.swift index d62b84ed..f3c7b5ab 100644 --- a/Sources/DOMKit/WebIDL/HTMLFontElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFontElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFontElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFontElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFontElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _color = ReadWriteAttribute(jsObject: jsObject, name: Strings.color) @@ -13,7 +13,7 @@ public class HTMLFontElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift index 1a1fd391..cd07cc57 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFormControlsCollection: HTMLCollection { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFormControlsCollection].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFormControlsCollection].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public subscript(key: String) -> __UNSUPPORTED_UNION__? { + @inlinable public subscript(key: String) -> __UNSUPPORTED_UNION__? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index 4fda36eb..3a6e095d 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFormElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFormElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFormElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _acceptCharset = ReadWriteAttribute(jsObject: jsObject, name: Strings.acceptCharset) @@ -23,7 +23,7 @@ public class HTMLFormElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -66,35 +66,35 @@ public class HTMLFormElement: HTMLElement { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Element { + @inlinable public subscript(key: Int) -> Element { jsObject[key].fromJSValue()! } - public subscript(key: String) -> __UNSUPPORTED_UNION__ { + @inlinable public subscript(key: String) -> __UNSUPPORTED_UNION__ { jsObject[key].fromJSValue()! } - public func submit() { + @inlinable public func submit() { let this = jsObject _ = this[Strings.submit].function!(this: this, arguments: []) } - public func requestSubmit(submitter: HTMLElement? = nil) { + @inlinable public func requestSubmit(submitter: HTMLElement? = nil) { let this = jsObject _ = this[Strings.requestSubmit].function!(this: this, arguments: [submitter?.jsValue() ?? .undefined]) } - public func reset() { + @inlinable public func reset() { let this = jsObject _ = this[Strings.reset].function!(this: this, arguments: []) } - public func checkValidity() -> Bool { + @inlinable public func checkValidity() -> Bool { let this = jsObject return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } - public func reportValidity() -> Bool { + @inlinable public func reportValidity() -> Bool { let this = jsObject return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift index 6d4f8801..7c0f3bf5 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFrameElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFrameElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFrameElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) @@ -20,7 +20,7 @@ public class HTMLFrameElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift index 763b5112..01d50eb6 100644 --- a/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFrameSetElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLFrameSetElement: HTMLElement, WindowEventHandlers { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFrameSetElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLFrameSetElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cols = ReadWriteAttribute(jsObject: jsObject, name: Strings.cols) @@ -12,7 +12,7 @@ public class HTMLFrameSetElement: HTMLElement, WindowEventHandlers { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLHRElement.swift b/Sources/DOMKit/WebIDL/HTMLHRElement.swift index db6538e4..e9030cd1 100644 --- a/Sources/DOMKit/WebIDL/HTMLHRElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHRElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLHRElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHRElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHRElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) @@ -15,7 +15,7 @@ public class HTMLHRElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift index eab63c43..4a2e8d24 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadElement.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLHeadElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHeadElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHeadElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift index 53885f0a..5420f27b 100644 --- a/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHeadingElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLHeadingElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHeadingElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHeadingElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift index f10821b2..b7d8e824 100644 --- a/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLHtmlElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLHtmlElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHtmlElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLHtmlElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _version = ReadWriteAttribute(jsObject: jsObject, name: Strings.version) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift index 173327fe..57a585a0 100644 --- a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift +++ b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift @@ -5,54 +5,54 @@ import JavaScriptKit public protocol HTMLHyperlinkElementUtils: JSBridgedClass {} public extension HTMLHyperlinkElementUtils { - var href: String { + @inlinable var href: String { get { ReadWriteAttribute[Strings.href, in: jsObject] } set { ReadWriteAttribute[Strings.href, in: jsObject] = newValue } } - var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } + @inlinable var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } - var `protocol`: String { + @inlinable var `protocol`: String { get { ReadWriteAttribute[Strings.protocol, in: jsObject] } set { ReadWriteAttribute[Strings.protocol, in: jsObject] = newValue } } - var username: String { + @inlinable var username: String { get { ReadWriteAttribute[Strings.username, in: jsObject] } set { ReadWriteAttribute[Strings.username, in: jsObject] = newValue } } - var password: String { + @inlinable var password: String { get { ReadWriteAttribute[Strings.password, in: jsObject] } set { ReadWriteAttribute[Strings.password, in: jsObject] = newValue } } - var host: String { + @inlinable var host: String { get { ReadWriteAttribute[Strings.host, in: jsObject] } set { ReadWriteAttribute[Strings.host, in: jsObject] = newValue } } - var hostname: String { + @inlinable var hostname: String { get { ReadWriteAttribute[Strings.hostname, in: jsObject] } set { ReadWriteAttribute[Strings.hostname, in: jsObject] = newValue } } - var port: String { + @inlinable var port: String { get { ReadWriteAttribute[Strings.port, in: jsObject] } set { ReadWriteAttribute[Strings.port, in: jsObject] = newValue } } - var pathname: String { + @inlinable var pathname: String { get { ReadWriteAttribute[Strings.pathname, in: jsObject] } set { ReadWriteAttribute[Strings.pathname, in: jsObject] = newValue } } - var search: String { + @inlinable var search: String { get { ReadWriteAttribute[Strings.search, in: jsObject] } set { ReadWriteAttribute[Strings.search, in: jsObject] = newValue } } - var hash: String { + @inlinable var hash: String { get { ReadWriteAttribute[Strings.hash, in: jsObject] } set { ReadWriteAttribute[Strings.hash, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index ebcc9d02..bd86624c 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLIFrameElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLIFrameElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLIFrameElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _csp = ReadWriteAttribute(jsObject: jsObject, name: Strings.csp) @@ -34,7 +34,7 @@ public class HTMLIFrameElement: HTMLElement { @ReadWriteAttribute public var csp: String - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -74,7 +74,7 @@ public class HTMLIFrameElement: HTMLElement { @ReadonlyAttribute public var contentWindow: WindowProxy? - public func getSVGDocument() -> Document? { + @inlinable public func getSVGDocument() -> Document? { let this = jsObject return this[Strings.getSVGDocument].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index 1b55f05f..05f1f953 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLImageElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLImageElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLImageElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) @@ -42,7 +42,7 @@ public class HTMLImageElement: HTMLElement { @ReadonlyAttribute public var y: Int32 - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -94,13 +94,13 @@ public class HTMLImageElement: HTMLElement { @ReadWriteAttribute public var loading: String - public func decode() -> JSPromise { + @inlinable public func decode() -> JSPromise { let this = jsObject return this[Strings.decode].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func decode() async throws { + @inlinable public func decode() async throws { let this = jsObject let _promise: JSPromise = this[Strings.decode].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index da90e148..d3930c6d 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLInputElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLInputElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLInputElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _webkitdirectory = ReadWriteAttribute(jsObject: jsObject, name: Strings.webkitdirectory) @@ -67,7 +67,7 @@ public class HTMLInputElement: HTMLElement { @ReadWriteAttribute public var capture: String - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -179,12 +179,12 @@ public class HTMLInputElement: HTMLElement { @ReadWriteAttribute public var width: UInt32 - public func stepUp(n: Int32? = nil) { + @inlinable public func stepUp(n: Int32? = nil) { let this = jsObject _ = this[Strings.stepUp].function!(this: this, arguments: [n?.jsValue() ?? .undefined]) } - public func stepDown(n: Int32? = nil) { + @inlinable public func stepDown(n: Int32? = nil) { let this = jsObject _ = this[Strings.stepDown].function!(this: this, arguments: [n?.jsValue() ?? .undefined]) } @@ -198,17 +198,17 @@ public class HTMLInputElement: HTMLElement { @ReadonlyAttribute public var validationMessage: String - public func checkValidity() -> Bool { + @inlinable public func checkValidity() -> Bool { let this = jsObject return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } - public func reportValidity() -> Bool { + @inlinable public func reportValidity() -> Bool { let this = jsObject return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } - public func setCustomValidity(error: String) { + @inlinable public func setCustomValidity(error: String) { let this = jsObject _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } @@ -216,7 +216,7 @@ public class HTMLInputElement: HTMLElement { @ReadonlyAttribute public var labels: NodeList? - public func select() { + @inlinable public func select() { let this = jsObject _ = this[Strings.select].function!(this: this, arguments: []) } @@ -230,22 +230,22 @@ public class HTMLInputElement: HTMLElement { @ReadWriteAttribute public var selectionDirection: String? - public func setRangeText(replacement: String) { + @inlinable public func setRangeText(replacement: String) { let this = jsObject _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue()]) } - public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { + @inlinable public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { let this = jsObject _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined]) } - public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { + @inlinable public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { let this = jsObject _ = this[Strings.setSelectionRange].function!(this: this, arguments: [start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined]) } - public func showPicker() { + @inlinable public func showPicker() { let this = jsObject _ = this[Strings.showPicker].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/HTMLLIElement.swift b/Sources/DOMKit/WebIDL/HTMLLIElement.swift index 5423cf81..e3b89ece 100644 --- a/Sources/DOMKit/WebIDL/HTMLLIElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLIElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLLIElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLIElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLIElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) @@ -12,7 +12,7 @@ public class HTMLLIElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift index 393a390e..5140458b 100644 --- a/Sources/DOMKit/WebIDL/HTMLLabelElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLabelElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLLabelElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLabelElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLabelElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) @@ -13,7 +13,7 @@ public class HTMLLabelElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift index add0602d..af091033 100644 --- a/Sources/DOMKit/WebIDL/HTMLLegendElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLegendElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLLegendElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLegendElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLegendElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) @@ -12,7 +12,7 @@ public class HTMLLegendElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift index 706dc47d..84cafd27 100644 --- a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLLinkElement: HTMLElement, LinkStyle { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLinkElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLinkElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _href = ReadWriteAttribute(jsObject: jsObject, name: Strings.href) @@ -29,7 +29,7 @@ public class HTMLLinkElement: HTMLElement, LinkStyle { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLMapElement.swift b/Sources/DOMKit/WebIDL/HTMLMapElement.swift index 4aa4e82e..47389672 100644 --- a/Sources/DOMKit/WebIDL/HTMLMapElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMapElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMapElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMapElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMapElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) @@ -12,7 +12,7 @@ public class HTMLMapElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift index b4f682eb..9747d62c 100644 --- a/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMarqueeElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMarqueeElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMarqueeElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMarqueeElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _behavior = ReadWriteAttribute(jsObject: jsObject, name: Strings.behavior) @@ -21,7 +21,7 @@ public class HTMLMarqueeElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -58,12 +58,12 @@ public class HTMLMarqueeElement: HTMLElement { @ReadWriteAttribute public var width: String - public func start() { + @inlinable public func start() { let this = jsObject _ = this[Strings.start].function!(this: this, arguments: []) } - public func stop() { + @inlinable public func stop() { let this = jsObject _ = this[Strings.stop].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index 6617dfe4..c5310e98 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMediaElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMediaElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMediaElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _sinkId = ReadonlyAttribute(jsObject: jsObject, name: Strings.sinkId) @@ -47,13 +47,13 @@ public class HTMLMediaElement: HTMLElement { @ReadonlyAttribute public var sinkId: String - public func setSinkId(sinkId: String) -> JSPromise { + @inlinable public func setSinkId(sinkId: String) -> JSPromise { let this = jsObject return this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setSinkId(sinkId: String) async throws { + @inlinable public func setSinkId(sinkId: String) async throws { let this = jsObject let _promise: JSPromise = this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue()]).fromJSValue()! _ = try await _promise.get() @@ -68,13 +68,13 @@ public class HTMLMediaElement: HTMLElement { @ClosureAttribute1Optional public var onwaitingforkey: EventHandler - public func setMediaKeys(mediaKeys: MediaKeys?) -> JSPromise { + @inlinable public func setMediaKeys(mediaKeys: MediaKeys?) -> JSPromise { let this = jsObject return this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setMediaKeys(mediaKeys: MediaKeys?) async throws { + @inlinable public func setMediaKeys(mediaKeys: MediaKeys?) async throws { let this = jsObject let _promise: JSPromise = this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue()]).fromJSValue()! _ = try await _promise.get() @@ -112,12 +112,12 @@ public class HTMLMediaElement: HTMLElement { @ReadonlyAttribute public var buffered: TimeRanges - public func load() { + @inlinable public func load() { let this = jsObject _ = this[Strings.load].function!(this: this, arguments: []) } - public func canPlayType(type: String) -> CanPlayTypeResult { + @inlinable public func canPlayType(type: String) -> CanPlayTypeResult { let this = jsObject return this[Strings.canPlayType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } @@ -141,7 +141,7 @@ public class HTMLMediaElement: HTMLElement { @ReadWriteAttribute public var currentTime: Double - public func fastSeek(time: Double) { + @inlinable public func fastSeek(time: Double) { let this = jsObject _ = this[Strings.fastSeek].function!(this: this, arguments: [time.jsValue()]) } @@ -149,7 +149,7 @@ public class HTMLMediaElement: HTMLElement { @ReadonlyAttribute public var duration: Double - public func getStartDate() -> JSObject { + @inlinable public func getStartDate() -> JSObject { let this = jsObject return this[Strings.getStartDate].function!(this: this, arguments: []).fromJSValue()! } @@ -181,19 +181,19 @@ public class HTMLMediaElement: HTMLElement { @ReadWriteAttribute public var loop: Bool - public func play() -> JSPromise { + @inlinable public func play() -> JSPromise { let this = jsObject return this[Strings.play].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func play() async throws { + @inlinable public func play() async throws { let this = jsObject let _promise: JSPromise = this[Strings.play].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func pause() { + @inlinable public func pause() { let this = jsObject _ = this[Strings.pause].function!(this: this, arguments: []) } @@ -219,12 +219,12 @@ public class HTMLMediaElement: HTMLElement { @ReadonlyAttribute public var textTracks: TextTrackList - public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { + @inlinable public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { let this = jsObject return this[Strings.addTextTrack].function!(this: this, arguments: [kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined]).fromJSValue()! } - public func captureStream() -> MediaStream { + @inlinable public func captureStream() -> MediaStream { let this = jsObject return this[Strings.captureStream].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift index 759f9a04..633819a0 100644 --- a/Sources/DOMKit/WebIDL/HTMLMenuElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMenuElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMenuElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMenuElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMenuElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift index 1cf7e31a..1874c76c 100644 --- a/Sources/DOMKit/WebIDL/HTMLMetaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMetaElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMetaElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMetaElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMetaElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) @@ -15,7 +15,7 @@ public class HTMLMetaElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift index 03302c26..111eac84 100644 --- a/Sources/DOMKit/WebIDL/HTMLMeterElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMeterElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLMeterElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMeterElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMeterElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) @@ -17,7 +17,7 @@ public class HTMLMeterElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLModElement.swift b/Sources/DOMKit/WebIDL/HTMLModElement.swift index 8f718aea..7b4ebe9f 100644 --- a/Sources/DOMKit/WebIDL/HTMLModElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLModElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLModElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLModElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLModElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cite = ReadWriteAttribute(jsObject: jsObject, name: Strings.cite) @@ -12,7 +12,7 @@ public class HTMLModElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLOListElement.swift b/Sources/DOMKit/WebIDL/HTMLOListElement.swift index c4c9a236..edc55fef 100644 --- a/Sources/DOMKit/WebIDL/HTMLOListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOListElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOListElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOListElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOListElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _reversed = ReadWriteAttribute(jsObject: jsObject, name: Strings.reversed) @@ -14,7 +14,7 @@ public class HTMLOListElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift index 75a48dc8..a7b0a468 100644 --- a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLObjectElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLObjectElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLObjectElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) @@ -32,7 +32,7 @@ public class HTMLObjectElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -60,7 +60,7 @@ public class HTMLObjectElement: HTMLElement { @ReadonlyAttribute public var contentWindow: WindowProxy? - public func getSVGDocument() -> Document? { + @inlinable public func getSVGDocument() -> Document? { let this = jsObject return this[Strings.getSVGDocument].function!(this: this, arguments: []).fromJSValue()! } @@ -74,17 +74,17 @@ public class HTMLObjectElement: HTMLElement { @ReadonlyAttribute public var validationMessage: String - public func checkValidity() -> Bool { + @inlinable public func checkValidity() -> Bool { let this = jsObject return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } - public func reportValidity() -> Bool { + @inlinable public func reportValidity() -> Bool { let this = jsObject return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } - public func setCustomValidity(error: String) { + @inlinable public func setCustomValidity(error: String) { let this = jsObject _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift index b31dd183..32c1e198 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOptGroupElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOptGroupElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOptGroupElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) @@ -12,7 +12,7 @@ public class HTMLOptGroupElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift index 8e4b9a80..7b45c2cc 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOptionElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOptionElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOptionElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) @@ -18,7 +18,7 @@ public class HTMLOptionElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift index 18750be8..d0c2357c 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOptionsCollection: HTMLCollection { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOptionsCollection].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOptionsCollection].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadWriteAttribute(jsObject: jsObject, name: Strings.length) @@ -12,20 +12,20 @@ public class HTMLOptionsCollection: HTMLCollection { super.init(unsafelyWrapping: jsObject) } - private var _length: ReadWriteAttribute - override public var length: UInt32 { + @usableFromInline let _length: ReadWriteAttribute + @inlinable override public var length: UInt32 { get { _length.wrappedValue } set { _length.wrappedValue = newValue } } // XXX: unsupported setter for keys of type UInt32 - public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { + @inlinable public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { let this = jsObject _ = this[Strings.add].function!(this: this, arguments: [element.jsValue(), before?.jsValue() ?? .undefined]) } - public func remove(index: Int32) { + @inlinable public func remove(index: Int32) { let this = jsObject _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift index 3853b57c..ace7441a 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift @@ -5,29 +5,29 @@ import JavaScriptKit public protocol HTMLOrSVGElement: JSBridgedClass {} public extension HTMLOrSVGElement { - var dataset: DOMStringMap { ReadonlyAttribute[Strings.dataset, in: jsObject] } + @inlinable var dataset: DOMStringMap { ReadonlyAttribute[Strings.dataset, in: jsObject] } - var nonce: String { + @inlinable var nonce: String { get { ReadWriteAttribute[Strings.nonce, in: jsObject] } set { ReadWriteAttribute[Strings.nonce, in: jsObject] = newValue } } - var autofocus: Bool { + @inlinable var autofocus: Bool { get { ReadWriteAttribute[Strings.autofocus, in: jsObject] } set { ReadWriteAttribute[Strings.autofocus, in: jsObject] = newValue } } - var tabIndex: Int32 { + @inlinable var tabIndex: Int32 { get { ReadWriteAttribute[Strings.tabIndex, in: jsObject] } set { ReadWriteAttribute[Strings.tabIndex, in: jsObject] = newValue } } - func focus(options: FocusOptions? = nil) { + @inlinable func focus(options: FocusOptions? = nil) { let this = jsObject _ = this[Strings.focus].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } - func blur() { + @inlinable func blur() { let this = jsObject _ = this[Strings.blur].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift index 9473c2ce..5488e9fd 100644 --- a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLOutputElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOutputElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLOutputElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _htmlFor = ReadonlyAttribute(jsObject: jsObject, name: Strings.htmlFor) @@ -20,7 +20,7 @@ public class HTMLOutputElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -51,17 +51,17 @@ public class HTMLOutputElement: HTMLElement { @ReadonlyAttribute public var validationMessage: String - public func checkValidity() -> Bool { + @inlinable public func checkValidity() -> Bool { let this = jsObject return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } - public func reportValidity() -> Bool { + @inlinable public func reportValidity() -> Bool { let this = jsObject return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } - public func setCustomValidity(error: String) { + @inlinable public func setCustomValidity(error: String) { let this = jsObject _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift index 9141cc30..11aeed63 100644 --- a/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParagraphElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLParagraphElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLParagraphElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLParagraphElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLParamElement.swift b/Sources/DOMKit/WebIDL/HTMLParamElement.swift index ebb1f0b4..25181450 100644 --- a/Sources/DOMKit/WebIDL/HTMLParamElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLParamElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLParamElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLParamElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLParamElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) @@ -14,7 +14,7 @@ public class HTMLParamElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift index 6f6c8898..1c41e52a 100644 --- a/Sources/DOMKit/WebIDL/HTMLPictureElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPictureElement.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLPictureElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPictureElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPictureElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift index 308f20aa..22b634bc 100644 --- a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLPortalElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPortalElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPortalElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) @@ -14,7 +14,7 @@ public class HTMLPortalElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -24,19 +24,19 @@ public class HTMLPortalElement: HTMLElement { @ReadWriteAttribute public var referrerPolicy: String - public func activate(options: PortalActivateOptions? = nil) -> JSPromise { + @inlinable public func activate(options: PortalActivateOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.activate].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func activate(options: PortalActivateOptions? = nil) async throws { + @inlinable public func activate(options: PortalActivateOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.activate].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/HTMLPreElement.swift b/Sources/DOMKit/WebIDL/HTMLPreElement.swift index f409b7d4..e4baf35f 100644 --- a/Sources/DOMKit/WebIDL/HTMLPreElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPreElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLPreElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPreElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPreElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift index 6b157fbd..b976c2e9 100644 --- a/Sources/DOMKit/WebIDL/HTMLProgressElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLProgressElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLProgressElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLProgressElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLProgressElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) @@ -14,7 +14,7 @@ public class HTMLProgressElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift index ba97282f..a898cf8e 100644 --- a/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLQuoteElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLQuoteElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLQuoteElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLQuoteElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cite = ReadWriteAttribute(jsObject: jsObject, name: Strings.cite) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift index ddeb459d..ea7c853e 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLScriptElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLScriptElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLScriptElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) @@ -24,7 +24,7 @@ public class HTMLScriptElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -58,7 +58,7 @@ public class HTMLScriptElement: HTMLElement { @ReadonlyAttribute public var blocking: DOMTokenList - public static func supports(type: String) -> Bool { + @inlinable public static func supports(type: String) -> Bool { let this = constructor return this[Strings.supports].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index b6344302..ada3af87 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLSelectElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSelectElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSelectElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) @@ -27,7 +27,7 @@ public class HTMLSelectElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -61,26 +61,26 @@ public class HTMLSelectElement: HTMLElement { @ReadWriteAttribute public var length: UInt32 - public subscript(key: Int) -> HTMLOptionElement? { + @inlinable public subscript(key: Int) -> HTMLOptionElement? { jsObject[key].fromJSValue() } - public func namedItem(name: String) -> HTMLOptionElement? { + @inlinable public func namedItem(name: String) -> HTMLOptionElement? { let this = jsObject return this[Strings.namedItem].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { + @inlinable public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { let this = jsObject _ = this[Strings.add].function!(this: this, arguments: [element.jsValue(), before?.jsValue() ?? .undefined]) } - public func remove() { + @inlinable public func remove() { let this = jsObject _ = this[Strings.remove].function!(this: this, arguments: []) } - public func remove(index: Int32) { + @inlinable public func remove(index: Int32) { let this = jsObject _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue()]) } @@ -105,17 +105,17 @@ public class HTMLSelectElement: HTMLElement { @ReadonlyAttribute public var validationMessage: String - public func checkValidity() -> Bool { + @inlinable public func checkValidity() -> Bool { let this = jsObject return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } - public func reportValidity() -> Bool { + @inlinable public func reportValidity() -> Bool { let this = jsObject return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } - public func setCustomValidity(error: String) { + @inlinable public func setCustomValidity(error: String) { let this = jsObject _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index 6d54db1f..c7a2a629 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -4,31 +4,31 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLSlotElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSlotElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSlotElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute public var name: String - public func assignedNodes(options: AssignedNodesOptions? = nil) -> [Node] { + @inlinable public func assignedNodes(options: AssignedNodesOptions? = nil) -> [Node] { let this = jsObject return this[Strings.assignedNodes].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func assignedElements(options: AssignedNodesOptions? = nil) -> [Element] { + @inlinable public func assignedElements(options: AssignedNodesOptions? = nil) -> [Element] { let this = jsObject return this[Strings.assignedElements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func assign(nodes: __UNSUPPORTED_UNION__...) { + @inlinable public func assign(nodes: __UNSUPPORTED_UNION__...) { let this = jsObject _ = this[Strings.assign].function!(this: this, arguments: nodes.map { $0.jsValue() }) } diff --git a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift index 77f2f237..6edd2ebb 100644 --- a/Sources/DOMKit/WebIDL/HTMLSourceElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSourceElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLSourceElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSourceElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSourceElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) @@ -17,7 +17,7 @@ public class HTMLSourceElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift index fbdf0b54..6a91c7f1 100644 --- a/Sources/DOMKit/WebIDL/HTMLSpanElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSpanElement.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLSpanElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSpanElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLSpanElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift index 9faa5601..9aa39e44 100644 --- a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLStyleElement: HTMLElement, LinkStyle { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLStyleElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLStyleElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _media = ReadWriteAttribute(jsObject: jsObject, name: Strings.media) @@ -13,7 +13,7 @@ public class HTMLStyleElement: HTMLElement, LinkStyle { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift index e280f8c9..20c6c3e0 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCaptionElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableCaptionElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableCaptionElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableCaptionElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift index e6b17aca..424c1e41 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableCellElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableCellElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableCellElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableCellElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _colSpan = ReadWriteAttribute(jsObject: jsObject, name: Strings.colSpan) @@ -25,7 +25,7 @@ public class HTMLTableCellElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift index e58c4de8..eeffb588 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableColElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableColElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableColElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableColElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableColElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _span = ReadWriteAttribute(jsObject: jsObject, name: Strings.span) @@ -16,7 +16,7 @@ public class HTMLTableColElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift index 81934e79..a5dbd710 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _caption = ReadWriteAttribute(jsObject: jsObject, name: Strings.caption) @@ -24,19 +24,19 @@ public class HTMLTableElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadWriteAttribute public var caption: HTMLTableCaptionElement? - public func createCaption() -> HTMLTableCaptionElement { + @inlinable public func createCaption() -> HTMLTableCaptionElement { let this = jsObject return this[Strings.createCaption].function!(this: this, arguments: []).fromJSValue()! } - public func deleteCaption() { + @inlinable public func deleteCaption() { let this = jsObject _ = this[Strings.deleteCaption].function!(this: this, arguments: []) } @@ -44,12 +44,12 @@ public class HTMLTableElement: HTMLElement { @ReadWriteAttribute public var tHead: HTMLTableSectionElement? - public func createTHead() -> HTMLTableSectionElement { + @inlinable public func createTHead() -> HTMLTableSectionElement { let this = jsObject return this[Strings.createTHead].function!(this: this, arguments: []).fromJSValue()! } - public func deleteTHead() { + @inlinable public func deleteTHead() { let this = jsObject _ = this[Strings.deleteTHead].function!(this: this, arguments: []) } @@ -57,12 +57,12 @@ public class HTMLTableElement: HTMLElement { @ReadWriteAttribute public var tFoot: HTMLTableSectionElement? - public func createTFoot() -> HTMLTableSectionElement { + @inlinable public func createTFoot() -> HTMLTableSectionElement { let this = jsObject return this[Strings.createTFoot].function!(this: this, arguments: []).fromJSValue()! } - public func deleteTFoot() { + @inlinable public func deleteTFoot() { let this = jsObject _ = this[Strings.deleteTFoot].function!(this: this, arguments: []) } @@ -70,7 +70,7 @@ public class HTMLTableElement: HTMLElement { @ReadonlyAttribute public var tBodies: HTMLCollection - public func createTBody() -> HTMLTableSectionElement { + @inlinable public func createTBody() -> HTMLTableSectionElement { let this = jsObject return this[Strings.createTBody].function!(this: this, arguments: []).fromJSValue()! } @@ -78,12 +78,12 @@ public class HTMLTableElement: HTMLElement { @ReadonlyAttribute public var rows: HTMLCollection - public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { + @inlinable public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { let this = jsObject return this[Strings.insertRow].function!(this: this, arguments: [index?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteRow(index: Int32) { + @inlinable public func deleteRow(index: Int32) { let this = jsObject _ = this[Strings.deleteRow].function!(this: this, arguments: [index.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift index bac2527f..b3175de3 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableRowElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableRowElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableRowElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _rowIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.rowIndex) @@ -18,7 +18,7 @@ public class HTMLTableRowElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -31,12 +31,12 @@ public class HTMLTableRowElement: HTMLElement { @ReadonlyAttribute public var cells: HTMLCollection - public func insertCell(index: Int32? = nil) -> HTMLTableCellElement { + @inlinable public func insertCell(index: Int32? = nil) -> HTMLTableCellElement { let this = jsObject return this[Strings.insertCell].function!(this: this, arguments: [index?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteCell(index: Int32) { + @inlinable public func deleteCell(index: Int32) { let this = jsObject _ = this[Strings.deleteCell].function!(this: this, arguments: [index.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift index 30a551a8..eb2395b5 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTableSectionElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableSectionElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTableSectionElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _rows = ReadonlyAttribute(jsObject: jsObject, name: Strings.rows) @@ -15,19 +15,19 @@ public class HTMLTableSectionElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute public var rows: HTMLCollection - public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { + @inlinable public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { let this = jsObject return this[Strings.insertRow].function!(this: this, arguments: [index?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteRow(index: Int32) { + @inlinable public func deleteRow(index: Int32) { let this = jsObject _ = this[Strings.deleteRow].function!(this: this, arguments: [index.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift index 3cca7679..0c417be9 100644 --- a/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTemplateElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTemplateElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTemplateElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTemplateElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _content = ReadonlyAttribute(jsObject: jsObject, name: Strings.content) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift index 97cfdcd3..9dc038e5 100644 --- a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTextAreaElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTextAreaElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTextAreaElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) @@ -34,7 +34,7 @@ public class HTMLTextAreaElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -98,17 +98,17 @@ public class HTMLTextAreaElement: HTMLElement { @ReadonlyAttribute public var validationMessage: String - public func checkValidity() -> Bool { + @inlinable public func checkValidity() -> Bool { let this = jsObject return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! } - public func reportValidity() -> Bool { + @inlinable public func reportValidity() -> Bool { let this = jsObject return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! } - public func setCustomValidity(error: String) { + @inlinable public func setCustomValidity(error: String) { let this = jsObject _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) } @@ -116,7 +116,7 @@ public class HTMLTextAreaElement: HTMLElement { @ReadonlyAttribute public var labels: NodeList - public func select() { + @inlinable public func select() { let this = jsObject _ = this[Strings.select].function!(this: this, arguments: []) } @@ -130,17 +130,17 @@ public class HTMLTextAreaElement: HTMLElement { @ReadWriteAttribute public var selectionDirection: String - public func setRangeText(replacement: String) { + @inlinable public func setRangeText(replacement: String) { let this = jsObject _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue()]) } - public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { + @inlinable public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { let this = jsObject _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined]) } - public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { + @inlinable public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { let this = jsObject _ = this[Strings.setSelectionRange].function!(this: this, arguments: [start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift index 9dbe58d8..3c030c96 100644 --- a/Sources/DOMKit/WebIDL/HTMLTimeElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTimeElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTimeElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTimeElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTimeElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _dateTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.dateTime) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift index 37811dd5..a3276414 100644 --- a/Sources/DOMKit/WebIDL/HTMLTitleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTitleElement.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTitleElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTitleElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTitleElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift index 4f0b260e..e40690bc 100644 --- a/Sources/DOMKit/WebIDL/HTMLTrackElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTrackElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLTrackElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTrackElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLTrackElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _kind = ReadWriteAttribute(jsObject: jsObject, name: Strings.kind) @@ -17,7 +17,7 @@ public class HTMLTrackElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLUListElement.swift b/Sources/DOMKit/WebIDL/HTMLUListElement.swift index bbf04bf8..58fc845f 100644 --- a/Sources/DOMKit/WebIDL/HTMLUListElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUListElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLUListElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLUListElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLUListElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _compact = ReadWriteAttribute(jsObject: jsObject, name: Strings.compact) @@ -12,7 +12,7 @@ public class HTMLUListElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift index 63f6cb5e..4fd853fa 100644 --- a/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLUnknownElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLUnknownElement: HTMLElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLUnknownElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLUnknownElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 19f9ee64..068f3211 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HTMLVideoElement: HTMLMediaElement { - override public class var constructor: JSFunction { JSObject.global[Strings.HTMLVideoElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLVideoElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) @@ -20,7 +20,7 @@ public class HTMLVideoElement: HTMLMediaElement { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -42,18 +42,18 @@ public class HTMLVideoElement: HTMLMediaElement { @ReadWriteAttribute public var playsInline: Bool - public func getVideoPlaybackQuality() -> VideoPlaybackQuality { + @inlinable public func getVideoPlaybackQuality() -> VideoPlaybackQuality { let this = jsObject return this[Strings.getVideoPlaybackQuality].function!(this: this, arguments: []).fromJSValue()! } - public func requestPictureInPicture() -> JSPromise { + @inlinable public func requestPictureInPicture() -> JSPromise { let this = jsObject return this[Strings.requestPictureInPicture].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestPictureInPicture() async throws -> PictureInPictureWindow { + @inlinable public func requestPictureInPicture() async throws -> PictureInPictureWindow { let this = jsObject let _promise: JSPromise = this[Strings.requestPictureInPicture].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -73,7 +73,7 @@ public class HTMLVideoElement: HTMLMediaElement { // XXX: member 'requestVideoFrameCallback' is ignored - public func cancelVideoFrameCallback(handle: UInt32) { + @inlinable public func cancelVideoFrameCallback(handle: UInt32) { let this = jsObject _ = this[Strings.cancelVideoFrameCallback].function!(this: this, arguments: [handle.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/HardwareAcceleration.swift b/Sources/DOMKit/WebIDL/HardwareAcceleration.swift index c3ad8dc5..ce13bd1b 100644 --- a/Sources/DOMKit/WebIDL/HardwareAcceleration.swift +++ b/Sources/DOMKit/WebIDL/HardwareAcceleration.swift @@ -8,16 +8,16 @@ public enum HardwareAcceleration: JSString, JSValueCompatible { case preferHardware = "prefer-hardware" case preferSoftware = "prefer-software" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/HashChangeEvent.swift b/Sources/DOMKit/WebIDL/HashChangeEvent.swift index 5d2a5ece..03f7aa2b 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HashChangeEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.HashChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HashChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _oldURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldURL) @@ -12,7 +12,7 @@ public class HashChangeEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: HashChangeEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: HashChangeEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/HdrMetadataType.swift b/Sources/DOMKit/WebIDL/HdrMetadataType.swift index 77dc70e2..222ccd38 100644 --- a/Sources/DOMKit/WebIDL/HdrMetadataType.swift +++ b/Sources/DOMKit/WebIDL/HdrMetadataType.swift @@ -8,16 +8,16 @@ public enum HdrMetadataType: JSString, JSValueCompatible { case smpteSt209410 = "smpteSt2094-10" case smpteSt209440 = "smpteSt2094-40" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift index 894b7f08..a28b9f50 100644 --- a/Sources/DOMKit/WebIDL/Headers.swift +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Headers: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.Headers].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Headers].function! } public let jsObject: JSObject @@ -12,31 +12,31 @@ public class Headers: JSBridgedClass, Sequence { self.jsObject = jsObject } - public convenience init(init: HeadersInit? = nil) { + @inlinable public convenience init(init: HeadersInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } - public func append(name: String, value: String) { + @inlinable public func append(name: String, value: String) { let this = jsObject _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } - public func delete(name: String) { + @inlinable public func delete(name: String) { let this = jsObject _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]) } - public func get(name: String) -> String? { + @inlinable public func get(name: String) -> String? { let this = jsObject return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func has(name: String) -> Bool { + @inlinable public func has(name: String) -> Bool { let this = jsObject return this[Strings.has].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func set(name: String, value: String) { + @inlinable public func set(name: String, value: String) { let this = jsObject _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/Highlight.swift b/Sources/DOMKit/WebIDL/Highlight.swift index a9e223fd..e9d5d71e 100644 --- a/Sources/DOMKit/WebIDL/Highlight.swift +++ b/Sources/DOMKit/WebIDL/Highlight.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Highlight: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Highlight].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Highlight].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class Highlight: JSBridgedClass { self.jsObject = jsObject } - public convenience init(initialRanges: AbstractRange...) { + @inlinable public convenience init(initialRanges: AbstractRange...) { self.init(unsafelyWrapping: Self.constructor.new(arguments: initialRanges.map { $0.jsValue() })) } diff --git a/Sources/DOMKit/WebIDL/HighlightRegistry.swift b/Sources/DOMKit/WebIDL/HighlightRegistry.swift index d9001985..b2794f44 100644 --- a/Sources/DOMKit/WebIDL/HighlightRegistry.swift +++ b/Sources/DOMKit/WebIDL/HighlightRegistry.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class HighlightRegistry: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.HighlightRegistry].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.HighlightRegistry].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/HighlightType.swift b/Sources/DOMKit/WebIDL/HighlightType.swift index 09d376ee..f4735a64 100644 --- a/Sources/DOMKit/WebIDL/HighlightType.swift +++ b/Sources/DOMKit/WebIDL/HighlightType.swift @@ -8,16 +8,16 @@ public enum HighlightType: JSString, JSValueCompatible { case spellingError = "spelling-error" case grammarError = "grammar-error" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/History.swift b/Sources/DOMKit/WebIDL/History.swift index 89b66243..4486bd34 100644 --- a/Sources/DOMKit/WebIDL/History.swift +++ b/Sources/DOMKit/WebIDL/History.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class History: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.History].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.History].function! } public let jsObject: JSObject @@ -24,27 +24,27 @@ public class History: JSBridgedClass { @ReadonlyAttribute public var state: JSValue - public func go(delta: Int32? = nil) { + @inlinable public func go(delta: Int32? = nil) { let this = jsObject _ = this[Strings.go].function!(this: this, arguments: [delta?.jsValue() ?? .undefined]) } - public func back() { + @inlinable public func back() { let this = jsObject _ = this[Strings.back].function!(this: this, arguments: []) } - public func forward() { + @inlinable public func forward() { let this = jsObject _ = this[Strings.forward].function!(this: this, arguments: []) } - public func pushState(data: JSValue, unused: String, url: String? = nil) { + @inlinable public func pushState(data: JSValue, unused: String, url: String? = nil) { let this = jsObject _ = this[Strings.pushState].function!(this: this, arguments: [data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined]) } - public func replaceState(data: JSValue, unused: String, url: String? = nil) { + @inlinable public func replaceState(data: JSValue, unused: String, url: String? = nil) { let this = jsObject _ = this[Strings.replaceState].function!(this: this, arguments: [data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/IDBCursor.swift b/Sources/DOMKit/WebIDL/IDBCursor.swift index a92e5b91..68a6c8b2 100644 --- a/Sources/DOMKit/WebIDL/IDBCursor.swift +++ b/Sources/DOMKit/WebIDL/IDBCursor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBCursor: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.IDBCursor].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBCursor].function! } public let jsObject: JSObject @@ -32,27 +32,27 @@ public class IDBCursor: JSBridgedClass { @ReadonlyAttribute public var request: IDBRequest - public func advance(count: UInt32) { + @inlinable public func advance(count: UInt32) { let this = jsObject _ = this[Strings.advance].function!(this: this, arguments: [count.jsValue()]) } - public func `continue`(key: JSValue? = nil) { + @inlinable public func `continue`(key: JSValue? = nil) { let this = jsObject _ = this[Strings.continue].function!(this: this, arguments: [key?.jsValue() ?? .undefined]) } - public func continuePrimaryKey(key: JSValue, primaryKey: JSValue) { + @inlinable public func continuePrimaryKey(key: JSValue, primaryKey: JSValue) { let this = jsObject _ = this[Strings.continuePrimaryKey].function!(this: this, arguments: [key.jsValue(), primaryKey.jsValue()]) } - public func update(value: JSValue) -> IDBRequest { + @inlinable public func update(value: JSValue) -> IDBRequest { let this = jsObject return this[Strings.update].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public func delete() -> IDBRequest { + @inlinable public func delete() -> IDBRequest { let this = jsObject return this[Strings.delete].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IDBCursorDirection.swift b/Sources/DOMKit/WebIDL/IDBCursorDirection.swift index c6e2af31..66166ea8 100644 --- a/Sources/DOMKit/WebIDL/IDBCursorDirection.swift +++ b/Sources/DOMKit/WebIDL/IDBCursorDirection.swift @@ -9,16 +9,16 @@ public enum IDBCursorDirection: JSString, JSValueCompatible { case prev = "prev" case prevunique = "prevunique" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/IDBCursorWithValue.swift b/Sources/DOMKit/WebIDL/IDBCursorWithValue.swift index aa3899ab..4c24da09 100644 --- a/Sources/DOMKit/WebIDL/IDBCursorWithValue.swift +++ b/Sources/DOMKit/WebIDL/IDBCursorWithValue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBCursorWithValue: IDBCursor { - override public class var constructor: JSFunction { JSObject.global[Strings.IDBCursorWithValue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBCursorWithValue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) diff --git a/Sources/DOMKit/WebIDL/IDBDatabase.swift b/Sources/DOMKit/WebIDL/IDBDatabase.swift index 1a347b73..db9dff64 100644 --- a/Sources/DOMKit/WebIDL/IDBDatabase.swift +++ b/Sources/DOMKit/WebIDL/IDBDatabase.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBDatabase: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.IDBDatabase].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBDatabase].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) @@ -26,22 +26,22 @@ public class IDBDatabase: EventTarget { @ReadonlyAttribute public var objectStoreNames: DOMStringList - public func transaction(storeNames: __UNSUPPORTED_UNION__, mode: IDBTransactionMode? = nil, options: IDBTransactionOptions? = nil) -> IDBTransaction { + @inlinable public func transaction(storeNames: __UNSUPPORTED_UNION__, mode: IDBTransactionMode? = nil, options: IDBTransactionOptions? = nil) -> IDBTransaction { let this = jsObject return this[Strings.transaction].function!(this: this, arguments: [storeNames.jsValue(), mode?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public func createObjectStore(name: String, options: IDBObjectStoreParameters? = nil) -> IDBObjectStore { + @inlinable public func createObjectStore(name: String, options: IDBObjectStoreParameters? = nil) -> IDBObjectStore { let this = jsObject return this[Strings.createObjectStore].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteObjectStore(name: String) { + @inlinable public func deleteObjectStore(name: String) { let this = jsObject _ = this[Strings.deleteObjectStore].function!(this: this, arguments: [name.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/IDBFactory.swift b/Sources/DOMKit/WebIDL/IDBFactory.swift index 6831d5e8..7e201a21 100644 --- a/Sources/DOMKit/WebIDL/IDBFactory.swift +++ b/Sources/DOMKit/WebIDL/IDBFactory.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBFactory: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.IDBFactory].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBFactory].function! } public let jsObject: JSObject @@ -12,29 +12,29 @@ public class IDBFactory: JSBridgedClass { self.jsObject = jsObject } - public func open(name: String, version: UInt64? = nil) -> IDBOpenDBRequest { + @inlinable public func open(name: String, version: UInt64? = nil) -> IDBOpenDBRequest { let this = jsObject return this[Strings.open].function!(this: this, arguments: [name.jsValue(), version?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteDatabase(name: String) -> IDBOpenDBRequest { + @inlinable public func deleteDatabase(name: String) -> IDBOpenDBRequest { let this = jsObject return this[Strings.deleteDatabase].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func databases() -> JSPromise { + @inlinable public func databases() -> JSPromise { let this = jsObject return this[Strings.databases].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func databases() async throws -> [IDBDatabaseInfo] { + @inlinable public func databases() async throws -> [IDBDatabaseInfo] { let this = jsObject let _promise: JSPromise = this[Strings.databases].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func cmp(first: JSValue, second: JSValue) -> Int16 { + @inlinable public func cmp(first: JSValue, second: JSValue) -> Int16 { let this = jsObject return this[Strings.cmp].function!(this: this, arguments: [first.jsValue(), second.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IDBIndex.swift b/Sources/DOMKit/WebIDL/IDBIndex.swift index e5c53cd9..f1897ea5 100644 --- a/Sources/DOMKit/WebIDL/IDBIndex.swift +++ b/Sources/DOMKit/WebIDL/IDBIndex.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBIndex: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.IDBIndex].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBIndex].function! } public let jsObject: JSObject @@ -32,37 +32,37 @@ public class IDBIndex: JSBridgedClass { @ReadonlyAttribute public var unique: Bool - public func get(query: JSValue) -> IDBRequest { + @inlinable public func get(query: JSValue) -> IDBRequest { let this = jsObject return this[Strings.get].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } - public func getKey(query: JSValue) -> IDBRequest { + @inlinable public func getKey(query: JSValue) -> IDBRequest { let this = jsObject return this[Strings.getKey].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } - public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { + @inlinable public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { let this = jsObject return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! } - public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { + @inlinable public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { let this = jsObject return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! } - public func count(query: JSValue? = nil) -> IDBRequest { + @inlinable public func count(query: JSValue? = nil) -> IDBRequest { let this = jsObject return this[Strings.count].function!(this: this, arguments: [query?.jsValue() ?? .undefined]).fromJSValue()! } - public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { + @inlinable public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { let this = jsObject return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! } - public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { + @inlinable public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { let this = jsObject return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IDBKeyRange.swift b/Sources/DOMKit/WebIDL/IDBKeyRange.swift index b967075e..ac354b8a 100644 --- a/Sources/DOMKit/WebIDL/IDBKeyRange.swift +++ b/Sources/DOMKit/WebIDL/IDBKeyRange.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBKeyRange: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.IDBKeyRange].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBKeyRange].function! } public let jsObject: JSObject @@ -28,27 +28,27 @@ public class IDBKeyRange: JSBridgedClass { @ReadonlyAttribute public var upperOpen: Bool - public static func only(value: JSValue) -> Self { + @inlinable public static func only(value: JSValue) -> Self { let this = constructor return this[Strings.only].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public static func lowerBound(lower: JSValue, open: Bool? = nil) -> Self { + @inlinable public static func lowerBound(lower: JSValue, open: Bool? = nil) -> Self { let this = constructor return this[Strings.lowerBound].function!(this: this, arguments: [lower.jsValue(), open?.jsValue() ?? .undefined]).fromJSValue()! } - public static func upperBound(upper: JSValue, open: Bool? = nil) -> Self { + @inlinable public static func upperBound(upper: JSValue, open: Bool? = nil) -> Self { let this = constructor return this[Strings.upperBound].function!(this: this, arguments: [upper.jsValue(), open?.jsValue() ?? .undefined]).fromJSValue()! } - public static func bound(lower: JSValue, upper: JSValue, lowerOpen: Bool? = nil, upperOpen: Bool? = nil) -> Self { + @inlinable public static func bound(lower: JSValue, upper: JSValue, lowerOpen: Bool? = nil, upperOpen: Bool? = nil) -> Self { let this = constructor return this[Strings.bound].function!(this: this, arguments: [lower.jsValue(), upper.jsValue(), lowerOpen?.jsValue() ?? .undefined, upperOpen?.jsValue() ?? .undefined]).fromJSValue()! } - public func includes(key: JSValue) -> Bool { + @inlinable public func includes(key: JSValue) -> Bool { let this = jsObject return this[Strings.includes].function!(this: this, arguments: [key.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBObjectStore.swift index e5730a07..9f681ff3 100644 --- a/Sources/DOMKit/WebIDL/IDBObjectStore.swift +++ b/Sources/DOMKit/WebIDL/IDBObjectStore.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBObjectStore: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.IDBObjectStore].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBObjectStore].function! } public let jsObject: JSObject @@ -32,72 +32,72 @@ public class IDBObjectStore: JSBridgedClass { @ReadonlyAttribute public var autoIncrement: Bool - public func put(value: JSValue, key: JSValue? = nil) -> IDBRequest { + @inlinable public func put(value: JSValue, key: JSValue? = nil) -> IDBRequest { let this = jsObject return this[Strings.put].function!(this: this, arguments: [value.jsValue(), key?.jsValue() ?? .undefined]).fromJSValue()! } - public func add(value: JSValue, key: JSValue? = nil) -> IDBRequest { + @inlinable public func add(value: JSValue, key: JSValue? = nil) -> IDBRequest { let this = jsObject return this[Strings.add].function!(this: this, arguments: [value.jsValue(), key?.jsValue() ?? .undefined]).fromJSValue()! } - public func delete(query: JSValue) -> IDBRequest { + @inlinable public func delete(query: JSValue) -> IDBRequest { let this = jsObject return this[Strings.delete].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } - public func clear() -> IDBRequest { + @inlinable public func clear() -> IDBRequest { let this = jsObject return this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! } - public func get(query: JSValue) -> IDBRequest { + @inlinable public func get(query: JSValue) -> IDBRequest { let this = jsObject return this[Strings.get].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } - public func getKey(query: JSValue) -> IDBRequest { + @inlinable public func getKey(query: JSValue) -> IDBRequest { let this = jsObject return this[Strings.getKey].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } - public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { + @inlinable public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { let this = jsObject return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! } - public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { + @inlinable public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { let this = jsObject return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! } - public func count(query: JSValue? = nil) -> IDBRequest { + @inlinable public func count(query: JSValue? = nil) -> IDBRequest { let this = jsObject return this[Strings.count].function!(this: this, arguments: [query?.jsValue() ?? .undefined]).fromJSValue()! } - public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { + @inlinable public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { let this = jsObject return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! } - public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { + @inlinable public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { let this = jsObject return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! } - public func index(name: String) -> IDBIndex { + @inlinable public func index(name: String) -> IDBIndex { let this = jsObject return this[Strings.index].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func createIndex(name: String, keyPath: __UNSUPPORTED_UNION__, options: IDBIndexParameters? = nil) -> IDBIndex { + @inlinable public func createIndex(name: String, keyPath: __UNSUPPORTED_UNION__, options: IDBIndexParameters? = nil) -> IDBIndex { let this = jsObject return this[Strings.createIndex].function!(this: this, arguments: [name.jsValue(), keyPath.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func deleteIndex(name: String) { + @inlinable public func deleteIndex(name: String) { let this = jsObject _ = this[Strings.deleteIndex].function!(this: this, arguments: [name.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift b/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift index 93943d90..d34fa830 100644 --- a/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift +++ b/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBOpenDBRequest: IDBRequest { - override public class var constructor: JSFunction { JSObject.global[Strings.IDBOpenDBRequest].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBOpenDBRequest].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onblocked = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onblocked) diff --git a/Sources/DOMKit/WebIDL/IDBRequest.swift b/Sources/DOMKit/WebIDL/IDBRequest.swift index 38c1dada..7423afa1 100644 --- a/Sources/DOMKit/WebIDL/IDBRequest.swift +++ b/Sources/DOMKit/WebIDL/IDBRequest.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBRequest: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.IDBRequest].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBRequest].function! } public required init(unsafelyWrapping jsObject: JSObject) { _result = ReadonlyAttribute(jsObject: jsObject, name: Strings.result) diff --git a/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift b/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift index 2f1b3929..e4e5ff8f 100644 --- a/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift +++ b/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift @@ -7,16 +7,16 @@ public enum IDBRequestReadyState: JSString, JSValueCompatible { case pending = "pending" case done = "done" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/IDBTransaction.swift b/Sources/DOMKit/WebIDL/IDBTransaction.swift index 29370ce7..ee3c5496 100644 --- a/Sources/DOMKit/WebIDL/IDBTransaction.swift +++ b/Sources/DOMKit/WebIDL/IDBTransaction.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBTransaction: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.IDBTransaction].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBTransaction].function! } public required init(unsafelyWrapping jsObject: JSObject) { _objectStoreNames = ReadonlyAttribute(jsObject: jsObject, name: Strings.objectStoreNames) @@ -33,17 +33,17 @@ public class IDBTransaction: EventTarget { @ReadonlyAttribute public var error: DOMException? - public func objectStore(name: String) -> IDBObjectStore { + @inlinable public func objectStore(name: String) -> IDBObjectStore { let this = jsObject return this[Strings.objectStore].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func commit() { + @inlinable public func commit() { let this = jsObject _ = this[Strings.commit].function!(this: this, arguments: []) } - public func abort() { + @inlinable public func abort() { let this = jsObject _ = this[Strings.abort].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift b/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift index d55c1dd1..004d87be 100644 --- a/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift +++ b/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift @@ -8,16 +8,16 @@ public enum IDBTransactionDurability: JSString, JSValueCompatible { case strict = "strict" case relaxed = "relaxed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/IDBTransactionMode.swift b/Sources/DOMKit/WebIDL/IDBTransactionMode.swift index ed0dea8e..8c3c7b22 100644 --- a/Sources/DOMKit/WebIDL/IDBTransactionMode.swift +++ b/Sources/DOMKit/WebIDL/IDBTransactionMode.swift @@ -8,16 +8,16 @@ public enum IDBTransactionMode: JSString, JSValueCompatible { case readwrite = "readwrite" case versionchange = "versionchange" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift b/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift index 562a2338..3974465d 100644 --- a/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBVersionChangeEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.IDBVersionChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBVersionChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _oldVersion = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldVersion) @@ -12,7 +12,7 @@ public class IDBVersionChangeEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: IDBVersionChangeEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: IDBVersionChangeEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/IIRFilterNode.swift b/Sources/DOMKit/WebIDL/IIRFilterNode.swift index 438f304f..7a9c918c 100644 --- a/Sources/DOMKit/WebIDL/IIRFilterNode.swift +++ b/Sources/DOMKit/WebIDL/IIRFilterNode.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit public class IIRFilterNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.IIRFilterNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IIRFilterNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: IIRFilterOptions) { + @inlinable public convenience init(context: BaseAudioContext, options: IIRFilterOptions) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) } - public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { + @inlinable public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { let this = jsObject _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/IdleDeadline.swift b/Sources/DOMKit/WebIDL/IdleDeadline.swift index c6e3d785..f2bb616b 100644 --- a/Sources/DOMKit/WebIDL/IdleDeadline.swift +++ b/Sources/DOMKit/WebIDL/IdleDeadline.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IdleDeadline: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.IdleDeadline].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IdleDeadline].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class IdleDeadline: JSBridgedClass { self.jsObject = jsObject } - public func timeRemaining() -> DOMHighResTimeStamp { + @inlinable public func timeRemaining() -> DOMHighResTimeStamp { let this = jsObject return this[Strings.timeRemaining].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IdleDetector.swift b/Sources/DOMKit/WebIDL/IdleDetector.swift index 32b4a84a..55d76940 100644 --- a/Sources/DOMKit/WebIDL/IdleDetector.swift +++ b/Sources/DOMKit/WebIDL/IdleDetector.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IdleDetector: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.IdleDetector].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IdleDetector].function! } public required init(unsafelyWrapping jsObject: JSObject) { _userState = ReadonlyAttribute(jsObject: jsObject, name: Strings.userState) @@ -13,7 +13,7 @@ public class IdleDetector: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -26,25 +26,25 @@ public class IdleDetector: EventTarget { @ClosureAttribute1Optional public var onchange: EventHandler - public static func requestPermission() -> JSPromise { + @inlinable public static func requestPermission() -> JSPromise { let this = constructor return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func requestPermission() async throws -> PermissionState { + @inlinable public static func requestPermission() async throws -> PermissionState { let this = constructor let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func start(options: IdleOptions? = nil) -> JSPromise { + @inlinable public func start(options: IdleOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.start].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func start(options: IdleOptions? = nil) async throws { + @inlinable public func start(options: IdleOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.start].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/ImageBitmap.swift b/Sources/DOMKit/WebIDL/ImageBitmap.swift index 9cda1920..bb780a8c 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmap.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageBitmap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ImageBitmap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageBitmap].function! } public let jsObject: JSObject @@ -20,7 +20,7 @@ public class ImageBitmap: JSBridgedClass { @ReadonlyAttribute public var height: UInt32 - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift index 3f35fc7c..787f6000 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageBitmapRenderingContext: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ImageBitmapRenderingContext].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageBitmapRenderingContext].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class ImageBitmapRenderingContext: JSBridgedClass { @ReadonlyAttribute public var canvas: __UNSUPPORTED_UNION__ - public func transferFromImageBitmap(bitmap: ImageBitmap?) { + @inlinable public func transferFromImageBitmap(bitmap: ImageBitmap?) { let this = jsObject _ = this[Strings.transferFromImageBitmap].function!(this: this, arguments: [bitmap.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/ImageCapture.swift b/Sources/DOMKit/WebIDL/ImageCapture.swift index be06815a..e82851ec 100644 --- a/Sources/DOMKit/WebIDL/ImageCapture.swift +++ b/Sources/DOMKit/WebIDL/ImageCapture.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageCapture: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ImageCapture].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageCapture].function! } public let jsObject: JSObject @@ -13,53 +13,53 @@ public class ImageCapture: JSBridgedClass { self.jsObject = jsObject } - public convenience init(videoTrack: MediaStreamTrack) { + @inlinable public convenience init(videoTrack: MediaStreamTrack) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [videoTrack.jsValue()])) } - public func takePhoto(photoSettings: PhotoSettings? = nil) -> JSPromise { + @inlinable public func takePhoto(photoSettings: PhotoSettings? = nil) -> JSPromise { let this = jsObject return this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func takePhoto(photoSettings: PhotoSettings? = nil) async throws -> Blob { + @inlinable public func takePhoto(photoSettings: PhotoSettings? = nil) async throws -> Blob { let this = jsObject let _promise: JSPromise = this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getPhotoCapabilities() -> JSPromise { + @inlinable public func getPhotoCapabilities() -> JSPromise { let this = jsObject return this[Strings.getPhotoCapabilities].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getPhotoCapabilities() async throws -> PhotoCapabilities { + @inlinable public func getPhotoCapabilities() async throws -> PhotoCapabilities { let this = jsObject let _promise: JSPromise = this[Strings.getPhotoCapabilities].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getPhotoSettings() -> JSPromise { + @inlinable public func getPhotoSettings() -> JSPromise { let this = jsObject return this[Strings.getPhotoSettings].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getPhotoSettings() async throws -> PhotoSettings { + @inlinable public func getPhotoSettings() async throws -> PhotoSettings { let this = jsObject let _promise: JSPromise = this[Strings.getPhotoSettings].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func grabFrame() -> JSPromise { + @inlinable public func grabFrame() -> JSPromise { let this = jsObject return this[Strings.grabFrame].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func grabFrame() async throws -> ImageBitmap { + @inlinable public func grabFrame() async throws -> ImageBitmap { let this = jsObject let _promise: JSPromise = this[Strings.grabFrame].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ImageData.swift b/Sources/DOMKit/WebIDL/ImageData.swift index 8501e905..03bf4e00 100644 --- a/Sources/DOMKit/WebIDL/ImageData.swift +++ b/Sources/DOMKit/WebIDL/ImageData.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageData: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ImageData].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageData].function! } public let jsObject: JSObject @@ -16,11 +16,11 @@ public class ImageData: JSBridgedClass { self.jsObject = jsObject } - public convenience init(sw: UInt32, sh: UInt32, settings: ImageDataSettings? = nil) { + @inlinable public convenience init(sw: UInt32, sh: UInt32, settings: ImageDataSettings? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined])) } - public convenience init(data: Uint8ClampedArray, sw: UInt32, sh: UInt32? = nil, settings: ImageDataSettings? = nil) { + @inlinable public convenience init(data: Uint8ClampedArray, sw: UInt32, sh: UInt32? = nil, settings: ImageDataSettings? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue(), sw.jsValue(), sh?.jsValue() ?? .undefined, settings?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/ImageDecoder.swift b/Sources/DOMKit/WebIDL/ImageDecoder.swift index 9a8963eb..a44901fd 100644 --- a/Sources/DOMKit/WebIDL/ImageDecoder.swift +++ b/Sources/DOMKit/WebIDL/ImageDecoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageDecoder: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ImageDecoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageDecoder].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class ImageDecoder: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: ImageDecoderInit) { + @inlinable public convenience init(init: ImageDecoderInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @@ -32,35 +32,35 @@ public class ImageDecoder: JSBridgedClass { @ReadonlyAttribute public var tracks: ImageTrackList - public func decode(options: ImageDecodeOptions? = nil) -> JSPromise { + @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, *) - public func decode(options: ImageDecodeOptions? = nil) async throws -> ImageDecodeResult { + @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.get().fromJSValue()! } - public func reset() { + @inlinable public func reset() { let this = jsObject _ = this[Strings.reset].function!(this: this, arguments: []) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public static func isTypeSupported(type: String) -> JSPromise { + @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, *) - public static func isTypeSupported(type: String) async throws -> Bool { + @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.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ImageOrientation.swift b/Sources/DOMKit/WebIDL/ImageOrientation.swift index bdeeadc2..f74377bb 100644 --- a/Sources/DOMKit/WebIDL/ImageOrientation.swift +++ b/Sources/DOMKit/WebIDL/ImageOrientation.swift @@ -7,16 +7,16 @@ public enum ImageOrientation: JSString, JSValueCompatible { case none = "none" case flipY = "flipY" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift index 70b4d48d..b0f6c49e 100644 --- a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift +++ b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift @@ -8,16 +8,16 @@ public enum ImageSmoothingQuality: JSString, JSValueCompatible { case medium = "medium" case high = "high" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ImageTrack.swift b/Sources/DOMKit/WebIDL/ImageTrack.swift index 634f2a06..b68c7a97 100644 --- a/Sources/DOMKit/WebIDL/ImageTrack.swift +++ b/Sources/DOMKit/WebIDL/ImageTrack.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageTrack: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.ImageTrack].function! } + @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) diff --git a/Sources/DOMKit/WebIDL/ImageTrackList.swift b/Sources/DOMKit/WebIDL/ImageTrackList.swift index 1bdabdd6..10b44925 100644 --- a/Sources/DOMKit/WebIDL/ImageTrackList.swift +++ b/Sources/DOMKit/WebIDL/ImageTrackList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ImageTrackList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ImageTrackList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageTrackList].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class ImageTrackList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: Int) -> ImageTrack { + @inlinable public subscript(key: Int) -> ImageTrack { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ImportExportKind.swift b/Sources/DOMKit/WebIDL/ImportExportKind.swift index 394385fd..7971d4b5 100644 --- a/Sources/DOMKit/WebIDL/ImportExportKind.swift +++ b/Sources/DOMKit/WebIDL/ImportExportKind.swift @@ -9,16 +9,16 @@ public enum ImportExportKind: JSString, JSValueCompatible { case memory = "memory" case global = "global" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Ink.swift b/Sources/DOMKit/WebIDL/Ink.swift index 0465c273..71368757 100644 --- a/Sources/DOMKit/WebIDL/Ink.swift +++ b/Sources/DOMKit/WebIDL/Ink.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Ink: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Ink].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Ink].function! } public let jsObject: JSObject @@ -12,13 +12,13 @@ public class Ink: JSBridgedClass { self.jsObject = jsObject } - public func requestPresenter(param: InkPresenterParam? = nil) -> JSPromise { + @inlinable public func requestPresenter(param: InkPresenterParam? = nil) -> JSPromise { let this = jsObject return this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestPresenter(param: InkPresenterParam? = nil) async throws -> InkPresenter { + @inlinable public func requestPresenter(param: InkPresenterParam? = nil) async throws -> InkPresenter { let this = jsObject let _promise: JSPromise = this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/InkPresenter.swift b/Sources/DOMKit/WebIDL/InkPresenter.swift index 7b46c45d..080e9269 100644 --- a/Sources/DOMKit/WebIDL/InkPresenter.swift +++ b/Sources/DOMKit/WebIDL/InkPresenter.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class InkPresenter: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.InkPresenter].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.InkPresenter].function! } public let jsObject: JSObject @@ -20,7 +20,7 @@ public class InkPresenter: JSBridgedClass { @ReadonlyAttribute public var expectedImprovement: UInt32 - public func updateInkTrailStartPoint(event: PointerEvent, style: InkTrailStyle) { + @inlinable public func updateInkTrailStartPoint(event: PointerEvent, style: InkTrailStyle) { let this = jsObject _ = this[Strings.updateInkTrailStartPoint].function!(this: this, arguments: [event.jsValue(), style.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/InnerHTML.swift b/Sources/DOMKit/WebIDL/InnerHTML.swift index b709f2fc..bac644a8 100644 --- a/Sources/DOMKit/WebIDL/InnerHTML.swift +++ b/Sources/DOMKit/WebIDL/InnerHTML.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol InnerHTML: JSBridgedClass {} public extension InnerHTML { - var innerHTML: String { + @inlinable var innerHTML: String { get { ReadWriteAttribute[Strings.innerHTML, in: jsObject] } set { ReadWriteAttribute[Strings.innerHTML, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift b/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift index b2ca736b..b5b1d069 100644 --- a/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift +++ b/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class InputDeviceCapabilities: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.InputDeviceCapabilities].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.InputDeviceCapabilities].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class InputDeviceCapabilities: JSBridgedClass { self.jsObject = jsObject } - public convenience init(deviceInitDict: InputDeviceCapabilitiesInit? = nil) { + @inlinable public convenience init(deviceInitDict: InputDeviceCapabilitiesInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/InputDeviceInfo.swift b/Sources/DOMKit/WebIDL/InputDeviceInfo.swift index 4adadefb..d6170195 100644 --- a/Sources/DOMKit/WebIDL/InputDeviceInfo.swift +++ b/Sources/DOMKit/WebIDL/InputDeviceInfo.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class InputDeviceInfo: MediaDeviceInfo { - override public class var constructor: JSFunction { JSObject.global[Strings.InputDeviceInfo].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.InputDeviceInfo].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public func getCapabilities() -> MediaTrackCapabilities { + @inlinable public func getCapabilities() -> MediaTrackCapabilities { let this = jsObject return this[Strings.getCapabilities].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index 266ca794..9f3d7523 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class InputEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.InputEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.InputEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) @@ -17,12 +17,12 @@ public class InputEvent: UIEvent { @ReadonlyAttribute public var dataTransfer: DataTransfer? - public func getTargetRanges() -> [StaticRange] { + @inlinable public func getTargetRanges() -> [StaticRange] { let this = jsObject return this[Strings.getTargetRanges].function!(this: this, arguments: []).fromJSValue()! } - public convenience init(type: String, eventInitDict: InputEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: InputEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/Instance.swift b/Sources/DOMKit/WebIDL/Instance.swift index 9be31e8f..e0e81831 100644 --- a/Sources/DOMKit/WebIDL/Instance.swift +++ b/Sources/DOMKit/WebIDL/Instance.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Instance: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Instance].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Instance].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class Instance: JSBridgedClass { self.jsObject = jsObject } - public convenience init(module: Module, importObject: JSObject? = nil) { + @inlinable public convenience init(module: Module, importObject: JSObject? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [module.jsValue(), importObject?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/InteractionCounts.swift b/Sources/DOMKit/WebIDL/InteractionCounts.swift index d1f03dd8..24f3564e 100644 --- a/Sources/DOMKit/WebIDL/InteractionCounts.swift +++ b/Sources/DOMKit/WebIDL/InteractionCounts.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class InteractionCounts: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.InteractionCounts].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.InteractionCounts].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/IntersectionObserver.swift b/Sources/DOMKit/WebIDL/IntersectionObserver.swift index 28bde196..4adb6343 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserver.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IntersectionObserver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.IntersectionObserver].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IntersectionObserver].function! } public let jsObject: JSObject @@ -26,22 +26,22 @@ public class IntersectionObserver: JSBridgedClass { @ReadonlyAttribute public var thresholds: [Double] - public func observe(target: Element) { + @inlinable public func observe(target: Element) { let this = jsObject _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue()]) } - public func unobserve(target: Element) { + @inlinable public func unobserve(target: Element) { let this = jsObject _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue()]) } - public func disconnect() { + @inlinable public func disconnect() { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: []) } - public func takeRecords() -> [IntersectionObserverEntry] { + @inlinable public func takeRecords() -> [IntersectionObserverEntry] { let this = jsObject return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift b/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift index 9ffa9806..3d8f5351 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IntersectionObserverEntry: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.IntersectionObserverEntry].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IntersectionObserverEntry].function! } public let jsObject: JSObject @@ -19,7 +19,7 @@ public class IntersectionObserverEntry: JSBridgedClass { self.jsObject = jsObject } - public convenience init(intersectionObserverEntryInit: IntersectionObserverEntryInit) { + @inlinable public convenience init(intersectionObserverEntryInit: IntersectionObserverEntryInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [intersectionObserverEntryInit.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/InterventionReportBody.swift b/Sources/DOMKit/WebIDL/InterventionReportBody.swift index b1947a21..b41bbd20 100644 --- a/Sources/DOMKit/WebIDL/InterventionReportBody.swift +++ b/Sources/DOMKit/WebIDL/InterventionReportBody.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class InterventionReportBody: ReportBody { - override public class var constructor: JSFunction { JSObject.global[Strings.InterventionReportBody].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.InterventionReportBody].function! } public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) @@ -15,7 +15,7 @@ public class InterventionReportBody: ReportBody { super.init(unsafelyWrapping: jsObject) } - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IntrinsicSizes.swift b/Sources/DOMKit/WebIDL/IntrinsicSizes.swift index 7de6b91f..b56d7648 100644 --- a/Sources/DOMKit/WebIDL/IntrinsicSizes.swift +++ b/Sources/DOMKit/WebIDL/IntrinsicSizes.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IntrinsicSizes: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.IntrinsicSizes].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IntrinsicSizes].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ItemType.swift b/Sources/DOMKit/WebIDL/ItemType.swift index 3665558a..d63eeb77 100644 --- a/Sources/DOMKit/WebIDL/ItemType.swift +++ b/Sources/DOMKit/WebIDL/ItemType.swift @@ -7,16 +7,16 @@ public enum ItemType: JSString, JSValueCompatible { case product = "product" case subscription = "subscription" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift b/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift index 1c4210f2..578d12ce 100644 --- a/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift +++ b/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift @@ -7,16 +7,16 @@ public enum IterationCompositeOperation: JSString, JSValueCompatible { case replace = "replace" case accumulate = "accumulate" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift b/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift index 40108f07..b7a51d31 100644 --- a/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift +++ b/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class KHR_parallel_shader_compile: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.KHR_parallel_shader_compile].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.KHR_parallel_shader_compile].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/KeyFormat.swift b/Sources/DOMKit/WebIDL/KeyFormat.swift index 697865c3..b64c36a9 100644 --- a/Sources/DOMKit/WebIDL/KeyFormat.swift +++ b/Sources/DOMKit/WebIDL/KeyFormat.swift @@ -9,16 +9,16 @@ public enum KeyFormat: JSString, JSValueCompatible { case pkcs8 = "pkcs8" case jwk = "jwk" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/KeyType.swift b/Sources/DOMKit/WebIDL/KeyType.swift index 3baa4053..4e8cb671 100644 --- a/Sources/DOMKit/WebIDL/KeyType.swift +++ b/Sources/DOMKit/WebIDL/KeyType.swift @@ -8,16 +8,16 @@ public enum KeyType: JSString, JSValueCompatible { case `private` = "private" case secret = "secret" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/KeyUsage.swift b/Sources/DOMKit/WebIDL/KeyUsage.swift index bddff2e0..5b527601 100644 --- a/Sources/DOMKit/WebIDL/KeyUsage.swift +++ b/Sources/DOMKit/WebIDL/KeyUsage.swift @@ -13,16 +13,16 @@ public enum KeyUsage: JSString, JSValueCompatible { case wrapKey = "wrapKey" case unwrapKey = "unwrapKey" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Keyboard.swift b/Sources/DOMKit/WebIDL/Keyboard.swift index 1f402347..199b193e 100644 --- a/Sources/DOMKit/WebIDL/Keyboard.swift +++ b/Sources/DOMKit/WebIDL/Keyboard.swift @@ -4,37 +4,37 @@ import JavaScriptEventLoop import JavaScriptKit public class Keyboard: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Keyboard].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Keyboard].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onlayoutchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onlayoutchange) super.init(unsafelyWrapping: jsObject) } - public func lock(keyCodes: [String]? = nil) -> JSPromise { + @inlinable public func lock(keyCodes: [String]? = nil) -> JSPromise { let this = jsObject return this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func lock(keyCodes: [String]? = nil) async throws { + @inlinable public func lock(keyCodes: [String]? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func unlock() { + @inlinable public func unlock() { let this = jsObject _ = this[Strings.unlock].function!(this: this, arguments: []) } - public func getLayoutMap() -> JSPromise { + @inlinable public func getLayoutMap() -> JSPromise { let this = jsObject return this[Strings.getLayoutMap].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getLayoutMap() async throws -> KeyboardLayoutMap { + @inlinable public func getLayoutMap() async throws -> KeyboardLayoutMap { let this = jsObject let _promise: JSPromise = this[Strings.getLayoutMap].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index 39a83c59..27a953ca 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class KeyboardEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.KeyboardEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.KeyboardEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) @@ -21,7 +21,7 @@ public class KeyboardEvent: UIEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: KeyboardEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: KeyboardEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -60,12 +60,12 @@ public class KeyboardEvent: UIEvent { @ReadonlyAttribute public var isComposing: Bool - public func getModifierState(keyArg: String) -> Bool { + @inlinable public func getModifierState(keyArg: String) -> Bool { let this = jsObject return this[Strings.getModifierState].function!(this: this, arguments: [keyArg.jsValue()]).fromJSValue()! } - public func initKeyboardEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, keyArg: String? = nil, locationArg: UInt32? = nil, ctrlKey: Bool? = nil, altKey: Bool? = nil, shiftKey: Bool? = nil, metaKey: Bool? = nil) { + @inlinable public func initKeyboardEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, keyArg: String? = nil, locationArg: UInt32? = nil, ctrlKey: Bool? = nil, altKey: Bool? = nil, shiftKey: Bool? = nil, metaKey: Bool? = nil) { let _arg0 = typeArg.jsValue() let _arg1 = bubblesArg?.jsValue() ?? .undefined let _arg2 = cancelableArg?.jsValue() ?? .undefined diff --git a/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift b/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift index dd935ea8..53c396b0 100644 --- a/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift +++ b/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class KeyboardLayoutMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.KeyboardLayoutMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.KeyboardLayoutMap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/KeyframeEffect.swift b/Sources/DOMKit/WebIDL/KeyframeEffect.swift index 3a948a40..a55282d3 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffect.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffect.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class KeyframeEffect: AnimationEffect { - override public class var constructor: JSFunction { JSObject.global[Strings.KeyframeEffect].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.KeyframeEffect].function! } public required init(unsafelyWrapping jsObject: JSObject) { _iterationComposite = ReadWriteAttribute(jsObject: jsObject, name: Strings.iterationComposite) @@ -17,11 +17,11 @@ public class KeyframeEffect: AnimationEffect { @ReadWriteAttribute public var iterationComposite: IterationCompositeOperation - public convenience init(target: Element?, keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(target: Element?, keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [target.jsValue(), keyframes.jsValue(), options?.jsValue() ?? .undefined])) } - public convenience init(source: KeyframeEffect) { + @inlinable public convenience init(source: KeyframeEffect) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue()])) } @@ -34,12 +34,12 @@ public class KeyframeEffect: AnimationEffect { @ReadWriteAttribute public var composite: CompositeOperation - public func getKeyframes() -> [JSObject] { + @inlinable public func getKeyframes() -> [JSObject] { let this = jsObject return this[Strings.getKeyframes].function!(this: this, arguments: []).fromJSValue()! } - public func setKeyframes(keyframes: JSObject?) { + @inlinable public func setKeyframes(keyframes: JSObject?) { let this = jsObject _ = this[Strings.setKeyframes].function!(this: this, arguments: [keyframes.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/LandmarkType.swift b/Sources/DOMKit/WebIDL/LandmarkType.swift index 846d2987..6b33a834 100644 --- a/Sources/DOMKit/WebIDL/LandmarkType.swift +++ b/Sources/DOMKit/WebIDL/LandmarkType.swift @@ -8,16 +8,16 @@ public enum LandmarkType: JSString, JSValueCompatible { case eye = "eye" case nose = "nose" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/LargeBlobSupport.swift b/Sources/DOMKit/WebIDL/LargeBlobSupport.swift index bf017688..5a7a92e9 100644 --- a/Sources/DOMKit/WebIDL/LargeBlobSupport.swift +++ b/Sources/DOMKit/WebIDL/LargeBlobSupport.swift @@ -7,16 +7,16 @@ public enum LargeBlobSupport: JSString, JSValueCompatible { case required = "required" case preferred = "preferred" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift b/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift index aca30947..d12d5974 100644 --- a/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift +++ b/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class LargestContentfulPaint: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.LargestContentfulPaint].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.LargestContentfulPaint].function! } public required init(unsafelyWrapping jsObject: JSObject) { _renderTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderTime) @@ -34,7 +34,7 @@ public class LargestContentfulPaint: PerformanceEntry { @ReadonlyAttribute public var element: Element? - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/LatencyMode.swift b/Sources/DOMKit/WebIDL/LatencyMode.swift index 16daa3bb..45c391c2 100644 --- a/Sources/DOMKit/WebIDL/LatencyMode.swift +++ b/Sources/DOMKit/WebIDL/LatencyMode.swift @@ -7,16 +7,16 @@ public enum LatencyMode: JSString, JSValueCompatible { case quality = "quality" case realtime = "realtime" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/LayoutChild.swift b/Sources/DOMKit/WebIDL/LayoutChild.swift index fe5cac7c..a99b9e0c 100644 --- a/Sources/DOMKit/WebIDL/LayoutChild.swift +++ b/Sources/DOMKit/WebIDL/LayoutChild.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class LayoutChild: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.LayoutChild].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutChild].function! } public let jsObject: JSObject @@ -16,25 +16,25 @@ public class LayoutChild: JSBridgedClass { @ReadonlyAttribute public var styleMap: StylePropertyMapReadOnly - public func intrinsicSizes() -> JSPromise { + @inlinable public func intrinsicSizes() -> JSPromise { let this = jsObject return this[Strings.intrinsicSizes].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func intrinsicSizes() async throws -> IntrinsicSizes { + @inlinable public func intrinsicSizes() async throws -> IntrinsicSizes { let this = jsObject let _promise: JSPromise = this[Strings.intrinsicSizes].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) -> JSPromise { + @inlinable public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) -> JSPromise { let this = jsObject return this[Strings.layoutNextFragment].function!(this: this, arguments: [constraints.jsValue(), breakToken.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) async throws -> LayoutFragment { + @inlinable public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) async throws -> LayoutFragment { let this = jsObject let _promise: JSPromise = this[Strings.layoutNextFragment].function!(this: this, arguments: [constraints.jsValue(), breakToken.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/LayoutConstraints.swift b/Sources/DOMKit/WebIDL/LayoutConstraints.swift index 92c289c6..d4dabf8b 100644 --- a/Sources/DOMKit/WebIDL/LayoutConstraints.swift +++ b/Sources/DOMKit/WebIDL/LayoutConstraints.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class LayoutConstraints: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.LayoutConstraints].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutConstraints].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/LayoutEdges.swift b/Sources/DOMKit/WebIDL/LayoutEdges.swift index 5339fe4b..00281c89 100644 --- a/Sources/DOMKit/WebIDL/LayoutEdges.swift +++ b/Sources/DOMKit/WebIDL/LayoutEdges.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class LayoutEdges: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.LayoutEdges].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutEdges].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/LayoutFragment.swift b/Sources/DOMKit/WebIDL/LayoutFragment.swift index 4b92a6bc..ca27e1d6 100644 --- a/Sources/DOMKit/WebIDL/LayoutFragment.swift +++ b/Sources/DOMKit/WebIDL/LayoutFragment.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class LayoutFragment: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.LayoutFragment].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutFragment].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/LayoutShift.swift b/Sources/DOMKit/WebIDL/LayoutShift.swift index 597d0d0e..484537c5 100644 --- a/Sources/DOMKit/WebIDL/LayoutShift.swift +++ b/Sources/DOMKit/WebIDL/LayoutShift.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class LayoutShift: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.LayoutShift].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.LayoutShift].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) @@ -26,7 +26,7 @@ public class LayoutShift: PerformanceEntry { @ReadonlyAttribute public var sources: [LayoutShiftAttribution] - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift b/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift index d3aa75fd..95ccb310 100644 --- a/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift +++ b/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class LayoutShiftAttribution: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.LayoutShiftAttribution].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutShiftAttribution].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/LayoutSizingMode.swift b/Sources/DOMKit/WebIDL/LayoutSizingMode.swift index 2fd416da..3f532ad9 100644 --- a/Sources/DOMKit/WebIDL/LayoutSizingMode.swift +++ b/Sources/DOMKit/WebIDL/LayoutSizingMode.swift @@ -7,16 +7,16 @@ public enum LayoutSizingMode: JSString, JSValueCompatible { case blockLike = "block-like" case manual = "manual" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift index ff92a5ef..eaf77092 100644 --- a/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class LayoutWorkletGlobalScope: WorkletGlobalScope { - override public class var constructor: JSFunction { JSObject.global[Strings.LayoutWorkletGlobalScope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.LayoutWorkletGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/LineAlignSetting.swift b/Sources/DOMKit/WebIDL/LineAlignSetting.swift index 4b1ed099..ce613de1 100644 --- a/Sources/DOMKit/WebIDL/LineAlignSetting.swift +++ b/Sources/DOMKit/WebIDL/LineAlignSetting.swift @@ -8,16 +8,16 @@ public enum LineAlignSetting: JSString, JSValueCompatible { case center = "center" case end = "end" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift b/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift index 9da9bbc1..a177a42b 100644 --- a/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift +++ b/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class LinearAccelerationSensor: Accelerometer { - override public class var constructor: JSFunction { JSObject.global[Strings.LinearAccelerationSensor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.LinearAccelerationSensor].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: AccelerometerSensorOptions? = nil) { + @inlinable public convenience init(options: AccelerometerSensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/LinkStyle.swift b/Sources/DOMKit/WebIDL/LinkStyle.swift index 19330183..962c0bcc 100644 --- a/Sources/DOMKit/WebIDL/LinkStyle.swift +++ b/Sources/DOMKit/WebIDL/LinkStyle.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol LinkStyle: JSBridgedClass {} public extension LinkStyle { - var sheet: CSSStyleSheet? { ReadonlyAttribute[Strings.sheet, in: jsObject] } + @inlinable var sheet: CSSStyleSheet? { ReadonlyAttribute[Strings.sheet, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Location.swift b/Sources/DOMKit/WebIDL/Location.swift index 078bb04a..bed2e134 100644 --- a/Sources/DOMKit/WebIDL/Location.swift +++ b/Sources/DOMKit/WebIDL/Location.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Location: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Location].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Location].function! } public let jsObject: JSObject @@ -49,17 +49,17 @@ public class Location: JSBridgedClass { @ReadWriteAttribute public var hash: String - public func assign(url: String) { + @inlinable public func assign(url: String) { let this = jsObject _ = this[Strings.assign].function!(this: this, arguments: [url.jsValue()]) } - public func replace(url: String) { + @inlinable public func replace(url: String) { let this = jsObject _ = this[Strings.replace].function!(this: this, arguments: [url.jsValue()]) } - public func reload() { + @inlinable public func reload() { let this = jsObject _ = this[Strings.reload].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/Lock.swift b/Sources/DOMKit/WebIDL/Lock.swift index d14ee62a..4b599193 100644 --- a/Sources/DOMKit/WebIDL/Lock.swift +++ b/Sources/DOMKit/WebIDL/Lock.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Lock: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Lock].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Lock].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/LockManager.swift b/Sources/DOMKit/WebIDL/LockManager.swift index 5bcf6ebd..d6afa67e 100644 --- a/Sources/DOMKit/WebIDL/LockManager.swift +++ b/Sources/DOMKit/WebIDL/LockManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class LockManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.LockManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LockManager].function! } public let jsObject: JSObject @@ -20,13 +20,13 @@ public class LockManager: JSBridgedClass { // XXX: member 'request' is ignored - public func query() -> JSPromise { + @inlinable public func query() -> JSPromise { let this = jsObject return this[Strings.query].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func query() async throws -> LockManagerSnapshot { + @inlinable public func query() async throws -> LockManagerSnapshot { let this = jsObject let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/LockMode.swift b/Sources/DOMKit/WebIDL/LockMode.swift index 5a0624dc..99110974 100644 --- a/Sources/DOMKit/WebIDL/LockMode.swift +++ b/Sources/DOMKit/WebIDL/LockMode.swift @@ -7,16 +7,16 @@ public enum LockMode: JSString, JSValueCompatible { case shared = "shared" case exclusive = "exclusive" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MIDIAccess.swift b/Sources/DOMKit/WebIDL/MIDIAccess.swift index 139dacc8..29898415 100644 --- a/Sources/DOMKit/WebIDL/MIDIAccess.swift +++ b/Sources/DOMKit/WebIDL/MIDIAccess.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MIDIAccess: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MIDIAccess].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIAccess].function! } public required init(unsafelyWrapping jsObject: JSObject) { _inputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputs) diff --git a/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift b/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift index 8a5e4ce2..e2a85ded 100644 --- a/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift +++ b/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class MIDIConnectionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.MIDIConnectionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIConnectionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: MIDIConnectionEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: MIDIConnectionEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/MIDIInput.swift b/Sources/DOMKit/WebIDL/MIDIInput.swift index b527d608..2f720958 100644 --- a/Sources/DOMKit/WebIDL/MIDIInput.swift +++ b/Sources/DOMKit/WebIDL/MIDIInput.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MIDIInput: MIDIPort { - override public class var constructor: JSFunction { JSObject.global[Strings.MIDIInput].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIInput].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onmidimessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmidimessage) diff --git a/Sources/DOMKit/WebIDL/MIDIInputMap.swift b/Sources/DOMKit/WebIDL/MIDIInputMap.swift index cd64b65e..ce5ff81f 100644 --- a/Sources/DOMKit/WebIDL/MIDIInputMap.swift +++ b/Sources/DOMKit/WebIDL/MIDIInputMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MIDIInputMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MIDIInputMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MIDIInputMap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift b/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift index e67135b6..3bc1404b 100644 --- a/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class MIDIMessageEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.MIDIMessageEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIMessageEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: MIDIMessageEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: MIDIMessageEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/MIDIOutput.swift b/Sources/DOMKit/WebIDL/MIDIOutput.swift index d3517842..70505bed 100644 --- a/Sources/DOMKit/WebIDL/MIDIOutput.swift +++ b/Sources/DOMKit/WebIDL/MIDIOutput.swift @@ -4,18 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class MIDIOutput: MIDIPort { - override public class var constructor: JSFunction { JSObject.global[Strings.MIDIOutput].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIOutput].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public func send(data: [UInt8], timestamp: DOMHighResTimeStamp? = nil) { + @inlinable public func send(data: [UInt8], timestamp: DOMHighResTimeStamp? = nil) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue(), timestamp?.jsValue() ?? .undefined]) } - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/MIDIOutputMap.swift b/Sources/DOMKit/WebIDL/MIDIOutputMap.swift index 20c52336..167b390e 100644 --- a/Sources/DOMKit/WebIDL/MIDIOutputMap.swift +++ b/Sources/DOMKit/WebIDL/MIDIOutputMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MIDIOutputMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MIDIOutputMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MIDIOutputMap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MIDIPort.swift b/Sources/DOMKit/WebIDL/MIDIPort.swift index bf97d2da..93f5e342 100644 --- a/Sources/DOMKit/WebIDL/MIDIPort.swift +++ b/Sources/DOMKit/WebIDL/MIDIPort.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MIDIPort: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MIDIPort].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIPort].function! } public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) @@ -42,25 +42,25 @@ public class MIDIPort: EventTarget { @ClosureAttribute1Optional public var onstatechange: EventHandler - public func open() -> JSPromise { + @inlinable public func open() -> JSPromise { let this = jsObject return this[Strings.open].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func open() async throws -> MIDIPort { + @inlinable public func open() async throws -> MIDIPort { let this = jsObject let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func close() -> JSPromise { + @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, *) - public func close() async throws -> MIDIPort { + @inlinable public func close() async throws -> MIDIPort { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift b/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift index d8b8ea0d..f8f28668 100644 --- a/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift +++ b/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift @@ -8,16 +8,16 @@ public enum MIDIPortConnectionState: JSString, JSValueCompatible { case closed = "closed" case pending = "pending" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift b/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift index 154e8b11..e363acec 100644 --- a/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift +++ b/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift @@ -7,16 +7,16 @@ public enum MIDIPortDeviceState: JSString, JSValueCompatible { case disconnected = "disconnected" case connected = "connected" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MIDIPortType.swift b/Sources/DOMKit/WebIDL/MIDIPortType.swift index a6e732ef..16b6f850 100644 --- a/Sources/DOMKit/WebIDL/MIDIPortType.swift +++ b/Sources/DOMKit/WebIDL/MIDIPortType.swift @@ -7,16 +7,16 @@ public enum MIDIPortType: JSString, JSValueCompatible { case input = "input" case output = "output" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ML.swift b/Sources/DOMKit/WebIDL/ML.swift index fd30e8eb..ca8912a5 100644 --- a/Sources/DOMKit/WebIDL/ML.swift +++ b/Sources/DOMKit/WebIDL/ML.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ML: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ML].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ML].function! } public let jsObject: JSObject @@ -12,17 +12,17 @@ public class ML: JSBridgedClass { self.jsObject = jsObject } - public func createContext(options: MLContextOptions? = nil) -> MLContext { + @inlinable public func createContext(options: MLContextOptions? = nil) -> MLContext { let this = jsObject return this[Strings.createContext].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func createContext(glContext: WebGLRenderingContext) -> MLContext { + @inlinable public func createContext(glContext: WebGLRenderingContext) -> MLContext { let this = jsObject return this[Strings.createContext].function!(this: this, arguments: [glContext.jsValue()]).fromJSValue()! } - public func createContext(gpuDevice: GPUDevice) -> MLContext { + @inlinable public func createContext(gpuDevice: GPUDevice) -> MLContext { let this = jsObject return this[Strings.createContext].function!(this: this, arguments: [gpuDevice.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MLAutoPad.swift b/Sources/DOMKit/WebIDL/MLAutoPad.swift index 1cb9b52e..48180d41 100644 --- a/Sources/DOMKit/WebIDL/MLAutoPad.swift +++ b/Sources/DOMKit/WebIDL/MLAutoPad.swift @@ -8,16 +8,16 @@ public enum MLAutoPad: JSString, JSValueCompatible { case sameUpper = "same-upper" case sameLower = "same-lower" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLContext.swift b/Sources/DOMKit/WebIDL/MLContext.swift index 74e668db..28405a12 100644 --- a/Sources/DOMKit/WebIDL/MLContext.swift +++ b/Sources/DOMKit/WebIDL/MLContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MLContext: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MLContext].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLContext].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift b/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift index 795dd9cd..76416323 100644 --- a/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift +++ b/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift @@ -9,16 +9,16 @@ public enum MLConv2dFilterOperandLayout: JSString, JSValueCompatible { case ohwi = "ohwi" case ihwo = "ihwo" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift b/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift index 7d3cb04d..8f5294a3 100644 --- a/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift +++ b/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift @@ -8,16 +8,16 @@ public enum MLConvTranspose2dFilterOperandLayout: JSString, JSValueCompatible { case hwoi = "hwoi" case ohwi = "ohwi" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLDevicePreference.swift b/Sources/DOMKit/WebIDL/MLDevicePreference.swift index 91d4d22f..5be40d72 100644 --- a/Sources/DOMKit/WebIDL/MLDevicePreference.swift +++ b/Sources/DOMKit/WebIDL/MLDevicePreference.swift @@ -8,16 +8,16 @@ public enum MLDevicePreference: JSString, JSValueCompatible { case gpu = "gpu" case cpu = "cpu" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLGraph.swift b/Sources/DOMKit/WebIDL/MLGraph.swift index 346af327..293b8e5c 100644 --- a/Sources/DOMKit/WebIDL/MLGraph.swift +++ b/Sources/DOMKit/WebIDL/MLGraph.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MLGraph: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MLGraph].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLGraph].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class MLGraph: JSBridgedClass { self.jsObject = jsObject } - public func compute(inputs: MLNamedInputs, outputs: MLNamedOutputs) { + @inlinable public func compute(inputs: MLNamedInputs, outputs: MLNamedOutputs) { let this = jsObject _ = this[Strings.compute].function!(this: this, arguments: [inputs.jsValue(), outputs.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift index 0fc99b11..802cb268 100644 --- a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift +++ b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MLGraphBuilder: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MLGraphBuilder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLGraphBuilder].function! } public let jsObject: JSObject @@ -12,156 +12,156 @@ public class MLGraphBuilder: JSBridgedClass { self.jsObject = jsObject } - public convenience init(context: MLContext) { + @inlinable public convenience init(context: MLContext) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue()])) } - public func input(name: String, desc: MLOperandDescriptor) -> MLOperand { + @inlinable public func input(name: String, desc: MLOperandDescriptor) -> MLOperand { let this = jsObject return this[Strings.input].function!(this: this, arguments: [name.jsValue(), desc.jsValue()]).fromJSValue()! } - public func constant(desc: MLOperandDescriptor, bufferView: MLBufferView) -> MLOperand { + @inlinable public func constant(desc: MLOperandDescriptor, bufferView: MLBufferView) -> MLOperand { let this = jsObject return this[Strings.constant].function!(this: this, arguments: [desc.jsValue(), bufferView.jsValue()]).fromJSValue()! } - public func constant(value: Double, type: MLOperandType? = nil) -> MLOperand { + @inlinable public func constant(value: Double, type: MLOperandType? = nil) -> MLOperand { let this = jsObject return this[Strings.constant].function!(this: this, arguments: [value.jsValue(), type?.jsValue() ?? .undefined]).fromJSValue()! } - public func build(outputs: MLNamedOperands) -> MLGraph { + @inlinable public func build(outputs: MLNamedOperands) -> MLGraph { let this = jsObject return this[Strings.build].function!(this: this, arguments: [outputs.jsValue()]).fromJSValue()! } - public func batchNormalization(input: MLOperand, mean: MLOperand, variance: MLOperand, options: MLBatchNormalizationOptions? = nil) -> MLOperand { + @inlinable public func batchNormalization(input: MLOperand, mean: MLOperand, variance: MLOperand, options: MLBatchNormalizationOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.batchNormalization].function!(this: this, arguments: [input.jsValue(), mean.jsValue(), variance.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func clamp(x: MLOperand, options: MLClampOptions? = nil) -> MLOperand { + @inlinable public func clamp(x: MLOperand, options: MLClampOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.clamp].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func clamp(options: MLClampOptions? = nil) -> MLOperator { + @inlinable public func clamp(options: MLClampOptions? = nil) -> MLOperator { let this = jsObject return this[Strings.clamp].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func concat(inputs: [MLOperand], axis: Int32) -> MLOperand { + @inlinable public func concat(inputs: [MLOperand], axis: Int32) -> MLOperand { let this = jsObject return this[Strings.concat].function!(this: this, arguments: [inputs.jsValue(), axis.jsValue()]).fromJSValue()! } - public func conv2d(input: MLOperand, filter: MLOperand, options: MLConv2dOptions? = nil) -> MLOperand { + @inlinable public func conv2d(input: MLOperand, filter: MLOperand, options: MLConv2dOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.conv2d].function!(this: this, arguments: [input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func convTranspose2d(input: MLOperand, filter: MLOperand, options: MLConvTranspose2dOptions? = nil) -> MLOperand { + @inlinable public func convTranspose2d(input: MLOperand, filter: MLOperand, options: MLConvTranspose2dOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.convTranspose2d].function!(this: this, arguments: [input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func add(a: MLOperand, b: MLOperand) -> MLOperand { + @inlinable public func add(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject return this[Strings.add].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } - public func sub(a: MLOperand, b: MLOperand) -> MLOperand { + @inlinable public func sub(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject return this[Strings.sub].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } - public func mul(a: MLOperand, b: MLOperand) -> MLOperand { + @inlinable public func mul(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject return this[Strings.mul].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } - public func div(a: MLOperand, b: MLOperand) -> MLOperand { + @inlinable public func div(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject return this[Strings.div].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } - public func max(a: MLOperand, b: MLOperand) -> MLOperand { + @inlinable public func max(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject return this[Strings.max].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } - public func min(a: MLOperand, b: MLOperand) -> MLOperand { + @inlinable public func min(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject return this[Strings.min].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } - public func pow(a: MLOperand, b: MLOperand) -> MLOperand { + @inlinable public func pow(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject return this[Strings.pow].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } - public func abs(x: MLOperand) -> MLOperand { + @inlinable public func abs(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.abs].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func ceil(x: MLOperand) -> MLOperand { + @inlinable public func ceil(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.ceil].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func cos(x: MLOperand) -> MLOperand { + @inlinable public func cos(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.cos].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func exp(x: MLOperand) -> MLOperand { + @inlinable public func exp(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.exp].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func floor(x: MLOperand) -> MLOperand { + @inlinable public func floor(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.floor].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func log(x: MLOperand) -> MLOperand { + @inlinable public func log(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.log].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func neg(x: MLOperand) -> MLOperand { + @inlinable public func neg(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.neg].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func sin(x: MLOperand) -> MLOperand { + @inlinable public func sin(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.sin].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func tan(x: MLOperand) -> MLOperand { + @inlinable public func tan(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.tan].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func elu(x: MLOperand, options: MLEluOptions? = nil) -> MLOperand { + @inlinable public func elu(x: MLOperand, options: MLEluOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.elu].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func elu(options: MLEluOptions? = nil) -> MLOperator { + @inlinable public func elu(options: MLEluOptions? = nil) -> MLOperator { let this = jsObject return this[Strings.elu].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func gemm(a: MLOperand, b: MLOperand, options: MLGemmOptions? = nil) -> MLOperand { + @inlinable public func gemm(a: MLOperand, b: MLOperand, options: MLGemmOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.gemm].function!(this: this, arguments: [a.jsValue(), b.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func gru(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, steps: Int32, hiddenSize: Int32, options: MLGruOptions? = nil) -> [MLOperand] { + @inlinable public func gru(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, steps: Int32, hiddenSize: Int32, options: MLGruOptions? = nil) -> [MLOperand] { let _arg0 = input.jsValue() let _arg1 = weight.jsValue() let _arg2 = recurrentWeight.jsValue() @@ -172,7 +172,7 @@ public class MLGraphBuilder: JSBridgedClass { return this[Strings.gru].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } - public func gruCell(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, hiddenState: MLOperand, hiddenSize: Int32, options: MLGruCellOptions? = nil) -> MLOperand { + @inlinable public func gruCell(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, hiddenState: MLOperand, hiddenSize: Int32, options: MLGruCellOptions? = nil) -> MLOperand { let _arg0 = input.jsValue() let _arg1 = weight.jsValue() let _arg2 = recurrentWeight.jsValue() @@ -183,207 +183,207 @@ public class MLGraphBuilder: JSBridgedClass { return this[Strings.gruCell].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } - public func hardSigmoid(x: MLOperand, options: MLHardSigmoidOptions? = nil) -> MLOperand { + @inlinable public func hardSigmoid(x: MLOperand, options: MLHardSigmoidOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.hardSigmoid].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func hardSigmoid(options: MLHardSigmoidOptions? = nil) -> MLOperator { + @inlinable public func hardSigmoid(options: MLHardSigmoidOptions? = nil) -> MLOperator { let this = jsObject return this[Strings.hardSigmoid].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func hardSwish(x: MLOperand) -> MLOperand { + @inlinable public func hardSwish(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.hardSwish].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func hardSwish() -> MLOperator { + @inlinable public func hardSwish() -> MLOperator { let this = jsObject return this[Strings.hardSwish].function!(this: this, arguments: []).fromJSValue()! } - public func instanceNormalization(input: MLOperand, options: MLInstanceNormalizationOptions? = nil) -> MLOperand { + @inlinable public func instanceNormalization(input: MLOperand, options: MLInstanceNormalizationOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.instanceNormalization].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func leakyRelu(x: MLOperand, options: MLLeakyReluOptions? = nil) -> MLOperand { + @inlinable public func leakyRelu(x: MLOperand, options: MLLeakyReluOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.leakyRelu].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func leakyRelu(options: MLLeakyReluOptions? = nil) -> MLOperator { + @inlinable public func leakyRelu(options: MLLeakyReluOptions? = nil) -> MLOperator { let this = jsObject return this[Strings.leakyRelu].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func matmul(a: MLOperand, b: MLOperand) -> MLOperand { + @inlinable public func matmul(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject return this[Strings.matmul].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! } - public func linear(x: MLOperand, options: MLLinearOptions? = nil) -> MLOperand { + @inlinable public func linear(x: MLOperand, options: MLLinearOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.linear].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func linear(options: MLLinearOptions? = nil) -> MLOperator { + @inlinable public func linear(options: MLLinearOptions? = nil) -> MLOperator { let this = jsObject return this[Strings.linear].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func pad(input: MLOperand, padding: MLOperand, options: MLPadOptions? = nil) -> MLOperand { + @inlinable public func pad(input: MLOperand, padding: MLOperand, options: MLPadOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.pad].function!(this: this, arguments: [input.jsValue(), padding.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func averagePool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { + @inlinable public func averagePool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.averagePool2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func l2Pool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { + @inlinable public func l2Pool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.l2Pool2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func maxPool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { + @inlinable public func maxPool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.maxPool2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceL1(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceL1(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceL1].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceL2(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceL2(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceL2].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceLogSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceLogSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceLogSum].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceLogSumExp(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceLogSumExp(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceLogSumExp].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceMax(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceMax(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceMax].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceMean(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceMean(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceMean].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceMin(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceMin(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceMin].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceProduct(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceProduct(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceProduct].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceSum].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reduceSumSquare(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { + @inlinable public func reduceSumSquare(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.reduceSumSquare].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func relu(x: MLOperand) -> MLOperand { + @inlinable public func relu(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.relu].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func relu() -> MLOperator { + @inlinable public func relu() -> MLOperator { let this = jsObject return this[Strings.relu].function!(this: this, arguments: []).fromJSValue()! } - public func resample2d(input: MLOperand, options: MLResample2dOptions? = nil) -> MLOperand { + @inlinable public func resample2d(input: MLOperand, options: MLResample2dOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.resample2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reshape(input: MLOperand, newShape: [Int32]) -> MLOperand { + @inlinable public func reshape(input: MLOperand, newShape: [Int32]) -> MLOperand { let this = jsObject return this[Strings.reshape].function!(this: this, arguments: [input.jsValue(), newShape.jsValue()]).fromJSValue()! } - public func sigmoid(x: MLOperand) -> MLOperand { + @inlinable public func sigmoid(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.sigmoid].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func sigmoid() -> MLOperator { + @inlinable public func sigmoid() -> MLOperator { let this = jsObject return this[Strings.sigmoid].function!(this: this, arguments: []).fromJSValue()! } - public func slice(input: MLOperand, starts: [Int32], sizes: [Int32], options: MLSliceOptions? = nil) -> MLOperand { + @inlinable public func slice(input: MLOperand, starts: [Int32], sizes: [Int32], options: MLSliceOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.slice].function!(this: this, arguments: [input.jsValue(), starts.jsValue(), sizes.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func softmax(x: MLOperand) -> MLOperand { + @inlinable public func softmax(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.softmax].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func softplus(x: MLOperand, options: MLSoftplusOptions? = nil) -> MLOperand { + @inlinable public func softplus(x: MLOperand, options: MLSoftplusOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.softplus].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func softplus(options: MLSoftplusOptions? = nil) -> MLOperator { + @inlinable public func softplus(options: MLSoftplusOptions? = nil) -> MLOperator { let this = jsObject return this[Strings.softplus].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func softsign(x: MLOperand) -> MLOperand { + @inlinable public func softsign(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.softsign].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func softsign() -> MLOperator { + @inlinable public func softsign() -> MLOperator { let this = jsObject return this[Strings.softsign].function!(this: this, arguments: []).fromJSValue()! } - public func split(input: MLOperand, splits: __UNSUPPORTED_UNION__, options: MLSplitOptions? = nil) -> [MLOperand] { + @inlinable public func split(input: MLOperand, splits: __UNSUPPORTED_UNION__, options: MLSplitOptions? = nil) -> [MLOperand] { let this = jsObject return this[Strings.split].function!(this: this, arguments: [input.jsValue(), splits.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func squeeze(input: MLOperand, options: MLSqueezeOptions? = nil) -> MLOperand { + @inlinable public func squeeze(input: MLOperand, options: MLSqueezeOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.squeeze].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func tanh(x: MLOperand) -> MLOperand { + @inlinable public func tanh(x: MLOperand) -> MLOperand { let this = jsObject return this[Strings.tanh].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! } - public func tanh() -> MLOperator { + @inlinable public func tanh() -> MLOperator { let this = jsObject return this[Strings.tanh].function!(this: this, arguments: []).fromJSValue()! } - public func transpose(input: MLOperand, options: MLTransposeOptions? = nil) -> MLOperand { + @inlinable public func transpose(input: MLOperand, options: MLTransposeOptions? = nil) -> MLOperand { let this = jsObject return this[Strings.transpose].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift b/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift index 331ea268..78461b0b 100644 --- a/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift +++ b/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift @@ -7,16 +7,16 @@ public enum MLInputOperandLayout: JSString, JSValueCompatible { case nchw = "nchw" case nhwc = "nhwc" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLInterpolationMode.swift b/Sources/DOMKit/WebIDL/MLInterpolationMode.swift index 56785f87..c4c9040c 100644 --- a/Sources/DOMKit/WebIDL/MLInterpolationMode.swift +++ b/Sources/DOMKit/WebIDL/MLInterpolationMode.swift @@ -7,16 +7,16 @@ public enum MLInterpolationMode: JSString, JSValueCompatible { case nearestNeighbor = "nearest-neighbor" case linear = "linear" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLOperand.swift b/Sources/DOMKit/WebIDL/MLOperand.swift index 31a5b5da..2919f693 100644 --- a/Sources/DOMKit/WebIDL/MLOperand.swift +++ b/Sources/DOMKit/WebIDL/MLOperand.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MLOperand: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MLOperand].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLOperand].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MLOperandType.swift b/Sources/DOMKit/WebIDL/MLOperandType.swift index e64b0870..8b3a954c 100644 --- a/Sources/DOMKit/WebIDL/MLOperandType.swift +++ b/Sources/DOMKit/WebIDL/MLOperandType.swift @@ -11,16 +11,16 @@ public enum MLOperandType: JSString, JSValueCompatible { case int8 = "int8" case uint8 = "uint8" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLOperator.swift b/Sources/DOMKit/WebIDL/MLOperator.swift index cd8f130a..3616d36c 100644 --- a/Sources/DOMKit/WebIDL/MLOperator.swift +++ b/Sources/DOMKit/WebIDL/MLOperator.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MLOperator: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MLOperator].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLOperator].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MLPaddingMode.swift b/Sources/DOMKit/WebIDL/MLPaddingMode.swift index 2995ca1c..1ce6dda3 100644 --- a/Sources/DOMKit/WebIDL/MLPaddingMode.swift +++ b/Sources/DOMKit/WebIDL/MLPaddingMode.swift @@ -9,16 +9,16 @@ public enum MLPaddingMode: JSString, JSValueCompatible { case reflection = "reflection" case symmetric = "symmetric" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLPowerPreference.swift b/Sources/DOMKit/WebIDL/MLPowerPreference.swift index 5e8dade8..7519f9fc 100644 --- a/Sources/DOMKit/WebIDL/MLPowerPreference.swift +++ b/Sources/DOMKit/WebIDL/MLPowerPreference.swift @@ -8,16 +8,16 @@ public enum MLPowerPreference: JSString, JSValueCompatible { case highPerformance = "high-performance" case lowPower = "low-power" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift b/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift index 07ee3756..cc86b9c0 100644 --- a/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift +++ b/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift @@ -8,16 +8,16 @@ public enum MLRecurrentNetworkDirection: JSString, JSValueCompatible { case backward = "backward" case both = "both" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift b/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift index fbdaf8f0..ac941ab7 100644 --- a/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift +++ b/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift @@ -7,16 +7,16 @@ public enum MLRecurrentNetworkWeightLayout: JSString, JSValueCompatible { case zrn = "zrn" case rzn = "rzn" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MLRoundingType.swift b/Sources/DOMKit/WebIDL/MLRoundingType.swift index 68dcb16c..c7be2cdb 100644 --- a/Sources/DOMKit/WebIDL/MLRoundingType.swift +++ b/Sources/DOMKit/WebIDL/MLRoundingType.swift @@ -7,16 +7,16 @@ public enum MLRoundingType: JSString, JSValueCompatible { case floor = "floor" case ceil = "ceil" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Magnetometer.swift b/Sources/DOMKit/WebIDL/Magnetometer.swift index cf630ff6..90a5ea61 100644 --- a/Sources/DOMKit/WebIDL/Magnetometer.swift +++ b/Sources/DOMKit/WebIDL/Magnetometer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Magnetometer: Sensor { - override public class var constructor: JSFunction { JSObject.global[Strings.Magnetometer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Magnetometer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) @@ -13,7 +13,7 @@ public class Magnetometer: Sensor { super.init(unsafelyWrapping: jsObject) } - public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { + @inlinable public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift index 0e8d26c7..05594e67 100644 --- a/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift +++ b/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift @@ -7,16 +7,16 @@ public enum MagnetometerLocalCoordinateSystem: JSString, JSValueCompatible { case device = "device" case screen = "screen" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MathMLElement.swift b/Sources/DOMKit/WebIDL/MathMLElement.swift index 87ca6dbe..2336d8bd 100644 --- a/Sources/DOMKit/WebIDL/MathMLElement.swift +++ b/Sources/DOMKit/WebIDL/MathMLElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MathMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, HTMLOrSVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.MathMLElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MathMLElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/MediaCapabilities.swift b/Sources/DOMKit/WebIDL/MediaCapabilities.swift index 2124411e..855ec4f5 100644 --- a/Sources/DOMKit/WebIDL/MediaCapabilities.swift +++ b/Sources/DOMKit/WebIDL/MediaCapabilities.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaCapabilities: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MediaCapabilities].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaCapabilities].function! } public let jsObject: JSObject @@ -12,25 +12,25 @@ public class MediaCapabilities: JSBridgedClass { self.jsObject = jsObject } - public func decodingInfo(configuration: MediaDecodingConfiguration) -> JSPromise { + @inlinable public func decodingInfo(configuration: MediaDecodingConfiguration) -> JSPromise { let this = jsObject return this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func decodingInfo(configuration: MediaDecodingConfiguration) async throws -> MediaCapabilitiesDecodingInfo { + @inlinable public func decodingInfo(configuration: MediaDecodingConfiguration) async throws -> MediaCapabilitiesDecodingInfo { let this = jsObject let _promise: JSPromise = this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func encodingInfo(configuration: MediaEncodingConfiguration) -> JSPromise { + @inlinable public func encodingInfo(configuration: MediaEncodingConfiguration) -> JSPromise { let this = jsObject return this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func encodingInfo(configuration: MediaEncodingConfiguration) async throws -> MediaCapabilitiesEncodingInfo { + @inlinable public func encodingInfo(configuration: MediaEncodingConfiguration) async throws -> MediaCapabilitiesEncodingInfo { let this = jsObject let _promise: JSPromise = this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/MediaDecodingType.swift b/Sources/DOMKit/WebIDL/MediaDecodingType.swift index 8ab0a0db..99833c78 100644 --- a/Sources/DOMKit/WebIDL/MediaDecodingType.swift +++ b/Sources/DOMKit/WebIDL/MediaDecodingType.swift @@ -8,16 +8,16 @@ public enum MediaDecodingType: JSString, JSValueCompatible { case mediaSource = "media-source" case webrtc = "webrtc" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift b/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift index 0df92a63..1f063478 100644 --- a/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift +++ b/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaDeviceInfo: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MediaDeviceInfo].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaDeviceInfo].function! } public let jsObject: JSObject @@ -28,7 +28,7 @@ public class MediaDeviceInfo: JSBridgedClass { @ReadonlyAttribute public var groupId: String - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MediaDeviceKind.swift b/Sources/DOMKit/WebIDL/MediaDeviceKind.swift index 59285654..f331436a 100644 --- a/Sources/DOMKit/WebIDL/MediaDeviceKind.swift +++ b/Sources/DOMKit/WebIDL/MediaDeviceKind.swift @@ -8,16 +8,16 @@ public enum MediaDeviceKind: JSString, JSValueCompatible { case audiooutput = "audiooutput" case videoinput = "videoinput" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaDevices.swift b/Sources/DOMKit/WebIDL/MediaDevices.swift index ea3a658f..e82c42ba 100644 --- a/Sources/DOMKit/WebIDL/MediaDevices.swift +++ b/Sources/DOMKit/WebIDL/MediaDevices.swift @@ -4,32 +4,32 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaDevices: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaDevices].function! } + @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) } - public func selectAudioOutput(options: AudioOutputOptions? = nil) -> JSPromise { + @inlinable public func selectAudioOutput(options: AudioOutputOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func selectAudioOutput(options: AudioOutputOptions? = nil) async throws -> MediaDeviceInfo { + @inlinable public func selectAudioOutput(options: AudioOutputOptions? = nil) async throws -> MediaDeviceInfo { let this = jsObject let _promise: JSPromise = this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func produceCropTarget(element: HTMLElement) -> JSPromise { + @inlinable public func produceCropTarget(element: HTMLElement) -> JSPromise { let this = jsObject return this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func produceCropTarget(element: HTMLElement) async throws -> CropTarget { + @inlinable public func produceCropTarget(element: HTMLElement) async throws -> CropTarget { let this = jsObject let _promise: JSPromise = this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -38,42 +38,42 @@ public class MediaDevices: EventTarget { @ClosureAttribute1Optional public var ondevicechange: EventHandler - public func enumerateDevices() -> JSPromise { + @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, *) - public func enumerateDevices() async throws -> [MediaDeviceInfo] { + @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.get().fromJSValue()! } - public func getSupportedConstraints() -> MediaTrackSupportedConstraints { + @inlinable public func getSupportedConstraints() -> MediaTrackSupportedConstraints { let this = jsObject return this[Strings.getSupportedConstraints].function!(this: this, arguments: []).fromJSValue()! } - public func getUserMedia(constraints: MediaStreamConstraints? = nil) -> JSPromise { + @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, *) - public func getUserMedia(constraints: MediaStreamConstraints? = nil) async throws -> MediaStream { + @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.get().fromJSValue()! } - public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) -> JSPromise { + @inlinable public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) -> JSPromise { let this = jsObject return this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) async throws -> MediaStream { + @inlinable public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) async throws -> MediaStream { let this = jsObject let _promise: JSPromise = this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift index f0bc10c6..0d57e850 100644 --- a/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift +++ b/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaElementAudioSourceNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaElementAudioSourceNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaElementAudioSourceNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _mediaElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaElement) super.init(unsafelyWrapping: jsObject) } - public convenience init(context: AudioContext, options: MediaElementAudioSourceOptions) { + @inlinable public convenience init(context: AudioContext, options: MediaElementAudioSourceOptions) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/MediaEncodingType.swift b/Sources/DOMKit/WebIDL/MediaEncodingType.swift index 3313cc2e..b54a6268 100644 --- a/Sources/DOMKit/WebIDL/MediaEncodingType.swift +++ b/Sources/DOMKit/WebIDL/MediaEncodingType.swift @@ -7,16 +7,16 @@ public enum MediaEncodingType: JSString, JSValueCompatible { case record = "record" case webrtc = "webrtc" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift b/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift index 48fe7a6d..eadaf045 100644 --- a/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaEncryptedEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaEncryptedEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaEncryptedEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _initDataType = ReadonlyAttribute(jsObject: jsObject, name: Strings.initDataType) @@ -12,7 +12,7 @@ public class MediaEncryptedEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: MediaEncryptedEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: MediaEncryptedEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/MediaError.swift b/Sources/DOMKit/WebIDL/MediaError.swift index e3960907..1c499ab5 100644 --- a/Sources/DOMKit/WebIDL/MediaError.swift +++ b/Sources/DOMKit/WebIDL/MediaError.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaError: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MediaError].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaError].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift index c4e3ee12..091320cb 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaKeyMessageEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaKeyMessageEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaKeyMessageEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _messageType = ReadonlyAttribute(jsObject: jsObject, name: Strings.messageType) @@ -12,7 +12,7 @@ public class MediaKeyMessageEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: MediaKeyMessageEventInit) { + @inlinable public convenience init(type: String, eventInitDict: MediaKeyMessageEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift index 4469c0f4..352b21e6 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift @@ -9,16 +9,16 @@ public enum MediaKeyMessageType: JSString, JSValueCompatible { case licenseRelease = "license-release" case individualizationRequest = "individualization-request" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaKeySession.swift b/Sources/DOMKit/WebIDL/MediaKeySession.swift index fceb1d24..c9d7fbf3 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySession.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySession.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaKeySession: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaKeySession].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaKeySession].function! } public required init(unsafelyWrapping jsObject: JSObject) { _sessionId = ReadonlyAttribute(jsObject: jsObject, name: Strings.sessionId) @@ -34,61 +34,61 @@ public class MediaKeySession: EventTarget { @ClosureAttribute1Optional public var onmessage: EventHandler - public func generateRequest(initDataType: String, initData: BufferSource) -> JSPromise { + @inlinable public func generateRequest(initDataType: String, initData: BufferSource) -> JSPromise { let this = jsObject return this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue(), initData.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func generateRequest(initDataType: String, initData: BufferSource) async throws { + @inlinable public func generateRequest(initDataType: String, initData: BufferSource) async throws { let this = jsObject let _promise: JSPromise = this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue(), initData.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func load(sessionId: String) -> JSPromise { + @inlinable public func load(sessionId: String) -> JSPromise { let this = jsObject return this[Strings.load].function!(this: this, arguments: [sessionId.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func load(sessionId: String) async throws -> Bool { + @inlinable public func load(sessionId: String) async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [sessionId.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func update(response: BufferSource) -> JSPromise { + @inlinable public func update(response: BufferSource) -> JSPromise { let this = jsObject return this[Strings.update].function!(this: this, arguments: [response.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func update(response: BufferSource) async throws { + @inlinable public func update(response: BufferSource) async throws { let this = jsObject let _promise: JSPromise = this[Strings.update].function!(this: this, arguments: [response.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func close() -> JSPromise { + @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, *) - public func close() async throws { + @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func remove() -> JSPromise { + @inlinable public func remove() -> JSPromise { let this = jsObject return this[Strings.remove].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func remove() async throws { + @inlinable public func remove() async throws { let this = jsObject let _promise: JSPromise = this[Strings.remove].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift b/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift index 9c57ca4f..56d8b6bc 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift @@ -10,16 +10,16 @@ public enum MediaKeySessionClosedReason: JSString, JSValueCompatible { case hardwareContextReset = "hardware-context-reset" case resourceEvicted = "resource-evicted" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaKeySessionType.swift b/Sources/DOMKit/WebIDL/MediaKeySessionType.swift index 7f86ad03..5d425c9b 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySessionType.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySessionType.swift @@ -7,16 +7,16 @@ public enum MediaKeySessionType: JSString, JSValueCompatible { case temporary = "temporary" case persistentLicense = "persistent-license" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatus.swift b/Sources/DOMKit/WebIDL/MediaKeyStatus.swift index bdbe3042..6091c973 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyStatus.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyStatus.swift @@ -13,16 +13,16 @@ public enum MediaKeyStatus: JSString, JSValueCompatible { case statusPending = "status-pending" case internalError = "internal-error" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift index 31b0ec4d..ffbd55f9 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaKeyStatusMap: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.MediaKeyStatusMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaKeyStatusMap].function! } public let jsObject: JSObject @@ -21,12 +21,12 @@ public class MediaKeyStatusMap: JSBridgedClass, Sequence { @ReadonlyAttribute public var size: UInt32 - public func has(keyId: BufferSource) -> Bool { + @inlinable public func has(keyId: BufferSource) -> Bool { let this = jsObject return this[Strings.has].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! } - public func get(keyId: BufferSource) -> __UNSUPPORTED_UNION__ { + @inlinable public func get(keyId: BufferSource) -> __UNSUPPORTED_UNION__ { let this = jsObject return this[Strings.get].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift b/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift index 67a3063d..cf4c171a 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaKeySystemAccess: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MediaKeySystemAccess].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaKeySystemAccess].function! } public let jsObject: JSObject @@ -16,18 +16,18 @@ public class MediaKeySystemAccess: JSBridgedClass { @ReadonlyAttribute public var keySystem: String - public func getConfiguration() -> MediaKeySystemConfiguration { + @inlinable public func getConfiguration() -> MediaKeySystemConfiguration { let this = jsObject return this[Strings.getConfiguration].function!(this: this, arguments: []).fromJSValue()! } - public func createMediaKeys() -> JSPromise { + @inlinable public func createMediaKeys() -> JSPromise { let this = jsObject return this[Strings.createMediaKeys].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createMediaKeys() async throws -> MediaKeys { + @inlinable public func createMediaKeys() async throws -> MediaKeys { let this = jsObject let _promise: JSPromise = this[Strings.createMediaKeys].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/MediaKeys.swift b/Sources/DOMKit/WebIDL/MediaKeys.swift index 7e3e1d05..6a09cd3d 100644 --- a/Sources/DOMKit/WebIDL/MediaKeys.swift +++ b/Sources/DOMKit/WebIDL/MediaKeys.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaKeys: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MediaKeys].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaKeys].function! } public let jsObject: JSObject @@ -12,18 +12,18 @@ public class MediaKeys: JSBridgedClass { self.jsObject = jsObject } - public func createSession(sessionType: MediaKeySessionType? = nil) -> MediaKeySession { + @inlinable public func createSession(sessionType: MediaKeySessionType? = nil) -> MediaKeySession { let this = jsObject return this[Strings.createSession].function!(this: this, arguments: [sessionType?.jsValue() ?? .undefined]).fromJSValue()! } - public func setServerCertificate(serverCertificate: BufferSource) -> JSPromise { + @inlinable public func setServerCertificate(serverCertificate: BufferSource) -> JSPromise { let this = jsObject return this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setServerCertificate(serverCertificate: BufferSource) async throws -> Bool { + @inlinable public func setServerCertificate(serverCertificate: BufferSource) async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift b/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift index 18ceae7c..2bf8891c 100644 --- a/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift +++ b/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift @@ -8,16 +8,16 @@ public enum MediaKeysRequirement: JSString, JSValueCompatible { case optional = "optional" case notAllowed = "not-allowed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift index fe566a7f..e4f3087d 100644 --- a/Sources/DOMKit/WebIDL/MediaList.swift +++ b/Sources/DOMKit/WebIDL/MediaList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MediaList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaList].function! } public let jsObject: JSObject @@ -20,16 +20,16 @@ public class MediaList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> String? { + @inlinable public subscript(key: Int) -> String? { jsObject[key].fromJSValue() } - public func appendMedium(medium: String) { + @inlinable public func appendMedium(medium: String) { let this = jsObject _ = this[Strings.appendMedium].function!(this: this, arguments: [medium.jsValue()]) } - public func deleteMedium(medium: String) { + @inlinable public func deleteMedium(medium: String) { let this = jsObject _ = this[Strings.deleteMedium].function!(this: this, arguments: [medium.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/MediaMetadata.swift b/Sources/DOMKit/WebIDL/MediaMetadata.swift index 567736fe..f4182aec 100644 --- a/Sources/DOMKit/WebIDL/MediaMetadata.swift +++ b/Sources/DOMKit/WebIDL/MediaMetadata.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaMetadata: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MediaMetadata].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaMetadata].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class MediaMetadata: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: MediaMetadataInit? = nil) { + @inlinable public convenience init(init: MediaMetadataInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/MediaQueryList.swift b/Sources/DOMKit/WebIDL/MediaQueryList.swift index dbbebd56..e2f6e574 100644 --- a/Sources/DOMKit/WebIDL/MediaQueryList.swift +++ b/Sources/DOMKit/WebIDL/MediaQueryList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaQueryList: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaQueryList].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaQueryList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) diff --git a/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift b/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift index 91027d22..502349b0 100644 --- a/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaQueryListEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaQueryListEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaQueryListEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) @@ -12,7 +12,7 @@ public class MediaQueryListEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: MediaQueryListEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: MediaQueryListEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/MediaRecorder.swift b/Sources/DOMKit/WebIDL/MediaRecorder.swift index 80cc48b9..8845453b 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorder.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaRecorder: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaRecorder].function! } + @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) @@ -22,7 +22,7 @@ public class MediaRecorder: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(stream: MediaStream, options: MediaRecorderOptions? = nil) { + @inlinable public convenience init(stream: MediaStream, options: MediaRecorderOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue(), options?.jsValue() ?? .undefined])) } @@ -62,32 +62,32 @@ public class MediaRecorder: EventTarget { @ReadonlyAttribute public var audioBitrateMode: BitrateMode - public func start(timeslice: UInt32? = nil) { + @inlinable public func start(timeslice: UInt32? = nil) { let this = jsObject _ = this[Strings.start].function!(this: this, arguments: [timeslice?.jsValue() ?? .undefined]) } - public func stop() { + @inlinable public func stop() { let this = jsObject _ = this[Strings.stop].function!(this: this, arguments: []) } - public func pause() { + @inlinable public func pause() { let this = jsObject _ = this[Strings.pause].function!(this: this, arguments: []) } - public func resume() { + @inlinable public func resume() { let this = jsObject _ = this[Strings.resume].function!(this: this, arguments: []) } - public func requestData() { + @inlinable public func requestData() { let this = jsObject _ = this[Strings.requestData].function!(this: this, arguments: []) } - public static func isTypeSupported(type: String) -> Bool { + @inlinable public static func isTypeSupported(type: String) -> Bool { let this = constructor return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift b/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift index 600e653a..041148a3 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaRecorderErrorEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaRecorderErrorEvent].function! } + @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) } - public convenience init(type: String, eventInitDict: MediaRecorderErrorEventInit) { + @inlinable public convenience init(type: String, eventInitDict: MediaRecorderErrorEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/MediaSession.swift b/Sources/DOMKit/WebIDL/MediaSession.swift index b57a5c29..550c6a4a 100644 --- a/Sources/DOMKit/WebIDL/MediaSession.swift +++ b/Sources/DOMKit/WebIDL/MediaSession.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaSession: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MediaSession].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaSession].function! } public let jsObject: JSObject @@ -22,17 +22,17 @@ public class MediaSession: JSBridgedClass { // XXX: member 'setActionHandler' is ignored - public func setPositionState(state: MediaPositionState? = nil) { + @inlinable public func setPositionState(state: MediaPositionState? = nil) { let this = jsObject _ = this[Strings.setPositionState].function!(this: this, arguments: [state?.jsValue() ?? .undefined]) } - public func setMicrophoneActive(active: Bool) { + @inlinable public func setMicrophoneActive(active: Bool) { let this = jsObject _ = this[Strings.setMicrophoneActive].function!(this: this, arguments: [active.jsValue()]) } - public func setCameraActive(active: Bool) { + @inlinable public func setCameraActive(active: Bool) { let this = jsObject _ = this[Strings.setCameraActive].function!(this: this, arguments: [active.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/MediaSessionAction.swift b/Sources/DOMKit/WebIDL/MediaSessionAction.swift index 5bb7fa1f..d421fa1b 100644 --- a/Sources/DOMKit/WebIDL/MediaSessionAction.swift +++ b/Sources/DOMKit/WebIDL/MediaSessionAction.swift @@ -17,16 +17,16 @@ public enum MediaSessionAction: JSString, JSValueCompatible { case togglecamera = "togglecamera" case hangup = "hangup" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift b/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift index a281c116..bac3083a 100644 --- a/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift +++ b/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift @@ -8,16 +8,16 @@ public enum MediaSessionPlaybackState: JSString, JSValueCompatible { case paused = "paused" case playing = "playing" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MediaSource.swift b/Sources/DOMKit/WebIDL/MediaSource.swift index a784540f..f7c82990 100644 --- a/Sources/DOMKit/WebIDL/MediaSource.swift +++ b/Sources/DOMKit/WebIDL/MediaSource.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaSource: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaSource].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaSource].function! } public required init(unsafelyWrapping jsObject: JSObject) { _sourceBuffers = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffers) @@ -18,7 +18,7 @@ public class MediaSource: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -46,32 +46,32 @@ public class MediaSource: EventTarget { @ReadonlyAttribute public var canConstructInDedicatedWorker: Bool - public func addSourceBuffer(type: String) -> SourceBuffer { + @inlinable public func addSourceBuffer(type: String) -> SourceBuffer { let this = jsObject return this[Strings.addSourceBuffer].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } - public func removeSourceBuffer(sourceBuffer: SourceBuffer) { + @inlinable public func removeSourceBuffer(sourceBuffer: SourceBuffer) { let this = jsObject _ = this[Strings.removeSourceBuffer].function!(this: this, arguments: [sourceBuffer.jsValue()]) } - public func endOfStream(error: EndOfStreamError? = nil) { + @inlinable public func endOfStream(error: EndOfStreamError? = nil) { let this = jsObject _ = this[Strings.endOfStream].function!(this: this, arguments: [error?.jsValue() ?? .undefined]) } - public func setLiveSeekableRange(start: Double, end: Double) { + @inlinable public func setLiveSeekableRange(start: Double, end: Double) { let this = jsObject _ = this[Strings.setLiveSeekableRange].function!(this: this, arguments: [start.jsValue(), end.jsValue()]) } - public func clearLiveSeekableRange() { + @inlinable public func clearLiveSeekableRange() { let this = jsObject _ = this[Strings.clearLiveSeekableRange].function!(this: this, arguments: []) } - public static func isTypeSupported(type: String) -> Bool { + @inlinable public static func isTypeSupported(type: String) -> Bool { let this = constructor return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MediaStream.swift b/Sources/DOMKit/WebIDL/MediaStream.swift index 230533a0..312413ee 100644 --- a/Sources/DOMKit/WebIDL/MediaStream.swift +++ b/Sources/DOMKit/WebIDL/MediaStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStream: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaStream].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStream].function! } public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) @@ -14,52 +14,52 @@ public class MediaStream: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public convenience init(stream: MediaStream) { + @inlinable public convenience init(stream: MediaStream) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) } - public convenience init(tracks: [MediaStreamTrack]) { + @inlinable public convenience init(tracks: [MediaStreamTrack]) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [tracks.jsValue()])) } @ReadonlyAttribute public var id: String - public func getAudioTracks() -> [MediaStreamTrack] { + @inlinable public func getAudioTracks() -> [MediaStreamTrack] { let this = jsObject return this[Strings.getAudioTracks].function!(this: this, arguments: []).fromJSValue()! } - public func getVideoTracks() -> [MediaStreamTrack] { + @inlinable public func getVideoTracks() -> [MediaStreamTrack] { let this = jsObject return this[Strings.getVideoTracks].function!(this: this, arguments: []).fromJSValue()! } - public func getTracks() -> [MediaStreamTrack] { + @inlinable public func getTracks() -> [MediaStreamTrack] { let this = jsObject return this[Strings.getTracks].function!(this: this, arguments: []).fromJSValue()! } - public func getTrackById(trackId: String) -> MediaStreamTrack? { + @inlinable public func getTrackById(trackId: String) -> MediaStreamTrack? { let this = jsObject return this[Strings.getTrackById].function!(this: this, arguments: [trackId.jsValue()]).fromJSValue()! } - public func addTrack(track: MediaStreamTrack) { + @inlinable public func addTrack(track: MediaStreamTrack) { let this = jsObject _ = this[Strings.addTrack].function!(this: this, arguments: [track.jsValue()]) } - public func removeTrack(track: MediaStreamTrack) { + @inlinable public func removeTrack(track: MediaStreamTrack) { let this = jsObject _ = this[Strings.removeTrack].function!(this: this, arguments: [track.jsValue()]) } - public func clone() -> Self { + @inlinable public func clone() -> Self { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift index 39756616..b494961d 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamAudioDestinationNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamAudioDestinationNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamAudioDestinationNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _stream = ReadonlyAttribute(jsObject: jsObject, name: Strings.stream) super.init(unsafelyWrapping: jsObject) } - public convenience init(context: AudioContext, options: AudioNodeOptions? = nil) { + @inlinable public convenience init(context: AudioContext, options: AudioNodeOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift index cc22efa1..33f15136 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamAudioSourceNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamAudioSourceNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamAudioSourceNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _mediaStream = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaStream) super.init(unsafelyWrapping: jsObject) } - public convenience init(context: AudioContext, options: MediaStreamAudioSourceOptions) { + @inlinable public convenience init(context: AudioContext, options: MediaStreamAudioSourceOptions) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift index 0b8f8ed6..725a0bb2 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamTrack: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrack].function! } + @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) @@ -49,38 +49,38 @@ public class MediaStreamTrack: EventTarget { @ClosureAttribute1Optional public var onended: EventHandler - public func clone() -> Self { + @inlinable public func clone() -> Self { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } - public func stop() { + @inlinable public func stop() { let this = jsObject _ = this[Strings.stop].function!(this: this, arguments: []) } - public func getCapabilities() -> MediaTrackCapabilities { + @inlinable public func getCapabilities() -> MediaTrackCapabilities { let this = jsObject return this[Strings.getCapabilities].function!(this: this, arguments: []).fromJSValue()! } - public func getConstraints() -> MediaTrackConstraints { + @inlinable public func getConstraints() -> MediaTrackConstraints { let this = jsObject return this[Strings.getConstraints].function!(this: this, arguments: []).fromJSValue()! } - public func getSettings() -> MediaTrackSettings { + @inlinable public func getSettings() -> MediaTrackSettings { let this = jsObject return this[Strings.getSettings].function!(this: this, arguments: []).fromJSValue()! } - public func applyConstraints(constraints: MediaTrackConstraints? = nil) -> JSPromise { + @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, *) - public func applyConstraints(constraints: MediaTrackConstraints? = nil) async throws { + @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.get() diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift index 531c2bd5..8f0c77fa 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamTrackAudioSourceNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackAudioSourceNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackAudioSourceNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: AudioContext, options: MediaStreamTrackAudioSourceOptions) { + @inlinable public convenience init(context: AudioContext, options: MediaStreamTrackAudioSourceOptions) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) } } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift index a3354c87..2b8be939 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamTrackEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackEvent].function! } + @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) } - public convenience init(type: String, eventInitDict: MediaStreamTrackEventInit) { + @inlinable public convenience init(type: String, eventInitDict: MediaStreamTrackEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift index f371c691..98ca5772 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamTrackProcessor: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackProcessor].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackProcessor].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class MediaStreamTrackProcessor: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: MediaStreamTrackProcessorInit) { + @inlinable public convenience init(init: MediaStreamTrackProcessorInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift index 1661678a..26b43f70 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift @@ -7,16 +7,16 @@ public enum MediaStreamTrackState: JSString, JSValueCompatible { case live = "live" case ended = "ended" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Memory.swift b/Sources/DOMKit/WebIDL/Memory.swift index 5ef148df..688b6e50 100644 --- a/Sources/DOMKit/WebIDL/Memory.swift +++ b/Sources/DOMKit/WebIDL/Memory.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Memory: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Memory].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Memory].function! } public let jsObject: JSObject @@ -13,11 +13,11 @@ public class Memory: JSBridgedClass { self.jsObject = jsObject } - public convenience init(descriptor: MemoryDescriptor) { + @inlinable public convenience init(descriptor: MemoryDescriptor) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue()])) } - public func grow(delta: UInt32) -> UInt32 { + @inlinable public func grow(delta: UInt32) -> UInt32 { let this = jsObject return this[Strings.grow].function!(this: this, arguments: [delta.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MessageChannel.swift b/Sources/DOMKit/WebIDL/MessageChannel.swift index d22a3f7c..e8ddfec1 100644 --- a/Sources/DOMKit/WebIDL/MessageChannel.swift +++ b/Sources/DOMKit/WebIDL/MessageChannel.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MessageChannel: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MessageChannel].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MessageChannel].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class MessageChannel: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift index fb9e31fa..b9bd8dca 100644 --- a/Sources/DOMKit/WebIDL/MessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MessageEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.MessageEvent].function! } + @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) @@ -15,7 +15,7 @@ public class MessageEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: MessageEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: MessageEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -34,7 +34,7 @@ public class MessageEvent: Event { @ReadonlyAttribute public var ports: [MessagePort] - 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) { + @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 diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift index cb9b8f5c..6fa7e3df 100644 --- a/Sources/DOMKit/WebIDL/MessagePort.swift +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MessagePort: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.MessagePort].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MessagePort].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) @@ -12,22 +12,22 @@ public class MessagePort: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func postMessage(message: JSValue, transfer: [JSObject]) { + @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } - public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } - public func start() { + @inlinable public func start() { let this = jsObject _ = this[Strings.start].function!(this: this, arguments: []) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/MeteringMode.swift b/Sources/DOMKit/WebIDL/MeteringMode.swift index 030e5027..e33816a7 100644 --- a/Sources/DOMKit/WebIDL/MeteringMode.swift +++ b/Sources/DOMKit/WebIDL/MeteringMode.swift @@ -9,16 +9,16 @@ public enum MeteringMode: JSString, JSValueCompatible { case singleShot = "single-shot" case continuous = "continuous" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MimeType.swift b/Sources/DOMKit/WebIDL/MimeType.swift index 826f5c0a..33aa20e2 100644 --- a/Sources/DOMKit/WebIDL/MimeType.swift +++ b/Sources/DOMKit/WebIDL/MimeType.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MimeType: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MimeType].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MimeType].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/MimeTypeArray.swift b/Sources/DOMKit/WebIDL/MimeTypeArray.swift index edaa928d..8dc67b43 100644 --- a/Sources/DOMKit/WebIDL/MimeTypeArray.swift +++ b/Sources/DOMKit/WebIDL/MimeTypeArray.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MimeTypeArray: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MimeTypeArray].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MimeTypeArray].function! } public let jsObject: JSObject @@ -16,11 +16,11 @@ public class MimeTypeArray: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> MimeType? { + @inlinable public subscript(key: Int) -> MimeType? { jsObject[key].fromJSValue() } - public subscript(key: String) -> MimeType? { + @inlinable public subscript(key: String) -> MimeType? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift b/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift index e08d060c..f092f4d8 100644 --- a/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift +++ b/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift @@ -7,16 +7,16 @@ public enum MockCapturePromptResult: JSString, JSValueCompatible { case granted = "granted" case denied = "denied" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/MockSensorType.swift b/Sources/DOMKit/WebIDL/MockSensorType.swift index f20cdc71..1efb384e 100644 --- a/Sources/DOMKit/WebIDL/MockSensorType.swift +++ b/Sources/DOMKit/WebIDL/MockSensorType.swift @@ -16,16 +16,16 @@ public enum MockSensorType: JSString, JSValueCompatible { case geolocation = "geolocation" case proximity = "proximity" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Module.swift b/Sources/DOMKit/WebIDL/Module.swift index cd7303c4..23eb152b 100644 --- a/Sources/DOMKit/WebIDL/Module.swift +++ b/Sources/DOMKit/WebIDL/Module.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Module: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Module].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Module].function! } public let jsObject: JSObject @@ -12,21 +12,21 @@ public class Module: JSBridgedClass { self.jsObject = jsObject } - public convenience init(bytes: BufferSource) { + @inlinable public convenience init(bytes: BufferSource) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [bytes.jsValue()])) } - public static func exports(moduleObject: Module) -> [ModuleExportDescriptor] { + @inlinable public static func exports(moduleObject: Module) -> [ModuleExportDescriptor] { let this = constructor return this[Strings.exports].function!(this: this, arguments: [moduleObject.jsValue()]).fromJSValue()! } - public static func imports(moduleObject: Module) -> [ModuleImportDescriptor] { + @inlinable public static func imports(moduleObject: Module) -> [ModuleImportDescriptor] { let this = constructor return this[Strings.imports].function!(this: this, arguments: [moduleObject.jsValue()]).fromJSValue()! } - public static func customSections(moduleObject: Module, sectionName: String) -> [ArrayBuffer] { + @inlinable public static func customSections(moduleObject: Module, sectionName: String) -> [ArrayBuffer] { let this = constructor return this[Strings.customSections].function!(this: this, arguments: [moduleObject.jsValue(), sectionName.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index 5880c516..dfa69031 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MouseEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.MouseEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MouseEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _pageX = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageX) @@ -53,7 +53,7 @@ public class MouseEvent: UIEvent { @ReadonlyAttribute public var movementY: Double - public convenience init(type: String, eventInitDict: MouseEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: MouseEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -90,12 +90,12 @@ public class MouseEvent: UIEvent { @ReadonlyAttribute public var relatedTarget: EventTarget? - public func getModifierState(keyArg: String) -> Bool { + @inlinable public func getModifierState(keyArg: String) -> Bool { let this = jsObject return this[Strings.getModifierState].function!(this: this, arguments: [keyArg.jsValue()]).fromJSValue()! } - public func initMouseEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil, screenXArg: Int32? = nil, screenYArg: Int32? = nil, clientXArg: Int32? = nil, clientYArg: Int32? = nil, ctrlKeyArg: Bool? = nil, altKeyArg: Bool? = nil, shiftKeyArg: Bool? = nil, metaKeyArg: Bool? = nil, buttonArg: Int16? = nil, relatedTargetArg: EventTarget? = nil) { + @inlinable public func initMouseEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil, screenXArg: Int32? = nil, screenYArg: Int32? = nil, clientXArg: Int32? = nil, clientYArg: Int32? = nil, ctrlKeyArg: Bool? = nil, altKeyArg: Bool? = nil, shiftKeyArg: Bool? = nil, metaKeyArg: Bool? = nil, buttonArg: Int16? = nil, relatedTargetArg: EventTarget? = nil) { let _arg0 = typeArg.jsValue() let _arg1 = bubblesArg?.jsValue() ?? .undefined let _arg2 = cancelableArg?.jsValue() ?? .undefined diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift index 31c2fcf9..cfa657c0 100644 --- a/Sources/DOMKit/WebIDL/MutationEvent.swift +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MutationEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.MutationEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MutationEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _relatedNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedNode) @@ -36,7 +36,7 @@ public class MutationEvent: Event { @ReadonlyAttribute public var attrChange: UInt16 - public func initMutationEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, relatedNodeArg: Node? = nil, prevValueArg: String? = nil, newValueArg: String? = nil, attrNameArg: String? = nil, attrChangeArg: UInt16? = nil) { + @inlinable public func initMutationEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, relatedNodeArg: Node? = nil, prevValueArg: String? = nil, newValueArg: String? = nil, attrNameArg: String? = nil, attrChangeArg: UInt16? = nil) { let _arg0 = typeArg.jsValue() let _arg1 = bubblesArg?.jsValue() ?? .undefined let _arg2 = cancelableArg?.jsValue() ?? .undefined diff --git a/Sources/DOMKit/WebIDL/MutationObserver.swift b/Sources/DOMKit/WebIDL/MutationObserver.swift index aeaab047..c5d68b98 100644 --- a/Sources/DOMKit/WebIDL/MutationObserver.swift +++ b/Sources/DOMKit/WebIDL/MutationObserver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MutationObserver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MutationObserver].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MutationObserver].function! } public let jsObject: JSObject @@ -14,17 +14,17 @@ public class MutationObserver: JSBridgedClass { // XXX: constructor is ignored - public func observe(target: Node, options: MutationObserverInit? = nil) { + @inlinable public func observe(target: Node, options: MutationObserverInit? = nil) { let this = jsObject _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue(), options?.jsValue() ?? .undefined]) } - public func disconnect() { + @inlinable public func disconnect() { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: []) } - public func takeRecords() -> [MutationRecord] { + @inlinable public func takeRecords() -> [MutationRecord] { let this = jsObject return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MutationRecord.swift b/Sources/DOMKit/WebIDL/MutationRecord.swift index 9f783a39..2b7a6fa1 100644 --- a/Sources/DOMKit/WebIDL/MutationRecord.swift +++ b/Sources/DOMKit/WebIDL/MutationRecord.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MutationRecord: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.MutationRecord].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MutationRecord].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/NDEFMessage.swift b/Sources/DOMKit/WebIDL/NDEFMessage.swift index eba2d85b..4229c101 100644 --- a/Sources/DOMKit/WebIDL/NDEFMessage.swift +++ b/Sources/DOMKit/WebIDL/NDEFMessage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NDEFMessage: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.NDEFMessage].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NDEFMessage].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class NDEFMessage: JSBridgedClass { self.jsObject = jsObject } - public convenience init(messageInit: NDEFMessageInit) { + @inlinable public convenience init(messageInit: NDEFMessageInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [messageInit.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/NDEFReader.swift b/Sources/DOMKit/WebIDL/NDEFReader.swift index bbb51474..bc4b66db 100644 --- a/Sources/DOMKit/WebIDL/NDEFReader.swift +++ b/Sources/DOMKit/WebIDL/NDEFReader.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NDEFReader: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.NDEFReader].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NDEFReader].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onreading = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreading) @@ -12,7 +12,7 @@ public class NDEFReader: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -22,37 +22,37 @@ public class NDEFReader: EventTarget { @ClosureAttribute1Optional public var onreadingerror: EventHandler - public func scan(options: NDEFScanOptions? = nil) -> JSPromise { + @inlinable public func scan(options: NDEFScanOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.scan].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func scan(options: NDEFScanOptions? = nil) async throws { + @inlinable public func scan(options: NDEFScanOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.scan].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) -> JSPromise { + @inlinable public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.write].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) async throws { + @inlinable public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) -> JSPromise { + @inlinable public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) async throws { + @inlinable public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift b/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift index b9a06fe7..a3f45b79 100644 --- a/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift +++ b/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NDEFReadingEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.NDEFReadingEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NDEFReadingEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _serialNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.serialNumber) @@ -12,7 +12,7 @@ public class NDEFReadingEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, readingEventInitDict: NDEFReadingEventInit) { + @inlinable public convenience init(type: String, readingEventInitDict: NDEFReadingEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), readingEventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/NDEFRecord.swift b/Sources/DOMKit/WebIDL/NDEFRecord.swift index 5a1d8df4..e18ca0f0 100644 --- a/Sources/DOMKit/WebIDL/NDEFRecord.swift +++ b/Sources/DOMKit/WebIDL/NDEFRecord.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NDEFRecord: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.NDEFRecord].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NDEFRecord].function! } public let jsObject: JSObject @@ -18,7 +18,7 @@ public class NDEFRecord: JSBridgedClass { self.jsObject = jsObject } - public convenience init(recordInit: NDEFRecordInit) { + @inlinable public convenience init(recordInit: NDEFRecordInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [recordInit.jsValue()])) } @@ -40,7 +40,7 @@ public class NDEFRecord: JSBridgedClass { @ReadonlyAttribute public var lang: String? - public func toRecords() -> [NDEFRecord]? { + @inlinable public func toRecords() -> [NDEFRecord]? { let this = jsObject return this[Strings.toRecords].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/NamedFlow.swift b/Sources/DOMKit/WebIDL/NamedFlow.swift index 4fc5e671..fd9f3b7e 100644 --- a/Sources/DOMKit/WebIDL/NamedFlow.swift +++ b/Sources/DOMKit/WebIDL/NamedFlow.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NamedFlow: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.NamedFlow].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NamedFlow].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) @@ -19,7 +19,7 @@ public class NamedFlow: EventTarget { @ReadonlyAttribute public var overset: Bool - public func getRegions() -> [Element] { + @inlinable public func getRegions() -> [Element] { let this = jsObject return this[Strings.getRegions].function!(this: this, arguments: []).fromJSValue()! } @@ -27,12 +27,12 @@ public class NamedFlow: EventTarget { @ReadonlyAttribute public var firstEmptyRegionIndex: Int16 - public func getContent() -> [Node] { + @inlinable public func getContent() -> [Node] { let this = jsObject return this[Strings.getContent].function!(this: this, arguments: []).fromJSValue()! } - public func getRegionsByContent(node: Node) -> [Element] { + @inlinable public func getRegionsByContent(node: Node) -> [Element] { let this = jsObject return this[Strings.getRegionsByContent].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/NamedFlowMap.swift b/Sources/DOMKit/WebIDL/NamedFlowMap.swift index fd5f3750..0009ffd9 100644 --- a/Sources/DOMKit/WebIDL/NamedFlowMap.swift +++ b/Sources/DOMKit/WebIDL/NamedFlowMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NamedFlowMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.NamedFlowMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NamedFlowMap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/NamedNodeMap.swift b/Sources/DOMKit/WebIDL/NamedNodeMap.swift index 369cc9f7..15eaab84 100644 --- a/Sources/DOMKit/WebIDL/NamedNodeMap.swift +++ b/Sources/DOMKit/WebIDL/NamedNodeMap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NamedNodeMap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.NamedNodeMap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NamedNodeMap].function! } public let jsObject: JSObject @@ -16,35 +16,35 @@ public class NamedNodeMap: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Attr? { + @inlinable public subscript(key: Int) -> Attr? { jsObject[key].fromJSValue() } - public subscript(key: String) -> Attr? { + @inlinable public subscript(key: String) -> Attr? { jsObject[key].fromJSValue() } - public func getNamedItemNS(namespace: String?, localName: String) -> Attr? { + @inlinable public func getNamedItemNS(namespace: String?, localName: String) -> Attr? { let this = jsObject return this[Strings.getNamedItemNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } - public func setNamedItem(attr: Attr) -> Attr? { + @inlinable public func setNamedItem(attr: Attr) -> Attr? { let this = jsObject return this[Strings.setNamedItem].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } - public func setNamedItemNS(attr: Attr) -> Attr? { + @inlinable public func setNamedItemNS(attr: Attr) -> Attr? { let this = jsObject return this[Strings.setNamedItemNS].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! } - public func removeNamedItem(qualifiedName: String) -> Attr { + @inlinable public func removeNamedItem(qualifiedName: String) -> Attr { let this = jsObject return this[Strings.removeNamedItem].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! } - public func removeNamedItemNS(namespace: String?, localName: String) -> Attr { + @inlinable public func removeNamedItemNS(namespace: String?, localName: String) -> Attr { let this = jsObject return this[Strings.removeNamedItemNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/NavigateEvent.swift b/Sources/DOMKit/WebIDL/NavigateEvent.swift index 21ae0cd8..511a72d5 100644 --- a/Sources/DOMKit/WebIDL/NavigateEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigateEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NavigateEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.NavigateEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NavigateEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _navigationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationType) @@ -18,7 +18,7 @@ public class NavigateEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInit: NavigateEventInit) { + @inlinable public convenience init(type: String, eventInit: NavigateEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInit.jsValue()])) } @@ -46,7 +46,7 @@ public class NavigateEvent: Event { @ReadonlyAttribute public var info: JSValue - public func transitionWhile(newNavigationAction: JSPromise) { + @inlinable public func transitionWhile(newNavigationAction: JSPromise) { let this = jsObject _ = this[Strings.transitionWhile].function!(this: this, arguments: [newNavigationAction.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/Navigation.swift b/Sources/DOMKit/WebIDL/Navigation.swift index 7668e2e9..fadaf5d4 100644 --- a/Sources/DOMKit/WebIDL/Navigation.swift +++ b/Sources/DOMKit/WebIDL/Navigation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Navigation: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Navigation].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Navigation].function! } public required init(unsafelyWrapping jsObject: JSObject) { _currentEntry = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentEntry) @@ -18,7 +18,7 @@ public class Navigation: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func entries() -> [NavigationHistoryEntry] { + @inlinable public func entries() -> [NavigationHistoryEntry] { let this = jsObject return this[Strings.entries].function!(this: this, arguments: []).fromJSValue()! } @@ -26,7 +26,7 @@ public class Navigation: EventTarget { @ReadonlyAttribute public var currentEntry: NavigationHistoryEntry? - public func updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions) { + @inlinable public func updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions) { let this = jsObject _ = this[Strings.updateCurrentEntry].function!(this: this, arguments: [options.jsValue()]) } @@ -40,27 +40,27 @@ public class Navigation: EventTarget { @ReadonlyAttribute public var canGoForward: Bool - public func navigate(url: String, options: NavigationNavigateOptions? = nil) -> NavigationResult { + @inlinable public func navigate(url: String, options: NavigationNavigateOptions? = nil) -> NavigationResult { let this = jsObject return this[Strings.navigate].function!(this: this, arguments: [url.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func reload(options: NavigationReloadOptions? = nil) -> NavigationResult { + @inlinable public func reload(options: NavigationReloadOptions? = nil) -> NavigationResult { let this = jsObject return this[Strings.reload].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func traverseTo(key: String, options: NavigationOptions? = nil) -> NavigationResult { + @inlinable public func traverseTo(key: String, options: NavigationOptions? = nil) -> NavigationResult { let this = jsObject return this[Strings.traverseTo].function!(this: this, arguments: [key.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func back(options: NavigationOptions? = nil) -> NavigationResult { + @inlinable public func back(options: NavigationOptions? = nil) -> NavigationResult { let this = jsObject return this[Strings.back].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func forward(options: NavigationOptions? = nil) -> NavigationResult { + @inlinable public func forward(options: NavigationOptions? = nil) -> NavigationResult { let this = jsObject return this[Strings.forward].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift index 14cd1c73..bcf0404b 100644 --- a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NavigationCurrentEntryChangeEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.NavigationCurrentEntryChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NavigationCurrentEntryChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _navigationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationType) @@ -12,7 +12,7 @@ public class NavigationCurrentEntryChangeEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInit: NavigationCurrentEntryChangeEventInit) { + @inlinable public convenience init(type: String, eventInit: NavigationCurrentEntryChangeEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInit.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/NavigationDestination.swift b/Sources/DOMKit/WebIDL/NavigationDestination.swift index b3eeac41..3d459290 100644 --- a/Sources/DOMKit/WebIDL/NavigationDestination.swift +++ b/Sources/DOMKit/WebIDL/NavigationDestination.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NavigationDestination: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.NavigationDestination].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NavigationDestination].function! } public let jsObject: JSObject @@ -32,7 +32,7 @@ public class NavigationDestination: JSBridgedClass { @ReadonlyAttribute public var sameDocument: Bool - public func getState() -> JSValue { + @inlinable public func getState() -> JSValue { let this = jsObject return this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/NavigationEvent.swift b/Sources/DOMKit/WebIDL/NavigationEvent.swift index 551f5958..cd659d83 100644 --- a/Sources/DOMKit/WebIDL/NavigationEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigationEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NavigationEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.NavigationEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NavigationEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _dir = ReadonlyAttribute(jsObject: jsObject, name: Strings.dir) @@ -12,7 +12,7 @@ public class NavigationEvent: UIEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: NavigationEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: NavigationEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift b/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift index bb6532ca..c20cac6c 100644 --- a/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift +++ b/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NavigationHistoryEntry: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.NavigationHistoryEntry].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NavigationHistoryEntry].function! } public required init(unsafelyWrapping jsObject: JSObject) { _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) @@ -34,7 +34,7 @@ public class NavigationHistoryEntry: EventTarget { @ReadonlyAttribute public var sameDocument: Bool - public func getState() -> JSValue { + @inlinable public func getState() -> JSValue { let this = jsObject return this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/NavigationNavigationType.swift b/Sources/DOMKit/WebIDL/NavigationNavigationType.swift index 446bacb9..0a70b115 100644 --- a/Sources/DOMKit/WebIDL/NavigationNavigationType.swift +++ b/Sources/DOMKit/WebIDL/NavigationNavigationType.swift @@ -9,16 +9,16 @@ public enum NavigationNavigationType: JSString, JSValueCompatible { case replace = "replace" case traverse = "traverse" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift b/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift index 717d4642..1b005c8b 100644 --- a/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift +++ b/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NavigationPreloadManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.NavigationPreloadManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NavigationPreloadManager].function! } public let jsObject: JSObject @@ -12,49 +12,49 @@ public class NavigationPreloadManager: JSBridgedClass { self.jsObject = jsObject } - public func enable() -> JSPromise { + @inlinable public func enable() -> JSPromise { let this = jsObject return this[Strings.enable].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func enable() async throws { + @inlinable public func enable() async throws { let this = jsObject let _promise: JSPromise = this[Strings.enable].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func disable() -> JSPromise { + @inlinable public func disable() -> JSPromise { let this = jsObject return this[Strings.disable].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func disable() async throws { + @inlinable public func disable() async throws { let this = jsObject let _promise: JSPromise = this[Strings.disable].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func setHeaderValue(value: String) -> JSPromise { + @inlinable public func setHeaderValue(value: String) -> JSPromise { let this = jsObject return this[Strings.setHeaderValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setHeaderValue(value: String) async throws { + @inlinable public func setHeaderValue(value: String) async throws { let this = jsObject let _promise: JSPromise = this[Strings.setHeaderValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func getState() -> JSPromise { + @inlinable public func getState() -> JSPromise { let this = jsObject return this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getState() async throws -> NavigationPreloadState { + @inlinable public func getState() async throws -> NavigationPreloadState { let this = jsObject let _promise: JSPromise = this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/NavigationTimingType.swift b/Sources/DOMKit/WebIDL/NavigationTimingType.swift index 8b58377f..8a42cbaa 100644 --- a/Sources/DOMKit/WebIDL/NavigationTimingType.swift +++ b/Sources/DOMKit/WebIDL/NavigationTimingType.swift @@ -9,16 +9,16 @@ public enum NavigationTimingType: JSString, JSValueCompatible { case backForward = "back_forward" case prerender = "prerender" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/NavigationTransition.swift b/Sources/DOMKit/WebIDL/NavigationTransition.swift index 3e46c701..6202904e 100644 --- a/Sources/DOMKit/WebIDL/NavigationTransition.swift +++ b/Sources/DOMKit/WebIDL/NavigationTransition.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NavigationTransition: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.NavigationTransition].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NavigationTransition].function! } public let jsObject: JSObject @@ -24,7 +24,7 @@ public class NavigationTransition: JSBridgedClass { @ReadonlyAttribute public var finished: JSPromise - public func rollback(options: NavigationOptions? = nil) -> NavigationResult { + @inlinable public func rollback(options: NavigationOptions? = nil) -> NavigationResult { let this = jsObject return this[Strings.rollback].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index c0bc04fd..91fca99e 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware, NavigatorFonts, NavigatorNetworkInformation, NavigatorStorage, NavigatorUA, NavigatorLocks, NavigatorAutomationInformation, NavigatorGPU, NavigatorML { - public class var constructor: JSFunction { JSObject.global[Strings.Navigator].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Navigator].function! } public let jsObject: JSObject @@ -35,58 +35,58 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N self.jsObject = jsObject } - public func getAutoplayPolicy(type: AutoplayPolicyMediaType) -> AutoplayPolicy { + @inlinable public func getAutoplayPolicy(type: AutoplayPolicyMediaType) -> AutoplayPolicy { let this = jsObject return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } - public func getAutoplayPolicy(element: HTMLMediaElement) -> AutoplayPolicy { + @inlinable public func getAutoplayPolicy(element: HTMLMediaElement) -> AutoplayPolicy { let this = jsObject return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! } - public func getAutoplayPolicy(context: AudioContext) -> AutoplayPolicy { + @inlinable public func getAutoplayPolicy(context: AudioContext) -> AutoplayPolicy { let this = jsObject return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [context.jsValue()]).fromJSValue()! } - public func setClientBadge(contents: UInt64? = nil) -> JSPromise { + @inlinable public func setClientBadge(contents: UInt64? = nil) -> JSPromise { let this = jsObject return this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setClientBadge(contents: UInt64? = nil) async throws { + @inlinable public func setClientBadge(contents: UInt64? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func clearClientBadge() -> JSPromise { + @inlinable public func clearClientBadge() -> JSPromise { let this = jsObject return this[Strings.clearClientBadge].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func clearClientBadge() async throws { + @inlinable public func clearClientBadge() async throws { let this = jsObject let _promise: JSPromise = this[Strings.clearClientBadge].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func getBattery() -> JSPromise { + @inlinable public func getBattery() -> JSPromise { let this = jsObject return this[Strings.getBattery].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getBattery() async throws -> BatteryManager { + @inlinable public func getBattery() async throws -> BatteryManager { let this = jsObject let _promise: JSPromise = this[Strings.getBattery].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { + @inlinable public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { let this = jsObject return this[Strings.sendBeacon].function!(this: this, arguments: [url.jsValue(), data?.jsValue() ?? .undefined]).fromJSValue()! } @@ -103,19 +103,19 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @ReadonlyAttribute public var devicePosture: DevicePosture - public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { + @inlinable public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { let this = jsObject return this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue(), supportedConfigurations.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { + @inlinable public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { let this = jsObject let _promise: JSPromise = this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue(), supportedConfigurations.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getGamepads() -> [Gamepad?] { + @inlinable public func getGamepads() -> [Gamepad?] { let this = jsObject return this[Strings.getGamepads].function!(this: this, arguments: []).fromJSValue()! } @@ -123,13 +123,13 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @ReadonlyAttribute public var geolocation: Geolocation - public func getInstalledRelatedApps() -> JSPromise { + @inlinable public func getInstalledRelatedApps() -> JSPromise { let this = jsObject return this[Strings.getInstalledRelatedApps].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getInstalledRelatedApps() async throws -> [RelatedApplication] { + @inlinable public func getInstalledRelatedApps() async throws -> [RelatedApplication] { let this = jsObject let _promise: JSPromise = this[Strings.getInstalledRelatedApps].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -173,7 +173,7 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @ReadonlyAttribute public var serviceWorker: ServiceWorkerContainer - public func vibrate(pattern: VibratePattern) -> Bool { + @inlinable public func vibrate(pattern: VibratePattern) -> Bool { let this = jsObject return this[Strings.vibrate].function!(this: this, arguments: [pattern.jsValue()]).fromJSValue()! } @@ -184,19 +184,19 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @ReadonlyAttribute public var bluetooth: Bluetooth - public func share(data: ShareData? = nil) -> JSPromise { + @inlinable public func share(data: ShareData? = nil) -> JSPromise { let this = jsObject return this[Strings.share].function!(this: this, arguments: [data?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func share(data: ShareData? = nil) async throws { + @inlinable public func share(data: ShareData? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.share].function!(this: this, arguments: [data?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func canShare(data: ShareData? = nil) -> Bool { + @inlinable public func canShare(data: ShareData? = nil) -> Bool { let this = jsObject return this[Strings.canShare].function!(this: this, arguments: [data?.jsValue() ?? .undefined]).fromJSValue()! } @@ -204,13 +204,13 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @ReadonlyAttribute public var hid: HID - public func requestMIDIAccess(options: MIDIOptions? = nil) -> JSPromise { + @inlinable public func requestMIDIAccess(options: MIDIOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestMIDIAccess(options: MIDIOptions? = nil) async throws -> MIDIAccess { + @inlinable public func requestMIDIAccess(options: MIDIOptions? = nil) async throws -> MIDIAccess { let this = jsObject let _promise: JSPromise = this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift b/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift index 8b94eeed..02b0d52f 100644 --- a/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift +++ b/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorAutomationInformation: JSBridgedClass {} public extension NavigatorAutomationInformation { - var webdriver: Bool { ReadonlyAttribute[Strings.webdriver, in: jsObject] } + @inlinable var webdriver: Bool { ReadonlyAttribute[Strings.webdriver, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorBadge.swift b/Sources/DOMKit/WebIDL/NavigatorBadge.swift index 2596064d..b91d25ff 100644 --- a/Sources/DOMKit/WebIDL/NavigatorBadge.swift +++ b/Sources/DOMKit/WebIDL/NavigatorBadge.swift @@ -5,25 +5,25 @@ import JavaScriptKit public protocol NavigatorBadge: JSBridgedClass {} public extension NavigatorBadge { - func setAppBadge(contents: UInt64? = nil) -> JSPromise { + @inlinable func setAppBadge(contents: UInt64? = nil) -> JSPromise { let this = jsObject return this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func setAppBadge(contents: UInt64? = nil) async throws { + @inlinable func setAppBadge(contents: UInt64? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - func clearAppBadge() -> JSPromise { + @inlinable func clearAppBadge() -> JSPromise { let this = jsObject return this[Strings.clearAppBadge].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func clearAppBadge() async throws { + @inlinable func clearAppBadge() async throws { let this = jsObject let _promise: JSPromise = this[Strings.clearAppBadge].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift b/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift index 07edf796..17b759f4 100644 --- a/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift +++ b/Sources/DOMKit/WebIDL/NavigatorConcurrentHardware.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorConcurrentHardware: JSBridgedClass {} public extension NavigatorConcurrentHardware { - var hardwareConcurrency: UInt64 { ReadonlyAttribute[Strings.hardwareConcurrency, in: jsObject] } + @inlinable var hardwareConcurrency: UInt64 { ReadonlyAttribute[Strings.hardwareConcurrency, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift index f6d01b9d..a18aaf94 100644 --- a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift +++ b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift @@ -5,12 +5,12 @@ import JavaScriptKit public protocol NavigatorContentUtils: JSBridgedClass {} public extension NavigatorContentUtils { - func registerProtocolHandler(scheme: String, url: String) { + @inlinable func registerProtocolHandler(scheme: String, url: String) { let this = jsObject _ = this[Strings.registerProtocolHandler].function!(this: this, arguments: [scheme.jsValue(), url.jsValue()]) } - func unregisterProtocolHandler(scheme: String, url: String) { + @inlinable func unregisterProtocolHandler(scheme: String, url: String) { let this = jsObject _ = this[Strings.unregisterProtocolHandler].function!(this: this, arguments: [scheme.jsValue(), url.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/NavigatorCookies.swift b/Sources/DOMKit/WebIDL/NavigatorCookies.swift index 7eec4e0b..7a35664b 100644 --- a/Sources/DOMKit/WebIDL/NavigatorCookies.swift +++ b/Sources/DOMKit/WebIDL/NavigatorCookies.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorCookies: JSBridgedClass {} public extension NavigatorCookies { - var cookieEnabled: Bool { ReadonlyAttribute[Strings.cookieEnabled, in: jsObject] } + @inlinable var cookieEnabled: Bool { ReadonlyAttribute[Strings.cookieEnabled, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift b/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift index c1cbc40f..c3184b80 100644 --- a/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift +++ b/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorDeviceMemory: JSBridgedClass {} public extension NavigatorDeviceMemory { - var deviceMemory: Double { ReadonlyAttribute[Strings.deviceMemory, in: jsObject] } + @inlinable var deviceMemory: Double { ReadonlyAttribute[Strings.deviceMemory, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorFonts.swift b/Sources/DOMKit/WebIDL/NavigatorFonts.swift index d79f83fb..471fc03b 100644 --- a/Sources/DOMKit/WebIDL/NavigatorFonts.swift +++ b/Sources/DOMKit/WebIDL/NavigatorFonts.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorFonts: JSBridgedClass {} public extension NavigatorFonts { - var fonts: FontManager { ReadonlyAttribute[Strings.fonts, in: jsObject] } + @inlinable var fonts: FontManager { ReadonlyAttribute[Strings.fonts, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorGPU.swift b/Sources/DOMKit/WebIDL/NavigatorGPU.swift index 8ed2e465..287f8f5a 100644 --- a/Sources/DOMKit/WebIDL/NavigatorGPU.swift +++ b/Sources/DOMKit/WebIDL/NavigatorGPU.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorGPU: JSBridgedClass {} public extension NavigatorGPU { - var gpu: GPU { ReadonlyAttribute[Strings.gpu, in: jsObject] } + @inlinable var gpu: GPU { ReadonlyAttribute[Strings.gpu, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorID.swift b/Sources/DOMKit/WebIDL/NavigatorID.swift index 3f128934..e925577d 100644 --- a/Sources/DOMKit/WebIDL/NavigatorID.swift +++ b/Sources/DOMKit/WebIDL/NavigatorID.swift @@ -5,28 +5,28 @@ import JavaScriptKit public protocol NavigatorID: JSBridgedClass {} public extension NavigatorID { - var appCodeName: String { ReadonlyAttribute[Strings.appCodeName, in: jsObject] } + @inlinable var appCodeName: String { ReadonlyAttribute[Strings.appCodeName, in: jsObject] } - var appName: String { ReadonlyAttribute[Strings.appName, in: jsObject] } + @inlinable var appName: String { ReadonlyAttribute[Strings.appName, in: jsObject] } - var appVersion: String { ReadonlyAttribute[Strings.appVersion, in: jsObject] } + @inlinable var appVersion: String { ReadonlyAttribute[Strings.appVersion, in: jsObject] } - var platform: String { ReadonlyAttribute[Strings.platform, in: jsObject] } + @inlinable var platform: String { ReadonlyAttribute[Strings.platform, in: jsObject] } - var product: String { ReadonlyAttribute[Strings.product, in: jsObject] } + @inlinable var product: String { ReadonlyAttribute[Strings.product, in: jsObject] } - var productSub: String { ReadonlyAttribute[Strings.productSub, in: jsObject] } + @inlinable var productSub: String { ReadonlyAttribute[Strings.productSub, in: jsObject] } - var userAgent: String { ReadonlyAttribute[Strings.userAgent, in: jsObject] } + @inlinable var userAgent: String { ReadonlyAttribute[Strings.userAgent, in: jsObject] } - var vendor: String { ReadonlyAttribute[Strings.vendor, in: jsObject] } + @inlinable var vendor: String { ReadonlyAttribute[Strings.vendor, in: jsObject] } - var vendorSub: String { ReadonlyAttribute[Strings.vendorSub, in: jsObject] } + @inlinable var vendorSub: String { ReadonlyAttribute[Strings.vendorSub, in: jsObject] } - func taintEnabled() -> Bool { + @inlinable func taintEnabled() -> Bool { let this = jsObject return this[Strings.taintEnabled].function!(this: this, arguments: []).fromJSValue()! } - var oscpu: String { ReadonlyAttribute[Strings.oscpu, in: jsObject] } + @inlinable var oscpu: String { ReadonlyAttribute[Strings.oscpu, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorLanguage.swift b/Sources/DOMKit/WebIDL/NavigatorLanguage.swift index 11780c8c..a692466a 100644 --- a/Sources/DOMKit/WebIDL/NavigatorLanguage.swift +++ b/Sources/DOMKit/WebIDL/NavigatorLanguage.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol NavigatorLanguage: JSBridgedClass {} public extension NavigatorLanguage { - var language: String { ReadonlyAttribute[Strings.language, in: jsObject] } + @inlinable var language: String { ReadonlyAttribute[Strings.language, in: jsObject] } - var languages: [String] { ReadonlyAttribute[Strings.languages, in: jsObject] } + @inlinable var languages: [String] { ReadonlyAttribute[Strings.languages, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorLocks.swift b/Sources/DOMKit/WebIDL/NavigatorLocks.swift index 6aa3845c..c5f33ae4 100644 --- a/Sources/DOMKit/WebIDL/NavigatorLocks.swift +++ b/Sources/DOMKit/WebIDL/NavigatorLocks.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorLocks: JSBridgedClass {} public extension NavigatorLocks { - var locks: LockManager { ReadonlyAttribute[Strings.locks, in: jsObject] } + @inlinable var locks: LockManager { ReadonlyAttribute[Strings.locks, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorML.swift b/Sources/DOMKit/WebIDL/NavigatorML.swift index aa97f8d9..51bfc736 100644 --- a/Sources/DOMKit/WebIDL/NavigatorML.swift +++ b/Sources/DOMKit/WebIDL/NavigatorML.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorML: JSBridgedClass {} public extension NavigatorML { - var ml: ML { ReadonlyAttribute[Strings.ml, in: jsObject] } + @inlinable var ml: ML { ReadonlyAttribute[Strings.ml, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift b/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift index 5f94bc72..95115716 100644 --- a/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift +++ b/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorNetworkInformation: JSBridgedClass {} public extension NavigatorNetworkInformation { - var connection: NetworkInformation { ReadonlyAttribute[Strings.connection, in: jsObject] } + @inlinable var connection: NetworkInformation { ReadonlyAttribute[Strings.connection, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorOnLine.swift b/Sources/DOMKit/WebIDL/NavigatorOnLine.swift index aad1a3e9..56f5b291 100644 --- a/Sources/DOMKit/WebIDL/NavigatorOnLine.swift +++ b/Sources/DOMKit/WebIDL/NavigatorOnLine.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorOnLine: JSBridgedClass {} public extension NavigatorOnLine { - var onLine: Bool { ReadonlyAttribute[Strings.onLine, in: jsObject] } + @inlinable var onLine: Bool { ReadonlyAttribute[Strings.onLine, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift index 691b9838..69a000c0 100644 --- a/Sources/DOMKit/WebIDL/NavigatorPlugins.swift +++ b/Sources/DOMKit/WebIDL/NavigatorPlugins.swift @@ -5,14 +5,14 @@ import JavaScriptKit public protocol NavigatorPlugins: JSBridgedClass {} public extension NavigatorPlugins { - var plugins: PluginArray { ReadonlyAttribute[Strings.plugins, in: jsObject] } + @inlinable var plugins: PluginArray { ReadonlyAttribute[Strings.plugins, in: jsObject] } - var mimeTypes: MimeTypeArray { ReadonlyAttribute[Strings.mimeTypes, in: jsObject] } + @inlinable var mimeTypes: MimeTypeArray { ReadonlyAttribute[Strings.mimeTypes, in: jsObject] } - func javaEnabled() -> Bool { + @inlinable func javaEnabled() -> Bool { let this = jsObject return this[Strings.javaEnabled].function!(this: this, arguments: []).fromJSValue()! } - var pdfViewerEnabled: Bool { ReadonlyAttribute[Strings.pdfViewerEnabled, in: jsObject] } + @inlinable var pdfViewerEnabled: Bool { ReadonlyAttribute[Strings.pdfViewerEnabled, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorStorage.swift b/Sources/DOMKit/WebIDL/NavigatorStorage.swift index 7861b9cd..cdee04ef 100644 --- a/Sources/DOMKit/WebIDL/NavigatorStorage.swift +++ b/Sources/DOMKit/WebIDL/NavigatorStorage.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorStorage: JSBridgedClass {} public extension NavigatorStorage { - var storage: StorageManager { ReadonlyAttribute[Strings.storage, in: jsObject] } + @inlinable var storage: StorageManager { ReadonlyAttribute[Strings.storage, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorUA.swift b/Sources/DOMKit/WebIDL/NavigatorUA.swift index d4e53f1c..d28ce9e6 100644 --- a/Sources/DOMKit/WebIDL/NavigatorUA.swift +++ b/Sources/DOMKit/WebIDL/NavigatorUA.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NavigatorUA: JSBridgedClass {} public extension NavigatorUA { - var userAgentData: NavigatorUAData { ReadonlyAttribute[Strings.userAgentData, in: jsObject] } + @inlinable var userAgentData: NavigatorUAData { ReadonlyAttribute[Strings.userAgentData, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NavigatorUAData.swift b/Sources/DOMKit/WebIDL/NavigatorUAData.swift index 363c2e9e..9bf47c58 100644 --- a/Sources/DOMKit/WebIDL/NavigatorUAData.swift +++ b/Sources/DOMKit/WebIDL/NavigatorUAData.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NavigatorUAData: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.NavigatorUAData].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NavigatorUAData].function! } public let jsObject: JSObject @@ -24,19 +24,19 @@ public class NavigatorUAData: JSBridgedClass { @ReadonlyAttribute public var platform: String - public func getHighEntropyValues(hints: [String]) -> JSPromise { + @inlinable public func getHighEntropyValues(hints: [String]) -> JSPromise { let this = jsObject return this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getHighEntropyValues(hints: [String]) async throws -> UADataValues { + @inlinable public func getHighEntropyValues(hints: [String]) async throws -> UADataValues { let this = jsObject let _promise: JSPromise = this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func toJSON() -> UALowEntropyJSON { + @inlinable public func toJSON() -> UALowEntropyJSON { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/NetworkInformation.swift b/Sources/DOMKit/WebIDL/NetworkInformation.swift index 7e961e21..7f91c27d 100644 --- a/Sources/DOMKit/WebIDL/NetworkInformation.swift +++ b/Sources/DOMKit/WebIDL/NetworkInformation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NetworkInformation: EventTarget, NetworkInformationSaveData { - override public class var constructor: JSFunction { JSObject.global[Strings.NetworkInformation].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NetworkInformation].function! } public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) diff --git a/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift b/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift index b87cbdc1..aa503b98 100644 --- a/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift +++ b/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol NetworkInformationSaveData: JSBridgedClass {} public extension NetworkInformationSaveData { - var saveData: Bool { ReadonlyAttribute[Strings.saveData, in: jsObject] } + @inlinable var saveData: Bool { ReadonlyAttribute[Strings.saveData, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Node.swift b/Sources/DOMKit/WebIDL/Node.swift index 698c80cc..c9a22939 100644 --- a/Sources/DOMKit/WebIDL/Node.swift +++ b/Sources/DOMKit/WebIDL/Node.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Node: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Node].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Node].function! } public required init(unsafelyWrapping jsObject: JSObject) { _nodeType = ReadonlyAttribute(jsObject: jsObject, name: Strings.nodeType) @@ -63,7 +63,7 @@ public class Node: EventTarget { @ReadonlyAttribute public var ownerDocument: Document? - public func getRootNode(options: GetRootNodeOptions? = nil) -> Self { + @inlinable public func getRootNode(options: GetRootNodeOptions? = nil) -> Self { let this = jsObject return this[Strings.getRootNode].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @@ -74,7 +74,7 @@ public class Node: EventTarget { @ReadonlyAttribute public var parentElement: Element? - public func hasChildNodes() -> Bool { + @inlinable public func hasChildNodes() -> Bool { let this = jsObject return this[Strings.hasChildNodes].function!(this: this, arguments: []).fromJSValue()! } @@ -100,22 +100,22 @@ public class Node: EventTarget { @ReadWriteAttribute public var textContent: String? - public func normalize() { + @inlinable public func normalize() { let this = jsObject _ = this[Strings.normalize].function!(this: this, arguments: []) } - public func cloneNode(deep: Bool? = nil) -> Self { + @inlinable public func cloneNode(deep: Bool? = nil) -> Self { let this = jsObject return this[Strings.cloneNode].function!(this: this, arguments: [deep?.jsValue() ?? .undefined]).fromJSValue()! } - public func isEqualNode(otherNode: Node?) -> Bool { + @inlinable public func isEqualNode(otherNode: Node?) -> Bool { let this = jsObject return this[Strings.isEqualNode].function!(this: this, arguments: [otherNode.jsValue()]).fromJSValue()! } - public func isSameNode(otherNode: Node?) -> Bool { + @inlinable public func isSameNode(otherNode: Node?) -> Bool { let this = jsObject return this[Strings.isSameNode].function!(this: this, arguments: [otherNode.jsValue()]).fromJSValue()! } @@ -132,47 +132,47 @@ public class Node: EventTarget { public static let DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: UInt16 = 0x20 - public func compareDocumentPosition(other: Node) -> UInt16 { + @inlinable public func compareDocumentPosition(other: Node) -> UInt16 { let this = jsObject return this[Strings.compareDocumentPosition].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! } - public func contains(other: Node?) -> Bool { + @inlinable public func contains(other: Node?) -> Bool { let this = jsObject return this[Strings.contains].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! } - public func lookupPrefix(namespace: String?) -> String? { + @inlinable public func lookupPrefix(namespace: String?) -> String? { let this = jsObject return this[Strings.lookupPrefix].function!(this: this, arguments: [namespace.jsValue()]).fromJSValue()! } - public func lookupNamespaceURI(prefix: String?) -> String? { + @inlinable public func lookupNamespaceURI(prefix: String?) -> String? { let this = jsObject return this[Strings.lookupNamespaceURI].function!(this: this, arguments: [prefix.jsValue()]).fromJSValue()! } - public func isDefaultNamespace(namespace: String?) -> Bool { + @inlinable public func isDefaultNamespace(namespace: String?) -> Bool { let this = jsObject return this[Strings.isDefaultNamespace].function!(this: this, arguments: [namespace.jsValue()]).fromJSValue()! } - public func insertBefore(node: Node, child: Node?) -> Self { + @inlinable public func insertBefore(node: Node, child: Node?) -> Self { let this = jsObject return this[Strings.insertBefore].function!(this: this, arguments: [node.jsValue(), child.jsValue()]).fromJSValue()! } - public func appendChild(node: Node) -> Self { + @inlinable public func appendChild(node: Node) -> Self { let this = jsObject return this[Strings.appendChild].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! } - public func replaceChild(node: Node, child: Node) -> Self { + @inlinable public func replaceChild(node: Node, child: Node) -> Self { let this = jsObject return this[Strings.replaceChild].function!(this: this, arguments: [node.jsValue(), child.jsValue()]).fromJSValue()! } - public func removeChild(child: Node) -> Self { + @inlinable public func removeChild(child: Node) -> Self { let this = jsObject return this[Strings.removeChild].function!(this: this, arguments: [child.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/NodeIterator.swift b/Sources/DOMKit/WebIDL/NodeIterator.swift index 0258f743..b3ae30eb 100644 --- a/Sources/DOMKit/WebIDL/NodeIterator.swift +++ b/Sources/DOMKit/WebIDL/NodeIterator.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NodeIterator: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.NodeIterator].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NodeIterator].function! } public let jsObject: JSObject @@ -30,17 +30,17 @@ public class NodeIterator: JSBridgedClass { // XXX: member 'filter' is ignored - public func nextNode() -> Node? { + @inlinable public func nextNode() -> Node? { let this = jsObject return this[Strings.nextNode].function!(this: this, arguments: []).fromJSValue()! } - public func previousNode() -> Node? { + @inlinable public func previousNode() -> Node? { let this = jsObject return this[Strings.previousNode].function!(this: this, arguments: []).fromJSValue()! } - public func detach() { + @inlinable public func detach() { let this = jsObject _ = this[Strings.detach].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/NodeList.swift b/Sources/DOMKit/WebIDL/NodeList.swift index 483eb63c..4e3a16f4 100644 --- a/Sources/DOMKit/WebIDL/NodeList.swift +++ b/Sources/DOMKit/WebIDL/NodeList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NodeList: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.NodeList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NodeList].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class NodeList: JSBridgedClass, Sequence { self.jsObject = jsObject } - public subscript(key: Int) -> Node? { + @inlinable public subscript(key: Int) -> Node? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift b/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift index 8bac3f59..211c96f3 100644 --- a/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift +++ b/Sources/DOMKit/WebIDL/NonDocumentTypeChildNode.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol NonDocumentTypeChildNode: JSBridgedClass {} public extension NonDocumentTypeChildNode { - var previousElementSibling: Element? { ReadonlyAttribute[Strings.previousElementSibling, in: jsObject] } + @inlinable var previousElementSibling: Element? { ReadonlyAttribute[Strings.previousElementSibling, in: jsObject] } - var nextElementSibling: Element? { ReadonlyAttribute[Strings.nextElementSibling, in: jsObject] } + @inlinable var nextElementSibling: Element? { ReadonlyAttribute[Strings.nextElementSibling, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/NonElementParentNode.swift b/Sources/DOMKit/WebIDL/NonElementParentNode.swift index 7194dd86..6e2829bc 100644 --- a/Sources/DOMKit/WebIDL/NonElementParentNode.swift +++ b/Sources/DOMKit/WebIDL/NonElementParentNode.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol NonElementParentNode: JSBridgedClass {} public extension NonElementParentNode { - func getElementById(elementId: String) -> Element? { + @inlinable func getElementById(elementId: String) -> Element? { let this = jsObject return this[Strings.getElementById].function!(this: this, arguments: [elementId.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Notification.swift b/Sources/DOMKit/WebIDL/Notification.swift index cfbbc09b..8b63e6d6 100644 --- a/Sources/DOMKit/WebIDL/Notification.swift +++ b/Sources/DOMKit/WebIDL/Notification.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Notification: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Notification].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Notification].function! } public required init(unsafelyWrapping jsObject: JSObject) { _permission = ReadonlyAttribute(jsObject: jsObject, name: Strings.permission) @@ -31,7 +31,7 @@ public class Notification: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(title: String, options: NotificationOptions? = nil) { + @inlinable public convenience init(title: String, options: NotificationOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [title.jsValue(), options?.jsValue() ?? .undefined])) } @@ -102,7 +102,7 @@ public class Notification: EventTarget { @ReadonlyAttribute public var actions: [NotificationAction] - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/NotificationDirection.swift b/Sources/DOMKit/WebIDL/NotificationDirection.swift index 9915468a..1e3ac8d0 100644 --- a/Sources/DOMKit/WebIDL/NotificationDirection.swift +++ b/Sources/DOMKit/WebIDL/NotificationDirection.swift @@ -8,16 +8,16 @@ public enum NotificationDirection: JSString, JSValueCompatible { case ltr = "ltr" case rtl = "rtl" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/NotificationEvent.swift b/Sources/DOMKit/WebIDL/NotificationEvent.swift index eab93d62..c680a144 100644 --- a/Sources/DOMKit/WebIDL/NotificationEvent.swift +++ b/Sources/DOMKit/WebIDL/NotificationEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class NotificationEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.NotificationEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NotificationEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _notification = ReadonlyAttribute(jsObject: jsObject, name: Strings.notification) @@ -12,7 +12,7 @@ public class NotificationEvent: ExtendableEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: NotificationEventInit) { + @inlinable public convenience init(type: String, eventInitDict: NotificationEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/NotificationPermission.swift b/Sources/DOMKit/WebIDL/NotificationPermission.swift index a90b68cc..2a91a296 100644 --- a/Sources/DOMKit/WebIDL/NotificationPermission.swift +++ b/Sources/DOMKit/WebIDL/NotificationPermission.swift @@ -8,16 +8,16 @@ public enum NotificationPermission: JSString, JSValueCompatible { case denied = "denied" case granted = "granted" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift b/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift index 8941afff..1dab1791 100644 --- a/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift +++ b/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OES_draw_buffers_indexed: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OES_draw_buffers_indexed].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_draw_buffers_indexed].function! } public let jsObject: JSObject @@ -12,37 +12,37 @@ public class OES_draw_buffers_indexed: JSBridgedClass { self.jsObject = jsObject } - public func enableiOES(target: GLenum, index: GLuint) { + @inlinable public func enableiOES(target: GLenum, index: GLuint) { let this = jsObject _ = this[Strings.enableiOES].function!(this: this, arguments: [target.jsValue(), index.jsValue()]) } - public func disableiOES(target: GLenum, index: GLuint) { + @inlinable public func disableiOES(target: GLenum, index: GLuint) { let this = jsObject _ = this[Strings.disableiOES].function!(this: this, arguments: [target.jsValue(), index.jsValue()]) } - public func blendEquationiOES(buf: GLuint, mode: GLenum) { + @inlinable public func blendEquationiOES(buf: GLuint, mode: GLenum) { let this = jsObject _ = this[Strings.blendEquationiOES].function!(this: this, arguments: [buf.jsValue(), mode.jsValue()]) } - public func blendEquationSeparateiOES(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum) { + @inlinable public func blendEquationSeparateiOES(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum) { let this = jsObject _ = this[Strings.blendEquationSeparateiOES].function!(this: this, arguments: [buf.jsValue(), modeRGB.jsValue(), modeAlpha.jsValue()]) } - public func blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum) { + @inlinable public func blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum) { let this = jsObject _ = this[Strings.blendFunciOES].function!(this: this, arguments: [buf.jsValue(), src.jsValue(), dst.jsValue()]) } - public func blendFuncSeparateiOES(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { + @inlinable public func blendFuncSeparateiOES(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { let this = jsObject _ = this[Strings.blendFuncSeparateiOES].function!(this: this, arguments: [buf.jsValue(), srcRGB.jsValue(), dstRGB.jsValue(), srcAlpha.jsValue(), dstAlpha.jsValue()]) } - public func colorMaskiOES(buf: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean) { + @inlinable public func colorMaskiOES(buf: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean) { let this = jsObject _ = this[Strings.colorMaskiOES].function!(this: this, arguments: [buf.jsValue(), r.jsValue(), g.jsValue(), b.jsValue(), a.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/OES_element_index_uint.swift b/Sources/DOMKit/WebIDL/OES_element_index_uint.swift index 1b302edb..895756a5 100644 --- a/Sources/DOMKit/WebIDL/OES_element_index_uint.swift +++ b/Sources/DOMKit/WebIDL/OES_element_index_uint.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OES_element_index_uint: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OES_element_index_uint].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_element_index_uint].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift b/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift index 77094fc1..f6bf6990 100644 --- a/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift +++ b/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OES_fbo_render_mipmap: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OES_fbo_render_mipmap].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_fbo_render_mipmap].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift b/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift index 6b114d77..132ef4ad 100644 --- a/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift +++ b/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OES_standard_derivatives: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OES_standard_derivatives].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_standard_derivatives].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/OES_texture_float.swift b/Sources/DOMKit/WebIDL/OES_texture_float.swift index 57ddcbb3..4152e44a 100644 --- a/Sources/DOMKit/WebIDL/OES_texture_float.swift +++ b/Sources/DOMKit/WebIDL/OES_texture_float.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OES_texture_float: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_float].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_float].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift b/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift index ad8a43b4..751222ea 100644 --- a/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift +++ b/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OES_texture_float_linear: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_float_linear].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_float_linear].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/OES_texture_half_float.swift b/Sources/DOMKit/WebIDL/OES_texture_half_float.swift index f43939eb..a62ad3c8 100644 --- a/Sources/DOMKit/WebIDL/OES_texture_half_float.swift +++ b/Sources/DOMKit/WebIDL/OES_texture_half_float.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OES_texture_half_float: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_half_float].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_half_float].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift b/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift index 8a315698..88452af8 100644 --- a/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift +++ b/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OES_texture_half_float_linear: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_half_float_linear].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_half_float_linear].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift b/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift index b011beed..7107fd69 100644 --- a/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift +++ b/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OES_vertex_array_object: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OES_vertex_array_object].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_vertex_array_object].function! } public let jsObject: JSObject @@ -14,22 +14,22 @@ public class OES_vertex_array_object: JSBridgedClass { public static let VERTEX_ARRAY_BINDING_OES: GLenum = 0x85B5 - public func createVertexArrayOES() -> WebGLVertexArrayObjectOES? { + @inlinable public func createVertexArrayOES() -> WebGLVertexArrayObjectOES? { let this = jsObject return this[Strings.createVertexArrayOES].function!(this: this, arguments: []).fromJSValue()! } - public func deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { + @inlinable public func deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { let this = jsObject _ = this[Strings.deleteVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue()]) } - public func isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) -> GLboolean { + @inlinable public func isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) -> GLboolean { let this = jsObject return this[Strings.isVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue()]).fromJSValue()! } - public func bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { + @inlinable public func bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { let this = jsObject _ = this[Strings.bindVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/OTPCredential.swift b/Sources/DOMKit/WebIDL/OTPCredential.swift index 9c342fd8..ae099edb 100644 --- a/Sources/DOMKit/WebIDL/OTPCredential.swift +++ b/Sources/DOMKit/WebIDL/OTPCredential.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OTPCredential: Credential { - override public class var constructor: JSFunction { JSObject.global[Strings.OTPCredential].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OTPCredential].function! } public required init(unsafelyWrapping jsObject: JSObject) { _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) diff --git a/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift b/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift index ec75db90..2bbaffca 100644 --- a/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift +++ b/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum OTPCredentialTransportType: JSString, JSValueCompatible { case sms = "sms" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/OVR_multiview2.swift b/Sources/DOMKit/WebIDL/OVR_multiview2.swift index f3be8e80..54fd3d05 100644 --- a/Sources/DOMKit/WebIDL/OVR_multiview2.swift +++ b/Sources/DOMKit/WebIDL/OVR_multiview2.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OVR_multiview2: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.OVR_multiview2].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OVR_multiview2].function! } public let jsObject: JSObject @@ -20,7 +20,7 @@ public class OVR_multiview2: JSBridgedClass { public static let FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: GLenum = 0x9633 - public func framebufferTextureMultiviewOVR(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, baseViewIndex: GLint, numViews: GLsizei) { + @inlinable public func framebufferTextureMultiviewOVR(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, baseViewIndex: GLint, numViews: GLsizei) { let _arg0 = target.jsValue() let _arg1 = attachment.jsValue() let _arg2 = texture.jsValue() diff --git a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift index c4319072..3cd70745 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class OfflineAudioCompletionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.OfflineAudioCompletionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OfflineAudioCompletionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _renderedBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderedBuffer) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: OfflineAudioCompletionEventInit) { + @inlinable public convenience init(type: String, eventInitDict: OfflineAudioCompletionEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift index d78bc25a..ca4bc1ec 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OfflineAudioContext: BaseAudioContext { - override public class var constructor: JSFunction { JSObject.global[Strings.OfflineAudioContext].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OfflineAudioContext].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) @@ -12,45 +12,45 @@ public class OfflineAudioContext: BaseAudioContext { super.init(unsafelyWrapping: jsObject) } - public convenience init(contextOptions: OfflineAudioContextOptions) { + @inlinable public convenience init(contextOptions: OfflineAudioContextOptions) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions.jsValue()])) } - public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { + @inlinable public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue()])) } - public func startRendering() -> JSPromise { + @inlinable public func startRendering() -> JSPromise { let this = jsObject return this[Strings.startRendering].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func startRendering() async throws -> AudioBuffer { + @inlinable public func startRendering() async throws -> AudioBuffer { let this = jsObject let _promise: JSPromise = this[Strings.startRendering].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func resume() -> JSPromise { + @inlinable public func resume() -> JSPromise { let this = jsObject return this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func resume() async throws { + @inlinable public func resume() async throws { let this = jsObject let _promise: JSPromise = this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func suspend(suspendTime: Double) -> JSPromise { + @inlinable public func suspend(suspendTime: Double) -> JSPromise { let this = jsObject return this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func suspend(suspendTime: Double) async throws { + @inlinable public func suspend(suspendTime: Double) async throws { let this = jsObject let _promise: JSPromise = this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue()]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift index 8c2ad9e6..e1d0cce2 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OffscreenCanvas: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.OffscreenCanvas].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OffscreenCanvas].function! } public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) @@ -14,7 +14,7 @@ public class OffscreenCanvas: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(width: UInt64, height: UInt64) { + @inlinable public convenience init(width: UInt64, height: UInt64) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [width.jsValue(), height.jsValue()])) } @@ -24,23 +24,23 @@ public class OffscreenCanvas: EventTarget { @ReadWriteAttribute public var height: UInt64 - public func getContext(contextId: OffscreenRenderingContextId, options: JSValue? = nil) -> OffscreenRenderingContext? { + @inlinable public func getContext(contextId: OffscreenRenderingContextId, options: JSValue? = nil) -> OffscreenRenderingContext? { let this = jsObject return this[Strings.getContext].function!(this: this, arguments: [contextId.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - public func transferToImageBitmap() -> ImageBitmap { + @inlinable public func transferToImageBitmap() -> ImageBitmap { let this = jsObject return this[Strings.transferToImageBitmap].function!(this: this, arguments: []).fromJSValue()! } - public func convertToBlob(options: ImageEncodeOptions? = nil) -> JSPromise { + @inlinable public func convertToBlob(options: ImageEncodeOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.convertToBlob].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func convertToBlob(options: ImageEncodeOptions? = nil) async throws -> Blob { + @inlinable public func convertToBlob(options: ImageEncodeOptions? = nil) async throws -> Blob { let this = jsObject let _promise: JSPromise = this[Strings.convertToBlob].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift index 8bebfcf1..b37fb1fb 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvasRenderingContext2D.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OffscreenCanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { - public class var constructor: JSFunction { JSObject.global[Strings.OffscreenCanvasRenderingContext2D].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OffscreenCanvasRenderingContext2D].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class OffscreenCanvasRenderingContext2D: JSBridgedClass, CanvasState, Can self.jsObject = jsObject } - public func commit() { + @inlinable public func commit() { let this = jsObject _ = this[Strings.commit].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift index ad8c1828..fcb9d7f2 100644 --- a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift @@ -10,16 +10,16 @@ public enum OffscreenRenderingContextId: JSString, JSValueCompatible { case webgl2 = "webgl2" case webgpu = "webgpu" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/OrientationLockType.swift b/Sources/DOMKit/WebIDL/OrientationLockType.swift index 56b0633d..006e09e4 100644 --- a/Sources/DOMKit/WebIDL/OrientationLockType.swift +++ b/Sources/DOMKit/WebIDL/OrientationLockType.swift @@ -13,16 +13,16 @@ public enum OrientationLockType: JSString, JSValueCompatible { case landscapePrimary = "landscape-primary" case landscapeSecondary = "landscape-secondary" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/OrientationSensor.swift b/Sources/DOMKit/WebIDL/OrientationSensor.swift index 943402b9..12608f72 100644 --- a/Sources/DOMKit/WebIDL/OrientationSensor.swift +++ b/Sources/DOMKit/WebIDL/OrientationSensor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OrientationSensor: Sensor { - override public class var constructor: JSFunction { JSObject.global[Strings.OrientationSensor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OrientationSensor].function! } public required init(unsafelyWrapping jsObject: JSObject) { _quaternion = ReadonlyAttribute(jsObject: jsObject, name: Strings.quaternion) @@ -14,7 +14,7 @@ public class OrientationSensor: Sensor { @ReadonlyAttribute public var quaternion: [Double]? - public func populateMatrix(targetMatrix: RotationMatrixType) { + @inlinable public func populateMatrix(targetMatrix: RotationMatrixType) { let this = jsObject _ = this[Strings.populateMatrix].function!(this: this, arguments: [targetMatrix.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift index 4e27a4bf..72fffb93 100644 --- a/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift +++ b/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift @@ -7,16 +7,16 @@ public enum OrientationSensorLocalCoordinateSystem: JSString, JSValueCompatible case device = "device" case screen = "screen" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/OrientationType.swift b/Sources/DOMKit/WebIDL/OrientationType.swift index 0639da39..aea2b5c6 100644 --- a/Sources/DOMKit/WebIDL/OrientationType.swift +++ b/Sources/DOMKit/WebIDL/OrientationType.swift @@ -9,16 +9,16 @@ public enum OrientationType: JSString, JSValueCompatible { case landscapePrimary = "landscape-primary" case landscapeSecondary = "landscape-secondary" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/OscillatorNode.swift b/Sources/DOMKit/WebIDL/OscillatorNode.swift index db87504f..aba9d30b 100644 --- a/Sources/DOMKit/WebIDL/OscillatorNode.swift +++ b/Sources/DOMKit/WebIDL/OscillatorNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OscillatorNode: AudioScheduledSourceNode { - override public class var constructor: JSFunction { JSObject.global[Strings.OscillatorNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OscillatorNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) @@ -13,7 +13,7 @@ public class OscillatorNode: AudioScheduledSourceNode { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: OscillatorOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: OscillatorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @@ -26,7 +26,7 @@ public class OscillatorNode: AudioScheduledSourceNode { @ReadonlyAttribute public var detune: AudioParam - public func setPeriodicWave(periodicWave: PeriodicWave) { + @inlinable public func setPeriodicWave(periodicWave: PeriodicWave) { let this = jsObject _ = this[Strings.setPeriodicWave].function!(this: this, arguments: [periodicWave.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/OscillatorType.swift b/Sources/DOMKit/WebIDL/OscillatorType.swift index 162bcb20..ad63908c 100644 --- a/Sources/DOMKit/WebIDL/OscillatorType.swift +++ b/Sources/DOMKit/WebIDL/OscillatorType.swift @@ -10,16 +10,16 @@ public enum OscillatorType: JSString, JSValueCompatible { case triangle = "triangle" case custom = "custom" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/OverSampleType.swift b/Sources/DOMKit/WebIDL/OverSampleType.swift index 0d0eacc4..b8d79869 100644 --- a/Sources/DOMKit/WebIDL/OverSampleType.swift +++ b/Sources/DOMKit/WebIDL/OverSampleType.swift @@ -8,16 +8,16 @@ public enum OverSampleType: JSString, JSValueCompatible { case _2x = "2x" case _4x = "4x" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/OverconstrainedError.swift b/Sources/DOMKit/WebIDL/OverconstrainedError.swift index efae7fd2..4de51eee 100644 --- a/Sources/DOMKit/WebIDL/OverconstrainedError.swift +++ b/Sources/DOMKit/WebIDL/OverconstrainedError.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class OverconstrainedError: DOMException { - override public class var constructor: JSFunction { JSObject.global[Strings.OverconstrainedError].function! } + @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) } - public convenience init(constraint: String, message: String? = nil) { + @inlinable public convenience init(constraint: String, message: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [constraint.jsValue(), message?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift index fda527ac..c67ffc08 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class PageTransitionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.PageTransitionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PageTransitionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _persisted = ReadonlyAttribute(jsObject: jsObject, name: Strings.persisted) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PageTransitionEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: PageTransitionEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift b/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift index bf1f85cb..6d5c03d7 100644 --- a/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift +++ b/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PaintRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasRect, CanvasDrawPath, CanvasDrawImage, CanvasPathDrawingStyles, CanvasPath { - public class var constructor: JSFunction { JSObject.global[Strings.PaintRenderingContext2D].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PaintRenderingContext2D].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/PaintSize.swift b/Sources/DOMKit/WebIDL/PaintSize.swift index 2d3fea98..4602c594 100644 --- a/Sources/DOMKit/WebIDL/PaintSize.swift +++ b/Sources/DOMKit/WebIDL/PaintSize.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PaintSize: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PaintSize].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PaintSize].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift index 3cf02459..28f1fd07 100644 --- a/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PaintWorkletGlobalScope: WorkletGlobalScope { - override public class var constructor: JSFunction { JSObject.global[Strings.PaintWorkletGlobalScope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaintWorkletGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _devicePixelRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePixelRatio) diff --git a/Sources/DOMKit/WebIDL/PannerNode.swift b/Sources/DOMKit/WebIDL/PannerNode.swift index 962f22ae..979dac8d 100644 --- a/Sources/DOMKit/WebIDL/PannerNode.swift +++ b/Sources/DOMKit/WebIDL/PannerNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PannerNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.PannerNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PannerNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _panningModel = ReadWriteAttribute(jsObject: jsObject, name: Strings.panningModel) @@ -24,7 +24,7 @@ public class PannerNode: AudioNode { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: PannerOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: PannerOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } @@ -70,12 +70,12 @@ public class PannerNode: AudioNode { @ReadWriteAttribute public var coneOuterGain: Double - public func setPosition(x: Float, y: Float, z: Float) { + @inlinable public func setPosition(x: Float, y: Float, z: Float) { let this = jsObject _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue(), y.jsValue(), z.jsValue()]) } - public func setOrientation(x: Float, y: Float, z: Float) { + @inlinable public func setOrientation(x: Float, y: Float, z: Float) { let this = jsObject _ = this[Strings.setOrientation].function!(this: this, arguments: [x.jsValue(), y.jsValue(), z.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/PanningModelType.swift b/Sources/DOMKit/WebIDL/PanningModelType.swift index bc9e3131..fa3f8f33 100644 --- a/Sources/DOMKit/WebIDL/PanningModelType.swift +++ b/Sources/DOMKit/WebIDL/PanningModelType.swift @@ -7,16 +7,16 @@ public enum PanningModelType: JSString, JSValueCompatible { case equalpower = "equalpower" case hRTF = "HRTF" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ParentNode.swift b/Sources/DOMKit/WebIDL/ParentNode.swift index 7dc59a09..a70a9a4d 100644 --- a/Sources/DOMKit/WebIDL/ParentNode.swift +++ b/Sources/DOMKit/WebIDL/ParentNode.swift @@ -5,35 +5,35 @@ import JavaScriptKit public protocol ParentNode: JSBridgedClass {} public extension ParentNode { - var children: HTMLCollection { ReadonlyAttribute[Strings.children, in: jsObject] } + @inlinable var children: HTMLCollection { ReadonlyAttribute[Strings.children, in: jsObject] } - var firstElementChild: Element? { ReadonlyAttribute[Strings.firstElementChild, in: jsObject] } + @inlinable var firstElementChild: Element? { ReadonlyAttribute[Strings.firstElementChild, in: jsObject] } - var lastElementChild: Element? { ReadonlyAttribute[Strings.lastElementChild, in: jsObject] } + @inlinable var lastElementChild: Element? { ReadonlyAttribute[Strings.lastElementChild, in: jsObject] } - var childElementCount: UInt32 { ReadonlyAttribute[Strings.childElementCount, in: jsObject] } + @inlinable var childElementCount: UInt32 { ReadonlyAttribute[Strings.childElementCount, in: jsObject] } - func prepend(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func prepend(nodes: __UNSUPPORTED_UNION__...) { let this = jsObject _ = this[Strings.prepend].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - func append(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func append(nodes: __UNSUPPORTED_UNION__...) { let this = jsObject _ = this[Strings.append].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - func replaceChildren(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func replaceChildren(nodes: __UNSUPPORTED_UNION__...) { let this = jsObject _ = this[Strings.replaceChildren].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - func querySelector(selectors: String) -> Element? { + @inlinable func querySelector(selectors: String) -> Element? { let this = jsObject return this[Strings.querySelector].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } - func querySelectorAll(selectors: String) -> NodeList { + @inlinable func querySelectorAll(selectors: String) -> NodeList { let this = jsObject return this[Strings.querySelectorAll].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ParityType.swift b/Sources/DOMKit/WebIDL/ParityType.swift index a90ec594..5dc33c93 100644 --- a/Sources/DOMKit/WebIDL/ParityType.swift +++ b/Sources/DOMKit/WebIDL/ParityType.swift @@ -8,16 +8,16 @@ public enum ParityType: JSString, JSValueCompatible { case even = "even" case odd = "odd" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PasswordCredential.swift b/Sources/DOMKit/WebIDL/PasswordCredential.swift index bddb48d1..2b78233c 100644 --- a/Sources/DOMKit/WebIDL/PasswordCredential.swift +++ b/Sources/DOMKit/WebIDL/PasswordCredential.swift @@ -4,18 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class PasswordCredential: Credential, CredentialUserData { - override public class var constructor: JSFunction { JSObject.global[Strings.PasswordCredential].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PasswordCredential].function! } public required init(unsafelyWrapping jsObject: JSObject) { _password = ReadonlyAttribute(jsObject: jsObject, name: Strings.password) super.init(unsafelyWrapping: jsObject) } - public convenience init(form: HTMLFormElement) { + @inlinable public convenience init(form: HTMLFormElement) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [form.jsValue()])) } - public convenience init(data: PasswordCredentialData) { + @inlinable public convenience init(data: PasswordCredentialData) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index 531e9f40..0a049232 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Path2D: JSBridgedClass, CanvasPath { - public class var constructor: JSFunction { JSObject.global[Strings.Path2D].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Path2D].function! } public let jsObject: JSObject @@ -12,11 +12,11 @@ public class Path2D: JSBridgedClass, CanvasPath { self.jsObject = jsObject } - public convenience init(path: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(path: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [path?.jsValue() ?? .undefined])) } - public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { + @inlinable public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { let this = jsObject _ = this[Strings.addPath].function!(this: this, arguments: [path.jsValue(), transform?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/PaymentComplete.swift b/Sources/DOMKit/WebIDL/PaymentComplete.swift index 3902599c..0143eaf2 100644 --- a/Sources/DOMKit/WebIDL/PaymentComplete.swift +++ b/Sources/DOMKit/WebIDL/PaymentComplete.swift @@ -8,16 +8,16 @@ public enum PaymentComplete: JSString, JSValueCompatible { case success = "success" case unknown = "unknown" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PaymentInstruments.swift b/Sources/DOMKit/WebIDL/PaymentInstruments.swift index 466ec1ac..60a02053 100644 --- a/Sources/DOMKit/WebIDL/PaymentInstruments.swift +++ b/Sources/DOMKit/WebIDL/PaymentInstruments.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PaymentInstruments: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PaymentInstruments].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PaymentInstruments].function! } public let jsObject: JSObject @@ -12,73 +12,73 @@ public class PaymentInstruments: JSBridgedClass { self.jsObject = jsObject } - public func delete(instrumentKey: String) -> JSPromise { + @inlinable public func delete(instrumentKey: String) -> JSPromise { let this = jsObject return this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func delete(instrumentKey: String) async throws -> Bool { + @inlinable public func delete(instrumentKey: String) async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func get(instrumentKey: String) -> JSPromise { + @inlinable public func get(instrumentKey: String) -> JSPromise { let this = jsObject return this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func get(instrumentKey: String) async throws -> JSValue { + @inlinable public func get(instrumentKey: String) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func keys() -> JSPromise { + @inlinable public func keys() -> JSPromise { let this = jsObject return this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func keys() async throws -> [String] { + @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.get().fromJSValue()! } - public func has(instrumentKey: String) -> JSPromise { + @inlinable public func has(instrumentKey: String) -> JSPromise { let this = jsObject return this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func has(instrumentKey: String) async throws -> Bool { + @inlinable public func has(instrumentKey: String) async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func set(instrumentKey: String, details: PaymentInstrument) -> JSPromise { + @inlinable public func set(instrumentKey: String, details: PaymentInstrument) -> JSPromise { let this = jsObject return this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue(), details.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func set(instrumentKey: String, details: PaymentInstrument) async throws { + @inlinable public func set(instrumentKey: String, details: PaymentInstrument) async throws { let this = jsObject let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue(), details.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func clear() -> JSPromise { + @inlinable public func clear() -> JSPromise { let this = jsObject return this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func clear() async throws { + @inlinable public func clear() async throws { let this = jsObject let _promise: JSPromise = this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/PaymentManager.swift b/Sources/DOMKit/WebIDL/PaymentManager.swift index 3ce36894..63bb3b36 100644 --- a/Sources/DOMKit/WebIDL/PaymentManager.swift +++ b/Sources/DOMKit/WebIDL/PaymentManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PaymentManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PaymentManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PaymentManager].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift b/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift index 681e2d36..c9cb0198 100644 --- a/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PaymentMethodChangeEvent: PaymentRequestUpdateEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.PaymentMethodChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentMethodChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _methodName = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodName) @@ -12,7 +12,7 @@ public class PaymentMethodChangeEvent: PaymentRequestUpdateEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PaymentMethodChangeEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: PaymentMethodChangeEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/PaymentRequest.swift b/Sources/DOMKit/WebIDL/PaymentRequest.swift index 9c40d8b4..e4743bf2 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequest.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequest.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PaymentRequest: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequest].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequest].function! } public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) @@ -12,41 +12,41 @@ public class PaymentRequest: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(methodData: [PaymentMethodData], details: PaymentDetailsInit) { + @inlinable public convenience init(methodData: [PaymentMethodData], details: PaymentDetailsInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [methodData.jsValue(), details.jsValue()])) } - public func show(detailsPromise: JSPromise? = nil) -> JSPromise { + @inlinable public func show(detailsPromise: JSPromise? = nil) -> JSPromise { let this = jsObject return this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func show(detailsPromise: JSPromise? = nil) async throws -> PaymentResponse { + @inlinable public func show(detailsPromise: JSPromise? = nil) async throws -> PaymentResponse { let this = jsObject let _promise: JSPromise = this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func abort() -> JSPromise { + @inlinable public func abort() -> JSPromise { let this = jsObject return this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func abort() async throws { + @inlinable public func abort() async throws { let this = jsObject let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func canMakePayment() -> JSPromise { + @inlinable public func canMakePayment() -> JSPromise { let this = jsObject return this[Strings.canMakePayment].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func canMakePayment() async throws -> Bool { + @inlinable public func canMakePayment() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.canMakePayment].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift index a57a0f58..a856720c 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PaymentRequestEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequestEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequestEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _topOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.topOrigin) @@ -16,7 +16,7 @@ public class PaymentRequestEvent: ExtendableEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PaymentRequestEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: PaymentRequestEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -38,31 +38,31 @@ public class PaymentRequestEvent: ExtendableEvent { @ReadonlyAttribute public var modifiers: [PaymentDetailsModifier] - public func openWindow(url: String) -> JSPromise { + @inlinable public func openWindow(url: String) -> JSPromise { let this = jsObject return this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func openWindow(url: String) async throws -> WindowClient? { + @inlinable public func openWindow(url: String) async throws -> WindowClient? { let this = jsObject let _promise: JSPromise = this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) -> JSPromise { + @inlinable public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) -> JSPromise { let this = jsObject return this[Strings.changePaymentMethod].function!(this: this, arguments: [methodName.jsValue(), methodDetails?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) async throws -> PaymentRequestDetailsUpdate? { + @inlinable public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) async throws -> PaymentRequestDetailsUpdate? { let this = jsObject let _promise: JSPromise = this[Strings.changePaymentMethod].function!(this: this, arguments: [methodName.jsValue(), methodDetails?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func respondWith(handlerResponsePromise: JSPromise) { + @inlinable public func respondWith(handlerResponsePromise: JSPromise) { let this = jsObject _ = this[Strings.respondWith].function!(this: this, arguments: [handlerResponsePromise.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift index e86b0254..16e0b13f 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit public class PaymentRequestUpdateEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequestUpdateEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequestUpdateEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PaymentRequestUpdateEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: PaymentRequestUpdateEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } - public func updateWith(detailsPromise: JSPromise) { + @inlinable public func updateWith(detailsPromise: JSPromise) { let this = jsObject _ = this[Strings.updateWith].function!(this: this, arguments: [detailsPromise.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/PaymentResponse.swift b/Sources/DOMKit/WebIDL/PaymentResponse.swift index 60d1a3c5..7b12a4eb 100644 --- a/Sources/DOMKit/WebIDL/PaymentResponse.swift +++ b/Sources/DOMKit/WebIDL/PaymentResponse.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PaymentResponse: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.PaymentResponse].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentResponse].function! } public required init(unsafelyWrapping jsObject: JSObject) { _requestId = ReadonlyAttribute(jsObject: jsObject, name: Strings.requestId) @@ -13,7 +13,7 @@ public class PaymentResponse: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @@ -27,25 +27,25 @@ public class PaymentResponse: EventTarget { @ReadonlyAttribute public var details: JSObject - public func complete(result: PaymentComplete? = nil) -> JSPromise { + @inlinable public func complete(result: PaymentComplete? = nil) -> JSPromise { let this = jsObject return this[Strings.complete].function!(this: this, arguments: [result?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func complete(result: PaymentComplete? = nil) async throws { + @inlinable public func complete(result: PaymentComplete? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.complete].function!(this: this, arguments: [result?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func retry(errorFields: PaymentValidationErrors? = nil) -> JSPromise { + @inlinable public func retry(errorFields: PaymentValidationErrors? = nil) -> JSPromise { let this = jsObject return this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func retry(errorFields: PaymentValidationErrors? = nil) async throws { + @inlinable public func retry(errorFields: PaymentValidationErrors? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index 9c30b892..136e3743 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Performance: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Performance].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Performance].function! } public required init(unsafelyWrapping jsObject: JSObject) { _eventCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.eventCounts) @@ -22,7 +22,7 @@ public class Performance: EventTarget { @ReadonlyAttribute public var interactionCounts: InteractionCounts - public func now() -> DOMHighResTimeStamp { + @inlinable public func now() -> DOMHighResTimeStamp { let this = jsObject return this[Strings.now].function!(this: this, arguments: []).fromJSValue()! } @@ -30,7 +30,7 @@ public class Performance: EventTarget { @ReadonlyAttribute public var timeOrigin: DOMHighResTimeStamp - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } @@ -41,39 +41,39 @@ public class Performance: EventTarget { @ReadonlyAttribute public var navigation: PerformanceNavigation - public func measureUserAgentSpecificMemory() -> JSPromise { + @inlinable public func measureUserAgentSpecificMemory() -> JSPromise { let this = jsObject return this[Strings.measureUserAgentSpecificMemory].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { + @inlinable public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { let this = jsObject let _promise: JSPromise = this[Strings.measureUserAgentSpecificMemory].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getEntries() -> PerformanceEntryList { + @inlinable public func getEntries() -> PerformanceEntryList { let this = jsObject return this[Strings.getEntries].function!(this: this, arguments: []).fromJSValue()! } - public func getEntriesByType(type: String) -> PerformanceEntryList { + @inlinable public func getEntriesByType(type: String) -> PerformanceEntryList { let this = jsObject return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } - public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { + @inlinable public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { let this = jsObject return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue(), type?.jsValue() ?? .undefined]).fromJSValue()! } - public func clearResourceTimings() { + @inlinable public func clearResourceTimings() { let this = jsObject _ = this[Strings.clearResourceTimings].function!(this: this, arguments: []) } - public func setResourceTimingBufferSize(maxSize: UInt32) { + @inlinable public func setResourceTimingBufferSize(maxSize: UInt32) { let this = jsObject _ = this[Strings.setResourceTimingBufferSize].function!(this: this, arguments: [maxSize.jsValue()]) } @@ -81,22 +81,22 @@ public class Performance: EventTarget { @ClosureAttribute1Optional public var onresourcetimingbufferfull: EventHandler - public func mark(markName: String, markOptions: PerformanceMarkOptions? = nil) -> PerformanceMark { + @inlinable public func mark(markName: String, markOptions: PerformanceMarkOptions? = nil) -> PerformanceMark { let this = jsObject return this[Strings.mark].function!(this: this, arguments: [markName.jsValue(), markOptions?.jsValue() ?? .undefined]).fromJSValue()! } - public func clearMarks(markName: String? = nil) { + @inlinable public func clearMarks(markName: String? = nil) { let this = jsObject _ = this[Strings.clearMarks].function!(this: this, arguments: [markName?.jsValue() ?? .undefined]) } - public func measure(measureName: String, startOrMeasureOptions: __UNSUPPORTED_UNION__? = nil, endMark: String? = nil) -> PerformanceMeasure { + @inlinable public func measure(measureName: String, startOrMeasureOptions: __UNSUPPORTED_UNION__? = nil, endMark: String? = nil) -> PerformanceMeasure { let this = jsObject return this[Strings.measure].function!(this: this, arguments: [measureName.jsValue(), startOrMeasureOptions?.jsValue() ?? .undefined, endMark?.jsValue() ?? .undefined]).fromJSValue()! } - public func clearMeasures(measureName: String? = nil) { + @inlinable public func clearMeasures(measureName: String? = nil) { let this = jsObject _ = this[Strings.clearMeasures].function!(this: this, arguments: [measureName?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift b/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift index 80165c12..09c3dc92 100644 --- a/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceElementTiming: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceElementTiming].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceElementTiming].function! } public required init(unsafelyWrapping jsObject: JSObject) { _renderTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderTime) @@ -46,7 +46,7 @@ public class PerformanceElementTiming: PerformanceEntry { @ReadonlyAttribute public var url: String - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceEntry.swift b/Sources/DOMKit/WebIDL/PerformanceEntry.swift index 09e721c0..f64bac68 100644 --- a/Sources/DOMKit/WebIDL/PerformanceEntry.swift +++ b/Sources/DOMKit/WebIDL/PerformanceEntry.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceEntry: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PerformanceEntry].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceEntry].function! } public let jsObject: JSObject @@ -28,7 +28,7 @@ public class PerformanceEntry: JSBridgedClass { @ReadonlyAttribute public var duration: DOMHighResTimeStamp - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift b/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift index aaf22b98..069aae05 100644 --- a/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceEventTiming: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceEventTiming].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceEventTiming].function! } public required init(unsafelyWrapping jsObject: JSObject) { _processingStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.processingStart) @@ -30,7 +30,7 @@ public class PerformanceEventTiming: PerformanceEntry { @ReadonlyAttribute public var interactionId: UInt64 - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift b/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift index dda9421e..8c4955a7 100644 --- a/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceLongTaskTiming: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceLongTaskTiming].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceLongTaskTiming].function! } public required init(unsafelyWrapping jsObject: JSObject) { _attribution = ReadonlyAttribute(jsObject: jsObject, name: Strings.attribution) @@ -14,7 +14,7 @@ public class PerformanceLongTaskTiming: PerformanceEntry { @ReadonlyAttribute public var attribution: [TaskAttributionTiming] - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceMark.swift b/Sources/DOMKit/WebIDL/PerformanceMark.swift index e51e2c3a..f25649d1 100644 --- a/Sources/DOMKit/WebIDL/PerformanceMark.swift +++ b/Sources/DOMKit/WebIDL/PerformanceMark.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceMark: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceMark].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceMark].function! } public required init(unsafelyWrapping jsObject: JSObject) { _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) super.init(unsafelyWrapping: jsObject) } - public convenience init(markName: String, markOptions: PerformanceMarkOptions? = nil) { + @inlinable public convenience init(markName: String, markOptions: PerformanceMarkOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [markName.jsValue(), markOptions?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasure.swift b/Sources/DOMKit/WebIDL/PerformanceMeasure.swift index 438a361f..d9966d33 100644 --- a/Sources/DOMKit/WebIDL/PerformanceMeasure.swift +++ b/Sources/DOMKit/WebIDL/PerformanceMeasure.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceMeasure: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceMeasure].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceMeasure].function! } public required init(unsafelyWrapping jsObject: JSObject) { _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) diff --git a/Sources/DOMKit/WebIDL/PerformanceNavigation.swift b/Sources/DOMKit/WebIDL/PerformanceNavigation.swift index a861efe3..4c398cf7 100644 --- a/Sources/DOMKit/WebIDL/PerformanceNavigation.swift +++ b/Sources/DOMKit/WebIDL/PerformanceNavigation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceNavigation: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PerformanceNavigation].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceNavigation].function! } public let jsObject: JSObject @@ -28,7 +28,7 @@ public class PerformanceNavigation: JSBridgedClass { @ReadonlyAttribute public var redirectCount: UInt16 - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift b/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift index 3ca38100..35c4c998 100644 --- a/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceNavigationTiming: PerformanceResourceTiming { - override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceNavigationTiming].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceNavigationTiming].function! } public required init(unsafelyWrapping jsObject: JSObject) { _unloadEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.unloadEventStart) @@ -50,7 +50,7 @@ public class PerformanceNavigationTiming: PerformanceResourceTiming { @ReadonlyAttribute public var redirectCount: UInt16 - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceObserver.swift b/Sources/DOMKit/WebIDL/PerformanceObserver.swift index 67d2570c..aaec30c9 100644 --- a/Sources/DOMKit/WebIDL/PerformanceObserver.swift +++ b/Sources/DOMKit/WebIDL/PerformanceObserver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceObserver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PerformanceObserver].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceObserver].function! } public let jsObject: JSObject @@ -15,17 +15,17 @@ public class PerformanceObserver: JSBridgedClass { // XXX: constructor is ignored - public func observe(options: PerformanceObserverInit? = nil) { + @inlinable public func observe(options: PerformanceObserverInit? = nil) { let this = jsObject _ = this[Strings.observe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } - public func disconnect() { + @inlinable public func disconnect() { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: []) } - public func takeRecords() -> PerformanceEntryList { + @inlinable public func takeRecords() -> PerformanceEntryList { let this = jsObject return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift b/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift index de1ec84c..5985637b 100644 --- a/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift +++ b/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceObserverEntryList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PerformanceObserverEntryList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceObserverEntryList].function! } public let jsObject: JSObject @@ -12,17 +12,17 @@ public class PerformanceObserverEntryList: JSBridgedClass { self.jsObject = jsObject } - public func getEntries() -> PerformanceEntryList { + @inlinable public func getEntries() -> PerformanceEntryList { let this = jsObject return this[Strings.getEntries].function!(this: this, arguments: []).fromJSValue()! } - public func getEntriesByType(type: String) -> PerformanceEntryList { + @inlinable public func getEntriesByType(type: String) -> PerformanceEntryList { let this = jsObject return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } - public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { + @inlinable public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { let this = jsObject return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue(), type?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift b/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift index 023cb736..78ae13ce 100644 --- a/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformancePaintTiming: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.PerformancePaintTiming].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformancePaintTiming].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift b/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift index 11abf652..0e7eade3 100644 --- a/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceResourceTiming: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceResourceTiming].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceResourceTiming].function! } public required init(unsafelyWrapping jsObject: JSObject) { _initiatorType = ReadonlyAttribute(jsObject: jsObject, name: Strings.initiatorType) @@ -79,7 +79,7 @@ public class PerformanceResourceTiming: PerformanceEntry { @ReadonlyAttribute public var decodedBodySize: UInt64 - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift b/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift index a3cccf9d..13249090 100644 --- a/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceServerTiming: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PerformanceServerTiming].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceServerTiming].function! } public let jsObject: JSObject @@ -24,7 +24,7 @@ public class PerformanceServerTiming: JSBridgedClass { @ReadonlyAttribute public var description: String - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceTiming.swift b/Sources/DOMKit/WebIDL/PerformanceTiming.swift index a20c12a1..55c9309d 100644 --- a/Sources/DOMKit/WebIDL/PerformanceTiming.swift +++ b/Sources/DOMKit/WebIDL/PerformanceTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceTiming: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PerformanceTiming].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceTiming].function! } public let jsObject: JSObject @@ -96,7 +96,7 @@ public class PerformanceTiming: JSBridgedClass { @ReadonlyAttribute public var loadEventEnd: UInt64 - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift b/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift index a1ad12dd..cbf210b2 100644 --- a/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift +++ b/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class PeriodicSyncEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.PeriodicSyncEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PeriodicSyncEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _tag = ReadonlyAttribute(jsObject: jsObject, name: Strings.tag) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, init: PeriodicSyncEventInit) { + @inlinable public convenience init(type: String, init: PeriodicSyncEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift b/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift index 7cfc9205..77ef149f 100644 --- a/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift +++ b/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PeriodicSyncManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PeriodicSyncManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PeriodicSyncManager].function! } public let jsObject: JSObject @@ -12,37 +12,37 @@ public class PeriodicSyncManager: JSBridgedClass { self.jsObject = jsObject } - public func register(tag: String, options: BackgroundSyncOptions? = nil) -> JSPromise { + @inlinable public func register(tag: String, options: BackgroundSyncOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.register].function!(this: this, arguments: [tag.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func register(tag: String, options: BackgroundSyncOptions? = nil) async throws { + @inlinable public func register(tag: String, options: BackgroundSyncOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func getTags() -> JSPromise { + @inlinable public func getTags() -> JSPromise { let this = jsObject return this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getTags() async throws -> [String] { + @inlinable public func getTags() async throws -> [String] { let this = jsObject let _promise: JSPromise = this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func unregister(tag: String) -> JSPromise { + @inlinable public func unregister(tag: String) -> JSPromise { let this = jsObject return this[Strings.unregister].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func unregister(tag: String) async throws { + @inlinable public func unregister(tag: String) async throws { let this = jsObject let _promise: JSPromise = this[Strings.unregister].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/PeriodicWave.swift b/Sources/DOMKit/WebIDL/PeriodicWave.swift index e4e8e594..57c30cc4 100644 --- a/Sources/DOMKit/WebIDL/PeriodicWave.swift +++ b/Sources/DOMKit/WebIDL/PeriodicWave.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PeriodicWave: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PeriodicWave].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PeriodicWave].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class PeriodicWave: JSBridgedClass { self.jsObject = jsObject } - public convenience init(context: BaseAudioContext, options: PeriodicWaveOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: PeriodicWaveOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/PermissionState.swift b/Sources/DOMKit/WebIDL/PermissionState.swift index e78319cf..08889b82 100644 --- a/Sources/DOMKit/WebIDL/PermissionState.swift +++ b/Sources/DOMKit/WebIDL/PermissionState.swift @@ -8,16 +8,16 @@ public enum PermissionState: JSString, JSValueCompatible { case denied = "denied" case prompt = "prompt" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PermissionStatus.swift b/Sources/DOMKit/WebIDL/PermissionStatus.swift index 47c7eb42..4effa753 100644 --- a/Sources/DOMKit/WebIDL/PermissionStatus.swift +++ b/Sources/DOMKit/WebIDL/PermissionStatus.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PermissionStatus: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.PermissionStatus].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PermissionStatus].function! } public required init(unsafelyWrapping jsObject: JSObject) { _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) diff --git a/Sources/DOMKit/WebIDL/Permissions.swift b/Sources/DOMKit/WebIDL/Permissions.swift index b06a165e..4fc51b03 100644 --- a/Sources/DOMKit/WebIDL/Permissions.swift +++ b/Sources/DOMKit/WebIDL/Permissions.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Permissions: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Permissions].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Permissions].function! } public let jsObject: JSObject @@ -12,37 +12,37 @@ public class Permissions: JSBridgedClass { self.jsObject = jsObject } - public func request(permissionDesc: JSObject) -> JSPromise { + @inlinable public func request(permissionDesc: JSObject) -> JSPromise { let this = jsObject return this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func request(permissionDesc: JSObject) async throws -> PermissionStatus { + @inlinable public func request(permissionDesc: JSObject) async throws -> PermissionStatus { let this = jsObject let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func revoke(permissionDesc: JSObject) -> JSPromise { + @inlinable public func revoke(permissionDesc: JSObject) -> JSPromise { let this = jsObject return this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func revoke(permissionDesc: JSObject) async throws -> PermissionStatus { + @inlinable public func revoke(permissionDesc: JSObject) async throws -> PermissionStatus { let this = jsObject let _promise: JSPromise = this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func query(permissionDesc: JSObject) -> JSPromise { + @inlinable public func query(permissionDesc: JSObject) -> JSPromise { let this = jsObject return this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func query(permissionDesc: JSObject) async throws -> PermissionStatus { + @inlinable public func query(permissionDesc: JSObject) async throws -> PermissionStatus { let this = jsObject let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/PermissionsPolicy.swift b/Sources/DOMKit/WebIDL/PermissionsPolicy.swift index 887f6d7d..120c75d0 100644 --- a/Sources/DOMKit/WebIDL/PermissionsPolicy.swift +++ b/Sources/DOMKit/WebIDL/PermissionsPolicy.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PermissionsPolicy: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PermissionsPolicy].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PermissionsPolicy].function! } public let jsObject: JSObject @@ -12,22 +12,22 @@ public class PermissionsPolicy: JSBridgedClass { self.jsObject = jsObject } - public func allowsFeature(feature: String, origin: String? = nil) -> Bool { + @inlinable public func allowsFeature(feature: String, origin: String? = nil) -> Bool { let this = jsObject return this[Strings.allowsFeature].function!(this: this, arguments: [feature.jsValue(), origin?.jsValue() ?? .undefined]).fromJSValue()! } - public func features() -> [String] { + @inlinable public func features() -> [String] { let this = jsObject return this[Strings.features].function!(this: this, arguments: []).fromJSValue()! } - public func allowedFeatures() -> [String] { + @inlinable public func allowedFeatures() -> [String] { let this = jsObject return this[Strings.allowedFeatures].function!(this: this, arguments: []).fromJSValue()! } - public func getAllowlistForFeature(feature: String) -> [String] { + @inlinable public func getAllowlistForFeature(feature: String) -> [String] { let this = jsObject return this[Strings.getAllowlistForFeature].function!(this: this, arguments: [feature.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift b/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift index 1f781aa8..dcfd7a2d 100644 --- a/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift +++ b/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PermissionsPolicyViolationReportBody: ReportBody { - override public class var constructor: JSFunction { JSObject.global[Strings.PermissionsPolicyViolationReportBody].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PermissionsPolicyViolationReportBody].function! } public required init(unsafelyWrapping jsObject: JSObject) { _featureId = ReadonlyAttribute(jsObject: jsObject, name: Strings.featureId) diff --git a/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift b/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift index 43fe0608..bb50b9de 100644 --- a/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift +++ b/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class PictureInPictureEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.PictureInPictureEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PictureInPictureEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _pictureInPictureWindow = ReadonlyAttribute(jsObject: jsObject, name: Strings.pictureInPictureWindow) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PictureInPictureEventInit) { + @inlinable public convenience init(type: String, eventInitDict: PictureInPictureEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift b/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift index bf9d3fde..1bb55bcc 100644 --- a/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift +++ b/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PictureInPictureWindow: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.PictureInPictureWindow].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PictureInPictureWindow].function! } public required init(unsafelyWrapping jsObject: JSObject) { _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) diff --git a/Sources/DOMKit/WebIDL/PlaybackDirection.swift b/Sources/DOMKit/WebIDL/PlaybackDirection.swift index 63e727d3..079b1d52 100644 --- a/Sources/DOMKit/WebIDL/PlaybackDirection.swift +++ b/Sources/DOMKit/WebIDL/PlaybackDirection.swift @@ -9,16 +9,16 @@ public enum PlaybackDirection: JSString, JSValueCompatible { case alternate = "alternate" case alternateReverse = "alternate-reverse" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Plugin.swift b/Sources/DOMKit/WebIDL/Plugin.swift index d92b871c..920bb6e0 100644 --- a/Sources/DOMKit/WebIDL/Plugin.swift +++ b/Sources/DOMKit/WebIDL/Plugin.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Plugin: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Plugin].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Plugin].function! } public let jsObject: JSObject @@ -28,11 +28,11 @@ public class Plugin: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> MimeType? { + @inlinable public subscript(key: Int) -> MimeType? { jsObject[key].fromJSValue() } - public subscript(key: String) -> MimeType? { + @inlinable public subscript(key: String) -> MimeType? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/PluginArray.swift b/Sources/DOMKit/WebIDL/PluginArray.swift index f23224a7..0a21853a 100644 --- a/Sources/DOMKit/WebIDL/PluginArray.swift +++ b/Sources/DOMKit/WebIDL/PluginArray.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PluginArray: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PluginArray].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PluginArray].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class PluginArray: JSBridgedClass { self.jsObject = jsObject } - public func refresh() { + @inlinable public func refresh() { let this = jsObject _ = this[Strings.refresh].function!(this: this, arguments: []) } @@ -21,11 +21,11 @@ public class PluginArray: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Plugin? { + @inlinable public subscript(key: Int) -> Plugin? { jsObject[key].fromJSValue() } - public subscript(key: String) -> Plugin? { + @inlinable public subscript(key: String) -> Plugin? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/PointerEvent.swift b/Sources/DOMKit/WebIDL/PointerEvent.swift index 9a7e98df..acd5116f 100644 --- a/Sources/DOMKit/WebIDL/PointerEvent.swift +++ b/Sources/DOMKit/WebIDL/PointerEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PointerEvent: MouseEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.PointerEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PointerEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _pointerId = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointerId) @@ -22,7 +22,7 @@ public class PointerEvent: MouseEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PointerEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: PointerEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -62,12 +62,12 @@ public class PointerEvent: MouseEvent { @ReadonlyAttribute public var isPrimary: Bool - public func getCoalescedEvents() -> [PointerEvent] { + @inlinable public func getCoalescedEvents() -> [PointerEvent] { let this = jsObject return this[Strings.getCoalescedEvents].function!(this: this, arguments: []).fromJSValue()! } - public func getPredictedEvents() -> [PointerEvent] { + @inlinable public func getPredictedEvents() -> [PointerEvent] { let this = jsObject return this[Strings.getPredictedEvents].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PopStateEvent.swift b/Sources/DOMKit/WebIDL/PopStateEvent.swift index a3e99cd0..b6fb6d13 100644 --- a/Sources/DOMKit/WebIDL/PopStateEvent.swift +++ b/Sources/DOMKit/WebIDL/PopStateEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class PopStateEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.PopStateEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PopStateEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PopStateEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: PopStateEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift index 7a9bf137..ae79c2a4 100644 --- a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift +++ b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift @@ -4,21 +4,21 @@ import JavaScriptEventLoop import JavaScriptKit public class PortalActivateEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.PortalActivateEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PortalActivateEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PortalActivateEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: PortalActivateEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @ReadonlyAttribute public var data: JSValue - public func adoptPredecessor() -> HTMLPortalElement { + @inlinable public func adoptPredecessor() -> HTMLPortalElement { let this = jsObject return this[Strings.adoptPredecessor].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PortalHost.swift b/Sources/DOMKit/WebIDL/PortalHost.swift index aacc0ceb..28457229 100644 --- a/Sources/DOMKit/WebIDL/PortalHost.swift +++ b/Sources/DOMKit/WebIDL/PortalHost.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PortalHost: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.PortalHost].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PortalHost].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) @@ -12,7 +12,7 @@ public class PortalHost: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/PositionAlignSetting.swift b/Sources/DOMKit/WebIDL/PositionAlignSetting.swift index dae1213b..3c732a68 100644 --- a/Sources/DOMKit/WebIDL/PositionAlignSetting.swift +++ b/Sources/DOMKit/WebIDL/PositionAlignSetting.swift @@ -9,16 +9,16 @@ public enum PositionAlignSetting: JSString, JSValueCompatible { case lineRight = "line-right" case auto = "auto" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift index 635ecb91..33c73a7a 100644 --- a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift +++ b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift @@ -7,16 +7,16 @@ public enum PredefinedColorSpace: JSString, JSValueCompatible { case srgb = "srgb" case displayP3 = "display-p3" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift index 811f4ce3..23f43a02 100644 --- a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift +++ b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift @@ -8,16 +8,16 @@ public enum PremultiplyAlpha: JSString, JSValueCompatible { case premultiply = "premultiply" case `default` = "default" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Presentation.swift b/Sources/DOMKit/WebIDL/Presentation.swift index a3698087..1229fa7a 100644 --- a/Sources/DOMKit/WebIDL/Presentation.swift +++ b/Sources/DOMKit/WebIDL/Presentation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Presentation: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Presentation].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Presentation].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/PresentationAvailability.swift b/Sources/DOMKit/WebIDL/PresentationAvailability.swift index d78ae070..32f52325 100644 --- a/Sources/DOMKit/WebIDL/PresentationAvailability.swift +++ b/Sources/DOMKit/WebIDL/PresentationAvailability.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PresentationAvailability: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.PresentationAvailability].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationAvailability].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) diff --git a/Sources/DOMKit/WebIDL/PresentationConnection.swift b/Sources/DOMKit/WebIDL/PresentationConnection.swift index 6155d93f..caf3d621 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnection.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PresentationConnection: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnection].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnection].function! } public required init(unsafelyWrapping jsObject: JSObject) { _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) @@ -27,12 +27,12 @@ public class PresentationConnection: EventTarget { @ReadonlyAttribute public var state: PresentationConnectionState - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public func terminate() { + @inlinable public func terminate() { let this = jsObject _ = this[Strings.terminate].function!(this: this, arguments: []) } @@ -52,22 +52,22 @@ public class PresentationConnection: EventTarget { @ClosureAttribute1Optional public var onmessage: EventHandler - public func send(message: String) { + @inlinable public func send(message: String) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [message.jsValue()]) } - public func send(data: Blob) { + @inlinable public func send(data: Blob) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } - public func send(data: ArrayBuffer) { + @inlinable public func send(data: ArrayBuffer) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } - public func send(data: ArrayBufferView) { + @inlinable public func send(data: ArrayBufferView) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift index ba2dfac9..a9231176 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class PresentationConnectionAvailableEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionAvailableEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionAvailableEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _connection = ReadonlyAttribute(jsObject: jsObject, name: Strings.connection) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PresentationConnectionAvailableEventInit) { + @inlinable public convenience init(type: String, eventInitDict: PresentationConnectionAvailableEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift index 09650da9..022539f6 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PresentationConnectionCloseEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionCloseEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionCloseEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) @@ -12,7 +12,7 @@ public class PresentationConnectionCloseEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PresentationConnectionCloseEventInit) { + @inlinable public convenience init(type: String, eventInitDict: PresentationConnectionCloseEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift index 51ed4f29..2c18e2aa 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift @@ -8,16 +8,16 @@ public enum PresentationConnectionCloseReason: JSString, JSValueCompatible { case closed = "closed" case wentaway = "wentaway" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionList.swift b/Sources/DOMKit/WebIDL/PresentationConnectionList.swift index 146d0546..3421ded4 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionList.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PresentationConnectionList: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionList].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _connections = ReadonlyAttribute(jsObject: jsObject, name: Strings.connections) diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionState.swift b/Sources/DOMKit/WebIDL/PresentationConnectionState.swift index e7a78f29..6386d3ac 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionState.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionState.swift @@ -9,16 +9,16 @@ public enum PresentationConnectionState: JSString, JSValueCompatible { case closed = "closed" case terminated = "terminated" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PresentationReceiver.swift b/Sources/DOMKit/WebIDL/PresentationReceiver.swift index 6bf2540c..500a35da 100644 --- a/Sources/DOMKit/WebIDL/PresentationReceiver.swift +++ b/Sources/DOMKit/WebIDL/PresentationReceiver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PresentationReceiver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PresentationReceiver].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PresentationReceiver].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/PresentationRequest.swift b/Sources/DOMKit/WebIDL/PresentationRequest.swift index b6b558b4..b6b4a846 100644 --- a/Sources/DOMKit/WebIDL/PresentationRequest.swift +++ b/Sources/DOMKit/WebIDL/PresentationRequest.swift @@ -4,52 +4,52 @@ import JavaScriptEventLoop import JavaScriptKit public class PresentationRequest: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.PresentationRequest].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationRequest].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onconnectionavailable = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnectionavailable) super.init(unsafelyWrapping: jsObject) } - public convenience init(url: String) { + @inlinable public convenience init(url: String) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue()])) } - public convenience init(urls: [String]) { + @inlinable public convenience init(urls: [String]) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [urls.jsValue()])) } - public func start() -> JSPromise { + @inlinable public func start() -> JSPromise { let this = jsObject return this[Strings.start].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func start() async throws -> PresentationConnection { + @inlinable public func start() async throws -> PresentationConnection { let this = jsObject let _promise: JSPromise = this[Strings.start].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func reconnect(presentationId: String) -> JSPromise { + @inlinable public func reconnect(presentationId: String) -> JSPromise { let this = jsObject return this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func reconnect(presentationId: String) async throws -> PresentationConnection { + @inlinable public func reconnect(presentationId: String) async throws -> PresentationConnection { let this = jsObject let _promise: JSPromise = this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getAvailability() -> JSPromise { + @inlinable public func getAvailability() -> JSPromise { let this = jsObject return this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getAvailability() async throws -> PresentationAvailability { + @inlinable public func getAvailability() async throws -> PresentationAvailability { let this = jsObject let _promise: JSPromise = this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/PresentationStyle.swift b/Sources/DOMKit/WebIDL/PresentationStyle.swift index ec65cf4e..cfec31dc 100644 --- a/Sources/DOMKit/WebIDL/PresentationStyle.swift +++ b/Sources/DOMKit/WebIDL/PresentationStyle.swift @@ -8,16 +8,16 @@ public enum PresentationStyle: JSString, JSValueCompatible { case inline = "inline" case attachment = "attachment" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift index f0bfad9e..bd59094c 100644 --- a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift +++ b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ProcessingInstruction: CharacterData, LinkStyle { - override public class var constructor: JSFunction { JSObject.global[Strings.ProcessingInstruction].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ProcessingInstruction].function! } public required init(unsafelyWrapping jsObject: JSObject) { _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) diff --git a/Sources/DOMKit/WebIDL/Profiler.swift b/Sources/DOMKit/WebIDL/Profiler.swift index 65bf3b5a..8e37f4af 100644 --- a/Sources/DOMKit/WebIDL/Profiler.swift +++ b/Sources/DOMKit/WebIDL/Profiler.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Profiler: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Profiler].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Profiler].function! } public required init(unsafelyWrapping jsObject: JSObject) { _sampleInterval = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleInterval) @@ -18,17 +18,17 @@ public class Profiler: EventTarget { @ReadonlyAttribute public var stopped: Bool - public convenience init(options: ProfilerInitOptions) { + @inlinable public convenience init(options: ProfilerInitOptions) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue()])) } - public func stop() -> JSPromise { + @inlinable public func stop() -> JSPromise { let this = jsObject return this[Strings.stop].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func stop() async throws -> ProfilerTrace { + @inlinable public func stop() async throws -> ProfilerTrace { let this = jsObject let _promise: JSPromise = this[Strings.stop].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ProgressEvent.swift b/Sources/DOMKit/WebIDL/ProgressEvent.swift index b58073ae..4b6c9834 100644 --- a/Sources/DOMKit/WebIDL/ProgressEvent.swift +++ b/Sources/DOMKit/WebIDL/ProgressEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ProgressEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.ProgressEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ProgressEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _lengthComputable = ReadonlyAttribute(jsObject: jsObject, name: Strings.lengthComputable) @@ -13,7 +13,7 @@ public class ProgressEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: ProgressEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: ProgressEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift index 62c74c6b..99f36dc8 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PromiseRejectionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.PromiseRejectionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PromiseRejectionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _promise = ReadonlyAttribute(jsObject: jsObject, name: Strings.promise) @@ -12,7 +12,7 @@ public class PromiseRejectionEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PromiseRejectionEventInit) { + @inlinable public convenience init(type: String, eventInitDict: PromiseRejectionEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/ProximitySensor.swift b/Sources/DOMKit/WebIDL/ProximitySensor.swift index dd77bb00..617d1085 100644 --- a/Sources/DOMKit/WebIDL/ProximitySensor.swift +++ b/Sources/DOMKit/WebIDL/ProximitySensor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ProximitySensor: Sensor { - override public class var constructor: JSFunction { JSObject.global[Strings.ProximitySensor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ProximitySensor].function! } public required init(unsafelyWrapping jsObject: JSObject) { _distance = ReadonlyAttribute(jsObject: jsObject, name: Strings.distance) @@ -13,7 +13,7 @@ public class ProximitySensor: Sensor { super.init(unsafelyWrapping: jsObject) } - public convenience init(sensorOptions: SensorOptions? = nil) { + @inlinable public convenience init(sensorOptions: SensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredential.swift b/Sources/DOMKit/WebIDL/PublicKeyCredential.swift index d59690c4..e7caef2a 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredential.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredential.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PublicKeyCredential: Credential { - override public class var constructor: JSFunction { JSObject.global[Strings.PublicKeyCredential].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PublicKeyCredential].function! } public required init(unsafelyWrapping jsObject: JSObject) { _rawId = ReadonlyAttribute(jsObject: jsObject, name: Strings.rawId) @@ -22,18 +22,18 @@ public class PublicKeyCredential: Credential { @ReadonlyAttribute public var authenticatorAttachment: String? - public func getClientExtensionResults() -> AuthenticationExtensionsClientOutputs { + @inlinable public func getClientExtensionResults() -> AuthenticationExtensionsClientOutputs { let this = jsObject return this[Strings.getClientExtensionResults].function!(this: this, arguments: []).fromJSValue()! } - public static func isUserVerifyingPlatformAuthenticatorAvailable() -> JSPromise { + @inlinable public static func isUserVerifyingPlatformAuthenticatorAvailable() -> JSPromise { let this = constructor return this[Strings.isUserVerifyingPlatformAuthenticatorAvailable].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func isUserVerifyingPlatformAuthenticatorAvailable() async throws -> Bool { + @inlinable public static func isUserVerifyingPlatformAuthenticatorAvailable() async throws -> Bool { let this = constructor let _promise: JSPromise = this[Strings.isUserVerifyingPlatformAuthenticatorAvailable].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift index 2f38b05b..25c2cbdc 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum PublicKeyCredentialType: JSString, JSValueCompatible { case publicKey = "public-key" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift b/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift index bc297e13..1815db61 100644 --- a/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift +++ b/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift @@ -7,16 +7,16 @@ public enum PushEncryptionKeyName: JSString, JSValueCompatible { case p256dh = "p256dh" case auth = "auth" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/PushEvent.swift b/Sources/DOMKit/WebIDL/PushEvent.swift index 334f9658..36e26a5b 100644 --- a/Sources/DOMKit/WebIDL/PushEvent.swift +++ b/Sources/DOMKit/WebIDL/PushEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class PushEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.PushEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PushEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PushEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: PushEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/PushManager.swift b/Sources/DOMKit/WebIDL/PushManager.swift index c2439ff3..981c6df9 100644 --- a/Sources/DOMKit/WebIDL/PushManager.swift +++ b/Sources/DOMKit/WebIDL/PushManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PushManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PushManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PushManager].function! } public let jsObject: JSObject @@ -16,37 +16,37 @@ public class PushManager: JSBridgedClass { @ReadonlyAttribute public var supportedContentEncodings: [String] - public func subscribe(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { + @inlinable public func subscribe(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { let this = jsObject return this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func subscribe(options: PushSubscriptionOptionsInit? = nil) async throws -> PushSubscription { + @inlinable public func subscribe(options: PushSubscriptionOptionsInit? = nil) async throws -> PushSubscription { let this = jsObject let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getSubscription() -> JSPromise { + @inlinable public func getSubscription() -> JSPromise { let this = jsObject return this[Strings.getSubscription].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getSubscription() async throws -> PushSubscription? { + @inlinable public func getSubscription() async throws -> PushSubscription? { let this = jsObject let _promise: JSPromise = this[Strings.getSubscription].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func permissionState(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { + @inlinable public func permissionState(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { let this = jsObject return this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func permissionState(options: PushSubscriptionOptionsInit? = nil) async throws -> PermissionState { + @inlinable public func permissionState(options: PushSubscriptionOptionsInit? = nil) async throws -> PermissionState { let this = jsObject let _promise: JSPromise = this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/PushMessageData.swift b/Sources/DOMKit/WebIDL/PushMessageData.swift index a8d39f7f..eae01b62 100644 --- a/Sources/DOMKit/WebIDL/PushMessageData.swift +++ b/Sources/DOMKit/WebIDL/PushMessageData.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PushMessageData: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PushMessageData].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PushMessageData].function! } public let jsObject: JSObject @@ -12,22 +12,22 @@ public class PushMessageData: JSBridgedClass { self.jsObject = jsObject } - public func arrayBuffer() -> ArrayBuffer { + @inlinable public func arrayBuffer() -> ArrayBuffer { let this = jsObject return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! } - public func blob() -> Blob { + @inlinable public func blob() -> Blob { let this = jsObject return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! } - public func json() -> JSValue { + @inlinable public func json() -> JSValue { let this = jsObject return this[Strings.json].function!(this: this, arguments: []).fromJSValue()! } - public func text() -> String { + @inlinable public func text() -> String { let this = jsObject return this[Strings.text].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PushSubscription.swift b/Sources/DOMKit/WebIDL/PushSubscription.swift index 46e8353a..e53339d4 100644 --- a/Sources/DOMKit/WebIDL/PushSubscription.swift +++ b/Sources/DOMKit/WebIDL/PushSubscription.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PushSubscription: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PushSubscription].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PushSubscription].function! } public let jsObject: JSObject @@ -24,24 +24,24 @@ public class PushSubscription: JSBridgedClass { @ReadonlyAttribute public var options: PushSubscriptionOptions - public func getKey(name: PushEncryptionKeyName) -> ArrayBuffer? { + @inlinable public func getKey(name: PushEncryptionKeyName) -> ArrayBuffer? { let this = jsObject return this[Strings.getKey].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func unsubscribe() -> JSPromise { + @inlinable public func unsubscribe() -> JSPromise { let this = jsObject return this[Strings.unsubscribe].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func unsubscribe() async throws -> Bool { + @inlinable public func unsubscribe() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.unsubscribe].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func toJSON() -> PushSubscriptionJSON { + @inlinable public func toJSON() -> PushSubscriptionJSON { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift index 4b255a90..7cb10473 100644 --- a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PushSubscriptionChangeEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.PushSubscriptionChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PushSubscriptionChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _newSubscription = ReadonlyAttribute(jsObject: jsObject, name: Strings.newSubscription) @@ -12,7 +12,7 @@ public class PushSubscriptionChangeEvent: ExtendableEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: PushSubscriptionChangeEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: PushSubscriptionChangeEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift b/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift index 2ac54865..5905641c 100644 --- a/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift +++ b/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PushSubscriptionOptions: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.PushSubscriptionOptions].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PushSubscriptionOptions].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift b/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift index 17700a11..e8a29c0d 100644 --- a/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift +++ b/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift @@ -8,16 +8,16 @@ public enum RTCBundlePolicy: JSString, JSValueCompatible { case maxCompat = "max-compat" case maxBundle = "max-bundle" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCCertificate.swift b/Sources/DOMKit/WebIDL/RTCCertificate.swift index 1497aff4..3b48033f 100644 --- a/Sources/DOMKit/WebIDL/RTCCertificate.swift +++ b/Sources/DOMKit/WebIDL/RTCCertificate.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCCertificate: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCCertificate].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCCertificate].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class RTCCertificate: JSBridgedClass { @ReadonlyAttribute public var expires: EpochTimeStamp - public func getFingerprints() -> [RTCDtlsFingerprint] { + @inlinable public func getFingerprints() -> [RTCDtlsFingerprint] { let this = jsObject return this[Strings.getFingerprints].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RTCCodecType.swift b/Sources/DOMKit/WebIDL/RTCCodecType.swift index 208b875c..2edea590 100644 --- a/Sources/DOMKit/WebIDL/RTCCodecType.swift +++ b/Sources/DOMKit/WebIDL/RTCCodecType.swift @@ -7,16 +7,16 @@ public enum RTCCodecType: JSString, JSValueCompatible { case encode = "encode" case decode = "decode" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift index 9e186ff0..33913253 100644 --- a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift +++ b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCDTMFSender: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCDTMFSender].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDTMFSender].function! } public required init(unsafelyWrapping jsObject: JSObject) { _ontonechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontonechange) @@ -13,7 +13,7 @@ public class RTCDTMFSender: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func insertDTMF(tones: String, duration: UInt32? = nil, interToneGap: UInt32? = nil) { + @inlinable public func insertDTMF(tones: String, duration: UInt32? = nil, interToneGap: UInt32? = nil) { let this = jsObject _ = this[Strings.insertDTMF].function!(this: this, arguments: [tones.jsValue(), duration?.jsValue() ?? .undefined, interToneGap?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift index 87611d9f..f0a1fedd 100644 --- a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCDTMFToneChangeEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCDTMFToneChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDTMFToneChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _tone = ReadonlyAttribute(jsObject: jsObject, name: Strings.tone) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: RTCDTMFToneChangeEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: RTCDTMFToneChangeEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannel.swift b/Sources/DOMKit/WebIDL/RTCDataChannel.swift index b32eab17..6ead5a92 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannel.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannel.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCDataChannel: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCDataChannel].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDataChannel].function! } public required init(unsafelyWrapping jsObject: JSObject) { _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) @@ -76,7 +76,7 @@ public class RTCDataChannel: EventTarget { @ClosureAttribute1Optional public var onclose: EventHandler - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } @@ -87,22 +87,22 @@ public class RTCDataChannel: EventTarget { @ReadWriteAttribute public var binaryType: BinaryType - public func send(data: String) { + @inlinable public func send(data: String) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } - public func send(data: Blob) { + @inlinable public func send(data: Blob) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } - public func send(data: ArrayBuffer) { + @inlinable public func send(data: ArrayBuffer) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } - public func send(data: ArrayBufferView) { + @inlinable public func send(data: ArrayBufferView) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift b/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift index 803f53c4..f0143459 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCDataChannelEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCDataChannelEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDataChannelEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _channel = ReadonlyAttribute(jsObject: jsObject, name: Strings.channel) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: RTCDataChannelEventInit) { + @inlinable public convenience init(type: String, eventInitDict: RTCDataChannelEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelState.swift b/Sources/DOMKit/WebIDL/RTCDataChannelState.swift index 2bc0265d..4d7e2f0e 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannelState.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannelState.swift @@ -9,16 +9,16 @@ public enum RTCDataChannelState: JSString, JSValueCompatible { case closing = "closing" case closed = "closed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift b/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift index 6c1b0f05..63519424 100644 --- a/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift +++ b/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift @@ -8,16 +8,16 @@ public enum RTCDegradationPreference: JSString, JSValueCompatible { case maintainResolution = "maintain-resolution" case balanced = "balanced" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift b/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift index 7037554f..8b93485b 100644 --- a/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCDtlsTransport: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCDtlsTransport].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDtlsTransport].function! } public required init(unsafelyWrapping jsObject: JSObject) { _iceTransport = ReadonlyAttribute(jsObject: jsObject, name: Strings.iceTransport) @@ -20,7 +20,7 @@ public class RTCDtlsTransport: EventTarget { @ReadonlyAttribute public var state: RTCDtlsTransportState - public func getRemoteCertificates() -> [ArrayBuffer] { + @inlinable public func getRemoteCertificates() -> [ArrayBuffer] { let this = jsObject return this[Strings.getRemoteCertificates].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift b/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift index 0c161975..d847d4f9 100644 --- a/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift +++ b/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift @@ -10,16 +10,16 @@ public enum RTCDtlsTransportState: JSString, JSValueCompatible { case closed = "closed" case failed = "failed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift index 1a87734e..481f3b20 100644 --- a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift +++ b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCEncodedAudioFrame: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCEncodedAudioFrame].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCEncodedAudioFrame].function! } public let jsObject: JSObject @@ -20,7 +20,7 @@ public class RTCEncodedAudioFrame: JSBridgedClass { @ReadWriteAttribute public var data: ArrayBuffer - public func getMetadata() -> RTCEncodedAudioFrameMetadata { + @inlinable public func getMetadata() -> RTCEncodedAudioFrameMetadata { let this = jsObject return this[Strings.getMetadata].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift index 7d0029ff..5b8ef715 100644 --- a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift +++ b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCEncodedVideoFrame: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCEncodedVideoFrame].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCEncodedVideoFrame].function! } public let jsObject: JSObject @@ -24,7 +24,7 @@ public class RTCEncodedVideoFrame: JSBridgedClass { @ReadWriteAttribute public var data: ArrayBuffer - public func getMetadata() -> RTCEncodedVideoFrameMetadata { + @inlinable public func getMetadata() -> RTCEncodedVideoFrameMetadata { let this = jsObject return this[Strings.getMetadata].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift index 9a68f40e..ada428ab 100644 --- a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift +++ b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift @@ -8,16 +8,16 @@ public enum RTCEncodedVideoFrameType: JSString, JSValueCompatible { case key = "key" case delta = "delta" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCError.swift b/Sources/DOMKit/WebIDL/RTCError.swift index 234fea76..7399daba 100644 --- a/Sources/DOMKit/WebIDL/RTCError.swift +++ b/Sources/DOMKit/WebIDL/RTCError.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCError: DOMException { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCError].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCError].function! } public required init(unsafelyWrapping jsObject: JSObject) { _httpRequestStatusCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.httpRequestStatusCode) @@ -19,7 +19,7 @@ public class RTCError: DOMException { @ReadonlyAttribute public var httpRequestStatusCode: Int32? - public convenience init(init: RTCErrorInit, message: String? = nil) { + @inlinable public convenience init(init: RTCErrorInit, message: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue(), message?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift b/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift index b42e3b42..cf32e04f 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift @@ -12,16 +12,16 @@ public enum RTCErrorDetailType: JSString, JSValueCompatible { case hardwareEncoderNotAvailable = "hardware-encoder-not-available" case hardwareEncoderError = "hardware-encoder-error" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift b/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift index 5c4c2ef0..918eebea 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift @@ -13,16 +13,16 @@ public enum RTCErrorDetailTypeIdp: JSString, JSValueCompatible { case idpTokenExpired = "idp-token-expired" case idpTokenInvalid = "idp-token-invalid" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCErrorEvent.swift index 7ae49d81..3fa3d4e2 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCErrorEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCErrorEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCErrorEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: RTCErrorEventInit) { + @inlinable public convenience init(type: String, eventInitDict: RTCErrorEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift index 8081ad46..dc1b1fec 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCIceCandidate: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCIceCandidate].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCIceCandidate].function! } public let jsObject: JSObject @@ -26,7 +26,7 @@ public class RTCIceCandidate: JSBridgedClass { self.jsObject = jsObject } - public convenience init(candidateInitDict: RTCIceCandidateInit? = nil) { + @inlinable public convenience init(candidateInitDict: RTCIceCandidateInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [candidateInitDict?.jsValue() ?? .undefined])) } @@ -72,7 +72,7 @@ public class RTCIceCandidate: JSBridgedClass { @ReadonlyAttribute public var usernameFragment: String? - public func toJSON() -> RTCIceCandidateInit { + @inlinable public func toJSON() -> RTCIceCandidateInit { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift index cee743aa..486f874b 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift @@ -9,16 +9,16 @@ public enum RTCIceCandidateType: JSString, JSValueCompatible { case prflx = "prflx" case relay = "relay" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceComponent.swift b/Sources/DOMKit/WebIDL/RTCIceComponent.swift index 6148d036..53e5c14d 100644 --- a/Sources/DOMKit/WebIDL/RTCIceComponent.swift +++ b/Sources/DOMKit/WebIDL/RTCIceComponent.swift @@ -7,16 +7,16 @@ public enum RTCIceComponent: JSString, JSValueCompatible { case rtp = "rtp" case rtcp = "rtcp" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift b/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift index 91cec9f3..dfcf61e7 100644 --- a/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift +++ b/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift @@ -12,16 +12,16 @@ public enum RTCIceConnectionState: JSString, JSValueCompatible { case completed = "completed" case connected = "connected" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift b/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift index a627df68..f1583e38 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum RTCIceCredentialType: JSString, JSValueCompatible { case password = "password" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceGathererState.swift b/Sources/DOMKit/WebIDL/RTCIceGathererState.swift index b20a0808..970e986d 100644 --- a/Sources/DOMKit/WebIDL/RTCIceGathererState.swift +++ b/Sources/DOMKit/WebIDL/RTCIceGathererState.swift @@ -8,16 +8,16 @@ public enum RTCIceGathererState: JSString, JSValueCompatible { case gathering = "gathering" case complete = "complete" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift b/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift index 0adc7eec..6ae7eb5c 100644 --- a/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift +++ b/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift @@ -8,16 +8,16 @@ public enum RTCIceGatheringState: JSString, JSValueCompatible { case gathering = "gathering" case complete = "complete" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceProtocol.swift b/Sources/DOMKit/WebIDL/RTCIceProtocol.swift index 638c8af0..bd91c90a 100644 --- a/Sources/DOMKit/WebIDL/RTCIceProtocol.swift +++ b/Sources/DOMKit/WebIDL/RTCIceProtocol.swift @@ -7,16 +7,16 @@ public enum RTCIceProtocol: JSString, JSValueCompatible { case udp = "udp" case tcp = "tcp" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceRole.swift b/Sources/DOMKit/WebIDL/RTCIceRole.swift index 2205993a..49d11ae1 100644 --- a/Sources/DOMKit/WebIDL/RTCIceRole.swift +++ b/Sources/DOMKit/WebIDL/RTCIceRole.swift @@ -8,16 +8,16 @@ public enum RTCIceRole: JSString, JSValueCompatible { case controlling = "controlling" case controlled = "controlled" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift b/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift index 584d3636..4df144f2 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift @@ -8,16 +8,16 @@ public enum RTCIceTcpCandidateType: JSString, JSValueCompatible { case passive = "passive" case so = "so" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceTransport.swift b/Sources/DOMKit/WebIDL/RTCIceTransport.swift index c8eb263f..72922dcd 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransport.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCIceTransport: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCIceTransport].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCIceTransport].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) @@ -19,26 +19,26 @@ public class RTCIceTransport: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public func gather(options: RTCIceGatherOptions? = nil) { + @inlinable public func gather(options: RTCIceGatherOptions? = nil) { let this = jsObject _ = this[Strings.gather].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } - public func start(remoteParameters: RTCIceParameters? = nil, role: RTCIceRole? = nil) { + @inlinable public func start(remoteParameters: RTCIceParameters? = nil, role: RTCIceRole? = nil) { let this = jsObject _ = this[Strings.start].function!(this: this, arguments: [remoteParameters?.jsValue() ?? .undefined, role?.jsValue() ?? .undefined]) } - public func stop() { + @inlinable public func stop() { let this = jsObject _ = this[Strings.stop].function!(this: this, arguments: []) } - public func addRemoteCandidate(remoteCandidate: RTCIceCandidateInit? = nil) { + @inlinable public func addRemoteCandidate(remoteCandidate: RTCIceCandidateInit? = nil) { let this = jsObject _ = this[Strings.addRemoteCandidate].function!(this: this, arguments: [remoteCandidate?.jsValue() ?? .undefined]) } @@ -61,27 +61,27 @@ public class RTCIceTransport: EventTarget { @ReadonlyAttribute public var gatheringState: RTCIceGathererState - public func getLocalCandidates() -> [RTCIceCandidate] { + @inlinable public func getLocalCandidates() -> [RTCIceCandidate] { let this = jsObject return this[Strings.getLocalCandidates].function!(this: this, arguments: []).fromJSValue()! } - public func getRemoteCandidates() -> [RTCIceCandidate] { + @inlinable public func getRemoteCandidates() -> [RTCIceCandidate] { let this = jsObject return this[Strings.getRemoteCandidates].function!(this: this, arguments: []).fromJSValue()! } - public func getSelectedCandidatePair() -> RTCIceCandidatePair? { + @inlinable public func getSelectedCandidatePair() -> RTCIceCandidatePair? { let this = jsObject return this[Strings.getSelectedCandidatePair].function!(this: this, arguments: []).fromJSValue()! } - public func getLocalParameters() -> RTCIceParameters? { + @inlinable public func getLocalParameters() -> RTCIceParameters? { let this = jsObject return this[Strings.getLocalParameters].function!(this: this, arguments: []).fromJSValue()! } - public func getRemoteParameters() -> RTCIceParameters? { + @inlinable public func getRemoteParameters() -> RTCIceParameters? { let this = jsObject return this[Strings.getRemoteParameters].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift b/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift index e72d4952..00faedc5 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift @@ -7,16 +7,16 @@ public enum RTCIceTransportPolicy: JSString, JSValueCompatible { case relay = "relay" case all = "all" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIceTransportState.swift b/Sources/DOMKit/WebIDL/RTCIceTransportState.swift index 778296f2..54d51c30 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransportState.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransportState.swift @@ -12,16 +12,16 @@ public enum RTCIceTransportState: JSString, JSValueCompatible { case failed = "failed" case closed = "closed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift b/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift index e80ed4fc..1e0589b3 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCIdentityAssertion: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityAssertion].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityAssertion].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class RTCIdentityAssertion: JSBridgedClass { self.jsObject = jsObject } - public convenience init(idp: String, name: String) { + @inlinable public convenience init(idp: String, name: String) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [idp.jsValue(), name.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift index 5375e384..8cab70b2 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCIdentityProviderGlobalScope: WorkerGlobalScope { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityProviderGlobalScope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityProviderGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _rtcIdentityProvider = ReadonlyAttribute(jsObject: jsObject, name: Strings.rtcIdentityProvider) diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift index 3b76b3a7..bf313649 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCIdentityProviderRegistrar: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityProviderRegistrar].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityProviderRegistrar].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class RTCIdentityProviderRegistrar: JSBridgedClass { self.jsObject = jsObject } - public func register(idp: RTCIdentityProvider) { + @inlinable public func register(idp: RTCIdentityProvider) { let this = jsObject _ = this[Strings.register].function!(this: this, arguments: [idp.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift index f6677794..1fc28aeb 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCPeerConnection: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnection].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnection].function! } public required init(unsafelyWrapping jsObject: JSObject) { _peerIdentity = ReadonlyAttribute(jsObject: jsObject, name: Strings.peerIdentity) @@ -34,18 +34,18 @@ public class RTCPeerConnection: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func setIdentityProvider(provider: String, options: RTCIdentityProviderOptions? = nil) { + @inlinable public func setIdentityProvider(provider: String, options: RTCIdentityProviderOptions? = nil) { let this = jsObject _ = this[Strings.setIdentityProvider].function!(this: this, arguments: [provider.jsValue(), options?.jsValue() ?? .undefined]) } - public func getIdentityAssertion() -> JSPromise { + @inlinable public func getIdentityAssertion() -> JSPromise { let this = jsObject return this[Strings.getIdentityAssertion].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getIdentityAssertion() async throws -> String { + @inlinable public func getIdentityAssertion() async throws -> String { let this = jsObject let _promise: JSPromise = this[Strings.getIdentityAssertion].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -60,7 +60,7 @@ public class RTCPeerConnection: EventTarget { @ReadonlyAttribute public var idpErrorInfo: String? - public convenience init(configuration: RTCConfiguration? = nil) { + @inlinable public convenience init(configuration: RTCConfiguration? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration?.jsValue() ?? .undefined])) } @@ -117,22 +117,22 @@ public class RTCPeerConnection: EventTarget { @ReadonlyAttribute public var canTrickleIceCandidates: Bool? - public func restartIce() { + @inlinable public func restartIce() { let this = jsObject _ = this[Strings.restartIce].function!(this: this, arguments: []) } - public func getConfiguration() -> RTCConfiguration { + @inlinable public func getConfiguration() -> RTCConfiguration { let this = jsObject return this[Strings.getConfiguration].function!(this: this, arguments: []).fromJSValue()! } - public func setConfiguration(configuration: RTCConfiguration? = nil) { + @inlinable public func setConfiguration(configuration: RTCConfiguration? = nil) { let this = jsObject _ = this[Strings.setConfiguration].function!(this: this, arguments: [configuration?.jsValue() ?? .undefined]) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } @@ -178,44 +178,44 @@ public class RTCPeerConnection: EventTarget { // XXX: member 'addIceCandidate' is ignored - public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) -> JSPromise { + @inlinable public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) -> JSPromise { let this = constructor return this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) async throws -> RTCCertificate { + @inlinable public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) async throws -> RTCCertificate { let this = constructor let _promise: JSPromise = this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getSenders() -> [RTCRtpSender] { + @inlinable public func getSenders() -> [RTCRtpSender] { let this = jsObject return this[Strings.getSenders].function!(this: this, arguments: []).fromJSValue()! } - public func getReceivers() -> [RTCRtpReceiver] { + @inlinable public func getReceivers() -> [RTCRtpReceiver] { let this = jsObject return this[Strings.getReceivers].function!(this: this, arguments: []).fromJSValue()! } - public func getTransceivers() -> [RTCRtpTransceiver] { + @inlinable public func getTransceivers() -> [RTCRtpTransceiver] { let this = jsObject return this[Strings.getTransceivers].function!(this: this, arguments: []).fromJSValue()! } - public func addTrack(track: MediaStreamTrack, streams: MediaStream...) -> RTCRtpSender { + @inlinable public func addTrack(track: MediaStreamTrack, streams: MediaStream...) -> RTCRtpSender { let this = jsObject return this[Strings.addTrack].function!(this: this, arguments: [track.jsValue()] + streams.map { $0.jsValue() }).fromJSValue()! } - public func removeTrack(sender: RTCRtpSender) { + @inlinable public func removeTrack(sender: RTCRtpSender) { let this = jsObject _ = this[Strings.removeTrack].function!(this: this, arguments: [sender.jsValue()]) } - public func addTransceiver(trackOrKind: __UNSUPPORTED_UNION__, init: RTCRtpTransceiverInit? = nil) -> RTCRtpTransceiver { + @inlinable public func addTransceiver(trackOrKind: __UNSUPPORTED_UNION__, init: RTCRtpTransceiverInit? = nil) -> RTCRtpTransceiver { let this = jsObject return this[Strings.addTransceiver].function!(this: this, arguments: [trackOrKind.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } @@ -226,7 +226,7 @@ public class RTCPeerConnection: EventTarget { @ReadonlyAttribute public var sctp: RTCSctpTransport? - public func createDataChannel(label: String, dataChannelDict: RTCDataChannelInit? = nil) -> RTCDataChannel { + @inlinable public func createDataChannel(label: String, dataChannelDict: RTCDataChannelInit? = nil) -> RTCDataChannel { let this = jsObject return this[Strings.createDataChannel].function!(this: this, arguments: [label.jsValue(), dataChannelDict?.jsValue() ?? .undefined]).fromJSValue()! } @@ -234,13 +234,13 @@ public class RTCPeerConnection: EventTarget { @ClosureAttribute1Optional public var ondatachannel: EventHandler - public func getStats(selector: MediaStreamTrack? = nil) -> JSPromise { + @inlinable public func getStats(selector: MediaStreamTrack? = nil) -> JSPromise { let this = jsObject return this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getStats(selector: MediaStreamTrack? = nil) async throws -> RTCStatsReport { + @inlinable public func getStats(selector: MediaStreamTrack? = nil) async throws -> RTCStatsReport { let this = jsObject let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift index 72c83081..32d6406b 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCPeerConnectionIceErrorEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnectionIceErrorEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnectionIceErrorEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _address = ReadonlyAttribute(jsObject: jsObject, name: Strings.address) @@ -15,7 +15,7 @@ public class RTCPeerConnectionIceErrorEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: RTCPeerConnectionIceErrorEventInit) { + @inlinable public convenience init(type: String, eventInitDict: RTCPeerConnectionIceErrorEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift index 7c617b68..7ebbd607 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCPeerConnectionIceEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnectionIceEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnectionIceEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _candidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.candidate) @@ -12,7 +12,7 @@ public class RTCPeerConnectionIceEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: RTCPeerConnectionIceEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: RTCPeerConnectionIceEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift index 42b569f7..e5979acf 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift @@ -11,16 +11,16 @@ public enum RTCPeerConnectionState: JSString, JSValueCompatible { case connecting = "connecting" case connected = "connected" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCPriorityType.swift b/Sources/DOMKit/WebIDL/RTCPriorityType.swift index 7a1b4c2c..db5d09c3 100644 --- a/Sources/DOMKit/WebIDL/RTCPriorityType.swift +++ b/Sources/DOMKit/WebIDL/RTCPriorityType.swift @@ -9,16 +9,16 @@ public enum RTCPriorityType: JSString, JSValueCompatible { case medium = "medium" case high = "high" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift b/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift index 8a308ba5..b2984b39 100644 --- a/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift +++ b/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift @@ -9,16 +9,16 @@ public enum RTCQualityLimitationReason: JSString, JSValueCompatible { case bandwidth = "bandwidth" case other = "other" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift b/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift index 07045ba6..980ed57e 100644 --- a/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift +++ b/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum RTCRtcpMuxPolicy: JSString, JSValueCompatible { case require = "require" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift index 5d356130..c5187bd5 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCRtpReceiver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpReceiver].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpReceiver].function! } public let jsObject: JSObject @@ -24,33 +24,33 @@ public class RTCRtpReceiver: JSBridgedClass { @ReadonlyAttribute public var transport: RTCDtlsTransport? - public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { + @inlinable public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { let this = constructor return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue()]).fromJSValue()! } - public func getParameters() -> RTCRtpReceiveParameters { + @inlinable public func getParameters() -> RTCRtpReceiveParameters { let this = jsObject return this[Strings.getParameters].function!(this: this, arguments: []).fromJSValue()! } - public func getContributingSources() -> [RTCRtpContributingSource] { + @inlinable public func getContributingSources() -> [RTCRtpContributingSource] { let this = jsObject return this[Strings.getContributingSources].function!(this: this, arguments: []).fromJSValue()! } - public func getSynchronizationSources() -> [RTCRtpSynchronizationSource] { + @inlinable public func getSynchronizationSources() -> [RTCRtpSynchronizationSource] { let this = jsObject return this[Strings.getSynchronizationSources].function!(this: this, arguments: []).fromJSValue()! } - public func getStats() -> JSPromise { + @inlinable public func getStats() -> JSPromise { let this = jsObject return this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getStats() async throws -> RTCStatsReport { + @inlinable public func getStats() async throws -> RTCStatsReport { let this = jsObject let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift index 9bdf3866..c87c2171 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCRtpScriptTransform: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpScriptTransform].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpScriptTransform].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class RTCRtpScriptTransform: JSBridgedClass { self.jsObject = jsObject } - public convenience init(worker: Worker, options: JSValue? = nil, transfer: [JSObject]? = nil) { + @inlinable public convenience init(worker: Worker, options: JSValue? = nil, transfer: [JSObject]? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [worker.jsValue(), options?.jsValue() ?? .undefined, transfer?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift index f3ae8996..e03e4018 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCRtpScriptTransformer: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpScriptTransformer].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpScriptTransformer].function! } public let jsObject: JSObject @@ -24,25 +24,25 @@ public class RTCRtpScriptTransformer: JSBridgedClass { @ReadonlyAttribute public var options: JSValue - public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { + @inlinable public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { let this = jsObject return this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func generateKeyFrame(rids: [String]? = nil) async throws { + @inlinable public func generateKeyFrame(rids: [String]? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func sendKeyFrameRequest() -> JSPromise { + @inlinable public func sendKeyFrameRequest() -> JSPromise { let this = jsObject return this[Strings.sendKeyFrameRequest].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func sendKeyFrameRequest() async throws { + @inlinable public func sendKeyFrameRequest() async throws { let this = jsObject let _promise: JSPromise = this[Strings.sendKeyFrameRequest].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/RTCRtpSender.swift b/Sources/DOMKit/WebIDL/RTCRtpSender.swift index 31dd2e01..71cfad00 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpSender.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpSender.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCRtpSender: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpSender].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpSender].function! } public let jsObject: JSObject @@ -19,13 +19,13 @@ public class RTCRtpSender: JSBridgedClass { @ReadWriteAttribute public var transform: RTCRtpTransform? - public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { + @inlinable public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { let this = jsObject return this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func generateKeyFrame(rids: [String]? = nil) async throws { + @inlinable public func generateKeyFrame(rids: [String]? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() @@ -37,52 +37,52 @@ public class RTCRtpSender: JSBridgedClass { @ReadonlyAttribute public var transport: RTCDtlsTransport? - public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { + @inlinable public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { let this = constructor return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue()]).fromJSValue()! } - public func setParameters(parameters: RTCRtpSendParameters) -> JSPromise { + @inlinable public func setParameters(parameters: RTCRtpSendParameters) -> JSPromise { let this = jsObject return this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setParameters(parameters: RTCRtpSendParameters) async throws { + @inlinable public func setParameters(parameters: RTCRtpSendParameters) async throws { let this = jsObject let _promise: JSPromise = this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func getParameters() -> RTCRtpSendParameters { + @inlinable public func getParameters() -> RTCRtpSendParameters { let this = jsObject return this[Strings.getParameters].function!(this: this, arguments: []).fromJSValue()! } - public func replaceTrack(withTrack: MediaStreamTrack?) -> JSPromise { + @inlinable public func replaceTrack(withTrack: MediaStreamTrack?) -> JSPromise { let this = jsObject return this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func replaceTrack(withTrack: MediaStreamTrack?) async throws { + @inlinable public func replaceTrack(withTrack: MediaStreamTrack?) async throws { let this = jsObject let _promise: JSPromise = this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func setStreams(streams: MediaStream...) { + @inlinable public func setStreams(streams: MediaStream...) { let this = jsObject _ = this[Strings.setStreams].function!(this: this, arguments: streams.map { $0.jsValue() }) } - public func getStats() -> JSPromise { + @inlinable public func getStats() -> JSPromise { let this = jsObject return this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getStats() async throws -> RTCStatsReport { + @inlinable public func getStats() async throws -> RTCStatsReport { let this = jsObject let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift index bacef299..6551f37d 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCRtpTransceiver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpTransceiver].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpTransceiver].function! } public let jsObject: JSObject @@ -32,12 +32,12 @@ public class RTCRtpTransceiver: JSBridgedClass { @ReadonlyAttribute public var currentDirection: RTCRtpTransceiverDirection? - public func stop() { + @inlinable public func stop() { let this = jsObject _ = this[Strings.stop].function!(this: this, arguments: []) } - public func setCodecPreferences(codecs: [RTCRtpCodecCapability]) { + @inlinable public func setCodecPreferences(codecs: [RTCRtpCodecCapability]) { let this = jsObject _ = this[Strings.setCodecPreferences].function!(this: this, arguments: [codecs.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift index 34f7c804..4071ae96 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift @@ -10,16 +10,16 @@ public enum RTCRtpTransceiverDirection: JSString, JSValueCompatible { case inactive = "inactive" case stopped = "stopped" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransport.swift b/Sources/DOMKit/WebIDL/RTCSctpTransport.swift index 35daba02..b3b2103a 100644 --- a/Sources/DOMKit/WebIDL/RTCSctpTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCSctpTransport.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCSctpTransport: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCSctpTransport].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCSctpTransport].function! } public required init(unsafelyWrapping jsObject: JSObject) { _transport = ReadonlyAttribute(jsObject: jsObject, name: Strings.transport) diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift b/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift index 2d7128dc..47a0345f 100644 --- a/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift +++ b/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift @@ -8,16 +8,16 @@ public enum RTCSctpTransportState: JSString, JSValueCompatible { case connected = "connected" case closed = "closed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCSdpType.swift b/Sources/DOMKit/WebIDL/RTCSdpType.swift index 4c9a0ea6..69d0741a 100644 --- a/Sources/DOMKit/WebIDL/RTCSdpType.swift +++ b/Sources/DOMKit/WebIDL/RTCSdpType.swift @@ -9,16 +9,16 @@ public enum RTCSdpType: JSString, JSValueCompatible { case answer = "answer" case rollback = "rollback" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift index a0f812ed..27e5c6f8 100644 --- a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift +++ b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCSessionDescription: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCSessionDescription].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCSessionDescription].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class RTCSessionDescription: JSBridgedClass { self.jsObject = jsObject } - public convenience init(descriptionInitDict: RTCSessionDescriptionInit) { + @inlinable public convenience init(descriptionInitDict: RTCSessionDescriptionInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptionInitDict.jsValue()])) } @@ -24,7 +24,7 @@ public class RTCSessionDescription: JSBridgedClass { @ReadonlyAttribute public var sdp: String - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RTCSignalingState.swift b/Sources/DOMKit/WebIDL/RTCSignalingState.swift index f909a070..dd6136bf 100644 --- a/Sources/DOMKit/WebIDL/RTCSignalingState.swift +++ b/Sources/DOMKit/WebIDL/RTCSignalingState.swift @@ -11,16 +11,16 @@ public enum RTCSignalingState: JSString, JSValueCompatible { case haveRemotePranswer = "have-remote-pranswer" case closed = "closed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift b/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift index 20e1ae73..c7cf618d 100644 --- a/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift +++ b/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift @@ -10,16 +10,16 @@ public enum RTCStatsIceCandidatePairState: JSString, JSValueCompatible { case failed = "failed" case succeeded = "succeeded" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCStatsReport.swift b/Sources/DOMKit/WebIDL/RTCStatsReport.swift index b0dc4758..3961eebe 100644 --- a/Sources/DOMKit/WebIDL/RTCStatsReport.swift +++ b/Sources/DOMKit/WebIDL/RTCStatsReport.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCStatsReport: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.RTCStatsReport].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCStatsReport].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/RTCStatsType.swift b/Sources/DOMKit/WebIDL/RTCStatsType.swift index 1715dbf5..6ff7802b 100644 --- a/Sources/DOMKit/WebIDL/RTCStatsType.swift +++ b/Sources/DOMKit/WebIDL/RTCStatsType.swift @@ -26,16 +26,16 @@ public enum RTCStatsType: JSString, JSValueCompatible { case certificate = "certificate" case iceServer = "ice-server" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RTCTrackEvent.swift b/Sources/DOMKit/WebIDL/RTCTrackEvent.swift index 748e7a9b..0067a094 100644 --- a/Sources/DOMKit/WebIDL/RTCTrackEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCTrackEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCTrackEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCTrackEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCTrackEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _receiver = ReadonlyAttribute(jsObject: jsObject, name: Strings.receiver) @@ -14,7 +14,7 @@ public class RTCTrackEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: RTCTrackEventInit) { + @inlinable public convenience init(type: String, eventInitDict: RTCTrackEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/RTCTransformEvent.swift b/Sources/DOMKit/WebIDL/RTCTransformEvent.swift index 2f0f6f36..1ec8f799 100644 --- a/Sources/DOMKit/WebIDL/RTCTransformEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCTransformEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCTransformEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.RTCTransformEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCTransformEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _transformer = ReadonlyAttribute(jsObject: jsObject, name: Strings.transformer) diff --git a/Sources/DOMKit/WebIDL/RadioNodeList.swift b/Sources/DOMKit/WebIDL/RadioNodeList.swift index 777c20c2..60a188a6 100644 --- a/Sources/DOMKit/WebIDL/RadioNodeList.swift +++ b/Sources/DOMKit/WebIDL/RadioNodeList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RadioNodeList: NodeList { - override public class var constructor: JSFunction { JSObject.global[Strings.RadioNodeList].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RadioNodeList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index e19240f3..9b14c6d7 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -4,76 +4,76 @@ import JavaScriptEventLoop import JavaScriptKit public class Range: AbstractRange { - override public class var constructor: JSFunction { JSObject.global[Strings.Range].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Range].function! } public required init(unsafelyWrapping jsObject: JSObject) { _commonAncestorContainer = ReadonlyAttribute(jsObject: jsObject, name: Strings.commonAncestorContainer) super.init(unsafelyWrapping: jsObject) } - public func createContextualFragment(fragment: String) -> DocumentFragment { + @inlinable public func createContextualFragment(fragment: String) -> DocumentFragment { let this = jsObject return this[Strings.createContextualFragment].function!(this: this, arguments: [fragment.jsValue()]).fromJSValue()! } - public func getClientRects() -> DOMRectList { + @inlinable public func getClientRects() -> DOMRectList { let this = jsObject return this[Strings.getClientRects].function!(this: this, arguments: []).fromJSValue()! } - public func getBoundingClientRect() -> DOMRect { + @inlinable public func getBoundingClientRect() -> DOMRect { let this = jsObject return this[Strings.getBoundingClientRect].function!(this: this, arguments: []).fromJSValue()! } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute public var commonAncestorContainer: Node - public func setStart(node: Node, offset: UInt32) { + @inlinable public func setStart(node: Node, offset: UInt32) { let this = jsObject _ = this[Strings.setStart].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]) } - public func setEnd(node: Node, offset: UInt32) { + @inlinable public func setEnd(node: Node, offset: UInt32) { let this = jsObject _ = this[Strings.setEnd].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]) } - public func setStartBefore(node: Node) { + @inlinable public func setStartBefore(node: Node) { let this = jsObject _ = this[Strings.setStartBefore].function!(this: this, arguments: [node.jsValue()]) } - public func setStartAfter(node: Node) { + @inlinable public func setStartAfter(node: Node) { let this = jsObject _ = this[Strings.setStartAfter].function!(this: this, arguments: [node.jsValue()]) } - public func setEndBefore(node: Node) { + @inlinable public func setEndBefore(node: Node) { let this = jsObject _ = this[Strings.setEndBefore].function!(this: this, arguments: [node.jsValue()]) } - public func setEndAfter(node: Node) { + @inlinable public func setEndAfter(node: Node) { let this = jsObject _ = this[Strings.setEndAfter].function!(this: this, arguments: [node.jsValue()]) } - public func collapse(toStart: Bool? = nil) { + @inlinable public func collapse(toStart: Bool? = nil) { let this = jsObject _ = this[Strings.collapse].function!(this: this, arguments: [toStart?.jsValue() ?? .undefined]) } - public func selectNode(node: Node) { + @inlinable public func selectNode(node: Node) { let this = jsObject _ = this[Strings.selectNode].function!(this: this, arguments: [node.jsValue()]) } - public func selectNodeContents(node: Node) { + @inlinable public func selectNodeContents(node: Node) { let this = jsObject _ = this[Strings.selectNodeContents].function!(this: this, arguments: [node.jsValue()]) } @@ -86,62 +86,62 @@ public class Range: AbstractRange { public static let END_TO_START: UInt16 = 3 - public func compareBoundaryPoints(how: UInt16, sourceRange: Range) -> Int16 { + @inlinable public func compareBoundaryPoints(how: UInt16, sourceRange: Range) -> Int16 { let this = jsObject return this[Strings.compareBoundaryPoints].function!(this: this, arguments: [how.jsValue(), sourceRange.jsValue()]).fromJSValue()! } - public func deleteContents() { + @inlinable public func deleteContents() { let this = jsObject _ = this[Strings.deleteContents].function!(this: this, arguments: []) } - public func extractContents() -> DocumentFragment { + @inlinable public func extractContents() -> DocumentFragment { let this = jsObject return this[Strings.extractContents].function!(this: this, arguments: []).fromJSValue()! } - public func cloneContents() -> DocumentFragment { + @inlinable public func cloneContents() -> DocumentFragment { let this = jsObject return this[Strings.cloneContents].function!(this: this, arguments: []).fromJSValue()! } - public func insertNode(node: Node) { + @inlinable public func insertNode(node: Node) { let this = jsObject _ = this[Strings.insertNode].function!(this: this, arguments: [node.jsValue()]) } - public func surroundContents(newParent: Node) { + @inlinable public func surroundContents(newParent: Node) { let this = jsObject _ = this[Strings.surroundContents].function!(this: this, arguments: [newParent.jsValue()]) } - public func cloneRange() -> Self { + @inlinable public func cloneRange() -> Self { let this = jsObject return this[Strings.cloneRange].function!(this: this, arguments: []).fromJSValue()! } - public func detach() { + @inlinable public func detach() { let this = jsObject _ = this[Strings.detach].function!(this: this, arguments: []) } - public func isPointInRange(node: Node, offset: UInt32) -> Bool { + @inlinable public func isPointInRange(node: Node, offset: UInt32) -> Bool { let this = jsObject return this[Strings.isPointInRange].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]).fromJSValue()! } - public func comparePoint(node: Node, offset: UInt32) -> Int16 { + @inlinable public func comparePoint(node: Node, offset: UInt32) -> Int16 { let this = jsObject return this[Strings.comparePoint].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]).fromJSValue()! } - public func intersectsNode(node: Node) -> Bool { + @inlinable public func intersectsNode(node: Node) -> Bool { let this = jsObject return this[Strings.intersectsNode].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! } - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift index b7b5a34a..ee1ac41c 100644 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableByteStreamController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ReadableByteStreamController].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableByteStreamController].function! } public let jsObject: JSObject @@ -20,17 +20,17 @@ public class ReadableByteStreamController: JSBridgedClass { @ReadonlyAttribute public var desiredSize: Double? - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public func enqueue(chunk: ArrayBufferView) { + @inlinable public func enqueue(chunk: ArrayBufferView) { let this = jsObject _ = this[Strings.enqueue].function!(this: this, arguments: [chunk.jsValue()]) } - public func error(e: JSValue? = nil) { + @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 index 34a6d0b0..d098200c 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStream: JSBridgedClass, AsyncSequence { - public class var constructor: JSFunction { JSObject.global[Strings.ReadableStream].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStream].function! } public let jsObject: JSObject @@ -13,48 +13,48 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { self.jsObject = jsObject } - public convenience init(underlyingSource: JSObject? = nil, strategy: QueuingStrategy? = nil) { + @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 - public func cancel(reason: JSValue? = nil) -> JSPromise { + @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, *) - public func cancel(reason: JSValue? = nil) async throws { + @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.get() } - public func getReader(options: ReadableStreamGetReaderOptions? = nil) -> ReadableStreamReader { + @inlinable public func getReader(options: ReadableStreamGetReaderOptions? = nil) -> ReadableStreamReader { let this = jsObject return this[Strings.getReader].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func pipeThrough(transform: ReadableWritablePair, options: StreamPipeOptions? = nil) -> Self { + @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()! } - public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) -> JSPromise { + @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, *) - public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) async throws { + @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.get() } - public func tee() -> [ReadableStream] { + @inlinable public func tee() -> [ReadableStream] { let this = jsObject return this[Strings.tee].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift index 5c6e0b76..060edb0c 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericReader { - public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamBYOBReader].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamBYOBReader].function! } public let jsObject: JSObject @@ -12,23 +12,23 @@ public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericRead self.jsObject = jsObject } - public convenience init(stream: ReadableStream) { + @inlinable public convenience init(stream: ReadableStream) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) } - public func read(view: ArrayBufferView) -> JSPromise { + @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, *) - public func read(view: ArrayBufferView) async throws -> ReadableStreamBYOBReadResult { + @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.get().fromJSValue()! } - public func releaseLock() { + @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 index 75f5cf6c..0df74238 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamBYOBRequest: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamBYOBRequest].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamBYOBRequest].function! } public let jsObject: JSObject @@ -16,12 +16,12 @@ public class ReadableStreamBYOBRequest: JSBridgedClass { @ReadonlyAttribute public var view: ArrayBufferView? - public func respond(bytesWritten: UInt64) { + @inlinable public func respond(bytesWritten: UInt64) { let this = jsObject _ = this[Strings.respond].function!(this: this, arguments: [bytesWritten.jsValue()]) } - public func respondWithNewView(view: ArrayBufferView) { + @inlinable public func respondWithNewView(view: ArrayBufferView) { let this = jsObject _ = this[Strings.respondWithNewView].function!(this: this, arguments: [view.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift index dc3d592e..fdb40d13 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamDefaultController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamDefaultController].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamDefaultController].function! } public let jsObject: JSObject @@ -16,17 +16,17 @@ public class ReadableStreamDefaultController: JSBridgedClass { @ReadonlyAttribute public var desiredSize: Double? - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public func enqueue(chunk: JSValue? = nil) { + @inlinable public func enqueue(chunk: JSValue? = nil) { let this = jsObject _ = this[Strings.enqueue].function!(this: this, arguments: [chunk?.jsValue() ?? .undefined]) } - public func error(e: JSValue? = nil) { + @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/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift index 73593a6d..45a41dc1 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericReader { - public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamDefaultReader].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamDefaultReader].function! } public let jsObject: JSObject @@ -12,23 +12,23 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR self.jsObject = jsObject } - public convenience init(stream: ReadableStream) { + @inlinable public convenience init(stream: ReadableStream) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) } - public func read() -> JSPromise { + @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, *) - public func read() async throws -> ReadableStreamDefaultReadResult { + @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.get().fromJSValue()! } - public func releaseLock() { + @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 index b8cfbbce..840ad641 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift @@ -5,15 +5,15 @@ import JavaScriptKit public protocol ReadableStreamGenericReader: JSBridgedClass {} public extension ReadableStreamGenericReader { - var closed: JSPromise { ReadonlyAttribute[Strings.closed, in: jsObject] } + @inlinable var closed: JSPromise { ReadonlyAttribute[Strings.closed, in: jsObject] } - func cancel(reason: JSValue? = nil) -> JSPromise { + @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, *) - func cancel(reason: JSValue? = nil) async throws { + @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.get() diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift index 5441c54b..e417ae53 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum ReadableStreamReaderMode: JSString, JSValueCompatible { case byob = "byob" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamType.swift b/Sources/DOMKit/WebIDL/ReadableStreamType.swift index 136accfe..a8a4d4c4 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamType.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamType.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum ReadableStreamType: JSString, JSValueCompatible { case bytes = "bytes" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ReadyState.swift b/Sources/DOMKit/WebIDL/ReadyState.swift index bd5e3fb6..8839409c 100644 --- a/Sources/DOMKit/WebIDL/ReadyState.swift +++ b/Sources/DOMKit/WebIDL/ReadyState.swift @@ -8,16 +8,16 @@ public enum ReadyState: JSString, JSValueCompatible { case open = "open" case ended = "ended" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RecordingState.swift b/Sources/DOMKit/WebIDL/RecordingState.swift index ac9f91b0..6254b7b2 100644 --- a/Sources/DOMKit/WebIDL/RecordingState.swift +++ b/Sources/DOMKit/WebIDL/RecordingState.swift @@ -8,16 +8,16 @@ public enum RecordingState: JSString, JSValueCompatible { case recording = "recording" case paused = "paused" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RedEyeReduction.swift b/Sources/DOMKit/WebIDL/RedEyeReduction.swift index fdc3edd5..5d3fdd2d 100644 --- a/Sources/DOMKit/WebIDL/RedEyeReduction.swift +++ b/Sources/DOMKit/WebIDL/RedEyeReduction.swift @@ -8,16 +8,16 @@ public enum RedEyeReduction: JSString, JSValueCompatible { case always = "always" case controllable = "controllable" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift index e2ab79f9..6346a67a 100644 --- a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift +++ b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift @@ -14,16 +14,16 @@ public enum ReferrerPolicy: JSString, JSValueCompatible { case strictOriginWhenCrossOrigin = "strict-origin-when-cross-origin" case unsafeUrl = "unsafe-url" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Region.swift b/Sources/DOMKit/WebIDL/Region.swift index c7b2a199..3449b145 100644 --- a/Sources/DOMKit/WebIDL/Region.swift +++ b/Sources/DOMKit/WebIDL/Region.swift @@ -5,9 +5,9 @@ import JavaScriptKit public protocol Region: JSBridgedClass {} public extension Region { - var regionOverset: String { ReadonlyAttribute[Strings.regionOverset, in: jsObject] } + @inlinable var regionOverset: String { ReadonlyAttribute[Strings.regionOverset, in: jsObject] } - func getRegionFlowRanges() -> [Range]? { + @inlinable func getRegionFlowRanges() -> [Range]? { let this = jsObject return this[Strings.getRegionFlowRanges].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift b/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift index fe402b89..206950cc 100644 --- a/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift +++ b/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class RelativeOrientationSensor: OrientationSensor { - override public class var constructor: JSFunction { JSObject.global[Strings.RelativeOrientationSensor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RelativeOrientationSensor].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(sensorOptions: OrientationSensorOptions? = nil) { + @inlinable public convenience init(sensorOptions: OrientationSensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/RemotePlayback.swift b/Sources/DOMKit/WebIDL/RemotePlayback.swift index 17e38716..f0fc09d6 100644 --- a/Sources/DOMKit/WebIDL/RemotePlayback.swift +++ b/Sources/DOMKit/WebIDL/RemotePlayback.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RemotePlayback: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.RemotePlayback].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RemotePlayback].function! } public required init(unsafelyWrapping jsObject: JSObject) { _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) @@ -18,13 +18,13 @@ public class RemotePlayback: EventTarget { // XXX: member 'watchAvailability' is ignored - public func cancelWatchAvailability(id: Int32? = nil) -> JSPromise { + @inlinable public func cancelWatchAvailability(id: Int32? = nil) -> JSPromise { let this = jsObject return this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func cancelWatchAvailability(id: Int32? = nil) async throws { + @inlinable public func cancelWatchAvailability(id: Int32? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() @@ -42,13 +42,13 @@ public class RemotePlayback: EventTarget { @ClosureAttribute1Optional public var ondisconnect: EventHandler - public func prompt() -> JSPromise { + @inlinable public func prompt() -> JSPromise { let this = jsObject return this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func prompt() async throws { + @inlinable public func prompt() async throws { let this = jsObject let _promise: JSPromise = this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/RemotePlaybackState.swift b/Sources/DOMKit/WebIDL/RemotePlaybackState.swift index baf8f905..2c20a6bc 100644 --- a/Sources/DOMKit/WebIDL/RemotePlaybackState.swift +++ b/Sources/DOMKit/WebIDL/RemotePlaybackState.swift @@ -8,16 +8,16 @@ public enum RemotePlaybackState: JSString, JSValueCompatible { case connected = "connected" case disconnected = "disconnected" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Report.swift b/Sources/DOMKit/WebIDL/Report.swift index 19cc4d1d..71dc619a 100644 --- a/Sources/DOMKit/WebIDL/Report.swift +++ b/Sources/DOMKit/WebIDL/Report.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Report: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Report].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Report].function! } public let jsObject: JSObject @@ -15,7 +15,7 @@ public class Report: JSBridgedClass { self.jsObject = jsObject } - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ReportBody.swift b/Sources/DOMKit/WebIDL/ReportBody.swift index 1d37b1ec..0d640797 100644 --- a/Sources/DOMKit/WebIDL/ReportBody.swift +++ b/Sources/DOMKit/WebIDL/ReportBody.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReportBody: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ReportBody].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReportBody].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class ReportBody: JSBridgedClass { self.jsObject = jsObject } - public func toJSON() -> JSObject { + @inlinable public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ReportingObserver.swift b/Sources/DOMKit/WebIDL/ReportingObserver.swift index 52436af3..255c3d65 100644 --- a/Sources/DOMKit/WebIDL/ReportingObserver.swift +++ b/Sources/DOMKit/WebIDL/ReportingObserver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReportingObserver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ReportingObserver].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReportingObserver].function! } public let jsObject: JSObject @@ -14,17 +14,17 @@ public class ReportingObserver: JSBridgedClass { // XXX: constructor is ignored - public func observe() { + @inlinable public func observe() { let this = jsObject _ = this[Strings.observe].function!(this: this, arguments: []) } - public func disconnect() { + @inlinable public func disconnect() { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: []) } - public func takeRecords() -> ReportList { + @inlinable public func takeRecords() -> ReportList { let this = jsObject return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift index 7bd42c99..73860a10 100644 --- a/Sources/DOMKit/WebIDL/Request.swift +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Request: JSBridgedClass, Body { - public class var constructor: JSFunction { JSObject.global[Strings.Request].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Request].function! } public let jsObject: JSObject @@ -28,7 +28,7 @@ public class Request: JSBridgedClass, Body { self.jsObject = jsObject } - public convenience init(input: RequestInfo, init: RequestInit? = nil) { + @inlinable public convenience init(input: RequestInfo, init: RequestInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [input.jsValue(), `init`?.jsValue() ?? .undefined])) } @@ -77,7 +77,7 @@ public class Request: JSBridgedClass, Body { @ReadonlyAttribute public var signal: AbortSignal - public func clone() -> Self { + @inlinable public func clone() -> Self { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RequestCache.swift b/Sources/DOMKit/WebIDL/RequestCache.swift index 5a2bc97a..603fe67c 100644 --- a/Sources/DOMKit/WebIDL/RequestCache.swift +++ b/Sources/DOMKit/WebIDL/RequestCache.swift @@ -11,16 +11,16 @@ public enum RequestCache: JSString, JSValueCompatible { case forceCache = "force-cache" case onlyIfCached = "only-if-cached" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RequestCredentials.swift b/Sources/DOMKit/WebIDL/RequestCredentials.swift index 842c1862..750741b5 100644 --- a/Sources/DOMKit/WebIDL/RequestCredentials.swift +++ b/Sources/DOMKit/WebIDL/RequestCredentials.swift @@ -8,16 +8,16 @@ public enum RequestCredentials: JSString, JSValueCompatible { case sameOrigin = "same-origin" case include = "include" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RequestDestination.swift b/Sources/DOMKit/WebIDL/RequestDestination.swift index 992014b8..bd189b73 100644 --- a/Sources/DOMKit/WebIDL/RequestDestination.swift +++ b/Sources/DOMKit/WebIDL/RequestDestination.swift @@ -25,16 +25,16 @@ public enum RequestDestination: JSString, JSValueCompatible { case worker = "worker" case xslt = "xslt" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RequestMode.swift b/Sources/DOMKit/WebIDL/RequestMode.swift index d90fb39e..085511f1 100644 --- a/Sources/DOMKit/WebIDL/RequestMode.swift +++ b/Sources/DOMKit/WebIDL/RequestMode.swift @@ -9,16 +9,16 @@ public enum RequestMode: JSString, JSValueCompatible { case noCors = "no-cors" case cors = "cors" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/RequestRedirect.swift b/Sources/DOMKit/WebIDL/RequestRedirect.swift index 4cf86139..44097a07 100644 --- a/Sources/DOMKit/WebIDL/RequestRedirect.swift +++ b/Sources/DOMKit/WebIDL/RequestRedirect.swift @@ -8,16 +8,16 @@ public enum RequestRedirect: JSString, JSValueCompatible { case error = "error" case manual = "manual" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift b/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift index 663dedd5..3f80d2e6 100644 --- a/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift +++ b/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift @@ -8,16 +8,16 @@ public enum ResidentKeyRequirement: JSString, JSValueCompatible { case preferred = "preferred" case required = "required" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ResizeObserver.swift b/Sources/DOMKit/WebIDL/ResizeObserver.swift index 71190798..c03b0612 100644 --- a/Sources/DOMKit/WebIDL/ResizeObserver.swift +++ b/Sources/DOMKit/WebIDL/ResizeObserver.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ResizeObserver: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserver].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserver].function! } public let jsObject: JSObject @@ -14,17 +14,17 @@ public class ResizeObserver: JSBridgedClass { // XXX: constructor is ignored - public func observe(target: Element, options: ResizeObserverOptions? = nil) { + @inlinable public func observe(target: Element, options: ResizeObserverOptions? = nil) { let this = jsObject _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue(), options?.jsValue() ?? .undefined]) } - public func unobserve(target: Element) { + @inlinable public func unobserve(target: Element) { let this = jsObject _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue()]) } - public func disconnect() { + @inlinable public func disconnect() { let this = jsObject _ = this[Strings.disconnect].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift b/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift index 9f918318..64adb223 100644 --- a/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift +++ b/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift @@ -8,16 +8,16 @@ public enum ResizeObserverBoxOptions: JSString, JSValueCompatible { case contentBox = "content-box" case devicePixelContentBox = "device-pixel-content-box" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ResizeObserverEntry.swift b/Sources/DOMKit/WebIDL/ResizeObserverEntry.swift index 9d75b067..65a359ba 100644 --- a/Sources/DOMKit/WebIDL/ResizeObserverEntry.swift +++ b/Sources/DOMKit/WebIDL/ResizeObserverEntry.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ResizeObserverEntry: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserverEntry].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserverEntry].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ResizeObserverSize.swift b/Sources/DOMKit/WebIDL/ResizeObserverSize.swift index 95931caa..440108a8 100644 --- a/Sources/DOMKit/WebIDL/ResizeObserverSize.swift +++ b/Sources/DOMKit/WebIDL/ResizeObserverSize.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ResizeObserverSize: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserverSize].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserverSize].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ResizeQuality.swift b/Sources/DOMKit/WebIDL/ResizeQuality.swift index d1cc889c..5f118472 100644 --- a/Sources/DOMKit/WebIDL/ResizeQuality.swift +++ b/Sources/DOMKit/WebIDL/ResizeQuality.swift @@ -9,16 +9,16 @@ public enum ResizeQuality: JSString, JSValueCompatible { case medium = "medium" case high = "high" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Response.swift b/Sources/DOMKit/WebIDL/Response.swift index 6f683511..935ad7c0 100644 --- a/Sources/DOMKit/WebIDL/Response.swift +++ b/Sources/DOMKit/WebIDL/Response.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Response: JSBridgedClass, Body { - public class var constructor: JSFunction { JSObject.global[Strings.Response].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Response].function! } public let jsObject: JSObject @@ -19,16 +19,16 @@ public class Response: JSBridgedClass, Body { self.jsObject = jsObject } - public convenience init(body: BodyInit? = nil, init: ResponseInit? = nil) { + @inlinable public convenience init(body: BodyInit? = nil, init: ResponseInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [body?.jsValue() ?? .undefined, `init`?.jsValue() ?? .undefined])) } - public static func error() -> Self { + @inlinable public static func error() -> Self { let this = constructor return this[Strings.error].function!(this: this, arguments: []).fromJSValue()! } - public static func redirect(url: String, status: UInt16? = nil) -> Self { + @inlinable public static func redirect(url: String, status: UInt16? = nil) -> Self { let this = constructor return this[Strings.redirect].function!(this: this, arguments: [url.jsValue(), status?.jsValue() ?? .undefined]).fromJSValue()! } @@ -54,7 +54,7 @@ public class Response: JSBridgedClass, Body { @ReadonlyAttribute public var headers: Headers - public func clone() -> Self { + @inlinable public func clone() -> Self { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ResponseType.swift b/Sources/DOMKit/WebIDL/ResponseType.swift index db6f244f..8f0f2293 100644 --- a/Sources/DOMKit/WebIDL/ResponseType.swift +++ b/Sources/DOMKit/WebIDL/ResponseType.swift @@ -11,16 +11,16 @@ public enum ResponseType: JSString, JSValueCompatible { case opaque = "opaque" case opaqueredirect = "opaqueredirect" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SFrameTransform.swift b/Sources/DOMKit/WebIDL/SFrameTransform.swift index 582b30da..10e14143 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransform.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransform.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SFrameTransform: JSBridgedClass, GenericTransformStream { - public class var constructor: JSFunction { JSObject.global[Strings.SFrameTransform].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SFrameTransform].function! } public let jsObject: JSObject @@ -13,17 +13,17 @@ public class SFrameTransform: JSBridgedClass, GenericTransformStream { self.jsObject = jsObject } - public convenience init(options: SFrameTransformOptions? = nil) { + @inlinable public convenience init(options: SFrameTransformOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } - public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) -> JSPromise { + @inlinable public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) -> JSPromise { let this = jsObject return this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue(), keyID?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) async throws { + @inlinable public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue(), keyID?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift index 13ea8f2a..08347b9c 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SFrameTransformErrorEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.SFrameTransformErrorEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SFrameTransformErrorEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _errorType = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorType) @@ -13,7 +13,7 @@ public class SFrameTransformErrorEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: SFrameTransformErrorEventInit) { + @inlinable public convenience init(type: String, eventInitDict: SFrameTransformErrorEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift index 987f448d..2836106e 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift @@ -8,16 +8,16 @@ public enum SFrameTransformErrorEventType: JSString, JSValueCompatible { case keyID = "keyID" case syntax = "syntax" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SFrameTransformRole.swift b/Sources/DOMKit/WebIDL/SFrameTransformRole.swift index d05b8e59..72e0e1bd 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransformRole.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransformRole.swift @@ -7,16 +7,16 @@ public enum SFrameTransformRole: JSString, JSValueCompatible { case encrypt = "encrypt" case decrypt = "decrypt" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SVGAElement.swift b/Sources/DOMKit/WebIDL/SVGAElement.swift index a18efa3c..9a21d289 100644 --- a/Sources/DOMKit/WebIDL/SVGAElement.swift +++ b/Sources/DOMKit/WebIDL/SVGAElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAElement: SVGGraphicsElement, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGAElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) diff --git a/Sources/DOMKit/WebIDL/SVGAngle.swift b/Sources/DOMKit/WebIDL/SVGAngle.swift index 4fc5b7c0..4985eb77 100644 --- a/Sources/DOMKit/WebIDL/SVGAngle.swift +++ b/Sources/DOMKit/WebIDL/SVGAngle.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAngle: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAngle].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAngle].function! } public let jsObject: JSObject @@ -38,12 +38,12 @@ public class SVGAngle: JSBridgedClass { @ReadWriteAttribute public var valueAsString: String - public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { + @inlinable public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { let this = jsObject _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue(), valueInSpecifiedUnits.jsValue()]) } - public func convertToSpecifiedUnits(unitType: UInt16) { + @inlinable public func convertToSpecifiedUnits(unitType: UInt16) { let this = jsObject _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SVGAnimateElement.swift b/Sources/DOMKit/WebIDL/SVGAnimateElement.swift index ba63dd1f..ad005500 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimateElement.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimateElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimateElement: SVGAnimationElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift b/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift index 83bfbc32..d3ac9dd7 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimateMotionElement: SVGAnimationElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateMotionElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateMotionElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift b/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift index e81c989a..0b33e500 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimateTransformElement: SVGAnimationElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateTransformElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateTransformElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift b/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift index 87b2d9f3..8e927078 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedAngle: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedAngle].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedAngle].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift b/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift index 98c77d67..6704b5d2 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedBoolean: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedBoolean].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedBoolean].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift b/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift index 95a137d5..b1081a6d 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedEnumeration: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedEnumeration].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedEnumeration].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift b/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift index 242a2d86..759adcba 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedInteger: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedInteger].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedInteger].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift b/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift index c654e395..2a613d5f 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedLength: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedLength].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedLength].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift b/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift index d67764f9..bc6125af 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedLengthList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedLengthList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedLengthList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift b/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift index 856b5e42..7897194b 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedNumber: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedNumber].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedNumber].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift b/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift index 6051fd3c..edb008e5 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedNumberList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedNumberList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedNumberList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift b/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift index e652dc9d..32fa2fe2 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol SVGAnimatedPoints: JSBridgedClass {} public extension SVGAnimatedPoints { - var points: SVGPointList { ReadonlyAttribute[Strings.points, in: jsObject] } + @inlinable var points: SVGPointList { ReadonlyAttribute[Strings.points, in: jsObject] } - var animatedPoints: SVGPointList { ReadonlyAttribute[Strings.animatedPoints, in: jsObject] } + @inlinable var animatedPoints: SVGPointList { ReadonlyAttribute[Strings.animatedPoints, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift b/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift index da97ac17..2f42ede5 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedPreserveAspectRatio: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedPreserveAspectRatio].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedPreserveAspectRatio].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift b/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift index f2ce18de..45cf4212 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedRect: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedRect].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedRect].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedString.swift b/Sources/DOMKit/WebIDL/SVGAnimatedString.swift index 6d1730f4..97965f5b 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedString.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedString.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedString: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedString].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedString].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift b/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift index 87d77df2..d8b3fb27 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimatedTransformList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedTransformList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedTransformList].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift index ca393a82..aa741b4e 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGAnimationElement: SVGElement, SVGTests { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimationElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimationElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _targetElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetElement) @@ -26,37 +26,37 @@ public class SVGAnimationElement: SVGElement, SVGTests { @ClosureAttribute1Optional public var onrepeat: EventHandler - public func getStartTime() -> Float { + @inlinable public func getStartTime() -> Float { let this = jsObject return this[Strings.getStartTime].function!(this: this, arguments: []).fromJSValue()! } - public func getCurrentTime() -> Float { + @inlinable public func getCurrentTime() -> Float { let this = jsObject return this[Strings.getCurrentTime].function!(this: this, arguments: []).fromJSValue()! } - public func getSimpleDuration() -> Float { + @inlinable public func getSimpleDuration() -> Float { let this = jsObject return this[Strings.getSimpleDuration].function!(this: this, arguments: []).fromJSValue()! } - public func beginElement() { + @inlinable public func beginElement() { let this = jsObject _ = this[Strings.beginElement].function!(this: this, arguments: []) } - public func beginElementAt(offset: Float) { + @inlinable public func beginElementAt(offset: Float) { let this = jsObject _ = this[Strings.beginElementAt].function!(this: this, arguments: [offset.jsValue()]) } - public func endElement() { + @inlinable public func endElement() { let this = jsObject _ = this[Strings.endElement].function!(this: this, arguments: []) } - public func endElementAt(offset: Float) { + @inlinable public func endElementAt(offset: Float) { let this = jsObject _ = this[Strings.endElementAt].function!(this: this, arguments: [offset.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SVGCircleElement.swift b/Sources/DOMKit/WebIDL/SVGCircleElement.swift index 3dfa3cec..20e95399 100644 --- a/Sources/DOMKit/WebIDL/SVGCircleElement.swift +++ b/Sources/DOMKit/WebIDL/SVGCircleElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGCircleElement: SVGGeometryElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGCircleElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGCircleElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cx = ReadonlyAttribute(jsObject: jsObject, name: Strings.cx) diff --git a/Sources/DOMKit/WebIDL/SVGClipPathElement.swift b/Sources/DOMKit/WebIDL/SVGClipPathElement.swift index 0834c5a0..0b8a8441 100644 --- a/Sources/DOMKit/WebIDL/SVGClipPathElement.swift +++ b/Sources/DOMKit/WebIDL/SVGClipPathElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGClipPathElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGClipPathElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGClipPathElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _clipPathUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipPathUnits) diff --git a/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift b/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift index 65fbd1d4..c41e8538 100644 --- a/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift +++ b/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGComponentTransferFunctionElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGComponentTransferFunctionElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGComponentTransferFunctionElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) diff --git a/Sources/DOMKit/WebIDL/SVGDefsElement.swift b/Sources/DOMKit/WebIDL/SVGDefsElement.swift index d1965c14..466aed8a 100644 --- a/Sources/DOMKit/WebIDL/SVGDefsElement.swift +++ b/Sources/DOMKit/WebIDL/SVGDefsElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGDefsElement: SVGGraphicsElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGDefsElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGDefsElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGDescElement.swift b/Sources/DOMKit/WebIDL/SVGDescElement.swift index 89b42185..92024f1a 100644 --- a/Sources/DOMKit/WebIDL/SVGDescElement.swift +++ b/Sources/DOMKit/WebIDL/SVGDescElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGDescElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGDescElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGDescElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGDiscardElement.swift b/Sources/DOMKit/WebIDL/SVGDiscardElement.swift index 92c1d8eb..8a54ee61 100644 --- a/Sources/DOMKit/WebIDL/SVGDiscardElement.swift +++ b/Sources/DOMKit/WebIDL/SVGDiscardElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGDiscardElement: SVGAnimationElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGDiscardElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGDiscardElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGElement.swift b/Sources/DOMKit/WebIDL/SVGElement.swift index f48f7449..66b31fee 100644 --- a/Sources/DOMKit/WebIDL/SVGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement, ElementCSSInlineStyle { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _ownerSVGElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerSVGElement) diff --git a/Sources/DOMKit/WebIDL/SVGElementInstance.swift b/Sources/DOMKit/WebIDL/SVGElementInstance.swift index 691aa610..57b55643 100644 --- a/Sources/DOMKit/WebIDL/SVGElementInstance.swift +++ b/Sources/DOMKit/WebIDL/SVGElementInstance.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol SVGElementInstance: JSBridgedClass {} public extension SVGElementInstance { - var correspondingElement: SVGElement? { ReadonlyAttribute[Strings.correspondingElement, in: jsObject] } + @inlinable var correspondingElement: SVGElement? { ReadonlyAttribute[Strings.correspondingElement, in: jsObject] } - var correspondingUseElement: SVGUseElement? { ReadonlyAttribute[Strings.correspondingUseElement, in: jsObject] } + @inlinable var correspondingUseElement: SVGUseElement? { ReadonlyAttribute[Strings.correspondingUseElement, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/SVGEllipseElement.swift b/Sources/DOMKit/WebIDL/SVGEllipseElement.swift index bc2f9342..783f83f8 100644 --- a/Sources/DOMKit/WebIDL/SVGEllipseElement.swift +++ b/Sources/DOMKit/WebIDL/SVGEllipseElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGEllipseElement: SVGGeometryElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGEllipseElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGEllipseElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cx = ReadonlyAttribute(jsObject: jsObject, name: Strings.cx) diff --git a/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift b/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift index ae22e455..16a56103 100644 --- a/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEBlendElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEBlendElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEBlendElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift b/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift index c0b34522..3fab0881 100644 --- a/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEColorMatrixElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEColorMatrixElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEColorMatrixElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift b/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift index 9052cf0c..b7dadf98 100644 --- a/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEComponentTransferElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEComponentTransferElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEComponentTransferElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift b/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift index 50f9e866..2bd9f6f0 100644 --- a/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFECompositeElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFECompositeElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFECompositeElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift b/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift index babf1ada..b67f63ee 100644 --- a/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEConvolveMatrixElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEConvolveMatrixElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEConvolveMatrixElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift b/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift index da5e2d0c..d3aebc5e 100644 --- a/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEDiffuseLightingElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDiffuseLightingElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDiffuseLightingElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift b/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift index efb98fe6..05d31d85 100644 --- a/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEDisplacementMapElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDisplacementMapElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDisplacementMapElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift b/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift index c893fd9f..e58dacdb 100644 --- a/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEDistantLightElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDistantLightElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDistantLightElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _azimuth = ReadonlyAttribute(jsObject: jsObject, name: Strings.azimuth) diff --git a/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift b/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift index 1c4a606d..7004496f 100644 --- a/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEDropShadowElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDropShadowElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDropShadowElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) @@ -30,7 +30,7 @@ public class SVGFEDropShadowElement: SVGElement, SVGFilterPrimitiveStandardAttri @ReadonlyAttribute public var stdDeviationY: SVGAnimatedNumber - public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { + @inlinable public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { let this = jsObject _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue(), stdDeviationY.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift b/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift index 6af1a2ab..2ae73b65 100644 --- a/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEFloodElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFloodElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFloodElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift index 3bf08468..91b4c54a 100644 --- a/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEFuncAElement: SVGComponentTransferFunctionElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncAElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncAElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift index afebc3a8..422f56e5 100644 --- a/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEFuncBElement: SVGComponentTransferFunctionElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncBElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncBElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift index 2b30b27e..6d8938ca 100644 --- a/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEFuncGElement: SVGComponentTransferFunctionElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncGElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncGElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift index f2f6ae3a..5acbcb17 100644 --- a/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEFuncRElement: SVGComponentTransferFunctionElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncRElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncRElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift b/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift index 17fd7e1e..2ebb4f3d 100644 --- a/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEGaussianBlurElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEGaussianBlurElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEGaussianBlurElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) @@ -34,7 +34,7 @@ public class SVGFEGaussianBlurElement: SVGElement, SVGFilterPrimitiveStandardAtt @ReadonlyAttribute public var edgeMode: SVGAnimatedEnumeration - public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { + @inlinable public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { let this = jsObject _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue(), stdDeviationY.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SVGFEImageElement.swift b/Sources/DOMKit/WebIDL/SVGFEImageElement.swift index becf588a..ecc3ee0b 100644 --- a/Sources/DOMKit/WebIDL/SVGFEImageElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEImageElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEImageElement: SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEImageElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEImageElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _preserveAspectRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.preserveAspectRatio) diff --git a/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift b/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift index 59fdf83d..476c1437 100644 --- a/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEMergeElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMergeElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMergeElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift b/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift index 93f6cdac..c9099e17 100644 --- a/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEMergeNodeElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMergeNodeElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMergeNodeElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift b/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift index abe0bece..8ff23d2a 100644 --- a/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEMorphologyElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMorphologyElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMorphologyElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift b/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift index 81bc9064..2d03b416 100644 --- a/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEOffsetElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEOffsetElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEOffsetElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift b/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift index 7a2b5f91..00c052ab 100644 --- a/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFEPointLightElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEPointLightElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEPointLightElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) diff --git a/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift b/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift index 9c0bfef1..bd700136 100644 --- a/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFESpecularLightingElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFESpecularLightingElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFESpecularLightingElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift b/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift index 756805bd..cd423069 100644 --- a/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFESpotLightElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFESpotLightElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFESpotLightElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) diff --git a/Sources/DOMKit/WebIDL/SVGFETileElement.swift b/Sources/DOMKit/WebIDL/SVGFETileElement.swift index 528ad11b..7862eb1d 100644 --- a/Sources/DOMKit/WebIDL/SVGFETileElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFETileElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFETileElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFETileElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFETileElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) diff --git a/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift b/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift index 4a1c6519..617f4d0b 100644 --- a/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFETurbulenceElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFETurbulenceElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFETurbulenceElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _baseFrequencyX = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseFrequencyX) diff --git a/Sources/DOMKit/WebIDL/SVGFilterElement.swift b/Sources/DOMKit/WebIDL/SVGFilterElement.swift index 6f1c3a31..9c7b8d7a 100644 --- a/Sources/DOMKit/WebIDL/SVGFilterElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFilterElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGFilterElement: SVGElement, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGFilterElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFilterElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _filterUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.filterUnits) diff --git a/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift b/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift index f7bd5bfb..65789732 100644 --- a/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift +++ b/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift @@ -5,13 +5,13 @@ import JavaScriptKit public protocol SVGFilterPrimitiveStandardAttributes: JSBridgedClass {} public extension SVGFilterPrimitiveStandardAttributes { - var x: SVGAnimatedLength { ReadonlyAttribute[Strings.x, in: jsObject] } + @inlinable var x: SVGAnimatedLength { ReadonlyAttribute[Strings.x, in: jsObject] } - var y: SVGAnimatedLength { ReadonlyAttribute[Strings.y, in: jsObject] } + @inlinable var y: SVGAnimatedLength { ReadonlyAttribute[Strings.y, in: jsObject] } - var width: SVGAnimatedLength { ReadonlyAttribute[Strings.width, in: jsObject] } + @inlinable var width: SVGAnimatedLength { ReadonlyAttribute[Strings.width, in: jsObject] } - var height: SVGAnimatedLength { ReadonlyAttribute[Strings.height, in: jsObject] } + @inlinable var height: SVGAnimatedLength { ReadonlyAttribute[Strings.height, in: jsObject] } - var result: SVGAnimatedString { ReadonlyAttribute[Strings.result, in: jsObject] } + @inlinable var result: SVGAnimatedString { ReadonlyAttribute[Strings.result, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift b/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift index eb970826..2dc8f733 100644 --- a/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift +++ b/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol SVGFitToViewBox: JSBridgedClass {} public extension SVGFitToViewBox { - var viewBox: SVGAnimatedRect { ReadonlyAttribute[Strings.viewBox, in: jsObject] } + @inlinable var viewBox: SVGAnimatedRect { ReadonlyAttribute[Strings.viewBox, in: jsObject] } - var preserveAspectRatio: SVGAnimatedPreserveAspectRatio { ReadonlyAttribute[Strings.preserveAspectRatio, in: jsObject] } + @inlinable var preserveAspectRatio: SVGAnimatedPreserveAspectRatio { ReadonlyAttribute[Strings.preserveAspectRatio, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift b/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift index e351908b..24613b44 100644 --- a/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift +++ b/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGForeignObjectElement: SVGGraphicsElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGForeignObjectElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGForeignObjectElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) diff --git a/Sources/DOMKit/WebIDL/SVGGElement.swift b/Sources/DOMKit/WebIDL/SVGGElement.swift index ef630034..a0ae9619 100644 --- a/Sources/DOMKit/WebIDL/SVGGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGGElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGGElement: SVGGraphicsElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGGElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGGElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGGeometryElement.swift b/Sources/DOMKit/WebIDL/SVGGeometryElement.swift index b7589afd..8954450a 100644 --- a/Sources/DOMKit/WebIDL/SVGGeometryElement.swift +++ b/Sources/DOMKit/WebIDL/SVGGeometryElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGGeometryElement: SVGGraphicsElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGGeometryElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGGeometryElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _pathLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.pathLength) @@ -14,22 +14,22 @@ public class SVGGeometryElement: SVGGraphicsElement { @ReadonlyAttribute public var pathLength: SVGAnimatedNumber - public func isPointInFill(point: DOMPointInit? = nil) -> Bool { + @inlinable public func isPointInFill(point: DOMPointInit? = nil) -> Bool { let this = jsObject return this[Strings.isPointInFill].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! } - public func isPointInStroke(point: DOMPointInit? = nil) -> Bool { + @inlinable public func isPointInStroke(point: DOMPointInit? = nil) -> Bool { let this = jsObject return this[Strings.isPointInStroke].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! } - public func getTotalLength() -> Float { + @inlinable public func getTotalLength() -> Float { let this = jsObject return this[Strings.getTotalLength].function!(this: this, arguments: []).fromJSValue()! } - public func getPointAtLength(distance: Float) -> DOMPoint { + @inlinable public func getPointAtLength(distance: Float) -> DOMPoint { let this = jsObject return this[Strings.getPointAtLength].function!(this: this, arguments: [distance.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SVGGradientElement.swift b/Sources/DOMKit/WebIDL/SVGGradientElement.swift index f12b8d38..7356b768 100644 --- a/Sources/DOMKit/WebIDL/SVGGradientElement.swift +++ b/Sources/DOMKit/WebIDL/SVGGradientElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGGradientElement: SVGElement, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGGradientElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGGradientElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _gradientUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.gradientUnits) diff --git a/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift b/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift index 1c1f1d4a..4ffc70b5 100644 --- a/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift +++ b/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGGraphicsElement: SVGElement, SVGTests { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGGraphicsElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGGraphicsElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) @@ -14,17 +14,17 @@ public class SVGGraphicsElement: SVGElement, SVGTests { @ReadonlyAttribute public var transform: SVGAnimatedTransformList - public func getBBox(options: SVGBoundingBoxOptions? = nil) -> DOMRect { + @inlinable public func getBBox(options: SVGBoundingBoxOptions? = nil) -> DOMRect { let this = jsObject return this[Strings.getBBox].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func getCTM() -> DOMMatrix? { + @inlinable public func getCTM() -> DOMMatrix? { let this = jsObject return this[Strings.getCTM].function!(this: this, arguments: []).fromJSValue()! } - public func getScreenCTM() -> DOMMatrix? { + @inlinable public func getScreenCTM() -> DOMMatrix? { let this = jsObject return this[Strings.getScreenCTM].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SVGImageElement.swift b/Sources/DOMKit/WebIDL/SVGImageElement.swift index a45dea7d..ad4145f1 100644 --- a/Sources/DOMKit/WebIDL/SVGImageElement.swift +++ b/Sources/DOMKit/WebIDL/SVGImageElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGImageElement: SVGGraphicsElement, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGImageElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGImageElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) diff --git a/Sources/DOMKit/WebIDL/SVGLength.swift b/Sources/DOMKit/WebIDL/SVGLength.swift index 549e22cc..a68862b4 100644 --- a/Sources/DOMKit/WebIDL/SVGLength.swift +++ b/Sources/DOMKit/WebIDL/SVGLength.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGLength: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGLength].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGLength].function! } public let jsObject: JSObject @@ -50,12 +50,12 @@ public class SVGLength: JSBridgedClass { @ReadWriteAttribute public var valueAsString: String - public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { + @inlinable public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { let this = jsObject _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue(), valueInSpecifiedUnits.jsValue()]) } - public func convertToSpecifiedUnits(unitType: UInt16) { + @inlinable public func convertToSpecifiedUnits(unitType: UInt16) { let this = jsObject _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SVGLengthList.swift b/Sources/DOMKit/WebIDL/SVGLengthList.swift index db47e9d2..af78e83e 100644 --- a/Sources/DOMKit/WebIDL/SVGLengthList.swift +++ b/Sources/DOMKit/WebIDL/SVGLengthList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGLengthList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGLengthList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGLengthList].function! } public let jsObject: JSObject @@ -20,36 +20,36 @@ public class SVGLengthList: JSBridgedClass { @ReadonlyAttribute public var numberOfItems: UInt32 - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } - public func initialize(newItem: SVGLength) -> SVGLength { + @inlinable public func initialize(newItem: SVGLength) -> SVGLength { let this = jsObject return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } - public subscript(key: Int) -> SVGLength { + @inlinable public subscript(key: Int) -> SVGLength { jsObject[key].fromJSValue()! } - public func insertItemBefore(newItem: SVGLength, index: UInt32) -> SVGLength { + @inlinable public func insertItemBefore(newItem: SVGLength, index: UInt32) -> SVGLength { let this = jsObject return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func replaceItem(newItem: SVGLength, index: UInt32) -> SVGLength { + @inlinable public func replaceItem(newItem: SVGLength, index: UInt32) -> SVGLength { let this = jsObject return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func removeItem(index: UInt32) -> SVGLength { + @inlinable public func removeItem(index: UInt32) -> SVGLength { let this = jsObject return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } - public func appendItem(newItem: SVGLength) -> SVGLength { + @inlinable public func appendItem(newItem: SVGLength) -> SVGLength { let this = jsObject return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SVGLineElement.swift b/Sources/DOMKit/WebIDL/SVGLineElement.swift index 26d302cc..116f3712 100644 --- a/Sources/DOMKit/WebIDL/SVGLineElement.swift +++ b/Sources/DOMKit/WebIDL/SVGLineElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGLineElement: SVGGeometryElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGLineElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGLineElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x1) diff --git a/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift b/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift index 6a970f06..92c46de6 100644 --- a/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift +++ b/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGLinearGradientElement: SVGGradientElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGLinearGradientElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGLinearGradientElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x1) diff --git a/Sources/DOMKit/WebIDL/SVGMPathElement.swift b/Sources/DOMKit/WebIDL/SVGMPathElement.swift index 71889f06..91025cd4 100644 --- a/Sources/DOMKit/WebIDL/SVGMPathElement.swift +++ b/Sources/DOMKit/WebIDL/SVGMPathElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGMPathElement: SVGElement, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGMPathElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGMPathElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGMarkerElement.swift b/Sources/DOMKit/WebIDL/SVGMarkerElement.swift index f919955e..f650bdcd 100644 --- a/Sources/DOMKit/WebIDL/SVGMarkerElement.swift +++ b/Sources/DOMKit/WebIDL/SVGMarkerElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGMarkerElement: SVGElement, SVGFitToViewBox { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGMarkerElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGMarkerElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _refX = ReadonlyAttribute(jsObject: jsObject, name: Strings.refX) @@ -54,12 +54,12 @@ public class SVGMarkerElement: SVGElement, SVGFitToViewBox { @ReadWriteAttribute public var orient: String - public func setOrientToAuto() { + @inlinable public func setOrientToAuto() { let this = jsObject _ = this[Strings.setOrientToAuto].function!(this: this, arguments: []) } - public func setOrientToAngle(angle: SVGAngle) { + @inlinable public func setOrientToAngle(angle: SVGAngle) { let this = jsObject _ = this[Strings.setOrientToAngle].function!(this: this, arguments: [angle.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SVGMaskElement.swift b/Sources/DOMKit/WebIDL/SVGMaskElement.swift index 2dc4e79b..ecc9e382 100644 --- a/Sources/DOMKit/WebIDL/SVGMaskElement.swift +++ b/Sources/DOMKit/WebIDL/SVGMaskElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGMaskElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGMaskElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGMaskElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _maskUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.maskUnits) diff --git a/Sources/DOMKit/WebIDL/SVGMetadataElement.swift b/Sources/DOMKit/WebIDL/SVGMetadataElement.swift index 575f43d0..972c3a21 100644 --- a/Sources/DOMKit/WebIDL/SVGMetadataElement.swift +++ b/Sources/DOMKit/WebIDL/SVGMetadataElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGMetadataElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGMetadataElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGMetadataElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGNumber.swift b/Sources/DOMKit/WebIDL/SVGNumber.swift index 129e062d..d6e5531d 100644 --- a/Sources/DOMKit/WebIDL/SVGNumber.swift +++ b/Sources/DOMKit/WebIDL/SVGNumber.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGNumber: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGNumber].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGNumber].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGNumberList.swift b/Sources/DOMKit/WebIDL/SVGNumberList.swift index e74ea8cc..3a478cc3 100644 --- a/Sources/DOMKit/WebIDL/SVGNumberList.swift +++ b/Sources/DOMKit/WebIDL/SVGNumberList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGNumberList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGNumberList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGNumberList].function! } public let jsObject: JSObject @@ -20,36 +20,36 @@ public class SVGNumberList: JSBridgedClass { @ReadonlyAttribute public var numberOfItems: UInt32 - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } - public func initialize(newItem: SVGNumber) -> SVGNumber { + @inlinable public func initialize(newItem: SVGNumber) -> SVGNumber { let this = jsObject return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } - public subscript(key: Int) -> SVGNumber { + @inlinable public subscript(key: Int) -> SVGNumber { jsObject[key].fromJSValue()! } - public func insertItemBefore(newItem: SVGNumber, index: UInt32) -> SVGNumber { + @inlinable public func insertItemBefore(newItem: SVGNumber, index: UInt32) -> SVGNumber { let this = jsObject return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func replaceItem(newItem: SVGNumber, index: UInt32) -> SVGNumber { + @inlinable public func replaceItem(newItem: SVGNumber, index: UInt32) -> SVGNumber { let this = jsObject return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func removeItem(index: UInt32) -> SVGNumber { + @inlinable public func removeItem(index: UInt32) -> SVGNumber { let this = jsObject return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } - public func appendItem(newItem: SVGNumber) -> SVGNumber { + @inlinable public func appendItem(newItem: SVGNumber) -> SVGNumber { let this = jsObject return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SVGPathElement.swift b/Sources/DOMKit/WebIDL/SVGPathElement.swift index 38bd115a..a0fba634 100644 --- a/Sources/DOMKit/WebIDL/SVGPathElement.swift +++ b/Sources/DOMKit/WebIDL/SVGPathElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGPathElement: SVGGeometryElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGPathElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGPathElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGPatternElement.swift b/Sources/DOMKit/WebIDL/SVGPatternElement.swift index 4fe8573f..47c75487 100644 --- a/Sources/DOMKit/WebIDL/SVGPatternElement.swift +++ b/Sources/DOMKit/WebIDL/SVGPatternElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGPatternElement: SVGElement, SVGFitToViewBox, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGPatternElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGPatternElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _patternUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.patternUnits) diff --git a/Sources/DOMKit/WebIDL/SVGPointList.swift b/Sources/DOMKit/WebIDL/SVGPointList.swift index 86100b53..66631c4b 100644 --- a/Sources/DOMKit/WebIDL/SVGPointList.swift +++ b/Sources/DOMKit/WebIDL/SVGPointList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGPointList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGPointList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGPointList].function! } public let jsObject: JSObject @@ -20,36 +20,36 @@ public class SVGPointList: JSBridgedClass { @ReadonlyAttribute public var numberOfItems: UInt32 - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } - public func initialize(newItem: DOMPoint) -> DOMPoint { + @inlinable public func initialize(newItem: DOMPoint) -> DOMPoint { let this = jsObject return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } - public subscript(key: Int) -> DOMPoint { + @inlinable public subscript(key: Int) -> DOMPoint { jsObject[key].fromJSValue()! } - public func insertItemBefore(newItem: DOMPoint, index: UInt32) -> DOMPoint { + @inlinable public func insertItemBefore(newItem: DOMPoint, index: UInt32) -> DOMPoint { let this = jsObject return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func replaceItem(newItem: DOMPoint, index: UInt32) -> DOMPoint { + @inlinable public func replaceItem(newItem: DOMPoint, index: UInt32) -> DOMPoint { let this = jsObject return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func removeItem(index: UInt32) -> DOMPoint { + @inlinable public func removeItem(index: UInt32) -> DOMPoint { let this = jsObject return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } - public func appendItem(newItem: DOMPoint) -> DOMPoint { + @inlinable public func appendItem(newItem: DOMPoint) -> DOMPoint { let this = jsObject return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SVGPolygonElement.swift b/Sources/DOMKit/WebIDL/SVGPolygonElement.swift index ebc02247..7effcea5 100644 --- a/Sources/DOMKit/WebIDL/SVGPolygonElement.swift +++ b/Sources/DOMKit/WebIDL/SVGPolygonElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGPolygonElement: SVGGeometryElement, SVGAnimatedPoints { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGPolygonElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGPolygonElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGPolylineElement.swift b/Sources/DOMKit/WebIDL/SVGPolylineElement.swift index 23d6b323..d6c37154 100644 --- a/Sources/DOMKit/WebIDL/SVGPolylineElement.swift +++ b/Sources/DOMKit/WebIDL/SVGPolylineElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGPolylineElement: SVGGeometryElement, SVGAnimatedPoints { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGPolylineElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGPolylineElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift b/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift index 347b9a4c..b50dd291 100644 --- a/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift +++ b/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGPreserveAspectRatio: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGPreserveAspectRatio].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGPreserveAspectRatio].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift b/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift index 66e6c3a4..4415ffd4 100644 --- a/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift +++ b/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGRadialGradientElement: SVGGradientElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGRadialGradientElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGRadialGradientElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _cx = ReadonlyAttribute(jsObject: jsObject, name: Strings.cx) diff --git a/Sources/DOMKit/WebIDL/SVGRectElement.swift b/Sources/DOMKit/WebIDL/SVGRectElement.swift index 1e0fbc73..ac3ac6bd 100644 --- a/Sources/DOMKit/WebIDL/SVGRectElement.swift +++ b/Sources/DOMKit/WebIDL/SVGRectElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGRectElement: SVGGeometryElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGRectElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGRectElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) diff --git a/Sources/DOMKit/WebIDL/SVGSVGElement.swift b/Sources/DOMKit/WebIDL/SVGSVGElement.swift index 0ad174fa..e39334d9 100644 --- a/Sources/DOMKit/WebIDL/SVGSVGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGSVGElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHandlers { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGSVGElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGSVGElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) @@ -34,117 +34,117 @@ public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHand @ReadonlyAttribute public var currentTranslate: DOMPointReadOnly - public func getIntersectionList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { + @inlinable public func getIntersectionList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { let this = jsObject return this[Strings.getIntersectionList].function!(this: this, arguments: [rect.jsValue(), referenceElement.jsValue()]).fromJSValue()! } - public func getEnclosureList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { + @inlinable public func getEnclosureList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { let this = jsObject return this[Strings.getEnclosureList].function!(this: this, arguments: [rect.jsValue(), referenceElement.jsValue()]).fromJSValue()! } - public func checkIntersection(element: SVGElement, rect: DOMRectReadOnly) -> Bool { + @inlinable public func checkIntersection(element: SVGElement, rect: DOMRectReadOnly) -> Bool { let this = jsObject return this[Strings.checkIntersection].function!(this: this, arguments: [element.jsValue(), rect.jsValue()]).fromJSValue()! } - public func checkEnclosure(element: SVGElement, rect: DOMRectReadOnly) -> Bool { + @inlinable public func checkEnclosure(element: SVGElement, rect: DOMRectReadOnly) -> Bool { let this = jsObject return this[Strings.checkEnclosure].function!(this: this, arguments: [element.jsValue(), rect.jsValue()]).fromJSValue()! } - public func deselectAll() { + @inlinable public func deselectAll() { let this = jsObject _ = this[Strings.deselectAll].function!(this: this, arguments: []) } - public func createSVGNumber() -> SVGNumber { + @inlinable public func createSVGNumber() -> SVGNumber { let this = jsObject return this[Strings.createSVGNumber].function!(this: this, arguments: []).fromJSValue()! } - public func createSVGLength() -> SVGLength { + @inlinable public func createSVGLength() -> SVGLength { let this = jsObject return this[Strings.createSVGLength].function!(this: this, arguments: []).fromJSValue()! } - public func createSVGAngle() -> SVGAngle { + @inlinable public func createSVGAngle() -> SVGAngle { let this = jsObject return this[Strings.createSVGAngle].function!(this: this, arguments: []).fromJSValue()! } - public func createSVGPoint() -> DOMPoint { + @inlinable public func createSVGPoint() -> DOMPoint { let this = jsObject return this[Strings.createSVGPoint].function!(this: this, arguments: []).fromJSValue()! } - public func createSVGMatrix() -> DOMMatrix { + @inlinable public func createSVGMatrix() -> DOMMatrix { let this = jsObject return this[Strings.createSVGMatrix].function!(this: this, arguments: []).fromJSValue()! } - public func createSVGRect() -> DOMRect { + @inlinable public func createSVGRect() -> DOMRect { let this = jsObject return this[Strings.createSVGRect].function!(this: this, arguments: []).fromJSValue()! } - public func createSVGTransform() -> SVGTransform { + @inlinable public func createSVGTransform() -> SVGTransform { let this = jsObject return this[Strings.createSVGTransform].function!(this: this, arguments: []).fromJSValue()! } - public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { + @inlinable public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { let this = jsObject return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]).fromJSValue()! } - public func getElementById(elementId: String) -> Element { + @inlinable public func getElementById(elementId: String) -> Element { let this = jsObject return this[Strings.getElementById].function!(this: this, arguments: [elementId.jsValue()]).fromJSValue()! } - public func suspendRedraw(maxWaitMilliseconds: UInt32) -> UInt32 { + @inlinable public func suspendRedraw(maxWaitMilliseconds: UInt32) -> UInt32 { let this = jsObject return this[Strings.suspendRedraw].function!(this: this, arguments: [maxWaitMilliseconds.jsValue()]).fromJSValue()! } - public func unsuspendRedraw(suspendHandleID: UInt32) { + @inlinable public func unsuspendRedraw(suspendHandleID: UInt32) { let this = jsObject _ = this[Strings.unsuspendRedraw].function!(this: this, arguments: [suspendHandleID.jsValue()]) } - public func unsuspendRedrawAll() { + @inlinable public func unsuspendRedrawAll() { let this = jsObject _ = this[Strings.unsuspendRedrawAll].function!(this: this, arguments: []) } - public func forceRedraw() { + @inlinable public func forceRedraw() { let this = jsObject _ = this[Strings.forceRedraw].function!(this: this, arguments: []) } - public func pauseAnimations() { + @inlinable public func pauseAnimations() { let this = jsObject _ = this[Strings.pauseAnimations].function!(this: this, arguments: []) } - public func unpauseAnimations() { + @inlinable public func unpauseAnimations() { let this = jsObject _ = this[Strings.unpauseAnimations].function!(this: this, arguments: []) } - public func animationsPaused() -> Bool { + @inlinable public func animationsPaused() -> Bool { let this = jsObject return this[Strings.animationsPaused].function!(this: this, arguments: []).fromJSValue()! } - public func getCurrentTime() -> Float { + @inlinable public func getCurrentTime() -> Float { let this = jsObject return this[Strings.getCurrentTime].function!(this: this, arguments: []).fromJSValue()! } - public func setCurrentTime(seconds: Float) { + @inlinable public func setCurrentTime(seconds: Float) { let this = jsObject _ = this[Strings.setCurrentTime].function!(this: this, arguments: [seconds.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SVGScriptElement.swift b/Sources/DOMKit/WebIDL/SVGScriptElement.swift index e53ed4ec..2420b54f 100644 --- a/Sources/DOMKit/WebIDL/SVGScriptElement.swift +++ b/Sources/DOMKit/WebIDL/SVGScriptElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGScriptElement: SVGElement, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGScriptElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGScriptElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) diff --git a/Sources/DOMKit/WebIDL/SVGSetElement.swift b/Sources/DOMKit/WebIDL/SVGSetElement.swift index 08b215da..bdcbff03 100644 --- a/Sources/DOMKit/WebIDL/SVGSetElement.swift +++ b/Sources/DOMKit/WebIDL/SVGSetElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGSetElement: SVGAnimationElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGSetElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGSetElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGStopElement.swift b/Sources/DOMKit/WebIDL/SVGStopElement.swift index 51cf8868..f965aa11 100644 --- a/Sources/DOMKit/WebIDL/SVGStopElement.swift +++ b/Sources/DOMKit/WebIDL/SVGStopElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGStopElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGStopElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGStopElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) diff --git a/Sources/DOMKit/WebIDL/SVGStringList.swift b/Sources/DOMKit/WebIDL/SVGStringList.swift index d3995a2b..9ee4d71e 100644 --- a/Sources/DOMKit/WebIDL/SVGStringList.swift +++ b/Sources/DOMKit/WebIDL/SVGStringList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGStringList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGStringList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGStringList].function! } public let jsObject: JSObject @@ -20,36 +20,36 @@ public class SVGStringList: JSBridgedClass { @ReadonlyAttribute public var numberOfItems: UInt32 - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } - public func initialize(newItem: String) -> String { + @inlinable public func initialize(newItem: String) -> String { let this = jsObject return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } - public subscript(key: Int) -> String { + @inlinable public subscript(key: Int) -> String { jsObject[key].fromJSValue()! } - public func insertItemBefore(newItem: String, index: UInt32) -> String { + @inlinable public func insertItemBefore(newItem: String, index: UInt32) -> String { let this = jsObject return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func replaceItem(newItem: String, index: UInt32) -> String { + @inlinable public func replaceItem(newItem: String, index: UInt32) -> String { let this = jsObject return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func removeItem(index: UInt32) -> String { + @inlinable public func removeItem(index: UInt32) -> String { let this = jsObject return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } - public func appendItem(newItem: String) -> String { + @inlinable public func appendItem(newItem: String) -> String { let this = jsObject return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SVGStyleElement.swift b/Sources/DOMKit/WebIDL/SVGStyleElement.swift index 079041e5..108541ec 100644 --- a/Sources/DOMKit/WebIDL/SVGStyleElement.swift +++ b/Sources/DOMKit/WebIDL/SVGStyleElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGStyleElement: SVGElement, LinkStyle { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGStyleElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGStyleElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) diff --git a/Sources/DOMKit/WebIDL/SVGSwitchElement.swift b/Sources/DOMKit/WebIDL/SVGSwitchElement.swift index 037d4c95..d75a5584 100644 --- a/Sources/DOMKit/WebIDL/SVGSwitchElement.swift +++ b/Sources/DOMKit/WebIDL/SVGSwitchElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGSwitchElement: SVGGraphicsElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGSwitchElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGSwitchElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGSymbolElement.swift b/Sources/DOMKit/WebIDL/SVGSymbolElement.swift index 94e45c51..81551625 100644 --- a/Sources/DOMKit/WebIDL/SVGSymbolElement.swift +++ b/Sources/DOMKit/WebIDL/SVGSymbolElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGSymbolElement: SVGGraphicsElement, SVGFitToViewBox { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGSymbolElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGSymbolElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGTSpanElement.swift b/Sources/DOMKit/WebIDL/SVGTSpanElement.swift index 5068cf19..552134c8 100644 --- a/Sources/DOMKit/WebIDL/SVGTSpanElement.swift +++ b/Sources/DOMKit/WebIDL/SVGTSpanElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGTSpanElement: SVGTextPositioningElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGTSpanElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTSpanElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGTests.swift b/Sources/DOMKit/WebIDL/SVGTests.swift index 4a235197..904e0da3 100644 --- a/Sources/DOMKit/WebIDL/SVGTests.swift +++ b/Sources/DOMKit/WebIDL/SVGTests.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol SVGTests: JSBridgedClass {} public extension SVGTests { - var requiredExtensions: SVGStringList { ReadonlyAttribute[Strings.requiredExtensions, in: jsObject] } + @inlinable var requiredExtensions: SVGStringList { ReadonlyAttribute[Strings.requiredExtensions, in: jsObject] } - var systemLanguage: SVGStringList { ReadonlyAttribute[Strings.systemLanguage, in: jsObject] } + @inlinable var systemLanguage: SVGStringList { ReadonlyAttribute[Strings.systemLanguage, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/SVGTextContentElement.swift b/Sources/DOMKit/WebIDL/SVGTextContentElement.swift index b3e277f5..2deb154c 100644 --- a/Sources/DOMKit/WebIDL/SVGTextContentElement.swift +++ b/Sources/DOMKit/WebIDL/SVGTextContentElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGTextContentElement: SVGGraphicsElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextContentElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextContentElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _textLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.textLength) @@ -24,47 +24,47 @@ public class SVGTextContentElement: SVGGraphicsElement { @ReadonlyAttribute public var lengthAdjust: SVGAnimatedEnumeration - public func getNumberOfChars() -> Int32 { + @inlinable public func getNumberOfChars() -> Int32 { let this = jsObject return this[Strings.getNumberOfChars].function!(this: this, arguments: []).fromJSValue()! } - public func getComputedTextLength() -> Float { + @inlinable public func getComputedTextLength() -> Float { let this = jsObject return this[Strings.getComputedTextLength].function!(this: this, arguments: []).fromJSValue()! } - public func getSubStringLength(charnum: UInt32, nchars: UInt32) -> Float { + @inlinable public func getSubStringLength(charnum: UInt32, nchars: UInt32) -> Float { let this = jsObject return this[Strings.getSubStringLength].function!(this: this, arguments: [charnum.jsValue(), nchars.jsValue()]).fromJSValue()! } - public func getStartPositionOfChar(charnum: UInt32) -> DOMPoint { + @inlinable public func getStartPositionOfChar(charnum: UInt32) -> DOMPoint { let this = jsObject return this[Strings.getStartPositionOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! } - public func getEndPositionOfChar(charnum: UInt32) -> DOMPoint { + @inlinable public func getEndPositionOfChar(charnum: UInt32) -> DOMPoint { let this = jsObject return this[Strings.getEndPositionOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! } - public func getExtentOfChar(charnum: UInt32) -> DOMRect { + @inlinable public func getExtentOfChar(charnum: UInt32) -> DOMRect { let this = jsObject return this[Strings.getExtentOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! } - public func getRotationOfChar(charnum: UInt32) -> Float { + @inlinable public func getRotationOfChar(charnum: UInt32) -> Float { let this = jsObject return this[Strings.getRotationOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! } - public func getCharNumAtPosition(point: DOMPointInit? = nil) -> Int32 { + @inlinable public func getCharNumAtPosition(point: DOMPointInit? = nil) -> Int32 { let this = jsObject return this[Strings.getCharNumAtPosition].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! } - public func selectSubString(charnum: UInt32, nchars: UInt32) { + @inlinable public func selectSubString(charnum: UInt32, nchars: UInt32) { let this = jsObject _ = this[Strings.selectSubString].function!(this: this, arguments: [charnum.jsValue(), nchars.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SVGTextElement.swift b/Sources/DOMKit/WebIDL/SVGTextElement.swift index bc5646c8..774cb1c2 100644 --- a/Sources/DOMKit/WebIDL/SVGTextElement.swift +++ b/Sources/DOMKit/WebIDL/SVGTextElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGTextElement: SVGTextPositioningElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGTextPathElement.swift b/Sources/DOMKit/WebIDL/SVGTextPathElement.swift index eb00b3f1..f9fc9c17 100644 --- a/Sources/DOMKit/WebIDL/SVGTextPathElement.swift +++ b/Sources/DOMKit/WebIDL/SVGTextPathElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGTextPathElement: SVGTextContentElement, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextPathElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextPathElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _startOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.startOffset) diff --git a/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift b/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift index fdd87072..2c890286 100644 --- a/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift +++ b/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGTextPositioningElement: SVGTextContentElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextPositioningElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextPositioningElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) diff --git a/Sources/DOMKit/WebIDL/SVGTitleElement.swift b/Sources/DOMKit/WebIDL/SVGTitleElement.swift index 716e750f..ff2db400 100644 --- a/Sources/DOMKit/WebIDL/SVGTitleElement.swift +++ b/Sources/DOMKit/WebIDL/SVGTitleElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGTitleElement: SVGElement { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGTitleElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTitleElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGTransform.swift b/Sources/DOMKit/WebIDL/SVGTransform.swift index dc4ff06b..b942169d 100644 --- a/Sources/DOMKit/WebIDL/SVGTransform.swift +++ b/Sources/DOMKit/WebIDL/SVGTransform.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGTransform: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGTransform].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGTransform].function! } public let jsObject: JSObject @@ -38,32 +38,32 @@ public class SVGTransform: JSBridgedClass { @ReadonlyAttribute public var angle: Float - public func setMatrix(matrix: DOMMatrix2DInit? = nil) { + @inlinable public func setMatrix(matrix: DOMMatrix2DInit? = nil) { let this = jsObject _ = this[Strings.setMatrix].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]) } - public func setTranslate(tx: Float, ty: Float) { + @inlinable public func setTranslate(tx: Float, ty: Float) { let this = jsObject _ = this[Strings.setTranslate].function!(this: this, arguments: [tx.jsValue(), ty.jsValue()]) } - public func setScale(sx: Float, sy: Float) { + @inlinable public func setScale(sx: Float, sy: Float) { let this = jsObject _ = this[Strings.setScale].function!(this: this, arguments: [sx.jsValue(), sy.jsValue()]) } - public func setRotate(angle: Float, cx: Float, cy: Float) { + @inlinable public func setRotate(angle: Float, cx: Float, cy: Float) { let this = jsObject _ = this[Strings.setRotate].function!(this: this, arguments: [angle.jsValue(), cx.jsValue(), cy.jsValue()]) } - public func setSkewX(angle: Float) { + @inlinable public func setSkewX(angle: Float) { let this = jsObject _ = this[Strings.setSkewX].function!(this: this, arguments: [angle.jsValue()]) } - public func setSkewY(angle: Float) { + @inlinable public func setSkewY(angle: Float) { let this = jsObject _ = this[Strings.setSkewY].function!(this: this, arguments: [angle.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SVGTransformList.swift b/Sources/DOMKit/WebIDL/SVGTransformList.swift index bdd37548..5c930ac1 100644 --- a/Sources/DOMKit/WebIDL/SVGTransformList.swift +++ b/Sources/DOMKit/WebIDL/SVGTransformList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGTransformList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGTransformList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGTransformList].function! } public let jsObject: JSObject @@ -20,48 +20,48 @@ public class SVGTransformList: JSBridgedClass { @ReadonlyAttribute public var numberOfItems: UInt32 - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } - public func initialize(newItem: SVGTransform) -> SVGTransform { + @inlinable public func initialize(newItem: SVGTransform) -> SVGTransform { let this = jsObject return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } - public subscript(key: Int) -> SVGTransform { + @inlinable public subscript(key: Int) -> SVGTransform { jsObject[key].fromJSValue()! } - public func insertItemBefore(newItem: SVGTransform, index: UInt32) -> SVGTransform { + @inlinable public func insertItemBefore(newItem: SVGTransform, index: UInt32) -> SVGTransform { let this = jsObject return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func replaceItem(newItem: SVGTransform, index: UInt32) -> SVGTransform { + @inlinable public func replaceItem(newItem: SVGTransform, index: UInt32) -> SVGTransform { let this = jsObject return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! } - public func removeItem(index: UInt32) -> SVGTransform { + @inlinable public func removeItem(index: UInt32) -> SVGTransform { let this = jsObject return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } - public func appendItem(newItem: SVGTransform) -> SVGTransform { + @inlinable public func appendItem(newItem: SVGTransform) -> SVGTransform { let this = jsObject return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 - public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { + @inlinable public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { let this = jsObject return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]).fromJSValue()! } - public func consolidate() -> SVGTransform? { + @inlinable public func consolidate() -> SVGTransform? { let this = jsObject return this[Strings.consolidate].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SVGURIReference.swift b/Sources/DOMKit/WebIDL/SVGURIReference.swift index 79105bd9..6d5d1048 100644 --- a/Sources/DOMKit/WebIDL/SVGURIReference.swift +++ b/Sources/DOMKit/WebIDL/SVGURIReference.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol SVGURIReference: JSBridgedClass {} public extension SVGURIReference { - var href: SVGAnimatedString { ReadonlyAttribute[Strings.href, in: jsObject] } + @inlinable var href: SVGAnimatedString { ReadonlyAttribute[Strings.href, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/SVGUnitTypes.swift b/Sources/DOMKit/WebIDL/SVGUnitTypes.swift index 6efc8975..6aa1bf78 100644 --- a/Sources/DOMKit/WebIDL/SVGUnitTypes.swift +++ b/Sources/DOMKit/WebIDL/SVGUnitTypes.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGUnitTypes: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SVGUnitTypes].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGUnitTypes].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SVGUseElement.swift b/Sources/DOMKit/WebIDL/SVGUseElement.swift index 911e2ad7..7e45cd6c 100644 --- a/Sources/DOMKit/WebIDL/SVGUseElement.swift +++ b/Sources/DOMKit/WebIDL/SVGUseElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGUseElement: SVGGraphicsElement, SVGURIReference { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGUseElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGUseElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) diff --git a/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift b/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift index 4f244233..d00b0273 100644 --- a/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGUseElementShadowRoot: ShadowRoot { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGUseElementShadowRoot].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGUseElementShadowRoot].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/SVGViewElement.swift b/Sources/DOMKit/WebIDL/SVGViewElement.swift index 1e4a6a1b..70d79dcf 100644 --- a/Sources/DOMKit/WebIDL/SVGViewElement.swift +++ b/Sources/DOMKit/WebIDL/SVGViewElement.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SVGViewElement: SVGElement, SVGFitToViewBox { - override public class var constructor: JSFunction { JSObject.global[Strings.SVGViewElement].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGViewElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/Sanitizer.swift b/Sources/DOMKit/WebIDL/Sanitizer.swift index 98aebad1..64bffd65 100644 --- a/Sources/DOMKit/WebIDL/Sanitizer.swift +++ b/Sources/DOMKit/WebIDL/Sanitizer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Sanitizer: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Sanitizer].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Sanitizer].function! } public let jsObject: JSObject @@ -12,26 +12,26 @@ public class Sanitizer: JSBridgedClass { self.jsObject = jsObject } - public convenience init(config: SanitizerConfig? = nil) { + @inlinable public convenience init(config: SanitizerConfig? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [config?.jsValue() ?? .undefined])) } - public func sanitize(input: __UNSUPPORTED_UNION__) -> DocumentFragment { + @inlinable public func sanitize(input: __UNSUPPORTED_UNION__) -> DocumentFragment { let this = jsObject return this[Strings.sanitize].function!(this: this, arguments: [input.jsValue()]).fromJSValue()! } - public func sanitizeFor(element: String, input: String) -> Element? { + @inlinable public func sanitizeFor(element: String, input: String) -> Element? { let this = jsObject return this[Strings.sanitizeFor].function!(this: this, arguments: [element.jsValue(), input.jsValue()]).fromJSValue()! } - public func getConfiguration() -> SanitizerConfig { + @inlinable public func getConfiguration() -> SanitizerConfig { let this = jsObject return this[Strings.getConfiguration].function!(this: this, arguments: []).fromJSValue()! } - public static func getDefaultConfiguration() -> SanitizerConfig { + @inlinable public static func getDefaultConfiguration() -> SanitizerConfig { let this = constructor return this[Strings.getDefaultConfiguration].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Scheduler.swift b/Sources/DOMKit/WebIDL/Scheduler.swift index 838c287c..9edfa33e 100644 --- a/Sources/DOMKit/WebIDL/Scheduler.swift +++ b/Sources/DOMKit/WebIDL/Scheduler.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Scheduler: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Scheduler].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Scheduler].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/Scheduling.swift b/Sources/DOMKit/WebIDL/Scheduling.swift index 916c2ad5..f106a2f7 100644 --- a/Sources/DOMKit/WebIDL/Scheduling.swift +++ b/Sources/DOMKit/WebIDL/Scheduling.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Scheduling: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Scheduling].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Scheduling].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class Scheduling: JSBridgedClass { self.jsObject = jsObject } - public func isInputPending(isInputPendingOptions: IsInputPendingOptions? = nil) -> Bool { + @inlinable public func isInputPending(isInputPendingOptions: IsInputPendingOptions? = nil) -> Bool { let this = jsObject return this[Strings.isInputPending].function!(this: this, arguments: [isInputPendingOptions?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Screen.swift b/Sources/DOMKit/WebIDL/Screen.swift index ea8152f9..d9441297 100644 --- a/Sources/DOMKit/WebIDL/Screen.swift +++ b/Sources/DOMKit/WebIDL/Screen.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Screen: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Screen].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Screen].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ScreenIdleState.swift b/Sources/DOMKit/WebIDL/ScreenIdleState.swift index 42897520..1e3691f9 100644 --- a/Sources/DOMKit/WebIDL/ScreenIdleState.swift +++ b/Sources/DOMKit/WebIDL/ScreenIdleState.swift @@ -7,16 +7,16 @@ public enum ScreenIdleState: JSString, JSValueCompatible { case locked = "locked" case unlocked = "unlocked" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ScreenOrientation.swift b/Sources/DOMKit/WebIDL/ScreenOrientation.swift index d8743543..45fce6d0 100644 --- a/Sources/DOMKit/WebIDL/ScreenOrientation.swift +++ b/Sources/DOMKit/WebIDL/ScreenOrientation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ScreenOrientation: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.ScreenOrientation].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ScreenOrientation].function! } public required init(unsafelyWrapping jsObject: JSObject) { _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) @@ -13,19 +13,19 @@ public class ScreenOrientation: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func lock(orientation: OrientationLockType) -> JSPromise { + @inlinable public func lock(orientation: OrientationLockType) -> JSPromise { let this = jsObject return this[Strings.lock].function!(this: this, arguments: [orientation.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func lock(orientation: OrientationLockType) async throws { + @inlinable public func lock(orientation: OrientationLockType) async throws { let this = jsObject let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [orientation.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func unlock() { + @inlinable public func unlock() { let this = jsObject _ = this[Strings.unlock].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift b/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift index 112b6191..1e0ec540 100644 --- a/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift +++ b/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ScriptProcessorNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.ScriptProcessorNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ScriptProcessorNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onaudioprocess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaudioprocess) diff --git a/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift b/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift index 9938be99..449997b7 100644 --- a/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift +++ b/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ScriptingPolicyReportBody: ReportBody { - override public class var constructor: JSFunction { JSObject.global[Strings.ScriptingPolicyReportBody].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ScriptingPolicyReportBody].function! } public required init(unsafelyWrapping jsObject: JSObject) { _violationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.violationType) @@ -15,7 +15,7 @@ public class ScriptingPolicyReportBody: ReportBody { super.init(unsafelyWrapping: jsObject) } - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift b/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift index 1975b316..f00470e5 100644 --- a/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift +++ b/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift @@ -9,16 +9,16 @@ public enum ScriptingPolicyViolationType: JSString, JSValueCompatible { case inlineEventHandler = "inlineEventHandler" case eval = "eval" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ScrollBehavior.swift b/Sources/DOMKit/WebIDL/ScrollBehavior.swift index 017c72d4..ed2ac2ff 100644 --- a/Sources/DOMKit/WebIDL/ScrollBehavior.swift +++ b/Sources/DOMKit/WebIDL/ScrollBehavior.swift @@ -7,16 +7,16 @@ public enum ScrollBehavior: JSString, JSValueCompatible { case auto = "auto" case smooth = "smooth" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ScrollDirection.swift b/Sources/DOMKit/WebIDL/ScrollDirection.swift index 54dc49da..04ac7d66 100644 --- a/Sources/DOMKit/WebIDL/ScrollDirection.swift +++ b/Sources/DOMKit/WebIDL/ScrollDirection.swift @@ -9,16 +9,16 @@ public enum ScrollDirection: JSString, JSValueCompatible { case horizontal = "horizontal" case vertical = "vertical" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift b/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift index 4c5bb5a5..2515ce36 100644 --- a/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift +++ b/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift @@ -9,16 +9,16 @@ public enum ScrollLogicalPosition: JSString, JSValueCompatible { case end = "end" case nearest = "nearest" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ScrollRestoration.swift b/Sources/DOMKit/WebIDL/ScrollRestoration.swift index 3b7bb2ec..7aa95009 100644 --- a/Sources/DOMKit/WebIDL/ScrollRestoration.swift +++ b/Sources/DOMKit/WebIDL/ScrollRestoration.swift @@ -7,16 +7,16 @@ public enum ScrollRestoration: JSString, JSValueCompatible { case auto = "auto" case manual = "manual" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ScrollSetting.swift b/Sources/DOMKit/WebIDL/ScrollSetting.swift index 263b9675..7358cb7d 100644 --- a/Sources/DOMKit/WebIDL/ScrollSetting.swift +++ b/Sources/DOMKit/WebIDL/ScrollSetting.swift @@ -7,16 +7,16 @@ public enum ScrollSetting: JSString, JSValueCompatible { case _empty = "" case up = "up" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ScrollTimeline.swift b/Sources/DOMKit/WebIDL/ScrollTimeline.swift index ba862e70..d71a56d4 100644 --- a/Sources/DOMKit/WebIDL/ScrollTimeline.swift +++ b/Sources/DOMKit/WebIDL/ScrollTimeline.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ScrollTimeline: AnimationTimeline { - override public class var constructor: JSFunction { JSObject.global[Strings.ScrollTimeline].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ScrollTimeline].function! } public required init(unsafelyWrapping jsObject: JSObject) { _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) @@ -13,7 +13,7 @@ public class ScrollTimeline: AnimationTimeline { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: ScrollTimelineOptions? = nil) { + @inlinable public convenience init(options: ScrollTimelineOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift b/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift index 0cd98a95..36b10e1b 100644 --- a/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift +++ b/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum ScrollTimelineAutoKeyword: JSString, JSValueCompatible { case auto = "auto" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift index 11682fd8..8d295f5f 100644 --- a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift +++ b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SecurityPolicyViolationEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.SecurityPolicyViolationEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SecurityPolicyViolationEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _documentURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURI) @@ -22,7 +22,7 @@ public class SecurityPolicyViolationEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: SecurityPolicyViolationEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: SecurityPolicyViolationEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift index 03a7bda6..132ff1b5 100644 --- a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift +++ b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift @@ -7,16 +7,16 @@ public enum SecurityPolicyViolationEventDisposition: JSString, JSValueCompatible case enforce = "enforce" case report = "report" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Selection.swift b/Sources/DOMKit/WebIDL/Selection.swift index 16909a18..a95b5762 100644 --- a/Sources/DOMKit/WebIDL/Selection.swift +++ b/Sources/DOMKit/WebIDL/Selection.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Selection: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Selection].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Selection].function! } public let jsObject: JSObject @@ -40,77 +40,77 @@ public class Selection: JSBridgedClass { @ReadonlyAttribute public var type: String - public func getRangeAt(index: UInt32) -> Range { + @inlinable public func getRangeAt(index: UInt32) -> Range { let this = jsObject return this[Strings.getRangeAt].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } - public func addRange(range: Range) { + @inlinable public func addRange(range: Range) { let this = jsObject _ = this[Strings.addRange].function!(this: this, arguments: [range.jsValue()]) } - public func removeRange(range: Range) { + @inlinable public func removeRange(range: Range) { let this = jsObject _ = this[Strings.removeRange].function!(this: this, arguments: [range.jsValue()]) } - public func removeAllRanges() { + @inlinable public func removeAllRanges() { let this = jsObject _ = this[Strings.removeAllRanges].function!(this: this, arguments: []) } - public func empty() { + @inlinable public func empty() { let this = jsObject _ = this[Strings.empty].function!(this: this, arguments: []) } - public func collapse(node: Node?, offset: UInt32? = nil) { + @inlinable public func collapse(node: Node?, offset: UInt32? = nil) { let this = jsObject _ = this[Strings.collapse].function!(this: this, arguments: [node.jsValue(), offset?.jsValue() ?? .undefined]) } - public func setPosition(node: Node?, offset: UInt32? = nil) { + @inlinable public func setPosition(node: Node?, offset: UInt32? = nil) { let this = jsObject _ = this[Strings.setPosition].function!(this: this, arguments: [node.jsValue(), offset?.jsValue() ?? .undefined]) } - public func collapseToStart() { + @inlinable public func collapseToStart() { let this = jsObject _ = this[Strings.collapseToStart].function!(this: this, arguments: []) } - public func collapseToEnd() { + @inlinable public func collapseToEnd() { let this = jsObject _ = this[Strings.collapseToEnd].function!(this: this, arguments: []) } - public func extend(node: Node, offset: UInt32? = nil) { + @inlinable public func extend(node: Node, offset: UInt32? = nil) { let this = jsObject _ = this[Strings.extend].function!(this: this, arguments: [node.jsValue(), offset?.jsValue() ?? .undefined]) } - public func setBaseAndExtent(anchorNode: Node, anchorOffset: UInt32, focusNode: Node, focusOffset: UInt32) { + @inlinable public func setBaseAndExtent(anchorNode: Node, anchorOffset: UInt32, focusNode: Node, focusOffset: UInt32) { let this = jsObject _ = this[Strings.setBaseAndExtent].function!(this: this, arguments: [anchorNode.jsValue(), anchorOffset.jsValue(), focusNode.jsValue(), focusOffset.jsValue()]) } - public func selectAllChildren(node: Node) { + @inlinable public func selectAllChildren(node: Node) { let this = jsObject _ = this[Strings.selectAllChildren].function!(this: this, arguments: [node.jsValue()]) } - public func deleteFromDocument() { + @inlinable public func deleteFromDocument() { let this = jsObject _ = this[Strings.deleteFromDocument].function!(this: this, arguments: []) } - public func containsNode(node: Node, allowPartialContainment: Bool? = nil) -> Bool { + @inlinable public func containsNode(node: Node, allowPartialContainment: Bool? = nil) -> Bool { let this = jsObject return this[Strings.containsNode].function!(this: this, arguments: [node.jsValue(), allowPartialContainment?.jsValue() ?? .undefined]).fromJSValue()! } - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SelectionMode.swift b/Sources/DOMKit/WebIDL/SelectionMode.swift index 73d9e54f..c0d5ceb5 100644 --- a/Sources/DOMKit/WebIDL/SelectionMode.swift +++ b/Sources/DOMKit/WebIDL/SelectionMode.swift @@ -9,16 +9,16 @@ public enum SelectionMode: JSString, JSValueCompatible { case end = "end" case preserve = "preserve" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Sensor.swift b/Sources/DOMKit/WebIDL/Sensor.swift index bf066fed..cf070f51 100644 --- a/Sources/DOMKit/WebIDL/Sensor.swift +++ b/Sources/DOMKit/WebIDL/Sensor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Sensor: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Sensor].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Sensor].function! } public required init(unsafelyWrapping jsObject: JSObject) { _activated = ReadonlyAttribute(jsObject: jsObject, name: Strings.activated) @@ -25,12 +25,12 @@ public class Sensor: EventTarget { @ReadonlyAttribute public var timestamp: DOMHighResTimeStamp? - public func start() { + @inlinable public func start() { let this = jsObject _ = this[Strings.start].function!(this: this, arguments: []) } - public func stop() { + @inlinable public func stop() { let this = jsObject _ = this[Strings.stop].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/SensorErrorEvent.swift b/Sources/DOMKit/WebIDL/SensorErrorEvent.swift index da22fbb7..bf0ce2d3 100644 --- a/Sources/DOMKit/WebIDL/SensorErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SensorErrorEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class SensorErrorEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.SensorErrorEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SensorErrorEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, errorEventInitDict: SensorErrorEventInit) { + @inlinable public convenience init(type: String, errorEventInitDict: SensorErrorEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), errorEventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/SequenceEffect.swift b/Sources/DOMKit/WebIDL/SequenceEffect.swift index 8410c752..d61f9c8f 100644 --- a/Sources/DOMKit/WebIDL/SequenceEffect.swift +++ b/Sources/DOMKit/WebIDL/SequenceEffect.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit public class SequenceEffect: GroupEffect { - override public class var constructor: JSFunction { JSObject.global[Strings.SequenceEffect].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SequenceEffect].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue(), timing?.jsValue() ?? .undefined])) } - override public func clone() -> Self { + @inlinable override public func clone() -> Self { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Serial.swift b/Sources/DOMKit/WebIDL/Serial.swift index 82478bc3..ff20c49c 100644 --- a/Sources/DOMKit/WebIDL/Serial.swift +++ b/Sources/DOMKit/WebIDL/Serial.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Serial: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.Serial].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Serial].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) @@ -18,25 +18,25 @@ public class Serial: EventTarget { @ClosureAttribute1Optional public var ondisconnect: EventHandler - public func getPorts() -> JSPromise { + @inlinable public func getPorts() -> JSPromise { let this = jsObject return this[Strings.getPorts].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getPorts() async throws -> [SerialPort] { + @inlinable public func getPorts() async throws -> [SerialPort] { let this = jsObject let _promise: JSPromise = this[Strings.getPorts].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func requestPort(options: SerialPortRequestOptions? = nil) -> JSPromise { + @inlinable public func requestPort(options: SerialPortRequestOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestPort(options: SerialPortRequestOptions? = nil) async throws -> SerialPort { + @inlinable public func requestPort(options: SerialPortRequestOptions? = nil) async throws -> SerialPort { let this = jsObject let _promise: JSPromise = this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/SerialPort.swift b/Sources/DOMKit/WebIDL/SerialPort.swift index 6583c5c8..cb3f3ed2 100644 --- a/Sources/DOMKit/WebIDL/SerialPort.swift +++ b/Sources/DOMKit/WebIDL/SerialPort.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SerialPort: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.SerialPort].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SerialPort].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) @@ -26,54 +26,54 @@ public class SerialPort: EventTarget { @ReadonlyAttribute public var writable: WritableStream - public func getInfo() -> SerialPortInfo { + @inlinable public func getInfo() -> SerialPortInfo { let this = jsObject return this[Strings.getInfo].function!(this: this, arguments: []).fromJSValue()! } - public func open(options: SerialOptions) -> JSPromise { + @inlinable public func open(options: SerialOptions) -> JSPromise { let this = jsObject return this[Strings.open].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func open(options: SerialOptions) async throws { + @inlinable public func open(options: SerialOptions) async throws { let this = jsObject let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func setSignals(signals: SerialOutputSignals? = nil) -> JSPromise { + @inlinable public func setSignals(signals: SerialOutputSignals? = nil) -> JSPromise { let this = jsObject return this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func setSignals(signals: SerialOutputSignals? = nil) async throws { + @inlinable public func setSignals(signals: SerialOutputSignals? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func getSignals() -> JSPromise { + @inlinable public func getSignals() -> JSPromise { let this = jsObject return this[Strings.getSignals].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getSignals() async throws -> SerialInputSignals { + @inlinable public func getSignals() async throws -> SerialInputSignals { let this = jsObject let _promise: JSPromise = this[Strings.getSignals].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func close() -> JSPromise { + @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, *) - public func close() async throws { + @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift b/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift index f01605ab..fdfa2914 100644 --- a/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift @@ -5,17 +5,17 @@ import JavaScriptKit public protocol ServiceEventHandlers: JSBridgedClass {} public extension ServiceEventHandlers { - var onserviceadded: EventHandler { + @inlinable var onserviceadded: EventHandler { get { ClosureAttribute1Optional[Strings.onserviceadded, in: jsObject] } set { ClosureAttribute1Optional[Strings.onserviceadded, in: jsObject] = newValue } } - var onservicechanged: EventHandler { + @inlinable var onservicechanged: EventHandler { get { ClosureAttribute1Optional[Strings.onservicechanged, in: jsObject] } set { ClosureAttribute1Optional[Strings.onservicechanged, in: jsObject] = newValue } } - var onserviceremoved: EventHandler { + @inlinable var onserviceremoved: EventHandler { get { ClosureAttribute1Optional[Strings.onserviceremoved, in: jsObject] } set { ClosureAttribute1Optional[Strings.onserviceremoved, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/ServiceWorker.swift b/Sources/DOMKit/WebIDL/ServiceWorker.swift index 3565c1af..21235ddc 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorker.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorker.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ServiceWorker: EventTarget, AbstractWorker { - override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorker].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorker].function! } public required init(unsafelyWrapping jsObject: JSObject) { _scriptURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.scriptURL) @@ -19,12 +19,12 @@ public class ServiceWorker: EventTarget, AbstractWorker { @ReadonlyAttribute public var state: ServiceWorkerState - public func postMessage(message: JSValue, transfer: [JSObject]) { + @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } - public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift index 0a89175b..486ac606 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ServiceWorkerContainer: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerContainer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerContainer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _controller = ReadonlyAttribute(jsObject: jsObject, name: Strings.controller) @@ -21,43 +21,43 @@ public class ServiceWorkerContainer: EventTarget { @ReadonlyAttribute public var ready: JSPromise - public func register(scriptURL: String, options: RegistrationOptions? = nil) -> JSPromise { + @inlinable public func register(scriptURL: String, options: RegistrationOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.register].function!(this: this, arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func register(scriptURL: String, options: RegistrationOptions? = nil) async throws -> ServiceWorkerRegistration { + @inlinable public func register(scriptURL: String, options: RegistrationOptions? = nil) async throws -> ServiceWorkerRegistration { let this = jsObject let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getRegistration(clientURL: String? = nil) -> JSPromise { + @inlinable public func getRegistration(clientURL: String? = nil) -> JSPromise { let this = jsObject return this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getRegistration(clientURL: String? = nil) async throws -> __UNSUPPORTED_UNION__ { + @inlinable public func getRegistration(clientURL: String? = nil) async throws -> __UNSUPPORTED_UNION__ { let this = jsObject let _promise: JSPromise = this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getRegistrations() -> JSPromise { + @inlinable public func getRegistrations() -> JSPromise { let this = jsObject return this[Strings.getRegistrations].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getRegistrations() async throws -> [ServiceWorkerRegistration] { + @inlinable public func getRegistrations() async throws -> [ServiceWorkerRegistration] { let this = jsObject let _promise: JSPromise = this[Strings.getRegistrations].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func startMessages() { + @inlinable public func startMessages() { let this = jsObject _ = this[Strings.startMessages].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift index 25ade41b..f53b5f1d 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ServiceWorkerGlobalScope: WorkerGlobalScope { - override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerGlobalScope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onbackgroundfetchsuccess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbackgroundfetchsuccess) @@ -87,13 +87,13 @@ public class ServiceWorkerGlobalScope: WorkerGlobalScope { @ReadonlyAttribute public var serviceWorker: ServiceWorker - public func skipWaiting() -> JSPromise { + @inlinable public func skipWaiting() -> JSPromise { let this = jsObject return this[Strings.skipWaiting].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func skipWaiting() async throws { + @inlinable public func skipWaiting() async throws { let this = jsObject let _promise: JSPromise = this[Strings.skipWaiting].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift index eaae2f06..7280f003 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ServiceWorkerRegistration: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerRegistration].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerRegistration].function! } public required init(unsafelyWrapping jsObject: JSObject) { _backgroundFetch = ReadonlyAttribute(jsObject: jsObject, name: Strings.backgroundFetch) @@ -36,25 +36,25 @@ public class ServiceWorkerRegistration: EventTarget { @ReadonlyAttribute public var cookies: CookieStoreManager - public func showNotification(title: String, options: NotificationOptions? = nil) -> JSPromise { + @inlinable public func showNotification(title: String, options: NotificationOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.showNotification].function!(this: this, arguments: [title.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showNotification(title: String, options: NotificationOptions? = nil) async throws { + @inlinable public func showNotification(title: String, options: NotificationOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.showNotification].function!(this: this, arguments: [title.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() } - public func getNotifications(filter: GetNotificationOptions? = nil) -> JSPromise { + @inlinable public func getNotifications(filter: GetNotificationOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getNotifications(filter: GetNotificationOptions? = nil) async throws -> [Notification] { + @inlinable public func getNotifications(filter: GetNotificationOptions? = nil) async throws -> [Notification] { let this = jsObject let _promise: JSPromise = this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -87,25 +87,25 @@ public class ServiceWorkerRegistration: EventTarget { @ReadonlyAttribute public var updateViaCache: ServiceWorkerUpdateViaCache - public func update() -> JSPromise { + @inlinable public func update() -> JSPromise { let this = jsObject return this[Strings.update].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func update() async throws { + @inlinable public func update() async throws { let this = jsObject let _promise: JSPromise = this[Strings.update].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func unregister() -> JSPromise { + @inlinable public func unregister() -> JSPromise { let this = jsObject return this[Strings.unregister].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func unregister() async throws -> Bool { + @inlinable public func unregister() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.unregister].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerState.swift b/Sources/DOMKit/WebIDL/ServiceWorkerState.swift index 3bd8c395..c45873b7 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerState.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerState.swift @@ -11,16 +11,16 @@ public enum ServiceWorkerState: JSString, JSValueCompatible { case activated = "activated" case redundant = "redundant" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift b/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift index 0f50c1b5..f4d12b74 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift @@ -8,16 +8,16 @@ public enum ServiceWorkerUpdateViaCache: JSString, JSValueCompatible { case all = "all" case none = "none" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/ShadowAnimation.swift b/Sources/DOMKit/WebIDL/ShadowAnimation.swift index d7af4587..3e776903 100644 --- a/Sources/DOMKit/WebIDL/ShadowAnimation.swift +++ b/Sources/DOMKit/WebIDL/ShadowAnimation.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ShadowAnimation: Animation { - override public class var constructor: JSFunction { JSObject.global[Strings.ShadowAnimation].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ShadowAnimation].function! } public required init(unsafelyWrapping jsObject: JSObject) { _sourceAnimation = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceAnimation) super.init(unsafelyWrapping: jsObject) } - public convenience init(source: Animation, newTarget: __UNSUPPORTED_UNION__) { + @inlinable public convenience init(source: Animation, newTarget: __UNSUPPORTED_UNION__) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue(), newTarget.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/ShadowRoot.swift b/Sources/DOMKit/WebIDL/ShadowRoot.swift index f82fff85..410bcc77 100644 --- a/Sources/DOMKit/WebIDL/ShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/ShadowRoot.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ShadowRoot: DocumentFragment, InnerHTML, DocumentOrShadowRoot { - override public class var constructor: JSFunction { JSObject.global[Strings.ShadowRoot].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ShadowRoot].function! } public required init(unsafelyWrapping jsObject: JSObject) { _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) diff --git a/Sources/DOMKit/WebIDL/ShadowRootMode.swift b/Sources/DOMKit/WebIDL/ShadowRootMode.swift index 5798a255..a3803e51 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootMode.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootMode.swift @@ -7,16 +7,16 @@ public enum ShadowRootMode: JSString, JSValueCompatible { case open = "open" case closed = "closed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SharedWorker.swift b/Sources/DOMKit/WebIDL/SharedWorker.swift index 986ff6b6..82f22510 100644 --- a/Sources/DOMKit/WebIDL/SharedWorker.swift +++ b/Sources/DOMKit/WebIDL/SharedWorker.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class SharedWorker: EventTarget, AbstractWorker { - override public class var constructor: JSFunction { JSObject.global[Strings.SharedWorker].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SharedWorker].function! } public required init(unsafelyWrapping jsObject: JSObject) { _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) super.init(unsafelyWrapping: jsObject) } - public convenience init(scriptURL: String, options: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(scriptURL: String, options: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift index f6840bc4..13284f35 100644 --- a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SharedWorkerGlobalScope: WorkerGlobalScope { - override public class var constructor: JSFunction { JSObject.global[Strings.SharedWorkerGlobalScope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SharedWorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) @@ -15,7 +15,7 @@ public class SharedWorkerGlobalScope: WorkerGlobalScope { @ReadonlyAttribute public var name: String - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift index a9b9718a..05b23253 100644 --- a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift +++ b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift @@ -7,16 +7,16 @@ public enum SlotAssignmentMode: JSString, JSValueCompatible { case manual = "manual" case named = "named" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Slottable.swift b/Sources/DOMKit/WebIDL/Slottable.swift index b66c17e6..64c060ee 100644 --- a/Sources/DOMKit/WebIDL/Slottable.swift +++ b/Sources/DOMKit/WebIDL/Slottable.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol Slottable: JSBridgedClass {} public extension Slottable { - var assignedSlot: HTMLSlotElement? { ReadonlyAttribute[Strings.assignedSlot, in: jsObject] } + @inlinable var assignedSlot: HTMLSlotElement? { ReadonlyAttribute[Strings.assignedSlot, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/SourceBuffer.swift b/Sources/DOMKit/WebIDL/SourceBuffer.swift index e9460ebd..ad4432c1 100644 --- a/Sources/DOMKit/WebIDL/SourceBuffer.swift +++ b/Sources/DOMKit/WebIDL/SourceBuffer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SourceBuffer: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.SourceBuffer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SourceBuffer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _mode = ReadWriteAttribute(jsObject: jsObject, name: Strings.mode) @@ -66,22 +66,22 @@ public class SourceBuffer: EventTarget { @ClosureAttribute1Optional public var onabort: EventHandler - public func appendBuffer(data: BufferSource) { + @inlinable public func appendBuffer(data: BufferSource) { let this = jsObject _ = this[Strings.appendBuffer].function!(this: this, arguments: [data.jsValue()]) } - public func abort() { + @inlinable public func abort() { let this = jsObject _ = this[Strings.abort].function!(this: this, arguments: []) } - public func changeType(type: String) { + @inlinable public func changeType(type: String) { let this = jsObject _ = this[Strings.changeType].function!(this: this, arguments: [type.jsValue()]) } - public func remove(start: Double, end: Double) { + @inlinable public func remove(start: Double, end: Double) { let this = jsObject _ = this[Strings.remove].function!(this: this, arguments: [start.jsValue(), end.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/SourceBufferList.swift b/Sources/DOMKit/WebIDL/SourceBufferList.swift index b59ec548..28798d08 100644 --- a/Sources/DOMKit/WebIDL/SourceBufferList.swift +++ b/Sources/DOMKit/WebIDL/SourceBufferList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SourceBufferList: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.SourceBufferList].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SourceBufferList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) @@ -22,7 +22,7 @@ public class SourceBufferList: EventTarget { @ClosureAttribute1Optional public var onremovesourcebuffer: EventHandler - public subscript(key: Int) -> SourceBuffer { + @inlinable public subscript(key: Int) -> SourceBuffer { jsObject[key].fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift b/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift index bec6993d..0f637478 100644 --- a/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift +++ b/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift @@ -9,16 +9,16 @@ public enum SpatialNavigationDirection: JSString, JSValueCompatible { case left = "left" case right = "right" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SpeechGrammar.swift b/Sources/DOMKit/WebIDL/SpeechGrammar.swift index c462f5ba..0ceba22e 100644 --- a/Sources/DOMKit/WebIDL/SpeechGrammar.swift +++ b/Sources/DOMKit/WebIDL/SpeechGrammar.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechGrammar: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SpeechGrammar].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechGrammar].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift index 1a1844b3..a41ddf69 100644 --- a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift +++ b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechGrammarList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SpeechGrammarList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechGrammarList].function! } public let jsObject: JSObject @@ -13,23 +13,23 @@ public class SpeechGrammarList: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> SpeechGrammar { + @inlinable public subscript(key: Int) -> SpeechGrammar { jsObject[key].fromJSValue()! } - public func addFromURI(src: String, weight: Float? = nil) { + @inlinable public func addFromURI(src: String, weight: Float? = nil) { let this = jsObject _ = this[Strings.addFromURI].function!(this: this, arguments: [src.jsValue(), weight?.jsValue() ?? .undefined]) } - public func addFromString(string: String, weight: Float? = nil) { + @inlinable public func addFromString(string: String, weight: Float? = nil) { let this = jsObject _ = this[Strings.addFromString].function!(this: this, arguments: [string.jsValue(), weight?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognition.swift b/Sources/DOMKit/WebIDL/SpeechRecognition.swift index 59c2a9d6..ba2cbbdb 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognition.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognition.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechRecognition: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognition].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognition].function! } public required init(unsafelyWrapping jsObject: JSObject) { _grammars = ReadWriteAttribute(jsObject: jsObject, name: Strings.grammars) @@ -26,7 +26,7 @@ public class SpeechRecognition: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -45,17 +45,17 @@ public class SpeechRecognition: EventTarget { @ReadWriteAttribute public var maxAlternatives: UInt32 - public func start() { + @inlinable public func start() { let this = jsObject _ = this[Strings.start].function!(this: this, arguments: []) } - public func stop() { + @inlinable public func stop() { let this = jsObject _ = this[Strings.stop].function!(this: this, arguments: []) } - public func abort() { + @inlinable public func abort() { let this = jsObject _ = this[Strings.abort].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift index aafa0121..506ca310 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechRecognitionAlternative: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionAlternative].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionAlternative].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift index cb71df05..6f554ddc 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift @@ -13,16 +13,16 @@ public enum SpeechRecognitionErrorCode: JSString, JSValueCompatible { case badGrammar = "bad-grammar" case languageNotSupported = "language-not-supported" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift index 4f9de7e7..97d21807 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechRecognitionErrorEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionErrorEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionErrorEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) @@ -12,7 +12,7 @@ public class SpeechRecognitionErrorEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: SpeechRecognitionErrorEventInit) { + @inlinable public convenience init(type: String, eventInitDict: SpeechRecognitionErrorEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift index 8b9a8ab0..26d0134e 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechRecognitionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _resultIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.resultIndex) @@ -12,7 +12,7 @@ public class SpeechRecognitionEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: SpeechRecognitionEventInit) { + @inlinable public convenience init(type: String, eventInitDict: SpeechRecognitionEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift index 5b2d2766..17a04f81 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechRecognitionResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionResult].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionResult].function! } public let jsObject: JSObject @@ -17,7 +17,7 @@ public class SpeechRecognitionResult: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> SpeechRecognitionAlternative { + @inlinable public subscript(key: Int) -> SpeechRecognitionAlternative { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift index acc20956..66f66136 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechRecognitionResultList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionResultList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionResultList].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class SpeechRecognitionResultList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> SpeechRecognitionResult { + @inlinable public subscript(key: Int) -> SpeechRecognitionResult { jsObject[key].fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift index e106960f..0e9d170b 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechSynthesis: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesis].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesis].function! } public required init(unsafelyWrapping jsObject: JSObject) { _pending = ReadonlyAttribute(jsObject: jsObject, name: Strings.pending) @@ -26,27 +26,27 @@ public class SpeechSynthesis: EventTarget { @ClosureAttribute1Optional public var onvoiceschanged: EventHandler - public func speak(utterance: SpeechSynthesisUtterance) { + @inlinable public func speak(utterance: SpeechSynthesisUtterance) { let this = jsObject _ = this[Strings.speak].function!(this: this, arguments: [utterance.jsValue()]) } - public func cancel() { + @inlinable public func cancel() { let this = jsObject _ = this[Strings.cancel].function!(this: this, arguments: []) } - public func pause() { + @inlinable public func pause() { let this = jsObject _ = this[Strings.pause].function!(this: this, arguments: []) } - public func resume() { + @inlinable public func resume() { let this = jsObject _ = this[Strings.resume].function!(this: this, arguments: []) } - public func getVoices() -> [SpeechSynthesisVoice] { + @inlinable public func getVoices() -> [SpeechSynthesisVoice] { let this = jsObject return this[Strings.getVoices].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift index 17fef334..59438bb7 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift @@ -17,16 +17,16 @@ public enum SpeechSynthesisErrorCode: JSString, JSValueCompatible { case invalidArgument = "invalid-argument" case notAllowed = "not-allowed" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift index 9ab811c2..4298b749 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechSynthesisErrorEvent: SpeechSynthesisEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisErrorEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisErrorEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: SpeechSynthesisErrorEventInit) { + @inlinable public convenience init(type: String, eventInitDict: SpeechSynthesisErrorEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift index 362415cd..b48afdb7 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechSynthesisEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _utterance = ReadonlyAttribute(jsObject: jsObject, name: Strings.utterance) @@ -15,7 +15,7 @@ public class SpeechSynthesisEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: SpeechSynthesisEventInit) { + @inlinable public convenience init(type: String, eventInitDict: SpeechSynthesisEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift index f269ce92..433db52b 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechSynthesisUtterance: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisUtterance].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisUtterance].function! } public required init(unsafelyWrapping jsObject: JSObject) { _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) @@ -23,7 +23,7 @@ public class SpeechSynthesisUtterance: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(text: String? = nil) { + @inlinable public convenience init(text: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [text?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift index 224f5db7..4dd8af22 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SpeechSynthesisVoice: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisVoice].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisVoice].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/StaticRange.swift b/Sources/DOMKit/WebIDL/StaticRange.swift index 8d8a5741..5c9fec2b 100644 --- a/Sources/DOMKit/WebIDL/StaticRange.swift +++ b/Sources/DOMKit/WebIDL/StaticRange.swift @@ -4,13 +4,13 @@ import JavaScriptEventLoop import JavaScriptKit public class StaticRange: AbstractRange { - override public class var constructor: JSFunction { JSObject.global[Strings.StaticRange].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.StaticRange].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(init: StaticRangeInit) { + @inlinable public convenience init(init: StaticRangeInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } } diff --git a/Sources/DOMKit/WebIDL/StereoPannerNode.swift b/Sources/DOMKit/WebIDL/StereoPannerNode.swift index e2d4b4ac..a3b685fc 100644 --- a/Sources/DOMKit/WebIDL/StereoPannerNode.swift +++ b/Sources/DOMKit/WebIDL/StereoPannerNode.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class StereoPannerNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.StereoPannerNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.StereoPannerNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _pan = ReadonlyAttribute(jsObject: jsObject, name: Strings.pan) super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: StereoPannerOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: StereoPannerOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/Storage.swift b/Sources/DOMKit/WebIDL/Storage.swift index 6b56752e..0115f04a 100644 --- a/Sources/DOMKit/WebIDL/Storage.swift +++ b/Sources/DOMKit/WebIDL/Storage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Storage: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Storage].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Storage].function! } public let jsObject: JSObject @@ -16,12 +16,12 @@ public class Storage: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public func key(index: UInt32) -> String? { + @inlinable public func key(index: UInt32) -> String? { let this = jsObject return this[Strings.key].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } - public subscript(key: String) -> String? { + @inlinable public subscript(key: String) -> String? { jsObject[key].fromJSValue() } @@ -29,7 +29,7 @@ public class Storage: JSBridgedClass { // XXX: unsupported deleter for keys of type String - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift index de4eeb28..f5b08fee 100644 --- a/Sources/DOMKit/WebIDL/StorageEvent.swift +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class StorageEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.StorageEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.StorageEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) @@ -15,7 +15,7 @@ public class StorageEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: StorageEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: StorageEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -34,7 +34,7 @@ public class StorageEvent: Event { @ReadonlyAttribute public var storageArea: Storage? - public func initStorageEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, key: String? = nil, oldValue: String? = nil, newValue: String? = nil, url: String? = nil, storageArea: Storage? = nil) { + @inlinable public func initStorageEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, key: String? = nil, oldValue: String? = nil, newValue: String? = nil, url: String? = nil, storageArea: Storage? = nil) { let _arg0 = type.jsValue() let _arg1 = bubbles?.jsValue() ?? .undefined let _arg2 = cancelable?.jsValue() ?? .undefined diff --git a/Sources/DOMKit/WebIDL/StorageManager.swift b/Sources/DOMKit/WebIDL/StorageManager.swift index 2cae3ba7..5c23cecc 100644 --- a/Sources/DOMKit/WebIDL/StorageManager.swift +++ b/Sources/DOMKit/WebIDL/StorageManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class StorageManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.StorageManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.StorageManager].function! } public let jsObject: JSObject @@ -12,49 +12,49 @@ public class StorageManager: JSBridgedClass { self.jsObject = jsObject } - public func getDirectory() -> JSPromise { + @inlinable public func getDirectory() -> JSPromise { let this = jsObject return this[Strings.getDirectory].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDirectory() async throws -> FileSystemDirectoryHandle { + @inlinable public func getDirectory() async throws -> FileSystemDirectoryHandle { let this = jsObject let _promise: JSPromise = this[Strings.getDirectory].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func persisted() -> JSPromise { + @inlinable public func persisted() -> JSPromise { let this = jsObject return this[Strings.persisted].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func persisted() async throws -> Bool { + @inlinable public func persisted() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.persisted].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func persist() -> JSPromise { + @inlinable public func persist() -> JSPromise { let this = jsObject return this[Strings.persist].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func persist() async throws -> Bool { + @inlinable public func persist() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.persist].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func estimate() -> JSPromise { + @inlinable public func estimate() -> JSPromise { let this = jsObject return this[Strings.estimate].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func estimate() async throws -> StorageEstimate { + @inlinable public func estimate() async throws -> StorageEstimate { let this = jsObject let _promise: JSPromise = this[Strings.estimate].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index de1c01ac..3d663824 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -3,5119 +3,5119 @@ import JavaScriptEventLoop import JavaScriptKit -enum Strings { +@usableFromInline enum Strings { static let _self: JSString = "self" - static let ANGLE_instanced_arrays: JSString = "ANGLE_instanced_arrays" - static let AbortController: JSString = "AbortController" - static let AbortSignal: JSString = "AbortSignal" - static let AbsoluteOrientationSensor: JSString = "AbsoluteOrientationSensor" - static let AbstractRange: JSString = "AbstractRange" - static let Accelerometer: JSString = "Accelerometer" - static let AddSearchProvider: JSString = "AddSearchProvider" - static let AmbientLightSensor: JSString = "AmbientLightSensor" - static let AnalyserNode: JSString = "AnalyserNode" - static let Animation: JSString = "Animation" - static let AnimationEffect: JSString = "AnimationEffect" - static let AnimationEvent: JSString = "AnimationEvent" - static let AnimationNodeList: JSString = "AnimationNodeList" - static let AnimationPlaybackEvent: JSString = "AnimationPlaybackEvent" - static let AnimationTimeline: JSString = "AnimationTimeline" - static let AnimationWorkletGlobalScope: JSString = "AnimationWorkletGlobalScope" - static let Attr: JSString = "Attr" - static let AttributionReporting: JSString = "AttributionReporting" - static let AudioBuffer: JSString = "AudioBuffer" - static let AudioBufferSourceNode: JSString = "AudioBufferSourceNode" - static let AudioContext: JSString = "AudioContext" - static let AudioData: JSString = "AudioData" - static let AudioDecoder: JSString = "AudioDecoder" - static let AudioDestinationNode: JSString = "AudioDestinationNode" - static let AudioEncoder: JSString = "AudioEncoder" - static let AudioListener: JSString = "AudioListener" - static let AudioNode: JSString = "AudioNode" - static let AudioParam: JSString = "AudioParam" - static let AudioParamMap: JSString = "AudioParamMap" - static let AudioProcessingEvent: JSString = "AudioProcessingEvent" - static let AudioScheduledSourceNode: JSString = "AudioScheduledSourceNode" - static let AudioTrack: JSString = "AudioTrack" - static let AudioTrackList: JSString = "AudioTrackList" - static let AudioWorklet: JSString = "AudioWorklet" - static let AudioWorkletGlobalScope: JSString = "AudioWorkletGlobalScope" - static let AudioWorkletNode: JSString = "AudioWorkletNode" - static let AudioWorkletProcessor: JSString = "AudioWorkletProcessor" - static let AuthenticatorAssertionResponse: JSString = "AuthenticatorAssertionResponse" - static let AuthenticatorAttestationResponse: JSString = "AuthenticatorAttestationResponse" - static let AuthenticatorResponse: JSString = "AuthenticatorResponse" - static let BackgroundFetchEvent: JSString = "BackgroundFetchEvent" - static let BackgroundFetchManager: JSString = "BackgroundFetchManager" - static let BackgroundFetchRecord: JSString = "BackgroundFetchRecord" - static let BackgroundFetchRegistration: JSString = "BackgroundFetchRegistration" - static let BackgroundFetchUpdateUIEvent: JSString = "BackgroundFetchUpdateUIEvent" - static let BarProp: JSString = "BarProp" - static let BarcodeDetector: JSString = "BarcodeDetector" - static let BaseAudioContext: JSString = "BaseAudioContext" - static let Baseline: JSString = "Baseline" - static let BatteryManager: JSString = "BatteryManager" - static let BeforeInstallPromptEvent: JSString = "BeforeInstallPromptEvent" - static let BeforeUnloadEvent: JSString = "BeforeUnloadEvent" - static let BiquadFilterNode: JSString = "BiquadFilterNode" - static let Blob: JSString = "Blob" - static let BlobEvent: JSString = "BlobEvent" - static let Bluetooth: JSString = "Bluetooth" - static let BluetoothAdvertisingEvent: JSString = "BluetoothAdvertisingEvent" - static let BluetoothCharacteristicProperties: JSString = "BluetoothCharacteristicProperties" - static let BluetoothDevice: JSString = "BluetoothDevice" - static let BluetoothManufacturerDataMap: JSString = "BluetoothManufacturerDataMap" - static let BluetoothPermissionResult: JSString = "BluetoothPermissionResult" - static let BluetoothRemoteGATTCharacteristic: JSString = "BluetoothRemoteGATTCharacteristic" - static let BluetoothRemoteGATTDescriptor: JSString = "BluetoothRemoteGATTDescriptor" - static let BluetoothRemoteGATTServer: JSString = "BluetoothRemoteGATTServer" - static let BluetoothRemoteGATTService: JSString = "BluetoothRemoteGATTService" - static let BluetoothServiceDataMap: JSString = "BluetoothServiceDataMap" - static let BluetoothUUID: JSString = "BluetoothUUID" - static let BreakToken: JSString = "BreakToken" - static let BroadcastChannel: JSString = "BroadcastChannel" - static let BrowserCaptureMediaStreamTrack: JSString = "BrowserCaptureMediaStreamTrack" - static let ByteLengthQueuingStrategy: JSString = "ByteLengthQueuingStrategy" - static let CDATASection: JSString = "CDATASection" - static let CSPViolationReportBody: JSString = "CSPViolationReportBody" - static let CSS: JSString = "CSS" - static let CSSAnimation: JSString = "CSSAnimation" - static let CSSColor: JSString = "CSSColor" - static let CSSColorValue: JSString = "CSSColorValue" - static let CSSConditionRule: JSString = "CSSConditionRule" - static let CSSContainerRule: JSString = "CSSContainerRule" - static let CSSCounterStyleRule: JSString = "CSSCounterStyleRule" - static let CSSFontFaceRule: JSString = "CSSFontFaceRule" - static let CSSFontFeatureValuesMap: JSString = "CSSFontFeatureValuesMap" - static let CSSFontFeatureValuesRule: JSString = "CSSFontFeatureValuesRule" - static let CSSFontPaletteValuesRule: JSString = "CSSFontPaletteValuesRule" - static let CSSGroupingRule: JSString = "CSSGroupingRule" - static let CSSHSL: JSString = "CSSHSL" - static let CSSHWB: JSString = "CSSHWB" - static let CSSImageValue: JSString = "CSSImageValue" - static let CSSImportRule: JSString = "CSSImportRule" - static let CSSKeyframeRule: JSString = "CSSKeyframeRule" - static let CSSKeyframesRule: JSString = "CSSKeyframesRule" - static let CSSKeywordValue: JSString = "CSSKeywordValue" - static let CSSLCH: JSString = "CSSLCH" - static let CSSLab: JSString = "CSSLab" - static let CSSLayerBlockRule: JSString = "CSSLayerBlockRule" - static let CSSLayerStatementRule: JSString = "CSSLayerStatementRule" - static let CSSMarginRule: JSString = "CSSMarginRule" - static let CSSMathClamp: JSString = "CSSMathClamp" - static let CSSMathInvert: JSString = "CSSMathInvert" - static let CSSMathMax: JSString = "CSSMathMax" - static let CSSMathMin: JSString = "CSSMathMin" - static let CSSMathNegate: JSString = "CSSMathNegate" - static let CSSMathProduct: JSString = "CSSMathProduct" - static let CSSMathSum: JSString = "CSSMathSum" - static let CSSMathValue: JSString = "CSSMathValue" - static let CSSMatrixComponent: JSString = "CSSMatrixComponent" - static let CSSMediaRule: JSString = "CSSMediaRule" - static let CSSNamespaceRule: JSString = "CSSNamespaceRule" - static let CSSNestingRule: JSString = "CSSNestingRule" - static let CSSNumericArray: JSString = "CSSNumericArray" - static let CSSNumericValue: JSString = "CSSNumericValue" - static let CSSOKLCH: JSString = "CSSOKLCH" - static let CSSOKLab: JSString = "CSSOKLab" - static let CSSPageRule: JSString = "CSSPageRule" - static let CSSParserAtRule: JSString = "CSSParserAtRule" - static let CSSParserBlock: JSString = "CSSParserBlock" - static let CSSParserDeclaration: JSString = "CSSParserDeclaration" - static let CSSParserFunction: JSString = "CSSParserFunction" - static let CSSParserQualifiedRule: JSString = "CSSParserQualifiedRule" - static let CSSParserRule: JSString = "CSSParserRule" - static let CSSParserValue: JSString = "CSSParserValue" - static let CSSPerspective: JSString = "CSSPerspective" - static let CSSPropertyRule: JSString = "CSSPropertyRule" - static let CSSPseudoElement: JSString = "CSSPseudoElement" - static let CSSRGB: JSString = "CSSRGB" - static let CSSRotate: JSString = "CSSRotate" - static let CSSRule: JSString = "CSSRule" - static let CSSRuleList: JSString = "CSSRuleList" - static let CSSScale: JSString = "CSSScale" - static let CSSScrollTimelineRule: JSString = "CSSScrollTimelineRule" - static let CSSSkew: JSString = "CSSSkew" - static let CSSSkewX: JSString = "CSSSkewX" - static let CSSSkewY: JSString = "CSSSkewY" - static let CSSStyleDeclaration: JSString = "CSSStyleDeclaration" - static let CSSStyleRule: JSString = "CSSStyleRule" - static let CSSStyleSheet: JSString = "CSSStyleSheet" - static let CSSStyleValue: JSString = "CSSStyleValue" - static let CSSSupportsRule: JSString = "CSSSupportsRule" - static let CSSTransformComponent: JSString = "CSSTransformComponent" - static let CSSTransformValue: JSString = "CSSTransformValue" - static let CSSTransition: JSString = "CSSTransition" - static let CSSTranslate: JSString = "CSSTranslate" - static let CSSUnitValue: JSString = "CSSUnitValue" - static let CSSUnparsedValue: JSString = "CSSUnparsedValue" - static let CSSVariableReferenceValue: JSString = "CSSVariableReferenceValue" - static let CSSViewportRule: JSString = "CSSViewportRule" - static let Cache: JSString = "Cache" - static let CacheStorage: JSString = "CacheStorage" - static let CanMakePaymentEvent: JSString = "CanMakePaymentEvent" - static let CanvasCaptureMediaStreamTrack: JSString = "CanvasCaptureMediaStreamTrack" - static let CanvasFilter: JSString = "CanvasFilter" - static let CanvasGradient: JSString = "CanvasGradient" - static let CanvasPattern: JSString = "CanvasPattern" - static let CanvasRenderingContext2D: JSString = "CanvasRenderingContext2D" - static let CaretPosition: JSString = "CaretPosition" - static let ChannelMergerNode: JSString = "ChannelMergerNode" - static let ChannelSplitterNode: JSString = "ChannelSplitterNode" - static let CharacterBoundsUpdateEvent: JSString = "CharacterBoundsUpdateEvent" - static let CharacterData: JSString = "CharacterData" - static let ChildBreakToken: JSString = "ChildBreakToken" - static let Client: JSString = "Client" - static let Clients: JSString = "Clients" - static let Clipboard: JSString = "Clipboard" - static let ClipboardEvent: JSString = "ClipboardEvent" - static let ClipboardItem: JSString = "ClipboardItem" - static let CloseEvent: JSString = "CloseEvent" - static let CloseWatcher: JSString = "CloseWatcher" - static let Comment: JSString = "Comment" - static let CompositionEvent: JSString = "CompositionEvent" - static let CompressionStream: JSString = "CompressionStream" - static let ComputePressureObserver: JSString = "ComputePressureObserver" - static let ConstantSourceNode: JSString = "ConstantSourceNode" - static let ContactAddress: JSString = "ContactAddress" - static let ContactsManager: JSString = "ContactsManager" - static let ContentIndex: JSString = "ContentIndex" - static let ContentIndexEvent: JSString = "ContentIndexEvent" - static let ConvolverNode: JSString = "ConvolverNode" - static let CookieChangeEvent: JSString = "CookieChangeEvent" - static let CookieStore: JSString = "CookieStore" - static let CookieStoreManager: JSString = "CookieStoreManager" - static let CountQueuingStrategy: JSString = "CountQueuingStrategy" - static let CrashReportBody: JSString = "CrashReportBody" - static let Credential: JSString = "Credential" - static let CredentialsContainer: JSString = "CredentialsContainer" - static let CropTarget: JSString = "CropTarget" - static let Crypto: JSString = "Crypto" - static let CryptoKey: JSString = "CryptoKey" - static let CustomElementRegistry: JSString = "CustomElementRegistry" - static let CustomEvent: JSString = "CustomEvent" - static let CustomStateSet: JSString = "CustomStateSet" - static let DOMException: JSString = "DOMException" - static let DOMImplementation: JSString = "DOMImplementation" - static let DOMMatrix: JSString = "DOMMatrix" - static let DOMMatrixReadOnly: JSString = "DOMMatrixReadOnly" - static let DOMParser: JSString = "DOMParser" - static let DOMPoint: JSString = "DOMPoint" - static let DOMPointReadOnly: JSString = "DOMPointReadOnly" - static let DOMQuad: JSString = "DOMQuad" - static let DOMRect: JSString = "DOMRect" - static let DOMRectList: JSString = "DOMRectList" - static let DOMRectReadOnly: JSString = "DOMRectReadOnly" - static let DOMStringList: JSString = "DOMStringList" - static let DOMStringMap: JSString = "DOMStringMap" - static let DOMTokenList: JSString = "DOMTokenList" - static let DataCue: JSString = "DataCue" - static let DataTransfer: JSString = "DataTransfer" - static let DataTransferItem: JSString = "DataTransferItem" - static let DataTransferItemList: JSString = "DataTransferItemList" - static let DecompressionStream: JSString = "DecompressionStream" - static let DedicatedWorkerGlobalScope: JSString = "DedicatedWorkerGlobalScope" - static let DelayNode: JSString = "DelayNode" - static let DeprecationReportBody: JSString = "DeprecationReportBody" - static let DeviceMotionEvent: JSString = "DeviceMotionEvent" - static let DeviceMotionEventAcceleration: JSString = "DeviceMotionEventAcceleration" - static let DeviceMotionEventRotationRate: JSString = "DeviceMotionEventRotationRate" - static let DeviceOrientationEvent: JSString = "DeviceOrientationEvent" - static let DevicePosture: JSString = "DevicePosture" - static let DigitalGoodsService: JSString = "DigitalGoodsService" - static let Document: JSString = "Document" - static let DocumentFragment: JSString = "DocumentFragment" - static let DocumentTimeline: JSString = "DocumentTimeline" - static let DocumentType: JSString = "DocumentType" - static let DragEvent: JSString = "DragEvent" - static let DynamicsCompressorNode: JSString = "DynamicsCompressorNode" - static let EXT_blend_minmax: JSString = "EXT_blend_minmax" - static let EXT_clip_cull_distance: JSString = "EXT_clip_cull_distance" - static let EXT_color_buffer_float: JSString = "EXT_color_buffer_float" - static let EXT_color_buffer_half_float: JSString = "EXT_color_buffer_half_float" - static let EXT_disjoint_timer_query: JSString = "EXT_disjoint_timer_query" - static let EXT_disjoint_timer_query_webgl2: JSString = "EXT_disjoint_timer_query_webgl2" - static let EXT_float_blend: JSString = "EXT_float_blend" - static let EXT_frag_depth: JSString = "EXT_frag_depth" - static let EXT_sRGB: JSString = "EXT_sRGB" - static let EXT_shader_texture_lod: JSString = "EXT_shader_texture_lod" - static let EXT_texture_compression_bptc: JSString = "EXT_texture_compression_bptc" - static let EXT_texture_compression_rgtc: JSString = "EXT_texture_compression_rgtc" - static let EXT_texture_filter_anisotropic: JSString = "EXT_texture_filter_anisotropic" - static let EXT_texture_norm16: JSString = "EXT_texture_norm16" - static let EditContext: JSString = "EditContext" - static let Element: JSString = "Element" - static let ElementInternals: JSString = "ElementInternals" - static let EncodedAudioChunk: JSString = "EncodedAudioChunk" - static let EncodedVideoChunk: JSString = "EncodedVideoChunk" - static let ErrorEvent: JSString = "ErrorEvent" - static let Event: JSString = "Event" - static let EventCounts: JSString = "EventCounts" - static let EventSource: JSString = "EventSource" - static let EventTarget: JSString = "EventTarget" - static let ExtendableCookieChangeEvent: JSString = "ExtendableCookieChangeEvent" - static let ExtendableEvent: JSString = "ExtendableEvent" - static let ExtendableMessageEvent: JSString = "ExtendableMessageEvent" - static let External: JSString = "External" - static let EyeDropper: JSString = "EyeDropper" - static let FaceDetector: JSString = "FaceDetector" - static let FederatedCredential: JSString = "FederatedCredential" - static let FetchEvent: JSString = "FetchEvent" - static let File: JSString = "File" - static let FileList: JSString = "FileList" - static let FileReader: JSString = "FileReader" - static let FileReaderSync: JSString = "FileReaderSync" - static let FileSystem: JSString = "FileSystem" - static let FileSystemDirectoryEntry: JSString = "FileSystemDirectoryEntry" - static let FileSystemDirectoryHandle: JSString = "FileSystemDirectoryHandle" - static let FileSystemDirectoryReader: JSString = "FileSystemDirectoryReader" - static let FileSystemEntry: JSString = "FileSystemEntry" - static let FileSystemFileEntry: JSString = "FileSystemFileEntry" - static let FileSystemFileHandle: JSString = "FileSystemFileHandle" - static let FileSystemHandle: JSString = "FileSystemHandle" - static let FileSystemWritableFileStream: JSString = "FileSystemWritableFileStream" - static let FocusEvent: JSString = "FocusEvent" - static let Font: JSString = "Font" - static let FontFace: JSString = "FontFace" - static let FontFaceFeatures: JSString = "FontFaceFeatures" - static let FontFacePalette: JSString = "FontFacePalette" - static let FontFacePalettes: JSString = "FontFacePalettes" - static let FontFaceSet: JSString = "FontFaceSet" - static let FontFaceSetLoadEvent: JSString = "FontFaceSetLoadEvent" - static let FontFaceVariationAxis: JSString = "FontFaceVariationAxis" - static let FontFaceVariations: JSString = "FontFaceVariations" - static let FontManager: JSString = "FontManager" - static let FontMetadata: JSString = "FontMetadata" - static let FontMetrics: JSString = "FontMetrics" - static let FormData: JSString = "FormData" - static let FormDataEvent: JSString = "FormDataEvent" - static let FragmentDirective: JSString = "FragmentDirective" - static let FragmentResult: JSString = "FragmentResult" - static let GPU: JSString = "GPU" - static let GPUAdapter: JSString = "GPUAdapter" - static let GPUBindGroup: JSString = "GPUBindGroup" - static let GPUBindGroupLayout: JSString = "GPUBindGroupLayout" - static let GPUBuffer: JSString = "GPUBuffer" - static let GPUBufferUsage: JSString = "GPUBufferUsage" - static let GPUCanvasContext: JSString = "GPUCanvasContext" - static let GPUColorWrite: JSString = "GPUColorWrite" - static let GPUCommandBuffer: JSString = "GPUCommandBuffer" - static let GPUCommandEncoder: JSString = "GPUCommandEncoder" - static let GPUCompilationInfo: JSString = "GPUCompilationInfo" - static let GPUCompilationMessage: JSString = "GPUCompilationMessage" - static let GPUComputePassEncoder: JSString = "GPUComputePassEncoder" - static let GPUComputePipeline: JSString = "GPUComputePipeline" - static let GPUDevice: JSString = "GPUDevice" - static let GPUDeviceLostInfo: JSString = "GPUDeviceLostInfo" - static let GPUExternalTexture: JSString = "GPUExternalTexture" - static let GPUMapMode: JSString = "GPUMapMode" - static let GPUOutOfMemoryError: JSString = "GPUOutOfMemoryError" - static let GPUPipelineLayout: JSString = "GPUPipelineLayout" - static let GPUQuerySet: JSString = "GPUQuerySet" - static let GPUQueue: JSString = "GPUQueue" - static let GPURenderBundle: JSString = "GPURenderBundle" - static let GPURenderBundleEncoder: JSString = "GPURenderBundleEncoder" - static let GPURenderPassEncoder: JSString = "GPURenderPassEncoder" - static let GPURenderPipeline: JSString = "GPURenderPipeline" - static let GPUSampler: JSString = "GPUSampler" - static let GPUShaderModule: JSString = "GPUShaderModule" - static let GPUShaderStage: JSString = "GPUShaderStage" - static let GPUSupportedFeatures: JSString = "GPUSupportedFeatures" - static let GPUSupportedLimits: JSString = "GPUSupportedLimits" - static let GPUTexture: JSString = "GPUTexture" - static let GPUTextureUsage: JSString = "GPUTextureUsage" - static let GPUTextureView: JSString = "GPUTextureView" - static let GPUUncapturedErrorEvent: JSString = "GPUUncapturedErrorEvent" - static let GPUValidationError: JSString = "GPUValidationError" - static let GainNode: JSString = "GainNode" - static let Gamepad: JSString = "Gamepad" - static let GamepadButton: JSString = "GamepadButton" - static let GamepadEvent: JSString = "GamepadEvent" - static let GamepadHapticActuator: JSString = "GamepadHapticActuator" - static let GamepadPose: JSString = "GamepadPose" - static let GamepadTouch: JSString = "GamepadTouch" - static let Geolocation: JSString = "Geolocation" - static let GeolocationCoordinates: JSString = "GeolocationCoordinates" - static let GeolocationPosition: JSString = "GeolocationPosition" - static let GeolocationPositionError: JSString = "GeolocationPositionError" - static let GeolocationSensor: JSString = "GeolocationSensor" - static let Global: JSString = "Global" - static let GravitySensor: JSString = "GravitySensor" - static let GroupEffect: JSString = "GroupEffect" - static let Gyroscope: JSString = "Gyroscope" - static let HID: JSString = "HID" - static let HIDConnectionEvent: JSString = "HIDConnectionEvent" - static let HIDDevice: JSString = "HIDDevice" - static let HIDInputReportEvent: JSString = "HIDInputReportEvent" - static let HTMLAllCollection: JSString = "HTMLAllCollection" - static let HTMLAnchorElement: JSString = "HTMLAnchorElement" - static let HTMLAreaElement: JSString = "HTMLAreaElement" - static let HTMLAudioElement: JSString = "HTMLAudioElement" - static let HTMLBRElement: JSString = "HTMLBRElement" - static let HTMLBaseElement: JSString = "HTMLBaseElement" - static let HTMLBodyElement: JSString = "HTMLBodyElement" - static let HTMLButtonElement: JSString = "HTMLButtonElement" - static let HTMLCanvasElement: JSString = "HTMLCanvasElement" - static let HTMLCollection: JSString = "HTMLCollection" - static let HTMLDListElement: JSString = "HTMLDListElement" - static let HTMLDataElement: JSString = "HTMLDataElement" - static let HTMLDataListElement: JSString = "HTMLDataListElement" - static let HTMLDetailsElement: JSString = "HTMLDetailsElement" - static let HTMLDialogElement: JSString = "HTMLDialogElement" - static let HTMLDirectoryElement: JSString = "HTMLDirectoryElement" - static let HTMLDivElement: JSString = "HTMLDivElement" - static let HTMLElement: JSString = "HTMLElement" - static let HTMLEmbedElement: JSString = "HTMLEmbedElement" - static let HTMLFieldSetElement: JSString = "HTMLFieldSetElement" - static let HTMLFontElement: JSString = "HTMLFontElement" - static let HTMLFormControlsCollection: JSString = "HTMLFormControlsCollection" - static let HTMLFormElement: JSString = "HTMLFormElement" - static let HTMLFrameElement: JSString = "HTMLFrameElement" - static let HTMLFrameSetElement: JSString = "HTMLFrameSetElement" - static let HTMLHRElement: JSString = "HTMLHRElement" - static let HTMLHeadElement: JSString = "HTMLHeadElement" - static let HTMLHeadingElement: JSString = "HTMLHeadingElement" - static let HTMLHtmlElement: JSString = "HTMLHtmlElement" - static let HTMLIFrameElement: JSString = "HTMLIFrameElement" - static let HTMLImageElement: JSString = "HTMLImageElement" - static let HTMLInputElement: JSString = "HTMLInputElement" - static let HTMLLIElement: JSString = "HTMLLIElement" - static let HTMLLabelElement: JSString = "HTMLLabelElement" - static let HTMLLegendElement: JSString = "HTMLLegendElement" - static let HTMLLinkElement: JSString = "HTMLLinkElement" - static let HTMLMapElement: JSString = "HTMLMapElement" - static let HTMLMarqueeElement: JSString = "HTMLMarqueeElement" - static let HTMLMediaElement: JSString = "HTMLMediaElement" - static let HTMLMenuElement: JSString = "HTMLMenuElement" - static let HTMLMetaElement: JSString = "HTMLMetaElement" - static let HTMLMeterElement: JSString = "HTMLMeterElement" - static let HTMLModElement: JSString = "HTMLModElement" - static let HTMLOListElement: JSString = "HTMLOListElement" - static let HTMLObjectElement: JSString = "HTMLObjectElement" - static let HTMLOptGroupElement: JSString = "HTMLOptGroupElement" - static let HTMLOptionElement: JSString = "HTMLOptionElement" - static let HTMLOptionsCollection: JSString = "HTMLOptionsCollection" - static let HTMLOutputElement: JSString = "HTMLOutputElement" - static let HTMLParagraphElement: JSString = "HTMLParagraphElement" - static let HTMLParamElement: JSString = "HTMLParamElement" - static let HTMLPictureElement: JSString = "HTMLPictureElement" - static let HTMLPortalElement: JSString = "HTMLPortalElement" - static let HTMLPreElement: JSString = "HTMLPreElement" - static let HTMLProgressElement: JSString = "HTMLProgressElement" - static let HTMLQuoteElement: JSString = "HTMLQuoteElement" - static let HTMLScriptElement: JSString = "HTMLScriptElement" - static let HTMLSelectElement: JSString = "HTMLSelectElement" - static let HTMLSlotElement: JSString = "HTMLSlotElement" - static let HTMLSourceElement: JSString = "HTMLSourceElement" - static let HTMLSpanElement: JSString = "HTMLSpanElement" - static let HTMLStyleElement: JSString = "HTMLStyleElement" - static let HTMLTableCaptionElement: JSString = "HTMLTableCaptionElement" - static let HTMLTableCellElement: JSString = "HTMLTableCellElement" - static let HTMLTableColElement: JSString = "HTMLTableColElement" - static let HTMLTableElement: JSString = "HTMLTableElement" - static let HTMLTableRowElement: JSString = "HTMLTableRowElement" - static let HTMLTableSectionElement: JSString = "HTMLTableSectionElement" - static let HTMLTemplateElement: JSString = "HTMLTemplateElement" - static let HTMLTextAreaElement: JSString = "HTMLTextAreaElement" - static let HTMLTimeElement: JSString = "HTMLTimeElement" - static let HTMLTitleElement: JSString = "HTMLTitleElement" - static let HTMLTrackElement: JSString = "HTMLTrackElement" - static let HTMLUListElement: JSString = "HTMLUListElement" - static let HTMLUnknownElement: JSString = "HTMLUnknownElement" - static let HTMLVideoElement: JSString = "HTMLVideoElement" - static let HashChangeEvent: JSString = "HashChangeEvent" - static let Headers: JSString = "Headers" - static let Highlight: JSString = "Highlight" - static let HighlightRegistry: JSString = "HighlightRegistry" - static let History: JSString = "History" - static let Hz: JSString = "Hz" - static let IDBCursor: JSString = "IDBCursor" - static let IDBCursorWithValue: JSString = "IDBCursorWithValue" - static let IDBDatabase: JSString = "IDBDatabase" - static let IDBFactory: JSString = "IDBFactory" - static let IDBIndex: JSString = "IDBIndex" - static let IDBKeyRange: JSString = "IDBKeyRange" - static let IDBObjectStore: JSString = "IDBObjectStore" - static let IDBOpenDBRequest: JSString = "IDBOpenDBRequest" - static let IDBRequest: JSString = "IDBRequest" - static let IDBTransaction: JSString = "IDBTransaction" - static let IDBVersionChangeEvent: JSString = "IDBVersionChangeEvent" - static let IIRFilterNode: JSString = "IIRFilterNode" - static let IdleDeadline: JSString = "IdleDeadline" - static let IdleDetector: JSString = "IdleDetector" - static let ImageBitmap: JSString = "ImageBitmap" - static let ImageBitmapRenderingContext: JSString = "ImageBitmapRenderingContext" - static let ImageCapture: JSString = "ImageCapture" - static let ImageData: JSString = "ImageData" - static let ImageDecoder: JSString = "ImageDecoder" - static let ImageTrack: JSString = "ImageTrack" - static let ImageTrackList: JSString = "ImageTrackList" - static let Ink: JSString = "Ink" - static let InkPresenter: JSString = "InkPresenter" - static let InputDeviceCapabilities: JSString = "InputDeviceCapabilities" - static let InputDeviceInfo: JSString = "InputDeviceInfo" - static let InputEvent: JSString = "InputEvent" - static let Instance: JSString = "Instance" - static let InteractionCounts: JSString = "InteractionCounts" - static let IntersectionObserver: JSString = "IntersectionObserver" - static let IntersectionObserverEntry: JSString = "IntersectionObserverEntry" - static let InterventionReportBody: JSString = "InterventionReportBody" - static let IntrinsicSizes: JSString = "IntrinsicSizes" - static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" - static let KHR_parallel_shader_compile: JSString = "KHR_parallel_shader_compile" - static let Keyboard: JSString = "Keyboard" - static let KeyboardEvent: JSString = "KeyboardEvent" - static let KeyboardLayoutMap: JSString = "KeyboardLayoutMap" - static let KeyframeEffect: JSString = "KeyframeEffect" - static let LargestContentfulPaint: JSString = "LargestContentfulPaint" - static let LayoutChild: JSString = "LayoutChild" - static let LayoutConstraints: JSString = "LayoutConstraints" - static let LayoutEdges: JSString = "LayoutEdges" - static let LayoutFragment: JSString = "LayoutFragment" - static let LayoutShift: JSString = "LayoutShift" - static let LayoutShiftAttribution: JSString = "LayoutShiftAttribution" - static let LayoutWorkletGlobalScope: JSString = "LayoutWorkletGlobalScope" - static let LinearAccelerationSensor: JSString = "LinearAccelerationSensor" - static let Location: JSString = "Location" - static let Lock: JSString = "Lock" - static let LockManager: JSString = "LockManager" - static let MIDIAccess: JSString = "MIDIAccess" - static let MIDIConnectionEvent: JSString = "MIDIConnectionEvent" - static let MIDIInput: JSString = "MIDIInput" - static let MIDIInputMap: JSString = "MIDIInputMap" - static let MIDIMessageEvent: JSString = "MIDIMessageEvent" - static let MIDIOutput: JSString = "MIDIOutput" - static let MIDIOutputMap: JSString = "MIDIOutputMap" - static let MIDIPort: JSString = "MIDIPort" - static let ML: JSString = "ML" - static let MLContext: JSString = "MLContext" - static let MLGraph: JSString = "MLGraph" - static let MLGraphBuilder: JSString = "MLGraphBuilder" - static let MLOperand: JSString = "MLOperand" - static let MLOperator: JSString = "MLOperator" - static let Magnetometer: JSString = "Magnetometer" - static let MathMLElement: JSString = "MathMLElement" - static let MediaCapabilities: JSString = "MediaCapabilities" - static let MediaDeviceInfo: JSString = "MediaDeviceInfo" - static let MediaDevices: JSString = "MediaDevices" - static let MediaElementAudioSourceNode: JSString = "MediaElementAudioSourceNode" - static let MediaEncryptedEvent: JSString = "MediaEncryptedEvent" - static let MediaError: JSString = "MediaError" - static let MediaKeyMessageEvent: JSString = "MediaKeyMessageEvent" - static let MediaKeySession: JSString = "MediaKeySession" - static let MediaKeyStatusMap: JSString = "MediaKeyStatusMap" - static let MediaKeySystemAccess: JSString = "MediaKeySystemAccess" - static let MediaKeys: JSString = "MediaKeys" - static let MediaList: JSString = "MediaList" - static let MediaMetadata: JSString = "MediaMetadata" - static let MediaQueryList: JSString = "MediaQueryList" - static let MediaQueryListEvent: JSString = "MediaQueryListEvent" - static let MediaRecorder: JSString = "MediaRecorder" - static let MediaRecorderErrorEvent: JSString = "MediaRecorderErrorEvent" - static let MediaSession: JSString = "MediaSession" - static let MediaSource: JSString = "MediaSource" - static let MediaStream: JSString = "MediaStream" - static let MediaStreamAudioDestinationNode: JSString = "MediaStreamAudioDestinationNode" - static let MediaStreamAudioSourceNode: JSString = "MediaStreamAudioSourceNode" - static let MediaStreamTrack: JSString = "MediaStreamTrack" - static let MediaStreamTrackAudioSourceNode: JSString = "MediaStreamTrackAudioSourceNode" - static let MediaStreamTrackEvent: JSString = "MediaStreamTrackEvent" - static let MediaStreamTrackProcessor: JSString = "MediaStreamTrackProcessor" - static let Memory: JSString = "Memory" - static let MessageChannel: JSString = "MessageChannel" - static let MessageEvent: JSString = "MessageEvent" - static let MessagePort: JSString = "MessagePort" - static let MimeType: JSString = "MimeType" - static let MimeTypeArray: JSString = "MimeTypeArray" - static let Module: JSString = "Module" - static let MouseEvent: JSString = "MouseEvent" - static let MutationEvent: JSString = "MutationEvent" - static let MutationObserver: JSString = "MutationObserver" - static let MutationRecord: JSString = "MutationRecord" - static let NDEFMessage: JSString = "NDEFMessage" - static let NDEFReader: JSString = "NDEFReader" - static let NDEFReadingEvent: JSString = "NDEFReadingEvent" - static let NDEFRecord: JSString = "NDEFRecord" - static let NamedFlow: JSString = "NamedFlow" - static let NamedFlowMap: JSString = "NamedFlowMap" - static let NamedNodeMap: JSString = "NamedNodeMap" - static let NavigateEvent: JSString = "NavigateEvent" - static let Navigation: JSString = "Navigation" - static let NavigationCurrentEntryChangeEvent: JSString = "NavigationCurrentEntryChangeEvent" - static let NavigationDestination: JSString = "NavigationDestination" - static let NavigationEvent: JSString = "NavigationEvent" - static let NavigationHistoryEntry: JSString = "NavigationHistoryEntry" - static let NavigationPreloadManager: JSString = "NavigationPreloadManager" - static let NavigationTransition: JSString = "NavigationTransition" - static let Navigator: JSString = "Navigator" - static let NavigatorUAData: JSString = "NavigatorUAData" - static let NetworkInformation: JSString = "NetworkInformation" - static let Node: JSString = "Node" - static let NodeIterator: JSString = "NodeIterator" - static let NodeList: JSString = "NodeList" - static let Notification: JSString = "Notification" - static let NotificationEvent: JSString = "NotificationEvent" - static let OES_draw_buffers_indexed: JSString = "OES_draw_buffers_indexed" - static let OES_element_index_uint: JSString = "OES_element_index_uint" - static let OES_fbo_render_mipmap: JSString = "OES_fbo_render_mipmap" - static let OES_standard_derivatives: JSString = "OES_standard_derivatives" - static let OES_texture_float: JSString = "OES_texture_float" - static let OES_texture_float_linear: JSString = "OES_texture_float_linear" - static let OES_texture_half_float: JSString = "OES_texture_half_float" - static let OES_texture_half_float_linear: JSString = "OES_texture_half_float_linear" - static let OES_vertex_array_object: JSString = "OES_vertex_array_object" - static let OTPCredential: JSString = "OTPCredential" - static let OVR_multiview2: JSString = "OVR_multiview2" - static let Object: JSString = "Object" - static let OfflineAudioCompletionEvent: JSString = "OfflineAudioCompletionEvent" - static let OfflineAudioContext: JSString = "OfflineAudioContext" - static let OffscreenCanvas: JSString = "OffscreenCanvas" - static let OffscreenCanvasRenderingContext2D: JSString = "OffscreenCanvasRenderingContext2D" - static let OrientationSensor: JSString = "OrientationSensor" - static let OscillatorNode: JSString = "OscillatorNode" - static let OverconstrainedError: JSString = "OverconstrainedError" - static let PageTransitionEvent: JSString = "PageTransitionEvent" - static let PaintRenderingContext2D: JSString = "PaintRenderingContext2D" - static let PaintSize: JSString = "PaintSize" - static let PaintWorkletGlobalScope: JSString = "PaintWorkletGlobalScope" - static let PannerNode: JSString = "PannerNode" - static let PasswordCredential: JSString = "PasswordCredential" - static let Path2D: JSString = "Path2D" - static let PaymentInstruments: JSString = "PaymentInstruments" - static let PaymentManager: JSString = "PaymentManager" - static let PaymentMethodChangeEvent: JSString = "PaymentMethodChangeEvent" - static let PaymentRequest: JSString = "PaymentRequest" - static let PaymentRequestEvent: JSString = "PaymentRequestEvent" - static let PaymentRequestUpdateEvent: JSString = "PaymentRequestUpdateEvent" - static let PaymentResponse: JSString = "PaymentResponse" - static let Performance: JSString = "Performance" - static let PerformanceElementTiming: JSString = "PerformanceElementTiming" - static let PerformanceEntry: JSString = "PerformanceEntry" - static let PerformanceEventTiming: JSString = "PerformanceEventTiming" - static let PerformanceLongTaskTiming: JSString = "PerformanceLongTaskTiming" - static let PerformanceMark: JSString = "PerformanceMark" - static let PerformanceMeasure: JSString = "PerformanceMeasure" - static let PerformanceNavigation: JSString = "PerformanceNavigation" - static let PerformanceNavigationTiming: JSString = "PerformanceNavigationTiming" - static let PerformanceObserver: JSString = "PerformanceObserver" - static let PerformanceObserverEntryList: JSString = "PerformanceObserverEntryList" - static let PerformancePaintTiming: JSString = "PerformancePaintTiming" - static let PerformanceResourceTiming: JSString = "PerformanceResourceTiming" - static let PerformanceServerTiming: JSString = "PerformanceServerTiming" - static let PerformanceTiming: JSString = "PerformanceTiming" - static let PeriodicSyncEvent: JSString = "PeriodicSyncEvent" - static let PeriodicSyncManager: JSString = "PeriodicSyncManager" - static let PeriodicWave: JSString = "PeriodicWave" - static let PermissionStatus: JSString = "PermissionStatus" - static let Permissions: JSString = "Permissions" - static let PermissionsPolicy: JSString = "PermissionsPolicy" - static let PermissionsPolicyViolationReportBody: JSString = "PermissionsPolicyViolationReportBody" - static let PictureInPictureEvent: JSString = "PictureInPictureEvent" - static let PictureInPictureWindow: JSString = "PictureInPictureWindow" - static let Plugin: JSString = "Plugin" - static let PluginArray: JSString = "PluginArray" - static let PointerEvent: JSString = "PointerEvent" - static let PopStateEvent: JSString = "PopStateEvent" - static let PortalActivateEvent: JSString = "PortalActivateEvent" - static let PortalHost: JSString = "PortalHost" - static let Presentation: JSString = "Presentation" - static let PresentationAvailability: JSString = "PresentationAvailability" - static let PresentationConnection: JSString = "PresentationConnection" - static let PresentationConnectionAvailableEvent: JSString = "PresentationConnectionAvailableEvent" - static let PresentationConnectionCloseEvent: JSString = "PresentationConnectionCloseEvent" - static let PresentationConnectionList: JSString = "PresentationConnectionList" - static let PresentationReceiver: JSString = "PresentationReceiver" - static let PresentationRequest: JSString = "PresentationRequest" - static let ProcessingInstruction: JSString = "ProcessingInstruction" - static let Profiler: JSString = "Profiler" - static let ProgressEvent: JSString = "ProgressEvent" - static let PromiseRejectionEvent: JSString = "PromiseRejectionEvent" - static let ProximitySensor: JSString = "ProximitySensor" - static let PublicKeyCredential: JSString = "PublicKeyCredential" - static let PushEvent: JSString = "PushEvent" - static let PushManager: JSString = "PushManager" - static let PushMessageData: JSString = "PushMessageData" - static let PushSubscription: JSString = "PushSubscription" - static let PushSubscriptionChangeEvent: JSString = "PushSubscriptionChangeEvent" - static let PushSubscriptionOptions: JSString = "PushSubscriptionOptions" - static let Q: JSString = "Q" - static let RTCCertificate: JSString = "RTCCertificate" - static let RTCDTMFSender: JSString = "RTCDTMFSender" - static let RTCDTMFToneChangeEvent: JSString = "RTCDTMFToneChangeEvent" - static let RTCDataChannel: JSString = "RTCDataChannel" - static let RTCDataChannelEvent: JSString = "RTCDataChannelEvent" - static let RTCDtlsTransport: JSString = "RTCDtlsTransport" - static let RTCEncodedAudioFrame: JSString = "RTCEncodedAudioFrame" - static let RTCEncodedVideoFrame: JSString = "RTCEncodedVideoFrame" - static let RTCError: JSString = "RTCError" - static let RTCErrorEvent: JSString = "RTCErrorEvent" - static let RTCIceCandidate: JSString = "RTCIceCandidate" - static let RTCIceTransport: JSString = "RTCIceTransport" - static let RTCIdentityAssertion: JSString = "RTCIdentityAssertion" - static let RTCIdentityProviderGlobalScope: JSString = "RTCIdentityProviderGlobalScope" - static let RTCIdentityProviderRegistrar: JSString = "RTCIdentityProviderRegistrar" - static let RTCPeerConnection: JSString = "RTCPeerConnection" - static let RTCPeerConnectionIceErrorEvent: JSString = "RTCPeerConnectionIceErrorEvent" - static let RTCPeerConnectionIceEvent: JSString = "RTCPeerConnectionIceEvent" - static let RTCRtpReceiver: JSString = "RTCRtpReceiver" - static let RTCRtpScriptTransform: JSString = "RTCRtpScriptTransform" - static let RTCRtpScriptTransformer: JSString = "RTCRtpScriptTransformer" - static let RTCRtpSender: JSString = "RTCRtpSender" - static let RTCRtpTransceiver: JSString = "RTCRtpTransceiver" - static let RTCSctpTransport: JSString = "RTCSctpTransport" - static let RTCSessionDescription: JSString = "RTCSessionDescription" - static let RTCStatsReport: JSString = "RTCStatsReport" - static let RTCTrackEvent: JSString = "RTCTrackEvent" - static let RTCTransformEvent: JSString = "RTCTransformEvent" - static let RadioNodeList: JSString = "RadioNodeList" - static let Range: JSString = "Range" - static let ReadableByteStreamController: JSString = "ReadableByteStreamController" - static let ReadableStream: JSString = "ReadableStream" - static let ReadableStreamBYOBReader: JSString = "ReadableStreamBYOBReader" - static let ReadableStreamBYOBRequest: JSString = "ReadableStreamBYOBRequest" - static let ReadableStreamDefaultController: JSString = "ReadableStreamDefaultController" - static let ReadableStreamDefaultReader: JSString = "ReadableStreamDefaultReader" - static let RelativeOrientationSensor: JSString = "RelativeOrientationSensor" - static let RemotePlayback: JSString = "RemotePlayback" - static let Report: JSString = "Report" - static let ReportBody: JSString = "ReportBody" - static let ReportingObserver: JSString = "ReportingObserver" - static let Request: JSString = "Request" - static let ResizeObserver: JSString = "ResizeObserver" - static let ResizeObserverEntry: JSString = "ResizeObserverEntry" - static let ResizeObserverSize: JSString = "ResizeObserverSize" - static let Response: JSString = "Response" - static let SFrameTransform: JSString = "SFrameTransform" - static let SFrameTransformErrorEvent: JSString = "SFrameTransformErrorEvent" - static let SVGAElement: JSString = "SVGAElement" - static let SVGAngle: JSString = "SVGAngle" - static let SVGAnimateElement: JSString = "SVGAnimateElement" - static let SVGAnimateMotionElement: JSString = "SVGAnimateMotionElement" - static let SVGAnimateTransformElement: JSString = "SVGAnimateTransformElement" - static let SVGAnimatedAngle: JSString = "SVGAnimatedAngle" - static let SVGAnimatedBoolean: JSString = "SVGAnimatedBoolean" - static let SVGAnimatedEnumeration: JSString = "SVGAnimatedEnumeration" - static let SVGAnimatedInteger: JSString = "SVGAnimatedInteger" - static let SVGAnimatedLength: JSString = "SVGAnimatedLength" - static let SVGAnimatedLengthList: JSString = "SVGAnimatedLengthList" - static let SVGAnimatedNumber: JSString = "SVGAnimatedNumber" - static let SVGAnimatedNumberList: JSString = "SVGAnimatedNumberList" - static let SVGAnimatedPreserveAspectRatio: JSString = "SVGAnimatedPreserveAspectRatio" - static let SVGAnimatedRect: JSString = "SVGAnimatedRect" - static let SVGAnimatedString: JSString = "SVGAnimatedString" - static let SVGAnimatedTransformList: JSString = "SVGAnimatedTransformList" - static let SVGAnimationElement: JSString = "SVGAnimationElement" - static let SVGCircleElement: JSString = "SVGCircleElement" - static let SVGClipPathElement: JSString = "SVGClipPathElement" - static let SVGComponentTransferFunctionElement: JSString = "SVGComponentTransferFunctionElement" - static let SVGDefsElement: JSString = "SVGDefsElement" - static let SVGDescElement: JSString = "SVGDescElement" - static let SVGDiscardElement: JSString = "SVGDiscardElement" - static let SVGElement: JSString = "SVGElement" - static let SVGEllipseElement: JSString = "SVGEllipseElement" - static let SVGFEBlendElement: JSString = "SVGFEBlendElement" - static let SVGFEColorMatrixElement: JSString = "SVGFEColorMatrixElement" - static let SVGFEComponentTransferElement: JSString = "SVGFEComponentTransferElement" - static let SVGFECompositeElement: JSString = "SVGFECompositeElement" - static let SVGFEConvolveMatrixElement: JSString = "SVGFEConvolveMatrixElement" - static let SVGFEDiffuseLightingElement: JSString = "SVGFEDiffuseLightingElement" - static let SVGFEDisplacementMapElement: JSString = "SVGFEDisplacementMapElement" - static let SVGFEDistantLightElement: JSString = "SVGFEDistantLightElement" - static let SVGFEDropShadowElement: JSString = "SVGFEDropShadowElement" - static let SVGFEFloodElement: JSString = "SVGFEFloodElement" - static let SVGFEFuncAElement: JSString = "SVGFEFuncAElement" - static let SVGFEFuncBElement: JSString = "SVGFEFuncBElement" - static let SVGFEFuncGElement: JSString = "SVGFEFuncGElement" - static let SVGFEFuncRElement: JSString = "SVGFEFuncRElement" - static let SVGFEGaussianBlurElement: JSString = "SVGFEGaussianBlurElement" - static let SVGFEImageElement: JSString = "SVGFEImageElement" - static let SVGFEMergeElement: JSString = "SVGFEMergeElement" - static let SVGFEMergeNodeElement: JSString = "SVGFEMergeNodeElement" - static let SVGFEMorphologyElement: JSString = "SVGFEMorphologyElement" - static let SVGFEOffsetElement: JSString = "SVGFEOffsetElement" - static let SVGFEPointLightElement: JSString = "SVGFEPointLightElement" - static let SVGFESpecularLightingElement: JSString = "SVGFESpecularLightingElement" - static let SVGFESpotLightElement: JSString = "SVGFESpotLightElement" - static let SVGFETileElement: JSString = "SVGFETileElement" - static let SVGFETurbulenceElement: JSString = "SVGFETurbulenceElement" - static let SVGFilterElement: JSString = "SVGFilterElement" - static let SVGForeignObjectElement: JSString = "SVGForeignObjectElement" - static let SVGGElement: JSString = "SVGGElement" - static let SVGGeometryElement: JSString = "SVGGeometryElement" - static let SVGGradientElement: JSString = "SVGGradientElement" - static let SVGGraphicsElement: JSString = "SVGGraphicsElement" - static let SVGImageElement: JSString = "SVGImageElement" - static let SVGLength: JSString = "SVGLength" - static let SVGLengthList: JSString = "SVGLengthList" - static let SVGLineElement: JSString = "SVGLineElement" - static let SVGLinearGradientElement: JSString = "SVGLinearGradientElement" - static let SVGMPathElement: JSString = "SVGMPathElement" - static let SVGMarkerElement: JSString = "SVGMarkerElement" - static let SVGMaskElement: JSString = "SVGMaskElement" - static let SVGMetadataElement: JSString = "SVGMetadataElement" - static let SVGNumber: JSString = "SVGNumber" - static let SVGNumberList: JSString = "SVGNumberList" - static let SVGPathElement: JSString = "SVGPathElement" - static let SVGPatternElement: JSString = "SVGPatternElement" - static let SVGPointList: JSString = "SVGPointList" - static let SVGPolygonElement: JSString = "SVGPolygonElement" - static let SVGPolylineElement: JSString = "SVGPolylineElement" - static let SVGPreserveAspectRatio: JSString = "SVGPreserveAspectRatio" - static let SVGRadialGradientElement: JSString = "SVGRadialGradientElement" - static let SVGRectElement: JSString = "SVGRectElement" - static let SVGSVGElement: JSString = "SVGSVGElement" - static let SVGScriptElement: JSString = "SVGScriptElement" - static let SVGSetElement: JSString = "SVGSetElement" - static let SVGStopElement: JSString = "SVGStopElement" - static let SVGStringList: JSString = "SVGStringList" - static let SVGStyleElement: JSString = "SVGStyleElement" - static let SVGSwitchElement: JSString = "SVGSwitchElement" - static let SVGSymbolElement: JSString = "SVGSymbolElement" - static let SVGTSpanElement: JSString = "SVGTSpanElement" - static let SVGTextContentElement: JSString = "SVGTextContentElement" - static let SVGTextElement: JSString = "SVGTextElement" - static let SVGTextPathElement: JSString = "SVGTextPathElement" - static let SVGTextPositioningElement: JSString = "SVGTextPositioningElement" - static let SVGTitleElement: JSString = "SVGTitleElement" - static let SVGTransform: JSString = "SVGTransform" - static let SVGTransformList: JSString = "SVGTransformList" - static let SVGUnitTypes: JSString = "SVGUnitTypes" - static let SVGUseElement: JSString = "SVGUseElement" - static let SVGUseElementShadowRoot: JSString = "SVGUseElementShadowRoot" - static let SVGViewElement: JSString = "SVGViewElement" - static let Sanitizer: JSString = "Sanitizer" - static let Scheduler: JSString = "Scheduler" - static let Scheduling: JSString = "Scheduling" - static let Screen: JSString = "Screen" - static let ScreenOrientation: JSString = "ScreenOrientation" - static let ScriptProcessorNode: JSString = "ScriptProcessorNode" - static let ScriptingPolicyReportBody: JSString = "ScriptingPolicyReportBody" - static let ScrollTimeline: JSString = "ScrollTimeline" - static let SecurityPolicyViolationEvent: JSString = "SecurityPolicyViolationEvent" - static let Selection: JSString = "Selection" - static let Sensor: JSString = "Sensor" - static let SensorErrorEvent: JSString = "SensorErrorEvent" - static let SequenceEffect: JSString = "SequenceEffect" - static let Serial: JSString = "Serial" - static let SerialPort: JSString = "SerialPort" - static let ServiceWorker: JSString = "ServiceWorker" - static let ServiceWorkerContainer: JSString = "ServiceWorkerContainer" - static let ServiceWorkerGlobalScope: JSString = "ServiceWorkerGlobalScope" - static let ServiceWorkerRegistration: JSString = "ServiceWorkerRegistration" - static let ShadowAnimation: JSString = "ShadowAnimation" - static let ShadowRoot: JSString = "ShadowRoot" - static let SharedWorker: JSString = "SharedWorker" - static let SharedWorkerGlobalScope: JSString = "SharedWorkerGlobalScope" - static let SourceBuffer: JSString = "SourceBuffer" - static let SourceBufferList: JSString = "SourceBufferList" - static let SpeechGrammar: JSString = "SpeechGrammar" - static let SpeechGrammarList: JSString = "SpeechGrammarList" - static let SpeechRecognition: JSString = "SpeechRecognition" - static let SpeechRecognitionAlternative: JSString = "SpeechRecognitionAlternative" - static let SpeechRecognitionErrorEvent: JSString = "SpeechRecognitionErrorEvent" - static let SpeechRecognitionEvent: JSString = "SpeechRecognitionEvent" - static let SpeechRecognitionResult: JSString = "SpeechRecognitionResult" - static let SpeechRecognitionResultList: JSString = "SpeechRecognitionResultList" - static let SpeechSynthesis: JSString = "SpeechSynthesis" - static let SpeechSynthesisErrorEvent: JSString = "SpeechSynthesisErrorEvent" - static let SpeechSynthesisEvent: JSString = "SpeechSynthesisEvent" - static let SpeechSynthesisUtterance: JSString = "SpeechSynthesisUtterance" - static let SpeechSynthesisVoice: JSString = "SpeechSynthesisVoice" - static let StaticRange: JSString = "StaticRange" - static let StereoPannerNode: JSString = "StereoPannerNode" - static let Storage: JSString = "Storage" - static let StorageEvent: JSString = "StorageEvent" - static let StorageManager: JSString = "StorageManager" - static let StylePropertyMap: JSString = "StylePropertyMap" - static let StylePropertyMapReadOnly: JSString = "StylePropertyMapReadOnly" - static let StyleSheet: JSString = "StyleSheet" - static let StyleSheetList: JSString = "StyleSheetList" - static let SubmitEvent: JSString = "SubmitEvent" - static let SubtleCrypto: JSString = "SubtleCrypto" - static let SyncEvent: JSString = "SyncEvent" - static let SyncManager: JSString = "SyncManager" - static let Table: JSString = "Table" - static let TaskAttributionTiming: JSString = "TaskAttributionTiming" - static let TaskController: JSString = "TaskController" - static let TaskPriorityChangeEvent: JSString = "TaskPriorityChangeEvent" - static let TaskSignal: JSString = "TaskSignal" - static let TestUtils: JSString = "TestUtils" - static let Text: JSString = "Text" - static let TextDecoder: JSString = "TextDecoder" - static let TextDecoderStream: JSString = "TextDecoderStream" - static let TextDetector: JSString = "TextDetector" - static let TextEncoder: JSString = "TextEncoder" - static let TextEncoderStream: JSString = "TextEncoderStream" - static let TextFormat: JSString = "TextFormat" - static let TextFormatUpdateEvent: JSString = "TextFormatUpdateEvent" - static let TextMetrics: JSString = "TextMetrics" - static let TextTrack: JSString = "TextTrack" - static let TextTrackCue: JSString = "TextTrackCue" - static let TextTrackCueList: JSString = "TextTrackCueList" - static let TextTrackList: JSString = "TextTrackList" - static let TextUpdateEvent: JSString = "TextUpdateEvent" - static let TimeEvent: JSString = "TimeEvent" - static let TimeRanges: JSString = "TimeRanges" - static let Touch: JSString = "Touch" - static let TouchEvent: JSString = "TouchEvent" - static let TouchList: JSString = "TouchList" - static let TrackEvent: JSString = "TrackEvent" - static let TransformStream: JSString = "TransformStream" - static let TransformStreamDefaultController: JSString = "TransformStreamDefaultController" - static let TransitionEvent: JSString = "TransitionEvent" - static let TreeWalker: JSString = "TreeWalker" - static let TrustedHTML: JSString = "TrustedHTML" - static let TrustedScript: JSString = "TrustedScript" - static let TrustedScriptURL: JSString = "TrustedScriptURL" - static let TrustedTypePolicy: JSString = "TrustedTypePolicy" - static let TrustedTypePolicyFactory: JSString = "TrustedTypePolicyFactory" - static let UIEvent: JSString = "UIEvent" - static let URL: JSString = "URL" - static let URLPattern: JSString = "URLPattern" - static let URLSearchParams: JSString = "URLSearchParams" - static let USB: JSString = "USB" - static let USBAlternateInterface: JSString = "USBAlternateInterface" - static let USBConfiguration: JSString = "USBConfiguration" - static let USBConnectionEvent: JSString = "USBConnectionEvent" - static let USBDevice: JSString = "USBDevice" - static let USBEndpoint: JSString = "USBEndpoint" - static let USBInTransferResult: JSString = "USBInTransferResult" - static let USBInterface: JSString = "USBInterface" - static let USBIsochronousInTransferPacket: JSString = "USBIsochronousInTransferPacket" - static let USBIsochronousInTransferResult: JSString = "USBIsochronousInTransferResult" - static let USBIsochronousOutTransferPacket: JSString = "USBIsochronousOutTransferPacket" - static let USBIsochronousOutTransferResult: JSString = "USBIsochronousOutTransferResult" - static let USBOutTransferResult: JSString = "USBOutTransferResult" - static let USBPermissionResult: JSString = "USBPermissionResult" - static let UncalibratedMagnetometer: JSString = "UncalibratedMagnetometer" - static let VTTCue: JSString = "VTTCue" - static let VTTRegion: JSString = "VTTRegion" - static let ValidityState: JSString = "ValidityState" - static let ValueEvent: JSString = "ValueEvent" - static let VideoColorSpace: JSString = "VideoColorSpace" - static let VideoDecoder: JSString = "VideoDecoder" - static let VideoEncoder: JSString = "VideoEncoder" - static let VideoFrame: JSString = "VideoFrame" - static let VideoPlaybackQuality: JSString = "VideoPlaybackQuality" - static let VideoTrack: JSString = "VideoTrack" - static let VideoTrackGenerator: JSString = "VideoTrackGenerator" - static let VideoTrackList: JSString = "VideoTrackList" - static let VirtualKeyboard: JSString = "VirtualKeyboard" - static let VisualViewport: JSString = "VisualViewport" - static let WEBGL_blend_equation_advanced_coherent: JSString = "WEBGL_blend_equation_advanced_coherent" - static let WEBGL_color_buffer_float: JSString = "WEBGL_color_buffer_float" - static let WEBGL_compressed_texture_astc: JSString = "WEBGL_compressed_texture_astc" - static let WEBGL_compressed_texture_etc: JSString = "WEBGL_compressed_texture_etc" - static let WEBGL_compressed_texture_etc1: JSString = "WEBGL_compressed_texture_etc1" - static let WEBGL_compressed_texture_pvrtc: JSString = "WEBGL_compressed_texture_pvrtc" - static let WEBGL_compressed_texture_s3tc: JSString = "WEBGL_compressed_texture_s3tc" - static let WEBGL_compressed_texture_s3tc_srgb: JSString = "WEBGL_compressed_texture_s3tc_srgb" - static let WEBGL_debug_renderer_info: JSString = "WEBGL_debug_renderer_info" - static let WEBGL_debug_shaders: JSString = "WEBGL_debug_shaders" - static let WEBGL_depth_texture: JSString = "WEBGL_depth_texture" - static let WEBGL_draw_buffers: JSString = "WEBGL_draw_buffers" - static let WEBGL_draw_instanced_base_vertex_base_instance: JSString = "WEBGL_draw_instanced_base_vertex_base_instance" - static let WEBGL_lose_context: JSString = "WEBGL_lose_context" - static let WEBGL_multi_draw: JSString = "WEBGL_multi_draw" - static let WEBGL_multi_draw_instanced_base_vertex_base_instance: JSString = "WEBGL_multi_draw_instanced_base_vertex_base_instance" - static let WakeLock: JSString = "WakeLock" - static let WakeLockSentinel: JSString = "WakeLockSentinel" - static let WaveShaperNode: JSString = "WaveShaperNode" - static let WebAssembly: JSString = "WebAssembly" - static let WebGL2RenderingContext: JSString = "WebGL2RenderingContext" - static let WebGLActiveInfo: JSString = "WebGLActiveInfo" - static let WebGLBuffer: JSString = "WebGLBuffer" - static let WebGLContextEvent: JSString = "WebGLContextEvent" - static let WebGLFramebuffer: JSString = "WebGLFramebuffer" - static let WebGLObject: JSString = "WebGLObject" - static let WebGLProgram: JSString = "WebGLProgram" - static let WebGLQuery: JSString = "WebGLQuery" - static let WebGLRenderbuffer: JSString = "WebGLRenderbuffer" - static let WebGLRenderingContext: JSString = "WebGLRenderingContext" - static let WebGLSampler: JSString = "WebGLSampler" - static let WebGLShader: JSString = "WebGLShader" - static let WebGLShaderPrecisionFormat: JSString = "WebGLShaderPrecisionFormat" - static let WebGLSync: JSString = "WebGLSync" - static let WebGLTexture: JSString = "WebGLTexture" - static let WebGLTimerQueryEXT: JSString = "WebGLTimerQueryEXT" - static let WebGLTransformFeedback: JSString = "WebGLTransformFeedback" - static let WebGLUniformLocation: JSString = "WebGLUniformLocation" - static let WebGLVertexArrayObject: JSString = "WebGLVertexArrayObject" - static let WebGLVertexArrayObjectOES: JSString = "WebGLVertexArrayObjectOES" - static let WebSocket: JSString = "WebSocket" - static let WebTransport: JSString = "WebTransport" - static let WebTransportBidirectionalStream: JSString = "WebTransportBidirectionalStream" - static let WebTransportDatagramDuplexStream: JSString = "WebTransportDatagramDuplexStream" - static let WebTransportError: JSString = "WebTransportError" - static let WheelEvent: JSString = "WheelEvent" - static let Window: JSString = "Window" - static let WindowClient: JSString = "WindowClient" - static let WindowControlsOverlay: JSString = "WindowControlsOverlay" - static let WindowControlsOverlayGeometryChangeEvent: JSString = "WindowControlsOverlayGeometryChangeEvent" - static let Worker: JSString = "Worker" - static let WorkerGlobalScope: JSString = "WorkerGlobalScope" - static let WorkerLocation: JSString = "WorkerLocation" - static let WorkerNavigator: JSString = "WorkerNavigator" - static let Worklet: JSString = "Worklet" - static let WorkletAnimation: JSString = "WorkletAnimation" - static let WorkletAnimationEffect: JSString = "WorkletAnimationEffect" - static let WorkletGlobalScope: JSString = "WorkletGlobalScope" - static let WorkletGroupEffect: JSString = "WorkletGroupEffect" - static let WritableStream: JSString = "WritableStream" - static let WritableStreamDefaultController: JSString = "WritableStreamDefaultController" - static let WritableStreamDefaultWriter: JSString = "WritableStreamDefaultWriter" - static let XMLDocument: JSString = "XMLDocument" - static let XMLHttpRequest: JSString = "XMLHttpRequest" - static let XMLHttpRequestEventTarget: JSString = "XMLHttpRequestEventTarget" - static let XMLHttpRequestUpload: JSString = "XMLHttpRequestUpload" - static let XMLSerializer: JSString = "XMLSerializer" - static let XPathEvaluator: JSString = "XPathEvaluator" - static let XPathExpression: JSString = "XPathExpression" - static let XPathResult: JSString = "XPathResult" - static let XRAnchor: JSString = "XRAnchor" - static let XRAnchorSet: JSString = "XRAnchorSet" - static let XRBoundedReferenceSpace: JSString = "XRBoundedReferenceSpace" - static let XRCPUDepthInformation: JSString = "XRCPUDepthInformation" - static let XRCompositionLayer: JSString = "XRCompositionLayer" - static let XRCubeLayer: JSString = "XRCubeLayer" - static let XRCylinderLayer: JSString = "XRCylinderLayer" - static let XRDepthInformation: JSString = "XRDepthInformation" - static let XREquirectLayer: JSString = "XREquirectLayer" - static let XRFrame: JSString = "XRFrame" - static let XRHand: JSString = "XRHand" - static let XRHitTestResult: JSString = "XRHitTestResult" - static let XRHitTestSource: JSString = "XRHitTestSource" - static let XRInputSource: JSString = "XRInputSource" - static let XRInputSourceArray: JSString = "XRInputSourceArray" - static let XRInputSourceEvent: JSString = "XRInputSourceEvent" - static let XRInputSourcesChangeEvent: JSString = "XRInputSourcesChangeEvent" - static let XRJointPose: JSString = "XRJointPose" - static let XRJointSpace: JSString = "XRJointSpace" - static let XRLayer: JSString = "XRLayer" - static let XRLayerEvent: JSString = "XRLayerEvent" - static let XRLightEstimate: JSString = "XRLightEstimate" - static let XRLightProbe: JSString = "XRLightProbe" - static let XRMediaBinding: JSString = "XRMediaBinding" - static let XRPermissionStatus: JSString = "XRPermissionStatus" - static let XRPose: JSString = "XRPose" - static let XRProjectionLayer: JSString = "XRProjectionLayer" - static let XRQuadLayer: JSString = "XRQuadLayer" - static let XRRay: JSString = "XRRay" - static let XRReferenceSpace: JSString = "XRReferenceSpace" - static let XRReferenceSpaceEvent: JSString = "XRReferenceSpaceEvent" - static let XRRenderState: JSString = "XRRenderState" - static let XRRigidTransform: JSString = "XRRigidTransform" - static let XRSession: JSString = "XRSession" - static let XRSessionEvent: JSString = "XRSessionEvent" - static let XRSpace: JSString = "XRSpace" - static let XRSubImage: JSString = "XRSubImage" - static let XRSystem: JSString = "XRSystem" - static let XRTransientInputHitTestResult: JSString = "XRTransientInputHitTestResult" - static let XRTransientInputHitTestSource: JSString = "XRTransientInputHitTestSource" - static let XRView: JSString = "XRView" - static let XRViewerPose: JSString = "XRViewerPose" - static let XRViewport: JSString = "XRViewport" - static let XRWebGLBinding: JSString = "XRWebGLBinding" - static let XRWebGLDepthInformation: JSString = "XRWebGLDepthInformation" - static let XRWebGLLayer: JSString = "XRWebGLLayer" - static let XRWebGLSubImage: JSString = "XRWebGLSubImage" - static let XSLTProcessor: JSString = "XSLTProcessor" - static let a: JSString = "a" - static let aLink: JSString = "aLink" - static let aTranspose: JSString = "aTranspose" - static let abbr: JSString = "abbr" - static let abort: JSString = "abort" - static let aborted: JSString = "aborted" - static let abs: JSString = "abs" - static let absolute: JSString = "absolute" - static let acceleration: JSString = "acceleration" - static let accelerationIncludingGravity: JSString = "accelerationIncludingGravity" - static let accept: JSString = "accept" - static let acceptAllDevices: JSString = "acceptAllDevices" - static let acceptCharset: JSString = "acceptCharset" - static let access: JSString = "access" - static let accessKey: JSString = "accessKey" - static let accessKeyLabel: JSString = "accessKeyLabel" - static let accuracy: JSString = "accuracy" - static let action: JSString = "action" - static let actions: JSString = "actions" - static let activate: JSString = "activate" - static let activated: JSString = "activated" - static let activation: JSString = "activation" - static let activations: JSString = "activations" - static let active: JSString = "active" - static let activeCues: JSString = "activeCues" - static let activeDuration: JSString = "activeDuration" - static let activeElement: JSString = "activeElement" - static let activeSourceBuffers: JSString = "activeSourceBuffers" - static let activeTexture: JSString = "activeTexture" - static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" - static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" - static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" - static let actualBoundingBoxRight: JSString = "actualBoundingBoxRight" - static let add: JSString = "add" - static let addAll: JSString = "addAll" - static let addColorStop: JSString = "addColorStop" - static let addCue: JSString = "addCue" - static let addFromString: JSString = "addFromString" - static let addFromURI: JSString = "addFromURI" - static let addModule: JSString = "addModule" - static let addPath: JSString = "addPath" - static let addRange: JSString = "addRange" - static let addRemoteCandidate: JSString = "addRemoteCandidate" - static let addRule: JSString = "addRule" - static let addSourceBuffer: JSString = "addSourceBuffer" - static let addTextTrack: JSString = "addTextTrack" - static let addTrack: JSString = "addTrack" - static let addTransceiver: JSString = "addTransceiver" - static let added: JSString = "added" - static let addedNodes: JSString = "addedNodes" - static let additionalData: JSString = "additionalData" - static let additionalDisplayItems: JSString = "additionalDisplayItems" - static let additiveSymbols: JSString = "additiveSymbols" - static let address: JSString = "address" - static let addressLine: JSString = "addressLine" - static let addressModeU: JSString = "addressModeU" - static let addressModeV: JSString = "addressModeV" - static let addressModeW: JSString = "addressModeW" - static let adoptNode: JSString = "adoptNode" - static let adoptPredecessor: JSString = "adoptPredecessor" - static let adoptedStyleSheets: JSString = "adoptedStyleSheets" - static let advance: JSString = "advance" - static let advanced: JSString = "advanced" - static let advances: JSString = "advances" - static let after: JSString = "after" - static let album: JSString = "album" - static let alert: JSString = "alert" - static let alg: JSString = "alg" - static let algorithm: JSString = "algorithm" - static let align: JSString = "align" - static let alinkColor: JSString = "alinkColor" - static let all: JSString = "all" - static let allocationSize: JSString = "allocationSize" - static let allow: JSString = "allow" - static let allowAttributes: JSString = "allowAttributes" - static let allowComments: JSString = "allowComments" - static let allowCredentials: JSString = "allowCredentials" - static let allowCustomElements: JSString = "allowCustomElements" - static let allowElements: JSString = "allowElements" - static let allowFullscreen: JSString = "allowFullscreen" - static let allowPooling: JSString = "allowPooling" - static let allowWithoutGesture: JSString = "allowWithoutGesture" - static let allowedDevices: JSString = "allowedDevices" - static let allowedFeatures: JSString = "allowedFeatures" - static let allowedManufacturerData: JSString = "allowedManufacturerData" - static let allowedServices: JSString = "allowedServices" - static let allowsFeature: JSString = "allowsFeature" - static let alpha: JSString = "alpha" - static let alphaSideData: JSString = "alphaSideData" - static let alphaToCoverageEnabled: JSString = "alphaToCoverageEnabled" - static let alphabeticBaseline: JSString = "alphabeticBaseline" - static let alt: JSString = "alt" - static let altKey: JSString = "altKey" - static let alternate: JSString = "alternate" - static let alternateSetting: JSString = "alternateSetting" - static let alternates: JSString = "alternates" - static let altitude: JSString = "altitude" - static let altitudeAccuracy: JSString = "altitudeAccuracy" - static let altitudeAngle: JSString = "altitudeAngle" - static let amount: JSString = "amount" - static let amplitude: JSString = "amplitude" - static let ancestorOrigins: JSString = "ancestorOrigins" - static let anchorNode: JSString = "anchorNode" - static let anchorOffset: JSString = "anchorOffset" - static let anchorSpace: JSString = "anchorSpace" - static let anchors: JSString = "anchors" - static let angle: JSString = "angle" - static let angularAcceleration: JSString = "angularAcceleration" - static let angularVelocity: JSString = "angularVelocity" - static let animVal: JSString = "animVal" - static let animate: JSString = "animate" - static let animated: JSString = "animated" - static let animatedInstanceRoot: JSString = "animatedInstanceRoot" - static let animatedPoints: JSString = "animatedPoints" - static let animationName: JSString = "animationName" - static let animationWorklet: JSString = "animationWorklet" - static let animationsPaused: JSString = "animationsPaused" - static let animatorName: JSString = "animatorName" - static let annotation: JSString = "annotation" - static let antialias: JSString = "antialias" - static let anticipatedRemoval: JSString = "anticipatedRemoval" - static let appCodeName: JSString = "appCodeName" - static let appName: JSString = "appName" - static let appVersion: JSString = "appVersion" - static let appearance: JSString = "appearance" - static let append: JSString = "append" - static let appendBuffer: JSString = "appendBuffer" - static let appendChild: JSString = "appendChild" - static let appendData: JSString = "appendData" - static let appendItem: JSString = "appendItem" - static let appendMedium: JSString = "appendMedium" - static let appendRule: JSString = "appendRule" - static let appendWindowEnd: JSString = "appendWindowEnd" - static let appendWindowStart: JSString = "appendWindowStart" - static let appid: JSString = "appid" - static let appidExclude: JSString = "appidExclude" - static let applets: JSString = "applets" - static let applicationServerKey: JSString = "applicationServerKey" - static let applyConstraints: JSString = "applyConstraints" - static let arc: JSString = "arc" - static let arcTo: JSString = "arcTo" - static let architecture: JSString = "architecture" - static let archive: JSString = "archive" - static let areas: JSString = "areas" - static let args: JSString = "args" - static let ariaAtomic: JSString = "ariaAtomic" - static let ariaAutoComplete: JSString = "ariaAutoComplete" - static let ariaBusy: JSString = "ariaBusy" - static let ariaChecked: JSString = "ariaChecked" - static let ariaColCount: JSString = "ariaColCount" - static let ariaColIndex: JSString = "ariaColIndex" - static let ariaColIndexText: JSString = "ariaColIndexText" - static let ariaColSpan: JSString = "ariaColSpan" - static let ariaCurrent: JSString = "ariaCurrent" - static let ariaDescription: JSString = "ariaDescription" - static let ariaDisabled: JSString = "ariaDisabled" - static let ariaExpanded: JSString = "ariaExpanded" - static let ariaHasPopup: JSString = "ariaHasPopup" - static let ariaHidden: JSString = "ariaHidden" - static let ariaInvalid: JSString = "ariaInvalid" - static let ariaKeyShortcuts: JSString = "ariaKeyShortcuts" - static let ariaLabel: JSString = "ariaLabel" - static let ariaLevel: JSString = "ariaLevel" - static let ariaLive: JSString = "ariaLive" - static let ariaModal: JSString = "ariaModal" - static let ariaMultiLine: JSString = "ariaMultiLine" - static let ariaMultiSelectable: JSString = "ariaMultiSelectable" - static let ariaOrientation: JSString = "ariaOrientation" - static let ariaPlaceholder: JSString = "ariaPlaceholder" - static let ariaPosInSet: JSString = "ariaPosInSet" - static let ariaPressed: JSString = "ariaPressed" - static let ariaReadOnly: JSString = "ariaReadOnly" - static let ariaRequired: JSString = "ariaRequired" - static let ariaRoleDescription: JSString = "ariaRoleDescription" - static let ariaRowCount: JSString = "ariaRowCount" - static let ariaRowIndex: JSString = "ariaRowIndex" - static let ariaRowIndexText: JSString = "ariaRowIndexText" - static let ariaRowSpan: JSString = "ariaRowSpan" - static let ariaSelected: JSString = "ariaSelected" - static let ariaSetSize: JSString = "ariaSetSize" - static let ariaSort: JSString = "ariaSort" - static let ariaValueMax: JSString = "ariaValueMax" - static let ariaValueMin: JSString = "ariaValueMin" - static let ariaValueNow: JSString = "ariaValueNow" - static let ariaValueText: JSString = "ariaValueText" - static let arrayBuffer: JSString = "arrayBuffer" - static let arrayLayerCount: JSString = "arrayLayerCount" - static let arrayStride: JSString = "arrayStride" - static let artist: JSString = "artist" - static let artwork: JSString = "artwork" - static let `as`: JSString = "as" - static let ascentOverride: JSString = "ascentOverride" - static let aspect: JSString = "aspect" - static let aspectRatio: JSString = "aspectRatio" - static let assert: JSString = "assert" - static let assertion: JSString = "assertion" - static let assign: JSString = "assign" - static let assignedElements: JSString = "assignedElements" - static let assignedNodes: JSString = "assignedNodes" - static let assignedSlot: JSString = "assignedSlot" - static let async: JSString = "async" - static let atRules: JSString = "atRules" - static let atob: JSString = "atob" - static let attachInternals: JSString = "attachInternals" - static let attachShader: JSString = "attachShader" - static let attachShadow: JSString = "attachShadow" - static let attachedElements: JSString = "attachedElements" - static let attack: JSString = "attack" - static let attestation: JSString = "attestation" - static let attestationObject: JSString = "attestationObject" - static let attrChange: JSString = "attrChange" - static let attrName: JSString = "attrName" - static let attributeFilter: JSString = "attributeFilter" - static let attributeName: JSString = "attributeName" - static let attributeNamespace: JSString = "attributeNamespace" - static let attributeOldValue: JSString = "attributeOldValue" - static let attributeStyleMap: JSString = "attributeStyleMap" - static let attributes: JSString = "attributes" - static let attribution: JSString = "attribution" - static let attributionDestination: JSString = "attributionDestination" - static let attributionExpiry: JSString = "attributionExpiry" - static let attributionReportTo: JSString = "attributionReportTo" - static let attributionReporting: JSString = "attributionReporting" - static let attributionSourceEventId: JSString = "attributionSourceEventId" - static let attributionSourceId: JSString = "attributionSourceId" - static let attributionSourcePriority: JSString = "attributionSourcePriority" - static let audio: JSString = "audio" - static let audioBitrateMode: JSString = "audioBitrateMode" - static let audioBitsPerSecond: JSString = "audioBitsPerSecond" - static let audioCapabilities: JSString = "audioCapabilities" - static let audioLevel: JSString = "audioLevel" - static let audioTracks: JSString = "audioTracks" - static let audioWorklet: JSString = "audioWorklet" - static let authenticatedSignedWrites: JSString = "authenticatedSignedWrites" - static let authenticatorAttachment: JSString = "authenticatorAttachment" - static let authenticatorData: JSString = "authenticatorData" - static let authenticatorSelection: JSString = "authenticatorSelection" - static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" - static let autoBlockSize: JSString = "autoBlockSize" - static let autoGainControl: JSString = "autoGainControl" - static let autoIncrement: JSString = "autoIncrement" - static let autoPad: JSString = "autoPad" - static let autoPictureInPicture: JSString = "autoPictureInPicture" - static let autocapitalize: JSString = "autocapitalize" - static let autocomplete: JSString = "autocomplete" - static let autofocus: JSString = "autofocus" - static let automationRate: JSString = "automationRate" - static let autoplay: JSString = "autoplay" - static let availHeight: JSString = "availHeight" - static let availWidth: JSString = "availWidth" - static let availableBlockSize: JSString = "availableBlockSize" - static let availableIncomingBitrate: JSString = "availableIncomingBitrate" - static let availableInlineSize: JSString = "availableInlineSize" - static let availableOutgoingBitrate: JSString = "availableOutgoingBitrate" - static let averagePool2d: JSString = "averagePool2d" - static let averageRtcpInterval: JSString = "averageRtcpInterval" - static let ax: JSString = "ax" - static let axes: JSString = "axes" - static let axis: JSString = "axis" - static let axisTag: JSString = "axisTag" - static let ay: JSString = "ay" - static let azimuth: JSString = "azimuth" - static let azimuthAngle: JSString = "azimuthAngle" - static let b: JSString = "b" - static let bTranspose: JSString = "bTranspose" - static let back: JSString = "back" - static let background: JSString = "background" - static let backgroundColor: JSString = "backgroundColor" - static let backgroundFetch: JSString = "backgroundFetch" - static let badInput: JSString = "badInput" - static let badge: JSString = "badge" - static let base64Certificate: JSString = "base64Certificate" - static let baseArrayLayer: JSString = "baseArrayLayer" - static let baseFrequencyX: JSString = "baseFrequencyX" - static let baseFrequencyY: JSString = "baseFrequencyY" - static let baseLatency: JSString = "baseLatency" - static let baseLayer: JSString = "baseLayer" - static let baseMipLevel: JSString = "baseMipLevel" - static let basePalette: JSString = "basePalette" - static let baseURI: JSString = "baseURI" - static let baseURL: JSString = "baseURL" - static let baseVal: JSString = "baseVal" - static let baselines: JSString = "baselines" - static let batchNormalization: JSString = "batchNormalization" - static let baudRate: JSString = "baudRate" - static let before: JSString = "before" - static let beginComputePass: JSString = "beginComputePass" - static let beginElement: JSString = "beginElement" - static let beginElementAt: JSString = "beginElementAt" - static let beginOcclusionQuery: JSString = "beginOcclusionQuery" - static let beginPath: JSString = "beginPath" - static let beginQuery: JSString = "beginQuery" - static let beginQueryEXT: JSString = "beginQueryEXT" - static let beginRenderPass: JSString = "beginRenderPass" - static let beginTransformFeedback: JSString = "beginTransformFeedback" - static let behavior: JSString = "behavior" - static let beta: JSString = "beta" - static let bezierCurveTo: JSString = "bezierCurveTo" - static let bgColor: JSString = "bgColor" - static let bias: JSString = "bias" - static let binaryType: JSString = "binaryType" - static let bindAttribLocation: JSString = "bindAttribLocation" - static let bindBuffer: JSString = "bindBuffer" - static let bindBufferBase: JSString = "bindBufferBase" - static let bindBufferRange: JSString = "bindBufferRange" - static let bindFramebuffer: JSString = "bindFramebuffer" - static let bindGroupLayouts: JSString = "bindGroupLayouts" - static let bindRenderbuffer: JSString = "bindRenderbuffer" - static let bindSampler: JSString = "bindSampler" - static let bindTexture: JSString = "bindTexture" - static let bindTransformFeedback: JSString = "bindTransformFeedback" - static let bindVertexArray: JSString = "bindVertexArray" - static let bindVertexArrayOES: JSString = "bindVertexArrayOES" - static let binding: JSString = "binding" - static let bitDepth: JSString = "bitDepth" - static let bitness: JSString = "bitness" - static let bitrate: JSString = "bitrate" - static let bitrateMode: JSString = "bitrateMode" - static let bitsPerSecond: JSString = "bitsPerSecond" - static let blend: JSString = "blend" - static let blendColor: JSString = "blendColor" - static let blendEquation: JSString = "blendEquation" - static let blendEquationSeparate: JSString = "blendEquationSeparate" - static let blendEquationSeparateiOES: JSString = "blendEquationSeparateiOES" - static let blendEquationiOES: JSString = "blendEquationiOES" - static let blendFunc: JSString = "blendFunc" - static let blendFuncSeparate: JSString = "blendFuncSeparate" - static let blendFuncSeparateiOES: JSString = "blendFuncSeparateiOES" - static let blendFunciOES: JSString = "blendFunciOES" - static let blendTextureSourceAlpha: JSString = "blendTextureSourceAlpha" - static let blitFramebuffer: JSString = "blitFramebuffer" - static let blob: JSString = "blob" - static let block: JSString = "block" - static let blockElements: JSString = "blockElements" - static let blockEnd: JSString = "blockEnd" - static let blockFragmentationOffset: JSString = "blockFragmentationOffset" - static let blockFragmentationType: JSString = "blockFragmentationType" - static let blockOffset: JSString = "blockOffset" - static let blockSize: JSString = "blockSize" - static let blockStart: JSString = "blockStart" - static let blockedURI: JSString = "blockedURI" - static let blockedURL: JSString = "blockedURL" - static let blocking: JSString = "blocking" - static let bluetooth: JSString = "bluetooth" - static let blur: JSString = "blur" - static let body: JSString = "body" - static let bodyUsed: JSString = "bodyUsed" - static let booleanValue: JSString = "booleanValue" - static let border: JSString = "border" - static let borderBoxSize: JSString = "borderBoxSize" - static let bottom: JSString = "bottom" - static let bound: JSString = "bound" - static let boundingBox: JSString = "boundingBox" - static let boundingBoxAscent: JSString = "boundingBoxAscent" - static let boundingBoxDescent: JSString = "boundingBoxDescent" - static let boundingBoxLeft: JSString = "boundingBoxLeft" - static let boundingBoxRight: JSString = "boundingBoxRight" - static let boundingClientRect: JSString = "boundingClientRect" - static let boundingRect: JSString = "boundingRect" - static let boundsGeometry: JSString = "boundsGeometry" - static let box: JSString = "box" - static let brand: JSString = "brand" - static let brands: JSString = "brands" - static let `break`: JSString = "break" - static let breakToken: JSString = "breakToken" - static let breakType: JSString = "breakType" - static let breakdown: JSString = "breakdown" - static let brightness: JSString = "brightness" - static let broadcast: JSString = "broadcast" - static let btoa: JSString = "btoa" - static let bubbles: JSString = "bubbles" - static let buffer: JSString = "buffer" - static let bufferData: JSString = "bufferData" - static let bufferSize: JSString = "bufferSize" - static let bufferSubData: JSString = "bufferSubData" - static let buffered: JSString = "buffered" - static let bufferedAmount: JSString = "bufferedAmount" - static let bufferedAmountLowThreshold: JSString = "bufferedAmountLowThreshold" - static let buffers: JSString = "buffers" - static let build: JSString = "build" - static let bundlePolicy: JSString = "bundlePolicy" - static let burstDiscardCount: JSString = "burstDiscardCount" - static let burstDiscardRate: JSString = "burstDiscardRate" - static let burstLossCount: JSString = "burstLossCount" - static let burstLossRate: JSString = "burstLossRate" - static let burstPacketsDiscarded: JSString = "burstPacketsDiscarded" - static let burstPacketsLost: JSString = "burstPacketsLost" - static let button: JSString = "button" - static let buttons: JSString = "buttons" - static let byobRequest: JSString = "byobRequest" - static let byteLength: JSString = "byteLength" - static let bytes: JSString = "bytes" - static let bytesDiscardedOnSend: JSString = "bytesDiscardedOnSend" - static let bytesPerRow: JSString = "bytesPerRow" - static let bytesReceived: JSString = "bytesReceived" - static let bytesSent: JSString = "bytesSent" - static let bytesWritten: JSString = "bytesWritten" - static let c: JSString = "c" - static let cache: JSString = "cache" - static let cacheName: JSString = "cacheName" - static let caches: JSString = "caches" - static let canConstructInDedicatedWorker: JSString = "canConstructInDedicatedWorker" - static let canGoBack: JSString = "canGoBack" - static let canGoForward: JSString = "canGoForward" - static let canInsertDTMF: JSString = "canInsertDTMF" - static let canMakePayment: JSString = "canMakePayment" - static let canPlayType: JSString = "canPlayType" - static let canShare: JSString = "canShare" - static let canTransition: JSString = "canTransition" - static let canTrickleIceCandidates: JSString = "canTrickleIceCandidates" - static let cancel: JSString = "cancel" - static let cancelAndHoldAtTime: JSString = "cancelAndHoldAtTime" - static let cancelAnimationFrame: JSString = "cancelAnimationFrame" - static let cancelBubble: JSString = "cancelBubble" - static let cancelIdleCallback: JSString = "cancelIdleCallback" - static let cancelScheduledValues: JSString = "cancelScheduledValues" - static let cancelVideoFrameCallback: JSString = "cancelVideoFrameCallback" - static let cancelWatchAvailability: JSString = "cancelWatchAvailability" - static let cancelable: JSString = "cancelable" - static let candidate: JSString = "candidate" - static let candidateType: JSString = "candidateType" - static let candidates: JSString = "candidates" - static let canonicalUUID: JSString = "canonicalUUID" - static let canvas: JSString = "canvas" - static let caption: JSString = "caption" - static let capture: JSString = "capture" - static let captureEvents: JSString = "captureEvents" - static let captureStream: JSString = "captureStream" - static let captureTime: JSString = "captureTime" - static let caretPositionFromPoint: JSString = "caretPositionFromPoint" - static let category: JSString = "category" - static let ceil: JSString = "ceil" - static let cellIndex: JSString = "cellIndex" - static let cellPadding: JSString = "cellPadding" - static let cellSpacing: JSString = "cellSpacing" - static let cells: JSString = "cells" - static let centralAngle: JSString = "centralAngle" - static let centralHorizontalAngle: JSString = "centralHorizontalAngle" - static let certificates: JSString = "certificates" - static let ch: JSString = "ch" - static let chOff: JSString = "chOff" - static let challenge: JSString = "challenge" - static let changePaymentMethod: JSString = "changePaymentMethod" - static let changeType: JSString = "changeType" - static let changed: JSString = "changed" - static let changedTouches: JSString = "changedTouches" - static let channel: JSString = "channel" - static let channelCount: JSString = "channelCount" - static let channelCountMode: JSString = "channelCountMode" - static let channelInterpretation: JSString = "channelInterpretation" - static let channels: JSString = "channels" - static let charCode: JSString = "charCode" - static let charIndex: JSString = "charIndex" - static let charLength: JSString = "charLength" - static let characterBounds: JSString = "characterBounds" - static let characterBoundsRangeStart: JSString = "characterBoundsRangeStart" - static let characterData: JSString = "characterData" - static let characterDataOldValue: JSString = "characterDataOldValue" - static let characterSet: JSString = "characterSet" - static let characterVariant: JSString = "characterVariant" - static let characteristic: JSString = "characteristic" - static let charging: JSString = "charging" - static let chargingTime: JSString = "chargingTime" - static let charset: JSString = "charset" - static let check: JSString = "check" - static let checkEnclosure: JSString = "checkEnclosure" - static let checkFramebufferStatus: JSString = "checkFramebufferStatus" - static let checkIntersection: JSString = "checkIntersection" - static let checkValidity: JSString = "checkValidity" - static let checked: JSString = "checked" - static let child: JSString = "child" - static let childBreakTokens: JSString = "childBreakTokens" - static let childDisplay: JSString = "childDisplay" - static let childElementCount: JSString = "childElementCount" - static let childFragments: JSString = "childFragments" - static let childList: JSString = "childList" - static let childNodes: JSString = "childNodes" - static let children: JSString = "children" - static let chromaticAberrationCorrection: JSString = "chromaticAberrationCorrection" - static let circuitBreakerTriggerCount: JSString = "circuitBreakerTriggerCount" - static let cite: JSString = "cite" - static let city: JSString = "city" - static let claim: JSString = "claim" - static let claimInterface: JSString = "claimInterface" - static let claimed: JSString = "claimed" - static let clamp: JSString = "clamp" - static let classCode: JSString = "classCode" - static let classList: JSString = "classList" - static let className: JSString = "className" - static let clear: JSString = "clear" - static let clearAppBadge: JSString = "clearAppBadge" - static let clearBuffer: JSString = "clearBuffer" - static let clearBufferfi: JSString = "clearBufferfi" - static let clearBufferfv: JSString = "clearBufferfv" - static let clearBufferiv: JSString = "clearBufferiv" - static let clearBufferuiv: JSString = "clearBufferuiv" - static let clearClientBadge: JSString = "clearClientBadge" - static let clearColor: JSString = "clearColor" - static let clearData: JSString = "clearData" - static let clearDepth: JSString = "clearDepth" - static let clearHalt: JSString = "clearHalt" - static let clearInterval: JSString = "clearInterval" - static let clearLiveSeekableRange: JSString = "clearLiveSeekableRange" - static let clearMarks: JSString = "clearMarks" - static let clearMeasures: JSString = "clearMeasures" - static let clearParameters: JSString = "clearParameters" - static let clearRect: JSString = "clearRect" - static let clearResourceTimings: JSString = "clearResourceTimings" - static let clearStencil: JSString = "clearStencil" - static let clearTimeout: JSString = "clearTimeout" - static let clearToSend: JSString = "clearToSend" - static let clearValue: JSString = "clearValue" - static let clearWatch: JSString = "clearWatch" - static let click: JSString = "click" - static let clientDataJSON: JSString = "clientDataJSON" - static let clientHeight: JSString = "clientHeight" - static let clientId: JSString = "clientId" - static let clientInformation: JSString = "clientInformation" - static let clientLeft: JSString = "clientLeft" - static let clientTop: JSString = "clientTop" - static let clientWaitSync: JSString = "clientWaitSync" - static let clientWidth: JSString = "clientWidth" - static let clientX: JSString = "clientX" - static let clientY: JSString = "clientY" - static let clients: JSString = "clients" - static let clip: JSString = "clip" - static let clipPathUnits: JSString = "clipPathUnits" - static let clipboard: JSString = "clipboard" - static let clipboardData: JSString = "clipboardData" - static let clipped: JSString = "clipped" - static let clockRate: JSString = "clockRate" - static let clone: JSString = "clone" - static let cloneContents: JSString = "cloneContents" - static let cloneNode: JSString = "cloneNode" - static let cloneRange: JSString = "cloneRange" - static let close: JSString = "close" - static let closeCode: JSString = "closeCode" - static let closePath: JSString = "closePath" - static let closed: JSString = "closed" - static let closest: JSString = "closest" - static let cm: JSString = "cm" - static let cmp: JSString = "cmp" - static let cname: JSString = "cname" - static let coalescedEvents: JSString = "coalescedEvents" - static let code: JSString = "code" - static let codeBase: JSString = "codeBase" - static let codeType: JSString = "codeType" - static let codec: JSString = "codec" - static let codecId: JSString = "codecId" - static let codecType: JSString = "codecType" - static let codecs: JSString = "codecs" - static let codedHeight: JSString = "codedHeight" - static let codedRect: JSString = "codedRect" - static let codedWidth: JSString = "codedWidth" - static let colSpan: JSString = "colSpan" - static let collapse: JSString = "collapse" - static let collapseToEnd: JSString = "collapseToEnd" - static let collapseToStart: JSString = "collapseToStart" - static let collapsed: JSString = "collapsed" - static let collections: JSString = "collections" - static let colno: JSString = "colno" - static let color: JSString = "color" - static let colorAttachments: JSString = "colorAttachments" - static let colorDepth: JSString = "colorDepth" - static let colorFormat: JSString = "colorFormat" - static let colorFormats: JSString = "colorFormats" - static let colorGamut: JSString = "colorGamut" - static let colorMask: JSString = "colorMask" - static let colorMaskiOES: JSString = "colorMaskiOES" - static let colorSpace: JSString = "colorSpace" - static let colorSpaceConversion: JSString = "colorSpaceConversion" - static let colorTemperature: JSString = "colorTemperature" - static let colorTexture: JSString = "colorTexture" - static let cols: JSString = "cols" - static let column: JSString = "column" - static let columnNumber: JSString = "columnNumber" - static let commit: JSString = "commit" - static let commitStyles: JSString = "commitStyles" - static let committed: JSString = "committed" - static let commonAncestorContainer: JSString = "commonAncestorContainer" - static let compact: JSString = "compact" - static let companyIdentifier: JSString = "companyIdentifier" - static let compare: JSString = "compare" - static let compareBoundaryPoints: JSString = "compareBoundaryPoints" - static let compareDocumentPosition: JSString = "compareDocumentPosition" - static let comparePoint: JSString = "comparePoint" - static let compatMode: JSString = "compatMode" - static let compilationInfo: JSString = "compilationInfo" - static let compile: JSString = "compile" - static let compileShader: JSString = "compileShader" - static let compileStreaming: JSString = "compileStreaming" - static let complete: JSString = "complete" - static let completeFramesOnly: JSString = "completeFramesOnly" - static let completed: JSString = "completed" - static let component: JSString = "component" - static let composed: JSString = "composed" - static let composedPath: JSString = "composedPath" - static let composite: JSString = "composite" - static let compositingAlphaMode: JSString = "compositingAlphaMode" - static let compositionEnd: JSString = "compositionEnd" - static let compositionRangeEnd: JSString = "compositionRangeEnd" - static let compositionRangeStart: JSString = "compositionRangeStart" - static let compositionStart: JSString = "compositionStart" - static let compressedTexImage2D: JSString = "compressedTexImage2D" - static let compressedTexImage3D: JSString = "compressedTexImage3D" - static let compressedTexSubImage2D: JSString = "compressedTexSubImage2D" - static let compressedTexSubImage3D: JSString = "compressedTexSubImage3D" - static let compute: JSString = "compute" - static let computedOffset: JSString = "computedOffset" - static let computedStyleMap: JSString = "computedStyleMap" - static let concat: JSString = "concat" - static let concealedSamples: JSString = "concealedSamples" - static let concealmentEvents: JSString = "concealmentEvents" - static let conditionText: JSString = "conditionText" - static let coneInnerAngle: JSString = "coneInnerAngle" - static let coneOuterAngle: JSString = "coneOuterAngle" - static let coneOuterGain: JSString = "coneOuterGain" - static let confidence: JSString = "confidence" - static let config: JSString = "config" - static let configuration: JSString = "configuration" - static let configurationName: JSString = "configurationName" - static let configurationValue: JSString = "configurationValue" - static let configurations: JSString = "configurations" - static let configure: JSString = "configure" - static let confirm: JSString = "confirm" - static let congestionWindow: JSString = "congestionWindow" - static let connect: JSString = "connect" - static let connectEnd: JSString = "connectEnd" - static let connectStart: JSString = "connectStart" - static let connected: JSString = "connected" - static let connection: JSString = "connection" - static let connectionList: JSString = "connectionList" - static let connectionState: JSString = "connectionState" - static let connections: JSString = "connections" - static let consentExpiredTimestamp: JSString = "consentExpiredTimestamp" - static let consentRequestBytesSent: JSString = "consentRequestBytesSent" - static let consentRequestsSent: JSString = "consentRequestsSent" - static let console: JSString = "console" - static let consolidate: JSString = "consolidate" - static let constant: JSString = "constant" - static let constants: JSString = "constants" - static let constraint: JSString = "constraint" - static let consume: JSString = "consume" - static let contacts: JSString = "contacts" - static let container: JSString = "container" - static let containerId: JSString = "containerId" - static let containerName: JSString = "containerName" - static let containerSrc: JSString = "containerSrc" - static let containerType: JSString = "containerType" - static let contains: JSString = "contains" - static let containsNode: JSString = "containsNode" - static let content: JSString = "content" - static let contentBoxSize: JSString = "contentBoxSize" - static let contentDocument: JSString = "contentDocument" - static let contentEditable: JSString = "contentEditable" - static let contentHint: JSString = "contentHint" - static let contentRect: JSString = "contentRect" - static let contentType: JSString = "contentType" - static let contentWindow: JSString = "contentWindow" - static let contents: JSString = "contents" - static let context: JSString = "context" - static let contextTime: JSString = "contextTime" - static let `continue`: JSString = "continue" - static let continuePrimaryKey: JSString = "continuePrimaryKey" - static let continuous: JSString = "continuous" - static let contrast: JSString = "contrast" - static let contributingSources: JSString = "contributingSources" - static let contributorSsrc: JSString = "contributorSsrc" - static let control: JSString = "control" - static let controlBound: JSString = "controlBound" - static let controlTransferIn: JSString = "controlTransferIn" - static let controlTransferOut: JSString = "controlTransferOut" - static let controller: JSString = "controller" - static let controls: JSString = "controls" - static let conv2d: JSString = "conv2d" - static let convTranspose2d: JSString = "convTranspose2d" - static let convertPointFromNode: JSString = "convertPointFromNode" - static let convertQuadFromNode: JSString = "convertQuadFromNode" - static let convertRectFromNode: JSString = "convertRectFromNode" - static let convertToBlob: JSString = "convertToBlob" - static let convertToSpecifiedUnits: JSString = "convertToSpecifiedUnits" - static let cookie: JSString = "cookie" - static let cookieEnabled: JSString = "cookieEnabled" - static let cookieStore: JSString = "cookieStore" - static let cookies: JSString = "cookies" - static let coords: JSString = "coords" - static let copyBufferSubData: JSString = "copyBufferSubData" - static let copyBufferToBuffer: JSString = "copyBufferToBuffer" - static let copyBufferToTexture: JSString = "copyBufferToTexture" - static let copyExternalImageToTexture: JSString = "copyExternalImageToTexture" - static let copyFromChannel: JSString = "copyFromChannel" - static let copyTexImage2D: JSString = "copyTexImage2D" - static let copyTexSubImage2D: JSString = "copyTexSubImage2D" - static let copyTexSubImage3D: JSString = "copyTexSubImage3D" - static let copyTextureToBuffer: JSString = "copyTextureToBuffer" - static let copyTextureToTexture: JSString = "copyTextureToTexture" - static let copyTo: JSString = "copyTo" - static let copyToChannel: JSString = "copyToChannel" - static let cornerPoints: JSString = "cornerPoints" - static let correspondingElement: JSString = "correspondingElement" - static let correspondingUseElement: JSString = "correspondingUseElement" - static let corruptedVideoFrames: JSString = "corruptedVideoFrames" - static let cos: JSString = "cos" - static let count: JSString = "count" - static let countReset: JSString = "countReset" - static let counter: JSString = "counter" - static let country: JSString = "country" - static let cqb: JSString = "cqb" - static let cqh: JSString = "cqh" - static let cqi: JSString = "cqi" - static let cqmax: JSString = "cqmax" - static let cqmin: JSString = "cqmin" - static let cqw: JSString = "cqw" - static let create: JSString = "create" - static let createAnalyser: JSString = "createAnalyser" - static let createAnchor: JSString = "createAnchor" - static let createAttribute: JSString = "createAttribute" - static let createAttributeNS: JSString = "createAttributeNS" - static let createBidirectionalStream: JSString = "createBidirectionalStream" - static let createBindGroup: JSString = "createBindGroup" - static let createBindGroupLayout: JSString = "createBindGroupLayout" - static let createBiquadFilter: JSString = "createBiquadFilter" - static let createBuffer: JSString = "createBuffer" - static let createBufferSource: JSString = "createBufferSource" - static let createCDATASection: JSString = "createCDATASection" - static let createCaption: JSString = "createCaption" - static let createChannelMerger: JSString = "createChannelMerger" - static let createChannelSplitter: JSString = "createChannelSplitter" - static let createCommandEncoder: JSString = "createCommandEncoder" - static let createComment: JSString = "createComment" - static let createComputePipeline: JSString = "createComputePipeline" - static let createComputePipelineAsync: JSString = "createComputePipelineAsync" - static let createConicGradient: JSString = "createConicGradient" - static let createConstantSource: JSString = "createConstantSource" - static let createContext: JSString = "createContext" - static let createContextualFragment: JSString = "createContextualFragment" - static let createConvolver: JSString = "createConvolver" - static let createCubeLayer: JSString = "createCubeLayer" - static let createCylinderLayer: JSString = "createCylinderLayer" - static let createDataChannel: JSString = "createDataChannel" - static let createDelay: JSString = "createDelay" - static let createDocument: JSString = "createDocument" - static let createDocumentFragment: JSString = "createDocumentFragment" - static let createDocumentType: JSString = "createDocumentType" - static let createDynamicsCompressor: JSString = "createDynamicsCompressor" - static let createElement: JSString = "createElement" - static let createElementNS: JSString = "createElementNS" - static let createEquirectLayer: JSString = "createEquirectLayer" - static let createEvent: JSString = "createEvent" - static let createFramebuffer: JSString = "createFramebuffer" - static let createGain: JSString = "createGain" - static let createHTML: JSString = "createHTML" - static let createHTMLDocument: JSString = "createHTMLDocument" - static let createIIRFilter: JSString = "createIIRFilter" - static let createImageBitmap: JSString = "createImageBitmap" - static let createImageData: JSString = "createImageData" - static let createIndex: JSString = "createIndex" - static let createLinearGradient: JSString = "createLinearGradient" - static let createMediaElementSource: JSString = "createMediaElementSource" - static let createMediaKeys: JSString = "createMediaKeys" - static let createMediaStreamDestination: JSString = "createMediaStreamDestination" - static let createMediaStreamSource: JSString = "createMediaStreamSource" - static let createMediaStreamTrackSource: JSString = "createMediaStreamTrackSource" - static let createObjectStore: JSString = "createObjectStore" - static let createObjectURL: JSString = "createObjectURL" - static let createOscillator: JSString = "createOscillator" - static let createPanner: JSString = "createPanner" - static let createPattern: JSString = "createPattern" - static let createPeriodicWave: JSString = "createPeriodicWave" - static let createPipelineLayout: JSString = "createPipelineLayout" - static let createPolicy: JSString = "createPolicy" - static let createProcessingInstruction: JSString = "createProcessingInstruction" - static let createProgram: JSString = "createProgram" - static let createProjectionLayer: JSString = "createProjectionLayer" - static let createQuadLayer: JSString = "createQuadLayer" - static let createQuery: JSString = "createQuery" - static let createQueryEXT: JSString = "createQueryEXT" - static let createQuerySet: JSString = "createQuerySet" - static let createRadialGradient: JSString = "createRadialGradient" - static let createRange: JSString = "createRange" - static let createReader: JSString = "createReader" - static let createRenderBundleEncoder: JSString = "createRenderBundleEncoder" - static let createRenderPipeline: JSString = "createRenderPipeline" - static let createRenderPipelineAsync: JSString = "createRenderPipelineAsync" - static let createRenderbuffer: JSString = "createRenderbuffer" - static let createSVGAngle: JSString = "createSVGAngle" - static let createSVGLength: JSString = "createSVGLength" - static let createSVGMatrix: JSString = "createSVGMatrix" - static let createSVGNumber: JSString = "createSVGNumber" - static let createSVGPoint: JSString = "createSVGPoint" - static let createSVGRect: JSString = "createSVGRect" - static let createSVGTransform: JSString = "createSVGTransform" - static let createSVGTransformFromMatrix: JSString = "createSVGTransformFromMatrix" - static let createSampler: JSString = "createSampler" - static let createScript: JSString = "createScript" - static let createScriptProcessor: JSString = "createScriptProcessor" - static let createScriptURL: JSString = "createScriptURL" - static let createSession: JSString = "createSession" - static let createShader: JSString = "createShader" - static let createShaderModule: JSString = "createShaderModule" - static let createStereoPanner: JSString = "createStereoPanner" - static let createTBody: JSString = "createTBody" - static let createTFoot: JSString = "createTFoot" - static let createTHead: JSString = "createTHead" - static let createTextNode: JSString = "createTextNode" - static let createTexture: JSString = "createTexture" - static let createTransformFeedback: JSString = "createTransformFeedback" - static let createUnidirectionalStream: JSString = "createUnidirectionalStream" - static let createVertexArray: JSString = "createVertexArray" - static let createVertexArrayOES: JSString = "createVertexArrayOES" - static let createView: JSString = "createView" - static let createWaveShaper: JSString = "createWaveShaper" - static let createWritable: JSString = "createWritable" - static let creationTime: JSString = "creationTime" - static let credProps: JSString = "credProps" - static let credential: JSString = "credential" - static let credentialIds: JSString = "credentialIds" - static let credentialType: JSString = "credentialType" - static let credentials: JSString = "credentials" - static let cropTo: JSString = "cropTo" - static let crossOrigin: JSString = "crossOrigin" - static let crossOriginIsolated: JSString = "crossOriginIsolated" - static let crv: JSString = "crv" - static let crypto: JSString = "crypto" - static let csp: JSString = "csp" - static let cssFloat: JSString = "cssFloat" - static let cssRules: JSString = "cssRules" - static let cssText: JSString = "cssText" - static let ctrlKey: JSString = "ctrlKey" - static let cues: JSString = "cues" - static let cullFace: JSString = "cullFace" - static let cullMode: JSString = "cullMode" - static let currency: JSString = "currency" - static let currentDirection: JSString = "currentDirection" - static let currentEntry: JSString = "currentEntry" - static let currentFrame: JSString = "currentFrame" - static let currentIteration: JSString = "currentIteration" - static let currentLocalDescription: JSString = "currentLocalDescription" - static let currentNode: JSString = "currentNode" - static let currentRect: JSString = "currentRect" - static let currentRemoteDescription: JSString = "currentRemoteDescription" - static let currentRoundTripTime: JSString = "currentRoundTripTime" - static let currentScale: JSString = "currentScale" - static let currentScript: JSString = "currentScript" - static let currentSrc: JSString = "currentSrc" - static let currentTarget: JSString = "currentTarget" - static let currentTime: JSString = "currentTime" - static let currentTranslate: JSString = "currentTranslate" - static let cursor: JSString = "cursor" - static let curve: JSString = "curve" - static let customElements: JSString = "customElements" - static let customError: JSString = "customError" - static let customSections: JSString = "customSections" - static let cx: JSString = "cx" - static let cy: JSString = "cy" - static let d: JSString = "d" - static let data: JSString = "data" - static let dataBits: JSString = "dataBits" - static let dataCarrierDetect: JSString = "dataCarrierDetect" - static let dataChannelIdentifier: JSString = "dataChannelIdentifier" - static let dataChannelsAccepted: JSString = "dataChannelsAccepted" - static let dataChannelsClosed: JSString = "dataChannelsClosed" - static let dataChannelsOpened: JSString = "dataChannelsOpened" - static let dataChannelsRequested: JSString = "dataChannelsRequested" - static let dataFormatPreference: JSString = "dataFormatPreference" - static let dataPrefix: JSString = "dataPrefix" - static let dataSetReady: JSString = "dataSetReady" - static let dataTerminalReady: JSString = "dataTerminalReady" - static let dataTransfer: JSString = "dataTransfer" - static let databases: JSString = "databases" - static let datagrams: JSString = "datagrams" - static let dataset: JSString = "dataset" - static let dateTime: JSString = "dateTime" - static let db: JSString = "db" - static let debug: JSString = "debug" - static let declare: JSString = "declare" - static let decode: JSString = "decode" - static let decodeQueueSize: JSString = "decodeQueueSize" - static let decodedBodySize: JSString = "decodedBodySize" - static let decoderConfig: JSString = "decoderConfig" - static let decoderImplementation: JSString = "decoderImplementation" - static let decoding: JSString = "decoding" - static let decodingInfo: JSString = "decodingInfo" - static let decrypt: JSString = "decrypt" - static let `default`: JSString = "default" - static let defaultChecked: JSString = "defaultChecked" - static let defaultFrameRate: JSString = "defaultFrameRate" - static let defaultMuted: JSString = "defaultMuted" - static let defaultPlaybackRate: JSString = "defaultPlaybackRate" - static let defaultPolicy: JSString = "defaultPolicy" - static let defaultPrevented: JSString = "defaultPrevented" - static let defaultQueue: JSString = "defaultQueue" - static let defaultRequest: JSString = "defaultRequest" - static let defaultSampleRate: JSString = "defaultSampleRate" - static let defaultSelected: JSString = "defaultSelected" - static let defaultValue: JSString = "defaultValue" - static let defaultView: JSString = "defaultView" - static let `defer`: JSString = "defer" - static let deg: JSString = "deg" - static let degradationPreference: JSString = "degradationPreference" - static let delay: JSString = "delay" - static let delayTime: JSString = "delayTime" - static let delegatesFocus: JSString = "delegatesFocus" - static let delete: JSString = "delete" - static let deleteBuffer: JSString = "deleteBuffer" - static let deleteCaption: JSString = "deleteCaption" - static let deleteCell: JSString = "deleteCell" - static let deleteContents: JSString = "deleteContents" - static let deleteData: JSString = "deleteData" - static let deleteDatabase: JSString = "deleteDatabase" - static let deleteFramebuffer: JSString = "deleteFramebuffer" - static let deleteFromDocument: JSString = "deleteFromDocument" - static let deleteIndex: JSString = "deleteIndex" - static let deleteMedium: JSString = "deleteMedium" - static let deleteObjectStore: JSString = "deleteObjectStore" - static let deleteProgram: JSString = "deleteProgram" - static let deleteQuery: JSString = "deleteQuery" - static let deleteQueryEXT: JSString = "deleteQueryEXT" - static let deleteRenderbuffer: JSString = "deleteRenderbuffer" - static let deleteRow: JSString = "deleteRow" - static let deleteRule: JSString = "deleteRule" - static let deleteSampler: JSString = "deleteSampler" - static let deleteShader: JSString = "deleteShader" - static let deleteSync: JSString = "deleteSync" - static let deleteTFoot: JSString = "deleteTFoot" - static let deleteTHead: JSString = "deleteTHead" - static let deleteTexture: JSString = "deleteTexture" - static let deleteTransformFeedback: JSString = "deleteTransformFeedback" - static let deleteVertexArray: JSString = "deleteVertexArray" - static let deleteVertexArrayOES: JSString = "deleteVertexArrayOES" - static let deleted: JSString = "deleted" - static let deltaMode: JSString = "deltaMode" - static let deltaX: JSString = "deltaX" - static let deltaY: JSString = "deltaY" - static let deltaZ: JSString = "deltaZ" - static let dependencies: JSString = "dependencies" - static let dependentLocality: JSString = "dependentLocality" - static let depth: JSString = "depth" - static let depthBias: JSString = "depthBias" - static let depthBiasClamp: JSString = "depthBiasClamp" - static let depthBiasSlopeScale: JSString = "depthBiasSlopeScale" - static let depthClearValue: JSString = "depthClearValue" - static let depthCompare: JSString = "depthCompare" - static let depthDataFormat: JSString = "depthDataFormat" - static let depthFailOp: JSString = "depthFailOp" - static let depthFar: JSString = "depthFar" - static let depthFormat: JSString = "depthFormat" - static let depthFunc: JSString = "depthFunc" - static let depthLoadOp: JSString = "depthLoadOp" - static let depthMask: JSString = "depthMask" - static let depthNear: JSString = "depthNear" - static let depthOrArrayLayers: JSString = "depthOrArrayLayers" - static let depthRange: JSString = "depthRange" - static let depthReadOnly: JSString = "depthReadOnly" - static let depthSensing: JSString = "depthSensing" - static let depthStencil: JSString = "depthStencil" - static let depthStencilAttachment: JSString = "depthStencilAttachment" - static let depthStencilFormat: JSString = "depthStencilFormat" - static let depthStencilTexture: JSString = "depthStencilTexture" - static let depthStoreOp: JSString = "depthStoreOp" - static let depthUsage: JSString = "depthUsage" - static let depthWriteEnabled: JSString = "depthWriteEnabled" - static let deriveBits: JSString = "deriveBits" - static let deriveKey: JSString = "deriveKey" - static let descentOverride: JSString = "descentOverride" - static let description: JSString = "description" - static let descriptor: JSString = "descriptor" - static let deselectAll: JSString = "deselectAll" - static let designMode: JSString = "designMode" - static let desiredHeight: JSString = "desiredHeight" - static let desiredSize: JSString = "desiredSize" - static let desiredWidth: JSString = "desiredWidth" - static let destination: JSString = "destination" - static let destroy: JSString = "destroy" - static let desynchronized: JSString = "desynchronized" - static let detach: JSString = "detach" - static let detachShader: JSString = "detachShader" - static let detail: JSString = "detail" - static let details: JSString = "details" - static let detect: JSString = "detect" - static let detune: JSString = "detune" - static let device: JSString = "device" - static let deviceClass: JSString = "deviceClass" - static let deviceId: JSString = "deviceId" - static let deviceMemory: JSString = "deviceMemory" - static let devicePixelContentBoxSize: JSString = "devicePixelContentBoxSize" - static let devicePixelRatio: JSString = "devicePixelRatio" - static let devicePosture: JSString = "devicePosture" - static let devicePreference: JSString = "devicePreference" - static let deviceProtocol: JSString = "deviceProtocol" - static let deviceSubclass: JSString = "deviceSubclass" - static let deviceVersionMajor: JSString = "deviceVersionMajor" - static let deviceVersionMinor: JSString = "deviceVersionMinor" - static let deviceVersionSubminor: JSString = "deviceVersionSubminor" - static let devices: JSString = "devices" - static let diameter: JSString = "diameter" - static let didTimeout: JSString = "didTimeout" - static let diffuseConstant: JSString = "diffuseConstant" - static let digest: JSString = "digest" - static let dilations: JSString = "dilations" - static let dimension: JSString = "dimension" - static let dimensions: JSString = "dimensions" - static let dir: JSString = "dir" - static let dirName: JSString = "dirName" - static let direction: JSString = "direction" - static let dirxml: JSString = "dirxml" - static let disable: JSString = "disable" - static let disableNormalization: JSString = "disableNormalization" - static let disablePictureInPicture: JSString = "disablePictureInPicture" - static let disableRemotePlayback: JSString = "disableRemotePlayback" - static let disableVertexAttribArray: JSString = "disableVertexAttribArray" - static let disabled: JSString = "disabled" - static let disableiOES: JSString = "disableiOES" - static let dischargingTime: JSString = "dischargingTime" - static let disconnect: JSString = "disconnect" - static let dispatch: JSString = "dispatch" - static let dispatchEvent: JSString = "dispatchEvent" - static let dispatchIndirect: JSString = "dispatchIndirect" - static let display: JSString = "display" - static let displayAspectHeight: JSString = "displayAspectHeight" - static let displayAspectWidth: JSString = "displayAspectWidth" - static let displayHeight: JSString = "displayHeight" - static let displayItems: JSString = "displayItems" - static let displayName: JSString = "displayName" - static let displaySurface: JSString = "displaySurface" - static let displayWidth: JSString = "displayWidth" - static let disposition: JSString = "disposition" - static let distance: JSString = "distance" - static let distanceModel: JSString = "distanceModel" - static let distinctiveIdentifier: JSString = "distinctiveIdentifier" - static let div: JSString = "div" - static let divisor: JSString = "divisor" - static let doctype: JSString = "doctype" - static let document: JSString = "document" - static let documentElement: JSString = "documentElement" - static let documentURI: JSString = "documentURI" - static let documentURL: JSString = "documentURL" - static let domComplete: JSString = "domComplete" - static let domContentLoadedEventEnd: JSString = "domContentLoadedEventEnd" - static let domContentLoadedEventStart: JSString = "domContentLoadedEventStart" - static let domInteractive: JSString = "domInteractive" - static let domLoading: JSString = "domLoading" - static let domOverlay: JSString = "domOverlay" - static let domOverlayState: JSString = "domOverlayState" - static let domain: JSString = "domain" - static let domainLookupEnd: JSString = "domainLookupEnd" - static let domainLookupStart: JSString = "domainLookupStart" - static let dominantBaseline: JSString = "dominantBaseline" - static let done: JSString = "done" - static let downlink: JSString = "downlink" - static let downlinkMax: JSString = "downlinkMax" - static let download: JSString = "download" - static let downloadTotal: JSString = "downloadTotal" - static let downloaded: JSString = "downloaded" - static let dp: JSString = "dp" - static let dpcm: JSString = "dpcm" - static let dpi: JSString = "dpi" - static let dppx: JSString = "dppx" - static let dq: JSString = "dq" - static let draggable: JSString = "draggable" - static let draw: JSString = "draw" - static let drawArrays: JSString = "drawArrays" - static let drawArraysInstanced: JSString = "drawArraysInstanced" - static let drawArraysInstancedANGLE: JSString = "drawArraysInstancedANGLE" - static let drawArraysInstancedBaseInstanceWEBGL: JSString = "drawArraysInstancedBaseInstanceWEBGL" - static let drawBuffers: JSString = "drawBuffers" - static let drawBuffersWEBGL: JSString = "drawBuffersWEBGL" - static let drawElements: JSString = "drawElements" - static let drawElementsInstanced: JSString = "drawElementsInstanced" - static let drawElementsInstancedANGLE: JSString = "drawElementsInstancedANGLE" - static let drawElementsInstancedBaseVertexBaseInstanceWEBGL: JSString = "drawElementsInstancedBaseVertexBaseInstanceWEBGL" - static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded" - static let drawImage: JSString = "drawImage" - static let drawIndexed: JSString = "drawIndexed" - static let drawIndexedIndirect: JSString = "drawIndexedIndirect" - static let drawIndirect: JSString = "drawIndirect" - static let drawRangeElements: JSString = "drawRangeElements" - static let drawingBufferHeight: JSString = "drawingBufferHeight" - static let drawingBufferWidth: JSString = "drawingBufferWidth" - static let dropAttributes: JSString = "dropAttributes" - static let dropEffect: JSString = "dropEffect" - static let dropElements: JSString = "dropElements" - static let droppedEntriesCount: JSString = "droppedEntriesCount" - static let droppedVideoFrames: JSString = "droppedVideoFrames" - static let dstFactor: JSString = "dstFactor" - static let dtlsCipher: JSString = "dtlsCipher" - static let dtlsState: JSString = "dtlsState" - static let dtmf: JSString = "dtmf" - static let durability: JSString = "durability" - static let duration: JSString = "duration" - static let durationThreshold: JSString = "durationThreshold" - static let dvb: JSString = "dvb" - static let dvh: JSString = "dvh" - static let dvi: JSString = "dvi" - static let dvmax: JSString = "dvmax" - static let dvmin: JSString = "dvmin" - static let dvw: JSString = "dvw" - static let dx: JSString = "dx" - static let dy: JSString = "dy" - static let e: JSString = "e" - static let easing: JSString = "easing" - static let echoCancellation: JSString = "echoCancellation" - static let echoReturnLoss: JSString = "echoReturnLoss" - static let echoReturnLossEnhancement: JSString = "echoReturnLossEnhancement" - static let edge: JSString = "edge" - static let edgeMode: JSString = "edgeMode" - static let editContext: JSString = "editContext" - static let effect: JSString = "effect" - static let effectAllowed: JSString = "effectAllowed" - static let effectiveDirective: JSString = "effectiveDirective" - static let effectiveType: JSString = "effectiveType" - static let elapsedTime: JSString = "elapsedTime" - static let element: JSString = "element" - static let elementFromPoint: JSString = "elementFromPoint" - static let elementSources: JSString = "elementSources" - static let elementTiming: JSString = "elementTiming" - static let elements: JSString = "elements" - static let elementsFromPoint: JSString = "elementsFromPoint" - static let elevation: JSString = "elevation" - static let ellipse: JSString = "ellipse" - static let elu: JSString = "elu" - static let em: JSString = "em" - static let emHeightAscent: JSString = "emHeightAscent" - static let emHeightDescent: JSString = "emHeightDescent" - static let email: JSString = "email" - static let embeds: JSString = "embeds" - static let empty: JSString = "empty" - static let emptyHTML: JSString = "emptyHTML" - static let emptyScript: JSString = "emptyScript" - static let emulatedPosition: JSString = "emulatedPosition" - static let enable: JSString = "enable" - static let enableHighAccuracy: JSString = "enableHighAccuracy" - static let enableVertexAttribArray: JSString = "enableVertexAttribArray" - static let enabled: JSString = "enabled" - static let enabledPlugin: JSString = "enabledPlugin" - static let enableiOES: JSString = "enableiOES" - static let encode: JSString = "encode" - static let encodeInto: JSString = "encodeInto" - static let encodeQueueSize: JSString = "encodeQueueSize" - static let encodedBodySize: JSString = "encodedBodySize" - static let encoderImplementation: JSString = "encoderImplementation" - static let encoding: JSString = "encoding" - static let encodingInfo: JSString = "encodingInfo" - static let encodings: JSString = "encodings" - static let encrypt: JSString = "encrypt" - static let encrypted: JSString = "encrypted" - static let encryptionScheme: JSString = "encryptionScheme" - static let enctype: JSString = "enctype" - static let end: JSString = "end" - static let endContainer: JSString = "endContainer" - static let endDelay: JSString = "endDelay" - static let endElement: JSString = "endElement" - static let endElementAt: JSString = "endElementAt" - static let endOcclusionQuery: JSString = "endOcclusionQuery" - static let endOfStream: JSString = "endOfStream" - static let endOffset: JSString = "endOffset" - static let endQuery: JSString = "endQuery" - static let endQueryEXT: JSString = "endQueryEXT" - static let endTime: JSString = "endTime" - static let endTransformFeedback: JSString = "endTransformFeedback" - static let ended: JSString = "ended" - static let endings: JSString = "endings" - static let endpoint: JSString = "endpoint" - static let endpointNumber: JSString = "endpointNumber" - static let endpoints: JSString = "endpoints" - static let enqueue: JSString = "enqueue" - static let enterKeyHint: JSString = "enterKeyHint" - static let entityTypes: JSString = "entityTypes" - static let entries: JSString = "entries" - static let entryPoint: JSString = "entryPoint" - static let entryType: JSString = "entryType" - static let entryTypes: JSString = "entryTypes" - static let enumerateDevices: JSString = "enumerateDevices" - static let environmentBlendMode: JSString = "environmentBlendMode" - static let epsilon: JSString = "epsilon" - static let equals: JSString = "equals" - static let error: JSString = "error" - static let errorCode: JSString = "errorCode" - static let errorDetail: JSString = "errorDetail" - static let errorText: JSString = "errorText" - static let errorType: JSString = "errorType" - static let escape: JSString = "escape" - static let estimate: JSString = "estimate" - static let estimatedPlayoutTimestamp: JSString = "estimatedPlayoutTimestamp" - static let evaluate: JSString = "evaluate" - static let event: JSString = "event" - static let eventCounts: JSString = "eventCounts" - static let eventPhase: JSString = "eventPhase" - static let ex: JSString = "ex" - static let exact: JSString = "exact" - static let excludeAcceptAllOption: JSString = "excludeAcceptAllOption" - static let excludeCredentials: JSString = "excludeCredentials" - static let exclusive: JSString = "exclusive" - static let exec: JSString = "exec" - static let execCommand: JSString = "execCommand" - static let executeBundles: JSString = "executeBundles" - static let exitFullscreen: JSString = "exitFullscreen" - static let exitPictureInPicture: JSString = "exitPictureInPicture" - static let exitPointerLock: JSString = "exitPointerLock" - static let exp: JSString = "exp" - static let expectedDisplayTime: JSString = "expectedDisplayTime" - static let expectedImprovement: JSString = "expectedImprovement" - static let expiration: JSString = "expiration" - static let expirationTime: JSString = "expirationTime" - static let expired: JSString = "expired" - static let expires: JSString = "expires" - static let exponent: JSString = "exponent" - static let exponentialRampToValueAtTime: JSString = "exponentialRampToValueAtTime" - static let exportKey: JSString = "exportKey" - static let exports: JSString = "exports" - static let exposureCompensation: JSString = "exposureCompensation" - static let exposureMode: JSString = "exposureMode" - static let exposureTime: JSString = "exposureTime" - static let ext: JSString = "ext" - static let extend: JSString = "extend" - static let extends: JSString = "extends" - static let extensions: JSString = "extensions" - static let external: JSString = "external" - static let externalTexture: JSString = "externalTexture" - static let extractContents: JSString = "extractContents" - static let extractable: JSString = "extractable" - static let eye: JSString = "eye" - static let f: JSString = "f" - static let face: JSString = "face" - static let facingMode: JSString = "facingMode" - static let factors: JSString = "factors" - static let failIfMajorPerformanceCaveat: JSString = "failIfMajorPerformanceCaveat" - static let failOp: JSString = "failOp" - static let failureReason: JSString = "failureReason" - static let fallback: JSString = "fallback" - static let family: JSString = "family" - static let fastMode: JSString = "fastMode" - static let fastSeek: JSString = "fastSeek" - static let fatal: JSString = "fatal" - static let featureId: JSString = "featureId" - static let featureReports: JSString = "featureReports" - static let featureSettings: JSString = "featureSettings" - static let features: JSString = "features" - static let fecPacketsDiscarded: JSString = "fecPacketsDiscarded" - static let fecPacketsReceived: JSString = "fecPacketsReceived" - static let fecPacketsSent: JSString = "fecPacketsSent" - static let federated: JSString = "federated" - static let feedback: JSString = "feedback" - static let feedforward: JSString = "feedforward" - static let fenceSync: JSString = "fenceSync" - static let fetch: JSString = "fetch" - static let fetchStart: JSString = "fetchStart" - static let fetchpriority: JSString = "fetchpriority" - static let fftSize: JSString = "fftSize" - static let fgColor: JSString = "fgColor" - static let filename: JSString = "filename" - static let files: JSString = "files" - static let filesystem: JSString = "filesystem" - static let fill: JSString = "fill" - static let fillJointRadii: JSString = "fillJointRadii" - static let fillLightMode: JSString = "fillLightMode" - static let fillPoses: JSString = "fillPoses" - static let fillRect: JSString = "fillRect" - static let fillStyle: JSString = "fillStyle" - static let fillText: JSString = "fillText" - static let filter: JSString = "filter" - static let filterLayout: JSString = "filterLayout" - static let filterUnits: JSString = "filterUnits" - static let filters: JSString = "filters" - static let findRule: JSString = "findRule" - static let fingerprint: JSString = "fingerprint" - static let fingerprintAlgorithm: JSString = "fingerprintAlgorithm" - static let finish: JSString = "finish" - static let finished: JSString = "finished" - static let firCount: JSString = "firCount" - static let firesTouchEvents: JSString = "firesTouchEvents" - static let firstChild: JSString = "firstChild" - static let firstElementChild: JSString = "firstElementChild" - static let firstEmptyRegionIndex: JSString = "firstEmptyRegionIndex" - static let firstRequestTimestamp: JSString = "firstRequestTimestamp" - static let fixedBlockSize: JSString = "fixedBlockSize" - static let fixedFoveation: JSString = "fixedFoveation" - static let fixedInlineSize: JSString = "fixedInlineSize" - static let flatten: JSString = "flatten" - static let flex: JSString = "flex" - static let flipX: JSString = "flipX" - static let flipY: JSString = "flipY" - static let floor: JSString = "floor" - static let flowControl: JSString = "flowControl" - static let flush: JSString = "flush" - static let focus: JSString = "focus" - static let focusDistance: JSString = "focusDistance" - static let focusMode: JSString = "focusMode" - static let focusNode: JSString = "focusNode" - static let focusOffset: JSString = "focusOffset" - static let focusableAreas: JSString = "focusableAreas" - static let focused: JSString = "focused" - static let font: JSString = "font" - static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" - static let fontBoundingBoxDescent: JSString = "fontBoundingBoxDescent" - static let fontFamily: JSString = "fontFamily" - static let fontKerning: JSString = "fontKerning" - static let fontStretch: JSString = "fontStretch" - static let fontVariantCaps: JSString = "fontVariantCaps" - static let fontfaces: JSString = "fontfaces" - static let fonts: JSString = "fonts" - static let force: JSString = "force" - static let forceFallbackAdapter: JSString = "forceFallbackAdapter" - static let forceRedraw: JSString = "forceRedraw" - static let forget: JSString = "forget" - static let form: JSString = "form" - static let formAction: JSString = "formAction" - static let formData: JSString = "formData" - static let formEnctype: JSString = "formEnctype" - static let formMethod: JSString = "formMethod" - static let formNoValidate: JSString = "formNoValidate" - static let formTarget: JSString = "formTarget" - static let format: JSString = "format" - static let formats: JSString = "formats" - static let forms: JSString = "forms" - static let forward: JSString = "forward" - static let forwardX: JSString = "forwardX" - static let forwardY: JSString = "forwardY" - static let forwardZ: JSString = "forwardZ" - static let foundation: JSString = "foundation" - static let fr: JSString = "fr" - static let fractionLost: JSString = "fractionLost" - static let fragment: JSString = "fragment" - static let fragmentDirective: JSString = "fragmentDirective" - static let frame: JSString = "frame" - static let frameBitDepth: JSString = "frameBitDepth" - static let frameBorder: JSString = "frameBorder" - static let frameCount: JSString = "frameCount" - static let frameElement: JSString = "frameElement" - static let frameHeight: JSString = "frameHeight" - static let frameId: JSString = "frameId" - static let frameIndex: JSString = "frameIndex" - static let frameOffset: JSString = "frameOffset" - static let frameRate: JSString = "frameRate" - static let frameType: JSString = "frameType" - static let frameWidth: JSString = "frameWidth" - static let framebuffer: JSString = "framebuffer" - static let framebufferHeight: JSString = "framebufferHeight" - static let framebufferRenderbuffer: JSString = "framebufferRenderbuffer" - static let framebufferScaleFactor: JSString = "framebufferScaleFactor" - static let framebufferTexture2D: JSString = "framebufferTexture2D" - static let framebufferTextureLayer: JSString = "framebufferTextureLayer" - static let framebufferTextureMultiviewOVR: JSString = "framebufferTextureMultiviewOVR" - static let framebufferWidth: JSString = "framebufferWidth" - static let framerate: JSString = "framerate" - static let frames: JSString = "frames" - static let framesDecoded: JSString = "framesDecoded" - static let framesDiscardedOnSend: JSString = "framesDiscardedOnSend" - static let framesDropped: JSString = "framesDropped" - static let framesEncoded: JSString = "framesEncoded" - static let framesPerSecond: JSString = "framesPerSecond" - static let framesReceived: JSString = "framesReceived" - static let framesSent: JSString = "framesSent" - static let freeTrialPeriod: JSString = "freeTrialPeriod" - static let frequency: JSString = "frequency" - static let frequencyBinCount: JSString = "frequencyBinCount" - static let from: JSString = "from" - static let fromBox: JSString = "fromBox" - static let fromFloat32Array: JSString = "fromFloat32Array" - static let fromFloat64Array: JSString = "fromFloat64Array" - static let fromLiteral: JSString = "fromLiteral" - static let fromMatrix: JSString = "fromMatrix" - static let fromPoint: JSString = "fromPoint" - static let fromQuad: JSString = "fromQuad" - static let fromRect: JSString = "fromRect" - static let frontFace: JSString = "frontFace" - static let fullFramesLost: JSString = "fullFramesLost" - static let fullName: JSString = "fullName" - static let fullPath: JSString = "fullPath" - static let fullRange: JSString = "fullRange" - static let fullVersionList: JSString = "fullVersionList" - static let fullscreen: JSString = "fullscreen" - static let fullscreenElement: JSString = "fullscreenElement" - static let fullscreenEnabled: JSString = "fullscreenEnabled" - static let fx: JSString = "fx" - static let fy: JSString = "fy" - static let g: JSString = "g" - static let gain: JSString = "gain" - static let gamepad: JSString = "gamepad" - static let gamma: JSString = "gamma" - static let gapDiscardRate: JSString = "gapDiscardRate" - static let gapLossRate: JSString = "gapLossRate" - static let gather: JSString = "gather" - static let gatherPolicy: JSString = "gatherPolicy" - static let gatheringState: JSString = "gatheringState" - static let gatt: JSString = "gatt" - static let gc: JSString = "gc" - static let gemm: JSString = "gemm" - static let generateAssertion: JSString = "generateAssertion" - static let generateCertificate: JSString = "generateCertificate" - static let generateKey: JSString = "generateKey" - static let generateKeyFrame: JSString = "generateKeyFrame" - static let generateMipmap: JSString = "generateMipmap" - static let generateRequest: JSString = "generateRequest" - static let geolocation: JSString = "geolocation" - static let get: JSString = "get" - static let getActiveAttrib: JSString = "getActiveAttrib" - static let getActiveUniform: JSString = "getActiveUniform" - static let getActiveUniformBlockName: JSString = "getActiveUniformBlockName" - static let getActiveUniformBlockParameter: JSString = "getActiveUniformBlockParameter" - static let getActiveUniforms: JSString = "getActiveUniforms" - static let getAll: JSString = "getAll" - static let getAllKeys: JSString = "getAllKeys" - static let getAllResponseHeaders: JSString = "getAllResponseHeaders" - static let getAllowlistForFeature: JSString = "getAllowlistForFeature" - static let getAnimations: JSString = "getAnimations" - static let getAsFile: JSString = "getAsFile" - static let getAsFileSystemHandle: JSString = "getAsFileSystemHandle" - static let getAttachedShaders: JSString = "getAttachedShaders" - static let getAttribLocation: JSString = "getAttribLocation" - static let getAttribute: JSString = "getAttribute" - static let getAttributeNS: JSString = "getAttributeNS" - static let getAttributeNames: JSString = "getAttributeNames" - static let getAttributeNode: JSString = "getAttributeNode" - static let getAttributeNodeNS: JSString = "getAttributeNodeNS" - static let getAttributeType: JSString = "getAttributeType" - static let getAudioTracks: JSString = "getAudioTracks" - static let getAuthenticatorData: JSString = "getAuthenticatorData" - static let getAutoplayPolicy: JSString = "getAutoplayPolicy" - static let getAvailability: JSString = "getAvailability" - static let getBBox: JSString = "getBBox" - static let getBattery: JSString = "getBattery" - static let getBindGroupLayout: JSString = "getBindGroupLayout" - static let getBoundingClientRect: JSString = "getBoundingClientRect" - static let getBounds: JSString = "getBounds" - static let getBoxQuads: JSString = "getBoxQuads" - static let getBufferParameter: JSString = "getBufferParameter" - static let getBufferSubData: JSString = "getBufferSubData" - static let getByteFrequencyData: JSString = "getByteFrequencyData" - static let getByteTimeDomainData: JSString = "getByteTimeDomainData" - static let getCTM: JSString = "getCTM" - static let getCapabilities: JSString = "getCapabilities" - static let getChannelData: JSString = "getChannelData" - static let getCharNumAtPosition: JSString = "getCharNumAtPosition" - static let getCharacteristic: JSString = "getCharacteristic" - static let getCharacteristics: JSString = "getCharacteristics" - static let getChildren: JSString = "getChildren" - static let getClientExtensionResults: JSString = "getClientExtensionResults" - static let getClientRect: JSString = "getClientRect" - static let getClientRects: JSString = "getClientRects" - static let getCoalescedEvents: JSString = "getCoalescedEvents" - static let getComputedStyle: JSString = "getComputedStyle" - static let getComputedTextLength: JSString = "getComputedTextLength" - static let getComputedTiming: JSString = "getComputedTiming" - static let getConfiguration: JSString = "getConfiguration" - static let getConstraints: JSString = "getConstraints" - static let getContent: JSString = "getContent" - static let getContext: JSString = "getContext" - static let getContextAttributes: JSString = "getContextAttributes" - static let getContributingSources: JSString = "getContributingSources" - static let getCueAsHTML: JSString = "getCueAsHTML" - static let getCueById: JSString = "getCueById" - static let getCurrentTexture: JSString = "getCurrentTexture" - static let getCurrentTime: JSString = "getCurrentTime" - static let getData: JSString = "getData" - static let getDefaultConfiguration: JSString = "getDefaultConfiguration" - static let getDepthInMeters: JSString = "getDepthInMeters" - static let getDepthInformation: JSString = "getDepthInformation" - static let getDescriptor: JSString = "getDescriptor" - static let getDescriptors: JSString = "getDescriptors" - static let getDetails: JSString = "getDetails" - static let getDevices: JSString = "getDevices" - static let getDigitalGoodsService: JSString = "getDigitalGoodsService" - static let getDirectory: JSString = "getDirectory" - static let getDirectoryHandle: JSString = "getDirectoryHandle" - static let getDisplayMedia: JSString = "getDisplayMedia" - static let getElementById: JSString = "getElementById" - static let getElementsByClassName: JSString = "getElementsByClassName" - static let getElementsByName: JSString = "getElementsByName" - static let getElementsByTagName: JSString = "getElementsByTagName" - static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" - static let getEnclosureList: JSString = "getEnclosureList" - static let getEndPositionOfChar: JSString = "getEndPositionOfChar" - static let getEntries: JSString = "getEntries" - static let getEntriesByName: JSString = "getEntriesByName" - static let getEntriesByType: JSString = "getEntriesByType" - static let getError: JSString = "getError" - static let getExtension: JSString = "getExtension" - static let getExtentOfChar: JSString = "getExtentOfChar" - static let getFile: JSString = "getFile" - static let getFileHandle: JSString = "getFileHandle" - static let getFingerprints: JSString = "getFingerprints" - static let getFloatFrequencyData: JSString = "getFloatFrequencyData" - static let getFloatTimeDomainData: JSString = "getFloatTimeDomainData" - static let getFragDataLocation: JSString = "getFragDataLocation" - static let getFramebufferAttachmentParameter: JSString = "getFramebufferAttachmentParameter" - static let getFrequencyResponse: JSString = "getFrequencyResponse" - static let getGamepads: JSString = "getGamepads" - static let getHighEntropyValues: JSString = "getHighEntropyValues" - static let getHitTestResults: JSString = "getHitTestResults" - static let getHitTestResultsForTransientInput: JSString = "getHitTestResultsForTransientInput" - static let getIdentityAssertion: JSString = "getIdentityAssertion" - static let getIds: JSString = "getIds" - static let getImageData: JSString = "getImageData" - static let getIncludedService: JSString = "getIncludedService" - static let getIncludedServices: JSString = "getIncludedServices" - static let getIndexedParameter: JSString = "getIndexedParameter" - static let getInfo: JSString = "getInfo" - static let getInstalledRelatedApps: JSString = "getInstalledRelatedApps" - static let getInternalformatParameter: JSString = "getInternalformatParameter" - static let getIntersectionList: JSString = "getIntersectionList" - static let getJointPose: JSString = "getJointPose" - static let getKey: JSString = "getKey" - static let getKeyframes: JSString = "getKeyframes" - static let getLayoutMap: JSString = "getLayoutMap" - static let getLightEstimate: JSString = "getLightEstimate" - static let getLineDash: JSString = "getLineDash" - static let getLocalCandidates: JSString = "getLocalCandidates" - static let getLocalParameters: JSString = "getLocalParameters" - static let getMappedRange: JSString = "getMappedRange" - static let getMetadata: JSString = "getMetadata" - static let getModifierState: JSString = "getModifierState" - static let getNamedItemNS: JSString = "getNamedItemNS" - static let getNativeFramebufferScaleFactor: JSString = "getNativeFramebufferScaleFactor" - static let getNotifications: JSString = "getNotifications" - static let getNumberOfChars: JSString = "getNumberOfChars" - static let getOffsetReferenceSpace: JSString = "getOffsetReferenceSpace" - static let getOutputTimestamp: JSString = "getOutputTimestamp" - static let getParameter: JSString = "getParameter" - static let getParameters: JSString = "getParameters" - static let getPhotoCapabilities: JSString = "getPhotoCapabilities" - static let getPhotoSettings: JSString = "getPhotoSettings" - static let getPointAtLength: JSString = "getPointAtLength" - static let getPorts: JSString = "getPorts" - static let getPose: JSString = "getPose" - static let getPredictedEvents: JSString = "getPredictedEvents" - static let getPreferredFormat: JSString = "getPreferredFormat" - static let getPrimaryService: JSString = "getPrimaryService" - static let getPrimaryServices: JSString = "getPrimaryServices" - static let getProgramInfoLog: JSString = "getProgramInfoLog" - static let getProgramParameter: JSString = "getProgramParameter" - static let getProperties: JSString = "getProperties" - static let getPropertyPriority: JSString = "getPropertyPriority" - static let getPropertyType: JSString = "getPropertyType" - static let getPropertyValue: JSString = "getPropertyValue" - static let getPublicKey: JSString = "getPublicKey" - static let getPublicKeyAlgorithm: JSString = "getPublicKeyAlgorithm" - static let getQuery: JSString = "getQuery" - static let getQueryEXT: JSString = "getQueryEXT" - static let getQueryObjectEXT: JSString = "getQueryObjectEXT" - static let getQueryParameter: JSString = "getQueryParameter" - static let getRandomValues: JSString = "getRandomValues" - static let getRangeAt: JSString = "getRangeAt" - static let getReader: JSString = "getReader" - static let getReceivers: JSString = "getReceivers" - static let getReflectionCubeMap: JSString = "getReflectionCubeMap" - static let getRegionFlowRanges: JSString = "getRegionFlowRanges" - static let getRegions: JSString = "getRegions" - static let getRegionsByContent: JSString = "getRegionsByContent" - static let getRegistration: JSString = "getRegistration" - static let getRegistrations: JSString = "getRegistrations" - static let getRemoteCandidates: JSString = "getRemoteCandidates" - static let getRemoteCertificates: JSString = "getRemoteCertificates" - static let getRemoteParameters: JSString = "getRemoteParameters" - static let getRenderbufferParameter: JSString = "getRenderbufferParameter" - static let getResponseHeader: JSString = "getResponseHeader" - static let getRootNode: JSString = "getRootNode" - static let getRotationOfChar: JSString = "getRotationOfChar" - static let getSVGDocument: JSString = "getSVGDocument" - static let getSamplerParameter: JSString = "getSamplerParameter" - static let getScreenCTM: JSString = "getScreenCTM" - static let getSelectedCandidatePair: JSString = "getSelectedCandidatePair" - static let getSelection: JSString = "getSelection" - static let getSenders: JSString = "getSenders" - static let getService: JSString = "getService" - static let getSettings: JSString = "getSettings" - static let getShaderInfoLog: JSString = "getShaderInfoLog" - static let getShaderParameter: JSString = "getShaderParameter" - static let getShaderPrecisionFormat: JSString = "getShaderPrecisionFormat" - static let getShaderSource: JSString = "getShaderSource" - static let getSignals: JSString = "getSignals" - static let getSimpleDuration: JSString = "getSimpleDuration" - static let getSpatialNavigationContainer: JSString = "getSpatialNavigationContainer" - static let getStartDate: JSString = "getStartDate" - static let getStartPositionOfChar: JSString = "getStartPositionOfChar" - static let getStartTime: JSString = "getStartTime" - static let getState: JSString = "getState" - static let getStats: JSString = "getStats" - static let getSubImage: JSString = "getSubImage" - static let getSubStringLength: JSString = "getSubStringLength" - static let getSubscription: JSString = "getSubscription" - static let getSubscriptions: JSString = "getSubscriptions" - static let getSupportedConstraints: JSString = "getSupportedConstraints" - static let getSupportedExtensions: JSString = "getSupportedExtensions" - static let getSupportedFormats: JSString = "getSupportedFormats" - static let getSupportedProfiles: JSString = "getSupportedProfiles" - static let getSyncParameter: JSString = "getSyncParameter" - static let getSynchronizationSources: JSString = "getSynchronizationSources" - static let getTags: JSString = "getTags" - static let getTargetRanges: JSString = "getTargetRanges" - static let getTexParameter: JSString = "getTexParameter" - static let getTextFormats: JSString = "getTextFormats" - static let getTiming: JSString = "getTiming" - static let getTitlebarAreaRect: JSString = "getTitlebarAreaRect" - static let getTotalLength: JSString = "getTotalLength" - static let getTrackById: JSString = "getTrackById" - static let getTracks: JSString = "getTracks" - static let getTransceivers: JSString = "getTransceivers" - static let getTransform: JSString = "getTransform" - static let getTransformFeedbackVarying: JSString = "getTransformFeedbackVarying" - static let getTranslatedShaderSource: JSString = "getTranslatedShaderSource" - static let getTransports: JSString = "getTransports" - static let getType: JSString = "getType" - static let getUniform: JSString = "getUniform" - static let getUniformBlockIndex: JSString = "getUniformBlockIndex" - static let getUniformIndices: JSString = "getUniformIndices" - static let getUniformLocation: JSString = "getUniformLocation" - static let getUserMedia: JSString = "getUserMedia" - static let getVertexAttrib: JSString = "getVertexAttrib" - static let getVertexAttribOffset: JSString = "getVertexAttribOffset" - static let getVideoPlaybackQuality: JSString = "getVideoPlaybackQuality" - static let getVideoTracks: JSString = "getVideoTracks" - static let getViewSubImage: JSString = "getViewSubImage" - static let getViewerPose: JSString = "getViewerPose" - static let getViewport: JSString = "getViewport" - static let getVoices: JSString = "getVoices" - static let getWriter: JSString = "getWriter" - static let globalAlpha: JSString = "globalAlpha" - static let globalCompositeOperation: JSString = "globalCompositeOperation" - static let glyphsRendered: JSString = "glyphsRendered" - static let go: JSString = "go" - static let gpu: JSString = "gpu" - static let grabFrame: JSString = "grabFrame" - static let grad: JSString = "grad" - static let gradientTransform: JSString = "gradientTransform" - static let gradientUnits: JSString = "gradientUnits" - static let grammars: JSString = "grammars" - static let granted: JSString = "granted" - static let gripSpace: JSString = "gripSpace" - static let group: JSString = "group" - static let groupCollapsed: JSString = "groupCollapsed" - static let groupEnd: JSString = "groupEnd" - static let groupId: JSString = "groupId" - static let groups: JSString = "groups" - static let grow: JSString = "grow" - static let gru: JSString = "gru" - static let gruCell: JSString = "gruCell" - static let h: JSString = "h" - static let hadRecentInput: JSString = "hadRecentInput" - static let hand: JSString = "hand" - static let handedness: JSString = "handedness" - static let handle: JSString = "handle" - static let handled: JSString = "handled" - static let hangingBaseline: JSString = "hangingBaseline" - static let hapticActuators: JSString = "hapticActuators" - static let hardSigmoid: JSString = "hardSigmoid" - static let hardSwish: JSString = "hardSwish" - static let hardwareAcceleration: JSString = "hardwareAcceleration" - static let hardwareConcurrency: JSString = "hardwareConcurrency" - static let has: JSString = "has" - static let hasAlphaChannel: JSString = "hasAlphaChannel" - static let hasAttribute: JSString = "hasAttribute" - static let hasAttributeNS: JSString = "hasAttributeNS" - static let hasAttributes: JSString = "hasAttributes" - static let hasChildNodes: JSString = "hasChildNodes" - static let hasDynamicOffset: JSString = "hasDynamicOffset" - static let hasFeature: JSString = "hasFeature" - static let hasFocus: JSString = "hasFocus" - static let hasNull: JSString = "hasNull" - static let hasOrientation: JSString = "hasOrientation" - static let hasPointerCapture: JSString = "hasPointerCapture" - static let hasPosition: JSString = "hasPosition" - static let hasPreferredState: JSString = "hasPreferredState" - static let hasReading: JSString = "hasReading" - static let hasStorageAccess: JSString = "hasStorageAccess" - static let hash: JSString = "hash" - static let hashChange: JSString = "hashChange" - static let hdrMetadataType: JSString = "hdrMetadataType" - static let head: JSString = "head" - static let headerBytesReceived: JSString = "headerBytesReceived" - static let headerBytesSent: JSString = "headerBytesSent" - static let headerExtensions: JSString = "headerExtensions" - static let headerValue: JSString = "headerValue" - static let headers: JSString = "headers" - static let heading: JSString = "heading" - static let height: JSString = "height" - static let held: JSString = "held" - static let hid: JSString = "hid" - static let hidden: JSString = "hidden" - static let hide: JSString = "hide" - static let high: JSString = "high" - static let highWaterMark: JSString = "highWaterMark" - static let highlights: JSString = "highlights" - static let hint: JSString = "hint" - static let hints: JSString = "hints" - static let history: JSString = "history" - static let host: JSString = "host" - static let hostname: JSString = "hostname" - static let href: JSString = "href" - static let hreflang: JSString = "hreflang" - static let hspace: JSString = "hspace" - static let htmlFor: JSString = "htmlFor" - static let httpEquiv: JSString = "httpEquiv" - static let httpRequestStatusCode: JSString = "httpRequestStatusCode" - static let hugeFramesSent: JSString = "hugeFramesSent" - static let ic: JSString = "ic" - static let iceCandidatePoolSize: JSString = "iceCandidatePoolSize" - static let iceConnectionState: JSString = "iceConnectionState" - static let iceGatheringState: JSString = "iceGatheringState" - static let iceLite: JSString = "iceLite" - static let iceLocalUsernameFragment: JSString = "iceLocalUsernameFragment" - static let iceRestart: JSString = "iceRestart" - static let iceRole: JSString = "iceRole" - static let iceServers: JSString = "iceServers" - static let iceState: JSString = "iceState" - static let iceTransport: JSString = "iceTransport" - static let iceTransportPolicy: JSString = "iceTransportPolicy" - static let icon: JSString = "icon" - static let iconMustBeShown: JSString = "iconMustBeShown" - static let iconURL: JSString = "iconURL" - static let iconURLs: JSString = "iconURLs" - static let icons: JSString = "icons" - static let id: JSString = "id" - static let ideal: JSString = "ideal" - static let identifier: JSString = "identifier" - static let identity: JSString = "identity" - static let ideographicBaseline: JSString = "ideographicBaseline" - static let idp: JSString = "idp" - static let idpErrorInfo: JSString = "idpErrorInfo" - static let idpLoginUrl: JSString = "idpLoginUrl" - static let ifAvailable: JSString = "ifAvailable" - static let ignoreBOM: JSString = "ignoreBOM" - static let ignoreDepthValues: JSString = "ignoreDepthValues" - static let ignoreMethod: JSString = "ignoreMethod" - static let ignoreSearch: JSString = "ignoreSearch" - static let ignoreVary: JSString = "ignoreVary" - static let illuminance: JSString = "illuminance" - static let imag: JSString = "imag" - static let image: JSString = "image" - static let imageHeight: JSString = "imageHeight" - static let imageIndex: JSString = "imageIndex" - static let imageOrientation: JSString = "imageOrientation" - static let imageSizes: JSString = "imageSizes" - static let imageSmoothingEnabled: JSString = "imageSmoothingEnabled" - static let imageSmoothingQuality: JSString = "imageSmoothingQuality" - static let imageSrcset: JSString = "imageSrcset" - static let imageWidth: JSString = "imageWidth" - static let images: JSString = "images" - static let implementation: JSString = "implementation" - static let importExternalTexture: JSString = "importExternalTexture" - static let importKey: JSString = "importKey" - static let importNode: JSString = "importNode" - static let importScripts: JSString = "importScripts" - static let importStylesheet: JSString = "importStylesheet" - static let imports: JSString = "imports" - static let `in`: JSString = "in" - static let in1: JSString = "in1" - static let in2: JSString = "in2" - static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" - static let inboundRtpStreamId: JSString = "inboundRtpStreamId" - static let includeContinuous: JSString = "includeContinuous" - static let includeUncontrolled: JSString = "includeUncontrolled" - static let includes: JSString = "includes" - static let incomingBidirectionalStreams: JSString = "incomingBidirectionalStreams" - static let incomingHighWaterMark: JSString = "incomingHighWaterMark" - static let incomingMaxAge: JSString = "incomingMaxAge" - static let incomingUnidirectionalStreams: JSString = "incomingUnidirectionalStreams" - static let indeterminate: JSString = "indeterminate" - static let index: JSString = "index" - static let indexNames: JSString = "indexNames" - static let indexedDB: JSString = "indexedDB" - static let indicate: JSString = "indicate" - static let inert: JSString = "inert" - static let info: JSString = "info" - static let inherits: JSString = "inherits" - static let initCompositionEvent: JSString = "initCompositionEvent" - static let initCustomEvent: JSString = "initCustomEvent" - static let initData: JSString = "initData" - static let initDataType: JSString = "initDataType" - static let initDataTypes: JSString = "initDataTypes" - static let initEvent: JSString = "initEvent" - static let initKeyboardEvent: JSString = "initKeyboardEvent" - static let initMessageEvent: JSString = "initMessageEvent" - static let initMouseEvent: JSString = "initMouseEvent" - static let initMutationEvent: JSString = "initMutationEvent" - static let initStorageEvent: JSString = "initStorageEvent" - static let initTimeEvent: JSString = "initTimeEvent" - static let initUIEvent: JSString = "initUIEvent" - static let initial: JSString = "initial" - static let initialHiddenState: JSString = "initialHiddenState" - static let initialValue: JSString = "initialValue" - static let initialize: JSString = "initialize" - static let initiatorType: JSString = "initiatorType" - static let ink: JSString = "ink" - static let inline: JSString = "inline" - static let inlineEnd: JSString = "inlineEnd" - static let inlineOffset: JSString = "inlineOffset" - static let inlineSize: JSString = "inlineSize" - static let inlineStart: JSString = "inlineStart" - static let inlineVerticalFieldOfView: JSString = "inlineVerticalFieldOfView" - static let innerHTML: JSString = "innerHTML" - static let innerHeight: JSString = "innerHeight" - static let innerText: JSString = "innerText" - static let innerWidth: JSString = "innerWidth" - static let input: JSString = "input" - static let inputBuffer: JSString = "inputBuffer" - static let inputEncoding: JSString = "inputEncoding" - static let inputLayout: JSString = "inputLayout" - static let inputMode: JSString = "inputMode" - static let inputReports: JSString = "inputReports" - static let inputSource: JSString = "inputSource" - static let inputSources: JSString = "inputSources" - static let inputType: JSString = "inputType" - static let inputs: JSString = "inputs" - static let insertAdjacentElement: JSString = "insertAdjacentElement" - static let insertAdjacentHTML: JSString = "insertAdjacentHTML" - static let insertAdjacentText: JSString = "insertAdjacentText" - static let insertBefore: JSString = "insertBefore" - static let insertCell: JSString = "insertCell" - static let insertDTMF: JSString = "insertDTMF" - static let insertData: JSString = "insertData" - static let insertDebugMarker: JSString = "insertDebugMarker" - static let insertItemBefore: JSString = "insertItemBefore" - static let insertNode: JSString = "insertNode" - static let insertRow: JSString = "insertRow" - static let insertRule: JSString = "insertRule" - static let insertedSamplesForDeceleration: JSString = "insertedSamplesForDeceleration" - static let installing: JSString = "installing" - static let instance: JSString = "instance" - static let instanceNormalization: JSString = "instanceNormalization" - static let instanceRoot: JSString = "instanceRoot" - static let instantiate: JSString = "instantiate" - static let instantiateStreaming: JSString = "instantiateStreaming" - static let instrument: JSString = "instrument" - static let instruments: JSString = "instruments" - static let integrity: JSString = "integrity" - static let interactionCounts: JSString = "interactionCounts" - static let interactionId: JSString = "interactionId" - static let interactionMode: JSString = "interactionMode" - static let intercept: JSString = "intercept" - static let interfaceClass: JSString = "interfaceClass" - static let interfaceName: JSString = "interfaceName" - static let interfaceNumber: JSString = "interfaceNumber" - static let interfaceProtocol: JSString = "interfaceProtocol" - static let interfaceSubclass: JSString = "interfaceSubclass" - static let interfaces: JSString = "interfaces" - static let interimResults: JSString = "interimResults" - static let intersectionRatio: JSString = "intersectionRatio" - static let intersectionRect: JSString = "intersectionRect" - static let intersectsNode: JSString = "intersectsNode" - static let interval: JSString = "interval" - static let intrinsicSizes: JSString = "intrinsicSizes" - static let introductoryPrice: JSString = "introductoryPrice" - static let introductoryPriceCycles: JSString = "introductoryPriceCycles" - static let introductoryPricePeriod: JSString = "introductoryPricePeriod" - static let invalidIteratorState: JSString = "invalidIteratorState" - static let invalidateFramebuffer: JSString = "invalidateFramebuffer" - static let invalidateSubFramebuffer: JSString = "invalidateSubFramebuffer" - static let inverse: JSString = "inverse" - static let invertSelf: JSString = "invertSelf" - static let invertStereo: JSString = "invertStereo" - static let `is`: JSString = "is" - static let is2D: JSString = "is2D" - static let isAbsolute: JSString = "isAbsolute" - static let isArray: JSString = "isArray" - static let isBuffer: JSString = "isBuffer" - static let isBufferedBytes: JSString = "isBufferedBytes" - static let isCollapsed: JSString = "isCollapsed" - static let isComposing: JSString = "isComposing" - static let isConditionalMediationAvailable: JSString = "isConditionalMediationAvailable" - static let isConfigSupported: JSString = "isConfigSupported" - static let isConnected: JSString = "isConnected" - static let isConstant: JSString = "isConstant" - static let isContentEditable: JSString = "isContentEditable" - static let isContextLost: JSString = "isContextLost" - static let isDefaultNamespace: JSString = "isDefaultNamespace" - static let isDirectory: JSString = "isDirectory" - static let isEnabled: JSString = "isEnabled" - static let isEqualNode: JSString = "isEqualNode" - static let isFallbackAdapter: JSString = "isFallbackAdapter" - static let isFile: JSString = "isFile" - static let isFinal: JSString = "isFinal" - static let isFirstPersonObserver: JSString = "isFirstPersonObserver" - static let isFramebuffer: JSString = "isFramebuffer" - static let isHTML: JSString = "isHTML" - static let isHistoryNavigation: JSString = "isHistoryNavigation" - static let isIdentity: JSString = "isIdentity" - static let isInComposition: JSString = "isInComposition" - static let isInputPending: JSString = "isInputPending" - static let isIntersecting: JSString = "isIntersecting" - static let isLinear: JSString = "isLinear" - static let isMap: JSString = "isMap" - static let isPayment: JSString = "isPayment" - static let isPointInFill: JSString = "isPointInFill" - static let isPointInPath: JSString = "isPointInPath" - static let isPointInRange: JSString = "isPointInRange" - static let isPointInStroke: JSString = "isPointInStroke" - static let isPrimary: JSString = "isPrimary" - static let isProgram: JSString = "isProgram" - static let isQuery: JSString = "isQuery" - static let isQueryEXT: JSString = "isQueryEXT" - static let isRange: JSString = "isRange" - static let isReloadNavigation: JSString = "isReloadNavigation" - static let isRenderbuffer: JSString = "isRenderbuffer" - static let isSameEntry: JSString = "isSameEntry" - static let isSameNode: JSString = "isSameNode" - static let isSampler: JSString = "isSampler" - static let isScript: JSString = "isScript" - static let isScriptURL: JSString = "isScriptURL" - static let isSecureContext: JSString = "isSecureContext" - static let isSessionSupported: JSString = "isSessionSupported" - static let isShader: JSString = "isShader" - static let isStatic: JSString = "isStatic" - static let isSync: JSString = "isSync" - static let isTexture: JSString = "isTexture" - static let isTransformFeedback: JSString = "isTransformFeedback" - static let isTrusted: JSString = "isTrusted" - static let isTypeSupported: JSString = "isTypeSupported" - static let isUserVerifyingPlatformAuthenticatorAvailable: JSString = "isUserVerifyingPlatformAuthenticatorAvailable" - static let isVertexArray: JSString = "isVertexArray" - static let isVertexArrayOES: JSString = "isVertexArrayOES" - static let isVisible: JSString = "isVisible" - static let isVolatile: JSString = "isVolatile" - static let iso: JSString = "iso" - static let isochronousTransferIn: JSString = "isochronousTransferIn" - static let isochronousTransferOut: JSString = "isochronousTransferOut" - static let isolated: JSString = "isolated" - static let issuerCertificateId: JSString = "issuerCertificateId" - static let item: JSString = "item" - static let itemId: JSString = "itemId" - static let items: JSString = "items" - static let iterateNext: JSString = "iterateNext" - static let iterationComposite: JSString = "iterationComposite" - static let iterationStart: JSString = "iterationStart" - static let iterations: JSString = "iterations" - static let iv: JSString = "iv" - static let javaEnabled: JSString = "javaEnabled" - static let jitter: JSString = "jitter" - static let jitterBufferDelay: JSString = "jitterBufferDelay" - static let jitterBufferEmittedCount: JSString = "jitterBufferEmittedCount" - static let jointName: JSString = "jointName" - static let json: JSString = "json" - static let k: JSString = "k" - static let k1: JSString = "k1" - static let k2: JSString = "k2" - static let k3: JSString = "k3" - static let k4: JSString = "k4" - static let kHz: JSString = "kHz" - static let keepDimensions: JSString = "keepDimensions" - static let keepExistingData: JSString = "keepExistingData" - static let keepalive: JSString = "keepalive" - static let kernelMatrix: JSString = "kernelMatrix" - static let kernelUnitLengthX: JSString = "kernelUnitLengthX" - static let kernelUnitLengthY: JSString = "kernelUnitLengthY" - static let key: JSString = "key" - static let keyCode: JSString = "keyCode" - static let keyFrame: JSString = "keyFrame" - static let keyFramesDecoded: JSString = "keyFramesDecoded" - static let keyFramesEncoded: JSString = "keyFramesEncoded" - static let keyID: JSString = "keyID" - static let keyPath: JSString = "keyPath" - static let keyStatuses: JSString = "keyStatuses" - static let keySystem: JSString = "keySystem" - static let keySystemAccess: JSString = "keySystemAccess" - static let keySystemConfiguration: JSString = "keySystemConfiguration" - static let keyText: JSString = "keyText" - static let key_ops: JSString = "key_ops" - static let keyboard: JSString = "keyboard" - static let keys: JSString = "keys" - static let kind: JSString = "kind" - static let knee: JSString = "knee" - static let kty: JSString = "kty" - static let l: JSString = "l" - static let l2Pool2d: JSString = "l2Pool2d" - static let label: JSString = "label" - static let labels: JSString = "labels" - static let landmarks: JSString = "landmarks" - static let lang: JSString = "lang" - static let language: JSString = "language" - static let languages: JSString = "languages" - static let largeBlob: JSString = "largeBlob" - static let lastChance: JSString = "lastChance" - static let lastChild: JSString = "lastChild" - static let lastElementChild: JSString = "lastElementChild" - static let lastEventId: JSString = "lastEventId" - static let lastInputTime: JSString = "lastInputTime" - static let lastModified: JSString = "lastModified" - static let lastPacketReceivedTimestamp: JSString = "lastPacketReceivedTimestamp" - static let lastPacketSentTimestamp: JSString = "lastPacketSentTimestamp" - static let lastRequestTimestamp: JSString = "lastRequestTimestamp" - static let lastResponseTimestamp: JSString = "lastResponseTimestamp" - static let latency: JSString = "latency" - static let latencyHint: JSString = "latencyHint" - static let latencyMode: JSString = "latencyMode" - static let latitude: JSString = "latitude" - static let layer: JSString = "layer" - static let layerName: JSString = "layerName" - static let layers: JSString = "layers" - static let layout: JSString = "layout" - static let layoutNextFragment: JSString = "layoutNextFragment" - static let layoutWorklet: JSString = "layoutWorklet" - static let leakyRelu: JSString = "leakyRelu" - static let left: JSString = "left" - static let length: JSString = "length" - static let lengthAdjust: JSString = "lengthAdjust" - static let lengthComputable: JSString = "lengthComputable" - static let letterSpacing: JSString = "letterSpacing" - static let level: JSString = "level" - static let lh: JSString = "lh" - static let lifecycleState: JSString = "lifecycleState" - static let limitingConeAngle: JSString = "limitingConeAngle" - static let limits: JSString = "limits" - static let line: JSString = "line" - static let lineAlign: JSString = "lineAlign" - static let lineCap: JSString = "lineCap" - static let lineDashOffset: JSString = "lineDashOffset" - static let lineGapOverride: JSString = "lineGapOverride" - static let lineJoin: JSString = "lineJoin" - static let lineNum: JSString = "lineNum" - static let lineNumber: JSString = "lineNumber" - static let linePos: JSString = "linePos" - static let lineTo: JSString = "lineTo" - static let lineWidth: JSString = "lineWidth" - static let linear: JSString = "linear" - static let linearAcceleration: JSString = "linearAcceleration" - static let linearRampToValueAtTime: JSString = "linearRampToValueAtTime" - static let linearVelocity: JSString = "linearVelocity" - static let lineno: JSString = "lineno" - static let lines: JSString = "lines" - static let link: JSString = "link" - static let linkColor: JSString = "linkColor" - static let linkProgram: JSString = "linkProgram" - static let links: JSString = "links" - static let list: JSString = "list" - static let listPurchaseHistory: JSString = "listPurchaseHistory" - static let listPurchases: JSString = "listPurchases" - static let listener: JSString = "listener" - static let load: JSString = "load" - static let loadEventEnd: JSString = "loadEventEnd" - static let loadEventStart: JSString = "loadEventStart" - static let loadOp: JSString = "loadOp" - static let loadTime: JSString = "loadTime" - static let loaded: JSString = "loaded" - static let loading: JSString = "loading" - static let local: JSString = "local" - static let localCandidateId: JSString = "localCandidateId" - static let localCertificateId: JSString = "localCertificateId" - static let localDescription: JSString = "localDescription" - static let localId: JSString = "localId" - static let localName: JSString = "localName" - static let localService: JSString = "localService" - static let localStorage: JSString = "localStorage" - static let localTime: JSString = "localTime" - static let location: JSString = "location" - static let locationbar: JSString = "locationbar" - static let locations: JSString = "locations" - static let lock: JSString = "lock" - static let locked: JSString = "locked" - static let locks: JSString = "locks" - static let lodMaxClamp: JSString = "lodMaxClamp" - static let lodMinClamp: JSString = "lodMinClamp" - static let log: JSString = "log" - static let logicalMaximum: JSString = "logicalMaximum" - static let logicalMinimum: JSString = "logicalMinimum" - static let logicalSurface: JSString = "logicalSurface" - static let longDesc: JSString = "longDesc" - static let longitude: JSString = "longitude" - static let lookupNamespaceURI: JSString = "lookupNamespaceURI" - static let lookupPrefix: JSString = "lookupPrefix" - static let loop: JSString = "loop" - static let loopEnd: JSString = "loopEnd" - static let loopStart: JSString = "loopStart" - static let loseContext: JSString = "loseContext" - static let lost: JSString = "lost" - static let low: JSString = "low" - static let lower: JSString = "lower" - static let lowerBound: JSString = "lowerBound" - static let lowerOpen: JSString = "lowerOpen" - static let lowerVerticalAngle: JSString = "lowerVerticalAngle" - static let lowsrc: JSString = "lowsrc" - static let lvb: JSString = "lvb" - static let lvh: JSString = "lvh" - static let lvi: JSString = "lvi" - static let lvmax: JSString = "lvmax" - static let lvmin: JSString = "lvmin" - static let lvw: JSString = "lvw" - static let m11: JSString = "m11" - static let m12: JSString = "m12" - static let m13: JSString = "m13" - static let m14: JSString = "m14" - static let m21: JSString = "m21" - static let m22: JSString = "m22" - static let m23: JSString = "m23" - static let m24: JSString = "m24" - static let m31: JSString = "m31" - static let m32: JSString = "m32" - static let m33: JSString = "m33" - static let m34: JSString = "m34" - static let m41: JSString = "m41" - static let m42: JSString = "m42" - static let m43: JSString = "m43" - static let m44: JSString = "m44" - static let magFilter: JSString = "magFilter" - static let makeReadOnly: JSString = "makeReadOnly" - static let makeXRCompatible: JSString = "makeXRCompatible" - static let manufacturer: JSString = "manufacturer" - static let manufacturerData: JSString = "manufacturerData" - static let manufacturerName: JSString = "manufacturerName" - static let mapAsync: JSString = "mapAsync" - static let mappedAtCreation: JSString = "mappedAtCreation" - static let mapping: JSString = "mapping" - static let marginHeight: JSString = "marginHeight" - static let marginWidth: JSString = "marginWidth" - static let mark: JSString = "mark" - static let markerHeight: JSString = "markerHeight" - static let markerUnits: JSString = "markerUnits" - static let markerWidth: JSString = "markerWidth" - static let markers: JSString = "markers" - static let mask: JSString = "mask" - static let maskContentUnits: JSString = "maskContentUnits" - static let maskUnits: JSString = "maskUnits" - static let match: JSString = "match" - static let matchAll: JSString = "matchAll" - static let matchMedia: JSString = "matchMedia" - static let matches: JSString = "matches" - static let matmul: JSString = "matmul" - static let matrix: JSString = "matrix" - static let matrixTransform: JSString = "matrixTransform" - static let max: JSString = "max" - static let maxActions: JSString = "maxActions" - static let maxAlternatives: JSString = "maxAlternatives" - static let maxAnisotropy: JSString = "maxAnisotropy" - static let maxBindGroups: JSString = "maxBindGroups" - static let maxBitrate: JSString = "maxBitrate" - static let maxBufferSize: JSString = "maxBufferSize" - static let maxChannelCount: JSString = "maxChannelCount" - static let maxChannels: JSString = "maxChannels" - static let maxComputeInvocationsPerWorkgroup: JSString = "maxComputeInvocationsPerWorkgroup" - static let maxComputeWorkgroupSizeX: JSString = "maxComputeWorkgroupSizeX" - static let maxComputeWorkgroupSizeY: JSString = "maxComputeWorkgroupSizeY" - static let maxComputeWorkgroupSizeZ: JSString = "maxComputeWorkgroupSizeZ" - static let maxComputeWorkgroupStorageSize: JSString = "maxComputeWorkgroupStorageSize" - static let maxComputeWorkgroupsPerDimension: JSString = "maxComputeWorkgroupsPerDimension" - static let maxContentSize: JSString = "maxContentSize" - static let maxDatagramSize: JSString = "maxDatagramSize" - static let maxDecibels: JSString = "maxDecibels" - static let maxDelayTime: JSString = "maxDelayTime" - static let maxDetectedFaces: JSString = "maxDetectedFaces" - static let maxDistance: JSString = "maxDistance" - static let maxDynamicStorageBuffersPerPipelineLayout: JSString = "maxDynamicStorageBuffersPerPipelineLayout" - static let maxDynamicUniformBuffersPerPipelineLayout: JSString = "maxDynamicUniformBuffersPerPipelineLayout" - static let maxInterStageShaderComponents: JSString = "maxInterStageShaderComponents" - static let maxLength: JSString = "maxLength" - static let maxMessageSize: JSString = "maxMessageSize" - static let maxPacketLifeTime: JSString = "maxPacketLifeTime" - static let maxPool2d: JSString = "maxPool2d" - static let maxRetransmits: JSString = "maxRetransmits" - static let maxSampledTexturesPerShaderStage: JSString = "maxSampledTexturesPerShaderStage" - static let maxSamplersPerShaderStage: JSString = "maxSamplersPerShaderStage" - static let maxSamplingFrequency: JSString = "maxSamplingFrequency" - static let maxStorageBufferBindingSize: JSString = "maxStorageBufferBindingSize" - static let maxStorageBuffersPerShaderStage: JSString = "maxStorageBuffersPerShaderStage" - static let maxStorageTexturesPerShaderStage: JSString = "maxStorageTexturesPerShaderStage" - static let maxTextureArrayLayers: JSString = "maxTextureArrayLayers" - static let maxTextureDimension1D: JSString = "maxTextureDimension1D" - static let maxTextureDimension2D: JSString = "maxTextureDimension2D" - static let maxTextureDimension3D: JSString = "maxTextureDimension3D" - static let maxTouchPoints: JSString = "maxTouchPoints" - static let maxUniformBufferBindingSize: JSString = "maxUniformBufferBindingSize" - static let maxUniformBuffersPerShaderStage: JSString = "maxUniformBuffersPerShaderStage" - static let maxValue: JSString = "maxValue" - static let maxVertexAttributes: JSString = "maxVertexAttributes" - static let maxVertexBufferArrayStride: JSString = "maxVertexBufferArrayStride" - static let maxVertexBuffers: JSString = "maxVertexBuffers" - static let maximum: JSString = "maximum" - static let maximumAge: JSString = "maximumAge" - static let maximumValue: JSString = "maximumValue" - static let mayUseGATT: JSString = "mayUseGATT" - static let measure: JSString = "measure" - static let measureElement: JSString = "measureElement" - static let measureText: JSString = "measureText" - static let measureUserAgentSpecificMemory: JSString = "measureUserAgentSpecificMemory" - static let media: JSString = "media" - static let mediaCapabilities: JSString = "mediaCapabilities" - static let mediaDevices: JSString = "mediaDevices" - static let mediaElement: JSString = "mediaElement" - static let mediaKeys: JSString = "mediaKeys" - static let mediaSession: JSString = "mediaSession" - static let mediaSourceId: JSString = "mediaSourceId" - static let mediaStream: JSString = "mediaStream" - static let mediaStreamTrack: JSString = "mediaStreamTrack" - static let mediaText: JSString = "mediaText" - static let mediaTime: JSString = "mediaTime" - static let mediaType: JSString = "mediaType" - static let mediation: JSString = "mediation" - static let meetOrSlice: JSString = "meetOrSlice" - static let menubar: JSString = "menubar" - static let message: JSString = "message" - static let messageType: JSString = "messageType" - static let messages: JSString = "messages" - static let messagesReceived: JSString = "messagesReceived" - static let messagesSent: JSString = "messagesSent" - static let metaKey: JSString = "metaKey" - static let metadata: JSString = "metadata" - static let method: JSString = "method" - static let methodData: JSString = "methodData" - static let methodDetails: JSString = "methodDetails" - static let methodName: JSString = "methodName" - static let mid: JSString = "mid" - static let mimeType: JSString = "mimeType" - static let mimeTypes: JSString = "mimeTypes" - static let min: JSString = "min" - static let minBindingSize: JSString = "minBindingSize" - static let minContentSize: JSString = "minContentSize" - static let minDecibels: JSString = "minDecibels" - static let minFilter: JSString = "minFilter" - static let minInterval: JSString = "minInterval" - static let minLength: JSString = "minLength" - static let minRtt: JSString = "minRtt" - static let minSamplingFrequency: JSString = "minSamplingFrequency" - static let minStorageBufferOffsetAlignment: JSString = "minStorageBufferOffsetAlignment" - static let minUniformBufferOffsetAlignment: JSString = "minUniformBufferOffsetAlignment" - static let minValue: JSString = "minValue" - static let minimumValue: JSString = "minimumValue" - static let mipLevel: JSString = "mipLevel" - static let mipLevelCount: JSString = "mipLevelCount" - static let mipLevels: JSString = "mipLevels" - static let mipmapFilter: JSString = "mipmapFilter" - static let miterLimit: JSString = "miterLimit" - static let ml: JSString = "ml" - static let mm: JSString = "mm" - static let mobile: JSString = "mobile" - static let mockSensorType: JSString = "mockSensorType" - static let mode: JSString = "mode" - static let model: JSString = "model" - static let modifierAltGraph: JSString = "modifierAltGraph" - static let modifierCapsLock: JSString = "modifierCapsLock" - static let modifierFn: JSString = "modifierFn" - static let modifierFnLock: JSString = "modifierFnLock" - static let modifierHyper: JSString = "modifierHyper" - static let modifierNumLock: JSString = "modifierNumLock" - static let modifierScrollLock: JSString = "modifierScrollLock" - static let modifierSuper: JSString = "modifierSuper" - static let modifierSymbol: JSString = "modifierSymbol" - static let modifierSymbolLock: JSString = "modifierSymbolLock" - static let modifiers: JSString = "modifiers" - static let module: JSString = "module" - static let modulusLength: JSString = "modulusLength" - static let moveBy: JSString = "moveBy" - static let moveTo: JSString = "moveTo" - static let movementX: JSString = "movementX" - static let movementY: JSString = "movementY" - static let ms: JSString = "ms" - static let mtu: JSString = "mtu" - static let mul: JSString = "mul" - static let multiDrawArraysInstancedBaseInstanceWEBGL: JSString = "multiDrawArraysInstancedBaseInstanceWEBGL" - static let multiDrawArraysInstancedWEBGL: JSString = "multiDrawArraysInstancedWEBGL" - static let multiDrawArraysWEBGL: JSString = "multiDrawArraysWEBGL" - static let multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL: JSString = "multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL" - static let multiDrawElementsInstancedWEBGL: JSString = "multiDrawElementsInstancedWEBGL" - static let multiDrawElementsWEBGL: JSString = "multiDrawElementsWEBGL" - static let multiEntry: JSString = "multiEntry" - static let multiple: JSString = "multiple" - static let multiply: JSString = "multiply" - static let multiplySelf: JSString = "multiplySelf" - static let multisample: JSString = "multisample" - static let multisampled: JSString = "multisampled" - static let mutable: JSString = "mutable" - static let muted: JSString = "muted" - static let n: JSString = "n" - static let nackCount: JSString = "nackCount" - static let name: JSString = "name" - static let nameList: JSString = "nameList" - static let namePrefix: JSString = "namePrefix" - static let namedCurve: JSString = "namedCurve" - static let namedFlows: JSString = "namedFlows" - static let namedItem: JSString = "namedItem" - static let namespaceURI: JSString = "namespaceURI" - static let nativeProjectionScaleFactor: JSString = "nativeProjectionScaleFactor" - static let naturalHeight: JSString = "naturalHeight" - static let naturalWidth: JSString = "naturalWidth" - static let navigate: JSString = "navigate" - static let navigation: JSString = "navigation" - static let navigationPreload: JSString = "navigationPreload" - static let navigationStart: JSString = "navigationStart" - static let navigationType: JSString = "navigationType" - static let navigationUI: JSString = "navigationUI" - static let navigator: JSString = "navigator" - static let near: JSString = "near" - static let needsRedraw: JSString = "needsRedraw" - static let neg: JSString = "neg" - static let negative: JSString = "negative" - static let negotiated: JSString = "negotiated" - static let networkPriority: JSString = "networkPriority" - static let networkState: JSString = "networkState" - static let newSubscription: JSString = "newSubscription" - static let newURL: JSString = "newURL" - static let newValue: JSString = "newValue" - static let newValueSpecifiedUnits: JSString = "newValueSpecifiedUnits" - static let newVersion: JSString = "newVersion" - static let nextElementSibling: JSString = "nextElementSibling" - static let nextHopProtocol: JSString = "nextHopProtocol" - static let nextNode: JSString = "nextNode" - static let nextSibling: JSString = "nextSibling" - static let noHref: JSString = "noHref" - static let noModule: JSString = "noModule" - static let noResize: JSString = "noResize" - static let noShade: JSString = "noShade" - static let noValidate: JSString = "noValidate" - static let noWrap: JSString = "noWrap" - static let node: JSString = "node" - static let nodeName: JSString = "nodeName" - static let nodeType: JSString = "nodeType" - static let nodeValue: JSString = "nodeValue" - static let noiseSuppression: JSString = "noiseSuppression" - static let nominated: JSString = "nominated" - static let nonce: JSString = "nonce" - static let normDepthBufferFromNormView: JSString = "normDepthBufferFromNormView" - static let normalize: JSString = "normalize" - static let notification: JSString = "notification" - static let notify: JSString = "notify" - static let now: JSString = "now" - static let numIncomingStreamsCreated: JSString = "numIncomingStreamsCreated" - static let numOctaves: JSString = "numOctaves" - static let numOutgoingStreamsCreated: JSString = "numOutgoingStreamsCreated" - static let numReceivedDatagramsDropped: JSString = "numReceivedDatagramsDropped" - static let number: JSString = "number" - static let numberOfChannels: JSString = "numberOfChannels" - static let numberOfFrames: JSString = "numberOfFrames" - static let numberOfInputs: JSString = "numberOfInputs" - static let numberOfItems: JSString = "numberOfItems" - static let numberOfOutputs: JSString = "numberOfOutputs" - static let numberValue: JSString = "numberValue" - static let objectStore: JSString = "objectStore" - static let objectStoreNames: JSString = "objectStoreNames" - static let observe: JSString = "observe" - static let occlusionQuerySet: JSString = "occlusionQuerySet" - static let offerToReceiveAudio: JSString = "offerToReceiveAudio" - static let offerToReceiveVideo: JSString = "offerToReceiveVideo" - static let offset: JSString = "offset" - static let offsetHeight: JSString = "offsetHeight" - static let offsetLeft: JSString = "offsetLeft" - static let offsetNode: JSString = "offsetNode" - static let offsetParent: JSString = "offsetParent" - static let offsetRay: JSString = "offsetRay" - static let offsetTop: JSString = "offsetTop" - static let offsetWidth: JSString = "offsetWidth" - static let offsetX: JSString = "offsetX" - static let offsetY: JSString = "offsetY" - static let ok: JSString = "ok" - static let oldSubscription: JSString = "oldSubscription" - static let oldURL: JSString = "oldURL" - static let oldValue: JSString = "oldValue" - static let oldVersion: JSString = "oldVersion" - static let onLine: JSString = "onLine" - static let onSubmittedWorkDone: JSString = "onSubmittedWorkDone" - static let onabort: JSString = "onabort" - static let onactivate: JSString = "onactivate" - static let onaddsourcebuffer: JSString = "onaddsourcebuffer" - static let onaddtrack: JSString = "onaddtrack" - static let onadvertisementreceived: JSString = "onadvertisementreceived" - static let onafterprint: JSString = "onafterprint" - static let onanimationcancel: JSString = "onanimationcancel" - static let onanimationend: JSString = "onanimationend" - static let onanimationiteration: JSString = "onanimationiteration" - static let onanimationstart: JSString = "onanimationstart" - static let onappinstalled: JSString = "onappinstalled" - static let onaudioend: JSString = "onaudioend" - static let onaudioprocess: JSString = "onaudioprocess" - static let onaudiostart: JSString = "onaudiostart" - static let onauxclick: JSString = "onauxclick" - static let onavailabilitychanged: JSString = "onavailabilitychanged" - static let onbackgroundfetchabort: JSString = "onbackgroundfetchabort" - static let onbackgroundfetchclick: JSString = "onbackgroundfetchclick" - static let onbackgroundfetchfail: JSString = "onbackgroundfetchfail" - static let onbackgroundfetchsuccess: JSString = "onbackgroundfetchsuccess" - static let onbeforeinstallprompt: JSString = "onbeforeinstallprompt" - static let onbeforeprint: JSString = "onbeforeprint" - static let onbeforeunload: JSString = "onbeforeunload" - static let onbeforexrselect: JSString = "onbeforexrselect" - static let onbegin: JSString = "onbegin" - static let onblocked: JSString = "onblocked" - static let onblur: JSString = "onblur" - static let onboundary: JSString = "onboundary" - static let onbufferedamountlow: JSString = "onbufferedamountlow" - static let oncancel: JSString = "oncancel" - static let oncanmakepayment: JSString = "oncanmakepayment" - static let oncanplay: JSString = "oncanplay" - static let oncanplaythrough: JSString = "oncanplaythrough" - static let once: JSString = "once" - static let onchange: JSString = "onchange" - static let oncharacterboundsupdate: JSString = "oncharacterboundsupdate" - static let oncharacteristicvaluechanged: JSString = "oncharacteristicvaluechanged" - static let onchargingchange: JSString = "onchargingchange" - static let onchargingtimechange: JSString = "onchargingtimechange" - static let onclick: JSString = "onclick" - static let onclose: JSString = "onclose" - static let onclosing: JSString = "onclosing" - static let oncompassneedscalibration: JSString = "oncompassneedscalibration" - static let oncomplete: JSString = "oncomplete" - static let oncompositionend: JSString = "oncompositionend" - static let oncompositionstart: JSString = "oncompositionstart" - static let onconnect: JSString = "onconnect" - static let onconnecting: JSString = "onconnecting" - static let onconnectionavailable: JSString = "onconnectionavailable" - static let onconnectionstatechange: JSString = "onconnectionstatechange" - static let oncontentdelete: JSString = "oncontentdelete" - static let oncontextlost: JSString = "oncontextlost" - static let oncontextmenu: JSString = "oncontextmenu" - static let oncontextrestored: JSString = "oncontextrestored" - static let oncontrollerchange: JSString = "oncontrollerchange" - static let oncookiechange: JSString = "oncookiechange" - static let oncopy: JSString = "oncopy" - static let oncuechange: JSString = "oncuechange" - static let oncurrententrychange: JSString = "oncurrententrychange" - static let oncut: JSString = "oncut" - static let ondataavailable: JSString = "ondataavailable" - static let ondatachannel: JSString = "ondatachannel" - static let ondblclick: JSString = "ondblclick" - static let ondevicechange: JSString = "ondevicechange" - static let ondevicemotion: JSString = "ondevicemotion" - static let ondeviceorientation: JSString = "ondeviceorientation" - static let ondeviceorientationabsolute: JSString = "ondeviceorientationabsolute" - static let ondischargingtimechange: JSString = "ondischargingtimechange" - static let ondisconnect: JSString = "ondisconnect" - static let ondispose: JSString = "ondispose" - static let ondrag: JSString = "ondrag" - static let ondragend: JSString = "ondragend" - static let ondragenter: JSString = "ondragenter" - static let ondragleave: JSString = "ondragleave" - static let ondragover: JSString = "ondragover" - static let ondragstart: JSString = "ondragstart" - static let ondrop: JSString = "ondrop" - static let ondurationchange: JSString = "ondurationchange" - static let oneRealm: JSString = "oneRealm" - static let onemptied: JSString = "onemptied" - static let onencrypted: JSString = "onencrypted" - static let onend: JSString = "onend" - static let onended: JSString = "onended" - static let onenter: JSString = "onenter" - static let onenterpictureinpicture: JSString = "onenterpictureinpicture" - static let onerror: JSString = "onerror" - static let onexit: JSString = "onexit" - static let onfetch: JSString = "onfetch" - static let onfinish: JSString = "onfinish" - static let onfocus: JSString = "onfocus" - static let onformdata: JSString = "onformdata" - static let onframeratechange: JSString = "onframeratechange" - static let onfreeze: JSString = "onfreeze" - static let onfullscreenchange: JSString = "onfullscreenchange" - static let onfullscreenerror: JSString = "onfullscreenerror" - static let ongamepadconnected: JSString = "ongamepadconnected" - static let ongamepaddisconnected: JSString = "ongamepaddisconnected" - static let ongatheringstatechange: JSString = "ongatheringstatechange" - static let ongattserverdisconnected: JSString = "ongattserverdisconnected" - static let ongeometrychange: JSString = "ongeometrychange" - static let ongotpointercapture: JSString = "ongotpointercapture" - static let onhashchange: JSString = "onhashchange" - static let onicecandidate: JSString = "onicecandidate" - static let onicecandidateerror: JSString = "onicecandidateerror" - static let oniceconnectionstatechange: JSString = "oniceconnectionstatechange" - static let onicegatheringstatechange: JSString = "onicegatheringstatechange" - static let oninput: JSString = "oninput" - static let oninputreport: JSString = "oninputreport" - static let oninputsourceschange: JSString = "oninputsourceschange" - static let oninstall: JSString = "oninstall" - static let oninvalid: JSString = "oninvalid" - static let onisolationchange: JSString = "onisolationchange" - static let onkeydown: JSString = "onkeydown" - static let onkeypress: JSString = "onkeypress" - static let onkeystatuseschange: JSString = "onkeystatuseschange" - static let onkeyup: JSString = "onkeyup" - static let onlanguagechange: JSString = "onlanguagechange" - static let onlayoutchange: JSString = "onlayoutchange" - static let onleavepictureinpicture: JSString = "onleavepictureinpicture" - static let onlevelchange: JSString = "onlevelchange" - static let onload: JSString = "onload" - static let onloadeddata: JSString = "onloadeddata" - static let onloadedmetadata: JSString = "onloadedmetadata" - static let onloadend: JSString = "onloadend" - static let onloading: JSString = "onloading" - static let onloadingdone: JSString = "onloadingdone" - static let onloadingerror: JSString = "onloadingerror" - static let onloadstart: JSString = "onloadstart" - static let onlostpointercapture: JSString = "onlostpointercapture" - static let only: JSString = "only" - static let onmark: JSString = "onmark" - static let onmessage: JSString = "onmessage" - static let onmessageerror: JSString = "onmessageerror" - static let onmidimessage: JSString = "onmidimessage" - static let onmousedown: JSString = "onmousedown" - static let onmouseenter: JSString = "onmouseenter" - static let onmouseleave: JSString = "onmouseleave" - static let onmousemove: JSString = "onmousemove" - static let onmouseout: JSString = "onmouseout" - static let onmouseover: JSString = "onmouseover" - static let onmouseup: JSString = "onmouseup" - static let onmute: JSString = "onmute" - static let onnavigate: JSString = "onnavigate" - static let onnavigateerror: JSString = "onnavigateerror" - static let onnavigatefrom: JSString = "onnavigatefrom" - static let onnavigatesuccess: JSString = "onnavigatesuccess" - static let onnavigateto: JSString = "onnavigateto" - static let onnegotiationneeded: JSString = "onnegotiationneeded" - static let onnomatch: JSString = "onnomatch" - static let onnotificationclick: JSString = "onnotificationclick" - static let onnotificationclose: JSString = "onnotificationclose" - static let onoffline: JSString = "onoffline" - static let ononline: JSString = "ononline" - static let onopen: JSString = "onopen" - static let onorientationchange: JSString = "onorientationchange" - static let onpagehide: JSString = "onpagehide" - static let onpageshow: JSString = "onpageshow" - static let onpaste: JSString = "onpaste" - static let onpause: JSString = "onpause" - static let onpaymentmethodchange: JSString = "onpaymentmethodchange" - static let onpaymentrequest: JSString = "onpaymentrequest" - static let onperiodicsync: JSString = "onperiodicsync" - static let onplay: JSString = "onplay" - static let onplaying: JSString = "onplaying" - static let onpointercancel: JSString = "onpointercancel" - static let onpointerdown: JSString = "onpointerdown" - static let onpointerenter: JSString = "onpointerenter" - static let onpointerleave: JSString = "onpointerleave" - static let onpointerlockchange: JSString = "onpointerlockchange" - static let onpointerlockerror: JSString = "onpointerlockerror" - static let onpointermove: JSString = "onpointermove" - static let onpointerout: JSString = "onpointerout" - static let onpointerover: JSString = "onpointerover" - static let onpointerrawupdate: JSString = "onpointerrawupdate" - static let onpointerup: JSString = "onpointerup" - static let onpopstate: JSString = "onpopstate" - static let onportalactivate: JSString = "onportalactivate" - static let onprioritychange: JSString = "onprioritychange" - static let onprocessorerror: JSString = "onprocessorerror" - static let onprogress: JSString = "onprogress" - static let onpush: JSString = "onpush" - static let onpushsubscriptionchange: JSString = "onpushsubscriptionchange" - static let onratechange: JSString = "onratechange" - static let onreading: JSString = "onreading" - static let onreadingerror: JSString = "onreadingerror" - static let onreadystatechange: JSString = "onreadystatechange" - static let onredraw: JSString = "onredraw" - static let onreflectionchange: JSString = "onreflectionchange" - static let onrejectionhandled: JSString = "onrejectionhandled" - static let onrelease: JSString = "onrelease" - static let onremove: JSString = "onremove" - static let onremovesourcebuffer: JSString = "onremovesourcebuffer" - static let onremovetrack: JSString = "onremovetrack" - static let onrepeat: JSString = "onrepeat" - static let onreset: JSString = "onreset" - static let onresize: JSString = "onresize" - static let onresourcetimingbufferfull: JSString = "onresourcetimingbufferfull" - static let onresult: JSString = "onresult" - static let onresume: JSString = "onresume" - static let onrtctransform: JSString = "onrtctransform" - static let onscroll: JSString = "onscroll" - static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" - static let onseeked: JSString = "onseeked" - static let onseeking: JSString = "onseeking" - static let onselect: JSString = "onselect" - static let onselectedcandidatepairchange: JSString = "onselectedcandidatepairchange" - static let onselectend: JSString = "onselectend" - static let onselectionchange: JSString = "onselectionchange" - static let onselectstart: JSString = "onselectstart" - static let onserviceadded: JSString = "onserviceadded" - static let onservicechanged: JSString = "onservicechanged" - static let onserviceremoved: JSString = "onserviceremoved" - static let onshow: JSString = "onshow" - static let onsignalingstatechange: JSString = "onsignalingstatechange" - static let onslotchange: JSString = "onslotchange" - static let onsoundend: JSString = "onsoundend" - static let onsoundstart: JSString = "onsoundstart" - static let onsourceclose: JSString = "onsourceclose" - static let onsourceended: JSString = "onsourceended" - static let onsourceopen: JSString = "onsourceopen" - static let onspeechend: JSString = "onspeechend" - static let onspeechstart: JSString = "onspeechstart" - static let onsqueeze: JSString = "onsqueeze" - static let onsqueezeend: JSString = "onsqueezeend" - static let onsqueezestart: JSString = "onsqueezestart" - static let onstalled: JSString = "onstalled" - static let onstart: JSString = "onstart" - static let onstatechange: JSString = "onstatechange" - static let onstop: JSString = "onstop" - static let onstorage: JSString = "onstorage" - static let onsubmit: JSString = "onsubmit" - static let onsuccess: JSString = "onsuccess" - static let onsuspend: JSString = "onsuspend" - static let onsync: JSString = "onsync" - static let onterminate: JSString = "onterminate" - static let ontextformatupdate: JSString = "ontextformatupdate" - static let ontextupdate: JSString = "ontextupdate" - static let ontimeout: JSString = "ontimeout" - static let ontimeupdate: JSString = "ontimeupdate" - static let ontoggle: JSString = "ontoggle" - static let ontonechange: JSString = "ontonechange" - static let ontouchcancel: JSString = "ontouchcancel" - static let ontouchend: JSString = "ontouchend" - static let ontouchmove: JSString = "ontouchmove" - static let ontouchstart: JSString = "ontouchstart" - static let ontrack: JSString = "ontrack" - static let ontransitioncancel: JSString = "ontransitioncancel" - static let ontransitionend: JSString = "ontransitionend" - static let ontransitionrun: JSString = "ontransitionrun" - static let ontransitionstart: JSString = "ontransitionstart" - static let onuncapturederror: JSString = "onuncapturederror" - static let onunhandledrejection: JSString = "onunhandledrejection" - static let onunload: JSString = "onunload" - static let onunmute: JSString = "onunmute" - static let onupdate: JSString = "onupdate" - static let onupdateend: JSString = "onupdateend" - static let onupdatefound: JSString = "onupdatefound" - static let onupdatestart: JSString = "onupdatestart" - static let onupgradeneeded: JSString = "onupgradeneeded" - static let onversionchange: JSString = "onversionchange" - static let onvisibilitychange: JSString = "onvisibilitychange" - static let onvoiceschanged: JSString = "onvoiceschanged" - static let onvolumechange: JSString = "onvolumechange" - static let onwaiting: JSString = "onwaiting" - static let onwaitingforkey: JSString = "onwaitingforkey" - static let onwebkitanimationend: JSString = "onwebkitanimationend" - static let onwebkitanimationiteration: JSString = "onwebkitanimationiteration" - static let onwebkitanimationstart: JSString = "onwebkitanimationstart" - static let onwebkittransitionend: JSString = "onwebkittransitionend" - static let onwheel: JSString = "onwheel" - static let open: JSString = "open" - static let openCursor: JSString = "openCursor" - static let openKeyCursor: JSString = "openKeyCursor" - static let openWindow: JSString = "openWindow" - static let opened: JSString = "opened" - static let opener: JSString = "opener" - static let operation: JSString = "operation" - static let `operator`: JSString = "operator" - static let optimizeForLatency: JSString = "optimizeForLatency" - static let optimum: JSString = "optimum" - static let optionalFeatures: JSString = "optionalFeatures" - static let optionalManufacturerData: JSString = "optionalManufacturerData" - static let optionalServices: JSString = "optionalServices" - static let options: JSString = "options" - static let orderX: JSString = "orderX" - static let orderY: JSString = "orderY" - static let ordered: JSString = "ordered" - static let organization: JSString = "organization" - static let orient: JSString = "orient" - static let orientAngle: JSString = "orientAngle" - static let orientType: JSString = "orientType" - static let orientation: JSString = "orientation" - static let orientationX: JSString = "orientationX" - static let orientationY: JSString = "orientationY" - static let orientationZ: JSString = "orientationZ" - static let origin: JSString = "origin" - static let originAgentCluster: JSString = "originAgentCluster" - static let originPolicyIds: JSString = "originPolicyIds" - static let originTime: JSString = "originTime" - static let originalPolicy: JSString = "originalPolicy" - static let ornaments: JSString = "ornaments" - static let oscpu: JSString = "oscpu" - static let oth: JSString = "oth" - static let otp: JSString = "otp" - static let outerHTML: JSString = "outerHTML" - static let outerHeight: JSString = "outerHeight" - static let outerText: JSString = "outerText" - static let outerWidth: JSString = "outerWidth" - static let outgoingHighWaterMark: JSString = "outgoingHighWaterMark" - static let outgoingMaxAge: JSString = "outgoingMaxAge" - static let output: JSString = "output" - static let outputBuffer: JSString = "outputBuffer" - static let outputChannelCount: JSString = "outputChannelCount" - static let outputLatency: JSString = "outputLatency" - static let outputPadding: JSString = "outputPadding" - static let outputReports: JSString = "outputReports" - static let outputSizes: JSString = "outputSizes" - static let outputs: JSString = "outputs" - static let overlaysContent: JSString = "overlaysContent" - static let overrideColors: JSString = "overrideColors" - static let overrideMimeType: JSString = "overrideMimeType" - static let oversample: JSString = "oversample" - static let overset: JSString = "overset" - static let overwrite: JSString = "overwrite" - static let ownerDocument: JSString = "ownerDocument" - static let ownerElement: JSString = "ownerElement" - static let ownerNode: JSString = "ownerNode" - static let ownerRule: JSString = "ownerRule" - static let ownerSVGElement: JSString = "ownerSVGElement" - static let p: JSString = "p" - static let p1: JSString = "p1" - static let p2: JSString = "p2" - static let p3: JSString = "p3" - static let p4: JSString = "p4" - static let packetSize: JSString = "packetSize" - static let packets: JSString = "packets" - static let packetsContributedTo: JSString = "packetsContributedTo" - static let packetsDiscarded: JSString = "packetsDiscarded" - static let packetsDiscardedOnSend: JSString = "packetsDiscardedOnSend" - static let packetsDuplicated: JSString = "packetsDuplicated" - static let packetsFailedDecryption: JSString = "packetsFailedDecryption" - static let packetsLost: JSString = "packetsLost" - static let packetsReceived: JSString = "packetsReceived" - static let packetsRepaired: JSString = "packetsRepaired" - static let packetsSent: JSString = "packetsSent" - static let pad: JSString = "pad" - static let padding: JSString = "padding" - static let pageLeft: JSString = "pageLeft" - static let pageTop: JSString = "pageTop" - static let pageX: JSString = "pageX" - static let pageXOffset: JSString = "pageXOffset" - static let pageY: JSString = "pageY" - static let pageYOffset: JSString = "pageYOffset" - static let paintWorklet: JSString = "paintWorklet" - static let palettes: JSString = "palettes" - static let pan: JSString = "pan" - static let panTiltZoom: JSString = "panTiltZoom" - static let panningModel: JSString = "panningModel" - static let parameterData: JSString = "parameterData" - static let parameters: JSString = "parameters" - static let parent: JSString = "parent" - static let parentElement: JSString = "parentElement" - static let parentId: JSString = "parentId" - static let parentNode: JSString = "parentNode" - static let parentRule: JSString = "parentRule" - static let parentStyleSheet: JSString = "parentStyleSheet" - static let parity: JSString = "parity" - static let parse: JSString = "parse" - static let parseAll: JSString = "parseAll" - static let parseCommaValueList: JSString = "parseCommaValueList" - static let parseDeclaration: JSString = "parseDeclaration" - static let parseDeclarationList: JSString = "parseDeclarationList" - static let parseFromString: JSString = "parseFromString" - static let parseRule: JSString = "parseRule" - static let parseRuleList: JSString = "parseRuleList" - static let parseStylesheet: JSString = "parseStylesheet" - static let parseValue: JSString = "parseValue" - static let parseValueList: JSString = "parseValueList" - static let part: JSString = "part" - static let partialFramesLost: JSString = "partialFramesLost" - static let passOp: JSString = "passOp" - static let passive: JSString = "passive" - static let password: JSString = "password" - static let path: JSString = "path" - static let pathLength: JSString = "pathLength" - static let pathname: JSString = "pathname" - static let pattern: JSString = "pattern" - static let patternContentUnits: JSString = "patternContentUnits" - static let patternMismatch: JSString = "patternMismatch" - static let patternTransform: JSString = "patternTransform" - static let patternUnits: JSString = "patternUnits" - static let pause: JSString = "pause" - static let pauseAnimations: JSString = "pauseAnimations" - static let pauseOnExit: JSString = "pauseOnExit" - static let pauseTransformFeedback: JSString = "pauseTransformFeedback" - static let paused: JSString = "paused" - static let payeeOrigin: JSString = "payeeOrigin" - static let payloadType: JSString = "payloadType" - static let payment: JSString = "payment" - static let paymentManager: JSString = "paymentManager" - static let paymentMethod: JSString = "paymentMethod" - static let paymentMethodErrors: JSString = "paymentMethodErrors" - static let paymentRequestId: JSString = "paymentRequestId" - static let paymentRequestOrigin: JSString = "paymentRequestOrigin" - static let pc: JSString = "pc" - static let pdfViewerEnabled: JSString = "pdfViewerEnabled" - static let peerIdentity: JSString = "peerIdentity" - static let pending: JSString = "pending" - static let pendingLocalDescription: JSString = "pendingLocalDescription" - static let pendingRemoteDescription: JSString = "pendingRemoteDescription" - static let perDscpPacketsReceived: JSString = "perDscpPacketsReceived" - static let perDscpPacketsSent: JSString = "perDscpPacketsSent" - static let percent: JSString = "percent" - static let percentHint: JSString = "percentHint" - static let percentageBlockSize: JSString = "percentageBlockSize" - static let percentageInlineSize: JSString = "percentageInlineSize" - static let performance: JSString = "performance" - static let performanceTime: JSString = "performanceTime" - static let periodicSync: JSString = "periodicSync" - static let periodicWave: JSString = "periodicWave" - static let permission: JSString = "permission" - static let permissionState: JSString = "permissionState" - static let permissions: JSString = "permissions" - static let permissionsPolicy: JSString = "permissionsPolicy" - static let permutation: JSString = "permutation" - static let persist: JSString = "persist" - static let persisted: JSString = "persisted" - static let persistentState: JSString = "persistentState" - static let personalbar: JSString = "personalbar" - static let phase: JSString = "phase" - static let phone: JSString = "phone" - static let physicalMaximum: JSString = "physicalMaximum" - static let physicalMinimum: JSString = "physicalMinimum" - static let pictureInPictureElement: JSString = "pictureInPictureElement" - static let pictureInPictureEnabled: JSString = "pictureInPictureEnabled" - static let pictureInPictureWindow: JSString = "pictureInPictureWindow" - static let ping: JSString = "ping" - static let pipeThrough: JSString = "pipeThrough" - static let pipeTo: JSString = "pipeTo" - static let pitch: JSString = "pitch" - static let pixelDepth: JSString = "pixelDepth" - static let pixelStorei: JSString = "pixelStorei" - static let placeholder: JSString = "placeholder" - static let planeIndex: JSString = "planeIndex" - static let platform: JSString = "platform" - static let platformVersion: JSString = "platformVersion" - static let play: JSString = "play" - static let playState: JSString = "playState" - static let playbackRate: JSString = "playbackRate" - static let playbackState: JSString = "playbackState" - static let playbackTime: JSString = "playbackTime" - static let played: JSString = "played" - static let playsInline: JSString = "playsInline" - static let pliCount: JSString = "pliCount" - static let plugins: JSString = "plugins" - static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" - static let pointerId: JSString = "pointerId" - static let pointerLockElement: JSString = "pointerLockElement" - static let pointerMovementScrolls: JSString = "pointerMovementScrolls" - static let pointerType: JSString = "pointerType" - static let points: JSString = "points" - static let pointsAtX: JSString = "pointsAtX" - static let pointsAtY: JSString = "pointsAtY" - static let pointsAtZ: JSString = "pointsAtZ" - static let pointsOfInterest: JSString = "pointsOfInterest" - static let polygonOffset: JSString = "polygonOffset" - static let popDebugGroup: JSString = "popDebugGroup" - static let popErrorScope: JSString = "popErrorScope" - static let populateMatrix: JSString = "populateMatrix" - static let port: JSString = "port" - static let port1: JSString = "port1" - static let port2: JSString = "port2" - static let portalHost: JSString = "portalHost" - static let ports: JSString = "ports" - static let pose: JSString = "pose" - static let position: JSString = "position" - static let positionAlign: JSString = "positionAlign" - static let positionX: JSString = "positionX" - static let positionY: JSString = "positionY" - static let positionZ: JSString = "positionZ" - static let postMessage: JSString = "postMessage" - static let postalCode: JSString = "postalCode" - static let poster: JSString = "poster" - static let postscriptName: JSString = "postscriptName" - static let pow: JSString = "pow" - static let powerEfficient: JSString = "powerEfficient" - static let powerPreference: JSString = "powerPreference" - static let preMultiplySelf: JSString = "preMultiplySelf" - static let precision: JSString = "precision" - static let predictedDisplayTime: JSString = "predictedDisplayTime" - static let predictedEvents: JSString = "predictedEvents" - static let preferAnimation: JSString = "preferAnimation" - static let preferCurrentTab: JSString = "preferCurrentTab" - static let preferredReflectionFormat: JSString = "preferredReflectionFormat" - static let prefix: JSString = "prefix" - static let preload: JSString = "preload" - static let preloadResponse: JSString = "preloadResponse" - static let prelude: JSString = "prelude" - static let premultipliedAlpha: JSString = "premultipliedAlpha" - static let premultiplyAlpha: JSString = "premultiplyAlpha" - static let prepend: JSString = "prepend" - static let presentation: JSString = "presentation" - static let presentationArea: JSString = "presentationArea" - static let presentationStyle: JSString = "presentationStyle" - static let presentationTime: JSString = "presentationTime" - static let presentedFrames: JSString = "presentedFrames" - static let preserveAlpha: JSString = "preserveAlpha" - static let preserveAspectRatio: JSString = "preserveAspectRatio" - static let preserveDrawingBuffer: JSString = "preserveDrawingBuffer" - static let preservesPitch: JSString = "preservesPitch" - static let pressed: JSString = "pressed" - static let pressure: JSString = "pressure" - static let prevValue: JSString = "prevValue" - static let preventAbort: JSString = "preventAbort" - static let preventCancel: JSString = "preventCancel" - static let preventClose: JSString = "preventClose" - static let preventDefault: JSString = "preventDefault" - static let preventScroll: JSString = "preventScroll" - static let preventSilentAccess: JSString = "preventSilentAccess" - static let previousElementSibling: JSString = "previousElementSibling" - static let previousNode: JSString = "previousNode" - static let previousPriority: JSString = "previousPriority" - static let previousRect: JSString = "previousRect" - static let previousSibling: JSString = "previousSibling" - static let price: JSString = "price" - static let primaries: JSString = "primaries" - static let primaryKey: JSString = "primaryKey" - static let primaryLightDirection: JSString = "primaryLightDirection" - static let primaryLightIntensity: JSString = "primaryLightIntensity" - static let primitive: JSString = "primitive" - static let primitiveUnits: JSString = "primitiveUnits" - static let print: JSString = "print" - static let priority: JSString = "priority" - static let privateKey: JSString = "privateKey" - static let probeSpace: JSString = "probeSpace" - static let processingDuration: JSString = "processingDuration" - static let processingEnd: JSString = "processingEnd" - static let processingStart: JSString = "processingStart" - static let processorOptions: JSString = "processorOptions" - static let produceCropTarget: JSString = "produceCropTarget" - static let product: JSString = "product" - static let productId: JSString = "productId" - static let productName: JSString = "productName" - static let productSub: JSString = "productSub" - static let profile: JSString = "profile" - static let profiles: JSString = "profiles" - static let progress: JSString = "progress" - static let projectionMatrix: JSString = "projectionMatrix" - static let promise: JSString = "promise" - static let prompt: JSString = "prompt" - static let properties: JSString = "properties" - static let propertyName: JSString = "propertyName" - static let `protocol`: JSString = "protocol" - static let protocolCode: JSString = "protocolCode" - static let protocols: JSString = "protocols" - static let provider: JSString = "provider" - static let providers: JSString = "providers" - static let pseudo: JSString = "pseudo" - static let pseudoElement: JSString = "pseudoElement" - static let pt: JSString = "pt" - static let pubKeyCredParams: JSString = "pubKeyCredParams" - static let `public`: JSString = "public" - static let publicExponent: JSString = "publicExponent" - static let publicId: JSString = "publicId" - static let publicKey: JSString = "publicKey" - static let pull: JSString = "pull" - static let pulse: JSString = "pulse" - static let purchaseToken: JSString = "purchaseToken" - static let pushDebugGroup: JSString = "pushDebugGroup" - static let pushErrorScope: JSString = "pushErrorScope" - static let pushManager: JSString = "pushManager" - static let pushState: JSString = "pushState" - static let put: JSString = "put" - static let putImageData: JSString = "putImageData" - static let px: JSString = "px" - static let q: JSString = "q" - static let qi: JSString = "qi" - static let qpSum: JSString = "qpSum" - static let quadraticCurveTo: JSString = "quadraticCurveTo" - static let quality: JSString = "quality" - static let qualityLimitationDurations: JSString = "qualityLimitationDurations" - static let qualityLimitationReason: JSString = "qualityLimitationReason" - static let qualityLimitationResolutionChanges: JSString = "qualityLimitationResolutionChanges" - static let quaternion: JSString = "quaternion" - static let query: JSString = "query" - static let queryCommandEnabled: JSString = "queryCommandEnabled" - static let queryCommandIndeterm: JSString = "queryCommandIndeterm" - static let queryCommandState: JSString = "queryCommandState" - static let queryCommandSupported: JSString = "queryCommandSupported" - static let queryCommandValue: JSString = "queryCommandValue" - static let queryCounterEXT: JSString = "queryCounterEXT" - static let queryIndex: JSString = "queryIndex" - static let queryPermission: JSString = "queryPermission" - static let querySelector: JSString = "querySelector" - static let querySelectorAll: JSString = "querySelectorAll" - static let querySet: JSString = "querySet" - static let queue: JSString = "queue" - static let quota: JSString = "quota" - static let r: JSString = "r" - static let rad: JSString = "rad" - static let radius: JSString = "radius" - static let radiusX: JSString = "radiusX" - static let radiusY: JSString = "radiusY" - static let randomUUID: JSString = "randomUUID" - static let range: JSString = "range" - static let rangeCount: JSString = "rangeCount" - static let rangeEnd: JSString = "rangeEnd" - static let rangeMax: JSString = "rangeMax" - static let rangeMin: JSString = "rangeMin" - static let rangeOverflow: JSString = "rangeOverflow" - static let rangeStart: JSString = "rangeStart" - static let rangeUnderflow: JSString = "rangeUnderflow" - static let rate: JSString = "rate" - static let ratio: JSString = "ratio" - static let rawId: JSString = "rawId" - static let rawValue: JSString = "rawValue" - static let rawValueToMeters: JSString = "rawValueToMeters" - static let read: JSString = "read" - static let readAsArrayBuffer: JSString = "readAsArrayBuffer" - static let readAsBinaryString: JSString = "readAsBinaryString" - static let readAsDataURL: JSString = "readAsDataURL" - static let readAsText: JSString = "readAsText" - static let readBuffer: JSString = "readBuffer" - static let readOnly: JSString = "readOnly" - static let readPixels: JSString = "readPixels" - static let readText: JSString = "readText" - static let readValue: JSString = "readValue" - static let readable: JSString = "readable" - static let readableType: JSString = "readableType" - static let ready: JSString = "ready" - static let readyState: JSString = "readyState" - static let real: JSString = "real" - static let reason: JSString = "reason" - static let receiveFeatureReport: JSString = "receiveFeatureReport" - static let receiveTime: JSString = "receiveTime" - static let receivedAlert: JSString = "receivedAlert" - static let receiver: JSString = "receiver" - static let receiverId: JSString = "receiverId" - static let receiverWindow: JSString = "receiverWindow" - static let recipient: JSString = "recipient" - static let recommendedViewportScale: JSString = "recommendedViewportScale" - static let reconnect: JSString = "reconnect" - static let recordType: JSString = "recordType" - static let records: JSString = "records" - static let recordsAvailable: JSString = "recordsAvailable" - static let rect: JSString = "rect" - static let recurrentBias: JSString = "recurrentBias" - static let recursive: JSString = "recursive" - static let redEyeReduction: JSString = "redEyeReduction" - static let redirect: JSString = "redirect" - static let redirectCount: JSString = "redirectCount" - static let redirectEnd: JSString = "redirectEnd" - static let redirectStart: JSString = "redirectStart" - static let redirected: JSString = "redirected" - static let reduceL1: JSString = "reduceL1" - static let reduceL2: JSString = "reduceL2" - static let reduceLogSum: JSString = "reduceLogSum" - static let reduceLogSumExp: JSString = "reduceLogSumExp" - static let reduceMax: JSString = "reduceMax" - static let reduceMean: JSString = "reduceMean" - static let reduceMin: JSString = "reduceMin" - static let reduceProduct: JSString = "reduceProduct" - static let reduceSum: JSString = "reduceSum" - static let reduceSumSquare: JSString = "reduceSumSquare" - static let reducedSize: JSString = "reducedSize" - static let reduction: JSString = "reduction" - static let refDistance: JSString = "refDistance" - static let refX: JSString = "refX" - static let refY: JSString = "refY" - static let referenceFrame: JSString = "referenceFrame" - static let referenceNode: JSString = "referenceNode" - static let referenceSpace: JSString = "referenceSpace" - static let referrer: JSString = "referrer" - static let referrerPolicy: JSString = "referrerPolicy" - static let referringDevice: JSString = "referringDevice" - static let reflectionFormat: JSString = "reflectionFormat" - static let refresh: JSString = "refresh" - static let region: JSString = "region" - static let regionAnchorX: JSString = "regionAnchorX" - static let regionAnchorY: JSString = "regionAnchorY" - static let regionOverset: JSString = "regionOverset" - static let register: JSString = "register" - static let registerAttributionSource: JSString = "registerAttributionSource" - static let registerProperty: JSString = "registerProperty" - static let registerProtocolHandler: JSString = "registerProtocolHandler" - static let registration: JSString = "registration" - static let rel: JSString = "rel" - static let relList: JSString = "relList" - static let relatedAddress: JSString = "relatedAddress" - static let relatedNode: JSString = "relatedNode" - static let relatedPort: JSString = "relatedPort" - static let relatedTarget: JSString = "relatedTarget" - static let relativeTo: JSString = "relativeTo" - static let relayProtocol: JSString = "relayProtocol" - static let relayedSource: JSString = "relayedSource" - static let release: JSString = "release" - static let releaseEvents: JSString = "releaseEvents" - static let releaseInterface: JSString = "releaseInterface" - static let releaseLock: JSString = "releaseLock" - static let releasePointerCapture: JSString = "releasePointerCapture" - static let released: JSString = "released" - static let reliableWrite: JSString = "reliableWrite" - static let reload: JSString = "reload" - static let relu: JSString = "relu" - static let rem: JSString = "rem" - static let remote: JSString = "remote" - static let remoteCandidateId: JSString = "remoteCandidateId" - static let remoteCertificateId: JSString = "remoteCertificateId" - static let remoteDescription: JSString = "remoteDescription" - static let remoteId: JSString = "remoteId" - static let remoteTimestamp: JSString = "remoteTimestamp" - static let remove: JSString = "remove" - static let removeAllRanges: JSString = "removeAllRanges" - static let removeAttribute: JSString = "removeAttribute" - static let removeAttributeNS: JSString = "removeAttributeNS" - static let removeAttributeNode: JSString = "removeAttributeNode" - static let removeChild: JSString = "removeChild" - static let removeCue: JSString = "removeCue" - static let removeEntry: JSString = "removeEntry" - static let removeItem: JSString = "removeItem" - static let removeNamedItem: JSString = "removeNamedItem" - static let removeNamedItemNS: JSString = "removeNamedItemNS" - static let removeParameter: JSString = "removeParameter" - static let removeProperty: JSString = "removeProperty" - static let removeRange: JSString = "removeRange" - static let removeRule: JSString = "removeRule" - static let removeSourceBuffer: JSString = "removeSourceBuffer" - static let removeTrack: JSString = "removeTrack" - static let removed: JSString = "removed" - static let removedNodes: JSString = "removedNodes" - static let removedSamplesForAcceleration: JSString = "removedSamplesForAcceleration" - static let renderState: JSString = "renderState" - static let renderTime: JSString = "renderTime" - static let renderbufferStorage: JSString = "renderbufferStorage" - static let renderbufferStorageMultisample: JSString = "renderbufferStorageMultisample" - static let renderedBuffer: JSString = "renderedBuffer" - static let renotify: JSString = "renotify" - static let `repeat`: JSString = "repeat" - static let repetitionCount: JSString = "repetitionCount" - static let replace: JSString = "replace" - static let replaceChild: JSString = "replaceChild" - static let replaceChildren: JSString = "replaceChildren" - static let replaceData: JSString = "replaceData" - static let replaceItem: JSString = "replaceItem" - static let replaceState: JSString = "replaceState" - static let replaceSync: JSString = "replaceSync" - static let replaceTrack: JSString = "replaceTrack" - static let replaceWith: JSString = "replaceWith" - static let replacesClientId: JSString = "replacesClientId" - static let reportCount: JSString = "reportCount" - static let reportError: JSString = "reportError" - static let reportId: JSString = "reportId" - static let reportSize: JSString = "reportSize" - static let reportValidity: JSString = "reportValidity" - static let reportsReceived: JSString = "reportsReceived" - static let reportsSent: JSString = "reportsSent" - static let request: JSString = "request" - static let requestAdapter: JSString = "requestAdapter" - static let requestBytesSent: JSString = "requestBytesSent" - static let requestData: JSString = "requestData" - static let requestDevice: JSString = "requestDevice" - static let requestFrame: JSString = "requestFrame" - static let requestFullscreen: JSString = "requestFullscreen" - static let requestHitTestSource: JSString = "requestHitTestSource" - static let requestHitTestSourceForTransientInput: JSString = "requestHitTestSourceForTransientInput" - static let requestId: JSString = "requestId" - static let requestLightProbe: JSString = "requestLightProbe" - static let requestMIDIAccess: JSString = "requestMIDIAccess" - static let requestMediaKeySystemAccess: JSString = "requestMediaKeySystemAccess" - static let requestPermission: JSString = "requestPermission" - static let requestPictureInPicture: JSString = "requestPictureInPicture" - static let requestPointerLock: JSString = "requestPointerLock" - static let requestPort: JSString = "requestPort" - static let requestPresenter: JSString = "requestPresenter" - static let requestReferenceSpace: JSString = "requestReferenceSpace" - static let requestSession: JSString = "requestSession" - static let requestStart: JSString = "requestStart" - static let requestStorageAccess: JSString = "requestStorageAccess" - static let requestSubmit: JSString = "requestSubmit" - static let requestToSend: JSString = "requestToSend" - static let requestType: JSString = "requestType" - static let requestViewportScale: JSString = "requestViewportScale" - static let requestedSamplingFrequency: JSString = "requestedSamplingFrequency" - static let requestsReceived: JSString = "requestsReceived" - static let requestsSent: JSString = "requestsSent" - static let requireInteraction: JSString = "requireInteraction" - static let requireResidentKey: JSString = "requireResidentKey" - static let required: JSString = "required" - static let requiredExtensions: JSString = "requiredExtensions" - static let requiredFeatures: JSString = "requiredFeatures" - static let requiredLimits: JSString = "requiredLimits" - static let resample2d: JSString = "resample2d" - static let reset: JSString = "reset" - static let resetAfter: JSString = "resetAfter" - static let resetTransform: JSString = "resetTransform" - static let reshape: JSString = "reshape" - static let residentKey: JSString = "residentKey" - static let resizeBy: JSString = "resizeBy" - static let resizeHeight: JSString = "resizeHeight" - static let resizeMode: JSString = "resizeMode" - static let resizeQuality: JSString = "resizeQuality" - static let resizeTo: JSString = "resizeTo" - static let resizeWidth: JSString = "resizeWidth" - static let resolution: JSString = "resolution" - static let resolve: JSString = "resolve" - static let resolveQuerySet: JSString = "resolveQuerySet" - static let resolveTarget: JSString = "resolveTarget" - static let resource: JSString = "resource" - static let resourceId: JSString = "resourceId" - static let resources: JSString = "resources" - static let respond: JSString = "respond" - static let respondWith: JSString = "respondWith" - static let respondWithNewView: JSString = "respondWithNewView" - static let response: JSString = "response" - static let responseBytesSent: JSString = "responseBytesSent" - static let responseEnd: JSString = "responseEnd" - static let responseReady: JSString = "responseReady" - static let responseStart: JSString = "responseStart" - static let responseText: JSString = "responseText" - static let responseType: JSString = "responseType" - static let responseURL: JSString = "responseURL" - static let responseXML: JSString = "responseXML" - static let responsesReceived: JSString = "responsesReceived" - static let responsesSent: JSString = "responsesSent" - static let restartIce: JSString = "restartIce" - static let restore: JSString = "restore" - static let restoreContext: JSString = "restoreContext" - static let restrictOwnAudio: JSString = "restrictOwnAudio" - static let result: JSString = "result" - static let resultIndex: JSString = "resultIndex" - static let resultType: JSString = "resultType" - static let resultingClientId: JSString = "resultingClientId" - static let results: JSString = "results" - static let resume: JSString = "resume" - static let resumeTransformFeedback: JSString = "resumeTransformFeedback" - static let retransmissionsReceived: JSString = "retransmissionsReceived" - static let retransmissionsSent: JSString = "retransmissionsSent" - static let retransmittedBytesSent: JSString = "retransmittedBytesSent" - static let retransmittedPacketsSent: JSString = "retransmittedPacketsSent" - static let retry: JSString = "retry" - static let returnSequence: JSString = "returnSequence" - static let returnValue: JSString = "returnValue" - static let rev: JSString = "rev" - static let reverse: JSString = "reverse" - static let reversed: JSString = "reversed" - static let revoke: JSString = "revoke" - static let revokeObjectURL: JSString = "revokeObjectURL" - static let rid: JSString = "rid" - static let right: JSString = "right" - static let ringIndicator: JSString = "ringIndicator" - static let rk: JSString = "rk" - static let rlh: JSString = "rlh" - static let robustness: JSString = "robustness" - static let role: JSString = "role" - static let rollback: JSString = "rollback" - static let rolloffFactor: JSString = "rolloffFactor" - static let root: JSString = "root" - static let rootBounds: JSString = "rootBounds" - static let rootElement: JSString = "rootElement" - static let rootMargin: JSString = "rootMargin" - static let rotate: JSString = "rotate" - static let rotateAxisAngle: JSString = "rotateAxisAngle" - static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" - static let rotateFromVector: JSString = "rotateFromVector" - static let rotateFromVectorSelf: JSString = "rotateFromVectorSelf" - static let rotateSelf: JSString = "rotateSelf" - static let rotationAngle: JSString = "rotationAngle" - static let rotationRate: JSString = "rotationRate" - static let roundRect: JSString = "roundRect" - static let roundTripTime: JSString = "roundTripTime" - static let roundTripTimeMeasurements: JSString = "roundTripTimeMeasurements" - static let roundingType: JSString = "roundingType" - static let rowIndex: JSString = "rowIndex" - static let rowSpan: JSString = "rowSpan" - static let rows: JSString = "rows" - static let rowsPerImage: JSString = "rowsPerImage" - static let rp: JSString = "rp" - static let rpId: JSString = "rpId" - static let rssi: JSString = "rssi" - static let rtcIdentityProvider: JSString = "rtcIdentityProvider" - static let rtcp: JSString = "rtcp" - static let rtcpMuxPolicy: JSString = "rtcpMuxPolicy" - static let rtcpTransportStatsId: JSString = "rtcpTransportStatsId" - static let rtpTimestamp: JSString = "rtpTimestamp" - static let rtt: JSString = "rtt" - static let rttVariation: JSString = "rttVariation" - static let rtxSsrc: JSString = "rtxSsrc" - static let rules: JSString = "rules" - static let rx: JSString = "rx" - static let ry: JSString = "ry" - static let s: JSString = "s" - static let sRGBHex: JSString = "sRGBHex" - static let salt: JSString = "salt" - static let saltLength: JSString = "saltLength" - static let sameDocument: JSString = "sameDocument" - static let sameSite: JSString = "sameSite" - static let sample: JSString = "sample" - static let sampleCount: JSString = "sampleCount" - static let sampleCoverage: JSString = "sampleCoverage" - static let sampleInterval: JSString = "sampleInterval" - static let sampleRate: JSString = "sampleRate" - static let sampleSize: JSString = "sampleSize" - static let sampleType: JSString = "sampleType" - static let sampler: JSString = "sampler" - static let samplerParameterf: JSString = "samplerParameterf" - static let samplerParameteri: JSString = "samplerParameteri" - static let samplerate: JSString = "samplerate" - static let samples: JSString = "samples" - static let samplesDecodedWithCelt: JSString = "samplesDecodedWithCelt" - static let samplesDecodedWithSilk: JSString = "samplesDecodedWithSilk" - static let samplesEncodedWithCelt: JSString = "samplesEncodedWithCelt" - static let samplesEncodedWithSilk: JSString = "samplesEncodedWithSilk" - static let sandbox: JSString = "sandbox" - static let sanitize: JSString = "sanitize" - static let sanitizeFor: JSString = "sanitizeFor" - static let sanitizer: JSString = "sanitizer" - static let saturation: JSString = "saturation" - static let save: JSString = "save" - static let saveData: JSString = "saveData" - static let scalabilityMode: JSString = "scalabilityMode" - static let scalabilityModes: JSString = "scalabilityModes" - static let scale: JSString = "scale" - static let scale3d: JSString = "scale3d" - static let scale3dSelf: JSString = "scale3dSelf" - static let scaleFactor: JSString = "scaleFactor" - static let scaleNonUniform: JSString = "scaleNonUniform" - static let scaleResolutionDownBy: JSString = "scaleResolutionDownBy" - static let scaleSelf: JSString = "scaleSelf" - static let scales: JSString = "scales" - static let scan: JSString = "scan" - static let scheduler: JSString = "scheduler" - static let scheduling: JSString = "scheduling" - static let scheme: JSString = "scheme" - static let scissor: JSString = "scissor" - static let scope: JSString = "scope" - static let screen: JSString = "screen" - static let screenLeft: JSString = "screenLeft" - static let screenState: JSString = "screenState" - static let screenTop: JSString = "screenTop" - static let screenX: JSString = "screenX" - static let screenY: JSString = "screenY" - static let scriptURL: JSString = "scriptURL" - static let scripts: JSString = "scripts" - static let scroll: JSString = "scroll" - static let scrollAmount: JSString = "scrollAmount" - static let scrollBy: JSString = "scrollBy" - static let scrollDelay: JSString = "scrollDelay" - static let scrollHeight: JSString = "scrollHeight" - static let scrollIntoView: JSString = "scrollIntoView" - static let scrollLeft: JSString = "scrollLeft" - static let scrollOffsets: JSString = "scrollOffsets" - static let scrollPathIntoView: JSString = "scrollPathIntoView" - static let scrollRestoration: JSString = "scrollRestoration" - static let scrollTo: JSString = "scrollTo" - static let scrollTop: JSString = "scrollTop" - static let scrollWidth: JSString = "scrollWidth" - static let scrollX: JSString = "scrollX" - static let scrollY: JSString = "scrollY" - static let scrollbars: JSString = "scrollbars" - static let scrolling: JSString = "scrolling" - static let scrollingElement: JSString = "scrollingElement" - static let sctp: JSString = "sctp" - static let sctpCauseCode: JSString = "sctpCauseCode" - static let sdp: JSString = "sdp" - static let sdpFmtpLine: JSString = "sdpFmtpLine" - static let sdpLineNumber: JSString = "sdpLineNumber" - static let sdpMLineIndex: JSString = "sdpMLineIndex" - static let sdpMid: JSString = "sdpMid" - static let search: JSString = "search" - static let searchParams: JSString = "searchParams" - static let sectionRowIndex: JSString = "sectionRowIndex" - static let secure: JSString = "secure" - static let secureConnectionStart: JSString = "secureConnectionStart" - static let seed: JSString = "seed" - static let seek: JSString = "seek" - static let seekOffset: JSString = "seekOffset" - static let seekTime: JSString = "seekTime" - static let seekable: JSString = "seekable" - static let seeking: JSString = "seeking" - static let segments: JSString = "segments" - static let select: JSString = "select" - static let selectAllChildren: JSString = "selectAllChildren" - static let selectAlternateInterface: JSString = "selectAlternateInterface" - static let selectAudioOutput: JSString = "selectAudioOutput" - static let selectConfiguration: JSString = "selectConfiguration" - static let selectNode: JSString = "selectNode" - static let selectNodeContents: JSString = "selectNodeContents" - static let selectSubString: JSString = "selectSubString" - static let selected: JSString = "selected" - static let selectedCandidatePairChanges: JSString = "selectedCandidatePairChanges" - static let selectedCandidatePairId: JSString = "selectedCandidatePairId" - static let selectedIndex: JSString = "selectedIndex" - static let selectedOptions: JSString = "selectedOptions" - static let selectedTrack: JSString = "selectedTrack" - static let selectionBound: JSString = "selectionBound" - static let selectionDirection: JSString = "selectionDirection" - static let selectionEnd: JSString = "selectionEnd" - static let selectionStart: JSString = "selectionStart" - static let selectorText: JSString = "selectorText" - static let send: JSString = "send" - static let sendBeacon: JSString = "sendBeacon" - static let sendEncodings: JSString = "sendEncodings" - static let sendFeatureReport: JSString = "sendFeatureReport" - static let sendKeyFrameRequest: JSString = "sendKeyFrameRequest" - static let sendReport: JSString = "sendReport" - static let sender: JSString = "sender" - static let senderId: JSString = "senderId" - static let sentAlert: JSString = "sentAlert" - static let serial: JSString = "serial" - static let serialNumber: JSString = "serialNumber" - static let serializeToString: JSString = "serializeToString" - static let serverCertificateHashes: JSString = "serverCertificateHashes" - static let serverTiming: JSString = "serverTiming" - static let service: JSString = "service" - static let serviceData: JSString = "serviceData" - static let serviceWorker: JSString = "serviceWorker" - static let services: JSString = "services" - static let session: JSString = "session" - static let sessionId: JSString = "sessionId" - static let sessionStorage: JSString = "sessionStorage" - static let sessionTypes: JSString = "sessionTypes" - static let set: JSString = "set" - static let setAppBadge: JSString = "setAppBadge" - static let setAttribute: JSString = "setAttribute" - static let setAttributeNS: JSString = "setAttributeNS" - static let setAttributeNode: JSString = "setAttributeNode" - static let setAttributeNodeNS: JSString = "setAttributeNodeNS" - static let setBaseAndExtent: JSString = "setBaseAndExtent" - static let setBindGroup: JSString = "setBindGroup" - static let setBlendConstant: JSString = "setBlendConstant" - static let setCameraActive: JSString = "setCameraActive" - static let setClientBadge: JSString = "setClientBadge" - static let setCodecPreferences: JSString = "setCodecPreferences" - static let setConfiguration: JSString = "setConfiguration" - static let setCurrentTime: JSString = "setCurrentTime" - static let setCustomValidity: JSString = "setCustomValidity" - static let setData: JSString = "setData" - static let setDragImage: JSString = "setDragImage" - static let setEncryptionKey: JSString = "setEncryptionKey" - static let setEnd: JSString = "setEnd" - static let setEndAfter: JSString = "setEndAfter" - static let setEndBefore: JSString = "setEndBefore" - static let setFormValue: JSString = "setFormValue" - static let setHTML: JSString = "setHTML" - static let setHeaderValue: JSString = "setHeaderValue" - static let setIdentityProvider: JSString = "setIdentityProvider" - static let setIndexBuffer: JSString = "setIndexBuffer" - static let setInterval: JSString = "setInterval" - static let setKeyframes: JSString = "setKeyframes" - static let setLineDash: JSString = "setLineDash" - static let setLiveSeekableRange: JSString = "setLiveSeekableRange" - static let setMatrix: JSString = "setMatrix" - static let setMatrixValue: JSString = "setMatrixValue" - static let setMediaKeys: JSString = "setMediaKeys" - static let setMicrophoneActive: JSString = "setMicrophoneActive" - static let setNamedItem: JSString = "setNamedItem" - static let setNamedItemNS: JSString = "setNamedItemNS" - static let setOrientToAngle: JSString = "setOrientToAngle" - static let setOrientToAuto: JSString = "setOrientToAuto" - static let setOrientation: JSString = "setOrientation" - static let setParameter: JSString = "setParameter" - static let setParameters: JSString = "setParameters" - static let setPeriodicWave: JSString = "setPeriodicWave" - static let setPipeline: JSString = "setPipeline" - static let setPointerCapture: JSString = "setPointerCapture" - static let setPosition: JSString = "setPosition" - static let setPositionState: JSString = "setPositionState" - static let setPriority: JSString = "setPriority" - static let setProperty: JSString = "setProperty" - static let setRangeText: JSString = "setRangeText" - static let setRequestHeader: JSString = "setRequestHeader" - static let setResourceTimingBufferSize: JSString = "setResourceTimingBufferSize" - static let setRotate: JSString = "setRotate" - static let setScale: JSString = "setScale" - static let setScissorRect: JSString = "setScissorRect" - static let setSelectionRange: JSString = "setSelectionRange" - static let setServerCertificate: JSString = "setServerCertificate" - static let setSignals: JSString = "setSignals" - static let setSinkId: JSString = "setSinkId" - static let setSkewX: JSString = "setSkewX" - static let setSkewY: JSString = "setSkewY" - static let setStart: JSString = "setStart" - static let setStartAfter: JSString = "setStartAfter" - static let setStartBefore: JSString = "setStartBefore" - static let setStdDeviation: JSString = "setStdDeviation" - static let setStencilReference: JSString = "setStencilReference" - static let setStreams: JSString = "setStreams" - static let setTargetAtTime: JSString = "setTargetAtTime" - static let setTimeout: JSString = "setTimeout" - static let setTransform: JSString = "setTransform" - static let setTranslate: JSString = "setTranslate" - static let setValidity: JSString = "setValidity" - static let setValueAtTime: JSString = "setValueAtTime" - static let setValueCurveAtTime: JSString = "setValueCurveAtTime" - static let setVertexBuffer: JSString = "setVertexBuffer" - static let setViewport: JSString = "setViewport" - static let shaderLocation: JSString = "shaderLocation" - static let shaderSource: JSString = "shaderSource" - static let shadowBlur: JSString = "shadowBlur" - static let shadowColor: JSString = "shadowColor" - static let shadowOffsetX: JSString = "shadowOffsetX" - static let shadowOffsetY: JSString = "shadowOffsetY" - static let shadowRoot: JSString = "shadowRoot" - static let shape: JSString = "shape" - static let share: JSString = "share" - static let sharpness: JSString = "sharpness" - static let sheet: JSString = "sheet" - static let shiftKey: JSString = "shiftKey" - static let show: JSString = "show" - static let showDirectoryPicker: JSString = "showDirectoryPicker" - static let showModal: JSString = "showModal" - static let showNotification: JSString = "showNotification" - static let showOpenFilePicker: JSString = "showOpenFilePicker" - static let showPicker: JSString = "showPicker" - static let showSaveFilePicker: JSString = "showSaveFilePicker" - static let sigmoid: JSString = "sigmoid" - static let sign: JSString = "sign" - static let signal: JSString = "signal" - static let signalingState: JSString = "signalingState" - static let signature: JSString = "signature" - static let silent: JSString = "silent" - static let silentConcealedSamples: JSString = "silentConcealedSamples" - static let sin: JSString = "sin" - static let singleNodeValue: JSString = "singleNodeValue" - static let sinkId: JSString = "sinkId" - static let size: JSString = "size" - static let sizes: JSString = "sizes" - static let sizing: JSString = "sizing" - static let skewX: JSString = "skewX" - static let skewXSelf: JSString = "skewXSelf" - static let skewY: JSString = "skewY" - static let skewYSelf: JSString = "skewYSelf" - static let skipWaiting: JSString = "skipWaiting" - static let sliCount: JSString = "sliCount" - static let slice: JSString = "slice" - static let slope: JSString = "slope" - static let slot: JSString = "slot" - static let slotAssignment: JSString = "slotAssignment" - static let smooth: JSString = "smooth" - static let smoothedRoundTripTime: JSString = "smoothedRoundTripTime" - static let smoothedRtt: JSString = "smoothedRtt" - static let smoothingTimeConstant: JSString = "smoothingTimeConstant" - static let snapToLines: JSString = "snapToLines" - static let snapshotItem: JSString = "snapshotItem" - static let snapshotLength: JSString = "snapshotLength" - static let softmax: JSString = "softmax" - static let softplus: JSString = "softplus" - static let softsign: JSString = "softsign" - static let software: JSString = "software" - static let sort: JSString = "sort" - static let sortingCode: JSString = "sortingCode" - static let source: JSString = "source" - static let sourceAnimation: JSString = "sourceAnimation" - static let sourceBuffer: JSString = "sourceBuffer" - static let sourceBuffers: JSString = "sourceBuffers" - static let sourceCapabilities: JSString = "sourceCapabilities" - static let sourceFile: JSString = "sourceFile" - static let sourceMap: JSString = "sourceMap" - static let sources: JSString = "sources" - static let space: JSString = "space" - static let spacing: JSString = "spacing" - static let span: JSString = "span" - static let spatialIndex: JSString = "spatialIndex" - static let spatialNavigationSearch: JSString = "spatialNavigationSearch" - static let spatialRendering: JSString = "spatialRendering" - static let speak: JSString = "speak" - static let speakAs: JSString = "speakAs" - static let speaking: JSString = "speaking" - static let specified: JSString = "specified" - static let specularConstant: JSString = "specularConstant" - static let specularExponent: JSString = "specularExponent" - static let speechSynthesis: JSString = "speechSynthesis" - static let speed: JSString = "speed" - static let spellcheck: JSString = "spellcheck" - static let sphericalHarmonicsCoefficients: JSString = "sphericalHarmonicsCoefficients" - static let split: JSString = "split" - static let splitText: JSString = "splitText" - static let spreadMethod: JSString = "spreadMethod" - static let squeeze: JSString = "squeeze" - static let src: JSString = "src" - static let srcElement: JSString = "srcElement" - static let srcFactor: JSString = "srcFactor" - static let srcObject: JSString = "srcObject" - static let srcdoc: JSString = "srcdoc" - static let srclang: JSString = "srclang" - static let srcset: JSString = "srcset" - static let srtpCipher: JSString = "srtpCipher" - static let ssrc: JSString = "ssrc" - static let stackId: JSString = "stackId" - static let stacks: JSString = "stacks" - static let standby: JSString = "standby" - static let start: JSString = "start" - static let startContainer: JSString = "startContainer" - static let startIn: JSString = "startIn" - static let startMessages: JSString = "startMessages" - static let startNotifications: JSString = "startNotifications" - static let startOffset: JSString = "startOffset" - static let startRendering: JSString = "startRendering" - static let startTime: JSString = "startTime" - static let state: JSString = "state" - static let states: JSString = "states" - static let status: JSString = "status" - static let statusCode: JSString = "statusCode" - static let statusMessage: JSString = "statusMessage" - static let statusText: JSString = "statusText" - static let statusbar: JSString = "statusbar" - static let stdDeviationX: JSString = "stdDeviationX" - static let stdDeviationY: JSString = "stdDeviationY" - static let steal: JSString = "steal" - static let steepness: JSString = "steepness" - static let stencil: JSString = "stencil" - static let stencilBack: JSString = "stencilBack" - static let stencilClearValue: JSString = "stencilClearValue" - static let stencilFront: JSString = "stencilFront" - static let stencilFunc: JSString = "stencilFunc" - static let stencilFuncSeparate: JSString = "stencilFuncSeparate" - static let stencilLoadOp: JSString = "stencilLoadOp" - static let stencilMask: JSString = "stencilMask" - static let stencilMaskSeparate: JSString = "stencilMaskSeparate" - static let stencilOp: JSString = "stencilOp" - static let stencilOpSeparate: JSString = "stencilOpSeparate" - static let stencilReadMask: JSString = "stencilReadMask" - static let stencilReadOnly: JSString = "stencilReadOnly" - static let stencilStoreOp: JSString = "stencilStoreOp" - static let stencilWriteMask: JSString = "stencilWriteMask" - static let step: JSString = "step" - static let stepDown: JSString = "stepDown" - static let stepMismatch: JSString = "stepMismatch" - static let stepMode: JSString = "stepMode" - static let stepUp: JSString = "stepUp" - static let stitchTiles: JSString = "stitchTiles" - static let stop: JSString = "stop" - static let stopBits: JSString = "stopBits" - static let stopImmediatePropagation: JSString = "stopImmediatePropagation" - static let stopNotifications: JSString = "stopNotifications" - static let stopPropagation: JSString = "stopPropagation" - static let stopped: JSString = "stopped" - static let storage: JSString = "storage" - static let storageArea: JSString = "storageArea" - static let storageTexture: JSString = "storageTexture" - static let store: JSString = "store" - static let storeOp: JSString = "storeOp" - static let stream: JSString = "stream" - static let streamErrorCode: JSString = "streamErrorCode" - static let streams: JSString = "streams" - static let stretch: JSString = "stretch" - static let stride: JSString = "stride" - static let strides: JSString = "strides" - static let stringValue: JSString = "stringValue" - static let strings: JSString = "strings" - static let stripIndexFormat: JSString = "stripIndexFormat" - static let stroke: JSString = "stroke" - static let strokeRect: JSString = "strokeRect" - static let strokeStyle: JSString = "strokeStyle" - static let strokeText: JSString = "strokeText" - static let structuredClone: JSString = "structuredClone" - static let style: JSString = "style" - static let styleMap: JSString = "styleMap" - static let styleSheet: JSString = "styleSheet" - static let styleSheets: JSString = "styleSheets" - static let styleset: JSString = "styleset" - static let stylistic: JSString = "stylistic" - static let sub: JSString = "sub" - static let subclassCode: JSString = "subclassCode" - static let submit: JSString = "submit" - static let submitter: JSString = "submitter" - static let subscribe: JSString = "subscribe" - static let subscriptionPeriod: JSString = "subscriptionPeriod" - static let substringData: JSString = "substringData" - static let subtle: JSString = "subtle" - static let subtree: JSString = "subtree" - static let suffix: JSString = "suffix" - static let suffixes: JSString = "suffixes" - static let suggestedName: JSString = "suggestedName" - static let summary: JSString = "summary" - static let support: JSString = "support" - static let supported: JSString = "supported" - static let supportedContentEncodings: JSString = "supportedContentEncodings" - static let supportedEntryTypes: JSString = "supportedEntryTypes" - static let supportedFrameRates: JSString = "supportedFrameRates" - static let supportedMethods: JSString = "supportedMethods" - static let supportedSources: JSString = "supportedSources" - static let supports: JSString = "supports" - static let suppressLocalAudioPlayback: JSString = "suppressLocalAudioPlayback" - static let surfaceDimensions: JSString = "surfaceDimensions" - static let surfaceId: JSString = "surfaceId" - static let surfaceScale: JSString = "surfaceScale" - static let surroundContents: JSString = "surroundContents" - static let suspend: JSString = "suspend" - static let suspendRedraw: JSString = "suspendRedraw" - static let svb: JSString = "svb" - static let svc: JSString = "svc" - static let svh: JSString = "svh" - static let svi: JSString = "svi" - static let svmax: JSString = "svmax" - static let svmin: JSString = "svmin" - static let svw: JSString = "svw" - static let swash: JSString = "swash" - static let symbols: JSString = "symbols" - static let sync: JSString = "sync" - static let synchronizationSource: JSString = "synchronizationSource" - static let syntax: JSString = "syntax" - static let sysex: JSString = "sysex" - static let sysexEnabled: JSString = "sysexEnabled" - static let system: JSString = "system" - static let systemId: JSString = "systemId" - static let systemLanguage: JSString = "systemLanguage" - static let t: JSString = "t" - static let tBodies: JSString = "tBodies" - static let tFoot: JSString = "tFoot" - static let tHead: JSString = "tHead" - static let tabIndex: JSString = "tabIndex" - static let table: JSString = "table" - static let tableValues: JSString = "tableValues" - static let tag: JSString = "tag" - static let tagLength: JSString = "tagLength" - static let tagName: JSString = "tagName" - static let taintEnabled: JSString = "taintEnabled" - static let takePhoto: JSString = "takePhoto" - static let takeRecords: JSString = "takeRecords" - static let tan: JSString = "tan" - static let tangentialPressure: JSString = "tangentialPressure" - static let tanh: JSString = "tanh" - static let target: JSString = "target" - static let targetBitrate: JSString = "targetBitrate" - static let targetElement: JSString = "targetElement" - static let targetOrigin: JSString = "targetOrigin" - static let targetRanges: JSString = "targetRanges" - static let targetRayMode: JSString = "targetRayMode" - static let targetRaySpace: JSString = "targetRaySpace" - static let targetTouches: JSString = "targetTouches" - static let targetX: JSString = "targetX" - static let targetY: JSString = "targetY" - static let targets: JSString = "targets" - static let tcpType: JSString = "tcpType" - static let tee: JSString = "tee" - static let tel: JSString = "tel" - static let temporalIndex: JSString = "temporalIndex" - static let temporalLayerId: JSString = "temporalLayerId" - static let terminate: JSString = "terminate" - static let test: JSString = "test" - static let texImage2D: JSString = "texImage2D" - static let texImage3D: JSString = "texImage3D" - static let texParameterf: JSString = "texParameterf" - static let texParameteri: JSString = "texParameteri" - static let texStorage2D: JSString = "texStorage2D" - static let texStorage3D: JSString = "texStorage3D" - static let texSubImage2D: JSString = "texSubImage2D" - static let texSubImage3D: JSString = "texSubImage3D" - static let text: JSString = "text" - static let textAlign: JSString = "textAlign" - static let textBaseline: JSString = "textBaseline" - static let textColor: JSString = "textColor" - static let textContent: JSString = "textContent" - static let textFormats: JSString = "textFormats" - static let textLength: JSString = "textLength" - static let textRendering: JSString = "textRendering" - static let textTracks: JSString = "textTracks" - static let texture: JSString = "texture" - static let textureArrayLength: JSString = "textureArrayLength" - static let textureHeight: JSString = "textureHeight" - static let textureType: JSString = "textureType" - static let textureWidth: JSString = "textureWidth" - static let threshold: JSString = "threshold" - static let thresholds: JSString = "thresholds" - static let throwIfAborted: JSString = "throwIfAborted" - static let tilt: JSString = "tilt" - static let tiltX: JSString = "tiltX" - static let tiltY: JSString = "tiltY" - static let time: JSString = "time" - static let timeEnd: JSString = "timeEnd" - static let timeLog: JSString = "timeLog" - static let timeOrigin: JSString = "timeOrigin" - static let timeRemaining: JSString = "timeRemaining" - static let timeStamp: JSString = "timeStamp" - static let timecode: JSString = "timecode" - static let timeline: JSString = "timeline" - static let timelineTime: JSString = "timelineTime" - static let timeout: JSString = "timeout" - static let timestamp: JSString = "timestamp" - static let timestampOffset: JSString = "timestampOffset" - static let timestampWrites: JSString = "timestampWrites" - static let timing: JSString = "timing" - static let title: JSString = "title" - static let titlebarAreaRect: JSString = "titlebarAreaRect" - static let tlsGroup: JSString = "tlsGroup" - static let tlsVersion: JSString = "tlsVersion" - static let to: JSString = "to" - static let toBox: JSString = "toBox" - static let toDataURL: JSString = "toDataURL" - static let toFloat32Array: JSString = "toFloat32Array" - static let toFloat64Array: JSString = "toFloat64Array" - static let toJSON: JSString = "toJSON" - static let toMatrix: JSString = "toMatrix" - static let toRecords: JSString = "toRecords" - static let toString: JSString = "toString" - static let toSum: JSString = "toSum" - static let toggle: JSString = "toggle" - static let toggleAttribute: JSString = "toggleAttribute" - static let tone: JSString = "tone" - static let toneBuffer: JSString = "toneBuffer" - static let tooLong: JSString = "tooLong" - static let tooShort: JSString = "tooShort" - static let toolbar: JSString = "toolbar" - static let top: JSString = "top" - static let topOrigin: JSString = "topOrigin" - static let topology: JSString = "topology" - static let torch: JSString = "torch" - static let total: JSString = "total" - static let totalAudioEnergy: JSString = "totalAudioEnergy" - static let totalDecodeTime: JSString = "totalDecodeTime" - static let totalEncodeTime: JSString = "totalEncodeTime" - static let totalEncodedBytesTarget: JSString = "totalEncodedBytesTarget" - static let totalInterFrameDelay: JSString = "totalInterFrameDelay" - static let totalPacketSendDelay: JSString = "totalPacketSendDelay" - static let totalProcessingDelay: JSString = "totalProcessingDelay" - static let totalRequestsSent: JSString = "totalRequestsSent" - static let totalResponsesReceived: JSString = "totalResponsesReceived" - static let totalRoundTripTime: JSString = "totalRoundTripTime" - static let totalSamplesDecoded: JSString = "totalSamplesDecoded" - static let totalSamplesDuration: JSString = "totalSamplesDuration" - static let totalSamplesReceived: JSString = "totalSamplesReceived" - static let totalSamplesSent: JSString = "totalSamplesSent" - static let totalSquaredInterFrameDelay: JSString = "totalSquaredInterFrameDelay" - static let totalVideoFrames: JSString = "totalVideoFrames" - static let touchEvents: JSString = "touchEvents" - static let touchId: JSString = "touchId" - static let touchType: JSString = "touchType" - static let touched: JSString = "touched" - static let touches: JSString = "touches" - static let trace: JSString = "trace" - static let track: JSString = "track" - static let trackIdentifier: JSString = "trackIdentifier" - static let trackedAnchors: JSString = "trackedAnchors" - static let tracks: JSString = "tracks" - static let transaction: JSString = "transaction" - static let transactionId: JSString = "transactionId" - static let transceiver: JSString = "transceiver" - static let transcript: JSString = "transcript" - static let transfer: JSString = "transfer" - static let transferControlToOffscreen: JSString = "transferControlToOffscreen" - static let transferFromImageBitmap: JSString = "transferFromImageBitmap" - static let transferFunction: JSString = "transferFunction" - static let transferIn: JSString = "transferIn" - static let transferOut: JSString = "transferOut" - static let transferSize: JSString = "transferSize" - static let transferToImageBitmap: JSString = "transferToImageBitmap" - static let transform: JSString = "transform" - static let transformFeedbackVaryings: JSString = "transformFeedbackVaryings" - static let transformPoint: JSString = "transformPoint" - static let transformToDocument: JSString = "transformToDocument" - static let transformToFragment: JSString = "transformToFragment" - static let transformer: JSString = "transformer" - static let transition: JSString = "transition" - static let transitionProperty: JSString = "transitionProperty" - static let transitionWhile: JSString = "transitionWhile" - static let translate: JSString = "translate" - static let translateSelf: JSString = "translateSelf" - static let transport: JSString = "transport" - static let transportId: JSString = "transportId" - static let transports: JSString = "transports" - static let transpose: JSString = "transpose" - static let traverseTo: JSString = "traverseTo" - static let trueSpeed: JSString = "trueSpeed" - static let truncate: JSString = "truncate" - static let trustedTypes: JSString = "trustedTypes" - static let turn: JSString = "turn" - static let twist: JSString = "twist" - static let txPower: JSString = "txPower" - static let type: JSString = "type" - static let typeMismatch: JSString = "typeMismatch" - static let types: JSString = "types" - static let uaFullVersion: JSString = "uaFullVersion" - static let unackData: JSString = "unackData" - static let unclippedDepth: JSString = "unclippedDepth" - static let unconfigure: JSString = "unconfigure" - static let underlineColor: JSString = "underlineColor" - static let underlineStyle: JSString = "underlineStyle" - static let underlineThickness: JSString = "underlineThickness" - static let unicodeRange: JSString = "unicodeRange" - static let uniform1f: JSString = "uniform1f" - static let uniform1fv: JSString = "uniform1fv" - static let uniform1i: JSString = "uniform1i" - static let uniform1iv: JSString = "uniform1iv" - static let uniform1ui: JSString = "uniform1ui" - static let uniform1uiv: JSString = "uniform1uiv" - static let uniform2f: JSString = "uniform2f" - static let uniform2fv: JSString = "uniform2fv" - static let uniform2i: JSString = "uniform2i" - static let uniform2iv: JSString = "uniform2iv" - static let uniform2ui: JSString = "uniform2ui" - static let uniform2uiv: JSString = "uniform2uiv" - static let uniform3f: JSString = "uniform3f" - static let uniform3fv: JSString = "uniform3fv" - static let uniform3i: JSString = "uniform3i" - static let uniform3iv: JSString = "uniform3iv" - static let uniform3ui: JSString = "uniform3ui" - static let uniform3uiv: JSString = "uniform3uiv" - static let uniform4f: JSString = "uniform4f" - static let uniform4fv: JSString = "uniform4fv" - static let uniform4i: JSString = "uniform4i" - static let uniform4iv: JSString = "uniform4iv" - static let uniform4ui: JSString = "uniform4ui" - static let uniform4uiv: JSString = "uniform4uiv" - static let uniformBlockBinding: JSString = "uniformBlockBinding" - static let uniformMatrix2fv: JSString = "uniformMatrix2fv" - static let uniformMatrix2x3fv: JSString = "uniformMatrix2x3fv" - static let uniformMatrix2x4fv: JSString = "uniformMatrix2x4fv" - static let uniformMatrix3fv: JSString = "uniformMatrix3fv" - static let uniformMatrix3x2fv: JSString = "uniformMatrix3x2fv" - static let uniformMatrix3x4fv: JSString = "uniformMatrix3x4fv" - static let uniformMatrix4fv: JSString = "uniformMatrix4fv" - static let uniformMatrix4x2fv: JSString = "uniformMatrix4x2fv" - static let uniformMatrix4x3fv: JSString = "uniformMatrix4x3fv" - static let unique: JSString = "unique" - static let unit: JSString = "unit" - static let unitExponent: JSString = "unitExponent" - static let unitFactorCurrentExponent: JSString = "unitFactorCurrentExponent" - static let unitFactorLengthExponent: JSString = "unitFactorLengthExponent" - static let unitFactorLuminousIntensityExponent: JSString = "unitFactorLuminousIntensityExponent" - static let unitFactorMassExponent: JSString = "unitFactorMassExponent" - static let unitFactorTemperatureExponent: JSString = "unitFactorTemperatureExponent" - static let unitFactorTimeExponent: JSString = "unitFactorTimeExponent" - static let unitSystem: JSString = "unitSystem" - static let unitType: JSString = "unitType" - static let unloadEventEnd: JSString = "unloadEventEnd" - static let unloadEventStart: JSString = "unloadEventStart" - static let unlock: JSString = "unlock" - static let unmap: JSString = "unmap" - static let unobserve: JSString = "unobserve" - static let unpauseAnimations: JSString = "unpauseAnimations" - static let unregister: JSString = "unregister" - static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" - static let unsubscribe: JSString = "unsubscribe" - static let unsuspendRedraw: JSString = "unsuspendRedraw" - static let unsuspendRedrawAll: JSString = "unsuspendRedrawAll" - static let unwrapKey: JSString = "unwrapKey" - static let upX: JSString = "upX" - static let upY: JSString = "upY" - static let upZ: JSString = "upZ" - static let update: JSString = "update" - static let updateCharacterBounds: JSString = "updateCharacterBounds" - static let updateControlBound: JSString = "updateControlBound" - static let updateCurrentEntry: JSString = "updateCurrentEntry" - static let updateInkTrailStartPoint: JSString = "updateInkTrailStartPoint" - static let updatePlaybackRate: JSString = "updatePlaybackRate" - static let updateRangeEnd: JSString = "updateRangeEnd" - static let updateRangeStart: JSString = "updateRangeStart" - static let updateRenderState: JSString = "updateRenderState" - static let updateSelection: JSString = "updateSelection" - static let updateSelectionBound: JSString = "updateSelectionBound" - static let updateTargetFrameRate: JSString = "updateTargetFrameRate" - static let updateText: JSString = "updateText" - static let updateTiming: JSString = "updateTiming" - static let updateUI: JSString = "updateUI" - static let updateViaCache: JSString = "updateViaCache" - static let updateWith: JSString = "updateWith" - static let updating: JSString = "updating" - static let upgrade: JSString = "upgrade" - static let upload: JSString = "upload" - static let uploadTotal: JSString = "uploadTotal" - static let uploaded: JSString = "uploaded" - static let upper: JSString = "upper" - static let upperBound: JSString = "upperBound" - static let upperOpen: JSString = "upperOpen" - static let upperVerticalAngle: JSString = "upperVerticalAngle" - static let uri: JSString = "uri" - static let url: JSString = "url" - static let urls: JSString = "urls" - static let usableWithDarkBackground: JSString = "usableWithDarkBackground" - static let usableWithLightBackground: JSString = "usableWithLightBackground" - static let usage: JSString = "usage" - static let usageMaximum: JSString = "usageMaximum" - static let usageMinimum: JSString = "usageMinimum" - static let usagePage: JSString = "usagePage" - static let usagePreference: JSString = "usagePreference" - static let usages: JSString = "usages" - static let usb: JSString = "usb" - static let usbProductId: JSString = "usbProductId" - static let usbVendorId: JSString = "usbVendorId" - static let usbVersionMajor: JSString = "usbVersionMajor" - static let usbVersionMinor: JSString = "usbVersionMinor" - static let usbVersionSubminor: JSString = "usbVersionSubminor" - static let use: JSString = "use" - static let useMap: JSString = "useMap" - static let useProgram: JSString = "useProgram" - static let user: JSString = "user" - static let userAgent: JSString = "userAgent" - static let userAgentData: JSString = "userAgentData" - static let userChoice: JSString = "userChoice" - static let userHandle: JSString = "userHandle" - static let userHint: JSString = "userHint" - static let userInitiated: JSString = "userInitiated" - static let userState: JSString = "userState" - static let userVerification: JSString = "userVerification" - static let userVisibleOnly: JSString = "userVisibleOnly" - static let username: JSString = "username" - static let usernameFragment: JSString = "usernameFragment" - static let usernameHint: JSString = "usernameHint" - static let usesDepthValues: JSString = "usesDepthValues" - static let utterance: JSString = "utterance" - static let uuid: JSString = "uuid" - static let uuids: JSString = "uuids" - static let uvm: JSString = "uvm" - static let vAlign: JSString = "vAlign" - static let vLink: JSString = "vLink" - static let valid: JSString = "valid" - static let validate: JSString = "validate" - static let validateAssertion: JSString = "validateAssertion" - static let validateProgram: JSString = "validateProgram" - static let validationMessage: JSString = "validationMessage" - static let validity: JSString = "validity" - static let value: JSString = "value" - static let valueAsDate: JSString = "valueAsDate" - static let valueAsNumber: JSString = "valueAsNumber" - static let valueAsString: JSString = "valueAsString" - static let valueInSpecifiedUnits: JSString = "valueInSpecifiedUnits" - static let valueMissing: JSString = "valueMissing" - static let valueOf: JSString = "valueOf" - static let valueType: JSString = "valueType" - static let values: JSString = "values" - static let variable: JSString = "variable" - static let variant: JSString = "variant" - static let variationSettings: JSString = "variationSettings" - static let variations: JSString = "variations" - static let vb: JSString = "vb" - static let vendor: JSString = "vendor" - static let vendorId: JSString = "vendorId" - static let vendorSub: JSString = "vendorSub" - static let verify: JSString = "verify" - static let version: JSString = "version" - static let vertex: JSString = "vertex" - static let vertexAttrib1f: JSString = "vertexAttrib1f" - static let vertexAttrib1fv: JSString = "vertexAttrib1fv" - static let vertexAttrib2f: JSString = "vertexAttrib2f" - static let vertexAttrib2fv: JSString = "vertexAttrib2fv" - static let vertexAttrib3f: JSString = "vertexAttrib3f" - static let vertexAttrib3fv: JSString = "vertexAttrib3fv" - static let vertexAttrib4f: JSString = "vertexAttrib4f" - static let vertexAttrib4fv: JSString = "vertexAttrib4fv" - static let vertexAttribDivisor: JSString = "vertexAttribDivisor" - static let vertexAttribDivisorANGLE: JSString = "vertexAttribDivisorANGLE" - static let vertexAttribI4i: JSString = "vertexAttribI4i" - static let vertexAttribI4iv: JSString = "vertexAttribI4iv" - static let vertexAttribI4ui: JSString = "vertexAttribI4ui" - static let vertexAttribI4uiv: JSString = "vertexAttribI4uiv" - static let vertexAttribIPointer: JSString = "vertexAttribIPointer" - static let vertexAttribPointer: JSString = "vertexAttribPointer" - static let vertical: JSString = "vertical" - static let vh: JSString = "vh" - static let vi: JSString = "vi" - static let vibrate: JSString = "vibrate" - static let video: JSString = "video" - static let videoBitsPerSecond: JSString = "videoBitsPerSecond" - static let videoCapabilities: JSString = "videoCapabilities" - static let videoHeight: JSString = "videoHeight" - static let videoTracks: JSString = "videoTracks" - static let videoWidth: JSString = "videoWidth" - static let view: JSString = "view" - static let viewBox: JSString = "viewBox" - static let viewDimension: JSString = "viewDimension" - static let viewFormats: JSString = "viewFormats" - static let viewPixelHeight: JSString = "viewPixelHeight" - static let viewPixelWidth: JSString = "viewPixelWidth" - static let viewport: JSString = "viewport" - static let viewportAnchorX: JSString = "viewportAnchorX" - static let viewportAnchorY: JSString = "viewportAnchorY" - static let viewportElement: JSString = "viewportElement" - static let views: JSString = "views" - static let violatedDirective: JSString = "violatedDirective" - static let violationSample: JSString = "violationSample" - static let violationType: JSString = "violationType" - static let violationURL: JSString = "violationURL" - static let virtualKeyboard: JSString = "virtualKeyboard" - static let virtualKeyboardPolicy: JSString = "virtualKeyboardPolicy" - static let visibility: JSString = "visibility" - static let visibilityState: JSString = "visibilityState" - static let visible: JSString = "visible" - static let visibleRect: JSString = "visibleRect" - static let visualViewport: JSString = "visualViewport" - static let vlinkColor: JSString = "vlinkColor" - static let vmax: JSString = "vmax" - static let vmin: JSString = "vmin" - static let voice: JSString = "voice" - static let voiceActivityFlag: JSString = "voiceActivityFlag" - static let voiceURI: JSString = "voiceURI" - static let volume: JSString = "volume" - static let vspace: JSString = "vspace" - static let vw: JSString = "vw" - static let w: JSString = "w" - static let waitSync: JSString = "waitSync" - static let waitUntil: JSString = "waitUntil" - static let waiting: JSString = "waiting" - static let wakeLock: JSString = "wakeLock" - static let warn: JSString = "warn" - static let wasClean: JSString = "wasClean" - static let wasDiscarded: JSString = "wasDiscarded" - static let watchAdvertisements: JSString = "watchAdvertisements" - static let watchingAdvertisements: JSString = "watchingAdvertisements" - static let webdriver: JSString = "webdriver" - static let webkitEntries: JSString = "webkitEntries" - static let webkitGetAsEntry: JSString = "webkitGetAsEntry" - static let webkitMatchesSelector: JSString = "webkitMatchesSelector" - static let webkitRelativePath: JSString = "webkitRelativePath" - static let webkitdirectory: JSString = "webkitdirectory" - static let weight: JSString = "weight" - static let whatToShow: JSString = "whatToShow" - static let which: JSString = "which" - static let whiteBalanceMode: JSString = "whiteBalanceMode" - static let wholeText: JSString = "wholeText" - static let width: JSString = "width" - static let willReadFrequently: JSString = "willReadFrequently" - static let willValidate: JSString = "willValidate" - static let window: JSString = "window" - static let windowControlsOverlay: JSString = "windowControlsOverlay" - static let windowDimensions: JSString = "windowDimensions" - static let withCredentials: JSString = "withCredentials" - static let wordSpacing: JSString = "wordSpacing" - static let workerStart: JSString = "workerStart" - static let wow64: JSString = "wow64" - static let wrap: JSString = "wrap" - static let wrapKey: JSString = "wrapKey" - static let writable: JSString = "writable" - static let writableAuxiliaries: JSString = "writableAuxiliaries" - static let writableType: JSString = "writableType" - static let write: JSString = "write" - static let writeBuffer: JSString = "writeBuffer" - static let writeMask: JSString = "writeMask" - static let writeText: JSString = "writeText" - static let writeTexture: JSString = "writeTexture" - static let writeTimestamp: JSString = "writeTimestamp" - static let writeValue: JSString = "writeValue" - static let writeValueWithResponse: JSString = "writeValueWithResponse" - static let writeValueWithoutResponse: JSString = "writeValueWithoutResponse" - static let writeWithoutResponse: JSString = "writeWithoutResponse" - static let writeln: JSString = "writeln" - static let written: JSString = "written" - static let x: JSString = "x" - static let x1: JSString = "x1" - static let x2: JSString = "x2" - static let xBias: JSString = "xBias" - static let xChannelSelector: JSString = "xChannelSelector" - static let xr: JSString = "xr" - static let xrCompatible: JSString = "xrCompatible" - static let y: JSString = "y" - static let y1: JSString = "y1" - static let y2: JSString = "y2" - static let yBias: JSString = "yBias" - static let yChannelSelector: JSString = "yChannelSelector" - static let z: JSString = "z" - static let zBias: JSString = "zBias" - static let zoom: JSString = "zoom" + @usableFromInline static let ANGLE_instanced_arrays: JSString = "ANGLE_instanced_arrays" + @usableFromInline static let AbortController: JSString = "AbortController" + @usableFromInline static let AbortSignal: JSString = "AbortSignal" + @usableFromInline static let AbsoluteOrientationSensor: JSString = "AbsoluteOrientationSensor" + @usableFromInline static let AbstractRange: JSString = "AbstractRange" + @usableFromInline static let Accelerometer: JSString = "Accelerometer" + @usableFromInline static let AddSearchProvider: JSString = "AddSearchProvider" + @usableFromInline static let AmbientLightSensor: JSString = "AmbientLightSensor" + @usableFromInline static let AnalyserNode: JSString = "AnalyserNode" + @usableFromInline static let Animation: JSString = "Animation" + @usableFromInline static let AnimationEffect: JSString = "AnimationEffect" + @usableFromInline static let AnimationEvent: JSString = "AnimationEvent" + @usableFromInline static let AnimationNodeList: JSString = "AnimationNodeList" + @usableFromInline static let AnimationPlaybackEvent: JSString = "AnimationPlaybackEvent" + @usableFromInline static let AnimationTimeline: JSString = "AnimationTimeline" + @usableFromInline static let AnimationWorkletGlobalScope: JSString = "AnimationWorkletGlobalScope" + @usableFromInline static let Attr: JSString = "Attr" + @usableFromInline static let AttributionReporting: JSString = "AttributionReporting" + @usableFromInline static let AudioBuffer: JSString = "AudioBuffer" + @usableFromInline static let AudioBufferSourceNode: JSString = "AudioBufferSourceNode" + @usableFromInline static let AudioContext: JSString = "AudioContext" + @usableFromInline static let AudioData: JSString = "AudioData" + @usableFromInline static let AudioDecoder: JSString = "AudioDecoder" + @usableFromInline static let AudioDestinationNode: JSString = "AudioDestinationNode" + @usableFromInline static let AudioEncoder: JSString = "AudioEncoder" + @usableFromInline static let AudioListener: JSString = "AudioListener" + @usableFromInline static let AudioNode: JSString = "AudioNode" + @usableFromInline static let AudioParam: JSString = "AudioParam" + @usableFromInline static let AudioParamMap: JSString = "AudioParamMap" + @usableFromInline static let AudioProcessingEvent: JSString = "AudioProcessingEvent" + @usableFromInline static let AudioScheduledSourceNode: JSString = "AudioScheduledSourceNode" + @usableFromInline static let AudioTrack: JSString = "AudioTrack" + @usableFromInline static let AudioTrackList: JSString = "AudioTrackList" + @usableFromInline static let AudioWorklet: JSString = "AudioWorklet" + @usableFromInline static let AudioWorkletGlobalScope: JSString = "AudioWorkletGlobalScope" + @usableFromInline static let AudioWorkletNode: JSString = "AudioWorkletNode" + @usableFromInline static let AudioWorkletProcessor: JSString = "AudioWorkletProcessor" + @usableFromInline static let AuthenticatorAssertionResponse: JSString = "AuthenticatorAssertionResponse" + @usableFromInline static let AuthenticatorAttestationResponse: JSString = "AuthenticatorAttestationResponse" + @usableFromInline static let AuthenticatorResponse: JSString = "AuthenticatorResponse" + @usableFromInline static let BackgroundFetchEvent: JSString = "BackgroundFetchEvent" + @usableFromInline static let BackgroundFetchManager: JSString = "BackgroundFetchManager" + @usableFromInline static let BackgroundFetchRecord: JSString = "BackgroundFetchRecord" + @usableFromInline static let BackgroundFetchRegistration: JSString = "BackgroundFetchRegistration" + @usableFromInline static let BackgroundFetchUpdateUIEvent: JSString = "BackgroundFetchUpdateUIEvent" + @usableFromInline static let BarProp: JSString = "BarProp" + @usableFromInline static let BarcodeDetector: JSString = "BarcodeDetector" + @usableFromInline static let BaseAudioContext: JSString = "BaseAudioContext" + @usableFromInline static let Baseline: JSString = "Baseline" + @usableFromInline static let BatteryManager: JSString = "BatteryManager" + @usableFromInline static let BeforeInstallPromptEvent: JSString = "BeforeInstallPromptEvent" + @usableFromInline static let BeforeUnloadEvent: JSString = "BeforeUnloadEvent" + @usableFromInline static let BiquadFilterNode: JSString = "BiquadFilterNode" + @usableFromInline static let Blob: JSString = "Blob" + @usableFromInline static let BlobEvent: JSString = "BlobEvent" + @usableFromInline static let Bluetooth: JSString = "Bluetooth" + @usableFromInline static let BluetoothAdvertisingEvent: JSString = "BluetoothAdvertisingEvent" + @usableFromInline static let BluetoothCharacteristicProperties: JSString = "BluetoothCharacteristicProperties" + @usableFromInline static let BluetoothDevice: JSString = "BluetoothDevice" + @usableFromInline static let BluetoothManufacturerDataMap: JSString = "BluetoothManufacturerDataMap" + @usableFromInline static let BluetoothPermissionResult: JSString = "BluetoothPermissionResult" + @usableFromInline static let BluetoothRemoteGATTCharacteristic: JSString = "BluetoothRemoteGATTCharacteristic" + @usableFromInline static let BluetoothRemoteGATTDescriptor: JSString = "BluetoothRemoteGATTDescriptor" + @usableFromInline static let BluetoothRemoteGATTServer: JSString = "BluetoothRemoteGATTServer" + @usableFromInline static let BluetoothRemoteGATTService: JSString = "BluetoothRemoteGATTService" + @usableFromInline static let BluetoothServiceDataMap: JSString = "BluetoothServiceDataMap" + @usableFromInline static let BluetoothUUID: JSString = "BluetoothUUID" + @usableFromInline static let BreakToken: JSString = "BreakToken" + @usableFromInline static let BroadcastChannel: JSString = "BroadcastChannel" + @usableFromInline static let BrowserCaptureMediaStreamTrack: JSString = "BrowserCaptureMediaStreamTrack" + @usableFromInline static let ByteLengthQueuingStrategy: JSString = "ByteLengthQueuingStrategy" + @usableFromInline static let CDATASection: JSString = "CDATASection" + @usableFromInline static let CSPViolationReportBody: JSString = "CSPViolationReportBody" + @usableFromInline static let CSS: JSString = "CSS" + @usableFromInline static let CSSAnimation: JSString = "CSSAnimation" + @usableFromInline static let CSSColor: JSString = "CSSColor" + @usableFromInline static let CSSColorValue: JSString = "CSSColorValue" + @usableFromInline static let CSSConditionRule: JSString = "CSSConditionRule" + @usableFromInline static let CSSContainerRule: JSString = "CSSContainerRule" + @usableFromInline static let CSSCounterStyleRule: JSString = "CSSCounterStyleRule" + @usableFromInline static let CSSFontFaceRule: JSString = "CSSFontFaceRule" + @usableFromInline static let CSSFontFeatureValuesMap: JSString = "CSSFontFeatureValuesMap" + @usableFromInline static let CSSFontFeatureValuesRule: JSString = "CSSFontFeatureValuesRule" + @usableFromInline static let CSSFontPaletteValuesRule: JSString = "CSSFontPaletteValuesRule" + @usableFromInline static let CSSGroupingRule: JSString = "CSSGroupingRule" + @usableFromInline static let CSSHSL: JSString = "CSSHSL" + @usableFromInline static let CSSHWB: JSString = "CSSHWB" + @usableFromInline static let CSSImageValue: JSString = "CSSImageValue" + @usableFromInline static let CSSImportRule: JSString = "CSSImportRule" + @usableFromInline static let CSSKeyframeRule: JSString = "CSSKeyframeRule" + @usableFromInline static let CSSKeyframesRule: JSString = "CSSKeyframesRule" + @usableFromInline static let CSSKeywordValue: JSString = "CSSKeywordValue" + @usableFromInline static let CSSLCH: JSString = "CSSLCH" + @usableFromInline static let CSSLab: JSString = "CSSLab" + @usableFromInline static let CSSLayerBlockRule: JSString = "CSSLayerBlockRule" + @usableFromInline static let CSSLayerStatementRule: JSString = "CSSLayerStatementRule" + @usableFromInline static let CSSMarginRule: JSString = "CSSMarginRule" + @usableFromInline static let CSSMathClamp: JSString = "CSSMathClamp" + @usableFromInline static let CSSMathInvert: JSString = "CSSMathInvert" + @usableFromInline static let CSSMathMax: JSString = "CSSMathMax" + @usableFromInline static let CSSMathMin: JSString = "CSSMathMin" + @usableFromInline static let CSSMathNegate: JSString = "CSSMathNegate" + @usableFromInline static let CSSMathProduct: JSString = "CSSMathProduct" + @usableFromInline static let CSSMathSum: JSString = "CSSMathSum" + @usableFromInline static let CSSMathValue: JSString = "CSSMathValue" + @usableFromInline static let CSSMatrixComponent: JSString = "CSSMatrixComponent" + @usableFromInline static let CSSMediaRule: JSString = "CSSMediaRule" + @usableFromInline static let CSSNamespaceRule: JSString = "CSSNamespaceRule" + @usableFromInline static let CSSNestingRule: JSString = "CSSNestingRule" + @usableFromInline static let CSSNumericArray: JSString = "CSSNumericArray" + @usableFromInline static let CSSNumericValue: JSString = "CSSNumericValue" + @usableFromInline static let CSSOKLCH: JSString = "CSSOKLCH" + @usableFromInline static let CSSOKLab: JSString = "CSSOKLab" + @usableFromInline static let CSSPageRule: JSString = "CSSPageRule" + @usableFromInline static let CSSParserAtRule: JSString = "CSSParserAtRule" + @usableFromInline static let CSSParserBlock: JSString = "CSSParserBlock" + @usableFromInline static let CSSParserDeclaration: JSString = "CSSParserDeclaration" + @usableFromInline static let CSSParserFunction: JSString = "CSSParserFunction" + @usableFromInline static let CSSParserQualifiedRule: JSString = "CSSParserQualifiedRule" + @usableFromInline static let CSSParserRule: JSString = "CSSParserRule" + @usableFromInline static let CSSParserValue: JSString = "CSSParserValue" + @usableFromInline static let CSSPerspective: JSString = "CSSPerspective" + @usableFromInline static let CSSPropertyRule: JSString = "CSSPropertyRule" + @usableFromInline static let CSSPseudoElement: JSString = "CSSPseudoElement" + @usableFromInline static let CSSRGB: JSString = "CSSRGB" + @usableFromInline static let CSSRotate: JSString = "CSSRotate" + @usableFromInline static let CSSRule: JSString = "CSSRule" + @usableFromInline static let CSSRuleList: JSString = "CSSRuleList" + @usableFromInline static let CSSScale: JSString = "CSSScale" + @usableFromInline static let CSSScrollTimelineRule: JSString = "CSSScrollTimelineRule" + @usableFromInline static let CSSSkew: JSString = "CSSSkew" + @usableFromInline static let CSSSkewX: JSString = "CSSSkewX" + @usableFromInline static let CSSSkewY: JSString = "CSSSkewY" + @usableFromInline static let CSSStyleDeclaration: JSString = "CSSStyleDeclaration" + @usableFromInline static let CSSStyleRule: JSString = "CSSStyleRule" + @usableFromInline static let CSSStyleSheet: JSString = "CSSStyleSheet" + @usableFromInline static let CSSStyleValue: JSString = "CSSStyleValue" + @usableFromInline static let CSSSupportsRule: JSString = "CSSSupportsRule" + @usableFromInline static let CSSTransformComponent: JSString = "CSSTransformComponent" + @usableFromInline static let CSSTransformValue: JSString = "CSSTransformValue" + @usableFromInline static let CSSTransition: JSString = "CSSTransition" + @usableFromInline static let CSSTranslate: JSString = "CSSTranslate" + @usableFromInline static let CSSUnitValue: JSString = "CSSUnitValue" + @usableFromInline static let CSSUnparsedValue: JSString = "CSSUnparsedValue" + @usableFromInline static let CSSVariableReferenceValue: JSString = "CSSVariableReferenceValue" + @usableFromInline static let CSSViewportRule: JSString = "CSSViewportRule" + @usableFromInline static let Cache: JSString = "Cache" + @usableFromInline static let CacheStorage: JSString = "CacheStorage" + @usableFromInline static let CanMakePaymentEvent: JSString = "CanMakePaymentEvent" + @usableFromInline static let CanvasCaptureMediaStreamTrack: JSString = "CanvasCaptureMediaStreamTrack" + @usableFromInline static let CanvasFilter: JSString = "CanvasFilter" + @usableFromInline static let CanvasGradient: JSString = "CanvasGradient" + @usableFromInline static let CanvasPattern: JSString = "CanvasPattern" + @usableFromInline static let CanvasRenderingContext2D: JSString = "CanvasRenderingContext2D" + @usableFromInline static let CaretPosition: JSString = "CaretPosition" + @usableFromInline static let ChannelMergerNode: JSString = "ChannelMergerNode" + @usableFromInline static let ChannelSplitterNode: JSString = "ChannelSplitterNode" + @usableFromInline static let CharacterBoundsUpdateEvent: JSString = "CharacterBoundsUpdateEvent" + @usableFromInline static let CharacterData: JSString = "CharacterData" + @usableFromInline static let ChildBreakToken: JSString = "ChildBreakToken" + @usableFromInline static let Client: JSString = "Client" + @usableFromInline static let Clients: JSString = "Clients" + @usableFromInline static let Clipboard: JSString = "Clipboard" + @usableFromInline static let ClipboardEvent: JSString = "ClipboardEvent" + @usableFromInline static let ClipboardItem: JSString = "ClipboardItem" + @usableFromInline static let CloseEvent: JSString = "CloseEvent" + @usableFromInline static let CloseWatcher: JSString = "CloseWatcher" + @usableFromInline static let Comment: JSString = "Comment" + @usableFromInline static let CompositionEvent: JSString = "CompositionEvent" + @usableFromInline static let CompressionStream: JSString = "CompressionStream" + @usableFromInline static let ComputePressureObserver: JSString = "ComputePressureObserver" + @usableFromInline static let ConstantSourceNode: JSString = "ConstantSourceNode" + @usableFromInline static let ContactAddress: JSString = "ContactAddress" + @usableFromInline static let ContactsManager: JSString = "ContactsManager" + @usableFromInline static let ContentIndex: JSString = "ContentIndex" + @usableFromInline static let ContentIndexEvent: JSString = "ContentIndexEvent" + @usableFromInline static let ConvolverNode: JSString = "ConvolverNode" + @usableFromInline static let CookieChangeEvent: JSString = "CookieChangeEvent" + @usableFromInline static let CookieStore: JSString = "CookieStore" + @usableFromInline static let CookieStoreManager: JSString = "CookieStoreManager" + @usableFromInline static let CountQueuingStrategy: JSString = "CountQueuingStrategy" + @usableFromInline static let CrashReportBody: JSString = "CrashReportBody" + @usableFromInline static let Credential: JSString = "Credential" + @usableFromInline static let CredentialsContainer: JSString = "CredentialsContainer" + @usableFromInline static let CropTarget: JSString = "CropTarget" + @usableFromInline static let Crypto: JSString = "Crypto" + @usableFromInline static let CryptoKey: JSString = "CryptoKey" + @usableFromInline static let CustomElementRegistry: JSString = "CustomElementRegistry" + @usableFromInline static let CustomEvent: JSString = "CustomEvent" + @usableFromInline static let CustomStateSet: JSString = "CustomStateSet" + @usableFromInline static let DOMException: JSString = "DOMException" + @usableFromInline static let DOMImplementation: JSString = "DOMImplementation" + @usableFromInline static let DOMMatrix: JSString = "DOMMatrix" + @usableFromInline static let DOMMatrixReadOnly: JSString = "DOMMatrixReadOnly" + @usableFromInline static let DOMParser: JSString = "DOMParser" + @usableFromInline static let DOMPoint: JSString = "DOMPoint" + @usableFromInline static let DOMPointReadOnly: JSString = "DOMPointReadOnly" + @usableFromInline static let DOMQuad: JSString = "DOMQuad" + @usableFromInline static let DOMRect: JSString = "DOMRect" + @usableFromInline static let DOMRectList: JSString = "DOMRectList" + @usableFromInline static let DOMRectReadOnly: JSString = "DOMRectReadOnly" + @usableFromInline static let DOMStringList: JSString = "DOMStringList" + @usableFromInline static let DOMStringMap: JSString = "DOMStringMap" + @usableFromInline static let DOMTokenList: JSString = "DOMTokenList" + @usableFromInline static let DataCue: JSString = "DataCue" + @usableFromInline static let DataTransfer: JSString = "DataTransfer" + @usableFromInline static let DataTransferItem: JSString = "DataTransferItem" + @usableFromInline static let DataTransferItemList: JSString = "DataTransferItemList" + @usableFromInline static let DecompressionStream: JSString = "DecompressionStream" + @usableFromInline static let DedicatedWorkerGlobalScope: JSString = "DedicatedWorkerGlobalScope" + @usableFromInline static let DelayNode: JSString = "DelayNode" + @usableFromInline static let DeprecationReportBody: JSString = "DeprecationReportBody" + @usableFromInline static let DeviceMotionEvent: JSString = "DeviceMotionEvent" + @usableFromInline static let DeviceMotionEventAcceleration: JSString = "DeviceMotionEventAcceleration" + @usableFromInline static let DeviceMotionEventRotationRate: JSString = "DeviceMotionEventRotationRate" + @usableFromInline static let DeviceOrientationEvent: JSString = "DeviceOrientationEvent" + @usableFromInline static let DevicePosture: JSString = "DevicePosture" + @usableFromInline static let DigitalGoodsService: JSString = "DigitalGoodsService" + @usableFromInline static let Document: JSString = "Document" + @usableFromInline static let DocumentFragment: JSString = "DocumentFragment" + @usableFromInline static let DocumentTimeline: JSString = "DocumentTimeline" + @usableFromInline static let DocumentType: JSString = "DocumentType" + @usableFromInline static let DragEvent: JSString = "DragEvent" + @usableFromInline static let DynamicsCompressorNode: JSString = "DynamicsCompressorNode" + @usableFromInline static let EXT_blend_minmax: JSString = "EXT_blend_minmax" + @usableFromInline static let EXT_clip_cull_distance: JSString = "EXT_clip_cull_distance" + @usableFromInline static let EXT_color_buffer_float: JSString = "EXT_color_buffer_float" + @usableFromInline static let EXT_color_buffer_half_float: JSString = "EXT_color_buffer_half_float" + @usableFromInline static let EXT_disjoint_timer_query: JSString = "EXT_disjoint_timer_query" + @usableFromInline static let EXT_disjoint_timer_query_webgl2: JSString = "EXT_disjoint_timer_query_webgl2" + @usableFromInline static let EXT_float_blend: JSString = "EXT_float_blend" + @usableFromInline static let EXT_frag_depth: JSString = "EXT_frag_depth" + @usableFromInline static let EXT_sRGB: JSString = "EXT_sRGB" + @usableFromInline static let EXT_shader_texture_lod: JSString = "EXT_shader_texture_lod" + @usableFromInline static let EXT_texture_compression_bptc: JSString = "EXT_texture_compression_bptc" + @usableFromInline static let EXT_texture_compression_rgtc: JSString = "EXT_texture_compression_rgtc" + @usableFromInline static let EXT_texture_filter_anisotropic: JSString = "EXT_texture_filter_anisotropic" + @usableFromInline static let EXT_texture_norm16: JSString = "EXT_texture_norm16" + @usableFromInline static let EditContext: JSString = "EditContext" + @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 EventCounts: JSString = "EventCounts" + @usableFromInline static let EventSource: JSString = "EventSource" + @usableFromInline static let EventTarget: JSString = "EventTarget" + @usableFromInline static let ExtendableCookieChangeEvent: JSString = "ExtendableCookieChangeEvent" + @usableFromInline static let ExtendableEvent: JSString = "ExtendableEvent" + @usableFromInline static let ExtendableMessageEvent: JSString = "ExtendableMessageEvent" + @usableFromInline static let External: JSString = "External" + @usableFromInline static let EyeDropper: JSString = "EyeDropper" + @usableFromInline static let FaceDetector: JSString = "FaceDetector" + @usableFromInline static let FederatedCredential: JSString = "FederatedCredential" + @usableFromInline static let FetchEvent: JSString = "FetchEvent" + @usableFromInline static let File: JSString = "File" + @usableFromInline static let FileList: JSString = "FileList" + @usableFromInline static let FileReader: JSString = "FileReader" + @usableFromInline static let FileReaderSync: JSString = "FileReaderSync" + @usableFromInline static let FileSystem: JSString = "FileSystem" + @usableFromInline static let FileSystemDirectoryEntry: JSString = "FileSystemDirectoryEntry" + @usableFromInline static let FileSystemDirectoryHandle: JSString = "FileSystemDirectoryHandle" + @usableFromInline static let FileSystemDirectoryReader: JSString = "FileSystemDirectoryReader" + @usableFromInline static let FileSystemEntry: JSString = "FileSystemEntry" + @usableFromInline static let FileSystemFileEntry: JSString = "FileSystemFileEntry" + @usableFromInline static let FileSystemFileHandle: JSString = "FileSystemFileHandle" + @usableFromInline static let FileSystemHandle: JSString = "FileSystemHandle" + @usableFromInline static let FileSystemWritableFileStream: JSString = "FileSystemWritableFileStream" + @usableFromInline static let FocusEvent: JSString = "FocusEvent" + @usableFromInline static let Font: JSString = "Font" + @usableFromInline static let FontFace: JSString = "FontFace" + @usableFromInline static let FontFaceFeatures: JSString = "FontFaceFeatures" + @usableFromInline static let FontFacePalette: JSString = "FontFacePalette" + @usableFromInline static let FontFacePalettes: JSString = "FontFacePalettes" + @usableFromInline static let FontFaceSet: JSString = "FontFaceSet" + @usableFromInline static let FontFaceSetLoadEvent: JSString = "FontFaceSetLoadEvent" + @usableFromInline static let FontFaceVariationAxis: JSString = "FontFaceVariationAxis" + @usableFromInline static let FontFaceVariations: JSString = "FontFaceVariations" + @usableFromInline static let FontManager: JSString = "FontManager" + @usableFromInline static let FontMetadata: JSString = "FontMetadata" + @usableFromInline static let FontMetrics: JSString = "FontMetrics" + @usableFromInline static let FormData: JSString = "FormData" + @usableFromInline static let FormDataEvent: JSString = "FormDataEvent" + @usableFromInline static let FragmentDirective: JSString = "FragmentDirective" + @usableFromInline static let FragmentResult: JSString = "FragmentResult" + @usableFromInline static let GPU: JSString = "GPU" + @usableFromInline static let GPUAdapter: JSString = "GPUAdapter" + @usableFromInline static let GPUBindGroup: JSString = "GPUBindGroup" + @usableFromInline static let GPUBindGroupLayout: JSString = "GPUBindGroupLayout" + @usableFromInline static let GPUBuffer: JSString = "GPUBuffer" + @usableFromInline static let GPUBufferUsage: JSString = "GPUBufferUsage" + @usableFromInline static let GPUCanvasContext: JSString = "GPUCanvasContext" + @usableFromInline static let GPUColorWrite: JSString = "GPUColorWrite" + @usableFromInline static let GPUCommandBuffer: JSString = "GPUCommandBuffer" + @usableFromInline static let GPUCommandEncoder: JSString = "GPUCommandEncoder" + @usableFromInline static let GPUCompilationInfo: JSString = "GPUCompilationInfo" + @usableFromInline static let GPUCompilationMessage: JSString = "GPUCompilationMessage" + @usableFromInline static let GPUComputePassEncoder: JSString = "GPUComputePassEncoder" + @usableFromInline static let GPUComputePipeline: JSString = "GPUComputePipeline" + @usableFromInline static let GPUDevice: JSString = "GPUDevice" + @usableFromInline static let GPUDeviceLostInfo: JSString = "GPUDeviceLostInfo" + @usableFromInline static let GPUExternalTexture: JSString = "GPUExternalTexture" + @usableFromInline static let GPUMapMode: JSString = "GPUMapMode" + @usableFromInline static let GPUOutOfMemoryError: JSString = "GPUOutOfMemoryError" + @usableFromInline static let GPUPipelineLayout: JSString = "GPUPipelineLayout" + @usableFromInline static let GPUQuerySet: JSString = "GPUQuerySet" + @usableFromInline static let GPUQueue: JSString = "GPUQueue" + @usableFromInline static let GPURenderBundle: JSString = "GPURenderBundle" + @usableFromInline static let GPURenderBundleEncoder: JSString = "GPURenderBundleEncoder" + @usableFromInline static let GPURenderPassEncoder: JSString = "GPURenderPassEncoder" + @usableFromInline static let GPURenderPipeline: JSString = "GPURenderPipeline" + @usableFromInline static let GPUSampler: JSString = "GPUSampler" + @usableFromInline static let GPUShaderModule: JSString = "GPUShaderModule" + @usableFromInline static let GPUShaderStage: JSString = "GPUShaderStage" + @usableFromInline static let GPUSupportedFeatures: JSString = "GPUSupportedFeatures" + @usableFromInline static let GPUSupportedLimits: JSString = "GPUSupportedLimits" + @usableFromInline static let GPUTexture: JSString = "GPUTexture" + @usableFromInline static let GPUTextureUsage: JSString = "GPUTextureUsage" + @usableFromInline static let GPUTextureView: JSString = "GPUTextureView" + @usableFromInline static let GPUUncapturedErrorEvent: JSString = "GPUUncapturedErrorEvent" + @usableFromInline static let GPUValidationError: JSString = "GPUValidationError" + @usableFromInline static let GainNode: JSString = "GainNode" + @usableFromInline static let Gamepad: JSString = "Gamepad" + @usableFromInline static let GamepadButton: JSString = "GamepadButton" + @usableFromInline static let GamepadEvent: JSString = "GamepadEvent" + @usableFromInline static let GamepadHapticActuator: JSString = "GamepadHapticActuator" + @usableFromInline static let GamepadPose: JSString = "GamepadPose" + @usableFromInline static let GamepadTouch: JSString = "GamepadTouch" + @usableFromInline static let Geolocation: JSString = "Geolocation" + @usableFromInline static let GeolocationCoordinates: JSString = "GeolocationCoordinates" + @usableFromInline static let GeolocationPosition: JSString = "GeolocationPosition" + @usableFromInline static let GeolocationPositionError: JSString = "GeolocationPositionError" + @usableFromInline static let GeolocationSensor: JSString = "GeolocationSensor" + @usableFromInline static let Global: JSString = "Global" + @usableFromInline static let GravitySensor: JSString = "GravitySensor" + @usableFromInline static let GroupEffect: JSString = "GroupEffect" + @usableFromInline static let Gyroscope: JSString = "Gyroscope" + @usableFromInline static let HID: JSString = "HID" + @usableFromInline static let HIDConnectionEvent: JSString = "HIDConnectionEvent" + @usableFromInline static let HIDDevice: JSString = "HIDDevice" + @usableFromInline static let HIDInputReportEvent: JSString = "HIDInputReportEvent" + @usableFromInline static let HTMLAllCollection: JSString = "HTMLAllCollection" + @usableFromInline static let HTMLAnchorElement: JSString = "HTMLAnchorElement" + @usableFromInline static let HTMLAreaElement: JSString = "HTMLAreaElement" + @usableFromInline static let HTMLAudioElement: JSString = "HTMLAudioElement" + @usableFromInline static let HTMLBRElement: JSString = "HTMLBRElement" + @usableFromInline static let HTMLBaseElement: JSString = "HTMLBaseElement" + @usableFromInline static let HTMLBodyElement: JSString = "HTMLBodyElement" + @usableFromInline static let HTMLButtonElement: JSString = "HTMLButtonElement" + @usableFromInline static let HTMLCanvasElement: JSString = "HTMLCanvasElement" + @usableFromInline static let HTMLCollection: JSString = "HTMLCollection" + @usableFromInline static let HTMLDListElement: JSString = "HTMLDListElement" + @usableFromInline static let HTMLDataElement: JSString = "HTMLDataElement" + @usableFromInline static let HTMLDataListElement: JSString = "HTMLDataListElement" + @usableFromInline static let HTMLDetailsElement: JSString = "HTMLDetailsElement" + @usableFromInline static let HTMLDialogElement: JSString = "HTMLDialogElement" + @usableFromInline static let HTMLDirectoryElement: JSString = "HTMLDirectoryElement" + @usableFromInline static let HTMLDivElement: JSString = "HTMLDivElement" + @usableFromInline static let HTMLElement: JSString = "HTMLElement" + @usableFromInline static let HTMLEmbedElement: JSString = "HTMLEmbedElement" + @usableFromInline static let HTMLFieldSetElement: JSString = "HTMLFieldSetElement" + @usableFromInline static let HTMLFontElement: JSString = "HTMLFontElement" + @usableFromInline static let HTMLFormControlsCollection: JSString = "HTMLFormControlsCollection" + @usableFromInline static let HTMLFormElement: JSString = "HTMLFormElement" + @usableFromInline static let HTMLFrameElement: JSString = "HTMLFrameElement" + @usableFromInline static let HTMLFrameSetElement: JSString = "HTMLFrameSetElement" + @usableFromInline static let HTMLHRElement: JSString = "HTMLHRElement" + @usableFromInline static let HTMLHeadElement: JSString = "HTMLHeadElement" + @usableFromInline static let HTMLHeadingElement: JSString = "HTMLHeadingElement" + @usableFromInline static let HTMLHtmlElement: JSString = "HTMLHtmlElement" + @usableFromInline static let HTMLIFrameElement: JSString = "HTMLIFrameElement" + @usableFromInline static let HTMLImageElement: JSString = "HTMLImageElement" + @usableFromInline static let HTMLInputElement: JSString = "HTMLInputElement" + @usableFromInline static let HTMLLIElement: JSString = "HTMLLIElement" + @usableFromInline static let HTMLLabelElement: JSString = "HTMLLabelElement" + @usableFromInline static let HTMLLegendElement: JSString = "HTMLLegendElement" + @usableFromInline static let HTMLLinkElement: JSString = "HTMLLinkElement" + @usableFromInline static let HTMLMapElement: JSString = "HTMLMapElement" + @usableFromInline static let HTMLMarqueeElement: JSString = "HTMLMarqueeElement" + @usableFromInline static let HTMLMediaElement: JSString = "HTMLMediaElement" + @usableFromInline static let HTMLMenuElement: JSString = "HTMLMenuElement" + @usableFromInline static let HTMLMetaElement: JSString = "HTMLMetaElement" + @usableFromInline static let HTMLMeterElement: JSString = "HTMLMeterElement" + @usableFromInline static let HTMLModElement: JSString = "HTMLModElement" + @usableFromInline static let HTMLOListElement: JSString = "HTMLOListElement" + @usableFromInline static let HTMLObjectElement: JSString = "HTMLObjectElement" + @usableFromInline static let HTMLOptGroupElement: JSString = "HTMLOptGroupElement" + @usableFromInline static let HTMLOptionElement: JSString = "HTMLOptionElement" + @usableFromInline static let HTMLOptionsCollection: JSString = "HTMLOptionsCollection" + @usableFromInline static let HTMLOutputElement: JSString = "HTMLOutputElement" + @usableFromInline static let HTMLParagraphElement: JSString = "HTMLParagraphElement" + @usableFromInline static let HTMLParamElement: JSString = "HTMLParamElement" + @usableFromInline static let HTMLPictureElement: JSString = "HTMLPictureElement" + @usableFromInline static let HTMLPortalElement: JSString = "HTMLPortalElement" + @usableFromInline static let HTMLPreElement: JSString = "HTMLPreElement" + @usableFromInline static let HTMLProgressElement: JSString = "HTMLProgressElement" + @usableFromInline static let HTMLQuoteElement: JSString = "HTMLQuoteElement" + @usableFromInline static let HTMLScriptElement: JSString = "HTMLScriptElement" + @usableFromInline static let HTMLSelectElement: JSString = "HTMLSelectElement" + @usableFromInline static let HTMLSlotElement: JSString = "HTMLSlotElement" + @usableFromInline static let HTMLSourceElement: JSString = "HTMLSourceElement" + @usableFromInline static let HTMLSpanElement: JSString = "HTMLSpanElement" + @usableFromInline static let HTMLStyleElement: JSString = "HTMLStyleElement" + @usableFromInline static let HTMLTableCaptionElement: JSString = "HTMLTableCaptionElement" + @usableFromInline static let HTMLTableCellElement: JSString = "HTMLTableCellElement" + @usableFromInline static let HTMLTableColElement: JSString = "HTMLTableColElement" + @usableFromInline static let HTMLTableElement: JSString = "HTMLTableElement" + @usableFromInline static let HTMLTableRowElement: JSString = "HTMLTableRowElement" + @usableFromInline static let HTMLTableSectionElement: JSString = "HTMLTableSectionElement" + @usableFromInline static let HTMLTemplateElement: JSString = "HTMLTemplateElement" + @usableFromInline static let HTMLTextAreaElement: JSString = "HTMLTextAreaElement" + @usableFromInline static let HTMLTimeElement: JSString = "HTMLTimeElement" + @usableFromInline static let HTMLTitleElement: JSString = "HTMLTitleElement" + @usableFromInline static let HTMLTrackElement: JSString = "HTMLTrackElement" + @usableFromInline static let HTMLUListElement: JSString = "HTMLUListElement" + @usableFromInline static let HTMLUnknownElement: JSString = "HTMLUnknownElement" + @usableFromInline static let HTMLVideoElement: JSString = "HTMLVideoElement" + @usableFromInline static let HashChangeEvent: JSString = "HashChangeEvent" + @usableFromInline static let Headers: JSString = "Headers" + @usableFromInline static let Highlight: JSString = "Highlight" + @usableFromInline static let HighlightRegistry: JSString = "HighlightRegistry" + @usableFromInline static let History: JSString = "History" + @usableFromInline static let Hz: JSString = "Hz" + @usableFromInline static let IDBCursor: JSString = "IDBCursor" + @usableFromInline static let IDBCursorWithValue: JSString = "IDBCursorWithValue" + @usableFromInline static let IDBDatabase: JSString = "IDBDatabase" + @usableFromInline static let IDBFactory: JSString = "IDBFactory" + @usableFromInline static let IDBIndex: JSString = "IDBIndex" + @usableFromInline static let IDBKeyRange: JSString = "IDBKeyRange" + @usableFromInline static let IDBObjectStore: JSString = "IDBObjectStore" + @usableFromInline static let IDBOpenDBRequest: JSString = "IDBOpenDBRequest" + @usableFromInline static let IDBRequest: JSString = "IDBRequest" + @usableFromInline static let IDBTransaction: JSString = "IDBTransaction" + @usableFromInline static let IDBVersionChangeEvent: JSString = "IDBVersionChangeEvent" + @usableFromInline static let IIRFilterNode: JSString = "IIRFilterNode" + @usableFromInline static let IdleDeadline: JSString = "IdleDeadline" + @usableFromInline static let IdleDetector: JSString = "IdleDetector" + @usableFromInline static let ImageBitmap: JSString = "ImageBitmap" + @usableFromInline static let ImageBitmapRenderingContext: JSString = "ImageBitmapRenderingContext" + @usableFromInline static let ImageCapture: JSString = "ImageCapture" + @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 Ink: JSString = "Ink" + @usableFromInline static let InkPresenter: JSString = "InkPresenter" + @usableFromInline static let InputDeviceCapabilities: JSString = "InputDeviceCapabilities" + @usableFromInline static let InputDeviceInfo: JSString = "InputDeviceInfo" + @usableFromInline static let InputEvent: JSString = "InputEvent" + @usableFromInline static let Instance: JSString = "Instance" + @usableFromInline static let InteractionCounts: JSString = "InteractionCounts" + @usableFromInline static let IntersectionObserver: JSString = "IntersectionObserver" + @usableFromInline static let IntersectionObserverEntry: JSString = "IntersectionObserverEntry" + @usableFromInline static let InterventionReportBody: JSString = "InterventionReportBody" + @usableFromInline static let IntrinsicSizes: JSString = "IntrinsicSizes" + @usableFromInline static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" + @usableFromInline static let KHR_parallel_shader_compile: JSString = "KHR_parallel_shader_compile" + @usableFromInline static let Keyboard: JSString = "Keyboard" + @usableFromInline static let KeyboardEvent: JSString = "KeyboardEvent" + @usableFromInline static let KeyboardLayoutMap: JSString = "KeyboardLayoutMap" + @usableFromInline static let KeyframeEffect: JSString = "KeyframeEffect" + @usableFromInline static let LargestContentfulPaint: JSString = "LargestContentfulPaint" + @usableFromInline static let LayoutChild: JSString = "LayoutChild" + @usableFromInline static let LayoutConstraints: JSString = "LayoutConstraints" + @usableFromInline static let LayoutEdges: JSString = "LayoutEdges" + @usableFromInline static let LayoutFragment: JSString = "LayoutFragment" + @usableFromInline static let LayoutShift: JSString = "LayoutShift" + @usableFromInline static let LayoutShiftAttribution: JSString = "LayoutShiftAttribution" + @usableFromInline static let LayoutWorkletGlobalScope: JSString = "LayoutWorkletGlobalScope" + @usableFromInline static let LinearAccelerationSensor: JSString = "LinearAccelerationSensor" + @usableFromInline static let Location: JSString = "Location" + @usableFromInline static let Lock: JSString = "Lock" + @usableFromInline static let LockManager: JSString = "LockManager" + @usableFromInline static let MIDIAccess: JSString = "MIDIAccess" + @usableFromInline static let MIDIConnectionEvent: JSString = "MIDIConnectionEvent" + @usableFromInline static let MIDIInput: JSString = "MIDIInput" + @usableFromInline static let MIDIInputMap: JSString = "MIDIInputMap" + @usableFromInline static let MIDIMessageEvent: JSString = "MIDIMessageEvent" + @usableFromInline static let MIDIOutput: JSString = "MIDIOutput" + @usableFromInline static let MIDIOutputMap: JSString = "MIDIOutputMap" + @usableFromInline static let MIDIPort: JSString = "MIDIPort" + @usableFromInline static let ML: JSString = "ML" + @usableFromInline static let MLContext: JSString = "MLContext" + @usableFromInline static let MLGraph: JSString = "MLGraph" + @usableFromInline static let MLGraphBuilder: JSString = "MLGraphBuilder" + @usableFromInline static let MLOperand: JSString = "MLOperand" + @usableFromInline static let MLOperator: JSString = "MLOperator" + @usableFromInline static let Magnetometer: JSString = "Magnetometer" + @usableFromInline static let MathMLElement: JSString = "MathMLElement" + @usableFromInline static let MediaCapabilities: JSString = "MediaCapabilities" + @usableFromInline static let MediaDeviceInfo: JSString = "MediaDeviceInfo" + @usableFromInline static let MediaDevices: JSString = "MediaDevices" + @usableFromInline static let MediaElementAudioSourceNode: JSString = "MediaElementAudioSourceNode" + @usableFromInline static let MediaEncryptedEvent: JSString = "MediaEncryptedEvent" + @usableFromInline static let MediaError: JSString = "MediaError" + @usableFromInline static let MediaKeyMessageEvent: JSString = "MediaKeyMessageEvent" + @usableFromInline static let MediaKeySession: JSString = "MediaKeySession" + @usableFromInline static let MediaKeyStatusMap: JSString = "MediaKeyStatusMap" + @usableFromInline static let MediaKeySystemAccess: JSString = "MediaKeySystemAccess" + @usableFromInline static let MediaKeys: JSString = "MediaKeys" + @usableFromInline static let MediaList: JSString = "MediaList" + @usableFromInline static let MediaMetadata: JSString = "MediaMetadata" + @usableFromInline static let MediaQueryList: JSString = "MediaQueryList" + @usableFromInline static let MediaQueryListEvent: JSString = "MediaQueryListEvent" + @usableFromInline static let MediaRecorder: JSString = "MediaRecorder" + @usableFromInline static let MediaRecorderErrorEvent: JSString = "MediaRecorderErrorEvent" + @usableFromInline static let MediaSession: JSString = "MediaSession" + @usableFromInline static let MediaSource: JSString = "MediaSource" + @usableFromInline static let MediaStream: JSString = "MediaStream" + @usableFromInline static let MediaStreamAudioDestinationNode: JSString = "MediaStreamAudioDestinationNode" + @usableFromInline static let MediaStreamAudioSourceNode: JSString = "MediaStreamAudioSourceNode" + @usableFromInline static let MediaStreamTrack: JSString = "MediaStreamTrack" + @usableFromInline static let MediaStreamTrackAudioSourceNode: JSString = "MediaStreamTrackAudioSourceNode" + @usableFromInline static let MediaStreamTrackEvent: JSString = "MediaStreamTrackEvent" + @usableFromInline static let MediaStreamTrackProcessor: JSString = "MediaStreamTrackProcessor" + @usableFromInline static let Memory: JSString = "Memory" + @usableFromInline static let MessageChannel: JSString = "MessageChannel" + @usableFromInline static let MessageEvent: JSString = "MessageEvent" + @usableFromInline static let MessagePort: JSString = "MessagePort" + @usableFromInline static let MimeType: JSString = "MimeType" + @usableFromInline static let MimeTypeArray: JSString = "MimeTypeArray" + @usableFromInline static let Module: JSString = "Module" + @usableFromInline static let MouseEvent: JSString = "MouseEvent" + @usableFromInline static let MutationEvent: JSString = "MutationEvent" + @usableFromInline static let MutationObserver: JSString = "MutationObserver" + @usableFromInline static let MutationRecord: JSString = "MutationRecord" + @usableFromInline static let NDEFMessage: JSString = "NDEFMessage" + @usableFromInline static let NDEFReader: JSString = "NDEFReader" + @usableFromInline static let NDEFReadingEvent: JSString = "NDEFReadingEvent" + @usableFromInline static let NDEFRecord: JSString = "NDEFRecord" + @usableFromInline static let NamedFlow: JSString = "NamedFlow" + @usableFromInline static let NamedFlowMap: JSString = "NamedFlowMap" + @usableFromInline static let NamedNodeMap: JSString = "NamedNodeMap" + @usableFromInline static let NavigateEvent: JSString = "NavigateEvent" + @usableFromInline static let Navigation: JSString = "Navigation" + @usableFromInline static let NavigationCurrentEntryChangeEvent: JSString = "NavigationCurrentEntryChangeEvent" + @usableFromInline static let NavigationDestination: JSString = "NavigationDestination" + @usableFromInline static let NavigationEvent: JSString = "NavigationEvent" + @usableFromInline static let NavigationHistoryEntry: JSString = "NavigationHistoryEntry" + @usableFromInline static let NavigationPreloadManager: JSString = "NavigationPreloadManager" + @usableFromInline static let NavigationTransition: JSString = "NavigationTransition" + @usableFromInline static let Navigator: JSString = "Navigator" + @usableFromInline static let NavigatorUAData: JSString = "NavigatorUAData" + @usableFromInline static let NetworkInformation: JSString = "NetworkInformation" + @usableFromInline static let Node: JSString = "Node" + @usableFromInline static let NodeIterator: JSString = "NodeIterator" + @usableFromInline static let NodeList: JSString = "NodeList" + @usableFromInline static let Notification: JSString = "Notification" + @usableFromInline static let NotificationEvent: JSString = "NotificationEvent" + @usableFromInline static let OES_draw_buffers_indexed: JSString = "OES_draw_buffers_indexed" + @usableFromInline static let OES_element_index_uint: JSString = "OES_element_index_uint" + @usableFromInline static let OES_fbo_render_mipmap: JSString = "OES_fbo_render_mipmap" + @usableFromInline static let OES_standard_derivatives: JSString = "OES_standard_derivatives" + @usableFromInline static let OES_texture_float: JSString = "OES_texture_float" + @usableFromInline static let OES_texture_float_linear: JSString = "OES_texture_float_linear" + @usableFromInline static let OES_texture_half_float: JSString = "OES_texture_half_float" + @usableFromInline static let OES_texture_half_float_linear: JSString = "OES_texture_half_float_linear" + @usableFromInline static let OES_vertex_array_object: JSString = "OES_vertex_array_object" + @usableFromInline static let OTPCredential: JSString = "OTPCredential" + @usableFromInline static let OVR_multiview2: JSString = "OVR_multiview2" + @usableFromInline static let Object: JSString = "Object" + @usableFromInline static let OfflineAudioCompletionEvent: JSString = "OfflineAudioCompletionEvent" + @usableFromInline static let OfflineAudioContext: JSString = "OfflineAudioContext" + @usableFromInline static let OffscreenCanvas: JSString = "OffscreenCanvas" + @usableFromInline static let OffscreenCanvasRenderingContext2D: JSString = "OffscreenCanvasRenderingContext2D" + @usableFromInline static let OrientationSensor: JSString = "OrientationSensor" + @usableFromInline static let OscillatorNode: JSString = "OscillatorNode" + @usableFromInline static let OverconstrainedError: JSString = "OverconstrainedError" + @usableFromInline static let PageTransitionEvent: JSString = "PageTransitionEvent" + @usableFromInline static let PaintRenderingContext2D: JSString = "PaintRenderingContext2D" + @usableFromInline static let PaintSize: JSString = "PaintSize" + @usableFromInline static let PaintWorkletGlobalScope: JSString = "PaintWorkletGlobalScope" + @usableFromInline static let PannerNode: JSString = "PannerNode" + @usableFromInline static let PasswordCredential: JSString = "PasswordCredential" + @usableFromInline static let Path2D: JSString = "Path2D" + @usableFromInline static let PaymentInstruments: JSString = "PaymentInstruments" + @usableFromInline static let PaymentManager: JSString = "PaymentManager" + @usableFromInline static let PaymentMethodChangeEvent: JSString = "PaymentMethodChangeEvent" + @usableFromInline static let PaymentRequest: JSString = "PaymentRequest" + @usableFromInline static let PaymentRequestEvent: JSString = "PaymentRequestEvent" + @usableFromInline static let PaymentRequestUpdateEvent: JSString = "PaymentRequestUpdateEvent" + @usableFromInline static let PaymentResponse: JSString = "PaymentResponse" + @usableFromInline static let Performance: JSString = "Performance" + @usableFromInline static let PerformanceElementTiming: JSString = "PerformanceElementTiming" + @usableFromInline static let PerformanceEntry: JSString = "PerformanceEntry" + @usableFromInline static let PerformanceEventTiming: JSString = "PerformanceEventTiming" + @usableFromInline static let PerformanceLongTaskTiming: JSString = "PerformanceLongTaskTiming" + @usableFromInline static let PerformanceMark: JSString = "PerformanceMark" + @usableFromInline static let PerformanceMeasure: JSString = "PerformanceMeasure" + @usableFromInline static let PerformanceNavigation: JSString = "PerformanceNavigation" + @usableFromInline static let PerformanceNavigationTiming: JSString = "PerformanceNavigationTiming" + @usableFromInline static let PerformanceObserver: JSString = "PerformanceObserver" + @usableFromInline static let PerformanceObserverEntryList: JSString = "PerformanceObserverEntryList" + @usableFromInline static let PerformancePaintTiming: JSString = "PerformancePaintTiming" + @usableFromInline static let PerformanceResourceTiming: JSString = "PerformanceResourceTiming" + @usableFromInline static let PerformanceServerTiming: JSString = "PerformanceServerTiming" + @usableFromInline static let PerformanceTiming: JSString = "PerformanceTiming" + @usableFromInline static let PeriodicSyncEvent: JSString = "PeriodicSyncEvent" + @usableFromInline static let PeriodicSyncManager: JSString = "PeriodicSyncManager" + @usableFromInline static let PeriodicWave: JSString = "PeriodicWave" + @usableFromInline static let PermissionStatus: JSString = "PermissionStatus" + @usableFromInline static let Permissions: JSString = "Permissions" + @usableFromInline static let PermissionsPolicy: JSString = "PermissionsPolicy" + @usableFromInline static let PermissionsPolicyViolationReportBody: JSString = "PermissionsPolicyViolationReportBody" + @usableFromInline static let PictureInPictureEvent: JSString = "PictureInPictureEvent" + @usableFromInline static let PictureInPictureWindow: JSString = "PictureInPictureWindow" + @usableFromInline static let Plugin: JSString = "Plugin" + @usableFromInline static let PluginArray: JSString = "PluginArray" + @usableFromInline static let PointerEvent: JSString = "PointerEvent" + @usableFromInline static let PopStateEvent: JSString = "PopStateEvent" + @usableFromInline static let PortalActivateEvent: JSString = "PortalActivateEvent" + @usableFromInline static let PortalHost: JSString = "PortalHost" + @usableFromInline static let Presentation: JSString = "Presentation" + @usableFromInline static let PresentationAvailability: JSString = "PresentationAvailability" + @usableFromInline static let PresentationConnection: JSString = "PresentationConnection" + @usableFromInline static let PresentationConnectionAvailableEvent: JSString = "PresentationConnectionAvailableEvent" + @usableFromInline static let PresentationConnectionCloseEvent: JSString = "PresentationConnectionCloseEvent" + @usableFromInline static let PresentationConnectionList: JSString = "PresentationConnectionList" + @usableFromInline static let PresentationReceiver: JSString = "PresentationReceiver" + @usableFromInline static let PresentationRequest: JSString = "PresentationRequest" + @usableFromInline static let ProcessingInstruction: JSString = "ProcessingInstruction" + @usableFromInline static let Profiler: JSString = "Profiler" + @usableFromInline static let ProgressEvent: JSString = "ProgressEvent" + @usableFromInline static let PromiseRejectionEvent: JSString = "PromiseRejectionEvent" + @usableFromInline static let ProximitySensor: JSString = "ProximitySensor" + @usableFromInline static let PublicKeyCredential: JSString = "PublicKeyCredential" + @usableFromInline static let PushEvent: JSString = "PushEvent" + @usableFromInline static let PushManager: JSString = "PushManager" + @usableFromInline static let PushMessageData: JSString = "PushMessageData" + @usableFromInline static let PushSubscription: JSString = "PushSubscription" + @usableFromInline static let PushSubscriptionChangeEvent: JSString = "PushSubscriptionChangeEvent" + @usableFromInline static let PushSubscriptionOptions: JSString = "PushSubscriptionOptions" + @usableFromInline static let Q: JSString = "Q" + @usableFromInline static let RTCCertificate: JSString = "RTCCertificate" + @usableFromInline static let RTCDTMFSender: JSString = "RTCDTMFSender" + @usableFromInline static let RTCDTMFToneChangeEvent: JSString = "RTCDTMFToneChangeEvent" + @usableFromInline static let RTCDataChannel: JSString = "RTCDataChannel" + @usableFromInline static let RTCDataChannelEvent: JSString = "RTCDataChannelEvent" + @usableFromInline static let RTCDtlsTransport: JSString = "RTCDtlsTransport" + @usableFromInline static let RTCEncodedAudioFrame: JSString = "RTCEncodedAudioFrame" + @usableFromInline static let RTCEncodedVideoFrame: JSString = "RTCEncodedVideoFrame" + @usableFromInline static let RTCError: JSString = "RTCError" + @usableFromInline static let RTCErrorEvent: JSString = "RTCErrorEvent" + @usableFromInline static let RTCIceCandidate: JSString = "RTCIceCandidate" + @usableFromInline static let RTCIceTransport: JSString = "RTCIceTransport" + @usableFromInline static let RTCIdentityAssertion: JSString = "RTCIdentityAssertion" + @usableFromInline static let RTCIdentityProviderGlobalScope: JSString = "RTCIdentityProviderGlobalScope" + @usableFromInline static let RTCIdentityProviderRegistrar: JSString = "RTCIdentityProviderRegistrar" + @usableFromInline static let RTCPeerConnection: JSString = "RTCPeerConnection" + @usableFromInline static let RTCPeerConnectionIceErrorEvent: JSString = "RTCPeerConnectionIceErrorEvent" + @usableFromInline static let RTCPeerConnectionIceEvent: JSString = "RTCPeerConnectionIceEvent" + @usableFromInline static let RTCRtpReceiver: JSString = "RTCRtpReceiver" + @usableFromInline static let RTCRtpScriptTransform: JSString = "RTCRtpScriptTransform" + @usableFromInline static let RTCRtpScriptTransformer: JSString = "RTCRtpScriptTransformer" + @usableFromInline static let RTCRtpSender: JSString = "RTCRtpSender" + @usableFromInline static let RTCRtpTransceiver: JSString = "RTCRtpTransceiver" + @usableFromInline static let RTCSctpTransport: JSString = "RTCSctpTransport" + @usableFromInline static let RTCSessionDescription: JSString = "RTCSessionDescription" + @usableFromInline static let RTCStatsReport: JSString = "RTCStatsReport" + @usableFromInline static let RTCTrackEvent: JSString = "RTCTrackEvent" + @usableFromInline static let RTCTransformEvent: JSString = "RTCTransformEvent" + @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 RelativeOrientationSensor: JSString = "RelativeOrientationSensor" + @usableFromInline static let RemotePlayback: JSString = "RemotePlayback" + @usableFromInline static let Report: JSString = "Report" + @usableFromInline static let ReportBody: JSString = "ReportBody" + @usableFromInline static let ReportingObserver: JSString = "ReportingObserver" + @usableFromInline static let Request: JSString = "Request" + @usableFromInline static let ResizeObserver: JSString = "ResizeObserver" + @usableFromInline static let ResizeObserverEntry: JSString = "ResizeObserverEntry" + @usableFromInline static let ResizeObserverSize: JSString = "ResizeObserverSize" + @usableFromInline static let Response: JSString = "Response" + @usableFromInline static let SFrameTransform: JSString = "SFrameTransform" + @usableFromInline static let SFrameTransformErrorEvent: JSString = "SFrameTransformErrorEvent" + @usableFromInline static let SVGAElement: JSString = "SVGAElement" + @usableFromInline static let SVGAngle: JSString = "SVGAngle" + @usableFromInline static let SVGAnimateElement: JSString = "SVGAnimateElement" + @usableFromInline static let SVGAnimateMotionElement: JSString = "SVGAnimateMotionElement" + @usableFromInline static let SVGAnimateTransformElement: JSString = "SVGAnimateTransformElement" + @usableFromInline static let SVGAnimatedAngle: JSString = "SVGAnimatedAngle" + @usableFromInline static let SVGAnimatedBoolean: JSString = "SVGAnimatedBoolean" + @usableFromInline static let SVGAnimatedEnumeration: JSString = "SVGAnimatedEnumeration" + @usableFromInline static let SVGAnimatedInteger: JSString = "SVGAnimatedInteger" + @usableFromInline static let SVGAnimatedLength: JSString = "SVGAnimatedLength" + @usableFromInline static let SVGAnimatedLengthList: JSString = "SVGAnimatedLengthList" + @usableFromInline static let SVGAnimatedNumber: JSString = "SVGAnimatedNumber" + @usableFromInline static let SVGAnimatedNumberList: JSString = "SVGAnimatedNumberList" + @usableFromInline static let SVGAnimatedPreserveAspectRatio: JSString = "SVGAnimatedPreserveAspectRatio" + @usableFromInline static let SVGAnimatedRect: JSString = "SVGAnimatedRect" + @usableFromInline static let SVGAnimatedString: JSString = "SVGAnimatedString" + @usableFromInline static let SVGAnimatedTransformList: JSString = "SVGAnimatedTransformList" + @usableFromInline static let SVGAnimationElement: JSString = "SVGAnimationElement" + @usableFromInline static let SVGCircleElement: JSString = "SVGCircleElement" + @usableFromInline static let SVGClipPathElement: JSString = "SVGClipPathElement" + @usableFromInline static let SVGComponentTransferFunctionElement: JSString = "SVGComponentTransferFunctionElement" + @usableFromInline static let SVGDefsElement: JSString = "SVGDefsElement" + @usableFromInline static let SVGDescElement: JSString = "SVGDescElement" + @usableFromInline static let SVGDiscardElement: JSString = "SVGDiscardElement" + @usableFromInline static let SVGElement: JSString = "SVGElement" + @usableFromInline static let SVGEllipseElement: JSString = "SVGEllipseElement" + @usableFromInline static let SVGFEBlendElement: JSString = "SVGFEBlendElement" + @usableFromInline static let SVGFEColorMatrixElement: JSString = "SVGFEColorMatrixElement" + @usableFromInline static let SVGFEComponentTransferElement: JSString = "SVGFEComponentTransferElement" + @usableFromInline static let SVGFECompositeElement: JSString = "SVGFECompositeElement" + @usableFromInline static let SVGFEConvolveMatrixElement: JSString = "SVGFEConvolveMatrixElement" + @usableFromInline static let SVGFEDiffuseLightingElement: JSString = "SVGFEDiffuseLightingElement" + @usableFromInline static let SVGFEDisplacementMapElement: JSString = "SVGFEDisplacementMapElement" + @usableFromInline static let SVGFEDistantLightElement: JSString = "SVGFEDistantLightElement" + @usableFromInline static let SVGFEDropShadowElement: JSString = "SVGFEDropShadowElement" + @usableFromInline static let SVGFEFloodElement: JSString = "SVGFEFloodElement" + @usableFromInline static let SVGFEFuncAElement: JSString = "SVGFEFuncAElement" + @usableFromInline static let SVGFEFuncBElement: JSString = "SVGFEFuncBElement" + @usableFromInline static let SVGFEFuncGElement: JSString = "SVGFEFuncGElement" + @usableFromInline static let SVGFEFuncRElement: JSString = "SVGFEFuncRElement" + @usableFromInline static let SVGFEGaussianBlurElement: JSString = "SVGFEGaussianBlurElement" + @usableFromInline static let SVGFEImageElement: JSString = "SVGFEImageElement" + @usableFromInline static let SVGFEMergeElement: JSString = "SVGFEMergeElement" + @usableFromInline static let SVGFEMergeNodeElement: JSString = "SVGFEMergeNodeElement" + @usableFromInline static let SVGFEMorphologyElement: JSString = "SVGFEMorphologyElement" + @usableFromInline static let SVGFEOffsetElement: JSString = "SVGFEOffsetElement" + @usableFromInline static let SVGFEPointLightElement: JSString = "SVGFEPointLightElement" + @usableFromInline static let SVGFESpecularLightingElement: JSString = "SVGFESpecularLightingElement" + @usableFromInline static let SVGFESpotLightElement: JSString = "SVGFESpotLightElement" + @usableFromInline static let SVGFETileElement: JSString = "SVGFETileElement" + @usableFromInline static let SVGFETurbulenceElement: JSString = "SVGFETurbulenceElement" + @usableFromInline static let SVGFilterElement: JSString = "SVGFilterElement" + @usableFromInline static let SVGForeignObjectElement: JSString = "SVGForeignObjectElement" + @usableFromInline static let SVGGElement: JSString = "SVGGElement" + @usableFromInline static let SVGGeometryElement: JSString = "SVGGeometryElement" + @usableFromInline static let SVGGradientElement: JSString = "SVGGradientElement" + @usableFromInline static let SVGGraphicsElement: JSString = "SVGGraphicsElement" + @usableFromInline static let SVGImageElement: JSString = "SVGImageElement" + @usableFromInline static let SVGLength: JSString = "SVGLength" + @usableFromInline static let SVGLengthList: JSString = "SVGLengthList" + @usableFromInline static let SVGLineElement: JSString = "SVGLineElement" + @usableFromInline static let SVGLinearGradientElement: JSString = "SVGLinearGradientElement" + @usableFromInline static let SVGMPathElement: JSString = "SVGMPathElement" + @usableFromInline static let SVGMarkerElement: JSString = "SVGMarkerElement" + @usableFromInline static let SVGMaskElement: JSString = "SVGMaskElement" + @usableFromInline static let SVGMetadataElement: JSString = "SVGMetadataElement" + @usableFromInline static let SVGNumber: JSString = "SVGNumber" + @usableFromInline static let SVGNumberList: JSString = "SVGNumberList" + @usableFromInline static let SVGPathElement: JSString = "SVGPathElement" + @usableFromInline static let SVGPatternElement: JSString = "SVGPatternElement" + @usableFromInline static let SVGPointList: JSString = "SVGPointList" + @usableFromInline static let SVGPolygonElement: JSString = "SVGPolygonElement" + @usableFromInline static let SVGPolylineElement: JSString = "SVGPolylineElement" + @usableFromInline static let SVGPreserveAspectRatio: JSString = "SVGPreserveAspectRatio" + @usableFromInline static let SVGRadialGradientElement: JSString = "SVGRadialGradientElement" + @usableFromInline static let SVGRectElement: JSString = "SVGRectElement" + @usableFromInline static let SVGSVGElement: JSString = "SVGSVGElement" + @usableFromInline static let SVGScriptElement: JSString = "SVGScriptElement" + @usableFromInline static let SVGSetElement: JSString = "SVGSetElement" + @usableFromInline static let SVGStopElement: JSString = "SVGStopElement" + @usableFromInline static let SVGStringList: JSString = "SVGStringList" + @usableFromInline static let SVGStyleElement: JSString = "SVGStyleElement" + @usableFromInline static let SVGSwitchElement: JSString = "SVGSwitchElement" + @usableFromInline static let SVGSymbolElement: JSString = "SVGSymbolElement" + @usableFromInline static let SVGTSpanElement: JSString = "SVGTSpanElement" + @usableFromInline static let SVGTextContentElement: JSString = "SVGTextContentElement" + @usableFromInline static let SVGTextElement: JSString = "SVGTextElement" + @usableFromInline static let SVGTextPathElement: JSString = "SVGTextPathElement" + @usableFromInline static let SVGTextPositioningElement: JSString = "SVGTextPositioningElement" + @usableFromInline static let SVGTitleElement: JSString = "SVGTitleElement" + @usableFromInline static let SVGTransform: JSString = "SVGTransform" + @usableFromInline static let SVGTransformList: JSString = "SVGTransformList" + @usableFromInline static let SVGUnitTypes: JSString = "SVGUnitTypes" + @usableFromInline static let SVGUseElement: JSString = "SVGUseElement" + @usableFromInline static let SVGUseElementShadowRoot: JSString = "SVGUseElementShadowRoot" + @usableFromInline static let SVGViewElement: JSString = "SVGViewElement" + @usableFromInline static let Sanitizer: JSString = "Sanitizer" + @usableFromInline static let Scheduler: JSString = "Scheduler" + @usableFromInline static let Scheduling: JSString = "Scheduling" + @usableFromInline static let Screen: JSString = "Screen" + @usableFromInline static let ScreenOrientation: JSString = "ScreenOrientation" + @usableFromInline static let ScriptProcessorNode: JSString = "ScriptProcessorNode" + @usableFromInline static let ScriptingPolicyReportBody: JSString = "ScriptingPolicyReportBody" + @usableFromInline static let ScrollTimeline: JSString = "ScrollTimeline" + @usableFromInline static let SecurityPolicyViolationEvent: JSString = "SecurityPolicyViolationEvent" + @usableFromInline static let Selection: JSString = "Selection" + @usableFromInline static let Sensor: JSString = "Sensor" + @usableFromInline static let SensorErrorEvent: JSString = "SensorErrorEvent" + @usableFromInline static let SequenceEffect: JSString = "SequenceEffect" + @usableFromInline static let Serial: JSString = "Serial" + @usableFromInline static let SerialPort: JSString = "SerialPort" + @usableFromInline static let ServiceWorker: JSString = "ServiceWorker" + @usableFromInline static let ServiceWorkerContainer: JSString = "ServiceWorkerContainer" + @usableFromInline static let ServiceWorkerGlobalScope: JSString = "ServiceWorkerGlobalScope" + @usableFromInline static let ServiceWorkerRegistration: JSString = "ServiceWorkerRegistration" + @usableFromInline static let ShadowAnimation: JSString = "ShadowAnimation" + @usableFromInline static let ShadowRoot: JSString = "ShadowRoot" + @usableFromInline static let SharedWorker: JSString = "SharedWorker" + @usableFromInline static let SharedWorkerGlobalScope: JSString = "SharedWorkerGlobalScope" + @usableFromInline static let SourceBuffer: JSString = "SourceBuffer" + @usableFromInline static let SourceBufferList: JSString = "SourceBufferList" + @usableFromInline static let SpeechGrammar: JSString = "SpeechGrammar" + @usableFromInline static let SpeechGrammarList: JSString = "SpeechGrammarList" + @usableFromInline static let SpeechRecognition: JSString = "SpeechRecognition" + @usableFromInline static let SpeechRecognitionAlternative: JSString = "SpeechRecognitionAlternative" + @usableFromInline static let SpeechRecognitionErrorEvent: JSString = "SpeechRecognitionErrorEvent" + @usableFromInline static let SpeechRecognitionEvent: JSString = "SpeechRecognitionEvent" + @usableFromInline static let SpeechRecognitionResult: JSString = "SpeechRecognitionResult" + @usableFromInline static let SpeechRecognitionResultList: JSString = "SpeechRecognitionResultList" + @usableFromInline static let SpeechSynthesis: JSString = "SpeechSynthesis" + @usableFromInline static let SpeechSynthesisErrorEvent: JSString = "SpeechSynthesisErrorEvent" + @usableFromInline static let SpeechSynthesisEvent: JSString = "SpeechSynthesisEvent" + @usableFromInline static let SpeechSynthesisUtterance: JSString = "SpeechSynthesisUtterance" + @usableFromInline static let SpeechSynthesisVoice: JSString = "SpeechSynthesisVoice" + @usableFromInline static let StaticRange: JSString = "StaticRange" + @usableFromInline static let StereoPannerNode: JSString = "StereoPannerNode" + @usableFromInline static let Storage: JSString = "Storage" + @usableFromInline static let StorageEvent: JSString = "StorageEvent" + @usableFromInline static let StorageManager: JSString = "StorageManager" + @usableFromInline static let StylePropertyMap: JSString = "StylePropertyMap" + @usableFromInline static let StylePropertyMapReadOnly: JSString = "StylePropertyMapReadOnly" + @usableFromInline static let StyleSheet: JSString = "StyleSheet" + @usableFromInline static let StyleSheetList: JSString = "StyleSheetList" + @usableFromInline static let SubmitEvent: JSString = "SubmitEvent" + @usableFromInline static let SubtleCrypto: JSString = "SubtleCrypto" + @usableFromInline static let SyncEvent: JSString = "SyncEvent" + @usableFromInline static let SyncManager: JSString = "SyncManager" + @usableFromInline static let Table: JSString = "Table" + @usableFromInline static let TaskAttributionTiming: JSString = "TaskAttributionTiming" + @usableFromInline static let TaskController: JSString = "TaskController" + @usableFromInline static let TaskPriorityChangeEvent: JSString = "TaskPriorityChangeEvent" + @usableFromInline static let TaskSignal: JSString = "TaskSignal" + @usableFromInline static let TestUtils: JSString = "TestUtils" + @usableFromInline static let Text: JSString = "Text" + @usableFromInline static let TextDecoder: JSString = "TextDecoder" + @usableFromInline static let TextDecoderStream: JSString = "TextDecoderStream" + @usableFromInline static let TextDetector: JSString = "TextDetector" + @usableFromInline static let TextEncoder: JSString = "TextEncoder" + @usableFromInline static let TextEncoderStream: JSString = "TextEncoderStream" + @usableFromInline static let TextFormat: JSString = "TextFormat" + @usableFromInline static let TextFormatUpdateEvent: JSString = "TextFormatUpdateEvent" + @usableFromInline static let TextMetrics: JSString = "TextMetrics" + @usableFromInline static let TextTrack: JSString = "TextTrack" + @usableFromInline static let TextTrackCue: JSString = "TextTrackCue" + @usableFromInline static let TextTrackCueList: JSString = "TextTrackCueList" + @usableFromInline static let TextTrackList: JSString = "TextTrackList" + @usableFromInline static let TextUpdateEvent: JSString = "TextUpdateEvent" + @usableFromInline static let TimeEvent: JSString = "TimeEvent" + @usableFromInline static let TimeRanges: JSString = "TimeRanges" + @usableFromInline static let Touch: JSString = "Touch" + @usableFromInline static let TouchEvent: JSString = "TouchEvent" + @usableFromInline static let TouchList: JSString = "TouchList" + @usableFromInline static let TrackEvent: JSString = "TrackEvent" + @usableFromInline static let TransformStream: JSString = "TransformStream" + @usableFromInline static let TransformStreamDefaultController: JSString = "TransformStreamDefaultController" + @usableFromInline static let TransitionEvent: JSString = "TransitionEvent" + @usableFromInline static let TreeWalker: JSString = "TreeWalker" + @usableFromInline static let TrustedHTML: JSString = "TrustedHTML" + @usableFromInline static let TrustedScript: JSString = "TrustedScript" + @usableFromInline static let TrustedScriptURL: JSString = "TrustedScriptURL" + @usableFromInline static let TrustedTypePolicy: JSString = "TrustedTypePolicy" + @usableFromInline static let TrustedTypePolicyFactory: JSString = "TrustedTypePolicyFactory" + @usableFromInline static let UIEvent: JSString = "UIEvent" + @usableFromInline static let URL: JSString = "URL" + @usableFromInline static let URLPattern: JSString = "URLPattern" + @usableFromInline static let URLSearchParams: JSString = "URLSearchParams" + @usableFromInline static let USB: JSString = "USB" + @usableFromInline static let USBAlternateInterface: JSString = "USBAlternateInterface" + @usableFromInline static let USBConfiguration: JSString = "USBConfiguration" + @usableFromInline static let USBConnectionEvent: JSString = "USBConnectionEvent" + @usableFromInline static let USBDevice: JSString = "USBDevice" + @usableFromInline static let USBEndpoint: JSString = "USBEndpoint" + @usableFromInline static let USBInTransferResult: JSString = "USBInTransferResult" + @usableFromInline static let USBInterface: JSString = "USBInterface" + @usableFromInline static let USBIsochronousInTransferPacket: JSString = "USBIsochronousInTransferPacket" + @usableFromInline static let USBIsochronousInTransferResult: JSString = "USBIsochronousInTransferResult" + @usableFromInline static let USBIsochronousOutTransferPacket: JSString = "USBIsochronousOutTransferPacket" + @usableFromInline static let USBIsochronousOutTransferResult: JSString = "USBIsochronousOutTransferResult" + @usableFromInline static let USBOutTransferResult: JSString = "USBOutTransferResult" + @usableFromInline static let USBPermissionResult: JSString = "USBPermissionResult" + @usableFromInline static let UncalibratedMagnetometer: JSString = "UncalibratedMagnetometer" + @usableFromInline static let VTTCue: JSString = "VTTCue" + @usableFromInline static let VTTRegion: JSString = "VTTRegion" + @usableFromInline static let ValidityState: JSString = "ValidityState" + @usableFromInline static let ValueEvent: JSString = "ValueEvent" + @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 VideoPlaybackQuality: JSString = "VideoPlaybackQuality" + @usableFromInline static let VideoTrack: JSString = "VideoTrack" + @usableFromInline static let VideoTrackGenerator: JSString = "VideoTrackGenerator" + @usableFromInline static let VideoTrackList: JSString = "VideoTrackList" + @usableFromInline static let VirtualKeyboard: JSString = "VirtualKeyboard" + @usableFromInline static let VisualViewport: JSString = "VisualViewport" + @usableFromInline static let WEBGL_blend_equation_advanced_coherent: JSString = "WEBGL_blend_equation_advanced_coherent" + @usableFromInline static let WEBGL_color_buffer_float: JSString = "WEBGL_color_buffer_float" + @usableFromInline static let WEBGL_compressed_texture_astc: JSString = "WEBGL_compressed_texture_astc" + @usableFromInline static let WEBGL_compressed_texture_etc: JSString = "WEBGL_compressed_texture_etc" + @usableFromInline static let WEBGL_compressed_texture_etc1: JSString = "WEBGL_compressed_texture_etc1" + @usableFromInline static let WEBGL_compressed_texture_pvrtc: JSString = "WEBGL_compressed_texture_pvrtc" + @usableFromInline static let WEBGL_compressed_texture_s3tc: JSString = "WEBGL_compressed_texture_s3tc" + @usableFromInline static let WEBGL_compressed_texture_s3tc_srgb: JSString = "WEBGL_compressed_texture_s3tc_srgb" + @usableFromInline static let WEBGL_debug_renderer_info: JSString = "WEBGL_debug_renderer_info" + @usableFromInline static let WEBGL_debug_shaders: JSString = "WEBGL_debug_shaders" + @usableFromInline static let WEBGL_depth_texture: JSString = "WEBGL_depth_texture" + @usableFromInline static let WEBGL_draw_buffers: JSString = "WEBGL_draw_buffers" + @usableFromInline static let WEBGL_draw_instanced_base_vertex_base_instance: JSString = "WEBGL_draw_instanced_base_vertex_base_instance" + @usableFromInline static let WEBGL_lose_context: JSString = "WEBGL_lose_context" + @usableFromInline static let WEBGL_multi_draw: JSString = "WEBGL_multi_draw" + @usableFromInline static let WEBGL_multi_draw_instanced_base_vertex_base_instance: JSString = "WEBGL_multi_draw_instanced_base_vertex_base_instance" + @usableFromInline static let WakeLock: JSString = "WakeLock" + @usableFromInline static let WakeLockSentinel: JSString = "WakeLockSentinel" + @usableFromInline static let WaveShaperNode: JSString = "WaveShaperNode" + @usableFromInline static let WebAssembly: JSString = "WebAssembly" + @usableFromInline static let WebGL2RenderingContext: JSString = "WebGL2RenderingContext" + @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 WebGLQuery: JSString = "WebGLQuery" + @usableFromInline static let WebGLRenderbuffer: JSString = "WebGLRenderbuffer" + @usableFromInline static let WebGLRenderingContext: JSString = "WebGLRenderingContext" + @usableFromInline static let WebGLSampler: JSString = "WebGLSampler" + @usableFromInline static let WebGLShader: JSString = "WebGLShader" + @usableFromInline static let WebGLShaderPrecisionFormat: JSString = "WebGLShaderPrecisionFormat" + @usableFromInline static let WebGLSync: JSString = "WebGLSync" + @usableFromInline static let WebGLTexture: JSString = "WebGLTexture" + @usableFromInline static let WebGLTimerQueryEXT: JSString = "WebGLTimerQueryEXT" + @usableFromInline static let WebGLTransformFeedback: JSString = "WebGLTransformFeedback" + @usableFromInline static let WebGLUniformLocation: JSString = "WebGLUniformLocation" + @usableFromInline static let WebGLVertexArrayObject: JSString = "WebGLVertexArrayObject" + @usableFromInline static let WebGLVertexArrayObjectOES: JSString = "WebGLVertexArrayObjectOES" + @usableFromInline static let WebSocket: JSString = "WebSocket" + @usableFromInline static let WebTransport: JSString = "WebTransport" + @usableFromInline static let WebTransportBidirectionalStream: JSString = "WebTransportBidirectionalStream" + @usableFromInline static let WebTransportDatagramDuplexStream: JSString = "WebTransportDatagramDuplexStream" + @usableFromInline static let WebTransportError: JSString = "WebTransportError" + @usableFromInline static let WheelEvent: JSString = "WheelEvent" + @usableFromInline static let Window: JSString = "Window" + @usableFromInline static let WindowClient: JSString = "WindowClient" + @usableFromInline static let WindowControlsOverlay: JSString = "WindowControlsOverlay" + @usableFromInline static let WindowControlsOverlayGeometryChangeEvent: JSString = "WindowControlsOverlayGeometryChangeEvent" + @usableFromInline static let Worker: JSString = "Worker" + @usableFromInline static let WorkerGlobalScope: JSString = "WorkerGlobalScope" + @usableFromInline static let WorkerLocation: JSString = "WorkerLocation" + @usableFromInline static let WorkerNavigator: JSString = "WorkerNavigator" + @usableFromInline static let Worklet: JSString = "Worklet" + @usableFromInline static let WorkletAnimation: JSString = "WorkletAnimation" + @usableFromInline static let WorkletAnimationEffect: JSString = "WorkletAnimationEffect" + @usableFromInline static let WorkletGlobalScope: JSString = "WorkletGlobalScope" + @usableFromInline static let WorkletGroupEffect: JSString = "WorkletGroupEffect" + @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" + @usableFromInline static let XMLHttpRequestUpload: JSString = "XMLHttpRequestUpload" + @usableFromInline static let XMLSerializer: JSString = "XMLSerializer" + @usableFromInline static let XPathEvaluator: JSString = "XPathEvaluator" + @usableFromInline static let XPathExpression: JSString = "XPathExpression" + @usableFromInline static let XPathResult: JSString = "XPathResult" + @usableFromInline static let XRAnchor: JSString = "XRAnchor" + @usableFromInline static let XRAnchorSet: JSString = "XRAnchorSet" + @usableFromInline static let XRBoundedReferenceSpace: JSString = "XRBoundedReferenceSpace" + @usableFromInline static let XRCPUDepthInformation: JSString = "XRCPUDepthInformation" + @usableFromInline static let XRCompositionLayer: JSString = "XRCompositionLayer" + @usableFromInline static let XRCubeLayer: JSString = "XRCubeLayer" + @usableFromInline static let XRCylinderLayer: JSString = "XRCylinderLayer" + @usableFromInline static let XRDepthInformation: JSString = "XRDepthInformation" + @usableFromInline static let XREquirectLayer: JSString = "XREquirectLayer" + @usableFromInline static let XRFrame: JSString = "XRFrame" + @usableFromInline static let XRHand: JSString = "XRHand" + @usableFromInline static let XRHitTestResult: JSString = "XRHitTestResult" + @usableFromInline static let XRHitTestSource: JSString = "XRHitTestSource" + @usableFromInline static let XRInputSource: JSString = "XRInputSource" + @usableFromInline static let XRInputSourceArray: JSString = "XRInputSourceArray" + @usableFromInline static let XRInputSourceEvent: JSString = "XRInputSourceEvent" + @usableFromInline static let XRInputSourcesChangeEvent: JSString = "XRInputSourcesChangeEvent" + @usableFromInline static let XRJointPose: JSString = "XRJointPose" + @usableFromInline static let XRJointSpace: JSString = "XRJointSpace" + @usableFromInline static let XRLayer: JSString = "XRLayer" + @usableFromInline static let XRLayerEvent: JSString = "XRLayerEvent" + @usableFromInline static let XRLightEstimate: JSString = "XRLightEstimate" + @usableFromInline static let XRLightProbe: JSString = "XRLightProbe" + @usableFromInline static let XRMediaBinding: JSString = "XRMediaBinding" + @usableFromInline static let XRPermissionStatus: JSString = "XRPermissionStatus" + @usableFromInline static let XRPose: JSString = "XRPose" + @usableFromInline static let XRProjectionLayer: JSString = "XRProjectionLayer" + @usableFromInline static let XRQuadLayer: JSString = "XRQuadLayer" + @usableFromInline static let XRRay: JSString = "XRRay" + @usableFromInline static let XRReferenceSpace: JSString = "XRReferenceSpace" + @usableFromInline static let XRReferenceSpaceEvent: JSString = "XRReferenceSpaceEvent" + @usableFromInline static let XRRenderState: JSString = "XRRenderState" + @usableFromInline static let XRRigidTransform: JSString = "XRRigidTransform" + @usableFromInline static let XRSession: JSString = "XRSession" + @usableFromInline static let XRSessionEvent: JSString = "XRSessionEvent" + @usableFromInline static let XRSpace: JSString = "XRSpace" + @usableFromInline static let XRSubImage: JSString = "XRSubImage" + @usableFromInline static let XRSystem: JSString = "XRSystem" + @usableFromInline static let XRTransientInputHitTestResult: JSString = "XRTransientInputHitTestResult" + @usableFromInline static let XRTransientInputHitTestSource: JSString = "XRTransientInputHitTestSource" + @usableFromInline static let XRView: JSString = "XRView" + @usableFromInline static let XRViewerPose: JSString = "XRViewerPose" + @usableFromInline static let XRViewport: JSString = "XRViewport" + @usableFromInline static let XRWebGLBinding: JSString = "XRWebGLBinding" + @usableFromInline static let XRWebGLDepthInformation: JSString = "XRWebGLDepthInformation" + @usableFromInline static let XRWebGLLayer: JSString = "XRWebGLLayer" + @usableFromInline static let XRWebGLSubImage: JSString = "XRWebGLSubImage" + @usableFromInline static let XSLTProcessor: JSString = "XSLTProcessor" + @usableFromInline static let a: JSString = "a" + @usableFromInline static let aLink: JSString = "aLink" + @usableFromInline static let aTranspose: JSString = "aTranspose" + @usableFromInline static let abbr: JSString = "abbr" + @usableFromInline static let abort: JSString = "abort" + @usableFromInline static let aborted: JSString = "aborted" + @usableFromInline static let abs: JSString = "abs" + @usableFromInline static let absolute: JSString = "absolute" + @usableFromInline static let acceleration: JSString = "acceleration" + @usableFromInline static let accelerationIncludingGravity: JSString = "accelerationIncludingGravity" + @usableFromInline static let accept: JSString = "accept" + @usableFromInline static let acceptAllDevices: JSString = "acceptAllDevices" + @usableFromInline static let acceptCharset: JSString = "acceptCharset" + @usableFromInline static let access: JSString = "access" + @usableFromInline static let accessKey: JSString = "accessKey" + @usableFromInline static let accessKeyLabel: JSString = "accessKeyLabel" + @usableFromInline static let accuracy: JSString = "accuracy" + @usableFromInline static let action: JSString = "action" + @usableFromInline static let actions: JSString = "actions" + @usableFromInline static let activate: JSString = "activate" + @usableFromInline static let activated: JSString = "activated" + @usableFromInline static let activation: JSString = "activation" + @usableFromInline static let activations: JSString = "activations" + @usableFromInline static let active: JSString = "active" + @usableFromInline static let activeCues: JSString = "activeCues" + @usableFromInline static let activeDuration: JSString = "activeDuration" + @usableFromInline static let activeElement: JSString = "activeElement" + @usableFromInline static let activeSourceBuffers: JSString = "activeSourceBuffers" + @usableFromInline static let activeTexture: JSString = "activeTexture" + @usableFromInline static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" + @usableFromInline static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" + @usableFromInline static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" + @usableFromInline static let actualBoundingBoxRight: JSString = "actualBoundingBoxRight" + @usableFromInline static let add: JSString = "add" + @usableFromInline static let addAll: JSString = "addAll" + @usableFromInline static let addColorStop: JSString = "addColorStop" + @usableFromInline static let addCue: JSString = "addCue" + @usableFromInline static let addFromString: JSString = "addFromString" + @usableFromInline static let addFromURI: JSString = "addFromURI" + @usableFromInline static let addModule: JSString = "addModule" + @usableFromInline static let addPath: JSString = "addPath" + @usableFromInline static let addRange: JSString = "addRange" + @usableFromInline static let addRemoteCandidate: JSString = "addRemoteCandidate" + @usableFromInline static let addRule: JSString = "addRule" + @usableFromInline static let addSourceBuffer: JSString = "addSourceBuffer" + @usableFromInline static let addTextTrack: JSString = "addTextTrack" + @usableFromInline static let addTrack: JSString = "addTrack" + @usableFromInline static let addTransceiver: JSString = "addTransceiver" + @usableFromInline static let added: JSString = "added" + @usableFromInline static let addedNodes: JSString = "addedNodes" + @usableFromInline static let additionalData: JSString = "additionalData" + @usableFromInline static let additionalDisplayItems: JSString = "additionalDisplayItems" + @usableFromInline static let additiveSymbols: JSString = "additiveSymbols" + @usableFromInline static let address: JSString = "address" + @usableFromInline static let addressLine: JSString = "addressLine" + @usableFromInline static let addressModeU: JSString = "addressModeU" + @usableFromInline static let addressModeV: JSString = "addressModeV" + @usableFromInline static let addressModeW: JSString = "addressModeW" + @usableFromInline static let adoptNode: JSString = "adoptNode" + @usableFromInline static let adoptPredecessor: JSString = "adoptPredecessor" + @usableFromInline static let adoptedStyleSheets: JSString = "adoptedStyleSheets" + @usableFromInline static let advance: JSString = "advance" + @usableFromInline static let advanced: JSString = "advanced" + @usableFromInline static let advances: JSString = "advances" + @usableFromInline static let after: JSString = "after" + @usableFromInline static let album: JSString = "album" + @usableFromInline static let alert: JSString = "alert" + @usableFromInline static let alg: JSString = "alg" + @usableFromInline static let algorithm: JSString = "algorithm" + @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 allowAttributes: JSString = "allowAttributes" + @usableFromInline static let allowComments: JSString = "allowComments" + @usableFromInline static let allowCredentials: JSString = "allowCredentials" + @usableFromInline static let allowCustomElements: JSString = "allowCustomElements" + @usableFromInline static let allowElements: JSString = "allowElements" + @usableFromInline static let allowFullscreen: JSString = "allowFullscreen" + @usableFromInline static let allowPooling: JSString = "allowPooling" + @usableFromInline static let allowWithoutGesture: JSString = "allowWithoutGesture" + @usableFromInline static let allowedDevices: JSString = "allowedDevices" + @usableFromInline static let allowedFeatures: JSString = "allowedFeatures" + @usableFromInline static let allowedManufacturerData: JSString = "allowedManufacturerData" + @usableFromInline static let allowedServices: JSString = "allowedServices" + @usableFromInline static let allowsFeature: JSString = "allowsFeature" + @usableFromInline static let alpha: JSString = "alpha" + @usableFromInline static let alphaSideData: JSString = "alphaSideData" + @usableFromInline static let alphaToCoverageEnabled: JSString = "alphaToCoverageEnabled" + @usableFromInline static let alphabeticBaseline: JSString = "alphabeticBaseline" + @usableFromInline static let alt: JSString = "alt" + @usableFromInline static let altKey: JSString = "altKey" + @usableFromInline static let alternate: JSString = "alternate" + @usableFromInline static let alternateSetting: JSString = "alternateSetting" + @usableFromInline static let alternates: JSString = "alternates" + @usableFromInline static let altitude: JSString = "altitude" + @usableFromInline static let altitudeAccuracy: JSString = "altitudeAccuracy" + @usableFromInline static let altitudeAngle: JSString = "altitudeAngle" + @usableFromInline static let amount: JSString = "amount" + @usableFromInline static let amplitude: JSString = "amplitude" + @usableFromInline static let ancestorOrigins: JSString = "ancestorOrigins" + @usableFromInline static let anchorNode: JSString = "anchorNode" + @usableFromInline static let anchorOffset: JSString = "anchorOffset" + @usableFromInline static let anchorSpace: JSString = "anchorSpace" + @usableFromInline static let anchors: JSString = "anchors" + @usableFromInline static let angle: JSString = "angle" + @usableFromInline static let angularAcceleration: JSString = "angularAcceleration" + @usableFromInline static let angularVelocity: JSString = "angularVelocity" + @usableFromInline static let animVal: JSString = "animVal" + @usableFromInline static let animate: JSString = "animate" + @usableFromInline static let animated: JSString = "animated" + @usableFromInline static let animatedInstanceRoot: JSString = "animatedInstanceRoot" + @usableFromInline static let animatedPoints: JSString = "animatedPoints" + @usableFromInline static let animationName: JSString = "animationName" + @usableFromInline static let animationWorklet: JSString = "animationWorklet" + @usableFromInline static let animationsPaused: JSString = "animationsPaused" + @usableFromInline static let animatorName: JSString = "animatorName" + @usableFromInline static let annotation: JSString = "annotation" + @usableFromInline static let antialias: JSString = "antialias" + @usableFromInline static let anticipatedRemoval: JSString = "anticipatedRemoval" + @usableFromInline static let appCodeName: JSString = "appCodeName" + @usableFromInline static let appName: JSString = "appName" + @usableFromInline static let appVersion: JSString = "appVersion" + @usableFromInline static let appearance: JSString = "appearance" + @usableFromInline static let append: JSString = "append" + @usableFromInline static let appendBuffer: JSString = "appendBuffer" + @usableFromInline static let appendChild: JSString = "appendChild" + @usableFromInline static let appendData: JSString = "appendData" + @usableFromInline static let appendItem: JSString = "appendItem" + @usableFromInline static let appendMedium: JSString = "appendMedium" + @usableFromInline static let appendRule: JSString = "appendRule" + @usableFromInline static let appendWindowEnd: JSString = "appendWindowEnd" + @usableFromInline static let appendWindowStart: JSString = "appendWindowStart" + @usableFromInline static let appid: JSString = "appid" + @usableFromInline static let appidExclude: JSString = "appidExclude" + @usableFromInline static let applets: JSString = "applets" + @usableFromInline static let applicationServerKey: JSString = "applicationServerKey" + @usableFromInline static let applyConstraints: JSString = "applyConstraints" + @usableFromInline static let arc: JSString = "arc" + @usableFromInline static let arcTo: JSString = "arcTo" + @usableFromInline static let architecture: JSString = "architecture" + @usableFromInline static let archive: JSString = "archive" + @usableFromInline static let areas: JSString = "areas" + @usableFromInline static let args: JSString = "args" + @usableFromInline static let ariaAtomic: JSString = "ariaAtomic" + @usableFromInline static let ariaAutoComplete: JSString = "ariaAutoComplete" + @usableFromInline static let ariaBusy: JSString = "ariaBusy" + @usableFromInline static let ariaChecked: JSString = "ariaChecked" + @usableFromInline static let ariaColCount: JSString = "ariaColCount" + @usableFromInline static let ariaColIndex: JSString = "ariaColIndex" + @usableFromInline static let ariaColIndexText: JSString = "ariaColIndexText" + @usableFromInline static let ariaColSpan: JSString = "ariaColSpan" + @usableFromInline static let ariaCurrent: JSString = "ariaCurrent" + @usableFromInline static let ariaDescription: JSString = "ariaDescription" + @usableFromInline static let ariaDisabled: JSString = "ariaDisabled" + @usableFromInline static let ariaExpanded: JSString = "ariaExpanded" + @usableFromInline static let ariaHasPopup: JSString = "ariaHasPopup" + @usableFromInline static let ariaHidden: JSString = "ariaHidden" + @usableFromInline static let ariaInvalid: JSString = "ariaInvalid" + @usableFromInline static let ariaKeyShortcuts: JSString = "ariaKeyShortcuts" + @usableFromInline static let ariaLabel: JSString = "ariaLabel" + @usableFromInline static let ariaLevel: JSString = "ariaLevel" + @usableFromInline static let ariaLive: JSString = "ariaLive" + @usableFromInline static let ariaModal: JSString = "ariaModal" + @usableFromInline static let ariaMultiLine: JSString = "ariaMultiLine" + @usableFromInline static let ariaMultiSelectable: JSString = "ariaMultiSelectable" + @usableFromInline static let ariaOrientation: JSString = "ariaOrientation" + @usableFromInline static let ariaPlaceholder: JSString = "ariaPlaceholder" + @usableFromInline static let ariaPosInSet: JSString = "ariaPosInSet" + @usableFromInline static let ariaPressed: JSString = "ariaPressed" + @usableFromInline static let ariaReadOnly: JSString = "ariaReadOnly" + @usableFromInline static let ariaRequired: JSString = "ariaRequired" + @usableFromInline static let ariaRoleDescription: JSString = "ariaRoleDescription" + @usableFromInline static let ariaRowCount: JSString = "ariaRowCount" + @usableFromInline static let ariaRowIndex: JSString = "ariaRowIndex" + @usableFromInline static let ariaRowIndexText: JSString = "ariaRowIndexText" + @usableFromInline static let ariaRowSpan: JSString = "ariaRowSpan" + @usableFromInline static let ariaSelected: JSString = "ariaSelected" + @usableFromInline static let ariaSetSize: JSString = "ariaSetSize" + @usableFromInline static let ariaSort: JSString = "ariaSort" + @usableFromInline static let ariaValueMax: JSString = "ariaValueMax" + @usableFromInline static let ariaValueMin: JSString = "ariaValueMin" + @usableFromInline static let ariaValueNow: JSString = "ariaValueNow" + @usableFromInline static let ariaValueText: JSString = "ariaValueText" + @usableFromInline static let arrayBuffer: JSString = "arrayBuffer" + @usableFromInline static let arrayLayerCount: JSString = "arrayLayerCount" + @usableFromInline static let arrayStride: JSString = "arrayStride" + @usableFromInline static let artist: JSString = "artist" + @usableFromInline static let artwork: JSString = "artwork" + @usableFromInline static let `as`: JSString = "as" + @usableFromInline static let ascentOverride: JSString = "ascentOverride" + @usableFromInline static let aspect: JSString = "aspect" + @usableFromInline static let aspectRatio: JSString = "aspectRatio" + @usableFromInline static let assert: JSString = "assert" + @usableFromInline static let assertion: JSString = "assertion" + @usableFromInline static let assign: JSString = "assign" + @usableFromInline static let assignedElements: JSString = "assignedElements" + @usableFromInline static let assignedNodes: JSString = "assignedNodes" + @usableFromInline static let assignedSlot: JSString = "assignedSlot" + @usableFromInline static let async: JSString = "async" + @usableFromInline static let atRules: JSString = "atRules" + @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 attachedElements: JSString = "attachedElements" + @usableFromInline static let attack: JSString = "attack" + @usableFromInline static let attestation: JSString = "attestation" + @usableFromInline static let attestationObject: JSString = "attestationObject" + @usableFromInline static let attrChange: JSString = "attrChange" + @usableFromInline static let attrName: JSString = "attrName" + @usableFromInline static let attributeFilter: JSString = "attributeFilter" + @usableFromInline static let attributeName: JSString = "attributeName" + @usableFromInline static let attributeNamespace: JSString = "attributeNamespace" + @usableFromInline static let attributeOldValue: JSString = "attributeOldValue" + @usableFromInline static let attributeStyleMap: JSString = "attributeStyleMap" + @usableFromInline static let attributes: JSString = "attributes" + @usableFromInline static let attribution: JSString = "attribution" + @usableFromInline static let attributionDestination: JSString = "attributionDestination" + @usableFromInline static let attributionExpiry: JSString = "attributionExpiry" + @usableFromInline static let attributionReportTo: JSString = "attributionReportTo" + @usableFromInline static let attributionReporting: JSString = "attributionReporting" + @usableFromInline static let attributionSourceEventId: JSString = "attributionSourceEventId" + @usableFromInline static let attributionSourceId: JSString = "attributionSourceId" + @usableFromInline static let attributionSourcePriority: JSString = "attributionSourcePriority" + @usableFromInline static let audio: JSString = "audio" + @usableFromInline static let audioBitrateMode: JSString = "audioBitrateMode" + @usableFromInline static let audioBitsPerSecond: JSString = "audioBitsPerSecond" + @usableFromInline static let audioCapabilities: JSString = "audioCapabilities" + @usableFromInline static let audioLevel: JSString = "audioLevel" + @usableFromInline static let audioTracks: JSString = "audioTracks" + @usableFromInline static let audioWorklet: JSString = "audioWorklet" + @usableFromInline static let authenticatedSignedWrites: JSString = "authenticatedSignedWrites" + @usableFromInline static let authenticatorAttachment: JSString = "authenticatorAttachment" + @usableFromInline static let authenticatorData: JSString = "authenticatorData" + @usableFromInline static let authenticatorSelection: JSString = "authenticatorSelection" + @usableFromInline static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" + @usableFromInline static let autoBlockSize: JSString = "autoBlockSize" + @usableFromInline static let autoGainControl: JSString = "autoGainControl" + @usableFromInline static let autoIncrement: JSString = "autoIncrement" + @usableFromInline static let autoPad: JSString = "autoPad" + @usableFromInline static let autoPictureInPicture: JSString = "autoPictureInPicture" + @usableFromInline static let autocapitalize: JSString = "autocapitalize" + @usableFromInline static let autocomplete: JSString = "autocomplete" + @usableFromInline static let autofocus: JSString = "autofocus" + @usableFromInline static let automationRate: JSString = "automationRate" + @usableFromInline static let autoplay: JSString = "autoplay" + @usableFromInline static let availHeight: JSString = "availHeight" + @usableFromInline static let availWidth: JSString = "availWidth" + @usableFromInline static let availableBlockSize: JSString = "availableBlockSize" + @usableFromInline static let availableIncomingBitrate: JSString = "availableIncomingBitrate" + @usableFromInline static let availableInlineSize: JSString = "availableInlineSize" + @usableFromInline static let availableOutgoingBitrate: JSString = "availableOutgoingBitrate" + @usableFromInline static let averagePool2d: JSString = "averagePool2d" + @usableFromInline static let averageRtcpInterval: JSString = "averageRtcpInterval" + @usableFromInline static let ax: JSString = "ax" + @usableFromInline static let axes: JSString = "axes" + @usableFromInline static let axis: JSString = "axis" + @usableFromInline static let axisTag: JSString = "axisTag" + @usableFromInline static let ay: JSString = "ay" + @usableFromInline static let azimuth: JSString = "azimuth" + @usableFromInline static let azimuthAngle: JSString = "azimuthAngle" + @usableFromInline static let b: JSString = "b" + @usableFromInline static let bTranspose: JSString = "bTranspose" + @usableFromInline static let back: JSString = "back" + @usableFromInline static let background: JSString = "background" + @usableFromInline static let backgroundColor: JSString = "backgroundColor" + @usableFromInline static let backgroundFetch: JSString = "backgroundFetch" + @usableFromInline static let badInput: JSString = "badInput" + @usableFromInline static let badge: JSString = "badge" + @usableFromInline static let base64Certificate: JSString = "base64Certificate" + @usableFromInline static let baseArrayLayer: JSString = "baseArrayLayer" + @usableFromInline static let baseFrequencyX: JSString = "baseFrequencyX" + @usableFromInline static let baseFrequencyY: JSString = "baseFrequencyY" + @usableFromInline static let baseLatency: JSString = "baseLatency" + @usableFromInline static let baseLayer: JSString = "baseLayer" + @usableFromInline static let baseMipLevel: JSString = "baseMipLevel" + @usableFromInline static let basePalette: JSString = "basePalette" + @usableFromInline static let baseURI: JSString = "baseURI" + @usableFromInline static let baseURL: JSString = "baseURL" + @usableFromInline static let baseVal: JSString = "baseVal" + @usableFromInline static let baselines: JSString = "baselines" + @usableFromInline static let batchNormalization: JSString = "batchNormalization" + @usableFromInline static let baudRate: JSString = "baudRate" + @usableFromInline static let before: JSString = "before" + @usableFromInline static let beginComputePass: JSString = "beginComputePass" + @usableFromInline static let beginElement: JSString = "beginElement" + @usableFromInline static let beginElementAt: JSString = "beginElementAt" + @usableFromInline static let beginOcclusionQuery: JSString = "beginOcclusionQuery" + @usableFromInline static let beginPath: JSString = "beginPath" + @usableFromInline static let beginQuery: JSString = "beginQuery" + @usableFromInline static let beginQueryEXT: JSString = "beginQueryEXT" + @usableFromInline static let beginRenderPass: JSString = "beginRenderPass" + @usableFromInline static let beginTransformFeedback: JSString = "beginTransformFeedback" + @usableFromInline static let behavior: JSString = "behavior" + @usableFromInline static let beta: JSString = "beta" + @usableFromInline static let bezierCurveTo: JSString = "bezierCurveTo" + @usableFromInline static let bgColor: JSString = "bgColor" + @usableFromInline static let bias: JSString = "bias" + @usableFromInline static let binaryType: JSString = "binaryType" + @usableFromInline static let bindAttribLocation: JSString = "bindAttribLocation" + @usableFromInline static let bindBuffer: JSString = "bindBuffer" + @usableFromInline static let bindBufferBase: JSString = "bindBufferBase" + @usableFromInline static let bindBufferRange: JSString = "bindBufferRange" + @usableFromInline static let bindFramebuffer: JSString = "bindFramebuffer" + @usableFromInline static let bindGroupLayouts: JSString = "bindGroupLayouts" + @usableFromInline static let bindRenderbuffer: JSString = "bindRenderbuffer" + @usableFromInline static let bindSampler: JSString = "bindSampler" + @usableFromInline static let bindTexture: JSString = "bindTexture" + @usableFromInline static let bindTransformFeedback: JSString = "bindTransformFeedback" + @usableFromInline static let bindVertexArray: JSString = "bindVertexArray" + @usableFromInline static let bindVertexArrayOES: JSString = "bindVertexArrayOES" + @usableFromInline static let binding: JSString = "binding" + @usableFromInline static let bitDepth: JSString = "bitDepth" + @usableFromInline static let bitness: JSString = "bitness" + @usableFromInline static let bitrate: JSString = "bitrate" + @usableFromInline static let bitrateMode: JSString = "bitrateMode" + @usableFromInline static let bitsPerSecond: JSString = "bitsPerSecond" + @usableFromInline static let blend: JSString = "blend" + @usableFromInline static let blendColor: JSString = "blendColor" + @usableFromInline static let blendEquation: JSString = "blendEquation" + @usableFromInline static let blendEquationSeparate: JSString = "blendEquationSeparate" + @usableFromInline static let blendEquationSeparateiOES: JSString = "blendEquationSeparateiOES" + @usableFromInline static let blendEquationiOES: JSString = "blendEquationiOES" + @usableFromInline static let blendFunc: JSString = "blendFunc" + @usableFromInline static let blendFuncSeparate: JSString = "blendFuncSeparate" + @usableFromInline static let blendFuncSeparateiOES: JSString = "blendFuncSeparateiOES" + @usableFromInline static let blendFunciOES: JSString = "blendFunciOES" + @usableFromInline static let blendTextureSourceAlpha: JSString = "blendTextureSourceAlpha" + @usableFromInline static let blitFramebuffer: JSString = "blitFramebuffer" + @usableFromInline static let blob: JSString = "blob" + @usableFromInline static let block: JSString = "block" + @usableFromInline static let blockElements: JSString = "blockElements" + @usableFromInline static let blockEnd: JSString = "blockEnd" + @usableFromInline static let blockFragmentationOffset: JSString = "blockFragmentationOffset" + @usableFromInline static let blockFragmentationType: JSString = "blockFragmentationType" + @usableFromInline static let blockOffset: JSString = "blockOffset" + @usableFromInline static let blockSize: JSString = "blockSize" + @usableFromInline static let blockStart: JSString = "blockStart" + @usableFromInline static let blockedURI: JSString = "blockedURI" + @usableFromInline static let blockedURL: JSString = "blockedURL" + @usableFromInline static let blocking: JSString = "blocking" + @usableFromInline static let bluetooth: JSString = "bluetooth" + @usableFromInline static let blur: JSString = "blur" + @usableFromInline static let body: JSString = "body" + @usableFromInline static let bodyUsed: JSString = "bodyUsed" + @usableFromInline static let booleanValue: JSString = "booleanValue" + @usableFromInline static let border: JSString = "border" + @usableFromInline static let borderBoxSize: JSString = "borderBoxSize" + @usableFromInline static let bottom: JSString = "bottom" + @usableFromInline static let bound: JSString = "bound" + @usableFromInline static let boundingBox: JSString = "boundingBox" + @usableFromInline static let boundingBoxAscent: JSString = "boundingBoxAscent" + @usableFromInline static let boundingBoxDescent: JSString = "boundingBoxDescent" + @usableFromInline static let boundingBoxLeft: JSString = "boundingBoxLeft" + @usableFromInline static let boundingBoxRight: JSString = "boundingBoxRight" + @usableFromInline static let boundingClientRect: JSString = "boundingClientRect" + @usableFromInline static let boundingRect: JSString = "boundingRect" + @usableFromInline static let boundsGeometry: JSString = "boundsGeometry" + @usableFromInline static let box: JSString = "box" + @usableFromInline static let brand: JSString = "brand" + @usableFromInline static let brands: JSString = "brands" + @usableFromInline static let `break`: JSString = "break" + @usableFromInline static let breakToken: JSString = "breakToken" + @usableFromInline static let breakType: JSString = "breakType" + @usableFromInline static let breakdown: JSString = "breakdown" + @usableFromInline static let brightness: JSString = "brightness" + @usableFromInline static let broadcast: JSString = "broadcast" + @usableFromInline static let btoa: JSString = "btoa" + @usableFromInline static let bubbles: JSString = "bubbles" + @usableFromInline static let buffer: JSString = "buffer" + @usableFromInline static let bufferData: JSString = "bufferData" + @usableFromInline static let bufferSize: JSString = "bufferSize" + @usableFromInline static let bufferSubData: JSString = "bufferSubData" + @usableFromInline static let buffered: JSString = "buffered" + @usableFromInline static let bufferedAmount: JSString = "bufferedAmount" + @usableFromInline static let bufferedAmountLowThreshold: JSString = "bufferedAmountLowThreshold" + @usableFromInline static let buffers: JSString = "buffers" + @usableFromInline static let build: JSString = "build" + @usableFromInline static let bundlePolicy: JSString = "bundlePolicy" + @usableFromInline static let burstDiscardCount: JSString = "burstDiscardCount" + @usableFromInline static let burstDiscardRate: JSString = "burstDiscardRate" + @usableFromInline static let burstLossCount: JSString = "burstLossCount" + @usableFromInline static let burstLossRate: JSString = "burstLossRate" + @usableFromInline static let burstPacketsDiscarded: JSString = "burstPacketsDiscarded" + @usableFromInline static let burstPacketsLost: JSString = "burstPacketsLost" + @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 bytes: JSString = "bytes" + @usableFromInline static let bytesDiscardedOnSend: JSString = "bytesDiscardedOnSend" + @usableFromInline static let bytesPerRow: JSString = "bytesPerRow" + @usableFromInline static let bytesReceived: JSString = "bytesReceived" + @usableFromInline static let bytesSent: JSString = "bytesSent" + @usableFromInline static let bytesWritten: JSString = "bytesWritten" + @usableFromInline static let c: JSString = "c" + @usableFromInline static let cache: JSString = "cache" + @usableFromInline static let cacheName: JSString = "cacheName" + @usableFromInline static let caches: JSString = "caches" + @usableFromInline static let canConstructInDedicatedWorker: JSString = "canConstructInDedicatedWorker" + @usableFromInline static let canGoBack: JSString = "canGoBack" + @usableFromInline static let canGoForward: JSString = "canGoForward" + @usableFromInline static let canInsertDTMF: JSString = "canInsertDTMF" + @usableFromInline static let canMakePayment: JSString = "canMakePayment" + @usableFromInline static let canPlayType: JSString = "canPlayType" + @usableFromInline static let canShare: JSString = "canShare" + @usableFromInline static let canTransition: JSString = "canTransition" + @usableFromInline static let canTrickleIceCandidates: JSString = "canTrickleIceCandidates" + @usableFromInline static let cancel: JSString = "cancel" + @usableFromInline static let cancelAndHoldAtTime: JSString = "cancelAndHoldAtTime" + @usableFromInline static let cancelAnimationFrame: JSString = "cancelAnimationFrame" + @usableFromInline static let cancelBubble: JSString = "cancelBubble" + @usableFromInline static let cancelIdleCallback: JSString = "cancelIdleCallback" + @usableFromInline static let cancelScheduledValues: JSString = "cancelScheduledValues" + @usableFromInline static let cancelVideoFrameCallback: JSString = "cancelVideoFrameCallback" + @usableFromInline static let cancelWatchAvailability: JSString = "cancelWatchAvailability" + @usableFromInline static let cancelable: JSString = "cancelable" + @usableFromInline static let candidate: JSString = "candidate" + @usableFromInline static let candidateType: JSString = "candidateType" + @usableFromInline static let candidates: JSString = "candidates" + @usableFromInline static let canonicalUUID: JSString = "canonicalUUID" + @usableFromInline static let canvas: JSString = "canvas" + @usableFromInline static let caption: JSString = "caption" + @usableFromInline static let capture: JSString = "capture" + @usableFromInline static let captureEvents: JSString = "captureEvents" + @usableFromInline static let captureStream: JSString = "captureStream" + @usableFromInline static let captureTime: JSString = "captureTime" + @usableFromInline static let caretPositionFromPoint: JSString = "caretPositionFromPoint" + @usableFromInline static let category: JSString = "category" + @usableFromInline static let ceil: JSString = "ceil" + @usableFromInline static let cellIndex: JSString = "cellIndex" + @usableFromInline static let cellPadding: JSString = "cellPadding" + @usableFromInline static let cellSpacing: JSString = "cellSpacing" + @usableFromInline static let cells: JSString = "cells" + @usableFromInline static let centralAngle: JSString = "centralAngle" + @usableFromInline static let centralHorizontalAngle: JSString = "centralHorizontalAngle" + @usableFromInline static let certificates: JSString = "certificates" + @usableFromInline static let ch: JSString = "ch" + @usableFromInline static let chOff: JSString = "chOff" + @usableFromInline static let challenge: JSString = "challenge" + @usableFromInline static let changePaymentMethod: JSString = "changePaymentMethod" + @usableFromInline static let changeType: JSString = "changeType" + @usableFromInline static let changed: JSString = "changed" + @usableFromInline static let changedTouches: JSString = "changedTouches" + @usableFromInline static let channel: JSString = "channel" + @usableFromInline static let channelCount: JSString = "channelCount" + @usableFromInline static let channelCountMode: JSString = "channelCountMode" + @usableFromInline static let channelInterpretation: JSString = "channelInterpretation" + @usableFromInline static let channels: JSString = "channels" + @usableFromInline static let charCode: JSString = "charCode" + @usableFromInline static let charIndex: JSString = "charIndex" + @usableFromInline static let charLength: JSString = "charLength" + @usableFromInline static let characterBounds: JSString = "characterBounds" + @usableFromInline static let characterBoundsRangeStart: JSString = "characterBoundsRangeStart" + @usableFromInline static let characterData: JSString = "characterData" + @usableFromInline static let characterDataOldValue: JSString = "characterDataOldValue" + @usableFromInline static let characterSet: JSString = "characterSet" + @usableFromInline static let characterVariant: JSString = "characterVariant" + @usableFromInline static let characteristic: JSString = "characteristic" + @usableFromInline static let charging: JSString = "charging" + @usableFromInline static let chargingTime: JSString = "chargingTime" + @usableFromInline static let charset: JSString = "charset" + @usableFromInline static let check: JSString = "check" + @usableFromInline static let checkEnclosure: JSString = "checkEnclosure" + @usableFromInline static let checkFramebufferStatus: JSString = "checkFramebufferStatus" + @usableFromInline static let checkIntersection: JSString = "checkIntersection" + @usableFromInline static let checkValidity: JSString = "checkValidity" + @usableFromInline static let checked: JSString = "checked" + @usableFromInline static let child: JSString = "child" + @usableFromInline static let childBreakTokens: JSString = "childBreakTokens" + @usableFromInline static let childDisplay: JSString = "childDisplay" + @usableFromInline static let childElementCount: JSString = "childElementCount" + @usableFromInline static let childFragments: JSString = "childFragments" + @usableFromInline static let childList: JSString = "childList" + @usableFromInline static let childNodes: JSString = "childNodes" + @usableFromInline static let children: JSString = "children" + @usableFromInline static let chromaticAberrationCorrection: JSString = "chromaticAberrationCorrection" + @usableFromInline static let circuitBreakerTriggerCount: JSString = "circuitBreakerTriggerCount" + @usableFromInline static let cite: JSString = "cite" + @usableFromInline static let city: JSString = "city" + @usableFromInline static let claim: JSString = "claim" + @usableFromInline static let claimInterface: JSString = "claimInterface" + @usableFromInline static let claimed: JSString = "claimed" + @usableFromInline static let clamp: JSString = "clamp" + @usableFromInline static let classCode: JSString = "classCode" + @usableFromInline static let classList: JSString = "classList" + @usableFromInline static let className: JSString = "className" + @usableFromInline static let clear: JSString = "clear" + @usableFromInline static let clearAppBadge: JSString = "clearAppBadge" + @usableFromInline static let clearBuffer: JSString = "clearBuffer" + @usableFromInline static let clearBufferfi: JSString = "clearBufferfi" + @usableFromInline static let clearBufferfv: JSString = "clearBufferfv" + @usableFromInline static let clearBufferiv: JSString = "clearBufferiv" + @usableFromInline static let clearBufferuiv: JSString = "clearBufferuiv" + @usableFromInline static let clearClientBadge: JSString = "clearClientBadge" + @usableFromInline static let clearColor: JSString = "clearColor" + @usableFromInline static let clearData: JSString = "clearData" + @usableFromInline static let clearDepth: JSString = "clearDepth" + @usableFromInline static let clearHalt: JSString = "clearHalt" + @usableFromInline static let clearInterval: JSString = "clearInterval" + @usableFromInline static let clearLiveSeekableRange: JSString = "clearLiveSeekableRange" + @usableFromInline static let clearMarks: JSString = "clearMarks" + @usableFromInline static let clearMeasures: JSString = "clearMeasures" + @usableFromInline static let clearParameters: JSString = "clearParameters" + @usableFromInline static let clearRect: JSString = "clearRect" + @usableFromInline static let clearResourceTimings: JSString = "clearResourceTimings" + @usableFromInline static let clearStencil: JSString = "clearStencil" + @usableFromInline static let clearTimeout: JSString = "clearTimeout" + @usableFromInline static let clearToSend: JSString = "clearToSend" + @usableFromInline static let clearValue: JSString = "clearValue" + @usableFromInline static let clearWatch: JSString = "clearWatch" + @usableFromInline static let click: JSString = "click" + @usableFromInline static let clientDataJSON: JSString = "clientDataJSON" + @usableFromInline static let clientHeight: JSString = "clientHeight" + @usableFromInline static let clientId: JSString = "clientId" + @usableFromInline static let clientInformation: JSString = "clientInformation" + @usableFromInline static let clientLeft: JSString = "clientLeft" + @usableFromInline static let clientTop: JSString = "clientTop" + @usableFromInline static let clientWaitSync: JSString = "clientWaitSync" + @usableFromInline static let clientWidth: JSString = "clientWidth" + @usableFromInline static let clientX: JSString = "clientX" + @usableFromInline static let clientY: JSString = "clientY" + @usableFromInline static let clients: JSString = "clients" + @usableFromInline static let clip: JSString = "clip" + @usableFromInline static let clipPathUnits: JSString = "clipPathUnits" + @usableFromInline static let clipboard: JSString = "clipboard" + @usableFromInline static let clipboardData: JSString = "clipboardData" + @usableFromInline static let clipped: JSString = "clipped" + @usableFromInline static let clockRate: JSString = "clockRate" + @usableFromInline static let clone: JSString = "clone" + @usableFromInline static let cloneContents: JSString = "cloneContents" + @usableFromInline static let cloneNode: JSString = "cloneNode" + @usableFromInline static let cloneRange: JSString = "cloneRange" + @usableFromInline static let close: JSString = "close" + @usableFromInline static let closeCode: JSString = "closeCode" + @usableFromInline static let closePath: JSString = "closePath" + @usableFromInline static let closed: JSString = "closed" + @usableFromInline static let closest: JSString = "closest" + @usableFromInline static let cm: JSString = "cm" + @usableFromInline static let cmp: JSString = "cmp" + @usableFromInline static let cname: JSString = "cname" + @usableFromInline static let coalescedEvents: JSString = "coalescedEvents" + @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 codecId: JSString = "codecId" + @usableFromInline static let codecType: JSString = "codecType" + @usableFromInline static let codecs: JSString = "codecs" + @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 collapseToEnd: JSString = "collapseToEnd" + @usableFromInline static let collapseToStart: JSString = "collapseToStart" + @usableFromInline static let collapsed: JSString = "collapsed" + @usableFromInline static let collections: JSString = "collections" + @usableFromInline static let colno: JSString = "colno" + @usableFromInline static let color: JSString = "color" + @usableFromInline static let colorAttachments: JSString = "colorAttachments" + @usableFromInline static let colorDepth: JSString = "colorDepth" + @usableFromInline static let colorFormat: JSString = "colorFormat" + @usableFromInline static let colorFormats: JSString = "colorFormats" + @usableFromInline static let colorGamut: JSString = "colorGamut" + @usableFromInline static let colorMask: JSString = "colorMask" + @usableFromInline static let colorMaskiOES: JSString = "colorMaskiOES" + @usableFromInline static let colorSpace: JSString = "colorSpace" + @usableFromInline static let colorSpaceConversion: JSString = "colorSpaceConversion" + @usableFromInline static let colorTemperature: JSString = "colorTemperature" + @usableFromInline static let colorTexture: JSString = "colorTexture" + @usableFromInline static let cols: JSString = "cols" + @usableFromInline static let column: JSString = "column" + @usableFromInline static let columnNumber: JSString = "columnNumber" + @usableFromInline static let commit: JSString = "commit" + @usableFromInline static let commitStyles: JSString = "commitStyles" + @usableFromInline static let committed: JSString = "committed" + @usableFromInline static let commonAncestorContainer: JSString = "commonAncestorContainer" + @usableFromInline static let compact: JSString = "compact" + @usableFromInline static let companyIdentifier: JSString = "companyIdentifier" + @usableFromInline static let compare: JSString = "compare" + @usableFromInline static let compareBoundaryPoints: JSString = "compareBoundaryPoints" + @usableFromInline static let compareDocumentPosition: JSString = "compareDocumentPosition" + @usableFromInline static let comparePoint: JSString = "comparePoint" + @usableFromInline static let compatMode: JSString = "compatMode" + @usableFromInline static let compilationInfo: JSString = "compilationInfo" + @usableFromInline static let compile: JSString = "compile" + @usableFromInline static let compileShader: JSString = "compileShader" + @usableFromInline static let compileStreaming: JSString = "compileStreaming" + @usableFromInline static let complete: JSString = "complete" + @usableFromInline static let completeFramesOnly: JSString = "completeFramesOnly" + @usableFromInline static let completed: JSString = "completed" + @usableFromInline static let component: JSString = "component" + @usableFromInline static let composed: JSString = "composed" + @usableFromInline static let composedPath: JSString = "composedPath" + @usableFromInline static let composite: JSString = "composite" + @usableFromInline static let compositingAlphaMode: JSString = "compositingAlphaMode" + @usableFromInline static let compositionEnd: JSString = "compositionEnd" + @usableFromInline static let compositionRangeEnd: JSString = "compositionRangeEnd" + @usableFromInline static let compositionRangeStart: JSString = "compositionRangeStart" + @usableFromInline static let compositionStart: JSString = "compositionStart" + @usableFromInline static let compressedTexImage2D: JSString = "compressedTexImage2D" + @usableFromInline static let compressedTexImage3D: JSString = "compressedTexImage3D" + @usableFromInline static let compressedTexSubImage2D: JSString = "compressedTexSubImage2D" + @usableFromInline static let compressedTexSubImage3D: JSString = "compressedTexSubImage3D" + @usableFromInline static let compute: JSString = "compute" + @usableFromInline static let computedOffset: JSString = "computedOffset" + @usableFromInline static let computedStyleMap: JSString = "computedStyleMap" + @usableFromInline static let concat: JSString = "concat" + @usableFromInline static let concealedSamples: JSString = "concealedSamples" + @usableFromInline static let concealmentEvents: JSString = "concealmentEvents" + @usableFromInline static let conditionText: JSString = "conditionText" + @usableFromInline static let coneInnerAngle: JSString = "coneInnerAngle" + @usableFromInline static let coneOuterAngle: JSString = "coneOuterAngle" + @usableFromInline static let coneOuterGain: JSString = "coneOuterGain" + @usableFromInline static let confidence: JSString = "confidence" + @usableFromInline static let config: JSString = "config" + @usableFromInline static let configuration: JSString = "configuration" + @usableFromInline static let configurationName: JSString = "configurationName" + @usableFromInline static let configurationValue: JSString = "configurationValue" + @usableFromInline static let configurations: JSString = "configurations" + @usableFromInline static let configure: JSString = "configure" + @usableFromInline static let confirm: JSString = "confirm" + @usableFromInline static let congestionWindow: JSString = "congestionWindow" + @usableFromInline static let connect: JSString = "connect" + @usableFromInline static let connectEnd: JSString = "connectEnd" + @usableFromInline static let connectStart: JSString = "connectStart" + @usableFromInline static let connected: JSString = "connected" + @usableFromInline static let connection: JSString = "connection" + @usableFromInline static let connectionList: JSString = "connectionList" + @usableFromInline static let connectionState: JSString = "connectionState" + @usableFromInline static let connections: JSString = "connections" + @usableFromInline static let consentExpiredTimestamp: JSString = "consentExpiredTimestamp" + @usableFromInline static let consentRequestBytesSent: JSString = "consentRequestBytesSent" + @usableFromInline static let consentRequestsSent: JSString = "consentRequestsSent" + @usableFromInline static let console: JSString = "console" + @usableFromInline static let consolidate: JSString = "consolidate" + @usableFromInline static let constant: JSString = "constant" + @usableFromInline static let constants: JSString = "constants" + @usableFromInline static let constraint: JSString = "constraint" + @usableFromInline static let consume: JSString = "consume" + @usableFromInline static let contacts: JSString = "contacts" + @usableFromInline static let container: JSString = "container" + @usableFromInline static let containerId: JSString = "containerId" + @usableFromInline static let containerName: JSString = "containerName" + @usableFromInline static let containerSrc: JSString = "containerSrc" + @usableFromInline static let containerType: JSString = "containerType" + @usableFromInline static let contains: JSString = "contains" + @usableFromInline static let containsNode: JSString = "containsNode" + @usableFromInline static let content: JSString = "content" + @usableFromInline static let contentBoxSize: JSString = "contentBoxSize" + @usableFromInline static let contentDocument: JSString = "contentDocument" + @usableFromInline static let contentEditable: JSString = "contentEditable" + @usableFromInline static let contentHint: JSString = "contentHint" + @usableFromInline static let contentRect: JSString = "contentRect" + @usableFromInline static let contentType: JSString = "contentType" + @usableFromInline static let contentWindow: JSString = "contentWindow" + @usableFromInline static let contents: JSString = "contents" + @usableFromInline static let context: JSString = "context" + @usableFromInline static let contextTime: JSString = "contextTime" + @usableFromInline static let `continue`: JSString = "continue" + @usableFromInline static let continuePrimaryKey: JSString = "continuePrimaryKey" + @usableFromInline static let continuous: JSString = "continuous" + @usableFromInline static let contrast: JSString = "contrast" + @usableFromInline static let contributingSources: JSString = "contributingSources" + @usableFromInline static let contributorSsrc: JSString = "contributorSsrc" + @usableFromInline static let control: JSString = "control" + @usableFromInline static let controlBound: JSString = "controlBound" + @usableFromInline static let controlTransferIn: JSString = "controlTransferIn" + @usableFromInline static let controlTransferOut: JSString = "controlTransferOut" + @usableFromInline static let controller: JSString = "controller" + @usableFromInline static let controls: JSString = "controls" + @usableFromInline static let conv2d: JSString = "conv2d" + @usableFromInline static let convTranspose2d: JSString = "convTranspose2d" + @usableFromInline static let convertPointFromNode: JSString = "convertPointFromNode" + @usableFromInline static let convertQuadFromNode: JSString = "convertQuadFromNode" + @usableFromInline static let convertRectFromNode: JSString = "convertRectFromNode" + @usableFromInline static let convertToBlob: JSString = "convertToBlob" + @usableFromInline static let convertToSpecifiedUnits: JSString = "convertToSpecifiedUnits" + @usableFromInline static let cookie: JSString = "cookie" + @usableFromInline static let cookieEnabled: JSString = "cookieEnabled" + @usableFromInline static let cookieStore: JSString = "cookieStore" + @usableFromInline static let cookies: JSString = "cookies" + @usableFromInline static let coords: JSString = "coords" + @usableFromInline static let copyBufferSubData: JSString = "copyBufferSubData" + @usableFromInline static let copyBufferToBuffer: JSString = "copyBufferToBuffer" + @usableFromInline static let copyBufferToTexture: JSString = "copyBufferToTexture" + @usableFromInline static let copyExternalImageToTexture: JSString = "copyExternalImageToTexture" + @usableFromInline static let copyFromChannel: JSString = "copyFromChannel" + @usableFromInline static let copyTexImage2D: JSString = "copyTexImage2D" + @usableFromInline static let copyTexSubImage2D: JSString = "copyTexSubImage2D" + @usableFromInline static let copyTexSubImage3D: JSString = "copyTexSubImage3D" + @usableFromInline static let copyTextureToBuffer: JSString = "copyTextureToBuffer" + @usableFromInline static let copyTextureToTexture: JSString = "copyTextureToTexture" + @usableFromInline static let copyTo: JSString = "copyTo" + @usableFromInline static let copyToChannel: JSString = "copyToChannel" + @usableFromInline static let cornerPoints: JSString = "cornerPoints" + @usableFromInline static let correspondingElement: JSString = "correspondingElement" + @usableFromInline static let correspondingUseElement: JSString = "correspondingUseElement" + @usableFromInline static let corruptedVideoFrames: JSString = "corruptedVideoFrames" + @usableFromInline static let cos: JSString = "cos" + @usableFromInline static let count: JSString = "count" + @usableFromInline static let countReset: JSString = "countReset" + @usableFromInline static let counter: JSString = "counter" + @usableFromInline static let country: JSString = "country" + @usableFromInline static let cqb: JSString = "cqb" + @usableFromInline static let cqh: JSString = "cqh" + @usableFromInline static let cqi: JSString = "cqi" + @usableFromInline static let cqmax: JSString = "cqmax" + @usableFromInline static let cqmin: JSString = "cqmin" + @usableFromInline static let cqw: JSString = "cqw" + @usableFromInline static let create: JSString = "create" + @usableFromInline static let createAnalyser: JSString = "createAnalyser" + @usableFromInline static let createAnchor: JSString = "createAnchor" + @usableFromInline static let createAttribute: JSString = "createAttribute" + @usableFromInline static let createAttributeNS: JSString = "createAttributeNS" + @usableFromInline static let createBidirectionalStream: JSString = "createBidirectionalStream" + @usableFromInline static let createBindGroup: JSString = "createBindGroup" + @usableFromInline static let createBindGroupLayout: JSString = "createBindGroupLayout" + @usableFromInline static let createBiquadFilter: JSString = "createBiquadFilter" + @usableFromInline static let createBuffer: JSString = "createBuffer" + @usableFromInline static let createBufferSource: JSString = "createBufferSource" + @usableFromInline static let createCDATASection: JSString = "createCDATASection" + @usableFromInline static let createCaption: JSString = "createCaption" + @usableFromInline static let createChannelMerger: JSString = "createChannelMerger" + @usableFromInline static let createChannelSplitter: JSString = "createChannelSplitter" + @usableFromInline static let createCommandEncoder: JSString = "createCommandEncoder" + @usableFromInline static let createComment: JSString = "createComment" + @usableFromInline static let createComputePipeline: JSString = "createComputePipeline" + @usableFromInline static let createComputePipelineAsync: JSString = "createComputePipelineAsync" + @usableFromInline static let createConicGradient: JSString = "createConicGradient" + @usableFromInline static let createConstantSource: JSString = "createConstantSource" + @usableFromInline static let createContext: JSString = "createContext" + @usableFromInline static let createContextualFragment: JSString = "createContextualFragment" + @usableFromInline static let createConvolver: JSString = "createConvolver" + @usableFromInline static let createCubeLayer: JSString = "createCubeLayer" + @usableFromInline static let createCylinderLayer: JSString = "createCylinderLayer" + @usableFromInline static let createDataChannel: JSString = "createDataChannel" + @usableFromInline static let createDelay: JSString = "createDelay" + @usableFromInline static let createDocument: JSString = "createDocument" + @usableFromInline static let createDocumentFragment: JSString = "createDocumentFragment" + @usableFromInline static let createDocumentType: JSString = "createDocumentType" + @usableFromInline static let createDynamicsCompressor: JSString = "createDynamicsCompressor" + @usableFromInline static let createElement: JSString = "createElement" + @usableFromInline static let createElementNS: JSString = "createElementNS" + @usableFromInline static let createEquirectLayer: JSString = "createEquirectLayer" + @usableFromInline static let createEvent: JSString = "createEvent" + @usableFromInline static let createFramebuffer: JSString = "createFramebuffer" + @usableFromInline static let createGain: JSString = "createGain" + @usableFromInline static let createHTML: JSString = "createHTML" + @usableFromInline static let createHTMLDocument: JSString = "createHTMLDocument" + @usableFromInline static let createIIRFilter: JSString = "createIIRFilter" + @usableFromInline static let createImageBitmap: JSString = "createImageBitmap" + @usableFromInline static let createImageData: JSString = "createImageData" + @usableFromInline static let createIndex: JSString = "createIndex" + @usableFromInline static let createLinearGradient: JSString = "createLinearGradient" + @usableFromInline static let createMediaElementSource: JSString = "createMediaElementSource" + @usableFromInline static let createMediaKeys: JSString = "createMediaKeys" + @usableFromInline static let createMediaStreamDestination: JSString = "createMediaStreamDestination" + @usableFromInline static let createMediaStreamSource: JSString = "createMediaStreamSource" + @usableFromInline static let createMediaStreamTrackSource: JSString = "createMediaStreamTrackSource" + @usableFromInline static let createObjectStore: JSString = "createObjectStore" + @usableFromInline static let createObjectURL: JSString = "createObjectURL" + @usableFromInline static let createOscillator: JSString = "createOscillator" + @usableFromInline static let createPanner: JSString = "createPanner" + @usableFromInline static let createPattern: JSString = "createPattern" + @usableFromInline static let createPeriodicWave: JSString = "createPeriodicWave" + @usableFromInline static let createPipelineLayout: JSString = "createPipelineLayout" + @usableFromInline static let createPolicy: JSString = "createPolicy" + @usableFromInline static let createProcessingInstruction: JSString = "createProcessingInstruction" + @usableFromInline static let createProgram: JSString = "createProgram" + @usableFromInline static let createProjectionLayer: JSString = "createProjectionLayer" + @usableFromInline static let createQuadLayer: JSString = "createQuadLayer" + @usableFromInline static let createQuery: JSString = "createQuery" + @usableFromInline static let createQueryEXT: JSString = "createQueryEXT" + @usableFromInline static let createQuerySet: JSString = "createQuerySet" + @usableFromInline static let createRadialGradient: JSString = "createRadialGradient" + @usableFromInline static let createRange: JSString = "createRange" + @usableFromInline static let createReader: JSString = "createReader" + @usableFromInline static let createRenderBundleEncoder: JSString = "createRenderBundleEncoder" + @usableFromInline static let createRenderPipeline: JSString = "createRenderPipeline" + @usableFromInline static let createRenderPipelineAsync: JSString = "createRenderPipelineAsync" + @usableFromInline static let createRenderbuffer: JSString = "createRenderbuffer" + @usableFromInline static let createSVGAngle: JSString = "createSVGAngle" + @usableFromInline static let createSVGLength: JSString = "createSVGLength" + @usableFromInline static let createSVGMatrix: JSString = "createSVGMatrix" + @usableFromInline static let createSVGNumber: JSString = "createSVGNumber" + @usableFromInline static let createSVGPoint: JSString = "createSVGPoint" + @usableFromInline static let createSVGRect: JSString = "createSVGRect" + @usableFromInline static let createSVGTransform: JSString = "createSVGTransform" + @usableFromInline static let createSVGTransformFromMatrix: JSString = "createSVGTransformFromMatrix" + @usableFromInline static let createSampler: JSString = "createSampler" + @usableFromInline static let createScript: JSString = "createScript" + @usableFromInline static let createScriptProcessor: JSString = "createScriptProcessor" + @usableFromInline static let createScriptURL: JSString = "createScriptURL" + @usableFromInline static let createSession: JSString = "createSession" + @usableFromInline static let createShader: JSString = "createShader" + @usableFromInline static let createShaderModule: JSString = "createShaderModule" + @usableFromInline static let createStereoPanner: JSString = "createStereoPanner" + @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 createTransformFeedback: JSString = "createTransformFeedback" + @usableFromInline static let createUnidirectionalStream: JSString = "createUnidirectionalStream" + @usableFromInline static let createVertexArray: JSString = "createVertexArray" + @usableFromInline static let createVertexArrayOES: JSString = "createVertexArrayOES" + @usableFromInline static let createView: JSString = "createView" + @usableFromInline static let createWaveShaper: JSString = "createWaveShaper" + @usableFromInline static let createWritable: JSString = "createWritable" + @usableFromInline static let creationTime: JSString = "creationTime" + @usableFromInline static let credProps: JSString = "credProps" + @usableFromInline static let credential: JSString = "credential" + @usableFromInline static let credentialIds: JSString = "credentialIds" + @usableFromInline static let credentialType: JSString = "credentialType" + @usableFromInline static let credentials: JSString = "credentials" + @usableFromInline static let cropTo: JSString = "cropTo" + @usableFromInline static let crossOrigin: JSString = "crossOrigin" + @usableFromInline static let crossOriginIsolated: JSString = "crossOriginIsolated" + @usableFromInline static let crv: JSString = "crv" + @usableFromInline static let crypto: JSString = "crypto" + @usableFromInline static let csp: JSString = "csp" + @usableFromInline static let cssFloat: JSString = "cssFloat" + @usableFromInline static let cssRules: JSString = "cssRules" + @usableFromInline static let cssText: JSString = "cssText" + @usableFromInline static let ctrlKey: JSString = "ctrlKey" + @usableFromInline static let cues: JSString = "cues" + @usableFromInline static let cullFace: JSString = "cullFace" + @usableFromInline static let cullMode: JSString = "cullMode" + @usableFromInline static let currency: JSString = "currency" + @usableFromInline static let currentDirection: JSString = "currentDirection" + @usableFromInline static let currentEntry: JSString = "currentEntry" + @usableFromInline static let currentFrame: JSString = "currentFrame" + @usableFromInline static let currentIteration: JSString = "currentIteration" + @usableFromInline static let currentLocalDescription: JSString = "currentLocalDescription" + @usableFromInline static let currentNode: JSString = "currentNode" + @usableFromInline static let currentRect: JSString = "currentRect" + @usableFromInline static let currentRemoteDescription: JSString = "currentRemoteDescription" + @usableFromInline static let currentRoundTripTime: JSString = "currentRoundTripTime" + @usableFromInline static let currentScale: JSString = "currentScale" + @usableFromInline static let currentScript: JSString = "currentScript" + @usableFromInline static let currentSrc: JSString = "currentSrc" + @usableFromInline static let currentTarget: JSString = "currentTarget" + @usableFromInline static let currentTime: JSString = "currentTime" + @usableFromInline static let currentTranslate: JSString = "currentTranslate" + @usableFromInline static let cursor: JSString = "cursor" + @usableFromInline static let curve: JSString = "curve" + @usableFromInline static let customElements: JSString = "customElements" + @usableFromInline static let customError: JSString = "customError" + @usableFromInline static let customSections: JSString = "customSections" + @usableFromInline static let cx: JSString = "cx" + @usableFromInline static let cy: JSString = "cy" + @usableFromInline static let d: JSString = "d" + @usableFromInline static let data: JSString = "data" + @usableFromInline static let dataBits: JSString = "dataBits" + @usableFromInline static let dataCarrierDetect: JSString = "dataCarrierDetect" + @usableFromInline static let dataChannelIdentifier: JSString = "dataChannelIdentifier" + @usableFromInline static let dataChannelsAccepted: JSString = "dataChannelsAccepted" + @usableFromInline static let dataChannelsClosed: JSString = "dataChannelsClosed" + @usableFromInline static let dataChannelsOpened: JSString = "dataChannelsOpened" + @usableFromInline static let dataChannelsRequested: JSString = "dataChannelsRequested" + @usableFromInline static let dataFormatPreference: JSString = "dataFormatPreference" + @usableFromInline static let dataPrefix: JSString = "dataPrefix" + @usableFromInline static let dataSetReady: JSString = "dataSetReady" + @usableFromInline static let dataTerminalReady: JSString = "dataTerminalReady" + @usableFromInline static let dataTransfer: JSString = "dataTransfer" + @usableFromInline static let databases: JSString = "databases" + @usableFromInline static let datagrams: JSString = "datagrams" + @usableFromInline static let dataset: JSString = "dataset" + @usableFromInline static let dateTime: JSString = "dateTime" + @usableFromInline static let db: JSString = "db" + @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 decodedBodySize: JSString = "decodedBodySize" + @usableFromInline static let decoderConfig: JSString = "decoderConfig" + @usableFromInline static let decoderImplementation: JSString = "decoderImplementation" + @usableFromInline static let decoding: JSString = "decoding" + @usableFromInline static let decodingInfo: JSString = "decodingInfo" + @usableFromInline static let decrypt: JSString = "decrypt" + @usableFromInline static let `default`: JSString = "default" + @usableFromInline static let defaultChecked: JSString = "defaultChecked" + @usableFromInline static let defaultFrameRate: JSString = "defaultFrameRate" + @usableFromInline static let defaultMuted: JSString = "defaultMuted" + @usableFromInline static let defaultPlaybackRate: JSString = "defaultPlaybackRate" + @usableFromInline static let defaultPolicy: JSString = "defaultPolicy" + @usableFromInline static let defaultPrevented: JSString = "defaultPrevented" + @usableFromInline static let defaultQueue: JSString = "defaultQueue" + @usableFromInline static let defaultRequest: JSString = "defaultRequest" + @usableFromInline static let defaultSampleRate: JSString = "defaultSampleRate" + @usableFromInline static let defaultSelected: JSString = "defaultSelected" + @usableFromInline static let defaultValue: JSString = "defaultValue" + @usableFromInline static let defaultView: JSString = "defaultView" + @usableFromInline static let `defer`: JSString = "defer" + @usableFromInline static let deg: JSString = "deg" + @usableFromInline static let degradationPreference: JSString = "degradationPreference" + @usableFromInline static let delay: JSString = "delay" + @usableFromInline static let delayTime: JSString = "delayTime" + @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 deleteDatabase: JSString = "deleteDatabase" + @usableFromInline static let deleteFramebuffer: JSString = "deleteFramebuffer" + @usableFromInline static let deleteFromDocument: JSString = "deleteFromDocument" + @usableFromInline static let deleteIndex: JSString = "deleteIndex" + @usableFromInline static let deleteMedium: JSString = "deleteMedium" + @usableFromInline static let deleteObjectStore: JSString = "deleteObjectStore" + @usableFromInline static let deleteProgram: JSString = "deleteProgram" + @usableFromInline static let deleteQuery: JSString = "deleteQuery" + @usableFromInline static let deleteQueryEXT: JSString = "deleteQueryEXT" + @usableFromInline static let deleteRenderbuffer: JSString = "deleteRenderbuffer" + @usableFromInline static let deleteRow: JSString = "deleteRow" + @usableFromInline static let deleteRule: JSString = "deleteRule" + @usableFromInline static let deleteSampler: JSString = "deleteSampler" + @usableFromInline static let deleteShader: JSString = "deleteShader" + @usableFromInline static let deleteSync: JSString = "deleteSync" + @usableFromInline static let deleteTFoot: JSString = "deleteTFoot" + @usableFromInline static let deleteTHead: JSString = "deleteTHead" + @usableFromInline static let deleteTexture: JSString = "deleteTexture" + @usableFromInline static let deleteTransformFeedback: JSString = "deleteTransformFeedback" + @usableFromInline static let deleteVertexArray: JSString = "deleteVertexArray" + @usableFromInline static let deleteVertexArrayOES: JSString = "deleteVertexArrayOES" + @usableFromInline static let deleted: JSString = "deleted" + @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 dependencies: JSString = "dependencies" + @usableFromInline static let dependentLocality: JSString = "dependentLocality" + @usableFromInline static let depth: JSString = "depth" + @usableFromInline static let depthBias: JSString = "depthBias" + @usableFromInline static let depthBiasClamp: JSString = "depthBiasClamp" + @usableFromInline static let depthBiasSlopeScale: JSString = "depthBiasSlopeScale" + @usableFromInline static let depthClearValue: JSString = "depthClearValue" + @usableFromInline static let depthCompare: JSString = "depthCompare" + @usableFromInline static let depthDataFormat: JSString = "depthDataFormat" + @usableFromInline static let depthFailOp: JSString = "depthFailOp" + @usableFromInline static let depthFar: JSString = "depthFar" + @usableFromInline static let depthFormat: JSString = "depthFormat" + @usableFromInline static let depthFunc: JSString = "depthFunc" + @usableFromInline static let depthLoadOp: JSString = "depthLoadOp" + @usableFromInline static let depthMask: JSString = "depthMask" + @usableFromInline static let depthNear: JSString = "depthNear" + @usableFromInline static let depthOrArrayLayers: JSString = "depthOrArrayLayers" + @usableFromInline static let depthRange: JSString = "depthRange" + @usableFromInline static let depthReadOnly: JSString = "depthReadOnly" + @usableFromInline static let depthSensing: JSString = "depthSensing" + @usableFromInline static let depthStencil: JSString = "depthStencil" + @usableFromInline static let depthStencilAttachment: JSString = "depthStencilAttachment" + @usableFromInline static let depthStencilFormat: JSString = "depthStencilFormat" + @usableFromInline static let depthStencilTexture: JSString = "depthStencilTexture" + @usableFromInline static let depthStoreOp: JSString = "depthStoreOp" + @usableFromInline static let depthUsage: JSString = "depthUsage" + @usableFromInline static let depthWriteEnabled: JSString = "depthWriteEnabled" + @usableFromInline static let deriveBits: JSString = "deriveBits" + @usableFromInline static let deriveKey: JSString = "deriveKey" + @usableFromInline static let descentOverride: JSString = "descentOverride" + @usableFromInline static let description: JSString = "description" + @usableFromInline static let descriptor: JSString = "descriptor" + @usableFromInline static let deselectAll: JSString = "deselectAll" + @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 destroy: JSString = "destroy" + @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 details: JSString = "details" + @usableFromInline static let detect: JSString = "detect" + @usableFromInline static let detune: JSString = "detune" + @usableFromInline static let device: JSString = "device" + @usableFromInline static let deviceClass: JSString = "deviceClass" + @usableFromInline static let deviceId: JSString = "deviceId" + @usableFromInline static let deviceMemory: JSString = "deviceMemory" + @usableFromInline static let devicePixelContentBoxSize: JSString = "devicePixelContentBoxSize" + @usableFromInline static let devicePixelRatio: JSString = "devicePixelRatio" + @usableFromInline static let devicePosture: JSString = "devicePosture" + @usableFromInline static let devicePreference: JSString = "devicePreference" + @usableFromInline static let deviceProtocol: JSString = "deviceProtocol" + @usableFromInline static let deviceSubclass: JSString = "deviceSubclass" + @usableFromInline static let deviceVersionMajor: JSString = "deviceVersionMajor" + @usableFromInline static let deviceVersionMinor: JSString = "deviceVersionMinor" + @usableFromInline static let deviceVersionSubminor: JSString = "deviceVersionSubminor" + @usableFromInline static let devices: JSString = "devices" + @usableFromInline static let diameter: JSString = "diameter" + @usableFromInline static let didTimeout: JSString = "didTimeout" + @usableFromInline static let diffuseConstant: JSString = "diffuseConstant" + @usableFromInline static let digest: JSString = "digest" + @usableFromInline static let dilations: JSString = "dilations" + @usableFromInline static let dimension: JSString = "dimension" + @usableFromInline static let dimensions: JSString = "dimensions" + @usableFromInline static let dir: JSString = "dir" + @usableFromInline static let dirName: JSString = "dirName" + @usableFromInline static let direction: JSString = "direction" + @usableFromInline static let dirxml: JSString = "dirxml" + @usableFromInline static let disable: JSString = "disable" + @usableFromInline static let disableNormalization: JSString = "disableNormalization" + @usableFromInline static let disablePictureInPicture: JSString = "disablePictureInPicture" + @usableFromInline static let disableRemotePlayback: JSString = "disableRemotePlayback" + @usableFromInline static let disableVertexAttribArray: JSString = "disableVertexAttribArray" + @usableFromInline static let disabled: JSString = "disabled" + @usableFromInline static let disableiOES: JSString = "disableiOES" + @usableFromInline static let dischargingTime: JSString = "dischargingTime" + @usableFromInline static let disconnect: JSString = "disconnect" + @usableFromInline static let dispatch: JSString = "dispatch" + @usableFromInline static let dispatchEvent: JSString = "dispatchEvent" + @usableFromInline static let dispatchIndirect: JSString = "dispatchIndirect" + @usableFromInline static let display: JSString = "display" + @usableFromInline static let displayAspectHeight: JSString = "displayAspectHeight" + @usableFromInline static let displayAspectWidth: JSString = "displayAspectWidth" + @usableFromInline static let displayHeight: JSString = "displayHeight" + @usableFromInline static let displayItems: JSString = "displayItems" + @usableFromInline static let displayName: JSString = "displayName" + @usableFromInline static let displaySurface: JSString = "displaySurface" + @usableFromInline static let displayWidth: JSString = "displayWidth" + @usableFromInline static let disposition: JSString = "disposition" + @usableFromInline static let distance: JSString = "distance" + @usableFromInline static let distanceModel: JSString = "distanceModel" + @usableFromInline static let distinctiveIdentifier: JSString = "distinctiveIdentifier" + @usableFromInline static let div: JSString = "div" + @usableFromInline static let divisor: JSString = "divisor" + @usableFromInline static let doctype: JSString = "doctype" + @usableFromInline static let document: JSString = "document" + @usableFromInline static let documentElement: JSString = "documentElement" + @usableFromInline static let documentURI: JSString = "documentURI" + @usableFromInline static let documentURL: JSString = "documentURL" + @usableFromInline static let domComplete: JSString = "domComplete" + @usableFromInline static let domContentLoadedEventEnd: JSString = "domContentLoadedEventEnd" + @usableFromInline static let domContentLoadedEventStart: JSString = "domContentLoadedEventStart" + @usableFromInline static let domInteractive: JSString = "domInteractive" + @usableFromInline static let domLoading: JSString = "domLoading" + @usableFromInline static let domOverlay: JSString = "domOverlay" + @usableFromInline static let domOverlayState: JSString = "domOverlayState" + @usableFromInline static let domain: JSString = "domain" + @usableFromInline static let domainLookupEnd: JSString = "domainLookupEnd" + @usableFromInline static let domainLookupStart: JSString = "domainLookupStart" + @usableFromInline static let dominantBaseline: JSString = "dominantBaseline" + @usableFromInline static let done: JSString = "done" + @usableFromInline static let downlink: JSString = "downlink" + @usableFromInline static let downlinkMax: JSString = "downlinkMax" + @usableFromInline static let download: JSString = "download" + @usableFromInline static let downloadTotal: JSString = "downloadTotal" + @usableFromInline static let downloaded: JSString = "downloaded" + @usableFromInline static let dp: JSString = "dp" + @usableFromInline static let dpcm: JSString = "dpcm" + @usableFromInline static let dpi: JSString = "dpi" + @usableFromInline static let dppx: JSString = "dppx" + @usableFromInline static let dq: JSString = "dq" + @usableFromInline static let draggable: JSString = "draggable" + @usableFromInline static let draw: JSString = "draw" + @usableFromInline static let drawArrays: JSString = "drawArrays" + @usableFromInline static let drawArraysInstanced: JSString = "drawArraysInstanced" + @usableFromInline static let drawArraysInstancedANGLE: JSString = "drawArraysInstancedANGLE" + @usableFromInline static let drawArraysInstancedBaseInstanceWEBGL: JSString = "drawArraysInstancedBaseInstanceWEBGL" + @usableFromInline static let drawBuffers: JSString = "drawBuffers" + @usableFromInline static let drawBuffersWEBGL: JSString = "drawBuffersWEBGL" + @usableFromInline static let drawElements: JSString = "drawElements" + @usableFromInline static let drawElementsInstanced: JSString = "drawElementsInstanced" + @usableFromInline static let drawElementsInstancedANGLE: JSString = "drawElementsInstancedANGLE" + @usableFromInline static let drawElementsInstancedBaseVertexBaseInstanceWEBGL: JSString = "drawElementsInstancedBaseVertexBaseInstanceWEBGL" + @usableFromInline static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded" + @usableFromInline static let drawImage: JSString = "drawImage" + @usableFromInline static let drawIndexed: JSString = "drawIndexed" + @usableFromInline static let drawIndexedIndirect: JSString = "drawIndexedIndirect" + @usableFromInline static let drawIndirect: JSString = "drawIndirect" + @usableFromInline static let drawRangeElements: JSString = "drawRangeElements" + @usableFromInline static let drawingBufferHeight: JSString = "drawingBufferHeight" + @usableFromInline static let drawingBufferWidth: JSString = "drawingBufferWidth" + @usableFromInline static let dropAttributes: JSString = "dropAttributes" + @usableFromInline static let dropEffect: JSString = "dropEffect" + @usableFromInline static let dropElements: JSString = "dropElements" + @usableFromInline static let droppedEntriesCount: JSString = "droppedEntriesCount" + @usableFromInline static let droppedVideoFrames: JSString = "droppedVideoFrames" + @usableFromInline static let dstFactor: JSString = "dstFactor" + @usableFromInline static let dtlsCipher: JSString = "dtlsCipher" + @usableFromInline static let dtlsState: JSString = "dtlsState" + @usableFromInline static let dtmf: JSString = "dtmf" + @usableFromInline static let durability: JSString = "durability" + @usableFromInline static let duration: JSString = "duration" + @usableFromInline static let durationThreshold: JSString = "durationThreshold" + @usableFromInline static let dvb: JSString = "dvb" + @usableFromInline static let dvh: JSString = "dvh" + @usableFromInline static let dvi: JSString = "dvi" + @usableFromInline static let dvmax: JSString = "dvmax" + @usableFromInline static let dvmin: JSString = "dvmin" + @usableFromInline static let dvw: JSString = "dvw" + @usableFromInline static let dx: JSString = "dx" + @usableFromInline static let dy: JSString = "dy" + @usableFromInline static let e: JSString = "e" + @usableFromInline static let easing: JSString = "easing" + @usableFromInline static let echoCancellation: JSString = "echoCancellation" + @usableFromInline static let echoReturnLoss: JSString = "echoReturnLoss" + @usableFromInline static let echoReturnLossEnhancement: JSString = "echoReturnLossEnhancement" + @usableFromInline static let edge: JSString = "edge" + @usableFromInline static let edgeMode: JSString = "edgeMode" + @usableFromInline static let editContext: JSString = "editContext" + @usableFromInline static let effect: JSString = "effect" + @usableFromInline static let effectAllowed: JSString = "effectAllowed" + @usableFromInline static let effectiveDirective: JSString = "effectiveDirective" + @usableFromInline static let effectiveType: JSString = "effectiveType" + @usableFromInline static let elapsedTime: JSString = "elapsedTime" + @usableFromInline static let element: JSString = "element" + @usableFromInline static let elementFromPoint: JSString = "elementFromPoint" + @usableFromInline static let elementSources: JSString = "elementSources" + @usableFromInline static let elementTiming: JSString = "elementTiming" + @usableFromInline static let elements: JSString = "elements" + @usableFromInline static let elementsFromPoint: JSString = "elementsFromPoint" + @usableFromInline static let elevation: JSString = "elevation" + @usableFromInline static let ellipse: JSString = "ellipse" + @usableFromInline static let elu: JSString = "elu" + @usableFromInline static let em: JSString = "em" + @usableFromInline static let emHeightAscent: JSString = "emHeightAscent" + @usableFromInline static let emHeightDescent: JSString = "emHeightDescent" + @usableFromInline static let email: JSString = "email" + @usableFromInline static let embeds: JSString = "embeds" + @usableFromInline static let empty: JSString = "empty" + @usableFromInline static let emptyHTML: JSString = "emptyHTML" + @usableFromInline static let emptyScript: JSString = "emptyScript" + @usableFromInline static let emulatedPosition: JSString = "emulatedPosition" + @usableFromInline static let enable: JSString = "enable" + @usableFromInline static let enableHighAccuracy: JSString = "enableHighAccuracy" + @usableFromInline static let enableVertexAttribArray: JSString = "enableVertexAttribArray" + @usableFromInline static let enabled: JSString = "enabled" + @usableFromInline static let enabledPlugin: JSString = "enabledPlugin" + @usableFromInline static let enableiOES: JSString = "enableiOES" + @usableFromInline static let encode: JSString = "encode" + @usableFromInline static let encodeInto: JSString = "encodeInto" + @usableFromInline static let encodeQueueSize: JSString = "encodeQueueSize" + @usableFromInline static let encodedBodySize: JSString = "encodedBodySize" + @usableFromInline static let encoderImplementation: JSString = "encoderImplementation" + @usableFromInline static let encoding: JSString = "encoding" + @usableFromInline static let encodingInfo: JSString = "encodingInfo" + @usableFromInline static let encodings: JSString = "encodings" + @usableFromInline static let encrypt: JSString = "encrypt" + @usableFromInline static let encrypted: JSString = "encrypted" + @usableFromInline static let encryptionScheme: JSString = "encryptionScheme" + @usableFromInline static let enctype: JSString = "enctype" + @usableFromInline static let end: JSString = "end" + @usableFromInline static let endContainer: JSString = "endContainer" + @usableFromInline static let endDelay: JSString = "endDelay" + @usableFromInline static let endElement: JSString = "endElement" + @usableFromInline static let endElementAt: JSString = "endElementAt" + @usableFromInline static let endOcclusionQuery: JSString = "endOcclusionQuery" + @usableFromInline static let endOfStream: JSString = "endOfStream" + @usableFromInline static let endOffset: JSString = "endOffset" + @usableFromInline static let endQuery: JSString = "endQuery" + @usableFromInline static let endQueryEXT: JSString = "endQueryEXT" + @usableFromInline static let endTime: JSString = "endTime" + @usableFromInline static let endTransformFeedback: JSString = "endTransformFeedback" + @usableFromInline static let ended: JSString = "ended" + @usableFromInline static let endings: JSString = "endings" + @usableFromInline static let endpoint: JSString = "endpoint" + @usableFromInline static let endpointNumber: JSString = "endpointNumber" + @usableFromInline static let endpoints: JSString = "endpoints" + @usableFromInline static let enqueue: JSString = "enqueue" + @usableFromInline static let enterKeyHint: JSString = "enterKeyHint" + @usableFromInline static let entityTypes: JSString = "entityTypes" + @usableFromInline static let entries: JSString = "entries" + @usableFromInline static let entryPoint: JSString = "entryPoint" + @usableFromInline static let entryType: JSString = "entryType" + @usableFromInline static let entryTypes: JSString = "entryTypes" + @usableFromInline static let enumerateDevices: JSString = "enumerateDevices" + @usableFromInline static let environmentBlendMode: JSString = "environmentBlendMode" + @usableFromInline static let epsilon: JSString = "epsilon" + @usableFromInline static let equals: JSString = "equals" + @usableFromInline static let error: JSString = "error" + @usableFromInline static let errorCode: JSString = "errorCode" + @usableFromInline static let errorDetail: JSString = "errorDetail" + @usableFromInline static let errorText: JSString = "errorText" + @usableFromInline static let errorType: JSString = "errorType" + @usableFromInline static let escape: JSString = "escape" + @usableFromInline static let estimate: JSString = "estimate" + @usableFromInline static let estimatedPlayoutTimestamp: JSString = "estimatedPlayoutTimestamp" + @usableFromInline static let evaluate: JSString = "evaluate" + @usableFromInline static let event: JSString = "event" + @usableFromInline static let eventCounts: JSString = "eventCounts" + @usableFromInline static let eventPhase: JSString = "eventPhase" + @usableFromInline static let ex: JSString = "ex" + @usableFromInline static let exact: JSString = "exact" + @usableFromInline static let excludeAcceptAllOption: JSString = "excludeAcceptAllOption" + @usableFromInline static let excludeCredentials: JSString = "excludeCredentials" + @usableFromInline static let exclusive: JSString = "exclusive" + @usableFromInline static let exec: JSString = "exec" + @usableFromInline static let execCommand: JSString = "execCommand" + @usableFromInline static let executeBundles: JSString = "executeBundles" + @usableFromInline static let exitFullscreen: JSString = "exitFullscreen" + @usableFromInline static let exitPictureInPicture: JSString = "exitPictureInPicture" + @usableFromInline static let exitPointerLock: JSString = "exitPointerLock" + @usableFromInline static let exp: JSString = "exp" + @usableFromInline static let expectedDisplayTime: JSString = "expectedDisplayTime" + @usableFromInline static let expectedImprovement: JSString = "expectedImprovement" + @usableFromInline static let expiration: JSString = "expiration" + @usableFromInline static let expirationTime: JSString = "expirationTime" + @usableFromInline static let expired: JSString = "expired" + @usableFromInline static let expires: JSString = "expires" + @usableFromInline static let exponent: JSString = "exponent" + @usableFromInline static let exponentialRampToValueAtTime: JSString = "exponentialRampToValueAtTime" + @usableFromInline static let exportKey: JSString = "exportKey" + @usableFromInline static let exports: JSString = "exports" + @usableFromInline static let exposureCompensation: JSString = "exposureCompensation" + @usableFromInline static let exposureMode: JSString = "exposureMode" + @usableFromInline static let exposureTime: JSString = "exposureTime" + @usableFromInline static let ext: JSString = "ext" + @usableFromInline static let extend: JSString = "extend" + @usableFromInline static let extends: JSString = "extends" + @usableFromInline static let extensions: JSString = "extensions" + @usableFromInline static let external: JSString = "external" + @usableFromInline static let externalTexture: JSString = "externalTexture" + @usableFromInline static let extractContents: JSString = "extractContents" + @usableFromInline static let extractable: JSString = "extractable" + @usableFromInline static let eye: JSString = "eye" + @usableFromInline static let f: JSString = "f" + @usableFromInline static let face: JSString = "face" + @usableFromInline static let facingMode: JSString = "facingMode" + @usableFromInline static let factors: JSString = "factors" + @usableFromInline static let failIfMajorPerformanceCaveat: JSString = "failIfMajorPerformanceCaveat" + @usableFromInline static let failOp: JSString = "failOp" + @usableFromInline static let failureReason: JSString = "failureReason" + @usableFromInline static let fallback: JSString = "fallback" + @usableFromInline static let family: JSString = "family" + @usableFromInline static let fastMode: JSString = "fastMode" + @usableFromInline static let fastSeek: JSString = "fastSeek" + @usableFromInline static let fatal: JSString = "fatal" + @usableFromInline static let featureId: JSString = "featureId" + @usableFromInline static let featureReports: JSString = "featureReports" + @usableFromInline static let featureSettings: JSString = "featureSettings" + @usableFromInline static let features: JSString = "features" + @usableFromInline static let fecPacketsDiscarded: JSString = "fecPacketsDiscarded" + @usableFromInline static let fecPacketsReceived: JSString = "fecPacketsReceived" + @usableFromInline static let fecPacketsSent: JSString = "fecPacketsSent" + @usableFromInline static let federated: JSString = "federated" + @usableFromInline static let feedback: JSString = "feedback" + @usableFromInline static let feedforward: JSString = "feedforward" + @usableFromInline static let fenceSync: JSString = "fenceSync" + @usableFromInline static let fetch: JSString = "fetch" + @usableFromInline static let fetchStart: JSString = "fetchStart" + @usableFromInline static let fetchpriority: JSString = "fetchpriority" + @usableFromInline static let fftSize: JSString = "fftSize" + @usableFromInline static let fgColor: JSString = "fgColor" + @usableFromInline static let filename: JSString = "filename" + @usableFromInline static let files: JSString = "files" + @usableFromInline static let filesystem: JSString = "filesystem" + @usableFromInline static let fill: JSString = "fill" + @usableFromInline static let fillJointRadii: JSString = "fillJointRadii" + @usableFromInline static let fillLightMode: JSString = "fillLightMode" + @usableFromInline static let fillPoses: JSString = "fillPoses" + @usableFromInline static let fillRect: JSString = "fillRect" + @usableFromInline static let fillStyle: JSString = "fillStyle" + @usableFromInline static let fillText: JSString = "fillText" + @usableFromInline static let filter: JSString = "filter" + @usableFromInline static let filterLayout: JSString = "filterLayout" + @usableFromInline static let filterUnits: JSString = "filterUnits" + @usableFromInline static let filters: JSString = "filters" + @usableFromInline static let findRule: JSString = "findRule" + @usableFromInline static let fingerprint: JSString = "fingerprint" + @usableFromInline static let fingerprintAlgorithm: JSString = "fingerprintAlgorithm" + @usableFromInline static let finish: JSString = "finish" + @usableFromInline static let finished: JSString = "finished" + @usableFromInline static let firCount: JSString = "firCount" + @usableFromInline static let firesTouchEvents: JSString = "firesTouchEvents" + @usableFromInline static let firstChild: JSString = "firstChild" + @usableFromInline static let firstElementChild: JSString = "firstElementChild" + @usableFromInline static let firstEmptyRegionIndex: JSString = "firstEmptyRegionIndex" + @usableFromInline static let firstRequestTimestamp: JSString = "firstRequestTimestamp" + @usableFromInline static let fixedBlockSize: JSString = "fixedBlockSize" + @usableFromInline static let fixedFoveation: JSString = "fixedFoveation" + @usableFromInline static let fixedInlineSize: JSString = "fixedInlineSize" + @usableFromInline static let flatten: JSString = "flatten" + @usableFromInline static let flex: JSString = "flex" + @usableFromInline static let flipX: JSString = "flipX" + @usableFromInline static let flipY: JSString = "flipY" + @usableFromInline static let floor: JSString = "floor" + @usableFromInline static let flowControl: JSString = "flowControl" + @usableFromInline static let flush: JSString = "flush" + @usableFromInline static let focus: JSString = "focus" + @usableFromInline static let focusDistance: JSString = "focusDistance" + @usableFromInline static let focusMode: JSString = "focusMode" + @usableFromInline static let focusNode: JSString = "focusNode" + @usableFromInline static let focusOffset: JSString = "focusOffset" + @usableFromInline static let focusableAreas: JSString = "focusableAreas" + @usableFromInline static let focused: JSString = "focused" + @usableFromInline static let font: JSString = "font" + @usableFromInline static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" + @usableFromInline static let fontBoundingBoxDescent: JSString = "fontBoundingBoxDescent" + @usableFromInline static let fontFamily: JSString = "fontFamily" + @usableFromInline static let fontKerning: JSString = "fontKerning" + @usableFromInline static let fontStretch: JSString = "fontStretch" + @usableFromInline static let fontVariantCaps: JSString = "fontVariantCaps" + @usableFromInline static let fontfaces: JSString = "fontfaces" + @usableFromInline static let fonts: JSString = "fonts" + @usableFromInline static let force: JSString = "force" + @usableFromInline static let forceFallbackAdapter: JSString = "forceFallbackAdapter" + @usableFromInline static let forceRedraw: JSString = "forceRedraw" + @usableFromInline static let forget: JSString = "forget" + @usableFromInline static let form: JSString = "form" + @usableFromInline static let formAction: JSString = "formAction" + @usableFromInline static let formData: JSString = "formData" + @usableFromInline static let formEnctype: JSString = "formEnctype" + @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 formats: JSString = "formats" + @usableFromInline static let forms: JSString = "forms" + @usableFromInline static let forward: JSString = "forward" + @usableFromInline static let forwardX: JSString = "forwardX" + @usableFromInline static let forwardY: JSString = "forwardY" + @usableFromInline static let forwardZ: JSString = "forwardZ" + @usableFromInline static let foundation: JSString = "foundation" + @usableFromInline static let fr: JSString = "fr" + @usableFromInline static let fractionLost: JSString = "fractionLost" + @usableFromInline static let fragment: JSString = "fragment" + @usableFromInline static let fragmentDirective: JSString = "fragmentDirective" + @usableFromInline static let frame: JSString = "frame" + @usableFromInline static let frameBitDepth: JSString = "frameBitDepth" + @usableFromInline static let frameBorder: JSString = "frameBorder" + @usableFromInline static let frameCount: JSString = "frameCount" + @usableFromInline static let frameElement: JSString = "frameElement" + @usableFromInline static let frameHeight: JSString = "frameHeight" + @usableFromInline static let frameId: JSString = "frameId" + @usableFromInline static let frameIndex: JSString = "frameIndex" + @usableFromInline static let frameOffset: JSString = "frameOffset" + @usableFromInline static let frameRate: JSString = "frameRate" + @usableFromInline static let frameType: JSString = "frameType" + @usableFromInline static let frameWidth: JSString = "frameWidth" + @usableFromInline static let framebuffer: JSString = "framebuffer" + @usableFromInline static let framebufferHeight: JSString = "framebufferHeight" + @usableFromInline static let framebufferRenderbuffer: JSString = "framebufferRenderbuffer" + @usableFromInline static let framebufferScaleFactor: JSString = "framebufferScaleFactor" + @usableFromInline static let framebufferTexture2D: JSString = "framebufferTexture2D" + @usableFromInline static let framebufferTextureLayer: JSString = "framebufferTextureLayer" + @usableFromInline static let framebufferTextureMultiviewOVR: JSString = "framebufferTextureMultiviewOVR" + @usableFromInline static let framebufferWidth: JSString = "framebufferWidth" + @usableFromInline static let framerate: JSString = "framerate" + @usableFromInline static let frames: JSString = "frames" + @usableFromInline static let framesDecoded: JSString = "framesDecoded" + @usableFromInline static let framesDiscardedOnSend: JSString = "framesDiscardedOnSend" + @usableFromInline static let framesDropped: JSString = "framesDropped" + @usableFromInline static let framesEncoded: JSString = "framesEncoded" + @usableFromInline static let framesPerSecond: JSString = "framesPerSecond" + @usableFromInline static let framesReceived: JSString = "framesReceived" + @usableFromInline static let framesSent: JSString = "framesSent" + @usableFromInline static let freeTrialPeriod: JSString = "freeTrialPeriod" + @usableFromInline static let frequency: JSString = "frequency" + @usableFromInline static let frequencyBinCount: JSString = "frequencyBinCount" + @usableFromInline static let from: JSString = "from" + @usableFromInline static let fromBox: JSString = "fromBox" + @usableFromInline static let fromFloat32Array: JSString = "fromFloat32Array" + @usableFromInline static let fromFloat64Array: JSString = "fromFloat64Array" + @usableFromInline static let fromLiteral: JSString = "fromLiteral" + @usableFromInline static let fromMatrix: JSString = "fromMatrix" + @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 fullFramesLost: JSString = "fullFramesLost" + @usableFromInline static let fullName: JSString = "fullName" + @usableFromInline static let fullPath: JSString = "fullPath" + @usableFromInline static let fullRange: JSString = "fullRange" + @usableFromInline static let fullVersionList: JSString = "fullVersionList" + @usableFromInline static let fullscreen: JSString = "fullscreen" + @usableFromInline static let fullscreenElement: JSString = "fullscreenElement" + @usableFromInline static let fullscreenEnabled: JSString = "fullscreenEnabled" + @usableFromInline static let fx: JSString = "fx" + @usableFromInline static let fy: JSString = "fy" + @usableFromInline static let g: JSString = "g" + @usableFromInline static let gain: JSString = "gain" + @usableFromInline static let gamepad: JSString = "gamepad" + @usableFromInline static let gamma: JSString = "gamma" + @usableFromInline static let gapDiscardRate: JSString = "gapDiscardRate" + @usableFromInline static let gapLossRate: JSString = "gapLossRate" + @usableFromInline static let gather: JSString = "gather" + @usableFromInline static let gatherPolicy: JSString = "gatherPolicy" + @usableFromInline static let gatheringState: JSString = "gatheringState" + @usableFromInline static let gatt: JSString = "gatt" + @usableFromInline static let gc: JSString = "gc" + @usableFromInline static let gemm: JSString = "gemm" + @usableFromInline static let generateAssertion: JSString = "generateAssertion" + @usableFromInline static let generateCertificate: JSString = "generateCertificate" + @usableFromInline static let generateKey: JSString = "generateKey" + @usableFromInline static let generateKeyFrame: JSString = "generateKeyFrame" + @usableFromInline static let generateMipmap: JSString = "generateMipmap" + @usableFromInline static let generateRequest: JSString = "generateRequest" + @usableFromInline static let geolocation: JSString = "geolocation" + @usableFromInline static let get: JSString = "get" + @usableFromInline static let getActiveAttrib: JSString = "getActiveAttrib" + @usableFromInline static let getActiveUniform: JSString = "getActiveUniform" + @usableFromInline static let getActiveUniformBlockName: JSString = "getActiveUniformBlockName" + @usableFromInline static let getActiveUniformBlockParameter: JSString = "getActiveUniformBlockParameter" + @usableFromInline static let getActiveUniforms: JSString = "getActiveUniforms" + @usableFromInline static let getAll: JSString = "getAll" + @usableFromInline static let getAllKeys: JSString = "getAllKeys" + @usableFromInline static let getAllResponseHeaders: JSString = "getAllResponseHeaders" + @usableFromInline static let getAllowlistForFeature: JSString = "getAllowlistForFeature" + @usableFromInline static let getAnimations: JSString = "getAnimations" + @usableFromInline static let getAsFile: JSString = "getAsFile" + @usableFromInline static let getAsFileSystemHandle: JSString = "getAsFileSystemHandle" + @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" + @usableFromInline static let getAttributeNode: JSString = "getAttributeNode" + @usableFromInline static let getAttributeNodeNS: JSString = "getAttributeNodeNS" + @usableFromInline static let getAttributeType: JSString = "getAttributeType" + @usableFromInline static let getAudioTracks: JSString = "getAudioTracks" + @usableFromInline static let getAuthenticatorData: JSString = "getAuthenticatorData" + @usableFromInline static let getAutoplayPolicy: JSString = "getAutoplayPolicy" + @usableFromInline static let getAvailability: JSString = "getAvailability" + @usableFromInline static let getBBox: JSString = "getBBox" + @usableFromInline static let getBattery: JSString = "getBattery" + @usableFromInline static let getBindGroupLayout: JSString = "getBindGroupLayout" + @usableFromInline static let getBoundingClientRect: JSString = "getBoundingClientRect" + @usableFromInline static let getBounds: JSString = "getBounds" + @usableFromInline static let getBoxQuads: JSString = "getBoxQuads" + @usableFromInline static let getBufferParameter: JSString = "getBufferParameter" + @usableFromInline static let getBufferSubData: JSString = "getBufferSubData" + @usableFromInline static let getByteFrequencyData: JSString = "getByteFrequencyData" + @usableFromInline static let getByteTimeDomainData: JSString = "getByteTimeDomainData" + @usableFromInline static let getCTM: JSString = "getCTM" + @usableFromInline static let getCapabilities: JSString = "getCapabilities" + @usableFromInline static let getChannelData: JSString = "getChannelData" + @usableFromInline static let getCharNumAtPosition: JSString = "getCharNumAtPosition" + @usableFromInline static let getCharacteristic: JSString = "getCharacteristic" + @usableFromInline static let getCharacteristics: JSString = "getCharacteristics" + @usableFromInline static let getChildren: JSString = "getChildren" + @usableFromInline static let getClientExtensionResults: JSString = "getClientExtensionResults" + @usableFromInline static let getClientRect: JSString = "getClientRect" + @usableFromInline static let getClientRects: JSString = "getClientRects" + @usableFromInline static let getCoalescedEvents: JSString = "getCoalescedEvents" + @usableFromInline static let getComputedStyle: JSString = "getComputedStyle" + @usableFromInline static let getComputedTextLength: JSString = "getComputedTextLength" + @usableFromInline static let getComputedTiming: JSString = "getComputedTiming" + @usableFromInline static let getConfiguration: JSString = "getConfiguration" + @usableFromInline static let getConstraints: JSString = "getConstraints" + @usableFromInline static let getContent: JSString = "getContent" + @usableFromInline static let getContext: JSString = "getContext" + @usableFromInline static let getContextAttributes: JSString = "getContextAttributes" + @usableFromInline static let getContributingSources: JSString = "getContributingSources" + @usableFromInline static let getCueAsHTML: JSString = "getCueAsHTML" + @usableFromInline static let getCueById: JSString = "getCueById" + @usableFromInline static let getCurrentTexture: JSString = "getCurrentTexture" + @usableFromInline static let getCurrentTime: JSString = "getCurrentTime" + @usableFromInline static let getData: JSString = "getData" + @usableFromInline static let getDefaultConfiguration: JSString = "getDefaultConfiguration" + @usableFromInline static let getDepthInMeters: JSString = "getDepthInMeters" + @usableFromInline static let getDepthInformation: JSString = "getDepthInformation" + @usableFromInline static let getDescriptor: JSString = "getDescriptor" + @usableFromInline static let getDescriptors: JSString = "getDescriptors" + @usableFromInline static let getDetails: JSString = "getDetails" + @usableFromInline static let getDevices: JSString = "getDevices" + @usableFromInline static let getDigitalGoodsService: JSString = "getDigitalGoodsService" + @usableFromInline static let getDirectory: JSString = "getDirectory" + @usableFromInline static let getDirectoryHandle: JSString = "getDirectoryHandle" + @usableFromInline static let getDisplayMedia: JSString = "getDisplayMedia" + @usableFromInline static let getElementById: JSString = "getElementById" + @usableFromInline static let getElementsByClassName: JSString = "getElementsByClassName" + @usableFromInline static let getElementsByName: JSString = "getElementsByName" + @usableFromInline static let getElementsByTagName: JSString = "getElementsByTagName" + @usableFromInline static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" + @usableFromInline static let getEnclosureList: JSString = "getEnclosureList" + @usableFromInline static let getEndPositionOfChar: JSString = "getEndPositionOfChar" + @usableFromInline static let getEntries: JSString = "getEntries" + @usableFromInline static let getEntriesByName: JSString = "getEntriesByName" + @usableFromInline static let getEntriesByType: JSString = "getEntriesByType" + @usableFromInline static let getError: JSString = "getError" + @usableFromInline static let getExtension: JSString = "getExtension" + @usableFromInline static let getExtentOfChar: JSString = "getExtentOfChar" + @usableFromInline static let getFile: JSString = "getFile" + @usableFromInline static let getFileHandle: JSString = "getFileHandle" + @usableFromInline static let getFingerprints: JSString = "getFingerprints" + @usableFromInline static let getFloatFrequencyData: JSString = "getFloatFrequencyData" + @usableFromInline static let getFloatTimeDomainData: JSString = "getFloatTimeDomainData" + @usableFromInline static let getFragDataLocation: JSString = "getFragDataLocation" + @usableFromInline static let getFramebufferAttachmentParameter: JSString = "getFramebufferAttachmentParameter" + @usableFromInline static let getFrequencyResponse: JSString = "getFrequencyResponse" + @usableFromInline static let getGamepads: JSString = "getGamepads" + @usableFromInline static let getHighEntropyValues: JSString = "getHighEntropyValues" + @usableFromInline static let getHitTestResults: JSString = "getHitTestResults" + @usableFromInline static let getHitTestResultsForTransientInput: JSString = "getHitTestResultsForTransientInput" + @usableFromInline static let getIdentityAssertion: JSString = "getIdentityAssertion" + @usableFromInline static let getIds: JSString = "getIds" + @usableFromInline static let getImageData: JSString = "getImageData" + @usableFromInline static let getIncludedService: JSString = "getIncludedService" + @usableFromInline static let getIncludedServices: JSString = "getIncludedServices" + @usableFromInline static let getIndexedParameter: JSString = "getIndexedParameter" + @usableFromInline static let getInfo: JSString = "getInfo" + @usableFromInline static let getInstalledRelatedApps: JSString = "getInstalledRelatedApps" + @usableFromInline static let getInternalformatParameter: JSString = "getInternalformatParameter" + @usableFromInline static let getIntersectionList: JSString = "getIntersectionList" + @usableFromInline static let getJointPose: JSString = "getJointPose" + @usableFromInline static let getKey: JSString = "getKey" + @usableFromInline static let getKeyframes: JSString = "getKeyframes" + @usableFromInline static let getLayoutMap: JSString = "getLayoutMap" + @usableFromInline static let getLightEstimate: JSString = "getLightEstimate" + @usableFromInline static let getLineDash: JSString = "getLineDash" + @usableFromInline static let getLocalCandidates: JSString = "getLocalCandidates" + @usableFromInline static let getLocalParameters: JSString = "getLocalParameters" + @usableFromInline static let getMappedRange: JSString = "getMappedRange" + @usableFromInline static let getMetadata: JSString = "getMetadata" + @usableFromInline static let getModifierState: JSString = "getModifierState" + @usableFromInline static let getNamedItemNS: JSString = "getNamedItemNS" + @usableFromInline static let getNativeFramebufferScaleFactor: JSString = "getNativeFramebufferScaleFactor" + @usableFromInline static let getNotifications: JSString = "getNotifications" + @usableFromInline static let getNumberOfChars: JSString = "getNumberOfChars" + @usableFromInline static let getOffsetReferenceSpace: JSString = "getOffsetReferenceSpace" + @usableFromInline static let getOutputTimestamp: JSString = "getOutputTimestamp" + @usableFromInline static let getParameter: JSString = "getParameter" + @usableFromInline static let getParameters: JSString = "getParameters" + @usableFromInline static let getPhotoCapabilities: JSString = "getPhotoCapabilities" + @usableFromInline static let getPhotoSettings: JSString = "getPhotoSettings" + @usableFromInline static let getPointAtLength: JSString = "getPointAtLength" + @usableFromInline static let getPorts: JSString = "getPorts" + @usableFromInline static let getPose: JSString = "getPose" + @usableFromInline static let getPredictedEvents: JSString = "getPredictedEvents" + @usableFromInline static let getPreferredFormat: JSString = "getPreferredFormat" + @usableFromInline static let getPrimaryService: JSString = "getPrimaryService" + @usableFromInline static let getPrimaryServices: JSString = "getPrimaryServices" + @usableFromInline static let getProgramInfoLog: JSString = "getProgramInfoLog" + @usableFromInline static let getProgramParameter: JSString = "getProgramParameter" + @usableFromInline static let getProperties: JSString = "getProperties" + @usableFromInline static let getPropertyPriority: JSString = "getPropertyPriority" + @usableFromInline static let getPropertyType: JSString = "getPropertyType" + @usableFromInline static let getPropertyValue: JSString = "getPropertyValue" + @usableFromInline static let getPublicKey: JSString = "getPublicKey" + @usableFromInline static let getPublicKeyAlgorithm: JSString = "getPublicKeyAlgorithm" + @usableFromInline static let getQuery: JSString = "getQuery" + @usableFromInline static let getQueryEXT: JSString = "getQueryEXT" + @usableFromInline static let getQueryObjectEXT: JSString = "getQueryObjectEXT" + @usableFromInline static let getQueryParameter: JSString = "getQueryParameter" + @usableFromInline static let getRandomValues: JSString = "getRandomValues" + @usableFromInline static let getRangeAt: JSString = "getRangeAt" + @usableFromInline static let getReader: JSString = "getReader" + @usableFromInline static let getReceivers: JSString = "getReceivers" + @usableFromInline static let getReflectionCubeMap: JSString = "getReflectionCubeMap" + @usableFromInline static let getRegionFlowRanges: JSString = "getRegionFlowRanges" + @usableFromInline static let getRegions: JSString = "getRegions" + @usableFromInline static let getRegionsByContent: JSString = "getRegionsByContent" + @usableFromInline static let getRegistration: JSString = "getRegistration" + @usableFromInline static let getRegistrations: JSString = "getRegistrations" + @usableFromInline static let getRemoteCandidates: JSString = "getRemoteCandidates" + @usableFromInline static let getRemoteCertificates: JSString = "getRemoteCertificates" + @usableFromInline static let getRemoteParameters: JSString = "getRemoteParameters" + @usableFromInline static let getRenderbufferParameter: JSString = "getRenderbufferParameter" + @usableFromInline static let getResponseHeader: JSString = "getResponseHeader" + @usableFromInline static let getRootNode: JSString = "getRootNode" + @usableFromInline static let getRotationOfChar: JSString = "getRotationOfChar" + @usableFromInline static let getSVGDocument: JSString = "getSVGDocument" + @usableFromInline static let getSamplerParameter: JSString = "getSamplerParameter" + @usableFromInline static let getScreenCTM: JSString = "getScreenCTM" + @usableFromInline static let getSelectedCandidatePair: JSString = "getSelectedCandidatePair" + @usableFromInline static let getSelection: JSString = "getSelection" + @usableFromInline static let getSenders: JSString = "getSenders" + @usableFromInline static let getService: JSString = "getService" + @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 getSignals: JSString = "getSignals" + @usableFromInline static let getSimpleDuration: JSString = "getSimpleDuration" + @usableFromInline static let getSpatialNavigationContainer: JSString = "getSpatialNavigationContainer" + @usableFromInline static let getStartDate: JSString = "getStartDate" + @usableFromInline static let getStartPositionOfChar: JSString = "getStartPositionOfChar" + @usableFromInline static let getStartTime: JSString = "getStartTime" + @usableFromInline static let getState: JSString = "getState" + @usableFromInline static let getStats: JSString = "getStats" + @usableFromInline static let getSubImage: JSString = "getSubImage" + @usableFromInline static let getSubStringLength: JSString = "getSubStringLength" + @usableFromInline static let getSubscription: JSString = "getSubscription" + @usableFromInline static let getSubscriptions: JSString = "getSubscriptions" + @usableFromInline static let getSupportedConstraints: JSString = "getSupportedConstraints" + @usableFromInline static let getSupportedExtensions: JSString = "getSupportedExtensions" + @usableFromInline static let getSupportedFormats: JSString = "getSupportedFormats" + @usableFromInline static let getSupportedProfiles: JSString = "getSupportedProfiles" + @usableFromInline static let getSyncParameter: JSString = "getSyncParameter" + @usableFromInline static let getSynchronizationSources: JSString = "getSynchronizationSources" + @usableFromInline static let getTags: JSString = "getTags" + @usableFromInline static let getTargetRanges: JSString = "getTargetRanges" + @usableFromInline static let getTexParameter: JSString = "getTexParameter" + @usableFromInline static let getTextFormats: JSString = "getTextFormats" + @usableFromInline static let getTiming: JSString = "getTiming" + @usableFromInline static let getTitlebarAreaRect: JSString = "getTitlebarAreaRect" + @usableFromInline static let getTotalLength: JSString = "getTotalLength" + @usableFromInline static let getTrackById: JSString = "getTrackById" + @usableFromInline static let getTracks: JSString = "getTracks" + @usableFromInline static let getTransceivers: JSString = "getTransceivers" + @usableFromInline static let getTransform: JSString = "getTransform" + @usableFromInline static let getTransformFeedbackVarying: JSString = "getTransformFeedbackVarying" + @usableFromInline static let getTranslatedShaderSource: JSString = "getTranslatedShaderSource" + @usableFromInline static let getTransports: JSString = "getTransports" + @usableFromInline static let getType: JSString = "getType" + @usableFromInline static let getUniform: JSString = "getUniform" + @usableFromInline static let getUniformBlockIndex: JSString = "getUniformBlockIndex" + @usableFromInline static let getUniformIndices: JSString = "getUniformIndices" + @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 getVideoPlaybackQuality: JSString = "getVideoPlaybackQuality" + @usableFromInline static let getVideoTracks: JSString = "getVideoTracks" + @usableFromInline static let getViewSubImage: JSString = "getViewSubImage" + @usableFromInline static let getViewerPose: JSString = "getViewerPose" + @usableFromInline static let getViewport: JSString = "getViewport" + @usableFromInline static let getVoices: JSString = "getVoices" + @usableFromInline static let getWriter: JSString = "getWriter" + @usableFromInline static let globalAlpha: JSString = "globalAlpha" + @usableFromInline static let globalCompositeOperation: JSString = "globalCompositeOperation" + @usableFromInline static let glyphsRendered: JSString = "glyphsRendered" + @usableFromInline static let go: JSString = "go" + @usableFromInline static let gpu: JSString = "gpu" + @usableFromInline static let grabFrame: JSString = "grabFrame" + @usableFromInline static let grad: JSString = "grad" + @usableFromInline static let gradientTransform: JSString = "gradientTransform" + @usableFromInline static let gradientUnits: JSString = "gradientUnits" + @usableFromInline static let grammars: JSString = "grammars" + @usableFromInline static let granted: JSString = "granted" + @usableFromInline static let gripSpace: JSString = "gripSpace" + @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 groups: JSString = "groups" + @usableFromInline static let grow: JSString = "grow" + @usableFromInline static let gru: JSString = "gru" + @usableFromInline static let gruCell: JSString = "gruCell" + @usableFromInline static let h: JSString = "h" + @usableFromInline static let hadRecentInput: JSString = "hadRecentInput" + @usableFromInline static let hand: JSString = "hand" + @usableFromInline static let handedness: JSString = "handedness" + @usableFromInline static let handle: JSString = "handle" + @usableFromInline static let handled: JSString = "handled" + @usableFromInline static let hangingBaseline: JSString = "hangingBaseline" + @usableFromInline static let hapticActuators: JSString = "hapticActuators" + @usableFromInline static let hardSigmoid: JSString = "hardSigmoid" + @usableFromInline static let hardSwish: JSString = "hardSwish" + @usableFromInline static let hardwareAcceleration: JSString = "hardwareAcceleration" + @usableFromInline static let hardwareConcurrency: JSString = "hardwareConcurrency" + @usableFromInline static let has: JSString = "has" + @usableFromInline static let hasAlphaChannel: JSString = "hasAlphaChannel" + @usableFromInline static let hasAttribute: JSString = "hasAttribute" + @usableFromInline static let hasAttributeNS: JSString = "hasAttributeNS" + @usableFromInline static let hasAttributes: JSString = "hasAttributes" + @usableFromInline static let hasChildNodes: JSString = "hasChildNodes" + @usableFromInline static let hasDynamicOffset: JSString = "hasDynamicOffset" + @usableFromInline static let hasFeature: JSString = "hasFeature" + @usableFromInline static let hasFocus: JSString = "hasFocus" + @usableFromInline static let hasNull: JSString = "hasNull" + @usableFromInline static let hasOrientation: JSString = "hasOrientation" + @usableFromInline static let hasPointerCapture: JSString = "hasPointerCapture" + @usableFromInline static let hasPosition: JSString = "hasPosition" + @usableFromInline static let hasPreferredState: JSString = "hasPreferredState" + @usableFromInline static let hasReading: JSString = "hasReading" + @usableFromInline static let hasStorageAccess: JSString = "hasStorageAccess" + @usableFromInline static let hash: JSString = "hash" + @usableFromInline static let hashChange: JSString = "hashChange" + @usableFromInline static let hdrMetadataType: JSString = "hdrMetadataType" + @usableFromInline static let head: JSString = "head" + @usableFromInline static let headerBytesReceived: JSString = "headerBytesReceived" + @usableFromInline static let headerBytesSent: JSString = "headerBytesSent" + @usableFromInline static let headerExtensions: JSString = "headerExtensions" + @usableFromInline static let headerValue: JSString = "headerValue" + @usableFromInline static let headers: JSString = "headers" + @usableFromInline static let heading: JSString = "heading" + @usableFromInline static let height: JSString = "height" + @usableFromInline static let held: JSString = "held" + @usableFromInline static let hid: JSString = "hid" + @usableFromInline static let hidden: JSString = "hidden" + @usableFromInline static let hide: JSString = "hide" + @usableFromInline static let high: JSString = "high" + @usableFromInline static let highWaterMark: JSString = "highWaterMark" + @usableFromInline static let highlights: JSString = "highlights" + @usableFromInline static let hint: JSString = "hint" + @usableFromInline static let hints: JSString = "hints" + @usableFromInline static let history: JSString = "history" + @usableFromInline static let host: JSString = "host" + @usableFromInline static let hostname: JSString = "hostname" + @usableFromInline static let href: JSString = "href" + @usableFromInline static let hreflang: JSString = "hreflang" + @usableFromInline static let hspace: JSString = "hspace" + @usableFromInline static let htmlFor: JSString = "htmlFor" + @usableFromInline static let httpEquiv: JSString = "httpEquiv" + @usableFromInline static let httpRequestStatusCode: JSString = "httpRequestStatusCode" + @usableFromInline static let hugeFramesSent: JSString = "hugeFramesSent" + @usableFromInline static let ic: JSString = "ic" + @usableFromInline static let iceCandidatePoolSize: JSString = "iceCandidatePoolSize" + @usableFromInline static let iceConnectionState: JSString = "iceConnectionState" + @usableFromInline static let iceGatheringState: JSString = "iceGatheringState" + @usableFromInline static let iceLite: JSString = "iceLite" + @usableFromInline static let iceLocalUsernameFragment: JSString = "iceLocalUsernameFragment" + @usableFromInline static let iceRestart: JSString = "iceRestart" + @usableFromInline static let iceRole: JSString = "iceRole" + @usableFromInline static let iceServers: JSString = "iceServers" + @usableFromInline static let iceState: JSString = "iceState" + @usableFromInline static let iceTransport: JSString = "iceTransport" + @usableFromInline static let iceTransportPolicy: JSString = "iceTransportPolicy" + @usableFromInline static let icon: JSString = "icon" + @usableFromInline static let iconMustBeShown: JSString = "iconMustBeShown" + @usableFromInline static let iconURL: JSString = "iconURL" + @usableFromInline static let iconURLs: JSString = "iconURLs" + @usableFromInline static let icons: JSString = "icons" + @usableFromInline static let id: JSString = "id" + @usableFromInline static let ideal: JSString = "ideal" + @usableFromInline static let identifier: JSString = "identifier" + @usableFromInline static let identity: JSString = "identity" + @usableFromInline static let ideographicBaseline: JSString = "ideographicBaseline" + @usableFromInline static let idp: JSString = "idp" + @usableFromInline static let idpErrorInfo: JSString = "idpErrorInfo" + @usableFromInline static let idpLoginUrl: JSString = "idpLoginUrl" + @usableFromInline static let ifAvailable: JSString = "ifAvailable" + @usableFromInline static let ignoreBOM: JSString = "ignoreBOM" + @usableFromInline static let ignoreDepthValues: JSString = "ignoreDepthValues" + @usableFromInline static let ignoreMethod: JSString = "ignoreMethod" + @usableFromInline static let ignoreSearch: JSString = "ignoreSearch" + @usableFromInline static let ignoreVary: JSString = "ignoreVary" + @usableFromInline static let illuminance: JSString = "illuminance" + @usableFromInline static let imag: JSString = "imag" + @usableFromInline static let image: JSString = "image" + @usableFromInline static let imageHeight: JSString = "imageHeight" + @usableFromInline static let imageIndex: JSString = "imageIndex" + @usableFromInline static let imageOrientation: JSString = "imageOrientation" + @usableFromInline static let imageSizes: JSString = "imageSizes" + @usableFromInline static let imageSmoothingEnabled: JSString = "imageSmoothingEnabled" + @usableFromInline static let imageSmoothingQuality: JSString = "imageSmoothingQuality" + @usableFromInline static let imageSrcset: JSString = "imageSrcset" + @usableFromInline static let imageWidth: JSString = "imageWidth" + @usableFromInline static let images: JSString = "images" + @usableFromInline static let implementation: JSString = "implementation" + @usableFromInline static let importExternalTexture: JSString = "importExternalTexture" + @usableFromInline static let importKey: JSString = "importKey" + @usableFromInline static let importNode: JSString = "importNode" + @usableFromInline static let importScripts: JSString = "importScripts" + @usableFromInline static let importStylesheet: JSString = "importStylesheet" + @usableFromInline static let imports: JSString = "imports" + @usableFromInline static let `in`: JSString = "in" + @usableFromInline static let in1: JSString = "in1" + @usableFromInline static let in2: JSString = "in2" + @usableFromInline static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" + @usableFromInline static let inboundRtpStreamId: JSString = "inboundRtpStreamId" + @usableFromInline static let includeContinuous: JSString = "includeContinuous" + @usableFromInline static let includeUncontrolled: JSString = "includeUncontrolled" + @usableFromInline static let includes: JSString = "includes" + @usableFromInline static let incomingBidirectionalStreams: JSString = "incomingBidirectionalStreams" + @usableFromInline static let incomingHighWaterMark: JSString = "incomingHighWaterMark" + @usableFromInline static let incomingMaxAge: JSString = "incomingMaxAge" + @usableFromInline static let incomingUnidirectionalStreams: JSString = "incomingUnidirectionalStreams" + @usableFromInline static let indeterminate: JSString = "indeterminate" + @usableFromInline static let index: JSString = "index" + @usableFromInline static let indexNames: JSString = "indexNames" + @usableFromInline static let indexedDB: JSString = "indexedDB" + @usableFromInline static let indicate: JSString = "indicate" + @usableFromInline static let inert: JSString = "inert" + @usableFromInline static let info: JSString = "info" + @usableFromInline static let inherits: JSString = "inherits" + @usableFromInline static let initCompositionEvent: JSString = "initCompositionEvent" + @usableFromInline static let initCustomEvent: JSString = "initCustomEvent" + @usableFromInline static let initData: JSString = "initData" + @usableFromInline static let initDataType: JSString = "initDataType" + @usableFromInline static let initDataTypes: JSString = "initDataTypes" + @usableFromInline static let initEvent: JSString = "initEvent" + @usableFromInline static let initKeyboardEvent: JSString = "initKeyboardEvent" + @usableFromInline static let initMessageEvent: JSString = "initMessageEvent" + @usableFromInline static let initMouseEvent: JSString = "initMouseEvent" + @usableFromInline static let initMutationEvent: JSString = "initMutationEvent" + @usableFromInline static let initStorageEvent: JSString = "initStorageEvent" + @usableFromInline static let initTimeEvent: JSString = "initTimeEvent" + @usableFromInline static let initUIEvent: JSString = "initUIEvent" + @usableFromInline static let initial: JSString = "initial" + @usableFromInline static let initialHiddenState: JSString = "initialHiddenState" + @usableFromInline static let initialValue: JSString = "initialValue" + @usableFromInline static let initialize: JSString = "initialize" + @usableFromInline static let initiatorType: JSString = "initiatorType" + @usableFromInline static let ink: JSString = "ink" + @usableFromInline static let inline: JSString = "inline" + @usableFromInline static let inlineEnd: JSString = "inlineEnd" + @usableFromInline static let inlineOffset: JSString = "inlineOffset" + @usableFromInline static let inlineSize: JSString = "inlineSize" + @usableFromInline static let inlineStart: JSString = "inlineStart" + @usableFromInline static let inlineVerticalFieldOfView: JSString = "inlineVerticalFieldOfView" + @usableFromInline static let innerHTML: JSString = "innerHTML" + @usableFromInline static let innerHeight: JSString = "innerHeight" + @usableFromInline static let innerText: JSString = "innerText" + @usableFromInline static let innerWidth: JSString = "innerWidth" + @usableFromInline static let input: JSString = "input" + @usableFromInline static let inputBuffer: JSString = "inputBuffer" + @usableFromInline static let inputEncoding: JSString = "inputEncoding" + @usableFromInline static let inputLayout: JSString = "inputLayout" + @usableFromInline static let inputMode: JSString = "inputMode" + @usableFromInline static let inputReports: JSString = "inputReports" + @usableFromInline static let inputSource: JSString = "inputSource" + @usableFromInline static let inputSources: JSString = "inputSources" + @usableFromInline static let inputType: JSString = "inputType" + @usableFromInline static let inputs: JSString = "inputs" + @usableFromInline static let insertAdjacentElement: JSString = "insertAdjacentElement" + @usableFromInline static let insertAdjacentHTML: JSString = "insertAdjacentHTML" + @usableFromInline static let insertAdjacentText: JSString = "insertAdjacentText" + @usableFromInline static let insertBefore: JSString = "insertBefore" + @usableFromInline static let insertCell: JSString = "insertCell" + @usableFromInline static let insertDTMF: JSString = "insertDTMF" + @usableFromInline static let insertData: JSString = "insertData" + @usableFromInline static let insertDebugMarker: JSString = "insertDebugMarker" + @usableFromInline static let insertItemBefore: JSString = "insertItemBefore" + @usableFromInline static let insertNode: JSString = "insertNode" + @usableFromInline static let insertRow: JSString = "insertRow" + @usableFromInline static let insertRule: JSString = "insertRule" + @usableFromInline static let insertedSamplesForDeceleration: JSString = "insertedSamplesForDeceleration" + @usableFromInline static let installing: JSString = "installing" + @usableFromInline static let instance: JSString = "instance" + @usableFromInline static let instanceNormalization: JSString = "instanceNormalization" + @usableFromInline static let instanceRoot: JSString = "instanceRoot" + @usableFromInline static let instantiate: JSString = "instantiate" + @usableFromInline static let instantiateStreaming: JSString = "instantiateStreaming" + @usableFromInline static let instrument: JSString = "instrument" + @usableFromInline static let instruments: JSString = "instruments" + @usableFromInline static let integrity: JSString = "integrity" + @usableFromInline static let interactionCounts: JSString = "interactionCounts" + @usableFromInline static let interactionId: JSString = "interactionId" + @usableFromInline static let interactionMode: JSString = "interactionMode" + @usableFromInline static let intercept: JSString = "intercept" + @usableFromInline static let interfaceClass: JSString = "interfaceClass" + @usableFromInline static let interfaceName: JSString = "interfaceName" + @usableFromInline static let interfaceNumber: JSString = "interfaceNumber" + @usableFromInline static let interfaceProtocol: JSString = "interfaceProtocol" + @usableFromInline static let interfaceSubclass: JSString = "interfaceSubclass" + @usableFromInline static let interfaces: JSString = "interfaces" + @usableFromInline static let interimResults: JSString = "interimResults" + @usableFromInline static let intersectionRatio: JSString = "intersectionRatio" + @usableFromInline static let intersectionRect: JSString = "intersectionRect" + @usableFromInline static let intersectsNode: JSString = "intersectsNode" + @usableFromInline static let interval: JSString = "interval" + @usableFromInline static let intrinsicSizes: JSString = "intrinsicSizes" + @usableFromInline static let introductoryPrice: JSString = "introductoryPrice" + @usableFromInline static let introductoryPriceCycles: JSString = "introductoryPriceCycles" + @usableFromInline static let introductoryPricePeriod: JSString = "introductoryPricePeriod" + @usableFromInline static let invalidIteratorState: JSString = "invalidIteratorState" + @usableFromInline static let invalidateFramebuffer: JSString = "invalidateFramebuffer" + @usableFromInline static let invalidateSubFramebuffer: JSString = "invalidateSubFramebuffer" + @usableFromInline static let inverse: JSString = "inverse" + @usableFromInline static let invertSelf: JSString = "invertSelf" + @usableFromInline static let invertStereo: JSString = "invertStereo" + @usableFromInline static let `is`: JSString = "is" + @usableFromInline static let is2D: JSString = "is2D" + @usableFromInline static let isAbsolute: JSString = "isAbsolute" + @usableFromInline static let isArray: JSString = "isArray" + @usableFromInline static let isBuffer: JSString = "isBuffer" + @usableFromInline static let isBufferedBytes: JSString = "isBufferedBytes" + @usableFromInline static let isCollapsed: JSString = "isCollapsed" + @usableFromInline static let isComposing: JSString = "isComposing" + @usableFromInline static let isConditionalMediationAvailable: JSString = "isConditionalMediationAvailable" + @usableFromInline static let isConfigSupported: JSString = "isConfigSupported" + @usableFromInline static let isConnected: JSString = "isConnected" + @usableFromInline static let isConstant: JSString = "isConstant" + @usableFromInline static let isContentEditable: JSString = "isContentEditable" + @usableFromInline static let isContextLost: JSString = "isContextLost" + @usableFromInline static let isDefaultNamespace: JSString = "isDefaultNamespace" + @usableFromInline static let isDirectory: JSString = "isDirectory" + @usableFromInline static let isEnabled: JSString = "isEnabled" + @usableFromInline static let isEqualNode: JSString = "isEqualNode" + @usableFromInline static let isFallbackAdapter: JSString = "isFallbackAdapter" + @usableFromInline static let isFile: JSString = "isFile" + @usableFromInline static let isFinal: JSString = "isFinal" + @usableFromInline static let isFirstPersonObserver: JSString = "isFirstPersonObserver" + @usableFromInline static let isFramebuffer: JSString = "isFramebuffer" + @usableFromInline static let isHTML: JSString = "isHTML" + @usableFromInline static let isHistoryNavigation: JSString = "isHistoryNavigation" + @usableFromInline static let isIdentity: JSString = "isIdentity" + @usableFromInline static let isInComposition: JSString = "isInComposition" + @usableFromInline static let isInputPending: JSString = "isInputPending" + @usableFromInline static let isIntersecting: JSString = "isIntersecting" + @usableFromInline static let isLinear: JSString = "isLinear" + @usableFromInline static let isMap: JSString = "isMap" + @usableFromInline static let isPayment: JSString = "isPayment" + @usableFromInline static let isPointInFill: JSString = "isPointInFill" + @usableFromInline static let isPointInPath: JSString = "isPointInPath" + @usableFromInline static let isPointInRange: JSString = "isPointInRange" + @usableFromInline static let isPointInStroke: JSString = "isPointInStroke" + @usableFromInline static let isPrimary: JSString = "isPrimary" + @usableFromInline static let isProgram: JSString = "isProgram" + @usableFromInline static let isQuery: JSString = "isQuery" + @usableFromInline static let isQueryEXT: JSString = "isQueryEXT" + @usableFromInline static let isRange: JSString = "isRange" + @usableFromInline static let isReloadNavigation: JSString = "isReloadNavigation" + @usableFromInline static let isRenderbuffer: JSString = "isRenderbuffer" + @usableFromInline static let isSameEntry: JSString = "isSameEntry" + @usableFromInline static let isSameNode: JSString = "isSameNode" + @usableFromInline static let isSampler: JSString = "isSampler" + @usableFromInline static let isScript: JSString = "isScript" + @usableFromInline static let isScriptURL: JSString = "isScriptURL" + @usableFromInline static let isSecureContext: JSString = "isSecureContext" + @usableFromInline static let isSessionSupported: JSString = "isSessionSupported" + @usableFromInline static let isShader: JSString = "isShader" + @usableFromInline static let isStatic: JSString = "isStatic" + @usableFromInline static let isSync: JSString = "isSync" + @usableFromInline static let isTexture: JSString = "isTexture" + @usableFromInline static let isTransformFeedback: JSString = "isTransformFeedback" + @usableFromInline static let isTrusted: JSString = "isTrusted" + @usableFromInline static let isTypeSupported: JSString = "isTypeSupported" + @usableFromInline static let isUserVerifyingPlatformAuthenticatorAvailable: JSString = "isUserVerifyingPlatformAuthenticatorAvailable" + @usableFromInline static let isVertexArray: JSString = "isVertexArray" + @usableFromInline static let isVertexArrayOES: JSString = "isVertexArrayOES" + @usableFromInline static let isVisible: JSString = "isVisible" + @usableFromInline static let isVolatile: JSString = "isVolatile" + @usableFromInline static let iso: JSString = "iso" + @usableFromInline static let isochronousTransferIn: JSString = "isochronousTransferIn" + @usableFromInline static let isochronousTransferOut: JSString = "isochronousTransferOut" + @usableFromInline static let isolated: JSString = "isolated" + @usableFromInline static let issuerCertificateId: JSString = "issuerCertificateId" + @usableFromInline static let item: JSString = "item" + @usableFromInline static let itemId: JSString = "itemId" + @usableFromInline static let items: JSString = "items" + @usableFromInline static let iterateNext: JSString = "iterateNext" + @usableFromInline static let iterationComposite: JSString = "iterationComposite" + @usableFromInline static let iterationStart: JSString = "iterationStart" + @usableFromInline static let iterations: JSString = "iterations" + @usableFromInline static let iv: JSString = "iv" + @usableFromInline static let javaEnabled: JSString = "javaEnabled" + @usableFromInline static let jitter: JSString = "jitter" + @usableFromInline static let jitterBufferDelay: JSString = "jitterBufferDelay" + @usableFromInline static let jitterBufferEmittedCount: JSString = "jitterBufferEmittedCount" + @usableFromInline static let jointName: JSString = "jointName" + @usableFromInline static let json: JSString = "json" + @usableFromInline static let k: JSString = "k" + @usableFromInline static let k1: JSString = "k1" + @usableFromInline static let k2: JSString = "k2" + @usableFromInline static let k3: JSString = "k3" + @usableFromInline static let k4: JSString = "k4" + @usableFromInline static let kHz: JSString = "kHz" + @usableFromInline static let keepDimensions: JSString = "keepDimensions" + @usableFromInline static let keepExistingData: JSString = "keepExistingData" + @usableFromInline static let keepalive: JSString = "keepalive" + @usableFromInline static let kernelMatrix: JSString = "kernelMatrix" + @usableFromInline static let kernelUnitLengthX: JSString = "kernelUnitLengthX" + @usableFromInline static let kernelUnitLengthY: JSString = "kernelUnitLengthY" + @usableFromInline static let key: JSString = "key" + @usableFromInline static let keyCode: JSString = "keyCode" + @usableFromInline static let keyFrame: JSString = "keyFrame" + @usableFromInline static let keyFramesDecoded: JSString = "keyFramesDecoded" + @usableFromInline static let keyFramesEncoded: JSString = "keyFramesEncoded" + @usableFromInline static let keyID: JSString = "keyID" + @usableFromInline static let keyPath: JSString = "keyPath" + @usableFromInline static let keyStatuses: JSString = "keyStatuses" + @usableFromInline static let keySystem: JSString = "keySystem" + @usableFromInline static let keySystemAccess: JSString = "keySystemAccess" + @usableFromInline static let keySystemConfiguration: JSString = "keySystemConfiguration" + @usableFromInline static let keyText: JSString = "keyText" + @usableFromInline static let key_ops: JSString = "key_ops" + @usableFromInline static let keyboard: JSString = "keyboard" + @usableFromInline static let keys: JSString = "keys" + @usableFromInline static let kind: JSString = "kind" + @usableFromInline static let knee: JSString = "knee" + @usableFromInline static let kty: JSString = "kty" + @usableFromInline static let l: JSString = "l" + @usableFromInline static let l2Pool2d: JSString = "l2Pool2d" + @usableFromInline static let label: JSString = "label" + @usableFromInline static let labels: JSString = "labels" + @usableFromInline static let landmarks: JSString = "landmarks" + @usableFromInline static let lang: JSString = "lang" + @usableFromInline static let language: JSString = "language" + @usableFromInline static let languages: JSString = "languages" + @usableFromInline static let largeBlob: JSString = "largeBlob" + @usableFromInline static let lastChance: JSString = "lastChance" + @usableFromInline static let lastChild: JSString = "lastChild" + @usableFromInline static let lastElementChild: JSString = "lastElementChild" + @usableFromInline static let lastEventId: JSString = "lastEventId" + @usableFromInline static let lastInputTime: JSString = "lastInputTime" + @usableFromInline static let lastModified: JSString = "lastModified" + @usableFromInline static let lastPacketReceivedTimestamp: JSString = "lastPacketReceivedTimestamp" + @usableFromInline static let lastPacketSentTimestamp: JSString = "lastPacketSentTimestamp" + @usableFromInline static let lastRequestTimestamp: JSString = "lastRequestTimestamp" + @usableFromInline static let lastResponseTimestamp: JSString = "lastResponseTimestamp" + @usableFromInline static let latency: JSString = "latency" + @usableFromInline static let latencyHint: JSString = "latencyHint" + @usableFromInline static let latencyMode: JSString = "latencyMode" + @usableFromInline static let latitude: JSString = "latitude" + @usableFromInline static let layer: JSString = "layer" + @usableFromInline static let layerName: JSString = "layerName" + @usableFromInline static let layers: JSString = "layers" + @usableFromInline static let layout: JSString = "layout" + @usableFromInline static let layoutNextFragment: JSString = "layoutNextFragment" + @usableFromInline static let layoutWorklet: JSString = "layoutWorklet" + @usableFromInline static let leakyRelu: JSString = "leakyRelu" + @usableFromInline static let left: JSString = "left" + @usableFromInline static let length: JSString = "length" + @usableFromInline static let lengthAdjust: JSString = "lengthAdjust" + @usableFromInline static let lengthComputable: JSString = "lengthComputable" + @usableFromInline static let letterSpacing: JSString = "letterSpacing" + @usableFromInline static let level: JSString = "level" + @usableFromInline static let lh: JSString = "lh" + @usableFromInline static let lifecycleState: JSString = "lifecycleState" + @usableFromInline static let limitingConeAngle: JSString = "limitingConeAngle" + @usableFromInline static let limits: JSString = "limits" + @usableFromInline static let line: JSString = "line" + @usableFromInline static let lineAlign: JSString = "lineAlign" + @usableFromInline static let lineCap: JSString = "lineCap" + @usableFromInline static let lineDashOffset: JSString = "lineDashOffset" + @usableFromInline static let lineGapOverride: JSString = "lineGapOverride" + @usableFromInline static let lineJoin: JSString = "lineJoin" + @usableFromInline static let lineNum: JSString = "lineNum" + @usableFromInline static let lineNumber: JSString = "lineNumber" + @usableFromInline static let linePos: JSString = "linePos" + @usableFromInline static let lineTo: JSString = "lineTo" + @usableFromInline static let lineWidth: JSString = "lineWidth" + @usableFromInline static let linear: JSString = "linear" + @usableFromInline static let linearAcceleration: JSString = "linearAcceleration" + @usableFromInline static let linearRampToValueAtTime: JSString = "linearRampToValueAtTime" + @usableFromInline static let linearVelocity: JSString = "linearVelocity" + @usableFromInline static let lineno: JSString = "lineno" + @usableFromInline static let lines: JSString = "lines" + @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 listPurchaseHistory: JSString = "listPurchaseHistory" + @usableFromInline static let listPurchases: JSString = "listPurchases" + @usableFromInline static let listener: JSString = "listener" + @usableFromInline static let load: JSString = "load" + @usableFromInline static let loadEventEnd: JSString = "loadEventEnd" + @usableFromInline static let loadEventStart: JSString = "loadEventStart" + @usableFromInline static let loadOp: JSString = "loadOp" + @usableFromInline static let loadTime: JSString = "loadTime" + @usableFromInline static let loaded: JSString = "loaded" + @usableFromInline static let loading: JSString = "loading" + @usableFromInline static let local: JSString = "local" + @usableFromInline static let localCandidateId: JSString = "localCandidateId" + @usableFromInline static let localCertificateId: JSString = "localCertificateId" + @usableFromInline static let localDescription: JSString = "localDescription" + @usableFromInline static let localId: JSString = "localId" + @usableFromInline static let localName: JSString = "localName" + @usableFromInline static let localService: JSString = "localService" + @usableFromInline static let localStorage: JSString = "localStorage" + @usableFromInline static let localTime: JSString = "localTime" + @usableFromInline static let location: JSString = "location" + @usableFromInline static let locationbar: JSString = "locationbar" + @usableFromInline static let locations: JSString = "locations" + @usableFromInline static let lock: JSString = "lock" + @usableFromInline static let locked: JSString = "locked" + @usableFromInline static let locks: JSString = "locks" + @usableFromInline static let lodMaxClamp: JSString = "lodMaxClamp" + @usableFromInline static let lodMinClamp: JSString = "lodMinClamp" + @usableFromInline static let log: JSString = "log" + @usableFromInline static let logicalMaximum: JSString = "logicalMaximum" + @usableFromInline static let logicalMinimum: JSString = "logicalMinimum" + @usableFromInline static let logicalSurface: JSString = "logicalSurface" + @usableFromInline static let longDesc: JSString = "longDesc" + @usableFromInline static let longitude: JSString = "longitude" + @usableFromInline static let lookupNamespaceURI: JSString = "lookupNamespaceURI" + @usableFromInline static let lookupPrefix: JSString = "lookupPrefix" + @usableFromInline static let loop: JSString = "loop" + @usableFromInline static let loopEnd: JSString = "loopEnd" + @usableFromInline static let loopStart: JSString = "loopStart" + @usableFromInline static let loseContext: JSString = "loseContext" + @usableFromInline static let lost: JSString = "lost" + @usableFromInline static let low: JSString = "low" + @usableFromInline static let lower: JSString = "lower" + @usableFromInline static let lowerBound: JSString = "lowerBound" + @usableFromInline static let lowerOpen: JSString = "lowerOpen" + @usableFromInline static let lowerVerticalAngle: JSString = "lowerVerticalAngle" + @usableFromInline static let lowsrc: JSString = "lowsrc" + @usableFromInline static let lvb: JSString = "lvb" + @usableFromInline static let lvh: JSString = "lvh" + @usableFromInline static let lvi: JSString = "lvi" + @usableFromInline static let lvmax: JSString = "lvmax" + @usableFromInline static let lvmin: JSString = "lvmin" + @usableFromInline static let lvw: JSString = "lvw" + @usableFromInline static let m11: JSString = "m11" + @usableFromInline static let m12: JSString = "m12" + @usableFromInline static let m13: JSString = "m13" + @usableFromInline static let m14: JSString = "m14" + @usableFromInline static let m21: JSString = "m21" + @usableFromInline static let m22: JSString = "m22" + @usableFromInline static let m23: JSString = "m23" + @usableFromInline static let m24: JSString = "m24" + @usableFromInline static let m31: JSString = "m31" + @usableFromInline static let m32: JSString = "m32" + @usableFromInline static let m33: JSString = "m33" + @usableFromInline static let m34: JSString = "m34" + @usableFromInline static let m41: JSString = "m41" + @usableFromInline static let m42: JSString = "m42" + @usableFromInline static let m43: JSString = "m43" + @usableFromInline static let m44: JSString = "m44" + @usableFromInline static let magFilter: JSString = "magFilter" + @usableFromInline static let makeReadOnly: JSString = "makeReadOnly" + @usableFromInline static let makeXRCompatible: JSString = "makeXRCompatible" + @usableFromInline static let manufacturer: JSString = "manufacturer" + @usableFromInline static let manufacturerData: JSString = "manufacturerData" + @usableFromInline static let manufacturerName: JSString = "manufacturerName" + @usableFromInline static let mapAsync: JSString = "mapAsync" + @usableFromInline static let mappedAtCreation: JSString = "mappedAtCreation" + @usableFromInline static let mapping: JSString = "mapping" + @usableFromInline static let marginHeight: JSString = "marginHeight" + @usableFromInline static let marginWidth: JSString = "marginWidth" + @usableFromInline static let mark: JSString = "mark" + @usableFromInline static let markerHeight: JSString = "markerHeight" + @usableFromInline static let markerUnits: JSString = "markerUnits" + @usableFromInline static let markerWidth: JSString = "markerWidth" + @usableFromInline static let markers: JSString = "markers" + @usableFromInline static let mask: JSString = "mask" + @usableFromInline static let maskContentUnits: JSString = "maskContentUnits" + @usableFromInline static let maskUnits: JSString = "maskUnits" + @usableFromInline static let match: JSString = "match" + @usableFromInline static let matchAll: JSString = "matchAll" + @usableFromInline static let matchMedia: JSString = "matchMedia" + @usableFromInline static let matches: JSString = "matches" + @usableFromInline static let matmul: JSString = "matmul" + @usableFromInline static let matrix: JSString = "matrix" + @usableFromInline static let matrixTransform: JSString = "matrixTransform" + @usableFromInline static let max: JSString = "max" + @usableFromInline static let maxActions: JSString = "maxActions" + @usableFromInline static let maxAlternatives: JSString = "maxAlternatives" + @usableFromInline static let maxAnisotropy: JSString = "maxAnisotropy" + @usableFromInline static let maxBindGroups: JSString = "maxBindGroups" + @usableFromInline static let maxBitrate: JSString = "maxBitrate" + @usableFromInline static let maxBufferSize: JSString = "maxBufferSize" + @usableFromInline static let maxChannelCount: JSString = "maxChannelCount" + @usableFromInline static let maxChannels: JSString = "maxChannels" + @usableFromInline static let maxComputeInvocationsPerWorkgroup: JSString = "maxComputeInvocationsPerWorkgroup" + @usableFromInline static let maxComputeWorkgroupSizeX: JSString = "maxComputeWorkgroupSizeX" + @usableFromInline static let maxComputeWorkgroupSizeY: JSString = "maxComputeWorkgroupSizeY" + @usableFromInline static let maxComputeWorkgroupSizeZ: JSString = "maxComputeWorkgroupSizeZ" + @usableFromInline static let maxComputeWorkgroupStorageSize: JSString = "maxComputeWorkgroupStorageSize" + @usableFromInline static let maxComputeWorkgroupsPerDimension: JSString = "maxComputeWorkgroupsPerDimension" + @usableFromInline static let maxContentSize: JSString = "maxContentSize" + @usableFromInline static let maxDatagramSize: JSString = "maxDatagramSize" + @usableFromInline static let maxDecibels: JSString = "maxDecibels" + @usableFromInline static let maxDelayTime: JSString = "maxDelayTime" + @usableFromInline static let maxDetectedFaces: JSString = "maxDetectedFaces" + @usableFromInline static let maxDistance: JSString = "maxDistance" + @usableFromInline static let maxDynamicStorageBuffersPerPipelineLayout: JSString = "maxDynamicStorageBuffersPerPipelineLayout" + @usableFromInline static let maxDynamicUniformBuffersPerPipelineLayout: JSString = "maxDynamicUniformBuffersPerPipelineLayout" + @usableFromInline static let maxInterStageShaderComponents: JSString = "maxInterStageShaderComponents" + @usableFromInline static let maxLength: JSString = "maxLength" + @usableFromInline static let maxMessageSize: JSString = "maxMessageSize" + @usableFromInline static let maxPacketLifeTime: JSString = "maxPacketLifeTime" + @usableFromInline static let maxPool2d: JSString = "maxPool2d" + @usableFromInline static let maxRetransmits: JSString = "maxRetransmits" + @usableFromInline static let maxSampledTexturesPerShaderStage: JSString = "maxSampledTexturesPerShaderStage" + @usableFromInline static let maxSamplersPerShaderStage: JSString = "maxSamplersPerShaderStage" + @usableFromInline static let maxSamplingFrequency: JSString = "maxSamplingFrequency" + @usableFromInline static let maxStorageBufferBindingSize: JSString = "maxStorageBufferBindingSize" + @usableFromInline static let maxStorageBuffersPerShaderStage: JSString = "maxStorageBuffersPerShaderStage" + @usableFromInline static let maxStorageTexturesPerShaderStage: JSString = "maxStorageTexturesPerShaderStage" + @usableFromInline static let maxTextureArrayLayers: JSString = "maxTextureArrayLayers" + @usableFromInline static let maxTextureDimension1D: JSString = "maxTextureDimension1D" + @usableFromInline static let maxTextureDimension2D: JSString = "maxTextureDimension2D" + @usableFromInline static let maxTextureDimension3D: JSString = "maxTextureDimension3D" + @usableFromInline static let maxTouchPoints: JSString = "maxTouchPoints" + @usableFromInline static let maxUniformBufferBindingSize: JSString = "maxUniformBufferBindingSize" + @usableFromInline static let maxUniformBuffersPerShaderStage: JSString = "maxUniformBuffersPerShaderStage" + @usableFromInline static let maxValue: JSString = "maxValue" + @usableFromInline static let maxVertexAttributes: JSString = "maxVertexAttributes" + @usableFromInline static let maxVertexBufferArrayStride: JSString = "maxVertexBufferArrayStride" + @usableFromInline static let maxVertexBuffers: JSString = "maxVertexBuffers" + @usableFromInline static let maximum: JSString = "maximum" + @usableFromInline static let maximumAge: JSString = "maximumAge" + @usableFromInline static let maximumValue: JSString = "maximumValue" + @usableFromInline static let mayUseGATT: JSString = "mayUseGATT" + @usableFromInline static let measure: JSString = "measure" + @usableFromInline static let measureElement: JSString = "measureElement" + @usableFromInline static let measureText: JSString = "measureText" + @usableFromInline static let measureUserAgentSpecificMemory: JSString = "measureUserAgentSpecificMemory" + @usableFromInline static let media: JSString = "media" + @usableFromInline static let mediaCapabilities: JSString = "mediaCapabilities" + @usableFromInline static let mediaDevices: JSString = "mediaDevices" + @usableFromInline static let mediaElement: JSString = "mediaElement" + @usableFromInline static let mediaKeys: JSString = "mediaKeys" + @usableFromInline static let mediaSession: JSString = "mediaSession" + @usableFromInline static let mediaSourceId: JSString = "mediaSourceId" + @usableFromInline static let mediaStream: JSString = "mediaStream" + @usableFromInline static let mediaStreamTrack: JSString = "mediaStreamTrack" + @usableFromInline static let mediaText: JSString = "mediaText" + @usableFromInline static let mediaTime: JSString = "mediaTime" + @usableFromInline static let mediaType: JSString = "mediaType" + @usableFromInline static let mediation: JSString = "mediation" + @usableFromInline static let meetOrSlice: JSString = "meetOrSlice" + @usableFromInline static let menubar: JSString = "menubar" + @usableFromInline static let message: JSString = "message" + @usableFromInline static let messageType: JSString = "messageType" + @usableFromInline static let messages: JSString = "messages" + @usableFromInline static let messagesReceived: JSString = "messagesReceived" + @usableFromInline static let messagesSent: JSString = "messagesSent" + @usableFromInline static let metaKey: JSString = "metaKey" + @usableFromInline static let metadata: JSString = "metadata" + @usableFromInline static let method: JSString = "method" + @usableFromInline static let methodData: JSString = "methodData" + @usableFromInline static let methodDetails: JSString = "methodDetails" + @usableFromInline static let methodName: JSString = "methodName" + @usableFromInline static let mid: JSString = "mid" + @usableFromInline static let mimeType: JSString = "mimeType" + @usableFromInline static let mimeTypes: JSString = "mimeTypes" + @usableFromInline static let min: JSString = "min" + @usableFromInline static let minBindingSize: JSString = "minBindingSize" + @usableFromInline static let minContentSize: JSString = "minContentSize" + @usableFromInline static let minDecibels: JSString = "minDecibels" + @usableFromInline static let minFilter: JSString = "minFilter" + @usableFromInline static let minInterval: JSString = "minInterval" + @usableFromInline static let minLength: JSString = "minLength" + @usableFromInline static let minRtt: JSString = "minRtt" + @usableFromInline static let minSamplingFrequency: JSString = "minSamplingFrequency" + @usableFromInline static let minStorageBufferOffsetAlignment: JSString = "minStorageBufferOffsetAlignment" + @usableFromInline static let minUniformBufferOffsetAlignment: JSString = "minUniformBufferOffsetAlignment" + @usableFromInline static let minValue: JSString = "minValue" + @usableFromInline static let minimumValue: JSString = "minimumValue" + @usableFromInline static let mipLevel: JSString = "mipLevel" + @usableFromInline static let mipLevelCount: JSString = "mipLevelCount" + @usableFromInline static let mipLevels: JSString = "mipLevels" + @usableFromInline static let mipmapFilter: JSString = "mipmapFilter" + @usableFromInline static let miterLimit: JSString = "miterLimit" + @usableFromInline static let ml: JSString = "ml" + @usableFromInline static let mm: JSString = "mm" + @usableFromInline static let mobile: JSString = "mobile" + @usableFromInline static let mockSensorType: JSString = "mockSensorType" + @usableFromInline static let mode: JSString = "mode" + @usableFromInline static let model: JSString = "model" + @usableFromInline static let modifierAltGraph: JSString = "modifierAltGraph" + @usableFromInline static let modifierCapsLock: JSString = "modifierCapsLock" + @usableFromInline static let modifierFn: JSString = "modifierFn" + @usableFromInline static let modifierFnLock: JSString = "modifierFnLock" + @usableFromInline static let modifierHyper: JSString = "modifierHyper" + @usableFromInline static let modifierNumLock: JSString = "modifierNumLock" + @usableFromInline static let modifierScrollLock: JSString = "modifierScrollLock" + @usableFromInline static let modifierSuper: JSString = "modifierSuper" + @usableFromInline static let modifierSymbol: JSString = "modifierSymbol" + @usableFromInline static let modifierSymbolLock: JSString = "modifierSymbolLock" + @usableFromInline static let modifiers: JSString = "modifiers" + @usableFromInline static let module: JSString = "module" + @usableFromInline static let modulusLength: JSString = "modulusLength" + @usableFromInline static let moveBy: JSString = "moveBy" + @usableFromInline static let moveTo: JSString = "moveTo" + @usableFromInline static let movementX: JSString = "movementX" + @usableFromInline static let movementY: JSString = "movementY" + @usableFromInline static let ms: JSString = "ms" + @usableFromInline static let mtu: JSString = "mtu" + @usableFromInline static let mul: JSString = "mul" + @usableFromInline static let multiDrawArraysInstancedBaseInstanceWEBGL: JSString = "multiDrawArraysInstancedBaseInstanceWEBGL" + @usableFromInline static let multiDrawArraysInstancedWEBGL: JSString = "multiDrawArraysInstancedWEBGL" + @usableFromInline static let multiDrawArraysWEBGL: JSString = "multiDrawArraysWEBGL" + @usableFromInline static let multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL: JSString = "multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL" + @usableFromInline static let multiDrawElementsInstancedWEBGL: JSString = "multiDrawElementsInstancedWEBGL" + @usableFromInline static let multiDrawElementsWEBGL: JSString = "multiDrawElementsWEBGL" + @usableFromInline static let multiEntry: JSString = "multiEntry" + @usableFromInline static let multiple: JSString = "multiple" + @usableFromInline static let multiply: JSString = "multiply" + @usableFromInline static let multiplySelf: JSString = "multiplySelf" + @usableFromInline static let multisample: JSString = "multisample" + @usableFromInline static let multisampled: JSString = "multisampled" + @usableFromInline static let mutable: JSString = "mutable" + @usableFromInline static let muted: JSString = "muted" + @usableFromInline static let n: JSString = "n" + @usableFromInline static let nackCount: JSString = "nackCount" + @usableFromInline static let name: JSString = "name" + @usableFromInline static let nameList: JSString = "nameList" + @usableFromInline static let namePrefix: JSString = "namePrefix" + @usableFromInline static let namedCurve: JSString = "namedCurve" + @usableFromInline static let namedFlows: JSString = "namedFlows" + @usableFromInline static let namedItem: JSString = "namedItem" + @usableFromInline static let namespaceURI: JSString = "namespaceURI" + @usableFromInline static let nativeProjectionScaleFactor: JSString = "nativeProjectionScaleFactor" + @usableFromInline static let naturalHeight: JSString = "naturalHeight" + @usableFromInline static let naturalWidth: JSString = "naturalWidth" + @usableFromInline static let navigate: JSString = "navigate" + @usableFromInline static let navigation: JSString = "navigation" + @usableFromInline static let navigationPreload: JSString = "navigationPreload" + @usableFromInline static let navigationStart: JSString = "navigationStart" + @usableFromInline static let navigationType: JSString = "navigationType" + @usableFromInline static let navigationUI: JSString = "navigationUI" + @usableFromInline static let navigator: JSString = "navigator" + @usableFromInline static let near: JSString = "near" + @usableFromInline static let needsRedraw: JSString = "needsRedraw" + @usableFromInline static let neg: JSString = "neg" + @usableFromInline static let negative: JSString = "negative" + @usableFromInline static let negotiated: JSString = "negotiated" + @usableFromInline static let networkPriority: JSString = "networkPriority" + @usableFromInline static let networkState: JSString = "networkState" + @usableFromInline static let newSubscription: JSString = "newSubscription" + @usableFromInline static let newURL: JSString = "newURL" + @usableFromInline static let newValue: JSString = "newValue" + @usableFromInline static let newValueSpecifiedUnits: JSString = "newValueSpecifiedUnits" + @usableFromInline static let newVersion: JSString = "newVersion" + @usableFromInline static let nextElementSibling: JSString = "nextElementSibling" + @usableFromInline static let nextHopProtocol: JSString = "nextHopProtocol" + @usableFromInline static let nextNode: JSString = "nextNode" + @usableFromInline static let nextSibling: JSString = "nextSibling" + @usableFromInline static let noHref: JSString = "noHref" + @usableFromInline static let noModule: JSString = "noModule" + @usableFromInline static let noResize: JSString = "noResize" + @usableFromInline static let noShade: JSString = "noShade" + @usableFromInline static let noValidate: JSString = "noValidate" + @usableFromInline static let noWrap: JSString = "noWrap" + @usableFromInline static let node: JSString = "node" + @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 nominated: JSString = "nominated" + @usableFromInline static let nonce: JSString = "nonce" + @usableFromInline static let normDepthBufferFromNormView: JSString = "normDepthBufferFromNormView" + @usableFromInline static let normalize: JSString = "normalize" + @usableFromInline static let notification: JSString = "notification" + @usableFromInline static let notify: JSString = "notify" + @usableFromInline static let now: JSString = "now" + @usableFromInline static let numIncomingStreamsCreated: JSString = "numIncomingStreamsCreated" + @usableFromInline static let numOctaves: JSString = "numOctaves" + @usableFromInline static let numOutgoingStreamsCreated: JSString = "numOutgoingStreamsCreated" + @usableFromInline static let numReceivedDatagramsDropped: JSString = "numReceivedDatagramsDropped" + @usableFromInline static let number: JSString = "number" + @usableFromInline static let numberOfChannels: JSString = "numberOfChannels" + @usableFromInline static let numberOfFrames: JSString = "numberOfFrames" + @usableFromInline static let numberOfInputs: JSString = "numberOfInputs" + @usableFromInline static let numberOfItems: JSString = "numberOfItems" + @usableFromInline static let numberOfOutputs: JSString = "numberOfOutputs" + @usableFromInline static let numberValue: JSString = "numberValue" + @usableFromInline static let objectStore: JSString = "objectStore" + @usableFromInline static let objectStoreNames: JSString = "objectStoreNames" + @usableFromInline static let observe: JSString = "observe" + @usableFromInline static let occlusionQuerySet: JSString = "occlusionQuerySet" + @usableFromInline static let offerToReceiveAudio: JSString = "offerToReceiveAudio" + @usableFromInline static let offerToReceiveVideo: JSString = "offerToReceiveVideo" + @usableFromInline static let offset: JSString = "offset" + @usableFromInline static let offsetHeight: JSString = "offsetHeight" + @usableFromInline static let offsetLeft: JSString = "offsetLeft" + @usableFromInline static let offsetNode: JSString = "offsetNode" + @usableFromInline static let offsetParent: JSString = "offsetParent" + @usableFromInline static let offsetRay: JSString = "offsetRay" + @usableFromInline static let offsetTop: JSString = "offsetTop" + @usableFromInline static let offsetWidth: JSString = "offsetWidth" + @usableFromInline static let offsetX: JSString = "offsetX" + @usableFromInline static let offsetY: JSString = "offsetY" + @usableFromInline static let ok: JSString = "ok" + @usableFromInline static let oldSubscription: JSString = "oldSubscription" + @usableFromInline static let oldURL: JSString = "oldURL" + @usableFromInline static let oldValue: JSString = "oldValue" + @usableFromInline static let oldVersion: JSString = "oldVersion" + @usableFromInline static let onLine: JSString = "onLine" + @usableFromInline static let onSubmittedWorkDone: JSString = "onSubmittedWorkDone" + @usableFromInline static let onabort: JSString = "onabort" + @usableFromInline static let onactivate: JSString = "onactivate" + @usableFromInline static let onaddsourcebuffer: JSString = "onaddsourcebuffer" + @usableFromInline static let onaddtrack: JSString = "onaddtrack" + @usableFromInline static let onadvertisementreceived: JSString = "onadvertisementreceived" + @usableFromInline static let onafterprint: JSString = "onafterprint" + @usableFromInline static let onanimationcancel: JSString = "onanimationcancel" + @usableFromInline static let onanimationend: JSString = "onanimationend" + @usableFromInline static let onanimationiteration: JSString = "onanimationiteration" + @usableFromInline static let onanimationstart: JSString = "onanimationstart" + @usableFromInline static let onappinstalled: JSString = "onappinstalled" + @usableFromInline static let onaudioend: JSString = "onaudioend" + @usableFromInline static let onaudioprocess: JSString = "onaudioprocess" + @usableFromInline static let onaudiostart: JSString = "onaudiostart" + @usableFromInline static let onauxclick: JSString = "onauxclick" + @usableFromInline static let onavailabilitychanged: JSString = "onavailabilitychanged" + @usableFromInline static let onbackgroundfetchabort: JSString = "onbackgroundfetchabort" + @usableFromInline static let onbackgroundfetchclick: JSString = "onbackgroundfetchclick" + @usableFromInline static let onbackgroundfetchfail: JSString = "onbackgroundfetchfail" + @usableFromInline static let onbackgroundfetchsuccess: JSString = "onbackgroundfetchsuccess" + @usableFromInline static let onbeforeinstallprompt: JSString = "onbeforeinstallprompt" + @usableFromInline static let onbeforeprint: JSString = "onbeforeprint" + @usableFromInline static let onbeforeunload: JSString = "onbeforeunload" + @usableFromInline static let onbeforexrselect: JSString = "onbeforexrselect" + @usableFromInline static let onbegin: JSString = "onbegin" + @usableFromInline static let onblocked: JSString = "onblocked" + @usableFromInline static let onblur: JSString = "onblur" + @usableFromInline static let onboundary: JSString = "onboundary" + @usableFromInline static let onbufferedamountlow: JSString = "onbufferedamountlow" + @usableFromInline static let oncancel: JSString = "oncancel" + @usableFromInline static let oncanmakepayment: JSString = "oncanmakepayment" + @usableFromInline static let oncanplay: JSString = "oncanplay" + @usableFromInline static let oncanplaythrough: JSString = "oncanplaythrough" + @usableFromInline static let once: JSString = "once" + @usableFromInline static let onchange: JSString = "onchange" + @usableFromInline static let oncharacterboundsupdate: JSString = "oncharacterboundsupdate" + @usableFromInline static let oncharacteristicvaluechanged: JSString = "oncharacteristicvaluechanged" + @usableFromInline static let onchargingchange: JSString = "onchargingchange" + @usableFromInline static let onchargingtimechange: JSString = "onchargingtimechange" + @usableFromInline static let onclick: JSString = "onclick" + @usableFromInline static let onclose: JSString = "onclose" + @usableFromInline static let onclosing: JSString = "onclosing" + @usableFromInline static let oncompassneedscalibration: JSString = "oncompassneedscalibration" + @usableFromInline static let oncomplete: JSString = "oncomplete" + @usableFromInline static let oncompositionend: JSString = "oncompositionend" + @usableFromInline static let oncompositionstart: JSString = "oncompositionstart" + @usableFromInline static let onconnect: JSString = "onconnect" + @usableFromInline static let onconnecting: JSString = "onconnecting" + @usableFromInline static let onconnectionavailable: JSString = "onconnectionavailable" + @usableFromInline static let onconnectionstatechange: JSString = "onconnectionstatechange" + @usableFromInline static let oncontentdelete: JSString = "oncontentdelete" + @usableFromInline static let oncontextlost: JSString = "oncontextlost" + @usableFromInline static let oncontextmenu: JSString = "oncontextmenu" + @usableFromInline static let oncontextrestored: JSString = "oncontextrestored" + @usableFromInline static let oncontrollerchange: JSString = "oncontrollerchange" + @usableFromInline static let oncookiechange: JSString = "oncookiechange" + @usableFromInline static let oncopy: JSString = "oncopy" + @usableFromInline static let oncuechange: JSString = "oncuechange" + @usableFromInline static let oncurrententrychange: JSString = "oncurrententrychange" + @usableFromInline static let oncut: JSString = "oncut" + @usableFromInline static let ondataavailable: JSString = "ondataavailable" + @usableFromInline static let ondatachannel: JSString = "ondatachannel" + @usableFromInline static let ondblclick: JSString = "ondblclick" + @usableFromInline static let ondevicechange: JSString = "ondevicechange" + @usableFromInline static let ondevicemotion: JSString = "ondevicemotion" + @usableFromInline static let ondeviceorientation: JSString = "ondeviceorientation" + @usableFromInline static let ondeviceorientationabsolute: JSString = "ondeviceorientationabsolute" + @usableFromInline static let ondischargingtimechange: JSString = "ondischargingtimechange" + @usableFromInline static let ondisconnect: JSString = "ondisconnect" + @usableFromInline static let ondispose: JSString = "ondispose" + @usableFromInline static let ondrag: JSString = "ondrag" + @usableFromInline static let ondragend: JSString = "ondragend" + @usableFromInline static let ondragenter: JSString = "ondragenter" + @usableFromInline static let ondragleave: JSString = "ondragleave" + @usableFromInline static let ondragover: JSString = "ondragover" + @usableFromInline static let ondragstart: JSString = "ondragstart" + @usableFromInline static let ondrop: JSString = "ondrop" + @usableFromInline static let ondurationchange: JSString = "ondurationchange" + @usableFromInline static let oneRealm: JSString = "oneRealm" + @usableFromInline static let onemptied: JSString = "onemptied" + @usableFromInline static let onencrypted: JSString = "onencrypted" + @usableFromInline static let onend: JSString = "onend" + @usableFromInline static let onended: JSString = "onended" + @usableFromInline static let onenter: JSString = "onenter" + @usableFromInline static let onenterpictureinpicture: JSString = "onenterpictureinpicture" + @usableFromInline static let onerror: JSString = "onerror" + @usableFromInline static let onexit: JSString = "onexit" + @usableFromInline static let onfetch: JSString = "onfetch" + @usableFromInline static let onfinish: JSString = "onfinish" + @usableFromInline static let onfocus: JSString = "onfocus" + @usableFromInline static let onformdata: JSString = "onformdata" + @usableFromInline static let onframeratechange: JSString = "onframeratechange" + @usableFromInline static let onfreeze: JSString = "onfreeze" + @usableFromInline static let onfullscreenchange: JSString = "onfullscreenchange" + @usableFromInline static let onfullscreenerror: JSString = "onfullscreenerror" + @usableFromInline static let ongamepadconnected: JSString = "ongamepadconnected" + @usableFromInline static let ongamepaddisconnected: JSString = "ongamepaddisconnected" + @usableFromInline static let ongatheringstatechange: JSString = "ongatheringstatechange" + @usableFromInline static let ongattserverdisconnected: JSString = "ongattserverdisconnected" + @usableFromInline static let ongeometrychange: JSString = "ongeometrychange" + @usableFromInline static let ongotpointercapture: JSString = "ongotpointercapture" + @usableFromInline static let onhashchange: JSString = "onhashchange" + @usableFromInline static let onicecandidate: JSString = "onicecandidate" + @usableFromInline static let onicecandidateerror: JSString = "onicecandidateerror" + @usableFromInline static let oniceconnectionstatechange: JSString = "oniceconnectionstatechange" + @usableFromInline static let onicegatheringstatechange: JSString = "onicegatheringstatechange" + @usableFromInline static let oninput: JSString = "oninput" + @usableFromInline static let oninputreport: JSString = "oninputreport" + @usableFromInline static let oninputsourceschange: JSString = "oninputsourceschange" + @usableFromInline static let oninstall: JSString = "oninstall" + @usableFromInline static let oninvalid: JSString = "oninvalid" + @usableFromInline static let onisolationchange: JSString = "onisolationchange" + @usableFromInline static let onkeydown: JSString = "onkeydown" + @usableFromInline static let onkeypress: JSString = "onkeypress" + @usableFromInline static let onkeystatuseschange: JSString = "onkeystatuseschange" + @usableFromInline static let onkeyup: JSString = "onkeyup" + @usableFromInline static let onlanguagechange: JSString = "onlanguagechange" + @usableFromInline static let onlayoutchange: JSString = "onlayoutchange" + @usableFromInline static let onleavepictureinpicture: JSString = "onleavepictureinpicture" + @usableFromInline static let onlevelchange: JSString = "onlevelchange" + @usableFromInline static let onload: JSString = "onload" + @usableFromInline static let onloadeddata: JSString = "onloadeddata" + @usableFromInline static let onloadedmetadata: JSString = "onloadedmetadata" + @usableFromInline static let onloadend: JSString = "onloadend" + @usableFromInline static let onloading: JSString = "onloading" + @usableFromInline static let onloadingdone: JSString = "onloadingdone" + @usableFromInline static let onloadingerror: JSString = "onloadingerror" + @usableFromInline static let onloadstart: JSString = "onloadstart" + @usableFromInline static let onlostpointercapture: JSString = "onlostpointercapture" + @usableFromInline static let only: JSString = "only" + @usableFromInline static let onmark: JSString = "onmark" + @usableFromInline static let onmessage: JSString = "onmessage" + @usableFromInline static let onmessageerror: JSString = "onmessageerror" + @usableFromInline static let onmidimessage: JSString = "onmidimessage" + @usableFromInline static let onmousedown: JSString = "onmousedown" + @usableFromInline static let onmouseenter: JSString = "onmouseenter" + @usableFromInline static let onmouseleave: JSString = "onmouseleave" + @usableFromInline static let onmousemove: JSString = "onmousemove" + @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 onnavigate: JSString = "onnavigate" + @usableFromInline static let onnavigateerror: JSString = "onnavigateerror" + @usableFromInline static let onnavigatefrom: JSString = "onnavigatefrom" + @usableFromInline static let onnavigatesuccess: JSString = "onnavigatesuccess" + @usableFromInline static let onnavigateto: JSString = "onnavigateto" + @usableFromInline static let onnegotiationneeded: JSString = "onnegotiationneeded" + @usableFromInline static let onnomatch: JSString = "onnomatch" + @usableFromInline static let onnotificationclick: JSString = "onnotificationclick" + @usableFromInline static let onnotificationclose: JSString = "onnotificationclose" + @usableFromInline static let onoffline: JSString = "onoffline" + @usableFromInline static let ononline: JSString = "ononline" + @usableFromInline static let onopen: JSString = "onopen" + @usableFromInline static let onorientationchange: JSString = "onorientationchange" + @usableFromInline static let onpagehide: JSString = "onpagehide" + @usableFromInline static let onpageshow: JSString = "onpageshow" + @usableFromInline static let onpaste: JSString = "onpaste" + @usableFromInline static let onpause: JSString = "onpause" + @usableFromInline static let onpaymentmethodchange: JSString = "onpaymentmethodchange" + @usableFromInline static let onpaymentrequest: JSString = "onpaymentrequest" + @usableFromInline static let onperiodicsync: JSString = "onperiodicsync" + @usableFromInline static let onplay: JSString = "onplay" + @usableFromInline static let onplaying: JSString = "onplaying" + @usableFromInline static let onpointercancel: JSString = "onpointercancel" + @usableFromInline static let onpointerdown: JSString = "onpointerdown" + @usableFromInline static let onpointerenter: JSString = "onpointerenter" + @usableFromInline static let onpointerleave: JSString = "onpointerleave" + @usableFromInline static let onpointerlockchange: JSString = "onpointerlockchange" + @usableFromInline static let onpointerlockerror: JSString = "onpointerlockerror" + @usableFromInline static let onpointermove: JSString = "onpointermove" + @usableFromInline static let onpointerout: JSString = "onpointerout" + @usableFromInline static let onpointerover: JSString = "onpointerover" + @usableFromInline static let onpointerrawupdate: JSString = "onpointerrawupdate" + @usableFromInline static let onpointerup: JSString = "onpointerup" + @usableFromInline static let onpopstate: JSString = "onpopstate" + @usableFromInline static let onportalactivate: JSString = "onportalactivate" + @usableFromInline static let onprioritychange: JSString = "onprioritychange" + @usableFromInline static let onprocessorerror: JSString = "onprocessorerror" + @usableFromInline static let onprogress: JSString = "onprogress" + @usableFromInline static let onpush: JSString = "onpush" + @usableFromInline static let onpushsubscriptionchange: JSString = "onpushsubscriptionchange" + @usableFromInline static let onratechange: JSString = "onratechange" + @usableFromInline static let onreading: JSString = "onreading" + @usableFromInline static let onreadingerror: JSString = "onreadingerror" + @usableFromInline static let onreadystatechange: JSString = "onreadystatechange" + @usableFromInline static let onredraw: JSString = "onredraw" + @usableFromInline static let onreflectionchange: JSString = "onreflectionchange" + @usableFromInline static let onrejectionhandled: JSString = "onrejectionhandled" + @usableFromInline static let onrelease: JSString = "onrelease" + @usableFromInline static let onremove: JSString = "onremove" + @usableFromInline static let onremovesourcebuffer: JSString = "onremovesourcebuffer" + @usableFromInline static let onremovetrack: JSString = "onremovetrack" + @usableFromInline static let onrepeat: JSString = "onrepeat" + @usableFromInline static let onreset: JSString = "onreset" + @usableFromInline static let onresize: JSString = "onresize" + @usableFromInline static let onresourcetimingbufferfull: JSString = "onresourcetimingbufferfull" + @usableFromInline static let onresult: JSString = "onresult" + @usableFromInline static let onresume: JSString = "onresume" + @usableFromInline static let onrtctransform: JSString = "onrtctransform" + @usableFromInline static let onscroll: JSString = "onscroll" + @usableFromInline static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" + @usableFromInline static let onseeked: JSString = "onseeked" + @usableFromInline static let onseeking: JSString = "onseeking" + @usableFromInline static let onselect: JSString = "onselect" + @usableFromInline static let onselectedcandidatepairchange: JSString = "onselectedcandidatepairchange" + @usableFromInline static let onselectend: JSString = "onselectend" + @usableFromInline static let onselectionchange: JSString = "onselectionchange" + @usableFromInline static let onselectstart: JSString = "onselectstart" + @usableFromInline static let onserviceadded: JSString = "onserviceadded" + @usableFromInline static let onservicechanged: JSString = "onservicechanged" + @usableFromInline static let onserviceremoved: JSString = "onserviceremoved" + @usableFromInline static let onshow: JSString = "onshow" + @usableFromInline static let onsignalingstatechange: JSString = "onsignalingstatechange" + @usableFromInline static let onslotchange: JSString = "onslotchange" + @usableFromInline static let onsoundend: JSString = "onsoundend" + @usableFromInline static let onsoundstart: JSString = "onsoundstart" + @usableFromInline static let onsourceclose: JSString = "onsourceclose" + @usableFromInline static let onsourceended: JSString = "onsourceended" + @usableFromInline static let onsourceopen: JSString = "onsourceopen" + @usableFromInline static let onspeechend: JSString = "onspeechend" + @usableFromInline static let onspeechstart: JSString = "onspeechstart" + @usableFromInline static let onsqueeze: JSString = "onsqueeze" + @usableFromInline static let onsqueezeend: JSString = "onsqueezeend" + @usableFromInline static let onsqueezestart: JSString = "onsqueezestart" + @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 onsuccess: JSString = "onsuccess" + @usableFromInline static let onsuspend: JSString = "onsuspend" + @usableFromInline static let onsync: JSString = "onsync" + @usableFromInline static let onterminate: JSString = "onterminate" + @usableFromInline static let ontextformatupdate: JSString = "ontextformatupdate" + @usableFromInline static let ontextupdate: JSString = "ontextupdate" + @usableFromInline static let ontimeout: JSString = "ontimeout" + @usableFromInline static let ontimeupdate: JSString = "ontimeupdate" + @usableFromInline static let ontoggle: JSString = "ontoggle" + @usableFromInline static let ontonechange: JSString = "ontonechange" + @usableFromInline static let ontouchcancel: JSString = "ontouchcancel" + @usableFromInline static let ontouchend: JSString = "ontouchend" + @usableFromInline static let ontouchmove: JSString = "ontouchmove" + @usableFromInline static let ontouchstart: JSString = "ontouchstart" + @usableFromInline static let ontrack: JSString = "ontrack" + @usableFromInline static let ontransitioncancel: JSString = "ontransitioncancel" + @usableFromInline static let ontransitionend: JSString = "ontransitionend" + @usableFromInline static let ontransitionrun: JSString = "ontransitionrun" + @usableFromInline static let ontransitionstart: JSString = "ontransitionstart" + @usableFromInline static let onuncapturederror: JSString = "onuncapturederror" + @usableFromInline static let onunhandledrejection: JSString = "onunhandledrejection" + @usableFromInline static let onunload: JSString = "onunload" + @usableFromInline static let onunmute: JSString = "onunmute" + @usableFromInline static let onupdate: JSString = "onupdate" + @usableFromInline static let onupdateend: JSString = "onupdateend" + @usableFromInline static let onupdatefound: JSString = "onupdatefound" + @usableFromInline static let onupdatestart: JSString = "onupdatestart" + @usableFromInline static let onupgradeneeded: JSString = "onupgradeneeded" + @usableFromInline static let onversionchange: JSString = "onversionchange" + @usableFromInline static let onvisibilitychange: JSString = "onvisibilitychange" + @usableFromInline static let onvoiceschanged: JSString = "onvoiceschanged" + @usableFromInline static let onvolumechange: JSString = "onvolumechange" + @usableFromInline static let onwaiting: JSString = "onwaiting" + @usableFromInline static let onwaitingforkey: JSString = "onwaitingforkey" + @usableFromInline static let onwebkitanimationend: JSString = "onwebkitanimationend" + @usableFromInline static let onwebkitanimationiteration: JSString = "onwebkitanimationiteration" + @usableFromInline static let onwebkitanimationstart: JSString = "onwebkitanimationstart" + @usableFromInline static let onwebkittransitionend: JSString = "onwebkittransitionend" + @usableFromInline static let onwheel: JSString = "onwheel" + @usableFromInline static let open: JSString = "open" + @usableFromInline static let openCursor: JSString = "openCursor" + @usableFromInline static let openKeyCursor: JSString = "openKeyCursor" + @usableFromInline static let openWindow: JSString = "openWindow" + @usableFromInline static let opened: JSString = "opened" + @usableFromInline static let opener: JSString = "opener" + @usableFromInline static let operation: JSString = "operation" + @usableFromInline static let `operator`: JSString = "operator" + @usableFromInline static let optimizeForLatency: JSString = "optimizeForLatency" + @usableFromInline static let optimum: JSString = "optimum" + @usableFromInline static let optionalFeatures: JSString = "optionalFeatures" + @usableFromInline static let optionalManufacturerData: JSString = "optionalManufacturerData" + @usableFromInline static let optionalServices: JSString = "optionalServices" + @usableFromInline static let options: JSString = "options" + @usableFromInline static let orderX: JSString = "orderX" + @usableFromInline static let orderY: JSString = "orderY" + @usableFromInline static let ordered: JSString = "ordered" + @usableFromInline static let organization: JSString = "organization" + @usableFromInline static let orient: JSString = "orient" + @usableFromInline static let orientAngle: JSString = "orientAngle" + @usableFromInline static let orientType: JSString = "orientType" + @usableFromInline static let orientation: JSString = "orientation" + @usableFromInline static let orientationX: JSString = "orientationX" + @usableFromInline static let orientationY: JSString = "orientationY" + @usableFromInline static let orientationZ: JSString = "orientationZ" + @usableFromInline static let origin: JSString = "origin" + @usableFromInline static let originAgentCluster: JSString = "originAgentCluster" + @usableFromInline static let originPolicyIds: JSString = "originPolicyIds" + @usableFromInline static let originTime: JSString = "originTime" + @usableFromInline static let originalPolicy: JSString = "originalPolicy" + @usableFromInline static let ornaments: JSString = "ornaments" + @usableFromInline static let oscpu: JSString = "oscpu" + @usableFromInline static let oth: JSString = "oth" + @usableFromInline static let otp: JSString = "otp" + @usableFromInline static let outerHTML: JSString = "outerHTML" + @usableFromInline static let outerHeight: JSString = "outerHeight" + @usableFromInline static let outerText: JSString = "outerText" + @usableFromInline static let outerWidth: JSString = "outerWidth" + @usableFromInline static let outgoingHighWaterMark: JSString = "outgoingHighWaterMark" + @usableFromInline static let outgoingMaxAge: JSString = "outgoingMaxAge" + @usableFromInline static let output: JSString = "output" + @usableFromInline static let outputBuffer: JSString = "outputBuffer" + @usableFromInline static let outputChannelCount: JSString = "outputChannelCount" + @usableFromInline static let outputLatency: JSString = "outputLatency" + @usableFromInline static let outputPadding: JSString = "outputPadding" + @usableFromInline static let outputReports: JSString = "outputReports" + @usableFromInline static let outputSizes: JSString = "outputSizes" + @usableFromInline static let outputs: JSString = "outputs" + @usableFromInline static let overlaysContent: JSString = "overlaysContent" + @usableFromInline static let overrideColors: JSString = "overrideColors" + @usableFromInline static let overrideMimeType: JSString = "overrideMimeType" + @usableFromInline static let oversample: JSString = "oversample" + @usableFromInline static let overset: JSString = "overset" + @usableFromInline static let overwrite: JSString = "overwrite" + @usableFromInline static let ownerDocument: JSString = "ownerDocument" + @usableFromInline static let ownerElement: JSString = "ownerElement" + @usableFromInline static let ownerNode: JSString = "ownerNode" + @usableFromInline static let ownerRule: JSString = "ownerRule" + @usableFromInline static let ownerSVGElement: JSString = "ownerSVGElement" + @usableFromInline static let p: JSString = "p" + @usableFromInline static let p1: JSString = "p1" + @usableFromInline static let p2: JSString = "p2" + @usableFromInline static let p3: JSString = "p3" + @usableFromInline static let p4: JSString = "p4" + @usableFromInline static let packetSize: JSString = "packetSize" + @usableFromInline static let packets: JSString = "packets" + @usableFromInline static let packetsContributedTo: JSString = "packetsContributedTo" + @usableFromInline static let packetsDiscarded: JSString = "packetsDiscarded" + @usableFromInline static let packetsDiscardedOnSend: JSString = "packetsDiscardedOnSend" + @usableFromInline static let packetsDuplicated: JSString = "packetsDuplicated" + @usableFromInline static let packetsFailedDecryption: JSString = "packetsFailedDecryption" + @usableFromInline static let packetsLost: JSString = "packetsLost" + @usableFromInline static let packetsReceived: JSString = "packetsReceived" + @usableFromInline static let packetsRepaired: JSString = "packetsRepaired" + @usableFromInline static let packetsSent: JSString = "packetsSent" + @usableFromInline static let pad: JSString = "pad" + @usableFromInline static let padding: JSString = "padding" + @usableFromInline static let pageLeft: JSString = "pageLeft" + @usableFromInline static let pageTop: JSString = "pageTop" + @usableFromInline static let pageX: JSString = "pageX" + @usableFromInline static let pageXOffset: JSString = "pageXOffset" + @usableFromInline static let pageY: JSString = "pageY" + @usableFromInline static let pageYOffset: JSString = "pageYOffset" + @usableFromInline static let paintWorklet: JSString = "paintWorklet" + @usableFromInline static let palettes: JSString = "palettes" + @usableFromInline static let pan: JSString = "pan" + @usableFromInline static let panTiltZoom: JSString = "panTiltZoom" + @usableFromInline static let panningModel: JSString = "panningModel" + @usableFromInline static let parameterData: JSString = "parameterData" + @usableFromInline static let parameters: JSString = "parameters" + @usableFromInline static let parent: JSString = "parent" + @usableFromInline static let parentElement: JSString = "parentElement" + @usableFromInline static let parentId: JSString = "parentId" + @usableFromInline static let parentNode: JSString = "parentNode" + @usableFromInline static let parentRule: JSString = "parentRule" + @usableFromInline static let parentStyleSheet: JSString = "parentStyleSheet" + @usableFromInline static let parity: JSString = "parity" + @usableFromInline static let parse: JSString = "parse" + @usableFromInline static let parseAll: JSString = "parseAll" + @usableFromInline static let parseCommaValueList: JSString = "parseCommaValueList" + @usableFromInline static let parseDeclaration: JSString = "parseDeclaration" + @usableFromInline static let parseDeclarationList: JSString = "parseDeclarationList" + @usableFromInline static let parseFromString: JSString = "parseFromString" + @usableFromInline static let parseRule: JSString = "parseRule" + @usableFromInline static let parseRuleList: JSString = "parseRuleList" + @usableFromInline static let parseStylesheet: JSString = "parseStylesheet" + @usableFromInline static let parseValue: JSString = "parseValue" + @usableFromInline static let parseValueList: JSString = "parseValueList" + @usableFromInline static let part: JSString = "part" + @usableFromInline static let partialFramesLost: JSString = "partialFramesLost" + @usableFromInline static let passOp: JSString = "passOp" + @usableFromInline static let passive: JSString = "passive" + @usableFromInline static let password: JSString = "password" + @usableFromInline static let path: JSString = "path" + @usableFromInline static let pathLength: JSString = "pathLength" + @usableFromInline static let pathname: JSString = "pathname" + @usableFromInline static let pattern: JSString = "pattern" + @usableFromInline static let patternContentUnits: JSString = "patternContentUnits" + @usableFromInline static let patternMismatch: JSString = "patternMismatch" + @usableFromInline static let patternTransform: JSString = "patternTransform" + @usableFromInline static let patternUnits: JSString = "patternUnits" + @usableFromInline static let pause: JSString = "pause" + @usableFromInline static let pauseAnimations: JSString = "pauseAnimations" + @usableFromInline static let pauseOnExit: JSString = "pauseOnExit" + @usableFromInline static let pauseTransformFeedback: JSString = "pauseTransformFeedback" + @usableFromInline static let paused: JSString = "paused" + @usableFromInline static let payeeOrigin: JSString = "payeeOrigin" + @usableFromInline static let payloadType: JSString = "payloadType" + @usableFromInline static let payment: JSString = "payment" + @usableFromInline static let paymentManager: JSString = "paymentManager" + @usableFromInline static let paymentMethod: JSString = "paymentMethod" + @usableFromInline static let paymentMethodErrors: JSString = "paymentMethodErrors" + @usableFromInline static let paymentRequestId: JSString = "paymentRequestId" + @usableFromInline static let paymentRequestOrigin: JSString = "paymentRequestOrigin" + @usableFromInline static let pc: JSString = "pc" + @usableFromInline static let pdfViewerEnabled: JSString = "pdfViewerEnabled" + @usableFromInline static let peerIdentity: JSString = "peerIdentity" + @usableFromInline static let pending: JSString = "pending" + @usableFromInline static let pendingLocalDescription: JSString = "pendingLocalDescription" + @usableFromInline static let pendingRemoteDescription: JSString = "pendingRemoteDescription" + @usableFromInline static let perDscpPacketsReceived: JSString = "perDscpPacketsReceived" + @usableFromInline static let perDscpPacketsSent: JSString = "perDscpPacketsSent" + @usableFromInline static let percent: JSString = "percent" + @usableFromInline static let percentHint: JSString = "percentHint" + @usableFromInline static let percentageBlockSize: JSString = "percentageBlockSize" + @usableFromInline static let percentageInlineSize: JSString = "percentageInlineSize" + @usableFromInline static let performance: JSString = "performance" + @usableFromInline static let performanceTime: JSString = "performanceTime" + @usableFromInline static let periodicSync: JSString = "periodicSync" + @usableFromInline static let periodicWave: JSString = "periodicWave" + @usableFromInline static let permission: JSString = "permission" + @usableFromInline static let permissionState: JSString = "permissionState" + @usableFromInline static let permissions: JSString = "permissions" + @usableFromInline static let permissionsPolicy: JSString = "permissionsPolicy" + @usableFromInline static let permutation: JSString = "permutation" + @usableFromInline static let persist: JSString = "persist" + @usableFromInline static let persisted: JSString = "persisted" + @usableFromInline static let persistentState: JSString = "persistentState" + @usableFromInline static let personalbar: JSString = "personalbar" + @usableFromInline static let phase: JSString = "phase" + @usableFromInline static let phone: JSString = "phone" + @usableFromInline static let physicalMaximum: JSString = "physicalMaximum" + @usableFromInline static let physicalMinimum: JSString = "physicalMinimum" + @usableFromInline static let pictureInPictureElement: JSString = "pictureInPictureElement" + @usableFromInline static let pictureInPictureEnabled: JSString = "pictureInPictureEnabled" + @usableFromInline static let pictureInPictureWindow: JSString = "pictureInPictureWindow" + @usableFromInline static let ping: JSString = "ping" + @usableFromInline static let pipeThrough: JSString = "pipeThrough" + @usableFromInline static let pipeTo: JSString = "pipeTo" + @usableFromInline static let pitch: JSString = "pitch" + @usableFromInline static let pixelDepth: JSString = "pixelDepth" + @usableFromInline static let pixelStorei: JSString = "pixelStorei" + @usableFromInline static let placeholder: JSString = "placeholder" + @usableFromInline static let planeIndex: JSString = "planeIndex" + @usableFromInline static let platform: JSString = "platform" + @usableFromInline static let platformVersion: JSString = "platformVersion" + @usableFromInline static let play: JSString = "play" + @usableFromInline static let playState: JSString = "playState" + @usableFromInline static let playbackRate: JSString = "playbackRate" + @usableFromInline static let playbackState: JSString = "playbackState" + @usableFromInline static let playbackTime: JSString = "playbackTime" + @usableFromInline static let played: JSString = "played" + @usableFromInline static let playsInline: JSString = "playsInline" + @usableFromInline static let pliCount: JSString = "pliCount" + @usableFromInline static let plugins: JSString = "plugins" + @usableFromInline static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" + @usableFromInline static let pointerId: JSString = "pointerId" + @usableFromInline static let pointerLockElement: JSString = "pointerLockElement" + @usableFromInline static let pointerMovementScrolls: JSString = "pointerMovementScrolls" + @usableFromInline static let pointerType: JSString = "pointerType" + @usableFromInline static let points: JSString = "points" + @usableFromInline static let pointsAtX: JSString = "pointsAtX" + @usableFromInline static let pointsAtY: JSString = "pointsAtY" + @usableFromInline static let pointsAtZ: JSString = "pointsAtZ" + @usableFromInline static let pointsOfInterest: JSString = "pointsOfInterest" + @usableFromInline static let polygonOffset: JSString = "polygonOffset" + @usableFromInline static let popDebugGroup: JSString = "popDebugGroup" + @usableFromInline static let popErrorScope: JSString = "popErrorScope" + @usableFromInline static let populateMatrix: JSString = "populateMatrix" + @usableFromInline static let port: JSString = "port" + @usableFromInline static let port1: JSString = "port1" + @usableFromInline static let port2: JSString = "port2" + @usableFromInline static let portalHost: JSString = "portalHost" + @usableFromInline static let ports: JSString = "ports" + @usableFromInline static let pose: JSString = "pose" + @usableFromInline static let position: JSString = "position" + @usableFromInline static let positionAlign: JSString = "positionAlign" + @usableFromInline static let positionX: JSString = "positionX" + @usableFromInline static let positionY: JSString = "positionY" + @usableFromInline static let positionZ: JSString = "positionZ" + @usableFromInline static let postMessage: JSString = "postMessage" + @usableFromInline static let postalCode: JSString = "postalCode" + @usableFromInline static let poster: JSString = "poster" + @usableFromInline static let postscriptName: JSString = "postscriptName" + @usableFromInline static let pow: JSString = "pow" + @usableFromInline static let powerEfficient: JSString = "powerEfficient" + @usableFromInline static let powerPreference: JSString = "powerPreference" + @usableFromInline static let preMultiplySelf: JSString = "preMultiplySelf" + @usableFromInline static let precision: JSString = "precision" + @usableFromInline static let predictedDisplayTime: JSString = "predictedDisplayTime" + @usableFromInline static let predictedEvents: JSString = "predictedEvents" + @usableFromInline static let preferAnimation: JSString = "preferAnimation" + @usableFromInline static let preferCurrentTab: JSString = "preferCurrentTab" + @usableFromInline static let preferredReflectionFormat: JSString = "preferredReflectionFormat" + @usableFromInline static let prefix: JSString = "prefix" + @usableFromInline static let preload: JSString = "preload" + @usableFromInline static let preloadResponse: JSString = "preloadResponse" + @usableFromInline static let prelude: JSString = "prelude" + @usableFromInline static let premultipliedAlpha: JSString = "premultipliedAlpha" + @usableFromInline static let premultiplyAlpha: JSString = "premultiplyAlpha" + @usableFromInline static let prepend: JSString = "prepend" + @usableFromInline static let presentation: JSString = "presentation" + @usableFromInline static let presentationArea: JSString = "presentationArea" + @usableFromInline static let presentationStyle: JSString = "presentationStyle" + @usableFromInline static let presentationTime: JSString = "presentationTime" + @usableFromInline static let presentedFrames: JSString = "presentedFrames" + @usableFromInline static let preserveAlpha: JSString = "preserveAlpha" + @usableFromInline static let preserveAspectRatio: JSString = "preserveAspectRatio" + @usableFromInline static let preserveDrawingBuffer: JSString = "preserveDrawingBuffer" + @usableFromInline static let preservesPitch: JSString = "preservesPitch" + @usableFromInline static let pressed: JSString = "pressed" + @usableFromInline static let pressure: JSString = "pressure" + @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 preventSilentAccess: JSString = "preventSilentAccess" + @usableFromInline static let previousElementSibling: JSString = "previousElementSibling" + @usableFromInline static let previousNode: JSString = "previousNode" + @usableFromInline static let previousPriority: JSString = "previousPriority" + @usableFromInline static let previousRect: JSString = "previousRect" + @usableFromInline static let previousSibling: JSString = "previousSibling" + @usableFromInline static let price: JSString = "price" + @usableFromInline static let primaries: JSString = "primaries" + @usableFromInline static let primaryKey: JSString = "primaryKey" + @usableFromInline static let primaryLightDirection: JSString = "primaryLightDirection" + @usableFromInline static let primaryLightIntensity: JSString = "primaryLightIntensity" + @usableFromInline static let primitive: JSString = "primitive" + @usableFromInline static let primitiveUnits: JSString = "primitiveUnits" + @usableFromInline static let print: JSString = "print" + @usableFromInline static let priority: JSString = "priority" + @usableFromInline static let privateKey: JSString = "privateKey" + @usableFromInline static let probeSpace: JSString = "probeSpace" + @usableFromInline static let processingDuration: JSString = "processingDuration" + @usableFromInline static let processingEnd: JSString = "processingEnd" + @usableFromInline static let processingStart: JSString = "processingStart" + @usableFromInline static let processorOptions: JSString = "processorOptions" + @usableFromInline static let produceCropTarget: JSString = "produceCropTarget" + @usableFromInline static let product: JSString = "product" + @usableFromInline static let productId: JSString = "productId" + @usableFromInline static let productName: JSString = "productName" + @usableFromInline static let productSub: JSString = "productSub" + @usableFromInline static let profile: JSString = "profile" + @usableFromInline static let profiles: JSString = "profiles" + @usableFromInline static let progress: JSString = "progress" + @usableFromInline static let projectionMatrix: JSString = "projectionMatrix" + @usableFromInline static let promise: JSString = "promise" + @usableFromInline static let prompt: JSString = "prompt" + @usableFromInline static let properties: JSString = "properties" + @usableFromInline static let propertyName: JSString = "propertyName" + @usableFromInline static let `protocol`: JSString = "protocol" + @usableFromInline static let protocolCode: JSString = "protocolCode" + @usableFromInline static let protocols: JSString = "protocols" + @usableFromInline static let provider: JSString = "provider" + @usableFromInline static let providers: JSString = "providers" + @usableFromInline static let pseudo: JSString = "pseudo" + @usableFromInline static let pseudoElement: JSString = "pseudoElement" + @usableFromInline static let pt: JSString = "pt" + @usableFromInline static let pubKeyCredParams: JSString = "pubKeyCredParams" + @usableFromInline static let `public`: JSString = "public" + @usableFromInline static let publicExponent: JSString = "publicExponent" + @usableFromInline static let publicId: JSString = "publicId" + @usableFromInline static let publicKey: JSString = "publicKey" + @usableFromInline static let pull: JSString = "pull" + @usableFromInline static let pulse: JSString = "pulse" + @usableFromInline static let purchaseToken: JSString = "purchaseToken" + @usableFromInline static let pushDebugGroup: JSString = "pushDebugGroup" + @usableFromInline static let pushErrorScope: JSString = "pushErrorScope" + @usableFromInline static let pushManager: JSString = "pushManager" + @usableFromInline static let pushState: JSString = "pushState" + @usableFromInline static let put: JSString = "put" + @usableFromInline static let putImageData: JSString = "putImageData" + @usableFromInline static let px: JSString = "px" + @usableFromInline static let q: JSString = "q" + @usableFromInline static let qi: JSString = "qi" + @usableFromInline static let qpSum: JSString = "qpSum" + @usableFromInline static let quadraticCurveTo: JSString = "quadraticCurveTo" + @usableFromInline static let quality: JSString = "quality" + @usableFromInline static let qualityLimitationDurations: JSString = "qualityLimitationDurations" + @usableFromInline static let qualityLimitationReason: JSString = "qualityLimitationReason" + @usableFromInline static let qualityLimitationResolutionChanges: JSString = "qualityLimitationResolutionChanges" + @usableFromInline static let quaternion: JSString = "quaternion" + @usableFromInline static let query: JSString = "query" + @usableFromInline static let queryCommandEnabled: JSString = "queryCommandEnabled" + @usableFromInline static let queryCommandIndeterm: JSString = "queryCommandIndeterm" + @usableFromInline static let queryCommandState: JSString = "queryCommandState" + @usableFromInline static let queryCommandSupported: JSString = "queryCommandSupported" + @usableFromInline static let queryCommandValue: JSString = "queryCommandValue" + @usableFromInline static let queryCounterEXT: JSString = "queryCounterEXT" + @usableFromInline static let queryIndex: JSString = "queryIndex" + @usableFromInline static let queryPermission: JSString = "queryPermission" + @usableFromInline static let querySelector: JSString = "querySelector" + @usableFromInline static let querySelectorAll: JSString = "querySelectorAll" + @usableFromInline static let querySet: JSString = "querySet" + @usableFromInline static let queue: JSString = "queue" + @usableFromInline static let quota: JSString = "quota" + @usableFromInline static let r: JSString = "r" + @usableFromInline static let rad: JSString = "rad" + @usableFromInline static let radius: JSString = "radius" + @usableFromInline static let radiusX: JSString = "radiusX" + @usableFromInline static let radiusY: JSString = "radiusY" + @usableFromInline static let randomUUID: JSString = "randomUUID" + @usableFromInline static let range: JSString = "range" + @usableFromInline static let rangeCount: JSString = "rangeCount" + @usableFromInline static let rangeEnd: JSString = "rangeEnd" + @usableFromInline static let rangeMax: JSString = "rangeMax" + @usableFromInline static let rangeMin: JSString = "rangeMin" + @usableFromInline static let rangeOverflow: JSString = "rangeOverflow" + @usableFromInline static let rangeStart: JSString = "rangeStart" + @usableFromInline static let rangeUnderflow: JSString = "rangeUnderflow" + @usableFromInline static let rate: JSString = "rate" + @usableFromInline static let ratio: JSString = "ratio" + @usableFromInline static let rawId: JSString = "rawId" + @usableFromInline static let rawValue: JSString = "rawValue" + @usableFromInline static let rawValueToMeters: JSString = "rawValueToMeters" + @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 readBuffer: JSString = "readBuffer" + @usableFromInline static let readOnly: JSString = "readOnly" + @usableFromInline static let readPixels: JSString = "readPixels" + @usableFromInline static let readText: JSString = "readText" + @usableFromInline static let readValue: JSString = "readValue" + @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 real: JSString = "real" + @usableFromInline static let reason: JSString = "reason" + @usableFromInline static let receiveFeatureReport: JSString = "receiveFeatureReport" + @usableFromInline static let receiveTime: JSString = "receiveTime" + @usableFromInline static let receivedAlert: JSString = "receivedAlert" + @usableFromInline static let receiver: JSString = "receiver" + @usableFromInline static let receiverId: JSString = "receiverId" + @usableFromInline static let receiverWindow: JSString = "receiverWindow" + @usableFromInline static let recipient: JSString = "recipient" + @usableFromInline static let recommendedViewportScale: JSString = "recommendedViewportScale" + @usableFromInline static let reconnect: JSString = "reconnect" + @usableFromInline static let recordType: JSString = "recordType" + @usableFromInline static let records: JSString = "records" + @usableFromInline static let recordsAvailable: JSString = "recordsAvailable" + @usableFromInline static let rect: JSString = "rect" + @usableFromInline static let recurrentBias: JSString = "recurrentBias" + @usableFromInline static let recursive: JSString = "recursive" + @usableFromInline static let redEyeReduction: JSString = "redEyeReduction" + @usableFromInline static let redirect: JSString = "redirect" + @usableFromInline static let redirectCount: JSString = "redirectCount" + @usableFromInline static let redirectEnd: JSString = "redirectEnd" + @usableFromInline static let redirectStart: JSString = "redirectStart" + @usableFromInline static let redirected: JSString = "redirected" + @usableFromInline static let reduceL1: JSString = "reduceL1" + @usableFromInline static let reduceL2: JSString = "reduceL2" + @usableFromInline static let reduceLogSum: JSString = "reduceLogSum" + @usableFromInline static let reduceLogSumExp: JSString = "reduceLogSumExp" + @usableFromInline static let reduceMax: JSString = "reduceMax" + @usableFromInline static let reduceMean: JSString = "reduceMean" + @usableFromInline static let reduceMin: JSString = "reduceMin" + @usableFromInline static let reduceProduct: JSString = "reduceProduct" + @usableFromInline static let reduceSum: JSString = "reduceSum" + @usableFromInline static let reduceSumSquare: JSString = "reduceSumSquare" + @usableFromInline static let reducedSize: JSString = "reducedSize" + @usableFromInline static let reduction: JSString = "reduction" + @usableFromInline static let refDistance: JSString = "refDistance" + @usableFromInline static let refX: JSString = "refX" + @usableFromInline static let refY: JSString = "refY" + @usableFromInline static let referenceFrame: JSString = "referenceFrame" + @usableFromInline static let referenceNode: JSString = "referenceNode" + @usableFromInline static let referenceSpace: JSString = "referenceSpace" + @usableFromInline static let referrer: JSString = "referrer" + @usableFromInline static let referrerPolicy: JSString = "referrerPolicy" + @usableFromInline static let referringDevice: JSString = "referringDevice" + @usableFromInline static let reflectionFormat: JSString = "reflectionFormat" + @usableFromInline static let refresh: JSString = "refresh" + @usableFromInline static let region: JSString = "region" + @usableFromInline static let regionAnchorX: JSString = "regionAnchorX" + @usableFromInline static let regionAnchorY: JSString = "regionAnchorY" + @usableFromInline static let regionOverset: JSString = "regionOverset" + @usableFromInline static let register: JSString = "register" + @usableFromInline static let registerAttributionSource: JSString = "registerAttributionSource" + @usableFromInline static let registerProperty: JSString = "registerProperty" + @usableFromInline static let registerProtocolHandler: JSString = "registerProtocolHandler" + @usableFromInline static let registration: JSString = "registration" + @usableFromInline static let rel: JSString = "rel" + @usableFromInline static let relList: JSString = "relList" + @usableFromInline static let relatedAddress: JSString = "relatedAddress" + @usableFromInline static let relatedNode: JSString = "relatedNode" + @usableFromInline static let relatedPort: JSString = "relatedPort" + @usableFromInline static let relatedTarget: JSString = "relatedTarget" + @usableFromInline static let relativeTo: JSString = "relativeTo" + @usableFromInline static let relayProtocol: JSString = "relayProtocol" + @usableFromInline static let relayedSource: JSString = "relayedSource" + @usableFromInline static let release: JSString = "release" + @usableFromInline static let releaseEvents: JSString = "releaseEvents" + @usableFromInline static let releaseInterface: JSString = "releaseInterface" + @usableFromInline static let releaseLock: JSString = "releaseLock" + @usableFromInline static let releasePointerCapture: JSString = "releasePointerCapture" + @usableFromInline static let released: JSString = "released" + @usableFromInline static let reliableWrite: JSString = "reliableWrite" + @usableFromInline static let reload: JSString = "reload" + @usableFromInline static let relu: JSString = "relu" + @usableFromInline static let rem: JSString = "rem" + @usableFromInline static let remote: JSString = "remote" + @usableFromInline static let remoteCandidateId: JSString = "remoteCandidateId" + @usableFromInline static let remoteCertificateId: JSString = "remoteCertificateId" + @usableFromInline static let remoteDescription: JSString = "remoteDescription" + @usableFromInline static let remoteId: JSString = "remoteId" + @usableFromInline static let remoteTimestamp: JSString = "remoteTimestamp" + @usableFromInline static let remove: JSString = "remove" + @usableFromInline static let removeAllRanges: JSString = "removeAllRanges" + @usableFromInline static let removeAttribute: JSString = "removeAttribute" + @usableFromInline static let removeAttributeNS: JSString = "removeAttributeNS" + @usableFromInline static let removeAttributeNode: JSString = "removeAttributeNode" + @usableFromInline static let removeChild: JSString = "removeChild" + @usableFromInline static let removeCue: JSString = "removeCue" + @usableFromInline static let removeEntry: JSString = "removeEntry" + @usableFromInline static let removeItem: JSString = "removeItem" + @usableFromInline static let removeNamedItem: JSString = "removeNamedItem" + @usableFromInline static let removeNamedItemNS: JSString = "removeNamedItemNS" + @usableFromInline static let removeParameter: JSString = "removeParameter" + @usableFromInline static let removeProperty: JSString = "removeProperty" + @usableFromInline static let removeRange: JSString = "removeRange" + @usableFromInline static let removeRule: JSString = "removeRule" + @usableFromInline static let removeSourceBuffer: JSString = "removeSourceBuffer" + @usableFromInline static let removeTrack: JSString = "removeTrack" + @usableFromInline static let removed: JSString = "removed" + @usableFromInline static let removedNodes: JSString = "removedNodes" + @usableFromInline static let removedSamplesForAcceleration: JSString = "removedSamplesForAcceleration" + @usableFromInline static let renderState: JSString = "renderState" + @usableFromInline static let renderTime: JSString = "renderTime" + @usableFromInline static let renderbufferStorage: JSString = "renderbufferStorage" + @usableFromInline static let renderbufferStorageMultisample: JSString = "renderbufferStorageMultisample" + @usableFromInline static let renderedBuffer: JSString = "renderedBuffer" + @usableFromInline static let renotify: JSString = "renotify" + @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" + @usableFromInline static let replaceData: JSString = "replaceData" + @usableFromInline static let replaceItem: JSString = "replaceItem" + @usableFromInline static let replaceState: JSString = "replaceState" + @usableFromInline static let replaceSync: JSString = "replaceSync" + @usableFromInline static let replaceTrack: JSString = "replaceTrack" + @usableFromInline static let replaceWith: JSString = "replaceWith" + @usableFromInline static let replacesClientId: JSString = "replacesClientId" + @usableFromInline static let reportCount: JSString = "reportCount" + @usableFromInline static let reportError: JSString = "reportError" + @usableFromInline static let reportId: JSString = "reportId" + @usableFromInline static let reportSize: JSString = "reportSize" + @usableFromInline static let reportValidity: JSString = "reportValidity" + @usableFromInline static let reportsReceived: JSString = "reportsReceived" + @usableFromInline static let reportsSent: JSString = "reportsSent" + @usableFromInline static let request: JSString = "request" + @usableFromInline static let requestAdapter: JSString = "requestAdapter" + @usableFromInline static let requestBytesSent: JSString = "requestBytesSent" + @usableFromInline static let requestData: JSString = "requestData" + @usableFromInline static let requestDevice: JSString = "requestDevice" + @usableFromInline static let requestFrame: JSString = "requestFrame" + @usableFromInline static let requestFullscreen: JSString = "requestFullscreen" + @usableFromInline static let requestHitTestSource: JSString = "requestHitTestSource" + @usableFromInline static let requestHitTestSourceForTransientInput: JSString = "requestHitTestSourceForTransientInput" + @usableFromInline static let requestId: JSString = "requestId" + @usableFromInline static let requestLightProbe: JSString = "requestLightProbe" + @usableFromInline static let requestMIDIAccess: JSString = "requestMIDIAccess" + @usableFromInline static let requestMediaKeySystemAccess: JSString = "requestMediaKeySystemAccess" + @usableFromInline static let requestPermission: JSString = "requestPermission" + @usableFromInline static let requestPictureInPicture: JSString = "requestPictureInPicture" + @usableFromInline static let requestPointerLock: JSString = "requestPointerLock" + @usableFromInline static let requestPort: JSString = "requestPort" + @usableFromInline static let requestPresenter: JSString = "requestPresenter" + @usableFromInline static let requestReferenceSpace: JSString = "requestReferenceSpace" + @usableFromInline static let requestSession: JSString = "requestSession" + @usableFromInline static let requestStart: JSString = "requestStart" + @usableFromInline static let requestStorageAccess: JSString = "requestStorageAccess" + @usableFromInline static let requestSubmit: JSString = "requestSubmit" + @usableFromInline static let requestToSend: JSString = "requestToSend" + @usableFromInline static let requestType: JSString = "requestType" + @usableFromInline static let requestViewportScale: JSString = "requestViewportScale" + @usableFromInline static let requestedSamplingFrequency: JSString = "requestedSamplingFrequency" + @usableFromInline static let requestsReceived: JSString = "requestsReceived" + @usableFromInline static let requestsSent: JSString = "requestsSent" + @usableFromInline static let requireInteraction: JSString = "requireInteraction" + @usableFromInline static let requireResidentKey: JSString = "requireResidentKey" + @usableFromInline static let required: JSString = "required" + @usableFromInline static let requiredExtensions: JSString = "requiredExtensions" + @usableFromInline static let requiredFeatures: JSString = "requiredFeatures" + @usableFromInline static let requiredLimits: JSString = "requiredLimits" + @usableFromInline static let resample2d: JSString = "resample2d" + @usableFromInline static let reset: JSString = "reset" + @usableFromInline static let resetAfter: JSString = "resetAfter" + @usableFromInline static let resetTransform: JSString = "resetTransform" + @usableFromInline static let reshape: JSString = "reshape" + @usableFromInline static let residentKey: JSString = "residentKey" + @usableFromInline static let resizeBy: JSString = "resizeBy" + @usableFromInline static let resizeHeight: JSString = "resizeHeight" + @usableFromInline static let resizeMode: JSString = "resizeMode" + @usableFromInline static let resizeQuality: JSString = "resizeQuality" + @usableFromInline static let resizeTo: JSString = "resizeTo" + @usableFromInline static let resizeWidth: JSString = "resizeWidth" + @usableFromInline static let resolution: JSString = "resolution" + @usableFromInline static let resolve: JSString = "resolve" + @usableFromInline static let resolveQuerySet: JSString = "resolveQuerySet" + @usableFromInline static let resolveTarget: JSString = "resolveTarget" + @usableFromInline static let resource: JSString = "resource" + @usableFromInline static let resourceId: JSString = "resourceId" + @usableFromInline static let resources: JSString = "resources" + @usableFromInline static let respond: JSString = "respond" + @usableFromInline static let respondWith: JSString = "respondWith" + @usableFromInline static let respondWithNewView: JSString = "respondWithNewView" + @usableFromInline static let response: JSString = "response" + @usableFromInline static let responseBytesSent: JSString = "responseBytesSent" + @usableFromInline static let responseEnd: JSString = "responseEnd" + @usableFromInline static let responseReady: JSString = "responseReady" + @usableFromInline static let responseStart: JSString = "responseStart" + @usableFromInline static let responseText: JSString = "responseText" + @usableFromInline static let responseType: JSString = "responseType" + @usableFromInline static let responseURL: JSString = "responseURL" + @usableFromInline static let responseXML: JSString = "responseXML" + @usableFromInline static let responsesReceived: JSString = "responsesReceived" + @usableFromInline static let responsesSent: JSString = "responsesSent" + @usableFromInline static let restartIce: JSString = "restartIce" + @usableFromInline static let restore: JSString = "restore" + @usableFromInline static let restoreContext: JSString = "restoreContext" + @usableFromInline static let restrictOwnAudio: JSString = "restrictOwnAudio" + @usableFromInline static let result: JSString = "result" + @usableFromInline static let resultIndex: JSString = "resultIndex" + @usableFromInline static let resultType: JSString = "resultType" + @usableFromInline static let resultingClientId: JSString = "resultingClientId" + @usableFromInline static let results: JSString = "results" + @usableFromInline static let resume: JSString = "resume" + @usableFromInline static let resumeTransformFeedback: JSString = "resumeTransformFeedback" + @usableFromInline static let retransmissionsReceived: JSString = "retransmissionsReceived" + @usableFromInline static let retransmissionsSent: JSString = "retransmissionsSent" + @usableFromInline static let retransmittedBytesSent: JSString = "retransmittedBytesSent" + @usableFromInline static let retransmittedPacketsSent: JSString = "retransmittedPacketsSent" + @usableFromInline static let retry: JSString = "retry" + @usableFromInline static let returnSequence: JSString = "returnSequence" + @usableFromInline static let returnValue: JSString = "returnValue" + @usableFromInline static let rev: JSString = "rev" + @usableFromInline static let reverse: JSString = "reverse" + @usableFromInline static let reversed: JSString = "reversed" + @usableFromInline static let revoke: JSString = "revoke" + @usableFromInline static let revokeObjectURL: JSString = "revokeObjectURL" + @usableFromInline static let rid: JSString = "rid" + @usableFromInline static let right: JSString = "right" + @usableFromInline static let ringIndicator: JSString = "ringIndicator" + @usableFromInline static let rk: JSString = "rk" + @usableFromInline static let rlh: JSString = "rlh" + @usableFromInline static let robustness: JSString = "robustness" + @usableFromInline static let role: JSString = "role" + @usableFromInline static let rollback: JSString = "rollback" + @usableFromInline static let rolloffFactor: JSString = "rolloffFactor" + @usableFromInline static let root: JSString = "root" + @usableFromInline static let rootBounds: JSString = "rootBounds" + @usableFromInline static let rootElement: JSString = "rootElement" + @usableFromInline static let rootMargin: JSString = "rootMargin" + @usableFromInline static let rotate: JSString = "rotate" + @usableFromInline static let rotateAxisAngle: JSString = "rotateAxisAngle" + @usableFromInline static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" + @usableFromInline static let rotateFromVector: JSString = "rotateFromVector" + @usableFromInline static let rotateFromVectorSelf: JSString = "rotateFromVectorSelf" + @usableFromInline static let rotateSelf: JSString = "rotateSelf" + @usableFromInline static let rotationAngle: JSString = "rotationAngle" + @usableFromInline static let rotationRate: JSString = "rotationRate" + @usableFromInline static let roundRect: JSString = "roundRect" + @usableFromInline static let roundTripTime: JSString = "roundTripTime" + @usableFromInline static let roundTripTimeMeasurements: JSString = "roundTripTimeMeasurements" + @usableFromInline static let roundingType: JSString = "roundingType" + @usableFromInline static let rowIndex: JSString = "rowIndex" + @usableFromInline static let rowSpan: JSString = "rowSpan" + @usableFromInline static let rows: JSString = "rows" + @usableFromInline static let rowsPerImage: JSString = "rowsPerImage" + @usableFromInline static let rp: JSString = "rp" + @usableFromInline static let rpId: JSString = "rpId" + @usableFromInline static let rssi: JSString = "rssi" + @usableFromInline static let rtcIdentityProvider: JSString = "rtcIdentityProvider" + @usableFromInline static let rtcp: JSString = "rtcp" + @usableFromInline static let rtcpMuxPolicy: JSString = "rtcpMuxPolicy" + @usableFromInline static let rtcpTransportStatsId: JSString = "rtcpTransportStatsId" + @usableFromInline static let rtpTimestamp: JSString = "rtpTimestamp" + @usableFromInline static let rtt: JSString = "rtt" + @usableFromInline static let rttVariation: JSString = "rttVariation" + @usableFromInline static let rtxSsrc: JSString = "rtxSsrc" + @usableFromInline static let rules: JSString = "rules" + @usableFromInline static let rx: JSString = "rx" + @usableFromInline static let ry: JSString = "ry" + @usableFromInline static let s: JSString = "s" + @usableFromInline static let sRGBHex: JSString = "sRGBHex" + @usableFromInline static let salt: JSString = "salt" + @usableFromInline static let saltLength: JSString = "saltLength" + @usableFromInline static let sameDocument: JSString = "sameDocument" + @usableFromInline static let sameSite: JSString = "sameSite" + @usableFromInline static let sample: JSString = "sample" + @usableFromInline static let sampleCount: JSString = "sampleCount" + @usableFromInline static let sampleCoverage: JSString = "sampleCoverage" + @usableFromInline static let sampleInterval: JSString = "sampleInterval" + @usableFromInline static let sampleRate: JSString = "sampleRate" + @usableFromInline static let sampleSize: JSString = "sampleSize" + @usableFromInline static let sampleType: JSString = "sampleType" + @usableFromInline static let sampler: JSString = "sampler" + @usableFromInline static let samplerParameterf: JSString = "samplerParameterf" + @usableFromInline static let samplerParameteri: JSString = "samplerParameteri" + @usableFromInline static let samplerate: JSString = "samplerate" + @usableFromInline static let samples: JSString = "samples" + @usableFromInline static let samplesDecodedWithCelt: JSString = "samplesDecodedWithCelt" + @usableFromInline static let samplesDecodedWithSilk: JSString = "samplesDecodedWithSilk" + @usableFromInline static let samplesEncodedWithCelt: JSString = "samplesEncodedWithCelt" + @usableFromInline static let samplesEncodedWithSilk: JSString = "samplesEncodedWithSilk" + @usableFromInline static let sandbox: JSString = "sandbox" + @usableFromInline static let sanitize: JSString = "sanitize" + @usableFromInline static let sanitizeFor: JSString = "sanitizeFor" + @usableFromInline static let sanitizer: JSString = "sanitizer" + @usableFromInline static let saturation: JSString = "saturation" + @usableFromInline static let save: JSString = "save" + @usableFromInline static let saveData: JSString = "saveData" + @usableFromInline static let scalabilityMode: JSString = "scalabilityMode" + @usableFromInline static let scalabilityModes: JSString = "scalabilityModes" + @usableFromInline static let scale: JSString = "scale" + @usableFromInline static let scale3d: JSString = "scale3d" + @usableFromInline static let scale3dSelf: JSString = "scale3dSelf" + @usableFromInline static let scaleFactor: JSString = "scaleFactor" + @usableFromInline static let scaleNonUniform: JSString = "scaleNonUniform" + @usableFromInline static let scaleResolutionDownBy: JSString = "scaleResolutionDownBy" + @usableFromInline static let scaleSelf: JSString = "scaleSelf" + @usableFromInline static let scales: JSString = "scales" + @usableFromInline static let scan: JSString = "scan" + @usableFromInline static let scheduler: JSString = "scheduler" + @usableFromInline static let scheduling: JSString = "scheduling" + @usableFromInline static let scheme: JSString = "scheme" + @usableFromInline static let scissor: JSString = "scissor" + @usableFromInline static let scope: JSString = "scope" + @usableFromInline static let screen: JSString = "screen" + @usableFromInline static let screenLeft: JSString = "screenLeft" + @usableFromInline static let screenState: JSString = "screenState" + @usableFromInline static let screenTop: JSString = "screenTop" + @usableFromInline static let screenX: JSString = "screenX" + @usableFromInline static let screenY: JSString = "screenY" + @usableFromInline static let scriptURL: JSString = "scriptURL" + @usableFromInline static let scripts: JSString = "scripts" + @usableFromInline static let scroll: JSString = "scroll" + @usableFromInline static let scrollAmount: JSString = "scrollAmount" + @usableFromInline static let scrollBy: JSString = "scrollBy" + @usableFromInline static let scrollDelay: JSString = "scrollDelay" + @usableFromInline static let scrollHeight: JSString = "scrollHeight" + @usableFromInline static let scrollIntoView: JSString = "scrollIntoView" + @usableFromInline static let scrollLeft: JSString = "scrollLeft" + @usableFromInline static let scrollOffsets: JSString = "scrollOffsets" + @usableFromInline static let scrollPathIntoView: JSString = "scrollPathIntoView" + @usableFromInline static let scrollRestoration: JSString = "scrollRestoration" + @usableFromInline static let scrollTo: JSString = "scrollTo" + @usableFromInline static let scrollTop: JSString = "scrollTop" + @usableFromInline static let scrollWidth: JSString = "scrollWidth" + @usableFromInline static let scrollX: JSString = "scrollX" + @usableFromInline static let scrollY: JSString = "scrollY" + @usableFromInline static let scrollbars: JSString = "scrollbars" + @usableFromInline static let scrolling: JSString = "scrolling" + @usableFromInline static let scrollingElement: JSString = "scrollingElement" + @usableFromInline static let sctp: JSString = "sctp" + @usableFromInline static let sctpCauseCode: JSString = "sctpCauseCode" + @usableFromInline static let sdp: JSString = "sdp" + @usableFromInline static let sdpFmtpLine: JSString = "sdpFmtpLine" + @usableFromInline static let sdpLineNumber: JSString = "sdpLineNumber" + @usableFromInline static let sdpMLineIndex: JSString = "sdpMLineIndex" + @usableFromInline static let sdpMid: JSString = "sdpMid" + @usableFromInline static let search: JSString = "search" + @usableFromInline static let searchParams: JSString = "searchParams" + @usableFromInline static let sectionRowIndex: JSString = "sectionRowIndex" + @usableFromInline static let secure: JSString = "secure" + @usableFromInline static let secureConnectionStart: JSString = "secureConnectionStart" + @usableFromInline static let seed: JSString = "seed" + @usableFromInline static let seek: JSString = "seek" + @usableFromInline static let seekOffset: JSString = "seekOffset" + @usableFromInline static let seekTime: JSString = "seekTime" + @usableFromInline static let seekable: JSString = "seekable" + @usableFromInline static let seeking: JSString = "seeking" + @usableFromInline static let segments: JSString = "segments" + @usableFromInline static let select: JSString = "select" + @usableFromInline static let selectAllChildren: JSString = "selectAllChildren" + @usableFromInline static let selectAlternateInterface: JSString = "selectAlternateInterface" + @usableFromInline static let selectAudioOutput: JSString = "selectAudioOutput" + @usableFromInline static let selectConfiguration: JSString = "selectConfiguration" + @usableFromInline static let selectNode: JSString = "selectNode" + @usableFromInline static let selectNodeContents: JSString = "selectNodeContents" + @usableFromInline static let selectSubString: JSString = "selectSubString" + @usableFromInline static let selected: JSString = "selected" + @usableFromInline static let selectedCandidatePairChanges: JSString = "selectedCandidatePairChanges" + @usableFromInline static let selectedCandidatePairId: JSString = "selectedCandidatePairId" + @usableFromInline static let selectedIndex: JSString = "selectedIndex" + @usableFromInline static let selectedOptions: JSString = "selectedOptions" + @usableFromInline static let selectedTrack: JSString = "selectedTrack" + @usableFromInline static let selectionBound: JSString = "selectionBound" + @usableFromInline static let selectionDirection: JSString = "selectionDirection" + @usableFromInline static let selectionEnd: JSString = "selectionEnd" + @usableFromInline static let selectionStart: JSString = "selectionStart" + @usableFromInline static let selectorText: JSString = "selectorText" + @usableFromInline static let send: JSString = "send" + @usableFromInline static let sendBeacon: JSString = "sendBeacon" + @usableFromInline static let sendEncodings: JSString = "sendEncodings" + @usableFromInline static let sendFeatureReport: JSString = "sendFeatureReport" + @usableFromInline static let sendKeyFrameRequest: JSString = "sendKeyFrameRequest" + @usableFromInline static let sendReport: JSString = "sendReport" + @usableFromInline static let sender: JSString = "sender" + @usableFromInline static let senderId: JSString = "senderId" + @usableFromInline static let sentAlert: JSString = "sentAlert" + @usableFromInline static let serial: JSString = "serial" + @usableFromInline static let serialNumber: JSString = "serialNumber" + @usableFromInline static let serializeToString: JSString = "serializeToString" + @usableFromInline static let serverCertificateHashes: JSString = "serverCertificateHashes" + @usableFromInline static let serverTiming: JSString = "serverTiming" + @usableFromInline static let service: JSString = "service" + @usableFromInline static let serviceData: JSString = "serviceData" + @usableFromInline static let serviceWorker: JSString = "serviceWorker" + @usableFromInline static let services: JSString = "services" + @usableFromInline static let session: JSString = "session" + @usableFromInline static let sessionId: JSString = "sessionId" + @usableFromInline static let sessionStorage: JSString = "sessionStorage" + @usableFromInline static let sessionTypes: JSString = "sessionTypes" + @usableFromInline static let set: JSString = "set" + @usableFromInline static let setAppBadge: JSString = "setAppBadge" + @usableFromInline static let setAttribute: JSString = "setAttribute" + @usableFromInline static let setAttributeNS: JSString = "setAttributeNS" + @usableFromInline static let setAttributeNode: JSString = "setAttributeNode" + @usableFromInline static let setAttributeNodeNS: JSString = "setAttributeNodeNS" + @usableFromInline static let setBaseAndExtent: JSString = "setBaseAndExtent" + @usableFromInline static let setBindGroup: JSString = "setBindGroup" + @usableFromInline static let setBlendConstant: JSString = "setBlendConstant" + @usableFromInline static let setCameraActive: JSString = "setCameraActive" + @usableFromInline static let setClientBadge: JSString = "setClientBadge" + @usableFromInline static let setCodecPreferences: JSString = "setCodecPreferences" + @usableFromInline static let setConfiguration: JSString = "setConfiguration" + @usableFromInline static let setCurrentTime: JSString = "setCurrentTime" + @usableFromInline static let setCustomValidity: JSString = "setCustomValidity" + @usableFromInline static let setData: JSString = "setData" + @usableFromInline static let setDragImage: JSString = "setDragImage" + @usableFromInline static let setEncryptionKey: JSString = "setEncryptionKey" + @usableFromInline static let setEnd: JSString = "setEnd" + @usableFromInline static let setEndAfter: JSString = "setEndAfter" + @usableFromInline static let setEndBefore: JSString = "setEndBefore" + @usableFromInline static let setFormValue: JSString = "setFormValue" + @usableFromInline static let setHTML: JSString = "setHTML" + @usableFromInline static let setHeaderValue: JSString = "setHeaderValue" + @usableFromInline static let setIdentityProvider: JSString = "setIdentityProvider" + @usableFromInline static let setIndexBuffer: JSString = "setIndexBuffer" + @usableFromInline static let setInterval: JSString = "setInterval" + @usableFromInline static let setKeyframes: JSString = "setKeyframes" + @usableFromInline static let setLineDash: JSString = "setLineDash" + @usableFromInline static let setLiveSeekableRange: JSString = "setLiveSeekableRange" + @usableFromInline static let setMatrix: JSString = "setMatrix" + @usableFromInline static let setMatrixValue: JSString = "setMatrixValue" + @usableFromInline static let setMediaKeys: JSString = "setMediaKeys" + @usableFromInline static let setMicrophoneActive: JSString = "setMicrophoneActive" + @usableFromInline static let setNamedItem: JSString = "setNamedItem" + @usableFromInline static let setNamedItemNS: JSString = "setNamedItemNS" + @usableFromInline static let setOrientToAngle: JSString = "setOrientToAngle" + @usableFromInline static let setOrientToAuto: JSString = "setOrientToAuto" + @usableFromInline static let setOrientation: JSString = "setOrientation" + @usableFromInline static let setParameter: JSString = "setParameter" + @usableFromInline static let setParameters: JSString = "setParameters" + @usableFromInline static let setPeriodicWave: JSString = "setPeriodicWave" + @usableFromInline static let setPipeline: JSString = "setPipeline" + @usableFromInline static let setPointerCapture: JSString = "setPointerCapture" + @usableFromInline static let setPosition: JSString = "setPosition" + @usableFromInline static let setPositionState: JSString = "setPositionState" + @usableFromInline static let setPriority: JSString = "setPriority" + @usableFromInline static let setProperty: JSString = "setProperty" + @usableFromInline static let setRangeText: JSString = "setRangeText" + @usableFromInline static let setRequestHeader: JSString = "setRequestHeader" + @usableFromInline static let setResourceTimingBufferSize: JSString = "setResourceTimingBufferSize" + @usableFromInline static let setRotate: JSString = "setRotate" + @usableFromInline static let setScale: JSString = "setScale" + @usableFromInline static let setScissorRect: JSString = "setScissorRect" + @usableFromInline static let setSelectionRange: JSString = "setSelectionRange" + @usableFromInline static let setServerCertificate: JSString = "setServerCertificate" + @usableFromInline static let setSignals: JSString = "setSignals" + @usableFromInline static let setSinkId: JSString = "setSinkId" + @usableFromInline static let setSkewX: JSString = "setSkewX" + @usableFromInline static let setSkewY: JSString = "setSkewY" + @usableFromInline static let setStart: JSString = "setStart" + @usableFromInline static let setStartAfter: JSString = "setStartAfter" + @usableFromInline static let setStartBefore: JSString = "setStartBefore" + @usableFromInline static let setStdDeviation: JSString = "setStdDeviation" + @usableFromInline static let setStencilReference: JSString = "setStencilReference" + @usableFromInline static let setStreams: JSString = "setStreams" + @usableFromInline static let setTargetAtTime: JSString = "setTargetAtTime" + @usableFromInline static let setTimeout: JSString = "setTimeout" + @usableFromInline static let setTransform: JSString = "setTransform" + @usableFromInline static let setTranslate: JSString = "setTranslate" + @usableFromInline static let setValidity: JSString = "setValidity" + @usableFromInline static let setValueAtTime: JSString = "setValueAtTime" + @usableFromInline static let setValueCurveAtTime: JSString = "setValueCurveAtTime" + @usableFromInline static let setVertexBuffer: JSString = "setVertexBuffer" + @usableFromInline static let setViewport: JSString = "setViewport" + @usableFromInline static let shaderLocation: JSString = "shaderLocation" + @usableFromInline static let shaderSource: JSString = "shaderSource" + @usableFromInline static let shadowBlur: JSString = "shadowBlur" + @usableFromInline static let shadowColor: JSString = "shadowColor" + @usableFromInline static let shadowOffsetX: JSString = "shadowOffsetX" + @usableFromInline static let shadowOffsetY: JSString = "shadowOffsetY" + @usableFromInline static let shadowRoot: JSString = "shadowRoot" + @usableFromInline static let shape: JSString = "shape" + @usableFromInline static let share: JSString = "share" + @usableFromInline static let sharpness: JSString = "sharpness" + @usableFromInline static let sheet: JSString = "sheet" + @usableFromInline static let shiftKey: JSString = "shiftKey" + @usableFromInline static let show: JSString = "show" + @usableFromInline static let showDirectoryPicker: JSString = "showDirectoryPicker" + @usableFromInline static let showModal: JSString = "showModal" + @usableFromInline static let showNotification: JSString = "showNotification" + @usableFromInline static let showOpenFilePicker: JSString = "showOpenFilePicker" + @usableFromInline static let showPicker: JSString = "showPicker" + @usableFromInline static let showSaveFilePicker: JSString = "showSaveFilePicker" + @usableFromInline static let sigmoid: JSString = "sigmoid" + @usableFromInline static let sign: JSString = "sign" + @usableFromInline static let signal: JSString = "signal" + @usableFromInline static let signalingState: JSString = "signalingState" + @usableFromInline static let signature: JSString = "signature" + @usableFromInline static let silent: JSString = "silent" + @usableFromInline static let silentConcealedSamples: JSString = "silentConcealedSamples" + @usableFromInline static let sin: JSString = "sin" + @usableFromInline static let singleNodeValue: JSString = "singleNodeValue" + @usableFromInline static let sinkId: JSString = "sinkId" + @usableFromInline static let size: JSString = "size" + @usableFromInline static let sizes: JSString = "sizes" + @usableFromInline static let sizing: JSString = "sizing" + @usableFromInline static let skewX: JSString = "skewX" + @usableFromInline static let skewXSelf: JSString = "skewXSelf" + @usableFromInline static let skewY: JSString = "skewY" + @usableFromInline static let skewYSelf: JSString = "skewYSelf" + @usableFromInline static let skipWaiting: JSString = "skipWaiting" + @usableFromInline static let sliCount: JSString = "sliCount" + @usableFromInline static let slice: JSString = "slice" + @usableFromInline static let slope: JSString = "slope" + @usableFromInline static let slot: JSString = "slot" + @usableFromInline static let slotAssignment: JSString = "slotAssignment" + @usableFromInline static let smooth: JSString = "smooth" + @usableFromInline static let smoothedRoundTripTime: JSString = "smoothedRoundTripTime" + @usableFromInline static let smoothedRtt: JSString = "smoothedRtt" + @usableFromInline static let smoothingTimeConstant: JSString = "smoothingTimeConstant" + @usableFromInline static let snapToLines: JSString = "snapToLines" + @usableFromInline static let snapshotItem: JSString = "snapshotItem" + @usableFromInline static let snapshotLength: JSString = "snapshotLength" + @usableFromInline static let softmax: JSString = "softmax" + @usableFromInline static let softplus: JSString = "softplus" + @usableFromInline static let softsign: JSString = "softsign" + @usableFromInline static let software: JSString = "software" + @usableFromInline static let sort: JSString = "sort" + @usableFromInline static let sortingCode: JSString = "sortingCode" + @usableFromInline static let source: JSString = "source" + @usableFromInline static let sourceAnimation: JSString = "sourceAnimation" + @usableFromInline static let sourceBuffer: JSString = "sourceBuffer" + @usableFromInline static let sourceBuffers: JSString = "sourceBuffers" + @usableFromInline static let sourceCapabilities: JSString = "sourceCapabilities" + @usableFromInline static let sourceFile: JSString = "sourceFile" + @usableFromInline static let sourceMap: JSString = "sourceMap" + @usableFromInline static let sources: JSString = "sources" + @usableFromInline static let space: JSString = "space" + @usableFromInline static let spacing: JSString = "spacing" + @usableFromInline static let span: JSString = "span" + @usableFromInline static let spatialIndex: JSString = "spatialIndex" + @usableFromInline static let spatialNavigationSearch: JSString = "spatialNavigationSearch" + @usableFromInline static let spatialRendering: JSString = "spatialRendering" + @usableFromInline static let speak: JSString = "speak" + @usableFromInline static let speakAs: JSString = "speakAs" + @usableFromInline static let speaking: JSString = "speaking" + @usableFromInline static let specified: JSString = "specified" + @usableFromInline static let specularConstant: JSString = "specularConstant" + @usableFromInline static let specularExponent: JSString = "specularExponent" + @usableFromInline static let speechSynthesis: JSString = "speechSynthesis" + @usableFromInline static let speed: JSString = "speed" + @usableFromInline static let spellcheck: JSString = "spellcheck" + @usableFromInline static let sphericalHarmonicsCoefficients: JSString = "sphericalHarmonicsCoefficients" + @usableFromInline static let split: JSString = "split" + @usableFromInline static let splitText: JSString = "splitText" + @usableFromInline static let spreadMethod: JSString = "spreadMethod" + @usableFromInline static let squeeze: JSString = "squeeze" + @usableFromInline static let src: JSString = "src" + @usableFromInline static let srcElement: JSString = "srcElement" + @usableFromInline static let srcFactor: JSString = "srcFactor" + @usableFromInline static let srcObject: JSString = "srcObject" + @usableFromInline static let srcdoc: JSString = "srcdoc" + @usableFromInline static let srclang: JSString = "srclang" + @usableFromInline static let srcset: JSString = "srcset" + @usableFromInline static let srtpCipher: JSString = "srtpCipher" + @usableFromInline static let ssrc: JSString = "ssrc" + @usableFromInline static let stackId: JSString = "stackId" + @usableFromInline static let stacks: JSString = "stacks" + @usableFromInline static let standby: JSString = "standby" + @usableFromInline static let start: JSString = "start" + @usableFromInline static let startContainer: JSString = "startContainer" + @usableFromInline static let startIn: JSString = "startIn" + @usableFromInline static let startMessages: JSString = "startMessages" + @usableFromInline static let startNotifications: JSString = "startNotifications" + @usableFromInline static let startOffset: JSString = "startOffset" + @usableFromInline static let startRendering: JSString = "startRendering" + @usableFromInline static let startTime: JSString = "startTime" + @usableFromInline static let state: JSString = "state" + @usableFromInline static let states: JSString = "states" + @usableFromInline static let status: JSString = "status" + @usableFromInline static let statusCode: JSString = "statusCode" + @usableFromInline static let statusMessage: JSString = "statusMessage" + @usableFromInline static let statusText: JSString = "statusText" + @usableFromInline static let statusbar: JSString = "statusbar" + @usableFromInline static let stdDeviationX: JSString = "stdDeviationX" + @usableFromInline static let stdDeviationY: JSString = "stdDeviationY" + @usableFromInline static let steal: JSString = "steal" + @usableFromInline static let steepness: JSString = "steepness" + @usableFromInline static let stencil: JSString = "stencil" + @usableFromInline static let stencilBack: JSString = "stencilBack" + @usableFromInline static let stencilClearValue: JSString = "stencilClearValue" + @usableFromInline static let stencilFront: JSString = "stencilFront" + @usableFromInline static let stencilFunc: JSString = "stencilFunc" + @usableFromInline static let stencilFuncSeparate: JSString = "stencilFuncSeparate" + @usableFromInline static let stencilLoadOp: JSString = "stencilLoadOp" + @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 stencilReadMask: JSString = "stencilReadMask" + @usableFromInline static let stencilReadOnly: JSString = "stencilReadOnly" + @usableFromInline static let stencilStoreOp: JSString = "stencilStoreOp" + @usableFromInline static let stencilWriteMask: JSString = "stencilWriteMask" + @usableFromInline static let step: JSString = "step" + @usableFromInline static let stepDown: JSString = "stepDown" + @usableFromInline static let stepMismatch: JSString = "stepMismatch" + @usableFromInline static let stepMode: JSString = "stepMode" + @usableFromInline static let stepUp: JSString = "stepUp" + @usableFromInline static let stitchTiles: JSString = "stitchTiles" + @usableFromInline static let stop: JSString = "stop" + @usableFromInline static let stopBits: JSString = "stopBits" + @usableFromInline static let stopImmediatePropagation: JSString = "stopImmediatePropagation" + @usableFromInline static let stopNotifications: JSString = "stopNotifications" + @usableFromInline static let stopPropagation: JSString = "stopPropagation" + @usableFromInline static let stopped: JSString = "stopped" + @usableFromInline static let storage: JSString = "storage" + @usableFromInline static let storageArea: JSString = "storageArea" + @usableFromInline static let storageTexture: JSString = "storageTexture" + @usableFromInline static let store: JSString = "store" + @usableFromInline static let storeOp: JSString = "storeOp" + @usableFromInline static let stream: JSString = "stream" + @usableFromInline static let streamErrorCode: JSString = "streamErrorCode" + @usableFromInline static let streams: JSString = "streams" + @usableFromInline static let stretch: JSString = "stretch" + @usableFromInline static let stride: JSString = "stride" + @usableFromInline static let strides: JSString = "strides" + @usableFromInline static let stringValue: JSString = "stringValue" + @usableFromInline static let strings: JSString = "strings" + @usableFromInline static let stripIndexFormat: JSString = "stripIndexFormat" + @usableFromInline static let stroke: JSString = "stroke" + @usableFromInline static let strokeRect: JSString = "strokeRect" + @usableFromInline static let strokeStyle: JSString = "strokeStyle" + @usableFromInline static let strokeText: JSString = "strokeText" + @usableFromInline static let structuredClone: JSString = "structuredClone" + @usableFromInline static let style: JSString = "style" + @usableFromInline static let styleMap: JSString = "styleMap" + @usableFromInline static let styleSheet: JSString = "styleSheet" + @usableFromInline static let styleSheets: JSString = "styleSheets" + @usableFromInline static let styleset: JSString = "styleset" + @usableFromInline static let stylistic: JSString = "stylistic" + @usableFromInline static let sub: JSString = "sub" + @usableFromInline static let subclassCode: JSString = "subclassCode" + @usableFromInline static let submit: JSString = "submit" + @usableFromInline static let submitter: JSString = "submitter" + @usableFromInline static let subscribe: JSString = "subscribe" + @usableFromInline static let subscriptionPeriod: JSString = "subscriptionPeriod" + @usableFromInline static let substringData: JSString = "substringData" + @usableFromInline static let subtle: JSString = "subtle" + @usableFromInline static let subtree: JSString = "subtree" + @usableFromInline static let suffix: JSString = "suffix" + @usableFromInline static let suffixes: JSString = "suffixes" + @usableFromInline static let suggestedName: JSString = "suggestedName" + @usableFromInline static let summary: JSString = "summary" + @usableFromInline static let support: JSString = "support" + @usableFromInline static let supported: JSString = "supported" + @usableFromInline static let supportedContentEncodings: JSString = "supportedContentEncodings" + @usableFromInline static let supportedEntryTypes: JSString = "supportedEntryTypes" + @usableFromInline static let supportedFrameRates: JSString = "supportedFrameRates" + @usableFromInline static let supportedMethods: JSString = "supportedMethods" + @usableFromInline static let supportedSources: JSString = "supportedSources" + @usableFromInline static let supports: JSString = "supports" + @usableFromInline static let suppressLocalAudioPlayback: JSString = "suppressLocalAudioPlayback" + @usableFromInline static let surfaceDimensions: JSString = "surfaceDimensions" + @usableFromInline static let surfaceId: JSString = "surfaceId" + @usableFromInline static let surfaceScale: JSString = "surfaceScale" + @usableFromInline static let surroundContents: JSString = "surroundContents" + @usableFromInline static let suspend: JSString = "suspend" + @usableFromInline static let suspendRedraw: JSString = "suspendRedraw" + @usableFromInline static let svb: JSString = "svb" + @usableFromInline static let svc: JSString = "svc" + @usableFromInline static let svh: JSString = "svh" + @usableFromInline static let svi: JSString = "svi" + @usableFromInline static let svmax: JSString = "svmax" + @usableFromInline static let svmin: JSString = "svmin" + @usableFromInline static let svw: JSString = "svw" + @usableFromInline static let swash: JSString = "swash" + @usableFromInline static let symbols: JSString = "symbols" + @usableFromInline static let sync: JSString = "sync" + @usableFromInline static let synchronizationSource: JSString = "synchronizationSource" + @usableFromInline static let syntax: JSString = "syntax" + @usableFromInline static let sysex: JSString = "sysex" + @usableFromInline static let sysexEnabled: JSString = "sysexEnabled" + @usableFromInline static let system: JSString = "system" + @usableFromInline static let systemId: JSString = "systemId" + @usableFromInline static let systemLanguage: JSString = "systemLanguage" + @usableFromInline static let t: JSString = "t" + @usableFromInline static let tBodies: JSString = "tBodies" + @usableFromInline static let tFoot: JSString = "tFoot" + @usableFromInline static let tHead: JSString = "tHead" + @usableFromInline static let tabIndex: JSString = "tabIndex" + @usableFromInline static let table: JSString = "table" + @usableFromInline static let tableValues: JSString = "tableValues" + @usableFromInline static let tag: JSString = "tag" + @usableFromInline static let tagLength: JSString = "tagLength" + @usableFromInline static let tagName: JSString = "tagName" + @usableFromInline static let taintEnabled: JSString = "taintEnabled" + @usableFromInline static let takePhoto: JSString = "takePhoto" + @usableFromInline static let takeRecords: JSString = "takeRecords" + @usableFromInline static let tan: JSString = "tan" + @usableFromInline static let tangentialPressure: JSString = "tangentialPressure" + @usableFromInline static let tanh: JSString = "tanh" + @usableFromInline static let target: JSString = "target" + @usableFromInline static let targetBitrate: JSString = "targetBitrate" + @usableFromInline static let targetElement: JSString = "targetElement" + @usableFromInline static let targetOrigin: JSString = "targetOrigin" + @usableFromInline static let targetRanges: JSString = "targetRanges" + @usableFromInline static let targetRayMode: JSString = "targetRayMode" + @usableFromInline static let targetRaySpace: JSString = "targetRaySpace" + @usableFromInline static let targetTouches: JSString = "targetTouches" + @usableFromInline static let targetX: JSString = "targetX" + @usableFromInline static let targetY: JSString = "targetY" + @usableFromInline static let targets: JSString = "targets" + @usableFromInline static let tcpType: JSString = "tcpType" + @usableFromInline static let tee: JSString = "tee" + @usableFromInline static let tel: JSString = "tel" + @usableFromInline static let temporalIndex: JSString = "temporalIndex" + @usableFromInline static let temporalLayerId: JSString = "temporalLayerId" + @usableFromInline static let terminate: JSString = "terminate" + @usableFromInline static let test: JSString = "test" + @usableFromInline static let texImage2D: JSString = "texImage2D" + @usableFromInline static let texImage3D: JSString = "texImage3D" + @usableFromInline static let texParameterf: JSString = "texParameterf" + @usableFromInline static let texParameteri: JSString = "texParameteri" + @usableFromInline static let texStorage2D: JSString = "texStorage2D" + @usableFromInline static let texStorage3D: JSString = "texStorage3D" + @usableFromInline static let texSubImage2D: JSString = "texSubImage2D" + @usableFromInline static let texSubImage3D: JSString = "texSubImage3D" + @usableFromInline static let text: JSString = "text" + @usableFromInline static let textAlign: JSString = "textAlign" + @usableFromInline static let textBaseline: JSString = "textBaseline" + @usableFromInline static let textColor: JSString = "textColor" + @usableFromInline static let textContent: JSString = "textContent" + @usableFromInline static let textFormats: JSString = "textFormats" + @usableFromInline static let textLength: JSString = "textLength" + @usableFromInline static let textRendering: JSString = "textRendering" + @usableFromInline static let textTracks: JSString = "textTracks" + @usableFromInline static let texture: JSString = "texture" + @usableFromInline static let textureArrayLength: JSString = "textureArrayLength" + @usableFromInline static let textureHeight: JSString = "textureHeight" + @usableFromInline static let textureType: JSString = "textureType" + @usableFromInline static let textureWidth: JSString = "textureWidth" + @usableFromInline static let threshold: JSString = "threshold" + @usableFromInline static let thresholds: JSString = "thresholds" + @usableFromInline static let throwIfAborted: JSString = "throwIfAborted" + @usableFromInline static let tilt: JSString = "tilt" + @usableFromInline static let tiltX: JSString = "tiltX" + @usableFromInline static let tiltY: JSString = "tiltY" + @usableFromInline static let time: JSString = "time" + @usableFromInline static let timeEnd: JSString = "timeEnd" + @usableFromInline static let timeLog: JSString = "timeLog" + @usableFromInline static let timeOrigin: JSString = "timeOrigin" + @usableFromInline static let timeRemaining: JSString = "timeRemaining" + @usableFromInline static let timeStamp: JSString = "timeStamp" + @usableFromInline static let timecode: JSString = "timecode" + @usableFromInline static let timeline: JSString = "timeline" + @usableFromInline static let timelineTime: JSString = "timelineTime" + @usableFromInline static let timeout: JSString = "timeout" + @usableFromInline static let timestamp: JSString = "timestamp" + @usableFromInline static let timestampOffset: JSString = "timestampOffset" + @usableFromInline static let timestampWrites: JSString = "timestampWrites" + @usableFromInline static let timing: JSString = "timing" + @usableFromInline static let title: JSString = "title" + @usableFromInline static let titlebarAreaRect: JSString = "titlebarAreaRect" + @usableFromInline static let tlsGroup: JSString = "tlsGroup" + @usableFromInline static let tlsVersion: JSString = "tlsVersion" + @usableFromInline static let to: JSString = "to" + @usableFromInline static let toBox: JSString = "toBox" + @usableFromInline static let toDataURL: JSString = "toDataURL" + @usableFromInline static let toFloat32Array: JSString = "toFloat32Array" + @usableFromInline static let toFloat64Array: JSString = "toFloat64Array" + @usableFromInline static let toJSON: JSString = "toJSON" + @usableFromInline static let toMatrix: JSString = "toMatrix" + @usableFromInline static let toRecords: JSString = "toRecords" + @usableFromInline static let toString: JSString = "toString" + @usableFromInline static let toSum: JSString = "toSum" + @usableFromInline static let toggle: JSString = "toggle" + @usableFromInline static let toggleAttribute: JSString = "toggleAttribute" + @usableFromInline static let tone: JSString = "tone" + @usableFromInline static let toneBuffer: JSString = "toneBuffer" + @usableFromInline static let tooLong: JSString = "tooLong" + @usableFromInline static let tooShort: JSString = "tooShort" + @usableFromInline static let toolbar: JSString = "toolbar" + @usableFromInline static let top: JSString = "top" + @usableFromInline static let topOrigin: JSString = "topOrigin" + @usableFromInline static let topology: JSString = "topology" + @usableFromInline static let torch: JSString = "torch" + @usableFromInline static let total: JSString = "total" + @usableFromInline static let totalAudioEnergy: JSString = "totalAudioEnergy" + @usableFromInline static let totalDecodeTime: JSString = "totalDecodeTime" + @usableFromInline static let totalEncodeTime: JSString = "totalEncodeTime" + @usableFromInline static let totalEncodedBytesTarget: JSString = "totalEncodedBytesTarget" + @usableFromInline static let totalInterFrameDelay: JSString = "totalInterFrameDelay" + @usableFromInline static let totalPacketSendDelay: JSString = "totalPacketSendDelay" + @usableFromInline static let totalProcessingDelay: JSString = "totalProcessingDelay" + @usableFromInline static let totalRequestsSent: JSString = "totalRequestsSent" + @usableFromInline static let totalResponsesReceived: JSString = "totalResponsesReceived" + @usableFromInline static let totalRoundTripTime: JSString = "totalRoundTripTime" + @usableFromInline static let totalSamplesDecoded: JSString = "totalSamplesDecoded" + @usableFromInline static let totalSamplesDuration: JSString = "totalSamplesDuration" + @usableFromInline static let totalSamplesReceived: JSString = "totalSamplesReceived" + @usableFromInline static let totalSamplesSent: JSString = "totalSamplesSent" + @usableFromInline static let totalSquaredInterFrameDelay: JSString = "totalSquaredInterFrameDelay" + @usableFromInline static let totalVideoFrames: JSString = "totalVideoFrames" + @usableFromInline static let touchEvents: JSString = "touchEvents" + @usableFromInline static let touchId: JSString = "touchId" + @usableFromInline static let touchType: JSString = "touchType" + @usableFromInline static let touched: JSString = "touched" + @usableFromInline static let touches: JSString = "touches" + @usableFromInline static let trace: JSString = "trace" + @usableFromInline static let track: JSString = "track" + @usableFromInline static let trackIdentifier: JSString = "trackIdentifier" + @usableFromInline static let trackedAnchors: JSString = "trackedAnchors" + @usableFromInline static let tracks: JSString = "tracks" + @usableFromInline static let transaction: JSString = "transaction" + @usableFromInline static let transactionId: JSString = "transactionId" + @usableFromInline static let transceiver: JSString = "transceiver" + @usableFromInline static let transcript: JSString = "transcript" + @usableFromInline static let transfer: JSString = "transfer" + @usableFromInline static let transferControlToOffscreen: JSString = "transferControlToOffscreen" + @usableFromInline static let transferFromImageBitmap: JSString = "transferFromImageBitmap" + @usableFromInline static let transferFunction: JSString = "transferFunction" + @usableFromInline static let transferIn: JSString = "transferIn" + @usableFromInline static let transferOut: JSString = "transferOut" + @usableFromInline static let transferSize: JSString = "transferSize" + @usableFromInline static let transferToImageBitmap: JSString = "transferToImageBitmap" + @usableFromInline static let transform: JSString = "transform" + @usableFromInline static let transformFeedbackVaryings: JSString = "transformFeedbackVaryings" + @usableFromInline static let transformPoint: JSString = "transformPoint" + @usableFromInline static let transformToDocument: JSString = "transformToDocument" + @usableFromInline static let transformToFragment: JSString = "transformToFragment" + @usableFromInline static let transformer: JSString = "transformer" + @usableFromInline static let transition: JSString = "transition" + @usableFromInline static let transitionProperty: JSString = "transitionProperty" + @usableFromInline static let transitionWhile: JSString = "transitionWhile" + @usableFromInline static let translate: JSString = "translate" + @usableFromInline static let translateSelf: JSString = "translateSelf" + @usableFromInline static let transport: JSString = "transport" + @usableFromInline static let transportId: JSString = "transportId" + @usableFromInline static let transports: JSString = "transports" + @usableFromInline static let transpose: JSString = "transpose" + @usableFromInline static let traverseTo: JSString = "traverseTo" + @usableFromInline static let trueSpeed: JSString = "trueSpeed" + @usableFromInline static let truncate: JSString = "truncate" + @usableFromInline static let trustedTypes: JSString = "trustedTypes" + @usableFromInline static let turn: JSString = "turn" + @usableFromInline static let twist: JSString = "twist" + @usableFromInline static let txPower: JSString = "txPower" + @usableFromInline static let type: JSString = "type" + @usableFromInline static let typeMismatch: JSString = "typeMismatch" + @usableFromInline static let types: JSString = "types" + @usableFromInline static let uaFullVersion: JSString = "uaFullVersion" + @usableFromInline static let unackData: JSString = "unackData" + @usableFromInline static let unclippedDepth: JSString = "unclippedDepth" + @usableFromInline static let unconfigure: JSString = "unconfigure" + @usableFromInline static let underlineColor: JSString = "underlineColor" + @usableFromInline static let underlineStyle: JSString = "underlineStyle" + @usableFromInline static let underlineThickness: JSString = "underlineThickness" + @usableFromInline static let unicodeRange: JSString = "unicodeRange" + @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 uniform1ui: JSString = "uniform1ui" + @usableFromInline static let uniform1uiv: JSString = "uniform1uiv" + @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 uniform2ui: JSString = "uniform2ui" + @usableFromInline static let uniform2uiv: JSString = "uniform2uiv" + @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 uniform3ui: JSString = "uniform3ui" + @usableFromInline static let uniform3uiv: JSString = "uniform3uiv" + @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 uniform4ui: JSString = "uniform4ui" + @usableFromInline static let uniform4uiv: JSString = "uniform4uiv" + @usableFromInline static let uniformBlockBinding: JSString = "uniformBlockBinding" + @usableFromInline static let uniformMatrix2fv: JSString = "uniformMatrix2fv" + @usableFromInline static let uniformMatrix2x3fv: JSString = "uniformMatrix2x3fv" + @usableFromInline static let uniformMatrix2x4fv: JSString = "uniformMatrix2x4fv" + @usableFromInline static let uniformMatrix3fv: JSString = "uniformMatrix3fv" + @usableFromInline static let uniformMatrix3x2fv: JSString = "uniformMatrix3x2fv" + @usableFromInline static let uniformMatrix3x4fv: JSString = "uniformMatrix3x4fv" + @usableFromInline static let uniformMatrix4fv: JSString = "uniformMatrix4fv" + @usableFromInline static let uniformMatrix4x2fv: JSString = "uniformMatrix4x2fv" + @usableFromInline static let uniformMatrix4x3fv: JSString = "uniformMatrix4x3fv" + @usableFromInline static let unique: JSString = "unique" + @usableFromInline static let unit: JSString = "unit" + @usableFromInline static let unitExponent: JSString = "unitExponent" + @usableFromInline static let unitFactorCurrentExponent: JSString = "unitFactorCurrentExponent" + @usableFromInline static let unitFactorLengthExponent: JSString = "unitFactorLengthExponent" + @usableFromInline static let unitFactorLuminousIntensityExponent: JSString = "unitFactorLuminousIntensityExponent" + @usableFromInline static let unitFactorMassExponent: JSString = "unitFactorMassExponent" + @usableFromInline static let unitFactorTemperatureExponent: JSString = "unitFactorTemperatureExponent" + @usableFromInline static let unitFactorTimeExponent: JSString = "unitFactorTimeExponent" + @usableFromInline static let unitSystem: JSString = "unitSystem" + @usableFromInline static let unitType: JSString = "unitType" + @usableFromInline static let unloadEventEnd: JSString = "unloadEventEnd" + @usableFromInline static let unloadEventStart: JSString = "unloadEventStart" + @usableFromInline static let unlock: JSString = "unlock" + @usableFromInline static let unmap: JSString = "unmap" + @usableFromInline static let unobserve: JSString = "unobserve" + @usableFromInline static let unpauseAnimations: JSString = "unpauseAnimations" + @usableFromInline static let unregister: JSString = "unregister" + @usableFromInline static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" + @usableFromInline static let unsubscribe: JSString = "unsubscribe" + @usableFromInline static let unsuspendRedraw: JSString = "unsuspendRedraw" + @usableFromInline static let unsuspendRedrawAll: JSString = "unsuspendRedrawAll" + @usableFromInline static let unwrapKey: JSString = "unwrapKey" + @usableFromInline static let upX: JSString = "upX" + @usableFromInline static let upY: JSString = "upY" + @usableFromInline static let upZ: JSString = "upZ" + @usableFromInline static let update: JSString = "update" + @usableFromInline static let updateCharacterBounds: JSString = "updateCharacterBounds" + @usableFromInline static let updateControlBound: JSString = "updateControlBound" + @usableFromInline static let updateCurrentEntry: JSString = "updateCurrentEntry" + @usableFromInline static let updateInkTrailStartPoint: JSString = "updateInkTrailStartPoint" + @usableFromInline static let updatePlaybackRate: JSString = "updatePlaybackRate" + @usableFromInline static let updateRangeEnd: JSString = "updateRangeEnd" + @usableFromInline static let updateRangeStart: JSString = "updateRangeStart" + @usableFromInline static let updateRenderState: JSString = "updateRenderState" + @usableFromInline static let updateSelection: JSString = "updateSelection" + @usableFromInline static let updateSelectionBound: JSString = "updateSelectionBound" + @usableFromInline static let updateTargetFrameRate: JSString = "updateTargetFrameRate" + @usableFromInline static let updateText: JSString = "updateText" + @usableFromInline static let updateTiming: JSString = "updateTiming" + @usableFromInline static let updateUI: JSString = "updateUI" + @usableFromInline static let updateViaCache: JSString = "updateViaCache" + @usableFromInline static let updateWith: JSString = "updateWith" + @usableFromInline static let updating: JSString = "updating" + @usableFromInline static let upgrade: JSString = "upgrade" + @usableFromInline static let upload: JSString = "upload" + @usableFromInline static let uploadTotal: JSString = "uploadTotal" + @usableFromInline static let uploaded: JSString = "uploaded" + @usableFromInline static let upper: JSString = "upper" + @usableFromInline static let upperBound: JSString = "upperBound" + @usableFromInline static let upperOpen: JSString = "upperOpen" + @usableFromInline static let upperVerticalAngle: JSString = "upperVerticalAngle" + @usableFromInline static let uri: JSString = "uri" + @usableFromInline static let url: JSString = "url" + @usableFromInline static let urls: JSString = "urls" + @usableFromInline static let usableWithDarkBackground: JSString = "usableWithDarkBackground" + @usableFromInline static let usableWithLightBackground: JSString = "usableWithLightBackground" + @usableFromInline static let usage: JSString = "usage" + @usableFromInline static let usageMaximum: JSString = "usageMaximum" + @usableFromInline static let usageMinimum: JSString = "usageMinimum" + @usableFromInline static let usagePage: JSString = "usagePage" + @usableFromInline static let usagePreference: JSString = "usagePreference" + @usableFromInline static let usages: JSString = "usages" + @usableFromInline static let usb: JSString = "usb" + @usableFromInline static let usbProductId: JSString = "usbProductId" + @usableFromInline static let usbVendorId: JSString = "usbVendorId" + @usableFromInline static let usbVersionMajor: JSString = "usbVersionMajor" + @usableFromInline static let usbVersionMinor: JSString = "usbVersionMinor" + @usableFromInline static let usbVersionSubminor: JSString = "usbVersionSubminor" + @usableFromInline static let use: JSString = "use" + @usableFromInline static let useMap: JSString = "useMap" + @usableFromInline static let useProgram: JSString = "useProgram" + @usableFromInline static let user: JSString = "user" + @usableFromInline static let userAgent: JSString = "userAgent" + @usableFromInline static let userAgentData: JSString = "userAgentData" + @usableFromInline static let userChoice: JSString = "userChoice" + @usableFromInline static let userHandle: JSString = "userHandle" + @usableFromInline static let userHint: JSString = "userHint" + @usableFromInline static let userInitiated: JSString = "userInitiated" + @usableFromInline static let userState: JSString = "userState" + @usableFromInline static let userVerification: JSString = "userVerification" + @usableFromInline static let userVisibleOnly: JSString = "userVisibleOnly" + @usableFromInline static let username: JSString = "username" + @usableFromInline static let usernameFragment: JSString = "usernameFragment" + @usableFromInline static let usernameHint: JSString = "usernameHint" + @usableFromInline static let usesDepthValues: JSString = "usesDepthValues" + @usableFromInline static let utterance: JSString = "utterance" + @usableFromInline static let uuid: JSString = "uuid" + @usableFromInline static let uuids: JSString = "uuids" + @usableFromInline static let uvm: JSString = "uvm" + @usableFromInline static let vAlign: JSString = "vAlign" + @usableFromInline static let vLink: JSString = "vLink" + @usableFromInline static let valid: JSString = "valid" + @usableFromInline static let validate: JSString = "validate" + @usableFromInline static let validateAssertion: JSString = "validateAssertion" + @usableFromInline static let validateProgram: JSString = "validateProgram" + @usableFromInline static let validationMessage: JSString = "validationMessage" + @usableFromInline static let validity: JSString = "validity" + @usableFromInline static let value: JSString = "value" + @usableFromInline static let valueAsDate: JSString = "valueAsDate" + @usableFromInline static let valueAsNumber: JSString = "valueAsNumber" + @usableFromInline static let valueAsString: JSString = "valueAsString" + @usableFromInline static let valueInSpecifiedUnits: JSString = "valueInSpecifiedUnits" + @usableFromInline static let valueMissing: JSString = "valueMissing" + @usableFromInline static let valueOf: JSString = "valueOf" + @usableFromInline static let valueType: JSString = "valueType" + @usableFromInline static let values: JSString = "values" + @usableFromInline static let variable: JSString = "variable" + @usableFromInline static let variant: JSString = "variant" + @usableFromInline static let variationSettings: JSString = "variationSettings" + @usableFromInline static let variations: JSString = "variations" + @usableFromInline static let vb: JSString = "vb" + @usableFromInline static let vendor: JSString = "vendor" + @usableFromInline static let vendorId: JSString = "vendorId" + @usableFromInline static let vendorSub: JSString = "vendorSub" + @usableFromInline static let verify: JSString = "verify" + @usableFromInline static let version: JSString = "version" + @usableFromInline static let vertex: JSString = "vertex" + @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 vertexAttribDivisor: JSString = "vertexAttribDivisor" + @usableFromInline static let vertexAttribDivisorANGLE: JSString = "vertexAttribDivisorANGLE" + @usableFromInline static let vertexAttribI4i: JSString = "vertexAttribI4i" + @usableFromInline static let vertexAttribI4iv: JSString = "vertexAttribI4iv" + @usableFromInline static let vertexAttribI4ui: JSString = "vertexAttribI4ui" + @usableFromInline static let vertexAttribI4uiv: JSString = "vertexAttribI4uiv" + @usableFromInline static let vertexAttribIPointer: JSString = "vertexAttribIPointer" + @usableFromInline static let vertexAttribPointer: JSString = "vertexAttribPointer" + @usableFromInline static let vertical: JSString = "vertical" + @usableFromInline static let vh: JSString = "vh" + @usableFromInline static let vi: JSString = "vi" + @usableFromInline static let vibrate: JSString = "vibrate" + @usableFromInline static let video: JSString = "video" + @usableFromInline static let videoBitsPerSecond: JSString = "videoBitsPerSecond" + @usableFromInline static let videoCapabilities: JSString = "videoCapabilities" + @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 viewBox: JSString = "viewBox" + @usableFromInline static let viewDimension: JSString = "viewDimension" + @usableFromInline static let viewFormats: JSString = "viewFormats" + @usableFromInline static let viewPixelHeight: JSString = "viewPixelHeight" + @usableFromInline static let viewPixelWidth: JSString = "viewPixelWidth" + @usableFromInline static let viewport: JSString = "viewport" + @usableFromInline static let viewportAnchorX: JSString = "viewportAnchorX" + @usableFromInline static let viewportAnchorY: JSString = "viewportAnchorY" + @usableFromInline static let viewportElement: JSString = "viewportElement" + @usableFromInline static let views: JSString = "views" + @usableFromInline static let violatedDirective: JSString = "violatedDirective" + @usableFromInline static let violationSample: JSString = "violationSample" + @usableFromInline static let violationType: JSString = "violationType" + @usableFromInline static let violationURL: JSString = "violationURL" + @usableFromInline static let virtualKeyboard: JSString = "virtualKeyboard" + @usableFromInline static let virtualKeyboardPolicy: JSString = "virtualKeyboardPolicy" + @usableFromInline static let visibility: JSString = "visibility" + @usableFromInline static let visibilityState: JSString = "visibilityState" + @usableFromInline static let visible: JSString = "visible" + @usableFromInline static let visibleRect: JSString = "visibleRect" + @usableFromInline static let visualViewport: JSString = "visualViewport" + @usableFromInline static let vlinkColor: JSString = "vlinkColor" + @usableFromInline static let vmax: JSString = "vmax" + @usableFromInline static let vmin: JSString = "vmin" + @usableFromInline static let voice: JSString = "voice" + @usableFromInline static let voiceActivityFlag: JSString = "voiceActivityFlag" + @usableFromInline static let voiceURI: JSString = "voiceURI" + @usableFromInline static let volume: JSString = "volume" + @usableFromInline static let vspace: JSString = "vspace" + @usableFromInline static let vw: JSString = "vw" + @usableFromInline static let w: JSString = "w" + @usableFromInline static let waitSync: JSString = "waitSync" + @usableFromInline static let waitUntil: JSString = "waitUntil" + @usableFromInline static let waiting: JSString = "waiting" + @usableFromInline static let wakeLock: JSString = "wakeLock" + @usableFromInline static let warn: JSString = "warn" + @usableFromInline static let wasClean: JSString = "wasClean" + @usableFromInline static let wasDiscarded: JSString = "wasDiscarded" + @usableFromInline static let watchAdvertisements: JSString = "watchAdvertisements" + @usableFromInline static let watchingAdvertisements: JSString = "watchingAdvertisements" + @usableFromInline static let webdriver: JSString = "webdriver" + @usableFromInline static let webkitEntries: JSString = "webkitEntries" + @usableFromInline static let webkitGetAsEntry: JSString = "webkitGetAsEntry" + @usableFromInline static let webkitMatchesSelector: JSString = "webkitMatchesSelector" + @usableFromInline static let webkitRelativePath: JSString = "webkitRelativePath" + @usableFromInline static let webkitdirectory: JSString = "webkitdirectory" + @usableFromInline static let weight: JSString = "weight" + @usableFromInline static let whatToShow: JSString = "whatToShow" + @usableFromInline static let which: JSString = "which" + @usableFromInline static let whiteBalanceMode: JSString = "whiteBalanceMode" + @usableFromInline static let wholeText: JSString = "wholeText" + @usableFromInline static let width: JSString = "width" + @usableFromInline static let willReadFrequently: JSString = "willReadFrequently" + @usableFromInline static let willValidate: JSString = "willValidate" + @usableFromInline static let window: JSString = "window" + @usableFromInline static let windowControlsOverlay: JSString = "windowControlsOverlay" + @usableFromInline static let windowDimensions: JSString = "windowDimensions" + @usableFromInline static let withCredentials: JSString = "withCredentials" + @usableFromInline static let wordSpacing: JSString = "wordSpacing" + @usableFromInline static let workerStart: JSString = "workerStart" + @usableFromInline static let wow64: JSString = "wow64" + @usableFromInline static let wrap: JSString = "wrap" + @usableFromInline static let wrapKey: JSString = "wrapKey" + @usableFromInline static let writable: JSString = "writable" + @usableFromInline static let writableAuxiliaries: JSString = "writableAuxiliaries" + @usableFromInline static let writableType: JSString = "writableType" + @usableFromInline static let write: JSString = "write" + @usableFromInline static let writeBuffer: JSString = "writeBuffer" + @usableFromInline static let writeMask: JSString = "writeMask" + @usableFromInline static let writeText: JSString = "writeText" + @usableFromInline static let writeTexture: JSString = "writeTexture" + @usableFromInline static let writeTimestamp: JSString = "writeTimestamp" + @usableFromInline static let writeValue: JSString = "writeValue" + @usableFromInline static let writeValueWithResponse: JSString = "writeValueWithResponse" + @usableFromInline static let writeValueWithoutResponse: JSString = "writeValueWithoutResponse" + @usableFromInline static let writeWithoutResponse: JSString = "writeWithoutResponse" + @usableFromInline static let writeln: JSString = "writeln" + @usableFromInline static let written: JSString = "written" + @usableFromInline static let x: JSString = "x" + @usableFromInline static let x1: JSString = "x1" + @usableFromInline static let x2: JSString = "x2" + @usableFromInline static let xBias: JSString = "xBias" + @usableFromInline static let xChannelSelector: JSString = "xChannelSelector" + @usableFromInline static let xr: JSString = "xr" + @usableFromInline static let xrCompatible: JSString = "xrCompatible" + @usableFromInline static let y: JSString = "y" + @usableFromInline static let y1: JSString = "y1" + @usableFromInline static let y2: JSString = "y2" + @usableFromInline static let yBias: JSString = "yBias" + @usableFromInline static let yChannelSelector: JSString = "yChannelSelector" + @usableFromInline static let z: JSString = "z" + @usableFromInline static let zBias: JSString = "zBias" + @usableFromInline static let zoom: JSString = "zoom" } diff --git a/Sources/DOMKit/WebIDL/StylePropertyMap.swift b/Sources/DOMKit/WebIDL/StylePropertyMap.swift index bbda3a72..d0d108a3 100644 --- a/Sources/DOMKit/WebIDL/StylePropertyMap.swift +++ b/Sources/DOMKit/WebIDL/StylePropertyMap.swift @@ -4,28 +4,28 @@ import JavaScriptEventLoop import JavaScriptKit public class StylePropertyMap: StylePropertyMapReadOnly { - override public class var constructor: JSFunction { JSObject.global[Strings.StylePropertyMap].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.StylePropertyMap].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public func set(property: String, values: __UNSUPPORTED_UNION__...) { + @inlinable public func set(property: String, values: __UNSUPPORTED_UNION__...) { let this = jsObject _ = this[Strings.set].function!(this: this, arguments: [property.jsValue()] + values.map { $0.jsValue() }) } - public func append(property: String, values: __UNSUPPORTED_UNION__...) { + @inlinable public func append(property: String, values: __UNSUPPORTED_UNION__...) { let this = jsObject _ = this[Strings.append].function!(this: this, arguments: [property.jsValue()] + values.map { $0.jsValue() }) } - public func delete(property: String) { + @inlinable public func delete(property: String) { let this = jsObject _ = this[Strings.delete].function!(this: this, arguments: [property.jsValue()]) } - public func clear() { + @inlinable public func clear() { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift b/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift index 46716468..203b0757 100644 --- a/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift +++ b/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class StylePropertyMapReadOnly: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.StylePropertyMapReadOnly].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.StylePropertyMapReadOnly].function! } public let jsObject: JSObject @@ -18,17 +18,17 @@ public class StylePropertyMapReadOnly: JSBridgedClass, Sequence { ValueIterableIterator(sequence: self) } - public func get(property: String) -> JSValue { + @inlinable public func get(property: String) -> JSValue { let this = jsObject return this[Strings.get].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } - public func getAll(property: String) -> [CSSStyleValue] { + @inlinable public func getAll(property: String) -> [CSSStyleValue] { let this = jsObject return this[Strings.getAll].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } - public func has(property: String) -> Bool { + @inlinable public func has(property: String) -> Bool { let this = jsObject return this[Strings.has].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/StyleSheet.swift b/Sources/DOMKit/WebIDL/StyleSheet.swift index afe15ddf..38f280f4 100644 --- a/Sources/DOMKit/WebIDL/StyleSheet.swift +++ b/Sources/DOMKit/WebIDL/StyleSheet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class StyleSheet: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.StyleSheet].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.StyleSheet].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/StyleSheetList.swift b/Sources/DOMKit/WebIDL/StyleSheetList.swift index 80b0e04f..6adfa0eb 100644 --- a/Sources/DOMKit/WebIDL/StyleSheetList.swift +++ b/Sources/DOMKit/WebIDL/StyleSheetList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class StyleSheetList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.StyleSheetList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.StyleSheetList].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class StyleSheetList: JSBridgedClass { self.jsObject = jsObject } - public subscript(key: Int) -> CSSStyleSheet? { + @inlinable public subscript(key: Int) -> CSSStyleSheet? { jsObject[key].fromJSValue() } diff --git a/Sources/DOMKit/WebIDL/SubmitEvent.swift b/Sources/DOMKit/WebIDL/SubmitEvent.swift index 06ecafc9..f5728c1d 100644 --- a/Sources/DOMKit/WebIDL/SubmitEvent.swift +++ b/Sources/DOMKit/WebIDL/SubmitEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class SubmitEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.SubmitEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SubmitEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _submitter = ReadonlyAttribute(jsObject: jsObject, name: Strings.submitter) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: SubmitEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: SubmitEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/SubtleCrypto.swift b/Sources/DOMKit/WebIDL/SubtleCrypto.swift index 098c1f12..2b13c72f 100644 --- a/Sources/DOMKit/WebIDL/SubtleCrypto.swift +++ b/Sources/DOMKit/WebIDL/SubtleCrypto.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SubtleCrypto: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SubtleCrypto].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SubtleCrypto].function! } public let jsObject: JSObject @@ -12,139 +12,139 @@ public class SubtleCrypto: JSBridgedClass { self.jsObject = jsObject } - public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { + @inlinable public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { let this = jsObject return this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { + @inlinable public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { + @inlinable public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { let this = jsObject return this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { + @inlinable public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { + @inlinable public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { let this = jsObject return this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { + @inlinable public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) -> JSPromise { + @inlinable public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) -> JSPromise { let this = jsObject return this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) async throws -> JSValue { + @inlinable public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) -> JSPromise { + @inlinable public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) -> JSPromise { let this = jsObject return this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) async throws -> JSValue { + @inlinable public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { + @inlinable public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { let this = jsObject return this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { + @inlinable public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { + @inlinable public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { let this = jsObject return this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { + @inlinable public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) -> JSPromise { + @inlinable public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) -> JSPromise { let this = jsObject return this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), length.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) async throws -> ArrayBuffer { + @inlinable public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) async throws -> ArrayBuffer { let this = jsObject let _promise: JSPromise = this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), length.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { + @inlinable public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { let this = jsObject return this[Strings.importKey].function!(this: this, arguments: [format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { + @inlinable public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { let this = jsObject let _promise: JSPromise = this[Strings.importKey].function!(this: this, arguments: [format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func exportKey(format: KeyFormat, key: CryptoKey) -> JSPromise { + @inlinable public func exportKey(format: KeyFormat, key: CryptoKey) -> JSPromise { let this = jsObject return this[Strings.exportKey].function!(this: this, arguments: [format.jsValue(), key.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func exportKey(format: KeyFormat, key: CryptoKey) async throws -> JSValue { + @inlinable public func exportKey(format: KeyFormat, key: CryptoKey) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.exportKey].function!(this: this, arguments: [format.jsValue(), key.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) -> JSPromise { + @inlinable public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) -> JSPromise { let this = jsObject return this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) async throws -> JSValue { + @inlinable public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { + @inlinable public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { let _arg0 = format.jsValue() let _arg1 = wrappedKey.jsValue() let _arg2 = unwrappingKey.jsValue() @@ -157,7 +157,7 @@ public class SubtleCrypto: JSBridgedClass { } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { + @inlinable public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { let _arg0 = format.jsValue() let _arg1 = wrappedKey.jsValue() let _arg2 = unwrappingKey.jsValue() diff --git a/Sources/DOMKit/WebIDL/SyncEvent.swift b/Sources/DOMKit/WebIDL/SyncEvent.swift index 7340cde7..a8895339 100644 --- a/Sources/DOMKit/WebIDL/SyncEvent.swift +++ b/Sources/DOMKit/WebIDL/SyncEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SyncEvent: ExtendableEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.SyncEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SyncEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _tag = ReadonlyAttribute(jsObject: jsObject, name: Strings.tag) @@ -12,7 +12,7 @@ public class SyncEvent: ExtendableEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, init: SyncEventInit) { + @inlinable public convenience init(type: String, init: SyncEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/SyncManager.swift b/Sources/DOMKit/WebIDL/SyncManager.swift index c65f5d85..19a6ddbb 100644 --- a/Sources/DOMKit/WebIDL/SyncManager.swift +++ b/Sources/DOMKit/WebIDL/SyncManager.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class SyncManager: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.SyncManager].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SyncManager].function! } public let jsObject: JSObject @@ -12,25 +12,25 @@ public class SyncManager: JSBridgedClass { self.jsObject = jsObject } - public func register(tag: String) -> JSPromise { + @inlinable public func register(tag: String) -> JSPromise { let this = jsObject return this[Strings.register].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func register(tag: String) async throws { + @inlinable public func register(tag: String) async throws { let this = jsObject let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func getTags() -> JSPromise { + @inlinable public func getTags() -> JSPromise { let this = jsObject return this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getTags() async throws -> [String] { + @inlinable public func getTags() async throws -> [String] { let this = jsObject let _promise: JSPromise = this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/Table.swift b/Sources/DOMKit/WebIDL/Table.swift index 756bf115..94cb21ff 100644 --- a/Sources/DOMKit/WebIDL/Table.swift +++ b/Sources/DOMKit/WebIDL/Table.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Table: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Table].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Table].function! } public let jsObject: JSObject @@ -13,21 +13,21 @@ public class Table: JSBridgedClass { self.jsObject = jsObject } - public convenience init(descriptor: TableDescriptor, value: JSValue? = nil) { + @inlinable public convenience init(descriptor: TableDescriptor, value: JSValue? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue(), value?.jsValue() ?? .undefined])) } - public func grow(delta: UInt32, value: JSValue? = nil) -> UInt32 { + @inlinable public func grow(delta: UInt32, value: JSValue? = nil) -> UInt32 { let this = jsObject return this[Strings.grow].function!(this: this, arguments: [delta.jsValue(), value?.jsValue() ?? .undefined]).fromJSValue()! } - public func get(index: UInt32) -> JSValue { + @inlinable public func get(index: UInt32) -> JSValue { let this = jsObject return this[Strings.get].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } - public func set(index: UInt32, value: JSValue? = nil) { + @inlinable public func set(index: UInt32, value: JSValue? = nil) { let this = jsObject _ = this[Strings.set].function!(this: this, arguments: [index.jsValue(), value?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/TableKind.swift b/Sources/DOMKit/WebIDL/TableKind.swift index fcacdbcb..80690c8a 100644 --- a/Sources/DOMKit/WebIDL/TableKind.swift +++ b/Sources/DOMKit/WebIDL/TableKind.swift @@ -7,16 +7,16 @@ public enum TableKind: JSString, JSValueCompatible { case externref = "externref" case anyfunc = "anyfunc" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift b/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift index 229ebb38..cfdd0863 100644 --- a/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift +++ b/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TaskAttributionTiming: PerformanceEntry { - override public class var constructor: JSFunction { JSObject.global[Strings.TaskAttributionTiming].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TaskAttributionTiming].function! } public required init(unsafelyWrapping jsObject: JSObject) { _containerType = ReadonlyAttribute(jsObject: jsObject, name: Strings.containerType) @@ -26,7 +26,7 @@ public class TaskAttributionTiming: PerformanceEntry { @ReadonlyAttribute public var containerName: String - override public func toJSON() -> JSObject { + @inlinable override public func toJSON() -> JSObject { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TaskController.swift b/Sources/DOMKit/WebIDL/TaskController.swift index 7f637582..1419ee53 100644 --- a/Sources/DOMKit/WebIDL/TaskController.swift +++ b/Sources/DOMKit/WebIDL/TaskController.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit public class TaskController: AbortController { - override public class var constructor: JSFunction { JSObject.global[Strings.TaskController].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TaskController].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(init: TaskControllerInit? = nil) { + @inlinable public convenience init(init: TaskControllerInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } - public func setPriority(priority: TaskPriority) { + @inlinable public func setPriority(priority: TaskPriority) { let this = jsObject _ = this[Strings.setPriority].function!(this: this, arguments: [priority.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/TaskPriority.swift b/Sources/DOMKit/WebIDL/TaskPriority.swift index 52a26b98..afeaf4ec 100644 --- a/Sources/DOMKit/WebIDL/TaskPriority.swift +++ b/Sources/DOMKit/WebIDL/TaskPriority.swift @@ -8,16 +8,16 @@ public enum TaskPriority: JSString, JSValueCompatible { case userVisible = "user-visible" case background = "background" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift b/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift index 447fd041..76336da4 100644 --- a/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class TaskPriorityChangeEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.TaskPriorityChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TaskPriorityChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _previousPriority = ReadonlyAttribute(jsObject: jsObject, name: Strings.previousPriority) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, priorityChangeEventInitDict: TaskPriorityChangeEventInit) { + @inlinable public convenience init(type: String, priorityChangeEventInitDict: TaskPriorityChangeEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), priorityChangeEventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/TaskSignal.swift b/Sources/DOMKit/WebIDL/TaskSignal.swift index a9170fd0..04233472 100644 --- a/Sources/DOMKit/WebIDL/TaskSignal.swift +++ b/Sources/DOMKit/WebIDL/TaskSignal.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TaskSignal: AbortSignal { - override public class var constructor: JSFunction { JSObject.global[Strings.TaskSignal].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TaskSignal].function! } public required init(unsafelyWrapping jsObject: JSObject) { _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) diff --git a/Sources/DOMKit/WebIDL/TestUtils.swift b/Sources/DOMKit/WebIDL/TestUtils.swift index be0ba7a9..76cf7039 100644 --- a/Sources/DOMKit/WebIDL/TestUtils.swift +++ b/Sources/DOMKit/WebIDL/TestUtils.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit public enum TestUtils { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { JSObject.global[Strings.TestUtils].object! } - public static func gc() -> JSPromise { + @inlinable public static func gc() -> JSPromise { let this = JSObject.global[Strings.TestUtils].object! return this[Strings.gc].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func gc() async throws { + @inlinable public static func gc() async throws { let this = JSObject.global[Strings.TestUtils].object! let _promise: JSPromise = this[Strings.gc].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index 8bcd9390..17f9f918 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -4,18 +4,18 @@ import JavaScriptEventLoop import JavaScriptKit public class Text: CharacterData, GeometryUtils, Slottable { - override public class var constructor: JSFunction { JSObject.global[Strings.Text].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Text].function! } public required init(unsafelyWrapping jsObject: JSObject) { _wholeText = ReadonlyAttribute(jsObject: jsObject, name: Strings.wholeText) super.init(unsafelyWrapping: jsObject) } - public convenience init(data: String? = nil) { + @inlinable public convenience init(data: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue() ?? .undefined])) } - public func splitText(offset: UInt32) -> Self { + @inlinable public func splitText(offset: UInt32) -> Self { let this = jsObject return this[Strings.splitText].function!(this: this, arguments: [offset.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TextDecoder.swift b/Sources/DOMKit/WebIDL/TextDecoder.swift index 50ab851d..424f243c 100644 --- a/Sources/DOMKit/WebIDL/TextDecoder.swift +++ b/Sources/DOMKit/WebIDL/TextDecoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextDecoder: JSBridgedClass, TextDecoderCommon { - public class var constructor: JSFunction { JSObject.global[Strings.TextDecoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextDecoder].function! } public let jsObject: JSObject @@ -12,11 +12,11 @@ public class TextDecoder: JSBridgedClass, TextDecoderCommon { self.jsObject = jsObject } - public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { + @inlinable public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) } - public func decode(input: BufferSource? = nil, options: TextDecodeOptions? = nil) -> String { + @inlinable public func decode(input: BufferSource? = nil, options: TextDecodeOptions? = nil) -> String { let this = jsObject return this[Strings.decode].function!(this: this, arguments: [input?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TextDecoderCommon.swift b/Sources/DOMKit/WebIDL/TextDecoderCommon.swift index 53fe5707..d2e70f26 100644 --- a/Sources/DOMKit/WebIDL/TextDecoderCommon.swift +++ b/Sources/DOMKit/WebIDL/TextDecoderCommon.swift @@ -5,9 +5,9 @@ import JavaScriptKit public protocol TextDecoderCommon: JSBridgedClass {} public extension TextDecoderCommon { - var encoding: String { ReadonlyAttribute[Strings.encoding, in: jsObject] } + @inlinable var encoding: String { ReadonlyAttribute[Strings.encoding, in: jsObject] } - var fatal: Bool { ReadonlyAttribute[Strings.fatal, in: jsObject] } + @inlinable var fatal: Bool { ReadonlyAttribute[Strings.fatal, in: jsObject] } - var ignoreBOM: Bool { ReadonlyAttribute[Strings.ignoreBOM, in: jsObject] } + @inlinable var ignoreBOM: Bool { ReadonlyAttribute[Strings.ignoreBOM, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/TextDecoderStream.swift b/Sources/DOMKit/WebIDL/TextDecoderStream.swift index 8816a807..44e55471 100644 --- a/Sources/DOMKit/WebIDL/TextDecoderStream.swift +++ b/Sources/DOMKit/WebIDL/TextDecoderStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextDecoderStream: JSBridgedClass, TextDecoderCommon, GenericTransformStream { - public class var constructor: JSFunction { JSObject.global[Strings.TextDecoderStream].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextDecoderStream].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class TextDecoderStream: JSBridgedClass, TextDecoderCommon, GenericTransf self.jsObject = jsObject } - public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { + @inlinable public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/TextDetector.swift b/Sources/DOMKit/WebIDL/TextDetector.swift index 08efa2af..dad33485 100644 --- a/Sources/DOMKit/WebIDL/TextDetector.swift +++ b/Sources/DOMKit/WebIDL/TextDetector.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextDetector: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TextDetector].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextDetector].function! } public let jsObject: JSObject @@ -12,17 +12,17 @@ public class TextDetector: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public func detect(image: ImageBitmapSource) -> JSPromise { + @inlinable public func detect(image: ImageBitmapSource) -> JSPromise { let this = jsObject return this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func detect(image: ImageBitmapSource) async throws -> [DetectedText] { + @inlinable public func detect(image: ImageBitmapSource) async throws -> [DetectedText] { let this = jsObject let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/TextEncoder.swift b/Sources/DOMKit/WebIDL/TextEncoder.swift index 24d0a481..bd310e9b 100644 --- a/Sources/DOMKit/WebIDL/TextEncoder.swift +++ b/Sources/DOMKit/WebIDL/TextEncoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextEncoder: JSBridgedClass, TextEncoderCommon { - public class var constructor: JSFunction { JSObject.global[Strings.TextEncoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextEncoder].function! } public let jsObject: JSObject @@ -12,16 +12,16 @@ public class TextEncoder: JSBridgedClass, TextEncoderCommon { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public func encode(input: String? = nil) -> Uint8Array { + @inlinable public func encode(input: String? = nil) -> Uint8Array { let this = jsObject return this[Strings.encode].function!(this: this, arguments: [input?.jsValue() ?? .undefined]).fromJSValue()! } - public func encodeInto(source: String, destination: Uint8Array) -> TextEncoderEncodeIntoResult { + @inlinable public func encodeInto(source: String, destination: Uint8Array) -> TextEncoderEncodeIntoResult { let this = jsObject return this[Strings.encodeInto].function!(this: this, arguments: [source.jsValue(), destination.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TextEncoderCommon.swift b/Sources/DOMKit/WebIDL/TextEncoderCommon.swift index 94710a84..b5cecbcf 100644 --- a/Sources/DOMKit/WebIDL/TextEncoderCommon.swift +++ b/Sources/DOMKit/WebIDL/TextEncoderCommon.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol TextEncoderCommon: JSBridgedClass {} public extension TextEncoderCommon { - var encoding: String { ReadonlyAttribute[Strings.encoding, in: jsObject] } + @inlinable var encoding: String { ReadonlyAttribute[Strings.encoding, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/TextEncoderStream.swift b/Sources/DOMKit/WebIDL/TextEncoderStream.swift index fbc30dab..15533b0b 100644 --- a/Sources/DOMKit/WebIDL/TextEncoderStream.swift +++ b/Sources/DOMKit/WebIDL/TextEncoderStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextEncoderStream: JSBridgedClass, TextEncoderCommon, GenericTransformStream { - public class var constructor: JSFunction { JSObject.global[Strings.TextEncoderStream].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextEncoderStream].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class TextEncoderStream: JSBridgedClass, TextEncoderCommon, GenericTransf self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/TextFormat.swift b/Sources/DOMKit/WebIDL/TextFormat.swift index 5df2a4c7..909996b0 100644 --- a/Sources/DOMKit/WebIDL/TextFormat.swift +++ b/Sources/DOMKit/WebIDL/TextFormat.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextFormat: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TextFormat].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextFormat].function! } public let jsObject: JSObject @@ -19,7 +19,7 @@ public class TextFormat: JSBridgedClass { self.jsObject = jsObject } - public convenience init(options: TextFormatInit? = nil) { + @inlinable public convenience init(options: TextFormatInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift index 5774f435..e203c3e9 100644 --- a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift @@ -4,17 +4,17 @@ import JavaScriptEventLoop import JavaScriptKit public class TextFormatUpdateEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.TextFormatUpdateEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TextFormatUpdateEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: TextFormatUpdateEventInit? = nil) { + @inlinable public convenience init(options: TextFormatUpdateEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } - public func getTextFormats() -> [TextFormat] { + @inlinable public func getTextFormats() -> [TextFormat] { let this = jsObject return this[Strings.getTextFormats].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TextMetrics.swift b/Sources/DOMKit/WebIDL/TextMetrics.swift index eab83a85..8d61be6e 100644 --- a/Sources/DOMKit/WebIDL/TextMetrics.swift +++ b/Sources/DOMKit/WebIDL/TextMetrics.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextMetrics: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TextMetrics].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextMetrics].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index 7a250269..3c803d8a 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextTrack: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.TextTrack].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TextTrack].function! } public required init(unsafelyWrapping jsObject: JSObject) { _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) @@ -44,12 +44,12 @@ public class TextTrack: EventTarget { @ReadonlyAttribute public var activeCues: TextTrackCueList? - public func addCue(cue: TextTrackCue) { + @inlinable public func addCue(cue: TextTrackCue) { let this = jsObject _ = this[Strings.addCue].function!(this: this, arguments: [cue.jsValue()]) } - public func removeCue(cue: TextTrackCue) { + @inlinable public func removeCue(cue: TextTrackCue) { let this = jsObject _ = this[Strings.removeCue].function!(this: this, arguments: [cue.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/TextTrackCue.swift b/Sources/DOMKit/WebIDL/TextTrackCue.swift index 77aedc42..583035f1 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCue.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextTrackCue: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.TextTrackCue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TextTrackCue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) diff --git a/Sources/DOMKit/WebIDL/TextTrackCueList.swift b/Sources/DOMKit/WebIDL/TextTrackCueList.swift index aaf57f06..0a43ff52 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCueList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCueList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextTrackCueList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TextTrackCueList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextTrackCueList].function! } public let jsObject: JSObject @@ -16,11 +16,11 @@ public class TextTrackCueList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> TextTrackCue { + @inlinable public subscript(key: Int) -> TextTrackCue { jsObject[key].fromJSValue()! } - public func getCueById(id: String) -> TextTrackCue? { + @inlinable public func getCueById(id: String) -> TextTrackCue? { let this = jsObject return this[Strings.getCueById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TextTrackKind.swift b/Sources/DOMKit/WebIDL/TextTrackKind.swift index 1be60c48..88fc9d33 100644 --- a/Sources/DOMKit/WebIDL/TextTrackKind.swift +++ b/Sources/DOMKit/WebIDL/TextTrackKind.swift @@ -10,16 +10,16 @@ public enum TextTrackKind: JSString, JSValueCompatible { case chapters = "chapters" case metadata = "metadata" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift index 1c55ef90..7e543ca5 100644 --- a/Sources/DOMKit/WebIDL/TextTrackList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextTrackList: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.TextTrackList].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TextTrackList].function! } public required init(unsafelyWrapping jsObject: JSObject) { _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) @@ -17,11 +17,11 @@ public class TextTrackList: EventTarget { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> TextTrack { + @inlinable public subscript(key: Int) -> TextTrack { jsObject[key].fromJSValue()! } - public func getTrackById(id: String) -> TextTrack? { + @inlinable public func getTrackById(id: String) -> TextTrack? { let this = jsObject return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TextTrackMode.swift b/Sources/DOMKit/WebIDL/TextTrackMode.swift index 2b9de600..5956cdc1 100644 --- a/Sources/DOMKit/WebIDL/TextTrackMode.swift +++ b/Sources/DOMKit/WebIDL/TextTrackMode.swift @@ -8,16 +8,16 @@ public enum TextTrackMode: JSString, JSValueCompatible { case hidden = "hidden" case showing = "showing" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TextUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextUpdateEvent.swift index d99e959c..14edcb66 100644 --- a/Sources/DOMKit/WebIDL/TextUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/TextUpdateEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TextUpdateEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.TextUpdateEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TextUpdateEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _updateRangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.updateRangeStart) @@ -17,7 +17,7 @@ public class TextUpdateEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(options: TextUpdateEventInit? = nil) { + @inlinable public convenience init(options: TextUpdateEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/TimeEvent.swift b/Sources/DOMKit/WebIDL/TimeEvent.swift index e6119db5..719691e2 100644 --- a/Sources/DOMKit/WebIDL/TimeEvent.swift +++ b/Sources/DOMKit/WebIDL/TimeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TimeEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.TimeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TimeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _view = ReadonlyAttribute(jsObject: jsObject, name: Strings.view) @@ -18,7 +18,7 @@ public class TimeEvent: Event { @ReadonlyAttribute public var detail: Int32 - public func initTimeEvent(typeArg: String, viewArg: Window?, detailArg: Int32) { + @inlinable public func initTimeEvent(typeArg: String, viewArg: Window?, detailArg: Int32) { let this = jsObject _ = this[Strings.initTimeEvent].function!(this: this, arguments: [typeArg.jsValue(), viewArg.jsValue(), detailArg.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/TimeRanges.swift b/Sources/DOMKit/WebIDL/TimeRanges.swift index 2d0b36aa..a63b7fcc 100644 --- a/Sources/DOMKit/WebIDL/TimeRanges.swift +++ b/Sources/DOMKit/WebIDL/TimeRanges.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TimeRanges: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TimeRanges].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TimeRanges].function! } public let jsObject: JSObject @@ -16,12 +16,12 @@ public class TimeRanges: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public func start(index: UInt32) -> Double { + @inlinable public func start(index: UInt32) -> Double { let this = jsObject return this[Strings.start].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } - public func end(index: UInt32) -> Double { + @inlinable public func end(index: UInt32) -> Double { let this = jsObject return this[Strings.end].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TimelinePhase.swift b/Sources/DOMKit/WebIDL/TimelinePhase.swift index 0c68f14c..8a5b5563 100644 --- a/Sources/DOMKit/WebIDL/TimelinePhase.swift +++ b/Sources/DOMKit/WebIDL/TimelinePhase.swift @@ -9,16 +9,16 @@ public enum TimelinePhase: JSString, JSValueCompatible { case active = "active" case after = "after" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TokenBindingStatus.swift b/Sources/DOMKit/WebIDL/TokenBindingStatus.swift index f15b69f0..58de3dd9 100644 --- a/Sources/DOMKit/WebIDL/TokenBindingStatus.swift +++ b/Sources/DOMKit/WebIDL/TokenBindingStatus.swift @@ -7,16 +7,16 @@ public enum TokenBindingStatus: JSString, JSValueCompatible { case present = "present" case supported = "supported" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Touch.swift b/Sources/DOMKit/WebIDL/Touch.swift index 1e18a12d..3b093c91 100644 --- a/Sources/DOMKit/WebIDL/Touch.swift +++ b/Sources/DOMKit/WebIDL/Touch.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Touch: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Touch].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Touch].function! } public let jsObject: JSObject @@ -27,7 +27,7 @@ public class Touch: JSBridgedClass { self.jsObject = jsObject } - public convenience init(touchInitDict: TouchInit) { + @inlinable public convenience init(touchInitDict: TouchInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [touchInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/TouchEvent.swift b/Sources/DOMKit/WebIDL/TouchEvent.swift index d4934d98..186b487f 100644 --- a/Sources/DOMKit/WebIDL/TouchEvent.swift +++ b/Sources/DOMKit/WebIDL/TouchEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TouchEvent: UIEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.TouchEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TouchEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _touches = ReadonlyAttribute(jsObject: jsObject, name: Strings.touches) @@ -17,7 +17,7 @@ public class TouchEvent: UIEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: TouchEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: TouchEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/TouchList.swift b/Sources/DOMKit/WebIDL/TouchList.swift index 5f97e238..86c70909 100644 --- a/Sources/DOMKit/WebIDL/TouchList.swift +++ b/Sources/DOMKit/WebIDL/TouchList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TouchList: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TouchList].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TouchList].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class TouchList: JSBridgedClass { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> Touch? { + @inlinable public subscript(key: Int) -> Touch? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/TouchType.swift b/Sources/DOMKit/WebIDL/TouchType.swift index 3c67f38f..23a2a100 100644 --- a/Sources/DOMKit/WebIDL/TouchType.swift +++ b/Sources/DOMKit/WebIDL/TouchType.swift @@ -7,16 +7,16 @@ public enum TouchType: JSString, JSValueCompatible { case direct = "direct" case stylus = "stylus" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TrackEvent.swift b/Sources/DOMKit/WebIDL/TrackEvent.swift index 219488b2..b502fe01 100644 --- a/Sources/DOMKit/WebIDL/TrackEvent.swift +++ b/Sources/DOMKit/WebIDL/TrackEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class TrackEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.TrackEvent].function! } + @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) } - public convenience init(type: String, eventInitDict: TrackEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: TrackEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift b/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift index 65a46c92..78a32b4e 100644 --- a/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift +++ b/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift @@ -8,16 +8,16 @@ public enum TransactionAutomationMode: JSString, JSValueCompatible { case autoaccept = "autoaccept" case autoreject = "autoreject" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TransferFunction.swift b/Sources/DOMKit/WebIDL/TransferFunction.swift index d2dec1cb..f46a0bd2 100644 --- a/Sources/DOMKit/WebIDL/TransferFunction.swift +++ b/Sources/DOMKit/WebIDL/TransferFunction.swift @@ -8,16 +8,16 @@ public enum TransferFunction: JSString, JSValueCompatible { case pq = "pq" case hlg = "hlg" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/TransformStream.swift b/Sources/DOMKit/WebIDL/TransformStream.swift index 2daecfd7..98f2a8f6 100644 --- a/Sources/DOMKit/WebIDL/TransformStream.swift +++ b/Sources/DOMKit/WebIDL/TransformStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TransformStream: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TransformStream].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TransformStream].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class TransformStream: JSBridgedClass { self.jsObject = jsObject } - public convenience init(transformer: JSObject? = nil, writableStrategy: QueuingStrategy? = nil, readableStrategy: QueuingStrategy? = nil) { + @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])) } diff --git a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift index c46dec08..7b02004a 100644 --- a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TransformStreamDefaultController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TransformStreamDefaultController].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TransformStreamDefaultController].function! } public let jsObject: JSObject @@ -16,17 +16,17 @@ public class TransformStreamDefaultController: JSBridgedClass { @ReadonlyAttribute public var desiredSize: Double? - public func enqueue(chunk: JSValue? = nil) { + @inlinable public func enqueue(chunk: JSValue? = nil) { let this = jsObject _ = this[Strings.enqueue].function!(this: this, arguments: [chunk?.jsValue() ?? .undefined]) } - public func error(reason: JSValue? = nil) { + @inlinable public func error(reason: JSValue? = nil) { let this = jsObject _ = this[Strings.error].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]) } - public func terminate() { + @inlinable public func terminate() { let this = jsObject _ = this[Strings.terminate].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/TransitionEvent.swift b/Sources/DOMKit/WebIDL/TransitionEvent.swift index 5e29169c..b69a1471 100644 --- a/Sources/DOMKit/WebIDL/TransitionEvent.swift +++ b/Sources/DOMKit/WebIDL/TransitionEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TransitionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.TransitionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TransitionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _propertyName = ReadonlyAttribute(jsObject: jsObject, name: Strings.propertyName) @@ -13,7 +13,7 @@ public class TransitionEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, transitionEventInitDict: TransitionEventInit? = nil) { + @inlinable public convenience init(type: String, transitionEventInitDict: TransitionEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), transitionEventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/TreeWalker.swift b/Sources/DOMKit/WebIDL/TreeWalker.swift index c836a365..541e1477 100644 --- a/Sources/DOMKit/WebIDL/TreeWalker.swift +++ b/Sources/DOMKit/WebIDL/TreeWalker.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TreeWalker: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TreeWalker].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TreeWalker].function! } public let jsObject: JSObject @@ -26,37 +26,37 @@ public class TreeWalker: JSBridgedClass { @ReadWriteAttribute public var currentNode: Node - public func parentNode() -> Node? { + @inlinable public func parentNode() -> Node? { let this = jsObject return this[Strings.parentNode].function!(this: this, arguments: []).fromJSValue()! } - public func firstChild() -> Node? { + @inlinable public func firstChild() -> Node? { let this = jsObject return this[Strings.firstChild].function!(this: this, arguments: []).fromJSValue()! } - public func lastChild() -> Node? { + @inlinable public func lastChild() -> Node? { let this = jsObject return this[Strings.lastChild].function!(this: this, arguments: []).fromJSValue()! } - public func previousSibling() -> Node? { + @inlinable public func previousSibling() -> Node? { let this = jsObject return this[Strings.previousSibling].function!(this: this, arguments: []).fromJSValue()! } - public func nextSibling() -> Node? { + @inlinable public func nextSibling() -> Node? { let this = jsObject return this[Strings.nextSibling].function!(this: this, arguments: []).fromJSValue()! } - public func previousNode() -> Node? { + @inlinable public func previousNode() -> Node? { let this = jsObject return this[Strings.previousNode].function!(this: this, arguments: []).fromJSValue()! } - public func nextNode() -> Node? { + @inlinable public func nextNode() -> Node? { let this = jsObject return this[Strings.nextNode].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TrustedHTML.swift b/Sources/DOMKit/WebIDL/TrustedHTML.swift index ebfcb6b3..772d5922 100644 --- a/Sources/DOMKit/WebIDL/TrustedHTML.swift +++ b/Sources/DOMKit/WebIDL/TrustedHTML.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TrustedHTML: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TrustedHTML].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedHTML].function! } public let jsObject: JSObject @@ -12,16 +12,16 @@ public class TrustedHTML: JSBridgedClass { self.jsObject = jsObject } - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } - public func toJSON() -> String { + @inlinable public func toJSON() -> String { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } - public static func fromLiteral(templateStringsArray: JSObject) -> Self { + @inlinable public static func fromLiteral(templateStringsArray: JSObject) -> Self { let this = constructor return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TrustedScript.swift b/Sources/DOMKit/WebIDL/TrustedScript.swift index aff9821d..ad1a1643 100644 --- a/Sources/DOMKit/WebIDL/TrustedScript.swift +++ b/Sources/DOMKit/WebIDL/TrustedScript.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TrustedScript: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TrustedScript].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedScript].function! } public let jsObject: JSObject @@ -12,16 +12,16 @@ public class TrustedScript: JSBridgedClass { self.jsObject = jsObject } - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } - public func toJSON() -> String { + @inlinable public func toJSON() -> String { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } - public static func fromLiteral(templateStringsArray: JSObject) -> Self { + @inlinable public static func fromLiteral(templateStringsArray: JSObject) -> Self { let this = constructor return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TrustedScriptURL.swift b/Sources/DOMKit/WebIDL/TrustedScriptURL.swift index f356ea07..95c96d92 100644 --- a/Sources/DOMKit/WebIDL/TrustedScriptURL.swift +++ b/Sources/DOMKit/WebIDL/TrustedScriptURL.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TrustedScriptURL: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TrustedScriptURL].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedScriptURL].function! } public let jsObject: JSObject @@ -12,16 +12,16 @@ public class TrustedScriptURL: JSBridgedClass { self.jsObject = jsObject } - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } - public func toJSON() -> String { + @inlinable public func toJSON() -> String { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } - public static func fromLiteral(templateStringsArray: JSObject) -> Self { + @inlinable public static func fromLiteral(templateStringsArray: JSObject) -> Self { let this = constructor return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift index 1e72c340..c6330a4a 100644 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TrustedTypePolicy: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TrustedTypePolicy].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedTypePolicy].function! } public let jsObject: JSObject @@ -16,17 +16,17 @@ public class TrustedTypePolicy: JSBridgedClass { @ReadonlyAttribute public var name: String - public func createHTML(input: String, arguments: JSValue...) -> TrustedHTML { + @inlinable public func createHTML(input: String, arguments: JSValue...) -> TrustedHTML { let this = jsObject return this[Strings.createHTML].function!(this: this, arguments: [input.jsValue()] + arguments.map { $0.jsValue() }).fromJSValue()! } - public func createScript(input: String, arguments: JSValue...) -> TrustedScript { + @inlinable public func createScript(input: String, arguments: JSValue...) -> TrustedScript { let this = jsObject return this[Strings.createScript].function!(this: this, arguments: [input.jsValue()] + arguments.map { $0.jsValue() }).fromJSValue()! } - public func createScriptURL(input: String, arguments: JSValue...) -> TrustedScriptURL { + @inlinable public func createScriptURL(input: String, arguments: JSValue...) -> TrustedScriptURL { let this = jsObject return this[Strings.createScriptURL].function!(this: this, arguments: [input.jsValue()] + arguments.map { $0.jsValue() }).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift index bbaa1e0b..ad0e8f7d 100644 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TrustedTypePolicyFactory: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.TrustedTypePolicyFactory].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedTypePolicyFactory].function! } public let jsObject: JSObject @@ -15,22 +15,22 @@ public class TrustedTypePolicyFactory: JSBridgedClass { self.jsObject = jsObject } - public func createPolicy(policyName: String, policyOptions: TrustedTypePolicyOptions? = nil) -> TrustedTypePolicy { + @inlinable public func createPolicy(policyName: String, policyOptions: TrustedTypePolicyOptions? = nil) -> TrustedTypePolicy { let this = jsObject return this[Strings.createPolicy].function!(this: this, arguments: [policyName.jsValue(), policyOptions?.jsValue() ?? .undefined]).fromJSValue()! } - public func isHTML(value: JSValue) -> Bool { + @inlinable public func isHTML(value: JSValue) -> Bool { let this = jsObject return this[Strings.isHTML].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public func isScript(value: JSValue) -> Bool { + @inlinable public func isScript(value: JSValue) -> Bool { let this = jsObject return this[Strings.isScript].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } - public func isScriptURL(value: JSValue) -> Bool { + @inlinable public func isScriptURL(value: JSValue) -> Bool { let this = jsObject return this[Strings.isScriptURL].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! } @@ -41,12 +41,12 @@ public class TrustedTypePolicyFactory: JSBridgedClass { @ReadonlyAttribute public var emptyScript: TrustedScript - public func getAttributeType(tagName: String, attribute: String, elementNs: String? = nil, attrNs: String? = nil) -> String? { + @inlinable public func getAttributeType(tagName: String, attribute: String, elementNs: String? = nil, attrNs: String? = nil) -> String? { let this = jsObject return this[Strings.getAttributeType].function!(this: this, arguments: [tagName.jsValue(), attribute.jsValue(), elementNs?.jsValue() ?? .undefined, attrNs?.jsValue() ?? .undefined]).fromJSValue()! } - public func getPropertyType(tagName: String, property: String, elementNs: String? = nil) -> String? { + @inlinable public func getPropertyType(tagName: String, property: String, elementNs: String? = nil) -> String? { let this = jsObject return this[Strings.getPropertyType].function!(this: this, arguments: [tagName.jsValue(), property.jsValue(), elementNs?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index f2ac77ac..a6eb311d 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class UIEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.UIEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.UIEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _sourceCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceCapabilities) @@ -17,7 +17,7 @@ public class UIEvent: Event { @ReadonlyAttribute public var sourceCapabilities: InputDeviceCapabilities? - public convenience init(type: String, eventInitDict: UIEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: UIEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } @@ -27,7 +27,7 @@ public class UIEvent: Event { @ReadonlyAttribute public var detail: Int32 - public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil) { + @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]) } diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index f49fa24e..a76647ed 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class URL: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.URL].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.URL].function! } public let jsObject: JSObject @@ -24,17 +24,17 @@ public class URL: JSBridgedClass { self.jsObject = jsObject } - public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { + @inlinable public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { let this = constructor return this[Strings.createObjectURL].function!(this: this, arguments: [obj.jsValue()]).fromJSValue()! } - public static func revokeObjectURL(url: String) { + @inlinable public static func revokeObjectURL(url: String) { let this = constructor _ = this[Strings.revokeObjectURL].function!(this: this, arguments: [url.jsValue()]) } - public convenience init(url: String, base: String? = nil) { + @inlinable public convenience init(url: String, base: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), base?.jsValue() ?? .undefined])) } @@ -74,7 +74,7 @@ public class URL: JSBridgedClass { @ReadWriteAttribute public var hash: String - public func toJSON() -> String { + @inlinable public func toJSON() -> String { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/URLPattern.swift b/Sources/DOMKit/WebIDL/URLPattern.swift index fed5b256..35a7ae1a 100644 --- a/Sources/DOMKit/WebIDL/URLPattern.swift +++ b/Sources/DOMKit/WebIDL/URLPattern.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class URLPattern: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.URLPattern].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.URLPattern].function! } public let jsObject: JSObject @@ -20,16 +20,16 @@ public class URLPattern: JSBridgedClass { self.jsObject = jsObject } - public convenience init(input: URLPatternInput? = nil, baseURL: String? = nil) { + @inlinable public convenience init(input: URLPatternInput? = nil, baseURL: String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined])) } - public func test(input: URLPatternInput? = nil, baseURL: String? = nil) -> Bool { + @inlinable public func test(input: URLPatternInput? = nil, baseURL: String? = nil) -> Bool { let this = jsObject return this[Strings.test].function!(this: this, arguments: [input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined]).fromJSValue()! } - public func exec(input: URLPatternInput? = nil, baseURL: String? = nil) -> URLPatternResult? { + @inlinable public func exec(input: URLPatternInput? = nil, baseURL: String? = nil) -> URLPatternResult? { let this = jsObject return this[Strings.exec].function!(this: this, arguments: [input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/URLSearchParams.swift b/Sources/DOMKit/WebIDL/URLSearchParams.swift index 73aae18d..c987bf74 100644 --- a/Sources/DOMKit/WebIDL/URLSearchParams.swift +++ b/Sources/DOMKit/WebIDL/URLSearchParams.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class URLSearchParams: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.URLSearchParams].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.URLSearchParams].function! } public let jsObject: JSObject @@ -12,41 +12,41 @@ public class URLSearchParams: JSBridgedClass, Sequence { self.jsObject = jsObject } - public convenience init(init: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(init: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } - public func append(name: String, value: String) { + @inlinable public func append(name: String, value: String) { let this = jsObject _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } - public func delete(name: String) { + @inlinable public func delete(name: String) { let this = jsObject _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]) } - public func get(name: String) -> String? { + @inlinable public func get(name: String) -> String? { let this = jsObject return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func getAll(name: String) -> [String] { + @inlinable public func getAll(name: String) -> [String] { let this = jsObject return this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func has(name: String) -> Bool { + @inlinable public func has(name: String) -> Bool { let this = jsObject return this[Strings.has].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func set(name: String, value: String) { + @inlinable public func set(name: String, value: String) { let this = jsObject _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } - public func sort() { + @inlinable public func sort() { let this = jsObject _ = this[Strings.sort].function!(this: this, arguments: []) } @@ -56,7 +56,7 @@ public class URLSearchParams: JSBridgedClass, Sequence { ValueIterableIterator(sequence: self) } - public var description: String { + @inlinable public var description: String { jsObject[Strings.toString]!().fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/USB.swift b/Sources/DOMKit/WebIDL/USB.swift index b00fb2c8..5ce44c44 100644 --- a/Sources/DOMKit/WebIDL/USB.swift +++ b/Sources/DOMKit/WebIDL/USB.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USB: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.USB].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.USB].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) @@ -18,25 +18,25 @@ public class USB: EventTarget { @ClosureAttribute1Optional public var ondisconnect: EventHandler - public func getDevices() -> JSPromise { + @inlinable public func getDevices() -> JSPromise { let this = jsObject return this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDevices() async throws -> [USBDevice] { + @inlinable public func getDevices() async throws -> [USBDevice] { let this = jsObject let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func requestDevice(options: USBDeviceRequestOptions) -> JSPromise { + @inlinable public func requestDevice(options: USBDeviceRequestOptions) -> JSPromise { let this = jsObject return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestDevice(options: USBDeviceRequestOptions) async throws -> USBDevice { + @inlinable public func requestDevice(options: USBDeviceRequestOptions) async throws -> USBDevice { let this = jsObject let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/USBAlternateInterface.swift b/Sources/DOMKit/WebIDL/USBAlternateInterface.swift index 4ec425ef..fd3bc19e 100644 --- a/Sources/DOMKit/WebIDL/USBAlternateInterface.swift +++ b/Sources/DOMKit/WebIDL/USBAlternateInterface.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBAlternateInterface: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBAlternateInterface].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBAlternateInterface].function! } public let jsObject: JSObject @@ -18,7 +18,7 @@ public class USBAlternateInterface: JSBridgedClass { self.jsObject = jsObject } - public convenience init(deviceInterface: USBInterface, alternateSetting: UInt8) { + @inlinable public convenience init(deviceInterface: USBInterface, alternateSetting: UInt8) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInterface.jsValue(), alternateSetting.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/USBConfiguration.swift b/Sources/DOMKit/WebIDL/USBConfiguration.swift index 76ddf6fb..e30dce2f 100644 --- a/Sources/DOMKit/WebIDL/USBConfiguration.swift +++ b/Sources/DOMKit/WebIDL/USBConfiguration.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBConfiguration: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBConfiguration].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBConfiguration].function! } public let jsObject: JSObject @@ -15,7 +15,7 @@ public class USBConfiguration: JSBridgedClass { self.jsObject = jsObject } - public convenience init(device: USBDevice, configurationValue: UInt8) { + @inlinable public convenience init(device: USBDevice, configurationValue: UInt8) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [device.jsValue(), configurationValue.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/USBConnectionEvent.swift b/Sources/DOMKit/WebIDL/USBConnectionEvent.swift index aff344fd..283cf60c 100644 --- a/Sources/DOMKit/WebIDL/USBConnectionEvent.swift +++ b/Sources/DOMKit/WebIDL/USBConnectionEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class USBConnectionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.USBConnectionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.USBConnectionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: USBConnectionEventInit) { + @inlinable public convenience init(type: String, eventInitDict: USBConnectionEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/USBDevice.swift b/Sources/DOMKit/WebIDL/USBDevice.swift index fdad1ae7..a751ec6e 100644 --- a/Sources/DOMKit/WebIDL/USBDevice.swift +++ b/Sources/DOMKit/WebIDL/USBDevice.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBDevice: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBDevice].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBDevice].function! } public let jsObject: JSObject @@ -80,181 +80,181 @@ public class USBDevice: JSBridgedClass { @ReadonlyAttribute public var opened: Bool - public func open() -> JSPromise { + @inlinable public func open() -> JSPromise { let this = jsObject return this[Strings.open].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func open() async throws { + @inlinable public func open() async throws { let this = jsObject let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func close() -> JSPromise { + @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, *) - public func close() async throws { + @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func forget() -> JSPromise { + @inlinable public func forget() -> JSPromise { let this = jsObject return this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func forget() async throws { + @inlinable public func forget() async throws { let this = jsObject let _promise: JSPromise = this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func selectConfiguration(configurationValue: UInt8) -> JSPromise { + @inlinable public func selectConfiguration(configurationValue: UInt8) -> JSPromise { let this = jsObject return this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func selectConfiguration(configurationValue: UInt8) async throws { + @inlinable public func selectConfiguration(configurationValue: UInt8) async throws { let this = jsObject let _promise: JSPromise = this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func claimInterface(interfaceNumber: UInt8) -> JSPromise { + @inlinable public func claimInterface(interfaceNumber: UInt8) -> JSPromise { let this = jsObject return this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func claimInterface(interfaceNumber: UInt8) async throws { + @inlinable public func claimInterface(interfaceNumber: UInt8) async throws { let this = jsObject let _promise: JSPromise = this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func releaseInterface(interfaceNumber: UInt8) -> JSPromise { + @inlinable public func releaseInterface(interfaceNumber: UInt8) -> JSPromise { let this = jsObject return this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func releaseInterface(interfaceNumber: UInt8) async throws { + @inlinable public func releaseInterface(interfaceNumber: UInt8) async throws { let this = jsObject let _promise: JSPromise = this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) -> JSPromise { + @inlinable public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) -> JSPromise { let this = jsObject return this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue(), alternateSetting.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) async throws { + @inlinable public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) async throws { let this = jsObject let _promise: JSPromise = this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue(), alternateSetting.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) -> JSPromise { + @inlinable public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) -> JSPromise { let this = jsObject return this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue(), length.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) async throws -> USBInTransferResult { + @inlinable public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) async throws -> USBInTransferResult { let this = jsObject let _promise: JSPromise = this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue(), length.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) -> JSPromise { + @inlinable public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) -> JSPromise { let this = jsObject return this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue(), data?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) async throws -> USBOutTransferResult { + @inlinable public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) async throws -> USBOutTransferResult { let this = jsObject let _promise: JSPromise = this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue(), data?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func clearHalt(direction: USBDirection, endpointNumber: UInt8) -> JSPromise { + @inlinable public func clearHalt(direction: USBDirection, endpointNumber: UInt8) -> JSPromise { let this = jsObject return this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue(), endpointNumber.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func clearHalt(direction: USBDirection, endpointNumber: UInt8) async throws { + @inlinable public func clearHalt(direction: USBDirection, endpointNumber: UInt8) async throws { let this = jsObject let _promise: JSPromise = this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue(), endpointNumber.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func transferIn(endpointNumber: UInt8, length: UInt32) -> JSPromise { + @inlinable public func transferIn(endpointNumber: UInt8, length: UInt32) -> JSPromise { let this = jsObject return this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue(), length.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func transferIn(endpointNumber: UInt8, length: UInt32) async throws -> USBInTransferResult { + @inlinable public func transferIn(endpointNumber: UInt8, length: UInt32) async throws -> USBInTransferResult { let this = jsObject let _promise: JSPromise = this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue(), length.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func transferOut(endpointNumber: UInt8, data: BufferSource) -> JSPromise { + @inlinable public func transferOut(endpointNumber: UInt8, data: BufferSource) -> JSPromise { let this = jsObject return this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func transferOut(endpointNumber: UInt8, data: BufferSource) async throws -> USBOutTransferResult { + @inlinable public func transferOut(endpointNumber: UInt8, data: BufferSource) async throws -> USBOutTransferResult { let this = jsObject let _promise: JSPromise = this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) -> JSPromise { + @inlinable public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) -> JSPromise { let this = jsObject return this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue(), packetLengths.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) async throws -> USBIsochronousInTransferResult { + @inlinable public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) async throws -> USBIsochronousInTransferResult { let this = jsObject let _promise: JSPromise = this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue(), packetLengths.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) -> JSPromise { + @inlinable public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) -> JSPromise { let this = jsObject return this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) async throws -> USBIsochronousOutTransferResult { + @inlinable public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) async throws -> USBIsochronousOutTransferResult { let this = jsObject let _promise: JSPromise = this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func reset() -> JSPromise { + @inlinable public func reset() -> JSPromise { let this = jsObject return this[Strings.reset].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func reset() async throws { + @inlinable public func reset() async throws { let this = jsObject let _promise: JSPromise = this[Strings.reset].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/USBDirection.swift b/Sources/DOMKit/WebIDL/USBDirection.swift index 47ba1493..4ef1ac1a 100644 --- a/Sources/DOMKit/WebIDL/USBDirection.swift +++ b/Sources/DOMKit/WebIDL/USBDirection.swift @@ -7,16 +7,16 @@ public enum USBDirection: JSString, JSValueCompatible { case `in` = "in" case out = "out" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/USBEndpoint.swift b/Sources/DOMKit/WebIDL/USBEndpoint.swift index e14ac2a3..7a1216bc 100644 --- a/Sources/DOMKit/WebIDL/USBEndpoint.swift +++ b/Sources/DOMKit/WebIDL/USBEndpoint.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBEndpoint: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBEndpoint].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBEndpoint].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class USBEndpoint: JSBridgedClass { self.jsObject = jsObject } - public convenience init(alternate: USBAlternateInterface, endpointNumber: UInt8, direction: USBDirection) { + @inlinable public convenience init(alternate: USBAlternateInterface, endpointNumber: UInt8, direction: USBDirection) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [alternate.jsValue(), endpointNumber.jsValue(), direction.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/USBEndpointType.swift b/Sources/DOMKit/WebIDL/USBEndpointType.swift index d4869024..f8b8e62a 100644 --- a/Sources/DOMKit/WebIDL/USBEndpointType.swift +++ b/Sources/DOMKit/WebIDL/USBEndpointType.swift @@ -8,16 +8,16 @@ public enum USBEndpointType: JSString, JSValueCompatible { case interrupt = "interrupt" case isochronous = "isochronous" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/USBInTransferResult.swift b/Sources/DOMKit/WebIDL/USBInTransferResult.swift index 4ec891eb..cde713ee 100644 --- a/Sources/DOMKit/WebIDL/USBInTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBInTransferResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBInTransferResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBInTransferResult].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBInTransferResult].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class USBInTransferResult: JSBridgedClass { self.jsObject = jsObject } - public convenience init(status: USBTransferStatus, data: DataView? = nil) { + @inlinable public convenience init(status: USBTransferStatus, data: DataView? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), data?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/USBInterface.swift b/Sources/DOMKit/WebIDL/USBInterface.swift index 241f8295..b2ecd8bf 100644 --- a/Sources/DOMKit/WebIDL/USBInterface.swift +++ b/Sources/DOMKit/WebIDL/USBInterface.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBInterface: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBInterface].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBInterface].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class USBInterface: JSBridgedClass { self.jsObject = jsObject } - public convenience init(configuration: USBConfiguration, interfaceNumber: UInt8) { + @inlinable public convenience init(configuration: USBConfiguration, interfaceNumber: UInt8) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration.jsValue(), interfaceNumber.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift index 21296be6..1099b98f 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBIsochronousInTransferPacket: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousInTransferPacket].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousInTransferPacket].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class USBIsochronousInTransferPacket: JSBridgedClass { self.jsObject = jsObject } - public convenience init(status: USBTransferStatus, data: DataView? = nil) { + @inlinable public convenience init(status: USBTransferStatus, data: DataView? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), data?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift index dd102dac..4bbaabf8 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBIsochronousInTransferResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousInTransferResult].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousInTransferResult].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class USBIsochronousInTransferResult: JSBridgedClass { self.jsObject = jsObject } - public convenience init(packets: [USBIsochronousInTransferPacket], data: DataView? = nil) { + @inlinable public convenience init(packets: [USBIsochronousInTransferPacket], data: DataView? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue(), data?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift index b0d5dde0..1d34504d 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBIsochronousOutTransferPacket: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousOutTransferPacket].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousOutTransferPacket].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class USBIsochronousOutTransferPacket: JSBridgedClass { self.jsObject = jsObject } - public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { + @inlinable public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), bytesWritten?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift index 101cca8f..b18b7a12 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBIsochronousOutTransferResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousOutTransferResult].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousOutTransferResult].function! } public let jsObject: JSObject @@ -13,7 +13,7 @@ public class USBIsochronousOutTransferResult: JSBridgedClass { self.jsObject = jsObject } - public convenience init(packets: [USBIsochronousOutTransferPacket]) { + @inlinable public convenience init(packets: [USBIsochronousOutTransferPacket]) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/USBOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBOutTransferResult.swift index e8fff6c1..12cc5146 100644 --- a/Sources/DOMKit/WebIDL/USBOutTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBOutTransferResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBOutTransferResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.USBOutTransferResult].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBOutTransferResult].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class USBOutTransferResult: JSBridgedClass { self.jsObject = jsObject } - public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { + @inlinable public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), bytesWritten?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/USBPermissionResult.swift b/Sources/DOMKit/WebIDL/USBPermissionResult.swift index 62bcdae3..0bc6dd25 100644 --- a/Sources/DOMKit/WebIDL/USBPermissionResult.swift +++ b/Sources/DOMKit/WebIDL/USBPermissionResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class USBPermissionResult: PermissionStatus { - override public class var constructor: JSFunction { JSObject.global[Strings.USBPermissionResult].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.USBPermissionResult].function! } public required init(unsafelyWrapping jsObject: JSObject) { _devices = ReadWriteAttribute(jsObject: jsObject, name: Strings.devices) diff --git a/Sources/DOMKit/WebIDL/USBRecipient.swift b/Sources/DOMKit/WebIDL/USBRecipient.swift index 28477646..0c3631ee 100644 --- a/Sources/DOMKit/WebIDL/USBRecipient.swift +++ b/Sources/DOMKit/WebIDL/USBRecipient.swift @@ -9,16 +9,16 @@ public enum USBRecipient: JSString, JSValueCompatible { case endpoint = "endpoint" case other = "other" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/USBRequestType.swift b/Sources/DOMKit/WebIDL/USBRequestType.swift index 05c1ddce..e6d5830e 100644 --- a/Sources/DOMKit/WebIDL/USBRequestType.swift +++ b/Sources/DOMKit/WebIDL/USBRequestType.swift @@ -8,16 +8,16 @@ public enum USBRequestType: JSString, JSValueCompatible { case `class` = "class" case vendor = "vendor" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/USBTransferStatus.swift b/Sources/DOMKit/WebIDL/USBTransferStatus.swift index 6f4acef4..d10081b4 100644 --- a/Sources/DOMKit/WebIDL/USBTransferStatus.swift +++ b/Sources/DOMKit/WebIDL/USBTransferStatus.swift @@ -8,16 +8,16 @@ public enum USBTransferStatus: JSString, JSValueCompatible { case stall = "stall" case babble = "babble" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift b/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift index 64a4eb1f..a616dd27 100644 --- a/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift +++ b/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class UncalibratedMagnetometer: Sensor { - override public class var constructor: JSFunction { JSObject.global[Strings.UncalibratedMagnetometer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.UncalibratedMagnetometer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) @@ -16,7 +16,7 @@ public class UncalibratedMagnetometer: Sensor { super.init(unsafelyWrapping: jsObject) } - public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { + @inlinable public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/UserIdleState.swift b/Sources/DOMKit/WebIDL/UserIdleState.swift index afb1ea15..fde09f8d 100644 --- a/Sources/DOMKit/WebIDL/UserIdleState.swift +++ b/Sources/DOMKit/WebIDL/UserIdleState.swift @@ -7,16 +7,16 @@ public enum UserIdleState: JSString, JSValueCompatible { case active = "active" case idle = "idle" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift b/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift index 1146eb6f..0bfbfc90 100644 --- a/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift +++ b/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift @@ -8,16 +8,16 @@ public enum UserVerificationRequirement: JSString, JSValueCompatible { case preferred = "preferred" case discouraged = "discouraged" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/VTTCue.swift b/Sources/DOMKit/WebIDL/VTTCue.swift index ce48fa16..a8d96410 100644 --- a/Sources/DOMKit/WebIDL/VTTCue.swift +++ b/Sources/DOMKit/WebIDL/VTTCue.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VTTCue: TextTrackCue { - override public class var constructor: JSFunction { JSObject.global[Strings.VTTCue].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VTTCue].function! } public required init(unsafelyWrapping jsObject: JSObject) { _region = ReadWriteAttribute(jsObject: jsObject, name: Strings.region) @@ -20,7 +20,7 @@ public class VTTCue: TextTrackCue { super.init(unsafelyWrapping: jsObject) } - public convenience init(startTime: Double, endTime: Double, text: String) { + @inlinable public convenience init(startTime: Double, endTime: Double, text: String) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue(), endTime.jsValue(), text.jsValue()])) } @@ -54,7 +54,7 @@ public class VTTCue: TextTrackCue { @ReadWriteAttribute public var text: String - public func getCueAsHTML() -> DocumentFragment { + @inlinable public func getCueAsHTML() -> DocumentFragment { let this = jsObject return this[Strings.getCueAsHTML].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/VTTRegion.swift b/Sources/DOMKit/WebIDL/VTTRegion.swift index 8d44e280..424d8519 100644 --- a/Sources/DOMKit/WebIDL/VTTRegion.swift +++ b/Sources/DOMKit/WebIDL/VTTRegion.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VTTRegion: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.VTTRegion].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VTTRegion].function! } public let jsObject: JSObject @@ -20,7 +20,7 @@ public class VTTRegion: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/ValidityState.swift b/Sources/DOMKit/WebIDL/ValidityState.swift index 9a39cb94..5b403383 100644 --- a/Sources/DOMKit/WebIDL/ValidityState.swift +++ b/Sources/DOMKit/WebIDL/ValidityState.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ValidityState: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.ValidityState].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ValidityState].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/ValueEvent.swift b/Sources/DOMKit/WebIDL/ValueEvent.swift index 224f41b2..7c6e7a9f 100644 --- a/Sources/DOMKit/WebIDL/ValueEvent.swift +++ b/Sources/DOMKit/WebIDL/ValueEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class ValueEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.ValueEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ValueEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, initDict: ValueEventInit? = nil) { + @inlinable public convenience init(type: String, initDict: ValueEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), initDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/ValueType.swift b/Sources/DOMKit/WebIDL/ValueType.swift index bcbfdbe8..6b66c2b4 100644 --- a/Sources/DOMKit/WebIDL/ValueType.swift +++ b/Sources/DOMKit/WebIDL/ValueType.swift @@ -12,16 +12,16 @@ public enum ValueType: JSString, JSValueCompatible { case externref = "externref" case anyfunc = "anyfunc" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift b/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift index e0fc2c03..0d3861b4 100644 --- a/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift +++ b/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift @@ -8,16 +8,16 @@ public enum VideoColorPrimaries: JSString, JSValueCompatible { case bt470bg = "bt470bg" case smpte170m = "smpte170m" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/VideoColorSpace.swift b/Sources/DOMKit/WebIDL/VideoColorSpace.swift index 8c3e7cb2..e74ef0f1 100644 --- a/Sources/DOMKit/WebIDL/VideoColorSpace.swift +++ b/Sources/DOMKit/WebIDL/VideoColorSpace.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoColorSpace: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.VideoColorSpace].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoColorSpace].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class VideoColorSpace: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: VideoColorSpaceInit? = nil) { + @inlinable public convenience init(init: VideoColorSpaceInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } @@ -32,7 +32,7 @@ public class VideoColorSpace: JSBridgedClass { @ReadonlyAttribute public var fullRange: Bool? - public func toJSON() -> VideoColorSpaceInit { + @inlinable public func toJSON() -> VideoColorSpaceInit { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/VideoDecoder.swift b/Sources/DOMKit/WebIDL/VideoDecoder.swift index 32184399..4082f418 100644 --- a/Sources/DOMKit/WebIDL/VideoDecoder.swift +++ b/Sources/DOMKit/WebIDL/VideoDecoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoDecoder: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.VideoDecoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoDecoder].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class VideoDecoder: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: VideoDecoderInit) { + @inlinable public convenience init(init: VideoDecoderInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @@ -24,45 +24,45 @@ public class VideoDecoder: JSBridgedClass { @ReadonlyAttribute public var decodeQueueSize: UInt32 - public func configure(config: VideoDecoderConfig) { + @inlinable public func configure(config: VideoDecoderConfig) { let this = jsObject _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) } - public func decode(chunk: EncodedVideoChunk) { + @inlinable public func decode(chunk: EncodedVideoChunk) { let this = jsObject _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue()]) } - public func flush() -> JSPromise { + @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, *) - public func flush() async throws { + @inlinable public func flush() async throws { let this = jsObject let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func reset() { + @inlinable public func reset() { let this = jsObject _ = this[Strings.reset].function!(this: this, arguments: []) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public static func isConfigSupported(config: VideoDecoderConfig) -> JSPromise { + @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, *) - public static func isConfigSupported(config: VideoDecoderConfig) async throws -> VideoDecoderSupport { + @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.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/VideoEncoder.swift b/Sources/DOMKit/WebIDL/VideoEncoder.swift index 0e8c4f26..a844ed08 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoder.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoder.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoEncoder: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.VideoEncoder].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoEncoder].function! } public let jsObject: JSObject @@ -14,7 +14,7 @@ public class VideoEncoder: JSBridgedClass { self.jsObject = jsObject } - public convenience init(init: VideoEncoderInit) { + @inlinable public convenience init(init: VideoEncoderInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) } @@ -24,45 +24,45 @@ public class VideoEncoder: JSBridgedClass { @ReadonlyAttribute public var encodeQueueSize: UInt32 - public func configure(config: VideoEncoderConfig) { + @inlinable public func configure(config: VideoEncoderConfig) { let this = jsObject _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) } - public func encode(frame: VideoFrame, options: VideoEncoderEncodeOptions? = nil) { + @inlinable public func encode(frame: VideoFrame, options: VideoEncoderEncodeOptions? = nil) { let this = jsObject _ = this[Strings.encode].function!(this: this, arguments: [frame.jsValue(), options?.jsValue() ?? .undefined]) } - public func flush() -> JSPromise { + @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, *) - public func flush() async throws { + @inlinable public func flush() async throws { let this = jsObject let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func reset() { + @inlinable public func reset() { let this = jsObject _ = this[Strings.reset].function!(this: this, arguments: []) } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } - public static func isConfigSupported(config: VideoEncoderConfig) -> JSPromise { + @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, *) - public static func isConfigSupported(config: VideoEncoderConfig) async throws -> VideoEncoderSupport { + @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.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift b/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift index fa5a1c01..e1a5388d 100644 --- a/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift +++ b/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift @@ -9,16 +9,16 @@ public enum VideoFacingModeEnum: JSString, JSValueCompatible { case left = "left" case right = "right" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/VideoFrame.swift b/Sources/DOMKit/WebIDL/VideoFrame.swift index 932ec96d..688c99d8 100644 --- a/Sources/DOMKit/WebIDL/VideoFrame.swift +++ b/Sources/DOMKit/WebIDL/VideoFrame.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoFrame: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.VideoFrame].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoFrame].function! } public let jsObject: JSObject @@ -22,11 +22,11 @@ public class VideoFrame: JSBridgedClass { self.jsObject = jsObject } - public convenience init(image: CanvasImageSource, init: VideoFrameInit? = nil) { + @inlinable public convenience init(image: CanvasImageSource, init: VideoFrameInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [image.jsValue(), `init`?.jsValue() ?? .undefined])) } - public convenience init(data: BufferSource, init: VideoFrameBufferInit) { + @inlinable public convenience init(data: BufferSource, init: VideoFrameBufferInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue(), `init`.jsValue()])) } @@ -60,29 +60,29 @@ public class VideoFrame: JSBridgedClass { @ReadonlyAttribute public var colorSpace: VideoColorSpace - public func allocationSize(options: VideoFrameCopyToOptions? = nil) -> UInt32 { + @inlinable public func allocationSize(options: VideoFrameCopyToOptions? = nil) -> UInt32 { let this = jsObject return this[Strings.allocationSize].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) -> JSPromise { + @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, *) - public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) async throws -> [PlaneLayout] { + @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.get().fromJSValue()! } - public func clone() -> Self { + @inlinable public func clone() -> Self { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift b/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift index c0511c7c..60917fe8 100644 --- a/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift +++ b/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift @@ -9,16 +9,16 @@ public enum VideoMatrixCoefficients: JSString, JSValueCompatible { case bt470bg = "bt470bg" case smpte170m = "smpte170m" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/VideoPixelFormat.swift b/Sources/DOMKit/WebIDL/VideoPixelFormat.swift index 16bd76e5..aa69a8fb 100644 --- a/Sources/DOMKit/WebIDL/VideoPixelFormat.swift +++ b/Sources/DOMKit/WebIDL/VideoPixelFormat.swift @@ -14,16 +14,16 @@ public enum VideoPixelFormat: JSString, JSValueCompatible { case bGRA = "BGRA" case bGRX = "BGRX" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift b/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift index 53fc1ef7..2df11cad 100644 --- a/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift +++ b/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoPlaybackQuality: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.VideoPlaybackQuality].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoPlaybackQuality].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift b/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift index 1757b1bc..58585acd 100644 --- a/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift +++ b/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift @@ -7,16 +7,16 @@ public enum VideoResizeModeEnum: JSString, JSValueCompatible { case none = "none" case cropAndScale = "crop-and-scale" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/VideoTrack.swift b/Sources/DOMKit/WebIDL/VideoTrack.swift index 74076918..6942a46c 100644 --- a/Sources/DOMKit/WebIDL/VideoTrack.swift +++ b/Sources/DOMKit/WebIDL/VideoTrack.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoTrack: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.VideoTrack].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoTrack].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift b/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift index aae9d046..9db54f81 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoTrackGenerator: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackGenerator].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackGenerator].function! } public let jsObject: JSObject @@ -15,7 +15,7 @@ public class VideoTrackGenerator: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift index ee221d1c..fc0ab994 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackList.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoTrackList: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackList].function! } + @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) @@ -18,11 +18,11 @@ public class VideoTrackList: EventTarget { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> VideoTrack { + @inlinable public subscript(key: Int) -> VideoTrack { jsObject[key].fromJSValue()! } - public func getTrackById(id: String) -> VideoTrack? { + @inlinable public func getTrackById(id: String) -> VideoTrack? { let this = jsObject return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift b/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift index 6c392b0b..1ccee139 100644 --- a/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift +++ b/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift @@ -8,16 +8,16 @@ public enum VideoTransferCharacteristics: JSString, JSValueCompatible { case smpte170m = "smpte170m" case iec6196621 = "iec61966-2-1" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/VirtualKeyboard.swift b/Sources/DOMKit/WebIDL/VirtualKeyboard.swift index f9867aca..7be9438b 100644 --- a/Sources/DOMKit/WebIDL/VirtualKeyboard.swift +++ b/Sources/DOMKit/WebIDL/VirtualKeyboard.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VirtualKeyboard: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.VirtualKeyboard].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VirtualKeyboard].function! } public required init(unsafelyWrapping jsObject: JSObject) { _boundingRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingRect) @@ -13,12 +13,12 @@ public class VirtualKeyboard: EventTarget { super.init(unsafelyWrapping: jsObject) } - public func show() { + @inlinable public func show() { let this = jsObject _ = this[Strings.show].function!(this: this, arguments: []) } - public func hide() { + @inlinable public func hide() { let this = jsObject _ = this[Strings.hide].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/VisualViewport.swift b/Sources/DOMKit/WebIDL/VisualViewport.swift index 8b87f4c2..8b47da06 100644 --- a/Sources/DOMKit/WebIDL/VisualViewport.swift +++ b/Sources/DOMKit/WebIDL/VisualViewport.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class VisualViewport: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.VisualViewport].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VisualViewport].function! } public required init(unsafelyWrapping jsObject: JSObject) { _offsetLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetLeft) diff --git a/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift b/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift index 1b2f348f..8e7e3b92 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_blend_equation_advanced_coherent: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_blend_equation_advanced_coherent].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_blend_equation_advanced_coherent].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift b/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift index b2b6dc76..02dc1b87 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_color_buffer_float: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_color_buffer_float].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_color_buffer_float].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift index 008acd49..4f9aec25 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_compressed_texture_astc: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_astc].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_astc].function! } public let jsObject: JSObject @@ -68,7 +68,7 @@ public class WEBGL_compressed_texture_astc: JSBridgedClass { public static let COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum = 0x93DD - public func getSupportedProfiles() -> [String] { + @inlinable public func getSupportedProfiles() -> [String] { let this = jsObject return this[Strings.getSupportedProfiles].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift index 669b4350..182e0d13 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_compressed_texture_etc: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_etc].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_etc].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift index 1607ad4c..0bef73eb 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_compressed_texture_etc1: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_etc1].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_etc1].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift index 047006f7..4411ac98 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_compressed_texture_pvrtc: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_pvrtc].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_pvrtc].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift index 5cd5ea9d..8c362d23 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_compressed_texture_s3tc: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_s3tc].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_s3tc].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift index 3db3753c..9957a01e 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_compressed_texture_s3tc_srgb: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_s3tc_srgb].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_s3tc_srgb].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift b/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift index 9430453b..3d8bd655 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_debug_renderer_info: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_debug_renderer_info].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_debug_renderer_info].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift b/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift index 9070a4ce..66f71bcc 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_debug_shaders: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_debug_shaders].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_debug_shaders].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class WEBGL_debug_shaders: JSBridgedClass { self.jsObject = jsObject } - public func getTranslatedShaderSource(shader: WebGLShader) -> String { + @inlinable public func getTranslatedShaderSource(shader: WebGLShader) -> String { let this = jsObject return this[Strings.getTranslatedShaderSource].function!(this: this, arguments: [shader.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift b/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift index a830b9e0..c8a79297 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_depth_texture: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_depth_texture].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_depth_texture].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift index 0c94a406..52e6ded1 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_draw_buffers: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_draw_buffers].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_draw_buffers].function! } public let jsObject: JSObject @@ -80,7 +80,7 @@ public class WEBGL_draw_buffers: JSBridgedClass { public static let MAX_DRAW_BUFFERS_WEBGL: GLenum = 0x8824 - public func drawBuffersWEBGL(buffers: [GLenum]) { + @inlinable public func drawBuffersWEBGL(buffers: [GLenum]) { let this = jsObject _ = this[Strings.drawBuffersWEBGL].function!(this: this, arguments: [buffers.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift index 3fb9c47d..f5122d42 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_draw_instanced_base_vertex_base_instance: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_draw_instanced_base_vertex_base_instance].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_draw_instanced_base_vertex_base_instance].function! } public let jsObject: JSObject @@ -12,12 +12,12 @@ public class WEBGL_draw_instanced_base_vertex_base_instance: JSBridgedClass { self.jsObject = jsObject } - public func drawArraysInstancedBaseInstanceWEBGL(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei, baseInstance: GLuint) { + @inlinable public func drawArraysInstancedBaseInstanceWEBGL(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei, baseInstance: GLuint) { let this = jsObject _ = this[Strings.drawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue(), baseInstance.jsValue()]) } - public func drawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei, baseVertex: GLint, baseInstance: GLuint) { + @inlinable public func drawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei, baseVertex: GLint, baseInstance: GLuint) { let _arg0 = mode.jsValue() let _arg1 = count.jsValue() let _arg2 = type.jsValue() diff --git a/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift b/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift index 39f4de21..ad9e54df 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_lose_context: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_lose_context].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_lose_context].function! } public let jsObject: JSObject @@ -12,12 +12,12 @@ public class WEBGL_lose_context: JSBridgedClass { self.jsObject = jsObject } - public func loseContext() { + @inlinable public func loseContext() { let this = jsObject _ = this[Strings.loseContext].function!(this: this, arguments: []) } - public func restoreContext() { + @inlinable public func restoreContext() { let this = jsObject _ = this[Strings.restoreContext].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift index fbab1ef3..79f2cb0a 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_multi_draw: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_multi_draw].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_multi_draw].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class WEBGL_multi_draw: JSBridgedClass { self.jsObject = jsObject } - public func multiDrawArraysWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, drawcount: GLsizei) { + @inlinable public func multiDrawArraysWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, drawcount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = firstsList.jsValue() let _arg2 = firstsOffset.jsValue() @@ -23,7 +23,7 @@ public class WEBGL_multi_draw: JSBridgedClass { _ = this[Strings.multiDrawArraysWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - public func multiDrawElementsWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, drawcount: GLsizei) { + @inlinable public func multiDrawElementsWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, drawcount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = countsList.jsValue() let _arg2 = countsOffset.jsValue() @@ -35,7 +35,7 @@ public class WEBGL_multi_draw: JSBridgedClass { _ = this[Strings.multiDrawElementsWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } - public func multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { + @inlinable public func multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = firstsList.jsValue() let _arg2 = firstsOffset.jsValue() @@ -48,7 +48,7 @@ public class WEBGL_multi_draw: JSBridgedClass { _ = this[Strings.multiDrawArraysInstancedWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } - public func multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { + @inlinable public func multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = countsList.jsValue() let _arg2 = countsOffset.jsValue() diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift index 2d994a59..f9db53d1 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_multi_draw_instanced_base_vertex_base_instance].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_multi_draw_instanced_base_vertex_base_instance].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClas self.jsObject = jsObject } - public func multiDrawArraysInstancedBaseInstanceWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, baseInstancesList: __UNSUPPORTED_UNION__, baseInstancesOffset: GLuint, drawCount: GLsizei) { + @inlinable public func multiDrawArraysInstancedBaseInstanceWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, baseInstancesList: __UNSUPPORTED_UNION__, baseInstancesOffset: GLuint, drawCount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = firstsList.jsValue() let _arg2 = firstsOffset.jsValue() @@ -27,7 +27,7 @@ public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClas _ = this[Strings.multiDrawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - public func multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, baseVerticesList: __UNSUPPORTED_UNION__, baseVerticesOffset: GLuint, baseInstancesList: __UNSUPPORTED_UNION__, baseInstancesOffset: GLuint, drawCount: GLsizei) { + @inlinable public func multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, baseVerticesList: __UNSUPPORTED_UNION__, baseVerticesOffset: GLuint, baseInstancesList: __UNSUPPORTED_UNION__, baseInstancesOffset: GLuint, drawCount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = countsList.jsValue() let _arg2 = countsOffset.jsValue() diff --git a/Sources/DOMKit/WebIDL/WakeLock.swift b/Sources/DOMKit/WebIDL/WakeLock.swift index 9344b430..e0281073 100644 --- a/Sources/DOMKit/WebIDL/WakeLock.swift +++ b/Sources/DOMKit/WebIDL/WakeLock.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WakeLock: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WakeLock].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WakeLock].function! } public let jsObject: JSObject @@ -12,13 +12,13 @@ public class WakeLock: JSBridgedClass { self.jsObject = jsObject } - public func request(type: WakeLockType? = nil) -> JSPromise { + @inlinable public func request(type: WakeLockType? = nil) -> JSPromise { let this = jsObject return this[Strings.request].function!(this: this, arguments: [type?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func request(type: WakeLockType? = nil) async throws -> WakeLockSentinel { + @inlinable public func request(type: WakeLockType? = nil) async throws -> WakeLockSentinel { let this = jsObject let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [type?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift index b6e3da4b..d30e171c 100644 --- a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift +++ b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WakeLockSentinel: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.WakeLockSentinel].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WakeLockSentinel].function! } public required init(unsafelyWrapping jsObject: JSObject) { _released = ReadonlyAttribute(jsObject: jsObject, name: Strings.released) @@ -19,13 +19,13 @@ public class WakeLockSentinel: EventTarget { @ReadonlyAttribute public var type: WakeLockType - public func release() -> JSPromise { + @inlinable public func release() -> JSPromise { let this = jsObject return this[Strings.release].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func release() async throws { + @inlinable public func release() async throws { let this = jsObject let _promise: JSPromise = this[Strings.release].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/WakeLockType.swift b/Sources/DOMKit/WebIDL/WakeLockType.swift index 5b78d2f1..88ca94c5 100644 --- a/Sources/DOMKit/WebIDL/WakeLockType.swift +++ b/Sources/DOMKit/WebIDL/WakeLockType.swift @@ -6,16 +6,16 @@ import JavaScriptKit public enum WakeLockType: JSString, JSValueCompatible { case screen = "screen" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/WaveShaperNode.swift b/Sources/DOMKit/WebIDL/WaveShaperNode.swift index 26c1fbc3..ce32aaff 100644 --- a/Sources/DOMKit/WebIDL/WaveShaperNode.swift +++ b/Sources/DOMKit/WebIDL/WaveShaperNode.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WaveShaperNode: AudioNode { - override public class var constructor: JSFunction { JSObject.global[Strings.WaveShaperNode].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WaveShaperNode].function! } public required init(unsafelyWrapping jsObject: JSObject) { _curve = ReadWriteAttribute(jsObject: jsObject, name: Strings.curve) @@ -12,7 +12,7 @@ public class WaveShaperNode: AudioNode { super.init(unsafelyWrapping: jsObject) } - public convenience init(context: BaseAudioContext, options: WaveShaperOptions? = nil) { + @inlinable public convenience init(context: BaseAudioContext, options: WaveShaperOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/WebAssembly.swift b/Sources/DOMKit/WebIDL/WebAssembly.swift index f4394fa5..3f38ec07 100644 --- a/Sources/DOMKit/WebIDL/WebAssembly.swift +++ b/Sources/DOMKit/WebIDL/WebAssembly.swift @@ -4,70 +4,70 @@ import JavaScriptEventLoop import JavaScriptKit public enum WebAssembly { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { JSObject.global[Strings.WebAssembly].object! } - public static func validate(bytes: BufferSource) -> Bool { + @inlinable public static func validate(bytes: BufferSource) -> Bool { let this = JSObject.global[Strings.WebAssembly].object! return this[Strings.validate].function!(this: this, arguments: [bytes.jsValue()]).fromJSValue()! } - public static func compile(bytes: BufferSource) -> JSPromise { + @inlinable public static func compile(bytes: BufferSource) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! return this[Strings.compile].function!(this: this, arguments: [bytes.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func compile(bytes: BufferSource) async throws -> Module { + @inlinable public static func compile(bytes: BufferSource) async throws -> Module { let this = JSObject.global[Strings.WebAssembly].object! let _promise: JSPromise = this[Strings.compile].function!(this: this, arguments: [bytes.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) -> JSPromise { + @inlinable public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! return this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { + @inlinable public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { let this = JSObject.global[Strings.WebAssembly].object! let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) -> JSPromise { + @inlinable public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! return this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) async throws -> Instance { + @inlinable public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) async throws -> Instance { let this = JSObject.global[Strings.WebAssembly].object! let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public static func compileStreaming(source: JSPromise) -> JSPromise { + @inlinable public static func compileStreaming(source: JSPromise) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! return this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func compileStreaming(source: JSPromise) async throws -> Module { + @inlinable public static func compileStreaming(source: JSPromise) async throws -> Module { let this = JSObject.global[Strings.WebAssembly].object! let _promise: JSPromise = this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) -> JSPromise { + @inlinable public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! return this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { + @inlinable public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { let this = JSObject.global[Strings.WebAssembly].object! let _promise: JSPromise = this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift index 91b1aa97..3ee19c40 100644 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGL2RenderingContext: JSBridgedClass, WebGLRenderingContextBase, WebGL2RenderingContextBase, WebGL2RenderingContextOverloads { - public class var constructor: JSFunction { JSObject.global[Strings.WebGL2RenderingContext].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGL2RenderingContext].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift index 8e98756a..13c585d3 100644 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift @@ -5,543 +5,543 @@ import JavaScriptKit public protocol WebGL2RenderingContextBase: JSBridgedClass {} public extension WebGL2RenderingContextBase { - static var READ_BUFFER: GLenum { 0x0C02 } + @inlinable static var READ_BUFFER: GLenum { 0x0C02 } - static var UNPACK_ROW_LENGTH: GLenum { 0x0CF2 } + @inlinable static var UNPACK_ROW_LENGTH: GLenum { 0x0CF2 } - static var UNPACK_SKIP_ROWS: GLenum { 0x0CF3 } + @inlinable static var UNPACK_SKIP_ROWS: GLenum { 0x0CF3 } - static var UNPACK_SKIP_PIXELS: GLenum { 0x0CF4 } + @inlinable static var UNPACK_SKIP_PIXELS: GLenum { 0x0CF4 } - static var PACK_ROW_LENGTH: GLenum { 0x0D02 } + @inlinable static var PACK_ROW_LENGTH: GLenum { 0x0D02 } - static var PACK_SKIP_ROWS: GLenum { 0x0D03 } + @inlinable static var PACK_SKIP_ROWS: GLenum { 0x0D03 } - static var PACK_SKIP_PIXELS: GLenum { 0x0D04 } + @inlinable static var PACK_SKIP_PIXELS: GLenum { 0x0D04 } - static var COLOR: GLenum { 0x1800 } + @inlinable static var COLOR: GLenum { 0x1800 } - static var DEPTH: GLenum { 0x1801 } + @inlinable static var DEPTH: GLenum { 0x1801 } - static var STENCIL: GLenum { 0x1802 } + @inlinable static var STENCIL: GLenum { 0x1802 } - static var RED: GLenum { 0x1903 } + @inlinable static var RED: GLenum { 0x1903 } - static var RGB8: GLenum { 0x8051 } + @inlinable static var RGB8: GLenum { 0x8051 } - static var RGBA8: GLenum { 0x8058 } + @inlinable static var RGBA8: GLenum { 0x8058 } - static var RGB10_A2: GLenum { 0x8059 } + @inlinable static var RGB10_A2: GLenum { 0x8059 } - static var TEXTURE_BINDING_3D: GLenum { 0x806A } + @inlinable static var TEXTURE_BINDING_3D: GLenum { 0x806A } - static var UNPACK_SKIP_IMAGES: GLenum { 0x806D } + @inlinable static var UNPACK_SKIP_IMAGES: GLenum { 0x806D } - static var UNPACK_IMAGE_HEIGHT: GLenum { 0x806E } + @inlinable static var UNPACK_IMAGE_HEIGHT: GLenum { 0x806E } - static var TEXTURE_3D: GLenum { 0x806F } + @inlinable static var TEXTURE_3D: GLenum { 0x806F } - static var TEXTURE_WRAP_R: GLenum { 0x8072 } + @inlinable static var TEXTURE_WRAP_R: GLenum { 0x8072 } - static var MAX_3D_TEXTURE_SIZE: GLenum { 0x8073 } + @inlinable static var MAX_3D_TEXTURE_SIZE: GLenum { 0x8073 } - static var UNSIGNED_INT_2_10_10_10_REV: GLenum { 0x8368 } + @inlinable static var UNSIGNED_INT_2_10_10_10_REV: GLenum { 0x8368 } - static var MAX_ELEMENTS_VERTICES: GLenum { 0x80E8 } + @inlinable static var MAX_ELEMENTS_VERTICES: GLenum { 0x80E8 } - static var MAX_ELEMENTS_INDICES: GLenum { 0x80E9 } + @inlinable static var MAX_ELEMENTS_INDICES: GLenum { 0x80E9 } - static var TEXTURE_MIN_LOD: GLenum { 0x813A } + @inlinable static var TEXTURE_MIN_LOD: GLenum { 0x813A } - static var TEXTURE_MAX_LOD: GLenum { 0x813B } + @inlinable static var TEXTURE_MAX_LOD: GLenum { 0x813B } - static var TEXTURE_BASE_LEVEL: GLenum { 0x813C } + @inlinable static var TEXTURE_BASE_LEVEL: GLenum { 0x813C } - static var TEXTURE_MAX_LEVEL: GLenum { 0x813D } + @inlinable static var TEXTURE_MAX_LEVEL: GLenum { 0x813D } - static var MIN: GLenum { 0x8007 } + @inlinable static var MIN: GLenum { 0x8007 } - static var MAX: GLenum { 0x8008 } + @inlinable static var MAX: GLenum { 0x8008 } - static var DEPTH_COMPONENT24: GLenum { 0x81A6 } + @inlinable static var DEPTH_COMPONENT24: GLenum { 0x81A6 } - static var MAX_TEXTURE_LOD_BIAS: GLenum { 0x84FD } + @inlinable static var MAX_TEXTURE_LOD_BIAS: GLenum { 0x84FD } - static var TEXTURE_COMPARE_MODE: GLenum { 0x884C } + @inlinable static var TEXTURE_COMPARE_MODE: GLenum { 0x884C } - static var TEXTURE_COMPARE_FUNC: GLenum { 0x884D } + @inlinable static var TEXTURE_COMPARE_FUNC: GLenum { 0x884D } - static var CURRENT_QUERY: GLenum { 0x8865 } + @inlinable static var CURRENT_QUERY: GLenum { 0x8865 } - static var QUERY_RESULT: GLenum { 0x8866 } + @inlinable static var QUERY_RESULT: GLenum { 0x8866 } - static var QUERY_RESULT_AVAILABLE: GLenum { 0x8867 } + @inlinable static var QUERY_RESULT_AVAILABLE: GLenum { 0x8867 } - static var STREAM_READ: GLenum { 0x88E1 } + @inlinable static var STREAM_READ: GLenum { 0x88E1 } - static var STREAM_COPY: GLenum { 0x88E2 } + @inlinable static var STREAM_COPY: GLenum { 0x88E2 } - static var STATIC_READ: GLenum { 0x88E5 } + @inlinable static var STATIC_READ: GLenum { 0x88E5 } - static var STATIC_COPY: GLenum { 0x88E6 } + @inlinable static var STATIC_COPY: GLenum { 0x88E6 } - static var DYNAMIC_READ: GLenum { 0x88E9 } + @inlinable static var DYNAMIC_READ: GLenum { 0x88E9 } - static var DYNAMIC_COPY: GLenum { 0x88EA } + @inlinable static var DYNAMIC_COPY: GLenum { 0x88EA } - static var MAX_DRAW_BUFFERS: GLenum { 0x8824 } + @inlinable static var MAX_DRAW_BUFFERS: GLenum { 0x8824 } - static var DRAW_BUFFER0: GLenum { 0x8825 } + @inlinable static var DRAW_BUFFER0: GLenum { 0x8825 } - static var DRAW_BUFFER1: GLenum { 0x8826 } + @inlinable static var DRAW_BUFFER1: GLenum { 0x8826 } - static var DRAW_BUFFER2: GLenum { 0x8827 } + @inlinable static var DRAW_BUFFER2: GLenum { 0x8827 } - static var DRAW_BUFFER3: GLenum { 0x8828 } + @inlinable static var DRAW_BUFFER3: GLenum { 0x8828 } - static var DRAW_BUFFER4: GLenum { 0x8829 } + @inlinable static var DRAW_BUFFER4: GLenum { 0x8829 } - static var DRAW_BUFFER5: GLenum { 0x882A } + @inlinable static var DRAW_BUFFER5: GLenum { 0x882A } - static var DRAW_BUFFER6: GLenum { 0x882B } + @inlinable static var DRAW_BUFFER6: GLenum { 0x882B } - static var DRAW_BUFFER7: GLenum { 0x882C } + @inlinable static var DRAW_BUFFER7: GLenum { 0x882C } - static var DRAW_BUFFER8: GLenum { 0x882D } + @inlinable static var DRAW_BUFFER8: GLenum { 0x882D } - static var DRAW_BUFFER9: GLenum { 0x882E } + @inlinable static var DRAW_BUFFER9: GLenum { 0x882E } - static var DRAW_BUFFER10: GLenum { 0x882F } + @inlinable static var DRAW_BUFFER10: GLenum { 0x882F } - static var DRAW_BUFFER11: GLenum { 0x8830 } + @inlinable static var DRAW_BUFFER11: GLenum { 0x8830 } - static var DRAW_BUFFER12: GLenum { 0x8831 } + @inlinable static var DRAW_BUFFER12: GLenum { 0x8831 } - static var DRAW_BUFFER13: GLenum { 0x8832 } + @inlinable static var DRAW_BUFFER13: GLenum { 0x8832 } - static var DRAW_BUFFER14: GLenum { 0x8833 } + @inlinable static var DRAW_BUFFER14: GLenum { 0x8833 } - static var DRAW_BUFFER15: GLenum { 0x8834 } + @inlinable static var DRAW_BUFFER15: GLenum { 0x8834 } - static var MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8B49 } + @inlinable static var MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8B49 } - static var MAX_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8B4A } + @inlinable static var MAX_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8B4A } - static var SAMPLER_3D: GLenum { 0x8B5F } + @inlinable static var SAMPLER_3D: GLenum { 0x8B5F } - static var SAMPLER_2D_SHADOW: GLenum { 0x8B62 } + @inlinable static var SAMPLER_2D_SHADOW: GLenum { 0x8B62 } - static var FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum { 0x8B8B } + @inlinable static var FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum { 0x8B8B } - static var PIXEL_PACK_BUFFER: GLenum { 0x88EB } + @inlinable static var PIXEL_PACK_BUFFER: GLenum { 0x88EB } - static var PIXEL_UNPACK_BUFFER: GLenum { 0x88EC } + @inlinable static var PIXEL_UNPACK_BUFFER: GLenum { 0x88EC } - static var PIXEL_PACK_BUFFER_BINDING: GLenum { 0x88ED } + @inlinable static var PIXEL_PACK_BUFFER_BINDING: GLenum { 0x88ED } - static var PIXEL_UNPACK_BUFFER_BINDING: GLenum { 0x88EF } + @inlinable static var PIXEL_UNPACK_BUFFER_BINDING: GLenum { 0x88EF } - static var FLOAT_MAT2x3: GLenum { 0x8B65 } + @inlinable static var FLOAT_MAT2x3: GLenum { 0x8B65 } - static var FLOAT_MAT2x4: GLenum { 0x8B66 } + @inlinable static var FLOAT_MAT2x4: GLenum { 0x8B66 } - static var FLOAT_MAT3x2: GLenum { 0x8B67 } + @inlinable static var FLOAT_MAT3x2: GLenum { 0x8B67 } - static var FLOAT_MAT3x4: GLenum { 0x8B68 } + @inlinable static var FLOAT_MAT3x4: GLenum { 0x8B68 } - static var FLOAT_MAT4x2: GLenum { 0x8B69 } + @inlinable static var FLOAT_MAT4x2: GLenum { 0x8B69 } - static var FLOAT_MAT4x3: GLenum { 0x8B6A } + @inlinable static var FLOAT_MAT4x3: GLenum { 0x8B6A } - static var SRGB: GLenum { 0x8C40 } + @inlinable static var SRGB: GLenum { 0x8C40 } - static var SRGB8: GLenum { 0x8C41 } + @inlinable static var SRGB8: GLenum { 0x8C41 } - static var SRGB8_ALPHA8: GLenum { 0x8C43 } + @inlinable static var SRGB8_ALPHA8: GLenum { 0x8C43 } - static var COMPARE_REF_TO_TEXTURE: GLenum { 0x884E } + @inlinable static var COMPARE_REF_TO_TEXTURE: GLenum { 0x884E } - static var RGBA32F: GLenum { 0x8814 } + @inlinable static var RGBA32F: GLenum { 0x8814 } - static var RGB32F: GLenum { 0x8815 } + @inlinable static var RGB32F: GLenum { 0x8815 } - static var RGBA16F: GLenum { 0x881A } + @inlinable static var RGBA16F: GLenum { 0x881A } - static var RGB16F: GLenum { 0x881B } + @inlinable static var RGB16F: GLenum { 0x881B } - static var VERTEX_ATTRIB_ARRAY_INTEGER: GLenum { 0x88FD } + @inlinable static var VERTEX_ATTRIB_ARRAY_INTEGER: GLenum { 0x88FD } - static var MAX_ARRAY_TEXTURE_LAYERS: GLenum { 0x88FF } + @inlinable static var MAX_ARRAY_TEXTURE_LAYERS: GLenum { 0x88FF } - static var MIN_PROGRAM_TEXEL_OFFSET: GLenum { 0x8904 } + @inlinable static var MIN_PROGRAM_TEXEL_OFFSET: GLenum { 0x8904 } - static var MAX_PROGRAM_TEXEL_OFFSET: GLenum { 0x8905 } + @inlinable static var MAX_PROGRAM_TEXEL_OFFSET: GLenum { 0x8905 } - static var MAX_VARYING_COMPONENTS: GLenum { 0x8B4B } + @inlinable static var MAX_VARYING_COMPONENTS: GLenum { 0x8B4B } - static var TEXTURE_2D_ARRAY: GLenum { 0x8C1A } + @inlinable static var TEXTURE_2D_ARRAY: GLenum { 0x8C1A } - static var TEXTURE_BINDING_2D_ARRAY: GLenum { 0x8C1D } + @inlinable static var TEXTURE_BINDING_2D_ARRAY: GLenum { 0x8C1D } - static var R11F_G11F_B10F: GLenum { 0x8C3A } + @inlinable static var R11F_G11F_B10F: GLenum { 0x8C3A } - static var UNSIGNED_INT_10F_11F_11F_REV: GLenum { 0x8C3B } + @inlinable static var UNSIGNED_INT_10F_11F_11F_REV: GLenum { 0x8C3B } - static var RGB9_E5: GLenum { 0x8C3D } + @inlinable static var RGB9_E5: GLenum { 0x8C3D } - static var UNSIGNED_INT_5_9_9_9_REV: GLenum { 0x8C3E } + @inlinable static var UNSIGNED_INT_5_9_9_9_REV: GLenum { 0x8C3E } - static var TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum { 0x8C7F } + @inlinable static var TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum { 0x8C7F } - static var MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum { 0x8C80 } + @inlinable static var MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum { 0x8C80 } - static var TRANSFORM_FEEDBACK_VARYINGS: GLenum { 0x8C83 } + @inlinable static var TRANSFORM_FEEDBACK_VARYINGS: GLenum { 0x8C83 } - static var TRANSFORM_FEEDBACK_BUFFER_START: GLenum { 0x8C84 } + @inlinable static var TRANSFORM_FEEDBACK_BUFFER_START: GLenum { 0x8C84 } - static var TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum { 0x8C85 } + @inlinable static var TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum { 0x8C85 } - static var TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum { 0x8C88 } + @inlinable static var TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum { 0x8C88 } - static var RASTERIZER_DISCARD: GLenum { 0x8C89 } + @inlinable static var RASTERIZER_DISCARD: GLenum { 0x8C89 } - static var MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum { 0x8C8A } + @inlinable static var MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum { 0x8C8A } - static var MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum { 0x8C8B } + @inlinable static var MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum { 0x8C8B } - static var INTERLEAVED_ATTRIBS: GLenum { 0x8C8C } + @inlinable static var INTERLEAVED_ATTRIBS: GLenum { 0x8C8C } - static var SEPARATE_ATTRIBS: GLenum { 0x8C8D } + @inlinable static var SEPARATE_ATTRIBS: GLenum { 0x8C8D } - static var TRANSFORM_FEEDBACK_BUFFER: GLenum { 0x8C8E } + @inlinable static var TRANSFORM_FEEDBACK_BUFFER: GLenum { 0x8C8E } - static var TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum { 0x8C8F } + @inlinable static var TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum { 0x8C8F } - static var RGBA32UI: GLenum { 0x8D70 } + @inlinable static var RGBA32UI: GLenum { 0x8D70 } - static var RGB32UI: GLenum { 0x8D71 } + @inlinable static var RGB32UI: GLenum { 0x8D71 } - static var RGBA16UI: GLenum { 0x8D76 } + @inlinable static var RGBA16UI: GLenum { 0x8D76 } - static var RGB16UI: GLenum { 0x8D77 } + @inlinable static var RGB16UI: GLenum { 0x8D77 } - static var RGBA8UI: GLenum { 0x8D7C } + @inlinable static var RGBA8UI: GLenum { 0x8D7C } - static var RGB8UI: GLenum { 0x8D7D } + @inlinable static var RGB8UI: GLenum { 0x8D7D } - static var RGBA32I: GLenum { 0x8D82 } + @inlinable static var RGBA32I: GLenum { 0x8D82 } - static var RGB32I: GLenum { 0x8D83 } + @inlinable static var RGB32I: GLenum { 0x8D83 } - static var RGBA16I: GLenum { 0x8D88 } + @inlinable static var RGBA16I: GLenum { 0x8D88 } - static var RGB16I: GLenum { 0x8D89 } + @inlinable static var RGB16I: GLenum { 0x8D89 } - static var RGBA8I: GLenum { 0x8D8E } + @inlinable static var RGBA8I: GLenum { 0x8D8E } - static var RGB8I: GLenum { 0x8D8F } + @inlinable static var RGB8I: GLenum { 0x8D8F } - static var RED_INTEGER: GLenum { 0x8D94 } + @inlinable static var RED_INTEGER: GLenum { 0x8D94 } - static var RGB_INTEGER: GLenum { 0x8D98 } + @inlinable static var RGB_INTEGER: GLenum { 0x8D98 } - static var RGBA_INTEGER: GLenum { 0x8D99 } + @inlinable static var RGBA_INTEGER: GLenum { 0x8D99 } - static var SAMPLER_2D_ARRAY: GLenum { 0x8DC1 } + @inlinable static var SAMPLER_2D_ARRAY: GLenum { 0x8DC1 } - static var SAMPLER_2D_ARRAY_SHADOW: GLenum { 0x8DC4 } + @inlinable static var SAMPLER_2D_ARRAY_SHADOW: GLenum { 0x8DC4 } - static var SAMPLER_CUBE_SHADOW: GLenum { 0x8DC5 } + @inlinable static var SAMPLER_CUBE_SHADOW: GLenum { 0x8DC5 } - static var UNSIGNED_INT_VEC2: GLenum { 0x8DC6 } + @inlinable static var UNSIGNED_INT_VEC2: GLenum { 0x8DC6 } - static var UNSIGNED_INT_VEC3: GLenum { 0x8DC7 } + @inlinable static var UNSIGNED_INT_VEC3: GLenum { 0x8DC7 } - static var UNSIGNED_INT_VEC4: GLenum { 0x8DC8 } + @inlinable static var UNSIGNED_INT_VEC4: GLenum { 0x8DC8 } - static var INT_SAMPLER_2D: GLenum { 0x8DCA } + @inlinable static var INT_SAMPLER_2D: GLenum { 0x8DCA } - static var INT_SAMPLER_3D: GLenum { 0x8DCB } + @inlinable static var INT_SAMPLER_3D: GLenum { 0x8DCB } - static var INT_SAMPLER_CUBE: GLenum { 0x8DCC } + @inlinable static var INT_SAMPLER_CUBE: GLenum { 0x8DCC } - static var INT_SAMPLER_2D_ARRAY: GLenum { 0x8DCF } + @inlinable static var INT_SAMPLER_2D_ARRAY: GLenum { 0x8DCF } - static var UNSIGNED_INT_SAMPLER_2D: GLenum { 0x8DD2 } + @inlinable static var UNSIGNED_INT_SAMPLER_2D: GLenum { 0x8DD2 } - static var UNSIGNED_INT_SAMPLER_3D: GLenum { 0x8DD3 } + @inlinable static var UNSIGNED_INT_SAMPLER_3D: GLenum { 0x8DD3 } - static var UNSIGNED_INT_SAMPLER_CUBE: GLenum { 0x8DD4 } + @inlinable static var UNSIGNED_INT_SAMPLER_CUBE: GLenum { 0x8DD4 } - static var UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum { 0x8DD7 } + @inlinable static var UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum { 0x8DD7 } - static var DEPTH_COMPONENT32F: GLenum { 0x8CAC } + @inlinable static var DEPTH_COMPONENT32F: GLenum { 0x8CAC } - static var DEPTH32F_STENCIL8: GLenum { 0x8CAD } + @inlinable static var DEPTH32F_STENCIL8: GLenum { 0x8CAD } - static var FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum { 0x8DAD } + @inlinable static var FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum { 0x8DAD } - static var FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum { 0x8210 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum { 0x8210 } - static var FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum { 0x8211 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum { 0x8211 } - static var FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum { 0x8212 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum { 0x8212 } - static var FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum { 0x8213 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum { 0x8213 } - static var FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum { 0x8214 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum { 0x8214 } - static var FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum { 0x8215 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum { 0x8215 } - static var FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum { 0x8216 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum { 0x8216 } - static var FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum { 0x8217 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum { 0x8217 } - static var FRAMEBUFFER_DEFAULT: GLenum { 0x8218 } + @inlinable static var FRAMEBUFFER_DEFAULT: GLenum { 0x8218 } - static var UNSIGNED_INT_24_8: GLenum { 0x84FA } + @inlinable static var UNSIGNED_INT_24_8: GLenum { 0x84FA } - static var DEPTH24_STENCIL8: GLenum { 0x88F0 } + @inlinable static var DEPTH24_STENCIL8: GLenum { 0x88F0 } - static var UNSIGNED_NORMALIZED: GLenum { 0x8C17 } + @inlinable static var UNSIGNED_NORMALIZED: GLenum { 0x8C17 } - static var DRAW_FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } + @inlinable static var DRAW_FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } - static var READ_FRAMEBUFFER: GLenum { 0x8CA8 } + @inlinable static var READ_FRAMEBUFFER: GLenum { 0x8CA8 } - static var DRAW_FRAMEBUFFER: GLenum { 0x8CA9 } + @inlinable static var DRAW_FRAMEBUFFER: GLenum { 0x8CA9 } - static var READ_FRAMEBUFFER_BINDING: GLenum { 0x8CAA } + @inlinable static var READ_FRAMEBUFFER_BINDING: GLenum { 0x8CAA } - static var RENDERBUFFER_SAMPLES: GLenum { 0x8CAB } + @inlinable static var RENDERBUFFER_SAMPLES: GLenum { 0x8CAB } - static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum { 0x8CD4 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum { 0x8CD4 } - static var MAX_COLOR_ATTACHMENTS: GLenum { 0x8CDF } + @inlinable static var MAX_COLOR_ATTACHMENTS: GLenum { 0x8CDF } - static var COLOR_ATTACHMENT1: GLenum { 0x8CE1 } + @inlinable static var COLOR_ATTACHMENT1: GLenum { 0x8CE1 } - static var COLOR_ATTACHMENT2: GLenum { 0x8CE2 } + @inlinable static var COLOR_ATTACHMENT2: GLenum { 0x8CE2 } - static var COLOR_ATTACHMENT3: GLenum { 0x8CE3 } + @inlinable static var COLOR_ATTACHMENT3: GLenum { 0x8CE3 } - static var COLOR_ATTACHMENT4: GLenum { 0x8CE4 } + @inlinable static var COLOR_ATTACHMENT4: GLenum { 0x8CE4 } - static var COLOR_ATTACHMENT5: GLenum { 0x8CE5 } + @inlinable static var COLOR_ATTACHMENT5: GLenum { 0x8CE5 } - static var COLOR_ATTACHMENT6: GLenum { 0x8CE6 } + @inlinable static var COLOR_ATTACHMENT6: GLenum { 0x8CE6 } - static var COLOR_ATTACHMENT7: GLenum { 0x8CE7 } + @inlinable static var COLOR_ATTACHMENT7: GLenum { 0x8CE7 } - static var COLOR_ATTACHMENT8: GLenum { 0x8CE8 } + @inlinable static var COLOR_ATTACHMENT8: GLenum { 0x8CE8 } - static var COLOR_ATTACHMENT9: GLenum { 0x8CE9 } + @inlinable static var COLOR_ATTACHMENT9: GLenum { 0x8CE9 } - static var COLOR_ATTACHMENT10: GLenum { 0x8CEA } + @inlinable static var COLOR_ATTACHMENT10: GLenum { 0x8CEA } - static var COLOR_ATTACHMENT11: GLenum { 0x8CEB } + @inlinable static var COLOR_ATTACHMENT11: GLenum { 0x8CEB } - static var COLOR_ATTACHMENT12: GLenum { 0x8CEC } + @inlinable static var COLOR_ATTACHMENT12: GLenum { 0x8CEC } - static var COLOR_ATTACHMENT13: GLenum { 0x8CED } + @inlinable static var COLOR_ATTACHMENT13: GLenum { 0x8CED } - static var COLOR_ATTACHMENT14: GLenum { 0x8CEE } + @inlinable static var COLOR_ATTACHMENT14: GLenum { 0x8CEE } - static var COLOR_ATTACHMENT15: GLenum { 0x8CEF } + @inlinable static var COLOR_ATTACHMENT15: GLenum { 0x8CEF } - static var FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum { 0x8D56 } + @inlinable static var FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum { 0x8D56 } - static var MAX_SAMPLES: GLenum { 0x8D57 } + @inlinable static var MAX_SAMPLES: GLenum { 0x8D57 } - static var HALF_FLOAT: GLenum { 0x140B } + @inlinable static var HALF_FLOAT: GLenum { 0x140B } - static var RG: GLenum { 0x8227 } + @inlinable static var RG: GLenum { 0x8227 } - static var RG_INTEGER: GLenum { 0x8228 } + @inlinable static var RG_INTEGER: GLenum { 0x8228 } - static var R8: GLenum { 0x8229 } + @inlinable static var R8: GLenum { 0x8229 } - static var RG8: GLenum { 0x822B } + @inlinable static var RG8: GLenum { 0x822B } - static var R16F: GLenum { 0x822D } + @inlinable static var R16F: GLenum { 0x822D } - static var R32F: GLenum { 0x822E } + @inlinable static var R32F: GLenum { 0x822E } - static var RG16F: GLenum { 0x822F } + @inlinable static var RG16F: GLenum { 0x822F } - static var RG32F: GLenum { 0x8230 } + @inlinable static var RG32F: GLenum { 0x8230 } - static var R8I: GLenum { 0x8231 } + @inlinable static var R8I: GLenum { 0x8231 } - static var R8UI: GLenum { 0x8232 } + @inlinable static var R8UI: GLenum { 0x8232 } - static var R16I: GLenum { 0x8233 } + @inlinable static var R16I: GLenum { 0x8233 } - static var R16UI: GLenum { 0x8234 } + @inlinable static var R16UI: GLenum { 0x8234 } - static var R32I: GLenum { 0x8235 } + @inlinable static var R32I: GLenum { 0x8235 } - static var R32UI: GLenum { 0x8236 } + @inlinable static var R32UI: GLenum { 0x8236 } - static var RG8I: GLenum { 0x8237 } + @inlinable static var RG8I: GLenum { 0x8237 } - static var RG8UI: GLenum { 0x8238 } + @inlinable static var RG8UI: GLenum { 0x8238 } - static var RG16I: GLenum { 0x8239 } + @inlinable static var RG16I: GLenum { 0x8239 } - static var RG16UI: GLenum { 0x823A } + @inlinable static var RG16UI: GLenum { 0x823A } - static var RG32I: GLenum { 0x823B } + @inlinable static var RG32I: GLenum { 0x823B } - static var RG32UI: GLenum { 0x823C } + @inlinable static var RG32UI: GLenum { 0x823C } - static var VERTEX_ARRAY_BINDING: GLenum { 0x85B5 } + @inlinable static var VERTEX_ARRAY_BINDING: GLenum { 0x85B5 } - static var R8_SNORM: GLenum { 0x8F94 } + @inlinable static var R8_SNORM: GLenum { 0x8F94 } - static var RG8_SNORM: GLenum { 0x8F95 } + @inlinable static var RG8_SNORM: GLenum { 0x8F95 } - static var RGB8_SNORM: GLenum { 0x8F96 } + @inlinable static var RGB8_SNORM: GLenum { 0x8F96 } - static var RGBA8_SNORM: GLenum { 0x8F97 } + @inlinable static var RGBA8_SNORM: GLenum { 0x8F97 } - static var SIGNED_NORMALIZED: GLenum { 0x8F9C } + @inlinable static var SIGNED_NORMALIZED: GLenum { 0x8F9C } - static var COPY_READ_BUFFER: GLenum { 0x8F36 } + @inlinable static var COPY_READ_BUFFER: GLenum { 0x8F36 } - static var COPY_WRITE_BUFFER: GLenum { 0x8F37 } + @inlinable static var COPY_WRITE_BUFFER: GLenum { 0x8F37 } - static var COPY_READ_BUFFER_BINDING: GLenum { 0x8F36 } + @inlinable static var COPY_READ_BUFFER_BINDING: GLenum { 0x8F36 } - static var COPY_WRITE_BUFFER_BINDING: GLenum { 0x8F37 } + @inlinable static var COPY_WRITE_BUFFER_BINDING: GLenum { 0x8F37 } - static var UNIFORM_BUFFER: GLenum { 0x8A11 } + @inlinable static var UNIFORM_BUFFER: GLenum { 0x8A11 } - static var UNIFORM_BUFFER_BINDING: GLenum { 0x8A28 } + @inlinable static var UNIFORM_BUFFER_BINDING: GLenum { 0x8A28 } - static var UNIFORM_BUFFER_START: GLenum { 0x8A29 } + @inlinable static var UNIFORM_BUFFER_START: GLenum { 0x8A29 } - static var UNIFORM_BUFFER_SIZE: GLenum { 0x8A2A } + @inlinable static var UNIFORM_BUFFER_SIZE: GLenum { 0x8A2A } - static var MAX_VERTEX_UNIFORM_BLOCKS: GLenum { 0x8A2B } + @inlinable static var MAX_VERTEX_UNIFORM_BLOCKS: GLenum { 0x8A2B } - static var MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum { 0x8A2D } + @inlinable static var MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum { 0x8A2D } - static var MAX_COMBINED_UNIFORM_BLOCKS: GLenum { 0x8A2E } + @inlinable static var MAX_COMBINED_UNIFORM_BLOCKS: GLenum { 0x8A2E } - static var MAX_UNIFORM_BUFFER_BINDINGS: GLenum { 0x8A2F } + @inlinable static var MAX_UNIFORM_BUFFER_BINDINGS: GLenum { 0x8A2F } - static var MAX_UNIFORM_BLOCK_SIZE: GLenum { 0x8A30 } + @inlinable static var MAX_UNIFORM_BLOCK_SIZE: GLenum { 0x8A30 } - static var MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8A31 } + @inlinable static var MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8A31 } - static var MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8A33 } + @inlinable static var MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8A33 } - static var UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum { 0x8A34 } + @inlinable static var UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum { 0x8A34 } - static var ACTIVE_UNIFORM_BLOCKS: GLenum { 0x8A36 } + @inlinable static var ACTIVE_UNIFORM_BLOCKS: GLenum { 0x8A36 } - static var UNIFORM_TYPE: GLenum { 0x8A37 } + @inlinable static var UNIFORM_TYPE: GLenum { 0x8A37 } - static var UNIFORM_SIZE: GLenum { 0x8A38 } + @inlinable static var UNIFORM_SIZE: GLenum { 0x8A38 } - static var UNIFORM_BLOCK_INDEX: GLenum { 0x8A3A } + @inlinable static var UNIFORM_BLOCK_INDEX: GLenum { 0x8A3A } - static var UNIFORM_OFFSET: GLenum { 0x8A3B } + @inlinable static var UNIFORM_OFFSET: GLenum { 0x8A3B } - static var UNIFORM_ARRAY_STRIDE: GLenum { 0x8A3C } + @inlinable static var UNIFORM_ARRAY_STRIDE: GLenum { 0x8A3C } - static var UNIFORM_MATRIX_STRIDE: GLenum { 0x8A3D } + @inlinable static var UNIFORM_MATRIX_STRIDE: GLenum { 0x8A3D } - static var UNIFORM_IS_ROW_MAJOR: GLenum { 0x8A3E } + @inlinable static var UNIFORM_IS_ROW_MAJOR: GLenum { 0x8A3E } - static var UNIFORM_BLOCK_BINDING: GLenum { 0x8A3F } + @inlinable static var UNIFORM_BLOCK_BINDING: GLenum { 0x8A3F } - static var UNIFORM_BLOCK_DATA_SIZE: GLenum { 0x8A40 } + @inlinable static var UNIFORM_BLOCK_DATA_SIZE: GLenum { 0x8A40 } - static var UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum { 0x8A42 } + @inlinable static var UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum { 0x8A42 } - static var UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum { 0x8A43 } + @inlinable static var UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum { 0x8A43 } - static var UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum { 0x8A44 } + @inlinable static var UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum { 0x8A44 } - static var UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum { 0x8A46 } + @inlinable static var UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum { 0x8A46 } - static var INVALID_INDEX: GLenum { 0xFFFF_FFFF } + @inlinable static var INVALID_INDEX: GLenum { 0xFFFF_FFFF } - static var MAX_VERTEX_OUTPUT_COMPONENTS: GLenum { 0x9122 } + @inlinable static var MAX_VERTEX_OUTPUT_COMPONENTS: GLenum { 0x9122 } - static var MAX_FRAGMENT_INPUT_COMPONENTS: GLenum { 0x9125 } + @inlinable static var MAX_FRAGMENT_INPUT_COMPONENTS: GLenum { 0x9125 } - static var MAX_SERVER_WAIT_TIMEOUT: GLenum { 0x9111 } + @inlinable static var MAX_SERVER_WAIT_TIMEOUT: GLenum { 0x9111 } - static var OBJECT_TYPE: GLenum { 0x9112 } + @inlinable static var OBJECT_TYPE: GLenum { 0x9112 } - static var SYNC_CONDITION: GLenum { 0x9113 } + @inlinable static var SYNC_CONDITION: GLenum { 0x9113 } - static var SYNC_STATUS: GLenum { 0x9114 } + @inlinable static var SYNC_STATUS: GLenum { 0x9114 } - static var SYNC_FLAGS: GLenum { 0x9115 } + @inlinable static var SYNC_FLAGS: GLenum { 0x9115 } - static var SYNC_FENCE: GLenum { 0x9116 } + @inlinable static var SYNC_FENCE: GLenum { 0x9116 } - static var SYNC_GPU_COMMANDS_COMPLETE: GLenum { 0x9117 } + @inlinable static var SYNC_GPU_COMMANDS_COMPLETE: GLenum { 0x9117 } - static var UNSIGNALED: GLenum { 0x9118 } + @inlinable static var UNSIGNALED: GLenum { 0x9118 } - static var SIGNALED: GLenum { 0x9119 } + @inlinable static var SIGNALED: GLenum { 0x9119 } - static var ALREADY_SIGNALED: GLenum { 0x911A } + @inlinable static var ALREADY_SIGNALED: GLenum { 0x911A } - static var TIMEOUT_EXPIRED: GLenum { 0x911B } + @inlinable static var TIMEOUT_EXPIRED: GLenum { 0x911B } - static var CONDITION_SATISFIED: GLenum { 0x911C } + @inlinable static var CONDITION_SATISFIED: GLenum { 0x911C } - static var WAIT_FAILED: GLenum { 0x911D } + @inlinable static var WAIT_FAILED: GLenum { 0x911D } - static var SYNC_FLUSH_COMMANDS_BIT: GLenum { 0x0000_0001 } + @inlinable static var SYNC_FLUSH_COMMANDS_BIT: GLenum { 0x0000_0001 } - static var VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum { 0x88FE } + @inlinable static var VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum { 0x88FE } - static var ANY_SAMPLES_PASSED: GLenum { 0x8C2F } + @inlinable static var ANY_SAMPLES_PASSED: GLenum { 0x8C2F } - static var ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum { 0x8D6A } + @inlinable static var ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum { 0x8D6A } - static var SAMPLER_BINDING: GLenum { 0x8919 } + @inlinable static var SAMPLER_BINDING: GLenum { 0x8919 } - static var RGB10_A2UI: GLenum { 0x906F } + @inlinable static var RGB10_A2UI: GLenum { 0x906F } - static var INT_2_10_10_10_REV: GLenum { 0x8D9F } + @inlinable static var INT_2_10_10_10_REV: GLenum { 0x8D9F } - static var TRANSFORM_FEEDBACK: GLenum { 0x8E22 } + @inlinable static var TRANSFORM_FEEDBACK: GLenum { 0x8E22 } - static var TRANSFORM_FEEDBACK_PAUSED: GLenum { 0x8E23 } + @inlinable static var TRANSFORM_FEEDBACK_PAUSED: GLenum { 0x8E23 } - static var TRANSFORM_FEEDBACK_ACTIVE: GLenum { 0x8E24 } + @inlinable static var TRANSFORM_FEEDBACK_ACTIVE: GLenum { 0x8E24 } - static var TRANSFORM_FEEDBACK_BINDING: GLenum { 0x8E25 } + @inlinable static var TRANSFORM_FEEDBACK_BINDING: GLenum { 0x8E25 } - static var TEXTURE_IMMUTABLE_FORMAT: GLenum { 0x912F } + @inlinable static var TEXTURE_IMMUTABLE_FORMAT: GLenum { 0x912F } - static var MAX_ELEMENT_INDEX: GLenum { 0x8D6B } + @inlinable static var MAX_ELEMENT_INDEX: GLenum { 0x8D6B } - static var TEXTURE_IMMUTABLE_LEVELS: GLenum { 0x82DF } + @inlinable static var TEXTURE_IMMUTABLE_LEVELS: GLenum { 0x82DF } - static var TIMEOUT_IGNORED: GLint64 { -1 } + @inlinable static var TIMEOUT_IGNORED: GLint64 { -1 } - static var MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum { 0x9247 } + @inlinable static var MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum { 0x9247 } - func copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) { + @inlinable func copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) { let this = jsObject _ = this[Strings.copyBufferSubData].function!(this: this, arguments: [readTarget.jsValue(), writeTarget.jsValue(), readOffset.jsValue(), writeOffset.jsValue(), size.jsValue()]) } - func getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset: GLuint? = nil, length: GLuint? = nil) { + @inlinable func getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset: GLuint? = nil, length: GLuint? = nil) { let this = jsObject _ = this[Strings.getBufferSubData].function!(this: this, arguments: [target.jsValue(), srcByteOffset.jsValue(), dstBuffer.jsValue(), dstOffset?.jsValue() ?? .undefined, length?.jsValue() ?? .undefined]) } - func blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum) { + @inlinable func blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum) { let _arg0 = srcX0.jsValue() let _arg1 = srcY0.jsValue() let _arg2 = srcX1.jsValue() @@ -556,17 +556,17 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.blitFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - func framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, layer: GLint) { + @inlinable func framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, layer: GLint) { let this = jsObject _ = this[Strings.framebufferTextureLayer].function!(this: this, arguments: [target.jsValue(), attachment.jsValue(), texture.jsValue(), level.jsValue(), layer.jsValue()]) } - func invalidateFramebuffer(target: GLenum, attachments: [GLenum]) { + @inlinable func invalidateFramebuffer(target: GLenum, attachments: [GLenum]) { let this = jsObject _ = this[Strings.invalidateFramebuffer].function!(this: this, arguments: [target.jsValue(), attachments.jsValue()]) } - func invalidateSubFramebuffer(target: GLenum, attachments: [GLenum], x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + @inlinable func invalidateSubFramebuffer(target: GLenum, attachments: [GLenum], x: GLint, y: GLint, width: GLsizei, height: GLsizei) { let _arg0 = target.jsValue() let _arg1 = attachments.jsValue() let _arg2 = x.jsValue() @@ -577,27 +577,27 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.invalidateSubFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func readBuffer(src: GLenum) { + @inlinable func readBuffer(src: GLenum) { let this = jsObject _ = this[Strings.readBuffer].function!(this: this, arguments: [src.jsValue()]) } - func getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum) -> JSValue { + @inlinable func getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getInternalformatParameter].function!(this: this, arguments: [target.jsValue(), internalformat.jsValue(), pname.jsValue()]).fromJSValue()! } - func renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { + @inlinable func renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { let this = jsObject _ = this[Strings.renderbufferStorageMultisample].function!(this: this, arguments: [target.jsValue(), samples.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()]) } - func texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { + @inlinable func texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { let this = jsObject _ = this[Strings.texStorage2D].function!(this: this, arguments: [target.jsValue(), levels.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()]) } - func texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) { + @inlinable func texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) { let _arg0 = target.jsValue() let _arg1 = levels.jsValue() let _arg2 = internalformat.jsValue() @@ -608,7 +608,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.texStorage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { + @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -623,7 +623,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -638,7 +638,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView?) { + @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView?) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -653,7 +653,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { + @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -669,7 +669,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } - func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { + @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -685,7 +685,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } - func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { + @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -701,7 +701,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } - func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView?, srcOffset: GLuint? = nil) { + @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView?, srcOffset: GLuint? = nil) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -718,7 +718,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) } - func copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + @inlinable func copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -732,7 +732,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.copyTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { + @inlinable func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -746,7 +746,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + @inlinable func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -761,7 +761,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { + @inlinable func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -777,7 +777,7 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } - func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + @inlinable func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -794,122 +794,122 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) } - func getFragDataLocation(program: WebGLProgram, name: String) -> GLint { + @inlinable func getFragDataLocation(program: WebGLProgram, name: String) -> GLint { let this = jsObject return this[Strings.getFragDataLocation].function!(this: this, arguments: [program.jsValue(), name.jsValue()]).fromJSValue()! } - func uniform1ui(location: WebGLUniformLocation?, v0: GLuint) { + @inlinable func uniform1ui(location: WebGLUniformLocation?, v0: GLuint) { let this = jsObject _ = this[Strings.uniform1ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue()]) } - func uniform2ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint) { + @inlinable func uniform2ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint) { let this = jsObject _ = this[Strings.uniform2ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue(), v1.jsValue()]) } - func uniform3ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint) { + @inlinable func uniform3ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint) { let this = jsObject _ = this[Strings.uniform3ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue()]) } - func uniform4ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) { + @inlinable func uniform4ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) { let this = jsObject _ = this[Strings.uniform4ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue(), v3.jsValue()]) } - func uniform1uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform1uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform1uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform2uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform2uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform2uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform3uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform3uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform3uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform4uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform4uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform4uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniformMatrix3x2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniformMatrix4x2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniformMatrix2x3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniformMatrix4x3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniformMatrix2x4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniformMatrix3x4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) { + @inlinable func vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) { let this = jsObject _ = this[Strings.vertexAttribI4i].function!(this: this, arguments: [index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()]) } - func vertexAttribI4iv(index: GLuint, values: Int32List) { + @inlinable func vertexAttribI4iv(index: GLuint, values: Int32List) { let this = jsObject _ = this[Strings.vertexAttribI4iv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } - func vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) { + @inlinable func vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) { let this = jsObject _ = this[Strings.vertexAttribI4ui].function!(this: this, arguments: [index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()]) } - func vertexAttribI4uiv(index: GLuint, values: Uint32List) { + @inlinable func vertexAttribI4uiv(index: GLuint, values: Uint32List) { let this = jsObject _ = this[Strings.vertexAttribI4uiv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } - func vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr) { + @inlinable func vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr) { let this = jsObject _ = this[Strings.vertexAttribIPointer].function!(this: this, arguments: [index.jsValue(), size.jsValue(), type.jsValue(), stride.jsValue(), offset.jsValue()]) } - func vertexAttribDivisor(index: GLuint, divisor: GLuint) { + @inlinable func vertexAttribDivisor(index: GLuint, divisor: GLuint) { let this = jsObject _ = this[Strings.vertexAttribDivisor].function!(this: this, arguments: [index.jsValue(), divisor.jsValue()]) } - func drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) { + @inlinable func drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) { let this = jsObject _ = this[Strings.drawArraysInstanced].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue()]) } - func drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) { + @inlinable func drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) { let this = jsObject _ = this[Strings.drawElementsInstanced].function!(this: this, arguments: [mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), instanceCount.jsValue()]) } - func drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr) { + @inlinable func drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr) { let _arg0 = mode.jsValue() let _arg1 = start.jsValue() let _arg2 = end.jsValue() @@ -920,242 +920,242 @@ public extension WebGL2RenderingContextBase { _ = this[Strings.drawRangeElements].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func drawBuffers(buffers: [GLenum]) { + @inlinable func drawBuffers(buffers: [GLenum]) { let this = jsObject _ = this[Strings.drawBuffers].function!(this: this, arguments: [buffers.jsValue()]) } - func clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset: GLuint? = nil) { + @inlinable func clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset: GLuint? = nil) { let this = jsObject _ = this[Strings.clearBufferfv].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined]) } - func clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset: GLuint? = nil) { + @inlinable func clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset: GLuint? = nil) { let this = jsObject _ = this[Strings.clearBufferiv].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined]) } - func clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset: GLuint? = nil) { + @inlinable func clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset: GLuint? = nil) { let this = jsObject _ = this[Strings.clearBufferuiv].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined]) } - func clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) { + @inlinable func clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) { let this = jsObject _ = this[Strings.clearBufferfi].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), depth.jsValue(), stencil.jsValue()]) } - func createQuery() -> WebGLQuery? { + @inlinable func createQuery() -> WebGLQuery? { let this = jsObject return this[Strings.createQuery].function!(this: this, arguments: []).fromJSValue()! } - func deleteQuery(query: WebGLQuery?) { + @inlinable func deleteQuery(query: WebGLQuery?) { let this = jsObject _ = this[Strings.deleteQuery].function!(this: this, arguments: [query.jsValue()]) } - func isQuery(query: WebGLQuery?) -> GLboolean { + @inlinable func isQuery(query: WebGLQuery?) -> GLboolean { let this = jsObject return this[Strings.isQuery].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } - func beginQuery(target: GLenum, query: WebGLQuery) { + @inlinable func beginQuery(target: GLenum, query: WebGLQuery) { let this = jsObject _ = this[Strings.beginQuery].function!(this: this, arguments: [target.jsValue(), query.jsValue()]) } - func endQuery(target: GLenum) { + @inlinable func endQuery(target: GLenum) { let this = jsObject _ = this[Strings.endQuery].function!(this: this, arguments: [target.jsValue()]) } - func getQuery(target: GLenum, pname: GLenum) -> WebGLQuery? { + @inlinable func getQuery(target: GLenum, pname: GLenum) -> WebGLQuery? { let this = jsObject return this[Strings.getQuery].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } - func getQueryParameter(query: WebGLQuery, pname: GLenum) -> JSValue { + @inlinable func getQueryParameter(query: WebGLQuery, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getQueryParameter].function!(this: this, arguments: [query.jsValue(), pname.jsValue()]).fromJSValue()! } - func createSampler() -> WebGLSampler? { + @inlinable func createSampler() -> WebGLSampler? { let this = jsObject return this[Strings.createSampler].function!(this: this, arguments: []).fromJSValue()! } - func deleteSampler(sampler: WebGLSampler?) { + @inlinable func deleteSampler(sampler: WebGLSampler?) { let this = jsObject _ = this[Strings.deleteSampler].function!(this: this, arguments: [sampler.jsValue()]) } - func isSampler(sampler: WebGLSampler?) -> GLboolean { + @inlinable func isSampler(sampler: WebGLSampler?) -> GLboolean { let this = jsObject return this[Strings.isSampler].function!(this: this, arguments: [sampler.jsValue()]).fromJSValue()! } - func bindSampler(unit: GLuint, sampler: WebGLSampler?) { + @inlinable func bindSampler(unit: GLuint, sampler: WebGLSampler?) { let this = jsObject _ = this[Strings.bindSampler].function!(this: this, arguments: [unit.jsValue(), sampler.jsValue()]) } - func samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint) { + @inlinable func samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint) { let this = jsObject _ = this[Strings.samplerParameteri].function!(this: this, arguments: [sampler.jsValue(), pname.jsValue(), param.jsValue()]) } - func samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat) { + @inlinable func samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat) { let this = jsObject _ = this[Strings.samplerParameterf].function!(this: this, arguments: [sampler.jsValue(), pname.jsValue(), param.jsValue()]) } - func getSamplerParameter(sampler: WebGLSampler, pname: GLenum) -> JSValue { + @inlinable func getSamplerParameter(sampler: WebGLSampler, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getSamplerParameter].function!(this: this, arguments: [sampler.jsValue(), pname.jsValue()]).fromJSValue()! } - func fenceSync(condition: GLenum, flags: GLbitfield) -> WebGLSync? { + @inlinable func fenceSync(condition: GLenum, flags: GLbitfield) -> WebGLSync? { let this = jsObject return this[Strings.fenceSync].function!(this: this, arguments: [condition.jsValue(), flags.jsValue()]).fromJSValue()! } - func isSync(sync: WebGLSync?) -> GLboolean { + @inlinable func isSync(sync: WebGLSync?) -> GLboolean { let this = jsObject return this[Strings.isSync].function!(this: this, arguments: [sync.jsValue()]).fromJSValue()! } - func deleteSync(sync: WebGLSync?) { + @inlinable func deleteSync(sync: WebGLSync?) { let this = jsObject _ = this[Strings.deleteSync].function!(this: this, arguments: [sync.jsValue()]) } - func clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64) -> GLenum { + @inlinable func clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64) -> GLenum { let this = jsObject return this[Strings.clientWaitSync].function!(this: this, arguments: [sync.jsValue(), flags.jsValue(), timeout.jsValue()]).fromJSValue()! } - func waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64) { + @inlinable func waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64) { let this = jsObject _ = this[Strings.waitSync].function!(this: this, arguments: [sync.jsValue(), flags.jsValue(), timeout.jsValue()]) } - func getSyncParameter(sync: WebGLSync, pname: GLenum) -> JSValue { + @inlinable func getSyncParameter(sync: WebGLSync, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getSyncParameter].function!(this: this, arguments: [sync.jsValue(), pname.jsValue()]).fromJSValue()! } - func createTransformFeedback() -> WebGLTransformFeedback? { + @inlinable func createTransformFeedback() -> WebGLTransformFeedback? { let this = jsObject return this[Strings.createTransformFeedback].function!(this: this, arguments: []).fromJSValue()! } - func deleteTransformFeedback(tf: WebGLTransformFeedback?) { + @inlinable func deleteTransformFeedback(tf: WebGLTransformFeedback?) { let this = jsObject _ = this[Strings.deleteTransformFeedback].function!(this: this, arguments: [tf.jsValue()]) } - func isTransformFeedback(tf: WebGLTransformFeedback?) -> GLboolean { + @inlinable func isTransformFeedback(tf: WebGLTransformFeedback?) -> GLboolean { let this = jsObject return this[Strings.isTransformFeedback].function!(this: this, arguments: [tf.jsValue()]).fromJSValue()! } - func bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback?) { + @inlinable func bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback?) { let this = jsObject _ = this[Strings.bindTransformFeedback].function!(this: this, arguments: [target.jsValue(), tf.jsValue()]) } - func beginTransformFeedback(primitiveMode: GLenum) { + @inlinable func beginTransformFeedback(primitiveMode: GLenum) { let this = jsObject _ = this[Strings.beginTransformFeedback].function!(this: this, arguments: [primitiveMode.jsValue()]) } - func endTransformFeedback() { + @inlinable func endTransformFeedback() { let this = jsObject _ = this[Strings.endTransformFeedback].function!(this: this, arguments: []) } - func transformFeedbackVaryings(program: WebGLProgram, varyings: [String], bufferMode: GLenum) { + @inlinable func transformFeedbackVaryings(program: WebGLProgram, varyings: [String], bufferMode: GLenum) { let this = jsObject _ = this[Strings.transformFeedbackVaryings].function!(this: this, arguments: [program.jsValue(), varyings.jsValue(), bufferMode.jsValue()]) } - func getTransformFeedbackVarying(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + @inlinable func getTransformFeedbackVarying(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { let this = jsObject return this[Strings.getTransformFeedbackVarying].function!(this: this, arguments: [program.jsValue(), index.jsValue()]).fromJSValue()! } - func pauseTransformFeedback() { + @inlinable func pauseTransformFeedback() { let this = jsObject _ = this[Strings.pauseTransformFeedback].function!(this: this, arguments: []) } - func resumeTransformFeedback() { + @inlinable func resumeTransformFeedback() { let this = jsObject _ = this[Strings.resumeTransformFeedback].function!(this: this, arguments: []) } - func bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer?) { + @inlinable func bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer?) { let this = jsObject _ = this[Strings.bindBufferBase].function!(this: this, arguments: [target.jsValue(), index.jsValue(), buffer.jsValue()]) } - func bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer?, offset: GLintptr, size: GLsizeiptr) { + @inlinable func bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer?, offset: GLintptr, size: GLsizeiptr) { let this = jsObject _ = this[Strings.bindBufferRange].function!(this: this, arguments: [target.jsValue(), index.jsValue(), buffer.jsValue(), offset.jsValue(), size.jsValue()]) } - func getIndexedParameter(target: GLenum, index: GLuint) -> JSValue { + @inlinable func getIndexedParameter(target: GLenum, index: GLuint) -> JSValue { let this = jsObject return this[Strings.getIndexedParameter].function!(this: this, arguments: [target.jsValue(), index.jsValue()]).fromJSValue()! } - func getUniformIndices(program: WebGLProgram, uniformNames: [String]) -> [GLuint]? { + @inlinable func getUniformIndices(program: WebGLProgram, uniformNames: [String]) -> [GLuint]? { let this = jsObject return this[Strings.getUniformIndices].function!(this: this, arguments: [program.jsValue(), uniformNames.jsValue()]).fromJSValue()! } - func getActiveUniforms(program: WebGLProgram, uniformIndices: [GLuint], pname: GLenum) -> JSValue { + @inlinable func getActiveUniforms(program: WebGLProgram, uniformIndices: [GLuint], pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getActiveUniforms].function!(this: this, arguments: [program.jsValue(), uniformIndices.jsValue(), pname.jsValue()]).fromJSValue()! } - func getUniformBlockIndex(program: WebGLProgram, uniformBlockName: String) -> GLuint { + @inlinable func getUniformBlockIndex(program: WebGLProgram, uniformBlockName: String) -> GLuint { let this = jsObject return this[Strings.getUniformBlockIndex].function!(this: this, arguments: [program.jsValue(), uniformBlockName.jsValue()]).fromJSValue()! } - func getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum) -> JSValue { + @inlinable func getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getActiveUniformBlockParameter].function!(this: this, arguments: [program.jsValue(), uniformBlockIndex.jsValue(), pname.jsValue()]).fromJSValue()! } - func getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint) -> String? { + @inlinable func getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint) -> String? { let this = jsObject return this[Strings.getActiveUniformBlockName].function!(this: this, arguments: [program.jsValue(), uniformBlockIndex.jsValue()]).fromJSValue()! } - func uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint) { + @inlinable func uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint) { let this = jsObject _ = this[Strings.uniformBlockBinding].function!(this: this, arguments: [program.jsValue(), uniformBlockIndex.jsValue(), uniformBlockBinding.jsValue()]) } - func createVertexArray() -> WebGLVertexArrayObject? { + @inlinable func createVertexArray() -> WebGLVertexArrayObject? { let this = jsObject return this[Strings.createVertexArray].function!(this: this, arguments: []).fromJSValue()! } - func deleteVertexArray(vertexArray: WebGLVertexArrayObject?) { + @inlinable func deleteVertexArray(vertexArray: WebGLVertexArrayObject?) { let this = jsObject _ = this[Strings.deleteVertexArray].function!(this: this, arguments: [vertexArray.jsValue()]) } - func isVertexArray(vertexArray: WebGLVertexArrayObject?) -> GLboolean { + @inlinable func isVertexArray(vertexArray: WebGLVertexArrayObject?) -> GLboolean { let this = jsObject return this[Strings.isVertexArray].function!(this: this, arguments: [vertexArray.jsValue()]).fromJSValue()! } - func bindVertexArray(array: WebGLVertexArrayObject?) { + @inlinable func bindVertexArray(array: WebGLVertexArrayObject?) { let this = jsObject _ = this[Strings.bindVertexArray].function!(this: this, arguments: [array.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift index 7fae18a9..a7c45d86 100644 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift @@ -5,32 +5,32 @@ import JavaScriptKit public protocol WebGL2RenderingContextOverloads: JSBridgedClass {} public extension WebGL2RenderingContextOverloads { - func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { + @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()]) } - func bufferData(target: GLenum, srcData: BufferSource?, usage: GLenum) { + @inlinable func bufferData(target: GLenum, srcData: BufferSource?, usage: GLenum) { let this = jsObject _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue(), srcData.jsValue(), usage.jsValue()]) } - func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource) { + @inlinable func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource) { let this = jsObject _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue()]) } - func bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length: GLuint? = nil) { + @inlinable func bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length: GLuint? = nil) { let this = jsObject _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue(), srcData.jsValue(), usage.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined]) } - func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length: GLuint? = nil) { + @inlinable func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length: GLuint? = nil) { let this = jsObject _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined]) } - func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + @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() @@ -44,7 +44,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + @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() @@ -55,7 +55,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + @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() @@ -69,7 +69,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + @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() @@ -81,7 +81,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } - func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -95,7 +95,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -109,7 +109,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -124,7 +124,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -138,7 +138,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -152,7 +152,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -167,7 +167,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { + @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -180,7 +180,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } - func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = internalformat.jsValue() @@ -194,7 +194,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { + @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -208,7 +208,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { let _arg0 = target.jsValue() let _arg1 = level.jsValue() let _arg2 = xoffset.jsValue() @@ -223,62 +223,62 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - func uniform1fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform1fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform2fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform2fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform3fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform3fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform4fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform4fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform1iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform1iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform2iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform2iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform3iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform3iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniform4iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniform4iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + @inlinable func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) } - func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView?) { + @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView?) { let _arg0 = x.jsValue() let _arg1 = y.jsValue() let _arg2 = width.jsValue() @@ -290,7 +290,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } - func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr) { + @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr) { let _arg0 = x.jsValue() let _arg1 = y.jsValue() let _arg2 = width.jsValue() @@ -302,7 +302,7 @@ public extension WebGL2RenderingContextOverloads { _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } - func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint) { + @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint) { let _arg0 = x.jsValue() let _arg1 = y.jsValue() let _arg2 = width.jsValue() diff --git a/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift b/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift index 7be633a6..38991452 100644 --- a/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift +++ b/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLActiveInfo: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WebGLActiveInfo].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLActiveInfo].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WebGLBuffer.swift b/Sources/DOMKit/WebIDL/WebGLBuffer.swift index 43dcc746..c5217eb0 100644 --- a/Sources/DOMKit/WebIDL/WebGLBuffer.swift +++ b/Sources/DOMKit/WebIDL/WebGLBuffer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLBuffer: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLBuffer].function! } + @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/WebGLContextEvent.swift b/Sources/DOMKit/WebIDL/WebGLContextEvent.swift index ba5e89d6..94607fc7 100644 --- a/Sources/DOMKit/WebIDL/WebGLContextEvent.swift +++ b/Sources/DOMKit/WebIDL/WebGLContextEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLContextEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLContextEvent].function! } + @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) } - public convenience init(type: String, eventInit: WebGLContextEventInit? = nil) { + @inlinable public convenience init(type: String, eventInit: WebGLContextEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInit?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift b/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift index 5fe76b5f..83d1af39 100644 --- a/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift +++ b/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLFramebuffer: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLFramebuffer].function! } + @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 index 2257f5c5..c50d37fc 100644 --- a/Sources/DOMKit/WebIDL/WebGLObject.swift +++ b/Sources/DOMKit/WebIDL/WebGLObject.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLObject: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WebGLObject].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLObject].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift b/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift index ed882ccf..798d98c9 100644 --- a/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift +++ b/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift @@ -8,16 +8,16 @@ public enum WebGLPowerPreference: JSString, JSValueCompatible { case lowPower = "low-power" case highPerformance = "high-performance" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/WebGLProgram.swift b/Sources/DOMKit/WebIDL/WebGLProgram.swift index 2d4bdb31..e38d4a93 100644 --- a/Sources/DOMKit/WebIDL/WebGLProgram.swift +++ b/Sources/DOMKit/WebIDL/WebGLProgram.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLProgram: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLProgram].function! } + @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/WebGLQuery.swift b/Sources/DOMKit/WebIDL/WebGLQuery.swift index 94ee3dc9..901356e4 100644 --- a/Sources/DOMKit/WebIDL/WebGLQuery.swift +++ b/Sources/DOMKit/WebIDL/WebGLQuery.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLQuery: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLQuery].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLQuery].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 index b87c8c7f..3b364894 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLRenderbuffer: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderbuffer].function! } + @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 index 875e0c10..f9919cbe 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContext.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLRenderingContext: JSBridgedClass, WebGLRenderingContextBase, WebGLRenderingContextOverloads { - public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderingContext].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderingContext].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift index dc95a975..971208bc 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift @@ -5,720 +5,720 @@ import JavaScriptKit public protocol WebGLRenderingContextBase: JSBridgedClass {} public extension WebGLRenderingContextBase { - static var DEPTH_BUFFER_BIT: GLenum { 0x0000_0100 } + @inlinable static var DEPTH_BUFFER_BIT: GLenum { 0x0000_0100 } - static var STENCIL_BUFFER_BIT: GLenum { 0x0000_0400 } + @inlinable static var STENCIL_BUFFER_BIT: GLenum { 0x0000_0400 } - static var COLOR_BUFFER_BIT: GLenum { 0x0000_4000 } + @inlinable static var COLOR_BUFFER_BIT: GLenum { 0x0000_4000 } - static var POINTS: GLenum { 0x0000 } + @inlinable static var POINTS: GLenum { 0x0000 } - static var LINES: GLenum { 0x0001 } + @inlinable static var LINES: GLenum { 0x0001 } - static var LINE_LOOP: GLenum { 0x0002 } + @inlinable static var LINE_LOOP: GLenum { 0x0002 } - static var LINE_STRIP: GLenum { 0x0003 } + @inlinable static var LINE_STRIP: GLenum { 0x0003 } - static var TRIANGLES: GLenum { 0x0004 } + @inlinable static var TRIANGLES: GLenum { 0x0004 } - static var TRIANGLE_STRIP: GLenum { 0x0005 } + @inlinable static var TRIANGLE_STRIP: GLenum { 0x0005 } - static var TRIANGLE_FAN: GLenum { 0x0006 } + @inlinable static var TRIANGLE_FAN: GLenum { 0x0006 } - static var ZERO: GLenum { 0 } + @inlinable static var ZERO: GLenum { 0 } - static var ONE: GLenum { 1 } + @inlinable static var ONE: GLenum { 1 } - static var SRC_COLOR: GLenum { 0x0300 } + @inlinable static var SRC_COLOR: GLenum { 0x0300 } - static var ONE_MINUS_SRC_COLOR: GLenum { 0x0301 } + @inlinable static var ONE_MINUS_SRC_COLOR: GLenum { 0x0301 } - static var SRC_ALPHA: GLenum { 0x0302 } + @inlinable static var SRC_ALPHA: GLenum { 0x0302 } - static var ONE_MINUS_SRC_ALPHA: GLenum { 0x0303 } + @inlinable static var ONE_MINUS_SRC_ALPHA: GLenum { 0x0303 } - static var DST_ALPHA: GLenum { 0x0304 } + @inlinable static var DST_ALPHA: GLenum { 0x0304 } - static var ONE_MINUS_DST_ALPHA: GLenum { 0x0305 } + @inlinable static var ONE_MINUS_DST_ALPHA: GLenum { 0x0305 } - static var DST_COLOR: GLenum { 0x0306 } + @inlinable static var DST_COLOR: GLenum { 0x0306 } - static var ONE_MINUS_DST_COLOR: GLenum { 0x0307 } + @inlinable static var ONE_MINUS_DST_COLOR: GLenum { 0x0307 } - static var SRC_ALPHA_SATURATE: GLenum { 0x0308 } + @inlinable static var SRC_ALPHA_SATURATE: GLenum { 0x0308 } - static var FUNC_ADD: GLenum { 0x8006 } + @inlinable static var FUNC_ADD: GLenum { 0x8006 } - static var BLEND_EQUATION: GLenum { 0x8009 } + @inlinable static var BLEND_EQUATION: GLenum { 0x8009 } - static var BLEND_EQUATION_RGB: GLenum { 0x8009 } + @inlinable static var BLEND_EQUATION_RGB: GLenum { 0x8009 } - static var BLEND_EQUATION_ALPHA: GLenum { 0x883D } + @inlinable static var BLEND_EQUATION_ALPHA: GLenum { 0x883D } - static var FUNC_SUBTRACT: GLenum { 0x800A } + @inlinable static var FUNC_SUBTRACT: GLenum { 0x800A } - static var FUNC_REVERSE_SUBTRACT: GLenum { 0x800B } + @inlinable static var FUNC_REVERSE_SUBTRACT: GLenum { 0x800B } - static var BLEND_DST_RGB: GLenum { 0x80C8 } + @inlinable static var BLEND_DST_RGB: GLenum { 0x80C8 } - static var BLEND_SRC_RGB: GLenum { 0x80C9 } + @inlinable static var BLEND_SRC_RGB: GLenum { 0x80C9 } - static var BLEND_DST_ALPHA: GLenum { 0x80CA } + @inlinable static var BLEND_DST_ALPHA: GLenum { 0x80CA } - static var BLEND_SRC_ALPHA: GLenum { 0x80CB } + @inlinable static var BLEND_SRC_ALPHA: GLenum { 0x80CB } - static var CONSTANT_COLOR: GLenum { 0x8001 } + @inlinable static var CONSTANT_COLOR: GLenum { 0x8001 } - static var ONE_MINUS_CONSTANT_COLOR: GLenum { 0x8002 } + @inlinable static var ONE_MINUS_CONSTANT_COLOR: GLenum { 0x8002 } - static var CONSTANT_ALPHA: GLenum { 0x8003 } + @inlinable static var CONSTANT_ALPHA: GLenum { 0x8003 } - static var ONE_MINUS_CONSTANT_ALPHA: GLenum { 0x8004 } + @inlinable static var ONE_MINUS_CONSTANT_ALPHA: GLenum { 0x8004 } - static var BLEND_COLOR: GLenum { 0x8005 } + @inlinable static var BLEND_COLOR: GLenum { 0x8005 } - static var ARRAY_BUFFER: GLenum { 0x8892 } + @inlinable static var ARRAY_BUFFER: GLenum { 0x8892 } - static var ELEMENT_ARRAY_BUFFER: GLenum { 0x8893 } + @inlinable static var ELEMENT_ARRAY_BUFFER: GLenum { 0x8893 } - static var ARRAY_BUFFER_BINDING: GLenum { 0x8894 } + @inlinable static var ARRAY_BUFFER_BINDING: GLenum { 0x8894 } - static var ELEMENT_ARRAY_BUFFER_BINDING: GLenum { 0x8895 } + @inlinable static var ELEMENT_ARRAY_BUFFER_BINDING: GLenum { 0x8895 } - static var STREAM_DRAW: GLenum { 0x88E0 } + @inlinable static var STREAM_DRAW: GLenum { 0x88E0 } - static var STATIC_DRAW: GLenum { 0x88E4 } + @inlinable static var STATIC_DRAW: GLenum { 0x88E4 } - static var DYNAMIC_DRAW: GLenum { 0x88E8 } + @inlinable static var DYNAMIC_DRAW: GLenum { 0x88E8 } - static var BUFFER_SIZE: GLenum { 0x8764 } + @inlinable static var BUFFER_SIZE: GLenum { 0x8764 } - static var BUFFER_USAGE: GLenum { 0x8765 } + @inlinable static var BUFFER_USAGE: GLenum { 0x8765 } - static var CURRENT_VERTEX_ATTRIB: GLenum { 0x8626 } + @inlinable static var CURRENT_VERTEX_ATTRIB: GLenum { 0x8626 } - static var FRONT: GLenum { 0x0404 } + @inlinable static var FRONT: GLenum { 0x0404 } - static var BACK: GLenum { 0x0405 } + @inlinable static var BACK: GLenum { 0x0405 } - static var FRONT_AND_BACK: GLenum { 0x0408 } + @inlinable static var FRONT_AND_BACK: GLenum { 0x0408 } - static var CULL_FACE: GLenum { 0x0B44 } + @inlinable static var CULL_FACE: GLenum { 0x0B44 } - static var BLEND: GLenum { 0x0BE2 } + @inlinable static var BLEND: GLenum { 0x0BE2 } - static var DITHER: GLenum { 0x0BD0 } + @inlinable static var DITHER: GLenum { 0x0BD0 } - static var STENCIL_TEST: GLenum { 0x0B90 } + @inlinable static var STENCIL_TEST: GLenum { 0x0B90 } - static var DEPTH_TEST: GLenum { 0x0B71 } + @inlinable static var DEPTH_TEST: GLenum { 0x0B71 } - static var SCISSOR_TEST: GLenum { 0x0C11 } + @inlinable static var SCISSOR_TEST: GLenum { 0x0C11 } - static var POLYGON_OFFSET_FILL: GLenum { 0x8037 } + @inlinable static var POLYGON_OFFSET_FILL: GLenum { 0x8037 } - static var SAMPLE_ALPHA_TO_COVERAGE: GLenum { 0x809E } + @inlinable static var SAMPLE_ALPHA_TO_COVERAGE: GLenum { 0x809E } - static var SAMPLE_COVERAGE: GLenum { 0x80A0 } + @inlinable static var SAMPLE_COVERAGE: GLenum { 0x80A0 } - static var NO_ERROR: GLenum { 0 } + @inlinable static var NO_ERROR: GLenum { 0 } - static var INVALID_ENUM: GLenum { 0x0500 } + @inlinable static var INVALID_ENUM: GLenum { 0x0500 } - static var INVALID_VALUE: GLenum { 0x0501 } + @inlinable static var INVALID_VALUE: GLenum { 0x0501 } - static var INVALID_OPERATION: GLenum { 0x0502 } + @inlinable static var INVALID_OPERATION: GLenum { 0x0502 } - static var OUT_OF_MEMORY: GLenum { 0x0505 } + @inlinable static var OUT_OF_MEMORY: GLenum { 0x0505 } - static var CW: GLenum { 0x0900 } + @inlinable static var CW: GLenum { 0x0900 } - static var CCW: GLenum { 0x0901 } + @inlinable static var CCW: GLenum { 0x0901 } - static var LINE_WIDTH: GLenum { 0x0B21 } + @inlinable static var LINE_WIDTH: GLenum { 0x0B21 } - static var ALIASED_POINT_SIZE_RANGE: GLenum { 0x846D } + @inlinable static var ALIASED_POINT_SIZE_RANGE: GLenum { 0x846D } - static var ALIASED_LINE_WIDTH_RANGE: GLenum { 0x846E } + @inlinable static var ALIASED_LINE_WIDTH_RANGE: GLenum { 0x846E } - static var CULL_FACE_MODE: GLenum { 0x0B45 } + @inlinable static var CULL_FACE_MODE: GLenum { 0x0B45 } - static var FRONT_FACE: GLenum { 0x0B46 } + @inlinable static var FRONT_FACE: GLenum { 0x0B46 } - static var DEPTH_RANGE: GLenum { 0x0B70 } + @inlinable static var DEPTH_RANGE: GLenum { 0x0B70 } - static var DEPTH_WRITEMASK: GLenum { 0x0B72 } + @inlinable static var DEPTH_WRITEMASK: GLenum { 0x0B72 } - static var DEPTH_CLEAR_VALUE: GLenum { 0x0B73 } + @inlinable static var DEPTH_CLEAR_VALUE: GLenum { 0x0B73 } - static var DEPTH_FUNC: GLenum { 0x0B74 } + @inlinable static var DEPTH_FUNC: GLenum { 0x0B74 } - static var STENCIL_CLEAR_VALUE: GLenum { 0x0B91 } + @inlinable static var STENCIL_CLEAR_VALUE: GLenum { 0x0B91 } - static var STENCIL_FUNC: GLenum { 0x0B92 } + @inlinable static var STENCIL_FUNC: GLenum { 0x0B92 } - static var STENCIL_FAIL: GLenum { 0x0B94 } + @inlinable static var STENCIL_FAIL: GLenum { 0x0B94 } - static var STENCIL_PASS_DEPTH_FAIL: GLenum { 0x0B95 } + @inlinable static var STENCIL_PASS_DEPTH_FAIL: GLenum { 0x0B95 } - static var STENCIL_PASS_DEPTH_PASS: GLenum { 0x0B96 } + @inlinable static var STENCIL_PASS_DEPTH_PASS: GLenum { 0x0B96 } - static var STENCIL_REF: GLenum { 0x0B97 } + @inlinable static var STENCIL_REF: GLenum { 0x0B97 } - static var STENCIL_VALUE_MASK: GLenum { 0x0B93 } + @inlinable static var STENCIL_VALUE_MASK: GLenum { 0x0B93 } - static var STENCIL_WRITEMASK: GLenum { 0x0B98 } + @inlinable static var STENCIL_WRITEMASK: GLenum { 0x0B98 } - static var STENCIL_BACK_FUNC: GLenum { 0x8800 } + @inlinable static var STENCIL_BACK_FUNC: GLenum { 0x8800 } - static var STENCIL_BACK_FAIL: GLenum { 0x8801 } + @inlinable static var STENCIL_BACK_FAIL: GLenum { 0x8801 } - static var STENCIL_BACK_PASS_DEPTH_FAIL: GLenum { 0x8802 } + @inlinable static var STENCIL_BACK_PASS_DEPTH_FAIL: GLenum { 0x8802 } - static var STENCIL_BACK_PASS_DEPTH_PASS: GLenum { 0x8803 } + @inlinable static var STENCIL_BACK_PASS_DEPTH_PASS: GLenum { 0x8803 } - static var STENCIL_BACK_REF: GLenum { 0x8CA3 } + @inlinable static var STENCIL_BACK_REF: GLenum { 0x8CA3 } - static var STENCIL_BACK_VALUE_MASK: GLenum { 0x8CA4 } + @inlinable static var STENCIL_BACK_VALUE_MASK: GLenum { 0x8CA4 } - static var STENCIL_BACK_WRITEMASK: GLenum { 0x8CA5 } + @inlinable static var STENCIL_BACK_WRITEMASK: GLenum { 0x8CA5 } - static var VIEWPORT: GLenum { 0x0BA2 } + @inlinable static var VIEWPORT: GLenum { 0x0BA2 } - static var SCISSOR_BOX: GLenum { 0x0C10 } + @inlinable static var SCISSOR_BOX: GLenum { 0x0C10 } - static var COLOR_CLEAR_VALUE: GLenum { 0x0C22 } + @inlinable static var COLOR_CLEAR_VALUE: GLenum { 0x0C22 } - static var COLOR_WRITEMASK: GLenum { 0x0C23 } + @inlinable static var COLOR_WRITEMASK: GLenum { 0x0C23 } - static var UNPACK_ALIGNMENT: GLenum { 0x0CF5 } + @inlinable static var UNPACK_ALIGNMENT: GLenum { 0x0CF5 } - static var PACK_ALIGNMENT: GLenum { 0x0D05 } + @inlinable static var PACK_ALIGNMENT: GLenum { 0x0D05 } - static var MAX_TEXTURE_SIZE: GLenum { 0x0D33 } + @inlinable static var MAX_TEXTURE_SIZE: GLenum { 0x0D33 } - static var MAX_VIEWPORT_DIMS: GLenum { 0x0D3A } + @inlinable static var MAX_VIEWPORT_DIMS: GLenum { 0x0D3A } - static var SUBPIXEL_BITS: GLenum { 0x0D50 } + @inlinable static var SUBPIXEL_BITS: GLenum { 0x0D50 } - static var RED_BITS: GLenum { 0x0D52 } + @inlinable static var RED_BITS: GLenum { 0x0D52 } - static var GREEN_BITS: GLenum { 0x0D53 } + @inlinable static var GREEN_BITS: GLenum { 0x0D53 } - static var BLUE_BITS: GLenum { 0x0D54 } + @inlinable static var BLUE_BITS: GLenum { 0x0D54 } - static var ALPHA_BITS: GLenum { 0x0D55 } + @inlinable static var ALPHA_BITS: GLenum { 0x0D55 } - static var DEPTH_BITS: GLenum { 0x0D56 } + @inlinable static var DEPTH_BITS: GLenum { 0x0D56 } - static var STENCIL_BITS: GLenum { 0x0D57 } + @inlinable static var STENCIL_BITS: GLenum { 0x0D57 } - static var POLYGON_OFFSET_UNITS: GLenum { 0x2A00 } + @inlinable static var POLYGON_OFFSET_UNITS: GLenum { 0x2A00 } - static var POLYGON_OFFSET_FACTOR: GLenum { 0x8038 } + @inlinable static var POLYGON_OFFSET_FACTOR: GLenum { 0x8038 } - static var TEXTURE_BINDING_2D: GLenum { 0x8069 } + @inlinable static var TEXTURE_BINDING_2D: GLenum { 0x8069 } - static var SAMPLE_BUFFERS: GLenum { 0x80A8 } + @inlinable static var SAMPLE_BUFFERS: GLenum { 0x80A8 } - static var SAMPLES: GLenum { 0x80A9 } + @inlinable static var SAMPLES: GLenum { 0x80A9 } - static var SAMPLE_COVERAGE_VALUE: GLenum { 0x80AA } + @inlinable static var SAMPLE_COVERAGE_VALUE: GLenum { 0x80AA } - static var SAMPLE_COVERAGE_INVERT: GLenum { 0x80AB } + @inlinable static var SAMPLE_COVERAGE_INVERT: GLenum { 0x80AB } - static var COMPRESSED_TEXTURE_FORMATS: GLenum { 0x86A3 } + @inlinable static var COMPRESSED_TEXTURE_FORMATS: GLenum { 0x86A3 } - static var DONT_CARE: GLenum { 0x1100 } + @inlinable static var DONT_CARE: GLenum { 0x1100 } - static var FASTEST: GLenum { 0x1101 } + @inlinable static var FASTEST: GLenum { 0x1101 } - static var NICEST: GLenum { 0x1102 } + @inlinable static var NICEST: GLenum { 0x1102 } - static var GENERATE_MIPMAP_HINT: GLenum { 0x8192 } + @inlinable static var GENERATE_MIPMAP_HINT: GLenum { 0x8192 } - static var BYTE: GLenum { 0x1400 } + @inlinable static var BYTE: GLenum { 0x1400 } - static var UNSIGNED_BYTE: GLenum { 0x1401 } + @inlinable static var UNSIGNED_BYTE: GLenum { 0x1401 } - static var SHORT: GLenum { 0x1402 } + @inlinable static var SHORT: GLenum { 0x1402 } - static var UNSIGNED_SHORT: GLenum { 0x1403 } + @inlinable static var UNSIGNED_SHORT: GLenum { 0x1403 } - static var INT: GLenum { 0x1404 } + @inlinable static var INT: GLenum { 0x1404 } - static var UNSIGNED_INT: GLenum { 0x1405 } + @inlinable static var UNSIGNED_INT: GLenum { 0x1405 } - static var FLOAT: GLenum { 0x1406 } + @inlinable static var FLOAT: GLenum { 0x1406 } - static var DEPTH_COMPONENT: GLenum { 0x1902 } + @inlinable static var DEPTH_COMPONENT: GLenum { 0x1902 } - static var ALPHA: GLenum { 0x1906 } + @inlinable static var ALPHA: GLenum { 0x1906 } - static var RGB: GLenum { 0x1907 } + @inlinable static var RGB: GLenum { 0x1907 } - static var RGBA: GLenum { 0x1908 } + @inlinable static var RGBA: GLenum { 0x1908 } - static var LUMINANCE: GLenum { 0x1909 } + @inlinable static var LUMINANCE: GLenum { 0x1909 } - static var LUMINANCE_ALPHA: GLenum { 0x190A } + @inlinable static var LUMINANCE_ALPHA: GLenum { 0x190A } - static var UNSIGNED_SHORT_4_4_4_4: GLenum { 0x8033 } + @inlinable static var UNSIGNED_SHORT_4_4_4_4: GLenum { 0x8033 } - static var UNSIGNED_SHORT_5_5_5_1: GLenum { 0x8034 } + @inlinable static var UNSIGNED_SHORT_5_5_5_1: GLenum { 0x8034 } - static var UNSIGNED_SHORT_5_6_5: GLenum { 0x8363 } + @inlinable static var UNSIGNED_SHORT_5_6_5: GLenum { 0x8363 } - static var FRAGMENT_SHADER: GLenum { 0x8B30 } + @inlinable static var FRAGMENT_SHADER: GLenum { 0x8B30 } - static var VERTEX_SHADER: GLenum { 0x8B31 } + @inlinable static var VERTEX_SHADER: GLenum { 0x8B31 } - static var MAX_VERTEX_ATTRIBS: GLenum { 0x8869 } + @inlinable static var MAX_VERTEX_ATTRIBS: GLenum { 0x8869 } - static var MAX_VERTEX_UNIFORM_VECTORS: GLenum { 0x8DFB } + @inlinable static var MAX_VERTEX_UNIFORM_VECTORS: GLenum { 0x8DFB } - static var MAX_VARYING_VECTORS: GLenum { 0x8DFC } + @inlinable static var MAX_VARYING_VECTORS: GLenum { 0x8DFC } - static var MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4D } + @inlinable static var MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4D } - static var MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4C } + @inlinable static var MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4C } - static var MAX_TEXTURE_IMAGE_UNITS: GLenum { 0x8872 } + @inlinable static var MAX_TEXTURE_IMAGE_UNITS: GLenum { 0x8872 } - static var MAX_FRAGMENT_UNIFORM_VECTORS: GLenum { 0x8DFD } + @inlinable static var MAX_FRAGMENT_UNIFORM_VECTORS: GLenum { 0x8DFD } - static var SHADER_TYPE: GLenum { 0x8B4F } + @inlinable static var SHADER_TYPE: GLenum { 0x8B4F } - static var DELETE_STATUS: GLenum { 0x8B80 } + @inlinable static var DELETE_STATUS: GLenum { 0x8B80 } - static var LINK_STATUS: GLenum { 0x8B82 } + @inlinable static var LINK_STATUS: GLenum { 0x8B82 } - static var VALIDATE_STATUS: GLenum { 0x8B83 } + @inlinable static var VALIDATE_STATUS: GLenum { 0x8B83 } - static var ATTACHED_SHADERS: GLenum { 0x8B85 } + @inlinable static var ATTACHED_SHADERS: GLenum { 0x8B85 } - static var ACTIVE_UNIFORMS: GLenum { 0x8B86 } + @inlinable static var ACTIVE_UNIFORMS: GLenum { 0x8B86 } - static var ACTIVE_ATTRIBUTES: GLenum { 0x8B89 } + @inlinable static var ACTIVE_ATTRIBUTES: GLenum { 0x8B89 } - static var SHADING_LANGUAGE_VERSION: GLenum { 0x8B8C } + @inlinable static var SHADING_LANGUAGE_VERSION: GLenum { 0x8B8C } - static var CURRENT_PROGRAM: GLenum { 0x8B8D } + @inlinable static var CURRENT_PROGRAM: GLenum { 0x8B8D } - static var NEVER: GLenum { 0x0200 } + @inlinable static var NEVER: GLenum { 0x0200 } - static var LESS: GLenum { 0x0201 } + @inlinable static var LESS: GLenum { 0x0201 } - static var EQUAL: GLenum { 0x0202 } + @inlinable static var EQUAL: GLenum { 0x0202 } - static var LEQUAL: GLenum { 0x0203 } + @inlinable static var LEQUAL: GLenum { 0x0203 } - static var GREATER: GLenum { 0x0204 } + @inlinable static var GREATER: GLenum { 0x0204 } - static var NOTEQUAL: GLenum { 0x0205 } + @inlinable static var NOTEQUAL: GLenum { 0x0205 } - static var GEQUAL: GLenum { 0x0206 } + @inlinable static var GEQUAL: GLenum { 0x0206 } - static var ALWAYS: GLenum { 0x0207 } + @inlinable static var ALWAYS: GLenum { 0x0207 } - static var KEEP: GLenum { 0x1E00 } + @inlinable static var KEEP: GLenum { 0x1E00 } - static var REPLACE: GLenum { 0x1E01 } + @inlinable static var REPLACE: GLenum { 0x1E01 } - static var INCR: GLenum { 0x1E02 } + @inlinable static var INCR: GLenum { 0x1E02 } - static var DECR: GLenum { 0x1E03 } + @inlinable static var DECR: GLenum { 0x1E03 } - static var INVERT: GLenum { 0x150A } + @inlinable static var INVERT: GLenum { 0x150A } - static var INCR_WRAP: GLenum { 0x8507 } + @inlinable static var INCR_WRAP: GLenum { 0x8507 } - static var DECR_WRAP: GLenum { 0x8508 } + @inlinable static var DECR_WRAP: GLenum { 0x8508 } - static var VENDOR: GLenum { 0x1F00 } + @inlinable static var VENDOR: GLenum { 0x1F00 } - static var RENDERER: GLenum { 0x1F01 } + @inlinable static var RENDERER: GLenum { 0x1F01 } - static var VERSION: GLenum { 0x1F02 } + @inlinable static var VERSION: GLenum { 0x1F02 } - static var NEAREST: GLenum { 0x2600 } + @inlinable static var NEAREST: GLenum { 0x2600 } - static var LINEAR: GLenum { 0x2601 } + @inlinable static var LINEAR: GLenum { 0x2601 } - static var NEAREST_MIPMAP_NEAREST: GLenum { 0x2700 } + @inlinable static var NEAREST_MIPMAP_NEAREST: GLenum { 0x2700 } - static var LINEAR_MIPMAP_NEAREST: GLenum { 0x2701 } + @inlinable static var LINEAR_MIPMAP_NEAREST: GLenum { 0x2701 } - static var NEAREST_MIPMAP_LINEAR: GLenum { 0x2702 } + @inlinable static var NEAREST_MIPMAP_LINEAR: GLenum { 0x2702 } - static var LINEAR_MIPMAP_LINEAR: GLenum { 0x2703 } + @inlinable static var LINEAR_MIPMAP_LINEAR: GLenum { 0x2703 } - static var TEXTURE_MAG_FILTER: GLenum { 0x2800 } + @inlinable static var TEXTURE_MAG_FILTER: GLenum { 0x2800 } - static var TEXTURE_MIN_FILTER: GLenum { 0x2801 } + @inlinable static var TEXTURE_MIN_FILTER: GLenum { 0x2801 } - static var TEXTURE_WRAP_S: GLenum { 0x2802 } + @inlinable static var TEXTURE_WRAP_S: GLenum { 0x2802 } - static var TEXTURE_WRAP_T: GLenum { 0x2803 } + @inlinable static var TEXTURE_WRAP_T: GLenum { 0x2803 } - static var TEXTURE_2D: GLenum { 0x0DE1 } + @inlinable static var TEXTURE_2D: GLenum { 0x0DE1 } - static var TEXTURE: GLenum { 0x1702 } + @inlinable static var TEXTURE: GLenum { 0x1702 } - static var TEXTURE_CUBE_MAP: GLenum { 0x8513 } + @inlinable static var TEXTURE_CUBE_MAP: GLenum { 0x8513 } - static var TEXTURE_BINDING_CUBE_MAP: GLenum { 0x8514 } + @inlinable static var TEXTURE_BINDING_CUBE_MAP: GLenum { 0x8514 } - static var TEXTURE_CUBE_MAP_POSITIVE_X: GLenum { 0x8515 } + @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_X: GLenum { 0x8515 } - static var TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum { 0x8516 } + @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum { 0x8516 } - static var TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum { 0x8517 } + @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum { 0x8517 } - static var TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum { 0x8518 } + @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum { 0x8518 } - static var TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum { 0x8519 } + @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum { 0x8519 } - static var TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum { 0x851A } + @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum { 0x851A } - static var MAX_CUBE_MAP_TEXTURE_SIZE: GLenum { 0x851C } + @inlinable static var MAX_CUBE_MAP_TEXTURE_SIZE: GLenum { 0x851C } - static var TEXTURE0: GLenum { 0x84C0 } + @inlinable static var TEXTURE0: GLenum { 0x84C0 } - static var TEXTURE1: GLenum { 0x84C1 } + @inlinable static var TEXTURE1: GLenum { 0x84C1 } - static var TEXTURE2: GLenum { 0x84C2 } + @inlinable static var TEXTURE2: GLenum { 0x84C2 } - static var TEXTURE3: GLenum { 0x84C3 } + @inlinable static var TEXTURE3: GLenum { 0x84C3 } - static var TEXTURE4: GLenum { 0x84C4 } + @inlinable static var TEXTURE4: GLenum { 0x84C4 } - static var TEXTURE5: GLenum { 0x84C5 } + @inlinable static var TEXTURE5: GLenum { 0x84C5 } - static var TEXTURE6: GLenum { 0x84C6 } + @inlinable static var TEXTURE6: GLenum { 0x84C6 } - static var TEXTURE7: GLenum { 0x84C7 } + @inlinable static var TEXTURE7: GLenum { 0x84C7 } - static var TEXTURE8: GLenum { 0x84C8 } + @inlinable static var TEXTURE8: GLenum { 0x84C8 } - static var TEXTURE9: GLenum { 0x84C9 } + @inlinable static var TEXTURE9: GLenum { 0x84C9 } - static var TEXTURE10: GLenum { 0x84CA } + @inlinable static var TEXTURE10: GLenum { 0x84CA } - static var TEXTURE11: GLenum { 0x84CB } + @inlinable static var TEXTURE11: GLenum { 0x84CB } - static var TEXTURE12: GLenum { 0x84CC } + @inlinable static var TEXTURE12: GLenum { 0x84CC } - static var TEXTURE13: GLenum { 0x84CD } + @inlinable static var TEXTURE13: GLenum { 0x84CD } - static var TEXTURE14: GLenum { 0x84CE } + @inlinable static var TEXTURE14: GLenum { 0x84CE } - static var TEXTURE15: GLenum { 0x84CF } + @inlinable static var TEXTURE15: GLenum { 0x84CF } - static var TEXTURE16: GLenum { 0x84D0 } + @inlinable static var TEXTURE16: GLenum { 0x84D0 } - static var TEXTURE17: GLenum { 0x84D1 } + @inlinable static var TEXTURE17: GLenum { 0x84D1 } - static var TEXTURE18: GLenum { 0x84D2 } + @inlinable static var TEXTURE18: GLenum { 0x84D2 } - static var TEXTURE19: GLenum { 0x84D3 } + @inlinable static var TEXTURE19: GLenum { 0x84D3 } - static var TEXTURE20: GLenum { 0x84D4 } + @inlinable static var TEXTURE20: GLenum { 0x84D4 } - static var TEXTURE21: GLenum { 0x84D5 } + @inlinable static var TEXTURE21: GLenum { 0x84D5 } - static var TEXTURE22: GLenum { 0x84D6 } + @inlinable static var TEXTURE22: GLenum { 0x84D6 } - static var TEXTURE23: GLenum { 0x84D7 } + @inlinable static var TEXTURE23: GLenum { 0x84D7 } - static var TEXTURE24: GLenum { 0x84D8 } + @inlinable static var TEXTURE24: GLenum { 0x84D8 } - static var TEXTURE25: GLenum { 0x84D9 } + @inlinable static var TEXTURE25: GLenum { 0x84D9 } - static var TEXTURE26: GLenum { 0x84DA } + @inlinable static var TEXTURE26: GLenum { 0x84DA } - static var TEXTURE27: GLenum { 0x84DB } + @inlinable static var TEXTURE27: GLenum { 0x84DB } - static var TEXTURE28: GLenum { 0x84DC } + @inlinable static var TEXTURE28: GLenum { 0x84DC } - static var TEXTURE29: GLenum { 0x84DD } + @inlinable static var TEXTURE29: GLenum { 0x84DD } - static var TEXTURE30: GLenum { 0x84DE } + @inlinable static var TEXTURE30: GLenum { 0x84DE } - static var TEXTURE31: GLenum { 0x84DF } + @inlinable static var TEXTURE31: GLenum { 0x84DF } - static var ACTIVE_TEXTURE: GLenum { 0x84E0 } + @inlinable static var ACTIVE_TEXTURE: GLenum { 0x84E0 } - static var REPEAT: GLenum { 0x2901 } + @inlinable static var REPEAT: GLenum { 0x2901 } - static var CLAMP_TO_EDGE: GLenum { 0x812F } + @inlinable static var CLAMP_TO_EDGE: GLenum { 0x812F } - static var MIRRORED_REPEAT: GLenum { 0x8370 } + @inlinable static var MIRRORED_REPEAT: GLenum { 0x8370 } - static var FLOAT_VEC2: GLenum { 0x8B50 } + @inlinable static var FLOAT_VEC2: GLenum { 0x8B50 } - static var FLOAT_VEC3: GLenum { 0x8B51 } + @inlinable static var FLOAT_VEC3: GLenum { 0x8B51 } - static var FLOAT_VEC4: GLenum { 0x8B52 } + @inlinable static var FLOAT_VEC4: GLenum { 0x8B52 } - static var INT_VEC2: GLenum { 0x8B53 } + @inlinable static var INT_VEC2: GLenum { 0x8B53 } - static var INT_VEC3: GLenum { 0x8B54 } + @inlinable static var INT_VEC3: GLenum { 0x8B54 } - static var INT_VEC4: GLenum { 0x8B55 } + @inlinable static var INT_VEC4: GLenum { 0x8B55 } - static var BOOL: GLenum { 0x8B56 } + @inlinable static var BOOL: GLenum { 0x8B56 } - static var BOOL_VEC2: GLenum { 0x8B57 } + @inlinable static var BOOL_VEC2: GLenum { 0x8B57 } - static var BOOL_VEC3: GLenum { 0x8B58 } + @inlinable static var BOOL_VEC3: GLenum { 0x8B58 } - static var BOOL_VEC4: GLenum { 0x8B59 } + @inlinable static var BOOL_VEC4: GLenum { 0x8B59 } - static var FLOAT_MAT2: GLenum { 0x8B5A } + @inlinable static var FLOAT_MAT2: GLenum { 0x8B5A } - static var FLOAT_MAT3: GLenum { 0x8B5B } + @inlinable static var FLOAT_MAT3: GLenum { 0x8B5B } - static var FLOAT_MAT4: GLenum { 0x8B5C } + @inlinable static var FLOAT_MAT4: GLenum { 0x8B5C } - static var SAMPLER_2D: GLenum { 0x8B5E } + @inlinable static var SAMPLER_2D: GLenum { 0x8B5E } - static var SAMPLER_CUBE: GLenum { 0x8B60 } + @inlinable static var SAMPLER_CUBE: GLenum { 0x8B60 } - static var VERTEX_ATTRIB_ARRAY_ENABLED: GLenum { 0x8622 } + @inlinable static var VERTEX_ATTRIB_ARRAY_ENABLED: GLenum { 0x8622 } - static var VERTEX_ATTRIB_ARRAY_SIZE: GLenum { 0x8623 } + @inlinable static var VERTEX_ATTRIB_ARRAY_SIZE: GLenum { 0x8623 } - static var VERTEX_ATTRIB_ARRAY_STRIDE: GLenum { 0x8624 } + @inlinable static var VERTEX_ATTRIB_ARRAY_STRIDE: GLenum { 0x8624 } - static var VERTEX_ATTRIB_ARRAY_TYPE: GLenum { 0x8625 } + @inlinable static var VERTEX_ATTRIB_ARRAY_TYPE: GLenum { 0x8625 } - static var VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum { 0x886A } + @inlinable static var VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum { 0x886A } - static var VERTEX_ATTRIB_ARRAY_POINTER: GLenum { 0x8645 } + @inlinable static var VERTEX_ATTRIB_ARRAY_POINTER: GLenum { 0x8645 } - static var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum { 0x889F } + @inlinable static var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum { 0x889F } - static var IMPLEMENTATION_COLOR_READ_TYPE: GLenum { 0x8B9A } + @inlinable static var IMPLEMENTATION_COLOR_READ_TYPE: GLenum { 0x8B9A } - static var IMPLEMENTATION_COLOR_READ_FORMAT: GLenum { 0x8B9B } + @inlinable static var IMPLEMENTATION_COLOR_READ_FORMAT: GLenum { 0x8B9B } - static var COMPILE_STATUS: GLenum { 0x8B81 } + @inlinable static var COMPILE_STATUS: GLenum { 0x8B81 } - static var LOW_FLOAT: GLenum { 0x8DF0 } + @inlinable static var LOW_FLOAT: GLenum { 0x8DF0 } - static var MEDIUM_FLOAT: GLenum { 0x8DF1 } + @inlinable static var MEDIUM_FLOAT: GLenum { 0x8DF1 } - static var HIGH_FLOAT: GLenum { 0x8DF2 } + @inlinable static var HIGH_FLOAT: GLenum { 0x8DF2 } - static var LOW_INT: GLenum { 0x8DF3 } + @inlinable static var LOW_INT: GLenum { 0x8DF3 } - static var MEDIUM_INT: GLenum { 0x8DF4 } + @inlinable static var MEDIUM_INT: GLenum { 0x8DF4 } - static var HIGH_INT: GLenum { 0x8DF5 } + @inlinable static var HIGH_INT: GLenum { 0x8DF5 } - static var FRAMEBUFFER: GLenum { 0x8D40 } + @inlinable static var FRAMEBUFFER: GLenum { 0x8D40 } - static var RENDERBUFFER: GLenum { 0x8D41 } + @inlinable static var RENDERBUFFER: GLenum { 0x8D41 } - static var RGBA4: GLenum { 0x8056 } + @inlinable static var RGBA4: GLenum { 0x8056 } - static var RGB5_A1: GLenum { 0x8057 } + @inlinable static var RGB5_A1: GLenum { 0x8057 } - static var RGB565: GLenum { 0x8D62 } + @inlinable static var RGB565: GLenum { 0x8D62 } - static var DEPTH_COMPONENT16: GLenum { 0x81A5 } + @inlinable static var DEPTH_COMPONENT16: GLenum { 0x81A5 } - static var STENCIL_INDEX8: GLenum { 0x8D48 } + @inlinable static var STENCIL_INDEX8: GLenum { 0x8D48 } - static var DEPTH_STENCIL: GLenum { 0x84F9 } + @inlinable static var DEPTH_STENCIL: GLenum { 0x84F9 } - static var RENDERBUFFER_WIDTH: GLenum { 0x8D42 } + @inlinable static var RENDERBUFFER_WIDTH: GLenum { 0x8D42 } - static var RENDERBUFFER_HEIGHT: GLenum { 0x8D43 } + @inlinable static var RENDERBUFFER_HEIGHT: GLenum { 0x8D43 } - static var RENDERBUFFER_INTERNAL_FORMAT: GLenum { 0x8D44 } + @inlinable static var RENDERBUFFER_INTERNAL_FORMAT: GLenum { 0x8D44 } - static var RENDERBUFFER_RED_SIZE: GLenum { 0x8D50 } + @inlinable static var RENDERBUFFER_RED_SIZE: GLenum { 0x8D50 } - static var RENDERBUFFER_GREEN_SIZE: GLenum { 0x8D51 } + @inlinable static var RENDERBUFFER_GREEN_SIZE: GLenum { 0x8D51 } - static var RENDERBUFFER_BLUE_SIZE: GLenum { 0x8D52 } + @inlinable static var RENDERBUFFER_BLUE_SIZE: GLenum { 0x8D52 } - static var RENDERBUFFER_ALPHA_SIZE: GLenum { 0x8D53 } + @inlinable static var RENDERBUFFER_ALPHA_SIZE: GLenum { 0x8D53 } - static var RENDERBUFFER_DEPTH_SIZE: GLenum { 0x8D54 } + @inlinable static var RENDERBUFFER_DEPTH_SIZE: GLenum { 0x8D54 } - static var RENDERBUFFER_STENCIL_SIZE: GLenum { 0x8D55 } + @inlinable static var RENDERBUFFER_STENCIL_SIZE: GLenum { 0x8D55 } - static var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum { 0x8CD0 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum { 0x8CD0 } - static var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum { 0x8CD1 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum { 0x8CD1 } - static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum { 0x8CD2 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum { 0x8CD2 } - static var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum { 0x8CD3 } + @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum { 0x8CD3 } - static var COLOR_ATTACHMENT0: GLenum { 0x8CE0 } + @inlinable static var COLOR_ATTACHMENT0: GLenum { 0x8CE0 } - static var DEPTH_ATTACHMENT: GLenum { 0x8D00 } + @inlinable static var DEPTH_ATTACHMENT: GLenum { 0x8D00 } - static var STENCIL_ATTACHMENT: GLenum { 0x8D20 } + @inlinable static var STENCIL_ATTACHMENT: GLenum { 0x8D20 } - static var DEPTH_STENCIL_ATTACHMENT: GLenum { 0x821A } + @inlinable static var DEPTH_STENCIL_ATTACHMENT: GLenum { 0x821A } - static var NONE: GLenum { 0 } + @inlinable static var NONE: GLenum { 0 } - static var FRAMEBUFFER_COMPLETE: GLenum { 0x8CD5 } + @inlinable static var FRAMEBUFFER_COMPLETE: GLenum { 0x8CD5 } - static var FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum { 0x8CD6 } + @inlinable static var FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum { 0x8CD6 } - static var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum { 0x8CD7 } + @inlinable static var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum { 0x8CD7 } - static var FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum { 0x8CD9 } + @inlinable static var FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum { 0x8CD9 } - static var FRAMEBUFFER_UNSUPPORTED: GLenum { 0x8CDD } + @inlinable static var FRAMEBUFFER_UNSUPPORTED: GLenum { 0x8CDD } - static var FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } + @inlinable static var FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } - static var RENDERBUFFER_BINDING: GLenum { 0x8CA7 } + @inlinable static var RENDERBUFFER_BINDING: GLenum { 0x8CA7 } - static var MAX_RENDERBUFFER_SIZE: GLenum { 0x84E8 } + @inlinable static var MAX_RENDERBUFFER_SIZE: GLenum { 0x84E8 } - static var INVALID_FRAMEBUFFER_OPERATION: GLenum { 0x0506 } + @inlinable static var INVALID_FRAMEBUFFER_OPERATION: GLenum { 0x0506 } - static var UNPACK_FLIP_Y_WEBGL: GLenum { 0x9240 } + @inlinable static var UNPACK_FLIP_Y_WEBGL: GLenum { 0x9240 } - static var UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum { 0x9241 } + @inlinable static var UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum { 0x9241 } - static var CONTEXT_LOST_WEBGL: GLenum { 0x9242 } + @inlinable static var CONTEXT_LOST_WEBGL: GLenum { 0x9242 } - static var UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum { 0x9243 } + @inlinable static var UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum { 0x9243 } - static var BROWSER_DEFAULT_WEBGL: GLenum { 0x9244 } + @inlinable static var BROWSER_DEFAULT_WEBGL: GLenum { 0x9244 } - var canvas: __UNSUPPORTED_UNION__ { ReadonlyAttribute[Strings.canvas, in: jsObject] } + @inlinable var canvas: __UNSUPPORTED_UNION__ { ReadonlyAttribute[Strings.canvas, in: jsObject] } - var drawingBufferWidth: GLsizei { ReadonlyAttribute[Strings.drawingBufferWidth, in: jsObject] } + @inlinable var drawingBufferWidth: GLsizei { ReadonlyAttribute[Strings.drawingBufferWidth, in: jsObject] } - var drawingBufferHeight: GLsizei { ReadonlyAttribute[Strings.drawingBufferHeight, in: jsObject] } + @inlinable var drawingBufferHeight: GLsizei { ReadonlyAttribute[Strings.drawingBufferHeight, in: jsObject] } - func getContextAttributes() -> WebGLContextAttributes? { + @inlinable func getContextAttributes() -> WebGLContextAttributes? { let this = jsObject return this[Strings.getContextAttributes].function!(this: this, arguments: []).fromJSValue()! } - func isContextLost() -> Bool { + @inlinable func isContextLost() -> Bool { let this = jsObject return this[Strings.isContextLost].function!(this: this, arguments: []).fromJSValue()! } - func getSupportedExtensions() -> [String]? { + @inlinable func getSupportedExtensions() -> [String]? { let this = jsObject return this[Strings.getSupportedExtensions].function!(this: this, arguments: []).fromJSValue()! } - func getExtension(name: String) -> JSObject? { + @inlinable func getExtension(name: String) -> JSObject? { let this = jsObject return this[Strings.getExtension].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - func activeTexture(texture: GLenum) { + @inlinable func activeTexture(texture: GLenum) { let this = jsObject _ = this[Strings.activeTexture].function!(this: this, arguments: [texture.jsValue()]) } - func attachShader(program: WebGLProgram, shader: WebGLShader) { + @inlinable func attachShader(program: WebGLProgram, shader: WebGLShader) { let this = jsObject _ = this[Strings.attachShader].function!(this: this, arguments: [program.jsValue(), shader.jsValue()]) } - func bindAttribLocation(program: WebGLProgram, index: GLuint, name: String) { + @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()]) } - func bindBuffer(target: GLenum, buffer: WebGLBuffer?) { + @inlinable func bindBuffer(target: GLenum, buffer: WebGLBuffer?) { let this = jsObject _ = this[Strings.bindBuffer].function!(this: this, arguments: [target.jsValue(), buffer.jsValue()]) } - func bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer?) { + @inlinable func bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer?) { let this = jsObject _ = this[Strings.bindFramebuffer].function!(this: this, arguments: [target.jsValue(), framebuffer.jsValue()]) } - func bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer?) { + @inlinable func bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer?) { let this = jsObject _ = this[Strings.bindRenderbuffer].function!(this: this, arguments: [target.jsValue(), renderbuffer.jsValue()]) } - func bindTexture(target: GLenum, texture: WebGLTexture?) { + @inlinable func bindTexture(target: GLenum, texture: WebGLTexture?) { let this = jsObject _ = this[Strings.bindTexture].function!(this: this, arguments: [target.jsValue(), texture.jsValue()]) } - func blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { + @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()]) } - func blendEquation(mode: GLenum) { + @inlinable func blendEquation(mode: GLenum) { let this = jsObject _ = this[Strings.blendEquation].function!(this: this, arguments: [mode.jsValue()]) } - func blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) { + @inlinable func blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) { let this = jsObject _ = this[Strings.blendEquationSeparate].function!(this: this, arguments: [modeRGB.jsValue(), modeAlpha.jsValue()]) } - func blendFunc(sfactor: GLenum, dfactor: GLenum) { + @inlinable func blendFunc(sfactor: GLenum, dfactor: GLenum) { let this = jsObject _ = this[Strings.blendFunc].function!(this: this, arguments: [sfactor.jsValue(), dfactor.jsValue()]) } - func blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { + @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()]) } - func checkFramebufferStatus(target: GLenum) -> GLenum { + @inlinable func checkFramebufferStatus(target: GLenum) -> GLenum { let this = jsObject return this[Strings.checkFramebufferStatus].function!(this: this, arguments: [target.jsValue()]).fromJSValue()! } - func clear(mask: GLbitfield) { + @inlinable func clear(mask: GLbitfield) { let this = jsObject _ = this[Strings.clear].function!(this: this, arguments: [mask.jsValue()]) } - func clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { + @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()]) } - func clearDepth(depth: GLclampf) { + @inlinable func clearDepth(depth: GLclampf) { let this = jsObject _ = this[Strings.clearDepth].function!(this: this, arguments: [depth.jsValue()]) } - func clearStencil(s: GLint) { + @inlinable func clearStencil(s: GLint) { let this = jsObject _ = this[Strings.clearStencil].function!(this: this, arguments: [s.jsValue()]) } - func colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) { + @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()]) } - func compileShader(shader: WebGLShader) { + @inlinable func compileShader(shader: WebGLShader) { let this = jsObject _ = this[Strings.compileShader].function!(this: this, arguments: [shader.jsValue()]) } - func copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) { + @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() @@ -731,7 +731,7 @@ public extension WebGLRenderingContextBase { _ = this[Strings.copyTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } - func copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + @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() @@ -744,462 +744,462 @@ public extension WebGLRenderingContextBase { _ = this[Strings.copyTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } - func createBuffer() -> WebGLBuffer? { + @inlinable func createBuffer() -> WebGLBuffer? { let this = jsObject return this[Strings.createBuffer].function!(this: this, arguments: []).fromJSValue()! } - func createFramebuffer() -> WebGLFramebuffer? { + @inlinable func createFramebuffer() -> WebGLFramebuffer? { let this = jsObject return this[Strings.createFramebuffer].function!(this: this, arguments: []).fromJSValue()! } - func createProgram() -> WebGLProgram? { + @inlinable func createProgram() -> WebGLProgram? { let this = jsObject return this[Strings.createProgram].function!(this: this, arguments: []).fromJSValue()! } - func createRenderbuffer() -> WebGLRenderbuffer? { + @inlinable func createRenderbuffer() -> WebGLRenderbuffer? { let this = jsObject return this[Strings.createRenderbuffer].function!(this: this, arguments: []).fromJSValue()! } - func createShader(type: GLenum) -> WebGLShader? { + @inlinable func createShader(type: GLenum) -> WebGLShader? { let this = jsObject return this[Strings.createShader].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } - func createTexture() -> WebGLTexture? { + @inlinable func createTexture() -> WebGLTexture? { let this = jsObject return this[Strings.createTexture].function!(this: this, arguments: []).fromJSValue()! } - func cullFace(mode: GLenum) { + @inlinable func cullFace(mode: GLenum) { let this = jsObject _ = this[Strings.cullFace].function!(this: this, arguments: [mode.jsValue()]) } - func deleteBuffer(buffer: WebGLBuffer?) { + @inlinable func deleteBuffer(buffer: WebGLBuffer?) { let this = jsObject _ = this[Strings.deleteBuffer].function!(this: this, arguments: [buffer.jsValue()]) } - func deleteFramebuffer(framebuffer: WebGLFramebuffer?) { + @inlinable func deleteFramebuffer(framebuffer: WebGLFramebuffer?) { let this = jsObject _ = this[Strings.deleteFramebuffer].function!(this: this, arguments: [framebuffer.jsValue()]) } - func deleteProgram(program: WebGLProgram?) { + @inlinable func deleteProgram(program: WebGLProgram?) { let this = jsObject _ = this[Strings.deleteProgram].function!(this: this, arguments: [program.jsValue()]) } - func deleteRenderbuffer(renderbuffer: WebGLRenderbuffer?) { + @inlinable func deleteRenderbuffer(renderbuffer: WebGLRenderbuffer?) { let this = jsObject _ = this[Strings.deleteRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue()]) } - func deleteShader(shader: WebGLShader?) { + @inlinable func deleteShader(shader: WebGLShader?) { let this = jsObject _ = this[Strings.deleteShader].function!(this: this, arguments: [shader.jsValue()]) } - func deleteTexture(texture: WebGLTexture?) { + @inlinable func deleteTexture(texture: WebGLTexture?) { let this = jsObject _ = this[Strings.deleteTexture].function!(this: this, arguments: [texture.jsValue()]) } - func depthFunc(func: GLenum) { + @inlinable func depthFunc(func: GLenum) { let this = jsObject _ = this[Strings.depthFunc].function!(this: this, arguments: [`func`.jsValue()]) } - func depthMask(flag: GLboolean) { + @inlinable func depthMask(flag: GLboolean) { let this = jsObject _ = this[Strings.depthMask].function!(this: this, arguments: [flag.jsValue()]) } - func depthRange(zNear: GLclampf, zFar: GLclampf) { + @inlinable func depthRange(zNear: GLclampf, zFar: GLclampf) { let this = jsObject _ = this[Strings.depthRange].function!(this: this, arguments: [zNear.jsValue(), zFar.jsValue()]) } - func detachShader(program: WebGLProgram, shader: WebGLShader) { + @inlinable func detachShader(program: WebGLProgram, shader: WebGLShader) { let this = jsObject _ = this[Strings.detachShader].function!(this: this, arguments: [program.jsValue(), shader.jsValue()]) } - func disable(cap: GLenum) { + @inlinable func disable(cap: GLenum) { let this = jsObject _ = this[Strings.disable].function!(this: this, arguments: [cap.jsValue()]) } - func disableVertexAttribArray(index: GLuint) { + @inlinable func disableVertexAttribArray(index: GLuint) { let this = jsObject _ = this[Strings.disableVertexAttribArray].function!(this: this, arguments: [index.jsValue()]) } - func drawArrays(mode: GLenum, first: GLint, count: GLsizei) { + @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()]) } - func drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr) { + @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()]) } - func enable(cap: GLenum) { + @inlinable func enable(cap: GLenum) { let this = jsObject _ = this[Strings.enable].function!(this: this, arguments: [cap.jsValue()]) } - func enableVertexAttribArray(index: GLuint) { + @inlinable func enableVertexAttribArray(index: GLuint) { let this = jsObject _ = this[Strings.enableVertexAttribArray].function!(this: this, arguments: [index.jsValue()]) } - func finish() { + @inlinable func finish() { let this = jsObject _ = this[Strings.finish].function!(this: this, arguments: []) } - func flush() { + @inlinable func flush() { let this = jsObject _ = this[Strings.flush].function!(this: this, arguments: []) } - func framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer?) { + @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()]) } - func framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture?, level: GLint) { + @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()]) } - func frontFace(mode: GLenum) { + @inlinable func frontFace(mode: GLenum) { let this = jsObject _ = this[Strings.frontFace].function!(this: this, arguments: [mode.jsValue()]) } - func generateMipmap(target: GLenum) { + @inlinable func generateMipmap(target: GLenum) { let this = jsObject _ = this[Strings.generateMipmap].function!(this: this, arguments: [target.jsValue()]) } - func getActiveAttrib(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + @inlinable func getActiveAttrib(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { let this = jsObject return this[Strings.getActiveAttrib].function!(this: this, arguments: [program.jsValue(), index.jsValue()]).fromJSValue()! } - func getActiveUniform(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + @inlinable func getActiveUniform(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { let this = jsObject return this[Strings.getActiveUniform].function!(this: this, arguments: [program.jsValue(), index.jsValue()]).fromJSValue()! } - func getAttachedShaders(program: WebGLProgram) -> [WebGLShader]? { + @inlinable func getAttachedShaders(program: WebGLProgram) -> [WebGLShader]? { let this = jsObject return this[Strings.getAttachedShaders].function!(this: this, arguments: [program.jsValue()]).fromJSValue()! } - func getAttribLocation(program: WebGLProgram, name: String) -> GLint { + @inlinable func getAttribLocation(program: WebGLProgram, name: String) -> GLint { let this = jsObject return this[Strings.getAttribLocation].function!(this: this, arguments: [program.jsValue(), name.jsValue()]).fromJSValue()! } - func getBufferParameter(target: GLenum, pname: GLenum) -> JSValue { + @inlinable func getBufferParameter(target: GLenum, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getBufferParameter].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } - func getParameter(pname: GLenum) -> JSValue { + @inlinable func getParameter(pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getParameter].function!(this: this, arguments: [pname.jsValue()]).fromJSValue()! } - func getError() -> GLenum { + @inlinable func getError() -> GLenum { let this = jsObject return this[Strings.getError].function!(this: this, arguments: []).fromJSValue()! } - func getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum) -> JSValue { + @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()! } - func getProgramParameter(program: WebGLProgram, pname: GLenum) -> JSValue { + @inlinable func getProgramParameter(program: WebGLProgram, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getProgramParameter].function!(this: this, arguments: [program.jsValue(), pname.jsValue()]).fromJSValue()! } - func getProgramInfoLog(program: WebGLProgram) -> String? { + @inlinable func getProgramInfoLog(program: WebGLProgram) -> String? { let this = jsObject return this[Strings.getProgramInfoLog].function!(this: this, arguments: [program.jsValue()]).fromJSValue()! } - func getRenderbufferParameter(target: GLenum, pname: GLenum) -> JSValue { + @inlinable func getRenderbufferParameter(target: GLenum, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getRenderbufferParameter].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } - func getShaderParameter(shader: WebGLShader, pname: GLenum) -> JSValue { + @inlinable func getShaderParameter(shader: WebGLShader, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getShaderParameter].function!(this: this, arguments: [shader.jsValue(), pname.jsValue()]).fromJSValue()! } - func getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) -> WebGLShaderPrecisionFormat? { + @inlinable func getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) -> WebGLShaderPrecisionFormat? { let this = jsObject return this[Strings.getShaderPrecisionFormat].function!(this: this, arguments: [shadertype.jsValue(), precisiontype.jsValue()]).fromJSValue()! } - func getShaderInfoLog(shader: WebGLShader) -> String? { + @inlinable func getShaderInfoLog(shader: WebGLShader) -> String? { let this = jsObject return this[Strings.getShaderInfoLog].function!(this: this, arguments: [shader.jsValue()]).fromJSValue()! } - func getShaderSource(shader: WebGLShader) -> String? { + @inlinable func getShaderSource(shader: WebGLShader) -> String? { let this = jsObject return this[Strings.getShaderSource].function!(this: this, arguments: [shader.jsValue()]).fromJSValue()! } - func getTexParameter(target: GLenum, pname: GLenum) -> JSValue { + @inlinable func getTexParameter(target: GLenum, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getTexParameter].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! } - func getUniform(program: WebGLProgram, location: WebGLUniformLocation) -> JSValue { + @inlinable func getUniform(program: WebGLProgram, location: WebGLUniformLocation) -> JSValue { let this = jsObject return this[Strings.getUniform].function!(this: this, arguments: [program.jsValue(), location.jsValue()]).fromJSValue()! } - func getUniformLocation(program: WebGLProgram, name: String) -> WebGLUniformLocation? { + @inlinable func getUniformLocation(program: WebGLProgram, name: String) -> WebGLUniformLocation? { let this = jsObject return this[Strings.getUniformLocation].function!(this: this, arguments: [program.jsValue(), name.jsValue()]).fromJSValue()! } - func getVertexAttrib(index: GLuint, pname: GLenum) -> JSValue { + @inlinable func getVertexAttrib(index: GLuint, pname: GLenum) -> JSValue { let this = jsObject return this[Strings.getVertexAttrib].function!(this: this, arguments: [index.jsValue(), pname.jsValue()]).fromJSValue()! } - func getVertexAttribOffset(index: GLuint, pname: GLenum) -> GLintptr { + @inlinable func getVertexAttribOffset(index: GLuint, pname: GLenum) -> GLintptr { let this = jsObject return this[Strings.getVertexAttribOffset].function!(this: this, arguments: [index.jsValue(), pname.jsValue()]).fromJSValue()! } - func hint(target: GLenum, mode: GLenum) { + @inlinable func hint(target: GLenum, mode: GLenum) { let this = jsObject _ = this[Strings.hint].function!(this: this, arguments: [target.jsValue(), mode.jsValue()]) } - func isBuffer(buffer: WebGLBuffer?) -> GLboolean { + @inlinable func isBuffer(buffer: WebGLBuffer?) -> GLboolean { let this = jsObject return this[Strings.isBuffer].function!(this: this, arguments: [buffer.jsValue()]).fromJSValue()! } - func isEnabled(cap: GLenum) -> GLboolean { + @inlinable func isEnabled(cap: GLenum) -> GLboolean { let this = jsObject return this[Strings.isEnabled].function!(this: this, arguments: [cap.jsValue()]).fromJSValue()! } - func isFramebuffer(framebuffer: WebGLFramebuffer?) -> GLboolean { + @inlinable func isFramebuffer(framebuffer: WebGLFramebuffer?) -> GLboolean { let this = jsObject return this[Strings.isFramebuffer].function!(this: this, arguments: [framebuffer.jsValue()]).fromJSValue()! } - func isProgram(program: WebGLProgram?) -> GLboolean { + @inlinable func isProgram(program: WebGLProgram?) -> GLboolean { let this = jsObject return this[Strings.isProgram].function!(this: this, arguments: [program.jsValue()]).fromJSValue()! } - func isRenderbuffer(renderbuffer: WebGLRenderbuffer?) -> GLboolean { + @inlinable func isRenderbuffer(renderbuffer: WebGLRenderbuffer?) -> GLboolean { let this = jsObject return this[Strings.isRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue()]).fromJSValue()! } - func isShader(shader: WebGLShader?) -> GLboolean { + @inlinable func isShader(shader: WebGLShader?) -> GLboolean { let this = jsObject return this[Strings.isShader].function!(this: this, arguments: [shader.jsValue()]).fromJSValue()! } - func isTexture(texture: WebGLTexture?) -> GLboolean { + @inlinable func isTexture(texture: WebGLTexture?) -> GLboolean { let this = jsObject return this[Strings.isTexture].function!(this: this, arguments: [texture.jsValue()]).fromJSValue()! } - func lineWidth(width: GLfloat) { + @inlinable func lineWidth(width: GLfloat) { let this = jsObject _ = this[Strings.lineWidth].function!(this: this, arguments: [width.jsValue()]) } - func linkProgram(program: WebGLProgram) { + @inlinable func linkProgram(program: WebGLProgram) { let this = jsObject _ = this[Strings.linkProgram].function!(this: this, arguments: [program.jsValue()]) } - func pixelStorei(pname: GLenum, param: GLint) { + @inlinable func pixelStorei(pname: GLenum, param: GLint) { let this = jsObject _ = this[Strings.pixelStorei].function!(this: this, arguments: [pname.jsValue(), param.jsValue()]) } - func polygonOffset(factor: GLfloat, units: GLfloat) { + @inlinable func polygonOffset(factor: GLfloat, units: GLfloat) { let this = jsObject _ = this[Strings.polygonOffset].function!(this: this, arguments: [factor.jsValue(), units.jsValue()]) } - func renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) { + @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()]) } - func sampleCoverage(value: GLclampf, invert: GLboolean) { + @inlinable func sampleCoverage(value: GLclampf, invert: GLboolean) { let this = jsObject _ = this[Strings.sampleCoverage].function!(this: this, arguments: [value.jsValue(), invert.jsValue()]) } - func scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + @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()]) } - func shaderSource(shader: WebGLShader, source: String) { + @inlinable func shaderSource(shader: WebGLShader, source: String) { let this = jsObject _ = this[Strings.shaderSource].function!(this: this, arguments: [shader.jsValue(), source.jsValue()]) } - func stencilFunc(func: GLenum, ref: GLint, mask: GLuint) { + @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()]) } - func stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint) { + @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()]) } - func stencilMask(mask: GLuint) { + @inlinable func stencilMask(mask: GLuint) { let this = jsObject _ = this[Strings.stencilMask].function!(this: this, arguments: [mask.jsValue()]) } - func stencilMaskSeparate(face: GLenum, mask: GLuint) { + @inlinable func stencilMaskSeparate(face: GLenum, mask: GLuint) { let this = jsObject _ = this[Strings.stencilMaskSeparate].function!(this: this, arguments: [face.jsValue(), mask.jsValue()]) } - func stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) { + @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()]) } - func stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) { + @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()]) } - func texParameterf(target: GLenum, pname: GLenum, param: GLfloat) { + @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()]) } - func texParameteri(target: GLenum, pname: GLenum, param: GLint) { + @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()]) } - func uniform1f(location: WebGLUniformLocation?, x: GLfloat) { + @inlinable func uniform1f(location: WebGLUniformLocation?, x: GLfloat) { let this = jsObject _ = this[Strings.uniform1f].function!(this: this, arguments: [location.jsValue(), x.jsValue()]) } - func uniform2f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat) { + @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()]) } - func uniform3f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat) { + @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()]) } - func uniform4f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { + @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()]) } - func uniform1i(location: WebGLUniformLocation?, x: GLint) { + @inlinable func uniform1i(location: WebGLUniformLocation?, x: GLint) { let this = jsObject _ = this[Strings.uniform1i].function!(this: this, arguments: [location.jsValue(), x.jsValue()]) } - func uniform2i(location: WebGLUniformLocation?, x: GLint, y: GLint) { + @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()]) } - func uniform3i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint) { + @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()]) } - func uniform4i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint, w: GLint) { + @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()]) } - func useProgram(program: WebGLProgram?) { + @inlinable func useProgram(program: WebGLProgram?) { let this = jsObject _ = this[Strings.useProgram].function!(this: this, arguments: [program.jsValue()]) } - func validateProgram(program: WebGLProgram) { + @inlinable func validateProgram(program: WebGLProgram) { let this = jsObject _ = this[Strings.validateProgram].function!(this: this, arguments: [program.jsValue()]) } - func vertexAttrib1f(index: GLuint, x: GLfloat) { + @inlinable func vertexAttrib1f(index: GLuint, x: GLfloat) { let this = jsObject _ = this[Strings.vertexAttrib1f].function!(this: this, arguments: [index.jsValue(), x.jsValue()]) } - func vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat) { + @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()]) } - func vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) { + @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()]) } - func vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { + @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()]) } - func vertexAttrib1fv(index: GLuint, values: Float32List) { + @inlinable func vertexAttrib1fv(index: GLuint, values: Float32List) { let this = jsObject _ = this[Strings.vertexAttrib1fv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } - func vertexAttrib2fv(index: GLuint, values: Float32List) { + @inlinable func vertexAttrib2fv(index: GLuint, values: Float32List) { let this = jsObject _ = this[Strings.vertexAttrib2fv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } - func vertexAttrib3fv(index: GLuint, values: Float32List) { + @inlinable func vertexAttrib3fv(index: GLuint, values: Float32List) { let this = jsObject _ = this[Strings.vertexAttrib3fv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } - func vertexAttrib4fv(index: GLuint, values: Float32List) { + @inlinable func vertexAttrib4fv(index: GLuint, values: Float32List) { let this = jsObject _ = this[Strings.vertexAttrib4fv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) } - func vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) { + @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() @@ -1210,18 +1210,18 @@ public extension WebGLRenderingContextBase { _ = this[Strings.vertexAttribPointer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + @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()]) } - func makeXRCompatible() -> JSPromise { + @inlinable func makeXRCompatible() -> JSPromise { let this = jsObject return this[Strings.makeXRCompatible].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func makeXRCompatible() async throws { + @inlinable func makeXRCompatible() async throws { let this = jsObject let _promise: JSPromise = this[Strings.makeXRCompatible].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift index 28348933..a3b3aebb 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift @@ -5,22 +5,22 @@ import JavaScriptKit public protocol WebGLRenderingContextOverloads: JSBridgedClass {} public extension WebGLRenderingContextOverloads { - func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { + @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()]) } - func bufferData(target: GLenum, data: BufferSource?, usage: GLenum) { + @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()]) } - func bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource) { + @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()]) } - func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) { + @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() @@ -32,7 +32,7 @@ public extension WebGLRenderingContextOverloads { _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } - func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) { + @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() @@ -45,7 +45,7 @@ public extension WebGLRenderingContextOverloads { _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } - func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + @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() @@ -57,7 +57,7 @@ public extension WebGLRenderingContextOverloads { _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } - func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + @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() @@ -71,7 +71,7 @@ public extension WebGLRenderingContextOverloads { _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + @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() @@ -82,7 +82,7 @@ public extension WebGLRenderingContextOverloads { _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + @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() @@ -96,7 +96,7 @@ public extension WebGLRenderingContextOverloads { _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + @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() @@ -108,57 +108,57 @@ public extension WebGLRenderingContextOverloads { _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } - func uniform1fv(location: WebGLUniformLocation?, v: Float32List) { + @inlinable func uniform1fv(location: WebGLUniformLocation?, v: Float32List) { let this = jsObject _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } - func uniform2fv(location: WebGLUniformLocation?, v: Float32List) { + @inlinable func uniform2fv(location: WebGLUniformLocation?, v: Float32List) { let this = jsObject _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } - func uniform3fv(location: WebGLUniformLocation?, v: Float32List) { + @inlinable func uniform3fv(location: WebGLUniformLocation?, v: Float32List) { let this = jsObject _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } - func uniform4fv(location: WebGLUniformLocation?, v: Float32List) { + @inlinable func uniform4fv(location: WebGLUniformLocation?, v: Float32List) { let this = jsObject _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } - func uniform1iv(location: WebGLUniformLocation?, v: Int32List) { + @inlinable func uniform1iv(location: WebGLUniformLocation?, v: Int32List) { let this = jsObject _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } - func uniform2iv(location: WebGLUniformLocation?, v: Int32List) { + @inlinable func uniform2iv(location: WebGLUniformLocation?, v: Int32List) { let this = jsObject _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } - func uniform3iv(location: WebGLUniformLocation?, v: Int32List) { + @inlinable func uniform3iv(location: WebGLUniformLocation?, v: Int32List) { let this = jsObject _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } - func uniform4iv(location: WebGLUniformLocation?, v: Int32List) { + @inlinable func uniform4iv(location: WebGLUniformLocation?, v: Int32List) { let this = jsObject _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue(), v.jsValue()]) } - func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + @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()]) } - func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + @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()]) } - func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + @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/WebGLSampler.swift b/Sources/DOMKit/WebIDL/WebGLSampler.swift index 74c9c22a..1b6c94e3 100644 --- a/Sources/DOMKit/WebIDL/WebGLSampler.swift +++ b/Sources/DOMKit/WebIDL/WebGLSampler.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLSampler: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSampler].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSampler].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/WebGLShader.swift b/Sources/DOMKit/WebIDL/WebGLShader.swift index 2d41208f..97f2b719 100644 --- a/Sources/DOMKit/WebIDL/WebGLShader.swift +++ b/Sources/DOMKit/WebIDL/WebGLShader.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLShader: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLShader].function! } + @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 index 45663ba6..67725e58 100644 --- a/Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift +++ b/Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLShaderPrecisionFormat: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WebGLShaderPrecisionFormat].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLShaderPrecisionFormat].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WebGLSync.swift b/Sources/DOMKit/WebIDL/WebGLSync.swift index 3208a1ac..38271eb1 100644 --- a/Sources/DOMKit/WebIDL/WebGLSync.swift +++ b/Sources/DOMKit/WebIDL/WebGLSync.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLSync: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSync].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSync].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/WebGLTexture.swift b/Sources/DOMKit/WebIDL/WebGLTexture.swift index 050b4385..ee7ad6c9 100644 --- a/Sources/DOMKit/WebIDL/WebGLTexture.swift +++ b/Sources/DOMKit/WebIDL/WebGLTexture.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLTexture: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTexture].function! } + @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/WebGLTimerQueryEXT.swift b/Sources/DOMKit/WebIDL/WebGLTimerQueryEXT.swift index 1ecad79e..f618444f 100644 --- a/Sources/DOMKit/WebIDL/WebGLTimerQueryEXT.swift +++ b/Sources/DOMKit/WebIDL/WebGLTimerQueryEXT.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLTimerQueryEXT: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTimerQueryEXT].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTimerQueryEXT].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift b/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift index b37734f9..981c92d1 100644 --- a/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift +++ b/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLTransformFeedback: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTransformFeedback].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTransformFeedback].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 index 75948c14..cf833a95 100644 --- a/Sources/DOMKit/WebIDL/WebGLUniformLocation.swift +++ b/Sources/DOMKit/WebIDL/WebGLUniformLocation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLUniformLocation: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WebGLUniformLocation].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLUniformLocation].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift b/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift index 8c667d5b..2ca909eb 100644 --- a/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift +++ b/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLVertexArrayObject: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLVertexArrayObject].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLVertexArrayObject].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift b/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift index c14384b7..ae43038a 100644 --- a/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift +++ b/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebGLVertexArrayObjectOES: WebGLObject { - override public class var constructor: JSFunction { JSObject.global[Strings.WebGLVertexArrayObjectOES].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLVertexArrayObjectOES].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/WebSocket.swift b/Sources/DOMKit/WebIDL/WebSocket.swift index 5e04e953..754f0069 100644 --- a/Sources/DOMKit/WebIDL/WebSocket.swift +++ b/Sources/DOMKit/WebIDL/WebSocket.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebSocket: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.WebSocket].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebSocket].function! } public required init(unsafelyWrapping jsObject: JSObject) { _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) @@ -20,7 +20,7 @@ public class WebSocket: EventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init(url: String, protocols: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(url: String, protocols: __UNSUPPORTED_UNION__? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), protocols?.jsValue() ?? .undefined])) } @@ -56,7 +56,7 @@ public class WebSocket: EventTarget { @ReadonlyAttribute public var `protocol`: String - public func close(code: UInt16? = nil, reason: String? = nil) { + @inlinable public func close(code: UInt16? = nil, reason: String? = nil) { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: [code?.jsValue() ?? .undefined, reason?.jsValue() ?? .undefined]) } @@ -67,7 +67,7 @@ public class WebSocket: EventTarget { @ReadWriteAttribute public var binaryType: BinaryType - public func send(data: __UNSUPPORTED_UNION__) { + @inlinable public func send(data: __UNSUPPORTED_UNION__) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/WebTransport.swift b/Sources/DOMKit/WebIDL/WebTransport.swift index f1d41111..a3da20b2 100644 --- a/Sources/DOMKit/WebIDL/WebTransport.swift +++ b/Sources/DOMKit/WebIDL/WebTransport.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebTransport: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WebTransport].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebTransport].function! } public let jsObject: JSObject @@ -17,17 +17,17 @@ public class WebTransport: JSBridgedClass { self.jsObject = jsObject } - public convenience init(url: String, options: WebTransportOptions? = nil) { + @inlinable public convenience init(url: String, options: WebTransportOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), options?.jsValue() ?? .undefined])) } - public func getStats() -> JSPromise { + @inlinable public func getStats() -> JSPromise { let this = jsObject return this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getStats() async throws -> WebTransportStats { + @inlinable public func getStats() async throws -> WebTransportStats { let this = jsObject let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -39,7 +39,7 @@ public class WebTransport: JSBridgedClass { @ReadonlyAttribute public var closed: JSPromise - public func close(closeInfo: WebTransportCloseInfo? = nil) { + @inlinable public func close(closeInfo: WebTransportCloseInfo? = nil) { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: [closeInfo?.jsValue() ?? .undefined]) } @@ -47,13 +47,13 @@ public class WebTransport: JSBridgedClass { @ReadonlyAttribute public var datagrams: WebTransportDatagramDuplexStream - public func createBidirectionalStream() -> JSPromise { + @inlinable public func createBidirectionalStream() -> JSPromise { let this = jsObject return this[Strings.createBidirectionalStream].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createBidirectionalStream() async throws -> WebTransportBidirectionalStream { + @inlinable public func createBidirectionalStream() async throws -> WebTransportBidirectionalStream { let this = jsObject let _promise: JSPromise = this[Strings.createBidirectionalStream].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -62,13 +62,13 @@ public class WebTransport: JSBridgedClass { @ReadonlyAttribute public var incomingBidirectionalStreams: ReadableStream - public func createUnidirectionalStream() -> JSPromise { + @inlinable public func createUnidirectionalStream() -> JSPromise { let this = jsObject return this[Strings.createUnidirectionalStream].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createUnidirectionalStream() async throws -> WritableStream { + @inlinable public func createUnidirectionalStream() async throws -> WritableStream { let this = jsObject let _promise: JSPromise = this[Strings.createUnidirectionalStream].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift b/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift index d4f351a0..113622c6 100644 --- a/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift +++ b/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebTransportBidirectionalStream: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WebTransportBidirectionalStream].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebTransportBidirectionalStream].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift b/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift index a3908148..0b0ae6fd 100644 --- a/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift +++ b/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebTransportDatagramDuplexStream: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WebTransportDatagramDuplexStream].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebTransportDatagramDuplexStream].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WebTransportError.swift b/Sources/DOMKit/WebIDL/WebTransportError.swift index 68b25bad..0fa243e9 100644 --- a/Sources/DOMKit/WebIDL/WebTransportError.swift +++ b/Sources/DOMKit/WebIDL/WebTransportError.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WebTransportError: DOMException { - override public class var constructor: JSFunction { JSObject.global[Strings.WebTransportError].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebTransportError].function! } public required init(unsafelyWrapping jsObject: JSObject) { _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) @@ -12,7 +12,7 @@ public class WebTransportError: DOMException { super.init(unsafelyWrapping: jsObject) } - public convenience init(init: WebTransportErrorInit? = nil) { + @inlinable public convenience init(init: WebTransportErrorInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift b/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift index 14ac3025..c9acd2f5 100644 --- a/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift +++ b/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift @@ -7,16 +7,16 @@ public enum WebTransportErrorSource: JSString, JSValueCompatible { case stream = "stream" case session = "session" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/WellKnownDirectory.swift b/Sources/DOMKit/WebIDL/WellKnownDirectory.swift index 31fda146..48d486fa 100644 --- a/Sources/DOMKit/WebIDL/WellKnownDirectory.swift +++ b/Sources/DOMKit/WebIDL/WellKnownDirectory.swift @@ -11,16 +11,16 @@ public enum WellKnownDirectory: JSString, JSValueCompatible { case pictures = "pictures" case videos = "videos" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/WheelEvent.swift b/Sources/DOMKit/WebIDL/WheelEvent.swift index 0fc4fb72..ff6e3f06 100644 --- a/Sources/DOMKit/WebIDL/WheelEvent.swift +++ b/Sources/DOMKit/WebIDL/WheelEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WheelEvent: MouseEvent { - override public class var constructor: JSFunction { JSObject.global[Strings.WheelEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WheelEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _deltaX = ReadonlyAttribute(jsObject: jsObject, name: Strings.deltaX) @@ -14,7 +14,7 @@ public class WheelEvent: MouseEvent { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: WheelEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: WheelEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 6a17e8a1..7d9dc407 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, WindowOrWorkerGlobalScope, AnimationFrameProvider, WindowSessionStorage, WindowLocalStorage { - override public class var constructor: JSFunction { JSObject.global[Strings.Window].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Window].function! } public required init(unsafelyWrapping jsObject: JSObject) { _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) @@ -76,12 +76,12 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var cookieStore: CookieStore - public func navigate(dir: SpatialNavigationDirection) { + @inlinable public func navigate(dir: SpatialNavigationDirection) { let this = jsObject _ = this[Strings.navigate].function!(this: this, arguments: [dir.jsValue()]) } - public func matchMedia(query: String) -> MediaQueryList { + @inlinable public func matchMedia(query: String) -> MediaQueryList { let this = jsObject return this[Strings.matchMedia].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! } @@ -89,22 +89,22 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var screen: Screen - public func moveTo(x: Int32, y: Int32) { + @inlinable public func moveTo(x: Int32, y: Int32) { let this = jsObject _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - public func moveBy(x: Int32, y: Int32) { + @inlinable public func moveBy(x: Int32, y: Int32) { let this = jsObject _ = this[Strings.moveBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - public func resizeTo(width: Int32, height: Int32) { + @inlinable public func resizeTo(width: Int32, height: Int32) { let this = jsObject _ = this[Strings.resizeTo].function!(this: this, arguments: [width.jsValue(), height.jsValue()]) } - public func resizeBy(x: Int32, y: Int32) { + @inlinable public func resizeBy(x: Int32, y: Int32) { let this = jsObject _ = this[Strings.resizeBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } @@ -127,32 +127,32 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var pageYOffset: Double - public func scroll(options: ScrollToOptions? = nil) { + @inlinable public func scroll(options: ScrollToOptions? = nil) { let this = jsObject _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } - public func scroll(x: Double, y: Double) { + @inlinable public func scroll(x: Double, y: Double) { let this = jsObject _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - public func scrollTo(options: ScrollToOptions? = nil) { + @inlinable public func scrollTo(options: ScrollToOptions? = nil) { let this = jsObject _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } - public func scrollTo(x: Double, y: Double) { + @inlinable public func scrollTo(x: Double, y: Double) { let this = jsObject _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } - public func scrollBy(options: ScrollToOptions? = nil) { + @inlinable public func scrollBy(options: ScrollToOptions? = nil) { let this = jsObject _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) } - public func scrollBy(x: Double, y: Double) { + @inlinable public func scrollBy(x: Double, y: Double) { let this = jsObject _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) } @@ -178,18 +178,18 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var devicePixelRatio: Double - public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { + @inlinable public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { let this = jsObject return this[Strings.getComputedStyle].function!(this: this, arguments: [elt.jsValue(), pseudoElt?.jsValue() ?? .undefined]).fromJSValue()! } - public func getDigitalGoodsService(serviceProvider: String) -> JSPromise { + @inlinable public func getDigitalGoodsService(serviceProvider: String) -> JSPromise { let this = jsObject return this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func getDigitalGoodsService(serviceProvider: String) async throws -> DigitalGoodsService { + @inlinable public func getDigitalGoodsService(serviceProvider: String) async throws -> DigitalGoodsService { let this = jsObject let _promise: JSPromise = this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -198,37 +198,37 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var event: __UNSUPPORTED_UNION__ - public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { + @inlinable public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { + @inlinable public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { let this = jsObject let _promise: JSPromise = this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { + @inlinable public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { + @inlinable public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { let this = jsObject let _promise: JSPromise = this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { + @inlinable public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { + @inlinable public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { let this = jsObject let _promise: JSPromise = this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -276,7 +276,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadWriteAttribute public var status: String - public func close() { + @inlinable public func close() { let this = jsObject _ = this[Strings.close].function!(this: this, arguments: []) } @@ -284,17 +284,17 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var closed: Bool - public func stop() { + @inlinable public func stop() { let this = jsObject _ = this[Strings.stop].function!(this: this, arguments: []) } - public func focus() { + @inlinable public func focus() { let this = jsObject _ = this[Strings.focus].function!(this: this, arguments: []) } - public func blur() { + @inlinable public func blur() { let this = jsObject _ = this[Strings.blur].function!(this: this, arguments: []) } @@ -317,12 +317,12 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var frameElement: Element? - public func open(url: String? = nil, target: String? = nil, features: String? = nil) -> WindowProxy? { + @inlinable public func open(url: String? = nil, target: String? = nil, features: String? = nil) -> WindowProxy? { let this = jsObject return this[Strings.open].function!(this: this, arguments: [url?.jsValue() ?? .undefined, target?.jsValue() ?? .undefined, features?.jsValue() ?? .undefined]).fromJSValue()! } - public subscript(key: String) -> JSObject { + @inlinable public subscript(key: String) -> JSObject { jsObject[key].fromJSValue()! } @@ -335,47 +335,47 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var originAgentCluster: Bool - public func alert() { + @inlinable public func alert() { let this = jsObject _ = this[Strings.alert].function!(this: this, arguments: []) } - public func alert(message: String) { + @inlinable public func alert(message: String) { let this = jsObject _ = this[Strings.alert].function!(this: this, arguments: [message.jsValue()]) } - public func confirm(message: String? = nil) -> Bool { + @inlinable public func confirm(message: String? = nil) -> Bool { let this = jsObject return this[Strings.confirm].function!(this: this, arguments: [message?.jsValue() ?? .undefined]).fromJSValue()! } - public func prompt(message: String? = nil, default: String? = nil) -> String? { + @inlinable public func prompt(message: String? = nil, default: String? = nil) -> String? { let this = jsObject return this[Strings.prompt].function!(this: this, arguments: [message?.jsValue() ?? .undefined, `default`?.jsValue() ?? .undefined]).fromJSValue()! } - public func print() { + @inlinable public func print() { let this = jsObject _ = this[Strings.print].function!(this: this, arguments: []) } - public func postMessage(message: JSValue, targetOrigin: String, transfer: [JSObject]? = nil) { + @inlinable public func postMessage(message: JSValue, targetOrigin: String, transfer: [JSObject]? = nil) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined]) } - public func postMessage(message: JSValue, options: WindowPostMessageOptions? = nil) { + @inlinable public func postMessage(message: JSValue, options: WindowPostMessageOptions? = nil) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } - public func captureEvents() { + @inlinable public func captureEvents() { let this = jsObject _ = this[Strings.captureEvents].function!(this: this, arguments: []) } - public func releaseEvents() { + @inlinable public func releaseEvents() { let this = jsObject _ = this[Strings.releaseEvents].function!(this: this, arguments: []) } @@ -409,12 +409,12 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind // XXX: member 'requestIdleCallback' is ignored - public func cancelIdleCallback(handle: UInt32) { + @inlinable public func cancelIdleCallback(handle: UInt32) { let this = jsObject _ = this[Strings.cancelIdleCallback].function!(this: this, arguments: [handle.jsValue()]) } - public func getSelection() -> Selection? { + @inlinable public func getSelection() -> Selection? { let this = jsObject return this[Strings.getSelection].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/WindowClient.swift b/Sources/DOMKit/WebIDL/WindowClient.swift index 22aaab32..4ca9c306 100644 --- a/Sources/DOMKit/WebIDL/WindowClient.swift +++ b/Sources/DOMKit/WebIDL/WindowClient.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WindowClient: Client { - override public class var constructor: JSFunction { JSObject.global[Strings.WindowClient].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WindowClient].function! } public required init(unsafelyWrapping jsObject: JSObject) { _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibilityState) @@ -22,25 +22,25 @@ public class WindowClient: Client { @ReadonlyAttribute public var ancestorOrigins: [String] - public func focus() -> JSPromise { + @inlinable public func focus() -> JSPromise { let this = jsObject return this[Strings.focus].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func focus() async throws -> WindowClient { + @inlinable public func focus() async throws -> WindowClient { let this = jsObject let _promise: JSPromise = this[Strings.focus].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func navigate(url: String) -> JSPromise { + @inlinable public func navigate(url: String) -> JSPromise { let this = jsObject return this[Strings.navigate].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func navigate(url: String) async throws -> WindowClient? { + @inlinable public func navigate(url: String) async throws -> WindowClient? { let this = jsObject let _promise: JSPromise = this[Strings.navigate].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift index 2fb4c280..cec15a74 100644 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WindowControlsOverlay: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.WindowControlsOverlay].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WindowControlsOverlay].function! } public required init(unsafelyWrapping jsObject: JSObject) { _visible = ReadonlyAttribute(jsObject: jsObject, name: Strings.visible) @@ -15,7 +15,7 @@ public class WindowControlsOverlay: EventTarget { @ReadonlyAttribute public var visible: Bool - public func getTitlebarAreaRect() -> DOMRect { + @inlinable public func getTitlebarAreaRect() -> DOMRect { let this = jsObject return this[Strings.getTitlebarAreaRect].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift index f19fc667..90494080 100644 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WindowControlsOverlayGeometryChangeEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.WindowControlsOverlayGeometryChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WindowControlsOverlayGeometryChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _titlebarAreaRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.titlebarAreaRect) @@ -12,7 +12,7 @@ public class WindowControlsOverlayGeometryChangeEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: WindowControlsOverlayGeometryChangeEventInit) { + @inlinable public convenience init(type: String, eventInitDict: WindowControlsOverlayGeometryChangeEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index 52eb6527..2d6d9d9b 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -5,97 +5,97 @@ import JavaScriptKit public protocol WindowEventHandlers: JSBridgedClass {} public extension WindowEventHandlers { - var ongamepadconnected: EventHandler { + @inlinable var ongamepadconnected: EventHandler { get { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] } set { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] = newValue } } - var ongamepaddisconnected: EventHandler { + @inlinable var ongamepaddisconnected: EventHandler { get { ClosureAttribute1Optional[Strings.ongamepaddisconnected, in: jsObject] } set { ClosureAttribute1Optional[Strings.ongamepaddisconnected, in: jsObject] = newValue } } - var onafterprint: EventHandler { + @inlinable var onafterprint: EventHandler { get { ClosureAttribute1Optional[Strings.onafterprint, in: jsObject] } set { ClosureAttribute1Optional[Strings.onafterprint, in: jsObject] = newValue } } - var onbeforeprint: EventHandler { + @inlinable var onbeforeprint: EventHandler { get { ClosureAttribute1Optional[Strings.onbeforeprint, in: jsObject] } set { ClosureAttribute1Optional[Strings.onbeforeprint, in: jsObject] = newValue } } - var onbeforeunload: OnBeforeUnloadEventHandler { + @inlinable var onbeforeunload: OnBeforeUnloadEventHandler { get { ClosureAttribute1Optional[Strings.onbeforeunload, in: jsObject] } set { ClosureAttribute1Optional[Strings.onbeforeunload, in: jsObject] = newValue } } - var onhashchange: EventHandler { + @inlinable var onhashchange: EventHandler { get { ClosureAttribute1Optional[Strings.onhashchange, in: jsObject] } set { ClosureAttribute1Optional[Strings.onhashchange, in: jsObject] = newValue } } - var onlanguagechange: EventHandler { + @inlinable var onlanguagechange: EventHandler { get { ClosureAttribute1Optional[Strings.onlanguagechange, in: jsObject] } set { ClosureAttribute1Optional[Strings.onlanguagechange, in: jsObject] = newValue } } - var onmessage: EventHandler { + @inlinable var onmessage: EventHandler { get { ClosureAttribute1Optional[Strings.onmessage, in: jsObject] } set { ClosureAttribute1Optional[Strings.onmessage, in: jsObject] = newValue } } - var onmessageerror: EventHandler { + @inlinable var onmessageerror: EventHandler { get { ClosureAttribute1Optional[Strings.onmessageerror, in: jsObject] } set { ClosureAttribute1Optional[Strings.onmessageerror, in: jsObject] = newValue } } - var onoffline: EventHandler { + @inlinable var onoffline: EventHandler { get { ClosureAttribute1Optional[Strings.onoffline, in: jsObject] } set { ClosureAttribute1Optional[Strings.onoffline, in: jsObject] = newValue } } - var ononline: EventHandler { + @inlinable var ononline: EventHandler { get { ClosureAttribute1Optional[Strings.ononline, in: jsObject] } set { ClosureAttribute1Optional[Strings.ononline, in: jsObject] = newValue } } - var onpagehide: EventHandler { + @inlinable var onpagehide: EventHandler { get { ClosureAttribute1Optional[Strings.onpagehide, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpagehide, in: jsObject] = newValue } } - var onpageshow: EventHandler { + @inlinable var onpageshow: EventHandler { get { ClosureAttribute1Optional[Strings.onpageshow, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpageshow, in: jsObject] = newValue } } - var onpopstate: EventHandler { + @inlinable var onpopstate: EventHandler { get { ClosureAttribute1Optional[Strings.onpopstate, in: jsObject] } set { ClosureAttribute1Optional[Strings.onpopstate, in: jsObject] = newValue } } - var onrejectionhandled: EventHandler { + @inlinable var onrejectionhandled: EventHandler { get { ClosureAttribute1Optional[Strings.onrejectionhandled, in: jsObject] } set { ClosureAttribute1Optional[Strings.onrejectionhandled, in: jsObject] = newValue } } - var onstorage: EventHandler { + @inlinable var onstorage: EventHandler { get { ClosureAttribute1Optional[Strings.onstorage, in: jsObject] } set { ClosureAttribute1Optional[Strings.onstorage, in: jsObject] = newValue } } - var onunhandledrejection: EventHandler { + @inlinable var onunhandledrejection: EventHandler { get { ClosureAttribute1Optional[Strings.onunhandledrejection, in: jsObject] } set { ClosureAttribute1Optional[Strings.onunhandledrejection, in: jsObject] = newValue } } - var onunload: EventHandler { + @inlinable var onunload: EventHandler { get { ClosureAttribute1Optional[Strings.onunload, in: jsObject] } set { ClosureAttribute1Optional[Strings.onunload, in: jsObject] = newValue } } - var onportalactivate: EventHandler { + @inlinable var onportalactivate: EventHandler { get { ClosureAttribute1Optional[Strings.onportalactivate, in: jsObject] } set { ClosureAttribute1Optional[Strings.onportalactivate, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/WindowLocalStorage.swift b/Sources/DOMKit/WebIDL/WindowLocalStorage.swift index 909b1fe9..c46d62fe 100644 --- a/Sources/DOMKit/WebIDL/WindowLocalStorage.swift +++ b/Sources/DOMKit/WebIDL/WindowLocalStorage.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol WindowLocalStorage: JSBridgedClass {} public extension WindowLocalStorage { - var localStorage: Storage { ReadonlyAttribute[Strings.localStorage, in: jsObject] } + @inlinable var localStorage: Storage { ReadonlyAttribute[Strings.localStorage, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index 125982bd..c7a0632b 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -5,80 +5,80 @@ import JavaScriptKit public protocol WindowOrWorkerGlobalScope: JSBridgedClass {} public extension WindowOrWorkerGlobalScope { - var indexedDB: IDBFactory { ReadonlyAttribute[Strings.indexedDB, in: jsObject] } + @inlinable var indexedDB: IDBFactory { ReadonlyAttribute[Strings.indexedDB, in: jsObject] } - var crypto: Crypto { ReadonlyAttribute[Strings.crypto, in: jsObject] } + @inlinable var crypto: Crypto { ReadonlyAttribute[Strings.crypto, in: jsObject] } - func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { + @inlinable func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { let this = jsObject return this[Strings.fetch].function!(this: this, arguments: [input.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func fetch(input: RequestInfo, init: RequestInit? = nil) async throws -> Response { + @inlinable func fetch(input: RequestInfo, init: RequestInit? = nil) async throws -> Response { let this = jsObject let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [input.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - var performance: Performance { ReadonlyAttribute[Strings.performance, in: jsObject] } + @inlinable var performance: Performance { ReadonlyAttribute[Strings.performance, in: jsObject] } - var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } + @inlinable var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } - var isSecureContext: Bool { ReadonlyAttribute[Strings.isSecureContext, in: jsObject] } + @inlinable var isSecureContext: Bool { ReadonlyAttribute[Strings.isSecureContext, in: jsObject] } - var crossOriginIsolated: Bool { ReadonlyAttribute[Strings.crossOriginIsolated, in: jsObject] } + @inlinable var crossOriginIsolated: Bool { ReadonlyAttribute[Strings.crossOriginIsolated, in: jsObject] } - func reportError(e: JSValue) { + @inlinable func reportError(e: JSValue) { let this = jsObject _ = this[Strings.reportError].function!(this: this, arguments: [e.jsValue()]) } - func btoa(data: String) -> String { + @inlinable func btoa(data: String) -> String { let this = jsObject return this[Strings.btoa].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } - func atob(data: String) -> String { + @inlinable func atob(data: String) -> String { let this = jsObject return this[Strings.atob].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! } - func setTimeout(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { + @inlinable func setTimeout(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { let this = jsObject return this[Strings.setTimeout].function!(this: this, arguments: [handler.jsValue(), timeout?.jsValue() ?? .undefined] + arguments.map { $0.jsValue() }).fromJSValue()! } - func clearTimeout(id: Int32? = nil) { + @inlinable func clearTimeout(id: Int32? = nil) { let this = jsObject _ = this[Strings.clearTimeout].function!(this: this, arguments: [id?.jsValue() ?? .undefined]) } - func setInterval(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { + @inlinable func setInterval(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { let this = jsObject return this[Strings.setInterval].function!(this: this, arguments: [handler.jsValue(), timeout?.jsValue() ?? .undefined] + arguments.map { $0.jsValue() }).fromJSValue()! } - func clearInterval(id: Int32? = nil) { + @inlinable func clearInterval(id: Int32? = nil) { let this = jsObject _ = this[Strings.clearInterval].function!(this: this, arguments: [id?.jsValue() ?? .undefined]) } // XXX: method 'queueMicrotask' is ignored - func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) -> JSPromise { + @inlinable func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.createImageBitmap].function!(this: this, arguments: [image.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { + @inlinable func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { let this = jsObject let _promise: JSPromise = this[Strings.createImageBitmap].function!(this: this, arguments: [image.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! } - func createImageBitmap(image: ImageBitmapSource, sx: Int32, sy: Int32, sw: Int32, sh: Int32, options: ImageBitmapOptions? = nil) -> JSPromise { + @inlinable func createImageBitmap(image: ImageBitmapSource, sx: Int32, sy: Int32, sw: Int32, sh: Int32, options: ImageBitmapOptions? = nil) -> JSPromise { let _arg0 = image.jsValue() let _arg1 = sx.jsValue() let _arg2 = sy.jsValue() @@ -90,7 +90,7 @@ public extension WindowOrWorkerGlobalScope { } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func createImageBitmap(image: ImageBitmapSource, sx: Int32, sy: Int32, sw: Int32, sh: Int32, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { + @inlinable func createImageBitmap(image: ImageBitmapSource, sx: Int32, sy: Int32, sw: Int32, sh: Int32, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { let _arg0 = image.jsValue() let _arg1 = sx.jsValue() let _arg2 = sy.jsValue() @@ -102,16 +102,16 @@ public extension WindowOrWorkerGlobalScope { return try await _promise.get().fromJSValue()! } - func structuredClone(value: JSValue, options: StructuredSerializeOptions? = nil) -> JSValue { + @inlinable func structuredClone(value: JSValue, options: StructuredSerializeOptions? = nil) -> JSValue { let this = jsObject return this[Strings.structuredClone].function!(this: this, arguments: [value.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - var originPolicyIds: [String] { ReadonlyAttribute[Strings.originPolicyIds, in: jsObject] } + @inlinable var originPolicyIds: [String] { ReadonlyAttribute[Strings.originPolicyIds, in: jsObject] } - var scheduler: Scheduler { ReadonlyAttribute[Strings.scheduler, in: jsObject] } + @inlinable var scheduler: Scheduler { ReadonlyAttribute[Strings.scheduler, in: jsObject] } - var caches: CacheStorage { ReadonlyAttribute[Strings.caches, in: jsObject] } + @inlinable var caches: CacheStorage { ReadonlyAttribute[Strings.caches, in: jsObject] } - var trustedTypes: TrustedTypePolicyFactory { ReadonlyAttribute[Strings.trustedTypes, in: jsObject] } + @inlinable var trustedTypes: TrustedTypePolicyFactory { ReadonlyAttribute[Strings.trustedTypes, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/WindowSessionStorage.swift b/Sources/DOMKit/WebIDL/WindowSessionStorage.swift index 19ea0aae..0e299f3f 100644 --- a/Sources/DOMKit/WebIDL/WindowSessionStorage.swift +++ b/Sources/DOMKit/WebIDL/WindowSessionStorage.swift @@ -5,5 +5,5 @@ import JavaScriptKit public protocol WindowSessionStorage: JSBridgedClass {} public extension WindowSessionStorage { - var sessionStorage: Storage { ReadonlyAttribute[Strings.sessionStorage, in: jsObject] } + @inlinable var sessionStorage: Storage { ReadonlyAttribute[Strings.sessionStorage, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index 3b801f15..07af18e2 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Worker: EventTarget, AbstractWorker { - override public class var constructor: JSFunction { JSObject.global[Strings.Worker].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Worker].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) @@ -12,21 +12,21 @@ public class Worker: EventTarget, AbstractWorker { super.init(unsafelyWrapping: jsObject) } - public convenience init(scriptURL: String, options: WorkerOptions? = nil) { + @inlinable public convenience init(scriptURL: String, options: WorkerOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined])) } - public func terminate() { + @inlinable public func terminate() { let this = jsObject _ = this[Strings.terminate].function!(this: this, arguments: []) } - public func postMessage(message: JSValue, transfer: [JSObject]) { + @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) } - public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { + @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift index 9d73fedc..5310f997 100644 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkerGlobalScope: EventTarget, FontFaceSource, WindowOrWorkerGlobalScope { - override public class var constructor: JSFunction { JSObject.global[Strings.WorkerGlobalScope].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WorkerGlobalScope].function! } public required init(unsafelyWrapping jsObject: JSObject) { _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) @@ -28,7 +28,7 @@ public class WorkerGlobalScope: EventTarget, FontFaceSource, WindowOrWorkerGloba @ReadonlyAttribute public var navigator: WorkerNavigator - public func importScripts(urls: String...) { + @inlinable public func importScripts(urls: String...) { let this = jsObject _ = this[Strings.importScripts].function!(this: this, arguments: urls.map { $0.jsValue() }) } diff --git a/Sources/DOMKit/WebIDL/WorkerLocation.swift b/Sources/DOMKit/WebIDL/WorkerLocation.swift index 4006e45d..7bf94015 100644 --- a/Sources/DOMKit/WebIDL/WorkerLocation.swift +++ b/Sources/DOMKit/WebIDL/WorkerLocation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkerLocation: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WorkerLocation].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkerLocation].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WorkerNavigator.swift b/Sources/DOMKit/WebIDL/WorkerNavigator.swift index 100dfc77..144d93e8 100644 --- a/Sources/DOMKit/WebIDL/WorkerNavigator.swift +++ b/Sources/DOMKit/WebIDL/WorkerNavigator.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkerNavigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware, NavigatorNetworkInformation, NavigatorStorage, NavigatorUA, NavigatorLocks, NavigatorGPU, NavigatorML { - public class var constructor: JSFunction { JSObject.global[Strings.WorkerNavigator].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkerNavigator].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WorkerType.swift b/Sources/DOMKit/WebIDL/WorkerType.swift index bf3e953d..6cdbf4e8 100644 --- a/Sources/DOMKit/WebIDL/WorkerType.swift +++ b/Sources/DOMKit/WebIDL/WorkerType.swift @@ -7,16 +7,16 @@ public enum WorkerType: JSString, JSValueCompatible { case classic = "classic" case module = "module" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/Worklet.swift b/Sources/DOMKit/WebIDL/Worklet.swift index d23fe1f0..12fe899f 100644 --- a/Sources/DOMKit/WebIDL/Worklet.swift +++ b/Sources/DOMKit/WebIDL/Worklet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class Worklet: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.Worklet].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Worklet].function! } public let jsObject: JSObject @@ -12,13 +12,13 @@ public class Worklet: JSBridgedClass { self.jsObject = jsObject } - public func addModule(moduleURL: String, options: WorkletOptions? = nil) -> JSPromise { + @inlinable public func addModule(moduleURL: String, options: WorkletOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.addModule].function!(this: this, arguments: [moduleURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func addModule(moduleURL: String, options: WorkletOptions? = nil) async throws { + @inlinable public func addModule(moduleURL: String, options: WorkletOptions? = nil) async throws { let this = jsObject let _promise: JSPromise = this[Strings.addModule].function!(this: this, arguments: [moduleURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/WorkletAnimation.swift b/Sources/DOMKit/WebIDL/WorkletAnimation.swift index 03cfb3c9..5011fd59 100644 --- a/Sources/DOMKit/WebIDL/WorkletAnimation.swift +++ b/Sources/DOMKit/WebIDL/WorkletAnimation.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkletAnimation: Animation { - override public class var constructor: JSFunction { JSObject.global[Strings.WorkletAnimation].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WorkletAnimation].function! } public required init(unsafelyWrapping jsObject: JSObject) { _animatorName = ReadonlyAttribute(jsObject: jsObject, name: Strings.animatorName) super.init(unsafelyWrapping: jsObject) } - public convenience init(animatorName: String, effects: __UNSUPPORTED_UNION__? = nil, timeline: AnimationTimeline? = nil, options: JSValue? = nil) { + @inlinable public convenience init(animatorName: String, effects: __UNSUPPORTED_UNION__? = nil, timeline: AnimationTimeline? = nil, options: JSValue? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [animatorName.jsValue(), effects?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift b/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift index c7833f7f..5d747d00 100644 --- a/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift +++ b/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkletAnimationEffect: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WorkletAnimationEffect].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkletAnimationEffect].function! } public let jsObject: JSObject @@ -13,12 +13,12 @@ public class WorkletAnimationEffect: JSBridgedClass { self.jsObject = jsObject } - public func getTiming() -> EffectTiming { + @inlinable public func getTiming() -> EffectTiming { let this = jsObject return this[Strings.getTiming].function!(this: this, arguments: []).fromJSValue()! } - public func getComputedTiming() -> ComputedEffectTiming { + @inlinable public func getComputedTiming() -> ComputedEffectTiming { let this = jsObject return this[Strings.getComputedTiming].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift index 59a0339a..20f211bb 100644 --- a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkletGlobalScope: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WorkletGlobalScope].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkletGlobalScope].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift b/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift index e614cb75..2406c270 100644 --- a/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift +++ b/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WorkletGroupEffect: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WorkletGroupEffect].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkletGroupEffect].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class WorkletGroupEffect: JSBridgedClass { self.jsObject = jsObject } - public func getChildren() -> [WorkletAnimationEffect] { + @inlinable public func getChildren() -> [WorkletAnimationEffect] { let this = jsObject return this[Strings.getChildren].function!(this: this, arguments: []).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift index 3fa32f16..8598e42d 100644 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WritableStream: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WritableStream].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WritableStream].function! } public let jsObject: JSObject @@ -13,38 +13,38 @@ public class WritableStream: JSBridgedClass { self.jsObject = jsObject } - public convenience init(underlyingSink: JSObject? = nil, strategy: QueuingStrategy? = nil) { + @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 - public func abort(reason: JSValue? = nil) -> 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, *) - public func abort(reason: JSValue? = nil) async throws { + @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.get() } - public func close() -> JSPromise { + @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, *) - public func close() async throws { + @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func getWriter() -> WritableStreamDefaultWriter { + @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 index da49d5f5..3f17fa84 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WritableStreamDefaultController: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WritableStreamDefaultController].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WritableStreamDefaultController].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class WritableStreamDefaultController: JSBridgedClass { @ReadonlyAttribute public var signal: AbortSignal - public func error(e: JSValue? = nil) { + @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 index db957e0b..e5b59d99 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WritableStreamDefaultWriter: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.WritableStreamDefaultWriter].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WritableStreamDefaultWriter].function! } public let jsObject: JSObject @@ -15,7 +15,7 @@ public class WritableStreamDefaultWriter: JSBridgedClass { self.jsObject = jsObject } - public convenience init(stream: WritableStream) { + @inlinable public convenience init(stream: WritableStream) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) } @@ -28,42 +28,42 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @ReadonlyAttribute public var ready: JSPromise - public func abort(reason: JSValue? = nil) -> 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, *) - public func abort(reason: JSValue? = nil) async throws { + @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.get() } - public func close() -> JSPromise { + @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, *) - public func close() async throws { + @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() } - public func releaseLock() { + @inlinable public func releaseLock() { let this = jsObject _ = this[Strings.releaseLock].function!(this: this, arguments: []) } - public func write(chunk: JSValue? = nil) -> JSPromise { + @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, *) - public func write(chunk: JSValue? = nil) async throws { + @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.get() diff --git a/Sources/DOMKit/WebIDL/WriteCommandType.swift b/Sources/DOMKit/WebIDL/WriteCommandType.swift index ac9d4462..c6a020a7 100644 --- a/Sources/DOMKit/WebIDL/WriteCommandType.swift +++ b/Sources/DOMKit/WebIDL/WriteCommandType.swift @@ -8,16 +8,16 @@ public enum WriteCommandType: JSString, JSValueCompatible { case seek = "seek" case truncate = "truncate" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XMLDocument.swift b/Sources/DOMKit/WebIDL/XMLDocument.swift index 4b90ce5e..7debba4e 100644 --- a/Sources/DOMKit/WebIDL/XMLDocument.swift +++ b/Sources/DOMKit/WebIDL/XMLDocument.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XMLDocument: Document { - override public class var constructor: JSFunction { JSObject.global[Strings.XMLDocument].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XMLDocument].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index 10d907ff..c0fe2006 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XMLHttpRequest: XMLHttpRequestEventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequest].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequest].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onreadystatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreadystatechange) @@ -22,7 +22,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { super.init(unsafelyWrapping: jsObject) } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -42,17 +42,17 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { @ReadonlyAttribute public var readyState: UInt16 - public func open(method: String, url: String) { + @inlinable public func open(method: String, url: String) { let this = jsObject _ = this[Strings.open].function!(this: this, arguments: [method.jsValue(), url.jsValue()]) } - public func open(method: String, url: String, async: Bool, username: String? = nil, password: String? = nil) { + @inlinable public func open(method: String, url: String, async: Bool, username: String? = nil, password: String? = nil) { let this = jsObject _ = this[Strings.open].function!(this: this, arguments: [method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined]) } - public func setRequestHeader(name: String, value: String) { + @inlinable public func setRequestHeader(name: String, value: String) { let this = jsObject _ = this[Strings.setRequestHeader].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) } @@ -66,12 +66,12 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { @ReadonlyAttribute public var upload: XMLHttpRequestUpload - public func send(body: __UNSUPPORTED_UNION__? = nil) { + @inlinable public func send(body: __UNSUPPORTED_UNION__? = nil) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [body?.jsValue() ?? .undefined]) } - public func abort() { + @inlinable public func abort() { let this = jsObject _ = this[Strings.abort].function!(this: this, arguments: []) } @@ -85,17 +85,17 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { @ReadonlyAttribute public var statusText: String - public func getResponseHeader(name: String) -> String? { + @inlinable public func getResponseHeader(name: String) -> String? { let this = jsObject return this[Strings.getResponseHeader].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - public func getAllResponseHeaders() -> String { + @inlinable public func getAllResponseHeaders() -> String { let this = jsObject return this[Strings.getAllResponseHeaders].function!(this: this, arguments: []).fromJSValue()! } - public func overrideMimeType(mime: String) { + @inlinable public func overrideMimeType(mime: String) { let this = jsObject _ = this[Strings.overrideMimeType].function!(this: this, arguments: [mime.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift index d55db1f0..6ca9430c 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestEventTarget.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XMLHttpRequestEventTarget: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequestEventTarget].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequestEventTarget].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onloadstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloadstart) diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift index dd867ba5..4a96acb6 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift @@ -11,16 +11,16 @@ public enum XMLHttpRequestResponseType: JSString, JSValueCompatible { case json = "json" case text = "text" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift index 324401df..68459258 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestUpload.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XMLHttpRequestUpload: XMLHttpRequestEventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequestUpload].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XMLHttpRequestUpload].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/XMLSerializer.swift b/Sources/DOMKit/WebIDL/XMLSerializer.swift index ba740348..e504c44f 100644 --- a/Sources/DOMKit/WebIDL/XMLSerializer.swift +++ b/Sources/DOMKit/WebIDL/XMLSerializer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XMLSerializer: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XMLSerializer].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XMLSerializer].function! } public let jsObject: JSObject @@ -12,11 +12,11 @@ public class XMLSerializer: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public func serializeToString(root: Node) -> String { + @inlinable public func serializeToString(root: Node) -> String { let this = jsObject return this[Strings.serializeToString].function!(this: this, arguments: [root.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XPathEvaluator.swift b/Sources/DOMKit/WebIDL/XPathEvaluator.swift index e37dee14..546d5ce5 100644 --- a/Sources/DOMKit/WebIDL/XPathEvaluator.swift +++ b/Sources/DOMKit/WebIDL/XPathEvaluator.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XPathEvaluator: JSBridgedClass, XPathEvaluatorBase { - public class var constructor: JSFunction { JSObject.global[Strings.XPathEvaluator].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XPathEvaluator].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class XPathEvaluator: JSBridgedClass, XPathEvaluatorBase { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } } diff --git a/Sources/DOMKit/WebIDL/XPathExpression.swift b/Sources/DOMKit/WebIDL/XPathExpression.swift index 465c5094..2eb12393 100644 --- a/Sources/DOMKit/WebIDL/XPathExpression.swift +++ b/Sources/DOMKit/WebIDL/XPathExpression.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XPathExpression: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XPathExpression].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XPathExpression].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class XPathExpression: JSBridgedClass { self.jsObject = jsObject } - public func evaluate(contextNode: Node, type: UInt16? = nil, result: XPathResult? = nil) -> XPathResult { + @inlinable public func evaluate(contextNode: Node, type: UInt16? = nil, result: XPathResult? = nil) -> XPathResult { let this = jsObject return this[Strings.evaluate].function!(this: this, arguments: [contextNode.jsValue(), type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XPathResult.swift b/Sources/DOMKit/WebIDL/XPathResult.swift index bb70e65b..3e339365 100644 --- a/Sources/DOMKit/WebIDL/XPathResult.swift +++ b/Sources/DOMKit/WebIDL/XPathResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XPathResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XPathResult].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XPathResult].function! } public let jsObject: JSObject @@ -60,12 +60,12 @@ public class XPathResult: JSBridgedClass { @ReadonlyAttribute public var snapshotLength: UInt32 - public func iterateNext() -> Node? { + @inlinable public func iterateNext() -> Node? { let this = jsObject return this[Strings.iterateNext].function!(this: this, arguments: []).fromJSValue()! } - public func snapshotItem(index: UInt32) -> Node? { + @inlinable public func snapshotItem(index: UInt32) -> Node? { let this = jsObject return this[Strings.snapshotItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRAnchor.swift b/Sources/DOMKit/WebIDL/XRAnchor.swift index d3bda1ce..95dc991b 100644 --- a/Sources/DOMKit/WebIDL/XRAnchor.swift +++ b/Sources/DOMKit/WebIDL/XRAnchor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRAnchor: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRAnchor].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRAnchor].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class XRAnchor: JSBridgedClass { @ReadonlyAttribute public var anchorSpace: XRSpace - public func delete() { + @inlinable public func delete() { let this = jsObject _ = this[Strings.delete].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/XRAnchorSet.swift b/Sources/DOMKit/WebIDL/XRAnchorSet.swift index 663dd0c3..f069fecb 100644 --- a/Sources/DOMKit/WebIDL/XRAnchorSet.swift +++ b/Sources/DOMKit/WebIDL/XRAnchorSet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRAnchorSet: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRAnchorSet].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRAnchorSet].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift b/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift index ab600f31..7ddd390a 100644 --- a/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift +++ b/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRBoundedReferenceSpace: XRReferenceSpace { - override public class var constructor: JSFunction { JSObject.global[Strings.XRBoundedReferenceSpace].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRBoundedReferenceSpace].function! } public required init(unsafelyWrapping jsObject: JSObject) { _boundsGeometry = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundsGeometry) diff --git a/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift b/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift index e8f008ae..8271325a 100644 --- a/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift +++ b/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRCPUDepthInformation: XRDepthInformation { - override public class var constructor: JSFunction { JSObject.global[Strings.XRCPUDepthInformation].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRCPUDepthInformation].function! } public required init(unsafelyWrapping jsObject: JSObject) { _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) @@ -14,7 +14,7 @@ public class XRCPUDepthInformation: XRDepthInformation { @ReadonlyAttribute public var data: ArrayBuffer - public func getDepthInMeters(x: Float, y: Float) -> Float { + @inlinable public func getDepthInMeters(x: Float, y: Float) -> Float { let this = jsObject return this[Strings.getDepthInMeters].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRCompositionLayer.swift b/Sources/DOMKit/WebIDL/XRCompositionLayer.swift index db72c67e..3c05260f 100644 --- a/Sources/DOMKit/WebIDL/XRCompositionLayer.swift +++ b/Sources/DOMKit/WebIDL/XRCompositionLayer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRCompositionLayer: XRLayer { - override public class var constructor: JSFunction { JSObject.global[Strings.XRCompositionLayer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRCompositionLayer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _layout = ReadonlyAttribute(jsObject: jsObject, name: Strings.layout) @@ -30,7 +30,7 @@ public class XRCompositionLayer: XRLayer { @ReadonlyAttribute public var needsRedraw: Bool - public func destroy() { + @inlinable public func destroy() { let this = jsObject _ = this[Strings.destroy].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/XRCubeLayer.swift b/Sources/DOMKit/WebIDL/XRCubeLayer.swift index ea470713..38a39794 100644 --- a/Sources/DOMKit/WebIDL/XRCubeLayer.swift +++ b/Sources/DOMKit/WebIDL/XRCubeLayer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRCubeLayer: XRCompositionLayer { - override public class var constructor: JSFunction { JSObject.global[Strings.XRCubeLayer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRCubeLayer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) diff --git a/Sources/DOMKit/WebIDL/XRCylinderLayer.swift b/Sources/DOMKit/WebIDL/XRCylinderLayer.swift index 179be2b8..182c74e3 100644 --- a/Sources/DOMKit/WebIDL/XRCylinderLayer.swift +++ b/Sources/DOMKit/WebIDL/XRCylinderLayer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRCylinderLayer: XRCompositionLayer { - override public class var constructor: JSFunction { JSObject.global[Strings.XRCylinderLayer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRCylinderLayer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift index d125588b..4c9b9236 100644 --- a/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift +++ b/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift @@ -8,16 +8,16 @@ public enum XRDOMOverlayType: JSString, JSValueCompatible { case floating = "floating" case headLocked = "head-locked" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift b/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift index 6dcfabfd..3bd9c3e7 100644 --- a/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift +++ b/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift @@ -7,16 +7,16 @@ public enum XRDepthDataFormat: JSString, JSValueCompatible { case luminanceAlpha = "luminance-alpha" case float32 = "float32" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRDepthInformation.swift b/Sources/DOMKit/WebIDL/XRDepthInformation.swift index 83f5a9b7..5b411708 100644 --- a/Sources/DOMKit/WebIDL/XRDepthInformation.swift +++ b/Sources/DOMKit/WebIDL/XRDepthInformation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRDepthInformation: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRDepthInformation].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRDepthInformation].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRDepthUsage.swift b/Sources/DOMKit/WebIDL/XRDepthUsage.swift index f949fca4..dcb4b25d 100644 --- a/Sources/DOMKit/WebIDL/XRDepthUsage.swift +++ b/Sources/DOMKit/WebIDL/XRDepthUsage.swift @@ -7,16 +7,16 @@ public enum XRDepthUsage: JSString, JSValueCompatible { case cpuOptimized = "cpu-optimized" case gpuOptimized = "gpu-optimized" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift b/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift index f1f4f8fe..4341fbf7 100644 --- a/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift +++ b/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift @@ -8,16 +8,16 @@ public enum XREnvironmentBlendMode: JSString, JSValueCompatible { case alphaBlend = "alpha-blend" case additive = "additive" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XREquirectLayer.swift b/Sources/DOMKit/WebIDL/XREquirectLayer.swift index c161f741..a1638e39 100644 --- a/Sources/DOMKit/WebIDL/XREquirectLayer.swift +++ b/Sources/DOMKit/WebIDL/XREquirectLayer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XREquirectLayer: XRCompositionLayer { - override public class var constructor: JSFunction { JSObject.global[Strings.XREquirectLayer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XREquirectLayer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) diff --git a/Sources/DOMKit/WebIDL/XREye.swift b/Sources/DOMKit/WebIDL/XREye.swift index af03e97a..4b22aa16 100644 --- a/Sources/DOMKit/WebIDL/XREye.swift +++ b/Sources/DOMKit/WebIDL/XREye.swift @@ -8,16 +8,16 @@ public enum XREye: JSString, JSValueCompatible { case left = "left" case right = "right" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRFrame.swift b/Sources/DOMKit/WebIDL/XRFrame.swift index e597773d..c5ebbab9 100644 --- a/Sources/DOMKit/WebIDL/XRFrame.swift +++ b/Sources/DOMKit/WebIDL/XRFrame.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRFrame: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRFrame].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRFrame].function! } public let jsObject: JSObject @@ -15,13 +15,13 @@ public class XRFrame: JSBridgedClass { self.jsObject = jsObject } - public func createAnchor(pose: XRRigidTransform, space: XRSpace) -> JSPromise { + @inlinable public func createAnchor(pose: XRRigidTransform, space: XRSpace) -> JSPromise { let this = jsObject return this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue(), space.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createAnchor(pose: XRRigidTransform, space: XRSpace) async throws -> XRAnchor { + @inlinable public func createAnchor(pose: XRRigidTransform, space: XRSpace) async throws -> XRAnchor { let this = jsObject let _promise: JSPromise = this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue(), space.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -30,37 +30,37 @@ public class XRFrame: JSBridgedClass { @ReadonlyAttribute public var trackedAnchors: XRAnchorSet - public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { + @inlinable public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { let this = jsObject return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! } - public func getJointPose(joint: XRJointSpace, baseSpace: XRSpace) -> XRJointPose? { + @inlinable public func getJointPose(joint: XRJointSpace, baseSpace: XRSpace) -> XRJointPose? { let this = jsObject return this[Strings.getJointPose].function!(this: this, arguments: [joint.jsValue(), baseSpace.jsValue()]).fromJSValue()! } - public func fillJointRadii(jointSpaces: [XRJointSpace], radii: Float32Array) -> Bool { + @inlinable public func fillJointRadii(jointSpaces: [XRJointSpace], radii: Float32Array) -> Bool { let this = jsObject return this[Strings.fillJointRadii].function!(this: this, arguments: [jointSpaces.jsValue(), radii.jsValue()]).fromJSValue()! } - public func fillPoses(spaces: [XRSpace], baseSpace: XRSpace, transforms: Float32Array) -> Bool { + @inlinable public func fillPoses(spaces: [XRSpace], baseSpace: XRSpace, transforms: Float32Array) -> Bool { let this = jsObject return this[Strings.fillPoses].function!(this: this, arguments: [spaces.jsValue(), baseSpace.jsValue(), transforms.jsValue()]).fromJSValue()! } - public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { + @inlinable public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { let this = jsObject return this[Strings.getHitTestResults].function!(this: this, arguments: [hitTestSource.jsValue()]).fromJSValue()! } - public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { + @inlinable public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { let this = jsObject return this[Strings.getHitTestResultsForTransientInput].function!(this: this, arguments: [hitTestSource.jsValue()]).fromJSValue()! } - public func getLightEstimate(lightProbe: XRLightProbe) -> XRLightEstimate? { + @inlinable public func getLightEstimate(lightProbe: XRLightProbe) -> XRLightEstimate? { let this = jsObject return this[Strings.getLightEstimate].function!(this: this, arguments: [lightProbe.jsValue()]).fromJSValue()! } @@ -71,12 +71,12 @@ public class XRFrame: JSBridgedClass { @ReadonlyAttribute public var predictedDisplayTime: DOMHighResTimeStamp - public func getViewerPose(referenceSpace: XRReferenceSpace) -> XRViewerPose? { + @inlinable public func getViewerPose(referenceSpace: XRReferenceSpace) -> XRViewerPose? { let this = jsObject return this[Strings.getViewerPose].function!(this: this, arguments: [referenceSpace.jsValue()]).fromJSValue()! } - public func getPose(space: XRSpace, baseSpace: XRSpace) -> XRPose? { + @inlinable public func getPose(space: XRSpace, baseSpace: XRSpace) -> XRPose? { let this = jsObject return this[Strings.getPose].function!(this: this, arguments: [space.jsValue(), baseSpace.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRHand.swift b/Sources/DOMKit/WebIDL/XRHand.swift index 3e8549eb..8f49d4ba 100644 --- a/Sources/DOMKit/WebIDL/XRHand.swift +++ b/Sources/DOMKit/WebIDL/XRHand.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRHand: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.XRHand].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRHand].function! } public let jsObject: JSObject @@ -21,7 +21,7 @@ public class XRHand: JSBridgedClass, Sequence { @ReadonlyAttribute public var size: UInt32 - public func get(key: XRHandJoint) -> XRJointSpace { + @inlinable public func get(key: XRHandJoint) -> XRJointSpace { let this = jsObject return this[Strings.get].function!(this: this, arguments: [key.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRHandJoint.swift b/Sources/DOMKit/WebIDL/XRHandJoint.swift index e0821578..cece1fd5 100644 --- a/Sources/DOMKit/WebIDL/XRHandJoint.swift +++ b/Sources/DOMKit/WebIDL/XRHandJoint.swift @@ -30,16 +30,16 @@ public enum XRHandJoint: JSString, JSValueCompatible { case pinkyFingerPhalanxDistal = "pinky-finger-phalanx-distal" case pinkyFingerTip = "pinky-finger-tip" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRHandedness.swift b/Sources/DOMKit/WebIDL/XRHandedness.swift index 4ea70351..85ba72c0 100644 --- a/Sources/DOMKit/WebIDL/XRHandedness.swift +++ b/Sources/DOMKit/WebIDL/XRHandedness.swift @@ -8,16 +8,16 @@ public enum XRHandedness: JSString, JSValueCompatible { case left = "left" case right = "right" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRHitTestResult.swift b/Sources/DOMKit/WebIDL/XRHitTestResult.swift index 94fc044a..b315e8a5 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestResult.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRHitTestResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRHitTestResult].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRHitTestResult].function! } public let jsObject: JSObject @@ -12,19 +12,19 @@ public class XRHitTestResult: JSBridgedClass { self.jsObject = jsObject } - public func createAnchor() -> JSPromise { + @inlinable public func createAnchor() -> JSPromise { let this = jsObject return this[Strings.createAnchor].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func createAnchor() async throws -> XRAnchor { + @inlinable public func createAnchor() async throws -> XRAnchor { let this = jsObject let _promise: JSPromise = this[Strings.createAnchor].function!(this: this, arguments: []).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func getPose(baseSpace: XRSpace) -> XRPose? { + @inlinable public func getPose(baseSpace: XRSpace) -> XRPose? { let this = jsObject return this[Strings.getPose].function!(this: this, arguments: [baseSpace.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRHitTestSource.swift b/Sources/DOMKit/WebIDL/XRHitTestSource.swift index f23be4fc..0c28a0cb 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestSource.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestSource.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRHitTestSource: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRHitTestSource].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRHitTestSource].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class XRHitTestSource: JSBridgedClass { self.jsObject = jsObject } - public func cancel() { + @inlinable public func cancel() { let this = jsObject _ = this[Strings.cancel].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift b/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift index 110d2733..60517361 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift @@ -8,16 +8,16 @@ public enum XRHitTestTrackableType: JSString, JSValueCompatible { case plane = "plane" case mesh = "mesh" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRInputSource.swift b/Sources/DOMKit/WebIDL/XRInputSource.swift index b75d2320..e2714954 100644 --- a/Sources/DOMKit/WebIDL/XRInputSource.swift +++ b/Sources/DOMKit/WebIDL/XRInputSource.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRInputSource: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRInputSource].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRInputSource].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRInputSourceArray.swift b/Sources/DOMKit/WebIDL/XRInputSourceArray.swift index ae4b7dcd..c727222a 100644 --- a/Sources/DOMKit/WebIDL/XRInputSourceArray.swift +++ b/Sources/DOMKit/WebIDL/XRInputSourceArray.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRInputSourceArray: JSBridgedClass, Sequence { - public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourceArray].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourceArray].function! } public let jsObject: JSObject @@ -21,7 +21,7 @@ public class XRInputSourceArray: JSBridgedClass, Sequence { @ReadonlyAttribute public var length: UInt32 - public subscript(key: Int) -> XRInputSource { + @inlinable public subscript(key: Int) -> XRInputSource { jsObject[key].fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift index 21d08a06..c44ddff1 100644 --- a/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift +++ b/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRInputSourceEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourceEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourceEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _frame = ReadonlyAttribute(jsObject: jsObject, name: Strings.frame) @@ -12,7 +12,7 @@ public class XRInputSourceEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: XRInputSourceEventInit) { + @inlinable public convenience init(type: String, eventInitDict: XRInputSourceEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift index 2eefd65b..15ba721b 100644 --- a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRInputSourcesChangeEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourcesChangeEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourcesChangeEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _session = ReadonlyAttribute(jsObject: jsObject, name: Strings.session) @@ -13,7 +13,7 @@ public class XRInputSourcesChangeEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: XRInputSourcesChangeEventInit) { + @inlinable public convenience init(type: String, eventInitDict: XRInputSourcesChangeEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/XRInteractionMode.swift b/Sources/DOMKit/WebIDL/XRInteractionMode.swift index ab979bb0..108bdf2b 100644 --- a/Sources/DOMKit/WebIDL/XRInteractionMode.swift +++ b/Sources/DOMKit/WebIDL/XRInteractionMode.swift @@ -7,16 +7,16 @@ public enum XRInteractionMode: JSString, JSValueCompatible { case screenSpace = "screen-space" case worldSpace = "world-space" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRJointPose.swift b/Sources/DOMKit/WebIDL/XRJointPose.swift index fd8cca8b..503adc0d 100644 --- a/Sources/DOMKit/WebIDL/XRJointPose.swift +++ b/Sources/DOMKit/WebIDL/XRJointPose.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRJointPose: XRPose { - override public class var constructor: JSFunction { JSObject.global[Strings.XRJointPose].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRJointPose].function! } public required init(unsafelyWrapping jsObject: JSObject) { _radius = ReadonlyAttribute(jsObject: jsObject, name: Strings.radius) diff --git a/Sources/DOMKit/WebIDL/XRJointSpace.swift b/Sources/DOMKit/WebIDL/XRJointSpace.swift index d3db86d3..7afe8a8b 100644 --- a/Sources/DOMKit/WebIDL/XRJointSpace.swift +++ b/Sources/DOMKit/WebIDL/XRJointSpace.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRJointSpace: XRSpace { - override public class var constructor: JSFunction { JSObject.global[Strings.XRJointSpace].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRJointSpace].function! } public required init(unsafelyWrapping jsObject: JSObject) { _jointName = ReadonlyAttribute(jsObject: jsObject, name: Strings.jointName) diff --git a/Sources/DOMKit/WebIDL/XRLayer.swift b/Sources/DOMKit/WebIDL/XRLayer.swift index 5ace3b45..8fe6bd4e 100644 --- a/Sources/DOMKit/WebIDL/XRLayer.swift +++ b/Sources/DOMKit/WebIDL/XRLayer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRLayer: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.XRLayer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRLayer].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/XRLayerEvent.swift b/Sources/DOMKit/WebIDL/XRLayerEvent.swift index 196e4d9c..ee1ca0c3 100644 --- a/Sources/DOMKit/WebIDL/XRLayerEvent.swift +++ b/Sources/DOMKit/WebIDL/XRLayerEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class XRLayerEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.XRLayerEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRLayerEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _layer = ReadonlyAttribute(jsObject: jsObject, name: Strings.layer) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: XRLayerEventInit) { + @inlinable public convenience init(type: String, eventInitDict: XRLayerEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/XRLayerLayout.swift b/Sources/DOMKit/WebIDL/XRLayerLayout.swift index 6d380e42..ad3ef90a 100644 --- a/Sources/DOMKit/WebIDL/XRLayerLayout.swift +++ b/Sources/DOMKit/WebIDL/XRLayerLayout.swift @@ -10,16 +10,16 @@ public enum XRLayerLayout: JSString, JSValueCompatible { case stereoLeftRight = "stereo-left-right" case stereoTopBottom = "stereo-top-bottom" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRLightEstimate.swift b/Sources/DOMKit/WebIDL/XRLightEstimate.swift index dd58d186..0d104bc3 100644 --- a/Sources/DOMKit/WebIDL/XRLightEstimate.swift +++ b/Sources/DOMKit/WebIDL/XRLightEstimate.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRLightEstimate: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRLightEstimate].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRLightEstimate].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRLightProbe.swift b/Sources/DOMKit/WebIDL/XRLightProbe.swift index fc1e00eb..dc5410e1 100644 --- a/Sources/DOMKit/WebIDL/XRLightProbe.swift +++ b/Sources/DOMKit/WebIDL/XRLightProbe.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRLightProbe: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.XRLightProbe].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRLightProbe].function! } public required init(unsafelyWrapping jsObject: JSObject) { _probeSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.probeSpace) diff --git a/Sources/DOMKit/WebIDL/XRMediaBinding.swift b/Sources/DOMKit/WebIDL/XRMediaBinding.swift index b64a96db..6f2e841c 100644 --- a/Sources/DOMKit/WebIDL/XRMediaBinding.swift +++ b/Sources/DOMKit/WebIDL/XRMediaBinding.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRMediaBinding: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRMediaBinding].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRMediaBinding].function! } public let jsObject: JSObject @@ -12,21 +12,21 @@ public class XRMediaBinding: JSBridgedClass { self.jsObject = jsObject } - public convenience init(session: XRSession) { + @inlinable public convenience init(session: XRSession) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue()])) } - public func createQuadLayer(video: HTMLVideoElement, init: XRMediaQuadLayerInit? = nil) -> XRQuadLayer { + @inlinable public func createQuadLayer(video: HTMLVideoElement, init: XRMediaQuadLayerInit? = nil) -> XRQuadLayer { let this = jsObject return this[Strings.createQuadLayer].function!(this: this, arguments: [video.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } - public func createCylinderLayer(video: HTMLVideoElement, init: XRMediaCylinderLayerInit? = nil) -> XRCylinderLayer { + @inlinable public func createCylinderLayer(video: HTMLVideoElement, init: XRMediaCylinderLayerInit? = nil) -> XRCylinderLayer { let this = jsObject return this[Strings.createCylinderLayer].function!(this: this, arguments: [video.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } - public func createEquirectLayer(video: HTMLVideoElement, init: XRMediaEquirectLayerInit? = nil) -> XREquirectLayer { + @inlinable public func createEquirectLayer(video: HTMLVideoElement, init: XRMediaEquirectLayerInit? = nil) -> XREquirectLayer { let this = jsObject return this[Strings.createEquirectLayer].function!(this: this, arguments: [video.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRPermissionStatus.swift b/Sources/DOMKit/WebIDL/XRPermissionStatus.swift index 9f2be4bb..1be8ea8c 100644 --- a/Sources/DOMKit/WebIDL/XRPermissionStatus.swift +++ b/Sources/DOMKit/WebIDL/XRPermissionStatus.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRPermissionStatus: PermissionStatus { - override public class var constructor: JSFunction { JSObject.global[Strings.XRPermissionStatus].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRPermissionStatus].function! } public required init(unsafelyWrapping jsObject: JSObject) { _granted = ReadWriteAttribute(jsObject: jsObject, name: Strings.granted) diff --git a/Sources/DOMKit/WebIDL/XRPose.swift b/Sources/DOMKit/WebIDL/XRPose.swift index 6e7fc526..242f60c5 100644 --- a/Sources/DOMKit/WebIDL/XRPose.swift +++ b/Sources/DOMKit/WebIDL/XRPose.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRPose: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRPose].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRPose].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRProjectionLayer.swift b/Sources/DOMKit/WebIDL/XRProjectionLayer.swift index 3a73049e..81431750 100644 --- a/Sources/DOMKit/WebIDL/XRProjectionLayer.swift +++ b/Sources/DOMKit/WebIDL/XRProjectionLayer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRProjectionLayer: XRCompositionLayer { - override public class var constructor: JSFunction { JSObject.global[Strings.XRProjectionLayer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRProjectionLayer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _textureWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureWidth) diff --git a/Sources/DOMKit/WebIDL/XRQuadLayer.swift b/Sources/DOMKit/WebIDL/XRQuadLayer.swift index eb6b6148..8a3b147c 100644 --- a/Sources/DOMKit/WebIDL/XRQuadLayer.swift +++ b/Sources/DOMKit/WebIDL/XRQuadLayer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRQuadLayer: XRCompositionLayer { - override public class var constructor: JSFunction { JSObject.global[Strings.XRQuadLayer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRQuadLayer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) diff --git a/Sources/DOMKit/WebIDL/XRRay.swift b/Sources/DOMKit/WebIDL/XRRay.swift index b6876e79..e4cd9a0e 100644 --- a/Sources/DOMKit/WebIDL/XRRay.swift +++ b/Sources/DOMKit/WebIDL/XRRay.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRRay: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRRay].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRRay].function! } public let jsObject: JSObject @@ -15,11 +15,11 @@ public class XRRay: JSBridgedClass { self.jsObject = jsObject } - public convenience init(origin: DOMPointInit? = nil, direction: XRRayDirectionInit? = nil) { + @inlinable public convenience init(origin: DOMPointInit? = nil, direction: XRRayDirectionInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [origin?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined])) } - public convenience init(transform: XRRigidTransform) { + @inlinable public convenience init(transform: XRRigidTransform) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [transform.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift index 8daebf25..634226f7 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class XRReferenceSpace: XRSpace { - override public class var constructor: JSFunction { JSObject.global[Strings.XRReferenceSpace].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRReferenceSpace].function! } public required init(unsafelyWrapping jsObject: JSObject) { _onreset = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreset) super.init(unsafelyWrapping: jsObject) } - public func getOffsetReferenceSpace(originOffset: XRRigidTransform) -> Self { + @inlinable public func getOffsetReferenceSpace(originOffset: XRRigidTransform) -> Self { let this = jsObject return this[Strings.getOffsetReferenceSpace].function!(this: this, arguments: [originOffset.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift index af2a308e..9df5325e 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRReferenceSpaceEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.XRReferenceSpaceEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRReferenceSpaceEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _referenceSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.referenceSpace) @@ -12,7 +12,7 @@ public class XRReferenceSpaceEvent: Event { super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: XRReferenceSpaceEventInit) { + @inlinable public convenience init(type: String, eventInitDict: XRReferenceSpaceEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift index aa1a609e..5dd22e21 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift @@ -10,16 +10,16 @@ public enum XRReferenceSpaceType: JSString, JSValueCompatible { case boundedFloor = "bounded-floor" case unbounded = "unbounded" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRReflectionFormat.swift b/Sources/DOMKit/WebIDL/XRReflectionFormat.swift index 0bffc077..fceaf978 100644 --- a/Sources/DOMKit/WebIDL/XRReflectionFormat.swift +++ b/Sources/DOMKit/WebIDL/XRReflectionFormat.swift @@ -7,16 +7,16 @@ public enum XRReflectionFormat: JSString, JSValueCompatible { case srgba8 = "srgba8" case rgba16f = "rgba16f" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRRenderState.swift b/Sources/DOMKit/WebIDL/XRRenderState.swift index a3fa71f4..8768f81e 100644 --- a/Sources/DOMKit/WebIDL/XRRenderState.swift +++ b/Sources/DOMKit/WebIDL/XRRenderState.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRRenderState: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRRenderState].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRRenderState].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRRigidTransform.swift b/Sources/DOMKit/WebIDL/XRRigidTransform.swift index 3c9e212d..b9ee50a9 100644 --- a/Sources/DOMKit/WebIDL/XRRigidTransform.swift +++ b/Sources/DOMKit/WebIDL/XRRigidTransform.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRRigidTransform: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRRigidTransform].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRRigidTransform].function! } public let jsObject: JSObject @@ -16,7 +16,7 @@ public class XRRigidTransform: JSBridgedClass { self.jsObject = jsObject } - public convenience init(position: DOMPointInit? = nil, orientation: DOMPointInit? = nil) { + @inlinable public convenience init(position: DOMPointInit? = nil, orientation: DOMPointInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [position?.jsValue() ?? .undefined, orientation?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/XRSession.swift b/Sources/DOMKit/WebIDL/XRSession.swift index 6284b447..5648726b 100644 --- a/Sources/DOMKit/WebIDL/XRSession.swift +++ b/Sources/DOMKit/WebIDL/XRSession.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRSession: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.XRSession].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRSession].function! } public required init(unsafelyWrapping jsObject: JSObject) { _environmentBlendMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.environmentBlendMode) @@ -46,37 +46,37 @@ public class XRSession: EventTarget { @ReadonlyAttribute public var domOverlayState: XRDOMOverlayState? - public func requestHitTestSource(options: XRHitTestOptionsInit) -> JSPromise { + @inlinable public func requestHitTestSource(options: XRHitTestOptionsInit) -> JSPromise { let this = jsObject return this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestHitTestSource(options: XRHitTestOptionsInit) async throws -> XRHitTestSource { + @inlinable public func requestHitTestSource(options: XRHitTestOptionsInit) async throws -> XRHitTestSource { let this = jsObject let _promise: JSPromise = this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) -> JSPromise { + @inlinable public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) -> JSPromise { let this = jsObject return this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) async throws -> XRTransientInputHitTestSource { + @inlinable public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) async throws -> XRTransientInputHitTestSource { let this = jsObject let _promise: JSPromise = this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func requestLightProbe(options: XRLightProbeInit? = nil) -> JSPromise { + @inlinable public func requestLightProbe(options: XRLightProbeInit? = nil) -> JSPromise { let this = jsObject return this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestLightProbe(options: XRLightProbeInit? = nil) async throws -> XRLightProbe { + @inlinable public func requestLightProbe(options: XRLightProbeInit? = nil) async throws -> XRLightProbe { let this = jsObject let _promise: JSPromise = this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -100,30 +100,30 @@ public class XRSession: EventTarget { @ReadonlyAttribute public var inputSources: XRInputSourceArray - public func updateRenderState(state: XRRenderStateInit? = nil) { + @inlinable public func updateRenderState(state: XRRenderStateInit? = nil) { let this = jsObject _ = this[Strings.updateRenderState].function!(this: this, arguments: [state?.jsValue() ?? .undefined]) } - public func updateTargetFrameRate(rate: Float) -> JSPromise { + @inlinable public func updateTargetFrameRate(rate: Float) -> JSPromise { let this = jsObject return this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func updateTargetFrameRate(rate: Float) async throws { + @inlinable public func updateTargetFrameRate(rate: Float) async throws { let this = jsObject let _promise: JSPromise = this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue()]).fromJSValue()! _ = try await _promise.get() } - public func requestReferenceSpace(type: XRReferenceSpaceType) -> JSPromise { + @inlinable public func requestReferenceSpace(type: XRReferenceSpaceType) -> JSPromise { let this = jsObject return this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestReferenceSpace(type: XRReferenceSpaceType) async throws -> XRReferenceSpace { + @inlinable public func requestReferenceSpace(type: XRReferenceSpaceType) async throws -> XRReferenceSpace { let this = jsObject let _promise: JSPromise = this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! @@ -131,18 +131,18 @@ public class XRSession: EventTarget { // XXX: member 'requestAnimationFrame' is ignored - public func cancelAnimationFrame(handle: UInt32) { + @inlinable public func cancelAnimationFrame(handle: UInt32) { let this = jsObject _ = this[Strings.cancelAnimationFrame].function!(this: this, arguments: [handle.jsValue()]) } - public func end() -> JSPromise { + @inlinable public func end() -> JSPromise { let this = jsObject return this[Strings.end].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func end() async throws { + @inlinable public func end() async throws { let this = jsObject let _promise: JSPromise = this[Strings.end].function!(this: this, arguments: []).fromJSValue()! _ = try await _promise.get() diff --git a/Sources/DOMKit/WebIDL/XRSessionEvent.swift b/Sources/DOMKit/WebIDL/XRSessionEvent.swift index 55fda402..a78d82e3 100644 --- a/Sources/DOMKit/WebIDL/XRSessionEvent.swift +++ b/Sources/DOMKit/WebIDL/XRSessionEvent.swift @@ -4,14 +4,14 @@ import JavaScriptEventLoop import JavaScriptKit public class XRSessionEvent: Event { - override public class var constructor: JSFunction { JSObject.global[Strings.XRSessionEvent].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRSessionEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { _session = ReadonlyAttribute(jsObject: jsObject, name: Strings.session) super.init(unsafelyWrapping: jsObject) } - public convenience init(type: String, eventInitDict: XRSessionEventInit) { + @inlinable public convenience init(type: String, eventInitDict: XRSessionEventInit) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/XRSessionMode.swift b/Sources/DOMKit/WebIDL/XRSessionMode.swift index 1d4866d2..f0a4146c 100644 --- a/Sources/DOMKit/WebIDL/XRSessionMode.swift +++ b/Sources/DOMKit/WebIDL/XRSessionMode.swift @@ -8,16 +8,16 @@ public enum XRSessionMode: JSString, JSValueCompatible { case immersiveVr = "immersive-vr" case immersiveAr = "immersive-ar" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRSpace.swift b/Sources/DOMKit/WebIDL/XRSpace.swift index 0f29a617..1f2bdf76 100644 --- a/Sources/DOMKit/WebIDL/XRSpace.swift +++ b/Sources/DOMKit/WebIDL/XRSpace.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRSpace: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.XRSpace].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRSpace].function! } public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) diff --git a/Sources/DOMKit/WebIDL/XRSubImage.swift b/Sources/DOMKit/WebIDL/XRSubImage.swift index 564ebb73..7efde5be 100644 --- a/Sources/DOMKit/WebIDL/XRSubImage.swift +++ b/Sources/DOMKit/WebIDL/XRSubImage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRSubImage: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRSubImage].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRSubImage].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRSystem.swift b/Sources/DOMKit/WebIDL/XRSystem.swift index e110a913..c4057479 100644 --- a/Sources/DOMKit/WebIDL/XRSystem.swift +++ b/Sources/DOMKit/WebIDL/XRSystem.swift @@ -4,32 +4,32 @@ import JavaScriptEventLoop import JavaScriptKit public class XRSystem: EventTarget { - override public class var constructor: JSFunction { JSObject.global[Strings.XRSystem].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRSystem].function! } public required init(unsafelyWrapping jsObject: JSObject) { _ondevicechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondevicechange) super.init(unsafelyWrapping: jsObject) } - public func isSessionSupported(mode: XRSessionMode) -> JSPromise { + @inlinable public func isSessionSupported(mode: XRSessionMode) -> JSPromise { let this = jsObject return this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func isSessionSupported(mode: XRSessionMode) async throws -> Bool { + @inlinable public func isSessionSupported(mode: XRSessionMode) async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! } - public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) -> JSPromise { + @inlinable public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) -> JSPromise { let this = jsObject return this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) async throws -> XRSession { + @inlinable public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) async throws -> XRSession { let this = jsObject let _promise: JSPromise = this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/XRTargetRayMode.swift b/Sources/DOMKit/WebIDL/XRTargetRayMode.swift index 75f62c9a..bf0fbc17 100644 --- a/Sources/DOMKit/WebIDL/XRTargetRayMode.swift +++ b/Sources/DOMKit/WebIDL/XRTargetRayMode.swift @@ -8,16 +8,16 @@ public enum XRTargetRayMode: JSString, JSValueCompatible { case trackedPointer = "tracked-pointer" case screen = "screen" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRTextureType.swift b/Sources/DOMKit/WebIDL/XRTextureType.swift index 178a2372..483bf43b 100644 --- a/Sources/DOMKit/WebIDL/XRTextureType.swift +++ b/Sources/DOMKit/WebIDL/XRTextureType.swift @@ -7,16 +7,16 @@ public enum XRTextureType: JSString, JSValueCompatible { case texture = "texture" case textureArray = "texture-array" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift index 491cd589..cce87a65 100644 --- a/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift +++ b/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRTransientInputHitTestResult: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRTransientInputHitTestResult].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRTransientInputHitTestResult].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift index 61231dc9..5566a4a9 100644 --- a/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift +++ b/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRTransientInputHitTestSource: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRTransientInputHitTestSource].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRTransientInputHitTestSource].function! } public let jsObject: JSObject @@ -12,7 +12,7 @@ public class XRTransientInputHitTestSource: JSBridgedClass { self.jsObject = jsObject } - public func cancel() { + @inlinable public func cancel() { let this = jsObject _ = this[Strings.cancel].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/XRView.swift b/Sources/DOMKit/WebIDL/XRView.swift index 9d800a42..ca90fba2 100644 --- a/Sources/DOMKit/WebIDL/XRView.swift +++ b/Sources/DOMKit/WebIDL/XRView.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRView: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRView].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRView].function! } public let jsObject: JSObject @@ -32,7 +32,7 @@ public class XRView: JSBridgedClass { @ReadonlyAttribute public var recommendedViewportScale: Double? - public func requestViewportScale(scale: Double?) { + @inlinable public func requestViewportScale(scale: Double?) { let this = jsObject _ = this[Strings.requestViewportScale].function!(this: this, arguments: [scale.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/XRViewerPose.swift b/Sources/DOMKit/WebIDL/XRViewerPose.swift index a0c5f8f5..f1d94602 100644 --- a/Sources/DOMKit/WebIDL/XRViewerPose.swift +++ b/Sources/DOMKit/WebIDL/XRViewerPose.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRViewerPose: XRPose { - override public class var constructor: JSFunction { JSObject.global[Strings.XRViewerPose].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRViewerPose].function! } public required init(unsafelyWrapping jsObject: JSObject) { _views = ReadonlyAttribute(jsObject: jsObject, name: Strings.views) diff --git a/Sources/DOMKit/WebIDL/XRViewport.swift b/Sources/DOMKit/WebIDL/XRViewport.swift index a1cf5808..a5d871a2 100644 --- a/Sources/DOMKit/WebIDL/XRViewport.swift +++ b/Sources/DOMKit/WebIDL/XRViewport.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRViewport: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRViewport].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRViewport].function! } public let jsObject: JSObject diff --git a/Sources/DOMKit/WebIDL/XRVisibilityState.swift b/Sources/DOMKit/WebIDL/XRVisibilityState.swift index 7b5d9e76..b2940a87 100644 --- a/Sources/DOMKit/WebIDL/XRVisibilityState.swift +++ b/Sources/DOMKit/WebIDL/XRVisibilityState.swift @@ -8,16 +8,16 @@ public enum XRVisibilityState: JSString, JSValueCompatible { case visibleBlurred = "visible-blurred" case hidden = "hidden" - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } diff --git a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift index f1016ed3..2f9f1a9a 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRWebGLBinding: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLBinding].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLBinding].function! } public let jsObject: JSObject @@ -14,17 +14,17 @@ public class XRWebGLBinding: JSBridgedClass { self.jsObject = jsObject } - public func getDepthInformation(view: XRView) -> XRWebGLDepthInformation? { + @inlinable public func getDepthInformation(view: XRView) -> XRWebGLDepthInformation? { let this = jsObject return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! } - public func getReflectionCubeMap(lightProbe: XRLightProbe) -> WebGLTexture? { + @inlinable public func getReflectionCubeMap(lightProbe: XRLightProbe) -> WebGLTexture? { let this = jsObject return this[Strings.getReflectionCubeMap].function!(this: this, arguments: [lightProbe.jsValue()]).fromJSValue()! } - public convenience init(session: XRSession, context: XRWebGLRenderingContext) { + @inlinable public convenience init(session: XRSession, context: XRWebGLRenderingContext) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue(), context.jsValue()])) } @@ -34,37 +34,37 @@ public class XRWebGLBinding: JSBridgedClass { @ReadonlyAttribute public var usesDepthValues: Bool - public func createProjectionLayer(init: XRProjectionLayerInit? = nil) -> XRProjectionLayer { + @inlinable public func createProjectionLayer(init: XRProjectionLayerInit? = nil) -> XRProjectionLayer { let this = jsObject return this[Strings.createProjectionLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } - public func createQuadLayer(init: XRQuadLayerInit? = nil) -> XRQuadLayer { + @inlinable public func createQuadLayer(init: XRQuadLayerInit? = nil) -> XRQuadLayer { let this = jsObject return this[Strings.createQuadLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } - public func createCylinderLayer(init: XRCylinderLayerInit? = nil) -> XRCylinderLayer { + @inlinable public func createCylinderLayer(init: XRCylinderLayerInit? = nil) -> XRCylinderLayer { let this = jsObject return this[Strings.createCylinderLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } - public func createEquirectLayer(init: XREquirectLayerInit? = nil) -> XREquirectLayer { + @inlinable public func createEquirectLayer(init: XREquirectLayerInit? = nil) -> XREquirectLayer { let this = jsObject return this[Strings.createEquirectLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } - public func createCubeLayer(init: XRCubeLayerInit? = nil) -> XRCubeLayer { + @inlinable public func createCubeLayer(init: XRCubeLayerInit? = nil) -> XRCubeLayer { let this = jsObject return this[Strings.createCubeLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! } - public func getSubImage(layer: XRCompositionLayer, frame: XRFrame, eye: XREye? = nil) -> XRWebGLSubImage { + @inlinable public func getSubImage(layer: XRCompositionLayer, frame: XRFrame, eye: XREye? = nil) -> XRWebGLSubImage { let this = jsObject return this[Strings.getSubImage].function!(this: this, arguments: [layer.jsValue(), frame.jsValue(), eye?.jsValue() ?? .undefined]).fromJSValue()! } - public func getViewSubImage(layer: XRProjectionLayer, view: XRView) -> XRWebGLSubImage { + @inlinable public func getViewSubImage(layer: XRProjectionLayer, view: XRView) -> XRWebGLSubImage { let this = jsObject return this[Strings.getViewSubImage].function!(this: this, arguments: [layer.jsValue(), view.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift b/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift index ef469b50..bb8d3550 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRWebGLDepthInformation: XRDepthInformation { - override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLDepthInformation].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLDepthInformation].function! } public required init(unsafelyWrapping jsObject: JSObject) { _texture = ReadonlyAttribute(jsObject: jsObject, name: Strings.texture) diff --git a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift index fb627438..1547c0fc 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRWebGLLayer: XRLayer { - override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLLayer].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLLayer].function! } public required init(unsafelyWrapping jsObject: JSObject) { _antialias = ReadonlyAttribute(jsObject: jsObject, name: Strings.antialias) @@ -16,7 +16,7 @@ public class XRWebGLLayer: XRLayer { super.init(unsafelyWrapping: jsObject) } - public convenience init(session: XRSession, context: XRWebGLRenderingContext, layerInit: XRWebGLLayerInit? = nil) { + @inlinable public convenience init(session: XRSession, context: XRWebGLRenderingContext, layerInit: XRWebGLLayerInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue(), context.jsValue(), layerInit?.jsValue() ?? .undefined])) } @@ -38,12 +38,12 @@ public class XRWebGLLayer: XRLayer { @ReadonlyAttribute public var framebufferHeight: UInt32 - public func getViewport(view: XRView) -> XRViewport? { + @inlinable public func getViewport(view: XRView) -> XRViewport? { let this = jsObject return this[Strings.getViewport].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! } - public static func getNativeFramebufferScaleFactor(session: XRSession) -> Double { + @inlinable public static func getNativeFramebufferScaleFactor(session: XRSession) -> Double { let this = constructor return this[Strings.getNativeFramebufferScaleFactor].function!(this: this, arguments: [session.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift b/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift index af908b39..e2198df2 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XRWebGLSubImage: XRSubImage { - override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLSubImage].function! } + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLSubImage].function! } public required init(unsafelyWrapping jsObject: JSObject) { _colorTexture = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorTexture) diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift index 68fbdf34..c660710d 100644 --- a/Sources/DOMKit/WebIDL/XSLTProcessor.swift +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class XSLTProcessor: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global[Strings.XSLTProcessor].function! } + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XSLTProcessor].function! } public let jsObject: JSObject @@ -12,46 +12,46 @@ public class XSLTProcessor: JSBridgedClass { self.jsObject = jsObject } - public convenience init() { + @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - public func importStylesheet(style: Node) { + @inlinable public func importStylesheet(style: Node) { let this = jsObject _ = this[Strings.importStylesheet].function!(this: this, arguments: [style.jsValue()]) } - public func transformToFragment(source: Node, output: Document) -> DocumentFragment { + @inlinable public func transformToFragment(source: Node, output: Document) -> DocumentFragment { let this = jsObject return this[Strings.transformToFragment].function!(this: this, arguments: [source.jsValue(), output.jsValue()]).fromJSValue()! } - public func transformToDocument(source: Node) -> Document { + @inlinable public func transformToDocument(source: Node) -> Document { let this = jsObject return this[Strings.transformToDocument].function!(this: this, arguments: [source.jsValue()]).fromJSValue()! } - public func setParameter(namespaceURI: String, localName: String, value: JSValue) { + @inlinable public func setParameter(namespaceURI: String, localName: String, value: JSValue) { let this = jsObject _ = this[Strings.setParameter].function!(this: this, arguments: [namespaceURI.jsValue(), localName.jsValue(), value.jsValue()]) } - public func getParameter(namespaceURI: String, localName: String) -> JSValue { + @inlinable public func getParameter(namespaceURI: String, localName: String) -> JSValue { let this = jsObject return this[Strings.getParameter].function!(this: this, arguments: [namespaceURI.jsValue(), localName.jsValue()]).fromJSValue()! } - public func removeParameter(namespaceURI: String, localName: String) { + @inlinable public func removeParameter(namespaceURI: String, localName: String) { let this = jsObject _ = this[Strings.removeParameter].function!(this: this, arguments: [namespaceURI.jsValue(), localName.jsValue()]) } - public func clearParameters() { + @inlinable public func clearParameters() { let this = jsObject _ = this[Strings.clearParameters].function!(this: this, arguments: []) } - public func reset() { + @inlinable public func reset() { let this = jsObject _ = this[Strings.reset].function!(this: this, arguments: []) } diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index 7039ac0c..edf97a6d 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -4,101 +4,101 @@ import JavaScriptEventLoop import JavaScriptKit public enum console { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { JSObject.global[Strings.console].object! } - public static func assert(condition: Bool? = nil, data: JSValue...) { + @inlinable public static func assert(condition: Bool? = nil, data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.assert].function!(this: this, arguments: [condition?.jsValue() ?? .undefined] + data.map { $0.jsValue() }) } - public static func clear() { + @inlinable public static func clear() { let this = JSObject.global[Strings.console].object! _ = this[Strings.clear].function!(this: this, arguments: []) } - public static func debug(data: JSValue...) { + @inlinable public static func debug(data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.debug].function!(this: this, arguments: data.map { $0.jsValue() }) } - public static func error(data: JSValue...) { + @inlinable public static func error(data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.error].function!(this: this, arguments: data.map { $0.jsValue() }) } - public static func info(data: JSValue...) { + @inlinable public static func info(data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.info].function!(this: this, arguments: data.map { $0.jsValue() }) } - public static func log(data: JSValue...) { + @inlinable public static func log(data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.log].function!(this: this, arguments: data.map { $0.jsValue() }) } - public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { + @inlinable public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { let this = JSObject.global[Strings.console].object! _ = this[Strings.table].function!(this: this, arguments: [tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined]) } - public static func trace(data: JSValue...) { + @inlinable public static func trace(data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.trace].function!(this: this, arguments: data.map { $0.jsValue() }) } - public static func warn(data: JSValue...) { + @inlinable public static func warn(data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.warn].function!(this: this, arguments: data.map { $0.jsValue() }) } - public static func dir(item: JSValue? = nil, options: JSObject? = nil) { + @inlinable public static func dir(item: JSValue? = nil, options: JSObject? = nil) { let this = JSObject.global[Strings.console].object! _ = this[Strings.dir].function!(this: this, arguments: [item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]) } - public static func dirxml(data: JSValue...) { + @inlinable public static func dirxml(data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.dirxml].function!(this: this, arguments: data.map { $0.jsValue() }) } - public static func count(label: String? = nil) { + @inlinable public static func count(label: String? = nil) { let this = JSObject.global[Strings.console].object! _ = this[Strings.count].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) } - public static func countReset(label: String? = nil) { + @inlinable public static func countReset(label: String? = nil) { let this = JSObject.global[Strings.console].object! _ = this[Strings.countReset].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) } - public static func group(data: JSValue...) { + @inlinable public static func group(data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.group].function!(this: this, arguments: data.map { $0.jsValue() }) } - public static func groupCollapsed(data: JSValue...) { + @inlinable public static func groupCollapsed(data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.groupCollapsed].function!(this: this, arguments: data.map { $0.jsValue() }) } - public static func groupEnd() { + @inlinable public static func groupEnd() { let this = JSObject.global[Strings.console].object! _ = this[Strings.groupEnd].function!(this: this, arguments: []) } - public static func time(label: String? = nil) { + @inlinable public static func time(label: String? = nil) { let this = JSObject.global[Strings.console].object! _ = this[Strings.time].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) } - public static func timeLog(label: String? = nil, data: JSValue...) { + @inlinable public static func timeLog(label: String? = nil, data: JSValue...) { let this = JSObject.global[Strings.console].object! _ = this[Strings.timeLog].function!(this: this, arguments: [label?.jsValue() ?? .undefined] + data.map { $0.jsValue() }) } - public static func timeEnd(label: String? = nil) { + @inlinable public static func timeEnd(label: String? = nil) { let this = JSObject.global[Strings.console].object! _ = this[Strings.timeEnd].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) } diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index a7fafb82..628b3475 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -105,9 +105,9 @@ enum IDLBuilder { static func generateStrings() throws { let strings = Context.strings.sorted() let stringsContent: SwiftSource = """ - enum Strings { + @usableFromInline enum Strings { static let _self: JSString = "self" - \(lines: strings.map { "static let `\(raw: $0)`: JSString = \(quoted: $0)" }) + \(lines: strings.map { "@usableFromInline static let `\(raw: $0)`: JSString = \(quoted: $0)" }) } """ diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index cb55f181..2c36c038 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -25,8 +25,8 @@ extension IDLAttribute: SwiftRepresentable, Initializable { assert(!Context.static) // can't do property wrappers on override declarations return """ - private var \(wrapperName): \(idlType.propertyWrapper(readonly: readonly))<\(idlType)> - override public var \(name): \(idlType) { + @usableFromInline let \(wrapperName): \(idlType.propertyWrapper(readonly: readonly))<\(idlType)> + @inlinable override public var \(name): \(idlType) { get { \(wrapperName).wrappedValue } \(readonly ? "" : "set { \(wrapperName).wrappedValue = newValue }") } @@ -38,7 +38,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { """ return """ - public\(raw: Context.static ? " static" : "") var \(name): \(idlType) { + @inlinable public\(raw: Context.static ? " static" : "") var \(name): \(idlType) { get { \(idlType.propertyWrapper(readonly: readonly))[\(Context.source(for: name)), in: jsObject] } \(readonly ? "" : setter) } @@ -121,18 +121,18 @@ extension IDLEnum: SwiftRepresentable { public enum \(name): JSString, JSValueCompatible { \(lines: cases.map { "case \($0.camelized) = \(quoted: $0)" }) - public static func construct(from jsValue: JSValue) -> Self? { + @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { return Self(rawValue: string) } return nil } - public init?(string: String) { + @inlinable public init?(string: String) { self.init(rawValue: JSString(string)) } - public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } } """ } @@ -188,7 +188,7 @@ extension MergedInterface: SwiftRepresentable { let inheritance = (parentClasses.isEmpty ? ["JSBridgedClass"] : parentClasses) + mixins return """ public class \(name): \(sequence: inheritance.map(SwiftSource.init(_:))) { - public\(parentClasses.isEmpty ? "" : " override") class var constructor: JSFunction { \(constructor) } + @inlinable public\(parentClasses.isEmpty ? "" : " override") class var constructor: JSFunction { \(constructor) } \(parentClasses.isEmpty ? "public let jsObject: JSObject" : "") @@ -255,7 +255,7 @@ extension IDLConstant: SwiftRepresentable, Initializable { if Context.inProtocol { // Static stored properties not supported in protocol extensions return """ - public static var \(name): \(idlType) { \(value) } + @inlinable public static var \(name): \(idlType) { \(value) } """ } else { return """ @@ -290,7 +290,7 @@ extension IDLConstructor: SwiftRepresentable, Initializable { argsArray = "[\(sequence: args)]" } return """ - public convenience init(\(sequence: arguments.map(\.swiftRepresentation))) { + @inlinable public convenience init(\(sequence: arguments.map(\.swiftRepresentation))) { self.init(unsafelyWrapping: Self.constructor.new(arguments: \(argsArray))) } """ @@ -330,7 +330,7 @@ extension MergedNamespace: SwiftRepresentable { } return """ public enum \(name) { - public static var jsObject: JSObject { + @inlinable public static var jsObject: JSObject { \(this) } @@ -354,7 +354,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { switch special { case "stringifier": return """ - public var description: String { + @inlinable public var description: String { \(Context.this)[Strings.toString]!().fromJSValue()! } """ @@ -368,7 +368,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { keyType = "Int" } return """ - public subscript(key: \(keyType)) -> \(idlType!) { + @inlinable public subscript(key: \(keyType)) -> \(idlType!) { jsObject[key].fromJSValue()\(idlType!.nullable ? "" : "!") } """ @@ -459,7 +459,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { } return """ - \(nameAndParams) -> \(returnType) { + @inlinable \(nameAndParams) -> \(returnType) { \(prep) \(body) } @@ -504,7 +504,7 @@ extension AsyncOperation: SwiftRepresentable, Initializable { } return """ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - \(operation.nameAndParams) async throws -> \(returnType) { + @inlinable \(operation.nameAndParams) async throws -> \(returnType) { \(prep) let _promise: JSPromise = \(call).fromJSValue()! \(result) From 05351af1840cf572f9f65785c8a03d464e2fccf6 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 12:24:52 -0400 Subject: [PATCH 101/124] disable broken TrustedTypePolicyOptions --- Sources/DOMKit/WebIDL/Strings.swift | 1 - .../WebIDL/TrustedTypePolicyFactory.swift | 5 +--- .../WebIDL/TrustedTypePolicyOptions.swift | 30 ------------------- Sources/WebIDLToSwift/IDLBuilder.swift | 5 ++++ 4 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index 3d663824..62242bc3 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -1790,7 +1790,6 @@ import JavaScriptKit @usableFromInline static let createPattern: JSString = "createPattern" @usableFromInline static let createPeriodicWave: JSString = "createPeriodicWave" @usableFromInline static let createPipelineLayout: JSString = "createPipelineLayout" - @usableFromInline static let createPolicy: JSString = "createPolicy" @usableFromInline static let createProcessingInstruction: JSString = "createProcessingInstruction" @usableFromInline static let createProgram: JSString = "createProgram" @usableFromInline static let createProjectionLayer: JSString = "createProjectionLayer" diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift index ad0e8f7d..4a2aa735 100644 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift @@ -15,10 +15,7 @@ public class TrustedTypePolicyFactory: JSBridgedClass { self.jsObject = jsObject } - @inlinable public func createPolicy(policyName: String, policyOptions: TrustedTypePolicyOptions? = nil) -> TrustedTypePolicy { - let this = jsObject - return this[Strings.createPolicy].function!(this: this, arguments: [policyName.jsValue(), policyOptions?.jsValue() ?? .undefined]).fromJSValue()! - } + // XXX: member 'createPolicy' is ignored @inlinable public func isHTML(value: JSValue) -> Bool { let this = jsObject diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift deleted file mode 100644 index 2198b802..00000000 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicyOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TrustedTypePolicyOptions: BridgedDictionary { - public convenience init(createHTML: @escaping CreateHTMLCallback?, createScript: @escaping CreateScriptCallback?, createScriptURL: @escaping CreateScriptURLCallback?) { - let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute2[Strings.createHTML, in: object] = createHTML - ClosureAttribute2[Strings.createScript, in: object] = createScript - ClosureAttribute2[Strings.createScriptURL, in: object] = createScriptURL - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _createHTML = ClosureAttribute2(jsObject: object, name: Strings.createHTML) - _createScript = ClosureAttribute2(jsObject: object, name: Strings.createScript) - _createScriptURL = ClosureAttribute2(jsObject: object, name: Strings.createScriptURL) - super.init(unsafelyWrapping: object) - } - - @ClosureAttribute2 - public var createHTML: CreateHTMLCallback? - - @ClosureAttribute2 - public var createScript: CreateScriptCallback? - - @ClosureAttribute2 - public var createScriptURL: CreateScriptURLCallback? -} diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 628b3475..1460bb2e 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -35,6 +35,9 @@ enum IDLBuilder { else { fatalError("Cannot find name for \(node)") } + if name == "TrustedTypePolicyOptions" { + continue + } let content = Context.withState(.root( interfaces: merged.interfaces, ignored: [ @@ -69,6 +72,8 @@ enum IDLBuilder { "Window": ["requestIdleCallback"], "WindowOrWorkerGlobalScope": ["queueMicrotask"], "XRSession": ["requestAnimationFrame"], + // variadic callbacks are unsupported + "TrustedTypePolicyFactory": ["createPolicy"], // functions as return types are unsupported "CustomElementRegistry": ["define", "whenDefined"], // NodeFilter From 3662d5bfe9bfc97740fb6c78517eca586f9257da Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 12:27:51 -0400 Subject: [PATCH 102/124] nonmutating --- Sources/DOMKit/ECMAScript/Attributes.swift | 2 +- Sources/DOMKit/WebIDL/ARIAMixin.swift | 82 ++++---- Sources/DOMKit/WebIDL/AbstractWorker.swift | 2 +- .../WebIDL/BluetoothDeviceEventHandlers.swift | 4 +- Sources/DOMKit/WebIDL/CanvasCompositing.swift | 4 +- .../WebIDL/CanvasFillStrokeStyles.swift | 4 +- Sources/DOMKit/WebIDL/CanvasFilters.swift | 2 +- .../DOMKit/WebIDL/CanvasImageSmoothing.swift | 4 +- .../WebIDL/CanvasPathDrawingStyles.swift | 10 +- .../DOMKit/WebIDL/CanvasShadowStyles.swift | 8 +- .../WebIDL/CanvasTextDrawingStyles.swift | 20 +- .../WebIDL/CharacteristicEventHandlers.swift | 2 +- .../DocumentAndElementEventHandlers.swift | 6 +- .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 2 +- .../WebIDL/ElementContentEditable.swift | 8 +- Sources/DOMKit/WebIDL/GPUObjectBase.swift | 2 +- .../DOMKit/WebIDL/GlobalEventHandlers.swift | 188 +++++++++--------- .../WebIDL/HTMLHyperlinkElementUtils.swift | 20 +- Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift | 6 +- Sources/DOMKit/WebIDL/InnerHTML.swift | 2 +- .../DOMKit/WebIDL/ServiceEventHandlers.swift | 6 +- .../DOMKit/WebIDL/WindowEventHandlers.swift | 38 ++-- .../WebIDL+SwiftRepresentation.swift | 2 +- 23 files changed, 212 insertions(+), 212 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Attributes.swift b/Sources/DOMKit/ECMAScript/Attributes.swift index 2a9dfb87..5091b554 100644 --- a/Sources/DOMKit/ECMAScript/Attributes.swift +++ b/Sources/DOMKit/ECMAScript/Attributes.swift @@ -11,7 +11,7 @@ import JavaScriptKit @inlinable public var wrappedValue: Wrapped { get { ReadWriteAttribute[name, in: jsObject] } - set { ReadWriteAttribute[name, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[name, in: jsObject] = newValue } } @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> Wrapped { diff --git a/Sources/DOMKit/WebIDL/ARIAMixin.swift b/Sources/DOMKit/WebIDL/ARIAMixin.swift index a0712417..b1ec9cf9 100644 --- a/Sources/DOMKit/WebIDL/ARIAMixin.swift +++ b/Sources/DOMKit/WebIDL/ARIAMixin.swift @@ -7,206 +7,206 @@ public protocol ARIAMixin: JSBridgedClass {} public extension ARIAMixin { @inlinable var role: String? { get { ReadWriteAttribute[Strings.role, in: jsObject] } - set { ReadWriteAttribute[Strings.role, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.role, in: jsObject] = newValue } } @inlinable var ariaAtomic: String? { get { ReadWriteAttribute[Strings.ariaAtomic, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaAtomic, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaAtomic, in: jsObject] = newValue } } @inlinable var ariaAutoComplete: String? { get { ReadWriteAttribute[Strings.ariaAutoComplete, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaAutoComplete, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaAutoComplete, in: jsObject] = newValue } } @inlinable var ariaBusy: String? { get { ReadWriteAttribute[Strings.ariaBusy, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaBusy, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaBusy, in: jsObject] = newValue } } @inlinable var ariaChecked: String? { get { ReadWriteAttribute[Strings.ariaChecked, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaChecked, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaChecked, in: jsObject] = newValue } } @inlinable var ariaColCount: String? { get { ReadWriteAttribute[Strings.ariaColCount, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaColCount, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaColCount, in: jsObject] = newValue } } @inlinable var ariaColIndex: String? { get { ReadWriteAttribute[Strings.ariaColIndex, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaColIndex, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaColIndex, in: jsObject] = newValue } } @inlinable var ariaColIndexText: String? { get { ReadWriteAttribute[Strings.ariaColIndexText, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaColIndexText, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaColIndexText, in: jsObject] = newValue } } @inlinable var ariaColSpan: String? { get { ReadWriteAttribute[Strings.ariaColSpan, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaColSpan, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaColSpan, in: jsObject] = newValue } } @inlinable var ariaCurrent: String? { get { ReadWriteAttribute[Strings.ariaCurrent, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaCurrent, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaCurrent, in: jsObject] = newValue } } @inlinable var ariaDescription: String? { get { ReadWriteAttribute[Strings.ariaDescription, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaDescription, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaDescription, in: jsObject] = newValue } } @inlinable var ariaDisabled: String? { get { ReadWriteAttribute[Strings.ariaDisabled, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaDisabled, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaDisabled, in: jsObject] = newValue } } @inlinable var ariaExpanded: String? { get { ReadWriteAttribute[Strings.ariaExpanded, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaExpanded, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaExpanded, in: jsObject] = newValue } } @inlinable var ariaHasPopup: String? { get { ReadWriteAttribute[Strings.ariaHasPopup, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaHasPopup, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaHasPopup, in: jsObject] = newValue } } @inlinable var ariaHidden: String? { get { ReadWriteAttribute[Strings.ariaHidden, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaHidden, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaHidden, in: jsObject] = newValue } } @inlinable var ariaInvalid: String? { get { ReadWriteAttribute[Strings.ariaInvalid, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaInvalid, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaInvalid, in: jsObject] = newValue } } @inlinable var ariaKeyShortcuts: String? { get { ReadWriteAttribute[Strings.ariaKeyShortcuts, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaKeyShortcuts, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaKeyShortcuts, in: jsObject] = newValue } } @inlinable var ariaLabel: String? { get { ReadWriteAttribute[Strings.ariaLabel, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaLabel, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaLabel, in: jsObject] = newValue } } @inlinable var ariaLevel: String? { get { ReadWriteAttribute[Strings.ariaLevel, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaLevel, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaLevel, in: jsObject] = newValue } } @inlinable var ariaLive: String? { get { ReadWriteAttribute[Strings.ariaLive, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaLive, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaLive, in: jsObject] = newValue } } @inlinable var ariaModal: String? { get { ReadWriteAttribute[Strings.ariaModal, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaModal, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaModal, in: jsObject] = newValue } } @inlinable var ariaMultiLine: String? { get { ReadWriteAttribute[Strings.ariaMultiLine, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaMultiLine, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaMultiLine, in: jsObject] = newValue } } @inlinable var ariaMultiSelectable: String? { get { ReadWriteAttribute[Strings.ariaMultiSelectable, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaMultiSelectable, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaMultiSelectable, in: jsObject] = newValue } } @inlinable var ariaOrientation: String? { get { ReadWriteAttribute[Strings.ariaOrientation, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaOrientation, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaOrientation, in: jsObject] = newValue } } @inlinable var ariaPlaceholder: String? { get { ReadWriteAttribute[Strings.ariaPlaceholder, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaPlaceholder, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaPlaceholder, in: jsObject] = newValue } } @inlinable var ariaPosInSet: String? { get { ReadWriteAttribute[Strings.ariaPosInSet, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaPosInSet, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaPosInSet, in: jsObject] = newValue } } @inlinable var ariaPressed: String? { get { ReadWriteAttribute[Strings.ariaPressed, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaPressed, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaPressed, in: jsObject] = newValue } } @inlinable var ariaReadOnly: String? { get { ReadWriteAttribute[Strings.ariaReadOnly, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaReadOnly, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaReadOnly, in: jsObject] = newValue } } @inlinable var ariaRequired: String? { get { ReadWriteAttribute[Strings.ariaRequired, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaRequired, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaRequired, in: jsObject] = newValue } } @inlinable var ariaRoleDescription: String? { get { ReadWriteAttribute[Strings.ariaRoleDescription, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaRoleDescription, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaRoleDescription, in: jsObject] = newValue } } @inlinable var ariaRowCount: String? { get { ReadWriteAttribute[Strings.ariaRowCount, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaRowCount, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaRowCount, in: jsObject] = newValue } } @inlinable var ariaRowIndex: String? { get { ReadWriteAttribute[Strings.ariaRowIndex, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaRowIndex, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaRowIndex, in: jsObject] = newValue } } @inlinable var ariaRowIndexText: String? { get { ReadWriteAttribute[Strings.ariaRowIndexText, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaRowIndexText, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaRowIndexText, in: jsObject] = newValue } } @inlinable var ariaRowSpan: String? { get { ReadWriteAttribute[Strings.ariaRowSpan, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaRowSpan, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaRowSpan, in: jsObject] = newValue } } @inlinable var ariaSelected: String? { get { ReadWriteAttribute[Strings.ariaSelected, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaSelected, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaSelected, in: jsObject] = newValue } } @inlinable var ariaSetSize: String? { get { ReadWriteAttribute[Strings.ariaSetSize, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaSetSize, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaSetSize, in: jsObject] = newValue } } @inlinable var ariaSort: String? { get { ReadWriteAttribute[Strings.ariaSort, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaSort, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaSort, in: jsObject] = newValue } } @inlinable var ariaValueMax: String? { get { ReadWriteAttribute[Strings.ariaValueMax, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaValueMax, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaValueMax, in: jsObject] = newValue } } @inlinable var ariaValueMin: String? { get { ReadWriteAttribute[Strings.ariaValueMin, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaValueMin, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaValueMin, in: jsObject] = newValue } } @inlinable var ariaValueNow: String? { get { ReadWriteAttribute[Strings.ariaValueNow, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaValueNow, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaValueNow, in: jsObject] = newValue } } @inlinable var ariaValueText: String? { get { ReadWriteAttribute[Strings.ariaValueText, in: jsObject] } - set { ReadWriteAttribute[Strings.ariaValueText, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.ariaValueText, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/AbstractWorker.swift b/Sources/DOMKit/WebIDL/AbstractWorker.swift index 121f2a7c..eba7eaf0 100644 --- a/Sources/DOMKit/WebIDL/AbstractWorker.swift +++ b/Sources/DOMKit/WebIDL/AbstractWorker.swift @@ -7,6 +7,6 @@ public protocol AbstractWorker: JSBridgedClass {} public extension AbstractWorker { @inlinable var onerror: EventHandler { get { ClosureAttribute1Optional[Strings.onerror, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onerror, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onerror, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift b/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift index 47920640..c648e436 100644 --- a/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift @@ -7,11 +7,11 @@ public protocol BluetoothDeviceEventHandlers: JSBridgedClass {} public extension BluetoothDeviceEventHandlers { @inlinable var onadvertisementreceived: EventHandler { get { ClosureAttribute1Optional[Strings.onadvertisementreceived, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onadvertisementreceived, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onadvertisementreceived, in: jsObject] = newValue } } @inlinable var ongattserverdisconnected: EventHandler { get { ClosureAttribute1Optional[Strings.ongattserverdisconnected, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ongattserverdisconnected, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ongattserverdisconnected, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasCompositing.swift b/Sources/DOMKit/WebIDL/CanvasCompositing.swift index dc2d61d5..9268b4ee 100644 --- a/Sources/DOMKit/WebIDL/CanvasCompositing.swift +++ b/Sources/DOMKit/WebIDL/CanvasCompositing.swift @@ -7,11 +7,11 @@ public protocol CanvasCompositing: JSBridgedClass {} public extension CanvasCompositing { @inlinable var globalAlpha: Double { get { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] } - set { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] = newValue } } @inlinable var globalCompositeOperation: String { get { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] } - set { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift index 1b10c2e0..469a7fca 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift @@ -7,12 +7,12 @@ public protocol CanvasFillStrokeStyles: JSBridgedClass {} public extension CanvasFillStrokeStyles { @inlinable var strokeStyle: __UNSUPPORTED_UNION__ { get { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] } - set { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] = newValue } } @inlinable var fillStyle: __UNSUPPORTED_UNION__ { get { ReadWriteAttribute[Strings.fillStyle, in: jsObject] } - set { ReadWriteAttribute[Strings.fillStyle, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.fillStyle, in: jsObject] = newValue } } @inlinable func createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double) -> CanvasGradient { diff --git a/Sources/DOMKit/WebIDL/CanvasFilters.swift b/Sources/DOMKit/WebIDL/CanvasFilters.swift index d054dda5..e3e02047 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilters.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilters.swift @@ -7,6 +7,6 @@ public protocol CanvasFilters: JSBridgedClass {} public extension CanvasFilters { @inlinable var filter: __UNSUPPORTED_UNION__ { get { ReadWriteAttribute[Strings.filter, in: jsObject] } - set { ReadWriteAttribute[Strings.filter, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.filter, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift index c38809ff..37b13cf5 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageSmoothing.swift @@ -7,11 +7,11 @@ public protocol CanvasImageSmoothing: JSBridgedClass {} public extension CanvasImageSmoothing { @inlinable var imageSmoothingEnabled: Bool { get { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] } - set { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] = newValue } } @inlinable var imageSmoothingQuality: ImageSmoothingQuality { get { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] } - set { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift index 1bb5288d..2b513e3b 100644 --- a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift @@ -7,22 +7,22 @@ public protocol CanvasPathDrawingStyles: JSBridgedClass {} public extension CanvasPathDrawingStyles { @inlinable var lineWidth: Double { get { ReadWriteAttribute[Strings.lineWidth, in: jsObject] } - set { ReadWriteAttribute[Strings.lineWidth, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.lineWidth, in: jsObject] = newValue } } @inlinable var lineCap: CanvasLineCap { get { ReadWriteAttribute[Strings.lineCap, in: jsObject] } - set { ReadWriteAttribute[Strings.lineCap, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.lineCap, in: jsObject] = newValue } } @inlinable var lineJoin: CanvasLineJoin { get { ReadWriteAttribute[Strings.lineJoin, in: jsObject] } - set { ReadWriteAttribute[Strings.lineJoin, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.lineJoin, in: jsObject] = newValue } } @inlinable var miterLimit: Double { get { ReadWriteAttribute[Strings.miterLimit, in: jsObject] } - set { ReadWriteAttribute[Strings.miterLimit, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.miterLimit, in: jsObject] = newValue } } @inlinable func setLineDash(segments: [Double]) { @@ -37,6 +37,6 @@ public extension CanvasPathDrawingStyles { @inlinable var lineDashOffset: Double { get { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] } - set { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift index d6aa3bd3..6d009735 100644 --- a/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasShadowStyles.swift @@ -7,21 +7,21 @@ public protocol CanvasShadowStyles: JSBridgedClass {} public extension CanvasShadowStyles { @inlinable var shadowOffsetX: Double { get { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] } - set { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] = newValue } } @inlinable var shadowOffsetY: Double { get { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] } - set { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] = newValue } } @inlinable var shadowBlur: Double { get { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] } - set { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] = newValue } } @inlinable var shadowColor: String { get { ReadWriteAttribute[Strings.shadowColor, in: jsObject] } - set { ReadWriteAttribute[Strings.shadowColor, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.shadowColor, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift index 1f0fbd00..c5c9af38 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextDrawingStyles.swift @@ -7,51 +7,51 @@ public protocol CanvasTextDrawingStyles: JSBridgedClass {} public extension CanvasTextDrawingStyles { @inlinable var font: String { get { ReadWriteAttribute[Strings.font, in: jsObject] } - set { ReadWriteAttribute[Strings.font, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.font, in: jsObject] = newValue } } @inlinable var textAlign: CanvasTextAlign { get { ReadWriteAttribute[Strings.textAlign, in: jsObject] } - set { ReadWriteAttribute[Strings.textAlign, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.textAlign, in: jsObject] = newValue } } @inlinable var textBaseline: CanvasTextBaseline { get { ReadWriteAttribute[Strings.textBaseline, in: jsObject] } - set { ReadWriteAttribute[Strings.textBaseline, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.textBaseline, in: jsObject] = newValue } } @inlinable var direction: CanvasDirection { get { ReadWriteAttribute[Strings.direction, in: jsObject] } - set { ReadWriteAttribute[Strings.direction, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.direction, in: jsObject] = newValue } } @inlinable var letterSpacing: String { get { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] } - set { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] = newValue } } @inlinable var fontKerning: CanvasFontKerning { get { ReadWriteAttribute[Strings.fontKerning, in: jsObject] } - set { ReadWriteAttribute[Strings.fontKerning, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.fontKerning, in: jsObject] = newValue } } @inlinable var fontStretch: CanvasFontStretch { get { ReadWriteAttribute[Strings.fontStretch, in: jsObject] } - set { ReadWriteAttribute[Strings.fontStretch, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.fontStretch, in: jsObject] = newValue } } @inlinable var fontVariantCaps: CanvasFontVariantCaps { get { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] } - set { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] = newValue } } @inlinable var textRendering: CanvasTextRendering { get { ReadWriteAttribute[Strings.textRendering, in: jsObject] } - set { ReadWriteAttribute[Strings.textRendering, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.textRendering, in: jsObject] = newValue } } @inlinable var wordSpacing: String { get { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] } - set { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift b/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift index 66749dc6..c6188931 100644 --- a/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift @@ -7,6 +7,6 @@ public protocol CharacteristicEventHandlers: JSBridgedClass {} public extension CharacteristicEventHandlers { @inlinable var oncharacteristicvaluechanged: EventHandler { get { ClosureAttribute1Optional[Strings.oncharacteristicvaluechanged, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncharacteristicvaluechanged, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncharacteristicvaluechanged, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift index f55472ee..c9e9b57e 100644 --- a/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/DocumentAndElementEventHandlers.swift @@ -7,16 +7,16 @@ public protocol DocumentAndElementEventHandlers: JSBridgedClass {} public extension DocumentAndElementEventHandlers { @inlinable var oncopy: EventHandler { get { ClosureAttribute1Optional[Strings.oncopy, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncopy, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncopy, in: jsObject] = newValue } } @inlinable var oncut: EventHandler { get { ClosureAttribute1Optional[Strings.oncut, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncut, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncut, in: jsObject] = newValue } } @inlinable var onpaste: EventHandler { get { ClosureAttribute1Optional[Strings.onpaste, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpaste, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpaste, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index cc98f674..b44070c1 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -9,7 +9,7 @@ public extension DocumentOrShadowRoot { @inlinable var adoptedStyleSheets: [CSSStyleSheet] { get { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] } - set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } } @inlinable var fullscreenElement: Element? { ReadonlyAttribute[Strings.fullscreenElement, in: jsObject] } diff --git a/Sources/DOMKit/WebIDL/ElementContentEditable.swift b/Sources/DOMKit/WebIDL/ElementContentEditable.swift index 8ace6787..de4d56ff 100644 --- a/Sources/DOMKit/WebIDL/ElementContentEditable.swift +++ b/Sources/DOMKit/WebIDL/ElementContentEditable.swift @@ -7,23 +7,23 @@ public protocol ElementContentEditable: JSBridgedClass {} public extension ElementContentEditable { @inlinable var contentEditable: String { get { ReadWriteAttribute[Strings.contentEditable, in: jsObject] } - set { ReadWriteAttribute[Strings.contentEditable, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.contentEditable, in: jsObject] = newValue } } @inlinable var enterKeyHint: String { get { ReadWriteAttribute[Strings.enterKeyHint, in: jsObject] } - set { ReadWriteAttribute[Strings.enterKeyHint, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.enterKeyHint, in: jsObject] = newValue } } @inlinable var isContentEditable: Bool { ReadonlyAttribute[Strings.isContentEditable, in: jsObject] } @inlinable var inputMode: String { get { ReadWriteAttribute[Strings.inputMode, in: jsObject] } - set { ReadWriteAttribute[Strings.inputMode, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.inputMode, in: jsObject] = newValue } } @inlinable var virtualKeyboardPolicy: String { get { ReadWriteAttribute[Strings.virtualKeyboardPolicy, in: jsObject] } - set { ReadWriteAttribute[Strings.virtualKeyboardPolicy, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.virtualKeyboardPolicy, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/GPUObjectBase.swift b/Sources/DOMKit/WebIDL/GPUObjectBase.swift index 3aa206e4..00059c2d 100644 --- a/Sources/DOMKit/WebIDL/GPUObjectBase.swift +++ b/Sources/DOMKit/WebIDL/GPUObjectBase.swift @@ -7,6 +7,6 @@ public protocol GPUObjectBase: JSBridgedClass {} public extension GPUObjectBase { @inlinable var label: __UNSUPPORTED_UNION__ { get { ReadWriteAttribute[Strings.label, in: jsObject] } - set { ReadWriteAttribute[Strings.label, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.label, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index e589fb35..5a9d8fff 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -7,471 +7,471 @@ public protocol GlobalEventHandlers: JSBridgedClass {} public extension GlobalEventHandlers { @inlinable var onanimationstart: EventHandler { get { ClosureAttribute1Optional[Strings.onanimationstart, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onanimationstart, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onanimationstart, in: jsObject] = newValue } } @inlinable var onanimationiteration: EventHandler { get { ClosureAttribute1Optional[Strings.onanimationiteration, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onanimationiteration, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onanimationiteration, in: jsObject] = newValue } } @inlinable var onanimationend: EventHandler { get { ClosureAttribute1Optional[Strings.onanimationend, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onanimationend, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onanimationend, in: jsObject] = newValue } } @inlinable var onanimationcancel: EventHandler { get { ClosureAttribute1Optional[Strings.onanimationcancel, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onanimationcancel, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onanimationcancel, in: jsObject] = newValue } } @inlinable var ontransitionrun: EventHandler { get { ClosureAttribute1Optional[Strings.ontransitionrun, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontransitionrun, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontransitionrun, in: jsObject] = newValue } } @inlinable var ontransitionstart: EventHandler { get { ClosureAttribute1Optional[Strings.ontransitionstart, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontransitionstart, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontransitionstart, in: jsObject] = newValue } } @inlinable var ontransitionend: EventHandler { get { ClosureAttribute1Optional[Strings.ontransitionend, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontransitionend, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontransitionend, in: jsObject] = newValue } } @inlinable var ontransitioncancel: EventHandler { get { ClosureAttribute1Optional[Strings.ontransitioncancel, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontransitioncancel, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontransitioncancel, in: jsObject] = newValue } } @inlinable var onabort: EventHandler { get { ClosureAttribute1Optional[Strings.onabort, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onabort, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onabort, in: jsObject] = newValue } } @inlinable var onauxclick: EventHandler { get { ClosureAttribute1Optional[Strings.onauxclick, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onauxclick, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onauxclick, in: jsObject] = newValue } } @inlinable var onblur: EventHandler { get { ClosureAttribute1Optional[Strings.onblur, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onblur, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onblur, in: jsObject] = newValue } } @inlinable var oncancel: EventHandler { get { ClosureAttribute1Optional[Strings.oncancel, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncancel, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncancel, in: jsObject] = newValue } } @inlinable var oncanplay: EventHandler { get { ClosureAttribute1Optional[Strings.oncanplay, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncanplay, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncanplay, in: jsObject] = newValue } } @inlinable var oncanplaythrough: EventHandler { get { ClosureAttribute1Optional[Strings.oncanplaythrough, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncanplaythrough, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncanplaythrough, in: jsObject] = newValue } } @inlinable var onchange: EventHandler { get { ClosureAttribute1Optional[Strings.onchange, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onchange, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onchange, in: jsObject] = newValue } } @inlinable var onclick: EventHandler { get { ClosureAttribute1Optional[Strings.onclick, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onclick, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onclick, in: jsObject] = newValue } } @inlinable var onclose: EventHandler { get { ClosureAttribute1Optional[Strings.onclose, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onclose, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onclose, in: jsObject] = newValue } } @inlinable var oncontextlost: EventHandler { get { ClosureAttribute1Optional[Strings.oncontextlost, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncontextlost, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncontextlost, in: jsObject] = newValue } } @inlinable var oncontextmenu: EventHandler { get { ClosureAttribute1Optional[Strings.oncontextmenu, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncontextmenu, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncontextmenu, in: jsObject] = newValue } } @inlinable var oncontextrestored: EventHandler { get { ClosureAttribute1Optional[Strings.oncontextrestored, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncontextrestored, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncontextrestored, in: jsObject] = newValue } } @inlinable var oncuechange: EventHandler { get { ClosureAttribute1Optional[Strings.oncuechange, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oncuechange, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oncuechange, in: jsObject] = newValue } } @inlinable var ondblclick: EventHandler { get { ClosureAttribute1Optional[Strings.ondblclick, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ondblclick, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ondblclick, in: jsObject] = newValue } } @inlinable var ondrag: EventHandler { get { ClosureAttribute1Optional[Strings.ondrag, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ondrag, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ondrag, in: jsObject] = newValue } } @inlinable var ondragend: EventHandler { get { ClosureAttribute1Optional[Strings.ondragend, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ondragend, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ondragend, in: jsObject] = newValue } } @inlinable var ondragenter: EventHandler { get { ClosureAttribute1Optional[Strings.ondragenter, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ondragenter, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ondragenter, in: jsObject] = newValue } } @inlinable var ondragleave: EventHandler { get { ClosureAttribute1Optional[Strings.ondragleave, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ondragleave, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ondragleave, in: jsObject] = newValue } } @inlinable var ondragover: EventHandler { get { ClosureAttribute1Optional[Strings.ondragover, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ondragover, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ondragover, in: jsObject] = newValue } } @inlinable var ondragstart: EventHandler { get { ClosureAttribute1Optional[Strings.ondragstart, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ondragstart, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ondragstart, in: jsObject] = newValue } } @inlinable var ondrop: EventHandler { get { ClosureAttribute1Optional[Strings.ondrop, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ondrop, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ondrop, in: jsObject] = newValue } } @inlinable var ondurationchange: EventHandler { get { ClosureAttribute1Optional[Strings.ondurationchange, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ondurationchange, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ondurationchange, in: jsObject] = newValue } } @inlinable var onemptied: EventHandler { get { ClosureAttribute1Optional[Strings.onemptied, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onemptied, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onemptied, in: jsObject] = newValue } } @inlinable var onended: EventHandler { get { ClosureAttribute1Optional[Strings.onended, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onended, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onended, in: jsObject] = newValue } } @inlinable var onerror: OnErrorEventHandler { get { ClosureAttribute5Optional[Strings.onerror, in: jsObject] } - set { ClosureAttribute5Optional[Strings.onerror, in: jsObject] = newValue } + nonmutating set { ClosureAttribute5Optional[Strings.onerror, in: jsObject] = newValue } } @inlinable var onfocus: EventHandler { get { ClosureAttribute1Optional[Strings.onfocus, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onfocus, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onfocus, in: jsObject] = newValue } } @inlinable var onformdata: EventHandler { get { ClosureAttribute1Optional[Strings.onformdata, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onformdata, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onformdata, in: jsObject] = newValue } } @inlinable var oninput: EventHandler { get { ClosureAttribute1Optional[Strings.oninput, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oninput, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oninput, in: jsObject] = newValue } } @inlinable var oninvalid: EventHandler { get { ClosureAttribute1Optional[Strings.oninvalid, in: jsObject] } - set { ClosureAttribute1Optional[Strings.oninvalid, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.oninvalid, in: jsObject] = newValue } } @inlinable var onkeydown: EventHandler { get { ClosureAttribute1Optional[Strings.onkeydown, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onkeydown, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onkeydown, in: jsObject] = newValue } } @inlinable var onkeypress: EventHandler { get { ClosureAttribute1Optional[Strings.onkeypress, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onkeypress, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onkeypress, in: jsObject] = newValue } } @inlinable var onkeyup: EventHandler { get { ClosureAttribute1Optional[Strings.onkeyup, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onkeyup, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onkeyup, in: jsObject] = newValue } } @inlinable var onload: EventHandler { get { ClosureAttribute1Optional[Strings.onload, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onload, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onload, in: jsObject] = newValue } } @inlinable var onloadeddata: EventHandler { get { ClosureAttribute1Optional[Strings.onloadeddata, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onloadeddata, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onloadeddata, in: jsObject] = newValue } } @inlinable var onloadedmetadata: EventHandler { get { ClosureAttribute1Optional[Strings.onloadedmetadata, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onloadedmetadata, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onloadedmetadata, in: jsObject] = newValue } } @inlinable var onloadstart: EventHandler { get { ClosureAttribute1Optional[Strings.onloadstart, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onloadstart, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onloadstart, in: jsObject] = newValue } } @inlinable var onmousedown: EventHandler { get { ClosureAttribute1Optional[Strings.onmousedown, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onmousedown, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onmousedown, in: jsObject] = newValue } } @inlinable var onmouseenter: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseenter, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onmouseenter, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onmouseenter, in: jsObject] = newValue } } @inlinable var onmouseleave: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseleave, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onmouseleave, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onmouseleave, in: jsObject] = newValue } } @inlinable var onmousemove: EventHandler { get { ClosureAttribute1Optional[Strings.onmousemove, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onmousemove, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onmousemove, in: jsObject] = newValue } } @inlinable var onmouseout: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseout, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onmouseout, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onmouseout, in: jsObject] = newValue } } @inlinable var onmouseover: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseover, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onmouseover, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onmouseover, in: jsObject] = newValue } } @inlinable var onmouseup: EventHandler { get { ClosureAttribute1Optional[Strings.onmouseup, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onmouseup, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onmouseup, in: jsObject] = newValue } } @inlinable var onpause: EventHandler { get { ClosureAttribute1Optional[Strings.onpause, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpause, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpause, in: jsObject] = newValue } } @inlinable var onplay: EventHandler { get { ClosureAttribute1Optional[Strings.onplay, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onplay, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onplay, in: jsObject] = newValue } } @inlinable var onplaying: EventHandler { get { ClosureAttribute1Optional[Strings.onplaying, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onplaying, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onplaying, in: jsObject] = newValue } } @inlinable var onprogress: EventHandler { get { ClosureAttribute1Optional[Strings.onprogress, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onprogress, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onprogress, in: jsObject] = newValue } } @inlinable var onratechange: EventHandler { get { ClosureAttribute1Optional[Strings.onratechange, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onratechange, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onratechange, in: jsObject] = newValue } } @inlinable var onreset: EventHandler { get { ClosureAttribute1Optional[Strings.onreset, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onreset, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onreset, in: jsObject] = newValue } } @inlinable var onresize: EventHandler { get { ClosureAttribute1Optional[Strings.onresize, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onresize, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onresize, in: jsObject] = newValue } } @inlinable var onscroll: EventHandler { get { ClosureAttribute1Optional[Strings.onscroll, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onscroll, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onscroll, in: jsObject] = newValue } } @inlinable var onsecuritypolicyviolation: EventHandler { get { ClosureAttribute1Optional[Strings.onsecuritypolicyviolation, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onsecuritypolicyviolation, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onsecuritypolicyviolation, in: jsObject] = newValue } } @inlinable var onseeked: EventHandler { get { ClosureAttribute1Optional[Strings.onseeked, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onseeked, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onseeked, in: jsObject] = newValue } } @inlinable var onseeking: EventHandler { get { ClosureAttribute1Optional[Strings.onseeking, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onseeking, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onseeking, in: jsObject] = newValue } } @inlinable var onselect: EventHandler { get { ClosureAttribute1Optional[Strings.onselect, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onselect, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onselect, in: jsObject] = newValue } } @inlinable var onslotchange: EventHandler { get { ClosureAttribute1Optional[Strings.onslotchange, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onslotchange, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onslotchange, in: jsObject] = newValue } } @inlinable var onstalled: EventHandler { get { ClosureAttribute1Optional[Strings.onstalled, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onstalled, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onstalled, in: jsObject] = newValue } } @inlinable var onsubmit: EventHandler { get { ClosureAttribute1Optional[Strings.onsubmit, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onsubmit, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onsubmit, in: jsObject] = newValue } } @inlinable var onsuspend: EventHandler { get { ClosureAttribute1Optional[Strings.onsuspend, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onsuspend, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onsuspend, in: jsObject] = newValue } } @inlinable var ontimeupdate: EventHandler { get { ClosureAttribute1Optional[Strings.ontimeupdate, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontimeupdate, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontimeupdate, in: jsObject] = newValue } } @inlinable var ontoggle: EventHandler { get { ClosureAttribute1Optional[Strings.ontoggle, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontoggle, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontoggle, in: jsObject] = newValue } } @inlinable var onvolumechange: EventHandler { get { ClosureAttribute1Optional[Strings.onvolumechange, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onvolumechange, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onvolumechange, in: jsObject] = newValue } } @inlinable var onwaiting: EventHandler { get { ClosureAttribute1Optional[Strings.onwaiting, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onwaiting, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onwaiting, in: jsObject] = newValue } } @inlinable var onwebkitanimationend: EventHandler { get { ClosureAttribute1Optional[Strings.onwebkitanimationend, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onwebkitanimationend, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onwebkitanimationend, in: jsObject] = newValue } } @inlinable var onwebkitanimationiteration: EventHandler { get { ClosureAttribute1Optional[Strings.onwebkitanimationiteration, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onwebkitanimationiteration, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onwebkitanimationiteration, in: jsObject] = newValue } } @inlinable var onwebkitanimationstart: EventHandler { get { ClosureAttribute1Optional[Strings.onwebkitanimationstart, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onwebkitanimationstart, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onwebkitanimationstart, in: jsObject] = newValue } } @inlinable var onwebkittransitionend: EventHandler { get { ClosureAttribute1Optional[Strings.onwebkittransitionend, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onwebkittransitionend, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onwebkittransitionend, in: jsObject] = newValue } } @inlinable var onwheel: EventHandler { get { ClosureAttribute1Optional[Strings.onwheel, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onwheel, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onwheel, in: jsObject] = newValue } } @inlinable var ongotpointercapture: EventHandler { get { ClosureAttribute1Optional[Strings.ongotpointercapture, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ongotpointercapture, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ongotpointercapture, in: jsObject] = newValue } } @inlinable var onlostpointercapture: EventHandler { get { ClosureAttribute1Optional[Strings.onlostpointercapture, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onlostpointercapture, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onlostpointercapture, in: jsObject] = newValue } } @inlinable var onpointerdown: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerdown, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpointerdown, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpointerdown, in: jsObject] = newValue } } @inlinable var onpointermove: EventHandler { get { ClosureAttribute1Optional[Strings.onpointermove, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpointermove, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpointermove, in: jsObject] = newValue } } @inlinable var onpointerrawupdate: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerrawupdate, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpointerrawupdate, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpointerrawupdate, in: jsObject] = newValue } } @inlinable var onpointerup: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerup, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpointerup, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpointerup, in: jsObject] = newValue } } @inlinable var onpointercancel: EventHandler { get { ClosureAttribute1Optional[Strings.onpointercancel, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpointercancel, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpointercancel, in: jsObject] = newValue } } @inlinable var onpointerover: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerover, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpointerover, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpointerover, in: jsObject] = newValue } } @inlinable var onpointerout: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerout, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpointerout, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpointerout, in: jsObject] = newValue } } @inlinable var onpointerenter: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerenter, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpointerenter, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpointerenter, in: jsObject] = newValue } } @inlinable var onpointerleave: EventHandler { get { ClosureAttribute1Optional[Strings.onpointerleave, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpointerleave, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpointerleave, in: jsObject] = newValue } } @inlinable var onselectstart: EventHandler { get { ClosureAttribute1Optional[Strings.onselectstart, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onselectstart, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onselectstart, in: jsObject] = newValue } } @inlinable var onselectionchange: EventHandler { get { ClosureAttribute1Optional[Strings.onselectionchange, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onselectionchange, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onselectionchange, in: jsObject] = newValue } } @inlinable var ontouchstart: EventHandler { get { ClosureAttribute1Optional[Strings.ontouchstart, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontouchstart, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontouchstart, in: jsObject] = newValue } } @inlinable var ontouchend: EventHandler { get { ClosureAttribute1Optional[Strings.ontouchend, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontouchend, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontouchend, in: jsObject] = newValue } } @inlinable var ontouchmove: EventHandler { get { ClosureAttribute1Optional[Strings.ontouchmove, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontouchmove, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontouchmove, in: jsObject] = newValue } } @inlinable var ontouchcancel: EventHandler { get { ClosureAttribute1Optional[Strings.ontouchcancel, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ontouchcancel, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ontouchcancel, in: jsObject] = newValue } } @inlinable var onbeforexrselect: EventHandler { get { ClosureAttribute1Optional[Strings.onbeforexrselect, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onbeforexrselect, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onbeforexrselect, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift index 57a585a0..37ed259e 100644 --- a/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift +++ b/Sources/DOMKit/WebIDL/HTMLHyperlinkElementUtils.swift @@ -7,53 +7,53 @@ public protocol HTMLHyperlinkElementUtils: JSBridgedClass {} public extension HTMLHyperlinkElementUtils { @inlinable var href: String { get { ReadWriteAttribute[Strings.href, in: jsObject] } - set { ReadWriteAttribute[Strings.href, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.href, in: jsObject] = newValue } } @inlinable var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } @inlinable var `protocol`: String { get { ReadWriteAttribute[Strings.protocol, in: jsObject] } - set { ReadWriteAttribute[Strings.protocol, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.protocol, in: jsObject] = newValue } } @inlinable var username: String { get { ReadWriteAttribute[Strings.username, in: jsObject] } - set { ReadWriteAttribute[Strings.username, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.username, in: jsObject] = newValue } } @inlinable var password: String { get { ReadWriteAttribute[Strings.password, in: jsObject] } - set { ReadWriteAttribute[Strings.password, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.password, in: jsObject] = newValue } } @inlinable var host: String { get { ReadWriteAttribute[Strings.host, in: jsObject] } - set { ReadWriteAttribute[Strings.host, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.host, in: jsObject] = newValue } } @inlinable var hostname: String { get { ReadWriteAttribute[Strings.hostname, in: jsObject] } - set { ReadWriteAttribute[Strings.hostname, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.hostname, in: jsObject] = newValue } } @inlinable var port: String { get { ReadWriteAttribute[Strings.port, in: jsObject] } - set { ReadWriteAttribute[Strings.port, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.port, in: jsObject] = newValue } } @inlinable var pathname: String { get { ReadWriteAttribute[Strings.pathname, in: jsObject] } - set { ReadWriteAttribute[Strings.pathname, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.pathname, in: jsObject] = newValue } } @inlinable var search: String { get { ReadWriteAttribute[Strings.search, in: jsObject] } - set { ReadWriteAttribute[Strings.search, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.search, in: jsObject] = newValue } } @inlinable var hash: String { get { ReadWriteAttribute[Strings.hash, in: jsObject] } - set { ReadWriteAttribute[Strings.hash, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.hash, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift index ace7441a..9a11e13a 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift @@ -9,17 +9,17 @@ public extension HTMLOrSVGElement { @inlinable var nonce: String { get { ReadWriteAttribute[Strings.nonce, in: jsObject] } - set { ReadWriteAttribute[Strings.nonce, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.nonce, in: jsObject] = newValue } } @inlinable var autofocus: Bool { get { ReadWriteAttribute[Strings.autofocus, in: jsObject] } - set { ReadWriteAttribute[Strings.autofocus, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.autofocus, in: jsObject] = newValue } } @inlinable var tabIndex: Int32 { get { ReadWriteAttribute[Strings.tabIndex, in: jsObject] } - set { ReadWriteAttribute[Strings.tabIndex, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.tabIndex, in: jsObject] = newValue } } @inlinable func focus(options: FocusOptions? = nil) { diff --git a/Sources/DOMKit/WebIDL/InnerHTML.swift b/Sources/DOMKit/WebIDL/InnerHTML.swift index bac644a8..3fba5c88 100644 --- a/Sources/DOMKit/WebIDL/InnerHTML.swift +++ b/Sources/DOMKit/WebIDL/InnerHTML.swift @@ -7,6 +7,6 @@ public protocol InnerHTML: JSBridgedClass {} public extension InnerHTML { @inlinable var innerHTML: String { get { ReadWriteAttribute[Strings.innerHTML, in: jsObject] } - set { ReadWriteAttribute[Strings.innerHTML, in: jsObject] = newValue } + nonmutating set { ReadWriteAttribute[Strings.innerHTML, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift b/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift index fdfa2914..2b787a3d 100644 --- a/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift @@ -7,16 +7,16 @@ public protocol ServiceEventHandlers: JSBridgedClass {} public extension ServiceEventHandlers { @inlinable var onserviceadded: EventHandler { get { ClosureAttribute1Optional[Strings.onserviceadded, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onserviceadded, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onserviceadded, in: jsObject] = newValue } } @inlinable var onservicechanged: EventHandler { get { ClosureAttribute1Optional[Strings.onservicechanged, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onservicechanged, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onservicechanged, in: jsObject] = newValue } } @inlinable var onserviceremoved: EventHandler { get { ClosureAttribute1Optional[Strings.onserviceremoved, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onserviceremoved, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onserviceremoved, in: jsObject] = newValue } } } diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index 2d6d9d9b..4f7d1d61 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -7,96 +7,96 @@ public protocol WindowEventHandlers: JSBridgedClass {} public extension WindowEventHandlers { @inlinable var ongamepadconnected: EventHandler { get { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] = newValue } } @inlinable var ongamepaddisconnected: EventHandler { get { ClosureAttribute1Optional[Strings.ongamepaddisconnected, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ongamepaddisconnected, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ongamepaddisconnected, in: jsObject] = newValue } } @inlinable var onafterprint: EventHandler { get { ClosureAttribute1Optional[Strings.onafterprint, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onafterprint, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onafterprint, in: jsObject] = newValue } } @inlinable var onbeforeprint: EventHandler { get { ClosureAttribute1Optional[Strings.onbeforeprint, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onbeforeprint, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onbeforeprint, in: jsObject] = newValue } } @inlinable var onbeforeunload: OnBeforeUnloadEventHandler { get { ClosureAttribute1Optional[Strings.onbeforeunload, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onbeforeunload, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onbeforeunload, in: jsObject] = newValue } } @inlinable var onhashchange: EventHandler { get { ClosureAttribute1Optional[Strings.onhashchange, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onhashchange, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onhashchange, in: jsObject] = newValue } } @inlinable var onlanguagechange: EventHandler { get { ClosureAttribute1Optional[Strings.onlanguagechange, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onlanguagechange, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onlanguagechange, in: jsObject] = newValue } } @inlinable var onmessage: EventHandler { get { ClosureAttribute1Optional[Strings.onmessage, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onmessage, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onmessage, in: jsObject] = newValue } } @inlinable var onmessageerror: EventHandler { get { ClosureAttribute1Optional[Strings.onmessageerror, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onmessageerror, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onmessageerror, in: jsObject] = newValue } } @inlinable var onoffline: EventHandler { get { ClosureAttribute1Optional[Strings.onoffline, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onoffline, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onoffline, in: jsObject] = newValue } } @inlinable var ononline: EventHandler { get { ClosureAttribute1Optional[Strings.ononline, in: jsObject] } - set { ClosureAttribute1Optional[Strings.ononline, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.ononline, in: jsObject] = newValue } } @inlinable var onpagehide: EventHandler { get { ClosureAttribute1Optional[Strings.onpagehide, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpagehide, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpagehide, in: jsObject] = newValue } } @inlinable var onpageshow: EventHandler { get { ClosureAttribute1Optional[Strings.onpageshow, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpageshow, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpageshow, in: jsObject] = newValue } } @inlinable var onpopstate: EventHandler { get { ClosureAttribute1Optional[Strings.onpopstate, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onpopstate, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onpopstate, in: jsObject] = newValue } } @inlinable var onrejectionhandled: EventHandler { get { ClosureAttribute1Optional[Strings.onrejectionhandled, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onrejectionhandled, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onrejectionhandled, in: jsObject] = newValue } } @inlinable var onstorage: EventHandler { get { ClosureAttribute1Optional[Strings.onstorage, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onstorage, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onstorage, in: jsObject] = newValue } } @inlinable var onunhandledrejection: EventHandler { get { ClosureAttribute1Optional[Strings.onunhandledrejection, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onunhandledrejection, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onunhandledrejection, in: jsObject] = newValue } } @inlinable var onunload: EventHandler { get { ClosureAttribute1Optional[Strings.onunload, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onunload, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onunload, in: jsObject] = newValue } } @inlinable var onportalactivate: EventHandler { get { ClosureAttribute1Optional[Strings.onportalactivate, in: jsObject] } - set { ClosureAttribute1Optional[Strings.onportalactivate, in: jsObject] = newValue } + nonmutating set { ClosureAttribute1Optional[Strings.onportalactivate, in: jsObject] = newValue } } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 2c36c038..abb5388e 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -34,7 +34,7 @@ extension IDLAttribute: SwiftRepresentable, Initializable { } else if Context.constructor == nil || Context.static { // can't do property wrappers on extensions let setter: SwiftSource = """ - set { \(idlType.propertyWrapper(readonly: readonly))[\(Context.source(for: name)), in: jsObject] = newValue } + nonmutating set { \(idlType.propertyWrapper(readonly: readonly))[\(Context.source(for: name)), in: jsObject] = newValue } """ return """ From 9d204ce11abfb493d0bc67fb46128c2e3a6f4969 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 12:31:55 -0400 Subject: [PATCH 103/124] paper over compile error --- Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift | 5 +---- Sources/WebIDLToSwift/IDLBuilder.swift | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift index 16cc702d..fb635a39 100644 --- a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift +++ b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift @@ -38,8 +38,5 @@ public class AudioBufferSourceNode: AudioScheduledSourceNode { @ReadWriteAttribute public var loopEnd: Double - @inlinable override public func start(when: Double? = nil, offset: Double? = nil, duration: Double? = nil) { - let this = jsObject - _ = this[Strings.start].function!(this: this, arguments: [when?.jsValue() ?? .undefined, offset?.jsValue() ?? .undefined, duration?.jsValue() ?? .undefined]) - } + // XXX: member 'start' is ignored } diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 1460bb2e..3f8bb55b 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -87,6 +87,7 @@ enum IDLBuilder { "BeforeUnloadEvent": ["returnValue"], "CSSColor": ["colorSpace"], "SVGElement": ["className"], + "AudioBufferSourceNode": ["start"], // XPathNSResolver "XPathEvaluatorBase": ["createExpression", "createNSResolver", "evaluate"], ], From 2d59fd9c0f3081752781624d4c4ecd97d952189a Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 13:03:27 -0400 Subject: [PATCH 104/124] Implement ValueIterableIterator, ValueIterableAsyncIterator --- Sources/DOMKit/ECMAScript/Iterators.swift | 29 ++++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Iterators.swift b/Sources/DOMKit/ECMAScript/Iterators.swift index 8e329f7b..0a179df8 100644 --- a/Sources/DOMKit/ECMAScript/Iterators.swift +++ b/Sources/DOMKit/ECMAScript/Iterators.swift @@ -1,24 +1,21 @@ +import JavaScriptEventLoop import JavaScriptKit public class ValueIterableIterator: IteratorProtocol where SequenceType.Element: ConstructibleFromJSValue { - private var index: Int = 0 private let iterator: JSObject public init(sequence: SequenceType) { - // TODO: fetch the actual symbol - iterator = sequence.jsObject[JSObject.global.Symbol.object!.iterator.string!]!().object! + iterator = sequence.jsObject[JSSymbol.iterator].function!().object! } public func next() -> SequenceType.Element? { - defer { index += 1 } - let value = iterator.next!() - guard value != .undefined else { - return nil - } + let result = iterator.next!().object! + let done = result.done.boolean! + guard !done else { return nil } - return value.fromJSValue() + return result.value.fromJSValue()! } } @@ -27,14 +24,18 @@ public class ValueIterableAsyncIterator SequenceType.Element? { - // TODO: implement - nil + public func next() async throws -> SequenceType.Element? { + let promise = JSPromise(from: iterator.next!())! + let result = try await promise.get() + let done = result.done.boolean! + guard !done else { return nil } + + return result.value.fromJSValue()! } } From 8542c195486ece7af7b773612cd494199fdc3cc1 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 13:24:38 -0400 Subject: [PATCH 105/124] remove non-Window-exposed APIs --- .../WebIDL/AnimationWorkletGlobalScope.swift | 14 --- .../WebIDL/AudioWorkletGlobalScope.swift | 26 ---- .../DOMKit/WebIDL/AudioWorkletProcessor.swift | 22 ---- .../DOMKit/WebIDL/BackgroundFetchEvent.swift | 20 --- .../WebIDL/BackgroundFetchUpdateUIEvent.swift | 28 ----- Sources/DOMKit/WebIDL/BreakToken.swift | 22 ---- .../DOMKit/WebIDL/CanMakePaymentEvent.swift | 33 ----- Sources/DOMKit/WebIDL/ChildBreakToken.swift | 22 ---- Sources/DOMKit/WebIDL/Client.swift | 44 ------- Sources/DOMKit/WebIDL/Clients.swift | 62 ---------- Sources/DOMKit/WebIDL/ContentIndexEvent.swift | 20 --- .../WebIDL/DedicatedWorkerGlobalScope.swift | 43 ------- .../WebIDL/ExtendableCookieChangeEvent.swift | 24 ---- Sources/DOMKit/WebIDL/ExtendableEvent.swift | 21 ---- .../WebIDL/ExtendableMessageEvent.swift | 36 ------ Sources/DOMKit/WebIDL/FetchEvent.swift | 45 ------- Sources/DOMKit/WebIDL/FileReaderSync.swift | 38 ------ Sources/DOMKit/WebIDL/FragmentResult.swift | 26 ---- Sources/DOMKit/WebIDL/IntrinsicSizes.swift | 22 ---- Sources/DOMKit/WebIDL/LayoutChild.swift | 42 ------- Sources/DOMKit/WebIDL/LayoutConstraints.swift | 50 -------- Sources/DOMKit/WebIDL/LayoutEdges.swift | 38 ------ Sources/DOMKit/WebIDL/LayoutFragment.swift | 38 ------ .../WebIDL/LayoutWorkletGlobalScope.swift | 14 --- .../WebIDL/MediaStreamTrackProcessor.swift | 22 ---- Sources/DOMKit/WebIDL/NotificationEvent.swift | 24 ---- .../WebIDL/PaintRenderingContext2D.swift | 14 --- Sources/DOMKit/WebIDL/PaintSize.swift | 22 ---- .../WebIDL/PaintWorkletGlobalScope.swift | 18 --- .../DOMKit/WebIDL/PaymentRequestEvent.swift | 69 ----------- Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift | 20 --- Sources/DOMKit/WebIDL/PushEvent.swift | 20 --- Sources/DOMKit/WebIDL/PushMessageData.swift | 34 ----- .../WebIDL/PushSubscriptionChangeEvent.swift | 24 ---- .../RTCIdentityProviderGlobalScope.swift | 16 --- .../WebIDL/RTCIdentityProviderRegistrar.swift | 19 --- .../WebIDL/RTCRtpScriptTransformer.swift | 50 -------- Sources/DOMKit/WebIDL/RTCTransformEvent.swift | 16 --- .../WebIDL/ServiceWorkerGlobalScope.swift | 116 ------------------ .../WebIDL/SharedWorkerGlobalScope.swift | 25 ---- Sources/DOMKit/WebIDL/Strings.swift | 93 -------------- Sources/DOMKit/WebIDL/SyncEvent.swift | 24 ---- .../DOMKit/WebIDL/VideoTrackGenerator.swift | 30 ----- Sources/DOMKit/WebIDL/WindowClient.swift | 48 -------- Sources/DOMKit/WebIDL/WorkerGlobalScope.swift | 53 -------- Sources/DOMKit/WebIDL/WorkerLocation.swift | 50 -------- Sources/DOMKit/WebIDL/WorkerNavigator.swift | 34 ----- .../WebIDL/WorkletAnimationEffect.swift | 28 ----- .../DOMKit/WebIDL/WorkletGlobalScope.swift | 14 --- .../DOMKit/WebIDL/WorkletGroupEffect.swift | 19 --- Sources/WebIDL/ExtendedAttribute.swift | 13 +- Sources/WebIDLToSwift/MergeDeclarations.swift | 15 ++- 52 files changed, 25 insertions(+), 1655 deletions(-) delete mode 100644 Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/BreakToken.swift delete mode 100644 Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/ChildBreakToken.swift delete mode 100644 Sources/DOMKit/WebIDL/Client.swift delete mode 100644 Sources/DOMKit/WebIDL/Clients.swift delete mode 100644 Sources/DOMKit/WebIDL/ContentIndexEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/ExtendableEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/FetchEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/FileReaderSync.swift delete mode 100644 Sources/DOMKit/WebIDL/FragmentResult.swift delete mode 100644 Sources/DOMKit/WebIDL/IntrinsicSizes.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutChild.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutConstraints.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutEdges.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutFragment.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift delete mode 100644 Sources/DOMKit/WebIDL/NotificationEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift delete mode 100644 Sources/DOMKit/WebIDL/PaintSize.swift delete mode 100644 Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentRequestEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PushEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PushMessageData.swift delete mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCTransformEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/SyncEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoTrackGenerator.swift delete mode 100644 Sources/DOMKit/WebIDL/WindowClient.swift delete mode 100644 Sources/DOMKit/WebIDL/WorkerGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/WorkerLocation.swift delete mode 100644 Sources/DOMKit/WebIDL/WorkerNavigator.swift delete mode 100644 Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift delete mode 100644 Sources/DOMKit/WebIDL/WorkletGlobalScope.swift delete mode 100644 Sources/DOMKit/WebIDL/WorkletGroupEffect.swift diff --git a/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift deleted file mode 100644 index 00580574..00000000 --- a/Sources/DOMKit/WebIDL/AnimationWorkletGlobalScope.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AnimationWorkletGlobalScope: WorkletGlobalScope { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AnimationWorkletGlobalScope].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - // XXX: member 'registerAnimator' is ignored -} diff --git a/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift deleted file mode 100644 index 746a8f5c..00000000 --- a/Sources/DOMKit/WebIDL/AudioWorkletGlobalScope.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioWorkletGlobalScope: WorkletGlobalScope { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletGlobalScope].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _currentFrame = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentFrame) - _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) - _sampleRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleRate) - super.init(unsafelyWrapping: jsObject) - } - - // XXX: member 'registerProcessor' is ignored - - @ReadonlyAttribute - public var currentFrame: UInt64 - - @ReadonlyAttribute - public var currentTime: Double - - @ReadonlyAttribute - public var sampleRate: Float -} diff --git a/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift b/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift deleted file mode 100644 index f75e446b..00000000 --- a/Sources/DOMKit/WebIDL/AudioWorkletProcessor.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioWorkletProcessor: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletProcessor].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @ReadonlyAttribute - public var port: MessagePort -} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift b/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift deleted file mode 100644 index 6667d5ab..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BackgroundFetchEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _registration = ReadonlyAttribute(jsObject: jsObject, name: Strings.registration) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, init: BackgroundFetchEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) - } - - @ReadonlyAttribute - public var registration: BackgroundFetchRegistration -} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift b/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift deleted file mode 100644 index 90f4239a..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchUpdateUIEvent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BackgroundFetchUpdateUIEvent: BackgroundFetchEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchUpdateUIEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, init: BackgroundFetchEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) - } - - @inlinable public func updateUI(options: BackgroundFetchUIOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.updateUI].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func updateUI(options: BackgroundFetchUIOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.updateUI].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() - } -} diff --git a/Sources/DOMKit/WebIDL/BreakToken.swift b/Sources/DOMKit/WebIDL/BreakToken.swift deleted file mode 100644 index e53a05e6..00000000 --- a/Sources/DOMKit/WebIDL/BreakToken.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BreakToken: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BreakToken].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _childBreakTokens = ReadonlyAttribute(jsObject: jsObject, name: Strings.childBreakTokens) - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var childBreakTokens: [ChildBreakToken] - - @ReadonlyAttribute - public var data: JSValue -} diff --git a/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift b/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift deleted file mode 100644 index 9ff82131..00000000 --- a/Sources/DOMKit/WebIDL/CanMakePaymentEvent.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CanMakePaymentEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CanMakePaymentEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _topOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.topOrigin) - _paymentRequestOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentRequestOrigin) - _methodData = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodData) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: CanMakePaymentEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) - } - - @ReadonlyAttribute - public var topOrigin: String - - @ReadonlyAttribute - public var paymentRequestOrigin: String - - @ReadonlyAttribute - public var methodData: [PaymentMethodData] - - @inlinable public func respondWith(canMakePaymentResponse: JSPromise) { - let this = jsObject - _ = this[Strings.respondWith].function!(this: this, arguments: [canMakePaymentResponse.jsValue()]) - } -} diff --git a/Sources/DOMKit/WebIDL/ChildBreakToken.swift b/Sources/DOMKit/WebIDL/ChildBreakToken.swift deleted file mode 100644 index 9b033b2a..00000000 --- a/Sources/DOMKit/WebIDL/ChildBreakToken.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ChildBreakToken: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ChildBreakToken].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _breakType = ReadonlyAttribute(jsObject: jsObject, name: Strings.breakType) - _child = ReadonlyAttribute(jsObject: jsObject, name: Strings.child) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var breakType: BreakType - - @ReadonlyAttribute - public var child: LayoutChild -} diff --git a/Sources/DOMKit/WebIDL/Client.swift b/Sources/DOMKit/WebIDL/Client.swift deleted file mode 100644 index 4691ef8b..00000000 --- a/Sources/DOMKit/WebIDL/Client.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Client: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Client].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _lifecycleState = ReadonlyAttribute(jsObject: jsObject, name: Strings.lifecycleState) - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - _frameType = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameType) - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var lifecycleState: ClientLifecycleState - - @ReadonlyAttribute - public var url: String - - @ReadonlyAttribute - public var frameType: FrameType - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var type: ClientType - - @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { - let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) - } - - @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) - } -} diff --git a/Sources/DOMKit/WebIDL/Clients.swift b/Sources/DOMKit/WebIDL/Clients.swift deleted file mode 100644 index 2f2f9224..00000000 --- a/Sources/DOMKit/WebIDL/Clients.swift +++ /dev/null @@ -1,62 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Clients: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Clients].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func get(id: String) -> JSPromise { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func get(id: String) async throws -> __UNSUPPORTED_UNION__ { - let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @inlinable public func matchAll(options: ClientQueryOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.matchAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func matchAll(options: ClientQueryOptions? = nil) async throws -> [Client] { - let this = jsObject - let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @inlinable public func openWindow(url: String) -> JSPromise { - let this = jsObject - return this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func openWindow(url: String) async throws -> WindowClient? { - let this = jsObject - let _promise: JSPromise = this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @inlinable public func claim() -> JSPromise { - let this = jsObject - return this[Strings.claim].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func claim() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.claim].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() - } -} diff --git a/Sources/DOMKit/WebIDL/ContentIndexEvent.swift b/Sources/DOMKit/WebIDL/ContentIndexEvent.swift deleted file mode 100644 index b2006d40..00000000 --- a/Sources/DOMKit/WebIDL/ContentIndexEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ContentIndexEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ContentIndexEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, init: ContentIndexEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) - } - - @ReadonlyAttribute - public var id: String -} diff --git a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift deleted file mode 100644 index 54e0d630..00000000 --- a/Sources/DOMKit/WebIDL/DedicatedWorkerGlobalScope.swift +++ /dev/null @@ -1,43 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DedicatedWorkerGlobalScope: WorkerGlobalScope, AnimationFrameProvider { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DedicatedWorkerGlobalScope].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) - _onrtctransform = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onrtctransform) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var name: String - - @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { - let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) - } - - @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var onmessage: EventHandler - - @ClosureAttribute1Optional - public var onmessageerror: EventHandler - - @ClosureAttribute1Optional - public var onrtctransform: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift deleted file mode 100644 index b292ee01..00000000 --- a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ExtendableCookieChangeEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableCookieChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _changed = ReadonlyAttribute(jsObject: jsObject, name: Strings.changed) - _deleted = ReadonlyAttribute(jsObject: jsObject, name: Strings.deleted) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: ExtendableCookieChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) - } - - @ReadonlyAttribute - public var changed: [CookieListItem] - - @ReadonlyAttribute - public var deleted: [CookieListItem] -} diff --git a/Sources/DOMKit/WebIDL/ExtendableEvent.swift b/Sources/DOMKit/WebIDL/ExtendableEvent.swift deleted file mode 100644 index 0c8d7bf2..00000000 --- a/Sources/DOMKit/WebIDL/ExtendableEvent.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ExtendableEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: ExtendableEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) - } - - @inlinable public func waitUntil(f: JSPromise) { - let this = jsObject - _ = this[Strings.waitUntil].function!(this: this, arguments: [f.jsValue()]) - } -} diff --git a/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift b/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift deleted file mode 100644 index 40fce31f..00000000 --- a/Sources/DOMKit/WebIDL/ExtendableMessageEvent.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ExtendableMessageEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ExtendableMessageEvent].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: ExtendableMessageEventInit? = 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: __UNSUPPORTED_UNION__? - - @ReadonlyAttribute - public var ports: [MessagePort] -} diff --git a/Sources/DOMKit/WebIDL/FetchEvent.swift b/Sources/DOMKit/WebIDL/FetchEvent.swift deleted file mode 100644 index af069a33..00000000 --- a/Sources/DOMKit/WebIDL/FetchEvent.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FetchEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FetchEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _request = ReadonlyAttribute(jsObject: jsObject, name: Strings.request) - _preloadResponse = ReadonlyAttribute(jsObject: jsObject, name: Strings.preloadResponse) - _clientId = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientId) - _resultingClientId = ReadonlyAttribute(jsObject: jsObject, name: Strings.resultingClientId) - _replacesClientId = ReadonlyAttribute(jsObject: jsObject, name: Strings.replacesClientId) - _handled = ReadonlyAttribute(jsObject: jsObject, name: Strings.handled) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: FetchEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) - } - - @ReadonlyAttribute - public var request: Request - - @ReadonlyAttribute - public var preloadResponse: JSPromise - - @ReadonlyAttribute - public var clientId: String - - @ReadonlyAttribute - public var resultingClientId: String - - @ReadonlyAttribute - public var replacesClientId: String - - @ReadonlyAttribute - public var handled: JSPromise - - @inlinable public func respondWith(r: JSPromise) { - let this = jsObject - _ = this[Strings.respondWith].function!(this: this, arguments: [r.jsValue()]) - } -} diff --git a/Sources/DOMKit/WebIDL/FileReaderSync.swift b/Sources/DOMKit/WebIDL/FileReaderSync.swift deleted file mode 100644 index 081d2739..00000000 --- a/Sources/DOMKit/WebIDL/FileReaderSync.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileReaderSync: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileReaderSync].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @inlinable public func readAsArrayBuffer(blob: Blob) -> ArrayBuffer { - let this = jsObject - return this[Strings.readAsArrayBuffer].function!(this: this, arguments: [blob.jsValue()]).fromJSValue()! - } - - @inlinable public func readAsBinaryString(blob: Blob) -> String { - let this = jsObject - return this[Strings.readAsBinaryString].function!(this: this, arguments: [blob.jsValue()]).fromJSValue()! - } - - @inlinable public func readAsText(blob: Blob, encoding: String? = nil) -> String { - let this = jsObject - return this[Strings.readAsText].function!(this: this, arguments: [blob.jsValue(), encoding?.jsValue() ?? .undefined]).fromJSValue()! - } - - @inlinable public func readAsDataURL(blob: Blob) -> String { - let this = jsObject - return this[Strings.readAsDataURL].function!(this: this, arguments: [blob.jsValue()]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/FragmentResult.swift b/Sources/DOMKit/WebIDL/FragmentResult.swift deleted file mode 100644 index 780968ac..00000000 --- a/Sources/DOMKit/WebIDL/FragmentResult.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FragmentResult: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FragmentResult].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _inlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineSize) - _blockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockSize) - self.jsObject = jsObject - } - - @inlinable public convenience init(options: FragmentResultOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) - } - - @ReadonlyAttribute - public var inlineSize: Double - - @ReadonlyAttribute - public var blockSize: Double -} diff --git a/Sources/DOMKit/WebIDL/IntrinsicSizes.swift b/Sources/DOMKit/WebIDL/IntrinsicSizes.swift deleted file mode 100644 index b56d7648..00000000 --- a/Sources/DOMKit/WebIDL/IntrinsicSizes.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IntrinsicSizes: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IntrinsicSizes].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _minContentSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.minContentSize) - _maxContentSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxContentSize) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var minContentSize: Double - - @ReadonlyAttribute - public var maxContentSize: Double -} diff --git a/Sources/DOMKit/WebIDL/LayoutChild.swift b/Sources/DOMKit/WebIDL/LayoutChild.swift deleted file mode 100644 index a99b9e0c..00000000 --- a/Sources/DOMKit/WebIDL/LayoutChild.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LayoutChild: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutChild].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _styleMap = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleMap) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var styleMap: StylePropertyMapReadOnly - - @inlinable public func intrinsicSizes() -> JSPromise { - let this = jsObject - return this[Strings.intrinsicSizes].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func intrinsicSizes() async throws -> IntrinsicSizes { - let this = jsObject - let _promise: JSPromise = this[Strings.intrinsicSizes].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @inlinable public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) -> JSPromise { - let this = jsObject - return this[Strings.layoutNextFragment].function!(this: this, arguments: [constraints.jsValue(), breakToken.jsValue()]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func layoutNextFragment(constraints: LayoutConstraintsOptions, breakToken: ChildBreakToken) async throws -> LayoutFragment { - let this = jsObject - let _promise: JSPromise = this[Strings.layoutNextFragment].function!(this: this, arguments: [constraints.jsValue(), breakToken.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/LayoutConstraints.swift b/Sources/DOMKit/WebIDL/LayoutConstraints.swift deleted file mode 100644 index d4dabf8b..00000000 --- a/Sources/DOMKit/WebIDL/LayoutConstraints.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LayoutConstraints: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutConstraints].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _availableInlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.availableInlineSize) - _availableBlockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.availableBlockSize) - _fixedInlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.fixedInlineSize) - _fixedBlockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.fixedBlockSize) - _percentageInlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.percentageInlineSize) - _percentageBlockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.percentageBlockSize) - _blockFragmentationOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockFragmentationOffset) - _blockFragmentationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockFragmentationType) - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var availableInlineSize: Double - - @ReadonlyAttribute - public var availableBlockSize: Double - - @ReadonlyAttribute - public var fixedInlineSize: Double? - - @ReadonlyAttribute - public var fixedBlockSize: Double? - - @ReadonlyAttribute - public var percentageInlineSize: Double - - @ReadonlyAttribute - public var percentageBlockSize: Double - - @ReadonlyAttribute - public var blockFragmentationOffset: Double? - - @ReadonlyAttribute - public var blockFragmentationType: BlockFragmentationType - - @ReadonlyAttribute - public var data: JSValue -} diff --git a/Sources/DOMKit/WebIDL/LayoutEdges.swift b/Sources/DOMKit/WebIDL/LayoutEdges.swift deleted file mode 100644 index 00281c89..00000000 --- a/Sources/DOMKit/WebIDL/LayoutEdges.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LayoutEdges: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutEdges].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _inlineStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineStart) - _inlineEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineEnd) - _blockStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockStart) - _blockEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockEnd) - _inline = ReadonlyAttribute(jsObject: jsObject, name: Strings.inline) - _block = ReadonlyAttribute(jsObject: jsObject, name: Strings.block) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var inlineStart: Double - - @ReadonlyAttribute - public var inlineEnd: Double - - @ReadonlyAttribute - public var blockStart: Double - - @ReadonlyAttribute - public var blockEnd: Double - - @ReadonlyAttribute - public var inline: Double - - @ReadonlyAttribute - public var block: Double -} diff --git a/Sources/DOMKit/WebIDL/LayoutFragment.swift b/Sources/DOMKit/WebIDL/LayoutFragment.swift deleted file mode 100644 index ca27e1d6..00000000 --- a/Sources/DOMKit/WebIDL/LayoutFragment.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LayoutFragment: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutFragment].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _inlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineSize) - _blockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockSize) - _inlineOffset = ReadWriteAttribute(jsObject: jsObject, name: Strings.inlineOffset) - _blockOffset = ReadWriteAttribute(jsObject: jsObject, name: Strings.blockOffset) - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - _breakToken = ReadonlyAttribute(jsObject: jsObject, name: Strings.breakToken) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var inlineSize: Double - - @ReadonlyAttribute - public var blockSize: Double - - @ReadWriteAttribute - public var inlineOffset: Double - - @ReadWriteAttribute - public var blockOffset: Double - - @ReadonlyAttribute - public var data: JSValue - - @ReadonlyAttribute - public var breakToken: ChildBreakToken? -} diff --git a/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift deleted file mode 100644 index eaf77092..00000000 --- a/Sources/DOMKit/WebIDL/LayoutWorkletGlobalScope.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LayoutWorkletGlobalScope: WorkletGlobalScope { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.LayoutWorkletGlobalScope].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - // XXX: member 'registerLayout' is ignored -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift deleted file mode 100644 index 98ca5772..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessor.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaStreamTrackProcessor: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackProcessor].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _readable = ReadWriteAttribute(jsObject: jsObject, name: Strings.readable) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: MediaStreamTrackProcessorInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) - } - - @ReadWriteAttribute - public var readable: ReadableStream -} diff --git a/Sources/DOMKit/WebIDL/NotificationEvent.swift b/Sources/DOMKit/WebIDL/NotificationEvent.swift deleted file mode 100644 index c680a144..00000000 --- a/Sources/DOMKit/WebIDL/NotificationEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NotificationEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NotificationEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _notification = ReadonlyAttribute(jsObject: jsObject, name: Strings.notification) - _action = ReadonlyAttribute(jsObject: jsObject, name: Strings.action) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: NotificationEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) - } - - @ReadonlyAttribute - public var notification: Notification - - @ReadonlyAttribute - public var action: String -} diff --git a/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift b/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift deleted file mode 100644 index 6d5c03d7..00000000 --- a/Sources/DOMKit/WebIDL/PaintRenderingContext2D.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaintRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasRect, CanvasDrawPath, CanvasDrawImage, CanvasPathDrawingStyles, CanvasPath { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PaintRenderingContext2D].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/PaintSize.swift b/Sources/DOMKit/WebIDL/PaintSize.swift deleted file mode 100644 index 4602c594..00000000 --- a/Sources/DOMKit/WebIDL/PaintSize.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaintSize: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PaintSize].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var width: Double - - @ReadonlyAttribute - public var height: Double -} diff --git a/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift deleted file mode 100644 index 28f1fd07..00000000 --- a/Sources/DOMKit/WebIDL/PaintWorkletGlobalScope.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaintWorkletGlobalScope: WorkletGlobalScope { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaintWorkletGlobalScope].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _devicePixelRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePixelRatio) - super.init(unsafelyWrapping: jsObject) - } - - // XXX: member 'registerPaint' is ignored - - @ReadonlyAttribute - public var devicePixelRatio: Double -} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift deleted file mode 100644 index a856720c..00000000 --- a/Sources/DOMKit/WebIDL/PaymentRequestEvent.swift +++ /dev/null @@ -1,69 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentRequestEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequestEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _topOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.topOrigin) - _paymentRequestOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentRequestOrigin) - _paymentRequestId = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentRequestId) - _methodData = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodData) - _total = ReadonlyAttribute(jsObject: jsObject, name: Strings.total) - _modifiers = ReadonlyAttribute(jsObject: jsObject, name: Strings.modifiers) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: PaymentRequestEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) - } - - @ReadonlyAttribute - public var topOrigin: String - - @ReadonlyAttribute - public var paymentRequestOrigin: String - - @ReadonlyAttribute - public var paymentRequestId: String - - @ReadonlyAttribute - public var methodData: [PaymentMethodData] - - @ReadonlyAttribute - public var total: JSObject - - @ReadonlyAttribute - public var modifiers: [PaymentDetailsModifier] - - @inlinable public func openWindow(url: String) -> JSPromise { - let this = jsObject - return this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func openWindow(url: String) async throws -> WindowClient? { - let this = jsObject - let _promise: JSPromise = this[Strings.openWindow].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @inlinable public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) -> JSPromise { - let this = jsObject - return this[Strings.changePaymentMethod].function!(this: this, arguments: [methodName.jsValue(), methodDetails?.jsValue() ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func changePaymentMethod(methodName: String, methodDetails: JSObject? = nil) async throws -> PaymentRequestDetailsUpdate? { - let this = jsObject - let _promise: JSPromise = this[Strings.changePaymentMethod].function!(this: this, arguments: [methodName.jsValue(), methodDetails?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @inlinable public func respondWith(handlerResponsePromise: JSPromise) { - let this = jsObject - _ = this[Strings.respondWith].function!(this: this, arguments: [handlerResponsePromise.jsValue()]) - } -} diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift b/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift deleted file mode 100644 index cbf210b2..00000000 --- a/Sources/DOMKit/WebIDL/PeriodicSyncEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PeriodicSyncEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PeriodicSyncEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _tag = ReadonlyAttribute(jsObject: jsObject, name: Strings.tag) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, init: PeriodicSyncEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) - } - - @ReadonlyAttribute - public var tag: String -} diff --git a/Sources/DOMKit/WebIDL/PushEvent.swift b/Sources/DOMKit/WebIDL/PushEvent.swift deleted file mode 100644 index 36e26a5b..00000000 --- a/Sources/DOMKit/WebIDL/PushEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PushEvent].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: PushEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) - } - - @ReadonlyAttribute - public var data: PushMessageData? -} diff --git a/Sources/DOMKit/WebIDL/PushMessageData.swift b/Sources/DOMKit/WebIDL/PushMessageData.swift deleted file mode 100644 index eae01b62..00000000 --- a/Sources/DOMKit/WebIDL/PushMessageData.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushMessageData: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PushMessageData].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func arrayBuffer() -> ArrayBuffer { - let this = jsObject - return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func blob() -> Blob { - let this = jsObject - return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func json() -> JSValue { - let this = jsObject - return this[Strings.json].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func text() -> String { - let this = jsObject - return this[Strings.text].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift deleted file mode 100644 index 7cb10473..00000000 --- a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushSubscriptionChangeEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PushSubscriptionChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _newSubscription = ReadonlyAttribute(jsObject: jsObject, name: Strings.newSubscription) - _oldSubscription = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldSubscription) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: PushSubscriptionChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) - } - - @ReadonlyAttribute - public var newSubscription: PushSubscription? - - @ReadonlyAttribute - public var oldSubscription: PushSubscription? -} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift deleted file mode 100644 index 8cab70b2..00000000 --- a/Sources/DOMKit/WebIDL/RTCIdentityProviderGlobalScope.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIdentityProviderGlobalScope: WorkerGlobalScope { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityProviderGlobalScope].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _rtcIdentityProvider = ReadonlyAttribute(jsObject: jsObject, name: Strings.rtcIdentityProvider) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var rtcIdentityProvider: RTCIdentityProviderRegistrar -} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift deleted file mode 100644 index bf313649..00000000 --- a/Sources/DOMKit/WebIDL/RTCIdentityProviderRegistrar.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIdentityProviderRegistrar: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityProviderRegistrar].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func register(idp: RTCIdentityProvider) { - let this = jsObject - _ = this[Strings.register].function!(this: this, arguments: [idp.jsValue()]) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift deleted file mode 100644 index e03e4018..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpScriptTransformer.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpScriptTransformer: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpScriptTransformer].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) - _options = ReadonlyAttribute(jsObject: jsObject, name: Strings.options) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var readable: ReadableStream - - @ReadonlyAttribute - public var writable: WritableStream - - @ReadonlyAttribute - public var options: JSValue - - @inlinable public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { - let this = jsObject - return this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func generateKeyFrame(rids: [String]? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() - } - - @inlinable public func sendKeyFrameRequest() -> JSPromise { - let this = jsObject - return this[Strings.sendKeyFrameRequest].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func sendKeyFrameRequest() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.sendKeyFrameRequest].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() - } -} diff --git a/Sources/DOMKit/WebIDL/RTCTransformEvent.swift b/Sources/DOMKit/WebIDL/RTCTransformEvent.swift deleted file mode 100644 index 1ec8f799..00000000 --- a/Sources/DOMKit/WebIDL/RTCTransformEvent.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCTransformEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCTransformEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _transformer = ReadonlyAttribute(jsObject: jsObject, name: Strings.transformer) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var transformer: RTCRtpScriptTransformer -} diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift deleted file mode 100644 index f53b5f1d..00000000 --- a/Sources/DOMKit/WebIDL/ServiceWorkerGlobalScope.swift +++ /dev/null @@ -1,116 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ServiceWorkerGlobalScope: WorkerGlobalScope { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerGlobalScope].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onbackgroundfetchsuccess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbackgroundfetchsuccess) - _onbackgroundfetchfail = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbackgroundfetchfail) - _onbackgroundfetchabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbackgroundfetchabort) - _onbackgroundfetchclick = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbackgroundfetchclick) - _onsync = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsync) - _oncontentdelete = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncontentdelete) - _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) - _oncookiechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncookiechange) - _onnotificationclick = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnotificationclick) - _onnotificationclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnotificationclose) - _oncanmakepayment = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncanmakepayment) - _onpaymentrequest = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpaymentrequest) - _onperiodicsync = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onperiodicsync) - _onpush = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpush) - _onpushsubscriptionchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpushsubscriptionchange) - _clients = ReadonlyAttribute(jsObject: jsObject, name: Strings.clients) - _registration = ReadonlyAttribute(jsObject: jsObject, name: Strings.registration) - _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) - _oninstall = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oninstall) - _onactivate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onactivate) - _onfetch = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfetch) - _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var onbackgroundfetchsuccess: EventHandler - - @ClosureAttribute1Optional - public var onbackgroundfetchfail: EventHandler - - @ClosureAttribute1Optional - public var onbackgroundfetchabort: EventHandler - - @ClosureAttribute1Optional - public var onbackgroundfetchclick: EventHandler - - @ClosureAttribute1Optional - public var onsync: EventHandler - - @ClosureAttribute1Optional - public var oncontentdelete: EventHandler - - @ReadonlyAttribute - public var cookieStore: CookieStore - - @ClosureAttribute1Optional - public var oncookiechange: EventHandler - - @ClosureAttribute1Optional - public var onnotificationclick: EventHandler - - @ClosureAttribute1Optional - public var onnotificationclose: EventHandler - - @ClosureAttribute1Optional - public var oncanmakepayment: EventHandler - - @ClosureAttribute1Optional - public var onpaymentrequest: EventHandler - - @ClosureAttribute1Optional - public var onperiodicsync: EventHandler - - @ClosureAttribute1Optional - public var onpush: EventHandler - - @ClosureAttribute1Optional - public var onpushsubscriptionchange: EventHandler - - @ReadonlyAttribute - public var clients: Clients - - @ReadonlyAttribute - public var registration: ServiceWorkerRegistration - - @ReadonlyAttribute - public var serviceWorker: ServiceWorker - - @inlinable public func skipWaiting() -> JSPromise { - let this = jsObject - return this[Strings.skipWaiting].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func skipWaiting() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.skipWaiting].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() - } - - @ClosureAttribute1Optional - public var oninstall: EventHandler - - @ClosureAttribute1Optional - public var onactivate: EventHandler - - @ClosureAttribute1Optional - public var onfetch: EventHandler - - @ClosureAttribute1Optional - public var onmessage: EventHandler - - @ClosureAttribute1Optional - public var onmessageerror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift deleted file mode 100644 index 13284f35..00000000 --- a/Sources/DOMKit/WebIDL/SharedWorkerGlobalScope.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SharedWorkerGlobalScope: WorkerGlobalScope { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SharedWorkerGlobalScope].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var name: String - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var onconnect: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index 62242bc3..fca980a9 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -20,7 +20,6 @@ import JavaScriptKit @usableFromInline static let AnimationNodeList: JSString = "AnimationNodeList" @usableFromInline static let AnimationPlaybackEvent: JSString = "AnimationPlaybackEvent" @usableFromInline static let AnimationTimeline: JSString = "AnimationTimeline" - @usableFromInline static let AnimationWorkletGlobalScope: JSString = "AnimationWorkletGlobalScope" @usableFromInline static let Attr: JSString = "Attr" @usableFromInline static let AttributionReporting: JSString = "AttributionReporting" @usableFromInline static let AudioBuffer: JSString = "AudioBuffer" @@ -39,17 +38,13 @@ import JavaScriptKit @usableFromInline static let AudioTrack: JSString = "AudioTrack" @usableFromInline static let AudioTrackList: JSString = "AudioTrackList" @usableFromInline static let AudioWorklet: JSString = "AudioWorklet" - @usableFromInline static let AudioWorkletGlobalScope: JSString = "AudioWorkletGlobalScope" @usableFromInline static let AudioWorkletNode: JSString = "AudioWorkletNode" - @usableFromInline static let AudioWorkletProcessor: JSString = "AudioWorkletProcessor" @usableFromInline static let AuthenticatorAssertionResponse: JSString = "AuthenticatorAssertionResponse" @usableFromInline static let AuthenticatorAttestationResponse: JSString = "AuthenticatorAttestationResponse" @usableFromInline static let AuthenticatorResponse: JSString = "AuthenticatorResponse" - @usableFromInline static let BackgroundFetchEvent: JSString = "BackgroundFetchEvent" @usableFromInline static let BackgroundFetchManager: JSString = "BackgroundFetchManager" @usableFromInline static let BackgroundFetchRecord: JSString = "BackgroundFetchRecord" @usableFromInline static let BackgroundFetchRegistration: JSString = "BackgroundFetchRegistration" - @usableFromInline static let BackgroundFetchUpdateUIEvent: JSString = "BackgroundFetchUpdateUIEvent" @usableFromInline static let BarProp: JSString = "BarProp" @usableFromInline static let BarcodeDetector: JSString = "BarcodeDetector" @usableFromInline static let BaseAudioContext: JSString = "BaseAudioContext" @@ -72,7 +67,6 @@ import JavaScriptKit @usableFromInline static let BluetoothRemoteGATTService: JSString = "BluetoothRemoteGATTService" @usableFromInline static let BluetoothServiceDataMap: JSString = "BluetoothServiceDataMap" @usableFromInline static let BluetoothUUID: JSString = "BluetoothUUID" - @usableFromInline static let BreakToken: JSString = "BreakToken" @usableFromInline static let BroadcastChannel: JSString = "BroadcastChannel" @usableFromInline static let BrowserCaptureMediaStreamTrack: JSString = "BrowserCaptureMediaStreamTrack" @usableFromInline static let ByteLengthQueuingStrategy: JSString = "ByteLengthQueuingStrategy" @@ -153,7 +147,6 @@ import JavaScriptKit @usableFromInline static let CSSViewportRule: JSString = "CSSViewportRule" @usableFromInline static let Cache: JSString = "Cache" @usableFromInline static let CacheStorage: JSString = "CacheStorage" - @usableFromInline static let CanMakePaymentEvent: JSString = "CanMakePaymentEvent" @usableFromInline static let CanvasCaptureMediaStreamTrack: JSString = "CanvasCaptureMediaStreamTrack" @usableFromInline static let CanvasFilter: JSString = "CanvasFilter" @usableFromInline static let CanvasGradient: JSString = "CanvasGradient" @@ -164,9 +157,6 @@ import JavaScriptKit @usableFromInline static let ChannelSplitterNode: JSString = "ChannelSplitterNode" @usableFromInline static let CharacterBoundsUpdateEvent: JSString = "CharacterBoundsUpdateEvent" @usableFromInline static let CharacterData: JSString = "CharacterData" - @usableFromInline static let ChildBreakToken: JSString = "ChildBreakToken" - @usableFromInline static let Client: JSString = "Client" - @usableFromInline static let Clients: JSString = "Clients" @usableFromInline static let Clipboard: JSString = "Clipboard" @usableFromInline static let ClipboardEvent: JSString = "ClipboardEvent" @usableFromInline static let ClipboardItem: JSString = "ClipboardItem" @@ -180,7 +170,6 @@ import JavaScriptKit @usableFromInline static let ContactAddress: JSString = "ContactAddress" @usableFromInline static let ContactsManager: JSString = "ContactsManager" @usableFromInline static let ContentIndex: JSString = "ContentIndex" - @usableFromInline static let ContentIndexEvent: JSString = "ContentIndexEvent" @usableFromInline static let ConvolverNode: JSString = "ConvolverNode" @usableFromInline static let CookieChangeEvent: JSString = "CookieChangeEvent" @usableFromInline static let CookieStore: JSString = "CookieStore" @@ -214,7 +203,6 @@ import JavaScriptKit @usableFromInline static let DataTransferItem: JSString = "DataTransferItem" @usableFromInline static let DataTransferItemList: JSString = "DataTransferItemList" @usableFromInline static let DecompressionStream: JSString = "DecompressionStream" - @usableFromInline static let DedicatedWorkerGlobalScope: JSString = "DedicatedWorkerGlobalScope" @usableFromInline static let DelayNode: JSString = "DelayNode" @usableFromInline static let DeprecationReportBody: JSString = "DeprecationReportBody" @usableFromInline static let DeviceMotionEvent: JSString = "DeviceMotionEvent" @@ -253,18 +241,13 @@ import JavaScriptKit @usableFromInline static let EventCounts: JSString = "EventCounts" @usableFromInline static let EventSource: JSString = "EventSource" @usableFromInline static let EventTarget: JSString = "EventTarget" - @usableFromInline static let ExtendableCookieChangeEvent: JSString = "ExtendableCookieChangeEvent" - @usableFromInline static let ExtendableEvent: JSString = "ExtendableEvent" - @usableFromInline static let ExtendableMessageEvent: JSString = "ExtendableMessageEvent" @usableFromInline static let External: JSString = "External" @usableFromInline static let EyeDropper: JSString = "EyeDropper" @usableFromInline static let FaceDetector: JSString = "FaceDetector" @usableFromInline static let FederatedCredential: JSString = "FederatedCredential" - @usableFromInline static let FetchEvent: JSString = "FetchEvent" @usableFromInline static let File: JSString = "File" @usableFromInline static let FileList: JSString = "FileList" @usableFromInline static let FileReader: JSString = "FileReader" - @usableFromInline static let FileReaderSync: JSString = "FileReaderSync" @usableFromInline static let FileSystem: JSString = "FileSystem" @usableFromInline static let FileSystemDirectoryEntry: JSString = "FileSystemDirectoryEntry" @usableFromInline static let FileSystemDirectoryHandle: JSString = "FileSystemDirectoryHandle" @@ -290,7 +273,6 @@ import JavaScriptKit @usableFromInline static let FormData: JSString = "FormData" @usableFromInline static let FormDataEvent: JSString = "FormDataEvent" @usableFromInline static let FragmentDirective: JSString = "FragmentDirective" - @usableFromInline static let FragmentResult: JSString = "FragmentResult" @usableFromInline static let GPU: JSString = "GPU" @usableFromInline static let GPUAdapter: JSString = "GPUAdapter" @usableFromInline static let GPUBindGroup: JSString = "GPUBindGroup" @@ -460,7 +442,6 @@ import JavaScriptKit @usableFromInline static let IntersectionObserver: JSString = "IntersectionObserver" @usableFromInline static let IntersectionObserverEntry: JSString = "IntersectionObserverEntry" @usableFromInline static let InterventionReportBody: JSString = "InterventionReportBody" - @usableFromInline static let IntrinsicSizes: JSString = "IntrinsicSizes" @usableFromInline static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" @usableFromInline static let KHR_parallel_shader_compile: JSString = "KHR_parallel_shader_compile" @usableFromInline static let Keyboard: JSString = "Keyboard" @@ -468,13 +449,8 @@ import JavaScriptKit @usableFromInline static let KeyboardLayoutMap: JSString = "KeyboardLayoutMap" @usableFromInline static let KeyframeEffect: JSString = "KeyframeEffect" @usableFromInline static let LargestContentfulPaint: JSString = "LargestContentfulPaint" - @usableFromInline static let LayoutChild: JSString = "LayoutChild" - @usableFromInline static let LayoutConstraints: JSString = "LayoutConstraints" - @usableFromInline static let LayoutEdges: JSString = "LayoutEdges" - @usableFromInline static let LayoutFragment: JSString = "LayoutFragment" @usableFromInline static let LayoutShift: JSString = "LayoutShift" @usableFromInline static let LayoutShiftAttribution: JSString = "LayoutShiftAttribution" - @usableFromInline static let LayoutWorkletGlobalScope: JSString = "LayoutWorkletGlobalScope" @usableFromInline static let LinearAccelerationSensor: JSString = "LinearAccelerationSensor" @usableFromInline static let Location: JSString = "Location" @usableFromInline static let Lock: JSString = "Lock" @@ -520,7 +496,6 @@ import JavaScriptKit @usableFromInline static let MediaStreamTrack: JSString = "MediaStreamTrack" @usableFromInline static let MediaStreamTrackAudioSourceNode: JSString = "MediaStreamTrackAudioSourceNode" @usableFromInline static let MediaStreamTrackEvent: JSString = "MediaStreamTrackEvent" - @usableFromInline static let MediaStreamTrackProcessor: JSString = "MediaStreamTrackProcessor" @usableFromInline static let Memory: JSString = "Memory" @usableFromInline static let MessageChannel: JSString = "MessageChannel" @usableFromInline static let MessageEvent: JSString = "MessageEvent" @@ -554,7 +529,6 @@ import JavaScriptKit @usableFromInline static let NodeIterator: JSString = "NodeIterator" @usableFromInline static let NodeList: JSString = "NodeList" @usableFromInline static let Notification: JSString = "Notification" - @usableFromInline static let NotificationEvent: JSString = "NotificationEvent" @usableFromInline static let OES_draw_buffers_indexed: JSString = "OES_draw_buffers_indexed" @usableFromInline static let OES_element_index_uint: JSString = "OES_element_index_uint" @usableFromInline static let OES_fbo_render_mipmap: JSString = "OES_fbo_render_mipmap" @@ -575,9 +549,6 @@ import JavaScriptKit @usableFromInline static let OscillatorNode: JSString = "OscillatorNode" @usableFromInline static let OverconstrainedError: JSString = "OverconstrainedError" @usableFromInline static let PageTransitionEvent: JSString = "PageTransitionEvent" - @usableFromInline static let PaintRenderingContext2D: JSString = "PaintRenderingContext2D" - @usableFromInline static let PaintSize: JSString = "PaintSize" - @usableFromInline static let PaintWorkletGlobalScope: JSString = "PaintWorkletGlobalScope" @usableFromInline static let PannerNode: JSString = "PannerNode" @usableFromInline static let PasswordCredential: JSString = "PasswordCredential" @usableFromInline static let Path2D: JSString = "Path2D" @@ -585,7 +556,6 @@ import JavaScriptKit @usableFromInline static let PaymentManager: JSString = "PaymentManager" @usableFromInline static let PaymentMethodChangeEvent: JSString = "PaymentMethodChangeEvent" @usableFromInline static let PaymentRequest: JSString = "PaymentRequest" - @usableFromInline static let PaymentRequestEvent: JSString = "PaymentRequestEvent" @usableFromInline static let PaymentRequestUpdateEvent: JSString = "PaymentRequestUpdateEvent" @usableFromInline static let PaymentResponse: JSString = "PaymentResponse" @usableFromInline static let Performance: JSString = "Performance" @@ -603,7 +573,6 @@ import JavaScriptKit @usableFromInline static let PerformanceResourceTiming: JSString = "PerformanceResourceTiming" @usableFromInline static let PerformanceServerTiming: JSString = "PerformanceServerTiming" @usableFromInline static let PerformanceTiming: JSString = "PerformanceTiming" - @usableFromInline static let PeriodicSyncEvent: JSString = "PeriodicSyncEvent" @usableFromInline static let PeriodicSyncManager: JSString = "PeriodicSyncManager" @usableFromInline static let PeriodicWave: JSString = "PeriodicWave" @usableFromInline static let PermissionStatus: JSString = "PermissionStatus" @@ -632,11 +601,8 @@ import JavaScriptKit @usableFromInline static let PromiseRejectionEvent: JSString = "PromiseRejectionEvent" @usableFromInline static let ProximitySensor: JSString = "ProximitySensor" @usableFromInline static let PublicKeyCredential: JSString = "PublicKeyCredential" - @usableFromInline static let PushEvent: JSString = "PushEvent" @usableFromInline static let PushManager: JSString = "PushManager" - @usableFromInline static let PushMessageData: JSString = "PushMessageData" @usableFromInline static let PushSubscription: JSString = "PushSubscription" - @usableFromInline static let PushSubscriptionChangeEvent: JSString = "PushSubscriptionChangeEvent" @usableFromInline static let PushSubscriptionOptions: JSString = "PushSubscriptionOptions" @usableFromInline static let Q: JSString = "Q" @usableFromInline static let RTCCertificate: JSString = "RTCCertificate" @@ -652,21 +618,17 @@ import JavaScriptKit @usableFromInline static let RTCIceCandidate: JSString = "RTCIceCandidate" @usableFromInline static let RTCIceTransport: JSString = "RTCIceTransport" @usableFromInline static let RTCIdentityAssertion: JSString = "RTCIdentityAssertion" - @usableFromInline static let RTCIdentityProviderGlobalScope: JSString = "RTCIdentityProviderGlobalScope" - @usableFromInline static let RTCIdentityProviderRegistrar: JSString = "RTCIdentityProviderRegistrar" @usableFromInline static let RTCPeerConnection: JSString = "RTCPeerConnection" @usableFromInline static let RTCPeerConnectionIceErrorEvent: JSString = "RTCPeerConnectionIceErrorEvent" @usableFromInline static let RTCPeerConnectionIceEvent: JSString = "RTCPeerConnectionIceEvent" @usableFromInline static let RTCRtpReceiver: JSString = "RTCRtpReceiver" @usableFromInline static let RTCRtpScriptTransform: JSString = "RTCRtpScriptTransform" - @usableFromInline static let RTCRtpScriptTransformer: JSString = "RTCRtpScriptTransformer" @usableFromInline static let RTCRtpSender: JSString = "RTCRtpSender" @usableFromInline static let RTCRtpTransceiver: JSString = "RTCRtpTransceiver" @usableFromInline static let RTCSctpTransport: JSString = "RTCSctpTransport" @usableFromInline static let RTCSessionDescription: JSString = "RTCSessionDescription" @usableFromInline static let RTCStatsReport: JSString = "RTCStatsReport" @usableFromInline static let RTCTrackEvent: JSString = "RTCTrackEvent" - @usableFromInline static let RTCTransformEvent: JSString = "RTCTransformEvent" @usableFromInline static let RadioNodeList: JSString = "RadioNodeList" @usableFromInline static let Range: JSString = "Range" @usableFromInline static let ReadableByteStreamController: JSString = "ReadableByteStreamController" @@ -800,12 +762,10 @@ import JavaScriptKit @usableFromInline static let SerialPort: JSString = "SerialPort" @usableFromInline static let ServiceWorker: JSString = "ServiceWorker" @usableFromInline static let ServiceWorkerContainer: JSString = "ServiceWorkerContainer" - @usableFromInline static let ServiceWorkerGlobalScope: JSString = "ServiceWorkerGlobalScope" @usableFromInline static let ServiceWorkerRegistration: JSString = "ServiceWorkerRegistration" @usableFromInline static let ShadowAnimation: JSString = "ShadowAnimation" @usableFromInline static let ShadowRoot: JSString = "ShadowRoot" @usableFromInline static let SharedWorker: JSString = "SharedWorker" - @usableFromInline static let SharedWorkerGlobalScope: JSString = "SharedWorkerGlobalScope" @usableFromInline static let SourceBuffer: JSString = "SourceBuffer" @usableFromInline static let SourceBufferList: JSString = "SourceBufferList" @usableFromInline static let SpeechGrammar: JSString = "SpeechGrammar" @@ -832,7 +792,6 @@ import JavaScriptKit @usableFromInline static let StyleSheetList: JSString = "StyleSheetList" @usableFromInline static let SubmitEvent: JSString = "SubmitEvent" @usableFromInline static let SubtleCrypto: JSString = "SubtleCrypto" - @usableFromInline static let SyncEvent: JSString = "SyncEvent" @usableFromInline static let SyncManager: JSString = "SyncManager" @usableFromInline static let Table: JSString = "Table" @usableFromInline static let TaskAttributionTiming: JSString = "TaskAttributionTiming" @@ -898,7 +857,6 @@ import JavaScriptKit @usableFromInline static let VideoFrame: JSString = "VideoFrame" @usableFromInline static let VideoPlaybackQuality: JSString = "VideoPlaybackQuality" @usableFromInline static let VideoTrack: JSString = "VideoTrack" - @usableFromInline static let VideoTrackGenerator: JSString = "VideoTrackGenerator" @usableFromInline static let VideoTrackList: JSString = "VideoTrackList" @usableFromInline static let VirtualKeyboard: JSString = "VirtualKeyboard" @usableFromInline static let VisualViewport: JSString = "VisualViewport" @@ -949,18 +907,11 @@ import JavaScriptKit @usableFromInline static let WebTransportError: JSString = "WebTransportError" @usableFromInline static let WheelEvent: JSString = "WheelEvent" @usableFromInline static let Window: JSString = "Window" - @usableFromInline static let WindowClient: JSString = "WindowClient" @usableFromInline static let WindowControlsOverlay: JSString = "WindowControlsOverlay" @usableFromInline static let WindowControlsOverlayGeometryChangeEvent: JSString = "WindowControlsOverlayGeometryChangeEvent" @usableFromInline static let Worker: JSString = "Worker" - @usableFromInline static let WorkerGlobalScope: JSString = "WorkerGlobalScope" - @usableFromInline static let WorkerLocation: JSString = "WorkerLocation" - @usableFromInline static let WorkerNavigator: JSString = "WorkerNavigator" @usableFromInline static let Worklet: JSString = "Worklet" @usableFromInline static let WorkletAnimation: JSString = "WorkletAnimation" - @usableFromInline static let WorkletAnimationEffect: JSString = "WorkletAnimationEffect" - @usableFromInline static let WorkletGlobalScope: JSString = "WorkletGlobalScope" - @usableFromInline static let WorkletGroupEffect: JSString = "WorkletGroupEffect" @usableFromInline static let WritableStream: JSString = "WritableStream" @usableFromInline static let WritableStreamDefaultController: JSString = "WritableStreamDefaultController" @usableFromInline static let WritableStreamDefaultWriter: JSString = "WritableStreamDefaultWriter" @@ -1354,12 +1305,9 @@ import JavaScriptKit @usableFromInline static let blob: JSString = "blob" @usableFromInline static let block: JSString = "block" @usableFromInline static let blockElements: JSString = "blockElements" - @usableFromInline static let blockEnd: JSString = "blockEnd" @usableFromInline static let blockFragmentationOffset: JSString = "blockFragmentationOffset" @usableFromInline static let blockFragmentationType: JSString = "blockFragmentationType" - @usableFromInline static let blockOffset: JSString = "blockOffset" @usableFromInline static let blockSize: JSString = "blockSize" - @usableFromInline static let blockStart: JSString = "blockStart" @usableFromInline static let blockedURI: JSString = "blockedURI" @usableFromInline static let blockedURL: JSString = "blockedURL" @usableFromInline static let blocking: JSString = "blocking" @@ -1385,7 +1333,6 @@ import JavaScriptKit @usableFromInline static let brands: JSString = "brands" @usableFromInline static let `break`: JSString = "break" @usableFromInline static let breakToken: JSString = "breakToken" - @usableFromInline static let breakType: JSString = "breakType" @usableFromInline static let breakdown: JSString = "breakdown" @usableFromInline static let brightness: JSString = "brightness" @usableFromInline static let broadcast: JSString = "broadcast" @@ -1462,7 +1409,6 @@ import JavaScriptKit @usableFromInline static let ch: JSString = "ch" @usableFromInline static let chOff: JSString = "chOff" @usableFromInline static let challenge: JSString = "challenge" - @usableFromInline static let changePaymentMethod: JSString = "changePaymentMethod" @usableFromInline static let changeType: JSString = "changeType" @usableFromInline static let changed: JSString = "changed" @usableFromInline static let changedTouches: JSString = "changedTouches" @@ -1490,7 +1436,6 @@ import JavaScriptKit @usableFromInline static let checkIntersection: JSString = "checkIntersection" @usableFromInline static let checkValidity: JSString = "checkValidity" @usableFromInline static let checked: JSString = "checked" - @usableFromInline static let child: JSString = "child" @usableFromInline static let childBreakTokens: JSString = "childBreakTokens" @usableFromInline static let childDisplay: JSString = "childDisplay" @usableFromInline static let childElementCount: JSString = "childElementCount" @@ -1502,7 +1447,6 @@ import JavaScriptKit @usableFromInline static let circuitBreakerTriggerCount: JSString = "circuitBreakerTriggerCount" @usableFromInline static let cite: JSString = "cite" @usableFromInline static let city: JSString = "city" - @usableFromInline static let claim: JSString = "claim" @usableFromInline static let claimInterface: JSString = "claimInterface" @usableFromInline static let claimed: JSString = "claimed" @usableFromInline static let clamp: JSString = "clamp" @@ -1544,7 +1488,6 @@ import JavaScriptKit @usableFromInline static let clientWidth: JSString = "clientWidth" @usableFromInline static let clientX: JSString = "clientX" @usableFromInline static let clientY: JSString = "clientY" - @usableFromInline static let clients: JSString = "clients" @usableFromInline static let clip: JSString = "clip" @usableFromInline static let clipPathUnits: JSString = "clipPathUnits" @usableFromInline static let clipboard: JSString = "clipboard" @@ -1854,7 +1797,6 @@ import JavaScriptKit @usableFromInline static let currency: JSString = "currency" @usableFromInline static let currentDirection: JSString = "currentDirection" @usableFromInline static let currentEntry: JSString = "currentEntry" - @usableFromInline static let currentFrame: JSString = "currentFrame" @usableFromInline static let currentIteration: JSString = "currentIteration" @usableFromInline static let currentLocalDescription: JSString = "currentLocalDescription" @usableFromInline static let currentNode: JSString = "currentNode" @@ -2310,7 +2252,6 @@ import JavaScriptKit @usableFromInline static let focusNode: JSString = "focusNode" @usableFromInline static let focusOffset: JSString = "focusOffset" @usableFromInline static let focusableAreas: JSString = "focusableAreas" - @usableFromInline static let focused: JSString = "focused" @usableFromInline static let font: JSString = "font" @usableFromInline static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" @usableFromInline static let fontBoundingBoxDescent: JSString = "fontBoundingBoxDescent" @@ -2353,7 +2294,6 @@ import JavaScriptKit @usableFromInline static let frameIndex: JSString = "frameIndex" @usableFromInline static let frameOffset: JSString = "frameOffset" @usableFromInline static let frameRate: JSString = "frameRate" - @usableFromInline static let frameType: JSString = "frameType" @usableFromInline static let frameWidth: JSString = "frameWidth" @usableFromInline static let framebuffer: JSString = "framebuffer" @usableFromInline static let framebufferHeight: JSString = "framebufferHeight" @@ -2455,7 +2395,6 @@ import JavaScriptKit @usableFromInline static let getCharNumAtPosition: JSString = "getCharNumAtPosition" @usableFromInline static let getCharacteristic: JSString = "getCharacteristic" @usableFromInline static let getCharacteristics: JSString = "getCharacteristics" - @usableFromInline static let getChildren: JSString = "getChildren" @usableFromInline static let getClientExtensionResults: JSString = "getClientExtensionResults" @usableFromInline static let getClientRect: JSString = "getClientRect" @usableFromInline static let getClientRects: JSString = "getClientRects" @@ -2761,7 +2700,6 @@ import JavaScriptKit @usableFromInline static let importExternalTexture: JSString = "importExternalTexture" @usableFromInline static let importKey: JSString = "importKey" @usableFromInline static let importNode: JSString = "importNode" - @usableFromInline static let importScripts: JSString = "importScripts" @usableFromInline static let importStylesheet: JSString = "importStylesheet" @usableFromInline static let imports: JSString = "imports" @usableFromInline static let `in`: JSString = "in" @@ -2804,10 +2742,7 @@ import JavaScriptKit @usableFromInline static let initiatorType: JSString = "initiatorType" @usableFromInline static let ink: JSString = "ink" @usableFromInline static let inline: JSString = "inline" - @usableFromInline static let inlineEnd: JSString = "inlineEnd" - @usableFromInline static let inlineOffset: JSString = "inlineOffset" @usableFromInline static let inlineSize: JSString = "inlineSize" - @usableFromInline static let inlineStart: JSString = "inlineStart" @usableFromInline static let inlineVerticalFieldOfView: JSString = "inlineVerticalFieldOfView" @usableFromInline static let innerHTML: JSString = "innerHTML" @usableFromInline static let innerHeight: JSString = "innerHeight" @@ -2860,7 +2795,6 @@ import JavaScriptKit @usableFromInline static let intersectionRect: JSString = "intersectionRect" @usableFromInline static let intersectsNode: JSString = "intersectsNode" @usableFromInline static let interval: JSString = "interval" - @usableFromInline static let intrinsicSizes: JSString = "intrinsicSizes" @usableFromInline static let introductoryPrice: JSString = "introductoryPrice" @usableFromInline static let introductoryPriceCycles: JSString = "introductoryPriceCycles" @usableFromInline static let introductoryPricePeriod: JSString = "introductoryPricePeriod" @@ -3008,7 +2942,6 @@ import JavaScriptKit @usableFromInline static let layerName: JSString = "layerName" @usableFromInline static let layers: JSString = "layers" @usableFromInline static let layout: JSString = "layout" - @usableFromInline static let layoutNextFragment: JSString = "layoutNextFragment" @usableFromInline static let layoutWorklet: JSString = "layoutWorklet" @usableFromInline static let leakyRelu: JSString = "leakyRelu" @usableFromInline static let left: JSString = "left" @@ -3018,7 +2951,6 @@ import JavaScriptKit @usableFromInline static let letterSpacing: JSString = "letterSpacing" @usableFromInline static let level: JSString = "level" @usableFromInline static let lh: JSString = "lh" - @usableFromInline static let lifecycleState: JSString = "lifecycleState" @usableFromInline static let limitingConeAngle: JSString = "limitingConeAngle" @usableFromInline static let limits: JSString = "limits" @usableFromInline static let line: JSString = "line" @@ -3381,10 +3313,6 @@ import JavaScriptKit @usableFromInline static let onaudiostart: JSString = "onaudiostart" @usableFromInline static let onauxclick: JSString = "onauxclick" @usableFromInline static let onavailabilitychanged: JSString = "onavailabilitychanged" - @usableFromInline static let onbackgroundfetchabort: JSString = "onbackgroundfetchabort" - @usableFromInline static let onbackgroundfetchclick: JSString = "onbackgroundfetchclick" - @usableFromInline static let onbackgroundfetchfail: JSString = "onbackgroundfetchfail" - @usableFromInline static let onbackgroundfetchsuccess: JSString = "onbackgroundfetchsuccess" @usableFromInline static let onbeforeinstallprompt: JSString = "onbeforeinstallprompt" @usableFromInline static let onbeforeprint: JSString = "onbeforeprint" @usableFromInline static let onbeforeunload: JSString = "onbeforeunload" @@ -3395,7 +3323,6 @@ import JavaScriptKit @usableFromInline static let onboundary: JSString = "onboundary" @usableFromInline static let onbufferedamountlow: JSString = "onbufferedamountlow" @usableFromInline static let oncancel: JSString = "oncancel" - @usableFromInline static let oncanmakepayment: JSString = "oncanmakepayment" @usableFromInline static let oncanplay: JSString = "oncanplay" @usableFromInline static let oncanplaythrough: JSString = "oncanplaythrough" @usableFromInline static let once: JSString = "once" @@ -3415,12 +3342,10 @@ import JavaScriptKit @usableFromInline static let onconnecting: JSString = "onconnecting" @usableFromInline static let onconnectionavailable: JSString = "onconnectionavailable" @usableFromInline static let onconnectionstatechange: JSString = "onconnectionstatechange" - @usableFromInline static let oncontentdelete: JSString = "oncontentdelete" @usableFromInline static let oncontextlost: JSString = "oncontextlost" @usableFromInline static let oncontextmenu: JSString = "oncontextmenu" @usableFromInline static let oncontextrestored: JSString = "oncontextrestored" @usableFromInline static let oncontrollerchange: JSString = "oncontrollerchange" - @usableFromInline static let oncookiechange: JSString = "oncookiechange" @usableFromInline static let oncopy: JSString = "oncopy" @usableFromInline static let oncuechange: JSString = "oncuechange" @usableFromInline static let oncurrententrychange: JSString = "oncurrententrychange" @@ -3452,7 +3377,6 @@ import JavaScriptKit @usableFromInline static let onenterpictureinpicture: JSString = "onenterpictureinpicture" @usableFromInline static let onerror: JSString = "onerror" @usableFromInline static let onexit: JSString = "onexit" - @usableFromInline static let onfetch: JSString = "onfetch" @usableFromInline static let onfinish: JSString = "onfinish" @usableFromInline static let onfocus: JSString = "onfocus" @usableFromInline static let onformdata: JSString = "onformdata" @@ -3474,7 +3398,6 @@ import JavaScriptKit @usableFromInline static let oninput: JSString = "oninput" @usableFromInline static let oninputreport: JSString = "oninputreport" @usableFromInline static let oninputsourceschange: JSString = "oninputsourceschange" - @usableFromInline static let oninstall: JSString = "oninstall" @usableFromInline static let oninvalid: JSString = "oninvalid" @usableFromInline static let onisolationchange: JSString = "onisolationchange" @usableFromInline static let onkeydown: JSString = "onkeydown" @@ -3514,8 +3437,6 @@ import JavaScriptKit @usableFromInline static let onnavigateto: JSString = "onnavigateto" @usableFromInline static let onnegotiationneeded: JSString = "onnegotiationneeded" @usableFromInline static let onnomatch: JSString = "onnomatch" - @usableFromInline static let onnotificationclick: JSString = "onnotificationclick" - @usableFromInline static let onnotificationclose: JSString = "onnotificationclose" @usableFromInline static let onoffline: JSString = "onoffline" @usableFromInline static let ononline: JSString = "ononline" @usableFromInline static let onopen: JSString = "onopen" @@ -3525,8 +3446,6 @@ import JavaScriptKit @usableFromInline static let onpaste: JSString = "onpaste" @usableFromInline static let onpause: JSString = "onpause" @usableFromInline static let onpaymentmethodchange: JSString = "onpaymentmethodchange" - @usableFromInline static let onpaymentrequest: JSString = "onpaymentrequest" - @usableFromInline static let onperiodicsync: JSString = "onperiodicsync" @usableFromInline static let onplay: JSString = "onplay" @usableFromInline static let onplaying: JSString = "onplaying" @usableFromInline static let onpointercancel: JSString = "onpointercancel" @@ -3545,8 +3464,6 @@ import JavaScriptKit @usableFromInline static let onprioritychange: JSString = "onprioritychange" @usableFromInline static let onprocessorerror: JSString = "onprocessorerror" @usableFromInline static let onprogress: JSString = "onprogress" - @usableFromInline static let onpush: JSString = "onpush" - @usableFromInline static let onpushsubscriptionchange: JSString = "onpushsubscriptionchange" @usableFromInline static let onratechange: JSString = "onratechange" @usableFromInline static let onreading: JSString = "onreading" @usableFromInline static let onreadingerror: JSString = "onreadingerror" @@ -3564,7 +3481,6 @@ import JavaScriptKit @usableFromInline static let onresourcetimingbufferfull: JSString = "onresourcetimingbufferfull" @usableFromInline static let onresult: JSString = "onresult" @usableFromInline static let onresume: JSString = "onresume" - @usableFromInline static let onrtctransform: JSString = "onrtctransform" @usableFromInline static let onscroll: JSString = "onscroll" @usableFromInline static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" @usableFromInline static let onseeked: JSString = "onseeked" @@ -3598,7 +3514,6 @@ import JavaScriptKit @usableFromInline static let onsubmit: JSString = "onsubmit" @usableFromInline static let onsuccess: JSString = "onsuccess" @usableFromInline static let onsuspend: JSString = "onsuspend" - @usableFromInline static let onsync: JSString = "onsync" @usableFromInline static let onterminate: JSString = "onterminate" @usableFromInline static let ontextformatupdate: JSString = "ontextformatupdate" @usableFromInline static let ontextupdate: JSString = "ontextupdate" @@ -3638,7 +3553,6 @@ import JavaScriptKit @usableFromInline static let open: JSString = "open" @usableFromInline static let openCursor: JSString = "openCursor" @usableFromInline static let openKeyCursor: JSString = "openKeyCursor" - @usableFromInline static let openWindow: JSString = "openWindow" @usableFromInline static let opened: JSString = "opened" @usableFromInline static let opener: JSString = "opener" @usableFromInline static let operation: JSString = "operation" @@ -4176,7 +4090,6 @@ import JavaScriptKit @usableFromInline static let resourceId: JSString = "resourceId" @usableFromInline static let resources: JSString = "resources" @usableFromInline static let respond: JSString = "respond" - @usableFromInline static let respondWith: JSString = "respondWith" @usableFromInline static let respondWithNewView: JSString = "respondWithNewView" @usableFromInline static let response: JSString = "response" @usableFromInline static let responseBytesSent: JSString = "responseBytesSent" @@ -4244,7 +4157,6 @@ import JavaScriptKit @usableFromInline static let rp: JSString = "rp" @usableFromInline static let rpId: JSString = "rpId" @usableFromInline static let rssi: JSString = "rssi" - @usableFromInline static let rtcIdentityProvider: JSString = "rtcIdentityProvider" @usableFromInline static let rtcp: JSString = "rtcp" @usableFromInline static let rtcpMuxPolicy: JSString = "rtcpMuxPolicy" @usableFromInline static let rtcpTransportStatsId: JSString = "rtcpTransportStatsId" @@ -4368,7 +4280,6 @@ import JavaScriptKit @usableFromInline static let sendBeacon: JSString = "sendBeacon" @usableFromInline static let sendEncodings: JSString = "sendEncodings" @usableFromInline static let sendFeatureReport: JSString = "sendFeatureReport" - @usableFromInline static let sendKeyFrameRequest: JSString = "sendKeyFrameRequest" @usableFromInline static let sendReport: JSString = "sendReport" @usableFromInline static let sender: JSString = "sender" @usableFromInline static let senderId: JSString = "senderId" @@ -4497,7 +4408,6 @@ import JavaScriptKit @usableFromInline static let skewXSelf: JSString = "skewXSelf" @usableFromInline static let skewY: JSString = "skewY" @usableFromInline static let skewYSelf: JSString = "skewYSelf" - @usableFromInline static let skipWaiting: JSString = "skipWaiting" @usableFromInline static let sliCount: JSString = "sliCount" @usableFromInline static let slice: JSString = "slice" @usableFromInline static let slope: JSString = "slope" @@ -4817,7 +4727,6 @@ import JavaScriptKit @usableFromInline static let transformPoint: JSString = "transformPoint" @usableFromInline static let transformToDocument: JSString = "transformToDocument" @usableFromInline static let transformToFragment: JSString = "transformToFragment" - @usableFromInline static let transformer: JSString = "transformer" @usableFromInline static let transition: JSString = "transition" @usableFromInline static let transitionProperty: JSString = "transitionProperty" @usableFromInline static let transitionWhile: JSString = "transitionWhile" @@ -4919,7 +4828,6 @@ import JavaScriptKit @usableFromInline static let updateTargetFrameRate: JSString = "updateTargetFrameRate" @usableFromInline static let updateText: JSString = "updateText" @usableFromInline static let updateTiming: JSString = "updateTiming" - @usableFromInline static let updateUI: JSString = "updateUI" @usableFromInline static let updateViaCache: JSString = "updateViaCache" @usableFromInline static let updateWith: JSString = "updateWith" @usableFromInline static let updating: JSString = "updating" @@ -5056,7 +4964,6 @@ import JavaScriptKit @usableFromInline static let vw: JSString = "vw" @usableFromInline static let w: JSString = "w" @usableFromInline static let waitSync: JSString = "waitSync" - @usableFromInline static let waitUntil: JSString = "waitUntil" @usableFromInline static let waiting: JSString = "waiting" @usableFromInline static let wakeLock: JSString = "wakeLock" @usableFromInline static let warn: JSString = "warn" diff --git a/Sources/DOMKit/WebIDL/SyncEvent.swift b/Sources/DOMKit/WebIDL/SyncEvent.swift deleted file mode 100644 index a8895339..00000000 --- a/Sources/DOMKit/WebIDL/SyncEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SyncEvent: ExtendableEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SyncEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _tag = ReadonlyAttribute(jsObject: jsObject, name: Strings.tag) - _lastChance = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastChance) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, init: SyncEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) - } - - @ReadonlyAttribute - public var tag: String - - @ReadonlyAttribute - public var lastChance: Bool -} diff --git a/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift b/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift deleted file mode 100644 index 9db54f81..00000000 --- a/Sources/DOMKit/WebIDL/VideoTrackGenerator.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoTrackGenerator: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackGenerator].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _writable = ReadonlyAttribute(jsObject: jsObject, name: Strings.writable) - _muted = ReadWriteAttribute(jsObject: jsObject, name: Strings.muted) - _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @ReadonlyAttribute - public var writable: WritableStream - - @ReadWriteAttribute - public var muted: Bool - - @ReadonlyAttribute - public var track: MediaStreamTrack -} diff --git a/Sources/DOMKit/WebIDL/WindowClient.swift b/Sources/DOMKit/WebIDL/WindowClient.swift deleted file mode 100644 index 4ca9c306..00000000 --- a/Sources/DOMKit/WebIDL/WindowClient.swift +++ /dev/null @@ -1,48 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WindowClient: Client { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WindowClient].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibilityState) - _focused = ReadonlyAttribute(jsObject: jsObject, name: Strings.focused) - _ancestorOrigins = ReadonlyAttribute(jsObject: jsObject, name: Strings.ancestorOrigins) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var visibilityState: DocumentVisibilityState - - @ReadonlyAttribute - public var focused: Bool - - @ReadonlyAttribute - public var ancestorOrigins: [String] - - @inlinable public func focus() -> JSPromise { - let this = jsObject - return this[Strings.focus].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func focus() async throws -> WindowClient { - let this = jsObject - let _promise: JSPromise = this[Strings.focus].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! - } - - @inlinable public func navigate(url: String) -> JSPromise { - let this = jsObject - return this[Strings.navigate].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func navigate(url: String) async throws -> WindowClient? { - let this = jsObject - let _promise: JSPromise = this[Strings.navigate].function!(this: this, arguments: [url.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift deleted file mode 100644 index 5310f997..00000000 --- a/Sources/DOMKit/WebIDL/WorkerGlobalScope.swift +++ /dev/null @@ -1,53 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WorkerGlobalScope: EventTarget, FontFaceSource, WindowOrWorkerGlobalScope { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WorkerGlobalScope].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) - _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) - _navigator = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigator) - _onerror = ClosureAttribute5Optional(jsObject: jsObject, name: Strings.onerror) - _onlanguagechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onlanguagechange) - _onoffline = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onoffline) - _ononline = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ononline) - _onrejectionhandled = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onrejectionhandled) - _onunhandledrejection = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onunhandledrejection) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var `self`: WorkerGlobalScope - - @ReadonlyAttribute - public var location: WorkerLocation - - @ReadonlyAttribute - public var navigator: WorkerNavigator - - @inlinable public func importScripts(urls: String...) { - let this = jsObject - _ = this[Strings.importScripts].function!(this: this, arguments: urls.map { $0.jsValue() }) - } - - @ClosureAttribute5Optional - public var onerror: OnErrorEventHandler - - @ClosureAttribute1Optional - public var onlanguagechange: EventHandler - - @ClosureAttribute1Optional - public var onoffline: EventHandler - - @ClosureAttribute1Optional - public var ononline: EventHandler - - @ClosureAttribute1Optional - public var onrejectionhandled: EventHandler - - @ClosureAttribute1Optional - public var onunhandledrejection: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/WorkerLocation.swift b/Sources/DOMKit/WebIDL/WorkerLocation.swift deleted file mode 100644 index 7bf94015..00000000 --- a/Sources/DOMKit/WebIDL/WorkerLocation.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WorkerLocation: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkerLocation].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadonlyAttribute(jsObject: jsObject, name: Strings.href) - _origin = ReadonlyAttribute(jsObject: jsObject, name: Strings.origin) - _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) - _host = ReadonlyAttribute(jsObject: jsObject, name: Strings.host) - _hostname = ReadonlyAttribute(jsObject: jsObject, name: Strings.hostname) - _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) - _pathname = ReadonlyAttribute(jsObject: jsObject, name: Strings.pathname) - _search = ReadonlyAttribute(jsObject: jsObject, name: Strings.search) - _hash = ReadonlyAttribute(jsObject: jsObject, name: Strings.hash) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var href: String - - @ReadonlyAttribute - public var origin: String - - @ReadonlyAttribute - public var `protocol`: String - - @ReadonlyAttribute - public var host: String - - @ReadonlyAttribute - public var hostname: String - - @ReadonlyAttribute - public var port: String - - @ReadonlyAttribute - public var pathname: String - - @ReadonlyAttribute - public var search: String - - @ReadonlyAttribute - public var hash: String -} diff --git a/Sources/DOMKit/WebIDL/WorkerNavigator.swift b/Sources/DOMKit/WebIDL/WorkerNavigator.swift deleted file mode 100644 index 144d93e8..00000000 --- a/Sources/DOMKit/WebIDL/WorkerNavigator.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WorkerNavigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware, NavigatorNetworkInformation, NavigatorStorage, NavigatorUA, NavigatorLocks, NavigatorGPU, NavigatorML { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkerNavigator].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) - _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) - _serial = ReadonlyAttribute(jsObject: jsObject, name: Strings.serial) - _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) - _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var mediaCapabilities: MediaCapabilities - - @ReadonlyAttribute - public var permissions: Permissions - - @ReadonlyAttribute - public var serial: Serial - - @ReadonlyAttribute - public var serviceWorker: ServiceWorkerContainer - - @ReadonlyAttribute - public var usb: USB -} diff --git a/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift b/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift deleted file mode 100644 index 5d747d00..00000000 --- a/Sources/DOMKit/WebIDL/WorkletAnimationEffect.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WorkletAnimationEffect: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkletAnimationEffect].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _localTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.localTime) - self.jsObject = jsObject - } - - @inlinable public func getTiming() -> EffectTiming { - let this = jsObject - return this[Strings.getTiming].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getComputedTiming() -> ComputedEffectTiming { - let this = jsObject - return this[Strings.getComputedTiming].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadWriteAttribute - public var localTime: Double? -} diff --git a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift b/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift deleted file mode 100644 index 20f211bb..00000000 --- a/Sources/DOMKit/WebIDL/WorkletGlobalScope.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WorkletGlobalScope: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkletGlobalScope].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift b/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift deleted file mode 100644 index 2406c270..00000000 --- a/Sources/DOMKit/WebIDL/WorkletGroupEffect.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WorkletGroupEffect: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WorkletGroupEffect].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func getChildren() -> [WorkletAnimationEffect] { - let this = jsObject - return this[Strings.getChildren].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/WebIDL/ExtendedAttribute.swift b/Sources/WebIDL/ExtendedAttribute.swift index ea1c1f0a..00b75b78 100644 --- a/Sources/WebIDL/ExtendedAttribute.swift +++ b/Sources/WebIDL/ExtendedAttribute.swift @@ -4,7 +4,7 @@ public struct IDLExtendedAttribute: Decodable, IDLNamed { public let arguments: [IDLArgument] public let rhs: RHS? - public enum RHS: Decodable { + public enum RHS: Decodable, Equatable { case identifier(String) case identifierList([String]) case string(String) @@ -24,6 +24,17 @@ public struct IDLExtendedAttribute: Decodable, IDLNamed { let value: String } + public var identifiers: [String]? { + switch self { + case let .identifier(identifier): + return [identifier] + case let .identifierList(identifiers): + return identifiers + default: + return nil + } + } + public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let type = try container.decode(String.self, forKey: .type) diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 6f4e077b..4614fbce 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -2,6 +2,7 @@ import WebIDL enum DeclarationMerger { static let ignoredTypedefs: Set = ["Function"] + static let validExposures: Set = ["Window"] private static func addAsync(_ members: [IDLNode]) -> [IDLNode] { members.flatMap { member -> [IDLNode] in @@ -65,7 +66,13 @@ enum DeclarationMerger { MergedInterface( name: $0.name, parentClasses: [$0.inheritance].compactMap { $0 }, - members: addAsync($0.members.array) as! [IDLInterfaceMember] + members: addAsync($0.members.array) as! [IDLInterfaceMember], + exposed: Set( + $0.extAttrs + .filter { $0.name == "Exposed" } + .flatMap { $0.rhs?.identifiers ?? [] } + ), + exposedToAll: $0.extAttrs.contains { $0.name == "Exposed" && $0.rhs == .wildcard } ) }, by: \.name @@ -73,13 +80,15 @@ enum DeclarationMerger { var interface = toMerge.dropFirst().reduce(into: toMerge.first!) { partialResult, interface in partialResult.parentClasses += interface.parentClasses partialResult.members += interface.members + partialResult.exposed.formUnion(interface.exposed) + partialResult.exposedToAll = partialResult.exposedToAll || interface.exposedToAll } interface.mixins = includes[interface.name, default: []] if let decl = interface.members.first(where: { $0 is IDLIterableDeclaration }) as? IDLIterableDeclaration { interface.mixins.append(decl.async ? "AsyncSequence" : "Sequence") } return interface - } + }.filter { $0.value.exposedToAll || $0.value.exposed.contains(where: validExposures.contains) } let mergedDictionaries = Dictionary( grouping: all(IDLDictionary.self).map { @@ -179,6 +188,8 @@ struct MergedInterface: DeclarationFile { var parentClasses: [String] var mixins: [String] = [] var members: [IDLInterfaceMember] + var exposed: Set + var exposedToAll: Bool } struct Typedefs: DeclarationFile, SwiftRepresentable { From b79a328a7eb8353f196cb6428aa04c12fdce9d0d Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 16:03:01 -0400 Subject: [PATCH 106/124] Initial union support --- .../WebIDL/AllowedBluetoothDevice.swift | 4 +- Sources/DOMKit/WebIDL/Animatable.swift | 2 +- ...tionEffect_or_seq_of_AnimationEffect.swift | 32 ++++ ...ayBufferView_or_MLBufferResourceView.swift | 32 ++++ .../WebIDL/ArrayBufferView_or_Void.swift | 32 ++++ .../ArrayBuffer_or_ArrayBufferView.swift | 32 ++++ .../DOMKit/WebIDL/ArrayBuffer_or_String.swift | 32 ++++ ...udioContextLatencyCategory_or_Double.swift | 32 ++++ .../DOMKit/WebIDL/AudioContextOptions.swift | 4 +- ...udioTrack_or_TextTrack_or_VideoTrack.swift | 39 ++++ .../DOMKit/WebIDL/AutoKeyword_or_Double.swift | 32 ++++ .../WebIDL/BackgroundFetchManager.swift | 4 +- .../WebIDL/BasePropertyIndexedKeyframe.swift | 8 +- ...y_or_Uint8Array_or_Uint8ClampedArray.swift | 102 ++++++++++ .../DOMKit/WebIDL/BinaryData_or_String.swift | 32 ++++ ...ormData_or_String_or_URLSearchParams.swift | 53 +++++ .../Blob_or_BufferSource_or_String.swift | 39 ++++ ...ufferSource_or_String_or_WriteParams.swift | 46 +++++ ...ob_or_CanvasImageSource_or_ImageData.swift | 39 ++++ .../DOMKit/WebIDL/Blob_or_MediaSource.swift | 32 ++++ .../Blob_or_MediaSource_or_MediaStream.swift | 39 ++++ .../BluetoothAdvertisingEventInit.swift | 4 +- Sources/DOMKit/WebIDL/BluetoothUUID.swift | 6 +- .../Bool_or_ConstrainBooleanParameters.swift | 32 ++++ .../WebIDL/Bool_or_ConstrainDouble.swift | 32 ++++ .../Bool_or_MediaTrackConstraints.swift | 32 ++++ .../Bool_or_ScrollIntoViewOptions.swift | 32 ++++ Sources/DOMKit/WebIDL/BreakTokenOptions.swift | 25 --- .../WebIDL/BufferSource_or_JsonWebKey.swift | 32 ++++ ...rSource_or_NDEFMessageInit_or_String.swift | 39 ++++ .../BufferSource_or_ReadableStream.swift | 32 ++++ .../WebIDL/BufferSource_or_String.swift | 32 ++++ Sources/DOMKit/WebIDL/CSSColorValue.swift | 2 +- .../CSSColorValue_or_CSSStyleValue.swift | 32 ++++ .../WebIDL/CSSFontFeatureValuesMap.swift | 2 +- .../WebIDL/CSSKeywordValue_or_String.swift | 32 ++++ .../CSSKeywordish_or_CSSNumberish.swift | 32 ++++ .../CSSKeywordish_or_CSSNumericValue.swift | 32 ++++ .../WebIDL/CSSNumericValue_or_Double.swift | 32 ++++ .../CSSNumericValue_or_Double_or_String.swift | 39 ++++ ...rserValue_or_CSSStyleValue_or_String.swift | 39 ++++ Sources/DOMKit/WebIDL/CSSPseudoElement.swift | 2 +- ...ement_or_Document_or_Element_or_Text.swift | 46 +++++ .../WebIDL/CSSPseudoElement_or_Element.swift | 32 ++++ Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift | 4 +- .../WebIDL/CSSStyleValue_or_String.swift | 32 ++++ .../CSSVariableReferenceValue_or_String.swift | 32 ++++ Sources/DOMKit/WebIDL/Cache.swift | 2 +- Sources/DOMKit/WebIDL/CacheStorage.swift | 2 +- .../WebIDL/CanvasFillStrokeStyles.swift | 4 +- Sources/DOMKit/WebIDL/CanvasFilter.swift | 2 +- ...terInput_or_seq_of_CanvasFilterInput.swift | 32 ++++ .../WebIDL/CanvasFilter_or_String.swift | 32 ++++ Sources/DOMKit/WebIDL/CanvasFilters.swift | 2 +- ...sGradient_or_CanvasPattern_or_String.swift | 39 ++++ Sources/DOMKit/WebIDL/CanvasPath.swift | 2 +- ...ringContext_or_WebGLRenderingContext.swift | 53 +++++ Sources/DOMKit/WebIDL/ChildNode.swift | 6 +- ...o_or_seq_of_CompositeOperationOrAuto.swift | 32 ++++ .../WebIDL/ConstrainDOMStringParameters.swift | 6 +- ...arameters_or_String_or_seq_of_String.swift | 39 ++++ .../ConstrainDoubleRange_or_Double.swift | 32 ++++ ...nPoint2DParameters_or_seq_of_Point2D.swift | 32 ++++ .../ConstrainULongRange_or_UInt32.swift | 32 ++++ ...nerBasedOffset_or_ElementBasedOffset.swift | 32 ++++ .../CustomElementConstructor_or_Void.swift | 32 ++++ .../DOMKit/WebIDL/CustomElementRegistry.swift | 2 +- .../DOMHighResTimeStamp_or_String.swift | 32 ++++ Sources/DOMKit/WebIDL/DOMMatrix.swift | 2 +- Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 2 +- ...trix_or_Float32Array_or_Float64Array.swift | 39 ++++ .../WebIDL/DOMPointInit_or_Double.swift | 32 ++++ ...ble_or_seq_of_DOMPointInit_or_Double.swift | 39 ++++ .../DisplayMediaStreamConstraints.swift | 6 +- Sources/DOMKit/WebIDL/Document.swift | 4 +- .../WebIDL/Document_or_DocumentFragment.swift | 32 ++++ .../DOMKit/WebIDL/Document_or_Element.swift | 32 ++++ .../Document_or_XMLHttpRequestBodyInit.swift | 32 ++++ .../WebIDL/Double_or_EffectTiming.swift | 32 ++++ .../Double_or_KeyframeAnimationOptions.swift | 32 ++++ .../Double_or_KeyframeEffectOptions.swift | 32 ++++ Sources/DOMKit/WebIDL/Double_or_String.swift | 32 ++++ .../WebIDL/Double_or_seq_of_Double.swift | 32 ++++ Sources/DOMKit/WebIDL/EffectTiming.swift | 4 +- Sources/DOMKit/WebIDL/Element.swift | 2 +- .../ElementCreationOptions_or_String.swift | 32 ++++ Sources/DOMKit/WebIDL/ElementInternals.swift | 2 +- .../WebIDL/Element_or_HTMLCollection.swift | 32 ++++ .../Element_or_ProcessingInstruction.swift | 32 ++++ .../WebIDL/Element_or_RadioNodeList.swift | 32 ++++ Sources/DOMKit/WebIDL/Element_or_Text.swift | 32 ++++ Sources/DOMKit/WebIDL/Event_or_String.swift | 32 ++++ Sources/DOMKit/WebIDL/Event_or_Void.swift | 32 ++++ .../WebIDL/ExtendableMessageEventInit.swift | 40 ---- .../DOMKit/WebIDL/FilePickerAcceptType.swift | 4 +- Sources/DOMKit/WebIDL/FileReader.swift | 2 +- ...leSystemHandle_or_WellKnownDirectory.swift | 32 ++++ .../WebIDL/File_or_FormData_or_String.swift | 39 ++++ Sources/DOMKit/WebIDL/File_or_String.swift | 32 ++++ .../Float32Array_or_seq_of_GLfloat.swift | 32 ++++ Sources/DOMKit/WebIDL/FontFace.swift | 2 +- .../DOMKit/WebIDL/FragmentResultOptions.swift | 45 ----- ...ture_or_GPUSampler_or_GPUTextureView.swift | 46 +++++ .../WebIDL/GPUBuffer_or_WebGLBuffer.swift | 32 ++++ Sources/DOMKit/WebIDL/GPUCanvasContext.swift | 2 +- ...ringContext_or_WebGLRenderingContext.swift | 53 +++++ .../GPUColorDict_or_seq_of_Double.swift | 32 ++++ Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift | 2 +- .../WebIDL/GPUDeviceLostReason_or_Void.swift | 32 ++++ ...DDict_or_seq_of_GPUIntegerCoordinate.swift | 32 ++++ .../WebIDL/GPUImageCopyExternalImage.swift | 4 +- Sources/DOMKit/WebIDL/GPUObjectBase.swift | 2 +- ...DDict_or_seq_of_GPUIntegerCoordinate.swift | 32 ++++ ...DDict_or_seq_of_GPUIntegerCoordinate.swift | 32 ++++ ...tOfMemoryError_or_GPUValidationError.swift | 32 ++++ ...ture_or_MLBufferView_or_WebGLTexture.swift | 39 ++++ Sources/DOMKit/WebIDL/GroupEffect.swift | 2 +- Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 4 +- ...ata_or_OffscreenCanvas_or_VideoFrame.swift | 67 +++++++ ...map_or_OffscreenCanvas_or_VideoFrame.swift | 60 ++++++ ...nt_or_ImageBitmap_or_OffscreenCanvas.swift | 39 ++++ ...HTMLCanvasElement_or_OffscreenCanvas.swift | 32 ++++ .../DOMKit/WebIDL/HTMLElement_or_Int32.swift | 32 ++++ .../WebIDL/HTMLFormControlsCollection.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFormElement.swift | 2 +- ...ormElement_or_PasswordCredentialData.swift | 32 ++++ .../HTMLImageElement_or_SVGImageElement.swift | 32 ++++ ...OptGroupElement_or_HTMLOptionElement.swift | 32 ++++ .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 2 +- ...TMLScriptElement_or_SVGScriptElement.swift | 32 ++++ Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 2 +- Sources/DOMKit/WebIDL/IDBCursor.swift | 2 +- ...Cursor_or_IDBIndex_or_IDBObjectStore.swift | 39 ++++ Sources/DOMKit/WebIDL/IDBDatabase.swift | 2 +- .../WebIDL/IDBIndex_or_IDBObjectStore.swift | 32 ++++ Sources/DOMKit/WebIDL/IDBObjectStore.swift | 2 +- .../WebIDL/IDBObjectStoreParameters.swift | 4 +- Sources/DOMKit/WebIDL/IDBRequest.swift | 2 +- .../WebIDL/ImageBitmapRenderingContext.swift | 2 +- .../WebIDL/Int32Array_or_seq_of_GLint.swift | 32 ++++ .../WebIDL/Int32Array_or_seq_of_GLsizei.swift | 32 ++++ .../DOMKit/WebIDL/IntersectionObserver.swift | 2 +- .../WebIDL/IntersectionObserverInit.swift | 6 +- .../DOMKit/WebIDL/JSFunction_or_String.swift | 32 ++++ .../DOMKit/WebIDL/JSObject_or_String.swift | 32 ++++ Sources/DOMKit/WebIDL/KeyframeEffect.swift | 2 +- .../DOMKit/WebIDL/MLBufferResourceView.swift | 4 +- Sources/DOMKit/WebIDL/MLGraphBuilder.swift | 2 +- .../DOMKit/WebIDL/MLInput_or_MLResource.swift | 32 ++++ Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift | 2 +- .../WebIDL/MediaKeyStatus_or_Void.swift | 32 ++++ .../DOMKit/WebIDL/MediaList_or_String.swift | 32 ++++ .../WebIDL/MediaStreamConstraints.swift | 6 +- .../WebIDL/MediaStreamTrack_or_String.swift | 32 ++++ .../WebIDL/MediaTrackConstraintSet.swift | 8 +- ...Port_or_ServiceWorker_or_WindowProxy.swift | 39 ++++ Sources/DOMKit/WebIDL/Node_or_String.swift | 32 ++++ .../DOMKit/WebIDL/OptionalEffectTiming.swift | 4 +- Sources/DOMKit/WebIDL/ParentNode.swift | 6 +- Sources/DOMKit/WebIDL/Path2D.swift | 2 +- Sources/DOMKit/WebIDL/Path2D_or_String.swift | 32 ++++ Sources/DOMKit/WebIDL/Performance.swift | 2 +- .../WebIDL/PerformanceMeasureOptions.swift | 6 +- .../PerformanceMeasureOptions_or_String.swift | 32 ++++ .../WebIDL/PushSubscriptionOptionsInit.swift | 4 +- Sources/DOMKit/WebIDL/RTCIceServer.swift | 4 +- Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 2 +- ...tpScriptTransform_or_SFrameTransform.swift | 32 ++++ ...r_or_ReadableStreamDefaultController.swift | 32 ++++ .../WebIDL/ReadableStreamBYOBReadResult.swift | 4 +- ...eader_or_ReadableStreamDefaultReader.swift | 32 ++++ .../WebIDL/ReadableStream_or_String.swift | 32 ++++ ...ableStream_or_XMLHttpRequestBodyInit.swift | 32 ++++ .../RequestInfo_or_seq_of_RequestInfo.swift | 32 ++++ Sources/DOMKit/WebIDL/Request_or_String.swift | 32 ++++ Sources/DOMKit/WebIDL/Response_or_Void.swift | 32 ++++ Sources/DOMKit/WebIDL/Sanitizer.swift | 2 +- Sources/DOMKit/WebIDL/SequenceEffect.swift | 2 +- .../WebIDL/ServiceWorkerContainer.swift | 2 +- .../ServiceWorkerRegistration_or_Void.swift | 32 ++++ Sources/DOMKit/WebIDL/ShadowAnimation.swift | 2 +- Sources/DOMKit/WebIDL/SharedWorker.swift | 2 +- ...ryptoKeyID_or___UNSUPPORTED_BIGINT__.swift | 32 ++++ Sources/DOMKit/WebIDL/String_or_UInt32.swift | 32 ++++ .../WebIDL/String_or_URLPatternInit.swift | 32 ++++ Sources/DOMKit/WebIDL/String_or_Void.swift | 32 ++++ .../WebIDL/String_or_WorkerOptions.swift | 32 ++++ ...ng_to_String_or_seq_of_seq_of_String.swift | 39 ++++ .../WebIDL/String_or_seq_of_Double.swift | 32 ++++ .../WebIDL/String_or_seq_of_String.swift | 32 ++++ .../DOMKit/WebIDL/String_or_seq_of_UUID.swift | 32 ++++ Sources/DOMKit/WebIDL/Strings.swift | 4 - Sources/DOMKit/WebIDL/StylePropertyMap.swift | 4 +- Sources/DOMKit/WebIDL/StyleSheet.swift | 2 +- Sources/DOMKit/WebIDL/SubtleCrypto.swift | 4 +- Sources/DOMKit/WebIDL/TrackEvent.swift | 2 +- Sources/DOMKit/WebIDL/TrackEventInit.swift | 4 +- ...or_TrustedScript_or_TrustedScriptURL.swift | 39 ++++ Sources/DOMKit/WebIDL/Typedefs.swift | 143 +++++++------- .../WebIDL/UInt32_or_seq_of_UInt32.swift | 32 ++++ Sources/DOMKit/WebIDL/URL.swift | 2 +- .../WebIDL/URLPatternComponentResult.swift | 4 +- Sources/DOMKit/WebIDL/URLSearchParams.swift | 2 +- .../WebIDL/Uint32Array_or_seq_of_GLuint.swift | 32 ++++ Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift | 8 +- ..._instanced_base_vertex_base_instance.swift | 4 +- ...ringContext_or_WebGLRenderingContext.swift | 32 ++++ .../WebIDL/WebGLRenderingContextBase.swift | 2 +- Sources/DOMKit/WebIDL/WebSocket.swift | 4 +- Sources/DOMKit/WebIDL/Window.swift | 2 +- Sources/DOMKit/WebIDL/WorkletAnimation.swift | 2 +- Sources/DOMKit/WebIDL/WriteParams.swift | 4 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 2 +- ...ble_Double_or_seq_of_nullable_Double.swift | 32 ++++ ...ng_to_String_or_seq_of_seq_of_String.swift | 32 ++++ Sources/WebIDL/Argument.swift | 2 +- Sources/WebIDL/ExtendedAttribute.swift | 4 +- Sources/WebIDL/Type.swift | 4 +- Sources/WebIDL/Value.swift | 2 +- Sources/WebIDLToSwift/Context.swift | 3 + Sources/WebIDLToSwift/IDLBuilder.swift | 16 +- Sources/WebIDLToSwift/MergeDeclarations.swift | 2 +- Sources/WebIDLToSwift/UnionProtocol.swift | 181 ++++++++++++++++++ Sources/WebIDLToSwift/UnionType.swift | 84 ++++++++ .../WebIDL+SwiftRepresentation.swift | 8 +- Sources/WebIDLToSwift/main.swift | 2 + 227 files changed, 4898 insertions(+), 331 deletions(-) create mode 100644 Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift create mode 100644 Sources/DOMKit/WebIDL/ArrayBufferView_or_MLBufferResourceView.swift create mode 100644 Sources/DOMKit/WebIDL/ArrayBufferView_or_Void.swift create mode 100644 Sources/DOMKit/WebIDL/ArrayBuffer_or_ArrayBufferView.swift create mode 100644 Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift create mode 100644 Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift create mode 100644 Sources/DOMKit/WebIDL/AutoKeyword_or_Double.swift create mode 100644 Sources/DOMKit/WebIDL/BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray.swift create mode 100644 Sources/DOMKit/WebIDL/BinaryData_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams.swift create mode 100644 Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String_or_WriteParams.swift create mode 100644 Sources/DOMKit/WebIDL/Blob_or_CanvasImageSource_or_ImageData.swift create mode 100644 Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift create mode 100644 Sources/DOMKit/WebIDL/Blob_or_MediaSource_or_MediaStream.swift create mode 100644 Sources/DOMKit/WebIDL/Bool_or_ConstrainBooleanParameters.swift create mode 100644 Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift create mode 100644 Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift create mode 100644 Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/BreakTokenOptions.swift create mode 100644 Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift create mode 100644 Sources/DOMKit/WebIDL/BufferSource_or_NDEFMessageInit_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/BufferSource_or_ReadableStream.swift create mode 100644 Sources/DOMKit/WebIDL/BufferSource_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/CSSColorValue_or_CSSStyleValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSKeywordValue_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumberish.swift create mode 100644 Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumericValue.swift create mode 100644 Sources/DOMKit/WebIDL/CSSNumericValue_or_Double.swift create mode 100644 Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/CSSParserValue_or_CSSStyleValue_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/CSSPseudoElement_or_Document_or_Element_or_Text.swift create mode 100644 Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift create mode 100644 Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/CSSVariableReferenceValue_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift create mode 100644 Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift create mode 100644 Sources/DOMKit/WebIDL/ConstrainDOMStringParameters_or_String_or_seq_of_String.swift create mode 100644 Sources/DOMKit/WebIDL/ConstrainDoubleRange_or_Double.swift create mode 100644 Sources/DOMKit/WebIDL/ConstrainPoint2DParameters_or_seq_of_Point2D.swift create mode 100644 Sources/DOMKit/WebIDL/ConstrainULongRange_or_UInt32.swift create mode 100644 Sources/DOMKit/WebIDL/ContainerBasedOffset_or_ElementBasedOffset.swift create mode 100644 Sources/DOMKit/WebIDL/CustomElementConstructor_or_Void.swift create mode 100644 Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/DOMMatrix_or_Float32Array_or_Float64Array.swift create mode 100644 Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift create mode 100644 Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift create mode 100644 Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift create mode 100644 Sources/DOMKit/WebIDL/Document_or_Element.swift create mode 100644 Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift create mode 100644 Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift create mode 100644 Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift create mode 100644 Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift create mode 100644 Sources/DOMKit/WebIDL/Double_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift create mode 100644 Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift create mode 100644 Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift create mode 100644 Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift create mode 100644 Sources/DOMKit/WebIDL/Element_or_Text.swift create mode 100644 Sources/DOMKit/WebIDL/Event_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/Event_or_Void.swift delete mode 100644 Sources/DOMKit/WebIDL/ExtendableMessageEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/FileSystemHandle_or_WellKnownDirectory.swift create mode 100644 Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/File_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/Float32Array_or_seq_of_GLfloat.swift delete mode 100644 Sources/DOMKit/WebIDL/FragmentResultOptions.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView.swift create mode 100644 Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift create mode 100644 Sources/DOMKit/WebIDL/GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift create mode 100644 Sources/DOMKit/WebIDL/GPUColorDict_or_seq_of_Double.swift create mode 100644 Sources/DOMKit/WebIDL/GPUDeviceLostReason_or_Void.swift create mode 100644 Sources/DOMKit/WebIDL/GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate.swift create mode 100644 Sources/DOMKit/WebIDL/GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate.swift create mode 100644 Sources/DOMKit/WebIDL/GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate.swift create mode 100644 Sources/DOMKit/WebIDL/GPUOutOfMemoryError_or_GPUValidationError.swift create mode 100644 Sources/DOMKit/WebIDL/GPUTexture_or_MLBufferView_or_WebGLTexture.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLFormElement_or_PasswordCredentialData.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLImageElement_or_SVGImageElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift create mode 100644 Sources/DOMKit/WebIDL/HTMLScriptElement_or_SVGScriptElement.swift create mode 100644 Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift create mode 100644 Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift create mode 100644 Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLint.swift create mode 100644 Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift create mode 100644 Sources/DOMKit/WebIDL/JSFunction_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/JSObject_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift create mode 100644 Sources/DOMKit/WebIDL/MediaKeyStatus_or_Void.swift create mode 100644 Sources/DOMKit/WebIDL/MediaList_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/MessagePort_or_ServiceWorker_or_WindowProxy.swift create mode 100644 Sources/DOMKit/WebIDL/Node_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/Path2D_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/RTCRtpScriptTransform_or_SFrameTransform.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableByteStreamController_or_ReadableStreamDefaultController.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStreamBYOBReader_or_ReadableStreamDefaultReader.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStream_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/ReadableStream_or_XMLHttpRequestBodyInit.swift create mode 100644 Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift create mode 100644 Sources/DOMKit/WebIDL/Request_or_String.swift create mode 100644 Sources/DOMKit/WebIDL/Response_or_Void.swift create mode 100644 Sources/DOMKit/WebIDL/ServiceWorkerRegistration_or_Void.swift create mode 100644 Sources/DOMKit/WebIDL/SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__.swift create mode 100644 Sources/DOMKit/WebIDL/String_or_UInt32.swift create mode 100644 Sources/DOMKit/WebIDL/String_or_URLPatternInit.swift create mode 100644 Sources/DOMKit/WebIDL/String_or_Void.swift create mode 100644 Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift create mode 100644 Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift create mode 100644 Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift create mode 100644 Sources/DOMKit/WebIDL/String_or_seq_of_String.swift create mode 100644 Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift create mode 100644 Sources/DOMKit/WebIDL/TrustedHTML_or_TrustedScript_or_TrustedScriptURL.swift create mode 100644 Sources/DOMKit/WebIDL/UInt32_or_seq_of_UInt32.swift create mode 100644 Sources/DOMKit/WebIDL/Uint32Array_or_seq_of_GLuint.swift create mode 100644 Sources/DOMKit/WebIDL/WebGL2RenderingContext_or_WebGLRenderingContext.swift create mode 100644 Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift create mode 100644 Sources/DOMKit/WebIDL/record_String_to_String_or_seq_of_seq_of_String.swift create mode 100644 Sources/WebIDLToSwift/UnionProtocol.swift create mode 100644 Sources/WebIDLToSwift/UnionType.swift diff --git a/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift b/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift index 6b9d863a..eadd865a 100644 --- a/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift +++ b/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AllowedBluetoothDevice: BridgedDictionary { - public convenience init(deviceId: String, mayUseGATT: Bool, allowedServices: __UNSUPPORTED_UNION__, allowedManufacturerData: [UInt16]) { + public convenience init(deviceId: String, mayUseGATT: Bool, allowedServices: String_or_seq_of_UUID, allowedManufacturerData: [UInt16]) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.deviceId] = deviceId.jsValue() object[Strings.mayUseGATT] = mayUseGATT.jsValue() @@ -28,7 +28,7 @@ public class AllowedBluetoothDevice: BridgedDictionary { public var mayUseGATT: Bool @ReadWriteAttribute - public var allowedServices: __UNSUPPORTED_UNION__ + public var allowedServices: String_or_seq_of_UUID @ReadWriteAttribute public var allowedManufacturerData: [UInt16] diff --git a/Sources/DOMKit/WebIDL/Animatable.swift b/Sources/DOMKit/WebIDL/Animatable.swift index 6b638675..6656901d 100644 --- a/Sources/DOMKit/WebIDL/Animatable.swift +++ b/Sources/DOMKit/WebIDL/Animatable.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol Animatable: JSBridgedClass {} public extension Animatable { - @inlinable func animate(keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) -> Animation { + @inlinable func animate(keyframes: JSObject?, options: Double_or_KeyframeAnimationOptions? = nil) -> Animation { let this = jsObject return this[Strings.animate].function!(this: this, arguments: [keyframes.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift new file mode 100644 index 00000000..799ce34a --- /dev/null +++ b/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_AnimationEffect_or_seq_of_AnimationEffect: ConvertibleToJSValue {} +extension AnimationEffect: Any_AnimationEffect_or_seq_of_AnimationEffect {} +extension Array: Any_AnimationEffect_or_seq_of_AnimationEffect where Element == AnimationEffect {} + +public enum AnimationEffect_or_seq_of_AnimationEffect: JSValueCompatible, Any_AnimationEffect_or_seq_of_AnimationEffect { + case animationEffect(AnimationEffect) + case seq_of_AnimationEffect([AnimationEffect]) + + public static func construct(from value: JSValue) -> Self? { + if let animationEffect: AnimationEffect = value.fromJSValue() { + return .animationEffect(animationEffect) + } + if let seq_of_AnimationEffect: [AnimationEffect] = value.fromJSValue() { + return .seq_of_AnimationEffect(seq_of_AnimationEffect) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .animationEffect(animationEffect): + return animationEffect.jsValue() + case let .seq_of_AnimationEffect(seq_of_AnimationEffect): + return seq_of_AnimationEffect.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ArrayBufferView_or_MLBufferResourceView.swift b/Sources/DOMKit/WebIDL/ArrayBufferView_or_MLBufferResourceView.swift new file mode 100644 index 00000000..7e89d9b3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ArrayBufferView_or_MLBufferResourceView.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ArrayBufferView_or_MLBufferResourceView: ConvertibleToJSValue {} +extension ArrayBufferView: Any_ArrayBufferView_or_MLBufferResourceView {} +extension MLBufferResourceView: Any_ArrayBufferView_or_MLBufferResourceView {} + +public enum ArrayBufferView_or_MLBufferResourceView: JSValueCompatible, Any_ArrayBufferView_or_MLBufferResourceView { + case arrayBufferView(ArrayBufferView) + case mLBufferResourceView(MLBufferResourceView) + + public static func construct(from value: JSValue) -> Self? { + if let arrayBufferView: ArrayBufferView = value.fromJSValue() { + return .arrayBufferView(arrayBufferView) + } + if let mLBufferResourceView: MLBufferResourceView = value.fromJSValue() { + return .mLBufferResourceView(mLBufferResourceView) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .arrayBufferView(arrayBufferView): + return arrayBufferView.jsValue() + case let .mLBufferResourceView(mLBufferResourceView): + return mLBufferResourceView.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ArrayBufferView_or_Void.swift b/Sources/DOMKit/WebIDL/ArrayBufferView_or_Void.swift new file mode 100644 index 00000000..6e5fccba --- /dev/null +++ b/Sources/DOMKit/WebIDL/ArrayBufferView_or_Void.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ArrayBufferView_or_Void: ConvertibleToJSValue {} +extension ArrayBufferView: Any_ArrayBufferView_or_Void {} +extension Void: Any_ArrayBufferView_or_Void {} + +public enum ArrayBufferView_or_Void: JSValueCompatible, Any_ArrayBufferView_or_Void { + case arrayBufferView(ArrayBufferView) + case void(Void) + + public static func construct(from value: JSValue) -> Self? { + if let arrayBufferView: ArrayBufferView = value.fromJSValue() { + return .arrayBufferView(arrayBufferView) + } + if let void: Void = value.fromJSValue() { + return .void(void) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .arrayBufferView(arrayBufferView): + return arrayBufferView.jsValue() + case let .void(void): + return void.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ArrayBuffer_or_ArrayBufferView.swift b/Sources/DOMKit/WebIDL/ArrayBuffer_or_ArrayBufferView.swift new file mode 100644 index 00000000..4910b406 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ArrayBuffer_or_ArrayBufferView.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ArrayBuffer_or_ArrayBufferView: ConvertibleToJSValue {} +extension ArrayBuffer: Any_ArrayBuffer_or_ArrayBufferView {} +extension ArrayBufferView: Any_ArrayBuffer_or_ArrayBufferView {} + +public enum ArrayBuffer_or_ArrayBufferView: JSValueCompatible, Any_ArrayBuffer_or_ArrayBufferView { + case arrayBuffer(ArrayBuffer) + case arrayBufferView(ArrayBufferView) + + public static func construct(from value: JSValue) -> Self? { + if let arrayBuffer: ArrayBuffer = value.fromJSValue() { + return .arrayBuffer(arrayBuffer) + } + if let arrayBufferView: ArrayBufferView = value.fromJSValue() { + return .arrayBufferView(arrayBufferView) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .arrayBuffer(arrayBuffer): + return arrayBuffer.jsValue() + case let .arrayBufferView(arrayBufferView): + return arrayBufferView.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift b/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift new file mode 100644 index 00000000..887ef7f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ArrayBuffer_or_String: ConvertibleToJSValue {} +extension ArrayBuffer: Any_ArrayBuffer_or_String {} +extension String: Any_ArrayBuffer_or_String {} + +public enum ArrayBuffer_or_String: JSValueCompatible, Any_ArrayBuffer_or_String { + case arrayBuffer(ArrayBuffer) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let arrayBuffer: ArrayBuffer = value.fromJSValue() { + return .arrayBuffer(arrayBuffer) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .arrayBuffer(arrayBuffer): + return arrayBuffer.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift new file mode 100644 index 00000000..ef209adc --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_AudioContextLatencyCategory_or_Double: ConvertibleToJSValue {} +extension AudioContextLatencyCategory: Any_AudioContextLatencyCategory_or_Double {} +extension Double: Any_AudioContextLatencyCategory_or_Double {} + +public enum AudioContextLatencyCategory_or_Double: JSValueCompatible, Any_AudioContextLatencyCategory_or_Double { + case audioContextLatencyCategory(AudioContextLatencyCategory) + case double(Double) + + public static func construct(from value: JSValue) -> Self? { + if let audioContextLatencyCategory: AudioContextLatencyCategory = value.fromJSValue() { + return .audioContextLatencyCategory(audioContextLatencyCategory) + } + if let double: Double = value.fromJSValue() { + return .double(double) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .audioContextLatencyCategory(audioContextLatencyCategory): + return audioContextLatencyCategory.jsValue() + case let .double(double): + return double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/AudioContextOptions.swift b/Sources/DOMKit/WebIDL/AudioContextOptions.swift index b63c4ec2..d5fbc58b 100644 --- a/Sources/DOMKit/WebIDL/AudioContextOptions.swift +++ b/Sources/DOMKit/WebIDL/AudioContextOptions.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class AudioContextOptions: BridgedDictionary { - public convenience init(latencyHint: __UNSUPPORTED_UNION__, sampleRate: Float) { + public convenience init(latencyHint: AudioContextLatencyCategory_or_Double, sampleRate: Float) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.latencyHint] = latencyHint.jsValue() object[Strings.sampleRate] = sampleRate.jsValue() @@ -18,7 +18,7 @@ public class AudioContextOptions: BridgedDictionary { } @ReadWriteAttribute - public var latencyHint: __UNSUPPORTED_UNION__ + public var latencyHint: AudioContextLatencyCategory_or_Double @ReadWriteAttribute public var sampleRate: Float diff --git a/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift new file mode 100644 index 00000000..99614fcb --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_AudioTrack_or_TextTrack_or_VideoTrack: ConvertibleToJSValue {} +extension AudioTrack: Any_AudioTrack_or_TextTrack_or_VideoTrack {} +extension TextTrack: Any_AudioTrack_or_TextTrack_or_VideoTrack {} +extension VideoTrack: Any_AudioTrack_or_TextTrack_or_VideoTrack {} + +public enum AudioTrack_or_TextTrack_or_VideoTrack: JSValueCompatible, Any_AudioTrack_or_TextTrack_or_VideoTrack { + case audioTrack(AudioTrack) + case textTrack(TextTrack) + case videoTrack(VideoTrack) + + public static func construct(from value: JSValue) -> Self? { + if let audioTrack: AudioTrack = value.fromJSValue() { + return .audioTrack(audioTrack) + } + if let textTrack: TextTrack = value.fromJSValue() { + return .textTrack(textTrack) + } + if let videoTrack: VideoTrack = value.fromJSValue() { + return .videoTrack(videoTrack) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .audioTrack(audioTrack): + return audioTrack.jsValue() + case let .textTrack(textTrack): + return textTrack.jsValue() + case let .videoTrack(videoTrack): + return videoTrack.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/AutoKeyword_or_Double.swift b/Sources/DOMKit/WebIDL/AutoKeyword_or_Double.swift new file mode 100644 index 00000000..930368de --- /dev/null +++ b/Sources/DOMKit/WebIDL/AutoKeyword_or_Double.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_AutoKeyword_or_Double: ConvertibleToJSValue {} +extension AutoKeyword: Any_AutoKeyword_or_Double {} +extension Double: Any_AutoKeyword_or_Double {} + +public enum AutoKeyword_or_Double: JSValueCompatible, Any_AutoKeyword_or_Double { + case autoKeyword(AutoKeyword) + case double(Double) + + public static func construct(from value: JSValue) -> Self? { + if let autoKeyword: AutoKeyword = value.fromJSValue() { + return .autoKeyword(autoKeyword) + } + if let double: Double = value.fromJSValue() { + return .double(double) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .autoKeyword(autoKeyword): + return autoKeyword.jsValue() + case let .double(double): + return double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift index 4af5cb8d..ce306a17 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift @@ -12,13 +12,13 @@ public class BackgroundFetchManager: JSBridgedClass { self.jsObject = jsObject } - @inlinable public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) -> JSPromise { + @inlinable public func fetch(id: String, requests: RequestInfo_or_seq_of_RequestInfo, options: BackgroundFetchOptions? = nil) -> JSPromise { let this = jsObject return this[Strings.fetch].function!(this: this, arguments: [id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func fetch(id: String, requests: __UNSUPPORTED_UNION__, options: BackgroundFetchOptions? = nil) async throws -> BackgroundFetchRegistration { + @inlinable public func fetch(id: String, requests: RequestInfo_or_seq_of_RequestInfo, options: BackgroundFetchOptions? = nil) async throws -> BackgroundFetchRegistration { let this = jsObject let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift b/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift index cf7075e5..d845d6ee 100644 --- a/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift +++ b/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BasePropertyIndexedKeyframe: BridgedDictionary { - public convenience init(offset: __UNSUPPORTED_UNION__, easing: __UNSUPPORTED_UNION__, composite: __UNSUPPORTED_UNION__) { + 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() @@ -20,11 +20,11 @@ public class BasePropertyIndexedKeyframe: BridgedDictionary { } @ReadWriteAttribute - public var offset: __UNSUPPORTED_UNION__ + public var offset: nullable_Double_or_seq_of_nullable_Double @ReadWriteAttribute - public var easing: __UNSUPPORTED_UNION__ + public var easing: String_or_seq_of_String @ReadWriteAttribute - public var composite: __UNSUPPORTED_UNION__ + public var composite: CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto } diff --git a/Sources/DOMKit/WebIDL/BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray.swift b/Sources/DOMKit/WebIDL/BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray.swift new file mode 100644 index 00000000..0b90c0e9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray.swift @@ -0,0 +1,102 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray: ConvertibleToJSValue {} +extension BigInt64Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension BigUint64Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension DataView: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension Float32Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension Float64Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension Int16Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension Int32Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension Int8Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension Uint16Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension Uint32Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension Uint8Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} +extension Uint8ClampedArray: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} + +public enum BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray: JSValueCompatible, Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray { + case bigInt64Array(BigInt64Array) + case bigUint64Array(BigUint64Array) + case dataView(DataView) + case float32Array(Float32Array) + case float64Array(Float64Array) + case int16Array(Int16Array) + case int32Array(Int32Array) + case int8Array(Int8Array) + case uint16Array(Uint16Array) + case uint32Array(Uint32Array) + case uint8Array(Uint8Array) + case uint8ClampedArray(Uint8ClampedArray) + + public static func construct(from value: JSValue) -> Self? { + if let bigInt64Array: BigInt64Array = value.fromJSValue() { + return .bigInt64Array(bigInt64Array) + } + if let bigUint64Array: BigUint64Array = value.fromJSValue() { + return .bigUint64Array(bigUint64Array) + } + if let dataView: DataView = value.fromJSValue() { + return .dataView(dataView) + } + if let float32Array: Float32Array = value.fromJSValue() { + return .float32Array(float32Array) + } + if let float64Array: Float64Array = value.fromJSValue() { + return .float64Array(float64Array) + } + if let int16Array: Int16Array = value.fromJSValue() { + return .int16Array(int16Array) + } + if let int32Array: Int32Array = value.fromJSValue() { + return .int32Array(int32Array) + } + if let int8Array: Int8Array = value.fromJSValue() { + return .int8Array(int8Array) + } + if let uint16Array: Uint16Array = value.fromJSValue() { + return .uint16Array(uint16Array) + } + if let uint32Array: Uint32Array = value.fromJSValue() { + return .uint32Array(uint32Array) + } + if let uint8Array: Uint8Array = value.fromJSValue() { + return .uint8Array(uint8Array) + } + if let uint8ClampedArray: Uint8ClampedArray = value.fromJSValue() { + return .uint8ClampedArray(uint8ClampedArray) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .bigInt64Array(bigInt64Array): + return bigInt64Array.jsValue() + case let .bigUint64Array(bigUint64Array): + return bigUint64Array.jsValue() + case let .dataView(dataView): + return dataView.jsValue() + case let .float32Array(float32Array): + return float32Array.jsValue() + case let .float64Array(float64Array): + return float64Array.jsValue() + case let .int16Array(int16Array): + return int16Array.jsValue() + case let .int32Array(int32Array): + return int32Array.jsValue() + case let .int8Array(int8Array): + return int8Array.jsValue() + case let .uint16Array(uint16Array): + return uint16Array.jsValue() + case let .uint32Array(uint32Array): + return uint32Array.jsValue() + case let .uint8Array(uint8Array): + return uint8Array.jsValue() + case let .uint8ClampedArray(uint8ClampedArray): + return uint8ClampedArray.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/BinaryData_or_String.swift b/Sources/DOMKit/WebIDL/BinaryData_or_String.swift new file mode 100644 index 00000000..e0e24eea --- /dev/null +++ b/Sources/DOMKit/WebIDL/BinaryData_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_BinaryData_or_String: ConvertibleToJSValue {} +extension BinaryData: Any_BinaryData_or_String {} +extension String: Any_BinaryData_or_String {} + +public enum BinaryData_or_String: JSValueCompatible, Any_BinaryData_or_String { + case binaryData(BinaryData) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let binaryData: BinaryData = value.fromJSValue() { + return .binaryData(binaryData) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .binaryData(binaryData): + return binaryData.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams.swift b/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams.swift new file mode 100644 index 00000000..0736dd46 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams.swift @@ -0,0 +1,53 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams: ConvertibleToJSValue {} +extension Blob: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} +extension BufferSource: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} +extension FormData: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} +extension String: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} +extension URLSearchParams: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} + +public enum Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams: JSValueCompatible, Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams { + case blob(Blob) + case bufferSource(BufferSource) + case formData(FormData) + case string(String) + case uRLSearchParams(URLSearchParams) + + public static func construct(from value: JSValue) -> Self? { + if let blob: Blob = value.fromJSValue() { + return .blob(blob) + } + if let bufferSource: BufferSource = value.fromJSValue() { + return .bufferSource(bufferSource) + } + if let formData: FormData = value.fromJSValue() { + return .formData(formData) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + if let uRLSearchParams: URLSearchParams = value.fromJSValue() { + return .uRLSearchParams(uRLSearchParams) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .blob(blob): + return blob.jsValue() + case let .bufferSource(bufferSource): + return bufferSource.jsValue() + case let .formData(formData): + return formData.jsValue() + case let .string(string): + return string.jsValue() + case let .uRLSearchParams(uRLSearchParams): + return uRLSearchParams.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String.swift b/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String.swift new file mode 100644 index 00000000..5048dee9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Blob_or_BufferSource_or_String: ConvertibleToJSValue {} +extension Blob: Any_Blob_or_BufferSource_or_String {} +extension BufferSource: Any_Blob_or_BufferSource_or_String {} +extension String: Any_Blob_or_BufferSource_or_String {} + +public enum Blob_or_BufferSource_or_String: JSValueCompatible, Any_Blob_or_BufferSource_or_String { + case blob(Blob) + case bufferSource(BufferSource) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let blob: Blob = value.fromJSValue() { + return .blob(blob) + } + if let bufferSource: BufferSource = value.fromJSValue() { + return .bufferSource(bufferSource) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .blob(blob): + return blob.jsValue() + case let .bufferSource(bufferSource): + return bufferSource.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String_or_WriteParams.swift b/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String_or_WriteParams.swift new file mode 100644 index 00000000..bbe1cdde --- /dev/null +++ b/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String_or_WriteParams.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Blob_or_BufferSource_or_String_or_WriteParams: ConvertibleToJSValue {} +extension Blob: Any_Blob_or_BufferSource_or_String_or_WriteParams {} +extension BufferSource: Any_Blob_or_BufferSource_or_String_or_WriteParams {} +extension String: Any_Blob_or_BufferSource_or_String_or_WriteParams {} +extension WriteParams: Any_Blob_or_BufferSource_or_String_or_WriteParams {} + +public enum Blob_or_BufferSource_or_String_or_WriteParams: JSValueCompatible, Any_Blob_or_BufferSource_or_String_or_WriteParams { + case blob(Blob) + case bufferSource(BufferSource) + case string(String) + case writeParams(WriteParams) + + public static func construct(from value: JSValue) -> Self? { + if let blob: Blob = value.fromJSValue() { + return .blob(blob) + } + if let bufferSource: BufferSource = value.fromJSValue() { + return .bufferSource(bufferSource) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + if let writeParams: WriteParams = value.fromJSValue() { + return .writeParams(writeParams) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .blob(blob): + return blob.jsValue() + case let .bufferSource(bufferSource): + return bufferSource.jsValue() + case let .string(string): + return string.jsValue() + case let .writeParams(writeParams): + return writeParams.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Blob_or_CanvasImageSource_or_ImageData.swift b/Sources/DOMKit/WebIDL/Blob_or_CanvasImageSource_or_ImageData.swift new file mode 100644 index 00000000..352fe20b --- /dev/null +++ b/Sources/DOMKit/WebIDL/Blob_or_CanvasImageSource_or_ImageData.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Blob_or_CanvasImageSource_or_ImageData: ConvertibleToJSValue {} +extension Blob: Any_Blob_or_CanvasImageSource_or_ImageData {} +extension CanvasImageSource: Any_Blob_or_CanvasImageSource_or_ImageData {} +extension ImageData: Any_Blob_or_CanvasImageSource_or_ImageData {} + +public enum Blob_or_CanvasImageSource_or_ImageData: JSValueCompatible, Any_Blob_or_CanvasImageSource_or_ImageData { + case blob(Blob) + case canvasImageSource(CanvasImageSource) + case imageData(ImageData) + + public static func construct(from value: JSValue) -> Self? { + if let blob: Blob = value.fromJSValue() { + return .blob(blob) + } + if let canvasImageSource: CanvasImageSource = value.fromJSValue() { + return .canvasImageSource(canvasImageSource) + } + if let imageData: ImageData = value.fromJSValue() { + return .imageData(imageData) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .blob(blob): + return blob.jsValue() + case let .canvasImageSource(canvasImageSource): + return canvasImageSource.jsValue() + case let .imageData(imageData): + return imageData.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift b/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift new file mode 100644 index 00000000..b6d992f9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Blob_or_MediaSource: ConvertibleToJSValue {} +extension Blob: Any_Blob_or_MediaSource {} +extension MediaSource: Any_Blob_or_MediaSource {} + +public enum Blob_or_MediaSource: JSValueCompatible, Any_Blob_or_MediaSource { + case blob(Blob) + case mediaSource(MediaSource) + + public static func construct(from value: JSValue) -> Self? { + if let blob: Blob = value.fromJSValue() { + return .blob(blob) + } + if let mediaSource: MediaSource = value.fromJSValue() { + return .mediaSource(mediaSource) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .blob(blob): + return blob.jsValue() + case let .mediaSource(mediaSource): + return mediaSource.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Blob_or_MediaSource_or_MediaStream.swift b/Sources/DOMKit/WebIDL/Blob_or_MediaSource_or_MediaStream.swift new file mode 100644 index 00000000..f7c6f38e --- /dev/null +++ b/Sources/DOMKit/WebIDL/Blob_or_MediaSource_or_MediaStream.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Blob_or_MediaSource_or_MediaStream: ConvertibleToJSValue {} +extension Blob: Any_Blob_or_MediaSource_or_MediaStream {} +extension MediaSource: Any_Blob_or_MediaSource_or_MediaStream {} +extension MediaStream: Any_Blob_or_MediaSource_or_MediaStream {} + +public enum Blob_or_MediaSource_or_MediaStream: JSValueCompatible, Any_Blob_or_MediaSource_or_MediaStream { + case blob(Blob) + case mediaSource(MediaSource) + case mediaStream(MediaStream) + + public static func construct(from value: JSValue) -> Self? { + if let blob: Blob = value.fromJSValue() { + return .blob(blob) + } + if let mediaSource: MediaSource = value.fromJSValue() { + return .mediaSource(mediaSource) + } + if let mediaStream: MediaStream = value.fromJSValue() { + return .mediaStream(mediaStream) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .blob(blob): + return blob.jsValue() + case let .mediaSource(mediaSource): + return mediaSource.jsValue() + case let .mediaStream(mediaStream): + return mediaStream.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift index fca7d625..46df3b2f 100644 --- a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift +++ b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class BluetoothAdvertisingEventInit: BridgedDictionary { - public convenience init(device: BluetoothDevice, uuids: [__UNSUPPORTED_UNION__], name: String, appearance: UInt16, txPower: Int8, rssi: Int8, manufacturerData: BluetoothManufacturerDataMap, serviceData: BluetoothServiceDataMap) { + public convenience init(device: BluetoothDevice, uuids: [String_or_UInt32], name: String, appearance: UInt16, txPower: Int8, rssi: Int8, manufacturerData: BluetoothManufacturerDataMap, serviceData: BluetoothServiceDataMap) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.device] = device.jsValue() object[Strings.uuids] = uuids.jsValue() @@ -33,7 +33,7 @@ public class BluetoothAdvertisingEventInit: BridgedDictionary { public var device: BluetoothDevice @ReadWriteAttribute - public var uuids: [__UNSUPPORTED_UNION__] + public var uuids: [String_or_UInt32] @ReadWriteAttribute public var name: String diff --git a/Sources/DOMKit/WebIDL/BluetoothUUID.swift b/Sources/DOMKit/WebIDL/BluetoothUUID.swift index 7a306c65..2e32e17f 100644 --- a/Sources/DOMKit/WebIDL/BluetoothUUID.swift +++ b/Sources/DOMKit/WebIDL/BluetoothUUID.swift @@ -12,17 +12,17 @@ public class BluetoothUUID: JSBridgedClass { self.jsObject = jsObject } - @inlinable public static func getService(name: __UNSUPPORTED_UNION__) -> UUID { + @inlinable public static func getService(name: String_or_UInt32) -> UUID { let this = constructor return this[Strings.getService].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - @inlinable public static func getCharacteristic(name: __UNSUPPORTED_UNION__) -> UUID { + @inlinable public static func getCharacteristic(name: String_or_UInt32) -> UUID { let this = constructor return this[Strings.getCharacteristic].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - @inlinable public static func getDescriptor(name: __UNSUPPORTED_UNION__) -> UUID { + @inlinable public static func getDescriptor(name: String_or_UInt32) -> UUID { let this = constructor return this[Strings.getDescriptor].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Bool_or_ConstrainBooleanParameters.swift b/Sources/DOMKit/WebIDL/Bool_or_ConstrainBooleanParameters.swift new file mode 100644 index 00000000..41e4f5ea --- /dev/null +++ b/Sources/DOMKit/WebIDL/Bool_or_ConstrainBooleanParameters.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Bool_or_ConstrainBooleanParameters: ConvertibleToJSValue {} +extension Bool: Any_Bool_or_ConstrainBooleanParameters {} +extension ConstrainBooleanParameters: Any_Bool_or_ConstrainBooleanParameters {} + +public enum Bool_or_ConstrainBooleanParameters: JSValueCompatible, Any_Bool_or_ConstrainBooleanParameters { + case bool(Bool) + case constrainBooleanParameters(ConstrainBooleanParameters) + + 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 func jsValue() -> JSValue { + switch self { + case let .bool(bool): + return bool.jsValue() + case let .constrainBooleanParameters(constrainBooleanParameters): + return constrainBooleanParameters.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift b/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift new file mode 100644 index 00000000..e039f190 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Bool_or_ConstrainDouble: ConvertibleToJSValue {} +extension Bool: Any_Bool_or_ConstrainDouble {} +extension ConstrainDouble: Any_Bool_or_ConstrainDouble {} + +public enum Bool_or_ConstrainDouble: JSValueCompatible, Any_Bool_or_ConstrainDouble { + case bool(Bool) + case constrainDouble(ConstrainDouble) + + public static func construct(from value: JSValue) -> Self? { + if let bool: Bool = value.fromJSValue() { + return .bool(bool) + } + if let constrainDouble: ConstrainDouble = value.fromJSValue() { + return .constrainDouble(constrainDouble) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .bool(bool): + return bool.jsValue() + case let .constrainDouble(constrainDouble): + return constrainDouble.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift b/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift new file mode 100644 index 00000000..353718df --- /dev/null +++ b/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +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) + + 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 func jsValue() -> JSValue { + switch self { + case let .bool(bool): + return bool.jsValue() + case let .mediaTrackConstraints(mediaTrackConstraints): + return mediaTrackConstraints.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift b/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift new file mode 100644 index 00000000..1c21017f --- /dev/null +++ b/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Bool_or_ScrollIntoViewOptions: ConvertibleToJSValue {} +extension Bool: Any_Bool_or_ScrollIntoViewOptions {} +extension ScrollIntoViewOptions: Any_Bool_or_ScrollIntoViewOptions {} + +public enum Bool_or_ScrollIntoViewOptions: JSValueCompatible, Any_Bool_or_ScrollIntoViewOptions { + case bool(Bool) + case scrollIntoViewOptions(ScrollIntoViewOptions) + + public static func construct(from value: JSValue) -> Self? { + if let bool: Bool = value.fromJSValue() { + return .bool(bool) + } + if let scrollIntoViewOptions: ScrollIntoViewOptions = value.fromJSValue() { + return .scrollIntoViewOptions(scrollIntoViewOptions) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .bool(bool): + return bool.jsValue() + case let .scrollIntoViewOptions(scrollIntoViewOptions): + return scrollIntoViewOptions.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/BreakTokenOptions.swift b/Sources/DOMKit/WebIDL/BreakTokenOptions.swift deleted file mode 100644 index 6e27e8f5..00000000 --- a/Sources/DOMKit/WebIDL/BreakTokenOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BreakTokenOptions: BridgedDictionary { - public convenience init(childBreakTokens: [ChildBreakToken], data: JSValue) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.childBreakTokens] = childBreakTokens.jsValue() - object[Strings.data] = data.jsValue() - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _childBreakTokens = ReadWriteAttribute(jsObject: object, name: Strings.childBreakTokens) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var childBreakTokens: [ChildBreakToken] - - @ReadWriteAttribute - public var data: JSValue -} diff --git a/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift b/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift new file mode 100644 index 00000000..9897f2d7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_BufferSource_or_JsonWebKey: ConvertibleToJSValue {} +extension BufferSource: Any_BufferSource_or_JsonWebKey {} +extension JsonWebKey: Any_BufferSource_or_JsonWebKey {} + +public enum BufferSource_or_JsonWebKey: JSValueCompatible, Any_BufferSource_or_JsonWebKey { + case bufferSource(BufferSource) + case jsonWebKey(JsonWebKey) + + public static func construct(from value: JSValue) -> Self? { + if let bufferSource: BufferSource = value.fromJSValue() { + return .bufferSource(bufferSource) + } + if let jsonWebKey: JsonWebKey = value.fromJSValue() { + return .jsonWebKey(jsonWebKey) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .bufferSource(bufferSource): + return bufferSource.jsValue() + case let .jsonWebKey(jsonWebKey): + return jsonWebKey.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/BufferSource_or_NDEFMessageInit_or_String.swift b/Sources/DOMKit/WebIDL/BufferSource_or_NDEFMessageInit_or_String.swift new file mode 100644 index 00000000..b7a7f23d --- /dev/null +++ b/Sources/DOMKit/WebIDL/BufferSource_or_NDEFMessageInit_or_String.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_BufferSource_or_NDEFMessageInit_or_String: ConvertibleToJSValue {} +extension BufferSource: Any_BufferSource_or_NDEFMessageInit_or_String {} +extension NDEFMessageInit: Any_BufferSource_or_NDEFMessageInit_or_String {} +extension String: Any_BufferSource_or_NDEFMessageInit_or_String {} + +public enum BufferSource_or_NDEFMessageInit_or_String: JSValueCompatible, Any_BufferSource_or_NDEFMessageInit_or_String { + case bufferSource(BufferSource) + case nDEFMessageInit(NDEFMessageInit) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let bufferSource: BufferSource = value.fromJSValue() { + return .bufferSource(bufferSource) + } + if let nDEFMessageInit: NDEFMessageInit = value.fromJSValue() { + return .nDEFMessageInit(nDEFMessageInit) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .bufferSource(bufferSource): + return bufferSource.jsValue() + case let .nDEFMessageInit(nDEFMessageInit): + return nDEFMessageInit.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/BufferSource_or_ReadableStream.swift b/Sources/DOMKit/WebIDL/BufferSource_or_ReadableStream.swift new file mode 100644 index 00000000..78d3c185 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BufferSource_or_ReadableStream.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_BufferSource_or_ReadableStream: ConvertibleToJSValue {} +extension BufferSource: Any_BufferSource_or_ReadableStream {} +extension ReadableStream: Any_BufferSource_or_ReadableStream {} + +public enum BufferSource_or_ReadableStream: JSValueCompatible, Any_BufferSource_or_ReadableStream { + case bufferSource(BufferSource) + case readableStream(ReadableStream) + + 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 func jsValue() -> JSValue { + switch self { + case let .bufferSource(bufferSource): + return bufferSource.jsValue() + case let .readableStream(readableStream): + return readableStream.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/BufferSource_or_String.swift b/Sources/DOMKit/WebIDL/BufferSource_or_String.swift new file mode 100644 index 00000000..52cf7846 --- /dev/null +++ b/Sources/DOMKit/WebIDL/BufferSource_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_BufferSource_or_String: ConvertibleToJSValue {} +extension BufferSource: Any_BufferSource_or_String {} +extension String: Any_BufferSource_or_String {} + +public enum BufferSource_or_String: JSValueCompatible, Any_BufferSource_or_String { + case bufferSource(BufferSource) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let bufferSource: BufferSource = value.fromJSValue() { + return .bufferSource(bufferSource) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .bufferSource(bufferSource): + return bufferSource.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSColorValue.swift b/Sources/DOMKit/WebIDL/CSSColorValue.swift index 2c63ecee..2d71a25e 100644 --- a/Sources/DOMKit/WebIDL/CSSColorValue.swift +++ b/Sources/DOMKit/WebIDL/CSSColorValue.swift @@ -20,5 +20,5 @@ public class CSSColorValue: CSSStyleValue { } // XXX: illegal static override - // override public static func parse(cssText: String) -> __UNSUPPORTED_UNION__ + // override public static func parse(cssText: String) -> CSSColorValue_or_CSSStyleValue } diff --git a/Sources/DOMKit/WebIDL/CSSColorValue_or_CSSStyleValue.swift b/Sources/DOMKit/WebIDL/CSSColorValue_or_CSSStyleValue.swift new file mode 100644 index 00000000..c62d8f3a --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSColorValue_or_CSSStyleValue.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSColorValue_or_CSSStyleValue: ConvertibleToJSValue {} +extension CSSColorValue: Any_CSSColorValue_or_CSSStyleValue {} +extension CSSStyleValue: Any_CSSColorValue_or_CSSStyleValue {} + +public enum CSSColorValue_or_CSSStyleValue: JSValueCompatible, Any_CSSColorValue_or_CSSStyleValue { + case cSSColorValue(CSSColorValue) + case cSSStyleValue(CSSStyleValue) + + public static func construct(from value: JSValue) -> Self? { + if let cSSColorValue: CSSColorValue = value.fromJSValue() { + return .cSSColorValue(cSSColorValue) + } + if let cSSStyleValue: CSSStyleValue = value.fromJSValue() { + return .cSSStyleValue(cSSStyleValue) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSColorValue(cSSColorValue): + return cSSColorValue.jsValue() + case let .cSSStyleValue(cSSStyleValue): + return cSSStyleValue.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift index b476a082..7b524556 100644 --- a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift +++ b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift @@ -14,7 +14,7 @@ public class CSSFontFeatureValuesMap: JSBridgedClass { // XXX: make me Map-like! - @inlinable public func set(featureValueName: String, values: __UNSUPPORTED_UNION__) { + @inlinable public func set(featureValueName: String, values: UInt32_or_seq_of_UInt32) { let this = jsObject _ = this[Strings.set].function!(this: this, arguments: [featureValueName.jsValue(), values.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/CSSKeywordValue_or_String.swift b/Sources/DOMKit/WebIDL/CSSKeywordValue_or_String.swift new file mode 100644 index 00000000..b5e74de6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSKeywordValue_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSKeywordValue_or_String: ConvertibleToJSValue {} +extension CSSKeywordValue: Any_CSSKeywordValue_or_String {} +extension String: Any_CSSKeywordValue_or_String {} + +public enum CSSKeywordValue_or_String: JSValueCompatible, Any_CSSKeywordValue_or_String { + case cSSKeywordValue(CSSKeywordValue) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let cSSKeywordValue: CSSKeywordValue = value.fromJSValue() { + return .cSSKeywordValue(cSSKeywordValue) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSKeywordValue(cSSKeywordValue): + return cSSKeywordValue.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumberish.swift b/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumberish.swift new file mode 100644 index 00000000..632bd06a --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumberish.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSKeywordish_or_CSSNumberish: ConvertibleToJSValue {} +extension CSSKeywordish: Any_CSSKeywordish_or_CSSNumberish {} +extension CSSNumberish: Any_CSSKeywordish_or_CSSNumberish {} + +public enum CSSKeywordish_or_CSSNumberish: JSValueCompatible, Any_CSSKeywordish_or_CSSNumberish { + case cSSKeywordish(CSSKeywordish) + case cSSNumberish(CSSNumberish) + + public static func construct(from value: JSValue) -> Self? { + if let cSSKeywordish: CSSKeywordish = value.fromJSValue() { + return .cSSKeywordish(cSSKeywordish) + } + if let cSSNumberish: CSSNumberish = value.fromJSValue() { + return .cSSNumberish(cSSNumberish) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSKeywordish(cSSKeywordish): + return cSSKeywordish.jsValue() + case let .cSSNumberish(cSSNumberish): + return cSSNumberish.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumericValue.swift b/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumericValue.swift new file mode 100644 index 00000000..5df19068 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumericValue.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSKeywordish_or_CSSNumericValue: ConvertibleToJSValue {} +extension CSSKeywordish: Any_CSSKeywordish_or_CSSNumericValue {} +extension CSSNumericValue: Any_CSSKeywordish_or_CSSNumericValue {} + +public enum CSSKeywordish_or_CSSNumericValue: JSValueCompatible, Any_CSSKeywordish_or_CSSNumericValue { + case cSSKeywordish(CSSKeywordish) + case cSSNumericValue(CSSNumericValue) + + public static func construct(from value: JSValue) -> Self? { + if let cSSKeywordish: CSSKeywordish = value.fromJSValue() { + return .cSSKeywordish(cSSKeywordish) + } + if let cSSNumericValue: CSSNumericValue = value.fromJSValue() { + return .cSSNumericValue(cSSNumericValue) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSKeywordish(cSSKeywordish): + return cSSKeywordish.jsValue() + case let .cSSNumericValue(cSSNumericValue): + return cSSNumericValue.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double.swift b/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double.swift new file mode 100644 index 00000000..97d01860 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSNumericValue_or_Double: ConvertibleToJSValue {} +extension CSSNumericValue: Any_CSSNumericValue_or_Double {} +extension Double: Any_CSSNumericValue_or_Double {} + +public enum CSSNumericValue_or_Double: JSValueCompatible, Any_CSSNumericValue_or_Double { + case cSSNumericValue(CSSNumericValue) + case double(Double) + + public static func construct(from value: JSValue) -> Self? { + if let cSSNumericValue: CSSNumericValue = value.fromJSValue() { + return .cSSNumericValue(cSSNumericValue) + } + if let double: Double = value.fromJSValue() { + return .double(double) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSNumericValue(cSSNumericValue): + return cSSNumericValue.jsValue() + case let .double(double): + return double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift b/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift new file mode 100644 index 00000000..f5967cc5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSNumericValue_or_Double_or_String: ConvertibleToJSValue {} +extension CSSNumericValue: Any_CSSNumericValue_or_Double_or_String {} +extension Double: Any_CSSNumericValue_or_Double_or_String {} +extension String: Any_CSSNumericValue_or_Double_or_String {} + +public enum CSSNumericValue_or_Double_or_String: JSValueCompatible, Any_CSSNumericValue_or_Double_or_String { + case cSSNumericValue(CSSNumericValue) + case double(Double) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let cSSNumericValue: CSSNumericValue = value.fromJSValue() { + return .cSSNumericValue(cSSNumericValue) + } + if let double: Double = value.fromJSValue() { + return .double(double) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSNumericValue(cSSNumericValue): + return cSSNumericValue.jsValue() + case let .double(double): + return double.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSParserValue_or_CSSStyleValue_or_String.swift b/Sources/DOMKit/WebIDL/CSSParserValue_or_CSSStyleValue_or_String.swift new file mode 100644 index 00000000..b34e2497 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSParserValue_or_CSSStyleValue_or_String.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSParserValue_or_CSSStyleValue_or_String: ConvertibleToJSValue {} +extension CSSParserValue: Any_CSSParserValue_or_CSSStyleValue_or_String {} +extension CSSStyleValue: Any_CSSParserValue_or_CSSStyleValue_or_String {} +extension String: Any_CSSParserValue_or_CSSStyleValue_or_String {} + +public enum CSSParserValue_or_CSSStyleValue_or_String: JSValueCompatible, Any_CSSParserValue_or_CSSStyleValue_or_String { + case cSSParserValue(CSSParserValue) + case cSSStyleValue(CSSStyleValue) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let cSSParserValue: CSSParserValue = value.fromJSValue() { + return .cSSParserValue(cSSParserValue) + } + if let cSSStyleValue: CSSStyleValue = value.fromJSValue() { + return .cSSStyleValue(cSSStyleValue) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSParserValue(cSSParserValue): + return cSSParserValue.jsValue() + case let .cSSStyleValue(cSSStyleValue): + return cSSStyleValue.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift index f2362544..87185992 100644 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift @@ -20,7 +20,7 @@ public class CSSPseudoElement: EventTarget, GeometryUtils { public var element: Element @ReadonlyAttribute - public var parent: __UNSUPPORTED_UNION__ + public var parent: CSSPseudoElement_or_Element @inlinable public func pseudo(type: String) -> CSSPseudoElement? { let this = jsObject diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Document_or_Element_or_Text.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Document_or_Element_or_Text.swift new file mode 100644 index 00000000..32c33737 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Document_or_Element_or_Text.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSPseudoElement_or_Document_or_Element_or_Text: ConvertibleToJSValue {} +extension CSSPseudoElement: Any_CSSPseudoElement_or_Document_or_Element_or_Text {} +extension Document: Any_CSSPseudoElement_or_Document_or_Element_or_Text {} +extension Element: Any_CSSPseudoElement_or_Document_or_Element_or_Text {} +extension Text: Any_CSSPseudoElement_or_Document_or_Element_or_Text {} + +public enum CSSPseudoElement_or_Document_or_Element_or_Text: JSValueCompatible, Any_CSSPseudoElement_or_Document_or_Element_or_Text { + case cSSPseudoElement(CSSPseudoElement) + case document(Document) + case element(Element) + case text(Text) + + public static func construct(from value: JSValue) -> Self? { + if let cSSPseudoElement: CSSPseudoElement = value.fromJSValue() { + return .cSSPseudoElement(cSSPseudoElement) + } + if let document: Document = value.fromJSValue() { + return .document(document) + } + if let element: Element = value.fromJSValue() { + return .element(element) + } + if let text: Text = value.fromJSValue() { + return .text(text) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSPseudoElement(cSSPseudoElement): + return cSSPseudoElement.jsValue() + case let .document(document): + return document.jsValue() + case let .element(element): + return element.jsValue() + case let .text(text): + return text.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift new file mode 100644 index 00000000..a0c6cb5e --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSPseudoElement_or_Element: ConvertibleToJSValue {} +extension CSSPseudoElement: Any_CSSPseudoElement_or_Element {} +extension Element: Any_CSSPseudoElement_or_Element {} + +public enum CSSPseudoElement_or_Element: JSValueCompatible, Any_CSSPseudoElement_or_Element { + case cSSPseudoElement(CSSPseudoElement) + case element(Element) + + public static func construct(from value: JSValue) -> Self? { + if let cSSPseudoElement: CSSPseudoElement = value.fromJSValue() { + return .cSSPseudoElement(cSSPseudoElement) + } + if let element: Element = value.fromJSValue() { + return .element(element) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSPseudoElement(cSSPseudoElement): + return cSSPseudoElement.jsValue() + case let .element(element): + return element.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift index e05ef5ba..c37b959e 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class CSSStyleSheetInit: BridgedDictionary { - public convenience init(baseURL: String, media: __UNSUPPORTED_UNION__, disabled: Bool) { + public convenience init(baseURL: String, media: MediaList_or_String, disabled: Bool) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.baseURL] = baseURL.jsValue() object[Strings.media] = media.jsValue() @@ -23,7 +23,7 @@ public class CSSStyleSheetInit: BridgedDictionary { public var baseURL: String @ReadWriteAttribute - public var media: __UNSUPPORTED_UNION__ + public var media: MediaList_or_String @ReadWriteAttribute public var disabled: Bool diff --git a/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift b/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift new file mode 100644 index 00000000..b65f1e3b --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSStyleValue_or_String: ConvertibleToJSValue {} +extension CSSStyleValue: Any_CSSStyleValue_or_String {} +extension String: Any_CSSStyleValue_or_String {} + +public enum CSSStyleValue_or_String: JSValueCompatible, Any_CSSStyleValue_or_String { + case cSSStyleValue(CSSStyleValue) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let cSSStyleValue: CSSStyleValue = value.fromJSValue() { + return .cSSStyleValue(cSSStyleValue) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSStyleValue(cSSStyleValue): + return cSSStyleValue.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue_or_String.swift b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue_or_String.swift new file mode 100644 index 00000000..89b8c691 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CSSVariableReferenceValue_or_String: ConvertibleToJSValue {} +extension CSSVariableReferenceValue: Any_CSSVariableReferenceValue_or_String {} +extension String: Any_CSSVariableReferenceValue_or_String {} + +public enum CSSVariableReferenceValue_or_String: JSValueCompatible, Any_CSSVariableReferenceValue_or_String { + case cSSVariableReferenceValue(CSSVariableReferenceValue) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let cSSVariableReferenceValue: CSSVariableReferenceValue = value.fromJSValue() { + return .cSSVariableReferenceValue(cSSVariableReferenceValue) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .cSSVariableReferenceValue(cSSVariableReferenceValue): + return cSSVariableReferenceValue.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Cache.swift b/Sources/DOMKit/WebIDL/Cache.swift index 104d0fee..63b33da6 100644 --- a/Sources/DOMKit/WebIDL/Cache.swift +++ b/Sources/DOMKit/WebIDL/Cache.swift @@ -18,7 +18,7 @@ public class Cache: JSBridgedClass { } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { + @inlinable public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> Response_or_Void { let this = jsObject let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/CacheStorage.swift b/Sources/DOMKit/WebIDL/CacheStorage.swift index 5a6d395d..5ad02647 100644 --- a/Sources/DOMKit/WebIDL/CacheStorage.swift +++ b/Sources/DOMKit/WebIDL/CacheStorage.swift @@ -18,7 +18,7 @@ public class CacheStorage: JSBridgedClass { } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) async throws -> __UNSUPPORTED_UNION__ { + @inlinable public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) async throws -> Response_or_Void { let this = jsObject let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift index 469a7fca..a4fa2c8e 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift @@ -5,12 +5,12 @@ import JavaScriptKit public protocol CanvasFillStrokeStyles: JSBridgedClass {} public extension CanvasFillStrokeStyles { - @inlinable var strokeStyle: __UNSUPPORTED_UNION__ { + @inlinable var strokeStyle: CanvasGradient_or_CanvasPattern_or_String { get { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] } nonmutating set { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] = newValue } } - @inlinable var fillStyle: __UNSUPPORTED_UNION__ { + @inlinable var fillStyle: CanvasGradient_or_CanvasPattern_or_String { get { ReadWriteAttribute[Strings.fillStyle, in: jsObject] } nonmutating set { ReadWriteAttribute[Strings.fillStyle, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasFilter.swift b/Sources/DOMKit/WebIDL/CanvasFilter.swift index b72b43e4..fc477a9b 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilter.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilter.swift @@ -12,7 +12,7 @@ public class CanvasFilter: JSBridgedClass { self.jsObject = jsObject } - @inlinable public convenience init(filters: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(filters: CanvasFilterInput_or_seq_of_CanvasFilterInput? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [filters?.jsValue() ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift b/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift new file mode 100644 index 00000000..987eb280 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CanvasFilterInput_or_seq_of_CanvasFilterInput: ConvertibleToJSValue {} +extension CanvasFilterInput: Any_CanvasFilterInput_or_seq_of_CanvasFilterInput {} +extension Array: Any_CanvasFilterInput_or_seq_of_CanvasFilterInput where Element == CanvasFilterInput {} + +public enum CanvasFilterInput_or_seq_of_CanvasFilterInput: JSValueCompatible, Any_CanvasFilterInput_or_seq_of_CanvasFilterInput { + case canvasFilterInput(CanvasFilterInput) + case seq_of_CanvasFilterInput([CanvasFilterInput]) + + public static func construct(from value: JSValue) -> Self? { + if let canvasFilterInput: CanvasFilterInput = value.fromJSValue() { + return .canvasFilterInput(canvasFilterInput) + } + if let seq_of_CanvasFilterInput: [CanvasFilterInput] = value.fromJSValue() { + return .seq_of_CanvasFilterInput(seq_of_CanvasFilterInput) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .canvasFilterInput(canvasFilterInput): + return canvasFilterInput.jsValue() + case let .seq_of_CanvasFilterInput(seq_of_CanvasFilterInput): + return seq_of_CanvasFilterInput.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift b/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift new file mode 100644 index 00000000..710e7b74 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CanvasFilter_or_String: ConvertibleToJSValue {} +extension CanvasFilter: Any_CanvasFilter_or_String {} +extension String: Any_CanvasFilter_or_String {} + +public enum CanvasFilter_or_String: JSValueCompatible, Any_CanvasFilter_or_String { + case canvasFilter(CanvasFilter) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let canvasFilter: CanvasFilter = value.fromJSValue() { + return .canvasFilter(canvasFilter) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .canvasFilter(canvasFilter): + return canvasFilter.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasFilters.swift b/Sources/DOMKit/WebIDL/CanvasFilters.swift index e3e02047..071d548a 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilters.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilters.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol CanvasFilters: JSBridgedClass {} public extension CanvasFilters { - @inlinable var filter: __UNSUPPORTED_UNION__ { + @inlinable var filter: CanvasFilter_or_String { get { ReadWriteAttribute[Strings.filter, in: jsObject] } nonmutating set { ReadWriteAttribute[Strings.filter, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift b/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift new file mode 100644 index 00000000..638cacd8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CanvasGradient_or_CanvasPattern_or_String: ConvertibleToJSValue {} +extension CanvasGradient: Any_CanvasGradient_or_CanvasPattern_or_String {} +extension CanvasPattern: Any_CanvasGradient_or_CanvasPattern_or_String {} +extension String: Any_CanvasGradient_or_CanvasPattern_or_String {} + +public enum CanvasGradient_or_CanvasPattern_or_String: JSValueCompatible, Any_CanvasGradient_or_CanvasPattern_or_String { + case canvasGradient(CanvasGradient) + case canvasPattern(CanvasPattern) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let canvasGradient: CanvasGradient = value.fromJSValue() { + return .canvasGradient(canvasGradient) + } + if let canvasPattern: CanvasPattern = value.fromJSValue() { + return .canvasPattern(canvasPattern) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .canvasGradient(canvasGradient): + return canvasGradient.jsValue() + case let .canvasPattern(canvasPattern): + return canvasPattern.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CanvasPath.swift b/Sources/DOMKit/WebIDL/CanvasPath.swift index 1ddc9c07..b73f6c61 100644 --- a/Sources/DOMKit/WebIDL/CanvasPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasPath.swift @@ -46,7 +46,7 @@ public extension CanvasPath { _ = this[Strings.rect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), w.jsValue(), h.jsValue()]) } - @inlinable func roundRect(x: Double, y: Double, w: Double, h: Double, radii: __UNSUPPORTED_UNION__? = nil) { + @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]) } diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift new file mode 100644 index 00000000..e905e8ef --- /dev/null +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift @@ -0,0 +1,53 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext: ConvertibleToJSValue {} +extension CanvasRenderingContext2D: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +extension GPUCanvasContext: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +extension ImageBitmapRenderingContext: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +extension WebGL2RenderingContext: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +extension WebGLRenderingContext: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} + +public enum CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext: JSValueCompatible, Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext { + case canvasRenderingContext2D(CanvasRenderingContext2D) + case gPUCanvasContext(GPUCanvasContext) + case imageBitmapRenderingContext(ImageBitmapRenderingContext) + case webGL2RenderingContext(WebGL2RenderingContext) + case webGLRenderingContext(WebGLRenderingContext) + + public static func construct(from value: JSValue) -> Self? { + if let canvasRenderingContext2D: CanvasRenderingContext2D = value.fromJSValue() { + return .canvasRenderingContext2D(canvasRenderingContext2D) + } + if let gPUCanvasContext: GPUCanvasContext = value.fromJSValue() { + return .gPUCanvasContext(gPUCanvasContext) + } + if let imageBitmapRenderingContext: ImageBitmapRenderingContext = value.fromJSValue() { + return .imageBitmapRenderingContext(imageBitmapRenderingContext) + } + if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { + return .webGL2RenderingContext(webGL2RenderingContext) + } + if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { + return .webGLRenderingContext(webGLRenderingContext) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .canvasRenderingContext2D(canvasRenderingContext2D): + return canvasRenderingContext2D.jsValue() + case let .gPUCanvasContext(gPUCanvasContext): + return gPUCanvasContext.jsValue() + case let .imageBitmapRenderingContext(imageBitmapRenderingContext): + return imageBitmapRenderingContext.jsValue() + case let .webGL2RenderingContext(webGL2RenderingContext): + return webGL2RenderingContext.jsValue() + case let .webGLRenderingContext(webGLRenderingContext): + return webGLRenderingContext.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ChildNode.swift b/Sources/DOMKit/WebIDL/ChildNode.swift index 743043bd..07bb8d36 100644 --- a/Sources/DOMKit/WebIDL/ChildNode.swift +++ b/Sources/DOMKit/WebIDL/ChildNode.swift @@ -5,17 +5,17 @@ import JavaScriptKit public protocol ChildNode: JSBridgedClass {} public extension ChildNode { - @inlinable func before(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func before(nodes: Node_or_String...) { let this = jsObject _ = this[Strings.before].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - @inlinable func after(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func after(nodes: Node_or_String...) { let this = jsObject _ = this[Strings.after].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - @inlinable func replaceWith(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func replaceWith(nodes: Node_or_String...) { let this = jsObject _ = this[Strings.replaceWith].function!(this: this, arguments: nodes.map { $0.jsValue() }) } diff --git a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift new file mode 100644 index 00000000..e7ba78fc --- /dev/null +++ b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto: ConvertibleToJSValue {} +extension CompositeOperationOrAuto: Any_CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto {} +extension Array: Any_CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto where Element == CompositeOperationOrAuto {} + +public enum CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto: JSValueCompatible, Any_CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto { + case compositeOperationOrAuto(CompositeOperationOrAuto) + case seq_of_CompositeOperationOrAuto([CompositeOperationOrAuto]) + + public static func construct(from value: JSValue) -> Self? { + if let compositeOperationOrAuto: CompositeOperationOrAuto = value.fromJSValue() { + return .compositeOperationOrAuto(compositeOperationOrAuto) + } + if let seq_of_CompositeOperationOrAuto: [CompositeOperationOrAuto] = value.fromJSValue() { + return .seq_of_CompositeOperationOrAuto(seq_of_CompositeOperationOrAuto) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .compositeOperationOrAuto(compositeOperationOrAuto): + return compositeOperationOrAuto.jsValue() + case let .seq_of_CompositeOperationOrAuto(seq_of_CompositeOperationOrAuto): + return seq_of_CompositeOperationOrAuto.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift b/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift index 0d9cba58..e9efdbf8 100644 --- a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift +++ b/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ConstrainDOMStringParameters: BridgedDictionary { - public convenience init(exact: __UNSUPPORTED_UNION__, ideal: __UNSUPPORTED_UNION__) { + 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() @@ -18,8 +18,8 @@ public class ConstrainDOMStringParameters: BridgedDictionary { } @ReadWriteAttribute - public var exact: __UNSUPPORTED_UNION__ + public var exact: String_or_seq_of_String @ReadWriteAttribute - public var ideal: __UNSUPPORTED_UNION__ + public var ideal: String_or_seq_of_String } diff --git a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters_or_String_or_seq_of_String.swift b/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters_or_String_or_seq_of_String.swift new file mode 100644 index 00000000..a3d586d1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters_or_String_or_seq_of_String.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ConstrainDOMStringParameters_or_String_or_seq_of_String: ConvertibleToJSValue {} +extension ConstrainDOMStringParameters: Any_ConstrainDOMStringParameters_or_String_or_seq_of_String {} +extension String: Any_ConstrainDOMStringParameters_or_String_or_seq_of_String {} +extension Array: Any_ConstrainDOMStringParameters_or_String_or_seq_of_String where Element == String {} + +public enum ConstrainDOMStringParameters_or_String_or_seq_of_String: JSValueCompatible, Any_ConstrainDOMStringParameters_or_String_or_seq_of_String { + case constrainDOMStringParameters(ConstrainDOMStringParameters) + case string(String) + case seq_of_String([String]) + + 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 func 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() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ConstrainDoubleRange_or_Double.swift b/Sources/DOMKit/WebIDL/ConstrainDoubleRange_or_Double.swift new file mode 100644 index 00000000..f2d4a30e --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstrainDoubleRange_or_Double.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ConstrainDoubleRange_or_Double: ConvertibleToJSValue {} +extension ConstrainDoubleRange: Any_ConstrainDoubleRange_or_Double {} +extension Double: Any_ConstrainDoubleRange_or_Double {} + +public enum ConstrainDoubleRange_or_Double: JSValueCompatible, Any_ConstrainDoubleRange_or_Double { + case constrainDoubleRange(ConstrainDoubleRange) + case double(Double) + + 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 func jsValue() -> JSValue { + switch self { + case let .constrainDoubleRange(constrainDoubleRange): + return constrainDoubleRange.jsValue() + case let .double(double): + return double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters_or_seq_of_Point2D.swift b/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters_or_seq_of_Point2D.swift new file mode 100644 index 00000000..1f09b198 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters_or_seq_of_Point2D.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ConstrainPoint2DParameters_or_seq_of_Point2D: ConvertibleToJSValue {} +extension ConstrainPoint2DParameters: Any_ConstrainPoint2DParameters_or_seq_of_Point2D {} +extension Array: Any_ConstrainPoint2DParameters_or_seq_of_Point2D where Element == Point2D {} + +public enum ConstrainPoint2DParameters_or_seq_of_Point2D: JSValueCompatible, Any_ConstrainPoint2DParameters_or_seq_of_Point2D { + case constrainPoint2DParameters(ConstrainPoint2DParameters) + case seq_of_Point2D([Point2D]) + + public static func construct(from value: JSValue) -> Self? { + if let constrainPoint2DParameters: ConstrainPoint2DParameters = value.fromJSValue() { + return .constrainPoint2DParameters(constrainPoint2DParameters) + } + if let seq_of_Point2D: [Point2D] = value.fromJSValue() { + return .seq_of_Point2D(seq_of_Point2D) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .constrainPoint2DParameters(constrainPoint2DParameters): + return constrainPoint2DParameters.jsValue() + case let .seq_of_Point2D(seq_of_Point2D): + return seq_of_Point2D.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ConstrainULongRange_or_UInt32.swift b/Sources/DOMKit/WebIDL/ConstrainULongRange_or_UInt32.swift new file mode 100644 index 00000000..026eaa50 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ConstrainULongRange_or_UInt32.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ConstrainULongRange_or_UInt32: ConvertibleToJSValue {} +extension ConstrainULongRange: Any_ConstrainULongRange_or_UInt32 {} +extension UInt32: Any_ConstrainULongRange_or_UInt32 {} + +public enum ConstrainULongRange_or_UInt32: JSValueCompatible, Any_ConstrainULongRange_or_UInt32 { + case constrainULongRange(ConstrainULongRange) + case uInt32(UInt32) + + 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 func jsValue() -> JSValue { + switch self { + case let .constrainULongRange(constrainULongRange): + return constrainULongRange.jsValue() + case let .uInt32(uInt32): + return uInt32.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ContainerBasedOffset_or_ElementBasedOffset.swift b/Sources/DOMKit/WebIDL/ContainerBasedOffset_or_ElementBasedOffset.swift new file mode 100644 index 00000000..8a647150 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ContainerBasedOffset_or_ElementBasedOffset.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ContainerBasedOffset_or_ElementBasedOffset: ConvertibleToJSValue {} +extension ContainerBasedOffset: Any_ContainerBasedOffset_or_ElementBasedOffset {} +extension ElementBasedOffset: Any_ContainerBasedOffset_or_ElementBasedOffset {} + +public enum ContainerBasedOffset_or_ElementBasedOffset: JSValueCompatible, Any_ContainerBasedOffset_or_ElementBasedOffset { + case containerBasedOffset(ContainerBasedOffset) + case elementBasedOffset(ElementBasedOffset) + + public static func construct(from value: JSValue) -> Self? { + if let containerBasedOffset: ContainerBasedOffset = value.fromJSValue() { + return .containerBasedOffset(containerBasedOffset) + } + if let elementBasedOffset: ElementBasedOffset = value.fromJSValue() { + return .elementBasedOffset(elementBasedOffset) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .containerBasedOffset(containerBasedOffset): + return containerBasedOffset.jsValue() + case let .elementBasedOffset(elementBasedOffset): + return elementBasedOffset.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CustomElementConstructor_or_Void.swift b/Sources/DOMKit/WebIDL/CustomElementConstructor_or_Void.swift new file mode 100644 index 00000000..360a6b6e --- /dev/null +++ b/Sources/DOMKit/WebIDL/CustomElementConstructor_or_Void.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_CustomElementConstructor_or_Void: ConvertibleToJSValue {} +extension CustomElementConstructor: Any_CustomElementConstructor_or_Void {} +extension Void: Any_CustomElementConstructor_or_Void {} + +public enum CustomElementConstructor_or_Void: JSValueCompatible, Any_CustomElementConstructor_or_Void { + case customElementConstructor(CustomElementConstructor) + case void(Void) + + public static func construct(from value: JSValue) -> Self? { + if let customElementConstructor: CustomElementConstructor = value.fromJSValue() { + return .customElementConstructor(customElementConstructor) + } + if let void: Void = value.fromJSValue() { + return .void(void) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .customElementConstructor(customElementConstructor): + return customElementConstructor.jsValue() + case let .void(void): + return void.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index 0e35b096..d426f48f 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -14,7 +14,7 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'define' is ignored - @inlinable public func get(name: String) -> __UNSUPPORTED_UNION__ { + @inlinable public func get(name: String) -> CustomElementConstructor_or_Void { let this = jsObject return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift b/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift new file mode 100644 index 00000000..01707373 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_DOMHighResTimeStamp_or_String: ConvertibleToJSValue {} +extension DOMHighResTimeStamp: Any_DOMHighResTimeStamp_or_String {} +extension String: Any_DOMHighResTimeStamp_or_String {} + +public enum DOMHighResTimeStamp_or_String: JSValueCompatible, Any_DOMHighResTimeStamp_or_String { + case dOMHighResTimeStamp(DOMHighResTimeStamp) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let dOMHighResTimeStamp: DOMHighResTimeStamp = value.fromJSValue() { + return .dOMHighResTimeStamp(dOMHighResTimeStamp) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .dOMHighResTimeStamp(dOMHighResTimeStamp): + return dOMHighResTimeStamp.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index 80d37663..e9b8220e 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -32,7 +32,7 @@ public class DOMMatrix: DOMMatrixReadOnly { super.init(unsafelyWrapping: jsObject) } - @inlinable public convenience init(init: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(init: String_or_seq_of_Double? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift index b2d96cc9..4359e9f5 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -36,7 +36,7 @@ public class DOMMatrixReadOnly: JSBridgedClass { self.jsObject = jsObject } - @inlinable public convenience init(init: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(init: String_or_seq_of_Double? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix_or_Float32Array_or_Float64Array.swift b/Sources/DOMKit/WebIDL/DOMMatrix_or_Float32Array_or_Float64Array.swift new file mode 100644 index 00000000..083e4b9a --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMMatrix_or_Float32Array_or_Float64Array.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_DOMMatrix_or_Float32Array_or_Float64Array: ConvertibleToJSValue {} +extension DOMMatrix: Any_DOMMatrix_or_Float32Array_or_Float64Array {} +extension Float32Array: Any_DOMMatrix_or_Float32Array_or_Float64Array {} +extension Float64Array: Any_DOMMatrix_or_Float32Array_or_Float64Array {} + +public enum DOMMatrix_or_Float32Array_or_Float64Array: JSValueCompatible, Any_DOMMatrix_or_Float32Array_or_Float64Array { + case dOMMatrix(DOMMatrix) + case float32Array(Float32Array) + case float64Array(Float64Array) + + public static func construct(from value: JSValue) -> Self? { + if let dOMMatrix: DOMMatrix = value.fromJSValue() { + return .dOMMatrix(dOMMatrix) + } + if let float32Array: Float32Array = value.fromJSValue() { + return .float32Array(float32Array) + } + if let float64Array: Float64Array = value.fromJSValue() { + return .float64Array(float64Array) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .dOMMatrix(dOMMatrix): + return dOMMatrix.jsValue() + case let .float32Array(float32Array): + return float32Array.jsValue() + case let .float64Array(float64Array): + return float64Array.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift new file mode 100644 index 00000000..74e5b1b3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_DOMPointInit_or_Double: ConvertibleToJSValue {} +extension DOMPointInit: Any_DOMPointInit_or_Double {} +extension Double: Any_DOMPointInit_or_Double {} + +public enum DOMPointInit_or_Double: JSValueCompatible, Any_DOMPointInit_or_Double { + case dOMPointInit(DOMPointInit) + case double(Double) + + public static func construct(from value: JSValue) -> Self? { + if let dOMPointInit: DOMPointInit = value.fromJSValue() { + return .dOMPointInit(dOMPointInit) + } + if let double: Double = value.fromJSValue() { + return .double(double) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .dOMPointInit(dOMPointInit): + return dOMPointInit.jsValue() + case let .double(double): + return double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift new file mode 100644 index 00000000..6dd73ac6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double: ConvertibleToJSValue {} +extension DOMPointInit: Any_DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double {} +extension Double: Any_DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double {} +extension Array: Any_DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double where Element == DOMPointInit_or_Double {} + +public enum DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double: JSValueCompatible, Any_DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double { + case dOMPointInit(DOMPointInit) + case double(Double) + case seq_of_DOMPointInit_or_Double([DOMPointInit_or_Double]) + + public static func construct(from value: JSValue) -> Self? { + if let dOMPointInit: DOMPointInit = value.fromJSValue() { + return .dOMPointInit(dOMPointInit) + } + if let double: Double = value.fromJSValue() { + return .double(double) + } + if let seq_of_DOMPointInit_or_Double: [DOMPointInit_or_Double] = value.fromJSValue() { + return .seq_of_DOMPointInit_or_Double(seq_of_DOMPointInit_or_Double) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .dOMPointInit(dOMPointInit): + return dOMPointInit.jsValue() + case let .double(double): + return double.jsValue() + case let .seq_of_DOMPointInit_or_Double(seq_of_DOMPointInit_or_Double): + return seq_of_DOMPointInit_or_Double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift index 80a5c90e..39f0991c 100644 --- a/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift +++ b/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class DisplayMediaStreamConstraints: BridgedDictionary { - public convenience init(video: __UNSUPPORTED_UNION__, audio: __UNSUPPORTED_UNION__) { + public convenience init(video: Bool_or_MediaTrackConstraints, audio: Bool_or_MediaTrackConstraints) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.video] = video.jsValue() object[Strings.audio] = audio.jsValue() @@ -18,8 +18,8 @@ public class DisplayMediaStreamConstraints: BridgedDictionary { } @ReadWriteAttribute - public var video: __UNSUPPORTED_UNION__ + public var video: Bool_or_MediaTrackConstraints @ReadWriteAttribute - public var audio: __UNSUPPORTED_UNION__ + public var audio: Bool_or_MediaTrackConstraints } diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 5142fb2f..754f5a8a 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -140,12 +140,12 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode return this[Strings.getElementsByClassName].function!(this: this, arguments: [classNames.jsValue()]).fromJSValue()! } - @inlinable public func createElement(localName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { + @inlinable public func createElement(localName: String, options: ElementCreationOptions_or_String? = nil) -> Element { let this = jsObject return this[Strings.createElement].function!(this: this, arguments: [localName.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } - @inlinable public func createElementNS(namespace: String?, qualifiedName: String, options: __UNSUPPORTED_UNION__? = nil) -> Element { + @inlinable public func createElementNS(namespace: String?, qualifiedName: String, options: ElementCreationOptions_or_String? = nil) -> Element { let this = jsObject return this[Strings.createElementNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift b/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift new file mode 100644 index 00000000..df0ca2f0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Document_or_DocumentFragment: ConvertibleToJSValue {} +extension Document: Any_Document_or_DocumentFragment {} +extension DocumentFragment: Any_Document_or_DocumentFragment {} + +public enum Document_or_DocumentFragment: JSValueCompatible, Any_Document_or_DocumentFragment { + case document(Document) + case documentFragment(DocumentFragment) + + public static func construct(from value: JSValue) -> Self? { + if let document: Document = value.fromJSValue() { + return .document(document) + } + if let documentFragment: DocumentFragment = value.fromJSValue() { + return .documentFragment(documentFragment) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .document(document): + return document.jsValue() + case let .documentFragment(documentFragment): + return documentFragment.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Document_or_Element.swift b/Sources/DOMKit/WebIDL/Document_or_Element.swift new file mode 100644 index 00000000..12aba790 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Document_or_Element.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Document_or_Element: ConvertibleToJSValue {} +extension Document: Any_Document_or_Element {} +extension Element: Any_Document_or_Element {} + +public enum Document_or_Element: JSValueCompatible, Any_Document_or_Element { + case document(Document) + case element(Element) + + public static func construct(from value: JSValue) -> Self? { + if let document: Document = value.fromJSValue() { + return .document(document) + } + if let element: Element = value.fromJSValue() { + return .element(element) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .document(document): + return document.jsValue() + case let .element(element): + return element.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift b/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift new file mode 100644 index 00000000..9000ea40 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Document_or_XMLHttpRequestBodyInit: ConvertibleToJSValue {} +extension Document: Any_Document_or_XMLHttpRequestBodyInit {} +extension XMLHttpRequestBodyInit: Any_Document_or_XMLHttpRequestBodyInit {} + +public enum Document_or_XMLHttpRequestBodyInit: JSValueCompatible, Any_Document_or_XMLHttpRequestBodyInit { + case document(Document) + case xMLHttpRequestBodyInit(XMLHttpRequestBodyInit) + + public static func construct(from value: JSValue) -> Self? { + if let document: Document = value.fromJSValue() { + return .document(document) + } + if let xMLHttpRequestBodyInit: XMLHttpRequestBodyInit = value.fromJSValue() { + return .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .document(document): + return document.jsValue() + case let .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit): + return xMLHttpRequestBodyInit.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift b/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift new file mode 100644 index 00000000..3587fd18 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Double_or_EffectTiming: ConvertibleToJSValue {} +extension Double: Any_Double_or_EffectTiming {} +extension EffectTiming: Any_Double_or_EffectTiming {} + +public enum Double_or_EffectTiming: JSValueCompatible, Any_Double_or_EffectTiming { + case double(Double) + case effectTiming(EffectTiming) + + public static func construct(from value: JSValue) -> Self? { + if let double: Double = value.fromJSValue() { + return .double(double) + } + if let effectTiming: EffectTiming = value.fromJSValue() { + return .effectTiming(effectTiming) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .double(double): + return double.jsValue() + case let .effectTiming(effectTiming): + return effectTiming.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift b/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift new file mode 100644 index 00000000..b570243d --- /dev/null +++ b/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Double_or_KeyframeAnimationOptions: ConvertibleToJSValue {} +extension Double: Any_Double_or_KeyframeAnimationOptions {} +extension KeyframeAnimationOptions: Any_Double_or_KeyframeAnimationOptions {} + +public enum Double_or_KeyframeAnimationOptions: JSValueCompatible, Any_Double_or_KeyframeAnimationOptions { + case double(Double) + case keyframeAnimationOptions(KeyframeAnimationOptions) + + public static func construct(from value: JSValue) -> Self? { + if let double: Double = value.fromJSValue() { + return .double(double) + } + if let keyframeAnimationOptions: KeyframeAnimationOptions = value.fromJSValue() { + return .keyframeAnimationOptions(keyframeAnimationOptions) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .double(double): + return double.jsValue() + case let .keyframeAnimationOptions(keyframeAnimationOptions): + return keyframeAnimationOptions.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift b/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift new file mode 100644 index 00000000..aaafd79d --- /dev/null +++ b/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Double_or_KeyframeEffectOptions: ConvertibleToJSValue {} +extension Double: Any_Double_or_KeyframeEffectOptions {} +extension KeyframeEffectOptions: Any_Double_or_KeyframeEffectOptions {} + +public enum Double_or_KeyframeEffectOptions: JSValueCompatible, Any_Double_or_KeyframeEffectOptions { + case double(Double) + case keyframeEffectOptions(KeyframeEffectOptions) + + public static func construct(from value: JSValue) -> Self? { + if let double: Double = value.fromJSValue() { + return .double(double) + } + if let keyframeEffectOptions: KeyframeEffectOptions = value.fromJSValue() { + return .keyframeEffectOptions(keyframeEffectOptions) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .double(double): + return double.jsValue() + case let .keyframeEffectOptions(keyframeEffectOptions): + return keyframeEffectOptions.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Double_or_String.swift b/Sources/DOMKit/WebIDL/Double_or_String.swift new file mode 100644 index 00000000..812c512e --- /dev/null +++ b/Sources/DOMKit/WebIDL/Double_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Double_or_String: ConvertibleToJSValue {} +extension Double: Any_Double_or_String {} +extension String: Any_Double_or_String {} + +public enum Double_or_String: JSValueCompatible, Any_Double_or_String { + case double(Double) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let double: Double = value.fromJSValue() { + return .double(double) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .double(double): + return double.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift b/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift new file mode 100644 index 00000000..7924a539 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Double_or_seq_of_Double: ConvertibleToJSValue {} +extension Double: Any_Double_or_seq_of_Double {} +extension Array: Any_Double_or_seq_of_Double where Element == Double {} + +public enum Double_or_seq_of_Double: JSValueCompatible, Any_Double_or_seq_of_Double { + case double(Double) + case seq_of_Double([Double]) + + public static func construct(from value: JSValue) -> Self? { + if let double: Double = value.fromJSValue() { + return .double(double) + } + if let seq_of_Double: [Double] = value.fromJSValue() { + return .seq_of_Double(seq_of_Double) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .double(double): + return double.jsValue() + case let .seq_of_Double(seq_of_Double): + return seq_of_Double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/EffectTiming.swift b/Sources/DOMKit/WebIDL/EffectTiming.swift index e418897f..ecf1a803 100644 --- a/Sources/DOMKit/WebIDL/EffectTiming.swift +++ b/Sources/DOMKit/WebIDL/EffectTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class EffectTiming: BridgedDictionary { - public convenience init(playbackRate: Double, duration: __UNSUPPORTED_UNION__, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String) { + public convenience init(playbackRate: Double, duration: CSSNumericValue_or_Double_or_String, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.playbackRate] = playbackRate.jsValue() object[Strings.duration] = duration.jsValue() @@ -35,7 +35,7 @@ public class EffectTiming: BridgedDictionary { public var playbackRate: Double @ReadWriteAttribute - public var duration: __UNSUPPORTED_UNION__ + public var duration: CSSNumericValue_or_Double_or_String @ReadWriteAttribute public var delay: Double diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index 17677b80..8795f9f4 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -85,7 +85,7 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc return this[Strings.isVisible].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - @inlinable public func scrollIntoView(arg: __UNSUPPORTED_UNION__? = nil) { + @inlinable public func scrollIntoView(arg: Bool_or_ScrollIntoViewOptions? = nil) { let this = jsObject _ = this[Strings.scrollIntoView].function!(this: this, arguments: [arg?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift new file mode 100644 index 00000000..5d407d46 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ElementCreationOptions_or_String: ConvertibleToJSValue {} +extension ElementCreationOptions: Any_ElementCreationOptions_or_String {} +extension String: Any_ElementCreationOptions_or_String {} + +public enum ElementCreationOptions_or_String: JSValueCompatible, Any_ElementCreationOptions_or_String { + case elementCreationOptions(ElementCreationOptions) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let elementCreationOptions: ElementCreationOptions = value.fromJSValue() { + return .elementCreationOptions(elementCreationOptions) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .elementCreationOptions(elementCreationOptions): + return elementCreationOptions.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index c3a1b217..6793b065 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -25,7 +25,7 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { @ReadonlyAttribute public var shadowRoot: ShadowRoot? - @inlinable public func setFormValue(value: __UNSUPPORTED_UNION__?, state: __UNSUPPORTED_UNION__? = nil) { + @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]) } diff --git a/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift b/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift new file mode 100644 index 00000000..e01e2996 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Element_or_HTMLCollection: ConvertibleToJSValue {} +extension Element: Any_Element_or_HTMLCollection {} +extension HTMLCollection: Any_Element_or_HTMLCollection {} + +public enum Element_or_HTMLCollection: JSValueCompatible, Any_Element_or_HTMLCollection { + case element(Element) + case hTMLCollection(HTMLCollection) + + public static func construct(from value: JSValue) -> Self? { + if let element: Element = value.fromJSValue() { + return .element(element) + } + if let hTMLCollection: HTMLCollection = value.fromJSValue() { + return .hTMLCollection(hTMLCollection) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .element(element): + return element.jsValue() + case let .hTMLCollection(hTMLCollection): + return hTMLCollection.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift new file mode 100644 index 00000000..809c59ea --- /dev/null +++ b/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Element_or_ProcessingInstruction: ConvertibleToJSValue {} +extension Element: Any_Element_or_ProcessingInstruction {} +extension ProcessingInstruction: Any_Element_or_ProcessingInstruction {} + +public enum Element_or_ProcessingInstruction: JSValueCompatible, Any_Element_or_ProcessingInstruction { + case element(Element) + case processingInstruction(ProcessingInstruction) + + public static func construct(from value: JSValue) -> Self? { + if let element: Element = value.fromJSValue() { + return .element(element) + } + if let processingInstruction: ProcessingInstruction = value.fromJSValue() { + return .processingInstruction(processingInstruction) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .element(element): + return element.jsValue() + case let .processingInstruction(processingInstruction): + return processingInstruction.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift b/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift new file mode 100644 index 00000000..0bd29e58 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Element_or_RadioNodeList: ConvertibleToJSValue {} +extension Element: Any_Element_or_RadioNodeList {} +extension RadioNodeList: Any_Element_or_RadioNodeList {} + +public enum Element_or_RadioNodeList: JSValueCompatible, Any_Element_or_RadioNodeList { + case element(Element) + case radioNodeList(RadioNodeList) + + public static func construct(from value: JSValue) -> Self? { + if let element: Element = value.fromJSValue() { + return .element(element) + } + if let radioNodeList: RadioNodeList = value.fromJSValue() { + return .radioNodeList(radioNodeList) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .element(element): + return element.jsValue() + case let .radioNodeList(radioNodeList): + return radioNodeList.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Element_or_Text.swift b/Sources/DOMKit/WebIDL/Element_or_Text.swift new file mode 100644 index 00000000..181db452 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Element_or_Text.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Element_or_Text: ConvertibleToJSValue {} +extension Element: Any_Element_or_Text {} +extension Text: Any_Element_or_Text {} + +public enum Element_or_Text: JSValueCompatible, Any_Element_or_Text { + case element(Element) + case text(Text) + + public static func construct(from value: JSValue) -> Self? { + if let element: Element = value.fromJSValue() { + return .element(element) + } + if let text: Text = value.fromJSValue() { + return .text(text) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .element(element): + return element.jsValue() + case let .text(text): + return text.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Event_or_String.swift b/Sources/DOMKit/WebIDL/Event_or_String.swift new file mode 100644 index 00000000..c7d24ff9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Event_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Event_or_String: ConvertibleToJSValue {} +extension Event: Any_Event_or_String {} +extension String: Any_Event_or_String {} + +public enum Event_or_String: JSValueCompatible, Any_Event_or_String { + case event(Event) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let event: Event = value.fromJSValue() { + return .event(event) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .event(event): + return event.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Event_or_Void.swift b/Sources/DOMKit/WebIDL/Event_or_Void.swift new file mode 100644 index 00000000..d84d9393 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Event_or_Void.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Event_or_Void: ConvertibleToJSValue {} +extension Event: Any_Event_or_Void {} +extension Void: Any_Event_or_Void {} + +public enum Event_or_Void: JSValueCompatible, Any_Event_or_Void { + case event(Event) + case void(Void) + + public static func construct(from value: JSValue) -> Self? { + if let event: Event = value.fromJSValue() { + return .event(event) + } + if let void: Void = value.fromJSValue() { + return .void(void) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .event(event): + return event.jsValue() + case let .void(void): + return void.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ExtendableMessageEventInit.swift b/Sources/DOMKit/WebIDL/ExtendableMessageEventInit.swift deleted file mode 100644 index 83c287ee..00000000 --- a/Sources/DOMKit/WebIDL/ExtendableMessageEventInit.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ExtendableMessageEventInit: BridgedDictionary { - public convenience init(data: JSValue, origin: String, lastEventId: String, source: __UNSUPPORTED_UNION__?, 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: __UNSUPPORTED_UNION__? - - @ReadWriteAttribute - public var ports: [MessagePort] -} diff --git a/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift b/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift index 9b776c34..01a6b3fe 100644 --- a/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift +++ b/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class FilePickerAcceptType: BridgedDictionary { - public convenience init(description: String, accept: [String: __UNSUPPORTED_UNION__]) { + public convenience init(description: String, accept: [String: String_or_seq_of_String]) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.description] = description.jsValue() object[Strings.accept] = accept.jsValue() @@ -21,5 +21,5 @@ public class FilePickerAcceptType: BridgedDictionary { public var description: String @ReadWriteAttribute - public var accept: [String: __UNSUPPORTED_UNION__] + public var accept: [String: String_or_seq_of_String] } diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index ef22f890..db62eef3 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -58,7 +58,7 @@ public class FileReader: EventTarget { public var readyState: UInt16 @ReadonlyAttribute - public var result: __UNSUPPORTED_UNION__? + public var result: ArrayBuffer_or_String? @ReadonlyAttribute public var error: DOMException? diff --git a/Sources/DOMKit/WebIDL/FileSystemHandle_or_WellKnownDirectory.swift b/Sources/DOMKit/WebIDL/FileSystemHandle_or_WellKnownDirectory.swift new file mode 100644 index 00000000..9a547a26 --- /dev/null +++ b/Sources/DOMKit/WebIDL/FileSystemHandle_or_WellKnownDirectory.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_FileSystemHandle_or_WellKnownDirectory: ConvertibleToJSValue {} +extension FileSystemHandle: Any_FileSystemHandle_or_WellKnownDirectory {} +extension WellKnownDirectory: Any_FileSystemHandle_or_WellKnownDirectory {} + +public enum FileSystemHandle_or_WellKnownDirectory: JSValueCompatible, Any_FileSystemHandle_or_WellKnownDirectory { + case fileSystemHandle(FileSystemHandle) + case wellKnownDirectory(WellKnownDirectory) + + public static func construct(from value: JSValue) -> Self? { + if let fileSystemHandle: FileSystemHandle = value.fromJSValue() { + return .fileSystemHandle(fileSystemHandle) + } + if let wellKnownDirectory: WellKnownDirectory = value.fromJSValue() { + return .wellKnownDirectory(wellKnownDirectory) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .fileSystemHandle(fileSystemHandle): + return fileSystemHandle.jsValue() + case let .wellKnownDirectory(wellKnownDirectory): + return wellKnownDirectory.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift b/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift new file mode 100644 index 00000000..af75dbab --- /dev/null +++ b/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_File_or_FormData_or_String: ConvertibleToJSValue {} +extension File: Any_File_or_FormData_or_String {} +extension FormData: Any_File_or_FormData_or_String {} +extension String: Any_File_or_FormData_or_String {} + +public enum File_or_FormData_or_String: JSValueCompatible, Any_File_or_FormData_or_String { + case file(File) + case formData(FormData) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let file: File = value.fromJSValue() { + return .file(file) + } + if let formData: FormData = value.fromJSValue() { + return .formData(formData) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .file(file): + return file.jsValue() + case let .formData(formData): + return formData.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/File_or_String.swift b/Sources/DOMKit/WebIDL/File_or_String.swift new file mode 100644 index 00000000..7cb1de64 --- /dev/null +++ b/Sources/DOMKit/WebIDL/File_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_File_or_String: ConvertibleToJSValue {} +extension File: Any_File_or_String {} +extension String: Any_File_or_String {} + +public enum File_or_String: JSValueCompatible, Any_File_or_String { + case file(File) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let file: File = value.fromJSValue() { + return .file(file) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .file(file): + return file.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Float32Array_or_seq_of_GLfloat.swift b/Sources/DOMKit/WebIDL/Float32Array_or_seq_of_GLfloat.swift new file mode 100644 index 00000000..a8713dc8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Float32Array_or_seq_of_GLfloat.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Float32Array_or_seq_of_GLfloat: ConvertibleToJSValue {} +extension Float32Array: Any_Float32Array_or_seq_of_GLfloat {} +extension Array: Any_Float32Array_or_seq_of_GLfloat where Element == GLfloat {} + +public enum Float32Array_or_seq_of_GLfloat: JSValueCompatible, Any_Float32Array_or_seq_of_GLfloat { + case float32Array(Float32Array) + case seq_of_GLfloat([GLfloat]) + + 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 func 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/FontFace.swift b/Sources/DOMKit/WebIDL/FontFace.swift index 571ce973..514e2620 100644 --- a/Sources/DOMKit/WebIDL/FontFace.swift +++ b/Sources/DOMKit/WebIDL/FontFace.swift @@ -29,7 +29,7 @@ public class FontFace: JSBridgedClass { self.jsObject = jsObject } - @inlinable public convenience init(family: String, source: __UNSUPPORTED_UNION__, descriptors: FontFaceDescriptors? = nil) { + @inlinable public convenience init(family: String, source: BinaryData_or_String, descriptors: FontFaceDescriptors? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [family.jsValue(), source.jsValue(), descriptors?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/FragmentResultOptions.swift b/Sources/DOMKit/WebIDL/FragmentResultOptions.swift deleted file mode 100644 index 5ea7333c..00000000 --- a/Sources/DOMKit/WebIDL/FragmentResultOptions.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FragmentResultOptions: BridgedDictionary { - public convenience init(inlineSize: Double, blockSize: Double, autoBlockSize: Double, childFragments: [LayoutFragment], data: JSValue, breakToken: BreakTokenOptions) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.inlineSize] = inlineSize.jsValue() - object[Strings.blockSize] = blockSize.jsValue() - object[Strings.autoBlockSize] = autoBlockSize.jsValue() - object[Strings.childFragments] = childFragments.jsValue() - object[Strings.data] = data.jsValue() - object[Strings.breakToken] = breakToken.jsValue() - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _inlineSize = ReadWriteAttribute(jsObject: object, name: Strings.inlineSize) - _blockSize = ReadWriteAttribute(jsObject: object, name: Strings.blockSize) - _autoBlockSize = ReadWriteAttribute(jsObject: object, name: Strings.autoBlockSize) - _childFragments = ReadWriteAttribute(jsObject: object, name: Strings.childFragments) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - _breakToken = ReadWriteAttribute(jsObject: object, name: Strings.breakToken) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var inlineSize: Double - - @ReadWriteAttribute - public var blockSize: Double - - @ReadWriteAttribute - public var autoBlockSize: Double - - @ReadWriteAttribute - public var childFragments: [LayoutFragment] - - @ReadWriteAttribute - public var data: JSValue - - @ReadWriteAttribute - public var breakToken: BreakTokenOptions -} diff --git a/Sources/DOMKit/WebIDL/GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView.swift b/Sources/DOMKit/WebIDL/GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView.swift new file mode 100644 index 00000000..5a7364af --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView: ConvertibleToJSValue {} +extension GPUBufferBinding: Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView {} +extension GPUExternalTexture: Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView {} +extension GPUSampler: Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView {} +extension GPUTextureView: Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView {} + +public enum GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView: JSValueCompatible, Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView { + case gPUBufferBinding(GPUBufferBinding) + case gPUExternalTexture(GPUExternalTexture) + case gPUSampler(GPUSampler) + case gPUTextureView(GPUTextureView) + + public static func construct(from value: JSValue) -> Self? { + if let gPUBufferBinding: GPUBufferBinding = value.fromJSValue() { + return .gPUBufferBinding(gPUBufferBinding) + } + if let gPUExternalTexture: GPUExternalTexture = value.fromJSValue() { + return .gPUExternalTexture(gPUExternalTexture) + } + if let gPUSampler: GPUSampler = value.fromJSValue() { + return .gPUSampler(gPUSampler) + } + if let gPUTextureView: GPUTextureView = value.fromJSValue() { + return .gPUTextureView(gPUTextureView) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUBufferBinding(gPUBufferBinding): + return gPUBufferBinding.jsValue() + case let .gPUExternalTexture(gPUExternalTexture): + return gPUExternalTexture.jsValue() + case let .gPUSampler(gPUSampler): + return gPUSampler.jsValue() + case let .gPUTextureView(gPUTextureView): + return gPUTextureView.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift b/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift new file mode 100644 index 00000000..6551bc7c --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUBuffer_or_WebGLBuffer: ConvertibleToJSValue {} +extension GPUBuffer: Any_GPUBuffer_or_WebGLBuffer {} +extension WebGLBuffer: Any_GPUBuffer_or_WebGLBuffer {} + +public enum GPUBuffer_or_WebGLBuffer: JSValueCompatible, Any_GPUBuffer_or_WebGLBuffer { + case gPUBuffer(GPUBuffer) + case webGLBuffer(WebGLBuffer) + + public static func construct(from value: JSValue) -> Self? { + if let gPUBuffer: GPUBuffer = value.fromJSValue() { + return .gPUBuffer(gPUBuffer) + } + if let webGLBuffer: WebGLBuffer = value.fromJSValue() { + return .webGLBuffer(webGLBuffer) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUBuffer(gPUBuffer): + return gPUBuffer.jsValue() + case let .webGLBuffer(webGLBuffer): + return webGLBuffer.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift index 053b04e5..d395a114 100644 --- a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift +++ b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift @@ -14,7 +14,7 @@ public class GPUCanvasContext: JSBridgedClass { } @ReadonlyAttribute - public var canvas: __UNSUPPORTED_UNION__ + public var canvas: HTMLCanvasElement_or_OffscreenCanvas @inlinable public func configure(configuration: GPUCanvasConfiguration) { let this = jsObject diff --git a/Sources/DOMKit/WebIDL/GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift new file mode 100644 index 00000000..4f2de66a --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift @@ -0,0 +1,53 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext: ConvertibleToJSValue {} +extension GPUCanvasContext: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +extension ImageBitmapRenderingContext: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +extension OffscreenCanvasRenderingContext2D: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +extension WebGL2RenderingContext: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +extension WebGLRenderingContext: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} + +public enum GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext: JSValueCompatible, Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext { + case gPUCanvasContext(GPUCanvasContext) + case imageBitmapRenderingContext(ImageBitmapRenderingContext) + case offscreenCanvasRenderingContext2D(OffscreenCanvasRenderingContext2D) + case webGL2RenderingContext(WebGL2RenderingContext) + case webGLRenderingContext(WebGLRenderingContext) + + public static func construct(from value: JSValue) -> Self? { + if let gPUCanvasContext: GPUCanvasContext = value.fromJSValue() { + return .gPUCanvasContext(gPUCanvasContext) + } + if let imageBitmapRenderingContext: ImageBitmapRenderingContext = value.fromJSValue() { + return .imageBitmapRenderingContext(imageBitmapRenderingContext) + } + if let offscreenCanvasRenderingContext2D: OffscreenCanvasRenderingContext2D = value.fromJSValue() { + return .offscreenCanvasRenderingContext2D(offscreenCanvasRenderingContext2D) + } + if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { + return .webGL2RenderingContext(webGL2RenderingContext) + } + if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { + return .webGLRenderingContext(webGLRenderingContext) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUCanvasContext(gPUCanvasContext): + return gPUCanvasContext.jsValue() + case let .imageBitmapRenderingContext(imageBitmapRenderingContext): + return imageBitmapRenderingContext.jsValue() + case let .offscreenCanvasRenderingContext2D(offscreenCanvasRenderingContext2D): + return offscreenCanvasRenderingContext2D.jsValue() + case let .webGL2RenderingContext(webGL2RenderingContext): + return webGL2RenderingContext.jsValue() + case let .webGLRenderingContext(webGLRenderingContext): + return webGLRenderingContext.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUColorDict_or_seq_of_Double.swift b/Sources/DOMKit/WebIDL/GPUColorDict_or_seq_of_Double.swift new file mode 100644 index 00000000..23a899b3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUColorDict_or_seq_of_Double.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUColorDict_or_seq_of_Double: ConvertibleToJSValue {} +extension GPUColorDict: Any_GPUColorDict_or_seq_of_Double {} +extension Array: Any_GPUColorDict_or_seq_of_Double where Element == Double {} + +public enum GPUColorDict_or_seq_of_Double: JSValueCompatible, Any_GPUColorDict_or_seq_of_Double { + case gPUColorDict(GPUColorDict) + case seq_of_Double([Double]) + + public static func construct(from value: JSValue) -> Self? { + if let gPUColorDict: GPUColorDict = value.fromJSValue() { + return .gPUColorDict(gPUColorDict) + } + if let seq_of_Double: [Double] = value.fromJSValue() { + return .seq_of_Double(seq_of_Double) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUColorDict(gPUColorDict): + return gPUColorDict.jsValue() + case let .seq_of_Double(seq_of_Double): + return seq_of_Double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift index de804eed..6e75a0e8 100644 --- a/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift +++ b/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift @@ -15,7 +15,7 @@ public class GPUDeviceLostInfo: JSBridgedClass { } @ReadonlyAttribute - public var reason: __UNSUPPORTED_UNION__ + public var reason: GPUDeviceLostReason_or_Void @ReadonlyAttribute public var message: String diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostReason_or_Void.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostReason_or_Void.swift new file mode 100644 index 00000000..a7662c5e --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUDeviceLostReason_or_Void.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUDeviceLostReason_or_Void: ConvertibleToJSValue {} +extension GPUDeviceLostReason: Any_GPUDeviceLostReason_or_Void {} +extension Void: Any_GPUDeviceLostReason_or_Void {} + +public enum GPUDeviceLostReason_or_Void: JSValueCompatible, Any_GPUDeviceLostReason_or_Void { + case gPUDeviceLostReason(GPUDeviceLostReason) + case void(Void) + + public static func construct(from value: JSValue) -> Self? { + if let gPUDeviceLostReason: GPUDeviceLostReason = value.fromJSValue() { + return .gPUDeviceLostReason(gPUDeviceLostReason) + } + if let void: Void = value.fromJSValue() { + return .void(void) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUDeviceLostReason(gPUDeviceLostReason): + return gPUDeviceLostReason.jsValue() + case let .void(void): + return void.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate.swift b/Sources/DOMKit/WebIDL/GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate.swift new file mode 100644 index 00000000..70ee7407 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate: ConvertibleToJSValue {} +extension GPUExtent3DDict: Any_GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate {} +extension Array: Any_GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate where Element == GPUIntegerCoordinate {} + +public enum GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate: JSValueCompatible, Any_GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate { + case gPUExtent3DDict(GPUExtent3DDict) + case seq_of_GPUIntegerCoordinate([GPUIntegerCoordinate]) + + public static func construct(from value: JSValue) -> Self? { + if let gPUExtent3DDict: GPUExtent3DDict = value.fromJSValue() { + return .gPUExtent3DDict(gPUExtent3DDict) + } + if let seq_of_GPUIntegerCoordinate: [GPUIntegerCoordinate] = value.fromJSValue() { + return .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUExtent3DDict(gPUExtent3DDict): + return gPUExtent3DDict.jsValue() + case let .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate): + return seq_of_GPUIntegerCoordinate.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift b/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift index 74bffea5..f84927cc 100644 --- a/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift +++ b/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class GPUImageCopyExternalImage: BridgedDictionary { - public convenience init(source: __UNSUPPORTED_UNION__, origin: GPUOrigin2D, flipY: Bool) { + public convenience init(source: HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas, origin: GPUOrigin2D, flipY: Bool) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.source] = source.jsValue() object[Strings.origin] = origin.jsValue() @@ -20,7 +20,7 @@ public class GPUImageCopyExternalImage: BridgedDictionary { } @ReadWriteAttribute - public var source: __UNSUPPORTED_UNION__ + public var source: HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas @ReadWriteAttribute public var origin: GPUOrigin2D diff --git a/Sources/DOMKit/WebIDL/GPUObjectBase.swift b/Sources/DOMKit/WebIDL/GPUObjectBase.swift index 00059c2d..03d01013 100644 --- a/Sources/DOMKit/WebIDL/GPUObjectBase.swift +++ b/Sources/DOMKit/WebIDL/GPUObjectBase.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol GPUObjectBase: JSBridgedClass {} public extension GPUObjectBase { - @inlinable var label: __UNSUPPORTED_UNION__ { + @inlinable var label: String_or_Void { get { ReadWriteAttribute[Strings.label, in: jsObject] } nonmutating set { ReadWriteAttribute[Strings.label, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate.swift b/Sources/DOMKit/WebIDL/GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate.swift new file mode 100644 index 00000000..ac71d7ed --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate: ConvertibleToJSValue {} +extension GPUOrigin2DDict: Any_GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate {} +extension Array: Any_GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate where Element == GPUIntegerCoordinate {} + +public enum GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate: JSValueCompatible, Any_GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate { + case gPUOrigin2DDict(GPUOrigin2DDict) + case seq_of_GPUIntegerCoordinate([GPUIntegerCoordinate]) + + public static func construct(from value: JSValue) -> Self? { + if let gPUOrigin2DDict: GPUOrigin2DDict = value.fromJSValue() { + return .gPUOrigin2DDict(gPUOrigin2DDict) + } + if let seq_of_GPUIntegerCoordinate: [GPUIntegerCoordinate] = value.fromJSValue() { + return .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUOrigin2DDict(gPUOrigin2DDict): + return gPUOrigin2DDict.jsValue() + case let .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate): + return seq_of_GPUIntegerCoordinate.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate.swift b/Sources/DOMKit/WebIDL/GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate.swift new file mode 100644 index 00000000..2b875d0d --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate: ConvertibleToJSValue {} +extension GPUOrigin3DDict: Any_GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate {} +extension Array: Any_GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate where Element == GPUIntegerCoordinate {} + +public enum GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate: JSValueCompatible, Any_GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate { + case gPUOrigin3DDict(GPUOrigin3DDict) + case seq_of_GPUIntegerCoordinate([GPUIntegerCoordinate]) + + public static func construct(from value: JSValue) -> Self? { + if let gPUOrigin3DDict: GPUOrigin3DDict = value.fromJSValue() { + return .gPUOrigin3DDict(gPUOrigin3DDict) + } + if let seq_of_GPUIntegerCoordinate: [GPUIntegerCoordinate] = value.fromJSValue() { + return .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUOrigin3DDict(gPUOrigin3DDict): + return gPUOrigin3DDict.jsValue() + case let .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate): + return seq_of_GPUIntegerCoordinate.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError_or_GPUValidationError.swift b/Sources/DOMKit/WebIDL/GPUOutOfMemoryError_or_GPUValidationError.swift new file mode 100644 index 00000000..b8ec1293 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUOutOfMemoryError_or_GPUValidationError.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUOutOfMemoryError_or_GPUValidationError: ConvertibleToJSValue {} +extension GPUOutOfMemoryError: Any_GPUOutOfMemoryError_or_GPUValidationError {} +extension GPUValidationError: Any_GPUOutOfMemoryError_or_GPUValidationError {} + +public enum GPUOutOfMemoryError_or_GPUValidationError: JSValueCompatible, Any_GPUOutOfMemoryError_or_GPUValidationError { + case gPUOutOfMemoryError(GPUOutOfMemoryError) + case gPUValidationError(GPUValidationError) + + public static func construct(from value: JSValue) -> Self? { + if let gPUOutOfMemoryError: GPUOutOfMemoryError = value.fromJSValue() { + return .gPUOutOfMemoryError(gPUOutOfMemoryError) + } + if let gPUValidationError: GPUValidationError = value.fromJSValue() { + return .gPUValidationError(gPUValidationError) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUOutOfMemoryError(gPUOutOfMemoryError): + return gPUOutOfMemoryError.jsValue() + case let .gPUValidationError(gPUValidationError): + return gPUValidationError.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GPUTexture_or_MLBufferView_or_WebGLTexture.swift b/Sources/DOMKit/WebIDL/GPUTexture_or_MLBufferView_or_WebGLTexture.swift new file mode 100644 index 00000000..6b91f2c5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/GPUTexture_or_MLBufferView_or_WebGLTexture.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_GPUTexture_or_MLBufferView_or_WebGLTexture: ConvertibleToJSValue {} +extension GPUTexture: Any_GPUTexture_or_MLBufferView_or_WebGLTexture {} +extension MLBufferView: Any_GPUTexture_or_MLBufferView_or_WebGLTexture {} +extension WebGLTexture: Any_GPUTexture_or_MLBufferView_or_WebGLTexture {} + +public enum GPUTexture_or_MLBufferView_or_WebGLTexture: JSValueCompatible, Any_GPUTexture_or_MLBufferView_or_WebGLTexture { + case gPUTexture(GPUTexture) + case mLBufferView(MLBufferView) + case webGLTexture(WebGLTexture) + + public static func construct(from value: JSValue) -> Self? { + if let gPUTexture: GPUTexture = value.fromJSValue() { + return .gPUTexture(gPUTexture) + } + if let mLBufferView: MLBufferView = value.fromJSValue() { + return .mLBufferView(mLBufferView) + } + if let webGLTexture: WebGLTexture = value.fromJSValue() { + return .webGLTexture(webGLTexture) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .gPUTexture(gPUTexture): + return gPUTexture.jsValue() + case let .mLBufferView(mLBufferView): + return mLBufferView.jsValue() + case let .webGLTexture(webGLTexture): + return webGLTexture.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/GroupEffect.swift b/Sources/DOMKit/WebIDL/GroupEffect.swift index 515ad56b..8d3a05b7 100644 --- a/Sources/DOMKit/WebIDL/GroupEffect.swift +++ b/Sources/DOMKit/WebIDL/GroupEffect.swift @@ -15,7 +15,7 @@ public class GroupEffect: JSBridgedClass { self.jsObject = jsObject } - @inlinable public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(children: [AnimationEffect]?, timing: Double_or_EffectTiming? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue(), timing?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift index efab9b12..ece3affa 100644 --- a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -20,11 +20,11 @@ public class HTMLAllCollection: JSBridgedClass { jsObject[key].fromJSValue()! } - @inlinable public subscript(key: String) -> __UNSUPPORTED_UNION__? { + @inlinable public subscript(key: String) -> Element_or_HTMLCollection? { jsObject[key].fromJSValue() } - @inlinable public func item(nameOrIndex: String? = nil) -> __UNSUPPORTED_UNION__? { + @inlinable public func item(nameOrIndex: String? = nil) -> Element_or_HTMLCollection? { let this = jsObject return this[Strings.item].function!(this: this, arguments: [nameOrIndex?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame.swift new file mode 100644 index 00000000..34515e6b --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame.swift @@ -0,0 +1,67 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame: ConvertibleToJSValue {} +extension HTMLCanvasElement: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} +extension HTMLImageElement: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} +extension HTMLVideoElement: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} +extension ImageBitmap: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} +extension ImageData: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} +extension OffscreenCanvas: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} +extension VideoFrame: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} + +public enum HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame: JSValueCompatible, Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame { + case hTMLCanvasElement(HTMLCanvasElement) + case hTMLImageElement(HTMLImageElement) + case hTMLVideoElement(HTMLVideoElement) + case imageBitmap(ImageBitmap) + case imageData(ImageData) + case offscreenCanvas(OffscreenCanvas) + case videoFrame(VideoFrame) + + 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 func 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/HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame.swift new file mode 100644 index 00000000..ab1ac02d --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame: ConvertibleToJSValue {} +extension HTMLCanvasElement: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} +extension HTMLOrSVGImageElement: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} +extension HTMLVideoElement: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} +extension ImageBitmap: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} +extension OffscreenCanvas: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} +extension VideoFrame: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} + +public enum HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame: JSValueCompatible, Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame { + case hTMLCanvasElement(HTMLCanvasElement) + case hTMLOrSVGImageElement(HTMLOrSVGImageElement) + case hTMLVideoElement(HTMLVideoElement) + case imageBitmap(ImageBitmap) + case offscreenCanvas(OffscreenCanvas) + case videoFrame(VideoFrame) + + public static func construct(from value: JSValue) -> Self? { + if let hTMLCanvasElement: HTMLCanvasElement = value.fromJSValue() { + return .hTMLCanvasElement(hTMLCanvasElement) + } + if let hTMLOrSVGImageElement: HTMLOrSVGImageElement = value.fromJSValue() { + return .hTMLOrSVGImageElement(hTMLOrSVGImageElement) + } + if let hTMLVideoElement: HTMLVideoElement = value.fromJSValue() { + return .hTMLVideoElement(hTMLVideoElement) + } + if let imageBitmap: ImageBitmap = value.fromJSValue() { + return .imageBitmap(imageBitmap) + } + if let offscreenCanvas: OffscreenCanvas = value.fromJSValue() { + return .offscreenCanvas(offscreenCanvas) + } + if let videoFrame: VideoFrame = value.fromJSValue() { + return .videoFrame(videoFrame) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .hTMLCanvasElement(hTMLCanvasElement): + return hTMLCanvasElement.jsValue() + case let .hTMLOrSVGImageElement(hTMLOrSVGImageElement): + return hTMLOrSVGImageElement.jsValue() + case let .hTMLVideoElement(hTMLVideoElement): + return hTMLVideoElement.jsValue() + case let .imageBitmap(imageBitmap): + return imageBitmap.jsValue() + case let .offscreenCanvas(offscreenCanvas): + return offscreenCanvas.jsValue() + case let .videoFrame(videoFrame): + return videoFrame.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift new file mode 100644 index 00000000..a7c6c1ef --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas: ConvertibleToJSValue {} +extension HTMLCanvasElement: Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas {} +extension ImageBitmap: Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas {} +extension OffscreenCanvas: Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas {} + +public enum HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas: JSValueCompatible, Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas { + case hTMLCanvasElement(HTMLCanvasElement) + case imageBitmap(ImageBitmap) + case offscreenCanvas(OffscreenCanvas) + + public static func construct(from value: JSValue) -> Self? { + if let hTMLCanvasElement: HTMLCanvasElement = value.fromJSValue() { + return .hTMLCanvasElement(hTMLCanvasElement) + } + if let imageBitmap: ImageBitmap = value.fromJSValue() { + return .imageBitmap(imageBitmap) + } + if let offscreenCanvas: OffscreenCanvas = value.fromJSValue() { + return .offscreenCanvas(offscreenCanvas) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .hTMLCanvasElement(hTMLCanvasElement): + return hTMLCanvasElement.jsValue() + case let .imageBitmap(imageBitmap): + return imageBitmap.jsValue() + case let .offscreenCanvas(offscreenCanvas): + return offscreenCanvas.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift new file mode 100644 index 00000000..897163ec --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_HTMLCanvasElement_or_OffscreenCanvas: ConvertibleToJSValue {} +extension HTMLCanvasElement: Any_HTMLCanvasElement_or_OffscreenCanvas {} +extension OffscreenCanvas: Any_HTMLCanvasElement_or_OffscreenCanvas {} + +public enum HTMLCanvasElement_or_OffscreenCanvas: JSValueCompatible, Any_HTMLCanvasElement_or_OffscreenCanvas { + case hTMLCanvasElement(HTMLCanvasElement) + case offscreenCanvas(OffscreenCanvas) + + public static func construct(from value: JSValue) -> Self? { + if let hTMLCanvasElement: HTMLCanvasElement = value.fromJSValue() { + return .hTMLCanvasElement(hTMLCanvasElement) + } + if let offscreenCanvas: OffscreenCanvas = value.fromJSValue() { + return .offscreenCanvas(offscreenCanvas) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .hTMLCanvasElement(hTMLCanvasElement): + return hTMLCanvasElement.jsValue() + case let .offscreenCanvas(offscreenCanvas): + return offscreenCanvas.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift b/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift new file mode 100644 index 00000000..4ffeb88b --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_HTMLElement_or_Int32: ConvertibleToJSValue {} +extension HTMLElement: Any_HTMLElement_or_Int32 {} +extension Int32: Any_HTMLElement_or_Int32 {} + +public enum HTMLElement_or_Int32: JSValueCompatible, Any_HTMLElement_or_Int32 { + case hTMLElement(HTMLElement) + case int32(Int32) + + public static func construct(from value: JSValue) -> Self? { + if let hTMLElement: HTMLElement = value.fromJSValue() { + return .hTMLElement(hTMLElement) + } + if let int32: Int32 = value.fromJSValue() { + return .int32(int32) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .hTMLElement(hTMLElement): + return hTMLElement.jsValue() + case let .int32(int32): + return int32.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift index cd07cc57..bc0a9c1e 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormControlsCollection.swift @@ -10,7 +10,7 @@ public class HTMLFormControlsCollection: HTMLCollection { super.init(unsafelyWrapping: jsObject) } - @inlinable public subscript(key: String) -> __UNSUPPORTED_UNION__? { + @inlinable public subscript(key: String) -> Element_or_RadioNodeList? { jsObject[key].fromJSValue() } } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index 3a6e095d..74b525d5 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -70,7 +70,7 @@ public class HTMLFormElement: HTMLElement { jsObject[key].fromJSValue()! } - @inlinable public subscript(key: String) -> __UNSUPPORTED_UNION__ { + @inlinable public subscript(key: String) -> Element_or_RadioNodeList { jsObject[key].fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement_or_PasswordCredentialData.swift b/Sources/DOMKit/WebIDL/HTMLFormElement_or_PasswordCredentialData.swift new file mode 100644 index 00000000..fa7e188a --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLFormElement_or_PasswordCredentialData.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_HTMLFormElement_or_PasswordCredentialData: ConvertibleToJSValue {} +extension HTMLFormElement: Any_HTMLFormElement_or_PasswordCredentialData {} +extension PasswordCredentialData: Any_HTMLFormElement_or_PasswordCredentialData {} + +public enum HTMLFormElement_or_PasswordCredentialData: JSValueCompatible, Any_HTMLFormElement_or_PasswordCredentialData { + case hTMLFormElement(HTMLFormElement) + case passwordCredentialData(PasswordCredentialData) + + public static func construct(from value: JSValue) -> Self? { + if let hTMLFormElement: HTMLFormElement = value.fromJSValue() { + return .hTMLFormElement(hTMLFormElement) + } + if let passwordCredentialData: PasswordCredentialData = value.fromJSValue() { + return .passwordCredentialData(passwordCredentialData) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .hTMLFormElement(hTMLFormElement): + return hTMLFormElement.jsValue() + case let .passwordCredentialData(passwordCredentialData): + return passwordCredentialData.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement_or_SVGImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement_or_SVGImageElement.swift new file mode 100644 index 00000000..7386fff0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLImageElement_or_SVGImageElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_HTMLImageElement_or_SVGImageElement: ConvertibleToJSValue {} +extension HTMLImageElement: Any_HTMLImageElement_or_SVGImageElement {} +extension SVGImageElement: Any_HTMLImageElement_or_SVGImageElement {} + +public enum HTMLImageElement_or_SVGImageElement: JSValueCompatible, Any_HTMLImageElement_or_SVGImageElement { + case hTMLImageElement(HTMLImageElement) + case sVGImageElement(SVGImageElement) + + public static func construct(from value: JSValue) -> Self? { + if let hTMLImageElement: HTMLImageElement = value.fromJSValue() { + return .hTMLImageElement(hTMLImageElement) + } + if let sVGImageElement: SVGImageElement = value.fromJSValue() { + return .sVGImageElement(sVGImageElement) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .hTMLImageElement(hTMLImageElement): + return hTMLImageElement.jsValue() + case let .sVGImageElement(sVGImageElement): + return sVGImageElement.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift new file mode 100644 index 00000000..4afea7b5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_HTMLOptGroupElement_or_HTMLOptionElement: ConvertibleToJSValue {} +extension HTMLOptGroupElement: Any_HTMLOptGroupElement_or_HTMLOptionElement {} +extension HTMLOptionElement: Any_HTMLOptGroupElement_or_HTMLOptionElement {} + +public enum HTMLOptGroupElement_or_HTMLOptionElement: JSValueCompatible, Any_HTMLOptGroupElement_or_HTMLOptionElement { + case hTMLOptGroupElement(HTMLOptGroupElement) + case hTMLOptionElement(HTMLOptionElement) + + public static func construct(from value: JSValue) -> Self? { + if let hTMLOptGroupElement: HTMLOptGroupElement = value.fromJSValue() { + return .hTMLOptGroupElement(hTMLOptGroupElement) + } + if let hTMLOptionElement: HTMLOptionElement = value.fromJSValue() { + return .hTMLOptionElement(hTMLOptionElement) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .hTMLOptGroupElement(hTMLOptGroupElement): + return hTMLOptGroupElement.jsValue() + case let .hTMLOptionElement(hTMLOptionElement): + return hTMLOptionElement.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift index d0c2357c..5686130b 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -20,7 +20,7 @@ public class HTMLOptionsCollection: HTMLCollection { // XXX: unsupported setter for keys of type UInt32 - @inlinable public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { + @inlinable public func add(element: HTMLOptGroupElement_or_HTMLOptionElement, before: HTMLElement_or_Int32? = nil) { let this = jsObject _ = this[Strings.add].function!(this: this, arguments: [element.jsValue(), before?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement_or_SVGScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement_or_SVGScriptElement.swift new file mode 100644 index 00000000..49ab6bf3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement_or_SVGScriptElement.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_HTMLScriptElement_or_SVGScriptElement: ConvertibleToJSValue {} +extension HTMLScriptElement: Any_HTMLScriptElement_or_SVGScriptElement {} +extension SVGScriptElement: Any_HTMLScriptElement_or_SVGScriptElement {} + +public enum HTMLScriptElement_or_SVGScriptElement: JSValueCompatible, Any_HTMLScriptElement_or_SVGScriptElement { + case hTMLScriptElement(HTMLScriptElement) + case sVGScriptElement(SVGScriptElement) + + public static func construct(from value: JSValue) -> Self? { + if let hTMLScriptElement: HTMLScriptElement = value.fromJSValue() { + return .hTMLScriptElement(hTMLScriptElement) + } + if let sVGScriptElement: SVGScriptElement = value.fromJSValue() { + return .sVGScriptElement(sVGScriptElement) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .hTMLScriptElement(hTMLScriptElement): + return hTMLScriptElement.jsValue() + case let .sVGScriptElement(sVGScriptElement): + return sVGScriptElement.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index ada3af87..e994fafa 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -70,7 +70,7 @@ public class HTMLSelectElement: HTMLElement { return this[Strings.namedItem].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - @inlinable public func add(element: __UNSUPPORTED_UNION__, before: __UNSUPPORTED_UNION__? = nil) { + @inlinable public func add(element: HTMLOptGroupElement_or_HTMLOptionElement, before: HTMLElement_or_Int32? = nil) { let this = jsObject _ = this[Strings.add].function!(this: this, arguments: [element.jsValue(), before?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index c7a2a629..6ac1c098 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -28,7 +28,7 @@ public class HTMLSlotElement: HTMLElement { return this[Strings.assignedElements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! } - @inlinable public func assign(nodes: __UNSUPPORTED_UNION__...) { + @inlinable public func assign(nodes: Element_or_Text...) { let this = jsObject _ = this[Strings.assign].function!(this: this, arguments: nodes.map { $0.jsValue() }) } diff --git a/Sources/DOMKit/WebIDL/IDBCursor.swift b/Sources/DOMKit/WebIDL/IDBCursor.swift index 68a6c8b2..4f28c0b4 100644 --- a/Sources/DOMKit/WebIDL/IDBCursor.swift +++ b/Sources/DOMKit/WebIDL/IDBCursor.swift @@ -18,7 +18,7 @@ public class IDBCursor: JSBridgedClass { } @ReadonlyAttribute - public var source: __UNSUPPORTED_UNION__ + public var source: IDBIndex_or_IDBObjectStore @ReadonlyAttribute public var direction: IDBCursorDirection diff --git a/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift new file mode 100644 index 00000000..9a418408 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_IDBCursor_or_IDBIndex_or_IDBObjectStore: ConvertibleToJSValue {} +extension IDBCursor: Any_IDBCursor_or_IDBIndex_or_IDBObjectStore {} +extension IDBIndex: Any_IDBCursor_or_IDBIndex_or_IDBObjectStore {} +extension IDBObjectStore: Any_IDBCursor_or_IDBIndex_or_IDBObjectStore {} + +public enum IDBCursor_or_IDBIndex_or_IDBObjectStore: JSValueCompatible, Any_IDBCursor_or_IDBIndex_or_IDBObjectStore { + case iDBCursor(IDBCursor) + case iDBIndex(IDBIndex) + case iDBObjectStore(IDBObjectStore) + + public static func construct(from value: JSValue) -> Self? { + if let iDBCursor: IDBCursor = value.fromJSValue() { + return .iDBCursor(iDBCursor) + } + if let iDBIndex: IDBIndex = value.fromJSValue() { + return .iDBIndex(iDBIndex) + } + if let iDBObjectStore: IDBObjectStore = value.fromJSValue() { + return .iDBObjectStore(iDBObjectStore) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .iDBCursor(iDBCursor): + return iDBCursor.jsValue() + case let .iDBIndex(iDBIndex): + return iDBIndex.jsValue() + case let .iDBObjectStore(iDBObjectStore): + return iDBObjectStore.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/IDBDatabase.swift b/Sources/DOMKit/WebIDL/IDBDatabase.swift index db9dff64..6d6b5547 100644 --- a/Sources/DOMKit/WebIDL/IDBDatabase.swift +++ b/Sources/DOMKit/WebIDL/IDBDatabase.swift @@ -26,7 +26,7 @@ public class IDBDatabase: EventTarget { @ReadonlyAttribute public var objectStoreNames: DOMStringList - @inlinable public func transaction(storeNames: __UNSUPPORTED_UNION__, mode: IDBTransactionMode? = nil, options: IDBTransactionOptions? = nil) -> IDBTransaction { + @inlinable public func transaction(storeNames: String_or_seq_of_String, mode: IDBTransactionMode? = nil, options: IDBTransactionOptions? = nil) -> IDBTransaction { let this = jsObject return this[Strings.transaction].function!(this: this, arguments: [storeNames.jsValue(), mode?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift new file mode 100644 index 00000000..fc9598f2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_IDBIndex_or_IDBObjectStore: ConvertibleToJSValue {} +extension IDBIndex: Any_IDBIndex_or_IDBObjectStore {} +extension IDBObjectStore: Any_IDBIndex_or_IDBObjectStore {} + +public enum IDBIndex_or_IDBObjectStore: JSValueCompatible, Any_IDBIndex_or_IDBObjectStore { + case iDBIndex(IDBIndex) + case iDBObjectStore(IDBObjectStore) + + public static func construct(from value: JSValue) -> Self? { + if let iDBIndex: IDBIndex = value.fromJSValue() { + return .iDBIndex(iDBIndex) + } + if let iDBObjectStore: IDBObjectStore = value.fromJSValue() { + return .iDBObjectStore(iDBObjectStore) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .iDBIndex(iDBIndex): + return iDBIndex.jsValue() + case let .iDBObjectStore(iDBObjectStore): + return iDBObjectStore.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBObjectStore.swift index 9f681ff3..791d92a1 100644 --- a/Sources/DOMKit/WebIDL/IDBObjectStore.swift +++ b/Sources/DOMKit/WebIDL/IDBObjectStore.swift @@ -92,7 +92,7 @@ public class IDBObjectStore: JSBridgedClass { return this[Strings.index].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } - @inlinable public func createIndex(name: String, keyPath: __UNSUPPORTED_UNION__, options: IDBIndexParameters? = nil) -> IDBIndex { + @inlinable public func createIndex(name: String, keyPath: String_or_seq_of_String, options: IDBIndexParameters? = nil) -> IDBIndex { let this = jsObject return this[Strings.createIndex].function!(this: this, arguments: [name.jsValue(), keyPath.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift b/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift index 19027ace..0fad0c6c 100644 --- a/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift +++ b/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IDBObjectStoreParameters: BridgedDictionary { - public convenience init(keyPath: __UNSUPPORTED_UNION__?, autoIncrement: Bool) { + public convenience init(keyPath: String_or_seq_of_String?, autoIncrement: Bool) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.keyPath] = keyPath.jsValue() object[Strings.autoIncrement] = autoIncrement.jsValue() @@ -18,7 +18,7 @@ public class IDBObjectStoreParameters: BridgedDictionary { } @ReadWriteAttribute - public var keyPath: __UNSUPPORTED_UNION__? + public var keyPath: String_or_seq_of_String? @ReadWriteAttribute public var autoIncrement: Bool diff --git a/Sources/DOMKit/WebIDL/IDBRequest.swift b/Sources/DOMKit/WebIDL/IDBRequest.swift index 7423afa1..ab897d58 100644 --- a/Sources/DOMKit/WebIDL/IDBRequest.swift +++ b/Sources/DOMKit/WebIDL/IDBRequest.swift @@ -24,7 +24,7 @@ public class IDBRequest: EventTarget { public var error: DOMException? @ReadonlyAttribute - public var source: __UNSUPPORTED_UNION__? + public var source: IDBCursor_or_IDBIndex_or_IDBObjectStore? @ReadonlyAttribute public var transaction: IDBTransaction? diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift index 787f6000..ffcc55c2 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -14,7 +14,7 @@ public class ImageBitmapRenderingContext: JSBridgedClass { } @ReadonlyAttribute - public var canvas: __UNSUPPORTED_UNION__ + public var canvas: HTMLCanvasElement_or_OffscreenCanvas @inlinable public func transferFromImageBitmap(bitmap: ImageBitmap?) { let this = jsObject diff --git a/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLint.swift b/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLint.swift new file mode 100644 index 00000000..65fec7f0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLint.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Int32Array_or_seq_of_GLint: ConvertibleToJSValue {} +extension Int32Array: Any_Int32Array_or_seq_of_GLint {} +extension Array: Any_Int32Array_or_seq_of_GLint where Element == GLint {} + +public enum Int32Array_or_seq_of_GLint: JSValueCompatible, Any_Int32Array_or_seq_of_GLint { + case int32Array(Int32Array) + case seq_of_GLint([GLint]) + + 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 func 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/Int32Array_or_seq_of_GLsizei.swift b/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift new file mode 100644 index 00000000..7ca404d4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Int32Array_or_seq_of_GLsizei: ConvertibleToJSValue {} +extension Int32Array: Any_Int32Array_or_seq_of_GLsizei {} +extension Array: Any_Int32Array_or_seq_of_GLsizei where Element == GLsizei {} + +public enum Int32Array_or_seq_of_GLsizei: JSValueCompatible, Any_Int32Array_or_seq_of_GLsizei { + case int32Array(Int32Array) + case seq_of_GLsizei([GLsizei]) + + public static func construct(from value: JSValue) -> Self? { + if let int32Array: Int32Array = value.fromJSValue() { + return .int32Array(int32Array) + } + if let seq_of_GLsizei: [GLsizei] = value.fromJSValue() { + return .seq_of_GLsizei(seq_of_GLsizei) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .int32Array(int32Array): + return int32Array.jsValue() + case let .seq_of_GLsizei(seq_of_GLsizei): + return seq_of_GLsizei.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/IntersectionObserver.swift b/Sources/DOMKit/WebIDL/IntersectionObserver.swift index 4adb6343..66f82a75 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserver.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserver.swift @@ -18,7 +18,7 @@ public class IntersectionObserver: JSBridgedClass { // XXX: constructor is ignored @ReadonlyAttribute - public var root: __UNSUPPORTED_UNION__? + public var root: Document_or_Element? @ReadonlyAttribute public var rootMargin: String diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift b/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift index cd32c851..76fecd9f 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class IntersectionObserverInit: BridgedDictionary { - public convenience init(root: __UNSUPPORTED_UNION__?, rootMargin: String, threshold: __UNSUPPORTED_UNION__) { + public convenience init(root: Document_or_Element?, rootMargin: String, threshold: Double_or_seq_of_Double) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.root] = root.jsValue() object[Strings.rootMargin] = rootMargin.jsValue() @@ -20,11 +20,11 @@ public class IntersectionObserverInit: BridgedDictionary { } @ReadWriteAttribute - public var root: __UNSUPPORTED_UNION__? + public var root: Document_or_Element? @ReadWriteAttribute public var rootMargin: String @ReadWriteAttribute - public var threshold: __UNSUPPORTED_UNION__ + public var threshold: Double_or_seq_of_Double } diff --git a/Sources/DOMKit/WebIDL/JSFunction_or_String.swift b/Sources/DOMKit/WebIDL/JSFunction_or_String.swift new file mode 100644 index 00000000..17ce2db8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/JSFunction_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_JSFunction_or_String: ConvertibleToJSValue {} +extension JSFunction: Any_JSFunction_or_String {} +extension String: Any_JSFunction_or_String {} + +public enum JSFunction_or_String: JSValueCompatible, Any_JSFunction_or_String { + case jSFunction(JSFunction) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let jSFunction: JSFunction = value.fromJSValue() { + return .jSFunction(jSFunction) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .jSFunction(jSFunction): + return jSFunction.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/JSObject_or_String.swift b/Sources/DOMKit/WebIDL/JSObject_or_String.swift new file mode 100644 index 00000000..8bfd4244 --- /dev/null +++ b/Sources/DOMKit/WebIDL/JSObject_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_JSObject_or_String: ConvertibleToJSValue {} +extension JSObject: Any_JSObject_or_String {} +extension String: Any_JSObject_or_String {} + +public enum JSObject_or_String: JSValueCompatible, Any_JSObject_or_String { + case jSObject(JSObject) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let jSObject: JSObject = value.fromJSValue() { + return .jSObject(jSObject) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .jSObject(jSObject): + return jSObject.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/KeyframeEffect.swift b/Sources/DOMKit/WebIDL/KeyframeEffect.swift index a55282d3..c459622e 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffect.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffect.swift @@ -17,7 +17,7 @@ public class KeyframeEffect: AnimationEffect { @ReadWriteAttribute public var iterationComposite: IterationCompositeOperation - @inlinable public convenience init(target: Element?, keyframes: JSObject?, options: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(target: Element?, keyframes: JSObject?, options: Double_or_KeyframeEffectOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [target.jsValue(), keyframes.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/MLBufferResourceView.swift b/Sources/DOMKit/WebIDL/MLBufferResourceView.swift index ab78380f..8ff4925e 100644 --- a/Sources/DOMKit/WebIDL/MLBufferResourceView.swift +++ b/Sources/DOMKit/WebIDL/MLBufferResourceView.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MLBufferResourceView: BridgedDictionary { - public convenience init(resource: __UNSUPPORTED_UNION__, offset: UInt64, size: UInt64) { + public convenience init(resource: GPUBuffer_or_WebGLBuffer, offset: UInt64, size: UInt64) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.resource] = resource.jsValue() object[Strings.offset] = offset.jsValue() @@ -20,7 +20,7 @@ public class MLBufferResourceView: BridgedDictionary { } @ReadWriteAttribute - public var resource: __UNSUPPORTED_UNION__ + public var resource: GPUBuffer_or_WebGLBuffer @ReadWriteAttribute public var offset: UInt64 diff --git a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift index 802cb268..a72a7c2c 100644 --- a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift +++ b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift @@ -363,7 +363,7 @@ public class MLGraphBuilder: JSBridgedClass { return this[Strings.softsign].function!(this: this, arguments: []).fromJSValue()! } - @inlinable public func split(input: MLOperand, splits: __UNSUPPORTED_UNION__, options: MLSplitOptions? = nil) -> [MLOperand] { + @inlinable public func split(input: MLOperand, splits: UInt32_or_seq_of_UInt32, options: MLSplitOptions? = nil) -> [MLOperand] { let this = jsObject return this[Strings.split].function!(this: this, arguments: [input.jsValue(), splits.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift b/Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift new file mode 100644 index 00000000..a062865c --- /dev/null +++ b/Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_MLInput_or_MLResource: ConvertibleToJSValue {} +extension MLInput: Any_MLInput_or_MLResource {} +extension MLResource: Any_MLInput_or_MLResource {} + +public enum MLInput_or_MLResource: JSValueCompatible, Any_MLInput_or_MLResource { + case mLInput(MLInput) + case mLResource(MLResource) + + public static func construct(from value: JSValue) -> Self? { + if let mLInput: MLInput = value.fromJSValue() { + return .mLInput(mLInput) + } + if let mLResource: MLResource = value.fromJSValue() { + return .mLResource(mLResource) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .mLInput(mLInput): + return mLInput.jsValue() + case let .mLResource(mLResource): + return mLResource.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift index ffbd55f9..c1c3b41f 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift @@ -26,7 +26,7 @@ public class MediaKeyStatusMap: JSBridgedClass, Sequence { return this[Strings.has].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! } - @inlinable public func get(keyId: BufferSource) -> __UNSUPPORTED_UNION__ { + @inlinable public func get(keyId: BufferSource) -> MediaKeyStatus_or_Void { let this = jsObject return this[Strings.get].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatus_or_Void.swift b/Sources/DOMKit/WebIDL/MediaKeyStatus_or_Void.swift new file mode 100644 index 00000000..d6e87891 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaKeyStatus_or_Void.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_MediaKeyStatus_or_Void: ConvertibleToJSValue {} +extension MediaKeyStatus: Any_MediaKeyStatus_or_Void {} +extension Void: Any_MediaKeyStatus_or_Void {} + +public enum MediaKeyStatus_or_Void: JSValueCompatible, Any_MediaKeyStatus_or_Void { + case mediaKeyStatus(MediaKeyStatus) + case void(Void) + + public static func construct(from value: JSValue) -> Self? { + if let mediaKeyStatus: MediaKeyStatus = value.fromJSValue() { + return .mediaKeyStatus(mediaKeyStatus) + } + if let void: Void = value.fromJSValue() { + return .void(void) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .mediaKeyStatus(mediaKeyStatus): + return mediaKeyStatus.jsValue() + case let .void(void): + return void.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/MediaList_or_String.swift b/Sources/DOMKit/WebIDL/MediaList_or_String.swift new file mode 100644 index 00000000..c960d098 --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaList_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_MediaList_or_String: ConvertibleToJSValue {} +extension MediaList: Any_MediaList_or_String {} +extension String: Any_MediaList_or_String {} + +public enum MediaList_or_String: JSValueCompatible, Any_MediaList_or_String { + case mediaList(MediaList) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let mediaList: MediaList = value.fromJSValue() { + return .mediaList(mediaList) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .mediaList(mediaList): + return mediaList.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift index 35683670..10970ce8 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamConstraints: BridgedDictionary { - public convenience init(video: __UNSUPPORTED_UNION__, audio: __UNSUPPORTED_UNION__, preferCurrentTab: Bool, peerIdentity: String) { + public convenience init(video: Bool_or_MediaTrackConstraints, audio: Bool_or_MediaTrackConstraints, preferCurrentTab: Bool, peerIdentity: String) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.video] = video.jsValue() object[Strings.audio] = audio.jsValue() @@ -22,10 +22,10 @@ public class MediaStreamConstraints: BridgedDictionary { } @ReadWriteAttribute - public var video: __UNSUPPORTED_UNION__ + public var video: Bool_or_MediaTrackConstraints @ReadWriteAttribute - public var audio: __UNSUPPORTED_UNION__ + public var audio: Bool_or_MediaTrackConstraints @ReadWriteAttribute public var preferCurrentTab: Bool diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift new file mode 100644 index 00000000..98c5949f --- /dev/null +++ b/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_MediaStreamTrack_or_String: ConvertibleToJSValue {} +extension MediaStreamTrack: Any_MediaStreamTrack_or_String {} +extension String: Any_MediaStreamTrack_or_String {} + +public enum MediaStreamTrack_or_String: JSValueCompatible, Any_MediaStreamTrack_or_String { + case mediaStreamTrack(MediaStreamTrack) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let mediaStreamTrack: MediaStreamTrack = value.fromJSValue() { + return .mediaStreamTrack(mediaStreamTrack) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .mediaStreamTrack(mediaStreamTrack): + return mediaStreamTrack.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift index 8250abbb..21354fec 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaTrackConstraintSet: BridgedDictionary { - public convenience init(whiteBalanceMode: ConstrainDOMString, exposureMode: ConstrainDOMString, focusMode: ConstrainDOMString, pointsOfInterest: ConstrainPoint2D, exposureCompensation: ConstrainDouble, exposureTime: ConstrainDouble, colorTemperature: ConstrainDouble, iso: ConstrainDouble, brightness: ConstrainDouble, contrast: ConstrainDouble, saturation: ConstrainDouble, sharpness: ConstrainDouble, focusDistance: ConstrainDouble, pan: __UNSUPPORTED_UNION__, tilt: __UNSUPPORTED_UNION__, zoom: __UNSUPPORTED_UNION__, torch: ConstrainBoolean, 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, displaySurface: ConstrainDOMString, logicalSurface: ConstrainBoolean, cursor: ConstrainDOMString, restrictOwnAudio: ConstrainBoolean, suppressLocalAudioPlayback: ConstrainBoolean) { + public convenience init(whiteBalanceMode: ConstrainDOMString, exposureMode: ConstrainDOMString, focusMode: ConstrainDOMString, pointsOfInterest: ConstrainPoint2D, exposureCompensation: ConstrainDouble, exposureTime: ConstrainDouble, colorTemperature: ConstrainDouble, iso: ConstrainDouble, brightness: ConstrainDouble, contrast: ConstrainDouble, saturation: ConstrainDouble, sharpness: ConstrainDouble, focusDistance: ConstrainDouble, pan: Bool_or_ConstrainDouble, tilt: Bool_or_ConstrainDouble, zoom: Bool_or_ConstrainDouble, torch: ConstrainBoolean, 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, displaySurface: ConstrainDOMString, logicalSurface: ConstrainBoolean, cursor: ConstrainDOMString, restrictOwnAudio: ConstrainBoolean, suppressLocalAudioPlayback: ConstrainBoolean) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() object[Strings.exposureMode] = exposureMode.jsValue() @@ -127,13 +127,13 @@ public class MediaTrackConstraintSet: BridgedDictionary { public var focusDistance: ConstrainDouble @ReadWriteAttribute - public var pan: __UNSUPPORTED_UNION__ + public var pan: Bool_or_ConstrainDouble @ReadWriteAttribute - public var tilt: __UNSUPPORTED_UNION__ + public var tilt: Bool_or_ConstrainDouble @ReadWriteAttribute - public var zoom: __UNSUPPORTED_UNION__ + public var zoom: Bool_or_ConstrainDouble @ReadWriteAttribute public var torch: ConstrainBoolean diff --git a/Sources/DOMKit/WebIDL/MessagePort_or_ServiceWorker_or_WindowProxy.swift b/Sources/DOMKit/WebIDL/MessagePort_or_ServiceWorker_or_WindowProxy.swift new file mode 100644 index 00000000..165b51cf --- /dev/null +++ b/Sources/DOMKit/WebIDL/MessagePort_or_ServiceWorker_or_WindowProxy.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_MessagePort_or_ServiceWorker_or_WindowProxy: ConvertibleToJSValue {} +extension MessagePort: Any_MessagePort_or_ServiceWorker_or_WindowProxy {} +extension ServiceWorker: Any_MessagePort_or_ServiceWorker_or_WindowProxy {} +extension WindowProxy: Any_MessagePort_or_ServiceWorker_or_WindowProxy {} + +public enum MessagePort_or_ServiceWorker_or_WindowProxy: JSValueCompatible, Any_MessagePort_or_ServiceWorker_or_WindowProxy { + case messagePort(MessagePort) + case serviceWorker(ServiceWorker) + case windowProxy(WindowProxy) + + public static func construct(from value: JSValue) -> Self? { + if let messagePort: MessagePort = value.fromJSValue() { + return .messagePort(messagePort) + } + if let serviceWorker: ServiceWorker = value.fromJSValue() { + return .serviceWorker(serviceWorker) + } + if let windowProxy: WindowProxy = value.fromJSValue() { + return .windowProxy(windowProxy) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .messagePort(messagePort): + return messagePort.jsValue() + case let .serviceWorker(serviceWorker): + return serviceWorker.jsValue() + case let .windowProxy(windowProxy): + return windowProxy.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Node_or_String.swift b/Sources/DOMKit/WebIDL/Node_or_String.swift new file mode 100644 index 00000000..b2ee2ef1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Node_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Node_or_String: ConvertibleToJSValue {} +extension Node: Any_Node_or_String {} +extension String: Any_Node_or_String {} + +public enum Node_or_String: JSValueCompatible, Any_Node_or_String { + case node(Node) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let node: Node = value.fromJSValue() { + return .node(node) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .node(node): + return node.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift index c74850a8..c0c6ee73 100644 --- a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift +++ b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class OptionalEffectTiming: BridgedDictionary { - public convenience init(playbackRate: Double, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: __UNSUPPORTED_UNION__, direction: PlaybackDirection, easing: String) { + public convenience init(playbackRate: Double, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: Double_or_String, direction: PlaybackDirection, easing: String) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.playbackRate] = playbackRate.jsValue() object[Strings.delay] = delay.jsValue() @@ -50,7 +50,7 @@ public class OptionalEffectTiming: BridgedDictionary { public var iterations: Double @ReadWriteAttribute - public var duration: __UNSUPPORTED_UNION__ + public var duration: Double_or_String @ReadWriteAttribute public var direction: PlaybackDirection diff --git a/Sources/DOMKit/WebIDL/ParentNode.swift b/Sources/DOMKit/WebIDL/ParentNode.swift index a70a9a4d..09468ba8 100644 --- a/Sources/DOMKit/WebIDL/ParentNode.swift +++ b/Sources/DOMKit/WebIDL/ParentNode.swift @@ -13,17 +13,17 @@ public extension ParentNode { @inlinable var childElementCount: UInt32 { ReadonlyAttribute[Strings.childElementCount, in: jsObject] } - @inlinable func prepend(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func prepend(nodes: Node_or_String...) { let this = jsObject _ = this[Strings.prepend].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - @inlinable func append(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func append(nodes: Node_or_String...) { let this = jsObject _ = this[Strings.append].function!(this: this, arguments: nodes.map { $0.jsValue() }) } - @inlinable func replaceChildren(nodes: __UNSUPPORTED_UNION__...) { + @inlinable func replaceChildren(nodes: Node_or_String...) { let this = jsObject _ = this[Strings.replaceChildren].function!(this: this, arguments: nodes.map { $0.jsValue() }) } diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index 0a049232..b14f4e2e 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -12,7 +12,7 @@ public class Path2D: JSBridgedClass, CanvasPath { self.jsObject = jsObject } - @inlinable public convenience init(path: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(path: Path2D_or_String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [path?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/Path2D_or_String.swift b/Sources/DOMKit/WebIDL/Path2D_or_String.swift new file mode 100644 index 00000000..7bbcbc0e --- /dev/null +++ b/Sources/DOMKit/WebIDL/Path2D_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Path2D_or_String: ConvertibleToJSValue {} +extension Path2D: Any_Path2D_or_String {} +extension String: Any_Path2D_or_String {} + +public enum Path2D_or_String: JSValueCompatible, Any_Path2D_or_String { + case path2D(Path2D) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let path2D: Path2D = value.fromJSValue() { + return .path2D(path2D) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .path2D(path2D): + return path2D.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index 136e3743..059905b6 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -91,7 +91,7 @@ public class Performance: EventTarget { _ = this[Strings.clearMarks].function!(this: this, arguments: [markName?.jsValue() ?? .undefined]) } - @inlinable public func measure(measureName: String, startOrMeasureOptions: __UNSUPPORTED_UNION__? = nil, endMark: String? = nil) -> PerformanceMeasure { + @inlinable public func measure(measureName: String, startOrMeasureOptions: PerformanceMeasureOptions_or_String? = nil, endMark: String? = nil) -> PerformanceMeasure { let this = jsObject return this[Strings.measure].function!(this: this, arguments: [measureName.jsValue(), startOrMeasureOptions?.jsValue() ?? .undefined, endMark?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift index b0f971c2..6e40bcd0 100644 --- a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift +++ b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PerformanceMeasureOptions: BridgedDictionary { - public convenience init(detail: JSValue, start: __UNSUPPORTED_UNION__, duration: DOMHighResTimeStamp, end: __UNSUPPORTED_UNION__) { + public convenience init(detail: JSValue, start: DOMHighResTimeStamp_or_String, duration: DOMHighResTimeStamp, end: DOMHighResTimeStamp_or_String) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.detail] = detail.jsValue() object[Strings.start] = start.jsValue() @@ -25,11 +25,11 @@ public class PerformanceMeasureOptions: BridgedDictionary { public var detail: JSValue @ReadWriteAttribute - public var start: __UNSUPPORTED_UNION__ + public var start: DOMHighResTimeStamp_or_String @ReadWriteAttribute public var duration: DOMHighResTimeStamp @ReadWriteAttribute - public var end: __UNSUPPORTED_UNION__ + public var end: DOMHighResTimeStamp_or_String } diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift new file mode 100644 index 00000000..bd58ec0a --- /dev/null +++ b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_PerformanceMeasureOptions_or_String: ConvertibleToJSValue {} +extension PerformanceMeasureOptions: Any_PerformanceMeasureOptions_or_String {} +extension String: Any_PerformanceMeasureOptions_or_String {} + +public enum PerformanceMeasureOptions_or_String: JSValueCompatible, Any_PerformanceMeasureOptions_or_String { + case performanceMeasureOptions(PerformanceMeasureOptions) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let performanceMeasureOptions: PerformanceMeasureOptions = value.fromJSValue() { + return .performanceMeasureOptions(performanceMeasureOptions) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .performanceMeasureOptions(performanceMeasureOptions): + return performanceMeasureOptions.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift b/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift index d31e8bf9..d11208b0 100644 --- a/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift +++ b/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class PushSubscriptionOptionsInit: BridgedDictionary { - public convenience init(userVisibleOnly: Bool, applicationServerKey: __UNSUPPORTED_UNION__?) { + public convenience init(userVisibleOnly: Bool, applicationServerKey: BufferSource_or_String?) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.userVisibleOnly] = userVisibleOnly.jsValue() object[Strings.applicationServerKey] = applicationServerKey.jsValue() @@ -21,5 +21,5 @@ public class PushSubscriptionOptionsInit: BridgedDictionary { public var userVisibleOnly: Bool @ReadWriteAttribute - public var applicationServerKey: __UNSUPPORTED_UNION__? + public var applicationServerKey: BufferSource_or_String? } diff --git a/Sources/DOMKit/WebIDL/RTCIceServer.swift b/Sources/DOMKit/WebIDL/RTCIceServer.swift index 5cd5108d..06a6b923 100644 --- a/Sources/DOMKit/WebIDL/RTCIceServer.swift +++ b/Sources/DOMKit/WebIDL/RTCIceServer.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RTCIceServer: BridgedDictionary { - public convenience init(urls: __UNSUPPORTED_UNION__, username: String, credential: String, credentialType: RTCIceCredentialType) { + public convenience init(urls: String_or_seq_of_String, username: String, credential: String, credentialType: RTCIceCredentialType) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.urls] = urls.jsValue() object[Strings.username] = username.jsValue() @@ -22,7 +22,7 @@ public class RTCIceServer: BridgedDictionary { } @ReadWriteAttribute - public var urls: __UNSUPPORTED_UNION__ + public var urls: String_or_seq_of_String @ReadWriteAttribute public var username: String diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift index 1fc28aeb..0827f0c3 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift @@ -215,7 +215,7 @@ public class RTCPeerConnection: EventTarget { _ = this[Strings.removeTrack].function!(this: this, arguments: [sender.jsValue()]) } - @inlinable public func addTransceiver(trackOrKind: __UNSUPPORTED_UNION__, init: RTCRtpTransceiverInit? = nil) -> RTCRtpTransceiver { + @inlinable public func addTransceiver(trackOrKind: MediaStreamTrack_or_String, init: RTCRtpTransceiverInit? = nil) -> RTCRtpTransceiver { let this = jsObject return this[Strings.addTransceiver].function!(this: this, arguments: [trackOrKind.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform_or_SFrameTransform.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform_or_SFrameTransform.swift new file mode 100644 index 00000000..3817a173 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform_or_SFrameTransform.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_RTCRtpScriptTransform_or_SFrameTransform: ConvertibleToJSValue {} +extension RTCRtpScriptTransform: Any_RTCRtpScriptTransform_or_SFrameTransform {} +extension SFrameTransform: Any_RTCRtpScriptTransform_or_SFrameTransform {} + +public enum RTCRtpScriptTransform_or_SFrameTransform: JSValueCompatible, Any_RTCRtpScriptTransform_or_SFrameTransform { + case rTCRtpScriptTransform(RTCRtpScriptTransform) + case sFrameTransform(SFrameTransform) + + public static func construct(from value: JSValue) -> Self? { + if let rTCRtpScriptTransform: RTCRtpScriptTransform = value.fromJSValue() { + return .rTCRtpScriptTransform(rTCRtpScriptTransform) + } + if let sFrameTransform: SFrameTransform = value.fromJSValue() { + return .sFrameTransform(sFrameTransform) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .rTCRtpScriptTransform(rTCRtpScriptTransform): + return rTCRtpScriptTransform.jsValue() + case let .sFrameTransform(sFrameTransform): + return sFrameTransform.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController_or_ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController_or_ReadableStreamDefaultController.swift new file mode 100644 index 00000000..4e994a1a --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController_or_ReadableStreamDefaultController.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ReadableByteStreamController_or_ReadableStreamDefaultController: ConvertibleToJSValue {} +extension ReadableByteStreamController: Any_ReadableByteStreamController_or_ReadableStreamDefaultController {} +extension ReadableStreamDefaultController: Any_ReadableByteStreamController_or_ReadableStreamDefaultController {} + +public enum ReadableByteStreamController_or_ReadableStreamDefaultController: JSValueCompatible, Any_ReadableByteStreamController_or_ReadableStreamDefaultController { + case readableByteStreamController(ReadableByteStreamController) + case readableStreamDefaultController(ReadableStreamDefaultController) + + 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 func jsValue() -> JSValue { + switch self { + case let .readableByteStreamController(readableByteStreamController): + return readableByteStreamController.jsValue() + case let .readableStreamDefaultController(readableStreamDefaultController): + return readableStreamDefaultController.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift index 4f79cba6..f527df86 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamBYOBReadResult: BridgedDictionary { - public convenience init(value: __UNSUPPORTED_UNION__, done: Bool) { + public convenience init(value: ArrayBufferView_or_Void, done: Bool) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.value] = value.jsValue() object[Strings.done] = done.jsValue() @@ -18,7 +18,7 @@ public class ReadableStreamBYOBReadResult: BridgedDictionary { } @ReadWriteAttribute - public var value: __UNSUPPORTED_UNION__ + public var value: ArrayBufferView_or_Void @ReadWriteAttribute public var done: Bool diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader_or_ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader_or_ReadableStreamDefaultReader.swift new file mode 100644 index 00000000..2c78b5ce --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader_or_ReadableStreamDefaultReader.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ReadableStreamBYOBReader_or_ReadableStreamDefaultReader: ConvertibleToJSValue {} +extension ReadableStreamBYOBReader: Any_ReadableStreamBYOBReader_or_ReadableStreamDefaultReader {} +extension ReadableStreamDefaultReader: Any_ReadableStreamBYOBReader_or_ReadableStreamDefaultReader {} + +public enum ReadableStreamBYOBReader_or_ReadableStreamDefaultReader: JSValueCompatible, Any_ReadableStreamBYOBReader_or_ReadableStreamDefaultReader { + case readableStreamBYOBReader(ReadableStreamBYOBReader) + case readableStreamDefaultReader(ReadableStreamDefaultReader) + + 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 func jsValue() -> JSValue { + switch self { + case let .readableStreamBYOBReader(readableStreamBYOBReader): + return readableStreamBYOBReader.jsValue() + case let .readableStreamDefaultReader(readableStreamDefaultReader): + return readableStreamDefaultReader.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStream_or_String.swift b/Sources/DOMKit/WebIDL/ReadableStream_or_String.swift new file mode 100644 index 00000000..d023da8b --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStream_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ReadableStream_or_String: ConvertibleToJSValue {} +extension ReadableStream: Any_ReadableStream_or_String {} +extension String: Any_ReadableStream_or_String {} + +public enum ReadableStream_or_String: JSValueCompatible, Any_ReadableStream_or_String { + case readableStream(ReadableStream) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let readableStream: ReadableStream = value.fromJSValue() { + return .readableStream(readableStream) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .readableStream(readableStream): + return readableStream.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ReadableStream_or_XMLHttpRequestBodyInit.swift b/Sources/DOMKit/WebIDL/ReadableStream_or_XMLHttpRequestBodyInit.swift new file mode 100644 index 00000000..3cf8370a --- /dev/null +++ b/Sources/DOMKit/WebIDL/ReadableStream_or_XMLHttpRequestBodyInit.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ReadableStream_or_XMLHttpRequestBodyInit: ConvertibleToJSValue {} +extension ReadableStream: Any_ReadableStream_or_XMLHttpRequestBodyInit {} +extension XMLHttpRequestBodyInit: Any_ReadableStream_or_XMLHttpRequestBodyInit {} + +public enum ReadableStream_or_XMLHttpRequestBodyInit: JSValueCompatible, Any_ReadableStream_or_XMLHttpRequestBodyInit { + case readableStream(ReadableStream) + case xMLHttpRequestBodyInit(XMLHttpRequestBodyInit) + + public static func construct(from value: JSValue) -> Self? { + if let readableStream: ReadableStream = value.fromJSValue() { + return .readableStream(readableStream) + } + if let xMLHttpRequestBodyInit: XMLHttpRequestBodyInit = value.fromJSValue() { + return .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .readableStream(readableStream): + return readableStream.jsValue() + case let .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit): + return xMLHttpRequestBodyInit.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift b/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift new file mode 100644 index 00000000..e51321d4 --- /dev/null +++ b/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_RequestInfo_or_seq_of_RequestInfo: ConvertibleToJSValue {} +extension RequestInfo: Any_RequestInfo_or_seq_of_RequestInfo {} +extension Array: Any_RequestInfo_or_seq_of_RequestInfo where Element == RequestInfo {} + +public enum RequestInfo_or_seq_of_RequestInfo: JSValueCompatible, Any_RequestInfo_or_seq_of_RequestInfo { + case requestInfo(RequestInfo) + case seq_of_RequestInfo([RequestInfo]) + + public static func construct(from value: JSValue) -> Self? { + if let requestInfo: RequestInfo = value.fromJSValue() { + return .requestInfo(requestInfo) + } + if let seq_of_RequestInfo: [RequestInfo] = value.fromJSValue() { + return .seq_of_RequestInfo(seq_of_RequestInfo) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .requestInfo(requestInfo): + return requestInfo.jsValue() + case let .seq_of_RequestInfo(seq_of_RequestInfo): + return seq_of_RequestInfo.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Request_or_String.swift b/Sources/DOMKit/WebIDL/Request_or_String.swift new file mode 100644 index 00000000..17cfe358 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Request_or_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Request_or_String: ConvertibleToJSValue {} +extension Request: Any_Request_or_String {} +extension String: Any_Request_or_String {} + +public enum Request_or_String: JSValueCompatible, Any_Request_or_String { + case request(Request) + case string(String) + + public static func construct(from value: JSValue) -> Self? { + if let request: Request = value.fromJSValue() { + return .request(request) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .request(request): + return request.jsValue() + case let .string(string): + return string.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Response_or_Void.swift b/Sources/DOMKit/WebIDL/Response_or_Void.swift new file mode 100644 index 00000000..425df4fa --- /dev/null +++ b/Sources/DOMKit/WebIDL/Response_or_Void.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Response_or_Void: ConvertibleToJSValue {} +extension Response: Any_Response_or_Void {} +extension Void: Any_Response_or_Void {} + +public enum Response_or_Void: JSValueCompatible, Any_Response_or_Void { + case response(Response) + case void(Void) + + public static func construct(from value: JSValue) -> Self? { + if let response: Response = value.fromJSValue() { + return .response(response) + } + if let void: Void = value.fromJSValue() { + return .void(void) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .response(response): + return response.jsValue() + case let .void(void): + return void.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Sanitizer.swift b/Sources/DOMKit/WebIDL/Sanitizer.swift index 64bffd65..4990542c 100644 --- a/Sources/DOMKit/WebIDL/Sanitizer.swift +++ b/Sources/DOMKit/WebIDL/Sanitizer.swift @@ -16,7 +16,7 @@ public class Sanitizer: JSBridgedClass { self.init(unsafelyWrapping: Self.constructor.new(arguments: [config?.jsValue() ?? .undefined])) } - @inlinable public func sanitize(input: __UNSUPPORTED_UNION__) -> DocumentFragment { + @inlinable public func sanitize(input: Document_or_DocumentFragment) -> DocumentFragment { let this = jsObject return this[Strings.sanitize].function!(this: this, arguments: [input.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/SequenceEffect.swift b/Sources/DOMKit/WebIDL/SequenceEffect.swift index d61f9c8f..11cad38d 100644 --- a/Sources/DOMKit/WebIDL/SequenceEffect.swift +++ b/Sources/DOMKit/WebIDL/SequenceEffect.swift @@ -10,7 +10,7 @@ public class SequenceEffect: GroupEffect { super.init(unsafelyWrapping: jsObject) } - @inlinable public convenience init(children: [AnimationEffect]?, timing: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(children: [AnimationEffect]?, timing: Double_or_EffectTiming? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue(), timing?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift index 486ac606..45a4ae8c 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift @@ -39,7 +39,7 @@ public class ServiceWorkerContainer: EventTarget { } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getRegistration(clientURL: String? = nil) async throws -> __UNSUPPORTED_UNION__ { + @inlinable public func getRegistration(clientURL: String? = nil) async throws -> ServiceWorkerRegistration_or_Void { let this = jsObject let _promise: JSPromise = this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration_or_Void.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration_or_Void.swift new file mode 100644 index 00000000..f6c1fd82 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration_or_Void.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ServiceWorkerRegistration_or_Void: ConvertibleToJSValue {} +extension ServiceWorkerRegistration: Any_ServiceWorkerRegistration_or_Void {} +extension Void: Any_ServiceWorkerRegistration_or_Void {} + +public enum ServiceWorkerRegistration_or_Void: JSValueCompatible, Any_ServiceWorkerRegistration_or_Void { + case serviceWorkerRegistration(ServiceWorkerRegistration) + case void(Void) + + public static func construct(from value: JSValue) -> Self? { + if let serviceWorkerRegistration: ServiceWorkerRegistration = value.fromJSValue() { + return .serviceWorkerRegistration(serviceWorkerRegistration) + } + if let void: Void = value.fromJSValue() { + return .void(void) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .serviceWorkerRegistration(serviceWorkerRegistration): + return serviceWorkerRegistration.jsValue() + case let .void(void): + return void.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/ShadowAnimation.swift b/Sources/DOMKit/WebIDL/ShadowAnimation.swift index 3e776903..0fd14060 100644 --- a/Sources/DOMKit/WebIDL/ShadowAnimation.swift +++ b/Sources/DOMKit/WebIDL/ShadowAnimation.swift @@ -11,7 +11,7 @@ public class ShadowAnimation: Animation { super.init(unsafelyWrapping: jsObject) } - @inlinable public convenience init(source: Animation, newTarget: __UNSUPPORTED_UNION__) { + @inlinable public convenience init(source: Animation, newTarget: CSSPseudoElement_or_Element) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue(), newTarget.jsValue()])) } diff --git a/Sources/DOMKit/WebIDL/SharedWorker.swift b/Sources/DOMKit/WebIDL/SharedWorker.swift index 82f22510..78ab2cab 100644 --- a/Sources/DOMKit/WebIDL/SharedWorker.swift +++ b/Sources/DOMKit/WebIDL/SharedWorker.swift @@ -11,7 +11,7 @@ public class SharedWorker: EventTarget, AbstractWorker { super.init(unsafelyWrapping: jsObject) } - @inlinable public convenience init(scriptURL: String, options: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(scriptURL: String, options: String_or_WorkerOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__.swift b/Sources/DOMKit/WebIDL/SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__.swift new file mode 100644 index 00000000..14268418 --- /dev/null +++ b/Sources/DOMKit/WebIDL/SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__: ConvertibleToJSValue {} +extension SmallCryptoKeyID: Any_SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__ {} +extension __UNSUPPORTED_BIGINT__: Any_SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__ {} + +public enum SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__: JSValueCompatible, Any_SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__ { + case smallCryptoKeyID(SmallCryptoKeyID) + case __UNSUPPORTED_BIGINT__(__UNSUPPORTED_BIGINT__) + + public static func construct(from value: JSValue) -> Self? { + if let smallCryptoKeyID: SmallCryptoKeyID = value.fromJSValue() { + return .smallCryptoKeyID(smallCryptoKeyID) + } + if let __UNSUPPORTED_BIGINT__: __UNSUPPORTED_BIGINT__ = value.fromJSValue() { + return .__UNSUPPORTED_BIGINT__(__UNSUPPORTED_BIGINT__) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .smallCryptoKeyID(smallCryptoKeyID): + return smallCryptoKeyID.jsValue() + case let .__UNSUPPORTED_BIGINT__(__UNSUPPORTED_BIGINT__): + return __UNSUPPORTED_BIGINT__.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/String_or_UInt32.swift b/Sources/DOMKit/WebIDL/String_or_UInt32.swift new file mode 100644 index 00000000..75a254c9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/String_or_UInt32.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_String_or_UInt32: ConvertibleToJSValue {} +extension String: Any_String_or_UInt32 {} +extension UInt32: Any_String_or_UInt32 {} + +public enum String_or_UInt32: JSValueCompatible, Any_String_or_UInt32 { + case string(String) + case uInt32(UInt32) + + public static func construct(from value: JSValue) -> Self? { + if let string: String = value.fromJSValue() { + return .string(string) + } + if let uInt32: UInt32 = value.fromJSValue() { + return .uInt32(uInt32) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .string(string): + return string.jsValue() + case let .uInt32(uInt32): + return uInt32.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/String_or_URLPatternInit.swift b/Sources/DOMKit/WebIDL/String_or_URLPatternInit.swift new file mode 100644 index 00000000..3246d730 --- /dev/null +++ b/Sources/DOMKit/WebIDL/String_or_URLPatternInit.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_String_or_URLPatternInit: ConvertibleToJSValue {} +extension String: Any_String_or_URLPatternInit {} +extension URLPatternInit: Any_String_or_URLPatternInit {} + +public enum String_or_URLPatternInit: JSValueCompatible, Any_String_or_URLPatternInit { + case string(String) + case uRLPatternInit(URLPatternInit) + + public static func construct(from value: JSValue) -> Self? { + if let string: String = value.fromJSValue() { + return .string(string) + } + if let uRLPatternInit: URLPatternInit = value.fromJSValue() { + return .uRLPatternInit(uRLPatternInit) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .string(string): + return string.jsValue() + case let .uRLPatternInit(uRLPatternInit): + return uRLPatternInit.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/String_or_Void.swift b/Sources/DOMKit/WebIDL/String_or_Void.swift new file mode 100644 index 00000000..91bc380f --- /dev/null +++ b/Sources/DOMKit/WebIDL/String_or_Void.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_String_or_Void: ConvertibleToJSValue {} +extension String: Any_String_or_Void {} +extension Void: Any_String_or_Void {} + +public enum String_or_Void: JSValueCompatible, Any_String_or_Void { + case string(String) + case void(Void) + + public static func construct(from value: JSValue) -> Self? { + if let string: String = value.fromJSValue() { + return .string(string) + } + if let void: Void = value.fromJSValue() { + return .void(void) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .string(string): + return string.jsValue() + case let .void(void): + return void.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift b/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift new file mode 100644 index 00000000..88ae0c1e --- /dev/null +++ b/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_String_or_WorkerOptions: ConvertibleToJSValue {} +extension String: Any_String_or_WorkerOptions {} +extension WorkerOptions: Any_String_or_WorkerOptions {} + +public enum String_or_WorkerOptions: JSValueCompatible, Any_String_or_WorkerOptions { + case string(String) + case workerOptions(WorkerOptions) + + public static func construct(from value: JSValue) -> Self? { + if let string: String = value.fromJSValue() { + return .string(string) + } + if let workerOptions: WorkerOptions = value.fromJSValue() { + return .workerOptions(workerOptions) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .string(string): + return string.jsValue() + case let .workerOptions(workerOptions): + return workerOptions.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift b/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift new file mode 100644 index 00000000..d1251a5a --- /dev/null +++ b/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_String_or_record_String_to_String_or_seq_of_seq_of_String: ConvertibleToJSValue {} +extension String: Any_String_or_record_String_to_String_or_seq_of_seq_of_String {} +extension Dictionary: Any_String_or_record_String_to_String_or_seq_of_seq_of_String where Key == String, Value == String {} +extension Array: Any_String_or_record_String_to_String_or_seq_of_seq_of_String where Element == [String] {} + +public enum String_or_record_String_to_String_or_seq_of_seq_of_String: JSValueCompatible, Any_String_or_record_String_to_String_or_seq_of_seq_of_String { + case string(String) + case record_String_to_String([String: String]) + case seq_of_seq_of_String([[String]]) + + public static func construct(from value: JSValue) -> Self? { + if let string: String = value.fromJSValue() { + return .string(string) + } + if let record_String_to_String: [String: String] = value.fromJSValue() { + return .record_String_to_String(record_String_to_String) + } + if let seq_of_seq_of_String: [[String]] = value.fromJSValue() { + return .seq_of_seq_of_String(seq_of_seq_of_String) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .string(string): + return string.jsValue() + case let .record_String_to_String(record_String_to_String): + return record_String_to_String.jsValue() + case let .seq_of_seq_of_String(seq_of_seq_of_String): + return seq_of_seq_of_String.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift b/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift new file mode 100644 index 00000000..37864a10 --- /dev/null +++ b/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_String_or_seq_of_Double: ConvertibleToJSValue {} +extension String: Any_String_or_seq_of_Double {} +extension Array: Any_String_or_seq_of_Double where Element == Double {} + +public enum String_or_seq_of_Double: JSValueCompatible, Any_String_or_seq_of_Double { + case string(String) + case seq_of_Double([Double]) + + public static func construct(from value: JSValue) -> Self? { + if let string: String = value.fromJSValue() { + return .string(string) + } + if let seq_of_Double: [Double] = value.fromJSValue() { + return .seq_of_Double(seq_of_Double) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .string(string): + return string.jsValue() + case let .seq_of_Double(seq_of_Double): + return seq_of_Double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift b/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift new file mode 100644 index 00000000..7aeb2040 --- /dev/null +++ b/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_String_or_seq_of_String: ConvertibleToJSValue {} +extension String: Any_String_or_seq_of_String {} +extension Array: Any_String_or_seq_of_String where Element == String {} + +public enum String_or_seq_of_String: JSValueCompatible, Any_String_or_seq_of_String { + case string(String) + case seq_of_String([String]) + + public static func construct(from value: JSValue) -> Self? { + 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 func jsValue() -> JSValue { + switch self { + case let .string(string): + return string.jsValue() + case let .seq_of_String(seq_of_String): + return seq_of_String.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift b/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift new file mode 100644 index 00000000..9da2b424 --- /dev/null +++ b/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_String_or_seq_of_UUID: ConvertibleToJSValue {} +extension String: Any_String_or_seq_of_UUID {} +extension Array: Any_String_or_seq_of_UUID where Element == UUID {} + +public enum String_or_seq_of_UUID: JSValueCompatible, Any_String_or_seq_of_UUID { + case string(String) + case seq_of_UUID([UUID]) + + public static func construct(from value: JSValue) -> Self? { + if let string: String = value.fromJSValue() { + return .string(string) + } + if let seq_of_UUID: [UUID] = value.fromJSValue() { + return .seq_of_UUID(seq_of_UUID) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .string(string): + return string.jsValue() + case let .seq_of_UUID(seq_of_UUID): + return seq_of_UUID.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index fca980a9..3234df94 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -1209,7 +1209,6 @@ import JavaScriptKit @usableFromInline static let authenticatorData: JSString = "authenticatorData" @usableFromInline static let authenticatorSelection: JSString = "authenticatorSelection" @usableFromInline static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" - @usableFromInline static let autoBlockSize: JSString = "autoBlockSize" @usableFromInline static let autoGainControl: JSString = "autoGainControl" @usableFromInline static let autoIncrement: JSString = "autoIncrement" @usableFromInline static let autoPad: JSString = "autoPad" @@ -1332,7 +1331,6 @@ import JavaScriptKit @usableFromInline static let brand: JSString = "brand" @usableFromInline static let brands: JSString = "brands" @usableFromInline static let `break`: JSString = "break" - @usableFromInline static let breakToken: JSString = "breakToken" @usableFromInline static let breakdown: JSString = "breakdown" @usableFromInline static let brightness: JSString = "brightness" @usableFromInline static let broadcast: JSString = "broadcast" @@ -1436,10 +1434,8 @@ import JavaScriptKit @usableFromInline static let checkIntersection: JSString = "checkIntersection" @usableFromInline static let checkValidity: JSString = "checkValidity" @usableFromInline static let checked: JSString = "checked" - @usableFromInline static let childBreakTokens: JSString = "childBreakTokens" @usableFromInline static let childDisplay: JSString = "childDisplay" @usableFromInline static let childElementCount: JSString = "childElementCount" - @usableFromInline static let childFragments: JSString = "childFragments" @usableFromInline static let childList: JSString = "childList" @usableFromInline static let childNodes: JSString = "childNodes" @usableFromInline static let children: JSString = "children" diff --git a/Sources/DOMKit/WebIDL/StylePropertyMap.swift b/Sources/DOMKit/WebIDL/StylePropertyMap.swift index d0d108a3..779a6f79 100644 --- a/Sources/DOMKit/WebIDL/StylePropertyMap.swift +++ b/Sources/DOMKit/WebIDL/StylePropertyMap.swift @@ -10,12 +10,12 @@ public class StylePropertyMap: StylePropertyMapReadOnly { super.init(unsafelyWrapping: jsObject) } - @inlinable public func set(property: String, values: __UNSUPPORTED_UNION__...) { + @inlinable public func set(property: String, values: CSSStyleValue_or_String...) { let this = jsObject _ = this[Strings.set].function!(this: this, arguments: [property.jsValue()] + values.map { $0.jsValue() }) } - @inlinable public func append(property: String, values: __UNSUPPORTED_UNION__...) { + @inlinable public func append(property: String, values: CSSStyleValue_or_String...) { let this = jsObject _ = this[Strings.append].function!(this: this, arguments: [property.jsValue()] + values.map { $0.jsValue() }) } diff --git a/Sources/DOMKit/WebIDL/StyleSheet.swift b/Sources/DOMKit/WebIDL/StyleSheet.swift index 38f280f4..f8c4a456 100644 --- a/Sources/DOMKit/WebIDL/StyleSheet.swift +++ b/Sources/DOMKit/WebIDL/StyleSheet.swift @@ -26,7 +26,7 @@ public class StyleSheet: JSBridgedClass { public var href: String? @ReadonlyAttribute - public var ownerNode: __UNSUPPORTED_UNION__? + public var ownerNode: Element_or_ProcessingInstruction? @ReadonlyAttribute public var parentStyleSheet: CSSStyleSheet? diff --git a/Sources/DOMKit/WebIDL/SubtleCrypto.swift b/Sources/DOMKit/WebIDL/SubtleCrypto.swift index 2b13c72f..24605e1c 100644 --- a/Sources/DOMKit/WebIDL/SubtleCrypto.swift +++ b/Sources/DOMKit/WebIDL/SubtleCrypto.swift @@ -108,13 +108,13 @@ public class SubtleCrypto: JSBridgedClass { return try await _promise.get().fromJSValue()! } - @inlinable public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { + @inlinable public func importKey(format: KeyFormat, keyData: BufferSource_or_JsonWebKey, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { let this = jsObject return this[Strings.importKey].function!(this: this, arguments: [format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func importKey(format: KeyFormat, keyData: __UNSUPPORTED_UNION__, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { + @inlinable public func importKey(format: KeyFormat, keyData: BufferSource_or_JsonWebKey, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { let this = jsObject let _promise: JSPromise = this[Strings.importKey].function!(this: this, arguments: [format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/TrackEvent.swift b/Sources/DOMKit/WebIDL/TrackEvent.swift index b502fe01..380be8ac 100644 --- a/Sources/DOMKit/WebIDL/TrackEvent.swift +++ b/Sources/DOMKit/WebIDL/TrackEvent.swift @@ -16,5 +16,5 @@ public class TrackEvent: Event { } @ReadonlyAttribute - public var track: __UNSUPPORTED_UNION__? + public var track: AudioTrack_or_TextTrack_or_VideoTrack? } diff --git a/Sources/DOMKit/WebIDL/TrackEventInit.swift b/Sources/DOMKit/WebIDL/TrackEventInit.swift index 61d8cc80..1e755c4b 100644 --- a/Sources/DOMKit/WebIDL/TrackEventInit.swift +++ b/Sources/DOMKit/WebIDL/TrackEventInit.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class TrackEventInit: BridgedDictionary { - public convenience init(track: __UNSUPPORTED_UNION__?) { + 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) @@ -16,5 +16,5 @@ public class TrackEventInit: BridgedDictionary { } @ReadWriteAttribute - public var track: __UNSUPPORTED_UNION__? + public var track: AudioTrack_or_TextTrack_or_VideoTrack? } diff --git a/Sources/DOMKit/WebIDL/TrustedHTML_or_TrustedScript_or_TrustedScriptURL.swift b/Sources/DOMKit/WebIDL/TrustedHTML_or_TrustedScript_or_TrustedScriptURL.swift new file mode 100644 index 00000000..da425b69 --- /dev/null +++ b/Sources/DOMKit/WebIDL/TrustedHTML_or_TrustedScript_or_TrustedScriptURL.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL: ConvertibleToJSValue {} +extension TrustedHTML: Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL {} +extension TrustedScript: Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL {} +extension TrustedScriptURL: Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL {} + +public enum TrustedHTML_or_TrustedScript_or_TrustedScriptURL: JSValueCompatible, Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL { + case trustedHTML(TrustedHTML) + case trustedScript(TrustedScript) + case trustedScriptURL(TrustedScriptURL) + + public static func construct(from value: JSValue) -> Self? { + if let trustedHTML: TrustedHTML = value.fromJSValue() { + return .trustedHTML(trustedHTML) + } + if let trustedScript: TrustedScript = value.fromJSValue() { + return .trustedScript(trustedScript) + } + if let trustedScriptURL: TrustedScriptURL = value.fromJSValue() { + return .trustedScriptURL(trustedScriptURL) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .trustedHTML(trustedHTML): + return trustedHTML.jsValue() + case let .trustedScript(trustedScript): + return trustedScript.jsValue() + case let .trustedScriptURL(trustedScriptURL): + return trustedScriptURL.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index b9204598..21be2ea7 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -4,80 +4,80 @@ import JavaScriptEventLoop import JavaScriptKit public typealias GLuint64EXT = UInt64 -public typealias BlobPart = __UNSUPPORTED_UNION__ -public typealias AlgorithmIdentifier = __UNSUPPORTED_UNION__ +public typealias BlobPart = Blob_or_BufferSource_or_String +public typealias AlgorithmIdentifier = JSObject_or_String public typealias HashAlgorithmIdentifier = AlgorithmIdentifier public typealias BigInteger = Uint8Array public typealias NamedCurve = String public typealias ClipboardItemData = JSPromise public typealias ClipboardItems = [ClipboardItem] public typealias CookieList = [CookieListItem] -public typealias PasswordCredentialInit = __UNSUPPORTED_UNION__ -public typealias BinaryData = __UNSUPPORTED_UNION__ -public typealias CSSStringSource = __UNSUPPORTED_UNION__ -public typealias CSSToken = __UNSUPPORTED_UNION__ -public typealias CSSUnparsedSegment = __UNSUPPORTED_UNION__ -public typealias CSSKeywordish = __UNSUPPORTED_UNION__ -public typealias CSSNumberish = __UNSUPPORTED_UNION__ -public typealias CSSPerspectiveValue = __UNSUPPORTED_UNION__ -public typealias CSSColorRGBComp = __UNSUPPORTED_UNION__ -public typealias CSSColorPercent = __UNSUPPORTED_UNION__ -public typealias CSSColorNumber = __UNSUPPORTED_UNION__ -public typealias CSSColorAngle = __UNSUPPORTED_UNION__ -public typealias GeometryNode = __UNSUPPORTED_UNION__ -public typealias HeadersInit = __UNSUPPORTED_UNION__ -public typealias XMLHttpRequestBodyInit = __UNSUPPORTED_UNION__ -public typealias BodyInit = __UNSUPPORTED_UNION__ -public typealias RequestInfo = __UNSUPPORTED_UNION__ -public typealias FileSystemWriteChunkType = __UNSUPPORTED_UNION__ -public typealias StartInDirectory = __UNSUPPORTED_UNION__ +public typealias PasswordCredentialInit = HTMLFormElement_or_PasswordCredentialData +public typealias BinaryData = ArrayBuffer_or_ArrayBufferView +public typealias CSSStringSource = ReadableStream_or_String +public typealias CSSToken = CSSParserValue_or_CSSStyleValue_or_String +public typealias CSSUnparsedSegment = CSSVariableReferenceValue_or_String +public typealias CSSKeywordish = CSSKeywordValue_or_String +public typealias CSSNumberish = CSSNumericValue_or_Double +public typealias CSSPerspectiveValue = CSSKeywordish_or_CSSNumericValue +public typealias CSSColorRGBComp = CSSKeywordish_or_CSSNumberish +public typealias CSSColorPercent = CSSKeywordish_or_CSSNumberish +public typealias CSSColorNumber = CSSKeywordish_or_CSSNumberish +public typealias CSSColorAngle = CSSKeywordish_or_CSSNumberish +public typealias GeometryNode = CSSPseudoElement_or_Document_or_Element_or_Text +public typealias HeadersInit = record_String_to_String_or_seq_of_seq_of_String +public typealias XMLHttpRequestBodyInit = Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams +public typealias BodyInit = ReadableStream_or_XMLHttpRequestBodyInit +public typealias RequestInfo = Request_or_String +public typealias FileSystemWriteChunkType = Blob_or_BufferSource_or_String_or_WriteParams +public typealias StartInDirectory = FileSystemHandle_or_WellKnownDirectory public typealias DOMHighResTimeStamp = Double public typealias EpochTimeStamp = UInt64 -public typealias HTMLOrSVGScriptElement = __UNSUPPORTED_UNION__ -public typealias MediaProvider = __UNSUPPORTED_UNION__ -public typealias RenderingContext = __UNSUPPORTED_UNION__ -public typealias HTMLOrSVGImageElement = __UNSUPPORTED_UNION__ -public typealias CanvasImageSource = __UNSUPPORTED_UNION__ +public typealias HTMLOrSVGScriptElement = HTMLScriptElement_or_SVGScriptElement +public typealias MediaProvider = Blob_or_MediaSource_or_MediaStream +public typealias RenderingContext = CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext +public typealias HTMLOrSVGImageElement = HTMLImageElement_or_SVGImageElement +public typealias CanvasImageSource = HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame public typealias CanvasFilterInput = [String: JSValue] -public typealias OffscreenRenderingContext = __UNSUPPORTED_UNION__ +public typealias OffscreenRenderingContext = GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext public typealias EventHandler = EventHandlerNonNull? public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? -public typealias TimerHandler = __UNSUPPORTED_UNION__ -public typealias ImageBitmapSource = __UNSUPPORTED_UNION__ -public typealias MessageEventSource = __UNSUPPORTED_UNION__ -public typealias ConstrainPoint2D = __UNSUPPORTED_UNION__ +public typealias TimerHandler = JSFunction_or_String +public typealias ImageBitmapSource = Blob_or_CanvasImageSource_or_ImageData +public typealias MessageEventSource = MessagePort_or_ServiceWorker_or_WindowProxy +public typealias ConstrainPoint2D = ConstrainPoint2DParameters_or_seq_of_Point2D public typealias ProfilerResource = String -public typealias ConstrainULong = __UNSUPPORTED_UNION__ -public typealias ConstrainDouble = __UNSUPPORTED_UNION__ -public typealias ConstrainBoolean = __UNSUPPORTED_UNION__ -public typealias ConstrainDOMString = __UNSUPPORTED_UNION__ +public typealias ConstrainULong = ConstrainULongRange_or_UInt32 +public typealias ConstrainDouble = ConstrainDoubleRange_or_Double +public typealias ConstrainBoolean = Bool_or_ConstrainBooleanParameters +public typealias ConstrainDOMString = ConstrainDOMStringParameters_or_String_or_seq_of_String public typealias Megabit = Double public typealias Millisecond = UInt64 -public typealias RotationMatrixType = __UNSUPPORTED_UNION__ +public typealias RotationMatrixType = DOMMatrix_or_Float32Array_or_Float64Array public typealias PerformanceEntryList = [PerformanceEntry] -public typealias PushMessageDataInit = __UNSUPPORTED_UNION__ +public typealias PushMessageDataInit = BufferSource_or_String public typealias ReportList = [Report] public typealias AttributeMatchList = [String: [String]] -public typealias ContainerBasedOffset = __UNSUPPORTED_UNION__ -public typealias ScrollTimelineOffset = __UNSUPPORTED_UNION__ -public typealias ReadableStreamReader = __UNSUPPORTED_UNION__ -public typealias ReadableStreamController = __UNSUPPORTED_UNION__ +public typealias ContainerBasedOffset = CSSKeywordish_or_CSSNumericValue +public typealias ScrollTimelineOffset = ContainerBasedOffset_or_ElementBasedOffset +public typealias ReadableStreamReader = ReadableStreamBYOBReader_or_ReadableStreamDefaultReader +public typealias ReadableStreamController = ReadableByteStreamController_or_ReadableStreamDefaultController public typealias HTMLString = String public typealias ScriptString = String public typealias ScriptURLString = String -public typealias TrustedType = __UNSUPPORTED_UNION__ -public typealias URLPatternInput = __UNSUPPORTED_UNION__ -public typealias VibratePattern = __UNSUPPORTED_UNION__ +public typealias TrustedType = TrustedHTML_or_TrustedScript_or_TrustedScriptURL +public typealias URLPatternInput = String_or_URLPatternInit +public typealias VibratePattern = UInt32_or_seq_of_UInt32 public typealias UUID = String -public typealias BluetoothServiceUUID = __UNSUPPORTED_UNION__ -public typealias BluetoothCharacteristicUUID = __UNSUPPORTED_UNION__ -public typealias BluetoothDescriptorUUID = __UNSUPPORTED_UNION__ -public typealias NDEFMessageSource = __UNSUPPORTED_UNION__ +public typealias BluetoothServiceUUID = String_or_UInt32 +public typealias BluetoothCharacteristicUUID = String_or_UInt32 +public typealias BluetoothDescriptorUUID = String_or_UInt32 +public typealias NDEFMessageSource = BufferSource_or_NDEFMessageInit_or_String public typealias COSEAlgorithmIdentifier = Int32 public typealias UvmEntry = [UInt32] public typealias UvmEntries = [UvmEntry] -public typealias ImageBufferSource = __UNSUPPORTED_UNION__ +public typealias ImageBufferSource = BufferSource_or_ReadableStream public typealias GLenum = UInt32 public typealias GLboolean = Bool public typealias GLbitfield = UInt32 @@ -92,22 +92,22 @@ public typealias GLushort = UInt16 public typealias GLuint = UInt32 public typealias GLfloat = Float public typealias GLclampf = Float -public typealias TexImageSource = __UNSUPPORTED_UNION__ -public typealias Float32List = __UNSUPPORTED_UNION__ -public typealias Int32List = __UNSUPPORTED_UNION__ +public typealias TexImageSource = HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame +public typealias Float32List = Float32Array_or_seq_of_GLfloat +public typealias Int32List = Int32Array_or_seq_of_GLint public typealias GLint64 = Int64 public typealias GLuint64 = UInt64 -public typealias Uint32List = __UNSUPPORTED_UNION__ +public typealias Uint32List = Uint32Array_or_seq_of_GLuint public typealias GPUBufferUsageFlags = UInt32 public typealias GPUMapModeFlags = UInt32 public typealias GPUTextureUsageFlags = UInt32 public typealias GPUShaderStageFlags = UInt32 -public typealias GPUBindingResource = __UNSUPPORTED_UNION__ +public typealias GPUBindingResource = GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView public typealias GPUPipelineConstantValue = Double public typealias GPUColorWriteFlags = UInt32 public typealias GPUComputePassTimestampWrites = [GPUComputePassTimestampWrite] public typealias GPURenderPassTimestampWrites = [GPURenderPassTimestampWrite] -public typealias GPUError = __UNSUPPORTED_UNION__ +public typealias GPUError = GPUOutOfMemoryError_or_GPUValidationError public typealias GPUBufferDynamicOffset = UInt32 public typealias GPUStencilValue = UInt32 public typealias GPUSampleMask = UInt32 @@ -118,24 +118,24 @@ public typealias GPUIndex32 = UInt32 public typealias GPUSize32 = UInt32 public typealias GPUSignedOffset32 = Int32 public typealias GPUFlagsConstant = UInt32 -public typealias GPUColor = __UNSUPPORTED_UNION__ -public typealias GPUOrigin2D = __UNSUPPORTED_UNION__ -public typealias GPUOrigin3D = __UNSUPPORTED_UNION__ -public typealias GPUExtent3D = __UNSUPPORTED_UNION__ -public typealias ArrayBufferView = __UNSUPPORTED_UNION__ -public typealias BufferSource = __UNSUPPORTED_UNION__ +public typealias GPUColor = GPUColorDict_or_seq_of_Double +public typealias GPUOrigin2D = GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate +public typealias GPUOrigin3D = GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate +public typealias GPUExtent3D = GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate +public typealias ArrayBufferView = BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray +public typealias BufferSource = ArrayBuffer_or_ArrayBufferView public typealias DOMTimeStamp = UInt64 public typealias MLNamedOperands = [String: MLOperand] -public typealias MLBufferView = __UNSUPPORTED_UNION__ -public typealias MLResource = __UNSUPPORTED_UNION__ -public typealias MLNamedInputs = [String: __UNSUPPORTED_UNION__] +public typealias MLBufferView = ArrayBufferView_or_MLBufferResourceView +public typealias MLResource = GPUTexture_or_MLBufferView_or_WebGLTexture +public typealias MLNamedInputs = [String: MLInput_or_MLResource] public typealias MLNamedOutputs = [String: MLResource] -public typealias RTCRtpTransform = __UNSUPPORTED_UNION__ +public typealias RTCRtpTransform = RTCRtpScriptTransform_or_SFrameTransform public typealias SmallCryptoKeyID = UInt64 -public typealias CryptoKeyID = __UNSUPPORTED_UNION__ -public typealias LineAndPositionSetting = __UNSUPPORTED_UNION__ -public typealias XRWebGLRenderingContext = __UNSUPPORTED_UNION__ -public typealias FormDataEntryValue = __UNSUPPORTED_UNION__ +public typealias CryptoKeyID = SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__ +public typealias LineAndPositionSetting = AutoKeyword_or_Double +public typealias XRWebGLRenderingContext = WebGL2RenderingContext_or_WebGLRenderingContext +public typealias FormDataEntryValue = File_or_String public typealias ComputePressureUpdateCallback = ([ComputePressureRecord], ComputePressureObserver) -> Void public typealias AnimatorInstanceConstructor = (JSValue, JSValue) -> JSValue public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void @@ -149,7 +149,7 @@ public typealias BlobCallback = (Blob?) -> Void public typealias CustomElementConstructor = () -> HTMLElement public typealias FunctionStringCallback = (String) -> Void public typealias EventHandlerNonNull = (Event) -> JSValue -public typealias OnErrorEventHandlerNonNull = (__UNSUPPORTED_UNION__, String, UInt32, UInt32, JSValue) -> JSValue +public typealias OnErrorEventHandlerNonNull = (Event_or_String, String, UInt32, UInt32, JSValue) -> JSValue public typealias OnBeforeUnloadEventHandlerNonNull = (Event) -> String? public typealias FrameRequestCallback = (DOMHighResTimeStamp) -> Void public typealias IntersectionObserverCallback = ([IntersectionObserverEntry], IntersectionObserver) -> Void @@ -178,11 +178,10 @@ public typealias CreateHTMLCallback = (String, JSValue...) -> String public typealias CreateScriptCallback = (String, JSValue...) -> String public typealias CreateScriptURLCallback = (String, JSValue...) -> String public typealias VideoFrameRequestCallback = (DOMHighResTimeStamp, VideoFrameMetadata) -> Void -public typealias EffectCallback = (Double?, __UNSUPPORTED_UNION__, Animation) -> Void +public typealias EffectCallback = (Double?, CSSPseudoElement_or_Element, Animation) -> Void public typealias LockGrantedCallback = (Lock?) -> JSPromise public typealias DecodeErrorCallback = (DOMException) -> Void public typealias DecodeSuccessCallback = (AudioBuffer) -> Void -public typealias AudioWorkletProcessorConstructor = (JSObject) -> AudioWorkletProcessor public typealias AudioWorkletProcessCallback = ([[Float32Array]], [[Float32Array]], JSObject) -> Bool public typealias AudioDataOutputCallback = (AudioData) -> Void public typealias VideoFrameOutputCallback = (VideoFrame) -> Void diff --git a/Sources/DOMKit/WebIDL/UInt32_or_seq_of_UInt32.swift b/Sources/DOMKit/WebIDL/UInt32_or_seq_of_UInt32.swift new file mode 100644 index 00000000..dfc4f615 --- /dev/null +++ b/Sources/DOMKit/WebIDL/UInt32_or_seq_of_UInt32.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_UInt32_or_seq_of_UInt32: ConvertibleToJSValue {} +extension UInt32: Any_UInt32_or_seq_of_UInt32 {} +extension Array: Any_UInt32_or_seq_of_UInt32 where Element == UInt32 {} + +public enum UInt32_or_seq_of_UInt32: JSValueCompatible, Any_UInt32_or_seq_of_UInt32 { + case uInt32(UInt32) + case seq_of_UInt32([UInt32]) + + public static func construct(from value: JSValue) -> Self? { + if let uInt32: UInt32 = value.fromJSValue() { + return .uInt32(uInt32) + } + if let seq_of_UInt32: [UInt32] = value.fromJSValue() { + return .seq_of_UInt32(seq_of_UInt32) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .uInt32(uInt32): + return uInt32.jsValue() + case let .seq_of_UInt32(seq_of_UInt32): + return seq_of_UInt32.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index a76647ed..81e31010 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -24,7 +24,7 @@ public class URL: JSBridgedClass { self.jsObject = jsObject } - @inlinable public static func createObjectURL(obj: __UNSUPPORTED_UNION__) -> String { + @inlinable public static func createObjectURL(obj: Blob_or_MediaSource) -> String { let this = constructor return this[Strings.createObjectURL].function!(this: this, arguments: [obj.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift b/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift index 1edc7d65..e2e7ee64 100644 --- a/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift +++ b/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class URLPatternComponentResult: BridgedDictionary { - public convenience init(input: String, groups: [String: __UNSUPPORTED_UNION__]) { + public convenience init(input: String, groups: [String: String_or_Void]) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.input] = input.jsValue() object[Strings.groups] = groups.jsValue() @@ -21,5 +21,5 @@ public class URLPatternComponentResult: BridgedDictionary { public var input: String @ReadWriteAttribute - public var groups: [String: __UNSUPPORTED_UNION__] + public var groups: [String: String_or_Void] } diff --git a/Sources/DOMKit/WebIDL/URLSearchParams.swift b/Sources/DOMKit/WebIDL/URLSearchParams.swift index c987bf74..d5cbca73 100644 --- a/Sources/DOMKit/WebIDL/URLSearchParams.swift +++ b/Sources/DOMKit/WebIDL/URLSearchParams.swift @@ -12,7 +12,7 @@ public class URLSearchParams: JSBridgedClass, Sequence { self.jsObject = jsObject } - @inlinable public convenience init(init: __UNSUPPORTED_UNION__? = nil) { + @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])) } diff --git a/Sources/DOMKit/WebIDL/Uint32Array_or_seq_of_GLuint.swift b/Sources/DOMKit/WebIDL/Uint32Array_or_seq_of_GLuint.swift new file mode 100644 index 00000000..0d0c8dd3 --- /dev/null +++ b/Sources/DOMKit/WebIDL/Uint32Array_or_seq_of_GLuint.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Uint32Array_or_seq_of_GLuint: ConvertibleToJSValue {} +extension Uint32Array: Any_Uint32Array_or_seq_of_GLuint {} +extension Array: Any_Uint32Array_or_seq_of_GLuint where Element == GLuint {} + +public enum Uint32Array_or_seq_of_GLuint: JSValueCompatible, Any_Uint32Array_or_seq_of_GLuint { + case uint32Array(Uint32Array) + case seq_of_GLuint([GLuint]) + + public static func construct(from value: JSValue) -> Self? { + if let uint32Array: Uint32Array = value.fromJSValue() { + return .uint32Array(uint32Array) + } + if let seq_of_GLuint: [GLuint] = value.fromJSValue() { + return .seq_of_GLuint(seq_of_GLuint) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .uint32Array(uint32Array): + return uint32Array.jsValue() + case let .seq_of_GLuint(seq_of_GLuint): + return seq_of_GLuint.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift index 79f2cb0a..ff92e18a 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift @@ -12,7 +12,7 @@ public class WEBGL_multi_draw: JSBridgedClass { self.jsObject = jsObject } - @inlinable public func multiDrawArraysWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, drawcount: GLsizei) { + @inlinable public func multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array_or_seq_of_GLint, firstsOffset: GLuint, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, drawcount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = firstsList.jsValue() let _arg2 = firstsOffset.jsValue() @@ -23,7 +23,7 @@ public class WEBGL_multi_draw: JSBridgedClass { _ = this[Strings.multiDrawArraysWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - @inlinable public func multiDrawElementsWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, drawcount: GLsizei) { + @inlinable public func multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array_or_seq_of_GLint, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array_or_seq_of_GLsizei, offsetsOffset: GLuint, drawcount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = countsList.jsValue() let _arg2 = countsOffset.jsValue() @@ -35,7 +35,7 @@ public class WEBGL_multi_draw: JSBridgedClass { _ = this[Strings.multiDrawElementsWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } - @inlinable public func multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { + @inlinable public func multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array_or_seq_of_GLint, firstsOffset: GLuint, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, drawcount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = firstsList.jsValue() let _arg2 = firstsOffset.jsValue() @@ -48,7 +48,7 @@ public class WEBGL_multi_draw: JSBridgedClass { _ = this[Strings.multiDrawArraysInstancedWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } - @inlinable public func multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, drawcount: GLsizei) { + @inlinable public func multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array_or_seq_of_GLint, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array_or_seq_of_GLsizei, offsetsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, drawcount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = countsList.jsValue() let _arg2 = countsOffset.jsValue() diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift index f9db53d1..a47316a0 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift @@ -12,7 +12,7 @@ public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClas self.jsObject = jsObject } - @inlinable public func multiDrawArraysInstancedBaseInstanceWEBGL(mode: GLenum, firstsList: __UNSUPPORTED_UNION__, firstsOffset: GLuint, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, baseInstancesList: __UNSUPPORTED_UNION__, baseInstancesOffset: GLuint, drawCount: GLsizei) { + @inlinable public func multiDrawArraysInstancedBaseInstanceWEBGL(mode: GLenum, firstsList: Int32Array_or_seq_of_GLint, firstsOffset: GLuint, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, baseInstancesList: Uint32Array_or_seq_of_GLuint, baseInstancesOffset: GLuint, drawCount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = firstsList.jsValue() let _arg2 = firstsOffset.jsValue() @@ -27,7 +27,7 @@ public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClas _ = this[Strings.multiDrawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - @inlinable public func multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, countsList: __UNSUPPORTED_UNION__, countsOffset: GLuint, type: GLenum, offsetsList: __UNSUPPORTED_UNION__, offsetsOffset: GLuint, instanceCountsList: __UNSUPPORTED_UNION__, instanceCountsOffset: GLuint, baseVerticesList: __UNSUPPORTED_UNION__, baseVerticesOffset: GLuint, baseInstancesList: __UNSUPPORTED_UNION__, baseInstancesOffset: GLuint, drawCount: GLsizei) { + @inlinable public func multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array_or_seq_of_GLsizei, offsetsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, baseVerticesList: Int32Array_or_seq_of_GLint, baseVerticesOffset: GLuint, baseInstancesList: Uint32Array_or_seq_of_GLuint, baseInstancesOffset: GLuint, drawCount: GLsizei) { let _arg0 = mode.jsValue() let _arg1 = countsList.jsValue() let _arg2 = countsOffset.jsValue() diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContext_or_WebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContext_or_WebGLRenderingContext.swift new file mode 100644 index 00000000..e443fb97 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContext_or_WebGLRenderingContext.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_WebGL2RenderingContext_or_WebGLRenderingContext: ConvertibleToJSValue {} +extension WebGL2RenderingContext: Any_WebGL2RenderingContext_or_WebGLRenderingContext {} +extension WebGLRenderingContext: Any_WebGL2RenderingContext_or_WebGLRenderingContext {} + +public enum WebGL2RenderingContext_or_WebGLRenderingContext: JSValueCompatible, Any_WebGL2RenderingContext_or_WebGLRenderingContext { + case webGL2RenderingContext(WebGL2RenderingContext) + case webGLRenderingContext(WebGLRenderingContext) + + public static func construct(from value: JSValue) -> Self? { + if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { + return .webGL2RenderingContext(webGL2RenderingContext) + } + if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { + return .webGLRenderingContext(webGLRenderingContext) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .webGL2RenderingContext(webGL2RenderingContext): + return webGL2RenderingContext.jsValue() + case let .webGLRenderingContext(webGLRenderingContext): + return webGLRenderingContext.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift index 971208bc..411c50ce 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift @@ -597,7 +597,7 @@ public extension WebGLRenderingContextBase { @inlinable static var BROWSER_DEFAULT_WEBGL: GLenum { 0x9244 } - @inlinable var canvas: __UNSUPPORTED_UNION__ { ReadonlyAttribute[Strings.canvas, in: jsObject] } + @inlinable var canvas: HTMLCanvasElement_or_OffscreenCanvas { ReadonlyAttribute[Strings.canvas, in: jsObject] } @inlinable var drawingBufferWidth: GLsizei { ReadonlyAttribute[Strings.drawingBufferWidth, in: jsObject] } diff --git a/Sources/DOMKit/WebIDL/WebSocket.swift b/Sources/DOMKit/WebIDL/WebSocket.swift index 754f0069..21882685 100644 --- a/Sources/DOMKit/WebIDL/WebSocket.swift +++ b/Sources/DOMKit/WebIDL/WebSocket.swift @@ -20,7 +20,7 @@ public class WebSocket: EventTarget { super.init(unsafelyWrapping: jsObject) } - @inlinable public convenience init(url: String, protocols: __UNSUPPORTED_UNION__? = nil) { + @inlinable public convenience init(url: String, protocols: String_or_seq_of_String? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), protocols?.jsValue() ?? .undefined])) } @@ -67,7 +67,7 @@ public class WebSocket: EventTarget { @ReadWriteAttribute public var binaryType: BinaryType - @inlinable public func send(data: __UNSUPPORTED_UNION__) { + @inlinable public func send(data: Blob_or_BufferSource_or_String) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 7d9dc407..b5b51a1b 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -196,7 +196,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind } @ReadonlyAttribute - public var event: __UNSUPPORTED_UNION__ + public var event: Event_or_Void @inlinable public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { let this = jsObject diff --git a/Sources/DOMKit/WebIDL/WorkletAnimation.swift b/Sources/DOMKit/WebIDL/WorkletAnimation.swift index 5011fd59..334e4e9d 100644 --- a/Sources/DOMKit/WebIDL/WorkletAnimation.swift +++ b/Sources/DOMKit/WebIDL/WorkletAnimation.swift @@ -11,7 +11,7 @@ public class WorkletAnimation: Animation { super.init(unsafelyWrapping: jsObject) } - @inlinable public convenience init(animatorName: String, effects: __UNSUPPORTED_UNION__? = nil, timeline: AnimationTimeline? = nil, options: JSValue? = nil) { + @inlinable public convenience init(animatorName: String, effects: AnimationEffect_or_seq_of_AnimationEffect? = nil, timeline: AnimationTimeline? = nil, options: JSValue? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [animatorName.jsValue(), effects?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/WriteParams.swift b/Sources/DOMKit/WebIDL/WriteParams.swift index 7d75164b..09b1e8f1 100644 --- a/Sources/DOMKit/WebIDL/WriteParams.swift +++ b/Sources/DOMKit/WebIDL/WriteParams.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class WriteParams: BridgedDictionary { - public convenience init(type: WriteCommandType, size: UInt64?, position: UInt64?, data: __UNSUPPORTED_UNION__?) { + public convenience init(type: WriteCommandType, size: UInt64?, position: UInt64?, data: Blob_or_BufferSource_or_String?) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.type] = type.jsValue() object[Strings.size] = size.jsValue() @@ -31,5 +31,5 @@ public class WriteParams: BridgedDictionary { public var position: UInt64? @ReadWriteAttribute - public var data: __UNSUPPORTED_UNION__? + public var data: Blob_or_BufferSource_or_String? } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index c0fe2006..7a9b2913 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -66,7 +66,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { @ReadonlyAttribute public var upload: XMLHttpRequestUpload - @inlinable public func send(body: __UNSUPPORTED_UNION__? = nil) { + @inlinable public func send(body: Document_or_XMLHttpRequestBodyInit? = nil) { let this = jsObject _ = this[Strings.send].function!(this: this, arguments: [body?.jsValue() ?? .undefined]) } diff --git a/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift b/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift new file mode 100644 index 00000000..8fc7c465 --- /dev/null +++ b/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_nullable_Double_or_seq_of_nullable_Double: ConvertibleToJSValue {} +extension Optional: Any_nullable_Double_or_seq_of_nullable_Double where Wrapped == Double {} +extension Array: Any_nullable_Double_or_seq_of_nullable_Double where Element == Double? {} + +public enum nullable_Double_or_seq_of_nullable_Double: JSValueCompatible, Any_nullable_Double_or_seq_of_nullable_Double { + case nullable_Double(Double?) + case seq_of_nullable_Double([Double?]) + + public static func construct(from value: JSValue) -> Self? { + if let nullable_Double: Double? = value.fromJSValue() { + return .nullable_Double(nullable_Double) + } + if let seq_of_nullable_Double: [Double?] = value.fromJSValue() { + return .seq_of_nullable_Double(seq_of_nullable_Double) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .nullable_Double(nullable_Double): + return nullable_Double.jsValue() + case let .seq_of_nullable_Double(seq_of_nullable_Double): + return seq_of_nullable_Double.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/record_String_to_String_or_seq_of_seq_of_String.swift b/Sources/DOMKit/WebIDL/record_String_to_String_or_seq_of_seq_of_String.swift new file mode 100644 index 00000000..8f3995c7 --- /dev/null +++ b/Sources/DOMKit/WebIDL/record_String_to_String_or_seq_of_seq_of_String.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_record_String_to_String_or_seq_of_seq_of_String: ConvertibleToJSValue {} +extension Dictionary: Any_record_String_to_String_or_seq_of_seq_of_String where Key == String, Value == String {} +extension Array: Any_record_String_to_String_or_seq_of_seq_of_String where Element == [String] {} + +public enum record_String_to_String_or_seq_of_seq_of_String: JSValueCompatible, Any_record_String_to_String_or_seq_of_seq_of_String { + case record_String_to_String([String: String]) + case seq_of_seq_of_String([[String]]) + + public static func construct(from value: JSValue) -> Self? { + if let record_String_to_String: [String: String] = value.fromJSValue() { + return .record_String_to_String(record_String_to_String) + } + if let seq_of_seq_of_String: [[String]] = value.fromJSValue() { + return .seq_of_seq_of_String(seq_of_seq_of_String) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { + case let .record_String_to_String(record_String_to_String): + return record_String_to_String.jsValue() + case let .seq_of_seq_of_String(seq_of_seq_of_String): + return seq_of_seq_of_String.jsValue() + } + } +} diff --git a/Sources/WebIDL/Argument.swift b/Sources/WebIDL/Argument.swift index e0daf363..b6c4e8db 100644 --- a/Sources/WebIDL/Argument.swift +++ b/Sources/WebIDL/Argument.swift @@ -1,5 +1,5 @@ /// https://github.com/w3c/webidl2.js/#arguments -public struct IDLArgument: IDLNode, IDLNamed { +public struct IDLArgument: Hashable, IDLNode, IDLNamed { public static let type = "argument" public let `default`: IDLValue? public let optional: Bool diff --git a/Sources/WebIDL/ExtendedAttribute.swift b/Sources/WebIDL/ExtendedAttribute.swift index 00b75b78..acbd43ba 100644 --- a/Sources/WebIDL/ExtendedAttribute.swift +++ b/Sources/WebIDL/ExtendedAttribute.swift @@ -1,10 +1,10 @@ /// https://github.com/w3c/webidl2.js/#extended-attributes -public struct IDLExtendedAttribute: Decodable, IDLNamed { +public struct IDLExtendedAttribute: Hashable, Decodable, IDLNamed { public let name: String public let arguments: [IDLArgument] public let rhs: RHS? - public enum RHS: Decodable, Equatable { + public enum RHS: Decodable, Equatable, Hashable { case identifier(String) case identifierList([String]) case string(String) diff --git a/Sources/WebIDL/Type.swift b/Sources/WebIDL/Type.swift index debe662a..66406b2d 100644 --- a/Sources/WebIDL/Type.swift +++ b/Sources/WebIDL/Type.swift @@ -1,4 +1,4 @@ -public struct IDLType: Decodable { +public struct IDLType: Decodable, Hashable { public let type: String? public let value: TypeValue public let nullable: Bool @@ -21,7 +21,7 @@ public struct IDLType: Decodable { value = try TypeValue(from: decoder) } - public enum TypeValue: Decodable { + public enum TypeValue: Decodable, Hashable { case generic(String, args: [IDLType]) case single(String) case union([IDLType]) diff --git a/Sources/WebIDL/Value.swift b/Sources/WebIDL/Value.swift index 8119fc2f..f69c9ffd 100644 --- a/Sources/WebIDL/Value.swift +++ b/Sources/WebIDL/Value.swift @@ -1,5 +1,5 @@ /// Default and Const Values -public enum IDLValue: Decodable { +public enum IDLValue: Hashable, Decodable { case string(String) case number(String) case boolean(Bool) diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index a2e2e9ef..63f20efa 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -1,9 +1,12 @@ +import WebIDL + @dynamicMemberLookup enum Context { private(set) static var current = State() static var closurePatterns: Set = [] private(set) static var strings: Set = ["toString"] + static var unions: Set> = [] static func source(for name: String) -> SwiftSource { assert(!name.isEmpty) diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 3f8bb55b..40247a18 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -10,6 +10,12 @@ enum IDLBuilder { \n """ + // dictionaries that depend on types not exposed to Window environments + static let ignoredNames: Set = [ + "BreakTokenOptions", "TrustedTypePolicyOptions", "FragmentResultOptions", + "Client_or_MessagePort_or_ServiceWorker", "ExtendableMessageEventInit", + ] + static let outDir = "Sources/DOMKit/WebIDL/" static func writeFile(named name: String, content: String) throws { let path = outDir + name + ".swift" @@ -35,7 +41,7 @@ enum IDLBuilder { else { fatalError("Cannot find name for \(node)") } - if name == "TrustedTypePolicyOptions" { + if ignoredNames.contains(name) { continue } let content = Context.withState(.root( @@ -119,4 +125,12 @@ enum IDLBuilder { try writeFile(named: "Strings", content: stringsContent.source) } + + static func generateUnions() throws { + for union in Context.unions { + let file = UnionProtocol(types: union) + guard !ignoredNames.contains(file.types.inlineTypeName) else { continue } + try writeFile(named: file.types.inlineTypeName, content: file.swiftRepresentation.source) + } + } } diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 4614fbce..b6ba1330 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -1,7 +1,7 @@ import WebIDL enum DeclarationMerger { - static let ignoredTypedefs: Set = ["Function"] + static let ignoredTypedefs: Set = ["Function", "AudioWorkletProcessorConstructor"] static let validExposures: Set = ["Window"] private static func addAsync(_ members: [IDLNode]) -> [IDLNode] { diff --git a/Sources/WebIDLToSwift/UnionProtocol.swift b/Sources/WebIDLToSwift/UnionProtocol.swift new file mode 100644 index 00000000..b193b395 --- /dev/null +++ b/Sources/WebIDLToSwift/UnionProtocol.swift @@ -0,0 +1,181 @@ +import Foundation +import WebIDL + +struct UnionProtocol: SwiftRepresentable { + let types: Set + + var sortedTypes: [SlimIDLType] { + types.sorted(by: { $0.inlineTypeName < $1.inlineTypeName }) + } + + var sortedNames: [String] { + sortedTypes.map { + $0.inlineTypeName.first!.lowercased() + String($0.inlineTypeName.dropFirst()) + } + } + + var swiftRepresentation: SwiftSource { + """ + public protocol Any_\(types.inlineTypeName): ConvertibleToJSValue {} + \(lines: extensions) + + public enum \(types.inlineTypeName): JSValueCompatible, Any_\(types.inlineTypeName) { + \(lines: cases) + + public static func construct(from value: JSValue) -> Self? { + \(lines: constructors) + return nil + } + + public func jsValue() -> JSValue { + switch self { + \(lines: exporters) + } + } + } + """ + } + + var extensions: [SwiftSource] { + sortedTypes.map { + "extension \($0.typeName): Any_\(types.inlineTypeName) \($0.whereClause) {}" + } + } + + var cases: [SwiftSource] { + zip(sortedTypes, sortedNames).map { type, name in + "case \(name)(\(type))" + } + } + + var constructors: [SwiftSource] { + zip(sortedTypes, sortedNames).map { type, name in + """ + if let \(name): \(type) = value.fromJSValue() { + return .\(name)(\(name)) + } + """ + } + } + + var exporters: [SwiftSource] { + sortedNames.map { name in + """ + case let .\(name)(\(name)): + return \(name).jsValue() + """ + } + } +} + +extension SlimIDLType: SwiftRepresentable { + var swiftRepresentation: SwiftSource { + if nullable { + return "\(value)?" + } + return "\(value)" + } + + var typeName: SwiftSource { + if nullable { + return "Optional" + } + + return "\(value.typeName)" + } + + var whereClause: SwiftSource { + if whereClauses.isEmpty { + return "" + } + return "where \(sequence: whereClauses)" + } + + private var whereClauses: [SwiftSource] { + if nullable { + return ["Wrapped == \(value)"] + } + switch value { + case let .generic(name, args: args): + switch name { + case "sequence": + return ["Element == \(args[0])"] + case "FrozenArray", "ObservableArray": + // ??? + return ["Element == \(args[0])"] + case "Promise": + return [] + case "record": + return ["Key == \(args[0])", "Value == \(args[1])"] + default: + fatalError("Unsupported generic type: \(name)") + } + case .single: + return [] + case .union: + fatalError("Union types cannot be used directly") + } + } +} + +extension SlimIDLType.TypeValue: SwiftRepresentable { + var typeName: SwiftSource { + switch self { + case let .generic(name, _): + switch name { + case "sequence": + return "Array" + case "FrozenArray", "ObservableArray": + // ??? + return "Array" + case "Promise": + return "JSPromise" + case "record": + return "Dictionary" + default: + fatalError("Unsupported generic type: \(name)") + } + case let .single(name): + if let typeName = IDLType.typeNameMap[name] { + return "\(typeName)" + } else { + if name == name.lowercased() { + fatalError("Unsupported type: \(name)") + } + return "\(name)" + } + case let .union(types): + return "\(Set(types).inlineTypeName)" + } + } + + var swiftRepresentation: SwiftSource { + switch self { + case let .generic(name, args: args): + switch name { + case "sequence": + return "[\(args[0])]" + case "FrozenArray", "ObservableArray": + // ??? + return "[\(args[0])]" + case "Promise": + return "JSPromise" + case "record": + return "[\(args[0]): \(args[1])]" + default: + fatalError("Unsupported generic type: \(name)") + } + case let .single(name): + if let typeName = IDLType.typeNameMap[name] { + return "\(typeName)" + } else { + if name == name.lowercased() { + fatalError("Unsupported type: \(name)") + } + return "\(name)" + } + case let .union(types): + return "\(Set(types).inlineTypeName)" + } + } +} diff --git a/Sources/WebIDLToSwift/UnionType.swift b/Sources/WebIDLToSwift/UnionType.swift new file mode 100644 index 00000000..6aaa69f3 --- /dev/null +++ b/Sources/WebIDLToSwift/UnionType.swift @@ -0,0 +1,84 @@ +import WebIDL + +struct SlimIDLType: Hashable, Encodable { + let value: TypeValue + let nullable: Bool + + func hash(into hasher: inout Hasher) { + hasher.combine(inlineTypeName) + } + + static func == (lhs: SlimIDLType, rhs: SlimIDLType) -> Bool { + lhs.inlineTypeName == rhs.inlineTypeName + } + + init(_ type: IDLType) { + value = .init(type.value) + nullable = type.nullable + } + + var inlineTypeName: String { + if nullable { + return "nullable_\(value.inlineTypeName)" + } + + return value.inlineTypeName + } + + enum TypeValue: Encodable { + case generic(String, args: [SlimIDLType]) + case single(String) + case union([SlimIDLType]) + + init(_ value: IDLType.TypeValue) { + switch value { + case let .generic(name, args): + self = .generic(name, args: args.map(SlimIDLType.init)) + case let .single(name): + self = .single(name) + case let .union(types): + let slimmed = types.map(SlimIDLType.init) + self = .union(slimmed) + Context.unions.insert(Set(slimmed)) + } + } + } +} + +extension Set where Element == SlimIDLType { + var inlineTypeName: String { + map(\.inlineTypeName).sorted().joined(separator: "_or_") + } +} + +extension SlimIDLType.TypeValue { + var inlineTypeName: String { + switch self { + case let .generic(name, args): + switch name { + case "sequence": + return "seq_of_\(args[0].inlineTypeName)" + case "FrozenArray", "ObservableArray": + // ??? + return "\(name)_of_\(args[0].inlineTypeName)" + case "Promise": + return "JSPromise" + case "record": + return "record_\(args[0].inlineTypeName)_to_\(args[1].inlineTypeName)" + default: + fatalError("Unsupported generic type: \(name)") + } + case let .single(name): + if let typeName = IDLType.typeNameMap[name] { + return "\(typeName)" + } else { + if name == name.lowercased() { + fatalError("Unsupported type: \(name)") + } + return "\(name)" + } + case let .union(types): + return Set(types).inlineTypeName + } + } +} diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index abb5388e..3717cd9b 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -516,7 +516,7 @@ extension AsyncOperation: SwiftRepresentable, Initializable { } extension IDLType: SwiftRepresentable { - private static let typeNameMap = [ + static let typeNameMap = [ "boolean": "Bool", "any": "JSValue", "DOMString": "String", @@ -538,6 +538,7 @@ extension IDLType: SwiftRepresentable { "long": "Int32", "long long": "Int64", "Function": "JSFunction", + "bigint": "__UNSUPPORTED_BIGINT__", ] var swiftRepresentation: SwiftSource { @@ -573,8 +574,9 @@ extension IDLType: SwiftRepresentable { return "\(name)" } case let .union(types): - // print("union", types.count) - return "__UNSUPPORTED_UNION__" + let union = Set(types.map(SlimIDLType.init)) + Context.unions.insert(union) + return "\(raw: union.inlineTypeName)" } } diff --git a/Sources/WebIDLToSwift/main.swift b/Sources/WebIDLToSwift/main.swift index a32aa75d..734959a4 100644 --- a/Sources/WebIDLToSwift/main.swift +++ b/Sources/WebIDLToSwift/main.swift @@ -15,6 +15,8 @@ func main() { try IDLBuilder.generateClosureTypes() print("Generating JSString constants...") try IDLBuilder.generateStrings() + print("Generating union protocols...") + try IDLBuilder.generateUnions() SwiftFormatter.run() print("Done in \(Int(Date().timeIntervalSince(startTime) * 1000))ms.") } catch { From 24bf9074529efc7db9c56595f5353c49600261b9 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 16:07:36 -0400 Subject: [PATCH 107/124] Replace X_or_Void unions with Optional --- .../WebIDL/ArrayBufferView_or_Void.swift | 32 ------------------- Sources/DOMKit/WebIDL/Cache.swift | 2 +- Sources/DOMKit/WebIDL/CacheStorage.swift | 2 +- .../CustomElementConstructor_or_Void.swift | 32 ------------------- .../DOMKit/WebIDL/CustomElementRegistry.swift | 2 +- Sources/DOMKit/WebIDL/Event_or_Void.swift | 32 ------------------- Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift | 2 +- .../WebIDL/GPUDeviceLostReason_or_Void.swift | 32 ------------------- Sources/DOMKit/WebIDL/GPUObjectBase.swift | 2 +- Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift | 2 +- .../WebIDL/MediaKeyStatus_or_Void.swift | 32 ------------------- .../WebIDL/ReadableStreamBYOBReadResult.swift | 4 +-- Sources/DOMKit/WebIDL/Response_or_Void.swift | 32 ------------------- .../WebIDL/ServiceWorkerContainer.swift | 2 +- .../ServiceWorkerRegistration_or_Void.swift | 32 ------------------- Sources/DOMKit/WebIDL/String_or_Void.swift | 32 ------------------- .../WebIDL/URLPatternComponentResult.swift | 4 +-- Sources/DOMKit/WebIDL/Window.swift | 2 +- .../WebIDL+SwiftRepresentation.swift | 5 +++ 19 files changed, 17 insertions(+), 268 deletions(-) delete mode 100644 Sources/DOMKit/WebIDL/ArrayBufferView_or_Void.swift delete mode 100644 Sources/DOMKit/WebIDL/CustomElementConstructor_or_Void.swift delete mode 100644 Sources/DOMKit/WebIDL/Event_or_Void.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUDeviceLostReason_or_Void.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeyStatus_or_Void.swift delete mode 100644 Sources/DOMKit/WebIDL/Response_or_Void.swift delete mode 100644 Sources/DOMKit/WebIDL/ServiceWorkerRegistration_or_Void.swift delete mode 100644 Sources/DOMKit/WebIDL/String_or_Void.swift diff --git a/Sources/DOMKit/WebIDL/ArrayBufferView_or_Void.swift b/Sources/DOMKit/WebIDL/ArrayBufferView_or_Void.swift deleted file mode 100644 index 6e5fccba..00000000 --- a/Sources/DOMKit/WebIDL/ArrayBufferView_or_Void.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_ArrayBufferView_or_Void: ConvertibleToJSValue {} -extension ArrayBufferView: Any_ArrayBufferView_or_Void {} -extension Void: Any_ArrayBufferView_or_Void {} - -public enum ArrayBufferView_or_Void: JSValueCompatible, Any_ArrayBufferView_or_Void { - case arrayBufferView(ArrayBufferView) - case void(Void) - - public static func construct(from value: JSValue) -> Self? { - if let arrayBufferView: ArrayBufferView = value.fromJSValue() { - return .arrayBufferView(arrayBufferView) - } - if let void: Void = value.fromJSValue() { - return .void(void) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .arrayBufferView(arrayBufferView): - return arrayBufferView.jsValue() - case let .void(void): - return void.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/Cache.swift b/Sources/DOMKit/WebIDL/Cache.swift index 63b33da6..bd95b766 100644 --- a/Sources/DOMKit/WebIDL/Cache.swift +++ b/Sources/DOMKit/WebIDL/Cache.swift @@ -18,7 +18,7 @@ public class Cache: JSBridgedClass { } @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_or_Void { + @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.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/CacheStorage.swift b/Sources/DOMKit/WebIDL/CacheStorage.swift index 5ad02647..b3f4ec39 100644 --- a/Sources/DOMKit/WebIDL/CacheStorage.swift +++ b/Sources/DOMKit/WebIDL/CacheStorage.swift @@ -18,7 +18,7 @@ public class CacheStorage: JSBridgedClass { } @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_or_Void { + @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.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/CustomElementConstructor_or_Void.swift b/Sources/DOMKit/WebIDL/CustomElementConstructor_or_Void.swift deleted file mode 100644 index 360a6b6e..00000000 --- a/Sources/DOMKit/WebIDL/CustomElementConstructor_or_Void.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CustomElementConstructor_or_Void: ConvertibleToJSValue {} -extension CustomElementConstructor: Any_CustomElementConstructor_or_Void {} -extension Void: Any_CustomElementConstructor_or_Void {} - -public enum CustomElementConstructor_or_Void: JSValueCompatible, Any_CustomElementConstructor_or_Void { - case customElementConstructor(CustomElementConstructor) - case void(Void) - - public static func construct(from value: JSValue) -> Self? { - if let customElementConstructor: CustomElementConstructor = value.fromJSValue() { - return .customElementConstructor(customElementConstructor) - } - if let void: Void = value.fromJSValue() { - return .void(void) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .customElementConstructor(customElementConstructor): - return customElementConstructor.jsValue() - case let .void(void): - return void.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index d426f48f..73be4959 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -14,7 +14,7 @@ public class CustomElementRegistry: JSBridgedClass { // XXX: member 'define' is ignored - @inlinable public func get(name: String) -> CustomElementConstructor_or_Void { + @inlinable public func get(name: String) -> CustomElementConstructor? { let this = jsObject return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/Event_or_Void.swift b/Sources/DOMKit/WebIDL/Event_or_Void.swift deleted file mode 100644 index d84d9393..00000000 --- a/Sources/DOMKit/WebIDL/Event_or_Void.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Event_or_Void: ConvertibleToJSValue {} -extension Event: Any_Event_or_Void {} -extension Void: Any_Event_or_Void {} - -public enum Event_or_Void: JSValueCompatible, Any_Event_or_Void { - case event(Event) - case void(Void) - - public static func construct(from value: JSValue) -> Self? { - if let event: Event = value.fromJSValue() { - return .event(event) - } - if let void: Void = value.fromJSValue() { - return .void(void) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .event(event): - return event.jsValue() - case let .void(void): - return void.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift index 6e75a0e8..a4edb346 100644 --- a/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift +++ b/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift @@ -15,7 +15,7 @@ public class GPUDeviceLostInfo: JSBridgedClass { } @ReadonlyAttribute - public var reason: GPUDeviceLostReason_or_Void + public var reason: GPUDeviceLostReason? @ReadonlyAttribute public var message: String diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostReason_or_Void.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostReason_or_Void.swift deleted file mode 100644 index a7662c5e..00000000 --- a/Sources/DOMKit/WebIDL/GPUDeviceLostReason_or_Void.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_GPUDeviceLostReason_or_Void: ConvertibleToJSValue {} -extension GPUDeviceLostReason: Any_GPUDeviceLostReason_or_Void {} -extension Void: Any_GPUDeviceLostReason_or_Void {} - -public enum GPUDeviceLostReason_or_Void: JSValueCompatible, Any_GPUDeviceLostReason_or_Void { - case gPUDeviceLostReason(GPUDeviceLostReason) - case void(Void) - - public static func construct(from value: JSValue) -> Self? { - if let gPUDeviceLostReason: GPUDeviceLostReason = value.fromJSValue() { - return .gPUDeviceLostReason(gPUDeviceLostReason) - } - if let void: Void = value.fromJSValue() { - return .void(void) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .gPUDeviceLostReason(gPUDeviceLostReason): - return gPUDeviceLostReason.jsValue() - case let .void(void): - return void.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUObjectBase.swift b/Sources/DOMKit/WebIDL/GPUObjectBase.swift index 03d01013..b81d1d32 100644 --- a/Sources/DOMKit/WebIDL/GPUObjectBase.swift +++ b/Sources/DOMKit/WebIDL/GPUObjectBase.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol GPUObjectBase: JSBridgedClass {} public extension GPUObjectBase { - @inlinable var label: String_or_Void { + @inlinable var label: String? { get { ReadWriteAttribute[Strings.label, in: jsObject] } nonmutating set { ReadWriteAttribute[Strings.label, in: jsObject] = newValue } } diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift index c1c3b41f..4ccac231 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift @@ -26,7 +26,7 @@ public class MediaKeyStatusMap: JSBridgedClass, Sequence { return this[Strings.has].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! } - @inlinable public func get(keyId: BufferSource) -> MediaKeyStatus_or_Void { + @inlinable public func get(keyId: BufferSource) -> MediaKeyStatus? { let this = jsObject return this[Strings.get].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! } diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatus_or_Void.swift b/Sources/DOMKit/WebIDL/MediaKeyStatus_or_Void.swift deleted file mode 100644 index d6e87891..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeyStatus_or_Void.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_MediaKeyStatus_or_Void: ConvertibleToJSValue {} -extension MediaKeyStatus: Any_MediaKeyStatus_or_Void {} -extension Void: Any_MediaKeyStatus_or_Void {} - -public enum MediaKeyStatus_or_Void: JSValueCompatible, Any_MediaKeyStatus_or_Void { - case mediaKeyStatus(MediaKeyStatus) - case void(Void) - - public static func construct(from value: JSValue) -> Self? { - if let mediaKeyStatus: MediaKeyStatus = value.fromJSValue() { - return .mediaKeyStatus(mediaKeyStatus) - } - if let void: Void = value.fromJSValue() { - return .void(void) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .mediaKeyStatus(mediaKeyStatus): - return mediaKeyStatus.jsValue() - case let .void(void): - return void.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift index f527df86..79a2dcaa 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class ReadableStreamBYOBReadResult: BridgedDictionary { - public convenience init(value: ArrayBufferView_or_Void, done: Bool) { + 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() @@ -18,7 +18,7 @@ public class ReadableStreamBYOBReadResult: BridgedDictionary { } @ReadWriteAttribute - public var value: ArrayBufferView_or_Void + public var value: ArrayBufferView? @ReadWriteAttribute public var done: Bool diff --git a/Sources/DOMKit/WebIDL/Response_or_Void.swift b/Sources/DOMKit/WebIDL/Response_or_Void.swift deleted file mode 100644 index 425df4fa..00000000 --- a/Sources/DOMKit/WebIDL/Response_or_Void.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Response_or_Void: ConvertibleToJSValue {} -extension Response: Any_Response_or_Void {} -extension Void: Any_Response_or_Void {} - -public enum Response_or_Void: JSValueCompatible, Any_Response_or_Void { - case response(Response) - case void(Void) - - public static func construct(from value: JSValue) -> Self? { - if let response: Response = value.fromJSValue() { - return .response(response) - } - if let void: Void = value.fromJSValue() { - return .void(void) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .response(response): - return response.jsValue() - case let .void(void): - return void.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift index 45a4ae8c..c6b664ee 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift @@ -39,7 +39,7 @@ public class ServiceWorkerContainer: EventTarget { } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getRegistration(clientURL: String? = nil) async throws -> ServiceWorkerRegistration_or_Void { + @inlinable public func getRegistration(clientURL: String? = nil) async throws -> ServiceWorkerRegistration? { let this = jsObject let _promise: JSPromise = this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue() ?? .undefined]).fromJSValue()! return try await _promise.get().fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration_or_Void.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration_or_Void.swift deleted file mode 100644 index f6c1fd82..00000000 --- a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration_or_Void.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_ServiceWorkerRegistration_or_Void: ConvertibleToJSValue {} -extension ServiceWorkerRegistration: Any_ServiceWorkerRegistration_or_Void {} -extension Void: Any_ServiceWorkerRegistration_or_Void {} - -public enum ServiceWorkerRegistration_or_Void: JSValueCompatible, Any_ServiceWorkerRegistration_or_Void { - case serviceWorkerRegistration(ServiceWorkerRegistration) - case void(Void) - - public static func construct(from value: JSValue) -> Self? { - if let serviceWorkerRegistration: ServiceWorkerRegistration = value.fromJSValue() { - return .serviceWorkerRegistration(serviceWorkerRegistration) - } - if let void: Void = value.fromJSValue() { - return .void(void) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .serviceWorkerRegistration(serviceWorkerRegistration): - return serviceWorkerRegistration.jsValue() - case let .void(void): - return void.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/String_or_Void.swift b/Sources/DOMKit/WebIDL/String_or_Void.swift deleted file mode 100644 index 91bc380f..00000000 --- a/Sources/DOMKit/WebIDL/String_or_Void.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_String_or_Void: ConvertibleToJSValue {} -extension String: Any_String_or_Void {} -extension Void: Any_String_or_Void {} - -public enum String_or_Void: JSValueCompatible, Any_String_or_Void { - case string(String) - case void(Void) - - public static func construct(from value: JSValue) -> Self? { - if let string: String = value.fromJSValue() { - return .string(string) - } - if let void: Void = value.fromJSValue() { - return .void(void) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .string(string): - return string.jsValue() - case let .void(void): - return void.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift b/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift index e2e7ee64..03c205ee 100644 --- a/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift +++ b/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class URLPatternComponentResult: BridgedDictionary { - public convenience init(input: String, groups: [String: String_or_Void]) { + public convenience init(input: String, groups: [String: String?]) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.input] = input.jsValue() object[Strings.groups] = groups.jsValue() @@ -21,5 +21,5 @@ public class URLPatternComponentResult: BridgedDictionary { public var input: String @ReadWriteAttribute - public var groups: [String: String_or_Void] + public var groups: [String: String?] } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index b5b51a1b..a9d881c5 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -196,7 +196,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind } @ReadonlyAttribute - public var event: Event_or_Void + public var event: Event? @inlinable public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { let this = jsObject diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 3717cd9b..74a9e281 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -574,6 +574,11 @@ extension IDLType: SwiftRepresentable { return "\(name)" } case let .union(types): + if types.count == 2, + case .single("undefined") = types[1].value + { + return "\(types[0])?" + } let union = Set(types.map(SlimIDLType.init)) Context.unions.insert(union) return "\(raw: union.inlineTypeName)" From 3f7febf66ca899f107e8c352da8f9dd7051e6d13 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 16:30:45 -0400 Subject: [PATCH 108/124] Remove redundant union --- Sources/DOMKit/ECMAScript/Support.swift | 2 ++ .../CSSColorValue_or_CSSStyleValue.swift | 32 ------------------- Sources/WebIDLToSwift/IDLBuilder.swift | 1 + 3 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 Sources/DOMKit/WebIDL/CSSColorValue_or_CSSStyleValue.swift diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 85ce807e..9b852c93 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -14,3 +14,5 @@ public extension HTMLElement { public let globalThis = Window(from: JSObject.global.jsValue())! public typealias Uint8ClampedArray = JSUInt8ClampedArray +public typealias CSSColorValue_or_CSSStyleValue = CSSStyleValue +public typealias Any_CSSColorValue_or_CSSStyleValue = CSSStyleValue diff --git a/Sources/DOMKit/WebIDL/CSSColorValue_or_CSSStyleValue.swift b/Sources/DOMKit/WebIDL/CSSColorValue_or_CSSStyleValue.swift deleted file mode 100644 index c62d8f3a..00000000 --- a/Sources/DOMKit/WebIDL/CSSColorValue_or_CSSStyleValue.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSColorValue_or_CSSStyleValue: ConvertibleToJSValue {} -extension CSSColorValue: Any_CSSColorValue_or_CSSStyleValue {} -extension CSSStyleValue: Any_CSSColorValue_or_CSSStyleValue {} - -public enum CSSColorValue_or_CSSStyleValue: JSValueCompatible, Any_CSSColorValue_or_CSSStyleValue { - case cSSColorValue(CSSColorValue) - case cSSStyleValue(CSSStyleValue) - - public static func construct(from value: JSValue) -> Self? { - if let cSSColorValue: CSSColorValue = value.fromJSValue() { - return .cSSColorValue(cSSColorValue) - } - if let cSSStyleValue: CSSStyleValue = value.fromJSValue() { - return .cSSStyleValue(cSSStyleValue) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .cSSColorValue(cSSColorValue): - return cSSColorValue.jsValue() - case let .cSSStyleValue(cSSStyleValue): - return cSSStyleValue.jsValue() - } - } -} diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 40247a18..3f3e701a 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -14,6 +14,7 @@ enum IDLBuilder { static let ignoredNames: Set = [ "BreakTokenOptions", "TrustedTypePolicyOptions", "FragmentResultOptions", "Client_or_MessagePort_or_ServiceWorker", "ExtendableMessageEventInit", + "CSSColorValue_or_CSSStyleValue", ] static let outDir = "Sources/DOMKit/WebIDL/" From 2ddcf8ecac496261dac9bc36704d27870052777a Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 16:37:12 -0400 Subject: [PATCH 109/124] special-case CustomElementConstructor --- Sources/DOMKit/ECMAScript/Support.swift | 1 + .../DOMKit/WebIDL/CustomElementRegistry.swift | 17 ++++++++++++++--- Sources/DOMKit/WebIDL/Strings.swift | 2 ++ Sources/DOMKit/WebIDL/Typedefs.swift | 1 - Sources/WebIDLToSwift/IDLBuilder.swift | 5 ++--- Sources/WebIDLToSwift/MergeDeclarations.swift | 6 +++++- 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 9b852c93..75611c61 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -16,3 +16,4 @@ public let globalThis = Window(from: JSObject.global.jsValue())! public typealias Uint8ClampedArray = JSUInt8ClampedArray public typealias CSSColorValue_or_CSSStyleValue = CSSStyleValue public typealias Any_CSSColorValue_or_CSSStyleValue = CSSStyleValue +public typealias CustomElementConstructor = JSFunction diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index 73be4959..9a1f59ba 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -12,16 +12,27 @@ public class CustomElementRegistry: JSBridgedClass { self.jsObject = jsObject } - // XXX: member 'define' is ignored + @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()! } - // XXX: member 'whenDefined' is ignored + @inlinable public func whenDefined(name: String) -> JSPromise { + let this = jsObject + return this[Strings.whenDefined].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + } - // XXX: member 'whenDefined' is ignored + @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.get().fromJSValue()! + } @inlinable public func upgrade(root: Node) { let this = jsObject diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index 3234df94..1f1494c0 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -1855,6 +1855,7 @@ import JavaScriptKit @usableFromInline static let defaultValue: JSString = "defaultValue" @usableFromInline static let defaultView: JSString = "defaultView" @usableFromInline static let `defer`: JSString = "defer" + @usableFromInline static let define: JSString = "define" @usableFromInline static let deg: JSString = "deg" @usableFromInline static let degradationPreference: JSString = "degradationPreference" @usableFromInline static let delay: JSString = "delay" @@ -4975,6 +4976,7 @@ import JavaScriptKit @usableFromInline static let webkitdirectory: JSString = "webkitdirectory" @usableFromInline static let weight: JSString = "weight" @usableFromInline static let whatToShow: JSString = "whatToShow" + @usableFromInline static let whenDefined: JSString = "whenDefined" @usableFromInline static let which: JSString = "which" @usableFromInline static let whiteBalanceMode: JSString = "whiteBalanceMode" @usableFromInline static let wholeText: JSString = "wholeText" diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index 21be2ea7..88dc1810 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -146,7 +146,6 @@ public typealias FileCallback = (File) -> Void public typealias PositionCallback = (GeolocationPosition) -> Void public typealias PositionErrorCallback = (GeolocationPositionError) -> Void public typealias BlobCallback = (Blob?) -> Void -public typealias CustomElementConstructor = () -> HTMLElement public typealias FunctionStringCallback = (String) -> Void public typealias EventHandlerNonNull = (Event) -> JSValue public typealias OnErrorEventHandlerNonNull = (Event_or_String, String, UInt32, UInt32, JSValue) -> JSValue diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 3f3e701a..5d30d95c 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -10,10 +10,11 @@ enum IDLBuilder { \n """ - // dictionaries that depend on types not exposed to Window environments static let ignoredNames: Set = [ + // dictionaries that depend on types not exposed to Window environments "BreakTokenOptions", "TrustedTypePolicyOptions", "FragmentResultOptions", "Client_or_MessagePort_or_ServiceWorker", "ExtendableMessageEventInit", + // redundant unions "CSSColorValue_or_CSSStyleValue", ] @@ -81,8 +82,6 @@ enum IDLBuilder { "XRSession": ["requestAnimationFrame"], // variadic callbacks are unsupported "TrustedTypePolicyFactory": ["createPolicy"], - // functions as return types are unsupported - "CustomElementRegistry": ["define", "whenDefined"], // NodeFilter "Document": ["createNodeIterator", "createTreeWalker"], "NodeIterator": ["filter"], diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index b6ba1330..71dc8fa5 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -1,7 +1,11 @@ import WebIDL enum DeclarationMerger { - static let ignoredTypedefs: Set = ["Function", "AudioWorkletProcessorConstructor"] + static let ignoredTypedefs: Set = [ + "Function", + "AudioWorkletProcessorConstructor", + "CustomElementConstructor", + ] static let validExposures: Set = ["Window"] private static func addAsync(_ members: [IDLNode]) -> [IDLNode] { From cd16a42c645314991cd987ea5b92161bd0845530 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 16:42:12 -0400 Subject: [PATCH 110/124] fix ArrayBufferView --- .../DOMKit/ECMAScript/ArrayBufferView.swift | 93 ++++++++++++++++ ...y_or_Uint8Array_or_Uint8ClampedArray.swift | 102 ------------------ Sources/DOMKit/WebIDL/Typedefs.swift | 1 - Sources/WebIDLToSwift/IDLBuilder.swift | 2 + Sources/WebIDLToSwift/MergeDeclarations.swift | 1 + 5 files changed, 96 insertions(+), 103 deletions(-) create mode 100644 Sources/DOMKit/ECMAScript/ArrayBufferView.swift delete mode 100644 Sources/DOMKit/WebIDL/BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray.swift diff --git a/Sources/DOMKit/ECMAScript/ArrayBufferView.swift b/Sources/DOMKit/ECMAScript/ArrayBufferView.swift new file mode 100644 index 00000000..be55cc40 --- /dev/null +++ b/Sources/DOMKit/ECMAScript/ArrayBufferView.swift @@ -0,0 +1,93 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +// TODO: expand this to BigInt arrays +public protocol AnyArrayBufferView: ConvertibleToJSValue {} +extension DataView: AnyArrayBufferView {} +extension JSTypedArray: AnyArrayBufferView {} + +public enum ArrayBufferView: JSValueCompatible, AnyArrayBufferView { + case dataView(DataView) + // case bigInt64Array(BigInt64Array) + // case bigUint64Array(BigUint64Array) + case float32Array(Float32Array) + case float64Array(Float64Array) + case int16Array(Int16Array) + case int32Array(Int32Array) + case int8Array(Int8Array) + case uint16Array(Uint16Array) + case uint32Array(Uint32Array) + case uint8Array(Uint8Array) + case uint8ClampedArray(Uint8ClampedArray) + + public static func construct(from value: JSValue) -> Self? { + // if let bigInt64Array: BigInt64Array = value.fromJSValue() { + // return .bigInt64Array(bigInt64Array) + // } + // if let bigUint64Array: BigUint64Array = value.fromJSValue() { + // return .bigUint64Array(bigUint64Array) + // } + if let dataView: DataView = value.fromJSValue() { + return .dataView(dataView) + } + if let float32Array: Float32Array = value.fromJSValue() { + return .float32Array(float32Array) + } + if let float64Array: Float64Array = value.fromJSValue() { + return .float64Array(float64Array) + } + if let int16Array: Int16Array = value.fromJSValue() { + return .int16Array(int16Array) + } + if let int32Array: Int32Array = value.fromJSValue() { + return .int32Array(int32Array) + } + if let int8Array: Int8Array = value.fromJSValue() { + return .int8Array(int8Array) + } + if let uint16Array: Uint16Array = value.fromJSValue() { + return .uint16Array(uint16Array) + } + if let uint32Array: Uint32Array = value.fromJSValue() { + return .uint32Array(uint32Array) + } + if let uint8Array: Uint8Array = value.fromJSValue() { + return .uint8Array(uint8Array) + } + if let uint8ClampedArray: Uint8ClampedArray = value.fromJSValue() { + return .uint8ClampedArray(uint8ClampedArray) + } + return nil + } + + public func jsValue() -> JSValue { + switch self { +// case let .bigInt64Array(bigInt64Array): +// return bigInt64Array.jsValue() +// case let .bigUint64Array(bigUint64Array): +// return bigUint64Array.jsValue() + case let .dataView(dataView): + return dataView.jsValue() + case let .float32Array(float32Array): + return float32Array.jsValue() + case let .float64Array(float64Array): + return float64Array.jsValue() + case let .int16Array(int16Array): + return int16Array.jsValue() + case let .int32Array(int32Array): + return int32Array.jsValue() + case let .int8Array(int8Array): + return int8Array.jsValue() + case let .uint16Array(uint16Array): + return uint16Array.jsValue() + case let .uint32Array(uint32Array): + return uint32Array.jsValue() + case let .uint8Array(uint8Array): + return uint8Array.jsValue() + case let .uint8ClampedArray(uint8ClampedArray): + return uint8ClampedArray.jsValue() + } + } +} diff --git a/Sources/DOMKit/WebIDL/BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray.swift b/Sources/DOMKit/WebIDL/BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray.swift deleted file mode 100644 index 0b90c0e9..00000000 --- a/Sources/DOMKit/WebIDL/BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray.swift +++ /dev/null @@ -1,102 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray: ConvertibleToJSValue {} -extension BigInt64Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension BigUint64Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension DataView: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension Float32Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension Float64Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension Int16Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension Int32Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension Int8Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension Uint16Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension Uint32Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension Uint8Array: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} -extension Uint8ClampedArray: Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray {} - -public enum BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray: JSValueCompatible, Any_BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray { - case bigInt64Array(BigInt64Array) - case bigUint64Array(BigUint64Array) - case dataView(DataView) - case float32Array(Float32Array) - case float64Array(Float64Array) - case int16Array(Int16Array) - case int32Array(Int32Array) - case int8Array(Int8Array) - case uint16Array(Uint16Array) - case uint32Array(Uint32Array) - case uint8Array(Uint8Array) - case uint8ClampedArray(Uint8ClampedArray) - - public static func construct(from value: JSValue) -> Self? { - if let bigInt64Array: BigInt64Array = value.fromJSValue() { - return .bigInt64Array(bigInt64Array) - } - if let bigUint64Array: BigUint64Array = value.fromJSValue() { - return .bigUint64Array(bigUint64Array) - } - if let dataView: DataView = value.fromJSValue() { - return .dataView(dataView) - } - if let float32Array: Float32Array = value.fromJSValue() { - return .float32Array(float32Array) - } - if let float64Array: Float64Array = value.fromJSValue() { - return .float64Array(float64Array) - } - if let int16Array: Int16Array = value.fromJSValue() { - return .int16Array(int16Array) - } - if let int32Array: Int32Array = value.fromJSValue() { - return .int32Array(int32Array) - } - if let int8Array: Int8Array = value.fromJSValue() { - return .int8Array(int8Array) - } - if let uint16Array: Uint16Array = value.fromJSValue() { - return .uint16Array(uint16Array) - } - if let uint32Array: Uint32Array = value.fromJSValue() { - return .uint32Array(uint32Array) - } - if let uint8Array: Uint8Array = value.fromJSValue() { - return .uint8Array(uint8Array) - } - if let uint8ClampedArray: Uint8ClampedArray = value.fromJSValue() { - return .uint8ClampedArray(uint8ClampedArray) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .bigInt64Array(bigInt64Array): - return bigInt64Array.jsValue() - case let .bigUint64Array(bigUint64Array): - return bigUint64Array.jsValue() - case let .dataView(dataView): - return dataView.jsValue() - case let .float32Array(float32Array): - return float32Array.jsValue() - case let .float64Array(float64Array): - return float64Array.jsValue() - case let .int16Array(int16Array): - return int16Array.jsValue() - case let .int32Array(int32Array): - return int32Array.jsValue() - case let .int8Array(int8Array): - return int8Array.jsValue() - case let .uint16Array(uint16Array): - return uint16Array.jsValue() - case let .uint32Array(uint32Array): - return uint32Array.jsValue() - case let .uint8Array(uint8Array): - return uint8Array.jsValue() - case let .uint8ClampedArray(uint8ClampedArray): - return uint8ClampedArray.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index 88dc1810..e77f256b 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -122,7 +122,6 @@ public typealias GPUColor = GPUColorDict_or_seq_of_Double public typealias GPUOrigin2D = GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate public typealias GPUOrigin3D = GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate public typealias GPUExtent3D = GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate -public typealias ArrayBufferView = BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray public typealias BufferSource = ArrayBuffer_or_ArrayBufferView public typealias DOMTimeStamp = UInt64 public typealias MLNamedOperands = [String: MLOperand] diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 5d30d95c..6934d2e3 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -16,6 +16,8 @@ enum IDLBuilder { "Client_or_MessagePort_or_ServiceWorker", "ExtendableMessageEventInit", // redundant unions "CSSColorValue_or_CSSStyleValue", + // implemented manually + "BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray", ] static let outDir = "Sources/DOMKit/WebIDL/" diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 71dc8fa5..1f6fe9bc 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -5,6 +5,7 @@ enum DeclarationMerger { "Function", "AudioWorkletProcessorConstructor", "CustomElementConstructor", + "ArrayBufferView" ] static let validExposures: Set = ["Window"] From 582a77ddde8d26f9f850c8e6364cc373f525ee09 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 2 Apr 2022 16:47:20 -0400 Subject: [PATCH 111/124] fix RotationMatrixType --- .../ECMAScript/RotationMatrixType.swift | 8 ++++ Sources/DOMKit/ECMAScript/Support.swift | 2 +- ...trix_or_Float32Array_or_Float64Array.swift | 39 ------------------- Sources/DOMKit/WebIDL/Typedefs.swift | 1 - Sources/WebIDLToSwift/IDLBuilder.swift | 3 ++ Sources/WebIDLToSwift/MergeDeclarations.swift | 3 +- 6 files changed, 14 insertions(+), 42 deletions(-) create mode 100644 Sources/DOMKit/ECMAScript/RotationMatrixType.swift delete mode 100644 Sources/DOMKit/WebIDL/DOMMatrix_or_Float32Array_or_Float64Array.swift diff --git a/Sources/DOMKit/ECMAScript/RotationMatrixType.swift b/Sources/DOMKit/ECMAScript/RotationMatrixType.swift new file mode 100644 index 00000000..d14e2c74 --- /dev/null +++ b/Sources/DOMKit/ECMAScript/RotationMatrixType.swift @@ -0,0 +1,8 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol RotationMatrixType: ConvertibleToJSValue {} +extension DOMMatrix: RotationMatrixType {} +extension JSTypedArray: RotationMatrixType where Element: FloatingPoint {} diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 75611c61..7c4553da 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -1,7 +1,7 @@ import JavaScriptKit /* TODO: fix this */ -public typealias __UNSUPPORTED_UNION__ = JSValue +public typealias __UNSUPPORTED_BIGINT__ = JSValue public typealias WindowProxy = Window diff --git a/Sources/DOMKit/WebIDL/DOMMatrix_or_Float32Array_or_Float64Array.swift b/Sources/DOMKit/WebIDL/DOMMatrix_or_Float32Array_or_Float64Array.swift deleted file mode 100644 index 083e4b9a..00000000 --- a/Sources/DOMKit/WebIDL/DOMMatrix_or_Float32Array_or_Float64Array.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_DOMMatrix_or_Float32Array_or_Float64Array: ConvertibleToJSValue {} -extension DOMMatrix: Any_DOMMatrix_or_Float32Array_or_Float64Array {} -extension Float32Array: Any_DOMMatrix_or_Float32Array_or_Float64Array {} -extension Float64Array: Any_DOMMatrix_or_Float32Array_or_Float64Array {} - -public enum DOMMatrix_or_Float32Array_or_Float64Array: JSValueCompatible, Any_DOMMatrix_or_Float32Array_or_Float64Array { - case dOMMatrix(DOMMatrix) - case float32Array(Float32Array) - case float64Array(Float64Array) - - public static func construct(from value: JSValue) -> Self? { - if let dOMMatrix: DOMMatrix = value.fromJSValue() { - return .dOMMatrix(dOMMatrix) - } - if let float32Array: Float32Array = value.fromJSValue() { - return .float32Array(float32Array) - } - if let float64Array: Float64Array = value.fromJSValue() { - return .float64Array(float64Array) - } - return nil - } - - public func jsValue() -> JSValue { - switch self { - case let .dOMMatrix(dOMMatrix): - return dOMMatrix.jsValue() - case let .float32Array(float32Array): - return float32Array.jsValue() - case let .float64Array(float64Array): - return float64Array.jsValue() - } - } -} diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index e77f256b..b88d3e69 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -54,7 +54,6 @@ public typealias ConstrainBoolean = Bool_or_ConstrainBooleanParameters public typealias ConstrainDOMString = ConstrainDOMStringParameters_or_String_or_seq_of_String public typealias Megabit = Double public typealias Millisecond = UInt64 -public typealias RotationMatrixType = DOMMatrix_or_Float32Array_or_Float64Array public typealias PerformanceEntryList = [PerformanceEntry] public typealias PushMessageDataInit = BufferSource_or_String public typealias ReportList = [Report] diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 6934d2e3..18e8ec24 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -17,7 +17,10 @@ enum IDLBuilder { // redundant unions "CSSColorValue_or_CSSStyleValue", // implemented manually + // ArrayBufferView "BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray", + // RotationMatrixType + "DOMMatrix_or_Float32Array_or_Float64Array", ] static let outDir = "Sources/DOMKit/WebIDL/" diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index 1f6fe9bc..aaace3e9 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -5,7 +5,8 @@ enum DeclarationMerger { "Function", "AudioWorkletProcessorConstructor", "CustomElementConstructor", - "ArrayBufferView" + "ArrayBufferView", + "RotationMatrixType", ] static let validExposures: Set = ["Window"] From 46002908758eea42de771dcd7ce4b3a3a0fb2761 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sun, 3 Apr 2022 16:38:35 -0400 Subject: [PATCH 112/124] (wip) Automatically pick up friendly names for unions --- Package.resolved | 2 +- ...String.swift => AlgorithmIdentifier.swift} | 8 +- ...ArrayBufferView.swift => BinaryData.swift} | 8 +- ...rSource_or_String.swift => BlobPart.swift} | 10 +- ...Int32.swift => BluetoothServiceUUID.swift} | 8 +- ...tpRequestBodyInit.swift => BodyInit.swift} | 8 +- ...SNumberish.swift => CSSColorRGBComp.swift} | 8 +- ...ue_or_String.swift => CSSKeywordish.swift} | 8 +- ...lue_or_Double.swift => CSSNumberish.swift} | 8 +- ...cValue.swift => CSSPerspectiveValue.swift} | 8 +- ..._or_String.swift => CSSStringSource.swift} | 8 +- ...leValue_or_String.swift => CSSToken.swift} | 10 +- ..._String.swift => CSSUnparsedSegment.swift} | 8 +- ...deoFrame.swift => CanvasImageSource.swift} | 16 ++-- ...arameters.swift => ConstrainBoolean.swift} | 8 +- ..._String.swift => ConstrainDOMString.swift} | 10 +- ..._or_Double.swift => ConstrainDouble.swift} | 8 +- ...f_Point2D.swift => ConstrainPoint2D.swift} | 8 +- ...e_or_UInt32.swift => ConstrainULong.swift} | 8 +- ...ORTED_BIGINT__.swift => CryptoKeyID.swift} | 8 +- ...s.swift => FileSystemWriteChunkType.swift} | 12 +-- ...seq_of_GLfloat.swift => Float32List.swift} | 8 +- ..._String.swift => FormDataEntryValue.swift} | 8 +- ...ureView.swift => GPUBindingResource.swift} | 12 +-- ..._or_seq_of_Double.swift => GPUColor.swift} | 8 +- ...PUValidationError.swift => GPUError.swift} | 8 +- ...egerCoordinate.swift => GPUExtent3D.swift} | 8 +- ...egerCoordinate.swift => GPUOrigin2D.swift} | 8 +- ...egerCoordinate.swift => GPUOrigin3D.swift} | 8 +- ...ement_or_Text.swift => GeometryNode.swift} | 12 +-- ...ment.swift => HTMLOrSVGImageElement.swift} | 8 +- ...ent.swift => HTMLOrSVGScriptElement.swift} | 8 +- ..._seq_of_String.swift => HeadersInit.swift} | 8 +- ...mageData.swift => ImageBitmapSource.swift} | 10 +- ...leStream.swift => ImageBufferSource.swift} | 8 +- ..._or_seq_of_GLint.swift => Int32List.swift} | 8 +- ...ble.swift => LineAndPositionSetting.swift} | 8 +- ...rResourceView.swift => MLBufferView.swift} | 8 +- ...or_WebGLTexture.swift => MLResource.swift} | 10 +- ..._MediaStream.swift => MediaProvider.swift} | 10 +- ...owProxy.swift => MessageEventSource.swift} | 10 +- ...r_String.swift => NDEFMessageSource.swift} | 10 +- ....swift => OffscreenRenderingContext.swift} | 14 +-- ...ata.swift => PasswordCredentialInit.swift} | 8 +- ...String.swift => PushMessageDataInit.swift} | 8 +- ...eTransform.swift => RTCRtpTransform.swift} | 8 +- ...r.swift => ReadableStreamController.swift} | 8 +- ...eader.swift => ReadableStreamReader.swift} | 8 +- ...ngContext.swift => RenderingContext.swift} | 14 +-- ...uest_or_String.swift => RequestInfo.swift} | 8 +- ...ffset.swift => ScrollTimelineOffset.swift} | 8 +- ...Directory.swift => StartInDirectory.swift} | 8 +- ..._VideoFrame.swift => TexImageSource.swift} | 18 ++-- ...ion_or_String.swift => TimerHandler.swift} | 8 +- ...ustedScriptURL.swift => TrustedType.swift} | 10 +- Sources/DOMKit/WebIDL/Typedefs.swift | 94 ++++++------------- ...atternInit.swift => URLPatternInput.swift} | 8 +- ...r_seq_of_GLuint.swift => Uint32List.swift} | 8 +- ...q_of_UInt32.swift => VibratePattern.swift} | 8 +- ...ams.swift => XMLHttpRequestBodyInit.swift} | 14 +-- ...xt.swift => XRWebGLRenderingContext.swift} | 8 +- Sources/WebIDLToSwift/Context.swift | 2 +- Sources/WebIDLToSwift/IDLBuilder.swift | 5 +- ...ift => UnionType+SwiftRepresentable.swift} | 24 +++-- Sources/WebIDLToSwift/UnionType.swift | 34 +++++-- .../WebIDL+SwiftRepresentation.swift | 20 +++- 66 files changed, 357 insertions(+), 362 deletions(-) rename Sources/DOMKit/WebIDL/{JSObject_or_String.swift => AlgorithmIdentifier.swift} (74%) rename Sources/DOMKit/WebIDL/{ArrayBuffer_or_ArrayBufferView.swift => BinaryData.swift} (72%) rename Sources/DOMKit/WebIDL/{Blob_or_BufferSource_or_String.swift => BlobPart.swift} (72%) rename Sources/DOMKit/WebIDL/{String_or_UInt32.swift => BluetoothServiceUUID.swift} (73%) rename Sources/DOMKit/WebIDL/{ReadableStream_or_XMLHttpRequestBodyInit.swift => BodyInit.swift} (71%) rename Sources/DOMKit/WebIDL/{CSSKeywordish_or_CSSNumberish.swift => CSSColorRGBComp.swift} (72%) rename Sources/DOMKit/WebIDL/{CSSKeywordValue_or_String.swift => CSSKeywordish.swift} (73%) rename Sources/DOMKit/WebIDL/{CSSNumericValue_or_Double.swift => CSSNumberish.swift} (73%) rename Sources/DOMKit/WebIDL/{CSSKeywordish_or_CSSNumericValue.swift => CSSPerspectiveValue.swift} (72%) rename Sources/DOMKit/WebIDL/{ReadableStream_or_String.swift => CSSStringSource.swift} (73%) rename Sources/DOMKit/WebIDL/{CSSParserValue_or_CSSStyleValue_or_String.swift => CSSToken.swift} (70%) rename Sources/DOMKit/WebIDL/{CSSVariableReferenceValue_or_String.swift => CSSUnparsedSegment.swift} (71%) rename Sources/DOMKit/WebIDL/{HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame.swift => CanvasImageSource.swift} (60%) rename Sources/DOMKit/WebIDL/{Bool_or_ConstrainBooleanParameters.swift => ConstrainBoolean.swift} (71%) rename Sources/DOMKit/WebIDL/{ConstrainDOMStringParameters_or_String_or_seq_of_String.swift => ConstrainDOMString.swift} (67%) rename Sources/DOMKit/WebIDL/{ConstrainDoubleRange_or_Double.swift => ConstrainDouble.swift} (72%) rename Sources/DOMKit/WebIDL/{ConstrainPoint2DParameters_or_seq_of_Point2D.swift => ConstrainPoint2D.swift} (69%) rename Sources/DOMKit/WebIDL/{ConstrainULongRange_or_UInt32.swift => ConstrainULong.swift} (72%) rename Sources/DOMKit/WebIDL/{SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__.swift => CryptoKeyID.swift} (70%) rename Sources/DOMKit/WebIDL/{Blob_or_BufferSource_or_String_or_WriteParams.swift => FileSystemWriteChunkType.swift} (68%) rename Sources/DOMKit/WebIDL/{Float32Array_or_seq_of_GLfloat.swift => Float32List.swift} (71%) rename Sources/DOMKit/WebIDL/{File_or_String.swift => FormDataEntryValue.swift} (74%) rename Sources/DOMKit/WebIDL/{GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView.swift => GPUBindingResource.swift} (65%) rename Sources/DOMKit/WebIDL/{GPUColorDict_or_seq_of_Double.swift => GPUColor.swift} (71%) rename Sources/DOMKit/WebIDL/{GPUOutOfMemoryError_or_GPUValidationError.swift => GPUError.swift} (70%) rename Sources/DOMKit/WebIDL/{GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate.swift => GPUExtent3D.swift} (69%) rename Sources/DOMKit/WebIDL/{GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate.swift => GPUOrigin2D.swift} (69%) rename Sources/DOMKit/WebIDL/{GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate.swift => GPUOrigin3D.swift} (69%) rename Sources/DOMKit/WebIDL/{CSSPseudoElement_or_Document_or_Element_or_Text.swift => GeometryNode.swift} (68%) rename Sources/DOMKit/WebIDL/{HTMLImageElement_or_SVGImageElement.swift => HTMLOrSVGImageElement.swift} (71%) rename Sources/DOMKit/WebIDL/{HTMLScriptElement_or_SVGScriptElement.swift => HTMLOrSVGScriptElement.swift} (71%) rename Sources/DOMKit/WebIDL/{record_String_to_String_or_seq_of_seq_of_String.swift => HeadersInit.swift} (67%) rename Sources/DOMKit/WebIDL/{Blob_or_CanvasImageSource_or_ImageData.swift => ImageBitmapSource.swift} (70%) rename Sources/DOMKit/WebIDL/{BufferSource_or_ReadableStream.swift => ImageBufferSource.swift} (72%) rename Sources/DOMKit/WebIDL/{Int32Array_or_seq_of_GLint.swift => Int32List.swift} (71%) rename Sources/DOMKit/WebIDL/{AutoKeyword_or_Double.swift => LineAndPositionSetting.swift} (73%) rename Sources/DOMKit/WebIDL/{ArrayBufferView_or_MLBufferResourceView.swift => MLBufferView.swift} (71%) rename Sources/DOMKit/WebIDL/{GPUTexture_or_MLBufferView_or_WebGLTexture.swift => MLResource.swift} (70%) rename Sources/DOMKit/WebIDL/{Blob_or_MediaSource_or_MediaStream.swift => MediaProvider.swift} (71%) rename Sources/DOMKit/WebIDL/{MessagePort_or_ServiceWorker_or_WindowProxy.swift => MessageEventSource.swift} (69%) rename Sources/DOMKit/WebIDL/{BufferSource_or_NDEFMessageInit_or_String.swift => NDEFMessageSource.swift} (70%) rename Sources/DOMKit/WebIDL/{GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift => OffscreenRenderingContext.swift} (59%) rename Sources/DOMKit/WebIDL/{HTMLFormElement_or_PasswordCredentialData.swift => PasswordCredentialInit.swift} (70%) rename Sources/DOMKit/WebIDL/{BufferSource_or_String.swift => PushMessageDataInit.swift} (74%) rename Sources/DOMKit/WebIDL/{RTCRtpScriptTransform_or_SFrameTransform.swift => RTCRtpTransform.swift} (71%) rename Sources/DOMKit/WebIDL/{ReadableByteStreamController_or_ReadableStreamDefaultController.swift => ReadableStreamController.swift} (68%) rename Sources/DOMKit/WebIDL/{ReadableStreamBYOBReader_or_ReadableStreamDefaultReader.swift => ReadableStreamReader.swift} (69%) rename Sources/DOMKit/WebIDL/{CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift => RenderingContext.swift} (60%) rename Sources/DOMKit/WebIDL/{Request_or_String.swift => RequestInfo.swift} (75%) rename Sources/DOMKit/WebIDL/{ContainerBasedOffset_or_ElementBasedOffset.swift => ScrollTimelineOffset.swift} (70%) rename Sources/DOMKit/WebIDL/{FileSystemHandle_or_WellKnownDirectory.swift => StartInDirectory.swift} (71%) rename Sources/DOMKit/WebIDL/{HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame.swift => TexImageSource.swift} (58%) rename Sources/DOMKit/WebIDL/{JSFunction_or_String.swift => TimerHandler.swift} (74%) rename Sources/DOMKit/WebIDL/{TrustedHTML_or_TrustedScript_or_TrustedScriptURL.swift => TrustedType.swift} (69%) rename Sources/DOMKit/WebIDL/{String_or_URLPatternInit.swift => URLPatternInput.swift} (73%) rename Sources/DOMKit/WebIDL/{Uint32Array_or_seq_of_GLuint.swift => Uint32List.swift} (71%) rename Sources/DOMKit/WebIDL/{UInt32_or_seq_of_UInt32.swift => VibratePattern.swift} (72%) rename Sources/DOMKit/WebIDL/{Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams.swift => XMLHttpRequestBodyInit.swift} (65%) rename Sources/DOMKit/WebIDL/{WebGL2RenderingContext_or_WebGLRenderingContext.swift => XRWebGLRenderingContext.swift} (70%) rename Sources/WebIDLToSwift/{UnionProtocol.swift => UnionType+SwiftRepresentable.swift} (88%) diff --git a/Package.resolved b/Package.resolved index e49cf6b6..726dcc77 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { "branch": "jed/open-object", - "revision": "d76f26a9e3807331c44048b0429d6ac8aba65f8a", + "revision": "e6dbd0b4738fe52d7135310a918ced77b62f2e0e", "version": null } } diff --git a/Sources/DOMKit/WebIDL/JSObject_or_String.swift b/Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift similarity index 74% rename from Sources/DOMKit/WebIDL/JSObject_or_String.swift rename to Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift index 8bfd4244..80b4c27c 100644 --- a/Sources/DOMKit/WebIDL/JSObject_or_String.swift +++ b/Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_JSObject_or_String: ConvertibleToJSValue {} -extension JSObject: Any_JSObject_or_String {} -extension String: Any_JSObject_or_String {} +public protocol Any_AlgorithmIdentifier: ConvertibleToJSValue {} +extension JSObject: Any_AlgorithmIdentifier {} +extension String: Any_AlgorithmIdentifier {} -public enum JSObject_or_String: JSValueCompatible, Any_JSObject_or_String { +public enum AlgorithmIdentifier: JSValueCompatible, Any_AlgorithmIdentifier { case jSObject(JSObject) case string(String) diff --git a/Sources/DOMKit/WebIDL/ArrayBuffer_or_ArrayBufferView.swift b/Sources/DOMKit/WebIDL/BinaryData.swift similarity index 72% rename from Sources/DOMKit/WebIDL/ArrayBuffer_or_ArrayBufferView.swift rename to Sources/DOMKit/WebIDL/BinaryData.swift index 4910b406..6dbd11cb 100644 --- a/Sources/DOMKit/WebIDL/ArrayBuffer_or_ArrayBufferView.swift +++ b/Sources/DOMKit/WebIDL/BinaryData.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ArrayBuffer_or_ArrayBufferView: ConvertibleToJSValue {} -extension ArrayBuffer: Any_ArrayBuffer_or_ArrayBufferView {} -extension ArrayBufferView: Any_ArrayBuffer_or_ArrayBufferView {} +public protocol Any_BinaryData: ConvertibleToJSValue {} +extension ArrayBuffer: Any_BinaryData {} +extension ArrayBufferView: Any_BinaryData {} -public enum ArrayBuffer_or_ArrayBufferView: JSValueCompatible, Any_ArrayBuffer_or_ArrayBufferView { +public enum BinaryData: JSValueCompatible, Any_BinaryData { case arrayBuffer(ArrayBuffer) case arrayBufferView(ArrayBufferView) diff --git a/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String.swift b/Sources/DOMKit/WebIDL/BlobPart.swift similarity index 72% rename from Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String.swift rename to Sources/DOMKit/WebIDL/BlobPart.swift index 5048dee9..dd024e64 100644 --- a/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String.swift +++ b/Sources/DOMKit/WebIDL/BlobPart.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Blob_or_BufferSource_or_String: ConvertibleToJSValue {} -extension Blob: Any_Blob_or_BufferSource_or_String {} -extension BufferSource: Any_Blob_or_BufferSource_or_String {} -extension String: Any_Blob_or_BufferSource_or_String {} +public protocol Any_BlobPart: ConvertibleToJSValue {} +extension Blob: Any_BlobPart {} +extension BufferSource: Any_BlobPart {} +extension String: Any_BlobPart {} -public enum Blob_or_BufferSource_or_String: JSValueCompatible, Any_Blob_or_BufferSource_or_String { +public enum BlobPart: JSValueCompatible, Any_BlobPart { case blob(Blob) case bufferSource(BufferSource) case string(String) diff --git a/Sources/DOMKit/WebIDL/String_or_UInt32.swift b/Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift similarity index 73% rename from Sources/DOMKit/WebIDL/String_or_UInt32.swift rename to Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift index 75a254c9..8a4b23fc 100644 --- a/Sources/DOMKit/WebIDL/String_or_UInt32.swift +++ b/Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_String_or_UInt32: ConvertibleToJSValue {} -extension String: Any_String_or_UInt32 {} -extension UInt32: Any_String_or_UInt32 {} +public protocol Any_BluetoothServiceUUID: ConvertibleToJSValue {} +extension String: Any_BluetoothServiceUUID {} +extension UInt32: Any_BluetoothServiceUUID {} -public enum String_or_UInt32: JSValueCompatible, Any_String_or_UInt32 { +public enum BluetoothServiceUUID: JSValueCompatible, Any_BluetoothServiceUUID { case string(String) case uInt32(UInt32) diff --git a/Sources/DOMKit/WebIDL/ReadableStream_or_XMLHttpRequestBodyInit.swift b/Sources/DOMKit/WebIDL/BodyInit.swift similarity index 71% rename from Sources/DOMKit/WebIDL/ReadableStream_or_XMLHttpRequestBodyInit.swift rename to Sources/DOMKit/WebIDL/BodyInit.swift index 3cf8370a..bda9c14e 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream_or_XMLHttpRequestBodyInit.swift +++ b/Sources/DOMKit/WebIDL/BodyInit.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ReadableStream_or_XMLHttpRequestBodyInit: ConvertibleToJSValue {} -extension ReadableStream: Any_ReadableStream_or_XMLHttpRequestBodyInit {} -extension XMLHttpRequestBodyInit: Any_ReadableStream_or_XMLHttpRequestBodyInit {} +public protocol Any_BodyInit: ConvertibleToJSValue {} +extension ReadableStream: Any_BodyInit {} +extension XMLHttpRequestBodyInit: Any_BodyInit {} -public enum ReadableStream_or_XMLHttpRequestBodyInit: JSValueCompatible, Any_ReadableStream_or_XMLHttpRequestBodyInit { +public enum BodyInit: JSValueCompatible, Any_BodyInit { case readableStream(ReadableStream) case xMLHttpRequestBodyInit(XMLHttpRequestBodyInit) diff --git a/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumberish.swift b/Sources/DOMKit/WebIDL/CSSColorRGBComp.swift similarity index 72% rename from Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumberish.swift rename to Sources/DOMKit/WebIDL/CSSColorRGBComp.swift index 632bd06a..771e17c5 100644 --- a/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumberish.swift +++ b/Sources/DOMKit/WebIDL/CSSColorRGBComp.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_CSSKeywordish_or_CSSNumberish: ConvertibleToJSValue {} -extension CSSKeywordish: Any_CSSKeywordish_or_CSSNumberish {} -extension CSSNumberish: Any_CSSKeywordish_or_CSSNumberish {} +public protocol Any_CSSColorRGBComp: ConvertibleToJSValue {} +extension CSSKeywordish: Any_CSSColorRGBComp {} +extension CSSNumberish: Any_CSSColorRGBComp {} -public enum CSSKeywordish_or_CSSNumberish: JSValueCompatible, Any_CSSKeywordish_or_CSSNumberish { +public enum CSSColorRGBComp: JSValueCompatible, Any_CSSColorRGBComp { case cSSKeywordish(CSSKeywordish) case cSSNumberish(CSSNumberish) diff --git a/Sources/DOMKit/WebIDL/CSSKeywordValue_or_String.swift b/Sources/DOMKit/WebIDL/CSSKeywordish.swift similarity index 73% rename from Sources/DOMKit/WebIDL/CSSKeywordValue_or_String.swift rename to Sources/DOMKit/WebIDL/CSSKeywordish.swift index b5e74de6..bf28f712 100644 --- a/Sources/DOMKit/WebIDL/CSSKeywordValue_or_String.swift +++ b/Sources/DOMKit/WebIDL/CSSKeywordish.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_CSSKeywordValue_or_String: ConvertibleToJSValue {} -extension CSSKeywordValue: Any_CSSKeywordValue_or_String {} -extension String: Any_CSSKeywordValue_or_String {} +public protocol Any_CSSKeywordish: ConvertibleToJSValue {} +extension CSSKeywordValue: Any_CSSKeywordish {} +extension String: Any_CSSKeywordish {} -public enum CSSKeywordValue_or_String: JSValueCompatible, Any_CSSKeywordValue_or_String { +public enum CSSKeywordish: JSValueCompatible, Any_CSSKeywordish { case cSSKeywordValue(CSSKeywordValue) case string(String) diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double.swift b/Sources/DOMKit/WebIDL/CSSNumberish.swift similarity index 73% rename from Sources/DOMKit/WebIDL/CSSNumericValue_or_Double.swift rename to Sources/DOMKit/WebIDL/CSSNumberish.swift index 97d01860..7b7bc3c7 100644 --- a/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double.swift +++ b/Sources/DOMKit/WebIDL/CSSNumberish.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_CSSNumericValue_or_Double: ConvertibleToJSValue {} -extension CSSNumericValue: Any_CSSNumericValue_or_Double {} -extension Double: Any_CSSNumericValue_or_Double {} +public protocol Any_CSSNumberish: ConvertibleToJSValue {} +extension CSSNumericValue: Any_CSSNumberish {} +extension Double: Any_CSSNumberish {} -public enum CSSNumericValue_or_Double: JSValueCompatible, Any_CSSNumericValue_or_Double { +public enum CSSNumberish: JSValueCompatible, Any_CSSNumberish { case cSSNumericValue(CSSNumericValue) case double(Double) diff --git a/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumericValue.swift b/Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift similarity index 72% rename from Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumericValue.swift rename to Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift index 5df19068..9c1ec9b6 100644 --- a/Sources/DOMKit/WebIDL/CSSKeywordish_or_CSSNumericValue.swift +++ b/Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_CSSKeywordish_or_CSSNumericValue: ConvertibleToJSValue {} -extension CSSKeywordish: Any_CSSKeywordish_or_CSSNumericValue {} -extension CSSNumericValue: Any_CSSKeywordish_or_CSSNumericValue {} +public protocol Any_CSSPerspectiveValue: ConvertibleToJSValue {} +extension CSSKeywordish: Any_CSSPerspectiveValue {} +extension CSSNumericValue: Any_CSSPerspectiveValue {} -public enum CSSKeywordish_or_CSSNumericValue: JSValueCompatible, Any_CSSKeywordish_or_CSSNumericValue { +public enum CSSPerspectiveValue: JSValueCompatible, Any_CSSPerspectiveValue { case cSSKeywordish(CSSKeywordish) case cSSNumericValue(CSSNumericValue) diff --git a/Sources/DOMKit/WebIDL/ReadableStream_or_String.swift b/Sources/DOMKit/WebIDL/CSSStringSource.swift similarity index 73% rename from Sources/DOMKit/WebIDL/ReadableStream_or_String.swift rename to Sources/DOMKit/WebIDL/CSSStringSource.swift index d023da8b..49e9b3cd 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream_or_String.swift +++ b/Sources/DOMKit/WebIDL/CSSStringSource.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ReadableStream_or_String: ConvertibleToJSValue {} -extension ReadableStream: Any_ReadableStream_or_String {} -extension String: Any_ReadableStream_or_String {} +public protocol Any_CSSStringSource: ConvertibleToJSValue {} +extension ReadableStream: Any_CSSStringSource {} +extension String: Any_CSSStringSource {} -public enum ReadableStream_or_String: JSValueCompatible, Any_ReadableStream_or_String { +public enum CSSStringSource: JSValueCompatible, Any_CSSStringSource { case readableStream(ReadableStream) case string(String) diff --git a/Sources/DOMKit/WebIDL/CSSParserValue_or_CSSStyleValue_or_String.swift b/Sources/DOMKit/WebIDL/CSSToken.swift similarity index 70% rename from Sources/DOMKit/WebIDL/CSSParserValue_or_CSSStyleValue_or_String.swift rename to Sources/DOMKit/WebIDL/CSSToken.swift index b34e2497..9a0d0c9f 100644 --- a/Sources/DOMKit/WebIDL/CSSParserValue_or_CSSStyleValue_or_String.swift +++ b/Sources/DOMKit/WebIDL/CSSToken.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_CSSParserValue_or_CSSStyleValue_or_String: ConvertibleToJSValue {} -extension CSSParserValue: Any_CSSParserValue_or_CSSStyleValue_or_String {} -extension CSSStyleValue: Any_CSSParserValue_or_CSSStyleValue_or_String {} -extension String: Any_CSSParserValue_or_CSSStyleValue_or_String {} +public protocol Any_CSSToken: ConvertibleToJSValue {} +extension CSSParserValue: Any_CSSToken {} +extension CSSStyleValue: Any_CSSToken {} +extension String: Any_CSSToken {} -public enum CSSParserValue_or_CSSStyleValue_or_String: JSValueCompatible, Any_CSSParserValue_or_CSSStyleValue_or_String { +public enum CSSToken: JSValueCompatible, Any_CSSToken { case cSSParserValue(CSSParserValue) case cSSStyleValue(CSSStyleValue) case string(String) diff --git a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue_or_String.swift b/Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift similarity index 71% rename from Sources/DOMKit/WebIDL/CSSVariableReferenceValue_or_String.swift rename to Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift index 89b8c691..8083d2b2 100644 --- a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue_or_String.swift +++ b/Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_CSSVariableReferenceValue_or_String: ConvertibleToJSValue {} -extension CSSVariableReferenceValue: Any_CSSVariableReferenceValue_or_String {} -extension String: Any_CSSVariableReferenceValue_or_String {} +public protocol Any_CSSUnparsedSegment: ConvertibleToJSValue {} +extension CSSVariableReferenceValue: Any_CSSUnparsedSegment {} +extension String: Any_CSSUnparsedSegment {} -public enum CSSVariableReferenceValue_or_String: JSValueCompatible, Any_CSSVariableReferenceValue_or_String { +public enum CSSUnparsedSegment: JSValueCompatible, Any_CSSUnparsedSegment { case cSSVariableReferenceValue(CSSVariableReferenceValue) case string(String) diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame.swift b/Sources/DOMKit/WebIDL/CanvasImageSource.swift similarity index 60% rename from Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame.swift rename to Sources/DOMKit/WebIDL/CanvasImageSource.swift index ab1ac02d..f8394292 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageSource.swift @@ -3,15 +3,15 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame: ConvertibleToJSValue {} -extension HTMLCanvasElement: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} -extension HTMLOrSVGImageElement: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} -extension HTMLVideoElement: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} -extension ImageBitmap: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} -extension OffscreenCanvas: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} -extension VideoFrame: Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame {} +public protocol Any_CanvasImageSource: ConvertibleToJSValue {} +extension HTMLCanvasElement: Any_CanvasImageSource {} +extension HTMLOrSVGImageElement: Any_CanvasImageSource {} +extension HTMLVideoElement: Any_CanvasImageSource {} +extension ImageBitmap: Any_CanvasImageSource {} +extension OffscreenCanvas: Any_CanvasImageSource {} +extension VideoFrame: Any_CanvasImageSource {} -public enum HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame: JSValueCompatible, Any_HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame { +public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { case hTMLCanvasElement(HTMLCanvasElement) case hTMLOrSVGImageElement(HTMLOrSVGImageElement) case hTMLVideoElement(HTMLVideoElement) diff --git a/Sources/DOMKit/WebIDL/Bool_or_ConstrainBooleanParameters.swift b/Sources/DOMKit/WebIDL/ConstrainBoolean.swift similarity index 71% rename from Sources/DOMKit/WebIDL/Bool_or_ConstrainBooleanParameters.swift rename to Sources/DOMKit/WebIDL/ConstrainBoolean.swift index 41e4f5ea..c5da22d0 100644 --- a/Sources/DOMKit/WebIDL/Bool_or_ConstrainBooleanParameters.swift +++ b/Sources/DOMKit/WebIDL/ConstrainBoolean.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Bool_or_ConstrainBooleanParameters: ConvertibleToJSValue {} -extension Bool: Any_Bool_or_ConstrainBooleanParameters {} -extension ConstrainBooleanParameters: Any_Bool_or_ConstrainBooleanParameters {} +public protocol Any_ConstrainBoolean: ConvertibleToJSValue {} +extension Bool: Any_ConstrainBoolean {} +extension ConstrainBooleanParameters: Any_ConstrainBoolean {} -public enum Bool_or_ConstrainBooleanParameters: JSValueCompatible, Any_Bool_or_ConstrainBooleanParameters { +public enum ConstrainBoolean: JSValueCompatible, Any_ConstrainBoolean { case bool(Bool) case constrainBooleanParameters(ConstrainBooleanParameters) diff --git a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters_or_String_or_seq_of_String.swift b/Sources/DOMKit/WebIDL/ConstrainDOMString.swift similarity index 67% rename from Sources/DOMKit/WebIDL/ConstrainDOMStringParameters_or_String_or_seq_of_String.swift rename to Sources/DOMKit/WebIDL/ConstrainDOMString.swift index a3d586d1..8329416d 100644 --- a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters_or_String_or_seq_of_String.swift +++ b/Sources/DOMKit/WebIDL/ConstrainDOMString.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ConstrainDOMStringParameters_or_String_or_seq_of_String: ConvertibleToJSValue {} -extension ConstrainDOMStringParameters: Any_ConstrainDOMStringParameters_or_String_or_seq_of_String {} -extension String: Any_ConstrainDOMStringParameters_or_String_or_seq_of_String {} -extension Array: Any_ConstrainDOMStringParameters_or_String_or_seq_of_String where Element == String {} +public protocol Any_ConstrainDOMString: ConvertibleToJSValue {} +extension ConstrainDOMStringParameters: Any_ConstrainDOMString {} +extension String: Any_ConstrainDOMString {} +extension Array: Any_ConstrainDOMString where Element == String {} -public enum ConstrainDOMStringParameters_or_String_or_seq_of_String: JSValueCompatible, Any_ConstrainDOMStringParameters_or_String_or_seq_of_String { +public enum ConstrainDOMString: JSValueCompatible, Any_ConstrainDOMString { case constrainDOMStringParameters(ConstrainDOMStringParameters) case string(String) case seq_of_String([String]) diff --git a/Sources/DOMKit/WebIDL/ConstrainDoubleRange_or_Double.swift b/Sources/DOMKit/WebIDL/ConstrainDouble.swift similarity index 72% rename from Sources/DOMKit/WebIDL/ConstrainDoubleRange_or_Double.swift rename to Sources/DOMKit/WebIDL/ConstrainDouble.swift index f2d4a30e..e48fa61e 100644 --- a/Sources/DOMKit/WebIDL/ConstrainDoubleRange_or_Double.swift +++ b/Sources/DOMKit/WebIDL/ConstrainDouble.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ConstrainDoubleRange_or_Double: ConvertibleToJSValue {} -extension ConstrainDoubleRange: Any_ConstrainDoubleRange_or_Double {} -extension Double: Any_ConstrainDoubleRange_or_Double {} +public protocol Any_ConstrainDouble: ConvertibleToJSValue {} +extension ConstrainDoubleRange: Any_ConstrainDouble {} +extension Double: Any_ConstrainDouble {} -public enum ConstrainDoubleRange_or_Double: JSValueCompatible, Any_ConstrainDoubleRange_or_Double { +public enum ConstrainDouble: JSValueCompatible, Any_ConstrainDouble { case constrainDoubleRange(ConstrainDoubleRange) case double(Double) diff --git a/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters_or_seq_of_Point2D.swift b/Sources/DOMKit/WebIDL/ConstrainPoint2D.swift similarity index 69% rename from Sources/DOMKit/WebIDL/ConstrainPoint2DParameters_or_seq_of_Point2D.swift rename to Sources/DOMKit/WebIDL/ConstrainPoint2D.swift index 1f09b198..7094d719 100644 --- a/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters_or_seq_of_Point2D.swift +++ b/Sources/DOMKit/WebIDL/ConstrainPoint2D.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ConstrainPoint2DParameters_or_seq_of_Point2D: ConvertibleToJSValue {} -extension ConstrainPoint2DParameters: Any_ConstrainPoint2DParameters_or_seq_of_Point2D {} -extension Array: Any_ConstrainPoint2DParameters_or_seq_of_Point2D where Element == Point2D {} +public protocol Any_ConstrainPoint2D: ConvertibleToJSValue {} +extension ConstrainPoint2DParameters: Any_ConstrainPoint2D {} +extension Array: Any_ConstrainPoint2D where Element == Point2D {} -public enum ConstrainPoint2DParameters_or_seq_of_Point2D: JSValueCompatible, Any_ConstrainPoint2DParameters_or_seq_of_Point2D { +public enum ConstrainPoint2D: JSValueCompatible, Any_ConstrainPoint2D { case constrainPoint2DParameters(ConstrainPoint2DParameters) case seq_of_Point2D([Point2D]) diff --git a/Sources/DOMKit/WebIDL/ConstrainULongRange_or_UInt32.swift b/Sources/DOMKit/WebIDL/ConstrainULong.swift similarity index 72% rename from Sources/DOMKit/WebIDL/ConstrainULongRange_or_UInt32.swift rename to Sources/DOMKit/WebIDL/ConstrainULong.swift index 026eaa50..0e0e938c 100644 --- a/Sources/DOMKit/WebIDL/ConstrainULongRange_or_UInt32.swift +++ b/Sources/DOMKit/WebIDL/ConstrainULong.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ConstrainULongRange_or_UInt32: ConvertibleToJSValue {} -extension ConstrainULongRange: Any_ConstrainULongRange_or_UInt32 {} -extension UInt32: Any_ConstrainULongRange_or_UInt32 {} +public protocol Any_ConstrainULong: ConvertibleToJSValue {} +extension ConstrainULongRange: Any_ConstrainULong {} +extension UInt32: Any_ConstrainULong {} -public enum ConstrainULongRange_or_UInt32: JSValueCompatible, Any_ConstrainULongRange_or_UInt32 { +public enum ConstrainULong: JSValueCompatible, Any_ConstrainULong { case constrainULongRange(ConstrainULongRange) case uInt32(UInt32) diff --git a/Sources/DOMKit/WebIDL/SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__.swift b/Sources/DOMKit/WebIDL/CryptoKeyID.swift similarity index 70% rename from Sources/DOMKit/WebIDL/SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__.swift rename to Sources/DOMKit/WebIDL/CryptoKeyID.swift index 14268418..ab11a08d 100644 --- a/Sources/DOMKit/WebIDL/SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__.swift +++ b/Sources/DOMKit/WebIDL/CryptoKeyID.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__: ConvertibleToJSValue {} -extension SmallCryptoKeyID: Any_SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__ {} -extension __UNSUPPORTED_BIGINT__: Any_SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__ {} +public protocol Any_CryptoKeyID: ConvertibleToJSValue {} +extension SmallCryptoKeyID: Any_CryptoKeyID {} +extension __UNSUPPORTED_BIGINT__: Any_CryptoKeyID {} -public enum SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__: JSValueCompatible, Any_SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__ { +public enum CryptoKeyID: JSValueCompatible, Any_CryptoKeyID { case smallCryptoKeyID(SmallCryptoKeyID) case __UNSUPPORTED_BIGINT__(__UNSUPPORTED_BIGINT__) diff --git a/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String_or_WriteParams.swift b/Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift similarity index 68% rename from Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String_or_WriteParams.swift rename to Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift index bbe1cdde..d52dedb6 100644 --- a/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_String_or_WriteParams.swift +++ b/Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Blob_or_BufferSource_or_String_or_WriteParams: ConvertibleToJSValue {} -extension Blob: Any_Blob_or_BufferSource_or_String_or_WriteParams {} -extension BufferSource: Any_Blob_or_BufferSource_or_String_or_WriteParams {} -extension String: Any_Blob_or_BufferSource_or_String_or_WriteParams {} -extension WriteParams: Any_Blob_or_BufferSource_or_String_or_WriteParams {} +public protocol Any_FileSystemWriteChunkType: ConvertibleToJSValue {} +extension Blob: Any_FileSystemWriteChunkType {} +extension BufferSource: Any_FileSystemWriteChunkType {} +extension String: Any_FileSystemWriteChunkType {} +extension WriteParams: Any_FileSystemWriteChunkType {} -public enum Blob_or_BufferSource_or_String_or_WriteParams: JSValueCompatible, Any_Blob_or_BufferSource_or_String_or_WriteParams { +public enum FileSystemWriteChunkType: JSValueCompatible, Any_FileSystemWriteChunkType { case blob(Blob) case bufferSource(BufferSource) case string(String) diff --git a/Sources/DOMKit/WebIDL/Float32Array_or_seq_of_GLfloat.swift b/Sources/DOMKit/WebIDL/Float32List.swift similarity index 71% rename from Sources/DOMKit/WebIDL/Float32Array_or_seq_of_GLfloat.swift rename to Sources/DOMKit/WebIDL/Float32List.swift index a8713dc8..5c6efaf1 100644 --- a/Sources/DOMKit/WebIDL/Float32Array_or_seq_of_GLfloat.swift +++ b/Sources/DOMKit/WebIDL/Float32List.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Float32Array_or_seq_of_GLfloat: ConvertibleToJSValue {} -extension Float32Array: Any_Float32Array_or_seq_of_GLfloat {} -extension Array: Any_Float32Array_or_seq_of_GLfloat where Element == GLfloat {} +public protocol Any_Float32List: ConvertibleToJSValue {} +extension Float32Array: Any_Float32List {} +extension Array: Any_Float32List where Element == GLfloat {} -public enum Float32Array_or_seq_of_GLfloat: JSValueCompatible, Any_Float32Array_or_seq_of_GLfloat { +public enum Float32List: JSValueCompatible, Any_Float32List { case float32Array(Float32Array) case seq_of_GLfloat([GLfloat]) diff --git a/Sources/DOMKit/WebIDL/File_or_String.swift b/Sources/DOMKit/WebIDL/FormDataEntryValue.swift similarity index 74% rename from Sources/DOMKit/WebIDL/File_or_String.swift rename to Sources/DOMKit/WebIDL/FormDataEntryValue.swift index 7cb1de64..b8fc63b8 100644 --- a/Sources/DOMKit/WebIDL/File_or_String.swift +++ b/Sources/DOMKit/WebIDL/FormDataEntryValue.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_File_or_String: ConvertibleToJSValue {} -extension File: Any_File_or_String {} -extension String: Any_File_or_String {} +public protocol Any_FormDataEntryValue: ConvertibleToJSValue {} +extension File: Any_FormDataEntryValue {} +extension String: Any_FormDataEntryValue {} -public enum File_or_String: JSValueCompatible, Any_File_or_String { +public enum FormDataEntryValue: JSValueCompatible, Any_FormDataEntryValue { case file(File) case string(String) diff --git a/Sources/DOMKit/WebIDL/GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView.swift b/Sources/DOMKit/WebIDL/GPUBindingResource.swift similarity index 65% rename from Sources/DOMKit/WebIDL/GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView.swift rename to Sources/DOMKit/WebIDL/GPUBindingResource.swift index 5a7364af..c6f6ad44 100644 --- a/Sources/DOMKit/WebIDL/GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView.swift +++ b/Sources/DOMKit/WebIDL/GPUBindingResource.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView: ConvertibleToJSValue {} -extension GPUBufferBinding: Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView {} -extension GPUExternalTexture: Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView {} -extension GPUSampler: Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView {} -extension GPUTextureView: Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView {} +public protocol Any_GPUBindingResource: ConvertibleToJSValue {} +extension GPUBufferBinding: Any_GPUBindingResource {} +extension GPUExternalTexture: Any_GPUBindingResource {} +extension GPUSampler: Any_GPUBindingResource {} +extension GPUTextureView: Any_GPUBindingResource {} -public enum GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView: JSValueCompatible, Any_GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView { +public enum GPUBindingResource: JSValueCompatible, Any_GPUBindingResource { case gPUBufferBinding(GPUBufferBinding) case gPUExternalTexture(GPUExternalTexture) case gPUSampler(GPUSampler) diff --git a/Sources/DOMKit/WebIDL/GPUColorDict_or_seq_of_Double.swift b/Sources/DOMKit/WebIDL/GPUColor.swift similarity index 71% rename from Sources/DOMKit/WebIDL/GPUColorDict_or_seq_of_Double.swift rename to Sources/DOMKit/WebIDL/GPUColor.swift index 23a899b3..ef52b901 100644 --- a/Sources/DOMKit/WebIDL/GPUColorDict_or_seq_of_Double.swift +++ b/Sources/DOMKit/WebIDL/GPUColor.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_GPUColorDict_or_seq_of_Double: ConvertibleToJSValue {} -extension GPUColorDict: Any_GPUColorDict_or_seq_of_Double {} -extension Array: Any_GPUColorDict_or_seq_of_Double where Element == Double {} +public protocol Any_GPUColor: ConvertibleToJSValue {} +extension GPUColorDict: Any_GPUColor {} +extension Array: Any_GPUColor where Element == Double {} -public enum GPUColorDict_or_seq_of_Double: JSValueCompatible, Any_GPUColorDict_or_seq_of_Double { +public enum GPUColor: JSValueCompatible, Any_GPUColor { case gPUColorDict(GPUColorDict) case seq_of_Double([Double]) diff --git a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError_or_GPUValidationError.swift b/Sources/DOMKit/WebIDL/GPUError.swift similarity index 70% rename from Sources/DOMKit/WebIDL/GPUOutOfMemoryError_or_GPUValidationError.swift rename to Sources/DOMKit/WebIDL/GPUError.swift index b8ec1293..3fa8e559 100644 --- a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError_or_GPUValidationError.swift +++ b/Sources/DOMKit/WebIDL/GPUError.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_GPUOutOfMemoryError_or_GPUValidationError: ConvertibleToJSValue {} -extension GPUOutOfMemoryError: Any_GPUOutOfMemoryError_or_GPUValidationError {} -extension GPUValidationError: Any_GPUOutOfMemoryError_or_GPUValidationError {} +public protocol Any_GPUError: ConvertibleToJSValue {} +extension GPUOutOfMemoryError: Any_GPUError {} +extension GPUValidationError: Any_GPUError {} -public enum GPUOutOfMemoryError_or_GPUValidationError: JSValueCompatible, Any_GPUOutOfMemoryError_or_GPUValidationError { +public enum GPUError: JSValueCompatible, Any_GPUError { case gPUOutOfMemoryError(GPUOutOfMemoryError) case gPUValidationError(GPUValidationError) diff --git a/Sources/DOMKit/WebIDL/GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate.swift b/Sources/DOMKit/WebIDL/GPUExtent3D.swift similarity index 69% rename from Sources/DOMKit/WebIDL/GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate.swift rename to Sources/DOMKit/WebIDL/GPUExtent3D.swift index 70ee7407..bbf8e84d 100644 --- a/Sources/DOMKit/WebIDL/GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate.swift +++ b/Sources/DOMKit/WebIDL/GPUExtent3D.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate: ConvertibleToJSValue {} -extension GPUExtent3DDict: Any_GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate {} -extension Array: Any_GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate where Element == GPUIntegerCoordinate {} +public protocol Any_GPUExtent3D: ConvertibleToJSValue {} +extension GPUExtent3DDict: Any_GPUExtent3D {} +extension Array: Any_GPUExtent3D where Element == GPUIntegerCoordinate {} -public enum GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate: JSValueCompatible, Any_GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate { +public enum GPUExtent3D: JSValueCompatible, Any_GPUExtent3D { case gPUExtent3DDict(GPUExtent3DDict) case seq_of_GPUIntegerCoordinate([GPUIntegerCoordinate]) diff --git a/Sources/DOMKit/WebIDL/GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate.swift b/Sources/DOMKit/WebIDL/GPUOrigin2D.swift similarity index 69% rename from Sources/DOMKit/WebIDL/GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate.swift rename to Sources/DOMKit/WebIDL/GPUOrigin2D.swift index ac71d7ed..a2df976d 100644 --- a/Sources/DOMKit/WebIDL/GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate.swift +++ b/Sources/DOMKit/WebIDL/GPUOrigin2D.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate: ConvertibleToJSValue {} -extension GPUOrigin2DDict: Any_GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate {} -extension Array: Any_GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate where Element == GPUIntegerCoordinate {} +public protocol Any_GPUOrigin2D: ConvertibleToJSValue {} +extension GPUOrigin2DDict: Any_GPUOrigin2D {} +extension Array: Any_GPUOrigin2D where Element == GPUIntegerCoordinate {} -public enum GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate: JSValueCompatible, Any_GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate { +public enum GPUOrigin2D: JSValueCompatible, Any_GPUOrigin2D { case gPUOrigin2DDict(GPUOrigin2DDict) case seq_of_GPUIntegerCoordinate([GPUIntegerCoordinate]) diff --git a/Sources/DOMKit/WebIDL/GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate.swift b/Sources/DOMKit/WebIDL/GPUOrigin3D.swift similarity index 69% rename from Sources/DOMKit/WebIDL/GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate.swift rename to Sources/DOMKit/WebIDL/GPUOrigin3D.swift index 2b875d0d..f37f49c5 100644 --- a/Sources/DOMKit/WebIDL/GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate.swift +++ b/Sources/DOMKit/WebIDL/GPUOrigin3D.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate: ConvertibleToJSValue {} -extension GPUOrigin3DDict: Any_GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate {} -extension Array: Any_GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate where Element == GPUIntegerCoordinate {} +public protocol Any_GPUOrigin3D: ConvertibleToJSValue {} +extension GPUOrigin3DDict: Any_GPUOrigin3D {} +extension Array: Any_GPUOrigin3D where Element == GPUIntegerCoordinate {} -public enum GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate: JSValueCompatible, Any_GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate { +public enum GPUOrigin3D: JSValueCompatible, Any_GPUOrigin3D { case gPUOrigin3DDict(GPUOrigin3DDict) case seq_of_GPUIntegerCoordinate([GPUIntegerCoordinate]) diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Document_or_Element_or_Text.swift b/Sources/DOMKit/WebIDL/GeometryNode.swift similarity index 68% rename from Sources/DOMKit/WebIDL/CSSPseudoElement_or_Document_or_Element_or_Text.swift rename to Sources/DOMKit/WebIDL/GeometryNode.swift index 32c33737..dca84f09 100644 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Document_or_Element_or_Text.swift +++ b/Sources/DOMKit/WebIDL/GeometryNode.swift @@ -3,13 +3,13 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_CSSPseudoElement_or_Document_or_Element_or_Text: ConvertibleToJSValue {} -extension CSSPseudoElement: Any_CSSPseudoElement_or_Document_or_Element_or_Text {} -extension Document: Any_CSSPseudoElement_or_Document_or_Element_or_Text {} -extension Element: Any_CSSPseudoElement_or_Document_or_Element_or_Text {} -extension Text: Any_CSSPseudoElement_or_Document_or_Element_or_Text {} +public protocol Any_GeometryNode: ConvertibleToJSValue {} +extension CSSPseudoElement: Any_GeometryNode {} +extension Document: Any_GeometryNode {} +extension Element: Any_GeometryNode {} +extension Text: Any_GeometryNode {} -public enum CSSPseudoElement_or_Document_or_Element_or_Text: JSValueCompatible, Any_CSSPseudoElement_or_Document_or_Element_or_Text { +public enum GeometryNode: JSValueCompatible, Any_GeometryNode { case cSSPseudoElement(CSSPseudoElement) case document(Document) case element(Element) diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement_or_SVGImageElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift similarity index 71% rename from Sources/DOMKit/WebIDL/HTMLImageElement_or_SVGImageElement.swift rename to Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift index 7386fff0..c8c9f1da 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement_or_SVGImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_HTMLImageElement_or_SVGImageElement: ConvertibleToJSValue {} -extension HTMLImageElement: Any_HTMLImageElement_or_SVGImageElement {} -extension SVGImageElement: Any_HTMLImageElement_or_SVGImageElement {} +public protocol Any_HTMLOrSVGImageElement: ConvertibleToJSValue {} +extension HTMLImageElement: Any_HTMLOrSVGImageElement {} +extension SVGImageElement: Any_HTMLOrSVGImageElement {} -public enum HTMLImageElement_or_SVGImageElement: JSValueCompatible, Any_HTMLImageElement_or_SVGImageElement { +public enum HTMLOrSVGImageElement: JSValueCompatible, Any_HTMLOrSVGImageElement { case hTMLImageElement(HTMLImageElement) case sVGImageElement(SVGImageElement) diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement_or_SVGScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift similarity index 71% rename from Sources/DOMKit/WebIDL/HTMLScriptElement_or_SVGScriptElement.swift rename to Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift index 49ab6bf3..7ad6008a 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement_or_SVGScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_HTMLScriptElement_or_SVGScriptElement: ConvertibleToJSValue {} -extension HTMLScriptElement: Any_HTMLScriptElement_or_SVGScriptElement {} -extension SVGScriptElement: Any_HTMLScriptElement_or_SVGScriptElement {} +public protocol Any_HTMLOrSVGScriptElement: ConvertibleToJSValue {} +extension HTMLScriptElement: Any_HTMLOrSVGScriptElement {} +extension SVGScriptElement: Any_HTMLOrSVGScriptElement {} -public enum HTMLScriptElement_or_SVGScriptElement: JSValueCompatible, Any_HTMLScriptElement_or_SVGScriptElement { +public enum HTMLOrSVGScriptElement: JSValueCompatible, Any_HTMLOrSVGScriptElement { case hTMLScriptElement(HTMLScriptElement) case sVGScriptElement(SVGScriptElement) diff --git a/Sources/DOMKit/WebIDL/record_String_to_String_or_seq_of_seq_of_String.swift b/Sources/DOMKit/WebIDL/HeadersInit.swift similarity index 67% rename from Sources/DOMKit/WebIDL/record_String_to_String_or_seq_of_seq_of_String.swift rename to Sources/DOMKit/WebIDL/HeadersInit.swift index 8f3995c7..66b59cfd 100644 --- a/Sources/DOMKit/WebIDL/record_String_to_String_or_seq_of_seq_of_String.swift +++ b/Sources/DOMKit/WebIDL/HeadersInit.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_record_String_to_String_or_seq_of_seq_of_String: ConvertibleToJSValue {} -extension Dictionary: Any_record_String_to_String_or_seq_of_seq_of_String where Key == String, Value == String {} -extension Array: Any_record_String_to_String_or_seq_of_seq_of_String where Element == [String] {} +public protocol Any_HeadersInit: ConvertibleToJSValue {} +extension Dictionary: Any_HeadersInit where Key == String, Value == String {} +extension Array: Any_HeadersInit where Element == [String] {} -public enum record_String_to_String_or_seq_of_seq_of_String: JSValueCompatible, Any_record_String_to_String_or_seq_of_seq_of_String { +public enum HeadersInit: JSValueCompatible, Any_HeadersInit { case record_String_to_String([String: String]) case seq_of_seq_of_String([[String]]) diff --git a/Sources/DOMKit/WebIDL/Blob_or_CanvasImageSource_or_ImageData.swift b/Sources/DOMKit/WebIDL/ImageBitmapSource.swift similarity index 70% rename from Sources/DOMKit/WebIDL/Blob_or_CanvasImageSource_or_ImageData.swift rename to Sources/DOMKit/WebIDL/ImageBitmapSource.swift index 352fe20b..b0915f5c 100644 --- a/Sources/DOMKit/WebIDL/Blob_or_CanvasImageSource_or_ImageData.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapSource.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Blob_or_CanvasImageSource_or_ImageData: ConvertibleToJSValue {} -extension Blob: Any_Blob_or_CanvasImageSource_or_ImageData {} -extension CanvasImageSource: Any_Blob_or_CanvasImageSource_or_ImageData {} -extension ImageData: Any_Blob_or_CanvasImageSource_or_ImageData {} +public protocol Any_ImageBitmapSource: ConvertibleToJSValue {} +extension Blob: Any_ImageBitmapSource {} +extension CanvasImageSource: Any_ImageBitmapSource {} +extension ImageData: Any_ImageBitmapSource {} -public enum Blob_or_CanvasImageSource_or_ImageData: JSValueCompatible, Any_Blob_or_CanvasImageSource_or_ImageData { +public enum ImageBitmapSource: JSValueCompatible, Any_ImageBitmapSource { case blob(Blob) case canvasImageSource(CanvasImageSource) case imageData(ImageData) diff --git a/Sources/DOMKit/WebIDL/BufferSource_or_ReadableStream.swift b/Sources/DOMKit/WebIDL/ImageBufferSource.swift similarity index 72% rename from Sources/DOMKit/WebIDL/BufferSource_or_ReadableStream.swift rename to Sources/DOMKit/WebIDL/ImageBufferSource.swift index 78d3c185..aab3e594 100644 --- a/Sources/DOMKit/WebIDL/BufferSource_or_ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ImageBufferSource.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_BufferSource_or_ReadableStream: ConvertibleToJSValue {} -extension BufferSource: Any_BufferSource_or_ReadableStream {} -extension ReadableStream: Any_BufferSource_or_ReadableStream {} +public protocol Any_ImageBufferSource: ConvertibleToJSValue {} +extension BufferSource: Any_ImageBufferSource {} +extension ReadableStream: Any_ImageBufferSource {} -public enum BufferSource_or_ReadableStream: JSValueCompatible, Any_BufferSource_or_ReadableStream { +public enum ImageBufferSource: JSValueCompatible, Any_ImageBufferSource { case bufferSource(BufferSource) case readableStream(ReadableStream) diff --git a/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLint.swift b/Sources/DOMKit/WebIDL/Int32List.swift similarity index 71% rename from Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLint.swift rename to Sources/DOMKit/WebIDL/Int32List.swift index 65fec7f0..d760b21c 100644 --- a/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLint.swift +++ b/Sources/DOMKit/WebIDL/Int32List.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Int32Array_or_seq_of_GLint: ConvertibleToJSValue {} -extension Int32Array: Any_Int32Array_or_seq_of_GLint {} -extension Array: Any_Int32Array_or_seq_of_GLint where Element == GLint {} +public protocol Any_Int32List: ConvertibleToJSValue {} +extension Int32Array: Any_Int32List {} +extension Array: Any_Int32List where Element == GLint {} -public enum Int32Array_or_seq_of_GLint: JSValueCompatible, Any_Int32Array_or_seq_of_GLint { +public enum Int32List: JSValueCompatible, Any_Int32List { case int32Array(Int32Array) case seq_of_GLint([GLint]) diff --git a/Sources/DOMKit/WebIDL/AutoKeyword_or_Double.swift b/Sources/DOMKit/WebIDL/LineAndPositionSetting.swift similarity index 73% rename from Sources/DOMKit/WebIDL/AutoKeyword_or_Double.swift rename to Sources/DOMKit/WebIDL/LineAndPositionSetting.swift index 930368de..20ff97dc 100644 --- a/Sources/DOMKit/WebIDL/AutoKeyword_or_Double.swift +++ b/Sources/DOMKit/WebIDL/LineAndPositionSetting.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_AutoKeyword_or_Double: ConvertibleToJSValue {} -extension AutoKeyword: Any_AutoKeyword_or_Double {} -extension Double: Any_AutoKeyword_or_Double {} +public protocol Any_LineAndPositionSetting: ConvertibleToJSValue {} +extension AutoKeyword: Any_LineAndPositionSetting {} +extension Double: Any_LineAndPositionSetting {} -public enum AutoKeyword_or_Double: JSValueCompatible, Any_AutoKeyword_or_Double { +public enum LineAndPositionSetting: JSValueCompatible, Any_LineAndPositionSetting { case autoKeyword(AutoKeyword) case double(Double) diff --git a/Sources/DOMKit/WebIDL/ArrayBufferView_or_MLBufferResourceView.swift b/Sources/DOMKit/WebIDL/MLBufferView.swift similarity index 71% rename from Sources/DOMKit/WebIDL/ArrayBufferView_or_MLBufferResourceView.swift rename to Sources/DOMKit/WebIDL/MLBufferView.swift index 7e89d9b3..2d40ccbe 100644 --- a/Sources/DOMKit/WebIDL/ArrayBufferView_or_MLBufferResourceView.swift +++ b/Sources/DOMKit/WebIDL/MLBufferView.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ArrayBufferView_or_MLBufferResourceView: ConvertibleToJSValue {} -extension ArrayBufferView: Any_ArrayBufferView_or_MLBufferResourceView {} -extension MLBufferResourceView: Any_ArrayBufferView_or_MLBufferResourceView {} +public protocol Any_MLBufferView: ConvertibleToJSValue {} +extension ArrayBufferView: Any_MLBufferView {} +extension MLBufferResourceView: Any_MLBufferView {} -public enum ArrayBufferView_or_MLBufferResourceView: JSValueCompatible, Any_ArrayBufferView_or_MLBufferResourceView { +public enum MLBufferView: JSValueCompatible, Any_MLBufferView { case arrayBufferView(ArrayBufferView) case mLBufferResourceView(MLBufferResourceView) diff --git a/Sources/DOMKit/WebIDL/GPUTexture_or_MLBufferView_or_WebGLTexture.swift b/Sources/DOMKit/WebIDL/MLResource.swift similarity index 70% rename from Sources/DOMKit/WebIDL/GPUTexture_or_MLBufferView_or_WebGLTexture.swift rename to Sources/DOMKit/WebIDL/MLResource.swift index 6b91f2c5..3ae9b00e 100644 --- a/Sources/DOMKit/WebIDL/GPUTexture_or_MLBufferView_or_WebGLTexture.swift +++ b/Sources/DOMKit/WebIDL/MLResource.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_GPUTexture_or_MLBufferView_or_WebGLTexture: ConvertibleToJSValue {} -extension GPUTexture: Any_GPUTexture_or_MLBufferView_or_WebGLTexture {} -extension MLBufferView: Any_GPUTexture_or_MLBufferView_or_WebGLTexture {} -extension WebGLTexture: Any_GPUTexture_or_MLBufferView_or_WebGLTexture {} +public protocol Any_MLResource: ConvertibleToJSValue {} +extension GPUTexture: Any_MLResource {} +extension MLBufferView: Any_MLResource {} +extension WebGLTexture: Any_MLResource {} -public enum GPUTexture_or_MLBufferView_or_WebGLTexture: JSValueCompatible, Any_GPUTexture_or_MLBufferView_or_WebGLTexture { +public enum MLResource: JSValueCompatible, Any_MLResource { case gPUTexture(GPUTexture) case mLBufferView(MLBufferView) case webGLTexture(WebGLTexture) diff --git a/Sources/DOMKit/WebIDL/Blob_or_MediaSource_or_MediaStream.swift b/Sources/DOMKit/WebIDL/MediaProvider.swift similarity index 71% rename from Sources/DOMKit/WebIDL/Blob_or_MediaSource_or_MediaStream.swift rename to Sources/DOMKit/WebIDL/MediaProvider.swift index f7c6f38e..76736f3d 100644 --- a/Sources/DOMKit/WebIDL/Blob_or_MediaSource_or_MediaStream.swift +++ b/Sources/DOMKit/WebIDL/MediaProvider.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Blob_or_MediaSource_or_MediaStream: ConvertibleToJSValue {} -extension Blob: Any_Blob_or_MediaSource_or_MediaStream {} -extension MediaSource: Any_Blob_or_MediaSource_or_MediaStream {} -extension MediaStream: Any_Blob_or_MediaSource_or_MediaStream {} +public protocol Any_MediaProvider: ConvertibleToJSValue {} +extension Blob: Any_MediaProvider {} +extension MediaSource: Any_MediaProvider {} +extension MediaStream: Any_MediaProvider {} -public enum Blob_or_MediaSource_or_MediaStream: JSValueCompatible, Any_Blob_or_MediaSource_or_MediaStream { +public enum MediaProvider: JSValueCompatible, Any_MediaProvider { case blob(Blob) case mediaSource(MediaSource) case mediaStream(MediaStream) diff --git a/Sources/DOMKit/WebIDL/MessagePort_or_ServiceWorker_or_WindowProxy.swift b/Sources/DOMKit/WebIDL/MessageEventSource.swift similarity index 69% rename from Sources/DOMKit/WebIDL/MessagePort_or_ServiceWorker_or_WindowProxy.swift rename to Sources/DOMKit/WebIDL/MessageEventSource.swift index 165b51cf..43cefc39 100644 --- a/Sources/DOMKit/WebIDL/MessagePort_or_ServiceWorker_or_WindowProxy.swift +++ b/Sources/DOMKit/WebIDL/MessageEventSource.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_MessagePort_or_ServiceWorker_or_WindowProxy: ConvertibleToJSValue {} -extension MessagePort: Any_MessagePort_or_ServiceWorker_or_WindowProxy {} -extension ServiceWorker: Any_MessagePort_or_ServiceWorker_or_WindowProxy {} -extension WindowProxy: Any_MessagePort_or_ServiceWorker_or_WindowProxy {} +public protocol Any_MessageEventSource: ConvertibleToJSValue {} +extension MessagePort: Any_MessageEventSource {} +extension ServiceWorker: Any_MessageEventSource {} +extension WindowProxy: Any_MessageEventSource {} -public enum MessagePort_or_ServiceWorker_or_WindowProxy: JSValueCompatible, Any_MessagePort_or_ServiceWorker_or_WindowProxy { +public enum MessageEventSource: JSValueCompatible, Any_MessageEventSource { case messagePort(MessagePort) case serviceWorker(ServiceWorker) case windowProxy(WindowProxy) diff --git a/Sources/DOMKit/WebIDL/BufferSource_or_NDEFMessageInit_or_String.swift b/Sources/DOMKit/WebIDL/NDEFMessageSource.swift similarity index 70% rename from Sources/DOMKit/WebIDL/BufferSource_or_NDEFMessageInit_or_String.swift rename to Sources/DOMKit/WebIDL/NDEFMessageSource.swift index b7a7f23d..292220d8 100644 --- a/Sources/DOMKit/WebIDL/BufferSource_or_NDEFMessageInit_or_String.swift +++ b/Sources/DOMKit/WebIDL/NDEFMessageSource.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_BufferSource_or_NDEFMessageInit_or_String: ConvertibleToJSValue {} -extension BufferSource: Any_BufferSource_or_NDEFMessageInit_or_String {} -extension NDEFMessageInit: Any_BufferSource_or_NDEFMessageInit_or_String {} -extension String: Any_BufferSource_or_NDEFMessageInit_or_String {} +public protocol Any_NDEFMessageSource: ConvertibleToJSValue {} +extension BufferSource: Any_NDEFMessageSource {} +extension NDEFMessageInit: Any_NDEFMessageSource {} +extension String: Any_NDEFMessageSource {} -public enum BufferSource_or_NDEFMessageInit_or_String: JSValueCompatible, Any_BufferSource_or_NDEFMessageInit_or_String { +public enum NDEFMessageSource: JSValueCompatible, Any_NDEFMessageSource { case bufferSource(BufferSource) case nDEFMessageInit(NDEFMessageInit) case string(String) diff --git a/Sources/DOMKit/WebIDL/GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift similarity index 59% rename from Sources/DOMKit/WebIDL/GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift rename to Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift index 4f2de66a..9624bc7e 100644 --- a/Sources/DOMKit/WebIDL/GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift @@ -3,14 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext: ConvertibleToJSValue {} -extension GPUCanvasContext: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} -extension ImageBitmapRenderingContext: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} -extension OffscreenCanvasRenderingContext2D: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} -extension WebGL2RenderingContext: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} -extension WebGLRenderingContext: Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +public protocol Any_OffscreenRenderingContext: ConvertibleToJSValue {} +extension GPUCanvasContext: Any_OffscreenRenderingContext {} +extension ImageBitmapRenderingContext: Any_OffscreenRenderingContext {} +extension OffscreenCanvasRenderingContext2D: Any_OffscreenRenderingContext {} +extension WebGL2RenderingContext: Any_OffscreenRenderingContext {} +extension WebGLRenderingContext: Any_OffscreenRenderingContext {} -public enum GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext: JSValueCompatible, Any_GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext { +public enum OffscreenRenderingContext: JSValueCompatible, Any_OffscreenRenderingContext { case gPUCanvasContext(GPUCanvasContext) case imageBitmapRenderingContext(ImageBitmapRenderingContext) case offscreenCanvasRenderingContext2D(OffscreenCanvasRenderingContext2D) diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement_or_PasswordCredentialData.swift b/Sources/DOMKit/WebIDL/PasswordCredentialInit.swift similarity index 70% rename from Sources/DOMKit/WebIDL/HTMLFormElement_or_PasswordCredentialData.swift rename to Sources/DOMKit/WebIDL/PasswordCredentialInit.swift index fa7e188a..180b686c 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement_or_PasswordCredentialData.swift +++ b/Sources/DOMKit/WebIDL/PasswordCredentialInit.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_HTMLFormElement_or_PasswordCredentialData: ConvertibleToJSValue {} -extension HTMLFormElement: Any_HTMLFormElement_or_PasswordCredentialData {} -extension PasswordCredentialData: Any_HTMLFormElement_or_PasswordCredentialData {} +public protocol Any_PasswordCredentialInit: ConvertibleToJSValue {} +extension HTMLFormElement: Any_PasswordCredentialInit {} +extension PasswordCredentialData: Any_PasswordCredentialInit {} -public enum HTMLFormElement_or_PasswordCredentialData: JSValueCompatible, Any_HTMLFormElement_or_PasswordCredentialData { +public enum PasswordCredentialInit: JSValueCompatible, Any_PasswordCredentialInit { case hTMLFormElement(HTMLFormElement) case passwordCredentialData(PasswordCredentialData) diff --git a/Sources/DOMKit/WebIDL/BufferSource_or_String.swift b/Sources/DOMKit/WebIDL/PushMessageDataInit.swift similarity index 74% rename from Sources/DOMKit/WebIDL/BufferSource_or_String.swift rename to Sources/DOMKit/WebIDL/PushMessageDataInit.swift index 52cf7846..a5a09abc 100644 --- a/Sources/DOMKit/WebIDL/BufferSource_or_String.swift +++ b/Sources/DOMKit/WebIDL/PushMessageDataInit.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_BufferSource_or_String: ConvertibleToJSValue {} -extension BufferSource: Any_BufferSource_or_String {} -extension String: Any_BufferSource_or_String {} +public protocol Any_PushMessageDataInit: ConvertibleToJSValue {} +extension BufferSource: Any_PushMessageDataInit {} +extension String: Any_PushMessageDataInit {} -public enum BufferSource_or_String: JSValueCompatible, Any_BufferSource_or_String { +public enum PushMessageDataInit: JSValueCompatible, Any_PushMessageDataInit { case bufferSource(BufferSource) case string(String) diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform_or_SFrameTransform.swift b/Sources/DOMKit/WebIDL/RTCRtpTransform.swift similarity index 71% rename from Sources/DOMKit/WebIDL/RTCRtpScriptTransform_or_SFrameTransform.swift rename to Sources/DOMKit/WebIDL/RTCRtpTransform.swift index 3817a173..b4c7e459 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform_or_SFrameTransform.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpTransform.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_RTCRtpScriptTransform_or_SFrameTransform: ConvertibleToJSValue {} -extension RTCRtpScriptTransform: Any_RTCRtpScriptTransform_or_SFrameTransform {} -extension SFrameTransform: Any_RTCRtpScriptTransform_or_SFrameTransform {} +public protocol Any_RTCRtpTransform: ConvertibleToJSValue {} +extension RTCRtpScriptTransform: Any_RTCRtpTransform {} +extension SFrameTransform: Any_RTCRtpTransform {} -public enum RTCRtpScriptTransform_or_SFrameTransform: JSValueCompatible, Any_RTCRtpScriptTransform_or_SFrameTransform { +public enum RTCRtpTransform: JSValueCompatible, Any_RTCRtpTransform { case rTCRtpScriptTransform(RTCRtpScriptTransform) case sFrameTransform(SFrameTransform) diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController_or_ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamController.swift similarity index 68% rename from Sources/DOMKit/WebIDL/ReadableByteStreamController_or_ReadableStreamDefaultController.swift rename to Sources/DOMKit/WebIDL/ReadableStreamController.swift index 4e994a1a..8c01391f 100644 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController_or_ReadableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamController.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ReadableByteStreamController_or_ReadableStreamDefaultController: ConvertibleToJSValue {} -extension ReadableByteStreamController: Any_ReadableByteStreamController_or_ReadableStreamDefaultController {} -extension ReadableStreamDefaultController: Any_ReadableByteStreamController_or_ReadableStreamDefaultController {} +public protocol Any_ReadableStreamController: ConvertibleToJSValue {} +extension ReadableByteStreamController: Any_ReadableStreamController {} +extension ReadableStreamDefaultController: Any_ReadableStreamController {} -public enum ReadableByteStreamController_or_ReadableStreamDefaultController: JSValueCompatible, Any_ReadableByteStreamController_or_ReadableStreamDefaultController { +public enum ReadableStreamController: JSValueCompatible, Any_ReadableStreamController { case readableByteStreamController(ReadableByteStreamController) case readableStreamDefaultController(ReadableStreamDefaultController) diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader_or_ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamReader.swift similarity index 69% rename from Sources/DOMKit/WebIDL/ReadableStreamBYOBReader_or_ReadableStreamDefaultReader.swift rename to Sources/DOMKit/WebIDL/ReadableStreamReader.swift index 2c78b5ce..046f52c4 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader_or_ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamReader.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ReadableStreamBYOBReader_or_ReadableStreamDefaultReader: ConvertibleToJSValue {} -extension ReadableStreamBYOBReader: Any_ReadableStreamBYOBReader_or_ReadableStreamDefaultReader {} -extension ReadableStreamDefaultReader: Any_ReadableStreamBYOBReader_or_ReadableStreamDefaultReader {} +public protocol Any_ReadableStreamReader: ConvertibleToJSValue {} +extension ReadableStreamBYOBReader: Any_ReadableStreamReader {} +extension ReadableStreamDefaultReader: Any_ReadableStreamReader {} -public enum ReadableStreamBYOBReader_or_ReadableStreamDefaultReader: JSValueCompatible, Any_ReadableStreamBYOBReader_or_ReadableStreamDefaultReader { +public enum ReadableStreamReader: JSValueCompatible, Any_ReadableStreamReader { case readableStreamBYOBReader(ReadableStreamBYOBReader) case readableStreamDefaultReader(ReadableStreamDefaultReader) diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/RenderingContext.swift similarity index 60% rename from Sources/DOMKit/WebIDL/CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift rename to Sources/DOMKit/WebIDL/RenderingContext.swift index e905e8ef..15d96965 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/RenderingContext.swift @@ -3,14 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext: ConvertibleToJSValue {} -extension CanvasRenderingContext2D: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} -extension GPUCanvasContext: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} -extension ImageBitmapRenderingContext: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} -extension WebGL2RenderingContext: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} -extension WebGLRenderingContext: Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext {} +public protocol Any_RenderingContext: ConvertibleToJSValue {} +extension CanvasRenderingContext2D: Any_RenderingContext {} +extension GPUCanvasContext: Any_RenderingContext {} +extension ImageBitmapRenderingContext: Any_RenderingContext {} +extension WebGL2RenderingContext: Any_RenderingContext {} +extension WebGLRenderingContext: Any_RenderingContext {} -public enum CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext: JSValueCompatible, Any_CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext { +public enum RenderingContext: JSValueCompatible, Any_RenderingContext { case canvasRenderingContext2D(CanvasRenderingContext2D) case gPUCanvasContext(GPUCanvasContext) case imageBitmapRenderingContext(ImageBitmapRenderingContext) diff --git a/Sources/DOMKit/WebIDL/Request_or_String.swift b/Sources/DOMKit/WebIDL/RequestInfo.swift similarity index 75% rename from Sources/DOMKit/WebIDL/Request_or_String.swift rename to Sources/DOMKit/WebIDL/RequestInfo.swift index 17cfe358..c4fb4ef8 100644 --- a/Sources/DOMKit/WebIDL/Request_or_String.swift +++ b/Sources/DOMKit/WebIDL/RequestInfo.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Request_or_String: ConvertibleToJSValue {} -extension Request: Any_Request_or_String {} -extension String: Any_Request_or_String {} +public protocol Any_RequestInfo: ConvertibleToJSValue {} +extension Request: Any_RequestInfo {} +extension String: Any_RequestInfo {} -public enum Request_or_String: JSValueCompatible, Any_Request_or_String { +public enum RequestInfo: JSValueCompatible, Any_RequestInfo { case request(Request) case string(String) diff --git a/Sources/DOMKit/WebIDL/ContainerBasedOffset_or_ElementBasedOffset.swift b/Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift similarity index 70% rename from Sources/DOMKit/WebIDL/ContainerBasedOffset_or_ElementBasedOffset.swift rename to Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift index 8a647150..4b55b89c 100644 --- a/Sources/DOMKit/WebIDL/ContainerBasedOffset_or_ElementBasedOffset.swift +++ b/Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_ContainerBasedOffset_or_ElementBasedOffset: ConvertibleToJSValue {} -extension ContainerBasedOffset: Any_ContainerBasedOffset_or_ElementBasedOffset {} -extension ElementBasedOffset: Any_ContainerBasedOffset_or_ElementBasedOffset {} +public protocol Any_ScrollTimelineOffset: ConvertibleToJSValue {} +extension ContainerBasedOffset: Any_ScrollTimelineOffset {} +extension ElementBasedOffset: Any_ScrollTimelineOffset {} -public enum ContainerBasedOffset_or_ElementBasedOffset: JSValueCompatible, Any_ContainerBasedOffset_or_ElementBasedOffset { +public enum ScrollTimelineOffset: JSValueCompatible, Any_ScrollTimelineOffset { case containerBasedOffset(ContainerBasedOffset) case elementBasedOffset(ElementBasedOffset) diff --git a/Sources/DOMKit/WebIDL/FileSystemHandle_or_WellKnownDirectory.swift b/Sources/DOMKit/WebIDL/StartInDirectory.swift similarity index 71% rename from Sources/DOMKit/WebIDL/FileSystemHandle_or_WellKnownDirectory.swift rename to Sources/DOMKit/WebIDL/StartInDirectory.swift index 9a547a26..464a580a 100644 --- a/Sources/DOMKit/WebIDL/FileSystemHandle_or_WellKnownDirectory.swift +++ b/Sources/DOMKit/WebIDL/StartInDirectory.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_FileSystemHandle_or_WellKnownDirectory: ConvertibleToJSValue {} -extension FileSystemHandle: Any_FileSystemHandle_or_WellKnownDirectory {} -extension WellKnownDirectory: Any_FileSystemHandle_or_WellKnownDirectory {} +public protocol Any_StartInDirectory: ConvertibleToJSValue {} +extension FileSystemHandle: Any_StartInDirectory {} +extension WellKnownDirectory: Any_StartInDirectory {} -public enum FileSystemHandle_or_WellKnownDirectory: JSValueCompatible, Any_FileSystemHandle_or_WellKnownDirectory { +public enum StartInDirectory: JSValueCompatible, Any_StartInDirectory { case fileSystemHandle(FileSystemHandle) case wellKnownDirectory(WellKnownDirectory) diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame.swift b/Sources/DOMKit/WebIDL/TexImageSource.swift similarity index 58% rename from Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame.swift rename to Sources/DOMKit/WebIDL/TexImageSource.swift index 34515e6b..a759239c 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame.swift +++ b/Sources/DOMKit/WebIDL/TexImageSource.swift @@ -3,16 +3,16 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame: ConvertibleToJSValue {} -extension HTMLCanvasElement: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} -extension HTMLImageElement: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} -extension HTMLVideoElement: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} -extension ImageBitmap: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} -extension ImageData: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} -extension OffscreenCanvas: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} -extension VideoFrame: Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame {} +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 HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame: JSValueCompatible, Any_HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame { +public enum TexImageSource: JSValueCompatible, Any_TexImageSource { case hTMLCanvasElement(HTMLCanvasElement) case hTMLImageElement(HTMLImageElement) case hTMLVideoElement(HTMLVideoElement) diff --git a/Sources/DOMKit/WebIDL/JSFunction_or_String.swift b/Sources/DOMKit/WebIDL/TimerHandler.swift similarity index 74% rename from Sources/DOMKit/WebIDL/JSFunction_or_String.swift rename to Sources/DOMKit/WebIDL/TimerHandler.swift index 17ce2db8..93d60994 100644 --- a/Sources/DOMKit/WebIDL/JSFunction_or_String.swift +++ b/Sources/DOMKit/WebIDL/TimerHandler.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_JSFunction_or_String: ConvertibleToJSValue {} -extension JSFunction: Any_JSFunction_or_String {} -extension String: Any_JSFunction_or_String {} +public protocol Any_TimerHandler: ConvertibleToJSValue {} +extension JSFunction: Any_TimerHandler {} +extension String: Any_TimerHandler {} -public enum JSFunction_or_String: JSValueCompatible, Any_JSFunction_or_String { +public enum TimerHandler: JSValueCompatible, Any_TimerHandler { case jSFunction(JSFunction) case string(String) diff --git a/Sources/DOMKit/WebIDL/TrustedHTML_or_TrustedScript_or_TrustedScriptURL.swift b/Sources/DOMKit/WebIDL/TrustedType.swift similarity index 69% rename from Sources/DOMKit/WebIDL/TrustedHTML_or_TrustedScript_or_TrustedScriptURL.swift rename to Sources/DOMKit/WebIDL/TrustedType.swift index da425b69..bd772451 100644 --- a/Sources/DOMKit/WebIDL/TrustedHTML_or_TrustedScript_or_TrustedScriptURL.swift +++ b/Sources/DOMKit/WebIDL/TrustedType.swift @@ -3,12 +3,12 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL: ConvertibleToJSValue {} -extension TrustedHTML: Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL {} -extension TrustedScript: Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL {} -extension TrustedScriptURL: Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL {} +public protocol Any_TrustedType: ConvertibleToJSValue {} +extension TrustedHTML: Any_TrustedType {} +extension TrustedScript: Any_TrustedType {} +extension TrustedScriptURL: Any_TrustedType {} -public enum TrustedHTML_or_TrustedScript_or_TrustedScriptURL: JSValueCompatible, Any_TrustedHTML_or_TrustedScript_or_TrustedScriptURL { +public enum TrustedType: JSValueCompatible, Any_TrustedType { case trustedHTML(TrustedHTML) case trustedScript(TrustedScript) case trustedScriptURL(TrustedScriptURL) diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index b88d3e69..13f5c863 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -4,79 +4,50 @@ import JavaScriptEventLoop import JavaScriptKit public typealias GLuint64EXT = UInt64 -public typealias BlobPart = Blob_or_BufferSource_or_String -public typealias AlgorithmIdentifier = JSObject_or_String + public typealias HashAlgorithmIdentifier = AlgorithmIdentifier public typealias BigInteger = Uint8Array public typealias NamedCurve = String public typealias ClipboardItemData = JSPromise public typealias ClipboardItems = [ClipboardItem] public typealias CookieList = [CookieListItem] -public typealias PasswordCredentialInit = HTMLFormElement_or_PasswordCredentialData -public typealias BinaryData = ArrayBuffer_or_ArrayBufferView -public typealias CSSStringSource = ReadableStream_or_String -public typealias CSSToken = CSSParserValue_or_CSSStyleValue_or_String -public typealias CSSUnparsedSegment = CSSVariableReferenceValue_or_String -public typealias CSSKeywordish = CSSKeywordValue_or_String -public typealias CSSNumberish = CSSNumericValue_or_Double -public typealias CSSPerspectiveValue = CSSKeywordish_or_CSSNumericValue -public typealias CSSColorRGBComp = CSSKeywordish_or_CSSNumberish -public typealias CSSColorPercent = CSSKeywordish_or_CSSNumberish -public typealias CSSColorNumber = CSSKeywordish_or_CSSNumberish -public typealias CSSColorAngle = CSSKeywordish_or_CSSNumberish -public typealias GeometryNode = CSSPseudoElement_or_Document_or_Element_or_Text -public typealias HeadersInit = record_String_to_String_or_seq_of_seq_of_String -public typealias XMLHttpRequestBodyInit = Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams -public typealias BodyInit = ReadableStream_or_XMLHttpRequestBodyInit -public typealias RequestInfo = Request_or_String -public typealias FileSystemWriteChunkType = Blob_or_BufferSource_or_String_or_WriteParams -public typealias StartInDirectory = FileSystemHandle_or_WellKnownDirectory + +public typealias CSSColorPercent = CSSColorRGBComp +public typealias CSSColorNumber = CSSColorRGBComp +public typealias CSSColorAngle = CSSColorRGBComp + public typealias DOMHighResTimeStamp = Double public typealias EpochTimeStamp = UInt64 -public typealias HTMLOrSVGScriptElement = HTMLScriptElement_or_SVGScriptElement -public typealias MediaProvider = Blob_or_MediaSource_or_MediaStream -public typealias RenderingContext = CanvasRenderingContext2D_or_GPUCanvasContext_or_ImageBitmapRenderingContext_or_WebGL2RenderingContext_or_WebGLRenderingContext -public typealias HTMLOrSVGImageElement = HTMLImageElement_or_SVGImageElement -public typealias CanvasImageSource = HTMLCanvasElement_or_HTMLOrSVGImageElement_or_HTMLVideoElement_or_ImageBitmap_or_OffscreenCanvas_or_VideoFrame + public typealias CanvasFilterInput = [String: JSValue] -public typealias OffscreenRenderingContext = GPUCanvasContext_or_ImageBitmapRenderingContext_or_OffscreenCanvasRenderingContext2D_or_WebGL2RenderingContext_or_WebGLRenderingContext + public typealias EventHandler = EventHandlerNonNull? public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? -public typealias TimerHandler = JSFunction_or_String -public typealias ImageBitmapSource = Blob_or_CanvasImageSource_or_ImageData -public typealias MessageEventSource = MessagePort_or_ServiceWorker_or_WindowProxy -public typealias ConstrainPoint2D = ConstrainPoint2DParameters_or_seq_of_Point2D + public typealias ProfilerResource = String -public typealias ConstrainULong = ConstrainULongRange_or_UInt32 -public typealias ConstrainDouble = ConstrainDoubleRange_or_Double -public typealias ConstrainBoolean = Bool_or_ConstrainBooleanParameters -public typealias ConstrainDOMString = ConstrainDOMStringParameters_or_String_or_seq_of_String + public typealias Megabit = Double public typealias Millisecond = UInt64 public typealias PerformanceEntryList = [PerformanceEntry] -public typealias PushMessageDataInit = BufferSource_or_String + public typealias ReportList = [Report] public typealias AttributeMatchList = [String: [String]] -public typealias ContainerBasedOffset = CSSKeywordish_or_CSSNumericValue -public typealias ScrollTimelineOffset = ContainerBasedOffset_or_ElementBasedOffset -public typealias ReadableStreamReader = ReadableStreamBYOBReader_or_ReadableStreamDefaultReader -public typealias ReadableStreamController = ReadableByteStreamController_or_ReadableStreamDefaultController +public typealias ContainerBasedOffset = CSSPerspectiveValue + public typealias HTMLString = String public typealias ScriptString = String public typealias ScriptURLString = String -public typealias TrustedType = TrustedHTML_or_TrustedScript_or_TrustedScriptURL -public typealias URLPatternInput = String_or_URLPatternInit -public typealias VibratePattern = UInt32_or_seq_of_UInt32 + public typealias UUID = String -public typealias BluetoothServiceUUID = String_or_UInt32 -public typealias BluetoothCharacteristicUUID = String_or_UInt32 -public typealias BluetoothDescriptorUUID = String_or_UInt32 -public typealias NDEFMessageSource = BufferSource_or_NDEFMessageInit_or_String + +public typealias BluetoothCharacteristicUUID = BluetoothServiceUUID +public typealias BluetoothDescriptorUUID = BluetoothServiceUUID + public typealias COSEAlgorithmIdentifier = Int32 public typealias UvmEntry = [UInt32] public typealias UvmEntries = [UvmEntry] -public typealias ImageBufferSource = BufferSource_or_ReadableStream + public typealias GLenum = UInt32 public typealias GLboolean = Bool public typealias GLbitfield = UInt32 @@ -91,22 +62,20 @@ public typealias GLushort = UInt16 public typealias GLuint = UInt32 public typealias GLfloat = Float public typealias GLclampf = Float -public typealias TexImageSource = HTMLCanvasElement_or_HTMLImageElement_or_HTMLVideoElement_or_ImageBitmap_or_ImageData_or_OffscreenCanvas_or_VideoFrame -public typealias Float32List = Float32Array_or_seq_of_GLfloat -public typealias Int32List = Int32Array_or_seq_of_GLint + public typealias GLint64 = Int64 public typealias GLuint64 = UInt64 -public typealias Uint32List = Uint32Array_or_seq_of_GLuint + public typealias GPUBufferUsageFlags = UInt32 public typealias GPUMapModeFlags = UInt32 public typealias GPUTextureUsageFlags = UInt32 public typealias GPUShaderStageFlags = UInt32 -public typealias GPUBindingResource = GPUBufferBinding_or_GPUExternalTexture_or_GPUSampler_or_GPUTextureView + public typealias GPUPipelineConstantValue = Double public typealias GPUColorWriteFlags = UInt32 public typealias GPUComputePassTimestampWrites = [GPUComputePassTimestampWrite] public typealias GPURenderPassTimestampWrites = [GPURenderPassTimestampWrite] -public typealias GPUError = GPUOutOfMemoryError_or_GPUValidationError + public typealias GPUBufferDynamicOffset = UInt32 public typealias GPUStencilValue = UInt32 public typealias GPUSampleMask = UInt32 @@ -117,23 +86,16 @@ public typealias GPUIndex32 = UInt32 public typealias GPUSize32 = UInt32 public typealias GPUSignedOffset32 = Int32 public typealias GPUFlagsConstant = UInt32 -public typealias GPUColor = GPUColorDict_or_seq_of_Double -public typealias GPUOrigin2D = GPUOrigin2DDict_or_seq_of_GPUIntegerCoordinate -public typealias GPUOrigin3D = GPUOrigin3DDict_or_seq_of_GPUIntegerCoordinate -public typealias GPUExtent3D = GPUExtent3DDict_or_seq_of_GPUIntegerCoordinate -public typealias BufferSource = ArrayBuffer_or_ArrayBufferView + +public typealias BufferSource = BinaryData public typealias DOMTimeStamp = UInt64 public typealias MLNamedOperands = [String: MLOperand] -public typealias MLBufferView = ArrayBufferView_or_MLBufferResourceView -public typealias MLResource = GPUTexture_or_MLBufferView_or_WebGLTexture + public typealias MLNamedInputs = [String: MLInput_or_MLResource] public typealias MLNamedOutputs = [String: MLResource] -public typealias RTCRtpTransform = RTCRtpScriptTransform_or_SFrameTransform + public typealias SmallCryptoKeyID = UInt64 -public typealias CryptoKeyID = SmallCryptoKeyID_or___UNSUPPORTED_BIGINT__ -public typealias LineAndPositionSetting = AutoKeyword_or_Double -public typealias XRWebGLRenderingContext = WebGL2RenderingContext_or_WebGLRenderingContext -public typealias FormDataEntryValue = File_or_String + public typealias ComputePressureUpdateCallback = ([ComputePressureRecord], ComputePressureObserver) -> Void public typealias AnimatorInstanceConstructor = (JSValue, JSValue) -> JSValue public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void diff --git a/Sources/DOMKit/WebIDL/String_or_URLPatternInit.swift b/Sources/DOMKit/WebIDL/URLPatternInput.swift similarity index 73% rename from Sources/DOMKit/WebIDL/String_or_URLPatternInit.swift rename to Sources/DOMKit/WebIDL/URLPatternInput.swift index 3246d730..206482cd 100644 --- a/Sources/DOMKit/WebIDL/String_or_URLPatternInit.swift +++ b/Sources/DOMKit/WebIDL/URLPatternInput.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_String_or_URLPatternInit: ConvertibleToJSValue {} -extension String: Any_String_or_URLPatternInit {} -extension URLPatternInit: Any_String_or_URLPatternInit {} +public protocol Any_URLPatternInput: ConvertibleToJSValue {} +extension String: Any_URLPatternInput {} +extension URLPatternInit: Any_URLPatternInput {} -public enum String_or_URLPatternInit: JSValueCompatible, Any_String_or_URLPatternInit { +public enum URLPatternInput: JSValueCompatible, Any_URLPatternInput { case string(String) case uRLPatternInit(URLPatternInit) diff --git a/Sources/DOMKit/WebIDL/Uint32Array_or_seq_of_GLuint.swift b/Sources/DOMKit/WebIDL/Uint32List.swift similarity index 71% rename from Sources/DOMKit/WebIDL/Uint32Array_or_seq_of_GLuint.swift rename to Sources/DOMKit/WebIDL/Uint32List.swift index 0d0c8dd3..fef259a8 100644 --- a/Sources/DOMKit/WebIDL/Uint32Array_or_seq_of_GLuint.swift +++ b/Sources/DOMKit/WebIDL/Uint32List.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Uint32Array_or_seq_of_GLuint: ConvertibleToJSValue {} -extension Uint32Array: Any_Uint32Array_or_seq_of_GLuint {} -extension Array: Any_Uint32Array_or_seq_of_GLuint where Element == GLuint {} +public protocol Any_Uint32List: ConvertibleToJSValue {} +extension Uint32Array: Any_Uint32List {} +extension Array: Any_Uint32List where Element == GLuint {} -public enum Uint32Array_or_seq_of_GLuint: JSValueCompatible, Any_Uint32Array_or_seq_of_GLuint { +public enum Uint32List: JSValueCompatible, Any_Uint32List { case uint32Array(Uint32Array) case seq_of_GLuint([GLuint]) diff --git a/Sources/DOMKit/WebIDL/UInt32_or_seq_of_UInt32.swift b/Sources/DOMKit/WebIDL/VibratePattern.swift similarity index 72% rename from Sources/DOMKit/WebIDL/UInt32_or_seq_of_UInt32.swift rename to Sources/DOMKit/WebIDL/VibratePattern.swift index dfc4f615..3dc59c57 100644 --- a/Sources/DOMKit/WebIDL/UInt32_or_seq_of_UInt32.swift +++ b/Sources/DOMKit/WebIDL/VibratePattern.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_UInt32_or_seq_of_UInt32: ConvertibleToJSValue {} -extension UInt32: Any_UInt32_or_seq_of_UInt32 {} -extension Array: Any_UInt32_or_seq_of_UInt32 where Element == UInt32 {} +public protocol Any_VibratePattern: ConvertibleToJSValue {} +extension UInt32: Any_VibratePattern {} +extension Array: Any_VibratePattern where Element == UInt32 {} -public enum UInt32_or_seq_of_UInt32: JSValueCompatible, Any_UInt32_or_seq_of_UInt32 { +public enum VibratePattern: JSValueCompatible, Any_VibratePattern { case uInt32(UInt32) case seq_of_UInt32([UInt32]) diff --git a/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift similarity index 65% rename from Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams.swift rename to Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift index 0736dd46..6b4a740a 100644 --- a/Sources/DOMKit/WebIDL/Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift @@ -3,14 +3,14 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams: ConvertibleToJSValue {} -extension Blob: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} -extension BufferSource: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} -extension FormData: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} -extension String: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} -extension URLSearchParams: Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams {} +public protocol Any_XMLHttpRequestBodyInit: ConvertibleToJSValue {} +extension Blob: Any_XMLHttpRequestBodyInit {} +extension BufferSource: Any_XMLHttpRequestBodyInit {} +extension FormData: Any_XMLHttpRequestBodyInit {} +extension String: Any_XMLHttpRequestBodyInit {} +extension URLSearchParams: Any_XMLHttpRequestBodyInit {} -public enum Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams: JSValueCompatible, Any_Blob_or_BufferSource_or_FormData_or_String_or_URLSearchParams { +public enum XMLHttpRequestBodyInit: JSValueCompatible, Any_XMLHttpRequestBodyInit { case blob(Blob) case bufferSource(BufferSource) case formData(FormData) diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContext_or_WebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift similarity index 70% rename from Sources/DOMKit/WebIDL/WebGL2RenderingContext_or_WebGLRenderingContext.swift rename to Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift index e443fb97..1467ffcb 100644 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContext_or_WebGLRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_WebGL2RenderingContext_or_WebGLRenderingContext: ConvertibleToJSValue {} -extension WebGL2RenderingContext: Any_WebGL2RenderingContext_or_WebGLRenderingContext {} -extension WebGLRenderingContext: Any_WebGL2RenderingContext_or_WebGLRenderingContext {} +public protocol Any_XRWebGLRenderingContext: ConvertibleToJSValue {} +extension WebGL2RenderingContext: Any_XRWebGLRenderingContext {} +extension WebGLRenderingContext: Any_XRWebGLRenderingContext {} -public enum WebGL2RenderingContext_or_WebGLRenderingContext: JSValueCompatible, Any_WebGL2RenderingContext_or_WebGLRenderingContext { +public enum XRWebGLRenderingContext: JSValueCompatible, Any_XRWebGLRenderingContext { case webGL2RenderingContext(WebGL2RenderingContext) case webGLRenderingContext(WebGLRenderingContext) diff --git a/Sources/WebIDLToSwift/Context.swift b/Sources/WebIDLToSwift/Context.swift index 63f20efa..495eb878 100644 --- a/Sources/WebIDLToSwift/Context.swift +++ b/Sources/WebIDLToSwift/Context.swift @@ -6,7 +6,7 @@ enum Context { static var closurePatterns: Set = [] private(set) static var strings: Set = ["toString"] - static var unions: Set> = [] + static var unions: Set = [] static func source(for name: String) -> SwiftSource { assert(!name.isEmpty) diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 18e8ec24..de3521fa 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -133,9 +133,8 @@ enum IDLBuilder { static func generateUnions() throws { for union in Context.unions { - let file = UnionProtocol(types: union) - guard !ignoredNames.contains(file.types.inlineTypeName) else { continue } - try writeFile(named: file.types.inlineTypeName, content: file.swiftRepresentation.source) + guard !ignoredNames.contains(union.name) else { continue } + try writeFile(named: union.name, content: union.swiftRepresentation.source) } } } diff --git a/Sources/WebIDLToSwift/UnionProtocol.swift b/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift similarity index 88% rename from Sources/WebIDLToSwift/UnionProtocol.swift rename to Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift index b193b395..d3adb8c6 100644 --- a/Sources/WebIDLToSwift/UnionProtocol.swift +++ b/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift @@ -1,13 +1,15 @@ import Foundation import WebIDL -struct UnionProtocol: SwiftRepresentable { - let types: Set - +extension UnionType: SwiftRepresentable { var sortedTypes: [SlimIDLType] { types.sorted(by: { $0.inlineTypeName < $1.inlineTypeName }) } + var name: String { + friendlyName ?? defaultName + } + var sortedNames: [String] { sortedTypes.map { $0.inlineTypeName.first!.lowercased() + String($0.inlineTypeName.dropFirst()) @@ -16,10 +18,10 @@ struct UnionProtocol: SwiftRepresentable { var swiftRepresentation: SwiftSource { """ - public protocol Any_\(types.inlineTypeName): ConvertibleToJSValue {} + public protocol Any_\(name): ConvertibleToJSValue {} \(lines: extensions) - public enum \(types.inlineTypeName): JSValueCompatible, Any_\(types.inlineTypeName) { + public enum \(name): JSValueCompatible, Any_\(name) { \(lines: cases) public static func construct(from value: JSValue) -> Self? { @@ -38,7 +40,7 @@ struct UnionProtocol: SwiftRepresentable { var extensions: [SwiftSource] { sortedTypes.map { - "extension \($0.typeName): Any_\(types.inlineTypeName) \($0.whereClause) {}" + "extension \($0.typeName): Any_\(name) \($0.whereClause) {}" } } @@ -145,7 +147,7 @@ extension SlimIDLType.TypeValue: SwiftRepresentable { return "\(name)" } case let .union(types): - return "\(Set(types).inlineTypeName)" + return "\(unionName(types: types))" } } @@ -175,7 +177,13 @@ extension SlimIDLType.TypeValue: SwiftRepresentable { return "\(name)" } case let .union(types): - return "\(Set(types).inlineTypeName)" + return "\(unionName(types: types))" } } } + +func unionName(types: Set) -> String { + let union = Context.unions.first(where: { $0.types == types }) ?? UnionType(types: types) + Context.unions.insert(union) + return union.name +} diff --git a/Sources/WebIDLToSwift/UnionType.swift b/Sources/WebIDLToSwift/UnionType.swift index 6aaa69f3..5025b128 100644 --- a/Sources/WebIDLToSwift/UnionType.swift +++ b/Sources/WebIDLToSwift/UnionType.swift @@ -1,5 +1,25 @@ import WebIDL +class UnionType: Hashable, Equatable { + let types: Set + var friendlyName: String? + let defaultName: String + + init(types: Set, friendlyName: String? = nil) { + self.types = types + self.friendlyName = friendlyName + defaultName = types.map(\.inlineTypeName).sorted().joined(separator: "_or_") + } + + func hash(into hasher: inout Hasher) { + hasher.combine(defaultName) + } + + static func == (lhs: UnionType, rhs: UnionType) -> Bool { + lhs.types == rhs.types + } +} + struct SlimIDLType: Hashable, Encodable { let value: TypeValue let nullable: Bool @@ -28,7 +48,7 @@ struct SlimIDLType: Hashable, Encodable { enum TypeValue: Encodable { case generic(String, args: [SlimIDLType]) case single(String) - case union([SlimIDLType]) + case union(Set) init(_ value: IDLType.TypeValue) { switch value { @@ -37,20 +57,14 @@ struct SlimIDLType: Hashable, Encodable { case let .single(name): self = .single(name) case let .union(types): - let slimmed = types.map(SlimIDLType.init) + let slimmed = Set(types.map(SlimIDLType.init)) self = .union(slimmed) - Context.unions.insert(Set(slimmed)) + Context.unions.insert(UnionType(types: slimmed)) } } } } -extension Set where Element == SlimIDLType { - var inlineTypeName: String { - map(\.inlineTypeName).sorted().joined(separator: "_or_") - } -} - extension SlimIDLType.TypeValue { var inlineTypeName: String { switch self { @@ -78,7 +92,7 @@ extension SlimIDLType.TypeValue { return "\(name)" } case let .union(types): - return Set(types).inlineTypeName + return unionName(types: types) } } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 74a9e281..01edeff0 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -579,9 +579,7 @@ extension IDLType: SwiftRepresentable { { return "\(types[0])?" } - let union = Set(types.map(SlimIDLType.init)) - Context.unions.insert(union) - return "\(raw: union.inlineTypeName)" + return "\(unionName(types: Set(types.map(SlimIDLType.init))))" } } @@ -635,7 +633,21 @@ extension IDLType: SwiftRepresentable { extension IDLTypedef: SwiftRepresentable { var swiftRepresentation: SwiftSource { - "public typealias \(name) = \(idlType)" + if case let .union(types) = idlType.value { + let typeSet = Set(types.map(SlimIDLType.init)) + if let existing = Context.unions.first(where: { $0.types == typeSet }) { + if let existingName = existing.friendlyName { + return "public typealias \(name) = \(existingName)" + } else { + existing.friendlyName = name + return "" + } + } else { + Context.unions.insert(UnionType(types: typeSet, friendlyName: name)) + return "" + } + } + return "public typealias \(name) = \(idlType)" } } From 157f5ca9d1199fc898d20fa0e0097d42c82dc33a Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Mon, 4 Apr 2022 23:56:07 -0400 Subject: [PATCH 113/124] switch back to main branch of JSKit --- Package.resolved | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index 726dcc77..60906fdc 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,8 +5,8 @@ "package": "JavaScriptKit", "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { - "branch": "jed/open-object", - "revision": "e6dbd0b4738fe52d7135310a918ced77b62f2e0e", + "branch": "main", + "revision": "95d0c4cd78b48ffc7e19c618d57c3244917be09a", "version": null } } diff --git a/Package.swift b/Package.swift index 8e2e15e7..82799a74 100644 --- a/Package.swift +++ b/Package.swift @@ -18,7 +18,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/swiftwasm/JavaScriptKit.git", - .branch("jed/open-object")), + .branch("main")), ], targets: [ .target( From 1d8188b85b4869b931ec125ca360b8fe78fae1af Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 5 Apr 2022 00:05:10 -0400 Subject: [PATCH 114/124] update to the new JSKit APIs --- .../DOMKit/ECMAScript/ArrayBufferView.swift | 26 +- Sources/DOMKit/ECMAScript/Attributes.swift | 2 +- .../DOMKit/ECMAScript/BridgedDictionary.swift | 4 +- Sources/DOMKit/ECMAScript/DataView.swift | 82 ++-- Sources/DOMKit/ECMAScript/Iterators.swift | 2 +- Sources/DOMKit/ECMAScript/Support.swift | 2 +- .../WebIDL/ANGLE_instanced_arrays.swift | 6 +- Sources/DOMKit/WebIDL/AbortController.swift | 2 +- Sources/DOMKit/WebIDL/AbortSignal.swift | 4 +- .../AbsoluteOrientationReadingValues.swift | 2 +- .../WebIDL/AbsoluteOrientationSensor.swift | 2 +- Sources/DOMKit/WebIDL/Accelerometer.swift | 2 +- .../AccelerometerLocalCoordinateSystem.swift | 2 +- .../WebIDL/AccelerometerReadingValues.swift | 6 +- .../WebIDL/AccelerometerSensorOptions.swift | 2 +- .../WebIDL/AddEventListenerOptions.swift | 6 +- Sources/DOMKit/WebIDL/AesCbcParams.swift | 2 +- Sources/DOMKit/WebIDL/AesCtrParams.swift | 4 +- .../DOMKit/WebIDL/AesDerivedKeyParams.swift | 2 +- Sources/DOMKit/WebIDL/AesGcmParams.swift | 6 +- Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift | 2 +- Sources/DOMKit/WebIDL/AesKeyGenParams.swift | 2 +- Sources/DOMKit/WebIDL/Algorithm.swift | 2 +- .../DOMKit/WebIDL/AlgorithmIdentifier.swift | 6 +- Sources/DOMKit/WebIDL/AlignSetting.swift | 2 +- .../WebIDL/AllowedBluetoothDevice.swift | 8 +- Sources/DOMKit/WebIDL/AllowedUSBDevice.swift | 6 +- Sources/DOMKit/WebIDL/AlphaOption.swift | 2 +- .../WebIDL/AmbientLightReadingValues.swift | 2 +- .../DOMKit/WebIDL/AmbientLightSensor.swift | 2 +- Sources/DOMKit/WebIDL/AnalyserNode.swift | 10 +- Sources/DOMKit/WebIDL/AnalyserOptions.swift | 8 +- Sources/DOMKit/WebIDL/Animatable.swift | 4 +- Sources/DOMKit/WebIDL/Animation.swift | 4 +- Sources/DOMKit/WebIDL/AnimationEffect.swift | 8 +- ...tionEffect_or_seq_of_AnimationEffect.swift | 6 +- Sources/DOMKit/WebIDL/AnimationEvent.swift | 2 +- .../DOMKit/WebIDL/AnimationEventInit.swift | 6 +- .../WebIDL/AnimationFrameProvider.swift | 2 +- .../DOMKit/WebIDL/AnimationPlayState.swift | 2 +- .../WebIDL/AnimationPlaybackEvent.swift | 2 +- .../WebIDL/AnimationPlaybackEventInit.swift | 4 +- .../DOMKit/WebIDL/AnimationReplaceState.swift | 2 +- Sources/DOMKit/WebIDL/AnimationTimeline.swift | 2 +- .../WebIDL/AppBannerPromptOutcome.swift | 2 +- Sources/DOMKit/WebIDL/AppendMode.swift | 2 +- .../DOMKit/WebIDL/ArrayBuffer_or_String.swift | 6 +- .../DOMKit/WebIDL/AssignedNodesOptions.swift | 2 +- .../AttestationConveyancePreference.swift | 2 +- .../DOMKit/WebIDL/AttributionReporting.swift | 6 +- .../WebIDL/AttributionSourceParams.swift | 10 +- Sources/DOMKit/WebIDL/AudioBuffer.swift | 8 +- .../DOMKit/WebIDL/AudioBufferOptions.swift | 6 +- .../DOMKit/WebIDL/AudioBufferSourceNode.swift | 2 +- .../WebIDL/AudioBufferSourceOptions.swift | 12 +- .../DOMKit/WebIDL/AudioConfiguration.swift | 10 +- Sources/DOMKit/WebIDL/AudioContext.swift | 14 +- .../WebIDL/AudioContextLatencyCategory.swift | 2 +- ...udioContextLatencyCategory_or_Double.swift | 6 +- .../DOMKit/WebIDL/AudioContextOptions.swift | 4 +- Sources/DOMKit/WebIDL/AudioContextState.swift | 2 +- Sources/DOMKit/WebIDL/AudioData.swift | 6 +- .../WebIDL/AudioDataCopyToOptions.swift | 8 +- Sources/DOMKit/WebIDL/AudioDataInit.swift | 12 +- Sources/DOMKit/WebIDL/AudioDecoder.swift | 14 +- .../DOMKit/WebIDL/AudioDecoderConfig.swift | 8 +- .../DOMKit/WebIDL/AudioDecoderSupport.swift | 4 +- Sources/DOMKit/WebIDL/AudioEncoder.swift | 14 +- .../DOMKit/WebIDL/AudioEncoderConfig.swift | 8 +- .../DOMKit/WebIDL/AudioEncoderSupport.swift | 4 +- Sources/DOMKit/WebIDL/AudioListener.swift | 14 +- Sources/DOMKit/WebIDL/AudioNode.swift | 16 +- Sources/DOMKit/WebIDL/AudioNodeOptions.swift | 6 +- .../DOMKit/WebIDL/AudioOutputOptions.swift | 2 +- Sources/DOMKit/WebIDL/AudioParam.swift | 14 +- .../DOMKit/WebIDL/AudioParamDescriptor.swift | 10 +- .../DOMKit/WebIDL/AudioProcessingEvent.swift | 2 +- .../WebIDL/AudioProcessingEventInit.swift | 6 +- Sources/DOMKit/WebIDL/AudioSampleFormat.swift | 2 +- .../WebIDL/AudioScheduledSourceNode.swift | 4 +- Sources/DOMKit/WebIDL/AudioTimestamp.swift | 4 +- Sources/DOMKit/WebIDL/AudioTrackList.swift | 2 +- ...udioTrack_or_TextTrack_or_VideoTrack.swift | 8 +- Sources/DOMKit/WebIDL/AudioWorkletNode.swift | 2 +- .../WebIDL/AudioWorkletNodeOptions.swift | 10 +- ...AuthenticationExtensionsClientInputs.swift | 12 +- ...uthenticationExtensionsClientOutputs.swift | 10 +- ...henticationExtensionsLargeBlobInputs.swift | 6 +- ...enticationExtensionsLargeBlobOutputs.swift | 6 +- ...uthenticationExtensionsPaymentInputs.swift | 12 +- .../WebIDL/AuthenticatorAttachment.swift | 2 +- .../AuthenticatorSelectionCriteria.swift | 8 +- .../WebIDL/AuthenticatorTransport.swift | 2 +- Sources/DOMKit/WebIDL/AutoKeyword.swift | 2 +- Sources/DOMKit/WebIDL/AutomationRate.swift | 2 +- Sources/DOMKit/WebIDL/AutoplayPolicy.swift | 2 +- .../WebIDL/AutoplayPolicyMediaType.swift | 2 +- .../WebIDL/BackgroundFetchEventInit.swift | 2 +- .../WebIDL/BackgroundFetchFailureReason.swift | 2 +- .../WebIDL/BackgroundFetchManager.swift | 14 +- .../WebIDL/BackgroundFetchOptions.swift | 2 +- .../WebIDL/BackgroundFetchRegistration.swift | 14 +- .../DOMKit/WebIDL/BackgroundFetchResult.swift | 2 +- .../WebIDL/BackgroundFetchUIOptions.swift | 4 +- .../DOMKit/WebIDL/BackgroundSyncOptions.swift | 2 +- Sources/DOMKit/WebIDL/BarcodeDetector.swift | 10 +- .../WebIDL/BarcodeDetectorOptions.swift | 2 +- Sources/DOMKit/WebIDL/BarcodeFormat.swift | 2 +- Sources/DOMKit/WebIDL/BaseAudioContext.swift | 14 +- .../DOMKit/WebIDL/BaseComputedKeyframe.swift | 8 +- Sources/DOMKit/WebIDL/BaseKeyframe.swift | 6 +- .../WebIDL/BasePropertyIndexedKeyframe.swift | 6 +- .../WebIDL/BeforeInstallPromptEvent.swift | 4 +- Sources/DOMKit/WebIDL/BinaryData.swift | 6 +- .../DOMKit/WebIDL/BinaryData_or_String.swift | 6 +- Sources/DOMKit/WebIDL/BinaryType.swift | 2 +- Sources/DOMKit/WebIDL/BiquadFilterNode.swift | 4 +- .../DOMKit/WebIDL/BiquadFilterOptions.swift | 10 +- Sources/DOMKit/WebIDL/BiquadFilterType.swift | 2 +- Sources/DOMKit/WebIDL/BitrateMode.swift | 2 +- Sources/DOMKit/WebIDL/Blob.swift | 8 +- Sources/DOMKit/WebIDL/BlobEvent.swift | 2 +- Sources/DOMKit/WebIDL/BlobEventInit.swift | 4 +- Sources/DOMKit/WebIDL/BlobPart.swift | 8 +- Sources/DOMKit/WebIDL/BlobPropertyBag.swift | 4 +- .../DOMKit/WebIDL/Blob_or_MediaSource.swift | 6 +- .../WebIDL/BlockFragmentationType.swift | 2 +- Sources/DOMKit/WebIDL/Bluetooth.swift | 10 +- .../WebIDL/BluetoothAdvertisingEvent.swift | 2 +- .../BluetoothAdvertisingEventInit.swift | 16 +- .../WebIDL/BluetoothDataFilterInit.swift | 4 +- Sources/DOMKit/WebIDL/BluetoothDevice.swift | 6 +- .../WebIDL/BluetoothLEScanFilterInit.swift | 10 +- .../BluetoothManufacturerDataFilterInit.swift | 2 +- .../BluetoothPermissionDescriptor.swift | 10 +- .../WebIDL/BluetoothPermissionStorage.swift | 2 +- .../BluetoothRemoteGATTCharacteristic.swift | 36 +- .../BluetoothRemoteGATTDescriptor.swift | 8 +- .../WebIDL/BluetoothRemoteGATTServer.swift | 14 +- .../WebIDL/BluetoothRemoteGATTService.swift | 24 +- .../BluetoothServiceDataFilterInit.swift | 2 +- .../DOMKit/WebIDL/BluetoothServiceUUID.swift | 6 +- Sources/DOMKit/WebIDL/BluetoothUUID.swift | 8 +- Sources/DOMKit/WebIDL/Body.swift | 10 +- Sources/DOMKit/WebIDL/BodyInit.swift | 6 +- .../WebIDL/Bool_or_ConstrainDouble.swift | 6 +- .../Bool_or_MediaTrackConstraints.swift | 6 +- .../Bool_or_ScrollIntoViewOptions.swift | 6 +- Sources/DOMKit/WebIDL/BoxQuadOptions.swift | 4 +- Sources/DOMKit/WebIDL/BreakType.swift | 2 +- Sources/DOMKit/WebIDL/BroadcastChannel.swift | 4 +- .../BrowserCaptureMediaStreamTrack.swift | 6 +- .../WebIDL/BufferSource_or_JsonWebKey.swift | 6 +- .../WebIDL/ByteLengthQueuingStrategy.swift | 2 +- Sources/DOMKit/WebIDL/CSS.swift | 156 +++--- Sources/DOMKit/WebIDL/CSSBoxType.swift | 2 +- Sources/DOMKit/WebIDL/CSSColor.swift | 2 +- Sources/DOMKit/WebIDL/CSSColorRGBComp.swift | 6 +- Sources/DOMKit/WebIDL/CSSColorValue.swift | 2 +- .../WebIDL/CSSFontFeatureValuesMap.swift | 2 +- Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 4 +- Sources/DOMKit/WebIDL/CSSHSL.swift | 2 +- Sources/DOMKit/WebIDL/CSSHWB.swift | 2 +- Sources/DOMKit/WebIDL/CSSKeyframesRule.swift | 6 +- Sources/DOMKit/WebIDL/CSSKeywordValue.swift | 2 +- Sources/DOMKit/WebIDL/CSSKeywordish.swift | 6 +- Sources/DOMKit/WebIDL/CSSLCH.swift | 2 +- Sources/DOMKit/WebIDL/CSSLab.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathClamp.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathInvert.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathMax.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathMin.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathNegate.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathOperator.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathProduct.swift | 2 +- Sources/DOMKit/WebIDL/CSSMathSum.swift | 2 +- .../DOMKit/WebIDL/CSSMatrixComponent.swift | 2 +- .../WebIDL/CSSMatrixComponentOptions.swift | 2 +- Sources/DOMKit/WebIDL/CSSNestingRule.swift | 4 +- Sources/DOMKit/WebIDL/CSSNumberish.swift | 6 +- .../DOMKit/WebIDL/CSSNumericBaseType.swift | 2 +- Sources/DOMKit/WebIDL/CSSNumericType.swift | 16 +- Sources/DOMKit/WebIDL/CSSNumericValue.swift | 18 +- .../CSSNumericValue_or_Double_or_String.swift | 8 +- Sources/DOMKit/WebIDL/CSSOKLCH.swift | 2 +- Sources/DOMKit/WebIDL/CSSOKLab.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserAtRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserBlock.swift | 2 +- .../DOMKit/WebIDL/CSSParserDeclaration.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserFunction.swift | 2 +- Sources/DOMKit/WebIDL/CSSParserOptions.swift | 2 +- .../WebIDL/CSSParserQualifiedRule.swift | 2 +- Sources/DOMKit/WebIDL/CSSPerspective.swift | 2 +- .../DOMKit/WebIDL/CSSPerspectiveValue.swift | 6 +- Sources/DOMKit/WebIDL/CSSPseudoElement.swift | 2 +- .../WebIDL/CSSPseudoElement_or_Element.swift | 6 +- Sources/DOMKit/WebIDL/CSSRGB.swift | 2 +- Sources/DOMKit/WebIDL/CSSRotate.swift | 4 +- Sources/DOMKit/WebIDL/CSSScale.swift | 2 +- Sources/DOMKit/WebIDL/CSSSkew.swift | 2 +- Sources/DOMKit/WebIDL/CSSSkewX.swift | 2 +- Sources/DOMKit/WebIDL/CSSSkewY.swift | 2 +- Sources/DOMKit/WebIDL/CSSStringSource.swift | 6 +- .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 8 +- Sources/DOMKit/WebIDL/CSSStyleRule.swift | 4 +- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 18 +- Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift | 6 +- Sources/DOMKit/WebIDL/CSSStyleValue.swift | 4 +- .../WebIDL/CSSStyleValue_or_String.swift | 6 +- Sources/DOMKit/WebIDL/CSSToken.swift | 8 +- Sources/DOMKit/WebIDL/CSSTransformValue.swift | 2 +- Sources/DOMKit/WebIDL/CSSTranslate.swift | 2 +- Sources/DOMKit/WebIDL/CSSUnitValue.swift | 2 +- .../DOMKit/WebIDL/CSSUnparsedSegment.swift | 6 +- Sources/DOMKit/WebIDL/CSSUnparsedValue.swift | 2 +- .../WebIDL/CSSVariableReferenceValue.swift | 2 +- Sources/DOMKit/WebIDL/Cache.swift | 42 +- Sources/DOMKit/WebIDL/CacheQueryOptions.swift | 6 +- Sources/DOMKit/WebIDL/CacheStorage.swift | 26 +- .../CameraDevicePermissionDescriptor.swift | 2 +- .../WebIDL/CanMakePaymentEventInit.swift | 6 +- Sources/DOMKit/WebIDL/CanPlayTypeResult.swift | 2 +- Sources/DOMKit/WebIDL/CanvasDirection.swift | 2 +- Sources/DOMKit/WebIDL/CanvasDrawImage.swift | 22 +- Sources/DOMKit/WebIDL/CanvasDrawPath.swift | 18 +- Sources/DOMKit/WebIDL/CanvasFillRule.swift | 2 +- .../WebIDL/CanvasFillStrokeStyles.swift | 18 +- Sources/DOMKit/WebIDL/CanvasFilter.swift | 2 +- ...terInput_or_seq_of_CanvasFilterInput.swift | 6 +- .../WebIDL/CanvasFilter_or_String.swift | 6 +- Sources/DOMKit/WebIDL/CanvasFontKerning.swift | 2 +- Sources/DOMKit/WebIDL/CanvasFontStretch.swift | 2 +- .../DOMKit/WebIDL/CanvasFontVariantCaps.swift | 2 +- Sources/DOMKit/WebIDL/CanvasGradient.swift | 2 +- ...sGradient_or_CanvasPattern_or_String.swift | 8 +- Sources/DOMKit/WebIDL/CanvasImageData.swift | 22 +- Sources/DOMKit/WebIDL/CanvasImageSource.swift | 14 +- Sources/DOMKit/WebIDL/CanvasLineCap.swift | 2 +- Sources/DOMKit/WebIDL/CanvasLineJoin.swift | 2 +- Sources/DOMKit/WebIDL/CanvasPath.swift | 52 +- .../WebIDL/CanvasPathDrawingStyles.swift | 2 +- Sources/DOMKit/WebIDL/CanvasPattern.swift | 2 +- Sources/DOMKit/WebIDL/CanvasRect.swift | 6 +- .../CanvasRenderingContext2DSettings.swift | 8 +- Sources/DOMKit/WebIDL/CanvasText.swift | 6 +- Sources/DOMKit/WebIDL/CanvasTextAlign.swift | 2 +- .../DOMKit/WebIDL/CanvasTextBaseline.swift | 2 +- .../DOMKit/WebIDL/CanvasTextRendering.swift | 2 +- Sources/DOMKit/WebIDL/CanvasTransform.swift | 32 +- .../DOMKit/WebIDL/CanvasUserInterface.swift | 6 +- Sources/DOMKit/WebIDL/ChannelCountMode.swift | 2 +- .../DOMKit/WebIDL/ChannelInterpretation.swift | 2 +- Sources/DOMKit/WebIDL/ChannelMergerNode.swift | 2 +- .../DOMKit/WebIDL/ChannelMergerOptions.swift | 2 +- .../DOMKit/WebIDL/ChannelSplitterNode.swift | 2 +- .../WebIDL/ChannelSplitterOptions.swift | 2 +- .../WebIDL/CharacterBoundsUpdateEvent.swift | 2 +- .../CharacterBoundsUpdateEventInit.swift | 4 +- Sources/DOMKit/WebIDL/CharacterData.swift | 10 +- Sources/DOMKit/WebIDL/ChildDisplayType.swift | 2 +- Sources/DOMKit/WebIDL/ChildNode.swift | 6 +- .../DOMKit/WebIDL/ClientLifecycleState.swift | 2 +- .../DOMKit/WebIDL/ClientQueryOptions.swift | 4 +- Sources/DOMKit/WebIDL/ClientType.swift | 2 +- Sources/DOMKit/WebIDL/Clipboard.swift | 16 +- Sources/DOMKit/WebIDL/ClipboardEvent.swift | 2 +- .../DOMKit/WebIDL/ClipboardEventInit.swift | 2 +- Sources/DOMKit/WebIDL/ClipboardItem.swift | 8 +- .../DOMKit/WebIDL/ClipboardItemOptions.swift | 2 +- .../ClipboardPermissionDescriptor.swift | 2 +- Sources/DOMKit/WebIDL/CloseEvent.swift | 2 +- Sources/DOMKit/WebIDL/CloseEventInit.swift | 6 +- Sources/DOMKit/WebIDL/CloseWatcher.swift | 2 +- .../DOMKit/WebIDL/CloseWatcherOptions.swift | 2 +- Sources/DOMKit/WebIDL/ClosureAttribute.swift | 84 ++-- Sources/DOMKit/WebIDL/CodecState.swift | 2 +- ...CollectedClientAdditionalPaymentData.swift | 10 +- .../DOMKit/WebIDL/CollectedClientData.swift | 8 +- .../WebIDL/CollectedClientPaymentData.swift | 2 +- Sources/DOMKit/WebIDL/ColorGamut.swift | 2 +- .../DOMKit/WebIDL/ColorSelectionOptions.swift | 2 +- .../DOMKit/WebIDL/ColorSelectionResult.swift | 2 +- .../DOMKit/WebIDL/ColorSpaceConversion.swift | 2 +- Sources/DOMKit/WebIDL/Comment.swift | 2 +- .../DOMKit/WebIDL/CompositeOperation.swift | 2 +- .../WebIDL/CompositeOperationOrAuto.swift | 2 +- ...o_or_seq_of_CompositeOperationOrAuto.swift | 6 +- Sources/DOMKit/WebIDL/CompositionEvent.swift | 4 +- .../DOMKit/WebIDL/CompositionEventInit.swift | 2 +- Sources/DOMKit/WebIDL/CompressionStream.swift | 2 +- .../DOMKit/WebIDL/ComputePressureFactor.swift | 2 +- .../WebIDL/ComputePressureObserver.swift | 6 +- .../ComputePressureObserverOptions.swift | 2 +- .../DOMKit/WebIDL/ComputePressureRecord.swift | 8 +- .../DOMKit/WebIDL/ComputePressureSource.swift | 2 +- .../DOMKit/WebIDL/ComputePressureState.swift | 2 +- .../DOMKit/WebIDL/ComputedEffectTiming.swift | 12 +- Sources/DOMKit/WebIDL/ConnectionType.swift | 2 +- .../DOMKit/WebIDL/ConstantSourceNode.swift | 2 +- .../DOMKit/WebIDL/ConstantSourceOptions.swift | 2 +- Sources/DOMKit/WebIDL/ConstrainBoolean.swift | 6 +- .../WebIDL/ConstrainBooleanParameters.swift | 4 +- .../DOMKit/WebIDL/ConstrainDOMString.swift | 8 +- .../WebIDL/ConstrainDOMStringParameters.swift | 4 +- Sources/DOMKit/WebIDL/ConstrainDouble.swift | 6 +- .../DOMKit/WebIDL/ConstrainDoubleRange.swift | 4 +- Sources/DOMKit/WebIDL/ConstrainPoint2D.swift | 6 +- .../WebIDL/ConstrainPoint2DParameters.swift | 4 +- Sources/DOMKit/WebIDL/ConstrainULong.swift | 6 +- .../DOMKit/WebIDL/ConstrainULongRange.swift | 4 +- Sources/DOMKit/WebIDL/ContactInfo.swift | 10 +- Sources/DOMKit/WebIDL/ContactProperty.swift | 2 +- Sources/DOMKit/WebIDL/ContactsManager.swift | 8 +- .../DOMKit/WebIDL/ContactsSelectOptions.swift | 2 +- Sources/DOMKit/WebIDL/ContentCategory.swift | 2 +- .../DOMKit/WebIDL/ContentDescription.swift | 12 +- Sources/DOMKit/WebIDL/ContentIndex.swift | 14 +- .../DOMKit/WebIDL/ContentIndexEventInit.swift | 2 +- .../WebIDL/ConvertCoordinateOptions.swift | 4 +- Sources/DOMKit/WebIDL/ConvolverNode.swift | 2 +- Sources/DOMKit/WebIDL/ConvolverOptions.swift | 4 +- Sources/DOMKit/WebIDL/CookieChangeEvent.swift | 2 +- .../DOMKit/WebIDL/CookieChangeEventInit.swift | 4 +- Sources/DOMKit/WebIDL/CookieInit.swift | 12 +- Sources/DOMKit/WebIDL/CookieListItem.swift | 14 +- Sources/DOMKit/WebIDL/CookieSameSite.swift | 2 +- Sources/DOMKit/WebIDL/CookieStore.swift | 48 +- .../WebIDL/CookieStoreDeleteOptions.swift | 6 +- .../DOMKit/WebIDL/CookieStoreGetOptions.swift | 4 +- .../DOMKit/WebIDL/CookieStoreManager.swift | 14 +- .../DOMKit/WebIDL/CountQueuingStrategy.swift | 2 +- .../WebIDL/CredentialCreationOptions.swift | 8 +- Sources/DOMKit/WebIDL/CredentialData.swift | 2 +- .../CredentialMediationRequirement.swift | 2 +- .../WebIDL/CredentialPropertiesOutput.swift | 2 +- .../WebIDL/CredentialRequestOptions.swift | 12 +- .../DOMKit/WebIDL/CredentialsContainer.swift | 20 +- Sources/DOMKit/WebIDL/Crypto.swift | 2 +- Sources/DOMKit/WebIDL/CryptoKeyID.swift | 6 +- Sources/DOMKit/WebIDL/CryptoKeyPair.swift | 4 +- .../WebIDL/CursorCaptureConstraint.swift | 2 +- .../DOMKit/WebIDL/CustomElementRegistry.swift | 12 +- Sources/DOMKit/WebIDL/CustomEvent.swift | 4 +- Sources/DOMKit/WebIDL/CustomEventInit.swift | 2 +- Sources/DOMKit/WebIDL/CustomStateSet.swift | 2 +- Sources/DOMKit/WebIDL/DOMException.swift | 2 +- .../DOMHighResTimeStamp_or_String.swift | 6 +- Sources/DOMKit/WebIDL/DOMImplementation.swift | 6 +- Sources/DOMKit/WebIDL/DOMMatrix.swift | 34 +- Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift | 24 +- Sources/DOMKit/WebIDL/DOMMatrixInit.swift | 22 +- Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift | 40 +- Sources/DOMKit/WebIDL/DOMParser.swift | 2 +- .../WebIDL/DOMParserSupportedType.swift | 2 +- Sources/DOMKit/WebIDL/DOMPoint.swift | 2 +- Sources/DOMKit/WebIDL/DOMPointInit.swift | 8 +- .../WebIDL/DOMPointInit_or_Double.swift | 6 +- ...ble_or_seq_of_DOMPointInit_or_Double.swift | 8 +- Sources/DOMKit/WebIDL/DOMPointReadOnly.swift | 6 +- Sources/DOMKit/WebIDL/DOMQuad.swift | 6 +- Sources/DOMKit/WebIDL/DOMQuadInit.swift | 8 +- Sources/DOMKit/WebIDL/DOMRect.swift | 2 +- Sources/DOMKit/WebIDL/DOMRectInit.swift | 8 +- Sources/DOMKit/WebIDL/DOMRectReadOnly.swift | 4 +- Sources/DOMKit/WebIDL/DOMStringList.swift | 2 +- Sources/DOMKit/WebIDL/DOMTokenList.swift | 12 +- Sources/DOMKit/WebIDL/DataCue.swift | 2 +- Sources/DOMKit/WebIDL/DataTransfer.swift | 8 +- Sources/DOMKit/WebIDL/DataTransferItem.swift | 2 +- .../DOMKit/WebIDL/DataTransferItemList.swift | 6 +- .../DOMKit/WebIDL/DecompressionStream.swift | 2 +- Sources/DOMKit/WebIDL/DelayNode.swift | 2 +- Sources/DOMKit/WebIDL/DelayOptions.swift | 4 +- Sources/DOMKit/WebIDL/DetectedBarcode.swift | 8 +- Sources/DOMKit/WebIDL/DetectedFace.swift | 4 +- Sources/DOMKit/WebIDL/DetectedText.swift | 6 +- Sources/DOMKit/WebIDL/DeviceMotionEvent.swift | 4 +- .../DeviceMotionEventAccelerationInit.swift | 6 +- .../DOMKit/WebIDL/DeviceMotionEventInit.swift | 8 +- .../DeviceMotionEventRotationRateInit.swift | 6 +- .../WebIDL/DeviceOrientationEvent.swift | 4 +- .../WebIDL/DeviceOrientationEventInit.swift | 8 +- .../WebIDL/DevicePermissionDescriptor.swift | 2 +- Sources/DOMKit/WebIDL/DevicePostureType.swift | 2 +- .../DOMKit/WebIDL/DigitalGoodsService.swift | 16 +- Sources/DOMKit/WebIDL/DirectionSetting.swift | 2 +- .../WebIDL/DirectoryPickerOptions.swift | 4 +- .../WebIDL/DisplayCaptureSurfaceType.swift | 2 +- .../DisplayMediaStreamConstraints.swift | 4 +- Sources/DOMKit/WebIDL/DistanceModelType.swift | 2 +- Sources/DOMKit/WebIDL/Document.swift | 68 +-- .../DOMKit/WebIDL/DocumentReadyState.swift | 2 +- Sources/DOMKit/WebIDL/DocumentTimeline.swift | 2 +- .../WebIDL/DocumentTimelineOptions.swift | 2 +- .../WebIDL/DocumentVisibilityState.swift | 2 +- .../WebIDL/Document_or_DocumentFragment.swift | 6 +- .../DOMKit/WebIDL/Document_or_Element.swift | 6 +- .../Document_or_XMLHttpRequestBodyInit.swift | 6 +- Sources/DOMKit/WebIDL/DoubleRange.swift | 4 +- .../WebIDL/Double_or_EffectTiming.swift | 6 +- .../Double_or_KeyframeAnimationOptions.swift | 6 +- .../Double_or_KeyframeEffectOptions.swift | 6 +- Sources/DOMKit/WebIDL/Double_or_String.swift | 6 +- .../WebIDL/Double_or_seq_of_Double.swift | 6 +- Sources/DOMKit/WebIDL/DragEvent.swift | 2 +- Sources/DOMKit/WebIDL/DragEventInit.swift | 2 +- .../WebIDL/DynamicsCompressorNode.swift | 2 +- .../WebIDL/DynamicsCompressorOptions.swift | 10 +- .../WebIDL/EXT_disjoint_timer_query.swift | 14 +- .../EXT_disjoint_timer_query_webgl2.swift | 2 +- Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift | 2 +- Sources/DOMKit/WebIDL/EcKeyGenParams.swift | 2 +- Sources/DOMKit/WebIDL/EcKeyImportParams.swift | 2 +- .../DOMKit/WebIDL/EcdhKeyDeriveParams.swift | 2 +- Sources/DOMKit/WebIDL/EcdsaParams.swift | 2 +- Sources/DOMKit/WebIDL/Edge.swift | 2 +- Sources/DOMKit/WebIDL/EditContext.swift | 12 +- Sources/DOMKit/WebIDL/EditContextInit.swift | 6 +- Sources/DOMKit/WebIDL/EffectTiming.swift | 18 +- .../WebIDL/EffectiveConnectionType.swift | 2 +- Sources/DOMKit/WebIDL/Element.swift | 84 ++-- .../DOMKit/WebIDL/ElementBasedOffset.swift | 6 +- .../WebIDL/ElementCreationOptions.swift | 2 +- .../ElementCreationOptions_or_String.swift | 6 +- .../WebIDL/ElementDefinitionOptions.swift | 2 +- Sources/DOMKit/WebIDL/ElementInternals.swift | 4 +- .../WebIDL/Element_or_HTMLCollection.swift | 6 +- .../Element_or_ProcessingInstruction.swift | 6 +- .../WebIDL/Element_or_RadioNodeList.swift | 6 +- Sources/DOMKit/WebIDL/Element_or_Text.swift | 6 +- Sources/DOMKit/WebIDL/EncodedAudioChunk.swift | 4 +- .../DOMKit/WebIDL/EncodedAudioChunkInit.swift | 8 +- .../WebIDL/EncodedAudioChunkMetadata.swift | 2 +- .../DOMKit/WebIDL/EncodedAudioChunkType.swift | 2 +- Sources/DOMKit/WebIDL/EncodedVideoChunk.swift | 4 +- .../DOMKit/WebIDL/EncodedVideoChunkInit.swift | 8 +- .../WebIDL/EncodedVideoChunkMetadata.swift | 6 +- .../DOMKit/WebIDL/EncodedVideoChunkType.swift | 2 +- Sources/DOMKit/WebIDL/EndOfStreamError.swift | 2 +- Sources/DOMKit/WebIDL/EndingType.swift | 2 +- Sources/DOMKit/WebIDL/ErrorEvent.swift | 2 +- Sources/DOMKit/WebIDL/ErrorEventInit.swift | 10 +- Sources/DOMKit/WebIDL/Event.swift | 4 +- Sources/DOMKit/WebIDL/EventInit.swift | 6 +- .../DOMKit/WebIDL/EventListenerOptions.swift | 2 +- Sources/DOMKit/WebIDL/EventModifierInit.swift | 28 +- Sources/DOMKit/WebIDL/EventSource.swift | 2 +- Sources/DOMKit/WebIDL/EventSourceInit.swift | 2 +- Sources/DOMKit/WebIDL/EventTarget.swift | 2 +- Sources/DOMKit/WebIDL/Event_or_String.swift | 6 +- .../ExtendableCookieChangeEventInit.swift | 4 +- Sources/DOMKit/WebIDL/EyeDropper.swift | 6 +- Sources/DOMKit/WebIDL/FaceDetector.swift | 8 +- .../DOMKit/WebIDL/FaceDetectorOptions.swift | 4 +- .../DOMKit/WebIDL/FederatedCredential.swift | 2 +- .../WebIDL/FederatedCredentialInit.swift | 10 +- .../FederatedCredentialRequestOptions.swift | 4 +- Sources/DOMKit/WebIDL/FetchEventInit.swift | 12 +- Sources/DOMKit/WebIDL/FetchPriority.swift | 2 +- Sources/DOMKit/WebIDL/File.swift | 2 +- .../DOMKit/WebIDL/FilePickerAcceptType.swift | 4 +- Sources/DOMKit/WebIDL/FilePickerOptions.swift | 8 +- Sources/DOMKit/WebIDL/FilePropertyBag.swift | 2 +- Sources/DOMKit/WebIDL/FileReader.swift | 8 +- .../FileSystemCreateWritableOptions.swift | 2 +- .../WebIDL/FileSystemDirectoryHandle.swift | 24 +- .../DOMKit/WebIDL/FileSystemFileHandle.swift | 8 +- Sources/DOMKit/WebIDL/FileSystemFlags.swift | 4 +- .../FileSystemGetDirectoryOptions.swift | 2 +- .../WebIDL/FileSystemGetFileOptions.swift | 2 +- Sources/DOMKit/WebIDL/FileSystemHandle.swift | 18 +- .../DOMKit/WebIDL/FileSystemHandleKind.swift | 2 +- ...FileSystemHandlePermissionDescriptor.swift | 2 +- .../FileSystemPermissionDescriptor.swift | 4 +- .../WebIDL/FileSystemPermissionMode.swift | 2 +- .../WebIDL/FileSystemRemoveOptions.swift | 2 +- .../WebIDL/FileSystemWritableFileStream.swift | 18 +- .../WebIDL/FileSystemWriteChunkType.swift | 10 +- .../WebIDL/File_or_FormData_or_String.swift | 8 +- Sources/DOMKit/WebIDL/FillLightMode.swift | 2 +- Sources/DOMKit/WebIDL/FillMode.swift | 2 +- Sources/DOMKit/WebIDL/Float32List.swift | 6 +- Sources/DOMKit/WebIDL/FlowControlType.swift | 2 +- Sources/DOMKit/WebIDL/FocusEvent.swift | 2 +- Sources/DOMKit/WebIDL/FocusEventInit.swift | 2 +- Sources/DOMKit/WebIDL/FocusOptions.swift | 2 +- .../WebIDL/FocusableAreaSearchMode.swift | 2 +- .../DOMKit/WebIDL/FocusableAreasOption.swift | 2 +- Sources/DOMKit/WebIDL/FontFace.swift | 4 +- .../DOMKit/WebIDL/FontFaceDescriptors.swift | 22 +- .../DOMKit/WebIDL/FontFaceLoadStatus.swift | 2 +- Sources/DOMKit/WebIDL/FontFaceSet.swift | 14 +- .../DOMKit/WebIDL/FontFaceSetLoadEvent.swift | 2 +- .../WebIDL/FontFaceSetLoadEventInit.swift | 2 +- .../DOMKit/WebIDL/FontFaceSetLoadStatus.swift | 2 +- Sources/DOMKit/WebIDL/FontManager.swift | 6 +- Sources/DOMKit/WebIDL/FontMetadata.swift | 2 +- Sources/DOMKit/WebIDL/FormData.swift | 18 +- .../DOMKit/WebIDL/FormDataEntryValue.swift | 6 +- Sources/DOMKit/WebIDL/FormDataEvent.swift | 2 +- Sources/DOMKit/WebIDL/FormDataEventInit.swift | 2 +- Sources/DOMKit/WebIDL/FrameType.swift | 2 +- .../WebIDL/FullscreenNavigationUI.swift | 2 +- Sources/DOMKit/WebIDL/FullscreenOptions.swift | 2 +- Sources/DOMKit/WebIDL/GPU.swift | 6 +- Sources/DOMKit/WebIDL/GPUAdapter.swift | 6 +- Sources/DOMKit/WebIDL/GPUAddressMode.swift | 2 +- .../WebIDL/GPUBindGroupDescriptor.swift | 4 +- Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift | 4 +- .../WebIDL/GPUBindGroupLayoutDescriptor.swift | 2 +- .../WebIDL/GPUBindGroupLayoutEntry.swift | 14 +- .../DOMKit/WebIDL/GPUBindingResource.swift | 10 +- Sources/DOMKit/WebIDL/GPUBlendComponent.swift | 6 +- Sources/DOMKit/WebIDL/GPUBlendFactor.swift | 2 +- Sources/DOMKit/WebIDL/GPUBlendOperation.swift | 2 +- Sources/DOMKit/WebIDL/GPUBlendState.swift | 4 +- Sources/DOMKit/WebIDL/GPUBuffer.swift | 8 +- Sources/DOMKit/WebIDL/GPUBufferBinding.swift | 6 +- .../WebIDL/GPUBufferBindingLayout.swift | 6 +- .../DOMKit/WebIDL/GPUBufferBindingType.swift | 2 +- .../DOMKit/WebIDL/GPUBufferDescriptor.swift | 6 +- .../WebIDL/GPUBuffer_or_WebGLBuffer.swift | 6 +- .../GPUCanvasCompositingAlphaMode.swift | 2 +- .../WebIDL/GPUCanvasConfiguration.swift | 14 +- Sources/DOMKit/WebIDL/GPUCanvasContext.swift | 4 +- Sources/DOMKit/WebIDL/GPUColor.swift | 6 +- Sources/DOMKit/WebIDL/GPUColorDict.swift | 8 +- .../DOMKit/WebIDL/GPUColorTargetState.swift | 6 +- Sources/DOMKit/WebIDL/GPUCommandEncoder.swift | 20 +- .../DOMKit/WebIDL/GPUCompareFunction.swift | 2 +- .../WebIDL/GPUCompilationMessageType.swift | 2 +- .../WebIDL/GPUComputePassDescriptor.swift | 2 +- .../DOMKit/WebIDL/GPUComputePassEncoder.swift | 6 +- .../GPUComputePassTimestampLocation.swift | 2 +- .../WebIDL/GPUComputePassTimestampWrite.swift | 6 +- .../WebIDL/GPUComputePipelineDescriptor.swift | 2 +- Sources/DOMKit/WebIDL/GPUCullMode.swift | 2 +- .../DOMKit/WebIDL/GPUDebugCommandsMixin.swift | 4 +- .../DOMKit/WebIDL/GPUDepthStencilState.swift | 20 +- Sources/DOMKit/WebIDL/GPUDevice.swift | 42 +- .../DOMKit/WebIDL/GPUDeviceDescriptor.swift | 6 +- .../DOMKit/WebIDL/GPUDeviceLostReason.swift | 2 +- Sources/DOMKit/WebIDL/GPUError.swift | 6 +- Sources/DOMKit/WebIDL/GPUErrorFilter.swift | 2 +- Sources/DOMKit/WebIDL/GPUExtent3D.swift | 6 +- Sources/DOMKit/WebIDL/GPUExtent3DDict.swift | 6 +- .../WebIDL/GPUExternalTextureDescriptor.swift | 4 +- Sources/DOMKit/WebIDL/GPUFeatureName.swift | 2 +- Sources/DOMKit/WebIDL/GPUFilterMode.swift | 2 +- Sources/DOMKit/WebIDL/GPUFragmentState.swift | 2 +- Sources/DOMKit/WebIDL/GPUFrontFace.swift | 2 +- .../DOMKit/WebIDL/GPUImageCopyBuffer.swift | 2 +- .../WebIDL/GPUImageCopyExternalImage.swift | 6 +- .../DOMKit/WebIDL/GPUImageCopyTexture.swift | 8 +- .../WebIDL/GPUImageCopyTextureTagged.swift | 4 +- .../DOMKit/WebIDL/GPUImageDataLayout.swift | 6 +- Sources/DOMKit/WebIDL/GPUIndexFormat.swift | 2 +- Sources/DOMKit/WebIDL/GPULoadOp.swift | 2 +- .../DOMKit/WebIDL/GPUMipmapFilterMode.swift | 2 +- .../DOMKit/WebIDL/GPUMultisampleState.swift | 6 +- .../WebIDL/GPUObjectDescriptorBase.swift | 2 +- Sources/DOMKit/WebIDL/GPUOrigin2D.swift | 6 +- Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift | 4 +- Sources/DOMKit/WebIDL/GPUOrigin3D.swift | 6 +- Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift | 6 +- Sources/DOMKit/WebIDL/GPUPipelineBase.swift | 2 +- .../WebIDL/GPUPipelineDescriptorBase.swift | 2 +- .../WebIDL/GPUPipelineLayoutDescriptor.swift | 2 +- .../DOMKit/WebIDL/GPUPowerPreference.swift | 2 +- .../WebIDL/GPUPredefinedColorSpace.swift | 2 +- Sources/DOMKit/WebIDL/GPUPrimitiveState.swift | 10 +- .../DOMKit/WebIDL/GPUPrimitiveTopology.swift | 2 +- .../WebIDL/GPUProgrammablePassEncoder.swift | 4 +- .../DOMKit/WebIDL/GPUProgrammableStage.swift | 6 +- .../DOMKit/WebIDL/GPUQuerySetDescriptor.swift | 4 +- Sources/DOMKit/WebIDL/GPUQueryType.swift | 2 +- Sources/DOMKit/WebIDL/GPUQueue.swift | 10 +- .../WebIDL/GPURenderBundleEncoder.swift | 2 +- .../GPURenderBundleEncoderDescriptor.swift | 4 +- .../DOMKit/WebIDL/GPURenderEncoderBase.swift | 14 +- .../WebIDL/GPURenderPassColorAttachment.swift | 10 +- .../GPURenderPassDepthStencilAttachment.swift | 18 +- .../WebIDL/GPURenderPassDescriptor.swift | 8 +- .../DOMKit/WebIDL/GPURenderPassEncoder.swift | 22 +- .../DOMKit/WebIDL/GPURenderPassLayout.swift | 6 +- .../GPURenderPassTimestampLocation.swift | 2 +- .../WebIDL/GPURenderPassTimestampWrite.swift | 6 +- .../WebIDL/GPURenderPipelineDescriptor.swift | 10 +- .../WebIDL/GPURequestAdapterOptions.swift | 4 +- .../WebIDL/GPUSamplerBindingLayout.swift | 2 +- .../DOMKit/WebIDL/GPUSamplerBindingType.swift | 2 +- .../DOMKit/WebIDL/GPUSamplerDescriptor.swift | 20 +- Sources/DOMKit/WebIDL/GPUShaderModule.swift | 2 +- .../GPUShaderModuleCompilationHint.swift | 2 +- .../WebIDL/GPUShaderModuleDescriptor.swift | 6 +- .../DOMKit/WebIDL/GPUStencilFaceState.swift | 8 +- .../DOMKit/WebIDL/GPUStencilOperation.swift | 2 +- .../WebIDL/GPUStorageTextureAccess.swift | 2 +- .../GPUStorageTextureBindingLayout.swift | 6 +- Sources/DOMKit/WebIDL/GPUStoreOp.swift | 2 +- Sources/DOMKit/WebIDL/GPUTexture.swift | 2 +- Sources/DOMKit/WebIDL/GPUTextureAspect.swift | 2 +- .../WebIDL/GPUTextureBindingLayout.swift | 6 +- .../DOMKit/WebIDL/GPUTextureDescriptor.swift | 14 +- .../DOMKit/WebIDL/GPUTextureDimension.swift | 2 +- Sources/DOMKit/WebIDL/GPUTextureFormat.swift | 2 +- .../DOMKit/WebIDL/GPUTextureSampleType.swift | 2 +- .../WebIDL/GPUTextureViewDescriptor.swift | 14 +- .../WebIDL/GPUTextureViewDimension.swift | 2 +- .../WebIDL/GPUUncapturedErrorEvent.swift | 2 +- .../WebIDL/GPUUncapturedErrorEventInit.swift | 2 +- .../DOMKit/WebIDL/GPUValidationError.swift | 2 +- .../DOMKit/WebIDL/GPUVertexAttribute.swift | 6 +- .../DOMKit/WebIDL/GPUVertexBufferLayout.swift | 6 +- Sources/DOMKit/WebIDL/GPUVertexFormat.swift | 2 +- Sources/DOMKit/WebIDL/GPUVertexState.swift | 2 +- Sources/DOMKit/WebIDL/GPUVertexStepMode.swift | 2 +- Sources/DOMKit/WebIDL/GainNode.swift | 2 +- Sources/DOMKit/WebIDL/GainOptions.swift | 2 +- Sources/DOMKit/WebIDL/GamepadEvent.swift | 2 +- Sources/DOMKit/WebIDL/GamepadEventInit.swift | 2 +- Sources/DOMKit/WebIDL/GamepadHand.swift | 2 +- .../DOMKit/WebIDL/GamepadHapticActuator.swift | 6 +- .../WebIDL/GamepadHapticActuatorType.swift | 2 +- .../DOMKit/WebIDL/GamepadMappingType.swift | 2 +- .../WebIDL/GenerateTestReportParameters.swift | 4 +- Sources/DOMKit/WebIDL/Geolocation.swift | 2 +- .../WebIDL/GeolocationReadingValues.swift | 14 +- Sources/DOMKit/WebIDL/GeolocationSensor.swift | 8 +- .../WebIDL/GeolocationSensorReading.swift | 16 +- Sources/DOMKit/WebIDL/GeometryNode.swift | 10 +- Sources/DOMKit/WebIDL/GeometryUtils.swift | 8 +- .../DOMKit/WebIDL/GetAnimationsOptions.swift | 2 +- .../WebIDL/GetNotificationOptions.swift | 2 +- .../DOMKit/WebIDL/GetRootNodeOptions.swift | 2 +- Sources/DOMKit/WebIDL/Global.swift | 2 +- Sources/DOMKit/WebIDL/GlobalDescriptor.swift | 4 +- Sources/DOMKit/WebIDL/GravitySensor.swift | 2 +- Sources/DOMKit/WebIDL/GroupEffect.swift | 6 +- Sources/DOMKit/WebIDL/Gyroscope.swift | 2 +- .../GyroscopeLocalCoordinateSystem.swift | 2 +- .../WebIDL/GyroscopeReadingValues.swift | 6 +- .../WebIDL/GyroscopeSensorOptions.swift | 2 +- Sources/DOMKit/WebIDL/HID.swift | 8 +- Sources/DOMKit/WebIDL/HIDCollectionInfo.swift | 14 +- .../DOMKit/WebIDL/HIDConnectionEvent.swift | 2 +- .../WebIDL/HIDConnectionEventInit.swift | 2 +- Sources/DOMKit/WebIDL/HIDDevice.swift | 24 +- Sources/DOMKit/WebIDL/HIDDeviceFilter.swift | 8 +- .../WebIDL/HIDDeviceRequestOptions.swift | 2 +- .../DOMKit/WebIDL/HIDInputReportEvent.swift | 2 +- .../WebIDL/HIDInputReportEventInit.swift | 6 +- Sources/DOMKit/WebIDL/HIDReportInfo.swift | 4 +- Sources/DOMKit/WebIDL/HIDReportItem.swift | 56 +-- Sources/DOMKit/WebIDL/HIDUnitSystem.swift | 2 +- Sources/DOMKit/WebIDL/HTMLAllCollection.swift | 2 +- Sources/DOMKit/WebIDL/HTMLButtonElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 6 +- ...nt_or_ImageBitmap_or_OffscreenCanvas.swift | 8 +- ...HTMLCanvasElement_or_OffscreenCanvas.swift | 6 +- Sources/DOMKit/WebIDL/HTMLDialogElement.swift | 2 +- .../DOMKit/WebIDL/HTMLElement_or_Int32.swift | 6 +- .../DOMKit/WebIDL/HTMLFieldSetElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLFormElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLImageElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLInputElement.swift | 12 +- Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 20 +- Sources/DOMKit/WebIDL/HTMLObjectElement.swift | 2 +- ...OptGroupElement_or_HTMLOptionElement.swift | 6 +- .../DOMKit/WebIDL/HTMLOptionsCollection.swift | 4 +- Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift | 2 +- .../DOMKit/WebIDL/HTMLOrSVGImageElement.swift | 6 +- .../WebIDL/HTMLOrSVGScriptElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLOutputElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLPortalElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLSelectElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLSlotElement.swift | 6 +- Sources/DOMKit/WebIDL/HTMLTableElement.swift | 4 +- .../DOMKit/WebIDL/HTMLTableRowElement.swift | 4 +- .../WebIDL/HTMLTableSectionElement.swift | 4 +- .../DOMKit/WebIDL/HTMLTextAreaElement.swift | 8 +- Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 4 +- .../DOMKit/WebIDL/HardwareAcceleration.swift | 2 +- Sources/DOMKit/WebIDL/HashChangeEvent.swift | 2 +- .../DOMKit/WebIDL/HashChangeEventInit.swift | 4 +- Sources/DOMKit/WebIDL/HdrMetadataType.swift | 2 +- Sources/DOMKit/WebIDL/Headers.swift | 12 +- Sources/DOMKit/WebIDL/HeadersInit.swift | 6 +- Sources/DOMKit/WebIDL/Highlight.swift | 2 +- Sources/DOMKit/WebIDL/HighlightType.swift | 2 +- Sources/DOMKit/WebIDL/History.swift | 6 +- Sources/DOMKit/WebIDL/HkdfParams.swift | 6 +- Sources/DOMKit/WebIDL/HmacImportParams.swift | 4 +- Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift | 4 +- Sources/DOMKit/WebIDL/HmacKeyGenParams.swift | 4 +- Sources/DOMKit/WebIDL/IDBCursor.swift | 8 +- .../DOMKit/WebIDL/IDBCursorDirection.swift | 2 +- ...Cursor_or_IDBIndex_or_IDBObjectStore.swift | 8 +- Sources/DOMKit/WebIDL/IDBDatabase.swift | 6 +- Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift | 4 +- Sources/DOMKit/WebIDL/IDBFactory.swift | 8 +- Sources/DOMKit/WebIDL/IDBIndex.swift | 14 +- .../DOMKit/WebIDL/IDBIndexParameters.swift | 4 +- .../WebIDL/IDBIndex_or_IDBObjectStore.swift | 6 +- Sources/DOMKit/WebIDL/IDBKeyRange.swift | 10 +- Sources/DOMKit/WebIDL/IDBObjectStore.swift | 26 +- .../WebIDL/IDBObjectStoreParameters.swift | 4 +- .../DOMKit/WebIDL/IDBRequestReadyState.swift | 2 +- Sources/DOMKit/WebIDL/IDBTransaction.swift | 2 +- .../WebIDL/IDBTransactionDurability.swift | 2 +- .../DOMKit/WebIDL/IDBTransactionMode.swift | 2 +- .../DOMKit/WebIDL/IDBTransactionOptions.swift | 2 +- .../DOMKit/WebIDL/IDBVersionChangeEvent.swift | 2 +- .../WebIDL/IDBVersionChangeEventInit.swift | 4 +- Sources/DOMKit/WebIDL/IIRFilterNode.swift | 4 +- Sources/DOMKit/WebIDL/IIRFilterOptions.swift | 4 +- Sources/DOMKit/WebIDL/IdleDetector.swift | 8 +- Sources/DOMKit/WebIDL/IdleOptions.swift | 4 +- .../DOMKit/WebIDL/IdleRequestOptions.swift | 2 +- .../DOMKit/WebIDL/ImageBitmapOptions.swift | 12 +- .../WebIDL/ImageBitmapRenderingContext.swift | 2 +- .../ImageBitmapRenderingContextSettings.swift | 2 +- Sources/DOMKit/WebIDL/ImageBitmapSource.swift | 8 +- Sources/DOMKit/WebIDL/ImageBufferSource.swift | 6 +- Sources/DOMKit/WebIDL/ImageCapture.swift | 14 +- Sources/DOMKit/WebIDL/ImageData.swift | 4 +- Sources/DOMKit/WebIDL/ImageDataSettings.swift | 2 +- .../DOMKit/WebIDL/ImageDecodeOptions.swift | 4 +- Sources/DOMKit/WebIDL/ImageDecodeResult.swift | 4 +- Sources/DOMKit/WebIDL/ImageDecoder.swift | 14 +- Sources/DOMKit/WebIDL/ImageDecoderInit.swift | 14 +- .../DOMKit/WebIDL/ImageEncodeOptions.swift | 4 +- Sources/DOMKit/WebIDL/ImageObject.swift | 6 +- Sources/DOMKit/WebIDL/ImageOrientation.swift | 2 +- Sources/DOMKit/WebIDL/ImageResource.swift | 8 +- .../DOMKit/WebIDL/ImageSmoothingQuality.swift | 2 +- Sources/DOMKit/WebIDL/ImportExportKind.swift | 2 +- Sources/DOMKit/WebIDL/Ink.swift | 6 +- Sources/DOMKit/WebIDL/InkPresenter.swift | 2 +- Sources/DOMKit/WebIDL/InkPresenterParam.swift | 2 +- Sources/DOMKit/WebIDL/InkTrailStyle.swift | 4 +- .../WebIDL/InputDeviceCapabilities.swift | 2 +- .../WebIDL/InputDeviceCapabilitiesInit.swift | 4 +- Sources/DOMKit/WebIDL/InputEvent.swift | 2 +- Sources/DOMKit/WebIDL/InputEventInit.swift | 10 +- Sources/DOMKit/WebIDL/Instance.swift | 2 +- .../WebIDL/Int32Array_or_seq_of_GLsizei.swift | 6 +- Sources/DOMKit/WebIDL/Int32List.swift | 6 +- .../DOMKit/WebIDL/IntersectionObserver.swift | 4 +- .../WebIDL/IntersectionObserverEntry.swift | 2 +- .../IntersectionObserverEntryInit.swift | 14 +- .../WebIDL/IntersectionObserverInit.swift | 6 +- .../WebIDL/IntrinsicSizesResultOptions.swift | 4 +- .../DOMKit/WebIDL/IsInputPendingOptions.swift | 2 +- Sources/DOMKit/WebIDL/ItemDetails.swift | 22 +- Sources/DOMKit/WebIDL/ItemType.swift | 2 +- .../WebIDL/IterationCompositeOperation.swift | 2 +- Sources/DOMKit/WebIDL/JsonWebKey.swift | 36 +- Sources/DOMKit/WebIDL/KeyAlgorithm.swift | 2 +- Sources/DOMKit/WebIDL/KeyFormat.swift | 2 +- .../WebIDL/KeySystemTrackConfiguration.swift | 4 +- Sources/DOMKit/WebIDL/KeyType.swift | 2 +- Sources/DOMKit/WebIDL/KeyUsage.swift | 2 +- Sources/DOMKit/WebIDL/Keyboard.swift | 8 +- Sources/DOMKit/WebIDL/KeyboardEvent.swift | 24 +- Sources/DOMKit/WebIDL/KeyboardEventInit.swift | 14 +- .../WebIDL/KeyframeAnimationOptions.swift | 4 +- Sources/DOMKit/WebIDL/KeyframeEffect.swift | 6 +- .../DOMKit/WebIDL/KeyframeEffectOptions.swift | 6 +- Sources/DOMKit/WebIDL/Landmark.swift | 4 +- Sources/DOMKit/WebIDL/LandmarkType.swift | 2 +- Sources/DOMKit/WebIDL/LargeBlobSupport.swift | 2 +- Sources/DOMKit/WebIDL/LatencyMode.swift | 2 +- .../WebIDL/LayoutConstraintsOptions.swift | 18 +- Sources/DOMKit/WebIDL/LayoutOptions.swift | 4 +- Sources/DOMKit/WebIDL/LayoutSizingMode.swift | 2 +- Sources/DOMKit/WebIDL/LineAlignSetting.swift | 2 +- .../WebIDL/LineAndPositionSetting.swift | 6 +- .../WebIDL/LinearAccelerationSensor.swift | 2 +- Sources/DOMKit/WebIDL/Location.swift | 4 +- Sources/DOMKit/WebIDL/LockInfo.swift | 6 +- Sources/DOMKit/WebIDL/LockManager.swift | 2 +- .../DOMKit/WebIDL/LockManagerSnapshot.swift | 4 +- Sources/DOMKit/WebIDL/LockMode.swift | 2 +- Sources/DOMKit/WebIDL/LockOptions.swift | 8 +- .../DOMKit/WebIDL/MIDIConnectionEvent.swift | 2 +- .../WebIDL/MIDIConnectionEventInit.swift | 2 +- Sources/DOMKit/WebIDL/MIDIMessageEvent.swift | 2 +- .../DOMKit/WebIDL/MIDIMessageEventInit.swift | 2 +- Sources/DOMKit/WebIDL/MIDIOptions.swift | 4 +- Sources/DOMKit/WebIDL/MIDIOutput.swift | 2 +- Sources/DOMKit/WebIDL/MIDIPort.swift | 4 +- .../WebIDL/MIDIPortConnectionState.swift | 2 +- .../DOMKit/WebIDL/MIDIPortDeviceState.swift | 2 +- Sources/DOMKit/WebIDL/MIDIPortType.swift | 2 +- Sources/DOMKit/WebIDL/ML.swift | 6 +- Sources/DOMKit/WebIDL/MLAutoPad.swift | 2 +- .../WebIDL/MLBatchNormalizationOptions.swift | 10 +- .../DOMKit/WebIDL/MLBufferResourceView.swift | 6 +- Sources/DOMKit/WebIDL/MLBufferView.swift | 6 +- Sources/DOMKit/WebIDL/MLClampOptions.swift | 4 +- Sources/DOMKit/WebIDL/MLContextOptions.swift | 4 +- .../WebIDL/MLConv2dFilterOperandLayout.swift | 2 +- Sources/DOMKit/WebIDL/MLConv2dOptions.swift | 18 +- ...MLConvTranspose2dFilterOperandLayout.swift | 2 +- .../WebIDL/MLConvTranspose2dOptions.swift | 22 +- .../DOMKit/WebIDL/MLDevicePreference.swift | 2 +- Sources/DOMKit/WebIDL/MLEluOptions.swift | 2 +- Sources/DOMKit/WebIDL/MLGemmOptions.swift | 10 +- Sources/DOMKit/WebIDL/MLGraph.swift | 2 +- Sources/DOMKit/WebIDL/MLGraphBuilder.swift | 156 +++--- Sources/DOMKit/WebIDL/MLGruCellOptions.swift | 10 +- Sources/DOMKit/WebIDL/MLGruOptions.swift | 16 +- .../DOMKit/WebIDL/MLHardSigmoidOptions.swift | 4 +- Sources/DOMKit/WebIDL/MLInput.swift | 4 +- .../DOMKit/WebIDL/MLInputOperandLayout.swift | 2 +- .../DOMKit/WebIDL/MLInput_or_MLResource.swift | 6 +- .../MLInstanceNormalizationOptions.swift | 8 +- .../DOMKit/WebIDL/MLInterpolationMode.swift | 2 +- .../DOMKit/WebIDL/MLLeakyReluOptions.swift | 2 +- Sources/DOMKit/WebIDL/MLLinearOptions.swift | 4 +- .../DOMKit/WebIDL/MLOperandDescriptor.swift | 4 +- Sources/DOMKit/WebIDL/MLOperandType.swift | 2 +- Sources/DOMKit/WebIDL/MLPadOptions.swift | 4 +- Sources/DOMKit/WebIDL/MLPaddingMode.swift | 2 +- Sources/DOMKit/WebIDL/MLPool2dOptions.swift | 16 +- Sources/DOMKit/WebIDL/MLPowerPreference.swift | 2 +- .../WebIDL/MLRecurrentNetworkDirection.swift | 2 +- .../MLRecurrentNetworkWeightLayout.swift | 2 +- Sources/DOMKit/WebIDL/MLReduceOptions.swift | 4 +- .../DOMKit/WebIDL/MLResample2dOptions.swift | 8 +- Sources/DOMKit/WebIDL/MLResource.swift | 8 +- Sources/DOMKit/WebIDL/MLRoundingType.swift | 2 +- Sources/DOMKit/WebIDL/MLSliceOptions.swift | 2 +- Sources/DOMKit/WebIDL/MLSoftplusOptions.swift | 2 +- Sources/DOMKit/WebIDL/MLSplitOptions.swift | 2 +- Sources/DOMKit/WebIDL/MLSqueezeOptions.swift | 2 +- .../DOMKit/WebIDL/MLTransposeOptions.swift | 2 +- Sources/DOMKit/WebIDL/Magnetometer.swift | 2 +- .../MagnetometerLocalCoordinateSystem.swift | 2 +- .../WebIDL/MagnetometerReadingValues.swift | 6 +- .../WebIDL/MagnetometerSensorOptions.swift | 2 +- Sources/DOMKit/WebIDL/MediaCapabilities.swift | 12 +- .../MediaCapabilitiesDecodingInfo.swift | 4 +- .../MediaCapabilitiesEncodingInfo.swift | 2 +- .../DOMKit/WebIDL/MediaCapabilitiesInfo.swift | 6 +- ...iaCapabilitiesKeySystemConfiguration.swift | 14 +- .../DOMKit/WebIDL/MediaConfiguration.swift | 4 +- .../WebIDL/MediaDecodingConfiguration.swift | 4 +- Sources/DOMKit/WebIDL/MediaDecodingType.swift | 2 +- Sources/DOMKit/WebIDL/MediaDeviceKind.swift | 2 +- Sources/DOMKit/WebIDL/MediaDevices.swift | 26 +- .../WebIDL/MediaElementAudioSourceNode.swift | 2 +- .../MediaElementAudioSourceOptions.swift | 2 +- .../WebIDL/MediaEncodingConfiguration.swift | 2 +- Sources/DOMKit/WebIDL/MediaEncodingType.swift | 2 +- .../DOMKit/WebIDL/MediaEncryptedEvent.swift | 2 +- .../WebIDL/MediaEncryptedEventInit.swift | 4 +- Sources/DOMKit/WebIDL/MediaImage.swift | 6 +- .../DOMKit/WebIDL/MediaKeyMessageEvent.swift | 2 +- .../WebIDL/MediaKeyMessageEventInit.swift | 4 +- .../DOMKit/WebIDL/MediaKeyMessageType.swift | 2 +- Sources/DOMKit/WebIDL/MediaKeySession.swift | 22 +- .../WebIDL/MediaKeySessionClosedReason.swift | 2 +- .../DOMKit/WebIDL/MediaKeySessionType.swift | 2 +- Sources/DOMKit/WebIDL/MediaKeyStatus.swift | 2 +- Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift | 4 +- .../DOMKit/WebIDL/MediaKeySystemAccess.swift | 2 +- .../WebIDL/MediaKeySystemConfiguration.swift | 14 +- .../MediaKeySystemMediaCapability.swift | 6 +- Sources/DOMKit/WebIDL/MediaKeys.swift | 8 +- .../DOMKit/WebIDL/MediaKeysRequirement.swift | 2 +- Sources/DOMKit/WebIDL/MediaList.swift | 4 +- .../DOMKit/WebIDL/MediaList_or_String.swift | 6 +- Sources/DOMKit/WebIDL/MediaMetadata.swift | 2 +- Sources/DOMKit/WebIDL/MediaMetadataInit.swift | 8 +- .../DOMKit/WebIDL/MediaPositionState.swift | 6 +- Sources/DOMKit/WebIDL/MediaProvider.swift | 8 +- .../DOMKit/WebIDL/MediaQueryListEvent.swift | 2 +- .../WebIDL/MediaQueryListEventInit.swift | 4 +- Sources/DOMKit/WebIDL/MediaRecorder.swift | 6 +- .../WebIDL/MediaRecorderErrorEvent.swift | 2 +- .../WebIDL/MediaRecorderErrorEventInit.swift | 2 +- .../DOMKit/WebIDL/MediaRecorderOptions.swift | 10 +- Sources/DOMKit/WebIDL/MediaSession.swift | 6 +- .../DOMKit/WebIDL/MediaSessionAction.swift | 2 +- .../WebIDL/MediaSessionActionDetails.swift | 8 +- .../WebIDL/MediaSessionPlaybackState.swift | 2 +- .../DOMKit/WebIDL/MediaSettingsRange.swift | 6 +- Sources/DOMKit/WebIDL/MediaSource.swift | 10 +- Sources/DOMKit/WebIDL/MediaStream.swift | 10 +- .../MediaStreamAudioDestinationNode.swift | 2 +- .../WebIDL/MediaStreamAudioSourceNode.swift | 2 +- .../MediaStreamAudioSourceOptions.swift | 2 +- .../WebIDL/MediaStreamConstraints.swift | 8 +- Sources/DOMKit/WebIDL/MediaStreamTrack.swift | 6 +- .../MediaStreamTrackAudioSourceNode.swift | 2 +- .../MediaStreamTrackAudioSourceOptions.swift | 2 +- .../DOMKit/WebIDL/MediaStreamTrackEvent.swift | 2 +- .../WebIDL/MediaStreamTrackEventInit.swift | 2 +- .../MediaStreamTrackProcessorInit.swift | 4 +- .../DOMKit/WebIDL/MediaStreamTrackState.swift | 2 +- .../WebIDL/MediaStreamTrack_or_String.swift | 6 +- .../WebIDL/MediaTrackCapabilities.swift | 68 +-- .../WebIDL/MediaTrackConstraintSet.swift | 74 +-- .../DOMKit/WebIDL/MediaTrackConstraints.swift | 2 +- .../DOMKit/WebIDL/MediaTrackSettings.swift | 72 +-- .../MediaTrackSupportedConstraints.swift | 74 +-- Sources/DOMKit/WebIDL/Memory.swift | 4 +- Sources/DOMKit/WebIDL/MemoryAttribution.swift | 6 +- .../WebIDL/MemoryAttributionContainer.swift | 4 +- .../DOMKit/WebIDL/MemoryBreakdownEntry.swift | 6 +- Sources/DOMKit/WebIDL/MemoryDescriptor.swift | 4 +- Sources/DOMKit/WebIDL/MemoryMeasurement.swift | 4 +- Sources/DOMKit/WebIDL/MessageEvent.swift | 18 +- Sources/DOMKit/WebIDL/MessageEventInit.swift | 10 +- .../DOMKit/WebIDL/MessageEventSource.swift | 8 +- Sources/DOMKit/WebIDL/MessagePort.swift | 4 +- Sources/DOMKit/WebIDL/MeteringMode.swift | 2 +- .../WebIDL/MidiPermissionDescriptor.swift | 2 +- .../WebIDL/MockCameraConfiguration.swift | 4 +- .../MockCaptureDeviceConfiguration.swift | 6 +- .../WebIDL/MockCapturePromptResult.swift | 2 +- ...MockCapturePromptResultConfiguration.swift | 4 +- .../WebIDL/MockMicrophoneConfiguration.swift | 2 +- Sources/DOMKit/WebIDL/MockSensor.swift | 6 +- .../WebIDL/MockSensorConfiguration.swift | 8 +- Sources/DOMKit/WebIDL/MockSensorType.swift | 2 +- Sources/DOMKit/WebIDL/Module.swift | 8 +- .../WebIDL/ModuleExportDescriptor.swift | 4 +- .../WebIDL/ModuleImportDescriptor.swift | 6 +- Sources/DOMKit/WebIDL/MouseEvent.swift | 34 +- Sources/DOMKit/WebIDL/MouseEventInit.swift | 18 +- .../WebIDL/MultiCacheQueryOptions.swift | 2 +- Sources/DOMKit/WebIDL/MutationEvent.swift | 16 +- Sources/DOMKit/WebIDL/MutationObserver.swift | 2 +- .../DOMKit/WebIDL/MutationObserverInit.swift | 14 +- .../WebIDL/NDEFMakeReadOnlyOptions.swift | 2 +- Sources/DOMKit/WebIDL/NDEFMessage.swift | 2 +- Sources/DOMKit/WebIDL/NDEFMessageInit.swift | 2 +- Sources/DOMKit/WebIDL/NDEFMessageSource.swift | 8 +- Sources/DOMKit/WebIDL/NDEFReader.swift | 18 +- Sources/DOMKit/WebIDL/NDEFReadingEvent.swift | 2 +- .../DOMKit/WebIDL/NDEFReadingEventInit.swift | 4 +- Sources/DOMKit/WebIDL/NDEFRecord.swift | 2 +- Sources/DOMKit/WebIDL/NDEFRecordInit.swift | 12 +- Sources/DOMKit/WebIDL/NDEFScanOptions.swift | 2 +- Sources/DOMKit/WebIDL/NDEFWriteOptions.swift | 4 +- Sources/DOMKit/WebIDL/NamedFlow.swift | 2 +- Sources/DOMKit/WebIDL/NamedNodeMap.swift | 10 +- Sources/DOMKit/WebIDL/NavigateEvent.swift | 4 +- Sources/DOMKit/WebIDL/NavigateEventInit.swift | 16 +- Sources/DOMKit/WebIDL/Navigation.swift | 12 +- .../NavigationCurrentEntryChangeEvent.swift | 2 +- ...avigationCurrentEntryChangeEventInit.swift | 4 +- Sources/DOMKit/WebIDL/NavigationEvent.swift | 2 +- .../DOMKit/WebIDL/NavigationEventInit.swift | 4 +- .../WebIDL/NavigationNavigateOptions.swift | 4 +- .../WebIDL/NavigationNavigationType.swift | 2 +- Sources/DOMKit/WebIDL/NavigationOptions.swift | 2 +- .../WebIDL/NavigationPreloadManager.swift | 12 +- .../WebIDL/NavigationPreloadState.swift | 4 +- .../WebIDL/NavigationReloadOptions.swift | 2 +- Sources/DOMKit/WebIDL/NavigationResult.swift | 4 +- .../DOMKit/WebIDL/NavigationTimingType.swift | 2 +- .../DOMKit/WebIDL/NavigationTransition.swift | 2 +- .../NavigationUpdateCurrentEntryOptions.swift | 2 +- Sources/DOMKit/WebIDL/Navigator.swift | 42 +- Sources/DOMKit/WebIDL/NavigatorBadge.swift | 8 +- .../DOMKit/WebIDL/NavigatorContentUtils.swift | 4 +- .../WebIDL/NavigatorUABrandVersion.swift | 4 +- Sources/DOMKit/WebIDL/NavigatorUAData.swift | 6 +- Sources/DOMKit/WebIDL/Node.swift | 26 +- Sources/DOMKit/WebIDL/Node_or_String.swift | 6 +- .../DOMKit/WebIDL/NonElementParentNode.swift | 2 +- Sources/DOMKit/WebIDL/Notification.swift | 2 +- .../DOMKit/WebIDL/NotificationAction.swift | 6 +- .../DOMKit/WebIDL/NotificationDirection.swift | 2 +- .../DOMKit/WebIDL/NotificationEventInit.swift | 4 +- .../DOMKit/WebIDL/NotificationOptions.swift | 28 +- .../WebIDL/NotificationPermission.swift | 2 +- .../WebIDL/OES_draw_buffers_indexed.swift | 14 +- .../WebIDL/OES_vertex_array_object.swift | 6 +- .../WebIDL/OTPCredentialRequestOptions.swift | 2 +- .../WebIDL/OTPCredentialTransportType.swift | 2 +- Sources/DOMKit/WebIDL/OVR_multiview2.swift | 12 +- .../WebIDL/OfflineAudioCompletionEvent.swift | 2 +- .../OfflineAudioCompletionEventInit.swift | 2 +- .../DOMKit/WebIDL/OfflineAudioContext.swift | 14 +- .../WebIDL/OfflineAudioContextOptions.swift | 6 +- Sources/DOMKit/WebIDL/OffscreenCanvas.swift | 10 +- .../WebIDL/OffscreenRenderingContext.swift | 12 +- .../WebIDL/OffscreenRenderingContextId.swift | 2 +- .../DOMKit/WebIDL/OpenFilePickerOptions.swift | 2 +- .../DOMKit/WebIDL/OptionalEffectTiming.swift | 18 +- .../DOMKit/WebIDL/OrientationLockType.swift | 2 +- Sources/DOMKit/WebIDL/OrientationSensor.swift | 2 +- ...ientationSensorLocalCoordinateSystem.swift | 2 +- .../WebIDL/OrientationSensorOptions.swift | 2 +- Sources/DOMKit/WebIDL/OrientationType.swift | 2 +- Sources/DOMKit/WebIDL/OscillatorNode.swift | 4 +- Sources/DOMKit/WebIDL/OscillatorOptions.swift | 8 +- Sources/DOMKit/WebIDL/OscillatorType.swift | 2 +- Sources/DOMKit/WebIDL/OverSampleType.swift | 2 +- .../DOMKit/WebIDL/OverconstrainedError.swift | 2 +- .../DOMKit/WebIDL/PageTransitionEvent.swift | 2 +- .../WebIDL/PageTransitionEventInit.swift | 2 +- .../PaintRenderingContext2DSettings.swift | 2 +- Sources/DOMKit/WebIDL/PannerNode.swift | 6 +- Sources/DOMKit/WebIDL/PannerOptions.swift | 28 +- Sources/DOMKit/WebIDL/PanningModelType.swift | 2 +- Sources/DOMKit/WebIDL/ParentNode.swift | 10 +- Sources/DOMKit/WebIDL/ParityType.swift | 2 +- .../DOMKit/WebIDL/PasswordCredential.swift | 4 +- .../WebIDL/PasswordCredentialData.swift | 8 +- .../WebIDL/PasswordCredentialInit.swift | 6 +- Sources/DOMKit/WebIDL/Path2D.swift | 4 +- Sources/DOMKit/WebIDL/Path2D_or_String.swift | 6 +- Sources/DOMKit/WebIDL/PaymentComplete.swift | 2 +- .../WebIDL/PaymentCredentialInstrument.swift | 6 +- .../DOMKit/WebIDL/PaymentCurrencyAmount.swift | 4 +- .../DOMKit/WebIDL/PaymentDetailsBase.swift | 4 +- .../DOMKit/WebIDL/PaymentDetailsInit.swift | 4 +- .../WebIDL/PaymentDetailsModifier.swift | 8 +- .../DOMKit/WebIDL/PaymentDetailsUpdate.swift | 4 +- .../WebIDL/PaymentHandlerResponse.swift | 4 +- Sources/DOMKit/WebIDL/PaymentInstrument.swift | 6 +- .../DOMKit/WebIDL/PaymentInstruments.swift | 28 +- Sources/DOMKit/WebIDL/PaymentItem.swift | 6 +- .../WebIDL/PaymentMethodChangeEvent.swift | 2 +- .../WebIDL/PaymentMethodChangeEventInit.swift | 4 +- Sources/DOMKit/WebIDL/PaymentMethodData.swift | 4 +- Sources/DOMKit/WebIDL/PaymentRequest.swift | 12 +- .../WebIDL/PaymentRequestDetailsUpdate.swift | 8 +- .../WebIDL/PaymentRequestEventInit.swift | 12 +- .../WebIDL/PaymentRequestUpdateEvent.swift | 4 +- Sources/DOMKit/WebIDL/PaymentResponse.swift | 12 +- .../WebIDL/PaymentValidationErrors.swift | 4 +- Sources/DOMKit/WebIDL/Pbkdf2Params.swift | 6 +- Sources/DOMKit/WebIDL/Performance.swift | 16 +- Sources/DOMKit/WebIDL/PerformanceMark.swift | 2 +- .../WebIDL/PerformanceMarkOptions.swift | 4 +- .../WebIDL/PerformanceMeasureOptions.swift | 8 +- .../PerformanceMeasureOptions_or_String.swift | 6 +- .../DOMKit/WebIDL/PerformanceObserver.swift | 2 +- .../PerformanceObserverCallbackOptions.swift | 2 +- .../WebIDL/PerformanceObserverEntryList.swift | 4 +- .../WebIDL/PerformanceObserverInit.swift | 8 +- .../DOMKit/WebIDL/PeriodicSyncEventInit.swift | 2 +- .../DOMKit/WebIDL/PeriodicSyncManager.swift | 14 +- Sources/DOMKit/WebIDL/PeriodicWave.swift | 2 +- .../WebIDL/PeriodicWaveConstraints.swift | 2 +- .../DOMKit/WebIDL/PeriodicWaveOptions.swift | 4 +- .../DOMKit/WebIDL/PermissionDescriptor.swift | 2 +- .../WebIDL/PermissionSetParameters.swift | 6 +- Sources/DOMKit/WebIDL/PermissionState.swift | 2 +- Sources/DOMKit/WebIDL/Permissions.swift | 18 +- Sources/DOMKit/WebIDL/PermissionsPolicy.swift | 4 +- Sources/DOMKit/WebIDL/PhotoCapabilities.swift | 8 +- Sources/DOMKit/WebIDL/PhotoSettings.swift | 8 +- .../DOMKit/WebIDL/PictureInPictureEvent.swift | 2 +- .../WebIDL/PictureInPictureEventInit.swift | 2 +- Sources/DOMKit/WebIDL/PlaneLayout.swift | 4 +- Sources/DOMKit/WebIDL/PlaybackDirection.swift | 2 +- Sources/DOMKit/WebIDL/Point2D.swift | 4 +- Sources/DOMKit/WebIDL/PointerEvent.swift | 2 +- Sources/DOMKit/WebIDL/PointerEventInit.swift | 28 +- Sources/DOMKit/WebIDL/PopStateEvent.swift | 2 +- Sources/DOMKit/WebIDL/PopStateEventInit.swift | 2 +- .../DOMKit/WebIDL/PortalActivateEvent.swift | 2 +- .../WebIDL/PortalActivateEventInit.swift | 2 +- .../DOMKit/WebIDL/PortalActivateOptions.swift | 2 +- Sources/DOMKit/WebIDL/PortalHost.swift | 2 +- .../DOMKit/WebIDL/PositionAlignSetting.swift | 2 +- Sources/DOMKit/WebIDL/PositionOptions.swift | 6 +- .../DOMKit/WebIDL/PredefinedColorSpace.swift | 2 +- Sources/DOMKit/WebIDL/PremultiplyAlpha.swift | 2 +- .../WebIDL/PresentationConnection.swift | 8 +- ...PresentationConnectionAvailableEvent.swift | 2 +- ...entationConnectionAvailableEventInit.swift | 2 +- .../PresentationConnectionCloseEvent.swift | 2 +- ...PresentationConnectionCloseEventInit.swift | 4 +- .../PresentationConnectionCloseReason.swift | 2 +- .../WebIDL/PresentationConnectionState.swift | 2 +- .../DOMKit/WebIDL/PresentationRequest.swift | 14 +- Sources/DOMKit/WebIDL/PresentationStyle.swift | 2 +- Sources/DOMKit/WebIDL/Profiler.swift | 4 +- Sources/DOMKit/WebIDL/ProfilerFrame.swift | 8 +- .../DOMKit/WebIDL/ProfilerInitOptions.swift | 4 +- Sources/DOMKit/WebIDL/ProfilerSample.swift | 4 +- Sources/DOMKit/WebIDL/ProfilerStack.swift | 4 +- Sources/DOMKit/WebIDL/ProfilerTrace.swift | 8 +- Sources/DOMKit/WebIDL/ProgressEvent.swift | 2 +- Sources/DOMKit/WebIDL/ProgressEventInit.swift | 6 +- .../DOMKit/WebIDL/PromiseRejectionEvent.swift | 2 +- .../WebIDL/PromiseRejectionEventInit.swift | 4 +- .../DOMKit/WebIDL/PromptResponseObject.swift | 2 +- .../DOMKit/WebIDL/PropertyDefinition.swift | 8 +- .../WebIDL/ProximityReadingValues.swift | 6 +- Sources/DOMKit/WebIDL/ProximitySensor.swift | 2 +- .../DOMKit/WebIDL/PublicKeyCredential.swift | 2 +- .../PublicKeyCredentialCreationOptions.swift | 18 +- .../PublicKeyCredentialDescriptor.swift | 6 +- .../WebIDL/PublicKeyCredentialEntity.swift | 2 +- .../PublicKeyCredentialParameters.swift | 4 +- .../PublicKeyCredentialRequestOptions.swift | 12 +- .../WebIDL/PublicKeyCredentialRpEntity.swift | 2 +- .../WebIDL/PublicKeyCredentialType.swift | 2 +- .../PublicKeyCredentialUserEntity.swift | 4 +- Sources/DOMKit/WebIDL/PurchaseDetails.swift | 4 +- .../DOMKit/WebIDL/PushEncryptionKeyName.swift | 2 +- Sources/DOMKit/WebIDL/PushEventInit.swift | 2 +- Sources/DOMKit/WebIDL/PushManager.swift | 14 +- .../DOMKit/WebIDL/PushMessageDataInit.swift | 6 +- .../WebIDL/PushPermissionDescriptor.swift | 2 +- Sources/DOMKit/WebIDL/PushSubscription.swift | 4 +- .../PushSubscriptionChangeEventInit.swift | 4 +- .../DOMKit/WebIDL/PushSubscriptionJSON.swift | 6 +- .../WebIDL/PushSubscriptionOptionsInit.swift | 4 +- Sources/DOMKit/WebIDL/QueryOptions.swift | 2 +- Sources/DOMKit/WebIDL/QueuingStrategy.swift | 2 +- .../DOMKit/WebIDL/QueuingStrategyInit.swift | 2 +- .../DOMKit/WebIDL/RTCAudioSenderStats.swift | 2 +- .../DOMKit/WebIDL/RTCAudioSourceStats.swift | 10 +- Sources/DOMKit/WebIDL/RTCBundlePolicy.swift | 2 +- .../WebIDL/RTCCertificateExpiration.swift | 2 +- .../DOMKit/WebIDL/RTCCertificateStats.swift | 8 +- Sources/DOMKit/WebIDL/RTCCodecStats.swift | 14 +- Sources/DOMKit/WebIDL/RTCCodecType.swift | 2 +- Sources/DOMKit/WebIDL/RTCConfiguration.swift | 14 +- Sources/DOMKit/WebIDL/RTCDTMFSender.swift | 2 +- .../WebIDL/RTCDTMFToneChangeEvent.swift | 2 +- .../WebIDL/RTCDTMFToneChangeEventInit.swift | 2 +- Sources/DOMKit/WebIDL/RTCDataChannel.swift | 8 +- .../DOMKit/WebIDL/RTCDataChannelEvent.swift | 2 +- .../WebIDL/RTCDataChannelEventInit.swift | 2 +- .../DOMKit/WebIDL/RTCDataChannelInit.swift | 14 +- .../DOMKit/WebIDL/RTCDataChannelState.swift | 2 +- .../DOMKit/WebIDL/RTCDataChannelStats.swift | 16 +- .../WebIDL/RTCDegradationPreference.swift | 2 +- .../DOMKit/WebIDL/RTCDtlsFingerprint.swift | 4 +- .../DOMKit/WebIDL/RTCDtlsTransportState.swift | 2 +- .../WebIDL/RTCEncodedAudioFrameMetadata.swift | 6 +- .../WebIDL/RTCEncodedVideoFrameMetadata.swift | 18 +- .../WebIDL/RTCEncodedVideoFrameType.swift | 2 +- Sources/DOMKit/WebIDL/RTCError.swift | 2 +- .../DOMKit/WebIDL/RTCErrorDetailType.swift | 2 +- .../DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift | 2 +- Sources/DOMKit/WebIDL/RTCErrorEvent.swift | 2 +- Sources/DOMKit/WebIDL/RTCErrorEventInit.swift | 2 +- Sources/DOMKit/WebIDL/RTCErrorInit.swift | 12 +- Sources/DOMKit/WebIDL/RTCIceCandidate.swift | 2 +- .../DOMKit/WebIDL/RTCIceCandidateInit.swift | 8 +- .../DOMKit/WebIDL/RTCIceCandidatePair.swift | 4 +- .../WebIDL/RTCIceCandidatePairStats.swift | 64 +-- .../DOMKit/WebIDL/RTCIceCandidateStats.swift | 16 +- .../DOMKit/WebIDL/RTCIceCandidateType.swift | 2 +- Sources/DOMKit/WebIDL/RTCIceComponent.swift | 2 +- .../DOMKit/WebIDL/RTCIceConnectionState.swift | 2 +- .../DOMKit/WebIDL/RTCIceCredentialType.swift | 2 +- .../DOMKit/WebIDL/RTCIceGatherOptions.swift | 4 +- .../DOMKit/WebIDL/RTCIceGathererState.swift | 2 +- .../DOMKit/WebIDL/RTCIceGatheringState.swift | 2 +- Sources/DOMKit/WebIDL/RTCIceParameters.swift | 6 +- Sources/DOMKit/WebIDL/RTCIceProtocol.swift | 2 +- Sources/DOMKit/WebIDL/RTCIceRole.swift | 2 +- Sources/DOMKit/WebIDL/RTCIceServer.swift | 8 +- Sources/DOMKit/WebIDL/RTCIceServerStats.swift | 12 +- .../WebIDL/RTCIceTcpCandidateType.swift | 2 +- Sources/DOMKit/WebIDL/RTCIceTransport.swift | 6 +- .../DOMKit/WebIDL/RTCIceTransportPolicy.swift | 2 +- .../DOMKit/WebIDL/RTCIceTransportState.swift | 2 +- .../DOMKit/WebIDL/RTCIdentityAssertion.swift | 2 +- .../WebIDL/RTCIdentityAssertionResult.swift | 4 +- .../WebIDL/RTCIdentityProviderDetails.swift | 4 +- .../WebIDL/RTCIdentityProviderOptions.swift | 6 +- .../WebIDL/RTCIdentityValidationResult.swift | 4 +- .../WebIDL/RTCInboundRtpStreamStats.swift | 88 ++-- .../DOMKit/WebIDL/RTCInsertableStreams.swift | 4 +- .../RTCLocalSessionDescriptionInit.swift | 4 +- .../DOMKit/WebIDL/RTCMediaHandlerStats.swift | 6 +- .../DOMKit/WebIDL/RTCMediaSourceStats.swift | 6 +- Sources/DOMKit/WebIDL/RTCOfferOptions.swift | 6 +- .../WebIDL/RTCOutboundRtpStreamStats.swift | 80 ++-- Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 28 +- .../RTCPeerConnectionIceErrorEvent.swift | 2 +- .../RTCPeerConnectionIceErrorEventInit.swift | 10 +- .../WebIDL/RTCPeerConnectionIceEvent.swift | 2 +- .../RTCPeerConnectionIceEventInit.swift | 4 +- .../WebIDL/RTCPeerConnectionState.swift | 2 +- .../WebIDL/RTCPeerConnectionStats.swift | 8 +- Sources/DOMKit/WebIDL/RTCPriorityType.swift | 2 +- .../WebIDL/RTCQualityLimitationReason.swift | 2 +- .../WebIDL/RTCReceivedRtpStreamStats.swift | 32 +- .../RTCRemoteInboundRtpStreamStats.swift | 12 +- .../RTCRemoteOutboundRtpStreamStats.swift | 12 +- Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift | 2 +- Sources/DOMKit/WebIDL/RTCRtcpParameters.swift | 4 +- .../DOMKit/WebIDL/RTCRtpCapabilities.swift | 4 +- .../DOMKit/WebIDL/RTCRtpCodecCapability.swift | 10 +- .../DOMKit/WebIDL/RTCRtpCodecParameters.swift | 10 +- .../WebIDL/RTCRtpCodingParameters.swift | 2 +- .../WebIDL/RTCRtpContributingSource.swift | 8 +- .../RTCRtpContributingSourceStats.swift | 8 +- .../WebIDL/RTCRtpEncodingParameters.swift | 12 +- .../RTCRtpHeaderExtensionCapability.swift | 2 +- .../RTCRtpHeaderExtensionParameters.swift | 6 +- Sources/DOMKit/WebIDL/RTCRtpParameters.swift | 6 +- Sources/DOMKit/WebIDL/RTCRtpReceiver.swift | 4 +- .../DOMKit/WebIDL/RTCRtpScriptTransform.swift | 2 +- .../DOMKit/WebIDL/RTCRtpSendParameters.swift | 6 +- Sources/DOMKit/WebIDL/RTCRtpSender.swift | 24 +- Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift | 8 +- Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift | 2 +- .../WebIDL/RTCRtpTransceiverDirection.swift | 2 +- .../DOMKit/WebIDL/RTCRtpTransceiverInit.swift | 6 +- .../WebIDL/RTCRtpTransceiverStats.swift | 6 +- Sources/DOMKit/WebIDL/RTCRtpTransform.swift | 6 +- .../DOMKit/WebIDL/RTCSctpTransportState.swift | 2 +- .../DOMKit/WebIDL/RTCSctpTransportStats.swift | 12 +- Sources/DOMKit/WebIDL/RTCSdpType.swift | 2 +- .../DOMKit/WebIDL/RTCSentRtpStreamStats.swift | 4 +- .../DOMKit/WebIDL/RTCSessionDescription.swift | 2 +- .../WebIDL/RTCSessionDescriptionInit.swift | 4 +- Sources/DOMKit/WebIDL/RTCSignalingState.swift | 2 +- Sources/DOMKit/WebIDL/RTCStats.swift | 6 +- .../RTCStatsIceCandidatePairState.swift | 2 +- Sources/DOMKit/WebIDL/RTCStatsType.swift | 2 +- Sources/DOMKit/WebIDL/RTCTrackEvent.swift | 2 +- Sources/DOMKit/WebIDL/RTCTrackEventInit.swift | 8 +- Sources/DOMKit/WebIDL/RTCTransportStats.swift | 34 +- .../DOMKit/WebIDL/RTCVideoSenderStats.swift | 2 +- .../DOMKit/WebIDL/RTCVideoSourceStats.swift | 10 +- Sources/DOMKit/WebIDL/Range.swift | 32 +- Sources/DOMKit/WebIDL/ReadOptions.swift | 2 +- .../WebIDL/ReadableByteStreamController.swift | 4 +- Sources/DOMKit/WebIDL/ReadableStream.swift | 18 +- .../WebIDL/ReadableStreamBYOBReadResult.swift | 4 +- .../WebIDL/ReadableStreamBYOBReader.swift | 8 +- .../WebIDL/ReadableStreamBYOBRequest.swift | 4 +- .../WebIDL/ReadableStreamController.swift | 6 +- .../ReadableStreamDefaultController.swift | 4 +- .../ReadableStreamDefaultReadResult.swift | 4 +- .../WebIDL/ReadableStreamDefaultReader.swift | 4 +- .../WebIDL/ReadableStreamGenericReader.swift | 6 +- .../ReadableStreamGetReaderOptions.swift | 2 +- .../ReadableStreamIteratorOptions.swift | 2 +- .../DOMKit/WebIDL/ReadableStreamReader.swift | 6 +- .../WebIDL/ReadableStreamReaderMode.swift | 2 +- .../DOMKit/WebIDL/ReadableStreamType.swift | 2 +- .../DOMKit/WebIDL/ReadableWritablePair.swift | 4 +- Sources/DOMKit/WebIDL/ReadyState.swift | 2 +- Sources/DOMKit/WebIDL/RecordingState.swift | 2 +- Sources/DOMKit/WebIDL/RedEyeReduction.swift | 2 +- Sources/DOMKit/WebIDL/ReferrerPolicy.swift | 2 +- .../DOMKit/WebIDL/RegistrationOptions.swift | 6 +- .../DOMKit/WebIDL/RelatedApplication.swift | 8 +- .../WebIDL/RelativeOrientationSensor.swift | 2 +- Sources/DOMKit/WebIDL/RemotePlayback.swift | 8 +- .../DOMKit/WebIDL/RemotePlaybackState.swift | 2 +- Sources/DOMKit/WebIDL/RenderingContext.swift | 12 +- .../WebIDL/ReportingObserverOptions.swift | 4 +- Sources/DOMKit/WebIDL/Request.swift | 2 +- Sources/DOMKit/WebIDL/RequestCache.swift | 2 +- .../DOMKit/WebIDL/RequestCredentials.swift | 2 +- .../DOMKit/WebIDL/RequestDestination.swift | 2 +- .../DOMKit/WebIDL/RequestDeviceOptions.swift | 8 +- Sources/DOMKit/WebIDL/RequestInfo.swift | 6 +- .../RequestInfo_or_seq_of_RequestInfo.swift | 6 +- Sources/DOMKit/WebIDL/RequestInit.swift | 28 +- Sources/DOMKit/WebIDL/RequestMode.swift | 2 +- Sources/DOMKit/WebIDL/RequestRedirect.swift | 2 +- .../WebIDL/ResidentKeyRequirement.swift | 2 +- Sources/DOMKit/WebIDL/ResizeObserver.swift | 4 +- .../WebIDL/ResizeObserverBoxOptions.swift | 2 +- .../DOMKit/WebIDL/ResizeObserverOptions.swift | 2 +- Sources/DOMKit/WebIDL/ResizeQuality.swift | 2 +- Sources/DOMKit/WebIDL/Response.swift | 4 +- Sources/DOMKit/WebIDL/ResponseInit.swift | 6 +- Sources/DOMKit/WebIDL/ResponseType.swift | 2 +- .../DOMKit/WebIDL/RsaHashedImportParams.swift | 2 +- .../DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift | 2 +- .../DOMKit/WebIDL/RsaHashedKeyGenParams.swift | 2 +- Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift | 4 +- Sources/DOMKit/WebIDL/RsaKeyGenParams.swift | 4 +- Sources/DOMKit/WebIDL/RsaOaepParams.swift | 2 +- .../DOMKit/WebIDL/RsaOtherPrimesInfo.swift | 6 +- Sources/DOMKit/WebIDL/RsaPssParams.swift | 2 +- Sources/DOMKit/WebIDL/SFrameTransform.swift | 8 +- .../WebIDL/SFrameTransformErrorEvent.swift | 2 +- .../SFrameTransformErrorEventInit.swift | 6 +- .../SFrameTransformErrorEventType.swift | 2 +- .../WebIDL/SFrameTransformOptions.swift | 2 +- .../DOMKit/WebIDL/SFrameTransformRole.swift | 2 +- Sources/DOMKit/WebIDL/SVGAngle.swift | 4 +- .../DOMKit/WebIDL/SVGAnimationElement.swift | 4 +- .../DOMKit/WebIDL/SVGBoundingBoxOptions.swift | 8 +- .../WebIDL/SVGFEDropShadowElement.swift | 2 +- .../WebIDL/SVGFEGaussianBlurElement.swift | 2 +- .../DOMKit/WebIDL/SVGGeometryElement.swift | 6 +- .../DOMKit/WebIDL/SVGGraphicsElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGLength.swift | 4 +- Sources/DOMKit/WebIDL/SVGLengthList.swift | 10 +- Sources/DOMKit/WebIDL/SVGMarkerElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGNumberList.swift | 10 +- Sources/DOMKit/WebIDL/SVGPointList.swift | 10 +- Sources/DOMKit/WebIDL/SVGSVGElement.swift | 18 +- Sources/DOMKit/WebIDL/SVGStringList.swift | 10 +- .../DOMKit/WebIDL/SVGTextContentElement.swift | 14 +- Sources/DOMKit/WebIDL/SVGTransform.swift | 12 +- Sources/DOMKit/WebIDL/SVGTransformList.swift | 12 +- Sources/DOMKit/WebIDL/Sanitizer.swift | 6 +- Sources/DOMKit/WebIDL/SanitizerConfig.swift | 14 +- .../DOMKit/WebIDL/SaveFilePickerOptions.swift | 2 +- .../WebIDL/SchedulerPostTaskOptions.swift | 6 +- Sources/DOMKit/WebIDL/Scheduling.swift | 2 +- Sources/DOMKit/WebIDL/ScreenIdleState.swift | 2 +- Sources/DOMKit/WebIDL/ScreenOrientation.swift | 6 +- .../WebIDL/ScriptingPolicyViolationType.swift | 2 +- Sources/DOMKit/WebIDL/ScrollBehavior.swift | 2 +- Sources/DOMKit/WebIDL/ScrollDirection.swift | 2 +- .../DOMKit/WebIDL/ScrollIntoViewOptions.swift | 4 +- .../DOMKit/WebIDL/ScrollLogicalPosition.swift | 2 +- Sources/DOMKit/WebIDL/ScrollOptions.swift | 2 +- Sources/DOMKit/WebIDL/ScrollRestoration.swift | 2 +- Sources/DOMKit/WebIDL/ScrollSetting.swift | 2 +- Sources/DOMKit/WebIDL/ScrollTimeline.swift | 2 +- .../WebIDL/ScrollTimelineAutoKeyword.swift | 2 +- .../DOMKit/WebIDL/ScrollTimelineOffset.swift | 6 +- .../DOMKit/WebIDL/ScrollTimelineOptions.swift | 6 +- Sources/DOMKit/WebIDL/ScrollToOptions.swift | 4 +- .../SecurePaymentConfirmationRequest.swift | 14 +- .../WebIDL/SecurityPolicyViolationEvent.swift | 2 +- ...urityPolicyViolationEventDisposition.swift | 2 +- .../SecurityPolicyViolationEventInit.swift | 24 +- Sources/DOMKit/WebIDL/Selection.swift | 18 +- Sources/DOMKit/WebIDL/SelectionMode.swift | 2 +- Sources/DOMKit/WebIDL/SensorErrorEvent.swift | 2 +- .../DOMKit/WebIDL/SensorErrorEventInit.swift | 2 +- Sources/DOMKit/WebIDL/SensorOptions.swift | 2 +- Sources/DOMKit/WebIDL/SequenceEffect.swift | 2 +- Sources/DOMKit/WebIDL/Serial.swift | 8 +- .../DOMKit/WebIDL/SerialInputSignals.swift | 8 +- Sources/DOMKit/WebIDL/SerialOptions.swift | 12 +- .../DOMKit/WebIDL/SerialOutputSignals.swift | 6 +- Sources/DOMKit/WebIDL/SerialPort.swift | 16 +- Sources/DOMKit/WebIDL/SerialPortFilter.swift | 4 +- Sources/DOMKit/WebIDL/SerialPortInfo.swift | 4 +- .../WebIDL/SerialPortRequestOptions.swift | 2 +- Sources/DOMKit/WebIDL/ServiceWorker.swift | 4 +- .../WebIDL/ServiceWorkerContainer.swift | 14 +- .../WebIDL/ServiceWorkerRegistration.swift | 16 +- .../DOMKit/WebIDL/ServiceWorkerState.swift | 2 +- .../WebIDL/ServiceWorkerUpdateViaCache.swift | 2 +- Sources/DOMKit/WebIDL/SetHTMLOptions.swift | 2 +- Sources/DOMKit/WebIDL/ShadowAnimation.swift | 2 +- Sources/DOMKit/WebIDL/ShadowRootInit.swift | 6 +- Sources/DOMKit/WebIDL/ShadowRootMode.swift | 2 +- Sources/DOMKit/WebIDL/ShareData.swift | 8 +- Sources/DOMKit/WebIDL/SharedWorker.swift | 2 +- .../DOMKit/WebIDL/SlotAssignmentMode.swift | 2 +- Sources/DOMKit/WebIDL/SourceBuffer.swift | 6 +- .../WebIDL/SpatialNavigationDirection.swift | 2 +- .../SpatialNavigationSearchOptions.swift | 4 +- Sources/DOMKit/WebIDL/SpeechGrammarList.swift | 4 +- .../WebIDL/SpeechRecognitionErrorCode.swift | 2 +- .../WebIDL/SpeechRecognitionErrorEvent.swift | 2 +- .../SpeechRecognitionErrorEventInit.swift | 4 +- .../WebIDL/SpeechRecognitionEvent.swift | 2 +- .../WebIDL/SpeechRecognitionEventInit.swift | 4 +- Sources/DOMKit/WebIDL/SpeechSynthesis.swift | 2 +- .../WebIDL/SpeechSynthesisErrorCode.swift | 2 +- .../WebIDL/SpeechSynthesisErrorEvent.swift | 2 +- .../SpeechSynthesisErrorEventInit.swift | 2 +- .../DOMKit/WebIDL/SpeechSynthesisEvent.swift | 2 +- .../WebIDL/SpeechSynthesisEventInit.swift | 10 +- .../WebIDL/SpeechSynthesisUtterance.swift | 2 +- Sources/DOMKit/WebIDL/StartInDirectory.swift | 6 +- Sources/DOMKit/WebIDL/StaticRange.swift | 2 +- Sources/DOMKit/WebIDL/StaticRangeInit.swift | 8 +- Sources/DOMKit/WebIDL/StereoPannerNode.swift | 2 +- .../DOMKit/WebIDL/StereoPannerOptions.swift | 2 +- Sources/DOMKit/WebIDL/Storage.swift | 2 +- Sources/DOMKit/WebIDL/StorageEstimate.swift | 4 +- Sources/DOMKit/WebIDL/StorageEvent.swift | 18 +- Sources/DOMKit/WebIDL/StorageEventInit.swift | 10 +- Sources/DOMKit/WebIDL/StorageManager.swift | 8 +- Sources/DOMKit/WebIDL/StreamPipeOptions.swift | 8 +- .../WebIDL/String_or_WorkerOptions.swift | 6 +- ...ng_to_String_or_seq_of_seq_of_String.swift | 8 +- .../WebIDL/String_or_seq_of_Double.swift | 6 +- .../WebIDL/String_or_seq_of_String.swift | 6 +- .../DOMKit/WebIDL/String_or_seq_of_UUID.swift | 6 +- .../WebIDL/StructuredSerializeOptions.swift | 2 +- Sources/DOMKit/WebIDL/StylePropertyMap.swift | 6 +- .../WebIDL/StylePropertyMapReadOnly.swift | 6 +- Sources/DOMKit/WebIDL/SubmitEvent.swift | 2 +- Sources/DOMKit/WebIDL/SubmitEventInit.swift | 2 +- Sources/DOMKit/WebIDL/SubtleCrypto.swift | 96 ++-- Sources/DOMKit/WebIDL/SvcOutputMetadata.swift | 2 +- Sources/DOMKit/WebIDL/SyncEventInit.swift | 4 +- Sources/DOMKit/WebIDL/SyncManager.swift | 8 +- Sources/DOMKit/WebIDL/Table.swift | 8 +- Sources/DOMKit/WebIDL/TableDescriptor.swift | 6 +- Sources/DOMKit/WebIDL/TableKind.swift | 2 +- Sources/DOMKit/WebIDL/TaskController.swift | 4 +- .../DOMKit/WebIDL/TaskControllerInit.swift | 2 +- Sources/DOMKit/WebIDL/TaskPriority.swift | 2 +- .../WebIDL/TaskPriorityChangeEvent.swift | 2 +- .../WebIDL/TaskPriorityChangeEventInit.swift | 2 +- Sources/DOMKit/WebIDL/TestUtils.swift | 2 +- Sources/DOMKit/WebIDL/TexImageSource.swift | 16 +- Sources/DOMKit/WebIDL/Text.swift | 4 +- Sources/DOMKit/WebIDL/TextDecodeOptions.swift | 2 +- Sources/DOMKit/WebIDL/TextDecoder.swift | 4 +- .../DOMKit/WebIDL/TextDecoderOptions.swift | 4 +- Sources/DOMKit/WebIDL/TextDecoderStream.swift | 2 +- Sources/DOMKit/WebIDL/TextDetector.swift | 6 +- Sources/DOMKit/WebIDL/TextEncoder.swift | 4 +- .../WebIDL/TextEncoderEncodeIntoResult.swift | 4 +- Sources/DOMKit/WebIDL/TextFormat.swift | 2 +- Sources/DOMKit/WebIDL/TextFormatInit.swift | 14 +- .../DOMKit/WebIDL/TextFormatUpdateEvent.swift | 2 +- .../WebIDL/TextFormatUpdateEventInit.swift | 2 +- Sources/DOMKit/WebIDL/TextTrack.swift | 4 +- Sources/DOMKit/WebIDL/TextTrackCueList.swift | 2 +- Sources/DOMKit/WebIDL/TextTrackKind.swift | 2 +- Sources/DOMKit/WebIDL/TextTrackList.swift | 2 +- Sources/DOMKit/WebIDL/TextTrackMode.swift | 2 +- Sources/DOMKit/WebIDL/TextUpdateEvent.swift | 2 +- .../DOMKit/WebIDL/TextUpdateEventInit.swift | 14 +- Sources/DOMKit/WebIDL/TimeEvent.swift | 2 +- Sources/DOMKit/WebIDL/TimeRanges.swift | 4 +- Sources/DOMKit/WebIDL/TimelinePhase.swift | 2 +- Sources/DOMKit/WebIDL/TimerHandler.swift | 6 +- Sources/DOMKit/WebIDL/TokenBinding.swift | 4 +- .../DOMKit/WebIDL/TokenBindingStatus.swift | 2 +- Sources/DOMKit/WebIDL/Touch.swift | 2 +- Sources/DOMKit/WebIDL/TouchEvent.swift | 2 +- Sources/DOMKit/WebIDL/TouchEventInit.swift | 6 +- Sources/DOMKit/WebIDL/TouchInit.swift | 30 +- Sources/DOMKit/WebIDL/TouchType.swift | 2 +- Sources/DOMKit/WebIDL/TrackEvent.swift | 2 +- Sources/DOMKit/WebIDL/TrackEventInit.swift | 2 +- .../WebIDL/TransactionAutomationMode.swift | 2 +- Sources/DOMKit/WebIDL/TransferFunction.swift | 2 +- Sources/DOMKit/WebIDL/TransformStream.swift | 2 +- .../TransformStreamDefaultController.swift | 4 +- Sources/DOMKit/WebIDL/Transformer.swift | 4 +- Sources/DOMKit/WebIDL/TransitionEvent.swift | 2 +- .../DOMKit/WebIDL/TransitionEventInit.swift | 6 +- Sources/DOMKit/WebIDL/TrustedHTML.swift | 2 +- Sources/DOMKit/WebIDL/TrustedScript.swift | 2 +- Sources/DOMKit/WebIDL/TrustedScriptURL.swift | 2 +- Sources/DOMKit/WebIDL/TrustedType.swift | 8 +- Sources/DOMKit/WebIDL/TrustedTypePolicy.swift | 6 +- .../WebIDL/TrustedTypePolicyFactory.swift | 10 +- Sources/DOMKit/WebIDL/UADataValues.swift | 20 +- Sources/DOMKit/WebIDL/UALowEntropyJSON.swift | 6 +- Sources/DOMKit/WebIDL/UIEvent.swift | 4 +- Sources/DOMKit/WebIDL/UIEventInit.swift | 8 +- Sources/DOMKit/WebIDL/ULongRange.swift | 4 +- Sources/DOMKit/WebIDL/URL.swift | 6 +- Sources/DOMKit/WebIDL/URLPattern.swift | 6 +- .../WebIDL/URLPatternComponentResult.swift | 4 +- Sources/DOMKit/WebIDL/URLPatternInit.swift | 18 +- Sources/DOMKit/WebIDL/URLPatternInput.swift | 6 +- Sources/DOMKit/WebIDL/URLPatternResult.swift | 18 +- Sources/DOMKit/WebIDL/URLSearchParams.swift | 14 +- Sources/DOMKit/WebIDL/USB.swift | 8 +- .../DOMKit/WebIDL/USBAlternateInterface.swift | 2 +- Sources/DOMKit/WebIDL/USBConfiguration.swift | 2 +- .../DOMKit/WebIDL/USBConnectionEvent.swift | 2 +- .../WebIDL/USBConnectionEventInit.swift | 2 +- .../WebIDL/USBControlTransferParameters.swift | 10 +- Sources/DOMKit/WebIDL/USBDevice.swift | 74 +-- Sources/DOMKit/WebIDL/USBDeviceFilter.swift | 12 +- .../WebIDL/USBDeviceRequestOptions.swift | 2 +- Sources/DOMKit/WebIDL/USBDirection.swift | 2 +- Sources/DOMKit/WebIDL/USBEndpoint.swift | 2 +- Sources/DOMKit/WebIDL/USBEndpointType.swift | 2 +- .../DOMKit/WebIDL/USBInTransferResult.swift | 2 +- Sources/DOMKit/WebIDL/USBInterface.swift | 2 +- .../USBIsochronousInTransferPacket.swift | 2 +- .../USBIsochronousInTransferResult.swift | 2 +- .../USBIsochronousOutTransferPacket.swift | 2 +- .../USBIsochronousOutTransferResult.swift | 2 +- .../DOMKit/WebIDL/USBOutTransferResult.swift | 2 +- .../WebIDL/USBPermissionDescriptor.swift | 2 +- .../DOMKit/WebIDL/USBPermissionStorage.swift | 2 +- Sources/DOMKit/WebIDL/USBRecipient.swift | 2 +- Sources/DOMKit/WebIDL/USBRequestType.swift | 2 +- Sources/DOMKit/WebIDL/USBTransferStatus.swift | 2 +- Sources/DOMKit/WebIDL/Uint32List.swift | 6 +- .../WebIDL/UncalibratedMagnetometer.swift | 2 +- ...ncalibratedMagnetometerReadingValues.swift | 12 +- Sources/DOMKit/WebIDL/UnderlyingSink.swift | 2 +- Sources/DOMKit/WebIDL/UnderlyingSource.swift | 4 +- Sources/DOMKit/WebIDL/UserIdleState.swift | 2 +- .../WebIDL/UserVerificationRequirement.swift | 2 +- Sources/DOMKit/WebIDL/VTTCue.swift | 2 +- .../DOMKit/WebIDL/ValidityStateFlags.swift | 20 +- Sources/DOMKit/WebIDL/ValueEvent.swift | 2 +- Sources/DOMKit/WebIDL/ValueEventInit.swift | 2 +- Sources/DOMKit/WebIDL/ValueType.swift | 2 +- Sources/DOMKit/WebIDL/VibratePattern.swift | 6 +- .../DOMKit/WebIDL/VideoColorPrimaries.swift | 2 +- Sources/DOMKit/WebIDL/VideoColorSpace.swift | 2 +- .../DOMKit/WebIDL/VideoColorSpaceInit.swift | 8 +- .../DOMKit/WebIDL/VideoConfiguration.swift | 20 +- Sources/DOMKit/WebIDL/VideoDecoder.swift | 14 +- .../DOMKit/WebIDL/VideoDecoderConfig.swift | 18 +- .../DOMKit/WebIDL/VideoDecoderSupport.swift | 4 +- Sources/DOMKit/WebIDL/VideoEncoder.swift | 14 +- .../DOMKit/WebIDL/VideoEncoderConfig.swift | 24 +- .../WebIDL/VideoEncoderEncodeOptions.swift | 2 +- .../DOMKit/WebIDL/VideoEncoderSupport.swift | 4 +- .../DOMKit/WebIDL/VideoFacingModeEnum.swift | 2 +- Sources/DOMKit/WebIDL/VideoFrame.swift | 12 +- .../DOMKit/WebIDL/VideoFrameBufferInit.swift | 20 +- .../WebIDL/VideoFrameCopyToOptions.swift | 4 +- Sources/DOMKit/WebIDL/VideoFrameInit.swift | 12 +- .../DOMKit/WebIDL/VideoFrameMetadata.swift | 20 +- .../WebIDL/VideoMatrixCoefficients.swift | 2 +- Sources/DOMKit/WebIDL/VideoPixelFormat.swift | 2 +- .../DOMKit/WebIDL/VideoResizeModeEnum.swift | 2 +- Sources/DOMKit/WebIDL/VideoTrackList.swift | 2 +- .../WebIDL/VideoTransferCharacteristics.swift | 2 +- .../DOMKit/WebIDL/WEBGL_debug_shaders.swift | 2 +- .../DOMKit/WebIDL/WEBGL_draw_buffers.swift | 2 +- ..._instanced_base_vertex_base_instance.swift | 16 +- Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift | 60 +-- ..._instanced_base_vertex_base_instance.swift | 46 +- Sources/DOMKit/WebIDL/WakeLock.swift | 6 +- Sources/DOMKit/WebIDL/WakeLockSentinel.swift | 2 +- Sources/DOMKit/WebIDL/WakeLockType.swift | 2 +- .../WebIDL/WatchAdvertisementsOptions.swift | 2 +- Sources/DOMKit/WebIDL/WaveShaperNode.swift | 2 +- Sources/DOMKit/WebIDL/WaveShaperOptions.swift | 4 +- Sources/DOMKit/WebIDL/WebAssembly.swift | 32 +- .../WebAssemblyInstantiatedSource.swift | 4 +- .../WebIDL/WebGL2RenderingContextBase.swift | 452 +++++++++--------- .../WebGL2RenderingContextOverloads.swift | 322 ++++++------- .../WebIDL/WebGLContextAttributes.swift | 20 +- Sources/DOMKit/WebIDL/WebGLContextEvent.swift | 2 +- .../DOMKit/WebIDL/WebGLContextEventInit.swift | 2 +- .../DOMKit/WebIDL/WebGLPowerPreference.swift | 2 +- .../WebIDL/WebGLRenderingContextBase.swift | 254 +++++----- .../WebGLRenderingContextOverloads.swift | 134 +++--- Sources/DOMKit/WebIDL/WebSocket.swift | 6 +- Sources/DOMKit/WebIDL/WebTransport.swift | 10 +- .../DOMKit/WebIDL/WebTransportCloseInfo.swift | 4 +- Sources/DOMKit/WebIDL/WebTransportError.swift | 2 +- .../DOMKit/WebIDL/WebTransportErrorInit.swift | 4 +- .../WebIDL/WebTransportErrorSource.swift | 2 +- Sources/DOMKit/WebIDL/WebTransportHash.swift | 4 +- .../DOMKit/WebIDL/WebTransportOptions.swift | 4 +- Sources/DOMKit/WebIDL/WebTransportStats.swift | 24 +- .../DOMKit/WebIDL/WellKnownDirectory.swift | 2 +- Sources/DOMKit/WebIDL/WheelEvent.swift | 2 +- Sources/DOMKit/WebIDL/WheelEventInit.swift | 8 +- Sources/DOMKit/WebIDL/Window.swift | 64 +-- ...owControlsOverlayGeometryChangeEvent.swift | 2 +- ...ntrolsOverlayGeometryChangeEventInit.swift | 4 +- .../WebIDL/WindowOrWorkerGlobalScope.swift | 54 +-- .../WebIDL/WindowPostMessageOptions.swift | 2 +- Sources/DOMKit/WebIDL/Worker.swift | 6 +- Sources/DOMKit/WebIDL/WorkerOptions.swift | 6 +- Sources/DOMKit/WebIDL/WorkerType.swift | 2 +- Sources/DOMKit/WebIDL/Worklet.swift | 6 +- Sources/DOMKit/WebIDL/WorkletAnimation.swift | 2 +- Sources/DOMKit/WebIDL/WorkletOptions.swift | 2 +- Sources/DOMKit/WebIDL/WritableStream.swift | 10 +- .../WritableStreamDefaultController.swift | 2 +- .../WebIDL/WritableStreamDefaultWriter.swift | 16 +- Sources/DOMKit/WebIDL/WriteCommandType.swift | 2 +- Sources/DOMKit/WebIDL/WriteParams.swift | 8 +- Sources/DOMKit/WebIDL/XMLHttpRequest.swift | 12 +- .../WebIDL/XMLHttpRequestBodyInit.swift | 12 +- .../WebIDL/XMLHttpRequestResponseType.swift | 2 +- Sources/DOMKit/WebIDL/XMLSerializer.swift | 2 +- Sources/DOMKit/WebIDL/XPathExpression.swift | 2 +- Sources/DOMKit/WebIDL/XPathResult.swift | 2 +- .../DOMKit/WebIDL/XRCPUDepthInformation.swift | 2 +- Sources/DOMKit/WebIDL/XRCubeLayerInit.swift | 2 +- .../DOMKit/WebIDL/XRCylinderLayerInit.swift | 10 +- Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift | 2 +- Sources/DOMKit/WebIDL/XRDOMOverlayState.swift | 2 +- Sources/DOMKit/WebIDL/XRDOMOverlayType.swift | 2 +- Sources/DOMKit/WebIDL/XRDepthDataFormat.swift | 2 +- Sources/DOMKit/WebIDL/XRDepthStateInit.swift | 4 +- Sources/DOMKit/WebIDL/XRDepthUsage.swift | 2 +- .../WebIDL/XREnvironmentBlendMode.swift | 2 +- .../DOMKit/WebIDL/XREquirectLayerInit.swift | 12 +- Sources/DOMKit/WebIDL/XREye.swift | 2 +- Sources/DOMKit/WebIDL/XRFrame.swift | 24 +- Sources/DOMKit/WebIDL/XRHand.swift | 2 +- Sources/DOMKit/WebIDL/XRHandJoint.swift | 2 +- Sources/DOMKit/WebIDL/XRHandedness.swift | 2 +- .../DOMKit/WebIDL/XRHitTestOptionsInit.swift | 6 +- Sources/DOMKit/WebIDL/XRHitTestResult.swift | 4 +- .../WebIDL/XRHitTestTrackableType.swift | 2 +- .../DOMKit/WebIDL/XRInputSourceEvent.swift | 2 +- .../WebIDL/XRInputSourceEventInit.swift | 4 +- .../WebIDL/XRInputSourcesChangeEvent.swift | 2 +- .../XRInputSourcesChangeEventInit.swift | 6 +- Sources/DOMKit/WebIDL/XRInteractionMode.swift | 2 +- Sources/DOMKit/WebIDL/XRLayerEvent.swift | 2 +- Sources/DOMKit/WebIDL/XRLayerEventInit.swift | 2 +- Sources/DOMKit/WebIDL/XRLayerInit.swift | 16 +- Sources/DOMKit/WebIDL/XRLayerLayout.swift | 2 +- Sources/DOMKit/WebIDL/XRLightProbeInit.swift | 2 +- Sources/DOMKit/WebIDL/XRMediaBinding.swift | 8 +- .../WebIDL/XRMediaCylinderLayerInit.swift | 8 +- .../WebIDL/XRMediaEquirectLayerInit.swift | 10 +- Sources/DOMKit/WebIDL/XRMediaLayerInit.swift | 6 +- .../DOMKit/WebIDL/XRMediaQuadLayerInit.swift | 6 +- .../WebIDL/XRPermissionDescriptor.swift | 6 +- .../DOMKit/WebIDL/XRProjectionLayerInit.swift | 8 +- Sources/DOMKit/WebIDL/XRQuadLayerInit.swift | 8 +- Sources/DOMKit/WebIDL/XRRay.swift | 4 +- .../DOMKit/WebIDL/XRRayDirectionInit.swift | 8 +- Sources/DOMKit/WebIDL/XRReferenceSpace.swift | 2 +- .../DOMKit/WebIDL/XRReferenceSpaceEvent.swift | 2 +- .../WebIDL/XRReferenceSpaceEventInit.swift | 4 +- .../DOMKit/WebIDL/XRReferenceSpaceType.swift | 2 +- .../DOMKit/WebIDL/XRReflectionFormat.swift | 2 +- Sources/DOMKit/WebIDL/XRRenderStateInit.swift | 10 +- Sources/DOMKit/WebIDL/XRRigidTransform.swift | 2 +- Sources/DOMKit/WebIDL/XRSession.swift | 36 +- Sources/DOMKit/WebIDL/XRSessionEvent.swift | 2 +- .../DOMKit/WebIDL/XRSessionEventInit.swift | 2 +- Sources/DOMKit/WebIDL/XRSessionInit.swift | 8 +- Sources/DOMKit/WebIDL/XRSessionMode.swift | 2 +- ...SessionSupportedPermissionDescriptor.swift | 2 +- Sources/DOMKit/WebIDL/XRSystem.swift | 12 +- Sources/DOMKit/WebIDL/XRTargetRayMode.swift | 2 +- Sources/DOMKit/WebIDL/XRTextureType.swift | 2 +- .../XRTransientInputHitTestOptionsInit.swift | 6 +- Sources/DOMKit/WebIDL/XRView.swift | 2 +- Sources/DOMKit/WebIDL/XRVisibilityState.swift | 2 +- Sources/DOMKit/WebIDL/XRWebGLBinding.swift | 20 +- Sources/DOMKit/WebIDL/XRWebGLLayer.swift | 6 +- Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift | 12 +- .../WebIDL/XRWebGLRenderingContext.swift | 6 +- Sources/DOMKit/WebIDL/XSLTProcessor.swift | 12 +- Sources/DOMKit/WebIDL/console.swift | 34 +- ...ble_Double_or_seq_of_nullable_Double.swift | 6 +- Sources/WebIDLToSwift/ClosurePattern.swift | 6 +- .../UnionType+SwiftRepresentable.swift | 4 +- .../WebIDL+SwiftRepresentation.swift | 22 +- 1652 files changed, 5945 insertions(+), 5965 deletions(-) diff --git a/Sources/DOMKit/ECMAScript/ArrayBufferView.swift b/Sources/DOMKit/ECMAScript/ArrayBufferView.swift index be55cc40..ffa932d8 100644 --- a/Sources/DOMKit/ECMAScript/ArrayBufferView.swift +++ b/Sources/DOMKit/ECMAScript/ArrayBufferView.swift @@ -62,32 +62,32 @@ public enum ArrayBufferView: JSValueCompatible, AnyArrayBufferView { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { // case let .bigInt64Array(bigInt64Array): -// return bigInt64Array.jsValue() +// return bigInt64Array.jsValue // case let .bigUint64Array(bigUint64Array): -// return bigUint64Array.jsValue() +// return bigUint64Array.jsValue case let .dataView(dataView): - return dataView.jsValue() + return dataView.jsValue case let .float32Array(float32Array): - return float32Array.jsValue() + return float32Array.jsValue case let .float64Array(float64Array): - return float64Array.jsValue() + return float64Array.jsValue case let .int16Array(int16Array): - return int16Array.jsValue() + return int16Array.jsValue case let .int32Array(int32Array): - return int32Array.jsValue() + return int32Array.jsValue case let .int8Array(int8Array): - return int8Array.jsValue() + return int8Array.jsValue case let .uint16Array(uint16Array): - return uint16Array.jsValue() + return uint16Array.jsValue case let .uint32Array(uint32Array): - return uint32Array.jsValue() + return uint32Array.jsValue case let .uint8Array(uint8Array): - return uint8Array.jsValue() + return uint8Array.jsValue case let .uint8ClampedArray(uint8ClampedArray): - return uint8ClampedArray.jsValue() + return uint8ClampedArray.jsValue } } } diff --git a/Sources/DOMKit/ECMAScript/Attributes.swift b/Sources/DOMKit/ECMAScript/Attributes.swift index 5091b554..842cd627 100644 --- a/Sources/DOMKit/ECMAScript/Attributes.swift +++ b/Sources/DOMKit/ECMAScript/Attributes.swift @@ -16,7 +16,7 @@ import JavaScriptKit @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> Wrapped { get { jsObject[name].fromJSValue()! } - set { jsObject[name] = newValue.jsValue() } + set { jsObject[name] = newValue.jsValue } } } diff --git a/Sources/DOMKit/ECMAScript/BridgedDictionary.swift b/Sources/DOMKit/ECMAScript/BridgedDictionary.swift index 3ef5b12c..813e0a66 100644 --- a/Sources/DOMKit/ECMAScript/BridgedDictionary.swift +++ b/Sources/DOMKit/ECMAScript/BridgedDictionary.swift @@ -3,8 +3,8 @@ import JavaScriptKit public class BridgedDictionary: JSValueCompatible { public let jsObject: JSObject - public func jsValue() -> JSValue { - jsObject.jsValue() + public var jsValue: JSValue { + jsObject.jsValue } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/ECMAScript/DataView.swift b/Sources/DOMKit/ECMAScript/DataView.swift index e9a89a60..f21e6d9a 100644 --- a/Sources/DOMKit/ECMAScript/DataView.swift +++ b/Sources/DOMKit/ECMAScript/DataView.swift @@ -5,7 +5,6 @@ import JavaScriptKit public class DataView: JSBridgedClass { - public class var constructor: JSFunction { JSObject.global.DataView.function! } public let jsObject: JSObject @@ -18,18 +17,15 @@ public class DataView: JSBridgedClass { } public convenience init(buffer: ArrayBuffer) { - - self.init(unsafelyWrapping: DataView.constructor.new(buffer.jsValue())) + self.init(unsafelyWrapping: DataView.constructor.new(buffer.jsValue)) } public convenience init(buffer: ArrayBuffer, byteOffset: UInt32) { - - self.init(unsafelyWrapping: DataView.constructor.new(buffer.jsValue(), byteOffset.jsValue())) + self.init(unsafelyWrapping: DataView.constructor.new(buffer.jsValue, byteOffset.jsValue)) } public convenience init(buffer: ArrayBuffer, byteOffset: UInt32, byteLength: UInt32) { - - self.init(unsafelyWrapping: DataView.constructor.new(buffer.jsValue(), byteOffset.jsValue(), byteLength.jsValue())) + self.init(unsafelyWrapping: DataView.constructor.new(buffer.jsValue, byteOffset.jsValue, byteLength.jsValue)) } @ReadonlyAttribute @@ -41,131 +37,115 @@ public class DataView: JSBridgedClass { @ReadonlyAttribute public var byteLength: UInt32 - public func getFloat32(byteOffset: UInt32) -> Float { - - return jsObject.getFloat32!(byteOffset.jsValue()).fromJSValue()! + jsObject.getFloat32!(byteOffset.jsValue).fromJSValue()! } public func getFloat32(byteOffset: UInt32, littleEndian: Bool) -> Float { - - return jsObject.getFloat32!(byteOffset.jsValue(), littleEndian.jsValue()).fromJSValue()! + jsObject.getFloat32!(byteOffset.jsValue, littleEndian.jsValue).fromJSValue()! } public func getFloat64(byteOffset: UInt32) -> Double { - - return jsObject.getFloat64!(byteOffset.jsValue()).fromJSValue()! + jsObject.getFloat64!(byteOffset.jsValue).fromJSValue()! } public func getFloat64(byteOffset: UInt32, littleEndian: Bool) -> Double { - - return jsObject.getFloat64!(byteOffset.jsValue(), littleEndian.jsValue()).fromJSValue()! + jsObject.getFloat64!(byteOffset.jsValue, littleEndian.jsValue).fromJSValue()! } public func getUint8(byteOffset: UInt32) -> UInt8 { - - return jsObject.getUint8!(byteOffset.jsValue()).fromJSValue()! + jsObject.getUint8!(byteOffset.jsValue).fromJSValue()! } public func getUint16(byteOffset: UInt32) -> UInt16 { - - return jsObject.getUint16!(byteOffset.jsValue()).fromJSValue()! + jsObject.getUint16!(byteOffset.jsValue).fromJSValue()! } public func getUint16(byteOffset: UInt32, littleEndian: Bool) -> UInt16 { - - return jsObject.getUint16!(byteOffset.jsValue(), littleEndian.jsValue()).fromJSValue()! + jsObject.getUint16!(byteOffset.jsValue, littleEndian.jsValue).fromJSValue()! } public func getUint32(byteOffset: UInt32) -> UInt32 { - - return jsObject.getUint32!(byteOffset.jsValue()).fromJSValue()! + jsObject.getUint32!(byteOffset.jsValue).fromJSValue()! } public func getUint32(byteOffset: UInt32, littleEndian: Bool) -> UInt32 { - - return jsObject.getUint32!(byteOffset.jsValue(), littleEndian.jsValue()).fromJSValue()! + jsObject.getUint32!(byteOffset.jsValue, littleEndian.jsValue).fromJSValue()! } public func getInt8(byteOffset: UInt32) -> Int8 { - - return jsObject.getInt8!(byteOffset.jsValue()).fromJSValue()! + jsObject.getInt8!(byteOffset.jsValue).fromJSValue()! } public func getInt16(byteOffset: UInt32) -> Int16 { - - return jsObject.getInt16!(byteOffset.jsValue()).fromJSValue()! + jsObject.getInt16!(byteOffset.jsValue).fromJSValue()! } public func getInt16(byteOffset: UInt32, littleEndian: Bool) -> Int16 { - - return jsObject.getInt16!(byteOffset.jsValue(), littleEndian.jsValue()).fromJSValue()! + jsObject.getInt16!(byteOffset.jsValue, littleEndian.jsValue).fromJSValue()! } public func getInt32(byteOffset: UInt32) -> Int32 { - - return jsObject.getInt32!(byteOffset.jsValue()).fromJSValue()! + jsObject.getInt32!(byteOffset.jsValue).fromJSValue()! } public func getInt32(byteOffset: UInt32, littleEndian: Bool) -> Int32 { - - return jsObject.getInt32!(byteOffset.jsValue(), littleEndian.jsValue()).fromJSValue()! + jsObject.getInt32!(byteOffset.jsValue, littleEndian.jsValue).fromJSValue()! } public func setUint8(byteOffset: UInt32, value: UInt8) { - _ = jsObject.setUint8!(byteOffset.jsValue(), value.jsValue()) + _ = jsObject.setUint8!(byteOffset.jsValue, value.jsValue) } public func setUint16(byteOffset: UInt32, value: UInt16) { - _ = jsObject.setUint16!(byteOffset.jsValue(), value.jsValue()) + _ = jsObject.setUint16!(byteOffset.jsValue, value.jsValue) } public func setUint16(byteOffset: UInt32, value: UInt16, littleEndian: Bool) { - _ = jsObject.setUint16!(byteOffset.jsValue(), value.jsValue(), littleEndian.jsValue()) + _ = jsObject.setUint16!(byteOffset.jsValue, value.jsValue, littleEndian.jsValue) } public func setUint32(byteOffset: UInt32, value: UInt32) { - _ = jsObject.setUint32!(byteOffset.jsValue(), value.jsValue()) + _ = jsObject.setUint32!(byteOffset.jsValue, value.jsValue) } public func setUint32(byteOffset: UInt32, value: UInt32, littleEndian: Bool) { - _ = jsObject.setUint32!(byteOffset.jsValue(), value.jsValue(), littleEndian.jsValue()) + _ = jsObject.setUint32!(byteOffset.jsValue, value.jsValue, littleEndian.jsValue) } public func setInt8(byteOffset: UInt32, value: Int8) { - _ = jsObject.setUint8!(byteOffset.jsValue(), value.jsValue()) + _ = jsObject.setUint8!(byteOffset.jsValue, value.jsValue) } public func setInt16(byteOffset: UInt32, value: Int16) { - _ = jsObject.setInt16!(byteOffset.jsValue(), value.jsValue()) + _ = jsObject.setInt16!(byteOffset.jsValue, value.jsValue) } public func setInt16(byteOffset: UInt32, value: Int16, littleEndian: Bool) { - _ = jsObject.setInt16!(byteOffset.jsValue(), value.jsValue(), littleEndian.jsValue()) + _ = jsObject.setInt16!(byteOffset.jsValue, value.jsValue, littleEndian.jsValue) } public func setInt32(byteOffset: UInt32, value: Int32) { - _ = jsObject.setInt32!(byteOffset.jsValue(), value.jsValue()) + _ = jsObject.setInt32!(byteOffset.jsValue, value.jsValue) } public func setInt32(byteOffset: UInt32, value: Int32, littleEndian: Bool) { - _ = jsObject.setInt32!(byteOffset.jsValue(), value.jsValue(), littleEndian.jsValue()) + _ = jsObject.setInt32!(byteOffset.jsValue, value.jsValue, littleEndian.jsValue) } public func setFloat32(byteOffset: UInt32, value: Float) { - _ = jsObject.setFloat32!(byteOffset.jsValue(), value.jsValue()) + _ = jsObject.setFloat32!(byteOffset.jsValue, value.jsValue) } public func setFloat32(byteOffset: UInt32, value: Float, littleEndian: Bool) { - _ = jsObject.setFloat32!(byteOffset.jsValue(), value.jsValue(), littleEndian.jsValue()) + _ = jsObject.setFloat32!(byteOffset.jsValue, value.jsValue, littleEndian.jsValue) } public func setFloat64(byteOffset: UInt32, value: Double) { - _ = jsObject.setFloat64!(byteOffset.jsValue(), value.jsValue()) + _ = jsObject.setFloat64!(byteOffset.jsValue, value.jsValue) } public func setFloat64(byteOffset: UInt32, value: Double, littleEndian: Bool) { - _ = jsObject.setFloat64!(byteOffset.jsValue(), value.jsValue(), littleEndian.jsValue()) + _ = jsObject.setFloat64!(byteOffset.jsValue, value.jsValue, littleEndian.jsValue) } } - diff --git a/Sources/DOMKit/ECMAScript/Iterators.swift b/Sources/DOMKit/ECMAScript/Iterators.swift index 0a179df8..9fe63e15 100644 --- a/Sources/DOMKit/ECMAScript/Iterators.swift +++ b/Sources/DOMKit/ECMAScript/Iterators.swift @@ -32,7 +32,7 @@ public class ValueIterableAsyncIterator SequenceType.Element? { let promise = JSPromise(from: iterator.next!())! - let result = try await promise.get() + let result = try await promise.value let done = result.done.boolean! guard !done else { return nil } diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 7c4553da..b89795f6 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -11,7 +11,7 @@ public extension HTMLElement { } } -public let globalThis = Window(from: JSObject.global.jsValue())! +public let globalThis = Window(from: JSObject.global.jsValue)! public typealias Uint8ClampedArray = JSUInt8ClampedArray public typealias CSSColorValue_or_CSSStyleValue = CSSStyleValue diff --git a/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift b/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift index 22eaec64..31d76ee7 100644 --- a/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift +++ b/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift @@ -16,16 +16,16 @@ public class ANGLE_instanced_arrays: JSBridgedClass { @inlinable public func drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) { let this = jsObject - _ = this[Strings.drawArraysInstancedANGLE].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue(), primcount.jsValue()]) + _ = this[Strings.drawArraysInstancedANGLE].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue, primcount.jsValue]) } @inlinable public func drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei) { let this = jsObject - _ = this[Strings.drawElementsInstancedANGLE].function!(this: this, arguments: [mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), primcount.jsValue()]) + _ = this[Strings.drawElementsInstancedANGLE].function!(this: this, arguments: [mode.jsValue, count.jsValue, type.jsValue, offset.jsValue, primcount.jsValue]) } @inlinable public func vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint) { let this = jsObject - _ = this[Strings.vertexAttribDivisorANGLE].function!(this: this, arguments: [index.jsValue(), divisor.jsValue()]) + _ = this[Strings.vertexAttribDivisorANGLE].function!(this: this, arguments: [index.jsValue, divisor.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/AbortController.swift b/Sources/DOMKit/WebIDL/AbortController.swift index 28da04b0..12ea808f 100644 --- a/Sources/DOMKit/WebIDL/AbortController.swift +++ b/Sources/DOMKit/WebIDL/AbortController.swift @@ -22,6 +22,6 @@ public class AbortController: JSBridgedClass { @inlinable public func abort(reason: JSValue? = nil) { let this = jsObject - _ = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]) + _ = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/AbortSignal.swift b/Sources/DOMKit/WebIDL/AbortSignal.swift index 64697946..39d006f6 100644 --- a/Sources/DOMKit/WebIDL/AbortSignal.swift +++ b/Sources/DOMKit/WebIDL/AbortSignal.swift @@ -15,12 +15,12 @@ public class AbortSignal: EventTarget { @inlinable public static func abort(reason: JSValue? = nil) -> Self { let this = constructor - return this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.abort].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public static func timeout(milliseconds: UInt64) -> Self { let this = constructor - return this[Strings.timeout].function!(this: this, arguments: [milliseconds.jsValue()]).fromJSValue()! + return this[Strings.timeout].function!(this: this, arguments: [milliseconds.jsValue]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift b/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift index 08588d42..734e9539 100644 --- a/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift +++ b/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class AbsoluteOrientationReadingValues: BridgedDictionary { public convenience init(quaternion: [Double]?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.quaternion] = quaternion.jsValue() + object[Strings.quaternion] = quaternion.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift b/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift index f7c6806d..97550dc1 100644 --- a/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift +++ b/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift @@ -11,6 +11,6 @@ public class AbsoluteOrientationSensor: OrientationSensor { } @inlinable public convenience init(sensorOptions: OrientationSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/Accelerometer.swift b/Sources/DOMKit/WebIDL/Accelerometer.swift index d5ad6499..94a8808c 100644 --- a/Sources/DOMKit/WebIDL/Accelerometer.swift +++ b/Sources/DOMKit/WebIDL/Accelerometer.swift @@ -14,7 +14,7 @@ public class Accelerometer: Sensor { } @inlinable public convenience init(options: AccelerometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift index b0efea7f..98de2143 100644 --- a/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift +++ b/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift @@ -18,5 +18,5 @@ public enum AccelerometerLocalCoordinateSystem: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift b/Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift index 8829034d..402ce513 100644 --- a/Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift +++ b/Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AccelerometerReadingValues: BridgedDictionary { public convenience init(x: Double?, y: Double?, z: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.z] = z.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.z] = z.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift b/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift index e20c62d8..b18c354f 100644 --- a/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift +++ b/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class AccelerometerSensorOptions: BridgedDictionary { public convenience init(referenceFrame: AccelerometerLocalCoordinateSystem) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceFrame] = referenceFrame.jsValue() + object[Strings.referenceFrame] = referenceFrame.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift index 177f0f59..8cd62fd8 100644 --- a/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/AddEventListenerOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AddEventListenerOptions: BridgedDictionary { public convenience init(passive: Bool, once: Bool, signal: AbortSignal) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.passive] = passive.jsValue() - object[Strings.once] = once.jsValue() - object[Strings.signal] = signal.jsValue() + object[Strings.passive] = passive.jsValue + object[Strings.once] = once.jsValue + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AesCbcParams.swift b/Sources/DOMKit/WebIDL/AesCbcParams.swift index d83b9c57..4211354b 100644 --- a/Sources/DOMKit/WebIDL/AesCbcParams.swift +++ b/Sources/DOMKit/WebIDL/AesCbcParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class AesCbcParams: BridgedDictionary { public convenience init(iv: BufferSource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iv] = iv.jsValue() + object[Strings.iv] = iv.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AesCtrParams.swift b/Sources/DOMKit/WebIDL/AesCtrParams.swift index 22e37710..fd44c0c6 100644 --- a/Sources/DOMKit/WebIDL/AesCtrParams.swift +++ b/Sources/DOMKit/WebIDL/AesCtrParams.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class AesCtrParams: BridgedDictionary { public convenience init(counter: BufferSource, length: UInt8) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.counter] = counter.jsValue() - object[Strings.length] = length.jsValue() + object[Strings.counter] = counter.jsValue + object[Strings.length] = length.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift b/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift index b7c3c507..d0aa0d55 100644 --- a/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift +++ b/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class AesDerivedKeyParams: BridgedDictionary { public convenience init(length: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.length] = length.jsValue() + object[Strings.length] = length.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AesGcmParams.swift b/Sources/DOMKit/WebIDL/AesGcmParams.swift index 0f7edad9..fd36d499 100644 --- a/Sources/DOMKit/WebIDL/AesGcmParams.swift +++ b/Sources/DOMKit/WebIDL/AesGcmParams.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AesGcmParams: BridgedDictionary { public convenience init(iv: BufferSource, additionalData: BufferSource, tagLength: UInt8) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iv] = iv.jsValue() - object[Strings.additionalData] = additionalData.jsValue() - object[Strings.tagLength] = tagLength.jsValue() + object[Strings.iv] = iv.jsValue + object[Strings.additionalData] = additionalData.jsValue + object[Strings.tagLength] = tagLength.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift index 8564bbe8..bbcacfd3 100644 --- a/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift +++ b/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class AesKeyAlgorithm: BridgedDictionary { public convenience init(length: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.length] = length.jsValue() + object[Strings.length] = length.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AesKeyGenParams.swift b/Sources/DOMKit/WebIDL/AesKeyGenParams.swift index 3d774ae7..6fb5d7a4 100644 --- a/Sources/DOMKit/WebIDL/AesKeyGenParams.swift +++ b/Sources/DOMKit/WebIDL/AesKeyGenParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class AesKeyGenParams: BridgedDictionary { public convenience init(length: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.length] = length.jsValue() + object[Strings.length] = length.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Algorithm.swift b/Sources/DOMKit/WebIDL/Algorithm.swift index e7f95196..01af3fdf 100644 --- a/Sources/DOMKit/WebIDL/Algorithm.swift +++ b/Sources/DOMKit/WebIDL/Algorithm.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class Algorithm: BridgedDictionary { public convenience init(name: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() + object[Strings.name] = name.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift b/Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift index 80b4c27c..4d238032 100644 --- a/Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift +++ b/Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift @@ -21,12 +21,12 @@ public enum AlgorithmIdentifier: JSValueCompatible, Any_AlgorithmIdentifier { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .jSObject(jSObject): - return jSObject.jsValue() + return jSObject.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/AlignSetting.swift b/Sources/DOMKit/WebIDL/AlignSetting.swift index 5e6537dc..fd7a2f30 100644 --- a/Sources/DOMKit/WebIDL/AlignSetting.swift +++ b/Sources/DOMKit/WebIDL/AlignSetting.swift @@ -21,5 +21,5 @@ public enum AlignSetting: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift b/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift index eadd865a..73e407a8 100644 --- a/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift +++ b/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class AllowedBluetoothDevice: BridgedDictionary { public convenience init(deviceId: String, mayUseGATT: Bool, allowedServices: String_or_seq_of_UUID, allowedManufacturerData: [UInt16]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.deviceId] = deviceId.jsValue() - object[Strings.mayUseGATT] = mayUseGATT.jsValue() - object[Strings.allowedServices] = allowedServices.jsValue() - object[Strings.allowedManufacturerData] = allowedManufacturerData.jsValue() + object[Strings.deviceId] = deviceId.jsValue + object[Strings.mayUseGATT] = mayUseGATT.jsValue + object[Strings.allowedServices] = allowedServices.jsValue + object[Strings.allowedManufacturerData] = allowedManufacturerData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift b/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift index 9675f41d..244c46a7 100644 --- a/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift +++ b/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AllowedUSBDevice: BridgedDictionary { public convenience init(vendorId: UInt8, productId: UInt8, serialNumber: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.vendorId] = vendorId.jsValue() - object[Strings.productId] = productId.jsValue() - object[Strings.serialNumber] = serialNumber.jsValue() + object[Strings.vendorId] = vendorId.jsValue + object[Strings.productId] = productId.jsValue + object[Strings.serialNumber] = serialNumber.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AlphaOption.swift b/Sources/DOMKit/WebIDL/AlphaOption.swift index 7ffacbc3..f086fd3a 100644 --- a/Sources/DOMKit/WebIDL/AlphaOption.swift +++ b/Sources/DOMKit/WebIDL/AlphaOption.swift @@ -18,5 +18,5 @@ public enum AlphaOption: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift b/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift index 009b8f7e..435910a1 100644 --- a/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift +++ b/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class AmbientLightReadingValues: BridgedDictionary { public convenience init(illuminance: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.illuminance] = illuminance.jsValue() + object[Strings.illuminance] = illuminance.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AmbientLightSensor.swift b/Sources/DOMKit/WebIDL/AmbientLightSensor.swift index b99f5e2a..e03ee178 100644 --- a/Sources/DOMKit/WebIDL/AmbientLightSensor.swift +++ b/Sources/DOMKit/WebIDL/AmbientLightSensor.swift @@ -12,7 +12,7 @@ public class AmbientLightSensor: Sensor { } @inlinable public convenience init(sensorOptions: SensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AnalyserNode.swift b/Sources/DOMKit/WebIDL/AnalyserNode.swift index f4d18b09..89b6a803 100644 --- a/Sources/DOMKit/WebIDL/AnalyserNode.swift +++ b/Sources/DOMKit/WebIDL/AnalyserNode.swift @@ -16,27 +16,27 @@ public class AnalyserNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: AnalyserOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @inlinable public func getFloatFrequencyData(array: Float32Array) { let this = jsObject - _ = this[Strings.getFloatFrequencyData].function!(this: this, arguments: [array.jsValue()]) + _ = this[Strings.getFloatFrequencyData].function!(this: this, arguments: [array.jsValue]) } @inlinable public func getByteFrequencyData(array: Uint8Array) { let this = jsObject - _ = this[Strings.getByteFrequencyData].function!(this: this, arguments: [array.jsValue()]) + _ = this[Strings.getByteFrequencyData].function!(this: this, arguments: [array.jsValue]) } @inlinable public func getFloatTimeDomainData(array: Float32Array) { let this = jsObject - _ = this[Strings.getFloatTimeDomainData].function!(this: this, arguments: [array.jsValue()]) + _ = this[Strings.getFloatTimeDomainData].function!(this: this, arguments: [array.jsValue]) } @inlinable public func getByteTimeDomainData(array: Uint8Array) { let this = jsObject - _ = this[Strings.getByteTimeDomainData].function!(this: this, arguments: [array.jsValue()]) + _ = this[Strings.getByteTimeDomainData].function!(this: this, arguments: [array.jsValue]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/AnalyserOptions.swift b/Sources/DOMKit/WebIDL/AnalyserOptions.swift index b47ebce6..8c131340 100644 --- a/Sources/DOMKit/WebIDL/AnalyserOptions.swift +++ b/Sources/DOMKit/WebIDL/AnalyserOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class AnalyserOptions: BridgedDictionary { public convenience init(fftSize: UInt32, maxDecibels: Double, minDecibels: Double, smoothingTimeConstant: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fftSize] = fftSize.jsValue() - object[Strings.maxDecibels] = maxDecibels.jsValue() - object[Strings.minDecibels] = minDecibels.jsValue() - object[Strings.smoothingTimeConstant] = smoothingTimeConstant.jsValue() + object[Strings.fftSize] = fftSize.jsValue + object[Strings.maxDecibels] = maxDecibels.jsValue + object[Strings.minDecibels] = minDecibels.jsValue + object[Strings.smoothingTimeConstant] = smoothingTimeConstant.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Animatable.swift b/Sources/DOMKit/WebIDL/Animatable.swift index 6656901d..74890d13 100644 --- a/Sources/DOMKit/WebIDL/Animatable.swift +++ b/Sources/DOMKit/WebIDL/Animatable.swift @@ -7,11 +7,11 @@ public protocol Animatable: JSBridgedClass {} public extension Animatable { @inlinable func animate(keyframes: JSObject?, options: Double_or_KeyframeAnimationOptions? = nil) -> Animation { let this = jsObject - return this[Strings.animate].function!(this: this, arguments: [keyframes.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.animate].function!(this: this, arguments: [keyframes.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable func getAnimations(options: GetAnimationsOptions? = nil) -> [Animation] { let this = jsObject - return this[Strings.getAnimations].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getAnimations].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Animation.swift b/Sources/DOMKit/WebIDL/Animation.swift index 9dc6be1d..257a44ce 100644 --- a/Sources/DOMKit/WebIDL/Animation.swift +++ b/Sources/DOMKit/WebIDL/Animation.swift @@ -31,7 +31,7 @@ public class Animation: EventTarget { public var currentTime: CSSNumberish? @inlinable public convenience init(effect: AnimationEffect? = nil, timeline: AnimationTimeline? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [effect?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [effect?.jsValue ?? .undefined, timeline?.jsValue ?? .undefined])) } @ReadWriteAttribute @@ -92,7 +92,7 @@ public class Animation: EventTarget { @inlinable public func updatePlaybackRate(playbackRate: Double) { let this = jsObject - _ = this[Strings.updatePlaybackRate].function!(this: this, arguments: [playbackRate.jsValue()]) + _ = this[Strings.updatePlaybackRate].function!(this: this, arguments: [playbackRate.jsValue]) } @inlinable public func reverse() { diff --git a/Sources/DOMKit/WebIDL/AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect.swift index 5215d8cb..a9145e48 100644 --- a/Sources/DOMKit/WebIDL/AnimationEffect.swift +++ b/Sources/DOMKit/WebIDL/AnimationEffect.swift @@ -26,17 +26,17 @@ public class AnimationEffect: JSBridgedClass { @inlinable public func before(effects: AnimationEffect...) { let this = jsObject - _ = this[Strings.before].function!(this: this, arguments: effects.map { $0.jsValue() }) + _ = this[Strings.before].function!(this: this, arguments: effects.map(\.jsValue)) } @inlinable public func after(effects: AnimationEffect...) { let this = jsObject - _ = this[Strings.after].function!(this: this, arguments: effects.map { $0.jsValue() }) + _ = this[Strings.after].function!(this: this, arguments: effects.map(\.jsValue)) } @inlinable public func replace(effects: AnimationEffect...) { let this = jsObject - _ = this[Strings.replace].function!(this: this, arguments: effects.map { $0.jsValue() }) + _ = this[Strings.replace].function!(this: this, arguments: effects.map(\.jsValue)) } @inlinable public func remove() { @@ -56,6 +56,6 @@ public class AnimationEffect: JSBridgedClass { @inlinable public func updateTiming(timing: OptionalEffectTiming? = nil) { let this = jsObject - _ = this[Strings.updateTiming].function!(this: this, arguments: [timing?.jsValue() ?? .undefined]) + _ = this[Strings.updateTiming].function!(this: this, arguments: [timing?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift index 799ce34a..2589d750 100644 --- a/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift +++ b/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift @@ -21,12 +21,12 @@ public enum AnimationEffect_or_seq_of_AnimationEffect: JSValueCompatible, Any_An return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .animationEffect(animationEffect): - return animationEffect.jsValue() + return animationEffect.jsValue case let .seq_of_AnimationEffect(seq_of_AnimationEffect): - return seq_of_AnimationEffect.jsValue() + return seq_of_AnimationEffect.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/AnimationEvent.swift b/Sources/DOMKit/WebIDL/AnimationEvent.swift index b3bc3343..f1cecdf1 100644 --- a/Sources/DOMKit/WebIDL/AnimationEvent.swift +++ b/Sources/DOMKit/WebIDL/AnimationEvent.swift @@ -14,7 +14,7 @@ public class AnimationEvent: Event { } @inlinable public convenience init(type: String, animationEventInitDict: AnimationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), animationEventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, animationEventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AnimationEventInit.swift b/Sources/DOMKit/WebIDL/AnimationEventInit.swift index 1c82a6cb..198d8a9d 100644 --- a/Sources/DOMKit/WebIDL/AnimationEventInit.swift +++ b/Sources/DOMKit/WebIDL/AnimationEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AnimationEventInit: BridgedDictionary { public convenience init(animationName: String, elapsedTime: Double, pseudoElement: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.animationName] = animationName.jsValue() - object[Strings.elapsedTime] = elapsedTime.jsValue() - object[Strings.pseudoElement] = pseudoElement.jsValue() + object[Strings.animationName] = animationName.jsValue + object[Strings.elapsedTime] = elapsedTime.jsValue + object[Strings.pseudoElement] = pseudoElement.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift index 4dd53eae..49db0432 100644 --- a/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift +++ b/Sources/DOMKit/WebIDL/AnimationFrameProvider.swift @@ -9,6 +9,6 @@ public extension AnimationFrameProvider { @inlinable func cancelAnimationFrame(handle: UInt32) { let this = jsObject - _ = this[Strings.cancelAnimationFrame].function!(this: this, arguments: [handle.jsValue()]) + _ = this[Strings.cancelAnimationFrame].function!(this: this, arguments: [handle.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/AnimationPlayState.swift b/Sources/DOMKit/WebIDL/AnimationPlayState.swift index b270e919..2231613f 100644 --- a/Sources/DOMKit/WebIDL/AnimationPlayState.swift +++ b/Sources/DOMKit/WebIDL/AnimationPlayState.swift @@ -20,5 +20,5 @@ public enum AnimationPlayState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift b/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift index 2f66d482..f2e4ec45 100644 --- a/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift +++ b/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift @@ -13,7 +13,7 @@ public class AnimationPlaybackEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: AnimationPlaybackEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift b/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift index 13dab666..dc593747 100644 --- a/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift +++ b/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class AnimationPlaybackEventInit: BridgedDictionary { public convenience init(currentTime: CSSNumberish?, timelineTime: CSSNumberish?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.currentTime] = currentTime.jsValue() - object[Strings.timelineTime] = timelineTime.jsValue() + object[Strings.currentTime] = currentTime.jsValue + object[Strings.timelineTime] = timelineTime.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AnimationReplaceState.swift b/Sources/DOMKit/WebIDL/AnimationReplaceState.swift index c5521877..02e0796c 100644 --- a/Sources/DOMKit/WebIDL/AnimationReplaceState.swift +++ b/Sources/DOMKit/WebIDL/AnimationReplaceState.swift @@ -19,5 +19,5 @@ public enum AnimationReplaceState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AnimationTimeline.swift b/Sources/DOMKit/WebIDL/AnimationTimeline.swift index b78054b6..02e3cff0 100644 --- a/Sources/DOMKit/WebIDL/AnimationTimeline.swift +++ b/Sources/DOMKit/WebIDL/AnimationTimeline.swift @@ -20,7 +20,7 @@ public class AnimationTimeline: JSBridgedClass { @inlinable public func play(effect: AnimationEffect? = nil) -> Animation { let this = jsObject - return this[Strings.play].function!(this: this, arguments: [effect?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.play].function!(this: this, arguments: [effect?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift b/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift index c185e771..451ef746 100644 --- a/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift +++ b/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift @@ -18,5 +18,5 @@ public enum AppBannerPromptOutcome: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AppendMode.swift b/Sources/DOMKit/WebIDL/AppendMode.swift index 200aa692..23431206 100644 --- a/Sources/DOMKit/WebIDL/AppendMode.swift +++ b/Sources/DOMKit/WebIDL/AppendMode.swift @@ -18,5 +18,5 @@ public enum AppendMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift b/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift index 887ef7f9..923e272e 100644 --- a/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift +++ b/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift @@ -21,12 +21,12 @@ public enum ArrayBuffer_or_String: JSValueCompatible, Any_ArrayBuffer_or_String return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .arrayBuffer(arrayBuffer): - return arrayBuffer.jsValue() + return arrayBuffer.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift index 1b897a66..65a10d5c 100644 --- a/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift +++ b/Sources/DOMKit/WebIDL/AssignedNodesOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class AssignedNodesOptions: BridgedDictionary { public convenience init(flatten: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.flatten] = flatten.jsValue() + object[Strings.flatten] = flatten.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift b/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift index de35fa70..a6686c72 100644 --- a/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift +++ b/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift @@ -20,5 +20,5 @@ public enum AttestationConveyancePreference: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AttributionReporting.swift b/Sources/DOMKit/WebIDL/AttributionReporting.swift index ff0d4199..19bcb834 100644 --- a/Sources/DOMKit/WebIDL/AttributionReporting.swift +++ b/Sources/DOMKit/WebIDL/AttributionReporting.swift @@ -14,13 +14,13 @@ public class AttributionReporting: JSBridgedClass { @inlinable public func registerAttributionSource(params: AttributionSourceParams) -> JSPromise { let this = jsObject - return this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue()]).fromJSValue()! + return this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func registerAttributionSource(params: AttributionSourceParams) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/AttributionSourceParams.swift b/Sources/DOMKit/WebIDL/AttributionSourceParams.swift index 83ae649a..071baa4d 100644 --- a/Sources/DOMKit/WebIDL/AttributionSourceParams.swift +++ b/Sources/DOMKit/WebIDL/AttributionSourceParams.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class AttributionSourceParams: BridgedDictionary { public convenience init(attributionDestination: String, attributionSourceEventId: String, attributionReportTo: String, attributionExpiry: Int64, attributionSourcePriority: Int64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.attributionDestination] = attributionDestination.jsValue() - object[Strings.attributionSourceEventId] = attributionSourceEventId.jsValue() - object[Strings.attributionReportTo] = attributionReportTo.jsValue() - object[Strings.attributionExpiry] = attributionExpiry.jsValue() - object[Strings.attributionSourcePriority] = attributionSourcePriority.jsValue() + object[Strings.attributionDestination] = attributionDestination.jsValue + object[Strings.attributionSourceEventId] = attributionSourceEventId.jsValue + object[Strings.attributionReportTo] = attributionReportTo.jsValue + object[Strings.attributionExpiry] = attributionExpiry.jsValue + object[Strings.attributionSourcePriority] = attributionSourcePriority.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioBuffer.swift b/Sources/DOMKit/WebIDL/AudioBuffer.swift index ba5bbaeb..81fcd328 100644 --- a/Sources/DOMKit/WebIDL/AudioBuffer.swift +++ b/Sources/DOMKit/WebIDL/AudioBuffer.swift @@ -17,7 +17,7 @@ public class AudioBuffer: JSBridgedClass { } @inlinable public convenience init(options: AudioBufferOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue])) } @ReadonlyAttribute @@ -34,16 +34,16 @@ public class AudioBuffer: JSBridgedClass { @inlinable public func getChannelData(channel: UInt32) -> Float32Array { let this = jsObject - return this[Strings.getChannelData].function!(this: this, arguments: [channel.jsValue()]).fromJSValue()! + return this[Strings.getChannelData].function!(this: this, arguments: [channel.jsValue]).fromJSValue()! } @inlinable public func copyFromChannel(destination: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { let this = jsObject - _ = this[Strings.copyFromChannel].function!(this: this, arguments: [destination.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined]) + _ = this[Strings.copyFromChannel].function!(this: this, arguments: [destination.jsValue, channelNumber.jsValue, bufferOffset?.jsValue ?? .undefined]) } @inlinable public func copyToChannel(source: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { let this = jsObject - _ = this[Strings.copyToChannel].function!(this: this, arguments: [source.jsValue(), channelNumber.jsValue(), bufferOffset?.jsValue() ?? .undefined]) + _ = this[Strings.copyToChannel].function!(this: this, arguments: [source.jsValue, channelNumber.jsValue, bufferOffset?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/AudioBufferOptions.swift b/Sources/DOMKit/WebIDL/AudioBufferOptions.swift index e2ace5c9..28761c14 100644 --- a/Sources/DOMKit/WebIDL/AudioBufferOptions.swift +++ b/Sources/DOMKit/WebIDL/AudioBufferOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AudioBufferOptions: BridgedDictionary { public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfChannels] = numberOfChannels.jsValue() - object[Strings.length] = length.jsValue() - object[Strings.sampleRate] = sampleRate.jsValue() + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.length] = length.jsValue + object[Strings.sampleRate] = sampleRate.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift index fb635a39..866d9931 100644 --- a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift +++ b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift @@ -17,7 +17,7 @@ public class AudioBufferSourceNode: AudioScheduledSourceNode { } @inlinable public convenience init(context: BaseAudioContext, options: AudioBufferSourceOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift index 792099b5..2507d975 100644 --- a/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift +++ b/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class AudioBufferSourceOptions: BridgedDictionary { public convenience init(buffer: AudioBuffer?, detune: Float, loop: Bool, loopEnd: Double, loopStart: Double, playbackRate: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffer] = buffer.jsValue() - object[Strings.detune] = detune.jsValue() - object[Strings.loop] = loop.jsValue() - object[Strings.loopEnd] = loopEnd.jsValue() - object[Strings.loopStart] = loopStart.jsValue() - object[Strings.playbackRate] = playbackRate.jsValue() + object[Strings.buffer] = buffer.jsValue + object[Strings.detune] = detune.jsValue + object[Strings.loop] = loop.jsValue + object[Strings.loopEnd] = loopEnd.jsValue + object[Strings.loopStart] = loopStart.jsValue + object[Strings.playbackRate] = playbackRate.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioConfiguration.swift b/Sources/DOMKit/WebIDL/AudioConfiguration.swift index 68f925ee..6fe29b41 100644 --- a/Sources/DOMKit/WebIDL/AudioConfiguration.swift +++ b/Sources/DOMKit/WebIDL/AudioConfiguration.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class AudioConfiguration: BridgedDictionary { public convenience init(contentType: String, channels: String, bitrate: UInt64, samplerate: UInt32, spatialRendering: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contentType] = contentType.jsValue() - object[Strings.channels] = channels.jsValue() - object[Strings.bitrate] = bitrate.jsValue() - object[Strings.samplerate] = samplerate.jsValue() - object[Strings.spatialRendering] = spatialRendering.jsValue() + object[Strings.contentType] = contentType.jsValue + object[Strings.channels] = channels.jsValue + object[Strings.bitrate] = bitrate.jsValue + object[Strings.samplerate] = samplerate.jsValue + object[Strings.spatialRendering] = spatialRendering.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioContext.swift b/Sources/DOMKit/WebIDL/AudioContext.swift index 74ea8db4..92c4a3f3 100644 --- a/Sources/DOMKit/WebIDL/AudioContext.swift +++ b/Sources/DOMKit/WebIDL/AudioContext.swift @@ -13,7 +13,7 @@ public class AudioContext: BaseAudioContext { } @inlinable public convenience init(contextOptions: AudioContextOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -36,7 +36,7 @@ public class AudioContext: BaseAudioContext { @inlinable public func resume() async throws { let this = jsObject let _promise: JSPromise = this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func suspend() -> JSPromise { @@ -48,7 +48,7 @@ public class AudioContext: BaseAudioContext { @inlinable public func suspend() async throws { let this = jsObject let _promise: JSPromise = this[Strings.suspend].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func close() -> JSPromise { @@ -60,22 +60,22 @@ public class AudioContext: BaseAudioContext { @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func createMediaElementSource(mediaElement: HTMLMediaElement) -> MediaElementAudioSourceNode { let this = jsObject - return this[Strings.createMediaElementSource].function!(this: this, arguments: [mediaElement.jsValue()]).fromJSValue()! + return this[Strings.createMediaElementSource].function!(this: this, arguments: [mediaElement.jsValue]).fromJSValue()! } @inlinable public func createMediaStreamSource(mediaStream: MediaStream) -> MediaStreamAudioSourceNode { let this = jsObject - return this[Strings.createMediaStreamSource].function!(this: this, arguments: [mediaStream.jsValue()]).fromJSValue()! + return this[Strings.createMediaStreamSource].function!(this: this, arguments: [mediaStream.jsValue]).fromJSValue()! } @inlinable public func createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack) -> MediaStreamTrackAudioSourceNode { let this = jsObject - return this[Strings.createMediaStreamTrackSource].function!(this: this, arguments: [mediaStreamTrack.jsValue()]).fromJSValue()! + return this[Strings.createMediaStreamTrackSource].function!(this: this, arguments: [mediaStreamTrack.jsValue]).fromJSValue()! } @inlinable public func createMediaStreamDestination() -> MediaStreamAudioDestinationNode { diff --git a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift index 8843228d..d62ce93a 100644 --- a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift +++ b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift @@ -19,5 +19,5 @@ public enum AudioContextLatencyCategory: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift index ef209adc..4b27f8c7 100644 --- a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift +++ b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift @@ -21,12 +21,12 @@ public enum AudioContextLatencyCategory_or_Double: JSValueCompatible, Any_AudioC return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .audioContextLatencyCategory(audioContextLatencyCategory): - return audioContextLatencyCategory.jsValue() + return audioContextLatencyCategory.jsValue case let .double(double): - return double.jsValue() + return double.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/AudioContextOptions.swift b/Sources/DOMKit/WebIDL/AudioContextOptions.swift index d5fbc58b..09df3c2a 100644 --- a/Sources/DOMKit/WebIDL/AudioContextOptions.swift +++ b/Sources/DOMKit/WebIDL/AudioContextOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class AudioContextOptions: BridgedDictionary { public convenience init(latencyHint: AudioContextLatencyCategory_or_Double, sampleRate: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.latencyHint] = latencyHint.jsValue() - object[Strings.sampleRate] = sampleRate.jsValue() + object[Strings.latencyHint] = latencyHint.jsValue + object[Strings.sampleRate] = sampleRate.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioContextState.swift b/Sources/DOMKit/WebIDL/AudioContextState.swift index 987634db..b4671d1d 100644 --- a/Sources/DOMKit/WebIDL/AudioContextState.swift +++ b/Sources/DOMKit/WebIDL/AudioContextState.swift @@ -19,5 +19,5 @@ public enum AudioContextState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AudioData.swift b/Sources/DOMKit/WebIDL/AudioData.swift index b0df4f1b..a0fc829f 100644 --- a/Sources/DOMKit/WebIDL/AudioData.swift +++ b/Sources/DOMKit/WebIDL/AudioData.swift @@ -19,7 +19,7 @@ public class AudioData: JSBridgedClass { } @inlinable public convenience init(init: AudioDataInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute @@ -42,12 +42,12 @@ public class AudioData: JSBridgedClass { @inlinable public func allocationSize(options: AudioDataCopyToOptions) -> UInt32 { let this = jsObject - return this[Strings.allocationSize].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! + 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()]) + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options.jsValue]) } @inlinable public func clone() -> Self { diff --git a/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift b/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift index e24c9eb0..78daea46 100644 --- a/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift +++ b/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift @@ -6,10 +6,10 @@ 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() + object[Strings.planeIndex] = planeIndex.jsValue + object[Strings.frameOffset] = frameOffset.jsValue + object[Strings.frameCount] = frameCount.jsValue + object[Strings.format] = format.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioDataInit.swift b/Sources/DOMKit/WebIDL/AudioDataInit.swift index 78c34d70..d0395761 100644 --- a/Sources/DOMKit/WebIDL/AudioDataInit.swift +++ b/Sources/DOMKit/WebIDL/AudioDataInit.swift @@ -6,12 +6,12 @@ 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() + 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) } diff --git a/Sources/DOMKit/WebIDL/AudioDecoder.swift b/Sources/DOMKit/WebIDL/AudioDecoder.swift index f23a752e..d511e5ba 100644 --- a/Sources/DOMKit/WebIDL/AudioDecoder.swift +++ b/Sources/DOMKit/WebIDL/AudioDecoder.swift @@ -15,7 +15,7 @@ public class AudioDecoder: JSBridgedClass { } @inlinable public convenience init(init: AudioDecoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute @@ -26,12 +26,12 @@ public class AudioDecoder: JSBridgedClass { @inlinable public func configure(config: AudioDecoderConfig) { let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) + _ = 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()]) + _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue]) } @inlinable public func flush() -> JSPromise { @@ -43,7 +43,7 @@ public class AudioDecoder: JSBridgedClass { @inlinable public func flush() async throws { let this = jsObject let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func reset() { @@ -58,13 +58,13 @@ public class AudioDecoder: JSBridgedClass { @inlinable public static func isConfigSupported(config: AudioDecoderConfig) -> JSPromise { let this = constructor - return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue()]).fromJSValue()! + 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.get().fromJSValue()! + 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 index cf7e341b..55aa5a27 100644 --- a/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift +++ b/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift @@ -6,10 +6,10 @@ 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() + object[Strings.codec] = codec.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.description] = description.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift b/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift index 19c9221c..8245e0da 100644 --- a/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift +++ b/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift @@ -6,8 +6,8 @@ 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() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioEncoder.swift b/Sources/DOMKit/WebIDL/AudioEncoder.swift index 33d2f9d6..7565bc23 100644 --- a/Sources/DOMKit/WebIDL/AudioEncoder.swift +++ b/Sources/DOMKit/WebIDL/AudioEncoder.swift @@ -15,7 +15,7 @@ public class AudioEncoder: JSBridgedClass { } @inlinable public convenience init(init: AudioEncoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute @@ -26,12 +26,12 @@ public class AudioEncoder: JSBridgedClass { @inlinable public func configure(config: AudioEncoderConfig) { let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) + _ = 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()]) + _ = this[Strings.encode].function!(this: this, arguments: [data.jsValue]) } @inlinable public func flush() -> JSPromise { @@ -43,7 +43,7 @@ public class AudioEncoder: JSBridgedClass { @inlinable public func flush() async throws { let this = jsObject let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func reset() { @@ -58,13 +58,13 @@ public class AudioEncoder: JSBridgedClass { @inlinable public static func isConfigSupported(config: AudioEncoderConfig) -> JSPromise { let this = constructor - return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue()]).fromJSValue()! + 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.get().fromJSValue()! + 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 index 157f051c..0d8f8acf 100644 --- a/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift +++ b/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift @@ -6,10 +6,10 @@ 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() + object[Strings.codec] = codec.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.bitrate] = bitrate.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift b/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift index fccf587d..bed3a52b 100644 --- a/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift +++ b/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift @@ -6,8 +6,8 @@ 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() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioListener.swift b/Sources/DOMKit/WebIDL/AudioListener.swift index e5c55859..ca93854e 100644 --- a/Sources/DOMKit/WebIDL/AudioListener.swift +++ b/Sources/DOMKit/WebIDL/AudioListener.swift @@ -50,16 +50,16 @@ public class AudioListener: JSBridgedClass { @inlinable public func setPosition(x: Float, y: Float, z: Float) { let this = jsObject - _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue(), y.jsValue(), z.jsValue()]) + _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue, y.jsValue, z.jsValue]) } @inlinable public func setOrientation(x: Float, y: Float, z: Float, xUp: Float, yUp: Float, zUp: Float) { - let _arg0 = x.jsValue() - let _arg1 = y.jsValue() - let _arg2 = z.jsValue() - let _arg3 = xUp.jsValue() - let _arg4 = yUp.jsValue() - let _arg5 = zUp.jsValue() + let _arg0 = x.jsValue + let _arg1 = y.jsValue + let _arg2 = z.jsValue + let _arg3 = xUp.jsValue + let _arg4 = yUp.jsValue + let _arg5 = zUp.jsValue let this = jsObject _ = this[Strings.setOrientation].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } diff --git a/Sources/DOMKit/WebIDL/AudioNode.swift b/Sources/DOMKit/WebIDL/AudioNode.swift index b4df68cb..d4214b2f 100644 --- a/Sources/DOMKit/WebIDL/AudioNode.swift +++ b/Sources/DOMKit/WebIDL/AudioNode.swift @@ -18,12 +18,12 @@ public class AudioNode: EventTarget { @inlinable public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self { let this = jsObject - return this[Strings.connect].function!(this: this, arguments: [destinationNode.jsValue(), output?.jsValue() ?? .undefined, input?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.connect].function!(this: this, arguments: [destinationNode.jsValue, output?.jsValue ?? .undefined, input?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func connect(destinationParam: AudioParam, output: UInt32? = nil) { let this = jsObject - _ = this[Strings.connect].function!(this: this, arguments: [destinationParam.jsValue(), output?.jsValue() ?? .undefined]) + _ = this[Strings.connect].function!(this: this, arguments: [destinationParam.jsValue, output?.jsValue ?? .undefined]) } @inlinable public func disconnect() { @@ -33,32 +33,32 @@ public class AudioNode: EventTarget { @inlinable public func disconnect(output: UInt32) { let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [output.jsValue()]) + _ = this[Strings.disconnect].function!(this: this, arguments: [output.jsValue]) } @inlinable public func disconnect(destinationNode: AudioNode) { let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue()]) + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue]) } @inlinable public func disconnect(destinationNode: AudioNode, output: UInt32) { let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue(), output.jsValue()]) + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue, output.jsValue]) } @inlinable public func disconnect(destinationNode: AudioNode, output: UInt32, input: UInt32) { let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue(), output.jsValue(), input.jsValue()]) + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue, output.jsValue, input.jsValue]) } @inlinable public func disconnect(destinationParam: AudioParam) { let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue()]) + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue]) } @inlinable public func disconnect(destinationParam: AudioParam, output: UInt32) { let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue(), output.jsValue()]) + _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue, output.jsValue]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioNodeOptions.swift b/Sources/DOMKit/WebIDL/AudioNodeOptions.swift index e79d4d6b..69e409e4 100644 --- a/Sources/DOMKit/WebIDL/AudioNodeOptions.swift +++ b/Sources/DOMKit/WebIDL/AudioNodeOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AudioNodeOptions: BridgedDictionary { public convenience init(channelCount: UInt32, channelCountMode: ChannelCountMode, channelInterpretation: ChannelInterpretation) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.channelCount] = channelCount.jsValue() - object[Strings.channelCountMode] = channelCountMode.jsValue() - object[Strings.channelInterpretation] = channelInterpretation.jsValue() + object[Strings.channelCount] = channelCount.jsValue + object[Strings.channelCountMode] = channelCountMode.jsValue + object[Strings.channelInterpretation] = channelInterpretation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioOutputOptions.swift b/Sources/DOMKit/WebIDL/AudioOutputOptions.swift index a9fd10ca..9ec6a960 100644 --- a/Sources/DOMKit/WebIDL/AudioOutputOptions.swift +++ b/Sources/DOMKit/WebIDL/AudioOutputOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class AudioOutputOptions: BridgedDictionary { public convenience init(deviceId: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.deviceId] = deviceId.jsValue() + object[Strings.deviceId] = deviceId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioParam.swift b/Sources/DOMKit/WebIDL/AudioParam.swift index 39098ce6..b28da617 100644 --- a/Sources/DOMKit/WebIDL/AudioParam.swift +++ b/Sources/DOMKit/WebIDL/AudioParam.swift @@ -34,36 +34,36 @@ public class AudioParam: JSBridgedClass { @inlinable public func setValueAtTime(value: Float, startTime: Double) -> Self { let this = jsObject - return this[Strings.setValueAtTime].function!(this: this, arguments: [value.jsValue(), startTime.jsValue()]).fromJSValue()! + return this[Strings.setValueAtTime].function!(this: this, arguments: [value.jsValue, startTime.jsValue]).fromJSValue()! } @inlinable public func linearRampToValueAtTime(value: Float, endTime: Double) -> Self { let this = jsObject - return this[Strings.linearRampToValueAtTime].function!(this: this, arguments: [value.jsValue(), endTime.jsValue()]).fromJSValue()! + return this[Strings.linearRampToValueAtTime].function!(this: this, arguments: [value.jsValue, endTime.jsValue]).fromJSValue()! } @inlinable public func exponentialRampToValueAtTime(value: Float, endTime: Double) -> Self { let this = jsObject - return this[Strings.exponentialRampToValueAtTime].function!(this: this, arguments: [value.jsValue(), endTime.jsValue()]).fromJSValue()! + return this[Strings.exponentialRampToValueAtTime].function!(this: this, arguments: [value.jsValue, endTime.jsValue]).fromJSValue()! } @inlinable public func setTargetAtTime(target: Float, startTime: Double, timeConstant: Float) -> Self { let this = jsObject - return this[Strings.setTargetAtTime].function!(this: this, arguments: [target.jsValue(), startTime.jsValue(), timeConstant.jsValue()]).fromJSValue()! + return this[Strings.setTargetAtTime].function!(this: this, arguments: [target.jsValue, startTime.jsValue, timeConstant.jsValue]).fromJSValue()! } @inlinable public func setValueCurveAtTime(values: [Float], startTime: Double, duration: Double) -> Self { let this = jsObject - return this[Strings.setValueCurveAtTime].function!(this: this, arguments: [values.jsValue(), startTime.jsValue(), duration.jsValue()]).fromJSValue()! + return this[Strings.setValueCurveAtTime].function!(this: this, arguments: [values.jsValue, startTime.jsValue, duration.jsValue]).fromJSValue()! } @inlinable public func cancelScheduledValues(cancelTime: Double) -> Self { let this = jsObject - return this[Strings.cancelScheduledValues].function!(this: this, arguments: [cancelTime.jsValue()]).fromJSValue()! + return this[Strings.cancelScheduledValues].function!(this: this, arguments: [cancelTime.jsValue]).fromJSValue()! } @inlinable public func cancelAndHoldAtTime(cancelTime: Double) -> Self { let this = jsObject - return this[Strings.cancelAndHoldAtTime].function!(this: this, arguments: [cancelTime.jsValue()]).fromJSValue()! + return this[Strings.cancelAndHoldAtTime].function!(this: this, arguments: [cancelTime.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift b/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift index 51fd3218..bfe32cd8 100644 --- a/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift +++ b/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class AudioParamDescriptor: BridgedDictionary { public convenience init(name: String, defaultValue: Float, minValue: Float, maxValue: Float, automationRate: AutomationRate) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.defaultValue] = defaultValue.jsValue() - object[Strings.minValue] = minValue.jsValue() - object[Strings.maxValue] = maxValue.jsValue() - object[Strings.automationRate] = automationRate.jsValue() + object[Strings.name] = name.jsValue + object[Strings.defaultValue] = defaultValue.jsValue + object[Strings.minValue] = minValue.jsValue + object[Strings.maxValue] = maxValue.jsValue + object[Strings.automationRate] = automationRate.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift b/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift index c5232573..5bf8bd0f 100644 --- a/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift +++ b/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift @@ -14,7 +14,7 @@ public class AudioProcessingEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: AudioProcessingEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift b/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift index a41bf229..67ce6925 100644 --- a/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift +++ b/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AudioProcessingEventInit: BridgedDictionary { public convenience init(playbackTime: Double, inputBuffer: AudioBuffer, outputBuffer: AudioBuffer) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.playbackTime] = playbackTime.jsValue() - object[Strings.inputBuffer] = inputBuffer.jsValue() - object[Strings.outputBuffer] = outputBuffer.jsValue() + object[Strings.playbackTime] = playbackTime.jsValue + object[Strings.inputBuffer] = inputBuffer.jsValue + object[Strings.outputBuffer] = outputBuffer.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioSampleFormat.swift b/Sources/DOMKit/WebIDL/AudioSampleFormat.swift index 00db0aef..a629b0a5 100644 --- a/Sources/DOMKit/WebIDL/AudioSampleFormat.swift +++ b/Sources/DOMKit/WebIDL/AudioSampleFormat.swift @@ -24,5 +24,5 @@ public enum AudioSampleFormat: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift index 7cb9c47c..2621c325 100644 --- a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift +++ b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift @@ -16,11 +16,11 @@ public class AudioScheduledSourceNode: AudioNode { @inlinable public func start(when: Double? = nil) { let this = jsObject - _ = this[Strings.start].function!(this: this, arguments: [when?.jsValue() ?? .undefined]) + _ = this[Strings.start].function!(this: this, arguments: [when?.jsValue ?? .undefined]) } @inlinable public func stop(when: Double? = nil) { let this = jsObject - _ = this[Strings.stop].function!(this: this, arguments: [when?.jsValue() ?? .undefined]) + _ = this[Strings.stop].function!(this: this, arguments: [when?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/AudioTimestamp.swift b/Sources/DOMKit/WebIDL/AudioTimestamp.swift index 26e6840e..9de5277b 100644 --- a/Sources/DOMKit/WebIDL/AudioTimestamp.swift +++ b/Sources/DOMKit/WebIDL/AudioTimestamp.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class AudioTimestamp: BridgedDictionary { public convenience init(contextTime: Double, performanceTime: DOMHighResTimeStamp) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contextTime] = contextTime.jsValue() - object[Strings.performanceTime] = performanceTime.jsValue() + object[Strings.contextTime] = contextTime.jsValue + object[Strings.performanceTime] = performanceTime.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AudioTrackList.swift b/Sources/DOMKit/WebIDL/AudioTrackList.swift index fb83e18f..0fd4aea7 100644 --- a/Sources/DOMKit/WebIDL/AudioTrackList.swift +++ b/Sources/DOMKit/WebIDL/AudioTrackList.swift @@ -23,7 +23,7 @@ public class AudioTrackList: EventTarget { @inlinable public func getTrackById(id: String) -> AudioTrack? { let this = jsObject - return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! + return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift index 99614fcb..4dd6bed2 100644 --- a/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift +++ b/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift @@ -26,14 +26,14 @@ public enum AudioTrack_or_TextTrack_or_VideoTrack: JSValueCompatible, Any_AudioT return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .audioTrack(audioTrack): - return audioTrack.jsValue() + return audioTrack.jsValue case let .textTrack(textTrack): - return textTrack.jsValue() + return textTrack.jsValue case let .videoTrack(videoTrack): - return videoTrack.jsValue() + return videoTrack.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift index 2203bcdb..e2867403 100644 --- a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift +++ b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift @@ -14,7 +14,7 @@ public class AudioWorkletNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, name: String, options: AudioWorkletNodeOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), name.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, name.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift b/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift index 3d702309..01213d25 100644 --- a/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift +++ b/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class AudioWorkletNodeOptions: BridgedDictionary { public convenience init(numberOfInputs: UInt32, numberOfOutputs: UInt32, outputChannelCount: [UInt32], parameterData: [String: Double], processorOptions: JSObject) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfInputs] = numberOfInputs.jsValue() - object[Strings.numberOfOutputs] = numberOfOutputs.jsValue() - object[Strings.outputChannelCount] = outputChannelCount.jsValue() - object[Strings.parameterData] = parameterData.jsValue() - object[Strings.processorOptions] = processorOptions.jsValue() + object[Strings.numberOfInputs] = numberOfInputs.jsValue + object[Strings.numberOfOutputs] = numberOfOutputs.jsValue + object[Strings.outputChannelCount] = outputChannelCount.jsValue + object[Strings.parameterData] = parameterData.jsValue + object[Strings.processorOptions] = processorOptions.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift index 6b3201a0..936337a1 100644 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class AuthenticationExtensionsClientInputs: BridgedDictionary { public convenience init(payment: AuthenticationExtensionsPaymentInputs, appid: String, appidExclude: String, uvm: Bool, credProps: Bool, largeBlob: AuthenticationExtensionsLargeBlobInputs) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.payment] = payment.jsValue() - object[Strings.appid] = appid.jsValue() - object[Strings.appidExclude] = appidExclude.jsValue() - object[Strings.uvm] = uvm.jsValue() - object[Strings.credProps] = credProps.jsValue() - object[Strings.largeBlob] = largeBlob.jsValue() + object[Strings.payment] = payment.jsValue + object[Strings.appid] = appid.jsValue + object[Strings.appidExclude] = appidExclude.jsValue + object[Strings.uvm] = uvm.jsValue + object[Strings.credProps] = credProps.jsValue + object[Strings.largeBlob] = largeBlob.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift index 84ae7b5d..2daa915d 100644 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class AuthenticationExtensionsClientOutputs: BridgedDictionary { public convenience init(appid: Bool, appidExclude: Bool, uvm: UvmEntries, credProps: CredentialPropertiesOutput, largeBlob: AuthenticationExtensionsLargeBlobOutputs) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.appid] = appid.jsValue() - object[Strings.appidExclude] = appidExclude.jsValue() - object[Strings.uvm] = uvm.jsValue() - object[Strings.credProps] = credProps.jsValue() - object[Strings.largeBlob] = largeBlob.jsValue() + object[Strings.appid] = appid.jsValue + object[Strings.appidExclude] = appidExclude.jsValue + object[Strings.uvm] = uvm.jsValue + object[Strings.credProps] = credProps.jsValue + object[Strings.largeBlob] = largeBlob.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift index 4ef5f216..e0da3998 100644 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AuthenticationExtensionsLargeBlobInputs: BridgedDictionary { public convenience init(support: String, read: Bool, write: BufferSource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.support] = support.jsValue() - object[Strings.read] = read.jsValue() - object[Strings.write] = write.jsValue() + object[Strings.support] = support.jsValue + object[Strings.read] = read.jsValue + object[Strings.write] = write.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift index 95cc0ecd..9427b984 100644 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class AuthenticationExtensionsLargeBlobOutputs: BridgedDictionary { public convenience init(supported: Bool, blob: ArrayBuffer, written: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supported] = supported.jsValue() - object[Strings.blob] = blob.jsValue() - object[Strings.written] = written.jsValue() + object[Strings.supported] = supported.jsValue + object[Strings.blob] = blob.jsValue + object[Strings.written] = written.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift index c5c69bdd..4169f784 100644 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift +++ b/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class AuthenticationExtensionsPaymentInputs: BridgedDictionary { public convenience init(isPayment: Bool, rp: String, topOrigin: String, payeeOrigin: String, total: PaymentCurrencyAmount, instrument: PaymentCredentialInstrument) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.isPayment] = isPayment.jsValue() - object[Strings.rp] = rp.jsValue() - object[Strings.topOrigin] = topOrigin.jsValue() - object[Strings.payeeOrigin] = payeeOrigin.jsValue() - object[Strings.total] = total.jsValue() - object[Strings.instrument] = instrument.jsValue() + object[Strings.isPayment] = isPayment.jsValue + object[Strings.rp] = rp.jsValue + object[Strings.topOrigin] = topOrigin.jsValue + object[Strings.payeeOrigin] = payeeOrigin.jsValue + object[Strings.total] = total.jsValue + object[Strings.instrument] = instrument.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift b/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift index aa871ca7..42a70ba0 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift @@ -18,5 +18,5 @@ public enum AuthenticatorAttachment: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift b/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift index fc7e516b..8b739cc1 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class AuthenticatorSelectionCriteria: BridgedDictionary { public convenience init(authenticatorAttachment: String, residentKey: String, requireResidentKey: Bool, userVerification: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.authenticatorAttachment] = authenticatorAttachment.jsValue() - object[Strings.residentKey] = residentKey.jsValue() - object[Strings.requireResidentKey] = requireResidentKey.jsValue() - object[Strings.userVerification] = userVerification.jsValue() + object[Strings.authenticatorAttachment] = authenticatorAttachment.jsValue + object[Strings.residentKey] = residentKey.jsValue + object[Strings.requireResidentKey] = requireResidentKey.jsValue + object[Strings.userVerification] = userVerification.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift b/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift index df45d09b..3201d7e8 100644 --- a/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift +++ b/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift @@ -20,5 +20,5 @@ public enum AuthenticatorTransport: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AutoKeyword.swift b/Sources/DOMKit/WebIDL/AutoKeyword.swift index c5eda64f..2052c97f 100644 --- a/Sources/DOMKit/WebIDL/AutoKeyword.swift +++ b/Sources/DOMKit/WebIDL/AutoKeyword.swift @@ -17,5 +17,5 @@ public enum AutoKeyword: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AutomationRate.swift b/Sources/DOMKit/WebIDL/AutomationRate.swift index 379f9a00..849486e0 100644 --- a/Sources/DOMKit/WebIDL/AutomationRate.swift +++ b/Sources/DOMKit/WebIDL/AutomationRate.swift @@ -18,5 +18,5 @@ public enum AutomationRate: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AutoplayPolicy.swift b/Sources/DOMKit/WebIDL/AutoplayPolicy.swift index b34ac34c..a1cbbade 100644 --- a/Sources/DOMKit/WebIDL/AutoplayPolicy.swift +++ b/Sources/DOMKit/WebIDL/AutoplayPolicy.swift @@ -19,5 +19,5 @@ public enum AutoplayPolicy: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift b/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift index ab83b495..3c9309bf 100644 --- a/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift +++ b/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift @@ -18,5 +18,5 @@ public enum AutoplayPolicyMediaType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift b/Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift index e2199e32..c7b4a431 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class BackgroundFetchEventInit: BridgedDictionary { public convenience init(registration: BackgroundFetchRegistration) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.registration] = registration.jsValue() + object[Strings.registration] = registration.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift b/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift index 696b0ddd..75ceadc2 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift @@ -22,5 +22,5 @@ public enum BackgroundFetchFailureReason: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift index ce306a17..cb248840 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift @@ -14,26 +14,26 @@ public class BackgroundFetchManager: JSBridgedClass { @inlinable public func fetch(id: String, requests: RequestInfo_or_seq_of_RequestInfo, options: BackgroundFetchOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.fetch].function!(this: this, arguments: [id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.fetch].function!(this: this, arguments: [id.jsValue, requests.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func fetch(id: String, requests: RequestInfo_or_seq_of_RequestInfo, options: BackgroundFetchOptions? = nil) async throws -> BackgroundFetchRegistration { let this = jsObject - let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [id.jsValue(), requests.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [id.jsValue, requests.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func get(id: String) -> JSPromise { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [id.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func get(id: String) async throws -> BackgroundFetchRegistration? { let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [id.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getIds() -> JSPromise { @@ -45,6 +45,6 @@ public class BackgroundFetchManager: JSBridgedClass { @inlinable public func getIds() async throws -> [String] { let this = jsObject let _promise: JSPromise = this[Strings.getIds].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift b/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift index 7dd27c3c..e611cbb3 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class BackgroundFetchOptions: BridgedDictionary { public convenience init(downloadTotal: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.downloadTotal] = downloadTotal.jsValue() + object[Strings.downloadTotal] = downloadTotal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift index 39b2db1a..25c25d71 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift @@ -55,30 +55,30 @@ public class BackgroundFetchRegistration: EventTarget { @inlinable public func abort() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @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()! + 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: CacheQueryOptions? = nil) async throws -> BackgroundFetchRecord { let this = jsObject - let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + 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 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()! + return this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! } @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 -> [BackgroundFetchRecord] { let this = jsObject - let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift b/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift index c3375df6..e14e7d51 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift @@ -19,5 +19,5 @@ public enum BackgroundFetchResult: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift b/Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift index 3b5d342d..54ec8cbd 100644 --- a/Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift +++ b/Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class BackgroundFetchUIOptions: BridgedDictionary { public convenience init(icons: [ImageResource], title: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.icons] = icons.jsValue() - object[Strings.title] = title.jsValue() + object[Strings.icons] = icons.jsValue + object[Strings.title] = title.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift b/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift index bc9dd520..27962a31 100644 --- a/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift +++ b/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class BackgroundSyncOptions: BridgedDictionary { public convenience init(minInterval: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.minInterval] = minInterval.jsValue() + object[Strings.minInterval] = minInterval.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BarcodeDetector.swift b/Sources/DOMKit/WebIDL/BarcodeDetector.swift index a54072d2..67318ee1 100644 --- a/Sources/DOMKit/WebIDL/BarcodeDetector.swift +++ b/Sources/DOMKit/WebIDL/BarcodeDetector.swift @@ -13,7 +13,7 @@ public class BarcodeDetector: JSBridgedClass { } @inlinable public convenience init(barcodeDetectorOptions: BarcodeDetectorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [barcodeDetectorOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [barcodeDetectorOptions?.jsValue ?? .undefined])) } @inlinable public static func getSupportedFormats() -> JSPromise { @@ -25,18 +25,18 @@ public class BarcodeDetector: JSBridgedClass { @inlinable public static func getSupportedFormats() async throws -> [BarcodeFormat] { let this = constructor let _promise: JSPromise = this[Strings.getSupportedFormats].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func detect(image: ImageBitmapSource) -> JSPromise { let this = jsObject - return this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! + return this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func detect(image: ImageBitmapSource) async throws -> [DetectedBarcode] { let this = jsObject - let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift b/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift index b75192c7..21f75e0e 100644 --- a/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift +++ b/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class BarcodeDetectorOptions: BridgedDictionary { public convenience init(formats: [BarcodeFormat]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.formats] = formats.jsValue() + object[Strings.formats] = formats.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BarcodeFormat.swift b/Sources/DOMKit/WebIDL/BarcodeFormat.swift index 2eada70f..3fda481c 100644 --- a/Sources/DOMKit/WebIDL/BarcodeFormat.swift +++ b/Sources/DOMKit/WebIDL/BarcodeFormat.swift @@ -30,5 +30,5 @@ public enum BarcodeFormat: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/BaseAudioContext.swift b/Sources/DOMKit/WebIDL/BaseAudioContext.swift index 7c0feb1b..4b1e6b88 100644 --- a/Sources/DOMKit/WebIDL/BaseAudioContext.swift +++ b/Sources/DOMKit/WebIDL/BaseAudioContext.swift @@ -50,7 +50,7 @@ public class BaseAudioContext: EventTarget { @inlinable public func createBuffer(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) -> AudioBuffer { let this = jsObject - return this[Strings.createBuffer].function!(this: this, arguments: [numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue()]).fromJSValue()! + return this[Strings.createBuffer].function!(this: this, arguments: [numberOfChannels.jsValue, length.jsValue, sampleRate.jsValue]).fromJSValue()! } @inlinable public func createBufferSource() -> AudioBufferSourceNode { @@ -60,12 +60,12 @@ public class BaseAudioContext: EventTarget { @inlinable public func createChannelMerger(numberOfInputs: UInt32? = nil) -> ChannelMergerNode { let this = jsObject - return this[Strings.createChannelMerger].function!(this: this, arguments: [numberOfInputs?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createChannelMerger].function!(this: this, arguments: [numberOfInputs?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createChannelSplitter(numberOfOutputs: UInt32? = nil) -> ChannelSplitterNode { let this = jsObject - return this[Strings.createChannelSplitter].function!(this: this, arguments: [numberOfOutputs?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createChannelSplitter].function!(this: this, arguments: [numberOfOutputs?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createConstantSource() -> ConstantSourceNode { @@ -80,7 +80,7 @@ public class BaseAudioContext: EventTarget { @inlinable public func createDelay(maxDelayTime: Double? = nil) -> DelayNode { let this = jsObject - return this[Strings.createDelay].function!(this: this, arguments: [maxDelayTime?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createDelay].function!(this: this, arguments: [maxDelayTime?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createDynamicsCompressor() -> DynamicsCompressorNode { @@ -95,7 +95,7 @@ public class BaseAudioContext: EventTarget { @inlinable public func createIIRFilter(feedforward: [Double], feedback: [Double]) -> IIRFilterNode { let this = jsObject - return this[Strings.createIIRFilter].function!(this: this, arguments: [feedforward.jsValue(), feedback.jsValue()]).fromJSValue()! + return this[Strings.createIIRFilter].function!(this: this, arguments: [feedforward.jsValue, feedback.jsValue]).fromJSValue()! } @inlinable public func createOscillator() -> OscillatorNode { @@ -110,12 +110,12 @@ public class BaseAudioContext: EventTarget { @inlinable public func createPeriodicWave(real: [Float], imag: [Float], constraints: PeriodicWaveConstraints? = nil) -> PeriodicWave { let this = jsObject - return this[Strings.createPeriodicWave].function!(this: this, arguments: [real.jsValue(), imag.jsValue(), constraints?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createPeriodicWave].function!(this: this, arguments: [real.jsValue, imag.jsValue, constraints?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createScriptProcessor(bufferSize: UInt32? = nil, numberOfInputChannels: UInt32? = nil, numberOfOutputChannels: UInt32? = nil) -> ScriptProcessorNode { let this = jsObject - return this[Strings.createScriptProcessor].function!(this: this, arguments: [bufferSize?.jsValue() ?? .undefined, numberOfInputChannels?.jsValue() ?? .undefined, numberOfOutputChannels?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createScriptProcessor].function!(this: this, arguments: [bufferSize?.jsValue ?? .undefined, numberOfInputChannels?.jsValue ?? .undefined, numberOfOutputChannels?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createStereoPanner() -> StereoPannerNode { diff --git a/Sources/DOMKit/WebIDL/BaseComputedKeyframe.swift b/Sources/DOMKit/WebIDL/BaseComputedKeyframe.swift index 8e5499e1..3a88e7dc 100644 --- a/Sources/DOMKit/WebIDL/BaseComputedKeyframe.swift +++ b/Sources/DOMKit/WebIDL/BaseComputedKeyframe.swift @@ -6,10 +6,10 @@ import JavaScriptKit 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.offset] = offset.jsValue() - object[Strings.computedOffset] = computedOffset.jsValue() - object[Strings.easing] = easing.jsValue() - object[Strings.composite] = composite.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) } diff --git a/Sources/DOMKit/WebIDL/BaseKeyframe.swift b/Sources/DOMKit/WebIDL/BaseKeyframe.swift index 0ce61c23..74d9634a 100644 --- a/Sources/DOMKit/WebIDL/BaseKeyframe.swift +++ b/Sources/DOMKit/WebIDL/BaseKeyframe.swift @@ -6,9 +6,9 @@ import JavaScriptKit 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() + object[Strings.offset] = offset.jsValue + object[Strings.easing] = easing.jsValue + object[Strings.composite] = composite.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift b/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift index d845d6ee..9e0f1e22 100644 --- a/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift +++ b/Sources/DOMKit/WebIDL/BasePropertyIndexedKeyframe.swift @@ -6,9 +6,9 @@ import JavaScriptKit 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() + object[Strings.offset] = offset.jsValue + object[Strings.easing] = easing.jsValue + object[Strings.composite] = composite.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift index 2da8c025..f8b0274b 100644 --- a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift +++ b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift @@ -11,7 +11,7 @@ public class BeforeInstallPromptEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: EventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @inlinable public func prompt() -> JSPromise { @@ -23,6 +23,6 @@ public class BeforeInstallPromptEvent: Event { @inlinable public func prompt() async throws -> PromptResponseObject { let this = jsObject let _promise: JSPromise = this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BinaryData.swift b/Sources/DOMKit/WebIDL/BinaryData.swift index 6dbd11cb..ef1bf9bd 100644 --- a/Sources/DOMKit/WebIDL/BinaryData.swift +++ b/Sources/DOMKit/WebIDL/BinaryData.swift @@ -21,12 +21,12 @@ public enum BinaryData: JSValueCompatible, Any_BinaryData { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .arrayBuffer(arrayBuffer): - return arrayBuffer.jsValue() + return arrayBuffer.jsValue case let .arrayBufferView(arrayBufferView): - return arrayBufferView.jsValue() + return arrayBufferView.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/BinaryData_or_String.swift b/Sources/DOMKit/WebIDL/BinaryData_or_String.swift index e0e24eea..4d8fea50 100644 --- a/Sources/DOMKit/WebIDL/BinaryData_or_String.swift +++ b/Sources/DOMKit/WebIDL/BinaryData_or_String.swift @@ -21,12 +21,12 @@ public enum BinaryData_or_String: JSValueCompatible, Any_BinaryData_or_String { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .binaryData(binaryData): - return binaryData.jsValue() + return binaryData.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/BinaryType.swift b/Sources/DOMKit/WebIDL/BinaryType.swift index c54e4b25..65f46a02 100644 --- a/Sources/DOMKit/WebIDL/BinaryType.swift +++ b/Sources/DOMKit/WebIDL/BinaryType.swift @@ -18,5 +18,5 @@ public enum BinaryType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift index ae6e05e2..7c53089f 100644 --- a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift +++ b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift @@ -16,7 +16,7 @@ public class BiquadFilterNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: BiquadFilterOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadWriteAttribute @@ -36,6 +36,6 @@ public class BiquadFilterNode: AudioNode { @inlinable public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { let this = jsObject - _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()]) + _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue, magResponse.jsValue, phaseResponse.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift b/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift index 55fa7816..e00ccdb5 100644 --- a/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift +++ b/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class BiquadFilterOptions: BridgedDictionary { public convenience init(type: BiquadFilterType, Q: Float, detune: Float, frequency: Float, gain: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.Q] = Q.jsValue() - object[Strings.detune] = detune.jsValue() - object[Strings.frequency] = frequency.jsValue() - object[Strings.gain] = gain.jsValue() + object[Strings.type] = type.jsValue + object[Strings.Q] = Q.jsValue + object[Strings.detune] = detune.jsValue + object[Strings.frequency] = frequency.jsValue + object[Strings.gain] = gain.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BiquadFilterType.swift b/Sources/DOMKit/WebIDL/BiquadFilterType.swift index 1d1c987f..1a6858b8 100644 --- a/Sources/DOMKit/WebIDL/BiquadFilterType.swift +++ b/Sources/DOMKit/WebIDL/BiquadFilterType.swift @@ -24,5 +24,5 @@ public enum BiquadFilterType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/BitrateMode.swift b/Sources/DOMKit/WebIDL/BitrateMode.swift index 96f2f96f..b0001ae7 100644 --- a/Sources/DOMKit/WebIDL/BitrateMode.swift +++ b/Sources/DOMKit/WebIDL/BitrateMode.swift @@ -18,5 +18,5 @@ public enum BitrateMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index 1b87e4e3..8fd4dbcd 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -15,7 +15,7 @@ public class Blob: JSBridgedClass { } @inlinable public convenience init(blobParts: [BlobPart]? = nil, options: BlobPropertyBag? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [blobParts?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [blobParts?.jsValue ?? .undefined, options?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -26,7 +26,7 @@ public class Blob: JSBridgedClass { @inlinable public func slice(start: Int64? = nil, end: Int64? = nil, contentType: String? = nil) -> Self { let this = jsObject - return this[Strings.slice].function!(this: this, arguments: [start?.jsValue() ?? .undefined, end?.jsValue() ?? .undefined, contentType?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.slice].function!(this: this, arguments: [start?.jsValue ?? .undefined, end?.jsValue ?? .undefined, contentType?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func stream() -> ReadableStream { @@ -43,7 +43,7 @@ public class Blob: JSBridgedClass { @inlinable public func text() async throws -> String { let this = jsObject let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func arrayBuffer() -> JSPromise { @@ -55,6 +55,6 @@ public class Blob: JSBridgedClass { @inlinable public func arrayBuffer() async throws -> ArrayBuffer { let this = jsObject let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BlobEvent.swift b/Sources/DOMKit/WebIDL/BlobEvent.swift index ab84bddc..2f09f782 100644 --- a/Sources/DOMKit/WebIDL/BlobEvent.swift +++ b/Sources/DOMKit/WebIDL/BlobEvent.swift @@ -13,7 +13,7 @@ public class BlobEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: BlobEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/BlobEventInit.swift b/Sources/DOMKit/WebIDL/BlobEventInit.swift index 75ca5918..adb0fd32 100644 --- a/Sources/DOMKit/WebIDL/BlobEventInit.swift +++ b/Sources/DOMKit/WebIDL/BlobEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit 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() + object[Strings.data] = data.jsValue + object[Strings.timecode] = timecode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BlobPart.swift b/Sources/DOMKit/WebIDL/BlobPart.swift index dd024e64..a3491bb5 100644 --- a/Sources/DOMKit/WebIDL/BlobPart.swift +++ b/Sources/DOMKit/WebIDL/BlobPart.swift @@ -26,14 +26,14 @@ public enum BlobPart: JSValueCompatible, Any_BlobPart { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .blob(blob): - return blob.jsValue() + return blob.jsValue case let .bufferSource(bufferSource): - return bufferSource.jsValue() + return bufferSource.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift index 3e7513f2..3db421ff 100644 --- a/Sources/DOMKit/WebIDL/BlobPropertyBag.swift +++ b/Sources/DOMKit/WebIDL/BlobPropertyBag.swift @@ -6,8 +6,8 @@ import JavaScriptKit 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() + object[Strings.type] = type.jsValue + object[Strings.endings] = endings.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift b/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift index b6d992f9..ad90e925 100644 --- a/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift +++ b/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift @@ -21,12 +21,12 @@ public enum Blob_or_MediaSource: JSValueCompatible, Any_Blob_or_MediaSource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .blob(blob): - return blob.jsValue() + return blob.jsValue case let .mediaSource(mediaSource): - return mediaSource.jsValue() + return mediaSource.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/BlockFragmentationType.swift b/Sources/DOMKit/WebIDL/BlockFragmentationType.swift index 577f34db..6404399c 100644 --- a/Sources/DOMKit/WebIDL/BlockFragmentationType.swift +++ b/Sources/DOMKit/WebIDL/BlockFragmentationType.swift @@ -20,5 +20,5 @@ public enum BlockFragmentationType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Bluetooth.swift b/Sources/DOMKit/WebIDL/Bluetooth.swift index 49ac3400..c7e517d6 100644 --- a/Sources/DOMKit/WebIDL/Bluetooth.swift +++ b/Sources/DOMKit/WebIDL/Bluetooth.swift @@ -21,7 +21,7 @@ public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, Characteristi @inlinable public func getAvailability() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ClosureAttribute1Optional @@ -39,18 +39,18 @@ public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, Characteristi @inlinable public func getDevices() async throws -> [BluetoothDevice] { let this = jsObject let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func requestDevice(options: RequestDeviceOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestDevice(options: RequestDeviceOptions? = nil) async throws -> BluetoothDevice { let this = jsObject - let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift index 253add24..c81962bf 100644 --- a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift +++ b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift @@ -19,7 +19,7 @@ public class BluetoothAdvertisingEvent: Event { } @inlinable public convenience init(type: String, init: BluetoothAdvertisingEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), `init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, `init`.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift index 46df3b2f..33d9febc 100644 --- a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift +++ b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift @@ -6,14 +6,14 @@ import JavaScriptKit public class BluetoothAdvertisingEventInit: BridgedDictionary { public convenience init(device: BluetoothDevice, uuids: [String_or_UInt32], name: String, appearance: UInt16, txPower: Int8, rssi: Int8, manufacturerData: BluetoothManufacturerDataMap, serviceData: BluetoothServiceDataMap) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue() - object[Strings.uuids] = uuids.jsValue() - object[Strings.name] = name.jsValue() - object[Strings.appearance] = appearance.jsValue() - object[Strings.txPower] = txPower.jsValue() - object[Strings.rssi] = rssi.jsValue() - object[Strings.manufacturerData] = manufacturerData.jsValue() - object[Strings.serviceData] = serviceData.jsValue() + object[Strings.device] = device.jsValue + object[Strings.uuids] = uuids.jsValue + object[Strings.name] = name.jsValue + object[Strings.appearance] = appearance.jsValue + object[Strings.txPower] = txPower.jsValue + object[Strings.rssi] = rssi.jsValue + object[Strings.manufacturerData] = manufacturerData.jsValue + object[Strings.serviceData] = serviceData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift index 4fe801a8..20ed4bc2 100644 --- a/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift +++ b/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class BluetoothDataFilterInit: BridgedDictionary { public convenience init(dataPrefix: BufferSource, mask: BufferSource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataPrefix] = dataPrefix.jsValue() - object[Strings.mask] = mask.jsValue() + object[Strings.dataPrefix] = dataPrefix.jsValue + object[Strings.mask] = mask.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BluetoothDevice.swift b/Sources/DOMKit/WebIDL/BluetoothDevice.swift index 227ee7fc..9499eed8 100644 --- a/Sources/DOMKit/WebIDL/BluetoothDevice.swift +++ b/Sources/DOMKit/WebIDL/BluetoothDevice.swift @@ -25,14 +25,14 @@ public class BluetoothDevice: EventTarget, BluetoothDeviceEventHandlers, Charact @inlinable public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift index e0080b87..50ec6679 100644 --- a/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift +++ b/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class BluetoothLEScanFilterInit: BridgedDictionary { public convenience init(services: [BluetoothServiceUUID], name: String, namePrefix: String, manufacturerData: [BluetoothManufacturerDataFilterInit], serviceData: [BluetoothServiceDataFilterInit]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.services] = services.jsValue() - object[Strings.name] = name.jsValue() - object[Strings.namePrefix] = namePrefix.jsValue() - object[Strings.manufacturerData] = manufacturerData.jsValue() - object[Strings.serviceData] = serviceData.jsValue() + object[Strings.services] = services.jsValue + object[Strings.name] = name.jsValue + object[Strings.namePrefix] = namePrefix.jsValue + object[Strings.manufacturerData] = manufacturerData.jsValue + object[Strings.serviceData] = serviceData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift index c564d0bd..11530424 100644 --- a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift +++ b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class BluetoothManufacturerDataFilterInit: BridgedDictionary { public convenience init(companyIdentifier: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.companyIdentifier] = companyIdentifier.jsValue() + object[Strings.companyIdentifier] = companyIdentifier.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift index a10858c0..d0c309e8 100644 --- a/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class BluetoothPermissionDescriptor: BridgedDictionary { public convenience init(deviceId: String, filters: [BluetoothLEScanFilterInit], optionalServices: [BluetoothServiceUUID], optionalManufacturerData: [UInt16], acceptAllDevices: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.deviceId] = deviceId.jsValue() - object[Strings.filters] = filters.jsValue() - object[Strings.optionalServices] = optionalServices.jsValue() - object[Strings.optionalManufacturerData] = optionalManufacturerData.jsValue() - object[Strings.acceptAllDevices] = acceptAllDevices.jsValue() + object[Strings.deviceId] = deviceId.jsValue + object[Strings.filters] = filters.jsValue + object[Strings.optionalServices] = optionalServices.jsValue + object[Strings.optionalManufacturerData] = optionalManufacturerData.jsValue + object[Strings.acceptAllDevices] = acceptAllDevices.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift b/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift index 0bfbeeb2..4b909682 100644 --- a/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift +++ b/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class BluetoothPermissionStorage: BridgedDictionary { public convenience init(allowedDevices: [AllowedBluetoothDevice]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowedDevices] = allowedDevices.jsValue() + object[Strings.allowedDevices] = allowedDevices.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift index c08322cb..4c5d982b 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift @@ -28,26 +28,26 @@ public class BluetoothRemoteGATTCharacteristic: EventTarget, CharacteristicEvent @inlinable public func getDescriptor(descriptor: BluetoothDescriptorUUID) -> JSPromise { let this = jsObject - return this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getDescriptor(descriptor: BluetoothDescriptorUUID) async throws -> BluetoothRemoteGATTDescriptor { let this = jsObject - let _promise: JSPromise = this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) -> JSPromise { let this = jsObject - return this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) async throws -> [BluetoothRemoteGATTDescriptor] { let this = jsObject - let _promise: JSPromise = this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func readValue() -> JSPromise { @@ -59,43 +59,43 @@ public class BluetoothRemoteGATTCharacteristic: EventTarget, CharacteristicEvent @inlinable public func readValue() async throws -> DataView { let this = jsObject let _promise: JSPromise = this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func writeValue(value: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func writeValue(value: BufferSource) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func writeValueWithResponse(value: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func writeValueWithResponse(value: BufferSource) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func writeValueWithoutResponse(value: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func writeValueWithoutResponse(value: BufferSource) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func startNotifications() -> JSPromise { @@ -107,7 +107,7 @@ public class BluetoothRemoteGATTCharacteristic: EventTarget, CharacteristicEvent @inlinable public func startNotifications() async throws -> BluetoothRemoteGATTCharacteristic { let this = jsObject let _promise: JSPromise = this[Strings.startNotifications].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func stopNotifications() -> JSPromise { @@ -119,6 +119,6 @@ public class BluetoothRemoteGATTCharacteristic: EventTarget, CharacteristicEvent @inlinable public func stopNotifications() async throws -> BluetoothRemoteGATTCharacteristic { let this = jsObject let _promise: JSPromise = this[Strings.stopNotifications].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift index 212582dc..0593dc55 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift @@ -33,18 +33,18 @@ public class BluetoothRemoteGATTDescriptor: JSBridgedClass { @inlinable public func readValue() async throws -> DataView { let this = jsObject let _promise: JSPromise = this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func writeValue(value: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func writeValue(value: BufferSource) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift index 3572b00a..f09921d0 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift @@ -29,7 +29,7 @@ public class BluetoothRemoteGATTServer: JSBridgedClass { @inlinable public func connect() async throws -> BluetoothRemoteGATTServer { let this = jsObject let _promise: JSPromise = this[Strings.connect].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func disconnect() { @@ -39,25 +39,25 @@ public class BluetoothRemoteGATTServer: JSBridgedClass { @inlinable public func getPrimaryService(service: BluetoothServiceUUID) -> JSPromise { let this = jsObject - return this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! + return this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getPrimaryService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { let this = jsObject - let _promise: JSPromise = this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getPrimaryServices(service: BluetoothServiceUUID? = nil) -> JSPromise { let this = jsObject - return this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getPrimaryServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { let this = jsObject - let _promise: JSPromise = this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift index dc7a74c0..21a49cb0 100644 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift +++ b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift @@ -24,49 +24,49 @@ public class BluetoothRemoteGATTService: EventTarget, CharacteristicEventHandler @inlinable public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) -> JSPromise { let this = jsObject - return this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue()]).fromJSValue()! + return this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) async throws -> BluetoothRemoteGATTCharacteristic { let this = jsObject - let _promise: JSPromise = this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) -> JSPromise { let this = jsObject - return this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) async throws -> [BluetoothRemoteGATTCharacteristic] { let this = jsObject - let _promise: JSPromise = this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getIncludedService(service: BluetoothServiceUUID) -> JSPromise { let this = jsObject - return this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! + return this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getIncludedService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { let this = jsObject - let _promise: JSPromise = this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getIncludedServices(service: BluetoothServiceUUID? = nil) -> JSPromise { let this = jsObject - return this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getIncludedServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { let this = jsObject - let _promise: JSPromise = this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift index f034d096..3c2fd057 100644 --- a/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift +++ b/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class BluetoothServiceDataFilterInit: BridgedDictionary { public convenience init(service: BluetoothServiceUUID) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.service] = service.jsValue() + object[Strings.service] = service.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift b/Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift index 8a4b23fc..a23eb27c 100644 --- a/Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift +++ b/Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift @@ -21,12 +21,12 @@ public enum BluetoothServiceUUID: JSValueCompatible, Any_BluetoothServiceUUID { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .string(string): - return string.jsValue() + return string.jsValue case let .uInt32(uInt32): - return uInt32.jsValue() + return uInt32.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/BluetoothUUID.swift b/Sources/DOMKit/WebIDL/BluetoothUUID.swift index 2e32e17f..abf8a122 100644 --- a/Sources/DOMKit/WebIDL/BluetoothUUID.swift +++ b/Sources/DOMKit/WebIDL/BluetoothUUID.swift @@ -14,21 +14,21 @@ public class BluetoothUUID: JSBridgedClass { @inlinable public static func getService(name: String_or_UInt32) -> UUID { let this = constructor - return this[Strings.getService].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.getService].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public static func getCharacteristic(name: String_or_UInt32) -> UUID { let this = constructor - return this[Strings.getCharacteristic].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.getCharacteristic].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public static func getDescriptor(name: String_or_UInt32) -> UUID { let this = constructor - return this[Strings.getDescriptor].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.getDescriptor].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public static func canonicalUUID(alias: UInt32) -> UUID { let this = constructor - return this[Strings.canonicalUUID].function!(this: this, arguments: [alias.jsValue()]).fromJSValue()! + return this[Strings.canonicalUUID].function!(this: this, arguments: [alias.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Body.swift b/Sources/DOMKit/WebIDL/Body.swift index 34d41949..758f2fba 100644 --- a/Sources/DOMKit/WebIDL/Body.swift +++ b/Sources/DOMKit/WebIDL/Body.swift @@ -18,7 +18,7 @@ public extension Body { @inlinable func arrayBuffer() async throws -> ArrayBuffer { let this = jsObject let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable func blob() -> JSPromise { @@ -30,7 +30,7 @@ public extension Body { @inlinable func blob() async throws -> Blob { let this = jsObject let _promise: JSPromise = this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable func formData() -> JSPromise { @@ -42,7 +42,7 @@ public extension Body { @inlinable func formData() async throws -> FormData { let this = jsObject let _promise: JSPromise = this[Strings.formData].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable func json() -> JSPromise { @@ -54,7 +54,7 @@ public extension Body { @inlinable func json() async throws -> JSValue { let this = jsObject let _promise: JSPromise = this[Strings.json].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable func text() -> JSPromise { @@ -66,6 +66,6 @@ public extension Body { @inlinable func text() async throws -> String { let this = jsObject let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/BodyInit.swift b/Sources/DOMKit/WebIDL/BodyInit.swift index bda9c14e..3bafaba6 100644 --- a/Sources/DOMKit/WebIDL/BodyInit.swift +++ b/Sources/DOMKit/WebIDL/BodyInit.swift @@ -21,12 +21,12 @@ public enum BodyInit: JSValueCompatible, Any_BodyInit { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .readableStream(readableStream): - return readableStream.jsValue() + return readableStream.jsValue case let .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit): - return xMLHttpRequestBodyInit.jsValue() + return xMLHttpRequestBodyInit.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift b/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift index e039f190..51b747bb 100644 --- a/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift +++ b/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift @@ -21,12 +21,12 @@ public enum Bool_or_ConstrainDouble: JSValueCompatible, Any_Bool_or_ConstrainDou return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .bool(bool): - return bool.jsValue() + return bool.jsValue case let .constrainDouble(constrainDouble): - return constrainDouble.jsValue() + return constrainDouble.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift b/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift index 353718df..f2f7e943 100644 --- a/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift +++ b/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift @@ -21,12 +21,12 @@ public enum Bool_or_MediaTrackConstraints: JSValueCompatible, Any_Bool_or_MediaT return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .bool(bool): - return bool.jsValue() + return bool.jsValue case let .mediaTrackConstraints(mediaTrackConstraints): - return mediaTrackConstraints.jsValue() + return mediaTrackConstraints.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift b/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift index 1c21017f..cc28a195 100644 --- a/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift +++ b/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift @@ -21,12 +21,12 @@ public enum Bool_or_ScrollIntoViewOptions: JSValueCompatible, Any_Bool_or_Scroll return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .bool(bool): - return bool.jsValue() + return bool.jsValue case let .scrollIntoViewOptions(scrollIntoViewOptions): - return scrollIntoViewOptions.jsValue() + return scrollIntoViewOptions.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/BoxQuadOptions.swift b/Sources/DOMKit/WebIDL/BoxQuadOptions.swift index 8e766079..9c68f521 100644 --- a/Sources/DOMKit/WebIDL/BoxQuadOptions.swift +++ b/Sources/DOMKit/WebIDL/BoxQuadOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class BoxQuadOptions: BridgedDictionary { public convenience init(box: CSSBoxType, relativeTo: GeometryNode) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.box] = box.jsValue() - object[Strings.relativeTo] = relativeTo.jsValue() + object[Strings.box] = box.jsValue + object[Strings.relativeTo] = relativeTo.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/BreakType.swift b/Sources/DOMKit/WebIDL/BreakType.swift index 9a1cdebc..98dc5bf4 100644 --- a/Sources/DOMKit/WebIDL/BreakType.swift +++ b/Sources/DOMKit/WebIDL/BreakType.swift @@ -21,5 +21,5 @@ public enum BreakType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/BroadcastChannel.swift b/Sources/DOMKit/WebIDL/BroadcastChannel.swift index 6cc3f433..fcec4d0d 100644 --- a/Sources/DOMKit/WebIDL/BroadcastChannel.swift +++ b/Sources/DOMKit/WebIDL/BroadcastChannel.swift @@ -14,7 +14,7 @@ public class BroadcastChannel: EventTarget { } @inlinable public convenience init(name: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue])) } @ReadonlyAttribute @@ -22,7 +22,7 @@ public class BroadcastChannel: EventTarget { @inlinable public func postMessage(message: JSValue) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue()]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue]) } @inlinable public func close() { diff --git a/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift b/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift index 54af6c54..fefb8a22 100644 --- a/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift @@ -12,14 +12,14 @@ public class BrowserCaptureMediaStreamTrack: MediaStreamTrack { @inlinable public func cropTo(cropTarget: CropTarget?) -> JSPromise { let this = jsObject - return this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue()]).fromJSValue()! + return this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func cropTo(cropTarget: CropTarget?) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable override public func clone() -> Self { diff --git a/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift b/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift index 9897f2d7..ac3273b2 100644 --- a/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift +++ b/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift @@ -21,12 +21,12 @@ public enum BufferSource_or_JsonWebKey: JSValueCompatible, Any_BufferSource_or_J return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .bufferSource(bufferSource): - return bufferSource.jsValue() + return bufferSource.jsValue case let .jsonWebKey(jsonWebKey): - return jsonWebKey.jsValue() + return jsonWebKey.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift index eff373f0..480f696d 100644 --- a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift @@ -15,7 +15,7 @@ public class ByteLengthQueuingStrategy: JSBridgedClass { } @inlinable public convenience init(init: QueuingStrategyInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index 7053ed14..d88c65fb 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -12,12 +12,12 @@ public enum CSS { @inlinable public static func supports(property: String, value: String) -> Bool { let this = JSObject.global[Strings.CSS].object! - return this[Strings.supports].function!(this: this, arguments: [property.jsValue(), value.jsValue()]).fromJSValue()! + return this[Strings.supports].function!(this: this, arguments: [property.jsValue, value.jsValue]).fromJSValue()! } @inlinable public static func supports(conditionText: String) -> Bool { let this = JSObject.global[Strings.CSS].object! - return this[Strings.supports].function!(this: this, arguments: [conditionText.jsValue()]).fromJSValue()! + return this[Strings.supports].function!(this: this, arguments: [conditionText.jsValue]).fromJSValue()! } @inlinable public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } @@ -30,369 +30,369 @@ public enum CSS { @inlinable public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { let this = JSObject.global[Strings.CSS].object! - let _promise: JSPromise = this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { let this = JSObject.global[Strings.CSS].object! - let _promise: JSPromise = this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseRule].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.parseRule].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> CSSParserRule { let this = JSObject.global[Strings.CSS].object! - let _promise: JSPromise = this[Strings.parseRule].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.parseRule].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { let this = JSObject.global[Strings.CSS].object! - let _promise: JSPromise = this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public static func parseDeclaration(css: String, options: CSSParserOptions? = nil) -> CSSParserDeclaration { let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseDeclaration].function!(this: this, arguments: [css.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.parseDeclaration].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public static func parseValue(css: String) -> CSSToken { let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseValue].function!(this: this, arguments: [css.jsValue()]).fromJSValue()! + return this[Strings.parseValue].function!(this: this, arguments: [css.jsValue]).fromJSValue()! } @inlinable public static func parseValueList(css: String) -> [CSSToken] { let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseValueList].function!(this: this, arguments: [css.jsValue()]).fromJSValue()! + return this[Strings.parseValueList].function!(this: this, arguments: [css.jsValue]).fromJSValue()! } @inlinable public static func parseCommaValueList(css: String) -> [[CSSToken]] { let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseCommaValueList].function!(this: this, arguments: [css.jsValue()]).fromJSValue()! + return this[Strings.parseCommaValueList].function!(this: this, arguments: [css.jsValue]).fromJSValue()! } @inlinable public static func registerProperty(definition: PropertyDefinition) { let this = JSObject.global[Strings.CSS].object! - _ = this[Strings.registerProperty].function!(this: this, arguments: [definition.jsValue()]) + _ = this[Strings.registerProperty].function!(this: this, arguments: [definition.jsValue]) } @inlinable public static func number(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.number].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.number].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func percent(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.percent].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.percent].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func em(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.em].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.em].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func ex(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.ex].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.ex].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func ch(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.ch].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.ch].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func ic(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.ic].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.ic].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func rem(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.rem].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.rem].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func lh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.lh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.lh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func rlh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.rlh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.rlh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func vw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.vw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.vw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func vh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.vh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.vh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func vi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.vi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.vi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func vb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.vb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.vb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func vmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.vmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.vmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func vmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.vmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.vmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func svw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.svw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.svw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func svh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.svh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.svh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func svi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.svi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.svi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func svb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.svb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.svb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func svmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.svmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.svmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func svmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.svmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.svmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func lvw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.lvw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func lvh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.lvh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func lvi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.lvi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func lvb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.lvb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func lvmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.lvmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func lvmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.lvmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func dvw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.dvw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func dvh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.dvh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func dvi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.dvi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func dvb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.dvb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func dvmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.dvmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func dvmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.dvmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func cqw(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqw].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.cqw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func cqh(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqh].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.cqh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func cqi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.cqi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func cqb(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqb].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.cqb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func cqmin(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqmin].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.cqmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func cqmax(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqmax].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.cqmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func cm(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.cm].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.cm].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func mm(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.mm].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.mm].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func Q(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.Q].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.Q].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func `in`(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.in].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.in].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func pt(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.pt].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.pt].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func pc(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.pc].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.pc].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func px(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.px].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.px].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func deg(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.deg].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.deg].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func grad(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.grad].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.grad].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func rad(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.rad].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.rad].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func turn(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.turn].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.turn].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func s(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.s].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.s].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func ms(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.ms].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.ms].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func Hz(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.Hz].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.Hz].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func kHz(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.kHz].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.kHz].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func dpi(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.dpi].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.dpi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func dpcm(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.dpcm].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.dpcm].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func dppx(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.dppx].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.dppx].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func fr(value: Double) -> CSSUnitValue { let this = JSObject.global[Strings.CSS].object! - return this[Strings.fr].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.fr].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func escape(ident: String) -> String { let this = JSObject.global[Strings.CSS].object! - return this[Strings.escape].function!(this: this, arguments: [ident.jsValue()]).fromJSValue()! + return this[Strings.escape].function!(this: this, arguments: [ident.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSBoxType.swift b/Sources/DOMKit/WebIDL/CSSBoxType.swift index fc284b44..55fb3a91 100644 --- a/Sources/DOMKit/WebIDL/CSSBoxType.swift +++ b/Sources/DOMKit/WebIDL/CSSBoxType.swift @@ -20,5 +20,5 @@ public enum CSSBoxType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CSSColor.swift b/Sources/DOMKit/WebIDL/CSSColor.swift index 09ada61a..3b564e7b 100644 --- a/Sources/DOMKit/WebIDL/CSSColor.swift +++ b/Sources/DOMKit/WebIDL/CSSColor.swift @@ -13,7 +13,7 @@ public class CSSColor: CSSColorValue { } @inlinable public convenience init(colorSpace: CSSKeywordish, channels: [CSSColorPercent], alpha: CSSNumberish? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [colorSpace.jsValue(), channels.jsValue(), alpha?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [colorSpace.jsValue, channels.jsValue, alpha?.jsValue ?? .undefined])) } // XXX: member 'colorSpace' is ignored diff --git a/Sources/DOMKit/WebIDL/CSSColorRGBComp.swift b/Sources/DOMKit/WebIDL/CSSColorRGBComp.swift index 771e17c5..e034ce14 100644 --- a/Sources/DOMKit/WebIDL/CSSColorRGBComp.swift +++ b/Sources/DOMKit/WebIDL/CSSColorRGBComp.swift @@ -21,12 +21,12 @@ public enum CSSColorRGBComp: JSValueCompatible, Any_CSSColorRGBComp { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSKeywordish(cSSKeywordish): - return cSSKeywordish.jsValue() + return cSSKeywordish.jsValue case let .cSSNumberish(cSSNumberish): - return cSSNumberish.jsValue() + return cSSNumberish.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSColorValue.swift b/Sources/DOMKit/WebIDL/CSSColorValue.swift index 2d71a25e..b1768da6 100644 --- a/Sources/DOMKit/WebIDL/CSSColorValue.swift +++ b/Sources/DOMKit/WebIDL/CSSColorValue.swift @@ -16,7 +16,7 @@ public class CSSColorValue: CSSStyleValue { @inlinable public func to(colorSpace: CSSKeywordish) -> Self { let this = jsObject - return this[Strings.to].function!(this: this, arguments: [colorSpace.jsValue()]).fromJSValue()! + return this[Strings.to].function!(this: this, arguments: [colorSpace.jsValue]).fromJSValue()! } // XXX: illegal static override diff --git a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift index 7b524556..2339163c 100644 --- a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift +++ b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift @@ -16,6 +16,6 @@ public class CSSFontFeatureValuesMap: JSBridgedClass { @inlinable public func set(featureValueName: String, values: UInt32_or_seq_of_UInt32) { let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [featureValueName.jsValue(), values.jsValue()]) + _ = this[Strings.set].function!(this: this, arguments: [featureValueName.jsValue, values.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift index b852fb67..6a90100c 100644 --- a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift @@ -16,11 +16,11 @@ public class CSSGroupingRule: CSSRule { @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { let this = jsObject - return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue, index?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteRule(index: UInt32) { let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/CSSHSL.swift b/Sources/DOMKit/WebIDL/CSSHSL.swift index 24da7747..b7661df2 100644 --- a/Sources/DOMKit/WebIDL/CSSHSL.swift +++ b/Sources/DOMKit/WebIDL/CSSHSL.swift @@ -15,7 +15,7 @@ public class CSSHSL: CSSColorValue { } @inlinable public convenience init(h: CSSColorAngle, s: CSSColorPercent, l: CSSColorPercent, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue(), s.jsValue(), l.jsValue(), alpha?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue, s.jsValue, l.jsValue, alpha?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSHWB.swift b/Sources/DOMKit/WebIDL/CSSHWB.swift index 8d7da682..3d7285e5 100644 --- a/Sources/DOMKit/WebIDL/CSSHWB.swift +++ b/Sources/DOMKit/WebIDL/CSSHWB.swift @@ -15,7 +15,7 @@ public class CSSHWB: CSSColorValue { } @inlinable public convenience init(h: CSSNumericValue, w: CSSNumberish, b: CSSNumberish, alpha: CSSNumberish? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue(), w.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue, w.jsValue, b.jsValue, alpha?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift b/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift index e568e972..0d11b4ef 100644 --- a/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift +++ b/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift @@ -20,16 +20,16 @@ public class CSSKeyframesRule: CSSRule { @inlinable public func appendRule(rule: String) { let this = jsObject - _ = this[Strings.appendRule].function!(this: this, arguments: [rule.jsValue()]) + _ = this[Strings.appendRule].function!(this: this, arguments: [rule.jsValue]) } @inlinable public func deleteRule(select: String) { let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [select.jsValue()]) + _ = this[Strings.deleteRule].function!(this: this, arguments: [select.jsValue]) } @inlinable public func findRule(select: String) -> CSSKeyframeRule? { let this = jsObject - return this[Strings.findRule].function!(this: this, arguments: [select.jsValue()]).fromJSValue()! + return this[Strings.findRule].function!(this: this, arguments: [select.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSKeywordValue.swift b/Sources/DOMKit/WebIDL/CSSKeywordValue.swift index 3f667a37..7666c104 100644 --- a/Sources/DOMKit/WebIDL/CSSKeywordValue.swift +++ b/Sources/DOMKit/WebIDL/CSSKeywordValue.swift @@ -12,7 +12,7 @@ public class CSSKeywordValue: CSSStyleValue { } @inlinable public convenience init(value: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSKeywordish.swift b/Sources/DOMKit/WebIDL/CSSKeywordish.swift index bf28f712..cc9003c3 100644 --- a/Sources/DOMKit/WebIDL/CSSKeywordish.swift +++ b/Sources/DOMKit/WebIDL/CSSKeywordish.swift @@ -21,12 +21,12 @@ public enum CSSKeywordish: JSValueCompatible, Any_CSSKeywordish { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSKeywordValue(cSSKeywordValue): - return cSSKeywordValue.jsValue() + return cSSKeywordValue.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSLCH.swift b/Sources/DOMKit/WebIDL/CSSLCH.swift index 830e0b59..de3b356b 100644 --- a/Sources/DOMKit/WebIDL/CSSLCH.swift +++ b/Sources/DOMKit/WebIDL/CSSLCH.swift @@ -15,7 +15,7 @@ public class CSSLCH: CSSColorValue { } @inlinable public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue, c.jsValue, h.jsValue, alpha?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSLab.swift b/Sources/DOMKit/WebIDL/CSSLab.swift index 2599486e..5528d8d7 100644 --- a/Sources/DOMKit/WebIDL/CSSLab.swift +++ b/Sources/DOMKit/WebIDL/CSSLab.swift @@ -15,7 +15,7 @@ public class CSSLab: CSSColorValue { } @inlinable public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue, a.jsValue, b.jsValue, alpha?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathClamp.swift b/Sources/DOMKit/WebIDL/CSSMathClamp.swift index a12a31cd..401fde91 100644 --- a/Sources/DOMKit/WebIDL/CSSMathClamp.swift +++ b/Sources/DOMKit/WebIDL/CSSMathClamp.swift @@ -14,7 +14,7 @@ public class CSSMathClamp: CSSMathValue { } @inlinable public convenience init(lower: CSSNumberish, value: CSSNumberish, upper: CSSNumberish) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [lower.jsValue(), value.jsValue(), upper.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [lower.jsValue, value.jsValue, upper.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathInvert.swift b/Sources/DOMKit/WebIDL/CSSMathInvert.swift index ca4e06f4..1b89c49b 100644 --- a/Sources/DOMKit/WebIDL/CSSMathInvert.swift +++ b/Sources/DOMKit/WebIDL/CSSMathInvert.swift @@ -12,7 +12,7 @@ public class CSSMathInvert: CSSMathValue { } @inlinable public convenience init(arg: CSSNumberish) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathMax.swift b/Sources/DOMKit/WebIDL/CSSMathMax.swift index 0698147b..20eb8b5a 100644 --- a/Sources/DOMKit/WebIDL/CSSMathMax.swift +++ b/Sources/DOMKit/WebIDL/CSSMathMax.swift @@ -12,7 +12,7 @@ public class CSSMathMax: CSSMathValue { } @inlinable public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) + self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map(\.jsValue))) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathMin.swift b/Sources/DOMKit/WebIDL/CSSMathMin.swift index afd4d10f..997ccf6f 100644 --- a/Sources/DOMKit/WebIDL/CSSMathMin.swift +++ b/Sources/DOMKit/WebIDL/CSSMathMin.swift @@ -12,7 +12,7 @@ public class CSSMathMin: CSSMathValue { } @inlinable public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) + self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map(\.jsValue))) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathNegate.swift b/Sources/DOMKit/WebIDL/CSSMathNegate.swift index 0bf9b49a..ec261282 100644 --- a/Sources/DOMKit/WebIDL/CSSMathNegate.swift +++ b/Sources/DOMKit/WebIDL/CSSMathNegate.swift @@ -12,7 +12,7 @@ public class CSSMathNegate: CSSMathValue { } @inlinable public convenience init(arg: CSSNumberish) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathOperator.swift b/Sources/DOMKit/WebIDL/CSSMathOperator.swift index 461280d6..19ebc182 100644 --- a/Sources/DOMKit/WebIDL/CSSMathOperator.swift +++ b/Sources/DOMKit/WebIDL/CSSMathOperator.swift @@ -23,5 +23,5 @@ public enum CSSMathOperator: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CSSMathProduct.swift b/Sources/DOMKit/WebIDL/CSSMathProduct.swift index 72fc5257..a73c2dca 100644 --- a/Sources/DOMKit/WebIDL/CSSMathProduct.swift +++ b/Sources/DOMKit/WebIDL/CSSMathProduct.swift @@ -12,7 +12,7 @@ public class CSSMathProduct: CSSMathValue { } @inlinable public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) + self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map(\.jsValue))) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMathSum.swift b/Sources/DOMKit/WebIDL/CSSMathSum.swift index 0d41a262..a35c6521 100644 --- a/Sources/DOMKit/WebIDL/CSSMathSum.swift +++ b/Sources/DOMKit/WebIDL/CSSMathSum.swift @@ -12,7 +12,7 @@ public class CSSMathSum: CSSMathValue { } @inlinable public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map { $0.jsValue() })) + self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map(\.jsValue))) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift b/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift index 1fdc89ef..56af9ad8 100644 --- a/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift +++ b/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift @@ -12,7 +12,7 @@ public class CSSMatrixComponent: CSSTransformComponent { } @inlinable public convenience init(matrix: DOMMatrixReadOnly, options: CSSMatrixComponentOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [matrix.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [matrix.jsValue, options?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift b/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift index 26b76319..bf2179cc 100644 --- a/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift +++ b/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class CSSMatrixComponentOptions: BridgedDictionary { public convenience init(is2D: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.is2D] = is2D.jsValue() + object[Strings.is2D] = is2D.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CSSNestingRule.swift b/Sources/DOMKit/WebIDL/CSSNestingRule.swift index 31fe9716..c369c91e 100644 --- a/Sources/DOMKit/WebIDL/CSSNestingRule.swift +++ b/Sources/DOMKit/WebIDL/CSSNestingRule.swift @@ -24,11 +24,11 @@ public class CSSNestingRule: CSSRule { @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { let this = jsObject - return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue, index?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteRule(index: UInt32) { let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/CSSNumberish.swift b/Sources/DOMKit/WebIDL/CSSNumberish.swift index 7b7bc3c7..6ec09635 100644 --- a/Sources/DOMKit/WebIDL/CSSNumberish.swift +++ b/Sources/DOMKit/WebIDL/CSSNumberish.swift @@ -21,12 +21,12 @@ public enum CSSNumberish: JSValueCompatible, Any_CSSNumberish { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSNumericValue(cSSNumericValue): - return cSSNumericValue.jsValue() + return cSSNumericValue.jsValue case let .double(double): - return double.jsValue() + return double.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift b/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift index 3cf974e3..04717d00 100644 --- a/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift +++ b/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift @@ -23,5 +23,5 @@ public enum CSSNumericBaseType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CSSNumericType.swift b/Sources/DOMKit/WebIDL/CSSNumericType.swift index 9e263cce..804fcd7d 100644 --- a/Sources/DOMKit/WebIDL/CSSNumericType.swift +++ b/Sources/DOMKit/WebIDL/CSSNumericType.swift @@ -6,14 +6,14 @@ import JavaScriptKit public class CSSNumericType: BridgedDictionary { public convenience init(length: Int32, angle: Int32, time: Int32, frequency: Int32, resolution: Int32, flex: Int32, percent: Int32, percentHint: CSSNumericBaseType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.length] = length.jsValue() - object[Strings.angle] = angle.jsValue() - object[Strings.time] = time.jsValue() - object[Strings.frequency] = frequency.jsValue() - object[Strings.resolution] = resolution.jsValue() - object[Strings.flex] = flex.jsValue() - object[Strings.percent] = percent.jsValue() - object[Strings.percentHint] = percentHint.jsValue() + object[Strings.length] = length.jsValue + object[Strings.angle] = angle.jsValue + object[Strings.time] = time.jsValue + object[Strings.frequency] = frequency.jsValue + object[Strings.resolution] = resolution.jsValue + object[Strings.flex] = flex.jsValue + object[Strings.percent] = percent.jsValue + object[Strings.percentHint] = percentHint.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue.swift b/Sources/DOMKit/WebIDL/CSSNumericValue.swift index 33913c0c..b8ead155 100644 --- a/Sources/DOMKit/WebIDL/CSSNumericValue.swift +++ b/Sources/DOMKit/WebIDL/CSSNumericValue.swift @@ -12,47 +12,47 @@ public class CSSNumericValue: CSSStyleValue { @inlinable public func add(values: CSSNumberish...) -> Self { let this = jsObject - return this[Strings.add].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! + return this[Strings.add].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! } @inlinable public func sub(values: CSSNumberish...) -> Self { let this = jsObject - return this[Strings.sub].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! + return this[Strings.sub].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! } @inlinable public func mul(values: CSSNumberish...) -> Self { let this = jsObject - return this[Strings.mul].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! + return this[Strings.mul].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! } @inlinable public func div(values: CSSNumberish...) -> Self { let this = jsObject - return this[Strings.div].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! + return this[Strings.div].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! } @inlinable public func min(values: CSSNumberish...) -> Self { let this = jsObject - return this[Strings.min].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! + return this[Strings.min].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! } @inlinable public func max(values: CSSNumberish...) -> Self { let this = jsObject - return this[Strings.max].function!(this: this, arguments: values.map { $0.jsValue() }).fromJSValue()! + return this[Strings.max].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! } @inlinable public func equals(value: CSSNumberish...) -> Bool { let this = jsObject - return this[Strings.equals].function!(this: this, arguments: value.map { $0.jsValue() }).fromJSValue()! + return this[Strings.equals].function!(this: this, arguments: value.map(\.jsValue)).fromJSValue()! } @inlinable public func to(unit: String) -> CSSUnitValue { let this = jsObject - return this[Strings.to].function!(this: this, arguments: [unit.jsValue()]).fromJSValue()! + return this[Strings.to].function!(this: this, arguments: [unit.jsValue]).fromJSValue()! } @inlinable public func toSum(units: String...) -> CSSMathSum { let this = jsObject - return this[Strings.toSum].function!(this: this, arguments: units.map { $0.jsValue() }).fromJSValue()! + return this[Strings.toSum].function!(this: this, arguments: units.map(\.jsValue)).fromJSValue()! } @inlinable public func type() -> CSSNumericType { diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift b/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift index f5967cc5..90cb1088 100644 --- a/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift +++ b/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift @@ -26,14 +26,14 @@ public enum CSSNumericValue_or_Double_or_String: JSValueCompatible, Any_CSSNumer return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSNumericValue(cSSNumericValue): - return cSSNumericValue.jsValue() + return cSSNumericValue.jsValue case let .double(double): - return double.jsValue() + return double.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSOKLCH.swift b/Sources/DOMKit/WebIDL/CSSOKLCH.swift index 2ba372be..cedfeecf 100644 --- a/Sources/DOMKit/WebIDL/CSSOKLCH.swift +++ b/Sources/DOMKit/WebIDL/CSSOKLCH.swift @@ -15,7 +15,7 @@ public class CSSOKLCH: CSSColorValue { } @inlinable public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), c.jsValue(), h.jsValue(), alpha?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue, c.jsValue, h.jsValue, alpha?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSOKLab.swift b/Sources/DOMKit/WebIDL/CSSOKLab.swift index 50449458..220bb756 100644 --- a/Sources/DOMKit/WebIDL/CSSOKLab.swift +++ b/Sources/DOMKit/WebIDL/CSSOKLab.swift @@ -15,7 +15,7 @@ public class CSSOKLab: CSSColorValue { } @inlinable public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue(), a.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue, a.jsValue, b.jsValue, alpha?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserAtRule.swift b/Sources/DOMKit/WebIDL/CSSParserAtRule.swift index 2050a82c..9e0b8563 100644 --- a/Sources/DOMKit/WebIDL/CSSParserAtRule.swift +++ b/Sources/DOMKit/WebIDL/CSSParserAtRule.swift @@ -14,7 +14,7 @@ public class CSSParserAtRule: CSSParserRule { } @inlinable public convenience init(name: String, prelude: [CSSToken], body: [CSSParserRule]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), prelude.jsValue(), body?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue, prelude.jsValue, body?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserBlock.swift b/Sources/DOMKit/WebIDL/CSSParserBlock.swift index 152027e9..aa06b8a3 100644 --- a/Sources/DOMKit/WebIDL/CSSParserBlock.swift +++ b/Sources/DOMKit/WebIDL/CSSParserBlock.swift @@ -13,7 +13,7 @@ public class CSSParserBlock: CSSParserValue { } @inlinable public convenience init(name: String, body: [CSSParserValue]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), body.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue, body.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift b/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift index 251293a0..0478100c 100644 --- a/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift @@ -13,7 +13,7 @@ public class CSSParserDeclaration: CSSParserRule { } @inlinable public convenience init(name: String, body: [CSSParserRule]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), body?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue, body?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserFunction.swift b/Sources/DOMKit/WebIDL/CSSParserFunction.swift index 0272e5b7..f279422c 100644 --- a/Sources/DOMKit/WebIDL/CSSParserFunction.swift +++ b/Sources/DOMKit/WebIDL/CSSParserFunction.swift @@ -13,7 +13,7 @@ public class CSSParserFunction: CSSParserValue { } @inlinable public convenience init(name: String, args: [[CSSParserValue]]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue(), args.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue, args.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSParserOptions.swift b/Sources/DOMKit/WebIDL/CSSParserOptions.swift index 36fe8d79..f132424c 100644 --- a/Sources/DOMKit/WebIDL/CSSParserOptions.swift +++ b/Sources/DOMKit/WebIDL/CSSParserOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class CSSParserOptions: BridgedDictionary { public convenience init(atRules: JSObject) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.atRules] = atRules.jsValue() + object[Strings.atRules] = atRules.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift b/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift index 87a6dc40..ea7ecdf0 100644 --- a/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift +++ b/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift @@ -13,7 +13,7 @@ public class CSSParserQualifiedRule: CSSParserRule { } @inlinable public convenience init(prelude: [CSSToken], body: [CSSParserRule]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [prelude.jsValue(), body?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [prelude.jsValue, body?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSPerspective.swift b/Sources/DOMKit/WebIDL/CSSPerspective.swift index 5cea4e8b..64effa83 100644 --- a/Sources/DOMKit/WebIDL/CSSPerspective.swift +++ b/Sources/DOMKit/WebIDL/CSSPerspective.swift @@ -12,7 +12,7 @@ public class CSSPerspective: CSSTransformComponent { } @inlinable public convenience init(length: CSSPerspectiveValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [length.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [length.jsValue])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift b/Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift index 9c1ec9b6..d55ec10d 100644 --- a/Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift +++ b/Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift @@ -21,12 +21,12 @@ public enum CSSPerspectiveValue: JSValueCompatible, Any_CSSPerspectiveValue { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSKeywordish(cSSKeywordish): - return cSSKeywordish.jsValue() + return cSSKeywordish.jsValue case let .cSSNumericValue(cSSNumericValue): - return cSSNumericValue.jsValue() + return cSSNumericValue.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift index 87185992..29314d8d 100644 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift @@ -24,6 +24,6 @@ public class CSSPseudoElement: EventTarget, GeometryUtils { @inlinable public func pseudo(type: String) -> CSSPseudoElement? { let this = jsObject - return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift index a0c6cb5e..4c394a50 100644 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift @@ -21,12 +21,12 @@ public enum CSSPseudoElement_or_Element: JSValueCompatible, Any_CSSPseudoElement return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSPseudoElement(cSSPseudoElement): - return cSSPseudoElement.jsValue() + return cSSPseudoElement.jsValue case let .element(element): - return element.jsValue() + return element.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSRGB.swift b/Sources/DOMKit/WebIDL/CSSRGB.swift index 0f8ff205..b59b6b46 100644 --- a/Sources/DOMKit/WebIDL/CSSRGB.swift +++ b/Sources/DOMKit/WebIDL/CSSRGB.swift @@ -15,7 +15,7 @@ public class CSSRGB: CSSColorValue { } @inlinable public convenience init(r: CSSColorRGBComp, g: CSSColorRGBComp, b: CSSColorRGBComp, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [r.jsValue(), g.jsValue(), b.jsValue(), alpha?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [r.jsValue, g.jsValue, b.jsValue, alpha?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSRotate.swift b/Sources/DOMKit/WebIDL/CSSRotate.swift index 482c5781..9118a39d 100644 --- a/Sources/DOMKit/WebIDL/CSSRotate.swift +++ b/Sources/DOMKit/WebIDL/CSSRotate.swift @@ -15,11 +15,11 @@ public class CSSRotate: CSSTransformComponent { } @inlinable public convenience init(angle: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [angle.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [angle.jsValue])) } @inlinable public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish, angle: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue(), y.jsValue(), z.jsValue(), angle.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue, y.jsValue, z.jsValue, angle.jsValue])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSScale.swift b/Sources/DOMKit/WebIDL/CSSScale.swift index 99ab4f1c..c25830ff 100644 --- a/Sources/DOMKit/WebIDL/CSSScale.swift +++ b/Sources/DOMKit/WebIDL/CSSScale.swift @@ -14,7 +14,7 @@ public class CSSScale: CSSTransformComponent { } @inlinable public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue, y.jsValue, z?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSSkew.swift b/Sources/DOMKit/WebIDL/CSSSkew.swift index 1336ecde..647a799f 100644 --- a/Sources/DOMKit/WebIDL/CSSSkew.swift +++ b/Sources/DOMKit/WebIDL/CSSSkew.swift @@ -13,7 +13,7 @@ public class CSSSkew: CSSTransformComponent { } @inlinable public convenience init(ax: CSSNumericValue, ay: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue(), ay.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue, ay.jsValue])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSSkewX.swift b/Sources/DOMKit/WebIDL/CSSSkewX.swift index 733d15a0..9a6be145 100644 --- a/Sources/DOMKit/WebIDL/CSSSkewX.swift +++ b/Sources/DOMKit/WebIDL/CSSSkewX.swift @@ -12,7 +12,7 @@ public class CSSSkewX: CSSTransformComponent { } @inlinable public convenience init(ax: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSSkewY.swift b/Sources/DOMKit/WebIDL/CSSSkewY.swift index 10f4a385..df9cae99 100644 --- a/Sources/DOMKit/WebIDL/CSSSkewY.swift +++ b/Sources/DOMKit/WebIDL/CSSSkewY.swift @@ -12,7 +12,7 @@ public class CSSSkewY: CSSTransformComponent { } @inlinable public convenience init(ay: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [ay.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [ay.jsValue])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSStringSource.swift b/Sources/DOMKit/WebIDL/CSSStringSource.swift index 49e9b3cd..2b658636 100644 --- a/Sources/DOMKit/WebIDL/CSSStringSource.swift +++ b/Sources/DOMKit/WebIDL/CSSStringSource.swift @@ -21,12 +21,12 @@ public enum CSSStringSource: JSValueCompatible, Any_CSSStringSource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .readableStream(readableStream): - return readableStream.jsValue() + return readableStream.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift index 548ad66d..94b41299 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift @@ -28,22 +28,22 @@ public class CSSStyleDeclaration: JSBridgedClass { @inlinable public func getPropertyValue(property: String) -> String { let this = jsObject - return this[Strings.getPropertyValue].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! + return this[Strings.getPropertyValue].function!(this: this, arguments: [property.jsValue]).fromJSValue()! } @inlinable public func getPropertyPriority(property: String) -> String { let this = jsObject - return this[Strings.getPropertyPriority].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! + return this[Strings.getPropertyPriority].function!(this: this, arguments: [property.jsValue]).fromJSValue()! } @inlinable public func setProperty(property: String, value: String, priority: String? = nil) { let this = jsObject - _ = this[Strings.setProperty].function!(this: this, arguments: [property.jsValue(), value.jsValue(), priority?.jsValue() ?? .undefined]) + _ = this[Strings.setProperty].function!(this: this, arguments: [property.jsValue, value.jsValue, priority?.jsValue ?? .undefined]) } @inlinable public func removeProperty(property: String) -> String { let this = jsObject - return this[Strings.removeProperty].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! + return this[Strings.removeProperty].function!(this: this, arguments: [property.jsValue]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift index fa156e5e..b2f30a8c 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -19,12 +19,12 @@ public class CSSStyleRule: CSSRule { @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { let this = jsObject - return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue, index?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteRule(index: UInt32) { let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift index fc3ea941..8a5cad13 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift @@ -14,7 +14,7 @@ public class CSSStyleSheet: StyleSheet { } @inlinable public convenience init(options: CSSStyleSheetInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -25,29 +25,29 @@ public class CSSStyleSheet: StyleSheet { @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { let this = jsObject - return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue(), index?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue, index?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteRule(index: UInt32) { let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue]) } @inlinable public func replace(text: String) -> JSPromise { let this = jsObject - return this[Strings.replace].function!(this: this, arguments: [text.jsValue()]).fromJSValue()! + return this[Strings.replace].function!(this: this, arguments: [text.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func replace(text: String) async throws -> CSSStyleSheet { let this = jsObject - let _promise: JSPromise = this[Strings.replace].function!(this: this, arguments: [text.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.replace].function!(this: this, arguments: [text.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func replaceSync(text: String) { let this = jsObject - _ = this[Strings.replaceSync].function!(this: this, arguments: [text.jsValue()]) + _ = this[Strings.replaceSync].function!(this: this, arguments: [text.jsValue]) } @ReadonlyAttribute @@ -55,11 +55,11 @@ public class CSSStyleSheet: StyleSheet { @inlinable public func addRule(selector: String? = nil, style: String? = nil, index: UInt32? = nil) -> Int32 { let this = jsObject - return this[Strings.addRule].function!(this: this, arguments: [selector?.jsValue() ?? .undefined, style?.jsValue() ?? .undefined, index?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.addRule].function!(this: this, arguments: [selector?.jsValue ?? .undefined, style?.jsValue ?? .undefined, index?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func removeRule(index: UInt32? = nil) { let this = jsObject - _ = this[Strings.removeRule].function!(this: this, arguments: [index?.jsValue() ?? .undefined]) + _ = this[Strings.removeRule].function!(this: this, arguments: [index?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift index c37b959e..fa75a1d8 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class CSSStyleSheetInit: BridgedDictionary { public convenience init(baseURL: String, media: MediaList_or_String, disabled: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.baseURL] = baseURL.jsValue() - object[Strings.media] = media.jsValue() - object[Strings.disabled] = disabled.jsValue() + object[Strings.baseURL] = baseURL.jsValue + object[Strings.media] = media.jsValue + object[Strings.disabled] = disabled.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CSSStyleValue.swift b/Sources/DOMKit/WebIDL/CSSStyleValue.swift index 2e98853f..af6a5fbd 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleValue.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleValue.swift @@ -18,11 +18,11 @@ public class CSSStyleValue: JSBridgedClass { @inlinable public static func parse(property: String, cssText: String) -> Self { let this = constructor - return this[Strings.parse].function!(this: this, arguments: [property.jsValue(), cssText.jsValue()]).fromJSValue()! + return this[Strings.parse].function!(this: this, arguments: [property.jsValue, cssText.jsValue]).fromJSValue()! } @inlinable public static func parseAll(property: String, cssText: String) -> [CSSStyleValue] { let this = constructor - return this[Strings.parseAll].function!(this: this, arguments: [property.jsValue(), cssText.jsValue()]).fromJSValue()! + return this[Strings.parseAll].function!(this: this, arguments: [property.jsValue, cssText.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift b/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift index b65f1e3b..97d68f00 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift @@ -21,12 +21,12 @@ public enum CSSStyleValue_or_String: JSValueCompatible, Any_CSSStyleValue_or_Str return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSStyleValue(cSSStyleValue): - return cSSStyleValue.jsValue() + return cSSStyleValue.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSToken.swift b/Sources/DOMKit/WebIDL/CSSToken.swift index 9a0d0c9f..f217376b 100644 --- a/Sources/DOMKit/WebIDL/CSSToken.swift +++ b/Sources/DOMKit/WebIDL/CSSToken.swift @@ -26,14 +26,14 @@ public enum CSSToken: JSValueCompatible, Any_CSSToken { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSParserValue(cSSParserValue): - return cSSParserValue.jsValue() + return cSSParserValue.jsValue case let .cSSStyleValue(cSSStyleValue): - return cSSStyleValue.jsValue() + return cSSStyleValue.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSTransformValue.swift b/Sources/DOMKit/WebIDL/CSSTransformValue.swift index 14e811db..dbc3cf60 100644 --- a/Sources/DOMKit/WebIDL/CSSTransformValue.swift +++ b/Sources/DOMKit/WebIDL/CSSTransformValue.swift @@ -13,7 +13,7 @@ public class CSSTransformValue: CSSStyleValue, Sequence { } @inlinable public convenience init(transforms: [CSSTransformComponent]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [transforms.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [transforms.jsValue])) } public typealias Element = CSSTransformComponent diff --git a/Sources/DOMKit/WebIDL/CSSTranslate.swift b/Sources/DOMKit/WebIDL/CSSTranslate.swift index fca65c3b..46a56b0e 100644 --- a/Sources/DOMKit/WebIDL/CSSTranslate.swift +++ b/Sources/DOMKit/WebIDL/CSSTranslate.swift @@ -14,7 +14,7 @@ public class CSSTranslate: CSSTransformComponent { } @inlinable public convenience init(x: CSSNumericValue, y: CSSNumericValue, z: CSSNumericValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue(), y.jsValue(), z?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue, y.jsValue, z?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSUnitValue.swift b/Sources/DOMKit/WebIDL/CSSUnitValue.swift index 94113942..dbb0a46f 100644 --- a/Sources/DOMKit/WebIDL/CSSUnitValue.swift +++ b/Sources/DOMKit/WebIDL/CSSUnitValue.swift @@ -13,7 +13,7 @@ public class CSSUnitValue: CSSNumericValue { } @inlinable public convenience init(value: Double, unit: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue(), unit.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue, unit.jsValue])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift b/Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift index 8083d2b2..cdd44da2 100644 --- a/Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift +++ b/Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift @@ -21,12 +21,12 @@ public enum CSSUnparsedSegment: JSValueCompatible, Any_CSSUnparsedSegment { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSVariableReferenceValue(cSSVariableReferenceValue): - return cSSVariableReferenceValue.jsValue() + return cSSVariableReferenceValue.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift b/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift index ec985fe6..ae969d02 100644 --- a/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift +++ b/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift @@ -12,7 +12,7 @@ public class CSSUnparsedValue: CSSStyleValue, Sequence { } @inlinable public convenience init(members: [CSSUnparsedSegment]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [members.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [members.jsValue])) } public typealias Element = CSSUnparsedSegment diff --git a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift index cc44f312..da9b1af3 100644 --- a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift +++ b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift @@ -15,7 +15,7 @@ public class CSSVariableReferenceValue: JSBridgedClass { } @inlinable public convenience init(variable: String, fallback: CSSUnparsedValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [variable.jsValue(), fallback?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [variable.jsValue, fallback?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/Cache.swift b/Sources/DOMKit/WebIDL/Cache.swift index bd95b766..6b344dce 100644 --- a/Sources/DOMKit/WebIDL/Cache.swift +++ b/Sources/DOMKit/WebIDL/Cache.swift @@ -14,85 +14,85 @@ public class Cache: JSBridgedClass { @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()! + 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: 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.get().fromJSValue()! + 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 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()! + return this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! } @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.get().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 public func add(request: RequestInfo) -> JSPromise { let this = jsObject - return this[Strings.add].function!(this: this, arguments: [request.jsValue()]).fromJSValue()! + return this[Strings.add].function!(this: this, arguments: [request.jsValue]).fromJSValue()! } @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.get() + let _promise: JSPromise = this[Strings.add].function!(this: this, arguments: [request.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func addAll(requests: [RequestInfo]) -> JSPromise { let this = jsObject - return this[Strings.addAll].function!(this: this, arguments: [requests.jsValue()]).fromJSValue()! + return this[Strings.addAll].function!(this: this, arguments: [requests.jsValue]).fromJSValue()! } @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.get() + let _promise: JSPromise = this[Strings.addAll].function!(this: this, arguments: [requests.jsValue]).fromJSValue()! + _ = try await _promise.value } @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()! + return this[Strings.put].function!(this: this, arguments: [request.jsValue, response.jsValue]).fromJSValue()! } @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 - let _promise: JSPromise = this[Strings.put].function!(this: this, arguments: [request.jsValue(), response.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.put].function!(this: this, arguments: [request.jsValue, response.jsValue]).fromJSValue()! + _ = try await _promise.value } @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()! + return this[Strings.delete].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 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.get().fromJSValue()! + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @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()! + return this[Strings.keys].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! } @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.get().fromJSValue()! + let _promise: JSPromise = this[Strings.keys].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CacheQueryOptions.swift b/Sources/DOMKit/WebIDL/CacheQueryOptions.swift index 17647398..cb0feec1 100644 --- a/Sources/DOMKit/WebIDL/CacheQueryOptions.swift +++ b/Sources/DOMKit/WebIDL/CacheQueryOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit 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() + object[Strings.ignoreSearch] = ignoreSearch.jsValue + object[Strings.ignoreMethod] = ignoreMethod.jsValue + object[Strings.ignoreVary] = ignoreVary.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CacheStorage.swift b/Sources/DOMKit/WebIDL/CacheStorage.swift index b3f4ec39..e03f63b1 100644 --- a/Sources/DOMKit/WebIDL/CacheStorage.swift +++ b/Sources/DOMKit/WebIDL/CacheStorage.swift @@ -14,50 +14,50 @@ public class CacheStorage: JSBridgedClass { @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()! + 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.get().fromJSValue()! + 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()! + 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.get().fromJSValue()! + 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()! + 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.get().fromJSValue()! + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func delete(cacheName: String) -> JSPromise { let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue()]).fromJSValue()! + return this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! } @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.get().fromJSValue()! + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func keys() -> JSPromise { @@ -69,6 +69,6 @@ public class CacheStorage: JSBridgedClass { @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.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift b/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift index d233be9d..ee012fa8 100644 --- a/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class CameraDevicePermissionDescriptor: BridgedDictionary { public convenience init(panTiltZoom: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.panTiltZoom] = panTiltZoom.jsValue() + object[Strings.panTiltZoom] = panTiltZoom.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift b/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift index 4516c70e..6d10fa12 100644 --- a/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift +++ b/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class CanMakePaymentEventInit: BridgedDictionary { public convenience init(topOrigin: String, paymentRequestOrigin: String, methodData: [PaymentMethodData]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.topOrigin] = topOrigin.jsValue() - object[Strings.paymentRequestOrigin] = paymentRequestOrigin.jsValue() - object[Strings.methodData] = methodData.jsValue() + object[Strings.topOrigin] = topOrigin.jsValue + object[Strings.paymentRequestOrigin] = paymentRequestOrigin.jsValue + object[Strings.methodData] = methodData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift index bbd981e5..3daa302c 100644 --- a/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift +++ b/Sources/DOMKit/WebIDL/CanPlayTypeResult.swift @@ -19,5 +19,5 @@ public enum CanPlayTypeResult: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasDirection.swift b/Sources/DOMKit/WebIDL/CanvasDirection.swift index 9a1b9239..d2aab51e 100644 --- a/Sources/DOMKit/WebIDL/CanvasDirection.swift +++ b/Sources/DOMKit/WebIDL/CanvasDirection.swift @@ -19,5 +19,5 @@ public enum CanvasDirection: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift index c5bc5baa..a45379b6 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawImage.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawImage.swift @@ -7,24 +7,24 @@ 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()]) + _ = this[Strings.drawImage].function!(this: this, arguments: [image.jsValue, dx.jsValue, dy.jsValue]) } @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()]) + _ = this[Strings.drawImage].function!(this: this, arguments: [image.jsValue, dx.jsValue, dy.jsValue, dw.jsValue, dh.jsValue]) } @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 _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]) } diff --git a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift index c2df685f..1b2986e9 100644 --- a/Sources/DOMKit/WebIDL/CanvasDrawPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasDrawPath.swift @@ -12,12 +12,12 @@ public extension CanvasDrawPath { @inlinable func fill(fillRule: CanvasFillRule? = nil) { let this = jsObject - _ = this[Strings.fill].function!(this: this, arguments: [fillRule?.jsValue() ?? .undefined]) + _ = this[Strings.fill].function!(this: this, arguments: [fillRule?.jsValue ?? .undefined]) } @inlinable func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { let this = jsObject - _ = this[Strings.fill].function!(this: this, arguments: [path.jsValue(), fillRule?.jsValue() ?? .undefined]) + _ = this[Strings.fill].function!(this: this, arguments: [path.jsValue, fillRule?.jsValue ?? .undefined]) } @inlinable func stroke() { @@ -27,36 +27,36 @@ public extension CanvasDrawPath { @inlinable func stroke(path: Path2D) { let this = jsObject - _ = this[Strings.stroke].function!(this: this, arguments: [path.jsValue()]) + _ = this[Strings.stroke].function!(this: this, arguments: [path.jsValue]) } @inlinable func clip(fillRule: CanvasFillRule? = nil) { let this = jsObject - _ = this[Strings.clip].function!(this: this, arguments: [fillRule?.jsValue() ?? .undefined]) + _ = this[Strings.clip].function!(this: this, arguments: [fillRule?.jsValue ?? .undefined]) } @inlinable func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { let this = jsObject - _ = this[Strings.clip].function!(this: this, arguments: [path.jsValue(), fillRule?.jsValue() ?? .undefined]) + _ = this[Strings.clip].function!(this: this, arguments: [path.jsValue, fillRule?.jsValue ?? .undefined]) } @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()! + 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()! + 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()! + 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()! + return this[Strings.isPointInStroke].function!(this: this, arguments: [path.jsValue, x.jsValue, y.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasFillRule.swift b/Sources/DOMKit/WebIDL/CanvasFillRule.swift index cabb6896..17694dc2 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillRule.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillRule.swift @@ -18,5 +18,5 @@ public enum CanvasFillRule: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift index a4fa2c8e..1e9d0875 100644 --- a/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasFillStrokeStyles.swift @@ -17,27 +17,27 @@ public extension CanvasFillStrokeStyles { @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()! + return this[Strings.createLinearGradient].function!(this: this, arguments: [x0.jsValue, y0.jsValue, x1.jsValue, y1.jsValue]).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() + 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 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()! + return this[Strings.createConicGradient].function!(this: this, arguments: [startAngle.jsValue, x.jsValue, y.jsValue]).fromJSValue()! } @inlinable func createPattern(image: CanvasImageSource, repetition: String) -> CanvasPattern? { let this = jsObject - return this[Strings.createPattern].function!(this: this, arguments: [image.jsValue(), repetition.jsValue()]).fromJSValue()! + return this[Strings.createPattern].function!(this: this, arguments: [image.jsValue, repetition.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasFilter.swift b/Sources/DOMKit/WebIDL/CanvasFilter.swift index fc477a9b..322447f3 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilter.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilter.swift @@ -13,6 +13,6 @@ public class CanvasFilter: JSBridgedClass { } @inlinable public convenience init(filters: CanvasFilterInput_or_seq_of_CanvasFilterInput? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [filters?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [filters?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift b/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift index 987eb280..94cd22d2 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift @@ -21,12 +21,12 @@ public enum CanvasFilterInput_or_seq_of_CanvasFilterInput: JSValueCompatible, An return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .canvasFilterInput(canvasFilterInput): - return canvasFilterInput.jsValue() + return canvasFilterInput.jsValue case let .seq_of_CanvasFilterInput(seq_of_CanvasFilterInput): - return seq_of_CanvasFilterInput.jsValue() + return seq_of_CanvasFilterInput.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift b/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift index 710e7b74..eb038b02 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift @@ -21,12 +21,12 @@ public enum CanvasFilter_or_String: JSValueCompatible, Any_CanvasFilter_or_Strin return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .canvasFilter(canvasFilter): - return canvasFilter.jsValue() + return canvasFilter.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift index 4c1769bc..08539582 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontKerning.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontKerning.swift @@ -19,5 +19,5 @@ public enum CanvasFontKerning: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift index 1ff0b73f..005a3b8a 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontStretch.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontStretch.swift @@ -25,5 +25,5 @@ public enum CanvasFontStretch: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift index 6d0ab6af..4d9bd07c 100644 --- a/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift +++ b/Sources/DOMKit/WebIDL/CanvasFontVariantCaps.swift @@ -23,5 +23,5 @@ public enum CanvasFontVariantCaps: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasGradient.swift b/Sources/DOMKit/WebIDL/CanvasGradient.swift index 6298e35c..f968ea7f 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient.swift @@ -14,6 +14,6 @@ public class CanvasGradient: JSBridgedClass { @inlinable public func addColorStop(offset: Double, color: String) { let this = jsObject - _ = this[Strings.addColorStop].function!(this: this, arguments: [offset.jsValue(), color.jsValue()]) + _ = this[Strings.addColorStop].function!(this: this, arguments: [offset.jsValue, color.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift b/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift index 638cacd8..6334c577 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift @@ -26,14 +26,14 @@ public enum CanvasGradient_or_CanvasPattern_or_String: JSValueCompatible, Any_Ca return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .canvasGradient(canvasGradient): - return canvasGradient.jsValue() + return canvasGradient.jsValue case let .canvasPattern(canvasPattern): - return canvasPattern.jsValue() + return canvasPattern.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasImageData.swift b/Sources/DOMKit/WebIDL/CanvasImageData.swift index 864a6391..d3318b0b 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageData.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageData.swift @@ -7,32 +7,32 @@ public protocol CanvasImageData: JSBridgedClass {} public extension CanvasImageData { @inlinable func createImageData(sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { let this = jsObject - return this[Strings.createImageData].function!(this: this, arguments: [sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createImageData].function!(this: this, arguments: [sw.jsValue, sh.jsValue, settings?.jsValue ?? .undefined]).fromJSValue()! } @inlinable func createImageData(imagedata: ImageData) -> ImageData { let this = jsObject - return this[Strings.createImageData].function!(this: this, arguments: [imagedata.jsValue()]).fromJSValue()! + return this[Strings.createImageData].function!(this: this, arguments: [imagedata.jsValue]).fromJSValue()! } @inlinable func getImageData(sx: Int32, sy: Int32, sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { let this = jsObject - return this[Strings.getImageData].function!(this: this, arguments: [sx.jsValue(), sy.jsValue(), sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getImageData].function!(this: this, arguments: [sx.jsValue, sy.jsValue, sw.jsValue, sh.jsValue, settings?.jsValue ?? .undefined]).fromJSValue()! } @inlinable func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { let this = jsObject - _ = this[Strings.putImageData].function!(this: this, arguments: [imagedata.jsValue(), dx.jsValue(), dy.jsValue()]) + _ = this[Strings.putImageData].function!(this: this, arguments: [imagedata.jsValue, dx.jsValue, dy.jsValue]) } @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 _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.putImageData].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } diff --git a/Sources/DOMKit/WebIDL/CanvasImageSource.swift b/Sources/DOMKit/WebIDL/CanvasImageSource.swift index f8394292..db4e4d0d 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageSource.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageSource.swift @@ -41,20 +41,20 @@ public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .hTMLCanvasElement(hTMLCanvasElement): - return hTMLCanvasElement.jsValue() + return hTMLCanvasElement.jsValue case let .hTMLOrSVGImageElement(hTMLOrSVGImageElement): - return hTMLOrSVGImageElement.jsValue() + return hTMLOrSVGImageElement.jsValue case let .hTMLVideoElement(hTMLVideoElement): - return hTMLVideoElement.jsValue() + return hTMLVideoElement.jsValue case let .imageBitmap(imageBitmap): - return imageBitmap.jsValue() + return imageBitmap.jsValue case let .offscreenCanvas(offscreenCanvas): - return offscreenCanvas.jsValue() + return offscreenCanvas.jsValue case let .videoFrame(videoFrame): - return videoFrame.jsValue() + return videoFrame.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CanvasLineCap.swift b/Sources/DOMKit/WebIDL/CanvasLineCap.swift index 2de2bc12..abc5b1b9 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineCap.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineCap.swift @@ -19,5 +19,5 @@ public enum CanvasLineCap: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift index 7bce0ede..4bfc3d9e 100644 --- a/Sources/DOMKit/WebIDL/CanvasLineJoin.swift +++ b/Sources/DOMKit/WebIDL/CanvasLineJoin.swift @@ -19,5 +19,5 @@ public enum CanvasLineJoin: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasPath.swift b/Sources/DOMKit/WebIDL/CanvasPath.swift index b73f6c61..618d84ae 100644 --- a/Sources/DOMKit/WebIDL/CanvasPath.swift +++ b/Sources/DOMKit/WebIDL/CanvasPath.swift @@ -12,65 +12,65 @@ public extension CanvasPath { @inlinable func moveTo(x: Double, y: Double) { let this = jsObject - _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @inlinable func lineTo(x: Double, y: Double) { let this = jsObject - _ = this[Strings.lineTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.lineTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @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()]) + _ = this[Strings.quadraticCurveTo].function!(this: this, arguments: [cpx.jsValue, cpy.jsValue, x.jsValue, y.jsValue]) } @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 _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 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()]) + _ = this[Strings.arcTo].function!(this: this, arguments: [x1.jsValue, y1.jsValue, x2.jsValue, y2.jsValue, radius.jsValue]) } @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()]) + _ = this[Strings.rect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) } @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]) + _ = this[Strings.roundRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue, radii?.jsValue ?? .undefined]) } @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 _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 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 _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]) } diff --git a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift index 2b513e3b..fa980115 100644 --- a/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift +++ b/Sources/DOMKit/WebIDL/CanvasPathDrawingStyles.swift @@ -27,7 +27,7 @@ public extension CanvasPathDrawingStyles { @inlinable func setLineDash(segments: [Double]) { let this = jsObject - _ = this[Strings.setLineDash].function!(this: this, arguments: [segments.jsValue()]) + _ = this[Strings.setLineDash].function!(this: this, arguments: [segments.jsValue]) } @inlinable func getLineDash() -> [Double] { diff --git a/Sources/DOMKit/WebIDL/CanvasPattern.swift b/Sources/DOMKit/WebIDL/CanvasPattern.swift index 282e0213..0c5b037d 100644 --- a/Sources/DOMKit/WebIDL/CanvasPattern.swift +++ b/Sources/DOMKit/WebIDL/CanvasPattern.swift @@ -14,6 +14,6 @@ public class CanvasPattern: JSBridgedClass { @inlinable public func setTransform(transform: DOMMatrix2DInit? = nil) { let this = jsObject - _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue() ?? .undefined]) + _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasRect.swift b/Sources/DOMKit/WebIDL/CanvasRect.swift index 2f905353..97ae72d1 100644 --- a/Sources/DOMKit/WebIDL/CanvasRect.swift +++ b/Sources/DOMKit/WebIDL/CanvasRect.swift @@ -7,16 +7,16 @@ 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()]) + _ = this[Strings.clearRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) } @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()]) + _ = this[Strings.fillRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) } @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()]) + _ = this[Strings.strokeRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift index eac37c5d..9dc2ceb0 100644 --- a/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift +++ b/Sources/DOMKit/WebIDL/CanvasRenderingContext2DSettings.swift @@ -6,10 +6,10 @@ import JavaScriptKit 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.alpha] = alpha.jsValue() - object[Strings.desynchronized] = desynchronized.jsValue() - object[Strings.colorSpace] = colorSpace.jsValue() - object[Strings.willReadFrequently] = willReadFrequently.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) } diff --git a/Sources/DOMKit/WebIDL/CanvasText.swift b/Sources/DOMKit/WebIDL/CanvasText.swift index f68bc36c..9e48702d 100644 --- a/Sources/DOMKit/WebIDL/CanvasText.swift +++ b/Sources/DOMKit/WebIDL/CanvasText.swift @@ -7,16 +7,16 @@ public protocol CanvasText: JSBridgedClass {} public extension CanvasText { @inlinable func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { let this = jsObject - _ = this[Strings.fillText].function!(this: this, arguments: [text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined]) + _ = this[Strings.fillText].function!(this: this, arguments: [text.jsValue, x.jsValue, y.jsValue, maxWidth?.jsValue ?? .undefined]) } @inlinable func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { let this = jsObject - _ = this[Strings.strokeText].function!(this: this, arguments: [text.jsValue(), x.jsValue(), y.jsValue(), maxWidth?.jsValue() ?? .undefined]) + _ = this[Strings.strokeText].function!(this: this, arguments: [text.jsValue, x.jsValue, y.jsValue, maxWidth?.jsValue ?? .undefined]) } @inlinable func measureText(text: String) -> TextMetrics { let this = jsObject - return this[Strings.measureText].function!(this: this, arguments: [text.jsValue()]).fromJSValue()! + return this[Strings.measureText].function!(this: this, arguments: [text.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift index 2bdd6660..40992b7d 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextAlign.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextAlign.swift @@ -21,5 +21,5 @@ public enum CanvasTextAlign: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift index e6fdb197..4fc1c759 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextBaseline.swift @@ -22,5 +22,5 @@ public enum CanvasTextBaseline: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift index 7fa14436..e529cf10 100644 --- a/Sources/DOMKit/WebIDL/CanvasTextRendering.swift +++ b/Sources/DOMKit/WebIDL/CanvasTextRendering.swift @@ -20,5 +20,5 @@ public enum CanvasTextRendering: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CanvasTransform.swift b/Sources/DOMKit/WebIDL/CanvasTransform.swift index 0328f9cb..83337e04 100644 --- a/Sources/DOMKit/WebIDL/CanvasTransform.swift +++ b/Sources/DOMKit/WebIDL/CanvasTransform.swift @@ -7,26 +7,26 @@ 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()]) + _ = 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()]) + _ = 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()]) + _ = 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 _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]) } @@ -37,19 +37,19 @@ public extension CanvasTransform { } @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 _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]) + _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue ?? .undefined]) } @inlinable func resetTransform() { diff --git a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift index 0c328b02..74673ac0 100644 --- a/Sources/DOMKit/WebIDL/CanvasUserInterface.swift +++ b/Sources/DOMKit/WebIDL/CanvasUserInterface.swift @@ -7,12 +7,12 @@ public protocol CanvasUserInterface: JSBridgedClass {} public extension CanvasUserInterface { @inlinable func drawFocusIfNeeded(element: Element) { let this = jsObject - _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [element.jsValue()]) + _ = 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()]) + _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [path.jsValue, element.jsValue]) } @inlinable func scrollPathIntoView() { @@ -22,6 +22,6 @@ public extension CanvasUserInterface { @inlinable func scrollPathIntoView(path: Path2D) { let this = jsObject - _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: [path.jsValue()]) + _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: [path.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/ChannelCountMode.swift b/Sources/DOMKit/WebIDL/ChannelCountMode.swift index c6eaa2eb..7fb56c48 100644 --- a/Sources/DOMKit/WebIDL/ChannelCountMode.swift +++ b/Sources/DOMKit/WebIDL/ChannelCountMode.swift @@ -19,5 +19,5 @@ public enum ChannelCountMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ChannelInterpretation.swift b/Sources/DOMKit/WebIDL/ChannelInterpretation.swift index dc6df9b3..a1e3a41f 100644 --- a/Sources/DOMKit/WebIDL/ChannelInterpretation.swift +++ b/Sources/DOMKit/WebIDL/ChannelInterpretation.swift @@ -18,5 +18,5 @@ public enum ChannelInterpretation: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ChannelMergerNode.swift b/Sources/DOMKit/WebIDL/ChannelMergerNode.swift index 697bbd65..4d077fa2 100644 --- a/Sources/DOMKit/WebIDL/ChannelMergerNode.swift +++ b/Sources/DOMKit/WebIDL/ChannelMergerNode.swift @@ -11,6 +11,6 @@ public class ChannelMergerNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: ChannelMergerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift b/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift index aa9decee..ee0f8c1c 100644 --- a/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift +++ b/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ChannelMergerOptions: BridgedDictionary { public convenience init(numberOfInputs: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfInputs] = numberOfInputs.jsValue() + object[Strings.numberOfInputs] = numberOfInputs.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift b/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift index 4fafe994..14f9c626 100644 --- a/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift +++ b/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift @@ -11,6 +11,6 @@ public class ChannelSplitterNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: ChannelSplitterOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift b/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift index d10365e1..88ac6096 100644 --- a/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift +++ b/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ChannelSplitterOptions: BridgedDictionary { public convenience init(numberOfOutputs: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfOutputs] = numberOfOutputs.jsValue() + object[Strings.numberOfOutputs] = numberOfOutputs.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift index 8e5d5ad6..464ee04f 100644 --- a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift @@ -13,7 +13,7 @@ public class CharacterBoundsUpdateEvent: Event { } @inlinable public convenience init(options: CharacterBoundsUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift index 7f11e5b8..31d03107 100644 --- a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift +++ b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class CharacterBoundsUpdateEventInit: BridgedDictionary { public convenience init(rangeStart: UInt32, rangeEnd: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rangeStart] = rangeStart.jsValue() - object[Strings.rangeEnd] = rangeEnd.jsValue() + object[Strings.rangeStart] = rangeStart.jsValue + object[Strings.rangeEnd] = rangeEnd.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CharacterData.swift b/Sources/DOMKit/WebIDL/CharacterData.swift index 000d46b6..dcfe0231 100644 --- a/Sources/DOMKit/WebIDL/CharacterData.swift +++ b/Sources/DOMKit/WebIDL/CharacterData.swift @@ -20,26 +20,26 @@ public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { @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()! + 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = this[Strings.replaceData].function!(this: this, arguments: [offset.jsValue, count.jsValue, data.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/ChildDisplayType.swift b/Sources/DOMKit/WebIDL/ChildDisplayType.swift index ece86988..f540d213 100644 --- a/Sources/DOMKit/WebIDL/ChildDisplayType.swift +++ b/Sources/DOMKit/WebIDL/ChildDisplayType.swift @@ -18,5 +18,5 @@ public enum ChildDisplayType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ChildNode.swift b/Sources/DOMKit/WebIDL/ChildNode.swift index 07bb8d36..e2377621 100644 --- a/Sources/DOMKit/WebIDL/ChildNode.swift +++ b/Sources/DOMKit/WebIDL/ChildNode.swift @@ -7,17 +7,17 @@ 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 { $0.jsValue() }) + _ = 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 { $0.jsValue() }) + _ = 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 { $0.jsValue() }) + _ = this[Strings.replaceWith].function!(this: this, arguments: nodes.map(\.jsValue)) } @inlinable func remove() { diff --git a/Sources/DOMKit/WebIDL/ClientLifecycleState.swift b/Sources/DOMKit/WebIDL/ClientLifecycleState.swift index a00231ff..16514325 100644 --- a/Sources/DOMKit/WebIDL/ClientLifecycleState.swift +++ b/Sources/DOMKit/WebIDL/ClientLifecycleState.swift @@ -18,5 +18,5 @@ public enum ClientLifecycleState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ClientQueryOptions.swift b/Sources/DOMKit/WebIDL/ClientQueryOptions.swift index 6f925ff7..3b4a2778 100644 --- a/Sources/DOMKit/WebIDL/ClientQueryOptions.swift +++ b/Sources/DOMKit/WebIDL/ClientQueryOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit 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() + object[Strings.includeUncontrolled] = includeUncontrolled.jsValue + object[Strings.type] = type.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ClientType.swift b/Sources/DOMKit/WebIDL/ClientType.swift index 3e393706..91197c8f 100644 --- a/Sources/DOMKit/WebIDL/ClientType.swift +++ b/Sources/DOMKit/WebIDL/ClientType.swift @@ -20,5 +20,5 @@ public enum ClientType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Clipboard.swift b/Sources/DOMKit/WebIDL/Clipboard.swift index 8dfc276a..b5af9b40 100644 --- a/Sources/DOMKit/WebIDL/Clipboard.swift +++ b/Sources/DOMKit/WebIDL/Clipboard.swift @@ -19,7 +19,7 @@ public class Clipboard: EventTarget { @inlinable public func read() async throws -> ClipboardItems { let this = jsObject let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func readText() -> JSPromise { @@ -31,30 +31,30 @@ public class Clipboard: EventTarget { @inlinable public func readText() async throws -> String { let this = jsObject let _promise: JSPromise = this[Strings.readText].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func write(data: ClipboardItems) -> JSPromise { let this = jsObject - return this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! + return this[Strings.write].function!(this: this, arguments: [data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func write(data: ClipboardItems) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func writeText(data: String) -> JSPromise { let this = jsObject - return this[Strings.writeText].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! + return this[Strings.writeText].function!(this: this, arguments: [data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func writeText(data: String) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.writeText].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.writeText].function!(this: this, arguments: [data.jsValue]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/ClipboardEvent.swift b/Sources/DOMKit/WebIDL/ClipboardEvent.swift index dc9bd6cf..d6ac0199 100644 --- a/Sources/DOMKit/WebIDL/ClipboardEvent.swift +++ b/Sources/DOMKit/WebIDL/ClipboardEvent.swift @@ -12,7 +12,7 @@ public class ClipboardEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: ClipboardEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ClipboardEventInit.swift b/Sources/DOMKit/WebIDL/ClipboardEventInit.swift index 03a5e7ac..a1efb9a3 100644 --- a/Sources/DOMKit/WebIDL/ClipboardEventInit.swift +++ b/Sources/DOMKit/WebIDL/ClipboardEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ClipboardEventInit: BridgedDictionary { public convenience init(clipboardData: DataTransfer?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.clipboardData] = clipboardData.jsValue() + object[Strings.clipboardData] = clipboardData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ClipboardItem.swift b/Sources/DOMKit/WebIDL/ClipboardItem.swift index 7c9f5d24..8527107c 100644 --- a/Sources/DOMKit/WebIDL/ClipboardItem.swift +++ b/Sources/DOMKit/WebIDL/ClipboardItem.swift @@ -15,7 +15,7 @@ public class ClipboardItem: JSBridgedClass { } @inlinable public convenience init(items: [String: ClipboardItemData], options: ClipboardItemOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [items.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [items.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -26,13 +26,13 @@ public class ClipboardItem: JSBridgedClass { @inlinable public func getType(type: String) -> JSPromise { let this = jsObject - return this[Strings.getType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.getType].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getType(type: String) async throws -> Blob { let this = jsObject - let _promise: JSPromise = this[Strings.getType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getType].function!(this: this, arguments: [type.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift b/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift index ec97b76f..5d15acef 100644 --- a/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift +++ b/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ClipboardItemOptions: BridgedDictionary { public convenience init(presentationStyle: PresentationStyle) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.presentationStyle] = presentationStyle.jsValue() + object[Strings.presentationStyle] = presentationStyle.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift index ea5de3b7..4d7e04ed 100644 --- a/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ClipboardPermissionDescriptor: BridgedDictionary { public convenience init(allowWithoutGesture: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowWithoutGesture] = allowWithoutGesture.jsValue() + object[Strings.allowWithoutGesture] = allowWithoutGesture.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CloseEvent.swift b/Sources/DOMKit/WebIDL/CloseEvent.swift index 7247a465..4f76248f 100644 --- a/Sources/DOMKit/WebIDL/CloseEvent.swift +++ b/Sources/DOMKit/WebIDL/CloseEvent.swift @@ -14,7 +14,7 @@ public class CloseEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: CloseEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CloseEventInit.swift b/Sources/DOMKit/WebIDL/CloseEventInit.swift index 66b8a3b2..846aedd0 100644 --- a/Sources/DOMKit/WebIDL/CloseEventInit.swift +++ b/Sources/DOMKit/WebIDL/CloseEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class CloseEventInit: BridgedDictionary { public convenience init(wasClean: Bool, code: UInt16, reason: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.wasClean] = wasClean.jsValue() - object[Strings.code] = code.jsValue() - object[Strings.reason] = reason.jsValue() + object[Strings.wasClean] = wasClean.jsValue + object[Strings.code] = code.jsValue + object[Strings.reason] = reason.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CloseWatcher.swift b/Sources/DOMKit/WebIDL/CloseWatcher.swift index 68123f81..13e439e6 100644 --- a/Sources/DOMKit/WebIDL/CloseWatcher.swift +++ b/Sources/DOMKit/WebIDL/CloseWatcher.swift @@ -13,7 +13,7 @@ public class CloseWatcher: EventTarget { } @inlinable public convenience init(options: CloseWatcherOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @inlinable public func destroy() { diff --git a/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift b/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift index bf858075..cdd7f9e2 100644 --- a/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift +++ b/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class CloseWatcherOptions: BridgedDictionary { public convenience init(signal: AbortSignal) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue() + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ClosureAttribute.swift b/Sources/DOMKit/WebIDL/ClosureAttribute.swift index 549790e5..33d9c53c 100644 --- a/Sources/DOMKit/WebIDL/ClosureAttribute.swift +++ b/Sources/DOMKit/WebIDL/ClosureAttribute.swift @@ -27,8 +27,8 @@ import JavaScriptKit } set { jsObject[name] = JSClosure { _ in - newValue().jsValue() - }.jsValue() + newValue().jsValue + }.jsValue } } } @@ -59,8 +59,8 @@ import JavaScriptKit set { if let newValue = newValue { jsObject[name] = JSClosure { _ in - newValue().jsValue() - }.jsValue() + newValue().jsValue + }.jsValue } else { jsObject[name] = .null } @@ -94,7 +94,7 @@ import JavaScriptKit jsObject[name] = JSClosure { _ in newValue() return .undefined - }.jsValue() + }.jsValue } else { jsObject[name] = .null } @@ -125,7 +125,7 @@ import JavaScriptKit jsObject[name] = JSClosure { _ in newValue() return .undefined - }.jsValue() + }.jsValue } } } @@ -149,12 +149,12 @@ import JavaScriptKit @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0) -> ReturnType { get { let function = jsObject[name].function! - return { function($0.jsValue()).fromJSValue()! } + return { function($0.jsValue).fromJSValue()! } } set { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!).jsValue() - }.jsValue() + newValue($0[0].fromJSValue()!).jsValue + }.jsValue } } } @@ -180,13 +180,13 @@ import JavaScriptKit guard let function = jsObject[name].function else { return nil } - return { function($0.jsValue()).fromJSValue()! } + return { function($0.jsValue).fromJSValue()! } } set { if let newValue = newValue { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!).jsValue() - }.jsValue() + newValue($0[0].fromJSValue()!).jsValue + }.jsValue } else { jsObject[name] = .null } @@ -215,14 +215,14 @@ import JavaScriptKit guard let function = jsObject[name].function else { return nil } - return { function($0.jsValue()) } + return { function($0.jsValue) } } set { if let newValue = newValue { jsObject[name] = JSClosure { newValue($0[0].fromJSValue()!) return .undefined - }.jsValue() + }.jsValue } else { jsObject[name] = .null } @@ -249,13 +249,13 @@ import JavaScriptKit @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0) -> Void { get { let function = jsObject[name].function! - return { function($0.jsValue()) } + return { function($0.jsValue) } } set { jsObject[name] = JSClosure { newValue($0[0].fromJSValue()!) return .undefined - }.jsValue() + }.jsValue } } } @@ -279,12 +279,12 @@ import JavaScriptKit @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()! } + return { function($0.jsValue, $1.jsValue).fromJSValue()! } } set { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!).jsValue() - }.jsValue() + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!).jsValue + }.jsValue } } } @@ -310,13 +310,13 @@ import JavaScriptKit guard let function = jsObject[name].function else { return nil } - return { function($0.jsValue(), $1.jsValue()).fromJSValue()! } + return { function($0.jsValue, $1.jsValue).fromJSValue()! } } set { if let newValue = newValue { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!).jsValue() - }.jsValue() + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!).jsValue + }.jsValue } else { jsObject[name] = .null } @@ -345,14 +345,14 @@ import JavaScriptKit guard let function = jsObject[name].function else { return nil } - return { function($0.jsValue(), $1.jsValue()) } + return { function($0.jsValue, $1.jsValue) } } set { if let newValue = newValue { jsObject[name] = JSClosure { newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!) return .undefined - }.jsValue() + }.jsValue } else { jsObject[name] = .null } @@ -379,13 +379,13 @@ import JavaScriptKit @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1) -> Void { get { let function = jsObject[name].function! - return { function($0.jsValue(), $1.jsValue()) } + return { function($0.jsValue, $1.jsValue) } } set { jsObject[name] = JSClosure { newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!) return .undefined - }.jsValue() + }.jsValue } } } @@ -409,12 +409,12 @@ import JavaScriptKit @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2) -> ReturnType { get { let function = jsObject[name].function! - return { function($0.jsValue(), $1.jsValue(), $2.jsValue()).fromJSValue()! } + return { function($0.jsValue, $1.jsValue, $2.jsValue).fromJSValue()! } } set { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue() - }.jsValue() + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue + }.jsValue } } } @@ -440,13 +440,13 @@ import JavaScriptKit guard let function = jsObject[name].function else { return nil } - return { function($0.jsValue(), $1.jsValue(), $2.jsValue()).fromJSValue()! } + return { function($0.jsValue, $1.jsValue, $2.jsValue).fromJSValue()! } } set { if let newValue = newValue { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue() - }.jsValue() + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue + }.jsValue } else { jsObject[name] = .null } @@ -475,14 +475,14 @@ import JavaScriptKit guard let function = jsObject[name].function else { return nil } - return { function($0.jsValue(), $1.jsValue(), $2.jsValue()) } + return { function($0.jsValue, $1.jsValue, $2.jsValue) } } set { if let newValue = newValue { jsObject[name] = JSClosure { newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!) return .undefined - }.jsValue() + }.jsValue } else { jsObject[name] = .null } @@ -509,13 +509,13 @@ import JavaScriptKit @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2) -> Void { get { let function = jsObject[name].function! - return { function($0.jsValue(), $1.jsValue(), $2.jsValue()) } + return { function($0.jsValue, $1.jsValue, $2.jsValue) } } set { jsObject[name] = JSClosure { newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!) return .undefined - }.jsValue() + }.jsValue } } } @@ -539,12 +539,12 @@ import JavaScriptKit @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2, A3, A4) -> ReturnType { get { let function = jsObject[name].function! - return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } + return { function($0.jsValue, $1.jsValue, $2.jsValue, $3.jsValue, $4.jsValue).fromJSValue()! } } set { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue() - }.jsValue() + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue + }.jsValue } } } @@ -570,13 +570,13 @@ import JavaScriptKit guard let function = jsObject[name].function else { return nil } - return { function($0.jsValue(), $1.jsValue(), $2.jsValue(), $3.jsValue(), $4.jsValue()).fromJSValue()! } + return { function($0.jsValue, $1.jsValue, $2.jsValue, $3.jsValue, $4.jsValue).fromJSValue()! } } set { if let newValue = newValue { jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue() - }.jsValue() + newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!, $0[3].fromJSValue()!, $0[4].fromJSValue()!).jsValue + }.jsValue } else { jsObject[name] = .null } diff --git a/Sources/DOMKit/WebIDL/CodecState.swift b/Sources/DOMKit/WebIDL/CodecState.swift index 39f712f4..3495763f 100644 --- a/Sources/DOMKit/WebIDL/CodecState.swift +++ b/Sources/DOMKit/WebIDL/CodecState.swift @@ -19,5 +19,5 @@ public enum CodecState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift b/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift index 3bacd4eb..d7de20c2 100644 --- a/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift +++ b/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class CollectedClientAdditionalPaymentData: BridgedDictionary { public convenience init(rp: String, topOrigin: String, payeeOrigin: String, total: PaymentCurrencyAmount, instrument: PaymentCredentialInstrument) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rp] = rp.jsValue() - object[Strings.topOrigin] = topOrigin.jsValue() - object[Strings.payeeOrigin] = payeeOrigin.jsValue() - object[Strings.total] = total.jsValue() - object[Strings.instrument] = instrument.jsValue() + object[Strings.rp] = rp.jsValue + object[Strings.topOrigin] = topOrigin.jsValue + object[Strings.payeeOrigin] = payeeOrigin.jsValue + object[Strings.total] = total.jsValue + object[Strings.instrument] = instrument.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CollectedClientData.swift b/Sources/DOMKit/WebIDL/CollectedClientData.swift index f4e9ab49..99cbc814 100644 --- a/Sources/DOMKit/WebIDL/CollectedClientData.swift +++ b/Sources/DOMKit/WebIDL/CollectedClientData.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class CollectedClientData: BridgedDictionary { public convenience init(type: String, challenge: String, origin: String, crossOrigin: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.challenge] = challenge.jsValue() - object[Strings.origin] = origin.jsValue() - object[Strings.crossOrigin] = crossOrigin.jsValue() + object[Strings.type] = type.jsValue + object[Strings.challenge] = challenge.jsValue + object[Strings.origin] = origin.jsValue + object[Strings.crossOrigin] = crossOrigin.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift b/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift index 99439f4d..bfbba42f 100644 --- a/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift +++ b/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class CollectedClientPaymentData: BridgedDictionary { public convenience init(payment: CollectedClientAdditionalPaymentData) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.payment] = payment.jsValue() + object[Strings.payment] = payment.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ColorGamut.swift b/Sources/DOMKit/WebIDL/ColorGamut.swift index d48b6518..78297750 100644 --- a/Sources/DOMKit/WebIDL/ColorGamut.swift +++ b/Sources/DOMKit/WebIDL/ColorGamut.swift @@ -19,5 +19,5 @@ public enum ColorGamut: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ColorSelectionOptions.swift b/Sources/DOMKit/WebIDL/ColorSelectionOptions.swift index 6891aefa..3675f100 100644 --- a/Sources/DOMKit/WebIDL/ColorSelectionOptions.swift +++ b/Sources/DOMKit/WebIDL/ColorSelectionOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ColorSelectionOptions: BridgedDictionary { public convenience init(signal: AbortSignal) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue() + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ColorSelectionResult.swift b/Sources/DOMKit/WebIDL/ColorSelectionResult.swift index 5d212201..cc860896 100644 --- a/Sources/DOMKit/WebIDL/ColorSelectionResult.swift +++ b/Sources/DOMKit/WebIDL/ColorSelectionResult.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ColorSelectionResult: BridgedDictionary { public convenience init(sRGBHex: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sRGBHex] = sRGBHex.jsValue() + object[Strings.sRGBHex] = sRGBHex.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift index 942df651..862682ed 100644 --- a/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift +++ b/Sources/DOMKit/WebIDL/ColorSpaceConversion.swift @@ -18,5 +18,5 @@ public enum ColorSpaceConversion: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Comment.swift b/Sources/DOMKit/WebIDL/Comment.swift index dd801419..50ca3b54 100644 --- a/Sources/DOMKit/WebIDL/Comment.swift +++ b/Sources/DOMKit/WebIDL/Comment.swift @@ -11,6 +11,6 @@ public class Comment: CharacterData { } @inlinable public convenience init(data: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/CompositeOperation.swift b/Sources/DOMKit/WebIDL/CompositeOperation.swift index 805dcac0..5dd32127 100644 --- a/Sources/DOMKit/WebIDL/CompositeOperation.swift +++ b/Sources/DOMKit/WebIDL/CompositeOperation.swift @@ -19,5 +19,5 @@ public enum CompositeOperation: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift index a75afd54..7099d596 100644 --- a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift +++ b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto.swift @@ -20,5 +20,5 @@ public enum CompositeOperationOrAuto: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift index e7ba78fc..d2062c5a 100644 --- a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift +++ b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift @@ -21,12 +21,12 @@ public enum CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto: JSValue return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .compositeOperationOrAuto(compositeOperationOrAuto): - return compositeOperationOrAuto.jsValue() + return compositeOperationOrAuto.jsValue case let .seq_of_CompositeOperationOrAuto(seq_of_CompositeOperationOrAuto): - return seq_of_CompositeOperationOrAuto.jsValue() + return seq_of_CompositeOperationOrAuto.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CompositionEvent.swift b/Sources/DOMKit/WebIDL/CompositionEvent.swift index 515ecf64..f5426676 100644 --- a/Sources/DOMKit/WebIDL/CompositionEvent.swift +++ b/Sources/DOMKit/WebIDL/CompositionEvent.swift @@ -12,7 +12,7 @@ public class CompositionEvent: UIEvent { } @inlinable public convenience init(type: String, eventInitDict: CompositionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -20,6 +20,6 @@ public class CompositionEvent: UIEvent { @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]) + _ = this[Strings.initCompositionEvent].function!(this: this, arguments: [typeArg.jsValue, bubblesArg?.jsValue ?? .undefined, cancelableArg?.jsValue ?? .undefined, viewArg?.jsValue ?? .undefined, dataArg?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/CompositionEventInit.swift b/Sources/DOMKit/WebIDL/CompositionEventInit.swift index 35751d53..f3fa15f7 100644 --- a/Sources/DOMKit/WebIDL/CompositionEventInit.swift +++ b/Sources/DOMKit/WebIDL/CompositionEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class CompositionEventInit: BridgedDictionary { public convenience init(data: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.data] = data.jsValue() + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CompressionStream.swift b/Sources/DOMKit/WebIDL/CompressionStream.swift index c8a63130..47591de3 100644 --- a/Sources/DOMKit/WebIDL/CompressionStream.swift +++ b/Sources/DOMKit/WebIDL/CompressionStream.swift @@ -13,6 +13,6 @@ public class CompressionStream: JSBridgedClass, GenericTransformStream { } @inlinable public convenience init(format: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue])) } } diff --git a/Sources/DOMKit/WebIDL/ComputePressureFactor.swift b/Sources/DOMKit/WebIDL/ComputePressureFactor.swift index 9a579442..265e0ddf 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureFactor.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureFactor.swift @@ -18,5 +18,5 @@ public enum ComputePressureFactor: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift index ec732707..4a92f4d9 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift @@ -17,12 +17,12 @@ public class ComputePressureObserver: JSBridgedClass { @inlinable public func observe(source: ComputePressureSource) { let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: [source.jsValue()]) + _ = this[Strings.observe].function!(this: this, arguments: [source.jsValue]) } @inlinable public func unobserve(source: ComputePressureSource) { let this = jsObject - _ = this[Strings.unobserve].function!(this: this, arguments: [source.jsValue()]) + _ = this[Strings.unobserve].function!(this: this, arguments: [source.jsValue]) } @inlinable public func disconnect() { @@ -47,6 +47,6 @@ public class ComputePressureObserver: JSBridgedClass { @inlinable public static func requestPermission() async throws -> PermissionState { let this = constructor let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift b/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift index bdc8f5a0..dc2b92b0 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ComputePressureObserverOptions: BridgedDictionary { public convenience init(frequency: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.frequency] = frequency.jsValue() + object[Strings.frequency] = frequency.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ComputePressureRecord.swift b/Sources/DOMKit/WebIDL/ComputePressureRecord.swift index 0a344e01..a412bae5 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureRecord.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureRecord.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class ComputePressureRecord: BridgedDictionary { public convenience init(source: ComputePressureSource, state: ComputePressureState, factors: [ComputePressureFactor], time: DOMHighResTimeStamp) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.source] = source.jsValue() - object[Strings.state] = state.jsValue() - object[Strings.factors] = factors.jsValue() - object[Strings.time] = time.jsValue() + object[Strings.source] = source.jsValue + object[Strings.state] = state.jsValue + object[Strings.factors] = factors.jsValue + object[Strings.time] = time.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ComputePressureSource.swift b/Sources/DOMKit/WebIDL/ComputePressureSource.swift index cbcd3471..80da917f 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureSource.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureSource.swift @@ -17,5 +17,5 @@ public enum ComputePressureSource: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ComputePressureState.swift b/Sources/DOMKit/WebIDL/ComputePressureState.swift index 73b97cf2..39290025 100644 --- a/Sources/DOMKit/WebIDL/ComputePressureState.swift +++ b/Sources/DOMKit/WebIDL/ComputePressureState.swift @@ -20,5 +20,5 @@ public enum ComputePressureState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift index e91a4365..53a0887d 100644 --- a/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift +++ b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class ComputedEffectTiming: BridgedDictionary { public convenience init(startTime: CSSNumberish, endTime: CSSNumberish, activeDuration: CSSNumberish, localTime: CSSNumberish?, progress: Double?, currentIteration: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.startTime] = startTime.jsValue() - object[Strings.endTime] = endTime.jsValue() - object[Strings.activeDuration] = activeDuration.jsValue() - object[Strings.localTime] = localTime.jsValue() - object[Strings.progress] = progress.jsValue() - object[Strings.currentIteration] = currentIteration.jsValue() + object[Strings.startTime] = startTime.jsValue + object[Strings.endTime] = endTime.jsValue + object[Strings.activeDuration] = activeDuration.jsValue + object[Strings.localTime] = localTime.jsValue + object[Strings.progress] = progress.jsValue + object[Strings.currentIteration] = currentIteration.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ConnectionType.swift b/Sources/DOMKit/WebIDL/ConnectionType.swift index 29abeeac..634d7e2b 100644 --- a/Sources/DOMKit/WebIDL/ConnectionType.swift +++ b/Sources/DOMKit/WebIDL/ConnectionType.swift @@ -25,5 +25,5 @@ public enum ConnectionType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ConstantSourceNode.swift b/Sources/DOMKit/WebIDL/ConstantSourceNode.swift index 937234b2..5b0dfd3d 100644 --- a/Sources/DOMKit/WebIDL/ConstantSourceNode.swift +++ b/Sources/DOMKit/WebIDL/ConstantSourceNode.swift @@ -12,7 +12,7 @@ public class ConstantSourceNode: AudioScheduledSourceNode { } @inlinable public convenience init(context: BaseAudioContext, options: ConstantSourceOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift b/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift index 906ae7b9..3d94b1da 100644 --- a/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift +++ b/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ConstantSourceOptions: BridgedDictionary { public convenience init(offset: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.offset] = offset.jsValue() + object[Strings.offset] = offset.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ConstrainBoolean.swift b/Sources/DOMKit/WebIDL/ConstrainBoolean.swift index c5da22d0..e0f7a70c 100644 --- a/Sources/DOMKit/WebIDL/ConstrainBoolean.swift +++ b/Sources/DOMKit/WebIDL/ConstrainBoolean.swift @@ -21,12 +21,12 @@ public enum ConstrainBoolean: JSValueCompatible, Any_ConstrainBoolean { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .bool(bool): - return bool.jsValue() + return bool.jsValue case let .constrainBooleanParameters(constrainBooleanParameters): - return constrainBooleanParameters.jsValue() + return constrainBooleanParameters.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift b/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift index 28cc952e..aed2cd3b 100644 --- a/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift +++ b/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift @@ -6,8 +6,8 @@ import JavaScriptKit 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() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ConstrainDOMString.swift b/Sources/DOMKit/WebIDL/ConstrainDOMString.swift index 8329416d..aed2199e 100644 --- a/Sources/DOMKit/WebIDL/ConstrainDOMString.swift +++ b/Sources/DOMKit/WebIDL/ConstrainDOMString.swift @@ -26,14 +26,14 @@ public enum ConstrainDOMString: JSValueCompatible, Any_ConstrainDOMString { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .constrainDOMStringParameters(constrainDOMStringParameters): - return constrainDOMStringParameters.jsValue() + return constrainDOMStringParameters.jsValue case let .string(string): - return string.jsValue() + return string.jsValue case let .seq_of_String(seq_of_String): - return seq_of_String.jsValue() + return seq_of_String.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift b/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift index e9efdbf8..8a51b973 100644 --- a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift +++ b/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift @@ -6,8 +6,8 @@ import JavaScriptKit 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() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ConstrainDouble.swift b/Sources/DOMKit/WebIDL/ConstrainDouble.swift index e48fa61e..2ec0b242 100644 --- a/Sources/DOMKit/WebIDL/ConstrainDouble.swift +++ b/Sources/DOMKit/WebIDL/ConstrainDouble.swift @@ -21,12 +21,12 @@ public enum ConstrainDouble: JSValueCompatible, Any_ConstrainDouble { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .constrainDoubleRange(constrainDoubleRange): - return constrainDoubleRange.jsValue() + return constrainDoubleRange.jsValue case let .double(double): - return double.jsValue() + return double.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift b/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift index 1046449d..9ee176e9 100644 --- a/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift +++ b/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift @@ -6,8 +6,8 @@ import JavaScriptKit 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() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ConstrainPoint2D.swift b/Sources/DOMKit/WebIDL/ConstrainPoint2D.swift index 7094d719..2a81cf30 100644 --- a/Sources/DOMKit/WebIDL/ConstrainPoint2D.swift +++ b/Sources/DOMKit/WebIDL/ConstrainPoint2D.swift @@ -21,12 +21,12 @@ public enum ConstrainPoint2D: JSValueCompatible, Any_ConstrainPoint2D { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .constrainPoint2DParameters(constrainPoint2DParameters): - return constrainPoint2DParameters.jsValue() + return constrainPoint2DParameters.jsValue case let .seq_of_Point2D(seq_of_Point2D): - return seq_of_Point2D.jsValue() + return seq_of_Point2D.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift b/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift index 865d0b29..e9bc2ede 100644 --- a/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift +++ b/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ConstrainPoint2DParameters: BridgedDictionary { public convenience init(exact: [Point2D], ideal: [Point2D]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.exact] = exact.jsValue() - object[Strings.ideal] = ideal.jsValue() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ConstrainULong.swift b/Sources/DOMKit/WebIDL/ConstrainULong.swift index 0e0e938c..c6af86e4 100644 --- a/Sources/DOMKit/WebIDL/ConstrainULong.swift +++ b/Sources/DOMKit/WebIDL/ConstrainULong.swift @@ -21,12 +21,12 @@ public enum ConstrainULong: JSValueCompatible, Any_ConstrainULong { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .constrainULongRange(constrainULongRange): - return constrainULongRange.jsValue() + return constrainULongRange.jsValue case let .uInt32(uInt32): - return uInt32.jsValue() + return uInt32.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ConstrainULongRange.swift b/Sources/DOMKit/WebIDL/ConstrainULongRange.swift index 61ce0f06..5a87be30 100644 --- a/Sources/DOMKit/WebIDL/ConstrainULongRange.swift +++ b/Sources/DOMKit/WebIDL/ConstrainULongRange.swift @@ -6,8 +6,8 @@ import JavaScriptKit 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() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ContactInfo.swift b/Sources/DOMKit/WebIDL/ContactInfo.swift index 67b673b0..0d7fa663 100644 --- a/Sources/DOMKit/WebIDL/ContactInfo.swift +++ b/Sources/DOMKit/WebIDL/ContactInfo.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class ContactInfo: BridgedDictionary { public convenience init(address: [ContactAddress], email: [String], icon: [Blob], name: [String], tel: [String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.address] = address.jsValue() - object[Strings.email] = email.jsValue() - object[Strings.icon] = icon.jsValue() - object[Strings.name] = name.jsValue() - object[Strings.tel] = tel.jsValue() + object[Strings.address] = address.jsValue + object[Strings.email] = email.jsValue + object[Strings.icon] = icon.jsValue + object[Strings.name] = name.jsValue + object[Strings.tel] = tel.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ContactProperty.swift b/Sources/DOMKit/WebIDL/ContactProperty.swift index 2608d4ea..d9bbfdbd 100644 --- a/Sources/DOMKit/WebIDL/ContactProperty.swift +++ b/Sources/DOMKit/WebIDL/ContactProperty.swift @@ -21,5 +21,5 @@ public enum ContactProperty: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ContactsManager.swift b/Sources/DOMKit/WebIDL/ContactsManager.swift index 725fa1e0..24ab3fd8 100644 --- a/Sources/DOMKit/WebIDL/ContactsManager.swift +++ b/Sources/DOMKit/WebIDL/ContactsManager.swift @@ -21,18 +21,18 @@ public class ContactsManager: JSBridgedClass { @inlinable public func getProperties() async throws -> [ContactProperty] { let this = jsObject let _promise: JSPromise = this[Strings.getProperties].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.select].function!(this: this, arguments: [properties.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.select].function!(this: this, arguments: [properties.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) async throws -> [ContactInfo] { let this = jsObject - let _promise: JSPromise = this[Strings.select].function!(this: this, arguments: [properties.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.select].function!(this: this, arguments: [properties.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift b/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift index 23c0336f..0a989b96 100644 --- a/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift +++ b/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ContactsSelectOptions: BridgedDictionary { public convenience init(multiple: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.multiple] = multiple.jsValue() + object[Strings.multiple] = multiple.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ContentCategory.swift b/Sources/DOMKit/WebIDL/ContentCategory.swift index 2c1428c7..d6840252 100644 --- a/Sources/DOMKit/WebIDL/ContentCategory.swift +++ b/Sources/DOMKit/WebIDL/ContentCategory.swift @@ -21,5 +21,5 @@ public enum ContentCategory: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ContentDescription.swift b/Sources/DOMKit/WebIDL/ContentDescription.swift index c09f01b0..0b2c9fe0 100644 --- a/Sources/DOMKit/WebIDL/ContentDescription.swift +++ b/Sources/DOMKit/WebIDL/ContentDescription.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class ContentDescription: BridgedDictionary { public convenience init(id: String, title: String, description: String, category: ContentCategory, icons: [ImageResource], url: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue() - object[Strings.title] = title.jsValue() - object[Strings.description] = description.jsValue() - object[Strings.category] = category.jsValue() - object[Strings.icons] = icons.jsValue() - object[Strings.url] = url.jsValue() + object[Strings.id] = id.jsValue + object[Strings.title] = title.jsValue + object[Strings.description] = description.jsValue + object[Strings.category] = category.jsValue + object[Strings.icons] = icons.jsValue + object[Strings.url] = url.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ContentIndex.swift b/Sources/DOMKit/WebIDL/ContentIndex.swift index 597f9d9e..cd8398b8 100644 --- a/Sources/DOMKit/WebIDL/ContentIndex.swift +++ b/Sources/DOMKit/WebIDL/ContentIndex.swift @@ -14,26 +14,26 @@ public class ContentIndex: JSBridgedClass { @inlinable public func add(description: ContentDescription) -> JSPromise { let this = jsObject - return this[Strings.add].function!(this: this, arguments: [description.jsValue()]).fromJSValue()! + return this[Strings.add].function!(this: this, arguments: [description.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func add(description: ContentDescription) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.add].function!(this: this, arguments: [description.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.add].function!(this: this, arguments: [description.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func delete(id: String) -> JSPromise { let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! + return this[Strings.delete].function!(this: this, arguments: [id.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func delete(id: String) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [id.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func getAll() -> JSPromise { @@ -45,6 +45,6 @@ public class ContentIndex: JSBridgedClass { @inlinable public func getAll() async throws -> [ContentDescription] { let this = jsObject let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift b/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift index 7b82c67d..9b5e24d3 100644 --- a/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift +++ b/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ContentIndexEventInit: BridgedDictionary { public convenience init(id: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue() + object[Strings.id] = id.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift b/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift index 5dffa467..e5671dbc 100644 --- a/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift +++ b/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ConvertCoordinateOptions: BridgedDictionary { public convenience init(fromBox: CSSBoxType, toBox: CSSBoxType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fromBox] = fromBox.jsValue() - object[Strings.toBox] = toBox.jsValue() + object[Strings.fromBox] = fromBox.jsValue + object[Strings.toBox] = toBox.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ConvolverNode.swift b/Sources/DOMKit/WebIDL/ConvolverNode.swift index 8c59f544..bc79e7e7 100644 --- a/Sources/DOMKit/WebIDL/ConvolverNode.swift +++ b/Sources/DOMKit/WebIDL/ConvolverNode.swift @@ -13,7 +13,7 @@ public class ConvolverNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: ConvolverOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ConvolverOptions.swift b/Sources/DOMKit/WebIDL/ConvolverOptions.swift index fd438d57..5fcda090 100644 --- a/Sources/DOMKit/WebIDL/ConvolverOptions.swift +++ b/Sources/DOMKit/WebIDL/ConvolverOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ConvolverOptions: BridgedDictionary { public convenience init(buffer: AudioBuffer?, disableNormalization: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffer] = buffer.jsValue() - object[Strings.disableNormalization] = disableNormalization.jsValue() + object[Strings.buffer] = buffer.jsValue + object[Strings.disableNormalization] = disableNormalization.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CookieChangeEvent.swift b/Sources/DOMKit/WebIDL/CookieChangeEvent.swift index c891a26b..0380aed1 100644 --- a/Sources/DOMKit/WebIDL/CookieChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/CookieChangeEvent.swift @@ -13,7 +13,7 @@ public class CookieChangeEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: CookieChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift b/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift index ddd23a81..72e0ad9b 100644 --- a/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class CookieChangeEventInit: BridgedDictionary { public convenience init(changed: CookieList, deleted: CookieList) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.changed] = changed.jsValue() - object[Strings.deleted] = deleted.jsValue() + object[Strings.changed] = changed.jsValue + object[Strings.deleted] = deleted.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CookieInit.swift b/Sources/DOMKit/WebIDL/CookieInit.swift index fd5f9aff..63dbcd80 100644 --- a/Sources/DOMKit/WebIDL/CookieInit.swift +++ b/Sources/DOMKit/WebIDL/CookieInit.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class CookieInit: BridgedDictionary { public convenience init(name: String, value: String, expires: DOMTimeStamp?, domain: String?, path: String, sameSite: CookieSameSite) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.value] = value.jsValue() - object[Strings.expires] = expires.jsValue() - object[Strings.domain] = domain.jsValue() - object[Strings.path] = path.jsValue() - object[Strings.sameSite] = sameSite.jsValue() + object[Strings.name] = name.jsValue + object[Strings.value] = value.jsValue + object[Strings.expires] = expires.jsValue + object[Strings.domain] = domain.jsValue + object[Strings.path] = path.jsValue + object[Strings.sameSite] = sameSite.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CookieListItem.swift b/Sources/DOMKit/WebIDL/CookieListItem.swift index 51acd310..2e020ebb 100644 --- a/Sources/DOMKit/WebIDL/CookieListItem.swift +++ b/Sources/DOMKit/WebIDL/CookieListItem.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class CookieListItem: BridgedDictionary { public convenience init(name: String, value: String, domain: String?, path: String, expires: DOMTimeStamp?, secure: Bool, sameSite: CookieSameSite) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.value] = value.jsValue() - object[Strings.domain] = domain.jsValue() - object[Strings.path] = path.jsValue() - object[Strings.expires] = expires.jsValue() - object[Strings.secure] = secure.jsValue() - object[Strings.sameSite] = sameSite.jsValue() + object[Strings.name] = name.jsValue + object[Strings.value] = value.jsValue + object[Strings.domain] = domain.jsValue + object[Strings.path] = path.jsValue + object[Strings.expires] = expires.jsValue + object[Strings.secure] = secure.jsValue + object[Strings.sameSite] = sameSite.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CookieSameSite.swift b/Sources/DOMKit/WebIDL/CookieSameSite.swift index bd010a46..49cb425b 100644 --- a/Sources/DOMKit/WebIDL/CookieSameSite.swift +++ b/Sources/DOMKit/WebIDL/CookieSameSite.swift @@ -19,5 +19,5 @@ public enum CookieSameSite: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CookieStore.swift b/Sources/DOMKit/WebIDL/CookieStore.swift index 58e9a9a1..3de8846e 100644 --- a/Sources/DOMKit/WebIDL/CookieStore.swift +++ b/Sources/DOMKit/WebIDL/CookieStore.swift @@ -13,98 +13,98 @@ public class CookieStore: EventTarget { @inlinable public func get(name: String) -> JSPromise { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func get(name: String) async throws -> CookieListItem? { let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func get(options: CookieStoreGetOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func get(options: CookieStoreGetOptions? = nil) async throws -> CookieListItem? { let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getAll(name: String) -> JSPromise { let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.getAll].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getAll(name: String) async throws -> CookieList { let this = jsObject - let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getAll(options: CookieStoreGetOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getAll].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getAll(options: CookieStoreGetOptions? = nil) async throws -> CookieList { let this = jsObject - let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func set(name: String, value: String) -> JSPromise { let this = jsObject - return this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]).fromJSValue()! + return this[Strings.set].function!(this: this, arguments: [name.jsValue, value.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func set(name: String, value: String) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [name.jsValue, value.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func set(options: CookieInit) -> JSPromise { let this = jsObject - return this[Strings.set].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! + return this[Strings.set].function!(this: this, arguments: [options.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func set(options: CookieInit) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [options.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func delete(name: String) -> JSPromise { let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.delete].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func delete(name: String) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func delete(options: CookieStoreDeleteOptions) -> JSPromise { let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! + return this[Strings.delete].function!(this: this, arguments: [options.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func delete(options: CookieStoreDeleteOptions) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [options.jsValue]).fromJSValue()! + _ = try await _promise.value } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift b/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift index 2c67c3f5..6d7ca727 100644 --- a/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift +++ b/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class CookieStoreDeleteOptions: BridgedDictionary { public convenience init(name: String, domain: String?, path: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.domain] = domain.jsValue() - object[Strings.path] = path.jsValue() + object[Strings.name] = name.jsValue + object[Strings.domain] = domain.jsValue + object[Strings.path] = path.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift b/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift index b873989e..274f7d5a 100644 --- a/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift +++ b/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class CookieStoreGetOptions: BridgedDictionary { public convenience init(name: String, url: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.url] = url.jsValue() + object[Strings.name] = name.jsValue + object[Strings.url] = url.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CookieStoreManager.swift b/Sources/DOMKit/WebIDL/CookieStoreManager.swift index 50867061..add9e129 100644 --- a/Sources/DOMKit/WebIDL/CookieStoreManager.swift +++ b/Sources/DOMKit/WebIDL/CookieStoreManager.swift @@ -14,14 +14,14 @@ public class CookieStoreManager: JSBridgedClass { @inlinable public func subscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { let this = jsObject - return this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! + return this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func subscribe(subscriptions: [CookieStoreGetOptions]) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func getSubscriptions() -> JSPromise { @@ -33,18 +33,18 @@ public class CookieStoreManager: JSBridgedClass { @inlinable public func getSubscriptions() async throws -> [CookieStoreGetOptions] { let this = jsObject let _promise: JSPromise = this[Strings.getSubscriptions].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func unsubscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { let this = jsObject - return this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! + return this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func unsubscribe(subscriptions: [CookieStoreGetOptions]) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift index 2713a5c9..5362a092 100644 --- a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift @@ -15,7 +15,7 @@ public class CountQueuingStrategy: JSBridgedClass { } @inlinable public convenience init(init: QueuingStrategyInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift b/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift index 66db2d2d..37b53d63 100644 --- a/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift +++ b/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class CredentialCreationOptions: BridgedDictionary { public convenience init(signal: AbortSignal, password: PasswordCredentialInit, federated: FederatedCredentialInit, publicKey: PublicKeyCredentialCreationOptions) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue() - object[Strings.password] = password.jsValue() - object[Strings.federated] = federated.jsValue() - object[Strings.publicKey] = publicKey.jsValue() + object[Strings.signal] = signal.jsValue + object[Strings.password] = password.jsValue + object[Strings.federated] = federated.jsValue + object[Strings.publicKey] = publicKey.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CredentialData.swift b/Sources/DOMKit/WebIDL/CredentialData.swift index 7266cd8f..758574fb 100644 --- a/Sources/DOMKit/WebIDL/CredentialData.swift +++ b/Sources/DOMKit/WebIDL/CredentialData.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class CredentialData: BridgedDictionary { public convenience init(id: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue() + object[Strings.id] = id.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift b/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift index e14cdb7d..baed0604 100644 --- a/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift +++ b/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift @@ -20,5 +20,5 @@ public enum CredentialMediationRequirement: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift b/Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift index 2bac06cd..f917d103 100644 --- a/Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift +++ b/Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class CredentialPropertiesOutput: BridgedDictionary { public convenience init(rk: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rk] = rk.jsValue() + object[Strings.rk] = rk.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift index dd328fd6..f7f5503f 100644 --- a/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift +++ b/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class CredentialRequestOptions: BridgedDictionary { public convenience init(mediation: CredentialMediationRequirement, signal: AbortSignal, password: Bool, federated: FederatedCredentialRequestOptions, otp: OTPCredentialRequestOptions, publicKey: PublicKeyCredentialRequestOptions) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediation] = mediation.jsValue() - object[Strings.signal] = signal.jsValue() - object[Strings.password] = password.jsValue() - object[Strings.federated] = federated.jsValue() - object[Strings.otp] = otp.jsValue() - object[Strings.publicKey] = publicKey.jsValue() + object[Strings.mediation] = mediation.jsValue + object[Strings.signal] = signal.jsValue + object[Strings.password] = password.jsValue + object[Strings.federated] = federated.jsValue + object[Strings.otp] = otp.jsValue + object[Strings.publicKey] = publicKey.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CredentialsContainer.swift b/Sources/DOMKit/WebIDL/CredentialsContainer.swift index f536c1f3..f28b1c7f 100644 --- a/Sources/DOMKit/WebIDL/CredentialsContainer.swift +++ b/Sources/DOMKit/WebIDL/CredentialsContainer.swift @@ -14,38 +14,38 @@ public class CredentialsContainer: JSBridgedClass { @inlinable public func get(options: CredentialRequestOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func get(options: CredentialRequestOptions? = nil) async throws -> Credential? { let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func store(credential: Credential) -> JSPromise { let this = jsObject - return this[Strings.store].function!(this: this, arguments: [credential.jsValue()]).fromJSValue()! + return this[Strings.store].function!(this: this, arguments: [credential.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func store(credential: Credential) async throws -> Credential { let this = jsObject - let _promise: JSPromise = this[Strings.store].function!(this: this, arguments: [credential.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.store].function!(this: this, arguments: [credential.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func create(options: CredentialCreationOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.create].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.create].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func create(options: CredentialCreationOptions? = nil) async throws -> Credential? { let this = jsObject - let _promise: JSPromise = this[Strings.create].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.create].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func preventSilentAccess() -> JSPromise { @@ -57,6 +57,6 @@ public class CredentialsContainer: JSBridgedClass { @inlinable public func preventSilentAccess() async throws { let this = jsObject let _promise: JSPromise = this[Strings.preventSilentAccess].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/Crypto.swift b/Sources/DOMKit/WebIDL/Crypto.swift index df9830f2..4dd97060 100644 --- a/Sources/DOMKit/WebIDL/Crypto.swift +++ b/Sources/DOMKit/WebIDL/Crypto.swift @@ -18,7 +18,7 @@ public class Crypto: JSBridgedClass { @inlinable public func getRandomValues(array: ArrayBufferView) -> ArrayBufferView { let this = jsObject - return this[Strings.getRandomValues].function!(this: this, arguments: [array.jsValue()]).fromJSValue()! + return this[Strings.getRandomValues].function!(this: this, arguments: [array.jsValue]).fromJSValue()! } @inlinable public func randomUUID() -> String { diff --git a/Sources/DOMKit/WebIDL/CryptoKeyID.swift b/Sources/DOMKit/WebIDL/CryptoKeyID.swift index ab11a08d..5ba9ddbf 100644 --- a/Sources/DOMKit/WebIDL/CryptoKeyID.swift +++ b/Sources/DOMKit/WebIDL/CryptoKeyID.swift @@ -21,12 +21,12 @@ public enum CryptoKeyID: JSValueCompatible, Any_CryptoKeyID { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .smallCryptoKeyID(smallCryptoKeyID): - return smallCryptoKeyID.jsValue() + return smallCryptoKeyID.jsValue case let .__UNSUPPORTED_BIGINT__(__UNSUPPORTED_BIGINT__): - return __UNSUPPORTED_BIGINT__.jsValue() + return __UNSUPPORTED_BIGINT__.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/CryptoKeyPair.swift b/Sources/DOMKit/WebIDL/CryptoKeyPair.swift index c8d3fd68..5bc8e030 100644 --- a/Sources/DOMKit/WebIDL/CryptoKeyPair.swift +++ b/Sources/DOMKit/WebIDL/CryptoKeyPair.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class CryptoKeyPair: BridgedDictionary { public convenience init(publicKey: CryptoKey, privateKey: CryptoKey) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.publicKey] = publicKey.jsValue() - object[Strings.privateKey] = privateKey.jsValue() + object[Strings.publicKey] = publicKey.jsValue + object[Strings.privateKey] = privateKey.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift b/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift index 72067551..80aac352 100644 --- a/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift +++ b/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift @@ -19,5 +19,5 @@ public enum CursorCaptureConstraint: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift index 9a1f59ba..18c39967 100644 --- a/Sources/DOMKit/WebIDL/CustomElementRegistry.swift +++ b/Sources/DOMKit/WebIDL/CustomElementRegistry.swift @@ -14,28 +14,28 @@ public class CustomElementRegistry: JSBridgedClass { @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]) + _ = 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()! + 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()! + 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.get().fromJSValue()! + 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()]) + _ = this[Strings.upgrade].function!(this: this, arguments: [root.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/CustomEvent.swift b/Sources/DOMKit/WebIDL/CustomEvent.swift index 2e85b04f..cb6978e7 100644 --- a/Sources/DOMKit/WebIDL/CustomEvent.swift +++ b/Sources/DOMKit/WebIDL/CustomEvent.swift @@ -12,7 +12,7 @@ public class CustomEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: CustomEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -20,6 +20,6 @@ public class CustomEvent: Event { @inlinable public func initCustomEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, detail: JSValue? = nil) { let this = jsObject - _ = this[Strings.initCustomEvent].function!(this: this, arguments: [type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined, detail?.jsValue() ?? .undefined]) + _ = this[Strings.initCustomEvent].function!(this: this, arguments: [type.jsValue, bubbles?.jsValue ?? .undefined, cancelable?.jsValue ?? .undefined, detail?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/CustomEventInit.swift b/Sources/DOMKit/WebIDL/CustomEventInit.swift index a3447748..7447c406 100644 --- a/Sources/DOMKit/WebIDL/CustomEventInit.swift +++ b/Sources/DOMKit/WebIDL/CustomEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class CustomEventInit: BridgedDictionary { public convenience init(detail: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.detail] = detail.jsValue() + object[Strings.detail] = detail.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/CustomStateSet.swift b/Sources/DOMKit/WebIDL/CustomStateSet.swift index bb2924b2..0a8f82bf 100644 --- a/Sources/DOMKit/WebIDL/CustomStateSet.swift +++ b/Sources/DOMKit/WebIDL/CustomStateSet.swift @@ -16,6 +16,6 @@ public class CustomStateSet: JSBridgedClass { @inlinable public func add(value: String) { let this = jsObject - _ = this[Strings.add].function!(this: this, arguments: [value.jsValue()]) + _ = this[Strings.add].function!(this: this, arguments: [value.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/DOMException.swift b/Sources/DOMKit/WebIDL/DOMException.swift index 97fa9294..9dc26feb 100644 --- a/Sources/DOMKit/WebIDL/DOMException.swift +++ b/Sources/DOMKit/WebIDL/DOMException.swift @@ -16,7 +16,7 @@ public class DOMException: JSBridgedClass { } @inlinable public convenience init(message: String? = nil, name: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [message?.jsValue() ?? .undefined, name?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [message?.jsValue ?? .undefined, name?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift b/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift index 01707373..b85284df 100644 --- a/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift +++ b/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift @@ -21,12 +21,12 @@ public enum DOMHighResTimeStamp_or_String: JSValueCompatible, Any_DOMHighResTime return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .dOMHighResTimeStamp(dOMHighResTimeStamp): - return dOMHighResTimeStamp.jsValue() + return dOMHighResTimeStamp.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/DOMImplementation.swift b/Sources/DOMKit/WebIDL/DOMImplementation.swift index e219cbfc..c4a0457b 100644 --- a/Sources/DOMKit/WebIDL/DOMImplementation.swift +++ b/Sources/DOMKit/WebIDL/DOMImplementation.swift @@ -14,17 +14,17 @@ public class DOMImplementation: JSBridgedClass { @inlinable public func createDocumentType(qualifiedName: String, publicId: String, systemId: String) -> DocumentType { let this = jsObject - return this[Strings.createDocumentType].function!(this: this, arguments: [qualifiedName.jsValue(), publicId.jsValue(), systemId.jsValue()]).fromJSValue()! + return this[Strings.createDocumentType].function!(this: this, arguments: [qualifiedName.jsValue, publicId.jsValue, systemId.jsValue]).fromJSValue()! } @inlinable public func createDocument(namespace: String?, qualifiedName: String, doctype: DocumentType? = nil) -> XMLDocument { let this = jsObject - return this[Strings.createDocument].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), doctype?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createDocument].function!(this: this, arguments: [namespace.jsValue, qualifiedName.jsValue, doctype?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createHTMLDocument(title: String? = nil) -> Document { let this = jsObject - return this[Strings.createHTMLDocument].function!(this: this, arguments: [title?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createHTMLDocument].function!(this: this, arguments: [title?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func hasFeature() -> Bool { diff --git a/Sources/DOMKit/WebIDL/DOMMatrix.swift b/Sources/DOMKit/WebIDL/DOMMatrix.swift index e9b8220e..18cf4dd3 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix.swift @@ -33,7 +33,7 @@ public class DOMMatrix: DOMMatrixReadOnly { } @inlinable public convenience init(init: String_or_seq_of_Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) } // XXX: illegal static override @@ -179,58 +179,58 @@ public class DOMMatrix: DOMMatrixReadOnly { @inlinable public func multiplySelf(other: DOMMatrixInit? = nil) -> Self { let this = jsObject - return this[Strings.multiplySelf].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.multiplySelf].function!(this: this, arguments: [other?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func preMultiplySelf(other: DOMMatrixInit? = nil) -> Self { let this = jsObject - return this[Strings.preMultiplySelf].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.preMultiplySelf].function!(this: this, arguments: [other?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func translateSelf(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> Self { let this = jsObject - return this[Strings.translateSelf].function!(this: this, arguments: [tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.translateSelf].function!(this: this, arguments: [tx?.jsValue ?? .undefined, ty?.jsValue ?? .undefined, tz?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func scaleSelf(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { - let _arg0 = scaleX?.jsValue() ?? .undefined - let _arg1 = scaleY?.jsValue() ?? .undefined - let _arg2 = scaleZ?.jsValue() ?? .undefined - let _arg3 = originX?.jsValue() ?? .undefined - let _arg4 = originY?.jsValue() ?? .undefined - let _arg5 = originZ?.jsValue() ?? .undefined + let _arg0 = scaleX?.jsValue ?? .undefined + let _arg1 = scaleY?.jsValue ?? .undefined + let _arg2 = scaleZ?.jsValue ?? .undefined + let _arg3 = originX?.jsValue ?? .undefined + let _arg4 = originY?.jsValue ?? .undefined + let _arg5 = originZ?.jsValue ?? .undefined let this = jsObject return this[Strings.scaleSelf].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } @inlinable public func scale3dSelf(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> Self { let this = jsObject - return this[Strings.scale3dSelf].function!(this: this, arguments: [scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.scale3dSelf].function!(this: this, arguments: [scale?.jsValue ?? .undefined, originX?.jsValue ?? .undefined, originY?.jsValue ?? .undefined, originZ?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func rotateSelf(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> Self { let this = jsObject - return this[Strings.rotateSelf].function!(this: this, arguments: [rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.rotateSelf].function!(this: this, arguments: [rotX?.jsValue ?? .undefined, rotY?.jsValue ?? .undefined, rotZ?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func rotateFromVectorSelf(x: Double? = nil, y: Double? = nil) -> Self { let this = jsObject - return this[Strings.rotateFromVectorSelf].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.rotateFromVectorSelf].function!(this: this, arguments: [x?.jsValue ?? .undefined, y?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func rotateAxisAngleSelf(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> Self { let this = jsObject - return this[Strings.rotateAxisAngleSelf].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.rotateAxisAngleSelf].function!(this: this, arguments: [x?.jsValue ?? .undefined, y?.jsValue ?? .undefined, z?.jsValue ?? .undefined, angle?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func skewXSelf(sx: Double? = nil) -> Self { let this = jsObject - return this[Strings.skewXSelf].function!(this: this, arguments: [sx?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.skewXSelf].function!(this: this, arguments: [sx?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func skewYSelf(sy: Double? = nil) -> Self { let this = jsObject - return this[Strings.skewYSelf].function!(this: this, arguments: [sy?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.skewYSelf].function!(this: this, arguments: [sy?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func invertSelf() -> Self { @@ -240,6 +240,6 @@ public class DOMMatrix: DOMMatrixReadOnly { @inlinable public func setMatrixValue(transformList: String) -> Self { let this = jsObject - return this[Strings.setMatrixValue].function!(this: this, arguments: [transformList.jsValue()]).fromJSValue()! + return this[Strings.setMatrixValue].function!(this: this, arguments: [transformList.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift index aa5caaa4..06a3d09e 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrix2DInit.swift @@ -6,18 +6,18 @@ import JavaScriptKit public class DOMMatrix2DInit: BridgedDictionary { public convenience init(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double, m11: Double, m12: Double, m21: Double, m22: Double, m41: Double, m42: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.a] = a.jsValue() - object[Strings.b] = b.jsValue() - object[Strings.c] = c.jsValue() - object[Strings.d] = d.jsValue() - object[Strings.e] = e.jsValue() - object[Strings.f] = f.jsValue() - object[Strings.m11] = m11.jsValue() - object[Strings.m12] = m12.jsValue() - object[Strings.m21] = m21.jsValue() - object[Strings.m22] = m22.jsValue() - object[Strings.m41] = m41.jsValue() - object[Strings.m42] = m42.jsValue() + object[Strings.a] = a.jsValue + object[Strings.b] = b.jsValue + object[Strings.c] = c.jsValue + object[Strings.d] = d.jsValue + object[Strings.e] = e.jsValue + object[Strings.f] = f.jsValue + object[Strings.m11] = m11.jsValue + object[Strings.m12] = m12.jsValue + object[Strings.m21] = m21.jsValue + object[Strings.m22] = m22.jsValue + object[Strings.m41] = m41.jsValue + object[Strings.m42] = m42.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift index d21f1736..ad1d2d1d 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixInit.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixInit.swift @@ -6,17 +6,17 @@ import JavaScriptKit public class DOMMatrixInit: BridgedDictionary { public convenience init(m13: Double, m14: Double, m23: Double, m24: Double, m31: Double, m32: Double, m33: Double, m34: Double, m43: Double, m44: Double, is2D: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.m13] = m13.jsValue() - object[Strings.m14] = m14.jsValue() - object[Strings.m23] = m23.jsValue() - object[Strings.m24] = m24.jsValue() - object[Strings.m31] = m31.jsValue() - object[Strings.m32] = m32.jsValue() - object[Strings.m33] = m33.jsValue() - object[Strings.m34] = m34.jsValue() - object[Strings.m43] = m43.jsValue() - object[Strings.m44] = m44.jsValue() - object[Strings.is2D] = is2D.jsValue() + object[Strings.m13] = m13.jsValue + object[Strings.m14] = m14.jsValue + object[Strings.m23] = m23.jsValue + object[Strings.m24] = m24.jsValue + object[Strings.m31] = m31.jsValue + object[Strings.m32] = m32.jsValue + object[Strings.m33] = m33.jsValue + object[Strings.m34] = m34.jsValue + object[Strings.m43] = m43.jsValue + object[Strings.m44] = m44.jsValue + object[Strings.is2D] = is2D.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift index 4359e9f5..beec4a60 100644 --- a/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMMatrixReadOnly.swift @@ -37,22 +37,22 @@ public class DOMMatrixReadOnly: JSBridgedClass { } @inlinable public convenience init(init: String_or_seq_of_Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) } @inlinable public static func fromMatrix(other: DOMMatrixInit? = nil) -> Self { let this = constructor - return this[Strings.fromMatrix].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.fromMatrix].function!(this: this, arguments: [other?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public static func fromFloat32Array(array32: Float32Array) -> Self { let this = constructor - return this[Strings.fromFloat32Array].function!(this: this, arguments: [array32.jsValue()]).fromJSValue()! + return this[Strings.fromFloat32Array].function!(this: this, arguments: [array32.jsValue]).fromJSValue()! } @inlinable public static func fromFloat64Array(array64: Float64Array) -> Self { let this = constructor - return this[Strings.fromFloat64Array].function!(this: this, arguments: [array64.jsValue()]).fromJSValue()! + return this[Strings.fromFloat64Array].function!(this: this, arguments: [array64.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -129,58 +129,58 @@ public class DOMMatrixReadOnly: JSBridgedClass { @inlinable public func translate(tx: Double? = nil, ty: Double? = nil, tz: Double? = nil) -> DOMMatrix { let this = jsObject - return this[Strings.translate].function!(this: this, arguments: [tx?.jsValue() ?? .undefined, ty?.jsValue() ?? .undefined, tz?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.translate].function!(this: this, arguments: [tx?.jsValue ?? .undefined, ty?.jsValue ?? .undefined, tz?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func scale(scaleX: Double? = nil, scaleY: Double? = nil, scaleZ: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { - let _arg0 = scaleX?.jsValue() ?? .undefined - let _arg1 = scaleY?.jsValue() ?? .undefined - let _arg2 = scaleZ?.jsValue() ?? .undefined - let _arg3 = originX?.jsValue() ?? .undefined - let _arg4 = originY?.jsValue() ?? .undefined - let _arg5 = originZ?.jsValue() ?? .undefined + let _arg0 = scaleX?.jsValue ?? .undefined + let _arg1 = scaleY?.jsValue ?? .undefined + let _arg2 = scaleZ?.jsValue ?? .undefined + let _arg3 = originX?.jsValue ?? .undefined + let _arg4 = originY?.jsValue ?? .undefined + let _arg5 = originZ?.jsValue ?? .undefined let this = jsObject return this[Strings.scale].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } @inlinable public func scaleNonUniform(scaleX: Double? = nil, scaleY: Double? = nil) -> DOMMatrix { let this = jsObject - return this[Strings.scaleNonUniform].function!(this: this, arguments: [scaleX?.jsValue() ?? .undefined, scaleY?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.scaleNonUniform].function!(this: this, arguments: [scaleX?.jsValue ?? .undefined, scaleY?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func scale3d(scale: Double? = nil, originX: Double? = nil, originY: Double? = nil, originZ: Double? = nil) -> DOMMatrix { let this = jsObject - return this[Strings.scale3d].function!(this: this, arguments: [scale?.jsValue() ?? .undefined, originX?.jsValue() ?? .undefined, originY?.jsValue() ?? .undefined, originZ?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.scale3d].function!(this: this, arguments: [scale?.jsValue ?? .undefined, originX?.jsValue ?? .undefined, originY?.jsValue ?? .undefined, originZ?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func rotate(rotX: Double? = nil, rotY: Double? = nil, rotZ: Double? = nil) -> DOMMatrix { let this = jsObject - return this[Strings.rotate].function!(this: this, arguments: [rotX?.jsValue() ?? .undefined, rotY?.jsValue() ?? .undefined, rotZ?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.rotate].function!(this: this, arguments: [rotX?.jsValue ?? .undefined, rotY?.jsValue ?? .undefined, rotZ?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func rotateFromVector(x: Double? = nil, y: Double? = nil) -> DOMMatrix { let this = jsObject - return this[Strings.rotateFromVector].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.rotateFromVector].function!(this: this, arguments: [x?.jsValue ?? .undefined, y?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func rotateAxisAngle(x: Double? = nil, y: Double? = nil, z: Double? = nil, angle: Double? = nil) -> DOMMatrix { let this = jsObject - return this[Strings.rotateAxisAngle].function!(this: this, arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, angle?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.rotateAxisAngle].function!(this: this, arguments: [x?.jsValue ?? .undefined, y?.jsValue ?? .undefined, z?.jsValue ?? .undefined, angle?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func skewX(sx: Double? = nil) -> DOMMatrix { let this = jsObject - return this[Strings.skewX].function!(this: this, arguments: [sx?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.skewX].function!(this: this, arguments: [sx?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func skewY(sy: Double? = nil) -> DOMMatrix { let this = jsObject - return this[Strings.skewY].function!(this: this, arguments: [sy?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.skewY].function!(this: this, arguments: [sy?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func multiply(other: DOMMatrixInit? = nil) -> DOMMatrix { let this = jsObject - return this[Strings.multiply].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.multiply].function!(this: this, arguments: [other?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func flipX() -> DOMMatrix { @@ -200,7 +200,7 @@ public class DOMMatrixReadOnly: JSBridgedClass { @inlinable public func transformPoint(point: DOMPointInit? = nil) -> DOMPoint { let this = jsObject - return this[Strings.transformPoint].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.transformPoint].function!(this: this, arguments: [point?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func toFloat32Array() -> Float32Array { diff --git a/Sources/DOMKit/WebIDL/DOMParser.swift b/Sources/DOMKit/WebIDL/DOMParser.swift index 08c98e51..05ae1ed7 100644 --- a/Sources/DOMKit/WebIDL/DOMParser.swift +++ b/Sources/DOMKit/WebIDL/DOMParser.swift @@ -18,6 +18,6 @@ public class DOMParser: JSBridgedClass { @inlinable public func parseFromString(string: String, type: DOMParserSupportedType) -> Document { let this = jsObject - return this[Strings.parseFromString].function!(this: this, arguments: [string.jsValue(), type.jsValue()]).fromJSValue()! + return this[Strings.parseFromString].function!(this: this, arguments: [string.jsValue, type.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift index f1974c1a..273ffda3 100644 --- a/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift +++ b/Sources/DOMKit/WebIDL/DOMParserSupportedType.swift @@ -21,5 +21,5 @@ public enum DOMParserSupportedType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/DOMPoint.swift b/Sources/DOMKit/WebIDL/DOMPoint.swift index be3e681e..a6a4c7af 100644 --- a/Sources/DOMKit/WebIDL/DOMPoint.swift +++ b/Sources/DOMKit/WebIDL/DOMPoint.swift @@ -15,7 +15,7 @@ public class DOMPoint: DOMPointReadOnly { } @inlinable public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue ?? .undefined, y?.jsValue ?? .undefined, z?.jsValue ?? .undefined, w?.jsValue ?? .undefined])) } // XXX: illegal static override diff --git a/Sources/DOMKit/WebIDL/DOMPointInit.swift b/Sources/DOMKit/WebIDL/DOMPointInit.swift index 3ec95447..375d2f33 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class DOMPointInit: BridgedDictionary { public convenience init(x: Double, y: Double, z: Double, w: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.z] = z.jsValue() - object[Strings.w] = w.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.z] = z.jsValue + object[Strings.w] = w.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift index 74e5b1b3..ca4dce43 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift @@ -21,12 +21,12 @@ public enum DOMPointInit_or_Double: JSValueCompatible, Any_DOMPointInit_or_Doubl return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .dOMPointInit(dOMPointInit): - return dOMPointInit.jsValue() + return dOMPointInit.jsValue case let .double(double): - return double.jsValue() + return double.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift index 6dd73ac6..e0cd7200 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift @@ -26,14 +26,14 @@ public enum DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double: JSValueComp return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .dOMPointInit(dOMPointInit): - return dOMPointInit.jsValue() + return dOMPointInit.jsValue case let .double(double): - return double.jsValue() + return double.jsValue case let .seq_of_DOMPointInit_or_Double(seq_of_DOMPointInit_or_Double): - return seq_of_DOMPointInit_or_Double.jsValue() + return seq_of_DOMPointInit_or_Double.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift index 4b9f1735..40a34293 100644 --- a/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMPointReadOnly.swift @@ -17,12 +17,12 @@ public class DOMPointReadOnly: JSBridgedClass { } @inlinable public convenience init(x: Double? = nil, y: Double? = nil, z: Double? = nil, w: Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, z?.jsValue() ?? .undefined, w?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue ?? .undefined, y?.jsValue ?? .undefined, z?.jsValue ?? .undefined, w?.jsValue ?? .undefined])) } @inlinable public static func fromPoint(other: DOMPointInit? = nil) -> Self { let this = constructor - return this[Strings.fromPoint].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.fromPoint].function!(this: this, arguments: [other?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -39,7 +39,7 @@ public class DOMPointReadOnly: JSBridgedClass { @inlinable public func matrixTransform(matrix: DOMMatrixInit? = nil) -> DOMPoint { let this = jsObject - return this[Strings.matrixTransform].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.matrixTransform].function!(this: this, arguments: [matrix?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func toJSON() -> JSObject { diff --git a/Sources/DOMKit/WebIDL/DOMQuad.swift b/Sources/DOMKit/WebIDL/DOMQuad.swift index e2cc8d59..258b0fd5 100644 --- a/Sources/DOMKit/WebIDL/DOMQuad.swift +++ b/Sources/DOMKit/WebIDL/DOMQuad.swift @@ -17,17 +17,17 @@ public class DOMQuad: JSBridgedClass { } @inlinable public convenience init(p1: DOMPointInit? = nil, p2: DOMPointInit? = nil, p3: DOMPointInit? = nil, p4: DOMPointInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [p1?.jsValue() ?? .undefined, p2?.jsValue() ?? .undefined, p3?.jsValue() ?? .undefined, p4?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [p1?.jsValue ?? .undefined, p2?.jsValue ?? .undefined, p3?.jsValue ?? .undefined, p4?.jsValue ?? .undefined])) } @inlinable public static func fromRect(other: DOMRectInit? = nil) -> Self { let this = constructor - return this[Strings.fromRect].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.fromRect].function!(this: this, arguments: [other?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public static func fromQuad(other: DOMQuadInit? = nil) -> Self { let this = constructor - return this[Strings.fromQuad].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.fromQuad].function!(this: this, arguments: [other?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DOMQuadInit.swift b/Sources/DOMKit/WebIDL/DOMQuadInit.swift index cc4ef6a4..19faf473 100644 --- a/Sources/DOMKit/WebIDL/DOMQuadInit.swift +++ b/Sources/DOMKit/WebIDL/DOMQuadInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class DOMQuadInit: BridgedDictionary { public convenience init(p1: DOMPointInit, p2: DOMPointInit, p3: DOMPointInit, p4: DOMPointInit) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.p1] = p1.jsValue() - object[Strings.p2] = p2.jsValue() - object[Strings.p3] = p3.jsValue() - object[Strings.p4] = p4.jsValue() + object[Strings.p1] = p1.jsValue + object[Strings.p2] = p2.jsValue + object[Strings.p3] = p3.jsValue + object[Strings.p4] = p4.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMRect.swift b/Sources/DOMKit/WebIDL/DOMRect.swift index 79113a82..8214b20d 100644 --- a/Sources/DOMKit/WebIDL/DOMRect.swift +++ b/Sources/DOMKit/WebIDL/DOMRect.swift @@ -15,7 +15,7 @@ public class DOMRect: DOMRectReadOnly { } @inlinable public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue ?? .undefined, y?.jsValue ?? .undefined, width?.jsValue ?? .undefined, height?.jsValue ?? .undefined])) } // XXX: illegal static override diff --git a/Sources/DOMKit/WebIDL/DOMRectInit.swift b/Sources/DOMKit/WebIDL/DOMRectInit.swift index 5e17de6f..0c6ec947 100644 --- a/Sources/DOMKit/WebIDL/DOMRectInit.swift +++ b/Sources/DOMKit/WebIDL/DOMRectInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class DOMRectInit: BridgedDictionary { public convenience init(x: Double, y: Double, width: Double, height: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.width] = width.jsValue() - object[Strings.height] = height.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift index bf63ce8a..c4d49955 100644 --- a/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift +++ b/Sources/DOMKit/WebIDL/DOMRectReadOnly.swift @@ -21,12 +21,12 @@ public class DOMRectReadOnly: JSBridgedClass { } @inlinable public convenience init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue() ?? .undefined, y?.jsValue() ?? .undefined, width?.jsValue() ?? .undefined, height?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [x?.jsValue ?? .undefined, y?.jsValue ?? .undefined, width?.jsValue ?? .undefined, height?.jsValue ?? .undefined])) } @inlinable public static func fromRect(other: DOMRectInit? = nil) -> Self { let this = constructor - return this[Strings.fromRect].function!(this: this, arguments: [other?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.fromRect].function!(this: this, arguments: [other?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DOMStringList.swift b/Sources/DOMKit/WebIDL/DOMStringList.swift index 22a49b1e..78686c50 100644 --- a/Sources/DOMKit/WebIDL/DOMStringList.swift +++ b/Sources/DOMKit/WebIDL/DOMStringList.swift @@ -22,6 +22,6 @@ public class DOMStringList: JSBridgedClass { @inlinable public func contains(string: String) -> Bool { let this = jsObject - return this[Strings.contains].function!(this: this, arguments: [string.jsValue()]).fromJSValue()! + return this[Strings.contains].function!(this: this, arguments: [string.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DOMTokenList.swift b/Sources/DOMKit/WebIDL/DOMTokenList.swift index 70f8281b..4cc9cd76 100644 --- a/Sources/DOMKit/WebIDL/DOMTokenList.swift +++ b/Sources/DOMKit/WebIDL/DOMTokenList.swift @@ -23,32 +23,32 @@ public class DOMTokenList: JSBridgedClass, Sequence { @inlinable public func contains(token: String) -> Bool { let this = jsObject - return this[Strings.contains].function!(this: this, arguments: [token.jsValue()]).fromJSValue()! + return this[Strings.contains].function!(this: this, arguments: [token.jsValue]).fromJSValue()! } @inlinable public func add(tokens: String...) { let this = jsObject - _ = this[Strings.add].function!(this: this, arguments: tokens.map { $0.jsValue() }) + _ = this[Strings.add].function!(this: this, arguments: tokens.map(\.jsValue)) } @inlinable public func remove(tokens: String...) { let this = jsObject - _ = this[Strings.remove].function!(this: this, arguments: tokens.map { $0.jsValue() }) + _ = this[Strings.remove].function!(this: this, arguments: tokens.map(\.jsValue)) } @inlinable public func toggle(token: String, force: Bool? = nil) -> Bool { let this = jsObject - return this[Strings.toggle].function!(this: this, arguments: [token.jsValue(), force?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.toggle].function!(this: this, arguments: [token.jsValue, force?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func replace(token: String, newToken: String) -> Bool { let this = jsObject - return this[Strings.replace].function!(this: this, arguments: [token.jsValue(), newToken.jsValue()]).fromJSValue()! + return this[Strings.replace].function!(this: this, arguments: [token.jsValue, newToken.jsValue]).fromJSValue()! } @inlinable public func supports(token: String) -> Bool { let this = jsObject - return this[Strings.supports].function!(this: this, arguments: [token.jsValue()]).fromJSValue()! + return this[Strings.supports].function!(this: this, arguments: [token.jsValue]).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DataCue.swift b/Sources/DOMKit/WebIDL/DataCue.swift index 07837fdf..76429700 100644 --- a/Sources/DOMKit/WebIDL/DataCue.swift +++ b/Sources/DOMKit/WebIDL/DataCue.swift @@ -13,7 +13,7 @@ public class DataCue: TextTrackCue { } @inlinable public convenience init(startTime: Double, endTime: Double, value: JSValue, type: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue(), endTime.jsValue(), value.jsValue(), type?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue, endTime.jsValue, value.jsValue, type?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransfer.swift b/Sources/DOMKit/WebIDL/DataTransfer.swift index 2567cd76..a96259e9 100644 --- a/Sources/DOMKit/WebIDL/DataTransfer.swift +++ b/Sources/DOMKit/WebIDL/DataTransfer.swift @@ -32,7 +32,7 @@ public class DataTransfer: JSBridgedClass { @inlinable public func setDragImage(image: Element, x: Int32, y: Int32) { let this = jsObject - _ = this[Strings.setDragImage].function!(this: this, arguments: [image.jsValue(), x.jsValue(), y.jsValue()]) + _ = this[Strings.setDragImage].function!(this: this, arguments: [image.jsValue, x.jsValue, y.jsValue]) } @ReadonlyAttribute @@ -40,17 +40,17 @@ public class DataTransfer: JSBridgedClass { @inlinable public func getData(format: String) -> String { let this = jsObject - return this[Strings.getData].function!(this: this, arguments: [format.jsValue()]).fromJSValue()! + return this[Strings.getData].function!(this: this, arguments: [format.jsValue]).fromJSValue()! } @inlinable public func setData(format: String, data: String) { let this = jsObject - _ = this[Strings.setData].function!(this: this, arguments: [format.jsValue(), data.jsValue()]) + _ = this[Strings.setData].function!(this: this, arguments: [format.jsValue, data.jsValue]) } @inlinable public func clearData(format: String? = nil) { let this = jsObject - _ = this[Strings.clearData].function!(this: this, arguments: [format?.jsValue() ?? .undefined]) + _ = this[Strings.clearData].function!(this: this, arguments: [format?.jsValue ?? .undefined]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index 753737de..e36f0b63 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -28,7 +28,7 @@ public class DataTransferItem: JSBridgedClass { @inlinable public func getAsFileSystemHandle() async throws -> FileSystemHandle? { let this = jsObject let _promise: JSPromise = this[Strings.getAsFileSystemHandle].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DataTransferItemList.swift b/Sources/DOMKit/WebIDL/DataTransferItemList.swift index 48fe3d81..0e00f762 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItemList.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItemList.swift @@ -22,17 +22,17 @@ public class DataTransferItemList: JSBridgedClass { @inlinable public func add(data: String, type: String) -> DataTransferItem? { let this = jsObject - return this[Strings.add].function!(this: this, arguments: [data.jsValue(), type.jsValue()]).fromJSValue()! + return this[Strings.add].function!(this: this, arguments: [data.jsValue, type.jsValue]).fromJSValue()! } @inlinable public func add(data: File) -> DataTransferItem? { let this = jsObject - return this[Strings.add].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! + return this[Strings.add].function!(this: this, arguments: [data.jsValue]).fromJSValue()! } @inlinable public func remove(index: UInt32) { let this = jsObject - _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue]) } @inlinable public func clear() { diff --git a/Sources/DOMKit/WebIDL/DecompressionStream.swift b/Sources/DOMKit/WebIDL/DecompressionStream.swift index 3603e556..1c49a500 100644 --- a/Sources/DOMKit/WebIDL/DecompressionStream.swift +++ b/Sources/DOMKit/WebIDL/DecompressionStream.swift @@ -13,6 +13,6 @@ public class DecompressionStream: JSBridgedClass, GenericTransformStream { } @inlinable public convenience init(format: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue])) } } diff --git a/Sources/DOMKit/WebIDL/DelayNode.swift b/Sources/DOMKit/WebIDL/DelayNode.swift index 9ea06e52..2d6a1fbe 100644 --- a/Sources/DOMKit/WebIDL/DelayNode.swift +++ b/Sources/DOMKit/WebIDL/DelayNode.swift @@ -12,7 +12,7 @@ public class DelayNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: DelayOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DelayOptions.swift b/Sources/DOMKit/WebIDL/DelayOptions.swift index 6f652255..5389fd20 100644 --- a/Sources/DOMKit/WebIDL/DelayOptions.swift +++ b/Sources/DOMKit/WebIDL/DelayOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class DelayOptions: BridgedDictionary { public convenience init(maxDelayTime: Double, delayTime: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.maxDelayTime] = maxDelayTime.jsValue() - object[Strings.delayTime] = delayTime.jsValue() + object[Strings.maxDelayTime] = maxDelayTime.jsValue + object[Strings.delayTime] = delayTime.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DetectedBarcode.swift b/Sources/DOMKit/WebIDL/DetectedBarcode.swift index 24fc1341..a68e8a4d 100644 --- a/Sources/DOMKit/WebIDL/DetectedBarcode.swift +++ b/Sources/DOMKit/WebIDL/DetectedBarcode.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class DetectedBarcode: BridgedDictionary { public convenience init(boundingBox: DOMRectReadOnly, rawValue: String, format: BarcodeFormat, cornerPoints: [Point2D]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.boundingBox] = boundingBox.jsValue() - object[Strings.rawValue] = rawValue.jsValue() - object[Strings.format] = format.jsValue() - object[Strings.cornerPoints] = cornerPoints.jsValue() + object[Strings.boundingBox] = boundingBox.jsValue + object[Strings.rawValue] = rawValue.jsValue + object[Strings.format] = format.jsValue + object[Strings.cornerPoints] = cornerPoints.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DetectedFace.swift b/Sources/DOMKit/WebIDL/DetectedFace.swift index ba2d672e..54ff8272 100644 --- a/Sources/DOMKit/WebIDL/DetectedFace.swift +++ b/Sources/DOMKit/WebIDL/DetectedFace.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class DetectedFace: BridgedDictionary { public convenience init(boundingBox: DOMRectReadOnly, landmarks: [Landmark]?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.boundingBox] = boundingBox.jsValue() - object[Strings.landmarks] = landmarks.jsValue() + object[Strings.boundingBox] = boundingBox.jsValue + object[Strings.landmarks] = landmarks.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DetectedText.swift b/Sources/DOMKit/WebIDL/DetectedText.swift index 3617aec7..39e23a4b 100644 --- a/Sources/DOMKit/WebIDL/DetectedText.swift +++ b/Sources/DOMKit/WebIDL/DetectedText.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class DetectedText: BridgedDictionary { public convenience init(boundingBox: DOMRectReadOnly, rawValue: String, cornerPoints: [Point2D]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.boundingBox] = boundingBox.jsValue() - object[Strings.rawValue] = rawValue.jsValue() - object[Strings.cornerPoints] = cornerPoints.jsValue() + object[Strings.boundingBox] = boundingBox.jsValue + object[Strings.rawValue] = rawValue.jsValue + object[Strings.cornerPoints] = cornerPoints.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift index 4a7ef2a4..0a3c9542 100644 --- a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift +++ b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift @@ -15,7 +15,7 @@ public class DeviceMotionEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: DeviceMotionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -39,6 +39,6 @@ public class DeviceMotionEvent: Event { @inlinable public static func requestPermission() async throws -> PermissionState { let this = constructor let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift index 732fd86c..c5f6454d 100644 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class DeviceMotionEventAccelerationInit: BridgedDictionary { public convenience init(x: Double?, y: Double?, z: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.z] = z.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.z] = z.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift index be84b191..3b2ecc08 100644 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class DeviceMotionEventInit: BridgedDictionary { public convenience init(acceleration: DeviceMotionEventAccelerationInit, accelerationIncludingGravity: DeviceMotionEventAccelerationInit, rotationRate: DeviceMotionEventRotationRateInit, interval: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.acceleration] = acceleration.jsValue() - object[Strings.accelerationIncludingGravity] = accelerationIncludingGravity.jsValue() - object[Strings.rotationRate] = rotationRate.jsValue() - object[Strings.interval] = interval.jsValue() + object[Strings.acceleration] = acceleration.jsValue + object[Strings.accelerationIncludingGravity] = accelerationIncludingGravity.jsValue + object[Strings.rotationRate] = rotationRate.jsValue + object[Strings.interval] = interval.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift index b84fc37e..780293c8 100644 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift +++ b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class DeviceMotionEventRotationRateInit: BridgedDictionary { public convenience init(alpha: Double?, beta: Double?, gamma: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue() - object[Strings.beta] = beta.jsValue() - object[Strings.gamma] = gamma.jsValue() + object[Strings.alpha] = alpha.jsValue + object[Strings.beta] = beta.jsValue + object[Strings.gamma] = gamma.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift index cfd8338d..0bd3d13b 100644 --- a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift +++ b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift @@ -15,7 +15,7 @@ public class DeviceOrientationEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: DeviceOrientationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -39,6 +39,6 @@ public class DeviceOrientationEvent: Event { @inlinable public static func requestPermission() async throws -> PermissionState { let this = constructor let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift b/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift index 1c484cdd..3f721de2 100644 --- a/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift +++ b/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class DeviceOrientationEventInit: BridgedDictionary { public convenience init(alpha: Double?, beta: Double?, gamma: Double?, absolute: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue() - object[Strings.beta] = beta.jsValue() - object[Strings.gamma] = gamma.jsValue() - object[Strings.absolute] = absolute.jsValue() + object[Strings.alpha] = alpha.jsValue + object[Strings.beta] = beta.jsValue + object[Strings.gamma] = gamma.jsValue + object[Strings.absolute] = absolute.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift b/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift index 59a01900..92ae09de 100644 --- a/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class DevicePermissionDescriptor: BridgedDictionary { public convenience init(deviceId: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.deviceId] = deviceId.jsValue() + object[Strings.deviceId] = deviceId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DevicePostureType.swift b/Sources/DOMKit/WebIDL/DevicePostureType.swift index 55b542b6..2c4effe8 100644 --- a/Sources/DOMKit/WebIDL/DevicePostureType.swift +++ b/Sources/DOMKit/WebIDL/DevicePostureType.swift @@ -19,5 +19,5 @@ public enum DevicePostureType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/DigitalGoodsService.swift b/Sources/DOMKit/WebIDL/DigitalGoodsService.swift index be1211f3..d2484704 100644 --- a/Sources/DOMKit/WebIDL/DigitalGoodsService.swift +++ b/Sources/DOMKit/WebIDL/DigitalGoodsService.swift @@ -14,14 +14,14 @@ public class DigitalGoodsService: JSBridgedClass { @inlinable public func getDetails(itemIds: [String]) -> JSPromise { let this = jsObject - return this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue()]).fromJSValue()! + return this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getDetails(itemIds: [String]) async throws -> [ItemDetails] { let this = jsObject - let _promise: JSPromise = this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func listPurchases() -> JSPromise { @@ -33,7 +33,7 @@ public class DigitalGoodsService: JSBridgedClass { @inlinable public func listPurchases() async throws -> [PurchaseDetails] { let this = jsObject let _promise: JSPromise = this[Strings.listPurchases].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func listPurchaseHistory() -> JSPromise { @@ -45,18 +45,18 @@ public class DigitalGoodsService: JSBridgedClass { @inlinable public func listPurchaseHistory() async throws -> [PurchaseDetails] { let this = jsObject let _promise: JSPromise = this[Strings.listPurchaseHistory].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func consume(purchaseToken: String) -> JSPromise { let this = jsObject - return this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue()]).fromJSValue()! + return this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func consume(purchaseToken: String) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/DirectionSetting.swift b/Sources/DOMKit/WebIDL/DirectionSetting.swift index 0b76fce4..283f3ef9 100644 --- a/Sources/DOMKit/WebIDL/DirectionSetting.swift +++ b/Sources/DOMKit/WebIDL/DirectionSetting.swift @@ -19,5 +19,5 @@ public enum DirectionSetting: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift b/Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift index 573582cc..b2afb7e8 100644 --- a/Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift +++ b/Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class DirectoryPickerOptions: BridgedDictionary { public convenience init(id: String, startIn: StartInDirectory) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue() - object[Strings.startIn] = startIn.jsValue() + object[Strings.id] = id.jsValue + object[Strings.startIn] = startIn.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift b/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift index 485a9b60..b779a1e0 100644 --- a/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift +++ b/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift @@ -20,5 +20,5 @@ public enum DisplayCaptureSurfaceType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift index 39f0991c..94c30908 100644 --- a/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift +++ b/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class DisplayMediaStreamConstraints: BridgedDictionary { public convenience init(video: Bool_or_MediaTrackConstraints, audio: Bool_or_MediaTrackConstraints) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.video] = video.jsValue() - object[Strings.audio] = audio.jsValue() + object[Strings.video] = video.jsValue + object[Strings.audio] = audio.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DistanceModelType.swift b/Sources/DOMKit/WebIDL/DistanceModelType.swift index 0d13990b..0e2a163d 100644 --- a/Sources/DOMKit/WebIDL/DistanceModelType.swift +++ b/Sources/DOMKit/WebIDL/DistanceModelType.swift @@ -19,5 +19,5 @@ public enum DistanceModelType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 754f5a8a..56e4ec76 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -75,17 +75,17 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func elementFromPoint(x: Double, y: Double) -> Element? { let this = jsObject - return this[Strings.elementFromPoint].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! + return this[Strings.elementFromPoint].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! } @inlinable public func elementsFromPoint(x: Double, y: Double) -> [Element] { let this = jsObject - return this[Strings.elementsFromPoint].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! + return this[Strings.elementsFromPoint].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! } @inlinable public func caretPositionFromPoint(x: Double, y: Double) -> CaretPosition? { let this = jsObject - return this[Strings.caretPositionFromPoint].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! + return this[Strings.caretPositionFromPoint].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -127,27 +127,27 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { let this = jsObject - return this[Strings.getElementsByTagName].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! + return this[Strings.getElementsByTagName].function!(this: this, arguments: [qualifiedName.jsValue]).fromJSValue()! } @inlinable public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { let this = jsObject - return this[Strings.getElementsByTagNameNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! + return this[Strings.getElementsByTagNameNS].function!(this: this, arguments: [namespace.jsValue, localName.jsValue]).fromJSValue()! } @inlinable public func getElementsByClassName(classNames: String) -> HTMLCollection { let this = jsObject - return this[Strings.getElementsByClassName].function!(this: this, arguments: [classNames.jsValue()]).fromJSValue()! + return this[Strings.getElementsByClassName].function!(this: this, arguments: [classNames.jsValue]).fromJSValue()! } @inlinable public func createElement(localName: String, options: ElementCreationOptions_or_String? = nil) -> Element { let this = jsObject - return this[Strings.createElement].function!(this: this, arguments: [localName.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createElement].function!(this: this, arguments: [localName.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createElementNS(namespace: String?, qualifiedName: String, options: ElementCreationOptions_or_String? = nil) -> Element { let this = jsObject - return this[Strings.createElementNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createElementNS].function!(this: this, arguments: [namespace.jsValue, qualifiedName.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createDocumentFragment() -> DocumentFragment { @@ -157,47 +157,47 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func createTextNode(data: String) -> Text { let this = jsObject - return this[Strings.createTextNode].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! + return this[Strings.createTextNode].function!(this: this, arguments: [data.jsValue]).fromJSValue()! } @inlinable public func createCDATASection(data: String) -> CDATASection { let this = jsObject - return this[Strings.createCDATASection].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! + return this[Strings.createCDATASection].function!(this: this, arguments: [data.jsValue]).fromJSValue()! } @inlinable public func createComment(data: String) -> Comment { let this = jsObject - return this[Strings.createComment].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! + return this[Strings.createComment].function!(this: this, arguments: [data.jsValue]).fromJSValue()! } @inlinable public func createProcessingInstruction(target: String, data: String) -> ProcessingInstruction { let this = jsObject - return this[Strings.createProcessingInstruction].function!(this: this, arguments: [target.jsValue(), data.jsValue()]).fromJSValue()! + return this[Strings.createProcessingInstruction].function!(this: this, arguments: [target.jsValue, data.jsValue]).fromJSValue()! } @inlinable public func importNode(node: Node, deep: Bool? = nil) -> Node { let this = jsObject - return this[Strings.importNode].function!(this: this, arguments: [node.jsValue(), deep?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.importNode].function!(this: this, arguments: [node.jsValue, deep?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func adoptNode(node: Node) -> Node { let this = jsObject - return this[Strings.adoptNode].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! + return this[Strings.adoptNode].function!(this: this, arguments: [node.jsValue]).fromJSValue()! } @inlinable public func createAttribute(localName: String) -> Attr { let this = jsObject - return this[Strings.createAttribute].function!(this: this, arguments: [localName.jsValue()]).fromJSValue()! + return this[Strings.createAttribute].function!(this: this, arguments: [localName.jsValue]).fromJSValue()! } @inlinable public func createAttributeNS(namespace: String?, qualifiedName: String) -> Attr { let this = jsObject - return this[Strings.createAttributeNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue()]).fromJSValue()! + return this[Strings.createAttributeNS].function!(this: this, arguments: [namespace.jsValue, qualifiedName.jsValue]).fromJSValue()! } @inlinable public func createEvent(interface: String) -> Event { let this = jsObject - return this[Strings.createEvent].function!(this: this, arguments: [interface.jsValue()]).fromJSValue()! + return this[Strings.createEvent].function!(this: this, arguments: [interface.jsValue]).fromJSValue()! } @inlinable public func createRange() -> Range { @@ -211,12 +211,12 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func measureElement(element: Element) -> FontMetrics { let this = jsObject - return this[Strings.measureElement].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! + return this[Strings.measureElement].function!(this: this, arguments: [element.jsValue]).fromJSValue()! } @inlinable public func measureText(text: String, styleMap: StylePropertyMapReadOnly) -> FontMetrics { let this = jsObject - return this[Strings.measureText].function!(this: this, arguments: [text.jsValue(), styleMap.jsValue()]).fromJSValue()! + return this[Strings.measureText].function!(this: this, arguments: [text.jsValue, styleMap.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -234,7 +234,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func exitFullscreen() async throws { let this = jsObject let _promise: JSPromise = this[Strings.exitFullscreen].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @ClosureAttribute1Optional @@ -297,7 +297,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func getElementsByName(elementName: String) -> NodeList { let this = jsObject - return this[Strings.getElementsByName].function!(this: this, arguments: [elementName.jsValue()]).fromJSValue()! + return this[Strings.getElementsByName].function!(this: this, arguments: [elementName.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -305,12 +305,12 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func open(unused1: String? = nil, unused2: String? = nil) -> Self { let this = jsObject - return this[Strings.open].function!(this: this, arguments: [unused1?.jsValue() ?? .undefined, unused2?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.open].function!(this: this, arguments: [unused1?.jsValue ?? .undefined, unused2?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func open(url: String, name: String, features: String) -> WindowProxy? { let this = jsObject - return this[Strings.open].function!(this: this, arguments: [url.jsValue(), name.jsValue(), features.jsValue()]).fromJSValue()! + return this[Strings.open].function!(this: this, arguments: [url.jsValue, name.jsValue, features.jsValue]).fromJSValue()! } @inlinable public func close() { @@ -320,12 +320,12 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func write(text: String...) { let this = jsObject - _ = this[Strings.write].function!(this: this, arguments: text.map { $0.jsValue() }) + _ = this[Strings.write].function!(this: this, arguments: text.map(\.jsValue)) } @inlinable public func writeln(text: String...) { let this = jsObject - _ = this[Strings.writeln].function!(this: this, arguments: text.map { $0.jsValue() }) + _ = this[Strings.writeln].function!(this: this, arguments: text.map(\.jsValue)) } @ReadonlyAttribute @@ -341,32 +341,32 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func execCommand(commandId: String, showUI: Bool? = nil, value: String? = nil) -> Bool { let this = jsObject - return this[Strings.execCommand].function!(this: this, arguments: [commandId.jsValue(), showUI?.jsValue() ?? .undefined, value?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.execCommand].function!(this: this, arguments: [commandId.jsValue, showUI?.jsValue ?? .undefined, value?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func queryCommandEnabled(commandId: String) -> Bool { let this = jsObject - return this[Strings.queryCommandEnabled].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! + return this[Strings.queryCommandEnabled].function!(this: this, arguments: [commandId.jsValue]).fromJSValue()! } @inlinable public func queryCommandIndeterm(commandId: String) -> Bool { let this = jsObject - return this[Strings.queryCommandIndeterm].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! + return this[Strings.queryCommandIndeterm].function!(this: this, arguments: [commandId.jsValue]).fromJSValue()! } @inlinable public func queryCommandState(commandId: String) -> Bool { let this = jsObject - return this[Strings.queryCommandState].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! + return this[Strings.queryCommandState].function!(this: this, arguments: [commandId.jsValue]).fromJSValue()! } @inlinable public func queryCommandSupported(commandId: String) -> Bool { let this = jsObject - return this[Strings.queryCommandSupported].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! + return this[Strings.queryCommandSupported].function!(this: this, arguments: [commandId.jsValue]).fromJSValue()! } @inlinable public func queryCommandValue(commandId: String) -> String { let this = jsObject - return this[Strings.queryCommandValue].function!(this: this, arguments: [commandId.jsValue()]).fromJSValue()! + return this[Strings.queryCommandValue].function!(this: this, arguments: [commandId.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -444,7 +444,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func exitPictureInPicture() async throws { let this = jsObject let _promise: JSPromise = this[Strings.exitPictureInPicture].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @ClosureAttribute1Optional @@ -475,7 +475,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func hasStorageAccess() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.hasStorageAccess].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func requestStorageAccess() -> JSPromise { @@ -487,7 +487,7 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @inlinable public func requestStorageAccess() async throws { let this = jsObject let _promise: JSPromise = this[Strings.requestStorageAccess].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DocumentReadyState.swift b/Sources/DOMKit/WebIDL/DocumentReadyState.swift index 0d368e16..ae8f31c1 100644 --- a/Sources/DOMKit/WebIDL/DocumentReadyState.swift +++ b/Sources/DOMKit/WebIDL/DocumentReadyState.swift @@ -19,5 +19,5 @@ public enum DocumentReadyState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/DocumentTimeline.swift b/Sources/DOMKit/WebIDL/DocumentTimeline.swift index f32ade2a..e12a8aa8 100644 --- a/Sources/DOMKit/WebIDL/DocumentTimeline.swift +++ b/Sources/DOMKit/WebIDL/DocumentTimeline.swift @@ -11,6 +11,6 @@ public class DocumentTimeline: AnimationTimeline { } @inlinable public convenience init(options: DocumentTimelineOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/DocumentTimelineOptions.swift b/Sources/DOMKit/WebIDL/DocumentTimelineOptions.swift index 00f027d5..e45f94da 100644 --- a/Sources/DOMKit/WebIDL/DocumentTimelineOptions.swift +++ b/Sources/DOMKit/WebIDL/DocumentTimelineOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class DocumentTimelineOptions: BridgedDictionary { public convenience init(originTime: DOMHighResTimeStamp) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.originTime] = originTime.jsValue() + object[Strings.originTime] = originTime.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift index de18f2e0..a9d2497f 100644 --- a/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift +++ b/Sources/DOMKit/WebIDL/DocumentVisibilityState.swift @@ -18,5 +18,5 @@ public enum DocumentVisibilityState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift b/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift index df0ca2f0..87526a0d 100644 --- a/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift +++ b/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift @@ -21,12 +21,12 @@ public enum Document_or_DocumentFragment: JSValueCompatible, Any_Document_or_Doc return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .document(document): - return document.jsValue() + return document.jsValue case let .documentFragment(documentFragment): - return documentFragment.jsValue() + return documentFragment.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Document_or_Element.swift b/Sources/DOMKit/WebIDL/Document_or_Element.swift index 12aba790..ce3b7586 100644 --- a/Sources/DOMKit/WebIDL/Document_or_Element.swift +++ b/Sources/DOMKit/WebIDL/Document_or_Element.swift @@ -21,12 +21,12 @@ public enum Document_or_Element: JSValueCompatible, Any_Document_or_Element { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .document(document): - return document.jsValue() + return document.jsValue case let .element(element): - return element.jsValue() + return element.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift b/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift index 9000ea40..0dfeafc7 100644 --- a/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift +++ b/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift @@ -21,12 +21,12 @@ public enum Document_or_XMLHttpRequestBodyInit: JSValueCompatible, Any_Document_ return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .document(document): - return document.jsValue() + return document.jsValue case let .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit): - return xMLHttpRequestBodyInit.jsValue() + return xMLHttpRequestBodyInit.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/DoubleRange.swift b/Sources/DOMKit/WebIDL/DoubleRange.swift index 91e52bef..b58107cf 100644 --- a/Sources/DOMKit/WebIDL/DoubleRange.swift +++ b/Sources/DOMKit/WebIDL/DoubleRange.swift @@ -6,8 +6,8 @@ import JavaScriptKit 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() + object[Strings.max] = max.jsValue + object[Strings.min] = min.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift b/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift index 3587fd18..e32b94fa 100644 --- a/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift +++ b/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift @@ -21,12 +21,12 @@ public enum Double_or_EffectTiming: JSValueCompatible, Any_Double_or_EffectTimin return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .double(double): - return double.jsValue() + return double.jsValue case let .effectTiming(effectTiming): - return effectTiming.jsValue() + return effectTiming.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift b/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift index b570243d..0c5c2cce 100644 --- a/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift +++ b/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift @@ -21,12 +21,12 @@ public enum Double_or_KeyframeAnimationOptions: JSValueCompatible, Any_Double_or return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .double(double): - return double.jsValue() + return double.jsValue case let .keyframeAnimationOptions(keyframeAnimationOptions): - return keyframeAnimationOptions.jsValue() + return keyframeAnimationOptions.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift b/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift index aaafd79d..59fcf900 100644 --- a/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift +++ b/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift @@ -21,12 +21,12 @@ public enum Double_or_KeyframeEffectOptions: JSValueCompatible, Any_Double_or_Ke return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .double(double): - return double.jsValue() + return double.jsValue case let .keyframeEffectOptions(keyframeEffectOptions): - return keyframeEffectOptions.jsValue() + return keyframeEffectOptions.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Double_or_String.swift b/Sources/DOMKit/WebIDL/Double_or_String.swift index 812c512e..af9ad128 100644 --- a/Sources/DOMKit/WebIDL/Double_or_String.swift +++ b/Sources/DOMKit/WebIDL/Double_or_String.swift @@ -21,12 +21,12 @@ public enum Double_or_String: JSValueCompatible, Any_Double_or_String { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .double(double): - return double.jsValue() + return double.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift b/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift index 7924a539..3c25378d 100644 --- a/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift +++ b/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift @@ -21,12 +21,12 @@ public enum Double_or_seq_of_Double: JSValueCompatible, Any_Double_or_seq_of_Dou return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .double(double): - return double.jsValue() + return double.jsValue case let .seq_of_Double(seq_of_Double): - return seq_of_Double.jsValue() + return seq_of_Double.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/DragEvent.swift b/Sources/DOMKit/WebIDL/DragEvent.swift index 4fbcdd34..feeb3434 100644 --- a/Sources/DOMKit/WebIDL/DragEvent.swift +++ b/Sources/DOMKit/WebIDL/DragEvent.swift @@ -12,7 +12,7 @@ public class DragEvent: MouseEvent { } @inlinable public convenience init(type: String, eventInitDict: DragEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DragEventInit.swift b/Sources/DOMKit/WebIDL/DragEventInit.swift index 7e6eaab1..e7afb2e3 100644 --- a/Sources/DOMKit/WebIDL/DragEventInit.swift +++ b/Sources/DOMKit/WebIDL/DragEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class DragEventInit: BridgedDictionary { public convenience init(dataTransfer: DataTransfer?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataTransfer] = dataTransfer.jsValue() + object[Strings.dataTransfer] = dataTransfer.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift b/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift index 91ecce9a..94232e64 100644 --- a/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift +++ b/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift @@ -17,7 +17,7 @@ public class DynamicsCompressorNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: DynamicsCompressorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift b/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift index ae7480a5..5c630f54 100644 --- a/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift +++ b/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class DynamicsCompressorOptions: BridgedDictionary { public convenience init(attack: Float, knee: Float, ratio: Float, release: Float, threshold: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.attack] = attack.jsValue() - object[Strings.knee] = knee.jsValue() - object[Strings.ratio] = ratio.jsValue() - object[Strings.release] = release.jsValue() - object[Strings.threshold] = threshold.jsValue() + object[Strings.attack] = attack.jsValue + object[Strings.knee] = knee.jsValue + object[Strings.ratio] = ratio.jsValue + object[Strings.release] = release.jsValue + object[Strings.threshold] = threshold.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift index 15afc255..e75d35ce 100644 --- a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift +++ b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift @@ -33,36 +33,36 @@ public class EXT_disjoint_timer_query: JSBridgedClass { @inlinable public func deleteQueryEXT(query: WebGLTimerQueryEXT?) { let this = jsObject - _ = this[Strings.deleteQueryEXT].function!(this: this, arguments: [query.jsValue()]) + _ = this[Strings.deleteQueryEXT].function!(this: this, arguments: [query.jsValue]) } @inlinable public func isQueryEXT(query: WebGLTimerQueryEXT?) -> Bool { let this = jsObject - return this[Strings.isQueryEXT].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! + return this[Strings.isQueryEXT].function!(this: this, arguments: [query.jsValue]).fromJSValue()! } @inlinable public func beginQueryEXT(target: GLenum, query: WebGLTimerQueryEXT) { let this = jsObject - _ = this[Strings.beginQueryEXT].function!(this: this, arguments: [target.jsValue(), query.jsValue()]) + _ = this[Strings.beginQueryEXT].function!(this: this, arguments: [target.jsValue, query.jsValue]) } @inlinable public func endQueryEXT(target: GLenum) { let this = jsObject - _ = this[Strings.endQueryEXT].function!(this: this, arguments: [target.jsValue()]) + _ = this[Strings.endQueryEXT].function!(this: this, arguments: [target.jsValue]) } @inlinable public func queryCounterEXT(query: WebGLTimerQueryEXT, target: GLenum) { let this = jsObject - _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue(), target.jsValue()]) + _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue, target.jsValue]) } @inlinable public func getQueryEXT(target: GLenum, pname: GLenum) -> JSValue { let this = jsObject - return this[Strings.getQueryEXT].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! + return this[Strings.getQueryEXT].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! } @inlinable public func getQueryObjectEXT(query: WebGLTimerQueryEXT, pname: GLenum) -> JSValue { let this = jsObject - return this[Strings.getQueryObjectEXT].function!(this: this, arguments: [query.jsValue(), pname.jsValue()]).fromJSValue()! + return this[Strings.getQueryObjectEXT].function!(this: this, arguments: [query.jsValue, pname.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift index 08a2bbe8..251ccbc0 100644 --- a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift +++ b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift @@ -22,6 +22,6 @@ public class EXT_disjoint_timer_query_webgl2: JSBridgedClass { @inlinable public func queryCounterEXT(query: WebGLQuery, target: GLenum) { let this = jsObject - _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue(), target.jsValue()]) + _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue, target.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift index 9cb137dc..bd53de03 100644 --- a/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift +++ b/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class EcKeyAlgorithm: BridgedDictionary { public convenience init(namedCurve: NamedCurve) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.namedCurve] = namedCurve.jsValue() + object[Strings.namedCurve] = namedCurve.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EcKeyGenParams.swift b/Sources/DOMKit/WebIDL/EcKeyGenParams.swift index 27f62940..d2b2dc4a 100644 --- a/Sources/DOMKit/WebIDL/EcKeyGenParams.swift +++ b/Sources/DOMKit/WebIDL/EcKeyGenParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class EcKeyGenParams: BridgedDictionary { public convenience init(namedCurve: NamedCurve) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.namedCurve] = namedCurve.jsValue() + object[Strings.namedCurve] = namedCurve.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EcKeyImportParams.swift b/Sources/DOMKit/WebIDL/EcKeyImportParams.swift index ddd6dea7..2023a8ae 100644 --- a/Sources/DOMKit/WebIDL/EcKeyImportParams.swift +++ b/Sources/DOMKit/WebIDL/EcKeyImportParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class EcKeyImportParams: BridgedDictionary { public convenience init(namedCurve: NamedCurve) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.namedCurve] = namedCurve.jsValue() + object[Strings.namedCurve] = namedCurve.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift b/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift index a2548abc..6afc2b84 100644 --- a/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift +++ b/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class EcdhKeyDeriveParams: BridgedDictionary { public convenience init(public: CryptoKey) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.public] = `public`.jsValue() + object[Strings.public] = `public`.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EcdsaParams.swift b/Sources/DOMKit/WebIDL/EcdsaParams.swift index 2912d0a3..46c60d42 100644 --- a/Sources/DOMKit/WebIDL/EcdsaParams.swift +++ b/Sources/DOMKit/WebIDL/EcdsaParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class EcdsaParams: BridgedDictionary { public convenience init(hash: HashAlgorithmIdentifier) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue() + object[Strings.hash] = hash.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Edge.swift b/Sources/DOMKit/WebIDL/Edge.swift index b506c928..1f8283ec 100644 --- a/Sources/DOMKit/WebIDL/Edge.swift +++ b/Sources/DOMKit/WebIDL/Edge.swift @@ -18,5 +18,5 @@ public enum Edge: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/EditContext.swift b/Sources/DOMKit/WebIDL/EditContext.swift index 14cec2a8..e0a53697 100644 --- a/Sources/DOMKit/WebIDL/EditContext.swift +++ b/Sources/DOMKit/WebIDL/EditContext.swift @@ -25,32 +25,32 @@ public class EditContext: EventTarget { } @inlinable public convenience init(options: EditContextInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @inlinable public func updateText(rangeStart: UInt32, rangeEnd: UInt32, text: String) { let this = jsObject - _ = this[Strings.updateText].function!(this: this, arguments: [rangeStart.jsValue(), rangeEnd.jsValue(), text.jsValue()]) + _ = this[Strings.updateText].function!(this: this, arguments: [rangeStart.jsValue, rangeEnd.jsValue, text.jsValue]) } @inlinable public func updateSelection(start: UInt32, end: UInt32) { let this = jsObject - _ = this[Strings.updateSelection].function!(this: this, arguments: [start.jsValue(), end.jsValue()]) + _ = this[Strings.updateSelection].function!(this: this, arguments: [start.jsValue, end.jsValue]) } @inlinable public func updateControlBound(controlBound: DOMRect) { let this = jsObject - _ = this[Strings.updateControlBound].function!(this: this, arguments: [controlBound.jsValue()]) + _ = this[Strings.updateControlBound].function!(this: this, arguments: [controlBound.jsValue]) } @inlinable public func updateSelectionBound(selectionBound: DOMRect) { let this = jsObject - _ = this[Strings.updateSelectionBound].function!(this: this, arguments: [selectionBound.jsValue()]) + _ = this[Strings.updateSelectionBound].function!(this: this, arguments: [selectionBound.jsValue]) } @inlinable public func updateCharacterBounds(rangeStart: UInt32, characterBounds: [DOMRect]) { let this = jsObject - _ = this[Strings.updateCharacterBounds].function!(this: this, arguments: [rangeStart.jsValue(), characterBounds.jsValue()]) + _ = this[Strings.updateCharacterBounds].function!(this: this, arguments: [rangeStart.jsValue, characterBounds.jsValue]) } @inlinable public func attachedElements() -> [Element] { diff --git a/Sources/DOMKit/WebIDL/EditContextInit.swift b/Sources/DOMKit/WebIDL/EditContextInit.swift index 78173136..6b7ddaf5 100644 --- a/Sources/DOMKit/WebIDL/EditContextInit.swift +++ b/Sources/DOMKit/WebIDL/EditContextInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class EditContextInit: BridgedDictionary { public convenience init(text: String, selectionStart: UInt32, selectionEnd: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.text] = text.jsValue() - object[Strings.selectionStart] = selectionStart.jsValue() - object[Strings.selectionEnd] = selectionEnd.jsValue() + object[Strings.text] = text.jsValue + object[Strings.selectionStart] = selectionStart.jsValue + object[Strings.selectionEnd] = selectionEnd.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EffectTiming.swift b/Sources/DOMKit/WebIDL/EffectTiming.swift index ecf1a803..f9b362fe 100644 --- a/Sources/DOMKit/WebIDL/EffectTiming.swift +++ b/Sources/DOMKit/WebIDL/EffectTiming.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class EffectTiming: BridgedDictionary { public convenience init(playbackRate: Double, duration: CSSNumericValue_or_Double_or_String, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.playbackRate] = playbackRate.jsValue() - object[Strings.duration] = duration.jsValue() - object[Strings.delay] = delay.jsValue() - object[Strings.endDelay] = endDelay.jsValue() - object[Strings.fill] = fill.jsValue() - object[Strings.iterationStart] = iterationStart.jsValue() - object[Strings.iterations] = iterations.jsValue() - object[Strings.direction] = direction.jsValue() - object[Strings.easing] = easing.jsValue() + object[Strings.playbackRate] = playbackRate.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.delay] = delay.jsValue + object[Strings.endDelay] = endDelay.jsValue + object[Strings.fill] = fill.jsValue + object[Strings.iterationStart] = iterationStart.jsValue + object[Strings.iterations] = iterations.jsValue + object[Strings.direction] = direction.jsValue + object[Strings.easing] = easing.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift b/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift index 0de9fab7..488589d3 100644 --- a/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift +++ b/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift @@ -20,5 +20,5 @@ public enum EffectiveConnectionType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index 8795f9f4..16c31aa7 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -39,7 +39,7 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @inlinable public func insertAdjacentHTML(position: String, text: String) { let this = jsObject - _ = this[Strings.insertAdjacentHTML].function!(this: this, arguments: [position.jsValue(), text.jsValue()]) + _ = this[Strings.insertAdjacentHTML].function!(this: this, arguments: [position.jsValue, text.jsValue]) } @inlinable public func getSpatialNavigationContainer() -> Node { @@ -49,17 +49,17 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @inlinable public func focusableAreas(option: FocusableAreasOption? = nil) -> [Node] { let this = jsObject - return this[Strings.focusableAreas].function!(this: this, arguments: [option?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.focusableAreas].function!(this: this, arguments: [option?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func spatialNavigationSearch(dir: SpatialNavigationDirection, options: SpatialNavigationSearchOptions? = nil) -> Node? { let this = jsObject - return this[Strings.spatialNavigationSearch].function!(this: this, arguments: [dir.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.spatialNavigationSearch].function!(this: this, arguments: [dir.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func pseudo(type: String) -> CSSPseudoElement? { let this = jsObject - return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -82,42 +82,42 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @inlinable public func isVisible(options: IsVisibleOptions? = nil) -> Bool { let this = jsObject - return this[Strings.isVisible].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.isVisible].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func scrollIntoView(arg: Bool_or_ScrollIntoViewOptions? = nil) { let this = jsObject - _ = this[Strings.scrollIntoView].function!(this: this, arguments: [arg?.jsValue() ?? .undefined]) + _ = this[Strings.scrollIntoView].function!(this: this, arguments: [arg?.jsValue ?? .undefined]) } @inlinable public func scroll(options: ScrollToOptions? = nil) { let this = jsObject - _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) + _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue ?? .undefined]) } @inlinable public func scroll(x: Double, y: Double) { let this = jsObject - _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @inlinable public func scrollTo(options: ScrollToOptions? = nil) { let this = jsObject - _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) + _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue ?? .undefined]) } @inlinable public func scrollTo(x: Double, y: Double) { let this = jsObject - _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @inlinable public func scrollBy(options: ScrollToOptions? = nil) { let this = jsObject - _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) + _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue ?? .undefined]) } @inlinable public func scrollBy(x: Double, y: Double) { let this = jsObject - _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @ReadWriteAttribute @@ -183,77 +183,77 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @inlinable public func getAttribute(qualifiedName: String) -> String? { let this = jsObject - return this[Strings.getAttribute].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! + return this[Strings.getAttribute].function!(this: this, arguments: [qualifiedName.jsValue]).fromJSValue()! } @inlinable public func getAttributeNS(namespace: String?, localName: String) -> String? { let this = jsObject - return this[Strings.getAttributeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! + return this[Strings.getAttributeNS].function!(this: this, arguments: [namespace.jsValue, localName.jsValue]).fromJSValue()! } @inlinable public func setAttribute(qualifiedName: String, value: String) { let this = jsObject - _ = this[Strings.setAttribute].function!(this: this, arguments: [qualifiedName.jsValue(), value.jsValue()]) + _ = this[Strings.setAttribute].function!(this: this, arguments: [qualifiedName.jsValue, value.jsValue]) } @inlinable public func setAttributeNS(namespace: String?, qualifiedName: String, value: String) { let this = jsObject - _ = this[Strings.setAttributeNS].function!(this: this, arguments: [namespace.jsValue(), qualifiedName.jsValue(), value.jsValue()]) + _ = this[Strings.setAttributeNS].function!(this: this, arguments: [namespace.jsValue, qualifiedName.jsValue, value.jsValue]) } @inlinable public func removeAttribute(qualifiedName: String) { let this = jsObject - _ = this[Strings.removeAttribute].function!(this: this, arguments: [qualifiedName.jsValue()]) + _ = this[Strings.removeAttribute].function!(this: this, arguments: [qualifiedName.jsValue]) } @inlinable public func removeAttributeNS(namespace: String?, localName: String) { let this = jsObject - _ = this[Strings.removeAttributeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]) + _ = this[Strings.removeAttributeNS].function!(this: this, arguments: [namespace.jsValue, localName.jsValue]) } @inlinable public func toggleAttribute(qualifiedName: String, force: Bool? = nil) -> Bool { let this = jsObject - return this[Strings.toggleAttribute].function!(this: this, arguments: [qualifiedName.jsValue(), force?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.toggleAttribute].function!(this: this, arguments: [qualifiedName.jsValue, force?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func hasAttribute(qualifiedName: String) -> Bool { let this = jsObject - return this[Strings.hasAttribute].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! + return this[Strings.hasAttribute].function!(this: this, arguments: [qualifiedName.jsValue]).fromJSValue()! } @inlinable public func hasAttributeNS(namespace: String?, localName: String) -> Bool { let this = jsObject - return this[Strings.hasAttributeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! + return this[Strings.hasAttributeNS].function!(this: this, arguments: [namespace.jsValue, localName.jsValue]).fromJSValue()! } @inlinable public func getAttributeNode(qualifiedName: String) -> Attr? { let this = jsObject - return this[Strings.getAttributeNode].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! + return this[Strings.getAttributeNode].function!(this: this, arguments: [qualifiedName.jsValue]).fromJSValue()! } @inlinable public func getAttributeNodeNS(namespace: String?, localName: String) -> Attr? { let this = jsObject - return this[Strings.getAttributeNodeNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! + return this[Strings.getAttributeNodeNS].function!(this: this, arguments: [namespace.jsValue, localName.jsValue]).fromJSValue()! } @inlinable public func setAttributeNode(attr: Attr) -> Attr? { let this = jsObject - return this[Strings.setAttributeNode].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! + return this[Strings.setAttributeNode].function!(this: this, arguments: [attr.jsValue]).fromJSValue()! } @inlinable public func setAttributeNodeNS(attr: Attr) -> Attr? { let this = jsObject - return this[Strings.setAttributeNodeNS].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! + return this[Strings.setAttributeNodeNS].function!(this: this, arguments: [attr.jsValue]).fromJSValue()! } @inlinable public func removeAttributeNode(attr: Attr) -> Attr { let this = jsObject - return this[Strings.removeAttributeNode].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! + return this[Strings.removeAttributeNode].function!(this: this, arguments: [attr.jsValue]).fromJSValue()! } @inlinable public func attachShadow(init: ShadowRootInit) -> ShadowRoot { let this = jsObject - return this[Strings.attachShadow].function!(this: this, arguments: [`init`.jsValue()]).fromJSValue()! + return this[Strings.attachShadow].function!(this: this, arguments: [`init`.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -261,42 +261,42 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @inlinable public func closest(selectors: String) -> Element? { let this = jsObject - return this[Strings.closest].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! + return this[Strings.closest].function!(this: this, arguments: [selectors.jsValue]).fromJSValue()! } @inlinable public func matches(selectors: String) -> Bool { let this = jsObject - return this[Strings.matches].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! + return this[Strings.matches].function!(this: this, arguments: [selectors.jsValue]).fromJSValue()! } @inlinable public func webkitMatchesSelector(selectors: String) -> Bool { let this = jsObject - return this[Strings.webkitMatchesSelector].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! + return this[Strings.webkitMatchesSelector].function!(this: this, arguments: [selectors.jsValue]).fromJSValue()! } @inlinable public func getElementsByTagName(qualifiedName: String) -> HTMLCollection { let this = jsObject - return this[Strings.getElementsByTagName].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! + return this[Strings.getElementsByTagName].function!(this: this, arguments: [qualifiedName.jsValue]).fromJSValue()! } @inlinable public func getElementsByTagNameNS(namespace: String?, localName: String) -> HTMLCollection { let this = jsObject - return this[Strings.getElementsByTagNameNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! + return this[Strings.getElementsByTagNameNS].function!(this: this, arguments: [namespace.jsValue, localName.jsValue]).fromJSValue()! } @inlinable public func getElementsByClassName(classNames: String) -> HTMLCollection { let this = jsObject - return this[Strings.getElementsByClassName].function!(this: this, arguments: [classNames.jsValue()]).fromJSValue()! + return this[Strings.getElementsByClassName].function!(this: this, arguments: [classNames.jsValue]).fromJSValue()! } @inlinable public func insertAdjacentElement(where: String, element: Element) -> Element? { let this = jsObject - return this[Strings.insertAdjacentElement].function!(this: this, arguments: [`where`.jsValue(), element.jsValue()]).fromJSValue()! + return this[Strings.insertAdjacentElement].function!(this: this, arguments: [`where`.jsValue, element.jsValue]).fromJSValue()! } @inlinable public func insertAdjacentText(where: String, data: String) { let this = jsObject - _ = this[Strings.insertAdjacentText].function!(this: this, arguments: [`where`.jsValue(), data.jsValue()]) + _ = this[Strings.insertAdjacentText].function!(this: this, arguments: [`where`.jsValue, data.jsValue]) } @ReadWriteAttribute @@ -307,14 +307,14 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @inlinable public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestFullscreen(options: FullscreenOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @ClosureAttribute1Optional @@ -325,17 +325,17 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @inlinable public func setPointerCapture(pointerId: Int32) { let this = jsObject - _ = this[Strings.setPointerCapture].function!(this: this, arguments: [pointerId.jsValue()]) + _ = this[Strings.setPointerCapture].function!(this: this, arguments: [pointerId.jsValue]) } @inlinable public func releasePointerCapture(pointerId: Int32) { let this = jsObject - _ = this[Strings.releasePointerCapture].function!(this: this, arguments: [pointerId.jsValue()]) + _ = this[Strings.releasePointerCapture].function!(this: this, arguments: [pointerId.jsValue]) } @inlinable public func hasPointerCapture(pointerId: Int32) -> Bool { let this = jsObject - return this[Strings.hasPointerCapture].function!(this: this, arguments: [pointerId.jsValue()]).fromJSValue()! + return this[Strings.hasPointerCapture].function!(this: this, arguments: [pointerId.jsValue]).fromJSValue()! } @inlinable public func requestPointerLock() { @@ -345,6 +345,6 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc @inlinable public func setHTML(input: String, options: SetHTMLOptions? = nil) { let this = jsObject - _ = this[Strings.setHTML].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.setHTML].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/ElementBasedOffset.swift b/Sources/DOMKit/WebIDL/ElementBasedOffset.swift index 790a1df6..7f548ff7 100644 --- a/Sources/DOMKit/WebIDL/ElementBasedOffset.swift +++ b/Sources/DOMKit/WebIDL/ElementBasedOffset.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class ElementBasedOffset: BridgedDictionary { public convenience init(target: Element, edge: Edge, threshold: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.target] = target.jsValue() - object[Strings.edge] = edge.jsValue() - object[Strings.threshold] = threshold.jsValue() + object[Strings.target] = target.jsValue + object[Strings.edge] = edge.jsValue + object[Strings.threshold] = threshold.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift index 84bbad50..0ef2f4b9 100644 --- a/Sources/DOMKit/WebIDL/ElementCreationOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementCreationOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ElementCreationOptions: BridgedDictionary { public convenience init(is: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.is] = `is`.jsValue() + object[Strings.is] = `is`.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift index 5d407d46..6164bf12 100644 --- a/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift +++ b/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift @@ -21,12 +21,12 @@ public enum ElementCreationOptions_or_String: JSValueCompatible, Any_ElementCrea return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .elementCreationOptions(elementCreationOptions): - return elementCreationOptions.jsValue() + return elementCreationOptions.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift index 24f1b770..c6bb95d5 100644 --- a/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift +++ b/Sources/DOMKit/WebIDL/ElementDefinitionOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ElementDefinitionOptions: BridgedDictionary { public convenience init(extends: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.extends] = extends.jsValue() + object[Strings.extends] = extends.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index 6793b065..c6836670 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -27,7 +27,7 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { @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]) + _ = this[Strings.setFormValue].function!(this: this, arguments: [value.jsValue, state?.jsValue ?? .undefined]) } @ReadonlyAttribute @@ -35,7 +35,7 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { @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]) + _ = this[Strings.setValidity].function!(this: this, arguments: [flags?.jsValue ?? .undefined, message?.jsValue ?? .undefined, anchor?.jsValue ?? .undefined]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift b/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift index e01e2996..9ac689a5 100644 --- a/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift @@ -21,12 +21,12 @@ public enum Element_or_HTMLCollection: JSValueCompatible, Any_Element_or_HTMLCol return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .element(element): - return element.jsValue() + return element.jsValue case let .hTMLCollection(hTMLCollection): - return hTMLCollection.jsValue() + return hTMLCollection.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift index 809c59ea..0a55b74c 100644 --- a/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift +++ b/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift @@ -21,12 +21,12 @@ public enum Element_or_ProcessingInstruction: JSValueCompatible, Any_Element_or_ return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .element(element): - return element.jsValue() + return element.jsValue case let .processingInstruction(processingInstruction): - return processingInstruction.jsValue() + return processingInstruction.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift b/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift index 0bd29e58..c41cf3ac 100644 --- a/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift +++ b/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift @@ -21,12 +21,12 @@ public enum Element_or_RadioNodeList: JSValueCompatible, Any_Element_or_RadioNod return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .element(element): - return element.jsValue() + return element.jsValue case let .radioNodeList(radioNodeList): - return radioNodeList.jsValue() + return radioNodeList.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Element_or_Text.swift b/Sources/DOMKit/WebIDL/Element_or_Text.swift index 181db452..e4aea1ce 100644 --- a/Sources/DOMKit/WebIDL/Element_or_Text.swift +++ b/Sources/DOMKit/WebIDL/Element_or_Text.swift @@ -21,12 +21,12 @@ public enum Element_or_Text: JSValueCompatible, Any_Element_or_Text { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .element(element): - return element.jsValue() + return element.jsValue case let .text(text): - return text.jsValue() + return text.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift index 6115b76f..010e2b06 100644 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift @@ -17,7 +17,7 @@ public class EncodedAudioChunk: JSBridgedClass { } @inlinable public convenience init(init: EncodedAudioChunkInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute @@ -34,6 +34,6 @@ public class EncodedAudioChunk: JSBridgedClass { @inlinable public func copyTo(destination: BufferSource) { let this = jsObject - _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue()]) + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift index da387f14..054201f8 100644 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift @@ -6,10 +6,10 @@ 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() + object[Strings.type] = type.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift index b1432f02..6f5f8314 100644 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class EncodedAudioChunkMetadata: BridgedDictionary { public convenience init(decoderConfig: AudioDecoderConfig) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.decoderConfig] = decoderConfig.jsValue() + object[Strings.decoderConfig] = decoderConfig.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift index 8570684d..9c35362e 100644 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift @@ -18,5 +18,5 @@ public enum EncodedAudioChunkType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift index e2f6c52d..1da80666 100644 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift @@ -17,7 +17,7 @@ public class EncodedVideoChunk: JSBridgedClass { } @inlinable public convenience init(init: EncodedVideoChunkInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute @@ -34,6 +34,6 @@ public class EncodedVideoChunk: JSBridgedClass { @inlinable public func copyTo(destination: BufferSource) { let this = jsObject - _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue()]) + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift index e91d7005..0c95c51f 100644 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift @@ -6,10 +6,10 @@ 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() + object[Strings.type] = type.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift index ea1a9dae..6b3572e9 100644 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift @@ -6,9 +6,9 @@ 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() + object[Strings.decoderConfig] = decoderConfig.jsValue + object[Strings.svc] = svc.jsValue + object[Strings.alphaSideData] = alphaSideData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift index c316a37d..f59b9723 100644 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift @@ -18,5 +18,5 @@ public enum EncodedVideoChunkType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/EndOfStreamError.swift b/Sources/DOMKit/WebIDL/EndOfStreamError.swift index e9cc3d40..aa1ad8a9 100644 --- a/Sources/DOMKit/WebIDL/EndOfStreamError.swift +++ b/Sources/DOMKit/WebIDL/EndOfStreamError.swift @@ -18,5 +18,5 @@ public enum EndOfStreamError: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/EndingType.swift b/Sources/DOMKit/WebIDL/EndingType.swift index bd3af037..247cc899 100644 --- a/Sources/DOMKit/WebIDL/EndingType.swift +++ b/Sources/DOMKit/WebIDL/EndingType.swift @@ -18,5 +18,5 @@ public enum EndingType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ErrorEvent.swift b/Sources/DOMKit/WebIDL/ErrorEvent.swift index 954bd993..44547d64 100644 --- a/Sources/DOMKit/WebIDL/ErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/ErrorEvent.swift @@ -16,7 +16,7 @@ public class ErrorEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: ErrorEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ErrorEventInit.swift b/Sources/DOMKit/WebIDL/ErrorEventInit.swift index f2ef72c9..b558e880 100644 --- a/Sources/DOMKit/WebIDL/ErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/ErrorEventInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class ErrorEventInit: BridgedDictionary { public convenience init(message: String, filename: String, lineno: UInt32, colno: UInt32, error: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.message] = message.jsValue() - object[Strings.filename] = filename.jsValue() - object[Strings.lineno] = lineno.jsValue() - object[Strings.colno] = colno.jsValue() - object[Strings.error] = error.jsValue() + object[Strings.message] = message.jsValue + object[Strings.filename] = filename.jsValue + object[Strings.lineno] = lineno.jsValue + object[Strings.colno] = colno.jsValue + object[Strings.error] = error.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Event.swift b/Sources/DOMKit/WebIDL/Event.swift index 1faf1f2e..41015cf6 100644 --- a/Sources/DOMKit/WebIDL/Event.swift +++ b/Sources/DOMKit/WebIDL/Event.swift @@ -26,7 +26,7 @@ public class Event: JSBridgedClass { } @inlinable public convenience init(type: String, eventInitDict: EventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -98,6 +98,6 @@ public class Event: JSBridgedClass { @inlinable public func initEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil) { let this = jsObject - _ = this[Strings.initEvent].function!(this: this, arguments: [type.jsValue(), bubbles?.jsValue() ?? .undefined, cancelable?.jsValue() ?? .undefined]) + _ = this[Strings.initEvent].function!(this: this, arguments: [type.jsValue, bubbles?.jsValue ?? .undefined, cancelable?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/EventInit.swift b/Sources/DOMKit/WebIDL/EventInit.swift index 75091801..ac6bfe1f 100644 --- a/Sources/DOMKit/WebIDL/EventInit.swift +++ b/Sources/DOMKit/WebIDL/EventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class EventInit: BridgedDictionary { public convenience init(bubbles: Bool, cancelable: Bool, composed: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bubbles] = bubbles.jsValue() - object[Strings.cancelable] = cancelable.jsValue() - object[Strings.composed] = composed.jsValue() + object[Strings.bubbles] = bubbles.jsValue + object[Strings.cancelable] = cancelable.jsValue + object[Strings.composed] = composed.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventListenerOptions.swift b/Sources/DOMKit/WebIDL/EventListenerOptions.swift index 4ee7158c..b4f9d1c3 100644 --- a/Sources/DOMKit/WebIDL/EventListenerOptions.swift +++ b/Sources/DOMKit/WebIDL/EventListenerOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class EventListenerOptions: BridgedDictionary { public convenience init(capture: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.capture] = capture.jsValue() + object[Strings.capture] = capture.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventModifierInit.swift b/Sources/DOMKit/WebIDL/EventModifierInit.swift index f1ed622f..8139f6f0 100644 --- a/Sources/DOMKit/WebIDL/EventModifierInit.swift +++ b/Sources/DOMKit/WebIDL/EventModifierInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class EventModifierInit: BridgedDictionary { public convenience init(ctrlKey: Bool, shiftKey: Bool, altKey: Bool, metaKey: Bool, modifierAltGraph: Bool, modifierCapsLock: Bool, modifierFn: Bool, modifierFnLock: Bool, modifierHyper: Bool, modifierNumLock: Bool, modifierScrollLock: Bool, modifierSuper: Bool, modifierSymbol: Bool, modifierSymbolLock: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.ctrlKey] = ctrlKey.jsValue() - object[Strings.shiftKey] = shiftKey.jsValue() - object[Strings.altKey] = altKey.jsValue() - object[Strings.metaKey] = metaKey.jsValue() - object[Strings.modifierAltGraph] = modifierAltGraph.jsValue() - object[Strings.modifierCapsLock] = modifierCapsLock.jsValue() - object[Strings.modifierFn] = modifierFn.jsValue() - object[Strings.modifierFnLock] = modifierFnLock.jsValue() - object[Strings.modifierHyper] = modifierHyper.jsValue() - object[Strings.modifierNumLock] = modifierNumLock.jsValue() - object[Strings.modifierScrollLock] = modifierScrollLock.jsValue() - object[Strings.modifierSuper] = modifierSuper.jsValue() - object[Strings.modifierSymbol] = modifierSymbol.jsValue() - object[Strings.modifierSymbolLock] = modifierSymbolLock.jsValue() + object[Strings.ctrlKey] = ctrlKey.jsValue + object[Strings.shiftKey] = shiftKey.jsValue + object[Strings.altKey] = altKey.jsValue + object[Strings.metaKey] = metaKey.jsValue + object[Strings.modifierAltGraph] = modifierAltGraph.jsValue + object[Strings.modifierCapsLock] = modifierCapsLock.jsValue + object[Strings.modifierFn] = modifierFn.jsValue + object[Strings.modifierFnLock] = modifierFnLock.jsValue + object[Strings.modifierHyper] = modifierHyper.jsValue + object[Strings.modifierNumLock] = modifierNumLock.jsValue + object[Strings.modifierScrollLock] = modifierScrollLock.jsValue + object[Strings.modifierSuper] = modifierSuper.jsValue + object[Strings.modifierSymbol] = modifierSymbol.jsValue + object[Strings.modifierSymbolLock] = modifierSymbolLock.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventSource.swift b/Sources/DOMKit/WebIDL/EventSource.swift index 0ee701cb..9a95df8a 100644 --- a/Sources/DOMKit/WebIDL/EventSource.swift +++ b/Sources/DOMKit/WebIDL/EventSource.swift @@ -17,7 +17,7 @@ public class EventSource: EventTarget { } @inlinable public convenience init(url: String, eventSourceInitDict: EventSourceInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), eventSourceInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue, eventSourceInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/EventSourceInit.swift b/Sources/DOMKit/WebIDL/EventSourceInit.swift index ff77088a..c44cc13c 100644 --- a/Sources/DOMKit/WebIDL/EventSourceInit.swift +++ b/Sources/DOMKit/WebIDL/EventSourceInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class EventSourceInit: BridgedDictionary { public convenience init(withCredentials: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.withCredentials] = withCredentials.jsValue() + object[Strings.withCredentials] = withCredentials.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EventTarget.swift b/Sources/DOMKit/WebIDL/EventTarget.swift index acca466a..9848b2cb 100644 --- a/Sources/DOMKit/WebIDL/EventTarget.swift +++ b/Sources/DOMKit/WebIDL/EventTarget.swift @@ -22,6 +22,6 @@ public class EventTarget: JSBridgedClass { @inlinable public func dispatchEvent(event: Event) -> Bool { let this = jsObject - return this[Strings.dispatchEvent].function!(this: this, arguments: [event.jsValue()]).fromJSValue()! + return this[Strings.dispatchEvent].function!(this: this, arguments: [event.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Event_or_String.swift b/Sources/DOMKit/WebIDL/Event_or_String.swift index c7d24ff9..a4055d40 100644 --- a/Sources/DOMKit/WebIDL/Event_or_String.swift +++ b/Sources/DOMKit/WebIDL/Event_or_String.swift @@ -21,12 +21,12 @@ public enum Event_or_String: JSValueCompatible, Any_Event_or_String { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .event(event): - return event.jsValue() + return event.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift index 409e0c24..fae9b923 100644 --- a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ExtendableCookieChangeEventInit: BridgedDictionary { public convenience init(changed: CookieList, deleted: CookieList) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.changed] = changed.jsValue() - object[Strings.deleted] = deleted.jsValue() + object[Strings.changed] = changed.jsValue + object[Strings.deleted] = deleted.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/EyeDropper.swift b/Sources/DOMKit/WebIDL/EyeDropper.swift index a530793b..f99525a5 100644 --- a/Sources/DOMKit/WebIDL/EyeDropper.swift +++ b/Sources/DOMKit/WebIDL/EyeDropper.swift @@ -18,13 +18,13 @@ public class EyeDropper: JSBridgedClass { @inlinable public func open(options: ColorSelectionOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.open].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.open].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func open(options: ColorSelectionOptions? = nil) async throws -> ColorSelectionResult { let this = jsObject - let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FaceDetector.swift b/Sources/DOMKit/WebIDL/FaceDetector.swift index de3174e6..f34f8b94 100644 --- a/Sources/DOMKit/WebIDL/FaceDetector.swift +++ b/Sources/DOMKit/WebIDL/FaceDetector.swift @@ -13,18 +13,18 @@ public class FaceDetector: JSBridgedClass { } @inlinable public convenience init(faceDetectorOptions: FaceDetectorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [faceDetectorOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [faceDetectorOptions?.jsValue ?? .undefined])) } @inlinable public func detect(image: ImageBitmapSource) -> JSPromise { let this = jsObject - return this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! + return this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func detect(image: ImageBitmapSource) async throws -> [DetectedFace] { let this = jsObject - let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift b/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift index 60400fc9..45173313 100644 --- a/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift +++ b/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class FaceDetectorOptions: BridgedDictionary { public convenience init(maxDetectedFaces: UInt16, fastMode: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.maxDetectedFaces] = maxDetectedFaces.jsValue() - object[Strings.fastMode] = fastMode.jsValue() + object[Strings.maxDetectedFaces] = maxDetectedFaces.jsValue + object[Strings.fastMode] = fastMode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FederatedCredential.swift b/Sources/DOMKit/WebIDL/FederatedCredential.swift index 4e706570..7a461d5f 100644 --- a/Sources/DOMKit/WebIDL/FederatedCredential.swift +++ b/Sources/DOMKit/WebIDL/FederatedCredential.swift @@ -13,7 +13,7 @@ public class FederatedCredential: Credential, CredentialUserData { } @inlinable public convenience init(data: FederatedCredentialInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift b/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift index 4f5512d0..0d499563 100644 --- a/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift +++ b/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class FederatedCredentialInit: BridgedDictionary { public convenience init(name: String, iconURL: String, origin: String, provider: String, protocol: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.iconURL] = iconURL.jsValue() - object[Strings.origin] = origin.jsValue() - object[Strings.provider] = provider.jsValue() - object[Strings.protocol] = `protocol`.jsValue() + object[Strings.name] = name.jsValue + object[Strings.iconURL] = iconURL.jsValue + object[Strings.origin] = origin.jsValue + object[Strings.provider] = provider.jsValue + object[Strings.protocol] = `protocol`.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift index 290fcb09..ca7bc534 100644 --- a/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift +++ b/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class FederatedCredentialRequestOptions: BridgedDictionary { public convenience init(providers: [String], protocols: [String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.providers] = providers.jsValue() - object[Strings.protocols] = protocols.jsValue() + object[Strings.providers] = providers.jsValue + object[Strings.protocols] = protocols.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FetchEventInit.swift b/Sources/DOMKit/WebIDL/FetchEventInit.swift index c06c637a..065f527a 100644 --- a/Sources/DOMKit/WebIDL/FetchEventInit.swift +++ b/Sources/DOMKit/WebIDL/FetchEventInit.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class FetchEventInit: BridgedDictionary { public convenience init(request: Request, preloadResponse: JSPromise, clientId: String, resultingClientId: String, replacesClientId: String, handled: JSPromise) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.request] = request.jsValue() - object[Strings.preloadResponse] = preloadResponse.jsValue() - object[Strings.clientId] = clientId.jsValue() - object[Strings.resultingClientId] = resultingClientId.jsValue() - object[Strings.replacesClientId] = replacesClientId.jsValue() - object[Strings.handled] = handled.jsValue() + object[Strings.request] = request.jsValue + object[Strings.preloadResponse] = preloadResponse.jsValue + object[Strings.clientId] = clientId.jsValue + object[Strings.resultingClientId] = resultingClientId.jsValue + object[Strings.replacesClientId] = replacesClientId.jsValue + object[Strings.handled] = handled.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FetchPriority.swift b/Sources/DOMKit/WebIDL/FetchPriority.swift index 7582e725..c20e2379 100644 --- a/Sources/DOMKit/WebIDL/FetchPriority.swift +++ b/Sources/DOMKit/WebIDL/FetchPriority.swift @@ -19,5 +19,5 @@ public enum FetchPriority: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/File.swift b/Sources/DOMKit/WebIDL/File.swift index 7f7b2881..5ea408cc 100644 --- a/Sources/DOMKit/WebIDL/File.swift +++ b/Sources/DOMKit/WebIDL/File.swift @@ -14,7 +14,7 @@ public class File: Blob { } @inlinable public convenience init(fileBits: [BlobPart], fileName: String, options: FilePropertyBag? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [fileBits.jsValue(), fileName.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [fileBits.jsValue, fileName.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift b/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift index 01a6b3fe..fb799a61 100644 --- a/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift +++ b/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class FilePickerAcceptType: BridgedDictionary { public convenience init(description: String, accept: [String: String_or_seq_of_String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.description] = description.jsValue() - object[Strings.accept] = accept.jsValue() + object[Strings.description] = description.jsValue + object[Strings.accept] = accept.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FilePickerOptions.swift b/Sources/DOMKit/WebIDL/FilePickerOptions.swift index 30fbe897..d7e6420a 100644 --- a/Sources/DOMKit/WebIDL/FilePickerOptions.swift +++ b/Sources/DOMKit/WebIDL/FilePickerOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class FilePickerOptions: BridgedDictionary { public convenience init(types: [FilePickerAcceptType], excludeAcceptAllOption: Bool, id: String, startIn: StartInDirectory) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.types] = types.jsValue() - object[Strings.excludeAcceptAllOption] = excludeAcceptAllOption.jsValue() - object[Strings.id] = id.jsValue() - object[Strings.startIn] = startIn.jsValue() + object[Strings.types] = types.jsValue + object[Strings.excludeAcceptAllOption] = excludeAcceptAllOption.jsValue + object[Strings.id] = id.jsValue + object[Strings.startIn] = startIn.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FilePropertyBag.swift b/Sources/DOMKit/WebIDL/FilePropertyBag.swift index 26bafec1..d1c97803 100644 --- a/Sources/DOMKit/WebIDL/FilePropertyBag.swift +++ b/Sources/DOMKit/WebIDL/FilePropertyBag.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FilePropertyBag: BridgedDictionary { public convenience init(lastModified: Int64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.lastModified] = lastModified.jsValue() + object[Strings.lastModified] = lastModified.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileReader.swift b/Sources/DOMKit/WebIDL/FileReader.swift index db62eef3..90cbd578 100644 --- a/Sources/DOMKit/WebIDL/FileReader.swift +++ b/Sources/DOMKit/WebIDL/FileReader.swift @@ -25,22 +25,22 @@ public class FileReader: EventTarget { @inlinable public func readAsArrayBuffer(blob: Blob) { let this = jsObject - _ = this[Strings.readAsArrayBuffer].function!(this: this, arguments: [blob.jsValue()]) + _ = this[Strings.readAsArrayBuffer].function!(this: this, arguments: [blob.jsValue]) } @inlinable public func readAsBinaryString(blob: Blob) { let this = jsObject - _ = this[Strings.readAsBinaryString].function!(this: this, arguments: [blob.jsValue()]) + _ = this[Strings.readAsBinaryString].function!(this: this, arguments: [blob.jsValue]) } @inlinable public func readAsText(blob: Blob, encoding: String? = nil) { let this = jsObject - _ = this[Strings.readAsText].function!(this: this, arguments: [blob.jsValue(), encoding?.jsValue() ?? .undefined]) + _ = this[Strings.readAsText].function!(this: this, arguments: [blob.jsValue, encoding?.jsValue ?? .undefined]) } @inlinable public func readAsDataURL(blob: Blob) { let this = jsObject - _ = this[Strings.readAsDataURL].function!(this: this, arguments: [blob.jsValue()]) + _ = this[Strings.readAsDataURL].function!(this: this, arguments: [blob.jsValue]) } @inlinable public func abort() { diff --git a/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift b/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift index 625b2d58..2a88329c 100644 --- a/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift +++ b/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FileSystemCreateWritableOptions: BridgedDictionary { public convenience init(keepExistingData: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keepExistingData] = keepExistingData.jsValue() + object[Strings.keepExistingData] = keepExistingData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift index 70ee92b0..be23cb3a 100644 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift +++ b/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift @@ -18,49 +18,49 @@ public class FileSystemDirectoryHandle: FileSystemHandle, AsyncSequence { @inlinable public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) async throws -> FileSystemFileHandle { let this = jsObject - let _promise: JSPromise = this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) async throws -> FileSystemDirectoryHandle { let this = jsObject - let _promise: JSPromise = this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func resolve(possibleDescendant: FileSystemHandle) -> JSPromise { let this = jsObject - return this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue()]).fromJSValue()! + return this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func resolve(possibleDescendant: FileSystemHandle) async throws -> [String]? { let this = jsObject - let _promise: JSPromise = this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift b/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift index 76366829..cc5fa35c 100644 --- a/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift +++ b/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift @@ -19,18 +19,18 @@ public class FileSystemFileHandle: FileSystemHandle { @inlinable public func getFile() async throws -> File { let this = jsObject let _promise: JSPromise = this[Strings.getFile].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func createWritable(options: FileSystemCreateWritableOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func createWritable(options: FileSystemCreateWritableOptions? = nil) async throws -> FileSystemWritableFileStream { let this = jsObject - let _promise: JSPromise = this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FileSystemFlags.swift b/Sources/DOMKit/WebIDL/FileSystemFlags.swift index 2efbf986..99f05c9e 100644 --- a/Sources/DOMKit/WebIDL/FileSystemFlags.swift +++ b/Sources/DOMKit/WebIDL/FileSystemFlags.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class FileSystemFlags: BridgedDictionary { public convenience init(create: Bool, exclusive: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.create] = create.jsValue() - object[Strings.exclusive] = exclusive.jsValue() + object[Strings.create] = create.jsValue + object[Strings.exclusive] = exclusive.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift b/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift index 166372c1..6264bdfd 100644 --- a/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift +++ b/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FileSystemGetDirectoryOptions: BridgedDictionary { public convenience init(create: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.create] = create.jsValue() + object[Strings.create] = create.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift b/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift index 790da979..05b088e5 100644 --- a/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift +++ b/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FileSystemGetFileOptions: BridgedDictionary { public convenience init(create: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.create] = create.jsValue() + object[Strings.create] = create.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileSystemHandle.swift b/Sources/DOMKit/WebIDL/FileSystemHandle.swift index b9892fe2..508012c9 100644 --- a/Sources/DOMKit/WebIDL/FileSystemHandle.swift +++ b/Sources/DOMKit/WebIDL/FileSystemHandle.swift @@ -22,37 +22,37 @@ public class FileSystemHandle: JSBridgedClass { @inlinable public func isSameEntry(other: FileSystemHandle) -> JSPromise { let this = jsObject - return this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! + return this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func isSameEntry(other: FileSystemHandle) async throws -> Bool { let this = jsObject - let _promise: JSPromise = this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { let this = jsObject - return this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { let this = jsObject - let _promise: JSPromise = this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { let this = jsObject - let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift b/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift index 818682ce..d5834819 100644 --- a/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift +++ b/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift @@ -18,5 +18,5 @@ public enum FileSystemHandleKind: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift b/Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift index daeb3952..64b5aa8c 100644 --- a/Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FileSystemHandlePermissionDescriptor: BridgedDictionary { public convenience init(mode: FileSystemPermissionMode) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue() + object[Strings.mode] = mode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift index c1180bdc..2f77ba74 100644 --- a/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class FileSystemPermissionDescriptor: BridgedDictionary { public convenience init(handle: FileSystemHandle, mode: FileSystemPermissionMode) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.handle] = handle.jsValue() - object[Strings.mode] = mode.jsValue() + object[Strings.handle] = handle.jsValue + object[Strings.mode] = mode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift b/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift index 745c2233..005320a1 100644 --- a/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift +++ b/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift @@ -18,5 +18,5 @@ public enum FileSystemPermissionMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift b/Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift index 190961be..2ebccb04 100644 --- a/Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift +++ b/Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FileSystemRemoveOptions: BridgedDictionary { public convenience init(recursive: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.recursive] = recursive.jsValue() + object[Strings.recursive] = recursive.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift b/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift index e614191a..7aa5f030 100644 --- a/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift +++ b/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift @@ -12,37 +12,37 @@ public class FileSystemWritableFileStream: WritableStream { @inlinable public func write(data: FileSystemWriteChunkType) -> JSPromise { let this = jsObject - return this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! + return this[Strings.write].function!(this: this, arguments: [data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func write(data: FileSystemWriteChunkType) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func seek(position: UInt64) -> JSPromise { let this = jsObject - return this[Strings.seek].function!(this: this, arguments: [position.jsValue()]).fromJSValue()! + return this[Strings.seek].function!(this: this, arguments: [position.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func seek(position: UInt64) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.seek].function!(this: this, arguments: [position.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.seek].function!(this: this, arguments: [position.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func truncate(size: UInt64) -> JSPromise { let this = jsObject - return this[Strings.truncate].function!(this: this, arguments: [size.jsValue()]).fromJSValue()! + return this[Strings.truncate].function!(this: this, arguments: [size.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func truncate(size: UInt64) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.truncate].function!(this: this, arguments: [size.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.truncate].function!(this: this, arguments: [size.jsValue]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift b/Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift index d52dedb6..ccec41b9 100644 --- a/Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift +++ b/Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift @@ -31,16 +31,16 @@ public enum FileSystemWriteChunkType: JSValueCompatible, Any_FileSystemWriteChun return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .blob(blob): - return blob.jsValue() + return blob.jsValue case let .bufferSource(bufferSource): - return bufferSource.jsValue() + return bufferSource.jsValue case let .string(string): - return string.jsValue() + return string.jsValue case let .writeParams(writeParams): - return writeParams.jsValue() + return writeParams.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift b/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift index af75dbab..aef3a63e 100644 --- a/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift +++ b/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift @@ -26,14 +26,14 @@ public enum File_or_FormData_or_String: JSValueCompatible, Any_File_or_FormData_ return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .file(file): - return file.jsValue() + return file.jsValue case let .formData(formData): - return formData.jsValue() + return formData.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/FillLightMode.swift b/Sources/DOMKit/WebIDL/FillLightMode.swift index 9427ec70..1e16ed84 100644 --- a/Sources/DOMKit/WebIDL/FillLightMode.swift +++ b/Sources/DOMKit/WebIDL/FillLightMode.swift @@ -19,5 +19,5 @@ public enum FillLightMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/FillMode.swift b/Sources/DOMKit/WebIDL/FillMode.swift index b533c01d..b1063c23 100644 --- a/Sources/DOMKit/WebIDL/FillMode.swift +++ b/Sources/DOMKit/WebIDL/FillMode.swift @@ -21,5 +21,5 @@ public enum FillMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Float32List.swift b/Sources/DOMKit/WebIDL/Float32List.swift index 5c6efaf1..3dd8cf37 100644 --- a/Sources/DOMKit/WebIDL/Float32List.swift +++ b/Sources/DOMKit/WebIDL/Float32List.swift @@ -21,12 +21,12 @@ public enum Float32List: JSValueCompatible, Any_Float32List { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .float32Array(float32Array): - return float32Array.jsValue() + return float32Array.jsValue case let .seq_of_GLfloat(seq_of_GLfloat): - return seq_of_GLfloat.jsValue() + return seq_of_GLfloat.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/FlowControlType.swift b/Sources/DOMKit/WebIDL/FlowControlType.swift index d7346bd2..9d9bb94c 100644 --- a/Sources/DOMKit/WebIDL/FlowControlType.swift +++ b/Sources/DOMKit/WebIDL/FlowControlType.swift @@ -18,5 +18,5 @@ public enum FlowControlType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/FocusEvent.swift b/Sources/DOMKit/WebIDL/FocusEvent.swift index 67fbdffc..8fc35205 100644 --- a/Sources/DOMKit/WebIDL/FocusEvent.swift +++ b/Sources/DOMKit/WebIDL/FocusEvent.swift @@ -12,7 +12,7 @@ public class FocusEvent: UIEvent { } @inlinable public convenience init(type: String, eventInitDict: FocusEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FocusEventInit.swift b/Sources/DOMKit/WebIDL/FocusEventInit.swift index d3ee1c3d..d2a1efb8 100644 --- a/Sources/DOMKit/WebIDL/FocusEventInit.swift +++ b/Sources/DOMKit/WebIDL/FocusEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FocusEventInit: BridgedDictionary { public convenience init(relatedTarget: EventTarget?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.relatedTarget] = relatedTarget.jsValue() + object[Strings.relatedTarget] = relatedTarget.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FocusOptions.swift b/Sources/DOMKit/WebIDL/FocusOptions.swift index d40f27c3..ce7b2385 100644 --- a/Sources/DOMKit/WebIDL/FocusOptions.swift +++ b/Sources/DOMKit/WebIDL/FocusOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FocusOptions: BridgedDictionary { public convenience init(preventScroll: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.preventScroll] = preventScroll.jsValue() + object[Strings.preventScroll] = preventScroll.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift b/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift index 7ce0efad..0ba11437 100644 --- a/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift +++ b/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift @@ -18,5 +18,5 @@ public enum FocusableAreaSearchMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/FocusableAreasOption.swift b/Sources/DOMKit/WebIDL/FocusableAreasOption.swift index f7c02834..572e8097 100644 --- a/Sources/DOMKit/WebIDL/FocusableAreasOption.swift +++ b/Sources/DOMKit/WebIDL/FocusableAreasOption.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FocusableAreasOption: BridgedDictionary { public convenience init(mode: FocusableAreaSearchMode) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue() + object[Strings.mode] = mode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FontFace.swift b/Sources/DOMKit/WebIDL/FontFace.swift index 514e2620..cc9e63c2 100644 --- a/Sources/DOMKit/WebIDL/FontFace.swift +++ b/Sources/DOMKit/WebIDL/FontFace.swift @@ -30,7 +30,7 @@ public class FontFace: JSBridgedClass { } @inlinable public convenience init(family: String, source: BinaryData_or_String, descriptors: FontFaceDescriptors? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [family.jsValue(), source.jsValue(), descriptors?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [family.jsValue, source.jsValue, descriptors?.jsValue ?? .undefined])) } @ReadWriteAttribute @@ -81,7 +81,7 @@ public class FontFace: JSBridgedClass { @inlinable public func load() async throws -> FontFace { let this = jsObject let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift b/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift index 6b1186ec..61b9bbe5 100644 --- a/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift +++ b/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift @@ -6,17 +6,17 @@ import JavaScriptKit public class FontFaceDescriptors: BridgedDictionary { public convenience init(style: String, weight: String, stretch: String, unicodeRange: String, variant: String, featureSettings: String, variationSettings: String, display: String, ascentOverride: String, descentOverride: String, lineGapOverride: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.style] = style.jsValue() - object[Strings.weight] = weight.jsValue() - object[Strings.stretch] = stretch.jsValue() - object[Strings.unicodeRange] = unicodeRange.jsValue() - object[Strings.variant] = variant.jsValue() - object[Strings.featureSettings] = featureSettings.jsValue() - object[Strings.variationSettings] = variationSettings.jsValue() - object[Strings.display] = display.jsValue() - object[Strings.ascentOverride] = ascentOverride.jsValue() - object[Strings.descentOverride] = descentOverride.jsValue() - object[Strings.lineGapOverride] = lineGapOverride.jsValue() + object[Strings.style] = style.jsValue + object[Strings.weight] = weight.jsValue + object[Strings.stretch] = stretch.jsValue + object[Strings.unicodeRange] = unicodeRange.jsValue + object[Strings.variant] = variant.jsValue + object[Strings.featureSettings] = featureSettings.jsValue + object[Strings.variationSettings] = variationSettings.jsValue + object[Strings.display] = display.jsValue + object[Strings.ascentOverride] = ascentOverride.jsValue + object[Strings.descentOverride] = descentOverride.jsValue + object[Strings.lineGapOverride] = lineGapOverride.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift b/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift index 25d22c07..49b857eb 100644 --- a/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift +++ b/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift @@ -20,5 +20,5 @@ public enum FontFaceLoadStatus: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/FontFaceSet.swift b/Sources/DOMKit/WebIDL/FontFaceSet.swift index 3c2c9854..3b90b43a 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSet.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSet.swift @@ -16,19 +16,19 @@ public class FontFaceSet: EventTarget { } @inlinable public convenience init(initialFaces: [FontFace]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [initialFaces.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [initialFaces.jsValue])) } // XXX: make me Set-like! @inlinable public func add(font: FontFace) -> Self { let this = jsObject - return this[Strings.add].function!(this: this, arguments: [font.jsValue()]).fromJSValue()! + return this[Strings.add].function!(this: this, arguments: [font.jsValue]).fromJSValue()! } @inlinable public func delete(font: FontFace) -> Bool { let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [font.jsValue()]).fromJSValue()! + return this[Strings.delete].function!(this: this, arguments: [font.jsValue]).fromJSValue()! } @inlinable public func clear() { @@ -47,19 +47,19 @@ public class FontFaceSet: EventTarget { @inlinable public func load(font: String, text: String? = nil) -> JSPromise { let this = jsObject - return this[Strings.load].function!(this: this, arguments: [font.jsValue(), text?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.load].function!(this: this, arguments: [font.jsValue, text?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func load(font: String, text: String? = nil) async throws -> [FontFace] { let this = jsObject - let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [font.jsValue(), text?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [font.jsValue, text?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func check(font: String, text: String? = nil) -> Bool { let this = jsObject - return this[Strings.check].function!(this: this, arguments: [font.jsValue(), text?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.check].function!(this: this, arguments: [font.jsValue, text?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift index 4a893c1a..6f04df9e 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift @@ -12,7 +12,7 @@ public class FontFaceSetLoadEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: FontFaceSetLoadEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift index 9336d52e..df00ac10 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FontFaceSetLoadEventInit: BridgedDictionary { public convenience init(fontfaces: [FontFace]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fontfaces] = fontfaces.jsValue() + object[Strings.fontfaces] = fontfaces.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift index 999dd065..56e08f4b 100644 --- a/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift +++ b/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift @@ -18,5 +18,5 @@ public enum FontFaceSetLoadStatus: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/FontManager.swift b/Sources/DOMKit/WebIDL/FontManager.swift index 68bde960..2fbe9b2f 100644 --- a/Sources/DOMKit/WebIDL/FontManager.swift +++ b/Sources/DOMKit/WebIDL/FontManager.swift @@ -14,13 +14,13 @@ public class FontManager: JSBridgedClass { @inlinable public func query(options: QueryOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.query].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.query].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func query(options: QueryOptions? = nil) async throws -> [FontMetadata] { let this = jsObject - let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/FontMetadata.swift b/Sources/DOMKit/WebIDL/FontMetadata.swift index faef1e91..1c49d82c 100644 --- a/Sources/DOMKit/WebIDL/FontMetadata.swift +++ b/Sources/DOMKit/WebIDL/FontMetadata.swift @@ -25,7 +25,7 @@ public class FontMetadata: JSBridgedClass { @inlinable public func blob() async throws -> Blob { let this = jsObject let _promise: JSPromise = this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FormData.swift b/Sources/DOMKit/WebIDL/FormData.swift index e5f699c4..ff3d1973 100644 --- a/Sources/DOMKit/WebIDL/FormData.swift +++ b/Sources/DOMKit/WebIDL/FormData.swift @@ -13,47 +13,47 @@ public class FormData: JSBridgedClass, Sequence { } @inlinable public convenience init(form: HTMLFormElement? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [form?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [form?.jsValue ?? .undefined])) } @inlinable public func append(name: String, value: String) { let this = jsObject - _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) + _ = this[Strings.append].function!(this: this, arguments: [name.jsValue, value.jsValue]) } @inlinable public func append(name: String, blobValue: Blob, filename: String? = nil) { let this = jsObject - _ = this[Strings.append].function!(this: this, arguments: [name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined]) + _ = this[Strings.append].function!(this: this, arguments: [name.jsValue, blobValue.jsValue, filename?.jsValue ?? .undefined]) } @inlinable public func delete(name: String) { let this = jsObject - _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue()]) + _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue]) } @inlinable public func get(name: String) -> FormDataEntryValue? { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func getAll(name: String) -> [FormDataEntryValue] { let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.getAll].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func has(name: String) -> Bool { let this = jsObject - return this[Strings.has].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.has].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func set(name: String, value: String) { let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) + _ = this[Strings.set].function!(this: this, arguments: [name.jsValue, value.jsValue]) } @inlinable public func set(name: String, blobValue: Blob, filename: String? = nil) { let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), blobValue.jsValue(), filename?.jsValue() ?? .undefined]) + _ = this[Strings.set].function!(this: this, arguments: [name.jsValue, blobValue.jsValue, filename?.jsValue ?? .undefined]) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/FormDataEntryValue.swift b/Sources/DOMKit/WebIDL/FormDataEntryValue.swift index b8fc63b8..d01d9e44 100644 --- a/Sources/DOMKit/WebIDL/FormDataEntryValue.swift +++ b/Sources/DOMKit/WebIDL/FormDataEntryValue.swift @@ -21,12 +21,12 @@ public enum FormDataEntryValue: JSValueCompatible, Any_FormDataEntryValue { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .file(file): - return file.jsValue() + return file.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/FormDataEvent.swift b/Sources/DOMKit/WebIDL/FormDataEvent.swift index 966d4e3e..d5ae7f7f 100644 --- a/Sources/DOMKit/WebIDL/FormDataEvent.swift +++ b/Sources/DOMKit/WebIDL/FormDataEvent.swift @@ -12,7 +12,7 @@ public class FormDataEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: FormDataEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/FormDataEventInit.swift b/Sources/DOMKit/WebIDL/FormDataEventInit.swift index c6193fd5..183075f9 100644 --- a/Sources/DOMKit/WebIDL/FormDataEventInit.swift +++ b/Sources/DOMKit/WebIDL/FormDataEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FormDataEventInit: BridgedDictionary { public convenience init(formData: FormData) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.formData] = formData.jsValue() + object[Strings.formData] = formData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/FrameType.swift b/Sources/DOMKit/WebIDL/FrameType.swift index 7f67c36c..d9f5fe35 100644 --- a/Sources/DOMKit/WebIDL/FrameType.swift +++ b/Sources/DOMKit/WebIDL/FrameType.swift @@ -20,5 +20,5 @@ public enum FrameType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift b/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift index c4916f36..3eb14746 100644 --- a/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift +++ b/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift @@ -19,5 +19,5 @@ public enum FullscreenNavigationUI: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/FullscreenOptions.swift b/Sources/DOMKit/WebIDL/FullscreenOptions.swift index 0e5ff5a9..3ec8a1a0 100644 --- a/Sources/DOMKit/WebIDL/FullscreenOptions.swift +++ b/Sources/DOMKit/WebIDL/FullscreenOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class FullscreenOptions: BridgedDictionary { public convenience init(navigationUI: FullscreenNavigationUI) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.navigationUI] = navigationUI.jsValue() + object[Strings.navigationUI] = navigationUI.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPU.swift b/Sources/DOMKit/WebIDL/GPU.swift index 2f3a3619..21dbfb56 100644 --- a/Sources/DOMKit/WebIDL/GPU.swift +++ b/Sources/DOMKit/WebIDL/GPU.swift @@ -14,13 +14,13 @@ public class GPU: JSBridgedClass { @inlinable public func requestAdapter(options: GPURequestAdapterOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestAdapter(options: GPURequestAdapterOptions? = nil) async throws -> GPUAdapter? { let this = jsObject - let _promise: JSPromise = this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUAdapter.swift b/Sources/DOMKit/WebIDL/GPUAdapter.swift index 68ea4b24..f8292114 100644 --- a/Sources/DOMKit/WebIDL/GPUAdapter.swift +++ b/Sources/DOMKit/WebIDL/GPUAdapter.swift @@ -30,13 +30,13 @@ public class GPUAdapter: JSBridgedClass { @inlinable public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) async throws -> GPUDevice { let this = jsObject - let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUAddressMode.swift b/Sources/DOMKit/WebIDL/GPUAddressMode.swift index db030589..b8f27cfc 100644 --- a/Sources/DOMKit/WebIDL/GPUAddressMode.swift +++ b/Sources/DOMKit/WebIDL/GPUAddressMode.swift @@ -19,5 +19,5 @@ public enum GPUAddressMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift b/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift index 22ec36c0..3741b83b 100644 --- a/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GPUBindGroupDescriptor: BridgedDictionary { public convenience init(layout: GPUBindGroupLayout, entries: [GPUBindGroupEntry]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.layout] = layout.jsValue() - object[Strings.entries] = entries.jsValue() + object[Strings.layout] = layout.jsValue + object[Strings.entries] = entries.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift b/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift index 1e0652f0..2977f435 100644 --- a/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift +++ b/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GPUBindGroupEntry: BridgedDictionary { public convenience init(binding: GPUIndex32, resource: GPUBindingResource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.binding] = binding.jsValue() - object[Strings.resource] = resource.jsValue() + object[Strings.binding] = binding.jsValue + object[Strings.resource] = resource.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift index 43cfd3ca..4210f503 100644 --- a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUBindGroupLayoutDescriptor: BridgedDictionary { public convenience init(entries: [GPUBindGroupLayoutEntry]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.entries] = entries.jsValue() + object[Strings.entries] = entries.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift index 5759ce63..eb93182c 100644 --- a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift +++ b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class GPUBindGroupLayoutEntry: BridgedDictionary { public convenience init(binding: GPUIndex32, visibility: GPUShaderStageFlags, buffer: GPUBufferBindingLayout, sampler: GPUSamplerBindingLayout, texture: GPUTextureBindingLayout, storageTexture: GPUStorageTextureBindingLayout, externalTexture: GPUExternalTextureBindingLayout) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.binding] = binding.jsValue() - object[Strings.visibility] = visibility.jsValue() - object[Strings.buffer] = buffer.jsValue() - object[Strings.sampler] = sampler.jsValue() - object[Strings.texture] = texture.jsValue() - object[Strings.storageTexture] = storageTexture.jsValue() - object[Strings.externalTexture] = externalTexture.jsValue() + object[Strings.binding] = binding.jsValue + object[Strings.visibility] = visibility.jsValue + object[Strings.buffer] = buffer.jsValue + object[Strings.sampler] = sampler.jsValue + object[Strings.texture] = texture.jsValue + object[Strings.storageTexture] = storageTexture.jsValue + object[Strings.externalTexture] = externalTexture.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUBindingResource.swift b/Sources/DOMKit/WebIDL/GPUBindingResource.swift index c6f6ad44..6e06f2cf 100644 --- a/Sources/DOMKit/WebIDL/GPUBindingResource.swift +++ b/Sources/DOMKit/WebIDL/GPUBindingResource.swift @@ -31,16 +31,16 @@ public enum GPUBindingResource: JSValueCompatible, Any_GPUBindingResource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .gPUBufferBinding(gPUBufferBinding): - return gPUBufferBinding.jsValue() + return gPUBufferBinding.jsValue case let .gPUExternalTexture(gPUExternalTexture): - return gPUExternalTexture.jsValue() + return gPUExternalTexture.jsValue case let .gPUSampler(gPUSampler): - return gPUSampler.jsValue() + return gPUSampler.jsValue case let .gPUTextureView(gPUTextureView): - return gPUTextureView.jsValue() + return gPUTextureView.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/GPUBlendComponent.swift b/Sources/DOMKit/WebIDL/GPUBlendComponent.swift index 798fa2e5..120515cb 100644 --- a/Sources/DOMKit/WebIDL/GPUBlendComponent.swift +++ b/Sources/DOMKit/WebIDL/GPUBlendComponent.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUBlendComponent: BridgedDictionary { public convenience init(operation: GPUBlendOperation, srcFactor: GPUBlendFactor, dstFactor: GPUBlendFactor) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.operation] = operation.jsValue() - object[Strings.srcFactor] = srcFactor.jsValue() - object[Strings.dstFactor] = dstFactor.jsValue() + object[Strings.operation] = operation.jsValue + object[Strings.srcFactor] = srcFactor.jsValue + object[Strings.dstFactor] = dstFactor.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUBlendFactor.swift b/Sources/DOMKit/WebIDL/GPUBlendFactor.swift index 8b83ef47..51b995cd 100644 --- a/Sources/DOMKit/WebIDL/GPUBlendFactor.swift +++ b/Sources/DOMKit/WebIDL/GPUBlendFactor.swift @@ -29,5 +29,5 @@ public enum GPUBlendFactor: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUBlendOperation.swift b/Sources/DOMKit/WebIDL/GPUBlendOperation.swift index a6f860f4..f283df40 100644 --- a/Sources/DOMKit/WebIDL/GPUBlendOperation.swift +++ b/Sources/DOMKit/WebIDL/GPUBlendOperation.swift @@ -21,5 +21,5 @@ public enum GPUBlendOperation: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUBlendState.swift b/Sources/DOMKit/WebIDL/GPUBlendState.swift index 1d09ca29..98fb42b7 100644 --- a/Sources/DOMKit/WebIDL/GPUBlendState.swift +++ b/Sources/DOMKit/WebIDL/GPUBlendState.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GPUBlendState: BridgedDictionary { public convenience init(color: GPUBlendComponent, alpha: GPUBlendComponent) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.color] = color.jsValue() - object[Strings.alpha] = alpha.jsValue() + object[Strings.color] = color.jsValue + object[Strings.alpha] = alpha.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUBuffer.swift b/Sources/DOMKit/WebIDL/GPUBuffer.swift index 601b5be3..f2cdbeca 100644 --- a/Sources/DOMKit/WebIDL/GPUBuffer.swift +++ b/Sources/DOMKit/WebIDL/GPUBuffer.swift @@ -14,19 +14,19 @@ public class GPUBuffer: JSBridgedClass, GPUObjectBase { @inlinable public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) -> JSPromise { let this = jsObject - return this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func getMappedRange(offset: GPUSize64? = nil, size: GPUSize64? = nil) -> ArrayBuffer { let this = jsObject - return this[Strings.getMappedRange].function!(this: this, arguments: [offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getMappedRange].function!(this: this, arguments: [offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func unmap() { diff --git a/Sources/DOMKit/WebIDL/GPUBufferBinding.swift b/Sources/DOMKit/WebIDL/GPUBufferBinding.swift index b73f06c4..3e1f9079 100644 --- a/Sources/DOMKit/WebIDL/GPUBufferBinding.swift +++ b/Sources/DOMKit/WebIDL/GPUBufferBinding.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUBufferBinding: BridgedDictionary { public convenience init(buffer: GPUBuffer, offset: GPUSize64, size: GPUSize64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffer] = buffer.jsValue() - object[Strings.offset] = offset.jsValue() - object[Strings.size] = size.jsValue() + object[Strings.buffer] = buffer.jsValue + object[Strings.offset] = offset.jsValue + object[Strings.size] = size.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift index fb214e7d..bd05cbd8 100644 --- a/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift +++ b/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUBufferBindingLayout: BridgedDictionary { public convenience init(type: GPUBufferBindingType, hasDynamicOffset: Bool, minBindingSize: GPUSize64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.hasDynamicOffset] = hasDynamicOffset.jsValue() - object[Strings.minBindingSize] = minBindingSize.jsValue() + object[Strings.type] = type.jsValue + object[Strings.hasDynamicOffset] = hasDynamicOffset.jsValue + object[Strings.minBindingSize] = minBindingSize.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift b/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift index b3257eeb..8e0d3a28 100644 --- a/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift +++ b/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift @@ -19,5 +19,5 @@ public enum GPUBufferBindingType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift b/Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift index fbb643ae..f80dc94f 100644 --- a/Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUBufferDescriptor: BridgedDictionary { public convenience init(size: GPUSize64, usage: GPUBufferUsageFlags, mappedAtCreation: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.size] = size.jsValue() - object[Strings.usage] = usage.jsValue() - object[Strings.mappedAtCreation] = mappedAtCreation.jsValue() + object[Strings.size] = size.jsValue + object[Strings.usage] = usage.jsValue + object[Strings.mappedAtCreation] = mappedAtCreation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift b/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift index 6551bc7c..9643f83e 100644 --- a/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift +++ b/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift @@ -21,12 +21,12 @@ public enum GPUBuffer_or_WebGLBuffer: JSValueCompatible, Any_GPUBuffer_or_WebGLB return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .gPUBuffer(gPUBuffer): - return gPUBuffer.jsValue() + return gPUBuffer.jsValue case let .webGLBuffer(webGLBuffer): - return webGLBuffer.jsValue() + return webGLBuffer.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift b/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift index a2d2310a..aea7f1ca 100644 --- a/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift +++ b/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift @@ -18,5 +18,5 @@ public enum GPUCanvasCompositingAlphaMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift b/Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift index 3cdf14bd..9d47ab39 100644 --- a/Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift +++ b/Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class GPUCanvasConfiguration: BridgedDictionary { public convenience init(device: GPUDevice, format: GPUTextureFormat, usage: GPUTextureUsageFlags, viewFormats: [GPUTextureFormat], colorSpace: GPUPredefinedColorSpace, compositingAlphaMode: GPUCanvasCompositingAlphaMode, size: GPUExtent3D) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue() - object[Strings.format] = format.jsValue() - object[Strings.usage] = usage.jsValue() - object[Strings.viewFormats] = viewFormats.jsValue() - object[Strings.colorSpace] = colorSpace.jsValue() - object[Strings.compositingAlphaMode] = compositingAlphaMode.jsValue() - object[Strings.size] = size.jsValue() + object[Strings.device] = device.jsValue + object[Strings.format] = format.jsValue + object[Strings.usage] = usage.jsValue + object[Strings.viewFormats] = viewFormats.jsValue + object[Strings.colorSpace] = colorSpace.jsValue + object[Strings.compositingAlphaMode] = compositingAlphaMode.jsValue + object[Strings.size] = size.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift index d395a114..578e75e9 100644 --- a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift +++ b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift @@ -18,7 +18,7 @@ public class GPUCanvasContext: JSBridgedClass { @inlinable public func configure(configuration: GPUCanvasConfiguration) { let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [configuration.jsValue()]) + _ = this[Strings.configure].function!(this: this, arguments: [configuration.jsValue]) } @inlinable public func unconfigure() { @@ -28,7 +28,7 @@ public class GPUCanvasContext: JSBridgedClass { @inlinable public func getPreferredFormat(adapter: GPUAdapter) -> GPUTextureFormat { let this = jsObject - return this[Strings.getPreferredFormat].function!(this: this, arguments: [adapter.jsValue()]).fromJSValue()! + return this[Strings.getPreferredFormat].function!(this: this, arguments: [adapter.jsValue]).fromJSValue()! } @inlinable public func getCurrentTexture() -> GPUTexture { diff --git a/Sources/DOMKit/WebIDL/GPUColor.swift b/Sources/DOMKit/WebIDL/GPUColor.swift index ef52b901..82cd8703 100644 --- a/Sources/DOMKit/WebIDL/GPUColor.swift +++ b/Sources/DOMKit/WebIDL/GPUColor.swift @@ -21,12 +21,12 @@ public enum GPUColor: JSValueCompatible, Any_GPUColor { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .gPUColorDict(gPUColorDict): - return gPUColorDict.jsValue() + return gPUColorDict.jsValue case let .seq_of_Double(seq_of_Double): - return seq_of_Double.jsValue() + return seq_of_Double.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/GPUColorDict.swift b/Sources/DOMKit/WebIDL/GPUColorDict.swift index 36762e44..ac4a0515 100644 --- a/Sources/DOMKit/WebIDL/GPUColorDict.swift +++ b/Sources/DOMKit/WebIDL/GPUColorDict.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class GPUColorDict: BridgedDictionary { public convenience init(r: Double, g: Double, b: Double, a: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.r] = r.jsValue() - object[Strings.g] = g.jsValue() - object[Strings.b] = b.jsValue() - object[Strings.a] = a.jsValue() + object[Strings.r] = r.jsValue + object[Strings.g] = g.jsValue + object[Strings.b] = b.jsValue + object[Strings.a] = a.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUColorTargetState.swift b/Sources/DOMKit/WebIDL/GPUColorTargetState.swift index adf69613..f513fb2d 100644 --- a/Sources/DOMKit/WebIDL/GPUColorTargetState.swift +++ b/Sources/DOMKit/WebIDL/GPUColorTargetState.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUColorTargetState: BridgedDictionary { public convenience init(format: GPUTextureFormat, blend: GPUBlendState, writeMask: GPUColorWriteFlags) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue() - object[Strings.blend] = blend.jsValue() - object[Strings.writeMask] = writeMask.jsValue() + object[Strings.format] = format.jsValue + object[Strings.blend] = blend.jsValue + object[Strings.writeMask] = writeMask.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift b/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift index 19ce6bef..7774f676 100644 --- a/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift @@ -14,51 +14,51 @@ public class GPUCommandEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, @inlinable public func beginRenderPass(descriptor: GPURenderPassDescriptor) -> GPURenderPassEncoder { let this = jsObject - return this[Strings.beginRenderPass].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.beginRenderPass].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func beginComputePass(descriptor: GPUComputePassDescriptor? = nil) -> GPUComputePassEncoder { let this = jsObject - return this[Strings.beginComputePass].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.beginComputePass].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64) { let this = jsObject - _ = this[Strings.copyBufferToBuffer].function!(this: this, arguments: [source.jsValue(), sourceOffset.jsValue(), destination.jsValue(), destinationOffset.jsValue(), size.jsValue()]) + _ = this[Strings.copyBufferToBuffer].function!(this: this, arguments: [source.jsValue, sourceOffset.jsValue, destination.jsValue, destinationOffset.jsValue, size.jsValue]) } @inlinable public func copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { let this = jsObject - _ = this[Strings.copyBufferToTexture].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) + _ = this[Strings.copyBufferToTexture].function!(this: this, arguments: [source.jsValue, destination.jsValue, copySize.jsValue]) } @inlinable public func copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D) { let this = jsObject - _ = this[Strings.copyTextureToBuffer].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) + _ = this[Strings.copyTextureToBuffer].function!(this: this, arguments: [source.jsValue, destination.jsValue, copySize.jsValue]) } @inlinable public func copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { let this = jsObject - _ = this[Strings.copyTextureToTexture].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) + _ = this[Strings.copyTextureToTexture].function!(this: this, arguments: [source.jsValue, destination.jsValue, copySize.jsValue]) } @inlinable public func clearBuffer(buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { let this = jsObject - _ = this[Strings.clearBuffer].function!(this: this, arguments: [buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) + _ = this[Strings.clearBuffer].function!(this: this, arguments: [buffer.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]) } @inlinable public func writeTimestamp(querySet: GPUQuerySet, queryIndex: GPUSize32) { let this = jsObject - _ = this[Strings.writeTimestamp].function!(this: this, arguments: [querySet.jsValue(), queryIndex.jsValue()]) + _ = this[Strings.writeTimestamp].function!(this: this, arguments: [querySet.jsValue, queryIndex.jsValue]) } @inlinable public func resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64) { let this = jsObject - _ = this[Strings.resolveQuerySet].function!(this: this, arguments: [querySet.jsValue(), firstQuery.jsValue(), queryCount.jsValue(), destination.jsValue(), destinationOffset.jsValue()]) + _ = this[Strings.resolveQuerySet].function!(this: this, arguments: [querySet.jsValue, firstQuery.jsValue, queryCount.jsValue, destination.jsValue, destinationOffset.jsValue]) } @inlinable public func finish(descriptor: GPUCommandBufferDescriptor? = nil) -> GPUCommandBuffer { let this = jsObject - return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUCompareFunction.swift b/Sources/DOMKit/WebIDL/GPUCompareFunction.swift index f9c97590..c09eb376 100644 --- a/Sources/DOMKit/WebIDL/GPUCompareFunction.swift +++ b/Sources/DOMKit/WebIDL/GPUCompareFunction.swift @@ -24,5 +24,5 @@ public enum GPUCompareFunction: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift b/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift index 74c09ccb..d6f8c3d5 100644 --- a/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift +++ b/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift @@ -19,5 +19,5 @@ public enum GPUCompilationMessageType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift b/Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift index e1b0575b..8f51dea7 100644 --- a/Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUComputePassDescriptor: BridgedDictionary { public convenience init(timestampWrites: GPUComputePassTimestampWrites) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestampWrites] = timestampWrites.jsValue() + object[Strings.timestampWrites] = timestampWrites.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift index 53de6a37..a2e16137 100644 --- a/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift @@ -14,17 +14,17 @@ public class GPUComputePassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMi @inlinable public func setPipeline(pipeline: GPUComputePipeline) { let this = jsObject - _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue()]) + _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue]) } @inlinable public func dispatch(workgroupCountX: GPUSize32, workgroupCountY: GPUSize32? = nil, workgroupCountZ: GPUSize32? = nil) { let this = jsObject - _ = this[Strings.dispatch].function!(this: this, arguments: [workgroupCountX.jsValue(), workgroupCountY?.jsValue() ?? .undefined, workgroupCountZ?.jsValue() ?? .undefined]) + _ = this[Strings.dispatch].function!(this: this, arguments: [workgroupCountX.jsValue, workgroupCountY?.jsValue ?? .undefined, workgroupCountZ?.jsValue ?? .undefined]) } @inlinable public func dispatchIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { let this = jsObject - _ = this[Strings.dispatchIndirect].function!(this: this, arguments: [indirectBuffer.jsValue(), indirectOffset.jsValue()]) + _ = this[Strings.dispatchIndirect].function!(this: this, arguments: [indirectBuffer.jsValue, indirectOffset.jsValue]) } @inlinable public func end() { diff --git a/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift b/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift index 4a1d0f6a..8a26f0d4 100644 --- a/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift +++ b/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift @@ -18,5 +18,5 @@ public enum GPUComputePassTimestampLocation: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift b/Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift index 4c656940..b6f87cc5 100644 --- a/Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift +++ b/Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUComputePassTimestampWrite: BridgedDictionary { public convenience init(querySet: GPUQuerySet, queryIndex: GPUSize32, location: GPUComputePassTimestampLocation) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.querySet] = querySet.jsValue() - object[Strings.queryIndex] = queryIndex.jsValue() - object[Strings.location] = location.jsValue() + object[Strings.querySet] = querySet.jsValue + object[Strings.queryIndex] = queryIndex.jsValue + object[Strings.location] = location.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift b/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift index e54ae67c..2d6a7c90 100644 --- a/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUComputePipelineDescriptor: BridgedDictionary { public convenience init(compute: GPUProgrammableStage) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.compute] = compute.jsValue() + object[Strings.compute] = compute.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUCullMode.swift b/Sources/DOMKit/WebIDL/GPUCullMode.swift index 0e3c8393..aac8d9c3 100644 --- a/Sources/DOMKit/WebIDL/GPUCullMode.swift +++ b/Sources/DOMKit/WebIDL/GPUCullMode.swift @@ -19,5 +19,5 @@ public enum GPUCullMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift b/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift index 6c4bda65..b1ecfa70 100644 --- a/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift +++ b/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift @@ -7,7 +7,7 @@ public protocol GPUDebugCommandsMixin: JSBridgedClass {} public extension GPUDebugCommandsMixin { @inlinable func pushDebugGroup(groupLabel: String) { let this = jsObject - _ = this[Strings.pushDebugGroup].function!(this: this, arguments: [groupLabel.jsValue()]) + _ = this[Strings.pushDebugGroup].function!(this: this, arguments: [groupLabel.jsValue]) } @inlinable func popDebugGroup() { @@ -17,6 +17,6 @@ public extension GPUDebugCommandsMixin { @inlinable func insertDebugMarker(markerLabel: String) { let this = jsObject - _ = this[Strings.insertDebugMarker].function!(this: this, arguments: [markerLabel.jsValue()]) + _ = this[Strings.insertDebugMarker].function!(this: this, arguments: [markerLabel.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift b/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift index 45e86e56..288cd758 100644 --- a/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift +++ b/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift @@ -6,16 +6,16 @@ import JavaScriptKit public class GPUDepthStencilState: BridgedDictionary { public convenience init(format: GPUTextureFormat, depthWriteEnabled: Bool, depthCompare: GPUCompareFunction, stencilFront: GPUStencilFaceState, stencilBack: GPUStencilFaceState, stencilReadMask: GPUStencilValue, stencilWriteMask: GPUStencilValue, depthBias: GPUDepthBias, depthBiasSlopeScale: Float, depthBiasClamp: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue() - object[Strings.depthWriteEnabled] = depthWriteEnabled.jsValue() - object[Strings.depthCompare] = depthCompare.jsValue() - object[Strings.stencilFront] = stencilFront.jsValue() - object[Strings.stencilBack] = stencilBack.jsValue() - object[Strings.stencilReadMask] = stencilReadMask.jsValue() - object[Strings.stencilWriteMask] = stencilWriteMask.jsValue() - object[Strings.depthBias] = depthBias.jsValue() - object[Strings.depthBiasSlopeScale] = depthBiasSlopeScale.jsValue() - object[Strings.depthBiasClamp] = depthBiasClamp.jsValue() + object[Strings.format] = format.jsValue + object[Strings.depthWriteEnabled] = depthWriteEnabled.jsValue + object[Strings.depthCompare] = depthCompare.jsValue + object[Strings.stencilFront] = stencilFront.jsValue + object[Strings.stencilBack] = stencilBack.jsValue + object[Strings.stencilReadMask] = stencilReadMask.jsValue + object[Strings.stencilWriteMask] = stencilWriteMask.jsValue + object[Strings.depthBias] = depthBias.jsValue + object[Strings.depthBiasSlopeScale] = depthBiasSlopeScale.jsValue + object[Strings.depthBiasClamp] = depthBiasClamp.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUDevice.swift b/Sources/DOMKit/WebIDL/GPUDevice.swift index 5b8b2aff..fba48ca1 100644 --- a/Sources/DOMKit/WebIDL/GPUDevice.swift +++ b/Sources/DOMKit/WebIDL/GPUDevice.swift @@ -31,91 +31,91 @@ public class GPUDevice: EventTarget, GPUObjectBase { @inlinable public func createBuffer(descriptor: GPUBufferDescriptor) -> GPUBuffer { let this = jsObject - return this[Strings.createBuffer].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createBuffer].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createTexture(descriptor: GPUTextureDescriptor) -> GPUTexture { let this = jsObject - return this[Strings.createTexture].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createTexture].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createSampler(descriptor: GPUSamplerDescriptor? = nil) -> GPUSampler { let this = jsObject - return this[Strings.createSampler].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createSampler].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func importExternalTexture(descriptor: GPUExternalTextureDescriptor) -> GPUExternalTexture { let this = jsObject - return this[Strings.importExternalTexture].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.importExternalTexture].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor) -> GPUBindGroupLayout { let this = jsObject - return this[Strings.createBindGroupLayout].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createBindGroupLayout].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor) -> GPUPipelineLayout { let this = jsObject - return this[Strings.createPipelineLayout].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createPipelineLayout].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createBindGroup(descriptor: GPUBindGroupDescriptor) -> GPUBindGroup { let this = jsObject - return this[Strings.createBindGroup].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createBindGroup].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createShaderModule(descriptor: GPUShaderModuleDescriptor) -> GPUShaderModule { let this = jsObject - return this[Strings.createShaderModule].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createShaderModule].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createComputePipeline(descriptor: GPUComputePipelineDescriptor) -> GPUComputePipeline { let this = jsObject - return this[Strings.createComputePipeline].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createComputePipeline].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createRenderPipeline(descriptor: GPURenderPipelineDescriptor) -> GPURenderPipeline { let this = jsObject - return this[Strings.createRenderPipeline].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createRenderPipeline].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) -> JSPromise { let this = jsObject - return this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) async throws -> GPUComputePipeline { let this = jsObject - let _promise: JSPromise = this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) -> JSPromise { let this = jsObject - return this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) async throws -> GPURenderPipeline { let this = jsObject - let _promise: JSPromise = this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func createCommandEncoder(descriptor: GPUCommandEncoderDescriptor? = nil) -> GPUCommandEncoder { let this = jsObject - return this[Strings.createCommandEncoder].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createCommandEncoder].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor) -> GPURenderBundleEncoder { let this = jsObject - return this[Strings.createRenderBundleEncoder].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createRenderBundleEncoder].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @inlinable public func createQuerySet(descriptor: GPUQuerySetDescriptor) -> GPUQuerySet { let this = jsObject - return this[Strings.createQuerySet].function!(this: this, arguments: [descriptor.jsValue()]).fromJSValue()! + return this[Strings.createQuerySet].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -123,7 +123,7 @@ public class GPUDevice: EventTarget, GPUObjectBase { @inlinable public func pushErrorScope(filter: GPUErrorFilter) { let this = jsObject - _ = this[Strings.pushErrorScope].function!(this: this, arguments: [filter.jsValue()]) + _ = this[Strings.pushErrorScope].function!(this: this, arguments: [filter.jsValue]) } @inlinable public func popErrorScope() -> JSPromise { @@ -135,7 +135,7 @@ public class GPUDevice: EventTarget, GPUObjectBase { @inlinable public func popErrorScope() async throws -> GPUError? { let this = jsObject let _promise: JSPromise = this[Strings.popErrorScope].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift b/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift index db1e5cb1..96309aa1 100644 --- a/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUDeviceDescriptor: BridgedDictionary { public convenience init(requiredFeatures: [GPUFeatureName], requiredLimits: [String: GPUSize64], defaultQueue: GPUQueueDescriptor) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.requiredFeatures] = requiredFeatures.jsValue() - object[Strings.requiredLimits] = requiredLimits.jsValue() - object[Strings.defaultQueue] = defaultQueue.jsValue() + object[Strings.requiredFeatures] = requiredFeatures.jsValue + object[Strings.requiredLimits] = requiredLimits.jsValue + object[Strings.defaultQueue] = defaultQueue.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift index bf59bf81..e953fef7 100644 --- a/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift +++ b/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift @@ -17,5 +17,5 @@ public enum GPUDeviceLostReason: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUError.swift b/Sources/DOMKit/WebIDL/GPUError.swift index 3fa8e559..dcccbe64 100644 --- a/Sources/DOMKit/WebIDL/GPUError.swift +++ b/Sources/DOMKit/WebIDL/GPUError.swift @@ -21,12 +21,12 @@ public enum GPUError: JSValueCompatible, Any_GPUError { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .gPUOutOfMemoryError(gPUOutOfMemoryError): - return gPUOutOfMemoryError.jsValue() + return gPUOutOfMemoryError.jsValue case let .gPUValidationError(gPUValidationError): - return gPUValidationError.jsValue() + return gPUValidationError.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/GPUErrorFilter.swift b/Sources/DOMKit/WebIDL/GPUErrorFilter.swift index 4ec0dea9..32cbd30e 100644 --- a/Sources/DOMKit/WebIDL/GPUErrorFilter.swift +++ b/Sources/DOMKit/WebIDL/GPUErrorFilter.swift @@ -18,5 +18,5 @@ public enum GPUErrorFilter: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUExtent3D.swift b/Sources/DOMKit/WebIDL/GPUExtent3D.swift index bbf8e84d..d985ec2d 100644 --- a/Sources/DOMKit/WebIDL/GPUExtent3D.swift +++ b/Sources/DOMKit/WebIDL/GPUExtent3D.swift @@ -21,12 +21,12 @@ public enum GPUExtent3D: JSValueCompatible, Any_GPUExtent3D { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .gPUExtent3DDict(gPUExtent3DDict): - return gPUExtent3DDict.jsValue() + return gPUExtent3DDict.jsValue case let .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate): - return seq_of_GPUIntegerCoordinate.jsValue() + return seq_of_GPUIntegerCoordinate.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift b/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift index 28c529ad..ca32fa2a 100644 --- a/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift +++ b/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUExtent3DDict: BridgedDictionary { public convenience init(width: GPUIntegerCoordinate, height: GPUIntegerCoordinate, depthOrArrayLayers: GPUIntegerCoordinate) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.width] = width.jsValue() - object[Strings.height] = height.jsValue() - object[Strings.depthOrArrayLayers] = depthOrArrayLayers.jsValue() + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.depthOrArrayLayers] = depthOrArrayLayers.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift b/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift index 4dd787eb..d3be39da 100644 --- a/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GPUExternalTextureDescriptor: BridgedDictionary { public convenience init(source: HTMLVideoElement, colorSpace: GPUPredefinedColorSpace) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.source] = source.jsValue() - object[Strings.colorSpace] = colorSpace.jsValue() + object[Strings.source] = source.jsValue + object[Strings.colorSpace] = colorSpace.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUFeatureName.swift b/Sources/DOMKit/WebIDL/GPUFeatureName.swift index e1c7f0f3..70345e0c 100644 --- a/Sources/DOMKit/WebIDL/GPUFeatureName.swift +++ b/Sources/DOMKit/WebIDL/GPUFeatureName.swift @@ -24,5 +24,5 @@ public enum GPUFeatureName: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUFilterMode.swift b/Sources/DOMKit/WebIDL/GPUFilterMode.swift index ebbb95a5..9dd91a3f 100644 --- a/Sources/DOMKit/WebIDL/GPUFilterMode.swift +++ b/Sources/DOMKit/WebIDL/GPUFilterMode.swift @@ -18,5 +18,5 @@ public enum GPUFilterMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUFragmentState.swift b/Sources/DOMKit/WebIDL/GPUFragmentState.swift index cd78605e..4a238baf 100644 --- a/Sources/DOMKit/WebIDL/GPUFragmentState.swift +++ b/Sources/DOMKit/WebIDL/GPUFragmentState.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUFragmentState: BridgedDictionary { public convenience init(targets: [GPUColorTargetState?]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.targets] = targets.jsValue() + object[Strings.targets] = targets.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUFrontFace.swift b/Sources/DOMKit/WebIDL/GPUFrontFace.swift index 356e8657..814770fa 100644 --- a/Sources/DOMKit/WebIDL/GPUFrontFace.swift +++ b/Sources/DOMKit/WebIDL/GPUFrontFace.swift @@ -18,5 +18,5 @@ public enum GPUFrontFace: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift b/Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift index 8191875d..77034df1 100644 --- a/Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift +++ b/Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUImageCopyBuffer: BridgedDictionary { public convenience init(buffer: GPUBuffer) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffer] = buffer.jsValue() + object[Strings.buffer] = buffer.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift b/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift index f84927cc..5a6b1afa 100644 --- a/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift +++ b/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUImageCopyExternalImage: BridgedDictionary { public convenience init(source: HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas, origin: GPUOrigin2D, flipY: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.source] = source.jsValue() - object[Strings.origin] = origin.jsValue() - object[Strings.flipY] = flipY.jsValue() + object[Strings.source] = source.jsValue + object[Strings.origin] = origin.jsValue + object[Strings.flipY] = flipY.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift b/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift index 2648b776..c7e4b79a 100644 --- a/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift +++ b/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class GPUImageCopyTexture: BridgedDictionary { public convenience init(texture: GPUTexture, mipLevel: GPUIntegerCoordinate, origin: GPUOrigin3D, aspect: GPUTextureAspect) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.texture] = texture.jsValue() - object[Strings.mipLevel] = mipLevel.jsValue() - object[Strings.origin] = origin.jsValue() - object[Strings.aspect] = aspect.jsValue() + object[Strings.texture] = texture.jsValue + object[Strings.mipLevel] = mipLevel.jsValue + object[Strings.origin] = origin.jsValue + object[Strings.aspect] = aspect.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift b/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift index d60bf036..e2b1e2f2 100644 --- a/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift +++ b/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GPUImageCopyTextureTagged: BridgedDictionary { public convenience init(colorSpace: GPUPredefinedColorSpace, premultipliedAlpha: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.colorSpace] = colorSpace.jsValue() - object[Strings.premultipliedAlpha] = premultipliedAlpha.jsValue() + object[Strings.colorSpace] = colorSpace.jsValue + object[Strings.premultipliedAlpha] = premultipliedAlpha.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift b/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift index 907ecfbc..e199bd54 100644 --- a/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift +++ b/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUImageDataLayout: BridgedDictionary { public convenience init(offset: GPUSize64, bytesPerRow: GPUSize32, rowsPerImage: GPUSize32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.offset] = offset.jsValue() - object[Strings.bytesPerRow] = bytesPerRow.jsValue() - object[Strings.rowsPerImage] = rowsPerImage.jsValue() + object[Strings.offset] = offset.jsValue + object[Strings.bytesPerRow] = bytesPerRow.jsValue + object[Strings.rowsPerImage] = rowsPerImage.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUIndexFormat.swift b/Sources/DOMKit/WebIDL/GPUIndexFormat.swift index 167f538a..63882008 100644 --- a/Sources/DOMKit/WebIDL/GPUIndexFormat.swift +++ b/Sources/DOMKit/WebIDL/GPUIndexFormat.swift @@ -18,5 +18,5 @@ public enum GPUIndexFormat: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPULoadOp.swift b/Sources/DOMKit/WebIDL/GPULoadOp.swift index 71809929..fa4b06af 100644 --- a/Sources/DOMKit/WebIDL/GPULoadOp.swift +++ b/Sources/DOMKit/WebIDL/GPULoadOp.swift @@ -18,5 +18,5 @@ public enum GPULoadOp: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift b/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift index fbf4f54b..e276db7e 100644 --- a/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift +++ b/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift @@ -18,5 +18,5 @@ public enum GPUMipmapFilterMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUMultisampleState.swift b/Sources/DOMKit/WebIDL/GPUMultisampleState.swift index 40fcbaf0..b154e531 100644 --- a/Sources/DOMKit/WebIDL/GPUMultisampleState.swift +++ b/Sources/DOMKit/WebIDL/GPUMultisampleState.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUMultisampleState: BridgedDictionary { public convenience init(count: GPUSize32, mask: GPUSampleMask, alphaToCoverageEnabled: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.count] = count.jsValue() - object[Strings.mask] = mask.jsValue() - object[Strings.alphaToCoverageEnabled] = alphaToCoverageEnabled.jsValue() + object[Strings.count] = count.jsValue + object[Strings.mask] = mask.jsValue + object[Strings.alphaToCoverageEnabled] = alphaToCoverageEnabled.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift b/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift index 2555fbeb..1966cf64 100644 --- a/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift +++ b/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUObjectDescriptorBase: BridgedDictionary { public convenience init(label: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue() + object[Strings.label] = label.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUOrigin2D.swift b/Sources/DOMKit/WebIDL/GPUOrigin2D.swift index a2df976d..1682f836 100644 --- a/Sources/DOMKit/WebIDL/GPUOrigin2D.swift +++ b/Sources/DOMKit/WebIDL/GPUOrigin2D.swift @@ -21,12 +21,12 @@ public enum GPUOrigin2D: JSValueCompatible, Any_GPUOrigin2D { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .gPUOrigin2DDict(gPUOrigin2DDict): - return gPUOrigin2DDict.jsValue() + return gPUOrigin2DDict.jsValue case let .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate): - return seq_of_GPUIntegerCoordinate.jsValue() + return seq_of_GPUIntegerCoordinate.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift b/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift index 5cbe2a05..b41e5589 100644 --- a/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift +++ b/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GPUOrigin2DDict: BridgedDictionary { public convenience init(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUOrigin3D.swift b/Sources/DOMKit/WebIDL/GPUOrigin3D.swift index f37f49c5..2875ff1b 100644 --- a/Sources/DOMKit/WebIDL/GPUOrigin3D.swift +++ b/Sources/DOMKit/WebIDL/GPUOrigin3D.swift @@ -21,12 +21,12 @@ public enum GPUOrigin3D: JSValueCompatible, Any_GPUOrigin3D { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .gPUOrigin3DDict(gPUOrigin3DDict): - return gPUOrigin3DDict.jsValue() + return gPUOrigin3DDict.jsValue case let .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate): - return seq_of_GPUIntegerCoordinate.jsValue() + return seq_of_GPUIntegerCoordinate.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift b/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift index 516a3e98..54bab6d4 100644 --- a/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift +++ b/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUOrigin3DDict: BridgedDictionary { public convenience init(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, z: GPUIntegerCoordinate) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.z] = z.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.z] = z.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUPipelineBase.swift b/Sources/DOMKit/WebIDL/GPUPipelineBase.swift index 4c79c110..b821cac5 100644 --- a/Sources/DOMKit/WebIDL/GPUPipelineBase.swift +++ b/Sources/DOMKit/WebIDL/GPUPipelineBase.swift @@ -7,6 +7,6 @@ public protocol GPUPipelineBase: JSBridgedClass {} public extension GPUPipelineBase { @inlinable func getBindGroupLayout(index: UInt32) -> GPUBindGroupLayout { let this = jsObject - return this[Strings.getBindGroupLayout].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.getBindGroupLayout].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift b/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift index a594983a..2ec32c21 100644 --- a/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift +++ b/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUPipelineDescriptorBase: BridgedDictionary { public convenience init(layout: GPUPipelineLayout) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.layout] = layout.jsValue() + object[Strings.layout] = layout.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift b/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift index ac0ac11d..d88926f5 100644 --- a/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUPipelineLayoutDescriptor: BridgedDictionary { public convenience init(bindGroupLayouts: [GPUBindGroupLayout]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bindGroupLayouts] = bindGroupLayouts.jsValue() + object[Strings.bindGroupLayouts] = bindGroupLayouts.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUPowerPreference.swift b/Sources/DOMKit/WebIDL/GPUPowerPreference.swift index 81d682a1..5797e1e4 100644 --- a/Sources/DOMKit/WebIDL/GPUPowerPreference.swift +++ b/Sources/DOMKit/WebIDL/GPUPowerPreference.swift @@ -18,5 +18,5 @@ public enum GPUPowerPreference: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift index 411d74e0..634b5de1 100644 --- a/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift +++ b/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift @@ -17,5 +17,5 @@ public enum GPUPredefinedColorSpace: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUPrimitiveState.swift b/Sources/DOMKit/WebIDL/GPUPrimitiveState.swift index dd1d92a9..ac72f98d 100644 --- a/Sources/DOMKit/WebIDL/GPUPrimitiveState.swift +++ b/Sources/DOMKit/WebIDL/GPUPrimitiveState.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class GPUPrimitiveState: BridgedDictionary { public convenience init(topology: GPUPrimitiveTopology, stripIndexFormat: GPUIndexFormat, frontFace: GPUFrontFace, cullMode: GPUCullMode, unclippedDepth: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.topology] = topology.jsValue() - object[Strings.stripIndexFormat] = stripIndexFormat.jsValue() - object[Strings.frontFace] = frontFace.jsValue() - object[Strings.cullMode] = cullMode.jsValue() - object[Strings.unclippedDepth] = unclippedDepth.jsValue() + object[Strings.topology] = topology.jsValue + object[Strings.stripIndexFormat] = stripIndexFormat.jsValue + object[Strings.frontFace] = frontFace.jsValue + object[Strings.cullMode] = cullMode.jsValue + object[Strings.unclippedDepth] = unclippedDepth.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift b/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift index 37925367..4e6497eb 100644 --- a/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift +++ b/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift @@ -21,5 +21,5 @@ public enum GPUPrimitiveTopology: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift index 59e7be08..a35fe6d6 100644 --- a/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift @@ -7,11 +7,11 @@ public protocol GPUProgrammablePassEncoder: JSBridgedClass {} public extension GPUProgrammablePassEncoder { @inlinable func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets: [GPUBufferDynamicOffset]? = nil) { let this = jsObject - _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue(), bindGroup.jsValue(), dynamicOffsets?.jsValue() ?? .undefined]) + _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue, bindGroup.jsValue, dynamicOffsets?.jsValue ?? .undefined]) } @inlinable func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32) { let this = jsObject - _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue(), bindGroup.jsValue(), dynamicOffsetsData.jsValue(), dynamicOffsetsDataStart.jsValue(), dynamicOffsetsDataLength.jsValue()]) + _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue, bindGroup.jsValue, dynamicOffsetsData.jsValue, dynamicOffsetsDataStart.jsValue, dynamicOffsetsDataLength.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift b/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift index 16bd24c3..43b61afb 100644 --- a/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift +++ b/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUProgrammableStage: BridgedDictionary { public convenience init(module: GPUShaderModule, entryPoint: String, constants: [String: GPUPipelineConstantValue]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.module] = module.jsValue() - object[Strings.entryPoint] = entryPoint.jsValue() - object[Strings.constants] = constants.jsValue() + object[Strings.module] = module.jsValue + object[Strings.entryPoint] = entryPoint.jsValue + object[Strings.constants] = constants.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift b/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift index f83ca73e..e256f15c 100644 --- a/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GPUQuerySetDescriptor: BridgedDictionary { public convenience init(type: GPUQueryType, count: GPUSize32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.count] = count.jsValue() + object[Strings.type] = type.jsValue + object[Strings.count] = count.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUQueryType.swift b/Sources/DOMKit/WebIDL/GPUQueryType.swift index ebab69cb..85b7c7b1 100644 --- a/Sources/DOMKit/WebIDL/GPUQueryType.swift +++ b/Sources/DOMKit/WebIDL/GPUQueryType.swift @@ -18,5 +18,5 @@ public enum GPUQueryType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUQueue.swift b/Sources/DOMKit/WebIDL/GPUQueue.swift index b986f302..61f76e0c 100644 --- a/Sources/DOMKit/WebIDL/GPUQueue.swift +++ b/Sources/DOMKit/WebIDL/GPUQueue.swift @@ -14,7 +14,7 @@ public class GPUQueue: JSBridgedClass, GPUObjectBase { @inlinable public func submit(commandBuffers: [GPUCommandBuffer]) { let this = jsObject - _ = this[Strings.submit].function!(this: this, arguments: [commandBuffers.jsValue()]) + _ = this[Strings.submit].function!(this: this, arguments: [commandBuffers.jsValue]) } @inlinable public func onSubmittedWorkDone() -> JSPromise { @@ -26,21 +26,21 @@ public class GPUQueue: JSBridgedClass, GPUObjectBase { @inlinable public func onSubmittedWorkDone() async throws { let this = jsObject let _promise: JSPromise = this[Strings.onSubmittedWorkDone].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: BufferSource, dataOffset: GPUSize64? = nil, size: GPUSize64? = nil) { let this = jsObject - _ = this[Strings.writeBuffer].function!(this: this, arguments: [buffer.jsValue(), bufferOffset.jsValue(), data.jsValue(), dataOffset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) + _ = this[Strings.writeBuffer].function!(this: this, arguments: [buffer.jsValue, bufferOffset.jsValue, data.jsValue, dataOffset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]) } @inlinable public func writeTexture(destination: GPUImageCopyTexture, data: BufferSource, dataLayout: GPUImageDataLayout, size: GPUExtent3D) { let this = jsObject - _ = this[Strings.writeTexture].function!(this: this, arguments: [destination.jsValue(), data.jsValue(), dataLayout.jsValue(), size.jsValue()]) + _ = this[Strings.writeTexture].function!(this: this, arguments: [destination.jsValue, data.jsValue, dataLayout.jsValue, size.jsValue]) } @inlinable public func copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: GPUExtent3D) { let this = jsObject - _ = this[Strings.copyExternalImageToTexture].function!(this: this, arguments: [source.jsValue(), destination.jsValue(), copySize.jsValue()]) + _ = this[Strings.copyExternalImageToTexture].function!(this: this, arguments: [source.jsValue, destination.jsValue, copySize.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift index aba210a9..02e292c6 100644 --- a/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift @@ -14,6 +14,6 @@ public class GPURenderBundleEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsM @inlinable public func finish(descriptor: GPURenderBundleDescriptor? = nil) -> GPURenderBundle { let this = jsObject - return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift index 18cc529c..cd8adeb2 100644 --- a/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GPURenderBundleEncoderDescriptor: BridgedDictionary { public convenience init(depthReadOnly: Bool, stencilReadOnly: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.depthReadOnly] = depthReadOnly.jsValue() - object[Strings.stencilReadOnly] = stencilReadOnly.jsValue() + object[Strings.depthReadOnly] = depthReadOnly.jsValue + object[Strings.stencilReadOnly] = stencilReadOnly.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift b/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift index 43dbc3a1..0b5b063b 100644 --- a/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift +++ b/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift @@ -7,36 +7,36 @@ public protocol GPURenderEncoderBase: JSBridgedClass {} public extension GPURenderEncoderBase { @inlinable func setPipeline(pipeline: GPURenderPipeline) { let this = jsObject - _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue()]) + _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue]) } @inlinable func setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset: GPUSize64? = nil, size: GPUSize64? = nil) { let this = jsObject - _ = this[Strings.setIndexBuffer].function!(this: this, arguments: [buffer.jsValue(), indexFormat.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) + _ = this[Strings.setIndexBuffer].function!(this: this, arguments: [buffer.jsValue, indexFormat.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]) } @inlinable func setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { let this = jsObject - _ = this[Strings.setVertexBuffer].function!(this: this, arguments: [slot.jsValue(), buffer.jsValue(), offset?.jsValue() ?? .undefined, size?.jsValue() ?? .undefined]) + _ = this[Strings.setVertexBuffer].function!(this: this, arguments: [slot.jsValue, buffer.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]) } @inlinable func draw(vertexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstVertex: GPUSize32? = nil, firstInstance: GPUSize32? = nil) { let this = jsObject - _ = this[Strings.draw].function!(this: this, arguments: [vertexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined]) + _ = this[Strings.draw].function!(this: this, arguments: [vertexCount.jsValue, instanceCount?.jsValue ?? .undefined, firstVertex?.jsValue ?? .undefined, firstInstance?.jsValue ?? .undefined]) } @inlinable func drawIndexed(indexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstIndex: GPUSize32? = nil, baseVertex: GPUSignedOffset32? = nil, firstInstance: GPUSize32? = nil) { let this = jsObject - _ = this[Strings.drawIndexed].function!(this: this, arguments: [indexCount.jsValue(), instanceCount?.jsValue() ?? .undefined, firstIndex?.jsValue() ?? .undefined, baseVertex?.jsValue() ?? .undefined, firstInstance?.jsValue() ?? .undefined]) + _ = this[Strings.drawIndexed].function!(this: this, arguments: [indexCount.jsValue, instanceCount?.jsValue ?? .undefined, firstIndex?.jsValue ?? .undefined, baseVertex?.jsValue ?? .undefined, firstInstance?.jsValue ?? .undefined]) } @inlinable func drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { let this = jsObject - _ = this[Strings.drawIndirect].function!(this: this, arguments: [indirectBuffer.jsValue(), indirectOffset.jsValue()]) + _ = this[Strings.drawIndirect].function!(this: this, arguments: [indirectBuffer.jsValue, indirectOffset.jsValue]) } @inlinable func drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { let this = jsObject - _ = this[Strings.drawIndexedIndirect].function!(this: this, arguments: [indirectBuffer.jsValue(), indirectOffset.jsValue()]) + _ = this[Strings.drawIndexedIndirect].function!(this: this, arguments: [indirectBuffer.jsValue, indirectOffset.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift b/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift index 807d1f51..a6f976ff 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class GPURenderPassColorAttachment: BridgedDictionary { public convenience init(view: GPUTextureView, resolveTarget: GPUTextureView, clearValue: GPUColor, loadOp: GPULoadOp, storeOp: GPUStoreOp) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.view] = view.jsValue() - object[Strings.resolveTarget] = resolveTarget.jsValue() - object[Strings.clearValue] = clearValue.jsValue() - object[Strings.loadOp] = loadOp.jsValue() - object[Strings.storeOp] = storeOp.jsValue() + object[Strings.view] = view.jsValue + object[Strings.resolveTarget] = resolveTarget.jsValue + object[Strings.clearValue] = clearValue.jsValue + object[Strings.loadOp] = loadOp.jsValue + object[Strings.storeOp] = storeOp.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift b/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift index 35fa1ae8..64f4a728 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class GPURenderPassDepthStencilAttachment: BridgedDictionary { public convenience init(view: GPUTextureView, depthClearValue: Float, depthLoadOp: GPULoadOp, depthStoreOp: GPUStoreOp, depthReadOnly: Bool, stencilClearValue: GPUStencilValue, stencilLoadOp: GPULoadOp, stencilStoreOp: GPUStoreOp, stencilReadOnly: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.view] = view.jsValue() - object[Strings.depthClearValue] = depthClearValue.jsValue() - object[Strings.depthLoadOp] = depthLoadOp.jsValue() - object[Strings.depthStoreOp] = depthStoreOp.jsValue() - object[Strings.depthReadOnly] = depthReadOnly.jsValue() - object[Strings.stencilClearValue] = stencilClearValue.jsValue() - object[Strings.stencilLoadOp] = stencilLoadOp.jsValue() - object[Strings.stencilStoreOp] = stencilStoreOp.jsValue() - object[Strings.stencilReadOnly] = stencilReadOnly.jsValue() + object[Strings.view] = view.jsValue + object[Strings.depthClearValue] = depthClearValue.jsValue + object[Strings.depthLoadOp] = depthLoadOp.jsValue + object[Strings.depthStoreOp] = depthStoreOp.jsValue + object[Strings.depthReadOnly] = depthReadOnly.jsValue + object[Strings.stencilClearValue] = stencilClearValue.jsValue + object[Strings.stencilLoadOp] = stencilLoadOp.jsValue + object[Strings.stencilStoreOp] = stencilStoreOp.jsValue + object[Strings.stencilReadOnly] = stencilReadOnly.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift index dbf0786d..5832093b 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class GPURenderPassDescriptor: BridgedDictionary { public convenience init(colorAttachments: [GPURenderPassColorAttachment?], depthStencilAttachment: GPURenderPassDepthStencilAttachment, occlusionQuerySet: GPUQuerySet, timestampWrites: GPURenderPassTimestampWrites) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.colorAttachments] = colorAttachments.jsValue() - object[Strings.depthStencilAttachment] = depthStencilAttachment.jsValue() - object[Strings.occlusionQuerySet] = occlusionQuerySet.jsValue() - object[Strings.timestampWrites] = timestampWrites.jsValue() + object[Strings.colorAttachments] = colorAttachments.jsValue + object[Strings.depthStencilAttachment] = depthStencilAttachment.jsValue + object[Strings.occlusionQuerySet] = occlusionQuerySet.jsValue + object[Strings.timestampWrites] = timestampWrites.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift index f217e0d4..04edcbb9 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift @@ -13,34 +13,34 @@ public class GPURenderPassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMix } @inlinable public func setViewport(x: Float, y: Float, width: Float, height: Float, minDepth: Float, maxDepth: Float) { - let _arg0 = x.jsValue() - let _arg1 = y.jsValue() - let _arg2 = width.jsValue() - let _arg3 = height.jsValue() - let _arg4 = minDepth.jsValue() - let _arg5 = maxDepth.jsValue() + let _arg0 = x.jsValue + let _arg1 = y.jsValue + let _arg2 = width.jsValue + let _arg3 = height.jsValue + let _arg4 = minDepth.jsValue + let _arg5 = maxDepth.jsValue let this = jsObject _ = this[Strings.setViewport].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } @inlinable public func setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate) { let this = jsObject - _ = this[Strings.setScissorRect].function!(this: this, arguments: [x.jsValue(), y.jsValue(), width.jsValue(), height.jsValue()]) + _ = this[Strings.setScissorRect].function!(this: this, arguments: [x.jsValue, y.jsValue, width.jsValue, height.jsValue]) } @inlinable public func setBlendConstant(color: GPUColor) { let this = jsObject - _ = this[Strings.setBlendConstant].function!(this: this, arguments: [color.jsValue()]) + _ = this[Strings.setBlendConstant].function!(this: this, arguments: [color.jsValue]) } @inlinable public func setStencilReference(reference: GPUStencilValue) { let this = jsObject - _ = this[Strings.setStencilReference].function!(this: this, arguments: [reference.jsValue()]) + _ = this[Strings.setStencilReference].function!(this: this, arguments: [reference.jsValue]) } @inlinable public func beginOcclusionQuery(queryIndex: GPUSize32) { let this = jsObject - _ = this[Strings.beginOcclusionQuery].function!(this: this, arguments: [queryIndex.jsValue()]) + _ = this[Strings.beginOcclusionQuery].function!(this: this, arguments: [queryIndex.jsValue]) } @inlinable public func endOcclusionQuery() { @@ -50,7 +50,7 @@ public class GPURenderPassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMix @inlinable public func executeBundles(bundles: [GPURenderBundle]) { let this = jsObject - _ = this[Strings.executeBundles].function!(this: this, arguments: [bundles.jsValue()]) + _ = this[Strings.executeBundles].function!(this: this, arguments: [bundles.jsValue]) } @inlinable public func end() { diff --git a/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift b/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift index 132b3a1b..0f3f4fa2 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPURenderPassLayout: BridgedDictionary { public convenience init(colorFormats: [GPUTextureFormat?], depthStencilFormat: GPUTextureFormat, sampleCount: GPUSize32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.colorFormats] = colorFormats.jsValue() - object[Strings.depthStencilFormat] = depthStencilFormat.jsValue() - object[Strings.sampleCount] = sampleCount.jsValue() + object[Strings.colorFormats] = colorFormats.jsValue + object[Strings.depthStencilFormat] = depthStencilFormat.jsValue + object[Strings.sampleCount] = sampleCount.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift b/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift index 7b87559d..e8a6183f 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift @@ -18,5 +18,5 @@ public enum GPURenderPassTimestampLocation: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift b/Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift index 3f07b5f1..e9ce8fc9 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPURenderPassTimestampWrite: BridgedDictionary { public convenience init(querySet: GPUQuerySet, queryIndex: GPUSize32, location: GPURenderPassTimestampLocation) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.querySet] = querySet.jsValue() - object[Strings.queryIndex] = queryIndex.jsValue() - object[Strings.location] = location.jsValue() + object[Strings.querySet] = querySet.jsValue + object[Strings.queryIndex] = queryIndex.jsValue + object[Strings.location] = location.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift index eb76d6ec..47c992ef 100644 --- a/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class GPURenderPipelineDescriptor: BridgedDictionary { public convenience init(vertex: GPUVertexState, primitive: GPUPrimitiveState, depthStencil: GPUDepthStencilState, multisample: GPUMultisampleState, fragment: GPUFragmentState) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.vertex] = vertex.jsValue() - object[Strings.primitive] = primitive.jsValue() - object[Strings.depthStencil] = depthStencil.jsValue() - object[Strings.multisample] = multisample.jsValue() - object[Strings.fragment] = fragment.jsValue() + object[Strings.vertex] = vertex.jsValue + object[Strings.primitive] = primitive.jsValue + object[Strings.depthStencil] = depthStencil.jsValue + object[Strings.multisample] = multisample.jsValue + object[Strings.fragment] = fragment.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift b/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift index c8b5be34..555c458e 100644 --- a/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift +++ b/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GPURequestAdapterOptions: BridgedDictionary { public convenience init(powerPreference: GPUPowerPreference, forceFallbackAdapter: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.powerPreference] = powerPreference.jsValue() - object[Strings.forceFallbackAdapter] = forceFallbackAdapter.jsValue() + object[Strings.powerPreference] = powerPreference.jsValue + object[Strings.forceFallbackAdapter] = forceFallbackAdapter.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift index 5f0407a0..7d99c4f8 100644 --- a/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift +++ b/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUSamplerBindingLayout: BridgedDictionary { public convenience init(type: GPUSamplerBindingType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() + object[Strings.type] = type.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift b/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift index a259534e..792ca590 100644 --- a/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift +++ b/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift @@ -19,5 +19,5 @@ public enum GPUSamplerBindingType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift b/Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift index 2e458264..1ac98ca6 100644 --- a/Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift @@ -6,16 +6,16 @@ import JavaScriptKit public class GPUSamplerDescriptor: BridgedDictionary { public convenience init(addressModeU: GPUAddressMode, addressModeV: GPUAddressMode, addressModeW: GPUAddressMode, magFilter: GPUFilterMode, minFilter: GPUFilterMode, mipmapFilter: GPUMipmapFilterMode, lodMinClamp: Float, lodMaxClamp: Float, compare: GPUCompareFunction, maxAnisotropy: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.addressModeU] = addressModeU.jsValue() - object[Strings.addressModeV] = addressModeV.jsValue() - object[Strings.addressModeW] = addressModeW.jsValue() - object[Strings.magFilter] = magFilter.jsValue() - object[Strings.minFilter] = minFilter.jsValue() - object[Strings.mipmapFilter] = mipmapFilter.jsValue() - object[Strings.lodMinClamp] = lodMinClamp.jsValue() - object[Strings.lodMaxClamp] = lodMaxClamp.jsValue() - object[Strings.compare] = compare.jsValue() - object[Strings.maxAnisotropy] = maxAnisotropy.jsValue() + object[Strings.addressModeU] = addressModeU.jsValue + object[Strings.addressModeV] = addressModeV.jsValue + object[Strings.addressModeW] = addressModeW.jsValue + object[Strings.magFilter] = magFilter.jsValue + object[Strings.minFilter] = minFilter.jsValue + object[Strings.mipmapFilter] = mipmapFilter.jsValue + object[Strings.lodMinClamp] = lodMinClamp.jsValue + object[Strings.lodMaxClamp] = lodMaxClamp.jsValue + object[Strings.compare] = compare.jsValue + object[Strings.maxAnisotropy] = maxAnisotropy.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUShaderModule.swift b/Sources/DOMKit/WebIDL/GPUShaderModule.swift index 9819db15..6188cc29 100644 --- a/Sources/DOMKit/WebIDL/GPUShaderModule.swift +++ b/Sources/DOMKit/WebIDL/GPUShaderModule.swift @@ -21,6 +21,6 @@ public class GPUShaderModule: JSBridgedClass, GPUObjectBase { @inlinable public func compilationInfo() async throws -> GPUCompilationInfo { let this = jsObject let _promise: JSPromise = this[Strings.compilationInfo].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift b/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift index 54ff6121..04cb55f5 100644 --- a/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift +++ b/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUShaderModuleCompilationHint: BridgedDictionary { public convenience init(layout: GPUPipelineLayout) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.layout] = layout.jsValue() + object[Strings.layout] = layout.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift b/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift index 1d1a36fe..c9bedabd 100644 --- a/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUShaderModuleDescriptor: BridgedDictionary { public convenience init(code: String, sourceMap: JSObject, hints: [String: GPUShaderModuleCompilationHint]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.code] = code.jsValue() - object[Strings.sourceMap] = sourceMap.jsValue() - object[Strings.hints] = hints.jsValue() + object[Strings.code] = code.jsValue + object[Strings.sourceMap] = sourceMap.jsValue + object[Strings.hints] = hints.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift b/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift index ab3d6ff6..14753603 100644 --- a/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift +++ b/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class GPUStencilFaceState: BridgedDictionary { public convenience init(compare: GPUCompareFunction, failOp: GPUStencilOperation, depthFailOp: GPUStencilOperation, passOp: GPUStencilOperation) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.compare] = compare.jsValue() - object[Strings.failOp] = failOp.jsValue() - object[Strings.depthFailOp] = depthFailOp.jsValue() - object[Strings.passOp] = passOp.jsValue() + object[Strings.compare] = compare.jsValue + object[Strings.failOp] = failOp.jsValue + object[Strings.depthFailOp] = depthFailOp.jsValue + object[Strings.passOp] = passOp.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUStencilOperation.swift b/Sources/DOMKit/WebIDL/GPUStencilOperation.swift index 0c834ec5..66d47101 100644 --- a/Sources/DOMKit/WebIDL/GPUStencilOperation.swift +++ b/Sources/DOMKit/WebIDL/GPUStencilOperation.swift @@ -24,5 +24,5 @@ public enum GPUStencilOperation: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift b/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift index 989176b6..6c09dc16 100644 --- a/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift +++ b/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift @@ -17,5 +17,5 @@ public enum GPUStorageTextureAccess: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift index 3bb5a9d6..d22eca7e 100644 --- a/Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift +++ b/Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUStorageTextureBindingLayout: BridgedDictionary { public convenience init(access: GPUStorageTextureAccess, format: GPUTextureFormat, viewDimension: GPUTextureViewDimension) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.access] = access.jsValue() - object[Strings.format] = format.jsValue() - object[Strings.viewDimension] = viewDimension.jsValue() + object[Strings.access] = access.jsValue + object[Strings.format] = format.jsValue + object[Strings.viewDimension] = viewDimension.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUStoreOp.swift b/Sources/DOMKit/WebIDL/GPUStoreOp.swift index faff8cd9..ca3b0e76 100644 --- a/Sources/DOMKit/WebIDL/GPUStoreOp.swift +++ b/Sources/DOMKit/WebIDL/GPUStoreOp.swift @@ -18,5 +18,5 @@ public enum GPUStoreOp: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUTexture.swift b/Sources/DOMKit/WebIDL/GPUTexture.swift index 521c9f8f..eb7bf3c1 100644 --- a/Sources/DOMKit/WebIDL/GPUTexture.swift +++ b/Sources/DOMKit/WebIDL/GPUTexture.swift @@ -14,7 +14,7 @@ public class GPUTexture: JSBridgedClass, GPUObjectBase { @inlinable public func createView(descriptor: GPUTextureViewDescriptor? = nil) -> GPUTextureView { let this = jsObject - return this[Strings.createView].function!(this: this, arguments: [descriptor?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createView].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func destroy() { diff --git a/Sources/DOMKit/WebIDL/GPUTextureAspect.swift b/Sources/DOMKit/WebIDL/GPUTextureAspect.swift index 58e63114..b6508288 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureAspect.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureAspect.swift @@ -19,5 +19,5 @@ public enum GPUTextureAspect: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift index 7cfaa9e7..d5215e81 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUTextureBindingLayout: BridgedDictionary { public convenience init(sampleType: GPUTextureSampleType, viewDimension: GPUTextureViewDimension, multisampled: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sampleType] = sampleType.jsValue() - object[Strings.viewDimension] = viewDimension.jsValue() - object[Strings.multisampled] = multisampled.jsValue() + object[Strings.sampleType] = sampleType.jsValue + object[Strings.viewDimension] = viewDimension.jsValue + object[Strings.multisampled] = multisampled.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift b/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift index 939e3305..2c44a3a8 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class GPUTextureDescriptor: BridgedDictionary { public convenience init(size: GPUExtent3D, mipLevelCount: GPUIntegerCoordinate, sampleCount: GPUSize32, dimension: GPUTextureDimension, format: GPUTextureFormat, usage: GPUTextureUsageFlags, viewFormats: [GPUTextureFormat]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.size] = size.jsValue() - object[Strings.mipLevelCount] = mipLevelCount.jsValue() - object[Strings.sampleCount] = sampleCount.jsValue() - object[Strings.dimension] = dimension.jsValue() - object[Strings.format] = format.jsValue() - object[Strings.usage] = usage.jsValue() - object[Strings.viewFormats] = viewFormats.jsValue() + object[Strings.size] = size.jsValue + object[Strings.mipLevelCount] = mipLevelCount.jsValue + object[Strings.sampleCount] = sampleCount.jsValue + object[Strings.dimension] = dimension.jsValue + object[Strings.format] = format.jsValue + object[Strings.usage] = usage.jsValue + object[Strings.viewFormats] = viewFormats.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUTextureDimension.swift b/Sources/DOMKit/WebIDL/GPUTextureDimension.swift index cc56a978..6403241a 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureDimension.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureDimension.swift @@ -19,5 +19,5 @@ public enum GPUTextureDimension: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUTextureFormat.swift b/Sources/DOMKit/WebIDL/GPUTextureFormat.swift index 14737992..93b01280 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureFormat.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureFormat.swift @@ -111,5 +111,5 @@ public enum GPUTextureFormat: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift b/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift index 4f7dd59d..23842f06 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift @@ -21,5 +21,5 @@ public enum GPUTextureSampleType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift b/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift index 9d2fb44e..cf80ad5a 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class GPUTextureViewDescriptor: BridgedDictionary { public convenience init(format: GPUTextureFormat, dimension: GPUTextureViewDimension, aspect: GPUTextureAspect, baseMipLevel: GPUIntegerCoordinate, mipLevelCount: GPUIntegerCoordinate, baseArrayLayer: GPUIntegerCoordinate, arrayLayerCount: GPUIntegerCoordinate) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue() - object[Strings.dimension] = dimension.jsValue() - object[Strings.aspect] = aspect.jsValue() - object[Strings.baseMipLevel] = baseMipLevel.jsValue() - object[Strings.mipLevelCount] = mipLevelCount.jsValue() - object[Strings.baseArrayLayer] = baseArrayLayer.jsValue() - object[Strings.arrayLayerCount] = arrayLayerCount.jsValue() + object[Strings.format] = format.jsValue + object[Strings.dimension] = dimension.jsValue + object[Strings.aspect] = aspect.jsValue + object[Strings.baseMipLevel] = baseMipLevel.jsValue + object[Strings.mipLevelCount] = mipLevelCount.jsValue + object[Strings.baseArrayLayer] = baseArrayLayer.jsValue + object[Strings.arrayLayerCount] = arrayLayerCount.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift b/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift index 99f69dc6..89564fde 100644 --- a/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift +++ b/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift @@ -22,5 +22,5 @@ public enum GPUTextureViewDimension: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift index ac8c9666..1c892981 100644 --- a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift @@ -12,7 +12,7 @@ public class GPUUncapturedErrorEvent: Event { } @inlinable public convenience init(type: String, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), gpuUncapturedErrorEventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, gpuUncapturedErrorEventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift index f5c68732..6b9fbf98 100644 --- a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUUncapturedErrorEventInit: BridgedDictionary { public convenience init(error: GPUError) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue() + object[Strings.error] = error.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUValidationError.swift b/Sources/DOMKit/WebIDL/GPUValidationError.swift index 8bcb1969..c63d6674 100644 --- a/Sources/DOMKit/WebIDL/GPUValidationError.swift +++ b/Sources/DOMKit/WebIDL/GPUValidationError.swift @@ -14,7 +14,7 @@ public class GPUValidationError: JSBridgedClass { } @inlinable public convenience init(message: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [message.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [message.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift b/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift index 81828266..8ffada73 100644 --- a/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift +++ b/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUVertexAttribute: BridgedDictionary { public convenience init(format: GPUVertexFormat, offset: GPUSize64, shaderLocation: GPUIndex32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue() - object[Strings.offset] = offset.jsValue() - object[Strings.shaderLocation] = shaderLocation.jsValue() + object[Strings.format] = format.jsValue + object[Strings.offset] = offset.jsValue + object[Strings.shaderLocation] = shaderLocation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift b/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift index 9140b21e..c604561b 100644 --- a/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift +++ b/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GPUVertexBufferLayout: BridgedDictionary { public convenience init(arrayStride: GPUSize64, stepMode: GPUVertexStepMode, attributes: [GPUVertexAttribute]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.arrayStride] = arrayStride.jsValue() - object[Strings.stepMode] = stepMode.jsValue() - object[Strings.attributes] = attributes.jsValue() + object[Strings.arrayStride] = arrayStride.jsValue + object[Strings.stepMode] = stepMode.jsValue + object[Strings.attributes] = attributes.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUVertexFormat.swift b/Sources/DOMKit/WebIDL/GPUVertexFormat.swift index 09bfe333..16795f3b 100644 --- a/Sources/DOMKit/WebIDL/GPUVertexFormat.swift +++ b/Sources/DOMKit/WebIDL/GPUVertexFormat.swift @@ -46,5 +46,5 @@ public enum GPUVertexFormat: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GPUVertexState.swift b/Sources/DOMKit/WebIDL/GPUVertexState.swift index d01fbd2a..02c4ae77 100644 --- a/Sources/DOMKit/WebIDL/GPUVertexState.swift +++ b/Sources/DOMKit/WebIDL/GPUVertexState.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GPUVertexState: BridgedDictionary { public convenience init(buffers: [GPUVertexBufferLayout?]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffers] = buffers.jsValue() + object[Strings.buffers] = buffers.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift b/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift index 19132f65..f7661944 100644 --- a/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift +++ b/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift @@ -18,5 +18,5 @@ public enum GPUVertexStepMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GainNode.swift b/Sources/DOMKit/WebIDL/GainNode.swift index 577a35cd..208fe704 100644 --- a/Sources/DOMKit/WebIDL/GainNode.swift +++ b/Sources/DOMKit/WebIDL/GainNode.swift @@ -12,7 +12,7 @@ public class GainNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: GainOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GainOptions.swift b/Sources/DOMKit/WebIDL/GainOptions.swift index 60f70b26..8b1cae58 100644 --- a/Sources/DOMKit/WebIDL/GainOptions.swift +++ b/Sources/DOMKit/WebIDL/GainOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GainOptions: BridgedDictionary { public convenience init(gain: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.gain] = gain.jsValue() + object[Strings.gain] = gain.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GamepadEvent.swift b/Sources/DOMKit/WebIDL/GamepadEvent.swift index 60632c36..4aa1c65f 100644 --- a/Sources/DOMKit/WebIDL/GamepadEvent.swift +++ b/Sources/DOMKit/WebIDL/GamepadEvent.swift @@ -12,7 +12,7 @@ public class GamepadEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: GamepadEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GamepadEventInit.swift b/Sources/DOMKit/WebIDL/GamepadEventInit.swift index fb8a1e53..c7eca7cf 100644 --- a/Sources/DOMKit/WebIDL/GamepadEventInit.swift +++ b/Sources/DOMKit/WebIDL/GamepadEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GamepadEventInit: BridgedDictionary { public convenience init(gamepad: Gamepad) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.gamepad] = gamepad.jsValue() + object[Strings.gamepad] = gamepad.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GamepadHand.swift b/Sources/DOMKit/WebIDL/GamepadHand.swift index e76a6206..234491dc 100644 --- a/Sources/DOMKit/WebIDL/GamepadHand.swift +++ b/Sources/DOMKit/WebIDL/GamepadHand.swift @@ -19,5 +19,5 @@ public enum GamepadHand: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift b/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift index 4a07cf10..73a65fd3 100644 --- a/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift +++ b/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift @@ -18,13 +18,13 @@ public class GamepadHapticActuator: JSBridgedClass { @inlinable public func pulse(value: Double, duration: Double) -> JSPromise { let this = jsObject - return this[Strings.pulse].function!(this: this, arguments: [value.jsValue(), duration.jsValue()]).fromJSValue()! + return this[Strings.pulse].function!(this: this, arguments: [value.jsValue, duration.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func pulse(value: Double, duration: Double) async throws -> Bool { let this = jsObject - let _promise: JSPromise = this[Strings.pulse].function!(this: this, arguments: [value.jsValue(), duration.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.pulse].function!(this: this, arguments: [value.jsValue, duration.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift b/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift index 4fd1f112..070dd2c8 100644 --- a/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift +++ b/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift @@ -17,5 +17,5 @@ public enum GamepadHapticActuatorType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GamepadMappingType.swift b/Sources/DOMKit/WebIDL/GamepadMappingType.swift index b8cd47d8..693d1c9e 100644 --- a/Sources/DOMKit/WebIDL/GamepadMappingType.swift +++ b/Sources/DOMKit/WebIDL/GamepadMappingType.swift @@ -19,5 +19,5 @@ public enum GamepadMappingType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift b/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift index 3d68f426..7f810f85 100644 --- a/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift +++ b/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GenerateTestReportParameters: BridgedDictionary { public convenience init(message: String, group: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.message] = message.jsValue() - object[Strings.group] = group.jsValue() + object[Strings.message] = message.jsValue + object[Strings.group] = group.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Geolocation.swift b/Sources/DOMKit/WebIDL/Geolocation.swift index 02c66e09..d6cc1f89 100644 --- a/Sources/DOMKit/WebIDL/Geolocation.swift +++ b/Sources/DOMKit/WebIDL/Geolocation.swift @@ -18,6 +18,6 @@ public class Geolocation: JSBridgedClass { @inlinable public func clearWatch(watchId: Int32) { let this = jsObject - _ = this[Strings.clearWatch].function!(this: this, arguments: [watchId.jsValue()]) + _ = this[Strings.clearWatch].function!(this: this, arguments: [watchId.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift b/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift index ffea39de..f11a9a03 100644 --- a/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift +++ b/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class GeolocationReadingValues: BridgedDictionary { public convenience init(latitude: Double?, longitude: Double?, altitude: Double?, accuracy: Double?, altitudeAccuracy: Double?, heading: Double?, speed: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.latitude] = latitude.jsValue() - object[Strings.longitude] = longitude.jsValue() - object[Strings.altitude] = altitude.jsValue() - object[Strings.accuracy] = accuracy.jsValue() - object[Strings.altitudeAccuracy] = altitudeAccuracy.jsValue() - object[Strings.heading] = heading.jsValue() - object[Strings.speed] = speed.jsValue() + object[Strings.latitude] = latitude.jsValue + object[Strings.longitude] = longitude.jsValue + object[Strings.altitude] = altitude.jsValue + object[Strings.accuracy] = accuracy.jsValue + object[Strings.altitudeAccuracy] = altitudeAccuracy.jsValue + object[Strings.heading] = heading.jsValue + object[Strings.speed] = speed.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GeolocationSensor.swift b/Sources/DOMKit/WebIDL/GeolocationSensor.swift index b1739770..7631ed93 100644 --- a/Sources/DOMKit/WebIDL/GeolocationSensor.swift +++ b/Sources/DOMKit/WebIDL/GeolocationSensor.swift @@ -18,19 +18,19 @@ public class GeolocationSensor: Sensor { } @inlinable public convenience init(options: GeolocationSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @inlinable public static func read(readOptions: ReadOptions? = nil) -> JSPromise { let this = constructor - return this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func read(readOptions: ReadOptions? = nil) async throws -> GeolocationSensorReading { let this = constructor - let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift b/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift index 7997d50a..70afa885 100644 --- a/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift +++ b/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift @@ -6,14 +6,14 @@ import JavaScriptKit public class GeolocationSensorReading: BridgedDictionary { public convenience init(timestamp: DOMHighResTimeStamp?, latitude: Double?, longitude: Double?, altitude: Double?, accuracy: Double?, altitudeAccuracy: Double?, heading: Double?, speed: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue() - object[Strings.latitude] = latitude.jsValue() - object[Strings.longitude] = longitude.jsValue() - object[Strings.altitude] = altitude.jsValue() - object[Strings.accuracy] = accuracy.jsValue() - object[Strings.altitudeAccuracy] = altitudeAccuracy.jsValue() - object[Strings.heading] = heading.jsValue() - object[Strings.speed] = speed.jsValue() + object[Strings.timestamp] = timestamp.jsValue + object[Strings.latitude] = latitude.jsValue + object[Strings.longitude] = longitude.jsValue + object[Strings.altitude] = altitude.jsValue + object[Strings.accuracy] = accuracy.jsValue + object[Strings.altitudeAccuracy] = altitudeAccuracy.jsValue + object[Strings.heading] = heading.jsValue + object[Strings.speed] = speed.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GeometryNode.swift b/Sources/DOMKit/WebIDL/GeometryNode.swift index dca84f09..d6e19941 100644 --- a/Sources/DOMKit/WebIDL/GeometryNode.swift +++ b/Sources/DOMKit/WebIDL/GeometryNode.swift @@ -31,16 +31,16 @@ public enum GeometryNode: JSValueCompatible, Any_GeometryNode { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .cSSPseudoElement(cSSPseudoElement): - return cSSPseudoElement.jsValue() + return cSSPseudoElement.jsValue case let .document(document): - return document.jsValue() + return document.jsValue case let .element(element): - return element.jsValue() + return element.jsValue case let .text(text): - return text.jsValue() + return text.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/GeometryUtils.swift b/Sources/DOMKit/WebIDL/GeometryUtils.swift index 5daabbf4..15114de3 100644 --- a/Sources/DOMKit/WebIDL/GeometryUtils.swift +++ b/Sources/DOMKit/WebIDL/GeometryUtils.swift @@ -7,21 +7,21 @@ public protocol GeometryUtils: JSBridgedClass {} public extension GeometryUtils { @inlinable func getBoxQuads(options: BoxQuadOptions? = nil) -> [DOMQuad] { let this = jsObject - return this[Strings.getBoxQuads].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getBoxQuads].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable func convertQuadFromNode(quad: DOMQuadInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { let this = jsObject - return this[Strings.convertQuadFromNode].function!(this: this, arguments: [quad.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.convertQuadFromNode].function!(this: this, arguments: [quad.jsValue, from.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable func convertRectFromNode(rect: DOMRectReadOnly, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { let this = jsObject - return this[Strings.convertRectFromNode].function!(this: this, arguments: [rect.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.convertRectFromNode].function!(this: this, arguments: [rect.jsValue, from.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable func convertPointFromNode(point: DOMPointInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMPoint { let this = jsObject - return this[Strings.convertPointFromNode].function!(this: this, arguments: [point.jsValue(), from.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.convertPointFromNode].function!(this: this, arguments: [point.jsValue, from.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/GetAnimationsOptions.swift b/Sources/DOMKit/WebIDL/GetAnimationsOptions.swift index 8672eb33..7acb68cd 100644 --- a/Sources/DOMKit/WebIDL/GetAnimationsOptions.swift +++ b/Sources/DOMKit/WebIDL/GetAnimationsOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GetAnimationsOptions: BridgedDictionary { public convenience init(subtree: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.subtree] = subtree.jsValue() + object[Strings.subtree] = subtree.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GetNotificationOptions.swift b/Sources/DOMKit/WebIDL/GetNotificationOptions.swift index fed00471..e6aafdf3 100644 --- a/Sources/DOMKit/WebIDL/GetNotificationOptions.swift +++ b/Sources/DOMKit/WebIDL/GetNotificationOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GetNotificationOptions: BridgedDictionary { public convenience init(tag: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.tag] = tag.jsValue() + object[Strings.tag] = tag.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift index e64c55b0..642eaae9 100644 --- a/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift +++ b/Sources/DOMKit/WebIDL/GetRootNodeOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GetRootNodeOptions: BridgedDictionary { public convenience init(composed: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.composed] = composed.jsValue() + object[Strings.composed] = composed.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Global.swift b/Sources/DOMKit/WebIDL/Global.swift index 51f209e8..5f9b9c80 100644 --- a/Sources/DOMKit/WebIDL/Global.swift +++ b/Sources/DOMKit/WebIDL/Global.swift @@ -14,7 +14,7 @@ public class Global: JSBridgedClass { } @inlinable public convenience init(descriptor: GlobalDescriptor, v: JSValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue(), v?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue, v?.jsValue ?? .undefined])) } @inlinable public func valueOf() -> JSValue { diff --git a/Sources/DOMKit/WebIDL/GlobalDescriptor.swift b/Sources/DOMKit/WebIDL/GlobalDescriptor.swift index a0fa578f..e28a77ad 100644 --- a/Sources/DOMKit/WebIDL/GlobalDescriptor.swift +++ b/Sources/DOMKit/WebIDL/GlobalDescriptor.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class GlobalDescriptor: BridgedDictionary { public convenience init(value: ValueType, mutable: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.value] = value.jsValue() - object[Strings.mutable] = mutable.jsValue() + object[Strings.value] = value.jsValue + object[Strings.mutable] = mutable.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GravitySensor.swift b/Sources/DOMKit/WebIDL/GravitySensor.swift index 65b0c163..9001b94b 100644 --- a/Sources/DOMKit/WebIDL/GravitySensor.swift +++ b/Sources/DOMKit/WebIDL/GravitySensor.swift @@ -11,6 +11,6 @@ public class GravitySensor: Accelerometer { } @inlinable public convenience init(options: AccelerometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/GroupEffect.swift b/Sources/DOMKit/WebIDL/GroupEffect.swift index 8d3a05b7..572aed39 100644 --- a/Sources/DOMKit/WebIDL/GroupEffect.swift +++ b/Sources/DOMKit/WebIDL/GroupEffect.swift @@ -16,7 +16,7 @@ public class GroupEffect: JSBridgedClass { } @inlinable public convenience init(children: [AnimationEffect]?, timing: Double_or_EffectTiming? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue(), timing?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue, timing?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -35,11 +35,11 @@ public class GroupEffect: JSBridgedClass { @inlinable public func prepend(effects: AnimationEffect...) { let this = jsObject - _ = this[Strings.prepend].function!(this: this, arguments: effects.map { $0.jsValue() }) + _ = this[Strings.prepend].function!(this: this, arguments: effects.map(\.jsValue)) } @inlinable public func append(effects: AnimationEffect...) { let this = jsObject - _ = this[Strings.append].function!(this: this, arguments: effects.map { $0.jsValue() }) + _ = this[Strings.append].function!(this: this, arguments: effects.map(\.jsValue)) } } diff --git a/Sources/DOMKit/WebIDL/Gyroscope.swift b/Sources/DOMKit/WebIDL/Gyroscope.swift index 57a07195..61aefc8c 100644 --- a/Sources/DOMKit/WebIDL/Gyroscope.swift +++ b/Sources/DOMKit/WebIDL/Gyroscope.swift @@ -14,7 +14,7 @@ public class Gyroscope: Sensor { } @inlinable public convenience init(sensorOptions: GyroscopeSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift index 129f623f..ec3d03a8 100644 --- a/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift +++ b/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift @@ -18,5 +18,5 @@ public enum GyroscopeLocalCoordinateSystem: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift b/Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift index 5d5a9634..a990ad4e 100644 --- a/Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift +++ b/Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class GyroscopeReadingValues: BridgedDictionary { public convenience init(x: Double?, y: Double?, z: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.z] = z.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.z] = z.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift b/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift index e7043e0b..2f5f5971 100644 --- a/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift +++ b/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class GyroscopeSensorOptions: BridgedDictionary { public convenience init(referenceFrame: GyroscopeLocalCoordinateSystem) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceFrame] = referenceFrame.jsValue() + object[Strings.referenceFrame] = referenceFrame.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HID.swift b/Sources/DOMKit/WebIDL/HID.swift index c4ccc991..0bdae77a 100644 --- a/Sources/DOMKit/WebIDL/HID.swift +++ b/Sources/DOMKit/WebIDL/HID.swift @@ -27,18 +27,18 @@ public class HID: EventTarget { @inlinable public func getDevices() async throws -> [HIDDevice] { let this = jsObject let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func requestDevice(options: HIDDeviceRequestOptions) -> JSPromise { let this = jsObject - return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! + return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestDevice(options: HIDDeviceRequestOptions) async throws -> [HIDDevice] { let this = jsObject - let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift b/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift index 0bfc4f27..4133627c 100644 --- a/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift +++ b/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class HIDCollectionInfo: BridgedDictionary { public convenience init(usagePage: UInt16, usage: UInt16, type: UInt8, children: [HIDCollectionInfo], inputReports: [HIDReportInfo], outputReports: [HIDReportInfo], featureReports: [HIDReportInfo]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usagePage] = usagePage.jsValue() - object[Strings.usage] = usage.jsValue() - object[Strings.type] = type.jsValue() - object[Strings.children] = children.jsValue() - object[Strings.inputReports] = inputReports.jsValue() - object[Strings.outputReports] = outputReports.jsValue() - object[Strings.featureReports] = featureReports.jsValue() + object[Strings.usagePage] = usagePage.jsValue + object[Strings.usage] = usage.jsValue + object[Strings.type] = type.jsValue + object[Strings.children] = children.jsValue + object[Strings.inputReports] = inputReports.jsValue + object[Strings.outputReports] = outputReports.jsValue + object[Strings.featureReports] = featureReports.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift b/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift index 70a761ba..8f275214 100644 --- a/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift +++ b/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift @@ -12,7 +12,7 @@ public class HIDConnectionEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: HIDConnectionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift b/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift index 84f03e3f..1fe446a5 100644 --- a/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift +++ b/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class HIDConnectionEventInit: BridgedDictionary { public convenience init(device: HIDDevice) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue() + object[Strings.device] = device.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HIDDevice.swift b/Sources/DOMKit/WebIDL/HIDDevice.swift index dd97f803..b4c36089 100644 --- a/Sources/DOMKit/WebIDL/HIDDevice.swift +++ b/Sources/DOMKit/WebIDL/HIDDevice.swift @@ -43,7 +43,7 @@ public class HIDDevice: EventTarget { @inlinable public func open() async throws { let this = jsObject let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func close() -> JSPromise { @@ -55,7 +55,7 @@ public class HIDDevice: EventTarget { @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func forget() -> JSPromise { @@ -67,42 +67,42 @@ public class HIDDevice: EventTarget { @inlinable public func forget() async throws { let this = jsObject let _promise: JSPromise = this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func sendReport(reportId: UInt8, data: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! + return this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue, data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func sendReport(reportId: UInt8, data: BufferSource) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue, data.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func sendFeatureReport(reportId: UInt8, data: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! + return this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue, data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func sendFeatureReport(reportId: UInt8, data: BufferSource) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue(), data.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue, data.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func receiveFeatureReport(reportId: UInt8) -> JSPromise { let this = jsObject - return this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue()]).fromJSValue()! + return this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func receiveFeatureReport(reportId: UInt8) async throws -> DataView { let this = jsObject - let _promise: JSPromise = this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift b/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift index 9a38e4f0..c4ebeb6f 100644 --- a/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift +++ b/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class HIDDeviceFilter: BridgedDictionary { public convenience init(vendorId: UInt32, productId: UInt16, usagePage: UInt16, usage: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.vendorId] = vendorId.jsValue() - object[Strings.productId] = productId.jsValue() - object[Strings.usagePage] = usagePage.jsValue() - object[Strings.usage] = usage.jsValue() + object[Strings.vendorId] = vendorId.jsValue + object[Strings.productId] = productId.jsValue + object[Strings.usagePage] = usagePage.jsValue + object[Strings.usage] = usage.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift b/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift index 6a06cc05..f9a6b80e 100644 --- a/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift +++ b/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class HIDDeviceRequestOptions: BridgedDictionary { public convenience init(filters: [HIDDeviceFilter]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue() + object[Strings.filters] = filters.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift b/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift index bc72c45f..96da0a55 100644 --- a/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift +++ b/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift @@ -14,7 +14,7 @@ public class HIDInputReportEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: HIDInputReportEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift b/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift index 4d7d9b8e..57aeb14f 100644 --- a/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift +++ b/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class HIDInputReportEventInit: BridgedDictionary { public convenience init(device: HIDDevice, reportId: UInt8, data: DataView) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue() - object[Strings.reportId] = reportId.jsValue() - object[Strings.data] = data.jsValue() + object[Strings.device] = device.jsValue + object[Strings.reportId] = reportId.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HIDReportInfo.swift b/Sources/DOMKit/WebIDL/HIDReportInfo.swift index 47154280..09d048f7 100644 --- a/Sources/DOMKit/WebIDL/HIDReportInfo.swift +++ b/Sources/DOMKit/WebIDL/HIDReportInfo.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class HIDReportInfo: BridgedDictionary { public convenience init(reportId: UInt8, items: [HIDReportItem]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.reportId] = reportId.jsValue() - object[Strings.items] = items.jsValue() + object[Strings.reportId] = reportId.jsValue + object[Strings.items] = items.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HIDReportItem.swift b/Sources/DOMKit/WebIDL/HIDReportItem.swift index aa0808d7..1fe61d6a 100644 --- a/Sources/DOMKit/WebIDL/HIDReportItem.swift +++ b/Sources/DOMKit/WebIDL/HIDReportItem.swift @@ -6,34 +6,34 @@ import JavaScriptKit public class HIDReportItem: BridgedDictionary { public convenience init(isAbsolute: Bool, isArray: Bool, isBufferedBytes: Bool, isConstant: Bool, isLinear: Bool, isRange: Bool, isVolatile: Bool, hasNull: Bool, hasPreferredState: Bool, wrap: Bool, usages: [UInt32], usageMinimum: UInt32, usageMaximum: UInt32, reportSize: UInt16, reportCount: UInt16, unitExponent: Int8, unitSystem: HIDUnitSystem, unitFactorLengthExponent: Int8, unitFactorMassExponent: Int8, unitFactorTimeExponent: Int8, unitFactorTemperatureExponent: Int8, unitFactorCurrentExponent: Int8, unitFactorLuminousIntensityExponent: Int8, logicalMinimum: Int32, logicalMaximum: Int32, physicalMinimum: Int32, physicalMaximum: Int32, strings: [String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.isAbsolute] = isAbsolute.jsValue() - object[Strings.isArray] = isArray.jsValue() - object[Strings.isBufferedBytes] = isBufferedBytes.jsValue() - object[Strings.isConstant] = isConstant.jsValue() - object[Strings.isLinear] = isLinear.jsValue() - object[Strings.isRange] = isRange.jsValue() - object[Strings.isVolatile] = isVolatile.jsValue() - object[Strings.hasNull] = hasNull.jsValue() - object[Strings.hasPreferredState] = hasPreferredState.jsValue() - object[Strings.wrap] = wrap.jsValue() - object[Strings.usages] = usages.jsValue() - object[Strings.usageMinimum] = usageMinimum.jsValue() - object[Strings.usageMaximum] = usageMaximum.jsValue() - object[Strings.reportSize] = reportSize.jsValue() - object[Strings.reportCount] = reportCount.jsValue() - object[Strings.unitExponent] = unitExponent.jsValue() - object[Strings.unitSystem] = unitSystem.jsValue() - object[Strings.unitFactorLengthExponent] = unitFactorLengthExponent.jsValue() - object[Strings.unitFactorMassExponent] = unitFactorMassExponent.jsValue() - object[Strings.unitFactorTimeExponent] = unitFactorTimeExponent.jsValue() - object[Strings.unitFactorTemperatureExponent] = unitFactorTemperatureExponent.jsValue() - object[Strings.unitFactorCurrentExponent] = unitFactorCurrentExponent.jsValue() - object[Strings.unitFactorLuminousIntensityExponent] = unitFactorLuminousIntensityExponent.jsValue() - object[Strings.logicalMinimum] = logicalMinimum.jsValue() - object[Strings.logicalMaximum] = logicalMaximum.jsValue() - object[Strings.physicalMinimum] = physicalMinimum.jsValue() - object[Strings.physicalMaximum] = physicalMaximum.jsValue() - object[Strings.strings] = strings.jsValue() + object[Strings.isAbsolute] = isAbsolute.jsValue + object[Strings.isArray] = isArray.jsValue + object[Strings.isBufferedBytes] = isBufferedBytes.jsValue + object[Strings.isConstant] = isConstant.jsValue + object[Strings.isLinear] = isLinear.jsValue + object[Strings.isRange] = isRange.jsValue + object[Strings.isVolatile] = isVolatile.jsValue + object[Strings.hasNull] = hasNull.jsValue + object[Strings.hasPreferredState] = hasPreferredState.jsValue + object[Strings.wrap] = wrap.jsValue + object[Strings.usages] = usages.jsValue + object[Strings.usageMinimum] = usageMinimum.jsValue + object[Strings.usageMaximum] = usageMaximum.jsValue + object[Strings.reportSize] = reportSize.jsValue + object[Strings.reportCount] = reportCount.jsValue + object[Strings.unitExponent] = unitExponent.jsValue + object[Strings.unitSystem] = unitSystem.jsValue + object[Strings.unitFactorLengthExponent] = unitFactorLengthExponent.jsValue + object[Strings.unitFactorMassExponent] = unitFactorMassExponent.jsValue + object[Strings.unitFactorTimeExponent] = unitFactorTimeExponent.jsValue + object[Strings.unitFactorTemperatureExponent] = unitFactorTemperatureExponent.jsValue + object[Strings.unitFactorCurrentExponent] = unitFactorCurrentExponent.jsValue + object[Strings.unitFactorLuminousIntensityExponent] = unitFactorLuminousIntensityExponent.jsValue + object[Strings.logicalMinimum] = logicalMinimum.jsValue + object[Strings.logicalMaximum] = logicalMaximum.jsValue + object[Strings.physicalMinimum] = physicalMinimum.jsValue + object[Strings.physicalMaximum] = physicalMaximum.jsValue + object[Strings.strings] = strings.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HIDUnitSystem.swift b/Sources/DOMKit/WebIDL/HIDUnitSystem.swift index 73101aea..d89d8b55 100644 --- a/Sources/DOMKit/WebIDL/HIDUnitSystem.swift +++ b/Sources/DOMKit/WebIDL/HIDUnitSystem.swift @@ -23,5 +23,5 @@ public enum HIDUnitSystem: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift index ece3affa..6aec5e93 100644 --- a/Sources/DOMKit/WebIDL/HTMLAllCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLAllCollection.swift @@ -26,6 +26,6 @@ public class HTMLAllCollection: JSBridgedClass { @inlinable public func item(nameOrIndex: String? = nil) -> Element_or_HTMLCollection? { let this = jsObject - return this[Strings.item].function!(this: this, arguments: [nameOrIndex?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.item].function!(this: this, arguments: [nameOrIndex?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift index 248372bb..2b7112a4 100644 --- a/Sources/DOMKit/WebIDL/HTMLButtonElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLButtonElement.swift @@ -79,7 +79,7 @@ public class HTMLButtonElement: HTMLElement { @inlinable public func setCustomValidity(error: String) { let this = jsObject - _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index 3bba9f94..b052e833 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -24,12 +24,12 @@ public class HTMLCanvasElement: HTMLElement { @inlinable public func getContext(contextId: String, options: JSValue? = nil) -> RenderingContext? { let this = jsObject - return this[Strings.getContext].function!(this: this, arguments: [contextId.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getContext].function!(this: this, arguments: [contextId.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func toDataURL(type: String? = nil, quality: JSValue? = nil) -> String { let this = jsObject - return this[Strings.toDataURL].function!(this: this, arguments: [type?.jsValue() ?? .undefined, quality?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.toDataURL].function!(this: this, arguments: [type?.jsValue ?? .undefined, quality?.jsValue ?? .undefined]).fromJSValue()! } // XXX: member 'toBlob' is ignored @@ -41,6 +41,6 @@ public class HTMLCanvasElement: HTMLElement { @inlinable public func captureStream(frameRequestRate: Double? = nil) -> MediaStream { let this = jsObject - return this[Strings.captureStream].function!(this: this, arguments: [frameRequestRate?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.captureStream].function!(this: this, arguments: [frameRequestRate?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift index a7c6c1ef..cfba1dc1 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift @@ -26,14 +26,14 @@ public enum HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas: JSValueCompatib return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .hTMLCanvasElement(hTMLCanvasElement): - return hTMLCanvasElement.jsValue() + return hTMLCanvasElement.jsValue case let .imageBitmap(imageBitmap): - return imageBitmap.jsValue() + return imageBitmap.jsValue case let .offscreenCanvas(offscreenCanvas): - return offscreenCanvas.jsValue() + return offscreenCanvas.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift index 897163ec..385dbfd9 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift @@ -21,12 +21,12 @@ public enum HTMLCanvasElement_or_OffscreenCanvas: JSValueCompatible, Any_HTMLCan return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .hTMLCanvasElement(hTMLCanvasElement): - return hTMLCanvasElement.jsValue() + return hTMLCanvasElement.jsValue case let .offscreenCanvas(offscreenCanvas): - return offscreenCanvas.jsValue() + return offscreenCanvas.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift index f0db89fb..cbd398b3 100644 --- a/Sources/DOMKit/WebIDL/HTMLDialogElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLDialogElement.swift @@ -34,6 +34,6 @@ public class HTMLDialogElement: HTMLElement { @inlinable public func close(returnValue: String? = nil) { let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: [returnValue?.jsValue() ?? .undefined]) + _ = this[Strings.close].function!(this: this, arguments: [returnValue?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift b/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift index 4ffeb88b..805aa826 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift @@ -21,12 +21,12 @@ public enum HTMLElement_or_Int32: JSValueCompatible, Any_HTMLElement_or_Int32 { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .hTMLElement(hTMLElement): - return hTMLElement.jsValue() + return hTMLElement.jsValue case let .int32(int32): - return int32.jsValue() + return int32.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift index 8d64a7cc..9cff89b1 100644 --- a/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFieldSetElement.swift @@ -58,6 +58,6 @@ public class HTMLFieldSetElement: HTMLElement { @inlinable public func setCustomValidity(error: String) { let this = jsObject - _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/HTMLFormElement.swift b/Sources/DOMKit/WebIDL/HTMLFormElement.swift index 74b525d5..4f10d86d 100644 --- a/Sources/DOMKit/WebIDL/HTMLFormElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLFormElement.swift @@ -81,7 +81,7 @@ public class HTMLFormElement: HTMLElement { @inlinable public func requestSubmit(submitter: HTMLElement? = nil) { let this = jsObject - _ = this[Strings.requestSubmit].function!(this: this, arguments: [submitter?.jsValue() ?? .undefined]) + _ = this[Strings.requestSubmit].function!(this: this, arguments: [submitter?.jsValue ?? .undefined]) } @inlinable public func reset() { diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index 05f1f953..e4e347f3 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -103,7 +103,7 @@ public class HTMLImageElement: HTMLElement { @inlinable public func decode() async throws { let this = jsObject let _promise: JSPromise = this[Strings.decode].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index d3930c6d..0d234703 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -181,12 +181,12 @@ public class HTMLInputElement: HTMLElement { @inlinable public func stepUp(n: Int32? = nil) { let this = jsObject - _ = this[Strings.stepUp].function!(this: this, arguments: [n?.jsValue() ?? .undefined]) + _ = this[Strings.stepUp].function!(this: this, arguments: [n?.jsValue ?? .undefined]) } @inlinable public func stepDown(n: Int32? = nil) { let this = jsObject - _ = this[Strings.stepDown].function!(this: this, arguments: [n?.jsValue() ?? .undefined]) + _ = this[Strings.stepDown].function!(this: this, arguments: [n?.jsValue ?? .undefined]) } @ReadonlyAttribute @@ -210,7 +210,7 @@ public class HTMLInputElement: HTMLElement { @inlinable public func setCustomValidity(error: String) { let this = jsObject - _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue]) } @ReadonlyAttribute @@ -232,17 +232,17 @@ public class HTMLInputElement: HTMLElement { @inlinable public func setRangeText(replacement: String) { let this = jsObject - _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue()]) + _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue]) } @inlinable public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { let this = jsObject - _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined]) + _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue, start.jsValue, end.jsValue, selectionMode?.jsValue ?? .undefined]) } @inlinable public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { let this = jsObject - _ = this[Strings.setSelectionRange].function!(this: this, arguments: [start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined]) + _ = this[Strings.setSelectionRange].function!(this: this, arguments: [start.jsValue, end.jsValue, direction?.jsValue ?? .undefined]) } @inlinable public func showPicker() { diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index c5310e98..ae607a44 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -49,14 +49,14 @@ public class HTMLMediaElement: HTMLElement { @inlinable public func setSinkId(sinkId: String) -> JSPromise { let this = jsObject - return this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue()]).fromJSValue()! + return this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func setSinkId(sinkId: String) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue]).fromJSValue()! + _ = try await _promise.value } @ReadonlyAttribute @@ -70,14 +70,14 @@ public class HTMLMediaElement: HTMLElement { @inlinable public func setMediaKeys(mediaKeys: MediaKeys?) -> JSPromise { let this = jsObject - return this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue()]).fromJSValue()! + return this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func setMediaKeys(mediaKeys: MediaKeys?) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue]).fromJSValue()! + _ = try await _promise.value } @ReadonlyAttribute @@ -119,7 +119,7 @@ public class HTMLMediaElement: HTMLElement { @inlinable public func canPlayType(type: String) -> CanPlayTypeResult { let this = jsObject - return this[Strings.canPlayType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.canPlayType].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } public static let HAVE_NOTHING: UInt16 = 0 @@ -143,7 +143,7 @@ public class HTMLMediaElement: HTMLElement { @inlinable public func fastSeek(time: Double) { let this = jsObject - _ = this[Strings.fastSeek].function!(this: this, arguments: [time.jsValue()]) + _ = this[Strings.fastSeek].function!(this: this, arguments: [time.jsValue]) } @ReadonlyAttribute @@ -190,7 +190,7 @@ public class HTMLMediaElement: HTMLElement { @inlinable public func play() async throws { let this = jsObject let _promise: JSPromise = this[Strings.play].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func pause() { @@ -221,7 +221,7 @@ public class HTMLMediaElement: HTMLElement { @inlinable public func addTextTrack(kind: TextTrackKind, label: String? = nil, language: String? = nil) -> TextTrack { let this = jsObject - return this[Strings.addTextTrack].function!(this: this, arguments: [kind.jsValue(), label?.jsValue() ?? .undefined, language?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.addTextTrack].function!(this: this, arguments: [kind.jsValue, label?.jsValue ?? .undefined, language?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func captureStream() -> MediaStream { diff --git a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift index a7b0a468..9ac6eb2b 100644 --- a/Sources/DOMKit/WebIDL/HTMLObjectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLObjectElement.swift @@ -86,7 +86,7 @@ public class HTMLObjectElement: HTMLElement { @inlinable public func setCustomValidity(error: String) { let this = jsObject - _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift index 4afea7b5..630cd49d 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift @@ -21,12 +21,12 @@ public enum HTMLOptGroupElement_or_HTMLOptionElement: JSValueCompatible, Any_HTM return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .hTMLOptGroupElement(hTMLOptGroupElement): - return hTMLOptGroupElement.jsValue() + return hTMLOptGroupElement.jsValue case let .hTMLOptionElement(hTMLOptionElement): - return hTMLOptionElement.jsValue() + return hTMLOptionElement.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift index 5686130b..3b6256af 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptionsCollection.swift @@ -22,12 +22,12 @@ public class HTMLOptionsCollection: HTMLCollection { @inlinable public func add(element: HTMLOptGroupElement_or_HTMLOptionElement, before: HTMLElement_or_Int32? = nil) { let this = jsObject - _ = this[Strings.add].function!(this: this, arguments: [element.jsValue(), before?.jsValue() ?? .undefined]) + _ = this[Strings.add].function!(this: this, arguments: [element.jsValue, before?.jsValue ?? .undefined]) } @inlinable public func remove(index: Int32) { let this = jsObject - _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift index 9a11e13a..867d1ed9 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGElement.swift @@ -24,7 +24,7 @@ public extension HTMLOrSVGElement { @inlinable func focus(options: FocusOptions? = nil) { let this = jsObject - _ = this[Strings.focus].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) + _ = this[Strings.focus].function!(this: this, arguments: [options?.jsValue ?? .undefined]) } @inlinable func blur() { diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift index c8c9f1da..721862a8 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift @@ -21,12 +21,12 @@ public enum HTMLOrSVGImageElement: JSValueCompatible, Any_HTMLOrSVGImageElement return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .hTMLImageElement(hTMLImageElement): - return hTMLImageElement.jsValue() + return hTMLImageElement.jsValue case let .sVGImageElement(sVGImageElement): - return sVGImageElement.jsValue() + return sVGImageElement.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift index 7ad6008a..4a28df65 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift @@ -21,12 +21,12 @@ public enum HTMLOrSVGScriptElement: JSValueCompatible, Any_HTMLOrSVGScriptElemen return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .hTMLScriptElement(hTMLScriptElement): - return hTMLScriptElement.jsValue() + return hTMLScriptElement.jsValue case let .sVGScriptElement(sVGScriptElement): - return sVGScriptElement.jsValue() + return sVGScriptElement.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift index 5488e9fd..02c11f69 100644 --- a/Sources/DOMKit/WebIDL/HTMLOutputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOutputElement.swift @@ -63,7 +63,7 @@ public class HTMLOutputElement: HTMLElement { @inlinable public func setCustomValidity(error: String) { let this = jsObject - _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift index 22b634bc..24a02625 100644 --- a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift @@ -26,19 +26,19 @@ public class HTMLPortalElement: HTMLElement { @inlinable public func activate(options: PortalActivateOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.activate].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.activate].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func activate(options: PortalActivateOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.activate].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.activate].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift index ea7c853e..0d2eb7ce 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -60,7 +60,7 @@ public class HTMLScriptElement: HTMLElement { @inlinable public static func supports(type: String) -> Bool { let this = constructor - return this[Strings.supports].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.supports].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift index e994fafa..926d37f6 100644 --- a/Sources/DOMKit/WebIDL/HTMLSelectElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSelectElement.swift @@ -67,12 +67,12 @@ public class HTMLSelectElement: HTMLElement { @inlinable public func namedItem(name: String) -> HTMLOptionElement? { let this = jsObject - return this[Strings.namedItem].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.namedItem].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func add(element: HTMLOptGroupElement_or_HTMLOptionElement, before: HTMLElement_or_Int32? = nil) { let this = jsObject - _ = this[Strings.add].function!(this: this, arguments: [element.jsValue(), before?.jsValue() ?? .undefined]) + _ = this[Strings.add].function!(this: this, arguments: [element.jsValue, before?.jsValue ?? .undefined]) } @inlinable public func remove() { @@ -82,7 +82,7 @@ public class HTMLSelectElement: HTMLElement { @inlinable public func remove(index: Int32) { let this = jsObject - _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.remove].function!(this: this, arguments: [index.jsValue]) } // XXX: unsupported setter for keys of type UInt32 @@ -117,7 +117,7 @@ public class HTMLSelectElement: HTMLElement { @inlinable public func setCustomValidity(error: String) { let this = jsObject - _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift index 6ac1c098..a3806034 100644 --- a/Sources/DOMKit/WebIDL/HTMLSlotElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLSlotElement.swift @@ -20,16 +20,16 @@ public class HTMLSlotElement: HTMLElement { @inlinable public func assignedNodes(options: AssignedNodesOptions? = nil) -> [Node] { let this = jsObject - return this[Strings.assignedNodes].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.assignedNodes].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func assignedElements(options: AssignedNodesOptions? = nil) -> [Element] { let this = jsObject - return this[Strings.assignedElements].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.assignedElements].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func assign(nodes: Element_or_Text...) { let this = jsObject - _ = this[Strings.assign].function!(this: this, arguments: nodes.map { $0.jsValue() }) + _ = this[Strings.assign].function!(this: this, arguments: nodes.map(\.jsValue)) } } diff --git a/Sources/DOMKit/WebIDL/HTMLTableElement.swift b/Sources/DOMKit/WebIDL/HTMLTableElement.swift index a5dbd710..b6ac1f84 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableElement.swift @@ -80,12 +80,12 @@ public class HTMLTableElement: HTMLElement { @inlinable public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { let this = jsObject - return this[Strings.insertRow].function!(this: this, arguments: [index?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.insertRow].function!(this: this, arguments: [index?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteRow(index: Int32) { let this = jsObject - _ = this[Strings.deleteRow].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.deleteRow].function!(this: this, arguments: [index.jsValue]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift index b3175de3..418cf8d9 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableRowElement.swift @@ -33,12 +33,12 @@ public class HTMLTableRowElement: HTMLElement { @inlinable public func insertCell(index: Int32? = nil) -> HTMLTableCellElement { let this = jsObject - return this[Strings.insertCell].function!(this: this, arguments: [index?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.insertCell].function!(this: this, arguments: [index?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteCell(index: Int32) { let this = jsObject - _ = this[Strings.deleteCell].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.deleteCell].function!(this: this, arguments: [index.jsValue]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift index eb2395b5..4b820996 100644 --- a/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTableSectionElement.swift @@ -24,12 +24,12 @@ public class HTMLTableSectionElement: HTMLElement { @inlinable public func insertRow(index: Int32? = nil) -> HTMLTableRowElement { let this = jsObject - return this[Strings.insertRow].function!(this: this, arguments: [index?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.insertRow].function!(this: this, arguments: [index?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteRow(index: Int32) { let this = jsObject - _ = this[Strings.deleteRow].function!(this: this, arguments: [index.jsValue()]) + _ = this[Strings.deleteRow].function!(this: this, arguments: [index.jsValue]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift index 9dc038e5..b9b973d6 100644 --- a/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLTextAreaElement.swift @@ -110,7 +110,7 @@ public class HTMLTextAreaElement: HTMLElement { @inlinable public func setCustomValidity(error: String) { let this = jsObject - _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue()]) + _ = this[Strings.setCustomValidity].function!(this: this, arguments: [error.jsValue]) } @ReadonlyAttribute @@ -132,16 +132,16 @@ public class HTMLTextAreaElement: HTMLElement { @inlinable public func setRangeText(replacement: String) { let this = jsObject - _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue()]) + _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue]) } @inlinable public func setRangeText(replacement: String, start: UInt32, end: UInt32, selectionMode: SelectionMode? = nil) { let this = jsObject - _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue(), start.jsValue(), end.jsValue(), selectionMode?.jsValue() ?? .undefined]) + _ = this[Strings.setRangeText].function!(this: this, arguments: [replacement.jsValue, start.jsValue, end.jsValue, selectionMode?.jsValue ?? .undefined]) } @inlinable public func setSelectionRange(start: UInt32, end: UInt32, direction: String? = nil) { let this = jsObject - _ = this[Strings.setSelectionRange].function!(this: this, arguments: [start.jsValue(), end.jsValue(), direction?.jsValue() ?? .undefined]) + _ = this[Strings.setSelectionRange].function!(this: this, arguments: [start.jsValue, end.jsValue, direction?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index 068f3211..d8c805ed 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -56,7 +56,7 @@ public class HTMLVideoElement: HTMLMediaElement { @inlinable public func requestPictureInPicture() async throws -> PictureInPictureWindow { let this = jsObject let _promise: JSPromise = this[Strings.requestPictureInPicture].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ClosureAttribute1Optional @@ -75,6 +75,6 @@ public class HTMLVideoElement: HTMLMediaElement { @inlinable public func cancelVideoFrameCallback(handle: UInt32) { let this = jsObject - _ = this[Strings.cancelVideoFrameCallback].function!(this: this, arguments: [handle.jsValue()]) + _ = this[Strings.cancelVideoFrameCallback].function!(this: this, arguments: [handle.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/HardwareAcceleration.swift b/Sources/DOMKit/WebIDL/HardwareAcceleration.swift index ce13bd1b..9adb76b1 100644 --- a/Sources/DOMKit/WebIDL/HardwareAcceleration.swift +++ b/Sources/DOMKit/WebIDL/HardwareAcceleration.swift @@ -19,5 +19,5 @@ public enum HardwareAcceleration: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/HashChangeEvent.swift b/Sources/DOMKit/WebIDL/HashChangeEvent.swift index 03f7aa2b..47779d59 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEvent.swift @@ -13,7 +13,7 @@ public class HashChangeEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: HashChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift index 576c4a87..e9a91bc2 100644 --- a/Sources/DOMKit/WebIDL/HashChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/HashChangeEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class HashChangeEventInit: BridgedDictionary { public convenience init(oldURL: String, newURL: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.oldURL] = oldURL.jsValue() - object[Strings.newURL] = newURL.jsValue() + object[Strings.oldURL] = oldURL.jsValue + object[Strings.newURL] = newURL.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HdrMetadataType.swift b/Sources/DOMKit/WebIDL/HdrMetadataType.swift index 222ccd38..7fb003b1 100644 --- a/Sources/DOMKit/WebIDL/HdrMetadataType.swift +++ b/Sources/DOMKit/WebIDL/HdrMetadataType.swift @@ -19,5 +19,5 @@ public enum HdrMetadataType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Headers.swift b/Sources/DOMKit/WebIDL/Headers.swift index a28b9f50..a34995c9 100644 --- a/Sources/DOMKit/WebIDL/Headers.swift +++ b/Sources/DOMKit/WebIDL/Headers.swift @@ -13,32 +13,32 @@ public class Headers: JSBridgedClass, Sequence { } @inlinable public convenience init(init: HeadersInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) + 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()]) + _ = 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()]) + _ = 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()! + return this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func has(name: String) -> Bool { let this = jsObject - return this[Strings.has].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.has].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func set(name: String, value: String) { let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) + _ = this[Strings.set].function!(this: this, arguments: [name.jsValue, value.jsValue]) } public typealias Element = String diff --git a/Sources/DOMKit/WebIDL/HeadersInit.swift b/Sources/DOMKit/WebIDL/HeadersInit.swift index 66b59cfd..dcae6c17 100644 --- a/Sources/DOMKit/WebIDL/HeadersInit.swift +++ b/Sources/DOMKit/WebIDL/HeadersInit.swift @@ -21,12 +21,12 @@ public enum HeadersInit: JSValueCompatible, Any_HeadersInit { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .record_String_to_String(record_String_to_String): - return record_String_to_String.jsValue() + return record_String_to_String.jsValue case let .seq_of_seq_of_String(seq_of_seq_of_String): - return seq_of_seq_of_String.jsValue() + return seq_of_seq_of_String.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Highlight.swift b/Sources/DOMKit/WebIDL/Highlight.swift index e9d5d71e..8291aa97 100644 --- a/Sources/DOMKit/WebIDL/Highlight.swift +++ b/Sources/DOMKit/WebIDL/Highlight.swift @@ -15,7 +15,7 @@ public class Highlight: JSBridgedClass { } @inlinable public convenience init(initialRanges: AbstractRange...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: initialRanges.map { $0.jsValue() })) + self.init(unsafelyWrapping: Self.constructor.new(arguments: initialRanges.map(\.jsValue))) } // XXX: make me Set-like! diff --git a/Sources/DOMKit/WebIDL/HighlightType.swift b/Sources/DOMKit/WebIDL/HighlightType.swift index f4735a64..daad5e39 100644 --- a/Sources/DOMKit/WebIDL/HighlightType.swift +++ b/Sources/DOMKit/WebIDL/HighlightType.swift @@ -19,5 +19,5 @@ public enum HighlightType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/History.swift b/Sources/DOMKit/WebIDL/History.swift index 4486bd34..4295ed2d 100644 --- a/Sources/DOMKit/WebIDL/History.swift +++ b/Sources/DOMKit/WebIDL/History.swift @@ -26,7 +26,7 @@ public class History: JSBridgedClass { @inlinable public func go(delta: Int32? = nil) { let this = jsObject - _ = this[Strings.go].function!(this: this, arguments: [delta?.jsValue() ?? .undefined]) + _ = this[Strings.go].function!(this: this, arguments: [delta?.jsValue ?? .undefined]) } @inlinable public func back() { @@ -41,11 +41,11 @@ public class History: JSBridgedClass { @inlinable public func pushState(data: JSValue, unused: String, url: String? = nil) { let this = jsObject - _ = this[Strings.pushState].function!(this: this, arguments: [data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined]) + _ = this[Strings.pushState].function!(this: this, arguments: [data.jsValue, unused.jsValue, url?.jsValue ?? .undefined]) } @inlinable public func replaceState(data: JSValue, unused: String, url: String? = nil) { let this = jsObject - _ = this[Strings.replaceState].function!(this: this, arguments: [data.jsValue(), unused.jsValue(), url?.jsValue() ?? .undefined]) + _ = this[Strings.replaceState].function!(this: this, arguments: [data.jsValue, unused.jsValue, url?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/HkdfParams.swift b/Sources/DOMKit/WebIDL/HkdfParams.swift index 428822eb..ed7f00a7 100644 --- a/Sources/DOMKit/WebIDL/HkdfParams.swift +++ b/Sources/DOMKit/WebIDL/HkdfParams.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class HkdfParams: BridgedDictionary { public convenience init(hash: HashAlgorithmIdentifier, salt: BufferSource, info: BufferSource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue() - object[Strings.salt] = salt.jsValue() - object[Strings.info] = info.jsValue() + object[Strings.hash] = hash.jsValue + object[Strings.salt] = salt.jsValue + object[Strings.info] = info.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HmacImportParams.swift b/Sources/DOMKit/WebIDL/HmacImportParams.swift index 0caefa96..7e603af0 100644 --- a/Sources/DOMKit/WebIDL/HmacImportParams.swift +++ b/Sources/DOMKit/WebIDL/HmacImportParams.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class HmacImportParams: BridgedDictionary { public convenience init(hash: HashAlgorithmIdentifier, length: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue() - object[Strings.length] = length.jsValue() + object[Strings.hash] = hash.jsValue + object[Strings.length] = length.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift index 59487735..28f40daf 100644 --- a/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift +++ b/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class HmacKeyAlgorithm: BridgedDictionary { public convenience init(hash: KeyAlgorithm, length: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue() - object[Strings.length] = length.jsValue() + object[Strings.hash] = hash.jsValue + object[Strings.length] = length.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift b/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift index 97148ec8..2a537833 100644 --- a/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift +++ b/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class HmacKeyGenParams: BridgedDictionary { public convenience init(hash: HashAlgorithmIdentifier, length: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue() - object[Strings.length] = length.jsValue() + object[Strings.hash] = hash.jsValue + object[Strings.length] = length.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IDBCursor.swift b/Sources/DOMKit/WebIDL/IDBCursor.swift index 4f28c0b4..210a06ee 100644 --- a/Sources/DOMKit/WebIDL/IDBCursor.swift +++ b/Sources/DOMKit/WebIDL/IDBCursor.swift @@ -34,22 +34,22 @@ public class IDBCursor: JSBridgedClass { @inlinable public func advance(count: UInt32) { let this = jsObject - _ = this[Strings.advance].function!(this: this, arguments: [count.jsValue()]) + _ = this[Strings.advance].function!(this: this, arguments: [count.jsValue]) } @inlinable public func `continue`(key: JSValue? = nil) { let this = jsObject - _ = this[Strings.continue].function!(this: this, arguments: [key?.jsValue() ?? .undefined]) + _ = this[Strings.continue].function!(this: this, arguments: [key?.jsValue ?? .undefined]) } @inlinable public func continuePrimaryKey(key: JSValue, primaryKey: JSValue) { let this = jsObject - _ = this[Strings.continuePrimaryKey].function!(this: this, arguments: [key.jsValue(), primaryKey.jsValue()]) + _ = this[Strings.continuePrimaryKey].function!(this: this, arguments: [key.jsValue, primaryKey.jsValue]) } @inlinable public func update(value: JSValue) -> IDBRequest { let this = jsObject - return this[Strings.update].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.update].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public func delete() -> IDBRequest { diff --git a/Sources/DOMKit/WebIDL/IDBCursorDirection.swift b/Sources/DOMKit/WebIDL/IDBCursorDirection.swift index 66166ea8..8cc8383b 100644 --- a/Sources/DOMKit/WebIDL/IDBCursorDirection.swift +++ b/Sources/DOMKit/WebIDL/IDBCursorDirection.swift @@ -20,5 +20,5 @@ public enum IDBCursorDirection: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift index 9a418408..17db9caf 100644 --- a/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift +++ b/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift @@ -26,14 +26,14 @@ public enum IDBCursor_or_IDBIndex_or_IDBObjectStore: JSValueCompatible, Any_IDBC return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .iDBCursor(iDBCursor): - return iDBCursor.jsValue() + return iDBCursor.jsValue case let .iDBIndex(iDBIndex): - return iDBIndex.jsValue() + return iDBIndex.jsValue case let .iDBObjectStore(iDBObjectStore): - return iDBObjectStore.jsValue() + return iDBObjectStore.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/IDBDatabase.swift b/Sources/DOMKit/WebIDL/IDBDatabase.swift index 6d6b5547..ded59d13 100644 --- a/Sources/DOMKit/WebIDL/IDBDatabase.swift +++ b/Sources/DOMKit/WebIDL/IDBDatabase.swift @@ -28,7 +28,7 @@ public class IDBDatabase: EventTarget { @inlinable public func transaction(storeNames: String_or_seq_of_String, mode: IDBTransactionMode? = nil, options: IDBTransactionOptions? = nil) -> IDBTransaction { let this = jsObject - return this[Strings.transaction].function!(this: this, arguments: [storeNames.jsValue(), mode?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.transaction].function!(this: this, arguments: [storeNames.jsValue, mode?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func close() { @@ -38,12 +38,12 @@ public class IDBDatabase: EventTarget { @inlinable public func createObjectStore(name: String, options: IDBObjectStoreParameters? = nil) -> IDBObjectStore { let this = jsObject - return this[Strings.createObjectStore].function!(this: this, arguments: [name.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createObjectStore].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteObjectStore(name: String) { let this = jsObject - _ = this[Strings.deleteObjectStore].function!(this: this, arguments: [name.jsValue()]) + _ = this[Strings.deleteObjectStore].function!(this: this, arguments: [name.jsValue]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift b/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift index 13bdf8a2..b8a8b1c7 100644 --- a/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift +++ b/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class IDBDatabaseInfo: BridgedDictionary { public convenience init(name: String, version: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.version] = version.jsValue() + object[Strings.name] = name.jsValue + object[Strings.version] = version.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IDBFactory.swift b/Sources/DOMKit/WebIDL/IDBFactory.swift index 7e201a21..d20248d1 100644 --- a/Sources/DOMKit/WebIDL/IDBFactory.swift +++ b/Sources/DOMKit/WebIDL/IDBFactory.swift @@ -14,12 +14,12 @@ public class IDBFactory: JSBridgedClass { @inlinable public func open(name: String, version: UInt64? = nil) -> IDBOpenDBRequest { let this = jsObject - return this[Strings.open].function!(this: this, arguments: [name.jsValue(), version?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.open].function!(this: this, arguments: [name.jsValue, version?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteDatabase(name: String) -> IDBOpenDBRequest { let this = jsObject - return this[Strings.deleteDatabase].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.deleteDatabase].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func databases() -> JSPromise { @@ -31,11 +31,11 @@ public class IDBFactory: JSBridgedClass { @inlinable public func databases() async throws -> [IDBDatabaseInfo] { let this = jsObject let _promise: JSPromise = this[Strings.databases].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func cmp(first: JSValue, second: JSValue) -> Int16 { let this = jsObject - return this[Strings.cmp].function!(this: this, arguments: [first.jsValue(), second.jsValue()]).fromJSValue()! + return this[Strings.cmp].function!(this: this, arguments: [first.jsValue, second.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/IDBIndex.swift b/Sources/DOMKit/WebIDL/IDBIndex.swift index f1897ea5..f43bcd86 100644 --- a/Sources/DOMKit/WebIDL/IDBIndex.swift +++ b/Sources/DOMKit/WebIDL/IDBIndex.swift @@ -34,36 +34,36 @@ public class IDBIndex: JSBridgedClass { @inlinable public func get(query: JSValue) -> IDBRequest { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [query.jsValue]).fromJSValue()! } @inlinable public func getKey(query: JSValue) -> IDBRequest { let this = jsObject - return this[Strings.getKey].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! + return this[Strings.getKey].function!(this: this, arguments: [query.jsValue]).fromJSValue()! } @inlinable public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue ?? .undefined, count?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { let this = jsObject - return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue ?? .undefined, count?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func count(query: JSValue? = nil) -> IDBRequest { let this = jsObject - return this[Strings.count].function!(this: this, arguments: [query?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.count].function!(this: this, arguments: [query?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { let this = jsObject - return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue ?? .undefined, direction?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { let this = jsObject - return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue ?? .undefined, direction?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/IDBIndexParameters.swift b/Sources/DOMKit/WebIDL/IDBIndexParameters.swift index 510bd661..e6c6eaf1 100644 --- a/Sources/DOMKit/WebIDL/IDBIndexParameters.swift +++ b/Sources/DOMKit/WebIDL/IDBIndexParameters.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class IDBIndexParameters: BridgedDictionary { public convenience init(unique: Bool, multiEntry: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.unique] = unique.jsValue() - object[Strings.multiEntry] = multiEntry.jsValue() + object[Strings.unique] = unique.jsValue + object[Strings.multiEntry] = multiEntry.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift index fc9598f2..8ab78fc5 100644 --- a/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift +++ b/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift @@ -21,12 +21,12 @@ public enum IDBIndex_or_IDBObjectStore: JSValueCompatible, Any_IDBIndex_or_IDBOb return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .iDBIndex(iDBIndex): - return iDBIndex.jsValue() + return iDBIndex.jsValue case let .iDBObjectStore(iDBObjectStore): - return iDBObjectStore.jsValue() + return iDBObjectStore.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/IDBKeyRange.swift b/Sources/DOMKit/WebIDL/IDBKeyRange.swift index ac354b8a..3806b299 100644 --- a/Sources/DOMKit/WebIDL/IDBKeyRange.swift +++ b/Sources/DOMKit/WebIDL/IDBKeyRange.swift @@ -30,26 +30,26 @@ public class IDBKeyRange: JSBridgedClass { @inlinable public static func only(value: JSValue) -> Self { let this = constructor - return this[Strings.only].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.only].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public static func lowerBound(lower: JSValue, open: Bool? = nil) -> Self { let this = constructor - return this[Strings.lowerBound].function!(this: this, arguments: [lower.jsValue(), open?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.lowerBound].function!(this: this, arguments: [lower.jsValue, open?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public static func upperBound(upper: JSValue, open: Bool? = nil) -> Self { let this = constructor - return this[Strings.upperBound].function!(this: this, arguments: [upper.jsValue(), open?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.upperBound].function!(this: this, arguments: [upper.jsValue, open?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public static func bound(lower: JSValue, upper: JSValue, lowerOpen: Bool? = nil, upperOpen: Bool? = nil) -> Self { let this = constructor - return this[Strings.bound].function!(this: this, arguments: [lower.jsValue(), upper.jsValue(), lowerOpen?.jsValue() ?? .undefined, upperOpen?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.bound].function!(this: this, arguments: [lower.jsValue, upper.jsValue, lowerOpen?.jsValue ?? .undefined, upperOpen?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func includes(key: JSValue) -> Bool { let this = jsObject - return this[Strings.includes].function!(this: this, arguments: [key.jsValue()]).fromJSValue()! + return this[Strings.includes].function!(this: this, arguments: [key.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBObjectStore.swift index 791d92a1..8c1221c0 100644 --- a/Sources/DOMKit/WebIDL/IDBObjectStore.swift +++ b/Sources/DOMKit/WebIDL/IDBObjectStore.swift @@ -34,17 +34,17 @@ public class IDBObjectStore: JSBridgedClass { @inlinable public func put(value: JSValue, key: JSValue? = nil) -> IDBRequest { let this = jsObject - return this[Strings.put].function!(this: this, arguments: [value.jsValue(), key?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.put].function!(this: this, arguments: [value.jsValue, key?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func add(value: JSValue, key: JSValue? = nil) -> IDBRequest { let this = jsObject - return this[Strings.add].function!(this: this, arguments: [value.jsValue(), key?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.add].function!(this: this, arguments: [value.jsValue, key?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func delete(query: JSValue) -> IDBRequest { let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! + return this[Strings.delete].function!(this: this, arguments: [query.jsValue]).fromJSValue()! } @inlinable public func clear() -> IDBRequest { @@ -54,51 +54,51 @@ public class IDBObjectStore: JSBridgedClass { @inlinable public func get(query: JSValue) -> IDBRequest { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [query.jsValue]).fromJSValue()! } @inlinable public func getKey(query: JSValue) -> IDBRequest { let this = jsObject - return this[Strings.getKey].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! + return this[Strings.getKey].function!(this: this, arguments: [query.jsValue]).fromJSValue()! } @inlinable public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue ?? .undefined, count?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { let this = jsObject - return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue() ?? .undefined, count?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue ?? .undefined, count?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func count(query: JSValue? = nil) -> IDBRequest { let this = jsObject - return this[Strings.count].function!(this: this, arguments: [query?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.count].function!(this: this, arguments: [query?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { let this = jsObject - return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue ?? .undefined, direction?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { let this = jsObject - return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue ?? .undefined, direction?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func index(name: String) -> IDBIndex { let this = jsObject - return this[Strings.index].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.index].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func createIndex(name: String, keyPath: String_or_seq_of_String, options: IDBIndexParameters? = nil) -> IDBIndex { let this = jsObject - return this[Strings.createIndex].function!(this: this, arguments: [name.jsValue(), keyPath.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createIndex].function!(this: this, arguments: [name.jsValue, keyPath.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func deleteIndex(name: String) { let this = jsObject - _ = this[Strings.deleteIndex].function!(this: this, arguments: [name.jsValue()]) + _ = this[Strings.deleteIndex].function!(this: this, arguments: [name.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift b/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift index 0fad0c6c..f49450a1 100644 --- a/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift +++ b/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class IDBObjectStoreParameters: BridgedDictionary { public convenience init(keyPath: String_or_seq_of_String?, autoIncrement: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keyPath] = keyPath.jsValue() - object[Strings.autoIncrement] = autoIncrement.jsValue() + object[Strings.keyPath] = keyPath.jsValue + object[Strings.autoIncrement] = autoIncrement.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift b/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift index e4e5ff8f..1024dfca 100644 --- a/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift +++ b/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift @@ -18,5 +18,5 @@ public enum IDBRequestReadyState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/IDBTransaction.swift b/Sources/DOMKit/WebIDL/IDBTransaction.swift index ee3c5496..c666a7dc 100644 --- a/Sources/DOMKit/WebIDL/IDBTransaction.swift +++ b/Sources/DOMKit/WebIDL/IDBTransaction.swift @@ -35,7 +35,7 @@ public class IDBTransaction: EventTarget { @inlinable public func objectStore(name: String) -> IDBObjectStore { let this = jsObject - return this[Strings.objectStore].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.objectStore].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func commit() { diff --git a/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift b/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift index 004d87be..c03a9c8f 100644 --- a/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift +++ b/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift @@ -19,5 +19,5 @@ public enum IDBTransactionDurability: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/IDBTransactionMode.swift b/Sources/DOMKit/WebIDL/IDBTransactionMode.swift index 8c3c7b22..4d4ceaa6 100644 --- a/Sources/DOMKit/WebIDL/IDBTransactionMode.swift +++ b/Sources/DOMKit/WebIDL/IDBTransactionMode.swift @@ -19,5 +19,5 @@ public enum IDBTransactionMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/IDBTransactionOptions.swift b/Sources/DOMKit/WebIDL/IDBTransactionOptions.swift index ade57d2d..e6d33892 100644 --- a/Sources/DOMKit/WebIDL/IDBTransactionOptions.swift +++ b/Sources/DOMKit/WebIDL/IDBTransactionOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class IDBTransactionOptions: BridgedDictionary { public convenience init(durability: IDBTransactionDurability) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.durability] = durability.jsValue() + object[Strings.durability] = durability.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift b/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift index 3974465d..ac98f343 100644 --- a/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift @@ -13,7 +13,7 @@ public class IDBVersionChangeEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: IDBVersionChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift b/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift index 246703ca..ccece314 100644 --- a/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class IDBVersionChangeEventInit: BridgedDictionary { public convenience init(oldVersion: UInt64, newVersion: UInt64?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.oldVersion] = oldVersion.jsValue() - object[Strings.newVersion] = newVersion.jsValue() + object[Strings.oldVersion] = oldVersion.jsValue + object[Strings.newVersion] = newVersion.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IIRFilterNode.swift b/Sources/DOMKit/WebIDL/IIRFilterNode.swift index 7a9c918c..cab30b77 100644 --- a/Sources/DOMKit/WebIDL/IIRFilterNode.swift +++ b/Sources/DOMKit/WebIDL/IIRFilterNode.swift @@ -11,11 +11,11 @@ public class IIRFilterNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: IIRFilterOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options.jsValue])) } @inlinable public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { let this = jsObject - _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue(), magResponse.jsValue(), phaseResponse.jsValue()]) + _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue, magResponse.jsValue, phaseResponse.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/IIRFilterOptions.swift b/Sources/DOMKit/WebIDL/IIRFilterOptions.swift index cb5cea81..2e5dbef9 100644 --- a/Sources/DOMKit/WebIDL/IIRFilterOptions.swift +++ b/Sources/DOMKit/WebIDL/IIRFilterOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class IIRFilterOptions: BridgedDictionary { public convenience init(feedforward: [Double], feedback: [Double]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.feedforward] = feedforward.jsValue() - object[Strings.feedback] = feedback.jsValue() + object[Strings.feedforward] = feedforward.jsValue + object[Strings.feedback] = feedback.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IdleDetector.swift b/Sources/DOMKit/WebIDL/IdleDetector.swift index 55d76940..5fd3121a 100644 --- a/Sources/DOMKit/WebIDL/IdleDetector.swift +++ b/Sources/DOMKit/WebIDL/IdleDetector.swift @@ -35,18 +35,18 @@ public class IdleDetector: EventTarget { @inlinable public static func requestPermission() async throws -> PermissionState { let this = constructor let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func start(options: IdleOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.start].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.start].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func start(options: IdleOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.start].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.start].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/IdleOptions.swift b/Sources/DOMKit/WebIDL/IdleOptions.swift index 27f1366c..13a8fb0d 100644 --- a/Sources/DOMKit/WebIDL/IdleOptions.swift +++ b/Sources/DOMKit/WebIDL/IdleOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class IdleOptions: BridgedDictionary { public convenience init(threshold: UInt64, signal: AbortSignal) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.threshold] = threshold.jsValue() - object[Strings.signal] = signal.jsValue() + object[Strings.threshold] = threshold.jsValue + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IdleRequestOptions.swift b/Sources/DOMKit/WebIDL/IdleRequestOptions.swift index 7626d862..aeef0eb6 100644 --- a/Sources/DOMKit/WebIDL/IdleRequestOptions.swift +++ b/Sources/DOMKit/WebIDL/IdleRequestOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class IdleRequestOptions: BridgedDictionary { public convenience init(timeout: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timeout] = timeout.jsValue() + object[Strings.timeout] = timeout.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift index 34edd096..77156700 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapOptions.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class ImageBitmapOptions: BridgedDictionary { public convenience init(imageOrientation: ImageOrientation, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, resizeWidth: UInt32, resizeHeight: UInt32, resizeQuality: ResizeQuality) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.imageOrientation] = imageOrientation.jsValue() - object[Strings.premultiplyAlpha] = premultiplyAlpha.jsValue() - object[Strings.colorSpaceConversion] = colorSpaceConversion.jsValue() - object[Strings.resizeWidth] = resizeWidth.jsValue() - object[Strings.resizeHeight] = resizeHeight.jsValue() - object[Strings.resizeQuality] = resizeQuality.jsValue() + object[Strings.imageOrientation] = imageOrientation.jsValue + object[Strings.premultiplyAlpha] = premultiplyAlpha.jsValue + object[Strings.colorSpaceConversion] = colorSpaceConversion.jsValue + object[Strings.resizeWidth] = resizeWidth.jsValue + object[Strings.resizeHeight] = resizeHeight.jsValue + object[Strings.resizeQuality] = resizeQuality.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift index ffcc55c2..041cb8c7 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContext.swift @@ -18,6 +18,6 @@ public class ImageBitmapRenderingContext: JSBridgedClass { @inlinable public func transferFromImageBitmap(bitmap: ImageBitmap?) { let this = jsObject - _ = this[Strings.transferFromImageBitmap].function!(this: this, arguments: [bitmap.jsValue()]) + _ = this[Strings.transferFromImageBitmap].function!(this: this, arguments: [bitmap.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift index 98cc21cc..129ab258 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapRenderingContextSettings.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ImageBitmapRenderingContextSettings: BridgedDictionary { public convenience init(alpha: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue() + object[Strings.alpha] = alpha.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageBitmapSource.swift b/Sources/DOMKit/WebIDL/ImageBitmapSource.swift index b0915f5c..bd1ec6f8 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapSource.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapSource.swift @@ -26,14 +26,14 @@ public enum ImageBitmapSource: JSValueCompatible, Any_ImageBitmapSource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .blob(blob): - return blob.jsValue() + return blob.jsValue case let .canvasImageSource(canvasImageSource): - return canvasImageSource.jsValue() + return canvasImageSource.jsValue case let .imageData(imageData): - return imageData.jsValue() + return imageData.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ImageBufferSource.swift b/Sources/DOMKit/WebIDL/ImageBufferSource.swift index aab3e594..6252e898 100644 --- a/Sources/DOMKit/WebIDL/ImageBufferSource.swift +++ b/Sources/DOMKit/WebIDL/ImageBufferSource.swift @@ -21,12 +21,12 @@ public enum ImageBufferSource: JSValueCompatible, Any_ImageBufferSource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .bufferSource(bufferSource): - return bufferSource.jsValue() + return bufferSource.jsValue case let .readableStream(readableStream): - return readableStream.jsValue() + return readableStream.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ImageCapture.swift b/Sources/DOMKit/WebIDL/ImageCapture.swift index e82851ec..fa713d79 100644 --- a/Sources/DOMKit/WebIDL/ImageCapture.swift +++ b/Sources/DOMKit/WebIDL/ImageCapture.swift @@ -14,19 +14,19 @@ public class ImageCapture: JSBridgedClass { } @inlinable public convenience init(videoTrack: MediaStreamTrack) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [videoTrack.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [videoTrack.jsValue])) } @inlinable public func takePhoto(photoSettings: PhotoSettings? = nil) -> JSPromise { let this = jsObject - return this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func takePhoto(photoSettings: PhotoSettings? = nil) async throws -> Blob { let this = jsObject - let _promise: JSPromise = this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getPhotoCapabilities() -> JSPromise { @@ -38,7 +38,7 @@ public class ImageCapture: JSBridgedClass { @inlinable public func getPhotoCapabilities() async throws -> PhotoCapabilities { let this = jsObject let _promise: JSPromise = this[Strings.getPhotoCapabilities].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getPhotoSettings() -> JSPromise { @@ -50,7 +50,7 @@ public class ImageCapture: JSBridgedClass { @inlinable public func getPhotoSettings() async throws -> PhotoSettings { let this = jsObject let _promise: JSPromise = this[Strings.getPhotoSettings].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func grabFrame() -> JSPromise { @@ -62,7 +62,7 @@ public class ImageCapture: JSBridgedClass { @inlinable public func grabFrame() async throws -> ImageBitmap { let this = jsObject let _promise: JSPromise = this[Strings.grabFrame].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ImageData.swift b/Sources/DOMKit/WebIDL/ImageData.swift index 03bf4e00..2ad76a59 100644 --- a/Sources/DOMKit/WebIDL/ImageData.swift +++ b/Sources/DOMKit/WebIDL/ImageData.swift @@ -17,11 +17,11 @@ public class ImageData: JSBridgedClass { } @inlinable public convenience init(sw: UInt32, sh: UInt32, settings: ImageDataSettings? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sw.jsValue(), sh.jsValue(), settings?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sw.jsValue, sh.jsValue, settings?.jsValue ?? .undefined])) } @inlinable public convenience init(data: Uint8ClampedArray, sw: UInt32, sh: UInt32? = nil, settings: ImageDataSettings? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue(), sw.jsValue(), sh?.jsValue() ?? .undefined, settings?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue, sw.jsValue, sh?.jsValue ?? .undefined, settings?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ImageDataSettings.swift b/Sources/DOMKit/WebIDL/ImageDataSettings.swift index 553ddd12..6e784521 100644 --- a/Sources/DOMKit/WebIDL/ImageDataSettings.swift +++ b/Sources/DOMKit/WebIDL/ImageDataSettings.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ImageDataSettings: BridgedDictionary { public convenience init(colorSpace: PredefinedColorSpace) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.colorSpace] = colorSpace.jsValue() + object[Strings.colorSpace] = colorSpace.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift b/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift index 318a51b1..89806708 100644 --- a/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift @@ -6,8 +6,8 @@ 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() + object[Strings.frameIndex] = frameIndex.jsValue + object[Strings.completeFramesOnly] = completeFramesOnly.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageDecodeResult.swift b/Sources/DOMKit/WebIDL/ImageDecodeResult.swift index aea45b6d..1a4cb939 100644 --- a/Sources/DOMKit/WebIDL/ImageDecodeResult.swift +++ b/Sources/DOMKit/WebIDL/ImageDecodeResult.swift @@ -6,8 +6,8 @@ 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() + object[Strings.image] = image.jsValue + object[Strings.complete] = complete.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageDecoder.swift b/Sources/DOMKit/WebIDL/ImageDecoder.swift index a44901fd..6112d940 100644 --- a/Sources/DOMKit/WebIDL/ImageDecoder.swift +++ b/Sources/DOMKit/WebIDL/ImageDecoder.swift @@ -17,7 +17,7 @@ public class ImageDecoder: JSBridgedClass { } @inlinable public convenience init(init: ImageDecoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute @@ -34,14 +34,14 @@ public class ImageDecoder: JSBridgedClass { @inlinable public func decode(options: ImageDecodeOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.decode].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + 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.get().fromJSValue()! + let _promise: JSPromise = this[Strings.decode].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func reset() { @@ -56,13 +56,13 @@ public class ImageDecoder: JSBridgedClass { @inlinable public static func isTypeSupported(type: String) -> JSPromise { let this = constructor - return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + 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.get().fromJSValue()! + 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 index 77a5fd4f..06179973 100644 --- a/Sources/DOMKit/WebIDL/ImageDecoderInit.swift +++ b/Sources/DOMKit/WebIDL/ImageDecoderInit.swift @@ -6,13 +6,13 @@ 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() + 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) } diff --git a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift index 250ebdb0..f3263062 100644 --- a/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift +++ b/Sources/DOMKit/WebIDL/ImageEncodeOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ImageEncodeOptions: BridgedDictionary { public convenience init(type: String, quality: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.quality] = quality.jsValue() + object[Strings.type] = type.jsValue + object[Strings.quality] = quality.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageObject.swift b/Sources/DOMKit/WebIDL/ImageObject.swift index f4660eea..970e1137 100644 --- a/Sources/DOMKit/WebIDL/ImageObject.swift +++ b/Sources/DOMKit/WebIDL/ImageObject.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class ImageObject: BridgedDictionary { public convenience init(src: String, sizes: String, type: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.src] = src.jsValue() - object[Strings.sizes] = sizes.jsValue() - object[Strings.type] = type.jsValue() + object[Strings.src] = src.jsValue + object[Strings.sizes] = sizes.jsValue + object[Strings.type] = type.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageOrientation.swift b/Sources/DOMKit/WebIDL/ImageOrientation.swift index f74377bb..f8a5f79d 100644 --- a/Sources/DOMKit/WebIDL/ImageOrientation.swift +++ b/Sources/DOMKit/WebIDL/ImageOrientation.swift @@ -18,5 +18,5 @@ public enum ImageOrientation: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ImageResource.swift b/Sources/DOMKit/WebIDL/ImageResource.swift index 414a2e16..be5d5444 100644 --- a/Sources/DOMKit/WebIDL/ImageResource.swift +++ b/Sources/DOMKit/WebIDL/ImageResource.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class ImageResource: BridgedDictionary { public convenience init(src: String, sizes: String, type: String, label: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.src] = src.jsValue() - object[Strings.sizes] = sizes.jsValue() - object[Strings.type] = type.jsValue() - object[Strings.label] = label.jsValue() + object[Strings.src] = src.jsValue + object[Strings.sizes] = sizes.jsValue + object[Strings.type] = type.jsValue + object[Strings.label] = label.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift index b0f6c49e..16cce588 100644 --- a/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift +++ b/Sources/DOMKit/WebIDL/ImageSmoothingQuality.swift @@ -19,5 +19,5 @@ public enum ImageSmoothingQuality: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ImportExportKind.swift b/Sources/DOMKit/WebIDL/ImportExportKind.swift index 7971d4b5..cae8be2e 100644 --- a/Sources/DOMKit/WebIDL/ImportExportKind.swift +++ b/Sources/DOMKit/WebIDL/ImportExportKind.swift @@ -20,5 +20,5 @@ public enum ImportExportKind: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Ink.swift b/Sources/DOMKit/WebIDL/Ink.swift index 71368757..e25b3566 100644 --- a/Sources/DOMKit/WebIDL/Ink.swift +++ b/Sources/DOMKit/WebIDL/Ink.swift @@ -14,13 +14,13 @@ public class Ink: JSBridgedClass { @inlinable public func requestPresenter(param: InkPresenterParam? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestPresenter(param: InkPresenterParam? = nil) async throws -> InkPresenter { let this = jsObject - let _promise: JSPromise = this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/InkPresenter.swift b/Sources/DOMKit/WebIDL/InkPresenter.swift index 080e9269..a4dde76d 100644 --- a/Sources/DOMKit/WebIDL/InkPresenter.swift +++ b/Sources/DOMKit/WebIDL/InkPresenter.swift @@ -22,6 +22,6 @@ public class InkPresenter: JSBridgedClass { @inlinable public func updateInkTrailStartPoint(event: PointerEvent, style: InkTrailStyle) { let this = jsObject - _ = this[Strings.updateInkTrailStartPoint].function!(this: this, arguments: [event.jsValue(), style.jsValue()]) + _ = this[Strings.updateInkTrailStartPoint].function!(this: this, arguments: [event.jsValue, style.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/InkPresenterParam.swift b/Sources/DOMKit/WebIDL/InkPresenterParam.swift index b34a6ffd..e3d26bc6 100644 --- a/Sources/DOMKit/WebIDL/InkPresenterParam.swift +++ b/Sources/DOMKit/WebIDL/InkPresenterParam.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class InkPresenterParam: BridgedDictionary { public convenience init(presentationArea: Element?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.presentationArea] = presentationArea.jsValue() + object[Strings.presentationArea] = presentationArea.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/InkTrailStyle.swift b/Sources/DOMKit/WebIDL/InkTrailStyle.swift index 95fc960e..506cbb6b 100644 --- a/Sources/DOMKit/WebIDL/InkTrailStyle.swift +++ b/Sources/DOMKit/WebIDL/InkTrailStyle.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class InkTrailStyle: BridgedDictionary { public convenience init(color: String, diameter: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.color] = color.jsValue() - object[Strings.diameter] = diameter.jsValue() + object[Strings.color] = color.jsValue + object[Strings.diameter] = diameter.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift b/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift index b5b1d069..2fa5e699 100644 --- a/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift +++ b/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift @@ -15,7 +15,7 @@ public class InputDeviceCapabilities: JSBridgedClass { } @inlinable public convenience init(deviceInitDict: InputDeviceCapabilitiesInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift b/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift index 76797619..bdcc524a 100644 --- a/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift +++ b/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class InputDeviceCapabilitiesInit: BridgedDictionary { public convenience init(firesTouchEvents: Bool, pointerMovementScrolls: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.firesTouchEvents] = firesTouchEvents.jsValue() - object[Strings.pointerMovementScrolls] = pointerMovementScrolls.jsValue() + object[Strings.firesTouchEvents] = firesTouchEvents.jsValue + object[Strings.pointerMovementScrolls] = pointerMovementScrolls.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index 9f3d7523..44dc675d 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -23,7 +23,7 @@ public class InputEvent: UIEvent { } @inlinable public convenience init(type: String, eventInitDict: InputEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift index 8604dfca..22a6fe4f 100644 --- a/Sources/DOMKit/WebIDL/InputEventInit.swift +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class InputEventInit: BridgedDictionary { public convenience init(dataTransfer: DataTransfer?, targetRanges: [StaticRange], data: String?, isComposing: Bool, inputType: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataTransfer] = dataTransfer.jsValue() - object[Strings.targetRanges] = targetRanges.jsValue() - object[Strings.data] = data.jsValue() - object[Strings.isComposing] = isComposing.jsValue() - object[Strings.inputType] = inputType.jsValue() + object[Strings.dataTransfer] = dataTransfer.jsValue + object[Strings.targetRanges] = targetRanges.jsValue + object[Strings.data] = data.jsValue + object[Strings.isComposing] = isComposing.jsValue + object[Strings.inputType] = inputType.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Instance.swift b/Sources/DOMKit/WebIDL/Instance.swift index e0e81831..214d09e9 100644 --- a/Sources/DOMKit/WebIDL/Instance.swift +++ b/Sources/DOMKit/WebIDL/Instance.swift @@ -14,7 +14,7 @@ public class Instance: JSBridgedClass { } @inlinable public convenience init(module: Module, importObject: JSObject? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [module.jsValue(), importObject?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [module.jsValue, importObject?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift b/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift index 7ca404d4..44a7276f 100644 --- a/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift +++ b/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift @@ -21,12 +21,12 @@ public enum Int32Array_or_seq_of_GLsizei: JSValueCompatible, Any_Int32Array_or_s return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .int32Array(int32Array): - return int32Array.jsValue() + return int32Array.jsValue case let .seq_of_GLsizei(seq_of_GLsizei): - return seq_of_GLsizei.jsValue() + return seq_of_GLsizei.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Int32List.swift b/Sources/DOMKit/WebIDL/Int32List.swift index d760b21c..c251a4d6 100644 --- a/Sources/DOMKit/WebIDL/Int32List.swift +++ b/Sources/DOMKit/WebIDL/Int32List.swift @@ -21,12 +21,12 @@ public enum Int32List: JSValueCompatible, Any_Int32List { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .int32Array(int32Array): - return int32Array.jsValue() + return int32Array.jsValue case let .seq_of_GLint(seq_of_GLint): - return seq_of_GLint.jsValue() + return seq_of_GLint.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/IntersectionObserver.swift b/Sources/DOMKit/WebIDL/IntersectionObserver.swift index 66f82a75..32662022 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserver.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserver.swift @@ -28,12 +28,12 @@ public class IntersectionObserver: JSBridgedClass { @inlinable public func observe(target: Element) { let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue()]) + _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue]) } @inlinable public func unobserve(target: Element) { let this = jsObject - _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue()]) + _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue]) } @inlinable public func disconnect() { diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift b/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift index 3d8f5351..e164ecda 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift @@ -20,7 +20,7 @@ public class IntersectionObserverEntry: JSBridgedClass { } @inlinable public convenience init(intersectionObserverEntryInit: IntersectionObserverEntryInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [intersectionObserverEntryInit.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [intersectionObserverEntryInit.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift b/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift index 2b96f7b3..21508182 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class IntersectionObserverEntryInit: BridgedDictionary { public convenience init(time: DOMHighResTimeStamp, rootBounds: DOMRectInit?, boundingClientRect: DOMRectInit, intersectionRect: DOMRectInit, isIntersecting: Bool, intersectionRatio: Double, target: Element) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.time] = time.jsValue() - object[Strings.rootBounds] = rootBounds.jsValue() - object[Strings.boundingClientRect] = boundingClientRect.jsValue() - object[Strings.intersectionRect] = intersectionRect.jsValue() - object[Strings.isIntersecting] = isIntersecting.jsValue() - object[Strings.intersectionRatio] = intersectionRatio.jsValue() - object[Strings.target] = target.jsValue() + object[Strings.time] = time.jsValue + object[Strings.rootBounds] = rootBounds.jsValue + object[Strings.boundingClientRect] = boundingClientRect.jsValue + object[Strings.intersectionRect] = intersectionRect.jsValue + object[Strings.isIntersecting] = isIntersecting.jsValue + object[Strings.intersectionRatio] = intersectionRatio.jsValue + object[Strings.target] = target.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift b/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift index 76fecd9f..c191425d 100644 --- a/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift +++ b/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class IntersectionObserverInit: BridgedDictionary { public convenience init(root: Document_or_Element?, rootMargin: String, threshold: Double_or_seq_of_Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.root] = root.jsValue() - object[Strings.rootMargin] = rootMargin.jsValue() - object[Strings.threshold] = threshold.jsValue() + object[Strings.root] = root.jsValue + object[Strings.rootMargin] = rootMargin.jsValue + object[Strings.threshold] = threshold.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift b/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift index e76c005b..89f7ed83 100644 --- a/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift +++ b/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class IntrinsicSizesResultOptions: BridgedDictionary { public convenience init(maxContentSize: Double, minContentSize: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.maxContentSize] = maxContentSize.jsValue() - object[Strings.minContentSize] = minContentSize.jsValue() + object[Strings.maxContentSize] = maxContentSize.jsValue + object[Strings.minContentSize] = minContentSize.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift b/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift index 2e595936..e6eb4a6a 100644 --- a/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift +++ b/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class IsInputPendingOptions: BridgedDictionary { public convenience init(includeContinuous: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.includeContinuous] = includeContinuous.jsValue() + object[Strings.includeContinuous] = includeContinuous.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ItemDetails.swift b/Sources/DOMKit/WebIDL/ItemDetails.swift index d4fb2db8..719889e1 100644 --- a/Sources/DOMKit/WebIDL/ItemDetails.swift +++ b/Sources/DOMKit/WebIDL/ItemDetails.swift @@ -6,17 +6,17 @@ import JavaScriptKit public class ItemDetails: BridgedDictionary { public convenience init(itemId: String, title: String, price: PaymentCurrencyAmount, type: ItemType, description: String, iconURLs: [String], subscriptionPeriod: String, freeTrialPeriod: String, introductoryPrice: PaymentCurrencyAmount, introductoryPricePeriod: String, introductoryPriceCycles: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.itemId] = itemId.jsValue() - object[Strings.title] = title.jsValue() - object[Strings.price] = price.jsValue() - object[Strings.type] = type.jsValue() - object[Strings.description] = description.jsValue() - object[Strings.iconURLs] = iconURLs.jsValue() - object[Strings.subscriptionPeriod] = subscriptionPeriod.jsValue() - object[Strings.freeTrialPeriod] = freeTrialPeriod.jsValue() - object[Strings.introductoryPrice] = introductoryPrice.jsValue() - object[Strings.introductoryPricePeriod] = introductoryPricePeriod.jsValue() - object[Strings.introductoryPriceCycles] = introductoryPriceCycles.jsValue() + object[Strings.itemId] = itemId.jsValue + object[Strings.title] = title.jsValue + object[Strings.price] = price.jsValue + object[Strings.type] = type.jsValue + object[Strings.description] = description.jsValue + object[Strings.iconURLs] = iconURLs.jsValue + object[Strings.subscriptionPeriod] = subscriptionPeriod.jsValue + object[Strings.freeTrialPeriod] = freeTrialPeriod.jsValue + object[Strings.introductoryPrice] = introductoryPrice.jsValue + object[Strings.introductoryPricePeriod] = introductoryPricePeriod.jsValue + object[Strings.introductoryPriceCycles] = introductoryPriceCycles.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ItemType.swift b/Sources/DOMKit/WebIDL/ItemType.swift index d63eeb77..5a1695eb 100644 --- a/Sources/DOMKit/WebIDL/ItemType.swift +++ b/Sources/DOMKit/WebIDL/ItemType.swift @@ -18,5 +18,5 @@ public enum ItemType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift b/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift index 578d12ce..282f8955 100644 --- a/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift +++ b/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift @@ -18,5 +18,5 @@ public enum IterationCompositeOperation: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/JsonWebKey.swift b/Sources/DOMKit/WebIDL/JsonWebKey.swift index 91348ba9..f403efe3 100644 --- a/Sources/DOMKit/WebIDL/JsonWebKey.swift +++ b/Sources/DOMKit/WebIDL/JsonWebKey.swift @@ -6,24 +6,24 @@ import JavaScriptKit public class JsonWebKey: BridgedDictionary { public convenience init(kty: String, use: String, key_ops: [String], alg: String, ext: Bool, crv: String, x: String, y: String, d: String, n: String, e: String, p: String, q: String, dp: String, dq: String, qi: String, oth: [RsaOtherPrimesInfo], k: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.kty] = kty.jsValue() - object[Strings.use] = use.jsValue() - object[Strings.key_ops] = key_ops.jsValue() - object[Strings.alg] = alg.jsValue() - object[Strings.ext] = ext.jsValue() - object[Strings.crv] = crv.jsValue() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.d] = d.jsValue() - object[Strings.n] = n.jsValue() - object[Strings.e] = e.jsValue() - object[Strings.p] = p.jsValue() - object[Strings.q] = q.jsValue() - object[Strings.dp] = dp.jsValue() - object[Strings.dq] = dq.jsValue() - object[Strings.qi] = qi.jsValue() - object[Strings.oth] = oth.jsValue() - object[Strings.k] = k.jsValue() + object[Strings.kty] = kty.jsValue + object[Strings.use] = use.jsValue + object[Strings.key_ops] = key_ops.jsValue + object[Strings.alg] = alg.jsValue + object[Strings.ext] = ext.jsValue + object[Strings.crv] = crv.jsValue + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.d] = d.jsValue + object[Strings.n] = n.jsValue + object[Strings.e] = e.jsValue + object[Strings.p] = p.jsValue + object[Strings.q] = q.jsValue + object[Strings.dp] = dp.jsValue + object[Strings.dq] = dq.jsValue + object[Strings.qi] = qi.jsValue + object[Strings.oth] = oth.jsValue + object[Strings.k] = k.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/KeyAlgorithm.swift b/Sources/DOMKit/WebIDL/KeyAlgorithm.swift index a3c3a16f..9cdf95f5 100644 --- a/Sources/DOMKit/WebIDL/KeyAlgorithm.swift +++ b/Sources/DOMKit/WebIDL/KeyAlgorithm.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class KeyAlgorithm: BridgedDictionary { public convenience init(name: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() + object[Strings.name] = name.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/KeyFormat.swift b/Sources/DOMKit/WebIDL/KeyFormat.swift index b64c36a9..990af1f5 100644 --- a/Sources/DOMKit/WebIDL/KeyFormat.swift +++ b/Sources/DOMKit/WebIDL/KeyFormat.swift @@ -20,5 +20,5 @@ public enum KeyFormat: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift b/Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift index b69f53f3..4518ec1f 100644 --- a/Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift +++ b/Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class KeySystemTrackConfiguration: BridgedDictionary { public convenience init(robustness: String, encryptionScheme: String?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.robustness] = robustness.jsValue() - object[Strings.encryptionScheme] = encryptionScheme.jsValue() + object[Strings.robustness] = robustness.jsValue + object[Strings.encryptionScheme] = encryptionScheme.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/KeyType.swift b/Sources/DOMKit/WebIDL/KeyType.swift index 4e8cb671..e547bf2f 100644 --- a/Sources/DOMKit/WebIDL/KeyType.swift +++ b/Sources/DOMKit/WebIDL/KeyType.swift @@ -19,5 +19,5 @@ public enum KeyType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/KeyUsage.swift b/Sources/DOMKit/WebIDL/KeyUsage.swift index 5b527601..ca26fc12 100644 --- a/Sources/DOMKit/WebIDL/KeyUsage.swift +++ b/Sources/DOMKit/WebIDL/KeyUsage.swift @@ -24,5 +24,5 @@ public enum KeyUsage: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Keyboard.swift b/Sources/DOMKit/WebIDL/Keyboard.swift index 199b193e..63a8d41c 100644 --- a/Sources/DOMKit/WebIDL/Keyboard.swift +++ b/Sources/DOMKit/WebIDL/Keyboard.swift @@ -13,14 +13,14 @@ public class Keyboard: EventTarget { @inlinable public func lock(keyCodes: [String]? = nil) -> JSPromise { let this = jsObject - return this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func lock(keyCodes: [String]? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func unlock() { @@ -37,7 +37,7 @@ public class Keyboard: EventTarget { @inlinable public func getLayoutMap() async throws -> KeyboardLayoutMap { let this = jsObject let _promise: JSPromise = this[Strings.getLayoutMap].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/KeyboardEvent.swift b/Sources/DOMKit/WebIDL/KeyboardEvent.swift index 27a953ca..7f3b07a7 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEvent.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEvent.swift @@ -22,7 +22,7 @@ public class KeyboardEvent: UIEvent { } @inlinable public convenience init(type: String, eventInitDict: KeyboardEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } public static let DOM_KEY_LOCATION_STANDARD: UInt32 = 0x00 @@ -62,20 +62,20 @@ public class KeyboardEvent: UIEvent { @inlinable public func getModifierState(keyArg: String) -> Bool { let this = jsObject - return this[Strings.getModifierState].function!(this: this, arguments: [keyArg.jsValue()]).fromJSValue()! + return this[Strings.getModifierState].function!(this: this, arguments: [keyArg.jsValue]).fromJSValue()! } @inlinable public func initKeyboardEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, keyArg: String? = nil, locationArg: UInt32? = nil, ctrlKey: Bool? = nil, altKey: Bool? = nil, shiftKey: Bool? = nil, metaKey: Bool? = nil) { - let _arg0 = typeArg.jsValue() - let _arg1 = bubblesArg?.jsValue() ?? .undefined - let _arg2 = cancelableArg?.jsValue() ?? .undefined - let _arg3 = viewArg?.jsValue() ?? .undefined - let _arg4 = keyArg?.jsValue() ?? .undefined - let _arg5 = locationArg?.jsValue() ?? .undefined - let _arg6 = ctrlKey?.jsValue() ?? .undefined - let _arg7 = altKey?.jsValue() ?? .undefined - let _arg8 = shiftKey?.jsValue() ?? .undefined - let _arg9 = metaKey?.jsValue() ?? .undefined + let _arg0 = typeArg.jsValue + let _arg1 = bubblesArg?.jsValue ?? .undefined + let _arg2 = cancelableArg?.jsValue ?? .undefined + let _arg3 = viewArg?.jsValue ?? .undefined + let _arg4 = keyArg?.jsValue ?? .undefined + let _arg5 = locationArg?.jsValue ?? .undefined + let _arg6 = ctrlKey?.jsValue ?? .undefined + let _arg7 = altKey?.jsValue ?? .undefined + let _arg8 = shiftKey?.jsValue ?? .undefined + let _arg9 = metaKey?.jsValue ?? .undefined let this = jsObject _ = this[Strings.initKeyboardEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } diff --git a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift index afc8114b..2dc21725 100644 --- a/Sources/DOMKit/WebIDL/KeyboardEventInit.swift +++ b/Sources/DOMKit/WebIDL/KeyboardEventInit.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class KeyboardEventInit: BridgedDictionary { public convenience init(key: String, code: String, location: UInt32, repeat: Bool, isComposing: Bool, charCode: UInt32, keyCode: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.key] = key.jsValue() - object[Strings.code] = code.jsValue() - object[Strings.location] = location.jsValue() - object[Strings.repeat] = `repeat`.jsValue() - object[Strings.isComposing] = isComposing.jsValue() - object[Strings.charCode] = charCode.jsValue() - object[Strings.keyCode] = keyCode.jsValue() + object[Strings.key] = key.jsValue + object[Strings.code] = code.jsValue + object[Strings.location] = location.jsValue + object[Strings.repeat] = `repeat`.jsValue + object[Strings.isComposing] = isComposing.jsValue + object[Strings.charCode] = charCode.jsValue + object[Strings.keyCode] = keyCode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/KeyframeAnimationOptions.swift b/Sources/DOMKit/WebIDL/KeyframeAnimationOptions.swift index 342bef86..0568c226 100644 --- a/Sources/DOMKit/WebIDL/KeyframeAnimationOptions.swift +++ b/Sources/DOMKit/WebIDL/KeyframeAnimationOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class KeyframeAnimationOptions: BridgedDictionary { public convenience init(id: String, timeline: AnimationTimeline?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue() - object[Strings.timeline] = timeline.jsValue() + object[Strings.id] = id.jsValue + object[Strings.timeline] = timeline.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/KeyframeEffect.swift b/Sources/DOMKit/WebIDL/KeyframeEffect.swift index c459622e..6c560b1d 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffect.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffect.swift @@ -18,11 +18,11 @@ public class KeyframeEffect: AnimationEffect { public var iterationComposite: IterationCompositeOperation @inlinable public convenience init(target: Element?, keyframes: JSObject?, options: Double_or_KeyframeEffectOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [target.jsValue(), keyframes.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [target.jsValue, keyframes.jsValue, options?.jsValue ?? .undefined])) } @inlinable public convenience init(source: KeyframeEffect) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue])) } @ReadWriteAttribute @@ -41,6 +41,6 @@ public class KeyframeEffect: AnimationEffect { @inlinable public func setKeyframes(keyframes: JSObject?) { let this = jsObject - _ = this[Strings.setKeyframes].function!(this: this, arguments: [keyframes.jsValue()]) + _ = this[Strings.setKeyframes].function!(this: this, arguments: [keyframes.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift index b0a790a7..6db4c613 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class KeyframeEffectOptions: BridgedDictionary { public convenience init(iterationComposite: IterationCompositeOperation, composite: CompositeOperation, pseudoElement: String?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iterationComposite] = iterationComposite.jsValue() - object[Strings.composite] = composite.jsValue() - object[Strings.pseudoElement] = pseudoElement.jsValue() + object[Strings.iterationComposite] = iterationComposite.jsValue + object[Strings.composite] = composite.jsValue + object[Strings.pseudoElement] = pseudoElement.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Landmark.swift b/Sources/DOMKit/WebIDL/Landmark.swift index 7b3c4dbf..2f020458 100644 --- a/Sources/DOMKit/WebIDL/Landmark.swift +++ b/Sources/DOMKit/WebIDL/Landmark.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class Landmark: BridgedDictionary { public convenience init(locations: [Point2D], type: LandmarkType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.locations] = locations.jsValue() - object[Strings.type] = type.jsValue() + object[Strings.locations] = locations.jsValue + object[Strings.type] = type.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/LandmarkType.swift b/Sources/DOMKit/WebIDL/LandmarkType.swift index 6b33a834..277a8376 100644 --- a/Sources/DOMKit/WebIDL/LandmarkType.swift +++ b/Sources/DOMKit/WebIDL/LandmarkType.swift @@ -19,5 +19,5 @@ public enum LandmarkType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/LargeBlobSupport.swift b/Sources/DOMKit/WebIDL/LargeBlobSupport.swift index 5a7a92e9..26959708 100644 --- a/Sources/DOMKit/WebIDL/LargeBlobSupport.swift +++ b/Sources/DOMKit/WebIDL/LargeBlobSupport.swift @@ -18,5 +18,5 @@ public enum LargeBlobSupport: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/LatencyMode.swift b/Sources/DOMKit/WebIDL/LatencyMode.swift index 45c391c2..d4aa61af 100644 --- a/Sources/DOMKit/WebIDL/LatencyMode.swift +++ b/Sources/DOMKit/WebIDL/LatencyMode.swift @@ -18,5 +18,5 @@ public enum LatencyMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift b/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift index 83297aa2..c6721698 100644 --- a/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift +++ b/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class LayoutConstraintsOptions: BridgedDictionary { public convenience init(availableInlineSize: Double, availableBlockSize: Double, fixedInlineSize: Double, fixedBlockSize: Double, percentageInlineSize: Double, percentageBlockSize: Double, blockFragmentationOffset: Double, blockFragmentationType: BlockFragmentationType, data: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.availableInlineSize] = availableInlineSize.jsValue() - object[Strings.availableBlockSize] = availableBlockSize.jsValue() - object[Strings.fixedInlineSize] = fixedInlineSize.jsValue() - object[Strings.fixedBlockSize] = fixedBlockSize.jsValue() - object[Strings.percentageInlineSize] = percentageInlineSize.jsValue() - object[Strings.percentageBlockSize] = percentageBlockSize.jsValue() - object[Strings.blockFragmentationOffset] = blockFragmentationOffset.jsValue() - object[Strings.blockFragmentationType] = blockFragmentationType.jsValue() - object[Strings.data] = data.jsValue() + object[Strings.availableInlineSize] = availableInlineSize.jsValue + object[Strings.availableBlockSize] = availableBlockSize.jsValue + object[Strings.fixedInlineSize] = fixedInlineSize.jsValue + object[Strings.fixedBlockSize] = fixedBlockSize.jsValue + object[Strings.percentageInlineSize] = percentageInlineSize.jsValue + object[Strings.percentageBlockSize] = percentageBlockSize.jsValue + object[Strings.blockFragmentationOffset] = blockFragmentationOffset.jsValue + object[Strings.blockFragmentationType] = blockFragmentationType.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/LayoutOptions.swift b/Sources/DOMKit/WebIDL/LayoutOptions.swift index fcde2bde..8c2538d8 100644 --- a/Sources/DOMKit/WebIDL/LayoutOptions.swift +++ b/Sources/DOMKit/WebIDL/LayoutOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class LayoutOptions: BridgedDictionary { public convenience init(childDisplay: ChildDisplayType, sizing: LayoutSizingMode) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.childDisplay] = childDisplay.jsValue() - object[Strings.sizing] = sizing.jsValue() + object[Strings.childDisplay] = childDisplay.jsValue + object[Strings.sizing] = sizing.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/LayoutSizingMode.swift b/Sources/DOMKit/WebIDL/LayoutSizingMode.swift index 3f532ad9..28b0851b 100644 --- a/Sources/DOMKit/WebIDL/LayoutSizingMode.swift +++ b/Sources/DOMKit/WebIDL/LayoutSizingMode.swift @@ -18,5 +18,5 @@ public enum LayoutSizingMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/LineAlignSetting.swift b/Sources/DOMKit/WebIDL/LineAlignSetting.swift index ce613de1..0275ca7b 100644 --- a/Sources/DOMKit/WebIDL/LineAlignSetting.swift +++ b/Sources/DOMKit/WebIDL/LineAlignSetting.swift @@ -19,5 +19,5 @@ public enum LineAlignSetting: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/LineAndPositionSetting.swift b/Sources/DOMKit/WebIDL/LineAndPositionSetting.swift index 20ff97dc..a929527f 100644 --- a/Sources/DOMKit/WebIDL/LineAndPositionSetting.swift +++ b/Sources/DOMKit/WebIDL/LineAndPositionSetting.swift @@ -21,12 +21,12 @@ public enum LineAndPositionSetting: JSValueCompatible, Any_LineAndPositionSettin return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .autoKeyword(autoKeyword): - return autoKeyword.jsValue() + return autoKeyword.jsValue case let .double(double): - return double.jsValue() + return double.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift b/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift index a177a42b..8f50b1ae 100644 --- a/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift +++ b/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift @@ -11,6 +11,6 @@ public class LinearAccelerationSensor: Accelerometer { } @inlinable public convenience init(options: AccelerometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/Location.swift b/Sources/DOMKit/WebIDL/Location.swift index bed2e134..525aa304 100644 --- a/Sources/DOMKit/WebIDL/Location.swift +++ b/Sources/DOMKit/WebIDL/Location.swift @@ -51,12 +51,12 @@ public class Location: JSBridgedClass { @inlinable public func assign(url: String) { let this = jsObject - _ = this[Strings.assign].function!(this: this, arguments: [url.jsValue()]) + _ = this[Strings.assign].function!(this: this, arguments: [url.jsValue]) } @inlinable public func replace(url: String) { let this = jsObject - _ = this[Strings.replace].function!(this: this, arguments: [url.jsValue()]) + _ = this[Strings.replace].function!(this: this, arguments: [url.jsValue]) } @inlinable public func reload() { diff --git a/Sources/DOMKit/WebIDL/LockInfo.swift b/Sources/DOMKit/WebIDL/LockInfo.swift index 5108be0b..14a499d0 100644 --- a/Sources/DOMKit/WebIDL/LockInfo.swift +++ b/Sources/DOMKit/WebIDL/LockInfo.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class LockInfo: BridgedDictionary { public convenience init(name: String, mode: LockMode, clientId: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.mode] = mode.jsValue() - object[Strings.clientId] = clientId.jsValue() + object[Strings.name] = name.jsValue + object[Strings.mode] = mode.jsValue + object[Strings.clientId] = clientId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/LockManager.swift b/Sources/DOMKit/WebIDL/LockManager.swift index d6afa67e..edc20d31 100644 --- a/Sources/DOMKit/WebIDL/LockManager.swift +++ b/Sources/DOMKit/WebIDL/LockManager.swift @@ -29,6 +29,6 @@ public class LockManager: JSBridgedClass { @inlinable public func query() async throws -> LockManagerSnapshot { let this = jsObject let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift b/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift index e89f71e5..4e6e9221 100644 --- a/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift +++ b/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class LockManagerSnapshot: BridgedDictionary { public convenience init(held: [LockInfo], pending: [LockInfo]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.held] = held.jsValue() - object[Strings.pending] = pending.jsValue() + object[Strings.held] = held.jsValue + object[Strings.pending] = pending.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/LockMode.swift b/Sources/DOMKit/WebIDL/LockMode.swift index 99110974..e714cae0 100644 --- a/Sources/DOMKit/WebIDL/LockMode.swift +++ b/Sources/DOMKit/WebIDL/LockMode.swift @@ -18,5 +18,5 @@ public enum LockMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/LockOptions.swift b/Sources/DOMKit/WebIDL/LockOptions.swift index d1612df4..0dee3386 100644 --- a/Sources/DOMKit/WebIDL/LockOptions.swift +++ b/Sources/DOMKit/WebIDL/LockOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class LockOptions: BridgedDictionary { public convenience init(mode: LockMode, ifAvailable: Bool, steal: Bool, signal: AbortSignal) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue() - object[Strings.ifAvailable] = ifAvailable.jsValue() - object[Strings.steal] = steal.jsValue() - object[Strings.signal] = signal.jsValue() + object[Strings.mode] = mode.jsValue + object[Strings.ifAvailable] = ifAvailable.jsValue + object[Strings.steal] = steal.jsValue + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift b/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift index e2a85ded..17fbad89 100644 --- a/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift +++ b/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift @@ -12,7 +12,7 @@ public class MIDIConnectionEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: MIDIConnectionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift b/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift index ae3775b9..0481f338 100644 --- a/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift +++ b/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MIDIConnectionEventInit: BridgedDictionary { public convenience init(port: MIDIPort) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.port] = port.jsValue() + object[Strings.port] = port.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift b/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift index 3bc1404b..f7b34d51 100644 --- a/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift @@ -12,7 +12,7 @@ public class MIDIMessageEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: MIDIMessageEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift b/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift index 5569e95e..f7951e61 100644 --- a/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift +++ b/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MIDIMessageEventInit: BridgedDictionary { public convenience init(data: Uint8Array) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.data] = data.jsValue() + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MIDIOptions.swift b/Sources/DOMKit/WebIDL/MIDIOptions.swift index 62d317c7..b5367f5a 100644 --- a/Sources/DOMKit/WebIDL/MIDIOptions.swift +++ b/Sources/DOMKit/WebIDL/MIDIOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MIDIOptions: BridgedDictionary { public convenience init(sysex: Bool, software: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sysex] = sysex.jsValue() - object[Strings.software] = software.jsValue() + object[Strings.sysex] = sysex.jsValue + object[Strings.software] = software.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MIDIOutput.swift b/Sources/DOMKit/WebIDL/MIDIOutput.swift index 70505bed..80b6bded 100644 --- a/Sources/DOMKit/WebIDL/MIDIOutput.swift +++ b/Sources/DOMKit/WebIDL/MIDIOutput.swift @@ -12,7 +12,7 @@ public class MIDIOutput: MIDIPort { @inlinable public func send(data: [UInt8], timestamp: DOMHighResTimeStamp? = nil) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue(), timestamp?.jsValue() ?? .undefined]) + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue, timestamp?.jsValue ?? .undefined]) } @inlinable public func clear() { diff --git a/Sources/DOMKit/WebIDL/MIDIPort.swift b/Sources/DOMKit/WebIDL/MIDIPort.swift index 93f5e342..2d7042fd 100644 --- a/Sources/DOMKit/WebIDL/MIDIPort.swift +++ b/Sources/DOMKit/WebIDL/MIDIPort.swift @@ -51,7 +51,7 @@ public class MIDIPort: EventTarget { @inlinable public func open() async throws -> MIDIPort { let this = jsObject let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func close() -> JSPromise { @@ -63,6 +63,6 @@ public class MIDIPort: EventTarget { @inlinable public func close() async throws -> MIDIPort { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift b/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift index f8f28668..361b16d6 100644 --- a/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift +++ b/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift @@ -19,5 +19,5 @@ public enum MIDIPortConnectionState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift b/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift index e363acec..5ee64b87 100644 --- a/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift +++ b/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift @@ -18,5 +18,5 @@ public enum MIDIPortDeviceState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MIDIPortType.swift b/Sources/DOMKit/WebIDL/MIDIPortType.swift index 16b6f850..eacda4b0 100644 --- a/Sources/DOMKit/WebIDL/MIDIPortType.swift +++ b/Sources/DOMKit/WebIDL/MIDIPortType.swift @@ -18,5 +18,5 @@ public enum MIDIPortType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ML.swift b/Sources/DOMKit/WebIDL/ML.swift index ca8912a5..53e3ae30 100644 --- a/Sources/DOMKit/WebIDL/ML.swift +++ b/Sources/DOMKit/WebIDL/ML.swift @@ -14,16 +14,16 @@ public class ML: JSBridgedClass { @inlinable public func createContext(options: MLContextOptions? = nil) -> MLContext { let this = jsObject - return this[Strings.createContext].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createContext].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createContext(glContext: WebGLRenderingContext) -> MLContext { let this = jsObject - return this[Strings.createContext].function!(this: this, arguments: [glContext.jsValue()]).fromJSValue()! + return this[Strings.createContext].function!(this: this, arguments: [glContext.jsValue]).fromJSValue()! } @inlinable public func createContext(gpuDevice: GPUDevice) -> MLContext { let this = jsObject - return this[Strings.createContext].function!(this: this, arguments: [gpuDevice.jsValue()]).fromJSValue()! + return this[Strings.createContext].function!(this: this, arguments: [gpuDevice.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MLAutoPad.swift b/Sources/DOMKit/WebIDL/MLAutoPad.swift index 48180d41..0def6e1d 100644 --- a/Sources/DOMKit/WebIDL/MLAutoPad.swift +++ b/Sources/DOMKit/WebIDL/MLAutoPad.swift @@ -19,5 +19,5 @@ public enum MLAutoPad: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift b/Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift index 0c561831..f6aed4f2 100644 --- a/Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift +++ b/Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class MLBatchNormalizationOptions: BridgedDictionary { public convenience init(scale: MLOperand, bias: MLOperand, axis: Int32, epsilon: Float, activation: MLOperator) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.scale] = scale.jsValue() - object[Strings.bias] = bias.jsValue() - object[Strings.axis] = axis.jsValue() - object[Strings.epsilon] = epsilon.jsValue() - object[Strings.activation] = activation.jsValue() + object[Strings.scale] = scale.jsValue + object[Strings.bias] = bias.jsValue + object[Strings.axis] = axis.jsValue + object[Strings.epsilon] = epsilon.jsValue + object[Strings.activation] = activation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLBufferResourceView.swift b/Sources/DOMKit/WebIDL/MLBufferResourceView.swift index 8ff4925e..329c531d 100644 --- a/Sources/DOMKit/WebIDL/MLBufferResourceView.swift +++ b/Sources/DOMKit/WebIDL/MLBufferResourceView.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MLBufferResourceView: BridgedDictionary { public convenience init(resource: GPUBuffer_or_WebGLBuffer, offset: UInt64, size: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.resource] = resource.jsValue() - object[Strings.offset] = offset.jsValue() - object[Strings.size] = size.jsValue() + object[Strings.resource] = resource.jsValue + object[Strings.offset] = offset.jsValue + object[Strings.size] = size.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLBufferView.swift b/Sources/DOMKit/WebIDL/MLBufferView.swift index 2d40ccbe..3961d095 100644 --- a/Sources/DOMKit/WebIDL/MLBufferView.swift +++ b/Sources/DOMKit/WebIDL/MLBufferView.swift @@ -21,12 +21,12 @@ public enum MLBufferView: JSValueCompatible, Any_MLBufferView { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .arrayBufferView(arrayBufferView): - return arrayBufferView.jsValue() + return arrayBufferView.jsValue case let .mLBufferResourceView(mLBufferResourceView): - return mLBufferResourceView.jsValue() + return mLBufferResourceView.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/MLClampOptions.swift b/Sources/DOMKit/WebIDL/MLClampOptions.swift index 9c9ead0e..bde88166 100644 --- a/Sources/DOMKit/WebIDL/MLClampOptions.swift +++ b/Sources/DOMKit/WebIDL/MLClampOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MLClampOptions: BridgedDictionary { public convenience init(minValue: Float, maxValue: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.minValue] = minValue.jsValue() - object[Strings.maxValue] = maxValue.jsValue() + object[Strings.minValue] = minValue.jsValue + object[Strings.maxValue] = maxValue.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLContextOptions.swift b/Sources/DOMKit/WebIDL/MLContextOptions.swift index f3261fef..bbfba5fa 100644 --- a/Sources/DOMKit/WebIDL/MLContextOptions.swift +++ b/Sources/DOMKit/WebIDL/MLContextOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MLContextOptions: BridgedDictionary { public convenience init(devicePreference: MLDevicePreference, powerPreference: MLPowerPreference) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.devicePreference] = devicePreference.jsValue() - object[Strings.powerPreference] = powerPreference.jsValue() + object[Strings.devicePreference] = devicePreference.jsValue + object[Strings.powerPreference] = powerPreference.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift b/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift index 76416323..b4ae617c 100644 --- a/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift +++ b/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift @@ -20,5 +20,5 @@ public enum MLConv2dFilterOperandLayout: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLConv2dOptions.swift b/Sources/DOMKit/WebIDL/MLConv2dOptions.swift index ab4a4322..68a654af 100644 --- a/Sources/DOMKit/WebIDL/MLConv2dOptions.swift +++ b/Sources/DOMKit/WebIDL/MLConv2dOptions.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class MLConv2dOptions: BridgedDictionary { public convenience init(padding: [Int32], strides: [Int32], dilations: [Int32], autoPad: MLAutoPad, groups: Int32, inputLayout: MLInputOperandLayout, filterLayout: MLConv2dFilterOperandLayout, bias: MLOperand, activation: MLOperator) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.padding] = padding.jsValue() - object[Strings.strides] = strides.jsValue() - object[Strings.dilations] = dilations.jsValue() - object[Strings.autoPad] = autoPad.jsValue() - object[Strings.groups] = groups.jsValue() - object[Strings.inputLayout] = inputLayout.jsValue() - object[Strings.filterLayout] = filterLayout.jsValue() - object[Strings.bias] = bias.jsValue() - object[Strings.activation] = activation.jsValue() + object[Strings.padding] = padding.jsValue + object[Strings.strides] = strides.jsValue + object[Strings.dilations] = dilations.jsValue + object[Strings.autoPad] = autoPad.jsValue + object[Strings.groups] = groups.jsValue + object[Strings.inputLayout] = inputLayout.jsValue + object[Strings.filterLayout] = filterLayout.jsValue + object[Strings.bias] = bias.jsValue + object[Strings.activation] = activation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift b/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift index 8f5294a3..2bf00eff 100644 --- a/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift +++ b/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift @@ -19,5 +19,5 @@ public enum MLConvTranspose2dFilterOperandLayout: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift b/Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift index 4e7652be..110addf4 100644 --- a/Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift +++ b/Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift @@ -6,17 +6,17 @@ import JavaScriptKit public class MLConvTranspose2dOptions: BridgedDictionary { public convenience init(padding: [Int32], strides: [Int32], dilations: [Int32], outputPadding: [Int32], outputSizes: [Int32], autoPad: MLAutoPad, groups: Int32, inputLayout: MLInputOperandLayout, filterLayout: MLConvTranspose2dFilterOperandLayout, bias: MLOperand, activation: MLOperator) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.padding] = padding.jsValue() - object[Strings.strides] = strides.jsValue() - object[Strings.dilations] = dilations.jsValue() - object[Strings.outputPadding] = outputPadding.jsValue() - object[Strings.outputSizes] = outputSizes.jsValue() - object[Strings.autoPad] = autoPad.jsValue() - object[Strings.groups] = groups.jsValue() - object[Strings.inputLayout] = inputLayout.jsValue() - object[Strings.filterLayout] = filterLayout.jsValue() - object[Strings.bias] = bias.jsValue() - object[Strings.activation] = activation.jsValue() + object[Strings.padding] = padding.jsValue + object[Strings.strides] = strides.jsValue + object[Strings.dilations] = dilations.jsValue + object[Strings.outputPadding] = outputPadding.jsValue + object[Strings.outputSizes] = outputSizes.jsValue + object[Strings.autoPad] = autoPad.jsValue + object[Strings.groups] = groups.jsValue + object[Strings.inputLayout] = inputLayout.jsValue + object[Strings.filterLayout] = filterLayout.jsValue + object[Strings.bias] = bias.jsValue + object[Strings.activation] = activation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLDevicePreference.swift b/Sources/DOMKit/WebIDL/MLDevicePreference.swift index 5be40d72..eade9d08 100644 --- a/Sources/DOMKit/WebIDL/MLDevicePreference.swift +++ b/Sources/DOMKit/WebIDL/MLDevicePreference.swift @@ -19,5 +19,5 @@ public enum MLDevicePreference: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLEluOptions.swift b/Sources/DOMKit/WebIDL/MLEluOptions.swift index 41b8a4a9..34324736 100644 --- a/Sources/DOMKit/WebIDL/MLEluOptions.swift +++ b/Sources/DOMKit/WebIDL/MLEluOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MLEluOptions: BridgedDictionary { public convenience init(alpha: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue() + object[Strings.alpha] = alpha.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLGemmOptions.swift b/Sources/DOMKit/WebIDL/MLGemmOptions.swift index 5166b974..078be4c2 100644 --- a/Sources/DOMKit/WebIDL/MLGemmOptions.swift +++ b/Sources/DOMKit/WebIDL/MLGemmOptions.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class MLGemmOptions: BridgedDictionary { public convenience init(c: MLOperand, alpha: Float, beta: Float, aTranspose: Bool, bTranspose: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.c] = c.jsValue() - object[Strings.alpha] = alpha.jsValue() - object[Strings.beta] = beta.jsValue() - object[Strings.aTranspose] = aTranspose.jsValue() - object[Strings.bTranspose] = bTranspose.jsValue() + object[Strings.c] = c.jsValue + object[Strings.alpha] = alpha.jsValue + object[Strings.beta] = beta.jsValue + object[Strings.aTranspose] = aTranspose.jsValue + object[Strings.bTranspose] = bTranspose.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLGraph.swift b/Sources/DOMKit/WebIDL/MLGraph.swift index 293b8e5c..c50f03de 100644 --- a/Sources/DOMKit/WebIDL/MLGraph.swift +++ b/Sources/DOMKit/WebIDL/MLGraph.swift @@ -14,6 +14,6 @@ public class MLGraph: JSBridgedClass { @inlinable public func compute(inputs: MLNamedInputs, outputs: MLNamedOutputs) { let this = jsObject - _ = this[Strings.compute].function!(this: this, arguments: [inputs.jsValue(), outputs.jsValue()]) + _ = this[Strings.compute].function!(this: this, arguments: [inputs.jsValue, outputs.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift index a72a7c2c..9999a795 100644 --- a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift +++ b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift @@ -13,189 +13,189 @@ public class MLGraphBuilder: JSBridgedClass { } @inlinable public convenience init(context: MLContext) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue])) } @inlinable public func input(name: String, desc: MLOperandDescriptor) -> MLOperand { let this = jsObject - return this[Strings.input].function!(this: this, arguments: [name.jsValue(), desc.jsValue()]).fromJSValue()! + return this[Strings.input].function!(this: this, arguments: [name.jsValue, desc.jsValue]).fromJSValue()! } @inlinable public func constant(desc: MLOperandDescriptor, bufferView: MLBufferView) -> MLOperand { let this = jsObject - return this[Strings.constant].function!(this: this, arguments: [desc.jsValue(), bufferView.jsValue()]).fromJSValue()! + return this[Strings.constant].function!(this: this, arguments: [desc.jsValue, bufferView.jsValue]).fromJSValue()! } @inlinable public func constant(value: Double, type: MLOperandType? = nil) -> MLOperand { let this = jsObject - return this[Strings.constant].function!(this: this, arguments: [value.jsValue(), type?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.constant].function!(this: this, arguments: [value.jsValue, type?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func build(outputs: MLNamedOperands) -> MLGraph { let this = jsObject - return this[Strings.build].function!(this: this, arguments: [outputs.jsValue()]).fromJSValue()! + return this[Strings.build].function!(this: this, arguments: [outputs.jsValue]).fromJSValue()! } @inlinable public func batchNormalization(input: MLOperand, mean: MLOperand, variance: MLOperand, options: MLBatchNormalizationOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.batchNormalization].function!(this: this, arguments: [input.jsValue(), mean.jsValue(), variance.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.batchNormalization].function!(this: this, arguments: [input.jsValue, mean.jsValue, variance.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func clamp(x: MLOperand, options: MLClampOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.clamp].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.clamp].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func clamp(options: MLClampOptions? = nil) -> MLOperator { let this = jsObject - return this[Strings.clamp].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.clamp].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func concat(inputs: [MLOperand], axis: Int32) -> MLOperand { let this = jsObject - return this[Strings.concat].function!(this: this, arguments: [inputs.jsValue(), axis.jsValue()]).fromJSValue()! + return this[Strings.concat].function!(this: this, arguments: [inputs.jsValue, axis.jsValue]).fromJSValue()! } @inlinable public func conv2d(input: MLOperand, filter: MLOperand, options: MLConv2dOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.conv2d].function!(this: this, arguments: [input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.conv2d].function!(this: this, arguments: [input.jsValue, filter.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func convTranspose2d(input: MLOperand, filter: MLOperand, options: MLConvTranspose2dOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.convTranspose2d].function!(this: this, arguments: [input.jsValue(), filter.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.convTranspose2d].function!(this: this, arguments: [input.jsValue, filter.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func add(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.add].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! + return this[Strings.add].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! } @inlinable public func sub(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.sub].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! + return this[Strings.sub].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! } @inlinable public func mul(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.mul].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! + return this[Strings.mul].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! } @inlinable public func div(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.div].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! + return this[Strings.div].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! } @inlinable public func max(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.max].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! + return this[Strings.max].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! } @inlinable public func min(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.min].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! + return this[Strings.min].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! } @inlinable public func pow(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.pow].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! + return this[Strings.pow].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! } @inlinable public func abs(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.abs].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.abs].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func ceil(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.ceil].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.ceil].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func cos(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.cos].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.cos].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func exp(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.exp].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.exp].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func floor(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.floor].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.floor].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func log(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.log].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.log].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func neg(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.neg].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.neg].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func sin(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.sin].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.sin].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func tan(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.tan].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.tan].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func elu(x: MLOperand, options: MLEluOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.elu].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.elu].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func elu(options: MLEluOptions? = nil) -> MLOperator { let this = jsObject - return this[Strings.elu].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.elu].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func gemm(a: MLOperand, b: MLOperand, options: MLGemmOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.gemm].function!(this: this, arguments: [a.jsValue(), b.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.gemm].function!(this: this, arguments: [a.jsValue, b.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func gru(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, steps: Int32, hiddenSize: Int32, options: MLGruOptions? = nil) -> [MLOperand] { - let _arg0 = input.jsValue() - let _arg1 = weight.jsValue() - let _arg2 = recurrentWeight.jsValue() - let _arg3 = steps.jsValue() - let _arg4 = hiddenSize.jsValue() - let _arg5 = options?.jsValue() ?? .undefined + let _arg0 = input.jsValue + let _arg1 = weight.jsValue + let _arg2 = recurrentWeight.jsValue + let _arg3 = steps.jsValue + let _arg4 = hiddenSize.jsValue + let _arg5 = options?.jsValue ?? .undefined let this = jsObject return this[Strings.gru].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } @inlinable public func gruCell(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, hiddenState: MLOperand, hiddenSize: Int32, options: MLGruCellOptions? = nil) -> MLOperand { - let _arg0 = input.jsValue() - let _arg1 = weight.jsValue() - let _arg2 = recurrentWeight.jsValue() - let _arg3 = hiddenState.jsValue() - let _arg4 = hiddenSize.jsValue() - let _arg5 = options?.jsValue() ?? .undefined + let _arg0 = input.jsValue + let _arg1 = weight.jsValue + let _arg2 = recurrentWeight.jsValue + let _arg3 = hiddenState.jsValue + let _arg4 = hiddenSize.jsValue + let _arg5 = options?.jsValue ?? .undefined let this = jsObject return this[Strings.gruCell].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } @inlinable public func hardSigmoid(x: MLOperand, options: MLHardSigmoidOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.hardSigmoid].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.hardSigmoid].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func hardSigmoid(options: MLHardSigmoidOptions? = nil) -> MLOperator { let this = jsObject - return this[Strings.hardSigmoid].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.hardSigmoid].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func hardSwish(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.hardSwish].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.hardSwish].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func hardSwish() -> MLOperator { @@ -205,107 +205,107 @@ public class MLGraphBuilder: JSBridgedClass { @inlinable public func instanceNormalization(input: MLOperand, options: MLInstanceNormalizationOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.instanceNormalization].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.instanceNormalization].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func leakyRelu(x: MLOperand, options: MLLeakyReluOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.leakyRelu].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.leakyRelu].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func leakyRelu(options: MLLeakyReluOptions? = nil) -> MLOperator { let this = jsObject - return this[Strings.leakyRelu].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.leakyRelu].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func matmul(a: MLOperand, b: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.matmul].function!(this: this, arguments: [a.jsValue(), b.jsValue()]).fromJSValue()! + return this[Strings.matmul].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! } @inlinable public func linear(x: MLOperand, options: MLLinearOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.linear].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.linear].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func linear(options: MLLinearOptions? = nil) -> MLOperator { let this = jsObject - return this[Strings.linear].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.linear].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func pad(input: MLOperand, padding: MLOperand, options: MLPadOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.pad].function!(this: this, arguments: [input.jsValue(), padding.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.pad].function!(this: this, arguments: [input.jsValue, padding.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func averagePool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.averagePool2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.averagePool2d].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func l2Pool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.l2Pool2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.l2Pool2d].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func maxPool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.maxPool2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.maxPool2d].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceL1(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceL1].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceL1].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceL2(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceL2].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceL2].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceLogSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceLogSum].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceLogSum].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceLogSumExp(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceLogSumExp].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceLogSumExp].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceMax(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceMax].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceMax].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceMean(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceMean].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceMean].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceMin(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceMin].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceMin].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceProduct(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceProduct].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceProduct].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceSum].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceSum].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reduceSumSquare(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.reduceSumSquare].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reduceSumSquare].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func relu(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.relu].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.relu].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func relu() -> MLOperator { @@ -315,17 +315,17 @@ public class MLGraphBuilder: JSBridgedClass { @inlinable public func resample2d(input: MLOperand, options: MLResample2dOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.resample2d].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.resample2d].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reshape(input: MLOperand, newShape: [Int32]) -> MLOperand { let this = jsObject - return this[Strings.reshape].function!(this: this, arguments: [input.jsValue(), newShape.jsValue()]).fromJSValue()! + return this[Strings.reshape].function!(this: this, arguments: [input.jsValue, newShape.jsValue]).fromJSValue()! } @inlinable public func sigmoid(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.sigmoid].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.sigmoid].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func sigmoid() -> MLOperator { @@ -335,27 +335,27 @@ public class MLGraphBuilder: JSBridgedClass { @inlinable public func slice(input: MLOperand, starts: [Int32], sizes: [Int32], options: MLSliceOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.slice].function!(this: this, arguments: [input.jsValue(), starts.jsValue(), sizes.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.slice].function!(this: this, arguments: [input.jsValue, starts.jsValue, sizes.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func softmax(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.softmax].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.softmax].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func softplus(x: MLOperand, options: MLSoftplusOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.softplus].function!(this: this, arguments: [x.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.softplus].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func softplus(options: MLSoftplusOptions? = nil) -> MLOperator { let this = jsObject - return this[Strings.softplus].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.softplus].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func softsign(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.softsign].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.softsign].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func softsign() -> MLOperator { @@ -365,17 +365,17 @@ public class MLGraphBuilder: JSBridgedClass { @inlinable public func split(input: MLOperand, splits: UInt32_or_seq_of_UInt32, options: MLSplitOptions? = nil) -> [MLOperand] { let this = jsObject - return this[Strings.split].function!(this: this, arguments: [input.jsValue(), splits.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.split].function!(this: this, arguments: [input.jsValue, splits.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func squeeze(input: MLOperand, options: MLSqueezeOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.squeeze].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.squeeze].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func tanh(x: MLOperand) -> MLOperand { let this = jsObject - return this[Strings.tanh].function!(this: this, arguments: [x.jsValue()]).fromJSValue()! + return this[Strings.tanh].function!(this: this, arguments: [x.jsValue]).fromJSValue()! } @inlinable public func tanh() -> MLOperator { @@ -385,6 +385,6 @@ public class MLGraphBuilder: JSBridgedClass { @inlinable public func transpose(input: MLOperand, options: MLTransposeOptions? = nil) -> MLOperand { let this = jsObject - return this[Strings.transpose].function!(this: this, arguments: [input.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.transpose].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MLGruCellOptions.swift b/Sources/DOMKit/WebIDL/MLGruCellOptions.swift index e3d86071..bb33f3bf 100644 --- a/Sources/DOMKit/WebIDL/MLGruCellOptions.swift +++ b/Sources/DOMKit/WebIDL/MLGruCellOptions.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class MLGruCellOptions: BridgedDictionary { public convenience init(bias: MLOperand, recurrentBias: MLOperand, resetAfter: Bool, layout: MLRecurrentNetworkWeightLayout, activations: [MLOperator]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bias] = bias.jsValue() - object[Strings.recurrentBias] = recurrentBias.jsValue() - object[Strings.resetAfter] = resetAfter.jsValue() - object[Strings.layout] = layout.jsValue() - object[Strings.activations] = activations.jsValue() + object[Strings.bias] = bias.jsValue + object[Strings.recurrentBias] = recurrentBias.jsValue + object[Strings.resetAfter] = resetAfter.jsValue + object[Strings.layout] = layout.jsValue + object[Strings.activations] = activations.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLGruOptions.swift b/Sources/DOMKit/WebIDL/MLGruOptions.swift index 95894fc1..250e05cc 100644 --- a/Sources/DOMKit/WebIDL/MLGruOptions.swift +++ b/Sources/DOMKit/WebIDL/MLGruOptions.swift @@ -6,14 +6,14 @@ import JavaScriptKit public class MLGruOptions: BridgedDictionary { public convenience init(bias: MLOperand, recurrentBias: MLOperand, initialHiddenState: MLOperand, resetAfter: Bool, returnSequence: Bool, direction: MLRecurrentNetworkDirection, layout: MLRecurrentNetworkWeightLayout, activations: [MLOperator]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bias] = bias.jsValue() - object[Strings.recurrentBias] = recurrentBias.jsValue() - object[Strings.initialHiddenState] = initialHiddenState.jsValue() - object[Strings.resetAfter] = resetAfter.jsValue() - object[Strings.returnSequence] = returnSequence.jsValue() - object[Strings.direction] = direction.jsValue() - object[Strings.layout] = layout.jsValue() - object[Strings.activations] = activations.jsValue() + object[Strings.bias] = bias.jsValue + object[Strings.recurrentBias] = recurrentBias.jsValue + object[Strings.initialHiddenState] = initialHiddenState.jsValue + object[Strings.resetAfter] = resetAfter.jsValue + object[Strings.returnSequence] = returnSequence.jsValue + object[Strings.direction] = direction.jsValue + object[Strings.layout] = layout.jsValue + object[Strings.activations] = activations.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift b/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift index c97adc5a..690e6300 100644 --- a/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift +++ b/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MLHardSigmoidOptions: BridgedDictionary { public convenience init(alpha: Float, beta: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue() - object[Strings.beta] = beta.jsValue() + object[Strings.alpha] = alpha.jsValue + object[Strings.beta] = beta.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLInput.swift b/Sources/DOMKit/WebIDL/MLInput.swift index 2476bf82..40d6e573 100644 --- a/Sources/DOMKit/WebIDL/MLInput.swift +++ b/Sources/DOMKit/WebIDL/MLInput.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MLInput: BridgedDictionary { public convenience init(resource: MLResource, dimensions: [Int32]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.resource] = resource.jsValue() - object[Strings.dimensions] = dimensions.jsValue() + object[Strings.resource] = resource.jsValue + object[Strings.dimensions] = dimensions.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift b/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift index 78461b0b..d4ab657d 100644 --- a/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift +++ b/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift @@ -18,5 +18,5 @@ public enum MLInputOperandLayout: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift b/Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift index a062865c..5f31598e 100644 --- a/Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift +++ b/Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift @@ -21,12 +21,12 @@ public enum MLInput_or_MLResource: JSValueCompatible, Any_MLInput_or_MLResource return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .mLInput(mLInput): - return mLInput.jsValue() + return mLInput.jsValue case let .mLResource(mLResource): - return mLResource.jsValue() + return mLResource.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift b/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift index 82c881f5..33b8a168 100644 --- a/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift +++ b/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class MLInstanceNormalizationOptions: BridgedDictionary { public convenience init(scale: MLOperand, bias: MLOperand, epsilon: Float, layout: MLInputOperandLayout) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.scale] = scale.jsValue() - object[Strings.bias] = bias.jsValue() - object[Strings.epsilon] = epsilon.jsValue() - object[Strings.layout] = layout.jsValue() + object[Strings.scale] = scale.jsValue + object[Strings.bias] = bias.jsValue + object[Strings.epsilon] = epsilon.jsValue + object[Strings.layout] = layout.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLInterpolationMode.swift b/Sources/DOMKit/WebIDL/MLInterpolationMode.swift index c4c9040c..452c6973 100644 --- a/Sources/DOMKit/WebIDL/MLInterpolationMode.swift +++ b/Sources/DOMKit/WebIDL/MLInterpolationMode.swift @@ -18,5 +18,5 @@ public enum MLInterpolationMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift b/Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift index 944f0458..b0f57d8d 100644 --- a/Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift +++ b/Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MLLeakyReluOptions: BridgedDictionary { public convenience init(alpha: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue() + object[Strings.alpha] = alpha.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLLinearOptions.swift b/Sources/DOMKit/WebIDL/MLLinearOptions.swift index aa96774d..e57a90bf 100644 --- a/Sources/DOMKit/WebIDL/MLLinearOptions.swift +++ b/Sources/DOMKit/WebIDL/MLLinearOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MLLinearOptions: BridgedDictionary { public convenience init(alpha: Float, beta: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue() - object[Strings.beta] = beta.jsValue() + object[Strings.alpha] = alpha.jsValue + object[Strings.beta] = beta.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift b/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift index fc4a6fa2..161e6144 100644 --- a/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift +++ b/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MLOperandDescriptor: BridgedDictionary { public convenience init(type: MLOperandType, dimensions: [Int32]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.dimensions] = dimensions.jsValue() + object[Strings.type] = type.jsValue + object[Strings.dimensions] = dimensions.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLOperandType.swift b/Sources/DOMKit/WebIDL/MLOperandType.swift index 8b3a954c..1f99d311 100644 --- a/Sources/DOMKit/WebIDL/MLOperandType.swift +++ b/Sources/DOMKit/WebIDL/MLOperandType.swift @@ -22,5 +22,5 @@ public enum MLOperandType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLPadOptions.swift b/Sources/DOMKit/WebIDL/MLPadOptions.swift index d3b86f99..7149e1cc 100644 --- a/Sources/DOMKit/WebIDL/MLPadOptions.swift +++ b/Sources/DOMKit/WebIDL/MLPadOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MLPadOptions: BridgedDictionary { public convenience init(mode: MLPaddingMode, value: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue() - object[Strings.value] = value.jsValue() + object[Strings.mode] = mode.jsValue + object[Strings.value] = value.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLPaddingMode.swift b/Sources/DOMKit/WebIDL/MLPaddingMode.swift index 1ce6dda3..6aab0792 100644 --- a/Sources/DOMKit/WebIDL/MLPaddingMode.swift +++ b/Sources/DOMKit/WebIDL/MLPaddingMode.swift @@ -20,5 +20,5 @@ public enum MLPaddingMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLPool2dOptions.swift b/Sources/DOMKit/WebIDL/MLPool2dOptions.swift index 85a78ed8..9448cc9c 100644 --- a/Sources/DOMKit/WebIDL/MLPool2dOptions.swift +++ b/Sources/DOMKit/WebIDL/MLPool2dOptions.swift @@ -6,14 +6,14 @@ import JavaScriptKit public class MLPool2dOptions: BridgedDictionary { public convenience init(windowDimensions: [Int32], padding: [Int32], strides: [Int32], dilations: [Int32], autoPad: MLAutoPad, layout: MLInputOperandLayout, roundingType: MLRoundingType, outputSizes: [Int32]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.windowDimensions] = windowDimensions.jsValue() - object[Strings.padding] = padding.jsValue() - object[Strings.strides] = strides.jsValue() - object[Strings.dilations] = dilations.jsValue() - object[Strings.autoPad] = autoPad.jsValue() - object[Strings.layout] = layout.jsValue() - object[Strings.roundingType] = roundingType.jsValue() - object[Strings.outputSizes] = outputSizes.jsValue() + object[Strings.windowDimensions] = windowDimensions.jsValue + object[Strings.padding] = padding.jsValue + object[Strings.strides] = strides.jsValue + object[Strings.dilations] = dilations.jsValue + object[Strings.autoPad] = autoPad.jsValue + object[Strings.layout] = layout.jsValue + object[Strings.roundingType] = roundingType.jsValue + object[Strings.outputSizes] = outputSizes.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLPowerPreference.swift b/Sources/DOMKit/WebIDL/MLPowerPreference.swift index 7519f9fc..b9a47f53 100644 --- a/Sources/DOMKit/WebIDL/MLPowerPreference.swift +++ b/Sources/DOMKit/WebIDL/MLPowerPreference.swift @@ -19,5 +19,5 @@ public enum MLPowerPreference: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift b/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift index cc86b9c0..731deb72 100644 --- a/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift +++ b/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift @@ -19,5 +19,5 @@ public enum MLRecurrentNetworkDirection: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift b/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift index ac941ab7..5a4c3fc6 100644 --- a/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift +++ b/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift @@ -18,5 +18,5 @@ public enum MLRecurrentNetworkWeightLayout: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLReduceOptions.swift b/Sources/DOMKit/WebIDL/MLReduceOptions.swift index b0514afa..69dadec4 100644 --- a/Sources/DOMKit/WebIDL/MLReduceOptions.swift +++ b/Sources/DOMKit/WebIDL/MLReduceOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MLReduceOptions: BridgedDictionary { public convenience init(axes: [Int32], keepDimensions: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.axes] = axes.jsValue() - object[Strings.keepDimensions] = keepDimensions.jsValue() + object[Strings.axes] = axes.jsValue + object[Strings.keepDimensions] = keepDimensions.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLResample2dOptions.swift b/Sources/DOMKit/WebIDL/MLResample2dOptions.swift index 294d7f03..2477a0c0 100644 --- a/Sources/DOMKit/WebIDL/MLResample2dOptions.swift +++ b/Sources/DOMKit/WebIDL/MLResample2dOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class MLResample2dOptions: BridgedDictionary { public convenience init(mode: MLInterpolationMode, scales: [Float], sizes: [Int32], axes: [Int32]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue() - object[Strings.scales] = scales.jsValue() - object[Strings.sizes] = sizes.jsValue() - object[Strings.axes] = axes.jsValue() + object[Strings.mode] = mode.jsValue + object[Strings.scales] = scales.jsValue + object[Strings.sizes] = sizes.jsValue + object[Strings.axes] = axes.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLResource.swift b/Sources/DOMKit/WebIDL/MLResource.swift index 3ae9b00e..e4338632 100644 --- a/Sources/DOMKit/WebIDL/MLResource.swift +++ b/Sources/DOMKit/WebIDL/MLResource.swift @@ -26,14 +26,14 @@ public enum MLResource: JSValueCompatible, Any_MLResource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .gPUTexture(gPUTexture): - return gPUTexture.jsValue() + return gPUTexture.jsValue case let .mLBufferView(mLBufferView): - return mLBufferView.jsValue() + return mLBufferView.jsValue case let .webGLTexture(webGLTexture): - return webGLTexture.jsValue() + return webGLTexture.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/MLRoundingType.swift b/Sources/DOMKit/WebIDL/MLRoundingType.swift index c7be2cdb..d058068a 100644 --- a/Sources/DOMKit/WebIDL/MLRoundingType.swift +++ b/Sources/DOMKit/WebIDL/MLRoundingType.swift @@ -18,5 +18,5 @@ public enum MLRoundingType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MLSliceOptions.swift b/Sources/DOMKit/WebIDL/MLSliceOptions.swift index 0670c8c1..8fa808df 100644 --- a/Sources/DOMKit/WebIDL/MLSliceOptions.swift +++ b/Sources/DOMKit/WebIDL/MLSliceOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MLSliceOptions: BridgedDictionary { public convenience init(axes: [Int32]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.axes] = axes.jsValue() + object[Strings.axes] = axes.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift b/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift index 47a9f53d..6f767bd3 100644 --- a/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift +++ b/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MLSoftplusOptions: BridgedDictionary { public convenience init(steepness: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.steepness] = steepness.jsValue() + object[Strings.steepness] = steepness.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLSplitOptions.swift b/Sources/DOMKit/WebIDL/MLSplitOptions.swift index dcf34261..3e952071 100644 --- a/Sources/DOMKit/WebIDL/MLSplitOptions.swift +++ b/Sources/DOMKit/WebIDL/MLSplitOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MLSplitOptions: BridgedDictionary { public convenience init(axis: Int32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.axis] = axis.jsValue() + object[Strings.axis] = axis.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift b/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift index 06662222..f686cf75 100644 --- a/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift +++ b/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MLSqueezeOptions: BridgedDictionary { public convenience init(axes: [Int32]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.axes] = axes.jsValue() + object[Strings.axes] = axes.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MLTransposeOptions.swift b/Sources/DOMKit/WebIDL/MLTransposeOptions.swift index 5d1e4d51..c93c2f9e 100644 --- a/Sources/DOMKit/WebIDL/MLTransposeOptions.swift +++ b/Sources/DOMKit/WebIDL/MLTransposeOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MLTransposeOptions: BridgedDictionary { public convenience init(permutation: [Int32]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.permutation] = permutation.jsValue() + object[Strings.permutation] = permutation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Magnetometer.swift b/Sources/DOMKit/WebIDL/Magnetometer.swift index 90a5ea61..c8d90abc 100644 --- a/Sources/DOMKit/WebIDL/Magnetometer.swift +++ b/Sources/DOMKit/WebIDL/Magnetometer.swift @@ -14,7 +14,7 @@ public class Magnetometer: Sensor { } @inlinable public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift index 05594e67..17baf7df 100644 --- a/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift +++ b/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift @@ -18,5 +18,5 @@ public enum MagnetometerLocalCoordinateSystem: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift b/Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift index 645c91e6..42c1ce2b 100644 --- a/Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift +++ b/Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MagnetometerReadingValues: BridgedDictionary { public convenience init(x: Double?, y: Double?, z: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.z] = z.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.z] = z.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift b/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift index cd558499..050a71a6 100644 --- a/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift +++ b/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MagnetometerSensorOptions: BridgedDictionary { public convenience init(referenceFrame: MagnetometerLocalCoordinateSystem) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceFrame] = referenceFrame.jsValue() + object[Strings.referenceFrame] = referenceFrame.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaCapabilities.swift b/Sources/DOMKit/WebIDL/MediaCapabilities.swift index 855ec4f5..450d90d6 100644 --- a/Sources/DOMKit/WebIDL/MediaCapabilities.swift +++ b/Sources/DOMKit/WebIDL/MediaCapabilities.swift @@ -14,25 +14,25 @@ public class MediaCapabilities: JSBridgedClass { @inlinable public func decodingInfo(configuration: MediaDecodingConfiguration) -> JSPromise { let this = jsObject - return this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! + return this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func decodingInfo(configuration: MediaDecodingConfiguration) async throws -> MediaCapabilitiesDecodingInfo { let this = jsObject - let _promise: JSPromise = this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func encodingInfo(configuration: MediaEncodingConfiguration) -> JSPromise { let this = jsObject - return this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! + return this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func encodingInfo(configuration: MediaEncodingConfiguration) async throws -> MediaCapabilitiesEncodingInfo { let this = jsObject - let _promise: JSPromise = this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift index 5d8149aa..a9569a5c 100644 --- a/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift +++ b/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MediaCapabilitiesDecodingInfo: BridgedDictionary { public convenience init(keySystemAccess: MediaKeySystemAccess, configuration: MediaDecodingConfiguration) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keySystemAccess] = keySystemAccess.jsValue() - object[Strings.configuration] = configuration.jsValue() + object[Strings.keySystemAccess] = keySystemAccess.jsValue + object[Strings.configuration] = configuration.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift index 479c1f0d..673d93aa 100644 --- a/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift +++ b/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MediaCapabilitiesEncodingInfo: BridgedDictionary { public convenience init(configuration: MediaEncodingConfiguration) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.configuration] = configuration.jsValue() + object[Strings.configuration] = configuration.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift index 58140ad3..292fbf77 100644 --- a/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift +++ b/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MediaCapabilitiesInfo: BridgedDictionary { public convenience init(supported: Bool, smooth: Bool, powerEfficient: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supported] = supported.jsValue() - object[Strings.smooth] = smooth.jsValue() - object[Strings.powerEfficient] = powerEfficient.jsValue() + object[Strings.supported] = supported.jsValue + object[Strings.smooth] = smooth.jsValue + object[Strings.powerEfficient] = powerEfficient.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift index 5df480ae..dfcfe291 100644 --- a/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class MediaCapabilitiesKeySystemConfiguration: BridgedDictionary { public convenience init(keySystem: String, initDataType: String, distinctiveIdentifier: MediaKeysRequirement, persistentState: MediaKeysRequirement, sessionTypes: [String], audio: KeySystemTrackConfiguration, video: KeySystemTrackConfiguration) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keySystem] = keySystem.jsValue() - object[Strings.initDataType] = initDataType.jsValue() - object[Strings.distinctiveIdentifier] = distinctiveIdentifier.jsValue() - object[Strings.persistentState] = persistentState.jsValue() - object[Strings.sessionTypes] = sessionTypes.jsValue() - object[Strings.audio] = audio.jsValue() - object[Strings.video] = video.jsValue() + object[Strings.keySystem] = keySystem.jsValue + object[Strings.initDataType] = initDataType.jsValue + object[Strings.distinctiveIdentifier] = distinctiveIdentifier.jsValue + object[Strings.persistentState] = persistentState.jsValue + object[Strings.sessionTypes] = sessionTypes.jsValue + object[Strings.audio] = audio.jsValue + object[Strings.video] = video.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaConfiguration.swift b/Sources/DOMKit/WebIDL/MediaConfiguration.swift index e165f949..a11dc60c 100644 --- a/Sources/DOMKit/WebIDL/MediaConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MediaConfiguration.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MediaConfiguration: BridgedDictionary { public convenience init(video: VideoConfiguration, audio: AudioConfiguration) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.video] = video.jsValue() - object[Strings.audio] = audio.jsValue() + object[Strings.video] = video.jsValue + object[Strings.audio] = audio.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift b/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift index 71b12597..e3030b03 100644 --- a/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MediaDecodingConfiguration: BridgedDictionary { public convenience init(type: MediaDecodingType, keySystemConfiguration: MediaCapabilitiesKeySystemConfiguration) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.keySystemConfiguration] = keySystemConfiguration.jsValue() + object[Strings.type] = type.jsValue + object[Strings.keySystemConfiguration] = keySystemConfiguration.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaDecodingType.swift b/Sources/DOMKit/WebIDL/MediaDecodingType.swift index 99833c78..3fdf94c8 100644 --- a/Sources/DOMKit/WebIDL/MediaDecodingType.swift +++ b/Sources/DOMKit/WebIDL/MediaDecodingType.swift @@ -19,5 +19,5 @@ public enum MediaDecodingType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaDeviceKind.swift b/Sources/DOMKit/WebIDL/MediaDeviceKind.swift index f331436a..a19daab0 100644 --- a/Sources/DOMKit/WebIDL/MediaDeviceKind.swift +++ b/Sources/DOMKit/WebIDL/MediaDeviceKind.swift @@ -19,5 +19,5 @@ public enum MediaDeviceKind: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaDevices.swift b/Sources/DOMKit/WebIDL/MediaDevices.swift index e82c42ba..6d57fd6e 100644 --- a/Sources/DOMKit/WebIDL/MediaDevices.swift +++ b/Sources/DOMKit/WebIDL/MediaDevices.swift @@ -13,26 +13,26 @@ public class MediaDevices: EventTarget { @inlinable public func selectAudioOutput(options: AudioOutputOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func selectAudioOutput(options: AudioOutputOptions? = nil) async throws -> MediaDeviceInfo { let this = jsObject - let _promise: JSPromise = this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func produceCropTarget(element: HTMLElement) -> JSPromise { let this = jsObject - return this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! + return this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func produceCropTarget(element: HTMLElement) async throws -> CropTarget { let this = jsObject - let _promise: JSPromise = this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ClosureAttribute1Optional @@ -47,7 +47,7 @@ public class MediaDevices: EventTarget { @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.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getSupportedConstraints() -> MediaTrackSupportedConstraints { @@ -57,25 +57,25 @@ public class MediaDevices: EventTarget { @inlinable public func getUserMedia(constraints: MediaStreamConstraints? = nil) -> JSPromise { let this = jsObject - return this[Strings.getUserMedia].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! + 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.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getUserMedia].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) -> JSPromise { let this = jsObject - return this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) async throws -> MediaStream { let this = jsObject - let _promise: JSPromise = this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift index 0d57e850..b1c45274 100644 --- a/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift +++ b/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift @@ -12,7 +12,7 @@ public class MediaElementAudioSourceNode: AudioNode { } @inlinable public convenience init(context: AudioContext, options: MediaElementAudioSourceOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift b/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift index fffaa9c0..7ea0f005 100644 --- a/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift +++ b/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MediaElementAudioSourceOptions: BridgedDictionary { public convenience init(mediaElement: HTMLMediaElement) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaElement] = mediaElement.jsValue() + object[Strings.mediaElement] = mediaElement.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift b/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift index 87c18050..66271dba 100644 --- a/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MediaEncodingConfiguration: BridgedDictionary { public convenience init(type: MediaEncodingType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() + object[Strings.type] = type.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaEncodingType.swift b/Sources/DOMKit/WebIDL/MediaEncodingType.swift index b54a6268..88b97d87 100644 --- a/Sources/DOMKit/WebIDL/MediaEncodingType.swift +++ b/Sources/DOMKit/WebIDL/MediaEncodingType.swift @@ -18,5 +18,5 @@ public enum MediaEncodingType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift b/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift index eadaf045..c40d8a46 100644 --- a/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift @@ -13,7 +13,7 @@ public class MediaEncryptedEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: MediaEncryptedEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift b/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift index d75429e7..6d3d6aa8 100644 --- a/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift +++ b/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MediaEncryptedEventInit: BridgedDictionary { public convenience init(initDataType: String, initData: ArrayBuffer?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.initDataType] = initDataType.jsValue() - object[Strings.initData] = initData.jsValue() + object[Strings.initDataType] = initDataType.jsValue + object[Strings.initData] = initData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaImage.swift b/Sources/DOMKit/WebIDL/MediaImage.swift index 586829ee..d6e262da 100644 --- a/Sources/DOMKit/WebIDL/MediaImage.swift +++ b/Sources/DOMKit/WebIDL/MediaImage.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MediaImage: BridgedDictionary { public convenience init(src: String, sizes: String, type: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.src] = src.jsValue() - object[Strings.sizes] = sizes.jsValue() - object[Strings.type] = type.jsValue() + object[Strings.src] = src.jsValue + object[Strings.sizes] = sizes.jsValue + object[Strings.type] = type.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift index 091320cb..c7fe9f7b 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift @@ -13,7 +13,7 @@ public class MediaKeyMessageEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: MediaKeyMessageEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift index 580d044b..3cf7e00f 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MediaKeyMessageEventInit: BridgedDictionary { public convenience init(messageType: MediaKeyMessageType, message: ArrayBuffer) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.messageType] = messageType.jsValue() - object[Strings.message] = message.jsValue() + object[Strings.messageType] = messageType.jsValue + object[Strings.message] = message.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift index 352b21e6..5deb420f 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift @@ -20,5 +20,5 @@ public enum MediaKeyMessageType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaKeySession.swift b/Sources/DOMKit/WebIDL/MediaKeySession.swift index c9d7fbf3..afbde1b7 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySession.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySession.swift @@ -36,38 +36,38 @@ public class MediaKeySession: EventTarget { @inlinable public func generateRequest(initDataType: String, initData: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue(), initData.jsValue()]).fromJSValue()! + return this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue, initData.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func generateRequest(initDataType: String, initData: BufferSource) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue(), initData.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue, initData.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func load(sessionId: String) -> JSPromise { let this = jsObject - return this[Strings.load].function!(this: this, arguments: [sessionId.jsValue()]).fromJSValue()! + return this[Strings.load].function!(this: this, arguments: [sessionId.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func load(sessionId: String) async throws -> Bool { let this = jsObject - let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [sessionId.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [sessionId.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func update(response: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.update].function!(this: this, arguments: [response.jsValue()]).fromJSValue()! + return this[Strings.update].function!(this: this, arguments: [response.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func update(response: BufferSource) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.update].function!(this: this, arguments: [response.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.update].function!(this: this, arguments: [response.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func close() -> JSPromise { @@ -79,7 +79,7 @@ public class MediaKeySession: EventTarget { @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func remove() -> JSPromise { @@ -91,6 +91,6 @@ public class MediaKeySession: EventTarget { @inlinable public func remove() async throws { let this = jsObject let _promise: JSPromise = this[Strings.remove].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift b/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift index 56d8b6bc..b3f8e22a 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift @@ -21,5 +21,5 @@ public enum MediaKeySessionClosedReason: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaKeySessionType.swift b/Sources/DOMKit/WebIDL/MediaKeySessionType.swift index 5d425c9b..2a2cfe51 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySessionType.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySessionType.swift @@ -18,5 +18,5 @@ public enum MediaKeySessionType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatus.swift b/Sources/DOMKit/WebIDL/MediaKeyStatus.swift index 6091c973..18626775 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyStatus.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyStatus.swift @@ -24,5 +24,5 @@ public enum MediaKeyStatus: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift index 4ccac231..48f26737 100644 --- a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift +++ b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift @@ -23,11 +23,11 @@ public class MediaKeyStatusMap: JSBridgedClass, Sequence { @inlinable public func has(keyId: BufferSource) -> Bool { let this = jsObject - return this[Strings.has].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! + return this[Strings.has].function!(this: this, arguments: [keyId.jsValue]).fromJSValue()! } @inlinable public func get(keyId: BufferSource) -> MediaKeyStatus? { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [keyId.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [keyId.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift b/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift index cf4c171a..a33b4e01 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift @@ -30,6 +30,6 @@ public class MediaKeySystemAccess: JSBridgedClass { @inlinable public func createMediaKeys() async throws -> MediaKeys { let this = jsObject let _promise: JSPromise = this[Strings.createMediaKeys].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift b/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift index 305007e9..c60ae8cb 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class MediaKeySystemConfiguration: BridgedDictionary { public convenience init(label: String, initDataTypes: [String], audioCapabilities: [MediaKeySystemMediaCapability], videoCapabilities: [MediaKeySystemMediaCapability], distinctiveIdentifier: MediaKeysRequirement, persistentState: MediaKeysRequirement, sessionTypes: [String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue() - object[Strings.initDataTypes] = initDataTypes.jsValue() - object[Strings.audioCapabilities] = audioCapabilities.jsValue() - object[Strings.videoCapabilities] = videoCapabilities.jsValue() - object[Strings.distinctiveIdentifier] = distinctiveIdentifier.jsValue() - object[Strings.persistentState] = persistentState.jsValue() - object[Strings.sessionTypes] = sessionTypes.jsValue() + object[Strings.label] = label.jsValue + object[Strings.initDataTypes] = initDataTypes.jsValue + object[Strings.audioCapabilities] = audioCapabilities.jsValue + object[Strings.videoCapabilities] = videoCapabilities.jsValue + object[Strings.distinctiveIdentifier] = distinctiveIdentifier.jsValue + object[Strings.persistentState] = persistentState.jsValue + object[Strings.sessionTypes] = sessionTypes.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift b/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift index 4f9d43a0..7150a110 100644 --- a/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift +++ b/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MediaKeySystemMediaCapability: BridgedDictionary { public convenience init(contentType: String, encryptionScheme: String?, robustness: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contentType] = contentType.jsValue() - object[Strings.encryptionScheme] = encryptionScheme.jsValue() - object[Strings.robustness] = robustness.jsValue() + object[Strings.contentType] = contentType.jsValue + object[Strings.encryptionScheme] = encryptionScheme.jsValue + object[Strings.robustness] = robustness.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaKeys.swift b/Sources/DOMKit/WebIDL/MediaKeys.swift index 6a09cd3d..da2a7cab 100644 --- a/Sources/DOMKit/WebIDL/MediaKeys.swift +++ b/Sources/DOMKit/WebIDL/MediaKeys.swift @@ -14,18 +14,18 @@ public class MediaKeys: JSBridgedClass { @inlinable public func createSession(sessionType: MediaKeySessionType? = nil) -> MediaKeySession { let this = jsObject - return this[Strings.createSession].function!(this: this, arguments: [sessionType?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createSession].function!(this: this, arguments: [sessionType?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func setServerCertificate(serverCertificate: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue()]).fromJSValue()! + return this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func setServerCertificate(serverCertificate: BufferSource) async throws -> Bool { let this = jsObject - let _promise: JSPromise = this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift b/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift index 2bf8891c..5dc0e8b1 100644 --- a/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift +++ b/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift @@ -19,5 +19,5 @@ public enum MediaKeysRequirement: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift index e4f3087d..1bd2b789 100644 --- a/Sources/DOMKit/WebIDL/MediaList.swift +++ b/Sources/DOMKit/WebIDL/MediaList.swift @@ -26,11 +26,11 @@ public class MediaList: JSBridgedClass { @inlinable public func appendMedium(medium: String) { let this = jsObject - _ = this[Strings.appendMedium].function!(this: this, arguments: [medium.jsValue()]) + _ = this[Strings.appendMedium].function!(this: this, arguments: [medium.jsValue]) } @inlinable public func deleteMedium(medium: String) { let this = jsObject - _ = this[Strings.deleteMedium].function!(this: this, arguments: [medium.jsValue()]) + _ = this[Strings.deleteMedium].function!(this: this, arguments: [medium.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/MediaList_or_String.swift b/Sources/DOMKit/WebIDL/MediaList_or_String.swift index c960d098..2ec77c17 100644 --- a/Sources/DOMKit/WebIDL/MediaList_or_String.swift +++ b/Sources/DOMKit/WebIDL/MediaList_or_String.swift @@ -21,12 +21,12 @@ public enum MediaList_or_String: JSValueCompatible, Any_MediaList_or_String { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .mediaList(mediaList): - return mediaList.jsValue() + return mediaList.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/MediaMetadata.swift b/Sources/DOMKit/WebIDL/MediaMetadata.swift index f4182aec..8759d27c 100644 --- a/Sources/DOMKit/WebIDL/MediaMetadata.swift +++ b/Sources/DOMKit/WebIDL/MediaMetadata.swift @@ -17,7 +17,7 @@ public class MediaMetadata: JSBridgedClass { } @inlinable public convenience init(init: MediaMetadataInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/MediaMetadataInit.swift b/Sources/DOMKit/WebIDL/MediaMetadataInit.swift index 54a56f54..5795f8ca 100644 --- a/Sources/DOMKit/WebIDL/MediaMetadataInit.swift +++ b/Sources/DOMKit/WebIDL/MediaMetadataInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class MediaMetadataInit: BridgedDictionary { public convenience init(title: String, artist: String, album: String, artwork: [MediaImage]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.title] = title.jsValue() - object[Strings.artist] = artist.jsValue() - object[Strings.album] = album.jsValue() - object[Strings.artwork] = artwork.jsValue() + object[Strings.title] = title.jsValue + object[Strings.artist] = artist.jsValue + object[Strings.album] = album.jsValue + object[Strings.artwork] = artwork.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaPositionState.swift b/Sources/DOMKit/WebIDL/MediaPositionState.swift index e0ff18b2..d31c1d2e 100644 --- a/Sources/DOMKit/WebIDL/MediaPositionState.swift +++ b/Sources/DOMKit/WebIDL/MediaPositionState.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MediaPositionState: BridgedDictionary { public convenience init(duration: Double, playbackRate: Double, position: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.duration] = duration.jsValue() - object[Strings.playbackRate] = playbackRate.jsValue() - object[Strings.position] = position.jsValue() + object[Strings.duration] = duration.jsValue + object[Strings.playbackRate] = playbackRate.jsValue + object[Strings.position] = position.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaProvider.swift b/Sources/DOMKit/WebIDL/MediaProvider.swift index 76736f3d..229ee101 100644 --- a/Sources/DOMKit/WebIDL/MediaProvider.swift +++ b/Sources/DOMKit/WebIDL/MediaProvider.swift @@ -26,14 +26,14 @@ public enum MediaProvider: JSValueCompatible, Any_MediaProvider { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .blob(blob): - return blob.jsValue() + return blob.jsValue case let .mediaSource(mediaSource): - return mediaSource.jsValue() + return mediaSource.jsValue case let .mediaStream(mediaStream): - return mediaStream.jsValue() + return mediaStream.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift b/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift index 502349b0..e74e5c35 100644 --- a/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift @@ -13,7 +13,7 @@ public class MediaQueryListEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: MediaQueryListEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift b/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift index 57be2b9b..0f6adc8b 100644 --- a/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift +++ b/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MediaQueryListEventInit: BridgedDictionary { public convenience init(media: String, matches: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.media] = media.jsValue() - object[Strings.matches] = matches.jsValue() + object[Strings.media] = media.jsValue + object[Strings.matches] = matches.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaRecorder.swift b/Sources/DOMKit/WebIDL/MediaRecorder.swift index 8845453b..9336c57b 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorder.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorder.swift @@ -23,7 +23,7 @@ public class MediaRecorder: EventTarget { } @inlinable public convenience init(stream: MediaStream, options: MediaRecorderOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -64,7 +64,7 @@ public class MediaRecorder: EventTarget { @inlinable public func start(timeslice: UInt32? = nil) { let this = jsObject - _ = this[Strings.start].function!(this: this, arguments: [timeslice?.jsValue() ?? .undefined]) + _ = this[Strings.start].function!(this: this, arguments: [timeslice?.jsValue ?? .undefined]) } @inlinable public func stop() { @@ -89,6 +89,6 @@ public class MediaRecorder: EventTarget { @inlinable public static func isTypeSupported(type: String) -> Bool { let this = constructor - return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift b/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift index 041148a3..c4b4cc09 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift @@ -12,7 +12,7 @@ public class MediaRecorderErrorEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: MediaRecorderErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift b/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift index 20d908f4..4c773a67 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MediaRecorderErrorEventInit: BridgedDictionary { public convenience init(error: DOMException) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue() + object[Strings.error] = error.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift b/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift index eb1919f7..3a4300b0 100644 --- a/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift +++ b/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift @@ -6,11 +6,11 @@ import JavaScriptKit 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() + 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) } diff --git a/Sources/DOMKit/WebIDL/MediaSession.swift b/Sources/DOMKit/WebIDL/MediaSession.swift index 550c6a4a..aff40eca 100644 --- a/Sources/DOMKit/WebIDL/MediaSession.swift +++ b/Sources/DOMKit/WebIDL/MediaSession.swift @@ -24,16 +24,16 @@ public class MediaSession: JSBridgedClass { @inlinable public func setPositionState(state: MediaPositionState? = nil) { let this = jsObject - _ = this[Strings.setPositionState].function!(this: this, arguments: [state?.jsValue() ?? .undefined]) + _ = this[Strings.setPositionState].function!(this: this, arguments: [state?.jsValue ?? .undefined]) } @inlinable public func setMicrophoneActive(active: Bool) { let this = jsObject - _ = this[Strings.setMicrophoneActive].function!(this: this, arguments: [active.jsValue()]) + _ = this[Strings.setMicrophoneActive].function!(this: this, arguments: [active.jsValue]) } @inlinable public func setCameraActive(active: Bool) { let this = jsObject - _ = this[Strings.setCameraActive].function!(this: this, arguments: [active.jsValue()]) + _ = this[Strings.setCameraActive].function!(this: this, arguments: [active.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/MediaSessionAction.swift b/Sources/DOMKit/WebIDL/MediaSessionAction.swift index d421fa1b..09d789b8 100644 --- a/Sources/DOMKit/WebIDL/MediaSessionAction.swift +++ b/Sources/DOMKit/WebIDL/MediaSessionAction.swift @@ -28,5 +28,5 @@ public enum MediaSessionAction: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift b/Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift index cef092ec..6a6dd1fc 100644 --- a/Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift +++ b/Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class MediaSessionActionDetails: BridgedDictionary { public convenience init(action: MediaSessionAction, seekOffset: Double?, seekTime: Double?, fastSeek: Bool?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.action] = action.jsValue() - object[Strings.seekOffset] = seekOffset.jsValue() - object[Strings.seekTime] = seekTime.jsValue() - object[Strings.fastSeek] = fastSeek.jsValue() + object[Strings.action] = action.jsValue + object[Strings.seekOffset] = seekOffset.jsValue + object[Strings.seekTime] = seekTime.jsValue + object[Strings.fastSeek] = fastSeek.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift b/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift index bac3083a..e8fe7191 100644 --- a/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift +++ b/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift @@ -19,5 +19,5 @@ public enum MediaSessionPlaybackState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaSettingsRange.swift b/Sources/DOMKit/WebIDL/MediaSettingsRange.swift index 46e65430..de00ce6c 100644 --- a/Sources/DOMKit/WebIDL/MediaSettingsRange.swift +++ b/Sources/DOMKit/WebIDL/MediaSettingsRange.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MediaSettingsRange: BridgedDictionary { public convenience init(max: Double, min: Double, step: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.max] = max.jsValue() - object[Strings.min] = min.jsValue() - object[Strings.step] = step.jsValue() + object[Strings.max] = max.jsValue + object[Strings.min] = min.jsValue + object[Strings.step] = step.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaSource.swift b/Sources/DOMKit/WebIDL/MediaSource.swift index f7c82990..a8e5ee5c 100644 --- a/Sources/DOMKit/WebIDL/MediaSource.swift +++ b/Sources/DOMKit/WebIDL/MediaSource.swift @@ -48,22 +48,22 @@ public class MediaSource: EventTarget { @inlinable public func addSourceBuffer(type: String) -> SourceBuffer { let this = jsObject - return this[Strings.addSourceBuffer].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.addSourceBuffer].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } @inlinable public func removeSourceBuffer(sourceBuffer: SourceBuffer) { let this = jsObject - _ = this[Strings.removeSourceBuffer].function!(this: this, arguments: [sourceBuffer.jsValue()]) + _ = this[Strings.removeSourceBuffer].function!(this: this, arguments: [sourceBuffer.jsValue]) } @inlinable public func endOfStream(error: EndOfStreamError? = nil) { let this = jsObject - _ = this[Strings.endOfStream].function!(this: this, arguments: [error?.jsValue() ?? .undefined]) + _ = this[Strings.endOfStream].function!(this: this, arguments: [error?.jsValue ?? .undefined]) } @inlinable public func setLiveSeekableRange(start: Double, end: Double) { let this = jsObject - _ = this[Strings.setLiveSeekableRange].function!(this: this, arguments: [start.jsValue(), end.jsValue()]) + _ = this[Strings.setLiveSeekableRange].function!(this: this, arguments: [start.jsValue, end.jsValue]) } @inlinable public func clearLiveSeekableRange() { @@ -73,6 +73,6 @@ public class MediaSource: EventTarget { @inlinable public static func isTypeSupported(type: String) -> Bool { let this = constructor - return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/MediaStream.swift b/Sources/DOMKit/WebIDL/MediaStream.swift index 312413ee..819dac5a 100644 --- a/Sources/DOMKit/WebIDL/MediaStream.swift +++ b/Sources/DOMKit/WebIDL/MediaStream.swift @@ -19,11 +19,11 @@ public class MediaStream: EventTarget { } @inlinable public convenience init(stream: MediaStream) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue])) } @inlinable public convenience init(tracks: [MediaStreamTrack]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [tracks.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [tracks.jsValue])) } @ReadonlyAttribute @@ -46,17 +46,17 @@ public class MediaStream: EventTarget { @inlinable public func getTrackById(trackId: String) -> MediaStreamTrack? { let this = jsObject - return this[Strings.getTrackById].function!(this: this, arguments: [trackId.jsValue()]).fromJSValue()! + return this[Strings.getTrackById].function!(this: this, arguments: [trackId.jsValue]).fromJSValue()! } @inlinable public func addTrack(track: MediaStreamTrack) { let this = jsObject - _ = this[Strings.addTrack].function!(this: this, arguments: [track.jsValue()]) + _ = this[Strings.addTrack].function!(this: this, arguments: [track.jsValue]) } @inlinable public func removeTrack(track: MediaStreamTrack) { let this = jsObject - _ = this[Strings.removeTrack].function!(this: this, arguments: [track.jsValue()]) + _ = this[Strings.removeTrack].function!(this: this, arguments: [track.jsValue]) } @inlinable public func clone() -> Self { diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift index b494961d..d5e8ecc6 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift @@ -12,7 +12,7 @@ public class MediaStreamAudioDestinationNode: AudioNode { } @inlinable public convenience init(context: AudioContext, options: AudioNodeOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift index 33f15136..5be10e19 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift @@ -12,7 +12,7 @@ public class MediaStreamAudioSourceNode: AudioNode { } @inlinable public convenience init(context: AudioContext, options: MediaStreamAudioSourceOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift index 5ac15938..c7692542 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MediaStreamAudioSourceOptions: BridgedDictionary { public convenience init(mediaStream: MediaStream) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaStream] = mediaStream.jsValue() + object[Strings.mediaStream] = mediaStream.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift index 10970ce8..2f83e3b5 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class MediaStreamConstraints: BridgedDictionary { public convenience init(video: Bool_or_MediaTrackConstraints, audio: Bool_or_MediaTrackConstraints, preferCurrentTab: Bool, peerIdentity: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.video] = video.jsValue() - object[Strings.audio] = audio.jsValue() - object[Strings.preferCurrentTab] = preferCurrentTab.jsValue() - object[Strings.peerIdentity] = peerIdentity.jsValue() + object[Strings.video] = video.jsValue + object[Strings.audio] = audio.jsValue + object[Strings.preferCurrentTab] = preferCurrentTab.jsValue + object[Strings.peerIdentity] = peerIdentity.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift index 725a0bb2..a349e8ec 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift @@ -76,14 +76,14 @@ public class MediaStreamTrack: EventTarget { @inlinable public func applyConstraints(constraints: MediaTrackConstraints? = nil) -> JSPromise { let this = jsObject - return this[Strings.applyConstraints].function!(this: this, arguments: [constraints?.jsValue() ?? .undefined]).fromJSValue()! + 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.get() + let _promise: JSPromise = this[Strings.applyConstraints].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift index 8f0c77fa..38e86dde 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift @@ -11,6 +11,6 @@ public class MediaStreamTrackAudioSourceNode: AudioNode { } @inlinable public convenience init(context: AudioContext, options: MediaStreamTrackAudioSourceOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options.jsValue])) } } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift index 44407389..26d7ecb6 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MediaStreamTrackAudioSourceOptions: BridgedDictionary { public convenience init(mediaStreamTrack: MediaStreamTrack) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaStreamTrack] = mediaStreamTrack.jsValue() + object[Strings.mediaStreamTrack] = mediaStreamTrack.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift index 2b8be939..21d98e5a 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift @@ -12,7 +12,7 @@ public class MediaStreamTrackEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: MediaStreamTrackEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift index 51a51a69..2bab9838 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MediaStreamTrackEventInit: BridgedDictionary { public convenience init(track: MediaStreamTrack) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.track] = track.jsValue() + object[Strings.track] = track.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift index 05070da2..a3bc394b 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MediaStreamTrackProcessorInit: BridgedDictionary { public convenience init(track: MediaStreamTrack, maxBufferSize: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.track] = track.jsValue() - object[Strings.maxBufferSize] = maxBufferSize.jsValue() + object[Strings.track] = track.jsValue + object[Strings.maxBufferSize] = maxBufferSize.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift index 26b43f70..d08534a1 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift @@ -18,5 +18,5 @@ public enum MediaStreamTrackState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift index 98c5949f..daecfba5 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift @@ -21,12 +21,12 @@ public enum MediaStreamTrack_or_String: JSValueCompatible, Any_MediaStreamTrack_ return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .mediaStreamTrack(mediaStreamTrack): - return mediaStreamTrack.jsValue() + return mediaStreamTrack.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift index 01e3d2d2..b0112a82 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift @@ -6,40 +6,40 @@ import JavaScriptKit public class MediaTrackCapabilities: BridgedDictionary { public convenience init(whiteBalanceMode: [String], exposureMode: [String], focusMode: [String], exposureCompensation: MediaSettingsRange, exposureTime: MediaSettingsRange, colorTemperature: MediaSettingsRange, iso: MediaSettingsRange, brightness: MediaSettingsRange, contrast: MediaSettingsRange, saturation: MediaSettingsRange, sharpness: MediaSettingsRange, focusDistance: MediaSettingsRange, pan: MediaSettingsRange, tilt: MediaSettingsRange, zoom: MediaSettingsRange, torch: Bool, 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, displaySurface: String, logicalSurface: Bool, cursor: [String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() - object[Strings.exposureMode] = exposureMode.jsValue() - object[Strings.focusMode] = focusMode.jsValue() - object[Strings.exposureCompensation] = exposureCompensation.jsValue() - object[Strings.exposureTime] = exposureTime.jsValue() - object[Strings.colorTemperature] = colorTemperature.jsValue() - object[Strings.iso] = iso.jsValue() - object[Strings.brightness] = brightness.jsValue() - object[Strings.contrast] = contrast.jsValue() - object[Strings.saturation] = saturation.jsValue() - object[Strings.sharpness] = sharpness.jsValue() - object[Strings.focusDistance] = focusDistance.jsValue() - object[Strings.pan] = pan.jsValue() - object[Strings.tilt] = tilt.jsValue() - object[Strings.zoom] = zoom.jsValue() - object[Strings.torch] = torch.jsValue() - 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() - object[Strings.displaySurface] = displaySurface.jsValue() - object[Strings.logicalSurface] = logicalSurface.jsValue() - object[Strings.cursor] = cursor.jsValue() + object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue + object[Strings.exposureMode] = exposureMode.jsValue + object[Strings.focusMode] = focusMode.jsValue + object[Strings.exposureCompensation] = exposureCompensation.jsValue + object[Strings.exposureTime] = exposureTime.jsValue + object[Strings.colorTemperature] = colorTemperature.jsValue + object[Strings.iso] = iso.jsValue + object[Strings.brightness] = brightness.jsValue + object[Strings.contrast] = contrast.jsValue + object[Strings.saturation] = saturation.jsValue + object[Strings.sharpness] = sharpness.jsValue + object[Strings.focusDistance] = focusDistance.jsValue + object[Strings.pan] = pan.jsValue + object[Strings.tilt] = tilt.jsValue + object[Strings.zoom] = zoom.jsValue + object[Strings.torch] = torch.jsValue + 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 + object[Strings.displaySurface] = displaySurface.jsValue + object[Strings.logicalSurface] = logicalSurface.jsValue + object[Strings.cursor] = cursor.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift index 21354fec..15ef7501 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift @@ -6,43 +6,43 @@ import JavaScriptKit public class MediaTrackConstraintSet: BridgedDictionary { public convenience init(whiteBalanceMode: ConstrainDOMString, exposureMode: ConstrainDOMString, focusMode: ConstrainDOMString, pointsOfInterest: ConstrainPoint2D, exposureCompensation: ConstrainDouble, exposureTime: ConstrainDouble, colorTemperature: ConstrainDouble, iso: ConstrainDouble, brightness: ConstrainDouble, contrast: ConstrainDouble, saturation: ConstrainDouble, sharpness: ConstrainDouble, focusDistance: ConstrainDouble, pan: Bool_or_ConstrainDouble, tilt: Bool_or_ConstrainDouble, zoom: Bool_or_ConstrainDouble, torch: ConstrainBoolean, 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, displaySurface: ConstrainDOMString, logicalSurface: ConstrainBoolean, cursor: ConstrainDOMString, restrictOwnAudio: ConstrainBoolean, suppressLocalAudioPlayback: ConstrainBoolean) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() - object[Strings.exposureMode] = exposureMode.jsValue() - object[Strings.focusMode] = focusMode.jsValue() - object[Strings.pointsOfInterest] = pointsOfInterest.jsValue() - object[Strings.exposureCompensation] = exposureCompensation.jsValue() - object[Strings.exposureTime] = exposureTime.jsValue() - object[Strings.colorTemperature] = colorTemperature.jsValue() - object[Strings.iso] = iso.jsValue() - object[Strings.brightness] = brightness.jsValue() - object[Strings.contrast] = contrast.jsValue() - object[Strings.saturation] = saturation.jsValue() - object[Strings.sharpness] = sharpness.jsValue() - object[Strings.focusDistance] = focusDistance.jsValue() - object[Strings.pan] = pan.jsValue() - object[Strings.tilt] = tilt.jsValue() - object[Strings.zoom] = zoom.jsValue() - object[Strings.torch] = torch.jsValue() - 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() - object[Strings.displaySurface] = displaySurface.jsValue() - object[Strings.logicalSurface] = logicalSurface.jsValue() - object[Strings.cursor] = cursor.jsValue() - object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue() - object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue() + object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue + object[Strings.exposureMode] = exposureMode.jsValue + object[Strings.focusMode] = focusMode.jsValue + object[Strings.pointsOfInterest] = pointsOfInterest.jsValue + object[Strings.exposureCompensation] = exposureCompensation.jsValue + object[Strings.exposureTime] = exposureTime.jsValue + object[Strings.colorTemperature] = colorTemperature.jsValue + object[Strings.iso] = iso.jsValue + object[Strings.brightness] = brightness.jsValue + object[Strings.contrast] = contrast.jsValue + object[Strings.saturation] = saturation.jsValue + object[Strings.sharpness] = sharpness.jsValue + object[Strings.focusDistance] = focusDistance.jsValue + object[Strings.pan] = pan.jsValue + object[Strings.tilt] = tilt.jsValue + object[Strings.zoom] = zoom.jsValue + object[Strings.torch] = torch.jsValue + 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 + object[Strings.displaySurface] = displaySurface.jsValue + object[Strings.logicalSurface] = logicalSurface.jsValue + object[Strings.cursor] = cursor.jsValue + object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue + object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift index 41b7299f..5307db8a 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MediaTrackConstraints: BridgedDictionary { public convenience init(advanced: [MediaTrackConstraintSet]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.advanced] = advanced.jsValue() + object[Strings.advanced] = advanced.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift index 8a6d3b24..cac9524d 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift @@ -6,42 +6,42 @@ import JavaScriptKit public class MediaTrackSettings: BridgedDictionary { public convenience init(whiteBalanceMode: String, exposureMode: String, focusMode: String, pointsOfInterest: [Point2D], exposureCompensation: Double, exposureTime: Double, colorTemperature: Double, iso: Double, brightness: Double, contrast: Double, saturation: Double, sharpness: Double, focusDistance: Double, pan: Double, tilt: Double, zoom: Double, torch: Bool, 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, displaySurface: String, logicalSurface: Bool, cursor: String, restrictOwnAudio: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() - object[Strings.exposureMode] = exposureMode.jsValue() - object[Strings.focusMode] = focusMode.jsValue() - object[Strings.pointsOfInterest] = pointsOfInterest.jsValue() - object[Strings.exposureCompensation] = exposureCompensation.jsValue() - object[Strings.exposureTime] = exposureTime.jsValue() - object[Strings.colorTemperature] = colorTemperature.jsValue() - object[Strings.iso] = iso.jsValue() - object[Strings.brightness] = brightness.jsValue() - object[Strings.contrast] = contrast.jsValue() - object[Strings.saturation] = saturation.jsValue() - object[Strings.sharpness] = sharpness.jsValue() - object[Strings.focusDistance] = focusDistance.jsValue() - object[Strings.pan] = pan.jsValue() - object[Strings.tilt] = tilt.jsValue() - object[Strings.zoom] = zoom.jsValue() - object[Strings.torch] = torch.jsValue() - 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() - object[Strings.displaySurface] = displaySurface.jsValue() - object[Strings.logicalSurface] = logicalSurface.jsValue() - object[Strings.cursor] = cursor.jsValue() - object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue() + object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue + object[Strings.exposureMode] = exposureMode.jsValue + object[Strings.focusMode] = focusMode.jsValue + object[Strings.pointsOfInterest] = pointsOfInterest.jsValue + object[Strings.exposureCompensation] = exposureCompensation.jsValue + object[Strings.exposureTime] = exposureTime.jsValue + object[Strings.colorTemperature] = colorTemperature.jsValue + object[Strings.iso] = iso.jsValue + object[Strings.brightness] = brightness.jsValue + object[Strings.contrast] = contrast.jsValue + object[Strings.saturation] = saturation.jsValue + object[Strings.sharpness] = sharpness.jsValue + object[Strings.focusDistance] = focusDistance.jsValue + object[Strings.pan] = pan.jsValue + object[Strings.tilt] = tilt.jsValue + object[Strings.zoom] = zoom.jsValue + object[Strings.torch] = torch.jsValue + 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 + object[Strings.displaySurface] = displaySurface.jsValue + object[Strings.logicalSurface] = logicalSurface.jsValue + object[Strings.cursor] = cursor.jsValue + object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift index 9911b6eb..fda3f3b4 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift @@ -6,43 +6,43 @@ import JavaScriptKit public class MediaTrackSupportedConstraints: BridgedDictionary { public convenience init(whiteBalanceMode: Bool, exposureMode: Bool, focusMode: Bool, pointsOfInterest: Bool, exposureCompensation: Bool, exposureTime: Bool, colorTemperature: Bool, iso: Bool, brightness: Bool, contrast: Bool, pan: Bool, saturation: Bool, sharpness: Bool, focusDistance: Bool, tilt: Bool, zoom: Bool, torch: Bool, 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, displaySurface: Bool, logicalSurface: Bool, cursor: Bool, restrictOwnAudio: Bool, suppressLocalAudioPlayback: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue() - object[Strings.exposureMode] = exposureMode.jsValue() - object[Strings.focusMode] = focusMode.jsValue() - object[Strings.pointsOfInterest] = pointsOfInterest.jsValue() - object[Strings.exposureCompensation] = exposureCompensation.jsValue() - object[Strings.exposureTime] = exposureTime.jsValue() - object[Strings.colorTemperature] = colorTemperature.jsValue() - object[Strings.iso] = iso.jsValue() - object[Strings.brightness] = brightness.jsValue() - object[Strings.contrast] = contrast.jsValue() - object[Strings.pan] = pan.jsValue() - object[Strings.saturation] = saturation.jsValue() - object[Strings.sharpness] = sharpness.jsValue() - object[Strings.focusDistance] = focusDistance.jsValue() - object[Strings.tilt] = tilt.jsValue() - object[Strings.zoom] = zoom.jsValue() - object[Strings.torch] = torch.jsValue() - 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() - object[Strings.displaySurface] = displaySurface.jsValue() - object[Strings.logicalSurface] = logicalSurface.jsValue() - object[Strings.cursor] = cursor.jsValue() - object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue() - object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue() + object[Strings.whiteBalanceMode] = whiteBalanceMode.jsValue + object[Strings.exposureMode] = exposureMode.jsValue + object[Strings.focusMode] = focusMode.jsValue + object[Strings.pointsOfInterest] = pointsOfInterest.jsValue + object[Strings.exposureCompensation] = exposureCompensation.jsValue + object[Strings.exposureTime] = exposureTime.jsValue + object[Strings.colorTemperature] = colorTemperature.jsValue + object[Strings.iso] = iso.jsValue + object[Strings.brightness] = brightness.jsValue + object[Strings.contrast] = contrast.jsValue + object[Strings.pan] = pan.jsValue + object[Strings.saturation] = saturation.jsValue + object[Strings.sharpness] = sharpness.jsValue + object[Strings.focusDistance] = focusDistance.jsValue + object[Strings.tilt] = tilt.jsValue + object[Strings.zoom] = zoom.jsValue + object[Strings.torch] = torch.jsValue + 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 + object[Strings.displaySurface] = displaySurface.jsValue + object[Strings.logicalSurface] = logicalSurface.jsValue + object[Strings.cursor] = cursor.jsValue + object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue + object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Memory.swift b/Sources/DOMKit/WebIDL/Memory.swift index 688b6e50..b2a4e01d 100644 --- a/Sources/DOMKit/WebIDL/Memory.swift +++ b/Sources/DOMKit/WebIDL/Memory.swift @@ -14,12 +14,12 @@ public class Memory: JSBridgedClass { } @inlinable public convenience init(descriptor: MemoryDescriptor) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue])) } @inlinable public func grow(delta: UInt32) -> UInt32 { let this = jsObject - return this[Strings.grow].function!(this: this, arguments: [delta.jsValue()]).fromJSValue()! + return this[Strings.grow].function!(this: this, arguments: [delta.jsValue]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/MemoryAttribution.swift b/Sources/DOMKit/WebIDL/MemoryAttribution.swift index 75212ae3..f4a4c13d 100644 --- a/Sources/DOMKit/WebIDL/MemoryAttribution.swift +++ b/Sources/DOMKit/WebIDL/MemoryAttribution.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MemoryAttribution: BridgedDictionary { public convenience init(url: String, container: MemoryAttributionContainer, scope: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.url] = url.jsValue() - object[Strings.container] = container.jsValue() - object[Strings.scope] = scope.jsValue() + object[Strings.url] = url.jsValue + object[Strings.container] = container.jsValue + object[Strings.scope] = scope.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift b/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift index c28b66fd..da512030 100644 --- a/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift +++ b/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MemoryAttributionContainer: BridgedDictionary { public convenience init(id: String, src: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue() - object[Strings.src] = src.jsValue() + object[Strings.id] = id.jsValue + object[Strings.src] = src.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift b/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift index 968f5b71..0c7a8b05 100644 --- a/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift +++ b/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MemoryBreakdownEntry: BridgedDictionary { public convenience init(bytes: UInt64, attribution: [MemoryAttribution], types: [String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bytes] = bytes.jsValue() - object[Strings.attribution] = attribution.jsValue() - object[Strings.types] = types.jsValue() + object[Strings.bytes] = bytes.jsValue + object[Strings.attribution] = attribution.jsValue + object[Strings.types] = types.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MemoryDescriptor.swift b/Sources/DOMKit/WebIDL/MemoryDescriptor.swift index 67809d2e..2853647b 100644 --- a/Sources/DOMKit/WebIDL/MemoryDescriptor.swift +++ b/Sources/DOMKit/WebIDL/MemoryDescriptor.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MemoryDescriptor: BridgedDictionary { public convenience init(initial: UInt32, maximum: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.initial] = initial.jsValue() - object[Strings.maximum] = maximum.jsValue() + object[Strings.initial] = initial.jsValue + object[Strings.maximum] = maximum.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MemoryMeasurement.swift b/Sources/DOMKit/WebIDL/MemoryMeasurement.swift index 44a93e91..349b84e8 100644 --- a/Sources/DOMKit/WebIDL/MemoryMeasurement.swift +++ b/Sources/DOMKit/WebIDL/MemoryMeasurement.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MemoryMeasurement: BridgedDictionary { public convenience init(bytes: UInt64, breakdown: [MemoryBreakdownEntry]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bytes] = bytes.jsValue() - object[Strings.breakdown] = breakdown.jsValue() + object[Strings.bytes] = bytes.jsValue + object[Strings.breakdown] = breakdown.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MessageEvent.swift b/Sources/DOMKit/WebIDL/MessageEvent.swift index b9bd8dca..d2b8bebf 100644 --- a/Sources/DOMKit/WebIDL/MessageEvent.swift +++ b/Sources/DOMKit/WebIDL/MessageEvent.swift @@ -16,7 +16,7 @@ public class MessageEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: MessageEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -35,14 +35,14 @@ public class MessageEvent: Event { 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 _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]) } diff --git a/Sources/DOMKit/WebIDL/MessageEventInit.swift b/Sources/DOMKit/WebIDL/MessageEventInit.swift index 02a7a91a..61761d89 100644 --- a/Sources/DOMKit/WebIDL/MessageEventInit.swift +++ b/Sources/DOMKit/WebIDL/MessageEventInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit 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() + 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) } diff --git a/Sources/DOMKit/WebIDL/MessageEventSource.swift b/Sources/DOMKit/WebIDL/MessageEventSource.swift index 43cefc39..b3ad48ac 100644 --- a/Sources/DOMKit/WebIDL/MessageEventSource.swift +++ b/Sources/DOMKit/WebIDL/MessageEventSource.swift @@ -26,14 +26,14 @@ public enum MessageEventSource: JSValueCompatible, Any_MessageEventSource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .messagePort(messagePort): - return messagePort.jsValue() + return messagePort.jsValue case let .serviceWorker(serviceWorker): - return serviceWorker.jsValue() + return serviceWorker.jsValue case let .windowProxy(windowProxy): - return windowProxy.jsValue() + return windowProxy.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/MessagePort.swift b/Sources/DOMKit/WebIDL/MessagePort.swift index 6fa7e3df..d569eccf 100644 --- a/Sources/DOMKit/WebIDL/MessagePort.swift +++ b/Sources/DOMKit/WebIDL/MessagePort.swift @@ -14,12 +14,12 @@ public class MessagePort: EventTarget { @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, transfer.jsValue]) } @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]) } @inlinable public func start() { diff --git a/Sources/DOMKit/WebIDL/MeteringMode.swift b/Sources/DOMKit/WebIDL/MeteringMode.swift index e33816a7..2a08ed53 100644 --- a/Sources/DOMKit/WebIDL/MeteringMode.swift +++ b/Sources/DOMKit/WebIDL/MeteringMode.swift @@ -20,5 +20,5 @@ public enum MeteringMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift index 2d27a8cc..d46c874c 100644 --- a/Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MidiPermissionDescriptor: BridgedDictionary { public convenience init(sysex: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sysex] = sysex.jsValue() + object[Strings.sysex] = sysex.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift b/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift index 5c38cebf..6c3bc10e 100644 --- a/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MockCameraConfiguration: BridgedDictionary { public convenience init(defaultFrameRate: Double, facingMode: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.defaultFrameRate] = defaultFrameRate.jsValue() - object[Strings.facingMode] = facingMode.jsValue() + object[Strings.defaultFrameRate] = defaultFrameRate.jsValue + object[Strings.facingMode] = facingMode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift b/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift index aebbecae..eb11d856 100644 --- a/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MockCaptureDeviceConfiguration: BridgedDictionary { public convenience init(label: String, deviceId: String, groupId: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue() - object[Strings.deviceId] = deviceId.jsValue() - object[Strings.groupId] = groupId.jsValue() + object[Strings.label] = label.jsValue + object[Strings.deviceId] = deviceId.jsValue + object[Strings.groupId] = groupId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift b/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift index f092f4d8..44d35d35 100644 --- a/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift +++ b/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift @@ -18,5 +18,5 @@ public enum MockCapturePromptResult: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift b/Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift index 3e7c49e2..ae098160 100644 --- a/Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class MockCapturePromptResultConfiguration: BridgedDictionary { public convenience init(getUserMedia: MockCapturePromptResult, getDisplayMedia: MockCapturePromptResult) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.getUserMedia] = getUserMedia.jsValue() - object[Strings.getDisplayMedia] = getDisplayMedia.jsValue() + object[Strings.getUserMedia] = getUserMedia.jsValue + object[Strings.getDisplayMedia] = getDisplayMedia.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift b/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift index 504ed877..bacedcc5 100644 --- a/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MockMicrophoneConfiguration: BridgedDictionary { public convenience init(defaultSampleRate: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.defaultSampleRate] = defaultSampleRate.jsValue() + object[Strings.defaultSampleRate] = defaultSampleRate.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MockSensor.swift b/Sources/DOMKit/WebIDL/MockSensor.swift index 713e27a0..ebb51b09 100644 --- a/Sources/DOMKit/WebIDL/MockSensor.swift +++ b/Sources/DOMKit/WebIDL/MockSensor.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class MockSensor: BridgedDictionary { public convenience init(maxSamplingFrequency: Double, minSamplingFrequency: Double, requestedSamplingFrequency: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.maxSamplingFrequency] = maxSamplingFrequency.jsValue() - object[Strings.minSamplingFrequency] = minSamplingFrequency.jsValue() - object[Strings.requestedSamplingFrequency] = requestedSamplingFrequency.jsValue() + object[Strings.maxSamplingFrequency] = maxSamplingFrequency.jsValue + object[Strings.minSamplingFrequency] = minSamplingFrequency.jsValue + object[Strings.requestedSamplingFrequency] = requestedSamplingFrequency.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift b/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift index 44205204..569c32ae 100644 --- a/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift +++ b/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class MockSensorConfiguration: BridgedDictionary { public convenience init(mockSensorType: MockSensorType, connected: Bool, maxSamplingFrequency: Double?, minSamplingFrequency: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mockSensorType] = mockSensorType.jsValue() - object[Strings.connected] = connected.jsValue() - object[Strings.maxSamplingFrequency] = maxSamplingFrequency.jsValue() - object[Strings.minSamplingFrequency] = minSamplingFrequency.jsValue() + object[Strings.mockSensorType] = mockSensorType.jsValue + object[Strings.connected] = connected.jsValue + object[Strings.maxSamplingFrequency] = maxSamplingFrequency.jsValue + object[Strings.minSamplingFrequency] = minSamplingFrequency.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MockSensorType.swift b/Sources/DOMKit/WebIDL/MockSensorType.swift index 1efb384e..5387a9e7 100644 --- a/Sources/DOMKit/WebIDL/MockSensorType.swift +++ b/Sources/DOMKit/WebIDL/MockSensorType.swift @@ -27,5 +27,5 @@ public enum MockSensorType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Module.swift b/Sources/DOMKit/WebIDL/Module.swift index 23eb152b..78d7385e 100644 --- a/Sources/DOMKit/WebIDL/Module.swift +++ b/Sources/DOMKit/WebIDL/Module.swift @@ -13,21 +13,21 @@ public class Module: JSBridgedClass { } @inlinable public convenience init(bytes: BufferSource) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [bytes.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [bytes.jsValue])) } @inlinable public static func exports(moduleObject: Module) -> [ModuleExportDescriptor] { let this = constructor - return this[Strings.exports].function!(this: this, arguments: [moduleObject.jsValue()]).fromJSValue()! + return this[Strings.exports].function!(this: this, arguments: [moduleObject.jsValue]).fromJSValue()! } @inlinable public static func imports(moduleObject: Module) -> [ModuleImportDescriptor] { let this = constructor - return this[Strings.imports].function!(this: this, arguments: [moduleObject.jsValue()]).fromJSValue()! + return this[Strings.imports].function!(this: this, arguments: [moduleObject.jsValue]).fromJSValue()! } @inlinable public static func customSections(moduleObject: Module, sectionName: String) -> [ArrayBuffer] { let this = constructor - return this[Strings.customSections].function!(this: this, arguments: [moduleObject.jsValue(), sectionName.jsValue()]).fromJSValue()! + return this[Strings.customSections].function!(this: this, arguments: [moduleObject.jsValue, sectionName.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift b/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift index 3cfb04bf..6e85b9ec 100644 --- a/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift +++ b/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ModuleExportDescriptor: BridgedDictionary { public convenience init(name: String, kind: ImportExportKind) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.kind] = kind.jsValue() + object[Strings.name] = name.jsValue + object[Strings.kind] = kind.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift b/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift index e81eb254..48707ea9 100644 --- a/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift +++ b/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class ModuleImportDescriptor: BridgedDictionary { public convenience init(module: String, name: String, kind: ImportExportKind) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.module] = module.jsValue() - object[Strings.name] = name.jsValue() - object[Strings.kind] = kind.jsValue() + object[Strings.module] = module.jsValue + object[Strings.name] = name.jsValue + object[Strings.kind] = kind.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index dfa69031..0408017a 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -54,7 +54,7 @@ public class MouseEvent: UIEvent { public var movementY: Double @inlinable public convenience init(type: String, eventInitDict: MouseEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -92,25 +92,25 @@ public class MouseEvent: UIEvent { @inlinable public func getModifierState(keyArg: String) -> Bool { let this = jsObject - return this[Strings.getModifierState].function!(this: this, arguments: [keyArg.jsValue()]).fromJSValue()! + return this[Strings.getModifierState].function!(this: this, arguments: [keyArg.jsValue]).fromJSValue()! } @inlinable public func initMouseEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil, screenXArg: Int32? = nil, screenYArg: Int32? = nil, clientXArg: Int32? = nil, clientYArg: Int32? = nil, ctrlKeyArg: Bool? = nil, altKeyArg: Bool? = nil, shiftKeyArg: Bool? = nil, metaKeyArg: Bool? = nil, buttonArg: Int16? = nil, relatedTargetArg: EventTarget? = nil) { - let _arg0 = typeArg.jsValue() - let _arg1 = bubblesArg?.jsValue() ?? .undefined - let _arg2 = cancelableArg?.jsValue() ?? .undefined - let _arg3 = viewArg?.jsValue() ?? .undefined - let _arg4 = detailArg?.jsValue() ?? .undefined - let _arg5 = screenXArg?.jsValue() ?? .undefined - let _arg6 = screenYArg?.jsValue() ?? .undefined - let _arg7 = clientXArg?.jsValue() ?? .undefined - let _arg8 = clientYArg?.jsValue() ?? .undefined - let _arg9 = ctrlKeyArg?.jsValue() ?? .undefined - let _arg10 = altKeyArg?.jsValue() ?? .undefined - let _arg11 = shiftKeyArg?.jsValue() ?? .undefined - let _arg12 = metaKeyArg?.jsValue() ?? .undefined - let _arg13 = buttonArg?.jsValue() ?? .undefined - let _arg14 = relatedTargetArg?.jsValue() ?? .undefined + let _arg0 = typeArg.jsValue + let _arg1 = bubblesArg?.jsValue ?? .undefined + let _arg2 = cancelableArg?.jsValue ?? .undefined + let _arg3 = viewArg?.jsValue ?? .undefined + let _arg4 = detailArg?.jsValue ?? .undefined + let _arg5 = screenXArg?.jsValue ?? .undefined + let _arg6 = screenYArg?.jsValue ?? .undefined + let _arg7 = clientXArg?.jsValue ?? .undefined + let _arg8 = clientYArg?.jsValue ?? .undefined + let _arg9 = ctrlKeyArg?.jsValue ?? .undefined + let _arg10 = altKeyArg?.jsValue ?? .undefined + let _arg11 = shiftKeyArg?.jsValue ?? .undefined + let _arg12 = metaKeyArg?.jsValue ?? .undefined + let _arg13 = buttonArg?.jsValue ?? .undefined + let _arg14 = relatedTargetArg?.jsValue ?? .undefined let this = jsObject _ = this[Strings.initMouseEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14]) } diff --git a/Sources/DOMKit/WebIDL/MouseEventInit.swift b/Sources/DOMKit/WebIDL/MouseEventInit.swift index 032c83e2..ce3b6fad 100644 --- a/Sources/DOMKit/WebIDL/MouseEventInit.swift +++ b/Sources/DOMKit/WebIDL/MouseEventInit.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class MouseEventInit: BridgedDictionary { public convenience init(movementX: Double, movementY: Double, screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.movementX] = movementX.jsValue() - object[Strings.movementY] = movementY.jsValue() - object[Strings.screenX] = screenX.jsValue() - object[Strings.screenY] = screenY.jsValue() - object[Strings.clientX] = clientX.jsValue() - object[Strings.clientY] = clientY.jsValue() - object[Strings.button] = button.jsValue() - object[Strings.buttons] = buttons.jsValue() - object[Strings.relatedTarget] = relatedTarget.jsValue() + object[Strings.movementX] = movementX.jsValue + object[Strings.movementY] = movementY.jsValue + object[Strings.screenX] = screenX.jsValue + object[Strings.screenY] = screenY.jsValue + object[Strings.clientX] = clientX.jsValue + object[Strings.clientY] = clientY.jsValue + object[Strings.button] = button.jsValue + object[Strings.buttons] = buttons.jsValue + object[Strings.relatedTarget] = relatedTarget.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MultiCacheQueryOptions.swift b/Sources/DOMKit/WebIDL/MultiCacheQueryOptions.swift index 07f4abac..94a1f466 100644 --- a/Sources/DOMKit/WebIDL/MultiCacheQueryOptions.swift +++ b/Sources/DOMKit/WebIDL/MultiCacheQueryOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class MultiCacheQueryOptions: BridgedDictionary { public convenience init(cacheName: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.cacheName] = cacheName.jsValue() + object[Strings.cacheName] = cacheName.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/MutationEvent.swift b/Sources/DOMKit/WebIDL/MutationEvent.swift index cfa657c0..d81e064e 100644 --- a/Sources/DOMKit/WebIDL/MutationEvent.swift +++ b/Sources/DOMKit/WebIDL/MutationEvent.swift @@ -37,14 +37,14 @@ public class MutationEvent: Event { public var attrChange: UInt16 @inlinable public func initMutationEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, relatedNodeArg: Node? = nil, prevValueArg: String? = nil, newValueArg: String? = nil, attrNameArg: String? = nil, attrChangeArg: UInt16? = nil) { - let _arg0 = typeArg.jsValue() - let _arg1 = bubblesArg?.jsValue() ?? .undefined - let _arg2 = cancelableArg?.jsValue() ?? .undefined - let _arg3 = relatedNodeArg?.jsValue() ?? .undefined - let _arg4 = prevValueArg?.jsValue() ?? .undefined - let _arg5 = newValueArg?.jsValue() ?? .undefined - let _arg6 = attrNameArg?.jsValue() ?? .undefined - let _arg7 = attrChangeArg?.jsValue() ?? .undefined + let _arg0 = typeArg.jsValue + let _arg1 = bubblesArg?.jsValue ?? .undefined + let _arg2 = cancelableArg?.jsValue ?? .undefined + let _arg3 = relatedNodeArg?.jsValue ?? .undefined + let _arg4 = prevValueArg?.jsValue ?? .undefined + let _arg5 = newValueArg?.jsValue ?? .undefined + let _arg6 = attrNameArg?.jsValue ?? .undefined + let _arg7 = attrChangeArg?.jsValue ?? .undefined let this = jsObject _ = this[Strings.initMutationEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } diff --git a/Sources/DOMKit/WebIDL/MutationObserver.swift b/Sources/DOMKit/WebIDL/MutationObserver.swift index c5d68b98..9dd93278 100644 --- a/Sources/DOMKit/WebIDL/MutationObserver.swift +++ b/Sources/DOMKit/WebIDL/MutationObserver.swift @@ -16,7 +16,7 @@ public class MutationObserver: JSBridgedClass { @inlinable public func observe(target: Node, options: MutationObserverInit? = nil) { let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue, options?.jsValue ?? .undefined]) } @inlinable public func disconnect() { diff --git a/Sources/DOMKit/WebIDL/MutationObserverInit.swift b/Sources/DOMKit/WebIDL/MutationObserverInit.swift index 289eb900..ae71401c 100644 --- a/Sources/DOMKit/WebIDL/MutationObserverInit.swift +++ b/Sources/DOMKit/WebIDL/MutationObserverInit.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class MutationObserverInit: BridgedDictionary { public convenience init(childList: Bool, attributes: Bool, characterData: Bool, subtree: Bool, attributeOldValue: Bool, characterDataOldValue: Bool, attributeFilter: [String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.childList] = childList.jsValue() - object[Strings.attributes] = attributes.jsValue() - object[Strings.characterData] = characterData.jsValue() - object[Strings.subtree] = subtree.jsValue() - object[Strings.attributeOldValue] = attributeOldValue.jsValue() - object[Strings.characterDataOldValue] = characterDataOldValue.jsValue() - object[Strings.attributeFilter] = attributeFilter.jsValue() + object[Strings.childList] = childList.jsValue + object[Strings.attributes] = attributes.jsValue + object[Strings.characterData] = characterData.jsValue + object[Strings.subtree] = subtree.jsValue + object[Strings.attributeOldValue] = attributeOldValue.jsValue + object[Strings.characterDataOldValue] = characterDataOldValue.jsValue + object[Strings.attributeFilter] = attributeFilter.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift b/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift index b6e270f1..63bbc4d5 100644 --- a/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift +++ b/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class NDEFMakeReadOnlyOptions: BridgedDictionary { public convenience init(signal: AbortSignal?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue() + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NDEFMessage.swift b/Sources/DOMKit/WebIDL/NDEFMessage.swift index 4229c101..2f6a859e 100644 --- a/Sources/DOMKit/WebIDL/NDEFMessage.swift +++ b/Sources/DOMKit/WebIDL/NDEFMessage.swift @@ -14,7 +14,7 @@ public class NDEFMessage: JSBridgedClass { } @inlinable public convenience init(messageInit: NDEFMessageInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [messageInit.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [messageInit.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NDEFMessageInit.swift b/Sources/DOMKit/WebIDL/NDEFMessageInit.swift index 712af7cf..3f0a57c0 100644 --- a/Sources/DOMKit/WebIDL/NDEFMessageInit.swift +++ b/Sources/DOMKit/WebIDL/NDEFMessageInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class NDEFMessageInit: BridgedDictionary { public convenience init(records: [NDEFRecordInit]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.records] = records.jsValue() + object[Strings.records] = records.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NDEFMessageSource.swift b/Sources/DOMKit/WebIDL/NDEFMessageSource.swift index 292220d8..14eec83a 100644 --- a/Sources/DOMKit/WebIDL/NDEFMessageSource.swift +++ b/Sources/DOMKit/WebIDL/NDEFMessageSource.swift @@ -26,14 +26,14 @@ public enum NDEFMessageSource: JSValueCompatible, Any_NDEFMessageSource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .bufferSource(bufferSource): - return bufferSource.jsValue() + return bufferSource.jsValue case let .nDEFMessageInit(nDEFMessageInit): - return nDEFMessageInit.jsValue() + return nDEFMessageInit.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/NDEFReader.swift b/Sources/DOMKit/WebIDL/NDEFReader.swift index bc4b66db..e9d55087 100644 --- a/Sources/DOMKit/WebIDL/NDEFReader.swift +++ b/Sources/DOMKit/WebIDL/NDEFReader.swift @@ -24,37 +24,37 @@ public class NDEFReader: EventTarget { @inlinable public func scan(options: NDEFScanOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.scan].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.scan].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func scan(options: NDEFScanOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.scan].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.scan].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.write].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.write].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift b/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift index a3f45b79..17861eb4 100644 --- a/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift +++ b/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift @@ -13,7 +13,7 @@ public class NDEFReadingEvent: Event { } @inlinable public convenience init(type: String, readingEventInitDict: NDEFReadingEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), readingEventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, readingEventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift b/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift index 80241ae1..9426e951 100644 --- a/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift +++ b/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class NDEFReadingEventInit: BridgedDictionary { public convenience init(serialNumber: String?, message: NDEFMessageInit) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.serialNumber] = serialNumber.jsValue() - object[Strings.message] = message.jsValue() + object[Strings.serialNumber] = serialNumber.jsValue + object[Strings.message] = message.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NDEFRecord.swift b/Sources/DOMKit/WebIDL/NDEFRecord.swift index e18ca0f0..f5a38372 100644 --- a/Sources/DOMKit/WebIDL/NDEFRecord.swift +++ b/Sources/DOMKit/WebIDL/NDEFRecord.swift @@ -19,7 +19,7 @@ public class NDEFRecord: JSBridgedClass { } @inlinable public convenience init(recordInit: NDEFRecordInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [recordInit.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [recordInit.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NDEFRecordInit.swift b/Sources/DOMKit/WebIDL/NDEFRecordInit.swift index 5b87c281..e264bc6a 100644 --- a/Sources/DOMKit/WebIDL/NDEFRecordInit.swift +++ b/Sources/DOMKit/WebIDL/NDEFRecordInit.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class NDEFRecordInit: BridgedDictionary { public convenience init(recordType: String, mediaType: String, id: String, encoding: String, lang: String, data: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.recordType] = recordType.jsValue() - object[Strings.mediaType] = mediaType.jsValue() - object[Strings.id] = id.jsValue() - object[Strings.encoding] = encoding.jsValue() - object[Strings.lang] = lang.jsValue() - object[Strings.data] = data.jsValue() + object[Strings.recordType] = recordType.jsValue + object[Strings.mediaType] = mediaType.jsValue + object[Strings.id] = id.jsValue + object[Strings.encoding] = encoding.jsValue + object[Strings.lang] = lang.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NDEFScanOptions.swift b/Sources/DOMKit/WebIDL/NDEFScanOptions.swift index c44f9748..89d6ae05 100644 --- a/Sources/DOMKit/WebIDL/NDEFScanOptions.swift +++ b/Sources/DOMKit/WebIDL/NDEFScanOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class NDEFScanOptions: BridgedDictionary { public convenience init(signal: AbortSignal) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue() + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift b/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift index b3efe368..cf54fab5 100644 --- a/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift +++ b/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class NDEFWriteOptions: BridgedDictionary { public convenience init(overwrite: Bool, signal: AbortSignal?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.overwrite] = overwrite.jsValue() - object[Strings.signal] = signal.jsValue() + object[Strings.overwrite] = overwrite.jsValue + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NamedFlow.swift b/Sources/DOMKit/WebIDL/NamedFlow.swift index fd9f3b7e..7de33b83 100644 --- a/Sources/DOMKit/WebIDL/NamedFlow.swift +++ b/Sources/DOMKit/WebIDL/NamedFlow.swift @@ -34,6 +34,6 @@ public class NamedFlow: EventTarget { @inlinable public func getRegionsByContent(node: Node) -> [Element] { let this = jsObject - return this[Strings.getRegionsByContent].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! + return this[Strings.getRegionsByContent].function!(this: this, arguments: [node.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NamedNodeMap.swift b/Sources/DOMKit/WebIDL/NamedNodeMap.swift index 15eaab84..36468f52 100644 --- a/Sources/DOMKit/WebIDL/NamedNodeMap.swift +++ b/Sources/DOMKit/WebIDL/NamedNodeMap.swift @@ -26,26 +26,26 @@ public class NamedNodeMap: JSBridgedClass { @inlinable public func getNamedItemNS(namespace: String?, localName: String) -> Attr? { let this = jsObject - return this[Strings.getNamedItemNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! + return this[Strings.getNamedItemNS].function!(this: this, arguments: [namespace.jsValue, localName.jsValue]).fromJSValue()! } @inlinable public func setNamedItem(attr: Attr) -> Attr? { let this = jsObject - return this[Strings.setNamedItem].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! + return this[Strings.setNamedItem].function!(this: this, arguments: [attr.jsValue]).fromJSValue()! } @inlinable public func setNamedItemNS(attr: Attr) -> Attr? { let this = jsObject - return this[Strings.setNamedItemNS].function!(this: this, arguments: [attr.jsValue()]).fromJSValue()! + return this[Strings.setNamedItemNS].function!(this: this, arguments: [attr.jsValue]).fromJSValue()! } @inlinable public func removeNamedItem(qualifiedName: String) -> Attr { let this = jsObject - return this[Strings.removeNamedItem].function!(this: this, arguments: [qualifiedName.jsValue()]).fromJSValue()! + return this[Strings.removeNamedItem].function!(this: this, arguments: [qualifiedName.jsValue]).fromJSValue()! } @inlinable public func removeNamedItemNS(namespace: String?, localName: String) -> Attr { let this = jsObject - return this[Strings.removeNamedItemNS].function!(this: this, arguments: [namespace.jsValue(), localName.jsValue()]).fromJSValue()! + return this[Strings.removeNamedItemNS].function!(this: this, arguments: [namespace.jsValue, localName.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NavigateEvent.swift b/Sources/DOMKit/WebIDL/NavigateEvent.swift index 511a72d5..5f386dbb 100644 --- a/Sources/DOMKit/WebIDL/NavigateEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigateEvent.swift @@ -19,7 +19,7 @@ public class NavigateEvent: Event { } @inlinable public convenience init(type: String, eventInit: NavigateEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInit.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInit.jsValue])) } @ReadonlyAttribute @@ -48,6 +48,6 @@ public class NavigateEvent: Event { @inlinable public func transitionWhile(newNavigationAction: JSPromise) { let this = jsObject - _ = this[Strings.transitionWhile].function!(this: this, arguments: [newNavigationAction.jsValue()]) + _ = this[Strings.transitionWhile].function!(this: this, arguments: [newNavigationAction.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/NavigateEventInit.swift b/Sources/DOMKit/WebIDL/NavigateEventInit.swift index f9509528..8b70a640 100644 --- a/Sources/DOMKit/WebIDL/NavigateEventInit.swift +++ b/Sources/DOMKit/WebIDL/NavigateEventInit.swift @@ -6,14 +6,14 @@ import JavaScriptKit public class NavigateEventInit: BridgedDictionary { public convenience init(navigationType: NavigationNavigationType, destination: NavigationDestination, canTransition: Bool, userInitiated: Bool, hashChange: Bool, signal: AbortSignal, formData: FormData?, info: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.navigationType] = navigationType.jsValue() - object[Strings.destination] = destination.jsValue() - object[Strings.canTransition] = canTransition.jsValue() - object[Strings.userInitiated] = userInitiated.jsValue() - object[Strings.hashChange] = hashChange.jsValue() - object[Strings.signal] = signal.jsValue() - object[Strings.formData] = formData.jsValue() - object[Strings.info] = info.jsValue() + object[Strings.navigationType] = navigationType.jsValue + object[Strings.destination] = destination.jsValue + object[Strings.canTransition] = canTransition.jsValue + object[Strings.userInitiated] = userInitiated.jsValue + object[Strings.hashChange] = hashChange.jsValue + object[Strings.signal] = signal.jsValue + object[Strings.formData] = formData.jsValue + object[Strings.info] = info.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Navigation.swift b/Sources/DOMKit/WebIDL/Navigation.swift index fadaf5d4..1460de00 100644 --- a/Sources/DOMKit/WebIDL/Navigation.swift +++ b/Sources/DOMKit/WebIDL/Navigation.swift @@ -28,7 +28,7 @@ public class Navigation: EventTarget { @inlinable public func updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions) { let this = jsObject - _ = this[Strings.updateCurrentEntry].function!(this: this, arguments: [options.jsValue()]) + _ = this[Strings.updateCurrentEntry].function!(this: this, arguments: [options.jsValue]) } @ReadonlyAttribute @@ -42,27 +42,27 @@ public class Navigation: EventTarget { @inlinable public func navigate(url: String, options: NavigationNavigateOptions? = nil) -> NavigationResult { let this = jsObject - return this[Strings.navigate].function!(this: this, arguments: [url.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.navigate].function!(this: this, arguments: [url.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func reload(options: NavigationReloadOptions? = nil) -> NavigationResult { let this = jsObject - return this[Strings.reload].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.reload].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func traverseTo(key: String, options: NavigationOptions? = nil) -> NavigationResult { let this = jsObject - return this[Strings.traverseTo].function!(this: this, arguments: [key.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.traverseTo].function!(this: this, arguments: [key.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func back(options: NavigationOptions? = nil) -> NavigationResult { let this = jsObject - return this[Strings.back].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.back].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func forward(options: NavigationOptions? = nil) -> NavigationResult { let this = jsObject - return this[Strings.forward].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.forward].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift index bcf0404b..3ff885ac 100644 --- a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift @@ -13,7 +13,7 @@ public class NavigationCurrentEntryChangeEvent: Event { } @inlinable public convenience init(type: String, eventInit: NavigationCurrentEntryChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInit.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInit.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift index 85ea6ea2..9533183f 100644 --- a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class NavigationCurrentEntryChangeEventInit: BridgedDictionary { public convenience init(navigationType: NavigationNavigationType?, destination: NavigationHistoryEntry) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.navigationType] = navigationType.jsValue() - object[Strings.destination] = destination.jsValue() + object[Strings.navigationType] = navigationType.jsValue + object[Strings.destination] = destination.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NavigationEvent.swift b/Sources/DOMKit/WebIDL/NavigationEvent.swift index cd659d83..2b3cc3e7 100644 --- a/Sources/DOMKit/WebIDL/NavigationEvent.swift +++ b/Sources/DOMKit/WebIDL/NavigationEvent.swift @@ -13,7 +13,7 @@ public class NavigationEvent: UIEvent { } @inlinable public convenience init(type: String, eventInitDict: NavigationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NavigationEventInit.swift b/Sources/DOMKit/WebIDL/NavigationEventInit.swift index fa2c7a26..484dc266 100644 --- a/Sources/DOMKit/WebIDL/NavigationEventInit.swift +++ b/Sources/DOMKit/WebIDL/NavigationEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class NavigationEventInit: BridgedDictionary { public convenience init(dir: SpatialNavigationDirection, relatedTarget: EventTarget?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dir] = dir.jsValue() - object[Strings.relatedTarget] = relatedTarget.jsValue() + object[Strings.dir] = dir.jsValue + object[Strings.relatedTarget] = relatedTarget.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift b/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift index 043932aa..dcaafb53 100644 --- a/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift +++ b/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class NavigationNavigateOptions: BridgedDictionary { public convenience init(state: JSValue, replace: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.state] = state.jsValue() - object[Strings.replace] = replace.jsValue() + object[Strings.state] = state.jsValue + object[Strings.replace] = replace.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NavigationNavigationType.swift b/Sources/DOMKit/WebIDL/NavigationNavigationType.swift index 0a70b115..47883ecb 100644 --- a/Sources/DOMKit/WebIDL/NavigationNavigationType.swift +++ b/Sources/DOMKit/WebIDL/NavigationNavigationType.swift @@ -20,5 +20,5 @@ public enum NavigationNavigationType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/NavigationOptions.swift b/Sources/DOMKit/WebIDL/NavigationOptions.swift index f5142b9b..f3284959 100644 --- a/Sources/DOMKit/WebIDL/NavigationOptions.swift +++ b/Sources/DOMKit/WebIDL/NavigationOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class NavigationOptions: BridgedDictionary { public convenience init(info: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.info] = info.jsValue() + object[Strings.info] = info.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift b/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift index 1b005c8b..3484feb7 100644 --- a/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift +++ b/Sources/DOMKit/WebIDL/NavigationPreloadManager.swift @@ -21,7 +21,7 @@ public class NavigationPreloadManager: JSBridgedClass { @inlinable public func enable() async throws { let this = jsObject let _promise: JSPromise = this[Strings.enable].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func disable() -> JSPromise { @@ -33,19 +33,19 @@ public class NavigationPreloadManager: JSBridgedClass { @inlinable public func disable() async throws { let this = jsObject let _promise: JSPromise = this[Strings.disable].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func setHeaderValue(value: String) -> JSPromise { let this = jsObject - return this[Strings.setHeaderValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.setHeaderValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func setHeaderValue(value: String) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.setHeaderValue].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.setHeaderValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func getState() -> JSPromise { @@ -57,6 +57,6 @@ public class NavigationPreloadManager: JSBridgedClass { @inlinable public func getState() async throws -> NavigationPreloadState { let this = jsObject let _promise: JSPromise = this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NavigationPreloadState.swift b/Sources/DOMKit/WebIDL/NavigationPreloadState.swift index e3bd0cc9..4aea9988 100644 --- a/Sources/DOMKit/WebIDL/NavigationPreloadState.swift +++ b/Sources/DOMKit/WebIDL/NavigationPreloadState.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class NavigationPreloadState: BridgedDictionary { public convenience init(enabled: Bool, headerValue: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.enabled] = enabled.jsValue() - object[Strings.headerValue] = headerValue.jsValue() + object[Strings.enabled] = enabled.jsValue + object[Strings.headerValue] = headerValue.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift b/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift index 0d1322f7..49812a86 100644 --- a/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift +++ b/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class NavigationReloadOptions: BridgedDictionary { public convenience init(state: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.state] = state.jsValue() + object[Strings.state] = state.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NavigationResult.swift b/Sources/DOMKit/WebIDL/NavigationResult.swift index e235cc53..e9dae1e3 100644 --- a/Sources/DOMKit/WebIDL/NavigationResult.swift +++ b/Sources/DOMKit/WebIDL/NavigationResult.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class NavigationResult: BridgedDictionary { public convenience init(committed: JSPromise, finished: JSPromise) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.committed] = committed.jsValue() - object[Strings.finished] = finished.jsValue() + object[Strings.committed] = committed.jsValue + object[Strings.finished] = finished.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NavigationTimingType.swift b/Sources/DOMKit/WebIDL/NavigationTimingType.swift index 8a42cbaa..8e8c7c17 100644 --- a/Sources/DOMKit/WebIDL/NavigationTimingType.swift +++ b/Sources/DOMKit/WebIDL/NavigationTimingType.swift @@ -20,5 +20,5 @@ public enum NavigationTimingType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/NavigationTransition.swift b/Sources/DOMKit/WebIDL/NavigationTransition.swift index 6202904e..1cea2a85 100644 --- a/Sources/DOMKit/WebIDL/NavigationTransition.swift +++ b/Sources/DOMKit/WebIDL/NavigationTransition.swift @@ -26,6 +26,6 @@ public class NavigationTransition: JSBridgedClass { @inlinable public func rollback(options: NavigationOptions? = nil) -> NavigationResult { let this = jsObject - return this[Strings.rollback].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.rollback].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift b/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift index 81d6197a..158ead3f 100644 --- a/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift +++ b/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class NavigationUpdateCurrentEntryOptions: BridgedDictionary { public convenience init(state: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.state] = state.jsValue() + object[Strings.state] = state.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index 91fca99e..3850e583 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -37,29 +37,29 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @inlinable public func getAutoplayPolicy(type: AutoplayPolicyMediaType) -> AutoplayPolicy { let this = jsObject - return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } @inlinable public func getAutoplayPolicy(element: HTMLMediaElement) -> AutoplayPolicy { let this = jsObject - return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [element.jsValue()]).fromJSValue()! + return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [element.jsValue]).fromJSValue()! } @inlinable public func getAutoplayPolicy(context: AudioContext) -> AutoplayPolicy { let this = jsObject - return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [context.jsValue()]).fromJSValue()! + return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [context.jsValue]).fromJSValue()! } @inlinable public func setClientBadge(contents: UInt64? = nil) -> JSPromise { let this = jsObject - return this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func setClientBadge(contents: UInt64? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func clearClientBadge() -> JSPromise { @@ -71,7 +71,7 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @inlinable public func clearClientBadge() async throws { let this = jsObject let _promise: JSPromise = this[Strings.clearClientBadge].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func getBattery() -> JSPromise { @@ -83,12 +83,12 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @inlinable public func getBattery() async throws -> BatteryManager { let this = jsObject let _promise: JSPromise = this[Strings.getBattery].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { let this = jsObject - return this[Strings.sendBeacon].function!(this: this, arguments: [url.jsValue(), data?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.sendBeacon].function!(this: this, arguments: [url.jsValue, data?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -105,14 +105,14 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @inlinable public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { let this = jsObject - return this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue(), supportedConfigurations.jsValue()]).fromJSValue()! + return this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue, supportedConfigurations.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { let this = jsObject - let _promise: JSPromise = this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue(), supportedConfigurations.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue, supportedConfigurations.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getGamepads() -> [Gamepad?] { @@ -132,7 +132,7 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @inlinable public func getInstalledRelatedApps() async throws -> [RelatedApplication] { let this = jsObject let _promise: JSPromise = this[Strings.getInstalledRelatedApps].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute @@ -175,7 +175,7 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @inlinable public func vibrate(pattern: VibratePattern) -> Bool { let this = jsObject - return this[Strings.vibrate].function!(this: this, arguments: [pattern.jsValue()]).fromJSValue()! + return this[Strings.vibrate].function!(this: this, arguments: [pattern.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -186,19 +186,19 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @inlinable public func share(data: ShareData? = nil) -> JSPromise { let this = jsObject - return this[Strings.share].function!(this: this, arguments: [data?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.share].function!(this: this, arguments: [data?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func share(data: ShareData? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.share].function!(this: this, arguments: [data?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.share].function!(this: this, arguments: [data?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func canShare(data: ShareData? = nil) -> Bool { let this = jsObject - return this[Strings.canShare].function!(this: this, arguments: [data?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.canShare].function!(this: this, arguments: [data?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -206,14 +206,14 @@ public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, N @inlinable public func requestMIDIAccess(options: MIDIOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestMIDIAccess(options: MIDIOptions? = nil) async throws -> MIDIAccess { let this = jsObject - let _promise: JSPromise = this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NavigatorBadge.swift b/Sources/DOMKit/WebIDL/NavigatorBadge.swift index b91d25ff..a4caa6d8 100644 --- a/Sources/DOMKit/WebIDL/NavigatorBadge.swift +++ b/Sources/DOMKit/WebIDL/NavigatorBadge.swift @@ -7,14 +7,14 @@ public protocol NavigatorBadge: JSBridgedClass {} public extension NavigatorBadge { @inlinable func setAppBadge(contents: UInt64? = nil) -> JSPromise { let this = jsObject - return this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable func setAppBadge(contents: UInt64? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable func clearAppBadge() -> JSPromise { @@ -26,6 +26,6 @@ public extension NavigatorBadge { @inlinable func clearAppBadge() async throws { let this = jsObject let _promise: JSPromise = this[Strings.clearAppBadge].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift index a18aaf94..02a62820 100644 --- a/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift +++ b/Sources/DOMKit/WebIDL/NavigatorContentUtils.swift @@ -7,11 +7,11 @@ public protocol NavigatorContentUtils: JSBridgedClass {} public extension NavigatorContentUtils { @inlinable func registerProtocolHandler(scheme: String, url: String) { let this = jsObject - _ = this[Strings.registerProtocolHandler].function!(this: this, arguments: [scheme.jsValue(), url.jsValue()]) + _ = this[Strings.registerProtocolHandler].function!(this: this, arguments: [scheme.jsValue, url.jsValue]) } @inlinable func unregisterProtocolHandler(scheme: String, url: String) { let this = jsObject - _ = this[Strings.unregisterProtocolHandler].function!(this: this, arguments: [scheme.jsValue(), url.jsValue()]) + _ = this[Strings.unregisterProtocolHandler].function!(this: this, arguments: [scheme.jsValue, url.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift b/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift index 103751f1..969cf097 100644 --- a/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift +++ b/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class NavigatorUABrandVersion: BridgedDictionary { public convenience init(brand: String, version: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.brand] = brand.jsValue() - object[Strings.version] = version.jsValue() + object[Strings.brand] = brand.jsValue + object[Strings.version] = version.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NavigatorUAData.swift b/Sources/DOMKit/WebIDL/NavigatorUAData.swift index 9bf47c58..c797d7b1 100644 --- a/Sources/DOMKit/WebIDL/NavigatorUAData.swift +++ b/Sources/DOMKit/WebIDL/NavigatorUAData.swift @@ -26,14 +26,14 @@ public class NavigatorUAData: JSBridgedClass { @inlinable public func getHighEntropyValues(hints: [String]) -> JSPromise { let this = jsObject - return this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue()]).fromJSValue()! + return this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getHighEntropyValues(hints: [String]) async throws -> UADataValues { let this = jsObject - let _promise: JSPromise = this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func toJSON() -> UALowEntropyJSON { diff --git a/Sources/DOMKit/WebIDL/Node.swift b/Sources/DOMKit/WebIDL/Node.swift index c9a22939..870ce77c 100644 --- a/Sources/DOMKit/WebIDL/Node.swift +++ b/Sources/DOMKit/WebIDL/Node.swift @@ -65,7 +65,7 @@ public class Node: EventTarget { @inlinable public func getRootNode(options: GetRootNodeOptions? = nil) -> Self { let this = jsObject - return this[Strings.getRootNode].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getRootNode].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute @@ -107,17 +107,17 @@ public class Node: EventTarget { @inlinable public func cloneNode(deep: Bool? = nil) -> Self { let this = jsObject - return this[Strings.cloneNode].function!(this: this, arguments: [deep?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.cloneNode].function!(this: this, arguments: [deep?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func isEqualNode(otherNode: Node?) -> Bool { let this = jsObject - return this[Strings.isEqualNode].function!(this: this, arguments: [otherNode.jsValue()]).fromJSValue()! + return this[Strings.isEqualNode].function!(this: this, arguments: [otherNode.jsValue]).fromJSValue()! } @inlinable public func isSameNode(otherNode: Node?) -> Bool { let this = jsObject - return this[Strings.isSameNode].function!(this: this, arguments: [otherNode.jsValue()]).fromJSValue()! + return this[Strings.isSameNode].function!(this: this, arguments: [otherNode.jsValue]).fromJSValue()! } public static let DOCUMENT_POSITION_DISCONNECTED: UInt16 = 0x01 @@ -134,46 +134,46 @@ public class Node: EventTarget { @inlinable public func compareDocumentPosition(other: Node) -> UInt16 { let this = jsObject - return this[Strings.compareDocumentPosition].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! + return this[Strings.compareDocumentPosition].function!(this: this, arguments: [other.jsValue]).fromJSValue()! } @inlinable public func contains(other: Node?) -> Bool { let this = jsObject - return this[Strings.contains].function!(this: this, arguments: [other.jsValue()]).fromJSValue()! + return this[Strings.contains].function!(this: this, arguments: [other.jsValue]).fromJSValue()! } @inlinable public func lookupPrefix(namespace: String?) -> String? { let this = jsObject - return this[Strings.lookupPrefix].function!(this: this, arguments: [namespace.jsValue()]).fromJSValue()! + return this[Strings.lookupPrefix].function!(this: this, arguments: [namespace.jsValue]).fromJSValue()! } @inlinable public func lookupNamespaceURI(prefix: String?) -> String? { let this = jsObject - return this[Strings.lookupNamespaceURI].function!(this: this, arguments: [prefix.jsValue()]).fromJSValue()! + return this[Strings.lookupNamespaceURI].function!(this: this, arguments: [prefix.jsValue]).fromJSValue()! } @inlinable public func isDefaultNamespace(namespace: String?) -> Bool { let this = jsObject - return this[Strings.isDefaultNamespace].function!(this: this, arguments: [namespace.jsValue()]).fromJSValue()! + return this[Strings.isDefaultNamespace].function!(this: this, arguments: [namespace.jsValue]).fromJSValue()! } @inlinable public func insertBefore(node: Node, child: Node?) -> Self { let this = jsObject - return this[Strings.insertBefore].function!(this: this, arguments: [node.jsValue(), child.jsValue()]).fromJSValue()! + return this[Strings.insertBefore].function!(this: this, arguments: [node.jsValue, child.jsValue]).fromJSValue()! } @inlinable public func appendChild(node: Node) -> Self { let this = jsObject - return this[Strings.appendChild].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! + return this[Strings.appendChild].function!(this: this, arguments: [node.jsValue]).fromJSValue()! } @inlinable public func replaceChild(node: Node, child: Node) -> Self { let this = jsObject - return this[Strings.replaceChild].function!(this: this, arguments: [node.jsValue(), child.jsValue()]).fromJSValue()! + return this[Strings.replaceChild].function!(this: this, arguments: [node.jsValue, child.jsValue]).fromJSValue()! } @inlinable public func removeChild(child: Node) -> Self { let this = jsObject - return this[Strings.removeChild].function!(this: this, arguments: [child.jsValue()]).fromJSValue()! + return this[Strings.removeChild].function!(this: this, arguments: [child.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Node_or_String.swift b/Sources/DOMKit/WebIDL/Node_or_String.swift index b2ee2ef1..f1424800 100644 --- a/Sources/DOMKit/WebIDL/Node_or_String.swift +++ b/Sources/DOMKit/WebIDL/Node_or_String.swift @@ -21,12 +21,12 @@ public enum Node_or_String: JSValueCompatible, Any_Node_or_String { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .node(node): - return node.jsValue() + return node.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/NonElementParentNode.swift b/Sources/DOMKit/WebIDL/NonElementParentNode.swift index 6e2829bc..ebbbf429 100644 --- a/Sources/DOMKit/WebIDL/NonElementParentNode.swift +++ b/Sources/DOMKit/WebIDL/NonElementParentNode.swift @@ -7,6 +7,6 @@ public protocol NonElementParentNode: JSBridgedClass {} public extension NonElementParentNode { @inlinable func getElementById(elementId: String) -> Element? { let this = jsObject - return this[Strings.getElementById].function!(this: this, arguments: [elementId.jsValue()]).fromJSValue()! + return this[Strings.getElementById].function!(this: this, arguments: [elementId.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Notification.swift b/Sources/DOMKit/WebIDL/Notification.swift index 8b63e6d6..2cea0cb1 100644 --- a/Sources/DOMKit/WebIDL/Notification.swift +++ b/Sources/DOMKit/WebIDL/Notification.swift @@ -32,7 +32,7 @@ public class Notification: EventTarget { } @inlinable public convenience init(title: String, options: NotificationOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [title.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [title.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/NotificationAction.swift b/Sources/DOMKit/WebIDL/NotificationAction.swift index 18288571..8fd8bb16 100644 --- a/Sources/DOMKit/WebIDL/NotificationAction.swift +++ b/Sources/DOMKit/WebIDL/NotificationAction.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class NotificationAction: BridgedDictionary { public convenience init(action: String, title: String, icon: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.action] = action.jsValue() - object[Strings.title] = title.jsValue() - object[Strings.icon] = icon.jsValue() + object[Strings.action] = action.jsValue + object[Strings.title] = title.jsValue + object[Strings.icon] = icon.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NotificationDirection.swift b/Sources/DOMKit/WebIDL/NotificationDirection.swift index 1e3ac8d0..87c1928e 100644 --- a/Sources/DOMKit/WebIDL/NotificationDirection.swift +++ b/Sources/DOMKit/WebIDL/NotificationDirection.swift @@ -19,5 +19,5 @@ public enum NotificationDirection: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/NotificationEventInit.swift b/Sources/DOMKit/WebIDL/NotificationEventInit.swift index 0c160ce5..9ea4ff62 100644 --- a/Sources/DOMKit/WebIDL/NotificationEventInit.swift +++ b/Sources/DOMKit/WebIDL/NotificationEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class NotificationEventInit: BridgedDictionary { public convenience init(notification: Notification, action: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.notification] = notification.jsValue() - object[Strings.action] = action.jsValue() + object[Strings.notification] = notification.jsValue + object[Strings.action] = action.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NotificationOptions.swift b/Sources/DOMKit/WebIDL/NotificationOptions.swift index d3d43e9a..f13fa7c5 100644 --- a/Sources/DOMKit/WebIDL/NotificationOptions.swift +++ b/Sources/DOMKit/WebIDL/NotificationOptions.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class NotificationOptions: BridgedDictionary { public convenience init(dir: NotificationDirection, lang: String, body: String, tag: String, image: String, icon: String, badge: String, vibrate: VibratePattern, timestamp: EpochTimeStamp, renotify: Bool, silent: Bool, requireInteraction: Bool, data: JSValue, actions: [NotificationAction]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dir] = dir.jsValue() - object[Strings.lang] = lang.jsValue() - object[Strings.body] = body.jsValue() - object[Strings.tag] = tag.jsValue() - object[Strings.image] = image.jsValue() - object[Strings.icon] = icon.jsValue() - object[Strings.badge] = badge.jsValue() - object[Strings.vibrate] = vibrate.jsValue() - object[Strings.timestamp] = timestamp.jsValue() - object[Strings.renotify] = renotify.jsValue() - object[Strings.silent] = silent.jsValue() - object[Strings.requireInteraction] = requireInteraction.jsValue() - object[Strings.data] = data.jsValue() - object[Strings.actions] = actions.jsValue() + object[Strings.dir] = dir.jsValue + object[Strings.lang] = lang.jsValue + object[Strings.body] = body.jsValue + object[Strings.tag] = tag.jsValue + object[Strings.image] = image.jsValue + object[Strings.icon] = icon.jsValue + object[Strings.badge] = badge.jsValue + object[Strings.vibrate] = vibrate.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.renotify] = renotify.jsValue + object[Strings.silent] = silent.jsValue + object[Strings.requireInteraction] = requireInteraction.jsValue + object[Strings.data] = data.jsValue + object[Strings.actions] = actions.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/NotificationPermission.swift b/Sources/DOMKit/WebIDL/NotificationPermission.swift index 2a91a296..a60fb475 100644 --- a/Sources/DOMKit/WebIDL/NotificationPermission.swift +++ b/Sources/DOMKit/WebIDL/NotificationPermission.swift @@ -19,5 +19,5 @@ public enum NotificationPermission: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift b/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift index 1dab1791..6a5e1371 100644 --- a/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift +++ b/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift @@ -14,36 +14,36 @@ public class OES_draw_buffers_indexed: JSBridgedClass { @inlinable public func enableiOES(target: GLenum, index: GLuint) { let this = jsObject - _ = this[Strings.enableiOES].function!(this: this, arguments: [target.jsValue(), index.jsValue()]) + _ = this[Strings.enableiOES].function!(this: this, arguments: [target.jsValue, index.jsValue]) } @inlinable public func disableiOES(target: GLenum, index: GLuint) { let this = jsObject - _ = this[Strings.disableiOES].function!(this: this, arguments: [target.jsValue(), index.jsValue()]) + _ = this[Strings.disableiOES].function!(this: this, arguments: [target.jsValue, index.jsValue]) } @inlinable public func blendEquationiOES(buf: GLuint, mode: GLenum) { let this = jsObject - _ = this[Strings.blendEquationiOES].function!(this: this, arguments: [buf.jsValue(), mode.jsValue()]) + _ = this[Strings.blendEquationiOES].function!(this: this, arguments: [buf.jsValue, mode.jsValue]) } @inlinable public func blendEquationSeparateiOES(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum) { let this = jsObject - _ = this[Strings.blendEquationSeparateiOES].function!(this: this, arguments: [buf.jsValue(), modeRGB.jsValue(), modeAlpha.jsValue()]) + _ = this[Strings.blendEquationSeparateiOES].function!(this: this, arguments: [buf.jsValue, modeRGB.jsValue, modeAlpha.jsValue]) } @inlinable public func blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum) { let this = jsObject - _ = this[Strings.blendFunciOES].function!(this: this, arguments: [buf.jsValue(), src.jsValue(), dst.jsValue()]) + _ = this[Strings.blendFunciOES].function!(this: this, arguments: [buf.jsValue, src.jsValue, dst.jsValue]) } @inlinable public func blendFuncSeparateiOES(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { let this = jsObject - _ = this[Strings.blendFuncSeparateiOES].function!(this: this, arguments: [buf.jsValue(), srcRGB.jsValue(), dstRGB.jsValue(), srcAlpha.jsValue(), dstAlpha.jsValue()]) + _ = this[Strings.blendFuncSeparateiOES].function!(this: this, arguments: [buf.jsValue, srcRGB.jsValue, dstRGB.jsValue, srcAlpha.jsValue, dstAlpha.jsValue]) } @inlinable public func colorMaskiOES(buf: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean) { let this = jsObject - _ = this[Strings.colorMaskiOES].function!(this: this, arguments: [buf.jsValue(), r.jsValue(), g.jsValue(), b.jsValue(), a.jsValue()]) + _ = this[Strings.colorMaskiOES].function!(this: this, arguments: [buf.jsValue, r.jsValue, g.jsValue, b.jsValue, a.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift b/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift index 7107fd69..d88cd313 100644 --- a/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift +++ b/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift @@ -21,16 +21,16 @@ public class OES_vertex_array_object: JSBridgedClass { @inlinable public func deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { let this = jsObject - _ = this[Strings.deleteVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue()]) + _ = this[Strings.deleteVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue]) } @inlinable public func isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) -> GLboolean { let this = jsObject - return this[Strings.isVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue()]).fromJSValue()! + return this[Strings.isVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue]).fromJSValue()! } @inlinable public func bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { let this = jsObject - _ = this[Strings.bindVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue()]) + _ = this[Strings.bindVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift index f69226ec..3931b309 100644 --- a/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift +++ b/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class OTPCredentialRequestOptions: BridgedDictionary { public convenience init(transport: [OTPCredentialTransportType]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transport] = transport.jsValue() + object[Strings.transport] = transport.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift b/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift index 2bbaffca..86aa763d 100644 --- a/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift +++ b/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift @@ -17,5 +17,5 @@ public enum OTPCredentialTransportType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/OVR_multiview2.swift b/Sources/DOMKit/WebIDL/OVR_multiview2.swift index 54fd3d05..ed19ab96 100644 --- a/Sources/DOMKit/WebIDL/OVR_multiview2.swift +++ b/Sources/DOMKit/WebIDL/OVR_multiview2.swift @@ -21,12 +21,12 @@ public class OVR_multiview2: JSBridgedClass { public static let FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: GLenum = 0x9633 @inlinable public func framebufferTextureMultiviewOVR(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, baseViewIndex: GLint, numViews: GLsizei) { - let _arg0 = target.jsValue() - let _arg1 = attachment.jsValue() - let _arg2 = texture.jsValue() - let _arg3 = level.jsValue() - let _arg4 = baseViewIndex.jsValue() - let _arg5 = numViews.jsValue() + let _arg0 = target.jsValue + let _arg1 = attachment.jsValue + let _arg2 = texture.jsValue + let _arg3 = level.jsValue + let _arg4 = baseViewIndex.jsValue + let _arg5 = numViews.jsValue let this = jsObject _ = this[Strings.framebufferTextureMultiviewOVR].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } diff --git a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift index 3cd70745..bbd479f4 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift @@ -12,7 +12,7 @@ public class OfflineAudioCompletionEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: OfflineAudioCompletionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift index 68647689..6e61930a 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class OfflineAudioCompletionEventInit: BridgedDictionary { public convenience init(renderedBuffer: AudioBuffer) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.renderedBuffer] = renderedBuffer.jsValue() + object[Strings.renderedBuffer] = renderedBuffer.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift index ca4bc1ec..0d70006c 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift @@ -13,11 +13,11 @@ public class OfflineAudioContext: BaseAudioContext { } @inlinable public convenience init(contextOptions: OfflineAudioContextOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions.jsValue])) } @inlinable public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [numberOfChannels.jsValue(), length.jsValue(), sampleRate.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [numberOfChannels.jsValue, length.jsValue, sampleRate.jsValue])) } @inlinable public func startRendering() -> JSPromise { @@ -29,7 +29,7 @@ public class OfflineAudioContext: BaseAudioContext { @inlinable public func startRendering() async throws -> AudioBuffer { let this = jsObject let _promise: JSPromise = this[Strings.startRendering].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func resume() -> JSPromise { @@ -41,19 +41,19 @@ public class OfflineAudioContext: BaseAudioContext { @inlinable public func resume() async throws { let this = jsObject let _promise: JSPromise = this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func suspend(suspendTime: Double) -> JSPromise { let this = jsObject - return this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue()]).fromJSValue()! + return this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func suspend(suspendTime: Double) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue]).fromJSValue()! + _ = try await _promise.value } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift b/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift index 8ad220dc..cb5abf5a 100644 --- a/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift +++ b/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class OfflineAudioContextOptions: BridgedDictionary { public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfChannels] = numberOfChannels.jsValue() - object[Strings.length] = length.jsValue() - object[Strings.sampleRate] = sampleRate.jsValue() + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.length] = length.jsValue + object[Strings.sampleRate] = sampleRate.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift index e1d0cce2..5f03a997 100644 --- a/Sources/DOMKit/WebIDL/OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/OffscreenCanvas.swift @@ -15,7 +15,7 @@ public class OffscreenCanvas: EventTarget { } @inlinable public convenience init(width: UInt64, height: UInt64) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [width.jsValue(), height.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [width.jsValue, height.jsValue])) } @ReadWriteAttribute @@ -26,7 +26,7 @@ public class OffscreenCanvas: EventTarget { @inlinable public func getContext(contextId: OffscreenRenderingContextId, options: JSValue? = nil) -> OffscreenRenderingContext? { let this = jsObject - return this[Strings.getContext].function!(this: this, arguments: [contextId.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getContext].function!(this: this, arguments: [contextId.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func transferToImageBitmap() -> ImageBitmap { @@ -36,14 +36,14 @@ public class OffscreenCanvas: EventTarget { @inlinable public func convertToBlob(options: ImageEncodeOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.convertToBlob].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.convertToBlob].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func convertToBlob(options: ImageEncodeOptions? = nil) async throws -> Blob { let this = jsObject - let _promise: JSPromise = this[Strings.convertToBlob].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.convertToBlob].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift index 9624bc7e..f1bd2fa2 100644 --- a/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift @@ -36,18 +36,18 @@ public enum OffscreenRenderingContext: JSValueCompatible, Any_OffscreenRendering return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .gPUCanvasContext(gPUCanvasContext): - return gPUCanvasContext.jsValue() + return gPUCanvasContext.jsValue case let .imageBitmapRenderingContext(imageBitmapRenderingContext): - return imageBitmapRenderingContext.jsValue() + return imageBitmapRenderingContext.jsValue case let .offscreenCanvasRenderingContext2D(offscreenCanvasRenderingContext2D): - return offscreenCanvasRenderingContext2D.jsValue() + return offscreenCanvasRenderingContext2D.jsValue case let .webGL2RenderingContext(webGL2RenderingContext): - return webGL2RenderingContext.jsValue() + return webGL2RenderingContext.jsValue case let .webGLRenderingContext(webGLRenderingContext): - return webGLRenderingContext.jsValue() + return webGLRenderingContext.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift index fcb9d7f2..a2269db5 100644 --- a/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContextId.swift @@ -21,5 +21,5 @@ public enum OffscreenRenderingContextId: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift b/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift index dc859887..a3d45d5e 100644 --- a/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift +++ b/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class OpenFilePickerOptions: BridgedDictionary { public convenience init(multiple: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.multiple] = multiple.jsValue() + object[Strings.multiple] = multiple.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift index c0c6ee73..7b42b106 100644 --- a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift +++ b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class OptionalEffectTiming: BridgedDictionary { public convenience init(playbackRate: Double, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: Double_or_String, direction: PlaybackDirection, easing: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.playbackRate] = playbackRate.jsValue() - object[Strings.delay] = delay.jsValue() - object[Strings.endDelay] = endDelay.jsValue() - object[Strings.fill] = fill.jsValue() - object[Strings.iterationStart] = iterationStart.jsValue() - object[Strings.iterations] = iterations.jsValue() - object[Strings.duration] = duration.jsValue() - object[Strings.direction] = direction.jsValue() - object[Strings.easing] = easing.jsValue() + object[Strings.playbackRate] = playbackRate.jsValue + object[Strings.delay] = delay.jsValue + object[Strings.endDelay] = endDelay.jsValue + object[Strings.fill] = fill.jsValue + object[Strings.iterationStart] = iterationStart.jsValue + object[Strings.iterations] = iterations.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.direction] = direction.jsValue + object[Strings.easing] = easing.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/OrientationLockType.swift b/Sources/DOMKit/WebIDL/OrientationLockType.swift index 006e09e4..d0daf9f4 100644 --- a/Sources/DOMKit/WebIDL/OrientationLockType.swift +++ b/Sources/DOMKit/WebIDL/OrientationLockType.swift @@ -24,5 +24,5 @@ public enum OrientationLockType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/OrientationSensor.swift b/Sources/DOMKit/WebIDL/OrientationSensor.swift index 12608f72..950d2270 100644 --- a/Sources/DOMKit/WebIDL/OrientationSensor.swift +++ b/Sources/DOMKit/WebIDL/OrientationSensor.swift @@ -16,6 +16,6 @@ public class OrientationSensor: Sensor { @inlinable public func populateMatrix(targetMatrix: RotationMatrixType) { let this = jsObject - _ = this[Strings.populateMatrix].function!(this: this, arguments: [targetMatrix.jsValue()]) + _ = this[Strings.populateMatrix].function!(this: this, arguments: [targetMatrix.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift index 72fffb93..ce3ebc2c 100644 --- a/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift +++ b/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift @@ -18,5 +18,5 @@ public enum OrientationSensorLocalCoordinateSystem: JSString, JSValueCompatible self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/OrientationSensorOptions.swift b/Sources/DOMKit/WebIDL/OrientationSensorOptions.swift index 2b31c3b7..78421e6d 100644 --- a/Sources/DOMKit/WebIDL/OrientationSensorOptions.swift +++ b/Sources/DOMKit/WebIDL/OrientationSensorOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class OrientationSensorOptions: BridgedDictionary { public convenience init(referenceFrame: OrientationSensorLocalCoordinateSystem) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceFrame] = referenceFrame.jsValue() + object[Strings.referenceFrame] = referenceFrame.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/OrientationType.swift b/Sources/DOMKit/WebIDL/OrientationType.swift index aea2b5c6..3144ca77 100644 --- a/Sources/DOMKit/WebIDL/OrientationType.swift +++ b/Sources/DOMKit/WebIDL/OrientationType.swift @@ -20,5 +20,5 @@ public enum OrientationType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/OscillatorNode.swift b/Sources/DOMKit/WebIDL/OscillatorNode.swift index aba9d30b..e11648d9 100644 --- a/Sources/DOMKit/WebIDL/OscillatorNode.swift +++ b/Sources/DOMKit/WebIDL/OscillatorNode.swift @@ -14,7 +14,7 @@ public class OscillatorNode: AudioScheduledSourceNode { } @inlinable public convenience init(context: BaseAudioContext, options: OscillatorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadWriteAttribute @@ -28,6 +28,6 @@ public class OscillatorNode: AudioScheduledSourceNode { @inlinable public func setPeriodicWave(periodicWave: PeriodicWave) { let this = jsObject - _ = this[Strings.setPeriodicWave].function!(this: this, arguments: [periodicWave.jsValue()]) + _ = this[Strings.setPeriodicWave].function!(this: this, arguments: [periodicWave.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/OscillatorOptions.swift b/Sources/DOMKit/WebIDL/OscillatorOptions.swift index 754fb5eb..cc807696 100644 --- a/Sources/DOMKit/WebIDL/OscillatorOptions.swift +++ b/Sources/DOMKit/WebIDL/OscillatorOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class OscillatorOptions: BridgedDictionary { public convenience init(type: OscillatorType, frequency: Float, detune: Float, periodicWave: PeriodicWave) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.frequency] = frequency.jsValue() - object[Strings.detune] = detune.jsValue() - object[Strings.periodicWave] = periodicWave.jsValue() + object[Strings.type] = type.jsValue + object[Strings.frequency] = frequency.jsValue + object[Strings.detune] = detune.jsValue + object[Strings.periodicWave] = periodicWave.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/OscillatorType.swift b/Sources/DOMKit/WebIDL/OscillatorType.swift index ad63908c..1a276c46 100644 --- a/Sources/DOMKit/WebIDL/OscillatorType.swift +++ b/Sources/DOMKit/WebIDL/OscillatorType.swift @@ -21,5 +21,5 @@ public enum OscillatorType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/OverSampleType.swift b/Sources/DOMKit/WebIDL/OverSampleType.swift index b8d79869..2b936c99 100644 --- a/Sources/DOMKit/WebIDL/OverSampleType.swift +++ b/Sources/DOMKit/WebIDL/OverSampleType.swift @@ -19,5 +19,5 @@ public enum OverSampleType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/OverconstrainedError.swift b/Sources/DOMKit/WebIDL/OverconstrainedError.swift index 4de51eee..61499735 100644 --- a/Sources/DOMKit/WebIDL/OverconstrainedError.swift +++ b/Sources/DOMKit/WebIDL/OverconstrainedError.swift @@ -12,7 +12,7 @@ public class OverconstrainedError: DOMException { } @inlinable public convenience init(constraint: String, message: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [constraint.jsValue(), message?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [constraint.jsValue, message?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift index c67ffc08..9a451d49 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEvent.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEvent.swift @@ -12,7 +12,7 @@ public class PageTransitionEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: PageTransitionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift index 3b271df0..685734a7 100644 --- a/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PageTransitionEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PageTransitionEventInit: BridgedDictionary { public convenience init(persisted: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.persisted] = persisted.jsValue() + object[Strings.persisted] = persisted.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift index 36bcfe24..9673eca3 100644 --- a/Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift +++ b/Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PaintRenderingContext2DSettings: BridgedDictionary { public convenience init(alpha: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue() + object[Strings.alpha] = alpha.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PannerNode.swift b/Sources/DOMKit/WebIDL/PannerNode.swift index 979dac8d..0dc1eab3 100644 --- a/Sources/DOMKit/WebIDL/PannerNode.swift +++ b/Sources/DOMKit/WebIDL/PannerNode.swift @@ -25,7 +25,7 @@ public class PannerNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: PannerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadWriteAttribute @@ -72,11 +72,11 @@ public class PannerNode: AudioNode { @inlinable public func setPosition(x: Float, y: Float, z: Float) { let this = jsObject - _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue(), y.jsValue(), z.jsValue()]) + _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue, y.jsValue, z.jsValue]) } @inlinable public func setOrientation(x: Float, y: Float, z: Float) { let this = jsObject - _ = this[Strings.setOrientation].function!(this: this, arguments: [x.jsValue(), y.jsValue(), z.jsValue()]) + _ = this[Strings.setOrientation].function!(this: this, arguments: [x.jsValue, y.jsValue, z.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/PannerOptions.swift b/Sources/DOMKit/WebIDL/PannerOptions.swift index cb9968f7..e2685dc3 100644 --- a/Sources/DOMKit/WebIDL/PannerOptions.swift +++ b/Sources/DOMKit/WebIDL/PannerOptions.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class PannerOptions: BridgedDictionary { public convenience init(panningModel: PanningModelType, distanceModel: DistanceModelType, positionX: Float, positionY: Float, positionZ: Float, orientationX: Float, orientationY: Float, orientationZ: Float, refDistance: Double, maxDistance: Double, rolloffFactor: Double, coneInnerAngle: Double, coneOuterAngle: Double, coneOuterGain: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.panningModel] = panningModel.jsValue() - object[Strings.distanceModel] = distanceModel.jsValue() - object[Strings.positionX] = positionX.jsValue() - object[Strings.positionY] = positionY.jsValue() - object[Strings.positionZ] = positionZ.jsValue() - object[Strings.orientationX] = orientationX.jsValue() - object[Strings.orientationY] = orientationY.jsValue() - object[Strings.orientationZ] = orientationZ.jsValue() - object[Strings.refDistance] = refDistance.jsValue() - object[Strings.maxDistance] = maxDistance.jsValue() - object[Strings.rolloffFactor] = rolloffFactor.jsValue() - object[Strings.coneInnerAngle] = coneInnerAngle.jsValue() - object[Strings.coneOuterAngle] = coneOuterAngle.jsValue() - object[Strings.coneOuterGain] = coneOuterGain.jsValue() + object[Strings.panningModel] = panningModel.jsValue + object[Strings.distanceModel] = distanceModel.jsValue + object[Strings.positionX] = positionX.jsValue + object[Strings.positionY] = positionY.jsValue + object[Strings.positionZ] = positionZ.jsValue + object[Strings.orientationX] = orientationX.jsValue + object[Strings.orientationY] = orientationY.jsValue + object[Strings.orientationZ] = orientationZ.jsValue + object[Strings.refDistance] = refDistance.jsValue + object[Strings.maxDistance] = maxDistance.jsValue + object[Strings.rolloffFactor] = rolloffFactor.jsValue + object[Strings.coneInnerAngle] = coneInnerAngle.jsValue + object[Strings.coneOuterAngle] = coneOuterAngle.jsValue + object[Strings.coneOuterGain] = coneOuterGain.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PanningModelType.swift b/Sources/DOMKit/WebIDL/PanningModelType.swift index fa3f8f33..7c293a3a 100644 --- a/Sources/DOMKit/WebIDL/PanningModelType.swift +++ b/Sources/DOMKit/WebIDL/PanningModelType.swift @@ -18,5 +18,5 @@ public enum PanningModelType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ParentNode.swift b/Sources/DOMKit/WebIDL/ParentNode.swift index 09468ba8..a3d4f0ac 100644 --- a/Sources/DOMKit/WebIDL/ParentNode.swift +++ b/Sources/DOMKit/WebIDL/ParentNode.swift @@ -15,26 +15,26 @@ public extension ParentNode { @inlinable func prepend(nodes: Node_or_String...) { let this = jsObject - _ = this[Strings.prepend].function!(this: this, arguments: nodes.map { $0.jsValue() }) + _ = this[Strings.prepend].function!(this: this, arguments: nodes.map(\.jsValue)) } @inlinable func append(nodes: Node_or_String...) { let this = jsObject - _ = this[Strings.append].function!(this: this, arguments: nodes.map { $0.jsValue() }) + _ = this[Strings.append].function!(this: this, arguments: nodes.map(\.jsValue)) } @inlinable func replaceChildren(nodes: Node_or_String...) { let this = jsObject - _ = this[Strings.replaceChildren].function!(this: this, arguments: nodes.map { $0.jsValue() }) + _ = this[Strings.replaceChildren].function!(this: this, arguments: nodes.map(\.jsValue)) } @inlinable func querySelector(selectors: String) -> Element? { let this = jsObject - return this[Strings.querySelector].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! + return this[Strings.querySelector].function!(this: this, arguments: [selectors.jsValue]).fromJSValue()! } @inlinable func querySelectorAll(selectors: String) -> NodeList { let this = jsObject - return this[Strings.querySelectorAll].function!(this: this, arguments: [selectors.jsValue()]).fromJSValue()! + return this[Strings.querySelectorAll].function!(this: this, arguments: [selectors.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ParityType.swift b/Sources/DOMKit/WebIDL/ParityType.swift index 5dc33c93..8df22cf9 100644 --- a/Sources/DOMKit/WebIDL/ParityType.swift +++ b/Sources/DOMKit/WebIDL/ParityType.swift @@ -19,5 +19,5 @@ public enum ParityType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/PasswordCredential.swift b/Sources/DOMKit/WebIDL/PasswordCredential.swift index 2b78233c..8ed5b862 100644 --- a/Sources/DOMKit/WebIDL/PasswordCredential.swift +++ b/Sources/DOMKit/WebIDL/PasswordCredential.swift @@ -12,11 +12,11 @@ public class PasswordCredential: Credential, CredentialUserData { } @inlinable public convenience init(form: HTMLFormElement) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [form.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [form.jsValue])) } @inlinable public convenience init(data: PasswordCredentialData) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PasswordCredentialData.swift b/Sources/DOMKit/WebIDL/PasswordCredentialData.swift index fba6045a..c21f63f1 100644 --- a/Sources/DOMKit/WebIDL/PasswordCredentialData.swift +++ b/Sources/DOMKit/WebIDL/PasswordCredentialData.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class PasswordCredentialData: BridgedDictionary { public convenience init(name: String, iconURL: String, origin: String, password: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.iconURL] = iconURL.jsValue() - object[Strings.origin] = origin.jsValue() - object[Strings.password] = password.jsValue() + object[Strings.name] = name.jsValue + object[Strings.iconURL] = iconURL.jsValue + object[Strings.origin] = origin.jsValue + object[Strings.password] = password.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PasswordCredentialInit.swift b/Sources/DOMKit/WebIDL/PasswordCredentialInit.swift index 180b686c..a265bc15 100644 --- a/Sources/DOMKit/WebIDL/PasswordCredentialInit.swift +++ b/Sources/DOMKit/WebIDL/PasswordCredentialInit.swift @@ -21,12 +21,12 @@ public enum PasswordCredentialInit: JSValueCompatible, Any_PasswordCredentialIni return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .hTMLFormElement(hTMLFormElement): - return hTMLFormElement.jsValue() + return hTMLFormElement.jsValue case let .passwordCredentialData(passwordCredentialData): - return passwordCredentialData.jsValue() + return passwordCredentialData.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Path2D.swift b/Sources/DOMKit/WebIDL/Path2D.swift index b14f4e2e..5275df19 100644 --- a/Sources/DOMKit/WebIDL/Path2D.swift +++ b/Sources/DOMKit/WebIDL/Path2D.swift @@ -13,11 +13,11 @@ public class Path2D: JSBridgedClass, CanvasPath { } @inlinable public convenience init(path: Path2D_or_String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [path?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [path?.jsValue ?? .undefined])) } @inlinable public func addPath(path: Path2D, transform: DOMMatrix2DInit? = nil) { let this = jsObject - _ = this[Strings.addPath].function!(this: this, arguments: [path.jsValue(), transform?.jsValue() ?? .undefined]) + _ = this[Strings.addPath].function!(this: this, arguments: [path.jsValue, transform?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/Path2D_or_String.swift b/Sources/DOMKit/WebIDL/Path2D_or_String.swift index 7bbcbc0e..32d02492 100644 --- a/Sources/DOMKit/WebIDL/Path2D_or_String.swift +++ b/Sources/DOMKit/WebIDL/Path2D_or_String.swift @@ -21,12 +21,12 @@ public enum Path2D_or_String: JSValueCompatible, Any_Path2D_or_String { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .path2D(path2D): - return path2D.jsValue() + return path2D.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/PaymentComplete.swift b/Sources/DOMKit/WebIDL/PaymentComplete.swift index 0143eaf2..fbf6f301 100644 --- a/Sources/DOMKit/WebIDL/PaymentComplete.swift +++ b/Sources/DOMKit/WebIDL/PaymentComplete.swift @@ -19,5 +19,5 @@ public enum PaymentComplete: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift b/Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift index 98d8bdcf..5c708c65 100644 --- a/Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift +++ b/Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class PaymentCredentialInstrument: BridgedDictionary { public convenience init(displayName: String, icon: String, iconMustBeShown: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.displayName] = displayName.jsValue() - object[Strings.icon] = icon.jsValue() - object[Strings.iconMustBeShown] = iconMustBeShown.jsValue() + object[Strings.displayName] = displayName.jsValue + object[Strings.icon] = icon.jsValue + object[Strings.iconMustBeShown] = iconMustBeShown.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift b/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift index 06a6d2ec..79df15ad 100644 --- a/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift +++ b/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PaymentCurrencyAmount: BridgedDictionary { public convenience init(currency: String, value: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.currency] = currency.jsValue() - object[Strings.value] = value.jsValue() + object[Strings.currency] = currency.jsValue + object[Strings.value] = value.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift b/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift index 9817eb69..f1800e87 100644 --- a/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift +++ b/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PaymentDetailsBase: BridgedDictionary { public convenience init(displayItems: [PaymentItem], modifiers: [PaymentDetailsModifier]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.displayItems] = displayItems.jsValue() - object[Strings.modifiers] = modifiers.jsValue() + object[Strings.displayItems] = displayItems.jsValue + object[Strings.modifiers] = modifiers.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift b/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift index ac3aeb46..c7013679 100644 --- a/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift +++ b/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PaymentDetailsInit: BridgedDictionary { public convenience init(id: String, total: PaymentItem) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue() - object[Strings.total] = total.jsValue() + object[Strings.id] = id.jsValue + object[Strings.total] = total.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift b/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift index 46fe6d87..2fb76c55 100644 --- a/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift +++ b/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class PaymentDetailsModifier: BridgedDictionary { public convenience init(supportedMethods: String, total: PaymentItem, additionalDisplayItems: [PaymentItem], data: JSObject) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supportedMethods] = supportedMethods.jsValue() - object[Strings.total] = total.jsValue() - object[Strings.additionalDisplayItems] = additionalDisplayItems.jsValue() - object[Strings.data] = data.jsValue() + object[Strings.supportedMethods] = supportedMethods.jsValue + object[Strings.total] = total.jsValue + object[Strings.additionalDisplayItems] = additionalDisplayItems.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift b/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift index 93a3c5a6..ca1da2d1 100644 --- a/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift +++ b/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PaymentDetailsUpdate: BridgedDictionary { public convenience init(total: PaymentItem, paymentMethodErrors: JSObject) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.total] = total.jsValue() - object[Strings.paymentMethodErrors] = paymentMethodErrors.jsValue() + object[Strings.total] = total.jsValue + object[Strings.paymentMethodErrors] = paymentMethodErrors.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift b/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift index 1ca526cc..8b6c610f 100644 --- a/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift +++ b/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PaymentHandlerResponse: BridgedDictionary { public convenience init(methodName: String, details: JSObject) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.methodName] = methodName.jsValue() - object[Strings.details] = details.jsValue() + object[Strings.methodName] = methodName.jsValue + object[Strings.details] = details.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentInstrument.swift b/Sources/DOMKit/WebIDL/PaymentInstrument.swift index f3ac37ee..4cb83963 100644 --- a/Sources/DOMKit/WebIDL/PaymentInstrument.swift +++ b/Sources/DOMKit/WebIDL/PaymentInstrument.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class PaymentInstrument: BridgedDictionary { public convenience init(name: String, icons: [ImageObject], method: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.icons] = icons.jsValue() - object[Strings.method] = method.jsValue() + object[Strings.name] = name.jsValue + object[Strings.icons] = icons.jsValue + object[Strings.method] = method.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentInstruments.swift b/Sources/DOMKit/WebIDL/PaymentInstruments.swift index 60a02053..6068a16f 100644 --- a/Sources/DOMKit/WebIDL/PaymentInstruments.swift +++ b/Sources/DOMKit/WebIDL/PaymentInstruments.swift @@ -14,26 +14,26 @@ public class PaymentInstruments: JSBridgedClass { @inlinable public func delete(instrumentKey: String) -> JSPromise { let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! + return this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func delete(instrumentKey: String) async throws -> Bool { let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func get(instrumentKey: String) -> JSPromise { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func get(instrumentKey: String) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func keys() -> JSPromise { @@ -45,31 +45,31 @@ public class PaymentInstruments: JSBridgedClass { @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.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func has(instrumentKey: String) -> JSPromise { let this = jsObject - return this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! + return this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func has(instrumentKey: String) async throws -> Bool { let this = jsObject - let _promise: JSPromise = this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func set(instrumentKey: String, details: PaymentInstrument) -> JSPromise { let this = jsObject - return this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue(), details.jsValue()]).fromJSValue()! + return this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue, details.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func set(instrumentKey: String, details: PaymentInstrument) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue(), details.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue, details.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func clear() -> JSPromise { @@ -81,6 +81,6 @@ public class PaymentInstruments: JSBridgedClass { @inlinable public func clear() async throws { let this = jsObject let _promise: JSPromise = this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/PaymentItem.swift b/Sources/DOMKit/WebIDL/PaymentItem.swift index 75664a54..5604dd86 100644 --- a/Sources/DOMKit/WebIDL/PaymentItem.swift +++ b/Sources/DOMKit/WebIDL/PaymentItem.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class PaymentItem: BridgedDictionary { public convenience init(label: String, amount: PaymentCurrencyAmount, pending: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue() - object[Strings.amount] = amount.jsValue() - object[Strings.pending] = pending.jsValue() + object[Strings.label] = label.jsValue + object[Strings.amount] = amount.jsValue + object[Strings.pending] = pending.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift b/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift index c9cb0198..20975286 100644 --- a/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift @@ -13,7 +13,7 @@ public class PaymentMethodChangeEvent: PaymentRequestUpdateEvent { } @inlinable public convenience init(type: String, eventInitDict: PaymentMethodChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift b/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift index 2e894a7b..82f277fd 100644 --- a/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PaymentMethodChangeEventInit: BridgedDictionary { public convenience init(methodName: String, methodDetails: JSObject?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.methodName] = methodName.jsValue() - object[Strings.methodDetails] = methodDetails.jsValue() + object[Strings.methodName] = methodName.jsValue + object[Strings.methodDetails] = methodDetails.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentMethodData.swift b/Sources/DOMKit/WebIDL/PaymentMethodData.swift index b64697c3..28ced977 100644 --- a/Sources/DOMKit/WebIDL/PaymentMethodData.swift +++ b/Sources/DOMKit/WebIDL/PaymentMethodData.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PaymentMethodData: BridgedDictionary { public convenience init(supportedMethods: String, data: JSObject) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supportedMethods] = supportedMethods.jsValue() - object[Strings.data] = data.jsValue() + object[Strings.supportedMethods] = supportedMethods.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentRequest.swift b/Sources/DOMKit/WebIDL/PaymentRequest.swift index e4743bf2..be72bebc 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequest.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequest.swift @@ -13,19 +13,19 @@ public class PaymentRequest: EventTarget { } @inlinable public convenience init(methodData: [PaymentMethodData], details: PaymentDetailsInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [methodData.jsValue(), details.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [methodData.jsValue, details.jsValue])) } @inlinable public func show(detailsPromise: JSPromise? = nil) -> JSPromise { let this = jsObject - return this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func show(detailsPromise: JSPromise? = nil) async throws -> PaymentResponse { let this = jsObject - let _promise: JSPromise = this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func abort() -> JSPromise { @@ -37,7 +37,7 @@ public class PaymentRequest: EventTarget { @inlinable public func abort() async throws { let this = jsObject let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func canMakePayment() -> JSPromise { @@ -49,7 +49,7 @@ public class PaymentRequest: EventTarget { @inlinable public func canMakePayment() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.canMakePayment].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift b/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift index baff20bb..5f532169 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class PaymentRequestDetailsUpdate: BridgedDictionary { public convenience init(error: String, total: PaymentCurrencyAmount, modifiers: [PaymentDetailsModifier], paymentMethodErrors: JSObject) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue() - object[Strings.total] = total.jsValue() - object[Strings.modifiers] = modifiers.jsValue() - object[Strings.paymentMethodErrors] = paymentMethodErrors.jsValue() + object[Strings.error] = error.jsValue + object[Strings.total] = total.jsValue + object[Strings.modifiers] = modifiers.jsValue + object[Strings.paymentMethodErrors] = paymentMethodErrors.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift b/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift index 43ad5559..572f76c3 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class PaymentRequestEventInit: BridgedDictionary { public convenience init(topOrigin: String, paymentRequestOrigin: String, paymentRequestId: String, methodData: [PaymentMethodData], total: PaymentCurrencyAmount, modifiers: [PaymentDetailsModifier]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.topOrigin] = topOrigin.jsValue() - object[Strings.paymentRequestOrigin] = paymentRequestOrigin.jsValue() - object[Strings.paymentRequestId] = paymentRequestId.jsValue() - object[Strings.methodData] = methodData.jsValue() - object[Strings.total] = total.jsValue() - object[Strings.modifiers] = modifiers.jsValue() + object[Strings.topOrigin] = topOrigin.jsValue + object[Strings.paymentRequestOrigin] = paymentRequestOrigin.jsValue + object[Strings.paymentRequestId] = paymentRequestId.jsValue + object[Strings.methodData] = methodData.jsValue + object[Strings.total] = total.jsValue + object[Strings.modifiers] = modifiers.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift index 16e0b13f..314ee90a 100644 --- a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift @@ -11,11 +11,11 @@ public class PaymentRequestUpdateEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: PaymentRequestUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @inlinable public func updateWith(detailsPromise: JSPromise) { let this = jsObject - _ = this[Strings.updateWith].function!(this: this, arguments: [detailsPromise.jsValue()]) + _ = this[Strings.updateWith].function!(this: this, arguments: [detailsPromise.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/PaymentResponse.swift b/Sources/DOMKit/WebIDL/PaymentResponse.swift index 7b12a4eb..64ef013b 100644 --- a/Sources/DOMKit/WebIDL/PaymentResponse.swift +++ b/Sources/DOMKit/WebIDL/PaymentResponse.swift @@ -29,25 +29,25 @@ public class PaymentResponse: EventTarget { @inlinable public func complete(result: PaymentComplete? = nil) -> JSPromise { let this = jsObject - return this[Strings.complete].function!(this: this, arguments: [result?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.complete].function!(this: this, arguments: [result?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func complete(result: PaymentComplete? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.complete].function!(this: this, arguments: [result?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.complete].function!(this: this, arguments: [result?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func retry(errorFields: PaymentValidationErrors? = nil) -> JSPromise { let this = jsObject - return this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func retry(errorFields: PaymentValidationErrors? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift b/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift index d4030bb5..dbfbbb6c 100644 --- a/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift +++ b/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PaymentValidationErrors: BridgedDictionary { public convenience init(error: String, paymentMethod: JSObject) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue() - object[Strings.paymentMethod] = paymentMethod.jsValue() + object[Strings.error] = error.jsValue + object[Strings.paymentMethod] = paymentMethod.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Pbkdf2Params.swift b/Sources/DOMKit/WebIDL/Pbkdf2Params.swift index 4fc86742..e7bbe3d4 100644 --- a/Sources/DOMKit/WebIDL/Pbkdf2Params.swift +++ b/Sources/DOMKit/WebIDL/Pbkdf2Params.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class Pbkdf2Params: BridgedDictionary { public convenience init(salt: BufferSource, iterations: UInt32, hash: HashAlgorithmIdentifier) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.salt] = salt.jsValue() - object[Strings.iterations] = iterations.jsValue() - object[Strings.hash] = hash.jsValue() + object[Strings.salt] = salt.jsValue + object[Strings.iterations] = iterations.jsValue + object[Strings.hash] = hash.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index 059905b6..798756b9 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -50,7 +50,7 @@ public class Performance: EventTarget { @inlinable public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { let this = jsObject let _promise: JSPromise = this[Strings.measureUserAgentSpecificMemory].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getEntries() -> PerformanceEntryList { @@ -60,12 +60,12 @@ public class Performance: EventTarget { @inlinable public func getEntriesByType(type: String) -> PerformanceEntryList { let this = jsObject - return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } @inlinable public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { let this = jsObject - return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue(), type?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue, type?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func clearResourceTimings() { @@ -75,7 +75,7 @@ public class Performance: EventTarget { @inlinable public func setResourceTimingBufferSize(maxSize: UInt32) { let this = jsObject - _ = this[Strings.setResourceTimingBufferSize].function!(this: this, arguments: [maxSize.jsValue()]) + _ = this[Strings.setResourceTimingBufferSize].function!(this: this, arguments: [maxSize.jsValue]) } @ClosureAttribute1Optional @@ -83,21 +83,21 @@ public class Performance: EventTarget { @inlinable public func mark(markName: String, markOptions: PerformanceMarkOptions? = nil) -> PerformanceMark { let this = jsObject - return this[Strings.mark].function!(this: this, arguments: [markName.jsValue(), markOptions?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.mark].function!(this: this, arguments: [markName.jsValue, markOptions?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func clearMarks(markName: String? = nil) { let this = jsObject - _ = this[Strings.clearMarks].function!(this: this, arguments: [markName?.jsValue() ?? .undefined]) + _ = this[Strings.clearMarks].function!(this: this, arguments: [markName?.jsValue ?? .undefined]) } @inlinable public func measure(measureName: String, startOrMeasureOptions: PerformanceMeasureOptions_or_String? = nil, endMark: String? = nil) -> PerformanceMeasure { let this = jsObject - return this[Strings.measure].function!(this: this, arguments: [measureName.jsValue(), startOrMeasureOptions?.jsValue() ?? .undefined, endMark?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.measure].function!(this: this, arguments: [measureName.jsValue, startOrMeasureOptions?.jsValue ?? .undefined, endMark?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func clearMeasures(measureName: String? = nil) { let this = jsObject - _ = this[Strings.clearMeasures].function!(this: this, arguments: [measureName?.jsValue() ?? .undefined]) + _ = this[Strings.clearMeasures].function!(this: this, arguments: [measureName?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/PerformanceMark.swift b/Sources/DOMKit/WebIDL/PerformanceMark.swift index f25649d1..dc0871cb 100644 --- a/Sources/DOMKit/WebIDL/PerformanceMark.swift +++ b/Sources/DOMKit/WebIDL/PerformanceMark.swift @@ -12,7 +12,7 @@ public class PerformanceMark: PerformanceEntry { } @inlinable public convenience init(markName: String, markOptions: PerformanceMarkOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [markName.jsValue(), markOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [markName.jsValue, markOptions?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift b/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift index 1d5c909f..d5357f14 100644 --- a/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift +++ b/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PerformanceMarkOptions: BridgedDictionary { public convenience init(detail: JSValue, startTime: DOMHighResTimeStamp) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.detail] = detail.jsValue() - object[Strings.startTime] = startTime.jsValue() + object[Strings.detail] = detail.jsValue + object[Strings.startTime] = startTime.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift index 6e40bcd0..73b13ccb 100644 --- a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift +++ b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class PerformanceMeasureOptions: BridgedDictionary { public convenience init(detail: JSValue, start: DOMHighResTimeStamp_or_String, duration: DOMHighResTimeStamp, end: DOMHighResTimeStamp_or_String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.detail] = detail.jsValue() - object[Strings.start] = start.jsValue() - object[Strings.duration] = duration.jsValue() - object[Strings.end] = end.jsValue() + object[Strings.detail] = detail.jsValue + object[Strings.start] = start.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.end] = end.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift index bd58ec0a..6d968fcc 100644 --- a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift +++ b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift @@ -21,12 +21,12 @@ public enum PerformanceMeasureOptions_or_String: JSValueCompatible, Any_Performa return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .performanceMeasureOptions(performanceMeasureOptions): - return performanceMeasureOptions.jsValue() + return performanceMeasureOptions.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/PerformanceObserver.swift b/Sources/DOMKit/WebIDL/PerformanceObserver.swift index aaec30c9..11dd46d0 100644 --- a/Sources/DOMKit/WebIDL/PerformanceObserver.swift +++ b/Sources/DOMKit/WebIDL/PerformanceObserver.swift @@ -17,7 +17,7 @@ public class PerformanceObserver: JSBridgedClass { @inlinable public func observe(options: PerformanceObserverInit? = nil) { let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) + _ = this[Strings.observe].function!(this: this, arguments: [options?.jsValue ?? .undefined]) } @inlinable public func disconnect() { diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift b/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift index a9862713..7d89e5db 100644 --- a/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift +++ b/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PerformanceObserverCallbackOptions: BridgedDictionary { public convenience init(droppedEntriesCount: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.droppedEntriesCount] = droppedEntriesCount.jsValue() + object[Strings.droppedEntriesCount] = droppedEntriesCount.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift b/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift index 5985637b..a0eb0398 100644 --- a/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift +++ b/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift @@ -19,11 +19,11 @@ public class PerformanceObserverEntryList: JSBridgedClass { @inlinable public func getEntriesByType(type: String) -> PerformanceEntryList { let this = jsObject - return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } @inlinable public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { let this = jsObject - return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue(), type?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue, type?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift b/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift index 95590581..3cf5102f 100644 --- a/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift +++ b/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class PerformanceObserverInit: BridgedDictionary { public convenience init(durationThreshold: DOMHighResTimeStamp, entryTypes: [String], type: String, buffered: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.durationThreshold] = durationThreshold.jsValue() - object[Strings.entryTypes] = entryTypes.jsValue() - object[Strings.type] = type.jsValue() - object[Strings.buffered] = buffered.jsValue() + object[Strings.durationThreshold] = durationThreshold.jsValue + object[Strings.entryTypes] = entryTypes.jsValue + object[Strings.type] = type.jsValue + object[Strings.buffered] = buffered.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift b/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift index 99f354c4..4d3cbe35 100644 --- a/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift +++ b/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PeriodicSyncEventInit: BridgedDictionary { public convenience init(tag: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.tag] = tag.jsValue() + object[Strings.tag] = tag.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift b/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift index 77ef149f..ddd8179a 100644 --- a/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift +++ b/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift @@ -14,14 +14,14 @@ public class PeriodicSyncManager: JSBridgedClass { @inlinable public func register(tag: String, options: BackgroundSyncOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.register].function!(this: this, arguments: [tag.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.register].function!(this: this, arguments: [tag.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func register(tag: String, options: BackgroundSyncOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func getTags() -> JSPromise { @@ -33,18 +33,18 @@ public class PeriodicSyncManager: JSBridgedClass { @inlinable public func getTags() async throws -> [String] { let this = jsObject let _promise: JSPromise = this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func unregister(tag: String) -> JSPromise { let this = jsObject - return this[Strings.unregister].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! + return this[Strings.unregister].function!(this: this, arguments: [tag.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func unregister(tag: String) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.unregister].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.unregister].function!(this: this, arguments: [tag.jsValue]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/PeriodicWave.swift b/Sources/DOMKit/WebIDL/PeriodicWave.swift index 57c30cc4..ab55c718 100644 --- a/Sources/DOMKit/WebIDL/PeriodicWave.swift +++ b/Sources/DOMKit/WebIDL/PeriodicWave.swift @@ -13,6 +13,6 @@ public class PeriodicWave: JSBridgedClass { } @inlinable public convenience init(context: BaseAudioContext, options: PeriodicWaveOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift b/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift index 1c559abe..2bc37508 100644 --- a/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift +++ b/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PeriodicWaveConstraints: BridgedDictionary { public convenience init(disableNormalization: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.disableNormalization] = disableNormalization.jsValue() + object[Strings.disableNormalization] = disableNormalization.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift b/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift index d99e88be..09003cc6 100644 --- a/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift +++ b/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PeriodicWaveOptions: BridgedDictionary { public convenience init(real: [Float], imag: [Float]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.real] = real.jsValue() - object[Strings.imag] = imag.jsValue() + object[Strings.real] = real.jsValue + object[Strings.imag] = imag.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PermissionDescriptor.swift b/Sources/DOMKit/WebIDL/PermissionDescriptor.swift index f57973fc..cef25efb 100644 --- a/Sources/DOMKit/WebIDL/PermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/PermissionDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PermissionDescriptor: BridgedDictionary { public convenience init(name: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() + object[Strings.name] = name.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PermissionSetParameters.swift b/Sources/DOMKit/WebIDL/PermissionSetParameters.swift index 09f0411c..f4657869 100644 --- a/Sources/DOMKit/WebIDL/PermissionSetParameters.swift +++ b/Sources/DOMKit/WebIDL/PermissionSetParameters.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class PermissionSetParameters: BridgedDictionary { public convenience init(descriptor: PermissionDescriptor, state: PermissionState, oneRealm: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.descriptor] = descriptor.jsValue() - object[Strings.state] = state.jsValue() - object[Strings.oneRealm] = oneRealm.jsValue() + object[Strings.descriptor] = descriptor.jsValue + object[Strings.state] = state.jsValue + object[Strings.oneRealm] = oneRealm.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PermissionState.swift b/Sources/DOMKit/WebIDL/PermissionState.swift index 08889b82..f489d106 100644 --- a/Sources/DOMKit/WebIDL/PermissionState.swift +++ b/Sources/DOMKit/WebIDL/PermissionState.swift @@ -19,5 +19,5 @@ public enum PermissionState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Permissions.swift b/Sources/DOMKit/WebIDL/Permissions.swift index 4fc51b03..37e98036 100644 --- a/Sources/DOMKit/WebIDL/Permissions.swift +++ b/Sources/DOMKit/WebIDL/Permissions.swift @@ -14,37 +14,37 @@ public class Permissions: JSBridgedClass { @inlinable public func request(permissionDesc: JSObject) -> JSPromise { let this = jsObject - return this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! + return this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func request(permissionDesc: JSObject) async throws -> PermissionStatus { let this = jsObject - let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func revoke(permissionDesc: JSObject) -> JSPromise { let this = jsObject - return this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! + return this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func revoke(permissionDesc: JSObject) async throws -> PermissionStatus { let this = jsObject - let _promise: JSPromise = this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func query(permissionDesc: JSObject) -> JSPromise { let this = jsObject - return this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! + return this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func query(permissionDesc: JSObject) async throws -> PermissionStatus { let this = jsObject - let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PermissionsPolicy.swift b/Sources/DOMKit/WebIDL/PermissionsPolicy.swift index 120c75d0..b8b7313a 100644 --- a/Sources/DOMKit/WebIDL/PermissionsPolicy.swift +++ b/Sources/DOMKit/WebIDL/PermissionsPolicy.swift @@ -14,7 +14,7 @@ public class PermissionsPolicy: JSBridgedClass { @inlinable public func allowsFeature(feature: String, origin: String? = nil) -> Bool { let this = jsObject - return this[Strings.allowsFeature].function!(this: this, arguments: [feature.jsValue(), origin?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.allowsFeature].function!(this: this, arguments: [feature.jsValue, origin?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func features() -> [String] { @@ -29,6 +29,6 @@ public class PermissionsPolicy: JSBridgedClass { @inlinable public func getAllowlistForFeature(feature: String) -> [String] { let this = jsObject - return this[Strings.getAllowlistForFeature].function!(this: this, arguments: [feature.jsValue()]).fromJSValue()! + return this[Strings.getAllowlistForFeature].function!(this: this, arguments: [feature.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PhotoCapabilities.swift b/Sources/DOMKit/WebIDL/PhotoCapabilities.swift index ed2f3ae6..e69bda84 100644 --- a/Sources/DOMKit/WebIDL/PhotoCapabilities.swift +++ b/Sources/DOMKit/WebIDL/PhotoCapabilities.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class PhotoCapabilities: BridgedDictionary { public convenience init(redEyeReduction: RedEyeReduction, imageHeight: MediaSettingsRange, imageWidth: MediaSettingsRange, fillLightMode: [FillLightMode]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.redEyeReduction] = redEyeReduction.jsValue() - object[Strings.imageHeight] = imageHeight.jsValue() - object[Strings.imageWidth] = imageWidth.jsValue() - object[Strings.fillLightMode] = fillLightMode.jsValue() + object[Strings.redEyeReduction] = redEyeReduction.jsValue + object[Strings.imageHeight] = imageHeight.jsValue + object[Strings.imageWidth] = imageWidth.jsValue + object[Strings.fillLightMode] = fillLightMode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PhotoSettings.swift b/Sources/DOMKit/WebIDL/PhotoSettings.swift index dc4f4972..5438662d 100644 --- a/Sources/DOMKit/WebIDL/PhotoSettings.swift +++ b/Sources/DOMKit/WebIDL/PhotoSettings.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class PhotoSettings: BridgedDictionary { public convenience init(fillLightMode: FillLightMode, imageHeight: Double, imageWidth: Double, redEyeReduction: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fillLightMode] = fillLightMode.jsValue() - object[Strings.imageHeight] = imageHeight.jsValue() - object[Strings.imageWidth] = imageWidth.jsValue() - object[Strings.redEyeReduction] = redEyeReduction.jsValue() + object[Strings.fillLightMode] = fillLightMode.jsValue + object[Strings.imageHeight] = imageHeight.jsValue + object[Strings.imageWidth] = imageWidth.jsValue + object[Strings.redEyeReduction] = redEyeReduction.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift b/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift index bb50b9de..1919f26c 100644 --- a/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift +++ b/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift @@ -12,7 +12,7 @@ public class PictureInPictureEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: PictureInPictureEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift b/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift index af307ef9..bc85af6b 100644 --- a/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift +++ b/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PictureInPictureEventInit: BridgedDictionary { public convenience init(pictureInPictureWindow: PictureInPictureWindow) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.pictureInPictureWindow] = pictureInPictureWindow.jsValue() + object[Strings.pictureInPictureWindow] = pictureInPictureWindow.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PlaneLayout.swift b/Sources/DOMKit/WebIDL/PlaneLayout.swift index c460bc99..a4de400e 100644 --- a/Sources/DOMKit/WebIDL/PlaneLayout.swift +++ b/Sources/DOMKit/WebIDL/PlaneLayout.swift @@ -6,8 +6,8 @@ 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() + object[Strings.offset] = offset.jsValue + object[Strings.stride] = stride.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PlaybackDirection.swift b/Sources/DOMKit/WebIDL/PlaybackDirection.swift index 079b1d52..ca639aea 100644 --- a/Sources/DOMKit/WebIDL/PlaybackDirection.swift +++ b/Sources/DOMKit/WebIDL/PlaybackDirection.swift @@ -20,5 +20,5 @@ public enum PlaybackDirection: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Point2D.swift b/Sources/DOMKit/WebIDL/Point2D.swift index 340d9d32..d6c0ebcb 100644 --- a/Sources/DOMKit/WebIDL/Point2D.swift +++ b/Sources/DOMKit/WebIDL/Point2D.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class Point2D: BridgedDictionary { public convenience init(x: Double, y: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PointerEvent.swift b/Sources/DOMKit/WebIDL/PointerEvent.swift index acd5116f..4bc22c5e 100644 --- a/Sources/DOMKit/WebIDL/PointerEvent.swift +++ b/Sources/DOMKit/WebIDL/PointerEvent.swift @@ -23,7 +23,7 @@ public class PointerEvent: MouseEvent { } @inlinable public convenience init(type: String, eventInitDict: PointerEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PointerEventInit.swift b/Sources/DOMKit/WebIDL/PointerEventInit.swift index 4820bd17..e50dd406 100644 --- a/Sources/DOMKit/WebIDL/PointerEventInit.swift +++ b/Sources/DOMKit/WebIDL/PointerEventInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class PointerEventInit: BridgedDictionary { public convenience init(pointerId: Int32, width: Double, height: Double, pressure: Float, tangentialPressure: Float, tiltX: Int32, tiltY: Int32, twist: Int32, altitudeAngle: Double, azimuthAngle: Double, pointerType: String, isPrimary: Bool, coalescedEvents: [PointerEvent], predictedEvents: [PointerEvent]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.pointerId] = pointerId.jsValue() - object[Strings.width] = width.jsValue() - object[Strings.height] = height.jsValue() - object[Strings.pressure] = pressure.jsValue() - object[Strings.tangentialPressure] = tangentialPressure.jsValue() - object[Strings.tiltX] = tiltX.jsValue() - object[Strings.tiltY] = tiltY.jsValue() - object[Strings.twist] = twist.jsValue() - object[Strings.altitudeAngle] = altitudeAngle.jsValue() - object[Strings.azimuthAngle] = azimuthAngle.jsValue() - object[Strings.pointerType] = pointerType.jsValue() - object[Strings.isPrimary] = isPrimary.jsValue() - object[Strings.coalescedEvents] = coalescedEvents.jsValue() - object[Strings.predictedEvents] = predictedEvents.jsValue() + object[Strings.pointerId] = pointerId.jsValue + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.pressure] = pressure.jsValue + object[Strings.tangentialPressure] = tangentialPressure.jsValue + object[Strings.tiltX] = tiltX.jsValue + object[Strings.tiltY] = tiltY.jsValue + object[Strings.twist] = twist.jsValue + object[Strings.altitudeAngle] = altitudeAngle.jsValue + object[Strings.azimuthAngle] = azimuthAngle.jsValue + object[Strings.pointerType] = pointerType.jsValue + object[Strings.isPrimary] = isPrimary.jsValue + object[Strings.coalescedEvents] = coalescedEvents.jsValue + object[Strings.predictedEvents] = predictedEvents.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PopStateEvent.swift b/Sources/DOMKit/WebIDL/PopStateEvent.swift index b6fb6d13..cbfd0e55 100644 --- a/Sources/DOMKit/WebIDL/PopStateEvent.swift +++ b/Sources/DOMKit/WebIDL/PopStateEvent.swift @@ -12,7 +12,7 @@ public class PopStateEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: PopStateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PopStateEventInit.swift b/Sources/DOMKit/WebIDL/PopStateEventInit.swift index fe1de0c0..f0814184 100644 --- a/Sources/DOMKit/WebIDL/PopStateEventInit.swift +++ b/Sources/DOMKit/WebIDL/PopStateEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PopStateEventInit: BridgedDictionary { public convenience init(state: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.state] = state.jsValue() + object[Strings.state] = state.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift index ae79c2a4..72643da9 100644 --- a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift +++ b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift @@ -12,7 +12,7 @@ public class PortalActivateEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: PortalActivateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift b/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift index 94edbc81..a3b719e5 100644 --- a/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift +++ b/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PortalActivateEventInit: BridgedDictionary { public convenience init(data: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.data] = data.jsValue() + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PortalActivateOptions.swift b/Sources/DOMKit/WebIDL/PortalActivateOptions.swift index 9d3c8720..908d6e88 100644 --- a/Sources/DOMKit/WebIDL/PortalActivateOptions.swift +++ b/Sources/DOMKit/WebIDL/PortalActivateOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PortalActivateOptions: BridgedDictionary { public convenience init(data: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.data] = data.jsValue() + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PortalHost.swift b/Sources/DOMKit/WebIDL/PortalHost.swift index 28457229..fc38d513 100644 --- a/Sources/DOMKit/WebIDL/PortalHost.swift +++ b/Sources/DOMKit/WebIDL/PortalHost.swift @@ -14,7 +14,7 @@ public class PortalHost: EventTarget { @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/PositionAlignSetting.swift b/Sources/DOMKit/WebIDL/PositionAlignSetting.swift index 3c732a68..22e63c56 100644 --- a/Sources/DOMKit/WebIDL/PositionAlignSetting.swift +++ b/Sources/DOMKit/WebIDL/PositionAlignSetting.swift @@ -20,5 +20,5 @@ public enum PositionAlignSetting: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/PositionOptions.swift b/Sources/DOMKit/WebIDL/PositionOptions.swift index 95ffc138..1dcc13af 100644 --- a/Sources/DOMKit/WebIDL/PositionOptions.swift +++ b/Sources/DOMKit/WebIDL/PositionOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class PositionOptions: BridgedDictionary { public convenience init(enableHighAccuracy: Bool, timeout: UInt32, maximumAge: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.enableHighAccuracy] = enableHighAccuracy.jsValue() - object[Strings.timeout] = timeout.jsValue() - object[Strings.maximumAge] = maximumAge.jsValue() + object[Strings.enableHighAccuracy] = enableHighAccuracy.jsValue + object[Strings.timeout] = timeout.jsValue + object[Strings.maximumAge] = maximumAge.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift index 33c73a7a..67727b3f 100644 --- a/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift +++ b/Sources/DOMKit/WebIDL/PredefinedColorSpace.swift @@ -18,5 +18,5 @@ public enum PredefinedColorSpace: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift index 23f43a02..92f71592 100644 --- a/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift +++ b/Sources/DOMKit/WebIDL/PremultiplyAlpha.swift @@ -19,5 +19,5 @@ public enum PremultiplyAlpha: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/PresentationConnection.swift b/Sources/DOMKit/WebIDL/PresentationConnection.swift index caf3d621..7bcae7d9 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnection.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnection.swift @@ -54,21 +54,21 @@ public class PresentationConnection: EventTarget { @inlinable public func send(message: String) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [message.jsValue()]) + _ = this[Strings.send].function!(this: this, arguments: [message.jsValue]) } @inlinable public func send(data: Blob) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) } @inlinable public func send(data: ArrayBuffer) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) } @inlinable public func send(data: ArrayBufferView) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift index a9231176..81794a1f 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift @@ -12,7 +12,7 @@ public class PresentationConnectionAvailableEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: PresentationConnectionAvailableEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift index 221a24b2..9a308724 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PresentationConnectionAvailableEventInit: BridgedDictionary { public convenience init(connection: PresentationConnection) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.connection] = connection.jsValue() + object[Strings.connection] = connection.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift index 022539f6..d2b1fd07 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift @@ -13,7 +13,7 @@ public class PresentationConnectionCloseEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: PresentationConnectionCloseEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift index 49608e58..42d64e87 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PresentationConnectionCloseEventInit: BridgedDictionary { public convenience init(reason: PresentationConnectionCloseReason, message: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.reason] = reason.jsValue() - object[Strings.message] = message.jsValue() + object[Strings.reason] = reason.jsValue + object[Strings.message] = message.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift index 2c18e2aa..5555165e 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift @@ -19,5 +19,5 @@ public enum PresentationConnectionCloseReason: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionState.swift b/Sources/DOMKit/WebIDL/PresentationConnectionState.swift index 6386d3ac..03ad68ed 100644 --- a/Sources/DOMKit/WebIDL/PresentationConnectionState.swift +++ b/Sources/DOMKit/WebIDL/PresentationConnectionState.swift @@ -20,5 +20,5 @@ public enum PresentationConnectionState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/PresentationRequest.swift b/Sources/DOMKit/WebIDL/PresentationRequest.swift index b6b4a846..92f56495 100644 --- a/Sources/DOMKit/WebIDL/PresentationRequest.swift +++ b/Sources/DOMKit/WebIDL/PresentationRequest.swift @@ -12,11 +12,11 @@ public class PresentationRequest: EventTarget { } @inlinable public convenience init(url: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue])) } @inlinable public convenience init(urls: [String]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [urls.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [urls.jsValue])) } @inlinable public func start() -> JSPromise { @@ -28,19 +28,19 @@ public class PresentationRequest: EventTarget { @inlinable public func start() async throws -> PresentationConnection { let this = jsObject let _promise: JSPromise = this[Strings.start].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func reconnect(presentationId: String) -> JSPromise { let this = jsObject - return this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue()]).fromJSValue()! + return this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func reconnect(presentationId: String) async throws -> PresentationConnection { let this = jsObject - let _promise: JSPromise = this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getAvailability() -> JSPromise { @@ -52,7 +52,7 @@ public class PresentationRequest: EventTarget { @inlinable public func getAvailability() async throws -> PresentationAvailability { let this = jsObject let _promise: JSPromise = this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/PresentationStyle.swift b/Sources/DOMKit/WebIDL/PresentationStyle.swift index cfec31dc..5764ca11 100644 --- a/Sources/DOMKit/WebIDL/PresentationStyle.swift +++ b/Sources/DOMKit/WebIDL/PresentationStyle.swift @@ -19,5 +19,5 @@ public enum PresentationStyle: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Profiler.swift b/Sources/DOMKit/WebIDL/Profiler.swift index 8e37f4af..8f963b4a 100644 --- a/Sources/DOMKit/WebIDL/Profiler.swift +++ b/Sources/DOMKit/WebIDL/Profiler.swift @@ -19,7 +19,7 @@ public class Profiler: EventTarget { public var stopped: Bool @inlinable public convenience init(options: ProfilerInitOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue])) } @inlinable public func stop() -> JSPromise { @@ -31,6 +31,6 @@ public class Profiler: EventTarget { @inlinable public func stop() async throws -> ProfilerTrace { let this = jsObject let _promise: JSPromise = this[Strings.stop].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ProfilerFrame.swift b/Sources/DOMKit/WebIDL/ProfilerFrame.swift index 38607f2b..3afdbfa9 100644 --- a/Sources/DOMKit/WebIDL/ProfilerFrame.swift +++ b/Sources/DOMKit/WebIDL/ProfilerFrame.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class ProfilerFrame: BridgedDictionary { public convenience init(name: String, resourceId: UInt64, line: UInt64, column: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.resourceId] = resourceId.jsValue() - object[Strings.line] = line.jsValue() - object[Strings.column] = column.jsValue() + object[Strings.name] = name.jsValue + object[Strings.resourceId] = resourceId.jsValue + object[Strings.line] = line.jsValue + object[Strings.column] = column.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift b/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift index 651ef46d..95cc0e2c 100644 --- a/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift +++ b/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ProfilerInitOptions: BridgedDictionary { public convenience init(sampleInterval: DOMHighResTimeStamp, maxBufferSize: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sampleInterval] = sampleInterval.jsValue() - object[Strings.maxBufferSize] = maxBufferSize.jsValue() + object[Strings.sampleInterval] = sampleInterval.jsValue + object[Strings.maxBufferSize] = maxBufferSize.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ProfilerSample.swift b/Sources/DOMKit/WebIDL/ProfilerSample.swift index a3a4505b..2e25a30a 100644 --- a/Sources/DOMKit/WebIDL/ProfilerSample.swift +++ b/Sources/DOMKit/WebIDL/ProfilerSample.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ProfilerSample: BridgedDictionary { public convenience init(timestamp: DOMHighResTimeStamp, stackId: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue() - object[Strings.stackId] = stackId.jsValue() + object[Strings.timestamp] = timestamp.jsValue + object[Strings.stackId] = stackId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ProfilerStack.swift b/Sources/DOMKit/WebIDL/ProfilerStack.swift index d0fb1d95..3ff4f1c8 100644 --- a/Sources/DOMKit/WebIDL/ProfilerStack.swift +++ b/Sources/DOMKit/WebIDL/ProfilerStack.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ProfilerStack: BridgedDictionary { public convenience init(parentId: UInt64, frameId: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.parentId] = parentId.jsValue() - object[Strings.frameId] = frameId.jsValue() + object[Strings.parentId] = parentId.jsValue + object[Strings.frameId] = frameId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ProfilerTrace.swift b/Sources/DOMKit/WebIDL/ProfilerTrace.swift index cb0bcf11..6686b6ab 100644 --- a/Sources/DOMKit/WebIDL/ProfilerTrace.swift +++ b/Sources/DOMKit/WebIDL/ProfilerTrace.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class ProfilerTrace: BridgedDictionary { public convenience init(resources: [ProfilerResource], frames: [ProfilerFrame], stacks: [ProfilerStack], samples: [ProfilerSample]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.resources] = resources.jsValue() - object[Strings.frames] = frames.jsValue() - object[Strings.stacks] = stacks.jsValue() - object[Strings.samples] = samples.jsValue() + object[Strings.resources] = resources.jsValue + object[Strings.frames] = frames.jsValue + object[Strings.stacks] = stacks.jsValue + object[Strings.samples] = samples.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ProgressEvent.swift b/Sources/DOMKit/WebIDL/ProgressEvent.swift index 4b6c9834..2bc0d2a2 100644 --- a/Sources/DOMKit/WebIDL/ProgressEvent.swift +++ b/Sources/DOMKit/WebIDL/ProgressEvent.swift @@ -14,7 +14,7 @@ public class ProgressEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: ProgressEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ProgressEventInit.swift b/Sources/DOMKit/WebIDL/ProgressEventInit.swift index f1042f3b..cefb4961 100644 --- a/Sources/DOMKit/WebIDL/ProgressEventInit.swift +++ b/Sources/DOMKit/WebIDL/ProgressEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class ProgressEventInit: BridgedDictionary { public convenience init(lengthComputable: Bool, loaded: UInt64, total: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.lengthComputable] = lengthComputable.jsValue() - object[Strings.loaded] = loaded.jsValue() - object[Strings.total] = total.jsValue() + object[Strings.lengthComputable] = lengthComputable.jsValue + object[Strings.loaded] = loaded.jsValue + object[Strings.total] = total.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift index 99f36dc8..1be7f2e4 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEvent.swift @@ -13,7 +13,7 @@ public class PromiseRejectionEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: PromiseRejectionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift index 1cb30e9c..5ee0fc8d 100644 --- a/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift +++ b/Sources/DOMKit/WebIDL/PromiseRejectionEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PromiseRejectionEventInit: BridgedDictionary { public convenience init(promise: JSPromise, reason: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.promise] = promise.jsValue() - object[Strings.reason] = reason.jsValue() + object[Strings.promise] = promise.jsValue + object[Strings.reason] = reason.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PromptResponseObject.swift b/Sources/DOMKit/WebIDL/PromptResponseObject.swift index 3c7d6077..cd5bf515 100644 --- a/Sources/DOMKit/WebIDL/PromptResponseObject.swift +++ b/Sources/DOMKit/WebIDL/PromptResponseObject.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PromptResponseObject: BridgedDictionary { public convenience init(userChoice: AppBannerPromptOutcome) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.userChoice] = userChoice.jsValue() + object[Strings.userChoice] = userChoice.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PropertyDefinition.swift b/Sources/DOMKit/WebIDL/PropertyDefinition.swift index b99c0ca6..33d2381c 100644 --- a/Sources/DOMKit/WebIDL/PropertyDefinition.swift +++ b/Sources/DOMKit/WebIDL/PropertyDefinition.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class PropertyDefinition: BridgedDictionary { public convenience init(name: String, syntax: String, inherits: Bool, initialValue: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() - object[Strings.syntax] = syntax.jsValue() - object[Strings.inherits] = inherits.jsValue() - object[Strings.initialValue] = initialValue.jsValue() + object[Strings.name] = name.jsValue + object[Strings.syntax] = syntax.jsValue + object[Strings.inherits] = inherits.jsValue + object[Strings.initialValue] = initialValue.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ProximityReadingValues.swift b/Sources/DOMKit/WebIDL/ProximityReadingValues.swift index c6d02257..7ace10f0 100644 --- a/Sources/DOMKit/WebIDL/ProximityReadingValues.swift +++ b/Sources/DOMKit/WebIDL/ProximityReadingValues.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class ProximityReadingValues: BridgedDictionary { public convenience init(distance: Double?, max: Double?, near: Bool?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.distance] = distance.jsValue() - object[Strings.max] = max.jsValue() - object[Strings.near] = near.jsValue() + object[Strings.distance] = distance.jsValue + object[Strings.max] = max.jsValue + object[Strings.near] = near.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ProximitySensor.swift b/Sources/DOMKit/WebIDL/ProximitySensor.swift index 617d1085..596ab4ee 100644 --- a/Sources/DOMKit/WebIDL/ProximitySensor.swift +++ b/Sources/DOMKit/WebIDL/ProximitySensor.swift @@ -14,7 +14,7 @@ public class ProximitySensor: Sensor { } @inlinable public convenience init(sensorOptions: SensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredential.swift b/Sources/DOMKit/WebIDL/PublicKeyCredential.swift index e7caef2a..ef10d677 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredential.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredential.swift @@ -36,6 +36,6 @@ public class PublicKeyCredential: Credential { @inlinable public static func isUserVerifyingPlatformAuthenticatorAvailable() async throws -> Bool { let this = constructor let _promise: JSPromise = this[Strings.isUserVerifyingPlatformAuthenticatorAvailable].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift index 9e1ff1ca..21f152a8 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class PublicKeyCredentialCreationOptions: BridgedDictionary { public convenience init(rp: PublicKeyCredentialRpEntity, user: PublicKeyCredentialUserEntity, challenge: BufferSource, pubKeyCredParams: [PublicKeyCredentialParameters], timeout: UInt32, excludeCredentials: [PublicKeyCredentialDescriptor], authenticatorSelection: AuthenticatorSelectionCriteria, attestation: String, extensions: AuthenticationExtensionsClientInputs) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rp] = rp.jsValue() - object[Strings.user] = user.jsValue() - object[Strings.challenge] = challenge.jsValue() - object[Strings.pubKeyCredParams] = pubKeyCredParams.jsValue() - object[Strings.timeout] = timeout.jsValue() - object[Strings.excludeCredentials] = excludeCredentials.jsValue() - object[Strings.authenticatorSelection] = authenticatorSelection.jsValue() - object[Strings.attestation] = attestation.jsValue() - object[Strings.extensions] = extensions.jsValue() + object[Strings.rp] = rp.jsValue + object[Strings.user] = user.jsValue + object[Strings.challenge] = challenge.jsValue + object[Strings.pubKeyCredParams] = pubKeyCredParams.jsValue + object[Strings.timeout] = timeout.jsValue + object[Strings.excludeCredentials] = excludeCredentials.jsValue + object[Strings.authenticatorSelection] = authenticatorSelection.jsValue + object[Strings.attestation] = attestation.jsValue + object[Strings.extensions] = extensions.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift index 636654c5..d6422cd9 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class PublicKeyCredentialDescriptor: BridgedDictionary { public convenience init(type: String, id: BufferSource, transports: [String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.id] = id.jsValue() - object[Strings.transports] = transports.jsValue() + object[Strings.type] = type.jsValue + object[Strings.id] = id.jsValue + object[Strings.transports] = transports.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift index 11a09a3e..9f55a975 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PublicKeyCredentialEntity: BridgedDictionary { public convenience init(name: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue() + object[Strings.name] = name.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift index ccaf8b08..9cb6982b 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PublicKeyCredentialParameters: BridgedDictionary { public convenience init(type: String, alg: COSEAlgorithmIdentifier) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.alg] = alg.jsValue() + object[Strings.type] = type.jsValue + object[Strings.alg] = alg.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift index b31d9ee0..6725591f 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class PublicKeyCredentialRequestOptions: BridgedDictionary { public convenience init(challenge: BufferSource, timeout: UInt32, rpId: String, allowCredentials: [PublicKeyCredentialDescriptor], userVerification: String, extensions: AuthenticationExtensionsClientInputs) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.challenge] = challenge.jsValue() - object[Strings.timeout] = timeout.jsValue() - object[Strings.rpId] = rpId.jsValue() - object[Strings.allowCredentials] = allowCredentials.jsValue() - object[Strings.userVerification] = userVerification.jsValue() - object[Strings.extensions] = extensions.jsValue() + object[Strings.challenge] = challenge.jsValue + object[Strings.timeout] = timeout.jsValue + object[Strings.rpId] = rpId.jsValue + object[Strings.allowCredentials] = allowCredentials.jsValue + object[Strings.userVerification] = userVerification.jsValue + object[Strings.extensions] = extensions.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift index 3878d13d..692072af 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PublicKeyCredentialRpEntity: BridgedDictionary { public convenience init(id: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue() + object[Strings.id] = id.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift index 25c2cbdc..e7063638 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift @@ -17,5 +17,5 @@ public enum PublicKeyCredentialType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift index 75837e95..c6914abd 100644 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift +++ b/Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PublicKeyCredentialUserEntity: BridgedDictionary { public convenience init(id: BufferSource, displayName: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue() - object[Strings.displayName] = displayName.jsValue() + object[Strings.id] = id.jsValue + object[Strings.displayName] = displayName.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PurchaseDetails.swift b/Sources/DOMKit/WebIDL/PurchaseDetails.swift index 563db34e..c2663a90 100644 --- a/Sources/DOMKit/WebIDL/PurchaseDetails.swift +++ b/Sources/DOMKit/WebIDL/PurchaseDetails.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PurchaseDetails: BridgedDictionary { public convenience init(itemId: String, purchaseToken: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.itemId] = itemId.jsValue() - object[Strings.purchaseToken] = purchaseToken.jsValue() + object[Strings.itemId] = itemId.jsValue + object[Strings.purchaseToken] = purchaseToken.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift b/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift index 1815db61..11ef116c 100644 --- a/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift +++ b/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift @@ -18,5 +18,5 @@ public enum PushEncryptionKeyName: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/PushEventInit.swift b/Sources/DOMKit/WebIDL/PushEventInit.swift index e7c1f0ce..99e75582 100644 --- a/Sources/DOMKit/WebIDL/PushEventInit.swift +++ b/Sources/DOMKit/WebIDL/PushEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PushEventInit: BridgedDictionary { public convenience init(data: PushMessageDataInit) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.data] = data.jsValue() + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PushManager.swift b/Sources/DOMKit/WebIDL/PushManager.swift index 981c6df9..3a38b84c 100644 --- a/Sources/DOMKit/WebIDL/PushManager.swift +++ b/Sources/DOMKit/WebIDL/PushManager.swift @@ -18,14 +18,14 @@ public class PushManager: JSBridgedClass { @inlinable public func subscribe(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { let this = jsObject - return this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func subscribe(options: PushSubscriptionOptionsInit? = nil) async throws -> PushSubscription { let this = jsObject - let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getSubscription() -> JSPromise { @@ -37,18 +37,18 @@ public class PushManager: JSBridgedClass { @inlinable public func getSubscription() async throws -> PushSubscription? { let this = jsObject let _promise: JSPromise = this[Strings.getSubscription].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func permissionState(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { let this = jsObject - return this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func permissionState(options: PushSubscriptionOptionsInit? = nil) async throws -> PermissionState { let this = jsObject - let _promise: JSPromise = this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/PushMessageDataInit.swift b/Sources/DOMKit/WebIDL/PushMessageDataInit.swift index a5a09abc..5a08364b 100644 --- a/Sources/DOMKit/WebIDL/PushMessageDataInit.swift +++ b/Sources/DOMKit/WebIDL/PushMessageDataInit.swift @@ -21,12 +21,12 @@ public enum PushMessageDataInit: JSValueCompatible, Any_PushMessageDataInit { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .bufferSource(bufferSource): - return bufferSource.jsValue() + return bufferSource.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift index f288c5eb..89b0bf7c 100644 --- a/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class PushPermissionDescriptor: BridgedDictionary { public convenience init(userVisibleOnly: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.userVisibleOnly] = userVisibleOnly.jsValue() + object[Strings.userVisibleOnly] = userVisibleOnly.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PushSubscription.swift b/Sources/DOMKit/WebIDL/PushSubscription.swift index e53339d4..27a5458f 100644 --- a/Sources/DOMKit/WebIDL/PushSubscription.swift +++ b/Sources/DOMKit/WebIDL/PushSubscription.swift @@ -26,7 +26,7 @@ public class PushSubscription: JSBridgedClass { @inlinable public func getKey(name: PushEncryptionKeyName) -> ArrayBuffer? { let this = jsObject - return this[Strings.getKey].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.getKey].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func unsubscribe() -> JSPromise { @@ -38,7 +38,7 @@ public class PushSubscription: JSBridgedClass { @inlinable public func unsubscribe() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.unsubscribe].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func toJSON() -> PushSubscriptionJSON { diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift index 42497552..7f0b0418 100644 --- a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PushSubscriptionChangeEventInit: BridgedDictionary { public convenience init(newSubscription: PushSubscription, oldSubscription: PushSubscription) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.newSubscription] = newSubscription.jsValue() - object[Strings.oldSubscription] = oldSubscription.jsValue() + object[Strings.newSubscription] = newSubscription.jsValue + object[Strings.oldSubscription] = oldSubscription.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift b/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift index e6c0196c..45d9f09d 100644 --- a/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift +++ b/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class PushSubscriptionJSON: BridgedDictionary { public convenience init(endpoint: String, expirationTime: EpochTimeStamp?, keys: [String: String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.endpoint] = endpoint.jsValue() - object[Strings.expirationTime] = expirationTime.jsValue() - object[Strings.keys] = keys.jsValue() + object[Strings.endpoint] = endpoint.jsValue + object[Strings.expirationTime] = expirationTime.jsValue + object[Strings.keys] = keys.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift b/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift index d11208b0..358d6a94 100644 --- a/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift +++ b/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class PushSubscriptionOptionsInit: BridgedDictionary { public convenience init(userVisibleOnly: Bool, applicationServerKey: BufferSource_or_String?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.userVisibleOnly] = userVisibleOnly.jsValue() - object[Strings.applicationServerKey] = applicationServerKey.jsValue() + object[Strings.userVisibleOnly] = userVisibleOnly.jsValue + object[Strings.applicationServerKey] = applicationServerKey.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/QueryOptions.swift b/Sources/DOMKit/WebIDL/QueryOptions.swift index 4bd24aea..45dec868 100644 --- a/Sources/DOMKit/WebIDL/QueryOptions.swift +++ b/Sources/DOMKit/WebIDL/QueryOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class QueryOptions: BridgedDictionary { public convenience init(select: [String]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.select] = select.jsValue() + object[Strings.select] = select.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/QueuingStrategy.swift b/Sources/DOMKit/WebIDL/QueuingStrategy.swift index e4ed122d..03b8b2e9 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategy.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategy.swift @@ -6,7 +6,7 @@ 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() + object[Strings.highWaterMark] = highWaterMark.jsValue ClosureAttribute1[Strings.size, in: object] = size self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift index feba7921..2a51a702 100644 --- a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift +++ b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class QueuingStrategyInit: BridgedDictionary { public convenience init(highWaterMark: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.highWaterMark] = highWaterMark.jsValue() + object[Strings.highWaterMark] = highWaterMark.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift b/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift index ae64158e..3681e2e0 100644 --- a/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift +++ b/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RTCAudioSenderStats: BridgedDictionary { public convenience init(mediaSourceId: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaSourceId] = mediaSourceId.jsValue() + object[Strings.mediaSourceId] = mediaSourceId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift b/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift index 57f70e0f..fd948b2c 100644 --- a/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift +++ b/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class RTCAudioSourceStats: BridgedDictionary { public convenience init(audioLevel: Double, totalAudioEnergy: Double, totalSamplesDuration: Double, echoReturnLoss: Double, echoReturnLossEnhancement: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.audioLevel] = audioLevel.jsValue() - object[Strings.totalAudioEnergy] = totalAudioEnergy.jsValue() - object[Strings.totalSamplesDuration] = totalSamplesDuration.jsValue() - object[Strings.echoReturnLoss] = echoReturnLoss.jsValue() - object[Strings.echoReturnLossEnhancement] = echoReturnLossEnhancement.jsValue() + object[Strings.audioLevel] = audioLevel.jsValue + object[Strings.totalAudioEnergy] = totalAudioEnergy.jsValue + object[Strings.totalSamplesDuration] = totalSamplesDuration.jsValue + object[Strings.echoReturnLoss] = echoReturnLoss.jsValue + object[Strings.echoReturnLossEnhancement] = echoReturnLossEnhancement.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift b/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift index e8a29c0d..fd97fbe0 100644 --- a/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift +++ b/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift @@ -19,5 +19,5 @@ public enum RTCBundlePolicy: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift b/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift index 8635062c..01d1297a 100644 --- a/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift +++ b/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RTCCertificateExpiration: BridgedDictionary { public convenience init(expires: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.expires] = expires.jsValue() + object[Strings.expires] = expires.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCCertificateStats.swift b/Sources/DOMKit/WebIDL/RTCCertificateStats.swift index 64c5cc16..4b57c8f4 100644 --- a/Sources/DOMKit/WebIDL/RTCCertificateStats.swift +++ b/Sources/DOMKit/WebIDL/RTCCertificateStats.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RTCCertificateStats: BridgedDictionary { public convenience init(fingerprint: String, fingerprintAlgorithm: String, base64Certificate: String, issuerCertificateId: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fingerprint] = fingerprint.jsValue() - object[Strings.fingerprintAlgorithm] = fingerprintAlgorithm.jsValue() - object[Strings.base64Certificate] = base64Certificate.jsValue() - object[Strings.issuerCertificateId] = issuerCertificateId.jsValue() + object[Strings.fingerprint] = fingerprint.jsValue + object[Strings.fingerprintAlgorithm] = fingerprintAlgorithm.jsValue + object[Strings.base64Certificate] = base64Certificate.jsValue + object[Strings.issuerCertificateId] = issuerCertificateId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCCodecStats.swift b/Sources/DOMKit/WebIDL/RTCCodecStats.swift index 23ee29f4..cbe86159 100644 --- a/Sources/DOMKit/WebIDL/RTCCodecStats.swift +++ b/Sources/DOMKit/WebIDL/RTCCodecStats.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class RTCCodecStats: BridgedDictionary { public convenience init(payloadType: UInt32, codecType: RTCCodecType, transportId: String, mimeType: String, clockRate: UInt32, channels: UInt32, sdpFmtpLine: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.payloadType] = payloadType.jsValue() - object[Strings.codecType] = codecType.jsValue() - object[Strings.transportId] = transportId.jsValue() - object[Strings.mimeType] = mimeType.jsValue() - object[Strings.clockRate] = clockRate.jsValue() - object[Strings.channels] = channels.jsValue() - object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue() + object[Strings.payloadType] = payloadType.jsValue + object[Strings.codecType] = codecType.jsValue + object[Strings.transportId] = transportId.jsValue + object[Strings.mimeType] = mimeType.jsValue + object[Strings.clockRate] = clockRate.jsValue + object[Strings.channels] = channels.jsValue + object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCCodecType.swift b/Sources/DOMKit/WebIDL/RTCCodecType.swift index 2edea590..e52297b6 100644 --- a/Sources/DOMKit/WebIDL/RTCCodecType.swift +++ b/Sources/DOMKit/WebIDL/RTCCodecType.swift @@ -18,5 +18,5 @@ public enum RTCCodecType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCConfiguration.swift b/Sources/DOMKit/WebIDL/RTCConfiguration.swift index 1408aa47..79a12988 100644 --- a/Sources/DOMKit/WebIDL/RTCConfiguration.swift +++ b/Sources/DOMKit/WebIDL/RTCConfiguration.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class RTCConfiguration: BridgedDictionary { public convenience init(peerIdentity: String, iceServers: [RTCIceServer], iceTransportPolicy: RTCIceTransportPolicy, bundlePolicy: RTCBundlePolicy, rtcpMuxPolicy: RTCRtcpMuxPolicy, certificates: [RTCCertificate], iceCandidatePoolSize: UInt8) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.peerIdentity] = peerIdentity.jsValue() - object[Strings.iceServers] = iceServers.jsValue() - object[Strings.iceTransportPolicy] = iceTransportPolicy.jsValue() - object[Strings.bundlePolicy] = bundlePolicy.jsValue() - object[Strings.rtcpMuxPolicy] = rtcpMuxPolicy.jsValue() - object[Strings.certificates] = certificates.jsValue() - object[Strings.iceCandidatePoolSize] = iceCandidatePoolSize.jsValue() + object[Strings.peerIdentity] = peerIdentity.jsValue + object[Strings.iceServers] = iceServers.jsValue + object[Strings.iceTransportPolicy] = iceTransportPolicy.jsValue + object[Strings.bundlePolicy] = bundlePolicy.jsValue + object[Strings.rtcpMuxPolicy] = rtcpMuxPolicy.jsValue + object[Strings.certificates] = certificates.jsValue + object[Strings.iceCandidatePoolSize] = iceCandidatePoolSize.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift index 33913253..6dbd6428 100644 --- a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift +++ b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift @@ -15,7 +15,7 @@ public class RTCDTMFSender: EventTarget { @inlinable public func insertDTMF(tones: String, duration: UInt32? = nil, interToneGap: UInt32? = nil) { let this = jsObject - _ = this[Strings.insertDTMF].function!(this: this, arguments: [tones.jsValue(), duration?.jsValue() ?? .undefined, interToneGap?.jsValue() ?? .undefined]) + _ = this[Strings.insertDTMF].function!(this: this, arguments: [tones.jsValue, duration?.jsValue ?? .undefined, interToneGap?.jsValue ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift index f0a1fedd..2ff58382 100644 --- a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift @@ -12,7 +12,7 @@ public class RTCDTMFToneChangeEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: RTCDTMFToneChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift index b4683f79..4fdb5de5 100644 --- a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RTCDTMFToneChangeEventInit: BridgedDictionary { public convenience init(tone: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.tone] = tone.jsValue() + object[Strings.tone] = tone.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannel.swift b/Sources/DOMKit/WebIDL/RTCDataChannel.swift index 6ead5a92..708c259c 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannel.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannel.swift @@ -89,21 +89,21 @@ public class RTCDataChannel: EventTarget { @inlinable public func send(data: String) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) } @inlinable public func send(data: Blob) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) } @inlinable public func send(data: ArrayBuffer) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) } @inlinable public func send(data: ArrayBufferView) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift b/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift index f0143459..e85da360 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift @@ -12,7 +12,7 @@ public class RTCDataChannelEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: RTCDataChannelEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift b/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift index 46b9d10c..6e7dc3a5 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RTCDataChannelEventInit: BridgedDictionary { public convenience init(channel: RTCDataChannel) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.channel] = channel.jsValue() + object[Strings.channel] = channel.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift b/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift index d360c854..1f7ab939 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class RTCDataChannelInit: BridgedDictionary { public convenience init(priority: RTCPriorityType, ordered: Bool, maxPacketLifeTime: UInt16, maxRetransmits: UInt16, protocol: String, negotiated: Bool, id: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.priority] = priority.jsValue() - object[Strings.ordered] = ordered.jsValue() - object[Strings.maxPacketLifeTime] = maxPacketLifeTime.jsValue() - object[Strings.maxRetransmits] = maxRetransmits.jsValue() - object[Strings.protocol] = `protocol`.jsValue() - object[Strings.negotiated] = negotiated.jsValue() - object[Strings.id] = id.jsValue() + object[Strings.priority] = priority.jsValue + object[Strings.ordered] = ordered.jsValue + object[Strings.maxPacketLifeTime] = maxPacketLifeTime.jsValue + object[Strings.maxRetransmits] = maxRetransmits.jsValue + object[Strings.protocol] = `protocol`.jsValue + object[Strings.negotiated] = negotiated.jsValue + object[Strings.id] = id.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelState.swift b/Sources/DOMKit/WebIDL/RTCDataChannelState.swift index 4d7e2f0e..5c66aa2e 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannelState.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannelState.swift @@ -20,5 +20,5 @@ public enum RTCDataChannelState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelStats.swift b/Sources/DOMKit/WebIDL/RTCDataChannelStats.swift index 213c24b9..5af2c5a6 100644 --- a/Sources/DOMKit/WebIDL/RTCDataChannelStats.swift +++ b/Sources/DOMKit/WebIDL/RTCDataChannelStats.swift @@ -6,14 +6,14 @@ import JavaScriptKit public class RTCDataChannelStats: BridgedDictionary { public convenience init(label: String, protocol: String, dataChannelIdentifier: UInt16, state: RTCDataChannelState, messagesSent: UInt32, bytesSent: UInt64, messagesReceived: UInt32, bytesReceived: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue() - object[Strings.protocol] = `protocol`.jsValue() - object[Strings.dataChannelIdentifier] = dataChannelIdentifier.jsValue() - object[Strings.state] = state.jsValue() - object[Strings.messagesSent] = messagesSent.jsValue() - object[Strings.bytesSent] = bytesSent.jsValue() - object[Strings.messagesReceived] = messagesReceived.jsValue() - object[Strings.bytesReceived] = bytesReceived.jsValue() + object[Strings.label] = label.jsValue + object[Strings.protocol] = `protocol`.jsValue + object[Strings.dataChannelIdentifier] = dataChannelIdentifier.jsValue + object[Strings.state] = state.jsValue + object[Strings.messagesSent] = messagesSent.jsValue + object[Strings.bytesSent] = bytesSent.jsValue + object[Strings.messagesReceived] = messagesReceived.jsValue + object[Strings.bytesReceived] = bytesReceived.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift b/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift index 63519424..3228a2e4 100644 --- a/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift +++ b/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift @@ -19,5 +19,5 @@ public enum RTCDegradationPreference: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift b/Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift index 3c2f2afa..a8f016e2 100644 --- a/Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift +++ b/Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCDtlsFingerprint: BridgedDictionary { public convenience init(algorithm: String, value: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.algorithm] = algorithm.jsValue() - object[Strings.value] = value.jsValue() + object[Strings.algorithm] = algorithm.jsValue + object[Strings.value] = value.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift b/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift index d847d4f9..351d27e6 100644 --- a/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift +++ b/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift @@ -21,5 +21,5 @@ public enum RTCDtlsTransportState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift index 6fc10043..1dba1b1a 100644 --- a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift +++ b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCEncodedAudioFrameMetadata: BridgedDictionary { public convenience init(synchronizationSource: Int32, payloadType: UInt8, contributingSources: [Int32]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.synchronizationSource] = synchronizationSource.jsValue() - object[Strings.payloadType] = payloadType.jsValue() - object[Strings.contributingSources] = contributingSources.jsValue() + object[Strings.synchronizationSource] = synchronizationSource.jsValue + object[Strings.payloadType] = payloadType.jsValue + object[Strings.contributingSources] = contributingSources.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift index 279747a1..f0c24115 100644 --- a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift +++ b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class RTCEncodedVideoFrameMetadata: BridgedDictionary { public convenience init(frameId: Int64, dependencies: [Int64], width: UInt16, height: UInt16, spatialIndex: Int32, temporalIndex: Int32, synchronizationSource: Int32, payloadType: UInt8, contributingSources: [Int32]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.frameId] = frameId.jsValue() - object[Strings.dependencies] = dependencies.jsValue() - object[Strings.width] = width.jsValue() - object[Strings.height] = height.jsValue() - object[Strings.spatialIndex] = spatialIndex.jsValue() - object[Strings.temporalIndex] = temporalIndex.jsValue() - object[Strings.synchronizationSource] = synchronizationSource.jsValue() - object[Strings.payloadType] = payloadType.jsValue() - object[Strings.contributingSources] = contributingSources.jsValue() + object[Strings.frameId] = frameId.jsValue + object[Strings.dependencies] = dependencies.jsValue + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.spatialIndex] = spatialIndex.jsValue + object[Strings.temporalIndex] = temporalIndex.jsValue + object[Strings.synchronizationSource] = synchronizationSource.jsValue + object[Strings.payloadType] = payloadType.jsValue + object[Strings.contributingSources] = contributingSources.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift index ada428ab..a7f8ef74 100644 --- a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift +++ b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift @@ -19,5 +19,5 @@ public enum RTCEncodedVideoFrameType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCError.swift b/Sources/DOMKit/WebIDL/RTCError.swift index 7399daba..00883cae 100644 --- a/Sources/DOMKit/WebIDL/RTCError.swift +++ b/Sources/DOMKit/WebIDL/RTCError.swift @@ -20,7 +20,7 @@ public class RTCError: DOMException { public var httpRequestStatusCode: Int32? @inlinable public convenience init(init: RTCErrorInit, message: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue(), message?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue, message?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift b/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift index cf32e04f..6c667702 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift @@ -23,5 +23,5 @@ public enum RTCErrorDetailType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift b/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift index 918eebea..da8b75ed 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift @@ -24,5 +24,5 @@ public enum RTCErrorDetailTypeIdp: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCErrorEvent.swift index 3fa3d4e2..05af3107 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorEvent.swift @@ -12,7 +12,7 @@ public class RTCErrorEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: RTCErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift b/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift index ef778cbf..2c27f4f5 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RTCErrorEventInit: BridgedDictionary { public convenience init(error: RTCError) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue() + object[Strings.error] = error.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCErrorInit.swift b/Sources/DOMKit/WebIDL/RTCErrorInit.swift index f2808b80..bce91b69 100644 --- a/Sources/DOMKit/WebIDL/RTCErrorInit.swift +++ b/Sources/DOMKit/WebIDL/RTCErrorInit.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class RTCErrorInit: BridgedDictionary { public convenience init(httpRequestStatusCode: Int32, errorDetail: RTCErrorDetailType, sdpLineNumber: Int32, sctpCauseCode: Int32, receivedAlert: UInt32, sentAlert: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.httpRequestStatusCode] = httpRequestStatusCode.jsValue() - object[Strings.errorDetail] = errorDetail.jsValue() - object[Strings.sdpLineNumber] = sdpLineNumber.jsValue() - object[Strings.sctpCauseCode] = sctpCauseCode.jsValue() - object[Strings.receivedAlert] = receivedAlert.jsValue() - object[Strings.sentAlert] = sentAlert.jsValue() + object[Strings.httpRequestStatusCode] = httpRequestStatusCode.jsValue + object[Strings.errorDetail] = errorDetail.jsValue + object[Strings.sdpLineNumber] = sdpLineNumber.jsValue + object[Strings.sctpCauseCode] = sctpCauseCode.jsValue + object[Strings.receivedAlert] = receivedAlert.jsValue + object[Strings.sentAlert] = sentAlert.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift index dc1b1fec..f1a36c08 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift @@ -27,7 +27,7 @@ public class RTCIceCandidate: JSBridgedClass { } @inlinable public convenience init(candidateInitDict: RTCIceCandidateInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [candidateInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [candidateInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift index 2c96981c..328a2761 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RTCIceCandidateInit: BridgedDictionary { public convenience init(candidate: String, sdpMid: String?, sdpMLineIndex: UInt16?, usernameFragment: String?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.candidate] = candidate.jsValue() - object[Strings.sdpMid] = sdpMid.jsValue() - object[Strings.sdpMLineIndex] = sdpMLineIndex.jsValue() - object[Strings.usernameFragment] = usernameFragment.jsValue() + object[Strings.candidate] = candidate.jsValue + object[Strings.sdpMid] = sdpMid.jsValue + object[Strings.sdpMLineIndex] = sdpMLineIndex.jsValue + object[Strings.usernameFragment] = usernameFragment.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift b/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift index 01f3891e..8db6a4b4 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCIceCandidatePair: BridgedDictionary { public convenience init(local: RTCIceCandidate, remote: RTCIceCandidate) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.local] = local.jsValue() - object[Strings.remote] = remote.jsValue() + object[Strings.local] = local.jsValue + object[Strings.remote] = remote.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift b/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift index 36c8562c..45cbd848 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift @@ -6,38 +6,38 @@ import JavaScriptKit public class RTCIceCandidatePairStats: BridgedDictionary { public convenience init(transportId: String, localCandidateId: String, remoteCandidateId: String, state: RTCStatsIceCandidatePairState, nominated: Bool, packetsSent: UInt64, packetsReceived: UInt64, bytesSent: UInt64, bytesReceived: UInt64, lastPacketSentTimestamp: DOMHighResTimeStamp, lastPacketReceivedTimestamp: DOMHighResTimeStamp, firstRequestTimestamp: DOMHighResTimeStamp, lastRequestTimestamp: DOMHighResTimeStamp, lastResponseTimestamp: DOMHighResTimeStamp, totalRoundTripTime: Double, currentRoundTripTime: Double, availableOutgoingBitrate: Double, availableIncomingBitrate: Double, circuitBreakerTriggerCount: UInt32, requestsReceived: UInt64, requestsSent: UInt64, responsesReceived: UInt64, responsesSent: UInt64, retransmissionsReceived: UInt64, retransmissionsSent: UInt64, consentRequestsSent: UInt64, consentExpiredTimestamp: DOMHighResTimeStamp, packetsDiscardedOnSend: UInt32, bytesDiscardedOnSend: UInt64, requestBytesSent: UInt64, consentRequestBytesSent: UInt64, responseBytesSent: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transportId] = transportId.jsValue() - object[Strings.localCandidateId] = localCandidateId.jsValue() - object[Strings.remoteCandidateId] = remoteCandidateId.jsValue() - object[Strings.state] = state.jsValue() - object[Strings.nominated] = nominated.jsValue() - object[Strings.packetsSent] = packetsSent.jsValue() - object[Strings.packetsReceived] = packetsReceived.jsValue() - object[Strings.bytesSent] = bytesSent.jsValue() - object[Strings.bytesReceived] = bytesReceived.jsValue() - object[Strings.lastPacketSentTimestamp] = lastPacketSentTimestamp.jsValue() - object[Strings.lastPacketReceivedTimestamp] = lastPacketReceivedTimestamp.jsValue() - object[Strings.firstRequestTimestamp] = firstRequestTimestamp.jsValue() - object[Strings.lastRequestTimestamp] = lastRequestTimestamp.jsValue() - object[Strings.lastResponseTimestamp] = lastResponseTimestamp.jsValue() - object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue() - object[Strings.currentRoundTripTime] = currentRoundTripTime.jsValue() - object[Strings.availableOutgoingBitrate] = availableOutgoingBitrate.jsValue() - object[Strings.availableIncomingBitrate] = availableIncomingBitrate.jsValue() - object[Strings.circuitBreakerTriggerCount] = circuitBreakerTriggerCount.jsValue() - object[Strings.requestsReceived] = requestsReceived.jsValue() - object[Strings.requestsSent] = requestsSent.jsValue() - object[Strings.responsesReceived] = responsesReceived.jsValue() - object[Strings.responsesSent] = responsesSent.jsValue() - object[Strings.retransmissionsReceived] = retransmissionsReceived.jsValue() - object[Strings.retransmissionsSent] = retransmissionsSent.jsValue() - object[Strings.consentRequestsSent] = consentRequestsSent.jsValue() - object[Strings.consentExpiredTimestamp] = consentExpiredTimestamp.jsValue() - object[Strings.packetsDiscardedOnSend] = packetsDiscardedOnSend.jsValue() - object[Strings.bytesDiscardedOnSend] = bytesDiscardedOnSend.jsValue() - object[Strings.requestBytesSent] = requestBytesSent.jsValue() - object[Strings.consentRequestBytesSent] = consentRequestBytesSent.jsValue() - object[Strings.responseBytesSent] = responseBytesSent.jsValue() + object[Strings.transportId] = transportId.jsValue + object[Strings.localCandidateId] = localCandidateId.jsValue + object[Strings.remoteCandidateId] = remoteCandidateId.jsValue + object[Strings.state] = state.jsValue + object[Strings.nominated] = nominated.jsValue + object[Strings.packetsSent] = packetsSent.jsValue + object[Strings.packetsReceived] = packetsReceived.jsValue + object[Strings.bytesSent] = bytesSent.jsValue + object[Strings.bytesReceived] = bytesReceived.jsValue + object[Strings.lastPacketSentTimestamp] = lastPacketSentTimestamp.jsValue + object[Strings.lastPacketReceivedTimestamp] = lastPacketReceivedTimestamp.jsValue + object[Strings.firstRequestTimestamp] = firstRequestTimestamp.jsValue + object[Strings.lastRequestTimestamp] = lastRequestTimestamp.jsValue + object[Strings.lastResponseTimestamp] = lastResponseTimestamp.jsValue + object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue + object[Strings.currentRoundTripTime] = currentRoundTripTime.jsValue + object[Strings.availableOutgoingBitrate] = availableOutgoingBitrate.jsValue + object[Strings.availableIncomingBitrate] = availableIncomingBitrate.jsValue + object[Strings.circuitBreakerTriggerCount] = circuitBreakerTriggerCount.jsValue + object[Strings.requestsReceived] = requestsReceived.jsValue + object[Strings.requestsSent] = requestsSent.jsValue + object[Strings.responsesReceived] = responsesReceived.jsValue + object[Strings.responsesSent] = responsesSent.jsValue + object[Strings.retransmissionsReceived] = retransmissionsReceived.jsValue + object[Strings.retransmissionsSent] = retransmissionsSent.jsValue + object[Strings.consentRequestsSent] = consentRequestsSent.jsValue + object[Strings.consentExpiredTimestamp] = consentExpiredTimestamp.jsValue + object[Strings.packetsDiscardedOnSend] = packetsDiscardedOnSend.jsValue + object[Strings.bytesDiscardedOnSend] = bytesDiscardedOnSend.jsValue + object[Strings.requestBytesSent] = requestBytesSent.jsValue + object[Strings.consentRequestBytesSent] = consentRequestBytesSent.jsValue + object[Strings.responseBytesSent] = responseBytesSent.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift index 0486e846..fd845fe8 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift @@ -6,14 +6,14 @@ import JavaScriptKit public class RTCIceCandidateStats: BridgedDictionary { public convenience init(transportId: String, address: String?, port: Int32, protocol: String, candidateType: RTCIceCandidateType, priority: Int32, url: String, relayProtocol: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transportId] = transportId.jsValue() - object[Strings.address] = address.jsValue() - object[Strings.port] = port.jsValue() - object[Strings.protocol] = `protocol`.jsValue() - object[Strings.candidateType] = candidateType.jsValue() - object[Strings.priority] = priority.jsValue() - object[Strings.url] = url.jsValue() - object[Strings.relayProtocol] = relayProtocol.jsValue() + object[Strings.transportId] = transportId.jsValue + object[Strings.address] = address.jsValue + object[Strings.port] = port.jsValue + object[Strings.protocol] = `protocol`.jsValue + object[Strings.candidateType] = candidateType.jsValue + object[Strings.priority] = priority.jsValue + object[Strings.url] = url.jsValue + object[Strings.relayProtocol] = relayProtocol.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift index 486f874b..86c123a3 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift @@ -20,5 +20,5 @@ public enum RTCIceCandidateType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceComponent.swift b/Sources/DOMKit/WebIDL/RTCIceComponent.swift index 53e5c14d..789bcfca 100644 --- a/Sources/DOMKit/WebIDL/RTCIceComponent.swift +++ b/Sources/DOMKit/WebIDL/RTCIceComponent.swift @@ -18,5 +18,5 @@ public enum RTCIceComponent: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift b/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift index dfcf61e7..a9b37c33 100644 --- a/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift +++ b/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift @@ -23,5 +23,5 @@ public enum RTCIceConnectionState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift b/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift index f1583e38..0c5d9e57 100644 --- a/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift +++ b/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift @@ -17,5 +17,5 @@ public enum RTCIceCredentialType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift b/Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift index 6bd0dd03..7e6d236a 100644 --- a/Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift +++ b/Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCIceGatherOptions: BridgedDictionary { public convenience init(gatherPolicy: RTCIceTransportPolicy, iceServers: [RTCIceServer]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.gatherPolicy] = gatherPolicy.jsValue() - object[Strings.iceServers] = iceServers.jsValue() + object[Strings.gatherPolicy] = gatherPolicy.jsValue + object[Strings.iceServers] = iceServers.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIceGathererState.swift b/Sources/DOMKit/WebIDL/RTCIceGathererState.swift index 970e986d..3b79f2c8 100644 --- a/Sources/DOMKit/WebIDL/RTCIceGathererState.swift +++ b/Sources/DOMKit/WebIDL/RTCIceGathererState.swift @@ -19,5 +19,5 @@ public enum RTCIceGathererState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift b/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift index 6ae7eb5c..47c8c1ce 100644 --- a/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift +++ b/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift @@ -19,5 +19,5 @@ public enum RTCIceGatheringState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceParameters.swift b/Sources/DOMKit/WebIDL/RTCIceParameters.swift index e382c98c..fb75b397 100644 --- a/Sources/DOMKit/WebIDL/RTCIceParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCIceParameters.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCIceParameters: BridgedDictionary { public convenience init(iceLite: Bool, usernameFragment: String, password: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iceLite] = iceLite.jsValue() - object[Strings.usernameFragment] = usernameFragment.jsValue() - object[Strings.password] = password.jsValue() + object[Strings.iceLite] = iceLite.jsValue + object[Strings.usernameFragment] = usernameFragment.jsValue + object[Strings.password] = password.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIceProtocol.swift b/Sources/DOMKit/WebIDL/RTCIceProtocol.swift index bd91c90a..fd7d318d 100644 --- a/Sources/DOMKit/WebIDL/RTCIceProtocol.swift +++ b/Sources/DOMKit/WebIDL/RTCIceProtocol.swift @@ -18,5 +18,5 @@ public enum RTCIceProtocol: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceRole.swift b/Sources/DOMKit/WebIDL/RTCIceRole.swift index 49d11ae1..0855941d 100644 --- a/Sources/DOMKit/WebIDL/RTCIceRole.swift +++ b/Sources/DOMKit/WebIDL/RTCIceRole.swift @@ -19,5 +19,5 @@ public enum RTCIceRole: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceServer.swift b/Sources/DOMKit/WebIDL/RTCIceServer.swift index 06a6b923..3ef87fb1 100644 --- a/Sources/DOMKit/WebIDL/RTCIceServer.swift +++ b/Sources/DOMKit/WebIDL/RTCIceServer.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RTCIceServer: BridgedDictionary { public convenience init(urls: String_or_seq_of_String, username: String, credential: String, credentialType: RTCIceCredentialType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.urls] = urls.jsValue() - object[Strings.username] = username.jsValue() - object[Strings.credential] = credential.jsValue() - object[Strings.credentialType] = credentialType.jsValue() + object[Strings.urls] = urls.jsValue + object[Strings.username] = username.jsValue + object[Strings.credential] = credential.jsValue + object[Strings.credentialType] = credentialType.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIceServerStats.swift b/Sources/DOMKit/WebIDL/RTCIceServerStats.swift index 6d743123..bbd53dfe 100644 --- a/Sources/DOMKit/WebIDL/RTCIceServerStats.swift +++ b/Sources/DOMKit/WebIDL/RTCIceServerStats.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class RTCIceServerStats: BridgedDictionary { public convenience init(url: String, port: Int32, relayProtocol: String, totalRequestsSent: UInt32, totalResponsesReceived: UInt32, totalRoundTripTime: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.url] = url.jsValue() - object[Strings.port] = port.jsValue() - object[Strings.relayProtocol] = relayProtocol.jsValue() - object[Strings.totalRequestsSent] = totalRequestsSent.jsValue() - object[Strings.totalResponsesReceived] = totalResponsesReceived.jsValue() - object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue() + object[Strings.url] = url.jsValue + object[Strings.port] = port.jsValue + object[Strings.relayProtocol] = relayProtocol.jsValue + object[Strings.totalRequestsSent] = totalRequestsSent.jsValue + object[Strings.totalResponsesReceived] = totalResponsesReceived.jsValue + object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift b/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift index 4df144f2..6d2fb1f5 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift @@ -19,5 +19,5 @@ public enum RTCIceTcpCandidateType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceTransport.swift b/Sources/DOMKit/WebIDL/RTCIceTransport.swift index 72922dcd..0509d527 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransport.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransport.swift @@ -25,12 +25,12 @@ public class RTCIceTransport: EventTarget { @inlinable public func gather(options: RTCIceGatherOptions? = nil) { let this = jsObject - _ = this[Strings.gather].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) + _ = this[Strings.gather].function!(this: this, arguments: [options?.jsValue ?? .undefined]) } @inlinable public func start(remoteParameters: RTCIceParameters? = nil, role: RTCIceRole? = nil) { let this = jsObject - _ = this[Strings.start].function!(this: this, arguments: [remoteParameters?.jsValue() ?? .undefined, role?.jsValue() ?? .undefined]) + _ = this[Strings.start].function!(this: this, arguments: [remoteParameters?.jsValue ?? .undefined, role?.jsValue ?? .undefined]) } @inlinable public func stop() { @@ -40,7 +40,7 @@ public class RTCIceTransport: EventTarget { @inlinable public func addRemoteCandidate(remoteCandidate: RTCIceCandidateInit? = nil) { let this = jsObject - _ = this[Strings.addRemoteCandidate].function!(this: this, arguments: [remoteCandidate?.jsValue() ?? .undefined]) + _ = this[Strings.addRemoteCandidate].function!(this: this, arguments: [remoteCandidate?.jsValue ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift b/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift index 00faedc5..1fc6a85e 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift @@ -18,5 +18,5 @@ public enum RTCIceTransportPolicy: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIceTransportState.swift b/Sources/DOMKit/WebIDL/RTCIceTransportState.swift index 54d51c30..06a5c999 100644 --- a/Sources/DOMKit/WebIDL/RTCIceTransportState.swift +++ b/Sources/DOMKit/WebIDL/RTCIceTransportState.swift @@ -23,5 +23,5 @@ public enum RTCIceTransportState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift b/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift index 1e0589b3..f6ce08fd 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift @@ -15,7 +15,7 @@ public class RTCIdentityAssertion: JSBridgedClass { } @inlinable public convenience init(idp: String, name: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [idp.jsValue(), name.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [idp.jsValue, name.jsValue])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift b/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift index 535a9923..ffa3d2a3 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCIdentityAssertionResult: BridgedDictionary { public convenience init(idp: RTCIdentityProviderDetails, assertion: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.idp] = idp.jsValue() - object[Strings.assertion] = assertion.jsValue() + object[Strings.idp] = idp.jsValue + object[Strings.assertion] = assertion.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift index b5d743c4..b904f5e5 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCIdentityProviderDetails: BridgedDictionary { public convenience init(domain: String, protocol: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.domain] = domain.jsValue() - object[Strings.protocol] = `protocol`.jsValue() + object[Strings.domain] = domain.jsValue + object[Strings.protocol] = `protocol`.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift index f93633aa..af0c909d 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCIdentityProviderOptions: BridgedDictionary { public convenience init(protocol: String, usernameHint: String, peerIdentity: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.protocol] = `protocol`.jsValue() - object[Strings.usernameHint] = usernameHint.jsValue() - object[Strings.peerIdentity] = peerIdentity.jsValue() + object[Strings.protocol] = `protocol`.jsValue + object[Strings.usernameHint] = usernameHint.jsValue + object[Strings.peerIdentity] = peerIdentity.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift b/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift index aec714d4..349716c0 100644 --- a/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift +++ b/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCIdentityValidationResult: BridgedDictionary { public convenience init(identity: String, contents: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.identity] = identity.jsValue() - object[Strings.contents] = contents.jsValue() + object[Strings.identity] = identity.jsValue + object[Strings.contents] = contents.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift index 91387a08..7db6bad7 100644 --- a/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift +++ b/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift @@ -6,50 +6,50 @@ import JavaScriptKit public class RTCInboundRtpStreamStats: BridgedDictionary { public convenience init(receiverId: String, remoteId: String, framesDecoded: UInt32, keyFramesDecoded: UInt32, frameWidth: UInt32, frameHeight: UInt32, frameBitDepth: UInt32, framesPerSecond: Double, qpSum: UInt64, totalDecodeTime: Double, totalInterFrameDelay: Double, totalSquaredInterFrameDelay: Double, voiceActivityFlag: Bool, lastPacketReceivedTimestamp: DOMHighResTimeStamp, averageRtcpInterval: Double, headerBytesReceived: UInt64, fecPacketsReceived: UInt64, fecPacketsDiscarded: UInt64, bytesReceived: UInt64, packetsFailedDecryption: UInt64, packetsDuplicated: UInt64, perDscpPacketsReceived: [String: UInt64], nackCount: UInt32, firCount: UInt32, pliCount: UInt32, sliCount: UInt32, totalProcessingDelay: Double, estimatedPlayoutTimestamp: DOMHighResTimeStamp, jitterBufferDelay: Double, jitterBufferEmittedCount: UInt64, totalSamplesReceived: UInt64, totalSamplesDecoded: UInt64, samplesDecodedWithSilk: UInt64, samplesDecodedWithCelt: UInt64, concealedSamples: UInt64, silentConcealedSamples: UInt64, concealmentEvents: UInt64, insertedSamplesForDeceleration: UInt64, removedSamplesForAcceleration: UInt64, audioLevel: Double, totalAudioEnergy: Double, totalSamplesDuration: Double, framesReceived: UInt32, decoderImplementation: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.receiverId] = receiverId.jsValue() - object[Strings.remoteId] = remoteId.jsValue() - object[Strings.framesDecoded] = framesDecoded.jsValue() - object[Strings.keyFramesDecoded] = keyFramesDecoded.jsValue() - object[Strings.frameWidth] = frameWidth.jsValue() - object[Strings.frameHeight] = frameHeight.jsValue() - object[Strings.frameBitDepth] = frameBitDepth.jsValue() - object[Strings.framesPerSecond] = framesPerSecond.jsValue() - object[Strings.qpSum] = qpSum.jsValue() - object[Strings.totalDecodeTime] = totalDecodeTime.jsValue() - object[Strings.totalInterFrameDelay] = totalInterFrameDelay.jsValue() - object[Strings.totalSquaredInterFrameDelay] = totalSquaredInterFrameDelay.jsValue() - object[Strings.voiceActivityFlag] = voiceActivityFlag.jsValue() - object[Strings.lastPacketReceivedTimestamp] = lastPacketReceivedTimestamp.jsValue() - object[Strings.averageRtcpInterval] = averageRtcpInterval.jsValue() - object[Strings.headerBytesReceived] = headerBytesReceived.jsValue() - object[Strings.fecPacketsReceived] = fecPacketsReceived.jsValue() - object[Strings.fecPacketsDiscarded] = fecPacketsDiscarded.jsValue() - object[Strings.bytesReceived] = bytesReceived.jsValue() - object[Strings.packetsFailedDecryption] = packetsFailedDecryption.jsValue() - object[Strings.packetsDuplicated] = packetsDuplicated.jsValue() - object[Strings.perDscpPacketsReceived] = perDscpPacketsReceived.jsValue() - object[Strings.nackCount] = nackCount.jsValue() - object[Strings.firCount] = firCount.jsValue() - object[Strings.pliCount] = pliCount.jsValue() - object[Strings.sliCount] = sliCount.jsValue() - object[Strings.totalProcessingDelay] = totalProcessingDelay.jsValue() - object[Strings.estimatedPlayoutTimestamp] = estimatedPlayoutTimestamp.jsValue() - object[Strings.jitterBufferDelay] = jitterBufferDelay.jsValue() - object[Strings.jitterBufferEmittedCount] = jitterBufferEmittedCount.jsValue() - object[Strings.totalSamplesReceived] = totalSamplesReceived.jsValue() - object[Strings.totalSamplesDecoded] = totalSamplesDecoded.jsValue() - object[Strings.samplesDecodedWithSilk] = samplesDecodedWithSilk.jsValue() - object[Strings.samplesDecodedWithCelt] = samplesDecodedWithCelt.jsValue() - object[Strings.concealedSamples] = concealedSamples.jsValue() - object[Strings.silentConcealedSamples] = silentConcealedSamples.jsValue() - object[Strings.concealmentEvents] = concealmentEvents.jsValue() - object[Strings.insertedSamplesForDeceleration] = insertedSamplesForDeceleration.jsValue() - object[Strings.removedSamplesForAcceleration] = removedSamplesForAcceleration.jsValue() - object[Strings.audioLevel] = audioLevel.jsValue() - object[Strings.totalAudioEnergy] = totalAudioEnergy.jsValue() - object[Strings.totalSamplesDuration] = totalSamplesDuration.jsValue() - object[Strings.framesReceived] = framesReceived.jsValue() - object[Strings.decoderImplementation] = decoderImplementation.jsValue() + object[Strings.receiverId] = receiverId.jsValue + object[Strings.remoteId] = remoteId.jsValue + object[Strings.framesDecoded] = framesDecoded.jsValue + object[Strings.keyFramesDecoded] = keyFramesDecoded.jsValue + object[Strings.frameWidth] = frameWidth.jsValue + object[Strings.frameHeight] = frameHeight.jsValue + object[Strings.frameBitDepth] = frameBitDepth.jsValue + object[Strings.framesPerSecond] = framesPerSecond.jsValue + object[Strings.qpSum] = qpSum.jsValue + object[Strings.totalDecodeTime] = totalDecodeTime.jsValue + object[Strings.totalInterFrameDelay] = totalInterFrameDelay.jsValue + object[Strings.totalSquaredInterFrameDelay] = totalSquaredInterFrameDelay.jsValue + object[Strings.voiceActivityFlag] = voiceActivityFlag.jsValue + object[Strings.lastPacketReceivedTimestamp] = lastPacketReceivedTimestamp.jsValue + object[Strings.averageRtcpInterval] = averageRtcpInterval.jsValue + object[Strings.headerBytesReceived] = headerBytesReceived.jsValue + object[Strings.fecPacketsReceived] = fecPacketsReceived.jsValue + object[Strings.fecPacketsDiscarded] = fecPacketsDiscarded.jsValue + object[Strings.bytesReceived] = bytesReceived.jsValue + object[Strings.packetsFailedDecryption] = packetsFailedDecryption.jsValue + object[Strings.packetsDuplicated] = packetsDuplicated.jsValue + object[Strings.perDscpPacketsReceived] = perDscpPacketsReceived.jsValue + object[Strings.nackCount] = nackCount.jsValue + object[Strings.firCount] = firCount.jsValue + object[Strings.pliCount] = pliCount.jsValue + object[Strings.sliCount] = sliCount.jsValue + object[Strings.totalProcessingDelay] = totalProcessingDelay.jsValue + object[Strings.estimatedPlayoutTimestamp] = estimatedPlayoutTimestamp.jsValue + object[Strings.jitterBufferDelay] = jitterBufferDelay.jsValue + object[Strings.jitterBufferEmittedCount] = jitterBufferEmittedCount.jsValue + object[Strings.totalSamplesReceived] = totalSamplesReceived.jsValue + object[Strings.totalSamplesDecoded] = totalSamplesDecoded.jsValue + object[Strings.samplesDecodedWithSilk] = samplesDecodedWithSilk.jsValue + object[Strings.samplesDecodedWithCelt] = samplesDecodedWithCelt.jsValue + object[Strings.concealedSamples] = concealedSamples.jsValue + object[Strings.silentConcealedSamples] = silentConcealedSamples.jsValue + object[Strings.concealmentEvents] = concealmentEvents.jsValue + object[Strings.insertedSamplesForDeceleration] = insertedSamplesForDeceleration.jsValue + object[Strings.removedSamplesForAcceleration] = removedSamplesForAcceleration.jsValue + object[Strings.audioLevel] = audioLevel.jsValue + object[Strings.totalAudioEnergy] = totalAudioEnergy.jsValue + object[Strings.totalSamplesDuration] = totalSamplesDuration.jsValue + object[Strings.framesReceived] = framesReceived.jsValue + object[Strings.decoderImplementation] = decoderImplementation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift b/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift index 424a131b..3e838af3 100644 --- a/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift +++ b/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCInsertableStreams: 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() + object[Strings.readable] = readable.jsValue + object[Strings.writable] = writable.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift b/Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift index ddd02fe4..10447608 100644 --- a/Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift +++ b/Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCLocalSessionDescriptionInit: BridgedDictionary { public convenience init(type: RTCSdpType, sdp: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.sdp] = sdp.jsValue() + object[Strings.type] = type.jsValue + object[Strings.sdp] = sdp.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift b/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift index 3f5d1158..e9d5f091 100644 --- a/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift +++ b/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCMediaHandlerStats: BridgedDictionary { public convenience init(trackIdentifier: String, ended: Bool, kind: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.trackIdentifier] = trackIdentifier.jsValue() - object[Strings.ended] = ended.jsValue() - object[Strings.kind] = kind.jsValue() + object[Strings.trackIdentifier] = trackIdentifier.jsValue + object[Strings.ended] = ended.jsValue + object[Strings.kind] = kind.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift b/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift index d25bd041..b3d1549a 100644 --- a/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift +++ b/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCMediaSourceStats: BridgedDictionary { public convenience init(trackIdentifier: String, kind: String, relayedSource: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.trackIdentifier] = trackIdentifier.jsValue() - object[Strings.kind] = kind.jsValue() - object[Strings.relayedSource] = relayedSource.jsValue() + object[Strings.trackIdentifier] = trackIdentifier.jsValue + object[Strings.kind] = kind.jsValue + object[Strings.relayedSource] = relayedSource.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCOfferOptions.swift b/Sources/DOMKit/WebIDL/RTCOfferOptions.swift index f36f5da7..9ad0a418 100644 --- a/Sources/DOMKit/WebIDL/RTCOfferOptions.swift +++ b/Sources/DOMKit/WebIDL/RTCOfferOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCOfferOptions: BridgedDictionary { public convenience init(iceRestart: Bool, offerToReceiveAudio: Bool, offerToReceiveVideo: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iceRestart] = iceRestart.jsValue() - object[Strings.offerToReceiveAudio] = offerToReceiveAudio.jsValue() - object[Strings.offerToReceiveVideo] = offerToReceiveVideo.jsValue() + object[Strings.iceRestart] = iceRestart.jsValue + object[Strings.offerToReceiveAudio] = offerToReceiveAudio.jsValue + object[Strings.offerToReceiveVideo] = offerToReceiveVideo.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift index da377663..96ac0a6a 100644 --- a/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift +++ b/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift @@ -6,46 +6,46 @@ import JavaScriptKit public class RTCOutboundRtpStreamStats: BridgedDictionary { public convenience init(rtxSsrc: UInt32, mediaSourceId: String, senderId: String, remoteId: String, rid: String, lastPacketSentTimestamp: DOMHighResTimeStamp, headerBytesSent: UInt64, packetsDiscardedOnSend: UInt32, bytesDiscardedOnSend: UInt64, fecPacketsSent: UInt32, retransmittedPacketsSent: UInt64, retransmittedBytesSent: UInt64, targetBitrate: Double, totalEncodedBytesTarget: UInt64, frameWidth: UInt32, frameHeight: UInt32, frameBitDepth: UInt32, framesPerSecond: Double, framesSent: UInt32, hugeFramesSent: UInt32, framesEncoded: UInt32, keyFramesEncoded: UInt32, framesDiscardedOnSend: UInt32, qpSum: UInt64, totalSamplesSent: UInt64, samplesEncodedWithSilk: UInt64, samplesEncodedWithCelt: UInt64, voiceActivityFlag: Bool, totalEncodeTime: Double, totalPacketSendDelay: Double, averageRtcpInterval: Double, qualityLimitationReason: RTCQualityLimitationReason, qualityLimitationDurations: [String: Double], qualityLimitationResolutionChanges: UInt32, perDscpPacketsSent: [String: UInt64], nackCount: UInt32, firCount: UInt32, pliCount: UInt32, sliCount: UInt32, encoderImplementation: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rtxSsrc] = rtxSsrc.jsValue() - object[Strings.mediaSourceId] = mediaSourceId.jsValue() - object[Strings.senderId] = senderId.jsValue() - object[Strings.remoteId] = remoteId.jsValue() - object[Strings.rid] = rid.jsValue() - object[Strings.lastPacketSentTimestamp] = lastPacketSentTimestamp.jsValue() - object[Strings.headerBytesSent] = headerBytesSent.jsValue() - object[Strings.packetsDiscardedOnSend] = packetsDiscardedOnSend.jsValue() - object[Strings.bytesDiscardedOnSend] = bytesDiscardedOnSend.jsValue() - object[Strings.fecPacketsSent] = fecPacketsSent.jsValue() - object[Strings.retransmittedPacketsSent] = retransmittedPacketsSent.jsValue() - object[Strings.retransmittedBytesSent] = retransmittedBytesSent.jsValue() - object[Strings.targetBitrate] = targetBitrate.jsValue() - object[Strings.totalEncodedBytesTarget] = totalEncodedBytesTarget.jsValue() - object[Strings.frameWidth] = frameWidth.jsValue() - object[Strings.frameHeight] = frameHeight.jsValue() - object[Strings.frameBitDepth] = frameBitDepth.jsValue() - object[Strings.framesPerSecond] = framesPerSecond.jsValue() - object[Strings.framesSent] = framesSent.jsValue() - object[Strings.hugeFramesSent] = hugeFramesSent.jsValue() - object[Strings.framesEncoded] = framesEncoded.jsValue() - object[Strings.keyFramesEncoded] = keyFramesEncoded.jsValue() - object[Strings.framesDiscardedOnSend] = framesDiscardedOnSend.jsValue() - object[Strings.qpSum] = qpSum.jsValue() - object[Strings.totalSamplesSent] = totalSamplesSent.jsValue() - object[Strings.samplesEncodedWithSilk] = samplesEncodedWithSilk.jsValue() - object[Strings.samplesEncodedWithCelt] = samplesEncodedWithCelt.jsValue() - object[Strings.voiceActivityFlag] = voiceActivityFlag.jsValue() - object[Strings.totalEncodeTime] = totalEncodeTime.jsValue() - object[Strings.totalPacketSendDelay] = totalPacketSendDelay.jsValue() - object[Strings.averageRtcpInterval] = averageRtcpInterval.jsValue() - object[Strings.qualityLimitationReason] = qualityLimitationReason.jsValue() - object[Strings.qualityLimitationDurations] = qualityLimitationDurations.jsValue() - object[Strings.qualityLimitationResolutionChanges] = qualityLimitationResolutionChanges.jsValue() - object[Strings.perDscpPacketsSent] = perDscpPacketsSent.jsValue() - object[Strings.nackCount] = nackCount.jsValue() - object[Strings.firCount] = firCount.jsValue() - object[Strings.pliCount] = pliCount.jsValue() - object[Strings.sliCount] = sliCount.jsValue() - object[Strings.encoderImplementation] = encoderImplementation.jsValue() + object[Strings.rtxSsrc] = rtxSsrc.jsValue + object[Strings.mediaSourceId] = mediaSourceId.jsValue + object[Strings.senderId] = senderId.jsValue + object[Strings.remoteId] = remoteId.jsValue + object[Strings.rid] = rid.jsValue + object[Strings.lastPacketSentTimestamp] = lastPacketSentTimestamp.jsValue + object[Strings.headerBytesSent] = headerBytesSent.jsValue + object[Strings.packetsDiscardedOnSend] = packetsDiscardedOnSend.jsValue + object[Strings.bytesDiscardedOnSend] = bytesDiscardedOnSend.jsValue + object[Strings.fecPacketsSent] = fecPacketsSent.jsValue + object[Strings.retransmittedPacketsSent] = retransmittedPacketsSent.jsValue + object[Strings.retransmittedBytesSent] = retransmittedBytesSent.jsValue + object[Strings.targetBitrate] = targetBitrate.jsValue + object[Strings.totalEncodedBytesTarget] = totalEncodedBytesTarget.jsValue + object[Strings.frameWidth] = frameWidth.jsValue + object[Strings.frameHeight] = frameHeight.jsValue + object[Strings.frameBitDepth] = frameBitDepth.jsValue + object[Strings.framesPerSecond] = framesPerSecond.jsValue + object[Strings.framesSent] = framesSent.jsValue + object[Strings.hugeFramesSent] = hugeFramesSent.jsValue + object[Strings.framesEncoded] = framesEncoded.jsValue + object[Strings.keyFramesEncoded] = keyFramesEncoded.jsValue + object[Strings.framesDiscardedOnSend] = framesDiscardedOnSend.jsValue + object[Strings.qpSum] = qpSum.jsValue + object[Strings.totalSamplesSent] = totalSamplesSent.jsValue + object[Strings.samplesEncodedWithSilk] = samplesEncodedWithSilk.jsValue + object[Strings.samplesEncodedWithCelt] = samplesEncodedWithCelt.jsValue + object[Strings.voiceActivityFlag] = voiceActivityFlag.jsValue + object[Strings.totalEncodeTime] = totalEncodeTime.jsValue + object[Strings.totalPacketSendDelay] = totalPacketSendDelay.jsValue + object[Strings.averageRtcpInterval] = averageRtcpInterval.jsValue + object[Strings.qualityLimitationReason] = qualityLimitationReason.jsValue + object[Strings.qualityLimitationDurations] = qualityLimitationDurations.jsValue + object[Strings.qualityLimitationResolutionChanges] = qualityLimitationResolutionChanges.jsValue + object[Strings.perDscpPacketsSent] = perDscpPacketsSent.jsValue + object[Strings.nackCount] = nackCount.jsValue + object[Strings.firCount] = firCount.jsValue + object[Strings.pliCount] = pliCount.jsValue + object[Strings.sliCount] = sliCount.jsValue + object[Strings.encoderImplementation] = encoderImplementation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift index 0827f0c3..cd5f438c 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift @@ -36,7 +36,7 @@ public class RTCPeerConnection: EventTarget { @inlinable public func setIdentityProvider(provider: String, options: RTCIdentityProviderOptions? = nil) { let this = jsObject - _ = this[Strings.setIdentityProvider].function!(this: this, arguments: [provider.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.setIdentityProvider].function!(this: this, arguments: [provider.jsValue, options?.jsValue ?? .undefined]) } @inlinable public func getIdentityAssertion() -> JSPromise { @@ -48,7 +48,7 @@ public class RTCPeerConnection: EventTarget { @inlinable public func getIdentityAssertion() async throws -> String { let this = jsObject let _promise: JSPromise = this[Strings.getIdentityAssertion].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute @@ -61,7 +61,7 @@ public class RTCPeerConnection: EventTarget { public var idpErrorInfo: String? @inlinable public convenience init(configuration: RTCConfiguration? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration?.jsValue ?? .undefined])) } // XXX: member 'createOffer' is ignored @@ -129,7 +129,7 @@ public class RTCPeerConnection: EventTarget { @inlinable public func setConfiguration(configuration: RTCConfiguration? = nil) { let this = jsObject - _ = this[Strings.setConfiguration].function!(this: this, arguments: [configuration?.jsValue() ?? .undefined]) + _ = this[Strings.setConfiguration].function!(this: this, arguments: [configuration?.jsValue ?? .undefined]) } @inlinable public func close() { @@ -180,14 +180,14 @@ public class RTCPeerConnection: EventTarget { @inlinable public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) -> JSPromise { let this = constructor - return this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue()]).fromJSValue()! + return this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) async throws -> RTCCertificate { let this = constructor - let _promise: JSPromise = this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getSenders() -> [RTCRtpSender] { @@ -207,17 +207,17 @@ public class RTCPeerConnection: EventTarget { @inlinable public func addTrack(track: MediaStreamTrack, streams: MediaStream...) -> RTCRtpSender { let this = jsObject - return this[Strings.addTrack].function!(this: this, arguments: [track.jsValue()] + streams.map { $0.jsValue() }).fromJSValue()! + return this[Strings.addTrack].function!(this: this, arguments: [track.jsValue] + streams.map(\.jsValue)).fromJSValue()! } @inlinable public func removeTrack(sender: RTCRtpSender) { let this = jsObject - _ = this[Strings.removeTrack].function!(this: this, arguments: [sender.jsValue()]) + _ = this[Strings.removeTrack].function!(this: this, arguments: [sender.jsValue]) } @inlinable public func addTransceiver(trackOrKind: MediaStreamTrack_or_String, init: RTCRtpTransceiverInit? = nil) -> RTCRtpTransceiver { let this = jsObject - return this[Strings.addTransceiver].function!(this: this, arguments: [trackOrKind.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.addTransceiver].function!(this: this, arguments: [trackOrKind.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! } @ClosureAttribute1Optional @@ -228,7 +228,7 @@ public class RTCPeerConnection: EventTarget { @inlinable public func createDataChannel(label: String, dataChannelDict: RTCDataChannelInit? = nil) -> RTCDataChannel { let this = jsObject - return this[Strings.createDataChannel].function!(this: this, arguments: [label.jsValue(), dataChannelDict?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createDataChannel].function!(this: this, arguments: [label.jsValue, dataChannelDict?.jsValue ?? .undefined]).fromJSValue()! } @ClosureAttribute1Optional @@ -236,13 +236,13 @@ public class RTCPeerConnection: EventTarget { @inlinable public func getStats(selector: MediaStreamTrack? = nil) -> JSPromise { let this = jsObject - return this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getStats(selector: MediaStreamTrack? = nil) async throws -> RTCStatsReport { let this = jsObject - let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift index 32d6406b..19093338 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift @@ -16,7 +16,7 @@ public class RTCPeerConnectionIceErrorEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: RTCPeerConnectionIceErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift index 9f3ce0b9..67066a0f 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class RTCPeerConnectionIceErrorEventInit: BridgedDictionary { public convenience init(address: String?, port: UInt16?, url: String, errorCode: UInt16, errorText: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.address] = address.jsValue() - object[Strings.port] = port.jsValue() - object[Strings.url] = url.jsValue() - object[Strings.errorCode] = errorCode.jsValue() - object[Strings.errorText] = errorText.jsValue() + object[Strings.address] = address.jsValue + object[Strings.port] = port.jsValue + object[Strings.url] = url.jsValue + object[Strings.errorCode] = errorCode.jsValue + object[Strings.errorText] = errorText.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift index 7ebbd607..43b719cc 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift @@ -13,7 +13,7 @@ public class RTCPeerConnectionIceEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: RTCPeerConnectionIceEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift index b07a70ac..d42a48ef 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCPeerConnectionIceEventInit: BridgedDictionary { public convenience init(candidate: RTCIceCandidate?, url: String?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.candidate] = candidate.jsValue() - object[Strings.url] = url.jsValue() + object[Strings.candidate] = candidate.jsValue + object[Strings.url] = url.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift index e5979acf..2ade7aaa 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift @@ -22,5 +22,5 @@ public enum RTCPeerConnectionState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift index 99592479..2b779b04 100644 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift +++ b/Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RTCPeerConnectionStats: BridgedDictionary { public convenience init(dataChannelsOpened: UInt32, dataChannelsClosed: UInt32, dataChannelsRequested: UInt32, dataChannelsAccepted: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataChannelsOpened] = dataChannelsOpened.jsValue() - object[Strings.dataChannelsClosed] = dataChannelsClosed.jsValue() - object[Strings.dataChannelsRequested] = dataChannelsRequested.jsValue() - object[Strings.dataChannelsAccepted] = dataChannelsAccepted.jsValue() + object[Strings.dataChannelsOpened] = dataChannelsOpened.jsValue + object[Strings.dataChannelsClosed] = dataChannelsClosed.jsValue + object[Strings.dataChannelsRequested] = dataChannelsRequested.jsValue + object[Strings.dataChannelsAccepted] = dataChannelsAccepted.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCPriorityType.swift b/Sources/DOMKit/WebIDL/RTCPriorityType.swift index db5d09c3..40795f20 100644 --- a/Sources/DOMKit/WebIDL/RTCPriorityType.swift +++ b/Sources/DOMKit/WebIDL/RTCPriorityType.swift @@ -20,5 +20,5 @@ public enum RTCPriorityType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift b/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift index b2984b39..b96f5fff 100644 --- a/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift +++ b/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift @@ -20,5 +20,5 @@ public enum RTCQualityLimitationReason: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift index 8fe210ac..69d2ba97 100644 --- a/Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift +++ b/Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift @@ -6,22 +6,22 @@ import JavaScriptKit public class RTCReceivedRtpStreamStats: BridgedDictionary { public convenience init(packetsReceived: UInt64, packetsLost: Int64, jitter: Double, packetsDiscarded: UInt64, packetsRepaired: UInt64, burstPacketsLost: UInt64, burstPacketsDiscarded: UInt64, burstLossCount: UInt32, burstDiscardCount: UInt32, burstLossRate: Double, burstDiscardRate: Double, gapLossRate: Double, gapDiscardRate: Double, framesDropped: UInt32, partialFramesLost: UInt32, fullFramesLost: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.packetsReceived] = packetsReceived.jsValue() - object[Strings.packetsLost] = packetsLost.jsValue() - object[Strings.jitter] = jitter.jsValue() - object[Strings.packetsDiscarded] = packetsDiscarded.jsValue() - object[Strings.packetsRepaired] = packetsRepaired.jsValue() - object[Strings.burstPacketsLost] = burstPacketsLost.jsValue() - object[Strings.burstPacketsDiscarded] = burstPacketsDiscarded.jsValue() - object[Strings.burstLossCount] = burstLossCount.jsValue() - object[Strings.burstDiscardCount] = burstDiscardCount.jsValue() - object[Strings.burstLossRate] = burstLossRate.jsValue() - object[Strings.burstDiscardRate] = burstDiscardRate.jsValue() - object[Strings.gapLossRate] = gapLossRate.jsValue() - object[Strings.gapDiscardRate] = gapDiscardRate.jsValue() - object[Strings.framesDropped] = framesDropped.jsValue() - object[Strings.partialFramesLost] = partialFramesLost.jsValue() - object[Strings.fullFramesLost] = fullFramesLost.jsValue() + object[Strings.packetsReceived] = packetsReceived.jsValue + object[Strings.packetsLost] = packetsLost.jsValue + object[Strings.jitter] = jitter.jsValue + object[Strings.packetsDiscarded] = packetsDiscarded.jsValue + object[Strings.packetsRepaired] = packetsRepaired.jsValue + object[Strings.burstPacketsLost] = burstPacketsLost.jsValue + object[Strings.burstPacketsDiscarded] = burstPacketsDiscarded.jsValue + object[Strings.burstLossCount] = burstLossCount.jsValue + object[Strings.burstDiscardCount] = burstDiscardCount.jsValue + object[Strings.burstLossRate] = burstLossRate.jsValue + object[Strings.burstDiscardRate] = burstDiscardRate.jsValue + object[Strings.gapLossRate] = gapLossRate.jsValue + object[Strings.gapDiscardRate] = gapDiscardRate.jsValue + object[Strings.framesDropped] = framesDropped.jsValue + object[Strings.partialFramesLost] = partialFramesLost.jsValue + object[Strings.fullFramesLost] = fullFramesLost.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift index b3f76f46..dcc5a510 100644 --- a/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift +++ b/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class RTCRemoteInboundRtpStreamStats: BridgedDictionary { public convenience init(localId: String, roundTripTime: Double, totalRoundTripTime: Double, fractionLost: Double, reportsReceived: UInt64, roundTripTimeMeasurements: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.localId] = localId.jsValue() - object[Strings.roundTripTime] = roundTripTime.jsValue() - object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue() - object[Strings.fractionLost] = fractionLost.jsValue() - object[Strings.reportsReceived] = reportsReceived.jsValue() - object[Strings.roundTripTimeMeasurements] = roundTripTimeMeasurements.jsValue() + object[Strings.localId] = localId.jsValue + object[Strings.roundTripTime] = roundTripTime.jsValue + object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue + object[Strings.fractionLost] = fractionLost.jsValue + object[Strings.reportsReceived] = reportsReceived.jsValue + object[Strings.roundTripTimeMeasurements] = roundTripTimeMeasurements.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift index a66ff4d7..9cce14b6 100644 --- a/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift +++ b/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class RTCRemoteOutboundRtpStreamStats: BridgedDictionary { public convenience init(localId: String, remoteTimestamp: DOMHighResTimeStamp, reportsSent: UInt64, roundTripTime: Double, totalRoundTripTime: Double, roundTripTimeMeasurements: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.localId] = localId.jsValue() - object[Strings.remoteTimestamp] = remoteTimestamp.jsValue() - object[Strings.reportsSent] = reportsSent.jsValue() - object[Strings.roundTripTime] = roundTripTime.jsValue() - object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue() - object[Strings.roundTripTimeMeasurements] = roundTripTimeMeasurements.jsValue() + object[Strings.localId] = localId.jsValue + object[Strings.remoteTimestamp] = remoteTimestamp.jsValue + object[Strings.reportsSent] = reportsSent.jsValue + object[Strings.roundTripTime] = roundTripTime.jsValue + object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue + object[Strings.roundTripTimeMeasurements] = roundTripTimeMeasurements.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift b/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift index 980ed57e..6ef310d4 100644 --- a/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift +++ b/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift @@ -17,5 +17,5 @@ public enum RTCRtcpMuxPolicy: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCRtcpParameters.swift b/Sources/DOMKit/WebIDL/RTCRtcpParameters.swift index fee47629..4e8f02b5 100644 --- a/Sources/DOMKit/WebIDL/RTCRtcpParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCRtcpParameters.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCRtcpParameters: BridgedDictionary { public convenience init(cname: String, reducedSize: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.cname] = cname.jsValue() - object[Strings.reducedSize] = reducedSize.jsValue() + object[Strings.cname] = cname.jsValue + object[Strings.reducedSize] = reducedSize.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift b/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift index 578c8f23..ca406d40 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCRtpCapabilities: BridgedDictionary { public convenience init(codecs: [RTCRtpCodecCapability], headerExtensions: [RTCRtpHeaderExtensionCapability]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.codecs] = codecs.jsValue() - object[Strings.headerExtensions] = headerExtensions.jsValue() + object[Strings.codecs] = codecs.jsValue + object[Strings.headerExtensions] = headerExtensions.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift b/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift index 757be743..d2687c60 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class RTCRtpCodecCapability: BridgedDictionary { public convenience init(scalabilityModes: [String], mimeType: String, clockRate: UInt32, channels: UInt16, sdpFmtpLine: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.scalabilityModes] = scalabilityModes.jsValue() - object[Strings.mimeType] = mimeType.jsValue() - object[Strings.clockRate] = clockRate.jsValue() - object[Strings.channels] = channels.jsValue() - object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue() + object[Strings.scalabilityModes] = scalabilityModes.jsValue + object[Strings.mimeType] = mimeType.jsValue + object[Strings.clockRate] = clockRate.jsValue + object[Strings.channels] = channels.jsValue + object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift index 47b6c9aa..18e7edf9 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class RTCRtpCodecParameters: BridgedDictionary { public convenience init(payloadType: UInt8, mimeType: String, clockRate: UInt32, channels: UInt16, sdpFmtpLine: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.payloadType] = payloadType.jsValue() - object[Strings.mimeType] = mimeType.jsValue() - object[Strings.clockRate] = clockRate.jsValue() - object[Strings.channels] = channels.jsValue() - object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue() + object[Strings.payloadType] = payloadType.jsValue + object[Strings.mimeType] = mimeType.jsValue + object[Strings.clockRate] = clockRate.jsValue + object[Strings.channels] = channels.jsValue + object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift index bf00495c..a8135981 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RTCRtpCodingParameters: BridgedDictionary { public convenience init(rid: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rid] = rid.jsValue() + object[Strings.rid] = rid.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift b/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift index 61ed00ff..8839b01d 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RTCRtpContributingSource: BridgedDictionary { public convenience init(timestamp: DOMHighResTimeStamp, source: UInt32, audioLevel: Double, rtpTimestamp: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue() - object[Strings.source] = source.jsValue() - object[Strings.audioLevel] = audioLevel.jsValue() - object[Strings.rtpTimestamp] = rtpTimestamp.jsValue() + object[Strings.timestamp] = timestamp.jsValue + object[Strings.source] = source.jsValue + object[Strings.audioLevel] = audioLevel.jsValue + object[Strings.rtpTimestamp] = rtpTimestamp.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift b/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift index 56fec3c7..7b497902 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RTCRtpContributingSourceStats: BridgedDictionary { public convenience init(contributorSsrc: UInt32, inboundRtpStreamId: String, packetsContributedTo: UInt32, audioLevel: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contributorSsrc] = contributorSsrc.jsValue() - object[Strings.inboundRtpStreamId] = inboundRtpStreamId.jsValue() - object[Strings.packetsContributedTo] = packetsContributedTo.jsValue() - object[Strings.audioLevel] = audioLevel.jsValue() + object[Strings.contributorSsrc] = contributorSsrc.jsValue + object[Strings.inboundRtpStreamId] = inboundRtpStreamId.jsValue + object[Strings.packetsContributedTo] = packetsContributedTo.jsValue + object[Strings.audioLevel] = audioLevel.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift index 8abdf5b4..77cd9929 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class RTCRtpEncodingParameters: BridgedDictionary { public convenience init(priority: RTCPriorityType, networkPriority: RTCPriorityType, scalabilityMode: String, active: Bool, maxBitrate: UInt32, scaleResolutionDownBy: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.priority] = priority.jsValue() - object[Strings.networkPriority] = networkPriority.jsValue() - object[Strings.scalabilityMode] = scalabilityMode.jsValue() - object[Strings.active] = active.jsValue() - object[Strings.maxBitrate] = maxBitrate.jsValue() - object[Strings.scaleResolutionDownBy] = scaleResolutionDownBy.jsValue() + object[Strings.priority] = priority.jsValue + object[Strings.networkPriority] = networkPriority.jsValue + object[Strings.scalabilityMode] = scalabilityMode.jsValue + object[Strings.active] = active.jsValue + object[Strings.maxBitrate] = maxBitrate.jsValue + object[Strings.scaleResolutionDownBy] = scaleResolutionDownBy.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift index 15bbd74d..b39c918c 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RTCRtpHeaderExtensionCapability: BridgedDictionary { public convenience init(uri: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.uri] = uri.jsValue() + object[Strings.uri] = uri.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift index f2cff9cd..c9a07502 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCRtpHeaderExtensionParameters: BridgedDictionary { public convenience init(uri: String, id: UInt16, encrypted: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.uri] = uri.jsValue() - object[Strings.id] = id.jsValue() - object[Strings.encrypted] = encrypted.jsValue() + object[Strings.uri] = uri.jsValue + object[Strings.id] = id.jsValue + object[Strings.encrypted] = encrypted.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpParameters.swift index ab4f20f9..c7676a33 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpParameters.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCRtpParameters: BridgedDictionary { public convenience init(headerExtensions: [RTCRtpHeaderExtensionParameters], rtcp: RTCRtcpParameters, codecs: [RTCRtpCodecParameters]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.headerExtensions] = headerExtensions.jsValue() - object[Strings.rtcp] = rtcp.jsValue() - object[Strings.codecs] = codecs.jsValue() + object[Strings.headerExtensions] = headerExtensions.jsValue + object[Strings.rtcp] = rtcp.jsValue + object[Strings.codecs] = codecs.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift index c5187bd5..aab9ec22 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift @@ -26,7 +26,7 @@ public class RTCRtpReceiver: JSBridgedClass { @inlinable public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { let this = constructor - return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue()]).fromJSValue()! + return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue]).fromJSValue()! } @inlinable public func getParameters() -> RTCRtpReceiveParameters { @@ -53,6 +53,6 @@ public class RTCRtpReceiver: JSBridgedClass { @inlinable public func getStats() async throws -> RTCStatsReport { let this = jsObject let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift index c87c2171..72555739 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift @@ -13,6 +13,6 @@ public class RTCRtpScriptTransform: JSBridgedClass { } @inlinable public convenience init(worker: Worker, options: JSValue? = nil, transfer: [JSObject]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [worker.jsValue(), options?.jsValue() ?? .undefined, transfer?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [worker.jsValue, options?.jsValue ?? .undefined, transfer?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift index e89d9da5..afe33bd0 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCRtpSendParameters: BridgedDictionary { public convenience init(degradationPreference: RTCDegradationPreference, transactionId: String, encodings: [RTCRtpEncodingParameters]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.degradationPreference] = degradationPreference.jsValue() - object[Strings.transactionId] = transactionId.jsValue() - object[Strings.encodings] = encodings.jsValue() + object[Strings.degradationPreference] = degradationPreference.jsValue + object[Strings.transactionId] = transactionId.jsValue + object[Strings.encodings] = encodings.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpSender.swift b/Sources/DOMKit/WebIDL/RTCRtpSender.swift index 71cfad00..05a23cd6 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpSender.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpSender.swift @@ -21,14 +21,14 @@ public class RTCRtpSender: JSBridgedClass { @inlinable public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { let this = jsObject - return this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func generateKeyFrame(rids: [String]? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @ReadonlyAttribute @@ -39,19 +39,19 @@ public class RTCRtpSender: JSBridgedClass { @inlinable public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { let this = constructor - return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue()]).fromJSValue()! + return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue]).fromJSValue()! } @inlinable public func setParameters(parameters: RTCRtpSendParameters) -> JSPromise { let this = jsObject - return this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue()]).fromJSValue()! + return this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func setParameters(parameters: RTCRtpSendParameters) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func getParameters() -> RTCRtpSendParameters { @@ -61,19 +61,19 @@ public class RTCRtpSender: JSBridgedClass { @inlinable public func replaceTrack(withTrack: MediaStreamTrack?) -> JSPromise { let this = jsObject - return this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue()]).fromJSValue()! + return this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func replaceTrack(withTrack: MediaStreamTrack?) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func setStreams(streams: MediaStream...) { let this = jsObject - _ = this[Strings.setStreams].function!(this: this, arguments: streams.map { $0.jsValue() }) + _ = this[Strings.setStreams].function!(this: this, arguments: streams.map(\.jsValue)) } @inlinable public func getStats() -> JSPromise { @@ -85,7 +85,7 @@ public class RTCRtpSender: JSBridgedClass { @inlinable public func getStats() async throws -> RTCStatsReport { let this = jsObject let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift index 585b65cc..efe5d101 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RTCRtpStreamStats: BridgedDictionary { public convenience init(ssrc: UInt32, kind: String, transportId: String, codecId: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.ssrc] = ssrc.jsValue() - object[Strings.kind] = kind.jsValue() - object[Strings.transportId] = transportId.jsValue() - object[Strings.codecId] = codecId.jsValue() + object[Strings.ssrc] = ssrc.jsValue + object[Strings.kind] = kind.jsValue + object[Strings.transportId] = transportId.jsValue + object[Strings.codecId] = codecId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift index 6551f37d..1268032f 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift @@ -39,6 +39,6 @@ public class RTCRtpTransceiver: JSBridgedClass { @inlinable public func setCodecPreferences(codecs: [RTCRtpCodecCapability]) { let this = jsObject - _ = this[Strings.setCodecPreferences].function!(this: this, arguments: [codecs.jsValue()]) + _ = this[Strings.setCodecPreferences].function!(this: this, arguments: [codecs.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift index 4071ae96..e9adedfc 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift @@ -21,5 +21,5 @@ public enum RTCRtpTransceiverDirection: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift index 62010f76..9cce717a 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCRtpTransceiverInit: BridgedDictionary { public convenience init(direction: RTCRtpTransceiverDirection, streams: [MediaStream], sendEncodings: [RTCRtpEncodingParameters]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.direction] = direction.jsValue() - object[Strings.streams] = streams.jsValue() - object[Strings.sendEncodings] = sendEncodings.jsValue() + object[Strings.direction] = direction.jsValue + object[Strings.streams] = streams.jsValue + object[Strings.sendEncodings] = sendEncodings.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift index edaab7df..0a5efcb6 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCRtpTransceiverStats: BridgedDictionary { public convenience init(senderId: String, receiverId: String, mid: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.senderId] = senderId.jsValue() - object[Strings.receiverId] = receiverId.jsValue() - object[Strings.mid] = mid.jsValue() + object[Strings.senderId] = senderId.jsValue + object[Strings.receiverId] = receiverId.jsValue + object[Strings.mid] = mid.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransform.swift b/Sources/DOMKit/WebIDL/RTCRtpTransform.swift index b4c7e459..1d2a895b 100644 --- a/Sources/DOMKit/WebIDL/RTCRtpTransform.swift +++ b/Sources/DOMKit/WebIDL/RTCRtpTransform.swift @@ -21,12 +21,12 @@ public enum RTCRtpTransform: JSValueCompatible, Any_RTCRtpTransform { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .rTCRtpScriptTransform(rTCRtpScriptTransform): - return rTCRtpScriptTransform.jsValue() + return rTCRtpScriptTransform.jsValue case let .sFrameTransform(sFrameTransform): - return sFrameTransform.jsValue() + return sFrameTransform.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift b/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift index 47a0345f..8b4c2e04 100644 --- a/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift +++ b/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift @@ -19,5 +19,5 @@ public enum RTCSctpTransportState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift b/Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift index 916ea820..0950e508 100644 --- a/Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift +++ b/Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class RTCSctpTransportStats: BridgedDictionary { public convenience init(transportId: String, smoothedRoundTripTime: Double, congestionWindow: UInt32, receiverWindow: UInt32, mtu: UInt32, unackData: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transportId] = transportId.jsValue() - object[Strings.smoothedRoundTripTime] = smoothedRoundTripTime.jsValue() - object[Strings.congestionWindow] = congestionWindow.jsValue() - object[Strings.receiverWindow] = receiverWindow.jsValue() - object[Strings.mtu] = mtu.jsValue() - object[Strings.unackData] = unackData.jsValue() + object[Strings.transportId] = transportId.jsValue + object[Strings.smoothedRoundTripTime] = smoothedRoundTripTime.jsValue + object[Strings.congestionWindow] = congestionWindow.jsValue + object[Strings.receiverWindow] = receiverWindow.jsValue + object[Strings.mtu] = mtu.jsValue + object[Strings.unackData] = unackData.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCSdpType.swift b/Sources/DOMKit/WebIDL/RTCSdpType.swift index 69d0741a..95d13ae5 100644 --- a/Sources/DOMKit/WebIDL/RTCSdpType.swift +++ b/Sources/DOMKit/WebIDL/RTCSdpType.swift @@ -20,5 +20,5 @@ public enum RTCSdpType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift index 3d0232f5..854586f5 100644 --- a/Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift +++ b/Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCSentRtpStreamStats: BridgedDictionary { public convenience init(packetsSent: UInt32, bytesSent: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.packetsSent] = packetsSent.jsValue() - object[Strings.bytesSent] = bytesSent.jsValue() + object[Strings.packetsSent] = packetsSent.jsValue + object[Strings.bytesSent] = bytesSent.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift index 27e5c6f8..079654a7 100644 --- a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift +++ b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift @@ -15,7 +15,7 @@ public class RTCSessionDescription: JSBridgedClass { } @inlinable public convenience init(descriptionInitDict: RTCSessionDescriptionInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptionInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptionInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift b/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift index b17c7081..94039695 100644 --- a/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift +++ b/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RTCSessionDescriptionInit: BridgedDictionary { public convenience init(type: RTCSdpType, sdp: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.sdp] = sdp.jsValue() + object[Strings.type] = type.jsValue + object[Strings.sdp] = sdp.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCSignalingState.swift b/Sources/DOMKit/WebIDL/RTCSignalingState.swift index dd6136bf..cc377a28 100644 --- a/Sources/DOMKit/WebIDL/RTCSignalingState.swift +++ b/Sources/DOMKit/WebIDL/RTCSignalingState.swift @@ -22,5 +22,5 @@ public enum RTCSignalingState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCStats.swift b/Sources/DOMKit/WebIDL/RTCStats.swift index a0aaedd0..4035f9d0 100644 --- a/Sources/DOMKit/WebIDL/RTCStats.swift +++ b/Sources/DOMKit/WebIDL/RTCStats.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RTCStats: BridgedDictionary { public convenience init(timestamp: DOMHighResTimeStamp, type: RTCStatsType, id: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue() - object[Strings.type] = type.jsValue() - object[Strings.id] = id.jsValue() + object[Strings.timestamp] = timestamp.jsValue + object[Strings.type] = type.jsValue + object[Strings.id] = id.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift b/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift index c7cf618d..0e4c8719 100644 --- a/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift +++ b/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift @@ -21,5 +21,5 @@ public enum RTCStatsIceCandidatePairState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCStatsType.swift b/Sources/DOMKit/WebIDL/RTCStatsType.swift index 6ff7802b..aee82e6f 100644 --- a/Sources/DOMKit/WebIDL/RTCStatsType.swift +++ b/Sources/DOMKit/WebIDL/RTCStatsType.swift @@ -37,5 +37,5 @@ public enum RTCStatsType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RTCTrackEvent.swift b/Sources/DOMKit/WebIDL/RTCTrackEvent.swift index 0067a094..f8c0694d 100644 --- a/Sources/DOMKit/WebIDL/RTCTrackEvent.swift +++ b/Sources/DOMKit/WebIDL/RTCTrackEvent.swift @@ -15,7 +15,7 @@ public class RTCTrackEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: RTCTrackEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift b/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift index afaedfe2..8743372d 100644 --- a/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift +++ b/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RTCTrackEventInit: BridgedDictionary { public convenience init(receiver: RTCRtpReceiver, track: MediaStreamTrack, streams: [MediaStream], transceiver: RTCRtpTransceiver) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.receiver] = receiver.jsValue() - object[Strings.track] = track.jsValue() - object[Strings.streams] = streams.jsValue() - object[Strings.transceiver] = transceiver.jsValue() + object[Strings.receiver] = receiver.jsValue + object[Strings.track] = track.jsValue + object[Strings.streams] = streams.jsValue + object[Strings.transceiver] = transceiver.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCTransportStats.swift b/Sources/DOMKit/WebIDL/RTCTransportStats.swift index 3fbab231..90ea2335 100644 --- a/Sources/DOMKit/WebIDL/RTCTransportStats.swift +++ b/Sources/DOMKit/WebIDL/RTCTransportStats.swift @@ -6,23 +6,23 @@ import JavaScriptKit public class RTCTransportStats: BridgedDictionary { public convenience init(packetsSent: UInt64, packetsReceived: UInt64, bytesSent: UInt64, bytesReceived: UInt64, rtcpTransportStatsId: String, iceRole: RTCIceRole, iceLocalUsernameFragment: String, dtlsState: RTCDtlsTransportState, iceState: RTCIceTransportState, selectedCandidatePairId: String, localCertificateId: String, remoteCertificateId: String, tlsVersion: String, dtlsCipher: String, srtpCipher: String, tlsGroup: String, selectedCandidatePairChanges: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.packetsSent] = packetsSent.jsValue() - object[Strings.packetsReceived] = packetsReceived.jsValue() - object[Strings.bytesSent] = bytesSent.jsValue() - object[Strings.bytesReceived] = bytesReceived.jsValue() - object[Strings.rtcpTransportStatsId] = rtcpTransportStatsId.jsValue() - object[Strings.iceRole] = iceRole.jsValue() - object[Strings.iceLocalUsernameFragment] = iceLocalUsernameFragment.jsValue() - object[Strings.dtlsState] = dtlsState.jsValue() - object[Strings.iceState] = iceState.jsValue() - object[Strings.selectedCandidatePairId] = selectedCandidatePairId.jsValue() - object[Strings.localCertificateId] = localCertificateId.jsValue() - object[Strings.remoteCertificateId] = remoteCertificateId.jsValue() - object[Strings.tlsVersion] = tlsVersion.jsValue() - object[Strings.dtlsCipher] = dtlsCipher.jsValue() - object[Strings.srtpCipher] = srtpCipher.jsValue() - object[Strings.tlsGroup] = tlsGroup.jsValue() - object[Strings.selectedCandidatePairChanges] = selectedCandidatePairChanges.jsValue() + object[Strings.packetsSent] = packetsSent.jsValue + object[Strings.packetsReceived] = packetsReceived.jsValue + object[Strings.bytesSent] = bytesSent.jsValue + object[Strings.bytesReceived] = bytesReceived.jsValue + object[Strings.rtcpTransportStatsId] = rtcpTransportStatsId.jsValue + object[Strings.iceRole] = iceRole.jsValue + object[Strings.iceLocalUsernameFragment] = iceLocalUsernameFragment.jsValue + object[Strings.dtlsState] = dtlsState.jsValue + object[Strings.iceState] = iceState.jsValue + object[Strings.selectedCandidatePairId] = selectedCandidatePairId.jsValue + object[Strings.localCertificateId] = localCertificateId.jsValue + object[Strings.remoteCertificateId] = remoteCertificateId.jsValue + object[Strings.tlsVersion] = tlsVersion.jsValue + object[Strings.dtlsCipher] = dtlsCipher.jsValue + object[Strings.srtpCipher] = srtpCipher.jsValue + object[Strings.tlsGroup] = tlsGroup.jsValue + object[Strings.selectedCandidatePairChanges] = selectedCandidatePairChanges.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift b/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift index d8a5724e..4ff128e3 100644 --- a/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift +++ b/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RTCVideoSenderStats: BridgedDictionary { public convenience init(mediaSourceId: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaSourceId] = mediaSourceId.jsValue() + object[Strings.mediaSourceId] = mediaSourceId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift b/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift index 17a049a0..e6b1af60 100644 --- a/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift +++ b/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class RTCVideoSourceStats: BridgedDictionary { public convenience init(width: UInt32, height: UInt32, bitDepth: UInt32, frames: UInt32, framesPerSecond: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.width] = width.jsValue() - object[Strings.height] = height.jsValue() - object[Strings.bitDepth] = bitDepth.jsValue() - object[Strings.frames] = frames.jsValue() - object[Strings.framesPerSecond] = framesPerSecond.jsValue() + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.bitDepth] = bitDepth.jsValue + object[Strings.frames] = frames.jsValue + object[Strings.framesPerSecond] = framesPerSecond.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 9b14c6d7..63ac21f0 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -13,7 +13,7 @@ public class Range: AbstractRange { @inlinable public func createContextualFragment(fragment: String) -> DocumentFragment { let this = jsObject - return this[Strings.createContextualFragment].function!(this: this, arguments: [fragment.jsValue()]).fromJSValue()! + return this[Strings.createContextualFragment].function!(this: this, arguments: [fragment.jsValue]).fromJSValue()! } @inlinable public func getClientRects() -> DOMRectList { @@ -35,47 +35,47 @@ public class Range: AbstractRange { @inlinable public func setStart(node: Node, offset: UInt32) { let this = jsObject - _ = this[Strings.setStart].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]) + _ = this[Strings.setStart].function!(this: this, arguments: [node.jsValue, offset.jsValue]) } @inlinable public func setEnd(node: Node, offset: UInt32) { let this = jsObject - _ = this[Strings.setEnd].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]) + _ = this[Strings.setEnd].function!(this: this, arguments: [node.jsValue, offset.jsValue]) } @inlinable public func setStartBefore(node: Node) { let this = jsObject - _ = this[Strings.setStartBefore].function!(this: this, arguments: [node.jsValue()]) + _ = this[Strings.setStartBefore].function!(this: this, arguments: [node.jsValue]) } @inlinable public func setStartAfter(node: Node) { let this = jsObject - _ = this[Strings.setStartAfter].function!(this: this, arguments: [node.jsValue()]) + _ = this[Strings.setStartAfter].function!(this: this, arguments: [node.jsValue]) } @inlinable public func setEndBefore(node: Node) { let this = jsObject - _ = this[Strings.setEndBefore].function!(this: this, arguments: [node.jsValue()]) + _ = this[Strings.setEndBefore].function!(this: this, arguments: [node.jsValue]) } @inlinable public func setEndAfter(node: Node) { let this = jsObject - _ = this[Strings.setEndAfter].function!(this: this, arguments: [node.jsValue()]) + _ = this[Strings.setEndAfter].function!(this: this, arguments: [node.jsValue]) } @inlinable public func collapse(toStart: Bool? = nil) { let this = jsObject - _ = this[Strings.collapse].function!(this: this, arguments: [toStart?.jsValue() ?? .undefined]) + _ = this[Strings.collapse].function!(this: this, arguments: [toStart?.jsValue ?? .undefined]) } @inlinable public func selectNode(node: Node) { let this = jsObject - _ = this[Strings.selectNode].function!(this: this, arguments: [node.jsValue()]) + _ = this[Strings.selectNode].function!(this: this, arguments: [node.jsValue]) } @inlinable public func selectNodeContents(node: Node) { let this = jsObject - _ = this[Strings.selectNodeContents].function!(this: this, arguments: [node.jsValue()]) + _ = this[Strings.selectNodeContents].function!(this: this, arguments: [node.jsValue]) } public static let START_TO_START: UInt16 = 0 @@ -88,7 +88,7 @@ public class Range: AbstractRange { @inlinable public func compareBoundaryPoints(how: UInt16, sourceRange: Range) -> Int16 { let this = jsObject - return this[Strings.compareBoundaryPoints].function!(this: this, arguments: [how.jsValue(), sourceRange.jsValue()]).fromJSValue()! + return this[Strings.compareBoundaryPoints].function!(this: this, arguments: [how.jsValue, sourceRange.jsValue]).fromJSValue()! } @inlinable public func deleteContents() { @@ -108,12 +108,12 @@ public class Range: AbstractRange { @inlinable public func insertNode(node: Node) { let this = jsObject - _ = this[Strings.insertNode].function!(this: this, arguments: [node.jsValue()]) + _ = this[Strings.insertNode].function!(this: this, arguments: [node.jsValue]) } @inlinable public func surroundContents(newParent: Node) { let this = jsObject - _ = this[Strings.surroundContents].function!(this: this, arguments: [newParent.jsValue()]) + _ = this[Strings.surroundContents].function!(this: this, arguments: [newParent.jsValue]) } @inlinable public func cloneRange() -> Self { @@ -128,17 +128,17 @@ public class Range: AbstractRange { @inlinable public func isPointInRange(node: Node, offset: UInt32) -> Bool { let this = jsObject - return this[Strings.isPointInRange].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]).fromJSValue()! + return this[Strings.isPointInRange].function!(this: this, arguments: [node.jsValue, offset.jsValue]).fromJSValue()! } @inlinable public func comparePoint(node: Node, offset: UInt32) -> Int16 { let this = jsObject - return this[Strings.comparePoint].function!(this: this, arguments: [node.jsValue(), offset.jsValue()]).fromJSValue()! + return this[Strings.comparePoint].function!(this: this, arguments: [node.jsValue, offset.jsValue]).fromJSValue()! } @inlinable public func intersectsNode(node: Node) -> Bool { let this = jsObject - return this[Strings.intersectsNode].function!(this: this, arguments: [node.jsValue()]).fromJSValue()! + return this[Strings.intersectsNode].function!(this: this, arguments: [node.jsValue]).fromJSValue()! } @inlinable public var description: String { diff --git a/Sources/DOMKit/WebIDL/ReadOptions.swift b/Sources/DOMKit/WebIDL/ReadOptions.swift index 55e68472..ff9093d0 100644 --- a/Sources/DOMKit/WebIDL/ReadOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ReadOptions: BridgedDictionary { public convenience init(signal: AbortSignal?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue() + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift index ee1ac41c..81277212 100644 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift @@ -27,11 +27,11 @@ public class ReadableByteStreamController: JSBridgedClass { @inlinable public func enqueue(chunk: ArrayBufferView) { let this = jsObject - _ = this[Strings.enqueue].function!(this: this, arguments: [chunk.jsValue()]) + _ = 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]) + _ = this[Strings.error].function!(this: this, arguments: [e?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStream.swift b/Sources/DOMKit/WebIDL/ReadableStream.swift index d098200c..c14936b2 100644 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ b/Sources/DOMKit/WebIDL/ReadableStream.swift @@ -14,7 +14,7 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { } @inlinable public convenience init(underlyingSource: JSObject? = nil, strategy: QueuingStrategy? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [underlyingSource?.jsValue() ?? .undefined, strategy?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [underlyingSource?.jsValue ?? .undefined, strategy?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -22,36 +22,36 @@ public class ReadableStream: JSBridgedClass, AsyncSequence { @inlinable public func cancel(reason: JSValue? = nil) -> JSPromise { let this = jsObject - return this[Strings.cancel].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! + 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.get() + 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()! + 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()! + 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()! + 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.get() + 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] { diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift index 79a2dcaa..63ef6097 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift @@ -6,8 +6,8 @@ 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() + object[Strings.value] = value.jsValue + object[Strings.done] = done.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift index 060edb0c..588d7eb2 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift @@ -13,19 +13,19 @@ public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericRead } @inlinable public convenience init(stream: ReadableStream) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) + 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()! + 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.get().fromJSValue()! + let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: [view.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func releaseLock() { diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift index 0df74238..9a1d23f6 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift @@ -18,11 +18,11 @@ public class ReadableStreamBYOBRequest: JSBridgedClass { @inlinable public func respond(bytesWritten: UInt64) { let this = jsObject - _ = this[Strings.respond].function!(this: this, arguments: [bytesWritten.jsValue()]) + _ = 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()]) + _ = this[Strings.respondWithNewView].function!(this: this, arguments: [view.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamController.swift b/Sources/DOMKit/WebIDL/ReadableStreamController.swift index 8c01391f..beab5a57 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamController.swift @@ -21,12 +21,12 @@ public enum ReadableStreamController: JSValueCompatible, Any_ReadableStreamContr return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .readableByteStreamController(readableByteStreamController): - return readableByteStreamController.jsValue() + return readableByteStreamController.jsValue case let .readableStreamDefaultController(readableStreamDefaultController): - return readableStreamDefaultController.jsValue() + return readableStreamDefaultController.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift index fdb40d13..0b2c0f9d 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift @@ -23,11 +23,11 @@ public class ReadableStreamDefaultController: JSBridgedClass { @inlinable public func enqueue(chunk: JSValue? = nil) { let this = jsObject - _ = this[Strings.enqueue].function!(this: this, arguments: [chunk?.jsValue() ?? .undefined]) + _ = 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]) + _ = this[Strings.error].function!(this: this, arguments: [e?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift index 348a0186..ea49a802 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift @@ -6,8 +6,8 @@ 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() + object[Strings.value] = value.jsValue + object[Strings.done] = done.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift index 45a41dc1..b4116c98 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift @@ -13,7 +13,7 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR } @inlinable public convenience init(stream: ReadableStream) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue])) } @inlinable public func read() -> JSPromise { @@ -25,7 +25,7 @@ public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericR @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.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func releaseLock() { diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift index 840ad641..d3206c23 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift @@ -9,13 +9,13 @@ public extension ReadableStreamGenericReader { @inlinable func cancel(reason: JSValue? = nil) -> JSPromise { let this = jsObject - return this[Strings.cancel].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! + 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.get() + 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 index 0c8f5e17..82edb7bc 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ReadableStreamGetReaderOptions: BridgedDictionary { public convenience init(mode: ReadableStreamReaderMode) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue() + object[Strings.mode] = mode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift index 2860743b..4ba41ccb 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ReadableStreamIteratorOptions: BridgedDictionary { public convenience init(preventCancel: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.preventCancel] = preventCancel.jsValue() + object[Strings.preventCancel] = preventCancel.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamReader.swift index 046f52c4..16d6ec44 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamReader.swift @@ -21,12 +21,12 @@ public enum ReadableStreamReader: JSValueCompatible, Any_ReadableStreamReader { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .readableStreamBYOBReader(readableStreamBYOBReader): - return readableStreamBYOBReader.jsValue() + return readableStreamBYOBReader.jsValue case let .readableStreamDefaultReader(readableStreamDefaultReader): - return readableStreamDefaultReader.jsValue() + return readableStreamDefaultReader.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift index e417ae53..2e2b80e3 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift @@ -17,5 +17,5 @@ public enum ReadableStreamReaderMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ReadableStreamType.swift b/Sources/DOMKit/WebIDL/ReadableStreamType.swift index a8a4d4c4..a2c88e92 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamType.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamType.swift @@ -17,5 +17,5 @@ public enum ReadableStreamType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift index 71f36327..fb2fb13b 100644 --- a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift +++ b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift @@ -6,8 +6,8 @@ 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() + object[Strings.readable] = readable.jsValue + object[Strings.writable] = writable.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ReadyState.swift b/Sources/DOMKit/WebIDL/ReadyState.swift index 8839409c..e61a7157 100644 --- a/Sources/DOMKit/WebIDL/ReadyState.swift +++ b/Sources/DOMKit/WebIDL/ReadyState.swift @@ -19,5 +19,5 @@ public enum ReadyState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RecordingState.swift b/Sources/DOMKit/WebIDL/RecordingState.swift index 6254b7b2..7e057605 100644 --- a/Sources/DOMKit/WebIDL/RecordingState.swift +++ b/Sources/DOMKit/WebIDL/RecordingState.swift @@ -19,5 +19,5 @@ public enum RecordingState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RedEyeReduction.swift b/Sources/DOMKit/WebIDL/RedEyeReduction.swift index 5d3fdd2d..a9f0cd37 100644 --- a/Sources/DOMKit/WebIDL/RedEyeReduction.swift +++ b/Sources/DOMKit/WebIDL/RedEyeReduction.swift @@ -19,5 +19,5 @@ public enum RedEyeReduction: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift index 6346a67a..c1e36114 100644 --- a/Sources/DOMKit/WebIDL/ReferrerPolicy.swift +++ b/Sources/DOMKit/WebIDL/ReferrerPolicy.swift @@ -25,5 +25,5 @@ public enum ReferrerPolicy: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RegistrationOptions.swift b/Sources/DOMKit/WebIDL/RegistrationOptions.swift index 853c81b4..97cfe75b 100644 --- a/Sources/DOMKit/WebIDL/RegistrationOptions.swift +++ b/Sources/DOMKit/WebIDL/RegistrationOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RegistrationOptions: BridgedDictionary { public convenience init(scope: String, type: WorkerType, updateViaCache: ServiceWorkerUpdateViaCache) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.scope] = scope.jsValue() - object[Strings.type] = type.jsValue() - object[Strings.updateViaCache] = updateViaCache.jsValue() + object[Strings.scope] = scope.jsValue + object[Strings.type] = type.jsValue + object[Strings.updateViaCache] = updateViaCache.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RelatedApplication.swift b/Sources/DOMKit/WebIDL/RelatedApplication.swift index f97664b0..b9a47d7d 100644 --- a/Sources/DOMKit/WebIDL/RelatedApplication.swift +++ b/Sources/DOMKit/WebIDL/RelatedApplication.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RelatedApplication: BridgedDictionary { public convenience init(platform: String, url: String, id: String, version: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.platform] = platform.jsValue() - object[Strings.url] = url.jsValue() - object[Strings.id] = id.jsValue() - object[Strings.version] = version.jsValue() + object[Strings.platform] = platform.jsValue + object[Strings.url] = url.jsValue + object[Strings.id] = id.jsValue + object[Strings.version] = version.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift b/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift index 206950cc..179fdb96 100644 --- a/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift +++ b/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift @@ -11,6 +11,6 @@ public class RelativeOrientationSensor: OrientationSensor { } @inlinable public convenience init(sensorOptions: OrientationSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/RemotePlayback.swift b/Sources/DOMKit/WebIDL/RemotePlayback.swift index f0fc09d6..45810a18 100644 --- a/Sources/DOMKit/WebIDL/RemotePlayback.swift +++ b/Sources/DOMKit/WebIDL/RemotePlayback.swift @@ -20,14 +20,14 @@ public class RemotePlayback: EventTarget { @inlinable public func cancelWatchAvailability(id: Int32? = nil) -> JSPromise { let this = jsObject - return this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func cancelWatchAvailability(id: Int32? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @ReadonlyAttribute @@ -51,6 +51,6 @@ public class RemotePlayback: EventTarget { @inlinable public func prompt() async throws { let this = jsObject let _promise: JSPromise = this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/RemotePlaybackState.swift b/Sources/DOMKit/WebIDL/RemotePlaybackState.swift index 2c20a6bc..cfea0faa 100644 --- a/Sources/DOMKit/WebIDL/RemotePlaybackState.swift +++ b/Sources/DOMKit/WebIDL/RemotePlaybackState.swift @@ -19,5 +19,5 @@ public enum RemotePlaybackState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RenderingContext.swift b/Sources/DOMKit/WebIDL/RenderingContext.swift index 15d96965..3653bb19 100644 --- a/Sources/DOMKit/WebIDL/RenderingContext.swift +++ b/Sources/DOMKit/WebIDL/RenderingContext.swift @@ -36,18 +36,18 @@ public enum RenderingContext: JSValueCompatible, Any_RenderingContext { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .canvasRenderingContext2D(canvasRenderingContext2D): - return canvasRenderingContext2D.jsValue() + return canvasRenderingContext2D.jsValue case let .gPUCanvasContext(gPUCanvasContext): - return gPUCanvasContext.jsValue() + return gPUCanvasContext.jsValue case let .imageBitmapRenderingContext(imageBitmapRenderingContext): - return imageBitmapRenderingContext.jsValue() + return imageBitmapRenderingContext.jsValue case let .webGL2RenderingContext(webGL2RenderingContext): - return webGL2RenderingContext.jsValue() + return webGL2RenderingContext.jsValue case let .webGLRenderingContext(webGLRenderingContext): - return webGLRenderingContext.jsValue() + return webGLRenderingContext.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift b/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift index 1a4ff9cc..92df9f8d 100644 --- a/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift +++ b/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ReportingObserverOptions: BridgedDictionary { public convenience init(types: [String], buffered: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.types] = types.jsValue() - object[Strings.buffered] = buffered.jsValue() + object[Strings.types] = types.jsValue + object[Strings.buffered] = buffered.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift index 73860a10..b060f112 100644 --- a/Sources/DOMKit/WebIDL/Request.swift +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -29,7 +29,7 @@ public class Request: JSBridgedClass, Body { } @inlinable public convenience init(input: RequestInfo, init: RequestInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [input.jsValue(), `init`?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [input.jsValue, `init`?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/RequestCache.swift b/Sources/DOMKit/WebIDL/RequestCache.swift index 603fe67c..72c158ac 100644 --- a/Sources/DOMKit/WebIDL/RequestCache.swift +++ b/Sources/DOMKit/WebIDL/RequestCache.swift @@ -22,5 +22,5 @@ public enum RequestCache: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RequestCredentials.swift b/Sources/DOMKit/WebIDL/RequestCredentials.swift index 750741b5..9af56520 100644 --- a/Sources/DOMKit/WebIDL/RequestCredentials.swift +++ b/Sources/DOMKit/WebIDL/RequestCredentials.swift @@ -19,5 +19,5 @@ public enum RequestCredentials: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RequestDestination.swift b/Sources/DOMKit/WebIDL/RequestDestination.swift index bd189b73..85676c49 100644 --- a/Sources/DOMKit/WebIDL/RequestDestination.swift +++ b/Sources/DOMKit/WebIDL/RequestDestination.swift @@ -36,5 +36,5 @@ public enum RequestDestination: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift b/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift index 3e6e7058..9ed8ddd1 100644 --- a/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift +++ b/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class RequestDeviceOptions: BridgedDictionary { public convenience init(filters: [BluetoothLEScanFilterInit], optionalServices: [BluetoothServiceUUID], optionalManufacturerData: [UInt16], acceptAllDevices: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue() - object[Strings.optionalServices] = optionalServices.jsValue() - object[Strings.optionalManufacturerData] = optionalManufacturerData.jsValue() - object[Strings.acceptAllDevices] = acceptAllDevices.jsValue() + object[Strings.filters] = filters.jsValue + object[Strings.optionalServices] = optionalServices.jsValue + object[Strings.optionalManufacturerData] = optionalManufacturerData.jsValue + object[Strings.acceptAllDevices] = acceptAllDevices.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RequestInfo.swift b/Sources/DOMKit/WebIDL/RequestInfo.swift index c4fb4ef8..6748724a 100644 --- a/Sources/DOMKit/WebIDL/RequestInfo.swift +++ b/Sources/DOMKit/WebIDL/RequestInfo.swift @@ -21,12 +21,12 @@ public enum RequestInfo: JSValueCompatible, Any_RequestInfo { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .request(request): - return request.jsValue() + return request.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift b/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift index e51321d4..a5030ad2 100644 --- a/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift +++ b/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift @@ -21,12 +21,12 @@ public enum RequestInfo_or_seq_of_RequestInfo: JSValueCompatible, Any_RequestInf return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .requestInfo(requestInfo): - return requestInfo.jsValue() + return requestInfo.jsValue case let .seq_of_RequestInfo(seq_of_RequestInfo): - return seq_of_RequestInfo.jsValue() + return seq_of_RequestInfo.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/RequestInit.swift b/Sources/DOMKit/WebIDL/RequestInit.swift index 054f4e39..be07f0fa 100644 --- a/Sources/DOMKit/WebIDL/RequestInit.swift +++ b/Sources/DOMKit/WebIDL/RequestInit.swift @@ -6,20 +6,20 @@ import JavaScriptKit public class RequestInit: BridgedDictionary { public convenience init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue, priority: FetchPriority) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.method] = method.jsValue() - object[Strings.headers] = headers.jsValue() - object[Strings.body] = body.jsValue() - object[Strings.referrer] = referrer.jsValue() - object[Strings.referrerPolicy] = referrerPolicy.jsValue() - object[Strings.mode] = mode.jsValue() - object[Strings.credentials] = credentials.jsValue() - object[Strings.cache] = cache.jsValue() - object[Strings.redirect] = redirect.jsValue() - object[Strings.integrity] = integrity.jsValue() - object[Strings.keepalive] = keepalive.jsValue() - object[Strings.signal] = signal.jsValue() - object[Strings.window] = window.jsValue() - object[Strings.priority] = priority.jsValue() + object[Strings.method] = method.jsValue + object[Strings.headers] = headers.jsValue + object[Strings.body] = body.jsValue + object[Strings.referrer] = referrer.jsValue + object[Strings.referrerPolicy] = referrerPolicy.jsValue + object[Strings.mode] = mode.jsValue + object[Strings.credentials] = credentials.jsValue + object[Strings.cache] = cache.jsValue + object[Strings.redirect] = redirect.jsValue + object[Strings.integrity] = integrity.jsValue + object[Strings.keepalive] = keepalive.jsValue + object[Strings.signal] = signal.jsValue + object[Strings.window] = window.jsValue + object[Strings.priority] = priority.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RequestMode.swift b/Sources/DOMKit/WebIDL/RequestMode.swift index 085511f1..cea0dc8b 100644 --- a/Sources/DOMKit/WebIDL/RequestMode.swift +++ b/Sources/DOMKit/WebIDL/RequestMode.swift @@ -20,5 +20,5 @@ public enum RequestMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RequestRedirect.swift b/Sources/DOMKit/WebIDL/RequestRedirect.swift index 44097a07..999e4065 100644 --- a/Sources/DOMKit/WebIDL/RequestRedirect.swift +++ b/Sources/DOMKit/WebIDL/RequestRedirect.swift @@ -19,5 +19,5 @@ public enum RequestRedirect: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift b/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift index 3f80d2e6..8393ba15 100644 --- a/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift +++ b/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift @@ -19,5 +19,5 @@ public enum ResidentKeyRequirement: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ResizeObserver.swift b/Sources/DOMKit/WebIDL/ResizeObserver.swift index c03b0612..f53c89d7 100644 --- a/Sources/DOMKit/WebIDL/ResizeObserver.swift +++ b/Sources/DOMKit/WebIDL/ResizeObserver.swift @@ -16,12 +16,12 @@ public class ResizeObserver: JSBridgedClass { @inlinable public func observe(target: Element, options: ResizeObserverOptions? = nil) { let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue, options?.jsValue ?? .undefined]) } @inlinable public func unobserve(target: Element) { let this = jsObject - _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue()]) + _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue]) } @inlinable public func disconnect() { diff --git a/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift b/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift index 64adb223..cdc11842 100644 --- a/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift +++ b/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift @@ -19,5 +19,5 @@ public enum ResizeObserverBoxOptions: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift b/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift index c28b64cc..3e650e53 100644 --- a/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift +++ b/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ResizeObserverOptions: BridgedDictionary { public convenience init(box: ResizeObserverBoxOptions) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.box] = box.jsValue() + object[Strings.box] = box.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ResizeQuality.swift b/Sources/DOMKit/WebIDL/ResizeQuality.swift index 5f118472..2885fb64 100644 --- a/Sources/DOMKit/WebIDL/ResizeQuality.swift +++ b/Sources/DOMKit/WebIDL/ResizeQuality.swift @@ -20,5 +20,5 @@ public enum ResizeQuality: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Response.swift b/Sources/DOMKit/WebIDL/Response.swift index 935ad7c0..758d1166 100644 --- a/Sources/DOMKit/WebIDL/Response.swift +++ b/Sources/DOMKit/WebIDL/Response.swift @@ -20,7 +20,7 @@ public class Response: JSBridgedClass, Body { } @inlinable public convenience init(body: BodyInit? = nil, init: ResponseInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [body?.jsValue() ?? .undefined, `init`?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [body?.jsValue ?? .undefined, `init`?.jsValue ?? .undefined])) } @inlinable public static func error() -> Self { @@ -30,7 +30,7 @@ public class Response: JSBridgedClass, Body { @inlinable public static func redirect(url: String, status: UInt16? = nil) -> Self { let this = constructor - return this[Strings.redirect].function!(this: this, arguments: [url.jsValue(), status?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.redirect].function!(this: this, arguments: [url.jsValue, status?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ResponseInit.swift b/Sources/DOMKit/WebIDL/ResponseInit.swift index 1ddc700c..d2da62c2 100644 --- a/Sources/DOMKit/WebIDL/ResponseInit.swift +++ b/Sources/DOMKit/WebIDL/ResponseInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class ResponseInit: BridgedDictionary { public convenience init(status: UInt16, statusText: String, headers: HeadersInit) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.status] = status.jsValue() - object[Strings.statusText] = statusText.jsValue() - object[Strings.headers] = headers.jsValue() + object[Strings.status] = status.jsValue + object[Strings.statusText] = statusText.jsValue + object[Strings.headers] = headers.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ResponseType.swift b/Sources/DOMKit/WebIDL/ResponseType.swift index 8f0f2293..912d993a 100644 --- a/Sources/DOMKit/WebIDL/ResponseType.swift +++ b/Sources/DOMKit/WebIDL/ResponseType.swift @@ -22,5 +22,5 @@ public enum ResponseType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift b/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift index 541cf8fd..6c9b47b2 100644 --- a/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift +++ b/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RsaHashedImportParams: BridgedDictionary { public convenience init(hash: HashAlgorithmIdentifier) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue() + object[Strings.hash] = hash.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift index ec8531e9..ac2475c5 100644 --- a/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift +++ b/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RsaHashedKeyAlgorithm: BridgedDictionary { public convenience init(hash: KeyAlgorithm) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue() + object[Strings.hash] = hash.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift b/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift index 749e154a..974e14bf 100644 --- a/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift +++ b/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RsaHashedKeyGenParams: BridgedDictionary { public convenience init(hash: HashAlgorithmIdentifier) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue() + object[Strings.hash] = hash.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift index 52d0203a..5e2d64e7 100644 --- a/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift +++ b/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RsaKeyAlgorithm: BridgedDictionary { public convenience init(modulusLength: UInt32, publicExponent: BigInteger) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.modulusLength] = modulusLength.jsValue() - object[Strings.publicExponent] = publicExponent.jsValue() + object[Strings.modulusLength] = modulusLength.jsValue + object[Strings.publicExponent] = publicExponent.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift b/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift index 7984b7fc..9c3f2dd1 100644 --- a/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift +++ b/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class RsaKeyGenParams: BridgedDictionary { public convenience init(modulusLength: UInt32, publicExponent: BigInteger) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.modulusLength] = modulusLength.jsValue() - object[Strings.publicExponent] = publicExponent.jsValue() + object[Strings.modulusLength] = modulusLength.jsValue + object[Strings.publicExponent] = publicExponent.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RsaOaepParams.swift b/Sources/DOMKit/WebIDL/RsaOaepParams.swift index d6e300bf..12e41e55 100644 --- a/Sources/DOMKit/WebIDL/RsaOaepParams.swift +++ b/Sources/DOMKit/WebIDL/RsaOaepParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RsaOaepParams: BridgedDictionary { public convenience init(label: BufferSource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue() + object[Strings.label] = label.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift b/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift index 720b2eba..b3ac8fa3 100644 --- a/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift +++ b/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class RsaOtherPrimesInfo: BridgedDictionary { public convenience init(r: String, d: String, t: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.r] = r.jsValue() - object[Strings.d] = d.jsValue() - object[Strings.t] = t.jsValue() + object[Strings.r] = r.jsValue + object[Strings.d] = d.jsValue + object[Strings.t] = t.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/RsaPssParams.swift b/Sources/DOMKit/WebIDL/RsaPssParams.swift index 03270afd..f92a9b95 100644 --- a/Sources/DOMKit/WebIDL/RsaPssParams.swift +++ b/Sources/DOMKit/WebIDL/RsaPssParams.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class RsaPssParams: BridgedDictionary { public convenience init(saltLength: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.saltLength] = saltLength.jsValue() + object[Strings.saltLength] = saltLength.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SFrameTransform.swift b/Sources/DOMKit/WebIDL/SFrameTransform.swift index 10e14143..4d01afc7 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransform.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransform.swift @@ -14,19 +14,19 @@ public class SFrameTransform: JSBridgedClass, GenericTransformStream { } @inlinable public convenience init(options: SFrameTransformOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @inlinable public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) -> JSPromise { let this = jsObject - return this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue(), keyID?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue, keyID?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue(), keyID?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue, keyID?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift index 08347b9c..2738a4d7 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift @@ -14,7 +14,7 @@ public class SFrameTransformErrorEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: SFrameTransformErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift index 2c6a40ed..f712406d 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class SFrameTransformErrorEventInit: BridgedDictionary { public convenience init(errorType: SFrameTransformErrorEventType, frame: JSValue, keyID: CryptoKeyID?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.errorType] = errorType.jsValue() - object[Strings.frame] = frame.jsValue() - object[Strings.keyID] = keyID.jsValue() + object[Strings.errorType] = errorType.jsValue + object[Strings.frame] = frame.jsValue + object[Strings.keyID] = keyID.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift index 2836106e..3b52fba0 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift @@ -19,5 +19,5 @@ public enum SFrameTransformErrorEventType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/SFrameTransformOptions.swift b/Sources/DOMKit/WebIDL/SFrameTransformOptions.swift index 58c613fa..5a9978f5 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransformOptions.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransformOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class SFrameTransformOptions: BridgedDictionary { public convenience init(role: SFrameTransformRole) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.role] = role.jsValue() + object[Strings.role] = role.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SFrameTransformRole.swift b/Sources/DOMKit/WebIDL/SFrameTransformRole.swift index 72e0e1bd..50997bda 100644 --- a/Sources/DOMKit/WebIDL/SFrameTransformRole.swift +++ b/Sources/DOMKit/WebIDL/SFrameTransformRole.swift @@ -18,5 +18,5 @@ public enum SFrameTransformRole: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/SVGAngle.swift b/Sources/DOMKit/WebIDL/SVGAngle.swift index 4985eb77..22490a6c 100644 --- a/Sources/DOMKit/WebIDL/SVGAngle.swift +++ b/Sources/DOMKit/WebIDL/SVGAngle.swift @@ -40,11 +40,11 @@ public class SVGAngle: JSBridgedClass { @inlinable public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { let this = jsObject - _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue(), valueInSpecifiedUnits.jsValue()]) + _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue, valueInSpecifiedUnits.jsValue]) } @inlinable public func convertToSpecifiedUnits(unitType: UInt16) { let this = jsObject - _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue()]) + _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift index aa741b4e..85c4f074 100644 --- a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift +++ b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift @@ -48,7 +48,7 @@ public class SVGAnimationElement: SVGElement, SVGTests { @inlinable public func beginElementAt(offset: Float) { let this = jsObject - _ = this[Strings.beginElementAt].function!(this: this, arguments: [offset.jsValue()]) + _ = this[Strings.beginElementAt].function!(this: this, arguments: [offset.jsValue]) } @inlinable public func endElement() { @@ -58,6 +58,6 @@ public class SVGAnimationElement: SVGElement, SVGTests { @inlinable public func endElementAt(offset: Float) { let this = jsObject - _ = this[Strings.endElementAt].function!(this: this, arguments: [offset.jsValue()]) + _ = this[Strings.endElementAt].function!(this: this, arguments: [offset.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift b/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift index 87a274ff..682c82f2 100644 --- a/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift +++ b/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class SVGBoundingBoxOptions: BridgedDictionary { public convenience init(fill: Bool, stroke: Bool, markers: Bool, clipped: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fill] = fill.jsValue() - object[Strings.stroke] = stroke.jsValue() - object[Strings.markers] = markers.jsValue() - object[Strings.clipped] = clipped.jsValue() + object[Strings.fill] = fill.jsValue + object[Strings.stroke] = stroke.jsValue + object[Strings.markers] = markers.jsValue + object[Strings.clipped] = clipped.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift b/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift index 7004496f..27c3f5e4 100644 --- a/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift @@ -32,6 +32,6 @@ public class SVGFEDropShadowElement: SVGElement, SVGFilterPrimitiveStandardAttri @inlinable public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { let this = jsObject - _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue(), stdDeviationY.jsValue()]) + _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue, stdDeviationY.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift b/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift index 2ebb4f3d..da889749 100644 --- a/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift +++ b/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift @@ -36,6 +36,6 @@ public class SVGFEGaussianBlurElement: SVGElement, SVGFilterPrimitiveStandardAtt @inlinable public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { let this = jsObject - _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue(), stdDeviationY.jsValue()]) + _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue, stdDeviationY.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SVGGeometryElement.swift b/Sources/DOMKit/WebIDL/SVGGeometryElement.swift index 8954450a..b604708c 100644 --- a/Sources/DOMKit/WebIDL/SVGGeometryElement.swift +++ b/Sources/DOMKit/WebIDL/SVGGeometryElement.swift @@ -16,12 +16,12 @@ public class SVGGeometryElement: SVGGraphicsElement { @inlinable public func isPointInFill(point: DOMPointInit? = nil) -> Bool { let this = jsObject - return this[Strings.isPointInFill].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.isPointInFill].function!(this: this, arguments: [point?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func isPointInStroke(point: DOMPointInit? = nil) -> Bool { let this = jsObject - return this[Strings.isPointInStroke].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.isPointInStroke].function!(this: this, arguments: [point?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func getTotalLength() -> Float { @@ -31,6 +31,6 @@ public class SVGGeometryElement: SVGGraphicsElement { @inlinable public func getPointAtLength(distance: Float) -> DOMPoint { let this = jsObject - return this[Strings.getPointAtLength].function!(this: this, arguments: [distance.jsValue()]).fromJSValue()! + return this[Strings.getPointAtLength].function!(this: this, arguments: [distance.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift b/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift index 4ffc70b5..40f0b8f8 100644 --- a/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift +++ b/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift @@ -16,7 +16,7 @@ public class SVGGraphicsElement: SVGElement, SVGTests { @inlinable public func getBBox(options: SVGBoundingBoxOptions? = nil) -> DOMRect { let this = jsObject - return this[Strings.getBBox].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getBBox].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func getCTM() -> DOMMatrix? { diff --git a/Sources/DOMKit/WebIDL/SVGLength.swift b/Sources/DOMKit/WebIDL/SVGLength.swift index a68862b4..d498133a 100644 --- a/Sources/DOMKit/WebIDL/SVGLength.swift +++ b/Sources/DOMKit/WebIDL/SVGLength.swift @@ -52,11 +52,11 @@ public class SVGLength: JSBridgedClass { @inlinable public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { let this = jsObject - _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue(), valueInSpecifiedUnits.jsValue()]) + _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue, valueInSpecifiedUnits.jsValue]) } @inlinable public func convertToSpecifiedUnits(unitType: UInt16) { let this = jsObject - _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue()]) + _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SVGLengthList.swift b/Sources/DOMKit/WebIDL/SVGLengthList.swift index af78e83e..003689b9 100644 --- a/Sources/DOMKit/WebIDL/SVGLengthList.swift +++ b/Sources/DOMKit/WebIDL/SVGLengthList.swift @@ -27,7 +27,7 @@ public class SVGLengthList: JSBridgedClass { @inlinable public func initialize(newItem: SVGLength) -> SVGLength { let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } @inlinable public subscript(key: Int) -> SVGLength { @@ -36,22 +36,22 @@ public class SVGLengthList: JSBridgedClass { @inlinable public func insertItemBefore(newItem: SVGLength, index: UInt32) -> SVGLength { let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func replaceItem(newItem: SVGLength, index: UInt32) -> SVGLength { let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func removeItem(index: UInt32) -> SVGLength { let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } @inlinable public func appendItem(newItem: SVGLength) -> SVGLength { let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 diff --git a/Sources/DOMKit/WebIDL/SVGMarkerElement.swift b/Sources/DOMKit/WebIDL/SVGMarkerElement.swift index f650bdcd..bf908210 100644 --- a/Sources/DOMKit/WebIDL/SVGMarkerElement.swift +++ b/Sources/DOMKit/WebIDL/SVGMarkerElement.swift @@ -61,6 +61,6 @@ public class SVGMarkerElement: SVGElement, SVGFitToViewBox { @inlinable public func setOrientToAngle(angle: SVGAngle) { let this = jsObject - _ = this[Strings.setOrientToAngle].function!(this: this, arguments: [angle.jsValue()]) + _ = this[Strings.setOrientToAngle].function!(this: this, arguments: [angle.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SVGNumberList.swift b/Sources/DOMKit/WebIDL/SVGNumberList.swift index 3a478cc3..a9769598 100644 --- a/Sources/DOMKit/WebIDL/SVGNumberList.swift +++ b/Sources/DOMKit/WebIDL/SVGNumberList.swift @@ -27,7 +27,7 @@ public class SVGNumberList: JSBridgedClass { @inlinable public func initialize(newItem: SVGNumber) -> SVGNumber { let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } @inlinable public subscript(key: Int) -> SVGNumber { @@ -36,22 +36,22 @@ public class SVGNumberList: JSBridgedClass { @inlinable public func insertItemBefore(newItem: SVGNumber, index: UInt32) -> SVGNumber { let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func replaceItem(newItem: SVGNumber, index: UInt32) -> SVGNumber { let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func removeItem(index: UInt32) -> SVGNumber { let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } @inlinable public func appendItem(newItem: SVGNumber) -> SVGNumber { let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 diff --git a/Sources/DOMKit/WebIDL/SVGPointList.swift b/Sources/DOMKit/WebIDL/SVGPointList.swift index 66631c4b..e6527352 100644 --- a/Sources/DOMKit/WebIDL/SVGPointList.swift +++ b/Sources/DOMKit/WebIDL/SVGPointList.swift @@ -27,7 +27,7 @@ public class SVGPointList: JSBridgedClass { @inlinable public func initialize(newItem: DOMPoint) -> DOMPoint { let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } @inlinable public subscript(key: Int) -> DOMPoint { @@ -36,22 +36,22 @@ public class SVGPointList: JSBridgedClass { @inlinable public func insertItemBefore(newItem: DOMPoint, index: UInt32) -> DOMPoint { let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func replaceItem(newItem: DOMPoint, index: UInt32) -> DOMPoint { let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func removeItem(index: UInt32) -> DOMPoint { let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } @inlinable public func appendItem(newItem: DOMPoint) -> DOMPoint { let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 diff --git a/Sources/DOMKit/WebIDL/SVGSVGElement.swift b/Sources/DOMKit/WebIDL/SVGSVGElement.swift index e39334d9..e397e987 100644 --- a/Sources/DOMKit/WebIDL/SVGSVGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGSVGElement.swift @@ -36,22 +36,22 @@ public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHand @inlinable public func getIntersectionList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { let this = jsObject - return this[Strings.getIntersectionList].function!(this: this, arguments: [rect.jsValue(), referenceElement.jsValue()]).fromJSValue()! + return this[Strings.getIntersectionList].function!(this: this, arguments: [rect.jsValue, referenceElement.jsValue]).fromJSValue()! } @inlinable public func getEnclosureList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { let this = jsObject - return this[Strings.getEnclosureList].function!(this: this, arguments: [rect.jsValue(), referenceElement.jsValue()]).fromJSValue()! + return this[Strings.getEnclosureList].function!(this: this, arguments: [rect.jsValue, referenceElement.jsValue]).fromJSValue()! } @inlinable public func checkIntersection(element: SVGElement, rect: DOMRectReadOnly) -> Bool { let this = jsObject - return this[Strings.checkIntersection].function!(this: this, arguments: [element.jsValue(), rect.jsValue()]).fromJSValue()! + return this[Strings.checkIntersection].function!(this: this, arguments: [element.jsValue, rect.jsValue]).fromJSValue()! } @inlinable public func checkEnclosure(element: SVGElement, rect: DOMRectReadOnly) -> Bool { let this = jsObject - return this[Strings.checkEnclosure].function!(this: this, arguments: [element.jsValue(), rect.jsValue()]).fromJSValue()! + return this[Strings.checkEnclosure].function!(this: this, arguments: [element.jsValue, rect.jsValue]).fromJSValue()! } @inlinable public func deselectAll() { @@ -96,22 +96,22 @@ public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHand @inlinable public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { let this = jsObject - return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func getElementById(elementId: String) -> Element { let this = jsObject - return this[Strings.getElementById].function!(this: this, arguments: [elementId.jsValue()]).fromJSValue()! + return this[Strings.getElementById].function!(this: this, arguments: [elementId.jsValue]).fromJSValue()! } @inlinable public func suspendRedraw(maxWaitMilliseconds: UInt32) -> UInt32 { let this = jsObject - return this[Strings.suspendRedraw].function!(this: this, arguments: [maxWaitMilliseconds.jsValue()]).fromJSValue()! + return this[Strings.suspendRedraw].function!(this: this, arguments: [maxWaitMilliseconds.jsValue]).fromJSValue()! } @inlinable public func unsuspendRedraw(suspendHandleID: UInt32) { let this = jsObject - _ = this[Strings.unsuspendRedraw].function!(this: this, arguments: [suspendHandleID.jsValue()]) + _ = this[Strings.unsuspendRedraw].function!(this: this, arguments: [suspendHandleID.jsValue]) } @inlinable public func unsuspendRedrawAll() { @@ -146,6 +146,6 @@ public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHand @inlinable public func setCurrentTime(seconds: Float) { let this = jsObject - _ = this[Strings.setCurrentTime].function!(this: this, arguments: [seconds.jsValue()]) + _ = this[Strings.setCurrentTime].function!(this: this, arguments: [seconds.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SVGStringList.swift b/Sources/DOMKit/WebIDL/SVGStringList.swift index 9ee4d71e..56195983 100644 --- a/Sources/DOMKit/WebIDL/SVGStringList.swift +++ b/Sources/DOMKit/WebIDL/SVGStringList.swift @@ -27,7 +27,7 @@ public class SVGStringList: JSBridgedClass { @inlinable public func initialize(newItem: String) -> String { let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } @inlinable public subscript(key: Int) -> String { @@ -36,22 +36,22 @@ public class SVGStringList: JSBridgedClass { @inlinable public func insertItemBefore(newItem: String, index: UInt32) -> String { let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func replaceItem(newItem: String, index: UInt32) -> String { let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func removeItem(index: UInt32) -> String { let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } @inlinable public func appendItem(newItem: String) -> String { let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 diff --git a/Sources/DOMKit/WebIDL/SVGTextContentElement.swift b/Sources/DOMKit/WebIDL/SVGTextContentElement.swift index 2deb154c..b06704ff 100644 --- a/Sources/DOMKit/WebIDL/SVGTextContentElement.swift +++ b/Sources/DOMKit/WebIDL/SVGTextContentElement.swift @@ -36,36 +36,36 @@ public class SVGTextContentElement: SVGGraphicsElement { @inlinable public func getSubStringLength(charnum: UInt32, nchars: UInt32) -> Float { let this = jsObject - return this[Strings.getSubStringLength].function!(this: this, arguments: [charnum.jsValue(), nchars.jsValue()]).fromJSValue()! + return this[Strings.getSubStringLength].function!(this: this, arguments: [charnum.jsValue, nchars.jsValue]).fromJSValue()! } @inlinable public func getStartPositionOfChar(charnum: UInt32) -> DOMPoint { let this = jsObject - return this[Strings.getStartPositionOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! + return this[Strings.getStartPositionOfChar].function!(this: this, arguments: [charnum.jsValue]).fromJSValue()! } @inlinable public func getEndPositionOfChar(charnum: UInt32) -> DOMPoint { let this = jsObject - return this[Strings.getEndPositionOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! + return this[Strings.getEndPositionOfChar].function!(this: this, arguments: [charnum.jsValue]).fromJSValue()! } @inlinable public func getExtentOfChar(charnum: UInt32) -> DOMRect { let this = jsObject - return this[Strings.getExtentOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! + return this[Strings.getExtentOfChar].function!(this: this, arguments: [charnum.jsValue]).fromJSValue()! } @inlinable public func getRotationOfChar(charnum: UInt32) -> Float { let this = jsObject - return this[Strings.getRotationOfChar].function!(this: this, arguments: [charnum.jsValue()]).fromJSValue()! + return this[Strings.getRotationOfChar].function!(this: this, arguments: [charnum.jsValue]).fromJSValue()! } @inlinable public func getCharNumAtPosition(point: DOMPointInit? = nil) -> Int32 { let this = jsObject - return this[Strings.getCharNumAtPosition].function!(this: this, arguments: [point?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getCharNumAtPosition].function!(this: this, arguments: [point?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func selectSubString(charnum: UInt32, nchars: UInt32) { let this = jsObject - _ = this[Strings.selectSubString].function!(this: this, arguments: [charnum.jsValue(), nchars.jsValue()]) + _ = this[Strings.selectSubString].function!(this: this, arguments: [charnum.jsValue, nchars.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SVGTransform.swift b/Sources/DOMKit/WebIDL/SVGTransform.swift index b942169d..907ec023 100644 --- a/Sources/DOMKit/WebIDL/SVGTransform.swift +++ b/Sources/DOMKit/WebIDL/SVGTransform.swift @@ -40,31 +40,31 @@ public class SVGTransform: JSBridgedClass { @inlinable public func setMatrix(matrix: DOMMatrix2DInit? = nil) { let this = jsObject - _ = this[Strings.setMatrix].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]) + _ = this[Strings.setMatrix].function!(this: this, arguments: [matrix?.jsValue ?? .undefined]) } @inlinable public func setTranslate(tx: Float, ty: Float) { let this = jsObject - _ = this[Strings.setTranslate].function!(this: this, arguments: [tx.jsValue(), ty.jsValue()]) + _ = this[Strings.setTranslate].function!(this: this, arguments: [tx.jsValue, ty.jsValue]) } @inlinable public func setScale(sx: Float, sy: Float) { let this = jsObject - _ = this[Strings.setScale].function!(this: this, arguments: [sx.jsValue(), sy.jsValue()]) + _ = this[Strings.setScale].function!(this: this, arguments: [sx.jsValue, sy.jsValue]) } @inlinable public func setRotate(angle: Float, cx: Float, cy: Float) { let this = jsObject - _ = this[Strings.setRotate].function!(this: this, arguments: [angle.jsValue(), cx.jsValue(), cy.jsValue()]) + _ = this[Strings.setRotate].function!(this: this, arguments: [angle.jsValue, cx.jsValue, cy.jsValue]) } @inlinable public func setSkewX(angle: Float) { let this = jsObject - _ = this[Strings.setSkewX].function!(this: this, arguments: [angle.jsValue()]) + _ = this[Strings.setSkewX].function!(this: this, arguments: [angle.jsValue]) } @inlinable public func setSkewY(angle: Float) { let this = jsObject - _ = this[Strings.setSkewY].function!(this: this, arguments: [angle.jsValue()]) + _ = this[Strings.setSkewY].function!(this: this, arguments: [angle.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SVGTransformList.swift b/Sources/DOMKit/WebIDL/SVGTransformList.swift index 5c930ac1..2cac5c85 100644 --- a/Sources/DOMKit/WebIDL/SVGTransformList.swift +++ b/Sources/DOMKit/WebIDL/SVGTransformList.swift @@ -27,7 +27,7 @@ public class SVGTransformList: JSBridgedClass { @inlinable public func initialize(newItem: SVGTransform) -> SVGTransform { let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } @inlinable public subscript(key: Int) -> SVGTransform { @@ -36,29 +36,29 @@ public class SVGTransformList: JSBridgedClass { @inlinable public func insertItemBefore(newItem: SVGTransform, index: UInt32) -> SVGTransform { let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func replaceItem(newItem: SVGTransform, index: UInt32) -> SVGTransform { let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! } @inlinable public func removeItem(index: UInt32) -> SVGTransform { let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } @inlinable public func appendItem(newItem: SVGTransform) -> SVGTransform { let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue()]).fromJSValue()! + return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! } // XXX: unsupported setter for keys of type UInt32 @inlinable public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { let this = jsObject - return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func consolidate() -> SVGTransform? { diff --git a/Sources/DOMKit/WebIDL/Sanitizer.swift b/Sources/DOMKit/WebIDL/Sanitizer.swift index 4990542c..d37e0644 100644 --- a/Sources/DOMKit/WebIDL/Sanitizer.swift +++ b/Sources/DOMKit/WebIDL/Sanitizer.swift @@ -13,17 +13,17 @@ public class Sanitizer: JSBridgedClass { } @inlinable public convenience init(config: SanitizerConfig? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [config?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [config?.jsValue ?? .undefined])) } @inlinable public func sanitize(input: Document_or_DocumentFragment) -> DocumentFragment { let this = jsObject - return this[Strings.sanitize].function!(this: this, arguments: [input.jsValue()]).fromJSValue()! + return this[Strings.sanitize].function!(this: this, arguments: [input.jsValue]).fromJSValue()! } @inlinable public func sanitizeFor(element: String, input: String) -> Element? { let this = jsObject - return this[Strings.sanitizeFor].function!(this: this, arguments: [element.jsValue(), input.jsValue()]).fromJSValue()! + return this[Strings.sanitizeFor].function!(this: this, arguments: [element.jsValue, input.jsValue]).fromJSValue()! } @inlinable public func getConfiguration() -> SanitizerConfig { diff --git a/Sources/DOMKit/WebIDL/SanitizerConfig.swift b/Sources/DOMKit/WebIDL/SanitizerConfig.swift index b4ea5f92..90e564c3 100644 --- a/Sources/DOMKit/WebIDL/SanitizerConfig.swift +++ b/Sources/DOMKit/WebIDL/SanitizerConfig.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class SanitizerConfig: BridgedDictionary { public convenience init(allowElements: [String], blockElements: [String], dropElements: [String], allowAttributes: AttributeMatchList, dropAttributes: AttributeMatchList, allowCustomElements: Bool, allowComments: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowElements] = allowElements.jsValue() - object[Strings.blockElements] = blockElements.jsValue() - object[Strings.dropElements] = dropElements.jsValue() - object[Strings.allowAttributes] = allowAttributes.jsValue() - object[Strings.dropAttributes] = dropAttributes.jsValue() - object[Strings.allowCustomElements] = allowCustomElements.jsValue() - object[Strings.allowComments] = allowComments.jsValue() + object[Strings.allowElements] = allowElements.jsValue + object[Strings.blockElements] = blockElements.jsValue + object[Strings.dropElements] = dropElements.jsValue + object[Strings.allowAttributes] = allowAttributes.jsValue + object[Strings.dropAttributes] = dropAttributes.jsValue + object[Strings.allowCustomElements] = allowCustomElements.jsValue + object[Strings.allowComments] = allowComments.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift b/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift index aae7c142..28db174d 100644 --- a/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift +++ b/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class SaveFilePickerOptions: BridgedDictionary { public convenience init(suggestedName: String?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.suggestedName] = suggestedName.jsValue() + object[Strings.suggestedName] = suggestedName.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift b/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift index 7da77566..c0e5e4ff 100644 --- a/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift +++ b/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class SchedulerPostTaskOptions: BridgedDictionary { public convenience init(signal: AbortSignal, priority: TaskPriority, delay: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue() - object[Strings.priority] = priority.jsValue() - object[Strings.delay] = delay.jsValue() + object[Strings.signal] = signal.jsValue + object[Strings.priority] = priority.jsValue + object[Strings.delay] = delay.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Scheduling.swift b/Sources/DOMKit/WebIDL/Scheduling.swift index f106a2f7..ae9a18ea 100644 --- a/Sources/DOMKit/WebIDL/Scheduling.swift +++ b/Sources/DOMKit/WebIDL/Scheduling.swift @@ -14,6 +14,6 @@ public class Scheduling: JSBridgedClass { @inlinable public func isInputPending(isInputPendingOptions: IsInputPendingOptions? = nil) -> Bool { let this = jsObject - return this[Strings.isInputPending].function!(this: this, arguments: [isInputPendingOptions?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.isInputPending].function!(this: this, arguments: [isInputPendingOptions?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/ScreenIdleState.swift b/Sources/DOMKit/WebIDL/ScreenIdleState.swift index 1e3691f9..d2d67ab3 100644 --- a/Sources/DOMKit/WebIDL/ScreenIdleState.swift +++ b/Sources/DOMKit/WebIDL/ScreenIdleState.swift @@ -18,5 +18,5 @@ public enum ScreenIdleState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ScreenOrientation.swift b/Sources/DOMKit/WebIDL/ScreenOrientation.swift index 45fce6d0..2257eb80 100644 --- a/Sources/DOMKit/WebIDL/ScreenOrientation.swift +++ b/Sources/DOMKit/WebIDL/ScreenOrientation.swift @@ -15,14 +15,14 @@ public class ScreenOrientation: EventTarget { @inlinable public func lock(orientation: OrientationLockType) -> JSPromise { let this = jsObject - return this[Strings.lock].function!(this: this, arguments: [orientation.jsValue()]).fromJSValue()! + return this[Strings.lock].function!(this: this, arguments: [orientation.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func lock(orientation: OrientationLockType) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [orientation.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [orientation.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func unlock() { diff --git a/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift b/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift index f00470e5..d8f93cf5 100644 --- a/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift +++ b/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift @@ -20,5 +20,5 @@ public enum ScriptingPolicyViolationType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ScrollBehavior.swift b/Sources/DOMKit/WebIDL/ScrollBehavior.swift index ed2ac2ff..a76ba1cb 100644 --- a/Sources/DOMKit/WebIDL/ScrollBehavior.swift +++ b/Sources/DOMKit/WebIDL/ScrollBehavior.swift @@ -18,5 +18,5 @@ public enum ScrollBehavior: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ScrollDirection.swift b/Sources/DOMKit/WebIDL/ScrollDirection.swift index 04ac7d66..5747c841 100644 --- a/Sources/DOMKit/WebIDL/ScrollDirection.swift +++ b/Sources/DOMKit/WebIDL/ScrollDirection.swift @@ -20,5 +20,5 @@ public enum ScrollDirection: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift b/Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift index bf1338c7..23f42432 100644 --- a/Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift +++ b/Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ScrollIntoViewOptions: BridgedDictionary { public convenience init(block: ScrollLogicalPosition, inline: ScrollLogicalPosition) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.block] = block.jsValue() - object[Strings.inline] = inline.jsValue() + object[Strings.block] = block.jsValue + object[Strings.inline] = inline.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift b/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift index 2515ce36..9f11f0bf 100644 --- a/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift +++ b/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift @@ -20,5 +20,5 @@ public enum ScrollLogicalPosition: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ScrollOptions.swift b/Sources/DOMKit/WebIDL/ScrollOptions.swift index deed638a..93ba5ad2 100644 --- a/Sources/DOMKit/WebIDL/ScrollOptions.swift +++ b/Sources/DOMKit/WebIDL/ScrollOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ScrollOptions: BridgedDictionary { public convenience init(behavior: ScrollBehavior) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.behavior] = behavior.jsValue() + object[Strings.behavior] = behavior.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ScrollRestoration.swift b/Sources/DOMKit/WebIDL/ScrollRestoration.swift index 7aa95009..4c2ba486 100644 --- a/Sources/DOMKit/WebIDL/ScrollRestoration.swift +++ b/Sources/DOMKit/WebIDL/ScrollRestoration.swift @@ -18,5 +18,5 @@ public enum ScrollRestoration: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ScrollSetting.swift b/Sources/DOMKit/WebIDL/ScrollSetting.swift index 7358cb7d..1f65bac5 100644 --- a/Sources/DOMKit/WebIDL/ScrollSetting.swift +++ b/Sources/DOMKit/WebIDL/ScrollSetting.swift @@ -18,5 +18,5 @@ public enum ScrollSetting: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ScrollTimeline.swift b/Sources/DOMKit/WebIDL/ScrollTimeline.swift index d71a56d4..52c7bc7c 100644 --- a/Sources/DOMKit/WebIDL/ScrollTimeline.swift +++ b/Sources/DOMKit/WebIDL/ScrollTimeline.swift @@ -14,7 +14,7 @@ public class ScrollTimeline: AnimationTimeline { } @inlinable public convenience init(options: ScrollTimelineOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift b/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift index 36b10e1b..9cc03128 100644 --- a/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift +++ b/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift @@ -17,5 +17,5 @@ public enum ScrollTimelineAutoKeyword: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift b/Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift index 4b55b89c..444d845d 100644 --- a/Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift +++ b/Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift @@ -21,12 +21,12 @@ public enum ScrollTimelineOffset: JSValueCompatible, Any_ScrollTimelineOffset { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .containerBasedOffset(containerBasedOffset): - return containerBasedOffset.jsValue() + return containerBasedOffset.jsValue case let .elementBasedOffset(elementBasedOffset): - return elementBasedOffset.jsValue() + return elementBasedOffset.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift b/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift index 459c7a53..8702e66f 100644 --- a/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift +++ b/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class ScrollTimelineOptions: BridgedDictionary { public convenience init(source: Element?, orientation: ScrollDirection, scrollOffsets: [ScrollTimelineOffset]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.source] = source.jsValue() - object[Strings.orientation] = orientation.jsValue() - object[Strings.scrollOffsets] = scrollOffsets.jsValue() + object[Strings.source] = source.jsValue + object[Strings.orientation] = orientation.jsValue + object[Strings.scrollOffsets] = scrollOffsets.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ScrollToOptions.swift b/Sources/DOMKit/WebIDL/ScrollToOptions.swift index 1dd0cfc8..c48ba4d7 100644 --- a/Sources/DOMKit/WebIDL/ScrollToOptions.swift +++ b/Sources/DOMKit/WebIDL/ScrollToOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class ScrollToOptions: BridgedDictionary { public convenience init(left: Double, top: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.left] = left.jsValue() - object[Strings.top] = top.jsValue() + object[Strings.left] = left.jsValue + object[Strings.top] = top.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift b/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift index dfe64864..0e9881e7 100644 --- a/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift +++ b/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class SecurePaymentConfirmationRequest: BridgedDictionary { public convenience init(challenge: BufferSource, rpId: String, credentialIds: [BufferSource], instrument: PaymentCredentialInstrument, timeout: UInt32, payeeOrigin: String, extensions: AuthenticationExtensionsClientInputs) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.challenge] = challenge.jsValue() - object[Strings.rpId] = rpId.jsValue() - object[Strings.credentialIds] = credentialIds.jsValue() - object[Strings.instrument] = instrument.jsValue() - object[Strings.timeout] = timeout.jsValue() - object[Strings.payeeOrigin] = payeeOrigin.jsValue() - object[Strings.extensions] = extensions.jsValue() + object[Strings.challenge] = challenge.jsValue + object[Strings.rpId] = rpId.jsValue + object[Strings.credentialIds] = credentialIds.jsValue + object[Strings.instrument] = instrument.jsValue + object[Strings.timeout] = timeout.jsValue + object[Strings.payeeOrigin] = payeeOrigin.jsValue + object[Strings.extensions] = extensions.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift index 8d295f5f..283c3d91 100644 --- a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift +++ b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift @@ -23,7 +23,7 @@ public class SecurityPolicyViolationEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: SecurityPolicyViolationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift index 132ff1b5..98493676 100644 --- a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift +++ b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift @@ -18,5 +18,5 @@ public enum SecurityPolicyViolationEventDisposition: JSString, JSValueCompatible self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift index 9bdaa9ee..c14064df 100644 --- a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift +++ b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift @@ -6,18 +6,18 @@ import JavaScriptKit public class SecurityPolicyViolationEventInit: BridgedDictionary { public convenience init(documentURI: String, referrer: String, blockedURI: String, violatedDirective: String, effectiveDirective: String, originalPolicy: String, sourceFile: String, sample: String, disposition: SecurityPolicyViolationEventDisposition, statusCode: UInt16, lineNumber: UInt32, columnNumber: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.documentURI] = documentURI.jsValue() - object[Strings.referrer] = referrer.jsValue() - object[Strings.blockedURI] = blockedURI.jsValue() - object[Strings.violatedDirective] = violatedDirective.jsValue() - object[Strings.effectiveDirective] = effectiveDirective.jsValue() - object[Strings.originalPolicy] = originalPolicy.jsValue() - object[Strings.sourceFile] = sourceFile.jsValue() - object[Strings.sample] = sample.jsValue() - object[Strings.disposition] = disposition.jsValue() - object[Strings.statusCode] = statusCode.jsValue() - object[Strings.lineNumber] = lineNumber.jsValue() - object[Strings.columnNumber] = columnNumber.jsValue() + object[Strings.documentURI] = documentURI.jsValue + object[Strings.referrer] = referrer.jsValue + object[Strings.blockedURI] = blockedURI.jsValue + object[Strings.violatedDirective] = violatedDirective.jsValue + object[Strings.effectiveDirective] = effectiveDirective.jsValue + object[Strings.originalPolicy] = originalPolicy.jsValue + object[Strings.sourceFile] = sourceFile.jsValue + object[Strings.sample] = sample.jsValue + object[Strings.disposition] = disposition.jsValue + object[Strings.statusCode] = statusCode.jsValue + object[Strings.lineNumber] = lineNumber.jsValue + object[Strings.columnNumber] = columnNumber.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Selection.swift b/Sources/DOMKit/WebIDL/Selection.swift index a95b5762..794eb7f6 100644 --- a/Sources/DOMKit/WebIDL/Selection.swift +++ b/Sources/DOMKit/WebIDL/Selection.swift @@ -42,17 +42,17 @@ public class Selection: JSBridgedClass { @inlinable public func getRangeAt(index: UInt32) -> Range { let this = jsObject - return this[Strings.getRangeAt].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.getRangeAt].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } @inlinable public func addRange(range: Range) { let this = jsObject - _ = this[Strings.addRange].function!(this: this, arguments: [range.jsValue()]) + _ = this[Strings.addRange].function!(this: this, arguments: [range.jsValue]) } @inlinable public func removeRange(range: Range) { let this = jsObject - _ = this[Strings.removeRange].function!(this: this, arguments: [range.jsValue()]) + _ = this[Strings.removeRange].function!(this: this, arguments: [range.jsValue]) } @inlinable public func removeAllRanges() { @@ -67,12 +67,12 @@ public class Selection: JSBridgedClass { @inlinable public func collapse(node: Node?, offset: UInt32? = nil) { let this = jsObject - _ = this[Strings.collapse].function!(this: this, arguments: [node.jsValue(), offset?.jsValue() ?? .undefined]) + _ = this[Strings.collapse].function!(this: this, arguments: [node.jsValue, offset?.jsValue ?? .undefined]) } @inlinable public func setPosition(node: Node?, offset: UInt32? = nil) { let this = jsObject - _ = this[Strings.setPosition].function!(this: this, arguments: [node.jsValue(), offset?.jsValue() ?? .undefined]) + _ = this[Strings.setPosition].function!(this: this, arguments: [node.jsValue, offset?.jsValue ?? .undefined]) } @inlinable public func collapseToStart() { @@ -87,17 +87,17 @@ public class Selection: JSBridgedClass { @inlinable public func extend(node: Node, offset: UInt32? = nil) { let this = jsObject - _ = this[Strings.extend].function!(this: this, arguments: [node.jsValue(), offset?.jsValue() ?? .undefined]) + _ = this[Strings.extend].function!(this: this, arguments: [node.jsValue, offset?.jsValue ?? .undefined]) } @inlinable public func setBaseAndExtent(anchorNode: Node, anchorOffset: UInt32, focusNode: Node, focusOffset: UInt32) { let this = jsObject - _ = this[Strings.setBaseAndExtent].function!(this: this, arguments: [anchorNode.jsValue(), anchorOffset.jsValue(), focusNode.jsValue(), focusOffset.jsValue()]) + _ = this[Strings.setBaseAndExtent].function!(this: this, arguments: [anchorNode.jsValue, anchorOffset.jsValue, focusNode.jsValue, focusOffset.jsValue]) } @inlinable public func selectAllChildren(node: Node) { let this = jsObject - _ = this[Strings.selectAllChildren].function!(this: this, arguments: [node.jsValue()]) + _ = this[Strings.selectAllChildren].function!(this: this, arguments: [node.jsValue]) } @inlinable public func deleteFromDocument() { @@ -107,7 +107,7 @@ public class Selection: JSBridgedClass { @inlinable public func containsNode(node: Node, allowPartialContainment: Bool? = nil) -> Bool { let this = jsObject - return this[Strings.containsNode].function!(this: this, arguments: [node.jsValue(), allowPartialContainment?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.containsNode].function!(this: this, arguments: [node.jsValue, allowPartialContainment?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public var description: String { diff --git a/Sources/DOMKit/WebIDL/SelectionMode.swift b/Sources/DOMKit/WebIDL/SelectionMode.swift index c0d5ceb5..c5434877 100644 --- a/Sources/DOMKit/WebIDL/SelectionMode.swift +++ b/Sources/DOMKit/WebIDL/SelectionMode.swift @@ -20,5 +20,5 @@ public enum SelectionMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/SensorErrorEvent.swift b/Sources/DOMKit/WebIDL/SensorErrorEvent.swift index bf0ce2d3..4e303955 100644 --- a/Sources/DOMKit/WebIDL/SensorErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SensorErrorEvent.swift @@ -12,7 +12,7 @@ public class SensorErrorEvent: Event { } @inlinable public convenience init(type: String, errorEventInitDict: SensorErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), errorEventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, errorEventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift b/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift index 1c30af1d..453dce12 100644 --- a/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class SensorErrorEventInit: BridgedDictionary { public convenience init(error: DOMException) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue() + object[Strings.error] = error.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SensorOptions.swift b/Sources/DOMKit/WebIDL/SensorOptions.swift index 8e8fe16f..1a439197 100644 --- a/Sources/DOMKit/WebIDL/SensorOptions.swift +++ b/Sources/DOMKit/WebIDL/SensorOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class SensorOptions: BridgedDictionary { public convenience init(frequency: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.frequency] = frequency.jsValue() + object[Strings.frequency] = frequency.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SequenceEffect.swift b/Sources/DOMKit/WebIDL/SequenceEffect.swift index 11cad38d..67b4da7e 100644 --- a/Sources/DOMKit/WebIDL/SequenceEffect.swift +++ b/Sources/DOMKit/WebIDL/SequenceEffect.swift @@ -11,7 +11,7 @@ public class SequenceEffect: GroupEffect { } @inlinable public convenience init(children: [AnimationEffect]?, timing: Double_or_EffectTiming? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue(), timing?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue, timing?.jsValue ?? .undefined])) } @inlinable override public func clone() -> Self { diff --git a/Sources/DOMKit/WebIDL/Serial.swift b/Sources/DOMKit/WebIDL/Serial.swift index ff20c49c..8e7ea3f3 100644 --- a/Sources/DOMKit/WebIDL/Serial.swift +++ b/Sources/DOMKit/WebIDL/Serial.swift @@ -27,18 +27,18 @@ public class Serial: EventTarget { @inlinable public func getPorts() async throws -> [SerialPort] { let this = jsObject let _promise: JSPromise = this[Strings.getPorts].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func requestPort(options: SerialPortRequestOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestPort(options: SerialPortRequestOptions? = nil) async throws -> SerialPort { let this = jsObject - let _promise: JSPromise = this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SerialInputSignals.swift b/Sources/DOMKit/WebIDL/SerialInputSignals.swift index 80d52d13..9a395b37 100644 --- a/Sources/DOMKit/WebIDL/SerialInputSignals.swift +++ b/Sources/DOMKit/WebIDL/SerialInputSignals.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class SerialInputSignals: BridgedDictionary { public convenience init(dataCarrierDetect: Bool, clearToSend: Bool, ringIndicator: Bool, dataSetReady: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataCarrierDetect] = dataCarrierDetect.jsValue() - object[Strings.clearToSend] = clearToSend.jsValue() - object[Strings.ringIndicator] = ringIndicator.jsValue() - object[Strings.dataSetReady] = dataSetReady.jsValue() + object[Strings.dataCarrierDetect] = dataCarrierDetect.jsValue + object[Strings.clearToSend] = clearToSend.jsValue + object[Strings.ringIndicator] = ringIndicator.jsValue + object[Strings.dataSetReady] = dataSetReady.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SerialOptions.swift b/Sources/DOMKit/WebIDL/SerialOptions.swift index 7a9b9566..6220c5a0 100644 --- a/Sources/DOMKit/WebIDL/SerialOptions.swift +++ b/Sources/DOMKit/WebIDL/SerialOptions.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class SerialOptions: BridgedDictionary { public convenience init(baudRate: UInt32, dataBits: UInt8, stopBits: UInt8, parity: ParityType, bufferSize: UInt32, flowControl: FlowControlType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.baudRate] = baudRate.jsValue() - object[Strings.dataBits] = dataBits.jsValue() - object[Strings.stopBits] = stopBits.jsValue() - object[Strings.parity] = parity.jsValue() - object[Strings.bufferSize] = bufferSize.jsValue() - object[Strings.flowControl] = flowControl.jsValue() + object[Strings.baudRate] = baudRate.jsValue + object[Strings.dataBits] = dataBits.jsValue + object[Strings.stopBits] = stopBits.jsValue + object[Strings.parity] = parity.jsValue + object[Strings.bufferSize] = bufferSize.jsValue + object[Strings.flowControl] = flowControl.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SerialOutputSignals.swift b/Sources/DOMKit/WebIDL/SerialOutputSignals.swift index 8edf9379..d0057349 100644 --- a/Sources/DOMKit/WebIDL/SerialOutputSignals.swift +++ b/Sources/DOMKit/WebIDL/SerialOutputSignals.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class SerialOutputSignals: BridgedDictionary { public convenience init(dataTerminalReady: Bool, requestToSend: Bool, break: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataTerminalReady] = dataTerminalReady.jsValue() - object[Strings.requestToSend] = requestToSend.jsValue() - object[Strings.break] = `break`.jsValue() + object[Strings.dataTerminalReady] = dataTerminalReady.jsValue + object[Strings.requestToSend] = requestToSend.jsValue + object[Strings.break] = `break`.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SerialPort.swift b/Sources/DOMKit/WebIDL/SerialPort.swift index cb3f3ed2..b076707e 100644 --- a/Sources/DOMKit/WebIDL/SerialPort.swift +++ b/Sources/DOMKit/WebIDL/SerialPort.swift @@ -33,26 +33,26 @@ public class SerialPort: EventTarget { @inlinable public func open(options: SerialOptions) -> JSPromise { let this = jsObject - return this[Strings.open].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! + return this[Strings.open].function!(this: this, arguments: [options.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func open(options: SerialOptions) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func setSignals(signals: SerialOutputSignals? = nil) -> JSPromise { let this = jsObject - return this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func setSignals(signals: SerialOutputSignals? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func getSignals() -> JSPromise { @@ -64,7 +64,7 @@ public class SerialPort: EventTarget { @inlinable public func getSignals() async throws -> SerialInputSignals { let this = jsObject let _promise: JSPromise = this[Strings.getSignals].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func close() -> JSPromise { @@ -76,6 +76,6 @@ public class SerialPort: EventTarget { @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/SerialPortFilter.swift b/Sources/DOMKit/WebIDL/SerialPortFilter.swift index 1e5b049f..496ebfe0 100644 --- a/Sources/DOMKit/WebIDL/SerialPortFilter.swift +++ b/Sources/DOMKit/WebIDL/SerialPortFilter.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class SerialPortFilter: BridgedDictionary { public convenience init(usbVendorId: UInt16, usbProductId: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usbVendorId] = usbVendorId.jsValue() - object[Strings.usbProductId] = usbProductId.jsValue() + object[Strings.usbVendorId] = usbVendorId.jsValue + object[Strings.usbProductId] = usbProductId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SerialPortInfo.swift b/Sources/DOMKit/WebIDL/SerialPortInfo.swift index 931ef2cb..6aa61803 100644 --- a/Sources/DOMKit/WebIDL/SerialPortInfo.swift +++ b/Sources/DOMKit/WebIDL/SerialPortInfo.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class SerialPortInfo: BridgedDictionary { public convenience init(usbVendorId: UInt16, usbProductId: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usbVendorId] = usbVendorId.jsValue() - object[Strings.usbProductId] = usbProductId.jsValue() + object[Strings.usbVendorId] = usbVendorId.jsValue + object[Strings.usbProductId] = usbProductId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift b/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift index 2d5c2715..af4c44bc 100644 --- a/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift +++ b/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class SerialPortRequestOptions: BridgedDictionary { public convenience init(filters: [SerialPortFilter]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue() + object[Strings.filters] = filters.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ServiceWorker.swift b/Sources/DOMKit/WebIDL/ServiceWorker.swift index 21235ddc..0ab5f4cd 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorker.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorker.swift @@ -21,12 +21,12 @@ public class ServiceWorker: EventTarget, AbstractWorker { @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, transfer.jsValue]) } @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift index c6b664ee..63fe6273 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerContainer.swift @@ -23,26 +23,26 @@ public class ServiceWorkerContainer: EventTarget { @inlinable public func register(scriptURL: String, options: RegistrationOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.register].function!(this: this, arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.register].function!(this: this, arguments: [scriptURL.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func register(scriptURL: String, options: RegistrationOptions? = nil) async throws -> ServiceWorkerRegistration { let this = jsObject - let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [scriptURL.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getRegistration(clientURL: String? = nil) -> JSPromise { let this = jsObject - return this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getRegistration(clientURL: String? = nil) async throws -> ServiceWorkerRegistration? { let this = jsObject - let _promise: JSPromise = this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getRegistration].function!(this: this, arguments: [clientURL?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getRegistrations() -> JSPromise { @@ -54,7 +54,7 @@ public class ServiceWorkerContainer: EventTarget { @inlinable public func getRegistrations() async throws -> [ServiceWorkerRegistration] { let this = jsObject let _promise: JSPromise = this[Strings.getRegistrations].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func startMessages() { diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift index 7280f003..65173f2e 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift @@ -38,26 +38,26 @@ public class ServiceWorkerRegistration: EventTarget { @inlinable public func showNotification(title: String, options: NotificationOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.showNotification].function!(this: this, arguments: [title.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.showNotification].function!(this: this, arguments: [title.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func showNotification(title: String, options: NotificationOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.showNotification].function!(this: this, arguments: [title.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.showNotification].function!(this: this, arguments: [title.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func getNotifications(filter: GetNotificationOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getNotifications(filter: GetNotificationOptions? = nil) async throws -> [Notification] { let this = jsObject - let _promise: JSPromise = this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute @@ -96,7 +96,7 @@ public class ServiceWorkerRegistration: EventTarget { @inlinable public func update() async throws { let this = jsObject let _promise: JSPromise = this[Strings.update].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func unregister() -> JSPromise { @@ -108,7 +108,7 @@ public class ServiceWorkerRegistration: EventTarget { @inlinable public func unregister() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.unregister].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerState.swift b/Sources/DOMKit/WebIDL/ServiceWorkerState.swift index c45873b7..e5bfac3b 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerState.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerState.swift @@ -22,5 +22,5 @@ public enum ServiceWorkerState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift b/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift index f4d12b74..032f59f3 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerUpdateViaCache.swift @@ -19,5 +19,5 @@ public enum ServiceWorkerUpdateViaCache: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/SetHTMLOptions.swift b/Sources/DOMKit/WebIDL/SetHTMLOptions.swift index 27aaf147..0cf84de5 100644 --- a/Sources/DOMKit/WebIDL/SetHTMLOptions.swift +++ b/Sources/DOMKit/WebIDL/SetHTMLOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class SetHTMLOptions: BridgedDictionary { public convenience init(sanitizer: Sanitizer) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sanitizer] = sanitizer.jsValue() + object[Strings.sanitizer] = sanitizer.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ShadowAnimation.swift b/Sources/DOMKit/WebIDL/ShadowAnimation.swift index 0fd14060..ff82aa73 100644 --- a/Sources/DOMKit/WebIDL/ShadowAnimation.swift +++ b/Sources/DOMKit/WebIDL/ShadowAnimation.swift @@ -12,7 +12,7 @@ public class ShadowAnimation: Animation { } @inlinable public convenience init(source: Animation, newTarget: CSSPseudoElement_or_Element) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue(), newTarget.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue, newTarget.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ShadowRootInit.swift b/Sources/DOMKit/WebIDL/ShadowRootInit.swift index f422ea0e..24f7913a 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootInit.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class ShadowRootInit: BridgedDictionary { public convenience init(mode: ShadowRootMode, delegatesFocus: Bool, slotAssignment: SlotAssignmentMode) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue() - object[Strings.delegatesFocus] = delegatesFocus.jsValue() - object[Strings.slotAssignment] = slotAssignment.jsValue() + object[Strings.mode] = mode.jsValue + object[Strings.delegatesFocus] = delegatesFocus.jsValue + object[Strings.slotAssignment] = slotAssignment.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ShadowRootMode.swift b/Sources/DOMKit/WebIDL/ShadowRootMode.swift index a3803e51..7749aa7a 100644 --- a/Sources/DOMKit/WebIDL/ShadowRootMode.swift +++ b/Sources/DOMKit/WebIDL/ShadowRootMode.swift @@ -18,5 +18,5 @@ public enum ShadowRootMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/ShareData.swift b/Sources/DOMKit/WebIDL/ShareData.swift index 727f7037..915e6609 100644 --- a/Sources/DOMKit/WebIDL/ShareData.swift +++ b/Sources/DOMKit/WebIDL/ShareData.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class ShareData: BridgedDictionary { public convenience init(files: [File], title: String, text: String, url: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.files] = files.jsValue() - object[Strings.title] = title.jsValue() - object[Strings.text] = text.jsValue() - object[Strings.url] = url.jsValue() + object[Strings.files] = files.jsValue + object[Strings.title] = title.jsValue + object[Strings.text] = text.jsValue + object[Strings.url] = url.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SharedWorker.swift b/Sources/DOMKit/WebIDL/SharedWorker.swift index 78ab2cab..152a1717 100644 --- a/Sources/DOMKit/WebIDL/SharedWorker.swift +++ b/Sources/DOMKit/WebIDL/SharedWorker.swift @@ -12,7 +12,7 @@ public class SharedWorker: EventTarget, AbstractWorker { } @inlinable public convenience init(scriptURL: String, options: String_or_WorkerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [scriptURL.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift index 05b23253..9a4f11b1 100644 --- a/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift +++ b/Sources/DOMKit/WebIDL/SlotAssignmentMode.swift @@ -18,5 +18,5 @@ public enum SlotAssignmentMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/SourceBuffer.swift b/Sources/DOMKit/WebIDL/SourceBuffer.swift index ad4432c1..209ca8dc 100644 --- a/Sources/DOMKit/WebIDL/SourceBuffer.swift +++ b/Sources/DOMKit/WebIDL/SourceBuffer.swift @@ -68,7 +68,7 @@ public class SourceBuffer: EventTarget { @inlinable public func appendBuffer(data: BufferSource) { let this = jsObject - _ = this[Strings.appendBuffer].function!(this: this, arguments: [data.jsValue()]) + _ = this[Strings.appendBuffer].function!(this: this, arguments: [data.jsValue]) } @inlinable public func abort() { @@ -78,11 +78,11 @@ public class SourceBuffer: EventTarget { @inlinable public func changeType(type: String) { let this = jsObject - _ = this[Strings.changeType].function!(this: this, arguments: [type.jsValue()]) + _ = this[Strings.changeType].function!(this: this, arguments: [type.jsValue]) } @inlinable public func remove(start: Double, end: Double) { let this = jsObject - _ = this[Strings.remove].function!(this: this, arguments: [start.jsValue(), end.jsValue()]) + _ = this[Strings.remove].function!(this: this, arguments: [start.jsValue, end.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift b/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift index 0f637478..e45ede8e 100644 --- a/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift +++ b/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift @@ -20,5 +20,5 @@ public enum SpatialNavigationDirection: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift b/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift index 8a6ad550..7208e0a4 100644 --- a/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift +++ b/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class SpatialNavigationSearchOptions: BridgedDictionary { public convenience init(candidates: [Node]?, container: Node?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.candidates] = candidates.jsValue() - object[Strings.container] = container.jsValue() + object[Strings.candidates] = candidates.jsValue + object[Strings.container] = container.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift index a41ddf69..bd0332bb 100644 --- a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift +++ b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift @@ -26,11 +26,11 @@ public class SpeechGrammarList: JSBridgedClass { @inlinable public func addFromURI(src: String, weight: Float? = nil) { let this = jsObject - _ = this[Strings.addFromURI].function!(this: this, arguments: [src.jsValue(), weight?.jsValue() ?? .undefined]) + _ = this[Strings.addFromURI].function!(this: this, arguments: [src.jsValue, weight?.jsValue ?? .undefined]) } @inlinable public func addFromString(string: String, weight: Float? = nil) { let this = jsObject - _ = this[Strings.addFromString].function!(this: this, arguments: [string.jsValue(), weight?.jsValue() ?? .undefined]) + _ = this[Strings.addFromString].function!(this: this, arguments: [string.jsValue, weight?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift index 6f554ddc..d4d631dd 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift @@ -24,5 +24,5 @@ public enum SpeechRecognitionErrorCode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift index 97d21807..4423e691 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift @@ -13,7 +13,7 @@ public class SpeechRecognitionErrorEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: SpeechRecognitionErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift index 307ef924..e920e554 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class SpeechRecognitionErrorEventInit: BridgedDictionary { public convenience init(error: SpeechRecognitionErrorCode, message: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue() - object[Strings.message] = message.jsValue() + object[Strings.error] = error.jsValue + object[Strings.message] = message.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift index 26d0134e..31504966 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift @@ -13,7 +13,7 @@ public class SpeechRecognitionEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: SpeechRecognitionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift index 26e5b81e..3983275c 100644 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift +++ b/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class SpeechRecognitionEventInit: BridgedDictionary { public convenience init(resultIndex: UInt32, results: SpeechRecognitionResultList) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.resultIndex] = resultIndex.jsValue() - object[Strings.results] = results.jsValue() + object[Strings.resultIndex] = resultIndex.jsValue + object[Strings.results] = results.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift index 0e9d170b..36667dbe 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift @@ -28,7 +28,7 @@ public class SpeechSynthesis: EventTarget { @inlinable public func speak(utterance: SpeechSynthesisUtterance) { let this = jsObject - _ = this[Strings.speak].function!(this: this, arguments: [utterance.jsValue()]) + _ = this[Strings.speak].function!(this: this, arguments: [utterance.jsValue]) } @inlinable public func cancel() { diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift index 59438bb7..224aff9c 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift @@ -28,5 +28,5 @@ public enum SpeechSynthesisErrorCode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift index 4298b749..92f70538 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift @@ -12,7 +12,7 @@ public class SpeechSynthesisErrorEvent: SpeechSynthesisEvent { } @inlinable public convenience init(type: String, eventInitDict: SpeechSynthesisErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift index a5321a32..888b0c1a 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class SpeechSynthesisErrorEventInit: BridgedDictionary { public convenience init(error: SpeechSynthesisErrorCode) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue() + object[Strings.error] = error.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift index b48afdb7..cc6ea283 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift @@ -16,7 +16,7 @@ public class SpeechSynthesisEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: SpeechSynthesisEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift index ae75c8b6..c3f887bd 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class SpeechSynthesisEventInit: BridgedDictionary { public convenience init(utterance: SpeechSynthesisUtterance, charIndex: UInt32, charLength: UInt32, elapsedTime: Float, name: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.utterance] = utterance.jsValue() - object[Strings.charIndex] = charIndex.jsValue() - object[Strings.charLength] = charLength.jsValue() - object[Strings.elapsedTime] = elapsedTime.jsValue() - object[Strings.name] = name.jsValue() + object[Strings.utterance] = utterance.jsValue + object[Strings.charIndex] = charIndex.jsValue + object[Strings.charLength] = charLength.jsValue + object[Strings.elapsedTime] = elapsedTime.jsValue + object[Strings.name] = name.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift index 433db52b..6c5304fa 100644 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift +++ b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift @@ -24,7 +24,7 @@ public class SpeechSynthesisUtterance: EventTarget { } @inlinable public convenience init(text: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [text?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [text?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/StartInDirectory.swift b/Sources/DOMKit/WebIDL/StartInDirectory.swift index 464a580a..8f4c2550 100644 --- a/Sources/DOMKit/WebIDL/StartInDirectory.swift +++ b/Sources/DOMKit/WebIDL/StartInDirectory.swift @@ -21,12 +21,12 @@ public enum StartInDirectory: JSValueCompatible, Any_StartInDirectory { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .fileSystemHandle(fileSystemHandle): - return fileSystemHandle.jsValue() + return fileSystemHandle.jsValue case let .wellKnownDirectory(wellKnownDirectory): - return wellKnownDirectory.jsValue() + return wellKnownDirectory.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/StaticRange.swift b/Sources/DOMKit/WebIDL/StaticRange.swift index 5c9fec2b..f8f95fe6 100644 --- a/Sources/DOMKit/WebIDL/StaticRange.swift +++ b/Sources/DOMKit/WebIDL/StaticRange.swift @@ -11,6 +11,6 @@ public class StaticRange: AbstractRange { } @inlinable public convenience init(init: StaticRangeInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } } diff --git a/Sources/DOMKit/WebIDL/StaticRangeInit.swift b/Sources/DOMKit/WebIDL/StaticRangeInit.swift index f85585a7..45ca5d3e 100644 --- a/Sources/DOMKit/WebIDL/StaticRangeInit.swift +++ b/Sources/DOMKit/WebIDL/StaticRangeInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class StaticRangeInit: BridgedDictionary { public convenience init(startContainer: Node, startOffset: UInt32, endContainer: Node, endOffset: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.startContainer] = startContainer.jsValue() - object[Strings.startOffset] = startOffset.jsValue() - object[Strings.endContainer] = endContainer.jsValue() - object[Strings.endOffset] = endOffset.jsValue() + object[Strings.startContainer] = startContainer.jsValue + object[Strings.startOffset] = startOffset.jsValue + object[Strings.endContainer] = endContainer.jsValue + object[Strings.endOffset] = endOffset.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StereoPannerNode.swift b/Sources/DOMKit/WebIDL/StereoPannerNode.swift index a3b685fc..b85da5e4 100644 --- a/Sources/DOMKit/WebIDL/StereoPannerNode.swift +++ b/Sources/DOMKit/WebIDL/StereoPannerNode.swift @@ -12,7 +12,7 @@ public class StereoPannerNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: StereoPannerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/StereoPannerOptions.swift b/Sources/DOMKit/WebIDL/StereoPannerOptions.swift index 5b21aed8..8c42c5d1 100644 --- a/Sources/DOMKit/WebIDL/StereoPannerOptions.swift +++ b/Sources/DOMKit/WebIDL/StereoPannerOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class StereoPannerOptions: BridgedDictionary { public convenience init(pan: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.pan] = pan.jsValue() + object[Strings.pan] = pan.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Storage.swift b/Sources/DOMKit/WebIDL/Storage.swift index 0115f04a..b89232c9 100644 --- a/Sources/DOMKit/WebIDL/Storage.swift +++ b/Sources/DOMKit/WebIDL/Storage.swift @@ -18,7 +18,7 @@ public class Storage: JSBridgedClass { @inlinable public func key(index: UInt32) -> String? { let this = jsObject - return this[Strings.key].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.key].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } @inlinable public subscript(key: String) -> String? { diff --git a/Sources/DOMKit/WebIDL/StorageEstimate.swift b/Sources/DOMKit/WebIDL/StorageEstimate.swift index 999adf1d..0f3c2cda 100644 --- a/Sources/DOMKit/WebIDL/StorageEstimate.swift +++ b/Sources/DOMKit/WebIDL/StorageEstimate.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class StorageEstimate: BridgedDictionary { public convenience init(usage: UInt64, quota: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usage] = usage.jsValue() - object[Strings.quota] = quota.jsValue() + object[Strings.usage] = usage.jsValue + object[Strings.quota] = quota.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StorageEvent.swift b/Sources/DOMKit/WebIDL/StorageEvent.swift index f5b08fee..ff3503b2 100644 --- a/Sources/DOMKit/WebIDL/StorageEvent.swift +++ b/Sources/DOMKit/WebIDL/StorageEvent.swift @@ -16,7 +16,7 @@ public class StorageEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: StorageEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -35,14 +35,14 @@ public class StorageEvent: Event { public var storageArea: Storage? @inlinable public func initStorageEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, key: String? = nil, oldValue: String? = nil, newValue: String? = nil, url: String? = nil, storageArea: Storage? = nil) { - let _arg0 = type.jsValue() - let _arg1 = bubbles?.jsValue() ?? .undefined - let _arg2 = cancelable?.jsValue() ?? .undefined - let _arg3 = key?.jsValue() ?? .undefined - let _arg4 = oldValue?.jsValue() ?? .undefined - let _arg5 = newValue?.jsValue() ?? .undefined - let _arg6 = url?.jsValue() ?? .undefined - let _arg7 = storageArea?.jsValue() ?? .undefined + let _arg0 = type.jsValue + let _arg1 = bubbles?.jsValue ?? .undefined + let _arg2 = cancelable?.jsValue ?? .undefined + let _arg3 = key?.jsValue ?? .undefined + let _arg4 = oldValue?.jsValue ?? .undefined + let _arg5 = newValue?.jsValue ?? .undefined + let _arg6 = url?.jsValue ?? .undefined + let _arg7 = storageArea?.jsValue ?? .undefined let this = jsObject _ = this[Strings.initStorageEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } diff --git a/Sources/DOMKit/WebIDL/StorageEventInit.swift b/Sources/DOMKit/WebIDL/StorageEventInit.swift index 91dac5dd..00d17ee3 100644 --- a/Sources/DOMKit/WebIDL/StorageEventInit.swift +++ b/Sources/DOMKit/WebIDL/StorageEventInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class StorageEventInit: BridgedDictionary { public convenience init(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.key] = key.jsValue() - object[Strings.oldValue] = oldValue.jsValue() - object[Strings.newValue] = newValue.jsValue() - object[Strings.url] = url.jsValue() - object[Strings.storageArea] = storageArea.jsValue() + object[Strings.key] = key.jsValue + object[Strings.oldValue] = oldValue.jsValue + object[Strings.newValue] = newValue.jsValue + object[Strings.url] = url.jsValue + object[Strings.storageArea] = storageArea.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StorageManager.swift b/Sources/DOMKit/WebIDL/StorageManager.swift index 5c23cecc..ae572810 100644 --- a/Sources/DOMKit/WebIDL/StorageManager.swift +++ b/Sources/DOMKit/WebIDL/StorageManager.swift @@ -21,7 +21,7 @@ public class StorageManager: JSBridgedClass { @inlinable public func getDirectory() async throws -> FileSystemDirectoryHandle { let this = jsObject let _promise: JSPromise = this[Strings.getDirectory].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func persisted() -> JSPromise { @@ -33,7 +33,7 @@ public class StorageManager: JSBridgedClass { @inlinable public func persisted() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.persisted].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func persist() -> JSPromise { @@ -45,7 +45,7 @@ public class StorageManager: JSBridgedClass { @inlinable public func persist() async throws -> Bool { let this = jsObject let _promise: JSPromise = this[Strings.persist].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func estimate() -> JSPromise { @@ -57,6 +57,6 @@ public class StorageManager: JSBridgedClass { @inlinable public func estimate() async throws -> StorageEstimate { let this = jsObject let _promise: JSPromise = this[Strings.estimate].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift index e2176195..5ef69c77 100644 --- a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift +++ b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift @@ -6,10 +6,10 @@ 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() + object[Strings.preventClose] = preventClose.jsValue + object[Strings.preventAbort] = preventAbort.jsValue + object[Strings.preventCancel] = preventCancel.jsValue + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift b/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift index 88ae0c1e..fa3b15d1 100644 --- a/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift +++ b/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift @@ -21,12 +21,12 @@ public enum String_or_WorkerOptions: JSValueCompatible, Any_String_or_WorkerOpti return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .string(string): - return string.jsValue() + return string.jsValue case let .workerOptions(workerOptions): - return workerOptions.jsValue() + return workerOptions.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift b/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift index d1251a5a..f0afe12d 100644 --- a/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift +++ b/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift @@ -26,14 +26,14 @@ public enum String_or_record_String_to_String_or_seq_of_seq_of_String: JSValueCo return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .string(string): - return string.jsValue() + return string.jsValue case let .record_String_to_String(record_String_to_String): - return record_String_to_String.jsValue() + return record_String_to_String.jsValue case let .seq_of_seq_of_String(seq_of_seq_of_String): - return seq_of_seq_of_String.jsValue() + return seq_of_seq_of_String.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift b/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift index 37864a10..0cd68d11 100644 --- a/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift +++ b/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift @@ -21,12 +21,12 @@ public enum String_or_seq_of_Double: JSValueCompatible, Any_String_or_seq_of_Dou return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .string(string): - return string.jsValue() + return string.jsValue case let .seq_of_Double(seq_of_Double): - return seq_of_Double.jsValue() + return seq_of_Double.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift b/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift index 7aeb2040..fdd3419b 100644 --- a/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift +++ b/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift @@ -21,12 +21,12 @@ public enum String_or_seq_of_String: JSValueCompatible, Any_String_or_seq_of_Str return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .string(string): - return string.jsValue() + return string.jsValue case let .seq_of_String(seq_of_String): - return seq_of_String.jsValue() + return seq_of_String.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift b/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift index 9da2b424..58aca04f 100644 --- a/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift +++ b/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift @@ -21,12 +21,12 @@ public enum String_or_seq_of_UUID: JSValueCompatible, Any_String_or_seq_of_UUID return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .string(string): - return string.jsValue() + return string.jsValue case let .seq_of_UUID(seq_of_UUID): - return seq_of_UUID.jsValue() + return seq_of_UUID.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift index 32ac8512..67639f2d 100644 --- a/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift +++ b/Sources/DOMKit/WebIDL/StructuredSerializeOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class StructuredSerializeOptions: BridgedDictionary { public convenience init(transfer: [JSObject]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transfer] = transfer.jsValue() + object[Strings.transfer] = transfer.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/StylePropertyMap.swift b/Sources/DOMKit/WebIDL/StylePropertyMap.swift index 779a6f79..377e230a 100644 --- a/Sources/DOMKit/WebIDL/StylePropertyMap.swift +++ b/Sources/DOMKit/WebIDL/StylePropertyMap.swift @@ -12,17 +12,17 @@ public class StylePropertyMap: StylePropertyMapReadOnly { @inlinable public func set(property: String, values: CSSStyleValue_or_String...) { let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [property.jsValue()] + values.map { $0.jsValue() }) + _ = this[Strings.set].function!(this: this, arguments: [property.jsValue] + values.map(\.jsValue)) } @inlinable public func append(property: String, values: CSSStyleValue_or_String...) { let this = jsObject - _ = this[Strings.append].function!(this: this, arguments: [property.jsValue()] + values.map { $0.jsValue() }) + _ = this[Strings.append].function!(this: this, arguments: [property.jsValue] + values.map(\.jsValue)) } @inlinable public func delete(property: String) { let this = jsObject - _ = this[Strings.delete].function!(this: this, arguments: [property.jsValue()]) + _ = this[Strings.delete].function!(this: this, arguments: [property.jsValue]) } @inlinable public func clear() { diff --git a/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift b/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift index 203b0757..ba1e0570 100644 --- a/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift +++ b/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift @@ -20,17 +20,17 @@ public class StylePropertyMapReadOnly: JSBridgedClass, Sequence { @inlinable public func get(property: String) -> JSValue { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [property.jsValue]).fromJSValue()! } @inlinable public func getAll(property: String) -> [CSSStyleValue] { let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! + return this[Strings.getAll].function!(this: this, arguments: [property.jsValue]).fromJSValue()! } @inlinable public func has(property: String) -> Bool { let this = jsObject - return this[Strings.has].function!(this: this, arguments: [property.jsValue()]).fromJSValue()! + return this[Strings.has].function!(this: this, arguments: [property.jsValue]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SubmitEvent.swift b/Sources/DOMKit/WebIDL/SubmitEvent.swift index f5728c1d..7af0c6ef 100644 --- a/Sources/DOMKit/WebIDL/SubmitEvent.swift +++ b/Sources/DOMKit/WebIDL/SubmitEvent.swift @@ -12,7 +12,7 @@ public class SubmitEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: SubmitEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/SubmitEventInit.swift b/Sources/DOMKit/WebIDL/SubmitEventInit.swift index d9317868..7913a9c4 100644 --- a/Sources/DOMKit/WebIDL/SubmitEventInit.swift +++ b/Sources/DOMKit/WebIDL/SubmitEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class SubmitEventInit: BridgedDictionary { public convenience init(submitter: HTMLElement?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.submitter] = submitter.jsValue() + object[Strings.submitter] = submitter.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SubtleCrypto.swift b/Sources/DOMKit/WebIDL/SubtleCrypto.swift index 24605e1c..180b4882 100644 --- a/Sources/DOMKit/WebIDL/SubtleCrypto.swift +++ b/Sources/DOMKit/WebIDL/SubtleCrypto.swift @@ -14,159 +14,159 @@ public class SubtleCrypto: JSBridgedClass { @inlinable public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! + return this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! + return this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! + return this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), data.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()]).fromJSValue()! + return this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, signature.jsValue, data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue(), key.jsValue(), signature.jsValue(), data.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, signature.jsValue, data.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue(), data.jsValue()]).fromJSValue()! + return this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue, data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue(), data.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue, data.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { let this = jsObject - return this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! + return this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { let this = jsObject - return this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! + return this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue, baseKey.jsValue, derivedKeyType.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), derivedKeyType.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue, baseKey.jsValue, derivedKeyType.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) -> JSPromise { let this = jsObject - return this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), length.jsValue()]).fromJSValue()! + return this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue, baseKey.jsValue, length.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) async throws -> ArrayBuffer { let this = jsObject - let _promise: JSPromise = this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue(), baseKey.jsValue(), length.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue, baseKey.jsValue, length.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func importKey(format: KeyFormat, keyData: BufferSource_or_JsonWebKey, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { let this = jsObject - return this[Strings.importKey].function!(this: this, arguments: [format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! + return this[Strings.importKey].function!(this: this, arguments: [format.jsValue, keyData.jsValue, algorithm.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func importKey(format: KeyFormat, keyData: BufferSource_or_JsonWebKey, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { let this = jsObject - let _promise: JSPromise = this[Strings.importKey].function!(this: this, arguments: [format.jsValue(), keyData.jsValue(), algorithm.jsValue(), extractable.jsValue(), keyUsages.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.importKey].function!(this: this, arguments: [format.jsValue, keyData.jsValue, algorithm.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func exportKey(format: KeyFormat, key: CryptoKey) -> JSPromise { let this = jsObject - return this[Strings.exportKey].function!(this: this, arguments: [format.jsValue(), key.jsValue()]).fromJSValue()! + return this[Strings.exportKey].function!(this: this, arguments: [format.jsValue, key.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func exportKey(format: KeyFormat, key: CryptoKey) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.exportKey].function!(this: this, arguments: [format.jsValue(), key.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.exportKey].function!(this: this, arguments: [format.jsValue, key.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) -> JSPromise { let this = jsObject - return this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()]).fromJSValue()! + return this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue, key.jsValue, wrappingKey.jsValue, wrapAlgorithm.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) async throws -> JSValue { let this = jsObject - let _promise: JSPromise = this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue(), key.jsValue(), wrappingKey.jsValue(), wrapAlgorithm.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue, key.jsValue, wrappingKey.jsValue, wrapAlgorithm.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { - let _arg0 = format.jsValue() - let _arg1 = wrappedKey.jsValue() - let _arg2 = unwrappingKey.jsValue() - let _arg3 = unwrapAlgorithm.jsValue() - let _arg4 = unwrappedKeyAlgorithm.jsValue() - let _arg5 = extractable.jsValue() - let _arg6 = keyUsages.jsValue() + let _arg0 = format.jsValue + let _arg1 = wrappedKey.jsValue + let _arg2 = unwrappingKey.jsValue + let _arg3 = unwrapAlgorithm.jsValue + let _arg4 = unwrappedKeyAlgorithm.jsValue + let _arg5 = extractable.jsValue + let _arg6 = keyUsages.jsValue let this = jsObject return this[Strings.unwrapKey].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { - let _arg0 = format.jsValue() - let _arg1 = wrappedKey.jsValue() - let _arg2 = unwrappingKey.jsValue() - let _arg3 = unwrapAlgorithm.jsValue() - let _arg4 = unwrappedKeyAlgorithm.jsValue() - let _arg5 = extractable.jsValue() - let _arg6 = keyUsages.jsValue() + let _arg0 = format.jsValue + let _arg1 = wrappedKey.jsValue + let _arg2 = unwrappingKey.jsValue + let _arg3 = unwrapAlgorithm.jsValue + let _arg4 = unwrappedKeyAlgorithm.jsValue + let _arg5 = extractable.jsValue + let _arg6 = keyUsages.jsValue let this = jsObject let _promise: JSPromise = this[Strings.unwrapKey].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift b/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift index fa4b7930..2487040f 100644 --- a/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift +++ b/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class SvcOutputMetadata: BridgedDictionary { public convenience init(temporalLayerId: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.temporalLayerId] = temporalLayerId.jsValue() + object[Strings.temporalLayerId] = temporalLayerId.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SyncEventInit.swift b/Sources/DOMKit/WebIDL/SyncEventInit.swift index 4c213c91..fff664f6 100644 --- a/Sources/DOMKit/WebIDL/SyncEventInit.swift +++ b/Sources/DOMKit/WebIDL/SyncEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class SyncEventInit: BridgedDictionary { public convenience init(tag: String, lastChance: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.tag] = tag.jsValue() - object[Strings.lastChance] = lastChance.jsValue() + object[Strings.tag] = tag.jsValue + object[Strings.lastChance] = lastChance.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/SyncManager.swift b/Sources/DOMKit/WebIDL/SyncManager.swift index 19a6ddbb..55f20a87 100644 --- a/Sources/DOMKit/WebIDL/SyncManager.swift +++ b/Sources/DOMKit/WebIDL/SyncManager.swift @@ -14,14 +14,14 @@ public class SyncManager: JSBridgedClass { @inlinable public func register(tag: String) -> JSPromise { let this = jsObject - return this[Strings.register].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! + return this[Strings.register].function!(this: this, arguments: [tag.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func register(tag: String) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func getTags() -> JSPromise { @@ -33,6 +33,6 @@ public class SyncManager: JSBridgedClass { @inlinable public func getTags() async throws -> [String] { let this = jsObject let _promise: JSPromise = this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/Table.swift b/Sources/DOMKit/WebIDL/Table.swift index 94cb21ff..1d30e1f9 100644 --- a/Sources/DOMKit/WebIDL/Table.swift +++ b/Sources/DOMKit/WebIDL/Table.swift @@ -14,22 +14,22 @@ public class Table: JSBridgedClass { } @inlinable public convenience init(descriptor: TableDescriptor, value: JSValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue(), value?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue, value?.jsValue ?? .undefined])) } @inlinable public func grow(delta: UInt32, value: JSValue? = nil) -> UInt32 { let this = jsObject - return this[Strings.grow].function!(this: this, arguments: [delta.jsValue(), value?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.grow].function!(this: this, arguments: [delta.jsValue, value?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func get(index: UInt32) -> JSValue { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } @inlinable public func set(index: UInt32, value: JSValue? = nil) { let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [index.jsValue(), value?.jsValue() ?? .undefined]) + _ = this[Strings.set].function!(this: this, arguments: [index.jsValue, value?.jsValue ?? .undefined]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TableDescriptor.swift b/Sources/DOMKit/WebIDL/TableDescriptor.swift index 1af7f679..1f9fbe78 100644 --- a/Sources/DOMKit/WebIDL/TableDescriptor.swift +++ b/Sources/DOMKit/WebIDL/TableDescriptor.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class TableDescriptor: BridgedDictionary { public convenience init(element: TableKind, initial: UInt32, maximum: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.element] = element.jsValue() - object[Strings.initial] = initial.jsValue() - object[Strings.maximum] = maximum.jsValue() + object[Strings.element] = element.jsValue + object[Strings.initial] = initial.jsValue + object[Strings.maximum] = maximum.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TableKind.swift b/Sources/DOMKit/WebIDL/TableKind.swift index 80690c8a..6662bd31 100644 --- a/Sources/DOMKit/WebIDL/TableKind.swift +++ b/Sources/DOMKit/WebIDL/TableKind.swift @@ -18,5 +18,5 @@ public enum TableKind: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/TaskController.swift b/Sources/DOMKit/WebIDL/TaskController.swift index 1419ee53..7f732b55 100644 --- a/Sources/DOMKit/WebIDL/TaskController.swift +++ b/Sources/DOMKit/WebIDL/TaskController.swift @@ -11,11 +11,11 @@ public class TaskController: AbortController { } @inlinable public convenience init(init: TaskControllerInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) } @inlinable public func setPriority(priority: TaskPriority) { let this = jsObject - _ = this[Strings.setPriority].function!(this: this, arguments: [priority.jsValue()]) + _ = this[Strings.setPriority].function!(this: this, arguments: [priority.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/TaskControllerInit.swift b/Sources/DOMKit/WebIDL/TaskControllerInit.swift index 50d9222d..73c60f90 100644 --- a/Sources/DOMKit/WebIDL/TaskControllerInit.swift +++ b/Sources/DOMKit/WebIDL/TaskControllerInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class TaskControllerInit: BridgedDictionary { public convenience init(priority: TaskPriority) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.priority] = priority.jsValue() + object[Strings.priority] = priority.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TaskPriority.swift b/Sources/DOMKit/WebIDL/TaskPriority.swift index afeaf4ec..fb20e3d8 100644 --- a/Sources/DOMKit/WebIDL/TaskPriority.swift +++ b/Sources/DOMKit/WebIDL/TaskPriority.swift @@ -19,5 +19,5 @@ public enum TaskPriority: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift b/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift index 76336da4..e04b95c1 100644 --- a/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift @@ -12,7 +12,7 @@ public class TaskPriorityChangeEvent: Event { } @inlinable public convenience init(type: String, priorityChangeEventInitDict: TaskPriorityChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), priorityChangeEventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, priorityChangeEventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift b/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift index a87fcdb5..2b5def85 100644 --- a/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class TaskPriorityChangeEventInit: BridgedDictionary { public convenience init(previousPriority: TaskPriority) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.previousPriority] = previousPriority.jsValue() + object[Strings.previousPriority] = previousPriority.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TestUtils.swift b/Sources/DOMKit/WebIDL/TestUtils.swift index 76cf7039..23438935 100644 --- a/Sources/DOMKit/WebIDL/TestUtils.swift +++ b/Sources/DOMKit/WebIDL/TestUtils.swift @@ -17,6 +17,6 @@ public enum TestUtils { @inlinable public static func gc() async throws { let this = JSObject.global[Strings.TestUtils].object! let _promise: JSPromise = this[Strings.gc].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/TexImageSource.swift b/Sources/DOMKit/WebIDL/TexImageSource.swift index a759239c..3a265f58 100644 --- a/Sources/DOMKit/WebIDL/TexImageSource.swift +++ b/Sources/DOMKit/WebIDL/TexImageSource.swift @@ -46,22 +46,22 @@ public enum TexImageSource: JSValueCompatible, Any_TexImageSource { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .hTMLCanvasElement(hTMLCanvasElement): - return hTMLCanvasElement.jsValue() + return hTMLCanvasElement.jsValue case let .hTMLImageElement(hTMLImageElement): - return hTMLImageElement.jsValue() + return hTMLImageElement.jsValue case let .hTMLVideoElement(hTMLVideoElement): - return hTMLVideoElement.jsValue() + return hTMLVideoElement.jsValue case let .imageBitmap(imageBitmap): - return imageBitmap.jsValue() + return imageBitmap.jsValue case let .imageData(imageData): - return imageData.jsValue() + return imageData.jsValue case let .offscreenCanvas(offscreenCanvas): - return offscreenCanvas.jsValue() + return offscreenCanvas.jsValue case let .videoFrame(videoFrame): - return videoFrame.jsValue() + return videoFrame.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index 17f9f918..c6bb9fa3 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -12,12 +12,12 @@ public class Text: CharacterData, GeometryUtils, Slottable { } @inlinable public convenience init(data: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue ?? .undefined])) } @inlinable public func splitText(offset: UInt32) -> Self { let this = jsObject - return this[Strings.splitText].function!(this: this, arguments: [offset.jsValue()]).fromJSValue()! + return this[Strings.splitText].function!(this: this, arguments: [offset.jsValue]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TextDecodeOptions.swift b/Sources/DOMKit/WebIDL/TextDecodeOptions.swift index da758b45..b1c5f850 100644 --- a/Sources/DOMKit/WebIDL/TextDecodeOptions.swift +++ b/Sources/DOMKit/WebIDL/TextDecodeOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class TextDecodeOptions: BridgedDictionary { public convenience init(stream: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.stream] = stream.jsValue() + object[Strings.stream] = stream.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TextDecoder.swift b/Sources/DOMKit/WebIDL/TextDecoder.swift index 424f243c..ef616ba7 100644 --- a/Sources/DOMKit/WebIDL/TextDecoder.swift +++ b/Sources/DOMKit/WebIDL/TextDecoder.swift @@ -13,11 +13,11 @@ public class TextDecoder: JSBridgedClass, TextDecoderCommon { } @inlinable public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue ?? .undefined, options?.jsValue ?? .undefined])) } @inlinable public func decode(input: BufferSource? = nil, options: TextDecodeOptions? = nil) -> String { let this = jsObject - return this[Strings.decode].function!(this: this, arguments: [input?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.decode].function!(this: this, arguments: [input?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextDecoderOptions.swift b/Sources/DOMKit/WebIDL/TextDecoderOptions.swift index d1f37b1d..b935dd84 100644 --- a/Sources/DOMKit/WebIDL/TextDecoderOptions.swift +++ b/Sources/DOMKit/WebIDL/TextDecoderOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class TextDecoderOptions: BridgedDictionary { public convenience init(fatal: Bool, ignoreBOM: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fatal] = fatal.jsValue() - object[Strings.ignoreBOM] = ignoreBOM.jsValue() + object[Strings.fatal] = fatal.jsValue + object[Strings.ignoreBOM] = ignoreBOM.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TextDecoderStream.swift b/Sources/DOMKit/WebIDL/TextDecoderStream.swift index 44e55471..4dc556af 100644 --- a/Sources/DOMKit/WebIDL/TextDecoderStream.swift +++ b/Sources/DOMKit/WebIDL/TextDecoderStream.swift @@ -13,6 +13,6 @@ public class TextDecoderStream: JSBridgedClass, TextDecoderCommon, GenericTransf } @inlinable public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue ?? .undefined, options?.jsValue ?? .undefined])) } } diff --git a/Sources/DOMKit/WebIDL/TextDetector.swift b/Sources/DOMKit/WebIDL/TextDetector.swift index dad33485..1320196f 100644 --- a/Sources/DOMKit/WebIDL/TextDetector.swift +++ b/Sources/DOMKit/WebIDL/TextDetector.swift @@ -18,13 +18,13 @@ public class TextDetector: JSBridgedClass { @inlinable public func detect(image: ImageBitmapSource) -> JSPromise { let this = jsObject - return this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! + return this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func detect(image: ImageBitmapSource) async throws -> [DetectedText] { let this = jsObject - let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextEncoder.swift b/Sources/DOMKit/WebIDL/TextEncoder.swift index bd310e9b..8d3e8596 100644 --- a/Sources/DOMKit/WebIDL/TextEncoder.swift +++ b/Sources/DOMKit/WebIDL/TextEncoder.swift @@ -18,11 +18,11 @@ public class TextEncoder: JSBridgedClass, TextEncoderCommon { @inlinable public func encode(input: String? = nil) -> Uint8Array { let this = jsObject - return this[Strings.encode].function!(this: this, arguments: [input?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.encode].function!(this: this, arguments: [input?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func encodeInto(source: String, destination: Uint8Array) -> TextEncoderEncodeIntoResult { let this = jsObject - return this[Strings.encodeInto].function!(this: this, arguments: [source.jsValue(), destination.jsValue()]).fromJSValue()! + return this[Strings.encodeInto].function!(this: this, arguments: [source.jsValue, destination.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift b/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift index a27918b0..9f2e0e03 100644 --- a/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift +++ b/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class TextEncoderEncodeIntoResult: BridgedDictionary { public convenience init(read: UInt64, written: UInt64) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.read] = read.jsValue() - object[Strings.written] = written.jsValue() + object[Strings.read] = read.jsValue + object[Strings.written] = written.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TextFormat.swift b/Sources/DOMKit/WebIDL/TextFormat.swift index 909996b0..5143ef8d 100644 --- a/Sources/DOMKit/WebIDL/TextFormat.swift +++ b/Sources/DOMKit/WebIDL/TextFormat.swift @@ -20,7 +20,7 @@ public class TextFormat: JSBridgedClass { } @inlinable public convenience init(options: TextFormatInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/TextFormatInit.swift b/Sources/DOMKit/WebIDL/TextFormatInit.swift index abdd4996..8c5d0097 100644 --- a/Sources/DOMKit/WebIDL/TextFormatInit.swift +++ b/Sources/DOMKit/WebIDL/TextFormatInit.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class TextFormatInit: BridgedDictionary { public convenience init(rangeStart: UInt32, rangeEnd: UInt32, textColor: String, backgroundColor: String, underlineStyle: String, underlineThickness: String, underlineColor: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rangeStart] = rangeStart.jsValue() - object[Strings.rangeEnd] = rangeEnd.jsValue() - object[Strings.textColor] = textColor.jsValue() - object[Strings.backgroundColor] = backgroundColor.jsValue() - object[Strings.underlineStyle] = underlineStyle.jsValue() - object[Strings.underlineThickness] = underlineThickness.jsValue() - object[Strings.underlineColor] = underlineColor.jsValue() + object[Strings.rangeStart] = rangeStart.jsValue + object[Strings.rangeEnd] = rangeEnd.jsValue + object[Strings.textColor] = textColor.jsValue + object[Strings.backgroundColor] = backgroundColor.jsValue + object[Strings.underlineStyle] = underlineStyle.jsValue + object[Strings.underlineThickness] = underlineThickness.jsValue + object[Strings.underlineColor] = underlineColor.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift index e203c3e9..26c7c78e 100644 --- a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift @@ -11,7 +11,7 @@ public class TextFormatUpdateEvent: Event { } @inlinable public convenience init(options: TextFormatUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @inlinable public func getTextFormats() -> [TextFormat] { diff --git a/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift b/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift index 7f8edc73..2dc74c8f 100644 --- a/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift +++ b/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class TextFormatUpdateEventInit: BridgedDictionary { public convenience init(textFormats: [TextFormat]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textFormats] = textFormats.jsValue() + object[Strings.textFormats] = textFormats.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index 3c803d8a..79b2f496 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -46,12 +46,12 @@ public class TextTrack: EventTarget { @inlinable public func addCue(cue: TextTrackCue) { let this = jsObject - _ = this[Strings.addCue].function!(this: this, arguments: [cue.jsValue()]) + _ = this[Strings.addCue].function!(this: this, arguments: [cue.jsValue]) } @inlinable public func removeCue(cue: TextTrackCue) { let this = jsObject - _ = this[Strings.removeCue].function!(this: this, arguments: [cue.jsValue()]) + _ = this[Strings.removeCue].function!(this: this, arguments: [cue.jsValue]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/TextTrackCueList.swift b/Sources/DOMKit/WebIDL/TextTrackCueList.swift index 0a43ff52..0c73392e 100644 --- a/Sources/DOMKit/WebIDL/TextTrackCueList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackCueList.swift @@ -22,6 +22,6 @@ public class TextTrackCueList: JSBridgedClass { @inlinable public func getCueById(id: String) -> TextTrackCue? { let this = jsObject - return this[Strings.getCueById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! + return this[Strings.getCueById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TextTrackKind.swift b/Sources/DOMKit/WebIDL/TextTrackKind.swift index 88fc9d33..ac618d36 100644 --- a/Sources/DOMKit/WebIDL/TextTrackKind.swift +++ b/Sources/DOMKit/WebIDL/TextTrackKind.swift @@ -21,5 +21,5 @@ public enum TextTrackKind: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/TextTrackList.swift b/Sources/DOMKit/WebIDL/TextTrackList.swift index 7e543ca5..fed8608c 100644 --- a/Sources/DOMKit/WebIDL/TextTrackList.swift +++ b/Sources/DOMKit/WebIDL/TextTrackList.swift @@ -23,7 +23,7 @@ public class TextTrackList: EventTarget { @inlinable public func getTrackById(id: String) -> TextTrack? { let this = jsObject - return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! + return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/TextTrackMode.swift b/Sources/DOMKit/WebIDL/TextTrackMode.swift index 5956cdc1..e4ae982f 100644 --- a/Sources/DOMKit/WebIDL/TextTrackMode.swift +++ b/Sources/DOMKit/WebIDL/TextTrackMode.swift @@ -19,5 +19,5 @@ public enum TextTrackMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/TextUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextUpdateEvent.swift index 14edcb66..c4515dbb 100644 --- a/Sources/DOMKit/WebIDL/TextUpdateEvent.swift +++ b/Sources/DOMKit/WebIDL/TextUpdateEvent.swift @@ -18,7 +18,7 @@ public class TextUpdateEvent: Event { } @inlinable public convenience init(options: TextUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift b/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift index 03b9b419..1b489b6d 100644 --- a/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift +++ b/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift @@ -6,13 +6,13 @@ import JavaScriptKit public class TextUpdateEventInit: BridgedDictionary { public convenience init(updateRangeStart: UInt32, updateRangeEnd: UInt32, text: String, selectionStart: UInt32, selectionEnd: UInt32, compositionStart: UInt32, compositionEnd: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.updateRangeStart] = updateRangeStart.jsValue() - object[Strings.updateRangeEnd] = updateRangeEnd.jsValue() - object[Strings.text] = text.jsValue() - object[Strings.selectionStart] = selectionStart.jsValue() - object[Strings.selectionEnd] = selectionEnd.jsValue() - object[Strings.compositionStart] = compositionStart.jsValue() - object[Strings.compositionEnd] = compositionEnd.jsValue() + object[Strings.updateRangeStart] = updateRangeStart.jsValue + object[Strings.updateRangeEnd] = updateRangeEnd.jsValue + object[Strings.text] = text.jsValue + object[Strings.selectionStart] = selectionStart.jsValue + object[Strings.selectionEnd] = selectionEnd.jsValue + object[Strings.compositionStart] = compositionStart.jsValue + object[Strings.compositionEnd] = compositionEnd.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TimeEvent.swift b/Sources/DOMKit/WebIDL/TimeEvent.swift index 719691e2..42adcf48 100644 --- a/Sources/DOMKit/WebIDL/TimeEvent.swift +++ b/Sources/DOMKit/WebIDL/TimeEvent.swift @@ -20,6 +20,6 @@ public class TimeEvent: Event { @inlinable public func initTimeEvent(typeArg: String, viewArg: Window?, detailArg: Int32) { let this = jsObject - _ = this[Strings.initTimeEvent].function!(this: this, arguments: [typeArg.jsValue(), viewArg.jsValue(), detailArg.jsValue()]) + _ = this[Strings.initTimeEvent].function!(this: this, arguments: [typeArg.jsValue, viewArg.jsValue, detailArg.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/TimeRanges.swift b/Sources/DOMKit/WebIDL/TimeRanges.swift index a63b7fcc..08e6948f 100644 --- a/Sources/DOMKit/WebIDL/TimeRanges.swift +++ b/Sources/DOMKit/WebIDL/TimeRanges.swift @@ -18,11 +18,11 @@ public class TimeRanges: JSBridgedClass { @inlinable public func start(index: UInt32) -> Double { let this = jsObject - return this[Strings.start].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + 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()! + return this[Strings.end].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TimelinePhase.swift b/Sources/DOMKit/WebIDL/TimelinePhase.swift index 8a5b5563..6c79111d 100644 --- a/Sources/DOMKit/WebIDL/TimelinePhase.swift +++ b/Sources/DOMKit/WebIDL/TimelinePhase.swift @@ -20,5 +20,5 @@ public enum TimelinePhase: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/TimerHandler.swift b/Sources/DOMKit/WebIDL/TimerHandler.swift index 93d60994..7610b41b 100644 --- a/Sources/DOMKit/WebIDL/TimerHandler.swift +++ b/Sources/DOMKit/WebIDL/TimerHandler.swift @@ -21,12 +21,12 @@ public enum TimerHandler: JSValueCompatible, Any_TimerHandler { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .jSFunction(jSFunction): - return jSFunction.jsValue() + return jSFunction.jsValue case let .string(string): - return string.jsValue() + return string.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/TokenBinding.swift b/Sources/DOMKit/WebIDL/TokenBinding.swift index b2dc049a..e7a93f6c 100644 --- a/Sources/DOMKit/WebIDL/TokenBinding.swift +++ b/Sources/DOMKit/WebIDL/TokenBinding.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class TokenBinding: BridgedDictionary { public convenience init(status: String, id: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.status] = status.jsValue() - object[Strings.id] = id.jsValue() + object[Strings.status] = status.jsValue + object[Strings.id] = id.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TokenBindingStatus.swift b/Sources/DOMKit/WebIDL/TokenBindingStatus.swift index 58de3dd9..c0e83bd4 100644 --- a/Sources/DOMKit/WebIDL/TokenBindingStatus.swift +++ b/Sources/DOMKit/WebIDL/TokenBindingStatus.swift @@ -18,5 +18,5 @@ public enum TokenBindingStatus: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Touch.swift b/Sources/DOMKit/WebIDL/Touch.swift index 3b093c91..202ab1b6 100644 --- a/Sources/DOMKit/WebIDL/Touch.swift +++ b/Sources/DOMKit/WebIDL/Touch.swift @@ -28,7 +28,7 @@ public class Touch: JSBridgedClass { } @inlinable public convenience init(touchInitDict: TouchInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [touchInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [touchInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TouchEvent.swift b/Sources/DOMKit/WebIDL/TouchEvent.swift index 186b487f..34b0dd20 100644 --- a/Sources/DOMKit/WebIDL/TouchEvent.swift +++ b/Sources/DOMKit/WebIDL/TouchEvent.swift @@ -18,7 +18,7 @@ public class TouchEvent: UIEvent { } @inlinable public convenience init(type: String, eventInitDict: TouchEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TouchEventInit.swift b/Sources/DOMKit/WebIDL/TouchEventInit.swift index 0b580bea..c4eb8d0b 100644 --- a/Sources/DOMKit/WebIDL/TouchEventInit.swift +++ b/Sources/DOMKit/WebIDL/TouchEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class TouchEventInit: BridgedDictionary { public convenience init(touches: [Touch], targetTouches: [Touch], changedTouches: [Touch]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.touches] = touches.jsValue() - object[Strings.targetTouches] = targetTouches.jsValue() - object[Strings.changedTouches] = changedTouches.jsValue() + object[Strings.touches] = touches.jsValue + object[Strings.targetTouches] = targetTouches.jsValue + object[Strings.changedTouches] = changedTouches.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TouchInit.swift b/Sources/DOMKit/WebIDL/TouchInit.swift index 562d6f18..7c27d875 100644 --- a/Sources/DOMKit/WebIDL/TouchInit.swift +++ b/Sources/DOMKit/WebIDL/TouchInit.swift @@ -6,21 +6,21 @@ import JavaScriptKit public class TouchInit: BridgedDictionary { public convenience init(identifier: Int32, target: EventTarget, clientX: Double, clientY: Double, screenX: Double, screenY: Double, pageX: Double, pageY: Double, radiusX: Float, radiusY: Float, rotationAngle: Float, force: Float, altitudeAngle: Double, azimuthAngle: Double, touchType: TouchType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.identifier] = identifier.jsValue() - object[Strings.target] = target.jsValue() - object[Strings.clientX] = clientX.jsValue() - object[Strings.clientY] = clientY.jsValue() - object[Strings.screenX] = screenX.jsValue() - object[Strings.screenY] = screenY.jsValue() - object[Strings.pageX] = pageX.jsValue() - object[Strings.pageY] = pageY.jsValue() - object[Strings.radiusX] = radiusX.jsValue() - object[Strings.radiusY] = radiusY.jsValue() - object[Strings.rotationAngle] = rotationAngle.jsValue() - object[Strings.force] = force.jsValue() - object[Strings.altitudeAngle] = altitudeAngle.jsValue() - object[Strings.azimuthAngle] = azimuthAngle.jsValue() - object[Strings.touchType] = touchType.jsValue() + object[Strings.identifier] = identifier.jsValue + object[Strings.target] = target.jsValue + object[Strings.clientX] = clientX.jsValue + object[Strings.clientY] = clientY.jsValue + object[Strings.screenX] = screenX.jsValue + object[Strings.screenY] = screenY.jsValue + object[Strings.pageX] = pageX.jsValue + object[Strings.pageY] = pageY.jsValue + object[Strings.radiusX] = radiusX.jsValue + object[Strings.radiusY] = radiusY.jsValue + object[Strings.rotationAngle] = rotationAngle.jsValue + object[Strings.force] = force.jsValue + object[Strings.altitudeAngle] = altitudeAngle.jsValue + object[Strings.azimuthAngle] = azimuthAngle.jsValue + object[Strings.touchType] = touchType.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TouchType.swift b/Sources/DOMKit/WebIDL/TouchType.swift index 23a2a100..54db8c02 100644 --- a/Sources/DOMKit/WebIDL/TouchType.swift +++ b/Sources/DOMKit/WebIDL/TouchType.swift @@ -18,5 +18,5 @@ public enum TouchType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/TrackEvent.swift b/Sources/DOMKit/WebIDL/TrackEvent.swift index 380be8ac..9312c8ab 100644 --- a/Sources/DOMKit/WebIDL/TrackEvent.swift +++ b/Sources/DOMKit/WebIDL/TrackEvent.swift @@ -12,7 +12,7 @@ public class TrackEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: TrackEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TrackEventInit.swift b/Sources/DOMKit/WebIDL/TrackEventInit.swift index 1e755c4b..a9485dd4 100644 --- a/Sources/DOMKit/WebIDL/TrackEventInit.swift +++ b/Sources/DOMKit/WebIDL/TrackEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit 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() + object[Strings.track] = track.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift b/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift index 78a32b4e..0ecf24c3 100644 --- a/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift +++ b/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift @@ -19,5 +19,5 @@ public enum TransactionAutomationMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/TransferFunction.swift b/Sources/DOMKit/WebIDL/TransferFunction.swift index f46a0bd2..b651bc4a 100644 --- a/Sources/DOMKit/WebIDL/TransferFunction.swift +++ b/Sources/DOMKit/WebIDL/TransferFunction.swift @@ -19,5 +19,5 @@ public enum TransferFunction: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/TransformStream.swift b/Sources/DOMKit/WebIDL/TransformStream.swift index 98f2a8f6..8c846726 100644 --- a/Sources/DOMKit/WebIDL/TransformStream.swift +++ b/Sources/DOMKit/WebIDL/TransformStream.swift @@ -15,7 +15,7 @@ public class TransformStream: JSBridgedClass { } @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])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [transformer?.jsValue ?? .undefined, writableStrategy?.jsValue ?? .undefined, readableStrategy?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift index 7b02004a..eb2e5927 100644 --- a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift @@ -18,12 +18,12 @@ public class TransformStreamDefaultController: JSBridgedClass { @inlinable public func enqueue(chunk: JSValue? = nil) { let this = jsObject - _ = this[Strings.enqueue].function!(this: this, arguments: [chunk?.jsValue() ?? .undefined]) + _ = 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]) + _ = this[Strings.error].function!(this: this, arguments: [reason?.jsValue ?? .undefined]) } @inlinable public func terminate() { diff --git a/Sources/DOMKit/WebIDL/Transformer.swift b/Sources/DOMKit/WebIDL/Transformer.swift index fbf0fd83..d1a8bce6 100644 --- a/Sources/DOMKit/WebIDL/Transformer.swift +++ b/Sources/DOMKit/WebIDL/Transformer.swift @@ -9,8 +9,8 @@ public class Transformer: BridgedDictionary { 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() + object[Strings.readableType] = readableType.jsValue + object[Strings.writableType] = writableType.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TransitionEvent.swift b/Sources/DOMKit/WebIDL/TransitionEvent.swift index b69a1471..167077f8 100644 --- a/Sources/DOMKit/WebIDL/TransitionEvent.swift +++ b/Sources/DOMKit/WebIDL/TransitionEvent.swift @@ -14,7 +14,7 @@ public class TransitionEvent: Event { } @inlinable public convenience init(type: String, transitionEventInitDict: TransitionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), transitionEventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, transitionEventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/TransitionEventInit.swift b/Sources/DOMKit/WebIDL/TransitionEventInit.swift index cc24ff96..48a8c1be 100644 --- a/Sources/DOMKit/WebIDL/TransitionEventInit.swift +++ b/Sources/DOMKit/WebIDL/TransitionEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class TransitionEventInit: BridgedDictionary { public convenience init(propertyName: String, elapsedTime: Double, pseudoElement: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.propertyName] = propertyName.jsValue() - object[Strings.elapsedTime] = elapsedTime.jsValue() - object[Strings.pseudoElement] = pseudoElement.jsValue() + object[Strings.propertyName] = propertyName.jsValue + object[Strings.elapsedTime] = elapsedTime.jsValue + object[Strings.pseudoElement] = pseudoElement.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/TrustedHTML.swift b/Sources/DOMKit/WebIDL/TrustedHTML.swift index 772d5922..93921148 100644 --- a/Sources/DOMKit/WebIDL/TrustedHTML.swift +++ b/Sources/DOMKit/WebIDL/TrustedHTML.swift @@ -23,6 +23,6 @@ public class TrustedHTML: JSBridgedClass { @inlinable public static func fromLiteral(templateStringsArray: JSObject) -> Self { let this = constructor - return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue()]).fromJSValue()! + return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrustedScript.swift b/Sources/DOMKit/WebIDL/TrustedScript.swift index ad1a1643..606aaa12 100644 --- a/Sources/DOMKit/WebIDL/TrustedScript.swift +++ b/Sources/DOMKit/WebIDL/TrustedScript.swift @@ -23,6 +23,6 @@ public class TrustedScript: JSBridgedClass { @inlinable public static func fromLiteral(templateStringsArray: JSObject) -> Self { let this = constructor - return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue()]).fromJSValue()! + return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrustedScriptURL.swift b/Sources/DOMKit/WebIDL/TrustedScriptURL.swift index 95c96d92..084ede19 100644 --- a/Sources/DOMKit/WebIDL/TrustedScriptURL.swift +++ b/Sources/DOMKit/WebIDL/TrustedScriptURL.swift @@ -23,6 +23,6 @@ public class TrustedScriptURL: JSBridgedClass { @inlinable public static func fromLiteral(templateStringsArray: JSObject) -> Self { let this = constructor - return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue()]).fromJSValue()! + return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrustedType.swift b/Sources/DOMKit/WebIDL/TrustedType.swift index bd772451..059c32ac 100644 --- a/Sources/DOMKit/WebIDL/TrustedType.swift +++ b/Sources/DOMKit/WebIDL/TrustedType.swift @@ -26,14 +26,14 @@ public enum TrustedType: JSValueCompatible, Any_TrustedType { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .trustedHTML(trustedHTML): - return trustedHTML.jsValue() + return trustedHTML.jsValue case let .trustedScript(trustedScript): - return trustedScript.jsValue() + return trustedScript.jsValue case let .trustedScriptURL(trustedScriptURL): - return trustedScriptURL.jsValue() + return trustedScriptURL.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift index c6330a4a..8fb5e993 100644 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift @@ -18,16 +18,16 @@ public class TrustedTypePolicy: JSBridgedClass { @inlinable public func createHTML(input: String, arguments: JSValue...) -> TrustedHTML { let this = jsObject - return this[Strings.createHTML].function!(this: this, arguments: [input.jsValue()] + arguments.map { $0.jsValue() }).fromJSValue()! + return this[Strings.createHTML].function!(this: this, arguments: [input.jsValue] + arguments.map(\.jsValue)).fromJSValue()! } @inlinable public func createScript(input: String, arguments: JSValue...) -> TrustedScript { let this = jsObject - return this[Strings.createScript].function!(this: this, arguments: [input.jsValue()] + arguments.map { $0.jsValue() }).fromJSValue()! + return this[Strings.createScript].function!(this: this, arguments: [input.jsValue] + arguments.map(\.jsValue)).fromJSValue()! } @inlinable public func createScriptURL(input: String, arguments: JSValue...) -> TrustedScriptURL { let this = jsObject - return this[Strings.createScriptURL].function!(this: this, arguments: [input.jsValue()] + arguments.map { $0.jsValue() }).fromJSValue()! + return this[Strings.createScriptURL].function!(this: this, arguments: [input.jsValue] + arguments.map(\.jsValue)).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift index 4a2aa735..2bb4f844 100644 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift +++ b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift @@ -19,17 +19,17 @@ public class TrustedTypePolicyFactory: JSBridgedClass { @inlinable public func isHTML(value: JSValue) -> Bool { let this = jsObject - return this[Strings.isHTML].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.isHTML].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public func isScript(value: JSValue) -> Bool { let this = jsObject - return this[Strings.isScript].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.isScript].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @inlinable public func isScriptURL(value: JSValue) -> Bool { let this = jsObject - return this[Strings.isScriptURL].function!(this: this, arguments: [value.jsValue()]).fromJSValue()! + return this[Strings.isScriptURL].function!(this: this, arguments: [value.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -40,12 +40,12 @@ public class TrustedTypePolicyFactory: JSBridgedClass { @inlinable public func getAttributeType(tagName: String, attribute: String, elementNs: String? = nil, attrNs: String? = nil) -> String? { let this = jsObject - return this[Strings.getAttributeType].function!(this: this, arguments: [tagName.jsValue(), attribute.jsValue(), elementNs?.jsValue() ?? .undefined, attrNs?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getAttributeType].function!(this: this, arguments: [tagName.jsValue, attribute.jsValue, elementNs?.jsValue ?? .undefined, attrNs?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func getPropertyType(tagName: String, property: String, elementNs: String? = nil) -> String? { let this = jsObject - return this[Strings.getPropertyType].function!(this: this, arguments: [tagName.jsValue(), property.jsValue(), elementNs?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getPropertyType].function!(this: this, arguments: [tagName.jsValue, property.jsValue, elementNs?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/UADataValues.swift b/Sources/DOMKit/WebIDL/UADataValues.swift index e75eb0d8..f72ac9fa 100644 --- a/Sources/DOMKit/WebIDL/UADataValues.swift +++ b/Sources/DOMKit/WebIDL/UADataValues.swift @@ -6,16 +6,16 @@ import JavaScriptKit public class UADataValues: BridgedDictionary { public convenience init(brands: [NavigatorUABrandVersion], mobile: Bool, architecture: String, bitness: String, model: String, platform: String, platformVersion: String, uaFullVersion: String, wow64: Bool, fullVersionList: [NavigatorUABrandVersion]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.brands] = brands.jsValue() - object[Strings.mobile] = mobile.jsValue() - object[Strings.architecture] = architecture.jsValue() - object[Strings.bitness] = bitness.jsValue() - object[Strings.model] = model.jsValue() - object[Strings.platform] = platform.jsValue() - object[Strings.platformVersion] = platformVersion.jsValue() - object[Strings.uaFullVersion] = uaFullVersion.jsValue() - object[Strings.wow64] = wow64.jsValue() - object[Strings.fullVersionList] = fullVersionList.jsValue() + object[Strings.brands] = brands.jsValue + object[Strings.mobile] = mobile.jsValue + object[Strings.architecture] = architecture.jsValue + object[Strings.bitness] = bitness.jsValue + object[Strings.model] = model.jsValue + object[Strings.platform] = platform.jsValue + object[Strings.platformVersion] = platformVersion.jsValue + object[Strings.uaFullVersion] = uaFullVersion.jsValue + object[Strings.wow64] = wow64.jsValue + object[Strings.fullVersionList] = fullVersionList.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift b/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift index 33e5dac2..027232bc 100644 --- a/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift +++ b/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class UALowEntropyJSON: BridgedDictionary { public convenience init(brands: [NavigatorUABrandVersion], mobile: Bool, platform: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.brands] = brands.jsValue() - object[Strings.mobile] = mobile.jsValue() - object[Strings.platform] = platform.jsValue() + object[Strings.brands] = brands.jsValue + object[Strings.mobile] = mobile.jsValue + object[Strings.platform] = platform.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index a6eb311d..eb9fe8d3 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -18,7 +18,7 @@ public class UIEvent: Event { public var sourceCapabilities: InputDeviceCapabilities? @inlinable public convenience init(type: String, eventInitDict: UIEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -29,7 +29,7 @@ public class UIEvent: Event { @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]) + _ = this[Strings.initUIEvent].function!(this: this, arguments: [typeArg.jsValue, bubblesArg?.jsValue ?? .undefined, cancelableArg?.jsValue ?? .undefined, viewArg?.jsValue ?? .undefined, detailArg?.jsValue ?? .undefined]) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/UIEventInit.swift b/Sources/DOMKit/WebIDL/UIEventInit.swift index 7d98368a..f832a8ae 100644 --- a/Sources/DOMKit/WebIDL/UIEventInit.swift +++ b/Sources/DOMKit/WebIDL/UIEventInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class UIEventInit: BridgedDictionary { public convenience init(sourceCapabilities: InputDeviceCapabilities?, view: Window?, detail: Int32, which: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sourceCapabilities] = sourceCapabilities.jsValue() - object[Strings.view] = view.jsValue() - object[Strings.detail] = detail.jsValue() - object[Strings.which] = which.jsValue() + object[Strings.sourceCapabilities] = sourceCapabilities.jsValue + object[Strings.view] = view.jsValue + object[Strings.detail] = detail.jsValue + object[Strings.which] = which.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ULongRange.swift b/Sources/DOMKit/WebIDL/ULongRange.swift index 10d39171..cf578d6c 100644 --- a/Sources/DOMKit/WebIDL/ULongRange.swift +++ b/Sources/DOMKit/WebIDL/ULongRange.swift @@ -6,8 +6,8 @@ import JavaScriptKit 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() + object[Strings.max] = max.jsValue + object[Strings.min] = min.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/URL.swift b/Sources/DOMKit/WebIDL/URL.swift index 81e31010..989d2811 100644 --- a/Sources/DOMKit/WebIDL/URL.swift +++ b/Sources/DOMKit/WebIDL/URL.swift @@ -26,16 +26,16 @@ public class URL: JSBridgedClass { @inlinable public static func createObjectURL(obj: Blob_or_MediaSource) -> String { let this = constructor - return this[Strings.createObjectURL].function!(this: this, arguments: [obj.jsValue()]).fromJSValue()! + 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()]) + _ = 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])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue, base?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/URLPattern.swift b/Sources/DOMKit/WebIDL/URLPattern.swift index 35a7ae1a..9c9a6651 100644 --- a/Sources/DOMKit/WebIDL/URLPattern.swift +++ b/Sources/DOMKit/WebIDL/URLPattern.swift @@ -21,17 +21,17 @@ public class URLPattern: JSBridgedClass { } @inlinable public convenience init(input: URLPatternInput? = nil, baseURL: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [input?.jsValue ?? .undefined, baseURL?.jsValue ?? .undefined])) } @inlinable public func test(input: URLPatternInput? = nil, baseURL: String? = nil) -> Bool { let this = jsObject - return this[Strings.test].function!(this: this, arguments: [input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.test].function!(this: this, arguments: [input?.jsValue ?? .undefined, baseURL?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func exec(input: URLPatternInput? = nil, baseURL: String? = nil) -> URLPatternResult? { let this = jsObject - return this[Strings.exec].function!(this: this, arguments: [input?.jsValue() ?? .undefined, baseURL?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.exec].function!(this: this, arguments: [input?.jsValue ?? .undefined, baseURL?.jsValue ?? .undefined]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift b/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift index 03c205ee..8e6bebe4 100644 --- a/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift +++ b/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class URLPatternComponentResult: BridgedDictionary { public convenience init(input: String, groups: [String: String?]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.input] = input.jsValue() - object[Strings.groups] = groups.jsValue() + object[Strings.input] = input.jsValue + object[Strings.groups] = groups.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/URLPatternInit.swift b/Sources/DOMKit/WebIDL/URLPatternInit.swift index ca2ceadb..f71b535b 100644 --- a/Sources/DOMKit/WebIDL/URLPatternInit.swift +++ b/Sources/DOMKit/WebIDL/URLPatternInit.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class URLPatternInit: BridgedDictionary { public convenience init(protocol: String, username: String, password: String, hostname: String, port: String, pathname: String, search: String, hash: String, baseURL: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.protocol] = `protocol`.jsValue() - object[Strings.username] = username.jsValue() - object[Strings.password] = password.jsValue() - object[Strings.hostname] = hostname.jsValue() - object[Strings.port] = port.jsValue() - object[Strings.pathname] = pathname.jsValue() - object[Strings.search] = search.jsValue() - object[Strings.hash] = hash.jsValue() - object[Strings.baseURL] = baseURL.jsValue() + object[Strings.protocol] = `protocol`.jsValue + object[Strings.username] = username.jsValue + object[Strings.password] = password.jsValue + object[Strings.hostname] = hostname.jsValue + object[Strings.port] = port.jsValue + object[Strings.pathname] = pathname.jsValue + object[Strings.search] = search.jsValue + object[Strings.hash] = hash.jsValue + object[Strings.baseURL] = baseURL.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/URLPatternInput.swift b/Sources/DOMKit/WebIDL/URLPatternInput.swift index 206482cd..d24fd28f 100644 --- a/Sources/DOMKit/WebIDL/URLPatternInput.swift +++ b/Sources/DOMKit/WebIDL/URLPatternInput.swift @@ -21,12 +21,12 @@ public enum URLPatternInput: JSValueCompatible, Any_URLPatternInput { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .string(string): - return string.jsValue() + return string.jsValue case let .uRLPatternInit(uRLPatternInit): - return uRLPatternInit.jsValue() + return uRLPatternInit.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/URLPatternResult.swift b/Sources/DOMKit/WebIDL/URLPatternResult.swift index 87c68abf..c66ecf59 100644 --- a/Sources/DOMKit/WebIDL/URLPatternResult.swift +++ b/Sources/DOMKit/WebIDL/URLPatternResult.swift @@ -6,15 +6,15 @@ import JavaScriptKit public class URLPatternResult: BridgedDictionary { public convenience init(inputs: [URLPatternInput], protocol: URLPatternComponentResult, username: URLPatternComponentResult, password: URLPatternComponentResult, hostname: URLPatternComponentResult, port: URLPatternComponentResult, pathname: URLPatternComponentResult, search: URLPatternComponentResult, hash: URLPatternComponentResult) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.inputs] = inputs.jsValue() - object[Strings.protocol] = `protocol`.jsValue() - object[Strings.username] = username.jsValue() - object[Strings.password] = password.jsValue() - object[Strings.hostname] = hostname.jsValue() - object[Strings.port] = port.jsValue() - object[Strings.pathname] = pathname.jsValue() - object[Strings.search] = search.jsValue() - object[Strings.hash] = hash.jsValue() + object[Strings.inputs] = inputs.jsValue + object[Strings.protocol] = `protocol`.jsValue + object[Strings.username] = username.jsValue + object[Strings.password] = password.jsValue + object[Strings.hostname] = hostname.jsValue + object[Strings.port] = port.jsValue + object[Strings.pathname] = pathname.jsValue + object[Strings.search] = search.jsValue + object[Strings.hash] = hash.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/URLSearchParams.swift b/Sources/DOMKit/WebIDL/URLSearchParams.swift index d5cbca73..7d151f74 100644 --- a/Sources/DOMKit/WebIDL/URLSearchParams.swift +++ b/Sources/DOMKit/WebIDL/URLSearchParams.swift @@ -13,37 +13,37 @@ public class URLSearchParams: JSBridgedClass, Sequence { } @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])) + 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()]) + _ = 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()]) + _ = 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()! + return this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func getAll(name: String) -> [String] { let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.getAll].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func has(name: String) -> Bool { let this = jsObject - return this[Strings.has].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.has].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func set(name: String, value: String) { let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) + _ = this[Strings.set].function!(this: this, arguments: [name.jsValue, value.jsValue]) } @inlinable public func sort() { diff --git a/Sources/DOMKit/WebIDL/USB.swift b/Sources/DOMKit/WebIDL/USB.swift index 5ce44c44..f97bbc9b 100644 --- a/Sources/DOMKit/WebIDL/USB.swift +++ b/Sources/DOMKit/WebIDL/USB.swift @@ -27,18 +27,18 @@ public class USB: EventTarget { @inlinable public func getDevices() async throws -> [USBDevice] { let this = jsObject let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func requestDevice(options: USBDeviceRequestOptions) -> JSPromise { let this = jsObject - return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! + return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestDevice(options: USBDeviceRequestOptions) async throws -> USBDevice { let this = jsObject - let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/USBAlternateInterface.swift b/Sources/DOMKit/WebIDL/USBAlternateInterface.swift index fd3bc19e..cbc8f3ed 100644 --- a/Sources/DOMKit/WebIDL/USBAlternateInterface.swift +++ b/Sources/DOMKit/WebIDL/USBAlternateInterface.swift @@ -19,7 +19,7 @@ public class USBAlternateInterface: JSBridgedClass { } @inlinable public convenience init(deviceInterface: USBInterface, alternateSetting: UInt8) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInterface.jsValue(), alternateSetting.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInterface.jsValue, alternateSetting.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBConfiguration.swift b/Sources/DOMKit/WebIDL/USBConfiguration.swift index e30dce2f..ebd3dbee 100644 --- a/Sources/DOMKit/WebIDL/USBConfiguration.swift +++ b/Sources/DOMKit/WebIDL/USBConfiguration.swift @@ -16,7 +16,7 @@ public class USBConfiguration: JSBridgedClass { } @inlinable public convenience init(device: USBDevice, configurationValue: UInt8) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [device.jsValue(), configurationValue.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [device.jsValue, configurationValue.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBConnectionEvent.swift b/Sources/DOMKit/WebIDL/USBConnectionEvent.swift index 283cf60c..0edb961c 100644 --- a/Sources/DOMKit/WebIDL/USBConnectionEvent.swift +++ b/Sources/DOMKit/WebIDL/USBConnectionEvent.swift @@ -12,7 +12,7 @@ public class USBConnectionEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: USBConnectionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift b/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift index 7e7d012f..48706613 100644 --- a/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift +++ b/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class USBConnectionEventInit: BridgedDictionary { public convenience init(device: USBDevice) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue() + object[Strings.device] = device.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift b/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift index 2899d04c..facee2e3 100644 --- a/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift +++ b/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class USBControlTransferParameters: BridgedDictionary { public convenience init(requestType: USBRequestType, recipient: USBRecipient, request: UInt8, value: UInt16, index: UInt16) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.requestType] = requestType.jsValue() - object[Strings.recipient] = recipient.jsValue() - object[Strings.request] = request.jsValue() - object[Strings.value] = value.jsValue() - object[Strings.index] = index.jsValue() + object[Strings.requestType] = requestType.jsValue + object[Strings.recipient] = recipient.jsValue + object[Strings.request] = request.jsValue + object[Strings.value] = value.jsValue + object[Strings.index] = index.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/USBDevice.swift b/Sources/DOMKit/WebIDL/USBDevice.swift index a751ec6e..c40dcd88 100644 --- a/Sources/DOMKit/WebIDL/USBDevice.swift +++ b/Sources/DOMKit/WebIDL/USBDevice.swift @@ -89,7 +89,7 @@ public class USBDevice: JSBridgedClass { @inlinable public func open() async throws { let this = jsObject let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func close() -> JSPromise { @@ -101,7 +101,7 @@ public class USBDevice: JSBridgedClass { @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func forget() -> JSPromise { @@ -113,139 +113,139 @@ public class USBDevice: JSBridgedClass { @inlinable public func forget() async throws { let this = jsObject let _promise: JSPromise = this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func selectConfiguration(configurationValue: UInt8) -> JSPromise { let this = jsObject - return this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue()]).fromJSValue()! + return this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func selectConfiguration(configurationValue: UInt8) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func claimInterface(interfaceNumber: UInt8) -> JSPromise { let this = jsObject - return this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! + return this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func claimInterface(interfaceNumber: UInt8) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func releaseInterface(interfaceNumber: UInt8) -> JSPromise { let this = jsObject - return this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! + return this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func releaseInterface(interfaceNumber: UInt8) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) -> JSPromise { let this = jsObject - return this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue(), alternateSetting.jsValue()]).fromJSValue()! + return this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue, alternateSetting.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue(), alternateSetting.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue, alternateSetting.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) -> JSPromise { let this = jsObject - return this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue(), length.jsValue()]).fromJSValue()! + return this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue, length.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) async throws -> USBInTransferResult { let this = jsObject - let _promise: JSPromise = this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue(), length.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue, length.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) -> JSPromise { let this = jsObject - return this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue(), data?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue, data?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) async throws -> USBOutTransferResult { let this = jsObject - let _promise: JSPromise = this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue(), data?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue, data?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func clearHalt(direction: USBDirection, endpointNumber: UInt8) -> JSPromise { let this = jsObject - return this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue(), endpointNumber.jsValue()]).fromJSValue()! + return this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue, endpointNumber.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func clearHalt(direction: USBDirection, endpointNumber: UInt8) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue(), endpointNumber.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue, endpointNumber.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func transferIn(endpointNumber: UInt8, length: UInt32) -> JSPromise { let this = jsObject - return this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue(), length.jsValue()]).fromJSValue()! + return this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue, length.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func transferIn(endpointNumber: UInt8, length: UInt32) async throws -> USBInTransferResult { let this = jsObject - let _promise: JSPromise = this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue(), length.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue, length.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func transferOut(endpointNumber: UInt8, data: BufferSource) -> JSPromise { let this = jsObject - return this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue()]).fromJSValue()! + return this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue, data.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func transferOut(endpointNumber: UInt8, data: BufferSource) async throws -> USBOutTransferResult { let this = jsObject - let _promise: JSPromise = this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue, data.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) -> JSPromise { let this = jsObject - return this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue(), packetLengths.jsValue()]).fromJSValue()! + return this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue, packetLengths.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) async throws -> USBIsochronousInTransferResult { let this = jsObject - let _promise: JSPromise = this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue(), packetLengths.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue, packetLengths.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) -> JSPromise { let this = jsObject - return this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()]).fromJSValue()! + return this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue, data.jsValue, packetLengths.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) async throws -> USBIsochronousOutTransferResult { let this = jsObject - let _promise: JSPromise = this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue(), data.jsValue(), packetLengths.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue, data.jsValue, packetLengths.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func reset() -> JSPromise { @@ -257,6 +257,6 @@ public class USBDevice: JSBridgedClass { @inlinable public func reset() async throws { let this = jsObject let _promise: JSPromise = this[Strings.reset].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/USBDeviceFilter.swift b/Sources/DOMKit/WebIDL/USBDeviceFilter.swift index abf01e2e..ed7612d7 100644 --- a/Sources/DOMKit/WebIDL/USBDeviceFilter.swift +++ b/Sources/DOMKit/WebIDL/USBDeviceFilter.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class USBDeviceFilter: BridgedDictionary { public convenience init(vendorId: UInt16, productId: UInt16, classCode: UInt8, subclassCode: UInt8, protocolCode: UInt8, serialNumber: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.vendorId] = vendorId.jsValue() - object[Strings.productId] = productId.jsValue() - object[Strings.classCode] = classCode.jsValue() - object[Strings.subclassCode] = subclassCode.jsValue() - object[Strings.protocolCode] = protocolCode.jsValue() - object[Strings.serialNumber] = serialNumber.jsValue() + object[Strings.vendorId] = vendorId.jsValue + object[Strings.productId] = productId.jsValue + object[Strings.classCode] = classCode.jsValue + object[Strings.subclassCode] = subclassCode.jsValue + object[Strings.protocolCode] = protocolCode.jsValue + object[Strings.serialNumber] = serialNumber.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift b/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift index 855ead0d..3eb302b1 100644 --- a/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift +++ b/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class USBDeviceRequestOptions: BridgedDictionary { public convenience init(filters: [USBDeviceFilter]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue() + object[Strings.filters] = filters.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/USBDirection.swift b/Sources/DOMKit/WebIDL/USBDirection.swift index 4ef1ac1a..94554433 100644 --- a/Sources/DOMKit/WebIDL/USBDirection.swift +++ b/Sources/DOMKit/WebIDL/USBDirection.swift @@ -18,5 +18,5 @@ public enum USBDirection: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/USBEndpoint.swift b/Sources/DOMKit/WebIDL/USBEndpoint.swift index 7a1216bc..afafd821 100644 --- a/Sources/DOMKit/WebIDL/USBEndpoint.swift +++ b/Sources/DOMKit/WebIDL/USBEndpoint.swift @@ -17,7 +17,7 @@ public class USBEndpoint: JSBridgedClass { } @inlinable public convenience init(alternate: USBAlternateInterface, endpointNumber: UInt8, direction: USBDirection) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [alternate.jsValue(), endpointNumber.jsValue(), direction.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [alternate.jsValue, endpointNumber.jsValue, direction.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBEndpointType.swift b/Sources/DOMKit/WebIDL/USBEndpointType.swift index f8b8e62a..788df343 100644 --- a/Sources/DOMKit/WebIDL/USBEndpointType.swift +++ b/Sources/DOMKit/WebIDL/USBEndpointType.swift @@ -19,5 +19,5 @@ public enum USBEndpointType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/USBInTransferResult.swift b/Sources/DOMKit/WebIDL/USBInTransferResult.swift index cde713ee..31b13e10 100644 --- a/Sources/DOMKit/WebIDL/USBInTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBInTransferResult.swift @@ -15,7 +15,7 @@ public class USBInTransferResult: JSBridgedClass { } @inlinable public convenience init(status: USBTransferStatus, data: DataView? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), data?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue, data?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBInterface.swift b/Sources/DOMKit/WebIDL/USBInterface.swift index b2ecd8bf..4a1f3d93 100644 --- a/Sources/DOMKit/WebIDL/USBInterface.swift +++ b/Sources/DOMKit/WebIDL/USBInterface.swift @@ -17,7 +17,7 @@ public class USBInterface: JSBridgedClass { } @inlinable public convenience init(configuration: USBConfiguration, interfaceNumber: UInt8) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration.jsValue(), interfaceNumber.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration.jsValue, interfaceNumber.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift index 1099b98f..e7f6ff47 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift @@ -15,7 +15,7 @@ public class USBIsochronousInTransferPacket: JSBridgedClass { } @inlinable public convenience init(status: USBTransferStatus, data: DataView? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), data?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue, data?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift index 4bbaabf8..14be528d 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift @@ -15,7 +15,7 @@ public class USBIsochronousInTransferResult: JSBridgedClass { } @inlinable public convenience init(packets: [USBIsochronousInTransferPacket], data: DataView? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue(), data?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue, data?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift index 1d34504d..21f3c1e8 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift @@ -15,7 +15,7 @@ public class USBIsochronousOutTransferPacket: JSBridgedClass { } @inlinable public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), bytesWritten?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue, bytesWritten?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift index b18b7a12..c08b561b 100644 --- a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift @@ -14,7 +14,7 @@ public class USBIsochronousOutTransferResult: JSBridgedClass { } @inlinable public convenience init(packets: [USBIsochronousOutTransferPacket]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBOutTransferResult.swift index 12cc5146..6f934e5e 100644 --- a/Sources/DOMKit/WebIDL/USBOutTransferResult.swift +++ b/Sources/DOMKit/WebIDL/USBOutTransferResult.swift @@ -15,7 +15,7 @@ public class USBOutTransferResult: JSBridgedClass { } @inlinable public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue(), bytesWritten?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue, bytesWritten?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift index 5273766f..3db2823b 100644 --- a/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class USBPermissionDescriptor: BridgedDictionary { public convenience init(filters: [USBDeviceFilter]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue() + object[Strings.filters] = filters.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/USBPermissionStorage.swift b/Sources/DOMKit/WebIDL/USBPermissionStorage.swift index 2ba1d6cd..79d2bf4b 100644 --- a/Sources/DOMKit/WebIDL/USBPermissionStorage.swift +++ b/Sources/DOMKit/WebIDL/USBPermissionStorage.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class USBPermissionStorage: BridgedDictionary { public convenience init(allowedDevices: [AllowedUSBDevice]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowedDevices] = allowedDevices.jsValue() + object[Strings.allowedDevices] = allowedDevices.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/USBRecipient.swift b/Sources/DOMKit/WebIDL/USBRecipient.swift index 0c3631ee..9904f9a6 100644 --- a/Sources/DOMKit/WebIDL/USBRecipient.swift +++ b/Sources/DOMKit/WebIDL/USBRecipient.swift @@ -20,5 +20,5 @@ public enum USBRecipient: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/USBRequestType.swift b/Sources/DOMKit/WebIDL/USBRequestType.swift index e6d5830e..11a63ba9 100644 --- a/Sources/DOMKit/WebIDL/USBRequestType.swift +++ b/Sources/DOMKit/WebIDL/USBRequestType.swift @@ -19,5 +19,5 @@ public enum USBRequestType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/USBTransferStatus.swift b/Sources/DOMKit/WebIDL/USBTransferStatus.swift index d10081b4..b606d552 100644 --- a/Sources/DOMKit/WebIDL/USBTransferStatus.swift +++ b/Sources/DOMKit/WebIDL/USBTransferStatus.swift @@ -19,5 +19,5 @@ public enum USBTransferStatus: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Uint32List.swift b/Sources/DOMKit/WebIDL/Uint32List.swift index fef259a8..846c355b 100644 --- a/Sources/DOMKit/WebIDL/Uint32List.swift +++ b/Sources/DOMKit/WebIDL/Uint32List.swift @@ -21,12 +21,12 @@ public enum Uint32List: JSValueCompatible, Any_Uint32List { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .uint32Array(uint32Array): - return uint32Array.jsValue() + return uint32Array.jsValue case let .seq_of_GLuint(seq_of_GLuint): - return seq_of_GLuint.jsValue() + return seq_of_GLuint.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift b/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift index a616dd27..7f972e97 100644 --- a/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift +++ b/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift @@ -17,7 +17,7 @@ public class UncalibratedMagnetometer: Sensor { } @inlinable public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift b/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift index 802aa3f7..ee4e1cb3 100644 --- a/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift +++ b/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class UncalibratedMagnetometerReadingValues: BridgedDictionary { public convenience init(x: Double?, y: Double?, z: Double?, xBias: Double?, yBias: Double?, zBias: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.z] = z.jsValue() - object[Strings.xBias] = xBias.jsValue() - object[Strings.yBias] = yBias.jsValue() - object[Strings.zBias] = zBias.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.z] = z.jsValue + object[Strings.xBias] = xBias.jsValue + object[Strings.yBias] = yBias.jsValue + object[Strings.zBias] = zBias.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift index db20ec64..e4f52ec2 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSink.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSink.swift @@ -10,7 +10,7 @@ public class UnderlyingSink: BridgedDictionary { 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.type] = type.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/UnderlyingSource.swift b/Sources/DOMKit/WebIDL/UnderlyingSource.swift index fc9b2772..65db6d2f 100644 --- a/Sources/DOMKit/WebIDL/UnderlyingSource.swift +++ b/Sources/DOMKit/WebIDL/UnderlyingSource.swift @@ -9,8 +9,8 @@ public class UnderlyingSource: BridgedDictionary { 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.type] = type.jsValue + object[Strings.autoAllocateChunkSize] = autoAllocateChunkSize.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/UserIdleState.swift b/Sources/DOMKit/WebIDL/UserIdleState.swift index fde09f8d..39a67c87 100644 --- a/Sources/DOMKit/WebIDL/UserIdleState.swift +++ b/Sources/DOMKit/WebIDL/UserIdleState.swift @@ -18,5 +18,5 @@ public enum UserIdleState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift b/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift index 0bfbfc90..f2228d3c 100644 --- a/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift +++ b/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift @@ -19,5 +19,5 @@ public enum UserVerificationRequirement: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/VTTCue.swift b/Sources/DOMKit/WebIDL/VTTCue.swift index a8d96410..08fac506 100644 --- a/Sources/DOMKit/WebIDL/VTTCue.swift +++ b/Sources/DOMKit/WebIDL/VTTCue.swift @@ -21,7 +21,7 @@ public class VTTCue: TextTrackCue { } @inlinable public convenience init(startTime: Double, endTime: Double, text: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue(), endTime.jsValue(), text.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue, endTime.jsValue, text.jsValue])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift index 9cc09b1c..4686cec3 100644 --- a/Sources/DOMKit/WebIDL/ValidityStateFlags.swift +++ b/Sources/DOMKit/WebIDL/ValidityStateFlags.swift @@ -6,16 +6,16 @@ import JavaScriptKit 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() + 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) } diff --git a/Sources/DOMKit/WebIDL/ValueEvent.swift b/Sources/DOMKit/WebIDL/ValueEvent.swift index 7c6e7a9f..1145d599 100644 --- a/Sources/DOMKit/WebIDL/ValueEvent.swift +++ b/Sources/DOMKit/WebIDL/ValueEvent.swift @@ -12,7 +12,7 @@ public class ValueEvent: Event { } @inlinable public convenience init(type: String, initDict: ValueEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), initDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, initDict?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/ValueEventInit.swift b/Sources/DOMKit/WebIDL/ValueEventInit.swift index 5f5c047a..46b076b8 100644 --- a/Sources/DOMKit/WebIDL/ValueEventInit.swift +++ b/Sources/DOMKit/WebIDL/ValueEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class ValueEventInit: BridgedDictionary { public convenience init(value: JSValue) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.value] = value.jsValue() + object[Strings.value] = value.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/ValueType.swift b/Sources/DOMKit/WebIDL/ValueType.swift index 6b66c2b4..acc88c0e 100644 --- a/Sources/DOMKit/WebIDL/ValueType.swift +++ b/Sources/DOMKit/WebIDL/ValueType.swift @@ -23,5 +23,5 @@ public enum ValueType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/VibratePattern.swift b/Sources/DOMKit/WebIDL/VibratePattern.swift index 3dc59c57..9325923d 100644 --- a/Sources/DOMKit/WebIDL/VibratePattern.swift +++ b/Sources/DOMKit/WebIDL/VibratePattern.swift @@ -21,12 +21,12 @@ public enum VibratePattern: JSValueCompatible, Any_VibratePattern { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .uInt32(uInt32): - return uInt32.jsValue() + return uInt32.jsValue case let .seq_of_UInt32(seq_of_UInt32): - return seq_of_UInt32.jsValue() + return seq_of_UInt32.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift b/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift index 0d3861b4..364fa134 100644 --- a/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift +++ b/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift @@ -19,5 +19,5 @@ public enum VideoColorPrimaries: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/VideoColorSpace.swift b/Sources/DOMKit/WebIDL/VideoColorSpace.swift index e74ef0f1..25b08860 100644 --- a/Sources/DOMKit/WebIDL/VideoColorSpace.swift +++ b/Sources/DOMKit/WebIDL/VideoColorSpace.swift @@ -17,7 +17,7 @@ public class VideoColorSpace: JSBridgedClass { } @inlinable public convenience init(init: VideoColorSpaceInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift b/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift index f8074aa7..786cfccc 100644 --- a/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift +++ b/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift @@ -6,10 +6,10 @@ 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() + object[Strings.primaries] = primaries.jsValue + object[Strings.transfer] = transfer.jsValue + object[Strings.matrix] = matrix.jsValue + object[Strings.fullRange] = fullRange.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/VideoConfiguration.swift b/Sources/DOMKit/WebIDL/VideoConfiguration.swift index da32c0fe..fbb45126 100644 --- a/Sources/DOMKit/WebIDL/VideoConfiguration.swift +++ b/Sources/DOMKit/WebIDL/VideoConfiguration.swift @@ -6,16 +6,16 @@ import JavaScriptKit public class VideoConfiguration: BridgedDictionary { public convenience init(contentType: String, width: UInt32, height: UInt32, bitrate: UInt64, framerate: Double, hasAlphaChannel: Bool, hdrMetadataType: HdrMetadataType, colorGamut: ColorGamut, transferFunction: TransferFunction, scalabilityMode: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contentType] = contentType.jsValue() - object[Strings.width] = width.jsValue() - object[Strings.height] = height.jsValue() - object[Strings.bitrate] = bitrate.jsValue() - object[Strings.framerate] = framerate.jsValue() - object[Strings.hasAlphaChannel] = hasAlphaChannel.jsValue() - object[Strings.hdrMetadataType] = hdrMetadataType.jsValue() - object[Strings.colorGamut] = colorGamut.jsValue() - object[Strings.transferFunction] = transferFunction.jsValue() - object[Strings.scalabilityMode] = scalabilityMode.jsValue() + object[Strings.contentType] = contentType.jsValue + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.bitrate] = bitrate.jsValue + object[Strings.framerate] = framerate.jsValue + object[Strings.hasAlphaChannel] = hasAlphaChannel.jsValue + object[Strings.hdrMetadataType] = hdrMetadataType.jsValue + object[Strings.colorGamut] = colorGamut.jsValue + object[Strings.transferFunction] = transferFunction.jsValue + object[Strings.scalabilityMode] = scalabilityMode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/VideoDecoder.swift b/Sources/DOMKit/WebIDL/VideoDecoder.swift index 4082f418..8f8900c2 100644 --- a/Sources/DOMKit/WebIDL/VideoDecoder.swift +++ b/Sources/DOMKit/WebIDL/VideoDecoder.swift @@ -15,7 +15,7 @@ public class VideoDecoder: JSBridgedClass { } @inlinable public convenience init(init: VideoDecoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute @@ -26,12 +26,12 @@ public class VideoDecoder: JSBridgedClass { @inlinable public func configure(config: VideoDecoderConfig) { let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) + _ = 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()]) + _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue]) } @inlinable public func flush() -> JSPromise { @@ -43,7 +43,7 @@ public class VideoDecoder: JSBridgedClass { @inlinable public func flush() async throws { let this = jsObject let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func reset() { @@ -58,13 +58,13 @@ public class VideoDecoder: JSBridgedClass { @inlinable public static func isConfigSupported(config: VideoDecoderConfig) -> JSPromise { let this = constructor - return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue()]).fromJSValue()! + 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.get().fromJSValue()! + 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 index 63a3ec8c..3e431877 100644 --- a/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift +++ b/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift @@ -6,15 +6,15 @@ 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() + 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) } diff --git a/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift b/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift index daff0dce..4d41da3d 100644 --- a/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift +++ b/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift @@ -6,8 +6,8 @@ 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() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/VideoEncoder.swift b/Sources/DOMKit/WebIDL/VideoEncoder.swift index a844ed08..2349c057 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoder.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoder.swift @@ -15,7 +15,7 @@ public class VideoEncoder: JSBridgedClass { } @inlinable public convenience init(init: VideoEncoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute @@ -26,12 +26,12 @@ public class VideoEncoder: JSBridgedClass { @inlinable public func configure(config: VideoEncoderConfig) { let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue()]) + _ = 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]) + _ = this[Strings.encode].function!(this: this, arguments: [frame.jsValue, options?.jsValue ?? .undefined]) } @inlinable public func flush() -> JSPromise { @@ -43,7 +43,7 @@ public class VideoEncoder: JSBridgedClass { @inlinable public func flush() async throws { let this = jsObject let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func reset() { @@ -58,13 +58,13 @@ public class VideoEncoder: JSBridgedClass { @inlinable public static func isConfigSupported(config: VideoEncoderConfig) -> JSPromise { let this = constructor - return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue()]).fromJSValue()! + 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.get().fromJSValue()! + 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 index 794148f9..c6fdfd98 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift @@ -6,18 +6,18 @@ 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() + 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) } diff --git a/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift b/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift index 8620f890..583d307c 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class VideoEncoderEncodeOptions: BridgedDictionary { public convenience init(keyFrame: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keyFrame] = keyFrame.jsValue() + object[Strings.keyFrame] = keyFrame.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift b/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift index b5dcf628..f6419290 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift @@ -6,8 +6,8 @@ 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() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift b/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift index e1a5388d..9d325b8a 100644 --- a/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift +++ b/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift @@ -20,5 +20,5 @@ public enum VideoFacingModeEnum: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/VideoFrame.swift b/Sources/DOMKit/WebIDL/VideoFrame.swift index 688c99d8..9743b3fc 100644 --- a/Sources/DOMKit/WebIDL/VideoFrame.swift +++ b/Sources/DOMKit/WebIDL/VideoFrame.swift @@ -23,11 +23,11 @@ public class VideoFrame: JSBridgedClass { } @inlinable public convenience init(image: CanvasImageSource, init: VideoFrameInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [image.jsValue(), `init`?.jsValue() ?? .undefined])) + 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()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue, `init`.jsValue])) } @ReadonlyAttribute @@ -62,19 +62,19 @@ public class VideoFrame: JSBridgedClass { @inlinable public func allocationSize(options: VideoFrameCopyToOptions? = nil) -> UInt32 { let this = jsObject - return this[Strings.allocationSize].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + 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()! + 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.get().fromJSValue()! + 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 { diff --git a/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift b/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift index b0f356fc..0607012e 100644 --- a/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift +++ b/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift @@ -6,16 +6,16 @@ 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() + 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) } diff --git a/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift b/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift index 1652e6bf..a86c57dd 100644 --- a/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift +++ b/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift @@ -6,8 +6,8 @@ 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() + object[Strings.rect] = rect.jsValue + object[Strings.layout] = layout.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/VideoFrameInit.swift b/Sources/DOMKit/WebIDL/VideoFrameInit.swift index e6846570..a70eaea1 100644 --- a/Sources/DOMKit/WebIDL/VideoFrameInit.swift +++ b/Sources/DOMKit/WebIDL/VideoFrameInit.swift @@ -6,12 +6,12 @@ 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() + 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) } diff --git a/Sources/DOMKit/WebIDL/VideoFrameMetadata.swift b/Sources/DOMKit/WebIDL/VideoFrameMetadata.swift index 8f7ea359..36de932f 100644 --- a/Sources/DOMKit/WebIDL/VideoFrameMetadata.swift +++ b/Sources/DOMKit/WebIDL/VideoFrameMetadata.swift @@ -6,16 +6,16 @@ import JavaScriptKit public class VideoFrameMetadata: BridgedDictionary { public convenience init(presentationTime: DOMHighResTimeStamp, expectedDisplayTime: DOMHighResTimeStamp, width: UInt32, height: UInt32, mediaTime: Double, presentedFrames: UInt32, processingDuration: Double, captureTime: DOMHighResTimeStamp, receiveTime: DOMHighResTimeStamp, rtpTimestamp: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.presentationTime] = presentationTime.jsValue() - object[Strings.expectedDisplayTime] = expectedDisplayTime.jsValue() - object[Strings.width] = width.jsValue() - object[Strings.height] = height.jsValue() - object[Strings.mediaTime] = mediaTime.jsValue() - object[Strings.presentedFrames] = presentedFrames.jsValue() - object[Strings.processingDuration] = processingDuration.jsValue() - object[Strings.captureTime] = captureTime.jsValue() - object[Strings.receiveTime] = receiveTime.jsValue() - object[Strings.rtpTimestamp] = rtpTimestamp.jsValue() + object[Strings.presentationTime] = presentationTime.jsValue + object[Strings.expectedDisplayTime] = expectedDisplayTime.jsValue + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.mediaTime] = mediaTime.jsValue + object[Strings.presentedFrames] = presentedFrames.jsValue + object[Strings.processingDuration] = processingDuration.jsValue + object[Strings.captureTime] = captureTime.jsValue + object[Strings.receiveTime] = receiveTime.jsValue + object[Strings.rtpTimestamp] = rtpTimestamp.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift b/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift index 60917fe8..58f11f73 100644 --- a/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift +++ b/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift @@ -20,5 +20,5 @@ public enum VideoMatrixCoefficients: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/VideoPixelFormat.swift b/Sources/DOMKit/WebIDL/VideoPixelFormat.swift index aa69a8fb..1c8dea1f 100644 --- a/Sources/DOMKit/WebIDL/VideoPixelFormat.swift +++ b/Sources/DOMKit/WebIDL/VideoPixelFormat.swift @@ -25,5 +25,5 @@ public enum VideoPixelFormat: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift b/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift index 58585acd..78582a71 100644 --- a/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift +++ b/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift @@ -18,5 +18,5 @@ public enum VideoResizeModeEnum: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/VideoTrackList.swift b/Sources/DOMKit/WebIDL/VideoTrackList.swift index fc0ab994..99ca81ae 100644 --- a/Sources/DOMKit/WebIDL/VideoTrackList.swift +++ b/Sources/DOMKit/WebIDL/VideoTrackList.swift @@ -24,7 +24,7 @@ public class VideoTrackList: EventTarget { @inlinable public func getTrackById(id: String) -> VideoTrack? { let this = jsObject - return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue()]).fromJSValue()! + return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift b/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift index 1ccee139..e8407da6 100644 --- a/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift +++ b/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift @@ -19,5 +19,5 @@ public enum VideoTransferCharacteristics: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift b/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift index 66f71bcc..4fdb8eac 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift @@ -14,6 +14,6 @@ public class WEBGL_debug_shaders: JSBridgedClass { @inlinable public func getTranslatedShaderSource(shader: WebGLShader) -> String { let this = jsObject - return this[Strings.getTranslatedShaderSource].function!(this: this, arguments: [shader.jsValue()]).fromJSValue()! + return this[Strings.getTranslatedShaderSource].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift index 52e6ded1..8248c399 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift @@ -82,6 +82,6 @@ public class WEBGL_draw_buffers: JSBridgedClass { @inlinable public func drawBuffersWEBGL(buffers: [GLenum]) { let this = jsObject - _ = this[Strings.drawBuffersWEBGL].function!(this: this, arguments: [buffers.jsValue()]) + _ = this[Strings.drawBuffersWEBGL].function!(this: this, arguments: [buffers.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift index f5122d42..41319a30 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift @@ -14,17 +14,17 @@ public class WEBGL_draw_instanced_base_vertex_base_instance: JSBridgedClass { @inlinable public func drawArraysInstancedBaseInstanceWEBGL(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei, baseInstance: GLuint) { let this = jsObject - _ = this[Strings.drawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue(), baseInstance.jsValue()]) + _ = this[Strings.drawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue, instanceCount.jsValue, baseInstance.jsValue]) } @inlinable public func drawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei, baseVertex: GLint, baseInstance: GLuint) { - let _arg0 = mode.jsValue() - let _arg1 = count.jsValue() - let _arg2 = type.jsValue() - let _arg3 = offset.jsValue() - let _arg4 = instanceCount.jsValue() - let _arg5 = baseVertex.jsValue() - let _arg6 = baseInstance.jsValue() + let _arg0 = mode.jsValue + let _arg1 = count.jsValue + let _arg2 = type.jsValue + let _arg3 = offset.jsValue + let _arg4 = instanceCount.jsValue + let _arg5 = baseVertex.jsValue + let _arg6 = baseInstance.jsValue let this = jsObject _ = this[Strings.drawElementsInstancedBaseVertexBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift index ff92e18a..d02af26f 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift @@ -13,51 +13,51 @@ public class WEBGL_multi_draw: JSBridgedClass { } @inlinable public func multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array_or_seq_of_GLint, firstsOffset: GLuint, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, drawcount: GLsizei) { - let _arg0 = mode.jsValue() - let _arg1 = firstsList.jsValue() - let _arg2 = firstsOffset.jsValue() - let _arg3 = countsList.jsValue() - let _arg4 = countsOffset.jsValue() - let _arg5 = drawcount.jsValue() + let _arg0 = mode.jsValue + let _arg1 = firstsList.jsValue + let _arg2 = firstsOffset.jsValue + let _arg3 = countsList.jsValue + let _arg4 = countsOffset.jsValue + let _arg5 = drawcount.jsValue let this = jsObject _ = this[Strings.multiDrawArraysWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } @inlinable public func multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array_or_seq_of_GLint, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array_or_seq_of_GLsizei, offsetsOffset: GLuint, drawcount: GLsizei) { - let _arg0 = mode.jsValue() - let _arg1 = countsList.jsValue() - let _arg2 = countsOffset.jsValue() - let _arg3 = type.jsValue() - let _arg4 = offsetsList.jsValue() - let _arg5 = offsetsOffset.jsValue() - let _arg6 = drawcount.jsValue() + let _arg0 = mode.jsValue + let _arg1 = countsList.jsValue + let _arg2 = countsOffset.jsValue + let _arg3 = type.jsValue + let _arg4 = offsetsList.jsValue + let _arg5 = offsetsOffset.jsValue + let _arg6 = drawcount.jsValue let this = jsObject _ = this[Strings.multiDrawElementsWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } @inlinable public func multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array_or_seq_of_GLint, firstsOffset: GLuint, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, drawcount: GLsizei) { - let _arg0 = mode.jsValue() - let _arg1 = firstsList.jsValue() - let _arg2 = firstsOffset.jsValue() - let _arg3 = countsList.jsValue() - let _arg4 = countsOffset.jsValue() - let _arg5 = instanceCountsList.jsValue() - let _arg6 = instanceCountsOffset.jsValue() - let _arg7 = drawcount.jsValue() + let _arg0 = mode.jsValue + let _arg1 = firstsList.jsValue + let _arg2 = firstsOffset.jsValue + let _arg3 = countsList.jsValue + let _arg4 = countsOffset.jsValue + let _arg5 = instanceCountsList.jsValue + let _arg6 = instanceCountsOffset.jsValue + let _arg7 = drawcount.jsValue let this = jsObject _ = this[Strings.multiDrawArraysInstancedWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } @inlinable public func multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array_or_seq_of_GLint, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array_or_seq_of_GLsizei, offsetsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, drawcount: GLsizei) { - let _arg0 = mode.jsValue() - let _arg1 = countsList.jsValue() - let _arg2 = countsOffset.jsValue() - let _arg3 = type.jsValue() - let _arg4 = offsetsList.jsValue() - let _arg5 = offsetsOffset.jsValue() - let _arg6 = instanceCountsList.jsValue() - let _arg7 = instanceCountsOffset.jsValue() - let _arg8 = drawcount.jsValue() + let _arg0 = mode.jsValue + let _arg1 = countsList.jsValue + let _arg2 = countsOffset.jsValue + let _arg3 = type.jsValue + let _arg4 = offsetsList.jsValue + let _arg5 = offsetsOffset.jsValue + let _arg6 = instanceCountsList.jsValue + let _arg7 = instanceCountsOffset.jsValue + let _arg8 = drawcount.jsValue let this = jsObject _ = this[Strings.multiDrawElementsInstancedWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift index a47316a0..5ed8ef55 100644 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift +++ b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift @@ -13,34 +13,34 @@ public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClas } @inlinable public func multiDrawArraysInstancedBaseInstanceWEBGL(mode: GLenum, firstsList: Int32Array_or_seq_of_GLint, firstsOffset: GLuint, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, baseInstancesList: Uint32Array_or_seq_of_GLuint, baseInstancesOffset: GLuint, drawCount: GLsizei) { - let _arg0 = mode.jsValue() - let _arg1 = firstsList.jsValue() - let _arg2 = firstsOffset.jsValue() - let _arg3 = countsList.jsValue() - let _arg4 = countsOffset.jsValue() - let _arg5 = instanceCountsList.jsValue() - let _arg6 = instanceCountsOffset.jsValue() - let _arg7 = baseInstancesList.jsValue() - let _arg8 = baseInstancesOffset.jsValue() - let _arg9 = drawCount.jsValue() + let _arg0 = mode.jsValue + let _arg1 = firstsList.jsValue + let _arg2 = firstsOffset.jsValue + let _arg3 = countsList.jsValue + let _arg4 = countsOffset.jsValue + let _arg5 = instanceCountsList.jsValue + let _arg6 = instanceCountsOffset.jsValue + let _arg7 = baseInstancesList.jsValue + let _arg8 = baseInstancesOffset.jsValue + let _arg9 = drawCount.jsValue let this = jsObject _ = this[Strings.multiDrawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @inlinable public func multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array_or_seq_of_GLsizei, offsetsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, baseVerticesList: Int32Array_or_seq_of_GLint, baseVerticesOffset: GLuint, baseInstancesList: Uint32Array_or_seq_of_GLuint, baseInstancesOffset: GLuint, drawCount: GLsizei) { - let _arg0 = mode.jsValue() - let _arg1 = countsList.jsValue() - let _arg2 = countsOffset.jsValue() - let _arg3 = type.jsValue() - let _arg4 = offsetsList.jsValue() - let _arg5 = offsetsOffset.jsValue() - let _arg6 = instanceCountsList.jsValue() - let _arg7 = instanceCountsOffset.jsValue() - let _arg8 = baseVerticesList.jsValue() - let _arg9 = baseVerticesOffset.jsValue() - let _arg10 = baseInstancesList.jsValue() - let _arg11 = baseInstancesOffset.jsValue() - let _arg12 = drawCount.jsValue() + let _arg0 = mode.jsValue + let _arg1 = countsList.jsValue + let _arg2 = countsOffset.jsValue + let _arg3 = type.jsValue + let _arg4 = offsetsList.jsValue + let _arg5 = offsetsOffset.jsValue + let _arg6 = instanceCountsList.jsValue + let _arg7 = instanceCountsOffset.jsValue + let _arg8 = baseVerticesList.jsValue + let _arg9 = baseVerticesOffset.jsValue + let _arg10 = baseInstancesList.jsValue + let _arg11 = baseInstancesOffset.jsValue + let _arg12 = drawCount.jsValue let this = jsObject _ = this[Strings.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12]) } diff --git a/Sources/DOMKit/WebIDL/WakeLock.swift b/Sources/DOMKit/WebIDL/WakeLock.swift index e0281073..21767377 100644 --- a/Sources/DOMKit/WebIDL/WakeLock.swift +++ b/Sources/DOMKit/WebIDL/WakeLock.swift @@ -14,13 +14,13 @@ public class WakeLock: JSBridgedClass { @inlinable public func request(type: WakeLockType? = nil) -> JSPromise { let this = jsObject - return this[Strings.request].function!(this: this, arguments: [type?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.request].function!(this: this, arguments: [type?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func request(type: WakeLockType? = nil) async throws -> WakeLockSentinel { let this = jsObject - let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [type?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [type?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift index d30e171c..6e008719 100644 --- a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift +++ b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift @@ -28,7 +28,7 @@ public class WakeLockSentinel: EventTarget { @inlinable public func release() async throws { let this = jsObject let _promise: JSPromise = this[Strings.release].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/WakeLockType.swift b/Sources/DOMKit/WebIDL/WakeLockType.swift index 88ca94c5..baf95bad 100644 --- a/Sources/DOMKit/WebIDL/WakeLockType.swift +++ b/Sources/DOMKit/WebIDL/WakeLockType.swift @@ -17,5 +17,5 @@ public enum WakeLockType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift b/Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift index 7e09651f..8f6933c1 100644 --- a/Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift +++ b/Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class WatchAdvertisementsOptions: BridgedDictionary { public convenience init(signal: AbortSignal) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue() + object[Strings.signal] = signal.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WaveShaperNode.swift b/Sources/DOMKit/WebIDL/WaveShaperNode.swift index ce32aaff..f4737b9f 100644 --- a/Sources/DOMKit/WebIDL/WaveShaperNode.swift +++ b/Sources/DOMKit/WebIDL/WaveShaperNode.swift @@ -13,7 +13,7 @@ public class WaveShaperNode: AudioNode { } @inlinable public convenience init(context: BaseAudioContext, options: WaveShaperOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/WaveShaperOptions.swift b/Sources/DOMKit/WebIDL/WaveShaperOptions.swift index 8c37f26b..abf27776 100644 --- a/Sources/DOMKit/WebIDL/WaveShaperOptions.swift +++ b/Sources/DOMKit/WebIDL/WaveShaperOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class WaveShaperOptions: BridgedDictionary { public convenience init(curve: [Float], oversample: OverSampleType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.curve] = curve.jsValue() - object[Strings.oversample] = oversample.jsValue() + object[Strings.curve] = curve.jsValue + object[Strings.oversample] = oversample.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WebAssembly.swift b/Sources/DOMKit/WebIDL/WebAssembly.swift index 3f38ec07..9707adf5 100644 --- a/Sources/DOMKit/WebIDL/WebAssembly.swift +++ b/Sources/DOMKit/WebIDL/WebAssembly.swift @@ -10,66 +10,66 @@ public enum WebAssembly { @inlinable public static func validate(bytes: BufferSource) -> Bool { let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.validate].function!(this: this, arguments: [bytes.jsValue()]).fromJSValue()! + return this[Strings.validate].function!(this: this, arguments: [bytes.jsValue]).fromJSValue()! } @inlinable public static func compile(bytes: BufferSource) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.compile].function!(this: this, arguments: [bytes.jsValue()]).fromJSValue()! + return this[Strings.compile].function!(this: this, arguments: [bytes.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func compile(bytes: BufferSource) async throws -> Module { let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.compile].function!(this: this, arguments: [bytes.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.compile].function!(this: this, arguments: [bytes.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) async throws -> Instance { let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public static func compileStreaming(source: JSPromise) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue()]).fromJSValue()! + return this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func compileStreaming(source: JSPromise) async throws -> Module { let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) -> JSPromise { let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue(), importObject?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift b/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift index 0b546ffa..42562d11 100644 --- a/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift +++ b/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class WebAssemblyInstantiatedSource: BridgedDictionary { public convenience init(module: Module, instance: Instance) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.module] = module.jsValue() - object[Strings.instance] = instance.jsValue() + object[Strings.module] = module.jsValue + object[Strings.instance] = instance.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift index 13c585d3..2071c82e 100644 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift @@ -533,416 +533,416 @@ public extension WebGL2RenderingContextBase { @inlinable func copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) { let this = jsObject - _ = this[Strings.copyBufferSubData].function!(this: this, arguments: [readTarget.jsValue(), writeTarget.jsValue(), readOffset.jsValue(), writeOffset.jsValue(), size.jsValue()]) + _ = this[Strings.copyBufferSubData].function!(this: this, arguments: [readTarget.jsValue, writeTarget.jsValue, readOffset.jsValue, writeOffset.jsValue, size.jsValue]) } @inlinable func getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset: GLuint? = nil, length: GLuint? = nil) { let this = jsObject - _ = this[Strings.getBufferSubData].function!(this: this, arguments: [target.jsValue(), srcByteOffset.jsValue(), dstBuffer.jsValue(), dstOffset?.jsValue() ?? .undefined, length?.jsValue() ?? .undefined]) + _ = this[Strings.getBufferSubData].function!(this: this, arguments: [target.jsValue, srcByteOffset.jsValue, dstBuffer.jsValue, dstOffset?.jsValue ?? .undefined, length?.jsValue ?? .undefined]) } @inlinable func blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum) { - let _arg0 = srcX0.jsValue() - let _arg1 = srcY0.jsValue() - let _arg2 = srcX1.jsValue() - let _arg3 = srcY1.jsValue() - let _arg4 = dstX0.jsValue() - let _arg5 = dstY0.jsValue() - let _arg6 = dstX1.jsValue() - let _arg7 = dstY1.jsValue() - let _arg8 = mask.jsValue() - let _arg9 = filter.jsValue() + let _arg0 = srcX0.jsValue + let _arg1 = srcY0.jsValue + let _arg2 = srcX1.jsValue + let _arg3 = srcY1.jsValue + let _arg4 = dstX0.jsValue + let _arg5 = dstY0.jsValue + let _arg6 = dstX1.jsValue + let _arg7 = dstY1.jsValue + let _arg8 = mask.jsValue + let _arg9 = filter.jsValue let this = jsObject _ = this[Strings.blitFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @inlinable func framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, layer: GLint) { let this = jsObject - _ = this[Strings.framebufferTextureLayer].function!(this: this, arguments: [target.jsValue(), attachment.jsValue(), texture.jsValue(), level.jsValue(), layer.jsValue()]) + _ = this[Strings.framebufferTextureLayer].function!(this: this, arguments: [target.jsValue, attachment.jsValue, texture.jsValue, level.jsValue, layer.jsValue]) } @inlinable func invalidateFramebuffer(target: GLenum, attachments: [GLenum]) { let this = jsObject - _ = this[Strings.invalidateFramebuffer].function!(this: this, arguments: [target.jsValue(), attachments.jsValue()]) + _ = this[Strings.invalidateFramebuffer].function!(this: this, arguments: [target.jsValue, attachments.jsValue]) } @inlinable func invalidateSubFramebuffer(target: GLenum, attachments: [GLenum], x: GLint, y: GLint, width: GLsizei, height: GLsizei) { - let _arg0 = target.jsValue() - let _arg1 = attachments.jsValue() - let _arg2 = x.jsValue() - let _arg3 = y.jsValue() - let _arg4 = width.jsValue() - let _arg5 = height.jsValue() + let _arg0 = target.jsValue + let _arg1 = attachments.jsValue + let _arg2 = x.jsValue + let _arg3 = y.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue let this = jsObject _ = this[Strings.invalidateSubFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } @inlinable func readBuffer(src: GLenum) { let this = jsObject - _ = this[Strings.readBuffer].function!(this: this, arguments: [src.jsValue()]) + _ = this[Strings.readBuffer].function!(this: this, arguments: [src.jsValue]) } @inlinable func getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum) -> JSValue { let this = jsObject - return this[Strings.getInternalformatParameter].function!(this: this, arguments: [target.jsValue(), internalformat.jsValue(), pname.jsValue()]).fromJSValue()! + return this[Strings.getInternalformatParameter].function!(this: this, arguments: [target.jsValue, internalformat.jsValue, pname.jsValue]).fromJSValue()! } @inlinable func renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { let this = jsObject - _ = this[Strings.renderbufferStorageMultisample].function!(this: this, arguments: [target.jsValue(), samples.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()]) + _ = this[Strings.renderbufferStorageMultisample].function!(this: this, arguments: [target.jsValue, samples.jsValue, internalformat.jsValue, width.jsValue, height.jsValue]) } @inlinable func texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { let this = jsObject - _ = this[Strings.texStorage2D].function!(this: this, arguments: [target.jsValue(), levels.jsValue(), internalformat.jsValue(), width.jsValue(), height.jsValue()]) + _ = this[Strings.texStorage2D].function!(this: this, arguments: [target.jsValue, levels.jsValue, internalformat.jsValue, width.jsValue, height.jsValue]) } @inlinable func texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) { - let _arg0 = target.jsValue() - let _arg1 = levels.jsValue() - let _arg2 = internalformat.jsValue() - let _arg3 = width.jsValue() - let _arg4 = height.jsValue() - let _arg5 = depth.jsValue() + let _arg0 = target.jsValue + let _arg1 = levels.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue let this = jsObject _ = this[Strings.texStorage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = internalformat.jsValue() - let _arg3 = width.jsValue() - let _arg4 = height.jsValue() - let _arg5 = depth.jsValue() - let _arg6 = border.jsValue() - let _arg7 = format.jsValue() - let _arg8 = type.jsValue() - let _arg9 = pboOffset.jsValue() + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = format.jsValue + let _arg8 = type.jsValue + let _arg9 = pboOffset.jsValue let this = jsObject _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = internalformat.jsValue() - let _arg3 = width.jsValue() - let _arg4 = height.jsValue() - let _arg5 = depth.jsValue() - let _arg6 = border.jsValue() - let _arg7 = format.jsValue() - let _arg8 = type.jsValue() - let _arg9 = source.jsValue() + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = format.jsValue + let _arg8 = type.jsValue + let _arg9 = source.jsValue let this = jsObject _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView?) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = internalformat.jsValue() - let _arg3 = width.jsValue() - let _arg4 = height.jsValue() - let _arg5 = depth.jsValue() - let _arg6 = border.jsValue() - let _arg7 = format.jsValue() - let _arg8 = type.jsValue() - let _arg9 = srcData.jsValue() + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = format.jsValue + let _arg8 = type.jsValue + let _arg9 = srcData.jsValue let this = jsObject _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = internalformat.jsValue() - let _arg3 = width.jsValue() - let _arg4 = height.jsValue() - let _arg5 = depth.jsValue() - let _arg6 = border.jsValue() - let _arg7 = format.jsValue() - let _arg8 = type.jsValue() - let _arg9 = srcData.jsValue() - let _arg10 = srcOffset.jsValue() + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = format.jsValue + let _arg8 = type.jsValue + let _arg9 = srcData.jsValue + let _arg10 = srcOffset.jsValue let this = jsObject _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = xoffset.jsValue() - let _arg3 = yoffset.jsValue() - let _arg4 = zoffset.jsValue() - let _arg5 = width.jsValue() - let _arg6 = height.jsValue() - let _arg7 = depth.jsValue() - let _arg8 = format.jsValue() - let _arg9 = type.jsValue() - let _arg10 = pboOffset.jsValue() + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = type.jsValue + let _arg10 = pboOffset.jsValue let this = jsObject _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = xoffset.jsValue() - let _arg3 = yoffset.jsValue() - let _arg4 = zoffset.jsValue() - let _arg5 = width.jsValue() - let _arg6 = height.jsValue() - let _arg7 = depth.jsValue() - let _arg8 = format.jsValue() - let _arg9 = type.jsValue() - let _arg10 = source.jsValue() + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = type.jsValue + let _arg10 = source.jsValue let this = jsObject _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView?, srcOffset: GLuint? = nil) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = xoffset.jsValue() - let _arg3 = yoffset.jsValue() - let _arg4 = zoffset.jsValue() - let _arg5 = width.jsValue() - let _arg6 = height.jsValue() - let _arg7 = depth.jsValue() - let _arg8 = format.jsValue() - let _arg9 = type.jsValue() - let _arg10 = srcData.jsValue() - let _arg11 = srcOffset?.jsValue() ?? .undefined + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = type.jsValue + let _arg10 = srcData.jsValue + let _arg11 = srcOffset?.jsValue ?? .undefined let this = jsObject _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) } @inlinable func copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: 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 = zoffset.jsValue() - let _arg5 = x.jsValue() - let _arg6 = y.jsValue() - let _arg7 = width.jsValue() - let _arg8 = height.jsValue() + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = x.jsValue + let _arg6 = y.jsValue + let _arg7 = width.jsValue + let _arg8 = height.jsValue let this = jsObject _ = this[Strings.copyTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } @inlinable func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = internalformat.jsValue() - let _arg3 = width.jsValue() - let _arg4 = height.jsValue() - let _arg5 = depth.jsValue() - let _arg6 = border.jsValue() - let _arg7 = imageSize.jsValue() - let _arg8 = offset.jsValue() + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = imageSize.jsValue + let _arg8 = offset.jsValue let this = jsObject _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } @inlinable func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = internalformat.jsValue() - let _arg3 = width.jsValue() - let _arg4 = height.jsValue() - let _arg5 = depth.jsValue() - let _arg6 = border.jsValue() - let _arg7 = srcData.jsValue() - let _arg8 = srcOffset?.jsValue() ?? .undefined - let _arg9 = srcLengthOverride?.jsValue() ?? .undefined + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = srcData.jsValue + let _arg8 = srcOffset?.jsValue ?? .undefined + let _arg9 = srcLengthOverride?.jsValue ?? .undefined let this = jsObject _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @inlinable func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = xoffset.jsValue() - let _arg3 = yoffset.jsValue() - let _arg4 = zoffset.jsValue() - let _arg5 = width.jsValue() - let _arg6 = height.jsValue() - let _arg7 = depth.jsValue() - let _arg8 = format.jsValue() - let _arg9 = imageSize.jsValue() - let _arg10 = offset.jsValue() + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = imageSize.jsValue + let _arg10 = offset.jsValue let this = jsObject _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) } @inlinable func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { - let _arg0 = target.jsValue() - let _arg1 = level.jsValue() - let _arg2 = xoffset.jsValue() - let _arg3 = yoffset.jsValue() - let _arg4 = zoffset.jsValue() - let _arg5 = width.jsValue() - let _arg6 = height.jsValue() - let _arg7 = depth.jsValue() - let _arg8 = format.jsValue() - let _arg9 = srcData.jsValue() - let _arg10 = srcOffset?.jsValue() ?? .undefined - let _arg11 = srcLengthOverride?.jsValue() ?? .undefined + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = srcData.jsValue + let _arg10 = srcOffset?.jsValue ?? .undefined + let _arg11 = srcLengthOverride?.jsValue ?? .undefined let this = jsObject _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) } @inlinable func getFragDataLocation(program: WebGLProgram, name: String) -> GLint { let this = jsObject - return this[Strings.getFragDataLocation].function!(this: this, arguments: [program.jsValue(), name.jsValue()]).fromJSValue()! + return this[Strings.getFragDataLocation].function!(this: this, arguments: [program.jsValue, name.jsValue]).fromJSValue()! } @inlinable func uniform1ui(location: WebGLUniformLocation?, v0: GLuint) { let this = jsObject - _ = this[Strings.uniform1ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue()]) + _ = this[Strings.uniform1ui].function!(this: this, arguments: [location.jsValue, v0.jsValue]) } @inlinable func uniform2ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint) { let this = jsObject - _ = this[Strings.uniform2ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue(), v1.jsValue()]) + _ = this[Strings.uniform2ui].function!(this: this, arguments: [location.jsValue, v0.jsValue, v1.jsValue]) } @inlinable func uniform3ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint) { let this = jsObject - _ = this[Strings.uniform3ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue()]) + _ = this[Strings.uniform3ui].function!(this: this, arguments: [location.jsValue, v0.jsValue, v1.jsValue, v2.jsValue]) } @inlinable func uniform4ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) { let this = jsObject - _ = this[Strings.uniform4ui].function!(this: this, arguments: [location.jsValue(), v0.jsValue(), v1.jsValue(), v2.jsValue(), v3.jsValue()]) + _ = this[Strings.uniform4ui].function!(this: this, arguments: [location.jsValue, v0.jsValue, v1.jsValue, v2.jsValue, v3.jsValue]) } @inlinable func uniform1uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform1uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform1uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform2uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform2uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform2uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform3uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform3uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform3uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform4uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform4uiv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform4uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniformMatrix3x2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniformMatrix3x2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniformMatrix4x2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniformMatrix4x2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniformMatrix2x3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniformMatrix2x3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniformMatrix4x3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniformMatrix4x3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniformMatrix2x4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniformMatrix2x4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniformMatrix3x4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniformMatrix3x4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) { let this = jsObject - _ = this[Strings.vertexAttribI4i].function!(this: this, arguments: [index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()]) + _ = this[Strings.vertexAttribI4i].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) } @inlinable func vertexAttribI4iv(index: GLuint, values: Int32List) { let this = jsObject - _ = this[Strings.vertexAttribI4iv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) + _ = this[Strings.vertexAttribI4iv].function!(this: this, arguments: [index.jsValue, values.jsValue]) } @inlinable func vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) { let this = jsObject - _ = this[Strings.vertexAttribI4ui].function!(this: this, arguments: [index.jsValue(), x.jsValue(), y.jsValue(), z.jsValue(), w.jsValue()]) + _ = this[Strings.vertexAttribI4ui].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) } @inlinable func vertexAttribI4uiv(index: GLuint, values: Uint32List) { let this = jsObject - _ = this[Strings.vertexAttribI4uiv].function!(this: this, arguments: [index.jsValue(), values.jsValue()]) + _ = this[Strings.vertexAttribI4uiv].function!(this: this, arguments: [index.jsValue, values.jsValue]) } @inlinable func vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr) { let this = jsObject - _ = this[Strings.vertexAttribIPointer].function!(this: this, arguments: [index.jsValue(), size.jsValue(), type.jsValue(), stride.jsValue(), offset.jsValue()]) + _ = this[Strings.vertexAttribIPointer].function!(this: this, arguments: [index.jsValue, size.jsValue, type.jsValue, stride.jsValue, offset.jsValue]) } @inlinable func vertexAttribDivisor(index: GLuint, divisor: GLuint) { let this = jsObject - _ = this[Strings.vertexAttribDivisor].function!(this: this, arguments: [index.jsValue(), divisor.jsValue()]) + _ = this[Strings.vertexAttribDivisor].function!(this: this, arguments: [index.jsValue, divisor.jsValue]) } @inlinable func drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) { let this = jsObject - _ = this[Strings.drawArraysInstanced].function!(this: this, arguments: [mode.jsValue(), first.jsValue(), count.jsValue(), instanceCount.jsValue()]) + _ = this[Strings.drawArraysInstanced].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue, instanceCount.jsValue]) } @inlinable func drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) { let this = jsObject - _ = this[Strings.drawElementsInstanced].function!(this: this, arguments: [mode.jsValue(), count.jsValue(), type.jsValue(), offset.jsValue(), instanceCount.jsValue()]) + _ = this[Strings.drawElementsInstanced].function!(this: this, arguments: [mode.jsValue, count.jsValue, type.jsValue, offset.jsValue, instanceCount.jsValue]) } @inlinable func drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr) { - let _arg0 = mode.jsValue() - let _arg1 = start.jsValue() - let _arg2 = end.jsValue() - let _arg3 = count.jsValue() - let _arg4 = type.jsValue() - let _arg5 = offset.jsValue() + let _arg0 = mode.jsValue + let _arg1 = start.jsValue + let _arg2 = end.jsValue + let _arg3 = count.jsValue + let _arg4 = type.jsValue + let _arg5 = offset.jsValue let this = jsObject _ = this[Strings.drawRangeElements].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } @inlinable func drawBuffers(buffers: [GLenum]) { let this = jsObject - _ = this[Strings.drawBuffers].function!(this: this, arguments: [buffers.jsValue()]) + _ = this[Strings.drawBuffers].function!(this: this, arguments: [buffers.jsValue]) } @inlinable func clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset: GLuint? = nil) { let this = jsObject - _ = this[Strings.clearBufferfv].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined]) + _ = this[Strings.clearBufferfv].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, values.jsValue, srcOffset?.jsValue ?? .undefined]) } @inlinable func clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset: GLuint? = nil) { let this = jsObject - _ = this[Strings.clearBufferiv].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined]) + _ = this[Strings.clearBufferiv].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, values.jsValue, srcOffset?.jsValue ?? .undefined]) } @inlinable func clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset: GLuint? = nil) { let this = jsObject - _ = this[Strings.clearBufferuiv].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), values.jsValue(), srcOffset?.jsValue() ?? .undefined]) + _ = this[Strings.clearBufferuiv].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, values.jsValue, srcOffset?.jsValue ?? .undefined]) } @inlinable func clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) { let this = jsObject - _ = this[Strings.clearBufferfi].function!(this: this, arguments: [buffer.jsValue(), drawbuffer.jsValue(), depth.jsValue(), stencil.jsValue()]) + _ = this[Strings.clearBufferfi].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, depth.jsValue, stencil.jsValue]) } @inlinable func createQuery() -> WebGLQuery? { @@ -952,32 +952,32 @@ public extension WebGL2RenderingContextBase { @inlinable func deleteQuery(query: WebGLQuery?) { let this = jsObject - _ = this[Strings.deleteQuery].function!(this: this, arguments: [query.jsValue()]) + _ = this[Strings.deleteQuery].function!(this: this, arguments: [query.jsValue]) } @inlinable func isQuery(query: WebGLQuery?) -> GLboolean { let this = jsObject - return this[Strings.isQuery].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! + return this[Strings.isQuery].function!(this: this, arguments: [query.jsValue]).fromJSValue()! } @inlinable func beginQuery(target: GLenum, query: WebGLQuery) { let this = jsObject - _ = this[Strings.beginQuery].function!(this: this, arguments: [target.jsValue(), query.jsValue()]) + _ = this[Strings.beginQuery].function!(this: this, arguments: [target.jsValue, query.jsValue]) } @inlinable func endQuery(target: GLenum) { let this = jsObject - _ = this[Strings.endQuery].function!(this: this, arguments: [target.jsValue()]) + _ = this[Strings.endQuery].function!(this: this, arguments: [target.jsValue]) } @inlinable func getQuery(target: GLenum, pname: GLenum) -> WebGLQuery? { let this = jsObject - return this[Strings.getQuery].function!(this: this, arguments: [target.jsValue(), pname.jsValue()]).fromJSValue()! + return this[Strings.getQuery].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! } @inlinable func getQueryParameter(query: WebGLQuery, pname: GLenum) -> JSValue { let this = jsObject - return this[Strings.getQueryParameter].function!(this: this, arguments: [query.jsValue(), pname.jsValue()]).fromJSValue()! + return this[Strings.getQueryParameter].function!(this: this, arguments: [query.jsValue, pname.jsValue]).fromJSValue()! } @inlinable func createSampler() -> WebGLSampler? { @@ -987,62 +987,62 @@ public extension WebGL2RenderingContextBase { @inlinable func deleteSampler(sampler: WebGLSampler?) { let this = jsObject - _ = this[Strings.deleteSampler].function!(this: this, arguments: [sampler.jsValue()]) + _ = this[Strings.deleteSampler].function!(this: this, arguments: [sampler.jsValue]) } @inlinable func isSampler(sampler: WebGLSampler?) -> GLboolean { let this = jsObject - return this[Strings.isSampler].function!(this: this, arguments: [sampler.jsValue()]).fromJSValue()! + return this[Strings.isSampler].function!(this: this, arguments: [sampler.jsValue]).fromJSValue()! } @inlinable func bindSampler(unit: GLuint, sampler: WebGLSampler?) { let this = jsObject - _ = this[Strings.bindSampler].function!(this: this, arguments: [unit.jsValue(), sampler.jsValue()]) + _ = this[Strings.bindSampler].function!(this: this, arguments: [unit.jsValue, sampler.jsValue]) } @inlinable func samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint) { let this = jsObject - _ = this[Strings.samplerParameteri].function!(this: this, arguments: [sampler.jsValue(), pname.jsValue(), param.jsValue()]) + _ = this[Strings.samplerParameteri].function!(this: this, arguments: [sampler.jsValue, pname.jsValue, param.jsValue]) } @inlinable func samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat) { let this = jsObject - _ = this[Strings.samplerParameterf].function!(this: this, arguments: [sampler.jsValue(), pname.jsValue(), param.jsValue()]) + _ = this[Strings.samplerParameterf].function!(this: this, arguments: [sampler.jsValue, pname.jsValue, param.jsValue]) } @inlinable func getSamplerParameter(sampler: WebGLSampler, pname: GLenum) -> JSValue { let this = jsObject - return this[Strings.getSamplerParameter].function!(this: this, arguments: [sampler.jsValue(), pname.jsValue()]).fromJSValue()! + return this[Strings.getSamplerParameter].function!(this: this, arguments: [sampler.jsValue, pname.jsValue]).fromJSValue()! } @inlinable func fenceSync(condition: GLenum, flags: GLbitfield) -> WebGLSync? { let this = jsObject - return this[Strings.fenceSync].function!(this: this, arguments: [condition.jsValue(), flags.jsValue()]).fromJSValue()! + return this[Strings.fenceSync].function!(this: this, arguments: [condition.jsValue, flags.jsValue]).fromJSValue()! } @inlinable func isSync(sync: WebGLSync?) -> GLboolean { let this = jsObject - return this[Strings.isSync].function!(this: this, arguments: [sync.jsValue()]).fromJSValue()! + return this[Strings.isSync].function!(this: this, arguments: [sync.jsValue]).fromJSValue()! } @inlinable func deleteSync(sync: WebGLSync?) { let this = jsObject - _ = this[Strings.deleteSync].function!(this: this, arguments: [sync.jsValue()]) + _ = this[Strings.deleteSync].function!(this: this, arguments: [sync.jsValue]) } @inlinable func clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64) -> GLenum { let this = jsObject - return this[Strings.clientWaitSync].function!(this: this, arguments: [sync.jsValue(), flags.jsValue(), timeout.jsValue()]).fromJSValue()! + return this[Strings.clientWaitSync].function!(this: this, arguments: [sync.jsValue, flags.jsValue, timeout.jsValue]).fromJSValue()! } @inlinable func waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64) { let this = jsObject - _ = this[Strings.waitSync].function!(this: this, arguments: [sync.jsValue(), flags.jsValue(), timeout.jsValue()]) + _ = this[Strings.waitSync].function!(this: this, arguments: [sync.jsValue, flags.jsValue, timeout.jsValue]) } @inlinable func getSyncParameter(sync: WebGLSync, pname: GLenum) -> JSValue { let this = jsObject - return this[Strings.getSyncParameter].function!(this: this, arguments: [sync.jsValue(), pname.jsValue()]).fromJSValue()! + return this[Strings.getSyncParameter].function!(this: this, arguments: [sync.jsValue, pname.jsValue]).fromJSValue()! } @inlinable func createTransformFeedback() -> WebGLTransformFeedback? { @@ -1052,22 +1052,22 @@ public extension WebGL2RenderingContextBase { @inlinable func deleteTransformFeedback(tf: WebGLTransformFeedback?) { let this = jsObject - _ = this[Strings.deleteTransformFeedback].function!(this: this, arguments: [tf.jsValue()]) + _ = this[Strings.deleteTransformFeedback].function!(this: this, arguments: [tf.jsValue]) } @inlinable func isTransformFeedback(tf: WebGLTransformFeedback?) -> GLboolean { let this = jsObject - return this[Strings.isTransformFeedback].function!(this: this, arguments: [tf.jsValue()]).fromJSValue()! + return this[Strings.isTransformFeedback].function!(this: this, arguments: [tf.jsValue]).fromJSValue()! } @inlinable func bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback?) { let this = jsObject - _ = this[Strings.bindTransformFeedback].function!(this: this, arguments: [target.jsValue(), tf.jsValue()]) + _ = this[Strings.bindTransformFeedback].function!(this: this, arguments: [target.jsValue, tf.jsValue]) } @inlinable func beginTransformFeedback(primitiveMode: GLenum) { let this = jsObject - _ = this[Strings.beginTransformFeedback].function!(this: this, arguments: [primitiveMode.jsValue()]) + _ = this[Strings.beginTransformFeedback].function!(this: this, arguments: [primitiveMode.jsValue]) } @inlinable func endTransformFeedback() { @@ -1077,12 +1077,12 @@ public extension WebGL2RenderingContextBase { @inlinable func transformFeedbackVaryings(program: WebGLProgram, varyings: [String], bufferMode: GLenum) { let this = jsObject - _ = this[Strings.transformFeedbackVaryings].function!(this: this, arguments: [program.jsValue(), varyings.jsValue(), bufferMode.jsValue()]) + _ = this[Strings.transformFeedbackVaryings].function!(this: this, arguments: [program.jsValue, varyings.jsValue, bufferMode.jsValue]) } @inlinable func getTransformFeedbackVarying(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { let this = jsObject - return this[Strings.getTransformFeedbackVarying].function!(this: this, arguments: [program.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.getTransformFeedbackVarying].function!(this: this, arguments: [program.jsValue, index.jsValue]).fromJSValue()! } @inlinable func pauseTransformFeedback() { @@ -1097,47 +1097,47 @@ public extension WebGL2RenderingContextBase { @inlinable func bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer?) { let this = jsObject - _ = this[Strings.bindBufferBase].function!(this: this, arguments: [target.jsValue(), index.jsValue(), buffer.jsValue()]) + _ = this[Strings.bindBufferBase].function!(this: this, arguments: [target.jsValue, index.jsValue, buffer.jsValue]) } @inlinable func bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer?, offset: GLintptr, size: GLsizeiptr) { let this = jsObject - _ = this[Strings.bindBufferRange].function!(this: this, arguments: [target.jsValue(), index.jsValue(), buffer.jsValue(), offset.jsValue(), size.jsValue()]) + _ = this[Strings.bindBufferRange].function!(this: this, arguments: [target.jsValue, index.jsValue, buffer.jsValue, offset.jsValue, size.jsValue]) } @inlinable func getIndexedParameter(target: GLenum, index: GLuint) -> JSValue { let this = jsObject - return this[Strings.getIndexedParameter].function!(this: this, arguments: [target.jsValue(), index.jsValue()]).fromJSValue()! + return this[Strings.getIndexedParameter].function!(this: this, arguments: [target.jsValue, index.jsValue]).fromJSValue()! } @inlinable func getUniformIndices(program: WebGLProgram, uniformNames: [String]) -> [GLuint]? { let this = jsObject - return this[Strings.getUniformIndices].function!(this: this, arguments: [program.jsValue(), uniformNames.jsValue()]).fromJSValue()! + return this[Strings.getUniformIndices].function!(this: this, arguments: [program.jsValue, uniformNames.jsValue]).fromJSValue()! } @inlinable func getActiveUniforms(program: WebGLProgram, uniformIndices: [GLuint], pname: GLenum) -> JSValue { let this = jsObject - return this[Strings.getActiveUniforms].function!(this: this, arguments: [program.jsValue(), uniformIndices.jsValue(), pname.jsValue()]).fromJSValue()! + return this[Strings.getActiveUniforms].function!(this: this, arguments: [program.jsValue, uniformIndices.jsValue, pname.jsValue]).fromJSValue()! } @inlinable func getUniformBlockIndex(program: WebGLProgram, uniformBlockName: String) -> GLuint { let this = jsObject - return this[Strings.getUniformBlockIndex].function!(this: this, arguments: [program.jsValue(), uniformBlockName.jsValue()]).fromJSValue()! + return this[Strings.getUniformBlockIndex].function!(this: this, arguments: [program.jsValue, uniformBlockName.jsValue]).fromJSValue()! } @inlinable func getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum) -> JSValue { let this = jsObject - return this[Strings.getActiveUniformBlockParameter].function!(this: this, arguments: [program.jsValue(), uniformBlockIndex.jsValue(), pname.jsValue()]).fromJSValue()! + return this[Strings.getActiveUniformBlockParameter].function!(this: this, arguments: [program.jsValue, uniformBlockIndex.jsValue, pname.jsValue]).fromJSValue()! } @inlinable func getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint) -> String? { let this = jsObject - return this[Strings.getActiveUniformBlockName].function!(this: this, arguments: [program.jsValue(), uniformBlockIndex.jsValue()]).fromJSValue()! + return this[Strings.getActiveUniformBlockName].function!(this: this, arguments: [program.jsValue, uniformBlockIndex.jsValue]).fromJSValue()! } @inlinable func uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint) { let this = jsObject - _ = this[Strings.uniformBlockBinding].function!(this: this, arguments: [program.jsValue(), uniformBlockIndex.jsValue(), uniformBlockBinding.jsValue()]) + _ = this[Strings.uniformBlockBinding].function!(this: this, arguments: [program.jsValue, uniformBlockIndex.jsValue, uniformBlockBinding.jsValue]) } @inlinable func createVertexArray() -> WebGLVertexArrayObject? { @@ -1147,16 +1147,16 @@ public extension WebGL2RenderingContextBase { @inlinable func deleteVertexArray(vertexArray: WebGLVertexArrayObject?) { let this = jsObject - _ = this[Strings.deleteVertexArray].function!(this: this, arguments: [vertexArray.jsValue()]) + _ = this[Strings.deleteVertexArray].function!(this: this, arguments: [vertexArray.jsValue]) } @inlinable func isVertexArray(vertexArray: WebGLVertexArrayObject?) -> GLboolean { let this = jsObject - return this[Strings.isVertexArray].function!(this: this, arguments: [vertexArray.jsValue()]).fromJSValue()! + return this[Strings.isVertexArray].function!(this: this, arguments: [vertexArray.jsValue]).fromJSValue()! } @inlinable func bindVertexArray(array: WebGLVertexArrayObject?) { let this = jsObject - _ = this[Strings.bindVertexArray].function!(this: this, arguments: [array.jsValue()]) + _ = this[Strings.bindVertexArray].function!(this: this, arguments: [array.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift index a7c45d86..659213d5 100644 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift +++ b/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift @@ -7,310 +7,310 @@ public protocol WebGL2RenderingContextOverloads: JSBridgedClass {} public extension WebGL2RenderingContextOverloads { @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()]) + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, size.jsValue, usage.jsValue]) } @inlinable func bufferData(target: GLenum, srcData: BufferSource?, usage: GLenum) { let this = jsObject - _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue(), srcData.jsValue(), usage.jsValue()]) + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, srcData.jsValue, usage.jsValue]) } @inlinable func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource) { let this = jsObject - _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue()]) + _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue, dstByteOffset.jsValue, srcData.jsValue]) } @inlinable func bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length: GLuint? = nil) { let this = jsObject - _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue(), srcData.jsValue(), usage.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined]) + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, srcData.jsValue, usage.jsValue, srcOffset.jsValue, length?.jsValue ?? .undefined]) } @inlinable func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length: GLuint? = nil) { let this = jsObject - _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue(), dstByteOffset.jsValue(), srcData.jsValue(), srcOffset.jsValue(), length?.jsValue() ?? .undefined]) + _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue, dstByteOffset.jsValue, srcData.jsValue, srcOffset.jsValue, length?.jsValue ?? .undefined]) } @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 _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 _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 _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 _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 texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { - 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 = pboOffset.jsValue() + 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 = pboOffset.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, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { - 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 = source.jsValue() + 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 = source.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, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { - 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 = srcData.jsValue() - let _arg9 = srcOffset.jsValue() + 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 = srcData.jsValue + let _arg9 = srcOffset.jsValue let this = jsObject _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { - 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 = pboOffset.jsValue() + 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 = pboOffset.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, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { - 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 = source.jsValue() + 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 = source.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, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { - 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 = srcData.jsValue() - let _arg9 = srcOffset.jsValue() + 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 = srcData.jsValue + let _arg9 = srcOffset.jsValue let this = jsObject _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { - 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 = imageSize.jsValue() - let _arg7 = offset.jsValue() + 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 = imageSize.jsValue + let _arg7 = offset.jsValue let this = jsObject _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { - 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 = srcData.jsValue() - let _arg7 = srcOffset?.jsValue() ?? .undefined - let _arg8 = srcLengthOverride?.jsValue() ?? .undefined + 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 = srcData.jsValue + let _arg7 = srcOffset?.jsValue ?? .undefined + let _arg8 = srcLengthOverride?.jsValue ?? .undefined let this = jsObject _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { - 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 = imageSize.jsValue() - let _arg8 = offset.jsValue() + 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 = imageSize.jsValue + let _arg8 = offset.jsValue let this = jsObject _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { - 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 = srcData.jsValue() - let _arg8 = srcOffset?.jsValue() ?? .undefined - let _arg9 = srcLengthOverride?.jsValue() ?? .undefined + 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 = srcData.jsValue + let _arg8 = srcOffset?.jsValue ?? .undefined + let _arg9 = srcLengthOverride?.jsValue ?? .undefined let this = jsObject _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } @inlinable func uniform1fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform2fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform3fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform4fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform1iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform2iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform3iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniform4iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { let this = jsObject - _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue(), transpose.jsValue(), data.jsValue(), srcOffset?.jsValue() ?? .undefined, srcLength?.jsValue() ?? .undefined]) + _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: 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 = dstData.jsValue() + 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 = dstData.jsValue let this = jsObject _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr) { - 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 = offset.jsValue() + 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 = offset.jsValue let this = jsObject _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint) { - 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 = dstData.jsValue() - let _arg7 = dstOffset.jsValue() + 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 = dstData.jsValue + let _arg7 = dstOffset.jsValue let this = jsObject _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } diff --git a/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift b/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift index b3e2fdda..631a301d 100644 --- a/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift +++ b/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift @@ -6,16 +6,16 @@ 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, xrCompatible: 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() - object[Strings.xrCompatible] = xrCompatible.jsValue() + 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 + object[Strings.xrCompatible] = xrCompatible.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WebGLContextEvent.swift b/Sources/DOMKit/WebIDL/WebGLContextEvent.swift index 94607fc7..20837070 100644 --- a/Sources/DOMKit/WebIDL/WebGLContextEvent.swift +++ b/Sources/DOMKit/WebIDL/WebGLContextEvent.swift @@ -12,7 +12,7 @@ public class WebGLContextEvent: Event { } @inlinable public convenience init(type: String, eventInit: WebGLContextEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInit?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInit?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift b/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift index 78bd7cda..20c0c668 100644 --- a/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift +++ b/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class WebGLContextEventInit: BridgedDictionary { public convenience init(statusMessage: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.statusMessage] = statusMessage.jsValue() + object[Strings.statusMessage] = statusMessage.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift b/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift index 798d98c9..ce6b23f8 100644 --- a/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift +++ b/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift @@ -19,5 +19,5 @@ public enum WebGLPowerPreference: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift index 411c50ce..8f5c158c 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift @@ -620,126 +620,126 @@ public extension WebGLRenderingContextBase { @inlinable func getExtension(name: String) -> JSObject? { let this = jsObject - return this[Strings.getExtension].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()! + 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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 _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 _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]) } @@ -766,7 +766,7 @@ public extension WebGLRenderingContextBase { @inlinable func createShader(type: GLenum) -> WebGLShader? { let this = jsObject - return this[Strings.createShader].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.createShader].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } @inlinable func createTexture() -> WebGLTexture? { @@ -776,87 +776,87 @@ public extension WebGLRenderingContextBase { @inlinable func cullFace(mode: GLenum) { let this = jsObject - _ = this[Strings.cullFace].function!(this: this, arguments: [mode.jsValue()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = this[Strings.enableVertexAttribArray].function!(this: this, arguments: [index.jsValue]) } @inlinable func finish() { @@ -871,52 +871,52 @@ public extension WebGLRenderingContextBase { @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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + return this[Strings.getParameter].function!(this: this, arguments: [pname.jsValue]).fromJSValue()! } @inlinable func getError() -> GLenum { @@ -926,293 +926,293 @@ public extension WebGLRenderingContextBase { @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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()]) + _ = 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()! + 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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 _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()]) + _ = this[Strings.viewport].function!(this: this, arguments: [x.jsValue, y.jsValue, width.jsValue, height.jsValue]) } @inlinable func makeXRCompatible() -> JSPromise { @@ -1224,6 +1224,6 @@ public extension WebGLRenderingContextBase { @inlinable func makeXRCompatible() async throws { let this = jsObject let _promise: JSPromise = this[Strings.makeXRCompatible].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift index a3b3aebb..fe1977ac 100644 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift @@ -7,159 +7,159 @@ 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()]) + _ = 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()]) + _ = 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()]) + _ = 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 _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 _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 _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 _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 _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 _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 _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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = 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()]) + _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/WebSocket.swift b/Sources/DOMKit/WebIDL/WebSocket.swift index 21882685..9dcecc6e 100644 --- a/Sources/DOMKit/WebIDL/WebSocket.swift +++ b/Sources/DOMKit/WebIDL/WebSocket.swift @@ -21,7 +21,7 @@ public class WebSocket: EventTarget { } @inlinable public convenience init(url: String, protocols: String_or_seq_of_String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), protocols?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue, protocols?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -58,7 +58,7 @@ public class WebSocket: EventTarget { @inlinable public func close(code: UInt16? = nil, reason: String? = nil) { let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: [code?.jsValue() ?? .undefined, reason?.jsValue() ?? .undefined]) + _ = this[Strings.close].function!(this: this, arguments: [code?.jsValue ?? .undefined, reason?.jsValue ?? .undefined]) } @ClosureAttribute1Optional @@ -69,6 +69,6 @@ public class WebSocket: EventTarget { @inlinable public func send(data: Blob_or_BufferSource_or_String) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue()]) + _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/WebTransport.swift b/Sources/DOMKit/WebIDL/WebTransport.swift index a3da20b2..be25378b 100644 --- a/Sources/DOMKit/WebIDL/WebTransport.swift +++ b/Sources/DOMKit/WebIDL/WebTransport.swift @@ -18,7 +18,7 @@ public class WebTransport: JSBridgedClass { } @inlinable public convenience init(url: String, options: WebTransportOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue, options?.jsValue ?? .undefined])) } @inlinable public func getStats() -> JSPromise { @@ -30,7 +30,7 @@ public class WebTransport: JSBridgedClass { @inlinable public func getStats() async throws -> WebTransportStats { let this = jsObject let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute @@ -41,7 +41,7 @@ public class WebTransport: JSBridgedClass { @inlinable public func close(closeInfo: WebTransportCloseInfo? = nil) { let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: [closeInfo?.jsValue() ?? .undefined]) + _ = this[Strings.close].function!(this: this, arguments: [closeInfo?.jsValue ?? .undefined]) } @ReadonlyAttribute @@ -56,7 +56,7 @@ public class WebTransport: JSBridgedClass { @inlinable public func createBidirectionalStream() async throws -> WebTransportBidirectionalStream { let this = jsObject let _promise: JSPromise = this[Strings.createBidirectionalStream].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute @@ -71,7 +71,7 @@ public class WebTransport: JSBridgedClass { @inlinable public func createUnidirectionalStream() async throws -> WritableStream { let this = jsObject let _promise: JSPromise = this[Strings.createUnidirectionalStream].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift b/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift index fcede81d..65ef2ca0 100644 --- a/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift +++ b/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class WebTransportCloseInfo: BridgedDictionary { public convenience init(closeCode: UInt32, reason: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.closeCode] = closeCode.jsValue() - object[Strings.reason] = reason.jsValue() + object[Strings.closeCode] = closeCode.jsValue + object[Strings.reason] = reason.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WebTransportError.swift b/Sources/DOMKit/WebIDL/WebTransportError.swift index 0fa243e9..7e2a576d 100644 --- a/Sources/DOMKit/WebIDL/WebTransportError.swift +++ b/Sources/DOMKit/WebIDL/WebTransportError.swift @@ -13,7 +13,7 @@ public class WebTransportError: DOMException { } @inlinable public convenience init(init: WebTransportErrorInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift b/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift index 2a71f0f5..e5467b1e 100644 --- a/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift +++ b/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class WebTransportErrorInit: BridgedDictionary { public convenience init(streamErrorCode: UInt8, message: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.streamErrorCode] = streamErrorCode.jsValue() - object[Strings.message] = message.jsValue() + object[Strings.streamErrorCode] = streamErrorCode.jsValue + object[Strings.message] = message.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift b/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift index c9acd2f5..3c59aea4 100644 --- a/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift +++ b/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift @@ -18,5 +18,5 @@ public enum WebTransportErrorSource: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/WebTransportHash.swift b/Sources/DOMKit/WebIDL/WebTransportHash.swift index 2ed984ae..d79fba0b 100644 --- a/Sources/DOMKit/WebIDL/WebTransportHash.swift +++ b/Sources/DOMKit/WebIDL/WebTransportHash.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class WebTransportHash: BridgedDictionary { public convenience init(algorithm: String, value: BufferSource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.algorithm] = algorithm.jsValue() - object[Strings.value] = value.jsValue() + object[Strings.algorithm] = algorithm.jsValue + object[Strings.value] = value.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WebTransportOptions.swift b/Sources/DOMKit/WebIDL/WebTransportOptions.swift index 9eb6d3c1..072313f4 100644 --- a/Sources/DOMKit/WebIDL/WebTransportOptions.swift +++ b/Sources/DOMKit/WebIDL/WebTransportOptions.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class WebTransportOptions: BridgedDictionary { public convenience init(allowPooling: Bool, serverCertificateHashes: [WebTransportHash]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowPooling] = allowPooling.jsValue() - object[Strings.serverCertificateHashes] = serverCertificateHashes.jsValue() + object[Strings.allowPooling] = allowPooling.jsValue + object[Strings.serverCertificateHashes] = serverCertificateHashes.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WebTransportStats.swift b/Sources/DOMKit/WebIDL/WebTransportStats.swift index 4b5c34ae..5aba84a6 100644 --- a/Sources/DOMKit/WebIDL/WebTransportStats.swift +++ b/Sources/DOMKit/WebIDL/WebTransportStats.swift @@ -6,18 +6,18 @@ import JavaScriptKit public class WebTransportStats: BridgedDictionary { public convenience init(timestamp: DOMHighResTimeStamp, bytesSent: UInt64, packetsSent: UInt64, packetsLost: UInt64, numOutgoingStreamsCreated: UInt32, numIncomingStreamsCreated: UInt32, bytesReceived: UInt64, packetsReceived: UInt64, smoothedRtt: DOMHighResTimeStamp, rttVariation: DOMHighResTimeStamp, minRtt: DOMHighResTimeStamp, numReceivedDatagramsDropped: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue() - object[Strings.bytesSent] = bytesSent.jsValue() - object[Strings.packetsSent] = packetsSent.jsValue() - object[Strings.packetsLost] = packetsLost.jsValue() - object[Strings.numOutgoingStreamsCreated] = numOutgoingStreamsCreated.jsValue() - object[Strings.numIncomingStreamsCreated] = numIncomingStreamsCreated.jsValue() - object[Strings.bytesReceived] = bytesReceived.jsValue() - object[Strings.packetsReceived] = packetsReceived.jsValue() - object[Strings.smoothedRtt] = smoothedRtt.jsValue() - object[Strings.rttVariation] = rttVariation.jsValue() - object[Strings.minRtt] = minRtt.jsValue() - object[Strings.numReceivedDatagramsDropped] = numReceivedDatagramsDropped.jsValue() + object[Strings.timestamp] = timestamp.jsValue + object[Strings.bytesSent] = bytesSent.jsValue + object[Strings.packetsSent] = packetsSent.jsValue + object[Strings.packetsLost] = packetsLost.jsValue + object[Strings.numOutgoingStreamsCreated] = numOutgoingStreamsCreated.jsValue + object[Strings.numIncomingStreamsCreated] = numIncomingStreamsCreated.jsValue + object[Strings.bytesReceived] = bytesReceived.jsValue + object[Strings.packetsReceived] = packetsReceived.jsValue + object[Strings.smoothedRtt] = smoothedRtt.jsValue + object[Strings.rttVariation] = rttVariation.jsValue + object[Strings.minRtt] = minRtt.jsValue + object[Strings.numReceivedDatagramsDropped] = numReceivedDatagramsDropped.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WellKnownDirectory.swift b/Sources/DOMKit/WebIDL/WellKnownDirectory.swift index 48d486fa..f33605cb 100644 --- a/Sources/DOMKit/WebIDL/WellKnownDirectory.swift +++ b/Sources/DOMKit/WebIDL/WellKnownDirectory.swift @@ -22,5 +22,5 @@ public enum WellKnownDirectory: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/WheelEvent.swift b/Sources/DOMKit/WebIDL/WheelEvent.swift index ff6e3f06..c43417b3 100644 --- a/Sources/DOMKit/WebIDL/WheelEvent.swift +++ b/Sources/DOMKit/WebIDL/WheelEvent.swift @@ -15,7 +15,7 @@ public class WheelEvent: MouseEvent { } @inlinable public convenience init(type: String, eventInitDict: WheelEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } public static let DOM_DELTA_PIXEL: UInt32 = 0x00 diff --git a/Sources/DOMKit/WebIDL/WheelEventInit.swift b/Sources/DOMKit/WebIDL/WheelEventInit.swift index e27237ae..04433e65 100644 --- a/Sources/DOMKit/WebIDL/WheelEventInit.swift +++ b/Sources/DOMKit/WebIDL/WheelEventInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class WheelEventInit: BridgedDictionary { public convenience init(deltaX: Double, deltaY: Double, deltaZ: Double, deltaMode: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.deltaX] = deltaX.jsValue() - object[Strings.deltaY] = deltaY.jsValue() - object[Strings.deltaZ] = deltaZ.jsValue() - object[Strings.deltaMode] = deltaMode.jsValue() + object[Strings.deltaX] = deltaX.jsValue + object[Strings.deltaY] = deltaY.jsValue + object[Strings.deltaZ] = deltaZ.jsValue + object[Strings.deltaMode] = deltaMode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index a9d881c5..b3a15425 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -78,12 +78,12 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable public func navigate(dir: SpatialNavigationDirection) { let this = jsObject - _ = this[Strings.navigate].function!(this: this, arguments: [dir.jsValue()]) + _ = this[Strings.navigate].function!(this: this, arguments: [dir.jsValue]) } @inlinable public func matchMedia(query: String) -> MediaQueryList { let this = jsObject - return this[Strings.matchMedia].function!(this: this, arguments: [query.jsValue()]).fromJSValue()! + return this[Strings.matchMedia].function!(this: this, arguments: [query.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -91,22 +91,22 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable public func moveTo(x: Int32, y: Int32) { let this = jsObject - _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @inlinable public func moveBy(x: Int32, y: Int32) { let this = jsObject - _ = this[Strings.moveBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.moveBy].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @inlinable public func resizeTo(width: Int32, height: Int32) { let this = jsObject - _ = this[Strings.resizeTo].function!(this: this, arguments: [width.jsValue(), height.jsValue()]) + _ = this[Strings.resizeTo].function!(this: this, arguments: [width.jsValue, height.jsValue]) } @inlinable public func resizeBy(x: Int32, y: Int32) { let this = jsObject - _ = this[Strings.resizeBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.resizeBy].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @ReadonlyAttribute @@ -129,32 +129,32 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable public func scroll(options: ScrollToOptions? = nil) { let this = jsObject - _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) + _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue ?? .undefined]) } @inlinable public func scroll(x: Double, y: Double) { let this = jsObject - _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @inlinable public func scrollTo(options: ScrollToOptions? = nil) { let this = jsObject - _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) + _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue ?? .undefined]) } @inlinable public func scrollTo(x: Double, y: Double) { let this = jsObject - _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @inlinable public func scrollBy(options: ScrollToOptions? = nil) { let this = jsObject - _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue() ?? .undefined]) + _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue ?? .undefined]) } @inlinable public func scrollBy(x: Double, y: Double) { let this = jsObject - _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue(), y.jsValue()]) + _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue, y.jsValue]) } @ReadonlyAttribute @@ -180,19 +180,19 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { let this = jsObject - return this[Strings.getComputedStyle].function!(this: this, arguments: [elt.jsValue(), pseudoElt?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getComputedStyle].function!(this: this, arguments: [elt.jsValue, pseudoElt?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func getDigitalGoodsService(serviceProvider: String) -> JSPromise { let this = jsObject - return this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue()]).fromJSValue()! + return this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func getDigitalGoodsService(serviceProvider: String) async throws -> DigitalGoodsService { let this = jsObject - let _promise: JSPromise = this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute @@ -200,38 +200,38 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { let this = jsObject - let _promise: JSPromise = this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { let this = jsObject - let _promise: JSPromise = this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { let this = jsObject - let _promise: JSPromise = this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute @@ -319,7 +319,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable public func open(url: String? = nil, target: String? = nil, features: String? = nil) -> WindowProxy? { let this = jsObject - return this[Strings.open].function!(this: this, arguments: [url?.jsValue() ?? .undefined, target?.jsValue() ?? .undefined, features?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.open].function!(this: this, arguments: [url?.jsValue ?? .undefined, target?.jsValue ?? .undefined, features?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public subscript(key: String) -> JSObject { @@ -342,17 +342,17 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable public func alert(message: String) { let this = jsObject - _ = this[Strings.alert].function!(this: this, arguments: [message.jsValue()]) + _ = this[Strings.alert].function!(this: this, arguments: [message.jsValue]) } @inlinable public func confirm(message: String? = nil) -> Bool { let this = jsObject - return this[Strings.confirm].function!(this: this, arguments: [message?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.confirm].function!(this: this, arguments: [message?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func prompt(message: String? = nil, default: String? = nil) -> String? { let this = jsObject - return this[Strings.prompt].function!(this: this, arguments: [message?.jsValue() ?? .undefined, `default`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.prompt].function!(this: this, arguments: [message?.jsValue ?? .undefined, `default`?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func print() { @@ -362,12 +362,12 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable public func postMessage(message: JSValue, targetOrigin: String, transfer: [JSObject]? = nil) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), targetOrigin.jsValue(), transfer?.jsValue() ?? .undefined]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, targetOrigin.jsValue, transfer?.jsValue ?? .undefined]) } @inlinable public func postMessage(message: JSValue, options: WindowPostMessageOptions? = nil) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]) } @inlinable public func captureEvents() { @@ -411,7 +411,7 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable public func cancelIdleCallback(handle: UInt32) { let this = jsObject - _ = this[Strings.cancelIdleCallback].function!(this: this, arguments: [handle.jsValue()]) + _ = this[Strings.cancelIdleCallback].function!(this: this, arguments: [handle.jsValue]) } @inlinable public func getSelection() -> Selection? { diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift index 90494080..8f180156 100644 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift @@ -13,7 +13,7 @@ public class WindowControlsOverlayGeometryChangeEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: WindowControlsOverlayGeometryChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift index 2a4a9840..d6df0bf0 100644 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class WindowControlsOverlayGeometryChangeEventInit: BridgedDictionary { public convenience init(titlebarAreaRect: DOMRect, visible: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.titlebarAreaRect] = titlebarAreaRect.jsValue() - object[Strings.visible] = visible.jsValue() + object[Strings.titlebarAreaRect] = titlebarAreaRect.jsValue + object[Strings.visible] = visible.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index c7a0632b..4c116857 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -11,14 +11,14 @@ public extension WindowOrWorkerGlobalScope { @inlinable func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { let this = jsObject - return this[Strings.fetch].function!(this: this, arguments: [input.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.fetch].function!(this: this, arguments: [input.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable func fetch(input: RequestInfo, init: RequestInit? = nil) async throws -> Response { let this = jsObject - let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [input.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [input.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable var performance: Performance { ReadonlyAttribute[Strings.performance, in: jsObject] } @@ -31,80 +31,80 @@ public extension WindowOrWorkerGlobalScope { @inlinable func reportError(e: JSValue) { let this = jsObject - _ = this[Strings.reportError].function!(this: this, arguments: [e.jsValue()]) + _ = this[Strings.reportError].function!(this: this, arguments: [e.jsValue]) } @inlinable func btoa(data: String) -> String { let this = jsObject - return this[Strings.btoa].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! + return this[Strings.btoa].function!(this: this, arguments: [data.jsValue]).fromJSValue()! } @inlinable func atob(data: String) -> String { let this = jsObject - return this[Strings.atob].function!(this: this, arguments: [data.jsValue()]).fromJSValue()! + return this[Strings.atob].function!(this: this, arguments: [data.jsValue]).fromJSValue()! } @inlinable func setTimeout(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { let this = jsObject - return this[Strings.setTimeout].function!(this: this, arguments: [handler.jsValue(), timeout?.jsValue() ?? .undefined] + arguments.map { $0.jsValue() }).fromJSValue()! + return this[Strings.setTimeout].function!(this: this, arguments: [handler.jsValue, timeout?.jsValue ?? .undefined] + arguments.map(\.jsValue)).fromJSValue()! } @inlinable func clearTimeout(id: Int32? = nil) { let this = jsObject - _ = this[Strings.clearTimeout].function!(this: this, arguments: [id?.jsValue() ?? .undefined]) + _ = this[Strings.clearTimeout].function!(this: this, arguments: [id?.jsValue ?? .undefined]) } @inlinable func setInterval(handler: TimerHandler, timeout: Int32? = nil, arguments: JSValue...) -> Int32 { let this = jsObject - return this[Strings.setInterval].function!(this: this, arguments: [handler.jsValue(), timeout?.jsValue() ?? .undefined] + arguments.map { $0.jsValue() }).fromJSValue()! + return this[Strings.setInterval].function!(this: this, arguments: [handler.jsValue, timeout?.jsValue ?? .undefined] + arguments.map(\.jsValue)).fromJSValue()! } @inlinable func clearInterval(id: Int32? = nil) { let this = jsObject - _ = this[Strings.clearInterval].function!(this: this, arguments: [id?.jsValue() ?? .undefined]) + _ = this[Strings.clearInterval].function!(this: this, arguments: [id?.jsValue ?? .undefined]) } // XXX: method 'queueMicrotask' is ignored @inlinable func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.createImageBitmap].function!(this: this, arguments: [image.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createImageBitmap].function!(this: this, arguments: [image.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable func createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { let this = jsObject - let _promise: JSPromise = this[Strings.createImageBitmap].function!(this: this, arguments: [image.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.createImageBitmap].function!(this: this, arguments: [image.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable func createImageBitmap(image: ImageBitmapSource, sx: Int32, sy: Int32, sw: Int32, sh: Int32, options: ImageBitmapOptions? = nil) -> JSPromise { - let _arg0 = image.jsValue() - let _arg1 = sx.jsValue() - let _arg2 = sy.jsValue() - let _arg3 = sw.jsValue() - let _arg4 = sh.jsValue() - let _arg5 = options?.jsValue() ?? .undefined + let _arg0 = image.jsValue + let _arg1 = sx.jsValue + let _arg2 = sy.jsValue + let _arg3 = sw.jsValue + let _arg4 = sh.jsValue + let _arg5 = options?.jsValue ?? .undefined let this = jsObject return this[Strings.createImageBitmap].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable func createImageBitmap(image: ImageBitmapSource, sx: Int32, sy: Int32, sw: Int32, sh: Int32, options: ImageBitmapOptions? = nil) async throws -> ImageBitmap { - let _arg0 = image.jsValue() - let _arg1 = sx.jsValue() - let _arg2 = sy.jsValue() - let _arg3 = sw.jsValue() - let _arg4 = sh.jsValue() - let _arg5 = options?.jsValue() ?? .undefined + let _arg0 = image.jsValue + let _arg1 = sx.jsValue + let _arg2 = sy.jsValue + let _arg3 = sw.jsValue + let _arg4 = sh.jsValue + let _arg5 = options?.jsValue ?? .undefined let this = jsObject let _promise: JSPromise = this[Strings.createImageBitmap].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable func structuredClone(value: JSValue, options: StructuredSerializeOptions? = nil) -> JSValue { let this = jsObject - return this[Strings.structuredClone].function!(this: this, arguments: [value.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.structuredClone].function!(this: this, arguments: [value.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @inlinable var originPolicyIds: [String] { ReadonlyAttribute[Strings.originPolicyIds, in: jsObject] } diff --git a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift index fb328d2b..34eff6f7 100644 --- a/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift +++ b/Sources/DOMKit/WebIDL/WindowPostMessageOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class WindowPostMessageOptions: BridgedDictionary { public convenience init(targetOrigin: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.targetOrigin] = targetOrigin.jsValue() + object[Strings.targetOrigin] = targetOrigin.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/Worker.swift b/Sources/DOMKit/WebIDL/Worker.swift index 07af18e2..29375925 100644 --- a/Sources/DOMKit/WebIDL/Worker.swift +++ b/Sources/DOMKit/WebIDL/Worker.swift @@ -13,7 +13,7 @@ public class Worker: EventTarget, AbstractWorker { } @inlinable public convenience init(scriptURL: String, options: WorkerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [scriptURL.jsValue(), options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [scriptURL.jsValue, options?.jsValue ?? .undefined])) } @inlinable public func terminate() { @@ -23,12 +23,12 @@ public class Worker: EventTarget, AbstractWorker { @inlinable public func postMessage(message: JSValue, transfer: [JSObject]) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), transfer.jsValue()]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, transfer.jsValue]) } @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue(), options?.jsValue() ?? .undefined]) + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]) } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/WorkerOptions.swift b/Sources/DOMKit/WebIDL/WorkerOptions.swift index 75157849..41e473f4 100644 --- a/Sources/DOMKit/WebIDL/WorkerOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkerOptions.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class WorkerOptions: BridgedDictionary { public convenience init(type: WorkerType, credentials: RequestCredentials, name: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.credentials] = credentials.jsValue() - object[Strings.name] = name.jsValue() + object[Strings.type] = type.jsValue + object[Strings.credentials] = credentials.jsValue + object[Strings.name] = name.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WorkerType.swift b/Sources/DOMKit/WebIDL/WorkerType.swift index 6cdbf4e8..c52ed4c4 100644 --- a/Sources/DOMKit/WebIDL/WorkerType.swift +++ b/Sources/DOMKit/WebIDL/WorkerType.swift @@ -18,5 +18,5 @@ public enum WorkerType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/Worklet.swift b/Sources/DOMKit/WebIDL/Worklet.swift index 12fe899f..6d776066 100644 --- a/Sources/DOMKit/WebIDL/Worklet.swift +++ b/Sources/DOMKit/WebIDL/Worklet.swift @@ -14,13 +14,13 @@ public class Worklet: JSBridgedClass { @inlinable public func addModule(moduleURL: String, options: WorkletOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.addModule].function!(this: this, arguments: [moduleURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.addModule].function!(this: this, arguments: [moduleURL.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func addModule(moduleURL: String, options: WorkletOptions? = nil) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.addModule].function!(this: this, arguments: [moduleURL.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.addModule].function!(this: this, arguments: [moduleURL.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/WorkletAnimation.swift b/Sources/DOMKit/WebIDL/WorkletAnimation.swift index 334e4e9d..ada0c24e 100644 --- a/Sources/DOMKit/WebIDL/WorkletAnimation.swift +++ b/Sources/DOMKit/WebIDL/WorkletAnimation.swift @@ -12,7 +12,7 @@ public class WorkletAnimation: Animation { } @inlinable public convenience init(animatorName: String, effects: AnimationEffect_or_seq_of_AnimationEffect? = nil, timeline: AnimationTimeline? = nil, options: JSValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [animatorName.jsValue(), effects?.jsValue() ?? .undefined, timeline?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [animatorName.jsValue, effects?.jsValue ?? .undefined, timeline?.jsValue ?? .undefined, options?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/WorkletOptions.swift b/Sources/DOMKit/WebIDL/WorkletOptions.swift index b188889f..153d4b62 100644 --- a/Sources/DOMKit/WebIDL/WorkletOptions.swift +++ b/Sources/DOMKit/WebIDL/WorkletOptions.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class WorkletOptions: BridgedDictionary { public convenience init(credentials: RequestCredentials) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.credentials] = credentials.jsValue() + object[Strings.credentials] = credentials.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift index 8598e42d..779b06d5 100644 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ b/Sources/DOMKit/WebIDL/WritableStream.swift @@ -14,7 +14,7 @@ public class WritableStream: JSBridgedClass { } @inlinable public convenience init(underlyingSink: JSObject? = nil, strategy: QueuingStrategy? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [underlyingSink?.jsValue() ?? .undefined, strategy?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [underlyingSink?.jsValue ?? .undefined, strategy?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -22,14 +22,14 @@ public class WritableStream: JSBridgedClass { @inlinable public func abort(reason: JSValue? = nil) -> JSPromise { let this = jsObject - return this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! + 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.get() + let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func close() -> JSPromise { @@ -41,7 +41,7 @@ public class WritableStream: JSBridgedClass { @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func getWriter() -> WritableStreamDefaultWriter { diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift index 3f17fa84..b6ab0100 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift @@ -18,6 +18,6 @@ public class WritableStreamDefaultController: JSBridgedClass { @inlinable public func error(e: JSValue? = nil) { let this = jsObject - _ = this[Strings.error].function!(this: this, arguments: [e?.jsValue() ?? .undefined]) + _ = this[Strings.error].function!(this: this, arguments: [e?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift index e5b59d99..bd266356 100644 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift @@ -16,7 +16,7 @@ public class WritableStreamDefaultWriter: JSBridgedClass { } @inlinable public convenience init(stream: WritableStream) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue])) } @ReadonlyAttribute @@ -30,14 +30,14 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @inlinable public func abort(reason: JSValue? = nil) -> JSPromise { let this = jsObject - return this[Strings.abort].function!(this: this, arguments: [reason?.jsValue() ?? .undefined]).fromJSValue()! + 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.get() + let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } @inlinable public func close() -> JSPromise { @@ -49,7 +49,7 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @inlinable public func close() async throws { let this = jsObject let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @inlinable public func releaseLock() { @@ -59,13 +59,13 @@ public class WritableStreamDefaultWriter: JSBridgedClass { @inlinable public func write(chunk: JSValue? = nil) -> JSPromise { let this = jsObject - return this[Strings.write].function!(this: this, arguments: [chunk?.jsValue() ?? .undefined]).fromJSValue()! + 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.get() + let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [chunk?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value } } diff --git a/Sources/DOMKit/WebIDL/WriteCommandType.swift b/Sources/DOMKit/WebIDL/WriteCommandType.swift index c6a020a7..c6b802be 100644 --- a/Sources/DOMKit/WebIDL/WriteCommandType.swift +++ b/Sources/DOMKit/WebIDL/WriteCommandType.swift @@ -19,5 +19,5 @@ public enum WriteCommandType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/WriteParams.swift b/Sources/DOMKit/WebIDL/WriteParams.swift index 09b1e8f1..e612a1c1 100644 --- a/Sources/DOMKit/WebIDL/WriteParams.swift +++ b/Sources/DOMKit/WebIDL/WriteParams.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class WriteParams: BridgedDictionary { public convenience init(type: WriteCommandType, size: UInt64?, position: UInt64?, data: Blob_or_BufferSource_or_String?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() - object[Strings.size] = size.jsValue() - object[Strings.position] = position.jsValue() - object[Strings.data] = data.jsValue() + object[Strings.type] = type.jsValue + object[Strings.size] = size.jsValue + object[Strings.position] = position.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift index 7a9b2913..1be78b7a 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequest.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequest.swift @@ -44,17 +44,17 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { @inlinable public func open(method: String, url: String) { let this = jsObject - _ = this[Strings.open].function!(this: this, arguments: [method.jsValue(), url.jsValue()]) + _ = this[Strings.open].function!(this: this, arguments: [method.jsValue, url.jsValue]) } @inlinable public func open(method: String, url: String, async: Bool, username: String? = nil, password: String? = nil) { let this = jsObject - _ = this[Strings.open].function!(this: this, arguments: [method.jsValue(), url.jsValue(), async.jsValue(), username?.jsValue() ?? .undefined, password?.jsValue() ?? .undefined]) + _ = this[Strings.open].function!(this: this, arguments: [method.jsValue, url.jsValue, async.jsValue, username?.jsValue ?? .undefined, password?.jsValue ?? .undefined]) } @inlinable public func setRequestHeader(name: String, value: String) { let this = jsObject - _ = this[Strings.setRequestHeader].function!(this: this, arguments: [name.jsValue(), value.jsValue()]) + _ = this[Strings.setRequestHeader].function!(this: this, arguments: [name.jsValue, value.jsValue]) } @ReadWriteAttribute @@ -68,7 +68,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { @inlinable public func send(body: Document_or_XMLHttpRequestBodyInit? = nil) { let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [body?.jsValue() ?? .undefined]) + _ = this[Strings.send].function!(this: this, arguments: [body?.jsValue ?? .undefined]) } @inlinable public func abort() { @@ -87,7 +87,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { @inlinable public func getResponseHeader(name: String) -> String? { let this = jsObject - return this[Strings.getResponseHeader].function!(this: this, arguments: [name.jsValue()]).fromJSValue()! + return this[Strings.getResponseHeader].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } @inlinable public func getAllResponseHeaders() -> String { @@ -97,7 +97,7 @@ public class XMLHttpRequest: XMLHttpRequestEventTarget { @inlinable public func overrideMimeType(mime: String) { let this = jsObject - _ = this[Strings.overrideMimeType].function!(this: this, arguments: [mime.jsValue()]) + _ = this[Strings.overrideMimeType].function!(this: this, arguments: [mime.jsValue]) } @ReadWriteAttribute diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift index 6b4a740a..33a98489 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift @@ -36,18 +36,18 @@ public enum XMLHttpRequestBodyInit: JSValueCompatible, Any_XMLHttpRequestBodyIni return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .blob(blob): - return blob.jsValue() + return blob.jsValue case let .bufferSource(bufferSource): - return bufferSource.jsValue() + return bufferSource.jsValue case let .formData(formData): - return formData.jsValue() + return formData.jsValue case let .string(string): - return string.jsValue() + return string.jsValue case let .uRLSearchParams(uRLSearchParams): - return uRLSearchParams.jsValue() + return uRLSearchParams.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift index 4a96acb6..3fa4b45e 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestResponseType.swift @@ -22,5 +22,5 @@ public enum XMLHttpRequestResponseType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XMLSerializer.swift b/Sources/DOMKit/WebIDL/XMLSerializer.swift index e504c44f..d13cf486 100644 --- a/Sources/DOMKit/WebIDL/XMLSerializer.swift +++ b/Sources/DOMKit/WebIDL/XMLSerializer.swift @@ -18,6 +18,6 @@ public class XMLSerializer: JSBridgedClass { @inlinable public func serializeToString(root: Node) -> String { let this = jsObject - return this[Strings.serializeToString].function!(this: this, arguments: [root.jsValue()]).fromJSValue()! + return this[Strings.serializeToString].function!(this: this, arguments: [root.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XPathExpression.swift b/Sources/DOMKit/WebIDL/XPathExpression.swift index 2eb12393..6716ae55 100644 --- a/Sources/DOMKit/WebIDL/XPathExpression.swift +++ b/Sources/DOMKit/WebIDL/XPathExpression.swift @@ -14,6 +14,6 @@ public class XPathExpression: JSBridgedClass { @inlinable public func evaluate(contextNode: Node, type: UInt16? = nil, result: XPathResult? = nil) -> XPathResult { let this = jsObject - return this[Strings.evaluate].function!(this: this, arguments: [contextNode.jsValue(), type?.jsValue() ?? .undefined, result?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.evaluate].function!(this: this, arguments: [contextNode.jsValue, type?.jsValue ?? .undefined, result?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XPathResult.swift b/Sources/DOMKit/WebIDL/XPathResult.swift index 3e339365..1c4458c5 100644 --- a/Sources/DOMKit/WebIDL/XPathResult.swift +++ b/Sources/DOMKit/WebIDL/XPathResult.swift @@ -67,6 +67,6 @@ public class XPathResult: JSBridgedClass { @inlinable public func snapshotItem(index: UInt32) -> Node? { let this = jsObject - return this[Strings.snapshotItem].function!(this: this, arguments: [index.jsValue()]).fromJSValue()! + return this[Strings.snapshotItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift b/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift index 8271325a..26177977 100644 --- a/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift +++ b/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift @@ -16,6 +16,6 @@ public class XRCPUDepthInformation: XRDepthInformation { @inlinable public func getDepthInMeters(x: Float, y: Float) -> Float { let this = jsObject - return this[Strings.getDepthInMeters].function!(this: this, arguments: [x.jsValue(), y.jsValue()]).fromJSValue()! + return this[Strings.getDepthInMeters].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift b/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift index c97feb38..c12e3fdb 100644 --- a/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class XRCubeLayerInit: BridgedDictionary { public convenience init(orientation: DOMPointReadOnly?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.orientation] = orientation.jsValue() + object[Strings.orientation] = orientation.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift b/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift index 5c888df4..b5f4add7 100644 --- a/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class XRCylinderLayerInit: BridgedDictionary { public convenience init(textureType: XRTextureType, transform: XRRigidTransform?, radius: Float, centralAngle: Float, aspectRatio: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textureType] = textureType.jsValue() - object[Strings.transform] = transform.jsValue() - object[Strings.radius] = radius.jsValue() - object[Strings.centralAngle] = centralAngle.jsValue() - object[Strings.aspectRatio] = aspectRatio.jsValue() + object[Strings.textureType] = textureType.jsValue + object[Strings.transform] = transform.jsValue + object[Strings.radius] = radius.jsValue + object[Strings.centralAngle] = centralAngle.jsValue + object[Strings.aspectRatio] = aspectRatio.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift index da7355c9..4d3dae89 100644 --- a/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift +++ b/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class XRDOMOverlayInit: BridgedDictionary { public convenience init(root: Element) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.root] = root.jsValue() + object[Strings.root] = root.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift index 16aedf17..625c7ecb 100644 --- a/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift +++ b/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class XRDOMOverlayState: BridgedDictionary { public convenience init(type: XRDOMOverlayType) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue() + object[Strings.type] = type.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift index 4c9b9236..d394f0c9 100644 --- a/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift +++ b/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift @@ -19,5 +19,5 @@ public enum XRDOMOverlayType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift b/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift index 3bd9c3e7..8a3c2645 100644 --- a/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift +++ b/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift @@ -18,5 +18,5 @@ public enum XRDepthDataFormat: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRDepthStateInit.swift b/Sources/DOMKit/WebIDL/XRDepthStateInit.swift index 31f85f30..d8178c7c 100644 --- a/Sources/DOMKit/WebIDL/XRDepthStateInit.swift +++ b/Sources/DOMKit/WebIDL/XRDepthStateInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class XRDepthStateInit: BridgedDictionary { public convenience init(usagePreference: [XRDepthUsage], dataFormatPreference: [XRDepthDataFormat]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usagePreference] = usagePreference.jsValue() - object[Strings.dataFormatPreference] = dataFormatPreference.jsValue() + object[Strings.usagePreference] = usagePreference.jsValue + object[Strings.dataFormatPreference] = dataFormatPreference.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRDepthUsage.swift b/Sources/DOMKit/WebIDL/XRDepthUsage.swift index dcb4b25d..3b5a99d4 100644 --- a/Sources/DOMKit/WebIDL/XRDepthUsage.swift +++ b/Sources/DOMKit/WebIDL/XRDepthUsage.swift @@ -18,5 +18,5 @@ public enum XRDepthUsage: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift b/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift index 4341fbf7..81ff1a66 100644 --- a/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift +++ b/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift @@ -19,5 +19,5 @@ public enum XREnvironmentBlendMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift b/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift index f669bd06..24b64452 100644 --- a/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class XREquirectLayerInit: BridgedDictionary { public convenience init(textureType: XRTextureType, transform: XRRigidTransform?, radius: Float, centralHorizontalAngle: Float, upperVerticalAngle: Float, lowerVerticalAngle: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textureType] = textureType.jsValue() - object[Strings.transform] = transform.jsValue() - object[Strings.radius] = radius.jsValue() - object[Strings.centralHorizontalAngle] = centralHorizontalAngle.jsValue() - object[Strings.upperVerticalAngle] = upperVerticalAngle.jsValue() - object[Strings.lowerVerticalAngle] = lowerVerticalAngle.jsValue() + object[Strings.textureType] = textureType.jsValue + object[Strings.transform] = transform.jsValue + object[Strings.radius] = radius.jsValue + object[Strings.centralHorizontalAngle] = centralHorizontalAngle.jsValue + object[Strings.upperVerticalAngle] = upperVerticalAngle.jsValue + object[Strings.lowerVerticalAngle] = lowerVerticalAngle.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XREye.swift b/Sources/DOMKit/WebIDL/XREye.swift index 4b22aa16..f5a41446 100644 --- a/Sources/DOMKit/WebIDL/XREye.swift +++ b/Sources/DOMKit/WebIDL/XREye.swift @@ -19,5 +19,5 @@ public enum XREye: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRFrame.swift b/Sources/DOMKit/WebIDL/XRFrame.swift index c5ebbab9..f3f0a6ef 100644 --- a/Sources/DOMKit/WebIDL/XRFrame.swift +++ b/Sources/DOMKit/WebIDL/XRFrame.swift @@ -17,14 +17,14 @@ public class XRFrame: JSBridgedClass { @inlinable public func createAnchor(pose: XRRigidTransform, space: XRSpace) -> JSPromise { let this = jsObject - return this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue(), space.jsValue()]).fromJSValue()! + return this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue, space.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func createAnchor(pose: XRRigidTransform, space: XRSpace) async throws -> XRAnchor { let this = jsObject - let _promise: JSPromise = this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue(), space.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue, space.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute @@ -32,37 +32,37 @@ public class XRFrame: JSBridgedClass { @inlinable public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { let this = jsObject - return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! + return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue]).fromJSValue()! } @inlinable public func getJointPose(joint: XRJointSpace, baseSpace: XRSpace) -> XRJointPose? { let this = jsObject - return this[Strings.getJointPose].function!(this: this, arguments: [joint.jsValue(), baseSpace.jsValue()]).fromJSValue()! + return this[Strings.getJointPose].function!(this: this, arguments: [joint.jsValue, baseSpace.jsValue]).fromJSValue()! } @inlinable public func fillJointRadii(jointSpaces: [XRJointSpace], radii: Float32Array) -> Bool { let this = jsObject - return this[Strings.fillJointRadii].function!(this: this, arguments: [jointSpaces.jsValue(), radii.jsValue()]).fromJSValue()! + return this[Strings.fillJointRadii].function!(this: this, arguments: [jointSpaces.jsValue, radii.jsValue]).fromJSValue()! } @inlinable public func fillPoses(spaces: [XRSpace], baseSpace: XRSpace, transforms: Float32Array) -> Bool { let this = jsObject - return this[Strings.fillPoses].function!(this: this, arguments: [spaces.jsValue(), baseSpace.jsValue(), transforms.jsValue()]).fromJSValue()! + return this[Strings.fillPoses].function!(this: this, arguments: [spaces.jsValue, baseSpace.jsValue, transforms.jsValue]).fromJSValue()! } @inlinable public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { let this = jsObject - return this[Strings.getHitTestResults].function!(this: this, arguments: [hitTestSource.jsValue()]).fromJSValue()! + return this[Strings.getHitTestResults].function!(this: this, arguments: [hitTestSource.jsValue]).fromJSValue()! } @inlinable public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { let this = jsObject - return this[Strings.getHitTestResultsForTransientInput].function!(this: this, arguments: [hitTestSource.jsValue()]).fromJSValue()! + return this[Strings.getHitTestResultsForTransientInput].function!(this: this, arguments: [hitTestSource.jsValue]).fromJSValue()! } @inlinable public func getLightEstimate(lightProbe: XRLightProbe) -> XRLightEstimate? { let this = jsObject - return this[Strings.getLightEstimate].function!(this: this, arguments: [lightProbe.jsValue()]).fromJSValue()! + return this[Strings.getLightEstimate].function!(this: this, arguments: [lightProbe.jsValue]).fromJSValue()! } @ReadonlyAttribute @@ -73,11 +73,11 @@ public class XRFrame: JSBridgedClass { @inlinable public func getViewerPose(referenceSpace: XRReferenceSpace) -> XRViewerPose? { let this = jsObject - return this[Strings.getViewerPose].function!(this: this, arguments: [referenceSpace.jsValue()]).fromJSValue()! + return this[Strings.getViewerPose].function!(this: this, arguments: [referenceSpace.jsValue]).fromJSValue()! } @inlinable public func getPose(space: XRSpace, baseSpace: XRSpace) -> XRPose? { let this = jsObject - return this[Strings.getPose].function!(this: this, arguments: [space.jsValue(), baseSpace.jsValue()]).fromJSValue()! + return this[Strings.getPose].function!(this: this, arguments: [space.jsValue, baseSpace.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRHand.swift b/Sources/DOMKit/WebIDL/XRHand.swift index 8f49d4ba..bd7b774f 100644 --- a/Sources/DOMKit/WebIDL/XRHand.swift +++ b/Sources/DOMKit/WebIDL/XRHand.swift @@ -23,6 +23,6 @@ public class XRHand: JSBridgedClass, Sequence { @inlinable public func get(key: XRHandJoint) -> XRJointSpace { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [key.jsValue()]).fromJSValue()! + return this[Strings.get].function!(this: this, arguments: [key.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRHandJoint.swift b/Sources/DOMKit/WebIDL/XRHandJoint.swift index cece1fd5..efa483d8 100644 --- a/Sources/DOMKit/WebIDL/XRHandJoint.swift +++ b/Sources/DOMKit/WebIDL/XRHandJoint.swift @@ -41,5 +41,5 @@ public enum XRHandJoint: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRHandedness.swift b/Sources/DOMKit/WebIDL/XRHandedness.swift index 85ba72c0..804ac708 100644 --- a/Sources/DOMKit/WebIDL/XRHandedness.swift +++ b/Sources/DOMKit/WebIDL/XRHandedness.swift @@ -19,5 +19,5 @@ public enum XRHandedness: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift b/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift index e7fcd739..77306b09 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class XRHitTestOptionsInit: BridgedDictionary { public convenience init(space: XRSpace, entityTypes: [XRHitTestTrackableType], offsetRay: XRRay) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.space] = space.jsValue() - object[Strings.entityTypes] = entityTypes.jsValue() - object[Strings.offsetRay] = offsetRay.jsValue() + object[Strings.space] = space.jsValue + object[Strings.entityTypes] = entityTypes.jsValue + object[Strings.offsetRay] = offsetRay.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRHitTestResult.swift b/Sources/DOMKit/WebIDL/XRHitTestResult.swift index b315e8a5..ca741634 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestResult.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestResult.swift @@ -21,11 +21,11 @@ public class XRHitTestResult: JSBridgedClass { @inlinable public func createAnchor() async throws -> XRAnchor { let this = jsObject let _promise: JSPromise = this[Strings.createAnchor].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.get().fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func getPose(baseSpace: XRSpace) -> XRPose? { let this = jsObject - return this[Strings.getPose].function!(this: this, arguments: [baseSpace.jsValue()]).fromJSValue()! + return this[Strings.getPose].function!(this: this, arguments: [baseSpace.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift b/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift index 60517361..4d14174c 100644 --- a/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift +++ b/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift @@ -19,5 +19,5 @@ public enum XRHitTestTrackableType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift index c44ddff1..c3a04521 100644 --- a/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift +++ b/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift @@ -13,7 +13,7 @@ public class XRInputSourceEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: XRInputSourceEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift b/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift index 0ce27145..e35e9ac3 100644 --- a/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift +++ b/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class XRInputSourceEventInit: BridgedDictionary { public convenience init(frame: XRFrame, inputSource: XRInputSource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.frame] = frame.jsValue() - object[Strings.inputSource] = inputSource.jsValue() + object[Strings.frame] = frame.jsValue + object[Strings.inputSource] = inputSource.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift index 15ba721b..c888ef75 100644 --- a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift +++ b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift @@ -14,7 +14,7 @@ public class XRInputSourcesChangeEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: XRInputSourcesChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift index fc951723..341e506d 100644 --- a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift +++ b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class XRInputSourcesChangeEventInit: BridgedDictionary { public convenience init(session: XRSession, added: [XRInputSource], removed: [XRInputSource]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.session] = session.jsValue() - object[Strings.added] = added.jsValue() - object[Strings.removed] = removed.jsValue() + object[Strings.session] = session.jsValue + object[Strings.added] = added.jsValue + object[Strings.removed] = removed.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRInteractionMode.swift b/Sources/DOMKit/WebIDL/XRInteractionMode.swift index 108bdf2b..c3bb2dba 100644 --- a/Sources/DOMKit/WebIDL/XRInteractionMode.swift +++ b/Sources/DOMKit/WebIDL/XRInteractionMode.swift @@ -18,5 +18,5 @@ public enum XRInteractionMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRLayerEvent.swift b/Sources/DOMKit/WebIDL/XRLayerEvent.swift index ee1ca0c3..ba2b056e 100644 --- a/Sources/DOMKit/WebIDL/XRLayerEvent.swift +++ b/Sources/DOMKit/WebIDL/XRLayerEvent.swift @@ -12,7 +12,7 @@ public class XRLayerEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: XRLayerEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRLayerEventInit.swift b/Sources/DOMKit/WebIDL/XRLayerEventInit.swift index f4d52de5..b5408f33 100644 --- a/Sources/DOMKit/WebIDL/XRLayerEventInit.swift +++ b/Sources/DOMKit/WebIDL/XRLayerEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class XRLayerEventInit: BridgedDictionary { public convenience init(layer: XRLayer) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.layer] = layer.jsValue() + object[Strings.layer] = layer.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRLayerInit.swift b/Sources/DOMKit/WebIDL/XRLayerInit.swift index f7bac833..435e7e9f 100644 --- a/Sources/DOMKit/WebIDL/XRLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRLayerInit.swift @@ -6,14 +6,14 @@ import JavaScriptKit public class XRLayerInit: BridgedDictionary { public convenience init(space: XRSpace, colorFormat: GLenum, depthFormat: GLenum?, mipLevels: UInt32, viewPixelWidth: UInt32, viewPixelHeight: UInt32, layout: XRLayerLayout, isStatic: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.space] = space.jsValue() - object[Strings.colorFormat] = colorFormat.jsValue() - object[Strings.depthFormat] = depthFormat.jsValue() - object[Strings.mipLevels] = mipLevels.jsValue() - object[Strings.viewPixelWidth] = viewPixelWidth.jsValue() - object[Strings.viewPixelHeight] = viewPixelHeight.jsValue() - object[Strings.layout] = layout.jsValue() - object[Strings.isStatic] = isStatic.jsValue() + object[Strings.space] = space.jsValue + object[Strings.colorFormat] = colorFormat.jsValue + object[Strings.depthFormat] = depthFormat.jsValue + object[Strings.mipLevels] = mipLevels.jsValue + object[Strings.viewPixelWidth] = viewPixelWidth.jsValue + object[Strings.viewPixelHeight] = viewPixelHeight.jsValue + object[Strings.layout] = layout.jsValue + object[Strings.isStatic] = isStatic.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRLayerLayout.swift b/Sources/DOMKit/WebIDL/XRLayerLayout.swift index ad3ef90a..cd3f56ca 100644 --- a/Sources/DOMKit/WebIDL/XRLayerLayout.swift +++ b/Sources/DOMKit/WebIDL/XRLayerLayout.swift @@ -21,5 +21,5 @@ public enum XRLayerLayout: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRLightProbeInit.swift b/Sources/DOMKit/WebIDL/XRLightProbeInit.swift index f1a089c8..002e9501 100644 --- a/Sources/DOMKit/WebIDL/XRLightProbeInit.swift +++ b/Sources/DOMKit/WebIDL/XRLightProbeInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class XRLightProbeInit: BridgedDictionary { public convenience init(reflectionFormat: XRReflectionFormat) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.reflectionFormat] = reflectionFormat.jsValue() + object[Strings.reflectionFormat] = reflectionFormat.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRMediaBinding.swift b/Sources/DOMKit/WebIDL/XRMediaBinding.swift index 6f2e841c..06161ba3 100644 --- a/Sources/DOMKit/WebIDL/XRMediaBinding.swift +++ b/Sources/DOMKit/WebIDL/XRMediaBinding.swift @@ -13,21 +13,21 @@ public class XRMediaBinding: JSBridgedClass { } @inlinable public convenience init(session: XRSession) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue])) } @inlinable public func createQuadLayer(video: HTMLVideoElement, init: XRMediaQuadLayerInit? = nil) -> XRQuadLayer { let this = jsObject - return this[Strings.createQuadLayer].function!(this: this, arguments: [video.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createQuadLayer].function!(this: this, arguments: [video.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createCylinderLayer(video: HTMLVideoElement, init: XRMediaCylinderLayerInit? = nil) -> XRCylinderLayer { let this = jsObject - return this[Strings.createCylinderLayer].function!(this: this, arguments: [video.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createCylinderLayer].function!(this: this, arguments: [video.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createEquirectLayer(video: HTMLVideoElement, init: XRMediaEquirectLayerInit? = nil) -> XREquirectLayer { let this = jsObject - return this[Strings.createEquirectLayer].function!(this: this, arguments: [video.jsValue(), `init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createEquirectLayer].function!(this: this, arguments: [video.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift index febfd610..61f74bc8 100644 --- a/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class XRMediaCylinderLayerInit: BridgedDictionary { public convenience init(transform: XRRigidTransform?, radius: Float, centralAngle: Float, aspectRatio: Float?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transform] = transform.jsValue() - object[Strings.radius] = radius.jsValue() - object[Strings.centralAngle] = centralAngle.jsValue() - object[Strings.aspectRatio] = aspectRatio.jsValue() + object[Strings.transform] = transform.jsValue + object[Strings.radius] = radius.jsValue + object[Strings.centralAngle] = centralAngle.jsValue + object[Strings.aspectRatio] = aspectRatio.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift index e79d02d2..91d30fc0 100644 --- a/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class XRMediaEquirectLayerInit: BridgedDictionary { public convenience init(transform: XRRigidTransform?, radius: Float, centralHorizontalAngle: Float, upperVerticalAngle: Float, lowerVerticalAngle: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transform] = transform.jsValue() - object[Strings.radius] = radius.jsValue() - object[Strings.centralHorizontalAngle] = centralHorizontalAngle.jsValue() - object[Strings.upperVerticalAngle] = upperVerticalAngle.jsValue() - object[Strings.lowerVerticalAngle] = lowerVerticalAngle.jsValue() + object[Strings.transform] = transform.jsValue + object[Strings.radius] = radius.jsValue + object[Strings.centralHorizontalAngle] = centralHorizontalAngle.jsValue + object[Strings.upperVerticalAngle] = upperVerticalAngle.jsValue + object[Strings.lowerVerticalAngle] = lowerVerticalAngle.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift index 9d02733a..2a6d6a0e 100644 --- a/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class XRMediaLayerInit: BridgedDictionary { public convenience init(space: XRSpace, layout: XRLayerLayout, invertStereo: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.space] = space.jsValue() - object[Strings.layout] = layout.jsValue() - object[Strings.invertStereo] = invertStereo.jsValue() + object[Strings.space] = space.jsValue + object[Strings.layout] = layout.jsValue + object[Strings.invertStereo] = invertStereo.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift index 1a7d8824..60142942 100644 --- a/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class XRMediaQuadLayerInit: BridgedDictionary { public convenience init(transform: XRRigidTransform?, width: Float?, height: Float?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transform] = transform.jsValue() - object[Strings.width] = width.jsValue() - object[Strings.height] = height.jsValue() + object[Strings.transform] = transform.jsValue + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift index 8ed7b94f..c7e0efbc 100644 --- a/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class XRPermissionDescriptor: BridgedDictionary { public convenience init(mode: XRSessionMode, requiredFeatures: [JSValue], optionalFeatures: [JSValue]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue() - object[Strings.requiredFeatures] = requiredFeatures.jsValue() - object[Strings.optionalFeatures] = optionalFeatures.jsValue() + object[Strings.mode] = mode.jsValue + object[Strings.requiredFeatures] = requiredFeatures.jsValue + object[Strings.optionalFeatures] = optionalFeatures.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift b/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift index 3daf7132..1c5bca0f 100644 --- a/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class XRProjectionLayerInit: BridgedDictionary { public convenience init(textureType: XRTextureType, colorFormat: GLenum, depthFormat: GLenum, scaleFactor: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textureType] = textureType.jsValue() - object[Strings.colorFormat] = colorFormat.jsValue() - object[Strings.depthFormat] = depthFormat.jsValue() - object[Strings.scaleFactor] = scaleFactor.jsValue() + object[Strings.textureType] = textureType.jsValue + object[Strings.colorFormat] = colorFormat.jsValue + object[Strings.depthFormat] = depthFormat.jsValue + object[Strings.scaleFactor] = scaleFactor.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift b/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift index a45cad8f..2f8c83ec 100644 --- a/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class XRQuadLayerInit: BridgedDictionary { public convenience init(textureType: XRTextureType, transform: XRRigidTransform?, width: Float, height: Float) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textureType] = textureType.jsValue() - object[Strings.transform] = transform.jsValue() - object[Strings.width] = width.jsValue() - object[Strings.height] = height.jsValue() + object[Strings.textureType] = textureType.jsValue + object[Strings.transform] = transform.jsValue + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRRay.swift b/Sources/DOMKit/WebIDL/XRRay.swift index e4cd9a0e..7d4d2509 100644 --- a/Sources/DOMKit/WebIDL/XRRay.swift +++ b/Sources/DOMKit/WebIDL/XRRay.swift @@ -16,11 +16,11 @@ public class XRRay: JSBridgedClass { } @inlinable public convenience init(origin: DOMPointInit? = nil, direction: XRRayDirectionInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [origin?.jsValue() ?? .undefined, direction?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [origin?.jsValue ?? .undefined, direction?.jsValue ?? .undefined])) } @inlinable public convenience init(transform: XRRigidTransform) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [transform.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [transform.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift b/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift index f85e1d5b..80f39144 100644 --- a/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift +++ b/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class XRRayDirectionInit: BridgedDictionary { public convenience init(x: Double, y: Double, z: Double, w: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue() - object[Strings.y] = y.jsValue() - object[Strings.z] = z.jsValue() - object[Strings.w] = w.jsValue() + object[Strings.x] = x.jsValue + object[Strings.y] = y.jsValue + object[Strings.z] = z.jsValue + object[Strings.w] = w.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift index 634226f7..29be4cfe 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift @@ -13,7 +13,7 @@ public class XRReferenceSpace: XRSpace { @inlinable public func getOffsetReferenceSpace(originOffset: XRRigidTransform) -> Self { let this = jsObject - return this[Strings.getOffsetReferenceSpace].function!(this: this, arguments: [originOffset.jsValue()]).fromJSValue()! + return this[Strings.getOffsetReferenceSpace].function!(this: this, arguments: [originOffset.jsValue]).fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift index 9df5325e..59ffdd0d 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift @@ -13,7 +13,7 @@ public class XRReferenceSpaceEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: XRReferenceSpaceEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift index f122cd2d..00b54c62 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift @@ -6,8 +6,8 @@ import JavaScriptKit public class XRReferenceSpaceEventInit: BridgedDictionary { public convenience init(referenceSpace: XRReferenceSpace, transform: XRRigidTransform?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceSpace] = referenceSpace.jsValue() - object[Strings.transform] = transform.jsValue() + object[Strings.referenceSpace] = referenceSpace.jsValue + object[Strings.transform] = transform.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift index 5dd22e21..5020209c 100644 --- a/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift +++ b/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift @@ -21,5 +21,5 @@ public enum XRReferenceSpaceType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRReflectionFormat.swift b/Sources/DOMKit/WebIDL/XRReflectionFormat.swift index fceaf978..9c6353ba 100644 --- a/Sources/DOMKit/WebIDL/XRReflectionFormat.swift +++ b/Sources/DOMKit/WebIDL/XRReflectionFormat.swift @@ -18,5 +18,5 @@ public enum XRReflectionFormat: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRRenderStateInit.swift b/Sources/DOMKit/WebIDL/XRRenderStateInit.swift index b36642bc..f6e54575 100644 --- a/Sources/DOMKit/WebIDL/XRRenderStateInit.swift +++ b/Sources/DOMKit/WebIDL/XRRenderStateInit.swift @@ -6,11 +6,11 @@ import JavaScriptKit public class XRRenderStateInit: BridgedDictionary { public convenience init(depthNear: Double, depthFar: Double, inlineVerticalFieldOfView: Double, baseLayer: XRWebGLLayer?, layers: [XRLayer]?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.depthNear] = depthNear.jsValue() - object[Strings.depthFar] = depthFar.jsValue() - object[Strings.inlineVerticalFieldOfView] = inlineVerticalFieldOfView.jsValue() - object[Strings.baseLayer] = baseLayer.jsValue() - object[Strings.layers] = layers.jsValue() + object[Strings.depthNear] = depthNear.jsValue + object[Strings.depthFar] = depthFar.jsValue + object[Strings.inlineVerticalFieldOfView] = inlineVerticalFieldOfView.jsValue + object[Strings.baseLayer] = baseLayer.jsValue + object[Strings.layers] = layers.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRRigidTransform.swift b/Sources/DOMKit/WebIDL/XRRigidTransform.swift index b9ee50a9..5515bbcb 100644 --- a/Sources/DOMKit/WebIDL/XRRigidTransform.swift +++ b/Sources/DOMKit/WebIDL/XRRigidTransform.swift @@ -17,7 +17,7 @@ public class XRRigidTransform: JSBridgedClass { } @inlinable public convenience init(position: DOMPointInit? = nil, orientation: DOMPointInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [position?.jsValue() ?? .undefined, orientation?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [position?.jsValue ?? .undefined, orientation?.jsValue ?? .undefined])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRSession.swift b/Sources/DOMKit/WebIDL/XRSession.swift index 5648726b..084ecb6c 100644 --- a/Sources/DOMKit/WebIDL/XRSession.swift +++ b/Sources/DOMKit/WebIDL/XRSession.swift @@ -48,38 +48,38 @@ public class XRSession: EventTarget { @inlinable public func requestHitTestSource(options: XRHitTestOptionsInit) -> JSPromise { let this = jsObject - return this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! + return this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestHitTestSource(options: XRHitTestOptionsInit) async throws -> XRHitTestSource { let this = jsObject - let _promise: JSPromise = this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) -> JSPromise { let this = jsObject - return this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! + return this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) async throws -> XRTransientInputHitTestSource { let this = jsObject - let _promise: JSPromise = this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func requestLightProbe(options: XRLightProbeInit? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestLightProbe(options: XRLightProbeInit? = nil) async throws -> XRLightProbe { let this = jsObject - let _promise: JSPromise = this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ReadonlyAttribute @@ -102,38 +102,38 @@ public class XRSession: EventTarget { @inlinable public func updateRenderState(state: XRRenderStateInit? = nil) { let this = jsObject - _ = this[Strings.updateRenderState].function!(this: this, arguments: [state?.jsValue() ?? .undefined]) + _ = this[Strings.updateRenderState].function!(this: this, arguments: [state?.jsValue ?? .undefined]) } @inlinable public func updateTargetFrameRate(rate: Float) -> JSPromise { let this = jsObject - return this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue()]).fromJSValue()! + return this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func updateTargetFrameRate(rate: Float) async throws { let this = jsObject - let _promise: JSPromise = this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue()]).fromJSValue()! - _ = try await _promise.get() + let _promise: JSPromise = this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue]).fromJSValue()! + _ = try await _promise.value } @inlinable public func requestReferenceSpace(type: XRReferenceSpaceType) -> JSPromise { let this = jsObject - return this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! + return this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestReferenceSpace(type: XRReferenceSpaceType) async throws -> XRReferenceSpace { let this = jsObject - let _promise: JSPromise = this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } // XXX: member 'requestAnimationFrame' is ignored @inlinable public func cancelAnimationFrame(handle: UInt32) { let this = jsObject - _ = this[Strings.cancelAnimationFrame].function!(this: this, arguments: [handle.jsValue()]) + _ = this[Strings.cancelAnimationFrame].function!(this: this, arguments: [handle.jsValue]) } @inlinable public func end() -> JSPromise { @@ -145,7 +145,7 @@ public class XRSession: EventTarget { @inlinable public func end() async throws { let this = jsObject let _promise: JSPromise = this[Strings.end].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.get() + _ = try await _promise.value } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/XRSessionEvent.swift b/Sources/DOMKit/WebIDL/XRSessionEvent.swift index a78d82e3..fff62442 100644 --- a/Sources/DOMKit/WebIDL/XRSessionEvent.swift +++ b/Sources/DOMKit/WebIDL/XRSessionEvent.swift @@ -12,7 +12,7 @@ public class XRSessionEvent: Event { } @inlinable public convenience init(type: String, eventInitDict: XRSessionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue(), eventInitDict.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } @ReadonlyAttribute diff --git a/Sources/DOMKit/WebIDL/XRSessionEventInit.swift b/Sources/DOMKit/WebIDL/XRSessionEventInit.swift index 5fe3cfb0..1323c5c0 100644 --- a/Sources/DOMKit/WebIDL/XRSessionEventInit.swift +++ b/Sources/DOMKit/WebIDL/XRSessionEventInit.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class XRSessionEventInit: BridgedDictionary { public convenience init(session: XRSession) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.session] = session.jsValue() + object[Strings.session] = session.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRSessionInit.swift b/Sources/DOMKit/WebIDL/XRSessionInit.swift index 2ea5e3c5..6cc5e3e1 100644 --- a/Sources/DOMKit/WebIDL/XRSessionInit.swift +++ b/Sources/DOMKit/WebIDL/XRSessionInit.swift @@ -6,10 +6,10 @@ import JavaScriptKit public class XRSessionInit: BridgedDictionary { public convenience init(depthSensing: XRDepthStateInit, domOverlay: XRDOMOverlayInit?, requiredFeatures: [JSValue], optionalFeatures: [JSValue]) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.depthSensing] = depthSensing.jsValue() - object[Strings.domOverlay] = domOverlay.jsValue() - object[Strings.requiredFeatures] = requiredFeatures.jsValue() - object[Strings.optionalFeatures] = optionalFeatures.jsValue() + object[Strings.depthSensing] = depthSensing.jsValue + object[Strings.domOverlay] = domOverlay.jsValue + object[Strings.requiredFeatures] = requiredFeatures.jsValue + object[Strings.optionalFeatures] = optionalFeatures.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRSessionMode.swift b/Sources/DOMKit/WebIDL/XRSessionMode.swift index f0a4146c..daad4132 100644 --- a/Sources/DOMKit/WebIDL/XRSessionMode.swift +++ b/Sources/DOMKit/WebIDL/XRSessionMode.swift @@ -19,5 +19,5 @@ public enum XRSessionMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift index 9d046304..2170bb7c 100644 --- a/Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift +++ b/Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift @@ -6,7 +6,7 @@ import JavaScriptKit public class XRSessionSupportedPermissionDescriptor: BridgedDictionary { public convenience init(mode: XRSessionMode) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue() + object[Strings.mode] = mode.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRSystem.swift b/Sources/DOMKit/WebIDL/XRSystem.swift index c4057479..8f5f303e 100644 --- a/Sources/DOMKit/WebIDL/XRSystem.swift +++ b/Sources/DOMKit/WebIDL/XRSystem.swift @@ -13,26 +13,26 @@ public class XRSystem: EventTarget { @inlinable public func isSessionSupported(mode: XRSessionMode) -> JSPromise { let this = jsObject - return this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue()]).fromJSValue()! + return this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func isSessionSupported(mode: XRSessionMode) async throws -> Bool { let this = jsObject - let _promise: JSPromise = this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue()]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @inlinable public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) -> JSPromise { let this = jsObject - return this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @inlinable public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) async throws -> XRSession { let this = jsObject - let _promise: JSPromise = this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue(), options?.jsValue() ?? .undefined]).fromJSValue()! - return try await _promise.get().fromJSValue()! + let _promise: JSPromise = this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } @ClosureAttribute1Optional diff --git a/Sources/DOMKit/WebIDL/XRTargetRayMode.swift b/Sources/DOMKit/WebIDL/XRTargetRayMode.swift index bf0fbc17..0370ca15 100644 --- a/Sources/DOMKit/WebIDL/XRTargetRayMode.swift +++ b/Sources/DOMKit/WebIDL/XRTargetRayMode.swift @@ -19,5 +19,5 @@ public enum XRTargetRayMode: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRTextureType.swift b/Sources/DOMKit/WebIDL/XRTextureType.swift index 483bf43b..efd57a77 100644 --- a/Sources/DOMKit/WebIDL/XRTextureType.swift +++ b/Sources/DOMKit/WebIDL/XRTextureType.swift @@ -18,5 +18,5 @@ public enum XRTextureType: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift index 954388ba..b5cb6c84 100644 --- a/Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift +++ b/Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift @@ -6,9 +6,9 @@ import JavaScriptKit public class XRTransientInputHitTestOptionsInit: BridgedDictionary { public convenience init(profile: String, entityTypes: [XRHitTestTrackableType], offsetRay: XRRay) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.profile] = profile.jsValue() - object[Strings.entityTypes] = entityTypes.jsValue() - object[Strings.offsetRay] = offsetRay.jsValue() + object[Strings.profile] = profile.jsValue + object[Strings.entityTypes] = entityTypes.jsValue + object[Strings.offsetRay] = offsetRay.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRView.swift b/Sources/DOMKit/WebIDL/XRView.swift index ca90fba2..8892c782 100644 --- a/Sources/DOMKit/WebIDL/XRView.swift +++ b/Sources/DOMKit/WebIDL/XRView.swift @@ -34,6 +34,6 @@ public class XRView: JSBridgedClass { @inlinable public func requestViewportScale(scale: Double?) { let this = jsObject - _ = this[Strings.requestViewportScale].function!(this: this, arguments: [scale.jsValue()]) + _ = this[Strings.requestViewportScale].function!(this: this, arguments: [scale.jsValue]) } } diff --git a/Sources/DOMKit/WebIDL/XRVisibilityState.swift b/Sources/DOMKit/WebIDL/XRVisibilityState.swift index b2940a87..a8585df9 100644 --- a/Sources/DOMKit/WebIDL/XRVisibilityState.swift +++ b/Sources/DOMKit/WebIDL/XRVisibilityState.swift @@ -19,5 +19,5 @@ public enum XRVisibilityState: JSString, JSValueCompatible { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } diff --git a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift index 2f9f1a9a..9cbf741a 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift @@ -16,16 +16,16 @@ public class XRWebGLBinding: JSBridgedClass { @inlinable public func getDepthInformation(view: XRView) -> XRWebGLDepthInformation? { let this = jsObject - return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! + return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue]).fromJSValue()! } @inlinable public func getReflectionCubeMap(lightProbe: XRLightProbe) -> WebGLTexture? { let this = jsObject - return this[Strings.getReflectionCubeMap].function!(this: this, arguments: [lightProbe.jsValue()]).fromJSValue()! + return this[Strings.getReflectionCubeMap].function!(this: this, arguments: [lightProbe.jsValue]).fromJSValue()! } @inlinable public convenience init(session: XRSession, context: XRWebGLRenderingContext) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue(), context.jsValue()])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue, context.jsValue])) } @ReadonlyAttribute @@ -36,36 +36,36 @@ public class XRWebGLBinding: JSBridgedClass { @inlinable public func createProjectionLayer(init: XRProjectionLayerInit? = nil) -> XRProjectionLayer { let this = jsObject - return this[Strings.createProjectionLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createProjectionLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createQuadLayer(init: XRQuadLayerInit? = nil) -> XRQuadLayer { let this = jsObject - return this[Strings.createQuadLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createQuadLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createCylinderLayer(init: XRCylinderLayerInit? = nil) -> XRCylinderLayer { let this = jsObject - return this[Strings.createCylinderLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createCylinderLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createEquirectLayer(init: XREquirectLayerInit? = nil) -> XREquirectLayer { let this = jsObject - return this[Strings.createEquirectLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createEquirectLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func createCubeLayer(init: XRCubeLayerInit? = nil) -> XRCubeLayer { let this = jsObject - return this[Strings.createCubeLayer].function!(this: this, arguments: [`init`?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.createCubeLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func getSubImage(layer: XRCompositionLayer, frame: XRFrame, eye: XREye? = nil) -> XRWebGLSubImage { let this = jsObject - return this[Strings.getSubImage].function!(this: this, arguments: [layer.jsValue(), frame.jsValue(), eye?.jsValue() ?? .undefined]).fromJSValue()! + return this[Strings.getSubImage].function!(this: this, arguments: [layer.jsValue, frame.jsValue, eye?.jsValue ?? .undefined]).fromJSValue()! } @inlinable public func getViewSubImage(layer: XRProjectionLayer, view: XRView) -> XRWebGLSubImage { let this = jsObject - return this[Strings.getViewSubImage].function!(this: this, arguments: [layer.jsValue(), view.jsValue()]).fromJSValue()! + return this[Strings.getViewSubImage].function!(this: this, arguments: [layer.jsValue, view.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift index 1547c0fc..4da60803 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift @@ -17,7 +17,7 @@ public class XRWebGLLayer: XRLayer { } @inlinable public convenience init(session: XRSession, context: XRWebGLRenderingContext, layerInit: XRWebGLLayerInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue(), context.jsValue(), layerInit?.jsValue() ?? .undefined])) + self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue, context.jsValue, layerInit?.jsValue ?? .undefined])) } @ReadonlyAttribute @@ -40,11 +40,11 @@ public class XRWebGLLayer: XRLayer { @inlinable public func getViewport(view: XRView) -> XRViewport? { let this = jsObject - return this[Strings.getViewport].function!(this: this, arguments: [view.jsValue()]).fromJSValue()! + return this[Strings.getViewport].function!(this: this, arguments: [view.jsValue]).fromJSValue()! } @inlinable public static func getNativeFramebufferScaleFactor(session: XRSession) -> Double { let this = constructor - return this[Strings.getNativeFramebufferScaleFactor].function!(this: this, arguments: [session.jsValue()]).fromJSValue()! + return this[Strings.getNativeFramebufferScaleFactor].function!(this: this, arguments: [session.jsValue]).fromJSValue()! } } diff --git a/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift b/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift index 4b736f78..6137963e 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift @@ -6,12 +6,12 @@ import JavaScriptKit public class XRWebGLLayerInit: BridgedDictionary { public convenience init(antialias: Bool, depth: Bool, stencil: Bool, alpha: Bool, ignoreDepthValues: Bool, framebufferScaleFactor: Double) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.antialias] = antialias.jsValue() - object[Strings.depth] = depth.jsValue() - object[Strings.stencil] = stencil.jsValue() - object[Strings.alpha] = alpha.jsValue() - object[Strings.ignoreDepthValues] = ignoreDepthValues.jsValue() - object[Strings.framebufferScaleFactor] = framebufferScaleFactor.jsValue() + object[Strings.antialias] = antialias.jsValue + object[Strings.depth] = depth.jsValue + object[Strings.stencil] = stencil.jsValue + object[Strings.alpha] = alpha.jsValue + object[Strings.ignoreDepthValues] = ignoreDepthValues.jsValue + object[Strings.framebufferScaleFactor] = framebufferScaleFactor.jsValue self.init(unsafelyWrapping: object) } diff --git a/Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift index 1467ffcb..3af5527b 100644 --- a/Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift @@ -21,12 +21,12 @@ public enum XRWebGLRenderingContext: JSValueCompatible, Any_XRWebGLRenderingCont return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .webGL2RenderingContext(webGL2RenderingContext): - return webGL2RenderingContext.jsValue() + return webGL2RenderingContext.jsValue case let .webGLRenderingContext(webGLRenderingContext): - return webGLRenderingContext.jsValue() + return webGLRenderingContext.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/XSLTProcessor.swift b/Sources/DOMKit/WebIDL/XSLTProcessor.swift index c660710d..271b3589 100644 --- a/Sources/DOMKit/WebIDL/XSLTProcessor.swift +++ b/Sources/DOMKit/WebIDL/XSLTProcessor.swift @@ -18,32 +18,32 @@ public class XSLTProcessor: JSBridgedClass { @inlinable public func importStylesheet(style: Node) { let this = jsObject - _ = this[Strings.importStylesheet].function!(this: this, arguments: [style.jsValue()]) + _ = this[Strings.importStylesheet].function!(this: this, arguments: [style.jsValue]) } @inlinable public func transformToFragment(source: Node, output: Document) -> DocumentFragment { let this = jsObject - return this[Strings.transformToFragment].function!(this: this, arguments: [source.jsValue(), output.jsValue()]).fromJSValue()! + return this[Strings.transformToFragment].function!(this: this, arguments: [source.jsValue, output.jsValue]).fromJSValue()! } @inlinable public func transformToDocument(source: Node) -> Document { let this = jsObject - return this[Strings.transformToDocument].function!(this: this, arguments: [source.jsValue()]).fromJSValue()! + return this[Strings.transformToDocument].function!(this: this, arguments: [source.jsValue]).fromJSValue()! } @inlinable public func setParameter(namespaceURI: String, localName: String, value: JSValue) { let this = jsObject - _ = this[Strings.setParameter].function!(this: this, arguments: [namespaceURI.jsValue(), localName.jsValue(), value.jsValue()]) + _ = this[Strings.setParameter].function!(this: this, arguments: [namespaceURI.jsValue, localName.jsValue, value.jsValue]) } @inlinable public func getParameter(namespaceURI: String, localName: String) -> JSValue { let this = jsObject - return this[Strings.getParameter].function!(this: this, arguments: [namespaceURI.jsValue(), localName.jsValue()]).fromJSValue()! + return this[Strings.getParameter].function!(this: this, arguments: [namespaceURI.jsValue, localName.jsValue]).fromJSValue()! } @inlinable public func removeParameter(namespaceURI: String, localName: String) { let this = jsObject - _ = this[Strings.removeParameter].function!(this: this, arguments: [namespaceURI.jsValue(), localName.jsValue()]) + _ = this[Strings.removeParameter].function!(this: this, arguments: [namespaceURI.jsValue, localName.jsValue]) } @inlinable public func clearParameters() { diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift index edf97a6d..d61e67e0 100644 --- a/Sources/DOMKit/WebIDL/console.swift +++ b/Sources/DOMKit/WebIDL/console.swift @@ -10,7 +10,7 @@ public enum console { @inlinable public static func assert(condition: Bool? = nil, data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.assert].function!(this: this, arguments: [condition?.jsValue() ?? .undefined] + data.map { $0.jsValue() }) + _ = this[Strings.assert].function!(this: this, arguments: [condition?.jsValue ?? .undefined] + data.map(\.jsValue)) } @inlinable public static func clear() { @@ -20,67 +20,67 @@ public enum console { @inlinable public static func debug(data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.debug].function!(this: this, arguments: data.map { $0.jsValue() }) + _ = this[Strings.debug].function!(this: this, arguments: data.map(\.jsValue)) } @inlinable public static func error(data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.error].function!(this: this, arguments: data.map { $0.jsValue() }) + _ = this[Strings.error].function!(this: this, arguments: data.map(\.jsValue)) } @inlinable public static func info(data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.info].function!(this: this, arguments: data.map { $0.jsValue() }) + _ = this[Strings.info].function!(this: this, arguments: data.map(\.jsValue)) } @inlinable public static func log(data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.log].function!(this: this, arguments: data.map { $0.jsValue() }) + _ = this[Strings.log].function!(this: this, arguments: data.map(\.jsValue)) } @inlinable public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.table].function!(this: this, arguments: [tabularData?.jsValue() ?? .undefined, properties?.jsValue() ?? .undefined]) + _ = this[Strings.table].function!(this: this, arguments: [tabularData?.jsValue ?? .undefined, properties?.jsValue ?? .undefined]) } @inlinable public static func trace(data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.trace].function!(this: this, arguments: data.map { $0.jsValue() }) + _ = this[Strings.trace].function!(this: this, arguments: data.map(\.jsValue)) } @inlinable public static func warn(data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.warn].function!(this: this, arguments: data.map { $0.jsValue() }) + _ = this[Strings.warn].function!(this: this, arguments: data.map(\.jsValue)) } @inlinable public static func dir(item: JSValue? = nil, options: JSObject? = nil) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.dir].function!(this: this, arguments: [item?.jsValue() ?? .undefined, options?.jsValue() ?? .undefined]) + _ = this[Strings.dir].function!(this: this, arguments: [item?.jsValue ?? .undefined, options?.jsValue ?? .undefined]) } @inlinable public static func dirxml(data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.dirxml].function!(this: this, arguments: data.map { $0.jsValue() }) + _ = this[Strings.dirxml].function!(this: this, arguments: data.map(\.jsValue)) } @inlinable public static func count(label: String? = nil) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.count].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) + _ = this[Strings.count].function!(this: this, arguments: [label?.jsValue ?? .undefined]) } @inlinable public static func countReset(label: String? = nil) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.countReset].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) + _ = this[Strings.countReset].function!(this: this, arguments: [label?.jsValue ?? .undefined]) } @inlinable public static func group(data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.group].function!(this: this, arguments: data.map { $0.jsValue() }) + _ = this[Strings.group].function!(this: this, arguments: data.map(\.jsValue)) } @inlinable public static func groupCollapsed(data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.groupCollapsed].function!(this: this, arguments: data.map { $0.jsValue() }) + _ = this[Strings.groupCollapsed].function!(this: this, arguments: data.map(\.jsValue)) } @inlinable public static func groupEnd() { @@ -90,16 +90,16 @@ public enum console { @inlinable public static func time(label: String? = nil) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.time].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) + _ = this[Strings.time].function!(this: this, arguments: [label?.jsValue ?? .undefined]) } @inlinable public static func timeLog(label: String? = nil, data: JSValue...) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.timeLog].function!(this: this, arguments: [label?.jsValue() ?? .undefined] + data.map { $0.jsValue() }) + _ = this[Strings.timeLog].function!(this: this, arguments: [label?.jsValue ?? .undefined] + data.map(\.jsValue)) } @inlinable public static func timeEnd(label: String? = nil) { let this = JSObject.global[Strings.console].object! - _ = this[Strings.timeEnd].function!(this: this, arguments: [label?.jsValue() ?? .undefined]) + _ = this[Strings.timeEnd].function!(this: this, arguments: [label?.jsValue ?? .undefined]) } } diff --git a/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift b/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift index 8fc7c465..15b262ad 100644 --- a/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift +++ b/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift @@ -21,12 +21,12 @@ public enum nullable_Double_or_seq_of_nullable_Double: JSValueCompatible, Any_nu return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { case let .nullable_Double(nullable_Double): - return nullable_Double.jsValue() + return nullable_Double.jsValue case let .seq_of_nullable_Double(seq_of_nullable_Double): - return seq_of_nullable_Double.jsValue() + return seq_of_nullable_Double.jsValue } } } diff --git a/Sources/WebIDLToSwift/ClosurePattern.swift b/Sources/WebIDLToSwift/ClosurePattern.swift index 2ece2931..15b78d90 100644 --- a/Sources/WebIDLToSwift/ClosurePattern.swift +++ b/Sources/WebIDLToSwift/ClosurePattern.swift @@ -33,7 +33,7 @@ struct ClosurePattern: SwiftRepresentable, Equatable, Hashable, Comparable { } else { getFunction = "let function = jsObject[name].function!" } - let call: SwiftSource = "function(\(sequence: indexes.map { "$\($0).jsValue()" }))" + let call: SwiftSource = "function(\(sequence: indexes.map { "$\($0).jsValue" }))" let closureBody: SwiftSource if void { closureBody = call @@ -55,12 +55,12 @@ struct ClosurePattern: SwiftRepresentable, Equatable, Hashable, Comparable { return .undefined """ } else { - body = "\(call).jsValue()" + body = "\(call).jsValue" } let setClosure: SwiftSource = """ jsObject[name] = JSClosure { \(argCount == 0 ? "_ in" : "") \(body) - }.jsValue() + }.jsValue """ if nullable { diff --git a/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift b/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift index d3adb8c6..ddb833d9 100644 --- a/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift +++ b/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift @@ -29,7 +29,7 @@ extension UnionType: SwiftRepresentable { return nil } - public func jsValue() -> JSValue { + public var jsValue: JSValue { switch self { \(lines: exporters) } @@ -64,7 +64,7 @@ extension UnionType: SwiftRepresentable { sortedNames.map { name in """ case let .\(name)(\(name)): - return \(name).jsValue() + return \(name).jsValue """ } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 01edeff0..0393ddb2 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -89,7 +89,7 @@ extension MergedDictionary: SwiftRepresentable { """ } else { return """ - object[\(Context.source(for: member.name))] = \(member.name).jsValue() + object[\(Context.source(for: member.name))] = \(member.name).jsValue """ } }) @@ -132,7 +132,7 @@ extension IDLEnum: SwiftRepresentable { self.init(rawValue: JSString(string)) } - @inlinable public func jsValue() -> JSValue { rawValue.jsValue() } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } """ } @@ -275,12 +275,12 @@ extension IDLConstructor: SwiftRepresentable, Initializable { return "// XXX: constructor is ignored" } let args: [SwiftSource] = arguments.map { - "\($0.name)\($0.optional ? "?" : "").jsValue() \($0.optional ? " ?? .undefined" : "")" + "\($0.name)\($0.optional ? "?" : "").jsValue \($0.optional ? " ?? .undefined" : "")" } let argsArray: SwiftSource if let last = arguments.last, last.variadic { // TODO: handle optional variadics (if necessary?) - let variadic: SwiftSource = "\(last.name).map { $0.jsValue() }" + let variadic: SwiftSource = "\(last.name).map(\\.jsValue)" if args.count == 1 { argsArray = variadic } else { @@ -389,9 +389,9 @@ extension IDLOperation: SwiftRepresentable, Initializable { if arguments.count <= 5 { args = arguments.map { arg in if arg.optional { - return "\(arg.name)?.jsValue() ?? .undefined" + return "\(arg.name)?.jsValue ?? .undefined" } else { - return "\(arg.name).jsValue()" + return "\(arg.name).jsValue" } } prep = [] @@ -399,9 +399,9 @@ extension IDLOperation: SwiftRepresentable, Initializable { args = (0 ..< arguments.count).map { "_arg\(String($0))" } prep = arguments.enumerated().map { i, arg in if arg.optional { - return "let _arg\(String(i)) = \(arg.name)?.jsValue() ?? .undefined" + return "let _arg\(String(i)) = \(arg.name)?.jsValue ?? .undefined" } else { - return "let _arg\(String(i)) = \(arg.name).jsValue()" + return "let _arg\(String(i)) = \(arg.name).jsValue" } } } @@ -409,7 +409,7 @@ extension IDLOperation: SwiftRepresentable, Initializable { let argsArray: SwiftSource if let last = arguments.last, last.variadic { // TODO: handle optional variadics (if necessary?) - let variadic: SwiftSource = "\(last.name).map { $0.jsValue() }" + let variadic: SwiftSource = "\(last.name).map(\\.jsValue)" if args.count == 1 { argsArray = variadic } else { @@ -498,9 +498,9 @@ extension AsyncOperation: SwiftRepresentable, Initializable { let (prep, call) = operation.defaultBody let result: SwiftSource if returnType.swiftRepresentation.source == "Void" { - result = "_ = try await _promise.get()" + result = "_ = try await _promise.value" } else { - result = "return try await _promise.get().fromJSValue()!" + result = "return try await _promise.value.fromJSValue()!" } return """ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) From b9c4648f7caa51b36fa4aa858286de1d4ccba8a3 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 22 Apr 2022 20:29:28 -0400 Subject: [PATCH 115/124] polish naming of union cases that start with an acronym --- .../UnionType+SwiftRepresentable.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift b/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift index ddb833d9..10819c3f 100644 --- a/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift +++ b/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift @@ -1,6 +1,17 @@ import Foundation import WebIDL +extension String { + var lowerCamelCased: String { + let prefix = prefix(while: \.isUppercase) + if prefix.count <= 1 { + return prefix.lowercased() + dropFirst(prefix.count) + } else { + return prefix.dropLast().lowercased() + dropFirst(prefix.count - 1) + } + } +} + extension UnionType: SwiftRepresentable { var sortedTypes: [SlimIDLType] { types.sorted(by: { $0.inlineTypeName < $1.inlineTypeName }) @@ -11,9 +22,7 @@ extension UnionType: SwiftRepresentable { } var sortedNames: [String] { - sortedTypes.map { - $0.inlineTypeName.first!.lowercased() + String($0.inlineTypeName.dropFirst()) - } + sortedTypes.map(\.inlineTypeName.lowerCamelCased) } var swiftRepresentation: SwiftSource { From c435299befad69d00150a36ebdf6d61955652cde Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 22 Apr 2022 19:46:24 -0400 Subject: [PATCH 116/124] limit parsed specs remove remove --- Sources/DOMKit/ECMAScript/Support.swift | 4 +- .../WebIDL/ANGLE_instanced_arrays.swift | 31 - .../AbsoluteOrientationReadingValues.swift | 20 - .../WebIDL/AbsoluteOrientationSensor.swift | 16 - Sources/DOMKit/WebIDL/Accelerometer.swift | 28 - .../AccelerometerLocalCoordinateSystem.swift | 22 - .../WebIDL/AccelerometerReadingValues.swift | 30 - .../WebIDL/AccelerometerSensorOptions.swift | 20 - Sources/DOMKit/WebIDL/AesCbcParams.swift | 20 - Sources/DOMKit/WebIDL/AesCtrParams.swift | 25 - .../DOMKit/WebIDL/AesDerivedKeyParams.swift | 20 - Sources/DOMKit/WebIDL/AesGcmParams.swift | 30 - Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift | 20 - Sources/DOMKit/WebIDL/AesKeyGenParams.swift | 20 - Sources/DOMKit/WebIDL/Algorithm.swift | 20 - .../DOMKit/WebIDL/AlgorithmIdentifier.swift | 32 - Sources/DOMKit/WebIDL/AlignSetting.swift | 25 - .../WebIDL/AllowedBluetoothDevice.swift | 35 - Sources/DOMKit/WebIDL/AllowedUSBDevice.swift | 30 - .../WebIDL/AmbientLightReadingValues.swift | 20 - .../DOMKit/WebIDL/AmbientLightSensor.swift | 20 - Sources/DOMKit/WebIDL/AnalyserNode.swift | 56 - Sources/DOMKit/WebIDL/AnalyserOptions.swift | 35 - Sources/DOMKit/WebIDL/Animation.swift | 8 - Sources/DOMKit/WebIDL/AnimationEffect.swift | 32 - ...tionEffect_or_seq_of_AnimationEffect.swift | 32 - Sources/DOMKit/WebIDL/AnimationEvent.swift | 28 - .../DOMKit/WebIDL/AnimationEventInit.swift | 30 - Sources/DOMKit/WebIDL/AnimationNodeList.swift | 22 - .../WebIDL/AnimationPlaybackEvent.swift | 24 - .../WebIDL/AnimationPlaybackEventInit.swift | 25 - Sources/DOMKit/WebIDL/AnimationTimeline.swift | 9 - .../WebIDL/AppBannerPromptOutcome.swift | 22 - .../AttestationConveyancePreference.swift | 24 - .../DOMKit/WebIDL/AttributionReporting.swift | 26 - .../WebIDL/AttributionSourceParams.swift | 40 - Sources/DOMKit/WebIDL/AudioBuffer.swift | 49 - .../DOMKit/WebIDL/AudioBufferOptions.swift | 30 - .../DOMKit/WebIDL/AudioBufferSourceNode.swift | 42 - .../WebIDL/AudioBufferSourceOptions.swift | 45 - .../DOMKit/WebIDL/AudioConfiguration.swift | 40 - Sources/DOMKit/WebIDL/AudioContext.swift | 85 - .../WebIDL/AudioContextLatencyCategory.swift | 23 - ...udioContextLatencyCategory_or_Double.swift | 32 - .../DOMKit/WebIDL/AudioContextOptions.swift | 25 - Sources/DOMKit/WebIDL/AudioContextState.swift | 23 - .../DOMKit/WebIDL/AudioDestinationNode.swift | 16 - Sources/DOMKit/WebIDL/AudioListener.swift | 66 - Sources/DOMKit/WebIDL/AudioNode.swift | 81 - Sources/DOMKit/WebIDL/AudioNodeOptions.swift | 30 - .../DOMKit/WebIDL/AudioOutputOptions.swift | 20 - Sources/DOMKit/WebIDL/AudioParam.swift | 69 - .../DOMKit/WebIDL/AudioParamDescriptor.swift | 40 - Sources/DOMKit/WebIDL/AudioParamMap.swift | 16 - .../DOMKit/WebIDL/AudioProcessingEvent.swift | 28 - .../WebIDL/AudioProcessingEventInit.swift | 30 - .../WebIDL/AudioScheduledSourceNode.swift | 26 - Sources/DOMKit/WebIDL/AudioTimestamp.swift | 25 - Sources/DOMKit/WebIDL/AudioWorklet.swift | 12 - Sources/DOMKit/WebIDL/AudioWorkletNode.swift | 28 - .../WebIDL/AudioWorkletNodeOptions.swift | 40 - ...AuthenticationExtensionsClientInputs.swift | 45 - ...uthenticationExtensionsClientOutputs.swift | 40 - ...henticationExtensionsLargeBlobInputs.swift | 30 - ...enticationExtensionsLargeBlobOutputs.swift | 30 - ...uthenticationExtensionsPaymentInputs.swift | 45 - .../AuthenticatorAssertionResponse.swift | 24 - .../WebIDL/AuthenticatorAttachment.swift | 22 - .../AuthenticatorAttestationResponse.swift | 36 - .../DOMKit/WebIDL/AuthenticatorResponse.swift | 18 - .../AuthenticatorSelectionCriteria.swift | 35 - .../WebIDL/AuthenticatorTransport.swift | 24 - Sources/DOMKit/WebIDL/AutoKeyword.swift | 21 - Sources/DOMKit/WebIDL/AutomationRate.swift | 22 - Sources/DOMKit/WebIDL/AutoplayPolicy.swift | 23 - .../WebIDL/AutoplayPolicyMediaType.swift | 22 - .../WebIDL/BackgroundFetchEventInit.swift | 20 - .../WebIDL/BackgroundFetchFailureReason.swift | 26 - .../WebIDL/BackgroundFetchManager.swift | 50 - .../WebIDL/BackgroundFetchOptions.swift | 20 - .../DOMKit/WebIDL/BackgroundFetchRecord.swift | 22 - .../WebIDL/BackgroundFetchRegistration.swift | 84 - .../DOMKit/WebIDL/BackgroundFetchResult.swift | 23 - .../WebIDL/BackgroundFetchUIOptions.swift | 25 - .../DOMKit/WebIDL/BackgroundSyncOptions.swift | 20 - Sources/DOMKit/WebIDL/BarcodeDetector.swift | 42 - .../WebIDL/BarcodeDetectorOptions.swift | 20 - Sources/DOMKit/WebIDL/BarcodeFormat.swift | 34 - Sources/DOMKit/WebIDL/BaseAudioContext.swift | 134 - Sources/DOMKit/WebIDL/Baseline.swift | 22 - Sources/DOMKit/WebIDL/BatteryManager.swift | 44 - .../WebIDL/BeforeInstallPromptEvent.swift | 28 - .../DOMKit/WebIDL/BinaryData_or_String.swift | 32 - Sources/DOMKit/WebIDL/BinaryType.swift | 22 - Sources/DOMKit/WebIDL/BiquadFilterNode.swift | 41 - .../DOMKit/WebIDL/BiquadFilterOptions.swift | 40 - Sources/DOMKit/WebIDL/BiquadFilterType.swift | 28 - .../WebIDL/BlockFragmentationType.swift | 24 - Sources/DOMKit/WebIDL/Bluetooth.swift | 56 - .../WebIDL/BluetoothAdvertisingEvent.swift | 48 - .../BluetoothAdvertisingEventInit.swift | 55 - .../BluetoothCharacteristicProperties.swift | 50 - .../WebIDL/BluetoothDataFilterInit.swift | 25 - Sources/DOMKit/WebIDL/BluetoothDevice.swift | 40 - .../WebIDL/BluetoothDeviceEventHandlers.swift | 17 - .../WebIDL/BluetoothLEScanFilterInit.swift | 40 - .../BluetoothManufacturerDataFilterInit.swift | 20 - .../WebIDL/BluetoothManufacturerDataMap.swift | 16 - .../BluetoothPermissionDescriptor.swift | 40 - .../WebIDL/BluetoothPermissionResult.swift | 16 - .../WebIDL/BluetoothPermissionStorage.swift | 20 - .../BluetoothRemoteGATTCharacteristic.swift | 124 - .../BluetoothRemoteGATTDescriptor.swift | 50 - .../WebIDL/BluetoothRemoteGATTServer.swift | 63 - .../WebIDL/BluetoothRemoteGATTService.swift | 72 - .../BluetoothServiceDataFilterInit.swift | 20 - .../WebIDL/BluetoothServiceDataMap.swift | 16 - .../DOMKit/WebIDL/BluetoothServiceUUID.swift | 32 - Sources/DOMKit/WebIDL/BluetoothUUID.swift | 34 - Sources/DOMKit/WebIDL/BodyInit.swift | 10 +- .../WebIDL/Bool_or_ConstrainDouble.swift | 32 - .../Bool_or_ScrollIntoViewOptions.swift | 32 - Sources/DOMKit/WebIDL/BoxQuadOptions.swift | 25 - Sources/DOMKit/WebIDL/BreakType.swift | 25 - .../BrowserCaptureMediaStreamTrack.swift | 29 - .../{BinaryData.swift => BufferSource.swift} | 8 +- .../WebIDL/BufferSource_or_JsonWebKey.swift | 32 - .../WebIDL/CSPViolationReportBody.swift | 56 - Sources/DOMKit/WebIDL/CSS.swift | 383 -- Sources/DOMKit/WebIDL/CSSAnimation.swift | 16 - Sources/DOMKit/WebIDL/CSSBoxType.swift | 24 - Sources/DOMKit/WebIDL/CSSColor.swift | 26 - Sources/DOMKit/WebIDL/CSSColorRGBComp.swift | 32 - Sources/DOMKit/WebIDL/CSSColorValue.swift | 24 - Sources/DOMKit/WebIDL/CSSConditionRule.swift | 16 - Sources/DOMKit/WebIDL/CSSContainerRule.swift | 12 - .../DOMKit/WebIDL/CSSCounterStyleRule.swift | 56 - Sources/DOMKit/WebIDL/CSSFontFaceRule.swift | 16 - .../WebIDL/CSSFontFeatureValuesMap.swift | 21 - .../WebIDL/CSSFontFeatureValuesRule.swift | 40 - .../WebIDL/CSSFontPaletteValuesRule.swift | 28 - Sources/DOMKit/WebIDL/CSSHSL.swift | 32 - Sources/DOMKit/WebIDL/CSSHWB.swift | 32 - Sources/DOMKit/WebIDL/CSSImageValue.swift | 12 - Sources/DOMKit/WebIDL/CSSImportRule.swift | 4 - Sources/DOMKit/WebIDL/CSSKeyframeRule.swift | 20 - Sources/DOMKit/WebIDL/CSSKeyframesRule.swift | 35 - Sources/DOMKit/WebIDL/CSSKeywordValue.swift | 20 - Sources/DOMKit/WebIDL/CSSKeywordish.swift | 32 - Sources/DOMKit/WebIDL/CSSLCH.swift | 32 - Sources/DOMKit/WebIDL/CSSLab.swift | 32 - Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift | 16 - .../DOMKit/WebIDL/CSSLayerStatementRule.swift | 16 - Sources/DOMKit/WebIDL/CSSMathClamp.swift | 28 - Sources/DOMKit/WebIDL/CSSMathInvert.swift | 20 - Sources/DOMKit/WebIDL/CSSMathMax.swift | 20 - Sources/DOMKit/WebIDL/CSSMathMin.swift | 20 - Sources/DOMKit/WebIDL/CSSMathNegate.swift | 20 - Sources/DOMKit/WebIDL/CSSMathOperator.swift | 27 - Sources/DOMKit/WebIDL/CSSMathProduct.swift | 20 - Sources/DOMKit/WebIDL/CSSMathSum.swift | 20 - Sources/DOMKit/WebIDL/CSSMathValue.swift | 16 - .../DOMKit/WebIDL/CSSMatrixComponent.swift | 20 - .../WebIDL/CSSMatrixComponentOptions.swift | 20 - Sources/DOMKit/WebIDL/CSSMediaRule.swift | 16 - Sources/DOMKit/WebIDL/CSSNestingRule.swift | 34 - Sources/DOMKit/WebIDL/CSSNumberish.swift | 32 - Sources/DOMKit/WebIDL/CSSNumericArray.swift | 27 - .../DOMKit/WebIDL/CSSNumericBaseType.swift | 27 - Sources/DOMKit/WebIDL/CSSNumericType.swift | 55 - Sources/DOMKit/WebIDL/CSSNumericValue.swift | 65 - .../CSSNumericValue_or_Double_or_String.swift | 39 - Sources/DOMKit/WebIDL/CSSOKLCH.swift | 32 - Sources/DOMKit/WebIDL/CSSOKLab.swift | 32 - Sources/DOMKit/WebIDL/CSSParserAtRule.swift | 32 - Sources/DOMKit/WebIDL/CSSParserBlock.swift | 28 - .../DOMKit/WebIDL/CSSParserDeclaration.swift | 28 - Sources/DOMKit/WebIDL/CSSParserFunction.swift | 28 - Sources/DOMKit/WebIDL/CSSParserOptions.swift | 20 - .../WebIDL/CSSParserQualifiedRule.swift | 28 - Sources/DOMKit/WebIDL/CSSParserRule.swift | 14 - Sources/DOMKit/WebIDL/CSSParserValue.swift | 14 - Sources/DOMKit/WebIDL/CSSPerspective.swift | 20 - .../DOMKit/WebIDL/CSSPerspectiveValue.swift | 32 - Sources/DOMKit/WebIDL/CSSPropertyRule.swift | 28 - Sources/DOMKit/WebIDL/CSSPseudoElement.swift | 2 +- .../WebIDL/CSSPseudoElement_or_Element.swift | 10 +- Sources/DOMKit/WebIDL/CSSRGB.swift | 32 - Sources/DOMKit/WebIDL/CSSRotate.swift | 36 - Sources/DOMKit/WebIDL/CSSRule.swift | 12 - Sources/DOMKit/WebIDL/CSSScale.swift | 28 - .../DOMKit/WebIDL/CSSScrollTimelineRule.swift | 28 - Sources/DOMKit/WebIDL/CSSSkew.swift | 24 - Sources/DOMKit/WebIDL/CSSSkewX.swift | 20 - Sources/DOMKit/WebIDL/CSSSkewY.swift | 20 - Sources/DOMKit/WebIDL/CSSStringSource.swift | 32 - Sources/DOMKit/WebIDL/CSSStyleRule.swift | 18 - Sources/DOMKit/WebIDL/CSSStyleValue.swift | 28 - .../WebIDL/CSSStyleValue_or_String.swift | 32 - Sources/DOMKit/WebIDL/CSSSupportsRule.swift | 12 - Sources/DOMKit/WebIDL/CSSToken.swift | 39 - .../DOMKit/WebIDL/CSSTransformComponent.swift | 27 - Sources/DOMKit/WebIDL/CSSTransformValue.swift | 40 - Sources/DOMKit/WebIDL/CSSTransition.swift | 16 - Sources/DOMKit/WebIDL/CSSTranslate.swift | 28 - Sources/DOMKit/WebIDL/CSSUnitValue.swift | 24 - .../DOMKit/WebIDL/CSSUnparsedSegment.swift | 32 - Sources/DOMKit/WebIDL/CSSUnparsedValue.swift | 31 - .../WebIDL/CSSVariableReferenceValue.swift | 26 - Sources/DOMKit/WebIDL/CSSViewportRule.swift | 16 - .../WebIDL/CanMakePaymentEventInit.swift | 30 - .../CanvasCaptureMediaStreamTrack.swift | 21 - Sources/DOMKit/WebIDL/CanvasImageSource.swift | 30 +- Sources/DOMKit/WebIDL/CaretPosition.swift | 27 - Sources/DOMKit/WebIDL/ChannelCountMode.swift | 23 - .../DOMKit/WebIDL/ChannelInterpretation.swift | 22 - Sources/DOMKit/WebIDL/ChannelMergerNode.swift | 16 - .../DOMKit/WebIDL/ChannelMergerOptions.swift | 20 - .../DOMKit/WebIDL/ChannelSplitterNode.swift | 16 - .../WebIDL/ChannelSplitterOptions.swift | 20 - .../WebIDL/CharacterBoundsUpdateEvent.swift | 24 - .../CharacterBoundsUpdateEventInit.swift | 25 - .../WebIDL/CharacteristicEventHandlers.swift | 12 - Sources/DOMKit/WebIDL/ChildDisplayType.swift | 22 - .../DOMKit/WebIDL/ClientLifecycleState.swift | 22 - Sources/DOMKit/WebIDL/Clipboard.swift | 60 - Sources/DOMKit/WebIDL/ClipboardEvent.swift | 20 - .../DOMKit/WebIDL/ClipboardEventInit.swift | 20 - Sources/DOMKit/WebIDL/ClipboardItem.swift | 38 - .../DOMKit/WebIDL/ClipboardItemOptions.swift | 20 - .../ClipboardPermissionDescriptor.swift | 20 - Sources/DOMKit/WebIDL/CloseEvent.swift | 28 - Sources/DOMKit/WebIDL/CloseEventInit.swift | 30 - Sources/DOMKit/WebIDL/CloseWatcher.swift | 34 - .../DOMKit/WebIDL/CloseWatcherOptions.swift | 20 - Sources/DOMKit/WebIDL/ClosureAttribute.swift | 130 - ...CollectedClientAdditionalPaymentData.swift | 40 - .../DOMKit/WebIDL/CollectedClientData.swift | 35 - .../WebIDL/CollectedClientPaymentData.swift | 20 - Sources/DOMKit/WebIDL/ColorGamut.swift | 23 - .../DOMKit/WebIDL/ColorSelectionOptions.swift | 20 - .../DOMKit/WebIDL/ColorSelectionResult.swift | 20 - Sources/DOMKit/WebIDL/CompressionStream.swift | 18 - .../DOMKit/WebIDL/ComputePressureFactor.swift | 22 - .../WebIDL/ComputePressureObserver.swift | 52 - .../ComputePressureObserverOptions.swift | 20 - .../DOMKit/WebIDL/ComputePressureRecord.swift | 35 - .../DOMKit/WebIDL/ComputePressureSource.swift | 21 - .../DOMKit/WebIDL/ComputePressureState.swift | 24 - .../DOMKit/WebIDL/ComputedEffectTiming.swift | 22 +- Sources/DOMKit/WebIDL/ConnectionType.swift | 29 - .../DOMKit/WebIDL/ConstantSourceNode.swift | 20 - .../DOMKit/WebIDL/ConstantSourceOptions.swift | 20 - Sources/DOMKit/WebIDL/ConstrainPoint2D.swift | 32 - .../WebIDL/ConstrainPoint2DParameters.swift | 25 - Sources/DOMKit/WebIDL/ContactAddress.swift | 59 - Sources/DOMKit/WebIDL/ContactInfo.swift | 40 - Sources/DOMKit/WebIDL/ContactProperty.swift | 25 - Sources/DOMKit/WebIDL/ContactsManager.swift | 38 - .../DOMKit/WebIDL/ContactsSelectOptions.swift | 20 - Sources/DOMKit/WebIDL/ContentCategory.swift | 25 - .../DOMKit/WebIDL/ContentDescription.swift | 45 - Sources/DOMKit/WebIDL/ContentIndex.swift | 50 - .../DOMKit/WebIDL/ContentIndexEventInit.swift | 20 - .../WebIDL/ConvertCoordinateOptions.swift | 25 - Sources/DOMKit/WebIDL/ConvolverNode.swift | 24 - Sources/DOMKit/WebIDL/ConvolverOptions.swift | 25 - Sources/DOMKit/WebIDL/CookieChangeEvent.swift | 24 - .../DOMKit/WebIDL/CookieChangeEventInit.swift | 25 - Sources/DOMKit/WebIDL/CookieInit.swift | 45 - Sources/DOMKit/WebIDL/CookieListItem.swift | 50 - Sources/DOMKit/WebIDL/CookieSameSite.swift | 23 - Sources/DOMKit/WebIDL/CookieStore.swift | 112 - .../WebIDL/CookieStoreDeleteOptions.swift | 30 - .../DOMKit/WebIDL/CookieStoreGetOptions.swift | 25 - .../DOMKit/WebIDL/CookieStoreManager.swift | 50 - Sources/DOMKit/WebIDL/CrashReportBody.swift | 21 - Sources/DOMKit/WebIDL/Credential.swift | 27 - .../WebIDL/CredentialCreationOptions.swift | 35 - Sources/DOMKit/WebIDL/CredentialData.swift | 20 - .../CredentialMediationRequirement.swift | 24 - .../WebIDL/CredentialPropertiesOutput.swift | 20 - .../WebIDL/CredentialRequestOptions.swift | 45 - .../DOMKit/WebIDL/CredentialUserData.swift | 11 - .../DOMKit/WebIDL/CredentialsContainer.swift | 62 - Sources/DOMKit/WebIDL/CropTarget.swift | 14 - Sources/DOMKit/WebIDL/Crypto.swift | 28 - Sources/DOMKit/WebIDL/CryptoKey.swift | 30 - Sources/DOMKit/WebIDL/CryptoKeyID.swift | 32 - Sources/DOMKit/WebIDL/CryptoKeyPair.swift | 25 - .../WebIDL/CursorCaptureConstraint.swift | 23 - Sources/DOMKit/WebIDL/CustomStateSet.swift | 21 - .../DOMHighResTimeStamp_or_String.swift | 32 - .../WebIDL/DOMPointInit_or_Double.swift | 10 +- ...ble_or_seq_of_DOMPointInit_or_Double.swift | 10 +- Sources/DOMKit/WebIDL/DataCue.swift | 24 - Sources/DOMKit/WebIDL/DataTransferItem.swift | 17 - .../DOMKit/WebIDL/DecompressionStream.swift | 18 - Sources/DOMKit/WebIDL/DelayNode.swift | 20 - Sources/DOMKit/WebIDL/DelayOptions.swift | 25 - .../DOMKit/WebIDL/DeprecationReportBody.swift | 41 - Sources/DOMKit/WebIDL/DetectedBarcode.swift | 35 - Sources/DOMKit/WebIDL/DetectedFace.swift | 25 - Sources/DOMKit/WebIDL/DetectedText.swift | 30 - Sources/DOMKit/WebIDL/DeviceMotionEvent.swift | 44 - .../DeviceMotionEventAcceleration.swift | 26 - .../DeviceMotionEventAccelerationInit.swift | 30 - .../DOMKit/WebIDL/DeviceMotionEventInit.swift | 35 - .../DeviceMotionEventRotationRate.swift | 26 - .../DeviceMotionEventRotationRateInit.swift | 30 - .../WebIDL/DeviceOrientationEvent.swift | 44 - .../WebIDL/DeviceOrientationEventInit.swift | 35 - Sources/DOMKit/WebIDL/DevicePosture.swift | 20 - Sources/DOMKit/WebIDL/DevicePostureType.swift | 23 - .../DOMKit/WebIDL/DigitalGoodsService.swift | 62 - Sources/DOMKit/WebIDL/DirectionSetting.swift | 23 - .../WebIDL/DirectoryPickerOptions.swift | 25 - .../WebIDL/DisplayCaptureSurfaceType.swift | 24 - .../DisplayMediaStreamConstraints.swift | 25 - Sources/DOMKit/WebIDL/DistanceModelType.swift | 23 - Sources/DOMKit/WebIDL/Document.swift | 145 +- .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 6 - .../WebIDL/Document_or_DocumentFragment.swift | 32 - .../DOMKit/WebIDL/Document_or_Element.swift | 32 - .../Document_or_XMLHttpRequestBodyInit.swift | 10 +- .../WebIDL/Double_or_EffectTiming.swift | 32 - .../WebIDL/Double_or_seq_of_Double.swift | 32 - .../WebIDL/DynamicsCompressorNode.swift | 40 - .../WebIDL/DynamicsCompressorOptions.swift | 40 - Sources/DOMKit/WebIDL/EXT_blend_minmax.swift | 18 - .../WebIDL/EXT_clip_cull_distance.swift | 36 - .../WebIDL/EXT_color_buffer_float.swift | 14 - .../WebIDL/EXT_color_buffer_half_float.swift | 22 - .../WebIDL/EXT_disjoint_timer_query.swift | 68 - .../EXT_disjoint_timer_query_webgl2.swift | 27 - Sources/DOMKit/WebIDL/EXT_float_blend.swift | 14 - Sources/DOMKit/WebIDL/EXT_frag_depth.swift | 14 - Sources/DOMKit/WebIDL/EXT_sRGB.swift | 22 - .../WebIDL/EXT_shader_texture_lod.swift | 14 - .../WebIDL/EXT_texture_compression_bptc.swift | 22 - .../WebIDL/EXT_texture_compression_rgtc.swift | 22 - .../EXT_texture_filter_anisotropic.swift | 18 - .../DOMKit/WebIDL/EXT_texture_norm16.swift | 30 - Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift | 20 - Sources/DOMKit/WebIDL/EcKeyGenParams.swift | 20 - Sources/DOMKit/WebIDL/EcKeyImportParams.swift | 20 - .../DOMKit/WebIDL/EcdhKeyDeriveParams.swift | 20 - Sources/DOMKit/WebIDL/EcdsaParams.swift | 20 - Sources/DOMKit/WebIDL/Edge.swift | 22 - Sources/DOMKit/WebIDL/EditContext.swift | 107 - Sources/DOMKit/WebIDL/EditContextInit.swift | 30 - Sources/DOMKit/WebIDL/EffectTiming.swift | 12 +- .../WebIDL/EffectiveConnectionType.swift | 24 - Sources/DOMKit/WebIDL/Element.swift | 170 +- .../DOMKit/WebIDL/ElementBasedOffset.swift | 30 - .../DOMKit/WebIDL/ElementCSSInlineStyle.swift | 2 - .../WebIDL/ElementContentEditable.swift | 5 - Sources/DOMKit/WebIDL/ElementInternals.swift | 4 - .../WebIDL/Element_or_HTMLCollection.swift | 10 +- Sources/DOMKit/WebIDL/EventCounts.swift | 16 - .../ExtendableCookieChangeEventInit.swift | 25 - Sources/DOMKit/WebIDL/EyeDropper.swift | 30 - Sources/DOMKit/WebIDL/FaceDetector.swift | 30 - .../DOMKit/WebIDL/FaceDetectorOptions.swift | 25 - .../DOMKit/WebIDL/FederatedCredential.swift | 24 - .../WebIDL/FederatedCredentialInit.swift | 40 - .../FederatedCredentialRequestOptions.swift | 25 - Sources/DOMKit/WebIDL/FetchPriority.swift | 23 - Sources/DOMKit/WebIDL/File.swift | 4 - .../DOMKit/WebIDL/FilePickerAcceptType.swift | 25 - Sources/DOMKit/WebIDL/FilePickerOptions.swift | 35 - Sources/DOMKit/WebIDL/FileSystem.swift | 22 - .../FileSystemCreateWritableOptions.swift | 20 - .../WebIDL/FileSystemDirectoryEntry.swift | 21 - .../WebIDL/FileSystemDirectoryHandle.swift | 66 - .../WebIDL/FileSystemDirectoryReader.swift | 16 - Sources/DOMKit/WebIDL/FileSystemEntry.swift | 36 - .../DOMKit/WebIDL/FileSystemFileEntry.swift | 14 - .../DOMKit/WebIDL/FileSystemFileHandle.swift | 36 - Sources/DOMKit/WebIDL/FileSystemFlags.swift | 25 - .../FileSystemGetDirectoryOptions.swift | 20 - .../WebIDL/FileSystemGetFileOptions.swift | 20 - Sources/DOMKit/WebIDL/FileSystemHandle.swift | 58 - .../DOMKit/WebIDL/FileSystemHandleKind.swift | 22 - ...FileSystemHandlePermissionDescriptor.swift | 20 - .../FileSystemPermissionDescriptor.swift | 25 - .../WebIDL/FileSystemPermissionMode.swift | 22 - .../WebIDL/FileSystemRemoveOptions.swift | 20 - .../WebIDL/FileSystemWritableFileStream.swift | 48 - .../WebIDL/FileSystemWriteChunkType.swift | 46 - Sources/DOMKit/WebIDL/FillLightMode.swift | 23 - Sources/DOMKit/WebIDL/Float32List.swift | 32 - Sources/DOMKit/WebIDL/FlowControlType.swift | 22 - .../WebIDL/FocusableAreaSearchMode.swift | 22 - .../DOMKit/WebIDL/FocusableAreasOption.swift | 20 - Sources/DOMKit/WebIDL/Font.swift | 22 - Sources/DOMKit/WebIDL/FontFace.swift | 98 - .../DOMKit/WebIDL/FontFaceDescriptors.swift | 70 - Sources/DOMKit/WebIDL/FontFaceFeatures.swift | 14 - .../DOMKit/WebIDL/FontFaceLoadStatus.swift | 24 - Sources/DOMKit/WebIDL/FontFacePalette.swift | 35 - Sources/DOMKit/WebIDL/FontFacePalettes.swift | 27 - Sources/DOMKit/WebIDL/FontFaceSet.swift | 70 - .../DOMKit/WebIDL/FontFaceSetLoadEvent.swift | 20 - .../WebIDL/FontFaceSetLoadEventInit.swift | 20 - .../DOMKit/WebIDL/FontFaceSetLoadStatus.swift | 22 - Sources/DOMKit/WebIDL/FontFaceSource.swift | 9 - .../DOMKit/WebIDL/FontFaceVariationAxis.swift | 34 - .../DOMKit/WebIDL/FontFaceVariations.swift | 16 - Sources/DOMKit/WebIDL/FontManager.swift | 26 - Sources/DOMKit/WebIDL/FontMetadata.swift | 42 - Sources/DOMKit/WebIDL/FontMetrics.swift | 70 - Sources/DOMKit/WebIDL/FragmentDirective.swift | 14 - .../WebIDL/FullscreenNavigationUI.swift | 23 - Sources/DOMKit/WebIDL/FullscreenOptions.swift | 20 - Sources/DOMKit/WebIDL/GPU.swift | 26 - Sources/DOMKit/WebIDL/GPUAdapter.swift | 42 - Sources/DOMKit/WebIDL/GPUAddressMode.swift | 23 - Sources/DOMKit/WebIDL/GPUBindGroup.swift | 14 - .../WebIDL/GPUBindGroupDescriptor.swift | 25 - Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift | 25 - .../DOMKit/WebIDL/GPUBindGroupLayout.swift | 14 - .../WebIDL/GPUBindGroupLayoutDescriptor.swift | 20 - .../WebIDL/GPUBindGroupLayoutEntry.swift | 50 - .../DOMKit/WebIDL/GPUBindingResource.swift | 46 - Sources/DOMKit/WebIDL/GPUBlendComponent.swift | 30 - Sources/DOMKit/WebIDL/GPUBlendFactor.swift | 33 - Sources/DOMKit/WebIDL/GPUBlendOperation.swift | 25 - Sources/DOMKit/WebIDL/GPUBlendState.swift | 25 - Sources/DOMKit/WebIDL/GPUBuffer.swift | 41 - Sources/DOMKit/WebIDL/GPUBufferBinding.swift | 30 - .../WebIDL/GPUBufferBindingLayout.swift | 30 - .../DOMKit/WebIDL/GPUBufferBindingType.swift | 23 - .../DOMKit/WebIDL/GPUBufferDescriptor.swift | 30 - Sources/DOMKit/WebIDL/GPUBufferUsage.swift | 30 - .../WebIDL/GPUBuffer_or_WebGLBuffer.swift | 32 - .../GPUCanvasCompositingAlphaMode.swift | 22 - .../WebIDL/GPUCanvasConfiguration.swift | 50 - Sources/DOMKit/WebIDL/GPUCanvasContext.swift | 38 - Sources/DOMKit/WebIDL/GPUColor.swift | 32 - Sources/DOMKit/WebIDL/GPUColorDict.swift | 35 - .../DOMKit/WebIDL/GPUColorTargetState.swift | 30 - Sources/DOMKit/WebIDL/GPUColorWrite.swift | 20 - Sources/DOMKit/WebIDL/GPUCommandBuffer.swift | 14 - .../WebIDL/GPUCommandBufferDescriptor.swift | 16 - Sources/DOMKit/WebIDL/GPUCommandEncoder.swift | 64 - .../WebIDL/GPUCommandEncoderDescriptor.swift | 16 - Sources/DOMKit/WebIDL/GPUCommandsMixin.swift | 7 - .../DOMKit/WebIDL/GPUCompareFunction.swift | 28 - .../DOMKit/WebIDL/GPUCompilationInfo.swift | 18 - .../DOMKit/WebIDL/GPUCompilationMessage.swift | 38 - .../WebIDL/GPUCompilationMessageType.swift | 23 - .../WebIDL/GPUComputePassDescriptor.swift | 20 - .../DOMKit/WebIDL/GPUComputePassEncoder.swift | 34 - .../GPUComputePassTimestampLocation.swift | 22 - .../WebIDL/GPUComputePassTimestampWrite.swift | 30 - .../DOMKit/WebIDL/GPUComputePipeline.swift | 14 - .../WebIDL/GPUComputePipelineDescriptor.swift | 20 - Sources/DOMKit/WebIDL/GPUCullMode.swift | 23 - .../DOMKit/WebIDL/GPUDebugCommandsMixin.swift | 22 - .../DOMKit/WebIDL/GPUDepthStencilState.swift | 65 - Sources/DOMKit/WebIDL/GPUDevice.swift | 143 - .../DOMKit/WebIDL/GPUDeviceDescriptor.swift | 30 - Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift | 22 - .../DOMKit/WebIDL/GPUDeviceLostReason.swift | 21 - Sources/DOMKit/WebIDL/GPUError.swift | 32 - Sources/DOMKit/WebIDL/GPUErrorFilter.swift | 22 - Sources/DOMKit/WebIDL/GPUExtent3D.swift | 32 - Sources/DOMKit/WebIDL/GPUExtent3DDict.swift | 30 - .../DOMKit/WebIDL/GPUExternalTexture.swift | 18 - .../GPUExternalTextureBindingLayout.swift | 16 - .../WebIDL/GPUExternalTextureDescriptor.swift | 25 - Sources/DOMKit/WebIDL/GPUFeatureName.swift | 28 - Sources/DOMKit/WebIDL/GPUFilterMode.swift | 22 - Sources/DOMKit/WebIDL/GPUFragmentState.swift | 20 - Sources/DOMKit/WebIDL/GPUFrontFace.swift | 22 - .../DOMKit/WebIDL/GPUImageCopyBuffer.swift | 20 - .../WebIDL/GPUImageCopyExternalImage.swift | 30 - .../DOMKit/WebIDL/GPUImageCopyTexture.swift | 35 - .../WebIDL/GPUImageCopyTextureTagged.swift | 25 - .../DOMKit/WebIDL/GPUImageDataLayout.swift | 30 - Sources/DOMKit/WebIDL/GPUIndexFormat.swift | 22 - Sources/DOMKit/WebIDL/GPULoadOp.swift | 22 - Sources/DOMKit/WebIDL/GPUMapMode.swift | 14 - .../DOMKit/WebIDL/GPUMipmapFilterMode.swift | 22 - .../DOMKit/WebIDL/GPUMultisampleState.swift | 30 - Sources/DOMKit/WebIDL/GPUObjectBase.swift | 12 - .../WebIDL/GPUObjectDescriptorBase.swift | 20 - Sources/DOMKit/WebIDL/GPUOrigin2D.swift | 32 - Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift | 25 - Sources/DOMKit/WebIDL/GPUOrigin3D.swift | 32 - Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift | 30 - .../DOMKit/WebIDL/GPUOutOfMemoryError.swift | 18 - Sources/DOMKit/WebIDL/GPUPipelineBase.swift | 12 - .../WebIDL/GPUPipelineDescriptorBase.swift | 20 - Sources/DOMKit/WebIDL/GPUPipelineLayout.swift | 14 - .../WebIDL/GPUPipelineLayoutDescriptor.swift | 20 - .../DOMKit/WebIDL/GPUPowerPreference.swift | 22 - .../WebIDL/GPUPredefinedColorSpace.swift | 21 - Sources/DOMKit/WebIDL/GPUPrimitiveState.swift | 40 - .../DOMKit/WebIDL/GPUPrimitiveTopology.swift | 25 - .../WebIDL/GPUProgrammablePassEncoder.swift | 17 - .../DOMKit/WebIDL/GPUProgrammableStage.swift | 30 - Sources/DOMKit/WebIDL/GPUQuerySet.swift | 19 - .../DOMKit/WebIDL/GPUQuerySetDescriptor.swift | 25 - Sources/DOMKit/WebIDL/GPUQueryType.swift | 22 - Sources/DOMKit/WebIDL/GPUQueue.swift | 46 - .../DOMKit/WebIDL/GPUQueueDescriptor.swift | 16 - Sources/DOMKit/WebIDL/GPURenderBundle.swift | 14 - .../WebIDL/GPURenderBundleDescriptor.swift | 16 - .../WebIDL/GPURenderBundleEncoder.swift | 19 - .../GPURenderBundleEncoderDescriptor.swift | 25 - .../DOMKit/WebIDL/GPURenderEncoderBase.swift | 42 - .../WebIDL/GPURenderPassColorAttachment.swift | 40 - .../GPURenderPassDepthStencilAttachment.swift | 60 - .../WebIDL/GPURenderPassDescriptor.swift | 35 - .../DOMKit/WebIDL/GPURenderPassEncoder.swift | 60 - .../DOMKit/WebIDL/GPURenderPassLayout.swift | 30 - .../GPURenderPassTimestampLocation.swift | 22 - .../WebIDL/GPURenderPassTimestampWrite.swift | 30 - Sources/DOMKit/WebIDL/GPURenderPipeline.swift | 14 - .../WebIDL/GPURenderPipelineDescriptor.swift | 40 - .../WebIDL/GPURequestAdapterOptions.swift | 25 - Sources/DOMKit/WebIDL/GPUSampler.swift | 14 - .../WebIDL/GPUSamplerBindingLayout.swift | 20 - .../DOMKit/WebIDL/GPUSamplerBindingType.swift | 23 - .../DOMKit/WebIDL/GPUSamplerDescriptor.swift | 65 - Sources/DOMKit/WebIDL/GPUShaderModule.swift | 26 - .../GPUShaderModuleCompilationHint.swift | 20 - .../WebIDL/GPUShaderModuleDescriptor.swift | 30 - Sources/DOMKit/WebIDL/GPUShaderStage.swift | 16 - .../DOMKit/WebIDL/GPUStencilFaceState.swift | 35 - .../DOMKit/WebIDL/GPUStencilOperation.swift | 28 - .../WebIDL/GPUStorageTextureAccess.swift | 21 - .../GPUStorageTextureBindingLayout.swift | 30 - Sources/DOMKit/WebIDL/GPUStoreOp.swift | 22 - .../DOMKit/WebIDL/GPUSupportedFeatures.swift | 16 - .../DOMKit/WebIDL/GPUSupportedLimits.swift | 118 - Sources/DOMKit/WebIDL/GPUTexture.swift | 24 - Sources/DOMKit/WebIDL/GPUTextureAspect.swift | 23 - .../WebIDL/GPUTextureBindingLayout.swift | 30 - .../DOMKit/WebIDL/GPUTextureDescriptor.swift | 50 - .../DOMKit/WebIDL/GPUTextureDimension.swift | 23 - Sources/DOMKit/WebIDL/GPUTextureFormat.swift | 115 - .../DOMKit/WebIDL/GPUTextureSampleType.swift | 25 - Sources/DOMKit/WebIDL/GPUTextureUsage.swift | 20 - Sources/DOMKit/WebIDL/GPUTextureView.swift | 14 - .../WebIDL/GPUTextureViewDescriptor.swift | 50 - .../WebIDL/GPUTextureViewDimension.swift | 26 - .../WebIDL/GPUUncapturedErrorEvent.swift | 20 - .../WebIDL/GPUUncapturedErrorEventInit.swift | 20 - .../DOMKit/WebIDL/GPUValidationError.swift | 22 - .../DOMKit/WebIDL/GPUVertexAttribute.swift | 30 - .../DOMKit/WebIDL/GPUVertexBufferLayout.swift | 30 - Sources/DOMKit/WebIDL/GPUVertexFormat.swift | 50 - Sources/DOMKit/WebIDL/GPUVertexState.swift | 20 - Sources/DOMKit/WebIDL/GPUVertexStepMode.swift | 22 - Sources/DOMKit/WebIDL/GainNode.swift | 20 - Sources/DOMKit/WebIDL/GainOptions.swift | 20 - Sources/DOMKit/WebIDL/Gamepad.swift | 58 - Sources/DOMKit/WebIDL/GamepadButton.swift | 26 - Sources/DOMKit/WebIDL/GamepadEvent.swift | 20 - Sources/DOMKit/WebIDL/GamepadEventInit.swift | 20 - Sources/DOMKit/WebIDL/GamepadHand.swift | 23 - .../DOMKit/WebIDL/GamepadHapticActuator.swift | 30 - .../WebIDL/GamepadHapticActuatorType.swift | 21 - .../DOMKit/WebIDL/GamepadMappingType.swift | 23 - Sources/DOMKit/WebIDL/GamepadPose.swift | 46 - Sources/DOMKit/WebIDL/GamepadTouch.swift | 30 - .../WebIDL/GenerateTestReportParameters.swift | 25 - Sources/DOMKit/WebIDL/Geolocation.swift | 23 - .../WebIDL/GeolocationCoordinates.swift | 42 - .../DOMKit/WebIDL/GeolocationPosition.swift | 22 - .../WebIDL/GeolocationPositionError.swift | 28 - .../WebIDL/GeolocationReadingValues.swift | 50 - Sources/DOMKit/WebIDL/GeolocationSensor.swift | 56 - .../WebIDL/GeolocationSensorOptions.swift | 16 - .../WebIDL/GeolocationSensorReading.swift | 55 - Sources/DOMKit/WebIDL/GeometryNode.swift | 46 - Sources/DOMKit/WebIDL/GeometryUtils.swift | 27 - .../WebIDL/GetNotificationOptions.swift | 20 - Sources/DOMKit/WebIDL/Global.swift | 27 - Sources/DOMKit/WebIDL/GlobalDescriptor.swift | 25 - .../DOMKit/WebIDL/GlobalEventHandlers.swift | 130 - .../DOMKit/WebIDL/GravityReadingValues.swift | 16 - Sources/DOMKit/WebIDL/GravitySensor.swift | 16 - Sources/DOMKit/WebIDL/GroupEffect.swift | 45 - Sources/DOMKit/WebIDL/Gyroscope.swift | 28 - .../GyroscopeLocalCoordinateSystem.swift | 22 - .../WebIDL/GyroscopeReadingValues.swift | 30 - .../WebIDL/GyroscopeSensorOptions.swift | 20 - Sources/DOMKit/WebIDL/HID.swift | 44 - Sources/DOMKit/WebIDL/HIDCollectionInfo.swift | 50 - .../DOMKit/WebIDL/HIDConnectionEvent.swift | 20 - .../WebIDL/HIDConnectionEventInit.swift | 20 - Sources/DOMKit/WebIDL/HIDDevice.swift | 108 - Sources/DOMKit/WebIDL/HIDDeviceFilter.swift | 35 - .../WebIDL/HIDDeviceRequestOptions.swift | 20 - .../DOMKit/WebIDL/HIDInputReportEvent.swift | 28 - .../WebIDL/HIDInputReportEventInit.swift | 30 - Sources/DOMKit/WebIDL/HIDReportInfo.swift | 25 - Sources/DOMKit/WebIDL/HIDReportItem.swift | 155 - Sources/DOMKit/WebIDL/HIDUnitSystem.swift | 27 - Sources/DOMKit/WebIDL/HTMLAnchorElement.swift | 28 - Sources/DOMKit/WebIDL/HTMLBodyElement.swift | 4 - Sources/DOMKit/WebIDL/HTMLCanvasElement.swift | 5 - ...nt_or_ImageBitmap_or_OffscreenCanvas.swift | 39 - ...HTMLCanvasElement_or_OffscreenCanvas.swift | 10 +- Sources/DOMKit/WebIDL/HTMLElement.swift | 20 - .../DOMKit/WebIDL/HTMLElement_or_Int32.swift | 10 +- Sources/DOMKit/WebIDL/HTMLIFrameElement.swift | 12 - Sources/DOMKit/WebIDL/HTMLImageElement.swift | 12 - Sources/DOMKit/WebIDL/HTMLInputElement.swift | 12 - Sources/DOMKit/WebIDL/HTMLLinkElement.swift | 4 - Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 53 - ...OptGroupElement_or_HTMLOptionElement.swift | 20 +- .../DOMKit/WebIDL/HTMLOrSVGImageElement.swift | 20 +- .../WebIDL/HTMLOrSVGScriptElement.swift | 20 +- Sources/DOMKit/WebIDL/HTMLPortalElement.swift | 49 - Sources/DOMKit/WebIDL/HTMLScriptElement.swift | 4 - Sources/DOMKit/WebIDL/HTMLVideoElement.swift | 40 - Sources/DOMKit/WebIDL/HdrMetadataType.swift | 23 - Sources/DOMKit/WebIDL/Highlight.swift | 28 - Sources/DOMKit/WebIDL/HighlightRegistry.swift | 16 - Sources/DOMKit/WebIDL/HighlightType.swift | 23 - Sources/DOMKit/WebIDL/HkdfParams.swift | 30 - Sources/DOMKit/WebIDL/HmacImportParams.swift | 25 - Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift | 25 - Sources/DOMKit/WebIDL/HmacKeyGenParams.swift | 25 - Sources/DOMKit/WebIDL/IDBCursor.swift | 59 - .../DOMKit/WebIDL/IDBCursorDirection.swift | 24 - .../DOMKit/WebIDL/IDBCursorWithValue.swift | 16 - ...Cursor_or_IDBIndex_or_IDBObjectStore.swift | 39 - Sources/DOMKit/WebIDL/IDBDatabase.swift | 60 - Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift | 25 - Sources/DOMKit/WebIDL/IDBFactory.swift | 41 - Sources/DOMKit/WebIDL/IDBIndex.swift | 69 - .../DOMKit/WebIDL/IDBIndexParameters.swift | 25 - .../WebIDL/IDBIndex_or_IDBObjectStore.swift | 32 - Sources/DOMKit/WebIDL/IDBKeyRange.swift | 55 - Sources/DOMKit/WebIDL/IDBObjectStore.swift | 104 - .../WebIDL/IDBObjectStoreParameters.swift | 25 - Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift | 20 - Sources/DOMKit/WebIDL/IDBRequest.swift | 40 - .../DOMKit/WebIDL/IDBRequestReadyState.swift | 22 - Sources/DOMKit/WebIDL/IDBTransaction.swift | 59 - .../WebIDL/IDBTransactionDurability.swift | 23 - .../DOMKit/WebIDL/IDBTransactionMode.swift | 23 - .../DOMKit/WebIDL/IDBTransactionOptions.swift | 20 - .../DOMKit/WebIDL/IDBVersionChangeEvent.swift | 24 - .../WebIDL/IDBVersionChangeEventInit.swift | 25 - Sources/DOMKit/WebIDL/IIRFilterNode.swift | 21 - Sources/DOMKit/WebIDL/IIRFilterOptions.swift | 25 - Sources/DOMKit/WebIDL/IdleDeadline.swift | 23 - Sources/DOMKit/WebIDL/IdleDetector.swift | 52 - Sources/DOMKit/WebIDL/IdleOptions.swift | 25 - .../DOMKit/WebIDL/IdleRequestOptions.swift | 20 - Sources/DOMKit/WebIDL/ImageCapture.swift | 70 - Sources/DOMKit/WebIDL/ImageObject.swift | 30 - Sources/DOMKit/WebIDL/ImageResource.swift | 35 - Sources/DOMKit/WebIDL/ImportExportKind.swift | 24 - Sources/DOMKit/WebIDL/Ink.swift | 26 - Sources/DOMKit/WebIDL/InkPresenter.swift | 27 - Sources/DOMKit/WebIDL/InkPresenterParam.swift | 20 - Sources/DOMKit/WebIDL/InkTrailStyle.swift | 25 - Sources/DOMKit/WebIDL/InnerHTML.swift | 12 - .../WebIDL/InputDeviceCapabilities.swift | 26 - .../WebIDL/InputDeviceCapabilitiesInit.swift | 25 - Sources/DOMKit/WebIDL/InputEvent.swift | 9 - Sources/DOMKit/WebIDL/InputEventInit.swift | 12 +- Sources/DOMKit/WebIDL/Instance.swift | 22 - .../WebIDL/Int32Array_or_seq_of_GLsizei.swift | 32 - Sources/DOMKit/WebIDL/Int32List.swift | 32 - Sources/DOMKit/WebIDL/InteractionCounts.swift | 16 - .../DOMKit/WebIDL/IntersectionObserver.swift | 48 - .../WebIDL/IntersectionObserverEntry.swift | 46 - .../IntersectionObserverEntryInit.swift | 50 - .../WebIDL/IntersectionObserverInit.swift | 30 - .../WebIDL/InterventionReportBody.swift | 37 - .../WebIDL/IntrinsicSizesResultOptions.swift | 25 - .../DOMKit/WebIDL/IsInputPendingOptions.swift | 20 - Sources/DOMKit/WebIDL/IsVisibleOptions.swift | 16 - Sources/DOMKit/WebIDL/ItemDetails.swift | 70 - Sources/DOMKit/WebIDL/ItemType.swift | 22 - .../WebIDL/IterationCompositeOperation.swift | 22 - Sources/DOMKit/WebIDL/JsonWebKey.swift | 105 - .../WebIDL/KHR_parallel_shader_compile.swift | 16 - Sources/DOMKit/WebIDL/KeyAlgorithm.swift | 20 - Sources/DOMKit/WebIDL/KeyFormat.swift | 24 - .../WebIDL/KeySystemTrackConfiguration.swift | 25 - Sources/DOMKit/WebIDL/KeyType.swift | 23 - Sources/DOMKit/WebIDL/KeyUsage.swift | 28 - Sources/DOMKit/WebIDL/Keyboard.swift | 45 - Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift | 16 - Sources/DOMKit/WebIDL/KeyframeEffect.swift | 4 - .../DOMKit/WebIDL/KeyframeEffectOptions.swift | 7 +- Sources/DOMKit/WebIDL/Landmark.swift | 25 - Sources/DOMKit/WebIDL/LandmarkType.swift | 23 - Sources/DOMKit/WebIDL/LargeBlobSupport.swift | 22 - .../WebIDL/LargestContentfulPaint.swift | 41 - .../WebIDL/LayoutConstraintsOptions.swift | 60 - Sources/DOMKit/WebIDL/LayoutOptions.swift | 25 - Sources/DOMKit/WebIDL/LayoutShift.swift | 33 - .../WebIDL/LayoutShiftAttribution.swift | 26 - Sources/DOMKit/WebIDL/LayoutSizingMode.swift | 22 - Sources/DOMKit/WebIDL/LineAlignSetting.swift | 23 - .../WebIDL/LineAndPositionSetting.swift | 32 - .../LinearAccelerationReadingValues.swift | 16 - .../WebIDL/LinearAccelerationSensor.swift | 16 - Sources/DOMKit/WebIDL/Lock.swift | 22 - Sources/DOMKit/WebIDL/LockInfo.swift | 30 - Sources/DOMKit/WebIDL/LockManager.swift | 34 - .../DOMKit/WebIDL/LockManagerSnapshot.swift | 25 - Sources/DOMKit/WebIDL/LockMode.swift | 22 - Sources/DOMKit/WebIDL/LockOptions.swift | 35 - Sources/DOMKit/WebIDL/MIDIAccess.swift | 28 - .../DOMKit/WebIDL/MIDIConnectionEvent.swift | 20 - .../WebIDL/MIDIConnectionEventInit.swift | 20 - Sources/DOMKit/WebIDL/MIDIInput.swift | 16 - Sources/DOMKit/WebIDL/MIDIInputMap.swift | 16 - Sources/DOMKit/WebIDL/MIDIMessageEvent.swift | 20 - .../DOMKit/WebIDL/MIDIMessageEventInit.swift | 20 - Sources/DOMKit/WebIDL/MIDIOptions.swift | 25 - Sources/DOMKit/WebIDL/MIDIOutput.swift | 22 - Sources/DOMKit/WebIDL/MIDIOutputMap.swift | 16 - Sources/DOMKit/WebIDL/MIDIPort.swift | 68 - .../WebIDL/MIDIPortConnectionState.swift | 23 - .../DOMKit/WebIDL/MIDIPortDeviceState.swift | 22 - Sources/DOMKit/WebIDL/MIDIPortType.swift | 22 - Sources/DOMKit/WebIDL/ML.swift | 29 - Sources/DOMKit/WebIDL/MLAutoPad.swift | 23 - .../WebIDL/MLBatchNormalizationOptions.swift | 40 - .../DOMKit/WebIDL/MLBufferResourceView.swift | 30 - Sources/DOMKit/WebIDL/MLBufferView.swift | 32 - Sources/DOMKit/WebIDL/MLClampOptions.swift | 25 - Sources/DOMKit/WebIDL/MLContext.swift | 14 - Sources/DOMKit/WebIDL/MLContextOptions.swift | 25 - .../WebIDL/MLConv2dFilterOperandLayout.swift | 24 - Sources/DOMKit/WebIDL/MLConv2dOptions.swift | 60 - ...MLConvTranspose2dFilterOperandLayout.swift | 23 - .../WebIDL/MLConvTranspose2dOptions.swift | 70 - .../DOMKit/WebIDL/MLDevicePreference.swift | 23 - Sources/DOMKit/WebIDL/MLEluOptions.swift | 20 - Sources/DOMKit/WebIDL/MLGemmOptions.swift | 40 - Sources/DOMKit/WebIDL/MLGraph.swift | 19 - Sources/DOMKit/WebIDL/MLGraphBuilder.swift | 390 -- Sources/DOMKit/WebIDL/MLGruCellOptions.swift | 40 - Sources/DOMKit/WebIDL/MLGruOptions.swift | 55 - .../DOMKit/WebIDL/MLHardSigmoidOptions.swift | 25 - Sources/DOMKit/WebIDL/MLInput.swift | 25 - .../DOMKit/WebIDL/MLInputOperandLayout.swift | 22 - .../DOMKit/WebIDL/MLInput_or_MLResource.swift | 32 - .../MLInstanceNormalizationOptions.swift | 35 - .../DOMKit/WebIDL/MLInterpolationMode.swift | 22 - .../DOMKit/WebIDL/MLLeakyReluOptions.swift | 20 - Sources/DOMKit/WebIDL/MLLinearOptions.swift | 25 - Sources/DOMKit/WebIDL/MLOperand.swift | 14 - .../DOMKit/WebIDL/MLOperandDescriptor.swift | 25 - Sources/DOMKit/WebIDL/MLOperandType.swift | 26 - Sources/DOMKit/WebIDL/MLOperator.swift | 14 - Sources/DOMKit/WebIDL/MLPadOptions.swift | 25 - Sources/DOMKit/WebIDL/MLPaddingMode.swift | 24 - Sources/DOMKit/WebIDL/MLPool2dOptions.swift | 55 - Sources/DOMKit/WebIDL/MLPowerPreference.swift | 23 - .../WebIDL/MLRecurrentNetworkDirection.swift | 23 - .../MLRecurrentNetworkWeightLayout.swift | 22 - Sources/DOMKit/WebIDL/MLReduceOptions.swift | 25 - .../DOMKit/WebIDL/MLResample2dOptions.swift | 35 - Sources/DOMKit/WebIDL/MLResource.swift | 39 - Sources/DOMKit/WebIDL/MLRoundingType.swift | 22 - Sources/DOMKit/WebIDL/MLSliceOptions.swift | 20 - Sources/DOMKit/WebIDL/MLSoftplusOptions.swift | 20 - Sources/DOMKit/WebIDL/MLSplitOptions.swift | 20 - Sources/DOMKit/WebIDL/MLSqueezeOptions.swift | 20 - .../DOMKit/WebIDL/MLTransposeOptions.swift | 20 - Sources/DOMKit/WebIDL/Magnetometer.swift | 28 - .../MagnetometerLocalCoordinateSystem.swift | 22 - .../WebIDL/MagnetometerReadingValues.swift | 30 - .../WebIDL/MagnetometerSensorOptions.swift | 20 - Sources/DOMKit/WebIDL/MathMLElement.swift | 12 - Sources/DOMKit/WebIDL/MediaCapabilities.swift | 38 - .../MediaCapabilitiesDecodingInfo.swift | 25 - .../MediaCapabilitiesEncodingInfo.swift | 20 - .../DOMKit/WebIDL/MediaCapabilitiesInfo.swift | 30 - ...iaCapabilitiesKeySystemConfiguration.swift | 50 - .../DOMKit/WebIDL/MediaConfiguration.swift | 25 - .../WebIDL/MediaDecodingConfiguration.swift | 25 - Sources/DOMKit/WebIDL/MediaDecodingType.swift | 23 - Sources/DOMKit/WebIDL/MediaDevices.swift | 36 - .../WebIDL/MediaElementAudioSourceNode.swift | 20 - .../MediaElementAudioSourceOptions.swift | 20 - .../WebIDL/MediaEncodingConfiguration.swift | 20 - Sources/DOMKit/WebIDL/MediaEncodingType.swift | 22 - .../DOMKit/WebIDL/MediaEncryptedEvent.swift | 24 - .../WebIDL/MediaEncryptedEventInit.swift | 25 - Sources/DOMKit/WebIDL/MediaImage.swift | 30 - .../DOMKit/WebIDL/MediaKeyMessageEvent.swift | 24 - .../WebIDL/MediaKeyMessageEventInit.swift | 25 - .../DOMKit/WebIDL/MediaKeyMessageType.swift | 24 - Sources/DOMKit/WebIDL/MediaKeySession.swift | 96 - .../WebIDL/MediaKeySessionClosedReason.swift | 25 - .../DOMKit/WebIDL/MediaKeySessionType.swift | 22 - Sources/DOMKit/WebIDL/MediaKeyStatus.swift | 28 - Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift | 33 - .../DOMKit/WebIDL/MediaKeySystemAccess.swift | 35 - .../WebIDL/MediaKeySystemConfiguration.swift | 50 - .../MediaKeySystemMediaCapability.swift | 30 - Sources/DOMKit/WebIDL/MediaKeys.swift | 31 - .../DOMKit/WebIDL/MediaKeysRequirement.swift | 23 - Sources/DOMKit/WebIDL/MediaMetadata.swift | 34 - Sources/DOMKit/WebIDL/MediaMetadataInit.swift | 35 - .../DOMKit/WebIDL/MediaPositionState.swift | 30 - Sources/DOMKit/WebIDL/MediaQueryList.swift | 28 - .../DOMKit/WebIDL/MediaQueryListEvent.swift | 24 - .../WebIDL/MediaQueryListEventInit.swift | 25 - Sources/DOMKit/WebIDL/MediaSession.swift | 39 - .../DOMKit/WebIDL/MediaSessionAction.swift | 32 - .../WebIDL/MediaSessionActionDetails.swift | 35 - .../WebIDL/MediaSessionPlaybackState.swift | 23 - .../DOMKit/WebIDL/MediaSettingsRange.swift | 30 - .../MediaStreamAudioDestinationNode.swift | 20 - .../WebIDL/MediaStreamAudioSourceNode.swift | 20 - .../MediaStreamAudioSourceOptions.swift | 20 - .../WebIDL/MediaStreamConstraints.swift | 12 +- Sources/DOMKit/WebIDL/MediaStreamTrack.swift | 12 - .../MediaStreamTrackAudioSourceNode.swift | 16 - .../MediaStreamTrackAudioSourceOptions.swift | 20 - .../MediaStreamTrackProcessorInit.swift | 25 - .../WebIDL/MediaStreamTrack_or_String.swift | 32 - .../WebIDL/MediaTrackCapabilities.swift | 97 +- .../WebIDL/MediaTrackConstraintSet.swift | 112 +- .../DOMKit/WebIDL/MediaTrackSettings.swift | 107 +- .../MediaTrackSupportedConstraints.swift | 112 +- Sources/DOMKit/WebIDL/Memory.swift | 27 - Sources/DOMKit/WebIDL/MemoryAttribution.swift | 30 - .../WebIDL/MemoryAttributionContainer.swift | 25 - .../DOMKit/WebIDL/MemoryBreakdownEntry.swift | 30 - Sources/DOMKit/WebIDL/MemoryDescriptor.swift | 25 - Sources/DOMKit/WebIDL/MemoryMeasurement.swift | 25 - Sources/DOMKit/WebIDL/MeteringMode.swift | 24 - .../WebIDL/MidiPermissionDescriptor.swift | 20 - .../WebIDL/MockCameraConfiguration.swift | 25 - .../MockCaptureDeviceConfiguration.swift | 30 - .../WebIDL/MockCapturePromptResult.swift | 22 - ...MockCapturePromptResultConfiguration.swift | 25 - .../WebIDL/MockMicrophoneConfiguration.swift | 20 - Sources/DOMKit/WebIDL/MockSensor.swift | 30 - .../WebIDL/MockSensorConfiguration.swift | 35 - .../WebIDL/MockSensorReadingValues.swift | 16 - Sources/DOMKit/WebIDL/MockSensorType.swift | 31 - Sources/DOMKit/WebIDL/Module.swift | 33 - .../WebIDL/ModuleExportDescriptor.swift | 25 - .../WebIDL/ModuleImportDescriptor.swift | 30 - Sources/DOMKit/WebIDL/MouseEvent.swift | 32 - Sources/DOMKit/WebIDL/MouseEventInit.swift | 12 +- .../WebIDL/NDEFMakeReadOnlyOptions.swift | 20 - Sources/DOMKit/WebIDL/NDEFMessage.swift | 22 - Sources/DOMKit/WebIDL/NDEFMessageInit.swift | 20 - Sources/DOMKit/WebIDL/NDEFMessageSource.swift | 39 - Sources/DOMKit/WebIDL/NDEFReader.swift | 60 - Sources/DOMKit/WebIDL/NDEFReadingEvent.swift | 24 - .../DOMKit/WebIDL/NDEFReadingEventInit.swift | 25 - Sources/DOMKit/WebIDL/NDEFRecord.swift | 47 - Sources/DOMKit/WebIDL/NDEFRecordInit.swift | 45 - Sources/DOMKit/WebIDL/NDEFScanOptions.swift | 20 - Sources/DOMKit/WebIDL/NDEFWriteOptions.swift | 25 - Sources/DOMKit/WebIDL/NamedFlow.swift | 39 - Sources/DOMKit/WebIDL/NamedFlowMap.swift | 16 - Sources/DOMKit/WebIDL/NavigateEvent.swift | 53 - Sources/DOMKit/WebIDL/NavigateEventInit.swift | 55 - Sources/DOMKit/WebIDL/Navigation.swift | 79 - .../NavigationCurrentEntryChangeEvent.swift | 24 - ...avigationCurrentEntryChangeEventInit.swift | 25 - .../DOMKit/WebIDL/NavigationDestination.swift | 39 - Sources/DOMKit/WebIDL/NavigationEvent.swift | 24 - .../DOMKit/WebIDL/NavigationEventInit.swift | 25 - .../WebIDL/NavigationHistoryEntry.swift | 53 - .../WebIDL/NavigationNavigateOptions.swift | 25 - .../WebIDL/NavigationNavigationType.swift | 24 - Sources/DOMKit/WebIDL/NavigationOptions.swift | 20 - .../WebIDL/NavigationReloadOptions.swift | 20 - Sources/DOMKit/WebIDL/NavigationResult.swift | 25 - .../DOMKit/WebIDL/NavigationTimingType.swift | 24 - .../DOMKit/WebIDL/NavigationTransition.swift | 31 - .../NavigationUpdateCurrentEntryOptions.swift | 20 - Sources/DOMKit/WebIDL/Navigator.swift | 205 +- .../NavigatorAutomationInformation.swift | 9 - Sources/DOMKit/WebIDL/NavigatorBadge.swift | 31 - .../DOMKit/WebIDL/NavigatorDeviceMemory.swift | 9 - Sources/DOMKit/WebIDL/NavigatorFonts.swift | 9 - Sources/DOMKit/WebIDL/NavigatorGPU.swift | 9 - Sources/DOMKit/WebIDL/NavigatorLocks.swift | 9 - Sources/DOMKit/WebIDL/NavigatorML.swift | 9 - .../WebIDL/NavigatorNetworkInformation.swift | 9 - Sources/DOMKit/WebIDL/NavigatorStorage.swift | 9 - Sources/DOMKit/WebIDL/NavigatorUA.swift | 9 - .../WebIDL/NavigatorUABrandVersion.swift | 25 - Sources/DOMKit/WebIDL/NavigatorUAData.swift | 43 - .../DOMKit/WebIDL/NetworkInformation.swift | 36 - .../WebIDL/NetworkInformationSaveData.swift | 9 - Sources/DOMKit/WebIDL/Notification.swift | 109 - .../DOMKit/WebIDL/NotificationAction.swift | 30 - .../DOMKit/WebIDL/NotificationDirection.swift | 23 - .../DOMKit/WebIDL/NotificationEventInit.swift | 25 - .../DOMKit/WebIDL/NotificationOptions.swift | 85 - .../WebIDL/NotificationPermission.swift | 23 - .../WebIDL/OES_draw_buffers_indexed.swift | 49 - .../WebIDL/OES_element_index_uint.swift | 14 - .../DOMKit/WebIDL/OES_fbo_render_mipmap.swift | 14 - .../WebIDL/OES_standard_derivatives.swift | 16 - Sources/DOMKit/WebIDL/OES_texture_float.swift | 14 - .../WebIDL/OES_texture_float_linear.swift | 14 - .../WebIDL/OES_texture_half_float.swift | 16 - .../OES_texture_half_float_linear.swift | 14 - .../WebIDL/OES_vertex_array_object.swift | 36 - Sources/DOMKit/WebIDL/OTPCredential.swift | 16 - .../WebIDL/OTPCredentialRequestOptions.swift | 20 - .../WebIDL/OTPCredentialTransportType.swift | 21 - Sources/DOMKit/WebIDL/OVR_multiview2.swift | 33 - .../WebIDL/OfflineAudioCompletionEvent.swift | 20 - .../OfflineAudioCompletionEventInit.swift | 20 - .../DOMKit/WebIDL/OfflineAudioContext.swift | 64 - .../WebIDL/OfflineAudioContextOptions.swift | 30 - .../WebIDL/OffscreenRenderingContext.swift | 10 +- .../DOMKit/WebIDL/OpenFilePickerOptions.swift | 20 - .../DOMKit/WebIDL/OptionalEffectTiming.swift | 7 +- .../DOMKit/WebIDL/OrientationLockType.swift | 28 - Sources/DOMKit/WebIDL/OrientationSensor.swift | 21 - ...ientationSensorLocalCoordinateSystem.swift | 22 - .../WebIDL/OrientationSensorOptions.swift | 20 - Sources/DOMKit/WebIDL/OrientationType.swift | 24 - Sources/DOMKit/WebIDL/OscillatorNode.swift | 33 - Sources/DOMKit/WebIDL/OscillatorOptions.swift | 35 - Sources/DOMKit/WebIDL/OscillatorType.swift | 25 - Sources/DOMKit/WebIDL/OverSampleType.swift | 23 - .../PaintRenderingContext2DSettings.swift | 20 - Sources/DOMKit/WebIDL/PannerNode.swift | 82 - Sources/DOMKit/WebIDL/PannerOptions.swift | 85 - Sources/DOMKit/WebIDL/PanningModelType.swift | 22 - Sources/DOMKit/WebIDL/ParityType.swift | 23 - .../DOMKit/WebIDL/PasswordCredential.swift | 24 - .../WebIDL/PasswordCredentialData.swift | 35 - .../WebIDL/PasswordCredentialInit.swift | 32 - Sources/DOMKit/WebIDL/PaymentComplete.swift | 23 - .../WebIDL/PaymentCredentialInstrument.swift | 30 - .../DOMKit/WebIDL/PaymentCurrencyAmount.swift | 25 - .../DOMKit/WebIDL/PaymentDetailsBase.swift | 25 - .../DOMKit/WebIDL/PaymentDetailsInit.swift | 25 - .../WebIDL/PaymentDetailsModifier.swift | 35 - .../DOMKit/WebIDL/PaymentDetailsUpdate.swift | 25 - .../WebIDL/PaymentHandlerResponse.swift | 25 - Sources/DOMKit/WebIDL/PaymentInstrument.swift | 30 - .../DOMKit/WebIDL/PaymentInstruments.swift | 86 - Sources/DOMKit/WebIDL/PaymentItem.swift | 30 - Sources/DOMKit/WebIDL/PaymentManager.swift | 22 - .../WebIDL/PaymentMethodChangeEvent.swift | 24 - .../WebIDL/PaymentMethodChangeEventInit.swift | 25 - Sources/DOMKit/WebIDL/PaymentMethodData.swift | 25 - Sources/DOMKit/WebIDL/PaymentRequest.swift | 60 - .../WebIDL/PaymentRequestDetailsUpdate.swift | 35 - .../WebIDL/PaymentRequestEventInit.swift | 45 - .../WebIDL/PaymentRequestUpdateEvent.swift | 21 - .../PaymentRequestUpdateEventInit.swift | 16 - Sources/DOMKit/WebIDL/PaymentResponse.swift | 53 - .../WebIDL/PaymentValidationErrors.swift | 25 - Sources/DOMKit/WebIDL/Pbkdf2Params.swift | 30 - Sources/DOMKit/WebIDL/Performance.swift | 77 - .../WebIDL/PerformanceElementTiming.swift | 53 - Sources/DOMKit/WebIDL/PerformanceEntry.swift | 35 - .../WebIDL/PerformanceEventTiming.swift | 37 - .../WebIDL/PerformanceLongTaskTiming.swift | 21 - Sources/DOMKit/WebIDL/PerformanceMark.swift | 20 - .../WebIDL/PerformanceMarkOptions.swift | 25 - .../DOMKit/WebIDL/PerformanceMeasure.swift | 16 - .../WebIDL/PerformanceMeasureOptions.swift | 35 - .../PerformanceMeasureOptions_or_String.swift | 32 - .../DOMKit/WebIDL/PerformanceNavigation.swift | 35 - .../WebIDL/PerformanceNavigationTiming.swift | 57 - .../DOMKit/WebIDL/PerformanceObserver.swift | 35 - .../PerformanceObserverCallbackOptions.swift | 20 - .../WebIDL/PerformanceObserverEntryList.swift | 29 - .../WebIDL/PerformanceObserverInit.swift | 35 - .../WebIDL/PerformancePaintTiming.swift | 12 - .../WebIDL/PerformanceResourceTiming.swift | 89 - .../WebIDL/PerformanceServerTiming.swift | 31 - Sources/DOMKit/WebIDL/PerformanceTiming.swift | 103 - .../DOMKit/WebIDL/PeriodicSyncEventInit.swift | 20 - .../DOMKit/WebIDL/PeriodicSyncManager.swift | 50 - Sources/DOMKit/WebIDL/PeriodicWave.swift | 18 - .../WebIDL/PeriodicWaveConstraints.swift | 20 - .../DOMKit/WebIDL/PeriodicWaveOptions.swift | 25 - .../DOMKit/WebIDL/PermissionDescriptor.swift | 20 - .../WebIDL/PermissionSetParameters.swift | 30 - Sources/DOMKit/WebIDL/PermissionState.swift | 23 - Sources/DOMKit/WebIDL/PermissionStatus.swift | 24 - Sources/DOMKit/WebIDL/Permissions.swift | 50 - Sources/DOMKit/WebIDL/PermissionsPolicy.swift | 34 - ...PermissionsPolicyViolationReportBody.swift | 32 - Sources/DOMKit/WebIDL/PhotoCapabilities.swift | 35 - Sources/DOMKit/WebIDL/PhotoSettings.swift | 35 - .../DOMKit/WebIDL/PictureInPictureEvent.swift | 20 - .../WebIDL/PictureInPictureEventInit.swift | 20 - .../WebIDL/PictureInPictureWindow.swift | 24 - Sources/DOMKit/WebIDL/Point2D.swift | 25 - Sources/DOMKit/WebIDL/PointerEvent.swift | 74 - Sources/DOMKit/WebIDL/PointerEventInit.swift | 85 - .../DOMKit/WebIDL/PortalActivateEvent.swift | 25 - .../WebIDL/PortalActivateEventInit.swift | 20 - .../DOMKit/WebIDL/PortalActivateOptions.swift | 20 - Sources/DOMKit/WebIDL/PortalHost.swift | 25 - .../DOMKit/WebIDL/PositionAlignSetting.swift | 24 - Sources/DOMKit/WebIDL/PositionOptions.swift | 30 - Sources/DOMKit/WebIDL/Presentation.swift | 22 - .../WebIDL/PresentationAvailability.swift | 20 - .../WebIDL/PresentationConnection.swift | 74 - ...PresentationConnectionAvailableEvent.swift | 20 - ...entationConnectionAvailableEventInit.swift | 20 - .../PresentationConnectionCloseEvent.swift | 24 - ...PresentationConnectionCloseEventInit.swift | 25 - .../PresentationConnectionCloseReason.swift | 23 - .../WebIDL/PresentationConnectionList.swift | 20 - .../WebIDL/PresentationConnectionState.swift | 24 - .../DOMKit/WebIDL/PresentationReceiver.swift | 18 - .../DOMKit/WebIDL/PresentationRequest.swift | 60 - Sources/DOMKit/WebIDL/PresentationStyle.swift | 23 - Sources/DOMKit/WebIDL/Profiler.swift | 36 - Sources/DOMKit/WebIDL/ProfilerFrame.swift | 35 - .../DOMKit/WebIDL/ProfilerInitOptions.swift | 25 - Sources/DOMKit/WebIDL/ProfilerSample.swift | 25 - Sources/DOMKit/WebIDL/ProfilerStack.swift | 25 - Sources/DOMKit/WebIDL/ProfilerTrace.swift | 35 - .../DOMKit/WebIDL/PromptResponseObject.swift | 20 - .../DOMKit/WebIDL/PropertyDefinition.swift | 35 - .../WebIDL/ProximityReadingValues.swift | 30 - Sources/DOMKit/WebIDL/ProximitySensor.swift | 28 - .../DOMKit/WebIDL/PublicKeyCredential.swift | 41 - .../PublicKeyCredentialCreationOptions.swift | 60 - .../PublicKeyCredentialDescriptor.swift | 30 - .../WebIDL/PublicKeyCredentialEntity.swift | 20 - .../PublicKeyCredentialParameters.swift | 25 - .../PublicKeyCredentialRequestOptions.swift | 45 - .../WebIDL/PublicKeyCredentialRpEntity.swift | 20 - .../WebIDL/PublicKeyCredentialType.swift | 21 - .../PublicKeyCredentialUserEntity.swift | 25 - Sources/DOMKit/WebIDL/PurchaseDetails.swift | 25 - .../DOMKit/WebIDL/PushEncryptionKeyName.swift | 22 - Sources/DOMKit/WebIDL/PushEventInit.swift | 20 - Sources/DOMKit/WebIDL/PushManager.swift | 54 - .../DOMKit/WebIDL/PushMessageDataInit.swift | 32 - .../WebIDL/PushPermissionDescriptor.swift | 20 - Sources/DOMKit/WebIDL/PushSubscription.swift | 48 - .../PushSubscriptionChangeEventInit.swift | 25 - .../DOMKit/WebIDL/PushSubscriptionJSON.swift | 30 - .../WebIDL/PushSubscriptionOptions.swift | 22 - .../WebIDL/PushSubscriptionOptionsInit.swift | 25 - Sources/DOMKit/WebIDL/QueryOptions.swift | 20 - Sources/DOMKit/WebIDL/RTCAnswerOptions.swift | 16 - .../DOMKit/WebIDL/RTCAudioHandlerStats.swift | 16 - .../DOMKit/WebIDL/RTCAudioReceiverStats.swift | 16 - .../DOMKit/WebIDL/RTCAudioSenderStats.swift | 20 - .../DOMKit/WebIDL/RTCAudioSourceStats.swift | 40 - Sources/DOMKit/WebIDL/RTCBundlePolicy.swift | 23 - Sources/DOMKit/WebIDL/RTCCertificate.swift | 23 - .../WebIDL/RTCCertificateExpiration.swift | 20 - .../DOMKit/WebIDL/RTCCertificateStats.swift | 35 - Sources/DOMKit/WebIDL/RTCCodecStats.swift | 50 - Sources/DOMKit/WebIDL/RTCCodecType.swift | 22 - Sources/DOMKit/WebIDL/RTCConfiguration.swift | 50 - Sources/DOMKit/WebIDL/RTCDTMFSender.swift | 29 - .../WebIDL/RTCDTMFToneChangeEvent.swift | 20 - .../WebIDL/RTCDTMFToneChangeEventInit.swift | 20 - Sources/DOMKit/WebIDL/RTCDataChannel.swift | 109 - .../DOMKit/WebIDL/RTCDataChannelEvent.swift | 20 - .../WebIDL/RTCDataChannelEventInit.swift | 20 - .../DOMKit/WebIDL/RTCDataChannelInit.swift | 50 - .../DOMKit/WebIDL/RTCDataChannelState.swift | 24 - .../DOMKit/WebIDL/RTCDataChannelStats.swift | 55 - .../WebIDL/RTCDegradationPreference.swift | 23 - .../DOMKit/WebIDL/RTCDtlsFingerprint.swift | 25 - Sources/DOMKit/WebIDL/RTCDtlsTransport.swift | 33 - .../DOMKit/WebIDL/RTCDtlsTransportState.swift | 25 - .../DOMKit/WebIDL/RTCEncodedAudioFrame.swift | 27 - .../WebIDL/RTCEncodedAudioFrameMetadata.swift | 30 - .../DOMKit/WebIDL/RTCEncodedVideoFrame.swift | 31 - .../WebIDL/RTCEncodedVideoFrameMetadata.swift | 60 - .../WebIDL/RTCEncodedVideoFrameType.swift | 23 - Sources/DOMKit/WebIDL/RTCError.swift | 40 - .../DOMKit/WebIDL/RTCErrorDetailType.swift | 27 - .../DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift | 28 - Sources/DOMKit/WebIDL/RTCErrorEvent.swift | 20 - Sources/DOMKit/WebIDL/RTCErrorEventInit.swift | 20 - Sources/DOMKit/WebIDL/RTCErrorInit.swift | 45 - Sources/DOMKit/WebIDL/RTCIceCandidate.swift | 79 - .../DOMKit/WebIDL/RTCIceCandidateInit.swift | 35 - .../DOMKit/WebIDL/RTCIceCandidatePair.swift | 25 - .../WebIDL/RTCIceCandidatePairStats.swift | 175 - .../DOMKit/WebIDL/RTCIceCandidateStats.swift | 55 - .../DOMKit/WebIDL/RTCIceCandidateType.swift | 24 - Sources/DOMKit/WebIDL/RTCIceComponent.swift | 22 - .../DOMKit/WebIDL/RTCIceConnectionState.swift | 27 - .../DOMKit/WebIDL/RTCIceCredentialType.swift | 21 - .../DOMKit/WebIDL/RTCIceGatherOptions.swift | 25 - .../DOMKit/WebIDL/RTCIceGathererState.swift | 23 - .../DOMKit/WebIDL/RTCIceGatheringState.swift | 23 - Sources/DOMKit/WebIDL/RTCIceParameters.swift | 30 - Sources/DOMKit/WebIDL/RTCIceProtocol.swift | 22 - Sources/DOMKit/WebIDL/RTCIceRole.swift | 23 - Sources/DOMKit/WebIDL/RTCIceServer.swift | 35 - Sources/DOMKit/WebIDL/RTCIceServerStats.swift | 45 - .../WebIDL/RTCIceTcpCandidateType.swift | 23 - Sources/DOMKit/WebIDL/RTCIceTransport.swift | 97 - .../DOMKit/WebIDL/RTCIceTransportPolicy.swift | 22 - .../DOMKit/WebIDL/RTCIceTransportState.swift | 27 - .../DOMKit/WebIDL/RTCIdentityAssertion.swift | 26 - .../WebIDL/RTCIdentityAssertionResult.swift | 25 - .../DOMKit/WebIDL/RTCIdentityProvider.swift | 25 - .../WebIDL/RTCIdentityProviderDetails.swift | 25 - .../WebIDL/RTCIdentityProviderOptions.swift | 30 - .../WebIDL/RTCIdentityValidationResult.swift | 25 - .../WebIDL/RTCInboundRtpStreamStats.swift | 235 -- .../DOMKit/WebIDL/RTCInsertableStreams.swift | 25 - .../RTCLocalSessionDescriptionInit.swift | 25 - .../DOMKit/WebIDL/RTCMediaHandlerStats.swift | 30 - .../DOMKit/WebIDL/RTCMediaSourceStats.swift | 30 - .../DOMKit/WebIDL/RTCOfferAnswerOptions.swift | 16 - Sources/DOMKit/WebIDL/RTCOfferOptions.swift | 30 - .../WebIDL/RTCOutboundRtpStreamStats.swift | 215 -- Sources/DOMKit/WebIDL/RTCPeerConnection.swift | 248 -- .../RTCPeerConnectionIceErrorEvent.swift | 36 - .../RTCPeerConnectionIceErrorEventInit.swift | 40 - .../WebIDL/RTCPeerConnectionIceEvent.swift | 24 - .../RTCPeerConnectionIceEventInit.swift | 25 - .../WebIDL/RTCPeerConnectionState.swift | 26 - .../WebIDL/RTCPeerConnectionStats.swift | 35 - Sources/DOMKit/WebIDL/RTCPriorityType.swift | 24 - .../WebIDL/RTCQualityLimitationReason.swift | 24 - .../WebIDL/RTCReceivedRtpStreamStats.swift | 95 - .../RTCRemoteInboundRtpStreamStats.swift | 45 - .../RTCRemoteOutboundRtpStreamStats.swift | 45 - Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift | 21 - Sources/DOMKit/WebIDL/RTCRtcpParameters.swift | 25 - .../DOMKit/WebIDL/RTCRtpCapabilities.swift | 25 - .../DOMKit/WebIDL/RTCRtpCodecCapability.swift | 40 - .../DOMKit/WebIDL/RTCRtpCodecParameters.swift | 40 - .../WebIDL/RTCRtpCodingParameters.swift | 20 - .../WebIDL/RTCRtpContributingSource.swift | 35 - .../RTCRtpContributingSourceStats.swift | 35 - .../WebIDL/RTCRtpDecodingParameters.swift | 16 - .../WebIDL/RTCRtpEncodingParameters.swift | 45 - .../RTCRtpHeaderExtensionCapability.swift | 20 - .../RTCRtpHeaderExtensionParameters.swift | 30 - Sources/DOMKit/WebIDL/RTCRtpParameters.swift | 30 - .../WebIDL/RTCRtpReceiveParameters.swift | 16 - Sources/DOMKit/WebIDL/RTCRtpReceiver.swift | 58 - .../DOMKit/WebIDL/RTCRtpScriptTransform.swift | 18 - .../DOMKit/WebIDL/RTCRtpSendParameters.swift | 30 - Sources/DOMKit/WebIDL/RTCRtpSender.swift | 93 - Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift | 35 - .../WebIDL/RTCRtpSynchronizationSource.swift | 16 - Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift | 44 - .../WebIDL/RTCRtpTransceiverDirection.swift | 25 - .../DOMKit/WebIDL/RTCRtpTransceiverInit.swift | 30 - .../WebIDL/RTCRtpTransceiverStats.swift | 30 - Sources/DOMKit/WebIDL/RTCRtpTransform.swift | 32 - Sources/DOMKit/WebIDL/RTCSctpTransport.swift | 32 - .../DOMKit/WebIDL/RTCSctpTransportState.swift | 23 - .../DOMKit/WebIDL/RTCSctpTransportStats.swift | 45 - Sources/DOMKit/WebIDL/RTCSdpType.swift | 24 - .../DOMKit/WebIDL/RTCSentRtpStreamStats.swift | 25 - .../DOMKit/WebIDL/RTCSessionDescription.swift | 31 - .../WebIDL/RTCSessionDescriptionInit.swift | 25 - Sources/DOMKit/WebIDL/RTCSignalingState.swift | 26 - Sources/DOMKit/WebIDL/RTCStats.swift | 30 - .../RTCStatsIceCandidatePairState.swift | 25 - Sources/DOMKit/WebIDL/RTCStatsReport.swift | 16 - Sources/DOMKit/WebIDL/RTCStatsType.swift | 41 - Sources/DOMKit/WebIDL/RTCTrackEvent.swift | 32 - Sources/DOMKit/WebIDL/RTCTrackEventInit.swift | 35 - Sources/DOMKit/WebIDL/RTCTransportStats.swift | 100 - .../DOMKit/WebIDL/RTCVideoHandlerStats.swift | 16 - .../DOMKit/WebIDL/RTCVideoReceiverStats.swift | 16 - .../DOMKit/WebIDL/RTCVideoSenderStats.swift | 20 - .../DOMKit/WebIDL/RTCVideoSourceStats.swift | 40 - Sources/DOMKit/WebIDL/Range.swift | 15 - Sources/DOMKit/WebIDL/ReadOptions.swift | 20 - Sources/DOMKit/WebIDL/RedEyeReduction.swift | 23 - Sources/DOMKit/WebIDL/Region.swift | 14 - .../DOMKit/WebIDL/RelatedApplication.swift | 35 - .../RelativeOrientationReadingValues.swift | 16 - .../WebIDL/RelativeOrientationSensor.swift | 16 - Sources/DOMKit/WebIDL/RemotePlayback.swift | 56 - .../DOMKit/WebIDL/RemotePlaybackState.swift | 23 - Sources/DOMKit/WebIDL/RenderingContext.swift | 10 +- Sources/DOMKit/WebIDL/Report.swift | 31 - Sources/DOMKit/WebIDL/ReportBody.swift | 19 - Sources/DOMKit/WebIDL/ReportingObserver.swift | 31 - .../WebIDL/ReportingObserverOptions.swift | 25 - Sources/DOMKit/WebIDL/Request.swift | 4 - .../DOMKit/WebIDL/RequestDeviceOptions.swift | 35 - .../RequestInfo_or_seq_of_RequestInfo.swift | 32 - Sources/DOMKit/WebIDL/RequestInit.swift | 7 +- .../WebIDL/ResidentKeyRequirement.swift | 23 - Sources/DOMKit/WebIDL/ResizeObserver.swift | 31 - .../WebIDL/ResizeObserverBoxOptions.swift | 23 - .../DOMKit/WebIDL/ResizeObserverEntry.swift | 34 - .../DOMKit/WebIDL/ResizeObserverOptions.swift | 20 - .../DOMKit/WebIDL/ResizeObserverSize.swift | 22 - .../DOMKit/WebIDL/RsaHashedImportParams.swift | 20 - .../DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift | 20 - .../DOMKit/WebIDL/RsaHashedKeyGenParams.swift | 20 - Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift | 25 - Sources/DOMKit/WebIDL/RsaKeyGenParams.swift | 25 - Sources/DOMKit/WebIDL/RsaOaepParams.swift | 20 - .../DOMKit/WebIDL/RsaOtherPrimesInfo.swift | 30 - Sources/DOMKit/WebIDL/RsaPssParams.swift | 20 - Sources/DOMKit/WebIDL/SFrameTransform.swift | 34 - .../WebIDL/SFrameTransformErrorEvent.swift | 28 - .../SFrameTransformErrorEventInit.swift | 30 - .../SFrameTransformErrorEventType.swift | 23 - .../WebIDL/SFrameTransformOptions.swift | 20 - .../DOMKit/WebIDL/SFrameTransformRole.swift | 22 - Sources/DOMKit/WebIDL/SVGAnimateElement.swift | 12 - .../WebIDL/SVGAnimateMotionElement.swift | 12 - .../WebIDL/SVGAnimateTransformElement.swift | 12 - .../DOMKit/WebIDL/SVGAnimationElement.swift | 63 - .../DOMKit/WebIDL/SVGClipPathElement.swift | 20 - .../SVGComponentTransferFunctionElement.swift | 52 - Sources/DOMKit/WebIDL/SVGDiscardElement.swift | 12 - Sources/DOMKit/WebIDL/SVGElement.swift | 2 +- Sources/DOMKit/WebIDL/SVGFEBlendElement.swift | 58 - .../WebIDL/SVGFEColorMatrixElement.swift | 34 - .../SVGFEComponentTransferElement.swift | 16 - .../DOMKit/WebIDL/SVGFECompositeElement.swift | 54 - .../WebIDL/SVGFEConvolveMatrixElement.swift | 68 - .../WebIDL/SVGFEDiffuseLightingElement.swift | 32 - .../WebIDL/SVGFEDisplacementMapElement.swift | 42 - .../WebIDL/SVGFEDistantLightElement.swift | 20 - .../WebIDL/SVGFEDropShadowElement.swift | 37 - Sources/DOMKit/WebIDL/SVGFEFloodElement.swift | 12 - Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift | 12 - Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift | 12 - Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift | 12 - Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift | 12 - .../WebIDL/SVGFEGaussianBlurElement.swift | 41 - Sources/DOMKit/WebIDL/SVGFEImageElement.swift | 20 - Sources/DOMKit/WebIDL/SVGFEMergeElement.swift | 12 - .../DOMKit/WebIDL/SVGFEMergeNodeElement.swift | 16 - .../WebIDL/SVGFEMorphologyElement.swift | 34 - .../DOMKit/WebIDL/SVGFEOffsetElement.swift | 24 - .../WebIDL/SVGFEPointLightElement.swift | 24 - .../WebIDL/SVGFESpecularLightingElement.swift | 36 - .../DOMKit/WebIDL/SVGFESpotLightElement.swift | 44 - Sources/DOMKit/WebIDL/SVGFETileElement.swift | 16 - .../WebIDL/SVGFETurbulenceElement.swift | 48 - Sources/DOMKit/WebIDL/SVGFilterElement.swift | 36 - ...SVGFilterPrimitiveStandardAttributes.swift | 17 - Sources/DOMKit/WebIDL/SVGMPathElement.swift | 12 - Sources/DOMKit/WebIDL/SVGMaskElement.swift | 36 - Sources/DOMKit/WebIDL/SVGSVGElement.swift | 25 - Sources/DOMKit/WebIDL/SVGSetElement.swift | 12 - Sources/DOMKit/WebIDL/Sanitizer.swift | 38 - Sources/DOMKit/WebIDL/SanitizerConfig.swift | 50 - .../DOMKit/WebIDL/SaveFilePickerOptions.swift | 20 - Sources/DOMKit/WebIDL/Scheduler.swift | 18 - .../WebIDL/SchedulerPostTaskOptions.swift | 30 - Sources/DOMKit/WebIDL/Scheduling.swift | 19 - Sources/DOMKit/WebIDL/Screen.swift | 42 - Sources/DOMKit/WebIDL/ScreenIdleState.swift | 22 - Sources/DOMKit/WebIDL/ScreenOrientation.swift | 41 - .../DOMKit/WebIDL/ScriptProcessorNode.swift | 20 - .../WebIDL/ScriptingPolicyReportBody.swift | 37 - .../WebIDL/ScriptingPolicyViolationType.swift | 24 - Sources/DOMKit/WebIDL/ScrollBehavior.swift | 22 - Sources/DOMKit/WebIDL/ScrollDirection.swift | 24 - .../DOMKit/WebIDL/ScrollIntoViewOptions.swift | 25 - .../DOMKit/WebIDL/ScrollLogicalPosition.swift | 24 - Sources/DOMKit/WebIDL/ScrollOptions.swift | 20 - Sources/DOMKit/WebIDL/ScrollSetting.swift | 22 - Sources/DOMKit/WebIDL/ScrollTimeline.swift | 28 - .../WebIDL/ScrollTimelineAutoKeyword.swift | 21 - .../DOMKit/WebIDL/ScrollTimelineOffset.swift | 32 - .../DOMKit/WebIDL/ScrollTimelineOptions.swift | 30 - Sources/DOMKit/WebIDL/ScrollToOptions.swift | 25 - .../SecurePaymentConfirmationRequest.swift | 50 - .../WebIDL/SecurityPolicyViolationEvent.swift | 64 - ...urityPolicyViolationEventDisposition.swift | 22 - .../SecurityPolicyViolationEventInit.swift | 75 - Sources/DOMKit/WebIDL/Selection.swift | 116 - Sources/DOMKit/WebIDL/Sensor.swift | 46 - Sources/DOMKit/WebIDL/SensorErrorEvent.swift | 20 - .../DOMKit/WebIDL/SensorErrorEventInit.swift | 20 - Sources/DOMKit/WebIDL/SensorOptions.swift | 20 - Sources/DOMKit/WebIDL/SequenceEffect.swift | 21 - Sources/DOMKit/WebIDL/Serial.swift | 44 - .../DOMKit/WebIDL/SerialInputSignals.swift | 35 - Sources/DOMKit/WebIDL/SerialOptions.swift | 45 - .../DOMKit/WebIDL/SerialOutputSignals.swift | 30 - Sources/DOMKit/WebIDL/SerialPort.swift | 81 - Sources/DOMKit/WebIDL/SerialPortFilter.swift | 25 - Sources/DOMKit/WebIDL/SerialPortInfo.swift | 25 - .../WebIDL/SerialPortRequestOptions.swift | 20 - .../DOMKit/WebIDL/ServiceEventHandlers.swift | 22 - .../WebIDL/ServiceWorkerRegistration.swift | 52 - Sources/DOMKit/WebIDL/SetHTMLOptions.swift | 20 - Sources/DOMKit/WebIDL/ShadowRoot.swift | 2 +- Sources/DOMKit/WebIDL/ShareData.swift | 35 - .../WebIDL/SpatialNavigationDirection.swift | 24 - .../SpatialNavigationSearchOptions.swift | 25 - Sources/DOMKit/WebIDL/SpeechGrammar.swift | 22 - Sources/DOMKit/WebIDL/SpeechGrammarList.swift | 36 - Sources/DOMKit/WebIDL/SpeechRecognition.swift | 95 - .../WebIDL/SpeechRecognitionAlternative.swift | 22 - .../WebIDL/SpeechRecognitionErrorCode.swift | 28 - .../WebIDL/SpeechRecognitionErrorEvent.swift | 24 - .../SpeechRecognitionErrorEventInit.swift | 25 - .../WebIDL/SpeechRecognitionEvent.swift | 24 - .../WebIDL/SpeechRecognitionEventInit.swift | 25 - .../WebIDL/SpeechRecognitionResult.swift | 26 - .../WebIDL/SpeechRecognitionResultList.swift | 22 - Sources/DOMKit/WebIDL/SpeechSynthesis.swift | 53 - .../WebIDL/SpeechSynthesisErrorCode.swift | 32 - .../WebIDL/SpeechSynthesisErrorEvent.swift | 20 - .../SpeechSynthesisErrorEventInit.swift | 20 - .../DOMKit/WebIDL/SpeechSynthesisEvent.swift | 36 - .../WebIDL/SpeechSynthesisEventInit.swift | 40 - .../WebIDL/SpeechSynthesisUtterance.swift | 68 - .../DOMKit/WebIDL/SpeechSynthesisVoice.swift | 34 - Sources/DOMKit/WebIDL/StartInDirectory.swift | 32 - Sources/DOMKit/WebIDL/StereoPannerNode.swift | 20 - .../DOMKit/WebIDL/StereoPannerOptions.swift | 20 - Sources/DOMKit/WebIDL/StorageEstimate.swift | 25 - Sources/DOMKit/WebIDL/StorageManager.swift | 62 - .../DOMKit/WebIDL/String_or_seq_of_UUID.swift | 32 - Sources/DOMKit/WebIDL/Strings.swift | 3240 ----------------- Sources/DOMKit/WebIDL/StylePropertyMap.swift | 32 - .../WebIDL/StylePropertyMapReadOnly.swift | 38 - Sources/DOMKit/WebIDL/SubtleCrypto.swift | 172 - Sources/DOMKit/WebIDL/SyncEventInit.swift | 25 - Sources/DOMKit/WebIDL/SyncManager.swift | 38 - Sources/DOMKit/WebIDL/Table.swift | 37 - Sources/DOMKit/WebIDL/TableDescriptor.swift | 30 - Sources/DOMKit/WebIDL/TableKind.swift | 22 - .../DOMKit/WebIDL/TaskAttributionTiming.swift | 33 - Sources/DOMKit/WebIDL/TaskController.swift | 21 - .../DOMKit/WebIDL/TaskControllerInit.swift | 20 - Sources/DOMKit/WebIDL/TaskPriority.swift | 23 - .../WebIDL/TaskPriorityChangeEvent.swift | 20 - .../WebIDL/TaskPriorityChangeEventInit.swift | 20 - Sources/DOMKit/WebIDL/TaskSignal.swift | 20 - Sources/DOMKit/WebIDL/TestUtils.swift | 22 - Sources/DOMKit/WebIDL/TexImageSource.swift | 67 - Sources/DOMKit/WebIDL/Text.swift | 2 +- Sources/DOMKit/WebIDL/TextDecodeOptions.swift | 20 - Sources/DOMKit/WebIDL/TextDecoder.swift | 23 - Sources/DOMKit/WebIDL/TextDecoderCommon.swift | 13 - .../DOMKit/WebIDL/TextDecoderOptions.swift | 25 - Sources/DOMKit/WebIDL/TextDecoderStream.swift | 18 - Sources/DOMKit/WebIDL/TextDetector.swift | 30 - Sources/DOMKit/WebIDL/TextEncoder.swift | 28 - Sources/DOMKit/WebIDL/TextEncoderCommon.swift | 9 - .../WebIDL/TextEncoderEncodeIntoResult.swift | 25 - Sources/DOMKit/WebIDL/TextEncoderStream.swift | 18 - Sources/DOMKit/WebIDL/TextFormat.swift | 46 - Sources/DOMKit/WebIDL/TextFormatInit.swift | 50 - .../DOMKit/WebIDL/TextFormatUpdateEvent.swift | 21 - .../WebIDL/TextFormatUpdateEventInit.swift | 20 - Sources/DOMKit/WebIDL/TextUpdateEvent.swift | 44 - .../DOMKit/WebIDL/TextUpdateEventInit.swift | 50 - Sources/DOMKit/WebIDL/TimeEvent.swift | 25 - Sources/DOMKit/WebIDL/TimerHandler.swift | 10 +- Sources/DOMKit/WebIDL/TokenBinding.swift | 25 - .../DOMKit/WebIDL/TokenBindingStatus.swift | 22 - Sources/DOMKit/WebIDL/Touch.swift | 78 - Sources/DOMKit/WebIDL/TouchEvent.swift | 44 - Sources/DOMKit/WebIDL/TouchEventInit.swift | 30 - Sources/DOMKit/WebIDL/TouchInit.swift | 90 - Sources/DOMKit/WebIDL/TouchList.swift | 22 - Sources/DOMKit/WebIDL/TouchType.swift | 22 - .../WebIDL/TransactionAutomationMode.swift | 23 - Sources/DOMKit/WebIDL/TransferFunction.swift | 23 - Sources/DOMKit/WebIDL/TransitionEvent.swift | 28 - .../DOMKit/WebIDL/TransitionEventInit.swift | 30 - Sources/DOMKit/WebIDL/TrustedHTML.swift | 28 - Sources/DOMKit/WebIDL/TrustedScript.swift | 28 - Sources/DOMKit/WebIDL/TrustedScriptURL.swift | 28 - Sources/DOMKit/WebIDL/TrustedType.swift | 39 - Sources/DOMKit/WebIDL/TrustedTypePolicy.swift | 33 - .../WebIDL/TrustedTypePolicyFactory.swift | 53 - Sources/DOMKit/WebIDL/Typedefs.swift | 117 +- Sources/DOMKit/WebIDL/UADataValues.swift | 65 - Sources/DOMKit/WebIDL/UALowEntropyJSON.swift | 30 - Sources/DOMKit/WebIDL/UIEvent.swift | 4 - Sources/DOMKit/WebIDL/UIEventInit.swift | 7 +- Sources/DOMKit/WebIDL/URLPattern.swift | 60 - .../WebIDL/URLPatternComponentResult.swift | 25 - Sources/DOMKit/WebIDL/URLPatternInit.swift | 60 - Sources/DOMKit/WebIDL/URLPatternInput.swift | 32 - Sources/DOMKit/WebIDL/URLPatternResult.swift | 60 - Sources/DOMKit/WebIDL/USB.swift | 44 - .../DOMKit/WebIDL/USBAlternateInterface.swift | 42 - Sources/DOMKit/WebIDL/USBConfiguration.swift | 30 - .../DOMKit/WebIDL/USBConnectionEvent.swift | 20 - .../WebIDL/USBConnectionEventInit.swift | 20 - .../WebIDL/USBControlTransferParameters.swift | 40 - Sources/DOMKit/WebIDL/USBDevice.swift | 262 -- Sources/DOMKit/WebIDL/USBDeviceFilter.swift | 45 - .../WebIDL/USBDeviceRequestOptions.swift | 20 - Sources/DOMKit/WebIDL/USBDirection.swift | 22 - Sources/DOMKit/WebIDL/USBEndpoint.swift | 34 - Sources/DOMKit/WebIDL/USBEndpointType.swift | 23 - .../DOMKit/WebIDL/USBInTransferResult.swift | 26 - Sources/DOMKit/WebIDL/USBInterface.swift | 34 - .../USBIsochronousInTransferPacket.swift | 26 - .../USBIsochronousInTransferResult.swift | 26 - .../USBIsochronousOutTransferPacket.swift | 26 - .../USBIsochronousOutTransferResult.swift | 22 - .../DOMKit/WebIDL/USBOutTransferResult.swift | 26 - .../WebIDL/USBPermissionDescriptor.swift | 20 - .../DOMKit/WebIDL/USBPermissionResult.swift | 16 - .../DOMKit/WebIDL/USBPermissionStorage.swift | 20 - Sources/DOMKit/WebIDL/USBRecipient.swift | 24 - Sources/DOMKit/WebIDL/USBRequestType.swift | 23 - Sources/DOMKit/WebIDL/USBTransferStatus.swift | 23 - Sources/DOMKit/WebIDL/Uint32List.swift | 32 - .../WebIDL/UncalibratedMagnetometer.swift | 40 - ...ncalibratedMagnetometerReadingValues.swift | 45 - Sources/DOMKit/WebIDL/UserIdleState.swift | 22 - .../WebIDL/UserVerificationRequirement.swift | 23 - Sources/DOMKit/WebIDL/VTTCue.swift | 61 - Sources/DOMKit/WebIDL/VTTRegion.swift | 50 - Sources/DOMKit/WebIDL/ValueEvent.swift | 20 - Sources/DOMKit/WebIDL/ValueEventInit.swift | 20 - Sources/DOMKit/WebIDL/ValueType.swift | 27 - Sources/DOMKit/WebIDL/VibratePattern.swift | 32 - .../DOMKit/WebIDL/VideoConfiguration.swift | 65 - .../DOMKit/WebIDL/VideoFrameMetadata.swift | 65 - .../DOMKit/WebIDL/VideoPlaybackQuality.swift | 30 - Sources/DOMKit/WebIDL/VirtualKeyboard.swift | 34 - Sources/DOMKit/WebIDL/VisualViewport.swift | 52 - ...BGL_blend_equation_advanced_coherent.swift | 44 - .../WebIDL/WEBGL_color_buffer_float.swift | 20 - .../WEBGL_compressed_texture_astc.swift | 75 - .../WebIDL/WEBGL_compressed_texture_etc.swift | 34 - .../WEBGL_compressed_texture_etc1.swift | 16 - .../WEBGL_compressed_texture_pvrtc.swift | 22 - .../WEBGL_compressed_texture_s3tc.swift | 22 - .../WEBGL_compressed_texture_s3tc_srgb.swift | 22 - .../WebIDL/WEBGL_debug_renderer_info.swift | 18 - .../DOMKit/WebIDL/WEBGL_debug_shaders.swift | 19 - .../DOMKit/WebIDL/WEBGL_depth_texture.swift | 16 - .../DOMKit/WebIDL/WEBGL_draw_buffers.swift | 87 - ..._instanced_base_vertex_base_instance.swift | 31 - .../DOMKit/WebIDL/WEBGL_lose_context.swift | 24 - Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift | 64 - ..._instanced_base_vertex_base_instance.swift | 47 - Sources/DOMKit/WebIDL/WakeLock.swift | 26 - Sources/DOMKit/WebIDL/WakeLockSentinel.swift | 36 - Sources/DOMKit/WebIDL/WakeLockType.swift | 21 - .../WebIDL/WatchAdvertisementsOptions.swift | 20 - Sources/DOMKit/WebIDL/WaveShaperNode.swift | 24 - Sources/DOMKit/WebIDL/WaveShaperOptions.swift | 25 - Sources/DOMKit/WebIDL/WebAssembly.swift | 75 - .../WebAssemblyInstantiatedSource.swift | 25 - .../WebIDL/WebGL2RenderingContext.swift | 14 - .../WebIDL/WebGL2RenderingContextBase.swift | 1162 ------ .../WebGL2RenderingContextOverloads.swift | 317 -- Sources/DOMKit/WebIDL/WebGLActiveInfo.swift | 26 - Sources/DOMKit/WebIDL/WebGLBuffer.swift | 12 - .../WebIDL/WebGLContextAttributes.swift | 65 - 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/WebGLQuery.swift | 12 - Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift | 12 - .../DOMKit/WebIDL/WebGLRenderingContext.swift | 14 - .../WebIDL/WebGLRenderingContextBase.swift | 1229 ------- .../WebGLRenderingContextOverloads.swift | 165 - Sources/DOMKit/WebIDL/WebGLSampler.swift | 12 - Sources/DOMKit/WebIDL/WebGLShader.swift | 12 - .../WebIDL/WebGLShaderPrecisionFormat.swift | 26 - Sources/DOMKit/WebIDL/WebGLSync.swift | 12 - Sources/DOMKit/WebIDL/WebGLTexture.swift | 12 - .../DOMKit/WebIDL/WebGLTimerQueryEXT.swift | 12 - .../WebIDL/WebGLTransformFeedback.swift | 12 - .../DOMKit/WebIDL/WebGLUniformLocation.swift | 14 - .../WebIDL/WebGLVertexArrayObject.swift | 12 - .../WebIDL/WebGLVertexArrayObjectOES.swift | 12 - Sources/DOMKit/WebIDL/WebSocket.swift | 74 - Sources/DOMKit/WebIDL/WebTransport.swift | 79 - .../WebTransportBidirectionalStream.swift | 22 - .../DOMKit/WebIDL/WebTransportCloseInfo.swift | 25 - .../WebTransportDatagramDuplexStream.swift | 42 - Sources/DOMKit/WebIDL/WebTransportError.swift | 24 - .../DOMKit/WebIDL/WebTransportErrorInit.swift | 25 - .../WebIDL/WebTransportErrorSource.swift | 22 - Sources/DOMKit/WebIDL/WebTransportHash.swift | 25 - .../DOMKit/WebIDL/WebTransportOptions.swift | 25 - Sources/DOMKit/WebIDL/WebTransportStats.swift | 75 - .../DOMKit/WebIDL/WellKnownDirectory.swift | 26 - Sources/DOMKit/WebIDL/Window.swift | 232 -- .../DOMKit/WebIDL/WindowControlsOverlay.swift | 25 - ...owControlsOverlayGeometryChangeEvent.swift | 24 - ...ntrolsOverlayGeometryChangeEventInit.swift | 25 - .../DOMKit/WebIDL/WindowEventHandlers.swift | 15 - .../WebIDL/WindowOrWorkerGlobalScope.swift | 12 +- Sources/DOMKit/WebIDL/WorkletAnimation.swift | 20 - Sources/DOMKit/WebIDL/WriteCommandType.swift | 23 - Sources/DOMKit/WebIDL/WriteParams.swift | 35 - .../WebIDL/XMLHttpRequestBodyInit.swift | 10 +- Sources/DOMKit/WebIDL/XMLSerializer.swift | 23 - Sources/DOMKit/WebIDL/XRAnchor.swift | 23 - Sources/DOMKit/WebIDL/XRAnchorSet.swift | 16 - .../WebIDL/XRBoundedReferenceSpace.swift | 16 - .../DOMKit/WebIDL/XRCPUDepthInformation.swift | 21 - .../DOMKit/WebIDL/XRCompositionLayer.swift | 37 - Sources/DOMKit/WebIDL/XRCubeLayer.swift | 24 - Sources/DOMKit/WebIDL/XRCubeLayerInit.swift | 20 - Sources/DOMKit/WebIDL/XRCylinderLayer.swift | 36 - .../DOMKit/WebIDL/XRCylinderLayerInit.swift | 40 - Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift | 20 - Sources/DOMKit/WebIDL/XRDOMOverlayState.swift | 20 - Sources/DOMKit/WebIDL/XRDOMOverlayType.swift | 23 - Sources/DOMKit/WebIDL/XRDepthDataFormat.swift | 22 - .../DOMKit/WebIDL/XRDepthInformation.swift | 30 - Sources/DOMKit/WebIDL/XRDepthStateInit.swift | 25 - Sources/DOMKit/WebIDL/XRDepthUsage.swift | 22 - .../WebIDL/XREnvironmentBlendMode.swift | 23 - Sources/DOMKit/WebIDL/XREquirectLayer.swift | 40 - .../DOMKit/WebIDL/XREquirectLayerInit.swift | 45 - Sources/DOMKit/WebIDL/XREye.swift | 23 - Sources/DOMKit/WebIDL/XRFrame.swift | 83 - Sources/DOMKit/WebIDL/XRHand.swift | 28 - Sources/DOMKit/WebIDL/XRHandJoint.swift | 45 - Sources/DOMKit/WebIDL/XRHandedness.swift | 23 - .../DOMKit/WebIDL/XRHitTestOptionsInit.swift | 30 - Sources/DOMKit/WebIDL/XRHitTestResult.swift | 31 - Sources/DOMKit/WebIDL/XRHitTestSource.swift | 19 - .../WebIDL/XRHitTestTrackableType.swift | 23 - Sources/DOMKit/WebIDL/XRInputSource.swift | 42 - .../DOMKit/WebIDL/XRInputSourceArray.swift | 27 - .../DOMKit/WebIDL/XRInputSourceEvent.swift | 24 - .../WebIDL/XRInputSourceEventInit.swift | 25 - .../WebIDL/XRInputSourcesChangeEvent.swift | 28 - .../XRInputSourcesChangeEventInit.swift | 30 - Sources/DOMKit/WebIDL/XRInteractionMode.swift | 22 - Sources/DOMKit/WebIDL/XRJointPose.swift | 16 - Sources/DOMKit/WebIDL/XRJointSpace.swift | 16 - Sources/DOMKit/WebIDL/XRLayer.swift | 12 - Sources/DOMKit/WebIDL/XRLayerEvent.swift | 20 - Sources/DOMKit/WebIDL/XRLayerEventInit.swift | 20 - Sources/DOMKit/WebIDL/XRLayerInit.swift | 55 - Sources/DOMKit/WebIDL/XRLayerLayout.swift | 25 - Sources/DOMKit/WebIDL/XRLightEstimate.swift | 26 - Sources/DOMKit/WebIDL/XRLightProbe.swift | 20 - Sources/DOMKit/WebIDL/XRLightProbeInit.swift | 20 - Sources/DOMKit/WebIDL/XRMediaBinding.swift | 33 - .../WebIDL/XRMediaCylinderLayerInit.swift | 35 - .../WebIDL/XRMediaEquirectLayerInit.swift | 40 - Sources/DOMKit/WebIDL/XRMediaLayerInit.swift | 30 - .../DOMKit/WebIDL/XRMediaQuadLayerInit.swift | 30 - .../WebIDL/XRPermissionDescriptor.swift | 30 - .../DOMKit/WebIDL/XRPermissionStatus.swift | 16 - Sources/DOMKit/WebIDL/XRPose.swift | 30 - Sources/DOMKit/WebIDL/XRProjectionLayer.swift | 32 - .../DOMKit/WebIDL/XRProjectionLayerInit.swift | 35 - Sources/DOMKit/WebIDL/XRQuadLayer.swift | 32 - Sources/DOMKit/WebIDL/XRQuadLayerInit.swift | 35 - Sources/DOMKit/WebIDL/XRRay.swift | 34 - .../DOMKit/WebIDL/XRRayDirectionInit.swift | 35 - Sources/DOMKit/WebIDL/XRReferenceSpace.swift | 21 - .../DOMKit/WebIDL/XRReferenceSpaceEvent.swift | 24 - .../WebIDL/XRReferenceSpaceEventInit.swift | 25 - .../DOMKit/WebIDL/XRReferenceSpaceType.swift | 25 - .../DOMKit/WebIDL/XRReflectionFormat.swift | 22 - Sources/DOMKit/WebIDL/XRRenderState.swift | 34 - Sources/DOMKit/WebIDL/XRRenderStateInit.swift | 40 - Sources/DOMKit/WebIDL/XRRigidTransform.swift | 34 - Sources/DOMKit/WebIDL/XRSession.swift | 180 - Sources/DOMKit/WebIDL/XRSessionEvent.swift | 20 - .../DOMKit/WebIDL/XRSessionEventInit.swift | 20 - Sources/DOMKit/WebIDL/XRSessionInit.swift | 35 - Sources/DOMKit/WebIDL/XRSessionMode.swift | 23 - ...SessionSupportedPermissionDescriptor.swift | 20 - Sources/DOMKit/WebIDL/XRSpace.swift | 12 - Sources/DOMKit/WebIDL/XRSubImage.swift | 18 - Sources/DOMKit/WebIDL/XRSystem.swift | 40 - Sources/DOMKit/WebIDL/XRTargetRayMode.swift | 23 - Sources/DOMKit/WebIDL/XRTextureType.swift | 22 - .../XRTransientInputHitTestOptionsInit.swift | 30 - .../XRTransientInputHitTestResult.swift | 22 - .../XRTransientInputHitTestSource.swift | 19 - Sources/DOMKit/WebIDL/XRView.swift | 39 - Sources/DOMKit/WebIDL/XRViewerPose.swift | 16 - Sources/DOMKit/WebIDL/XRViewport.swift | 30 - Sources/DOMKit/WebIDL/XRVisibilityState.swift | 23 - Sources/DOMKit/WebIDL/XRWebGLBinding.swift | 71 - .../WebIDL/XRWebGLDepthInformation.swift | 16 - Sources/DOMKit/WebIDL/XRWebGLLayer.swift | 50 - Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift | 45 - .../WebIDL/XRWebGLRenderingContext.swift | 32 - Sources/DOMKit/WebIDL/XRWebGLSubImage.swift | 32 - Sources/DOMKit/WebIDL/console.swift | 105 - Sources/WebIDLToSwift/MergeDeclarations.swift | 2 +- parse-idl/parse-all.js | 4 +- 1607 files changed, 140 insertions(+), 56520 deletions(-) delete mode 100644 Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift delete mode 100644 Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift delete mode 100644 Sources/DOMKit/WebIDL/Accelerometer.swift delete mode 100644 Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift delete mode 100644 Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AesCbcParams.swift delete mode 100644 Sources/DOMKit/WebIDL/AesCtrParams.swift delete mode 100644 Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift delete mode 100644 Sources/DOMKit/WebIDL/AesGcmParams.swift delete mode 100644 Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift delete mode 100644 Sources/DOMKit/WebIDL/AesKeyGenParams.swift delete mode 100644 Sources/DOMKit/WebIDL/Algorithm.swift delete mode 100644 Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift delete mode 100644 Sources/DOMKit/WebIDL/AlignSetting.swift delete mode 100644 Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift delete mode 100644 Sources/DOMKit/WebIDL/AllowedUSBDevice.swift delete mode 100644 Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/AmbientLightSensor.swift delete mode 100644 Sources/DOMKit/WebIDL/AnalyserNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AnalyserOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift delete mode 100644 Sources/DOMKit/WebIDL/AnimationEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/AnimationEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/AnimationNodeList.swift delete mode 100644 Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift delete mode 100644 Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift delete mode 100644 Sources/DOMKit/WebIDL/AttributionReporting.swift delete mode 100644 Sources/DOMKit/WebIDL/AttributionSourceParams.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioBuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioBufferOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioContext.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioContextOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioContextState.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioDestinationNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioListener.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioNodeOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioOutputOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioParam.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioParamDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioParamMap.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioProcessingEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioTimestamp.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioWorklet.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioWorkletNode.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticatorResponse.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift delete mode 100644 Sources/DOMKit/WebIDL/AuthenticatorTransport.swift delete mode 100644 Sources/DOMKit/WebIDL/AutoKeyword.swift delete mode 100644 Sources/DOMKit/WebIDL/AutomationRate.swift delete mode 100644 Sources/DOMKit/WebIDL/AutoplayPolicy.swift delete mode 100644 Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchManager.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchResult.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/BarcodeDetector.swift delete mode 100644 Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/BarcodeFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/BaseAudioContext.swift delete mode 100644 Sources/DOMKit/WebIDL/Baseline.swift delete mode 100644 Sources/DOMKit/WebIDL/BatteryManager.swift delete mode 100644 Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/BinaryData_or_String.swift delete mode 100644 Sources/DOMKit/WebIDL/BinaryType.swift delete mode 100644 Sources/DOMKit/WebIDL/BiquadFilterNode.swift delete mode 100644 Sources/DOMKit/WebIDL/BiquadFilterOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/BiquadFilterType.swift delete mode 100644 Sources/DOMKit/WebIDL/BlockFragmentationType.swift delete mode 100644 Sources/DOMKit/WebIDL/Bluetooth.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothDevice.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift delete mode 100644 Sources/DOMKit/WebIDL/BluetoothUUID.swift delete mode 100644 Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift delete mode 100644 Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/BoxQuadOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/BreakType.swift delete mode 100644 Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift rename Sources/DOMKit/WebIDL/{BinaryData.swift => BufferSource.swift} (78%) delete mode 100644 Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift delete mode 100644 Sources/DOMKit/WebIDL/CSPViolationReportBody.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSAnimation.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSBoxType.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSColor.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSColorRGBComp.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSColorValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSConditionRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSContainerRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSFontFaceRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSHSL.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSHWB.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSImageValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSKeyframeRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSKeyframesRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSKeywordValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSKeywordish.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSLCH.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSLab.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMathClamp.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMathInvert.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMathMax.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMathMin.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMathNegate.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMathOperator.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMathProduct.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMathSum.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMathValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMatrixComponent.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMediaRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSNestingRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSNumberish.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSNumericArray.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSNumericBaseType.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSNumericType.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSNumericValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSOKLCH.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSOKLab.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSParserAtRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSParserBlock.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSParserDeclaration.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSParserFunction.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSParserOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSParserRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSParserValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSPerspective.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSPropertyRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSRGB.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSRotate.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSScale.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSSkew.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSSkewX.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSSkewY.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSStringSource.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSStyleValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSSupportsRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSToken.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSTransformComponent.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSTransformValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSTransition.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSTranslate.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSUnitValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSUnparsedValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSViewportRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift delete mode 100644 Sources/DOMKit/WebIDL/CaretPosition.swift delete mode 100644 Sources/DOMKit/WebIDL/ChannelCountMode.swift delete mode 100644 Sources/DOMKit/WebIDL/ChannelInterpretation.swift delete mode 100644 Sources/DOMKit/WebIDL/ChannelMergerNode.swift delete mode 100644 Sources/DOMKit/WebIDL/ChannelMergerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ChannelSplitterNode.swift delete mode 100644 Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift delete mode 100644 Sources/DOMKit/WebIDL/ChildDisplayType.swift delete mode 100644 Sources/DOMKit/WebIDL/ClientLifecycleState.swift delete mode 100644 Sources/DOMKit/WebIDL/Clipboard.swift delete mode 100644 Sources/DOMKit/WebIDL/ClipboardEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/ClipboardEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/ClipboardItem.swift delete mode 100644 Sources/DOMKit/WebIDL/ClipboardItemOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/CloseEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/CloseEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/CloseWatcher.swift delete mode 100644 Sources/DOMKit/WebIDL/CloseWatcherOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift delete mode 100644 Sources/DOMKit/WebIDL/CollectedClientData.swift delete mode 100644 Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift delete mode 100644 Sources/DOMKit/WebIDL/ColorGamut.swift delete mode 100644 Sources/DOMKit/WebIDL/ColorSelectionOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ColorSelectionResult.swift delete mode 100644 Sources/DOMKit/WebIDL/CompressionStream.swift delete mode 100644 Sources/DOMKit/WebIDL/ComputePressureFactor.swift delete mode 100644 Sources/DOMKit/WebIDL/ComputePressureObserver.swift delete mode 100644 Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ComputePressureRecord.swift delete mode 100644 Sources/DOMKit/WebIDL/ComputePressureSource.swift delete mode 100644 Sources/DOMKit/WebIDL/ComputePressureState.swift delete mode 100644 Sources/DOMKit/WebIDL/ConnectionType.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstantSourceNode.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstantSourceOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainPoint2D.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/ContactAddress.swift delete mode 100644 Sources/DOMKit/WebIDL/ContactInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/ContactProperty.swift delete mode 100644 Sources/DOMKit/WebIDL/ContactsManager.swift delete mode 100644 Sources/DOMKit/WebIDL/ContactsSelectOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ContentCategory.swift delete mode 100644 Sources/DOMKit/WebIDL/ContentDescription.swift delete mode 100644 Sources/DOMKit/WebIDL/ContentIndex.swift delete mode 100644 Sources/DOMKit/WebIDL/ContentIndexEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ConvolverNode.swift delete mode 100644 Sources/DOMKit/WebIDL/ConvolverOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/CookieChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/CookieChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/CookieInit.swift delete mode 100644 Sources/DOMKit/WebIDL/CookieListItem.swift delete mode 100644 Sources/DOMKit/WebIDL/CookieSameSite.swift delete mode 100644 Sources/DOMKit/WebIDL/CookieStore.swift delete mode 100644 Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/CookieStoreManager.swift delete mode 100644 Sources/DOMKit/WebIDL/CrashReportBody.swift delete mode 100644 Sources/DOMKit/WebIDL/Credential.swift delete mode 100644 Sources/DOMKit/WebIDL/CredentialCreationOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/CredentialData.swift delete mode 100644 Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift delete mode 100644 Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift delete mode 100644 Sources/DOMKit/WebIDL/CredentialRequestOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/CredentialUserData.swift delete mode 100644 Sources/DOMKit/WebIDL/CredentialsContainer.swift delete mode 100644 Sources/DOMKit/WebIDL/CropTarget.swift delete mode 100644 Sources/DOMKit/WebIDL/Crypto.swift delete mode 100644 Sources/DOMKit/WebIDL/CryptoKey.swift delete mode 100644 Sources/DOMKit/WebIDL/CryptoKeyID.swift delete mode 100644 Sources/DOMKit/WebIDL/CryptoKeyPair.swift delete mode 100644 Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift delete mode 100644 Sources/DOMKit/WebIDL/CustomStateSet.swift delete mode 100644 Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift delete mode 100644 Sources/DOMKit/WebIDL/DataCue.swift delete mode 100644 Sources/DOMKit/WebIDL/DecompressionStream.swift delete mode 100644 Sources/DOMKit/WebIDL/DelayNode.swift delete mode 100644 Sources/DOMKit/WebIDL/DelayOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/DeprecationReportBody.swift delete mode 100644 Sources/DOMKit/WebIDL/DetectedBarcode.swift delete mode 100644 Sources/DOMKit/WebIDL/DetectedFace.swift delete mode 100644 Sources/DOMKit/WebIDL/DetectedText.swift delete mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift delete mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift delete mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift delete mode 100644 Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift delete mode 100644 Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/DevicePosture.swift delete mode 100644 Sources/DOMKit/WebIDL/DevicePostureType.swift delete mode 100644 Sources/DOMKit/WebIDL/DigitalGoodsService.swift delete mode 100644 Sources/DOMKit/WebIDL/DirectionSetting.swift delete mode 100644 Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift delete mode 100644 Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift delete mode 100644 Sources/DOMKit/WebIDL/DistanceModelType.swift delete mode 100644 Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift delete mode 100644 Sources/DOMKit/WebIDL/Document_or_Element.swift delete mode 100644 Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift delete mode 100644 Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift delete mode 100644 Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_blend_minmax.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_float_blend.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_frag_depth.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_sRGB.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift delete mode 100644 Sources/DOMKit/WebIDL/EXT_texture_norm16.swift delete mode 100644 Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift delete mode 100644 Sources/DOMKit/WebIDL/EcKeyGenParams.swift delete mode 100644 Sources/DOMKit/WebIDL/EcKeyImportParams.swift delete mode 100644 Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift delete mode 100644 Sources/DOMKit/WebIDL/EcdsaParams.swift delete mode 100644 Sources/DOMKit/WebIDL/Edge.swift delete mode 100644 Sources/DOMKit/WebIDL/EditContext.swift delete mode 100644 Sources/DOMKit/WebIDL/EditContextInit.swift delete mode 100644 Sources/DOMKit/WebIDL/EffectiveConnectionType.swift delete mode 100644 Sources/DOMKit/WebIDL/ElementBasedOffset.swift delete mode 100644 Sources/DOMKit/WebIDL/EventCounts.swift delete mode 100644 Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/EyeDropper.swift delete mode 100644 Sources/DOMKit/WebIDL/FaceDetector.swift delete mode 100644 Sources/DOMKit/WebIDL/FaceDetectorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/FederatedCredential.swift delete mode 100644 Sources/DOMKit/WebIDL/FederatedCredentialInit.swift delete mode 100644 Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/FetchPriority.swift delete mode 100644 Sources/DOMKit/WebIDL/FilePickerAcceptType.swift delete mode 100644 Sources/DOMKit/WebIDL/FilePickerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystem.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemFileEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemFileHandle.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemFlags.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemHandle.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemHandleKind.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift delete mode 100644 Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift delete mode 100644 Sources/DOMKit/WebIDL/FillLightMode.swift delete mode 100644 Sources/DOMKit/WebIDL/Float32List.swift delete mode 100644 Sources/DOMKit/WebIDL/FlowControlType.swift delete mode 100644 Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift delete mode 100644 Sources/DOMKit/WebIDL/FocusableAreasOption.swift delete mode 100644 Sources/DOMKit/WebIDL/Font.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFace.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceDescriptors.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceFeatures.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFacePalette.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFacePalettes.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceSet.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceSource.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift delete mode 100644 Sources/DOMKit/WebIDL/FontFaceVariations.swift delete mode 100644 Sources/DOMKit/WebIDL/FontManager.swift delete mode 100644 Sources/DOMKit/WebIDL/FontMetadata.swift delete mode 100644 Sources/DOMKit/WebIDL/FontMetrics.swift delete mode 100644 Sources/DOMKit/WebIDL/FragmentDirective.swift delete mode 100644 Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift delete mode 100644 Sources/DOMKit/WebIDL/FullscreenOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/GPU.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUAdapter.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUAddressMode.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBindGroup.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBindingResource.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBlendComponent.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBlendFactor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBlendOperation.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBlendState.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBufferBinding.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBufferBindingType.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBufferUsage.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCanvasContext.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUColor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUColorDict.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUColorTargetState.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUColorWrite.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCommandBuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCommandBufferDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCommandEncoder.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCommandEncoderDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCommandsMixin.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCompareFunction.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCompilationInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCompilationMessage.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUComputePipeline.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUCullMode.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUDepthStencilState.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUDevice.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUError.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUErrorFilter.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUExtent3D.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUExtent3DDict.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUExternalTexture.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUExternalTextureBindingLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUFeatureName.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUFilterMode.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUFragmentState.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUFrontFace.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUImageDataLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUIndexFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/GPULoadOp.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUMapMode.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUMultisampleState.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUObjectBase.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUOrigin2D.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUOrigin3D.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUPipelineBase.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUPipelineLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUPowerPreference.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUPrimitiveState.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUProgrammableStage.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUQuerySet.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUQueryType.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUQueue.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUQueueDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderBundle.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderBundleDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderPassLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderPipeline.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUSampler.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUShaderModule.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUShaderStage.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUStencilFaceState.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUStencilOperation.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUStoreOp.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUSupportedLimits.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTexture.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureAspect.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureDimension.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureSampleType.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureUsage.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureView.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUValidationError.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUVertexAttribute.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUVertexFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUVertexState.swift delete mode 100644 Sources/DOMKit/WebIDL/GPUVertexStepMode.swift delete mode 100644 Sources/DOMKit/WebIDL/GainNode.swift delete mode 100644 Sources/DOMKit/WebIDL/GainOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/Gamepad.swift delete mode 100644 Sources/DOMKit/WebIDL/GamepadButton.swift delete mode 100644 Sources/DOMKit/WebIDL/GamepadEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/GamepadEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/GamepadHand.swift delete mode 100644 Sources/DOMKit/WebIDL/GamepadHapticActuator.swift delete mode 100644 Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift delete mode 100644 Sources/DOMKit/WebIDL/GamepadMappingType.swift delete mode 100644 Sources/DOMKit/WebIDL/GamepadPose.swift delete mode 100644 Sources/DOMKit/WebIDL/GamepadTouch.swift delete mode 100644 Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/Geolocation.swift delete mode 100644 Sources/DOMKit/WebIDL/GeolocationCoordinates.swift delete mode 100644 Sources/DOMKit/WebIDL/GeolocationPosition.swift delete mode 100644 Sources/DOMKit/WebIDL/GeolocationPositionError.swift delete mode 100644 Sources/DOMKit/WebIDL/GeolocationReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/GeolocationSensor.swift delete mode 100644 Sources/DOMKit/WebIDL/GeolocationSensorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/GeolocationSensorReading.swift delete mode 100644 Sources/DOMKit/WebIDL/GeometryNode.swift delete mode 100644 Sources/DOMKit/WebIDL/GeometryUtils.swift delete mode 100644 Sources/DOMKit/WebIDL/GetNotificationOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/Global.swift delete mode 100644 Sources/DOMKit/WebIDL/GlobalDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/GravityReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/GravitySensor.swift delete mode 100644 Sources/DOMKit/WebIDL/GroupEffect.swift delete mode 100644 Sources/DOMKit/WebIDL/Gyroscope.swift delete mode 100644 Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift delete mode 100644 Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/HID.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDCollectionInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDConnectionEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDDevice.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDDeviceFilter.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDInputReportEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDReportInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDReportItem.swift delete mode 100644 Sources/DOMKit/WebIDL/HIDUnitSystem.swift delete mode 100644 Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift delete mode 100644 Sources/DOMKit/WebIDL/HTMLPortalElement.swift delete mode 100644 Sources/DOMKit/WebIDL/HdrMetadataType.swift delete mode 100644 Sources/DOMKit/WebIDL/Highlight.swift delete mode 100644 Sources/DOMKit/WebIDL/HighlightRegistry.swift delete mode 100644 Sources/DOMKit/WebIDL/HighlightType.swift delete mode 100644 Sources/DOMKit/WebIDL/HkdfParams.swift delete mode 100644 Sources/DOMKit/WebIDL/HmacImportParams.swift delete mode 100644 Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift delete mode 100644 Sources/DOMKit/WebIDL/HmacKeyGenParams.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBCursor.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBCursorDirection.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBCursorWithValue.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBDatabase.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBFactory.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBIndex.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBIndexParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBKeyRange.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBObjectStore.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBRequest.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBRequestReadyState.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBTransaction.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBTransactionDurability.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBTransactionMode.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBTransactionOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/IIRFilterNode.swift delete mode 100644 Sources/DOMKit/WebIDL/IIRFilterOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/IdleDeadline.swift delete mode 100644 Sources/DOMKit/WebIDL/IdleDetector.swift delete mode 100644 Sources/DOMKit/WebIDL/IdleOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/IdleRequestOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageCapture.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageObject.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageResource.swift delete mode 100644 Sources/DOMKit/WebIDL/ImportExportKind.swift delete mode 100644 Sources/DOMKit/WebIDL/Ink.swift delete mode 100644 Sources/DOMKit/WebIDL/InkPresenter.swift delete mode 100644 Sources/DOMKit/WebIDL/InkPresenterParam.swift delete mode 100644 Sources/DOMKit/WebIDL/InkTrailStyle.swift delete mode 100644 Sources/DOMKit/WebIDL/InnerHTML.swift delete mode 100644 Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift delete mode 100644 Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift delete mode 100644 Sources/DOMKit/WebIDL/Instance.swift delete mode 100644 Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift delete mode 100644 Sources/DOMKit/WebIDL/Int32List.swift delete mode 100644 Sources/DOMKit/WebIDL/InteractionCounts.swift delete mode 100644 Sources/DOMKit/WebIDL/IntersectionObserver.swift delete mode 100644 Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift delete mode 100644 Sources/DOMKit/WebIDL/IntersectionObserverInit.swift delete mode 100644 Sources/DOMKit/WebIDL/InterventionReportBody.swift delete mode 100644 Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/IsInputPendingOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/IsVisibleOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ItemDetails.swift delete mode 100644 Sources/DOMKit/WebIDL/ItemType.swift delete mode 100644 Sources/DOMKit/WebIDL/IterationCompositeOperation.swift delete mode 100644 Sources/DOMKit/WebIDL/JsonWebKey.swift delete mode 100644 Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift delete mode 100644 Sources/DOMKit/WebIDL/KeyAlgorithm.swift delete mode 100644 Sources/DOMKit/WebIDL/KeyFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/KeyType.swift delete mode 100644 Sources/DOMKit/WebIDL/KeyUsage.swift delete mode 100644 Sources/DOMKit/WebIDL/Keyboard.swift delete mode 100644 Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift delete mode 100644 Sources/DOMKit/WebIDL/Landmark.swift delete mode 100644 Sources/DOMKit/WebIDL/LandmarkType.swift delete mode 100644 Sources/DOMKit/WebIDL/LargeBlobSupport.swift delete mode 100644 Sources/DOMKit/WebIDL/LargestContentfulPaint.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutShift.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift delete mode 100644 Sources/DOMKit/WebIDL/LayoutSizingMode.swift delete mode 100644 Sources/DOMKit/WebIDL/LineAlignSetting.swift delete mode 100644 Sources/DOMKit/WebIDL/LineAndPositionSetting.swift delete mode 100644 Sources/DOMKit/WebIDL/LinearAccelerationReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift delete mode 100644 Sources/DOMKit/WebIDL/Lock.swift delete mode 100644 Sources/DOMKit/WebIDL/LockInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/LockManager.swift delete mode 100644 Sources/DOMKit/WebIDL/LockManagerSnapshot.swift delete mode 100644 Sources/DOMKit/WebIDL/LockMode.swift delete mode 100644 Sources/DOMKit/WebIDL/LockOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIAccess.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIInput.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIInputMap.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIMessageEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIOutput.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIOutputMap.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIPort.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift delete mode 100644 Sources/DOMKit/WebIDL/MIDIPortType.swift delete mode 100644 Sources/DOMKit/WebIDL/ML.swift delete mode 100644 Sources/DOMKit/WebIDL/MLAutoPad.swift delete mode 100644 Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLBufferResourceView.swift delete mode 100644 Sources/DOMKit/WebIDL/MLBufferView.swift delete mode 100644 Sources/DOMKit/WebIDL/MLClampOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLContext.swift delete mode 100644 Sources/DOMKit/WebIDL/MLContextOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/MLConv2dOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLDevicePreference.swift delete mode 100644 Sources/DOMKit/WebIDL/MLEluOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLGemmOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLGraph.swift delete mode 100644 Sources/DOMKit/WebIDL/MLGraphBuilder.swift delete mode 100644 Sources/DOMKit/WebIDL/MLGruCellOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLGruOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLInput.swift delete mode 100644 Sources/DOMKit/WebIDL/MLInputOperandLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift delete mode 100644 Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLInterpolationMode.swift delete mode 100644 Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLLinearOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLOperand.swift delete mode 100644 Sources/DOMKit/WebIDL/MLOperandDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/MLOperandType.swift delete mode 100644 Sources/DOMKit/WebIDL/MLOperator.swift delete mode 100644 Sources/DOMKit/WebIDL/MLPadOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLPaddingMode.swift delete mode 100644 Sources/DOMKit/WebIDL/MLPool2dOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLPowerPreference.swift delete mode 100644 Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift delete mode 100644 Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/MLReduceOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLResample2dOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLResource.swift delete mode 100644 Sources/DOMKit/WebIDL/MLRoundingType.swift delete mode 100644 Sources/DOMKit/WebIDL/MLSliceOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLSoftplusOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLSplitOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLSqueezeOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MLTransposeOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/Magnetometer.swift delete mode 100644 Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift delete mode 100644 Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MathMLElement.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaCapabilities.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaDecodingType.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaEncodingType.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaImage.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeyMessageType.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeySession.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeySessionType.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeyStatus.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeys.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaKeysRequirement.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaMetadata.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaMetadataInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaPositionState.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaQueryList.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaQueryListEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaSession.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaSessionAction.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaSettingsRange.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift delete mode 100644 Sources/DOMKit/WebIDL/Memory.swift delete mode 100644 Sources/DOMKit/WebIDL/MemoryAttribution.swift delete mode 100644 Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift delete mode 100644 Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/MemoryDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/MemoryMeasurement.swift delete mode 100644 Sources/DOMKit/WebIDL/MeteringMode.swift delete mode 100644 Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/MockCameraConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MockCapturePromptResult.swift delete mode 100644 Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MockSensor.swift delete mode 100644 Sources/DOMKit/WebIDL/MockSensorConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/MockSensorReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/MockSensorType.swift delete mode 100644 Sources/DOMKit/WebIDL/Module.swift delete mode 100644 Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFMessage.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFMessageInit.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFMessageSource.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFReader.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFReadingEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFRecord.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFRecordInit.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFScanOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/NDEFWriteOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/NamedFlow.swift delete mode 100644 Sources/DOMKit/WebIDL/NamedFlowMap.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigateEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigateEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/Navigation.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationDestination.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationNavigationType.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationReloadOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationResult.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationTimingType.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationTransition.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorBadge.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorFonts.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorGPU.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorLocks.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorML.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorStorage.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorUA.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift delete mode 100644 Sources/DOMKit/WebIDL/NavigatorUAData.swift delete mode 100644 Sources/DOMKit/WebIDL/NetworkInformation.swift delete mode 100644 Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift delete mode 100644 Sources/DOMKit/WebIDL/Notification.swift delete mode 100644 Sources/DOMKit/WebIDL/NotificationAction.swift delete mode 100644 Sources/DOMKit/WebIDL/NotificationDirection.swift delete mode 100644 Sources/DOMKit/WebIDL/NotificationEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/NotificationOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/NotificationPermission.swift delete mode 100644 Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift delete mode 100644 Sources/DOMKit/WebIDL/OES_element_index_uint.swift delete mode 100644 Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift delete mode 100644 Sources/DOMKit/WebIDL/OES_standard_derivatives.swift delete mode 100644 Sources/DOMKit/WebIDL/OES_texture_float.swift delete mode 100644 Sources/DOMKit/WebIDL/OES_texture_float_linear.swift delete mode 100644 Sources/DOMKit/WebIDL/OES_texture_half_float.swift delete mode 100644 Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift delete mode 100644 Sources/DOMKit/WebIDL/OES_vertex_array_object.swift delete mode 100644 Sources/DOMKit/WebIDL/OTPCredential.swift delete mode 100644 Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift delete mode 100644 Sources/DOMKit/WebIDL/OVR_multiview2.swift delete mode 100644 Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/OfflineAudioContext.swift delete mode 100644 Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/OrientationLockType.swift delete mode 100644 Sources/DOMKit/WebIDL/OrientationSensor.swift delete mode 100644 Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift delete mode 100644 Sources/DOMKit/WebIDL/OrientationSensorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/OrientationType.swift delete mode 100644 Sources/DOMKit/WebIDL/OscillatorNode.swift delete mode 100644 Sources/DOMKit/WebIDL/OscillatorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/OscillatorType.swift delete mode 100644 Sources/DOMKit/WebIDL/OverSampleType.swift delete mode 100644 Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift delete mode 100644 Sources/DOMKit/WebIDL/PannerNode.swift delete mode 100644 Sources/DOMKit/WebIDL/PannerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/PanningModelType.swift delete mode 100644 Sources/DOMKit/WebIDL/ParityType.swift delete mode 100644 Sources/DOMKit/WebIDL/PasswordCredential.swift delete mode 100644 Sources/DOMKit/WebIDL/PasswordCredentialData.swift delete mode 100644 Sources/DOMKit/WebIDL/PasswordCredentialInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentComplete.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentDetailsBase.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentDetailsInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentInstrument.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentInstruments.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentItem.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentManager.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentMethodData.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentRequest.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentRequestUpdateEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentResponse.swift delete mode 100644 Sources/DOMKit/WebIDL/PaymentValidationErrors.swift delete mode 100644 Sources/DOMKit/WebIDL/Pbkdf2Params.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceElementTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceEventTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceMark.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceMeasure.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceNavigation.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceObserver.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceObserverInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformancePaintTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceServerTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/PerformanceTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PeriodicSyncManager.swift delete mode 100644 Sources/DOMKit/WebIDL/PeriodicWave.swift delete mode 100644 Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift delete mode 100644 Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/PermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/PermissionSetParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/PermissionState.swift delete mode 100644 Sources/DOMKit/WebIDL/PermissionStatus.swift delete mode 100644 Sources/DOMKit/WebIDL/Permissions.swift delete mode 100644 Sources/DOMKit/WebIDL/PermissionsPolicy.swift delete mode 100644 Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift delete mode 100644 Sources/DOMKit/WebIDL/PhotoCapabilities.swift delete mode 100644 Sources/DOMKit/WebIDL/PhotoSettings.swift delete mode 100644 Sources/DOMKit/WebIDL/PictureInPictureEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PictureInPictureWindow.swift delete mode 100644 Sources/DOMKit/WebIDL/Point2D.swift delete mode 100644 Sources/DOMKit/WebIDL/PointerEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PointerEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PortalActivateEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PortalActivateEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PortalActivateOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/PortalHost.swift delete mode 100644 Sources/DOMKit/WebIDL/PositionAlignSetting.swift delete mode 100644 Sources/DOMKit/WebIDL/PositionOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/Presentation.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationAvailability.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationConnection.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionList.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationConnectionState.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationReceiver.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationRequest.swift delete mode 100644 Sources/DOMKit/WebIDL/PresentationStyle.swift delete mode 100644 Sources/DOMKit/WebIDL/Profiler.swift delete mode 100644 Sources/DOMKit/WebIDL/ProfilerFrame.swift delete mode 100644 Sources/DOMKit/WebIDL/ProfilerInitOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ProfilerSample.swift delete mode 100644 Sources/DOMKit/WebIDL/ProfilerStack.swift delete mode 100644 Sources/DOMKit/WebIDL/ProfilerTrace.swift delete mode 100644 Sources/DOMKit/WebIDL/PromptResponseObject.swift delete mode 100644 Sources/DOMKit/WebIDL/PropertyDefinition.swift delete mode 100644 Sources/DOMKit/WebIDL/ProximityReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/ProximitySensor.swift delete mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredential.swift delete mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift delete mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift delete mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift delete mode 100644 Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift delete mode 100644 Sources/DOMKit/WebIDL/PurchaseDetails.swift delete mode 100644 Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift delete mode 100644 Sources/DOMKit/WebIDL/PushEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PushManager.swift delete mode 100644 Sources/DOMKit/WebIDL/PushMessageDataInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/PushSubscription.swift delete mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift delete mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift delete mode 100644 Sources/DOMKit/WebIDL/QueryOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCAnswerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCAudioHandlerStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCAudioReceiverStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCBundlePolicy.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCCertificate.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCCertificateStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCCodecStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCCodecType.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDTMFSender.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDataChannel.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDataChannelStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDegradationPreference.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDtlsTransport.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCError.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCErrorDetailType.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCErrorEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCErrorEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCErrorInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidate.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceCandidateType.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceComponent.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceConnectionState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceCredentialType.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceGathererState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceGatheringState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceProtocol.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceRole.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceServer.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceServerStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceTransport.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIceTransportState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProvider.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCInsertableStreams.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCOfferAnswerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCOfferOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnection.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCPriorityType.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtcpParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpDecodingParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpReceiveParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpReceiver.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpSender.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpSynchronizationSource.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCRtpTransform.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCSctpTransport.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCSctpTransportState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCSdpType.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCSessionDescription.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCSignalingState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCStatsReport.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCStatsType.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCTrackEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCTrackEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCTransportStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCVideoHandlerStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCVideoReceiverStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift delete mode 100644 Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/RedEyeReduction.swift delete mode 100644 Sources/DOMKit/WebIDL/Region.swift delete mode 100644 Sources/DOMKit/WebIDL/RelatedApplication.swift delete mode 100644 Sources/DOMKit/WebIDL/RelativeOrientationReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift delete mode 100644 Sources/DOMKit/WebIDL/RemotePlayback.swift delete mode 100644 Sources/DOMKit/WebIDL/RemotePlaybackState.swift delete mode 100644 Sources/DOMKit/WebIDL/Report.swift delete mode 100644 Sources/DOMKit/WebIDL/ReportBody.swift delete mode 100644 Sources/DOMKit/WebIDL/ReportingObserver.swift delete mode 100644 Sources/DOMKit/WebIDL/ReportingObserverOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/RequestDeviceOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift delete mode 100644 Sources/DOMKit/WebIDL/ResizeObserver.swift delete mode 100644 Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ResizeObserverEntry.swift delete mode 100644 Sources/DOMKit/WebIDL/ResizeObserverOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ResizeObserverSize.swift delete mode 100644 Sources/DOMKit/WebIDL/RsaHashedImportParams.swift delete mode 100644 Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift delete mode 100644 Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift delete mode 100644 Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift delete mode 100644 Sources/DOMKit/WebIDL/RsaKeyGenParams.swift delete mode 100644 Sources/DOMKit/WebIDL/RsaOaepParams.swift delete mode 100644 Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/RsaPssParams.swift delete mode 100644 Sources/DOMKit/WebIDL/SFrameTransform.swift delete mode 100644 Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift delete mode 100644 Sources/DOMKit/WebIDL/SFrameTransformOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/SFrameTransformRole.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimateElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimationElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGClipPathElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGDiscardElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEBlendElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFECompositeElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEFloodElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEImageElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEMergeElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFETileElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFilterElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGMPathElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGMaskElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGSetElement.swift delete mode 100644 Sources/DOMKit/WebIDL/Sanitizer.swift delete mode 100644 Sources/DOMKit/WebIDL/SanitizerConfig.swift delete mode 100644 Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/Scheduler.swift delete mode 100644 Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/Scheduling.swift delete mode 100644 Sources/DOMKit/WebIDL/Screen.swift delete mode 100644 Sources/DOMKit/WebIDL/ScreenIdleState.swift delete mode 100644 Sources/DOMKit/WebIDL/ScreenOrientation.swift delete mode 100644 Sources/DOMKit/WebIDL/ScriptProcessorNode.swift delete mode 100644 Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift delete mode 100644 Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollBehavior.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollDirection.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollSetting.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollTimeline.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ScrollToOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift delete mode 100644 Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift delete mode 100644 Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/Selection.swift delete mode 100644 Sources/DOMKit/WebIDL/Sensor.swift delete mode 100644 Sources/DOMKit/WebIDL/SensorErrorEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/SensorErrorEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/SensorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/SequenceEffect.swift delete mode 100644 Sources/DOMKit/WebIDL/Serial.swift delete mode 100644 Sources/DOMKit/WebIDL/SerialInputSignals.swift delete mode 100644 Sources/DOMKit/WebIDL/SerialOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/SerialOutputSignals.swift delete mode 100644 Sources/DOMKit/WebIDL/SerialPort.swift delete mode 100644 Sources/DOMKit/WebIDL/SerialPortFilter.swift delete mode 100644 Sources/DOMKit/WebIDL/SerialPortInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ServiceEventHandlers.swift delete mode 100644 Sources/DOMKit/WebIDL/SetHTMLOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ShareData.swift delete mode 100644 Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift delete mode 100644 Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechGrammar.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechGrammarList.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechRecognition.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesis.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift delete mode 100644 Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift delete mode 100644 Sources/DOMKit/WebIDL/StartInDirectory.swift delete mode 100644 Sources/DOMKit/WebIDL/StereoPannerNode.swift delete mode 100644 Sources/DOMKit/WebIDL/StereoPannerOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/StorageEstimate.swift delete mode 100644 Sources/DOMKit/WebIDL/StorageManager.swift delete mode 100644 Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift delete mode 100644 Sources/DOMKit/WebIDL/StylePropertyMap.swift delete mode 100644 Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift delete mode 100644 Sources/DOMKit/WebIDL/SubtleCrypto.swift delete mode 100644 Sources/DOMKit/WebIDL/SyncEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/SyncManager.swift delete mode 100644 Sources/DOMKit/WebIDL/Table.swift delete mode 100644 Sources/DOMKit/WebIDL/TableDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/TableKind.swift delete mode 100644 Sources/DOMKit/WebIDL/TaskAttributionTiming.swift delete mode 100644 Sources/DOMKit/WebIDL/TaskController.swift delete mode 100644 Sources/DOMKit/WebIDL/TaskControllerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/TaskPriority.swift delete mode 100644 Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/TaskSignal.swift delete mode 100644 Sources/DOMKit/WebIDL/TestUtils.swift delete mode 100644 Sources/DOMKit/WebIDL/TexImageSource.swift delete mode 100644 Sources/DOMKit/WebIDL/TextDecodeOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/TextDecoder.swift delete mode 100644 Sources/DOMKit/WebIDL/TextDecoderCommon.swift delete mode 100644 Sources/DOMKit/WebIDL/TextDecoderOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/TextDecoderStream.swift delete mode 100644 Sources/DOMKit/WebIDL/TextDetector.swift delete mode 100644 Sources/DOMKit/WebIDL/TextEncoder.swift delete mode 100644 Sources/DOMKit/WebIDL/TextEncoderCommon.swift delete mode 100644 Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift delete mode 100644 Sources/DOMKit/WebIDL/TextEncoderStream.swift delete mode 100644 Sources/DOMKit/WebIDL/TextFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/TextFormatInit.swift delete mode 100644 Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/TextUpdateEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/TextUpdateEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/TimeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/TokenBinding.swift delete mode 100644 Sources/DOMKit/WebIDL/TokenBindingStatus.swift delete mode 100644 Sources/DOMKit/WebIDL/Touch.swift delete mode 100644 Sources/DOMKit/WebIDL/TouchEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/TouchEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/TouchInit.swift delete mode 100644 Sources/DOMKit/WebIDL/TouchList.swift delete mode 100644 Sources/DOMKit/WebIDL/TouchType.swift delete mode 100644 Sources/DOMKit/WebIDL/TransactionAutomationMode.swift delete mode 100644 Sources/DOMKit/WebIDL/TransferFunction.swift delete mode 100644 Sources/DOMKit/WebIDL/TransitionEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/TransitionEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/TrustedHTML.swift delete mode 100644 Sources/DOMKit/WebIDL/TrustedScript.swift delete mode 100644 Sources/DOMKit/WebIDL/TrustedScriptURL.swift delete mode 100644 Sources/DOMKit/WebIDL/TrustedType.swift delete mode 100644 Sources/DOMKit/WebIDL/TrustedTypePolicy.swift delete mode 100644 Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift delete mode 100644 Sources/DOMKit/WebIDL/UADataValues.swift delete mode 100644 Sources/DOMKit/WebIDL/UALowEntropyJSON.swift delete mode 100644 Sources/DOMKit/WebIDL/URLPattern.swift delete mode 100644 Sources/DOMKit/WebIDL/URLPatternComponentResult.swift delete mode 100644 Sources/DOMKit/WebIDL/URLPatternInit.swift delete mode 100644 Sources/DOMKit/WebIDL/URLPatternInput.swift delete mode 100644 Sources/DOMKit/WebIDL/URLPatternResult.swift delete mode 100644 Sources/DOMKit/WebIDL/USB.swift delete mode 100644 Sources/DOMKit/WebIDL/USBAlternateInterface.swift delete mode 100644 Sources/DOMKit/WebIDL/USBConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/USBConnectionEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/USBConnectionEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/USBControlTransferParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/USBDevice.swift delete mode 100644 Sources/DOMKit/WebIDL/USBDeviceFilter.swift delete mode 100644 Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/USBDirection.swift delete mode 100644 Sources/DOMKit/WebIDL/USBEndpoint.swift delete mode 100644 Sources/DOMKit/WebIDL/USBEndpointType.swift delete mode 100644 Sources/DOMKit/WebIDL/USBInTransferResult.swift delete mode 100644 Sources/DOMKit/WebIDL/USBInterface.swift delete mode 100644 Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift delete mode 100644 Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift delete mode 100644 Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift delete mode 100644 Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift delete mode 100644 Sources/DOMKit/WebIDL/USBOutTransferResult.swift delete mode 100644 Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/USBPermissionResult.swift delete mode 100644 Sources/DOMKit/WebIDL/USBPermissionStorage.swift delete mode 100644 Sources/DOMKit/WebIDL/USBRecipient.swift delete mode 100644 Sources/DOMKit/WebIDL/USBRequestType.swift delete mode 100644 Sources/DOMKit/WebIDL/USBTransferStatus.swift delete mode 100644 Sources/DOMKit/WebIDL/Uint32List.swift delete mode 100644 Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift delete mode 100644 Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift delete mode 100644 Sources/DOMKit/WebIDL/UserIdleState.swift delete mode 100644 Sources/DOMKit/WebIDL/UserVerificationRequirement.swift delete mode 100644 Sources/DOMKit/WebIDL/VTTCue.swift delete mode 100644 Sources/DOMKit/WebIDL/VTTRegion.swift delete mode 100644 Sources/DOMKit/WebIDL/ValueEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/ValueEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/ValueType.swift delete mode 100644 Sources/DOMKit/WebIDL/VibratePattern.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoConfiguration.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoFrameMetadata.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift delete mode 100644 Sources/DOMKit/WebIDL/VirtualKeyboard.swift delete mode 100644 Sources/DOMKit/WebIDL/VisualViewport.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_lose_context.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift delete mode 100644 Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift delete mode 100644 Sources/DOMKit/WebIDL/WakeLock.swift delete mode 100644 Sources/DOMKit/WebIDL/WakeLockSentinel.swift delete mode 100644 Sources/DOMKit/WebIDL/WakeLockType.swift delete mode 100644 Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/WaveShaperNode.swift delete mode 100644 Sources/DOMKit/WebIDL/WaveShaperOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/WebAssembly.swift delete mode 100644 Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.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/WebGLQuery.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/WebGLSampler.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLShader.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLSync.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLTexture.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLTimerQueryEXT.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLUniformLocation.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift delete mode 100644 Sources/DOMKit/WebIDL/WebSocket.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransport.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransportError.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransportErrorInit.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransportErrorSource.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransportHash.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransportOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/WebTransportStats.swift delete mode 100644 Sources/DOMKit/WebIDL/WellKnownDirectory.swift delete mode 100644 Sources/DOMKit/WebIDL/WindowControlsOverlay.swift delete mode 100644 Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/WorkletAnimation.swift delete mode 100644 Sources/DOMKit/WebIDL/WriteCommandType.swift delete mode 100644 Sources/DOMKit/WebIDL/WriteParams.swift delete mode 100644 Sources/DOMKit/WebIDL/XMLSerializer.swift delete mode 100644 Sources/DOMKit/WebIDL/XRAnchor.swift delete mode 100644 Sources/DOMKit/WebIDL/XRAnchorSet.swift delete mode 100644 Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift delete mode 100644 Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift delete mode 100644 Sources/DOMKit/WebIDL/XRCompositionLayer.swift delete mode 100644 Sources/DOMKit/WebIDL/XRCubeLayer.swift delete mode 100644 Sources/DOMKit/WebIDL/XRCubeLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRCylinderLayer.swift delete mode 100644 Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRDOMOverlayState.swift delete mode 100644 Sources/DOMKit/WebIDL/XRDOMOverlayType.swift delete mode 100644 Sources/DOMKit/WebIDL/XRDepthDataFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/XRDepthInformation.swift delete mode 100644 Sources/DOMKit/WebIDL/XRDepthStateInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRDepthUsage.swift delete mode 100644 Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift delete mode 100644 Sources/DOMKit/WebIDL/XREquirectLayer.swift delete mode 100644 Sources/DOMKit/WebIDL/XREquirectLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XREye.swift delete mode 100644 Sources/DOMKit/WebIDL/XRFrame.swift delete mode 100644 Sources/DOMKit/WebIDL/XRHand.swift delete mode 100644 Sources/DOMKit/WebIDL/XRHandJoint.swift delete mode 100644 Sources/DOMKit/WebIDL/XRHandedness.swift delete mode 100644 Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRHitTestResult.swift delete mode 100644 Sources/DOMKit/WebIDL/XRHitTestSource.swift delete mode 100644 Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift delete mode 100644 Sources/DOMKit/WebIDL/XRInputSource.swift delete mode 100644 Sources/DOMKit/WebIDL/XRInputSourceArray.swift delete mode 100644 Sources/DOMKit/WebIDL/XRInputSourceEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRInteractionMode.swift delete mode 100644 Sources/DOMKit/WebIDL/XRJointPose.swift delete mode 100644 Sources/DOMKit/WebIDL/XRJointSpace.swift delete mode 100644 Sources/DOMKit/WebIDL/XRLayer.swift delete mode 100644 Sources/DOMKit/WebIDL/XRLayerEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/XRLayerEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRLayerLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/XRLightEstimate.swift delete mode 100644 Sources/DOMKit/WebIDL/XRLightProbe.swift delete mode 100644 Sources/DOMKit/WebIDL/XRLightProbeInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRMediaBinding.swift delete mode 100644 Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRMediaLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/XRPermissionStatus.swift delete mode 100644 Sources/DOMKit/WebIDL/XRPose.swift delete mode 100644 Sources/DOMKit/WebIDL/XRProjectionLayer.swift delete mode 100644 Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRQuadLayer.swift delete mode 100644 Sources/DOMKit/WebIDL/XRQuadLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRRay.swift delete mode 100644 Sources/DOMKit/WebIDL/XRRayDirectionInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRReferenceSpace.swift delete mode 100644 Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift delete mode 100644 Sources/DOMKit/WebIDL/XRReflectionFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/XRRenderState.swift delete mode 100644 Sources/DOMKit/WebIDL/XRRenderStateInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRRigidTransform.swift delete mode 100644 Sources/DOMKit/WebIDL/XRSession.swift delete mode 100644 Sources/DOMKit/WebIDL/XRSessionEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/XRSessionEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRSessionInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRSessionMode.swift delete mode 100644 Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/XRSpace.swift delete mode 100644 Sources/DOMKit/WebIDL/XRSubImage.swift delete mode 100644 Sources/DOMKit/WebIDL/XRSystem.swift delete mode 100644 Sources/DOMKit/WebIDL/XRTargetRayMode.swift delete mode 100644 Sources/DOMKit/WebIDL/XRTextureType.swift delete mode 100644 Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift delete mode 100644 Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift delete mode 100644 Sources/DOMKit/WebIDL/XRView.swift delete mode 100644 Sources/DOMKit/WebIDL/XRViewerPose.swift delete mode 100644 Sources/DOMKit/WebIDL/XRViewport.swift delete mode 100644 Sources/DOMKit/WebIDL/XRVisibilityState.swift delete mode 100644 Sources/DOMKit/WebIDL/XRWebGLBinding.swift delete mode 100644 Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift delete mode 100644 Sources/DOMKit/WebIDL/XRWebGLLayer.swift delete mode 100644 Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift delete mode 100644 Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift delete mode 100644 Sources/DOMKit/WebIDL/XRWebGLSubImage.swift delete mode 100644 Sources/DOMKit/WebIDL/console.swift diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index b89795f6..346486b8 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -14,6 +14,6 @@ public extension HTMLElement { public let globalThis = Window(from: JSObject.global.jsValue)! public typealias Uint8ClampedArray = JSUInt8ClampedArray -public typealias CSSColorValue_or_CSSStyleValue = CSSStyleValue -public typealias Any_CSSColorValue_or_CSSStyleValue = CSSStyleValue +//public typealias CSSColorValue_or_CSSStyleValue = CSSStyleValue +//public typealias Any_CSSColorValue_or_CSSStyleValue = CSSStyleValue public typealias CustomElementConstructor = JSFunction diff --git a/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift b/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift deleted file mode 100644 index 31d76ee7..00000000 --- a/Sources/DOMKit/WebIDL/ANGLE_instanced_arrays.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ANGLE_instanced_arrays: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ANGLE_instanced_arrays].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum = 0x88FE - - @inlinable public func drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) { - let this = jsObject - _ = this[Strings.drawArraysInstancedANGLE].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue, primcount.jsValue]) - } - - @inlinable public func drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei) { - let this = jsObject - _ = this[Strings.drawElementsInstancedANGLE].function!(this: this, arguments: [mode.jsValue, count.jsValue, type.jsValue, offset.jsValue, primcount.jsValue]) - } - - @inlinable public func vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint) { - let this = jsObject - _ = this[Strings.vertexAttribDivisorANGLE].function!(this: this, arguments: [index.jsValue, divisor.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift b/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift deleted file mode 100644 index 734e9539..00000000 --- a/Sources/DOMKit/WebIDL/AbsoluteOrientationReadingValues.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AbsoluteOrientationReadingValues: BridgedDictionary { - public convenience init(quaternion: [Double]?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.quaternion] = quaternion.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _quaternion = ReadWriteAttribute(jsObject: object, name: Strings.quaternion) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var quaternion: [Double]? -} diff --git a/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift b/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift deleted file mode 100644 index 97550dc1..00000000 --- a/Sources/DOMKit/WebIDL/AbsoluteOrientationSensor.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AbsoluteOrientationSensor: OrientationSensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AbsoluteOrientationSensor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(sensorOptions: OrientationSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) - } -} diff --git a/Sources/DOMKit/WebIDL/Accelerometer.swift b/Sources/DOMKit/WebIDL/Accelerometer.swift deleted file mode 100644 index 94a8808c..00000000 --- a/Sources/DOMKit/WebIDL/Accelerometer.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Accelerometer: Sensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Accelerometer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: AccelerometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var x: Double? - - @ReadonlyAttribute - public var y: Double? - - @ReadonlyAttribute - public var z: Double? -} diff --git a/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift deleted file mode 100644 index 98de2143..00000000 --- a/Sources/DOMKit/WebIDL/AccelerometerLocalCoordinateSystem.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AccelerometerLocalCoordinateSystem: JSString, JSValueCompatible { - case device = "device" - case screen = "screen" - - @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/AccelerometerReadingValues.swift b/Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift deleted file mode 100644 index 402ce513..00000000 --- a/Sources/DOMKit/WebIDL/AccelerometerReadingValues.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AccelerometerReadingValues: BridgedDictionary { - public convenience init(x: Double?, y: Double?, z: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - object[Strings.z] = z.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - _z = ReadWriteAttribute(jsObject: object, name: Strings.z) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var x: Double? - - @ReadWriteAttribute - public var y: Double? - - @ReadWriteAttribute - public var z: Double? -} diff --git a/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift b/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift deleted file mode 100644 index b18c354f..00000000 --- a/Sources/DOMKit/WebIDL/AccelerometerSensorOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AccelerometerSensorOptions: BridgedDictionary { - public convenience init(referenceFrame: AccelerometerLocalCoordinateSystem) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceFrame] = referenceFrame.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _referenceFrame = ReadWriteAttribute(jsObject: object, name: Strings.referenceFrame) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var referenceFrame: AccelerometerLocalCoordinateSystem -} diff --git a/Sources/DOMKit/WebIDL/AesCbcParams.swift b/Sources/DOMKit/WebIDL/AesCbcParams.swift deleted file mode 100644 index 4211354b..00000000 --- a/Sources/DOMKit/WebIDL/AesCbcParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AesCbcParams: BridgedDictionary { - public convenience init(iv: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iv] = iv.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _iv = ReadWriteAttribute(jsObject: object, name: Strings.iv) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var iv: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/AesCtrParams.swift b/Sources/DOMKit/WebIDL/AesCtrParams.swift deleted file mode 100644 index fd44c0c6..00000000 --- a/Sources/DOMKit/WebIDL/AesCtrParams.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AesCtrParams: BridgedDictionary { - public convenience init(counter: BufferSource, length: UInt8) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.counter] = counter.jsValue - object[Strings.length] = length.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _counter = ReadWriteAttribute(jsObject: object, name: Strings.counter) - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var counter: BufferSource - - @ReadWriteAttribute - public var length: UInt8 -} diff --git a/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift b/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift deleted file mode 100644 index d0aa0d55..00000000 --- a/Sources/DOMKit/WebIDL/AesDerivedKeyParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AesDerivedKeyParams: BridgedDictionary { - public convenience init(length: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.length] = length.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var length: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/AesGcmParams.swift b/Sources/DOMKit/WebIDL/AesGcmParams.swift deleted file mode 100644 index fd36d499..00000000 --- a/Sources/DOMKit/WebIDL/AesGcmParams.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AesGcmParams: BridgedDictionary { - public convenience init(iv: BufferSource, additionalData: BufferSource, tagLength: UInt8) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iv] = iv.jsValue - object[Strings.additionalData] = additionalData.jsValue - object[Strings.tagLength] = tagLength.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _iv = ReadWriteAttribute(jsObject: object, name: Strings.iv) - _additionalData = ReadWriteAttribute(jsObject: object, name: Strings.additionalData) - _tagLength = ReadWriteAttribute(jsObject: object, name: Strings.tagLength) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var iv: BufferSource - - @ReadWriteAttribute - public var additionalData: BufferSource - - @ReadWriteAttribute - public var tagLength: UInt8 -} diff --git a/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift deleted file mode 100644 index bbcacfd3..00000000 --- a/Sources/DOMKit/WebIDL/AesKeyAlgorithm.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AesKeyAlgorithm: BridgedDictionary { - public convenience init(length: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.length] = length.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var length: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/AesKeyGenParams.swift b/Sources/DOMKit/WebIDL/AesKeyGenParams.swift deleted file mode 100644 index 6fb5d7a4..00000000 --- a/Sources/DOMKit/WebIDL/AesKeyGenParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AesKeyGenParams: BridgedDictionary { - public convenience init(length: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.length] = length.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var length: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/Algorithm.swift b/Sources/DOMKit/WebIDL/Algorithm.swift deleted file mode 100644 index 01af3fdf..00000000 --- a/Sources/DOMKit/WebIDL/Algorithm.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Algorithm: BridgedDictionary { - public convenience init(name: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String -} diff --git a/Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift b/Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift deleted file mode 100644 index 4d238032..00000000 --- a/Sources/DOMKit/WebIDL/AlgorithmIdentifier.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_AlgorithmIdentifier: ConvertibleToJSValue {} -extension JSObject: Any_AlgorithmIdentifier {} -extension String: Any_AlgorithmIdentifier {} - -public enum AlgorithmIdentifier: JSValueCompatible, Any_AlgorithmIdentifier { - case jSObject(JSObject) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let jSObject: JSObject = value.fromJSValue() { - return .jSObject(jSObject) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .jSObject(jSObject): - return jSObject.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/AlignSetting.swift b/Sources/DOMKit/WebIDL/AlignSetting.swift deleted file mode 100644 index fd7a2f30..00000000 --- a/Sources/DOMKit/WebIDL/AlignSetting.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AlignSetting: JSString, JSValueCompatible { - case start = "start" - case center = "center" - case end = "end" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift b/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift deleted file mode 100644 index 73e407a8..00000000 --- a/Sources/DOMKit/WebIDL/AllowedBluetoothDevice.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AllowedBluetoothDevice: BridgedDictionary { - public convenience init(deviceId: String, mayUseGATT: Bool, allowedServices: String_or_seq_of_UUID, allowedManufacturerData: [UInt16]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.deviceId] = deviceId.jsValue - object[Strings.mayUseGATT] = mayUseGATT.jsValue - object[Strings.allowedServices] = allowedServices.jsValue - object[Strings.allowedManufacturerData] = allowedManufacturerData.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) - _mayUseGATT = ReadWriteAttribute(jsObject: object, name: Strings.mayUseGATT) - _allowedServices = ReadWriteAttribute(jsObject: object, name: Strings.allowedServices) - _allowedManufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.allowedManufacturerData) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var deviceId: String - - @ReadWriteAttribute - public var mayUseGATT: Bool - - @ReadWriteAttribute - public var allowedServices: String_or_seq_of_UUID - - @ReadWriteAttribute - public var allowedManufacturerData: [UInt16] -} diff --git a/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift b/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift deleted file mode 100644 index 244c46a7..00000000 --- a/Sources/DOMKit/WebIDL/AllowedUSBDevice.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AllowedUSBDevice: BridgedDictionary { - public convenience init(vendorId: UInt8, productId: UInt8, serialNumber: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.vendorId] = vendorId.jsValue - object[Strings.productId] = productId.jsValue - object[Strings.serialNumber] = serialNumber.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _vendorId = ReadWriteAttribute(jsObject: object, name: Strings.vendorId) - _productId = ReadWriteAttribute(jsObject: object, name: Strings.productId) - _serialNumber = ReadWriteAttribute(jsObject: object, name: Strings.serialNumber) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var vendorId: UInt8 - - @ReadWriteAttribute - public var productId: UInt8 - - @ReadWriteAttribute - public var serialNumber: String -} diff --git a/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift b/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift deleted file mode 100644 index 435910a1..00000000 --- a/Sources/DOMKit/WebIDL/AmbientLightReadingValues.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AmbientLightReadingValues: BridgedDictionary { - public convenience init(illuminance: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.illuminance] = illuminance.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _illuminance = ReadWriteAttribute(jsObject: object, name: Strings.illuminance) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var illuminance: Double? -} diff --git a/Sources/DOMKit/WebIDL/AmbientLightSensor.swift b/Sources/DOMKit/WebIDL/AmbientLightSensor.swift deleted file mode 100644 index e03ee178..00000000 --- a/Sources/DOMKit/WebIDL/AmbientLightSensor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AmbientLightSensor: Sensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AmbientLightSensor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _illuminance = ReadonlyAttribute(jsObject: jsObject, name: Strings.illuminance) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(sensorOptions: SensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var illuminance: Double? -} diff --git a/Sources/DOMKit/WebIDL/AnalyserNode.swift b/Sources/DOMKit/WebIDL/AnalyserNode.swift deleted file mode 100644 index 89b6a803..00000000 --- a/Sources/DOMKit/WebIDL/AnalyserNode.swift +++ /dev/null @@ -1,56 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AnalyserNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AnalyserNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _fftSize = ReadWriteAttribute(jsObject: jsObject, name: Strings.fftSize) - _frequencyBinCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.frequencyBinCount) - _minDecibels = ReadWriteAttribute(jsObject: jsObject, name: Strings.minDecibels) - _maxDecibels = ReadWriteAttribute(jsObject: jsObject, name: Strings.maxDecibels) - _smoothingTimeConstant = ReadWriteAttribute(jsObject: jsObject, name: Strings.smoothingTimeConstant) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: AnalyserOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @inlinable public func getFloatFrequencyData(array: Float32Array) { - let this = jsObject - _ = this[Strings.getFloatFrequencyData].function!(this: this, arguments: [array.jsValue]) - } - - @inlinable public func getByteFrequencyData(array: Uint8Array) { - let this = jsObject - _ = this[Strings.getByteFrequencyData].function!(this: this, arguments: [array.jsValue]) - } - - @inlinable public func getFloatTimeDomainData(array: Float32Array) { - let this = jsObject - _ = this[Strings.getFloatTimeDomainData].function!(this: this, arguments: [array.jsValue]) - } - - @inlinable public func getByteTimeDomainData(array: Uint8Array) { - let this = jsObject - _ = this[Strings.getByteTimeDomainData].function!(this: this, arguments: [array.jsValue]) - } - - @ReadWriteAttribute - public var fftSize: UInt32 - - @ReadonlyAttribute - public var frequencyBinCount: UInt32 - - @ReadWriteAttribute - public var minDecibels: Double - - @ReadWriteAttribute - public var maxDecibels: Double - - @ReadWriteAttribute - public var smoothingTimeConstant: Double -} diff --git a/Sources/DOMKit/WebIDL/AnalyserOptions.swift b/Sources/DOMKit/WebIDL/AnalyserOptions.swift deleted file mode 100644 index 8c131340..00000000 --- a/Sources/DOMKit/WebIDL/AnalyserOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AnalyserOptions: BridgedDictionary { - public convenience init(fftSize: UInt32, maxDecibels: Double, minDecibels: Double, smoothingTimeConstant: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fftSize] = fftSize.jsValue - object[Strings.maxDecibels] = maxDecibels.jsValue - object[Strings.minDecibels] = minDecibels.jsValue - object[Strings.smoothingTimeConstant] = smoothingTimeConstant.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _fftSize = ReadWriteAttribute(jsObject: object, name: Strings.fftSize) - _maxDecibels = ReadWriteAttribute(jsObject: object, name: Strings.maxDecibels) - _minDecibels = ReadWriteAttribute(jsObject: object, name: Strings.minDecibels) - _smoothingTimeConstant = ReadWriteAttribute(jsObject: object, name: Strings.smoothingTimeConstant) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var fftSize: UInt32 - - @ReadWriteAttribute - public var maxDecibels: Double - - @ReadWriteAttribute - public var minDecibels: Double - - @ReadWriteAttribute - public var smoothingTimeConstant: Double -} diff --git a/Sources/DOMKit/WebIDL/Animation.swift b/Sources/DOMKit/WebIDL/Animation.swift index 257a44ce..10ac8a0b 100644 --- a/Sources/DOMKit/WebIDL/Animation.swift +++ b/Sources/DOMKit/WebIDL/Animation.swift @@ -7,8 +7,6 @@ public class Animation: EventTarget { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Animation].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _startTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.startTime) - _currentTime = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentTime) _id = ReadWriteAttribute(jsObject: jsObject, name: Strings.id) _effect = ReadWriteAttribute(jsObject: jsObject, name: Strings.effect) _timeline = ReadWriteAttribute(jsObject: jsObject, name: Strings.timeline) @@ -24,12 +22,6 @@ public class Animation: EventTarget { super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var startTime: CSSNumberish? - - @ReadWriteAttribute - public var currentTime: CSSNumberish? - @inlinable public convenience init(effect: AnimationEffect? = nil, timeline: AnimationTimeline? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [effect?.jsValue ?? .undefined, timeline?.jsValue ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect.swift index a9145e48..9865ddd3 100644 --- a/Sources/DOMKit/WebIDL/AnimationEffect.swift +++ b/Sources/DOMKit/WebIDL/AnimationEffect.swift @@ -9,41 +9,9 @@ public class AnimationEffect: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _parent = ReadonlyAttribute(jsObject: jsObject, name: Strings.parent) - _previousSibling = ReadonlyAttribute(jsObject: jsObject, name: Strings.previousSibling) - _nextSibling = ReadonlyAttribute(jsObject: jsObject, name: Strings.nextSibling) self.jsObject = jsObject } - @ReadonlyAttribute - public var parent: GroupEffect? - - @ReadonlyAttribute - public var previousSibling: AnimationEffect? - - @ReadonlyAttribute - public var nextSibling: AnimationEffect? - - @inlinable public func before(effects: AnimationEffect...) { - let this = jsObject - _ = this[Strings.before].function!(this: this, arguments: effects.map(\.jsValue)) - } - - @inlinable public func after(effects: AnimationEffect...) { - let this = jsObject - _ = this[Strings.after].function!(this: this, arguments: effects.map(\.jsValue)) - } - - @inlinable public func replace(effects: AnimationEffect...) { - let this = jsObject - _ = this[Strings.replace].function!(this: this, arguments: effects.map(\.jsValue)) - } - - @inlinable public func remove() { - let this = jsObject - _ = this[Strings.remove].function!(this: this, arguments: []) - } - @inlinable public func getTiming() -> EffectTiming { let this = jsObject return this[Strings.getTiming].function!(this: this, arguments: []).fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift b/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift deleted file mode 100644 index 2589d750..00000000 --- a/Sources/DOMKit/WebIDL/AnimationEffect_or_seq_of_AnimationEffect.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_AnimationEffect_or_seq_of_AnimationEffect: ConvertibleToJSValue {} -extension AnimationEffect: Any_AnimationEffect_or_seq_of_AnimationEffect {} -extension Array: Any_AnimationEffect_or_seq_of_AnimationEffect where Element == AnimationEffect {} - -public enum AnimationEffect_or_seq_of_AnimationEffect: JSValueCompatible, Any_AnimationEffect_or_seq_of_AnimationEffect { - case animationEffect(AnimationEffect) - case seq_of_AnimationEffect([AnimationEffect]) - - public static func construct(from value: JSValue) -> Self? { - if let animationEffect: AnimationEffect = value.fromJSValue() { - return .animationEffect(animationEffect) - } - if let seq_of_AnimationEffect: [AnimationEffect] = value.fromJSValue() { - return .seq_of_AnimationEffect(seq_of_AnimationEffect) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .animationEffect(animationEffect): - return animationEffect.jsValue - case let .seq_of_AnimationEffect(seq_of_AnimationEffect): - return seq_of_AnimationEffect.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/AnimationEvent.swift b/Sources/DOMKit/WebIDL/AnimationEvent.swift deleted file mode 100644 index f1cecdf1..00000000 --- a/Sources/DOMKit/WebIDL/AnimationEvent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AnimationEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AnimationEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _animationName = ReadonlyAttribute(jsObject: jsObject, name: Strings.animationName) - _elapsedTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.elapsedTime) - _pseudoElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.pseudoElement) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, animationEventInitDict: AnimationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, animationEventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var animationName: String - - @ReadonlyAttribute - public var elapsedTime: Double - - @ReadonlyAttribute - public var pseudoElement: String -} diff --git a/Sources/DOMKit/WebIDL/AnimationEventInit.swift b/Sources/DOMKit/WebIDL/AnimationEventInit.swift deleted file mode 100644 index 198d8a9d..00000000 --- a/Sources/DOMKit/WebIDL/AnimationEventInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AnimationEventInit: BridgedDictionary { - public convenience init(animationName: String, elapsedTime: Double, pseudoElement: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.animationName] = animationName.jsValue - object[Strings.elapsedTime] = elapsedTime.jsValue - object[Strings.pseudoElement] = pseudoElement.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _animationName = ReadWriteAttribute(jsObject: object, name: Strings.animationName) - _elapsedTime = ReadWriteAttribute(jsObject: object, name: Strings.elapsedTime) - _pseudoElement = ReadWriteAttribute(jsObject: object, name: Strings.pseudoElement) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var animationName: String - - @ReadWriteAttribute - public var elapsedTime: Double - - @ReadWriteAttribute - public var pseudoElement: String -} diff --git a/Sources/DOMKit/WebIDL/AnimationNodeList.swift b/Sources/DOMKit/WebIDL/AnimationNodeList.swift deleted file mode 100644 index f9c56e9e..00000000 --- a/Sources/DOMKit/WebIDL/AnimationNodeList.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AnimationNodeList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AnimationNodeList].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 subscript(key: Int) -> AnimationEffect? { - jsObject[key].fromJSValue() - } -} diff --git a/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift b/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift deleted file mode 100644 index f2e4ec45..00000000 --- a/Sources/DOMKit/WebIDL/AnimationPlaybackEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AnimationPlaybackEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AnimationPlaybackEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) - _timelineTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.timelineTime) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: AnimationPlaybackEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var currentTime: CSSNumberish? - - @ReadonlyAttribute - public var timelineTime: CSSNumberish? -} diff --git a/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift b/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift deleted file mode 100644 index dc593747..00000000 --- a/Sources/DOMKit/WebIDL/AnimationPlaybackEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AnimationPlaybackEventInit: BridgedDictionary { - public convenience init(currentTime: CSSNumberish?, timelineTime: CSSNumberish?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.currentTime] = currentTime.jsValue - object[Strings.timelineTime] = timelineTime.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _currentTime = ReadWriteAttribute(jsObject: object, name: Strings.currentTime) - _timelineTime = ReadWriteAttribute(jsObject: object, name: Strings.timelineTime) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var currentTime: CSSNumberish? - - @ReadWriteAttribute - public var timelineTime: CSSNumberish? -} diff --git a/Sources/DOMKit/WebIDL/AnimationTimeline.swift b/Sources/DOMKit/WebIDL/AnimationTimeline.swift index 02e3cff0..96e84a17 100644 --- a/Sources/DOMKit/WebIDL/AnimationTimeline.swift +++ b/Sources/DOMKit/WebIDL/AnimationTimeline.swift @@ -9,20 +9,11 @@ public class AnimationTimeline: JSBridgedClass { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) _phase = ReadonlyAttribute(jsObject: jsObject, name: Strings.phase) self.jsObject = jsObject } - @ReadonlyAttribute - public var duration: CSSNumberish? - - @inlinable public func play(effect: AnimationEffect? = nil) -> Animation { - let this = jsObject - return this[Strings.play].function!(this: this, arguments: [effect?.jsValue ?? .undefined]).fromJSValue()! - } - @ReadonlyAttribute public var currentTime: Double? diff --git a/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift b/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift deleted file mode 100644 index 451ef746..00000000 --- a/Sources/DOMKit/WebIDL/AppBannerPromptOutcome.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AppBannerPromptOutcome: JSString, JSValueCompatible { - case accepted = "accepted" - case dismissed = "dismissed" - - @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/AttestationConveyancePreference.swift b/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift deleted file mode 100644 index a6686c72..00000000 --- a/Sources/DOMKit/WebIDL/AttestationConveyancePreference.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AttestationConveyancePreference: JSString, JSValueCompatible { - case none = "none" - case indirect = "indirect" - case direct = "direct" - case enterprise = "enterprise" - - @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/AttributionReporting.swift b/Sources/DOMKit/WebIDL/AttributionReporting.swift deleted file mode 100644 index 19bcb834..00000000 --- a/Sources/DOMKit/WebIDL/AttributionReporting.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AttributionReporting: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AttributionReporting].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func registerAttributionSource(params: AttributionSourceParams) -> JSPromise { - let this = jsObject - return this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func registerAttributionSource(params: AttributionSourceParams) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.registerAttributionSource].function!(this: this, arguments: [params.jsValue]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/AttributionSourceParams.swift b/Sources/DOMKit/WebIDL/AttributionSourceParams.swift deleted file mode 100644 index 071baa4d..00000000 --- a/Sources/DOMKit/WebIDL/AttributionSourceParams.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AttributionSourceParams: BridgedDictionary { - public convenience init(attributionDestination: String, attributionSourceEventId: String, attributionReportTo: String, attributionExpiry: Int64, attributionSourcePriority: Int64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.attributionDestination] = attributionDestination.jsValue - object[Strings.attributionSourceEventId] = attributionSourceEventId.jsValue - object[Strings.attributionReportTo] = attributionReportTo.jsValue - object[Strings.attributionExpiry] = attributionExpiry.jsValue - object[Strings.attributionSourcePriority] = attributionSourcePriority.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _attributionDestination = ReadWriteAttribute(jsObject: object, name: Strings.attributionDestination) - _attributionSourceEventId = ReadWriteAttribute(jsObject: object, name: Strings.attributionSourceEventId) - _attributionReportTo = ReadWriteAttribute(jsObject: object, name: Strings.attributionReportTo) - _attributionExpiry = ReadWriteAttribute(jsObject: object, name: Strings.attributionExpiry) - _attributionSourcePriority = ReadWriteAttribute(jsObject: object, name: Strings.attributionSourcePriority) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var attributionDestination: String - - @ReadWriteAttribute - public var attributionSourceEventId: String - - @ReadWriteAttribute - public var attributionReportTo: String - - @ReadWriteAttribute - public var attributionExpiry: Int64 - - @ReadWriteAttribute - public var attributionSourcePriority: Int64 -} diff --git a/Sources/DOMKit/WebIDL/AudioBuffer.swift b/Sources/DOMKit/WebIDL/AudioBuffer.swift deleted file mode 100644 index 81fcd328..00000000 --- a/Sources/DOMKit/WebIDL/AudioBuffer.swift +++ /dev/null @@ -1,49 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioBuffer: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioBuffer].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _sampleRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleRate) - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) - _numberOfChannels = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfChannels) - self.jsObject = jsObject - } - - @inlinable public convenience init(options: AudioBufferOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue])) - } - - @ReadonlyAttribute - public var sampleRate: Float - - @ReadonlyAttribute - public var length: UInt32 - - @ReadonlyAttribute - public var duration: Double - - @ReadonlyAttribute - public var numberOfChannels: UInt32 - - @inlinable public func getChannelData(channel: UInt32) -> Float32Array { - let this = jsObject - return this[Strings.getChannelData].function!(this: this, arguments: [channel.jsValue]).fromJSValue()! - } - - @inlinable public func copyFromChannel(destination: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { - let this = jsObject - _ = this[Strings.copyFromChannel].function!(this: this, arguments: [destination.jsValue, channelNumber.jsValue, bufferOffset?.jsValue ?? .undefined]) - } - - @inlinable public func copyToChannel(source: Float32Array, channelNumber: UInt32, bufferOffset: UInt32? = nil) { - let this = jsObject - _ = this[Strings.copyToChannel].function!(this: this, arguments: [source.jsValue, channelNumber.jsValue, bufferOffset?.jsValue ?? .undefined]) - } -} diff --git a/Sources/DOMKit/WebIDL/AudioBufferOptions.swift b/Sources/DOMKit/WebIDL/AudioBufferOptions.swift deleted file mode 100644 index 28761c14..00000000 --- a/Sources/DOMKit/WebIDL/AudioBufferOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioBufferOptions: BridgedDictionary { - public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfChannels] = numberOfChannels.jsValue - object[Strings.length] = length.jsValue - object[Strings.sampleRate] = sampleRate.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var numberOfChannels: UInt32 - - @ReadWriteAttribute - public var length: UInt32 - - @ReadWriteAttribute - public var sampleRate: Float -} diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift deleted file mode 100644 index 866d9931..00000000 --- a/Sources/DOMKit/WebIDL/AudioBufferSourceNode.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioBufferSourceNode: AudioScheduledSourceNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioBufferSourceNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _buffer = ReadWriteAttribute(jsObject: jsObject, name: Strings.buffer) - _playbackRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.playbackRate) - _detune = ReadonlyAttribute(jsObject: jsObject, name: Strings.detune) - _loop = ReadWriteAttribute(jsObject: jsObject, name: Strings.loop) - _loopStart = ReadWriteAttribute(jsObject: jsObject, name: Strings.loopStart) - _loopEnd = ReadWriteAttribute(jsObject: jsObject, name: Strings.loopEnd) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: AudioBufferSourceOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var buffer: AudioBuffer? - - @ReadonlyAttribute - public var playbackRate: AudioParam - - @ReadonlyAttribute - public var detune: AudioParam - - @ReadWriteAttribute - public var loop: Bool - - @ReadWriteAttribute - public var loopStart: Double - - @ReadWriteAttribute - public var loopEnd: Double - - // XXX: member 'start' is ignored -} diff --git a/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift b/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift deleted file mode 100644 index 2507d975..00000000 --- a/Sources/DOMKit/WebIDL/AudioBufferSourceOptions.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioBufferSourceOptions: BridgedDictionary { - public convenience init(buffer: AudioBuffer?, detune: Float, loop: Bool, loopEnd: Double, loopStart: Double, playbackRate: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffer] = buffer.jsValue - object[Strings.detune] = detune.jsValue - object[Strings.loop] = loop.jsValue - object[Strings.loopEnd] = loopEnd.jsValue - object[Strings.loopStart] = loopStart.jsValue - object[Strings.playbackRate] = playbackRate.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) - _detune = ReadWriteAttribute(jsObject: object, name: Strings.detune) - _loop = ReadWriteAttribute(jsObject: object, name: Strings.loop) - _loopEnd = ReadWriteAttribute(jsObject: object, name: Strings.loopEnd) - _loopStart = ReadWriteAttribute(jsObject: object, name: Strings.loopStart) - _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var buffer: AudioBuffer? - - @ReadWriteAttribute - public var detune: Float - - @ReadWriteAttribute - public var loop: Bool - - @ReadWriteAttribute - public var loopEnd: Double - - @ReadWriteAttribute - public var loopStart: Double - - @ReadWriteAttribute - public var playbackRate: Float -} diff --git a/Sources/DOMKit/WebIDL/AudioConfiguration.swift b/Sources/DOMKit/WebIDL/AudioConfiguration.swift deleted file mode 100644 index 6fe29b41..00000000 --- a/Sources/DOMKit/WebIDL/AudioConfiguration.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioConfiguration: BridgedDictionary { - public convenience init(contentType: String, channels: String, bitrate: UInt64, samplerate: UInt32, spatialRendering: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contentType] = contentType.jsValue - object[Strings.channels] = channels.jsValue - object[Strings.bitrate] = bitrate.jsValue - object[Strings.samplerate] = samplerate.jsValue - object[Strings.spatialRendering] = spatialRendering.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _contentType = ReadWriteAttribute(jsObject: object, name: Strings.contentType) - _channels = ReadWriteAttribute(jsObject: object, name: Strings.channels) - _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) - _samplerate = ReadWriteAttribute(jsObject: object, name: Strings.samplerate) - _spatialRendering = ReadWriteAttribute(jsObject: object, name: Strings.spatialRendering) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var contentType: String - - @ReadWriteAttribute - public var channels: String - - @ReadWriteAttribute - public var bitrate: UInt64 - - @ReadWriteAttribute - public var samplerate: UInt32 - - @ReadWriteAttribute - public var spatialRendering: Bool -} diff --git a/Sources/DOMKit/WebIDL/AudioContext.swift b/Sources/DOMKit/WebIDL/AudioContext.swift deleted file mode 100644 index 92c4a3f3..00000000 --- a/Sources/DOMKit/WebIDL/AudioContext.swift +++ /dev/null @@ -1,85 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioContext: BaseAudioContext { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioContext].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseLatency = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseLatency) - _outputLatency = ReadonlyAttribute(jsObject: jsObject, name: Strings.outputLatency) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(contextOptions: AudioContextOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var baseLatency: Double - - @ReadonlyAttribute - public var outputLatency: Double - - @inlinable public func getOutputTimestamp() -> AudioTimestamp { - let this = jsObject - return this[Strings.getOutputTimestamp].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func resume() -> JSPromise { - let this = jsObject - return this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func resume() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func suspend() -> JSPromise { - let this = jsObject - return this[Strings.suspend].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func suspend() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.suspend].function!(this: this, arguments: []).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 createMediaElementSource(mediaElement: HTMLMediaElement) -> MediaElementAudioSourceNode { - let this = jsObject - return this[Strings.createMediaElementSource].function!(this: this, arguments: [mediaElement.jsValue]).fromJSValue()! - } - - @inlinable public func createMediaStreamSource(mediaStream: MediaStream) -> MediaStreamAudioSourceNode { - let this = jsObject - return this[Strings.createMediaStreamSource].function!(this: this, arguments: [mediaStream.jsValue]).fromJSValue()! - } - - @inlinable public func createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack) -> MediaStreamTrackAudioSourceNode { - let this = jsObject - return this[Strings.createMediaStreamTrackSource].function!(this: this, arguments: [mediaStreamTrack.jsValue]).fromJSValue()! - } - - @inlinable public func createMediaStreamDestination() -> MediaStreamAudioDestinationNode { - let this = jsObject - return this[Strings.createMediaStreamDestination].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift deleted file mode 100644 index d62ce93a..00000000 --- a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AudioContextLatencyCategory: JSString, JSValueCompatible { - case balanced = "balanced" - case interactive = "interactive" - case playback = "playback" - - @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/AudioContextLatencyCategory_or_Double.swift b/Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift deleted file mode 100644 index 4b27f8c7..00000000 --- a/Sources/DOMKit/WebIDL/AudioContextLatencyCategory_or_Double.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_AudioContextLatencyCategory_or_Double: ConvertibleToJSValue {} -extension AudioContextLatencyCategory: Any_AudioContextLatencyCategory_or_Double {} -extension Double: Any_AudioContextLatencyCategory_or_Double {} - -public enum AudioContextLatencyCategory_or_Double: JSValueCompatible, Any_AudioContextLatencyCategory_or_Double { - case audioContextLatencyCategory(AudioContextLatencyCategory) - case double(Double) - - public static func construct(from value: JSValue) -> Self? { - if let audioContextLatencyCategory: AudioContextLatencyCategory = value.fromJSValue() { - return .audioContextLatencyCategory(audioContextLatencyCategory) - } - if let double: Double = value.fromJSValue() { - return .double(double) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .audioContextLatencyCategory(audioContextLatencyCategory): - return audioContextLatencyCategory.jsValue - case let .double(double): - return double.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/AudioContextOptions.swift b/Sources/DOMKit/WebIDL/AudioContextOptions.swift deleted file mode 100644 index 09df3c2a..00000000 --- a/Sources/DOMKit/WebIDL/AudioContextOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioContextOptions: BridgedDictionary { - public convenience init(latencyHint: AudioContextLatencyCategory_or_Double, sampleRate: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.latencyHint] = latencyHint.jsValue - object[Strings.sampleRate] = sampleRate.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _latencyHint = ReadWriteAttribute(jsObject: object, name: Strings.latencyHint) - _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var latencyHint: AudioContextLatencyCategory_or_Double - - @ReadWriteAttribute - public var sampleRate: Float -} diff --git a/Sources/DOMKit/WebIDL/AudioContextState.swift b/Sources/DOMKit/WebIDL/AudioContextState.swift deleted file mode 100644 index b4671d1d..00000000 --- a/Sources/DOMKit/WebIDL/AudioContextState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AudioContextState: JSString, JSValueCompatible { - case suspended = "suspended" - case running = "running" - 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/AudioDestinationNode.swift b/Sources/DOMKit/WebIDL/AudioDestinationNode.swift deleted file mode 100644 index ff528202..00000000 --- a/Sources/DOMKit/WebIDL/AudioDestinationNode.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioDestinationNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioDestinationNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _maxChannelCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxChannelCount) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var maxChannelCount: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/AudioListener.swift b/Sources/DOMKit/WebIDL/AudioListener.swift deleted file mode 100644 index ca93854e..00000000 --- a/Sources/DOMKit/WebIDL/AudioListener.swift +++ /dev/null @@ -1,66 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioListener: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioListener].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _positionX = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionX) - _positionY = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionY) - _positionZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionZ) - _forwardX = ReadonlyAttribute(jsObject: jsObject, name: Strings.forwardX) - _forwardY = ReadonlyAttribute(jsObject: jsObject, name: Strings.forwardY) - _forwardZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.forwardZ) - _upX = ReadonlyAttribute(jsObject: jsObject, name: Strings.upX) - _upY = ReadonlyAttribute(jsObject: jsObject, name: Strings.upY) - _upZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.upZ) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var positionX: AudioParam - - @ReadonlyAttribute - public var positionY: AudioParam - - @ReadonlyAttribute - public var positionZ: AudioParam - - @ReadonlyAttribute - public var forwardX: AudioParam - - @ReadonlyAttribute - public var forwardY: AudioParam - - @ReadonlyAttribute - public var forwardZ: AudioParam - - @ReadonlyAttribute - public var upX: AudioParam - - @ReadonlyAttribute - public var upY: AudioParam - - @ReadonlyAttribute - public var upZ: AudioParam - - @inlinable public func setPosition(x: Float, y: Float, z: Float) { - let this = jsObject - _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue, y.jsValue, z.jsValue]) - } - - @inlinable public func setOrientation(x: Float, y: Float, z: Float, xUp: Float, yUp: Float, zUp: Float) { - let _arg0 = x.jsValue - let _arg1 = y.jsValue - let _arg2 = z.jsValue - let _arg3 = xUp.jsValue - let _arg4 = yUp.jsValue - let _arg5 = zUp.jsValue - let this = jsObject - _ = this[Strings.setOrientation].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } -} diff --git a/Sources/DOMKit/WebIDL/AudioNode.swift b/Sources/DOMKit/WebIDL/AudioNode.swift deleted file mode 100644 index d4214b2f..00000000 --- a/Sources/DOMKit/WebIDL/AudioNode.swift +++ /dev/null @@ -1,81 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioNode: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _context = ReadonlyAttribute(jsObject: jsObject, name: Strings.context) - _numberOfInputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfInputs) - _numberOfOutputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfOutputs) - _channelCount = ReadWriteAttribute(jsObject: jsObject, name: Strings.channelCount) - _channelCountMode = ReadWriteAttribute(jsObject: jsObject, name: Strings.channelCountMode) - _channelInterpretation = ReadWriteAttribute(jsObject: jsObject, name: Strings.channelInterpretation) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self { - let this = jsObject - return this[Strings.connect].function!(this: this, arguments: [destinationNode.jsValue, output?.jsValue ?? .undefined, input?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func connect(destinationParam: AudioParam, output: UInt32? = nil) { - let this = jsObject - _ = this[Strings.connect].function!(this: this, arguments: [destinationParam.jsValue, output?.jsValue ?? .undefined]) - } - - @inlinable public func disconnect() { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: []) - } - - @inlinable public func disconnect(output: UInt32) { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [output.jsValue]) - } - - @inlinable public func disconnect(destinationNode: AudioNode) { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue]) - } - - @inlinable public func disconnect(destinationNode: AudioNode, output: UInt32) { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue, output.jsValue]) - } - - @inlinable public func disconnect(destinationNode: AudioNode, output: UInt32, input: UInt32) { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationNode.jsValue, output.jsValue, input.jsValue]) - } - - @inlinable public func disconnect(destinationParam: AudioParam) { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue]) - } - - @inlinable public func disconnect(destinationParam: AudioParam, output: UInt32) { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: [destinationParam.jsValue, output.jsValue]) - } - - @ReadonlyAttribute - public var context: BaseAudioContext - - @ReadonlyAttribute - public var numberOfInputs: UInt32 - - @ReadonlyAttribute - public var numberOfOutputs: UInt32 - - @ReadWriteAttribute - public var channelCount: UInt32 - - @ReadWriteAttribute - public var channelCountMode: ChannelCountMode - - @ReadWriteAttribute - public var channelInterpretation: ChannelInterpretation -} diff --git a/Sources/DOMKit/WebIDL/AudioNodeOptions.swift b/Sources/DOMKit/WebIDL/AudioNodeOptions.swift deleted file mode 100644 index 69e409e4..00000000 --- a/Sources/DOMKit/WebIDL/AudioNodeOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioNodeOptions: BridgedDictionary { - public convenience init(channelCount: UInt32, channelCountMode: ChannelCountMode, channelInterpretation: ChannelInterpretation) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.channelCount] = channelCount.jsValue - object[Strings.channelCountMode] = channelCountMode.jsValue - object[Strings.channelInterpretation] = channelInterpretation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) - _channelCountMode = ReadWriteAttribute(jsObject: object, name: Strings.channelCountMode) - _channelInterpretation = ReadWriteAttribute(jsObject: object, name: Strings.channelInterpretation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var channelCount: UInt32 - - @ReadWriteAttribute - public var channelCountMode: ChannelCountMode - - @ReadWriteAttribute - public var channelInterpretation: ChannelInterpretation -} diff --git a/Sources/DOMKit/WebIDL/AudioOutputOptions.swift b/Sources/DOMKit/WebIDL/AudioOutputOptions.swift deleted file mode 100644 index 9ec6a960..00000000 --- a/Sources/DOMKit/WebIDL/AudioOutputOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioOutputOptions: 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 -} diff --git a/Sources/DOMKit/WebIDL/AudioParam.swift b/Sources/DOMKit/WebIDL/AudioParam.swift deleted file mode 100644 index b28da617..00000000 --- a/Sources/DOMKit/WebIDL/AudioParam.swift +++ /dev/null @@ -1,69 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioParam: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioParam].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) - _automationRate = ReadWriteAttribute(jsObject: jsObject, name: Strings.automationRate) - _defaultValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.defaultValue) - _minValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.minValue) - _maxValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxValue) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var value: Float - - @ReadWriteAttribute - public var automationRate: AutomationRate - - @ReadonlyAttribute - public var defaultValue: Float - - @ReadonlyAttribute - public var minValue: Float - - @ReadonlyAttribute - public var maxValue: Float - - @inlinable public func setValueAtTime(value: Float, startTime: Double) -> Self { - let this = jsObject - return this[Strings.setValueAtTime].function!(this: this, arguments: [value.jsValue, startTime.jsValue]).fromJSValue()! - } - - @inlinable public func linearRampToValueAtTime(value: Float, endTime: Double) -> Self { - let this = jsObject - return this[Strings.linearRampToValueAtTime].function!(this: this, arguments: [value.jsValue, endTime.jsValue]).fromJSValue()! - } - - @inlinable public func exponentialRampToValueAtTime(value: Float, endTime: Double) -> Self { - let this = jsObject - return this[Strings.exponentialRampToValueAtTime].function!(this: this, arguments: [value.jsValue, endTime.jsValue]).fromJSValue()! - } - - @inlinable public func setTargetAtTime(target: Float, startTime: Double, timeConstant: Float) -> Self { - let this = jsObject - return this[Strings.setTargetAtTime].function!(this: this, arguments: [target.jsValue, startTime.jsValue, timeConstant.jsValue]).fromJSValue()! - } - - @inlinable public func setValueCurveAtTime(values: [Float], startTime: Double, duration: Double) -> Self { - let this = jsObject - return this[Strings.setValueCurveAtTime].function!(this: this, arguments: [values.jsValue, startTime.jsValue, duration.jsValue]).fromJSValue()! - } - - @inlinable public func cancelScheduledValues(cancelTime: Double) -> Self { - let this = jsObject - return this[Strings.cancelScheduledValues].function!(this: this, arguments: [cancelTime.jsValue]).fromJSValue()! - } - - @inlinable public func cancelAndHoldAtTime(cancelTime: Double) -> Self { - let this = jsObject - return this[Strings.cancelAndHoldAtTime].function!(this: this, arguments: [cancelTime.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift b/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift deleted file mode 100644 index bfe32cd8..00000000 --- a/Sources/DOMKit/WebIDL/AudioParamDescriptor.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioParamDescriptor: BridgedDictionary { - public convenience init(name: String, defaultValue: Float, minValue: Float, maxValue: Float, automationRate: AutomationRate) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.defaultValue] = defaultValue.jsValue - object[Strings.minValue] = minValue.jsValue - object[Strings.maxValue] = maxValue.jsValue - object[Strings.automationRate] = automationRate.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _defaultValue = ReadWriteAttribute(jsObject: object, name: Strings.defaultValue) - _minValue = ReadWriteAttribute(jsObject: object, name: Strings.minValue) - _maxValue = ReadWriteAttribute(jsObject: object, name: Strings.maxValue) - _automationRate = ReadWriteAttribute(jsObject: object, name: Strings.automationRate) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var defaultValue: Float - - @ReadWriteAttribute - public var minValue: Float - - @ReadWriteAttribute - public var maxValue: Float - - @ReadWriteAttribute - public var automationRate: AutomationRate -} diff --git a/Sources/DOMKit/WebIDL/AudioParamMap.swift b/Sources/DOMKit/WebIDL/AudioParamMap.swift deleted file mode 100644 index c9779693..00000000 --- a/Sources/DOMKit/WebIDL/AudioParamMap.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioParamMap: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioParamMap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift b/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift deleted file mode 100644 index 5bf8bd0f..00000000 --- a/Sources/DOMKit/WebIDL/AudioProcessingEvent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioProcessingEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioProcessingEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _playbackTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.playbackTime) - _inputBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputBuffer) - _outputBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.outputBuffer) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: AudioProcessingEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var playbackTime: Double - - @ReadonlyAttribute - public var inputBuffer: AudioBuffer - - @ReadonlyAttribute - public var outputBuffer: AudioBuffer -} diff --git a/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift b/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift deleted file mode 100644 index 67ce6925..00000000 --- a/Sources/DOMKit/WebIDL/AudioProcessingEventInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioProcessingEventInit: BridgedDictionary { - public convenience init(playbackTime: Double, inputBuffer: AudioBuffer, outputBuffer: AudioBuffer) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.playbackTime] = playbackTime.jsValue - object[Strings.inputBuffer] = inputBuffer.jsValue - object[Strings.outputBuffer] = outputBuffer.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _playbackTime = ReadWriteAttribute(jsObject: object, name: Strings.playbackTime) - _inputBuffer = ReadWriteAttribute(jsObject: object, name: Strings.inputBuffer) - _outputBuffer = ReadWriteAttribute(jsObject: object, name: Strings.outputBuffer) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var playbackTime: Double - - @ReadWriteAttribute - public var inputBuffer: AudioBuffer - - @ReadWriteAttribute - public var outputBuffer: AudioBuffer -} diff --git a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift b/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift deleted file mode 100644 index 2621c325..00000000 --- a/Sources/DOMKit/WebIDL/AudioScheduledSourceNode.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioScheduledSourceNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioScheduledSourceNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onended = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onended) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var onended: EventHandler - - @inlinable public func start(when: Double? = nil) { - let this = jsObject - _ = this[Strings.start].function!(this: this, arguments: [when?.jsValue ?? .undefined]) - } - - @inlinable public func stop(when: Double? = nil) { - let this = jsObject - _ = this[Strings.stop].function!(this: this, arguments: [when?.jsValue ?? .undefined]) - } -} diff --git a/Sources/DOMKit/WebIDL/AudioTimestamp.swift b/Sources/DOMKit/WebIDL/AudioTimestamp.swift deleted file mode 100644 index 9de5277b..00000000 --- a/Sources/DOMKit/WebIDL/AudioTimestamp.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioTimestamp: BridgedDictionary { - public convenience init(contextTime: Double, performanceTime: DOMHighResTimeStamp) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contextTime] = contextTime.jsValue - object[Strings.performanceTime] = performanceTime.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _contextTime = ReadWriteAttribute(jsObject: object, name: Strings.contextTime) - _performanceTime = ReadWriteAttribute(jsObject: object, name: Strings.performanceTime) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var contextTime: Double - - @ReadWriteAttribute - public var performanceTime: DOMHighResTimeStamp -} diff --git a/Sources/DOMKit/WebIDL/AudioWorklet.swift b/Sources/DOMKit/WebIDL/AudioWorklet.swift deleted file mode 100644 index 7dd1321f..00000000 --- a/Sources/DOMKit/WebIDL/AudioWorklet.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioWorklet: Worklet { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorklet].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift b/Sources/DOMKit/WebIDL/AudioWorkletNode.swift deleted file mode 100644 index e2867403..00000000 --- a/Sources/DOMKit/WebIDL/AudioWorkletNode.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioWorkletNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioWorkletNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _parameters = ReadonlyAttribute(jsObject: jsObject, name: Strings.parameters) - _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) - _onprocessorerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onprocessorerror) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, name: String, options: AudioWorkletNodeOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, name.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var parameters: AudioParamMap - - @ReadonlyAttribute - public var port: MessagePort - - @ClosureAttribute1Optional - public var onprocessorerror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift b/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift deleted file mode 100644 index 01213d25..00000000 --- a/Sources/DOMKit/WebIDL/AudioWorkletNodeOptions.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioWorkletNodeOptions: BridgedDictionary { - public convenience init(numberOfInputs: UInt32, numberOfOutputs: UInt32, outputChannelCount: [UInt32], parameterData: [String: Double], processorOptions: JSObject) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfInputs] = numberOfInputs.jsValue - object[Strings.numberOfOutputs] = numberOfOutputs.jsValue - object[Strings.outputChannelCount] = outputChannelCount.jsValue - object[Strings.parameterData] = parameterData.jsValue - object[Strings.processorOptions] = processorOptions.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _numberOfInputs = ReadWriteAttribute(jsObject: object, name: Strings.numberOfInputs) - _numberOfOutputs = ReadWriteAttribute(jsObject: object, name: Strings.numberOfOutputs) - _outputChannelCount = ReadWriteAttribute(jsObject: object, name: Strings.outputChannelCount) - _parameterData = ReadWriteAttribute(jsObject: object, name: Strings.parameterData) - _processorOptions = ReadWriteAttribute(jsObject: object, name: Strings.processorOptions) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var numberOfInputs: UInt32 - - @ReadWriteAttribute - public var numberOfOutputs: UInt32 - - @ReadWriteAttribute - public var outputChannelCount: [UInt32] - - @ReadWriteAttribute - public var parameterData: [String: Double] - - @ReadWriteAttribute - public var processorOptions: JSObject -} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift deleted file mode 100644 index 936337a1..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientInputs.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AuthenticationExtensionsClientInputs: BridgedDictionary { - public convenience init(payment: AuthenticationExtensionsPaymentInputs, appid: String, appidExclude: String, uvm: Bool, credProps: Bool, largeBlob: AuthenticationExtensionsLargeBlobInputs) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.payment] = payment.jsValue - object[Strings.appid] = appid.jsValue - object[Strings.appidExclude] = appidExclude.jsValue - object[Strings.uvm] = uvm.jsValue - object[Strings.credProps] = credProps.jsValue - object[Strings.largeBlob] = largeBlob.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _payment = ReadWriteAttribute(jsObject: object, name: Strings.payment) - _appid = ReadWriteAttribute(jsObject: object, name: Strings.appid) - _appidExclude = ReadWriteAttribute(jsObject: object, name: Strings.appidExclude) - _uvm = ReadWriteAttribute(jsObject: object, name: Strings.uvm) - _credProps = ReadWriteAttribute(jsObject: object, name: Strings.credProps) - _largeBlob = ReadWriteAttribute(jsObject: object, name: Strings.largeBlob) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var payment: AuthenticationExtensionsPaymentInputs - - @ReadWriteAttribute - public var appid: String - - @ReadWriteAttribute - public var appidExclude: String - - @ReadWriteAttribute - public var uvm: Bool - - @ReadWriteAttribute - public var credProps: Bool - - @ReadWriteAttribute - public var largeBlob: AuthenticationExtensionsLargeBlobInputs -} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift deleted file mode 100644 index 2daa915d..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsClientOutputs.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AuthenticationExtensionsClientOutputs: BridgedDictionary { - public convenience init(appid: Bool, appidExclude: Bool, uvm: UvmEntries, credProps: CredentialPropertiesOutput, largeBlob: AuthenticationExtensionsLargeBlobOutputs) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.appid] = appid.jsValue - object[Strings.appidExclude] = appidExclude.jsValue - object[Strings.uvm] = uvm.jsValue - object[Strings.credProps] = credProps.jsValue - object[Strings.largeBlob] = largeBlob.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _appid = ReadWriteAttribute(jsObject: object, name: Strings.appid) - _appidExclude = ReadWriteAttribute(jsObject: object, name: Strings.appidExclude) - _uvm = ReadWriteAttribute(jsObject: object, name: Strings.uvm) - _credProps = ReadWriteAttribute(jsObject: object, name: Strings.credProps) - _largeBlob = ReadWriteAttribute(jsObject: object, name: Strings.largeBlob) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var appid: Bool - - @ReadWriteAttribute - public var appidExclude: Bool - - @ReadWriteAttribute - public var uvm: UvmEntries - - @ReadWriteAttribute - public var credProps: CredentialPropertiesOutput - - @ReadWriteAttribute - public var largeBlob: AuthenticationExtensionsLargeBlobOutputs -} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift deleted file mode 100644 index e0da3998..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobInputs.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AuthenticationExtensionsLargeBlobInputs: BridgedDictionary { - public convenience init(support: String, read: Bool, write: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.support] = support.jsValue - object[Strings.read] = read.jsValue - object[Strings.write] = write.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _support = ReadWriteAttribute(jsObject: object, name: Strings.support) - _read = ReadWriteAttribute(jsObject: object, name: Strings.read) - _write = ReadWriteAttribute(jsObject: object, name: Strings.write) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var support: String - - @ReadWriteAttribute - public var read: Bool - - @ReadWriteAttribute - public var write: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift deleted file mode 100644 index 9427b984..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsLargeBlobOutputs.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AuthenticationExtensionsLargeBlobOutputs: BridgedDictionary { - public convenience init(supported: Bool, blob: ArrayBuffer, written: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supported] = supported.jsValue - object[Strings.blob] = blob.jsValue - object[Strings.written] = written.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) - _blob = ReadWriteAttribute(jsObject: object, name: Strings.blob) - _written = ReadWriteAttribute(jsObject: object, name: Strings.written) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var supported: Bool - - @ReadWriteAttribute - public var blob: ArrayBuffer - - @ReadWriteAttribute - public var written: Bool -} diff --git a/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift b/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift deleted file mode 100644 index 4169f784..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticationExtensionsPaymentInputs.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AuthenticationExtensionsPaymentInputs: BridgedDictionary { - public convenience init(isPayment: Bool, rp: String, topOrigin: String, payeeOrigin: String, total: PaymentCurrencyAmount, instrument: PaymentCredentialInstrument) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.isPayment] = isPayment.jsValue - object[Strings.rp] = rp.jsValue - object[Strings.topOrigin] = topOrigin.jsValue - object[Strings.payeeOrigin] = payeeOrigin.jsValue - object[Strings.total] = total.jsValue - object[Strings.instrument] = instrument.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _isPayment = ReadWriteAttribute(jsObject: object, name: Strings.isPayment) - _rp = ReadWriteAttribute(jsObject: object, name: Strings.rp) - _topOrigin = ReadWriteAttribute(jsObject: object, name: Strings.topOrigin) - _payeeOrigin = ReadWriteAttribute(jsObject: object, name: Strings.payeeOrigin) - _total = ReadWriteAttribute(jsObject: object, name: Strings.total) - _instrument = ReadWriteAttribute(jsObject: object, name: Strings.instrument) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var isPayment: Bool - - @ReadWriteAttribute - public var rp: String - - @ReadWriteAttribute - public var topOrigin: String - - @ReadWriteAttribute - public var payeeOrigin: String - - @ReadWriteAttribute - public var total: PaymentCurrencyAmount - - @ReadWriteAttribute - public var instrument: PaymentCredentialInstrument -} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift deleted file mode 100644 index 8332dbf6..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticatorAssertionResponse.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AuthenticatorAssertionResponse: AuthenticatorResponse { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorAssertionResponse].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _authenticatorData = ReadonlyAttribute(jsObject: jsObject, name: Strings.authenticatorData) - _signature = ReadonlyAttribute(jsObject: jsObject, name: Strings.signature) - _userHandle = ReadonlyAttribute(jsObject: jsObject, name: Strings.userHandle) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var authenticatorData: ArrayBuffer - - @ReadonlyAttribute - public var signature: ArrayBuffer - - @ReadonlyAttribute - public var userHandle: ArrayBuffer? -} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift b/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift deleted file mode 100644 index 42a70ba0..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticatorAttachment.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AuthenticatorAttachment: JSString, JSValueCompatible { - case platform = "platform" - case crossPlatform = "cross-platform" - - @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/AuthenticatorAttestationResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift deleted file mode 100644 index 46c95741..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticatorAttestationResponse.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AuthenticatorAttestationResponse: AuthenticatorResponse { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorAttestationResponse].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _attestationObject = ReadonlyAttribute(jsObject: jsObject, name: Strings.attestationObject) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var attestationObject: ArrayBuffer - - @inlinable public func getTransports() -> [String] { - let this = jsObject - return this[Strings.getTransports].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getAuthenticatorData() -> ArrayBuffer { - let this = jsObject - return this[Strings.getAuthenticatorData].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getPublicKey() -> ArrayBuffer? { - let this = jsObject - return this[Strings.getPublicKey].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getPublicKeyAlgorithm() -> COSEAlgorithmIdentifier { - let this = jsObject - return this[Strings.getPublicKeyAlgorithm].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift b/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift deleted file mode 100644 index b227a467..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticatorResponse.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AuthenticatorResponse: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AuthenticatorResponse].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _clientDataJSON = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientDataJSON) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var clientDataJSON: ArrayBuffer -} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift b/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift deleted file mode 100644 index 8b739cc1..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticatorSelectionCriteria.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AuthenticatorSelectionCriteria: BridgedDictionary { - public convenience init(authenticatorAttachment: String, residentKey: String, requireResidentKey: Bool, userVerification: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.authenticatorAttachment] = authenticatorAttachment.jsValue - object[Strings.residentKey] = residentKey.jsValue - object[Strings.requireResidentKey] = requireResidentKey.jsValue - object[Strings.userVerification] = userVerification.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _authenticatorAttachment = ReadWriteAttribute(jsObject: object, name: Strings.authenticatorAttachment) - _residentKey = ReadWriteAttribute(jsObject: object, name: Strings.residentKey) - _requireResidentKey = ReadWriteAttribute(jsObject: object, name: Strings.requireResidentKey) - _userVerification = ReadWriteAttribute(jsObject: object, name: Strings.userVerification) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var authenticatorAttachment: String - - @ReadWriteAttribute - public var residentKey: String - - @ReadWriteAttribute - public var requireResidentKey: Bool - - @ReadWriteAttribute - public var userVerification: String -} diff --git a/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift b/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift deleted file mode 100644 index 3201d7e8..00000000 --- a/Sources/DOMKit/WebIDL/AuthenticatorTransport.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AuthenticatorTransport: JSString, JSValueCompatible { - case usb = "usb" - case nfc = "nfc" - case ble = "ble" - case `internal` = "internal" - - @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/AutoKeyword.swift b/Sources/DOMKit/WebIDL/AutoKeyword.swift deleted file mode 100644 index 2052c97f..00000000 --- a/Sources/DOMKit/WebIDL/AutoKeyword.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AutoKeyword: JSString, JSValueCompatible { - 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 } -} diff --git a/Sources/DOMKit/WebIDL/AutomationRate.swift b/Sources/DOMKit/WebIDL/AutomationRate.swift deleted file mode 100644 index 849486e0..00000000 --- a/Sources/DOMKit/WebIDL/AutomationRate.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AutomationRate: JSString, JSValueCompatible { - case aRate = "a-rate" - case kRate = "k-rate" - - @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/AutoplayPolicy.swift b/Sources/DOMKit/WebIDL/AutoplayPolicy.swift deleted file mode 100644 index a1cbbade..00000000 --- a/Sources/DOMKit/WebIDL/AutoplayPolicy.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AutoplayPolicy: JSString, JSValueCompatible { - case allowed = "allowed" - case allowedMuted = "allowed-muted" - case disallowed = "disallowed" - - @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/AutoplayPolicyMediaType.swift b/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift deleted file mode 100644 index 3c9309bf..00000000 --- a/Sources/DOMKit/WebIDL/AutoplayPolicyMediaType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AutoplayPolicyMediaType: JSString, JSValueCompatible { - case mediaelement = "mediaelement" - case audiocontext = "audiocontext" - - @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/BackgroundFetchEventInit.swift b/Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift deleted file mode 100644 index c7b4a431..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BackgroundFetchEventInit: BridgedDictionary { - public convenience init(registration: BackgroundFetchRegistration) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.registration] = registration.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _registration = ReadWriteAttribute(jsObject: object, name: Strings.registration) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var registration: BackgroundFetchRegistration -} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift b/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift deleted file mode 100644 index 75ceadc2..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchFailureReason.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum BackgroundFetchFailureReason: JSString, JSValueCompatible { - case _empty = "" - case aborted = "aborted" - case badStatus = "bad-status" - case fetchError = "fetch-error" - case quotaExceeded = "quota-exceeded" - case downloadTotalExceeded = "download-total-exceeded" - - @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/BackgroundFetchManager.swift b/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift deleted file mode 100644 index cb248840..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchManager.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BackgroundFetchManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func fetch(id: String, requests: RequestInfo_or_seq_of_RequestInfo, options: BackgroundFetchOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.fetch].function!(this: this, arguments: [id.jsValue, requests.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func fetch(id: String, requests: RequestInfo_or_seq_of_RequestInfo, options: BackgroundFetchOptions? = nil) async throws -> BackgroundFetchRegistration { - let this = jsObject - let _promise: JSPromise = this[Strings.fetch].function!(this: this, arguments: [id.jsValue, requests.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func get(id: String) -> JSPromise { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [id.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func get(id: String) async throws -> BackgroundFetchRegistration? { - let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [id.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getIds() -> JSPromise { - let this = jsObject - return this[Strings.getIds].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getIds() async throws -> [String] { - let this = jsObject - let _promise: JSPromise = this[Strings.getIds].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift b/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift deleted file mode 100644 index e611cbb3..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BackgroundFetchOptions: BridgedDictionary { - public convenience init(downloadTotal: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.downloadTotal] = downloadTotal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _downloadTotal = ReadWriteAttribute(jsObject: object, name: Strings.downloadTotal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var downloadTotal: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift b/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift deleted file mode 100644 index 41f588b2..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchRecord.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BackgroundFetchRecord: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchRecord].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _request = ReadonlyAttribute(jsObject: jsObject, name: Strings.request) - _responseReady = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseReady) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var request: Request - - @ReadonlyAttribute - public var responseReady: JSPromise -} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift b/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift deleted file mode 100644 index 25c25d71..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchRegistration.swift +++ /dev/null @@ -1,84 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BackgroundFetchRegistration: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BackgroundFetchRegistration].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _uploadTotal = ReadonlyAttribute(jsObject: jsObject, name: Strings.uploadTotal) - _uploaded = ReadonlyAttribute(jsObject: jsObject, name: Strings.uploaded) - _downloadTotal = ReadonlyAttribute(jsObject: jsObject, name: Strings.downloadTotal) - _downloaded = ReadonlyAttribute(jsObject: jsObject, name: Strings.downloaded) - _result = ReadonlyAttribute(jsObject: jsObject, name: Strings.result) - _failureReason = ReadonlyAttribute(jsObject: jsObject, name: Strings.failureReason) - _recordsAvailable = ReadonlyAttribute(jsObject: jsObject, name: Strings.recordsAvailable) - _onprogress = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onprogress) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var uploadTotal: UInt64 - - @ReadonlyAttribute - public var uploaded: UInt64 - - @ReadonlyAttribute - public var downloadTotal: UInt64 - - @ReadonlyAttribute - public var downloaded: UInt64 - - @ReadonlyAttribute - public var result: BackgroundFetchResult - - @ReadonlyAttribute - public var failureReason: BackgroundFetchFailureReason - - @ReadonlyAttribute - public var recordsAvailable: Bool - - @ClosureAttribute1Optional - public var onprogress: EventHandler - - @inlinable public func abort() -> JSPromise { - let this = jsObject - return this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func abort() async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @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()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> BackgroundFetchRecord { - 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 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()! - } - - @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 -> [BackgroundFetchRecord] { - 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()! - } -} diff --git a/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift b/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift deleted file mode 100644 index e14e7d51..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchResult.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum BackgroundFetchResult: JSString, JSValueCompatible { - case _empty = "" - case success = "success" - case failure = "failure" - - @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/BackgroundFetchUIOptions.swift b/Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift deleted file mode 100644 index 54ec8cbd..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundFetchUIOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BackgroundFetchUIOptions: BridgedDictionary { - public convenience init(icons: [ImageResource], title: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.icons] = icons.jsValue - object[Strings.title] = title.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _icons = ReadWriteAttribute(jsObject: object, name: Strings.icons) - _title = ReadWriteAttribute(jsObject: object, name: Strings.title) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var icons: [ImageResource] - - @ReadWriteAttribute - public var title: String -} diff --git a/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift b/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift deleted file mode 100644 index 27962a31..00000000 --- a/Sources/DOMKit/WebIDL/BackgroundSyncOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BackgroundSyncOptions: BridgedDictionary { - public convenience init(minInterval: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.minInterval] = minInterval.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _minInterval = ReadWriteAttribute(jsObject: object, name: Strings.minInterval) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var minInterval: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/BarcodeDetector.swift b/Sources/DOMKit/WebIDL/BarcodeDetector.swift deleted file mode 100644 index 67318ee1..00000000 --- a/Sources/DOMKit/WebIDL/BarcodeDetector.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BarcodeDetector: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BarcodeDetector].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(barcodeDetectorOptions: BarcodeDetectorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [barcodeDetectorOptions?.jsValue ?? .undefined])) - } - - @inlinable public static func getSupportedFormats() -> JSPromise { - let this = constructor - return this[Strings.getSupportedFormats].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func getSupportedFormats() async throws -> [BarcodeFormat] { - let this = constructor - let _promise: JSPromise = this[Strings.getSupportedFormats].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func detect(image: ImageBitmapSource) -> JSPromise { - let this = jsObject - return this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func detect(image: ImageBitmapSource) async throws -> [DetectedBarcode] { - let this = jsObject - let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift b/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift deleted file mode 100644 index 21f75e0e..00000000 --- a/Sources/DOMKit/WebIDL/BarcodeDetectorOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BarcodeDetectorOptions: BridgedDictionary { - public convenience init(formats: [BarcodeFormat]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.formats] = formats.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _formats = ReadWriteAttribute(jsObject: object, name: Strings.formats) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var formats: [BarcodeFormat] -} diff --git a/Sources/DOMKit/WebIDL/BarcodeFormat.swift b/Sources/DOMKit/WebIDL/BarcodeFormat.swift deleted file mode 100644 index 3fda481c..00000000 --- a/Sources/DOMKit/WebIDL/BarcodeFormat.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum BarcodeFormat: JSString, JSValueCompatible { - case aztec = "aztec" - case code128 = "code_128" - case code39 = "code_39" - case code93 = "code_93" - case codabar = "codabar" - case dataMatrix = "data_matrix" - case ean13 = "ean_13" - case ean8 = "ean_8" - case itf = "itf" - case pdf417 = "pdf417" - case qrCode = "qr_code" - case unknown = "unknown" - case upcA = "upc_a" - case upcE = "upc_e" - - @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/BaseAudioContext.swift b/Sources/DOMKit/WebIDL/BaseAudioContext.swift deleted file mode 100644 index 4b1e6b88..00000000 --- a/Sources/DOMKit/WebIDL/BaseAudioContext.swift +++ /dev/null @@ -1,134 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BaseAudioContext: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BaseAudioContext].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _destination = ReadonlyAttribute(jsObject: jsObject, name: Strings.destination) - _sampleRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleRate) - _currentTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTime) - _listener = ReadonlyAttribute(jsObject: jsObject, name: Strings.listener) - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _audioWorklet = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioWorklet) - _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var destination: AudioDestinationNode - - @ReadonlyAttribute - public var sampleRate: Float - - @ReadonlyAttribute - public var currentTime: Double - - @ReadonlyAttribute - public var listener: AudioListener - - @ReadonlyAttribute - public var state: AudioContextState - - @ReadonlyAttribute - public var audioWorklet: AudioWorklet - - @ClosureAttribute1Optional - public var onstatechange: EventHandler - - @inlinable public func createAnalyser() -> AnalyserNode { - let this = jsObject - return this[Strings.createAnalyser].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createBiquadFilter() -> BiquadFilterNode { - let this = jsObject - return this[Strings.createBiquadFilter].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createBuffer(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) -> AudioBuffer { - let this = jsObject - return this[Strings.createBuffer].function!(this: this, arguments: [numberOfChannels.jsValue, length.jsValue, sampleRate.jsValue]).fromJSValue()! - } - - @inlinable public func createBufferSource() -> AudioBufferSourceNode { - let this = jsObject - return this[Strings.createBufferSource].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createChannelMerger(numberOfInputs: UInt32? = nil) -> ChannelMergerNode { - let this = jsObject - return this[Strings.createChannelMerger].function!(this: this, arguments: [numberOfInputs?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createChannelSplitter(numberOfOutputs: UInt32? = nil) -> ChannelSplitterNode { - let this = jsObject - return this[Strings.createChannelSplitter].function!(this: this, arguments: [numberOfOutputs?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createConstantSource() -> ConstantSourceNode { - let this = jsObject - return this[Strings.createConstantSource].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createConvolver() -> ConvolverNode { - let this = jsObject - return this[Strings.createConvolver].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createDelay(maxDelayTime: Double? = nil) -> DelayNode { - let this = jsObject - return this[Strings.createDelay].function!(this: this, arguments: [maxDelayTime?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createDynamicsCompressor() -> DynamicsCompressorNode { - let this = jsObject - return this[Strings.createDynamicsCompressor].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createGain() -> GainNode { - let this = jsObject - return this[Strings.createGain].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createIIRFilter(feedforward: [Double], feedback: [Double]) -> IIRFilterNode { - let this = jsObject - return this[Strings.createIIRFilter].function!(this: this, arguments: [feedforward.jsValue, feedback.jsValue]).fromJSValue()! - } - - @inlinable public func createOscillator() -> OscillatorNode { - let this = jsObject - return this[Strings.createOscillator].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createPanner() -> PannerNode { - let this = jsObject - return this[Strings.createPanner].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createPeriodicWave(real: [Float], imag: [Float], constraints: PeriodicWaveConstraints? = nil) -> PeriodicWave { - let this = jsObject - return this[Strings.createPeriodicWave].function!(this: this, arguments: [real.jsValue, imag.jsValue, constraints?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createScriptProcessor(bufferSize: UInt32? = nil, numberOfInputChannels: UInt32? = nil, numberOfOutputChannels: UInt32? = nil) -> ScriptProcessorNode { - let this = jsObject - return this[Strings.createScriptProcessor].function!(this: this, arguments: [bufferSize?.jsValue ?? .undefined, numberOfInputChannels?.jsValue ?? .undefined, numberOfOutputChannels?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createStereoPanner() -> StereoPannerNode { - let this = jsObject - return this[Strings.createStereoPanner].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createWaveShaper() -> WaveShaperNode { - let this = jsObject - return this[Strings.createWaveShaper].function!(this: this, arguments: []).fromJSValue()! - } - - // XXX: member 'decodeAudioData' is ignored - - // XXX: member 'decodeAudioData' is ignored -} diff --git a/Sources/DOMKit/WebIDL/Baseline.swift b/Sources/DOMKit/WebIDL/Baseline.swift deleted file mode 100644 index 3996a9cc..00000000 --- a/Sources/DOMKit/WebIDL/Baseline.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Baseline: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Baseline].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var value: Double -} diff --git a/Sources/DOMKit/WebIDL/BatteryManager.swift b/Sources/DOMKit/WebIDL/BatteryManager.swift deleted file mode 100644 index aaa66ee3..00000000 --- a/Sources/DOMKit/WebIDL/BatteryManager.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BatteryManager: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BatteryManager].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _charging = ReadonlyAttribute(jsObject: jsObject, name: Strings.charging) - _chargingTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.chargingTime) - _dischargingTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.dischargingTime) - _level = ReadonlyAttribute(jsObject: jsObject, name: Strings.level) - _onchargingchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchargingchange) - _onchargingtimechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchargingtimechange) - _ondischargingtimechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondischargingtimechange) - _onlevelchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onlevelchange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var charging: Bool - - @ReadonlyAttribute - public var chargingTime: Double - - @ReadonlyAttribute - public var dischargingTime: Double - - @ReadonlyAttribute - public var level: Double - - @ClosureAttribute1Optional - public var onchargingchange: EventHandler - - @ClosureAttribute1Optional - public var onchargingtimechange: EventHandler - - @ClosureAttribute1Optional - public var ondischargingtimechange: EventHandler - - @ClosureAttribute1Optional - public var onlevelchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift b/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift deleted file mode 100644 index f8b0274b..00000000 --- a/Sources/DOMKit/WebIDL/BeforeInstallPromptEvent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BeforeInstallPromptEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BeforeInstallPromptEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: EventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @inlinable public func prompt() -> JSPromise { - let this = jsObject - return this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func prompt() async throws -> PromptResponseObject { - let this = jsObject - let _promise: JSPromise = this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/BinaryData_or_String.swift b/Sources/DOMKit/WebIDL/BinaryData_or_String.swift deleted file mode 100644 index 4d8fea50..00000000 --- a/Sources/DOMKit/WebIDL/BinaryData_or_String.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_BinaryData_or_String: ConvertibleToJSValue {} -extension BinaryData: Any_BinaryData_or_String {} -extension String: Any_BinaryData_or_String {} - -public enum BinaryData_or_String: JSValueCompatible, Any_BinaryData_or_String { - case binaryData(BinaryData) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let binaryData: BinaryData = value.fromJSValue() { - return .binaryData(binaryData) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .binaryData(binaryData): - return binaryData.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/BinaryType.swift b/Sources/DOMKit/WebIDL/BinaryType.swift deleted file mode 100644 index 65f46a02..00000000 --- a/Sources/DOMKit/WebIDL/BinaryType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum BinaryType: JSString, JSValueCompatible { - case blob = "blob" - case arraybuffer = "arraybuffer" - - @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/BiquadFilterNode.swift b/Sources/DOMKit/WebIDL/BiquadFilterNode.swift deleted file mode 100644 index 7c53089f..00000000 --- a/Sources/DOMKit/WebIDL/BiquadFilterNode.swift +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BiquadFilterNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BiquadFilterNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) - _frequency = ReadonlyAttribute(jsObject: jsObject, name: Strings.frequency) - _detune = ReadonlyAttribute(jsObject: jsObject, name: Strings.detune) - _Q = ReadonlyAttribute(jsObject: jsObject, name: Strings.Q) - _gain = ReadonlyAttribute(jsObject: jsObject, name: Strings.gain) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: BiquadFilterOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var type: BiquadFilterType - - @ReadonlyAttribute - public var frequency: AudioParam - - @ReadonlyAttribute - public var detune: AudioParam - - @ReadonlyAttribute - public var Q: AudioParam - - @ReadonlyAttribute - public var gain: AudioParam - - @inlinable public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { - let this = jsObject - _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue, magResponse.jsValue, phaseResponse.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift b/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift deleted file mode 100644 index e00ccdb5..00000000 --- a/Sources/DOMKit/WebIDL/BiquadFilterOptions.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BiquadFilterOptions: BridgedDictionary { - public convenience init(type: BiquadFilterType, Q: Float, detune: Float, frequency: Float, gain: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.Q] = Q.jsValue - object[Strings.detune] = detune.jsValue - object[Strings.frequency] = frequency.jsValue - object[Strings.gain] = gain.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _Q = ReadWriteAttribute(jsObject: object, name: Strings.Q) - _detune = ReadWriteAttribute(jsObject: object, name: Strings.detune) - _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) - _gain = ReadWriteAttribute(jsObject: object, name: Strings.gain) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: BiquadFilterType - - @ReadWriteAttribute - public var Q: Float - - @ReadWriteAttribute - public var detune: Float - - @ReadWriteAttribute - public var frequency: Float - - @ReadWriteAttribute - public var gain: Float -} diff --git a/Sources/DOMKit/WebIDL/BiquadFilterType.swift b/Sources/DOMKit/WebIDL/BiquadFilterType.swift deleted file mode 100644 index 1a6858b8..00000000 --- a/Sources/DOMKit/WebIDL/BiquadFilterType.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum BiquadFilterType: JSString, JSValueCompatible { - case lowpass = "lowpass" - case highpass = "highpass" - case bandpass = "bandpass" - case lowshelf = "lowshelf" - case highshelf = "highshelf" - case peaking = "peaking" - case notch = "notch" - case allpass = "allpass" - - @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/BlockFragmentationType.swift b/Sources/DOMKit/WebIDL/BlockFragmentationType.swift deleted file mode 100644 index 6404399c..00000000 --- a/Sources/DOMKit/WebIDL/BlockFragmentationType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum BlockFragmentationType: JSString, JSValueCompatible { - case none = "none" - case page = "page" - case column = "column" - case region = "region" - - @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/Bluetooth.swift b/Sources/DOMKit/WebIDL/Bluetooth.swift deleted file mode 100644 index c7e517d6..00000000 --- a/Sources/DOMKit/WebIDL/Bluetooth.swift +++ /dev/null @@ -1,56 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Bluetooth: EventTarget, BluetoothDeviceEventHandlers, CharacteristicEventHandlers, ServiceEventHandlers { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Bluetooth].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onavailabilitychanged = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onavailabilitychanged) - _referringDevice = ReadonlyAttribute(jsObject: jsObject, name: Strings.referringDevice) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func getAvailability() -> JSPromise { - let this = jsObject - return this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getAvailability() async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ClosureAttribute1Optional - public var onavailabilitychanged: EventHandler - - @ReadonlyAttribute - public var referringDevice: BluetoothDevice? - - @inlinable public func getDevices() -> JSPromise { - let this = jsObject - return this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDevices() async throws -> [BluetoothDevice] { - let this = jsObject - let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func requestDevice(options: RequestDeviceOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestDevice(options: RequestDeviceOptions? = nil) async throws -> BluetoothDevice { - let this = jsObject - let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift deleted file mode 100644 index c81962bf..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEvent.swift +++ /dev/null @@ -1,48 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothAdvertisingEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothAdvertisingEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) - _uuids = ReadonlyAttribute(jsObject: jsObject, name: Strings.uuids) - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _appearance = ReadonlyAttribute(jsObject: jsObject, name: Strings.appearance) - _txPower = ReadonlyAttribute(jsObject: jsObject, name: Strings.txPower) - _rssi = ReadonlyAttribute(jsObject: jsObject, name: Strings.rssi) - _manufacturerData = ReadonlyAttribute(jsObject: jsObject, name: Strings.manufacturerData) - _serviceData = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceData) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, init: BluetoothAdvertisingEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, `init`.jsValue])) - } - - @ReadonlyAttribute - public var device: BluetoothDevice - - @ReadonlyAttribute - public var uuids: [UUID] - - @ReadonlyAttribute - public var name: String? - - @ReadonlyAttribute - public var appearance: UInt16? - - @ReadonlyAttribute - public var txPower: Int8? - - @ReadonlyAttribute - public var rssi: Int8? - - @ReadonlyAttribute - public var manufacturerData: BluetoothManufacturerDataMap - - @ReadonlyAttribute - public var serviceData: BluetoothServiceDataMap -} diff --git a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift b/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift deleted file mode 100644 index 33d9febc..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothAdvertisingEventInit.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothAdvertisingEventInit: BridgedDictionary { - public convenience init(device: BluetoothDevice, uuids: [String_or_UInt32], name: String, appearance: UInt16, txPower: Int8, rssi: Int8, manufacturerData: BluetoothManufacturerDataMap, serviceData: BluetoothServiceDataMap) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue - object[Strings.uuids] = uuids.jsValue - object[Strings.name] = name.jsValue - object[Strings.appearance] = appearance.jsValue - object[Strings.txPower] = txPower.jsValue - object[Strings.rssi] = rssi.jsValue - object[Strings.manufacturerData] = manufacturerData.jsValue - object[Strings.serviceData] = serviceData.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _device = ReadWriteAttribute(jsObject: object, name: Strings.device) - _uuids = ReadWriteAttribute(jsObject: object, name: Strings.uuids) - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _appearance = ReadWriteAttribute(jsObject: object, name: Strings.appearance) - _txPower = ReadWriteAttribute(jsObject: object, name: Strings.txPower) - _rssi = ReadWriteAttribute(jsObject: object, name: Strings.rssi) - _manufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.manufacturerData) - _serviceData = ReadWriteAttribute(jsObject: object, name: Strings.serviceData) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var device: BluetoothDevice - - @ReadWriteAttribute - public var uuids: [String_or_UInt32] - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var appearance: UInt16 - - @ReadWriteAttribute - public var txPower: Int8 - - @ReadWriteAttribute - public var rssi: Int8 - - @ReadWriteAttribute - public var manufacturerData: BluetoothManufacturerDataMap - - @ReadWriteAttribute - public var serviceData: BluetoothServiceDataMap -} diff --git a/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift b/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift deleted file mode 100644 index d566cb08..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothCharacteristicProperties.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothCharacteristicProperties: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothCharacteristicProperties].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _broadcast = ReadonlyAttribute(jsObject: jsObject, name: Strings.broadcast) - _read = ReadonlyAttribute(jsObject: jsObject, name: Strings.read) - _writeWithoutResponse = ReadonlyAttribute(jsObject: jsObject, name: Strings.writeWithoutResponse) - _write = ReadonlyAttribute(jsObject: jsObject, name: Strings.write) - _notify = ReadonlyAttribute(jsObject: jsObject, name: Strings.notify) - _indicate = ReadonlyAttribute(jsObject: jsObject, name: Strings.indicate) - _authenticatedSignedWrites = ReadonlyAttribute(jsObject: jsObject, name: Strings.authenticatedSignedWrites) - _reliableWrite = ReadonlyAttribute(jsObject: jsObject, name: Strings.reliableWrite) - _writableAuxiliaries = ReadonlyAttribute(jsObject: jsObject, name: Strings.writableAuxiliaries) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var broadcast: Bool - - @ReadonlyAttribute - public var read: Bool - - @ReadonlyAttribute - public var writeWithoutResponse: Bool - - @ReadonlyAttribute - public var write: Bool - - @ReadonlyAttribute - public var notify: Bool - - @ReadonlyAttribute - public var indicate: Bool - - @ReadonlyAttribute - public var authenticatedSignedWrites: Bool - - @ReadonlyAttribute - public var reliableWrite: Bool - - @ReadonlyAttribute - public var writableAuxiliaries: Bool -} diff --git a/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift deleted file mode 100644 index 20ed4bc2..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothDataFilterInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothDataFilterInit: BridgedDictionary { - public convenience init(dataPrefix: BufferSource, mask: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataPrefix] = dataPrefix.jsValue - object[Strings.mask] = mask.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _dataPrefix = ReadWriteAttribute(jsObject: object, name: Strings.dataPrefix) - _mask = ReadWriteAttribute(jsObject: object, name: Strings.mask) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var dataPrefix: BufferSource - - @ReadWriteAttribute - public var mask: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/BluetoothDevice.swift b/Sources/DOMKit/WebIDL/BluetoothDevice.swift deleted file mode 100644 index 9499eed8..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothDevice.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothDevice: EventTarget, BluetoothDeviceEventHandlers, CharacteristicEventHandlers, ServiceEventHandlers { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothDevice].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _gatt = ReadonlyAttribute(jsObject: jsObject, name: Strings.gatt) - _watchingAdvertisements = ReadonlyAttribute(jsObject: jsObject, name: Strings.watchingAdvertisements) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var name: String? - - @ReadonlyAttribute - public var gatt: BluetoothRemoteGATTServer? - - @inlinable public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func watchAdvertisements(options: WatchAdvertisementsOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.watchAdvertisements].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @ReadonlyAttribute - public var watchingAdvertisements: Bool -} diff --git a/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift b/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift deleted file mode 100644 index c648e436..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothDeviceEventHandlers.swift +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol BluetoothDeviceEventHandlers: JSBridgedClass {} -public extension BluetoothDeviceEventHandlers { - @inlinable var onadvertisementreceived: EventHandler { - get { ClosureAttribute1Optional[Strings.onadvertisementreceived, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onadvertisementreceived, in: jsObject] = newValue } - } - - @inlinable var ongattserverdisconnected: EventHandler { - get { ClosureAttribute1Optional[Strings.ongattserverdisconnected, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ongattserverdisconnected, in: jsObject] = newValue } - } -} diff --git a/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift deleted file mode 100644 index 50ec6679..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothLEScanFilterInit.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothLEScanFilterInit: BridgedDictionary { - public convenience init(services: [BluetoothServiceUUID], name: String, namePrefix: String, manufacturerData: [BluetoothManufacturerDataFilterInit], serviceData: [BluetoothServiceDataFilterInit]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.services] = services.jsValue - object[Strings.name] = name.jsValue - object[Strings.namePrefix] = namePrefix.jsValue - object[Strings.manufacturerData] = manufacturerData.jsValue - object[Strings.serviceData] = serviceData.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _services = ReadWriteAttribute(jsObject: object, name: Strings.services) - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _namePrefix = ReadWriteAttribute(jsObject: object, name: Strings.namePrefix) - _manufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.manufacturerData) - _serviceData = ReadWriteAttribute(jsObject: object, name: Strings.serviceData) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var services: [BluetoothServiceUUID] - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var namePrefix: String - - @ReadWriteAttribute - public var manufacturerData: [BluetoothManufacturerDataFilterInit] - - @ReadWriteAttribute - public var serviceData: [BluetoothServiceDataFilterInit] -} diff --git a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift deleted file mode 100644 index 11530424..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataFilterInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothManufacturerDataFilterInit: BridgedDictionary { - public convenience init(companyIdentifier: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.companyIdentifier] = companyIdentifier.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _companyIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.companyIdentifier) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var companyIdentifier: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift b/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift deleted file mode 100644 index 8638913f..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothManufacturerDataMap.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothManufacturerDataMap: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothManufacturerDataMap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift deleted file mode 100644 index d0c309e8..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothPermissionDescriptor.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothPermissionDescriptor: BridgedDictionary { - public convenience init(deviceId: String, filters: [BluetoothLEScanFilterInit], optionalServices: [BluetoothServiceUUID], optionalManufacturerData: [UInt16], acceptAllDevices: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.deviceId] = deviceId.jsValue - object[Strings.filters] = filters.jsValue - object[Strings.optionalServices] = optionalServices.jsValue - object[Strings.optionalManufacturerData] = optionalManufacturerData.jsValue - object[Strings.acceptAllDevices] = acceptAllDevices.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) - _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) - _optionalServices = ReadWriteAttribute(jsObject: object, name: Strings.optionalServices) - _optionalManufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.optionalManufacturerData) - _acceptAllDevices = ReadWriteAttribute(jsObject: object, name: Strings.acceptAllDevices) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var deviceId: String - - @ReadWriteAttribute - public var filters: [BluetoothLEScanFilterInit] - - @ReadWriteAttribute - public var optionalServices: [BluetoothServiceUUID] - - @ReadWriteAttribute - public var optionalManufacturerData: [UInt16] - - @ReadWriteAttribute - public var acceptAllDevices: Bool -} diff --git a/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift b/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift deleted file mode 100644 index d7433ff2..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothPermissionResult.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothPermissionResult: PermissionStatus { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothPermissionResult].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _devices = ReadWriteAttribute(jsObject: jsObject, name: Strings.devices) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var devices: [BluetoothDevice] -} diff --git a/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift b/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift deleted file mode 100644 index 4b909682..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothPermissionStorage.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothPermissionStorage: BridgedDictionary { - public convenience init(allowedDevices: [AllowedBluetoothDevice]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowedDevices] = allowedDevices.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _allowedDevices = ReadWriteAttribute(jsObject: object, name: Strings.allowedDevices) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var allowedDevices: [AllowedBluetoothDevice] -} diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift deleted file mode 100644 index 4c5d982b..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTCharacteristic.swift +++ /dev/null @@ -1,124 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothRemoteGATTCharacteristic: EventTarget, CharacteristicEventHandlers { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTCharacteristic].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _service = ReadonlyAttribute(jsObject: jsObject, name: Strings.service) - _uuid = ReadonlyAttribute(jsObject: jsObject, name: Strings.uuid) - _properties = ReadonlyAttribute(jsObject: jsObject, name: Strings.properties) - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var service: BluetoothRemoteGATTService - - @ReadonlyAttribute - public var uuid: UUID - - @ReadonlyAttribute - public var properties: BluetoothCharacteristicProperties - - @ReadonlyAttribute - public var value: DataView? - - @inlinable public func getDescriptor(descriptor: BluetoothDescriptorUUID) -> JSPromise { - let this = jsObject - return this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDescriptor(descriptor: BluetoothDescriptorUUID) async throws -> BluetoothRemoteGATTDescriptor { - let this = jsObject - let _promise: JSPromise = this[Strings.getDescriptor].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDescriptors(descriptor: BluetoothDescriptorUUID? = nil) async throws -> [BluetoothRemoteGATTDescriptor] { - let this = jsObject - let _promise: JSPromise = this[Strings.getDescriptors].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func readValue() -> JSPromise { - let this = jsObject - return this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func readValue() async throws -> DataView { - let this = jsObject - let _promise: JSPromise = this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func writeValue(value: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func writeValue(value: BufferSource) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func writeValueWithResponse(value: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func writeValueWithResponse(value: BufferSource) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.writeValueWithResponse].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func writeValueWithoutResponse(value: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func writeValueWithoutResponse(value: BufferSource) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.writeValueWithoutResponse].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func startNotifications() -> JSPromise { - let this = jsObject - return this[Strings.startNotifications].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func startNotifications() async throws -> BluetoothRemoteGATTCharacteristic { - let this = jsObject - let _promise: JSPromise = this[Strings.startNotifications].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func stopNotifications() -> JSPromise { - let this = jsObject - return this[Strings.stopNotifications].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func stopNotifications() async throws -> BluetoothRemoteGATTCharacteristic { - let this = jsObject - let _promise: JSPromise = this[Strings.stopNotifications].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift deleted file mode 100644 index 0593dc55..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTDescriptor.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothRemoteGATTDescriptor: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTDescriptor].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _characteristic = ReadonlyAttribute(jsObject: jsObject, name: Strings.characteristic) - _uuid = ReadonlyAttribute(jsObject: jsObject, name: Strings.uuid) - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var characteristic: BluetoothRemoteGATTCharacteristic - - @ReadonlyAttribute - public var uuid: UUID - - @ReadonlyAttribute - public var value: DataView? - - @inlinable public func readValue() -> JSPromise { - let this = jsObject - return this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func readValue() async throws -> DataView { - let this = jsObject - let _promise: JSPromise = this[Strings.readValue].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func writeValue(value: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.writeValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func writeValue(value: BufferSource) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.writeValue].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift deleted file mode 100644 index f09921d0..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTServer.swift +++ /dev/null @@ -1,63 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothRemoteGATTServer: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTServer].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) - _connected = ReadonlyAttribute(jsObject: jsObject, name: Strings.connected) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var device: BluetoothDevice - - @ReadonlyAttribute - public var connected: Bool - - @inlinable public func connect() -> JSPromise { - let this = jsObject - return this[Strings.connect].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func connect() async throws -> BluetoothRemoteGATTServer { - let this = jsObject - let _promise: JSPromise = this[Strings.connect].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func disconnect() { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: []) - } - - @inlinable public func getPrimaryService(service: BluetoothServiceUUID) -> JSPromise { - let this = jsObject - return this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getPrimaryService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { - let this = jsObject - let _promise: JSPromise = this[Strings.getPrimaryService].function!(this: this, arguments: [service.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getPrimaryServices(service: BluetoothServiceUUID? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getPrimaryServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { - let this = jsObject - let _promise: JSPromise = this[Strings.getPrimaryServices].function!(this: this, arguments: [service?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift b/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift deleted file mode 100644 index 21a49cb0..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothRemoteGATTService.swift +++ /dev/null @@ -1,72 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothRemoteGATTService: EventTarget, CharacteristicEventHandlers, ServiceEventHandlers { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BluetoothRemoteGATTService].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) - _uuid = ReadonlyAttribute(jsObject: jsObject, name: Strings.uuid) - _isPrimary = ReadonlyAttribute(jsObject: jsObject, name: Strings.isPrimary) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var device: BluetoothDevice - - @ReadonlyAttribute - public var uuid: UUID - - @ReadonlyAttribute - public var isPrimary: Bool - - @inlinable public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) -> JSPromise { - let this = jsObject - return this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getCharacteristic(characteristic: BluetoothCharacteristicUUID) async throws -> BluetoothRemoteGATTCharacteristic { - let this = jsObject - let _promise: JSPromise = this[Strings.getCharacteristic].function!(this: this, arguments: [characteristic.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getCharacteristics(characteristic: BluetoothCharacteristicUUID? = nil) async throws -> [BluetoothRemoteGATTCharacteristic] { - let this = jsObject - let _promise: JSPromise = this[Strings.getCharacteristics].function!(this: this, arguments: [characteristic?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getIncludedService(service: BluetoothServiceUUID) -> JSPromise { - let this = jsObject - return this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getIncludedService(service: BluetoothServiceUUID) async throws -> BluetoothRemoteGATTService { - let this = jsObject - let _promise: JSPromise = this[Strings.getIncludedService].function!(this: this, arguments: [service.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getIncludedServices(service: BluetoothServiceUUID? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getIncludedServices(service: BluetoothServiceUUID? = nil) async throws -> [BluetoothRemoteGATTService] { - let this = jsObject - let _promise: JSPromise = this[Strings.getIncludedServices].function!(this: this, arguments: [service?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift b/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift deleted file mode 100644 index 3c2fd057..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothServiceDataFilterInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothServiceDataFilterInit: BridgedDictionary { - public convenience init(service: BluetoothServiceUUID) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.service] = service.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _service = ReadWriteAttribute(jsObject: object, name: Strings.service) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var service: BluetoothServiceUUID -} diff --git a/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift b/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift deleted file mode 100644 index a72017a6..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothServiceDataMap.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothServiceDataMap: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothServiceDataMap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift b/Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift deleted file mode 100644 index a23eb27c..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothServiceUUID.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_BluetoothServiceUUID: ConvertibleToJSValue {} -extension String: Any_BluetoothServiceUUID {} -extension UInt32: Any_BluetoothServiceUUID {} - -public enum BluetoothServiceUUID: JSValueCompatible, Any_BluetoothServiceUUID { - case string(String) - case uInt32(UInt32) - - public static func construct(from value: JSValue) -> Self? { - if let string: String = value.fromJSValue() { - return .string(string) - } - if let uInt32: UInt32 = value.fromJSValue() { - return .uInt32(uInt32) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .string(string): - return string.jsValue - case let .uInt32(uInt32): - return uInt32.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/BluetoothUUID.swift b/Sources/DOMKit/WebIDL/BluetoothUUID.swift deleted file mode 100644 index abf8a122..00000000 --- a/Sources/DOMKit/WebIDL/BluetoothUUID.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BluetoothUUID: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BluetoothUUID].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public static func getService(name: String_or_UInt32) -> UUID { - let this = constructor - return this[Strings.getService].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @inlinable public static func getCharacteristic(name: String_or_UInt32) -> UUID { - let this = constructor - return this[Strings.getCharacteristic].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @inlinable public static func getDescriptor(name: String_or_UInt32) -> UUID { - let this = constructor - return this[Strings.getDescriptor].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @inlinable public static func canonicalUUID(alias: UInt32) -> UUID { - let this = constructor - return this[Strings.canonicalUUID].function!(this: this, arguments: [alias.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/BodyInit.swift b/Sources/DOMKit/WebIDL/BodyInit.swift index 3bafaba6..23eab0f2 100644 --- a/Sources/DOMKit/WebIDL/BodyInit.swift +++ b/Sources/DOMKit/WebIDL/BodyInit.swift @@ -9,14 +9,14 @@ extension XMLHttpRequestBodyInit: Any_BodyInit {} public enum BodyInit: JSValueCompatible, Any_BodyInit { case readableStream(ReadableStream) - case xMLHttpRequestBodyInit(XMLHttpRequestBodyInit) + case xmlHttpRequestBodyInit(XMLHttpRequestBodyInit) public static func construct(from value: JSValue) -> Self? { if let readableStream: ReadableStream = value.fromJSValue() { return .readableStream(readableStream) } - if let xMLHttpRequestBodyInit: XMLHttpRequestBodyInit = value.fromJSValue() { - return .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit) + if let xmlHttpRequestBodyInit: XMLHttpRequestBodyInit = value.fromJSValue() { + return .xmlHttpRequestBodyInit(xmlHttpRequestBodyInit) } return nil } @@ -25,8 +25,8 @@ public enum BodyInit: JSValueCompatible, Any_BodyInit { switch self { case let .readableStream(readableStream): return readableStream.jsValue - case let .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit): - return xMLHttpRequestBodyInit.jsValue + case let .xmlHttpRequestBodyInit(xmlHttpRequestBodyInit): + return xmlHttpRequestBodyInit.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift b/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift deleted file mode 100644 index 51b747bb..00000000 --- a/Sources/DOMKit/WebIDL/Bool_or_ConstrainDouble.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Bool_or_ConstrainDouble: ConvertibleToJSValue {} -extension Bool: Any_Bool_or_ConstrainDouble {} -extension ConstrainDouble: Any_Bool_or_ConstrainDouble {} - -public enum Bool_or_ConstrainDouble: JSValueCompatible, Any_Bool_or_ConstrainDouble { - case bool(Bool) - case constrainDouble(ConstrainDouble) - - public static func construct(from value: JSValue) -> Self? { - if let bool: Bool = value.fromJSValue() { - return .bool(bool) - } - if let constrainDouble: ConstrainDouble = value.fromJSValue() { - return .constrainDouble(constrainDouble) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .bool(bool): - return bool.jsValue - case let .constrainDouble(constrainDouble): - return constrainDouble.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift b/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift deleted file mode 100644 index cc28a195..00000000 --- a/Sources/DOMKit/WebIDL/Bool_or_ScrollIntoViewOptions.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Bool_or_ScrollIntoViewOptions: ConvertibleToJSValue {} -extension Bool: Any_Bool_or_ScrollIntoViewOptions {} -extension ScrollIntoViewOptions: Any_Bool_or_ScrollIntoViewOptions {} - -public enum Bool_or_ScrollIntoViewOptions: JSValueCompatible, Any_Bool_or_ScrollIntoViewOptions { - case bool(Bool) - case scrollIntoViewOptions(ScrollIntoViewOptions) - - public static func construct(from value: JSValue) -> Self? { - if let bool: Bool = value.fromJSValue() { - return .bool(bool) - } - if let scrollIntoViewOptions: ScrollIntoViewOptions = value.fromJSValue() { - return .scrollIntoViewOptions(scrollIntoViewOptions) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .bool(bool): - return bool.jsValue - case let .scrollIntoViewOptions(scrollIntoViewOptions): - return scrollIntoViewOptions.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/BoxQuadOptions.swift b/Sources/DOMKit/WebIDL/BoxQuadOptions.swift deleted file mode 100644 index 9c68f521..00000000 --- a/Sources/DOMKit/WebIDL/BoxQuadOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BoxQuadOptions: BridgedDictionary { - public convenience init(box: CSSBoxType, relativeTo: GeometryNode) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.box] = box.jsValue - object[Strings.relativeTo] = relativeTo.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _box = ReadWriteAttribute(jsObject: object, name: Strings.box) - _relativeTo = ReadWriteAttribute(jsObject: object, name: Strings.relativeTo) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var box: CSSBoxType - - @ReadWriteAttribute - public var relativeTo: GeometryNode -} diff --git a/Sources/DOMKit/WebIDL/BreakType.swift b/Sources/DOMKit/WebIDL/BreakType.swift deleted file mode 100644 index 98dc5bf4..00000000 --- a/Sources/DOMKit/WebIDL/BreakType.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum BreakType: JSString, JSValueCompatible { - case none = "none" - case line = "line" - case column = "column" - case page = "page" - case region = "region" - - @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/BrowserCaptureMediaStreamTrack.swift b/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift deleted file mode 100644 index fefb8a22..00000000 --- a/Sources/DOMKit/WebIDL/BrowserCaptureMediaStreamTrack.swift +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class BrowserCaptureMediaStreamTrack: MediaStreamTrack { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BrowserCaptureMediaStreamTrack].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func cropTo(cropTarget: CropTarget?) -> JSPromise { - let this = jsObject - return this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func cropTo(cropTarget: CropTarget?) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.cropTo].function!(this: this, arguments: [cropTarget.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable override public func clone() -> Self { - let this = jsObject - return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/BinaryData.swift b/Sources/DOMKit/WebIDL/BufferSource.swift similarity index 78% rename from Sources/DOMKit/WebIDL/BinaryData.swift rename to Sources/DOMKit/WebIDL/BufferSource.swift index ef1bf9bd..2bf068de 100644 --- a/Sources/DOMKit/WebIDL/BinaryData.swift +++ b/Sources/DOMKit/WebIDL/BufferSource.swift @@ -3,11 +3,11 @@ import JavaScriptEventLoop import JavaScriptKit -public protocol Any_BinaryData: ConvertibleToJSValue {} -extension ArrayBuffer: Any_BinaryData {} -extension ArrayBufferView: Any_BinaryData {} +public protocol Any_BufferSource: ConvertibleToJSValue {} +extension ArrayBuffer: Any_BufferSource {} +extension ArrayBufferView: Any_BufferSource {} -public enum BinaryData: JSValueCompatible, Any_BinaryData { +public enum BufferSource: JSValueCompatible, Any_BufferSource { case arrayBuffer(ArrayBuffer) case arrayBufferView(ArrayBufferView) diff --git a/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift b/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift deleted file mode 100644 index ac3273b2..00000000 --- a/Sources/DOMKit/WebIDL/BufferSource_or_JsonWebKey.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_BufferSource_or_JsonWebKey: ConvertibleToJSValue {} -extension BufferSource: Any_BufferSource_or_JsonWebKey {} -extension JsonWebKey: Any_BufferSource_or_JsonWebKey {} - -public enum BufferSource_or_JsonWebKey: JSValueCompatible, Any_BufferSource_or_JsonWebKey { - case bufferSource(BufferSource) - case jsonWebKey(JsonWebKey) - - public static func construct(from value: JSValue) -> Self? { - if let bufferSource: BufferSource = value.fromJSValue() { - return .bufferSource(bufferSource) - } - if let jsonWebKey: JsonWebKey = value.fromJSValue() { - return .jsonWebKey(jsonWebKey) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .bufferSource(bufferSource): - return bufferSource.jsValue - case let .jsonWebKey(jsonWebKey): - return jsonWebKey.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift b/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift deleted file mode 100644 index b0a33963..00000000 --- a/Sources/DOMKit/WebIDL/CSPViolationReportBody.swift +++ /dev/null @@ -1,56 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSPViolationReportBody: ReportBody { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSPViolationReportBody].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _documentURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURL) - _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) - _blockedURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockedURL) - _effectiveDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.effectiveDirective) - _originalPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.originalPolicy) - _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) - _sample = ReadonlyAttribute(jsObject: jsObject, name: Strings.sample) - _disposition = ReadonlyAttribute(jsObject: jsObject, name: Strings.disposition) - _statusCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusCode) - _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) - _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var documentURL: String - - @ReadonlyAttribute - public var referrer: String? - - @ReadonlyAttribute - public var blockedURL: String? - - @ReadonlyAttribute - public var effectiveDirective: String - - @ReadonlyAttribute - public var originalPolicy: String - - @ReadonlyAttribute - public var sourceFile: String? - - @ReadonlyAttribute - public var sample: String? - - @ReadonlyAttribute - public var disposition: SecurityPolicyViolationEventDisposition - - @ReadonlyAttribute - public var statusCode: UInt16 - - @ReadonlyAttribute - public var lineNumber: UInt32? - - @ReadonlyAttribute - public var columnNumber: UInt32? -} diff --git a/Sources/DOMKit/WebIDL/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift index d88c65fb..2a92a515 100644 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ b/Sources/DOMKit/WebIDL/CSS.swift @@ -8,389 +8,6 @@ public enum CSS { JSObject.global[Strings.CSS].object! } - @inlinable public static var animationWorklet: Worklet { ReadonlyAttribute[Strings.animationWorklet, in: jsObject] } - - @inlinable public static func supports(property: String, value: String) -> Bool { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.supports].function!(this: this, arguments: [property.jsValue, value.jsValue]).fromJSValue()! - } - - @inlinable public static func supports(conditionText: String) -> Bool { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.supports].function!(this: this, arguments: [conditionText.jsValue]).fromJSValue()! - } - - @inlinable public static var highlights: HighlightRegistry { ReadonlyAttribute[Strings.highlights, in: jsObject] } - - @inlinable public static var elementSources: JSValue { ReadonlyAttribute[Strings.elementSources, in: jsObject] } - - @inlinable public static var layoutWorklet: Worklet { ReadonlyAttribute[Strings.layoutWorklet, in: jsObject] } - - @inlinable public static var paintWorklet: Worklet { ReadonlyAttribute[Strings.paintWorklet, in: jsObject] } - - @inlinable public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func parseStylesheet(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { - let this = JSObject.global[Strings.CSS].object! - let _promise: JSPromise = this[Strings.parseStylesheet].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func parseRuleList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { - let this = JSObject.global[Strings.CSS].object! - let _promise: JSPromise = this[Strings.parseRuleList].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseRule].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func parseRule(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> CSSParserRule { - let this = JSObject.global[Strings.CSS].object! - let _promise: JSPromise = this[Strings.parseRule].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) -> JSPromise { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func parseDeclarationList(css: CSSStringSource, options: CSSParserOptions? = nil) async throws -> [CSSParserRule] { - let this = JSObject.global[Strings.CSS].object! - let _promise: JSPromise = this[Strings.parseDeclarationList].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public static func parseDeclaration(css: String, options: CSSParserOptions? = nil) -> CSSParserDeclaration { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseDeclaration].function!(this: this, arguments: [css.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public static func parseValue(css: String) -> CSSToken { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseValue].function!(this: this, arguments: [css.jsValue]).fromJSValue()! - } - - @inlinable public static func parseValueList(css: String) -> [CSSToken] { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseValueList].function!(this: this, arguments: [css.jsValue]).fromJSValue()! - } - - @inlinable public static func parseCommaValueList(css: String) -> [[CSSToken]] { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.parseCommaValueList].function!(this: this, arguments: [css.jsValue]).fromJSValue()! - } - - @inlinable public static func registerProperty(definition: PropertyDefinition) { - let this = JSObject.global[Strings.CSS].object! - _ = this[Strings.registerProperty].function!(this: this, arguments: [definition.jsValue]) - } - - @inlinable public static func number(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.number].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func percent(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.percent].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func em(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.em].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func ex(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.ex].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func ch(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.ch].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func ic(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.ic].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func rem(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.rem].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func lh(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.lh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func rlh(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.rlh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func vw(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.vw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func vh(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.vh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func vi(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.vi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func vb(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.vb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func vmin(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.vmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func vmax(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.vmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func svw(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.svw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func svh(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.svh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func svi(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.svi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func svb(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.svb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func svmin(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.svmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func svmax(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.svmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func lvw(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func lvh(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func lvi(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func lvb(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func lvmin(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func lvmax(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.lvmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func dvw(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func dvh(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func dvi(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func dvb(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func dvmin(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func dvmax(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.dvmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func cqw(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqw].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func cqh(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqh].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func cqi(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func cqb(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqb].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func cqmin(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqmin].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func cqmax(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.cqmax].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func cm(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.cm].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func mm(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.mm].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func Q(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.Q].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func `in`(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.in].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func pt(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.pt].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func pc(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.pc].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func px(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.px].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func deg(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.deg].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func grad(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.grad].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func rad(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.rad].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func turn(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.turn].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func s(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.s].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func ms(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.ms].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func Hz(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.Hz].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func kHz(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.kHz].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func dpi(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.dpi].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func dpcm(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.dpcm].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func dppx(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.dppx].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func fr(value: Double) -> CSSUnitValue { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.fr].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - @inlinable public static func escape(ident: String) -> String { let this = JSObject.global[Strings.CSS].object! return this[Strings.escape].function!(this: this, arguments: [ident.jsValue]).fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/CSSAnimation.swift b/Sources/DOMKit/WebIDL/CSSAnimation.swift deleted file mode 100644 index a355f7a2..00000000 --- a/Sources/DOMKit/WebIDL/CSSAnimation.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSAnimation: Animation { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSAnimation].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _animationName = ReadonlyAttribute(jsObject: jsObject, name: Strings.animationName) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var animationName: String -} diff --git a/Sources/DOMKit/WebIDL/CSSBoxType.swift b/Sources/DOMKit/WebIDL/CSSBoxType.swift deleted file mode 100644 index 55fb3a91..00000000 --- a/Sources/DOMKit/WebIDL/CSSBoxType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum CSSBoxType: JSString, JSValueCompatible { - case margin = "margin" - case border = "border" - case padding = "padding" - case content = "content" - - @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/CSSColor.swift b/Sources/DOMKit/WebIDL/CSSColor.swift deleted file mode 100644 index 3b564e7b..00000000 --- a/Sources/DOMKit/WebIDL/CSSColor.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSColor: CSSColorValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSColor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _channels = ReadWriteAttribute(jsObject: jsObject, name: Strings.channels) - _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(colorSpace: CSSKeywordish, channels: [CSSColorPercent], alpha: CSSNumberish? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [colorSpace.jsValue, channels.jsValue, alpha?.jsValue ?? .undefined])) - } - - // XXX: member 'colorSpace' is ignored - - @ReadWriteAttribute - public var channels: [CSSColorPercent] - - @ReadWriteAttribute - public var alpha: CSSNumberish -} diff --git a/Sources/DOMKit/WebIDL/CSSColorRGBComp.swift b/Sources/DOMKit/WebIDL/CSSColorRGBComp.swift deleted file mode 100644 index e034ce14..00000000 --- a/Sources/DOMKit/WebIDL/CSSColorRGBComp.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSColorRGBComp: ConvertibleToJSValue {} -extension CSSKeywordish: Any_CSSColorRGBComp {} -extension CSSNumberish: Any_CSSColorRGBComp {} - -public enum CSSColorRGBComp: JSValueCompatible, Any_CSSColorRGBComp { - case cSSKeywordish(CSSKeywordish) - case cSSNumberish(CSSNumberish) - - public static func construct(from value: JSValue) -> Self? { - if let cSSKeywordish: CSSKeywordish = value.fromJSValue() { - return .cSSKeywordish(cSSKeywordish) - } - if let cSSNumberish: CSSNumberish = value.fromJSValue() { - return .cSSNumberish(cSSNumberish) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cSSKeywordish(cSSKeywordish): - return cSSKeywordish.jsValue - case let .cSSNumberish(cSSNumberish): - return cSSNumberish.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSColorValue.swift b/Sources/DOMKit/WebIDL/CSSColorValue.swift deleted file mode 100644 index b1768da6..00000000 --- a/Sources/DOMKit/WebIDL/CSSColorValue.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSColorValue: CSSStyleValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSColorValue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorSpace) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var colorSpace: CSSKeywordValue - - @inlinable public func to(colorSpace: CSSKeywordish) -> Self { - let this = jsObject - return this[Strings.to].function!(this: this, arguments: [colorSpace.jsValue]).fromJSValue()! - } - - // XXX: illegal static override - // override public static func parse(cssText: String) -> CSSColorValue_or_CSSStyleValue -} diff --git a/Sources/DOMKit/WebIDL/CSSConditionRule.swift b/Sources/DOMKit/WebIDL/CSSConditionRule.swift deleted file mode 100644 index fff74130..00000000 --- a/Sources/DOMKit/WebIDL/CSSConditionRule.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSConditionRule: CSSGroupingRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSConditionRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _conditionText = ReadWriteAttribute(jsObject: jsObject, name: Strings.conditionText) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var conditionText: String -} diff --git a/Sources/DOMKit/WebIDL/CSSContainerRule.swift b/Sources/DOMKit/WebIDL/CSSContainerRule.swift deleted file mode 100644 index b5e9f661..00000000 --- a/Sources/DOMKit/WebIDL/CSSContainerRule.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSContainerRule: CSSConditionRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSContainerRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift b/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift deleted file mode 100644 index 8acb2627..00000000 --- a/Sources/DOMKit/WebIDL/CSSCounterStyleRule.swift +++ /dev/null @@ -1,56 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSCounterStyleRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSCounterStyleRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) - _system = ReadWriteAttribute(jsObject: jsObject, name: Strings.system) - _symbols = ReadWriteAttribute(jsObject: jsObject, name: Strings.symbols) - _additiveSymbols = ReadWriteAttribute(jsObject: jsObject, name: Strings.additiveSymbols) - _negative = ReadWriteAttribute(jsObject: jsObject, name: Strings.negative) - _prefix = ReadWriteAttribute(jsObject: jsObject, name: Strings.prefix) - _suffix = ReadWriteAttribute(jsObject: jsObject, name: Strings.suffix) - _range = ReadWriteAttribute(jsObject: jsObject, name: Strings.range) - _pad = ReadWriteAttribute(jsObject: jsObject, name: Strings.pad) - _speakAs = ReadWriteAttribute(jsObject: jsObject, name: Strings.speakAs) - _fallback = ReadWriteAttribute(jsObject: jsObject, name: Strings.fallback) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var system: String - - @ReadWriteAttribute - public var symbols: String - - @ReadWriteAttribute - public var additiveSymbols: String - - @ReadWriteAttribute - public var negative: String - - @ReadWriteAttribute - public var prefix: String - - @ReadWriteAttribute - public var suffix: String - - @ReadWriteAttribute - public var range: String - - @ReadWriteAttribute - public var pad: String - - @ReadWriteAttribute - public var speakAs: String - - @ReadWriteAttribute - public var fallback: String -} diff --git a/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift b/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift deleted file mode 100644 index 46432814..00000000 --- a/Sources/DOMKit/WebIDL/CSSFontFaceRule.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSFontFaceRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFaceRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var style: CSSStyleDeclaration -} diff --git a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift deleted file mode 100644 index 2339163c..00000000 --- a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesMap.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSFontFeatureValuesMap: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFeatureValuesMap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! - - @inlinable public func set(featureValueName: String, values: UInt32_or_seq_of_UInt32) { - let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [featureValueName.jsValue, values.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift b/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift deleted file mode 100644 index bd06fede..00000000 --- a/Sources/DOMKit/WebIDL/CSSFontFeatureValuesRule.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSFontFeatureValuesRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontFeatureValuesRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _fontFamily = ReadWriteAttribute(jsObject: jsObject, name: Strings.fontFamily) - _annotation = ReadonlyAttribute(jsObject: jsObject, name: Strings.annotation) - _ornaments = ReadonlyAttribute(jsObject: jsObject, name: Strings.ornaments) - _stylistic = ReadonlyAttribute(jsObject: jsObject, name: Strings.stylistic) - _swash = ReadonlyAttribute(jsObject: jsObject, name: Strings.swash) - _characterVariant = ReadonlyAttribute(jsObject: jsObject, name: Strings.characterVariant) - _styleset = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleset) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var fontFamily: String - - @ReadonlyAttribute - public var annotation: CSSFontFeatureValuesMap - - @ReadonlyAttribute - public var ornaments: CSSFontFeatureValuesMap - - @ReadonlyAttribute - public var stylistic: CSSFontFeatureValuesMap - - @ReadonlyAttribute - public var swash: CSSFontFeatureValuesMap - - @ReadonlyAttribute - public var characterVariant: CSSFontFeatureValuesMap - - @ReadonlyAttribute - public var styleset: CSSFontFeatureValuesMap -} diff --git a/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift b/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift deleted file mode 100644 index 72904770..00000000 --- a/Sources/DOMKit/WebIDL/CSSFontPaletteValuesRule.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSFontPaletteValuesRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSFontPaletteValuesRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _fontFamily = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontFamily) - _basePalette = ReadonlyAttribute(jsObject: jsObject, name: Strings.basePalette) - _overrideColors = ReadonlyAttribute(jsObject: jsObject, name: Strings.overrideColors) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var fontFamily: String - - @ReadonlyAttribute - public var basePalette: String - - @ReadonlyAttribute - public var overrideColors: String -} diff --git a/Sources/DOMKit/WebIDL/CSSHSL.swift b/Sources/DOMKit/WebIDL/CSSHSL.swift deleted file mode 100644 index b7661df2..00000000 --- a/Sources/DOMKit/WebIDL/CSSHSL.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSHSL: CSSColorValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSHSL].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) - _s = ReadWriteAttribute(jsObject: jsObject, name: Strings.s) - _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) - _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(h: CSSColorAngle, s: CSSColorPercent, l: CSSColorPercent, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue, s.jsValue, l.jsValue, alpha?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var h: CSSColorAngle - - @ReadWriteAttribute - public var s: CSSColorPercent - - @ReadWriteAttribute - public var l: CSSColorPercent - - @ReadWriteAttribute - public var alpha: CSSColorPercent -} diff --git a/Sources/DOMKit/WebIDL/CSSHWB.swift b/Sources/DOMKit/WebIDL/CSSHWB.swift deleted file mode 100644 index 3d7285e5..00000000 --- a/Sources/DOMKit/WebIDL/CSSHWB.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSHWB: CSSColorValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSHWB].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) - _w = ReadWriteAttribute(jsObject: jsObject, name: Strings.w) - _b = ReadWriteAttribute(jsObject: jsObject, name: Strings.b) - _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(h: CSSNumericValue, w: CSSNumberish, b: CSSNumberish, alpha: CSSNumberish? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [h.jsValue, w.jsValue, b.jsValue, alpha?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var h: CSSNumericValue - - @ReadWriteAttribute - public var w: CSSNumberish - - @ReadWriteAttribute - public var b: CSSNumberish - - @ReadWriteAttribute - public var alpha: CSSNumberish -} diff --git a/Sources/DOMKit/WebIDL/CSSImageValue.swift b/Sources/DOMKit/WebIDL/CSSImageValue.swift deleted file mode 100644 index a7e7ad55..00000000 --- a/Sources/DOMKit/WebIDL/CSSImageValue.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSImageValue: CSSStyleValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSImageValue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/CSSImportRule.swift b/Sources/DOMKit/WebIDL/CSSImportRule.swift index e9bbc83f..91e427cf 100644 --- a/Sources/DOMKit/WebIDL/CSSImportRule.swift +++ b/Sources/DOMKit/WebIDL/CSSImportRule.swift @@ -7,16 +7,12 @@ public class CSSImportRule: CSSRule { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSImportRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _layerName = ReadonlyAttribute(jsObject: jsObject, name: Strings.layerName) _href = ReadonlyAttribute(jsObject: jsObject, name: Strings.href) _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) _styleSheet = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleSheet) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var layerName: String? - @ReadonlyAttribute public var href: String diff --git a/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift b/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift deleted file mode 100644 index 8daab413..00000000 --- a/Sources/DOMKit/WebIDL/CSSKeyframeRule.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSKeyframeRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeyframeRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _keyText = ReadWriteAttribute(jsObject: jsObject, name: Strings.keyText) - _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var keyText: String - - @ReadonlyAttribute - public var style: CSSStyleDeclaration -} diff --git a/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift b/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift deleted file mode 100644 index 0d11b4ef..00000000 --- a/Sources/DOMKit/WebIDL/CSSKeyframesRule.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSKeyframesRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeyframesRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var name: String - - @ReadonlyAttribute - public var cssRules: CSSRuleList - - @inlinable public func appendRule(rule: String) { - let this = jsObject - _ = this[Strings.appendRule].function!(this: this, arguments: [rule.jsValue]) - } - - @inlinable public func deleteRule(select: String) { - let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [select.jsValue]) - } - - @inlinable public func findRule(select: String) -> CSSKeyframeRule? { - let this = jsObject - return this[Strings.findRule].function!(this: this, arguments: [select.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSKeywordValue.swift b/Sources/DOMKit/WebIDL/CSSKeywordValue.swift deleted file mode 100644 index 7666c104..00000000 --- a/Sources/DOMKit/WebIDL/CSSKeywordValue.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSKeywordValue: CSSStyleValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSKeywordValue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(value: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue])) - } - - @ReadWriteAttribute - public var value: String -} diff --git a/Sources/DOMKit/WebIDL/CSSKeywordish.swift b/Sources/DOMKit/WebIDL/CSSKeywordish.swift deleted file mode 100644 index cc9003c3..00000000 --- a/Sources/DOMKit/WebIDL/CSSKeywordish.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSKeywordish: ConvertibleToJSValue {} -extension CSSKeywordValue: Any_CSSKeywordish {} -extension String: Any_CSSKeywordish {} - -public enum CSSKeywordish: JSValueCompatible, Any_CSSKeywordish { - case cSSKeywordValue(CSSKeywordValue) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let cSSKeywordValue: CSSKeywordValue = value.fromJSValue() { - return .cSSKeywordValue(cSSKeywordValue) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cSSKeywordValue(cSSKeywordValue): - return cSSKeywordValue.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSLCH.swift b/Sources/DOMKit/WebIDL/CSSLCH.swift deleted file mode 100644 index de3b356b..00000000 --- a/Sources/DOMKit/WebIDL/CSSLCH.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSLCH: CSSColorValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSLCH].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) - _c = ReadWriteAttribute(jsObject: jsObject, name: Strings.c) - _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) - _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue, c.jsValue, h.jsValue, alpha?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var l: CSSColorPercent - - @ReadWriteAttribute - public var c: CSSColorPercent - - @ReadWriteAttribute - public var h: CSSColorAngle - - @ReadWriteAttribute - public var alpha: CSSColorPercent -} diff --git a/Sources/DOMKit/WebIDL/CSSLab.swift b/Sources/DOMKit/WebIDL/CSSLab.swift deleted file mode 100644 index 5528d8d7..00000000 --- a/Sources/DOMKit/WebIDL/CSSLab.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSLab: CSSColorValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSLab].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) - _a = ReadWriteAttribute(jsObject: jsObject, name: Strings.a) - _b = ReadWriteAttribute(jsObject: jsObject, name: Strings.b) - _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue, a.jsValue, b.jsValue, alpha?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var l: CSSColorPercent - - @ReadWriteAttribute - public var a: CSSColorNumber - - @ReadWriteAttribute - public var b: CSSColorNumber - - @ReadWriteAttribute - public var alpha: CSSColorPercent -} diff --git a/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift b/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift deleted file mode 100644 index 18874c84..00000000 --- a/Sources/DOMKit/WebIDL/CSSLayerBlockRule.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSLayerBlockRule: CSSGroupingRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSLayerBlockRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var name: String -} diff --git a/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift b/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift deleted file mode 100644 index 18d05b95..00000000 --- a/Sources/DOMKit/WebIDL/CSSLayerStatementRule.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSLayerStatementRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSLayerStatementRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _nameList = ReadonlyAttribute(jsObject: jsObject, name: Strings.nameList) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var nameList: [String] -} diff --git a/Sources/DOMKit/WebIDL/CSSMathClamp.swift b/Sources/DOMKit/WebIDL/CSSMathClamp.swift deleted file mode 100644 index 401fde91..00000000 --- a/Sources/DOMKit/WebIDL/CSSMathClamp.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMathClamp: CSSMathValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathClamp].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _lower = ReadonlyAttribute(jsObject: jsObject, name: Strings.lower) - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - _upper = ReadonlyAttribute(jsObject: jsObject, name: Strings.upper) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(lower: CSSNumberish, value: CSSNumberish, upper: CSSNumberish) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [lower.jsValue, value.jsValue, upper.jsValue])) - } - - @ReadonlyAttribute - public var lower: CSSNumericValue - - @ReadonlyAttribute - public var value: CSSNumericValue - - @ReadonlyAttribute - public var upper: CSSNumericValue -} diff --git a/Sources/DOMKit/WebIDL/CSSMathInvert.swift b/Sources/DOMKit/WebIDL/CSSMathInvert.swift deleted file mode 100644 index 1b89c49b..00000000 --- a/Sources/DOMKit/WebIDL/CSSMathInvert.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMathInvert: CSSMathValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathInvert].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(arg: CSSNumberish) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue])) - } - - @ReadonlyAttribute - public var value: CSSNumericValue -} diff --git a/Sources/DOMKit/WebIDL/CSSMathMax.swift b/Sources/DOMKit/WebIDL/CSSMathMax.swift deleted file mode 100644 index 20eb8b5a..00000000 --- a/Sources/DOMKit/WebIDL/CSSMathMax.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMathMax: CSSMathValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathMax].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map(\.jsValue))) - } - - @ReadonlyAttribute - public var values: CSSNumericArray -} diff --git a/Sources/DOMKit/WebIDL/CSSMathMin.swift b/Sources/DOMKit/WebIDL/CSSMathMin.swift deleted file mode 100644 index 997ccf6f..00000000 --- a/Sources/DOMKit/WebIDL/CSSMathMin.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMathMin: CSSMathValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathMin].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map(\.jsValue))) - } - - @ReadonlyAttribute - public var values: CSSNumericArray -} diff --git a/Sources/DOMKit/WebIDL/CSSMathNegate.swift b/Sources/DOMKit/WebIDL/CSSMathNegate.swift deleted file mode 100644 index ec261282..00000000 --- a/Sources/DOMKit/WebIDL/CSSMathNegate.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMathNegate: CSSMathValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathNegate].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(arg: CSSNumberish) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [arg.jsValue])) - } - - @ReadonlyAttribute - public var value: CSSNumericValue -} diff --git a/Sources/DOMKit/WebIDL/CSSMathOperator.swift b/Sources/DOMKit/WebIDL/CSSMathOperator.swift deleted file mode 100644 index 19ebc182..00000000 --- a/Sources/DOMKit/WebIDL/CSSMathOperator.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum CSSMathOperator: JSString, JSValueCompatible { - case sum = "sum" - case product = "product" - case negate = "negate" - case invert = "invert" - case min = "min" - case max = "max" - case clamp = "clamp" - - @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/CSSMathProduct.swift b/Sources/DOMKit/WebIDL/CSSMathProduct.swift deleted file mode 100644 index a73c2dca..00000000 --- a/Sources/DOMKit/WebIDL/CSSMathProduct.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMathProduct: CSSMathValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathProduct].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map(\.jsValue))) - } - - @ReadonlyAttribute - public var values: CSSNumericArray -} diff --git a/Sources/DOMKit/WebIDL/CSSMathSum.swift b/Sources/DOMKit/WebIDL/CSSMathSum.swift deleted file mode 100644 index a35c6521..00000000 --- a/Sources/DOMKit/WebIDL/CSSMathSum.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMathSum: CSSMathValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathSum].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(args: CSSNumberish...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: args.map(\.jsValue))) - } - - @ReadonlyAttribute - public var values: CSSNumericArray -} diff --git a/Sources/DOMKit/WebIDL/CSSMathValue.swift b/Sources/DOMKit/WebIDL/CSSMathValue.swift deleted file mode 100644 index c4ebac83..00000000 --- a/Sources/DOMKit/WebIDL/CSSMathValue.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMathValue: CSSNumericValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMathValue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _operator = ReadonlyAttribute(jsObject: jsObject, name: Strings.operator) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var `operator`: CSSMathOperator -} diff --git a/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift b/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift deleted file mode 100644 index 56af9ad8..00000000 --- a/Sources/DOMKit/WebIDL/CSSMatrixComponent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMatrixComponent: CSSTransformComponent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMatrixComponent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _matrix = ReadWriteAttribute(jsObject: jsObject, name: Strings.matrix) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(matrix: DOMMatrixReadOnly, options: CSSMatrixComponentOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [matrix.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var matrix: DOMMatrix -} diff --git a/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift b/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift deleted file mode 100644 index bf2179cc..00000000 --- a/Sources/DOMKit/WebIDL/CSSMatrixComponentOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMatrixComponentOptions: BridgedDictionary { - public convenience init(is2D: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.is2D] = is2D.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _is2D = ReadWriteAttribute(jsObject: object, name: Strings.is2D) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var is2D: Bool -} diff --git a/Sources/DOMKit/WebIDL/CSSMediaRule.swift b/Sources/DOMKit/WebIDL/CSSMediaRule.swift deleted file mode 100644 index ef223a08..00000000 --- a/Sources/DOMKit/WebIDL/CSSMediaRule.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMediaRule: CSSConditionRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMediaRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var media: MediaList -} diff --git a/Sources/DOMKit/WebIDL/CSSNestingRule.swift b/Sources/DOMKit/WebIDL/CSSNestingRule.swift deleted file mode 100644 index c369c91e..00000000 --- a/Sources/DOMKit/WebIDL/CSSNestingRule.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSNestingRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSNestingRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) - _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var selectorText: String - - @ReadonlyAttribute - public var style: CSSStyleDeclaration - - @ReadonlyAttribute - public var cssRules: CSSRuleList - - @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - let this = jsObject - return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue, index?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func deleteRule(index: UInt32) { - let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/CSSNumberish.swift b/Sources/DOMKit/WebIDL/CSSNumberish.swift deleted file mode 100644 index 6ec09635..00000000 --- a/Sources/DOMKit/WebIDL/CSSNumberish.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSNumberish: ConvertibleToJSValue {} -extension CSSNumericValue: Any_CSSNumberish {} -extension Double: Any_CSSNumberish {} - -public enum CSSNumberish: JSValueCompatible, Any_CSSNumberish { - case cSSNumericValue(CSSNumericValue) - case double(Double) - - public static func construct(from value: JSValue) -> Self? { - if let cSSNumericValue: CSSNumericValue = value.fromJSValue() { - return .cSSNumericValue(cSSNumericValue) - } - if let double: Double = value.fromJSValue() { - return .double(double) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cSSNumericValue(cSSNumericValue): - return cSSNumericValue.jsValue - case let .double(double): - return double.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSNumericArray.swift b/Sources/DOMKit/WebIDL/CSSNumericArray.swift deleted file mode 100644 index a9e2a345..00000000 --- a/Sources/DOMKit/WebIDL/CSSNumericArray.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSNumericArray: JSBridgedClass, Sequence { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSNumericArray].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - self.jsObject = jsObject - } - - public typealias Element = CSSNumericValue - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) - } - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> CSSNumericValue { - jsObject[key].fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift b/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift deleted file mode 100644 index 04717d00..00000000 --- a/Sources/DOMKit/WebIDL/CSSNumericBaseType.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum CSSNumericBaseType: JSString, JSValueCompatible { - case length = "length" - case angle = "angle" - case time = "time" - case frequency = "frequency" - case resolution = "resolution" - case flex = "flex" - case percent = "percent" - - @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/CSSNumericType.swift b/Sources/DOMKit/WebIDL/CSSNumericType.swift deleted file mode 100644 index 804fcd7d..00000000 --- a/Sources/DOMKit/WebIDL/CSSNumericType.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSNumericType: BridgedDictionary { - public convenience init(length: Int32, angle: Int32, time: Int32, frequency: Int32, resolution: Int32, flex: Int32, percent: Int32, percentHint: CSSNumericBaseType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.length] = length.jsValue - object[Strings.angle] = angle.jsValue - object[Strings.time] = time.jsValue - object[Strings.frequency] = frequency.jsValue - object[Strings.resolution] = resolution.jsValue - object[Strings.flex] = flex.jsValue - object[Strings.percent] = percent.jsValue - object[Strings.percentHint] = percentHint.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - _angle = ReadWriteAttribute(jsObject: object, name: Strings.angle) - _time = ReadWriteAttribute(jsObject: object, name: Strings.time) - _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) - _resolution = ReadWriteAttribute(jsObject: object, name: Strings.resolution) - _flex = ReadWriteAttribute(jsObject: object, name: Strings.flex) - _percent = ReadWriteAttribute(jsObject: object, name: Strings.percent) - _percentHint = ReadWriteAttribute(jsObject: object, name: Strings.percentHint) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var length: Int32 - - @ReadWriteAttribute - public var angle: Int32 - - @ReadWriteAttribute - public var time: Int32 - - @ReadWriteAttribute - public var frequency: Int32 - - @ReadWriteAttribute - public var resolution: Int32 - - @ReadWriteAttribute - public var flex: Int32 - - @ReadWriteAttribute - public var percent: Int32 - - @ReadWriteAttribute - public var percentHint: CSSNumericBaseType -} diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue.swift b/Sources/DOMKit/WebIDL/CSSNumericValue.swift deleted file mode 100644 index b8ead155..00000000 --- a/Sources/DOMKit/WebIDL/CSSNumericValue.swift +++ /dev/null @@ -1,65 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSNumericValue: CSSStyleValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSNumericValue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func add(values: CSSNumberish...) -> Self { - let this = jsObject - return this[Strings.add].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func sub(values: CSSNumberish...) -> Self { - let this = jsObject - return this[Strings.sub].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func mul(values: CSSNumberish...) -> Self { - let this = jsObject - return this[Strings.mul].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func div(values: CSSNumberish...) -> Self { - let this = jsObject - return this[Strings.div].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func min(values: CSSNumberish...) -> Self { - let this = jsObject - return this[Strings.min].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func max(values: CSSNumberish...) -> Self { - let this = jsObject - return this[Strings.max].function!(this: this, arguments: values.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func equals(value: CSSNumberish...) -> Bool { - let this = jsObject - return this[Strings.equals].function!(this: this, arguments: value.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func to(unit: String) -> CSSUnitValue { - let this = jsObject - return this[Strings.to].function!(this: this, arguments: [unit.jsValue]).fromJSValue()! - } - - @inlinable public func toSum(units: String...) -> CSSMathSum { - let this = jsObject - return this[Strings.toSum].function!(this: this, arguments: units.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func type() -> CSSNumericType { - let this = jsObject - return this[Strings.type].function!(this: this, arguments: []).fromJSValue()! - } - - // XXX: illegal static override - // override public static func parse(cssText: String) -> Self -} diff --git a/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift b/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift deleted file mode 100644 index 90cb1088..00000000 --- a/Sources/DOMKit/WebIDL/CSSNumericValue_or_Double_or_String.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSNumericValue_or_Double_or_String: ConvertibleToJSValue {} -extension CSSNumericValue: Any_CSSNumericValue_or_Double_or_String {} -extension Double: Any_CSSNumericValue_or_Double_or_String {} -extension String: Any_CSSNumericValue_or_Double_or_String {} - -public enum CSSNumericValue_or_Double_or_String: JSValueCompatible, Any_CSSNumericValue_or_Double_or_String { - case cSSNumericValue(CSSNumericValue) - case double(Double) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let cSSNumericValue: CSSNumericValue = value.fromJSValue() { - return .cSSNumericValue(cSSNumericValue) - } - if let double: Double = value.fromJSValue() { - return .double(double) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cSSNumericValue(cSSNumericValue): - return cSSNumericValue.jsValue - case let .double(double): - return double.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSOKLCH.swift b/Sources/DOMKit/WebIDL/CSSOKLCH.swift deleted file mode 100644 index cedfeecf..00000000 --- a/Sources/DOMKit/WebIDL/CSSOKLCH.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSOKLCH: CSSColorValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSOKLCH].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) - _c = ReadWriteAttribute(jsObject: jsObject, name: Strings.c) - _h = ReadWriteAttribute(jsObject: jsObject, name: Strings.h) - _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(l: CSSColorPercent, c: CSSColorPercent, h: CSSColorAngle, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue, c.jsValue, h.jsValue, alpha?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var l: CSSColorPercent - - @ReadWriteAttribute - public var c: CSSColorPercent - - @ReadWriteAttribute - public var h: CSSColorAngle - - @ReadWriteAttribute - public var alpha: CSSColorPercent -} diff --git a/Sources/DOMKit/WebIDL/CSSOKLab.swift b/Sources/DOMKit/WebIDL/CSSOKLab.swift deleted file mode 100644 index 220bb756..00000000 --- a/Sources/DOMKit/WebIDL/CSSOKLab.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSOKLab: CSSColorValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSOKLab].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _l = ReadWriteAttribute(jsObject: jsObject, name: Strings.l) - _a = ReadWriteAttribute(jsObject: jsObject, name: Strings.a) - _b = ReadWriteAttribute(jsObject: jsObject, name: Strings.b) - _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(l: CSSColorPercent, a: CSSColorNumber, b: CSSColorNumber, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [l.jsValue, a.jsValue, b.jsValue, alpha?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var l: CSSColorPercent - - @ReadWriteAttribute - public var a: CSSColorNumber - - @ReadWriteAttribute - public var b: CSSColorNumber - - @ReadWriteAttribute - public var alpha: CSSColorPercent -} diff --git a/Sources/DOMKit/WebIDL/CSSParserAtRule.swift b/Sources/DOMKit/WebIDL/CSSParserAtRule.swift deleted file mode 100644 index 9e0b8563..00000000 --- a/Sources/DOMKit/WebIDL/CSSParserAtRule.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSParserAtRule: CSSParserRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserAtRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _prelude = ReadonlyAttribute(jsObject: jsObject, name: Strings.prelude) - _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(name: String, prelude: [CSSToken], body: [CSSParserRule]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue, prelude.jsValue, body?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var prelude: [CSSParserValue] - - @ReadonlyAttribute - public var body: [CSSParserRule]? - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSParserBlock.swift b/Sources/DOMKit/WebIDL/CSSParserBlock.swift deleted file mode 100644 index aa06b8a3..00000000 --- a/Sources/DOMKit/WebIDL/CSSParserBlock.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSParserBlock: CSSParserValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserBlock].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(name: String, body: [CSSParserValue]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue, body.jsValue])) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var body: [CSSParserValue] - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift b/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift deleted file mode 100644 index 0478100c..00000000 --- a/Sources/DOMKit/WebIDL/CSSParserDeclaration.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSParserDeclaration: CSSParserRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserDeclaration].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(name: String, body: [CSSParserRule]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue, body?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var body: [CSSParserValue] - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSParserFunction.swift b/Sources/DOMKit/WebIDL/CSSParserFunction.swift deleted file mode 100644 index f279422c..00000000 --- a/Sources/DOMKit/WebIDL/CSSParserFunction.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSParserFunction: CSSParserValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserFunction].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _args = ReadonlyAttribute(jsObject: jsObject, name: Strings.args) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(name: String, args: [[CSSParserValue]]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue, args.jsValue])) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var args: [[CSSParserValue]] - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSParserOptions.swift b/Sources/DOMKit/WebIDL/CSSParserOptions.swift deleted file mode 100644 index f132424c..00000000 --- a/Sources/DOMKit/WebIDL/CSSParserOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSParserOptions: BridgedDictionary { - public convenience init(atRules: JSObject) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.atRules] = atRules.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _atRules = ReadWriteAttribute(jsObject: object, name: Strings.atRules) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var atRules: JSObject -} diff --git a/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift b/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift deleted file mode 100644 index ea7ecdf0..00000000 --- a/Sources/DOMKit/WebIDL/CSSParserQualifiedRule.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSParserQualifiedRule: CSSParserRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSParserQualifiedRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _prelude = ReadonlyAttribute(jsObject: jsObject, name: Strings.prelude) - _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(prelude: [CSSToken], body: [CSSParserRule]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [prelude.jsValue, body?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var prelude: [CSSParserValue] - - @ReadonlyAttribute - public var body: [CSSParserRule] - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSParserRule.swift b/Sources/DOMKit/WebIDL/CSSParserRule.swift deleted file mode 100644 index e3f9f3d2..00000000 --- a/Sources/DOMKit/WebIDL/CSSParserRule.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSParserRule: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSParserRule].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/CSSParserValue.swift b/Sources/DOMKit/WebIDL/CSSParserValue.swift deleted file mode 100644 index 05eb303d..00000000 --- a/Sources/DOMKit/WebIDL/CSSParserValue.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSParserValue: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSParserValue].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/CSSPerspective.swift b/Sources/DOMKit/WebIDL/CSSPerspective.swift deleted file mode 100644 index 64effa83..00000000 --- a/Sources/DOMKit/WebIDL/CSSPerspective.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSPerspective: CSSTransformComponent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPerspective].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadWriteAttribute(jsObject: jsObject, name: Strings.length) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(length: CSSPerspectiveValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [length.jsValue])) - } - - @ReadWriteAttribute - public var length: CSSPerspectiveValue -} diff --git a/Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift b/Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift deleted file mode 100644 index d55ec10d..00000000 --- a/Sources/DOMKit/WebIDL/CSSPerspectiveValue.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSPerspectiveValue: ConvertibleToJSValue {} -extension CSSKeywordish: Any_CSSPerspectiveValue {} -extension CSSNumericValue: Any_CSSPerspectiveValue {} - -public enum CSSPerspectiveValue: JSValueCompatible, Any_CSSPerspectiveValue { - case cSSKeywordish(CSSKeywordish) - case cSSNumericValue(CSSNumericValue) - - public static func construct(from value: JSValue) -> Self? { - if let cSSKeywordish: CSSKeywordish = value.fromJSValue() { - return .cSSKeywordish(cSSKeywordish) - } - if let cSSNumericValue: CSSNumericValue = value.fromJSValue() { - return .cSSNumericValue(cSSNumericValue) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cSSKeywordish(cSSKeywordish): - return cSSKeywordish.jsValue - case let .cSSNumericValue(cSSNumericValue): - return cSSNumericValue.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSPropertyRule.swift b/Sources/DOMKit/WebIDL/CSSPropertyRule.swift deleted file mode 100644 index 4a885f36..00000000 --- a/Sources/DOMKit/WebIDL/CSSPropertyRule.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSPropertyRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPropertyRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _syntax = ReadonlyAttribute(jsObject: jsObject, name: Strings.syntax) - _inherits = ReadonlyAttribute(jsObject: jsObject, name: Strings.inherits) - _initialValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.initialValue) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var syntax: String - - @ReadonlyAttribute - public var inherits: Bool - - @ReadonlyAttribute - public var initialValue: String? -} diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift index 29314d8d..f3302eaf 100644 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class CSSPseudoElement: EventTarget, GeometryUtils { +public class CSSPseudoElement: EventTarget { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPseudoElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift index 4c394a50..56e57709 100644 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift @@ -8,12 +8,12 @@ extension CSSPseudoElement: Any_CSSPseudoElement_or_Element {} extension Element: Any_CSSPseudoElement_or_Element {} public enum CSSPseudoElement_or_Element: JSValueCompatible, Any_CSSPseudoElement_or_Element { - case cSSPseudoElement(CSSPseudoElement) + case cssPseudoElement(CSSPseudoElement) case element(Element) public static func construct(from value: JSValue) -> Self? { - if let cSSPseudoElement: CSSPseudoElement = value.fromJSValue() { - return .cSSPseudoElement(cSSPseudoElement) + if let cssPseudoElement: CSSPseudoElement = value.fromJSValue() { + return .cssPseudoElement(cssPseudoElement) } if let element: Element = value.fromJSValue() { return .element(element) @@ -23,8 +23,8 @@ public enum CSSPseudoElement_or_Element: JSValueCompatible, Any_CSSPseudoElement public var jsValue: JSValue { switch self { - case let .cSSPseudoElement(cSSPseudoElement): - return cSSPseudoElement.jsValue + case let .cssPseudoElement(cssPseudoElement): + return cssPseudoElement.jsValue case let .element(element): return element.jsValue } diff --git a/Sources/DOMKit/WebIDL/CSSRGB.swift b/Sources/DOMKit/WebIDL/CSSRGB.swift deleted file mode 100644 index b59b6b46..00000000 --- a/Sources/DOMKit/WebIDL/CSSRGB.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSRGB: CSSColorValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSRGB].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _r = ReadWriteAttribute(jsObject: jsObject, name: Strings.r) - _g = ReadWriteAttribute(jsObject: jsObject, name: Strings.g) - _b = ReadWriteAttribute(jsObject: jsObject, name: Strings.b) - _alpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.alpha) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(r: CSSColorRGBComp, g: CSSColorRGBComp, b: CSSColorRGBComp, alpha: CSSColorPercent? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [r.jsValue, g.jsValue, b.jsValue, alpha?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var r: CSSColorRGBComp - - @ReadWriteAttribute - public var g: CSSColorRGBComp - - @ReadWriteAttribute - public var b: CSSColorRGBComp - - @ReadWriteAttribute - public var alpha: CSSColorPercent -} diff --git a/Sources/DOMKit/WebIDL/CSSRotate.swift b/Sources/DOMKit/WebIDL/CSSRotate.swift deleted file mode 100644 index 9118a39d..00000000 --- a/Sources/DOMKit/WebIDL/CSSRotate.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSRotate: CSSTransformComponent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSRotate].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadWriteAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadWriteAttribute(jsObject: jsObject, name: Strings.z) - _angle = ReadWriteAttribute(jsObject: jsObject, name: Strings.angle) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(angle: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [angle.jsValue])) - } - - @inlinable public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish, angle: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue, y.jsValue, z.jsValue, angle.jsValue])) - } - - @ReadWriteAttribute - public var x: CSSNumberish - - @ReadWriteAttribute - public var y: CSSNumberish - - @ReadWriteAttribute - public var z: CSSNumberish - - @ReadWriteAttribute - public var angle: CSSNumericValue -} diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift index 92c4ad12..33a1dfd1 100644 --- a/Sources/DOMKit/WebIDL/CSSRule.swift +++ b/Sources/DOMKit/WebIDL/CSSRule.swift @@ -16,18 +16,6 @@ public class CSSRule: JSBridgedClass { self.jsObject = jsObject } - public static let KEYFRAMES_RULE: UInt16 = 7 - - public static let KEYFRAME_RULE: UInt16 = 8 - - public static let SUPPORTS_RULE: UInt16 = 12 - - public static let COUNTER_STYLE_RULE: UInt16 = 11 - - public static let VIEWPORT_RULE: UInt16 = 15 - - public static let FONT_FEATURE_VALUES_RULE: UInt16 = 14 - @ReadWriteAttribute public var cssText: String diff --git a/Sources/DOMKit/WebIDL/CSSScale.swift b/Sources/DOMKit/WebIDL/CSSScale.swift deleted file mode 100644 index c25830ff..00000000 --- a/Sources/DOMKit/WebIDL/CSSScale.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSScale: CSSTransformComponent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSScale].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadWriteAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadWriteAttribute(jsObject: jsObject, name: Strings.z) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue, y.jsValue, z?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var x: CSSNumberish - - @ReadWriteAttribute - public var y: CSSNumberish - - @ReadWriteAttribute - public var z: CSSNumberish -} diff --git a/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift b/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift deleted file mode 100644 index 53c5ed86..00000000 --- a/Sources/DOMKit/WebIDL/CSSScrollTimelineRule.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSScrollTimelineRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSScrollTimelineRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) - _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) - _scrollOffsets = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollOffsets) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var source: String - - @ReadonlyAttribute - public var orientation: String - - @ReadonlyAttribute - public var scrollOffsets: String -} diff --git a/Sources/DOMKit/WebIDL/CSSSkew.swift b/Sources/DOMKit/WebIDL/CSSSkew.swift deleted file mode 100644 index 647a799f..00000000 --- a/Sources/DOMKit/WebIDL/CSSSkew.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSSkew: CSSTransformComponent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkew].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _ax = ReadWriteAttribute(jsObject: jsObject, name: Strings.ax) - _ay = ReadWriteAttribute(jsObject: jsObject, name: Strings.ay) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(ax: CSSNumericValue, ay: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue, ay.jsValue])) - } - - @ReadWriteAttribute - public var ax: CSSNumericValue - - @ReadWriteAttribute - public var ay: CSSNumericValue -} diff --git a/Sources/DOMKit/WebIDL/CSSSkewX.swift b/Sources/DOMKit/WebIDL/CSSSkewX.swift deleted file mode 100644 index 9a6be145..00000000 --- a/Sources/DOMKit/WebIDL/CSSSkewX.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSSkewX: CSSTransformComponent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkewX].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _ax = ReadWriteAttribute(jsObject: jsObject, name: Strings.ax) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(ax: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [ax.jsValue])) - } - - @ReadWriteAttribute - public var ax: CSSNumericValue -} diff --git a/Sources/DOMKit/WebIDL/CSSSkewY.swift b/Sources/DOMKit/WebIDL/CSSSkewY.swift deleted file mode 100644 index df9cae99..00000000 --- a/Sources/DOMKit/WebIDL/CSSSkewY.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSSkewY: CSSTransformComponent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSSkewY].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _ay = ReadWriteAttribute(jsObject: jsObject, name: Strings.ay) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(ay: CSSNumericValue) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [ay.jsValue])) - } - - @ReadWriteAttribute - public var ay: CSSNumericValue -} diff --git a/Sources/DOMKit/WebIDL/CSSStringSource.swift b/Sources/DOMKit/WebIDL/CSSStringSource.swift deleted file mode 100644 index 2b658636..00000000 --- a/Sources/DOMKit/WebIDL/CSSStringSource.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSStringSource: ConvertibleToJSValue {} -extension ReadableStream: Any_CSSStringSource {} -extension String: Any_CSSStringSource {} - -public enum CSSStringSource: JSValueCompatible, Any_CSSStringSource { - case readableStream(ReadableStream) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let readableStream: ReadableStream = value.fromJSValue() { - return .readableStream(readableStream) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .readableStream(readableStream): - return readableStream.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift index b2f30a8c..ad59f9c0 100644 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ b/Sources/DOMKit/WebIDL/CSSStyleRule.swift @@ -7,29 +7,11 @@ public class CSSStyleRule: CSSRule { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleRule].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) - _styleMap = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleMap) _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var cssRules: CSSRuleList - - @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - let this = jsObject - return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue, index?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func deleteRule(index: UInt32) { - let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue]) - } - - @ReadonlyAttribute - public var styleMap: StylePropertyMap - @ReadWriteAttribute public var selectorText: String diff --git a/Sources/DOMKit/WebIDL/CSSStyleValue.swift b/Sources/DOMKit/WebIDL/CSSStyleValue.swift deleted file mode 100644 index af6a5fbd..00000000 --- a/Sources/DOMKit/WebIDL/CSSStyleValue.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSStyleValue: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleValue].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } - - @inlinable public static func parse(property: String, cssText: String) -> Self { - let this = constructor - return this[Strings.parse].function!(this: this, arguments: [property.jsValue, cssText.jsValue]).fromJSValue()! - } - - @inlinable public static func parseAll(property: String, cssText: String) -> [CSSStyleValue] { - let this = constructor - return this[Strings.parseAll].function!(this: this, arguments: [property.jsValue, cssText.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift b/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift deleted file mode 100644 index 97d68f00..00000000 --- a/Sources/DOMKit/WebIDL/CSSStyleValue_or_String.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSStyleValue_or_String: ConvertibleToJSValue {} -extension CSSStyleValue: Any_CSSStyleValue_or_String {} -extension String: Any_CSSStyleValue_or_String {} - -public enum CSSStyleValue_or_String: JSValueCompatible, Any_CSSStyleValue_or_String { - case cSSStyleValue(CSSStyleValue) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let cSSStyleValue: CSSStyleValue = value.fromJSValue() { - return .cSSStyleValue(cSSStyleValue) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cSSStyleValue(cSSStyleValue): - return cSSStyleValue.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift b/Sources/DOMKit/WebIDL/CSSSupportsRule.swift deleted file mode 100644 index eac26957..00000000 --- a/Sources/DOMKit/WebIDL/CSSSupportsRule.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSSupportsRule: CSSConditionRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSSupportsRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/CSSToken.swift b/Sources/DOMKit/WebIDL/CSSToken.swift deleted file mode 100644 index f217376b..00000000 --- a/Sources/DOMKit/WebIDL/CSSToken.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSToken: ConvertibleToJSValue {} -extension CSSParserValue: Any_CSSToken {} -extension CSSStyleValue: Any_CSSToken {} -extension String: Any_CSSToken {} - -public enum CSSToken: JSValueCompatible, Any_CSSToken { - case cSSParserValue(CSSParserValue) - case cSSStyleValue(CSSStyleValue) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let cSSParserValue: CSSParserValue = value.fromJSValue() { - return .cSSParserValue(cSSParserValue) - } - if let cSSStyleValue: CSSStyleValue = value.fromJSValue() { - return .cSSStyleValue(cSSStyleValue) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cSSParserValue(cSSParserValue): - return cSSParserValue.jsValue - case let .cSSStyleValue(cSSStyleValue): - return cSSStyleValue.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSTransformComponent.swift b/Sources/DOMKit/WebIDL/CSSTransformComponent.swift deleted file mode 100644 index 21d3f324..00000000 --- a/Sources/DOMKit/WebIDL/CSSTransformComponent.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSTransformComponent: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSTransformComponent].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _is2D = ReadWriteAttribute(jsObject: jsObject, name: Strings.is2D) - self.jsObject = jsObject - } - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } - - @ReadWriteAttribute - public var is2D: Bool - - @inlinable public func toMatrix() -> DOMMatrix { - let this = jsObject - return this[Strings.toMatrix].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSTransformValue.swift b/Sources/DOMKit/WebIDL/CSSTransformValue.swift deleted file mode 100644 index dbc3cf60..00000000 --- a/Sources/DOMKit/WebIDL/CSSTransformValue.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSTransformValue: CSSStyleValue, Sequence { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSTransformValue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _is2D = ReadonlyAttribute(jsObject: jsObject, name: Strings.is2D) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(transforms: [CSSTransformComponent]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [transforms.jsValue])) - } - - public typealias Element = CSSTransformComponent - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) - } - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> CSSTransformComponent { - jsObject[key].fromJSValue()! - } - - // XXX: unsupported setter for keys of type UInt32 - - @ReadonlyAttribute - public var is2D: Bool - - @inlinable public func toMatrix() -> DOMMatrix { - let this = jsObject - return this[Strings.toMatrix].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSTransition.swift b/Sources/DOMKit/WebIDL/CSSTransition.swift deleted file mode 100644 index cbb7e83b..00000000 --- a/Sources/DOMKit/WebIDL/CSSTransition.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSTransition: Animation { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSTransition].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _transitionProperty = ReadonlyAttribute(jsObject: jsObject, name: Strings.transitionProperty) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var transitionProperty: String -} diff --git a/Sources/DOMKit/WebIDL/CSSTranslate.swift b/Sources/DOMKit/WebIDL/CSSTranslate.swift deleted file mode 100644 index 46a56b0e..00000000 --- a/Sources/DOMKit/WebIDL/CSSTranslate.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSTranslate: CSSTransformComponent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSTranslate].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadWriteAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadWriteAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadWriteAttribute(jsObject: jsObject, name: Strings.z) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(x: CSSNumericValue, y: CSSNumericValue, z: CSSNumericValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [x.jsValue, y.jsValue, z?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var x: CSSNumericValue - - @ReadWriteAttribute - public var y: CSSNumericValue - - @ReadWriteAttribute - public var z: CSSNumericValue -} diff --git a/Sources/DOMKit/WebIDL/CSSUnitValue.swift b/Sources/DOMKit/WebIDL/CSSUnitValue.swift deleted file mode 100644 index dbb0a46f..00000000 --- a/Sources/DOMKit/WebIDL/CSSUnitValue.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSUnitValue: CSSNumericValue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSUnitValue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) - _unit = ReadonlyAttribute(jsObject: jsObject, name: Strings.unit) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(value: Double, unit: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [value.jsValue, unit.jsValue])) - } - - @ReadWriteAttribute - public var value: Double - - @ReadonlyAttribute - public var unit: String -} diff --git a/Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift b/Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift deleted file mode 100644 index cdd44da2..00000000 --- a/Sources/DOMKit/WebIDL/CSSUnparsedSegment.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSUnparsedSegment: ConvertibleToJSValue {} -extension CSSVariableReferenceValue: Any_CSSUnparsedSegment {} -extension String: Any_CSSUnparsedSegment {} - -public enum CSSUnparsedSegment: JSValueCompatible, Any_CSSUnparsedSegment { - case cSSVariableReferenceValue(CSSVariableReferenceValue) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let cSSVariableReferenceValue: CSSVariableReferenceValue = value.fromJSValue() { - return .cSSVariableReferenceValue(cSSVariableReferenceValue) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cSSVariableReferenceValue(cSSVariableReferenceValue): - return cSSVariableReferenceValue.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift b/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift deleted file mode 100644 index ae969d02..00000000 --- a/Sources/DOMKit/WebIDL/CSSUnparsedValue.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSUnparsedValue: CSSStyleValue, Sequence { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSUnparsedValue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(members: [CSSUnparsedSegment]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [members.jsValue])) - } - - public typealias Element = CSSUnparsedSegment - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) - } - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> CSSUnparsedSegment { - jsObject[key].fromJSValue()! - } - - // XXX: unsupported setter for keys of type UInt32 -} diff --git a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift b/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift deleted file mode 100644 index da9b1af3..00000000 --- a/Sources/DOMKit/WebIDL/CSSVariableReferenceValue.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSVariableReferenceValue: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSVariableReferenceValue].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _variable = ReadWriteAttribute(jsObject: jsObject, name: Strings.variable) - _fallback = ReadonlyAttribute(jsObject: jsObject, name: Strings.fallback) - self.jsObject = jsObject - } - - @inlinable public convenience init(variable: String, fallback: CSSUnparsedValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [variable.jsValue, fallback?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var variable: String - - @ReadonlyAttribute - public var fallback: CSSUnparsedValue? -} diff --git a/Sources/DOMKit/WebIDL/CSSViewportRule.swift b/Sources/DOMKit/WebIDL/CSSViewportRule.swift deleted file mode 100644 index 8fbd9f47..00000000 --- a/Sources/DOMKit/WebIDL/CSSViewportRule.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSViewportRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSViewportRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var style: CSSStyleDeclaration -} diff --git a/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift b/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift deleted file mode 100644 index 6d10fa12..00000000 --- a/Sources/DOMKit/WebIDL/CanMakePaymentEventInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CanMakePaymentEventInit: BridgedDictionary { - public convenience init(topOrigin: String, paymentRequestOrigin: String, methodData: [PaymentMethodData]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.topOrigin] = topOrigin.jsValue - object[Strings.paymentRequestOrigin] = paymentRequestOrigin.jsValue - object[Strings.methodData] = methodData.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _topOrigin = ReadWriteAttribute(jsObject: object, name: Strings.topOrigin) - _paymentRequestOrigin = ReadWriteAttribute(jsObject: object, name: Strings.paymentRequestOrigin) - _methodData = ReadWriteAttribute(jsObject: object, name: Strings.methodData) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var topOrigin: String - - @ReadWriteAttribute - public var paymentRequestOrigin: String - - @ReadWriteAttribute - public var methodData: [PaymentMethodData] -} diff --git a/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift b/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift deleted file mode 100644 index f2a014b7..00000000 --- a/Sources/DOMKit/WebIDL/CanvasCaptureMediaStreamTrack.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CanvasCaptureMediaStreamTrack: MediaStreamTrack { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CanvasCaptureMediaStreamTrack].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var canvas: HTMLCanvasElement - - @inlinable public func requestFrame() { - let this = jsObject - _ = this[Strings.requestFrame].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/CanvasImageSource.swift b/Sources/DOMKit/WebIDL/CanvasImageSource.swift index db4e4d0d..02a12145 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageSource.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageSource.swift @@ -12,22 +12,22 @@ extension OffscreenCanvas: Any_CanvasImageSource {} extension VideoFrame: Any_CanvasImageSource {} public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { - case hTMLCanvasElement(HTMLCanvasElement) - case hTMLOrSVGImageElement(HTMLOrSVGImageElement) - case hTMLVideoElement(HTMLVideoElement) + case htmlCanvasElement(HTMLCanvasElement) + case htmlOrSVGImageElement(HTMLOrSVGImageElement) + case htmlVideoElement(HTMLVideoElement) case imageBitmap(ImageBitmap) case offscreenCanvas(OffscreenCanvas) case videoFrame(VideoFrame) public static func construct(from value: JSValue) -> Self? { - if let hTMLCanvasElement: HTMLCanvasElement = value.fromJSValue() { - return .hTMLCanvasElement(hTMLCanvasElement) + if let htmlCanvasElement: HTMLCanvasElement = value.fromJSValue() { + return .htmlCanvasElement(htmlCanvasElement) } - if let hTMLOrSVGImageElement: HTMLOrSVGImageElement = value.fromJSValue() { - return .hTMLOrSVGImageElement(hTMLOrSVGImageElement) + if let htmlOrSVGImageElement: HTMLOrSVGImageElement = value.fromJSValue() { + return .htmlOrSVGImageElement(htmlOrSVGImageElement) } - if let hTMLVideoElement: HTMLVideoElement = value.fromJSValue() { - return .hTMLVideoElement(hTMLVideoElement) + if let htmlVideoElement: HTMLVideoElement = value.fromJSValue() { + return .htmlVideoElement(htmlVideoElement) } if let imageBitmap: ImageBitmap = value.fromJSValue() { return .imageBitmap(imageBitmap) @@ -43,12 +43,12 @@ public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { public var jsValue: JSValue { switch self { - case let .hTMLCanvasElement(hTMLCanvasElement): - return hTMLCanvasElement.jsValue - case let .hTMLOrSVGImageElement(hTMLOrSVGImageElement): - return hTMLOrSVGImageElement.jsValue - case let .hTMLVideoElement(hTMLVideoElement): - return hTMLVideoElement.jsValue + case let .htmlCanvasElement(htmlCanvasElement): + return htmlCanvasElement.jsValue + case let .htmlOrSVGImageElement(htmlOrSVGImageElement): + return htmlOrSVGImageElement.jsValue + case let .htmlVideoElement(htmlVideoElement): + return htmlVideoElement.jsValue case let .imageBitmap(imageBitmap): return imageBitmap.jsValue case let .offscreenCanvas(offscreenCanvas): diff --git a/Sources/DOMKit/WebIDL/CaretPosition.swift b/Sources/DOMKit/WebIDL/CaretPosition.swift deleted file mode 100644 index 385d49ef..00000000 --- a/Sources/DOMKit/WebIDL/CaretPosition.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CaretPosition: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CaretPosition].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _offsetNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetNode) - _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var offsetNode: Node - - @ReadonlyAttribute - public var offset: UInt32 - - @inlinable public func getClientRect() -> DOMRect? { - let this = jsObject - return this[Strings.getClientRect].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ChannelCountMode.swift b/Sources/DOMKit/WebIDL/ChannelCountMode.swift deleted file mode 100644 index 7fb56c48..00000000 --- a/Sources/DOMKit/WebIDL/ChannelCountMode.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ChannelCountMode: JSString, JSValueCompatible { - case max = "max" - case clampedMax = "clamped-max" - case explicit = "explicit" - - @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/ChannelInterpretation.swift b/Sources/DOMKit/WebIDL/ChannelInterpretation.swift deleted file mode 100644 index a1e3a41f..00000000 --- a/Sources/DOMKit/WebIDL/ChannelInterpretation.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ChannelInterpretation: JSString, JSValueCompatible { - case speakers = "speakers" - case discrete = "discrete" - - @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/ChannelMergerNode.swift b/Sources/DOMKit/WebIDL/ChannelMergerNode.swift deleted file mode 100644 index 4d077fa2..00000000 --- a/Sources/DOMKit/WebIDL/ChannelMergerNode.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ChannelMergerNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ChannelMergerNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: ChannelMergerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } -} diff --git a/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift b/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift deleted file mode 100644 index ee0f8c1c..00000000 --- a/Sources/DOMKit/WebIDL/ChannelMergerOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ChannelMergerOptions: BridgedDictionary { - public convenience init(numberOfInputs: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfInputs] = numberOfInputs.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _numberOfInputs = ReadWriteAttribute(jsObject: object, name: Strings.numberOfInputs) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var numberOfInputs: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift b/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift deleted file mode 100644 index 14f9c626..00000000 --- a/Sources/DOMKit/WebIDL/ChannelSplitterNode.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ChannelSplitterNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ChannelSplitterNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: ChannelSplitterOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } -} diff --git a/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift b/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift deleted file mode 100644 index 88ac6096..00000000 --- a/Sources/DOMKit/WebIDL/ChannelSplitterOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ChannelSplitterOptions: BridgedDictionary { - public convenience init(numberOfOutputs: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfOutputs] = numberOfOutputs.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _numberOfOutputs = ReadWriteAttribute(jsObject: object, name: Strings.numberOfOutputs) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var numberOfOutputs: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift deleted file mode 100644 index 464ee04f..00000000 --- a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CharacterBoundsUpdateEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CharacterBoundsUpdateEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _rangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeStart) - _rangeEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeEnd) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: CharacterBoundsUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var rangeStart: UInt32 - - @ReadonlyAttribute - public var rangeEnd: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift b/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift deleted file mode 100644 index 31d03107..00000000 --- a/Sources/DOMKit/WebIDL/CharacterBoundsUpdateEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CharacterBoundsUpdateEventInit: BridgedDictionary { - public convenience init(rangeStart: UInt32, rangeEnd: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rangeStart] = rangeStart.jsValue - object[Strings.rangeEnd] = rangeEnd.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _rangeStart = ReadWriteAttribute(jsObject: object, name: Strings.rangeStart) - _rangeEnd = ReadWriteAttribute(jsObject: object, name: Strings.rangeEnd) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var rangeStart: UInt32 - - @ReadWriteAttribute - public var rangeEnd: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift b/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift deleted file mode 100644 index c6188931..00000000 --- a/Sources/DOMKit/WebIDL/CharacteristicEventHandlers.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol CharacteristicEventHandlers: JSBridgedClass {} -public extension CharacteristicEventHandlers { - @inlinable var oncharacteristicvaluechanged: EventHandler { - get { ClosureAttribute1Optional[Strings.oncharacteristicvaluechanged, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.oncharacteristicvaluechanged, in: jsObject] = newValue } - } -} diff --git a/Sources/DOMKit/WebIDL/ChildDisplayType.swift b/Sources/DOMKit/WebIDL/ChildDisplayType.swift deleted file mode 100644 index f540d213..00000000 --- a/Sources/DOMKit/WebIDL/ChildDisplayType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ChildDisplayType: JSString, JSValueCompatible { - case block = "block" - case normal = "normal" - - @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/ClientLifecycleState.swift b/Sources/DOMKit/WebIDL/ClientLifecycleState.swift deleted file mode 100644 index 16514325..00000000 --- a/Sources/DOMKit/WebIDL/ClientLifecycleState.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ClientLifecycleState: JSString, JSValueCompatible { - case active = "active" - case frozen = "frozen" - - @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/Clipboard.swift b/Sources/DOMKit/WebIDL/Clipboard.swift deleted file mode 100644 index b5af9b40..00000000 --- a/Sources/DOMKit/WebIDL/Clipboard.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Clipboard: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Clipboard].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @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 -> ClipboardItems { - let this = jsObject - let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func readText() -> JSPromise { - let this = jsObject - return this[Strings.readText].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func readText() async throws -> String { - let this = jsObject - let _promise: JSPromise = this[Strings.readText].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func write(data: ClipboardItems) -> JSPromise { - let this = jsObject - return this[Strings.write].function!(this: this, arguments: [data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func write(data: ClipboardItems) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func writeText(data: String) -> JSPromise { - let this = jsObject - return this[Strings.writeText].function!(this: this, arguments: [data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func writeText(data: String) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.writeText].function!(this: this, arguments: [data.jsValue]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/ClipboardEvent.swift b/Sources/DOMKit/WebIDL/ClipboardEvent.swift deleted file mode 100644 index d6ac0199..00000000 --- a/Sources/DOMKit/WebIDL/ClipboardEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ClipboardEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ClipboardEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _clipboardData = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipboardData) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: ClipboardEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var clipboardData: DataTransfer? -} diff --git a/Sources/DOMKit/WebIDL/ClipboardEventInit.swift b/Sources/DOMKit/WebIDL/ClipboardEventInit.swift deleted file mode 100644 index a1efb9a3..00000000 --- a/Sources/DOMKit/WebIDL/ClipboardEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ClipboardEventInit: BridgedDictionary { - public convenience init(clipboardData: DataTransfer?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.clipboardData] = clipboardData.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _clipboardData = ReadWriteAttribute(jsObject: object, name: Strings.clipboardData) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var clipboardData: DataTransfer? -} diff --git a/Sources/DOMKit/WebIDL/ClipboardItem.swift b/Sources/DOMKit/WebIDL/ClipboardItem.swift deleted file mode 100644 index 8527107c..00000000 --- a/Sources/DOMKit/WebIDL/ClipboardItem.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ClipboardItem: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ClipboardItem].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _presentationStyle = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentationStyle) - _types = ReadonlyAttribute(jsObject: jsObject, name: Strings.types) - self.jsObject = jsObject - } - - @inlinable public convenience init(items: [String: ClipboardItemData], options: ClipboardItemOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [items.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var presentationStyle: PresentationStyle - - @ReadonlyAttribute - public var types: [String] - - @inlinable public func getType(type: String) -> JSPromise { - let this = jsObject - return this[Strings.getType].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getType(type: String) async throws -> Blob { - let this = jsObject - let _promise: JSPromise = this[Strings.getType].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift b/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift deleted file mode 100644 index 5d15acef..00000000 --- a/Sources/DOMKit/WebIDL/ClipboardItemOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ClipboardItemOptions: BridgedDictionary { - public convenience init(presentationStyle: PresentationStyle) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.presentationStyle] = presentationStyle.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _presentationStyle = ReadWriteAttribute(jsObject: object, name: Strings.presentationStyle) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var presentationStyle: PresentationStyle -} diff --git a/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift deleted file mode 100644 index 4d7e04ed..00000000 --- a/Sources/DOMKit/WebIDL/ClipboardPermissionDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ClipboardPermissionDescriptor: BridgedDictionary { - public convenience init(allowWithoutGesture: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowWithoutGesture] = allowWithoutGesture.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _allowWithoutGesture = ReadWriteAttribute(jsObject: object, name: Strings.allowWithoutGesture) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var allowWithoutGesture: Bool -} diff --git a/Sources/DOMKit/WebIDL/CloseEvent.swift b/Sources/DOMKit/WebIDL/CloseEvent.swift deleted file mode 100644 index 4f76248f..00000000 --- a/Sources/DOMKit/WebIDL/CloseEvent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CloseEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CloseEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _wasClean = ReadonlyAttribute(jsObject: jsObject, name: Strings.wasClean) - _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) - _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: CloseEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var wasClean: Bool - - @ReadonlyAttribute - public var code: UInt16 - - @ReadonlyAttribute - public var reason: String -} diff --git a/Sources/DOMKit/WebIDL/CloseEventInit.swift b/Sources/DOMKit/WebIDL/CloseEventInit.swift deleted file mode 100644 index 846aedd0..00000000 --- a/Sources/DOMKit/WebIDL/CloseEventInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CloseEventInit: BridgedDictionary { - public convenience init(wasClean: Bool, code: UInt16, reason: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.wasClean] = wasClean.jsValue - object[Strings.code] = code.jsValue - object[Strings.reason] = reason.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _wasClean = ReadWriteAttribute(jsObject: object, name: Strings.wasClean) - _code = ReadWriteAttribute(jsObject: object, name: Strings.code) - _reason = ReadWriteAttribute(jsObject: object, name: Strings.reason) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var wasClean: Bool - - @ReadWriteAttribute - public var code: UInt16 - - @ReadWriteAttribute - public var reason: String -} diff --git a/Sources/DOMKit/WebIDL/CloseWatcher.swift b/Sources/DOMKit/WebIDL/CloseWatcher.swift deleted file mode 100644 index 13e439e6..00000000 --- a/Sources/DOMKit/WebIDL/CloseWatcher.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CloseWatcher: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CloseWatcher].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _oncancel = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncancel) - _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: CloseWatcherOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @inlinable public func destroy() { - let this = jsObject - _ = this[Strings.destroy].function!(this: this, arguments: []) - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var oncancel: EventHandler - - @ClosureAttribute1Optional - public var onclose: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift b/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift deleted file mode 100644 index cdd7f9e2..00000000 --- a/Sources/DOMKit/WebIDL/CloseWatcherOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CloseWatcherOptions: BridgedDictionary { - public convenience init(signal: AbortSignal) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var signal: AbortSignal -} diff --git a/Sources/DOMKit/WebIDL/ClosureAttribute.swift b/Sources/DOMKit/WebIDL/ClosureAttribute.swift index 33d9c53c..5bb26ecc 100644 --- a/Sources/DOMKit/WebIDL/ClosureAttribute.swift +++ b/Sources/DOMKit/WebIDL/ClosureAttribute.swift @@ -390,136 +390,6 @@ import JavaScriptKit } } -@propertyWrapper public final class ClosureAttribute3 - where A0: JSValueCompatible, A1: JSValueCompatible, A2: 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, A2) -> ReturnType { - get { ClosureAttribute3[name, in: jsObject] } - set { ClosureAttribute3[name, in: jsObject] = newValue } - } - - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2) -> ReturnType { - get { - let function = jsObject[name].function! - return { function($0.jsValue, $1.jsValue, $2.jsValue).fromJSValue()! } - } - set { - jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue - }.jsValue - } - } -} - -@propertyWrapper public final class ClosureAttribute3Optional - where A0: JSValueCompatible, A1: JSValueCompatible, A2: 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, A2) -> ReturnType)? { - get { ClosureAttribute3Optional[name, in: jsObject] } - set { ClosureAttribute3Optional[name, in: jsObject] = newValue } - } - - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1, A2) -> ReturnType)? { - get { - guard let function = jsObject[name].function else { - return nil - } - return { function($0.jsValue, $1.jsValue, $2.jsValue).fromJSValue()! } - } - set { - if let newValue = newValue { - jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!).jsValue - }.jsValue - } else { - jsObject[name] = .null - } - } - } -} - -@propertyWrapper public final class ClosureAttribute3OptionalVoid - where A0: JSValueCompatible, A1: JSValueCompatible, A2: 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, A2) -> Void)? { - get { ClosureAttribute3OptionalVoid[name, in: jsObject] } - set { ClosureAttribute3OptionalVoid[name, in: jsObject] = newValue } - } - - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1, A2) -> Void)? { - get { - guard let function = jsObject[name].function else { - return nil - } - return { function($0.jsValue, $1.jsValue, $2.jsValue) } - } - set { - if let newValue = newValue { - jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!) - return .undefined - }.jsValue - } else { - jsObject[name] = .null - } - } - } -} - -@propertyWrapper public final class ClosureAttribute3Void - where A0: JSValueCompatible, A1: JSValueCompatible, A2: 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, A2) -> Void { - get { ClosureAttribute3Void[name, in: jsObject] } - set { ClosureAttribute3Void[name, in: jsObject] = newValue } - } - - @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1, A2) -> Void { - get { - let function = jsObject[name].function! - return { function($0.jsValue, $1.jsValue, $2.jsValue) } - } - set { - jsObject[name] = JSClosure { - newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!, $0[2].fromJSValue()!) - return .undefined - }.jsValue - } - } -} - @propertyWrapper public final class ClosureAttribute5 where A0: JSValueCompatible, A1: JSValueCompatible, A2: JSValueCompatible, A3: JSValueCompatible, A4: JSValueCompatible, ReturnType: JSValueCompatible { diff --git a/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift b/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift deleted file mode 100644 index d7de20c2..00000000 --- a/Sources/DOMKit/WebIDL/CollectedClientAdditionalPaymentData.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CollectedClientAdditionalPaymentData: BridgedDictionary { - public convenience init(rp: String, topOrigin: String, payeeOrigin: String, total: PaymentCurrencyAmount, instrument: PaymentCredentialInstrument) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rp] = rp.jsValue - object[Strings.topOrigin] = topOrigin.jsValue - object[Strings.payeeOrigin] = payeeOrigin.jsValue - object[Strings.total] = total.jsValue - object[Strings.instrument] = instrument.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _rp = ReadWriteAttribute(jsObject: object, name: Strings.rp) - _topOrigin = ReadWriteAttribute(jsObject: object, name: Strings.topOrigin) - _payeeOrigin = ReadWriteAttribute(jsObject: object, name: Strings.payeeOrigin) - _total = ReadWriteAttribute(jsObject: object, name: Strings.total) - _instrument = ReadWriteAttribute(jsObject: object, name: Strings.instrument) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var rp: String - - @ReadWriteAttribute - public var topOrigin: String - - @ReadWriteAttribute - public var payeeOrigin: String - - @ReadWriteAttribute - public var total: PaymentCurrencyAmount - - @ReadWriteAttribute - public var instrument: PaymentCredentialInstrument -} diff --git a/Sources/DOMKit/WebIDL/CollectedClientData.swift b/Sources/DOMKit/WebIDL/CollectedClientData.swift deleted file mode 100644 index 99cbc814..00000000 --- a/Sources/DOMKit/WebIDL/CollectedClientData.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CollectedClientData: BridgedDictionary { - public convenience init(type: String, challenge: String, origin: String, crossOrigin: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.challenge] = challenge.jsValue - object[Strings.origin] = origin.jsValue - object[Strings.crossOrigin] = crossOrigin.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _challenge = ReadWriteAttribute(jsObject: object, name: Strings.challenge) - _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) - _crossOrigin = ReadWriteAttribute(jsObject: object, name: Strings.crossOrigin) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: String - - @ReadWriteAttribute - public var challenge: String - - @ReadWriteAttribute - public var origin: String - - @ReadWriteAttribute - public var crossOrigin: Bool -} diff --git a/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift b/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift deleted file mode 100644 index bfbba42f..00000000 --- a/Sources/DOMKit/WebIDL/CollectedClientPaymentData.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CollectedClientPaymentData: BridgedDictionary { - public convenience init(payment: CollectedClientAdditionalPaymentData) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.payment] = payment.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _payment = ReadWriteAttribute(jsObject: object, name: Strings.payment) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var payment: CollectedClientAdditionalPaymentData -} diff --git a/Sources/DOMKit/WebIDL/ColorGamut.swift b/Sources/DOMKit/WebIDL/ColorGamut.swift deleted file mode 100644 index 78297750..00000000 --- a/Sources/DOMKit/WebIDL/ColorGamut.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ColorGamut: JSString, JSValueCompatible { - case srgb = "srgb" - case p3 = "p3" - case rec2020 = "rec2020" - - @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/ColorSelectionOptions.swift b/Sources/DOMKit/WebIDL/ColorSelectionOptions.swift deleted file mode 100644 index 3675f100..00000000 --- a/Sources/DOMKit/WebIDL/ColorSelectionOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ColorSelectionOptions: BridgedDictionary { - public convenience init(signal: AbortSignal) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var signal: AbortSignal -} diff --git a/Sources/DOMKit/WebIDL/ColorSelectionResult.swift b/Sources/DOMKit/WebIDL/ColorSelectionResult.swift deleted file mode 100644 index cc860896..00000000 --- a/Sources/DOMKit/WebIDL/ColorSelectionResult.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ColorSelectionResult: BridgedDictionary { - public convenience init(sRGBHex: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sRGBHex] = sRGBHex.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _sRGBHex = ReadWriteAttribute(jsObject: object, name: Strings.sRGBHex) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var sRGBHex: String -} diff --git a/Sources/DOMKit/WebIDL/CompressionStream.swift b/Sources/DOMKit/WebIDL/CompressionStream.swift deleted file mode 100644 index 47591de3..00000000 --- a/Sources/DOMKit/WebIDL/CompressionStream.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CompressionStream: JSBridgedClass, GenericTransformStream { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CompressionStream].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(format: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue])) - } -} diff --git a/Sources/DOMKit/WebIDL/ComputePressureFactor.swift b/Sources/DOMKit/WebIDL/ComputePressureFactor.swift deleted file mode 100644 index 265e0ddf..00000000 --- a/Sources/DOMKit/WebIDL/ComputePressureFactor.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ComputePressureFactor: JSString, JSValueCompatible { - case thermal = "thermal" - case powerSupply = "power-supply" - - @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/ComputePressureObserver.swift b/Sources/DOMKit/WebIDL/ComputePressureObserver.swift deleted file mode 100644 index 4a92f4d9..00000000 --- a/Sources/DOMKit/WebIDL/ComputePressureObserver.swift +++ /dev/null @@ -1,52 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ComputePressureObserver: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ComputePressureObserver].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _supportedSources = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedSources) - self.jsObject = jsObject - } - - // XXX: constructor is ignored - - @inlinable public func observe(source: ComputePressureSource) { - let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: [source.jsValue]) - } - - @inlinable public func unobserve(source: ComputePressureSource) { - let this = jsObject - _ = this[Strings.unobserve].function!(this: this, arguments: [source.jsValue]) - } - - @inlinable public func disconnect() { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: []) - } - - @inlinable public func takeRecords() -> [ComputePressureRecord] { - let this = jsObject - return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var supportedSources: [ComputePressureSource] - - @inlinable public static func requestPermission() -> JSPromise { - let this = constructor - return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func requestPermission() async throws -> PermissionState { - let this = constructor - let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift b/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift deleted file mode 100644 index dc2b92b0..00000000 --- a/Sources/DOMKit/WebIDL/ComputePressureObserverOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ComputePressureObserverOptions: BridgedDictionary { - public convenience init(frequency: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.frequency] = frequency.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var frequency: Double -} diff --git a/Sources/DOMKit/WebIDL/ComputePressureRecord.swift b/Sources/DOMKit/WebIDL/ComputePressureRecord.swift deleted file mode 100644 index a412bae5..00000000 --- a/Sources/DOMKit/WebIDL/ComputePressureRecord.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ComputePressureRecord: BridgedDictionary { - public convenience init(source: ComputePressureSource, state: ComputePressureState, factors: [ComputePressureFactor], time: DOMHighResTimeStamp) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.source] = source.jsValue - object[Strings.state] = state.jsValue - object[Strings.factors] = factors.jsValue - object[Strings.time] = time.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _source = ReadWriteAttribute(jsObject: object, name: Strings.source) - _state = ReadWriteAttribute(jsObject: object, name: Strings.state) - _factors = ReadWriteAttribute(jsObject: object, name: Strings.factors) - _time = ReadWriteAttribute(jsObject: object, name: Strings.time) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var source: ComputePressureSource - - @ReadWriteAttribute - public var state: ComputePressureState - - @ReadWriteAttribute - public var factors: [ComputePressureFactor] - - @ReadWriteAttribute - public var time: DOMHighResTimeStamp -} diff --git a/Sources/DOMKit/WebIDL/ComputePressureSource.swift b/Sources/DOMKit/WebIDL/ComputePressureSource.swift deleted file mode 100644 index 80da917f..00000000 --- a/Sources/DOMKit/WebIDL/ComputePressureSource.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ComputePressureSource: JSString, JSValueCompatible { - case cpu = "cpu" - - @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/ComputePressureState.swift b/Sources/DOMKit/WebIDL/ComputePressureState.swift deleted file mode 100644 index 39290025..00000000 --- a/Sources/DOMKit/WebIDL/ComputePressureState.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ComputePressureState: JSString, JSValueCompatible { - case nominal = "nominal" - case fair = "fair" - case serious = "serious" - case critical = "critical" - - @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/ComputedEffectTiming.swift b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift index 53a0887d..b95ffc91 100644 --- a/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift +++ b/Sources/DOMKit/WebIDL/ComputedEffectTiming.swift @@ -4,39 +4,19 @@ import JavaScriptEventLoop import JavaScriptKit public class ComputedEffectTiming: BridgedDictionary { - public convenience init(startTime: CSSNumberish, endTime: CSSNumberish, activeDuration: CSSNumberish, localTime: CSSNumberish?, progress: Double?, currentIteration: Double?) { + public convenience init(progress: Double?, currentIteration: Double?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.startTime] = startTime.jsValue - object[Strings.endTime] = endTime.jsValue - object[Strings.activeDuration] = activeDuration.jsValue - object[Strings.localTime] = localTime.jsValue object[Strings.progress] = progress.jsValue object[Strings.currentIteration] = currentIteration.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _startTime = ReadWriteAttribute(jsObject: object, name: Strings.startTime) - _endTime = ReadWriteAttribute(jsObject: object, name: Strings.endTime) - _activeDuration = ReadWriteAttribute(jsObject: object, name: Strings.activeDuration) - _localTime = ReadWriteAttribute(jsObject: object, name: Strings.localTime) _progress = ReadWriteAttribute(jsObject: object, name: Strings.progress) _currentIteration = ReadWriteAttribute(jsObject: object, name: Strings.currentIteration) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var startTime: CSSNumberish - - @ReadWriteAttribute - public var endTime: CSSNumberish - - @ReadWriteAttribute - public var activeDuration: CSSNumberish - - @ReadWriteAttribute - public var localTime: CSSNumberish? - @ReadWriteAttribute public var progress: Double? diff --git a/Sources/DOMKit/WebIDL/ConnectionType.swift b/Sources/DOMKit/WebIDL/ConnectionType.swift deleted file mode 100644 index 634d7e2b..00000000 --- a/Sources/DOMKit/WebIDL/ConnectionType.swift +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ConnectionType: JSString, JSValueCompatible { - case bluetooth = "bluetooth" - case cellular = "cellular" - case ethernet = "ethernet" - case mixed = "mixed" - case none = "none" - case other = "other" - case unknown = "unknown" - case wifi = "wifi" - case wimax = "wimax" - - @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/ConstantSourceNode.swift b/Sources/DOMKit/WebIDL/ConstantSourceNode.swift deleted file mode 100644 index 5b0dfd3d..00000000 --- a/Sources/DOMKit/WebIDL/ConstantSourceNode.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ConstantSourceNode: AudioScheduledSourceNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ConstantSourceNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: ConstantSourceOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var offset: AudioParam -} diff --git a/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift b/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift deleted file mode 100644 index 3d94b1da..00000000 --- a/Sources/DOMKit/WebIDL/ConstantSourceOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ConstantSourceOptions: BridgedDictionary { - public convenience init(offset: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.offset] = offset.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var offset: Float -} diff --git a/Sources/DOMKit/WebIDL/ConstrainPoint2D.swift b/Sources/DOMKit/WebIDL/ConstrainPoint2D.swift deleted file mode 100644 index 2a81cf30..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainPoint2D.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_ConstrainPoint2D: ConvertibleToJSValue {} -extension ConstrainPoint2DParameters: Any_ConstrainPoint2D {} -extension Array: Any_ConstrainPoint2D where Element == Point2D {} - -public enum ConstrainPoint2D: JSValueCompatible, Any_ConstrainPoint2D { - case constrainPoint2DParameters(ConstrainPoint2DParameters) - case seq_of_Point2D([Point2D]) - - public static func construct(from value: JSValue) -> Self? { - if let constrainPoint2DParameters: ConstrainPoint2DParameters = value.fromJSValue() { - return .constrainPoint2DParameters(constrainPoint2DParameters) - } - if let seq_of_Point2D: [Point2D] = value.fromJSValue() { - return .seq_of_Point2D(seq_of_Point2D) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .constrainPoint2DParameters(constrainPoint2DParameters): - return constrainPoint2DParameters.jsValue - case let .seq_of_Point2D(seq_of_Point2D): - return seq_of_Point2D.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift b/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift deleted file mode 100644 index e9bc2ede..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainPoint2DParameters.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ConstrainPoint2DParameters: BridgedDictionary { - public convenience init(exact: [Point2D], ideal: [Point2D]) { - 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: [Point2D] - - @ReadWriteAttribute - public var ideal: [Point2D] -} diff --git a/Sources/DOMKit/WebIDL/ContactAddress.swift b/Sources/DOMKit/WebIDL/ContactAddress.swift deleted file mode 100644 index a77a7492..00000000 --- a/Sources/DOMKit/WebIDL/ContactAddress.swift +++ /dev/null @@ -1,59 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ContactAddress: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ContactAddress].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _city = ReadonlyAttribute(jsObject: jsObject, name: Strings.city) - _country = ReadonlyAttribute(jsObject: jsObject, name: Strings.country) - _dependentLocality = ReadonlyAttribute(jsObject: jsObject, name: Strings.dependentLocality) - _organization = ReadonlyAttribute(jsObject: jsObject, name: Strings.organization) - _phone = ReadonlyAttribute(jsObject: jsObject, name: Strings.phone) - _postalCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.postalCode) - _recipient = ReadonlyAttribute(jsObject: jsObject, name: Strings.recipient) - _region = ReadonlyAttribute(jsObject: jsObject, name: Strings.region) - _sortingCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.sortingCode) - _addressLine = ReadonlyAttribute(jsObject: jsObject, name: Strings.addressLine) - self.jsObject = jsObject - } - - @inlinable public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var city: String - - @ReadonlyAttribute - public var country: String - - @ReadonlyAttribute - public var dependentLocality: String - - @ReadonlyAttribute - public var organization: String - - @ReadonlyAttribute - public var phone: String - - @ReadonlyAttribute - public var postalCode: String - - @ReadonlyAttribute - public var recipient: String - - @ReadonlyAttribute - public var region: String - - @ReadonlyAttribute - public var sortingCode: String - - @ReadonlyAttribute - public var addressLine: [String] -} diff --git a/Sources/DOMKit/WebIDL/ContactInfo.swift b/Sources/DOMKit/WebIDL/ContactInfo.swift deleted file mode 100644 index 0d7fa663..00000000 --- a/Sources/DOMKit/WebIDL/ContactInfo.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ContactInfo: BridgedDictionary { - public convenience init(address: [ContactAddress], email: [String], icon: [Blob], name: [String], tel: [String]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.address] = address.jsValue - object[Strings.email] = email.jsValue - object[Strings.icon] = icon.jsValue - object[Strings.name] = name.jsValue - object[Strings.tel] = tel.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _address = ReadWriteAttribute(jsObject: object, name: Strings.address) - _email = ReadWriteAttribute(jsObject: object, name: Strings.email) - _icon = ReadWriteAttribute(jsObject: object, name: Strings.icon) - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _tel = ReadWriteAttribute(jsObject: object, name: Strings.tel) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var address: [ContactAddress] - - @ReadWriteAttribute - public var email: [String] - - @ReadWriteAttribute - public var icon: [Blob] - - @ReadWriteAttribute - public var name: [String] - - @ReadWriteAttribute - public var tel: [String] -} diff --git a/Sources/DOMKit/WebIDL/ContactProperty.swift b/Sources/DOMKit/WebIDL/ContactProperty.swift deleted file mode 100644 index d9bbfdbd..00000000 --- a/Sources/DOMKit/WebIDL/ContactProperty.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ContactProperty: JSString, JSValueCompatible { - case address = "address" - case email = "email" - case icon = "icon" - case name = "name" - case tel = "tel" - - @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/ContactsManager.swift b/Sources/DOMKit/WebIDL/ContactsManager.swift deleted file mode 100644 index 24ab3fd8..00000000 --- a/Sources/DOMKit/WebIDL/ContactsManager.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ContactsManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ContactsManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func getProperties() -> JSPromise { - let this = jsObject - return this[Strings.getProperties].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getProperties() async throws -> [ContactProperty] { - let this = jsObject - let _promise: JSPromise = this[Strings.getProperties].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.select].function!(this: this, arguments: [properties.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func select(properties: [ContactProperty], options: ContactsSelectOptions? = nil) async throws -> [ContactInfo] { - let this = jsObject - let _promise: JSPromise = this[Strings.select].function!(this: this, arguments: [properties.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift b/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift deleted file mode 100644 index 0a989b96..00000000 --- a/Sources/DOMKit/WebIDL/ContactsSelectOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ContactsSelectOptions: BridgedDictionary { - public convenience init(multiple: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.multiple] = multiple.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _multiple = ReadWriteAttribute(jsObject: object, name: Strings.multiple) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var multiple: Bool -} diff --git a/Sources/DOMKit/WebIDL/ContentCategory.swift b/Sources/DOMKit/WebIDL/ContentCategory.swift deleted file mode 100644 index d6840252..00000000 --- a/Sources/DOMKit/WebIDL/ContentCategory.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ContentCategory: JSString, JSValueCompatible { - case _empty = "" - case homepage = "homepage" - case article = "article" - case video = "video" - case audio = "audio" - - @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/ContentDescription.swift b/Sources/DOMKit/WebIDL/ContentDescription.swift deleted file mode 100644 index 0b2c9fe0..00000000 --- a/Sources/DOMKit/WebIDL/ContentDescription.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ContentDescription: BridgedDictionary { - public convenience init(id: String, title: String, description: String, category: ContentCategory, icons: [ImageResource], url: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue - object[Strings.title] = title.jsValue - object[Strings.description] = description.jsValue - object[Strings.category] = category.jsValue - object[Strings.icons] = icons.jsValue - object[Strings.url] = url.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _title = ReadWriteAttribute(jsObject: object, name: Strings.title) - _description = ReadWriteAttribute(jsObject: object, name: Strings.description) - _category = ReadWriteAttribute(jsObject: object, name: Strings.category) - _icons = ReadWriteAttribute(jsObject: object, name: Strings.icons) - _url = ReadWriteAttribute(jsObject: object, name: Strings.url) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var id: String - - @ReadWriteAttribute - public var title: String - - @ReadWriteAttribute - public var description: String - - @ReadWriteAttribute - public var category: ContentCategory - - @ReadWriteAttribute - public var icons: [ImageResource] - - @ReadWriteAttribute - public var url: String -} diff --git a/Sources/DOMKit/WebIDL/ContentIndex.swift b/Sources/DOMKit/WebIDL/ContentIndex.swift deleted file mode 100644 index cd8398b8..00000000 --- a/Sources/DOMKit/WebIDL/ContentIndex.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ContentIndex: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ContentIndex].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func add(description: ContentDescription) -> JSPromise { - let this = jsObject - return this[Strings.add].function!(this: this, arguments: [description.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func add(description: ContentDescription) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.add].function!(this: this, arguments: [description.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func delete(id: String) -> JSPromise { - let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [id.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func delete(id: String) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [id.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func getAll() -> JSPromise { - let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getAll() async throws -> [ContentDescription] { - let this = jsObject - let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift b/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift deleted file mode 100644 index 9b5e24d3..00000000 --- a/Sources/DOMKit/WebIDL/ContentIndexEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ContentIndexEventInit: BridgedDictionary { - public convenience init(id: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var id: String -} diff --git a/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift b/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift deleted file mode 100644 index e5671dbc..00000000 --- a/Sources/DOMKit/WebIDL/ConvertCoordinateOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ConvertCoordinateOptions: BridgedDictionary { - public convenience init(fromBox: CSSBoxType, toBox: CSSBoxType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fromBox] = fromBox.jsValue - object[Strings.toBox] = toBox.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _fromBox = ReadWriteAttribute(jsObject: object, name: Strings.fromBox) - _toBox = ReadWriteAttribute(jsObject: object, name: Strings.toBox) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var fromBox: CSSBoxType - - @ReadWriteAttribute - public var toBox: CSSBoxType -} diff --git a/Sources/DOMKit/WebIDL/ConvolverNode.swift b/Sources/DOMKit/WebIDL/ConvolverNode.swift deleted file mode 100644 index bc79e7e7..00000000 --- a/Sources/DOMKit/WebIDL/ConvolverNode.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ConvolverNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ConvolverNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _buffer = ReadWriteAttribute(jsObject: jsObject, name: Strings.buffer) - _normalize = ReadWriteAttribute(jsObject: jsObject, name: Strings.normalize) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: ConvolverOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var buffer: AudioBuffer? - - @ReadWriteAttribute - public var normalize: Bool -} diff --git a/Sources/DOMKit/WebIDL/ConvolverOptions.swift b/Sources/DOMKit/WebIDL/ConvolverOptions.swift deleted file mode 100644 index 5fcda090..00000000 --- a/Sources/DOMKit/WebIDL/ConvolverOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ConvolverOptions: BridgedDictionary { - public convenience init(buffer: AudioBuffer?, disableNormalization: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffer] = buffer.jsValue - object[Strings.disableNormalization] = disableNormalization.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) - _disableNormalization = ReadWriteAttribute(jsObject: object, name: Strings.disableNormalization) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var buffer: AudioBuffer? - - @ReadWriteAttribute - public var disableNormalization: Bool -} diff --git a/Sources/DOMKit/WebIDL/CookieChangeEvent.swift b/Sources/DOMKit/WebIDL/CookieChangeEvent.swift deleted file mode 100644 index 0380aed1..00000000 --- a/Sources/DOMKit/WebIDL/CookieChangeEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CookieChangeEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CookieChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _changed = ReadonlyAttribute(jsObject: jsObject, name: Strings.changed) - _deleted = ReadonlyAttribute(jsObject: jsObject, name: Strings.deleted) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: CookieChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var changed: [CookieListItem] - - @ReadonlyAttribute - public var deleted: [CookieListItem] -} diff --git a/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift b/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift deleted file mode 100644 index 72e0ad9b..00000000 --- a/Sources/DOMKit/WebIDL/CookieChangeEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CookieChangeEventInit: BridgedDictionary { - public convenience init(changed: CookieList, deleted: CookieList) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.changed] = changed.jsValue - object[Strings.deleted] = deleted.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _changed = ReadWriteAttribute(jsObject: object, name: Strings.changed) - _deleted = ReadWriteAttribute(jsObject: object, name: Strings.deleted) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var changed: CookieList - - @ReadWriteAttribute - public var deleted: CookieList -} diff --git a/Sources/DOMKit/WebIDL/CookieInit.swift b/Sources/DOMKit/WebIDL/CookieInit.swift deleted file mode 100644 index 63dbcd80..00000000 --- a/Sources/DOMKit/WebIDL/CookieInit.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CookieInit: BridgedDictionary { - public convenience init(name: String, value: String, expires: DOMTimeStamp?, domain: String?, path: String, sameSite: CookieSameSite) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.value] = value.jsValue - object[Strings.expires] = expires.jsValue - object[Strings.domain] = domain.jsValue - object[Strings.path] = path.jsValue - object[Strings.sameSite] = sameSite.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _value = ReadWriteAttribute(jsObject: object, name: Strings.value) - _expires = ReadWriteAttribute(jsObject: object, name: Strings.expires) - _domain = ReadWriteAttribute(jsObject: object, name: Strings.domain) - _path = ReadWriteAttribute(jsObject: object, name: Strings.path) - _sameSite = ReadWriteAttribute(jsObject: object, name: Strings.sameSite) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var value: String - - @ReadWriteAttribute - public var expires: DOMTimeStamp? - - @ReadWriteAttribute - public var domain: String? - - @ReadWriteAttribute - public var path: String - - @ReadWriteAttribute - public var sameSite: CookieSameSite -} diff --git a/Sources/DOMKit/WebIDL/CookieListItem.swift b/Sources/DOMKit/WebIDL/CookieListItem.swift deleted file mode 100644 index 2e020ebb..00000000 --- a/Sources/DOMKit/WebIDL/CookieListItem.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CookieListItem: BridgedDictionary { - public convenience init(name: String, value: String, domain: String?, path: String, expires: DOMTimeStamp?, secure: Bool, sameSite: CookieSameSite) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.value] = value.jsValue - object[Strings.domain] = domain.jsValue - object[Strings.path] = path.jsValue - object[Strings.expires] = expires.jsValue - object[Strings.secure] = secure.jsValue - object[Strings.sameSite] = sameSite.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _value = ReadWriteAttribute(jsObject: object, name: Strings.value) - _domain = ReadWriteAttribute(jsObject: object, name: Strings.domain) - _path = ReadWriteAttribute(jsObject: object, name: Strings.path) - _expires = ReadWriteAttribute(jsObject: object, name: Strings.expires) - _secure = ReadWriteAttribute(jsObject: object, name: Strings.secure) - _sameSite = ReadWriteAttribute(jsObject: object, name: Strings.sameSite) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var value: String - - @ReadWriteAttribute - public var domain: String? - - @ReadWriteAttribute - public var path: String - - @ReadWriteAttribute - public var expires: DOMTimeStamp? - - @ReadWriteAttribute - public var secure: Bool - - @ReadWriteAttribute - public var sameSite: CookieSameSite -} diff --git a/Sources/DOMKit/WebIDL/CookieSameSite.swift b/Sources/DOMKit/WebIDL/CookieSameSite.swift deleted file mode 100644 index 49cb425b..00000000 --- a/Sources/DOMKit/WebIDL/CookieSameSite.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum CookieSameSite: JSString, JSValueCompatible { - case strict = "strict" - case lax = "lax" - case none = "none" - - @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/CookieStore.swift b/Sources/DOMKit/WebIDL/CookieStore.swift deleted file mode 100644 index 3de8846e..00000000 --- a/Sources/DOMKit/WebIDL/CookieStore.swift +++ /dev/null @@ -1,112 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CookieStore: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CookieStore].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func get(name: String) -> JSPromise { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func get(name: String) async throws -> CookieListItem? { - let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func get(options: CookieStoreGetOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func get(options: CookieStoreGetOptions? = nil) async throws -> CookieListItem? { - let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getAll(name: String) -> JSPromise { - let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getAll(name: String) async throws -> CookieList { - let this = jsObject - let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getAll(options: CookieStoreGetOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getAll(options: CookieStoreGetOptions? = nil) async throws -> CookieList { - let this = jsObject - let _promise: JSPromise = this[Strings.getAll].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func set(name: String, value: String) -> JSPromise { - let this = jsObject - return this[Strings.set].function!(this: this, arguments: [name.jsValue, value.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func set(name: String, value: String) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [name.jsValue, value.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func set(options: CookieInit) -> JSPromise { - let this = jsObject - return this[Strings.set].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func set(options: CookieInit) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func delete(name: String) -> JSPromise { - let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func delete(name: String) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func delete(options: CookieStoreDeleteOptions) -> JSPromise { - let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func delete(options: CookieStoreDeleteOptions) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @ClosureAttribute1Optional - public var onchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift b/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift deleted file mode 100644 index 6d7ca727..00000000 --- a/Sources/DOMKit/WebIDL/CookieStoreDeleteOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CookieStoreDeleteOptions: BridgedDictionary { - public convenience init(name: String, domain: String?, path: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.domain] = domain.jsValue - object[Strings.path] = path.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _domain = ReadWriteAttribute(jsObject: object, name: Strings.domain) - _path = ReadWriteAttribute(jsObject: object, name: Strings.path) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var domain: String? - - @ReadWriteAttribute - public var path: String -} diff --git a/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift b/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift deleted file mode 100644 index 274f7d5a..00000000 --- a/Sources/DOMKit/WebIDL/CookieStoreGetOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CookieStoreGetOptions: BridgedDictionary { - public convenience init(name: String, url: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.url] = url.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _url = ReadWriteAttribute(jsObject: object, name: Strings.url) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var url: String -} diff --git a/Sources/DOMKit/WebIDL/CookieStoreManager.swift b/Sources/DOMKit/WebIDL/CookieStoreManager.swift deleted file mode 100644 index add9e129..00000000 --- a/Sources/DOMKit/WebIDL/CookieStoreManager.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CookieStoreManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CookieStoreManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func subscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { - let this = jsObject - return this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func subscribe(subscriptions: [CookieStoreGetOptions]) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [subscriptions.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func getSubscriptions() -> JSPromise { - let this = jsObject - return this[Strings.getSubscriptions].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getSubscriptions() async throws -> [CookieStoreGetOptions] { - let this = jsObject - let _promise: JSPromise = this[Strings.getSubscriptions].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func unsubscribe(subscriptions: [CookieStoreGetOptions]) -> JSPromise { - let this = jsObject - return this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func unsubscribe(subscriptions: [CookieStoreGetOptions]) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.unsubscribe].function!(this: this, arguments: [subscriptions.jsValue]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/CrashReportBody.swift b/Sources/DOMKit/WebIDL/CrashReportBody.swift deleted file mode 100644 index c417fa1c..00000000 --- a/Sources/DOMKit/WebIDL/CrashReportBody.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CrashReportBody: ReportBody { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CrashReportBody].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var reason: String? -} diff --git a/Sources/DOMKit/WebIDL/Credential.swift b/Sources/DOMKit/WebIDL/Credential.swift deleted file mode 100644 index 35e62e21..00000000 --- a/Sources/DOMKit/WebIDL/Credential.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Credential: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Credential].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var type: String - - @inlinable public static func isConditionalMediationAvailable() -> Bool { - let this = constructor - return this[Strings.isConditionalMediationAvailable].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift b/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift deleted file mode 100644 index 37b53d63..00000000 --- a/Sources/DOMKit/WebIDL/CredentialCreationOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CredentialCreationOptions: BridgedDictionary { - public convenience init(signal: AbortSignal, password: PasswordCredentialInit, federated: FederatedCredentialInit, publicKey: PublicKeyCredentialCreationOptions) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue - object[Strings.password] = password.jsValue - object[Strings.federated] = federated.jsValue - object[Strings.publicKey] = publicKey.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - _password = ReadWriteAttribute(jsObject: object, name: Strings.password) - _federated = ReadWriteAttribute(jsObject: object, name: Strings.federated) - _publicKey = ReadWriteAttribute(jsObject: object, name: Strings.publicKey) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var signal: AbortSignal - - @ReadWriteAttribute - public var password: PasswordCredentialInit - - @ReadWriteAttribute - public var federated: FederatedCredentialInit - - @ReadWriteAttribute - public var publicKey: PublicKeyCredentialCreationOptions -} diff --git a/Sources/DOMKit/WebIDL/CredentialData.swift b/Sources/DOMKit/WebIDL/CredentialData.swift deleted file mode 100644 index 758574fb..00000000 --- a/Sources/DOMKit/WebIDL/CredentialData.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CredentialData: BridgedDictionary { - public convenience init(id: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var id: String -} diff --git a/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift b/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift deleted file mode 100644 index baed0604..00000000 --- a/Sources/DOMKit/WebIDL/CredentialMediationRequirement.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum CredentialMediationRequirement: JSString, JSValueCompatible { - case silent = "silent" - case optional = "optional" - case conditional = "conditional" - case required = "required" - - @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/CredentialPropertiesOutput.swift b/Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift deleted file mode 100644 index f917d103..00000000 --- a/Sources/DOMKit/WebIDL/CredentialPropertiesOutput.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CredentialPropertiesOutput: BridgedDictionary { - public convenience init(rk: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rk] = rk.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _rk = ReadWriteAttribute(jsObject: object, name: Strings.rk) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var rk: Bool -} diff --git a/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift deleted file mode 100644 index f7f5503f..00000000 --- a/Sources/DOMKit/WebIDL/CredentialRequestOptions.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CredentialRequestOptions: BridgedDictionary { - public convenience init(mediation: CredentialMediationRequirement, signal: AbortSignal, password: Bool, federated: FederatedCredentialRequestOptions, otp: OTPCredentialRequestOptions, publicKey: PublicKeyCredentialRequestOptions) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediation] = mediation.jsValue - object[Strings.signal] = signal.jsValue - object[Strings.password] = password.jsValue - object[Strings.federated] = federated.jsValue - object[Strings.otp] = otp.jsValue - object[Strings.publicKey] = publicKey.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mediation = ReadWriteAttribute(jsObject: object, name: Strings.mediation) - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - _password = ReadWriteAttribute(jsObject: object, name: Strings.password) - _federated = ReadWriteAttribute(jsObject: object, name: Strings.federated) - _otp = ReadWriteAttribute(jsObject: object, name: Strings.otp) - _publicKey = ReadWriteAttribute(jsObject: object, name: Strings.publicKey) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mediation: CredentialMediationRequirement - - @ReadWriteAttribute - public var signal: AbortSignal - - @ReadWriteAttribute - public var password: Bool - - @ReadWriteAttribute - public var federated: FederatedCredentialRequestOptions - - @ReadWriteAttribute - public var otp: OTPCredentialRequestOptions - - @ReadWriteAttribute - public var publicKey: PublicKeyCredentialRequestOptions -} diff --git a/Sources/DOMKit/WebIDL/CredentialUserData.swift b/Sources/DOMKit/WebIDL/CredentialUserData.swift deleted file mode 100644 index a1f77b07..00000000 --- a/Sources/DOMKit/WebIDL/CredentialUserData.swift +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol CredentialUserData: JSBridgedClass {} -public extension CredentialUserData { - @inlinable var name: String { ReadonlyAttribute[Strings.name, in: jsObject] } - - @inlinable var iconURL: String { ReadonlyAttribute[Strings.iconURL, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/CredentialsContainer.swift b/Sources/DOMKit/WebIDL/CredentialsContainer.swift deleted file mode 100644 index f28b1c7f..00000000 --- a/Sources/DOMKit/WebIDL/CredentialsContainer.swift +++ /dev/null @@ -1,62 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CredentialsContainer: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CredentialsContainer].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func get(options: CredentialRequestOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func get(options: CredentialRequestOptions? = nil) async throws -> Credential? { - let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func store(credential: Credential) -> JSPromise { - let this = jsObject - return this[Strings.store].function!(this: this, arguments: [credential.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func store(credential: Credential) async throws -> Credential { - let this = jsObject - let _promise: JSPromise = this[Strings.store].function!(this: this, arguments: [credential.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func create(options: CredentialCreationOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.create].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func create(options: CredentialCreationOptions? = nil) async throws -> Credential? { - let this = jsObject - let _promise: JSPromise = this[Strings.create].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func preventSilentAccess() -> JSPromise { - let this = jsObject - return this[Strings.preventSilentAccess].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func preventSilentAccess() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.preventSilentAccess].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/CropTarget.swift b/Sources/DOMKit/WebIDL/CropTarget.swift deleted file mode 100644 index 5cff81a7..00000000 --- a/Sources/DOMKit/WebIDL/CropTarget.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CropTarget: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CropTarget].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/Crypto.swift b/Sources/DOMKit/WebIDL/Crypto.swift deleted file mode 100644 index 4dd97060..00000000 --- a/Sources/DOMKit/WebIDL/Crypto.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Crypto: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Crypto].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _subtle = ReadonlyAttribute(jsObject: jsObject, name: Strings.subtle) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var subtle: SubtleCrypto - - @inlinable public func getRandomValues(array: ArrayBufferView) -> ArrayBufferView { - let this = jsObject - return this[Strings.getRandomValues].function!(this: this, arguments: [array.jsValue]).fromJSValue()! - } - - @inlinable public func randomUUID() -> String { - let this = jsObject - return this[Strings.randomUUID].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CryptoKey.swift b/Sources/DOMKit/WebIDL/CryptoKey.swift deleted file mode 100644 index e7ba2153..00000000 --- a/Sources/DOMKit/WebIDL/CryptoKey.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CryptoKey: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CryptoKey].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _extractable = ReadonlyAttribute(jsObject: jsObject, name: Strings.extractable) - _algorithm = ReadonlyAttribute(jsObject: jsObject, name: Strings.algorithm) - _usages = ReadonlyAttribute(jsObject: jsObject, name: Strings.usages) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var type: KeyType - - @ReadonlyAttribute - public var extractable: Bool - - @ReadonlyAttribute - public var algorithm: JSObject - - @ReadonlyAttribute - public var usages: JSObject -} diff --git a/Sources/DOMKit/WebIDL/CryptoKeyID.swift b/Sources/DOMKit/WebIDL/CryptoKeyID.swift deleted file mode 100644 index 5ba9ddbf..00000000 --- a/Sources/DOMKit/WebIDL/CryptoKeyID.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CryptoKeyID: ConvertibleToJSValue {} -extension SmallCryptoKeyID: Any_CryptoKeyID {} -extension __UNSUPPORTED_BIGINT__: Any_CryptoKeyID {} - -public enum CryptoKeyID: JSValueCompatible, Any_CryptoKeyID { - case smallCryptoKeyID(SmallCryptoKeyID) - case __UNSUPPORTED_BIGINT__(__UNSUPPORTED_BIGINT__) - - public static func construct(from value: JSValue) -> Self? { - if let smallCryptoKeyID: SmallCryptoKeyID = value.fromJSValue() { - return .smallCryptoKeyID(smallCryptoKeyID) - } - if let __UNSUPPORTED_BIGINT__: __UNSUPPORTED_BIGINT__ = value.fromJSValue() { - return .__UNSUPPORTED_BIGINT__(__UNSUPPORTED_BIGINT__) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .smallCryptoKeyID(smallCryptoKeyID): - return smallCryptoKeyID.jsValue - case let .__UNSUPPORTED_BIGINT__(__UNSUPPORTED_BIGINT__): - return __UNSUPPORTED_BIGINT__.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CryptoKeyPair.swift b/Sources/DOMKit/WebIDL/CryptoKeyPair.swift deleted file mode 100644 index 5bc8e030..00000000 --- a/Sources/DOMKit/WebIDL/CryptoKeyPair.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CryptoKeyPair: BridgedDictionary { - public convenience init(publicKey: CryptoKey, privateKey: CryptoKey) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.publicKey] = publicKey.jsValue - object[Strings.privateKey] = privateKey.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _publicKey = ReadWriteAttribute(jsObject: object, name: Strings.publicKey) - _privateKey = ReadWriteAttribute(jsObject: object, name: Strings.privateKey) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var publicKey: CryptoKey - - @ReadWriteAttribute - public var privateKey: CryptoKey -} diff --git a/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift b/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift deleted file mode 100644 index 80aac352..00000000 --- a/Sources/DOMKit/WebIDL/CursorCaptureConstraint.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum CursorCaptureConstraint: JSString, JSValueCompatible { - case never = "never" - case always = "always" - case motion = "motion" - - @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/CustomStateSet.swift b/Sources/DOMKit/WebIDL/CustomStateSet.swift deleted file mode 100644 index 0a8f82bf..00000000 --- a/Sources/DOMKit/WebIDL/CustomStateSet.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CustomStateSet: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CustomStateSet].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Set-like! - - @inlinable public func add(value: String) { - let this = jsObject - _ = this[Strings.add].function!(this: this, arguments: [value.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift b/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift deleted file mode 100644 index b85284df..00000000 --- a/Sources/DOMKit/WebIDL/DOMHighResTimeStamp_or_String.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_DOMHighResTimeStamp_or_String: ConvertibleToJSValue {} -extension DOMHighResTimeStamp: Any_DOMHighResTimeStamp_or_String {} -extension String: Any_DOMHighResTimeStamp_or_String {} - -public enum DOMHighResTimeStamp_or_String: JSValueCompatible, Any_DOMHighResTimeStamp_or_String { - case dOMHighResTimeStamp(DOMHighResTimeStamp) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let dOMHighResTimeStamp: DOMHighResTimeStamp = value.fromJSValue() { - return .dOMHighResTimeStamp(dOMHighResTimeStamp) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .dOMHighResTimeStamp(dOMHighResTimeStamp): - return dOMHighResTimeStamp.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift index ca4dce43..bdc7d948 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift @@ -8,12 +8,12 @@ extension DOMPointInit: Any_DOMPointInit_or_Double {} extension Double: Any_DOMPointInit_or_Double {} public enum DOMPointInit_or_Double: JSValueCompatible, Any_DOMPointInit_or_Double { - case dOMPointInit(DOMPointInit) + case domPointInit(DOMPointInit) case double(Double) public static func construct(from value: JSValue) -> Self? { - if let dOMPointInit: DOMPointInit = value.fromJSValue() { - return .dOMPointInit(dOMPointInit) + if let domPointInit: DOMPointInit = value.fromJSValue() { + return .domPointInit(domPointInit) } if let double: Double = value.fromJSValue() { return .double(double) @@ -23,8 +23,8 @@ public enum DOMPointInit_or_Double: JSValueCompatible, Any_DOMPointInit_or_Doubl public var jsValue: JSValue { switch self { - case let .dOMPointInit(dOMPointInit): - return dOMPointInit.jsValue + case let .domPointInit(domPointInit): + return domPointInit.jsValue case let .double(double): return double.jsValue } diff --git a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift index e0cd7200..3e6d04d0 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift @@ -9,13 +9,13 @@ extension Double: Any_DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double {} extension Array: Any_DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double where Element == DOMPointInit_or_Double {} public enum DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double: JSValueCompatible, Any_DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double { - case dOMPointInit(DOMPointInit) + case domPointInit(DOMPointInit) case double(Double) case seq_of_DOMPointInit_or_Double([DOMPointInit_or_Double]) public static func construct(from value: JSValue) -> Self? { - if let dOMPointInit: DOMPointInit = value.fromJSValue() { - return .dOMPointInit(dOMPointInit) + if let domPointInit: DOMPointInit = value.fromJSValue() { + return .domPointInit(domPointInit) } if let double: Double = value.fromJSValue() { return .double(double) @@ -28,8 +28,8 @@ public enum DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double: JSValueComp public var jsValue: JSValue { switch self { - case let .dOMPointInit(dOMPointInit): - return dOMPointInit.jsValue + case let .domPointInit(domPointInit): + return domPointInit.jsValue case let .double(double): return double.jsValue case let .seq_of_DOMPointInit_or_Double(seq_of_DOMPointInit_or_Double): diff --git a/Sources/DOMKit/WebIDL/DataCue.swift b/Sources/DOMKit/WebIDL/DataCue.swift deleted file mode 100644 index 76429700..00000000 --- a/Sources/DOMKit/WebIDL/DataCue.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DataCue: TextTrackCue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DataCue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(startTime: Double, endTime: Double, value: JSValue, type: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue, endTime.jsValue, value.jsValue, type?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var value: JSValue - - @ReadonlyAttribute - public var type: String -} diff --git a/Sources/DOMKit/WebIDL/DataTransferItem.swift b/Sources/DOMKit/WebIDL/DataTransferItem.swift index e36f0b63..efe475e0 100644 --- a/Sources/DOMKit/WebIDL/DataTransferItem.swift +++ b/Sources/DOMKit/WebIDL/DataTransferItem.swift @@ -14,23 +14,6 @@ public class DataTransferItem: JSBridgedClass { self.jsObject = jsObject } - @inlinable public func webkitGetAsEntry() -> FileSystemEntry? { - let this = jsObject - return this[Strings.webkitGetAsEntry].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getAsFileSystemHandle() -> JSPromise { - let this = jsObject - return this[Strings.getAsFileSystemHandle].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getAsFileSystemHandle() async throws -> FileSystemHandle? { - let this = jsObject - let _promise: JSPromise = this[Strings.getAsFileSystemHandle].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - @ReadonlyAttribute public var kind: String diff --git a/Sources/DOMKit/WebIDL/DecompressionStream.swift b/Sources/DOMKit/WebIDL/DecompressionStream.swift deleted file mode 100644 index 1c49a500..00000000 --- a/Sources/DOMKit/WebIDL/DecompressionStream.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DecompressionStream: JSBridgedClass, GenericTransformStream { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DecompressionStream].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(format: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [format.jsValue])) - } -} diff --git a/Sources/DOMKit/WebIDL/DelayNode.swift b/Sources/DOMKit/WebIDL/DelayNode.swift deleted file mode 100644 index 2d6a1fbe..00000000 --- a/Sources/DOMKit/WebIDL/DelayNode.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DelayNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DelayNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _delayTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.delayTime) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: DelayOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var delayTime: AudioParam -} diff --git a/Sources/DOMKit/WebIDL/DelayOptions.swift b/Sources/DOMKit/WebIDL/DelayOptions.swift deleted file mode 100644 index 5389fd20..00000000 --- a/Sources/DOMKit/WebIDL/DelayOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DelayOptions: BridgedDictionary { - public convenience init(maxDelayTime: Double, delayTime: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.maxDelayTime] = maxDelayTime.jsValue - object[Strings.delayTime] = delayTime.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _maxDelayTime = ReadWriteAttribute(jsObject: object, name: Strings.maxDelayTime) - _delayTime = ReadWriteAttribute(jsObject: object, name: Strings.delayTime) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var maxDelayTime: Double - - @ReadWriteAttribute - public var delayTime: Double -} diff --git a/Sources/DOMKit/WebIDL/DeprecationReportBody.swift b/Sources/DOMKit/WebIDL/DeprecationReportBody.swift deleted file mode 100644 index ee44deb5..00000000 --- a/Sources/DOMKit/WebIDL/DeprecationReportBody.swift +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DeprecationReportBody: ReportBody { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DeprecationReportBody].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _anticipatedRemoval = ReadonlyAttribute(jsObject: jsObject, name: Strings.anticipatedRemoval) - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) - _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) - _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var anticipatedRemoval: JSObject? - - @ReadonlyAttribute - public var message: String - - @ReadonlyAttribute - public var sourceFile: String? - - @ReadonlyAttribute - public var lineNumber: UInt32? - - @ReadonlyAttribute - public var columnNumber: UInt32? -} diff --git a/Sources/DOMKit/WebIDL/DetectedBarcode.swift b/Sources/DOMKit/WebIDL/DetectedBarcode.swift deleted file mode 100644 index a68e8a4d..00000000 --- a/Sources/DOMKit/WebIDL/DetectedBarcode.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DetectedBarcode: BridgedDictionary { - public convenience init(boundingBox: DOMRectReadOnly, rawValue: String, format: BarcodeFormat, cornerPoints: [Point2D]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.boundingBox] = boundingBox.jsValue - object[Strings.rawValue] = rawValue.jsValue - object[Strings.format] = format.jsValue - object[Strings.cornerPoints] = cornerPoints.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _boundingBox = ReadWriteAttribute(jsObject: object, name: Strings.boundingBox) - _rawValue = ReadWriteAttribute(jsObject: object, name: Strings.rawValue) - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _cornerPoints = ReadWriteAttribute(jsObject: object, name: Strings.cornerPoints) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var boundingBox: DOMRectReadOnly - - @ReadWriteAttribute - public var rawValue: String - - @ReadWriteAttribute - public var format: BarcodeFormat - - @ReadWriteAttribute - public var cornerPoints: [Point2D] -} diff --git a/Sources/DOMKit/WebIDL/DetectedFace.swift b/Sources/DOMKit/WebIDL/DetectedFace.swift deleted file mode 100644 index 54ff8272..00000000 --- a/Sources/DOMKit/WebIDL/DetectedFace.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DetectedFace: BridgedDictionary { - public convenience init(boundingBox: DOMRectReadOnly, landmarks: [Landmark]?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.boundingBox] = boundingBox.jsValue - object[Strings.landmarks] = landmarks.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _boundingBox = ReadWriteAttribute(jsObject: object, name: Strings.boundingBox) - _landmarks = ReadWriteAttribute(jsObject: object, name: Strings.landmarks) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var boundingBox: DOMRectReadOnly - - @ReadWriteAttribute - public var landmarks: [Landmark]? -} diff --git a/Sources/DOMKit/WebIDL/DetectedText.swift b/Sources/DOMKit/WebIDL/DetectedText.swift deleted file mode 100644 index 39e23a4b..00000000 --- a/Sources/DOMKit/WebIDL/DetectedText.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DetectedText: BridgedDictionary { - public convenience init(boundingBox: DOMRectReadOnly, rawValue: String, cornerPoints: [Point2D]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.boundingBox] = boundingBox.jsValue - object[Strings.rawValue] = rawValue.jsValue - object[Strings.cornerPoints] = cornerPoints.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _boundingBox = ReadWriteAttribute(jsObject: object, name: Strings.boundingBox) - _rawValue = ReadWriteAttribute(jsObject: object, name: Strings.rawValue) - _cornerPoints = ReadWriteAttribute(jsObject: object, name: Strings.cornerPoints) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var boundingBox: DOMRectReadOnly - - @ReadWriteAttribute - public var rawValue: String - - @ReadWriteAttribute - public var cornerPoints: [Point2D] -} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift b/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift deleted file mode 100644 index 0a3c9542..00000000 --- a/Sources/DOMKit/WebIDL/DeviceMotionEvent.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DeviceMotionEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _acceleration = ReadonlyAttribute(jsObject: jsObject, name: Strings.acceleration) - _accelerationIncludingGravity = ReadonlyAttribute(jsObject: jsObject, name: Strings.accelerationIncludingGravity) - _rotationRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.rotationRate) - _interval = ReadonlyAttribute(jsObject: jsObject, name: Strings.interval) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: DeviceMotionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var acceleration: DeviceMotionEventAcceleration? - - @ReadonlyAttribute - public var accelerationIncludingGravity: DeviceMotionEventAcceleration? - - @ReadonlyAttribute - public var rotationRate: DeviceMotionEventRotationRate? - - @ReadonlyAttribute - public var interval: Double - - @inlinable public static func requestPermission() -> JSPromise { - let this = constructor - return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func requestPermission() async throws -> PermissionState { - let this = constructor - let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift deleted file mode 100644 index 3c9b148a..00000000 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventAcceleration.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DeviceMotionEventAcceleration: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEventAcceleration].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var x: Double? - - @ReadonlyAttribute - public var y: Double? - - @ReadonlyAttribute - public var z: Double? -} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift deleted file mode 100644 index c5f6454d..00000000 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventAccelerationInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DeviceMotionEventAccelerationInit: BridgedDictionary { - public convenience init(x: Double?, y: Double?, z: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - object[Strings.z] = z.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - _z = ReadWriteAttribute(jsObject: object, name: Strings.z) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var x: Double? - - @ReadWriteAttribute - public var y: Double? - - @ReadWriteAttribute - public var z: Double? -} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift deleted file mode 100644 index 3b2ecc08..00000000 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DeviceMotionEventInit: BridgedDictionary { - public convenience init(acceleration: DeviceMotionEventAccelerationInit, accelerationIncludingGravity: DeviceMotionEventAccelerationInit, rotationRate: DeviceMotionEventRotationRateInit, interval: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.acceleration] = acceleration.jsValue - object[Strings.accelerationIncludingGravity] = accelerationIncludingGravity.jsValue - object[Strings.rotationRate] = rotationRate.jsValue - object[Strings.interval] = interval.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _acceleration = ReadWriteAttribute(jsObject: object, name: Strings.acceleration) - _accelerationIncludingGravity = ReadWriteAttribute(jsObject: object, name: Strings.accelerationIncludingGravity) - _rotationRate = ReadWriteAttribute(jsObject: object, name: Strings.rotationRate) - _interval = ReadWriteAttribute(jsObject: object, name: Strings.interval) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var acceleration: DeviceMotionEventAccelerationInit - - @ReadWriteAttribute - public var accelerationIncludingGravity: DeviceMotionEventAccelerationInit - - @ReadWriteAttribute - public var rotationRate: DeviceMotionEventRotationRateInit - - @ReadWriteAttribute - public var interval: Double -} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift deleted file mode 100644 index 916ea7a8..00000000 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRate.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DeviceMotionEventRotationRate: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DeviceMotionEventRotationRate].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _alpha = ReadonlyAttribute(jsObject: jsObject, name: Strings.alpha) - _beta = ReadonlyAttribute(jsObject: jsObject, name: Strings.beta) - _gamma = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamma) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var alpha: Double? - - @ReadonlyAttribute - public var beta: Double? - - @ReadonlyAttribute - public var gamma: Double? -} diff --git a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift b/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift deleted file mode 100644 index 780293c8..00000000 --- a/Sources/DOMKit/WebIDL/DeviceMotionEventRotationRateInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DeviceMotionEventRotationRateInit: BridgedDictionary { - public convenience init(alpha: Double?, beta: Double?, gamma: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue - object[Strings.beta] = beta.jsValue - object[Strings.gamma] = gamma.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) - _gamma = ReadWriteAttribute(jsObject: object, name: Strings.gamma) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var alpha: Double? - - @ReadWriteAttribute - public var beta: Double? - - @ReadWriteAttribute - public var gamma: Double? -} diff --git a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift b/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift deleted file mode 100644 index 0bd3d13b..00000000 --- a/Sources/DOMKit/WebIDL/DeviceOrientationEvent.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DeviceOrientationEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DeviceOrientationEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _alpha = ReadonlyAttribute(jsObject: jsObject, name: Strings.alpha) - _beta = ReadonlyAttribute(jsObject: jsObject, name: Strings.beta) - _gamma = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamma) - _absolute = ReadonlyAttribute(jsObject: jsObject, name: Strings.absolute) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: DeviceOrientationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var alpha: Double? - - @ReadonlyAttribute - public var beta: Double? - - @ReadonlyAttribute - public var gamma: Double? - - @ReadonlyAttribute - public var absolute: Bool - - @inlinable public static func requestPermission() -> JSPromise { - let this = constructor - return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func requestPermission() async throws -> PermissionState { - let this = constructor - let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift b/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift deleted file mode 100644 index 3f721de2..00000000 --- a/Sources/DOMKit/WebIDL/DeviceOrientationEventInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DeviceOrientationEventInit: BridgedDictionary { - public convenience init(alpha: Double?, beta: Double?, gamma: Double?, absolute: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue - object[Strings.beta] = beta.jsValue - object[Strings.gamma] = gamma.jsValue - object[Strings.absolute] = absolute.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) - _gamma = ReadWriteAttribute(jsObject: object, name: Strings.gamma) - _absolute = ReadWriteAttribute(jsObject: object, name: Strings.absolute) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var alpha: Double? - - @ReadWriteAttribute - public var beta: Double? - - @ReadWriteAttribute - public var gamma: Double? - - @ReadWriteAttribute - public var absolute: Bool -} diff --git a/Sources/DOMKit/WebIDL/DevicePosture.swift b/Sources/DOMKit/WebIDL/DevicePosture.swift deleted file mode 100644 index 5a318c1b..00000000 --- a/Sources/DOMKit/WebIDL/DevicePosture.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DevicePosture: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DevicePosture].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var type: DevicePostureType - - @ClosureAttribute1Optional - public var onchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/DevicePostureType.swift b/Sources/DOMKit/WebIDL/DevicePostureType.swift deleted file mode 100644 index 2c4effe8..00000000 --- a/Sources/DOMKit/WebIDL/DevicePostureType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum DevicePostureType: JSString, JSValueCompatible { - case continuous = "continuous" - case folded = "folded" - case foldedOver = "folded-over" - - @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/DigitalGoodsService.swift b/Sources/DOMKit/WebIDL/DigitalGoodsService.swift deleted file mode 100644 index d2484704..00000000 --- a/Sources/DOMKit/WebIDL/DigitalGoodsService.swift +++ /dev/null @@ -1,62 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DigitalGoodsService: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.DigitalGoodsService].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func getDetails(itemIds: [String]) -> JSPromise { - let this = jsObject - return this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDetails(itemIds: [String]) async throws -> [ItemDetails] { - let this = jsObject - let _promise: JSPromise = this[Strings.getDetails].function!(this: this, arguments: [itemIds.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func listPurchases() -> JSPromise { - let this = jsObject - return this[Strings.listPurchases].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func listPurchases() async throws -> [PurchaseDetails] { - let this = jsObject - let _promise: JSPromise = this[Strings.listPurchases].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func listPurchaseHistory() -> JSPromise { - let this = jsObject - return this[Strings.listPurchaseHistory].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func listPurchaseHistory() async throws -> [PurchaseDetails] { - let this = jsObject - let _promise: JSPromise = this[Strings.listPurchaseHistory].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func consume(purchaseToken: String) -> JSPromise { - let this = jsObject - return this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func consume(purchaseToken: String) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.consume].function!(this: this, arguments: [purchaseToken.jsValue]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/DirectionSetting.swift b/Sources/DOMKit/WebIDL/DirectionSetting.swift deleted file mode 100644 index 283f3ef9..00000000 --- a/Sources/DOMKit/WebIDL/DirectionSetting.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum DirectionSetting: JSString, JSValueCompatible { - case _empty = "" - case rl = "rl" - case lr = "lr" - - @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/DirectoryPickerOptions.swift b/Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift deleted file mode 100644 index b2afb7e8..00000000 --- a/Sources/DOMKit/WebIDL/DirectoryPickerOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DirectoryPickerOptions: BridgedDictionary { - public convenience init(id: String, startIn: StartInDirectory) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue - object[Strings.startIn] = startIn.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _startIn = ReadWriteAttribute(jsObject: object, name: Strings.startIn) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var id: String - - @ReadWriteAttribute - public var startIn: StartInDirectory -} diff --git a/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift b/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift deleted file mode 100644 index b779a1e0..00000000 --- a/Sources/DOMKit/WebIDL/DisplayCaptureSurfaceType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum DisplayCaptureSurfaceType: JSString, JSValueCompatible { - case monitor = "monitor" - case window = "window" - case application = "application" - case browser = "browser" - - @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/DisplayMediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift deleted file mode 100644 index 94c30908..00000000 --- a/Sources/DOMKit/WebIDL/DisplayMediaStreamConstraints.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DisplayMediaStreamConstraints: BridgedDictionary { - public convenience init(video: Bool_or_MediaTrackConstraints, audio: Bool_or_MediaTrackConstraints) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.video] = video.jsValue - object[Strings.audio] = audio.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _video = ReadWriteAttribute(jsObject: object, name: Strings.video) - _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var video: Bool_or_MediaTrackConstraints - - @ReadWriteAttribute - public var audio: Bool_or_MediaTrackConstraints -} diff --git a/Sources/DOMKit/WebIDL/DistanceModelType.swift b/Sources/DOMKit/WebIDL/DistanceModelType.swift deleted file mode 100644 index 0e2a163d..00000000 --- a/Sources/DOMKit/WebIDL/DistanceModelType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum DistanceModelType: JSString, JSValueCompatible { - case linear = "linear" - case inverse = "inverse" - case exponential = "exponential" - - @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/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 56e4ec76..7f15e6fc 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -3,13 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { +public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Document].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _rootElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootElement) - _namedFlows = ReadonlyAttribute(jsObject: jsObject, name: Strings.namedFlows) - _scrollingElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollingElement) _implementation = ReadonlyAttribute(jsObject: jsObject, name: Strings.implementation) _URL = ReadonlyAttribute(jsObject: jsObject, name: Strings.URL) _documentURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURI) @@ -20,10 +17,6 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode _contentType = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentType) _doctype = ReadonlyAttribute(jsObject: jsObject, name: Strings.doctype) _documentElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentElement) - _fullscreenEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreenEnabled) - _fullscreen = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullscreen) - _onfullscreenchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfullscreenchange) - _onfullscreenerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfullscreenerror) _location = ReadonlyAttribute(jsObject: jsObject, name: Strings.location) _domain = ReadWriteAttribute(jsObject: jsObject, name: Strings.domain) _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) @@ -55,42 +48,11 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode _anchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchors) _applets = ReadonlyAttribute(jsObject: jsObject, name: Strings.applets) _all = ReadonlyAttribute(jsObject: jsObject, name: Strings.all) - _onfreeze = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfreeze) - _onresume = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresume) - _wasDiscarded = ReadonlyAttribute(jsObject: jsObject, name: Strings.wasDiscarded) - _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) - _pictureInPictureEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.pictureInPictureEnabled) - _onpointerlockchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpointerlockchange) - _onpointerlockerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpointerlockerror) - _fragmentDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.fragmentDirective) + _rootElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootElement) _timeline = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeline) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var rootElement: SVGSVGElement? - - @ReadonlyAttribute - public var namedFlows: NamedFlowMap - - @inlinable public func elementFromPoint(x: Double, y: Double) -> Element? { - let this = jsObject - return this[Strings.elementFromPoint].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! - } - - @inlinable public func elementsFromPoint(x: Double, y: Double) -> [Element] { - let this = jsObject - return this[Strings.elementsFromPoint].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! - } - - @inlinable public func caretPositionFromPoint(x: Double, y: Double) -> CaretPosition? { - let this = jsObject - return this[Strings.caretPositionFromPoint].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var scrollingElement: Element? - @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -209,40 +171,6 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode // XXX: member 'createTreeWalker' is ignored - @inlinable public func measureElement(element: Element) -> FontMetrics { - let this = jsObject - return this[Strings.measureElement].function!(this: this, arguments: [element.jsValue]).fromJSValue()! - } - - @inlinable public func measureText(text: String, styleMap: StylePropertyMapReadOnly) -> FontMetrics { - let this = jsObject - return this[Strings.measureText].function!(this: this, arguments: [text.jsValue, styleMap.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var fullscreenEnabled: Bool - - @ReadonlyAttribute - public var fullscreen: Bool - - @inlinable public func exitFullscreen() -> JSPromise { - let this = jsObject - return this[Strings.exitFullscreen].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func exitFullscreen() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.exitFullscreen].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @ClosureAttribute1Optional - public var onfullscreenchange: EventHandler - - @ClosureAttribute1Optional - public var onfullscreenerror: EventHandler - @ReadonlyAttribute public var location: Location? @@ -420,75 +348,8 @@ public class Document: Node, FontFaceSource, GeometryUtils, NonElementParentNode @ReadonlyAttribute public var all: HTMLAllCollection - @ClosureAttribute1Optional - public var onfreeze: EventHandler - - @ClosureAttribute1Optional - public var onresume: EventHandler - - @ReadonlyAttribute - public var wasDiscarded: Bool - - @ReadonlyAttribute - public var permissionsPolicy: PermissionsPolicy - - @ReadonlyAttribute - public var pictureInPictureEnabled: Bool - - @inlinable public func exitPictureInPicture() -> JSPromise { - let this = jsObject - return this[Strings.exitPictureInPicture].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func exitPictureInPicture() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.exitPictureInPicture].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @ClosureAttribute1Optional - public var onpointerlockchange: EventHandler - - @ClosureAttribute1Optional - public var onpointerlockerror: EventHandler - - @inlinable public func exitPointerLock() { - let this = jsObject - _ = this[Strings.exitPointerLock].function!(this: this, arguments: []) - } - @ReadonlyAttribute - public var fragmentDirective: FragmentDirective - - @inlinable public func getSelection() -> Selection? { - let this = jsObject - return this[Strings.getSelection].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func hasStorageAccess() -> JSPromise { - let this = jsObject - return this[Strings.hasStorageAccess].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func hasStorageAccess() async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.hasStorageAccess].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func requestStorageAccess() -> JSPromise { - let this = jsObject - return this[Strings.requestStorageAccess].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestStorageAccess() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.requestStorageAccess].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } + public var rootElement: SVGSVGElement? @ReadonlyAttribute public var timeline: DocumentTimeline diff --git a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index b44070c1..97f66e21 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -12,14 +12,8 @@ public extension DocumentOrShadowRoot { nonmutating set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } } - @inlinable var fullscreenElement: Element? { ReadonlyAttribute[Strings.fullscreenElement, in: jsObject] } - @inlinable var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } - @inlinable var pictureInPictureElement: Element? { ReadonlyAttribute[Strings.pictureInPictureElement, in: jsObject] } - - @inlinable var pointerLockElement: Element? { ReadonlyAttribute[Strings.pointerLockElement, in: jsObject] } - @inlinable func getAnimations() -> [Animation] { let this = jsObject return this[Strings.getAnimations].function!(this: this, arguments: []).fromJSValue()! diff --git a/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift b/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift deleted file mode 100644 index 87526a0d..00000000 --- a/Sources/DOMKit/WebIDL/Document_or_DocumentFragment.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Document_or_DocumentFragment: ConvertibleToJSValue {} -extension Document: Any_Document_or_DocumentFragment {} -extension DocumentFragment: Any_Document_or_DocumentFragment {} - -public enum Document_or_DocumentFragment: JSValueCompatible, Any_Document_or_DocumentFragment { - case document(Document) - case documentFragment(DocumentFragment) - - public static func construct(from value: JSValue) -> Self? { - if let document: Document = value.fromJSValue() { - return .document(document) - } - if let documentFragment: DocumentFragment = value.fromJSValue() { - return .documentFragment(documentFragment) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .document(document): - return document.jsValue - case let .documentFragment(documentFragment): - return documentFragment.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/Document_or_Element.swift b/Sources/DOMKit/WebIDL/Document_or_Element.swift deleted file mode 100644 index ce3b7586..00000000 --- a/Sources/DOMKit/WebIDL/Document_or_Element.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Document_or_Element: ConvertibleToJSValue {} -extension Document: Any_Document_or_Element {} -extension Element: Any_Document_or_Element {} - -public enum Document_or_Element: JSValueCompatible, Any_Document_or_Element { - case document(Document) - case element(Element) - - public static func construct(from value: JSValue) -> Self? { - if let document: Document = value.fromJSValue() { - return .document(document) - } - if let element: Element = value.fromJSValue() { - return .element(element) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .document(document): - return document.jsValue - case let .element(element): - return element.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift b/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift index 0dfeafc7..399e4df1 100644 --- a/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift +++ b/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift @@ -9,14 +9,14 @@ extension XMLHttpRequestBodyInit: Any_Document_or_XMLHttpRequestBodyInit {} public enum Document_or_XMLHttpRequestBodyInit: JSValueCompatible, Any_Document_or_XMLHttpRequestBodyInit { case document(Document) - case xMLHttpRequestBodyInit(XMLHttpRequestBodyInit) + case xmlHttpRequestBodyInit(XMLHttpRequestBodyInit) public static func construct(from value: JSValue) -> Self? { if let document: Document = value.fromJSValue() { return .document(document) } - if let xMLHttpRequestBodyInit: XMLHttpRequestBodyInit = value.fromJSValue() { - return .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit) + if let xmlHttpRequestBodyInit: XMLHttpRequestBodyInit = value.fromJSValue() { + return .xmlHttpRequestBodyInit(xmlHttpRequestBodyInit) } return nil } @@ -25,8 +25,8 @@ public enum Document_or_XMLHttpRequestBodyInit: JSValueCompatible, Any_Document_ switch self { case let .document(document): return document.jsValue - case let .xMLHttpRequestBodyInit(xMLHttpRequestBodyInit): - return xMLHttpRequestBodyInit.jsValue + case let .xmlHttpRequestBodyInit(xmlHttpRequestBodyInit): + return xmlHttpRequestBodyInit.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift b/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift deleted file mode 100644 index e32b94fa..00000000 --- a/Sources/DOMKit/WebIDL/Double_or_EffectTiming.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Double_or_EffectTiming: ConvertibleToJSValue {} -extension Double: Any_Double_or_EffectTiming {} -extension EffectTiming: Any_Double_or_EffectTiming {} - -public enum Double_or_EffectTiming: JSValueCompatible, Any_Double_or_EffectTiming { - case double(Double) - case effectTiming(EffectTiming) - - public static func construct(from value: JSValue) -> Self? { - if let double: Double = value.fromJSValue() { - return .double(double) - } - if let effectTiming: EffectTiming = value.fromJSValue() { - return .effectTiming(effectTiming) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .double(double): - return double.jsValue - case let .effectTiming(effectTiming): - return effectTiming.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift b/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift deleted file mode 100644 index 3c25378d..00000000 --- a/Sources/DOMKit/WebIDL/Double_or_seq_of_Double.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Double_or_seq_of_Double: ConvertibleToJSValue {} -extension Double: Any_Double_or_seq_of_Double {} -extension Array: Any_Double_or_seq_of_Double where Element == Double {} - -public enum Double_or_seq_of_Double: JSValueCompatible, Any_Double_or_seq_of_Double { - case double(Double) - case seq_of_Double([Double]) - - public static func construct(from value: JSValue) -> Self? { - if let double: Double = value.fromJSValue() { - return .double(double) - } - if let seq_of_Double: [Double] = value.fromJSValue() { - return .seq_of_Double(seq_of_Double) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .double(double): - return double.jsValue - case let .seq_of_Double(seq_of_Double): - return seq_of_Double.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift b/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift deleted file mode 100644 index 94232e64..00000000 --- a/Sources/DOMKit/WebIDL/DynamicsCompressorNode.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DynamicsCompressorNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DynamicsCompressorNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _threshold = ReadonlyAttribute(jsObject: jsObject, name: Strings.threshold) - _knee = ReadonlyAttribute(jsObject: jsObject, name: Strings.knee) - _ratio = ReadonlyAttribute(jsObject: jsObject, name: Strings.ratio) - _reduction = ReadonlyAttribute(jsObject: jsObject, name: Strings.reduction) - _attack = ReadonlyAttribute(jsObject: jsObject, name: Strings.attack) - _release = ReadonlyAttribute(jsObject: jsObject, name: Strings.release) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: DynamicsCompressorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var threshold: AudioParam - - @ReadonlyAttribute - public var knee: AudioParam - - @ReadonlyAttribute - public var ratio: AudioParam - - @ReadonlyAttribute - public var reduction: Float - - @ReadonlyAttribute - public var attack: AudioParam - - @ReadonlyAttribute - public var release: AudioParam -} diff --git a/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift b/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift deleted file mode 100644 index 5c630f54..00000000 --- a/Sources/DOMKit/WebIDL/DynamicsCompressorOptions.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class DynamicsCompressorOptions: BridgedDictionary { - public convenience init(attack: Float, knee: Float, ratio: Float, release: Float, threshold: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.attack] = attack.jsValue - object[Strings.knee] = knee.jsValue - object[Strings.ratio] = ratio.jsValue - object[Strings.release] = release.jsValue - object[Strings.threshold] = threshold.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _attack = ReadWriteAttribute(jsObject: object, name: Strings.attack) - _knee = ReadWriteAttribute(jsObject: object, name: Strings.knee) - _ratio = ReadWriteAttribute(jsObject: object, name: Strings.ratio) - _release = ReadWriteAttribute(jsObject: object, name: Strings.release) - _threshold = ReadWriteAttribute(jsObject: object, name: Strings.threshold) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var attack: Float - - @ReadWriteAttribute - public var knee: Float - - @ReadWriteAttribute - public var ratio: Float - - @ReadWriteAttribute - public var release: Float - - @ReadWriteAttribute - public var threshold: Float -} diff --git a/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift b/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift deleted file mode 100644 index d5ac5a2c..00000000 --- a/Sources/DOMKit/WebIDL/EXT_blend_minmax.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_blend_minmax: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_blend_minmax].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let MIN_EXT: GLenum = 0x8007 - - public static let MAX_EXT: GLenum = 0x8008 -} diff --git a/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift b/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift deleted file mode 100644 index f52555be..00000000 --- a/Sources/DOMKit/WebIDL/EXT_clip_cull_distance.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_clip_cull_distance: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_clip_cull_distance].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let MAX_CLIP_DISTANCES_EXT: GLenum = 0x0D32 - - public static let MAX_CULL_DISTANCES_EXT: GLenum = 0x82F9 - - public static let MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT: GLenum = 0x82FA - - public static let CLIP_DISTANCE0_EXT: GLenum = 0x3000 - - public static let CLIP_DISTANCE1_EXT: GLenum = 0x3001 - - public static let CLIP_DISTANCE2_EXT: GLenum = 0x3002 - - public static let CLIP_DISTANCE3_EXT: GLenum = 0x3003 - - public static let CLIP_DISTANCE4_EXT: GLenum = 0x3004 - - public static let CLIP_DISTANCE5_EXT: GLenum = 0x3005 - - public static let CLIP_DISTANCE6_EXT: GLenum = 0x3006 - - public static let CLIP_DISTANCE7_EXT: GLenum = 0x3007 -} diff --git a/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift b/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift deleted file mode 100644 index fa0a6d85..00000000 --- a/Sources/DOMKit/WebIDL/EXT_color_buffer_float.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_color_buffer_float: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_color_buffer_float].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift b/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift deleted file mode 100644 index 84010257..00000000 --- a/Sources/DOMKit/WebIDL/EXT_color_buffer_half_float.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_color_buffer_half_float: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_color_buffer_half_float].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let RGBA16F_EXT: GLenum = 0x881A - - public static let RGB16F_EXT: GLenum = 0x881B - - public static let FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum = 0x8211 - - public static let UNSIGNED_NORMALIZED_EXT: GLenum = 0x8C17 -} diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift deleted file mode 100644 index e75d35ce..00000000 --- a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query.swift +++ /dev/null @@ -1,68 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_disjoint_timer_query: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_disjoint_timer_query].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let QUERY_COUNTER_BITS_EXT: GLenum = 0x8864 - - public static let CURRENT_QUERY_EXT: GLenum = 0x8865 - - public static let QUERY_RESULT_EXT: GLenum = 0x8866 - - public static let QUERY_RESULT_AVAILABLE_EXT: GLenum = 0x8867 - - public static let TIME_ELAPSED_EXT: GLenum = 0x88BF - - public static let TIMESTAMP_EXT: GLenum = 0x8E28 - - public static let GPU_DISJOINT_EXT: GLenum = 0x8FBB - - @inlinable public func createQueryEXT() -> WebGLTimerQueryEXT? { - let this = jsObject - return this[Strings.createQueryEXT].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func deleteQueryEXT(query: WebGLTimerQueryEXT?) { - let this = jsObject - _ = this[Strings.deleteQueryEXT].function!(this: this, arguments: [query.jsValue]) - } - - @inlinable public func isQueryEXT(query: WebGLTimerQueryEXT?) -> Bool { - let this = jsObject - return this[Strings.isQueryEXT].function!(this: this, arguments: [query.jsValue]).fromJSValue()! - } - - @inlinable public func beginQueryEXT(target: GLenum, query: WebGLTimerQueryEXT) { - let this = jsObject - _ = this[Strings.beginQueryEXT].function!(this: this, arguments: [target.jsValue, query.jsValue]) - } - - @inlinable public func endQueryEXT(target: GLenum) { - let this = jsObject - _ = this[Strings.endQueryEXT].function!(this: this, arguments: [target.jsValue]) - } - - @inlinable public func queryCounterEXT(query: WebGLTimerQueryEXT, target: GLenum) { - let this = jsObject - _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue, target.jsValue]) - } - - @inlinable public func getQueryEXT(target: GLenum, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getQueryEXT].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable public func getQueryObjectEXT(query: WebGLTimerQueryEXT, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getQueryObjectEXT].function!(this: this, arguments: [query.jsValue, pname.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift b/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift deleted file mode 100644 index 251ccbc0..00000000 --- a/Sources/DOMKit/WebIDL/EXT_disjoint_timer_query_webgl2.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_disjoint_timer_query_webgl2: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_disjoint_timer_query_webgl2].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let QUERY_COUNTER_BITS_EXT: GLenum = 0x8864 - - public static let TIME_ELAPSED_EXT: GLenum = 0x88BF - - public static let TIMESTAMP_EXT: GLenum = 0x8E28 - - public static let GPU_DISJOINT_EXT: GLenum = 0x8FBB - - @inlinable public func queryCounterEXT(query: WebGLQuery, target: GLenum) { - let this = jsObject - _ = this[Strings.queryCounterEXT].function!(this: this, arguments: [query.jsValue, target.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/EXT_float_blend.swift b/Sources/DOMKit/WebIDL/EXT_float_blend.swift deleted file mode 100644 index e600de77..00000000 --- a/Sources/DOMKit/WebIDL/EXT_float_blend.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_float_blend: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_float_blend].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/EXT_frag_depth.swift b/Sources/DOMKit/WebIDL/EXT_frag_depth.swift deleted file mode 100644 index 8090bc01..00000000 --- a/Sources/DOMKit/WebIDL/EXT_frag_depth.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_frag_depth: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_frag_depth].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/EXT_sRGB.swift b/Sources/DOMKit/WebIDL/EXT_sRGB.swift deleted file mode 100644 index d23f4cfe..00000000 --- a/Sources/DOMKit/WebIDL/EXT_sRGB.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_sRGB: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_sRGB].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let SRGB_EXT: GLenum = 0x8C40 - - public static let SRGB_ALPHA_EXT: GLenum = 0x8C42 - - public static let SRGB8_ALPHA8_EXT: GLenum = 0x8C43 - - public static let FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum = 0x8210 -} diff --git a/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift b/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift deleted file mode 100644 index 2001785e..00000000 --- a/Sources/DOMKit/WebIDL/EXT_shader_texture_lod.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_shader_texture_lod: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_shader_texture_lod].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift b/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift deleted file mode 100644 index d0b81315..00000000 --- a/Sources/DOMKit/WebIDL/EXT_texture_compression_bptc.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_texture_compression_bptc: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_compression_bptc].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COMPRESSED_RGBA_BPTC_UNORM_EXT: GLenum = 0x8E8C - - public static let COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: GLenum = 0x8E8D - - public static let COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: GLenum = 0x8E8E - - public static let COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: GLenum = 0x8E8F -} diff --git a/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift b/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift deleted file mode 100644 index b01c06ba..00000000 --- a/Sources/DOMKit/WebIDL/EXT_texture_compression_rgtc.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_texture_compression_rgtc: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_compression_rgtc].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COMPRESSED_RED_RGTC1_EXT: GLenum = 0x8DBB - - public static let COMPRESSED_SIGNED_RED_RGTC1_EXT: GLenum = 0x8DBC - - public static let COMPRESSED_RED_GREEN_RGTC2_EXT: GLenum = 0x8DBD - - public static let COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GLenum = 0x8DBE -} diff --git a/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift b/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift deleted file mode 100644 index f313993c..00000000 --- a/Sources/DOMKit/WebIDL/EXT_texture_filter_anisotropic.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_texture_filter_anisotropic: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_filter_anisotropic].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let TEXTURE_MAX_ANISOTROPY_EXT: GLenum = 0x84FE - - public static let MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum = 0x84FF -} diff --git a/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift b/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift deleted file mode 100644 index 6b4af7db..00000000 --- a/Sources/DOMKit/WebIDL/EXT_texture_norm16.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EXT_texture_norm16: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EXT_texture_norm16].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let R16_EXT: GLenum = 0x822A - - public static let RG16_EXT: GLenum = 0x822C - - public static let RGB16_EXT: GLenum = 0x8054 - - public static let RGBA16_EXT: GLenum = 0x805B - - public static let R16_SNORM_EXT: GLenum = 0x8F98 - - public static let RG16_SNORM_EXT: GLenum = 0x8F99 - - public static let RGB16_SNORM_EXT: GLenum = 0x8F9A - - public static let RGBA16_SNORM_EXT: GLenum = 0x8F9B -} diff --git a/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift deleted file mode 100644 index bd53de03..00000000 --- a/Sources/DOMKit/WebIDL/EcKeyAlgorithm.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EcKeyAlgorithm: BridgedDictionary { - public convenience init(namedCurve: NamedCurve) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.namedCurve] = namedCurve.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _namedCurve = ReadWriteAttribute(jsObject: object, name: Strings.namedCurve) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var namedCurve: NamedCurve -} diff --git a/Sources/DOMKit/WebIDL/EcKeyGenParams.swift b/Sources/DOMKit/WebIDL/EcKeyGenParams.swift deleted file mode 100644 index d2b2dc4a..00000000 --- a/Sources/DOMKit/WebIDL/EcKeyGenParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EcKeyGenParams: BridgedDictionary { - public convenience init(namedCurve: NamedCurve) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.namedCurve] = namedCurve.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _namedCurve = ReadWriteAttribute(jsObject: object, name: Strings.namedCurve) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var namedCurve: NamedCurve -} diff --git a/Sources/DOMKit/WebIDL/EcKeyImportParams.swift b/Sources/DOMKit/WebIDL/EcKeyImportParams.swift deleted file mode 100644 index 2023a8ae..00000000 --- a/Sources/DOMKit/WebIDL/EcKeyImportParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EcKeyImportParams: BridgedDictionary { - public convenience init(namedCurve: NamedCurve) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.namedCurve] = namedCurve.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _namedCurve = ReadWriteAttribute(jsObject: object, name: Strings.namedCurve) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var namedCurve: NamedCurve -} diff --git a/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift b/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift deleted file mode 100644 index 6afc2b84..00000000 --- a/Sources/DOMKit/WebIDL/EcdhKeyDeriveParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EcdhKeyDeriveParams: BridgedDictionary { - public convenience init(public: CryptoKey) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.public] = `public`.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _public = ReadWriteAttribute(jsObject: object, name: Strings.public) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var `public`: CryptoKey -} diff --git a/Sources/DOMKit/WebIDL/EcdsaParams.swift b/Sources/DOMKit/WebIDL/EcdsaParams.swift deleted file mode 100644 index 46c60d42..00000000 --- a/Sources/DOMKit/WebIDL/EcdsaParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EcdsaParams: BridgedDictionary { - public convenience init(hash: HashAlgorithmIdentifier) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var hash: HashAlgorithmIdentifier -} diff --git a/Sources/DOMKit/WebIDL/Edge.swift b/Sources/DOMKit/WebIDL/Edge.swift deleted file mode 100644 index 1f8283ec..00000000 --- a/Sources/DOMKit/WebIDL/Edge.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum Edge: JSString, JSValueCompatible { - case start = "start" - case end = "end" - - @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/EditContext.swift b/Sources/DOMKit/WebIDL/EditContext.swift deleted file mode 100644 index e0a53697..00000000 --- a/Sources/DOMKit/WebIDL/EditContext.swift +++ /dev/null @@ -1,107 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EditContext: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.EditContext].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _text = ReadonlyAttribute(jsObject: jsObject, name: Strings.text) - _selectionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionStart) - _selectionEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionEnd) - _compositionRangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.compositionRangeStart) - _compositionRangeEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.compositionRangeEnd) - _isInComposition = ReadonlyAttribute(jsObject: jsObject, name: Strings.isInComposition) - _controlBound = ReadonlyAttribute(jsObject: jsObject, name: Strings.controlBound) - _selectionBound = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionBound) - _characterBoundsRangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.characterBoundsRangeStart) - _ontextupdate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontextupdate) - _ontextformatupdate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontextformatupdate) - _oncharacterboundsupdate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncharacterboundsupdate) - _oncompositionstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncompositionstart) - _oncompositionend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncompositionend) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: EditContextInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @inlinable public func updateText(rangeStart: UInt32, rangeEnd: UInt32, text: String) { - let this = jsObject - _ = this[Strings.updateText].function!(this: this, arguments: [rangeStart.jsValue, rangeEnd.jsValue, text.jsValue]) - } - - @inlinable public func updateSelection(start: UInt32, end: UInt32) { - let this = jsObject - _ = this[Strings.updateSelection].function!(this: this, arguments: [start.jsValue, end.jsValue]) - } - - @inlinable public func updateControlBound(controlBound: DOMRect) { - let this = jsObject - _ = this[Strings.updateControlBound].function!(this: this, arguments: [controlBound.jsValue]) - } - - @inlinable public func updateSelectionBound(selectionBound: DOMRect) { - let this = jsObject - _ = this[Strings.updateSelectionBound].function!(this: this, arguments: [selectionBound.jsValue]) - } - - @inlinable public func updateCharacterBounds(rangeStart: UInt32, characterBounds: [DOMRect]) { - let this = jsObject - _ = this[Strings.updateCharacterBounds].function!(this: this, arguments: [rangeStart.jsValue, characterBounds.jsValue]) - } - - @inlinable public func attachedElements() -> [Element] { - let this = jsObject - return this[Strings.attachedElements].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var text: String - - @ReadonlyAttribute - public var selectionStart: UInt32 - - @ReadonlyAttribute - public var selectionEnd: UInt32 - - @ReadonlyAttribute - public var compositionRangeStart: UInt32 - - @ReadonlyAttribute - public var compositionRangeEnd: UInt32 - - @ReadonlyAttribute - public var isInComposition: Bool - - @ReadonlyAttribute - public var controlBound: DOMRect - - @ReadonlyAttribute - public var selectionBound: DOMRect - - @ReadonlyAttribute - public var characterBoundsRangeStart: UInt32 - - @inlinable public func characterBounds() -> [DOMRect] { - let this = jsObject - return this[Strings.characterBounds].function!(this: this, arguments: []).fromJSValue()! - } - - @ClosureAttribute1Optional - public var ontextupdate: EventHandler - - @ClosureAttribute1Optional - public var ontextformatupdate: EventHandler - - @ClosureAttribute1Optional - public var oncharacterboundsupdate: EventHandler - - @ClosureAttribute1Optional - public var oncompositionstart: EventHandler - - @ClosureAttribute1Optional - public var oncompositionend: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/EditContextInit.swift b/Sources/DOMKit/WebIDL/EditContextInit.swift deleted file mode 100644 index 6b7ddaf5..00000000 --- a/Sources/DOMKit/WebIDL/EditContextInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EditContextInit: BridgedDictionary { - public convenience init(text: String, selectionStart: UInt32, selectionEnd: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.text] = text.jsValue - object[Strings.selectionStart] = selectionStart.jsValue - object[Strings.selectionEnd] = selectionEnd.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _text = ReadWriteAttribute(jsObject: object, name: Strings.text) - _selectionStart = ReadWriteAttribute(jsObject: object, name: Strings.selectionStart) - _selectionEnd = ReadWriteAttribute(jsObject: object, name: Strings.selectionEnd) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var text: String - - @ReadWriteAttribute - public var selectionStart: UInt32 - - @ReadWriteAttribute - public var selectionEnd: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/EffectTiming.swift b/Sources/DOMKit/WebIDL/EffectTiming.swift index f9b362fe..af69722e 100644 --- a/Sources/DOMKit/WebIDL/EffectTiming.swift +++ b/Sources/DOMKit/WebIDL/EffectTiming.swift @@ -4,10 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class EffectTiming: BridgedDictionary { - public convenience init(playbackRate: Double, duration: CSSNumericValue_or_Double_or_String, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String) { + public convenience init(delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, direction: PlaybackDirection, easing: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.playbackRate] = playbackRate.jsValue - object[Strings.duration] = duration.jsValue object[Strings.delay] = delay.jsValue object[Strings.endDelay] = endDelay.jsValue object[Strings.fill] = fill.jsValue @@ -19,8 +17,6 @@ public class EffectTiming: BridgedDictionary { } public required init(unsafelyWrapping object: JSObject) { - _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) - _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) _endDelay = ReadWriteAttribute(jsObject: object, name: Strings.endDelay) _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) @@ -31,12 +27,6 @@ public class EffectTiming: BridgedDictionary { super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var playbackRate: Double - - @ReadWriteAttribute - public var duration: CSSNumericValue_or_Double_or_String - @ReadWriteAttribute public var delay: Double diff --git a/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift b/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift deleted file mode 100644 index 488589d3..00000000 --- a/Sources/DOMKit/WebIDL/EffectiveConnectionType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum EffectiveConnectionType: JSString, JSValueCompatible { - case _2g = "2g" - case _3g = "3g" - case _4g = "4g" - case slow2g = "slow-2g" - - @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/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index 16c31aa7..f5cedce7 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -3,20 +3,10 @@ import JavaScriptEventLoop import JavaScriptKit -public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin, Animatable { +public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin, Animatable { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Element].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _outerHTML = ReadWriteAttribute(jsObject: jsObject, name: Strings.outerHTML) - _part = ReadonlyAttribute(jsObject: jsObject, name: Strings.part) - _scrollTop = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollTop) - _scrollLeft = ReadWriteAttribute(jsObject: jsObject, name: Strings.scrollLeft) - _scrollWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollWidth) - _scrollHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollHeight) - _clientTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientTop) - _clientLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientLeft) - _clientWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientWidth) - _clientHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientHeight) _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) _prefix = ReadonlyAttribute(jsObject: jsObject, name: Strings.prefix) _localName = ReadonlyAttribute(jsObject: jsObject, name: Strings.localName) @@ -27,123 +17,14 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc _slot = ReadWriteAttribute(jsObject: jsObject, name: Strings.slot) _attributes = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributes) _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) - _editContext = ReadWriteAttribute(jsObject: jsObject, name: Strings.editContext) - _elementTiming = ReadWriteAttribute(jsObject: jsObject, name: Strings.elementTiming) - _onfullscreenchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfullscreenchange) - _onfullscreenerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfullscreenerror) super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var outerHTML: String - - @inlinable public func insertAdjacentHTML(position: String, text: String) { - let this = jsObject - _ = this[Strings.insertAdjacentHTML].function!(this: this, arguments: [position.jsValue, text.jsValue]) - } - - @inlinable public func getSpatialNavigationContainer() -> Node { - let this = jsObject - return this[Strings.getSpatialNavigationContainer].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func focusableAreas(option: FocusableAreasOption? = nil) -> [Node] { - let this = jsObject - return this[Strings.focusableAreas].function!(this: this, arguments: [option?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func spatialNavigationSearch(dir: SpatialNavigationDirection, options: SpatialNavigationSearchOptions? = nil) -> Node? { - let this = jsObject - return this[Strings.spatialNavigationSearch].function!(this: this, arguments: [dir.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - @inlinable public func pseudo(type: String) -> CSSPseudoElement? { let this = jsObject return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue]).fromJSValue()! } - @ReadonlyAttribute - public var part: DOMTokenList - - @inlinable public func computedStyleMap() -> StylePropertyMapReadOnly { - let this = jsObject - return this[Strings.computedStyleMap].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getClientRects() -> DOMRectList { - let this = jsObject - return this[Strings.getClientRects].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getBoundingClientRect() -> DOMRect { - let this = jsObject - return this[Strings.getBoundingClientRect].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func isVisible(options: IsVisibleOptions? = nil) -> Bool { - let this = jsObject - return this[Strings.isVisible].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func scrollIntoView(arg: Bool_or_ScrollIntoViewOptions? = nil) { - let this = jsObject - _ = this[Strings.scrollIntoView].function!(this: this, arguments: [arg?.jsValue ?? .undefined]) - } - - @inlinable public func scroll(options: ScrollToOptions? = nil) { - let this = jsObject - _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue ?? .undefined]) - } - - @inlinable public func scroll(x: Double, y: Double) { - let this = jsObject - _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } - - @inlinable public func scrollTo(options: ScrollToOptions? = nil) { - let this = jsObject - _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue ?? .undefined]) - } - - @inlinable public func scrollTo(x: Double, y: Double) { - let this = jsObject - _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } - - @inlinable public func scrollBy(options: ScrollToOptions? = nil) { - let this = jsObject - _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue ?? .undefined]) - } - - @inlinable public func scrollBy(x: Double, y: Double) { - let this = jsObject - _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } - - @ReadWriteAttribute - public var scrollTop: Double - - @ReadWriteAttribute - public var scrollLeft: Double - - @ReadonlyAttribute - public var scrollWidth: Int32 - - @ReadonlyAttribute - public var scrollHeight: Int32 - - @ReadonlyAttribute - public var clientTop: Int32 - - @ReadonlyAttribute - public var clientLeft: Int32 - - @ReadonlyAttribute - public var clientWidth: Int32 - - @ReadonlyAttribute - public var clientHeight: Int32 - @ReadonlyAttribute public var namespaceURI: String? @@ -298,53 +179,4 @@ public class Element: Node, InnerHTML, Region, GeometryUtils, ParentNode, NonDoc let this = jsObject _ = this[Strings.insertAdjacentText].function!(this: this, arguments: [`where`.jsValue, data.jsValue]) } - - @ReadWriteAttribute - public var editContext: EditContext? - - @ReadWriteAttribute - public var elementTiming: String - - @inlinable public func requestFullscreen(options: FullscreenOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestFullscreen(options: FullscreenOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.requestFullscreen].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @ClosureAttribute1Optional - public var onfullscreenchange: EventHandler - - @ClosureAttribute1Optional - public var onfullscreenerror: EventHandler - - @inlinable public func setPointerCapture(pointerId: Int32) { - let this = jsObject - _ = this[Strings.setPointerCapture].function!(this: this, arguments: [pointerId.jsValue]) - } - - @inlinable public func releasePointerCapture(pointerId: Int32) { - let this = jsObject - _ = this[Strings.releasePointerCapture].function!(this: this, arguments: [pointerId.jsValue]) - } - - @inlinable public func hasPointerCapture(pointerId: Int32) -> Bool { - let this = jsObject - return this[Strings.hasPointerCapture].function!(this: this, arguments: [pointerId.jsValue]).fromJSValue()! - } - - @inlinable public func requestPointerLock() { - let this = jsObject - _ = this[Strings.requestPointerLock].function!(this: this, arguments: []) - } - - @inlinable public func setHTML(input: String, options: SetHTMLOptions? = nil) { - let this = jsObject - _ = this[Strings.setHTML].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]) - } } diff --git a/Sources/DOMKit/WebIDL/ElementBasedOffset.swift b/Sources/DOMKit/WebIDL/ElementBasedOffset.swift deleted file mode 100644 index 7f548ff7..00000000 --- a/Sources/DOMKit/WebIDL/ElementBasedOffset.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ElementBasedOffset: BridgedDictionary { - public convenience init(target: Element, edge: Edge, threshold: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.target] = target.jsValue - object[Strings.edge] = edge.jsValue - object[Strings.threshold] = threshold.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _target = ReadWriteAttribute(jsObject: object, name: Strings.target) - _edge = ReadWriteAttribute(jsObject: object, name: Strings.edge) - _threshold = ReadWriteAttribute(jsObject: object, name: Strings.threshold) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var target: Element - - @ReadWriteAttribute - public var edge: Edge - - @ReadWriteAttribute - public var threshold: Double -} diff --git a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift index 1efba9c5..bab4ce71 100644 --- a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift +++ b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift @@ -5,7 +5,5 @@ import JavaScriptKit public protocol ElementCSSInlineStyle: JSBridgedClass {} public extension ElementCSSInlineStyle { - @inlinable var attributeStyleMap: StylePropertyMap { ReadonlyAttribute[Strings.attributeStyleMap, in: jsObject] } - @inlinable var style: CSSStyleDeclaration { ReadonlyAttribute[Strings.style, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/ElementContentEditable.swift b/Sources/DOMKit/WebIDL/ElementContentEditable.swift index de4d56ff..8687472c 100644 --- a/Sources/DOMKit/WebIDL/ElementContentEditable.swift +++ b/Sources/DOMKit/WebIDL/ElementContentEditable.swift @@ -21,9 +21,4 @@ public extension ElementContentEditable { get { ReadWriteAttribute[Strings.inputMode, in: jsObject] } nonmutating set { ReadWriteAttribute[Strings.inputMode, in: jsObject] = newValue } } - - @inlinable var virtualKeyboardPolicy: String { - get { ReadWriteAttribute[Strings.virtualKeyboardPolicy, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.virtualKeyboardPolicy, in: jsObject] = newValue } - } } diff --git a/Sources/DOMKit/WebIDL/ElementInternals.swift b/Sources/DOMKit/WebIDL/ElementInternals.swift index c6836670..397bcc09 100644 --- a/Sources/DOMKit/WebIDL/ElementInternals.swift +++ b/Sources/DOMKit/WebIDL/ElementInternals.swift @@ -9,7 +9,6 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _states = ReadonlyAttribute(jsObject: jsObject, name: Strings.states) _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.willValidate) @@ -19,9 +18,6 @@ public class ElementInternals: JSBridgedClass, ARIAMixin { self.jsObject = jsObject } - @ReadonlyAttribute - public var states: CustomStateSet - @ReadonlyAttribute public var shadowRoot: ShadowRoot? diff --git a/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift b/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift index 9ac689a5..17722f48 100644 --- a/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift @@ -9,14 +9,14 @@ extension HTMLCollection: Any_Element_or_HTMLCollection {} public enum Element_or_HTMLCollection: JSValueCompatible, Any_Element_or_HTMLCollection { case element(Element) - case hTMLCollection(HTMLCollection) + case htmlCollection(HTMLCollection) public static func construct(from value: JSValue) -> Self? { if let element: Element = value.fromJSValue() { return .element(element) } - if let hTMLCollection: HTMLCollection = value.fromJSValue() { - return .hTMLCollection(hTMLCollection) + if let htmlCollection: HTMLCollection = value.fromJSValue() { + return .htmlCollection(htmlCollection) } return nil } @@ -25,8 +25,8 @@ public enum Element_or_HTMLCollection: JSValueCompatible, Any_Element_or_HTMLCol switch self { case let .element(element): return element.jsValue - case let .hTMLCollection(hTMLCollection): - return hTMLCollection.jsValue + case let .htmlCollection(htmlCollection): + return htmlCollection.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/EventCounts.swift b/Sources/DOMKit/WebIDL/EventCounts.swift deleted file mode 100644 index f3460b6f..00000000 --- a/Sources/DOMKit/WebIDL/EventCounts.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EventCounts: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EventCounts].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift b/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift deleted file mode 100644 index fae9b923..00000000 --- a/Sources/DOMKit/WebIDL/ExtendableCookieChangeEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ExtendableCookieChangeEventInit: BridgedDictionary { - public convenience init(changed: CookieList, deleted: CookieList) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.changed] = changed.jsValue - object[Strings.deleted] = deleted.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _changed = ReadWriteAttribute(jsObject: object, name: Strings.changed) - _deleted = ReadWriteAttribute(jsObject: object, name: Strings.deleted) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var changed: CookieList - - @ReadWriteAttribute - public var deleted: CookieList -} diff --git a/Sources/DOMKit/WebIDL/EyeDropper.swift b/Sources/DOMKit/WebIDL/EyeDropper.swift deleted file mode 100644 index f99525a5..00000000 --- a/Sources/DOMKit/WebIDL/EyeDropper.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EyeDropper: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EyeDropper].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @inlinable public func open(options: ColorSelectionOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.open].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func open(options: ColorSelectionOptions? = nil) async throws -> ColorSelectionResult { - let this = jsObject - let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/FaceDetector.swift b/Sources/DOMKit/WebIDL/FaceDetector.swift deleted file mode 100644 index f34f8b94..00000000 --- a/Sources/DOMKit/WebIDL/FaceDetector.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FaceDetector: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FaceDetector].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(faceDetectorOptions: FaceDetectorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [faceDetectorOptions?.jsValue ?? .undefined])) - } - - @inlinable public func detect(image: ImageBitmapSource) -> JSPromise { - let this = jsObject - return this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func detect(image: ImageBitmapSource) async throws -> [DetectedFace] { - let this = jsObject - let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift b/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift deleted file mode 100644 index 45173313..00000000 --- a/Sources/DOMKit/WebIDL/FaceDetectorOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FaceDetectorOptions: BridgedDictionary { - public convenience init(maxDetectedFaces: UInt16, fastMode: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.maxDetectedFaces] = maxDetectedFaces.jsValue - object[Strings.fastMode] = fastMode.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _maxDetectedFaces = ReadWriteAttribute(jsObject: object, name: Strings.maxDetectedFaces) - _fastMode = ReadWriteAttribute(jsObject: object, name: Strings.fastMode) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var maxDetectedFaces: UInt16 - - @ReadWriteAttribute - public var fastMode: Bool -} diff --git a/Sources/DOMKit/WebIDL/FederatedCredential.swift b/Sources/DOMKit/WebIDL/FederatedCredential.swift deleted file mode 100644 index 7a461d5f..00000000 --- a/Sources/DOMKit/WebIDL/FederatedCredential.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FederatedCredential: Credential, CredentialUserData { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FederatedCredential].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _provider = ReadonlyAttribute(jsObject: jsObject, name: Strings.provider) - _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(data: FederatedCredentialInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue])) - } - - @ReadonlyAttribute - public var provider: String - - @ReadonlyAttribute - public var `protocol`: String? -} diff --git a/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift b/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift deleted file mode 100644 index 0d499563..00000000 --- a/Sources/DOMKit/WebIDL/FederatedCredentialInit.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FederatedCredentialInit: BridgedDictionary { - public convenience init(name: String, iconURL: String, origin: String, provider: String, protocol: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.iconURL] = iconURL.jsValue - object[Strings.origin] = origin.jsValue - object[Strings.provider] = provider.jsValue - object[Strings.protocol] = `protocol`.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _iconURL = ReadWriteAttribute(jsObject: object, name: Strings.iconURL) - _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) - _provider = ReadWriteAttribute(jsObject: object, name: Strings.provider) - _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var iconURL: String - - @ReadWriteAttribute - public var origin: String - - @ReadWriteAttribute - public var provider: String - - @ReadWriteAttribute - public var `protocol`: String -} diff --git a/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift deleted file mode 100644 index ca7bc534..00000000 --- a/Sources/DOMKit/WebIDL/FederatedCredentialRequestOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FederatedCredentialRequestOptions: BridgedDictionary { - public convenience init(providers: [String], protocols: [String]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.providers] = providers.jsValue - object[Strings.protocols] = protocols.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _providers = ReadWriteAttribute(jsObject: object, name: Strings.providers) - _protocols = ReadWriteAttribute(jsObject: object, name: Strings.protocols) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var providers: [String] - - @ReadWriteAttribute - public var protocols: [String] -} diff --git a/Sources/DOMKit/WebIDL/FetchPriority.swift b/Sources/DOMKit/WebIDL/FetchPriority.swift deleted file mode 100644 index c20e2379..00000000 --- a/Sources/DOMKit/WebIDL/FetchPriority.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum FetchPriority: JSString, JSValueCompatible { - case high = "high" - case low = "low" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/File.swift b/Sources/DOMKit/WebIDL/File.swift index 5ea408cc..7489440b 100644 --- a/Sources/DOMKit/WebIDL/File.swift +++ b/Sources/DOMKit/WebIDL/File.swift @@ -9,7 +9,6 @@ public class File: Blob { public required init(unsafelyWrapping jsObject: JSObject) { _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) _lastModified = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastModified) - _webkitRelativePath = ReadonlyAttribute(jsObject: jsObject, name: Strings.webkitRelativePath) super.init(unsafelyWrapping: jsObject) } @@ -22,7 +21,4 @@ public class File: Blob { @ReadonlyAttribute public var lastModified: Int64 - - @ReadonlyAttribute - public var webkitRelativePath: String } diff --git a/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift b/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift deleted file mode 100644 index fb799a61..00000000 --- a/Sources/DOMKit/WebIDL/FilePickerAcceptType.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FilePickerAcceptType: BridgedDictionary { - public convenience init(description: String, accept: [String: String_or_seq_of_String]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.description] = description.jsValue - object[Strings.accept] = accept.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _description = ReadWriteAttribute(jsObject: object, name: Strings.description) - _accept = ReadWriteAttribute(jsObject: object, name: Strings.accept) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var description: String - - @ReadWriteAttribute - public var accept: [String: String_or_seq_of_String] -} diff --git a/Sources/DOMKit/WebIDL/FilePickerOptions.swift b/Sources/DOMKit/WebIDL/FilePickerOptions.swift deleted file mode 100644 index d7e6420a..00000000 --- a/Sources/DOMKit/WebIDL/FilePickerOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FilePickerOptions: BridgedDictionary { - public convenience init(types: [FilePickerAcceptType], excludeAcceptAllOption: Bool, id: String, startIn: StartInDirectory) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.types] = types.jsValue - object[Strings.excludeAcceptAllOption] = excludeAcceptAllOption.jsValue - object[Strings.id] = id.jsValue - object[Strings.startIn] = startIn.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _types = ReadWriteAttribute(jsObject: object, name: Strings.types) - _excludeAcceptAllOption = ReadWriteAttribute(jsObject: object, name: Strings.excludeAcceptAllOption) - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _startIn = ReadWriteAttribute(jsObject: object, name: Strings.startIn) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var types: [FilePickerAcceptType] - - @ReadWriteAttribute - public var excludeAcceptAllOption: Bool - - @ReadWriteAttribute - public var id: String - - @ReadWriteAttribute - public var startIn: StartInDirectory -} diff --git a/Sources/DOMKit/WebIDL/FileSystem.swift b/Sources/DOMKit/WebIDL/FileSystem.swift deleted file mode 100644 index b5190fad..00000000 --- a/Sources/DOMKit/WebIDL/FileSystem.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystem: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileSystem].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _root = ReadonlyAttribute(jsObject: jsObject, name: Strings.root) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var root: FileSystemDirectoryEntry -} diff --git a/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift b/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift deleted file mode 100644 index 2a88329c..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemCreateWritableOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemCreateWritableOptions: BridgedDictionary { - public convenience init(keepExistingData: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keepExistingData] = keepExistingData.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _keepExistingData = ReadWriteAttribute(jsObject: object, name: Strings.keepExistingData) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var keepExistingData: Bool -} diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift deleted file mode 100644 index b3d1fa64..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryEntry.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemDirectoryEntry: FileSystemEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryEntry].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func createReader() -> FileSystemDirectoryReader { - let this = jsObject - return this[Strings.createReader].function!(this: this, arguments: []).fromJSValue()! - } - - // XXX: member 'getFile' is ignored - - // XXX: member 'getDirectory' is ignored -} diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift deleted file mode 100644 index be23cb3a..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryHandle.swift +++ /dev/null @@ -1,66 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemDirectoryHandle: FileSystemHandle, AsyncSequence { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryHandle].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - public typealias Element = String - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - public func makeAsyncIterator() -> ValueIterableAsyncIterator { - ValueIterableAsyncIterator(sequence: self) - } - - @inlinable public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getFileHandle(name: String, options: FileSystemGetFileOptions? = nil) async throws -> FileSystemFileHandle { - let this = jsObject - let _promise: JSPromise = this[Strings.getFileHandle].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDirectoryHandle(name: String, options: FileSystemGetDirectoryOptions? = nil) async throws -> FileSystemDirectoryHandle { - let this = jsObject - let _promise: JSPromise = this[Strings.getDirectoryHandle].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func removeEntry(name: String, options: FileSystemRemoveOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.removeEntry].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func resolve(possibleDescendant: FileSystemHandle) -> JSPromise { - let this = jsObject - return this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func resolve(possibleDescendant: FileSystemHandle) async throws -> [String]? { - let this = jsObject - let _promise: JSPromise = this[Strings.resolve].function!(this: this, arguments: [possibleDescendant.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift b/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift deleted file mode 100644 index 5c9d1450..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemDirectoryReader.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemDirectoryReader: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileSystemDirectoryReader].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: member 'readEntries' is ignored -} diff --git a/Sources/DOMKit/WebIDL/FileSystemEntry.swift b/Sources/DOMKit/WebIDL/FileSystemEntry.swift deleted file mode 100644 index 2abb672a..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemEntry.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemEntry: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileSystemEntry].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _isFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFile) - _isDirectory = ReadonlyAttribute(jsObject: jsObject, name: Strings.isDirectory) - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _fullPath = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullPath) - _filesystem = ReadonlyAttribute(jsObject: jsObject, name: Strings.filesystem) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var isFile: Bool - - @ReadonlyAttribute - public var isDirectory: Bool - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var fullPath: String - - @ReadonlyAttribute - public var filesystem: FileSystem - - // XXX: member 'getParent' is ignored -} diff --git a/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift b/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift deleted file mode 100644 index 207615ac..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemFileEntry.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemFileEntry: FileSystemEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemFileEntry].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - // XXX: member 'file' is ignored -} diff --git a/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift b/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift deleted file mode 100644 index cc5fa35c..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemFileHandle.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemFileHandle: FileSystemHandle { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemFileHandle].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func getFile() -> JSPromise { - let this = jsObject - return this[Strings.getFile].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getFile() async throws -> File { - let this = jsObject - let _promise: JSPromise = this[Strings.getFile].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func createWritable(options: FileSystemCreateWritableOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func createWritable(options: FileSystemCreateWritableOptions? = nil) async throws -> FileSystemWritableFileStream { - let this = jsObject - let _promise: JSPromise = this[Strings.createWritable].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/FileSystemFlags.swift b/Sources/DOMKit/WebIDL/FileSystemFlags.swift deleted file mode 100644 index 99f05c9e..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemFlags.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemFlags: BridgedDictionary { - public convenience init(create: Bool, exclusive: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.create] = create.jsValue - object[Strings.exclusive] = exclusive.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _create = ReadWriteAttribute(jsObject: object, name: Strings.create) - _exclusive = ReadWriteAttribute(jsObject: object, name: Strings.exclusive) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var create: Bool - - @ReadWriteAttribute - public var exclusive: Bool -} diff --git a/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift b/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift deleted file mode 100644 index 6264bdfd..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemGetDirectoryOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemGetDirectoryOptions: BridgedDictionary { - public convenience init(create: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.create] = create.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _create = ReadWriteAttribute(jsObject: object, name: Strings.create) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var create: Bool -} diff --git a/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift b/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift deleted file mode 100644 index 05b088e5..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemGetFileOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemGetFileOptions: BridgedDictionary { - public convenience init(create: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.create] = create.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _create = ReadWriteAttribute(jsObject: object, name: Strings.create) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var create: Bool -} diff --git a/Sources/DOMKit/WebIDL/FileSystemHandle.swift b/Sources/DOMKit/WebIDL/FileSystemHandle.swift deleted file mode 100644 index 508012c9..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemHandle.swift +++ /dev/null @@ -1,58 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemHandle: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FileSystemHandle].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var kind: FileSystemHandleKind - - @ReadonlyAttribute - public var name: String - - @inlinable public func isSameEntry(other: FileSystemHandle) -> JSPromise { - let this = jsObject - return this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func isSameEntry(other: FileSystemHandle) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.isSameEntry].function!(this: this, arguments: [other.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { - let this = jsObject - return this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func queryPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { - let this = jsObject - let _promise: JSPromise = this[Strings.queryPermission].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestPermission(descriptor: FileSystemHandlePermissionDescriptor? = nil) async throws -> PermissionState { - let this = jsObject - let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift b/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift deleted file mode 100644 index d5834819..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemHandleKind.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum FileSystemHandleKind: JSString, JSValueCompatible { - case file = "file" - case directory = "directory" - - @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/FileSystemHandlePermissionDescriptor.swift b/Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift deleted file mode 100644 index 64b5aa8c..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemHandlePermissionDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemHandlePermissionDescriptor: BridgedDictionary { - public convenience init(mode: FileSystemPermissionMode) { - 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: FileSystemPermissionMode -} diff --git a/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift deleted file mode 100644 index 2f77ba74..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemPermissionDescriptor.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemPermissionDescriptor: BridgedDictionary { - public convenience init(handle: FileSystemHandle, mode: FileSystemPermissionMode) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.handle] = handle.jsValue - object[Strings.mode] = mode.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _handle = ReadWriteAttribute(jsObject: object, name: Strings.handle) - _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var handle: FileSystemHandle - - @ReadWriteAttribute - public var mode: FileSystemPermissionMode -} diff --git a/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift b/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift deleted file mode 100644 index 005320a1..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemPermissionMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum FileSystemPermissionMode: JSString, JSValueCompatible { - case read = "read" - case readwrite = "readwrite" - - @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/FileSystemRemoveOptions.swift b/Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift deleted file mode 100644 index 2ebccb04..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemRemoveOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemRemoveOptions: BridgedDictionary { - public convenience init(recursive: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.recursive] = recursive.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _recursive = ReadWriteAttribute(jsObject: object, name: Strings.recursive) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var recursive: Bool -} diff --git a/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift b/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift deleted file mode 100644 index 7aa5f030..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemWritableFileStream.swift +++ /dev/null @@ -1,48 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FileSystemWritableFileStream: WritableStream { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FileSystemWritableFileStream].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func write(data: FileSystemWriteChunkType) -> JSPromise { - let this = jsObject - return this[Strings.write].function!(this: this, arguments: [data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func write(data: FileSystemWriteChunkType) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [data.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func seek(position: UInt64) -> JSPromise { - let this = jsObject - return this[Strings.seek].function!(this: this, arguments: [position.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func seek(position: UInt64) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.seek].function!(this: this, arguments: [position.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func truncate(size: UInt64) -> JSPromise { - let this = jsObject - return this[Strings.truncate].function!(this: this, arguments: [size.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func truncate(size: UInt64) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.truncate].function!(this: this, arguments: [size.jsValue]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift b/Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift deleted file mode 100644 index ccec41b9..00000000 --- a/Sources/DOMKit/WebIDL/FileSystemWriteChunkType.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_FileSystemWriteChunkType: ConvertibleToJSValue {} -extension Blob: Any_FileSystemWriteChunkType {} -extension BufferSource: Any_FileSystemWriteChunkType {} -extension String: Any_FileSystemWriteChunkType {} -extension WriteParams: Any_FileSystemWriteChunkType {} - -public enum FileSystemWriteChunkType: JSValueCompatible, Any_FileSystemWriteChunkType { - case blob(Blob) - case bufferSource(BufferSource) - case string(String) - case writeParams(WriteParams) - - public static func construct(from value: JSValue) -> Self? { - if let blob: Blob = value.fromJSValue() { - return .blob(blob) - } - if let bufferSource: BufferSource = value.fromJSValue() { - return .bufferSource(bufferSource) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - if let writeParams: WriteParams = value.fromJSValue() { - return .writeParams(writeParams) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .blob(blob): - return blob.jsValue - case let .bufferSource(bufferSource): - return bufferSource.jsValue - case let .string(string): - return string.jsValue - case let .writeParams(writeParams): - return writeParams.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/FillLightMode.swift b/Sources/DOMKit/WebIDL/FillLightMode.swift deleted file mode 100644 index 1e16ed84..00000000 --- a/Sources/DOMKit/WebIDL/FillLightMode.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum FillLightMode: JSString, JSValueCompatible { - case auto = "auto" - case off = "off" - case flash = "flash" - - @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/Float32List.swift b/Sources/DOMKit/WebIDL/Float32List.swift deleted file mode 100644 index 3dd8cf37..00000000 --- a/Sources/DOMKit/WebIDL/Float32List.swift +++ /dev/null @@ -1,32 +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]) - - 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/FlowControlType.swift b/Sources/DOMKit/WebIDL/FlowControlType.swift deleted file mode 100644 index 9d9bb94c..00000000 --- a/Sources/DOMKit/WebIDL/FlowControlType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum FlowControlType: JSString, JSValueCompatible { - case none = "none" - case hardware = "hardware" - - @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/FocusableAreaSearchMode.swift b/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift deleted file mode 100644 index 0ba11437..00000000 --- a/Sources/DOMKit/WebIDL/FocusableAreaSearchMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum FocusableAreaSearchMode: JSString, JSValueCompatible { - case visible = "visible" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/FocusableAreasOption.swift b/Sources/DOMKit/WebIDL/FocusableAreasOption.swift deleted file mode 100644 index 572e8097..00000000 --- a/Sources/DOMKit/WebIDL/FocusableAreasOption.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FocusableAreasOption: BridgedDictionary { - public convenience init(mode: FocusableAreaSearchMode) { - 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: FocusableAreaSearchMode -} diff --git a/Sources/DOMKit/WebIDL/Font.swift b/Sources/DOMKit/WebIDL/Font.swift deleted file mode 100644 index c2ed5c89..00000000 --- a/Sources/DOMKit/WebIDL/Font.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Font: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Font].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _glyphsRendered = ReadonlyAttribute(jsObject: jsObject, name: Strings.glyphsRendered) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var glyphsRendered: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/FontFace.swift b/Sources/DOMKit/WebIDL/FontFace.swift deleted file mode 100644 index cc9e63c2..00000000 --- a/Sources/DOMKit/WebIDL/FontFace.swift +++ /dev/null @@ -1,98 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFace: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFace].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _family = ReadWriteAttribute(jsObject: jsObject, name: Strings.family) - _style = ReadWriteAttribute(jsObject: jsObject, name: Strings.style) - _weight = ReadWriteAttribute(jsObject: jsObject, name: Strings.weight) - _stretch = ReadWriteAttribute(jsObject: jsObject, name: Strings.stretch) - _unicodeRange = ReadWriteAttribute(jsObject: jsObject, name: Strings.unicodeRange) - _variant = ReadWriteAttribute(jsObject: jsObject, name: Strings.variant) - _featureSettings = ReadWriteAttribute(jsObject: jsObject, name: Strings.featureSettings) - _variationSettings = ReadWriteAttribute(jsObject: jsObject, name: Strings.variationSettings) - _display = ReadWriteAttribute(jsObject: jsObject, name: Strings.display) - _ascentOverride = ReadWriteAttribute(jsObject: jsObject, name: Strings.ascentOverride) - _descentOverride = ReadWriteAttribute(jsObject: jsObject, name: Strings.descentOverride) - _lineGapOverride = ReadWriteAttribute(jsObject: jsObject, name: Strings.lineGapOverride) - _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) - _loaded = ReadonlyAttribute(jsObject: jsObject, name: Strings.loaded) - _features = ReadonlyAttribute(jsObject: jsObject, name: Strings.features) - _variations = ReadonlyAttribute(jsObject: jsObject, name: Strings.variations) - _palettes = ReadonlyAttribute(jsObject: jsObject, name: Strings.palettes) - self.jsObject = jsObject - } - - @inlinable public convenience init(family: String, source: BinaryData_or_String, descriptors: FontFaceDescriptors? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [family.jsValue, source.jsValue, descriptors?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var family: String - - @ReadWriteAttribute - public var style: String - - @ReadWriteAttribute - public var weight: String - - @ReadWriteAttribute - public var stretch: String - - @ReadWriteAttribute - public var unicodeRange: String - - @ReadWriteAttribute - public var variant: String - - @ReadWriteAttribute - public var featureSettings: String - - @ReadWriteAttribute - public var variationSettings: String - - @ReadWriteAttribute - public var display: String - - @ReadWriteAttribute - public var ascentOverride: String - - @ReadWriteAttribute - public var descentOverride: String - - @ReadWriteAttribute - public var lineGapOverride: String - - @ReadonlyAttribute - public var status: FontFaceLoadStatus - - @inlinable public func load() -> JSPromise { - let this = jsObject - return this[Strings.load].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func load() async throws -> FontFace { - let this = jsObject - let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var loaded: JSPromise - - @ReadonlyAttribute - public var features: FontFaceFeatures - - @ReadonlyAttribute - public var variations: FontFaceVariations - - @ReadonlyAttribute - public var palettes: FontFacePalettes -} diff --git a/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift b/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift deleted file mode 100644 index 61b9bbe5..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceDescriptors.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFaceDescriptors: BridgedDictionary { - public convenience init(style: String, weight: String, stretch: String, unicodeRange: String, variant: String, featureSettings: String, variationSettings: String, display: String, ascentOverride: String, descentOverride: String, lineGapOverride: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.style] = style.jsValue - object[Strings.weight] = weight.jsValue - object[Strings.stretch] = stretch.jsValue - object[Strings.unicodeRange] = unicodeRange.jsValue - object[Strings.variant] = variant.jsValue - object[Strings.featureSettings] = featureSettings.jsValue - object[Strings.variationSettings] = variationSettings.jsValue - object[Strings.display] = display.jsValue - object[Strings.ascentOverride] = ascentOverride.jsValue - object[Strings.descentOverride] = descentOverride.jsValue - object[Strings.lineGapOverride] = lineGapOverride.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _style = ReadWriteAttribute(jsObject: object, name: Strings.style) - _weight = ReadWriteAttribute(jsObject: object, name: Strings.weight) - _stretch = ReadWriteAttribute(jsObject: object, name: Strings.stretch) - _unicodeRange = ReadWriteAttribute(jsObject: object, name: Strings.unicodeRange) - _variant = ReadWriteAttribute(jsObject: object, name: Strings.variant) - _featureSettings = ReadWriteAttribute(jsObject: object, name: Strings.featureSettings) - _variationSettings = ReadWriteAttribute(jsObject: object, name: Strings.variationSettings) - _display = ReadWriteAttribute(jsObject: object, name: Strings.display) - _ascentOverride = ReadWriteAttribute(jsObject: object, name: Strings.ascentOverride) - _descentOverride = ReadWriteAttribute(jsObject: object, name: Strings.descentOverride) - _lineGapOverride = ReadWriteAttribute(jsObject: object, name: Strings.lineGapOverride) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var style: String - - @ReadWriteAttribute - public var weight: String - - @ReadWriteAttribute - public var stretch: String - - @ReadWriteAttribute - public var unicodeRange: String - - @ReadWriteAttribute - public var variant: String - - @ReadWriteAttribute - public var featureSettings: String - - @ReadWriteAttribute - public var variationSettings: String - - @ReadWriteAttribute - public var display: String - - @ReadWriteAttribute - public var ascentOverride: String - - @ReadWriteAttribute - public var descentOverride: String - - @ReadWriteAttribute - public var lineGapOverride: String -} diff --git a/Sources/DOMKit/WebIDL/FontFaceFeatures.swift b/Sources/DOMKit/WebIDL/FontFaceFeatures.swift deleted file mode 100644 index 6f11335d..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceFeatures.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFaceFeatures: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFaceFeatures].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift b/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift deleted file mode 100644 index 49b857eb..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceLoadStatus.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum FontFaceLoadStatus: JSString, JSValueCompatible { - case unloaded = "unloaded" - case loading = "loading" - case loaded = "loaded" - case error = "error" - - @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/FontFacePalette.swift b/Sources/DOMKit/WebIDL/FontFacePalette.swift deleted file mode 100644 index 5296ef30..00000000 --- a/Sources/DOMKit/WebIDL/FontFacePalette.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFacePalette: JSBridgedClass, Sequence { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFacePalette].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _usableWithLightBackground = ReadonlyAttribute(jsObject: jsObject, name: Strings.usableWithLightBackground) - _usableWithDarkBackground = ReadonlyAttribute(jsObject: jsObject, name: Strings.usableWithDarkBackground) - self.jsObject = jsObject - } - - public typealias Element = String - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) - } - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> String { - jsObject[key].fromJSValue()! - } - - @ReadonlyAttribute - public var usableWithLightBackground: Bool - - @ReadonlyAttribute - public var usableWithDarkBackground: Bool -} diff --git a/Sources/DOMKit/WebIDL/FontFacePalettes.swift b/Sources/DOMKit/WebIDL/FontFacePalettes.swift deleted file mode 100644 index 26e5db76..00000000 --- a/Sources/DOMKit/WebIDL/FontFacePalettes.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFacePalettes: JSBridgedClass, Sequence { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFacePalettes].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - self.jsObject = jsObject - } - - public typealias Element = FontFacePalette - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) - } - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> FontFacePalette { - jsObject[key].fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/FontFaceSet.swift b/Sources/DOMKit/WebIDL/FontFaceSet.swift deleted file mode 100644 index 3b90b43a..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceSet.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFaceSet: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FontFaceSet].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onloading = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloading) - _onloadingdone = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloadingdone) - _onloadingerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onloadingerror) - _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) - _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(initialFaces: [FontFace]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [initialFaces.jsValue])) - } - - // XXX: make me Set-like! - - @inlinable public func add(font: FontFace) -> Self { - let this = jsObject - return this[Strings.add].function!(this: this, arguments: [font.jsValue]).fromJSValue()! - } - - @inlinable public func delete(font: FontFace) -> Bool { - let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [font.jsValue]).fromJSValue()! - } - - @inlinable public func clear() { - let this = jsObject - _ = this[Strings.clear].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var onloading: EventHandler - - @ClosureAttribute1Optional - public var onloadingdone: EventHandler - - @ClosureAttribute1Optional - public var onloadingerror: EventHandler - - @inlinable public func load(font: String, text: String? = nil) -> JSPromise { - let this = jsObject - return this[Strings.load].function!(this: this, arguments: [font.jsValue, text?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func load(font: String, text: String? = nil) async throws -> [FontFace] { - let this = jsObject - let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [font.jsValue, text?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func check(font: String, text: String? = nil) -> Bool { - let this = jsObject - return this[Strings.check].function!(this: this, arguments: [font.jsValue, text?.jsValue ?? .undefined]).fromJSValue()! - } - - @ReadonlyAttribute - public var ready: JSPromise - - @ReadonlyAttribute - public var status: FontFaceSetLoadStatus -} diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift deleted file mode 100644 index 6f04df9e..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceSetLoadEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFaceSetLoadEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.FontFaceSetLoadEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _fontfaces = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontfaces) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: FontFaceSetLoadEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var fontfaces: [FontFace] -} diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift deleted file mode 100644 index df00ac10..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceSetLoadEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFaceSetLoadEventInit: BridgedDictionary { - public convenience init(fontfaces: [FontFace]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fontfaces] = fontfaces.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _fontfaces = ReadWriteAttribute(jsObject: object, name: Strings.fontfaces) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var fontfaces: [FontFace] -} diff --git a/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift b/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift deleted file mode 100644 index 56e08f4b..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceSetLoadStatus.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum FontFaceSetLoadStatus: JSString, JSValueCompatible { - case loading = "loading" - case loaded = "loaded" - - @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/FontFaceSource.swift b/Sources/DOMKit/WebIDL/FontFaceSource.swift deleted file mode 100644 index 407069d1..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceSource.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol FontFaceSource: JSBridgedClass {} -public extension FontFaceSource { - @inlinable var fonts: FontFaceSet { ReadonlyAttribute[Strings.fonts, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift b/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift deleted file mode 100644 index 4a2ca1ee..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceVariationAxis.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFaceVariationAxis: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFaceVariationAxis].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _axisTag = ReadonlyAttribute(jsObject: jsObject, name: Strings.axisTag) - _minimumValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.minimumValue) - _maximumValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.maximumValue) - _defaultValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.defaultValue) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var axisTag: String - - @ReadonlyAttribute - public var minimumValue: Double - - @ReadonlyAttribute - public var maximumValue: Double - - @ReadonlyAttribute - public var defaultValue: Double -} diff --git a/Sources/DOMKit/WebIDL/FontFaceVariations.swift b/Sources/DOMKit/WebIDL/FontFaceVariations.swift deleted file mode 100644 index 205f9552..00000000 --- a/Sources/DOMKit/WebIDL/FontFaceVariations.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontFaceVariations: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontFaceVariations].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Set-like! -} diff --git a/Sources/DOMKit/WebIDL/FontManager.swift b/Sources/DOMKit/WebIDL/FontManager.swift deleted file mode 100644 index 2fbe9b2f..00000000 --- a/Sources/DOMKit/WebIDL/FontManager.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func query(options: QueryOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.query].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func query(options: QueryOptions? = nil) async throws -> [FontMetadata] { - let this = jsObject - let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/FontMetadata.swift b/Sources/DOMKit/WebIDL/FontMetadata.swift deleted file mode 100644 index 1c49d82c..00000000 --- a/Sources/DOMKit/WebIDL/FontMetadata.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontMetadata: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontMetadata].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _postscriptName = ReadonlyAttribute(jsObject: jsObject, name: Strings.postscriptName) - _fullName = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullName) - _family = ReadonlyAttribute(jsObject: jsObject, name: Strings.family) - _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - self.jsObject = jsObject - } - - @inlinable public func blob() -> JSPromise { - let this = jsObject - return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func blob() async throws -> Blob { - let this = jsObject - let _promise: JSPromise = this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var postscriptName: String - - @ReadonlyAttribute - public var fullName: String - - @ReadonlyAttribute - public var family: String - - @ReadonlyAttribute - public var style: String -} diff --git a/Sources/DOMKit/WebIDL/FontMetrics.swift b/Sources/DOMKit/WebIDL/FontMetrics.swift deleted file mode 100644 index 596f6abe..00000000 --- a/Sources/DOMKit/WebIDL/FontMetrics.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FontMetrics: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FontMetrics].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _advances = ReadonlyAttribute(jsObject: jsObject, name: Strings.advances) - _boundingBoxLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingBoxLeft) - _boundingBoxRight = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingBoxRight) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _emHeightAscent = ReadonlyAttribute(jsObject: jsObject, name: Strings.emHeightAscent) - _emHeightDescent = ReadonlyAttribute(jsObject: jsObject, name: Strings.emHeightDescent) - _boundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingBoxAscent) - _boundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingBoxDescent) - _fontBoundingBoxAscent = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontBoundingBoxAscent) - _fontBoundingBoxDescent = ReadonlyAttribute(jsObject: jsObject, name: Strings.fontBoundingBoxDescent) - _dominantBaseline = ReadonlyAttribute(jsObject: jsObject, name: Strings.dominantBaseline) - _baselines = ReadonlyAttribute(jsObject: jsObject, name: Strings.baselines) - _fonts = ReadonlyAttribute(jsObject: jsObject, name: Strings.fonts) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var width: Double - - @ReadonlyAttribute - public var advances: [Double] - - @ReadonlyAttribute - public var boundingBoxLeft: Double - - @ReadonlyAttribute - public var boundingBoxRight: Double - - @ReadonlyAttribute - public var height: Double - - @ReadonlyAttribute - public var emHeightAscent: Double - - @ReadonlyAttribute - public var emHeightDescent: Double - - @ReadonlyAttribute - public var boundingBoxAscent: Double - - @ReadonlyAttribute - public var boundingBoxDescent: Double - - @ReadonlyAttribute - public var fontBoundingBoxAscent: Double - - @ReadonlyAttribute - public var fontBoundingBoxDescent: Double - - @ReadonlyAttribute - public var dominantBaseline: Baseline - - @ReadonlyAttribute - public var baselines: [Baseline] - - @ReadonlyAttribute - public var fonts: [Font] -} diff --git a/Sources/DOMKit/WebIDL/FragmentDirective.swift b/Sources/DOMKit/WebIDL/FragmentDirective.swift deleted file mode 100644 index 0d1f537b..00000000 --- a/Sources/DOMKit/WebIDL/FragmentDirective.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FragmentDirective: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.FragmentDirective].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift b/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift deleted file mode 100644 index 3eb14746..00000000 --- a/Sources/DOMKit/WebIDL/FullscreenNavigationUI.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum FullscreenNavigationUI: JSString, JSValueCompatible { - case auto = "auto" - case show = "show" - case hide = "hide" - - @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/FullscreenOptions.swift b/Sources/DOMKit/WebIDL/FullscreenOptions.swift deleted file mode 100644 index 3ec8a1a0..00000000 --- a/Sources/DOMKit/WebIDL/FullscreenOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class FullscreenOptions: BridgedDictionary { - public convenience init(navigationUI: FullscreenNavigationUI) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.navigationUI] = navigationUI.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _navigationUI = ReadWriteAttribute(jsObject: object, name: Strings.navigationUI) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var navigationUI: FullscreenNavigationUI -} diff --git a/Sources/DOMKit/WebIDL/GPU.swift b/Sources/DOMKit/WebIDL/GPU.swift deleted file mode 100644 index 21dbfb56..00000000 --- a/Sources/DOMKit/WebIDL/GPU.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPU: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPU].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func requestAdapter(options: GPURequestAdapterOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestAdapter(options: GPURequestAdapterOptions? = nil) async throws -> GPUAdapter? { - let this = jsObject - let _promise: JSPromise = this[Strings.requestAdapter].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/GPUAdapter.swift b/Sources/DOMKit/WebIDL/GPUAdapter.swift deleted file mode 100644 index f8292114..00000000 --- a/Sources/DOMKit/WebIDL/GPUAdapter.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUAdapter: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUAdapter].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _features = ReadonlyAttribute(jsObject: jsObject, name: Strings.features) - _limits = ReadonlyAttribute(jsObject: jsObject, name: Strings.limits) - _isFallbackAdapter = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFallbackAdapter) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var features: GPUSupportedFeatures - - @ReadonlyAttribute - public var limits: GPUSupportedLimits - - @ReadonlyAttribute - public var isFallbackAdapter: Bool - - @inlinable public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestDevice(descriptor: GPUDeviceDescriptor? = nil) async throws -> GPUDevice { - let this = jsObject - let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/GPUAddressMode.swift b/Sources/DOMKit/WebIDL/GPUAddressMode.swift deleted file mode 100644 index b8f27cfc..00000000 --- a/Sources/DOMKit/WebIDL/GPUAddressMode.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUAddressMode: JSString, JSValueCompatible { - case clampToEdge = "clamp-to-edge" - case `repeat` = "repeat" - case mirrorRepeat = "mirror-repeat" - - @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/GPUBindGroup.swift b/Sources/DOMKit/WebIDL/GPUBindGroup.swift deleted file mode 100644 index 654e2600..00000000 --- a/Sources/DOMKit/WebIDL/GPUBindGroup.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBindGroup: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUBindGroup].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift b/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift deleted file mode 100644 index 3741b83b..00000000 --- a/Sources/DOMKit/WebIDL/GPUBindGroupDescriptor.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBindGroupDescriptor: BridgedDictionary { - public convenience init(layout: GPUBindGroupLayout, entries: [GPUBindGroupEntry]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.layout] = layout.jsValue - object[Strings.entries] = entries.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - _entries = ReadWriteAttribute(jsObject: object, name: Strings.entries) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var layout: GPUBindGroupLayout - - @ReadWriteAttribute - public var entries: [GPUBindGroupEntry] -} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift b/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift deleted file mode 100644 index 2977f435..00000000 --- a/Sources/DOMKit/WebIDL/GPUBindGroupEntry.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBindGroupEntry: BridgedDictionary { - public convenience init(binding: GPUIndex32, resource: GPUBindingResource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.binding] = binding.jsValue - object[Strings.resource] = resource.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _binding = ReadWriteAttribute(jsObject: object, name: Strings.binding) - _resource = ReadWriteAttribute(jsObject: object, name: Strings.resource) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var binding: GPUIndex32 - - @ReadWriteAttribute - public var resource: GPUBindingResource -} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift b/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift deleted file mode 100644 index e675b689..00000000 --- a/Sources/DOMKit/WebIDL/GPUBindGroupLayout.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBindGroupLayout: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUBindGroupLayout].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift deleted file mode 100644 index 4210f503..00000000 --- a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBindGroupLayoutDescriptor: BridgedDictionary { - public convenience init(entries: [GPUBindGroupLayoutEntry]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.entries] = entries.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _entries = ReadWriteAttribute(jsObject: object, name: Strings.entries) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var entries: [GPUBindGroupLayoutEntry] -} diff --git a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift b/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift deleted file mode 100644 index eb93182c..00000000 --- a/Sources/DOMKit/WebIDL/GPUBindGroupLayoutEntry.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBindGroupLayoutEntry: BridgedDictionary { - public convenience init(binding: GPUIndex32, visibility: GPUShaderStageFlags, buffer: GPUBufferBindingLayout, sampler: GPUSamplerBindingLayout, texture: GPUTextureBindingLayout, storageTexture: GPUStorageTextureBindingLayout, externalTexture: GPUExternalTextureBindingLayout) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.binding] = binding.jsValue - object[Strings.visibility] = visibility.jsValue - object[Strings.buffer] = buffer.jsValue - object[Strings.sampler] = sampler.jsValue - object[Strings.texture] = texture.jsValue - object[Strings.storageTexture] = storageTexture.jsValue - object[Strings.externalTexture] = externalTexture.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _binding = ReadWriteAttribute(jsObject: object, name: Strings.binding) - _visibility = ReadWriteAttribute(jsObject: object, name: Strings.visibility) - _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) - _sampler = ReadWriteAttribute(jsObject: object, name: Strings.sampler) - _texture = ReadWriteAttribute(jsObject: object, name: Strings.texture) - _storageTexture = ReadWriteAttribute(jsObject: object, name: Strings.storageTexture) - _externalTexture = ReadWriteAttribute(jsObject: object, name: Strings.externalTexture) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var binding: GPUIndex32 - - @ReadWriteAttribute - public var visibility: GPUShaderStageFlags - - @ReadWriteAttribute - public var buffer: GPUBufferBindingLayout - - @ReadWriteAttribute - public var sampler: GPUSamplerBindingLayout - - @ReadWriteAttribute - public var texture: GPUTextureBindingLayout - - @ReadWriteAttribute - public var storageTexture: GPUStorageTextureBindingLayout - - @ReadWriteAttribute - public var externalTexture: GPUExternalTextureBindingLayout -} diff --git a/Sources/DOMKit/WebIDL/GPUBindingResource.swift b/Sources/DOMKit/WebIDL/GPUBindingResource.swift deleted file mode 100644 index 6e06f2cf..00000000 --- a/Sources/DOMKit/WebIDL/GPUBindingResource.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_GPUBindingResource: ConvertibleToJSValue {} -extension GPUBufferBinding: Any_GPUBindingResource {} -extension GPUExternalTexture: Any_GPUBindingResource {} -extension GPUSampler: Any_GPUBindingResource {} -extension GPUTextureView: Any_GPUBindingResource {} - -public enum GPUBindingResource: JSValueCompatible, Any_GPUBindingResource { - case gPUBufferBinding(GPUBufferBinding) - case gPUExternalTexture(GPUExternalTexture) - case gPUSampler(GPUSampler) - case gPUTextureView(GPUTextureView) - - public static func construct(from value: JSValue) -> Self? { - if let gPUBufferBinding: GPUBufferBinding = value.fromJSValue() { - return .gPUBufferBinding(gPUBufferBinding) - } - if let gPUExternalTexture: GPUExternalTexture = value.fromJSValue() { - return .gPUExternalTexture(gPUExternalTexture) - } - if let gPUSampler: GPUSampler = value.fromJSValue() { - return .gPUSampler(gPUSampler) - } - if let gPUTextureView: GPUTextureView = value.fromJSValue() { - return .gPUTextureView(gPUTextureView) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .gPUBufferBinding(gPUBufferBinding): - return gPUBufferBinding.jsValue - case let .gPUExternalTexture(gPUExternalTexture): - return gPUExternalTexture.jsValue - case let .gPUSampler(gPUSampler): - return gPUSampler.jsValue - case let .gPUTextureView(gPUTextureView): - return gPUTextureView.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUBlendComponent.swift b/Sources/DOMKit/WebIDL/GPUBlendComponent.swift deleted file mode 100644 index 120515cb..00000000 --- a/Sources/DOMKit/WebIDL/GPUBlendComponent.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBlendComponent: BridgedDictionary { - public convenience init(operation: GPUBlendOperation, srcFactor: GPUBlendFactor, dstFactor: GPUBlendFactor) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.operation] = operation.jsValue - object[Strings.srcFactor] = srcFactor.jsValue - object[Strings.dstFactor] = dstFactor.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _operation = ReadWriteAttribute(jsObject: object, name: Strings.operation) - _srcFactor = ReadWriteAttribute(jsObject: object, name: Strings.srcFactor) - _dstFactor = ReadWriteAttribute(jsObject: object, name: Strings.dstFactor) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var operation: GPUBlendOperation - - @ReadWriteAttribute - public var srcFactor: GPUBlendFactor - - @ReadWriteAttribute - public var dstFactor: GPUBlendFactor -} diff --git a/Sources/DOMKit/WebIDL/GPUBlendFactor.swift b/Sources/DOMKit/WebIDL/GPUBlendFactor.swift deleted file mode 100644 index 51b995cd..00000000 --- a/Sources/DOMKit/WebIDL/GPUBlendFactor.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUBlendFactor: JSString, JSValueCompatible { - case zero = "zero" - case one = "one" - case src = "src" - case oneMinusSrc = "one-minus-src" - case srcAlpha = "src-alpha" - case oneMinusSrcAlpha = "one-minus-src-alpha" - case dst = "dst" - case oneMinusDst = "one-minus-dst" - case dstAlpha = "dst-alpha" - case oneMinusDstAlpha = "one-minus-dst-alpha" - case srcAlphaSaturated = "src-alpha-saturated" - case constant = "constant" - case oneMinusConstant = "one-minus-constant" - - @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/GPUBlendOperation.swift b/Sources/DOMKit/WebIDL/GPUBlendOperation.swift deleted file mode 100644 index f283df40..00000000 --- a/Sources/DOMKit/WebIDL/GPUBlendOperation.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUBlendOperation: JSString, JSValueCompatible { - case add = "add" - case subtract = "subtract" - case reverseSubtract = "reverse-subtract" - case min = "min" - case max = "max" - - @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/GPUBlendState.swift b/Sources/DOMKit/WebIDL/GPUBlendState.swift deleted file mode 100644 index 98fb42b7..00000000 --- a/Sources/DOMKit/WebIDL/GPUBlendState.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBlendState: BridgedDictionary { - public convenience init(color: GPUBlendComponent, alpha: GPUBlendComponent) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.color] = color.jsValue - object[Strings.alpha] = alpha.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _color = ReadWriteAttribute(jsObject: object, name: Strings.color) - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var color: GPUBlendComponent - - @ReadWriteAttribute - public var alpha: GPUBlendComponent -} diff --git a/Sources/DOMKit/WebIDL/GPUBuffer.swift b/Sources/DOMKit/WebIDL/GPUBuffer.swift deleted file mode 100644 index f2cdbeca..00000000 --- a/Sources/DOMKit/WebIDL/GPUBuffer.swift +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBuffer: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUBuffer].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) -> JSPromise { - let this = jsObject - return this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func mapAsync(mode: GPUMapModeFlags, offset: GPUSize64? = nil, size: GPUSize64? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.mapAsync].function!(this: this, arguments: [mode.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func getMappedRange(offset: GPUSize64? = nil, size: GPUSize64? = nil) -> ArrayBuffer { - let this = jsObject - return this[Strings.getMappedRange].function!(this: this, arguments: [offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func unmap() { - let this = jsObject - _ = this[Strings.unmap].function!(this: this, arguments: []) - } - - @inlinable public func destroy() { - let this = jsObject - _ = this[Strings.destroy].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUBufferBinding.swift b/Sources/DOMKit/WebIDL/GPUBufferBinding.swift deleted file mode 100644 index 3e1f9079..00000000 --- a/Sources/DOMKit/WebIDL/GPUBufferBinding.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBufferBinding: BridgedDictionary { - public convenience init(buffer: GPUBuffer, offset: GPUSize64, size: GPUSize64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffer] = buffer.jsValue - object[Strings.offset] = offset.jsValue - object[Strings.size] = size.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) - _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) - _size = ReadWriteAttribute(jsObject: object, name: Strings.size) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var buffer: GPUBuffer - - @ReadWriteAttribute - public var offset: GPUSize64 - - @ReadWriteAttribute - public var size: GPUSize64 -} diff --git a/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift deleted file mode 100644 index bd05cbd8..00000000 --- a/Sources/DOMKit/WebIDL/GPUBufferBindingLayout.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBufferBindingLayout: BridgedDictionary { - public convenience init(type: GPUBufferBindingType, hasDynamicOffset: Bool, minBindingSize: GPUSize64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.hasDynamicOffset] = hasDynamicOffset.jsValue - object[Strings.minBindingSize] = minBindingSize.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _hasDynamicOffset = ReadWriteAttribute(jsObject: object, name: Strings.hasDynamicOffset) - _minBindingSize = ReadWriteAttribute(jsObject: object, name: Strings.minBindingSize) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: GPUBufferBindingType - - @ReadWriteAttribute - public var hasDynamicOffset: Bool - - @ReadWriteAttribute - public var minBindingSize: GPUSize64 -} diff --git a/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift b/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift deleted file mode 100644 index 8e0d3a28..00000000 --- a/Sources/DOMKit/WebIDL/GPUBufferBindingType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUBufferBindingType: JSString, JSValueCompatible { - case uniform = "uniform" - case storage = "storage" - case readOnlyStorage = "read-only-storage" - - @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/GPUBufferDescriptor.swift b/Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift deleted file mode 100644 index f80dc94f..00000000 --- a/Sources/DOMKit/WebIDL/GPUBufferDescriptor.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUBufferDescriptor: BridgedDictionary { - public convenience init(size: GPUSize64, usage: GPUBufferUsageFlags, mappedAtCreation: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.size] = size.jsValue - object[Strings.usage] = usage.jsValue - object[Strings.mappedAtCreation] = mappedAtCreation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _size = ReadWriteAttribute(jsObject: object, name: Strings.size) - _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) - _mappedAtCreation = ReadWriteAttribute(jsObject: object, name: Strings.mappedAtCreation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var size: GPUSize64 - - @ReadWriteAttribute - public var usage: GPUBufferUsageFlags - - @ReadWriteAttribute - public var mappedAtCreation: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPUBufferUsage.swift b/Sources/DOMKit/WebIDL/GPUBufferUsage.swift deleted file mode 100644 index 7ae5cc37..00000000 --- a/Sources/DOMKit/WebIDL/GPUBufferUsage.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUBufferUsage { - @inlinable public static var jsObject: JSObject { - JSObject.global[Strings.GPUBufferUsage].object! - } - - public static let MAP_READ: GPUFlagsConstant = 0x0001 - - public static let MAP_WRITE: GPUFlagsConstant = 0x0002 - - public static let COPY_SRC: GPUFlagsConstant = 0x0004 - - public static let COPY_DST: GPUFlagsConstant = 0x0008 - - public static let INDEX: GPUFlagsConstant = 0x0010 - - public static let VERTEX: GPUFlagsConstant = 0x0020 - - public static let UNIFORM: GPUFlagsConstant = 0x0040 - - public static let STORAGE: GPUFlagsConstant = 0x0080 - - public static let INDIRECT: GPUFlagsConstant = 0x0100 - - public static let QUERY_RESOLVE: GPUFlagsConstant = 0x0200 -} diff --git a/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift b/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift deleted file mode 100644 index 9643f83e..00000000 --- a/Sources/DOMKit/WebIDL/GPUBuffer_or_WebGLBuffer.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_GPUBuffer_or_WebGLBuffer: ConvertibleToJSValue {} -extension GPUBuffer: Any_GPUBuffer_or_WebGLBuffer {} -extension WebGLBuffer: Any_GPUBuffer_or_WebGLBuffer {} - -public enum GPUBuffer_or_WebGLBuffer: JSValueCompatible, Any_GPUBuffer_or_WebGLBuffer { - case gPUBuffer(GPUBuffer) - case webGLBuffer(WebGLBuffer) - - public static func construct(from value: JSValue) -> Self? { - if let gPUBuffer: GPUBuffer = value.fromJSValue() { - return .gPUBuffer(gPUBuffer) - } - if let webGLBuffer: WebGLBuffer = value.fromJSValue() { - return .webGLBuffer(webGLBuffer) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .gPUBuffer(gPUBuffer): - return gPUBuffer.jsValue - case let .webGLBuffer(webGLBuffer): - return webGLBuffer.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift b/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift deleted file mode 100644 index aea7f1ca..00000000 --- a/Sources/DOMKit/WebIDL/GPUCanvasCompositingAlphaMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUCanvasCompositingAlphaMode: JSString, JSValueCompatible { - case opaque = "opaque" - case premultiplied = "premultiplied" - - @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/GPUCanvasConfiguration.swift b/Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift deleted file mode 100644 index 9d47ab39..00000000 --- a/Sources/DOMKit/WebIDL/GPUCanvasConfiguration.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUCanvasConfiguration: BridgedDictionary { - public convenience init(device: GPUDevice, format: GPUTextureFormat, usage: GPUTextureUsageFlags, viewFormats: [GPUTextureFormat], colorSpace: GPUPredefinedColorSpace, compositingAlphaMode: GPUCanvasCompositingAlphaMode, size: GPUExtent3D) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue - object[Strings.format] = format.jsValue - object[Strings.usage] = usage.jsValue - object[Strings.viewFormats] = viewFormats.jsValue - object[Strings.colorSpace] = colorSpace.jsValue - object[Strings.compositingAlphaMode] = compositingAlphaMode.jsValue - object[Strings.size] = size.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _device = ReadWriteAttribute(jsObject: object, name: Strings.device) - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) - _viewFormats = ReadWriteAttribute(jsObject: object, name: Strings.viewFormats) - _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) - _compositingAlphaMode = ReadWriteAttribute(jsObject: object, name: Strings.compositingAlphaMode) - _size = ReadWriteAttribute(jsObject: object, name: Strings.size) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var device: GPUDevice - - @ReadWriteAttribute - public var format: GPUTextureFormat - - @ReadWriteAttribute - public var usage: GPUTextureUsageFlags - - @ReadWriteAttribute - public var viewFormats: [GPUTextureFormat] - - @ReadWriteAttribute - public var colorSpace: GPUPredefinedColorSpace - - @ReadWriteAttribute - public var compositingAlphaMode: GPUCanvasCompositingAlphaMode - - @ReadWriteAttribute - public var size: GPUExtent3D -} diff --git a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift b/Sources/DOMKit/WebIDL/GPUCanvasContext.swift deleted file mode 100644 index 578e75e9..00000000 --- a/Sources/DOMKit/WebIDL/GPUCanvasContext.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUCanvasContext: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCanvasContext].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var canvas: HTMLCanvasElement_or_OffscreenCanvas - - @inlinable public func configure(configuration: GPUCanvasConfiguration) { - let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [configuration.jsValue]) - } - - @inlinable public func unconfigure() { - let this = jsObject - _ = this[Strings.unconfigure].function!(this: this, arguments: []) - } - - @inlinable public func getPreferredFormat(adapter: GPUAdapter) -> GPUTextureFormat { - let this = jsObject - return this[Strings.getPreferredFormat].function!(this: this, arguments: [adapter.jsValue]).fromJSValue()! - } - - @inlinable public func getCurrentTexture() -> GPUTexture { - let this = jsObject - return this[Strings.getCurrentTexture].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/GPUColor.swift b/Sources/DOMKit/WebIDL/GPUColor.swift deleted file mode 100644 index 82cd8703..00000000 --- a/Sources/DOMKit/WebIDL/GPUColor.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_GPUColor: ConvertibleToJSValue {} -extension GPUColorDict: Any_GPUColor {} -extension Array: Any_GPUColor where Element == Double {} - -public enum GPUColor: JSValueCompatible, Any_GPUColor { - case gPUColorDict(GPUColorDict) - case seq_of_Double([Double]) - - public static func construct(from value: JSValue) -> Self? { - if let gPUColorDict: GPUColorDict = value.fromJSValue() { - return .gPUColorDict(gPUColorDict) - } - if let seq_of_Double: [Double] = value.fromJSValue() { - return .seq_of_Double(seq_of_Double) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .gPUColorDict(gPUColorDict): - return gPUColorDict.jsValue - case let .seq_of_Double(seq_of_Double): - return seq_of_Double.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUColorDict.swift b/Sources/DOMKit/WebIDL/GPUColorDict.swift deleted file mode 100644 index ac4a0515..00000000 --- a/Sources/DOMKit/WebIDL/GPUColorDict.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUColorDict: BridgedDictionary { - public convenience init(r: Double, g: Double, b: Double, a: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.r] = r.jsValue - object[Strings.g] = g.jsValue - object[Strings.b] = b.jsValue - object[Strings.a] = a.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _r = ReadWriteAttribute(jsObject: object, name: Strings.r) - _g = ReadWriteAttribute(jsObject: object, name: Strings.g) - _b = ReadWriteAttribute(jsObject: object, name: Strings.b) - _a = ReadWriteAttribute(jsObject: object, name: Strings.a) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var r: Double - - @ReadWriteAttribute - public var g: Double - - @ReadWriteAttribute - public var b: Double - - @ReadWriteAttribute - public var a: Double -} diff --git a/Sources/DOMKit/WebIDL/GPUColorTargetState.swift b/Sources/DOMKit/WebIDL/GPUColorTargetState.swift deleted file mode 100644 index f513fb2d..00000000 --- a/Sources/DOMKit/WebIDL/GPUColorTargetState.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUColorTargetState: BridgedDictionary { - public convenience init(format: GPUTextureFormat, blend: GPUBlendState, writeMask: GPUColorWriteFlags) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue - object[Strings.blend] = blend.jsValue - object[Strings.writeMask] = writeMask.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _blend = ReadWriteAttribute(jsObject: object, name: Strings.blend) - _writeMask = ReadWriteAttribute(jsObject: object, name: Strings.writeMask) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var format: GPUTextureFormat - - @ReadWriteAttribute - public var blend: GPUBlendState - - @ReadWriteAttribute - public var writeMask: GPUColorWriteFlags -} diff --git a/Sources/DOMKit/WebIDL/GPUColorWrite.swift b/Sources/DOMKit/WebIDL/GPUColorWrite.swift deleted file mode 100644 index 406c02a3..00000000 --- a/Sources/DOMKit/WebIDL/GPUColorWrite.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUColorWrite { - @inlinable public static var jsObject: JSObject { - JSObject.global[Strings.GPUColorWrite].object! - } - - public static let RED: GPUFlagsConstant = 0x1 - - public static let GREEN: GPUFlagsConstant = 0x2 - - public static let BLUE: GPUFlagsConstant = 0x4 - - public static let ALPHA: GPUFlagsConstant = 0x8 - - public static let ALL: GPUFlagsConstant = 0xF -} diff --git a/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift b/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift deleted file mode 100644 index 32bee860..00000000 --- a/Sources/DOMKit/WebIDL/GPUCommandBuffer.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUCommandBuffer: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCommandBuffer].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/GPUCommandBufferDescriptor.swift b/Sources/DOMKit/WebIDL/GPUCommandBufferDescriptor.swift deleted file mode 100644 index cd2f999d..00000000 --- a/Sources/DOMKit/WebIDL/GPUCommandBufferDescriptor.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUCommandBufferDescriptor: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift b/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift deleted file mode 100644 index 7774f676..00000000 --- a/Sources/DOMKit/WebIDL/GPUCommandEncoder.swift +++ /dev/null @@ -1,64 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUCommandEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCommandEncoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func beginRenderPass(descriptor: GPURenderPassDescriptor) -> GPURenderPassEncoder { - let this = jsObject - return this[Strings.beginRenderPass].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func beginComputePass(descriptor: GPUComputePassDescriptor? = nil) -> GPUComputePassEncoder { - let this = jsObject - return this[Strings.beginComputePass].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64) { - let this = jsObject - _ = this[Strings.copyBufferToBuffer].function!(this: this, arguments: [source.jsValue, sourceOffset.jsValue, destination.jsValue, destinationOffset.jsValue, size.jsValue]) - } - - @inlinable public func copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { - let this = jsObject - _ = this[Strings.copyBufferToTexture].function!(this: this, arguments: [source.jsValue, destination.jsValue, copySize.jsValue]) - } - - @inlinable public func copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D) { - let this = jsObject - _ = this[Strings.copyTextureToBuffer].function!(this: this, arguments: [source.jsValue, destination.jsValue, copySize.jsValue]) - } - - @inlinable public func copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D) { - let this = jsObject - _ = this[Strings.copyTextureToTexture].function!(this: this, arguments: [source.jsValue, destination.jsValue, copySize.jsValue]) - } - - @inlinable public func clearBuffer(buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { - let this = jsObject - _ = this[Strings.clearBuffer].function!(this: this, arguments: [buffer.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]) - } - - @inlinable public func writeTimestamp(querySet: GPUQuerySet, queryIndex: GPUSize32) { - let this = jsObject - _ = this[Strings.writeTimestamp].function!(this: this, arguments: [querySet.jsValue, queryIndex.jsValue]) - } - - @inlinable public func resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64) { - let this = jsObject - _ = this[Strings.resolveQuerySet].function!(this: this, arguments: [querySet.jsValue, firstQuery.jsValue, queryCount.jsValue, destination.jsValue, destinationOffset.jsValue]) - } - - @inlinable public func finish(descriptor: GPUCommandBufferDescriptor? = nil) -> GPUCommandBuffer { - let this = jsObject - return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/GPUCommandEncoderDescriptor.swift b/Sources/DOMKit/WebIDL/GPUCommandEncoderDescriptor.swift deleted file mode 100644 index a778bfdb..00000000 --- a/Sources/DOMKit/WebIDL/GPUCommandEncoderDescriptor.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUCommandEncoderDescriptor: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUCommandsMixin.swift b/Sources/DOMKit/WebIDL/GPUCommandsMixin.swift deleted file mode 100644 index 4a48057c..00000000 --- a/Sources/DOMKit/WebIDL/GPUCommandsMixin.swift +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol GPUCommandsMixin: JSBridgedClass {} -public extension GPUCommandsMixin {} diff --git a/Sources/DOMKit/WebIDL/GPUCompareFunction.swift b/Sources/DOMKit/WebIDL/GPUCompareFunction.swift deleted file mode 100644 index c09eb376..00000000 --- a/Sources/DOMKit/WebIDL/GPUCompareFunction.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUCompareFunction: JSString, JSValueCompatible { - case never = "never" - case less = "less" - case equal = "equal" - case lessEqual = "less-equal" - case greater = "greater" - case notEqual = "not-equal" - case greaterEqual = "greater-equal" - case always = "always" - - @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/GPUCompilationInfo.swift b/Sources/DOMKit/WebIDL/GPUCompilationInfo.swift deleted file mode 100644 index 05ed76ff..00000000 --- a/Sources/DOMKit/WebIDL/GPUCompilationInfo.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUCompilationInfo: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCompilationInfo].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _messages = ReadonlyAttribute(jsObject: jsObject, name: Strings.messages) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var messages: [GPUCompilationMessage] -} diff --git a/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift b/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift deleted file mode 100644 index 5b7631b6..00000000 --- a/Sources/DOMKit/WebIDL/GPUCompilationMessage.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUCompilationMessage: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUCompilationMessage].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _lineNum = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNum) - _linePos = ReadonlyAttribute(jsObject: jsObject, name: Strings.linePos) - _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var message: String - - @ReadonlyAttribute - public var type: GPUCompilationMessageType - - @ReadonlyAttribute - public var lineNum: UInt64 - - @ReadonlyAttribute - public var linePos: UInt64 - - @ReadonlyAttribute - public var offset: UInt64 - - @ReadonlyAttribute - public var length: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift b/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift deleted file mode 100644 index d6f8c3d5..00000000 --- a/Sources/DOMKit/WebIDL/GPUCompilationMessageType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUCompilationMessageType: JSString, JSValueCompatible { - case error = "error" - case warning = "warning" - case info = "info" - - @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/GPUComputePassDescriptor.swift b/Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift deleted file mode 100644 index 8f51dea7..00000000 --- a/Sources/DOMKit/WebIDL/GPUComputePassDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUComputePassDescriptor: BridgedDictionary { - public convenience init(timestampWrites: GPUComputePassTimestampWrites) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestampWrites] = timestampWrites.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _timestampWrites = ReadWriteAttribute(jsObject: object, name: Strings.timestampWrites) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var timestampWrites: GPUComputePassTimestampWrites -} diff --git a/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift deleted file mode 100644 index a2e16137..00000000 --- a/Sources/DOMKit/WebIDL/GPUComputePassEncoder.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUComputePassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUComputePassEncoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func setPipeline(pipeline: GPUComputePipeline) { - let this = jsObject - _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue]) - } - - @inlinable public func dispatch(workgroupCountX: GPUSize32, workgroupCountY: GPUSize32? = nil, workgroupCountZ: GPUSize32? = nil) { - let this = jsObject - _ = this[Strings.dispatch].function!(this: this, arguments: [workgroupCountX.jsValue, workgroupCountY?.jsValue ?? .undefined, workgroupCountZ?.jsValue ?? .undefined]) - } - - @inlinable public func dispatchIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { - let this = jsObject - _ = this[Strings.dispatchIndirect].function!(this: this, arguments: [indirectBuffer.jsValue, indirectOffset.jsValue]) - } - - @inlinable public func end() { - let this = jsObject - _ = this[Strings.end].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift b/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift deleted file mode 100644 index 8a26f0d4..00000000 --- a/Sources/DOMKit/WebIDL/GPUComputePassTimestampLocation.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUComputePassTimestampLocation: JSString, JSValueCompatible { - case beginning = "beginning" - case end = "end" - - @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/GPUComputePassTimestampWrite.swift b/Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift deleted file mode 100644 index b6f87cc5..00000000 --- a/Sources/DOMKit/WebIDL/GPUComputePassTimestampWrite.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUComputePassTimestampWrite: BridgedDictionary { - public convenience init(querySet: GPUQuerySet, queryIndex: GPUSize32, location: GPUComputePassTimestampLocation) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.querySet] = querySet.jsValue - object[Strings.queryIndex] = queryIndex.jsValue - object[Strings.location] = location.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _querySet = ReadWriteAttribute(jsObject: object, name: Strings.querySet) - _queryIndex = ReadWriteAttribute(jsObject: object, name: Strings.queryIndex) - _location = ReadWriteAttribute(jsObject: object, name: Strings.location) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var querySet: GPUQuerySet - - @ReadWriteAttribute - public var queryIndex: GPUSize32 - - @ReadWriteAttribute - public var location: GPUComputePassTimestampLocation -} diff --git a/Sources/DOMKit/WebIDL/GPUComputePipeline.swift b/Sources/DOMKit/WebIDL/GPUComputePipeline.swift deleted file mode 100644 index 4c59a3ad..00000000 --- a/Sources/DOMKit/WebIDL/GPUComputePipeline.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUComputePipeline: JSBridgedClass, GPUObjectBase, GPUPipelineBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUComputePipeline].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift b/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift deleted file mode 100644 index 2d6a7c90..00000000 --- a/Sources/DOMKit/WebIDL/GPUComputePipelineDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUComputePipelineDescriptor: BridgedDictionary { - public convenience init(compute: GPUProgrammableStage) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.compute] = compute.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _compute = ReadWriteAttribute(jsObject: object, name: Strings.compute) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var compute: GPUProgrammableStage -} diff --git a/Sources/DOMKit/WebIDL/GPUCullMode.swift b/Sources/DOMKit/WebIDL/GPUCullMode.swift deleted file mode 100644 index aac8d9c3..00000000 --- a/Sources/DOMKit/WebIDL/GPUCullMode.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUCullMode: JSString, JSValueCompatible { - case none = "none" - case front = "front" - case back = "back" - - @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/GPUDebugCommandsMixin.swift b/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift deleted file mode 100644 index b1ecfa70..00000000 --- a/Sources/DOMKit/WebIDL/GPUDebugCommandsMixin.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol GPUDebugCommandsMixin: JSBridgedClass {} -public extension GPUDebugCommandsMixin { - @inlinable func pushDebugGroup(groupLabel: String) { - let this = jsObject - _ = this[Strings.pushDebugGroup].function!(this: this, arguments: [groupLabel.jsValue]) - } - - @inlinable func popDebugGroup() { - let this = jsObject - _ = this[Strings.popDebugGroup].function!(this: this, arguments: []) - } - - @inlinable func insertDebugMarker(markerLabel: String) { - let this = jsObject - _ = this[Strings.insertDebugMarker].function!(this: this, arguments: [markerLabel.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift b/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift deleted file mode 100644 index 288cd758..00000000 --- a/Sources/DOMKit/WebIDL/GPUDepthStencilState.swift +++ /dev/null @@ -1,65 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUDepthStencilState: BridgedDictionary { - public convenience init(format: GPUTextureFormat, depthWriteEnabled: Bool, depthCompare: GPUCompareFunction, stencilFront: GPUStencilFaceState, stencilBack: GPUStencilFaceState, stencilReadMask: GPUStencilValue, stencilWriteMask: GPUStencilValue, depthBias: GPUDepthBias, depthBiasSlopeScale: Float, depthBiasClamp: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue - object[Strings.depthWriteEnabled] = depthWriteEnabled.jsValue - object[Strings.depthCompare] = depthCompare.jsValue - object[Strings.stencilFront] = stencilFront.jsValue - object[Strings.stencilBack] = stencilBack.jsValue - object[Strings.stencilReadMask] = stencilReadMask.jsValue - object[Strings.stencilWriteMask] = stencilWriteMask.jsValue - object[Strings.depthBias] = depthBias.jsValue - object[Strings.depthBiasSlopeScale] = depthBiasSlopeScale.jsValue - object[Strings.depthBiasClamp] = depthBiasClamp.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _depthWriteEnabled = ReadWriteAttribute(jsObject: object, name: Strings.depthWriteEnabled) - _depthCompare = ReadWriteAttribute(jsObject: object, name: Strings.depthCompare) - _stencilFront = ReadWriteAttribute(jsObject: object, name: Strings.stencilFront) - _stencilBack = ReadWriteAttribute(jsObject: object, name: Strings.stencilBack) - _stencilReadMask = ReadWriteAttribute(jsObject: object, name: Strings.stencilReadMask) - _stencilWriteMask = ReadWriteAttribute(jsObject: object, name: Strings.stencilWriteMask) - _depthBias = ReadWriteAttribute(jsObject: object, name: Strings.depthBias) - _depthBiasSlopeScale = ReadWriteAttribute(jsObject: object, name: Strings.depthBiasSlopeScale) - _depthBiasClamp = ReadWriteAttribute(jsObject: object, name: Strings.depthBiasClamp) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var format: GPUTextureFormat - - @ReadWriteAttribute - public var depthWriteEnabled: Bool - - @ReadWriteAttribute - public var depthCompare: GPUCompareFunction - - @ReadWriteAttribute - public var stencilFront: GPUStencilFaceState - - @ReadWriteAttribute - public var stencilBack: GPUStencilFaceState - - @ReadWriteAttribute - public var stencilReadMask: GPUStencilValue - - @ReadWriteAttribute - public var stencilWriteMask: GPUStencilValue - - @ReadWriteAttribute - public var depthBias: GPUDepthBias - - @ReadWriteAttribute - public var depthBiasSlopeScale: Float - - @ReadWriteAttribute - public var depthBiasClamp: Float -} diff --git a/Sources/DOMKit/WebIDL/GPUDevice.swift b/Sources/DOMKit/WebIDL/GPUDevice.swift deleted file mode 100644 index fba48ca1..00000000 --- a/Sources/DOMKit/WebIDL/GPUDevice.swift +++ /dev/null @@ -1,143 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUDevice: EventTarget, GPUObjectBase { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GPUDevice].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _features = ReadonlyAttribute(jsObject: jsObject, name: Strings.features) - _limits = ReadonlyAttribute(jsObject: jsObject, name: Strings.limits) - _queue = ReadonlyAttribute(jsObject: jsObject, name: Strings.queue) - _lost = ReadonlyAttribute(jsObject: jsObject, name: Strings.lost) - _onuncapturederror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onuncapturederror) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var features: GPUSupportedFeatures - - @ReadonlyAttribute - public var limits: GPUSupportedLimits - - @ReadonlyAttribute - public var queue: GPUQueue - - @inlinable public func destroy() { - let this = jsObject - _ = this[Strings.destroy].function!(this: this, arguments: []) - } - - @inlinable public func createBuffer(descriptor: GPUBufferDescriptor) -> GPUBuffer { - let this = jsObject - return this[Strings.createBuffer].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createTexture(descriptor: GPUTextureDescriptor) -> GPUTexture { - let this = jsObject - return this[Strings.createTexture].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createSampler(descriptor: GPUSamplerDescriptor? = nil) -> GPUSampler { - let this = jsObject - return this[Strings.createSampler].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func importExternalTexture(descriptor: GPUExternalTextureDescriptor) -> GPUExternalTexture { - let this = jsObject - return this[Strings.importExternalTexture].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor) -> GPUBindGroupLayout { - let this = jsObject - return this[Strings.createBindGroupLayout].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor) -> GPUPipelineLayout { - let this = jsObject - return this[Strings.createPipelineLayout].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createBindGroup(descriptor: GPUBindGroupDescriptor) -> GPUBindGroup { - let this = jsObject - return this[Strings.createBindGroup].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createShaderModule(descriptor: GPUShaderModuleDescriptor) -> GPUShaderModule { - let this = jsObject - return this[Strings.createShaderModule].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createComputePipeline(descriptor: GPUComputePipelineDescriptor) -> GPUComputePipeline { - let this = jsObject - return this[Strings.createComputePipeline].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createRenderPipeline(descriptor: GPURenderPipelineDescriptor) -> GPURenderPipeline { - let this = jsObject - return this[Strings.createRenderPipeline].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) -> JSPromise { - let this = jsObject - return this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor) async throws -> GPUComputePipeline { - let this = jsObject - let _promise: JSPromise = this[Strings.createComputePipelineAsync].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) -> JSPromise { - let this = jsObject - return this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor) async throws -> GPURenderPipeline { - let this = jsObject - let _promise: JSPromise = this[Strings.createRenderPipelineAsync].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func createCommandEncoder(descriptor: GPUCommandEncoderDescriptor? = nil) -> GPUCommandEncoder { - let this = jsObject - return this[Strings.createCommandEncoder].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor) -> GPURenderBundleEncoder { - let this = jsObject - return this[Strings.createRenderBundleEncoder].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @inlinable public func createQuerySet(descriptor: GPUQuerySetDescriptor) -> GPUQuerySet { - let this = jsObject - return this[Strings.createQuerySet].function!(this: this, arguments: [descriptor.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var lost: JSPromise - - @inlinable public func pushErrorScope(filter: GPUErrorFilter) { - let this = jsObject - _ = this[Strings.pushErrorScope].function!(this: this, arguments: [filter.jsValue]) - } - - @inlinable public func popErrorScope() -> JSPromise { - let this = jsObject - return this[Strings.popErrorScope].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func popErrorScope() async throws -> GPUError? { - let this = jsObject - let _promise: JSPromise = this[Strings.popErrorScope].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ClosureAttribute1Optional - public var onuncapturederror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift b/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift deleted file mode 100644 index 96309aa1..00000000 --- a/Sources/DOMKit/WebIDL/GPUDeviceDescriptor.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUDeviceDescriptor: BridgedDictionary { - public convenience init(requiredFeatures: [GPUFeatureName], requiredLimits: [String: GPUSize64], defaultQueue: GPUQueueDescriptor) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.requiredFeatures] = requiredFeatures.jsValue - object[Strings.requiredLimits] = requiredLimits.jsValue - object[Strings.defaultQueue] = defaultQueue.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _requiredFeatures = ReadWriteAttribute(jsObject: object, name: Strings.requiredFeatures) - _requiredLimits = ReadWriteAttribute(jsObject: object, name: Strings.requiredLimits) - _defaultQueue = ReadWriteAttribute(jsObject: object, name: Strings.defaultQueue) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var requiredFeatures: [GPUFeatureName] - - @ReadWriteAttribute - public var requiredLimits: [String: GPUSize64] - - @ReadWriteAttribute - public var defaultQueue: GPUQueueDescriptor -} diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift deleted file mode 100644 index a4edb346..00000000 --- a/Sources/DOMKit/WebIDL/GPUDeviceLostInfo.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUDeviceLostInfo: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUDeviceLostInfo].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var reason: GPUDeviceLostReason? - - @ReadonlyAttribute - public var message: String -} diff --git a/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift b/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift deleted file mode 100644 index e953fef7..00000000 --- a/Sources/DOMKit/WebIDL/GPUDeviceLostReason.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUDeviceLostReason: JSString, JSValueCompatible { - case destroyed = "destroyed" - - @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/GPUError.swift b/Sources/DOMKit/WebIDL/GPUError.swift deleted file mode 100644 index dcccbe64..00000000 --- a/Sources/DOMKit/WebIDL/GPUError.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_GPUError: ConvertibleToJSValue {} -extension GPUOutOfMemoryError: Any_GPUError {} -extension GPUValidationError: Any_GPUError {} - -public enum GPUError: JSValueCompatible, Any_GPUError { - case gPUOutOfMemoryError(GPUOutOfMemoryError) - case gPUValidationError(GPUValidationError) - - public static func construct(from value: JSValue) -> Self? { - if let gPUOutOfMemoryError: GPUOutOfMemoryError = value.fromJSValue() { - return .gPUOutOfMemoryError(gPUOutOfMemoryError) - } - if let gPUValidationError: GPUValidationError = value.fromJSValue() { - return .gPUValidationError(gPUValidationError) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .gPUOutOfMemoryError(gPUOutOfMemoryError): - return gPUOutOfMemoryError.jsValue - case let .gPUValidationError(gPUValidationError): - return gPUValidationError.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUErrorFilter.swift b/Sources/DOMKit/WebIDL/GPUErrorFilter.swift deleted file mode 100644 index 32cbd30e..00000000 --- a/Sources/DOMKit/WebIDL/GPUErrorFilter.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUErrorFilter: JSString, JSValueCompatible { - case outOfMemory = "out-of-memory" - case validation = "validation" - - @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/GPUExtent3D.swift b/Sources/DOMKit/WebIDL/GPUExtent3D.swift deleted file mode 100644 index d985ec2d..00000000 --- a/Sources/DOMKit/WebIDL/GPUExtent3D.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_GPUExtent3D: ConvertibleToJSValue {} -extension GPUExtent3DDict: Any_GPUExtent3D {} -extension Array: Any_GPUExtent3D where Element == GPUIntegerCoordinate {} - -public enum GPUExtent3D: JSValueCompatible, Any_GPUExtent3D { - case gPUExtent3DDict(GPUExtent3DDict) - case seq_of_GPUIntegerCoordinate([GPUIntegerCoordinate]) - - public static func construct(from value: JSValue) -> Self? { - if let gPUExtent3DDict: GPUExtent3DDict = value.fromJSValue() { - return .gPUExtent3DDict(gPUExtent3DDict) - } - if let seq_of_GPUIntegerCoordinate: [GPUIntegerCoordinate] = value.fromJSValue() { - return .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .gPUExtent3DDict(gPUExtent3DDict): - return gPUExtent3DDict.jsValue - case let .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate): - return seq_of_GPUIntegerCoordinate.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift b/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift deleted file mode 100644 index ca32fa2a..00000000 --- a/Sources/DOMKit/WebIDL/GPUExtent3DDict.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUExtent3DDict: BridgedDictionary { - public convenience init(width: GPUIntegerCoordinate, height: GPUIntegerCoordinate, depthOrArrayLayers: GPUIntegerCoordinate) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.width] = width.jsValue - object[Strings.height] = height.jsValue - object[Strings.depthOrArrayLayers] = depthOrArrayLayers.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) - _depthOrArrayLayers = ReadWriteAttribute(jsObject: object, name: Strings.depthOrArrayLayers) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var width: GPUIntegerCoordinate - - @ReadWriteAttribute - public var height: GPUIntegerCoordinate - - @ReadWriteAttribute - public var depthOrArrayLayers: GPUIntegerCoordinate -} diff --git a/Sources/DOMKit/WebIDL/GPUExternalTexture.swift b/Sources/DOMKit/WebIDL/GPUExternalTexture.swift deleted file mode 100644 index 73676354..00000000 --- a/Sources/DOMKit/WebIDL/GPUExternalTexture.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUExternalTexture: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUExternalTexture].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _expired = ReadonlyAttribute(jsObject: jsObject, name: Strings.expired) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var expired: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPUExternalTextureBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUExternalTextureBindingLayout.swift deleted file mode 100644 index a68629e6..00000000 --- a/Sources/DOMKit/WebIDL/GPUExternalTextureBindingLayout.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUExternalTextureBindingLayout: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift b/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift deleted file mode 100644 index d3be39da..00000000 --- a/Sources/DOMKit/WebIDL/GPUExternalTextureDescriptor.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUExternalTextureDescriptor: BridgedDictionary { - public convenience init(source: HTMLVideoElement, colorSpace: GPUPredefinedColorSpace) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.source] = source.jsValue - object[Strings.colorSpace] = colorSpace.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _source = ReadWriteAttribute(jsObject: object, name: Strings.source) - _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var source: HTMLVideoElement - - @ReadWriteAttribute - public var colorSpace: GPUPredefinedColorSpace -} diff --git a/Sources/DOMKit/WebIDL/GPUFeatureName.swift b/Sources/DOMKit/WebIDL/GPUFeatureName.swift deleted file mode 100644 index 70345e0c..00000000 --- a/Sources/DOMKit/WebIDL/GPUFeatureName.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUFeatureName: JSString, JSValueCompatible { - case depthClipControl = "depth-clip-control" - case depth24unormStencil8 = "depth24unorm-stencil8" - case depth32floatStencil8 = "depth32float-stencil8" - case textureCompressionBc = "texture-compression-bc" - case textureCompressionEtc2 = "texture-compression-etc2" - case textureCompressionAstc = "texture-compression-astc" - case timestampQuery = "timestamp-query" - case indirectFirstInstance = "indirect-first-instance" - - @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/GPUFilterMode.swift b/Sources/DOMKit/WebIDL/GPUFilterMode.swift deleted file mode 100644 index 9dd91a3f..00000000 --- a/Sources/DOMKit/WebIDL/GPUFilterMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUFilterMode: JSString, JSValueCompatible { - case nearest = "nearest" - case linear = "linear" - - @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/GPUFragmentState.swift b/Sources/DOMKit/WebIDL/GPUFragmentState.swift deleted file mode 100644 index 4a238baf..00000000 --- a/Sources/DOMKit/WebIDL/GPUFragmentState.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUFragmentState: BridgedDictionary { - public convenience init(targets: [GPUColorTargetState?]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.targets] = targets.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _targets = ReadWriteAttribute(jsObject: object, name: Strings.targets) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var targets: [GPUColorTargetState?] -} diff --git a/Sources/DOMKit/WebIDL/GPUFrontFace.swift b/Sources/DOMKit/WebIDL/GPUFrontFace.swift deleted file mode 100644 index 814770fa..00000000 --- a/Sources/DOMKit/WebIDL/GPUFrontFace.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUFrontFace: JSString, JSValueCompatible { - case ccw = "ccw" - case cw = "cw" - - @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/GPUImageCopyBuffer.swift b/Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift deleted file mode 100644 index 77034df1..00000000 --- a/Sources/DOMKit/WebIDL/GPUImageCopyBuffer.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUImageCopyBuffer: BridgedDictionary { - public convenience init(buffer: GPUBuffer) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffer] = buffer.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _buffer = ReadWriteAttribute(jsObject: object, name: Strings.buffer) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var buffer: GPUBuffer -} diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift b/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift deleted file mode 100644 index 5a6b1afa..00000000 --- a/Sources/DOMKit/WebIDL/GPUImageCopyExternalImage.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUImageCopyExternalImage: BridgedDictionary { - public convenience init(source: HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas, origin: GPUOrigin2D, flipY: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.source] = source.jsValue - object[Strings.origin] = origin.jsValue - object[Strings.flipY] = flipY.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _source = ReadWriteAttribute(jsObject: object, name: Strings.source) - _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) - _flipY = ReadWriteAttribute(jsObject: object, name: Strings.flipY) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var source: HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas - - @ReadWriteAttribute - public var origin: GPUOrigin2D - - @ReadWriteAttribute - public var flipY: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift b/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift deleted file mode 100644 index c7e4b79a..00000000 --- a/Sources/DOMKit/WebIDL/GPUImageCopyTexture.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUImageCopyTexture: BridgedDictionary { - public convenience init(texture: GPUTexture, mipLevel: GPUIntegerCoordinate, origin: GPUOrigin3D, aspect: GPUTextureAspect) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.texture] = texture.jsValue - object[Strings.mipLevel] = mipLevel.jsValue - object[Strings.origin] = origin.jsValue - object[Strings.aspect] = aspect.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _texture = ReadWriteAttribute(jsObject: object, name: Strings.texture) - _mipLevel = ReadWriteAttribute(jsObject: object, name: Strings.mipLevel) - _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) - _aspect = ReadWriteAttribute(jsObject: object, name: Strings.aspect) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var texture: GPUTexture - - @ReadWriteAttribute - public var mipLevel: GPUIntegerCoordinate - - @ReadWriteAttribute - public var origin: GPUOrigin3D - - @ReadWriteAttribute - public var aspect: GPUTextureAspect -} diff --git a/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift b/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift deleted file mode 100644 index e2b1e2f2..00000000 --- a/Sources/DOMKit/WebIDL/GPUImageCopyTextureTagged.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUImageCopyTextureTagged: BridgedDictionary { - public convenience init(colorSpace: GPUPredefinedColorSpace, premultipliedAlpha: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.colorSpace] = colorSpace.jsValue - object[Strings.premultipliedAlpha] = premultipliedAlpha.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) - _premultipliedAlpha = ReadWriteAttribute(jsObject: object, name: Strings.premultipliedAlpha) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var colorSpace: GPUPredefinedColorSpace - - @ReadWriteAttribute - public var premultipliedAlpha: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift b/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift deleted file mode 100644 index e199bd54..00000000 --- a/Sources/DOMKit/WebIDL/GPUImageDataLayout.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUImageDataLayout: BridgedDictionary { - public convenience init(offset: GPUSize64, bytesPerRow: GPUSize32, rowsPerImage: GPUSize32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.offset] = offset.jsValue - object[Strings.bytesPerRow] = bytesPerRow.jsValue - object[Strings.rowsPerImage] = rowsPerImage.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) - _bytesPerRow = ReadWriteAttribute(jsObject: object, name: Strings.bytesPerRow) - _rowsPerImage = ReadWriteAttribute(jsObject: object, name: Strings.rowsPerImage) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var offset: GPUSize64 - - @ReadWriteAttribute - public var bytesPerRow: GPUSize32 - - @ReadWriteAttribute - public var rowsPerImage: GPUSize32 -} diff --git a/Sources/DOMKit/WebIDL/GPUIndexFormat.swift b/Sources/DOMKit/WebIDL/GPUIndexFormat.swift deleted file mode 100644 index 63882008..00000000 --- a/Sources/DOMKit/WebIDL/GPUIndexFormat.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUIndexFormat: JSString, JSValueCompatible { - case uint16 = "uint16" - case uint32 = "uint32" - - @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/GPULoadOp.swift b/Sources/DOMKit/WebIDL/GPULoadOp.swift deleted file mode 100644 index fa4b06af..00000000 --- a/Sources/DOMKit/WebIDL/GPULoadOp.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPULoadOp: JSString, JSValueCompatible { - case load = "load" - case clear = "clear" - - @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/GPUMapMode.swift b/Sources/DOMKit/WebIDL/GPUMapMode.swift deleted file mode 100644 index 689bb051..00000000 --- a/Sources/DOMKit/WebIDL/GPUMapMode.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUMapMode { - @inlinable public static var jsObject: JSObject { - JSObject.global[Strings.GPUMapMode].object! - } - - public static let READ: GPUFlagsConstant = 0x0001 - - public static let WRITE: GPUFlagsConstant = 0x0002 -} diff --git a/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift b/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift deleted file mode 100644 index e276db7e..00000000 --- a/Sources/DOMKit/WebIDL/GPUMipmapFilterMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUMipmapFilterMode: JSString, JSValueCompatible { - case nearest = "nearest" - case linear = "linear" - - @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/GPUMultisampleState.swift b/Sources/DOMKit/WebIDL/GPUMultisampleState.swift deleted file mode 100644 index b154e531..00000000 --- a/Sources/DOMKit/WebIDL/GPUMultisampleState.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUMultisampleState: BridgedDictionary { - public convenience init(count: GPUSize32, mask: GPUSampleMask, alphaToCoverageEnabled: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.count] = count.jsValue - object[Strings.mask] = mask.jsValue - object[Strings.alphaToCoverageEnabled] = alphaToCoverageEnabled.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _count = ReadWriteAttribute(jsObject: object, name: Strings.count) - _mask = ReadWriteAttribute(jsObject: object, name: Strings.mask) - _alphaToCoverageEnabled = ReadWriteAttribute(jsObject: object, name: Strings.alphaToCoverageEnabled) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var count: GPUSize32 - - @ReadWriteAttribute - public var mask: GPUSampleMask - - @ReadWriteAttribute - public var alphaToCoverageEnabled: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPUObjectBase.swift b/Sources/DOMKit/WebIDL/GPUObjectBase.swift deleted file mode 100644 index b81d1d32..00000000 --- a/Sources/DOMKit/WebIDL/GPUObjectBase.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol GPUObjectBase: JSBridgedClass {} -public extension GPUObjectBase { - @inlinable var label: String? { - get { ReadWriteAttribute[Strings.label, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.label, in: jsObject] = newValue } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift b/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift deleted file mode 100644 index 1966cf64..00000000 --- a/Sources/DOMKit/WebIDL/GPUObjectDescriptorBase.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUObjectDescriptorBase: BridgedDictionary { - public convenience init(label: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _label = ReadWriteAttribute(jsObject: object, name: Strings.label) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var label: String -} diff --git a/Sources/DOMKit/WebIDL/GPUOrigin2D.swift b/Sources/DOMKit/WebIDL/GPUOrigin2D.swift deleted file mode 100644 index 1682f836..00000000 --- a/Sources/DOMKit/WebIDL/GPUOrigin2D.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_GPUOrigin2D: ConvertibleToJSValue {} -extension GPUOrigin2DDict: Any_GPUOrigin2D {} -extension Array: Any_GPUOrigin2D where Element == GPUIntegerCoordinate {} - -public enum GPUOrigin2D: JSValueCompatible, Any_GPUOrigin2D { - case gPUOrigin2DDict(GPUOrigin2DDict) - case seq_of_GPUIntegerCoordinate([GPUIntegerCoordinate]) - - public static func construct(from value: JSValue) -> Self? { - if let gPUOrigin2DDict: GPUOrigin2DDict = value.fromJSValue() { - return .gPUOrigin2DDict(gPUOrigin2DDict) - } - if let seq_of_GPUIntegerCoordinate: [GPUIntegerCoordinate] = value.fromJSValue() { - return .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .gPUOrigin2DDict(gPUOrigin2DDict): - return gPUOrigin2DDict.jsValue - case let .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate): - return seq_of_GPUIntegerCoordinate.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift b/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift deleted file mode 100644 index b41e5589..00000000 --- a/Sources/DOMKit/WebIDL/GPUOrigin2DDict.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUOrigin2DDict: BridgedDictionary { - public convenience init(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var x: GPUIntegerCoordinate - - @ReadWriteAttribute - public var y: GPUIntegerCoordinate -} diff --git a/Sources/DOMKit/WebIDL/GPUOrigin3D.swift b/Sources/DOMKit/WebIDL/GPUOrigin3D.swift deleted file mode 100644 index 2875ff1b..00000000 --- a/Sources/DOMKit/WebIDL/GPUOrigin3D.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_GPUOrigin3D: ConvertibleToJSValue {} -extension GPUOrigin3DDict: Any_GPUOrigin3D {} -extension Array: Any_GPUOrigin3D where Element == GPUIntegerCoordinate {} - -public enum GPUOrigin3D: JSValueCompatible, Any_GPUOrigin3D { - case gPUOrigin3DDict(GPUOrigin3DDict) - case seq_of_GPUIntegerCoordinate([GPUIntegerCoordinate]) - - public static func construct(from value: JSValue) -> Self? { - if let gPUOrigin3DDict: GPUOrigin3DDict = value.fromJSValue() { - return .gPUOrigin3DDict(gPUOrigin3DDict) - } - if let seq_of_GPUIntegerCoordinate: [GPUIntegerCoordinate] = value.fromJSValue() { - return .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .gPUOrigin3DDict(gPUOrigin3DDict): - return gPUOrigin3DDict.jsValue - case let .seq_of_GPUIntegerCoordinate(seq_of_GPUIntegerCoordinate): - return seq_of_GPUIntegerCoordinate.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift b/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift deleted file mode 100644 index 54bab6d4..00000000 --- a/Sources/DOMKit/WebIDL/GPUOrigin3DDict.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUOrigin3DDict: BridgedDictionary { - public convenience init(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, z: GPUIntegerCoordinate) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - object[Strings.z] = z.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - _z = ReadWriteAttribute(jsObject: object, name: Strings.z) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var x: GPUIntegerCoordinate - - @ReadWriteAttribute - public var y: GPUIntegerCoordinate - - @ReadWriteAttribute - public var z: GPUIntegerCoordinate -} diff --git a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift b/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift deleted file mode 100644 index 8280d900..00000000 --- a/Sources/DOMKit/WebIDL/GPUOutOfMemoryError.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUOutOfMemoryError: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUOutOfMemoryError].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUPipelineBase.swift b/Sources/DOMKit/WebIDL/GPUPipelineBase.swift deleted file mode 100644 index b821cac5..00000000 --- a/Sources/DOMKit/WebIDL/GPUPipelineBase.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol GPUPipelineBase: JSBridgedClass {} -public extension GPUPipelineBase { - @inlinable func getBindGroupLayout(index: UInt32) -> GPUBindGroupLayout { - let this = jsObject - return this[Strings.getBindGroupLayout].function!(this: this, arguments: [index.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift b/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift deleted file mode 100644 index 2ec32c21..00000000 --- a/Sources/DOMKit/WebIDL/GPUPipelineDescriptorBase.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUPipelineDescriptorBase: BridgedDictionary { - public convenience init(layout: GPUPipelineLayout) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.layout] = layout.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var layout: GPUPipelineLayout -} diff --git a/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift b/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift deleted file mode 100644 index 099c4c5a..00000000 --- a/Sources/DOMKit/WebIDL/GPUPipelineLayout.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUPipelineLayout: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUPipelineLayout].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift b/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift deleted file mode 100644 index d88926f5..00000000 --- a/Sources/DOMKit/WebIDL/GPUPipelineLayoutDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUPipelineLayoutDescriptor: BridgedDictionary { - public convenience init(bindGroupLayouts: [GPUBindGroupLayout]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bindGroupLayouts] = bindGroupLayouts.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _bindGroupLayouts = ReadWriteAttribute(jsObject: object, name: Strings.bindGroupLayouts) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var bindGroupLayouts: [GPUBindGroupLayout] -} diff --git a/Sources/DOMKit/WebIDL/GPUPowerPreference.swift b/Sources/DOMKit/WebIDL/GPUPowerPreference.swift deleted file mode 100644 index 5797e1e4..00000000 --- a/Sources/DOMKit/WebIDL/GPUPowerPreference.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUPowerPreference: JSString, JSValueCompatible { - 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/GPUPredefinedColorSpace.swift b/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift deleted file mode 100644 index 634b5de1..00000000 --- a/Sources/DOMKit/WebIDL/GPUPredefinedColorSpace.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUPredefinedColorSpace: JSString, JSValueCompatible { - case srgb = "srgb" - - @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/GPUPrimitiveState.swift b/Sources/DOMKit/WebIDL/GPUPrimitiveState.swift deleted file mode 100644 index ac72f98d..00000000 --- a/Sources/DOMKit/WebIDL/GPUPrimitiveState.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUPrimitiveState: BridgedDictionary { - public convenience init(topology: GPUPrimitiveTopology, stripIndexFormat: GPUIndexFormat, frontFace: GPUFrontFace, cullMode: GPUCullMode, unclippedDepth: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.topology] = topology.jsValue - object[Strings.stripIndexFormat] = stripIndexFormat.jsValue - object[Strings.frontFace] = frontFace.jsValue - object[Strings.cullMode] = cullMode.jsValue - object[Strings.unclippedDepth] = unclippedDepth.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _topology = ReadWriteAttribute(jsObject: object, name: Strings.topology) - _stripIndexFormat = ReadWriteAttribute(jsObject: object, name: Strings.stripIndexFormat) - _frontFace = ReadWriteAttribute(jsObject: object, name: Strings.frontFace) - _cullMode = ReadWriteAttribute(jsObject: object, name: Strings.cullMode) - _unclippedDepth = ReadWriteAttribute(jsObject: object, name: Strings.unclippedDepth) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var topology: GPUPrimitiveTopology - - @ReadWriteAttribute - public var stripIndexFormat: GPUIndexFormat - - @ReadWriteAttribute - public var frontFace: GPUFrontFace - - @ReadWriteAttribute - public var cullMode: GPUCullMode - - @ReadWriteAttribute - public var unclippedDepth: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift b/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift deleted file mode 100644 index 4e6497eb..00000000 --- a/Sources/DOMKit/WebIDL/GPUPrimitiveTopology.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUPrimitiveTopology: JSString, JSValueCompatible { - case pointList = "point-list" - case lineList = "line-list" - case lineStrip = "line-strip" - case triangleList = "triangle-list" - case triangleStrip = "triangle-strip" - - @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/GPUProgrammablePassEncoder.swift b/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift deleted file mode 100644 index a35fe6d6..00000000 --- a/Sources/DOMKit/WebIDL/GPUProgrammablePassEncoder.swift +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol GPUProgrammablePassEncoder: JSBridgedClass {} -public extension GPUProgrammablePassEncoder { - @inlinable func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets: [GPUBufferDynamicOffset]? = nil) { - let this = jsObject - _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue, bindGroup.jsValue, dynamicOffsets?.jsValue ?? .undefined]) - } - - @inlinable func setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32) { - let this = jsObject - _ = this[Strings.setBindGroup].function!(this: this, arguments: [index.jsValue, bindGroup.jsValue, dynamicOffsetsData.jsValue, dynamicOffsetsDataStart.jsValue, dynamicOffsetsDataLength.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift b/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift deleted file mode 100644 index 43b61afb..00000000 --- a/Sources/DOMKit/WebIDL/GPUProgrammableStage.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUProgrammableStage: BridgedDictionary { - public convenience init(module: GPUShaderModule, entryPoint: String, constants: [String: GPUPipelineConstantValue]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.module] = module.jsValue - object[Strings.entryPoint] = entryPoint.jsValue - object[Strings.constants] = constants.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _module = ReadWriteAttribute(jsObject: object, name: Strings.module) - _entryPoint = ReadWriteAttribute(jsObject: object, name: Strings.entryPoint) - _constants = ReadWriteAttribute(jsObject: object, name: Strings.constants) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var module: GPUShaderModule - - @ReadWriteAttribute - public var entryPoint: String - - @ReadWriteAttribute - public var constants: [String: GPUPipelineConstantValue] -} diff --git a/Sources/DOMKit/WebIDL/GPUQuerySet.swift b/Sources/DOMKit/WebIDL/GPUQuerySet.swift deleted file mode 100644 index 2f5e208f..00000000 --- a/Sources/DOMKit/WebIDL/GPUQuerySet.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUQuerySet: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUQuerySet].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func destroy() { - let this = jsObject - _ = this[Strings.destroy].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift b/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift deleted file mode 100644 index e256f15c..00000000 --- a/Sources/DOMKit/WebIDL/GPUQuerySetDescriptor.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUQuerySetDescriptor: BridgedDictionary { - public convenience init(type: GPUQueryType, count: GPUSize32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.count] = count.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _count = ReadWriteAttribute(jsObject: object, name: Strings.count) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: GPUQueryType - - @ReadWriteAttribute - public var count: GPUSize32 -} diff --git a/Sources/DOMKit/WebIDL/GPUQueryType.swift b/Sources/DOMKit/WebIDL/GPUQueryType.swift deleted file mode 100644 index 85b7c7b1..00000000 --- a/Sources/DOMKit/WebIDL/GPUQueryType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUQueryType: JSString, JSValueCompatible { - case occlusion = "occlusion" - case timestamp = "timestamp" - - @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/GPUQueue.swift b/Sources/DOMKit/WebIDL/GPUQueue.swift deleted file mode 100644 index 61f76e0c..00000000 --- a/Sources/DOMKit/WebIDL/GPUQueue.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUQueue: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUQueue].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func submit(commandBuffers: [GPUCommandBuffer]) { - let this = jsObject - _ = this[Strings.submit].function!(this: this, arguments: [commandBuffers.jsValue]) - } - - @inlinable public func onSubmittedWorkDone() -> JSPromise { - let this = jsObject - return this[Strings.onSubmittedWorkDone].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func onSubmittedWorkDone() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.onSubmittedWorkDone].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: BufferSource, dataOffset: GPUSize64? = nil, size: GPUSize64? = nil) { - let this = jsObject - _ = this[Strings.writeBuffer].function!(this: this, arguments: [buffer.jsValue, bufferOffset.jsValue, data.jsValue, dataOffset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]) - } - - @inlinable public func writeTexture(destination: GPUImageCopyTexture, data: BufferSource, dataLayout: GPUImageDataLayout, size: GPUExtent3D) { - let this = jsObject - _ = this[Strings.writeTexture].function!(this: this, arguments: [destination.jsValue, data.jsValue, dataLayout.jsValue, size.jsValue]) - } - - @inlinable public func copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: GPUExtent3D) { - let this = jsObject - _ = this[Strings.copyExternalImageToTexture].function!(this: this, arguments: [source.jsValue, destination.jsValue, copySize.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUQueueDescriptor.swift b/Sources/DOMKit/WebIDL/GPUQueueDescriptor.swift deleted file mode 100644 index 4331c43f..00000000 --- a/Sources/DOMKit/WebIDL/GPUQueueDescriptor.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUQueueDescriptor: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/GPURenderBundle.swift b/Sources/DOMKit/WebIDL/GPURenderBundle.swift deleted file mode 100644 index 25dedd2a..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderBundle.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderBundle: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPURenderBundle].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderBundleDescriptor.swift deleted file mode 100644 index b86b3f91..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderBundleDescriptor.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderBundleDescriptor: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift deleted file mode 100644 index 02e292c6..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderBundleEncoder.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderBundleEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder, GPURenderEncoderBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPURenderBundleEncoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func finish(descriptor: GPURenderBundleDescriptor? = nil) -> GPURenderBundle { - let this = jsObject - return this[Strings.finish].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift deleted file mode 100644 index cd8adeb2..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderBundleEncoderDescriptor.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderBundleEncoderDescriptor: BridgedDictionary { - public convenience init(depthReadOnly: Bool, stencilReadOnly: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.depthReadOnly] = depthReadOnly.jsValue - object[Strings.stencilReadOnly] = stencilReadOnly.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _depthReadOnly = ReadWriteAttribute(jsObject: object, name: Strings.depthReadOnly) - _stencilReadOnly = ReadWriteAttribute(jsObject: object, name: Strings.stencilReadOnly) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var depthReadOnly: Bool - - @ReadWriteAttribute - public var stencilReadOnly: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift b/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift deleted file mode 100644 index 0b5b063b..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderEncoderBase.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol GPURenderEncoderBase: JSBridgedClass {} -public extension GPURenderEncoderBase { - @inlinable func setPipeline(pipeline: GPURenderPipeline) { - let this = jsObject - _ = this[Strings.setPipeline].function!(this: this, arguments: [pipeline.jsValue]) - } - - @inlinable func setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset: GPUSize64? = nil, size: GPUSize64? = nil) { - let this = jsObject - _ = this[Strings.setIndexBuffer].function!(this: this, arguments: [buffer.jsValue, indexFormat.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]) - } - - @inlinable func setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset: GPUSize64? = nil, size: GPUSize64? = nil) { - let this = jsObject - _ = this[Strings.setVertexBuffer].function!(this: this, arguments: [slot.jsValue, buffer.jsValue, offset?.jsValue ?? .undefined, size?.jsValue ?? .undefined]) - } - - @inlinable func draw(vertexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstVertex: GPUSize32? = nil, firstInstance: GPUSize32? = nil) { - let this = jsObject - _ = this[Strings.draw].function!(this: this, arguments: [vertexCount.jsValue, instanceCount?.jsValue ?? .undefined, firstVertex?.jsValue ?? .undefined, firstInstance?.jsValue ?? .undefined]) - } - - @inlinable func drawIndexed(indexCount: GPUSize32, instanceCount: GPUSize32? = nil, firstIndex: GPUSize32? = nil, baseVertex: GPUSignedOffset32? = nil, firstInstance: GPUSize32? = nil) { - let this = jsObject - _ = this[Strings.drawIndexed].function!(this: this, arguments: [indexCount.jsValue, instanceCount?.jsValue ?? .undefined, firstIndex?.jsValue ?? .undefined, baseVertex?.jsValue ?? .undefined, firstInstance?.jsValue ?? .undefined]) - } - - @inlinable func drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { - let this = jsObject - _ = this[Strings.drawIndirect].function!(this: this, arguments: [indirectBuffer.jsValue, indirectOffset.jsValue]) - } - - @inlinable func drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64) { - let this = jsObject - _ = this[Strings.drawIndexedIndirect].function!(this: this, arguments: [indirectBuffer.jsValue, indirectOffset.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift b/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift deleted file mode 100644 index a6f976ff..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderPassColorAttachment.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderPassColorAttachment: BridgedDictionary { - public convenience init(view: GPUTextureView, resolveTarget: GPUTextureView, clearValue: GPUColor, loadOp: GPULoadOp, storeOp: GPUStoreOp) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.view] = view.jsValue - object[Strings.resolveTarget] = resolveTarget.jsValue - object[Strings.clearValue] = clearValue.jsValue - object[Strings.loadOp] = loadOp.jsValue - object[Strings.storeOp] = storeOp.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _view = ReadWriteAttribute(jsObject: object, name: Strings.view) - _resolveTarget = ReadWriteAttribute(jsObject: object, name: Strings.resolveTarget) - _clearValue = ReadWriteAttribute(jsObject: object, name: Strings.clearValue) - _loadOp = ReadWriteAttribute(jsObject: object, name: Strings.loadOp) - _storeOp = ReadWriteAttribute(jsObject: object, name: Strings.storeOp) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var view: GPUTextureView - - @ReadWriteAttribute - public var resolveTarget: GPUTextureView - - @ReadWriteAttribute - public var clearValue: GPUColor - - @ReadWriteAttribute - public var loadOp: GPULoadOp - - @ReadWriteAttribute - public var storeOp: GPUStoreOp -} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift b/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift deleted file mode 100644 index 64f4a728..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderPassDepthStencilAttachment.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderPassDepthStencilAttachment: BridgedDictionary { - public convenience init(view: GPUTextureView, depthClearValue: Float, depthLoadOp: GPULoadOp, depthStoreOp: GPUStoreOp, depthReadOnly: Bool, stencilClearValue: GPUStencilValue, stencilLoadOp: GPULoadOp, stencilStoreOp: GPUStoreOp, stencilReadOnly: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.view] = view.jsValue - object[Strings.depthClearValue] = depthClearValue.jsValue - object[Strings.depthLoadOp] = depthLoadOp.jsValue - object[Strings.depthStoreOp] = depthStoreOp.jsValue - object[Strings.depthReadOnly] = depthReadOnly.jsValue - object[Strings.stencilClearValue] = stencilClearValue.jsValue - object[Strings.stencilLoadOp] = stencilLoadOp.jsValue - object[Strings.stencilStoreOp] = stencilStoreOp.jsValue - object[Strings.stencilReadOnly] = stencilReadOnly.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _view = ReadWriteAttribute(jsObject: object, name: Strings.view) - _depthClearValue = ReadWriteAttribute(jsObject: object, name: Strings.depthClearValue) - _depthLoadOp = ReadWriteAttribute(jsObject: object, name: Strings.depthLoadOp) - _depthStoreOp = ReadWriteAttribute(jsObject: object, name: Strings.depthStoreOp) - _depthReadOnly = ReadWriteAttribute(jsObject: object, name: Strings.depthReadOnly) - _stencilClearValue = ReadWriteAttribute(jsObject: object, name: Strings.stencilClearValue) - _stencilLoadOp = ReadWriteAttribute(jsObject: object, name: Strings.stencilLoadOp) - _stencilStoreOp = ReadWriteAttribute(jsObject: object, name: Strings.stencilStoreOp) - _stencilReadOnly = ReadWriteAttribute(jsObject: object, name: Strings.stencilReadOnly) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var view: GPUTextureView - - @ReadWriteAttribute - public var depthClearValue: Float - - @ReadWriteAttribute - public var depthLoadOp: GPULoadOp - - @ReadWriteAttribute - public var depthStoreOp: GPUStoreOp - - @ReadWriteAttribute - public var depthReadOnly: Bool - - @ReadWriteAttribute - public var stencilClearValue: GPUStencilValue - - @ReadWriteAttribute - public var stencilLoadOp: GPULoadOp - - @ReadWriteAttribute - public var stencilStoreOp: GPUStoreOp - - @ReadWriteAttribute - public var stencilReadOnly: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift deleted file mode 100644 index 5832093b..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderPassDescriptor.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderPassDescriptor: BridgedDictionary { - public convenience init(colorAttachments: [GPURenderPassColorAttachment?], depthStencilAttachment: GPURenderPassDepthStencilAttachment, occlusionQuerySet: GPUQuerySet, timestampWrites: GPURenderPassTimestampWrites) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.colorAttachments] = colorAttachments.jsValue - object[Strings.depthStencilAttachment] = depthStencilAttachment.jsValue - object[Strings.occlusionQuerySet] = occlusionQuerySet.jsValue - object[Strings.timestampWrites] = timestampWrites.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _colorAttachments = ReadWriteAttribute(jsObject: object, name: Strings.colorAttachments) - _depthStencilAttachment = ReadWriteAttribute(jsObject: object, name: Strings.depthStencilAttachment) - _occlusionQuerySet = ReadWriteAttribute(jsObject: object, name: Strings.occlusionQuerySet) - _timestampWrites = ReadWriteAttribute(jsObject: object, name: Strings.timestampWrites) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var colorAttachments: [GPURenderPassColorAttachment?] - - @ReadWriteAttribute - public var depthStencilAttachment: GPURenderPassDepthStencilAttachment - - @ReadWriteAttribute - public var occlusionQuerySet: GPUQuerySet - - @ReadWriteAttribute - public var timestampWrites: GPURenderPassTimestampWrites -} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift b/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift deleted file mode 100644 index 04edcbb9..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderPassEncoder.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderPassEncoder: JSBridgedClass, GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder, GPURenderEncoderBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPURenderPassEncoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func setViewport(x: Float, y: Float, width: Float, height: Float, minDepth: Float, maxDepth: Float) { - let _arg0 = x.jsValue - let _arg1 = y.jsValue - let _arg2 = width.jsValue - let _arg3 = height.jsValue - let _arg4 = minDepth.jsValue - let _arg5 = maxDepth.jsValue - let this = jsObject - _ = this[Strings.setViewport].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } - - @inlinable public func setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate) { - let this = jsObject - _ = this[Strings.setScissorRect].function!(this: this, arguments: [x.jsValue, y.jsValue, width.jsValue, height.jsValue]) - } - - @inlinable public func setBlendConstant(color: GPUColor) { - let this = jsObject - _ = this[Strings.setBlendConstant].function!(this: this, arguments: [color.jsValue]) - } - - @inlinable public func setStencilReference(reference: GPUStencilValue) { - let this = jsObject - _ = this[Strings.setStencilReference].function!(this: this, arguments: [reference.jsValue]) - } - - @inlinable public func beginOcclusionQuery(queryIndex: GPUSize32) { - let this = jsObject - _ = this[Strings.beginOcclusionQuery].function!(this: this, arguments: [queryIndex.jsValue]) - } - - @inlinable public func endOcclusionQuery() { - let this = jsObject - _ = this[Strings.endOcclusionQuery].function!(this: this, arguments: []) - } - - @inlinable public func executeBundles(bundles: [GPURenderBundle]) { - let this = jsObject - _ = this[Strings.executeBundles].function!(this: this, arguments: [bundles.jsValue]) - } - - @inlinable public func end() { - let this = jsObject - _ = this[Strings.end].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift b/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift deleted file mode 100644 index 0f3f4fa2..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderPassLayout.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderPassLayout: BridgedDictionary { - public convenience init(colorFormats: [GPUTextureFormat?], depthStencilFormat: GPUTextureFormat, sampleCount: GPUSize32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.colorFormats] = colorFormats.jsValue - object[Strings.depthStencilFormat] = depthStencilFormat.jsValue - object[Strings.sampleCount] = sampleCount.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _colorFormats = ReadWriteAttribute(jsObject: object, name: Strings.colorFormats) - _depthStencilFormat = ReadWriteAttribute(jsObject: object, name: Strings.depthStencilFormat) - _sampleCount = ReadWriteAttribute(jsObject: object, name: Strings.sampleCount) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var colorFormats: [GPUTextureFormat?] - - @ReadWriteAttribute - public var depthStencilFormat: GPUTextureFormat - - @ReadWriteAttribute - public var sampleCount: GPUSize32 -} diff --git a/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift b/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift deleted file mode 100644 index e8a6183f..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderPassTimestampLocation.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPURenderPassTimestampLocation: JSString, JSValueCompatible { - case beginning = "beginning" - case end = "end" - - @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/GPURenderPassTimestampWrite.swift b/Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift deleted file mode 100644 index e9ce8fc9..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderPassTimestampWrite.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderPassTimestampWrite: BridgedDictionary { - public convenience init(querySet: GPUQuerySet, queryIndex: GPUSize32, location: GPURenderPassTimestampLocation) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.querySet] = querySet.jsValue - object[Strings.queryIndex] = queryIndex.jsValue - object[Strings.location] = location.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _querySet = ReadWriteAttribute(jsObject: object, name: Strings.querySet) - _queryIndex = ReadWriteAttribute(jsObject: object, name: Strings.queryIndex) - _location = ReadWriteAttribute(jsObject: object, name: Strings.location) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var querySet: GPUQuerySet - - @ReadWriteAttribute - public var queryIndex: GPUSize32 - - @ReadWriteAttribute - public var location: GPURenderPassTimestampLocation -} diff --git a/Sources/DOMKit/WebIDL/GPURenderPipeline.swift b/Sources/DOMKit/WebIDL/GPURenderPipeline.swift deleted file mode 100644 index 86bfd70c..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderPipeline.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderPipeline: JSBridgedClass, GPUObjectBase, GPUPipelineBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPURenderPipeline].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift b/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift deleted file mode 100644 index 47c992ef..00000000 --- a/Sources/DOMKit/WebIDL/GPURenderPipelineDescriptor.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURenderPipelineDescriptor: BridgedDictionary { - public convenience init(vertex: GPUVertexState, primitive: GPUPrimitiveState, depthStencil: GPUDepthStencilState, multisample: GPUMultisampleState, fragment: GPUFragmentState) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.vertex] = vertex.jsValue - object[Strings.primitive] = primitive.jsValue - object[Strings.depthStencil] = depthStencil.jsValue - object[Strings.multisample] = multisample.jsValue - object[Strings.fragment] = fragment.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _vertex = ReadWriteAttribute(jsObject: object, name: Strings.vertex) - _primitive = ReadWriteAttribute(jsObject: object, name: Strings.primitive) - _depthStencil = ReadWriteAttribute(jsObject: object, name: Strings.depthStencil) - _multisample = ReadWriteAttribute(jsObject: object, name: Strings.multisample) - _fragment = ReadWriteAttribute(jsObject: object, name: Strings.fragment) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var vertex: GPUVertexState - - @ReadWriteAttribute - public var primitive: GPUPrimitiveState - - @ReadWriteAttribute - public var depthStencil: GPUDepthStencilState - - @ReadWriteAttribute - public var multisample: GPUMultisampleState - - @ReadWriteAttribute - public var fragment: GPUFragmentState -} diff --git a/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift b/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift deleted file mode 100644 index 555c458e..00000000 --- a/Sources/DOMKit/WebIDL/GPURequestAdapterOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPURequestAdapterOptions: BridgedDictionary { - public convenience init(powerPreference: GPUPowerPreference, forceFallbackAdapter: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.powerPreference] = powerPreference.jsValue - object[Strings.forceFallbackAdapter] = forceFallbackAdapter.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _powerPreference = ReadWriteAttribute(jsObject: object, name: Strings.powerPreference) - _forceFallbackAdapter = ReadWriteAttribute(jsObject: object, name: Strings.forceFallbackAdapter) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var powerPreference: GPUPowerPreference - - @ReadWriteAttribute - public var forceFallbackAdapter: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPUSampler.swift b/Sources/DOMKit/WebIDL/GPUSampler.swift deleted file mode 100644 index acfc0b81..00000000 --- a/Sources/DOMKit/WebIDL/GPUSampler.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUSampler: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUSampler].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift deleted file mode 100644 index 7d99c4f8..00000000 --- a/Sources/DOMKit/WebIDL/GPUSamplerBindingLayout.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUSamplerBindingLayout: BridgedDictionary { - public convenience init(type: GPUSamplerBindingType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: GPUSamplerBindingType -} diff --git a/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift b/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift deleted file mode 100644 index 792ca590..00000000 --- a/Sources/DOMKit/WebIDL/GPUSamplerBindingType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUSamplerBindingType: JSString, JSValueCompatible { - case filtering = "filtering" - case nonFiltering = "non-filtering" - case comparison = "comparison" - - @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/GPUSamplerDescriptor.swift b/Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift deleted file mode 100644 index 1ac98ca6..00000000 --- a/Sources/DOMKit/WebIDL/GPUSamplerDescriptor.swift +++ /dev/null @@ -1,65 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUSamplerDescriptor: BridgedDictionary { - public convenience init(addressModeU: GPUAddressMode, addressModeV: GPUAddressMode, addressModeW: GPUAddressMode, magFilter: GPUFilterMode, minFilter: GPUFilterMode, mipmapFilter: GPUMipmapFilterMode, lodMinClamp: Float, lodMaxClamp: Float, compare: GPUCompareFunction, maxAnisotropy: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.addressModeU] = addressModeU.jsValue - object[Strings.addressModeV] = addressModeV.jsValue - object[Strings.addressModeW] = addressModeW.jsValue - object[Strings.magFilter] = magFilter.jsValue - object[Strings.minFilter] = minFilter.jsValue - object[Strings.mipmapFilter] = mipmapFilter.jsValue - object[Strings.lodMinClamp] = lodMinClamp.jsValue - object[Strings.lodMaxClamp] = lodMaxClamp.jsValue - object[Strings.compare] = compare.jsValue - object[Strings.maxAnisotropy] = maxAnisotropy.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _addressModeU = ReadWriteAttribute(jsObject: object, name: Strings.addressModeU) - _addressModeV = ReadWriteAttribute(jsObject: object, name: Strings.addressModeV) - _addressModeW = ReadWriteAttribute(jsObject: object, name: Strings.addressModeW) - _magFilter = ReadWriteAttribute(jsObject: object, name: Strings.magFilter) - _minFilter = ReadWriteAttribute(jsObject: object, name: Strings.minFilter) - _mipmapFilter = ReadWriteAttribute(jsObject: object, name: Strings.mipmapFilter) - _lodMinClamp = ReadWriteAttribute(jsObject: object, name: Strings.lodMinClamp) - _lodMaxClamp = ReadWriteAttribute(jsObject: object, name: Strings.lodMaxClamp) - _compare = ReadWriteAttribute(jsObject: object, name: Strings.compare) - _maxAnisotropy = ReadWriteAttribute(jsObject: object, name: Strings.maxAnisotropy) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var addressModeU: GPUAddressMode - - @ReadWriteAttribute - public var addressModeV: GPUAddressMode - - @ReadWriteAttribute - public var addressModeW: GPUAddressMode - - @ReadWriteAttribute - public var magFilter: GPUFilterMode - - @ReadWriteAttribute - public var minFilter: GPUFilterMode - - @ReadWriteAttribute - public var mipmapFilter: GPUMipmapFilterMode - - @ReadWriteAttribute - public var lodMinClamp: Float - - @ReadWriteAttribute - public var lodMaxClamp: Float - - @ReadWriteAttribute - public var compare: GPUCompareFunction - - @ReadWriteAttribute - public var maxAnisotropy: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/GPUShaderModule.swift b/Sources/DOMKit/WebIDL/GPUShaderModule.swift deleted file mode 100644 index 6188cc29..00000000 --- a/Sources/DOMKit/WebIDL/GPUShaderModule.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUShaderModule: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUShaderModule].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func compilationInfo() -> JSPromise { - let this = jsObject - return this[Strings.compilationInfo].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func compilationInfo() async throws -> GPUCompilationInfo { - let this = jsObject - let _promise: JSPromise = this[Strings.compilationInfo].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift b/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift deleted file mode 100644 index 04cb55f5..00000000 --- a/Sources/DOMKit/WebIDL/GPUShaderModuleCompilationHint.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUShaderModuleCompilationHint: BridgedDictionary { - public convenience init(layout: GPUPipelineLayout) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.layout] = layout.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var layout: GPUPipelineLayout -} diff --git a/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift b/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift deleted file mode 100644 index c9bedabd..00000000 --- a/Sources/DOMKit/WebIDL/GPUShaderModuleDescriptor.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUShaderModuleDescriptor: BridgedDictionary { - public convenience init(code: String, sourceMap: JSObject, hints: [String: GPUShaderModuleCompilationHint]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.code] = code.jsValue - object[Strings.sourceMap] = sourceMap.jsValue - object[Strings.hints] = hints.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _code = ReadWriteAttribute(jsObject: object, name: Strings.code) - _sourceMap = ReadWriteAttribute(jsObject: object, name: Strings.sourceMap) - _hints = ReadWriteAttribute(jsObject: object, name: Strings.hints) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var code: String - - @ReadWriteAttribute - public var sourceMap: JSObject - - @ReadWriteAttribute - public var hints: [String: GPUShaderModuleCompilationHint] -} diff --git a/Sources/DOMKit/WebIDL/GPUShaderStage.swift b/Sources/DOMKit/WebIDL/GPUShaderStage.swift deleted file mode 100644 index 6b91ef75..00000000 --- a/Sources/DOMKit/WebIDL/GPUShaderStage.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUShaderStage { - @inlinable public static var jsObject: JSObject { - JSObject.global[Strings.GPUShaderStage].object! - } - - public static let VERTEX: GPUFlagsConstant = 0x1 - - public static let FRAGMENT: GPUFlagsConstant = 0x2 - - public static let COMPUTE: GPUFlagsConstant = 0x4 -} diff --git a/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift b/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift deleted file mode 100644 index 14753603..00000000 --- a/Sources/DOMKit/WebIDL/GPUStencilFaceState.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUStencilFaceState: BridgedDictionary { - public convenience init(compare: GPUCompareFunction, failOp: GPUStencilOperation, depthFailOp: GPUStencilOperation, passOp: GPUStencilOperation) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.compare] = compare.jsValue - object[Strings.failOp] = failOp.jsValue - object[Strings.depthFailOp] = depthFailOp.jsValue - object[Strings.passOp] = passOp.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _compare = ReadWriteAttribute(jsObject: object, name: Strings.compare) - _failOp = ReadWriteAttribute(jsObject: object, name: Strings.failOp) - _depthFailOp = ReadWriteAttribute(jsObject: object, name: Strings.depthFailOp) - _passOp = ReadWriteAttribute(jsObject: object, name: Strings.passOp) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var compare: GPUCompareFunction - - @ReadWriteAttribute - public var failOp: GPUStencilOperation - - @ReadWriteAttribute - public var depthFailOp: GPUStencilOperation - - @ReadWriteAttribute - public var passOp: GPUStencilOperation -} diff --git a/Sources/DOMKit/WebIDL/GPUStencilOperation.swift b/Sources/DOMKit/WebIDL/GPUStencilOperation.swift deleted file mode 100644 index 66d47101..00000000 --- a/Sources/DOMKit/WebIDL/GPUStencilOperation.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUStencilOperation: JSString, JSValueCompatible { - case keep = "keep" - case zero = "zero" - case replace = "replace" - case invert = "invert" - case incrementClamp = "increment-clamp" - case decrementClamp = "decrement-clamp" - case incrementWrap = "increment-wrap" - case decrementWrap = "decrement-wrap" - - @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/GPUStorageTextureAccess.swift b/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift deleted file mode 100644 index 6c09dc16..00000000 --- a/Sources/DOMKit/WebIDL/GPUStorageTextureAccess.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUStorageTextureAccess: JSString, JSValueCompatible { - case writeOnly = "write-only" - - @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/GPUStorageTextureBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift deleted file mode 100644 index d22eca7e..00000000 --- a/Sources/DOMKit/WebIDL/GPUStorageTextureBindingLayout.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUStorageTextureBindingLayout: BridgedDictionary { - public convenience init(access: GPUStorageTextureAccess, format: GPUTextureFormat, viewDimension: GPUTextureViewDimension) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.access] = access.jsValue - object[Strings.format] = format.jsValue - object[Strings.viewDimension] = viewDimension.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _access = ReadWriteAttribute(jsObject: object, name: Strings.access) - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _viewDimension = ReadWriteAttribute(jsObject: object, name: Strings.viewDimension) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var access: GPUStorageTextureAccess - - @ReadWriteAttribute - public var format: GPUTextureFormat - - @ReadWriteAttribute - public var viewDimension: GPUTextureViewDimension -} diff --git a/Sources/DOMKit/WebIDL/GPUStoreOp.swift b/Sources/DOMKit/WebIDL/GPUStoreOp.swift deleted file mode 100644 index ca3b0e76..00000000 --- a/Sources/DOMKit/WebIDL/GPUStoreOp.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUStoreOp: JSString, JSValueCompatible { - case store = "store" - 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/GPUSupportedFeatures.swift b/Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift deleted file mode 100644 index b30a044d..00000000 --- a/Sources/DOMKit/WebIDL/GPUSupportedFeatures.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUSupportedFeatures: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUSupportedFeatures].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Set-like! -} diff --git a/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift b/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift deleted file mode 100644 index 83e01311..00000000 --- a/Sources/DOMKit/WebIDL/GPUSupportedLimits.swift +++ /dev/null @@ -1,118 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUSupportedLimits: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUSupportedLimits].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _maxTextureDimension1D = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTextureDimension1D) - _maxTextureDimension2D = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTextureDimension2D) - _maxTextureDimension3D = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTextureDimension3D) - _maxTextureArrayLayers = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTextureArrayLayers) - _maxBindGroups = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxBindGroups) - _maxDynamicUniformBuffersPerPipelineLayout = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxDynamicUniformBuffersPerPipelineLayout) - _maxDynamicStorageBuffersPerPipelineLayout = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxDynamicStorageBuffersPerPipelineLayout) - _maxSampledTexturesPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxSampledTexturesPerShaderStage) - _maxSamplersPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxSamplersPerShaderStage) - _maxStorageBuffersPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxStorageBuffersPerShaderStage) - _maxStorageTexturesPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxStorageTexturesPerShaderStage) - _maxUniformBuffersPerShaderStage = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxUniformBuffersPerShaderStage) - _maxUniformBufferBindingSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxUniformBufferBindingSize) - _maxStorageBufferBindingSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxStorageBufferBindingSize) - _minUniformBufferOffsetAlignment = ReadonlyAttribute(jsObject: jsObject, name: Strings.minUniformBufferOffsetAlignment) - _minStorageBufferOffsetAlignment = ReadonlyAttribute(jsObject: jsObject, name: Strings.minStorageBufferOffsetAlignment) - _maxVertexBuffers = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxVertexBuffers) - _maxVertexAttributes = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxVertexAttributes) - _maxVertexBufferArrayStride = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxVertexBufferArrayStride) - _maxInterStageShaderComponents = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxInterStageShaderComponents) - _maxComputeWorkgroupStorageSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupStorageSize) - _maxComputeInvocationsPerWorkgroup = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeInvocationsPerWorkgroup) - _maxComputeWorkgroupSizeX = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupSizeX) - _maxComputeWorkgroupSizeY = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupSizeY) - _maxComputeWorkgroupSizeZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupSizeZ) - _maxComputeWorkgroupsPerDimension = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxComputeWorkgroupsPerDimension) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var maxTextureDimension1D: UInt32 - - @ReadonlyAttribute - public var maxTextureDimension2D: UInt32 - - @ReadonlyAttribute - public var maxTextureDimension3D: UInt32 - - @ReadonlyAttribute - public var maxTextureArrayLayers: UInt32 - - @ReadonlyAttribute - public var maxBindGroups: UInt32 - - @ReadonlyAttribute - public var maxDynamicUniformBuffersPerPipelineLayout: UInt32 - - @ReadonlyAttribute - public var maxDynamicStorageBuffersPerPipelineLayout: UInt32 - - @ReadonlyAttribute - public var maxSampledTexturesPerShaderStage: UInt32 - - @ReadonlyAttribute - public var maxSamplersPerShaderStage: UInt32 - - @ReadonlyAttribute - public var maxStorageBuffersPerShaderStage: UInt32 - - @ReadonlyAttribute - public var maxStorageTexturesPerShaderStage: UInt32 - - @ReadonlyAttribute - public var maxUniformBuffersPerShaderStage: UInt32 - - @ReadonlyAttribute - public var maxUniformBufferBindingSize: UInt64 - - @ReadonlyAttribute - public var maxStorageBufferBindingSize: UInt64 - - @ReadonlyAttribute - public var minUniformBufferOffsetAlignment: UInt32 - - @ReadonlyAttribute - public var minStorageBufferOffsetAlignment: UInt32 - - @ReadonlyAttribute - public var maxVertexBuffers: UInt32 - - @ReadonlyAttribute - public var maxVertexAttributes: UInt32 - - @ReadonlyAttribute - public var maxVertexBufferArrayStride: UInt32 - - @ReadonlyAttribute - public var maxInterStageShaderComponents: UInt32 - - @ReadonlyAttribute - public var maxComputeWorkgroupStorageSize: UInt32 - - @ReadonlyAttribute - public var maxComputeInvocationsPerWorkgroup: UInt32 - - @ReadonlyAttribute - public var maxComputeWorkgroupSizeX: UInt32 - - @ReadonlyAttribute - public var maxComputeWorkgroupSizeY: UInt32 - - @ReadonlyAttribute - public var maxComputeWorkgroupSizeZ: UInt32 - - @ReadonlyAttribute - public var maxComputeWorkgroupsPerDimension: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/GPUTexture.swift b/Sources/DOMKit/WebIDL/GPUTexture.swift deleted file mode 100644 index eb7bf3c1..00000000 --- a/Sources/DOMKit/WebIDL/GPUTexture.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUTexture: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUTexture].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func createView(descriptor: GPUTextureViewDescriptor? = nil) -> GPUTextureView { - let this = jsObject - return this[Strings.createView].function!(this: this, arguments: [descriptor?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func destroy() { - let this = jsObject - _ = this[Strings.destroy].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/GPUTextureAspect.swift b/Sources/DOMKit/WebIDL/GPUTextureAspect.swift deleted file mode 100644 index b6508288..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureAspect.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUTextureAspect: JSString, JSValueCompatible { - case all = "all" - case stencilOnly = "stencil-only" - case depthOnly = "depth-only" - - @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/GPUTextureBindingLayout.swift b/Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift deleted file mode 100644 index d5215e81..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureBindingLayout.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUTextureBindingLayout: BridgedDictionary { - public convenience init(sampleType: GPUTextureSampleType, viewDimension: GPUTextureViewDimension, multisampled: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sampleType] = sampleType.jsValue - object[Strings.viewDimension] = viewDimension.jsValue - object[Strings.multisampled] = multisampled.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _sampleType = ReadWriteAttribute(jsObject: object, name: Strings.sampleType) - _viewDimension = ReadWriteAttribute(jsObject: object, name: Strings.viewDimension) - _multisampled = ReadWriteAttribute(jsObject: object, name: Strings.multisampled) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var sampleType: GPUTextureSampleType - - @ReadWriteAttribute - public var viewDimension: GPUTextureViewDimension - - @ReadWriteAttribute - public var multisampled: Bool -} diff --git a/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift b/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift deleted file mode 100644 index 2c44a3a8..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureDescriptor.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUTextureDescriptor: BridgedDictionary { - public convenience init(size: GPUExtent3D, mipLevelCount: GPUIntegerCoordinate, sampleCount: GPUSize32, dimension: GPUTextureDimension, format: GPUTextureFormat, usage: GPUTextureUsageFlags, viewFormats: [GPUTextureFormat]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.size] = size.jsValue - object[Strings.mipLevelCount] = mipLevelCount.jsValue - object[Strings.sampleCount] = sampleCount.jsValue - object[Strings.dimension] = dimension.jsValue - object[Strings.format] = format.jsValue - object[Strings.usage] = usage.jsValue - object[Strings.viewFormats] = viewFormats.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _size = ReadWriteAttribute(jsObject: object, name: Strings.size) - _mipLevelCount = ReadWriteAttribute(jsObject: object, name: Strings.mipLevelCount) - _sampleCount = ReadWriteAttribute(jsObject: object, name: Strings.sampleCount) - _dimension = ReadWriteAttribute(jsObject: object, name: Strings.dimension) - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) - _viewFormats = ReadWriteAttribute(jsObject: object, name: Strings.viewFormats) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var size: GPUExtent3D - - @ReadWriteAttribute - public var mipLevelCount: GPUIntegerCoordinate - - @ReadWriteAttribute - public var sampleCount: GPUSize32 - - @ReadWriteAttribute - public var dimension: GPUTextureDimension - - @ReadWriteAttribute - public var format: GPUTextureFormat - - @ReadWriteAttribute - public var usage: GPUTextureUsageFlags - - @ReadWriteAttribute - public var viewFormats: [GPUTextureFormat] -} diff --git a/Sources/DOMKit/WebIDL/GPUTextureDimension.swift b/Sources/DOMKit/WebIDL/GPUTextureDimension.swift deleted file mode 100644 index 6403241a..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureDimension.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUTextureDimension: JSString, JSValueCompatible { - case _1d = "1d" - case _2d = "2d" - case _3d = "3d" - - @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/GPUTextureFormat.swift b/Sources/DOMKit/WebIDL/GPUTextureFormat.swift deleted file mode 100644 index 93b01280..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureFormat.swift +++ /dev/null @@ -1,115 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUTextureFormat: JSString, JSValueCompatible { - case r8unorm = "r8unorm" - case r8snorm = "r8snorm" - case r8uint = "r8uint" - case r8sint = "r8sint" - case r16uint = "r16uint" - case r16sint = "r16sint" - case r16float = "r16float" - case rg8unorm = "rg8unorm" - case rg8snorm = "rg8snorm" - case rg8uint = "rg8uint" - case rg8sint = "rg8sint" - case r32uint = "r32uint" - case r32sint = "r32sint" - case r32float = "r32float" - case rg16uint = "rg16uint" - case rg16sint = "rg16sint" - case rg16float = "rg16float" - case rgba8unorm = "rgba8unorm" - case rgba8unormSrgb = "rgba8unorm-srgb" - case rgba8snorm = "rgba8snorm" - case rgba8uint = "rgba8uint" - case rgba8sint = "rgba8sint" - case bgra8unorm = "bgra8unorm" - case bgra8unormSrgb = "bgra8unorm-srgb" - case rgb9e5ufloat = "rgb9e5ufloat" - case rgb10a2unorm = "rgb10a2unorm" - case rg11b10ufloat = "rg11b10ufloat" - case rg32uint = "rg32uint" - case rg32sint = "rg32sint" - case rg32float = "rg32float" - case rgba16uint = "rgba16uint" - case rgba16sint = "rgba16sint" - case rgba16float = "rgba16float" - case rgba32uint = "rgba32uint" - case rgba32sint = "rgba32sint" - case rgba32float = "rgba32float" - case stencil8 = "stencil8" - case depth16unorm = "depth16unorm" - case depth24plus = "depth24plus" - case depth24plusStencil8 = "depth24plus-stencil8" - case depth32float = "depth32float" - case depth24unormStencil8 = "depth24unorm-stencil8" - case depth32floatStencil8 = "depth32float-stencil8" - case bc1RgbaUnorm = "bc1-rgba-unorm" - case bc1RgbaUnormSrgb = "bc1-rgba-unorm-srgb" - case bc2RgbaUnorm = "bc2-rgba-unorm" - case bc2RgbaUnormSrgb = "bc2-rgba-unorm-srgb" - case bc3RgbaUnorm = "bc3-rgba-unorm" - case bc3RgbaUnormSrgb = "bc3-rgba-unorm-srgb" - case bc4RUnorm = "bc4-r-unorm" - case bc4RSnorm = "bc4-r-snorm" - case bc5RgUnorm = "bc5-rg-unorm" - case bc5RgSnorm = "bc5-rg-snorm" - case bc6hRgbUfloat = "bc6h-rgb-ufloat" - case bc6hRgbFloat = "bc6h-rgb-float" - case bc7RgbaUnorm = "bc7-rgba-unorm" - case bc7RgbaUnormSrgb = "bc7-rgba-unorm-srgb" - case etc2Rgb8unorm = "etc2-rgb8unorm" - case etc2Rgb8unormSrgb = "etc2-rgb8unorm-srgb" - case etc2Rgb8a1unorm = "etc2-rgb8a1unorm" - case etc2Rgb8a1unormSrgb = "etc2-rgb8a1unorm-srgb" - case etc2Rgba8unorm = "etc2-rgba8unorm" - case etc2Rgba8unormSrgb = "etc2-rgba8unorm-srgb" - case eacR11unorm = "eac-r11unorm" - case eacR11snorm = "eac-r11snorm" - case eacRg11unorm = "eac-rg11unorm" - case eacRg11snorm = "eac-rg11snorm" - case astc4x4Unorm = "astc-4x4-unorm" - case astc4x4UnormSrgb = "astc-4x4-unorm-srgb" - case astc5x4Unorm = "astc-5x4-unorm" - case astc5x4UnormSrgb = "astc-5x4-unorm-srgb" - case astc5x5Unorm = "astc-5x5-unorm" - case astc5x5UnormSrgb = "astc-5x5-unorm-srgb" - case astc6x5Unorm = "astc-6x5-unorm" - case astc6x5UnormSrgb = "astc-6x5-unorm-srgb" - case astc6x6Unorm = "astc-6x6-unorm" - case astc6x6UnormSrgb = "astc-6x6-unorm-srgb" - case astc8x5Unorm = "astc-8x5-unorm" - case astc8x5UnormSrgb = "astc-8x5-unorm-srgb" - case astc8x6Unorm = "astc-8x6-unorm" - case astc8x6UnormSrgb = "astc-8x6-unorm-srgb" - case astc8x8Unorm = "astc-8x8-unorm" - case astc8x8UnormSrgb = "astc-8x8-unorm-srgb" - case astc10x5Unorm = "astc-10x5-unorm" - case astc10x5UnormSrgb = "astc-10x5-unorm-srgb" - case astc10x6Unorm = "astc-10x6-unorm" - case astc10x6UnormSrgb = "astc-10x6-unorm-srgb" - case astc10x8Unorm = "astc-10x8-unorm" - case astc10x8UnormSrgb = "astc-10x8-unorm-srgb" - case astc10x10Unorm = "astc-10x10-unorm" - case astc10x10UnormSrgb = "astc-10x10-unorm-srgb" - case astc12x10Unorm = "astc-12x10-unorm" - case astc12x10UnormSrgb = "astc-12x10-unorm-srgb" - case astc12x12Unorm = "astc-12x12-unorm" - case astc12x12UnormSrgb = "astc-12x12-unorm-srgb" - - @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/GPUTextureSampleType.swift b/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift deleted file mode 100644 index 23842f06..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureSampleType.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUTextureSampleType: JSString, JSValueCompatible { - case float = "float" - case unfilterableFloat = "unfilterable-float" - case depth = "depth" - case sint = "sint" - case uint = "uint" - - @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/GPUTextureUsage.swift b/Sources/DOMKit/WebIDL/GPUTextureUsage.swift deleted file mode 100644 index aa4462b3..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureUsage.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUTextureUsage { - @inlinable public static var jsObject: JSObject { - JSObject.global[Strings.GPUTextureUsage].object! - } - - public static let COPY_SRC: GPUFlagsConstant = 0x01 - - public static let COPY_DST: GPUFlagsConstant = 0x02 - - public static let TEXTURE_BINDING: GPUFlagsConstant = 0x04 - - public static let STORAGE_BINDING: GPUFlagsConstant = 0x08 - - public static let RENDER_ATTACHMENT: GPUFlagsConstant = 0x10 -} diff --git a/Sources/DOMKit/WebIDL/GPUTextureView.swift b/Sources/DOMKit/WebIDL/GPUTextureView.swift deleted file mode 100644 index 2da5a848..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureView.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUTextureView: JSBridgedClass, GPUObjectBase { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUTextureView].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift b/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift deleted file mode 100644 index cf80ad5a..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureViewDescriptor.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUTextureViewDescriptor: BridgedDictionary { - public convenience init(format: GPUTextureFormat, dimension: GPUTextureViewDimension, aspect: GPUTextureAspect, baseMipLevel: GPUIntegerCoordinate, mipLevelCount: GPUIntegerCoordinate, baseArrayLayer: GPUIntegerCoordinate, arrayLayerCount: GPUIntegerCoordinate) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue - object[Strings.dimension] = dimension.jsValue - object[Strings.aspect] = aspect.jsValue - object[Strings.baseMipLevel] = baseMipLevel.jsValue - object[Strings.mipLevelCount] = mipLevelCount.jsValue - object[Strings.baseArrayLayer] = baseArrayLayer.jsValue - object[Strings.arrayLayerCount] = arrayLayerCount.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _dimension = ReadWriteAttribute(jsObject: object, name: Strings.dimension) - _aspect = ReadWriteAttribute(jsObject: object, name: Strings.aspect) - _baseMipLevel = ReadWriteAttribute(jsObject: object, name: Strings.baseMipLevel) - _mipLevelCount = ReadWriteAttribute(jsObject: object, name: Strings.mipLevelCount) - _baseArrayLayer = ReadWriteAttribute(jsObject: object, name: Strings.baseArrayLayer) - _arrayLayerCount = ReadWriteAttribute(jsObject: object, name: Strings.arrayLayerCount) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var format: GPUTextureFormat - - @ReadWriteAttribute - public var dimension: GPUTextureViewDimension - - @ReadWriteAttribute - public var aspect: GPUTextureAspect - - @ReadWriteAttribute - public var baseMipLevel: GPUIntegerCoordinate - - @ReadWriteAttribute - public var mipLevelCount: GPUIntegerCoordinate - - @ReadWriteAttribute - public var baseArrayLayer: GPUIntegerCoordinate - - @ReadWriteAttribute - public var arrayLayerCount: GPUIntegerCoordinate -} diff --git a/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift b/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift deleted file mode 100644 index 89564fde..00000000 --- a/Sources/DOMKit/WebIDL/GPUTextureViewDimension.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUTextureViewDimension: JSString, JSValueCompatible { - case _1d = "1d" - case _2d = "2d" - case _2dArray = "2d-array" - case cube = "cube" - case cubeArray = "cube-array" - case _3d = "3d" - - @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/GPUUncapturedErrorEvent.swift b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift deleted file mode 100644 index 1c892981..00000000 --- a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUUncapturedErrorEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GPUUncapturedErrorEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, gpuUncapturedErrorEventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var error: GPUError -} diff --git a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift b/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift deleted file mode 100644 index 6b9fbf98..00000000 --- a/Sources/DOMKit/WebIDL/GPUUncapturedErrorEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUUncapturedErrorEventInit: BridgedDictionary { - public convenience init(error: GPUError) { - 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: GPUError -} diff --git a/Sources/DOMKit/WebIDL/GPUValidationError.swift b/Sources/DOMKit/WebIDL/GPUValidationError.swift deleted file mode 100644 index c63d6674..00000000 --- a/Sources/DOMKit/WebIDL/GPUValidationError.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUValidationError: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GPUValidationError].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - self.jsObject = jsObject - } - - @inlinable public convenience init(message: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [message.jsValue])) - } - - @ReadonlyAttribute - public var message: String -} diff --git a/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift b/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift deleted file mode 100644 index 8ffada73..00000000 --- a/Sources/DOMKit/WebIDL/GPUVertexAttribute.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUVertexAttribute: BridgedDictionary { - public convenience init(format: GPUVertexFormat, offset: GPUSize64, shaderLocation: GPUIndex32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue - object[Strings.offset] = offset.jsValue - object[Strings.shaderLocation] = shaderLocation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) - _shaderLocation = ReadWriteAttribute(jsObject: object, name: Strings.shaderLocation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var format: GPUVertexFormat - - @ReadWriteAttribute - public var offset: GPUSize64 - - @ReadWriteAttribute - public var shaderLocation: GPUIndex32 -} diff --git a/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift b/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift deleted file mode 100644 index c604561b..00000000 --- a/Sources/DOMKit/WebIDL/GPUVertexBufferLayout.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUVertexBufferLayout: BridgedDictionary { - public convenience init(arrayStride: GPUSize64, stepMode: GPUVertexStepMode, attributes: [GPUVertexAttribute]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.arrayStride] = arrayStride.jsValue - object[Strings.stepMode] = stepMode.jsValue - object[Strings.attributes] = attributes.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _arrayStride = ReadWriteAttribute(jsObject: object, name: Strings.arrayStride) - _stepMode = ReadWriteAttribute(jsObject: object, name: Strings.stepMode) - _attributes = ReadWriteAttribute(jsObject: object, name: Strings.attributes) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var arrayStride: GPUSize64 - - @ReadWriteAttribute - public var stepMode: GPUVertexStepMode - - @ReadWriteAttribute - public var attributes: [GPUVertexAttribute] -} diff --git a/Sources/DOMKit/WebIDL/GPUVertexFormat.swift b/Sources/DOMKit/WebIDL/GPUVertexFormat.swift deleted file mode 100644 index 16795f3b..00000000 --- a/Sources/DOMKit/WebIDL/GPUVertexFormat.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUVertexFormat: JSString, JSValueCompatible { - case uint8x2 = "uint8x2" - case uint8x4 = "uint8x4" - case sint8x2 = "sint8x2" - case sint8x4 = "sint8x4" - case unorm8x2 = "unorm8x2" - case unorm8x4 = "unorm8x4" - case snorm8x2 = "snorm8x2" - case snorm8x4 = "snorm8x4" - case uint16x2 = "uint16x2" - case uint16x4 = "uint16x4" - case sint16x2 = "sint16x2" - case sint16x4 = "sint16x4" - case unorm16x2 = "unorm16x2" - case unorm16x4 = "unorm16x4" - case snorm16x2 = "snorm16x2" - case snorm16x4 = "snorm16x4" - case float16x2 = "float16x2" - case float16x4 = "float16x4" - case float32 = "float32" - case float32x2 = "float32x2" - case float32x3 = "float32x3" - case float32x4 = "float32x4" - case uint32 = "uint32" - case uint32x2 = "uint32x2" - case uint32x3 = "uint32x3" - case uint32x4 = "uint32x4" - case sint32 = "sint32" - case sint32x2 = "sint32x2" - case sint32x3 = "sint32x3" - case sint32x4 = "sint32x4" - - @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/GPUVertexState.swift b/Sources/DOMKit/WebIDL/GPUVertexState.swift deleted file mode 100644 index 02c4ae77..00000000 --- a/Sources/DOMKit/WebIDL/GPUVertexState.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GPUVertexState: BridgedDictionary { - public convenience init(buffers: [GPUVertexBufferLayout?]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.buffers] = buffers.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _buffers = ReadWriteAttribute(jsObject: object, name: Strings.buffers) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var buffers: [GPUVertexBufferLayout?] -} diff --git a/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift b/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift deleted file mode 100644 index f7661944..00000000 --- a/Sources/DOMKit/WebIDL/GPUVertexStepMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GPUVertexStepMode: JSString, JSValueCompatible { - case vertex = "vertex" - case instance = "instance" - - @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/GainNode.swift b/Sources/DOMKit/WebIDL/GainNode.swift deleted file mode 100644 index 208fe704..00000000 --- a/Sources/DOMKit/WebIDL/GainNode.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GainNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GainNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _gain = ReadonlyAttribute(jsObject: jsObject, name: Strings.gain) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: GainOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var gain: AudioParam -} diff --git a/Sources/DOMKit/WebIDL/GainOptions.swift b/Sources/DOMKit/WebIDL/GainOptions.swift deleted file mode 100644 index 8b1cae58..00000000 --- a/Sources/DOMKit/WebIDL/GainOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GainOptions: BridgedDictionary { - public convenience init(gain: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.gain] = gain.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _gain = ReadWriteAttribute(jsObject: object, name: Strings.gain) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var gain: Float -} diff --git a/Sources/DOMKit/WebIDL/Gamepad.swift b/Sources/DOMKit/WebIDL/Gamepad.swift deleted file mode 100644 index dc05eaa0..00000000 --- a/Sources/DOMKit/WebIDL/Gamepad.swift +++ /dev/null @@ -1,58 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Gamepad: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Gamepad].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) - _hapticActuators = ReadonlyAttribute(jsObject: jsObject, name: Strings.hapticActuators) - _pose = ReadonlyAttribute(jsObject: jsObject, name: Strings.pose) - _touchEvents = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchEvents) - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) - _connected = ReadonlyAttribute(jsObject: jsObject, name: Strings.connected) - _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - _mapping = ReadonlyAttribute(jsObject: jsObject, name: Strings.mapping) - _axes = ReadonlyAttribute(jsObject: jsObject, name: Strings.axes) - _buttons = ReadonlyAttribute(jsObject: jsObject, name: Strings.buttons) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var hand: GamepadHand - - @ReadonlyAttribute - public var hapticActuators: [GamepadHapticActuator] - - @ReadonlyAttribute - public var pose: GamepadPose? - - @ReadonlyAttribute - public var touchEvents: [GamepadTouch]? - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var index: Int32 - - @ReadonlyAttribute - public var connected: Bool - - @ReadonlyAttribute - public var timestamp: DOMHighResTimeStamp - - @ReadonlyAttribute - public var mapping: GamepadMappingType - - @ReadonlyAttribute - public var axes: [Double] - - @ReadonlyAttribute - public var buttons: [GamepadButton] -} diff --git a/Sources/DOMKit/WebIDL/GamepadButton.swift b/Sources/DOMKit/WebIDL/GamepadButton.swift deleted file mode 100644 index 7a7e05e4..00000000 --- a/Sources/DOMKit/WebIDL/GamepadButton.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GamepadButton: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GamepadButton].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _pressed = ReadonlyAttribute(jsObject: jsObject, name: Strings.pressed) - _touched = ReadonlyAttribute(jsObject: jsObject, name: Strings.touched) - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var pressed: Bool - - @ReadonlyAttribute - public var touched: Bool - - @ReadonlyAttribute - public var value: Double -} diff --git a/Sources/DOMKit/WebIDL/GamepadEvent.swift b/Sources/DOMKit/WebIDL/GamepadEvent.swift deleted file mode 100644 index 4aa1c65f..00000000 --- a/Sources/DOMKit/WebIDL/GamepadEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GamepadEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GamepadEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _gamepad = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamepad) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: GamepadEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var gamepad: Gamepad -} diff --git a/Sources/DOMKit/WebIDL/GamepadEventInit.swift b/Sources/DOMKit/WebIDL/GamepadEventInit.swift deleted file mode 100644 index c7eca7cf..00000000 --- a/Sources/DOMKit/WebIDL/GamepadEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GamepadEventInit: BridgedDictionary { - public convenience init(gamepad: Gamepad) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.gamepad] = gamepad.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _gamepad = ReadWriteAttribute(jsObject: object, name: Strings.gamepad) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var gamepad: Gamepad -} diff --git a/Sources/DOMKit/WebIDL/GamepadHand.swift b/Sources/DOMKit/WebIDL/GamepadHand.swift deleted file mode 100644 index 234491dc..00000000 --- a/Sources/DOMKit/WebIDL/GamepadHand.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GamepadHand: JSString, JSValueCompatible { - case _empty = "" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift b/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift deleted file mode 100644 index 73a65fd3..00000000 --- a/Sources/DOMKit/WebIDL/GamepadHapticActuator.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GamepadHapticActuator: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GamepadHapticActuator].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var type: GamepadHapticActuatorType - - @inlinable public func pulse(value: Double, duration: Double) -> JSPromise { - let this = jsObject - return this[Strings.pulse].function!(this: this, arguments: [value.jsValue, duration.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func pulse(value: Double, duration: Double) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.pulse].function!(this: this, arguments: [value.jsValue, duration.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift b/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift deleted file mode 100644 index 070dd2c8..00000000 --- a/Sources/DOMKit/WebIDL/GamepadHapticActuatorType.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GamepadHapticActuatorType: JSString, JSValueCompatible { - case vibration = "vibration" - - @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/GamepadMappingType.swift b/Sources/DOMKit/WebIDL/GamepadMappingType.swift deleted file mode 100644 index 693d1c9e..00000000 --- a/Sources/DOMKit/WebIDL/GamepadMappingType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GamepadMappingType: JSString, JSValueCompatible { - case _empty = "" - case standard = "standard" - case xrStandard = "xr-standard" - - @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/GamepadPose.swift b/Sources/DOMKit/WebIDL/GamepadPose.swift deleted file mode 100644 index de836c8a..00000000 --- a/Sources/DOMKit/WebIDL/GamepadPose.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GamepadPose: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GamepadPose].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _hasOrientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.hasOrientation) - _hasPosition = ReadonlyAttribute(jsObject: jsObject, name: Strings.hasPosition) - _position = ReadonlyAttribute(jsObject: jsObject, name: Strings.position) - _linearVelocity = ReadonlyAttribute(jsObject: jsObject, name: Strings.linearVelocity) - _linearAcceleration = ReadonlyAttribute(jsObject: jsObject, name: Strings.linearAcceleration) - _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) - _angularVelocity = ReadonlyAttribute(jsObject: jsObject, name: Strings.angularVelocity) - _angularAcceleration = ReadonlyAttribute(jsObject: jsObject, name: Strings.angularAcceleration) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var hasOrientation: Bool - - @ReadonlyAttribute - public var hasPosition: Bool - - @ReadonlyAttribute - public var position: Float32Array? - - @ReadonlyAttribute - public var linearVelocity: Float32Array? - - @ReadonlyAttribute - public var linearAcceleration: Float32Array? - - @ReadonlyAttribute - public var orientation: Float32Array? - - @ReadonlyAttribute - public var angularVelocity: Float32Array? - - @ReadonlyAttribute - public var angularAcceleration: Float32Array? -} diff --git a/Sources/DOMKit/WebIDL/GamepadTouch.swift b/Sources/DOMKit/WebIDL/GamepadTouch.swift deleted file mode 100644 index 206867c8..00000000 --- a/Sources/DOMKit/WebIDL/GamepadTouch.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GamepadTouch: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GamepadTouch].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _touchId = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchId) - _surfaceId = ReadonlyAttribute(jsObject: jsObject, name: Strings.surfaceId) - _position = ReadonlyAttribute(jsObject: jsObject, name: Strings.position) - _surfaceDimensions = ReadonlyAttribute(jsObject: jsObject, name: Strings.surfaceDimensions) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var touchId: UInt32 - - @ReadonlyAttribute - public var surfaceId: UInt8 - - @ReadonlyAttribute - public var position: Float32Array - - @ReadonlyAttribute - public var surfaceDimensions: Uint32Array? -} diff --git a/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift b/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift deleted file mode 100644 index 7f810f85..00000000 --- a/Sources/DOMKit/WebIDL/GenerateTestReportParameters.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GenerateTestReportParameters: BridgedDictionary { - public convenience init(message: String, group: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.message] = message.jsValue - object[Strings.group] = group.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _message = ReadWriteAttribute(jsObject: object, name: Strings.message) - _group = ReadWriteAttribute(jsObject: object, name: Strings.group) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var message: String - - @ReadWriteAttribute - public var group: String -} diff --git a/Sources/DOMKit/WebIDL/Geolocation.swift b/Sources/DOMKit/WebIDL/Geolocation.swift deleted file mode 100644 index d6cc1f89..00000000 --- a/Sources/DOMKit/WebIDL/Geolocation.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Geolocation: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Geolocation].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: member 'getCurrentPosition' is ignored - - // XXX: member 'watchPosition' is ignored - - @inlinable public func clearWatch(watchId: Int32) { - let this = jsObject - _ = this[Strings.clearWatch].function!(this: this, arguments: [watchId.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift b/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift deleted file mode 100644 index 4d9e52b2..00000000 --- a/Sources/DOMKit/WebIDL/GeolocationCoordinates.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GeolocationCoordinates: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GeolocationCoordinates].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _accuracy = ReadonlyAttribute(jsObject: jsObject, name: Strings.accuracy) - _latitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.latitude) - _longitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.longitude) - _altitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitude) - _altitudeAccuracy = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitudeAccuracy) - _heading = ReadonlyAttribute(jsObject: jsObject, name: Strings.heading) - _speed = ReadonlyAttribute(jsObject: jsObject, name: Strings.speed) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var accuracy: Double - - @ReadonlyAttribute - public var latitude: Double - - @ReadonlyAttribute - public var longitude: Double - - @ReadonlyAttribute - public var altitude: Double? - - @ReadonlyAttribute - public var altitudeAccuracy: Double? - - @ReadonlyAttribute - public var heading: Double? - - @ReadonlyAttribute - public var speed: Double? -} diff --git a/Sources/DOMKit/WebIDL/GeolocationPosition.swift b/Sources/DOMKit/WebIDL/GeolocationPosition.swift deleted file mode 100644 index 0b479d22..00000000 --- a/Sources/DOMKit/WebIDL/GeolocationPosition.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GeolocationPosition: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GeolocationPosition].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _coords = ReadonlyAttribute(jsObject: jsObject, name: Strings.coords) - _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var coords: GeolocationCoordinates - - @ReadonlyAttribute - public var timestamp: EpochTimeStamp -} diff --git a/Sources/DOMKit/WebIDL/GeolocationPositionError.swift b/Sources/DOMKit/WebIDL/GeolocationPositionError.swift deleted file mode 100644 index 455722eb..00000000 --- a/Sources/DOMKit/WebIDL/GeolocationPositionError.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GeolocationPositionError: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GeolocationPositionError].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - self.jsObject = jsObject - } - - public static let PERMISSION_DENIED: UInt16 = 1 - - public static let POSITION_UNAVAILABLE: UInt16 = 2 - - public static let TIMEOUT: UInt16 = 3 - - @ReadonlyAttribute - public var code: UInt16 - - @ReadonlyAttribute - public var message: String -} diff --git a/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift b/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift deleted file mode 100644 index f11a9a03..00000000 --- a/Sources/DOMKit/WebIDL/GeolocationReadingValues.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GeolocationReadingValues: BridgedDictionary { - public convenience init(latitude: Double?, longitude: Double?, altitude: Double?, accuracy: Double?, altitudeAccuracy: Double?, heading: Double?, speed: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.latitude] = latitude.jsValue - object[Strings.longitude] = longitude.jsValue - object[Strings.altitude] = altitude.jsValue - object[Strings.accuracy] = accuracy.jsValue - object[Strings.altitudeAccuracy] = altitudeAccuracy.jsValue - object[Strings.heading] = heading.jsValue - object[Strings.speed] = speed.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _latitude = ReadWriteAttribute(jsObject: object, name: Strings.latitude) - _longitude = ReadWriteAttribute(jsObject: object, name: Strings.longitude) - _altitude = ReadWriteAttribute(jsObject: object, name: Strings.altitude) - _accuracy = ReadWriteAttribute(jsObject: object, name: Strings.accuracy) - _altitudeAccuracy = ReadWriteAttribute(jsObject: object, name: Strings.altitudeAccuracy) - _heading = ReadWriteAttribute(jsObject: object, name: Strings.heading) - _speed = ReadWriteAttribute(jsObject: object, name: Strings.speed) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var latitude: Double? - - @ReadWriteAttribute - public var longitude: Double? - - @ReadWriteAttribute - public var altitude: Double? - - @ReadWriteAttribute - public var accuracy: Double? - - @ReadWriteAttribute - public var altitudeAccuracy: Double? - - @ReadWriteAttribute - public var heading: Double? - - @ReadWriteAttribute - public var speed: Double? -} diff --git a/Sources/DOMKit/WebIDL/GeolocationSensor.swift b/Sources/DOMKit/WebIDL/GeolocationSensor.swift deleted file mode 100644 index 7631ed93..00000000 --- a/Sources/DOMKit/WebIDL/GeolocationSensor.swift +++ /dev/null @@ -1,56 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GeolocationSensor: Sensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GeolocationSensor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _latitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.latitude) - _longitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.longitude) - _altitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitude) - _accuracy = ReadonlyAttribute(jsObject: jsObject, name: Strings.accuracy) - _altitudeAccuracy = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitudeAccuracy) - _heading = ReadonlyAttribute(jsObject: jsObject, name: Strings.heading) - _speed = ReadonlyAttribute(jsObject: jsObject, name: Strings.speed) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: GeolocationSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @inlinable public static func read(readOptions: ReadOptions? = nil) -> JSPromise { - let this = constructor - return this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func read(readOptions: ReadOptions? = nil) async throws -> GeolocationSensorReading { - let this = constructor - let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: [readOptions?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var latitude: Double? - - @ReadonlyAttribute - public var longitude: Double? - - @ReadonlyAttribute - public var altitude: Double? - - @ReadonlyAttribute - public var accuracy: Double? - - @ReadonlyAttribute - public var altitudeAccuracy: Double? - - @ReadonlyAttribute - public var heading: Double? - - @ReadonlyAttribute - public var speed: Double? -} diff --git a/Sources/DOMKit/WebIDL/GeolocationSensorOptions.swift b/Sources/DOMKit/WebIDL/GeolocationSensorOptions.swift deleted file mode 100644 index 6e2fae2b..00000000 --- a/Sources/DOMKit/WebIDL/GeolocationSensorOptions.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GeolocationSensorOptions: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift b/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift deleted file mode 100644 index 70afa885..00000000 --- a/Sources/DOMKit/WebIDL/GeolocationSensorReading.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GeolocationSensorReading: BridgedDictionary { - public convenience init(timestamp: DOMHighResTimeStamp?, latitude: Double?, longitude: Double?, altitude: Double?, accuracy: Double?, altitudeAccuracy: Double?, heading: Double?, speed: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue - object[Strings.latitude] = latitude.jsValue - object[Strings.longitude] = longitude.jsValue - object[Strings.altitude] = altitude.jsValue - object[Strings.accuracy] = accuracy.jsValue - object[Strings.altitudeAccuracy] = altitudeAccuracy.jsValue - object[Strings.heading] = heading.jsValue - object[Strings.speed] = speed.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _latitude = ReadWriteAttribute(jsObject: object, name: Strings.latitude) - _longitude = ReadWriteAttribute(jsObject: object, name: Strings.longitude) - _altitude = ReadWriteAttribute(jsObject: object, name: Strings.altitude) - _accuracy = ReadWriteAttribute(jsObject: object, name: Strings.accuracy) - _altitudeAccuracy = ReadWriteAttribute(jsObject: object, name: Strings.altitudeAccuracy) - _heading = ReadWriteAttribute(jsObject: object, name: Strings.heading) - _speed = ReadWriteAttribute(jsObject: object, name: Strings.speed) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var timestamp: DOMHighResTimeStamp? - - @ReadWriteAttribute - public var latitude: Double? - - @ReadWriteAttribute - public var longitude: Double? - - @ReadWriteAttribute - public var altitude: Double? - - @ReadWriteAttribute - public var accuracy: Double? - - @ReadWriteAttribute - public var altitudeAccuracy: Double? - - @ReadWriteAttribute - public var heading: Double? - - @ReadWriteAttribute - public var speed: Double? -} diff --git a/Sources/DOMKit/WebIDL/GeometryNode.swift b/Sources/DOMKit/WebIDL/GeometryNode.swift deleted file mode 100644 index d6e19941..00000000 --- a/Sources/DOMKit/WebIDL/GeometryNode.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_GeometryNode: ConvertibleToJSValue {} -extension CSSPseudoElement: Any_GeometryNode {} -extension Document: Any_GeometryNode {} -extension Element: Any_GeometryNode {} -extension Text: Any_GeometryNode {} - -public enum GeometryNode: JSValueCompatible, Any_GeometryNode { - case cSSPseudoElement(CSSPseudoElement) - case document(Document) - case element(Element) - case text(Text) - - public static func construct(from value: JSValue) -> Self? { - if let cSSPseudoElement: CSSPseudoElement = value.fromJSValue() { - return .cSSPseudoElement(cSSPseudoElement) - } - if let document: Document = value.fromJSValue() { - return .document(document) - } - if let element: Element = value.fromJSValue() { - return .element(element) - } - if let text: Text = value.fromJSValue() { - return .text(text) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cSSPseudoElement(cSSPseudoElement): - return cSSPseudoElement.jsValue - case let .document(document): - return document.jsValue - case let .element(element): - return element.jsValue - case let .text(text): - return text.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/GeometryUtils.swift b/Sources/DOMKit/WebIDL/GeometryUtils.swift deleted file mode 100644 index 15114de3..00000000 --- a/Sources/DOMKit/WebIDL/GeometryUtils.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol GeometryUtils: JSBridgedClass {} -public extension GeometryUtils { - @inlinable func getBoxQuads(options: BoxQuadOptions? = nil) -> [DOMQuad] { - let this = jsObject - return this[Strings.getBoxQuads].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable func convertQuadFromNode(quad: DOMQuadInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { - let this = jsObject - return this[Strings.convertQuadFromNode].function!(this: this, arguments: [quad.jsValue, from.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable func convertRectFromNode(rect: DOMRectReadOnly, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMQuad { - let this = jsObject - return this[Strings.convertRectFromNode].function!(this: this, arguments: [rect.jsValue, from.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable func convertPointFromNode(point: DOMPointInit, from: GeometryNode, options: ConvertCoordinateOptions? = nil) -> DOMPoint { - let this = jsObject - return this[Strings.convertPointFromNode].function!(this: this, arguments: [point.jsValue, from.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/GetNotificationOptions.swift b/Sources/DOMKit/WebIDL/GetNotificationOptions.swift deleted file mode 100644 index e6aafdf3..00000000 --- a/Sources/DOMKit/WebIDL/GetNotificationOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GetNotificationOptions: BridgedDictionary { - public convenience init(tag: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.tag] = tag.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _tag = ReadWriteAttribute(jsObject: object, name: Strings.tag) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var tag: String -} diff --git a/Sources/DOMKit/WebIDL/Global.swift b/Sources/DOMKit/WebIDL/Global.swift deleted file mode 100644 index 5f9b9c80..00000000 --- a/Sources/DOMKit/WebIDL/Global.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Global: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Global].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) - self.jsObject = jsObject - } - - @inlinable public convenience init(descriptor: GlobalDescriptor, v: JSValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue, v?.jsValue ?? .undefined])) - } - - @inlinable public func valueOf() -> JSValue { - let this = jsObject - return this[Strings.valueOf].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadWriteAttribute - public var value: JSValue -} diff --git a/Sources/DOMKit/WebIDL/GlobalDescriptor.swift b/Sources/DOMKit/WebIDL/GlobalDescriptor.swift deleted file mode 100644 index e28a77ad..00000000 --- a/Sources/DOMKit/WebIDL/GlobalDescriptor.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GlobalDescriptor: BridgedDictionary { - public convenience init(value: ValueType, mutable: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.value] = value.jsValue - object[Strings.mutable] = mutable.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _value = ReadWriteAttribute(jsObject: object, name: Strings.value) - _mutable = ReadWriteAttribute(jsObject: object, name: Strings.mutable) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var value: ValueType - - @ReadWriteAttribute - public var mutable: Bool -} diff --git a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift index 5a9d8fff..b2acb292 100644 --- a/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/GlobalEventHandlers.swift @@ -5,46 +5,6 @@ import JavaScriptKit public protocol GlobalEventHandlers: JSBridgedClass {} public extension GlobalEventHandlers { - @inlinable var onanimationstart: EventHandler { - get { ClosureAttribute1Optional[Strings.onanimationstart, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onanimationstart, in: jsObject] = newValue } - } - - @inlinable var onanimationiteration: EventHandler { - get { ClosureAttribute1Optional[Strings.onanimationiteration, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onanimationiteration, in: jsObject] = newValue } - } - - @inlinable var onanimationend: EventHandler { - get { ClosureAttribute1Optional[Strings.onanimationend, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onanimationend, in: jsObject] = newValue } - } - - @inlinable var onanimationcancel: EventHandler { - get { ClosureAttribute1Optional[Strings.onanimationcancel, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onanimationcancel, in: jsObject] = newValue } - } - - @inlinable var ontransitionrun: EventHandler { - get { ClosureAttribute1Optional[Strings.ontransitionrun, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ontransitionrun, in: jsObject] = newValue } - } - - @inlinable var ontransitionstart: EventHandler { - get { ClosureAttribute1Optional[Strings.ontransitionstart, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ontransitionstart, in: jsObject] = newValue } - } - - @inlinable var ontransitionend: EventHandler { - get { ClosureAttribute1Optional[Strings.ontransitionend, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ontransitionend, in: jsObject] = newValue } - } - - @inlinable var ontransitioncancel: EventHandler { - get { ClosureAttribute1Optional[Strings.ontransitioncancel, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ontransitioncancel, in: jsObject] = newValue } - } - @inlinable var onabort: EventHandler { get { ClosureAttribute1Optional[Strings.onabort, in: jsObject] } nonmutating set { ClosureAttribute1Optional[Strings.onabort, in: jsObject] = newValue } @@ -384,94 +344,4 @@ public extension GlobalEventHandlers { get { ClosureAttribute1Optional[Strings.onwheel, in: jsObject] } nonmutating set { ClosureAttribute1Optional[Strings.onwheel, in: jsObject] = newValue } } - - @inlinable var ongotpointercapture: EventHandler { - get { ClosureAttribute1Optional[Strings.ongotpointercapture, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ongotpointercapture, in: jsObject] = newValue } - } - - @inlinable var onlostpointercapture: EventHandler { - get { ClosureAttribute1Optional[Strings.onlostpointercapture, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onlostpointercapture, in: jsObject] = newValue } - } - - @inlinable var onpointerdown: EventHandler { - get { ClosureAttribute1Optional[Strings.onpointerdown, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onpointerdown, in: jsObject] = newValue } - } - - @inlinable var onpointermove: EventHandler { - get { ClosureAttribute1Optional[Strings.onpointermove, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onpointermove, in: jsObject] = newValue } - } - - @inlinable var onpointerrawupdate: EventHandler { - get { ClosureAttribute1Optional[Strings.onpointerrawupdate, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onpointerrawupdate, in: jsObject] = newValue } - } - - @inlinable var onpointerup: EventHandler { - get { ClosureAttribute1Optional[Strings.onpointerup, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onpointerup, in: jsObject] = newValue } - } - - @inlinable var onpointercancel: EventHandler { - get { ClosureAttribute1Optional[Strings.onpointercancel, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onpointercancel, in: jsObject] = newValue } - } - - @inlinable var onpointerover: EventHandler { - get { ClosureAttribute1Optional[Strings.onpointerover, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onpointerover, in: jsObject] = newValue } - } - - @inlinable var onpointerout: EventHandler { - get { ClosureAttribute1Optional[Strings.onpointerout, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onpointerout, in: jsObject] = newValue } - } - - @inlinable var onpointerenter: EventHandler { - get { ClosureAttribute1Optional[Strings.onpointerenter, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onpointerenter, in: jsObject] = newValue } - } - - @inlinable var onpointerleave: EventHandler { - get { ClosureAttribute1Optional[Strings.onpointerleave, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onpointerleave, in: jsObject] = newValue } - } - - @inlinable var onselectstart: EventHandler { - get { ClosureAttribute1Optional[Strings.onselectstart, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onselectstart, in: jsObject] = newValue } - } - - @inlinable var onselectionchange: EventHandler { - get { ClosureAttribute1Optional[Strings.onselectionchange, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onselectionchange, in: jsObject] = newValue } - } - - @inlinable var ontouchstart: EventHandler { - get { ClosureAttribute1Optional[Strings.ontouchstart, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ontouchstart, in: jsObject] = newValue } - } - - @inlinable var ontouchend: EventHandler { - get { ClosureAttribute1Optional[Strings.ontouchend, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ontouchend, in: jsObject] = newValue } - } - - @inlinable var ontouchmove: EventHandler { - get { ClosureAttribute1Optional[Strings.ontouchmove, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ontouchmove, in: jsObject] = newValue } - } - - @inlinable var ontouchcancel: EventHandler { - get { ClosureAttribute1Optional[Strings.ontouchcancel, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ontouchcancel, in: jsObject] = newValue } - } - - @inlinable var onbeforexrselect: EventHandler { - get { ClosureAttribute1Optional[Strings.onbeforexrselect, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onbeforexrselect, in: jsObject] = newValue } - } } diff --git a/Sources/DOMKit/WebIDL/GravityReadingValues.swift b/Sources/DOMKit/WebIDL/GravityReadingValues.swift deleted file mode 100644 index 3b1c9368..00000000 --- a/Sources/DOMKit/WebIDL/GravityReadingValues.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GravityReadingValues: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/GravitySensor.swift b/Sources/DOMKit/WebIDL/GravitySensor.swift deleted file mode 100644 index 9001b94b..00000000 --- a/Sources/DOMKit/WebIDL/GravitySensor.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GravitySensor: Accelerometer { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.GravitySensor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: AccelerometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } -} diff --git a/Sources/DOMKit/WebIDL/GroupEffect.swift b/Sources/DOMKit/WebIDL/GroupEffect.swift deleted file mode 100644 index 572aed39..00000000 --- a/Sources/DOMKit/WebIDL/GroupEffect.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GroupEffect: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.GroupEffect].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _children = ReadonlyAttribute(jsObject: jsObject, name: Strings.children) - _firstChild = ReadonlyAttribute(jsObject: jsObject, name: Strings.firstChild) - _lastChild = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastChild) - self.jsObject = jsObject - } - - @inlinable public convenience init(children: [AnimationEffect]?, timing: Double_or_EffectTiming? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue, timing?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var children: AnimationNodeList - - @ReadonlyAttribute - public var firstChild: AnimationEffect? - - @ReadonlyAttribute - public var lastChild: AnimationEffect? - - @inlinable public func clone() -> Self { - let this = jsObject - return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func prepend(effects: AnimationEffect...) { - let this = jsObject - _ = this[Strings.prepend].function!(this: this, arguments: effects.map(\.jsValue)) - } - - @inlinable public func append(effects: AnimationEffect...) { - let this = jsObject - _ = this[Strings.append].function!(this: this, arguments: effects.map(\.jsValue)) - } -} diff --git a/Sources/DOMKit/WebIDL/Gyroscope.swift b/Sources/DOMKit/WebIDL/Gyroscope.swift deleted file mode 100644 index 61aefc8c..00000000 --- a/Sources/DOMKit/WebIDL/Gyroscope.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Gyroscope: Sensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Gyroscope].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(sensorOptions: GyroscopeSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var x: Double? - - @ReadonlyAttribute - public var y: Double? - - @ReadonlyAttribute - public var z: Double? -} diff --git a/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift deleted file mode 100644 index ec3d03a8..00000000 --- a/Sources/DOMKit/WebIDL/GyroscopeLocalCoordinateSystem.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum GyroscopeLocalCoordinateSystem: JSString, JSValueCompatible { - case device = "device" - case screen = "screen" - - @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/GyroscopeReadingValues.swift b/Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift deleted file mode 100644 index a990ad4e..00000000 --- a/Sources/DOMKit/WebIDL/GyroscopeReadingValues.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GyroscopeReadingValues: BridgedDictionary { - public convenience init(x: Double?, y: Double?, z: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - object[Strings.z] = z.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - _z = ReadWriteAttribute(jsObject: object, name: Strings.z) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var x: Double? - - @ReadWriteAttribute - public var y: Double? - - @ReadWriteAttribute - public var z: Double? -} diff --git a/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift b/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift deleted file mode 100644 index 2f5f5971..00000000 --- a/Sources/DOMKit/WebIDL/GyroscopeSensorOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class GyroscopeSensorOptions: BridgedDictionary { - public convenience init(referenceFrame: GyroscopeLocalCoordinateSystem) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceFrame] = referenceFrame.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _referenceFrame = ReadWriteAttribute(jsObject: object, name: Strings.referenceFrame) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var referenceFrame: GyroscopeLocalCoordinateSystem -} diff --git a/Sources/DOMKit/WebIDL/HID.swift b/Sources/DOMKit/WebIDL/HID.swift deleted file mode 100644 index 0bdae77a..00000000 --- a/Sources/DOMKit/WebIDL/HID.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HID: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HID].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var onconnect: EventHandler - - @ClosureAttribute1Optional - public var ondisconnect: EventHandler - - @inlinable public func getDevices() -> JSPromise { - let this = jsObject - return this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDevices() async throws -> [HIDDevice] { - let this = jsObject - let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func requestDevice(options: HIDDeviceRequestOptions) -> JSPromise { - let this = jsObject - return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestDevice(options: HIDDeviceRequestOptions) async throws -> [HIDDevice] { - let this = jsObject - let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift b/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift deleted file mode 100644 index 4133627c..00000000 --- a/Sources/DOMKit/WebIDL/HIDCollectionInfo.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDCollectionInfo: BridgedDictionary { - public convenience init(usagePage: UInt16, usage: UInt16, type: UInt8, children: [HIDCollectionInfo], inputReports: [HIDReportInfo], outputReports: [HIDReportInfo], featureReports: [HIDReportInfo]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usagePage] = usagePage.jsValue - object[Strings.usage] = usage.jsValue - object[Strings.type] = type.jsValue - object[Strings.children] = children.jsValue - object[Strings.inputReports] = inputReports.jsValue - object[Strings.outputReports] = outputReports.jsValue - object[Strings.featureReports] = featureReports.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _usagePage = ReadWriteAttribute(jsObject: object, name: Strings.usagePage) - _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _children = ReadWriteAttribute(jsObject: object, name: Strings.children) - _inputReports = ReadWriteAttribute(jsObject: object, name: Strings.inputReports) - _outputReports = ReadWriteAttribute(jsObject: object, name: Strings.outputReports) - _featureReports = ReadWriteAttribute(jsObject: object, name: Strings.featureReports) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var usagePage: UInt16 - - @ReadWriteAttribute - public var usage: UInt16 - - @ReadWriteAttribute - public var type: UInt8 - - @ReadWriteAttribute - public var children: [HIDCollectionInfo] - - @ReadWriteAttribute - public var inputReports: [HIDReportInfo] - - @ReadWriteAttribute - public var outputReports: [HIDReportInfo] - - @ReadWriteAttribute - public var featureReports: [HIDReportInfo] -} diff --git a/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift b/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift deleted file mode 100644 index 8f275214..00000000 --- a/Sources/DOMKit/WebIDL/HIDConnectionEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDConnectionEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HIDConnectionEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: HIDConnectionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var device: HIDDevice -} diff --git a/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift b/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift deleted file mode 100644 index 1fe446a5..00000000 --- a/Sources/DOMKit/WebIDL/HIDConnectionEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDConnectionEventInit: BridgedDictionary { - public convenience init(device: HIDDevice) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _device = ReadWriteAttribute(jsObject: object, name: Strings.device) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var device: HIDDevice -} diff --git a/Sources/DOMKit/WebIDL/HIDDevice.swift b/Sources/DOMKit/WebIDL/HIDDevice.swift deleted file mode 100644 index b4c36089..00000000 --- a/Sources/DOMKit/WebIDL/HIDDevice.swift +++ /dev/null @@ -1,108 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDDevice: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HIDDevice].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _oninputreport = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oninputreport) - _opened = ReadonlyAttribute(jsObject: jsObject, name: Strings.opened) - _vendorId = ReadonlyAttribute(jsObject: jsObject, name: Strings.vendorId) - _productId = ReadonlyAttribute(jsObject: jsObject, name: Strings.productId) - _productName = ReadonlyAttribute(jsObject: jsObject, name: Strings.productName) - _collections = ReadonlyAttribute(jsObject: jsObject, name: Strings.collections) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var oninputreport: EventHandler - - @ReadonlyAttribute - public var opened: Bool - - @ReadonlyAttribute - public var vendorId: UInt16 - - @ReadonlyAttribute - public var productId: UInt16 - - @ReadonlyAttribute - public var productName: String - - @ReadonlyAttribute - public var collections: [HIDCollectionInfo] - - @inlinable public func open() -> JSPromise { - let this = jsObject - return this[Strings.open].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func open() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).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 forget() -> JSPromise { - let this = jsObject - return this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func forget() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func sendReport(reportId: UInt8, data: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue, data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func sendReport(reportId: UInt8, data: BufferSource) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.sendReport].function!(this: this, arguments: [reportId.jsValue, data.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func sendFeatureReport(reportId: UInt8, data: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue, data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func sendFeatureReport(reportId: UInt8, data: BufferSource) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.sendFeatureReport].function!(this: this, arguments: [reportId.jsValue, data.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func receiveFeatureReport(reportId: UInt8) -> JSPromise { - let this = jsObject - return this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func receiveFeatureReport(reportId: UInt8) async throws -> DataView { - let this = jsObject - let _promise: JSPromise = this[Strings.receiveFeatureReport].function!(this: this, arguments: [reportId.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift b/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift deleted file mode 100644 index c4ebeb6f..00000000 --- a/Sources/DOMKit/WebIDL/HIDDeviceFilter.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDDeviceFilter: BridgedDictionary { - public convenience init(vendorId: UInt32, productId: UInt16, usagePage: UInt16, usage: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.vendorId] = vendorId.jsValue - object[Strings.productId] = productId.jsValue - object[Strings.usagePage] = usagePage.jsValue - object[Strings.usage] = usage.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _vendorId = ReadWriteAttribute(jsObject: object, name: Strings.vendorId) - _productId = ReadWriteAttribute(jsObject: object, name: Strings.productId) - _usagePage = ReadWriteAttribute(jsObject: object, name: Strings.usagePage) - _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var vendorId: UInt32 - - @ReadWriteAttribute - public var productId: UInt16 - - @ReadWriteAttribute - public var usagePage: UInt16 - - @ReadWriteAttribute - public var usage: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift b/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift deleted file mode 100644 index f9a6b80e..00000000 --- a/Sources/DOMKit/WebIDL/HIDDeviceRequestOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDDeviceRequestOptions: BridgedDictionary { - public convenience init(filters: [HIDDeviceFilter]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var filters: [HIDDeviceFilter] -} diff --git a/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift b/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift deleted file mode 100644 index 96da0a55..00000000 --- a/Sources/DOMKit/WebIDL/HIDInputReportEvent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDInputReportEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HIDInputReportEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) - _reportId = ReadonlyAttribute(jsObject: jsObject, name: Strings.reportId) - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: HIDInputReportEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var device: HIDDevice - - @ReadonlyAttribute - public var reportId: UInt8 - - @ReadonlyAttribute - public var data: DataView -} diff --git a/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift b/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift deleted file mode 100644 index 57aeb14f..00000000 --- a/Sources/DOMKit/WebIDL/HIDInputReportEventInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDInputReportEventInit: BridgedDictionary { - public convenience init(device: HIDDevice, reportId: UInt8, data: DataView) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue - object[Strings.reportId] = reportId.jsValue - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _device = ReadWriteAttribute(jsObject: object, name: Strings.device) - _reportId = ReadWriteAttribute(jsObject: object, name: Strings.reportId) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var device: HIDDevice - - @ReadWriteAttribute - public var reportId: UInt8 - - @ReadWriteAttribute - public var data: DataView -} diff --git a/Sources/DOMKit/WebIDL/HIDReportInfo.swift b/Sources/DOMKit/WebIDL/HIDReportInfo.swift deleted file mode 100644 index 09d048f7..00000000 --- a/Sources/DOMKit/WebIDL/HIDReportInfo.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDReportInfo: BridgedDictionary { - public convenience init(reportId: UInt8, items: [HIDReportItem]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.reportId] = reportId.jsValue - object[Strings.items] = items.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _reportId = ReadWriteAttribute(jsObject: object, name: Strings.reportId) - _items = ReadWriteAttribute(jsObject: object, name: Strings.items) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var reportId: UInt8 - - @ReadWriteAttribute - public var items: [HIDReportItem] -} diff --git a/Sources/DOMKit/WebIDL/HIDReportItem.swift b/Sources/DOMKit/WebIDL/HIDReportItem.swift deleted file mode 100644 index 1fe61d6a..00000000 --- a/Sources/DOMKit/WebIDL/HIDReportItem.swift +++ /dev/null @@ -1,155 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HIDReportItem: BridgedDictionary { - public convenience init(isAbsolute: Bool, isArray: Bool, isBufferedBytes: Bool, isConstant: Bool, isLinear: Bool, isRange: Bool, isVolatile: Bool, hasNull: Bool, hasPreferredState: Bool, wrap: Bool, usages: [UInt32], usageMinimum: UInt32, usageMaximum: UInt32, reportSize: UInt16, reportCount: UInt16, unitExponent: Int8, unitSystem: HIDUnitSystem, unitFactorLengthExponent: Int8, unitFactorMassExponent: Int8, unitFactorTimeExponent: Int8, unitFactorTemperatureExponent: Int8, unitFactorCurrentExponent: Int8, unitFactorLuminousIntensityExponent: Int8, logicalMinimum: Int32, logicalMaximum: Int32, physicalMinimum: Int32, physicalMaximum: Int32, strings: [String]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.isAbsolute] = isAbsolute.jsValue - object[Strings.isArray] = isArray.jsValue - object[Strings.isBufferedBytes] = isBufferedBytes.jsValue - object[Strings.isConstant] = isConstant.jsValue - object[Strings.isLinear] = isLinear.jsValue - object[Strings.isRange] = isRange.jsValue - object[Strings.isVolatile] = isVolatile.jsValue - object[Strings.hasNull] = hasNull.jsValue - object[Strings.hasPreferredState] = hasPreferredState.jsValue - object[Strings.wrap] = wrap.jsValue - object[Strings.usages] = usages.jsValue - object[Strings.usageMinimum] = usageMinimum.jsValue - object[Strings.usageMaximum] = usageMaximum.jsValue - object[Strings.reportSize] = reportSize.jsValue - object[Strings.reportCount] = reportCount.jsValue - object[Strings.unitExponent] = unitExponent.jsValue - object[Strings.unitSystem] = unitSystem.jsValue - object[Strings.unitFactorLengthExponent] = unitFactorLengthExponent.jsValue - object[Strings.unitFactorMassExponent] = unitFactorMassExponent.jsValue - object[Strings.unitFactorTimeExponent] = unitFactorTimeExponent.jsValue - object[Strings.unitFactorTemperatureExponent] = unitFactorTemperatureExponent.jsValue - object[Strings.unitFactorCurrentExponent] = unitFactorCurrentExponent.jsValue - object[Strings.unitFactorLuminousIntensityExponent] = unitFactorLuminousIntensityExponent.jsValue - object[Strings.logicalMinimum] = logicalMinimum.jsValue - object[Strings.logicalMaximum] = logicalMaximum.jsValue - object[Strings.physicalMinimum] = physicalMinimum.jsValue - object[Strings.physicalMaximum] = physicalMaximum.jsValue - object[Strings.strings] = strings.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _isAbsolute = ReadWriteAttribute(jsObject: object, name: Strings.isAbsolute) - _isArray = ReadWriteAttribute(jsObject: object, name: Strings.isArray) - _isBufferedBytes = ReadWriteAttribute(jsObject: object, name: Strings.isBufferedBytes) - _isConstant = ReadWriteAttribute(jsObject: object, name: Strings.isConstant) - _isLinear = ReadWriteAttribute(jsObject: object, name: Strings.isLinear) - _isRange = ReadWriteAttribute(jsObject: object, name: Strings.isRange) - _isVolatile = ReadWriteAttribute(jsObject: object, name: Strings.isVolatile) - _hasNull = ReadWriteAttribute(jsObject: object, name: Strings.hasNull) - _hasPreferredState = ReadWriteAttribute(jsObject: object, name: Strings.hasPreferredState) - _wrap = ReadWriteAttribute(jsObject: object, name: Strings.wrap) - _usages = ReadWriteAttribute(jsObject: object, name: Strings.usages) - _usageMinimum = ReadWriteAttribute(jsObject: object, name: Strings.usageMinimum) - _usageMaximum = ReadWriteAttribute(jsObject: object, name: Strings.usageMaximum) - _reportSize = ReadWriteAttribute(jsObject: object, name: Strings.reportSize) - _reportCount = ReadWriteAttribute(jsObject: object, name: Strings.reportCount) - _unitExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitExponent) - _unitSystem = ReadWriteAttribute(jsObject: object, name: Strings.unitSystem) - _unitFactorLengthExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorLengthExponent) - _unitFactorMassExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorMassExponent) - _unitFactorTimeExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorTimeExponent) - _unitFactorTemperatureExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorTemperatureExponent) - _unitFactorCurrentExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorCurrentExponent) - _unitFactorLuminousIntensityExponent = ReadWriteAttribute(jsObject: object, name: Strings.unitFactorLuminousIntensityExponent) - _logicalMinimum = ReadWriteAttribute(jsObject: object, name: Strings.logicalMinimum) - _logicalMaximum = ReadWriteAttribute(jsObject: object, name: Strings.logicalMaximum) - _physicalMinimum = ReadWriteAttribute(jsObject: object, name: Strings.physicalMinimum) - _physicalMaximum = ReadWriteAttribute(jsObject: object, name: Strings.physicalMaximum) - _strings = ReadWriteAttribute(jsObject: object, name: Strings.strings) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var isAbsolute: Bool - - @ReadWriteAttribute - public var isArray: Bool - - @ReadWriteAttribute - public var isBufferedBytes: Bool - - @ReadWriteAttribute - public var isConstant: Bool - - @ReadWriteAttribute - public var isLinear: Bool - - @ReadWriteAttribute - public var isRange: Bool - - @ReadWriteAttribute - public var isVolatile: Bool - - @ReadWriteAttribute - public var hasNull: Bool - - @ReadWriteAttribute - public var hasPreferredState: Bool - - @ReadWriteAttribute - public var wrap: Bool - - @ReadWriteAttribute - public var usages: [UInt32] - - @ReadWriteAttribute - public var usageMinimum: UInt32 - - @ReadWriteAttribute - public var usageMaximum: UInt32 - - @ReadWriteAttribute - public var reportSize: UInt16 - - @ReadWriteAttribute - public var reportCount: UInt16 - - @ReadWriteAttribute - public var unitExponent: Int8 - - @ReadWriteAttribute - public var unitSystem: HIDUnitSystem - - @ReadWriteAttribute - public var unitFactorLengthExponent: Int8 - - @ReadWriteAttribute - public var unitFactorMassExponent: Int8 - - @ReadWriteAttribute - public var unitFactorTimeExponent: Int8 - - @ReadWriteAttribute - public var unitFactorTemperatureExponent: Int8 - - @ReadWriteAttribute - public var unitFactorCurrentExponent: Int8 - - @ReadWriteAttribute - public var unitFactorLuminousIntensityExponent: Int8 - - @ReadWriteAttribute - public var logicalMinimum: Int32 - - @ReadWriteAttribute - public var logicalMaximum: Int32 - - @ReadWriteAttribute - public var physicalMinimum: Int32 - - @ReadWriteAttribute - public var physicalMaximum: Int32 - - @ReadWriteAttribute - public var strings: [String] -} diff --git a/Sources/DOMKit/WebIDL/HIDUnitSystem.swift b/Sources/DOMKit/WebIDL/HIDUnitSystem.swift deleted file mode 100644 index d89d8b55..00000000 --- a/Sources/DOMKit/WebIDL/HIDUnitSystem.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum HIDUnitSystem: JSString, JSValueCompatible { - case none = "none" - case siLinear = "si-linear" - case siRotation = "si-rotation" - case englishLinear = "english-linear" - case englishRotation = "english-rotation" - case vendorDefined = "vendor-defined" - case reserved = "reserved" - - @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/HTMLAnchorElement.swift b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift index ba35dbfe..be82d0bf 100644 --- a/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLAnchorElement.swift @@ -7,12 +7,6 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLAnchorElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _attributionDestination = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionDestination) - _attributionSourceEventId = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionSourceEventId) - _attributionReportTo = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionReportTo) - _attributionExpiry = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionExpiry) - _attributionSourcePriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionSourcePriority) - _registerAttributionSource = ReadWriteAttribute(jsObject: jsObject, name: Strings.registerAttributionSource) _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) _download = ReadWriteAttribute(jsObject: jsObject, name: Strings.download) _ping = ReadWriteAttribute(jsObject: jsObject, name: Strings.ping) @@ -27,28 +21,9 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) _rev = ReadWriteAttribute(jsObject: jsObject, name: Strings.rev) _shape = ReadWriteAttribute(jsObject: jsObject, name: Strings.shape) - _attributionSourceId = ReadWriteAttribute(jsObject: jsObject, name: Strings.attributionSourceId) super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var attributionDestination: String - - @ReadWriteAttribute - public var attributionSourceEventId: String - - @ReadWriteAttribute - public var attributionReportTo: String - - @ReadWriteAttribute - public var attributionExpiry: Int64 - - @ReadWriteAttribute - public var attributionSourcePriority: Int64 - - @ReadWriteAttribute - public var registerAttributionSource: Bool - @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -94,7 +69,4 @@ public class HTMLAnchorElement: HTMLElement, HTMLHyperlinkElementUtils { @ReadWriteAttribute public var shape: String - - @ReadWriteAttribute - public var attributionSourceId: UInt32 } diff --git a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift index e762c9cc..2597a3cb 100644 --- a/Sources/DOMKit/WebIDL/HTMLBodyElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLBodyElement.swift @@ -7,7 +7,6 @@ public class HTMLBodyElement: HTMLElement, WindowEventHandlers { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLBodyElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _onorientationchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onorientationchange) _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) _link = ReadWriteAttribute(jsObject: jsObject, name: Strings.link) _vLink = ReadWriteAttribute(jsObject: jsObject, name: Strings.vLink) @@ -17,9 +16,6 @@ public class HTMLBodyElement: HTMLElement, WindowEventHandlers { super.init(unsafelyWrapping: jsObject) } - @ClosureAttribute1Optional - public var onorientationchange: EventHandler - @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift index b052e833..6d29b873 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement.swift @@ -38,9 +38,4 @@ public class HTMLCanvasElement: HTMLElement { let this = jsObject return this[Strings.transferControlToOffscreen].function!(this: this, arguments: []).fromJSValue()! } - - @inlinable public func captureStream(frameRequestRate: Double? = nil) -> MediaStream { - let this = jsObject - return this[Strings.captureStream].function!(this: this, arguments: [frameRequestRate?.jsValue ?? .undefined]).fromJSValue()! - } } diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift deleted file mode 100644 index cfba1dc1..00000000 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas: ConvertibleToJSValue {} -extension HTMLCanvasElement: Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas {} -extension ImageBitmap: Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas {} -extension OffscreenCanvas: Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas {} - -public enum HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas: JSValueCompatible, Any_HTMLCanvasElement_or_ImageBitmap_or_OffscreenCanvas { - case hTMLCanvasElement(HTMLCanvasElement) - case imageBitmap(ImageBitmap) - case offscreenCanvas(OffscreenCanvas) - - public static func construct(from value: JSValue) -> Self? { - if let hTMLCanvasElement: HTMLCanvasElement = value.fromJSValue() { - return .hTMLCanvasElement(hTMLCanvasElement) - } - if let imageBitmap: ImageBitmap = value.fromJSValue() { - return .imageBitmap(imageBitmap) - } - if let offscreenCanvas: OffscreenCanvas = value.fromJSValue() { - return .offscreenCanvas(offscreenCanvas) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .hTMLCanvasElement(hTMLCanvasElement): - return hTMLCanvasElement.jsValue - case let .imageBitmap(imageBitmap): - return imageBitmap.jsValue - case let .offscreenCanvas(offscreenCanvas): - return offscreenCanvas.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift index 385dbfd9..7ff34aad 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift @@ -8,12 +8,12 @@ extension HTMLCanvasElement: Any_HTMLCanvasElement_or_OffscreenCanvas {} extension OffscreenCanvas: Any_HTMLCanvasElement_or_OffscreenCanvas {} public enum HTMLCanvasElement_or_OffscreenCanvas: JSValueCompatible, Any_HTMLCanvasElement_or_OffscreenCanvas { - case hTMLCanvasElement(HTMLCanvasElement) + case htmlCanvasElement(HTMLCanvasElement) case offscreenCanvas(OffscreenCanvas) public static func construct(from value: JSValue) -> Self? { - if let hTMLCanvasElement: HTMLCanvasElement = value.fromJSValue() { - return .hTMLCanvasElement(hTMLCanvasElement) + if let htmlCanvasElement: HTMLCanvasElement = value.fromJSValue() { + return .htmlCanvasElement(htmlCanvasElement) } if let offscreenCanvas: OffscreenCanvas = value.fromJSValue() { return .offscreenCanvas(offscreenCanvas) @@ -23,8 +23,8 @@ public enum HTMLCanvasElement_or_OffscreenCanvas: JSValueCompatible, Any_HTMLCan public var jsValue: JSValue { switch self { - case let .hTMLCanvasElement(hTMLCanvasElement): - return hTMLCanvasElement.jsValue + case let .htmlCanvasElement(htmlCanvasElement): + return htmlCanvasElement.jsValue case let .offscreenCanvas(offscreenCanvas): return offscreenCanvas.jsValue } diff --git a/Sources/DOMKit/WebIDL/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index 24d2acfb..fe44ca3d 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -7,11 +7,6 @@ public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, D @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _offsetParent = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetParent) - _offsetTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetTop) - _offsetLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetLeft) - _offsetWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetWidth) - _offsetHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetHeight) _title = ReadWriteAttribute(jsObject: jsObject, name: Strings.title) _lang = ReadWriteAttribute(jsObject: jsObject, name: Strings.lang) _translate = ReadWriteAttribute(jsObject: jsObject, name: Strings.translate) @@ -28,21 +23,6 @@ public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, D super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var offsetParent: Element? - - @ReadonlyAttribute - public var offsetTop: Int32 - - @ReadonlyAttribute - public var offsetLeft: Int32 - - @ReadonlyAttribute - public var offsetWidth: Int32 - - @ReadonlyAttribute - public var offsetHeight: Int32 - @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift b/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift index 805aa826..9b81f44a 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift @@ -8,12 +8,12 @@ extension HTMLElement: Any_HTMLElement_or_Int32 {} extension Int32: Any_HTMLElement_or_Int32 {} public enum HTMLElement_or_Int32: JSValueCompatible, Any_HTMLElement_or_Int32 { - case hTMLElement(HTMLElement) + case htmlElement(HTMLElement) case int32(Int32) public static func construct(from value: JSValue) -> Self? { - if let hTMLElement: HTMLElement = value.fromJSValue() { - return .hTMLElement(hTMLElement) + if let htmlElement: HTMLElement = value.fromJSValue() { + return .htmlElement(htmlElement) } if let int32: Int32 = value.fromJSValue() { return .int32(int32) @@ -23,8 +23,8 @@ public enum HTMLElement_or_Int32: JSValueCompatible, Any_HTMLElement_or_Int32 { public var jsValue: JSValue { switch self { - case let .hTMLElement(hTMLElement): - return hTMLElement.jsValue + case let .htmlElement(htmlElement): + return htmlElement.jsValue case let .int32(int32): return int32.jsValue } diff --git a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift index bd86624c..3f2be596 100644 --- a/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLIFrameElement.swift @@ -7,7 +7,6 @@ public class HTMLIFrameElement: HTMLElement { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLIFrameElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _csp = ReadWriteAttribute(jsObject: jsObject, name: Strings.csp) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcdoc = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcdoc) _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) @@ -26,14 +25,9 @@ public class HTMLIFrameElement: HTMLElement { _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Strings.longDesc) _marginHeight = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginHeight) _marginWidth = ReadWriteAttribute(jsObject: jsObject, name: Strings.marginWidth) - _permissionsPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissionsPolicy) - _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var csp: String - @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -96,10 +90,4 @@ public class HTMLIFrameElement: HTMLElement { @ReadWriteAttribute public var marginWidth: String - - @ReadonlyAttribute - public var permissionsPolicy: PermissionsPolicy - - @ReadWriteAttribute - public var fetchpriority: String } diff --git a/Sources/DOMKit/WebIDL/HTMLImageElement.swift b/Sources/DOMKit/WebIDL/HTMLImageElement.swift index e4e347f3..6fb16310 100644 --- a/Sources/DOMKit/WebIDL/HTMLImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLImageElement.swift @@ -7,8 +7,6 @@ public class HTMLImageElement: HTMLElement { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLImageElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcset = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcset) @@ -32,16 +30,9 @@ public class HTMLImageElement: HTMLElement { _vspace = ReadWriteAttribute(jsObject: jsObject, name: Strings.vspace) _longDesc = ReadWriteAttribute(jsObject: jsObject, name: Strings.longDesc) _border = ReadWriteAttribute(jsObject: jsObject, name: Strings.border) - _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var x: Int32 - - @ReadonlyAttribute - public var y: Int32 - @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } @@ -126,7 +117,4 @@ public class HTMLImageElement: HTMLElement { @ReadWriteAttribute public var border: String - - @ReadWriteAttribute - public var fetchpriority: String } diff --git a/Sources/DOMKit/WebIDL/HTMLInputElement.swift b/Sources/DOMKit/WebIDL/HTMLInputElement.swift index 0d234703..d20d436e 100644 --- a/Sources/DOMKit/WebIDL/HTMLInputElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLInputElement.swift @@ -7,9 +7,6 @@ public class HTMLInputElement: HTMLElement { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLInputElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _webkitdirectory = ReadWriteAttribute(jsObject: jsObject, name: Strings.webkitdirectory) - _webkitEntries = ReadonlyAttribute(jsObject: jsObject, name: Strings.webkitEntries) - _capture = ReadWriteAttribute(jsObject: jsObject, name: Strings.capture) _accept = ReadWriteAttribute(jsObject: jsObject, name: Strings.accept) _alt = ReadWriteAttribute(jsObject: jsObject, name: Strings.alt) _autocomplete = ReadWriteAttribute(jsObject: jsObject, name: Strings.autocomplete) @@ -58,15 +55,6 @@ public class HTMLInputElement: HTMLElement { super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var webkitdirectory: Bool - - @ReadonlyAttribute - public var webkitEntries: [FileSystemEntry] - - @ReadWriteAttribute - public var capture: String - @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift index 84cafd27..bbc35a39 100644 --- a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift @@ -25,7 +25,6 @@ public class HTMLLinkElement: HTMLElement, LinkStyle { _charset = ReadWriteAttribute(jsObject: jsObject, name: Strings.charset) _rev = ReadWriteAttribute(jsObject: jsObject, name: Strings.rev) _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) - _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) super.init(unsafelyWrapping: jsObject) } @@ -86,7 +85,4 @@ public class HTMLLinkElement: HTMLElement, LinkStyle { @ReadWriteAttribute public var target: String - - @ReadWriteAttribute - public var fetchpriority: String } diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index ae607a44..505b4239 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -7,10 +7,6 @@ public class HTMLMediaElement: HTMLElement { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLMediaElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _sinkId = ReadonlyAttribute(jsObject: jsObject, name: Strings.sinkId) - _mediaKeys = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaKeys) - _onencrypted = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onencrypted) - _onwaitingforkey = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onwaitingforkey) _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) _srcObject = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcObject) @@ -39,47 +35,9 @@ public class HTMLMediaElement: HTMLElement { _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioTracks) _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoTracks) _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.textTracks) - _remote = ReadonlyAttribute(jsObject: jsObject, name: Strings.remote) - _disableRemotePlayback = ReadWriteAttribute(jsObject: jsObject, name: Strings.disableRemotePlayback) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var sinkId: String - - @inlinable public func setSinkId(sinkId: String) -> JSPromise { - let this = jsObject - return this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func setSinkId(sinkId: String) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.setSinkId].function!(this: this, arguments: [sinkId.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @ReadonlyAttribute - public var mediaKeys: MediaKeys? - - @ClosureAttribute1Optional - public var onencrypted: EventHandler - - @ClosureAttribute1Optional - public var onwaitingforkey: EventHandler - - @inlinable public func setMediaKeys(mediaKeys: MediaKeys?) -> JSPromise { - let this = jsObject - return this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func setMediaKeys(mediaKeys: MediaKeys?) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.setMediaKeys].function!(this: this, arguments: [mediaKeys.jsValue]).fromJSValue()! - _ = try await _promise.value - } - @ReadonlyAttribute public var error: MediaError? @@ -223,15 +181,4 @@ public class HTMLMediaElement: HTMLElement { let this = jsObject return this[Strings.addTextTrack].function!(this: this, arguments: [kind.jsValue, label?.jsValue ?? .undefined, language?.jsValue ?? .undefined]).fromJSValue()! } - - @inlinable public func captureStream() -> MediaStream { - let this = jsObject - return this[Strings.captureStream].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var remote: RemotePlayback - - @ReadWriteAttribute - public var disableRemotePlayback: Bool } diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift index 630cd49d..3a6edabd 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift @@ -8,25 +8,25 @@ extension HTMLOptGroupElement: Any_HTMLOptGroupElement_or_HTMLOptionElement {} extension HTMLOptionElement: Any_HTMLOptGroupElement_or_HTMLOptionElement {} public enum HTMLOptGroupElement_or_HTMLOptionElement: JSValueCompatible, Any_HTMLOptGroupElement_or_HTMLOptionElement { - case hTMLOptGroupElement(HTMLOptGroupElement) - case hTMLOptionElement(HTMLOptionElement) + case htmlOptGroupElement(HTMLOptGroupElement) + case htmlOptionElement(HTMLOptionElement) public static func construct(from value: JSValue) -> Self? { - if let hTMLOptGroupElement: HTMLOptGroupElement = value.fromJSValue() { - return .hTMLOptGroupElement(hTMLOptGroupElement) + if let htmlOptGroupElement: HTMLOptGroupElement = value.fromJSValue() { + return .htmlOptGroupElement(htmlOptGroupElement) } - if let hTMLOptionElement: HTMLOptionElement = value.fromJSValue() { - return .hTMLOptionElement(hTMLOptionElement) + if let htmlOptionElement: HTMLOptionElement = value.fromJSValue() { + return .htmlOptionElement(htmlOptionElement) } return nil } public var jsValue: JSValue { switch self { - case let .hTMLOptGroupElement(hTMLOptGroupElement): - return hTMLOptGroupElement.jsValue - case let .hTMLOptionElement(hTMLOptionElement): - return hTMLOptionElement.jsValue + case let .htmlOptGroupElement(htmlOptGroupElement): + return htmlOptGroupElement.jsValue + case let .htmlOptionElement(htmlOptionElement): + return htmlOptionElement.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift index 721862a8..99c1871c 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift @@ -8,25 +8,25 @@ extension HTMLImageElement: Any_HTMLOrSVGImageElement {} extension SVGImageElement: Any_HTMLOrSVGImageElement {} public enum HTMLOrSVGImageElement: JSValueCompatible, Any_HTMLOrSVGImageElement { - case hTMLImageElement(HTMLImageElement) - case sVGImageElement(SVGImageElement) + case htmlImageElement(HTMLImageElement) + case svgImageElement(SVGImageElement) public static func construct(from value: JSValue) -> Self? { - if let hTMLImageElement: HTMLImageElement = value.fromJSValue() { - return .hTMLImageElement(hTMLImageElement) + if let htmlImageElement: HTMLImageElement = value.fromJSValue() { + return .htmlImageElement(htmlImageElement) } - if let sVGImageElement: SVGImageElement = value.fromJSValue() { - return .sVGImageElement(sVGImageElement) + if let svgImageElement: SVGImageElement = value.fromJSValue() { + return .svgImageElement(svgImageElement) } return nil } public var jsValue: JSValue { switch self { - case let .hTMLImageElement(hTMLImageElement): - return hTMLImageElement.jsValue - case let .sVGImageElement(sVGImageElement): - return sVGImageElement.jsValue + case let .htmlImageElement(htmlImageElement): + return htmlImageElement.jsValue + case let .svgImageElement(svgImageElement): + return svgImageElement.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift index 4a28df65..8bc32187 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift @@ -8,25 +8,25 @@ extension HTMLScriptElement: Any_HTMLOrSVGScriptElement {} extension SVGScriptElement: Any_HTMLOrSVGScriptElement {} public enum HTMLOrSVGScriptElement: JSValueCompatible, Any_HTMLOrSVGScriptElement { - case hTMLScriptElement(HTMLScriptElement) - case sVGScriptElement(SVGScriptElement) + case htmlScriptElement(HTMLScriptElement) + case svgScriptElement(SVGScriptElement) public static func construct(from value: JSValue) -> Self? { - if let hTMLScriptElement: HTMLScriptElement = value.fromJSValue() { - return .hTMLScriptElement(hTMLScriptElement) + if let htmlScriptElement: HTMLScriptElement = value.fromJSValue() { + return .htmlScriptElement(htmlScriptElement) } - if let sVGScriptElement: SVGScriptElement = value.fromJSValue() { - return .sVGScriptElement(sVGScriptElement) + if let svgScriptElement: SVGScriptElement = value.fromJSValue() { + return .svgScriptElement(svgScriptElement) } return nil } public var jsValue: JSValue { switch self { - case let .hTMLScriptElement(hTMLScriptElement): - return hTMLScriptElement.jsValue - case let .sVGScriptElement(sVGScriptElement): - return sVGScriptElement.jsValue + case let .htmlScriptElement(htmlScriptElement): + return htmlScriptElement.jsValue + case let .svgScriptElement(svgScriptElement): + return svgScriptElement.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift b/Sources/DOMKit/WebIDL/HTMLPortalElement.swift deleted file mode 100644 index 24a02625..00000000 --- a/Sources/DOMKit/WebIDL/HTMLPortalElement.swift +++ /dev/null @@ -1,49 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HTMLPortalElement: HTMLElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLPortalElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) - _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @ReadWriteAttribute - public var src: String - - @ReadWriteAttribute - public var referrerPolicy: String - - @inlinable public func activate(options: PortalActivateOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.activate].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func activate(options: PortalActivateOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.activate].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]) - } - - @ClosureAttribute1Optional - public var onmessage: EventHandler - - @ClosureAttribute1Optional - public var onmessageerror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift index 0d2eb7ce..a9094699 100644 --- a/Sources/DOMKit/WebIDL/HTMLScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLScriptElement.swift @@ -20,7 +20,6 @@ public class HTMLScriptElement: HTMLElement { _charset = ReadWriteAttribute(jsObject: jsObject, name: Strings.charset) _event = ReadWriteAttribute(jsObject: jsObject, name: Strings.event) _htmlFor = ReadWriteAttribute(jsObject: jsObject, name: Strings.htmlFor) - _fetchpriority = ReadWriteAttribute(jsObject: jsObject, name: Strings.fetchpriority) super.init(unsafelyWrapping: jsObject) } @@ -71,7 +70,4 @@ public class HTMLScriptElement: HTMLElement { @ReadWriteAttribute public var htmlFor: String - - @ReadWriteAttribute - public var fetchpriority: String } diff --git a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift index d8c805ed..b194737d 100644 --- a/Sources/DOMKit/WebIDL/HTMLVideoElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLVideoElement.swift @@ -13,10 +13,6 @@ public class HTMLVideoElement: HTMLMediaElement { _videoHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoHeight) _poster = ReadWriteAttribute(jsObject: jsObject, name: Strings.poster) _playsInline = ReadWriteAttribute(jsObject: jsObject, name: Strings.playsInline) - _onenterpictureinpicture = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onenterpictureinpicture) - _onleavepictureinpicture = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onleavepictureinpicture) - _autoPictureInPicture = ReadWriteAttribute(jsObject: jsObject, name: Strings.autoPictureInPicture) - _disablePictureInPicture = ReadWriteAttribute(jsObject: jsObject, name: Strings.disablePictureInPicture) super.init(unsafelyWrapping: jsObject) } @@ -41,40 +37,4 @@ public class HTMLVideoElement: HTMLMediaElement { @ReadWriteAttribute public var playsInline: Bool - - @inlinable public func getVideoPlaybackQuality() -> VideoPlaybackQuality { - let this = jsObject - return this[Strings.getVideoPlaybackQuality].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func requestPictureInPicture() -> JSPromise { - let this = jsObject - return this[Strings.requestPictureInPicture].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestPictureInPicture() async throws -> PictureInPictureWindow { - let this = jsObject - let _promise: JSPromise = this[Strings.requestPictureInPicture].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ClosureAttribute1Optional - public var onenterpictureinpicture: EventHandler - - @ClosureAttribute1Optional - public var onleavepictureinpicture: EventHandler - - @ReadWriteAttribute - public var autoPictureInPicture: Bool - - @ReadWriteAttribute - public var disablePictureInPicture: Bool - - // XXX: member 'requestVideoFrameCallback' is ignored - - @inlinable public func cancelVideoFrameCallback(handle: UInt32) { - let this = jsObject - _ = this[Strings.cancelVideoFrameCallback].function!(this: this, arguments: [handle.jsValue]) - } } diff --git a/Sources/DOMKit/WebIDL/HdrMetadataType.swift b/Sources/DOMKit/WebIDL/HdrMetadataType.swift deleted file mode 100644 index 7fb003b1..00000000 --- a/Sources/DOMKit/WebIDL/HdrMetadataType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum HdrMetadataType: JSString, JSValueCompatible { - case smpteSt2086 = "smpteSt2086" - case smpteSt209410 = "smpteSt2094-10" - case smpteSt209440 = "smpteSt2094-40" - - @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/Highlight.swift b/Sources/DOMKit/WebIDL/Highlight.swift deleted file mode 100644 index 8291aa97..00000000 --- a/Sources/DOMKit/WebIDL/Highlight.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Highlight: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Highlight].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _priority = ReadWriteAttribute(jsObject: jsObject, name: Strings.priority) - _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) - self.jsObject = jsObject - } - - @inlinable public convenience init(initialRanges: AbstractRange...) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: initialRanges.map(\.jsValue))) - } - - // XXX: make me Set-like! - - @ReadWriteAttribute - public var priority: Int32 - - @ReadWriteAttribute - public var type: HighlightType -} diff --git a/Sources/DOMKit/WebIDL/HighlightRegistry.swift b/Sources/DOMKit/WebIDL/HighlightRegistry.swift deleted file mode 100644 index b2794f44..00000000 --- a/Sources/DOMKit/WebIDL/HighlightRegistry.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HighlightRegistry: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.HighlightRegistry].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/HighlightType.swift b/Sources/DOMKit/WebIDL/HighlightType.swift deleted file mode 100644 index daad5e39..00000000 --- a/Sources/DOMKit/WebIDL/HighlightType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum HighlightType: JSString, JSValueCompatible { - case highlight = "highlight" - case spellingError = "spelling-error" - case grammarError = "grammar-error" - - @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/HkdfParams.swift b/Sources/DOMKit/WebIDL/HkdfParams.swift deleted file mode 100644 index ed7f00a7..00000000 --- a/Sources/DOMKit/WebIDL/HkdfParams.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HkdfParams: BridgedDictionary { - public convenience init(hash: HashAlgorithmIdentifier, salt: BufferSource, info: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue - object[Strings.salt] = salt.jsValue - object[Strings.info] = info.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - _salt = ReadWriteAttribute(jsObject: object, name: Strings.salt) - _info = ReadWriteAttribute(jsObject: object, name: Strings.info) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var hash: HashAlgorithmIdentifier - - @ReadWriteAttribute - public var salt: BufferSource - - @ReadWriteAttribute - public var info: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/HmacImportParams.swift b/Sources/DOMKit/WebIDL/HmacImportParams.swift deleted file mode 100644 index 7e603af0..00000000 --- a/Sources/DOMKit/WebIDL/HmacImportParams.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HmacImportParams: BridgedDictionary { - public convenience init(hash: HashAlgorithmIdentifier, length: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue - object[Strings.length] = length.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var hash: HashAlgorithmIdentifier - - @ReadWriteAttribute - public var length: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift deleted file mode 100644 index 28f40daf..00000000 --- a/Sources/DOMKit/WebIDL/HmacKeyAlgorithm.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HmacKeyAlgorithm: BridgedDictionary { - public convenience init(hash: KeyAlgorithm, length: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue - object[Strings.length] = length.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var hash: KeyAlgorithm - - @ReadWriteAttribute - public var length: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift b/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift deleted file mode 100644 index 2a537833..00000000 --- a/Sources/DOMKit/WebIDL/HmacKeyGenParams.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class HmacKeyGenParams: BridgedDictionary { - public convenience init(hash: HashAlgorithmIdentifier, length: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue - object[Strings.length] = length.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var hash: HashAlgorithmIdentifier - - @ReadWriteAttribute - public var length: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/IDBCursor.swift b/Sources/DOMKit/WebIDL/IDBCursor.swift deleted file mode 100644 index 210a06ee..00000000 --- a/Sources/DOMKit/WebIDL/IDBCursor.swift +++ /dev/null @@ -1,59 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBCursor: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBCursor].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) - _direction = ReadonlyAttribute(jsObject: jsObject, name: Strings.direction) - _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) - _primaryKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.primaryKey) - _request = ReadonlyAttribute(jsObject: jsObject, name: Strings.request) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var source: IDBIndex_or_IDBObjectStore - - @ReadonlyAttribute - public var direction: IDBCursorDirection - - @ReadonlyAttribute - public var key: JSValue - - @ReadonlyAttribute - public var primaryKey: JSValue - - @ReadonlyAttribute - public var request: IDBRequest - - @inlinable public func advance(count: UInt32) { - let this = jsObject - _ = this[Strings.advance].function!(this: this, arguments: [count.jsValue]) - } - - @inlinable public func `continue`(key: JSValue? = nil) { - let this = jsObject - _ = this[Strings.continue].function!(this: this, arguments: [key?.jsValue ?? .undefined]) - } - - @inlinable public func continuePrimaryKey(key: JSValue, primaryKey: JSValue) { - let this = jsObject - _ = this[Strings.continuePrimaryKey].function!(this: this, arguments: [key.jsValue, primaryKey.jsValue]) - } - - @inlinable public func update(value: JSValue) -> IDBRequest { - let this = jsObject - return this[Strings.update].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public func delete() -> IDBRequest { - let this = jsObject - return this[Strings.delete].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/IDBCursorDirection.swift b/Sources/DOMKit/WebIDL/IDBCursorDirection.swift deleted file mode 100644 index 8cc8383b..00000000 --- a/Sources/DOMKit/WebIDL/IDBCursorDirection.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum IDBCursorDirection: JSString, JSValueCompatible { - case next = "next" - case nextunique = "nextunique" - case prev = "prev" - case prevunique = "prevunique" - - @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/IDBCursorWithValue.swift b/Sources/DOMKit/WebIDL/IDBCursorWithValue.swift deleted file mode 100644 index 4c24da09..00000000 --- a/Sources/DOMKit/WebIDL/IDBCursorWithValue.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBCursorWithValue: IDBCursor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBCursorWithValue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var value: JSValue -} diff --git a/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift deleted file mode 100644 index 17db9caf..00000000 --- a/Sources/DOMKit/WebIDL/IDBCursor_or_IDBIndex_or_IDBObjectStore.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_IDBCursor_or_IDBIndex_or_IDBObjectStore: ConvertibleToJSValue {} -extension IDBCursor: Any_IDBCursor_or_IDBIndex_or_IDBObjectStore {} -extension IDBIndex: Any_IDBCursor_or_IDBIndex_or_IDBObjectStore {} -extension IDBObjectStore: Any_IDBCursor_or_IDBIndex_or_IDBObjectStore {} - -public enum IDBCursor_or_IDBIndex_or_IDBObjectStore: JSValueCompatible, Any_IDBCursor_or_IDBIndex_or_IDBObjectStore { - case iDBCursor(IDBCursor) - case iDBIndex(IDBIndex) - case iDBObjectStore(IDBObjectStore) - - public static func construct(from value: JSValue) -> Self? { - if let iDBCursor: IDBCursor = value.fromJSValue() { - return .iDBCursor(iDBCursor) - } - if let iDBIndex: IDBIndex = value.fromJSValue() { - return .iDBIndex(iDBIndex) - } - if let iDBObjectStore: IDBObjectStore = value.fromJSValue() { - return .iDBObjectStore(iDBObjectStore) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .iDBCursor(iDBCursor): - return iDBCursor.jsValue - case let .iDBIndex(iDBIndex): - return iDBIndex.jsValue - case let .iDBObjectStore(iDBObjectStore): - return iDBObjectStore.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/IDBDatabase.swift b/Sources/DOMKit/WebIDL/IDBDatabase.swift deleted file mode 100644 index ded59d13..00000000 --- a/Sources/DOMKit/WebIDL/IDBDatabase.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBDatabase: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBDatabase].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _version = ReadonlyAttribute(jsObject: jsObject, name: Strings.version) - _objectStoreNames = ReadonlyAttribute(jsObject: jsObject, name: Strings.objectStoreNames) - _onabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onabort) - _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - _onversionchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onversionchange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var version: UInt64 - - @ReadonlyAttribute - public var objectStoreNames: DOMStringList - - @inlinable public func transaction(storeNames: String_or_seq_of_String, mode: IDBTransactionMode? = nil, options: IDBTransactionOptions? = nil) -> IDBTransaction { - let this = jsObject - return this[Strings.transaction].function!(this: this, arguments: [storeNames.jsValue, mode?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @inlinable public func createObjectStore(name: String, options: IDBObjectStoreParameters? = nil) -> IDBObjectStore { - let this = jsObject - return this[Strings.createObjectStore].function!(this: this, arguments: [name.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func deleteObjectStore(name: String) { - let this = jsObject - _ = this[Strings.deleteObjectStore].function!(this: this, arguments: [name.jsValue]) - } - - @ClosureAttribute1Optional - public var onabort: EventHandler - - @ClosureAttribute1Optional - public var onclose: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler - - @ClosureAttribute1Optional - public var onversionchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift b/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift deleted file mode 100644 index b8a8b1c7..00000000 --- a/Sources/DOMKit/WebIDL/IDBDatabaseInfo.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBDatabaseInfo: BridgedDictionary { - public convenience init(name: String, version: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.version] = version.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _version = ReadWriteAttribute(jsObject: object, name: Strings.version) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var version: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/IDBFactory.swift b/Sources/DOMKit/WebIDL/IDBFactory.swift deleted file mode 100644 index d20248d1..00000000 --- a/Sources/DOMKit/WebIDL/IDBFactory.swift +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBFactory: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBFactory].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func open(name: String, version: UInt64? = nil) -> IDBOpenDBRequest { - let this = jsObject - return this[Strings.open].function!(this: this, arguments: [name.jsValue, version?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func deleteDatabase(name: String) -> IDBOpenDBRequest { - let this = jsObject - return this[Strings.deleteDatabase].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @inlinable public func databases() -> JSPromise { - let this = jsObject - return this[Strings.databases].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func databases() async throws -> [IDBDatabaseInfo] { - let this = jsObject - let _promise: JSPromise = this[Strings.databases].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func cmp(first: JSValue, second: JSValue) -> Int16 { - let this = jsObject - return this[Strings.cmp].function!(this: this, arguments: [first.jsValue, second.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/IDBIndex.swift b/Sources/DOMKit/WebIDL/IDBIndex.swift deleted file mode 100644 index f43bcd86..00000000 --- a/Sources/DOMKit/WebIDL/IDBIndex.swift +++ /dev/null @@ -1,69 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBIndex: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBIndex].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) - _objectStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.objectStore) - _keyPath = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyPath) - _multiEntry = ReadonlyAttribute(jsObject: jsObject, name: Strings.multiEntry) - _unique = ReadonlyAttribute(jsObject: jsObject, name: Strings.unique) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var name: String - - @ReadonlyAttribute - public var objectStore: IDBObjectStore - - @ReadonlyAttribute - public var keyPath: JSValue - - @ReadonlyAttribute - public var multiEntry: Bool - - @ReadonlyAttribute - public var unique: Bool - - @inlinable public func get(query: JSValue) -> IDBRequest { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [query.jsValue]).fromJSValue()! - } - - @inlinable public func getKey(query: JSValue) -> IDBRequest { - let this = jsObject - return this[Strings.getKey].function!(this: this, arguments: [query.jsValue]).fromJSValue()! - } - - @inlinable public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue ?? .undefined, count?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue ?? .undefined, count?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func count(query: JSValue? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.count].function!(this: this, arguments: [query?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue ?? .undefined, direction?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue ?? .undefined, direction?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/IDBIndexParameters.swift b/Sources/DOMKit/WebIDL/IDBIndexParameters.swift deleted file mode 100644 index e6c6eaf1..00000000 --- a/Sources/DOMKit/WebIDL/IDBIndexParameters.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBIndexParameters: BridgedDictionary { - public convenience init(unique: Bool, multiEntry: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.unique] = unique.jsValue - object[Strings.multiEntry] = multiEntry.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _unique = ReadWriteAttribute(jsObject: object, name: Strings.unique) - _multiEntry = ReadWriteAttribute(jsObject: object, name: Strings.multiEntry) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var unique: Bool - - @ReadWriteAttribute - public var multiEntry: Bool -} diff --git a/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift deleted file mode 100644 index 8ab78fc5..00000000 --- a/Sources/DOMKit/WebIDL/IDBIndex_or_IDBObjectStore.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_IDBIndex_or_IDBObjectStore: ConvertibleToJSValue {} -extension IDBIndex: Any_IDBIndex_or_IDBObjectStore {} -extension IDBObjectStore: Any_IDBIndex_or_IDBObjectStore {} - -public enum IDBIndex_or_IDBObjectStore: JSValueCompatible, Any_IDBIndex_or_IDBObjectStore { - case iDBIndex(IDBIndex) - case iDBObjectStore(IDBObjectStore) - - public static func construct(from value: JSValue) -> Self? { - if let iDBIndex: IDBIndex = value.fromJSValue() { - return .iDBIndex(iDBIndex) - } - if let iDBObjectStore: IDBObjectStore = value.fromJSValue() { - return .iDBObjectStore(iDBObjectStore) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .iDBIndex(iDBIndex): - return iDBIndex.jsValue - case let .iDBObjectStore(iDBObjectStore): - return iDBObjectStore.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/IDBKeyRange.swift b/Sources/DOMKit/WebIDL/IDBKeyRange.swift deleted file mode 100644 index 3806b299..00000000 --- a/Sources/DOMKit/WebIDL/IDBKeyRange.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBKeyRange: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBKeyRange].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _lower = ReadonlyAttribute(jsObject: jsObject, name: Strings.lower) - _upper = ReadonlyAttribute(jsObject: jsObject, name: Strings.upper) - _lowerOpen = ReadonlyAttribute(jsObject: jsObject, name: Strings.lowerOpen) - _upperOpen = ReadonlyAttribute(jsObject: jsObject, name: Strings.upperOpen) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var lower: JSValue - - @ReadonlyAttribute - public var upper: JSValue - - @ReadonlyAttribute - public var lowerOpen: Bool - - @ReadonlyAttribute - public var upperOpen: Bool - - @inlinable public static func only(value: JSValue) -> Self { - let this = constructor - return this[Strings.only].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public static func lowerBound(lower: JSValue, open: Bool? = nil) -> Self { - let this = constructor - return this[Strings.lowerBound].function!(this: this, arguments: [lower.jsValue, open?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public static func upperBound(upper: JSValue, open: Bool? = nil) -> Self { - let this = constructor - return this[Strings.upperBound].function!(this: this, arguments: [upper.jsValue, open?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public static func bound(lower: JSValue, upper: JSValue, lowerOpen: Bool? = nil, upperOpen: Bool? = nil) -> Self { - let this = constructor - return this[Strings.bound].function!(this: this, arguments: [lower.jsValue, upper.jsValue, lowerOpen?.jsValue ?? .undefined, upperOpen?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func includes(key: JSValue) -> Bool { - let this = jsObject - return this[Strings.includes].function!(this: this, arguments: [key.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/IDBObjectStore.swift b/Sources/DOMKit/WebIDL/IDBObjectStore.swift deleted file mode 100644 index 8c1221c0..00000000 --- a/Sources/DOMKit/WebIDL/IDBObjectStore.swift +++ /dev/null @@ -1,104 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBObjectStore: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IDBObjectStore].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) - _keyPath = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyPath) - _indexNames = ReadonlyAttribute(jsObject: jsObject, name: Strings.indexNames) - _transaction = ReadonlyAttribute(jsObject: jsObject, name: Strings.transaction) - _autoIncrement = ReadonlyAttribute(jsObject: jsObject, name: Strings.autoIncrement) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var name: String - - @ReadonlyAttribute - public var keyPath: JSValue - - @ReadonlyAttribute - public var indexNames: DOMStringList - - @ReadonlyAttribute - public var transaction: IDBTransaction - - @ReadonlyAttribute - public var autoIncrement: Bool - - @inlinable public func put(value: JSValue, key: JSValue? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.put].function!(this: this, arguments: [value.jsValue, key?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func add(value: JSValue, key: JSValue? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.add].function!(this: this, arguments: [value.jsValue, key?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func delete(query: JSValue) -> IDBRequest { - let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [query.jsValue]).fromJSValue()! - } - - @inlinable public func clear() -> IDBRequest { - let this = jsObject - return this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func get(query: JSValue) -> IDBRequest { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [query.jsValue]).fromJSValue()! - } - - @inlinable public func getKey(query: JSValue) -> IDBRequest { - let this = jsObject - return this[Strings.getKey].function!(this: this, arguments: [query.jsValue]).fromJSValue()! - } - - @inlinable public func getAll(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [query?.jsValue ?? .undefined, count?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func getAllKeys(query: JSValue? = nil, count: UInt32? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.getAllKeys].function!(this: this, arguments: [query?.jsValue ?? .undefined, count?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func count(query: JSValue? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.count].function!(this: this, arguments: [query?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func openCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.openCursor].function!(this: this, arguments: [query?.jsValue ?? .undefined, direction?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func openKeyCursor(query: JSValue? = nil, direction: IDBCursorDirection? = nil) -> IDBRequest { - let this = jsObject - return this[Strings.openKeyCursor].function!(this: this, arguments: [query?.jsValue ?? .undefined, direction?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func index(name: String) -> IDBIndex { - let this = jsObject - return this[Strings.index].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @inlinable public func createIndex(name: String, keyPath: String_or_seq_of_String, options: IDBIndexParameters? = nil) -> IDBIndex { - let this = jsObject - return this[Strings.createIndex].function!(this: this, arguments: [name.jsValue, keyPath.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func deleteIndex(name: String) { - let this = jsObject - _ = this[Strings.deleteIndex].function!(this: this, arguments: [name.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift b/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift deleted file mode 100644 index f49450a1..00000000 --- a/Sources/DOMKit/WebIDL/IDBObjectStoreParameters.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBObjectStoreParameters: BridgedDictionary { - public convenience init(keyPath: String_or_seq_of_String?, autoIncrement: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keyPath] = keyPath.jsValue - object[Strings.autoIncrement] = autoIncrement.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _keyPath = ReadWriteAttribute(jsObject: object, name: Strings.keyPath) - _autoIncrement = ReadWriteAttribute(jsObject: object, name: Strings.autoIncrement) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var keyPath: String_or_seq_of_String? - - @ReadWriteAttribute - public var autoIncrement: Bool -} diff --git a/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift b/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift deleted file mode 100644 index d34fa830..00000000 --- a/Sources/DOMKit/WebIDL/IDBOpenDBRequest.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBOpenDBRequest: IDBRequest { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBOpenDBRequest].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onblocked = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onblocked) - _onupgradeneeded = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onupgradeneeded) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var onblocked: EventHandler - - @ClosureAttribute1Optional - public var onupgradeneeded: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/IDBRequest.swift b/Sources/DOMKit/WebIDL/IDBRequest.swift deleted file mode 100644 index ab897d58..00000000 --- a/Sources/DOMKit/WebIDL/IDBRequest.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBRequest: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBRequest].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _result = ReadonlyAttribute(jsObject: jsObject, name: Strings.result) - _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) - _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) - _transaction = ReadonlyAttribute(jsObject: jsObject, name: Strings.transaction) - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) - _onsuccess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsuccess) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var result: JSValue - - @ReadonlyAttribute - public var error: DOMException? - - @ReadonlyAttribute - public var source: IDBCursor_or_IDBIndex_or_IDBObjectStore? - - @ReadonlyAttribute - public var transaction: IDBTransaction? - - @ReadonlyAttribute - public var readyState: IDBRequestReadyState - - @ClosureAttribute1Optional - public var onsuccess: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift b/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift deleted file mode 100644 index 1024dfca..00000000 --- a/Sources/DOMKit/WebIDL/IDBRequestReadyState.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum IDBRequestReadyState: JSString, JSValueCompatible { - case pending = "pending" - case done = "done" - - @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/IDBTransaction.swift b/Sources/DOMKit/WebIDL/IDBTransaction.swift deleted file mode 100644 index c666a7dc..00000000 --- a/Sources/DOMKit/WebIDL/IDBTransaction.swift +++ /dev/null @@ -1,59 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBTransaction: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBTransaction].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _objectStoreNames = ReadonlyAttribute(jsObject: jsObject, name: Strings.objectStoreNames) - _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) - _durability = ReadonlyAttribute(jsObject: jsObject, name: Strings.durability) - _db = ReadonlyAttribute(jsObject: jsObject, name: Strings.db) - _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) - _onabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onabort) - _oncomplete = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncomplete) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var objectStoreNames: DOMStringList - - @ReadonlyAttribute - public var mode: IDBTransactionMode - - @ReadonlyAttribute - public var durability: IDBTransactionDurability - - @ReadonlyAttribute - public var db: IDBDatabase - - @ReadonlyAttribute - public var error: DOMException? - - @inlinable public func objectStore(name: String) -> IDBObjectStore { - let this = jsObject - return this[Strings.objectStore].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @inlinable public func commit() { - let this = jsObject - _ = this[Strings.commit].function!(this: this, arguments: []) - } - - @inlinable public func abort() { - let this = jsObject - _ = this[Strings.abort].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var onabort: EventHandler - - @ClosureAttribute1Optional - public var oncomplete: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift b/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift deleted file mode 100644 index c03a9c8f..00000000 --- a/Sources/DOMKit/WebIDL/IDBTransactionDurability.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum IDBTransactionDurability: JSString, JSValueCompatible { - case `default` = "default" - case strict = "strict" - case relaxed = "relaxed" - - @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/IDBTransactionMode.swift b/Sources/DOMKit/WebIDL/IDBTransactionMode.swift deleted file mode 100644 index 4d4ceaa6..00000000 --- a/Sources/DOMKit/WebIDL/IDBTransactionMode.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum IDBTransactionMode: JSString, JSValueCompatible { - case readonly = "readonly" - case readwrite = "readwrite" - case versionchange = "versionchange" - - @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/IDBTransactionOptions.swift b/Sources/DOMKit/WebIDL/IDBTransactionOptions.swift deleted file mode 100644 index e6d33892..00000000 --- a/Sources/DOMKit/WebIDL/IDBTransactionOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBTransactionOptions: BridgedDictionary { - public convenience init(durability: IDBTransactionDurability) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.durability] = durability.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _durability = ReadWriteAttribute(jsObject: object, name: Strings.durability) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var durability: IDBTransactionDurability -} diff --git a/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift b/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift deleted file mode 100644 index ac98f343..00000000 --- a/Sources/DOMKit/WebIDL/IDBVersionChangeEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBVersionChangeEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IDBVersionChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _oldVersion = ReadonlyAttribute(jsObject: jsObject, name: Strings.oldVersion) - _newVersion = ReadonlyAttribute(jsObject: jsObject, name: Strings.newVersion) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: IDBVersionChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var oldVersion: UInt64 - - @ReadonlyAttribute - public var newVersion: UInt64? -} diff --git a/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift b/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift deleted file mode 100644 index ccece314..00000000 --- a/Sources/DOMKit/WebIDL/IDBVersionChangeEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IDBVersionChangeEventInit: BridgedDictionary { - public convenience init(oldVersion: UInt64, newVersion: UInt64?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.oldVersion] = oldVersion.jsValue - object[Strings.newVersion] = newVersion.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _oldVersion = ReadWriteAttribute(jsObject: object, name: Strings.oldVersion) - _newVersion = ReadWriteAttribute(jsObject: object, name: Strings.newVersion) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var oldVersion: UInt64 - - @ReadWriteAttribute - public var newVersion: UInt64? -} diff --git a/Sources/DOMKit/WebIDL/IIRFilterNode.swift b/Sources/DOMKit/WebIDL/IIRFilterNode.swift deleted file mode 100644 index cab30b77..00000000 --- a/Sources/DOMKit/WebIDL/IIRFilterNode.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IIRFilterNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IIRFilterNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: IIRFilterOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options.jsValue])) - } - - @inlinable public func getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array) { - let this = jsObject - _ = this[Strings.getFrequencyResponse].function!(this: this, arguments: [frequencyHz.jsValue, magResponse.jsValue, phaseResponse.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/IIRFilterOptions.swift b/Sources/DOMKit/WebIDL/IIRFilterOptions.swift deleted file mode 100644 index 2e5dbef9..00000000 --- a/Sources/DOMKit/WebIDL/IIRFilterOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IIRFilterOptions: BridgedDictionary { - public convenience init(feedforward: [Double], feedback: [Double]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.feedforward] = feedforward.jsValue - object[Strings.feedback] = feedback.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _feedforward = ReadWriteAttribute(jsObject: object, name: Strings.feedforward) - _feedback = ReadWriteAttribute(jsObject: object, name: Strings.feedback) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var feedforward: [Double] - - @ReadWriteAttribute - public var feedback: [Double] -} diff --git a/Sources/DOMKit/WebIDL/IdleDeadline.swift b/Sources/DOMKit/WebIDL/IdleDeadline.swift deleted file mode 100644 index f2bb616b..00000000 --- a/Sources/DOMKit/WebIDL/IdleDeadline.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IdleDeadline: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IdleDeadline].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _didTimeout = ReadonlyAttribute(jsObject: jsObject, name: Strings.didTimeout) - self.jsObject = jsObject - } - - @inlinable public func timeRemaining() -> DOMHighResTimeStamp { - let this = jsObject - return this[Strings.timeRemaining].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var didTimeout: Bool -} diff --git a/Sources/DOMKit/WebIDL/IdleDetector.swift b/Sources/DOMKit/WebIDL/IdleDetector.swift deleted file mode 100644 index 5fd3121a..00000000 --- a/Sources/DOMKit/WebIDL/IdleDetector.swift +++ /dev/null @@ -1,52 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IdleDetector: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.IdleDetector].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _userState = ReadonlyAttribute(jsObject: jsObject, name: Strings.userState) - _screenState = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenState) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @ReadonlyAttribute - public var userState: UserIdleState? - - @ReadonlyAttribute - public var screenState: ScreenIdleState? - - @ClosureAttribute1Optional - public var onchange: EventHandler - - @inlinable public static func requestPermission() -> JSPromise { - let this = constructor - return this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func requestPermission() async throws -> PermissionState { - let this = constructor - let _promise: JSPromise = this[Strings.requestPermission].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func start(options: IdleOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.start].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func start(options: IdleOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.start].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/IdleOptions.swift b/Sources/DOMKit/WebIDL/IdleOptions.swift deleted file mode 100644 index 13a8fb0d..00000000 --- a/Sources/DOMKit/WebIDL/IdleOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IdleOptions: BridgedDictionary { - public convenience init(threshold: UInt64, signal: AbortSignal) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.threshold] = threshold.jsValue - object[Strings.signal] = signal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _threshold = ReadWriteAttribute(jsObject: object, name: Strings.threshold) - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var threshold: UInt64 - - @ReadWriteAttribute - public var signal: AbortSignal -} diff --git a/Sources/DOMKit/WebIDL/IdleRequestOptions.swift b/Sources/DOMKit/WebIDL/IdleRequestOptions.swift deleted file mode 100644 index aeef0eb6..00000000 --- a/Sources/DOMKit/WebIDL/IdleRequestOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IdleRequestOptions: BridgedDictionary { - public convenience init(timeout: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timeout] = timeout.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var timeout: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/ImageCapture.swift b/Sources/DOMKit/WebIDL/ImageCapture.swift deleted file mode 100644 index fa713d79..00000000 --- a/Sources/DOMKit/WebIDL/ImageCapture.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ImageCapture: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageCapture].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) - self.jsObject = jsObject - } - - @inlinable public convenience init(videoTrack: MediaStreamTrack) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [videoTrack.jsValue])) - } - - @inlinable public func takePhoto(photoSettings: PhotoSettings? = nil) -> JSPromise { - let this = jsObject - return this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func takePhoto(photoSettings: PhotoSettings? = nil) async throws -> Blob { - let this = jsObject - let _promise: JSPromise = this[Strings.takePhoto].function!(this: this, arguments: [photoSettings?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getPhotoCapabilities() -> JSPromise { - let this = jsObject - return this[Strings.getPhotoCapabilities].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getPhotoCapabilities() async throws -> PhotoCapabilities { - let this = jsObject - let _promise: JSPromise = this[Strings.getPhotoCapabilities].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getPhotoSettings() -> JSPromise { - let this = jsObject - return this[Strings.getPhotoSettings].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getPhotoSettings() async throws -> PhotoSettings { - let this = jsObject - let _promise: JSPromise = this[Strings.getPhotoSettings].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func grabFrame() -> JSPromise { - let this = jsObject - return this[Strings.grabFrame].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func grabFrame() async throws -> ImageBitmap { - let this = jsObject - let _promise: JSPromise = this[Strings.grabFrame].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var track: MediaStreamTrack -} diff --git a/Sources/DOMKit/WebIDL/ImageObject.swift b/Sources/DOMKit/WebIDL/ImageObject.swift deleted file mode 100644 index 970e1137..00000000 --- a/Sources/DOMKit/WebIDL/ImageObject.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ImageObject: BridgedDictionary { - public convenience init(src: String, sizes: String, type: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.src] = src.jsValue - object[Strings.sizes] = sizes.jsValue - object[Strings.type] = type.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _src = ReadWriteAttribute(jsObject: object, name: Strings.src) - _sizes = ReadWriteAttribute(jsObject: object, name: Strings.sizes) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var src: String - - @ReadWriteAttribute - public var sizes: String - - @ReadWriteAttribute - public var type: String -} diff --git a/Sources/DOMKit/WebIDL/ImageResource.swift b/Sources/DOMKit/WebIDL/ImageResource.swift deleted file mode 100644 index be5d5444..00000000 --- a/Sources/DOMKit/WebIDL/ImageResource.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ImageResource: BridgedDictionary { - public convenience init(src: String, sizes: String, type: String, label: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.src] = src.jsValue - object[Strings.sizes] = sizes.jsValue - object[Strings.type] = type.jsValue - object[Strings.label] = label.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _src = ReadWriteAttribute(jsObject: object, name: Strings.src) - _sizes = ReadWriteAttribute(jsObject: object, name: Strings.sizes) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _label = ReadWriteAttribute(jsObject: object, name: Strings.label) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var src: String - - @ReadWriteAttribute - public var sizes: String - - @ReadWriteAttribute - public var type: String - - @ReadWriteAttribute - public var label: String -} diff --git a/Sources/DOMKit/WebIDL/ImportExportKind.swift b/Sources/DOMKit/WebIDL/ImportExportKind.swift deleted file mode 100644 index cae8be2e..00000000 --- a/Sources/DOMKit/WebIDL/ImportExportKind.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ImportExportKind: JSString, JSValueCompatible { - case function = "function" - case table = "table" - case memory = "memory" - case global = "global" - - @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/Ink.swift b/Sources/DOMKit/WebIDL/Ink.swift deleted file mode 100644 index e25b3566..00000000 --- a/Sources/DOMKit/WebIDL/Ink.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Ink: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Ink].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func requestPresenter(param: InkPresenterParam? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestPresenter(param: InkPresenterParam? = nil) async throws -> InkPresenter { - let this = jsObject - let _promise: JSPromise = this[Strings.requestPresenter].function!(this: this, arguments: [param?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/InkPresenter.swift b/Sources/DOMKit/WebIDL/InkPresenter.swift deleted file mode 100644 index a4dde76d..00000000 --- a/Sources/DOMKit/WebIDL/InkPresenter.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class InkPresenter: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.InkPresenter].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _presentationArea = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentationArea) - _expectedImprovement = ReadonlyAttribute(jsObject: jsObject, name: Strings.expectedImprovement) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var presentationArea: Element? - - @ReadonlyAttribute - public var expectedImprovement: UInt32 - - @inlinable public func updateInkTrailStartPoint(event: PointerEvent, style: InkTrailStyle) { - let this = jsObject - _ = this[Strings.updateInkTrailStartPoint].function!(this: this, arguments: [event.jsValue, style.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/InkPresenterParam.swift b/Sources/DOMKit/WebIDL/InkPresenterParam.swift deleted file mode 100644 index e3d26bc6..00000000 --- a/Sources/DOMKit/WebIDL/InkPresenterParam.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class InkPresenterParam: BridgedDictionary { - public convenience init(presentationArea: Element?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.presentationArea] = presentationArea.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _presentationArea = ReadWriteAttribute(jsObject: object, name: Strings.presentationArea) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var presentationArea: Element? -} diff --git a/Sources/DOMKit/WebIDL/InkTrailStyle.swift b/Sources/DOMKit/WebIDL/InkTrailStyle.swift deleted file mode 100644 index 506cbb6b..00000000 --- a/Sources/DOMKit/WebIDL/InkTrailStyle.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class InkTrailStyle: BridgedDictionary { - public convenience init(color: String, diameter: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.color] = color.jsValue - object[Strings.diameter] = diameter.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _color = ReadWriteAttribute(jsObject: object, name: Strings.color) - _diameter = ReadWriteAttribute(jsObject: object, name: Strings.diameter) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var color: String - - @ReadWriteAttribute - public var diameter: Double -} diff --git a/Sources/DOMKit/WebIDL/InnerHTML.swift b/Sources/DOMKit/WebIDL/InnerHTML.swift deleted file mode 100644 index 3fba5c88..00000000 --- a/Sources/DOMKit/WebIDL/InnerHTML.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol InnerHTML: JSBridgedClass {} -public extension InnerHTML { - @inlinable var innerHTML: String { - get { ReadWriteAttribute[Strings.innerHTML, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.innerHTML, in: jsObject] = newValue } - } -} diff --git a/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift b/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift deleted file mode 100644 index 2fa5e699..00000000 --- a/Sources/DOMKit/WebIDL/InputDeviceCapabilities.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class InputDeviceCapabilities: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.InputDeviceCapabilities].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _firesTouchEvents = ReadonlyAttribute(jsObject: jsObject, name: Strings.firesTouchEvents) - _pointerMovementScrolls = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointerMovementScrolls) - self.jsObject = jsObject - } - - @inlinable public convenience init(deviceInitDict: InputDeviceCapabilitiesInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var firesTouchEvents: Bool - - @ReadonlyAttribute - public var pointerMovementScrolls: Bool -} diff --git a/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift b/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift deleted file mode 100644 index bdcc524a..00000000 --- a/Sources/DOMKit/WebIDL/InputDeviceCapabilitiesInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class InputDeviceCapabilitiesInit: BridgedDictionary { - public convenience init(firesTouchEvents: Bool, pointerMovementScrolls: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.firesTouchEvents] = firesTouchEvents.jsValue - object[Strings.pointerMovementScrolls] = pointerMovementScrolls.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _firesTouchEvents = ReadWriteAttribute(jsObject: object, name: Strings.firesTouchEvents) - _pointerMovementScrolls = ReadWriteAttribute(jsObject: object, name: Strings.pointerMovementScrolls) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var firesTouchEvents: Bool - - @ReadWriteAttribute - public var pointerMovementScrolls: Bool -} diff --git a/Sources/DOMKit/WebIDL/InputEvent.swift b/Sources/DOMKit/WebIDL/InputEvent.swift index 44dc675d..9c528a5c 100644 --- a/Sources/DOMKit/WebIDL/InputEvent.swift +++ b/Sources/DOMKit/WebIDL/InputEvent.swift @@ -7,21 +7,12 @@ public class InputEvent: UIEvent { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.InputEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _dataTransfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.dataTransfer) _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) _isComposing = ReadonlyAttribute(jsObject: jsObject, name: Strings.isComposing) _inputType = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputType) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var dataTransfer: DataTransfer? - - @inlinable public func getTargetRanges() -> [StaticRange] { - let this = jsObject - return this[Strings.getTargetRanges].function!(this: this, arguments: []).fromJSValue()! - } - @inlinable public convenience init(type: String, eventInitDict: InputEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/InputEventInit.swift b/Sources/DOMKit/WebIDL/InputEventInit.swift index 22a6fe4f..7f6f4ebd 100644 --- a/Sources/DOMKit/WebIDL/InputEventInit.swift +++ b/Sources/DOMKit/WebIDL/InputEventInit.swift @@ -4,10 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class InputEventInit: BridgedDictionary { - public convenience init(dataTransfer: DataTransfer?, targetRanges: [StaticRange], data: String?, isComposing: Bool, inputType: String) { + public convenience init(data: String?, isComposing: Bool, inputType: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataTransfer] = dataTransfer.jsValue - object[Strings.targetRanges] = targetRanges.jsValue object[Strings.data] = data.jsValue object[Strings.isComposing] = isComposing.jsValue object[Strings.inputType] = inputType.jsValue @@ -15,20 +13,12 @@ public class InputEventInit: BridgedDictionary { } public required init(unsafelyWrapping object: JSObject) { - _dataTransfer = ReadWriteAttribute(jsObject: object, name: Strings.dataTransfer) - _targetRanges = ReadWriteAttribute(jsObject: object, name: Strings.targetRanges) _data = ReadWriteAttribute(jsObject: object, name: Strings.data) _isComposing = ReadWriteAttribute(jsObject: object, name: Strings.isComposing) _inputType = ReadWriteAttribute(jsObject: object, name: Strings.inputType) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var dataTransfer: DataTransfer? - - @ReadWriteAttribute - public var targetRanges: [StaticRange] - @ReadWriteAttribute public var data: String? diff --git a/Sources/DOMKit/WebIDL/Instance.swift b/Sources/DOMKit/WebIDL/Instance.swift deleted file mode 100644 index 214d09e9..00000000 --- a/Sources/DOMKit/WebIDL/Instance.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Instance: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Instance].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _exports = ReadonlyAttribute(jsObject: jsObject, name: Strings.exports) - self.jsObject = jsObject - } - - @inlinable public convenience init(module: Module, importObject: JSObject? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [module.jsValue, importObject?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var exports: JSObject -} diff --git a/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift b/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift deleted file mode 100644 index 44a7276f..00000000 --- a/Sources/DOMKit/WebIDL/Int32Array_or_seq_of_GLsizei.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Int32Array_or_seq_of_GLsizei: ConvertibleToJSValue {} -extension Int32Array: Any_Int32Array_or_seq_of_GLsizei {} -extension Array: Any_Int32Array_or_seq_of_GLsizei where Element == GLsizei {} - -public enum Int32Array_or_seq_of_GLsizei: JSValueCompatible, Any_Int32Array_or_seq_of_GLsizei { - case int32Array(Int32Array) - case seq_of_GLsizei([GLsizei]) - - public static func construct(from value: JSValue) -> Self? { - if let int32Array: Int32Array = value.fromJSValue() { - return .int32Array(int32Array) - } - if let seq_of_GLsizei: [GLsizei] = value.fromJSValue() { - return .seq_of_GLsizei(seq_of_GLsizei) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .int32Array(int32Array): - return int32Array.jsValue - case let .seq_of_GLsizei(seq_of_GLsizei): - return seq_of_GLsizei.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/Int32List.swift b/Sources/DOMKit/WebIDL/Int32List.swift deleted file mode 100644 index c251a4d6..00000000 --- a/Sources/DOMKit/WebIDL/Int32List.swift +++ /dev/null @@ -1,32 +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]) - - 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/InteractionCounts.swift b/Sources/DOMKit/WebIDL/InteractionCounts.swift deleted file mode 100644 index 24f3564e..00000000 --- a/Sources/DOMKit/WebIDL/InteractionCounts.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class InteractionCounts: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.InteractionCounts].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/IntersectionObserver.swift b/Sources/DOMKit/WebIDL/IntersectionObserver.swift deleted file mode 100644 index 32662022..00000000 --- a/Sources/DOMKit/WebIDL/IntersectionObserver.swift +++ /dev/null @@ -1,48 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IntersectionObserver: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IntersectionObserver].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _root = ReadonlyAttribute(jsObject: jsObject, name: Strings.root) - _rootMargin = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootMargin) - _thresholds = ReadonlyAttribute(jsObject: jsObject, name: Strings.thresholds) - self.jsObject = jsObject - } - - // XXX: constructor is ignored - - @ReadonlyAttribute - public var root: Document_or_Element? - - @ReadonlyAttribute - public var rootMargin: String - - @ReadonlyAttribute - public var thresholds: [Double] - - @inlinable public func observe(target: Element) { - let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue]) - } - - @inlinable public func unobserve(target: Element) { - let this = jsObject - _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue]) - } - - @inlinable public func disconnect() { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: []) - } - - @inlinable public func takeRecords() -> [IntersectionObserverEntry] { - let this = jsObject - return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift b/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift deleted file mode 100644 index e164ecda..00000000 --- a/Sources/DOMKit/WebIDL/IntersectionObserverEntry.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IntersectionObserverEntry: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.IntersectionObserverEntry].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _time = ReadonlyAttribute(jsObject: jsObject, name: Strings.time) - _rootBounds = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootBounds) - _boundingClientRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingClientRect) - _intersectionRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.intersectionRect) - _isIntersecting = ReadonlyAttribute(jsObject: jsObject, name: Strings.isIntersecting) - _intersectionRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.intersectionRatio) - _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) - self.jsObject = jsObject - } - - @inlinable public convenience init(intersectionObserverEntryInit: IntersectionObserverEntryInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [intersectionObserverEntryInit.jsValue])) - } - - @ReadonlyAttribute - public var time: DOMHighResTimeStamp - - @ReadonlyAttribute - public var rootBounds: DOMRectReadOnly? - - @ReadonlyAttribute - public var boundingClientRect: DOMRectReadOnly - - @ReadonlyAttribute - public var intersectionRect: DOMRectReadOnly - - @ReadonlyAttribute - public var isIntersecting: Bool - - @ReadonlyAttribute - public var intersectionRatio: Double - - @ReadonlyAttribute - public var target: Element -} diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift b/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift deleted file mode 100644 index 21508182..00000000 --- a/Sources/DOMKit/WebIDL/IntersectionObserverEntryInit.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IntersectionObserverEntryInit: BridgedDictionary { - public convenience init(time: DOMHighResTimeStamp, rootBounds: DOMRectInit?, boundingClientRect: DOMRectInit, intersectionRect: DOMRectInit, isIntersecting: Bool, intersectionRatio: Double, target: Element) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.time] = time.jsValue - object[Strings.rootBounds] = rootBounds.jsValue - object[Strings.boundingClientRect] = boundingClientRect.jsValue - object[Strings.intersectionRect] = intersectionRect.jsValue - object[Strings.isIntersecting] = isIntersecting.jsValue - object[Strings.intersectionRatio] = intersectionRatio.jsValue - object[Strings.target] = target.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _time = ReadWriteAttribute(jsObject: object, name: Strings.time) - _rootBounds = ReadWriteAttribute(jsObject: object, name: Strings.rootBounds) - _boundingClientRect = ReadWriteAttribute(jsObject: object, name: Strings.boundingClientRect) - _intersectionRect = ReadWriteAttribute(jsObject: object, name: Strings.intersectionRect) - _isIntersecting = ReadWriteAttribute(jsObject: object, name: Strings.isIntersecting) - _intersectionRatio = ReadWriteAttribute(jsObject: object, name: Strings.intersectionRatio) - _target = ReadWriteAttribute(jsObject: object, name: Strings.target) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var time: DOMHighResTimeStamp - - @ReadWriteAttribute - public var rootBounds: DOMRectInit? - - @ReadWriteAttribute - public var boundingClientRect: DOMRectInit - - @ReadWriteAttribute - public var intersectionRect: DOMRectInit - - @ReadWriteAttribute - public var isIntersecting: Bool - - @ReadWriteAttribute - public var intersectionRatio: Double - - @ReadWriteAttribute - public var target: Element -} diff --git a/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift b/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift deleted file mode 100644 index c191425d..00000000 --- a/Sources/DOMKit/WebIDL/IntersectionObserverInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IntersectionObserverInit: BridgedDictionary { - public convenience init(root: Document_or_Element?, rootMargin: String, threshold: Double_or_seq_of_Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.root] = root.jsValue - object[Strings.rootMargin] = rootMargin.jsValue - object[Strings.threshold] = threshold.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _root = ReadWriteAttribute(jsObject: object, name: Strings.root) - _rootMargin = ReadWriteAttribute(jsObject: object, name: Strings.rootMargin) - _threshold = ReadWriteAttribute(jsObject: object, name: Strings.threshold) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var root: Document_or_Element? - - @ReadWriteAttribute - public var rootMargin: String - - @ReadWriteAttribute - public var threshold: Double_or_seq_of_Double -} diff --git a/Sources/DOMKit/WebIDL/InterventionReportBody.swift b/Sources/DOMKit/WebIDL/InterventionReportBody.swift deleted file mode 100644 index b41bbd20..00000000 --- a/Sources/DOMKit/WebIDL/InterventionReportBody.swift +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class InterventionReportBody: ReportBody { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.InterventionReportBody].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) - _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) - _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var message: String - - @ReadonlyAttribute - public var sourceFile: String? - - @ReadonlyAttribute - public var lineNumber: UInt32? - - @ReadonlyAttribute - public var columnNumber: UInt32? -} diff --git a/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift b/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift deleted file mode 100644 index 89f7ed83..00000000 --- a/Sources/DOMKit/WebIDL/IntrinsicSizesResultOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IntrinsicSizesResultOptions: BridgedDictionary { - public convenience init(maxContentSize: Double, minContentSize: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.maxContentSize] = maxContentSize.jsValue - object[Strings.minContentSize] = minContentSize.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _maxContentSize = ReadWriteAttribute(jsObject: object, name: Strings.maxContentSize) - _minContentSize = ReadWriteAttribute(jsObject: object, name: Strings.minContentSize) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var maxContentSize: Double - - @ReadWriteAttribute - public var minContentSize: Double -} diff --git a/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift b/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift deleted file mode 100644 index e6eb4a6a..00000000 --- a/Sources/DOMKit/WebIDL/IsInputPendingOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IsInputPendingOptions: BridgedDictionary { - public convenience init(includeContinuous: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.includeContinuous] = includeContinuous.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _includeContinuous = ReadWriteAttribute(jsObject: object, name: Strings.includeContinuous) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var includeContinuous: Bool -} diff --git a/Sources/DOMKit/WebIDL/IsVisibleOptions.swift b/Sources/DOMKit/WebIDL/IsVisibleOptions.swift deleted file mode 100644 index 2cf015a8..00000000 --- a/Sources/DOMKit/WebIDL/IsVisibleOptions.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class IsVisibleOptions: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/ItemDetails.swift b/Sources/DOMKit/WebIDL/ItemDetails.swift deleted file mode 100644 index 719889e1..00000000 --- a/Sources/DOMKit/WebIDL/ItemDetails.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ItemDetails: BridgedDictionary { - public convenience init(itemId: String, title: String, price: PaymentCurrencyAmount, type: ItemType, description: String, iconURLs: [String], subscriptionPeriod: String, freeTrialPeriod: String, introductoryPrice: PaymentCurrencyAmount, introductoryPricePeriod: String, introductoryPriceCycles: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.itemId] = itemId.jsValue - object[Strings.title] = title.jsValue - object[Strings.price] = price.jsValue - object[Strings.type] = type.jsValue - object[Strings.description] = description.jsValue - object[Strings.iconURLs] = iconURLs.jsValue - object[Strings.subscriptionPeriod] = subscriptionPeriod.jsValue - object[Strings.freeTrialPeriod] = freeTrialPeriod.jsValue - object[Strings.introductoryPrice] = introductoryPrice.jsValue - object[Strings.introductoryPricePeriod] = introductoryPricePeriod.jsValue - object[Strings.introductoryPriceCycles] = introductoryPriceCycles.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _itemId = ReadWriteAttribute(jsObject: object, name: Strings.itemId) - _title = ReadWriteAttribute(jsObject: object, name: Strings.title) - _price = ReadWriteAttribute(jsObject: object, name: Strings.price) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _description = ReadWriteAttribute(jsObject: object, name: Strings.description) - _iconURLs = ReadWriteAttribute(jsObject: object, name: Strings.iconURLs) - _subscriptionPeriod = ReadWriteAttribute(jsObject: object, name: Strings.subscriptionPeriod) - _freeTrialPeriod = ReadWriteAttribute(jsObject: object, name: Strings.freeTrialPeriod) - _introductoryPrice = ReadWriteAttribute(jsObject: object, name: Strings.introductoryPrice) - _introductoryPricePeriod = ReadWriteAttribute(jsObject: object, name: Strings.introductoryPricePeriod) - _introductoryPriceCycles = ReadWriteAttribute(jsObject: object, name: Strings.introductoryPriceCycles) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var itemId: String - - @ReadWriteAttribute - public var title: String - - @ReadWriteAttribute - public var price: PaymentCurrencyAmount - - @ReadWriteAttribute - public var type: ItemType - - @ReadWriteAttribute - public var description: String - - @ReadWriteAttribute - public var iconURLs: [String] - - @ReadWriteAttribute - public var subscriptionPeriod: String - - @ReadWriteAttribute - public var freeTrialPeriod: String - - @ReadWriteAttribute - public var introductoryPrice: PaymentCurrencyAmount - - @ReadWriteAttribute - public var introductoryPricePeriod: String - - @ReadWriteAttribute - public var introductoryPriceCycles: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/ItemType.swift b/Sources/DOMKit/WebIDL/ItemType.swift deleted file mode 100644 index 5a1695eb..00000000 --- a/Sources/DOMKit/WebIDL/ItemType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ItemType: JSString, JSValueCompatible { - case product = "product" - case subscription = "subscription" - - @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/IterationCompositeOperation.swift b/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift deleted file mode 100644 index 282f8955..00000000 --- a/Sources/DOMKit/WebIDL/IterationCompositeOperation.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum IterationCompositeOperation: JSString, JSValueCompatible { - case replace = "replace" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/JsonWebKey.swift b/Sources/DOMKit/WebIDL/JsonWebKey.swift deleted file mode 100644 index f403efe3..00000000 --- a/Sources/DOMKit/WebIDL/JsonWebKey.swift +++ /dev/null @@ -1,105 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class JsonWebKey: BridgedDictionary { - public convenience init(kty: String, use: String, key_ops: [String], alg: String, ext: Bool, crv: String, x: String, y: String, d: String, n: String, e: String, p: String, q: String, dp: String, dq: String, qi: String, oth: [RsaOtherPrimesInfo], k: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.kty] = kty.jsValue - object[Strings.use] = use.jsValue - object[Strings.key_ops] = key_ops.jsValue - object[Strings.alg] = alg.jsValue - object[Strings.ext] = ext.jsValue - object[Strings.crv] = crv.jsValue - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - object[Strings.d] = d.jsValue - object[Strings.n] = n.jsValue - object[Strings.e] = e.jsValue - object[Strings.p] = p.jsValue - object[Strings.q] = q.jsValue - object[Strings.dp] = dp.jsValue - object[Strings.dq] = dq.jsValue - object[Strings.qi] = qi.jsValue - object[Strings.oth] = oth.jsValue - object[Strings.k] = k.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _kty = ReadWriteAttribute(jsObject: object, name: Strings.kty) - _use = ReadWriteAttribute(jsObject: object, name: Strings.use) - _key_ops = ReadWriteAttribute(jsObject: object, name: Strings.key_ops) - _alg = ReadWriteAttribute(jsObject: object, name: Strings.alg) - _ext = ReadWriteAttribute(jsObject: object, name: Strings.ext) - _crv = ReadWriteAttribute(jsObject: object, name: Strings.crv) - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - _d = ReadWriteAttribute(jsObject: object, name: Strings.d) - _n = ReadWriteAttribute(jsObject: object, name: Strings.n) - _e = ReadWriteAttribute(jsObject: object, name: Strings.e) - _p = ReadWriteAttribute(jsObject: object, name: Strings.p) - _q = ReadWriteAttribute(jsObject: object, name: Strings.q) - _dp = ReadWriteAttribute(jsObject: object, name: Strings.dp) - _dq = ReadWriteAttribute(jsObject: object, name: Strings.dq) - _qi = ReadWriteAttribute(jsObject: object, name: Strings.qi) - _oth = ReadWriteAttribute(jsObject: object, name: Strings.oth) - _k = ReadWriteAttribute(jsObject: object, name: Strings.k) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var kty: String - - @ReadWriteAttribute - public var use: String - - @ReadWriteAttribute - public var key_ops: [String] - - @ReadWriteAttribute - public var alg: String - - @ReadWriteAttribute - public var ext: Bool - - @ReadWriteAttribute - public var crv: String - - @ReadWriteAttribute - public var x: String - - @ReadWriteAttribute - public var y: String - - @ReadWriteAttribute - public var d: String - - @ReadWriteAttribute - public var n: String - - @ReadWriteAttribute - public var e: String - - @ReadWriteAttribute - public var p: String - - @ReadWriteAttribute - public var q: String - - @ReadWriteAttribute - public var dp: String - - @ReadWriteAttribute - public var dq: String - - @ReadWriteAttribute - public var qi: String - - @ReadWriteAttribute - public var oth: [RsaOtherPrimesInfo] - - @ReadWriteAttribute - public var k: String -} diff --git a/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift b/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift deleted file mode 100644 index b7a51d31..00000000 --- a/Sources/DOMKit/WebIDL/KHR_parallel_shader_compile.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class KHR_parallel_shader_compile: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.KHR_parallel_shader_compile].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COMPLETION_STATUS_KHR: GLenum = 0x91B1 -} diff --git a/Sources/DOMKit/WebIDL/KeyAlgorithm.swift b/Sources/DOMKit/WebIDL/KeyAlgorithm.swift deleted file mode 100644 index 9cdf95f5..00000000 --- a/Sources/DOMKit/WebIDL/KeyAlgorithm.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class KeyAlgorithm: BridgedDictionary { - public convenience init(name: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String -} diff --git a/Sources/DOMKit/WebIDL/KeyFormat.swift b/Sources/DOMKit/WebIDL/KeyFormat.swift deleted file mode 100644 index 990af1f5..00000000 --- a/Sources/DOMKit/WebIDL/KeyFormat.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum KeyFormat: JSString, JSValueCompatible { - case raw = "raw" - case spki = "spki" - case pkcs8 = "pkcs8" - case jwk = "jwk" - - @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/KeySystemTrackConfiguration.swift b/Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift deleted file mode 100644 index 4518ec1f..00000000 --- a/Sources/DOMKit/WebIDL/KeySystemTrackConfiguration.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class KeySystemTrackConfiguration: BridgedDictionary { - public convenience init(robustness: String, encryptionScheme: String?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.robustness] = robustness.jsValue - object[Strings.encryptionScheme] = encryptionScheme.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _robustness = ReadWriteAttribute(jsObject: object, name: Strings.robustness) - _encryptionScheme = ReadWriteAttribute(jsObject: object, name: Strings.encryptionScheme) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var robustness: String - - @ReadWriteAttribute - public var encryptionScheme: String? -} diff --git a/Sources/DOMKit/WebIDL/KeyType.swift b/Sources/DOMKit/WebIDL/KeyType.swift deleted file mode 100644 index e547bf2f..00000000 --- a/Sources/DOMKit/WebIDL/KeyType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum KeyType: JSString, JSValueCompatible { - case `public` = "public" - case `private` = "private" - case secret = "secret" - - @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/KeyUsage.swift b/Sources/DOMKit/WebIDL/KeyUsage.swift deleted file mode 100644 index ca26fc12..00000000 --- a/Sources/DOMKit/WebIDL/KeyUsage.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum KeyUsage: JSString, JSValueCompatible { - case encrypt = "encrypt" - case decrypt = "decrypt" - case sign = "sign" - case verify = "verify" - case deriveKey = "deriveKey" - case deriveBits = "deriveBits" - case wrapKey = "wrapKey" - case unwrapKey = "unwrapKey" - - @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/Keyboard.swift b/Sources/DOMKit/WebIDL/Keyboard.swift deleted file mode 100644 index 63a8d41c..00000000 --- a/Sources/DOMKit/WebIDL/Keyboard.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Keyboard: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Keyboard].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onlayoutchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onlayoutchange) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func lock(keyCodes: [String]? = nil) -> JSPromise { - let this = jsObject - return this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func lock(keyCodes: [String]? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [keyCodes?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func unlock() { - let this = jsObject - _ = this[Strings.unlock].function!(this: this, arguments: []) - } - - @inlinable public func getLayoutMap() -> JSPromise { - let this = jsObject - return this[Strings.getLayoutMap].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getLayoutMap() async throws -> KeyboardLayoutMap { - let this = jsObject - let _promise: JSPromise = this[Strings.getLayoutMap].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ClosureAttribute1Optional - public var onlayoutchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift b/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift deleted file mode 100644 index 53c396b0..00000000 --- a/Sources/DOMKit/WebIDL/KeyboardLayoutMap.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class KeyboardLayoutMap: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.KeyboardLayoutMap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/KeyframeEffect.swift b/Sources/DOMKit/WebIDL/KeyframeEffect.swift index 6c560b1d..9569bb56 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffect.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffect.swift @@ -7,16 +7,12 @@ public class KeyframeEffect: AnimationEffect { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.KeyframeEffect].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _iterationComposite = ReadWriteAttribute(jsObject: jsObject, name: Strings.iterationComposite) _target = ReadWriteAttribute(jsObject: jsObject, name: Strings.target) _pseudoElement = ReadWriteAttribute(jsObject: jsObject, name: Strings.pseudoElement) _composite = ReadWriteAttribute(jsObject: jsObject, name: Strings.composite) super.init(unsafelyWrapping: jsObject) } - @ReadWriteAttribute - public var iterationComposite: IterationCompositeOperation - @inlinable public convenience init(target: Element?, keyframes: JSObject?, options: Double_or_KeyframeEffectOptions? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [target.jsValue, keyframes.jsValue, options?.jsValue ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift index 6db4c613..d6be80df 100644 --- a/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift +++ b/Sources/DOMKit/WebIDL/KeyframeEffectOptions.swift @@ -4,24 +4,19 @@ import JavaScriptEventLoop import JavaScriptKit public class KeyframeEffectOptions: BridgedDictionary { - public convenience init(iterationComposite: IterationCompositeOperation, composite: CompositeOperation, pseudoElement: String?) { + public convenience init(composite: CompositeOperation, pseudoElement: String?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iterationComposite] = iterationComposite.jsValue object[Strings.composite] = composite.jsValue object[Strings.pseudoElement] = pseudoElement.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _iterationComposite = ReadWriteAttribute(jsObject: object, name: Strings.iterationComposite) _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) _pseudoElement = ReadWriteAttribute(jsObject: object, name: Strings.pseudoElement) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var iterationComposite: IterationCompositeOperation - @ReadWriteAttribute public var composite: CompositeOperation diff --git a/Sources/DOMKit/WebIDL/Landmark.swift b/Sources/DOMKit/WebIDL/Landmark.swift deleted file mode 100644 index 2f020458..00000000 --- a/Sources/DOMKit/WebIDL/Landmark.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Landmark: BridgedDictionary { - public convenience init(locations: [Point2D], type: LandmarkType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.locations] = locations.jsValue - object[Strings.type] = type.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _locations = ReadWriteAttribute(jsObject: object, name: Strings.locations) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var locations: [Point2D] - - @ReadWriteAttribute - public var type: LandmarkType -} diff --git a/Sources/DOMKit/WebIDL/LandmarkType.swift b/Sources/DOMKit/WebIDL/LandmarkType.swift deleted file mode 100644 index 277a8376..00000000 --- a/Sources/DOMKit/WebIDL/LandmarkType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum LandmarkType: JSString, JSValueCompatible { - case mouth = "mouth" - case eye = "eye" - case nose = "nose" - - @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/LargeBlobSupport.swift b/Sources/DOMKit/WebIDL/LargeBlobSupport.swift deleted file mode 100644 index 26959708..00000000 --- a/Sources/DOMKit/WebIDL/LargeBlobSupport.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum LargeBlobSupport: JSString, JSValueCompatible { - case required = "required" - case preferred = "preferred" - - @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/LargestContentfulPaint.swift b/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift deleted file mode 100644 index d12d5974..00000000 --- a/Sources/DOMKit/WebIDL/LargestContentfulPaint.swift +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LargestContentfulPaint: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.LargestContentfulPaint].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _renderTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderTime) - _loadTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadTime) - _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - _element = ReadonlyAttribute(jsObject: jsObject, name: Strings.element) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var renderTime: DOMHighResTimeStamp - - @ReadonlyAttribute - public var loadTime: DOMHighResTimeStamp - - @ReadonlyAttribute - public var size: UInt32 - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var url: String - - @ReadonlyAttribute - public var element: Element? - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift b/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift deleted file mode 100644 index c6721698..00000000 --- a/Sources/DOMKit/WebIDL/LayoutConstraintsOptions.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LayoutConstraintsOptions: BridgedDictionary { - public convenience init(availableInlineSize: Double, availableBlockSize: Double, fixedInlineSize: Double, fixedBlockSize: Double, percentageInlineSize: Double, percentageBlockSize: Double, blockFragmentationOffset: Double, blockFragmentationType: BlockFragmentationType, data: JSValue) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.availableInlineSize] = availableInlineSize.jsValue - object[Strings.availableBlockSize] = availableBlockSize.jsValue - object[Strings.fixedInlineSize] = fixedInlineSize.jsValue - object[Strings.fixedBlockSize] = fixedBlockSize.jsValue - object[Strings.percentageInlineSize] = percentageInlineSize.jsValue - object[Strings.percentageBlockSize] = percentageBlockSize.jsValue - object[Strings.blockFragmentationOffset] = blockFragmentationOffset.jsValue - object[Strings.blockFragmentationType] = blockFragmentationType.jsValue - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _availableInlineSize = ReadWriteAttribute(jsObject: object, name: Strings.availableInlineSize) - _availableBlockSize = ReadWriteAttribute(jsObject: object, name: Strings.availableBlockSize) - _fixedInlineSize = ReadWriteAttribute(jsObject: object, name: Strings.fixedInlineSize) - _fixedBlockSize = ReadWriteAttribute(jsObject: object, name: Strings.fixedBlockSize) - _percentageInlineSize = ReadWriteAttribute(jsObject: object, name: Strings.percentageInlineSize) - _percentageBlockSize = ReadWriteAttribute(jsObject: object, name: Strings.percentageBlockSize) - _blockFragmentationOffset = ReadWriteAttribute(jsObject: object, name: Strings.blockFragmentationOffset) - _blockFragmentationType = ReadWriteAttribute(jsObject: object, name: Strings.blockFragmentationType) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var availableInlineSize: Double - - @ReadWriteAttribute - public var availableBlockSize: Double - - @ReadWriteAttribute - public var fixedInlineSize: Double - - @ReadWriteAttribute - public var fixedBlockSize: Double - - @ReadWriteAttribute - public var percentageInlineSize: Double - - @ReadWriteAttribute - public var percentageBlockSize: Double - - @ReadWriteAttribute - public var blockFragmentationOffset: Double - - @ReadWriteAttribute - public var blockFragmentationType: BlockFragmentationType - - @ReadWriteAttribute - public var data: JSValue -} diff --git a/Sources/DOMKit/WebIDL/LayoutOptions.swift b/Sources/DOMKit/WebIDL/LayoutOptions.swift deleted file mode 100644 index 8c2538d8..00000000 --- a/Sources/DOMKit/WebIDL/LayoutOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LayoutOptions: BridgedDictionary { - public convenience init(childDisplay: ChildDisplayType, sizing: LayoutSizingMode) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.childDisplay] = childDisplay.jsValue - object[Strings.sizing] = sizing.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _childDisplay = ReadWriteAttribute(jsObject: object, name: Strings.childDisplay) - _sizing = ReadWriteAttribute(jsObject: object, name: Strings.sizing) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var childDisplay: ChildDisplayType - - @ReadWriteAttribute - public var sizing: LayoutSizingMode -} diff --git a/Sources/DOMKit/WebIDL/LayoutShift.swift b/Sources/DOMKit/WebIDL/LayoutShift.swift deleted file mode 100644 index 484537c5..00000000 --- a/Sources/DOMKit/WebIDL/LayoutShift.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LayoutShift: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.LayoutShift].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - _hadRecentInput = ReadonlyAttribute(jsObject: jsObject, name: Strings.hadRecentInput) - _lastInputTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastInputTime) - _sources = ReadonlyAttribute(jsObject: jsObject, name: Strings.sources) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var value: Double - - @ReadonlyAttribute - public var hadRecentInput: Bool - - @ReadonlyAttribute - public var lastInputTime: DOMHighResTimeStamp - - @ReadonlyAttribute - public var sources: [LayoutShiftAttribution] - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift b/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift deleted file mode 100644 index 95ccb310..00000000 --- a/Sources/DOMKit/WebIDL/LayoutShiftAttribution.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LayoutShiftAttribution: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LayoutShiftAttribution].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _node = ReadonlyAttribute(jsObject: jsObject, name: Strings.node) - _previousRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.previousRect) - _currentRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentRect) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var node: Node? - - @ReadonlyAttribute - public var previousRect: DOMRectReadOnly - - @ReadonlyAttribute - public var currentRect: DOMRectReadOnly -} diff --git a/Sources/DOMKit/WebIDL/LayoutSizingMode.swift b/Sources/DOMKit/WebIDL/LayoutSizingMode.swift deleted file mode 100644 index 28b0851b..00000000 --- a/Sources/DOMKit/WebIDL/LayoutSizingMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum LayoutSizingMode: JSString, JSValueCompatible { - case blockLike = "block-like" - case manual = "manual" - - @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/LineAlignSetting.swift b/Sources/DOMKit/WebIDL/LineAlignSetting.swift deleted file mode 100644 index 0275ca7b..00000000 --- a/Sources/DOMKit/WebIDL/LineAlignSetting.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum LineAlignSetting: JSString, JSValueCompatible { - case start = "start" - case center = "center" - case end = "end" - - @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/LineAndPositionSetting.swift b/Sources/DOMKit/WebIDL/LineAndPositionSetting.swift deleted file mode 100644 index a929527f..00000000 --- a/Sources/DOMKit/WebIDL/LineAndPositionSetting.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_LineAndPositionSetting: ConvertibleToJSValue {} -extension AutoKeyword: Any_LineAndPositionSetting {} -extension Double: Any_LineAndPositionSetting {} - -public enum LineAndPositionSetting: JSValueCompatible, Any_LineAndPositionSetting { - case autoKeyword(AutoKeyword) - case double(Double) - - public static func construct(from value: JSValue) -> Self? { - if let autoKeyword: AutoKeyword = value.fromJSValue() { - return .autoKeyword(autoKeyword) - } - if let double: Double = value.fromJSValue() { - return .double(double) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .autoKeyword(autoKeyword): - return autoKeyword.jsValue - case let .double(double): - return double.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/LinearAccelerationReadingValues.swift b/Sources/DOMKit/WebIDL/LinearAccelerationReadingValues.swift deleted file mode 100644 index af71982f..00000000 --- a/Sources/DOMKit/WebIDL/LinearAccelerationReadingValues.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LinearAccelerationReadingValues: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift b/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift deleted file mode 100644 index 8f50b1ae..00000000 --- a/Sources/DOMKit/WebIDL/LinearAccelerationSensor.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LinearAccelerationSensor: Accelerometer { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.LinearAccelerationSensor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: AccelerometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } -} diff --git a/Sources/DOMKit/WebIDL/Lock.swift b/Sources/DOMKit/WebIDL/Lock.swift deleted file mode 100644 index 4b599193..00000000 --- a/Sources/DOMKit/WebIDL/Lock.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Lock: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Lock].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var mode: LockMode -} diff --git a/Sources/DOMKit/WebIDL/LockInfo.swift b/Sources/DOMKit/WebIDL/LockInfo.swift deleted file mode 100644 index 14a499d0..00000000 --- a/Sources/DOMKit/WebIDL/LockInfo.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LockInfo: BridgedDictionary { - public convenience init(name: String, mode: LockMode, clientId: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.mode] = mode.jsValue - object[Strings.clientId] = clientId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) - _clientId = ReadWriteAttribute(jsObject: object, name: Strings.clientId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var mode: LockMode - - @ReadWriteAttribute - public var clientId: String -} diff --git a/Sources/DOMKit/WebIDL/LockManager.swift b/Sources/DOMKit/WebIDL/LockManager.swift deleted file mode 100644 index edc20d31..00000000 --- a/Sources/DOMKit/WebIDL/LockManager.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LockManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.LockManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: member 'request' is ignored - - // XXX: member 'request' is ignored - - // XXX: member 'request' is ignored - - // XXX: member 'request' is ignored - - @inlinable public func query() -> JSPromise { - let this = jsObject - return this[Strings.query].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func query() async throws -> LockManagerSnapshot { - let this = jsObject - let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift b/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift deleted file mode 100644 index 4e6e9221..00000000 --- a/Sources/DOMKit/WebIDL/LockManagerSnapshot.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LockManagerSnapshot: BridgedDictionary { - public convenience init(held: [LockInfo], pending: [LockInfo]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.held] = held.jsValue - object[Strings.pending] = pending.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _held = ReadWriteAttribute(jsObject: object, name: Strings.held) - _pending = ReadWriteAttribute(jsObject: object, name: Strings.pending) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var held: [LockInfo] - - @ReadWriteAttribute - public var pending: [LockInfo] -} diff --git a/Sources/DOMKit/WebIDL/LockMode.swift b/Sources/DOMKit/WebIDL/LockMode.swift deleted file mode 100644 index e714cae0..00000000 --- a/Sources/DOMKit/WebIDL/LockMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum LockMode: JSString, JSValueCompatible { - case shared = "shared" - case exclusive = "exclusive" - - @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/LockOptions.swift b/Sources/DOMKit/WebIDL/LockOptions.swift deleted file mode 100644 index 0dee3386..00000000 --- a/Sources/DOMKit/WebIDL/LockOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class LockOptions: BridgedDictionary { - public convenience init(mode: LockMode, ifAvailable: Bool, steal: Bool, signal: AbortSignal) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue - object[Strings.ifAvailable] = ifAvailable.jsValue - object[Strings.steal] = steal.jsValue - object[Strings.signal] = signal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) - _ifAvailable = ReadWriteAttribute(jsObject: object, name: Strings.ifAvailable) - _steal = ReadWriteAttribute(jsObject: object, name: Strings.steal) - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mode: LockMode - - @ReadWriteAttribute - public var ifAvailable: Bool - - @ReadWriteAttribute - public var steal: Bool - - @ReadWriteAttribute - public var signal: AbortSignal -} diff --git a/Sources/DOMKit/WebIDL/MIDIAccess.swift b/Sources/DOMKit/WebIDL/MIDIAccess.swift deleted file mode 100644 index 29898415..00000000 --- a/Sources/DOMKit/WebIDL/MIDIAccess.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIAccess: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIAccess].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _inputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputs) - _outputs = ReadonlyAttribute(jsObject: jsObject, name: Strings.outputs) - _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) - _sysexEnabled = ReadonlyAttribute(jsObject: jsObject, name: Strings.sysexEnabled) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var inputs: MIDIInputMap - - @ReadonlyAttribute - public var outputs: MIDIOutputMap - - @ClosureAttribute1Optional - public var onstatechange: EventHandler - - @ReadonlyAttribute - public var sysexEnabled: Bool -} diff --git a/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift b/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift deleted file mode 100644 index 17fbad89..00000000 --- a/Sources/DOMKit/WebIDL/MIDIConnectionEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIConnectionEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIConnectionEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: MIDIConnectionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var port: MIDIPort -} diff --git a/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift b/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift deleted file mode 100644 index 0481f338..00000000 --- a/Sources/DOMKit/WebIDL/MIDIConnectionEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIConnectionEventInit: BridgedDictionary { - public convenience init(port: MIDIPort) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.port] = port.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _port = ReadWriteAttribute(jsObject: object, name: Strings.port) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var port: MIDIPort -} diff --git a/Sources/DOMKit/WebIDL/MIDIInput.swift b/Sources/DOMKit/WebIDL/MIDIInput.swift deleted file mode 100644 index 2f720958..00000000 --- a/Sources/DOMKit/WebIDL/MIDIInput.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIInput: MIDIPort { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIInput].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onmidimessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmidimessage) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var onmidimessage: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/MIDIInputMap.swift b/Sources/DOMKit/WebIDL/MIDIInputMap.swift deleted file mode 100644 index ce5ff81f..00000000 --- a/Sources/DOMKit/WebIDL/MIDIInputMap.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIInputMap: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MIDIInputMap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift b/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift deleted file mode 100644 index f7b34d51..00000000 --- a/Sources/DOMKit/WebIDL/MIDIMessageEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIMessageEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIMessageEvent].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: MIDIMessageEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var data: Uint8Array -} diff --git a/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift b/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift deleted file mode 100644 index f7951e61..00000000 --- a/Sources/DOMKit/WebIDL/MIDIMessageEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIMessageEventInit: BridgedDictionary { - public convenience init(data: Uint8Array) { - 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: Uint8Array -} diff --git a/Sources/DOMKit/WebIDL/MIDIOptions.swift b/Sources/DOMKit/WebIDL/MIDIOptions.swift deleted file mode 100644 index b5367f5a..00000000 --- a/Sources/DOMKit/WebIDL/MIDIOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIOptions: BridgedDictionary { - public convenience init(sysex: Bool, software: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sysex] = sysex.jsValue - object[Strings.software] = software.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _sysex = ReadWriteAttribute(jsObject: object, name: Strings.sysex) - _software = ReadWriteAttribute(jsObject: object, name: Strings.software) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var sysex: Bool - - @ReadWriteAttribute - public var software: Bool -} diff --git a/Sources/DOMKit/WebIDL/MIDIOutput.swift b/Sources/DOMKit/WebIDL/MIDIOutput.swift deleted file mode 100644 index 80b6bded..00000000 --- a/Sources/DOMKit/WebIDL/MIDIOutput.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIOutput: MIDIPort { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIOutput].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func send(data: [UInt8], timestamp: DOMHighResTimeStamp? = nil) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue, timestamp?.jsValue ?? .undefined]) - } - - @inlinable public func clear() { - let this = jsObject - _ = this[Strings.clear].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/MIDIOutputMap.swift b/Sources/DOMKit/WebIDL/MIDIOutputMap.swift deleted file mode 100644 index 167b390e..00000000 --- a/Sources/DOMKit/WebIDL/MIDIOutputMap.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIOutputMap: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MIDIOutputMap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/MIDIPort.swift b/Sources/DOMKit/WebIDL/MIDIPort.swift deleted file mode 100644 index 2d7042fd..00000000 --- a/Sources/DOMKit/WebIDL/MIDIPort.swift +++ /dev/null @@ -1,68 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MIDIPort: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MIDIPort].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _manufacturer = ReadonlyAttribute(jsObject: jsObject, name: Strings.manufacturer) - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _version = ReadonlyAttribute(jsObject: jsObject, name: Strings.version) - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _connection = ReadonlyAttribute(jsObject: jsObject, name: Strings.connection) - _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var manufacturer: String? - - @ReadonlyAttribute - public var name: String? - - @ReadonlyAttribute - public var type: MIDIPortType - - @ReadonlyAttribute - public var version: String? - - @ReadonlyAttribute - public var state: MIDIPortDeviceState - - @ReadonlyAttribute - public var connection: MIDIPortConnectionState - - @ClosureAttribute1Optional - public var onstatechange: EventHandler - - @inlinable public func open() -> JSPromise { - let this = jsObject - return this[Strings.open].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func open() async throws -> MIDIPort { - let this = jsObject - let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @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 -> MIDIPort { - let this = jsObject - let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift b/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift deleted file mode 100644 index 361b16d6..00000000 --- a/Sources/DOMKit/WebIDL/MIDIPortConnectionState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MIDIPortConnectionState: JSString, JSValueCompatible { - case open = "open" - case closed = "closed" - case pending = "pending" - - @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/MIDIPortDeviceState.swift b/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift deleted file mode 100644 index 5ee64b87..00000000 --- a/Sources/DOMKit/WebIDL/MIDIPortDeviceState.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MIDIPortDeviceState: JSString, JSValueCompatible { - case disconnected = "disconnected" - case connected = "connected" - - @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/MIDIPortType.swift b/Sources/DOMKit/WebIDL/MIDIPortType.swift deleted file mode 100644 index eacda4b0..00000000 --- a/Sources/DOMKit/WebIDL/MIDIPortType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MIDIPortType: JSString, JSValueCompatible { - case input = "input" - case output = "output" - - @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/ML.swift b/Sources/DOMKit/WebIDL/ML.swift deleted file mode 100644 index 53e3ae30..00000000 --- a/Sources/DOMKit/WebIDL/ML.swift +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ML: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ML].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func createContext(options: MLContextOptions? = nil) -> MLContext { - let this = jsObject - return this[Strings.createContext].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createContext(glContext: WebGLRenderingContext) -> MLContext { - let this = jsObject - return this[Strings.createContext].function!(this: this, arguments: [glContext.jsValue]).fromJSValue()! - } - - @inlinable public func createContext(gpuDevice: GPUDevice) -> MLContext { - let this = jsObject - return this[Strings.createContext].function!(this: this, arguments: [gpuDevice.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/MLAutoPad.swift b/Sources/DOMKit/WebIDL/MLAutoPad.swift deleted file mode 100644 index 0def6e1d..00000000 --- a/Sources/DOMKit/WebIDL/MLAutoPad.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLAutoPad: JSString, JSValueCompatible { - case explicit = "explicit" - case sameUpper = "same-upper" - case sameLower = "same-lower" - - @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/MLBatchNormalizationOptions.swift b/Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift deleted file mode 100644 index f6aed4f2..00000000 --- a/Sources/DOMKit/WebIDL/MLBatchNormalizationOptions.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLBatchNormalizationOptions: BridgedDictionary { - public convenience init(scale: MLOperand, bias: MLOperand, axis: Int32, epsilon: Float, activation: MLOperator) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.scale] = scale.jsValue - object[Strings.bias] = bias.jsValue - object[Strings.axis] = axis.jsValue - object[Strings.epsilon] = epsilon.jsValue - object[Strings.activation] = activation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _scale = ReadWriteAttribute(jsObject: object, name: Strings.scale) - _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) - _axis = ReadWriteAttribute(jsObject: object, name: Strings.axis) - _epsilon = ReadWriteAttribute(jsObject: object, name: Strings.epsilon) - _activation = ReadWriteAttribute(jsObject: object, name: Strings.activation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var scale: MLOperand - - @ReadWriteAttribute - public var bias: MLOperand - - @ReadWriteAttribute - public var axis: Int32 - - @ReadWriteAttribute - public var epsilon: Float - - @ReadWriteAttribute - public var activation: MLOperator -} diff --git a/Sources/DOMKit/WebIDL/MLBufferResourceView.swift b/Sources/DOMKit/WebIDL/MLBufferResourceView.swift deleted file mode 100644 index 329c531d..00000000 --- a/Sources/DOMKit/WebIDL/MLBufferResourceView.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLBufferResourceView: BridgedDictionary { - public convenience init(resource: GPUBuffer_or_WebGLBuffer, offset: UInt64, size: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.resource] = resource.jsValue - object[Strings.offset] = offset.jsValue - object[Strings.size] = size.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _resource = ReadWriteAttribute(jsObject: object, name: Strings.resource) - _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) - _size = ReadWriteAttribute(jsObject: object, name: Strings.size) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var resource: GPUBuffer_or_WebGLBuffer - - @ReadWriteAttribute - public var offset: UInt64 - - @ReadWriteAttribute - public var size: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/MLBufferView.swift b/Sources/DOMKit/WebIDL/MLBufferView.swift deleted file mode 100644 index 3961d095..00000000 --- a/Sources/DOMKit/WebIDL/MLBufferView.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_MLBufferView: ConvertibleToJSValue {} -extension ArrayBufferView: Any_MLBufferView {} -extension MLBufferResourceView: Any_MLBufferView {} - -public enum MLBufferView: JSValueCompatible, Any_MLBufferView { - case arrayBufferView(ArrayBufferView) - case mLBufferResourceView(MLBufferResourceView) - - public static func construct(from value: JSValue) -> Self? { - if let arrayBufferView: ArrayBufferView = value.fromJSValue() { - return .arrayBufferView(arrayBufferView) - } - if let mLBufferResourceView: MLBufferResourceView = value.fromJSValue() { - return .mLBufferResourceView(mLBufferResourceView) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .arrayBufferView(arrayBufferView): - return arrayBufferView.jsValue - case let .mLBufferResourceView(mLBufferResourceView): - return mLBufferResourceView.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/MLClampOptions.swift b/Sources/DOMKit/WebIDL/MLClampOptions.swift deleted file mode 100644 index bde88166..00000000 --- a/Sources/DOMKit/WebIDL/MLClampOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLClampOptions: BridgedDictionary { - public convenience init(minValue: Float, maxValue: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.minValue] = minValue.jsValue - object[Strings.maxValue] = maxValue.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _minValue = ReadWriteAttribute(jsObject: object, name: Strings.minValue) - _maxValue = ReadWriteAttribute(jsObject: object, name: Strings.maxValue) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var minValue: Float - - @ReadWriteAttribute - public var maxValue: Float -} diff --git a/Sources/DOMKit/WebIDL/MLContext.swift b/Sources/DOMKit/WebIDL/MLContext.swift deleted file mode 100644 index 28405a12..00000000 --- a/Sources/DOMKit/WebIDL/MLContext.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLContext: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLContext].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/MLContextOptions.swift b/Sources/DOMKit/WebIDL/MLContextOptions.swift deleted file mode 100644 index bbfba5fa..00000000 --- a/Sources/DOMKit/WebIDL/MLContextOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLContextOptions: BridgedDictionary { - public convenience init(devicePreference: MLDevicePreference, powerPreference: MLPowerPreference) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.devicePreference] = devicePreference.jsValue - object[Strings.powerPreference] = powerPreference.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _devicePreference = ReadWriteAttribute(jsObject: object, name: Strings.devicePreference) - _powerPreference = ReadWriteAttribute(jsObject: object, name: Strings.powerPreference) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var devicePreference: MLDevicePreference - - @ReadWriteAttribute - public var powerPreference: MLPowerPreference -} diff --git a/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift b/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift deleted file mode 100644 index b4ae617c..00000000 --- a/Sources/DOMKit/WebIDL/MLConv2dFilterOperandLayout.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLConv2dFilterOperandLayout: JSString, JSValueCompatible { - case oihw = "oihw" - case hwio = "hwio" - case ohwi = "ohwi" - case ihwo = "ihwo" - - @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/MLConv2dOptions.swift b/Sources/DOMKit/WebIDL/MLConv2dOptions.swift deleted file mode 100644 index 68a654af..00000000 --- a/Sources/DOMKit/WebIDL/MLConv2dOptions.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLConv2dOptions: BridgedDictionary { - public convenience init(padding: [Int32], strides: [Int32], dilations: [Int32], autoPad: MLAutoPad, groups: Int32, inputLayout: MLInputOperandLayout, filterLayout: MLConv2dFilterOperandLayout, bias: MLOperand, activation: MLOperator) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.padding] = padding.jsValue - object[Strings.strides] = strides.jsValue - object[Strings.dilations] = dilations.jsValue - object[Strings.autoPad] = autoPad.jsValue - object[Strings.groups] = groups.jsValue - object[Strings.inputLayout] = inputLayout.jsValue - object[Strings.filterLayout] = filterLayout.jsValue - object[Strings.bias] = bias.jsValue - object[Strings.activation] = activation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _padding = ReadWriteAttribute(jsObject: object, name: Strings.padding) - _strides = ReadWriteAttribute(jsObject: object, name: Strings.strides) - _dilations = ReadWriteAttribute(jsObject: object, name: Strings.dilations) - _autoPad = ReadWriteAttribute(jsObject: object, name: Strings.autoPad) - _groups = ReadWriteAttribute(jsObject: object, name: Strings.groups) - _inputLayout = ReadWriteAttribute(jsObject: object, name: Strings.inputLayout) - _filterLayout = ReadWriteAttribute(jsObject: object, name: Strings.filterLayout) - _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) - _activation = ReadWriteAttribute(jsObject: object, name: Strings.activation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var padding: [Int32] - - @ReadWriteAttribute - public var strides: [Int32] - - @ReadWriteAttribute - public var dilations: [Int32] - - @ReadWriteAttribute - public var autoPad: MLAutoPad - - @ReadWriteAttribute - public var groups: Int32 - - @ReadWriteAttribute - public var inputLayout: MLInputOperandLayout - - @ReadWriteAttribute - public var filterLayout: MLConv2dFilterOperandLayout - - @ReadWriteAttribute - public var bias: MLOperand - - @ReadWriteAttribute - public var activation: MLOperator -} diff --git a/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift b/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift deleted file mode 100644 index 2bf00eff..00000000 --- a/Sources/DOMKit/WebIDL/MLConvTranspose2dFilterOperandLayout.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLConvTranspose2dFilterOperandLayout: JSString, JSValueCompatible { - case iohw = "iohw" - case hwoi = "hwoi" - case ohwi = "ohwi" - - @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/MLConvTranspose2dOptions.swift b/Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift deleted file mode 100644 index 110addf4..00000000 --- a/Sources/DOMKit/WebIDL/MLConvTranspose2dOptions.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLConvTranspose2dOptions: BridgedDictionary { - public convenience init(padding: [Int32], strides: [Int32], dilations: [Int32], outputPadding: [Int32], outputSizes: [Int32], autoPad: MLAutoPad, groups: Int32, inputLayout: MLInputOperandLayout, filterLayout: MLConvTranspose2dFilterOperandLayout, bias: MLOperand, activation: MLOperator) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.padding] = padding.jsValue - object[Strings.strides] = strides.jsValue - object[Strings.dilations] = dilations.jsValue - object[Strings.outputPadding] = outputPadding.jsValue - object[Strings.outputSizes] = outputSizes.jsValue - object[Strings.autoPad] = autoPad.jsValue - object[Strings.groups] = groups.jsValue - object[Strings.inputLayout] = inputLayout.jsValue - object[Strings.filterLayout] = filterLayout.jsValue - object[Strings.bias] = bias.jsValue - object[Strings.activation] = activation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _padding = ReadWriteAttribute(jsObject: object, name: Strings.padding) - _strides = ReadWriteAttribute(jsObject: object, name: Strings.strides) - _dilations = ReadWriteAttribute(jsObject: object, name: Strings.dilations) - _outputPadding = ReadWriteAttribute(jsObject: object, name: Strings.outputPadding) - _outputSizes = ReadWriteAttribute(jsObject: object, name: Strings.outputSizes) - _autoPad = ReadWriteAttribute(jsObject: object, name: Strings.autoPad) - _groups = ReadWriteAttribute(jsObject: object, name: Strings.groups) - _inputLayout = ReadWriteAttribute(jsObject: object, name: Strings.inputLayout) - _filterLayout = ReadWriteAttribute(jsObject: object, name: Strings.filterLayout) - _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) - _activation = ReadWriteAttribute(jsObject: object, name: Strings.activation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var padding: [Int32] - - @ReadWriteAttribute - public var strides: [Int32] - - @ReadWriteAttribute - public var dilations: [Int32] - - @ReadWriteAttribute - public var outputPadding: [Int32] - - @ReadWriteAttribute - public var outputSizes: [Int32] - - @ReadWriteAttribute - public var autoPad: MLAutoPad - - @ReadWriteAttribute - public var groups: Int32 - - @ReadWriteAttribute - public var inputLayout: MLInputOperandLayout - - @ReadWriteAttribute - public var filterLayout: MLConvTranspose2dFilterOperandLayout - - @ReadWriteAttribute - public var bias: MLOperand - - @ReadWriteAttribute - public var activation: MLOperator -} diff --git a/Sources/DOMKit/WebIDL/MLDevicePreference.swift b/Sources/DOMKit/WebIDL/MLDevicePreference.swift deleted file mode 100644 index eade9d08..00000000 --- a/Sources/DOMKit/WebIDL/MLDevicePreference.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLDevicePreference: JSString, JSValueCompatible { - case `default` = "default" - case gpu = "gpu" - case cpu = "cpu" - - @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/MLEluOptions.swift b/Sources/DOMKit/WebIDL/MLEluOptions.swift deleted file mode 100644 index 34324736..00000000 --- a/Sources/DOMKit/WebIDL/MLEluOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLEluOptions: BridgedDictionary { - public convenience init(alpha: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var alpha: Float -} diff --git a/Sources/DOMKit/WebIDL/MLGemmOptions.swift b/Sources/DOMKit/WebIDL/MLGemmOptions.swift deleted file mode 100644 index 078be4c2..00000000 --- a/Sources/DOMKit/WebIDL/MLGemmOptions.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLGemmOptions: BridgedDictionary { - public convenience init(c: MLOperand, alpha: Float, beta: Float, aTranspose: Bool, bTranspose: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.c] = c.jsValue - object[Strings.alpha] = alpha.jsValue - object[Strings.beta] = beta.jsValue - object[Strings.aTranspose] = aTranspose.jsValue - object[Strings.bTranspose] = bTranspose.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _c = ReadWriteAttribute(jsObject: object, name: Strings.c) - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) - _aTranspose = ReadWriteAttribute(jsObject: object, name: Strings.aTranspose) - _bTranspose = ReadWriteAttribute(jsObject: object, name: Strings.bTranspose) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var c: MLOperand - - @ReadWriteAttribute - public var alpha: Float - - @ReadWriteAttribute - public var beta: Float - - @ReadWriteAttribute - public var aTranspose: Bool - - @ReadWriteAttribute - public var bTranspose: Bool -} diff --git a/Sources/DOMKit/WebIDL/MLGraph.swift b/Sources/DOMKit/WebIDL/MLGraph.swift deleted file mode 100644 index c50f03de..00000000 --- a/Sources/DOMKit/WebIDL/MLGraph.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLGraph: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLGraph].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func compute(inputs: MLNamedInputs, outputs: MLNamedOutputs) { - let this = jsObject - _ = this[Strings.compute].function!(this: this, arguments: [inputs.jsValue, outputs.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift b/Sources/DOMKit/WebIDL/MLGraphBuilder.swift deleted file mode 100644 index 9999a795..00000000 --- a/Sources/DOMKit/WebIDL/MLGraphBuilder.swift +++ /dev/null @@ -1,390 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLGraphBuilder: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLGraphBuilder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(context: MLContext) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue])) - } - - @inlinable public func input(name: String, desc: MLOperandDescriptor) -> MLOperand { - let this = jsObject - return this[Strings.input].function!(this: this, arguments: [name.jsValue, desc.jsValue]).fromJSValue()! - } - - @inlinable public func constant(desc: MLOperandDescriptor, bufferView: MLBufferView) -> MLOperand { - let this = jsObject - return this[Strings.constant].function!(this: this, arguments: [desc.jsValue, bufferView.jsValue]).fromJSValue()! - } - - @inlinable public func constant(value: Double, type: MLOperandType? = nil) -> MLOperand { - let this = jsObject - return this[Strings.constant].function!(this: this, arguments: [value.jsValue, type?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func build(outputs: MLNamedOperands) -> MLGraph { - let this = jsObject - return this[Strings.build].function!(this: this, arguments: [outputs.jsValue]).fromJSValue()! - } - - @inlinable public func batchNormalization(input: MLOperand, mean: MLOperand, variance: MLOperand, options: MLBatchNormalizationOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.batchNormalization].function!(this: this, arguments: [input.jsValue, mean.jsValue, variance.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func clamp(x: MLOperand, options: MLClampOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.clamp].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func clamp(options: MLClampOptions? = nil) -> MLOperator { - let this = jsObject - return this[Strings.clamp].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func concat(inputs: [MLOperand], axis: Int32) -> MLOperand { - let this = jsObject - return this[Strings.concat].function!(this: this, arguments: [inputs.jsValue, axis.jsValue]).fromJSValue()! - } - - @inlinable public func conv2d(input: MLOperand, filter: MLOperand, options: MLConv2dOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.conv2d].function!(this: this, arguments: [input.jsValue, filter.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func convTranspose2d(input: MLOperand, filter: MLOperand, options: MLConvTranspose2dOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.convTranspose2d].function!(this: this, arguments: [input.jsValue, filter.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func add(a: MLOperand, b: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.add].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! - } - - @inlinable public func sub(a: MLOperand, b: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.sub].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! - } - - @inlinable public func mul(a: MLOperand, b: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.mul].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! - } - - @inlinable public func div(a: MLOperand, b: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.div].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! - } - - @inlinable public func max(a: MLOperand, b: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.max].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! - } - - @inlinable public func min(a: MLOperand, b: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.min].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! - } - - @inlinable public func pow(a: MLOperand, b: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.pow].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! - } - - @inlinable public func abs(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.abs].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func ceil(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.ceil].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func cos(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.cos].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func exp(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.exp].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func floor(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.floor].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func log(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.log].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func neg(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.neg].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func sin(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.sin].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func tan(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.tan].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func elu(x: MLOperand, options: MLEluOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.elu].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func elu(options: MLEluOptions? = nil) -> MLOperator { - let this = jsObject - return this[Strings.elu].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func gemm(a: MLOperand, b: MLOperand, options: MLGemmOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.gemm].function!(this: this, arguments: [a.jsValue, b.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func gru(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, steps: Int32, hiddenSize: Int32, options: MLGruOptions? = nil) -> [MLOperand] { - let _arg0 = input.jsValue - let _arg1 = weight.jsValue - let _arg2 = recurrentWeight.jsValue - let _arg3 = steps.jsValue - let _arg4 = hiddenSize.jsValue - let _arg5 = options?.jsValue ?? .undefined - let this = jsObject - return this[Strings.gru].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! - } - - @inlinable public func gruCell(input: MLOperand, weight: MLOperand, recurrentWeight: MLOperand, hiddenState: MLOperand, hiddenSize: Int32, options: MLGruCellOptions? = nil) -> MLOperand { - let _arg0 = input.jsValue - let _arg1 = weight.jsValue - let _arg2 = recurrentWeight.jsValue - let _arg3 = hiddenState.jsValue - let _arg4 = hiddenSize.jsValue - let _arg5 = options?.jsValue ?? .undefined - let this = jsObject - return this[Strings.gruCell].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! - } - - @inlinable public func hardSigmoid(x: MLOperand, options: MLHardSigmoidOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.hardSigmoid].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func hardSigmoid(options: MLHardSigmoidOptions? = nil) -> MLOperator { - let this = jsObject - return this[Strings.hardSigmoid].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func hardSwish(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.hardSwish].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func hardSwish() -> MLOperator { - let this = jsObject - return this[Strings.hardSwish].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func instanceNormalization(input: MLOperand, options: MLInstanceNormalizationOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.instanceNormalization].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func leakyRelu(x: MLOperand, options: MLLeakyReluOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.leakyRelu].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func leakyRelu(options: MLLeakyReluOptions? = nil) -> MLOperator { - let this = jsObject - return this[Strings.leakyRelu].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func matmul(a: MLOperand, b: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.matmul].function!(this: this, arguments: [a.jsValue, b.jsValue]).fromJSValue()! - } - - @inlinable public func linear(x: MLOperand, options: MLLinearOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.linear].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func linear(options: MLLinearOptions? = nil) -> MLOperator { - let this = jsObject - return this[Strings.linear].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func pad(input: MLOperand, padding: MLOperand, options: MLPadOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.pad].function!(this: this, arguments: [input.jsValue, padding.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func averagePool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.averagePool2d].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func l2Pool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.l2Pool2d].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func maxPool2d(input: MLOperand, options: MLPool2dOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.maxPool2d].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceL1(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceL1].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceL2(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceL2].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceLogSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceLogSum].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceLogSumExp(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceLogSumExp].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceMax(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceMax].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceMean(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceMean].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceMin(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceMin].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceProduct(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceProduct].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceSum(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceSum].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reduceSumSquare(input: MLOperand, options: MLReduceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.reduceSumSquare].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func relu(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.relu].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func relu() -> MLOperator { - let this = jsObject - return this[Strings.relu].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func resample2d(input: MLOperand, options: MLResample2dOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.resample2d].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reshape(input: MLOperand, newShape: [Int32]) -> MLOperand { - let this = jsObject - return this[Strings.reshape].function!(this: this, arguments: [input.jsValue, newShape.jsValue]).fromJSValue()! - } - - @inlinable public func sigmoid(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.sigmoid].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func sigmoid() -> MLOperator { - let this = jsObject - return this[Strings.sigmoid].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func slice(input: MLOperand, starts: [Int32], sizes: [Int32], options: MLSliceOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.slice].function!(this: this, arguments: [input.jsValue, starts.jsValue, sizes.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func softmax(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.softmax].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func softplus(x: MLOperand, options: MLSoftplusOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.softplus].function!(this: this, arguments: [x.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func softplus(options: MLSoftplusOptions? = nil) -> MLOperator { - let this = jsObject - return this[Strings.softplus].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func softsign(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.softsign].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func softsign() -> MLOperator { - let this = jsObject - return this[Strings.softsign].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func split(input: MLOperand, splits: UInt32_or_seq_of_UInt32, options: MLSplitOptions? = nil) -> [MLOperand] { - let this = jsObject - return this[Strings.split].function!(this: this, arguments: [input.jsValue, splits.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func squeeze(input: MLOperand, options: MLSqueezeOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.squeeze].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func tanh(x: MLOperand) -> MLOperand { - let this = jsObject - return this[Strings.tanh].function!(this: this, arguments: [x.jsValue]).fromJSValue()! - } - - @inlinable public func tanh() -> MLOperator { - let this = jsObject - return this[Strings.tanh].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func transpose(input: MLOperand, options: MLTransposeOptions? = nil) -> MLOperand { - let this = jsObject - return this[Strings.transpose].function!(this: this, arguments: [input.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/MLGruCellOptions.swift b/Sources/DOMKit/WebIDL/MLGruCellOptions.swift deleted file mode 100644 index bb33f3bf..00000000 --- a/Sources/DOMKit/WebIDL/MLGruCellOptions.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLGruCellOptions: BridgedDictionary { - public convenience init(bias: MLOperand, recurrentBias: MLOperand, resetAfter: Bool, layout: MLRecurrentNetworkWeightLayout, activations: [MLOperator]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bias] = bias.jsValue - object[Strings.recurrentBias] = recurrentBias.jsValue - object[Strings.resetAfter] = resetAfter.jsValue - object[Strings.layout] = layout.jsValue - object[Strings.activations] = activations.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) - _recurrentBias = ReadWriteAttribute(jsObject: object, name: Strings.recurrentBias) - _resetAfter = ReadWriteAttribute(jsObject: object, name: Strings.resetAfter) - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - _activations = ReadWriteAttribute(jsObject: object, name: Strings.activations) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var bias: MLOperand - - @ReadWriteAttribute - public var recurrentBias: MLOperand - - @ReadWriteAttribute - public var resetAfter: Bool - - @ReadWriteAttribute - public var layout: MLRecurrentNetworkWeightLayout - - @ReadWriteAttribute - public var activations: [MLOperator] -} diff --git a/Sources/DOMKit/WebIDL/MLGruOptions.swift b/Sources/DOMKit/WebIDL/MLGruOptions.swift deleted file mode 100644 index 250e05cc..00000000 --- a/Sources/DOMKit/WebIDL/MLGruOptions.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLGruOptions: BridgedDictionary { - public convenience init(bias: MLOperand, recurrentBias: MLOperand, initialHiddenState: MLOperand, resetAfter: Bool, returnSequence: Bool, direction: MLRecurrentNetworkDirection, layout: MLRecurrentNetworkWeightLayout, activations: [MLOperator]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bias] = bias.jsValue - object[Strings.recurrentBias] = recurrentBias.jsValue - object[Strings.initialHiddenState] = initialHiddenState.jsValue - object[Strings.resetAfter] = resetAfter.jsValue - object[Strings.returnSequence] = returnSequence.jsValue - object[Strings.direction] = direction.jsValue - object[Strings.layout] = layout.jsValue - object[Strings.activations] = activations.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) - _recurrentBias = ReadWriteAttribute(jsObject: object, name: Strings.recurrentBias) - _initialHiddenState = ReadWriteAttribute(jsObject: object, name: Strings.initialHiddenState) - _resetAfter = ReadWriteAttribute(jsObject: object, name: Strings.resetAfter) - _returnSequence = ReadWriteAttribute(jsObject: object, name: Strings.returnSequence) - _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - _activations = ReadWriteAttribute(jsObject: object, name: Strings.activations) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var bias: MLOperand - - @ReadWriteAttribute - public var recurrentBias: MLOperand - - @ReadWriteAttribute - public var initialHiddenState: MLOperand - - @ReadWriteAttribute - public var resetAfter: Bool - - @ReadWriteAttribute - public var returnSequence: Bool - - @ReadWriteAttribute - public var direction: MLRecurrentNetworkDirection - - @ReadWriteAttribute - public var layout: MLRecurrentNetworkWeightLayout - - @ReadWriteAttribute - public var activations: [MLOperator] -} diff --git a/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift b/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift deleted file mode 100644 index 690e6300..00000000 --- a/Sources/DOMKit/WebIDL/MLHardSigmoidOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLHardSigmoidOptions: BridgedDictionary { - public convenience init(alpha: Float, beta: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue - object[Strings.beta] = beta.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var alpha: Float - - @ReadWriteAttribute - public var beta: Float -} diff --git a/Sources/DOMKit/WebIDL/MLInput.swift b/Sources/DOMKit/WebIDL/MLInput.swift deleted file mode 100644 index 40d6e573..00000000 --- a/Sources/DOMKit/WebIDL/MLInput.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLInput: BridgedDictionary { - public convenience init(resource: MLResource, dimensions: [Int32]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.resource] = resource.jsValue - object[Strings.dimensions] = dimensions.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _resource = ReadWriteAttribute(jsObject: object, name: Strings.resource) - _dimensions = ReadWriteAttribute(jsObject: object, name: Strings.dimensions) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var resource: MLResource - - @ReadWriteAttribute - public var dimensions: [Int32] -} diff --git a/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift b/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift deleted file mode 100644 index d4ab657d..00000000 --- a/Sources/DOMKit/WebIDL/MLInputOperandLayout.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLInputOperandLayout: JSString, JSValueCompatible { - case nchw = "nchw" - case nhwc = "nhwc" - - @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/MLInput_or_MLResource.swift b/Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift deleted file mode 100644 index 5f31598e..00000000 --- a/Sources/DOMKit/WebIDL/MLInput_or_MLResource.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_MLInput_or_MLResource: ConvertibleToJSValue {} -extension MLInput: Any_MLInput_or_MLResource {} -extension MLResource: Any_MLInput_or_MLResource {} - -public enum MLInput_or_MLResource: JSValueCompatible, Any_MLInput_or_MLResource { - case mLInput(MLInput) - case mLResource(MLResource) - - public static func construct(from value: JSValue) -> Self? { - if let mLInput: MLInput = value.fromJSValue() { - return .mLInput(mLInput) - } - if let mLResource: MLResource = value.fromJSValue() { - return .mLResource(mLResource) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .mLInput(mLInput): - return mLInput.jsValue - case let .mLResource(mLResource): - return mLResource.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift b/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift deleted file mode 100644 index 33b8a168..00000000 --- a/Sources/DOMKit/WebIDL/MLInstanceNormalizationOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLInstanceNormalizationOptions: BridgedDictionary { - public convenience init(scale: MLOperand, bias: MLOperand, epsilon: Float, layout: MLInputOperandLayout) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.scale] = scale.jsValue - object[Strings.bias] = bias.jsValue - object[Strings.epsilon] = epsilon.jsValue - object[Strings.layout] = layout.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _scale = ReadWriteAttribute(jsObject: object, name: Strings.scale) - _bias = ReadWriteAttribute(jsObject: object, name: Strings.bias) - _epsilon = ReadWriteAttribute(jsObject: object, name: Strings.epsilon) - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var scale: MLOperand - - @ReadWriteAttribute - public var bias: MLOperand - - @ReadWriteAttribute - public var epsilon: Float - - @ReadWriteAttribute - public var layout: MLInputOperandLayout -} diff --git a/Sources/DOMKit/WebIDL/MLInterpolationMode.swift b/Sources/DOMKit/WebIDL/MLInterpolationMode.swift deleted file mode 100644 index 452c6973..00000000 --- a/Sources/DOMKit/WebIDL/MLInterpolationMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLInterpolationMode: JSString, JSValueCompatible { - case nearestNeighbor = "nearest-neighbor" - case linear = "linear" - - @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/MLLeakyReluOptions.swift b/Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift deleted file mode 100644 index b0f57d8d..00000000 --- a/Sources/DOMKit/WebIDL/MLLeakyReluOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLLeakyReluOptions: BridgedDictionary { - public convenience init(alpha: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var alpha: Float -} diff --git a/Sources/DOMKit/WebIDL/MLLinearOptions.swift b/Sources/DOMKit/WebIDL/MLLinearOptions.swift deleted file mode 100644 index e57a90bf..00000000 --- a/Sources/DOMKit/WebIDL/MLLinearOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLLinearOptions: BridgedDictionary { - public convenience init(alpha: Float, beta: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue - object[Strings.beta] = beta.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _beta = ReadWriteAttribute(jsObject: object, name: Strings.beta) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var alpha: Float - - @ReadWriteAttribute - public var beta: Float -} diff --git a/Sources/DOMKit/WebIDL/MLOperand.swift b/Sources/DOMKit/WebIDL/MLOperand.swift deleted file mode 100644 index 2919f693..00000000 --- a/Sources/DOMKit/WebIDL/MLOperand.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLOperand: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLOperand].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift b/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift deleted file mode 100644 index 161e6144..00000000 --- a/Sources/DOMKit/WebIDL/MLOperandDescriptor.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLOperandDescriptor: BridgedDictionary { - public convenience init(type: MLOperandType, dimensions: [Int32]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.dimensions] = dimensions.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _dimensions = ReadWriteAttribute(jsObject: object, name: Strings.dimensions) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: MLOperandType - - @ReadWriteAttribute - public var dimensions: [Int32] -} diff --git a/Sources/DOMKit/WebIDL/MLOperandType.swift b/Sources/DOMKit/WebIDL/MLOperandType.swift deleted file mode 100644 index 1f99d311..00000000 --- a/Sources/DOMKit/WebIDL/MLOperandType.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLOperandType: JSString, JSValueCompatible { - case float32 = "float32" - case float16 = "float16" - case int32 = "int32" - case uint32 = "uint32" - case int8 = "int8" - case uint8 = "uint8" - - @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/MLOperator.swift b/Sources/DOMKit/WebIDL/MLOperator.swift deleted file mode 100644 index 3616d36c..00000000 --- a/Sources/DOMKit/WebIDL/MLOperator.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLOperator: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MLOperator].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/MLPadOptions.swift b/Sources/DOMKit/WebIDL/MLPadOptions.swift deleted file mode 100644 index 7149e1cc..00000000 --- a/Sources/DOMKit/WebIDL/MLPadOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLPadOptions: BridgedDictionary { - public convenience init(mode: MLPaddingMode, value: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue - object[Strings.value] = value.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) - _value = ReadWriteAttribute(jsObject: object, name: Strings.value) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mode: MLPaddingMode - - @ReadWriteAttribute - public var value: Float -} diff --git a/Sources/DOMKit/WebIDL/MLPaddingMode.swift b/Sources/DOMKit/WebIDL/MLPaddingMode.swift deleted file mode 100644 index 6aab0792..00000000 --- a/Sources/DOMKit/WebIDL/MLPaddingMode.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLPaddingMode: JSString, JSValueCompatible { - case constant = "constant" - case edge = "edge" - case reflection = "reflection" - case symmetric = "symmetric" - - @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/MLPool2dOptions.swift b/Sources/DOMKit/WebIDL/MLPool2dOptions.swift deleted file mode 100644 index 9448cc9c..00000000 --- a/Sources/DOMKit/WebIDL/MLPool2dOptions.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLPool2dOptions: BridgedDictionary { - public convenience init(windowDimensions: [Int32], padding: [Int32], strides: [Int32], dilations: [Int32], autoPad: MLAutoPad, layout: MLInputOperandLayout, roundingType: MLRoundingType, outputSizes: [Int32]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.windowDimensions] = windowDimensions.jsValue - object[Strings.padding] = padding.jsValue - object[Strings.strides] = strides.jsValue - object[Strings.dilations] = dilations.jsValue - object[Strings.autoPad] = autoPad.jsValue - object[Strings.layout] = layout.jsValue - object[Strings.roundingType] = roundingType.jsValue - object[Strings.outputSizes] = outputSizes.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _windowDimensions = ReadWriteAttribute(jsObject: object, name: Strings.windowDimensions) - _padding = ReadWriteAttribute(jsObject: object, name: Strings.padding) - _strides = ReadWriteAttribute(jsObject: object, name: Strings.strides) - _dilations = ReadWriteAttribute(jsObject: object, name: Strings.dilations) - _autoPad = ReadWriteAttribute(jsObject: object, name: Strings.autoPad) - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - _roundingType = ReadWriteAttribute(jsObject: object, name: Strings.roundingType) - _outputSizes = ReadWriteAttribute(jsObject: object, name: Strings.outputSizes) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var windowDimensions: [Int32] - - @ReadWriteAttribute - public var padding: [Int32] - - @ReadWriteAttribute - public var strides: [Int32] - - @ReadWriteAttribute - public var dilations: [Int32] - - @ReadWriteAttribute - public var autoPad: MLAutoPad - - @ReadWriteAttribute - public var layout: MLInputOperandLayout - - @ReadWriteAttribute - public var roundingType: MLRoundingType - - @ReadWriteAttribute - public var outputSizes: [Int32] -} diff --git a/Sources/DOMKit/WebIDL/MLPowerPreference.swift b/Sources/DOMKit/WebIDL/MLPowerPreference.swift deleted file mode 100644 index b9a47f53..00000000 --- a/Sources/DOMKit/WebIDL/MLPowerPreference.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLPowerPreference: JSString, JSValueCompatible { - case `default` = "default" - case highPerformance = "high-performance" - case lowPower = "low-power" - - @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/MLRecurrentNetworkDirection.swift b/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift deleted file mode 100644 index 731deb72..00000000 --- a/Sources/DOMKit/WebIDL/MLRecurrentNetworkDirection.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLRecurrentNetworkDirection: JSString, JSValueCompatible { - case forward = "forward" - case backward = "backward" - case both = "both" - - @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/MLRecurrentNetworkWeightLayout.swift b/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift deleted file mode 100644 index 5a4c3fc6..00000000 --- a/Sources/DOMKit/WebIDL/MLRecurrentNetworkWeightLayout.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLRecurrentNetworkWeightLayout: JSString, JSValueCompatible { - case zrn = "zrn" - case rzn = "rzn" - - @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/MLReduceOptions.swift b/Sources/DOMKit/WebIDL/MLReduceOptions.swift deleted file mode 100644 index 69dadec4..00000000 --- a/Sources/DOMKit/WebIDL/MLReduceOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLReduceOptions: BridgedDictionary { - public convenience init(axes: [Int32], keepDimensions: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.axes] = axes.jsValue - object[Strings.keepDimensions] = keepDimensions.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _axes = ReadWriteAttribute(jsObject: object, name: Strings.axes) - _keepDimensions = ReadWriteAttribute(jsObject: object, name: Strings.keepDimensions) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var axes: [Int32] - - @ReadWriteAttribute - public var keepDimensions: Bool -} diff --git a/Sources/DOMKit/WebIDL/MLResample2dOptions.swift b/Sources/DOMKit/WebIDL/MLResample2dOptions.swift deleted file mode 100644 index 2477a0c0..00000000 --- a/Sources/DOMKit/WebIDL/MLResample2dOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLResample2dOptions: BridgedDictionary { - public convenience init(mode: MLInterpolationMode, scales: [Float], sizes: [Int32], axes: [Int32]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue - object[Strings.scales] = scales.jsValue - object[Strings.sizes] = sizes.jsValue - object[Strings.axes] = axes.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) - _scales = ReadWriteAttribute(jsObject: object, name: Strings.scales) - _sizes = ReadWriteAttribute(jsObject: object, name: Strings.sizes) - _axes = ReadWriteAttribute(jsObject: object, name: Strings.axes) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mode: MLInterpolationMode - - @ReadWriteAttribute - public var scales: [Float] - - @ReadWriteAttribute - public var sizes: [Int32] - - @ReadWriteAttribute - public var axes: [Int32] -} diff --git a/Sources/DOMKit/WebIDL/MLResource.swift b/Sources/DOMKit/WebIDL/MLResource.swift deleted file mode 100644 index e4338632..00000000 --- a/Sources/DOMKit/WebIDL/MLResource.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_MLResource: ConvertibleToJSValue {} -extension GPUTexture: Any_MLResource {} -extension MLBufferView: Any_MLResource {} -extension WebGLTexture: Any_MLResource {} - -public enum MLResource: JSValueCompatible, Any_MLResource { - case gPUTexture(GPUTexture) - case mLBufferView(MLBufferView) - case webGLTexture(WebGLTexture) - - public static func construct(from value: JSValue) -> Self? { - if let gPUTexture: GPUTexture = value.fromJSValue() { - return .gPUTexture(gPUTexture) - } - if let mLBufferView: MLBufferView = value.fromJSValue() { - return .mLBufferView(mLBufferView) - } - if let webGLTexture: WebGLTexture = value.fromJSValue() { - return .webGLTexture(webGLTexture) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .gPUTexture(gPUTexture): - return gPUTexture.jsValue - case let .mLBufferView(mLBufferView): - return mLBufferView.jsValue - case let .webGLTexture(webGLTexture): - return webGLTexture.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/MLRoundingType.swift b/Sources/DOMKit/WebIDL/MLRoundingType.swift deleted file mode 100644 index d058068a..00000000 --- a/Sources/DOMKit/WebIDL/MLRoundingType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MLRoundingType: JSString, JSValueCompatible { - case floor = "floor" - case ceil = "ceil" - - @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/MLSliceOptions.swift b/Sources/DOMKit/WebIDL/MLSliceOptions.swift deleted file mode 100644 index 8fa808df..00000000 --- a/Sources/DOMKit/WebIDL/MLSliceOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLSliceOptions: BridgedDictionary { - public convenience init(axes: [Int32]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.axes] = axes.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _axes = ReadWriteAttribute(jsObject: object, name: Strings.axes) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var axes: [Int32] -} diff --git a/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift b/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift deleted file mode 100644 index 6f767bd3..00000000 --- a/Sources/DOMKit/WebIDL/MLSoftplusOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLSoftplusOptions: BridgedDictionary { - public convenience init(steepness: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.steepness] = steepness.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _steepness = ReadWriteAttribute(jsObject: object, name: Strings.steepness) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var steepness: Float -} diff --git a/Sources/DOMKit/WebIDL/MLSplitOptions.swift b/Sources/DOMKit/WebIDL/MLSplitOptions.swift deleted file mode 100644 index 3e952071..00000000 --- a/Sources/DOMKit/WebIDL/MLSplitOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLSplitOptions: BridgedDictionary { - public convenience init(axis: Int32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.axis] = axis.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _axis = ReadWriteAttribute(jsObject: object, name: Strings.axis) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var axis: Int32 -} diff --git a/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift b/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift deleted file mode 100644 index f686cf75..00000000 --- a/Sources/DOMKit/WebIDL/MLSqueezeOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLSqueezeOptions: BridgedDictionary { - public convenience init(axes: [Int32]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.axes] = axes.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _axes = ReadWriteAttribute(jsObject: object, name: Strings.axes) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var axes: [Int32] -} diff --git a/Sources/DOMKit/WebIDL/MLTransposeOptions.swift b/Sources/DOMKit/WebIDL/MLTransposeOptions.swift deleted file mode 100644 index c93c2f9e..00000000 --- a/Sources/DOMKit/WebIDL/MLTransposeOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MLTransposeOptions: BridgedDictionary { - public convenience init(permutation: [Int32]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.permutation] = permutation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _permutation = ReadWriteAttribute(jsObject: object, name: Strings.permutation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var permutation: [Int32] -} diff --git a/Sources/DOMKit/WebIDL/Magnetometer.swift b/Sources/DOMKit/WebIDL/Magnetometer.swift deleted file mode 100644 index c8d90abc..00000000 --- a/Sources/DOMKit/WebIDL/Magnetometer.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Magnetometer: Sensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Magnetometer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var x: Double? - - @ReadonlyAttribute - public var y: Double? - - @ReadonlyAttribute - public var z: Double? -} diff --git a/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift deleted file mode 100644 index 17baf7df..00000000 --- a/Sources/DOMKit/WebIDL/MagnetometerLocalCoordinateSystem.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MagnetometerLocalCoordinateSystem: JSString, JSValueCompatible { - case device = "device" - case screen = "screen" - - @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/MagnetometerReadingValues.swift b/Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift deleted file mode 100644 index 42c1ce2b..00000000 --- a/Sources/DOMKit/WebIDL/MagnetometerReadingValues.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MagnetometerReadingValues: BridgedDictionary { - public convenience init(x: Double?, y: Double?, z: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - object[Strings.z] = z.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - _z = ReadWriteAttribute(jsObject: object, name: Strings.z) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var x: Double? - - @ReadWriteAttribute - public var y: Double? - - @ReadWriteAttribute - public var z: Double? -} diff --git a/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift b/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift deleted file mode 100644 index 050a71a6..00000000 --- a/Sources/DOMKit/WebIDL/MagnetometerSensorOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MagnetometerSensorOptions: BridgedDictionary { - public convenience init(referenceFrame: MagnetometerLocalCoordinateSystem) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceFrame] = referenceFrame.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _referenceFrame = ReadWriteAttribute(jsObject: object, name: Strings.referenceFrame) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var referenceFrame: MagnetometerLocalCoordinateSystem -} diff --git a/Sources/DOMKit/WebIDL/MathMLElement.swift b/Sources/DOMKit/WebIDL/MathMLElement.swift deleted file mode 100644 index 2336d8bd..00000000 --- a/Sources/DOMKit/WebIDL/MathMLElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MathMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, HTMLOrSVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MathMLElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilities.swift b/Sources/DOMKit/WebIDL/MediaCapabilities.swift deleted file mode 100644 index 450d90d6..00000000 --- a/Sources/DOMKit/WebIDL/MediaCapabilities.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaCapabilities: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaCapabilities].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func decodingInfo(configuration: MediaDecodingConfiguration) -> JSPromise { - let this = jsObject - return this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func decodingInfo(configuration: MediaDecodingConfiguration) async throws -> MediaCapabilitiesDecodingInfo { - let this = jsObject - let _promise: JSPromise = this[Strings.decodingInfo].function!(this: this, arguments: [configuration.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func encodingInfo(configuration: MediaEncodingConfiguration) -> JSPromise { - let this = jsObject - return this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func encodingInfo(configuration: MediaEncodingConfiguration) async throws -> MediaCapabilitiesEncodingInfo { - let this = jsObject - let _promise: JSPromise = this[Strings.encodingInfo].function!(this: this, arguments: [configuration.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift deleted file mode 100644 index a9569a5c..00000000 --- a/Sources/DOMKit/WebIDL/MediaCapabilitiesDecodingInfo.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaCapabilitiesDecodingInfo: BridgedDictionary { - public convenience init(keySystemAccess: MediaKeySystemAccess, configuration: MediaDecodingConfiguration) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keySystemAccess] = keySystemAccess.jsValue - object[Strings.configuration] = configuration.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _keySystemAccess = ReadWriteAttribute(jsObject: object, name: Strings.keySystemAccess) - _configuration = ReadWriteAttribute(jsObject: object, name: Strings.configuration) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var keySystemAccess: MediaKeySystemAccess - - @ReadWriteAttribute - public var configuration: MediaDecodingConfiguration -} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift deleted file mode 100644 index 673d93aa..00000000 --- a/Sources/DOMKit/WebIDL/MediaCapabilitiesEncodingInfo.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaCapabilitiesEncodingInfo: BridgedDictionary { - public convenience init(configuration: MediaEncodingConfiguration) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.configuration] = configuration.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _configuration = ReadWriteAttribute(jsObject: object, name: Strings.configuration) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var configuration: MediaEncodingConfiguration -} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift deleted file mode 100644 index 292fbf77..00000000 --- a/Sources/DOMKit/WebIDL/MediaCapabilitiesInfo.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaCapabilitiesInfo: BridgedDictionary { - public convenience init(supported: Bool, smooth: Bool, powerEfficient: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supported] = supported.jsValue - object[Strings.smooth] = smooth.jsValue - object[Strings.powerEfficient] = powerEfficient.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) - _smooth = ReadWriteAttribute(jsObject: object, name: Strings.smooth) - _powerEfficient = ReadWriteAttribute(jsObject: object, name: Strings.powerEfficient) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var supported: Bool - - @ReadWriteAttribute - public var smooth: Bool - - @ReadWriteAttribute - public var powerEfficient: Bool -} diff --git a/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift b/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift deleted file mode 100644 index dfcfe291..00000000 --- a/Sources/DOMKit/WebIDL/MediaCapabilitiesKeySystemConfiguration.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaCapabilitiesKeySystemConfiguration: BridgedDictionary { - public convenience init(keySystem: String, initDataType: String, distinctiveIdentifier: MediaKeysRequirement, persistentState: MediaKeysRequirement, sessionTypes: [String], audio: KeySystemTrackConfiguration, video: KeySystemTrackConfiguration) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keySystem] = keySystem.jsValue - object[Strings.initDataType] = initDataType.jsValue - object[Strings.distinctiveIdentifier] = distinctiveIdentifier.jsValue - object[Strings.persistentState] = persistentState.jsValue - object[Strings.sessionTypes] = sessionTypes.jsValue - object[Strings.audio] = audio.jsValue - object[Strings.video] = video.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _keySystem = ReadWriteAttribute(jsObject: object, name: Strings.keySystem) - _initDataType = ReadWriteAttribute(jsObject: object, name: Strings.initDataType) - _distinctiveIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.distinctiveIdentifier) - _persistentState = ReadWriteAttribute(jsObject: object, name: Strings.persistentState) - _sessionTypes = ReadWriteAttribute(jsObject: object, name: Strings.sessionTypes) - _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) - _video = ReadWriteAttribute(jsObject: object, name: Strings.video) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var keySystem: String - - @ReadWriteAttribute - public var initDataType: String - - @ReadWriteAttribute - public var distinctiveIdentifier: MediaKeysRequirement - - @ReadWriteAttribute - public var persistentState: MediaKeysRequirement - - @ReadWriteAttribute - public var sessionTypes: [String] - - @ReadWriteAttribute - public var audio: KeySystemTrackConfiguration - - @ReadWriteAttribute - public var video: KeySystemTrackConfiguration -} diff --git a/Sources/DOMKit/WebIDL/MediaConfiguration.swift b/Sources/DOMKit/WebIDL/MediaConfiguration.swift deleted file mode 100644 index a11dc60c..00000000 --- a/Sources/DOMKit/WebIDL/MediaConfiguration.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaConfiguration: BridgedDictionary { - public convenience init(video: VideoConfiguration, audio: AudioConfiguration) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.video] = video.jsValue - object[Strings.audio] = audio.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _video = ReadWriteAttribute(jsObject: object, name: Strings.video) - _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var video: VideoConfiguration - - @ReadWriteAttribute - public var audio: AudioConfiguration -} diff --git a/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift b/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift deleted file mode 100644 index e3030b03..00000000 --- a/Sources/DOMKit/WebIDL/MediaDecodingConfiguration.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaDecodingConfiguration: BridgedDictionary { - public convenience init(type: MediaDecodingType, keySystemConfiguration: MediaCapabilitiesKeySystemConfiguration) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.keySystemConfiguration] = keySystemConfiguration.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _keySystemConfiguration = ReadWriteAttribute(jsObject: object, name: Strings.keySystemConfiguration) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: MediaDecodingType - - @ReadWriteAttribute - public var keySystemConfiguration: MediaCapabilitiesKeySystemConfiguration -} diff --git a/Sources/DOMKit/WebIDL/MediaDecodingType.swift b/Sources/DOMKit/WebIDL/MediaDecodingType.swift deleted file mode 100644 index 3fdf94c8..00000000 --- a/Sources/DOMKit/WebIDL/MediaDecodingType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MediaDecodingType: JSString, JSValueCompatible { - case file = "file" - case mediaSource = "media-source" - case webrtc = "webrtc" - - @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/MediaDevices.swift b/Sources/DOMKit/WebIDL/MediaDevices.swift index 6d57fd6e..a65b2d59 100644 --- a/Sources/DOMKit/WebIDL/MediaDevices.swift +++ b/Sources/DOMKit/WebIDL/MediaDevices.swift @@ -11,30 +11,6 @@ public class MediaDevices: EventTarget { super.init(unsafelyWrapping: jsObject) } - @inlinable public func selectAudioOutput(options: AudioOutputOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func selectAudioOutput(options: AudioOutputOptions? = nil) async throws -> MediaDeviceInfo { - let this = jsObject - let _promise: JSPromise = this[Strings.selectAudioOutput].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func produceCropTarget(element: HTMLElement) -> JSPromise { - let this = jsObject - return this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func produceCropTarget(element: HTMLElement) async throws -> CropTarget { - let this = jsObject - let _promise: JSPromise = this[Strings.produceCropTarget].function!(this: this, arguments: [element.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - @ClosureAttribute1Optional public var ondevicechange: EventHandler @@ -66,16 +42,4 @@ public class MediaDevices: EventTarget { let _promise: JSPromise = this[Strings.getUserMedia].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! return try await _promise.value.fromJSValue()! } - - @inlinable public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDisplayMedia(constraints: DisplayMediaStreamConstraints? = nil) async throws -> MediaStream { - let this = jsObject - let _promise: JSPromise = this[Strings.getDisplayMedia].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } } diff --git a/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift deleted file mode 100644 index b1c45274..00000000 --- a/Sources/DOMKit/WebIDL/MediaElementAudioSourceNode.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaElementAudioSourceNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaElementAudioSourceNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _mediaElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaElement) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: AudioContext, options: MediaElementAudioSourceOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options.jsValue])) - } - - @ReadonlyAttribute - public var mediaElement: HTMLMediaElement -} diff --git a/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift b/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift deleted file mode 100644 index 7ea0f005..00000000 --- a/Sources/DOMKit/WebIDL/MediaElementAudioSourceOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaElementAudioSourceOptions: BridgedDictionary { - public convenience init(mediaElement: HTMLMediaElement) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaElement] = mediaElement.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mediaElement = ReadWriteAttribute(jsObject: object, name: Strings.mediaElement) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mediaElement: HTMLMediaElement -} diff --git a/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift b/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift deleted file mode 100644 index 66271dba..00000000 --- a/Sources/DOMKit/WebIDL/MediaEncodingConfiguration.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaEncodingConfiguration: BridgedDictionary { - public convenience init(type: MediaEncodingType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: MediaEncodingType -} diff --git a/Sources/DOMKit/WebIDL/MediaEncodingType.swift b/Sources/DOMKit/WebIDL/MediaEncodingType.swift deleted file mode 100644 index 88b97d87..00000000 --- a/Sources/DOMKit/WebIDL/MediaEncodingType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MediaEncodingType: JSString, JSValueCompatible { - case record = "record" - case webrtc = "webrtc" - - @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/MediaEncryptedEvent.swift b/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift deleted file mode 100644 index c40d8a46..00000000 --- a/Sources/DOMKit/WebIDL/MediaEncryptedEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaEncryptedEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaEncryptedEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _initDataType = ReadonlyAttribute(jsObject: jsObject, name: Strings.initDataType) - _initData = ReadonlyAttribute(jsObject: jsObject, name: Strings.initData) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: MediaEncryptedEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var initDataType: String - - @ReadonlyAttribute - public var initData: ArrayBuffer? -} diff --git a/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift b/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift deleted file mode 100644 index 6d3d6aa8..00000000 --- a/Sources/DOMKit/WebIDL/MediaEncryptedEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaEncryptedEventInit: BridgedDictionary { - public convenience init(initDataType: String, initData: ArrayBuffer?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.initDataType] = initDataType.jsValue - object[Strings.initData] = initData.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _initDataType = ReadWriteAttribute(jsObject: object, name: Strings.initDataType) - _initData = ReadWriteAttribute(jsObject: object, name: Strings.initData) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var initDataType: String - - @ReadWriteAttribute - public var initData: ArrayBuffer? -} diff --git a/Sources/DOMKit/WebIDL/MediaImage.swift b/Sources/DOMKit/WebIDL/MediaImage.swift deleted file mode 100644 index d6e262da..00000000 --- a/Sources/DOMKit/WebIDL/MediaImage.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaImage: BridgedDictionary { - public convenience init(src: String, sizes: String, type: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.src] = src.jsValue - object[Strings.sizes] = sizes.jsValue - object[Strings.type] = type.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _src = ReadWriteAttribute(jsObject: object, name: Strings.src) - _sizes = ReadWriteAttribute(jsObject: object, name: Strings.sizes) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var src: String - - @ReadWriteAttribute - public var sizes: String - - @ReadWriteAttribute - public var type: String -} diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift deleted file mode 100644 index c7fe9f7b..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeyMessageEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaKeyMessageEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaKeyMessageEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _messageType = ReadonlyAttribute(jsObject: jsObject, name: Strings.messageType) - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: MediaKeyMessageEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var messageType: MediaKeyMessageType - - @ReadonlyAttribute - public var message: ArrayBuffer -} diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift deleted file mode 100644 index 3cf7e00f..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeyMessageEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaKeyMessageEventInit: BridgedDictionary { - public convenience init(messageType: MediaKeyMessageType, message: ArrayBuffer) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.messageType] = messageType.jsValue - object[Strings.message] = message.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _messageType = ReadWriteAttribute(jsObject: object, name: Strings.messageType) - _message = ReadWriteAttribute(jsObject: object, name: Strings.message) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var messageType: MediaKeyMessageType - - @ReadWriteAttribute - public var message: ArrayBuffer -} diff --git a/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift b/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift deleted file mode 100644 index 5deb420f..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeyMessageType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MediaKeyMessageType: JSString, JSValueCompatible { - case licenseRequest = "license-request" - case licenseRenewal = "license-renewal" - case licenseRelease = "license-release" - case individualizationRequest = "individualization-request" - - @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/MediaKeySession.swift b/Sources/DOMKit/WebIDL/MediaKeySession.swift deleted file mode 100644 index afbde1b7..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeySession.swift +++ /dev/null @@ -1,96 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaKeySession: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaKeySession].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _sessionId = ReadonlyAttribute(jsObject: jsObject, name: Strings.sessionId) - _expiration = ReadonlyAttribute(jsObject: jsObject, name: Strings.expiration) - _closed = ReadonlyAttribute(jsObject: jsObject, name: Strings.closed) - _keyStatuses = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyStatuses) - _onkeystatuseschange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onkeystatuseschange) - _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var sessionId: String - - @ReadonlyAttribute - public var expiration: Double - - @ReadonlyAttribute - public var closed: JSPromise - - @ReadonlyAttribute - public var keyStatuses: MediaKeyStatusMap - - @ClosureAttribute1Optional - public var onkeystatuseschange: EventHandler - - @ClosureAttribute1Optional - public var onmessage: EventHandler - - @inlinable public func generateRequest(initDataType: String, initData: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue, initData.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func generateRequest(initDataType: String, initData: BufferSource) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.generateRequest].function!(this: this, arguments: [initDataType.jsValue, initData.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func load(sessionId: String) -> JSPromise { - let this = jsObject - return this[Strings.load].function!(this: this, arguments: [sessionId.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func load(sessionId: String) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.load].function!(this: this, arguments: [sessionId.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func update(response: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.update].function!(this: this, arguments: [response.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func update(response: BufferSource) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.update].function!(this: this, arguments: [response.jsValue]).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 remove() -> JSPromise { - let this = jsObject - return this[Strings.remove].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func remove() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.remove].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift b/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift deleted file mode 100644 index b3f8e22a..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeySessionClosedReason.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MediaKeySessionClosedReason: JSString, JSValueCompatible { - case internalError = "internal-error" - case closedByApplication = "closed-by-application" - case releaseAcknowledged = "release-acknowledged" - case hardwareContextReset = "hardware-context-reset" - case resourceEvicted = "resource-evicted" - - @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/MediaKeySessionType.swift b/Sources/DOMKit/WebIDL/MediaKeySessionType.swift deleted file mode 100644 index 2a2cfe51..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeySessionType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MediaKeySessionType: JSString, JSValueCompatible { - case temporary = "temporary" - case persistentLicense = "persistent-license" - - @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/MediaKeyStatus.swift b/Sources/DOMKit/WebIDL/MediaKeyStatus.swift deleted file mode 100644 index 18626775..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeyStatus.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MediaKeyStatus: JSString, JSValueCompatible { - case usable = "usable" - case expired = "expired" - case released = "released" - case outputRestricted = "output-restricted" - case outputDownscaled = "output-downscaled" - case usableInFuture = "usable-in-future" - case statusPending = "status-pending" - case internalError = "internal-error" - - @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/MediaKeyStatusMap.swift b/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift deleted file mode 100644 index 48f26737..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeyStatusMap.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaKeyStatusMap: JSBridgedClass, Sequence { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaKeyStatusMap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) - self.jsObject = jsObject - } - - public typealias Element = BufferSource - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) - } - - @ReadonlyAttribute - public var size: UInt32 - - @inlinable public func has(keyId: BufferSource) -> Bool { - let this = jsObject - return this[Strings.has].function!(this: this, arguments: [keyId.jsValue]).fromJSValue()! - } - - @inlinable public func get(keyId: BufferSource) -> MediaKeyStatus? { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [keyId.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift b/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift deleted file mode 100644 index a33b4e01..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeySystemAccess.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaKeySystemAccess: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaKeySystemAccess].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _keySystem = ReadonlyAttribute(jsObject: jsObject, name: Strings.keySystem) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var keySystem: String - - @inlinable public func getConfiguration() -> MediaKeySystemConfiguration { - let this = jsObject - return this[Strings.getConfiguration].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createMediaKeys() -> JSPromise { - let this = jsObject - return this[Strings.createMediaKeys].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func createMediaKeys() async throws -> MediaKeys { - let this = jsObject - let _promise: JSPromise = this[Strings.createMediaKeys].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift b/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift deleted file mode 100644 index c60ae8cb..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeySystemConfiguration.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaKeySystemConfiguration: BridgedDictionary { - public convenience init(label: String, initDataTypes: [String], audioCapabilities: [MediaKeySystemMediaCapability], videoCapabilities: [MediaKeySystemMediaCapability], distinctiveIdentifier: MediaKeysRequirement, persistentState: MediaKeysRequirement, sessionTypes: [String]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue - object[Strings.initDataTypes] = initDataTypes.jsValue - object[Strings.audioCapabilities] = audioCapabilities.jsValue - object[Strings.videoCapabilities] = videoCapabilities.jsValue - object[Strings.distinctiveIdentifier] = distinctiveIdentifier.jsValue - object[Strings.persistentState] = persistentState.jsValue - object[Strings.sessionTypes] = sessionTypes.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _label = ReadWriteAttribute(jsObject: object, name: Strings.label) - _initDataTypes = ReadWriteAttribute(jsObject: object, name: Strings.initDataTypes) - _audioCapabilities = ReadWriteAttribute(jsObject: object, name: Strings.audioCapabilities) - _videoCapabilities = ReadWriteAttribute(jsObject: object, name: Strings.videoCapabilities) - _distinctiveIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.distinctiveIdentifier) - _persistentState = ReadWriteAttribute(jsObject: object, name: Strings.persistentState) - _sessionTypes = ReadWriteAttribute(jsObject: object, name: Strings.sessionTypes) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var label: String - - @ReadWriteAttribute - public var initDataTypes: [String] - - @ReadWriteAttribute - public var audioCapabilities: [MediaKeySystemMediaCapability] - - @ReadWriteAttribute - public var videoCapabilities: [MediaKeySystemMediaCapability] - - @ReadWriteAttribute - public var distinctiveIdentifier: MediaKeysRequirement - - @ReadWriteAttribute - public var persistentState: MediaKeysRequirement - - @ReadWriteAttribute - public var sessionTypes: [String] -} diff --git a/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift b/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift deleted file mode 100644 index 7150a110..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeySystemMediaCapability.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaKeySystemMediaCapability: BridgedDictionary { - public convenience init(contentType: String, encryptionScheme: String?, robustness: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contentType] = contentType.jsValue - object[Strings.encryptionScheme] = encryptionScheme.jsValue - object[Strings.robustness] = robustness.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _contentType = ReadWriteAttribute(jsObject: object, name: Strings.contentType) - _encryptionScheme = ReadWriteAttribute(jsObject: object, name: Strings.encryptionScheme) - _robustness = ReadWriteAttribute(jsObject: object, name: Strings.robustness) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var contentType: String - - @ReadWriteAttribute - public var encryptionScheme: String? - - @ReadWriteAttribute - public var robustness: String -} diff --git a/Sources/DOMKit/WebIDL/MediaKeys.swift b/Sources/DOMKit/WebIDL/MediaKeys.swift deleted file mode 100644 index da2a7cab..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeys.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaKeys: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaKeys].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func createSession(sessionType: MediaKeySessionType? = nil) -> MediaKeySession { - let this = jsObject - return this[Strings.createSession].function!(this: this, arguments: [sessionType?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func setServerCertificate(serverCertificate: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func setServerCertificate(serverCertificate: BufferSource) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.setServerCertificate].function!(this: this, arguments: [serverCertificate.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift b/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift deleted file mode 100644 index 5dc0e8b1..00000000 --- a/Sources/DOMKit/WebIDL/MediaKeysRequirement.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MediaKeysRequirement: JSString, JSValueCompatible { - case required = "required" - case optional = "optional" - case notAllowed = "not-allowed" - - @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/MediaMetadata.swift b/Sources/DOMKit/WebIDL/MediaMetadata.swift deleted file mode 100644 index 8759d27c..00000000 --- a/Sources/DOMKit/WebIDL/MediaMetadata.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaMetadata: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaMetadata].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _title = ReadWriteAttribute(jsObject: jsObject, name: Strings.title) - _artist = ReadWriteAttribute(jsObject: jsObject, name: Strings.artist) - _album = ReadWriteAttribute(jsObject: jsObject, name: Strings.album) - _artwork = ReadWriteAttribute(jsObject: jsObject, name: Strings.artwork) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: MediaMetadataInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var title: String - - @ReadWriteAttribute - public var artist: String - - @ReadWriteAttribute - public var album: String - - @ReadWriteAttribute - public var artwork: [MediaImage] -} diff --git a/Sources/DOMKit/WebIDL/MediaMetadataInit.swift b/Sources/DOMKit/WebIDL/MediaMetadataInit.swift deleted file mode 100644 index 5795f8ca..00000000 --- a/Sources/DOMKit/WebIDL/MediaMetadataInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaMetadataInit: BridgedDictionary { - public convenience init(title: String, artist: String, album: String, artwork: [MediaImage]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.title] = title.jsValue - object[Strings.artist] = artist.jsValue - object[Strings.album] = album.jsValue - object[Strings.artwork] = artwork.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _title = ReadWriteAttribute(jsObject: object, name: Strings.title) - _artist = ReadWriteAttribute(jsObject: object, name: Strings.artist) - _album = ReadWriteAttribute(jsObject: object, name: Strings.album) - _artwork = ReadWriteAttribute(jsObject: object, name: Strings.artwork) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var title: String - - @ReadWriteAttribute - public var artist: String - - @ReadWriteAttribute - public var album: String - - @ReadWriteAttribute - public var artwork: [MediaImage] -} diff --git a/Sources/DOMKit/WebIDL/MediaPositionState.swift b/Sources/DOMKit/WebIDL/MediaPositionState.swift deleted file mode 100644 index d31c1d2e..00000000 --- a/Sources/DOMKit/WebIDL/MediaPositionState.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaPositionState: BridgedDictionary { - public convenience init(duration: Double, playbackRate: Double, position: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.duration] = duration.jsValue - object[Strings.playbackRate] = playbackRate.jsValue - object[Strings.position] = position.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) - _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) - _position = ReadWriteAttribute(jsObject: object, name: Strings.position) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var duration: Double - - @ReadWriteAttribute - public var playbackRate: Double - - @ReadWriteAttribute - public var position: Double -} diff --git a/Sources/DOMKit/WebIDL/MediaQueryList.swift b/Sources/DOMKit/WebIDL/MediaQueryList.swift deleted file mode 100644 index e2f6e574..00000000 --- a/Sources/DOMKit/WebIDL/MediaQueryList.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaQueryList: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaQueryList].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) - _matches = ReadonlyAttribute(jsObject: jsObject, name: Strings.matches) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var media: String - - @ReadonlyAttribute - public var matches: Bool - - // XXX: member 'addListener' is ignored - - // XXX: member 'removeListener' is ignored - - @ClosureAttribute1Optional - public var onchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift b/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift deleted file mode 100644 index e74e5c35..00000000 --- a/Sources/DOMKit/WebIDL/MediaQueryListEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaQueryListEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaQueryListEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) - _matches = ReadonlyAttribute(jsObject: jsObject, name: Strings.matches) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: MediaQueryListEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var media: String - - @ReadonlyAttribute - public var matches: Bool -} diff --git a/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift b/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift deleted file mode 100644 index 0f6adc8b..00000000 --- a/Sources/DOMKit/WebIDL/MediaQueryListEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaQueryListEventInit: BridgedDictionary { - public convenience init(media: String, matches: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.media] = media.jsValue - object[Strings.matches] = matches.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _media = ReadWriteAttribute(jsObject: object, name: Strings.media) - _matches = ReadWriteAttribute(jsObject: object, name: Strings.matches) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var media: String - - @ReadWriteAttribute - public var matches: Bool -} diff --git a/Sources/DOMKit/WebIDL/MediaSession.swift b/Sources/DOMKit/WebIDL/MediaSession.swift deleted file mode 100644 index aff40eca..00000000 --- a/Sources/DOMKit/WebIDL/MediaSession.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaSession: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaSession].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _metadata = ReadWriteAttribute(jsObject: jsObject, name: Strings.metadata) - _playbackState = ReadWriteAttribute(jsObject: jsObject, name: Strings.playbackState) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var metadata: MediaMetadata? - - @ReadWriteAttribute - public var playbackState: MediaSessionPlaybackState - - // XXX: member 'setActionHandler' is ignored - - @inlinable public func setPositionState(state: MediaPositionState? = nil) { - let this = jsObject - _ = this[Strings.setPositionState].function!(this: this, arguments: [state?.jsValue ?? .undefined]) - } - - @inlinable public func setMicrophoneActive(active: Bool) { - let this = jsObject - _ = this[Strings.setMicrophoneActive].function!(this: this, arguments: [active.jsValue]) - } - - @inlinable public func setCameraActive(active: Bool) { - let this = jsObject - _ = this[Strings.setCameraActive].function!(this: this, arguments: [active.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/MediaSessionAction.swift b/Sources/DOMKit/WebIDL/MediaSessionAction.swift deleted file mode 100644 index 09d789b8..00000000 --- a/Sources/DOMKit/WebIDL/MediaSessionAction.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MediaSessionAction: JSString, JSValueCompatible { - case play = "play" - case pause = "pause" - case seekbackward = "seekbackward" - case seekforward = "seekforward" - case previoustrack = "previoustrack" - case nexttrack = "nexttrack" - case skipad = "skipad" - case stop = "stop" - case seekto = "seekto" - case togglemicrophone = "togglemicrophone" - case togglecamera = "togglecamera" - case hangup = "hangup" - - @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/MediaSessionActionDetails.swift b/Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift deleted file mode 100644 index 6a6dd1fc..00000000 --- a/Sources/DOMKit/WebIDL/MediaSessionActionDetails.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaSessionActionDetails: BridgedDictionary { - public convenience init(action: MediaSessionAction, seekOffset: Double?, seekTime: Double?, fastSeek: Bool?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.action] = action.jsValue - object[Strings.seekOffset] = seekOffset.jsValue - object[Strings.seekTime] = seekTime.jsValue - object[Strings.fastSeek] = fastSeek.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _action = ReadWriteAttribute(jsObject: object, name: Strings.action) - _seekOffset = ReadWriteAttribute(jsObject: object, name: Strings.seekOffset) - _seekTime = ReadWriteAttribute(jsObject: object, name: Strings.seekTime) - _fastSeek = ReadWriteAttribute(jsObject: object, name: Strings.fastSeek) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var action: MediaSessionAction - - @ReadWriteAttribute - public var seekOffset: Double? - - @ReadWriteAttribute - public var seekTime: Double? - - @ReadWriteAttribute - public var fastSeek: Bool? -} diff --git a/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift b/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift deleted file mode 100644 index e8fe7191..00000000 --- a/Sources/DOMKit/WebIDL/MediaSessionPlaybackState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MediaSessionPlaybackState: JSString, JSValueCompatible { - case none = "none" - case paused = "paused" - case playing = "playing" - - @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/MediaSettingsRange.swift b/Sources/DOMKit/WebIDL/MediaSettingsRange.swift deleted file mode 100644 index de00ce6c..00000000 --- a/Sources/DOMKit/WebIDL/MediaSettingsRange.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaSettingsRange: BridgedDictionary { - public convenience init(max: Double, min: Double, step: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.max] = max.jsValue - object[Strings.min] = min.jsValue - object[Strings.step] = step.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) - _step = ReadWriteAttribute(jsObject: object, name: Strings.step) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var max: Double - - @ReadWriteAttribute - public var min: Double - - @ReadWriteAttribute - public var step: Double -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift deleted file mode 100644 index d5e8ecc6..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioDestinationNode.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaStreamAudioDestinationNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamAudioDestinationNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _stream = ReadonlyAttribute(jsObject: jsObject, name: Strings.stream) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: AudioContext, options: AudioNodeOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var stream: MediaStream -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift deleted file mode 100644 index 5be10e19..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceNode.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaStreamAudioSourceNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamAudioSourceNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _mediaStream = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaStream) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: AudioContext, options: MediaStreamAudioSourceOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options.jsValue])) - } - - @ReadonlyAttribute - public var mediaStream: MediaStream -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift b/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift deleted file mode 100644 index c7692542..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamAudioSourceOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaStreamAudioSourceOptions: BridgedDictionary { - public convenience init(mediaStream: MediaStream) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaStream] = mediaStream.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mediaStream = ReadWriteAttribute(jsObject: object, name: Strings.mediaStream) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mediaStream: MediaStream -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift index 2f83e3b5..b2ee4cce 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift @@ -4,20 +4,16 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaStreamConstraints: BridgedDictionary { - public convenience init(video: Bool_or_MediaTrackConstraints, audio: Bool_or_MediaTrackConstraints, preferCurrentTab: Bool, peerIdentity: String) { + public convenience init(video: Bool_or_MediaTrackConstraints, audio: Bool_or_MediaTrackConstraints) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.video] = video.jsValue object[Strings.audio] = audio.jsValue - object[Strings.preferCurrentTab] = preferCurrentTab.jsValue - object[Strings.peerIdentity] = peerIdentity.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { _video = ReadWriteAttribute(jsObject: object, name: Strings.video) _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) - _preferCurrentTab = ReadWriteAttribute(jsObject: object, name: Strings.preferCurrentTab) - _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) super.init(unsafelyWrapping: object) } @@ -26,10 +22,4 @@ public class MediaStreamConstraints: BridgedDictionary { @ReadWriteAttribute public var audio: Bool_or_MediaTrackConstraints - - @ReadWriteAttribute - public var preferCurrentTab: Bool - - @ReadWriteAttribute - public var peerIdentity: String } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift index a349e8ec..450347d9 100644 --- a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift +++ b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift @@ -16,9 +16,6 @@ public class MediaStreamTrack: EventTarget { _onunmute = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onunmute) _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) _onended = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onended) - _contentHint = ReadWriteAttribute(jsObject: jsObject, name: Strings.contentHint) - _isolated = ReadonlyAttribute(jsObject: jsObject, name: Strings.isolated) - _onisolationchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onisolationchange) super.init(unsafelyWrapping: jsObject) } @@ -85,13 +82,4 @@ public class MediaStreamTrack: EventTarget { let _promise: JSPromise = this[Strings.applyConstraints].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! _ = try await _promise.value } - - @ReadWriteAttribute - public var contentHint: String - - @ReadonlyAttribute - public var isolated: Bool - - @ClosureAttribute1Optional - public var onisolationchange: EventHandler } diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift deleted file mode 100644 index 38e86dde..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceNode.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaStreamTrackAudioSourceNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackAudioSourceNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: AudioContext, options: MediaStreamTrackAudioSourceOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options.jsValue])) - } -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift deleted file mode 100644 index 26d7ecb6..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackAudioSourceOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaStreamTrackAudioSourceOptions: BridgedDictionary { - public convenience init(mediaStreamTrack: MediaStreamTrack) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaStreamTrack] = mediaStreamTrack.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mediaStreamTrack = ReadWriteAttribute(jsObject: object, name: Strings.mediaStreamTrack) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mediaStreamTrack: MediaStreamTrack -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift deleted file mode 100644 index a3bc394b..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackProcessorInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaStreamTrackProcessorInit: BridgedDictionary { - public convenience init(track: MediaStreamTrack, maxBufferSize: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.track] = track.jsValue - object[Strings.maxBufferSize] = maxBufferSize.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _track = ReadWriteAttribute(jsObject: object, name: Strings.track) - _maxBufferSize = ReadWriteAttribute(jsObject: object, name: Strings.maxBufferSize) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var track: MediaStreamTrack - - @ReadWriteAttribute - public var maxBufferSize: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift deleted file mode 100644 index daecfba5..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamTrack_or_String.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_MediaStreamTrack_or_String: ConvertibleToJSValue {} -extension MediaStreamTrack: Any_MediaStreamTrack_or_String {} -extension String: Any_MediaStreamTrack_or_String {} - -public enum MediaStreamTrack_or_String: JSValueCompatible, Any_MediaStreamTrack_or_String { - case mediaStreamTrack(MediaStreamTrack) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let mediaStreamTrack: MediaStreamTrack = value.fromJSValue() { - return .mediaStreamTrack(mediaStreamTrack) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .mediaStreamTrack(mediaStreamTrack): - return mediaStreamTrack.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift index b0112a82..41982ba3 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift @@ -4,24 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaTrackCapabilities: BridgedDictionary { - public convenience init(whiteBalanceMode: [String], exposureMode: [String], focusMode: [String], exposureCompensation: MediaSettingsRange, exposureTime: MediaSettingsRange, colorTemperature: MediaSettingsRange, iso: MediaSettingsRange, brightness: MediaSettingsRange, contrast: MediaSettingsRange, saturation: MediaSettingsRange, sharpness: MediaSettingsRange, focusDistance: MediaSettingsRange, pan: MediaSettingsRange, tilt: MediaSettingsRange, zoom: MediaSettingsRange, torch: Bool, 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, displaySurface: String, logicalSurface: Bool, cursor: [String]) { + 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.whiteBalanceMode] = whiteBalanceMode.jsValue - object[Strings.exposureMode] = exposureMode.jsValue - object[Strings.focusMode] = focusMode.jsValue - object[Strings.exposureCompensation] = exposureCompensation.jsValue - object[Strings.exposureTime] = exposureTime.jsValue - object[Strings.colorTemperature] = colorTemperature.jsValue - object[Strings.iso] = iso.jsValue - object[Strings.brightness] = brightness.jsValue - object[Strings.contrast] = contrast.jsValue - object[Strings.saturation] = saturation.jsValue - object[Strings.sharpness] = sharpness.jsValue - object[Strings.focusDistance] = focusDistance.jsValue - object[Strings.pan] = pan.jsValue - object[Strings.tilt] = tilt.jsValue - object[Strings.zoom] = zoom.jsValue - object[Strings.torch] = torch.jsValue object[Strings.width] = width.jsValue object[Strings.height] = height.jsValue object[Strings.aspectRatio] = aspectRatio.jsValue @@ -37,29 +21,10 @@ public class MediaTrackCapabilities: BridgedDictionary { object[Strings.channelCount] = channelCount.jsValue object[Strings.deviceId] = deviceId.jsValue object[Strings.groupId] = groupId.jsValue - object[Strings.displaySurface] = displaySurface.jsValue - object[Strings.logicalSurface] = logicalSurface.jsValue - object[Strings.cursor] = cursor.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) - _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) - _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) - _exposureCompensation = ReadWriteAttribute(jsObject: object, name: Strings.exposureCompensation) - _exposureTime = ReadWriteAttribute(jsObject: object, name: Strings.exposureTime) - _colorTemperature = ReadWriteAttribute(jsObject: object, name: Strings.colorTemperature) - _iso = ReadWriteAttribute(jsObject: object, name: Strings.iso) - _brightness = ReadWriteAttribute(jsObject: object, name: Strings.brightness) - _contrast = ReadWriteAttribute(jsObject: object, name: Strings.contrast) - _saturation = ReadWriteAttribute(jsObject: object, name: Strings.saturation) - _sharpness = ReadWriteAttribute(jsObject: object, name: Strings.sharpness) - _focusDistance = ReadWriteAttribute(jsObject: object, name: Strings.focusDistance) - _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) - _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) - _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) - _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) _width = ReadWriteAttribute(jsObject: object, name: Strings.width) _height = ReadWriteAttribute(jsObject: object, name: Strings.height) _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) @@ -75,60 +40,9 @@ public class MediaTrackCapabilities: BridgedDictionary { _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) - _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) - _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) - _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var whiteBalanceMode: [String] - - @ReadWriteAttribute - public var exposureMode: [String] - - @ReadWriteAttribute - public var focusMode: [String] - - @ReadWriteAttribute - public var exposureCompensation: MediaSettingsRange - - @ReadWriteAttribute - public var exposureTime: MediaSettingsRange - - @ReadWriteAttribute - public var colorTemperature: MediaSettingsRange - - @ReadWriteAttribute - public var iso: MediaSettingsRange - - @ReadWriteAttribute - public var brightness: MediaSettingsRange - - @ReadWriteAttribute - public var contrast: MediaSettingsRange - - @ReadWriteAttribute - public var saturation: MediaSettingsRange - - @ReadWriteAttribute - public var sharpness: MediaSettingsRange - - @ReadWriteAttribute - public var focusDistance: MediaSettingsRange - - @ReadWriteAttribute - public var pan: MediaSettingsRange - - @ReadWriteAttribute - public var tilt: MediaSettingsRange - - @ReadWriteAttribute - public var zoom: MediaSettingsRange - - @ReadWriteAttribute - public var torch: Bool - @ReadWriteAttribute public var width: ULongRange @@ -173,13 +87,4 @@ public class MediaTrackCapabilities: BridgedDictionary { @ReadWriteAttribute public var groupId: String - - @ReadWriteAttribute - public var displaySurface: String - - @ReadWriteAttribute - public var logicalSurface: Bool - - @ReadWriteAttribute - public var cursor: [String] } diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift index 15ef7501..1489baaa 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift @@ -4,25 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaTrackConstraintSet: BridgedDictionary { - public convenience init(whiteBalanceMode: ConstrainDOMString, exposureMode: ConstrainDOMString, focusMode: ConstrainDOMString, pointsOfInterest: ConstrainPoint2D, exposureCompensation: ConstrainDouble, exposureTime: ConstrainDouble, colorTemperature: ConstrainDouble, iso: ConstrainDouble, brightness: ConstrainDouble, contrast: ConstrainDouble, saturation: ConstrainDouble, sharpness: ConstrainDouble, focusDistance: ConstrainDouble, pan: Bool_or_ConstrainDouble, tilt: Bool_or_ConstrainDouble, zoom: Bool_or_ConstrainDouble, torch: ConstrainBoolean, 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, displaySurface: ConstrainDOMString, logicalSurface: ConstrainBoolean, cursor: ConstrainDOMString, restrictOwnAudio: ConstrainBoolean, suppressLocalAudioPlayback: ConstrainBoolean) { + 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.whiteBalanceMode] = whiteBalanceMode.jsValue - object[Strings.exposureMode] = exposureMode.jsValue - object[Strings.focusMode] = focusMode.jsValue - object[Strings.pointsOfInterest] = pointsOfInterest.jsValue - object[Strings.exposureCompensation] = exposureCompensation.jsValue - object[Strings.exposureTime] = exposureTime.jsValue - object[Strings.colorTemperature] = colorTemperature.jsValue - object[Strings.iso] = iso.jsValue - object[Strings.brightness] = brightness.jsValue - object[Strings.contrast] = contrast.jsValue - object[Strings.saturation] = saturation.jsValue - object[Strings.sharpness] = sharpness.jsValue - object[Strings.focusDistance] = focusDistance.jsValue - object[Strings.pan] = pan.jsValue - object[Strings.tilt] = tilt.jsValue - object[Strings.zoom] = zoom.jsValue - object[Strings.torch] = torch.jsValue object[Strings.width] = width.jsValue object[Strings.height] = height.jsValue object[Strings.aspectRatio] = aspectRatio.jsValue @@ -38,32 +21,10 @@ public class MediaTrackConstraintSet: BridgedDictionary { object[Strings.channelCount] = channelCount.jsValue object[Strings.deviceId] = deviceId.jsValue object[Strings.groupId] = groupId.jsValue - object[Strings.displaySurface] = displaySurface.jsValue - object[Strings.logicalSurface] = logicalSurface.jsValue - object[Strings.cursor] = cursor.jsValue - object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue - object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) - _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) - _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) - _pointsOfInterest = ReadWriteAttribute(jsObject: object, name: Strings.pointsOfInterest) - _exposureCompensation = ReadWriteAttribute(jsObject: object, name: Strings.exposureCompensation) - _exposureTime = ReadWriteAttribute(jsObject: object, name: Strings.exposureTime) - _colorTemperature = ReadWriteAttribute(jsObject: object, name: Strings.colorTemperature) - _iso = ReadWriteAttribute(jsObject: object, name: Strings.iso) - _brightness = ReadWriteAttribute(jsObject: object, name: Strings.brightness) - _contrast = ReadWriteAttribute(jsObject: object, name: Strings.contrast) - _saturation = ReadWriteAttribute(jsObject: object, name: Strings.saturation) - _sharpness = ReadWriteAttribute(jsObject: object, name: Strings.sharpness) - _focusDistance = ReadWriteAttribute(jsObject: object, name: Strings.focusDistance) - _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) - _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) - _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) - _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) _width = ReadWriteAttribute(jsObject: object, name: Strings.width) _height = ReadWriteAttribute(jsObject: object, name: Strings.height) _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) @@ -79,65 +40,9 @@ public class MediaTrackConstraintSet: BridgedDictionary { _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) - _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) - _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) - _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) - _restrictOwnAudio = ReadWriteAttribute(jsObject: object, name: Strings.restrictOwnAudio) - _suppressLocalAudioPlayback = ReadWriteAttribute(jsObject: object, name: Strings.suppressLocalAudioPlayback) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var whiteBalanceMode: ConstrainDOMString - - @ReadWriteAttribute - public var exposureMode: ConstrainDOMString - - @ReadWriteAttribute - public var focusMode: ConstrainDOMString - - @ReadWriteAttribute - public var pointsOfInterest: ConstrainPoint2D - - @ReadWriteAttribute - public var exposureCompensation: ConstrainDouble - - @ReadWriteAttribute - public var exposureTime: ConstrainDouble - - @ReadWriteAttribute - public var colorTemperature: ConstrainDouble - - @ReadWriteAttribute - public var iso: ConstrainDouble - - @ReadWriteAttribute - public var brightness: ConstrainDouble - - @ReadWriteAttribute - public var contrast: ConstrainDouble - - @ReadWriteAttribute - public var saturation: ConstrainDouble - - @ReadWriteAttribute - public var sharpness: ConstrainDouble - - @ReadWriteAttribute - public var focusDistance: ConstrainDouble - - @ReadWriteAttribute - public var pan: Bool_or_ConstrainDouble - - @ReadWriteAttribute - public var tilt: Bool_or_ConstrainDouble - - @ReadWriteAttribute - public var zoom: Bool_or_ConstrainDouble - - @ReadWriteAttribute - public var torch: ConstrainBoolean - @ReadWriteAttribute public var width: ConstrainULong @@ -182,19 +87,4 @@ public class MediaTrackConstraintSet: BridgedDictionary { @ReadWriteAttribute public var groupId: ConstrainDOMString - - @ReadWriteAttribute - public var displaySurface: ConstrainDOMString - - @ReadWriteAttribute - public var logicalSurface: ConstrainBoolean - - @ReadWriteAttribute - public var cursor: ConstrainDOMString - - @ReadWriteAttribute - public var restrictOwnAudio: ConstrainBoolean - - @ReadWriteAttribute - public var suppressLocalAudioPlayback: ConstrainBoolean } diff --git a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift index cac9524d..84d866a3 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift @@ -4,25 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaTrackSettings: BridgedDictionary { - public convenience init(whiteBalanceMode: String, exposureMode: String, focusMode: String, pointsOfInterest: [Point2D], exposureCompensation: Double, exposureTime: Double, colorTemperature: Double, iso: Double, brightness: Double, contrast: Double, saturation: Double, sharpness: Double, focusDistance: Double, pan: Double, tilt: Double, zoom: Double, torch: Bool, 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, displaySurface: String, logicalSurface: Bool, cursor: String, restrictOwnAudio: Bool) { + 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.whiteBalanceMode] = whiteBalanceMode.jsValue - object[Strings.exposureMode] = exposureMode.jsValue - object[Strings.focusMode] = focusMode.jsValue - object[Strings.pointsOfInterest] = pointsOfInterest.jsValue - object[Strings.exposureCompensation] = exposureCompensation.jsValue - object[Strings.exposureTime] = exposureTime.jsValue - object[Strings.colorTemperature] = colorTemperature.jsValue - object[Strings.iso] = iso.jsValue - object[Strings.brightness] = brightness.jsValue - object[Strings.contrast] = contrast.jsValue - object[Strings.saturation] = saturation.jsValue - object[Strings.sharpness] = sharpness.jsValue - object[Strings.focusDistance] = focusDistance.jsValue - object[Strings.pan] = pan.jsValue - object[Strings.tilt] = tilt.jsValue - object[Strings.zoom] = zoom.jsValue - object[Strings.torch] = torch.jsValue object[Strings.width] = width.jsValue object[Strings.height] = height.jsValue object[Strings.aspectRatio] = aspectRatio.jsValue @@ -38,31 +21,10 @@ public class MediaTrackSettings: BridgedDictionary { object[Strings.channelCount] = channelCount.jsValue object[Strings.deviceId] = deviceId.jsValue object[Strings.groupId] = groupId.jsValue - object[Strings.displaySurface] = displaySurface.jsValue - object[Strings.logicalSurface] = logicalSurface.jsValue - object[Strings.cursor] = cursor.jsValue - object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) - _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) - _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) - _pointsOfInterest = ReadWriteAttribute(jsObject: object, name: Strings.pointsOfInterest) - _exposureCompensation = ReadWriteAttribute(jsObject: object, name: Strings.exposureCompensation) - _exposureTime = ReadWriteAttribute(jsObject: object, name: Strings.exposureTime) - _colorTemperature = ReadWriteAttribute(jsObject: object, name: Strings.colorTemperature) - _iso = ReadWriteAttribute(jsObject: object, name: Strings.iso) - _brightness = ReadWriteAttribute(jsObject: object, name: Strings.brightness) - _contrast = ReadWriteAttribute(jsObject: object, name: Strings.contrast) - _saturation = ReadWriteAttribute(jsObject: object, name: Strings.saturation) - _sharpness = ReadWriteAttribute(jsObject: object, name: Strings.sharpness) - _focusDistance = ReadWriteAttribute(jsObject: object, name: Strings.focusDistance) - _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) - _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) - _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) - _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) _width = ReadWriteAttribute(jsObject: object, name: Strings.width) _height = ReadWriteAttribute(jsObject: object, name: Strings.height) _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) @@ -78,64 +40,9 @@ public class MediaTrackSettings: BridgedDictionary { _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) - _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) - _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) - _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) - _restrictOwnAudio = ReadWriteAttribute(jsObject: object, name: Strings.restrictOwnAudio) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var whiteBalanceMode: String - - @ReadWriteAttribute - public var exposureMode: String - - @ReadWriteAttribute - public var focusMode: String - - @ReadWriteAttribute - public var pointsOfInterest: [Point2D] - - @ReadWriteAttribute - public var exposureCompensation: Double - - @ReadWriteAttribute - public var exposureTime: Double - - @ReadWriteAttribute - public var colorTemperature: Double - - @ReadWriteAttribute - public var iso: Double - - @ReadWriteAttribute - public var brightness: Double - - @ReadWriteAttribute - public var contrast: Double - - @ReadWriteAttribute - public var saturation: Double - - @ReadWriteAttribute - public var sharpness: Double - - @ReadWriteAttribute - public var focusDistance: Double - - @ReadWriteAttribute - public var pan: Double - - @ReadWriteAttribute - public var tilt: Double - - @ReadWriteAttribute - public var zoom: Double - - @ReadWriteAttribute - public var torch: Bool - @ReadWriteAttribute public var width: Int32 @@ -180,16 +87,4 @@ public class MediaTrackSettings: BridgedDictionary { @ReadWriteAttribute public var groupId: String - - @ReadWriteAttribute - public var displaySurface: String - - @ReadWriteAttribute - public var logicalSurface: Bool - - @ReadWriteAttribute - public var cursor: String - - @ReadWriteAttribute - public var restrictOwnAudio: Bool } diff --git a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift index fda3f3b4..bcbfd4ba 100644 --- a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift +++ b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift @@ -4,25 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class MediaTrackSupportedConstraints: BridgedDictionary { - public convenience init(whiteBalanceMode: Bool, exposureMode: Bool, focusMode: Bool, pointsOfInterest: Bool, exposureCompensation: Bool, exposureTime: Bool, colorTemperature: Bool, iso: Bool, brightness: Bool, contrast: Bool, pan: Bool, saturation: Bool, sharpness: Bool, focusDistance: Bool, tilt: Bool, zoom: Bool, torch: Bool, 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, displaySurface: Bool, logicalSurface: Bool, cursor: Bool, restrictOwnAudio: Bool, suppressLocalAudioPlayback: Bool) { + 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.whiteBalanceMode] = whiteBalanceMode.jsValue - object[Strings.exposureMode] = exposureMode.jsValue - object[Strings.focusMode] = focusMode.jsValue - object[Strings.pointsOfInterest] = pointsOfInterest.jsValue - object[Strings.exposureCompensation] = exposureCompensation.jsValue - object[Strings.exposureTime] = exposureTime.jsValue - object[Strings.colorTemperature] = colorTemperature.jsValue - object[Strings.iso] = iso.jsValue - object[Strings.brightness] = brightness.jsValue - object[Strings.contrast] = contrast.jsValue - object[Strings.pan] = pan.jsValue - object[Strings.saturation] = saturation.jsValue - object[Strings.sharpness] = sharpness.jsValue - object[Strings.focusDistance] = focusDistance.jsValue - object[Strings.tilt] = tilt.jsValue - object[Strings.zoom] = zoom.jsValue - object[Strings.torch] = torch.jsValue object[Strings.width] = width.jsValue object[Strings.height] = height.jsValue object[Strings.aspectRatio] = aspectRatio.jsValue @@ -38,32 +21,10 @@ public class MediaTrackSupportedConstraints: BridgedDictionary { object[Strings.channelCount] = channelCount.jsValue object[Strings.deviceId] = deviceId.jsValue object[Strings.groupId] = groupId.jsValue - object[Strings.displaySurface] = displaySurface.jsValue - object[Strings.logicalSurface] = logicalSurface.jsValue - object[Strings.cursor] = cursor.jsValue - object[Strings.restrictOwnAudio] = restrictOwnAudio.jsValue - object[Strings.suppressLocalAudioPlayback] = suppressLocalAudioPlayback.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _whiteBalanceMode = ReadWriteAttribute(jsObject: object, name: Strings.whiteBalanceMode) - _exposureMode = ReadWriteAttribute(jsObject: object, name: Strings.exposureMode) - _focusMode = ReadWriteAttribute(jsObject: object, name: Strings.focusMode) - _pointsOfInterest = ReadWriteAttribute(jsObject: object, name: Strings.pointsOfInterest) - _exposureCompensation = ReadWriteAttribute(jsObject: object, name: Strings.exposureCompensation) - _exposureTime = ReadWriteAttribute(jsObject: object, name: Strings.exposureTime) - _colorTemperature = ReadWriteAttribute(jsObject: object, name: Strings.colorTemperature) - _iso = ReadWriteAttribute(jsObject: object, name: Strings.iso) - _brightness = ReadWriteAttribute(jsObject: object, name: Strings.brightness) - _contrast = ReadWriteAttribute(jsObject: object, name: Strings.contrast) - _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) - _saturation = ReadWriteAttribute(jsObject: object, name: Strings.saturation) - _sharpness = ReadWriteAttribute(jsObject: object, name: Strings.sharpness) - _focusDistance = ReadWriteAttribute(jsObject: object, name: Strings.focusDistance) - _tilt = ReadWriteAttribute(jsObject: object, name: Strings.tilt) - _zoom = ReadWriteAttribute(jsObject: object, name: Strings.zoom) - _torch = ReadWriteAttribute(jsObject: object, name: Strings.torch) _width = ReadWriteAttribute(jsObject: object, name: Strings.width) _height = ReadWriteAttribute(jsObject: object, name: Strings.height) _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) @@ -79,65 +40,9 @@ public class MediaTrackSupportedConstraints: BridgedDictionary { _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) - _displaySurface = ReadWriteAttribute(jsObject: object, name: Strings.displaySurface) - _logicalSurface = ReadWriteAttribute(jsObject: object, name: Strings.logicalSurface) - _cursor = ReadWriteAttribute(jsObject: object, name: Strings.cursor) - _restrictOwnAudio = ReadWriteAttribute(jsObject: object, name: Strings.restrictOwnAudio) - _suppressLocalAudioPlayback = ReadWriteAttribute(jsObject: object, name: Strings.suppressLocalAudioPlayback) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var whiteBalanceMode: Bool - - @ReadWriteAttribute - public var exposureMode: Bool - - @ReadWriteAttribute - public var focusMode: Bool - - @ReadWriteAttribute - public var pointsOfInterest: Bool - - @ReadWriteAttribute - public var exposureCompensation: Bool - - @ReadWriteAttribute - public var exposureTime: Bool - - @ReadWriteAttribute - public var colorTemperature: Bool - - @ReadWriteAttribute - public var iso: Bool - - @ReadWriteAttribute - public var brightness: Bool - - @ReadWriteAttribute - public var contrast: Bool - - @ReadWriteAttribute - public var pan: Bool - - @ReadWriteAttribute - public var saturation: Bool - - @ReadWriteAttribute - public var sharpness: Bool - - @ReadWriteAttribute - public var focusDistance: Bool - - @ReadWriteAttribute - public var tilt: Bool - - @ReadWriteAttribute - public var zoom: Bool - - @ReadWriteAttribute - public var torch: Bool - @ReadWriteAttribute public var width: Bool @@ -182,19 +87,4 @@ public class MediaTrackSupportedConstraints: BridgedDictionary { @ReadWriteAttribute public var groupId: Bool - - @ReadWriteAttribute - public var displaySurface: Bool - - @ReadWriteAttribute - public var logicalSurface: Bool - - @ReadWriteAttribute - public var cursor: Bool - - @ReadWriteAttribute - public var restrictOwnAudio: Bool - - @ReadWriteAttribute - public var suppressLocalAudioPlayback: Bool } diff --git a/Sources/DOMKit/WebIDL/Memory.swift b/Sources/DOMKit/WebIDL/Memory.swift deleted file mode 100644 index b2a4e01d..00000000 --- a/Sources/DOMKit/WebIDL/Memory.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Memory: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Memory].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _buffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.buffer) - self.jsObject = jsObject - } - - @inlinable public convenience init(descriptor: MemoryDescriptor) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue])) - } - - @inlinable public func grow(delta: UInt32) -> UInt32 { - let this = jsObject - return this[Strings.grow].function!(this: this, arguments: [delta.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var buffer: ArrayBuffer -} diff --git a/Sources/DOMKit/WebIDL/MemoryAttribution.swift b/Sources/DOMKit/WebIDL/MemoryAttribution.swift deleted file mode 100644 index f4a4c13d..00000000 --- a/Sources/DOMKit/WebIDL/MemoryAttribution.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MemoryAttribution: BridgedDictionary { - public convenience init(url: String, container: MemoryAttributionContainer, scope: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.url] = url.jsValue - object[Strings.container] = container.jsValue - object[Strings.scope] = scope.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _url = ReadWriteAttribute(jsObject: object, name: Strings.url) - _container = ReadWriteAttribute(jsObject: object, name: Strings.container) - _scope = ReadWriteAttribute(jsObject: object, name: Strings.scope) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var url: String - - @ReadWriteAttribute - public var container: MemoryAttributionContainer - - @ReadWriteAttribute - public var scope: String -} diff --git a/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift b/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift deleted file mode 100644 index da512030..00000000 --- a/Sources/DOMKit/WebIDL/MemoryAttributionContainer.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MemoryAttributionContainer: BridgedDictionary { - public convenience init(id: String, src: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue - object[Strings.src] = src.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _src = ReadWriteAttribute(jsObject: object, name: Strings.src) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var id: String - - @ReadWriteAttribute - public var src: String -} diff --git a/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift b/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift deleted file mode 100644 index 0c7a8b05..00000000 --- a/Sources/DOMKit/WebIDL/MemoryBreakdownEntry.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MemoryBreakdownEntry: BridgedDictionary { - public convenience init(bytes: UInt64, attribution: [MemoryAttribution], types: [String]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bytes] = bytes.jsValue - object[Strings.attribution] = attribution.jsValue - object[Strings.types] = types.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _bytes = ReadWriteAttribute(jsObject: object, name: Strings.bytes) - _attribution = ReadWriteAttribute(jsObject: object, name: Strings.attribution) - _types = ReadWriteAttribute(jsObject: object, name: Strings.types) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var bytes: UInt64 - - @ReadWriteAttribute - public var attribution: [MemoryAttribution] - - @ReadWriteAttribute - public var types: [String] -} diff --git a/Sources/DOMKit/WebIDL/MemoryDescriptor.swift b/Sources/DOMKit/WebIDL/MemoryDescriptor.swift deleted file mode 100644 index 2853647b..00000000 --- a/Sources/DOMKit/WebIDL/MemoryDescriptor.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MemoryDescriptor: BridgedDictionary { - public convenience init(initial: UInt32, maximum: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.initial] = initial.jsValue - object[Strings.maximum] = maximum.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _initial = ReadWriteAttribute(jsObject: object, name: Strings.initial) - _maximum = ReadWriteAttribute(jsObject: object, name: Strings.maximum) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var initial: UInt32 - - @ReadWriteAttribute - public var maximum: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/MemoryMeasurement.swift b/Sources/DOMKit/WebIDL/MemoryMeasurement.swift deleted file mode 100644 index 349b84e8..00000000 --- a/Sources/DOMKit/WebIDL/MemoryMeasurement.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MemoryMeasurement: BridgedDictionary { - public convenience init(bytes: UInt64, breakdown: [MemoryBreakdownEntry]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.bytes] = bytes.jsValue - object[Strings.breakdown] = breakdown.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _bytes = ReadWriteAttribute(jsObject: object, name: Strings.bytes) - _breakdown = ReadWriteAttribute(jsObject: object, name: Strings.breakdown) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var bytes: UInt64 - - @ReadWriteAttribute - public var breakdown: [MemoryBreakdownEntry] -} diff --git a/Sources/DOMKit/WebIDL/MeteringMode.swift b/Sources/DOMKit/WebIDL/MeteringMode.swift deleted file mode 100644 index 2a08ed53..00000000 --- a/Sources/DOMKit/WebIDL/MeteringMode.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MeteringMode: JSString, JSValueCompatible { - case none = "none" - case manual = "manual" - case singleShot = "single-shot" - case continuous = "continuous" - - @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/MidiPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift deleted file mode 100644 index d46c874c..00000000 --- a/Sources/DOMKit/WebIDL/MidiPermissionDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MidiPermissionDescriptor: BridgedDictionary { - public convenience init(sysex: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sysex] = sysex.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _sysex = ReadWriteAttribute(jsObject: object, name: Strings.sysex) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var sysex: Bool -} diff --git a/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift b/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift deleted file mode 100644 index 6c3bc10e..00000000 --- a/Sources/DOMKit/WebIDL/MockCameraConfiguration.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MockCameraConfiguration: BridgedDictionary { - public convenience init(defaultFrameRate: Double, facingMode: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.defaultFrameRate] = defaultFrameRate.jsValue - object[Strings.facingMode] = facingMode.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _defaultFrameRate = ReadWriteAttribute(jsObject: object, name: Strings.defaultFrameRate) - _facingMode = ReadWriteAttribute(jsObject: object, name: Strings.facingMode) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var defaultFrameRate: Double - - @ReadWriteAttribute - public var facingMode: String -} diff --git a/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift b/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift deleted file mode 100644 index eb11d856..00000000 --- a/Sources/DOMKit/WebIDL/MockCaptureDeviceConfiguration.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MockCaptureDeviceConfiguration: BridgedDictionary { - public convenience init(label: String, deviceId: String, groupId: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue - object[Strings.deviceId] = deviceId.jsValue - object[Strings.groupId] = groupId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _label = ReadWriteAttribute(jsObject: object, name: Strings.label) - _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) - _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var label: String - - @ReadWriteAttribute - public var deviceId: String - - @ReadWriteAttribute - public var groupId: String -} diff --git a/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift b/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift deleted file mode 100644 index 44d35d35..00000000 --- a/Sources/DOMKit/WebIDL/MockCapturePromptResult.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MockCapturePromptResult: JSString, JSValueCompatible { - case granted = "granted" - case denied = "denied" - - @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/MockCapturePromptResultConfiguration.swift b/Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift deleted file mode 100644 index ae098160..00000000 --- a/Sources/DOMKit/WebIDL/MockCapturePromptResultConfiguration.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MockCapturePromptResultConfiguration: BridgedDictionary { - public convenience init(getUserMedia: MockCapturePromptResult, getDisplayMedia: MockCapturePromptResult) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.getUserMedia] = getUserMedia.jsValue - object[Strings.getDisplayMedia] = getDisplayMedia.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _getUserMedia = ReadWriteAttribute(jsObject: object, name: Strings.getUserMedia) - _getDisplayMedia = ReadWriteAttribute(jsObject: object, name: Strings.getDisplayMedia) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var getUserMedia: MockCapturePromptResult - - @ReadWriteAttribute - public var getDisplayMedia: MockCapturePromptResult -} diff --git a/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift b/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift deleted file mode 100644 index bacedcc5..00000000 --- a/Sources/DOMKit/WebIDL/MockMicrophoneConfiguration.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MockMicrophoneConfiguration: BridgedDictionary { - public convenience init(defaultSampleRate: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.defaultSampleRate] = defaultSampleRate.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _defaultSampleRate = ReadWriteAttribute(jsObject: object, name: Strings.defaultSampleRate) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var defaultSampleRate: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/MockSensor.swift b/Sources/DOMKit/WebIDL/MockSensor.swift deleted file mode 100644 index ebb51b09..00000000 --- a/Sources/DOMKit/WebIDL/MockSensor.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MockSensor: BridgedDictionary { - public convenience init(maxSamplingFrequency: Double, minSamplingFrequency: Double, requestedSamplingFrequency: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.maxSamplingFrequency] = maxSamplingFrequency.jsValue - object[Strings.minSamplingFrequency] = minSamplingFrequency.jsValue - object[Strings.requestedSamplingFrequency] = requestedSamplingFrequency.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _maxSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.maxSamplingFrequency) - _minSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.minSamplingFrequency) - _requestedSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.requestedSamplingFrequency) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var maxSamplingFrequency: Double - - @ReadWriteAttribute - public var minSamplingFrequency: Double - - @ReadWriteAttribute - public var requestedSamplingFrequency: Double -} diff --git a/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift b/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift deleted file mode 100644 index 569c32ae..00000000 --- a/Sources/DOMKit/WebIDL/MockSensorConfiguration.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MockSensorConfiguration: BridgedDictionary { - public convenience init(mockSensorType: MockSensorType, connected: Bool, maxSamplingFrequency: Double?, minSamplingFrequency: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mockSensorType] = mockSensorType.jsValue - object[Strings.connected] = connected.jsValue - object[Strings.maxSamplingFrequency] = maxSamplingFrequency.jsValue - object[Strings.minSamplingFrequency] = minSamplingFrequency.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mockSensorType = ReadWriteAttribute(jsObject: object, name: Strings.mockSensorType) - _connected = ReadWriteAttribute(jsObject: object, name: Strings.connected) - _maxSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.maxSamplingFrequency) - _minSamplingFrequency = ReadWriteAttribute(jsObject: object, name: Strings.minSamplingFrequency) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mockSensorType: MockSensorType - - @ReadWriteAttribute - public var connected: Bool - - @ReadWriteAttribute - public var maxSamplingFrequency: Double? - - @ReadWriteAttribute - public var minSamplingFrequency: Double? -} diff --git a/Sources/DOMKit/WebIDL/MockSensorReadingValues.swift b/Sources/DOMKit/WebIDL/MockSensorReadingValues.swift deleted file mode 100644 index 7525ce5d..00000000 --- a/Sources/DOMKit/WebIDL/MockSensorReadingValues.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MockSensorReadingValues: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/MockSensorType.swift b/Sources/DOMKit/WebIDL/MockSensorType.swift deleted file mode 100644 index 5387a9e7..00000000 --- a/Sources/DOMKit/WebIDL/MockSensorType.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum MockSensorType: JSString, JSValueCompatible { - case ambientLight = "ambient-light" - case accelerometer = "accelerometer" - case linearAcceleration = "linear-acceleration" - case gravity = "gravity" - case gyroscope = "gyroscope" - case magnetometer = "magnetometer" - case uncalibratedMagnetometer = "uncalibrated-magnetometer" - case absoluteOrientation = "absolute-orientation" - case relativeOrientation = "relative-orientation" - case geolocation = "geolocation" - case proximity = "proximity" - - @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/Module.swift b/Sources/DOMKit/WebIDL/Module.swift deleted file mode 100644 index 78d7385e..00000000 --- a/Sources/DOMKit/WebIDL/Module.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Module: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Module].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(bytes: BufferSource) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [bytes.jsValue])) - } - - @inlinable public static func exports(moduleObject: Module) -> [ModuleExportDescriptor] { - let this = constructor - return this[Strings.exports].function!(this: this, arguments: [moduleObject.jsValue]).fromJSValue()! - } - - @inlinable public static func imports(moduleObject: Module) -> [ModuleImportDescriptor] { - let this = constructor - return this[Strings.imports].function!(this: this, arguments: [moduleObject.jsValue]).fromJSValue()! - } - - @inlinable public static func customSections(moduleObject: Module, sectionName: String) -> [ArrayBuffer] { - let this = constructor - return this[Strings.customSections].function!(this: this, arguments: [moduleObject.jsValue, sectionName.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift b/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift deleted file mode 100644 index 6e85b9ec..00000000 --- a/Sources/DOMKit/WebIDL/ModuleExportDescriptor.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ModuleExportDescriptor: BridgedDictionary { - public convenience init(name: String, kind: ImportExportKind) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.kind] = kind.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var kind: ImportExportKind -} diff --git a/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift b/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift deleted file mode 100644 index 48707ea9..00000000 --- a/Sources/DOMKit/WebIDL/ModuleImportDescriptor.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ModuleImportDescriptor: BridgedDictionary { - public convenience init(module: String, name: String, kind: ImportExportKind) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.module] = module.jsValue - object[Strings.name] = name.jsValue - object[Strings.kind] = kind.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _module = ReadWriteAttribute(jsObject: object, name: Strings.module) - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var module: String - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var kind: ImportExportKind -} diff --git a/Sources/DOMKit/WebIDL/MouseEvent.swift b/Sources/DOMKit/WebIDL/MouseEvent.swift index 0408017a..274f1d93 100644 --- a/Sources/DOMKit/WebIDL/MouseEvent.swift +++ b/Sources/DOMKit/WebIDL/MouseEvent.swift @@ -7,14 +7,6 @@ public class MouseEvent: UIEvent { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MouseEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _pageX = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageX) - _pageY = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageY) - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _offsetX = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetX) - _offsetY = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetY) - _movementX = ReadonlyAttribute(jsObject: jsObject, name: Strings.movementX) - _movementY = ReadonlyAttribute(jsObject: jsObject, name: Strings.movementY) _screenX = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenX) _screenY = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenY) _clientX = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientX) @@ -29,30 +21,6 @@ public class MouseEvent: UIEvent { super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var pageX: Double - - @ReadonlyAttribute - public var pageY: Double - - @ReadonlyAttribute - public var x: Double - - @ReadonlyAttribute - public var y: Double - - @ReadonlyAttribute - public var offsetX: Double - - @ReadonlyAttribute - public var offsetY: Double - - @ReadonlyAttribute - public var movementX: Double - - @ReadonlyAttribute - public var movementY: Double - @inlinable public convenience init(type: String, eventInitDict: MouseEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/MouseEventInit.swift b/Sources/DOMKit/WebIDL/MouseEventInit.swift index ce3b6fad..6878df64 100644 --- a/Sources/DOMKit/WebIDL/MouseEventInit.swift +++ b/Sources/DOMKit/WebIDL/MouseEventInit.swift @@ -4,10 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class MouseEventInit: BridgedDictionary { - public convenience init(movementX: Double, movementY: Double, screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { + public convenience init(screenX: Int32, screenY: Int32, clientX: Int32, clientY: Int32, button: Int16, buttons: UInt16, relatedTarget: EventTarget?) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.movementX] = movementX.jsValue - object[Strings.movementY] = movementY.jsValue object[Strings.screenX] = screenX.jsValue object[Strings.screenY] = screenY.jsValue object[Strings.clientX] = clientX.jsValue @@ -19,8 +17,6 @@ public class MouseEventInit: BridgedDictionary { } public required init(unsafelyWrapping object: JSObject) { - _movementX = ReadWriteAttribute(jsObject: object, name: Strings.movementX) - _movementY = ReadWriteAttribute(jsObject: object, name: Strings.movementY) _screenX = ReadWriteAttribute(jsObject: object, name: Strings.screenX) _screenY = ReadWriteAttribute(jsObject: object, name: Strings.screenY) _clientX = ReadWriteAttribute(jsObject: object, name: Strings.clientX) @@ -31,12 +27,6 @@ public class MouseEventInit: BridgedDictionary { super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var movementX: Double - - @ReadWriteAttribute - public var movementY: Double - @ReadWriteAttribute public var screenX: Int32 diff --git a/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift b/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift deleted file mode 100644 index 63bbc4d5..00000000 --- a/Sources/DOMKit/WebIDL/NDEFMakeReadOnlyOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFMakeReadOnlyOptions: BridgedDictionary { - public convenience init(signal: AbortSignal?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var signal: AbortSignal? -} diff --git a/Sources/DOMKit/WebIDL/NDEFMessage.swift b/Sources/DOMKit/WebIDL/NDEFMessage.swift deleted file mode 100644 index 2f6a859e..00000000 --- a/Sources/DOMKit/WebIDL/NDEFMessage.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFMessage: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NDEFMessage].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _records = ReadonlyAttribute(jsObject: jsObject, name: Strings.records) - self.jsObject = jsObject - } - - @inlinable public convenience init(messageInit: NDEFMessageInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [messageInit.jsValue])) - } - - @ReadonlyAttribute - public var records: [NDEFRecord] -} diff --git a/Sources/DOMKit/WebIDL/NDEFMessageInit.swift b/Sources/DOMKit/WebIDL/NDEFMessageInit.swift deleted file mode 100644 index 3f0a57c0..00000000 --- a/Sources/DOMKit/WebIDL/NDEFMessageInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFMessageInit: BridgedDictionary { - public convenience init(records: [NDEFRecordInit]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.records] = records.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _records = ReadWriteAttribute(jsObject: object, name: Strings.records) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var records: [NDEFRecordInit] -} diff --git a/Sources/DOMKit/WebIDL/NDEFMessageSource.swift b/Sources/DOMKit/WebIDL/NDEFMessageSource.swift deleted file mode 100644 index 14eec83a..00000000 --- a/Sources/DOMKit/WebIDL/NDEFMessageSource.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_NDEFMessageSource: ConvertibleToJSValue {} -extension BufferSource: Any_NDEFMessageSource {} -extension NDEFMessageInit: Any_NDEFMessageSource {} -extension String: Any_NDEFMessageSource {} - -public enum NDEFMessageSource: JSValueCompatible, Any_NDEFMessageSource { - case bufferSource(BufferSource) - case nDEFMessageInit(NDEFMessageInit) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let bufferSource: BufferSource = value.fromJSValue() { - return .bufferSource(bufferSource) - } - if let nDEFMessageInit: NDEFMessageInit = value.fromJSValue() { - return .nDEFMessageInit(nDEFMessageInit) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .bufferSource(bufferSource): - return bufferSource.jsValue - case let .nDEFMessageInit(nDEFMessageInit): - return nDEFMessageInit.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/NDEFReader.swift b/Sources/DOMKit/WebIDL/NDEFReader.swift deleted file mode 100644 index e9d55087..00000000 --- a/Sources/DOMKit/WebIDL/NDEFReader.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFReader: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NDEFReader].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onreading = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreading) - _onreadingerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreadingerror) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @ClosureAttribute1Optional - public var onreading: EventHandler - - @ClosureAttribute1Optional - public var onreadingerror: EventHandler - - @inlinable public func scan(options: NDEFScanOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.scan].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func scan(options: NDEFScanOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.scan].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.write].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func write(message: NDEFMessageSource, options: NDEFWriteOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func makeReadOnly(options: NDEFMakeReadOnlyOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.makeReadOnly].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift b/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift deleted file mode 100644 index 17861eb4..00000000 --- a/Sources/DOMKit/WebIDL/NDEFReadingEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFReadingEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NDEFReadingEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _serialNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.serialNumber) - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, readingEventInitDict: NDEFReadingEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, readingEventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var serialNumber: String - - @ReadonlyAttribute - public var message: NDEFMessage -} diff --git a/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift b/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift deleted file mode 100644 index 9426e951..00000000 --- a/Sources/DOMKit/WebIDL/NDEFReadingEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFReadingEventInit: BridgedDictionary { - public convenience init(serialNumber: String?, message: NDEFMessageInit) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.serialNumber] = serialNumber.jsValue - object[Strings.message] = message.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _serialNumber = ReadWriteAttribute(jsObject: object, name: Strings.serialNumber) - _message = ReadWriteAttribute(jsObject: object, name: Strings.message) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var serialNumber: String? - - @ReadWriteAttribute - public var message: NDEFMessageInit -} diff --git a/Sources/DOMKit/WebIDL/NDEFRecord.swift b/Sources/DOMKit/WebIDL/NDEFRecord.swift deleted file mode 100644 index f5a38372..00000000 --- a/Sources/DOMKit/WebIDL/NDEFRecord.swift +++ /dev/null @@ -1,47 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFRecord: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NDEFRecord].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _recordType = ReadonlyAttribute(jsObject: jsObject, name: Strings.recordType) - _mediaType = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaType) - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - _encoding = ReadonlyAttribute(jsObject: jsObject, name: Strings.encoding) - _lang = ReadonlyAttribute(jsObject: jsObject, name: Strings.lang) - self.jsObject = jsObject - } - - @inlinable public convenience init(recordInit: NDEFRecordInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [recordInit.jsValue])) - } - - @ReadonlyAttribute - public var recordType: String - - @ReadonlyAttribute - public var mediaType: String? - - @ReadonlyAttribute - public var id: String? - - @ReadonlyAttribute - public var data: DataView? - - @ReadonlyAttribute - public var encoding: String? - - @ReadonlyAttribute - public var lang: String? - - @inlinable public func toRecords() -> [NDEFRecord]? { - let this = jsObject - return this[Strings.toRecords].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/NDEFRecordInit.swift b/Sources/DOMKit/WebIDL/NDEFRecordInit.swift deleted file mode 100644 index e264bc6a..00000000 --- a/Sources/DOMKit/WebIDL/NDEFRecordInit.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFRecordInit: BridgedDictionary { - public convenience init(recordType: String, mediaType: String, id: String, encoding: String, lang: String, data: JSValue) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.recordType] = recordType.jsValue - object[Strings.mediaType] = mediaType.jsValue - object[Strings.id] = id.jsValue - object[Strings.encoding] = encoding.jsValue - object[Strings.lang] = lang.jsValue - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _recordType = ReadWriteAttribute(jsObject: object, name: Strings.recordType) - _mediaType = ReadWriteAttribute(jsObject: object, name: Strings.mediaType) - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _encoding = ReadWriteAttribute(jsObject: object, name: Strings.encoding) - _lang = ReadWriteAttribute(jsObject: object, name: Strings.lang) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var recordType: String - - @ReadWriteAttribute - public var mediaType: String - - @ReadWriteAttribute - public var id: String - - @ReadWriteAttribute - public var encoding: String - - @ReadWriteAttribute - public var lang: String - - @ReadWriteAttribute - public var data: JSValue -} diff --git a/Sources/DOMKit/WebIDL/NDEFScanOptions.swift b/Sources/DOMKit/WebIDL/NDEFScanOptions.swift deleted file mode 100644 index 89d6ae05..00000000 --- a/Sources/DOMKit/WebIDL/NDEFScanOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFScanOptions: BridgedDictionary { - public convenience init(signal: AbortSignal) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var signal: AbortSignal -} diff --git a/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift b/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift deleted file mode 100644 index cf54fab5..00000000 --- a/Sources/DOMKit/WebIDL/NDEFWriteOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NDEFWriteOptions: BridgedDictionary { - public convenience init(overwrite: Bool, signal: AbortSignal?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.overwrite] = overwrite.jsValue - object[Strings.signal] = signal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _overwrite = ReadWriteAttribute(jsObject: object, name: Strings.overwrite) - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var overwrite: Bool - - @ReadWriteAttribute - public var signal: AbortSignal? -} diff --git a/Sources/DOMKit/WebIDL/NamedFlow.swift b/Sources/DOMKit/WebIDL/NamedFlow.swift deleted file mode 100644 index 7de33b83..00000000 --- a/Sources/DOMKit/WebIDL/NamedFlow.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NamedFlow: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NamedFlow].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _overset = ReadonlyAttribute(jsObject: jsObject, name: Strings.overset) - _firstEmptyRegionIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.firstEmptyRegionIndex) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var overset: Bool - - @inlinable public func getRegions() -> [Element] { - let this = jsObject - return this[Strings.getRegions].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var firstEmptyRegionIndex: Int16 - - @inlinable public func getContent() -> [Node] { - let this = jsObject - return this[Strings.getContent].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getRegionsByContent(node: Node) -> [Element] { - let this = jsObject - return this[Strings.getRegionsByContent].function!(this: this, arguments: [node.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/NamedFlowMap.swift b/Sources/DOMKit/WebIDL/NamedFlowMap.swift deleted file mode 100644 index 0009ffd9..00000000 --- a/Sources/DOMKit/WebIDL/NamedFlowMap.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NamedFlowMap: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NamedFlowMap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/NavigateEvent.swift b/Sources/DOMKit/WebIDL/NavigateEvent.swift deleted file mode 100644 index 5f386dbb..00000000 --- a/Sources/DOMKit/WebIDL/NavigateEvent.swift +++ /dev/null @@ -1,53 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigateEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NavigateEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _navigationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationType) - _destination = ReadonlyAttribute(jsObject: jsObject, name: Strings.destination) - _canTransition = ReadonlyAttribute(jsObject: jsObject, name: Strings.canTransition) - _userInitiated = ReadonlyAttribute(jsObject: jsObject, name: Strings.userInitiated) - _hashChange = ReadonlyAttribute(jsObject: jsObject, name: Strings.hashChange) - _signal = ReadonlyAttribute(jsObject: jsObject, name: Strings.signal) - _formData = ReadonlyAttribute(jsObject: jsObject, name: Strings.formData) - _info = ReadonlyAttribute(jsObject: jsObject, name: Strings.info) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInit: NavigateEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInit.jsValue])) - } - - @ReadonlyAttribute - public var navigationType: NavigationNavigationType - - @ReadonlyAttribute - public var destination: NavigationDestination - - @ReadonlyAttribute - public var canTransition: Bool - - @ReadonlyAttribute - public var userInitiated: Bool - - @ReadonlyAttribute - public var hashChange: Bool - - @ReadonlyAttribute - public var signal: AbortSignal - - @ReadonlyAttribute - public var formData: FormData? - - @ReadonlyAttribute - public var info: JSValue - - @inlinable public func transitionWhile(newNavigationAction: JSPromise) { - let this = jsObject - _ = this[Strings.transitionWhile].function!(this: this, arguments: [newNavigationAction.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/NavigateEventInit.swift b/Sources/DOMKit/WebIDL/NavigateEventInit.swift deleted file mode 100644 index 8b70a640..00000000 --- a/Sources/DOMKit/WebIDL/NavigateEventInit.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigateEventInit: BridgedDictionary { - public convenience init(navigationType: NavigationNavigationType, destination: NavigationDestination, canTransition: Bool, userInitiated: Bool, hashChange: Bool, signal: AbortSignal, formData: FormData?, info: JSValue) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.navigationType] = navigationType.jsValue - object[Strings.destination] = destination.jsValue - object[Strings.canTransition] = canTransition.jsValue - object[Strings.userInitiated] = userInitiated.jsValue - object[Strings.hashChange] = hashChange.jsValue - object[Strings.signal] = signal.jsValue - object[Strings.formData] = formData.jsValue - object[Strings.info] = info.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _navigationType = ReadWriteAttribute(jsObject: object, name: Strings.navigationType) - _destination = ReadWriteAttribute(jsObject: object, name: Strings.destination) - _canTransition = ReadWriteAttribute(jsObject: object, name: Strings.canTransition) - _userInitiated = ReadWriteAttribute(jsObject: object, name: Strings.userInitiated) - _hashChange = ReadWriteAttribute(jsObject: object, name: Strings.hashChange) - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - _formData = ReadWriteAttribute(jsObject: object, name: Strings.formData) - _info = ReadWriteAttribute(jsObject: object, name: Strings.info) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var navigationType: NavigationNavigationType - - @ReadWriteAttribute - public var destination: NavigationDestination - - @ReadWriteAttribute - public var canTransition: Bool - - @ReadWriteAttribute - public var userInitiated: Bool - - @ReadWriteAttribute - public var hashChange: Bool - - @ReadWriteAttribute - public var signal: AbortSignal - - @ReadWriteAttribute - public var formData: FormData? - - @ReadWriteAttribute - public var info: JSValue -} diff --git a/Sources/DOMKit/WebIDL/Navigation.swift b/Sources/DOMKit/WebIDL/Navigation.swift deleted file mode 100644 index 1460de00..00000000 --- a/Sources/DOMKit/WebIDL/Navigation.swift +++ /dev/null @@ -1,79 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Navigation: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Navigation].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _currentEntry = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentEntry) - _transition = ReadonlyAttribute(jsObject: jsObject, name: Strings.transition) - _canGoBack = ReadonlyAttribute(jsObject: jsObject, name: Strings.canGoBack) - _canGoForward = ReadonlyAttribute(jsObject: jsObject, name: Strings.canGoForward) - _onnavigate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigate) - _onnavigatesuccess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigatesuccess) - _onnavigateerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigateerror) - _oncurrententrychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncurrententrychange) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func entries() -> [NavigationHistoryEntry] { - let this = jsObject - return this[Strings.entries].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var currentEntry: NavigationHistoryEntry? - - @inlinable public func updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions) { - let this = jsObject - _ = this[Strings.updateCurrentEntry].function!(this: this, arguments: [options.jsValue]) - } - - @ReadonlyAttribute - public var transition: NavigationTransition? - - @ReadonlyAttribute - public var canGoBack: Bool - - @ReadonlyAttribute - public var canGoForward: Bool - - @inlinable public func navigate(url: String, options: NavigationNavigateOptions? = nil) -> NavigationResult { - let this = jsObject - return this[Strings.navigate].function!(this: this, arguments: [url.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func reload(options: NavigationReloadOptions? = nil) -> NavigationResult { - let this = jsObject - return this[Strings.reload].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func traverseTo(key: String, options: NavigationOptions? = nil) -> NavigationResult { - let this = jsObject - return this[Strings.traverseTo].function!(this: this, arguments: [key.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func back(options: NavigationOptions? = nil) -> NavigationResult { - let this = jsObject - return this[Strings.back].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func forward(options: NavigationOptions? = nil) -> NavigationResult { - let this = jsObject - return this[Strings.forward].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @ClosureAttribute1Optional - public var onnavigate: EventHandler - - @ClosureAttribute1Optional - public var onnavigatesuccess: EventHandler - - @ClosureAttribute1Optional - public var onnavigateerror: EventHandler - - @ClosureAttribute1Optional - public var oncurrententrychange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift deleted file mode 100644 index 3ff885ac..00000000 --- a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationCurrentEntryChangeEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NavigationCurrentEntryChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _navigationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationType) - _from = ReadonlyAttribute(jsObject: jsObject, name: Strings.from) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInit: NavigationCurrentEntryChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInit.jsValue])) - } - - @ReadonlyAttribute - public var navigationType: NavigationNavigationType? - - @ReadonlyAttribute - public var from: NavigationHistoryEntry -} diff --git a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift b/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift deleted file mode 100644 index 9533183f..00000000 --- a/Sources/DOMKit/WebIDL/NavigationCurrentEntryChangeEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationCurrentEntryChangeEventInit: BridgedDictionary { - public convenience init(navigationType: NavigationNavigationType?, destination: NavigationHistoryEntry) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.navigationType] = navigationType.jsValue - object[Strings.destination] = destination.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _navigationType = ReadWriteAttribute(jsObject: object, name: Strings.navigationType) - _destination = ReadWriteAttribute(jsObject: object, name: Strings.destination) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var navigationType: NavigationNavigationType? - - @ReadWriteAttribute - public var destination: NavigationHistoryEntry -} diff --git a/Sources/DOMKit/WebIDL/NavigationDestination.swift b/Sources/DOMKit/WebIDL/NavigationDestination.swift deleted file mode 100644 index 3d459290..00000000 --- a/Sources/DOMKit/WebIDL/NavigationDestination.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationDestination: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NavigationDestination].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) - _sameDocument = ReadonlyAttribute(jsObject: jsObject, name: Strings.sameDocument) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var url: String - - @ReadonlyAttribute - public var key: String? - - @ReadonlyAttribute - public var id: String? - - @ReadonlyAttribute - public var index: Int64 - - @ReadonlyAttribute - public var sameDocument: Bool - - @inlinable public func getState() -> JSValue { - let this = jsObject - return this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/NavigationEvent.swift b/Sources/DOMKit/WebIDL/NavigationEvent.swift deleted file mode 100644 index 2b3cc3e7..00000000 --- a/Sources/DOMKit/WebIDL/NavigationEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationEvent: UIEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NavigationEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _dir = ReadonlyAttribute(jsObject: jsObject, name: Strings.dir) - _relatedTarget = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedTarget) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: NavigationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var dir: SpatialNavigationDirection - - @ReadonlyAttribute - public var relatedTarget: EventTarget? -} diff --git a/Sources/DOMKit/WebIDL/NavigationEventInit.swift b/Sources/DOMKit/WebIDL/NavigationEventInit.swift deleted file mode 100644 index 484dc266..00000000 --- a/Sources/DOMKit/WebIDL/NavigationEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationEventInit: BridgedDictionary { - public convenience init(dir: SpatialNavigationDirection, relatedTarget: EventTarget?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dir] = dir.jsValue - object[Strings.relatedTarget] = relatedTarget.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _dir = ReadWriteAttribute(jsObject: object, name: Strings.dir) - _relatedTarget = ReadWriteAttribute(jsObject: object, name: Strings.relatedTarget) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var dir: SpatialNavigationDirection - - @ReadWriteAttribute - public var relatedTarget: EventTarget? -} diff --git a/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift b/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift deleted file mode 100644 index c20cac6c..00000000 --- a/Sources/DOMKit/WebIDL/NavigationHistoryEntry.swift +++ /dev/null @@ -1,53 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationHistoryEntry: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NavigationHistoryEntry].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - _key = ReadonlyAttribute(jsObject: jsObject, name: Strings.key) - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) - _sameDocument = ReadonlyAttribute(jsObject: jsObject, name: Strings.sameDocument) - _onnavigateto = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigateto) - _onnavigatefrom = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnavigatefrom) - _onfinish = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onfinish) - _ondispose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondispose) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var url: String? - - @ReadonlyAttribute - public var key: String - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var index: Int64 - - @ReadonlyAttribute - public var sameDocument: Bool - - @inlinable public func getState() -> JSValue { - let this = jsObject - return this[Strings.getState].function!(this: this, arguments: []).fromJSValue()! - } - - @ClosureAttribute1Optional - public var onnavigateto: EventHandler - - @ClosureAttribute1Optional - public var onnavigatefrom: EventHandler - - @ClosureAttribute1Optional - public var onfinish: EventHandler - - @ClosureAttribute1Optional - public var ondispose: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift b/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift deleted file mode 100644 index dcaafb53..00000000 --- a/Sources/DOMKit/WebIDL/NavigationNavigateOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationNavigateOptions: BridgedDictionary { - public convenience init(state: JSValue, replace: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.state] = state.jsValue - object[Strings.replace] = replace.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _state = ReadWriteAttribute(jsObject: object, name: Strings.state) - _replace = ReadWriteAttribute(jsObject: object, name: Strings.replace) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var state: JSValue - - @ReadWriteAttribute - public var replace: Bool -} diff --git a/Sources/DOMKit/WebIDL/NavigationNavigationType.swift b/Sources/DOMKit/WebIDL/NavigationNavigationType.swift deleted file mode 100644 index 47883ecb..00000000 --- a/Sources/DOMKit/WebIDL/NavigationNavigationType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum NavigationNavigationType: JSString, JSValueCompatible { - case reload = "reload" - case push = "push" - case replace = "replace" - case traverse = "traverse" - - @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/NavigationOptions.swift b/Sources/DOMKit/WebIDL/NavigationOptions.swift deleted file mode 100644 index f3284959..00000000 --- a/Sources/DOMKit/WebIDL/NavigationOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationOptions: BridgedDictionary { - public convenience init(info: JSValue) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.info] = info.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _info = ReadWriteAttribute(jsObject: object, name: Strings.info) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var info: JSValue -} diff --git a/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift b/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift deleted file mode 100644 index 49812a86..00000000 --- a/Sources/DOMKit/WebIDL/NavigationReloadOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationReloadOptions: BridgedDictionary { - public convenience init(state: JSValue) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.state] = state.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _state = ReadWriteAttribute(jsObject: object, name: Strings.state) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var state: JSValue -} diff --git a/Sources/DOMKit/WebIDL/NavigationResult.swift b/Sources/DOMKit/WebIDL/NavigationResult.swift deleted file mode 100644 index e9dae1e3..00000000 --- a/Sources/DOMKit/WebIDL/NavigationResult.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationResult: BridgedDictionary { - public convenience init(committed: JSPromise, finished: JSPromise) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.committed] = committed.jsValue - object[Strings.finished] = finished.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _committed = ReadWriteAttribute(jsObject: object, name: Strings.committed) - _finished = ReadWriteAttribute(jsObject: object, name: Strings.finished) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var committed: JSPromise - - @ReadWriteAttribute - public var finished: JSPromise -} diff --git a/Sources/DOMKit/WebIDL/NavigationTimingType.swift b/Sources/DOMKit/WebIDL/NavigationTimingType.swift deleted file mode 100644 index 8e8c7c17..00000000 --- a/Sources/DOMKit/WebIDL/NavigationTimingType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum NavigationTimingType: JSString, JSValueCompatible { - case navigate = "navigate" - case reload = "reload" - case backForward = "back_forward" - case prerender = "prerender" - - @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/NavigationTransition.swift b/Sources/DOMKit/WebIDL/NavigationTransition.swift deleted file mode 100644 index 1cea2a85..00000000 --- a/Sources/DOMKit/WebIDL/NavigationTransition.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationTransition: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NavigationTransition].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _navigationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationType) - _from = ReadonlyAttribute(jsObject: jsObject, name: Strings.from) - _finished = ReadonlyAttribute(jsObject: jsObject, name: Strings.finished) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var navigationType: NavigationNavigationType - - @ReadonlyAttribute - public var from: NavigationHistoryEntry - - @ReadonlyAttribute - public var finished: JSPromise - - @inlinable public func rollback(options: NavigationOptions? = nil) -> NavigationResult { - let this = jsObject - return this[Strings.rollback].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift b/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift deleted file mode 100644 index 158ead3f..00000000 --- a/Sources/DOMKit/WebIDL/NavigationUpdateCurrentEntryOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigationUpdateCurrentEntryOptions: BridgedDictionary { - public convenience init(state: JSValue) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.state] = state.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _state = ReadWriteAttribute(jsObject: object, name: Strings.state) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var state: JSValue -} diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index 3850e583..0928de76 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -3,225 +3,22 @@ import JavaScriptEventLoop import JavaScriptKit -public class Navigator: JSBridgedClass, NavigatorBadge, NavigatorDeviceMemory, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware, NavigatorFonts, NavigatorNetworkInformation, NavigatorStorage, NavigatorUA, NavigatorLocks, NavigatorAutomationInformation, NavigatorGPU, NavigatorML { +public class Navigator: JSBridgedClass, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware { @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Navigator].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _clipboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipboard) - _contacts = ReadonlyAttribute(jsObject: jsObject, name: Strings.contacts) - _credentials = ReadonlyAttribute(jsObject: jsObject, name: Strings.credentials) - _devicePosture = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePosture) - _geolocation = ReadonlyAttribute(jsObject: jsObject, name: Strings.geolocation) - _ink = ReadonlyAttribute(jsObject: jsObject, name: Strings.ink) - _scheduling = ReadonlyAttribute(jsObject: jsObject, name: Strings.scheduling) - _keyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyboard) - _mediaCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaCapabilities) _mediaDevices = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaDevices) - _mediaSession = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaSession) - _permissions = ReadonlyAttribute(jsObject: jsObject, name: Strings.permissions) - _maxTouchPoints = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxTouchPoints) - _presentation = ReadonlyAttribute(jsObject: jsObject, name: Strings.presentation) - _wakeLock = ReadonlyAttribute(jsObject: jsObject, name: Strings.wakeLock) - _serial = ReadonlyAttribute(jsObject: jsObject, name: Strings.serial) _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) - _virtualKeyboard = ReadonlyAttribute(jsObject: jsObject, name: Strings.virtualKeyboard) - _bluetooth = ReadonlyAttribute(jsObject: jsObject, name: Strings.bluetooth) - _hid = ReadonlyAttribute(jsObject: jsObject, name: Strings.hid) - _usb = ReadonlyAttribute(jsObject: jsObject, name: Strings.usb) - _xr = ReadonlyAttribute(jsObject: jsObject, name: Strings.xr) - _windowControlsOverlay = ReadonlyAttribute(jsObject: jsObject, name: Strings.windowControlsOverlay) self.jsObject = jsObject } - @inlinable public func getAutoplayPolicy(type: AutoplayPolicyMediaType) -> AutoplayPolicy { - let this = jsObject - return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } - - @inlinable public func getAutoplayPolicy(element: HTMLMediaElement) -> AutoplayPolicy { - let this = jsObject - return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [element.jsValue]).fromJSValue()! - } - - @inlinable public func getAutoplayPolicy(context: AudioContext) -> AutoplayPolicy { - let this = jsObject - return this[Strings.getAutoplayPolicy].function!(this: this, arguments: [context.jsValue]).fromJSValue()! - } - - @inlinable public func setClientBadge(contents: UInt64? = nil) -> JSPromise { - let this = jsObject - return this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func setClientBadge(contents: UInt64? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.setClientBadge].function!(this: this, arguments: [contents?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func clearClientBadge() -> JSPromise { - let this = jsObject - return this[Strings.clearClientBadge].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func clearClientBadge() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.clearClientBadge].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func getBattery() -> JSPromise { - let this = jsObject - return this[Strings.getBattery].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getBattery() async throws -> BatteryManager { - let this = jsObject - let _promise: JSPromise = this[Strings.getBattery].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func sendBeacon(url: String, data: BodyInit? = nil) -> Bool { - let this = jsObject - return this[Strings.sendBeacon].function!(this: this, arguments: [url.jsValue, data?.jsValue ?? .undefined]).fromJSValue()! - } - - @ReadonlyAttribute - public var clipboard: Clipboard - - @ReadonlyAttribute - public var contacts: ContactsManager - - @ReadonlyAttribute - public var credentials: CredentialsContainer - - @ReadonlyAttribute - public var devicePosture: DevicePosture - - @inlinable public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) -> JSPromise { - let this = jsObject - return this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue, supportedConfigurations.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: [MediaKeySystemConfiguration]) async throws -> MediaKeySystemAccess { - let this = jsObject - let _promise: JSPromise = this[Strings.requestMediaKeySystemAccess].function!(this: this, arguments: [keySystem.jsValue, supportedConfigurations.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getGamepads() -> [Gamepad?] { - let this = jsObject - return this[Strings.getGamepads].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var geolocation: Geolocation - - @inlinable public func getInstalledRelatedApps() -> JSPromise { - let this = jsObject - return this[Strings.getInstalledRelatedApps].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getInstalledRelatedApps() async throws -> [RelatedApplication] { - let this = jsObject - let _promise: JSPromise = this[Strings.getInstalledRelatedApps].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var ink: Ink - - @ReadonlyAttribute - public var scheduling: Scheduling - - @ReadonlyAttribute - public var keyboard: Keyboard - - @ReadonlyAttribute - public var mediaCapabilities: MediaCapabilities - @ReadonlyAttribute public var mediaDevices: MediaDevices // XXX: member 'getUserMedia' is ignored - @ReadonlyAttribute - public var mediaSession: MediaSession - - @ReadonlyAttribute - public var permissions: Permissions - - @ReadonlyAttribute - public var maxTouchPoints: Int32 - - @ReadonlyAttribute - public var presentation: Presentation - - @ReadonlyAttribute - public var wakeLock: WakeLock - - @ReadonlyAttribute - public var serial: Serial - @ReadonlyAttribute public var serviceWorker: ServiceWorkerContainer - - @inlinable public func vibrate(pattern: VibratePattern) -> Bool { - let this = jsObject - return this[Strings.vibrate].function!(this: this, arguments: [pattern.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var virtualKeyboard: VirtualKeyboard - - @ReadonlyAttribute - public var bluetooth: Bluetooth - - @inlinable public func share(data: ShareData? = nil) -> JSPromise { - let this = jsObject - return this[Strings.share].function!(this: this, arguments: [data?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func share(data: ShareData? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.share].function!(this: this, arguments: [data?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func canShare(data: ShareData? = nil) -> Bool { - let this = jsObject - return this[Strings.canShare].function!(this: this, arguments: [data?.jsValue ?? .undefined]).fromJSValue()! - } - - @ReadonlyAttribute - public var hid: HID - - @inlinable public func requestMIDIAccess(options: MIDIOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestMIDIAccess(options: MIDIOptions? = nil) async throws -> MIDIAccess { - let this = jsObject - let _promise: JSPromise = this[Strings.requestMIDIAccess].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var usb: USB - - @ReadonlyAttribute - public var xr: XRSystem - - @ReadonlyAttribute - public var windowControlsOverlay: WindowControlsOverlay } diff --git a/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift b/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift deleted file mode 100644 index 02b0d52f..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorAutomationInformation.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorAutomationInformation: JSBridgedClass {} -public extension NavigatorAutomationInformation { - @inlinable var webdriver: Bool { ReadonlyAttribute[Strings.webdriver, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorBadge.swift b/Sources/DOMKit/WebIDL/NavigatorBadge.swift deleted file mode 100644 index a4caa6d8..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorBadge.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorBadge: JSBridgedClass {} -public extension NavigatorBadge { - @inlinable func setAppBadge(contents: UInt64? = nil) -> JSPromise { - let this = jsObject - return this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable func setAppBadge(contents: UInt64? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.setAppBadge].function!(this: this, arguments: [contents?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable func clearAppBadge() -> JSPromise { - let this = jsObject - return this[Strings.clearAppBadge].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable func clearAppBadge() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.clearAppBadge].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift b/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift deleted file mode 100644 index c3184b80..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorDeviceMemory.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorDeviceMemory: JSBridgedClass {} -public extension NavigatorDeviceMemory { - @inlinable var deviceMemory: Double { ReadonlyAttribute[Strings.deviceMemory, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorFonts.swift b/Sources/DOMKit/WebIDL/NavigatorFonts.swift deleted file mode 100644 index 471fc03b..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorFonts.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorFonts: JSBridgedClass {} -public extension NavigatorFonts { - @inlinable var fonts: FontManager { ReadonlyAttribute[Strings.fonts, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorGPU.swift b/Sources/DOMKit/WebIDL/NavigatorGPU.swift deleted file mode 100644 index 287f8f5a..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorGPU.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorGPU: JSBridgedClass {} -public extension NavigatorGPU { - @inlinable var gpu: GPU { ReadonlyAttribute[Strings.gpu, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorLocks.swift b/Sources/DOMKit/WebIDL/NavigatorLocks.swift deleted file mode 100644 index c5f33ae4..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorLocks.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorLocks: JSBridgedClass {} -public extension NavigatorLocks { - @inlinable var locks: LockManager { ReadonlyAttribute[Strings.locks, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorML.swift b/Sources/DOMKit/WebIDL/NavigatorML.swift deleted file mode 100644 index 51bfc736..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorML.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorML: JSBridgedClass {} -public extension NavigatorML { - @inlinable var ml: ML { ReadonlyAttribute[Strings.ml, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift b/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift deleted file mode 100644 index 95115716..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorNetworkInformation.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorNetworkInformation: JSBridgedClass {} -public extension NavigatorNetworkInformation { - @inlinable var connection: NetworkInformation { ReadonlyAttribute[Strings.connection, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorStorage.swift b/Sources/DOMKit/WebIDL/NavigatorStorage.swift deleted file mode 100644 index cdee04ef..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorStorage.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorStorage: JSBridgedClass {} -public extension NavigatorStorage { - @inlinable var storage: StorageManager { ReadonlyAttribute[Strings.storage, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorUA.swift b/Sources/DOMKit/WebIDL/NavigatorUA.swift deleted file mode 100644 index d28ce9e6..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorUA.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NavigatorUA: JSBridgedClass {} -public extension NavigatorUA { - @inlinable var userAgentData: NavigatorUAData { ReadonlyAttribute[Strings.userAgentData, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift b/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift deleted file mode 100644 index 969cf097..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorUABrandVersion.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigatorUABrandVersion: BridgedDictionary { - public convenience init(brand: String, version: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.brand] = brand.jsValue - object[Strings.version] = version.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _brand = ReadWriteAttribute(jsObject: object, name: Strings.brand) - _version = ReadWriteAttribute(jsObject: object, name: Strings.version) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var brand: String - - @ReadWriteAttribute - public var version: String -} diff --git a/Sources/DOMKit/WebIDL/NavigatorUAData.swift b/Sources/DOMKit/WebIDL/NavigatorUAData.swift deleted file mode 100644 index c797d7b1..00000000 --- a/Sources/DOMKit/WebIDL/NavigatorUAData.swift +++ /dev/null @@ -1,43 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NavigatorUAData: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.NavigatorUAData].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _brands = ReadonlyAttribute(jsObject: jsObject, name: Strings.brands) - _mobile = ReadonlyAttribute(jsObject: jsObject, name: Strings.mobile) - _platform = ReadonlyAttribute(jsObject: jsObject, name: Strings.platform) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var brands: [NavigatorUABrandVersion] - - @ReadonlyAttribute - public var mobile: Bool - - @ReadonlyAttribute - public var platform: String - - @inlinable public func getHighEntropyValues(hints: [String]) -> JSPromise { - let this = jsObject - return this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getHighEntropyValues(hints: [String]) async throws -> UADataValues { - let this = jsObject - let _promise: JSPromise = this[Strings.getHighEntropyValues].function!(this: this, arguments: [hints.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func toJSON() -> UALowEntropyJSON { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/NetworkInformation.swift b/Sources/DOMKit/WebIDL/NetworkInformation.swift deleted file mode 100644 index 7f91c27d..00000000 --- a/Sources/DOMKit/WebIDL/NetworkInformation.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NetworkInformation: EventTarget, NetworkInformationSaveData { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.NetworkInformation].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _effectiveType = ReadonlyAttribute(jsObject: jsObject, name: Strings.effectiveType) - _downlinkMax = ReadonlyAttribute(jsObject: jsObject, name: Strings.downlinkMax) - _downlink = ReadonlyAttribute(jsObject: jsObject, name: Strings.downlink) - _rtt = ReadonlyAttribute(jsObject: jsObject, name: Strings.rtt) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var type: ConnectionType - - @ReadonlyAttribute - public var effectiveType: EffectiveConnectionType - - @ReadonlyAttribute - public var downlinkMax: Megabit - - @ReadonlyAttribute - public var downlink: Megabit - - @ReadonlyAttribute - public var rtt: Millisecond - - @ClosureAttribute1Optional - public var onchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift b/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift deleted file mode 100644 index aa503b98..00000000 --- a/Sources/DOMKit/WebIDL/NetworkInformationSaveData.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol NetworkInformationSaveData: JSBridgedClass {} -public extension NetworkInformationSaveData { - @inlinable var saveData: Bool { ReadonlyAttribute[Strings.saveData, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/Notification.swift b/Sources/DOMKit/WebIDL/Notification.swift deleted file mode 100644 index 2cea0cb1..00000000 --- a/Sources/DOMKit/WebIDL/Notification.swift +++ /dev/null @@ -1,109 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Notification: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Notification].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _permission = ReadonlyAttribute(jsObject: jsObject, name: Strings.permission) - _maxActions = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxActions) - _onclick = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclick) - _onshow = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onshow) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) - _title = ReadonlyAttribute(jsObject: jsObject, name: Strings.title) - _dir = ReadonlyAttribute(jsObject: jsObject, name: Strings.dir) - _lang = ReadonlyAttribute(jsObject: jsObject, name: Strings.lang) - _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) - _tag = ReadonlyAttribute(jsObject: jsObject, name: Strings.tag) - _image = ReadonlyAttribute(jsObject: jsObject, name: Strings.image) - _icon = ReadonlyAttribute(jsObject: jsObject, name: Strings.icon) - _badge = ReadonlyAttribute(jsObject: jsObject, name: Strings.badge) - _vibrate = ReadonlyAttribute(jsObject: jsObject, name: Strings.vibrate) - _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - _renotify = ReadonlyAttribute(jsObject: jsObject, name: Strings.renotify) - _silent = ReadonlyAttribute(jsObject: jsObject, name: Strings.silent) - _requireInteraction = ReadonlyAttribute(jsObject: jsObject, name: Strings.requireInteraction) - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - _actions = ReadonlyAttribute(jsObject: jsObject, name: Strings.actions) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(title: String, options: NotificationOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [title.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var permission: NotificationPermission - - // XXX: member 'requestPermission' is ignored - - // XXX: member 'requestPermission' is ignored - - @ReadonlyAttribute - public var maxActions: UInt32 - - @ClosureAttribute1Optional - public var onclick: EventHandler - - @ClosureAttribute1Optional - public var onshow: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler - - @ClosureAttribute1Optional - public var onclose: EventHandler - - @ReadonlyAttribute - public var title: String - - @ReadonlyAttribute - public var dir: NotificationDirection - - @ReadonlyAttribute - public var lang: String - - @ReadonlyAttribute - public var body: String - - @ReadonlyAttribute - public var tag: String - - @ReadonlyAttribute - public var image: String - - @ReadonlyAttribute - public var icon: String - - @ReadonlyAttribute - public var badge: String - - @ReadonlyAttribute - public var vibrate: [UInt32] - - @ReadonlyAttribute - public var timestamp: EpochTimeStamp - - @ReadonlyAttribute - public var renotify: Bool - - @ReadonlyAttribute - public var silent: Bool - - @ReadonlyAttribute - public var requireInteraction: Bool - - @ReadonlyAttribute - public var data: JSValue - - @ReadonlyAttribute - public var actions: [NotificationAction] - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/NotificationAction.swift b/Sources/DOMKit/WebIDL/NotificationAction.swift deleted file mode 100644 index 8fd8bb16..00000000 --- a/Sources/DOMKit/WebIDL/NotificationAction.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NotificationAction: BridgedDictionary { - public convenience init(action: String, title: String, icon: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.action] = action.jsValue - object[Strings.title] = title.jsValue - object[Strings.icon] = icon.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _action = ReadWriteAttribute(jsObject: object, name: Strings.action) - _title = ReadWriteAttribute(jsObject: object, name: Strings.title) - _icon = ReadWriteAttribute(jsObject: object, name: Strings.icon) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var action: String - - @ReadWriteAttribute - public var title: String - - @ReadWriteAttribute - public var icon: String -} diff --git a/Sources/DOMKit/WebIDL/NotificationDirection.swift b/Sources/DOMKit/WebIDL/NotificationDirection.swift deleted file mode 100644 index 87c1928e..00000000 --- a/Sources/DOMKit/WebIDL/NotificationDirection.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum NotificationDirection: JSString, JSValueCompatible { - case auto = "auto" - case ltr = "ltr" - case rtl = "rtl" - - @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/NotificationEventInit.swift b/Sources/DOMKit/WebIDL/NotificationEventInit.swift deleted file mode 100644 index 9ea4ff62..00000000 --- a/Sources/DOMKit/WebIDL/NotificationEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NotificationEventInit: BridgedDictionary { - public convenience init(notification: Notification, action: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.notification] = notification.jsValue - object[Strings.action] = action.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _notification = ReadWriteAttribute(jsObject: object, name: Strings.notification) - _action = ReadWriteAttribute(jsObject: object, name: Strings.action) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var notification: Notification - - @ReadWriteAttribute - public var action: String -} diff --git a/Sources/DOMKit/WebIDL/NotificationOptions.swift b/Sources/DOMKit/WebIDL/NotificationOptions.swift deleted file mode 100644 index f13fa7c5..00000000 --- a/Sources/DOMKit/WebIDL/NotificationOptions.swift +++ /dev/null @@ -1,85 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class NotificationOptions: BridgedDictionary { - public convenience init(dir: NotificationDirection, lang: String, body: String, tag: String, image: String, icon: String, badge: String, vibrate: VibratePattern, timestamp: EpochTimeStamp, renotify: Bool, silent: Bool, requireInteraction: Bool, data: JSValue, actions: [NotificationAction]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dir] = dir.jsValue - object[Strings.lang] = lang.jsValue - object[Strings.body] = body.jsValue - object[Strings.tag] = tag.jsValue - object[Strings.image] = image.jsValue - object[Strings.icon] = icon.jsValue - object[Strings.badge] = badge.jsValue - object[Strings.vibrate] = vibrate.jsValue - object[Strings.timestamp] = timestamp.jsValue - object[Strings.renotify] = renotify.jsValue - object[Strings.silent] = silent.jsValue - object[Strings.requireInteraction] = requireInteraction.jsValue - object[Strings.data] = data.jsValue - object[Strings.actions] = actions.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _dir = ReadWriteAttribute(jsObject: object, name: Strings.dir) - _lang = ReadWriteAttribute(jsObject: object, name: Strings.lang) - _body = ReadWriteAttribute(jsObject: object, name: Strings.body) - _tag = ReadWriteAttribute(jsObject: object, name: Strings.tag) - _image = ReadWriteAttribute(jsObject: object, name: Strings.image) - _icon = ReadWriteAttribute(jsObject: object, name: Strings.icon) - _badge = ReadWriteAttribute(jsObject: object, name: Strings.badge) - _vibrate = ReadWriteAttribute(jsObject: object, name: Strings.vibrate) - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _renotify = ReadWriteAttribute(jsObject: object, name: Strings.renotify) - _silent = ReadWriteAttribute(jsObject: object, name: Strings.silent) - _requireInteraction = ReadWriteAttribute(jsObject: object, name: Strings.requireInteraction) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - _actions = ReadWriteAttribute(jsObject: object, name: Strings.actions) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var dir: NotificationDirection - - @ReadWriteAttribute - public var lang: String - - @ReadWriteAttribute - public var body: String - - @ReadWriteAttribute - public var tag: String - - @ReadWriteAttribute - public var image: String - - @ReadWriteAttribute - public var icon: String - - @ReadWriteAttribute - public var badge: String - - @ReadWriteAttribute - public var vibrate: VibratePattern - - @ReadWriteAttribute - public var timestamp: EpochTimeStamp - - @ReadWriteAttribute - public var renotify: Bool - - @ReadWriteAttribute - public var silent: Bool - - @ReadWriteAttribute - public var requireInteraction: Bool - - @ReadWriteAttribute - public var data: JSValue - - @ReadWriteAttribute - public var actions: [NotificationAction] -} diff --git a/Sources/DOMKit/WebIDL/NotificationPermission.swift b/Sources/DOMKit/WebIDL/NotificationPermission.swift deleted file mode 100644 index a60fb475..00000000 --- a/Sources/DOMKit/WebIDL/NotificationPermission.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum NotificationPermission: JSString, JSValueCompatible { - case `default` = "default" - case denied = "denied" - case granted = "granted" - - @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/OES_draw_buffers_indexed.swift b/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift deleted file mode 100644 index 6a5e1371..00000000 --- a/Sources/DOMKit/WebIDL/OES_draw_buffers_indexed.swift +++ /dev/null @@ -1,49 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OES_draw_buffers_indexed: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_draw_buffers_indexed].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func enableiOES(target: GLenum, index: GLuint) { - let this = jsObject - _ = this[Strings.enableiOES].function!(this: this, arguments: [target.jsValue, index.jsValue]) - } - - @inlinable public func disableiOES(target: GLenum, index: GLuint) { - let this = jsObject - _ = this[Strings.disableiOES].function!(this: this, arguments: [target.jsValue, index.jsValue]) - } - - @inlinable public func blendEquationiOES(buf: GLuint, mode: GLenum) { - let this = jsObject - _ = this[Strings.blendEquationiOES].function!(this: this, arguments: [buf.jsValue, mode.jsValue]) - } - - @inlinable public func blendEquationSeparateiOES(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum) { - let this = jsObject - _ = this[Strings.blendEquationSeparateiOES].function!(this: this, arguments: [buf.jsValue, modeRGB.jsValue, modeAlpha.jsValue]) - } - - @inlinable public func blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum) { - let this = jsObject - _ = this[Strings.blendFunciOES].function!(this: this, arguments: [buf.jsValue, src.jsValue, dst.jsValue]) - } - - @inlinable public func blendFuncSeparateiOES(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { - let this = jsObject - _ = this[Strings.blendFuncSeparateiOES].function!(this: this, arguments: [buf.jsValue, srcRGB.jsValue, dstRGB.jsValue, srcAlpha.jsValue, dstAlpha.jsValue]) - } - - @inlinable public func colorMaskiOES(buf: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean) { - let this = jsObject - _ = this[Strings.colorMaskiOES].function!(this: this, arguments: [buf.jsValue, r.jsValue, g.jsValue, b.jsValue, a.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/OES_element_index_uint.swift b/Sources/DOMKit/WebIDL/OES_element_index_uint.swift deleted file mode 100644 index 895756a5..00000000 --- a/Sources/DOMKit/WebIDL/OES_element_index_uint.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OES_element_index_uint: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_element_index_uint].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift b/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift deleted file mode 100644 index f6bf6990..00000000 --- a/Sources/DOMKit/WebIDL/OES_fbo_render_mipmap.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OES_fbo_render_mipmap: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_fbo_render_mipmap].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift b/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift deleted file mode 100644 index 132ef4ad..00000000 --- a/Sources/DOMKit/WebIDL/OES_standard_derivatives.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OES_standard_derivatives: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_standard_derivatives].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum = 0x8B8B -} diff --git a/Sources/DOMKit/WebIDL/OES_texture_float.swift b/Sources/DOMKit/WebIDL/OES_texture_float.swift deleted file mode 100644 index 4152e44a..00000000 --- a/Sources/DOMKit/WebIDL/OES_texture_float.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OES_texture_float: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_float].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift b/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift deleted file mode 100644 index 751222ea..00000000 --- a/Sources/DOMKit/WebIDL/OES_texture_float_linear.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OES_texture_float_linear: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_float_linear].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/OES_texture_half_float.swift b/Sources/DOMKit/WebIDL/OES_texture_half_float.swift deleted file mode 100644 index a62ad3c8..00000000 --- a/Sources/DOMKit/WebIDL/OES_texture_half_float.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OES_texture_half_float: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_half_float].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let HALF_FLOAT_OES: GLenum = 0x8D61 -} diff --git a/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift b/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift deleted file mode 100644 index 88452af8..00000000 --- a/Sources/DOMKit/WebIDL/OES_texture_half_float_linear.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OES_texture_half_float_linear: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_texture_half_float_linear].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift b/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift deleted file mode 100644 index d88cd313..00000000 --- a/Sources/DOMKit/WebIDL/OES_vertex_array_object.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OES_vertex_array_object: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OES_vertex_array_object].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let VERTEX_ARRAY_BINDING_OES: GLenum = 0x85B5 - - @inlinable public func createVertexArrayOES() -> WebGLVertexArrayObjectOES? { - let this = jsObject - return this[Strings.createVertexArrayOES].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { - let this = jsObject - _ = this[Strings.deleteVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue]) - } - - @inlinable public func isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) -> GLboolean { - let this = jsObject - return this[Strings.isVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue]).fromJSValue()! - } - - @inlinable public func bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) { - let this = jsObject - _ = this[Strings.bindVertexArrayOES].function!(this: this, arguments: [arrayObject.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/OTPCredential.swift b/Sources/DOMKit/WebIDL/OTPCredential.swift deleted file mode 100644 index ae099edb..00000000 --- a/Sources/DOMKit/WebIDL/OTPCredential.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OTPCredential: Credential { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OTPCredential].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _code = ReadonlyAttribute(jsObject: jsObject, name: Strings.code) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var code: String -} diff --git a/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift deleted file mode 100644 index 3931b309..00000000 --- a/Sources/DOMKit/WebIDL/OTPCredentialRequestOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OTPCredentialRequestOptions: BridgedDictionary { - public convenience init(transport: [OTPCredentialTransportType]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transport] = transport.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _transport = ReadWriteAttribute(jsObject: object, name: Strings.transport) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var transport: [OTPCredentialTransportType] -} diff --git a/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift b/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift deleted file mode 100644 index 86aa763d..00000000 --- a/Sources/DOMKit/WebIDL/OTPCredentialTransportType.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum OTPCredentialTransportType: JSString, JSValueCompatible { - case sms = "sms" - - @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/OVR_multiview2.swift b/Sources/DOMKit/WebIDL/OVR_multiview2.swift deleted file mode 100644 index ed19ab96..00000000 --- a/Sources/DOMKit/WebIDL/OVR_multiview2.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OVR_multiview2: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.OVR_multiview2].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: GLenum = 0x9630 - - public static let FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: GLenum = 0x9632 - - public static let MAX_VIEWS_OVR: GLenum = 0x9631 - - public static let FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: GLenum = 0x9633 - - @inlinable public func framebufferTextureMultiviewOVR(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, baseViewIndex: GLint, numViews: GLsizei) { - let _arg0 = target.jsValue - let _arg1 = attachment.jsValue - let _arg2 = texture.jsValue - let _arg3 = level.jsValue - let _arg4 = baseViewIndex.jsValue - let _arg5 = numViews.jsValue - let this = jsObject - _ = this[Strings.framebufferTextureMultiviewOVR].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } -} diff --git a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift deleted file mode 100644 index bbd479f4..00000000 --- a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OfflineAudioCompletionEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OfflineAudioCompletionEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _renderedBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderedBuffer) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: OfflineAudioCompletionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var renderedBuffer: AudioBuffer -} diff --git a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift b/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift deleted file mode 100644 index 6e61930a..00000000 --- a/Sources/DOMKit/WebIDL/OfflineAudioCompletionEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OfflineAudioCompletionEventInit: BridgedDictionary { - public convenience init(renderedBuffer: AudioBuffer) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.renderedBuffer] = renderedBuffer.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _renderedBuffer = ReadWriteAttribute(jsObject: object, name: Strings.renderedBuffer) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var renderedBuffer: AudioBuffer -} diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift b/Sources/DOMKit/WebIDL/OfflineAudioContext.swift deleted file mode 100644 index 0d70006c..00000000 --- a/Sources/DOMKit/WebIDL/OfflineAudioContext.swift +++ /dev/null @@ -1,64 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OfflineAudioContext: BaseAudioContext { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OfflineAudioContext].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _oncomplete = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncomplete) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(contextOptions: OfflineAudioContextOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [contextOptions.jsValue])) - } - - @inlinable public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [numberOfChannels.jsValue, length.jsValue, sampleRate.jsValue])) - } - - @inlinable public func startRendering() -> JSPromise { - let this = jsObject - return this[Strings.startRendering].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func startRendering() async throws -> AudioBuffer { - let this = jsObject - let _promise: JSPromise = this[Strings.startRendering].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func resume() -> JSPromise { - let this = jsObject - return this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func resume() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.resume].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func suspend(suspendTime: Double) -> JSPromise { - let this = jsObject - return this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func suspend(suspendTime: Double) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.suspend].function!(this: this, arguments: [suspendTime.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @ReadonlyAttribute - public var length: UInt32 - - @ClosureAttribute1Optional - public var oncomplete: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift b/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift deleted file mode 100644 index cb5abf5a..00000000 --- a/Sources/DOMKit/WebIDL/OfflineAudioContextOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OfflineAudioContextOptions: BridgedDictionary { - public convenience init(numberOfChannels: UInt32, length: UInt32, sampleRate: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.numberOfChannels] = numberOfChannels.jsValue - object[Strings.length] = length.jsValue - object[Strings.sampleRate] = sampleRate.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) - _length = ReadWriteAttribute(jsObject: object, name: Strings.length) - _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var numberOfChannels: UInt32 - - @ReadWriteAttribute - public var length: UInt32 - - @ReadWriteAttribute - public var sampleRate: Float -} diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift index f1bd2fa2..db97277e 100644 --- a/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift @@ -11,15 +11,15 @@ extension WebGL2RenderingContext: Any_OffscreenRenderingContext {} extension WebGLRenderingContext: Any_OffscreenRenderingContext {} public enum OffscreenRenderingContext: JSValueCompatible, Any_OffscreenRenderingContext { - case gPUCanvasContext(GPUCanvasContext) + case gpuCanvasContext(GPUCanvasContext) case imageBitmapRenderingContext(ImageBitmapRenderingContext) case offscreenCanvasRenderingContext2D(OffscreenCanvasRenderingContext2D) case webGL2RenderingContext(WebGL2RenderingContext) case webGLRenderingContext(WebGLRenderingContext) public static func construct(from value: JSValue) -> Self? { - if let gPUCanvasContext: GPUCanvasContext = value.fromJSValue() { - return .gPUCanvasContext(gPUCanvasContext) + if let gpuCanvasContext: GPUCanvasContext = value.fromJSValue() { + return .gpuCanvasContext(gpuCanvasContext) } if let imageBitmapRenderingContext: ImageBitmapRenderingContext = value.fromJSValue() { return .imageBitmapRenderingContext(imageBitmapRenderingContext) @@ -38,8 +38,8 @@ public enum OffscreenRenderingContext: JSValueCompatible, Any_OffscreenRendering public var jsValue: JSValue { switch self { - case let .gPUCanvasContext(gPUCanvasContext): - return gPUCanvasContext.jsValue + case let .gpuCanvasContext(gpuCanvasContext): + return gpuCanvasContext.jsValue case let .imageBitmapRenderingContext(imageBitmapRenderingContext): return imageBitmapRenderingContext.jsValue case let .offscreenCanvasRenderingContext2D(offscreenCanvasRenderingContext2D): diff --git a/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift b/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift deleted file mode 100644 index a3d45d5e..00000000 --- a/Sources/DOMKit/WebIDL/OpenFilePickerOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OpenFilePickerOptions: BridgedDictionary { - public convenience init(multiple: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.multiple] = multiple.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _multiple = ReadWriteAttribute(jsObject: object, name: Strings.multiple) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var multiple: Bool -} diff --git a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift index 7b42b106..e23c1217 100644 --- a/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift +++ b/Sources/DOMKit/WebIDL/OptionalEffectTiming.swift @@ -4,9 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class OptionalEffectTiming: BridgedDictionary { - public convenience init(playbackRate: Double, delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: Double_or_String, direction: PlaybackDirection, easing: String) { + public convenience init(delay: Double, endDelay: Double, fill: FillMode, iterationStart: Double, iterations: Double, duration: Double_or_String, direction: PlaybackDirection, easing: String) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.playbackRate] = playbackRate.jsValue object[Strings.delay] = delay.jsValue object[Strings.endDelay] = endDelay.jsValue object[Strings.fill] = fill.jsValue @@ -19,7 +18,6 @@ public class OptionalEffectTiming: BridgedDictionary { } public required init(unsafelyWrapping object: JSObject) { - _playbackRate = ReadWriteAttribute(jsObject: object, name: Strings.playbackRate) _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) _endDelay = ReadWriteAttribute(jsObject: object, name: Strings.endDelay) _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) @@ -31,9 +29,6 @@ public class OptionalEffectTiming: BridgedDictionary { super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var playbackRate: Double - @ReadWriteAttribute public var delay: Double diff --git a/Sources/DOMKit/WebIDL/OrientationLockType.swift b/Sources/DOMKit/WebIDL/OrientationLockType.swift deleted file mode 100644 index d0daf9f4..00000000 --- a/Sources/DOMKit/WebIDL/OrientationLockType.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum OrientationLockType: JSString, JSValueCompatible { - case any = "any" - case natural = "natural" - case landscape = "landscape" - case portrait = "portrait" - case portraitPrimary = "portrait-primary" - case portraitSecondary = "portrait-secondary" - case landscapePrimary = "landscape-primary" - case landscapeSecondary = "landscape-secondary" - - @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/OrientationSensor.swift b/Sources/DOMKit/WebIDL/OrientationSensor.swift deleted file mode 100644 index 950d2270..00000000 --- a/Sources/DOMKit/WebIDL/OrientationSensor.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OrientationSensor: Sensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OrientationSensor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _quaternion = ReadonlyAttribute(jsObject: jsObject, name: Strings.quaternion) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var quaternion: [Double]? - - @inlinable public func populateMatrix(targetMatrix: RotationMatrixType) { - let this = jsObject - _ = this[Strings.populateMatrix].function!(this: this, arguments: [targetMatrix.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift b/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift deleted file mode 100644 index ce3ebc2c..00000000 --- a/Sources/DOMKit/WebIDL/OrientationSensorLocalCoordinateSystem.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum OrientationSensorLocalCoordinateSystem: JSString, JSValueCompatible { - case device = "device" - case screen = "screen" - - @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/OrientationSensorOptions.swift b/Sources/DOMKit/WebIDL/OrientationSensorOptions.swift deleted file mode 100644 index 78421e6d..00000000 --- a/Sources/DOMKit/WebIDL/OrientationSensorOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OrientationSensorOptions: BridgedDictionary { - public convenience init(referenceFrame: OrientationSensorLocalCoordinateSystem) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceFrame] = referenceFrame.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _referenceFrame = ReadWriteAttribute(jsObject: object, name: Strings.referenceFrame) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var referenceFrame: OrientationSensorLocalCoordinateSystem -} diff --git a/Sources/DOMKit/WebIDL/OrientationType.swift b/Sources/DOMKit/WebIDL/OrientationType.swift deleted file mode 100644 index 3144ca77..00000000 --- a/Sources/DOMKit/WebIDL/OrientationType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum OrientationType: JSString, JSValueCompatible { - case portraitPrimary = "portrait-primary" - case portraitSecondary = "portrait-secondary" - case landscapePrimary = "landscape-primary" - case landscapeSecondary = "landscape-secondary" - - @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/OscillatorNode.swift b/Sources/DOMKit/WebIDL/OscillatorNode.swift deleted file mode 100644 index e11648d9..00000000 --- a/Sources/DOMKit/WebIDL/OscillatorNode.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OscillatorNode: AudioScheduledSourceNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OscillatorNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) - _frequency = ReadonlyAttribute(jsObject: jsObject, name: Strings.frequency) - _detune = ReadonlyAttribute(jsObject: jsObject, name: Strings.detune) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: OscillatorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var type: OscillatorType - - @ReadonlyAttribute - public var frequency: AudioParam - - @ReadonlyAttribute - public var detune: AudioParam - - @inlinable public func setPeriodicWave(periodicWave: PeriodicWave) { - let this = jsObject - _ = this[Strings.setPeriodicWave].function!(this: this, arguments: [periodicWave.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/OscillatorOptions.swift b/Sources/DOMKit/WebIDL/OscillatorOptions.swift deleted file mode 100644 index cc807696..00000000 --- a/Sources/DOMKit/WebIDL/OscillatorOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class OscillatorOptions: BridgedDictionary { - public convenience init(type: OscillatorType, frequency: Float, detune: Float, periodicWave: PeriodicWave) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.frequency] = frequency.jsValue - object[Strings.detune] = detune.jsValue - object[Strings.periodicWave] = periodicWave.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) - _detune = ReadWriteAttribute(jsObject: object, name: Strings.detune) - _periodicWave = ReadWriteAttribute(jsObject: object, name: Strings.periodicWave) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: OscillatorType - - @ReadWriteAttribute - public var frequency: Float - - @ReadWriteAttribute - public var detune: Float - - @ReadWriteAttribute - public var periodicWave: PeriodicWave -} diff --git a/Sources/DOMKit/WebIDL/OscillatorType.swift b/Sources/DOMKit/WebIDL/OscillatorType.swift deleted file mode 100644 index 1a276c46..00000000 --- a/Sources/DOMKit/WebIDL/OscillatorType.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum OscillatorType: JSString, JSValueCompatible { - case sine = "sine" - case square = "square" - case sawtooth = "sawtooth" - case triangle = "triangle" - case custom = "custom" - - @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/OverSampleType.swift b/Sources/DOMKit/WebIDL/OverSampleType.swift deleted file mode 100644 index 2b936c99..00000000 --- a/Sources/DOMKit/WebIDL/OverSampleType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum OverSampleType: JSString, JSValueCompatible { - case none = "none" - case _2x = "2x" - case _4x = "4x" - - @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/PaintRenderingContext2DSettings.swift b/Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift deleted file mode 100644 index 9673eca3..00000000 --- a/Sources/DOMKit/WebIDL/PaintRenderingContext2DSettings.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaintRenderingContext2DSettings: BridgedDictionary { - public convenience init(alpha: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var alpha: Bool -} diff --git a/Sources/DOMKit/WebIDL/PannerNode.swift b/Sources/DOMKit/WebIDL/PannerNode.swift deleted file mode 100644 index 0dc1eab3..00000000 --- a/Sources/DOMKit/WebIDL/PannerNode.swift +++ /dev/null @@ -1,82 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PannerNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PannerNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _panningModel = ReadWriteAttribute(jsObject: jsObject, name: Strings.panningModel) - _positionX = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionX) - _positionY = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionY) - _positionZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.positionZ) - _orientationX = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientationX) - _orientationY = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientationY) - _orientationZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientationZ) - _distanceModel = ReadWriteAttribute(jsObject: jsObject, name: Strings.distanceModel) - _refDistance = ReadWriteAttribute(jsObject: jsObject, name: Strings.refDistance) - _maxDistance = ReadWriteAttribute(jsObject: jsObject, name: Strings.maxDistance) - _rolloffFactor = ReadWriteAttribute(jsObject: jsObject, name: Strings.rolloffFactor) - _coneInnerAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.coneInnerAngle) - _coneOuterAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.coneOuterAngle) - _coneOuterGain = ReadWriteAttribute(jsObject: jsObject, name: Strings.coneOuterGain) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: PannerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var panningModel: PanningModelType - - @ReadonlyAttribute - public var positionX: AudioParam - - @ReadonlyAttribute - public var positionY: AudioParam - - @ReadonlyAttribute - public var positionZ: AudioParam - - @ReadonlyAttribute - public var orientationX: AudioParam - - @ReadonlyAttribute - public var orientationY: AudioParam - - @ReadonlyAttribute - public var orientationZ: AudioParam - - @ReadWriteAttribute - public var distanceModel: DistanceModelType - - @ReadWriteAttribute - public var refDistance: Double - - @ReadWriteAttribute - public var maxDistance: Double - - @ReadWriteAttribute - public var rolloffFactor: Double - - @ReadWriteAttribute - public var coneInnerAngle: Double - - @ReadWriteAttribute - public var coneOuterAngle: Double - - @ReadWriteAttribute - public var coneOuterGain: Double - - @inlinable public func setPosition(x: Float, y: Float, z: Float) { - let this = jsObject - _ = this[Strings.setPosition].function!(this: this, arguments: [x.jsValue, y.jsValue, z.jsValue]) - } - - @inlinable public func setOrientation(x: Float, y: Float, z: Float) { - let this = jsObject - _ = this[Strings.setOrientation].function!(this: this, arguments: [x.jsValue, y.jsValue, z.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/PannerOptions.swift b/Sources/DOMKit/WebIDL/PannerOptions.swift deleted file mode 100644 index e2685dc3..00000000 --- a/Sources/DOMKit/WebIDL/PannerOptions.swift +++ /dev/null @@ -1,85 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PannerOptions: BridgedDictionary { - public convenience init(panningModel: PanningModelType, distanceModel: DistanceModelType, positionX: Float, positionY: Float, positionZ: Float, orientationX: Float, orientationY: Float, orientationZ: Float, refDistance: Double, maxDistance: Double, rolloffFactor: Double, coneInnerAngle: Double, coneOuterAngle: Double, coneOuterGain: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.panningModel] = panningModel.jsValue - object[Strings.distanceModel] = distanceModel.jsValue - object[Strings.positionX] = positionX.jsValue - object[Strings.positionY] = positionY.jsValue - object[Strings.positionZ] = positionZ.jsValue - object[Strings.orientationX] = orientationX.jsValue - object[Strings.orientationY] = orientationY.jsValue - object[Strings.orientationZ] = orientationZ.jsValue - object[Strings.refDistance] = refDistance.jsValue - object[Strings.maxDistance] = maxDistance.jsValue - object[Strings.rolloffFactor] = rolloffFactor.jsValue - object[Strings.coneInnerAngle] = coneInnerAngle.jsValue - object[Strings.coneOuterAngle] = coneOuterAngle.jsValue - object[Strings.coneOuterGain] = coneOuterGain.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _panningModel = ReadWriteAttribute(jsObject: object, name: Strings.panningModel) - _distanceModel = ReadWriteAttribute(jsObject: object, name: Strings.distanceModel) - _positionX = ReadWriteAttribute(jsObject: object, name: Strings.positionX) - _positionY = ReadWriteAttribute(jsObject: object, name: Strings.positionY) - _positionZ = ReadWriteAttribute(jsObject: object, name: Strings.positionZ) - _orientationX = ReadWriteAttribute(jsObject: object, name: Strings.orientationX) - _orientationY = ReadWriteAttribute(jsObject: object, name: Strings.orientationY) - _orientationZ = ReadWriteAttribute(jsObject: object, name: Strings.orientationZ) - _refDistance = ReadWriteAttribute(jsObject: object, name: Strings.refDistance) - _maxDistance = ReadWriteAttribute(jsObject: object, name: Strings.maxDistance) - _rolloffFactor = ReadWriteAttribute(jsObject: object, name: Strings.rolloffFactor) - _coneInnerAngle = ReadWriteAttribute(jsObject: object, name: Strings.coneInnerAngle) - _coneOuterAngle = ReadWriteAttribute(jsObject: object, name: Strings.coneOuterAngle) - _coneOuterGain = ReadWriteAttribute(jsObject: object, name: Strings.coneOuterGain) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var panningModel: PanningModelType - - @ReadWriteAttribute - public var distanceModel: DistanceModelType - - @ReadWriteAttribute - public var positionX: Float - - @ReadWriteAttribute - public var positionY: Float - - @ReadWriteAttribute - public var positionZ: Float - - @ReadWriteAttribute - public var orientationX: Float - - @ReadWriteAttribute - public var orientationY: Float - - @ReadWriteAttribute - public var orientationZ: Float - - @ReadWriteAttribute - public var refDistance: Double - - @ReadWriteAttribute - public var maxDistance: Double - - @ReadWriteAttribute - public var rolloffFactor: Double - - @ReadWriteAttribute - public var coneInnerAngle: Double - - @ReadWriteAttribute - public var coneOuterAngle: Double - - @ReadWriteAttribute - public var coneOuterGain: Double -} diff --git a/Sources/DOMKit/WebIDL/PanningModelType.swift b/Sources/DOMKit/WebIDL/PanningModelType.swift deleted file mode 100644 index 7c293a3a..00000000 --- a/Sources/DOMKit/WebIDL/PanningModelType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum PanningModelType: JSString, JSValueCompatible { - case equalpower = "equalpower" - case hRTF = "HRTF" - - @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/ParityType.swift b/Sources/DOMKit/WebIDL/ParityType.swift deleted file mode 100644 index 8df22cf9..00000000 --- a/Sources/DOMKit/WebIDL/ParityType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ParityType: JSString, JSValueCompatible { - case none = "none" - case even = "even" - case odd = "odd" - - @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/PasswordCredential.swift b/Sources/DOMKit/WebIDL/PasswordCredential.swift deleted file mode 100644 index 8ed5b862..00000000 --- a/Sources/DOMKit/WebIDL/PasswordCredential.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PasswordCredential: Credential, CredentialUserData { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PasswordCredential].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _password = ReadonlyAttribute(jsObject: jsObject, name: Strings.password) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(form: HTMLFormElement) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [form.jsValue])) - } - - @inlinable public convenience init(data: PasswordCredentialData) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue])) - } - - @ReadonlyAttribute - public var password: String -} diff --git a/Sources/DOMKit/WebIDL/PasswordCredentialData.swift b/Sources/DOMKit/WebIDL/PasswordCredentialData.swift deleted file mode 100644 index c21f63f1..00000000 --- a/Sources/DOMKit/WebIDL/PasswordCredentialData.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PasswordCredentialData: BridgedDictionary { - public convenience init(name: String, iconURL: String, origin: String, password: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.iconURL] = iconURL.jsValue - object[Strings.origin] = origin.jsValue - object[Strings.password] = password.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _iconURL = ReadWriteAttribute(jsObject: object, name: Strings.iconURL) - _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) - _password = ReadWriteAttribute(jsObject: object, name: Strings.password) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var iconURL: String - - @ReadWriteAttribute - public var origin: String - - @ReadWriteAttribute - public var password: String -} diff --git a/Sources/DOMKit/WebIDL/PasswordCredentialInit.swift b/Sources/DOMKit/WebIDL/PasswordCredentialInit.swift deleted file mode 100644 index a265bc15..00000000 --- a/Sources/DOMKit/WebIDL/PasswordCredentialInit.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_PasswordCredentialInit: ConvertibleToJSValue {} -extension HTMLFormElement: Any_PasswordCredentialInit {} -extension PasswordCredentialData: Any_PasswordCredentialInit {} - -public enum PasswordCredentialInit: JSValueCompatible, Any_PasswordCredentialInit { - case hTMLFormElement(HTMLFormElement) - case passwordCredentialData(PasswordCredentialData) - - public static func construct(from value: JSValue) -> Self? { - if let hTMLFormElement: HTMLFormElement = value.fromJSValue() { - return .hTMLFormElement(hTMLFormElement) - } - if let passwordCredentialData: PasswordCredentialData = value.fromJSValue() { - return .passwordCredentialData(passwordCredentialData) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .hTMLFormElement(hTMLFormElement): - return hTMLFormElement.jsValue - case let .passwordCredentialData(passwordCredentialData): - return passwordCredentialData.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/PaymentComplete.swift b/Sources/DOMKit/WebIDL/PaymentComplete.swift deleted file mode 100644 index fbf6f301..00000000 --- a/Sources/DOMKit/WebIDL/PaymentComplete.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum PaymentComplete: JSString, JSValueCompatible { - case fail = "fail" - case success = "success" - case unknown = "unknown" - - @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/PaymentCredentialInstrument.swift b/Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift deleted file mode 100644 index 5c708c65..00000000 --- a/Sources/DOMKit/WebIDL/PaymentCredentialInstrument.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentCredentialInstrument: BridgedDictionary { - public convenience init(displayName: String, icon: String, iconMustBeShown: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.displayName] = displayName.jsValue - object[Strings.icon] = icon.jsValue - object[Strings.iconMustBeShown] = iconMustBeShown.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _displayName = ReadWriteAttribute(jsObject: object, name: Strings.displayName) - _icon = ReadWriteAttribute(jsObject: object, name: Strings.icon) - _iconMustBeShown = ReadWriteAttribute(jsObject: object, name: Strings.iconMustBeShown) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var displayName: String - - @ReadWriteAttribute - public var icon: String - - @ReadWriteAttribute - public var iconMustBeShown: Bool -} diff --git a/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift b/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift deleted file mode 100644 index 79df15ad..00000000 --- a/Sources/DOMKit/WebIDL/PaymentCurrencyAmount.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentCurrencyAmount: BridgedDictionary { - public convenience init(currency: String, value: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.currency] = currency.jsValue - object[Strings.value] = value.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _currency = ReadWriteAttribute(jsObject: object, name: Strings.currency) - _value = ReadWriteAttribute(jsObject: object, name: Strings.value) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var currency: String - - @ReadWriteAttribute - public var value: String -} diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift b/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift deleted file mode 100644 index f1800e87..00000000 --- a/Sources/DOMKit/WebIDL/PaymentDetailsBase.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentDetailsBase: BridgedDictionary { - public convenience init(displayItems: [PaymentItem], modifiers: [PaymentDetailsModifier]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.displayItems] = displayItems.jsValue - object[Strings.modifiers] = modifiers.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _displayItems = ReadWriteAttribute(jsObject: object, name: Strings.displayItems) - _modifiers = ReadWriteAttribute(jsObject: object, name: Strings.modifiers) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var displayItems: [PaymentItem] - - @ReadWriteAttribute - public var modifiers: [PaymentDetailsModifier] -} diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift b/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift deleted file mode 100644 index c7013679..00000000 --- a/Sources/DOMKit/WebIDL/PaymentDetailsInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentDetailsInit: BridgedDictionary { - public convenience init(id: String, total: PaymentItem) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue - object[Strings.total] = total.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _total = ReadWriteAttribute(jsObject: object, name: Strings.total) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var id: String - - @ReadWriteAttribute - public var total: PaymentItem -} diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift b/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift deleted file mode 100644 index 2fb76c55..00000000 --- a/Sources/DOMKit/WebIDL/PaymentDetailsModifier.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentDetailsModifier: BridgedDictionary { - public convenience init(supportedMethods: String, total: PaymentItem, additionalDisplayItems: [PaymentItem], data: JSObject) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supportedMethods] = supportedMethods.jsValue - object[Strings.total] = total.jsValue - object[Strings.additionalDisplayItems] = additionalDisplayItems.jsValue - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _supportedMethods = ReadWriteAttribute(jsObject: object, name: Strings.supportedMethods) - _total = ReadWriteAttribute(jsObject: object, name: Strings.total) - _additionalDisplayItems = ReadWriteAttribute(jsObject: object, name: Strings.additionalDisplayItems) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var supportedMethods: String - - @ReadWriteAttribute - public var total: PaymentItem - - @ReadWriteAttribute - public var additionalDisplayItems: [PaymentItem] - - @ReadWriteAttribute - public var data: JSObject -} diff --git a/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift b/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift deleted file mode 100644 index ca1da2d1..00000000 --- a/Sources/DOMKit/WebIDL/PaymentDetailsUpdate.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentDetailsUpdate: BridgedDictionary { - public convenience init(total: PaymentItem, paymentMethodErrors: JSObject) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.total] = total.jsValue - object[Strings.paymentMethodErrors] = paymentMethodErrors.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _total = ReadWriteAttribute(jsObject: object, name: Strings.total) - _paymentMethodErrors = ReadWriteAttribute(jsObject: object, name: Strings.paymentMethodErrors) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var total: PaymentItem - - @ReadWriteAttribute - public var paymentMethodErrors: JSObject -} diff --git a/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift b/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift deleted file mode 100644 index 8b6c610f..00000000 --- a/Sources/DOMKit/WebIDL/PaymentHandlerResponse.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentHandlerResponse: BridgedDictionary { - public convenience init(methodName: String, details: JSObject) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.methodName] = methodName.jsValue - object[Strings.details] = details.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _methodName = ReadWriteAttribute(jsObject: object, name: Strings.methodName) - _details = ReadWriteAttribute(jsObject: object, name: Strings.details) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var methodName: String - - @ReadWriteAttribute - public var details: JSObject -} diff --git a/Sources/DOMKit/WebIDL/PaymentInstrument.swift b/Sources/DOMKit/WebIDL/PaymentInstrument.swift deleted file mode 100644 index 4cb83963..00000000 --- a/Sources/DOMKit/WebIDL/PaymentInstrument.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentInstrument: BridgedDictionary { - public convenience init(name: String, icons: [ImageObject], method: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.icons] = icons.jsValue - object[Strings.method] = method.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _icons = ReadWriteAttribute(jsObject: object, name: Strings.icons) - _method = ReadWriteAttribute(jsObject: object, name: Strings.method) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var icons: [ImageObject] - - @ReadWriteAttribute - public var method: String -} diff --git a/Sources/DOMKit/WebIDL/PaymentInstruments.swift b/Sources/DOMKit/WebIDL/PaymentInstruments.swift deleted file mode 100644 index 6068a16f..00000000 --- a/Sources/DOMKit/WebIDL/PaymentInstruments.swift +++ /dev/null @@ -1,86 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentInstruments: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PaymentInstruments].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func delete(instrumentKey: String) -> JSPromise { - let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func delete(instrumentKey: String) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func get(instrumentKey: String) -> JSPromise { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func get(instrumentKey: String) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.get].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func keys() -> JSPromise { - let this = jsObject - return this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! - } - - @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()! - } - - @inlinable public func has(instrumentKey: String) -> JSPromise { - let this = jsObject - return this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func has(instrumentKey: String) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.has].function!(this: this, arguments: [instrumentKey.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func set(instrumentKey: String, details: PaymentInstrument) -> JSPromise { - let this = jsObject - return this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue, details.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func set(instrumentKey: String, details: PaymentInstrument) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.set].function!(this: this, arguments: [instrumentKey.jsValue, details.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func clear() -> JSPromise { - let this = jsObject - return this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func clear() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.clear].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/PaymentItem.swift b/Sources/DOMKit/WebIDL/PaymentItem.swift deleted file mode 100644 index 5604dd86..00000000 --- a/Sources/DOMKit/WebIDL/PaymentItem.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentItem: BridgedDictionary { - public convenience init(label: String, amount: PaymentCurrencyAmount, pending: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue - object[Strings.amount] = amount.jsValue - object[Strings.pending] = pending.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _label = ReadWriteAttribute(jsObject: object, name: Strings.label) - _amount = ReadWriteAttribute(jsObject: object, name: Strings.amount) - _pending = ReadWriteAttribute(jsObject: object, name: Strings.pending) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var label: String - - @ReadWriteAttribute - public var amount: PaymentCurrencyAmount - - @ReadWriteAttribute - public var pending: Bool -} diff --git a/Sources/DOMKit/WebIDL/PaymentManager.swift b/Sources/DOMKit/WebIDL/PaymentManager.swift deleted file mode 100644 index 63bb3b36..00000000 --- a/Sources/DOMKit/WebIDL/PaymentManager.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PaymentManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _instruments = ReadonlyAttribute(jsObject: jsObject, name: Strings.instruments) - _userHint = ReadWriteAttribute(jsObject: jsObject, name: Strings.userHint) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var instruments: PaymentInstruments - - @ReadWriteAttribute - public var userHint: String -} diff --git a/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift b/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift deleted file mode 100644 index 20975286..00000000 --- a/Sources/DOMKit/WebIDL/PaymentMethodChangeEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentMethodChangeEvent: PaymentRequestUpdateEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentMethodChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _methodName = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodName) - _methodDetails = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodDetails) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: PaymentMethodChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var methodName: String - - @ReadonlyAttribute - public var methodDetails: JSObject? -} diff --git a/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift b/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift deleted file mode 100644 index 82f277fd..00000000 --- a/Sources/DOMKit/WebIDL/PaymentMethodChangeEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentMethodChangeEventInit: BridgedDictionary { - public convenience init(methodName: String, methodDetails: JSObject?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.methodName] = methodName.jsValue - object[Strings.methodDetails] = methodDetails.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _methodName = ReadWriteAttribute(jsObject: object, name: Strings.methodName) - _methodDetails = ReadWriteAttribute(jsObject: object, name: Strings.methodDetails) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var methodName: String - - @ReadWriteAttribute - public var methodDetails: JSObject? -} diff --git a/Sources/DOMKit/WebIDL/PaymentMethodData.swift b/Sources/DOMKit/WebIDL/PaymentMethodData.swift deleted file mode 100644 index 28ced977..00000000 --- a/Sources/DOMKit/WebIDL/PaymentMethodData.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentMethodData: BridgedDictionary { - public convenience init(supportedMethods: String, data: JSObject) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supportedMethods] = supportedMethods.jsValue - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _supportedMethods = ReadWriteAttribute(jsObject: object, name: Strings.supportedMethods) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var supportedMethods: String - - @ReadWriteAttribute - public var data: JSObject -} diff --git a/Sources/DOMKit/WebIDL/PaymentRequest.swift b/Sources/DOMKit/WebIDL/PaymentRequest.swift deleted file mode 100644 index be72bebc..00000000 --- a/Sources/DOMKit/WebIDL/PaymentRequest.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentRequest: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequest].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _onpaymentmethodchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpaymentmethodchange) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(methodData: [PaymentMethodData], details: PaymentDetailsInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [methodData.jsValue, details.jsValue])) - } - - @inlinable public func show(detailsPromise: JSPromise? = nil) -> JSPromise { - let this = jsObject - return this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func show(detailsPromise: JSPromise? = nil) async throws -> PaymentResponse { - let this = jsObject - let _promise: JSPromise = this[Strings.show].function!(this: this, arguments: [detailsPromise?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func abort() -> JSPromise { - let this = jsObject - return this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func abort() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func canMakePayment() -> JSPromise { - let this = jsObject - return this[Strings.canMakePayment].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func canMakePayment() async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.canMakePayment].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var id: String - - @ClosureAttribute1Optional - public var onpaymentmethodchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift b/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift deleted file mode 100644 index 5f532169..00000000 --- a/Sources/DOMKit/WebIDL/PaymentRequestDetailsUpdate.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentRequestDetailsUpdate: BridgedDictionary { - public convenience init(error: String, total: PaymentCurrencyAmount, modifiers: [PaymentDetailsModifier], paymentMethodErrors: JSObject) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue - object[Strings.total] = total.jsValue - object[Strings.modifiers] = modifiers.jsValue - object[Strings.paymentMethodErrors] = paymentMethodErrors.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _error = ReadWriteAttribute(jsObject: object, name: Strings.error) - _total = ReadWriteAttribute(jsObject: object, name: Strings.total) - _modifiers = ReadWriteAttribute(jsObject: object, name: Strings.modifiers) - _paymentMethodErrors = ReadWriteAttribute(jsObject: object, name: Strings.paymentMethodErrors) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var error: String - - @ReadWriteAttribute - public var total: PaymentCurrencyAmount - - @ReadWriteAttribute - public var modifiers: [PaymentDetailsModifier] - - @ReadWriteAttribute - public var paymentMethodErrors: JSObject -} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift b/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift deleted file mode 100644 index 572f76c3..00000000 --- a/Sources/DOMKit/WebIDL/PaymentRequestEventInit.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentRequestEventInit: BridgedDictionary { - public convenience init(topOrigin: String, paymentRequestOrigin: String, paymentRequestId: String, methodData: [PaymentMethodData], total: PaymentCurrencyAmount, modifiers: [PaymentDetailsModifier]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.topOrigin] = topOrigin.jsValue - object[Strings.paymentRequestOrigin] = paymentRequestOrigin.jsValue - object[Strings.paymentRequestId] = paymentRequestId.jsValue - object[Strings.methodData] = methodData.jsValue - object[Strings.total] = total.jsValue - object[Strings.modifiers] = modifiers.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _topOrigin = ReadWriteAttribute(jsObject: object, name: Strings.topOrigin) - _paymentRequestOrigin = ReadWriteAttribute(jsObject: object, name: Strings.paymentRequestOrigin) - _paymentRequestId = ReadWriteAttribute(jsObject: object, name: Strings.paymentRequestId) - _methodData = ReadWriteAttribute(jsObject: object, name: Strings.methodData) - _total = ReadWriteAttribute(jsObject: object, name: Strings.total) - _modifiers = ReadWriteAttribute(jsObject: object, name: Strings.modifiers) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var topOrigin: String - - @ReadWriteAttribute - public var paymentRequestOrigin: String - - @ReadWriteAttribute - public var paymentRequestId: String - - @ReadWriteAttribute - public var methodData: [PaymentMethodData] - - @ReadWriteAttribute - public var total: PaymentCurrencyAmount - - @ReadWriteAttribute - public var modifiers: [PaymentDetailsModifier] -} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift deleted file mode 100644 index 314ee90a..00000000 --- a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEvent.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentRequestUpdateEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentRequestUpdateEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: PaymentRequestUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @inlinable public func updateWith(detailsPromise: JSPromise) { - let this = jsObject - _ = this[Strings.updateWith].function!(this: this, arguments: [detailsPromise.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEventInit.swift b/Sources/DOMKit/WebIDL/PaymentRequestUpdateEventInit.swift deleted file mode 100644 index 71136493..00000000 --- a/Sources/DOMKit/WebIDL/PaymentRequestUpdateEventInit.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentRequestUpdateEventInit: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/PaymentResponse.swift b/Sources/DOMKit/WebIDL/PaymentResponse.swift deleted file mode 100644 index 64ef013b..00000000 --- a/Sources/DOMKit/WebIDL/PaymentResponse.swift +++ /dev/null @@ -1,53 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentResponse: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PaymentResponse].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _requestId = ReadonlyAttribute(jsObject: jsObject, name: Strings.requestId) - _methodName = ReadonlyAttribute(jsObject: jsObject, name: Strings.methodName) - _details = ReadonlyAttribute(jsObject: jsObject, name: Strings.details) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var requestId: String - - @ReadonlyAttribute - public var methodName: String - - @ReadonlyAttribute - public var details: JSObject - - @inlinable public func complete(result: PaymentComplete? = nil) -> JSPromise { - let this = jsObject - return this[Strings.complete].function!(this: this, arguments: [result?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func complete(result: PaymentComplete? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.complete].function!(this: this, arguments: [result?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func retry(errorFields: PaymentValidationErrors? = nil) -> JSPromise { - let this = jsObject - return this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func retry(errorFields: PaymentValidationErrors? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.retry].function!(this: this, arguments: [errorFields?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift b/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift deleted file mode 100644 index dbfbbb6c..00000000 --- a/Sources/DOMKit/WebIDL/PaymentValidationErrors.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PaymentValidationErrors: BridgedDictionary { - public convenience init(error: String, paymentMethod: JSObject) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue - object[Strings.paymentMethod] = paymentMethod.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _error = ReadWriteAttribute(jsObject: object, name: Strings.error) - _paymentMethod = ReadWriteAttribute(jsObject: object, name: Strings.paymentMethod) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var error: String - - @ReadWriteAttribute - public var paymentMethod: JSObject -} diff --git a/Sources/DOMKit/WebIDL/Pbkdf2Params.swift b/Sources/DOMKit/WebIDL/Pbkdf2Params.swift deleted file mode 100644 index e7bbe3d4..00000000 --- a/Sources/DOMKit/WebIDL/Pbkdf2Params.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Pbkdf2Params: BridgedDictionary { - public convenience init(salt: BufferSource, iterations: UInt32, hash: HashAlgorithmIdentifier) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.salt] = salt.jsValue - object[Strings.iterations] = iterations.jsValue - object[Strings.hash] = hash.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _salt = ReadWriteAttribute(jsObject: object, name: Strings.salt) - _iterations = ReadWriteAttribute(jsObject: object, name: Strings.iterations) - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var salt: BufferSource - - @ReadWriteAttribute - public var iterations: UInt32 - - @ReadWriteAttribute - public var hash: HashAlgorithmIdentifier -} diff --git a/Sources/DOMKit/WebIDL/Performance.swift b/Sources/DOMKit/WebIDL/Performance.swift index 798756b9..37f8c687 100644 --- a/Sources/DOMKit/WebIDL/Performance.swift +++ b/Sources/DOMKit/WebIDL/Performance.swift @@ -7,21 +7,10 @@ public class Performance: EventTarget { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Performance].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _eventCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.eventCounts) - _interactionCounts = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionCounts) _timeOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeOrigin) - _timing = ReadonlyAttribute(jsObject: jsObject, name: Strings.timing) - _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) - _onresourcetimingbufferfull = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresourcetimingbufferfull) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var eventCounts: EventCounts - - @ReadonlyAttribute - public var interactionCounts: InteractionCounts - @inlinable public func now() -> DOMHighResTimeStamp { let this = jsObject return this[Strings.now].function!(this: this, arguments: []).fromJSValue()! @@ -34,70 +23,4 @@ public class Performance: EventTarget { let this = jsObject return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! } - - @ReadonlyAttribute - public var timing: PerformanceTiming - - @ReadonlyAttribute - public var navigation: PerformanceNavigation - - @inlinable public func measureUserAgentSpecificMemory() -> JSPromise { - let this = jsObject - return this[Strings.measureUserAgentSpecificMemory].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func measureUserAgentSpecificMemory() async throws -> MemoryMeasurement { - let this = jsObject - let _promise: JSPromise = this[Strings.measureUserAgentSpecificMemory].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getEntries() -> PerformanceEntryList { - let this = jsObject - return this[Strings.getEntries].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getEntriesByType(type: String) -> PerformanceEntryList { - let this = jsObject - return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } - - @inlinable public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { - let this = jsObject - return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue, type?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func clearResourceTimings() { - let this = jsObject - _ = this[Strings.clearResourceTimings].function!(this: this, arguments: []) - } - - @inlinable public func setResourceTimingBufferSize(maxSize: UInt32) { - let this = jsObject - _ = this[Strings.setResourceTimingBufferSize].function!(this: this, arguments: [maxSize.jsValue]) - } - - @ClosureAttribute1Optional - public var onresourcetimingbufferfull: EventHandler - - @inlinable public func mark(markName: String, markOptions: PerformanceMarkOptions? = nil) -> PerformanceMark { - let this = jsObject - return this[Strings.mark].function!(this: this, arguments: [markName.jsValue, markOptions?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func clearMarks(markName: String? = nil) { - let this = jsObject - _ = this[Strings.clearMarks].function!(this: this, arguments: [markName?.jsValue ?? .undefined]) - } - - @inlinable public func measure(measureName: String, startOrMeasureOptions: PerformanceMeasureOptions_or_String? = nil, endMark: String? = nil) -> PerformanceMeasure { - let this = jsObject - return this[Strings.measure].function!(this: this, arguments: [measureName.jsValue, startOrMeasureOptions?.jsValue ?? .undefined, endMark?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func clearMeasures(measureName: String? = nil) { - let this = jsObject - _ = this[Strings.clearMeasures].function!(this: this, arguments: [measureName?.jsValue ?? .undefined]) - } } diff --git a/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift b/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift deleted file mode 100644 index 09c3dc92..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceElementTiming.swift +++ /dev/null @@ -1,53 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceElementTiming: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceElementTiming].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _renderTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderTime) - _loadTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadTime) - _intersectionRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.intersectionRect) - _identifier = ReadonlyAttribute(jsObject: jsObject, name: Strings.identifier) - _naturalWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.naturalWidth) - _naturalHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.naturalHeight) - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _element = ReadonlyAttribute(jsObject: jsObject, name: Strings.element) - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var renderTime: DOMHighResTimeStamp - - @ReadonlyAttribute - public var loadTime: DOMHighResTimeStamp - - @ReadonlyAttribute - public var intersectionRect: DOMRectReadOnly - - @ReadonlyAttribute - public var identifier: String - - @ReadonlyAttribute - public var naturalWidth: UInt32 - - @ReadonlyAttribute - public var naturalHeight: UInt32 - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var element: Element? - - @ReadonlyAttribute - public var url: String - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceEntry.swift b/Sources/DOMKit/WebIDL/PerformanceEntry.swift deleted file mode 100644 index f64bac68..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceEntry.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceEntry: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceEntry].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _entryType = ReadonlyAttribute(jsObject: jsObject, name: Strings.entryType) - _startTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.startTime) - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var entryType: String - - @ReadonlyAttribute - public var startTime: DOMHighResTimeStamp - - @ReadonlyAttribute - public var duration: DOMHighResTimeStamp - - @inlinable public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift b/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift deleted file mode 100644 index 069aae05..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceEventTiming.swift +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceEventTiming: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceEventTiming].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _processingStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.processingStart) - _processingEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.processingEnd) - _cancelable = ReadonlyAttribute(jsObject: jsObject, name: Strings.cancelable) - _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) - _interactionId = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionId) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var processingStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var processingEnd: DOMHighResTimeStamp - - @ReadonlyAttribute - public var cancelable: Bool - - @ReadonlyAttribute - public var target: Node? - - @ReadonlyAttribute - public var interactionId: UInt64 - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift b/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift deleted file mode 100644 index 8c4955a7..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceLongTaskTiming.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceLongTaskTiming: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceLongTaskTiming].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _attribution = ReadonlyAttribute(jsObject: jsObject, name: Strings.attribution) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var attribution: [TaskAttributionTiming] - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceMark.swift b/Sources/DOMKit/WebIDL/PerformanceMark.swift deleted file mode 100644 index dc0871cb..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceMark.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceMark: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceMark].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(markName: String, markOptions: PerformanceMarkOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [markName.jsValue, markOptions?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var detail: JSValue -} diff --git a/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift b/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift deleted file mode 100644 index d5357f14..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceMarkOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceMarkOptions: BridgedDictionary { - public convenience init(detail: JSValue, startTime: DOMHighResTimeStamp) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.detail] = detail.jsValue - object[Strings.startTime] = startTime.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _detail = ReadWriteAttribute(jsObject: object, name: Strings.detail) - _startTime = ReadWriteAttribute(jsObject: object, name: Strings.startTime) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var detail: JSValue - - @ReadWriteAttribute - public var startTime: DOMHighResTimeStamp -} diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasure.swift b/Sources/DOMKit/WebIDL/PerformanceMeasure.swift deleted file mode 100644 index d9966d33..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceMeasure.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceMeasure: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceMeasure].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var detail: JSValue -} diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift deleted file mode 100644 index 73b13ccb..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceMeasureOptions: BridgedDictionary { - public convenience init(detail: JSValue, start: DOMHighResTimeStamp_or_String, duration: DOMHighResTimeStamp, end: DOMHighResTimeStamp_or_String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.detail] = detail.jsValue - object[Strings.start] = start.jsValue - object[Strings.duration] = duration.jsValue - object[Strings.end] = end.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _detail = ReadWriteAttribute(jsObject: object, name: Strings.detail) - _start = ReadWriteAttribute(jsObject: object, name: Strings.start) - _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) - _end = ReadWriteAttribute(jsObject: object, name: Strings.end) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var detail: JSValue - - @ReadWriteAttribute - public var start: DOMHighResTimeStamp_or_String - - @ReadWriteAttribute - public var duration: DOMHighResTimeStamp - - @ReadWriteAttribute - public var end: DOMHighResTimeStamp_or_String -} diff --git a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift b/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift deleted file mode 100644 index 6d968fcc..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceMeasureOptions_or_String.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_PerformanceMeasureOptions_or_String: ConvertibleToJSValue {} -extension PerformanceMeasureOptions: Any_PerformanceMeasureOptions_or_String {} -extension String: Any_PerformanceMeasureOptions_or_String {} - -public enum PerformanceMeasureOptions_or_String: JSValueCompatible, Any_PerformanceMeasureOptions_or_String { - case performanceMeasureOptions(PerformanceMeasureOptions) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let performanceMeasureOptions: PerformanceMeasureOptions = value.fromJSValue() { - return .performanceMeasureOptions(performanceMeasureOptions) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .performanceMeasureOptions(performanceMeasureOptions): - return performanceMeasureOptions.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceNavigation.swift b/Sources/DOMKit/WebIDL/PerformanceNavigation.swift deleted file mode 100644 index 4c398cf7..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceNavigation.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceNavigation: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceNavigation].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _redirectCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectCount) - self.jsObject = jsObject - } - - public static let TYPE_NAVIGATE: UInt16 = 0 - - public static let TYPE_RELOAD: UInt16 = 1 - - public static let TYPE_BACK_FORWARD: UInt16 = 2 - - public static let TYPE_RESERVED: UInt16 = 255 - - @ReadonlyAttribute - public var type: UInt16 - - @ReadonlyAttribute - public var redirectCount: UInt16 - - @inlinable public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift b/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift deleted file mode 100644 index 35c4c998..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceNavigationTiming.swift +++ /dev/null @@ -1,57 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceNavigationTiming: PerformanceResourceTiming { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceNavigationTiming].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _unloadEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.unloadEventStart) - _unloadEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.unloadEventEnd) - _domInteractive = ReadonlyAttribute(jsObject: jsObject, name: Strings.domInteractive) - _domContentLoadedEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.domContentLoadedEventStart) - _domContentLoadedEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.domContentLoadedEventEnd) - _domComplete = ReadonlyAttribute(jsObject: jsObject, name: Strings.domComplete) - _loadEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadEventStart) - _loadEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadEventEnd) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _redirectCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectCount) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var unloadEventStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var unloadEventEnd: DOMHighResTimeStamp - - @ReadonlyAttribute - public var domInteractive: DOMHighResTimeStamp - - @ReadonlyAttribute - public var domContentLoadedEventStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var domContentLoadedEventEnd: DOMHighResTimeStamp - - @ReadonlyAttribute - public var domComplete: DOMHighResTimeStamp - - @ReadonlyAttribute - public var loadEventStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var loadEventEnd: DOMHighResTimeStamp - - @ReadonlyAttribute - public var type: NavigationTimingType - - @ReadonlyAttribute - public var redirectCount: UInt16 - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceObserver.swift b/Sources/DOMKit/WebIDL/PerformanceObserver.swift deleted file mode 100644 index 11dd46d0..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceObserver.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceObserver: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceObserver].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _supportedEntryTypes = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedEntryTypes) - self.jsObject = jsObject - } - - // XXX: constructor is ignored - - @inlinable public func observe(options: PerformanceObserverInit? = nil) { - let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: [options?.jsValue ?? .undefined]) - } - - @inlinable public func disconnect() { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: []) - } - - @inlinable public func takeRecords() -> PerformanceEntryList { - let this = jsObject - return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var supportedEntryTypes: [String] -} diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift b/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift deleted file mode 100644 index 7d89e5db..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceObserverCallbackOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceObserverCallbackOptions: BridgedDictionary { - public convenience init(droppedEntriesCount: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.droppedEntriesCount] = droppedEntriesCount.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _droppedEntriesCount = ReadWriteAttribute(jsObject: object, name: Strings.droppedEntriesCount) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var droppedEntriesCount: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift b/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift deleted file mode 100644 index a0eb0398..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceObserverEntryList.swift +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceObserverEntryList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceObserverEntryList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func getEntries() -> PerformanceEntryList { - let this = jsObject - return this[Strings.getEntries].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getEntriesByType(type: String) -> PerformanceEntryList { - let this = jsObject - return this[Strings.getEntriesByType].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } - - @inlinable public func getEntriesByName(name: String, type: String? = nil) -> PerformanceEntryList { - let this = jsObject - return this[Strings.getEntriesByName].function!(this: this, arguments: [name.jsValue, type?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift b/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift deleted file mode 100644 index 3cf5102f..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceObserverInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceObserverInit: BridgedDictionary { - public convenience init(durationThreshold: DOMHighResTimeStamp, entryTypes: [String], type: String, buffered: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.durationThreshold] = durationThreshold.jsValue - object[Strings.entryTypes] = entryTypes.jsValue - object[Strings.type] = type.jsValue - object[Strings.buffered] = buffered.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _durationThreshold = ReadWriteAttribute(jsObject: object, name: Strings.durationThreshold) - _entryTypes = ReadWriteAttribute(jsObject: object, name: Strings.entryTypes) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _buffered = ReadWriteAttribute(jsObject: object, name: Strings.buffered) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var durationThreshold: DOMHighResTimeStamp - - @ReadWriteAttribute - public var entryTypes: [String] - - @ReadWriteAttribute - public var type: String - - @ReadWriteAttribute - public var buffered: Bool -} diff --git a/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift b/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift deleted file mode 100644 index 78ae13ce..00000000 --- a/Sources/DOMKit/WebIDL/PerformancePaintTiming.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformancePaintTiming: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformancePaintTiming].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift b/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift deleted file mode 100644 index 0e7eade3..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceResourceTiming.swift +++ /dev/null @@ -1,89 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceResourceTiming: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PerformanceResourceTiming].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _initiatorType = ReadonlyAttribute(jsObject: jsObject, name: Strings.initiatorType) - _nextHopProtocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.nextHopProtocol) - _workerStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.workerStart) - _redirectStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectStart) - _redirectEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectEnd) - _fetchStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.fetchStart) - _domainLookupStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.domainLookupStart) - _domainLookupEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.domainLookupEnd) - _connectStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectStart) - _connectEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectEnd) - _secureConnectionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.secureConnectionStart) - _requestStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.requestStart) - _responseStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseStart) - _responseEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseEnd) - _transferSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.transferSize) - _encodedBodySize = ReadonlyAttribute(jsObject: jsObject, name: Strings.encodedBodySize) - _decodedBodySize = ReadonlyAttribute(jsObject: jsObject, name: Strings.decodedBodySize) - _serverTiming = ReadonlyAttribute(jsObject: jsObject, name: Strings.serverTiming) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var initiatorType: String - - @ReadonlyAttribute - public var nextHopProtocol: String - - @ReadonlyAttribute - public var workerStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var redirectStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var redirectEnd: DOMHighResTimeStamp - - @ReadonlyAttribute - public var fetchStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var domainLookupStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var domainLookupEnd: DOMHighResTimeStamp - - @ReadonlyAttribute - public var connectStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var connectEnd: DOMHighResTimeStamp - - @ReadonlyAttribute - public var secureConnectionStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var requestStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var responseStart: DOMHighResTimeStamp - - @ReadonlyAttribute - public var responseEnd: DOMHighResTimeStamp - - @ReadonlyAttribute - public var transferSize: UInt64 - - @ReadonlyAttribute - public var encodedBodySize: UInt64 - - @ReadonlyAttribute - public var decodedBodySize: UInt64 - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var serverTiming: [PerformanceServerTiming] -} diff --git a/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift b/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift deleted file mode 100644 index 13249090..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceServerTiming.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceServerTiming: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceServerTiming].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) - _description = ReadonlyAttribute(jsObject: jsObject, name: Strings.description) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var duration: DOMHighResTimeStamp - - @ReadonlyAttribute - public var description: String - - @inlinable public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PerformanceTiming.swift b/Sources/DOMKit/WebIDL/PerformanceTiming.swift deleted file mode 100644 index 55c9309d..00000000 --- a/Sources/DOMKit/WebIDL/PerformanceTiming.swift +++ /dev/null @@ -1,103 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PerformanceTiming: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PerformanceTiming].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _navigationStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigationStart) - _unloadEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.unloadEventStart) - _unloadEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.unloadEventEnd) - _redirectStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectStart) - _redirectEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.redirectEnd) - _fetchStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.fetchStart) - _domainLookupStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.domainLookupStart) - _domainLookupEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.domainLookupEnd) - _connectStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectStart) - _connectEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectEnd) - _secureConnectionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.secureConnectionStart) - _requestStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.requestStart) - _responseStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseStart) - _responseEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.responseEnd) - _domLoading = ReadonlyAttribute(jsObject: jsObject, name: Strings.domLoading) - _domInteractive = ReadonlyAttribute(jsObject: jsObject, name: Strings.domInteractive) - _domContentLoadedEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.domContentLoadedEventStart) - _domContentLoadedEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.domContentLoadedEventEnd) - _domComplete = ReadonlyAttribute(jsObject: jsObject, name: Strings.domComplete) - _loadEventStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadEventStart) - _loadEventEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.loadEventEnd) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var navigationStart: UInt64 - - @ReadonlyAttribute - public var unloadEventStart: UInt64 - - @ReadonlyAttribute - public var unloadEventEnd: UInt64 - - @ReadonlyAttribute - public var redirectStart: UInt64 - - @ReadonlyAttribute - public var redirectEnd: UInt64 - - @ReadonlyAttribute - public var fetchStart: UInt64 - - @ReadonlyAttribute - public var domainLookupStart: UInt64 - - @ReadonlyAttribute - public var domainLookupEnd: UInt64 - - @ReadonlyAttribute - public var connectStart: UInt64 - - @ReadonlyAttribute - public var connectEnd: UInt64 - - @ReadonlyAttribute - public var secureConnectionStart: UInt64 - - @ReadonlyAttribute - public var requestStart: UInt64 - - @ReadonlyAttribute - public var responseStart: UInt64 - - @ReadonlyAttribute - public var responseEnd: UInt64 - - @ReadonlyAttribute - public var domLoading: UInt64 - - @ReadonlyAttribute - public var domInteractive: UInt64 - - @ReadonlyAttribute - public var domContentLoadedEventStart: UInt64 - - @ReadonlyAttribute - public var domContentLoadedEventEnd: UInt64 - - @ReadonlyAttribute - public var domComplete: UInt64 - - @ReadonlyAttribute - public var loadEventStart: UInt64 - - @ReadonlyAttribute - public var loadEventEnd: UInt64 - - @inlinable public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift b/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift deleted file mode 100644 index 4d3cbe35..00000000 --- a/Sources/DOMKit/WebIDL/PeriodicSyncEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PeriodicSyncEventInit: BridgedDictionary { - public convenience init(tag: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.tag] = tag.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _tag = ReadWriteAttribute(jsObject: object, name: Strings.tag) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var tag: String -} diff --git a/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift b/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift deleted file mode 100644 index ddd8179a..00000000 --- a/Sources/DOMKit/WebIDL/PeriodicSyncManager.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PeriodicSyncManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PeriodicSyncManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func register(tag: String, options: BackgroundSyncOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.register].function!(this: this, arguments: [tag.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func register(tag: String, options: BackgroundSyncOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func getTags() -> JSPromise { - let this = jsObject - return this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getTags() async throws -> [String] { - let this = jsObject - let _promise: JSPromise = this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func unregister(tag: String) -> JSPromise { - let this = jsObject - return this[Strings.unregister].function!(this: this, arguments: [tag.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func unregister(tag: String) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.unregister].function!(this: this, arguments: [tag.jsValue]).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/PeriodicWave.swift b/Sources/DOMKit/WebIDL/PeriodicWave.swift deleted file mode 100644 index ab55c718..00000000 --- a/Sources/DOMKit/WebIDL/PeriodicWave.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PeriodicWave: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PeriodicWave].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(context: BaseAudioContext, options: PeriodicWaveOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } -} diff --git a/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift b/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift deleted file mode 100644 index 2bc37508..00000000 --- a/Sources/DOMKit/WebIDL/PeriodicWaveConstraints.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PeriodicWaveConstraints: BridgedDictionary { - public convenience init(disableNormalization: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.disableNormalization] = disableNormalization.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _disableNormalization = ReadWriteAttribute(jsObject: object, name: Strings.disableNormalization) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var disableNormalization: Bool -} diff --git a/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift b/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift deleted file mode 100644 index 09003cc6..00000000 --- a/Sources/DOMKit/WebIDL/PeriodicWaveOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PeriodicWaveOptions: BridgedDictionary { - public convenience init(real: [Float], imag: [Float]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.real] = real.jsValue - object[Strings.imag] = imag.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _real = ReadWriteAttribute(jsObject: object, name: Strings.real) - _imag = ReadWriteAttribute(jsObject: object, name: Strings.imag) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var real: [Float] - - @ReadWriteAttribute - public var imag: [Float] -} diff --git a/Sources/DOMKit/WebIDL/PermissionDescriptor.swift b/Sources/DOMKit/WebIDL/PermissionDescriptor.swift deleted file mode 100644 index cef25efb..00000000 --- a/Sources/DOMKit/WebIDL/PermissionDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PermissionDescriptor: BridgedDictionary { - public convenience init(name: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String -} diff --git a/Sources/DOMKit/WebIDL/PermissionSetParameters.swift b/Sources/DOMKit/WebIDL/PermissionSetParameters.swift deleted file mode 100644 index f4657869..00000000 --- a/Sources/DOMKit/WebIDL/PermissionSetParameters.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PermissionSetParameters: BridgedDictionary { - public convenience init(descriptor: PermissionDescriptor, state: PermissionState, oneRealm: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.descriptor] = descriptor.jsValue - object[Strings.state] = state.jsValue - object[Strings.oneRealm] = oneRealm.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _descriptor = ReadWriteAttribute(jsObject: object, name: Strings.descriptor) - _state = ReadWriteAttribute(jsObject: object, name: Strings.state) - _oneRealm = ReadWriteAttribute(jsObject: object, name: Strings.oneRealm) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var descriptor: PermissionDescriptor - - @ReadWriteAttribute - public var state: PermissionState - - @ReadWriteAttribute - public var oneRealm: Bool -} diff --git a/Sources/DOMKit/WebIDL/PermissionState.swift b/Sources/DOMKit/WebIDL/PermissionState.swift deleted file mode 100644 index f489d106..00000000 --- a/Sources/DOMKit/WebIDL/PermissionState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum PermissionState: JSString, JSValueCompatible { - case granted = "granted" - case denied = "denied" - case prompt = "prompt" - - @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/PermissionStatus.swift b/Sources/DOMKit/WebIDL/PermissionStatus.swift deleted file mode 100644 index 4effa753..00000000 --- a/Sources/DOMKit/WebIDL/PermissionStatus.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PermissionStatus: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PermissionStatus].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var state: PermissionState - - @ReadonlyAttribute - public var name: String - - @ClosureAttribute1Optional - public var onchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/Permissions.swift b/Sources/DOMKit/WebIDL/Permissions.swift deleted file mode 100644 index 37e98036..00000000 --- a/Sources/DOMKit/WebIDL/Permissions.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Permissions: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Permissions].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func request(permissionDesc: JSObject) -> JSPromise { - let this = jsObject - return this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func request(permissionDesc: JSObject) async throws -> PermissionStatus { - let this = jsObject - let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func revoke(permissionDesc: JSObject) -> JSPromise { - let this = jsObject - return this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func revoke(permissionDesc: JSObject) async throws -> PermissionStatus { - let this = jsObject - let _promise: JSPromise = this[Strings.revoke].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func query(permissionDesc: JSObject) -> JSPromise { - let this = jsObject - return this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func query(permissionDesc: JSObject) async throws -> PermissionStatus { - let this = jsObject - let _promise: JSPromise = this[Strings.query].function!(this: this, arguments: [permissionDesc.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PermissionsPolicy.swift b/Sources/DOMKit/WebIDL/PermissionsPolicy.swift deleted file mode 100644 index b8b7313a..00000000 --- a/Sources/DOMKit/WebIDL/PermissionsPolicy.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PermissionsPolicy: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PermissionsPolicy].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func allowsFeature(feature: String, origin: String? = nil) -> Bool { - let this = jsObject - return this[Strings.allowsFeature].function!(this: this, arguments: [feature.jsValue, origin?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func features() -> [String] { - let this = jsObject - return this[Strings.features].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func allowedFeatures() -> [String] { - let this = jsObject - return this[Strings.allowedFeatures].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getAllowlistForFeature(feature: String) -> [String] { - let this = jsObject - return this[Strings.getAllowlistForFeature].function!(this: this, arguments: [feature.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift b/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift deleted file mode 100644 index dcfd7a2d..00000000 --- a/Sources/DOMKit/WebIDL/PermissionsPolicyViolationReportBody.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PermissionsPolicyViolationReportBody: ReportBody { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PermissionsPolicyViolationReportBody].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _featureId = ReadonlyAttribute(jsObject: jsObject, name: Strings.featureId) - _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) - _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) - _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) - _disposition = ReadonlyAttribute(jsObject: jsObject, name: Strings.disposition) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var featureId: String - - @ReadonlyAttribute - public var sourceFile: String? - - @ReadonlyAttribute - public var lineNumber: Int32? - - @ReadonlyAttribute - public var columnNumber: Int32? - - @ReadonlyAttribute - public var disposition: String -} diff --git a/Sources/DOMKit/WebIDL/PhotoCapabilities.swift b/Sources/DOMKit/WebIDL/PhotoCapabilities.swift deleted file mode 100644 index e69bda84..00000000 --- a/Sources/DOMKit/WebIDL/PhotoCapabilities.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PhotoCapabilities: BridgedDictionary { - public convenience init(redEyeReduction: RedEyeReduction, imageHeight: MediaSettingsRange, imageWidth: MediaSettingsRange, fillLightMode: [FillLightMode]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.redEyeReduction] = redEyeReduction.jsValue - object[Strings.imageHeight] = imageHeight.jsValue - object[Strings.imageWidth] = imageWidth.jsValue - object[Strings.fillLightMode] = fillLightMode.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _redEyeReduction = ReadWriteAttribute(jsObject: object, name: Strings.redEyeReduction) - _imageHeight = ReadWriteAttribute(jsObject: object, name: Strings.imageHeight) - _imageWidth = ReadWriteAttribute(jsObject: object, name: Strings.imageWidth) - _fillLightMode = ReadWriteAttribute(jsObject: object, name: Strings.fillLightMode) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var redEyeReduction: RedEyeReduction - - @ReadWriteAttribute - public var imageHeight: MediaSettingsRange - - @ReadWriteAttribute - public var imageWidth: MediaSettingsRange - - @ReadWriteAttribute - public var fillLightMode: [FillLightMode] -} diff --git a/Sources/DOMKit/WebIDL/PhotoSettings.swift b/Sources/DOMKit/WebIDL/PhotoSettings.swift deleted file mode 100644 index 5438662d..00000000 --- a/Sources/DOMKit/WebIDL/PhotoSettings.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PhotoSettings: BridgedDictionary { - public convenience init(fillLightMode: FillLightMode, imageHeight: Double, imageWidth: Double, redEyeReduction: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fillLightMode] = fillLightMode.jsValue - object[Strings.imageHeight] = imageHeight.jsValue - object[Strings.imageWidth] = imageWidth.jsValue - object[Strings.redEyeReduction] = redEyeReduction.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _fillLightMode = ReadWriteAttribute(jsObject: object, name: Strings.fillLightMode) - _imageHeight = ReadWriteAttribute(jsObject: object, name: Strings.imageHeight) - _imageWidth = ReadWriteAttribute(jsObject: object, name: Strings.imageWidth) - _redEyeReduction = ReadWriteAttribute(jsObject: object, name: Strings.redEyeReduction) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var fillLightMode: FillLightMode - - @ReadWriteAttribute - public var imageHeight: Double - - @ReadWriteAttribute - public var imageWidth: Double - - @ReadWriteAttribute - public var redEyeReduction: Bool -} diff --git a/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift b/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift deleted file mode 100644 index 1919f26c..00000000 --- a/Sources/DOMKit/WebIDL/PictureInPictureEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PictureInPictureEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PictureInPictureEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _pictureInPictureWindow = ReadonlyAttribute(jsObject: jsObject, name: Strings.pictureInPictureWindow) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: PictureInPictureEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var pictureInPictureWindow: PictureInPictureWindow -} diff --git a/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift b/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift deleted file mode 100644 index bc85af6b..00000000 --- a/Sources/DOMKit/WebIDL/PictureInPictureEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PictureInPictureEventInit: BridgedDictionary { - public convenience init(pictureInPictureWindow: PictureInPictureWindow) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.pictureInPictureWindow] = pictureInPictureWindow.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _pictureInPictureWindow = ReadWriteAttribute(jsObject: object, name: Strings.pictureInPictureWindow) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var pictureInPictureWindow: PictureInPictureWindow -} diff --git a/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift b/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift deleted file mode 100644 index 1bb55bcc..00000000 --- a/Sources/DOMKit/WebIDL/PictureInPictureWindow.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PictureInPictureWindow: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PictureInPictureWindow].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _onresize = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresize) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var width: Int32 - - @ReadonlyAttribute - public var height: Int32 - - @ClosureAttribute1Optional - public var onresize: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/Point2D.swift b/Sources/DOMKit/WebIDL/Point2D.swift deleted file mode 100644 index d6c0ebcb..00000000 --- a/Sources/DOMKit/WebIDL/Point2D.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Point2D: BridgedDictionary { - public convenience init(x: Double, y: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var x: Double - - @ReadWriteAttribute - public var y: Double -} diff --git a/Sources/DOMKit/WebIDL/PointerEvent.swift b/Sources/DOMKit/WebIDL/PointerEvent.swift deleted file mode 100644 index 4bc22c5e..00000000 --- a/Sources/DOMKit/WebIDL/PointerEvent.swift +++ /dev/null @@ -1,74 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PointerEvent: MouseEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PointerEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _pointerId = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointerId) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _pressure = ReadonlyAttribute(jsObject: jsObject, name: Strings.pressure) - _tangentialPressure = ReadonlyAttribute(jsObject: jsObject, name: Strings.tangentialPressure) - _tiltX = ReadonlyAttribute(jsObject: jsObject, name: Strings.tiltX) - _tiltY = ReadonlyAttribute(jsObject: jsObject, name: Strings.tiltY) - _twist = ReadonlyAttribute(jsObject: jsObject, name: Strings.twist) - _altitudeAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitudeAngle) - _azimuthAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.azimuthAngle) - _pointerType = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointerType) - _isPrimary = ReadonlyAttribute(jsObject: jsObject, name: Strings.isPrimary) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: PointerEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var pointerId: Int32 - - @ReadonlyAttribute - public var width: Double - - @ReadonlyAttribute - public var height: Double - - @ReadonlyAttribute - public var pressure: Float - - @ReadonlyAttribute - public var tangentialPressure: Float - - @ReadonlyAttribute - public var tiltX: Int32 - - @ReadonlyAttribute - public var tiltY: Int32 - - @ReadonlyAttribute - public var twist: Int32 - - @ReadonlyAttribute - public var altitudeAngle: Double - - @ReadonlyAttribute - public var azimuthAngle: Double - - @ReadonlyAttribute - public var pointerType: String - - @ReadonlyAttribute - public var isPrimary: Bool - - @inlinable public func getCoalescedEvents() -> [PointerEvent] { - let this = jsObject - return this[Strings.getCoalescedEvents].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getPredictedEvents() -> [PointerEvent] { - let this = jsObject - return this[Strings.getPredictedEvents].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PointerEventInit.swift b/Sources/DOMKit/WebIDL/PointerEventInit.swift deleted file mode 100644 index e50dd406..00000000 --- a/Sources/DOMKit/WebIDL/PointerEventInit.swift +++ /dev/null @@ -1,85 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PointerEventInit: BridgedDictionary { - public convenience init(pointerId: Int32, width: Double, height: Double, pressure: Float, tangentialPressure: Float, tiltX: Int32, tiltY: Int32, twist: Int32, altitudeAngle: Double, azimuthAngle: Double, pointerType: String, isPrimary: Bool, coalescedEvents: [PointerEvent], predictedEvents: [PointerEvent]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.pointerId] = pointerId.jsValue - object[Strings.width] = width.jsValue - object[Strings.height] = height.jsValue - object[Strings.pressure] = pressure.jsValue - object[Strings.tangentialPressure] = tangentialPressure.jsValue - object[Strings.tiltX] = tiltX.jsValue - object[Strings.tiltY] = tiltY.jsValue - object[Strings.twist] = twist.jsValue - object[Strings.altitudeAngle] = altitudeAngle.jsValue - object[Strings.azimuthAngle] = azimuthAngle.jsValue - object[Strings.pointerType] = pointerType.jsValue - object[Strings.isPrimary] = isPrimary.jsValue - object[Strings.coalescedEvents] = coalescedEvents.jsValue - object[Strings.predictedEvents] = predictedEvents.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _pointerId = ReadWriteAttribute(jsObject: object, name: Strings.pointerId) - _width = ReadWriteAttribute(jsObject: object, name: Strings.width) - _height = ReadWriteAttribute(jsObject: object, name: Strings.height) - _pressure = ReadWriteAttribute(jsObject: object, name: Strings.pressure) - _tangentialPressure = ReadWriteAttribute(jsObject: object, name: Strings.tangentialPressure) - _tiltX = ReadWriteAttribute(jsObject: object, name: Strings.tiltX) - _tiltY = ReadWriteAttribute(jsObject: object, name: Strings.tiltY) - _twist = ReadWriteAttribute(jsObject: object, name: Strings.twist) - _altitudeAngle = ReadWriteAttribute(jsObject: object, name: Strings.altitudeAngle) - _azimuthAngle = ReadWriteAttribute(jsObject: object, name: Strings.azimuthAngle) - _pointerType = ReadWriteAttribute(jsObject: object, name: Strings.pointerType) - _isPrimary = ReadWriteAttribute(jsObject: object, name: Strings.isPrimary) - _coalescedEvents = ReadWriteAttribute(jsObject: object, name: Strings.coalescedEvents) - _predictedEvents = ReadWriteAttribute(jsObject: object, name: Strings.predictedEvents) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var pointerId: Int32 - - @ReadWriteAttribute - public var width: Double - - @ReadWriteAttribute - public var height: Double - - @ReadWriteAttribute - public var pressure: Float - - @ReadWriteAttribute - public var tangentialPressure: Float - - @ReadWriteAttribute - public var tiltX: Int32 - - @ReadWriteAttribute - public var tiltY: Int32 - - @ReadWriteAttribute - public var twist: Int32 - - @ReadWriteAttribute - public var altitudeAngle: Double - - @ReadWriteAttribute - public var azimuthAngle: Double - - @ReadWriteAttribute - public var pointerType: String - - @ReadWriteAttribute - public var isPrimary: Bool - - @ReadWriteAttribute - public var coalescedEvents: [PointerEvent] - - @ReadWriteAttribute - public var predictedEvents: [PointerEvent] -} diff --git a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift b/Sources/DOMKit/WebIDL/PortalActivateEvent.swift deleted file mode 100644 index 72643da9..00000000 --- a/Sources/DOMKit/WebIDL/PortalActivateEvent.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PortalActivateEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PortalActivateEvent].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: PortalActivateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var data: JSValue - - @inlinable public func adoptPredecessor() -> HTMLPortalElement { - let this = jsObject - return this[Strings.adoptPredecessor].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift b/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift deleted file mode 100644 index a3b719e5..00000000 --- a/Sources/DOMKit/WebIDL/PortalActivateEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PortalActivateEventInit: BridgedDictionary { - public convenience init(data: JSValue) { - 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: JSValue -} diff --git a/Sources/DOMKit/WebIDL/PortalActivateOptions.swift b/Sources/DOMKit/WebIDL/PortalActivateOptions.swift deleted file mode 100644 index 908d6e88..00000000 --- a/Sources/DOMKit/WebIDL/PortalActivateOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PortalActivateOptions: BridgedDictionary { - public convenience init(data: JSValue) { - 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: JSValue -} diff --git a/Sources/DOMKit/WebIDL/PortalHost.swift b/Sources/DOMKit/WebIDL/PortalHost.swift deleted file mode 100644 index fc38d513..00000000 --- a/Sources/DOMKit/WebIDL/PortalHost.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PortalHost: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PortalHost].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func postMessage(message: JSValue, options: StructuredSerializeOptions? = nil) { - let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue, options?.jsValue ?? .undefined]) - } - - @ClosureAttribute1Optional - public var onmessage: EventHandler - - @ClosureAttribute1Optional - public var onmessageerror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/PositionAlignSetting.swift b/Sources/DOMKit/WebIDL/PositionAlignSetting.swift deleted file mode 100644 index 22e63c56..00000000 --- a/Sources/DOMKit/WebIDL/PositionAlignSetting.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum PositionAlignSetting: JSString, JSValueCompatible { - case lineLeft = "line-left" - case center = "center" - case lineRight = "line-right" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/PositionOptions.swift b/Sources/DOMKit/WebIDL/PositionOptions.swift deleted file mode 100644 index 1dcc13af..00000000 --- a/Sources/DOMKit/WebIDL/PositionOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PositionOptions: BridgedDictionary { - public convenience init(enableHighAccuracy: Bool, timeout: UInt32, maximumAge: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.enableHighAccuracy] = enableHighAccuracy.jsValue - object[Strings.timeout] = timeout.jsValue - object[Strings.maximumAge] = maximumAge.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _enableHighAccuracy = ReadWriteAttribute(jsObject: object, name: Strings.enableHighAccuracy) - _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) - _maximumAge = ReadWriteAttribute(jsObject: object, name: Strings.maximumAge) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var enableHighAccuracy: Bool - - @ReadWriteAttribute - public var timeout: UInt32 - - @ReadWriteAttribute - public var maximumAge: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/Presentation.swift b/Sources/DOMKit/WebIDL/Presentation.swift deleted file mode 100644 index 1229fa7a..00000000 --- a/Sources/DOMKit/WebIDL/Presentation.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Presentation: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Presentation].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _defaultRequest = ReadWriteAttribute(jsObject: jsObject, name: Strings.defaultRequest) - _receiver = ReadonlyAttribute(jsObject: jsObject, name: Strings.receiver) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var defaultRequest: PresentationRequest? - - @ReadonlyAttribute - public var receiver: PresentationReceiver? -} diff --git a/Sources/DOMKit/WebIDL/PresentationAvailability.swift b/Sources/DOMKit/WebIDL/PresentationAvailability.swift deleted file mode 100644 index 32f52325..00000000 --- a/Sources/DOMKit/WebIDL/PresentationAvailability.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PresentationAvailability: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationAvailability].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var value: Bool - - @ClosureAttribute1Optional - public var onchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/PresentationConnection.swift b/Sources/DOMKit/WebIDL/PresentationConnection.swift deleted file mode 100644 index 7bcae7d9..00000000 --- a/Sources/DOMKit/WebIDL/PresentationConnection.swift +++ /dev/null @@ -1,74 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PresentationConnection: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnection].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) - _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) - _onterminate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onterminate) - _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) - _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var url: String - - @ReadonlyAttribute - public var state: PresentationConnectionState - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @inlinable public func terminate() { - let this = jsObject - _ = this[Strings.terminate].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var onconnect: EventHandler - - @ClosureAttribute1Optional - public var onclose: EventHandler - - @ClosureAttribute1Optional - public var onterminate: EventHandler - - @ReadWriteAttribute - public var binaryType: BinaryType - - @ClosureAttribute1Optional - public var onmessage: EventHandler - - @inlinable public func send(message: String) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [message.jsValue]) - } - - @inlinable public func send(data: Blob) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) - } - - @inlinable public func send(data: ArrayBuffer) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) - } - - @inlinable public func send(data: ArrayBufferView) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift deleted file mode 100644 index 81794a1f..00000000 --- a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PresentationConnectionAvailableEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionAvailableEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _connection = ReadonlyAttribute(jsObject: jsObject, name: Strings.connection) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: PresentationConnectionAvailableEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var connection: PresentationConnection -} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift b/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift deleted file mode 100644 index 9a308724..00000000 --- a/Sources/DOMKit/WebIDL/PresentationConnectionAvailableEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PresentationConnectionAvailableEventInit: BridgedDictionary { - public convenience init(connection: PresentationConnection) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.connection] = connection.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _connection = ReadWriteAttribute(jsObject: object, name: Strings.connection) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var connection: PresentationConnection -} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift deleted file mode 100644 index d2b1fd07..00000000 --- a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PresentationConnectionCloseEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionCloseEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _reason = ReadonlyAttribute(jsObject: jsObject, name: Strings.reason) - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: PresentationConnectionCloseEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var reason: PresentationConnectionCloseReason - - @ReadonlyAttribute - public var message: String -} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift deleted file mode 100644 index 42d64e87..00000000 --- a/Sources/DOMKit/WebIDL/PresentationConnectionCloseEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PresentationConnectionCloseEventInit: BridgedDictionary { - public convenience init(reason: PresentationConnectionCloseReason, message: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.reason] = reason.jsValue - object[Strings.message] = message.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _reason = ReadWriteAttribute(jsObject: object, name: Strings.reason) - _message = ReadWriteAttribute(jsObject: object, name: Strings.message) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var reason: PresentationConnectionCloseReason - - @ReadWriteAttribute - public var message: String -} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift b/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift deleted file mode 100644 index 5555165e..00000000 --- a/Sources/DOMKit/WebIDL/PresentationConnectionCloseReason.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum PresentationConnectionCloseReason: JSString, JSValueCompatible { - case error = "error" - case closed = "closed" - case wentaway = "wentaway" - - @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/PresentationConnectionList.swift b/Sources/DOMKit/WebIDL/PresentationConnectionList.swift deleted file mode 100644 index 3421ded4..00000000 --- a/Sources/DOMKit/WebIDL/PresentationConnectionList.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PresentationConnectionList: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationConnectionList].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _connections = ReadonlyAttribute(jsObject: jsObject, name: Strings.connections) - _onconnectionavailable = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnectionavailable) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var connections: [PresentationConnection] - - @ClosureAttribute1Optional - public var onconnectionavailable: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/PresentationConnectionState.swift b/Sources/DOMKit/WebIDL/PresentationConnectionState.swift deleted file mode 100644 index 03ad68ed..00000000 --- a/Sources/DOMKit/WebIDL/PresentationConnectionState.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum PresentationConnectionState: JSString, JSValueCompatible { - case connecting = "connecting" - case connected = "connected" - case closed = "closed" - case terminated = "terminated" - - @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/PresentationReceiver.swift b/Sources/DOMKit/WebIDL/PresentationReceiver.swift deleted file mode 100644 index 500a35da..00000000 --- a/Sources/DOMKit/WebIDL/PresentationReceiver.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PresentationReceiver: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PresentationReceiver].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _connectionList = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectionList) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var connectionList: JSPromise -} diff --git a/Sources/DOMKit/WebIDL/PresentationRequest.swift b/Sources/DOMKit/WebIDL/PresentationRequest.swift deleted file mode 100644 index 92f56495..00000000 --- a/Sources/DOMKit/WebIDL/PresentationRequest.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PresentationRequest: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PresentationRequest].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onconnectionavailable = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnectionavailable) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(url: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue])) - } - - @inlinable public convenience init(urls: [String]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [urls.jsValue])) - } - - @inlinable public func start() -> JSPromise { - let this = jsObject - return this[Strings.start].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func start() async throws -> PresentationConnection { - let this = jsObject - let _promise: JSPromise = this[Strings.start].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func reconnect(presentationId: String) -> JSPromise { - let this = jsObject - return this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func reconnect(presentationId: String) async throws -> PresentationConnection { - let this = jsObject - let _promise: JSPromise = this[Strings.reconnect].function!(this: this, arguments: [presentationId.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getAvailability() -> JSPromise { - let this = jsObject - return this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getAvailability() async throws -> PresentationAvailability { - let this = jsObject - let _promise: JSPromise = this[Strings.getAvailability].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ClosureAttribute1Optional - public var onconnectionavailable: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/PresentationStyle.swift b/Sources/DOMKit/WebIDL/PresentationStyle.swift deleted file mode 100644 index 5764ca11..00000000 --- a/Sources/DOMKit/WebIDL/PresentationStyle.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum PresentationStyle: JSString, JSValueCompatible { - case unspecified = "unspecified" - case inline = "inline" - case attachment = "attachment" - - @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/Profiler.swift b/Sources/DOMKit/WebIDL/Profiler.swift deleted file mode 100644 index 8f963b4a..00000000 --- a/Sources/DOMKit/WebIDL/Profiler.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Profiler: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Profiler].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _sampleInterval = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleInterval) - _stopped = ReadonlyAttribute(jsObject: jsObject, name: Strings.stopped) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var sampleInterval: DOMHighResTimeStamp - - @ReadonlyAttribute - public var stopped: Bool - - @inlinable public convenience init(options: ProfilerInitOptions) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options.jsValue])) - } - - @inlinable public func stop() -> JSPromise { - let this = jsObject - return this[Strings.stop].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func stop() async throws -> ProfilerTrace { - let this = jsObject - let _promise: JSPromise = this[Strings.stop].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ProfilerFrame.swift b/Sources/DOMKit/WebIDL/ProfilerFrame.swift deleted file mode 100644 index 3afdbfa9..00000000 --- a/Sources/DOMKit/WebIDL/ProfilerFrame.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ProfilerFrame: BridgedDictionary { - public convenience init(name: String, resourceId: UInt64, line: UInt64, column: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.resourceId] = resourceId.jsValue - object[Strings.line] = line.jsValue - object[Strings.column] = column.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _resourceId = ReadWriteAttribute(jsObject: object, name: Strings.resourceId) - _line = ReadWriteAttribute(jsObject: object, name: Strings.line) - _column = ReadWriteAttribute(jsObject: object, name: Strings.column) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var resourceId: UInt64 - - @ReadWriteAttribute - public var line: UInt64 - - @ReadWriteAttribute - public var column: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift b/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift deleted file mode 100644 index 95cc0e2c..00000000 --- a/Sources/DOMKit/WebIDL/ProfilerInitOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ProfilerInitOptions: BridgedDictionary { - public convenience init(sampleInterval: DOMHighResTimeStamp, maxBufferSize: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sampleInterval] = sampleInterval.jsValue - object[Strings.maxBufferSize] = maxBufferSize.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _sampleInterval = ReadWriteAttribute(jsObject: object, name: Strings.sampleInterval) - _maxBufferSize = ReadWriteAttribute(jsObject: object, name: Strings.maxBufferSize) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var sampleInterval: DOMHighResTimeStamp - - @ReadWriteAttribute - public var maxBufferSize: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/ProfilerSample.swift b/Sources/DOMKit/WebIDL/ProfilerSample.swift deleted file mode 100644 index 2e25a30a..00000000 --- a/Sources/DOMKit/WebIDL/ProfilerSample.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ProfilerSample: BridgedDictionary { - public convenience init(timestamp: DOMHighResTimeStamp, stackId: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue - object[Strings.stackId] = stackId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _stackId = ReadWriteAttribute(jsObject: object, name: Strings.stackId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var timestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var stackId: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/ProfilerStack.swift b/Sources/DOMKit/WebIDL/ProfilerStack.swift deleted file mode 100644 index 3ff4f1c8..00000000 --- a/Sources/DOMKit/WebIDL/ProfilerStack.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ProfilerStack: BridgedDictionary { - public convenience init(parentId: UInt64, frameId: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.parentId] = parentId.jsValue - object[Strings.frameId] = frameId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _parentId = ReadWriteAttribute(jsObject: object, name: Strings.parentId) - _frameId = ReadWriteAttribute(jsObject: object, name: Strings.frameId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var parentId: UInt64 - - @ReadWriteAttribute - public var frameId: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/ProfilerTrace.swift b/Sources/DOMKit/WebIDL/ProfilerTrace.swift deleted file mode 100644 index 6686b6ab..00000000 --- a/Sources/DOMKit/WebIDL/ProfilerTrace.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ProfilerTrace: BridgedDictionary { - public convenience init(resources: [ProfilerResource], frames: [ProfilerFrame], stacks: [ProfilerStack], samples: [ProfilerSample]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.resources] = resources.jsValue - object[Strings.frames] = frames.jsValue - object[Strings.stacks] = stacks.jsValue - object[Strings.samples] = samples.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _resources = ReadWriteAttribute(jsObject: object, name: Strings.resources) - _frames = ReadWriteAttribute(jsObject: object, name: Strings.frames) - _stacks = ReadWriteAttribute(jsObject: object, name: Strings.stacks) - _samples = ReadWriteAttribute(jsObject: object, name: Strings.samples) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var resources: [ProfilerResource] - - @ReadWriteAttribute - public var frames: [ProfilerFrame] - - @ReadWriteAttribute - public var stacks: [ProfilerStack] - - @ReadWriteAttribute - public var samples: [ProfilerSample] -} diff --git a/Sources/DOMKit/WebIDL/PromptResponseObject.swift b/Sources/DOMKit/WebIDL/PromptResponseObject.swift deleted file mode 100644 index cd5bf515..00000000 --- a/Sources/DOMKit/WebIDL/PromptResponseObject.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PromptResponseObject: BridgedDictionary { - public convenience init(userChoice: AppBannerPromptOutcome) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.userChoice] = userChoice.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _userChoice = ReadWriteAttribute(jsObject: object, name: Strings.userChoice) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var userChoice: AppBannerPromptOutcome -} diff --git a/Sources/DOMKit/WebIDL/PropertyDefinition.swift b/Sources/DOMKit/WebIDL/PropertyDefinition.swift deleted file mode 100644 index 33d2381c..00000000 --- a/Sources/DOMKit/WebIDL/PropertyDefinition.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PropertyDefinition: BridgedDictionary { - public convenience init(name: String, syntax: String, inherits: Bool, initialValue: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - object[Strings.syntax] = syntax.jsValue - object[Strings.inherits] = inherits.jsValue - object[Strings.initialValue] = initialValue.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - _syntax = ReadWriteAttribute(jsObject: object, name: Strings.syntax) - _inherits = ReadWriteAttribute(jsObject: object, name: Strings.inherits) - _initialValue = ReadWriteAttribute(jsObject: object, name: Strings.initialValue) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String - - @ReadWriteAttribute - public var syntax: String - - @ReadWriteAttribute - public var inherits: Bool - - @ReadWriteAttribute - public var initialValue: String -} diff --git a/Sources/DOMKit/WebIDL/ProximityReadingValues.swift b/Sources/DOMKit/WebIDL/ProximityReadingValues.swift deleted file mode 100644 index 7ace10f0..00000000 --- a/Sources/DOMKit/WebIDL/ProximityReadingValues.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ProximityReadingValues: BridgedDictionary { - public convenience init(distance: Double?, max: Double?, near: Bool?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.distance] = distance.jsValue - object[Strings.max] = max.jsValue - object[Strings.near] = near.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _distance = ReadWriteAttribute(jsObject: object, name: Strings.distance) - _max = ReadWriteAttribute(jsObject: object, name: Strings.max) - _near = ReadWriteAttribute(jsObject: object, name: Strings.near) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var distance: Double? - - @ReadWriteAttribute - public var max: Double? - - @ReadWriteAttribute - public var near: Bool? -} diff --git a/Sources/DOMKit/WebIDL/ProximitySensor.swift b/Sources/DOMKit/WebIDL/ProximitySensor.swift deleted file mode 100644 index 596ab4ee..00000000 --- a/Sources/DOMKit/WebIDL/ProximitySensor.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ProximitySensor: Sensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ProximitySensor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _distance = ReadonlyAttribute(jsObject: jsObject, name: Strings.distance) - _max = ReadonlyAttribute(jsObject: jsObject, name: Strings.max) - _near = ReadonlyAttribute(jsObject: jsObject, name: Strings.near) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(sensorOptions: SensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var distance: Double? - - @ReadonlyAttribute - public var max: Double? - - @ReadonlyAttribute - public var near: Bool? -} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredential.swift b/Sources/DOMKit/WebIDL/PublicKeyCredential.swift deleted file mode 100644 index ef10d677..00000000 --- a/Sources/DOMKit/WebIDL/PublicKeyCredential.swift +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PublicKeyCredential: Credential { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PublicKeyCredential].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _rawId = ReadonlyAttribute(jsObject: jsObject, name: Strings.rawId) - _response = ReadonlyAttribute(jsObject: jsObject, name: Strings.response) - _authenticatorAttachment = ReadonlyAttribute(jsObject: jsObject, name: Strings.authenticatorAttachment) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var rawId: ArrayBuffer - - @ReadonlyAttribute - public var response: AuthenticatorResponse - - @ReadonlyAttribute - public var authenticatorAttachment: String? - - @inlinable public func getClientExtensionResults() -> AuthenticationExtensionsClientOutputs { - let this = jsObject - return this[Strings.getClientExtensionResults].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public static func isUserVerifyingPlatformAuthenticatorAvailable() -> JSPromise { - let this = constructor - return this[Strings.isUserVerifyingPlatformAuthenticatorAvailable].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func isUserVerifyingPlatformAuthenticatorAvailable() async throws -> Bool { - let this = constructor - let _promise: JSPromise = this[Strings.isUserVerifyingPlatformAuthenticatorAvailable].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift deleted file mode 100644 index 21f152a8..00000000 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialCreationOptions.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PublicKeyCredentialCreationOptions: BridgedDictionary { - public convenience init(rp: PublicKeyCredentialRpEntity, user: PublicKeyCredentialUserEntity, challenge: BufferSource, pubKeyCredParams: [PublicKeyCredentialParameters], timeout: UInt32, excludeCredentials: [PublicKeyCredentialDescriptor], authenticatorSelection: AuthenticatorSelectionCriteria, attestation: String, extensions: AuthenticationExtensionsClientInputs) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rp] = rp.jsValue - object[Strings.user] = user.jsValue - object[Strings.challenge] = challenge.jsValue - object[Strings.pubKeyCredParams] = pubKeyCredParams.jsValue - object[Strings.timeout] = timeout.jsValue - object[Strings.excludeCredentials] = excludeCredentials.jsValue - object[Strings.authenticatorSelection] = authenticatorSelection.jsValue - object[Strings.attestation] = attestation.jsValue - object[Strings.extensions] = extensions.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _rp = ReadWriteAttribute(jsObject: object, name: Strings.rp) - _user = ReadWriteAttribute(jsObject: object, name: Strings.user) - _challenge = ReadWriteAttribute(jsObject: object, name: Strings.challenge) - _pubKeyCredParams = ReadWriteAttribute(jsObject: object, name: Strings.pubKeyCredParams) - _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) - _excludeCredentials = ReadWriteAttribute(jsObject: object, name: Strings.excludeCredentials) - _authenticatorSelection = ReadWriteAttribute(jsObject: object, name: Strings.authenticatorSelection) - _attestation = ReadWriteAttribute(jsObject: object, name: Strings.attestation) - _extensions = ReadWriteAttribute(jsObject: object, name: Strings.extensions) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var rp: PublicKeyCredentialRpEntity - - @ReadWriteAttribute - public var user: PublicKeyCredentialUserEntity - - @ReadWriteAttribute - public var challenge: BufferSource - - @ReadWriteAttribute - public var pubKeyCredParams: [PublicKeyCredentialParameters] - - @ReadWriteAttribute - public var timeout: UInt32 - - @ReadWriteAttribute - public var excludeCredentials: [PublicKeyCredentialDescriptor] - - @ReadWriteAttribute - public var authenticatorSelection: AuthenticatorSelectionCriteria - - @ReadWriteAttribute - public var attestation: String - - @ReadWriteAttribute - public var extensions: AuthenticationExtensionsClientInputs -} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift deleted file mode 100644 index d6422cd9..00000000 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialDescriptor.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PublicKeyCredentialDescriptor: BridgedDictionary { - public convenience init(type: String, id: BufferSource, transports: [String]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.id] = id.jsValue - object[Strings.transports] = transports.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _transports = ReadWriteAttribute(jsObject: object, name: Strings.transports) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: String - - @ReadWriteAttribute - public var id: BufferSource - - @ReadWriteAttribute - public var transports: [String] -} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift deleted file mode 100644 index 9f55a975..00000000 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialEntity.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PublicKeyCredentialEntity: BridgedDictionary { - public convenience init(name: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.name] = name.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var name: String -} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift deleted file mode 100644 index 9cb6982b..00000000 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialParameters.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PublicKeyCredentialParameters: BridgedDictionary { - public convenience init(type: String, alg: COSEAlgorithmIdentifier) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.alg] = alg.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _alg = ReadWriteAttribute(jsObject: object, name: Strings.alg) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: String - - @ReadWriteAttribute - public var alg: COSEAlgorithmIdentifier -} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift deleted file mode 100644 index 6725591f..00000000 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialRequestOptions.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PublicKeyCredentialRequestOptions: BridgedDictionary { - public convenience init(challenge: BufferSource, timeout: UInt32, rpId: String, allowCredentials: [PublicKeyCredentialDescriptor], userVerification: String, extensions: AuthenticationExtensionsClientInputs) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.challenge] = challenge.jsValue - object[Strings.timeout] = timeout.jsValue - object[Strings.rpId] = rpId.jsValue - object[Strings.allowCredentials] = allowCredentials.jsValue - object[Strings.userVerification] = userVerification.jsValue - object[Strings.extensions] = extensions.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _challenge = ReadWriteAttribute(jsObject: object, name: Strings.challenge) - _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) - _rpId = ReadWriteAttribute(jsObject: object, name: Strings.rpId) - _allowCredentials = ReadWriteAttribute(jsObject: object, name: Strings.allowCredentials) - _userVerification = ReadWriteAttribute(jsObject: object, name: Strings.userVerification) - _extensions = ReadWriteAttribute(jsObject: object, name: Strings.extensions) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var challenge: BufferSource - - @ReadWriteAttribute - public var timeout: UInt32 - - @ReadWriteAttribute - public var rpId: String - - @ReadWriteAttribute - public var allowCredentials: [PublicKeyCredentialDescriptor] - - @ReadWriteAttribute - public var userVerification: String - - @ReadWriteAttribute - public var extensions: AuthenticationExtensionsClientInputs -} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift deleted file mode 100644 index 692072af..00000000 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialRpEntity.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PublicKeyCredentialRpEntity: BridgedDictionary { - public convenience init(id: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var id: String -} diff --git a/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift deleted file mode 100644 index e7063638..00000000 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialType.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum PublicKeyCredentialType: JSString, JSValueCompatible { - case publicKey = "public-key" - - @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/PublicKeyCredentialUserEntity.swift b/Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift deleted file mode 100644 index c6914abd..00000000 --- a/Sources/DOMKit/WebIDL/PublicKeyCredentialUserEntity.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PublicKeyCredentialUserEntity: BridgedDictionary { - public convenience init(id: BufferSource, displayName: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.id] = id.jsValue - object[Strings.displayName] = displayName.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _displayName = ReadWriteAttribute(jsObject: object, name: Strings.displayName) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var id: BufferSource - - @ReadWriteAttribute - public var displayName: String -} diff --git a/Sources/DOMKit/WebIDL/PurchaseDetails.swift b/Sources/DOMKit/WebIDL/PurchaseDetails.swift deleted file mode 100644 index c2663a90..00000000 --- a/Sources/DOMKit/WebIDL/PurchaseDetails.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PurchaseDetails: BridgedDictionary { - public convenience init(itemId: String, purchaseToken: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.itemId] = itemId.jsValue - object[Strings.purchaseToken] = purchaseToken.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _itemId = ReadWriteAttribute(jsObject: object, name: Strings.itemId) - _purchaseToken = ReadWriteAttribute(jsObject: object, name: Strings.purchaseToken) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var itemId: String - - @ReadWriteAttribute - public var purchaseToken: String -} diff --git a/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift b/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift deleted file mode 100644 index 11ef116c..00000000 --- a/Sources/DOMKit/WebIDL/PushEncryptionKeyName.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum PushEncryptionKeyName: JSString, JSValueCompatible { - case p256dh = "p256dh" - case auth = "auth" - - @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/PushEventInit.swift b/Sources/DOMKit/WebIDL/PushEventInit.swift deleted file mode 100644 index 99e75582..00000000 --- a/Sources/DOMKit/WebIDL/PushEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushEventInit: BridgedDictionary { - public convenience init(data: PushMessageDataInit) { - 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: PushMessageDataInit -} diff --git a/Sources/DOMKit/WebIDL/PushManager.swift b/Sources/DOMKit/WebIDL/PushManager.swift deleted file mode 100644 index 3a38b84c..00000000 --- a/Sources/DOMKit/WebIDL/PushManager.swift +++ /dev/null @@ -1,54 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PushManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _supportedContentEncodings = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedContentEncodings) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var supportedContentEncodings: [String] - - @inlinable public func subscribe(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { - let this = jsObject - return this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func subscribe(options: PushSubscriptionOptionsInit? = nil) async throws -> PushSubscription { - let this = jsObject - let _promise: JSPromise = this[Strings.subscribe].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getSubscription() -> JSPromise { - let this = jsObject - return this[Strings.getSubscription].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getSubscription() async throws -> PushSubscription? { - let this = jsObject - let _promise: JSPromise = this[Strings.getSubscription].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func permissionState(options: PushSubscriptionOptionsInit? = nil) -> JSPromise { - let this = jsObject - return this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func permissionState(options: PushSubscriptionOptionsInit? = nil) async throws -> PermissionState { - let this = jsObject - let _promise: JSPromise = this[Strings.permissionState].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PushMessageDataInit.swift b/Sources/DOMKit/WebIDL/PushMessageDataInit.swift deleted file mode 100644 index 5a08364b..00000000 --- a/Sources/DOMKit/WebIDL/PushMessageDataInit.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_PushMessageDataInit: ConvertibleToJSValue {} -extension BufferSource: Any_PushMessageDataInit {} -extension String: Any_PushMessageDataInit {} - -public enum PushMessageDataInit: JSValueCompatible, Any_PushMessageDataInit { - case bufferSource(BufferSource) - case string(String) - - public static func construct(from value: JSValue) -> Self? { - if let bufferSource: BufferSource = value.fromJSValue() { - return .bufferSource(bufferSource) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .bufferSource(bufferSource): - return bufferSource.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift deleted file mode 100644 index 89b0bf7c..00000000 --- a/Sources/DOMKit/WebIDL/PushPermissionDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushPermissionDescriptor: BridgedDictionary { - public convenience init(userVisibleOnly: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.userVisibleOnly] = userVisibleOnly.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _userVisibleOnly = ReadWriteAttribute(jsObject: object, name: Strings.userVisibleOnly) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var userVisibleOnly: Bool -} diff --git a/Sources/DOMKit/WebIDL/PushSubscription.swift b/Sources/DOMKit/WebIDL/PushSubscription.swift deleted file mode 100644 index 27a5458f..00000000 --- a/Sources/DOMKit/WebIDL/PushSubscription.swift +++ /dev/null @@ -1,48 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushSubscription: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PushSubscription].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _endpoint = ReadonlyAttribute(jsObject: jsObject, name: Strings.endpoint) - _expirationTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.expirationTime) - _options = ReadonlyAttribute(jsObject: jsObject, name: Strings.options) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var endpoint: String - - @ReadonlyAttribute - public var expirationTime: EpochTimeStamp? - - @ReadonlyAttribute - public var options: PushSubscriptionOptions - - @inlinable public func getKey(name: PushEncryptionKeyName) -> ArrayBuffer? { - let this = jsObject - return this[Strings.getKey].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @inlinable public func unsubscribe() -> JSPromise { - let this = jsObject - return this[Strings.unsubscribe].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func unsubscribe() async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.unsubscribe].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func toJSON() -> PushSubscriptionJSON { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift b/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift deleted file mode 100644 index 7f0b0418..00000000 --- a/Sources/DOMKit/WebIDL/PushSubscriptionChangeEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushSubscriptionChangeEventInit: BridgedDictionary { - public convenience init(newSubscription: PushSubscription, oldSubscription: PushSubscription) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.newSubscription] = newSubscription.jsValue - object[Strings.oldSubscription] = oldSubscription.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _newSubscription = ReadWriteAttribute(jsObject: object, name: Strings.newSubscription) - _oldSubscription = ReadWriteAttribute(jsObject: object, name: Strings.oldSubscription) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var newSubscription: PushSubscription - - @ReadWriteAttribute - public var oldSubscription: PushSubscription -} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift b/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift deleted file mode 100644 index 45d9f09d..00000000 --- a/Sources/DOMKit/WebIDL/PushSubscriptionJSON.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushSubscriptionJSON: BridgedDictionary { - public convenience init(endpoint: String, expirationTime: EpochTimeStamp?, keys: [String: String]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.endpoint] = endpoint.jsValue - object[Strings.expirationTime] = expirationTime.jsValue - object[Strings.keys] = keys.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _endpoint = ReadWriteAttribute(jsObject: object, name: Strings.endpoint) - _expirationTime = ReadWriteAttribute(jsObject: object, name: Strings.expirationTime) - _keys = ReadWriteAttribute(jsObject: object, name: Strings.keys) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var endpoint: String - - @ReadWriteAttribute - public var expirationTime: EpochTimeStamp? - - @ReadWriteAttribute - public var keys: [String: String] -} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift b/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift deleted file mode 100644 index 5905641c..00000000 --- a/Sources/DOMKit/WebIDL/PushSubscriptionOptions.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushSubscriptionOptions: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.PushSubscriptionOptions].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _userVisibleOnly = ReadonlyAttribute(jsObject: jsObject, name: Strings.userVisibleOnly) - _applicationServerKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.applicationServerKey) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var userVisibleOnly: Bool - - @ReadonlyAttribute - public var applicationServerKey: ArrayBuffer? -} diff --git a/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift b/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift deleted file mode 100644 index 358d6a94..00000000 --- a/Sources/DOMKit/WebIDL/PushSubscriptionOptionsInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PushSubscriptionOptionsInit: BridgedDictionary { - public convenience init(userVisibleOnly: Bool, applicationServerKey: BufferSource_or_String?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.userVisibleOnly] = userVisibleOnly.jsValue - object[Strings.applicationServerKey] = applicationServerKey.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _userVisibleOnly = ReadWriteAttribute(jsObject: object, name: Strings.userVisibleOnly) - _applicationServerKey = ReadWriteAttribute(jsObject: object, name: Strings.applicationServerKey) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var userVisibleOnly: Bool - - @ReadWriteAttribute - public var applicationServerKey: BufferSource_or_String? -} diff --git a/Sources/DOMKit/WebIDL/QueryOptions.swift b/Sources/DOMKit/WebIDL/QueryOptions.swift deleted file mode 100644 index 45dec868..00000000 --- a/Sources/DOMKit/WebIDL/QueryOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class QueryOptions: BridgedDictionary { - public convenience init(select: [String]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.select] = select.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _select = ReadWriteAttribute(jsObject: object, name: Strings.select) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var select: [String] -} diff --git a/Sources/DOMKit/WebIDL/RTCAnswerOptions.swift b/Sources/DOMKit/WebIDL/RTCAnswerOptions.swift deleted file mode 100644 index 23bdbb74..00000000 --- a/Sources/DOMKit/WebIDL/RTCAnswerOptions.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCAnswerOptions: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCAudioHandlerStats.swift b/Sources/DOMKit/WebIDL/RTCAudioHandlerStats.swift deleted file mode 100644 index 07e3c6aa..00000000 --- a/Sources/DOMKit/WebIDL/RTCAudioHandlerStats.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCAudioHandlerStats: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCAudioReceiverStats.swift b/Sources/DOMKit/WebIDL/RTCAudioReceiverStats.swift deleted file mode 100644 index 7f7208dc..00000000 --- a/Sources/DOMKit/WebIDL/RTCAudioReceiverStats.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCAudioReceiverStats: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift b/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift deleted file mode 100644 index 3681e2e0..00000000 --- a/Sources/DOMKit/WebIDL/RTCAudioSenderStats.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCAudioSenderStats: BridgedDictionary { - public convenience init(mediaSourceId: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaSourceId] = mediaSourceId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mediaSourceId = ReadWriteAttribute(jsObject: object, name: Strings.mediaSourceId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mediaSourceId: String -} diff --git a/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift b/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift deleted file mode 100644 index fd948b2c..00000000 --- a/Sources/DOMKit/WebIDL/RTCAudioSourceStats.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCAudioSourceStats: BridgedDictionary { - public convenience init(audioLevel: Double, totalAudioEnergy: Double, totalSamplesDuration: Double, echoReturnLoss: Double, echoReturnLossEnhancement: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.audioLevel] = audioLevel.jsValue - object[Strings.totalAudioEnergy] = totalAudioEnergy.jsValue - object[Strings.totalSamplesDuration] = totalSamplesDuration.jsValue - object[Strings.echoReturnLoss] = echoReturnLoss.jsValue - object[Strings.echoReturnLossEnhancement] = echoReturnLossEnhancement.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _audioLevel = ReadWriteAttribute(jsObject: object, name: Strings.audioLevel) - _totalAudioEnergy = ReadWriteAttribute(jsObject: object, name: Strings.totalAudioEnergy) - _totalSamplesDuration = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesDuration) - _echoReturnLoss = ReadWriteAttribute(jsObject: object, name: Strings.echoReturnLoss) - _echoReturnLossEnhancement = ReadWriteAttribute(jsObject: object, name: Strings.echoReturnLossEnhancement) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var audioLevel: Double - - @ReadWriteAttribute - public var totalAudioEnergy: Double - - @ReadWriteAttribute - public var totalSamplesDuration: Double - - @ReadWriteAttribute - public var echoReturnLoss: Double - - @ReadWriteAttribute - public var echoReturnLossEnhancement: Double -} diff --git a/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift b/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift deleted file mode 100644 index fd97fbe0..00000000 --- a/Sources/DOMKit/WebIDL/RTCBundlePolicy.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCBundlePolicy: JSString, JSValueCompatible { - case balanced = "balanced" - case maxCompat = "max-compat" - case maxBundle = "max-bundle" - - @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/RTCCertificate.swift b/Sources/DOMKit/WebIDL/RTCCertificate.swift deleted file mode 100644 index 3b48033f..00000000 --- a/Sources/DOMKit/WebIDL/RTCCertificate.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCCertificate: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCCertificate].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _expires = ReadonlyAttribute(jsObject: jsObject, name: Strings.expires) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var expires: EpochTimeStamp - - @inlinable public func getFingerprints() -> [RTCDtlsFingerprint] { - let this = jsObject - return this[Strings.getFingerprints].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift b/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift deleted file mode 100644 index 01d1297a..00000000 --- a/Sources/DOMKit/WebIDL/RTCCertificateExpiration.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCCertificateExpiration: BridgedDictionary { - public convenience init(expires: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.expires] = expires.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _expires = ReadWriteAttribute(jsObject: object, name: Strings.expires) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var expires: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/RTCCertificateStats.swift b/Sources/DOMKit/WebIDL/RTCCertificateStats.swift deleted file mode 100644 index 4b57c8f4..00000000 --- a/Sources/DOMKit/WebIDL/RTCCertificateStats.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCCertificateStats: BridgedDictionary { - public convenience init(fingerprint: String, fingerprintAlgorithm: String, base64Certificate: String, issuerCertificateId: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fingerprint] = fingerprint.jsValue - object[Strings.fingerprintAlgorithm] = fingerprintAlgorithm.jsValue - object[Strings.base64Certificate] = base64Certificate.jsValue - object[Strings.issuerCertificateId] = issuerCertificateId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _fingerprint = ReadWriteAttribute(jsObject: object, name: Strings.fingerprint) - _fingerprintAlgorithm = ReadWriteAttribute(jsObject: object, name: Strings.fingerprintAlgorithm) - _base64Certificate = ReadWriteAttribute(jsObject: object, name: Strings.base64Certificate) - _issuerCertificateId = ReadWriteAttribute(jsObject: object, name: Strings.issuerCertificateId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var fingerprint: String - - @ReadWriteAttribute - public var fingerprintAlgorithm: String - - @ReadWriteAttribute - public var base64Certificate: String - - @ReadWriteAttribute - public var issuerCertificateId: String -} diff --git a/Sources/DOMKit/WebIDL/RTCCodecStats.swift b/Sources/DOMKit/WebIDL/RTCCodecStats.swift deleted file mode 100644 index cbe86159..00000000 --- a/Sources/DOMKit/WebIDL/RTCCodecStats.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCCodecStats: BridgedDictionary { - public convenience init(payloadType: UInt32, codecType: RTCCodecType, transportId: String, mimeType: String, clockRate: UInt32, channels: UInt32, sdpFmtpLine: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.payloadType] = payloadType.jsValue - object[Strings.codecType] = codecType.jsValue - object[Strings.transportId] = transportId.jsValue - object[Strings.mimeType] = mimeType.jsValue - object[Strings.clockRate] = clockRate.jsValue - object[Strings.channels] = channels.jsValue - object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _payloadType = ReadWriteAttribute(jsObject: object, name: Strings.payloadType) - _codecType = ReadWriteAttribute(jsObject: object, name: Strings.codecType) - _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) - _mimeType = ReadWriteAttribute(jsObject: object, name: Strings.mimeType) - _clockRate = ReadWriteAttribute(jsObject: object, name: Strings.clockRate) - _channels = ReadWriteAttribute(jsObject: object, name: Strings.channels) - _sdpFmtpLine = ReadWriteAttribute(jsObject: object, name: Strings.sdpFmtpLine) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var payloadType: UInt32 - - @ReadWriteAttribute - public var codecType: RTCCodecType - - @ReadWriteAttribute - public var transportId: String - - @ReadWriteAttribute - public var mimeType: String - - @ReadWriteAttribute - public var clockRate: UInt32 - - @ReadWriteAttribute - public var channels: UInt32 - - @ReadWriteAttribute - public var sdpFmtpLine: String -} diff --git a/Sources/DOMKit/WebIDL/RTCCodecType.swift b/Sources/DOMKit/WebIDL/RTCCodecType.swift deleted file mode 100644 index e52297b6..00000000 --- a/Sources/DOMKit/WebIDL/RTCCodecType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCCodecType: JSString, JSValueCompatible { - case encode = "encode" - case decode = "decode" - - @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/RTCConfiguration.swift b/Sources/DOMKit/WebIDL/RTCConfiguration.swift deleted file mode 100644 index 79a12988..00000000 --- a/Sources/DOMKit/WebIDL/RTCConfiguration.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCConfiguration: BridgedDictionary { - public convenience init(peerIdentity: String, iceServers: [RTCIceServer], iceTransportPolicy: RTCIceTransportPolicy, bundlePolicy: RTCBundlePolicy, rtcpMuxPolicy: RTCRtcpMuxPolicy, certificates: [RTCCertificate], iceCandidatePoolSize: UInt8) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.peerIdentity] = peerIdentity.jsValue - object[Strings.iceServers] = iceServers.jsValue - object[Strings.iceTransportPolicy] = iceTransportPolicy.jsValue - object[Strings.bundlePolicy] = bundlePolicy.jsValue - object[Strings.rtcpMuxPolicy] = rtcpMuxPolicy.jsValue - object[Strings.certificates] = certificates.jsValue - object[Strings.iceCandidatePoolSize] = iceCandidatePoolSize.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) - _iceServers = ReadWriteAttribute(jsObject: object, name: Strings.iceServers) - _iceTransportPolicy = ReadWriteAttribute(jsObject: object, name: Strings.iceTransportPolicy) - _bundlePolicy = ReadWriteAttribute(jsObject: object, name: Strings.bundlePolicy) - _rtcpMuxPolicy = ReadWriteAttribute(jsObject: object, name: Strings.rtcpMuxPolicy) - _certificates = ReadWriteAttribute(jsObject: object, name: Strings.certificates) - _iceCandidatePoolSize = ReadWriteAttribute(jsObject: object, name: Strings.iceCandidatePoolSize) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var peerIdentity: String - - @ReadWriteAttribute - public var iceServers: [RTCIceServer] - - @ReadWriteAttribute - public var iceTransportPolicy: RTCIceTransportPolicy - - @ReadWriteAttribute - public var bundlePolicy: RTCBundlePolicy - - @ReadWriteAttribute - public var rtcpMuxPolicy: RTCRtcpMuxPolicy - - @ReadWriteAttribute - public var certificates: [RTCCertificate] - - @ReadWriteAttribute - public var iceCandidatePoolSize: UInt8 -} diff --git a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift b/Sources/DOMKit/WebIDL/RTCDTMFSender.swift deleted file mode 100644 index 6dbd6428..00000000 --- a/Sources/DOMKit/WebIDL/RTCDTMFSender.swift +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDTMFSender: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDTMFSender].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _ontonechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontonechange) - _canInsertDTMF = ReadonlyAttribute(jsObject: jsObject, name: Strings.canInsertDTMF) - _toneBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.toneBuffer) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func insertDTMF(tones: String, duration: UInt32? = nil, interToneGap: UInt32? = nil) { - let this = jsObject - _ = this[Strings.insertDTMF].function!(this: this, arguments: [tones.jsValue, duration?.jsValue ?? .undefined, interToneGap?.jsValue ?? .undefined]) - } - - @ClosureAttribute1Optional - public var ontonechange: EventHandler - - @ReadonlyAttribute - public var canInsertDTMF: Bool - - @ReadonlyAttribute - public var toneBuffer: String -} diff --git a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift deleted file mode 100644 index 2ff58382..00000000 --- a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDTMFToneChangeEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDTMFToneChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _tone = ReadonlyAttribute(jsObject: jsObject, name: Strings.tone) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: RTCDTMFToneChangeEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var tone: String -} diff --git a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift b/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift deleted file mode 100644 index 4fdb5de5..00000000 --- a/Sources/DOMKit/WebIDL/RTCDTMFToneChangeEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDTMFToneChangeEventInit: BridgedDictionary { - public convenience init(tone: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.tone] = tone.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _tone = ReadWriteAttribute(jsObject: object, name: Strings.tone) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var tone: String -} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannel.swift b/Sources/DOMKit/WebIDL/RTCDataChannel.swift deleted file mode 100644 index 708c259c..00000000 --- a/Sources/DOMKit/WebIDL/RTCDataChannel.swift +++ /dev/null @@ -1,109 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDataChannel: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDataChannel].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) - _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) - _ordered = ReadonlyAttribute(jsObject: jsObject, name: Strings.ordered) - _maxPacketLifeTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxPacketLifeTime) - _maxRetransmits = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxRetransmits) - _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) - _negotiated = ReadonlyAttribute(jsObject: jsObject, name: Strings.negotiated) - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) - _bufferedAmount = ReadonlyAttribute(jsObject: jsObject, name: Strings.bufferedAmount) - _bufferedAmountLowThreshold = ReadWriteAttribute(jsObject: jsObject, name: Strings.bufferedAmountLowThreshold) - _onopen = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onopen) - _onbufferedamountlow = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbufferedamountlow) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - _onclosing = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclosing) - _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) - _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) - _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var priority: RTCPriorityType - - @ReadonlyAttribute - public var label: String - - @ReadonlyAttribute - public var ordered: Bool - - @ReadonlyAttribute - public var maxPacketLifeTime: UInt16? - - @ReadonlyAttribute - public var maxRetransmits: UInt16? - - @ReadonlyAttribute - public var `protocol`: String - - @ReadonlyAttribute - public var negotiated: Bool - - @ReadonlyAttribute - public var id: UInt16? - - @ReadonlyAttribute - public var readyState: RTCDataChannelState - - @ReadonlyAttribute - public var bufferedAmount: UInt32 - - @ReadWriteAttribute - public var bufferedAmountLowThreshold: UInt32 - - @ClosureAttribute1Optional - public var onopen: EventHandler - - @ClosureAttribute1Optional - public var onbufferedamountlow: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler - - @ClosureAttribute1Optional - public var onclosing: EventHandler - - @ClosureAttribute1Optional - public var onclose: EventHandler - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var onmessage: EventHandler - - @ReadWriteAttribute - public var binaryType: BinaryType - - @inlinable public func send(data: String) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) - } - - @inlinable public func send(data: Blob) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) - } - - @inlinable public func send(data: ArrayBuffer) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) - } - - @inlinable public func send(data: ArrayBufferView) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift b/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift deleted file mode 100644 index e85da360..00000000 --- a/Sources/DOMKit/WebIDL/RTCDataChannelEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDataChannelEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDataChannelEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _channel = ReadonlyAttribute(jsObject: jsObject, name: Strings.channel) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: RTCDataChannelEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var channel: RTCDataChannel -} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift b/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift deleted file mode 100644 index 6e7dc3a5..00000000 --- a/Sources/DOMKit/WebIDL/RTCDataChannelEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDataChannelEventInit: BridgedDictionary { - public convenience init(channel: RTCDataChannel) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.channel] = channel.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _channel = ReadWriteAttribute(jsObject: object, name: Strings.channel) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var channel: RTCDataChannel -} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift b/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift deleted file mode 100644 index 1f7ab939..00000000 --- a/Sources/DOMKit/WebIDL/RTCDataChannelInit.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDataChannelInit: BridgedDictionary { - public convenience init(priority: RTCPriorityType, ordered: Bool, maxPacketLifeTime: UInt16, maxRetransmits: UInt16, protocol: String, negotiated: Bool, id: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.priority] = priority.jsValue - object[Strings.ordered] = ordered.jsValue - object[Strings.maxPacketLifeTime] = maxPacketLifeTime.jsValue - object[Strings.maxRetransmits] = maxRetransmits.jsValue - object[Strings.protocol] = `protocol`.jsValue - object[Strings.negotiated] = negotiated.jsValue - object[Strings.id] = id.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) - _ordered = ReadWriteAttribute(jsObject: object, name: Strings.ordered) - _maxPacketLifeTime = ReadWriteAttribute(jsObject: object, name: Strings.maxPacketLifeTime) - _maxRetransmits = ReadWriteAttribute(jsObject: object, name: Strings.maxRetransmits) - _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) - _negotiated = ReadWriteAttribute(jsObject: object, name: Strings.negotiated) - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var priority: RTCPriorityType - - @ReadWriteAttribute - public var ordered: Bool - - @ReadWriteAttribute - public var maxPacketLifeTime: UInt16 - - @ReadWriteAttribute - public var maxRetransmits: UInt16 - - @ReadWriteAttribute - public var `protocol`: String - - @ReadWriteAttribute - public var negotiated: Bool - - @ReadWriteAttribute - public var id: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/RTCDataChannelState.swift b/Sources/DOMKit/WebIDL/RTCDataChannelState.swift deleted file mode 100644 index 5c66aa2e..00000000 --- a/Sources/DOMKit/WebIDL/RTCDataChannelState.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCDataChannelState: JSString, JSValueCompatible { - case connecting = "connecting" - case open = "open" - case closing = "closing" - 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/RTCDataChannelStats.swift b/Sources/DOMKit/WebIDL/RTCDataChannelStats.swift deleted file mode 100644 index 5af2c5a6..00000000 --- a/Sources/DOMKit/WebIDL/RTCDataChannelStats.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDataChannelStats: BridgedDictionary { - public convenience init(label: String, protocol: String, dataChannelIdentifier: UInt16, state: RTCDataChannelState, messagesSent: UInt32, bytesSent: UInt64, messagesReceived: UInt32, bytesReceived: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue - object[Strings.protocol] = `protocol`.jsValue - object[Strings.dataChannelIdentifier] = dataChannelIdentifier.jsValue - object[Strings.state] = state.jsValue - object[Strings.messagesSent] = messagesSent.jsValue - object[Strings.bytesSent] = bytesSent.jsValue - object[Strings.messagesReceived] = messagesReceived.jsValue - object[Strings.bytesReceived] = bytesReceived.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _label = ReadWriteAttribute(jsObject: object, name: Strings.label) - _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) - _dataChannelIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelIdentifier) - _state = ReadWriteAttribute(jsObject: object, name: Strings.state) - _messagesSent = ReadWriteAttribute(jsObject: object, name: Strings.messagesSent) - _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) - _messagesReceived = ReadWriteAttribute(jsObject: object, name: Strings.messagesReceived) - _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var label: String - - @ReadWriteAttribute - public var `protocol`: String - - @ReadWriteAttribute - public var dataChannelIdentifier: UInt16 - - @ReadWriteAttribute - public var state: RTCDataChannelState - - @ReadWriteAttribute - public var messagesSent: UInt32 - - @ReadWriteAttribute - public var bytesSent: UInt64 - - @ReadWriteAttribute - public var messagesReceived: UInt32 - - @ReadWriteAttribute - public var bytesReceived: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift b/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift deleted file mode 100644 index 3228a2e4..00000000 --- a/Sources/DOMKit/WebIDL/RTCDegradationPreference.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCDegradationPreference: JSString, JSValueCompatible { - case maintainFramerate = "maintain-framerate" - case maintainResolution = "maintain-resolution" - case balanced = "balanced" - - @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/RTCDtlsFingerprint.swift b/Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift deleted file mode 100644 index a8f016e2..00000000 --- a/Sources/DOMKit/WebIDL/RTCDtlsFingerprint.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDtlsFingerprint: BridgedDictionary { - public convenience init(algorithm: String, value: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.algorithm] = algorithm.jsValue - object[Strings.value] = value.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _algorithm = ReadWriteAttribute(jsObject: object, name: Strings.algorithm) - _value = ReadWriteAttribute(jsObject: object, name: Strings.value) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var algorithm: String - - @ReadWriteAttribute - public var value: String -} diff --git a/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift b/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift deleted file mode 100644 index 8b93485b..00000000 --- a/Sources/DOMKit/WebIDL/RTCDtlsTransport.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCDtlsTransport: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCDtlsTransport].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _iceTransport = ReadonlyAttribute(jsObject: jsObject, name: Strings.iceTransport) - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var iceTransport: RTCIceTransport - - @ReadonlyAttribute - public var state: RTCDtlsTransportState - - @inlinable public func getRemoteCertificates() -> [ArrayBuffer] { - let this = jsObject - return this[Strings.getRemoteCertificates].function!(this: this, arguments: []).fromJSValue()! - } - - @ClosureAttribute1Optional - public var onstatechange: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift b/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift deleted file mode 100644 index 351d27e6..00000000 --- a/Sources/DOMKit/WebIDL/RTCDtlsTransportState.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCDtlsTransportState: JSString, JSValueCompatible { - case new = "new" - case connecting = "connecting" - case connected = "connected" - case closed = "closed" - case failed = "failed" - - @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/RTCEncodedAudioFrame.swift b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift deleted file mode 100644 index 481f3b20..00000000 --- a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrame.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCEncodedAudioFrame: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCEncodedAudioFrame].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var timestamp: UInt64 - - @ReadWriteAttribute - public var data: ArrayBuffer - - @inlinable public func getMetadata() -> RTCEncodedAudioFrameMetadata { - let this = jsObject - return this[Strings.getMetadata].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift b/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift deleted file mode 100644 index 1dba1b1a..00000000 --- a/Sources/DOMKit/WebIDL/RTCEncodedAudioFrameMetadata.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCEncodedAudioFrameMetadata: BridgedDictionary { - public convenience init(synchronizationSource: Int32, payloadType: UInt8, contributingSources: [Int32]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.synchronizationSource] = synchronizationSource.jsValue - object[Strings.payloadType] = payloadType.jsValue - object[Strings.contributingSources] = contributingSources.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _synchronizationSource = ReadWriteAttribute(jsObject: object, name: Strings.synchronizationSource) - _payloadType = ReadWriteAttribute(jsObject: object, name: Strings.payloadType) - _contributingSources = ReadWriteAttribute(jsObject: object, name: Strings.contributingSources) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var synchronizationSource: Int32 - - @ReadWriteAttribute - public var payloadType: UInt8 - - @ReadWriteAttribute - public var contributingSources: [Int32] -} diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift deleted file mode 100644 index 5b8ef715..00000000 --- a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrame.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCEncodedVideoFrame: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCEncodedVideoFrame].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) - _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var type: RTCEncodedVideoFrameType - - @ReadonlyAttribute - public var timestamp: UInt64 - - @ReadWriteAttribute - public var data: ArrayBuffer - - @inlinable public func getMetadata() -> RTCEncodedVideoFrameMetadata { - let this = jsObject - return this[Strings.getMetadata].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift deleted file mode 100644 index f0c24115..00000000 --- a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameMetadata.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCEncodedVideoFrameMetadata: BridgedDictionary { - public convenience init(frameId: Int64, dependencies: [Int64], width: UInt16, height: UInt16, spatialIndex: Int32, temporalIndex: Int32, synchronizationSource: Int32, payloadType: UInt8, contributingSources: [Int32]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.frameId] = frameId.jsValue - object[Strings.dependencies] = dependencies.jsValue - object[Strings.width] = width.jsValue - object[Strings.height] = height.jsValue - object[Strings.spatialIndex] = spatialIndex.jsValue - object[Strings.temporalIndex] = temporalIndex.jsValue - object[Strings.synchronizationSource] = synchronizationSource.jsValue - object[Strings.payloadType] = payloadType.jsValue - object[Strings.contributingSources] = contributingSources.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _frameId = ReadWriteAttribute(jsObject: object, name: Strings.frameId) - _dependencies = ReadWriteAttribute(jsObject: object, name: Strings.dependencies) - _width = ReadWriteAttribute(jsObject: object, name: Strings.width) - _height = ReadWriteAttribute(jsObject: object, name: Strings.height) - _spatialIndex = ReadWriteAttribute(jsObject: object, name: Strings.spatialIndex) - _temporalIndex = ReadWriteAttribute(jsObject: object, name: Strings.temporalIndex) - _synchronizationSource = ReadWriteAttribute(jsObject: object, name: Strings.synchronizationSource) - _payloadType = ReadWriteAttribute(jsObject: object, name: Strings.payloadType) - _contributingSources = ReadWriteAttribute(jsObject: object, name: Strings.contributingSources) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var frameId: Int64 - - @ReadWriteAttribute - public var dependencies: [Int64] - - @ReadWriteAttribute - public var width: UInt16 - - @ReadWriteAttribute - public var height: UInt16 - - @ReadWriteAttribute - public var spatialIndex: Int32 - - @ReadWriteAttribute - public var temporalIndex: Int32 - - @ReadWriteAttribute - public var synchronizationSource: Int32 - - @ReadWriteAttribute - public var payloadType: UInt8 - - @ReadWriteAttribute - public var contributingSources: [Int32] -} diff --git a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift b/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift deleted file mode 100644 index a7f8ef74..00000000 --- a/Sources/DOMKit/WebIDL/RTCEncodedVideoFrameType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCEncodedVideoFrameType: JSString, JSValueCompatible { - case empty = "empty" - 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/RTCError.swift b/Sources/DOMKit/WebIDL/RTCError.swift deleted file mode 100644 index 00883cae..00000000 --- a/Sources/DOMKit/WebIDL/RTCError.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCError: DOMException { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCError].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _httpRequestStatusCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.httpRequestStatusCode) - _errorDetail = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorDetail) - _sdpLineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.sdpLineNumber) - _sctpCauseCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.sctpCauseCode) - _receivedAlert = ReadonlyAttribute(jsObject: jsObject, name: Strings.receivedAlert) - _sentAlert = ReadonlyAttribute(jsObject: jsObject, name: Strings.sentAlert) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var httpRequestStatusCode: Int32? - - @inlinable public convenience init(init: RTCErrorInit, message: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue, message?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var errorDetail: RTCErrorDetailType - - @ReadonlyAttribute - public var sdpLineNumber: Int32? - - @ReadonlyAttribute - public var sctpCauseCode: Int32? - - @ReadonlyAttribute - public var receivedAlert: UInt32? - - @ReadonlyAttribute - public var sentAlert: UInt32? -} diff --git a/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift b/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift deleted file mode 100644 index 6c667702..00000000 --- a/Sources/DOMKit/WebIDL/RTCErrorDetailType.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCErrorDetailType: JSString, JSValueCompatible { - case dataChannelFailure = "data-channel-failure" - case dtlsFailure = "dtls-failure" - case fingerprintFailure = "fingerprint-failure" - case sctpFailure = "sctp-failure" - case sdpSyntaxError = "sdp-syntax-error" - case hardwareEncoderNotAvailable = "hardware-encoder-not-available" - case hardwareEncoderError = "hardware-encoder-error" - - @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/RTCErrorDetailTypeIdp.swift b/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift deleted file mode 100644 index da8b75ed..00000000 --- a/Sources/DOMKit/WebIDL/RTCErrorDetailTypeIdp.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCErrorDetailTypeIdp: JSString, JSValueCompatible { - case idpBadScriptFailure = "idp-bad-script-failure" - case idpExecutionFailure = "idp-execution-failure" - case idpLoadFailure = "idp-load-failure" - case idpNeedLogin = "idp-need-login" - case idpTimeout = "idp-timeout" - case idpTlsFailure = "idp-tls-failure" - case idpTokenExpired = "idp-token-expired" - case idpTokenInvalid = "idp-token-invalid" - - @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/RTCErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCErrorEvent.swift deleted file mode 100644 index 05af3107..00000000 --- a/Sources/DOMKit/WebIDL/RTCErrorEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCErrorEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCErrorEvent].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: RTCErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var error: RTCError -} diff --git a/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift b/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift deleted file mode 100644 index 2c27f4f5..00000000 --- a/Sources/DOMKit/WebIDL/RTCErrorEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCErrorEventInit: BridgedDictionary { - public convenience init(error: RTCError) { - 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: RTCError -} diff --git a/Sources/DOMKit/WebIDL/RTCErrorInit.swift b/Sources/DOMKit/WebIDL/RTCErrorInit.swift deleted file mode 100644 index bce91b69..00000000 --- a/Sources/DOMKit/WebIDL/RTCErrorInit.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCErrorInit: BridgedDictionary { - public convenience init(httpRequestStatusCode: Int32, errorDetail: RTCErrorDetailType, sdpLineNumber: Int32, sctpCauseCode: Int32, receivedAlert: UInt32, sentAlert: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.httpRequestStatusCode] = httpRequestStatusCode.jsValue - object[Strings.errorDetail] = errorDetail.jsValue - object[Strings.sdpLineNumber] = sdpLineNumber.jsValue - object[Strings.sctpCauseCode] = sctpCauseCode.jsValue - object[Strings.receivedAlert] = receivedAlert.jsValue - object[Strings.sentAlert] = sentAlert.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _httpRequestStatusCode = ReadWriteAttribute(jsObject: object, name: Strings.httpRequestStatusCode) - _errorDetail = ReadWriteAttribute(jsObject: object, name: Strings.errorDetail) - _sdpLineNumber = ReadWriteAttribute(jsObject: object, name: Strings.sdpLineNumber) - _sctpCauseCode = ReadWriteAttribute(jsObject: object, name: Strings.sctpCauseCode) - _receivedAlert = ReadWriteAttribute(jsObject: object, name: Strings.receivedAlert) - _sentAlert = ReadWriteAttribute(jsObject: object, name: Strings.sentAlert) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var httpRequestStatusCode: Int32 - - @ReadWriteAttribute - public var errorDetail: RTCErrorDetailType - - @ReadWriteAttribute - public var sdpLineNumber: Int32 - - @ReadWriteAttribute - public var sctpCauseCode: Int32 - - @ReadWriteAttribute - public var receivedAlert: UInt32 - - @ReadWriteAttribute - public var sentAlert: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift b/Sources/DOMKit/WebIDL/RTCIceCandidate.swift deleted file mode 100644 index f1a36c08..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceCandidate.swift +++ /dev/null @@ -1,79 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceCandidate: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCIceCandidate].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _candidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.candidate) - _sdpMid = ReadonlyAttribute(jsObject: jsObject, name: Strings.sdpMid) - _sdpMLineIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.sdpMLineIndex) - _foundation = ReadonlyAttribute(jsObject: jsObject, name: Strings.foundation) - _component = ReadonlyAttribute(jsObject: jsObject, name: Strings.component) - _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) - _address = ReadonlyAttribute(jsObject: jsObject, name: Strings.address) - _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) - _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _tcpType = ReadonlyAttribute(jsObject: jsObject, name: Strings.tcpType) - _relatedAddress = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedAddress) - _relatedPort = ReadonlyAttribute(jsObject: jsObject, name: Strings.relatedPort) - _usernameFragment = ReadonlyAttribute(jsObject: jsObject, name: Strings.usernameFragment) - self.jsObject = jsObject - } - - @inlinable public convenience init(candidateInitDict: RTCIceCandidateInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [candidateInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var candidate: String - - @ReadonlyAttribute - public var sdpMid: String? - - @ReadonlyAttribute - public var sdpMLineIndex: UInt16? - - @ReadonlyAttribute - public var foundation: String? - - @ReadonlyAttribute - public var component: RTCIceComponent? - - @ReadonlyAttribute - public var priority: UInt32? - - @ReadonlyAttribute - public var address: String? - - @ReadonlyAttribute - public var `protocol`: RTCIceProtocol? - - @ReadonlyAttribute - public var port: UInt16? - - @ReadonlyAttribute - public var type: RTCIceCandidateType? - - @ReadonlyAttribute - public var tcpType: RTCIceTcpCandidateType? - - @ReadonlyAttribute - public var relatedAddress: String? - - @ReadonlyAttribute - public var relatedPort: UInt16? - - @ReadonlyAttribute - public var usernameFragment: String? - - @inlinable public func toJSON() -> RTCIceCandidateInit { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift deleted file mode 100644 index 328a2761..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceCandidateInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceCandidateInit: BridgedDictionary { - public convenience init(candidate: String, sdpMid: String?, sdpMLineIndex: UInt16?, usernameFragment: String?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.candidate] = candidate.jsValue - object[Strings.sdpMid] = sdpMid.jsValue - object[Strings.sdpMLineIndex] = sdpMLineIndex.jsValue - object[Strings.usernameFragment] = usernameFragment.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _candidate = ReadWriteAttribute(jsObject: object, name: Strings.candidate) - _sdpMid = ReadWriteAttribute(jsObject: object, name: Strings.sdpMid) - _sdpMLineIndex = ReadWriteAttribute(jsObject: object, name: Strings.sdpMLineIndex) - _usernameFragment = ReadWriteAttribute(jsObject: object, name: Strings.usernameFragment) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var candidate: String - - @ReadWriteAttribute - public var sdpMid: String? - - @ReadWriteAttribute - public var sdpMLineIndex: UInt16? - - @ReadWriteAttribute - public var usernameFragment: String? -} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift b/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift deleted file mode 100644 index 8db6a4b4..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceCandidatePair.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceCandidatePair: BridgedDictionary { - public convenience init(local: RTCIceCandidate, remote: RTCIceCandidate) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.local] = local.jsValue - object[Strings.remote] = remote.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _local = ReadWriteAttribute(jsObject: object, name: Strings.local) - _remote = ReadWriteAttribute(jsObject: object, name: Strings.remote) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var local: RTCIceCandidate - - @ReadWriteAttribute - public var remote: RTCIceCandidate -} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift b/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift deleted file mode 100644 index 45cbd848..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceCandidatePairStats.swift +++ /dev/null @@ -1,175 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceCandidatePairStats: BridgedDictionary { - public convenience init(transportId: String, localCandidateId: String, remoteCandidateId: String, state: RTCStatsIceCandidatePairState, nominated: Bool, packetsSent: UInt64, packetsReceived: UInt64, bytesSent: UInt64, bytesReceived: UInt64, lastPacketSentTimestamp: DOMHighResTimeStamp, lastPacketReceivedTimestamp: DOMHighResTimeStamp, firstRequestTimestamp: DOMHighResTimeStamp, lastRequestTimestamp: DOMHighResTimeStamp, lastResponseTimestamp: DOMHighResTimeStamp, totalRoundTripTime: Double, currentRoundTripTime: Double, availableOutgoingBitrate: Double, availableIncomingBitrate: Double, circuitBreakerTriggerCount: UInt32, requestsReceived: UInt64, requestsSent: UInt64, responsesReceived: UInt64, responsesSent: UInt64, retransmissionsReceived: UInt64, retransmissionsSent: UInt64, consentRequestsSent: UInt64, consentExpiredTimestamp: DOMHighResTimeStamp, packetsDiscardedOnSend: UInt32, bytesDiscardedOnSend: UInt64, requestBytesSent: UInt64, consentRequestBytesSent: UInt64, responseBytesSent: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transportId] = transportId.jsValue - object[Strings.localCandidateId] = localCandidateId.jsValue - object[Strings.remoteCandidateId] = remoteCandidateId.jsValue - object[Strings.state] = state.jsValue - object[Strings.nominated] = nominated.jsValue - object[Strings.packetsSent] = packetsSent.jsValue - object[Strings.packetsReceived] = packetsReceived.jsValue - object[Strings.bytesSent] = bytesSent.jsValue - object[Strings.bytesReceived] = bytesReceived.jsValue - object[Strings.lastPacketSentTimestamp] = lastPacketSentTimestamp.jsValue - object[Strings.lastPacketReceivedTimestamp] = lastPacketReceivedTimestamp.jsValue - object[Strings.firstRequestTimestamp] = firstRequestTimestamp.jsValue - object[Strings.lastRequestTimestamp] = lastRequestTimestamp.jsValue - object[Strings.lastResponseTimestamp] = lastResponseTimestamp.jsValue - object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue - object[Strings.currentRoundTripTime] = currentRoundTripTime.jsValue - object[Strings.availableOutgoingBitrate] = availableOutgoingBitrate.jsValue - object[Strings.availableIncomingBitrate] = availableIncomingBitrate.jsValue - object[Strings.circuitBreakerTriggerCount] = circuitBreakerTriggerCount.jsValue - object[Strings.requestsReceived] = requestsReceived.jsValue - object[Strings.requestsSent] = requestsSent.jsValue - object[Strings.responsesReceived] = responsesReceived.jsValue - object[Strings.responsesSent] = responsesSent.jsValue - object[Strings.retransmissionsReceived] = retransmissionsReceived.jsValue - object[Strings.retransmissionsSent] = retransmissionsSent.jsValue - object[Strings.consentRequestsSent] = consentRequestsSent.jsValue - object[Strings.consentExpiredTimestamp] = consentExpiredTimestamp.jsValue - object[Strings.packetsDiscardedOnSend] = packetsDiscardedOnSend.jsValue - object[Strings.bytesDiscardedOnSend] = bytesDiscardedOnSend.jsValue - object[Strings.requestBytesSent] = requestBytesSent.jsValue - object[Strings.consentRequestBytesSent] = consentRequestBytesSent.jsValue - object[Strings.responseBytesSent] = responseBytesSent.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) - _localCandidateId = ReadWriteAttribute(jsObject: object, name: Strings.localCandidateId) - _remoteCandidateId = ReadWriteAttribute(jsObject: object, name: Strings.remoteCandidateId) - _state = ReadWriteAttribute(jsObject: object, name: Strings.state) - _nominated = ReadWriteAttribute(jsObject: object, name: Strings.nominated) - _packetsSent = ReadWriteAttribute(jsObject: object, name: Strings.packetsSent) - _packetsReceived = ReadWriteAttribute(jsObject: object, name: Strings.packetsReceived) - _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) - _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) - _lastPacketSentTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastPacketSentTimestamp) - _lastPacketReceivedTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastPacketReceivedTimestamp) - _firstRequestTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.firstRequestTimestamp) - _lastRequestTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastRequestTimestamp) - _lastResponseTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastResponseTimestamp) - _totalRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.totalRoundTripTime) - _currentRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.currentRoundTripTime) - _availableOutgoingBitrate = ReadWriteAttribute(jsObject: object, name: Strings.availableOutgoingBitrate) - _availableIncomingBitrate = ReadWriteAttribute(jsObject: object, name: Strings.availableIncomingBitrate) - _circuitBreakerTriggerCount = ReadWriteAttribute(jsObject: object, name: Strings.circuitBreakerTriggerCount) - _requestsReceived = ReadWriteAttribute(jsObject: object, name: Strings.requestsReceived) - _requestsSent = ReadWriteAttribute(jsObject: object, name: Strings.requestsSent) - _responsesReceived = ReadWriteAttribute(jsObject: object, name: Strings.responsesReceived) - _responsesSent = ReadWriteAttribute(jsObject: object, name: Strings.responsesSent) - _retransmissionsReceived = ReadWriteAttribute(jsObject: object, name: Strings.retransmissionsReceived) - _retransmissionsSent = ReadWriteAttribute(jsObject: object, name: Strings.retransmissionsSent) - _consentRequestsSent = ReadWriteAttribute(jsObject: object, name: Strings.consentRequestsSent) - _consentExpiredTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.consentExpiredTimestamp) - _packetsDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.packetsDiscardedOnSend) - _bytesDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.bytesDiscardedOnSend) - _requestBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.requestBytesSent) - _consentRequestBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.consentRequestBytesSent) - _responseBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.responseBytesSent) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var transportId: String - - @ReadWriteAttribute - public var localCandidateId: String - - @ReadWriteAttribute - public var remoteCandidateId: String - - @ReadWriteAttribute - public var state: RTCStatsIceCandidatePairState - - @ReadWriteAttribute - public var nominated: Bool - - @ReadWriteAttribute - public var packetsSent: UInt64 - - @ReadWriteAttribute - public var packetsReceived: UInt64 - - @ReadWriteAttribute - public var bytesSent: UInt64 - - @ReadWriteAttribute - public var bytesReceived: UInt64 - - @ReadWriteAttribute - public var lastPacketSentTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var lastPacketReceivedTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var firstRequestTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var lastRequestTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var lastResponseTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var totalRoundTripTime: Double - - @ReadWriteAttribute - public var currentRoundTripTime: Double - - @ReadWriteAttribute - public var availableOutgoingBitrate: Double - - @ReadWriteAttribute - public var availableIncomingBitrate: Double - - @ReadWriteAttribute - public var circuitBreakerTriggerCount: UInt32 - - @ReadWriteAttribute - public var requestsReceived: UInt64 - - @ReadWriteAttribute - public var requestsSent: UInt64 - - @ReadWriteAttribute - public var responsesReceived: UInt64 - - @ReadWriteAttribute - public var responsesSent: UInt64 - - @ReadWriteAttribute - public var retransmissionsReceived: UInt64 - - @ReadWriteAttribute - public var retransmissionsSent: UInt64 - - @ReadWriteAttribute - public var consentRequestsSent: UInt64 - - @ReadWriteAttribute - public var consentExpiredTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var packetsDiscardedOnSend: UInt32 - - @ReadWriteAttribute - public var bytesDiscardedOnSend: UInt64 - - @ReadWriteAttribute - public var requestBytesSent: UInt64 - - @ReadWriteAttribute - public var consentRequestBytesSent: UInt64 - - @ReadWriteAttribute - public var responseBytesSent: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift deleted file mode 100644 index fd845fe8..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceCandidateStats.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceCandidateStats: BridgedDictionary { - public convenience init(transportId: String, address: String?, port: Int32, protocol: String, candidateType: RTCIceCandidateType, priority: Int32, url: String, relayProtocol: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transportId] = transportId.jsValue - object[Strings.address] = address.jsValue - object[Strings.port] = port.jsValue - object[Strings.protocol] = `protocol`.jsValue - object[Strings.candidateType] = candidateType.jsValue - object[Strings.priority] = priority.jsValue - object[Strings.url] = url.jsValue - object[Strings.relayProtocol] = relayProtocol.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) - _address = ReadWriteAttribute(jsObject: object, name: Strings.address) - _port = ReadWriteAttribute(jsObject: object, name: Strings.port) - _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) - _candidateType = ReadWriteAttribute(jsObject: object, name: Strings.candidateType) - _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) - _url = ReadWriteAttribute(jsObject: object, name: Strings.url) - _relayProtocol = ReadWriteAttribute(jsObject: object, name: Strings.relayProtocol) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var transportId: String - - @ReadWriteAttribute - public var address: String? - - @ReadWriteAttribute - public var port: Int32 - - @ReadWriteAttribute - public var `protocol`: String - - @ReadWriteAttribute - public var candidateType: RTCIceCandidateType - - @ReadWriteAttribute - public var priority: Int32 - - @ReadWriteAttribute - public var url: String - - @ReadWriteAttribute - public var relayProtocol: String -} diff --git a/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift b/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift deleted file mode 100644 index 86c123a3..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceCandidateType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceCandidateType: JSString, JSValueCompatible { - case host = "host" - case srflx = "srflx" - case prflx = "prflx" - case relay = "relay" - - @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/RTCIceComponent.swift b/Sources/DOMKit/WebIDL/RTCIceComponent.swift deleted file mode 100644 index 789bcfca..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceComponent.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceComponent: JSString, JSValueCompatible { - case rtp = "rtp" - case rtcp = "rtcp" - - @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/RTCIceConnectionState.swift b/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift deleted file mode 100644 index a9b37c33..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceConnectionState.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceConnectionState: JSString, JSValueCompatible { - case closed = "closed" - case failed = "failed" - case disconnected = "disconnected" - case new = "new" - case checking = "checking" - case completed = "completed" - case connected = "connected" - - @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/RTCIceCredentialType.swift b/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift deleted file mode 100644 index 0c5d9e57..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceCredentialType.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceCredentialType: JSString, JSValueCompatible { - case password = "password" - - @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/RTCIceGatherOptions.swift b/Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift deleted file mode 100644 index 7e6d236a..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceGatherOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceGatherOptions: BridgedDictionary { - public convenience init(gatherPolicy: RTCIceTransportPolicy, iceServers: [RTCIceServer]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.gatherPolicy] = gatherPolicy.jsValue - object[Strings.iceServers] = iceServers.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _gatherPolicy = ReadWriteAttribute(jsObject: object, name: Strings.gatherPolicy) - _iceServers = ReadWriteAttribute(jsObject: object, name: Strings.iceServers) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var gatherPolicy: RTCIceTransportPolicy - - @ReadWriteAttribute - public var iceServers: [RTCIceServer] -} diff --git a/Sources/DOMKit/WebIDL/RTCIceGathererState.swift b/Sources/DOMKit/WebIDL/RTCIceGathererState.swift deleted file mode 100644 index 3b79f2c8..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceGathererState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceGathererState: JSString, JSValueCompatible { - case new = "new" - case gathering = "gathering" - case complete = "complete" - - @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/RTCIceGatheringState.swift b/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift deleted file mode 100644 index 47c8c1ce..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceGatheringState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceGatheringState: JSString, JSValueCompatible { - case new = "new" - case gathering = "gathering" - case complete = "complete" - - @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/RTCIceParameters.swift b/Sources/DOMKit/WebIDL/RTCIceParameters.swift deleted file mode 100644 index fb75b397..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceParameters.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceParameters: BridgedDictionary { - public convenience init(iceLite: Bool, usernameFragment: String, password: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iceLite] = iceLite.jsValue - object[Strings.usernameFragment] = usernameFragment.jsValue - object[Strings.password] = password.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _iceLite = ReadWriteAttribute(jsObject: object, name: Strings.iceLite) - _usernameFragment = ReadWriteAttribute(jsObject: object, name: Strings.usernameFragment) - _password = ReadWriteAttribute(jsObject: object, name: Strings.password) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var iceLite: Bool - - @ReadWriteAttribute - public var usernameFragment: String - - @ReadWriteAttribute - public var password: String -} diff --git a/Sources/DOMKit/WebIDL/RTCIceProtocol.swift b/Sources/DOMKit/WebIDL/RTCIceProtocol.swift deleted file mode 100644 index fd7d318d..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceProtocol.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceProtocol: JSString, JSValueCompatible { - case udp = "udp" - case tcp = "tcp" - - @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/RTCIceRole.swift b/Sources/DOMKit/WebIDL/RTCIceRole.swift deleted file mode 100644 index 0855941d..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceRole.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceRole: JSString, JSValueCompatible { - case unknown = "unknown" - case controlling = "controlling" - case controlled = "controlled" - - @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/RTCIceServer.swift b/Sources/DOMKit/WebIDL/RTCIceServer.swift deleted file mode 100644 index 3ef87fb1..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceServer.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceServer: BridgedDictionary { - public convenience init(urls: String_or_seq_of_String, username: String, credential: String, credentialType: RTCIceCredentialType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.urls] = urls.jsValue - object[Strings.username] = username.jsValue - object[Strings.credential] = credential.jsValue - object[Strings.credentialType] = credentialType.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _urls = ReadWriteAttribute(jsObject: object, name: Strings.urls) - _username = ReadWriteAttribute(jsObject: object, name: Strings.username) - _credential = ReadWriteAttribute(jsObject: object, name: Strings.credential) - _credentialType = ReadWriteAttribute(jsObject: object, name: Strings.credentialType) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var urls: String_or_seq_of_String - - @ReadWriteAttribute - public var username: String - - @ReadWriteAttribute - public var credential: String - - @ReadWriteAttribute - public var credentialType: RTCIceCredentialType -} diff --git a/Sources/DOMKit/WebIDL/RTCIceServerStats.swift b/Sources/DOMKit/WebIDL/RTCIceServerStats.swift deleted file mode 100644 index bbd53dfe..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceServerStats.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceServerStats: BridgedDictionary { - public convenience init(url: String, port: Int32, relayProtocol: String, totalRequestsSent: UInt32, totalResponsesReceived: UInt32, totalRoundTripTime: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.url] = url.jsValue - object[Strings.port] = port.jsValue - object[Strings.relayProtocol] = relayProtocol.jsValue - object[Strings.totalRequestsSent] = totalRequestsSent.jsValue - object[Strings.totalResponsesReceived] = totalResponsesReceived.jsValue - object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _url = ReadWriteAttribute(jsObject: object, name: Strings.url) - _port = ReadWriteAttribute(jsObject: object, name: Strings.port) - _relayProtocol = ReadWriteAttribute(jsObject: object, name: Strings.relayProtocol) - _totalRequestsSent = ReadWriteAttribute(jsObject: object, name: Strings.totalRequestsSent) - _totalResponsesReceived = ReadWriteAttribute(jsObject: object, name: Strings.totalResponsesReceived) - _totalRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.totalRoundTripTime) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var url: String - - @ReadWriteAttribute - public var port: Int32 - - @ReadWriteAttribute - public var relayProtocol: String - - @ReadWriteAttribute - public var totalRequestsSent: UInt32 - - @ReadWriteAttribute - public var totalResponsesReceived: UInt32 - - @ReadWriteAttribute - public var totalRoundTripTime: Double -} diff --git a/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift b/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift deleted file mode 100644 index 6d2fb1f5..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceTcpCandidateType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceTcpCandidateType: JSString, JSValueCompatible { - case active = "active" - case passive = "passive" - case so = "so" - - @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/RTCIceTransport.swift b/Sources/DOMKit/WebIDL/RTCIceTransport.swift deleted file mode 100644 index 0509d527..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceTransport.swift +++ /dev/null @@ -1,97 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIceTransport: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCIceTransport].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - _onicecandidate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onicecandidate) - _role = ReadonlyAttribute(jsObject: jsObject, name: Strings.role) - _component = ReadonlyAttribute(jsObject: jsObject, name: Strings.component) - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _gatheringState = ReadonlyAttribute(jsObject: jsObject, name: Strings.gatheringState) - _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) - _ongatheringstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ongatheringstatechange) - _onselectedcandidatepairchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onselectedcandidatepairchange) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @inlinable public func gather(options: RTCIceGatherOptions? = nil) { - let this = jsObject - _ = this[Strings.gather].function!(this: this, arguments: [options?.jsValue ?? .undefined]) - } - - @inlinable public func start(remoteParameters: RTCIceParameters? = nil, role: RTCIceRole? = nil) { - let this = jsObject - _ = this[Strings.start].function!(this: this, arguments: [remoteParameters?.jsValue ?? .undefined, role?.jsValue ?? .undefined]) - } - - @inlinable public func stop() { - let this = jsObject - _ = this[Strings.stop].function!(this: this, arguments: []) - } - - @inlinable public func addRemoteCandidate(remoteCandidate: RTCIceCandidateInit? = nil) { - let this = jsObject - _ = this[Strings.addRemoteCandidate].function!(this: this, arguments: [remoteCandidate?.jsValue ?? .undefined]) - } - - @ClosureAttribute1Optional - public var onerror: EventHandler - - @ClosureAttribute1Optional - public var onicecandidate: EventHandler - - @ReadonlyAttribute - public var role: RTCIceRole - - @ReadonlyAttribute - public var component: RTCIceComponent - - @ReadonlyAttribute - public var state: RTCIceTransportState - - @ReadonlyAttribute - public var gatheringState: RTCIceGathererState - - @inlinable public func getLocalCandidates() -> [RTCIceCandidate] { - let this = jsObject - return this[Strings.getLocalCandidates].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getRemoteCandidates() -> [RTCIceCandidate] { - let this = jsObject - return this[Strings.getRemoteCandidates].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getSelectedCandidatePair() -> RTCIceCandidatePair? { - let this = jsObject - return this[Strings.getSelectedCandidatePair].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getLocalParameters() -> RTCIceParameters? { - let this = jsObject - return this[Strings.getLocalParameters].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getRemoteParameters() -> RTCIceParameters? { - let this = jsObject - return this[Strings.getRemoteParameters].function!(this: this, arguments: []).fromJSValue()! - } - - @ClosureAttribute1Optional - public var onstatechange: EventHandler - - @ClosureAttribute1Optional - public var ongatheringstatechange: EventHandler - - @ClosureAttribute1Optional - public var onselectedcandidatepairchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift b/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift deleted file mode 100644 index 1fc6a85e..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceTransportPolicy.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceTransportPolicy: JSString, JSValueCompatible { - case relay = "relay" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/RTCIceTransportState.swift b/Sources/DOMKit/WebIDL/RTCIceTransportState.swift deleted file mode 100644 index 06a5c999..00000000 --- a/Sources/DOMKit/WebIDL/RTCIceTransportState.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCIceTransportState: JSString, JSValueCompatible { - case new = "new" - case checking = "checking" - case connected = "connected" - case completed = "completed" - case disconnected = "disconnected" - case failed = "failed" - 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/RTCIdentityAssertion.swift b/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift deleted file mode 100644 index f6ce08fd..00000000 --- a/Sources/DOMKit/WebIDL/RTCIdentityAssertion.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIdentityAssertion: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCIdentityAssertion].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _idp = ReadWriteAttribute(jsObject: jsObject, name: Strings.idp) - _name = ReadWriteAttribute(jsObject: jsObject, name: Strings.name) - self.jsObject = jsObject - } - - @inlinable public convenience init(idp: String, name: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [idp.jsValue, name.jsValue])) - } - - @ReadWriteAttribute - public var idp: String - - @ReadWriteAttribute - public var name: String -} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift b/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift deleted file mode 100644 index ffa3d2a3..00000000 --- a/Sources/DOMKit/WebIDL/RTCIdentityAssertionResult.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIdentityAssertionResult: BridgedDictionary { - public convenience init(idp: RTCIdentityProviderDetails, assertion: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.idp] = idp.jsValue - object[Strings.assertion] = assertion.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _idp = ReadWriteAttribute(jsObject: object, name: Strings.idp) - _assertion = ReadWriteAttribute(jsObject: object, name: Strings.assertion) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var idp: RTCIdentityProviderDetails - - @ReadWriteAttribute - public var assertion: String -} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift b/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift deleted file mode 100644 index cae9ad6f..00000000 --- a/Sources/DOMKit/WebIDL/RTCIdentityProvider.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIdentityProvider: BridgedDictionary { - public convenience init(generateAssertion: @escaping GenerateAssertionCallback, validateAssertion: @escaping ValidateAssertionCallback) { - let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute3[Strings.generateAssertion, in: object] = generateAssertion - ClosureAttribute2[Strings.validateAssertion, in: object] = validateAssertion - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _generateAssertion = ClosureAttribute3(jsObject: object, name: Strings.generateAssertion) - _validateAssertion = ClosureAttribute2(jsObject: object, name: Strings.validateAssertion) - super.init(unsafelyWrapping: object) - } - - @ClosureAttribute3 - public var generateAssertion: GenerateAssertionCallback - - @ClosureAttribute2 - public var validateAssertion: ValidateAssertionCallback -} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift deleted file mode 100644 index b904f5e5..00000000 --- a/Sources/DOMKit/WebIDL/RTCIdentityProviderDetails.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIdentityProviderDetails: BridgedDictionary { - public convenience init(domain: String, protocol: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.domain] = domain.jsValue - object[Strings.protocol] = `protocol`.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _domain = ReadWriteAttribute(jsObject: object, name: Strings.domain) - _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var domain: String - - @ReadWriteAttribute - public var `protocol`: String -} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift b/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift deleted file mode 100644 index af0c909d..00000000 --- a/Sources/DOMKit/WebIDL/RTCIdentityProviderOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIdentityProviderOptions: BridgedDictionary { - public convenience init(protocol: String, usernameHint: String, peerIdentity: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.protocol] = `protocol`.jsValue - object[Strings.usernameHint] = usernameHint.jsValue - object[Strings.peerIdentity] = peerIdentity.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) - _usernameHint = ReadWriteAttribute(jsObject: object, name: Strings.usernameHint) - _peerIdentity = ReadWriteAttribute(jsObject: object, name: Strings.peerIdentity) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var `protocol`: String - - @ReadWriteAttribute - public var usernameHint: String - - @ReadWriteAttribute - public var peerIdentity: String -} diff --git a/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift b/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift deleted file mode 100644 index 349716c0..00000000 --- a/Sources/DOMKit/WebIDL/RTCIdentityValidationResult.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCIdentityValidationResult: BridgedDictionary { - public convenience init(identity: String, contents: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.identity] = identity.jsValue - object[Strings.contents] = contents.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _identity = ReadWriteAttribute(jsObject: object, name: Strings.identity) - _contents = ReadWriteAttribute(jsObject: object, name: Strings.contents) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var identity: String - - @ReadWriteAttribute - public var contents: String -} diff --git a/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift deleted file mode 100644 index 7db6bad7..00000000 --- a/Sources/DOMKit/WebIDL/RTCInboundRtpStreamStats.swift +++ /dev/null @@ -1,235 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCInboundRtpStreamStats: BridgedDictionary { - public convenience init(receiverId: String, remoteId: String, framesDecoded: UInt32, keyFramesDecoded: UInt32, frameWidth: UInt32, frameHeight: UInt32, frameBitDepth: UInt32, framesPerSecond: Double, qpSum: UInt64, totalDecodeTime: Double, totalInterFrameDelay: Double, totalSquaredInterFrameDelay: Double, voiceActivityFlag: Bool, lastPacketReceivedTimestamp: DOMHighResTimeStamp, averageRtcpInterval: Double, headerBytesReceived: UInt64, fecPacketsReceived: UInt64, fecPacketsDiscarded: UInt64, bytesReceived: UInt64, packetsFailedDecryption: UInt64, packetsDuplicated: UInt64, perDscpPacketsReceived: [String: UInt64], nackCount: UInt32, firCount: UInt32, pliCount: UInt32, sliCount: UInt32, totalProcessingDelay: Double, estimatedPlayoutTimestamp: DOMHighResTimeStamp, jitterBufferDelay: Double, jitterBufferEmittedCount: UInt64, totalSamplesReceived: UInt64, totalSamplesDecoded: UInt64, samplesDecodedWithSilk: UInt64, samplesDecodedWithCelt: UInt64, concealedSamples: UInt64, silentConcealedSamples: UInt64, concealmentEvents: UInt64, insertedSamplesForDeceleration: UInt64, removedSamplesForAcceleration: UInt64, audioLevel: Double, totalAudioEnergy: Double, totalSamplesDuration: Double, framesReceived: UInt32, decoderImplementation: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.receiverId] = receiverId.jsValue - object[Strings.remoteId] = remoteId.jsValue - object[Strings.framesDecoded] = framesDecoded.jsValue - object[Strings.keyFramesDecoded] = keyFramesDecoded.jsValue - object[Strings.frameWidth] = frameWidth.jsValue - object[Strings.frameHeight] = frameHeight.jsValue - object[Strings.frameBitDepth] = frameBitDepth.jsValue - object[Strings.framesPerSecond] = framesPerSecond.jsValue - object[Strings.qpSum] = qpSum.jsValue - object[Strings.totalDecodeTime] = totalDecodeTime.jsValue - object[Strings.totalInterFrameDelay] = totalInterFrameDelay.jsValue - object[Strings.totalSquaredInterFrameDelay] = totalSquaredInterFrameDelay.jsValue - object[Strings.voiceActivityFlag] = voiceActivityFlag.jsValue - object[Strings.lastPacketReceivedTimestamp] = lastPacketReceivedTimestamp.jsValue - object[Strings.averageRtcpInterval] = averageRtcpInterval.jsValue - object[Strings.headerBytesReceived] = headerBytesReceived.jsValue - object[Strings.fecPacketsReceived] = fecPacketsReceived.jsValue - object[Strings.fecPacketsDiscarded] = fecPacketsDiscarded.jsValue - object[Strings.bytesReceived] = bytesReceived.jsValue - object[Strings.packetsFailedDecryption] = packetsFailedDecryption.jsValue - object[Strings.packetsDuplicated] = packetsDuplicated.jsValue - object[Strings.perDscpPacketsReceived] = perDscpPacketsReceived.jsValue - object[Strings.nackCount] = nackCount.jsValue - object[Strings.firCount] = firCount.jsValue - object[Strings.pliCount] = pliCount.jsValue - object[Strings.sliCount] = sliCount.jsValue - object[Strings.totalProcessingDelay] = totalProcessingDelay.jsValue - object[Strings.estimatedPlayoutTimestamp] = estimatedPlayoutTimestamp.jsValue - object[Strings.jitterBufferDelay] = jitterBufferDelay.jsValue - object[Strings.jitterBufferEmittedCount] = jitterBufferEmittedCount.jsValue - object[Strings.totalSamplesReceived] = totalSamplesReceived.jsValue - object[Strings.totalSamplesDecoded] = totalSamplesDecoded.jsValue - object[Strings.samplesDecodedWithSilk] = samplesDecodedWithSilk.jsValue - object[Strings.samplesDecodedWithCelt] = samplesDecodedWithCelt.jsValue - object[Strings.concealedSamples] = concealedSamples.jsValue - object[Strings.silentConcealedSamples] = silentConcealedSamples.jsValue - object[Strings.concealmentEvents] = concealmentEvents.jsValue - object[Strings.insertedSamplesForDeceleration] = insertedSamplesForDeceleration.jsValue - object[Strings.removedSamplesForAcceleration] = removedSamplesForAcceleration.jsValue - object[Strings.audioLevel] = audioLevel.jsValue - object[Strings.totalAudioEnergy] = totalAudioEnergy.jsValue - object[Strings.totalSamplesDuration] = totalSamplesDuration.jsValue - object[Strings.framesReceived] = framesReceived.jsValue - object[Strings.decoderImplementation] = decoderImplementation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _receiverId = ReadWriteAttribute(jsObject: object, name: Strings.receiverId) - _remoteId = ReadWriteAttribute(jsObject: object, name: Strings.remoteId) - _framesDecoded = ReadWriteAttribute(jsObject: object, name: Strings.framesDecoded) - _keyFramesDecoded = ReadWriteAttribute(jsObject: object, name: Strings.keyFramesDecoded) - _frameWidth = ReadWriteAttribute(jsObject: object, name: Strings.frameWidth) - _frameHeight = ReadWriteAttribute(jsObject: object, name: Strings.frameHeight) - _frameBitDepth = ReadWriteAttribute(jsObject: object, name: Strings.frameBitDepth) - _framesPerSecond = ReadWriteAttribute(jsObject: object, name: Strings.framesPerSecond) - _qpSum = ReadWriteAttribute(jsObject: object, name: Strings.qpSum) - _totalDecodeTime = ReadWriteAttribute(jsObject: object, name: Strings.totalDecodeTime) - _totalInterFrameDelay = ReadWriteAttribute(jsObject: object, name: Strings.totalInterFrameDelay) - _totalSquaredInterFrameDelay = ReadWriteAttribute(jsObject: object, name: Strings.totalSquaredInterFrameDelay) - _voiceActivityFlag = ReadWriteAttribute(jsObject: object, name: Strings.voiceActivityFlag) - _lastPacketReceivedTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastPacketReceivedTimestamp) - _averageRtcpInterval = ReadWriteAttribute(jsObject: object, name: Strings.averageRtcpInterval) - _headerBytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.headerBytesReceived) - _fecPacketsReceived = ReadWriteAttribute(jsObject: object, name: Strings.fecPacketsReceived) - _fecPacketsDiscarded = ReadWriteAttribute(jsObject: object, name: Strings.fecPacketsDiscarded) - _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) - _packetsFailedDecryption = ReadWriteAttribute(jsObject: object, name: Strings.packetsFailedDecryption) - _packetsDuplicated = ReadWriteAttribute(jsObject: object, name: Strings.packetsDuplicated) - _perDscpPacketsReceived = ReadWriteAttribute(jsObject: object, name: Strings.perDscpPacketsReceived) - _nackCount = ReadWriteAttribute(jsObject: object, name: Strings.nackCount) - _firCount = ReadWriteAttribute(jsObject: object, name: Strings.firCount) - _pliCount = ReadWriteAttribute(jsObject: object, name: Strings.pliCount) - _sliCount = ReadWriteAttribute(jsObject: object, name: Strings.sliCount) - _totalProcessingDelay = ReadWriteAttribute(jsObject: object, name: Strings.totalProcessingDelay) - _estimatedPlayoutTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.estimatedPlayoutTimestamp) - _jitterBufferDelay = ReadWriteAttribute(jsObject: object, name: Strings.jitterBufferDelay) - _jitterBufferEmittedCount = ReadWriteAttribute(jsObject: object, name: Strings.jitterBufferEmittedCount) - _totalSamplesReceived = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesReceived) - _totalSamplesDecoded = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesDecoded) - _samplesDecodedWithSilk = ReadWriteAttribute(jsObject: object, name: Strings.samplesDecodedWithSilk) - _samplesDecodedWithCelt = ReadWriteAttribute(jsObject: object, name: Strings.samplesDecodedWithCelt) - _concealedSamples = ReadWriteAttribute(jsObject: object, name: Strings.concealedSamples) - _silentConcealedSamples = ReadWriteAttribute(jsObject: object, name: Strings.silentConcealedSamples) - _concealmentEvents = ReadWriteAttribute(jsObject: object, name: Strings.concealmentEvents) - _insertedSamplesForDeceleration = ReadWriteAttribute(jsObject: object, name: Strings.insertedSamplesForDeceleration) - _removedSamplesForAcceleration = ReadWriteAttribute(jsObject: object, name: Strings.removedSamplesForAcceleration) - _audioLevel = ReadWriteAttribute(jsObject: object, name: Strings.audioLevel) - _totalAudioEnergy = ReadWriteAttribute(jsObject: object, name: Strings.totalAudioEnergy) - _totalSamplesDuration = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesDuration) - _framesReceived = ReadWriteAttribute(jsObject: object, name: Strings.framesReceived) - _decoderImplementation = ReadWriteAttribute(jsObject: object, name: Strings.decoderImplementation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var receiverId: String - - @ReadWriteAttribute - public var remoteId: String - - @ReadWriteAttribute - public var framesDecoded: UInt32 - - @ReadWriteAttribute - public var keyFramesDecoded: UInt32 - - @ReadWriteAttribute - public var frameWidth: UInt32 - - @ReadWriteAttribute - public var frameHeight: UInt32 - - @ReadWriteAttribute - public var frameBitDepth: UInt32 - - @ReadWriteAttribute - public var framesPerSecond: Double - - @ReadWriteAttribute - public var qpSum: UInt64 - - @ReadWriteAttribute - public var totalDecodeTime: Double - - @ReadWriteAttribute - public var totalInterFrameDelay: Double - - @ReadWriteAttribute - public var totalSquaredInterFrameDelay: Double - - @ReadWriteAttribute - public var voiceActivityFlag: Bool - - @ReadWriteAttribute - public var lastPacketReceivedTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var averageRtcpInterval: Double - - @ReadWriteAttribute - public var headerBytesReceived: UInt64 - - @ReadWriteAttribute - public var fecPacketsReceived: UInt64 - - @ReadWriteAttribute - public var fecPacketsDiscarded: UInt64 - - @ReadWriteAttribute - public var bytesReceived: UInt64 - - @ReadWriteAttribute - public var packetsFailedDecryption: UInt64 - - @ReadWriteAttribute - public var packetsDuplicated: UInt64 - - @ReadWriteAttribute - public var perDscpPacketsReceived: [String: UInt64] - - @ReadWriteAttribute - public var nackCount: UInt32 - - @ReadWriteAttribute - public var firCount: UInt32 - - @ReadWriteAttribute - public var pliCount: UInt32 - - @ReadWriteAttribute - public var sliCount: UInt32 - - @ReadWriteAttribute - public var totalProcessingDelay: Double - - @ReadWriteAttribute - public var estimatedPlayoutTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var jitterBufferDelay: Double - - @ReadWriteAttribute - public var jitterBufferEmittedCount: UInt64 - - @ReadWriteAttribute - public var totalSamplesReceived: UInt64 - - @ReadWriteAttribute - public var totalSamplesDecoded: UInt64 - - @ReadWriteAttribute - public var samplesDecodedWithSilk: UInt64 - - @ReadWriteAttribute - public var samplesDecodedWithCelt: UInt64 - - @ReadWriteAttribute - public var concealedSamples: UInt64 - - @ReadWriteAttribute - public var silentConcealedSamples: UInt64 - - @ReadWriteAttribute - public var concealmentEvents: UInt64 - - @ReadWriteAttribute - public var insertedSamplesForDeceleration: UInt64 - - @ReadWriteAttribute - public var removedSamplesForAcceleration: UInt64 - - @ReadWriteAttribute - public var audioLevel: Double - - @ReadWriteAttribute - public var totalAudioEnergy: Double - - @ReadWriteAttribute - public var totalSamplesDuration: Double - - @ReadWriteAttribute - public var framesReceived: UInt32 - - @ReadWriteAttribute - public var decoderImplementation: String -} diff --git a/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift b/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift deleted file mode 100644 index 3e838af3..00000000 --- a/Sources/DOMKit/WebIDL/RTCInsertableStreams.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCInsertableStreams: 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/RTCLocalSessionDescriptionInit.swift b/Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift deleted file mode 100644 index 10447608..00000000 --- a/Sources/DOMKit/WebIDL/RTCLocalSessionDescriptionInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCLocalSessionDescriptionInit: BridgedDictionary { - public convenience init(type: RTCSdpType, sdp: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.sdp] = sdp.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _sdp = ReadWriteAttribute(jsObject: object, name: Strings.sdp) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: RTCSdpType - - @ReadWriteAttribute - public var sdp: String -} diff --git a/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift b/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift deleted file mode 100644 index e9d5f091..00000000 --- a/Sources/DOMKit/WebIDL/RTCMediaHandlerStats.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCMediaHandlerStats: BridgedDictionary { - public convenience init(trackIdentifier: String, ended: Bool, kind: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.trackIdentifier] = trackIdentifier.jsValue - object[Strings.ended] = ended.jsValue - object[Strings.kind] = kind.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _trackIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.trackIdentifier) - _ended = ReadWriteAttribute(jsObject: object, name: Strings.ended) - _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var trackIdentifier: String - - @ReadWriteAttribute - public var ended: Bool - - @ReadWriteAttribute - public var kind: String -} diff --git a/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift b/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift deleted file mode 100644 index b3d1549a..00000000 --- a/Sources/DOMKit/WebIDL/RTCMediaSourceStats.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCMediaSourceStats: BridgedDictionary { - public convenience init(trackIdentifier: String, kind: String, relayedSource: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.trackIdentifier] = trackIdentifier.jsValue - object[Strings.kind] = kind.jsValue - object[Strings.relayedSource] = relayedSource.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _trackIdentifier = ReadWriteAttribute(jsObject: object, name: Strings.trackIdentifier) - _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) - _relayedSource = ReadWriteAttribute(jsObject: object, name: Strings.relayedSource) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var trackIdentifier: String - - @ReadWriteAttribute - public var kind: String - - @ReadWriteAttribute - public var relayedSource: Bool -} diff --git a/Sources/DOMKit/WebIDL/RTCOfferAnswerOptions.swift b/Sources/DOMKit/WebIDL/RTCOfferAnswerOptions.swift deleted file mode 100644 index 9dae63ca..00000000 --- a/Sources/DOMKit/WebIDL/RTCOfferAnswerOptions.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCOfferAnswerOptions: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCOfferOptions.swift b/Sources/DOMKit/WebIDL/RTCOfferOptions.swift deleted file mode 100644 index 9ad0a418..00000000 --- a/Sources/DOMKit/WebIDL/RTCOfferOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCOfferOptions: BridgedDictionary { - public convenience init(iceRestart: Bool, offerToReceiveAudio: Bool, offerToReceiveVideo: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.iceRestart] = iceRestart.jsValue - object[Strings.offerToReceiveAudio] = offerToReceiveAudio.jsValue - object[Strings.offerToReceiveVideo] = offerToReceiveVideo.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _iceRestart = ReadWriteAttribute(jsObject: object, name: Strings.iceRestart) - _offerToReceiveAudio = ReadWriteAttribute(jsObject: object, name: Strings.offerToReceiveAudio) - _offerToReceiveVideo = ReadWriteAttribute(jsObject: object, name: Strings.offerToReceiveVideo) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var iceRestart: Bool - - @ReadWriteAttribute - public var offerToReceiveAudio: Bool - - @ReadWriteAttribute - public var offerToReceiveVideo: Bool -} diff --git a/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift deleted file mode 100644 index 96ac0a6a..00000000 --- a/Sources/DOMKit/WebIDL/RTCOutboundRtpStreamStats.swift +++ /dev/null @@ -1,215 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCOutboundRtpStreamStats: BridgedDictionary { - public convenience init(rtxSsrc: UInt32, mediaSourceId: String, senderId: String, remoteId: String, rid: String, lastPacketSentTimestamp: DOMHighResTimeStamp, headerBytesSent: UInt64, packetsDiscardedOnSend: UInt32, bytesDiscardedOnSend: UInt64, fecPacketsSent: UInt32, retransmittedPacketsSent: UInt64, retransmittedBytesSent: UInt64, targetBitrate: Double, totalEncodedBytesTarget: UInt64, frameWidth: UInt32, frameHeight: UInt32, frameBitDepth: UInt32, framesPerSecond: Double, framesSent: UInt32, hugeFramesSent: UInt32, framesEncoded: UInt32, keyFramesEncoded: UInt32, framesDiscardedOnSend: UInt32, qpSum: UInt64, totalSamplesSent: UInt64, samplesEncodedWithSilk: UInt64, samplesEncodedWithCelt: UInt64, voiceActivityFlag: Bool, totalEncodeTime: Double, totalPacketSendDelay: Double, averageRtcpInterval: Double, qualityLimitationReason: RTCQualityLimitationReason, qualityLimitationDurations: [String: Double], qualityLimitationResolutionChanges: UInt32, perDscpPacketsSent: [String: UInt64], nackCount: UInt32, firCount: UInt32, pliCount: UInt32, sliCount: UInt32, encoderImplementation: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rtxSsrc] = rtxSsrc.jsValue - object[Strings.mediaSourceId] = mediaSourceId.jsValue - object[Strings.senderId] = senderId.jsValue - object[Strings.remoteId] = remoteId.jsValue - object[Strings.rid] = rid.jsValue - object[Strings.lastPacketSentTimestamp] = lastPacketSentTimestamp.jsValue - object[Strings.headerBytesSent] = headerBytesSent.jsValue - object[Strings.packetsDiscardedOnSend] = packetsDiscardedOnSend.jsValue - object[Strings.bytesDiscardedOnSend] = bytesDiscardedOnSend.jsValue - object[Strings.fecPacketsSent] = fecPacketsSent.jsValue - object[Strings.retransmittedPacketsSent] = retransmittedPacketsSent.jsValue - object[Strings.retransmittedBytesSent] = retransmittedBytesSent.jsValue - object[Strings.targetBitrate] = targetBitrate.jsValue - object[Strings.totalEncodedBytesTarget] = totalEncodedBytesTarget.jsValue - object[Strings.frameWidth] = frameWidth.jsValue - object[Strings.frameHeight] = frameHeight.jsValue - object[Strings.frameBitDepth] = frameBitDepth.jsValue - object[Strings.framesPerSecond] = framesPerSecond.jsValue - object[Strings.framesSent] = framesSent.jsValue - object[Strings.hugeFramesSent] = hugeFramesSent.jsValue - object[Strings.framesEncoded] = framesEncoded.jsValue - object[Strings.keyFramesEncoded] = keyFramesEncoded.jsValue - object[Strings.framesDiscardedOnSend] = framesDiscardedOnSend.jsValue - object[Strings.qpSum] = qpSum.jsValue - object[Strings.totalSamplesSent] = totalSamplesSent.jsValue - object[Strings.samplesEncodedWithSilk] = samplesEncodedWithSilk.jsValue - object[Strings.samplesEncodedWithCelt] = samplesEncodedWithCelt.jsValue - object[Strings.voiceActivityFlag] = voiceActivityFlag.jsValue - object[Strings.totalEncodeTime] = totalEncodeTime.jsValue - object[Strings.totalPacketSendDelay] = totalPacketSendDelay.jsValue - object[Strings.averageRtcpInterval] = averageRtcpInterval.jsValue - object[Strings.qualityLimitationReason] = qualityLimitationReason.jsValue - object[Strings.qualityLimitationDurations] = qualityLimitationDurations.jsValue - object[Strings.qualityLimitationResolutionChanges] = qualityLimitationResolutionChanges.jsValue - object[Strings.perDscpPacketsSent] = perDscpPacketsSent.jsValue - object[Strings.nackCount] = nackCount.jsValue - object[Strings.firCount] = firCount.jsValue - object[Strings.pliCount] = pliCount.jsValue - object[Strings.sliCount] = sliCount.jsValue - object[Strings.encoderImplementation] = encoderImplementation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _rtxSsrc = ReadWriteAttribute(jsObject: object, name: Strings.rtxSsrc) - _mediaSourceId = ReadWriteAttribute(jsObject: object, name: Strings.mediaSourceId) - _senderId = ReadWriteAttribute(jsObject: object, name: Strings.senderId) - _remoteId = ReadWriteAttribute(jsObject: object, name: Strings.remoteId) - _rid = ReadWriteAttribute(jsObject: object, name: Strings.rid) - _lastPacketSentTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.lastPacketSentTimestamp) - _headerBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.headerBytesSent) - _packetsDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.packetsDiscardedOnSend) - _bytesDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.bytesDiscardedOnSend) - _fecPacketsSent = ReadWriteAttribute(jsObject: object, name: Strings.fecPacketsSent) - _retransmittedPacketsSent = ReadWriteAttribute(jsObject: object, name: Strings.retransmittedPacketsSent) - _retransmittedBytesSent = ReadWriteAttribute(jsObject: object, name: Strings.retransmittedBytesSent) - _targetBitrate = ReadWriteAttribute(jsObject: object, name: Strings.targetBitrate) - _totalEncodedBytesTarget = ReadWriteAttribute(jsObject: object, name: Strings.totalEncodedBytesTarget) - _frameWidth = ReadWriteAttribute(jsObject: object, name: Strings.frameWidth) - _frameHeight = ReadWriteAttribute(jsObject: object, name: Strings.frameHeight) - _frameBitDepth = ReadWriteAttribute(jsObject: object, name: Strings.frameBitDepth) - _framesPerSecond = ReadWriteAttribute(jsObject: object, name: Strings.framesPerSecond) - _framesSent = ReadWriteAttribute(jsObject: object, name: Strings.framesSent) - _hugeFramesSent = ReadWriteAttribute(jsObject: object, name: Strings.hugeFramesSent) - _framesEncoded = ReadWriteAttribute(jsObject: object, name: Strings.framesEncoded) - _keyFramesEncoded = ReadWriteAttribute(jsObject: object, name: Strings.keyFramesEncoded) - _framesDiscardedOnSend = ReadWriteAttribute(jsObject: object, name: Strings.framesDiscardedOnSend) - _qpSum = ReadWriteAttribute(jsObject: object, name: Strings.qpSum) - _totalSamplesSent = ReadWriteAttribute(jsObject: object, name: Strings.totalSamplesSent) - _samplesEncodedWithSilk = ReadWriteAttribute(jsObject: object, name: Strings.samplesEncodedWithSilk) - _samplesEncodedWithCelt = ReadWriteAttribute(jsObject: object, name: Strings.samplesEncodedWithCelt) - _voiceActivityFlag = ReadWriteAttribute(jsObject: object, name: Strings.voiceActivityFlag) - _totalEncodeTime = ReadWriteAttribute(jsObject: object, name: Strings.totalEncodeTime) - _totalPacketSendDelay = ReadWriteAttribute(jsObject: object, name: Strings.totalPacketSendDelay) - _averageRtcpInterval = ReadWriteAttribute(jsObject: object, name: Strings.averageRtcpInterval) - _qualityLimitationReason = ReadWriteAttribute(jsObject: object, name: Strings.qualityLimitationReason) - _qualityLimitationDurations = ReadWriteAttribute(jsObject: object, name: Strings.qualityLimitationDurations) - _qualityLimitationResolutionChanges = ReadWriteAttribute(jsObject: object, name: Strings.qualityLimitationResolutionChanges) - _perDscpPacketsSent = ReadWriteAttribute(jsObject: object, name: Strings.perDscpPacketsSent) - _nackCount = ReadWriteAttribute(jsObject: object, name: Strings.nackCount) - _firCount = ReadWriteAttribute(jsObject: object, name: Strings.firCount) - _pliCount = ReadWriteAttribute(jsObject: object, name: Strings.pliCount) - _sliCount = ReadWriteAttribute(jsObject: object, name: Strings.sliCount) - _encoderImplementation = ReadWriteAttribute(jsObject: object, name: Strings.encoderImplementation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var rtxSsrc: UInt32 - - @ReadWriteAttribute - public var mediaSourceId: String - - @ReadWriteAttribute - public var senderId: String - - @ReadWriteAttribute - public var remoteId: String - - @ReadWriteAttribute - public var rid: String - - @ReadWriteAttribute - public var lastPacketSentTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var headerBytesSent: UInt64 - - @ReadWriteAttribute - public var packetsDiscardedOnSend: UInt32 - - @ReadWriteAttribute - public var bytesDiscardedOnSend: UInt64 - - @ReadWriteAttribute - public var fecPacketsSent: UInt32 - - @ReadWriteAttribute - public var retransmittedPacketsSent: UInt64 - - @ReadWriteAttribute - public var retransmittedBytesSent: UInt64 - - @ReadWriteAttribute - public var targetBitrate: Double - - @ReadWriteAttribute - public var totalEncodedBytesTarget: UInt64 - - @ReadWriteAttribute - public var frameWidth: UInt32 - - @ReadWriteAttribute - public var frameHeight: UInt32 - - @ReadWriteAttribute - public var frameBitDepth: UInt32 - - @ReadWriteAttribute - public var framesPerSecond: Double - - @ReadWriteAttribute - public var framesSent: UInt32 - - @ReadWriteAttribute - public var hugeFramesSent: UInt32 - - @ReadWriteAttribute - public var framesEncoded: UInt32 - - @ReadWriteAttribute - public var keyFramesEncoded: UInt32 - - @ReadWriteAttribute - public var framesDiscardedOnSend: UInt32 - - @ReadWriteAttribute - public var qpSum: UInt64 - - @ReadWriteAttribute - public var totalSamplesSent: UInt64 - - @ReadWriteAttribute - public var samplesEncodedWithSilk: UInt64 - - @ReadWriteAttribute - public var samplesEncodedWithCelt: UInt64 - - @ReadWriteAttribute - public var voiceActivityFlag: Bool - - @ReadWriteAttribute - public var totalEncodeTime: Double - - @ReadWriteAttribute - public var totalPacketSendDelay: Double - - @ReadWriteAttribute - public var averageRtcpInterval: Double - - @ReadWriteAttribute - public var qualityLimitationReason: RTCQualityLimitationReason - - @ReadWriteAttribute - public var qualityLimitationDurations: [String: Double] - - @ReadWriteAttribute - public var qualityLimitationResolutionChanges: UInt32 - - @ReadWriteAttribute - public var perDscpPacketsSent: [String: UInt64] - - @ReadWriteAttribute - public var nackCount: UInt32 - - @ReadWriteAttribute - public var firCount: UInt32 - - @ReadWriteAttribute - public var pliCount: UInt32 - - @ReadWriteAttribute - public var sliCount: UInt32 - - @ReadWriteAttribute - public var encoderImplementation: String -} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift b/Sources/DOMKit/WebIDL/RTCPeerConnection.swift deleted file mode 100644 index cd5f438c..00000000 --- a/Sources/DOMKit/WebIDL/RTCPeerConnection.swift +++ /dev/null @@ -1,248 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCPeerConnection: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnection].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _peerIdentity = ReadonlyAttribute(jsObject: jsObject, name: Strings.peerIdentity) - _idpLoginUrl = ReadonlyAttribute(jsObject: jsObject, name: Strings.idpLoginUrl) - _idpErrorInfo = ReadonlyAttribute(jsObject: jsObject, name: Strings.idpErrorInfo) - _localDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.localDescription) - _currentLocalDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentLocalDescription) - _pendingLocalDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.pendingLocalDescription) - _remoteDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.remoteDescription) - _currentRemoteDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentRemoteDescription) - _pendingRemoteDescription = ReadonlyAttribute(jsObject: jsObject, name: Strings.pendingRemoteDescription) - _signalingState = ReadonlyAttribute(jsObject: jsObject, name: Strings.signalingState) - _iceGatheringState = ReadonlyAttribute(jsObject: jsObject, name: Strings.iceGatheringState) - _iceConnectionState = ReadonlyAttribute(jsObject: jsObject, name: Strings.iceConnectionState) - _connectionState = ReadonlyAttribute(jsObject: jsObject, name: Strings.connectionState) - _canTrickleIceCandidates = ReadonlyAttribute(jsObject: jsObject, name: Strings.canTrickleIceCandidates) - _onnegotiationneeded = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnegotiationneeded) - _onicecandidate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onicecandidate) - _onicecandidateerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onicecandidateerror) - _onsignalingstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsignalingstatechange) - _oniceconnectionstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oniceconnectionstatechange) - _onicegatheringstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onicegatheringstatechange) - _onconnectionstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnectionstatechange) - _ontrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ontrack) - _sctp = ReadonlyAttribute(jsObject: jsObject, name: Strings.sctp) - _ondatachannel = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondatachannel) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func setIdentityProvider(provider: String, options: RTCIdentityProviderOptions? = nil) { - let this = jsObject - _ = this[Strings.setIdentityProvider].function!(this: this, arguments: [provider.jsValue, options?.jsValue ?? .undefined]) - } - - @inlinable public func getIdentityAssertion() -> JSPromise { - let this = jsObject - return this[Strings.getIdentityAssertion].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getIdentityAssertion() async throws -> String { - let this = jsObject - let _promise: JSPromise = this[Strings.getIdentityAssertion].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var peerIdentity: JSPromise - - @ReadonlyAttribute - public var idpLoginUrl: String? - - @ReadonlyAttribute - public var idpErrorInfo: String? - - @inlinable public convenience init(configuration: RTCConfiguration? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration?.jsValue ?? .undefined])) - } - - // XXX: member 'createOffer' is ignored - - // XXX: member 'createOffer' is ignored - - // XXX: member 'createAnswer' is ignored - - // XXX: member 'createAnswer' is ignored - - // XXX: member 'setLocalDescription' is ignored - - // XXX: member 'setLocalDescription' is ignored - - @ReadonlyAttribute - public var localDescription: RTCSessionDescription? - - @ReadonlyAttribute - public var currentLocalDescription: RTCSessionDescription? - - @ReadonlyAttribute - public var pendingLocalDescription: RTCSessionDescription? - - // XXX: member 'setRemoteDescription' is ignored - - // XXX: member 'setRemoteDescription' is ignored - - @ReadonlyAttribute - public var remoteDescription: RTCSessionDescription? - - @ReadonlyAttribute - public var currentRemoteDescription: RTCSessionDescription? - - @ReadonlyAttribute - public var pendingRemoteDescription: RTCSessionDescription? - - // XXX: member 'addIceCandidate' is ignored - - // XXX: member 'addIceCandidate' is ignored - - @ReadonlyAttribute - public var signalingState: RTCSignalingState - - @ReadonlyAttribute - public var iceGatheringState: RTCIceGatheringState - - @ReadonlyAttribute - public var iceConnectionState: RTCIceConnectionState - - @ReadonlyAttribute - public var connectionState: RTCPeerConnectionState - - @ReadonlyAttribute - public var canTrickleIceCandidates: Bool? - - @inlinable public func restartIce() { - let this = jsObject - _ = this[Strings.restartIce].function!(this: this, arguments: []) - } - - @inlinable public func getConfiguration() -> RTCConfiguration { - let this = jsObject - return this[Strings.getConfiguration].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func setConfiguration(configuration: RTCConfiguration? = nil) { - let this = jsObject - _ = this[Strings.setConfiguration].function!(this: this, arguments: [configuration?.jsValue ?? .undefined]) - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var onnegotiationneeded: EventHandler - - @ClosureAttribute1Optional - public var onicecandidate: EventHandler - - @ClosureAttribute1Optional - public var onicecandidateerror: EventHandler - - @ClosureAttribute1Optional - public var onsignalingstatechange: EventHandler - - @ClosureAttribute1Optional - public var oniceconnectionstatechange: EventHandler - - @ClosureAttribute1Optional - public var onicegatheringstatechange: EventHandler - - @ClosureAttribute1Optional - public var onconnectionstatechange: EventHandler - - // XXX: member 'createOffer' is ignored - - // XXX: member 'createOffer' is ignored - - // XXX: member 'setLocalDescription' is ignored - - // XXX: member 'setLocalDescription' is ignored - - // XXX: member 'createAnswer' is ignored - - // XXX: member 'createAnswer' is ignored - - // XXX: member 'setRemoteDescription' is ignored - - // XXX: member 'setRemoteDescription' is ignored - - // XXX: member 'addIceCandidate' is ignored - - // XXX: member 'addIceCandidate' is ignored - - @inlinable public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) -> JSPromise { - let this = constructor - return this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func generateCertificate(keygenAlgorithm: AlgorithmIdentifier) async throws -> RTCCertificate { - let this = constructor - let _promise: JSPromise = this[Strings.generateCertificate].function!(this: this, arguments: [keygenAlgorithm.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getSenders() -> [RTCRtpSender] { - let this = jsObject - return this[Strings.getSenders].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getReceivers() -> [RTCRtpReceiver] { - let this = jsObject - return this[Strings.getReceivers].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getTransceivers() -> [RTCRtpTransceiver] { - let this = jsObject - return this[Strings.getTransceivers].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func addTrack(track: MediaStreamTrack, streams: MediaStream...) -> RTCRtpSender { - let this = jsObject - return this[Strings.addTrack].function!(this: this, arguments: [track.jsValue] + streams.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func removeTrack(sender: RTCRtpSender) { - let this = jsObject - _ = this[Strings.removeTrack].function!(this: this, arguments: [sender.jsValue]) - } - - @inlinable public func addTransceiver(trackOrKind: MediaStreamTrack_or_String, init: RTCRtpTransceiverInit? = nil) -> RTCRtpTransceiver { - let this = jsObject - return this[Strings.addTransceiver].function!(this: this, arguments: [trackOrKind.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! - } - - @ClosureAttribute1Optional - public var ontrack: EventHandler - - @ReadonlyAttribute - public var sctp: RTCSctpTransport? - - @inlinable public func createDataChannel(label: String, dataChannelDict: RTCDataChannelInit? = nil) -> RTCDataChannel { - let this = jsObject - return this[Strings.createDataChannel].function!(this: this, arguments: [label.jsValue, dataChannelDict?.jsValue ?? .undefined]).fromJSValue()! - } - - @ClosureAttribute1Optional - public var ondatachannel: EventHandler - - @inlinable public func getStats(selector: MediaStreamTrack? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getStats(selector: MediaStreamTrack? = nil) async throws -> RTCStatsReport { - let this = jsObject - let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: [selector?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift deleted file mode 100644 index 19093338..00000000 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEvent.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCPeerConnectionIceErrorEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnectionIceErrorEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _address = ReadonlyAttribute(jsObject: jsObject, name: Strings.address) - _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - _errorCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorCode) - _errorText = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorText) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: RTCPeerConnectionIceErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var address: String? - - @ReadonlyAttribute - public var port: UInt16? - - @ReadonlyAttribute - public var url: String - - @ReadonlyAttribute - public var errorCode: UInt16 - - @ReadonlyAttribute - public var errorText: String -} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift deleted file mode 100644 index 67066a0f..00000000 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceErrorEventInit.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCPeerConnectionIceErrorEventInit: BridgedDictionary { - public convenience init(address: String?, port: UInt16?, url: String, errorCode: UInt16, errorText: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.address] = address.jsValue - object[Strings.port] = port.jsValue - object[Strings.url] = url.jsValue - object[Strings.errorCode] = errorCode.jsValue - object[Strings.errorText] = errorText.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _address = ReadWriteAttribute(jsObject: object, name: Strings.address) - _port = ReadWriteAttribute(jsObject: object, name: Strings.port) - _url = ReadWriteAttribute(jsObject: object, name: Strings.url) - _errorCode = ReadWriteAttribute(jsObject: object, name: Strings.errorCode) - _errorText = ReadWriteAttribute(jsObject: object, name: Strings.errorText) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var address: String? - - @ReadWriteAttribute - public var port: UInt16? - - @ReadWriteAttribute - public var url: String - - @ReadWriteAttribute - public var errorCode: UInt16 - - @ReadWriteAttribute - public var errorText: String -} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift deleted file mode 100644 index 43b719cc..00000000 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCPeerConnectionIceEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCPeerConnectionIceEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _candidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.candidate) - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: RTCPeerConnectionIceEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var candidate: RTCIceCandidate? - - @ReadonlyAttribute - public var url: String? -} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift deleted file mode 100644 index d42a48ef..00000000 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionIceEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCPeerConnectionIceEventInit: BridgedDictionary { - public convenience init(candidate: RTCIceCandidate?, url: String?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.candidate] = candidate.jsValue - object[Strings.url] = url.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _candidate = ReadWriteAttribute(jsObject: object, name: Strings.candidate) - _url = ReadWriteAttribute(jsObject: object, name: Strings.url) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var candidate: RTCIceCandidate? - - @ReadWriteAttribute - public var url: String? -} diff --git a/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift deleted file mode 100644 index 2ade7aaa..00000000 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionState.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCPeerConnectionState: JSString, JSValueCompatible { - case closed = "closed" - case failed = "failed" - case disconnected = "disconnected" - case new = "new" - case connecting = "connecting" - case connected = "connected" - - @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/RTCPeerConnectionStats.swift b/Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift deleted file mode 100644 index 2b779b04..00000000 --- a/Sources/DOMKit/WebIDL/RTCPeerConnectionStats.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCPeerConnectionStats: BridgedDictionary { - public convenience init(dataChannelsOpened: UInt32, dataChannelsClosed: UInt32, dataChannelsRequested: UInt32, dataChannelsAccepted: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataChannelsOpened] = dataChannelsOpened.jsValue - object[Strings.dataChannelsClosed] = dataChannelsClosed.jsValue - object[Strings.dataChannelsRequested] = dataChannelsRequested.jsValue - object[Strings.dataChannelsAccepted] = dataChannelsAccepted.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _dataChannelsOpened = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelsOpened) - _dataChannelsClosed = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelsClosed) - _dataChannelsRequested = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelsRequested) - _dataChannelsAccepted = ReadWriteAttribute(jsObject: object, name: Strings.dataChannelsAccepted) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var dataChannelsOpened: UInt32 - - @ReadWriteAttribute - public var dataChannelsClosed: UInt32 - - @ReadWriteAttribute - public var dataChannelsRequested: UInt32 - - @ReadWriteAttribute - public var dataChannelsAccepted: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/RTCPriorityType.swift b/Sources/DOMKit/WebIDL/RTCPriorityType.swift deleted file mode 100644 index 40795f20..00000000 --- a/Sources/DOMKit/WebIDL/RTCPriorityType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCPriorityType: JSString, JSValueCompatible { - case veryLow = "very-low" - case low = "low" - case medium = "medium" - case high = "high" - - @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/RTCQualityLimitationReason.swift b/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift deleted file mode 100644 index b96f5fff..00000000 --- a/Sources/DOMKit/WebIDL/RTCQualityLimitationReason.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCQualityLimitationReason: JSString, JSValueCompatible { - case none = "none" - case cpu = "cpu" - case bandwidth = "bandwidth" - case other = "other" - - @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/RTCReceivedRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift deleted file mode 100644 index 69d2ba97..00000000 --- a/Sources/DOMKit/WebIDL/RTCReceivedRtpStreamStats.swift +++ /dev/null @@ -1,95 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCReceivedRtpStreamStats: BridgedDictionary { - public convenience init(packetsReceived: UInt64, packetsLost: Int64, jitter: Double, packetsDiscarded: UInt64, packetsRepaired: UInt64, burstPacketsLost: UInt64, burstPacketsDiscarded: UInt64, burstLossCount: UInt32, burstDiscardCount: UInt32, burstLossRate: Double, burstDiscardRate: Double, gapLossRate: Double, gapDiscardRate: Double, framesDropped: UInt32, partialFramesLost: UInt32, fullFramesLost: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.packetsReceived] = packetsReceived.jsValue - object[Strings.packetsLost] = packetsLost.jsValue - object[Strings.jitter] = jitter.jsValue - object[Strings.packetsDiscarded] = packetsDiscarded.jsValue - object[Strings.packetsRepaired] = packetsRepaired.jsValue - object[Strings.burstPacketsLost] = burstPacketsLost.jsValue - object[Strings.burstPacketsDiscarded] = burstPacketsDiscarded.jsValue - object[Strings.burstLossCount] = burstLossCount.jsValue - object[Strings.burstDiscardCount] = burstDiscardCount.jsValue - object[Strings.burstLossRate] = burstLossRate.jsValue - object[Strings.burstDiscardRate] = burstDiscardRate.jsValue - object[Strings.gapLossRate] = gapLossRate.jsValue - object[Strings.gapDiscardRate] = gapDiscardRate.jsValue - object[Strings.framesDropped] = framesDropped.jsValue - object[Strings.partialFramesLost] = partialFramesLost.jsValue - object[Strings.fullFramesLost] = fullFramesLost.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _packetsReceived = ReadWriteAttribute(jsObject: object, name: Strings.packetsReceived) - _packetsLost = ReadWriteAttribute(jsObject: object, name: Strings.packetsLost) - _jitter = ReadWriteAttribute(jsObject: object, name: Strings.jitter) - _packetsDiscarded = ReadWriteAttribute(jsObject: object, name: Strings.packetsDiscarded) - _packetsRepaired = ReadWriteAttribute(jsObject: object, name: Strings.packetsRepaired) - _burstPacketsLost = ReadWriteAttribute(jsObject: object, name: Strings.burstPacketsLost) - _burstPacketsDiscarded = ReadWriteAttribute(jsObject: object, name: Strings.burstPacketsDiscarded) - _burstLossCount = ReadWriteAttribute(jsObject: object, name: Strings.burstLossCount) - _burstDiscardCount = ReadWriteAttribute(jsObject: object, name: Strings.burstDiscardCount) - _burstLossRate = ReadWriteAttribute(jsObject: object, name: Strings.burstLossRate) - _burstDiscardRate = ReadWriteAttribute(jsObject: object, name: Strings.burstDiscardRate) - _gapLossRate = ReadWriteAttribute(jsObject: object, name: Strings.gapLossRate) - _gapDiscardRate = ReadWriteAttribute(jsObject: object, name: Strings.gapDiscardRate) - _framesDropped = ReadWriteAttribute(jsObject: object, name: Strings.framesDropped) - _partialFramesLost = ReadWriteAttribute(jsObject: object, name: Strings.partialFramesLost) - _fullFramesLost = ReadWriteAttribute(jsObject: object, name: Strings.fullFramesLost) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var packetsReceived: UInt64 - - @ReadWriteAttribute - public var packetsLost: Int64 - - @ReadWriteAttribute - public var jitter: Double - - @ReadWriteAttribute - public var packetsDiscarded: UInt64 - - @ReadWriteAttribute - public var packetsRepaired: UInt64 - - @ReadWriteAttribute - public var burstPacketsLost: UInt64 - - @ReadWriteAttribute - public var burstPacketsDiscarded: UInt64 - - @ReadWriteAttribute - public var burstLossCount: UInt32 - - @ReadWriteAttribute - public var burstDiscardCount: UInt32 - - @ReadWriteAttribute - public var burstLossRate: Double - - @ReadWriteAttribute - public var burstDiscardRate: Double - - @ReadWriteAttribute - public var gapLossRate: Double - - @ReadWriteAttribute - public var gapDiscardRate: Double - - @ReadWriteAttribute - public var framesDropped: UInt32 - - @ReadWriteAttribute - public var partialFramesLost: UInt32 - - @ReadWriteAttribute - public var fullFramesLost: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift deleted file mode 100644 index dcc5a510..00000000 --- a/Sources/DOMKit/WebIDL/RTCRemoteInboundRtpStreamStats.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRemoteInboundRtpStreamStats: BridgedDictionary { - public convenience init(localId: String, roundTripTime: Double, totalRoundTripTime: Double, fractionLost: Double, reportsReceived: UInt64, roundTripTimeMeasurements: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.localId] = localId.jsValue - object[Strings.roundTripTime] = roundTripTime.jsValue - object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue - object[Strings.fractionLost] = fractionLost.jsValue - object[Strings.reportsReceived] = reportsReceived.jsValue - object[Strings.roundTripTimeMeasurements] = roundTripTimeMeasurements.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _localId = ReadWriteAttribute(jsObject: object, name: Strings.localId) - _roundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.roundTripTime) - _totalRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.totalRoundTripTime) - _fractionLost = ReadWriteAttribute(jsObject: object, name: Strings.fractionLost) - _reportsReceived = ReadWriteAttribute(jsObject: object, name: Strings.reportsReceived) - _roundTripTimeMeasurements = ReadWriteAttribute(jsObject: object, name: Strings.roundTripTimeMeasurements) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var localId: String - - @ReadWriteAttribute - public var roundTripTime: Double - - @ReadWriteAttribute - public var totalRoundTripTime: Double - - @ReadWriteAttribute - public var fractionLost: Double - - @ReadWriteAttribute - public var reportsReceived: UInt64 - - @ReadWriteAttribute - public var roundTripTimeMeasurements: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift deleted file mode 100644 index 9cce14b6..00000000 --- a/Sources/DOMKit/WebIDL/RTCRemoteOutboundRtpStreamStats.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRemoteOutboundRtpStreamStats: BridgedDictionary { - public convenience init(localId: String, remoteTimestamp: DOMHighResTimeStamp, reportsSent: UInt64, roundTripTime: Double, totalRoundTripTime: Double, roundTripTimeMeasurements: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.localId] = localId.jsValue - object[Strings.remoteTimestamp] = remoteTimestamp.jsValue - object[Strings.reportsSent] = reportsSent.jsValue - object[Strings.roundTripTime] = roundTripTime.jsValue - object[Strings.totalRoundTripTime] = totalRoundTripTime.jsValue - object[Strings.roundTripTimeMeasurements] = roundTripTimeMeasurements.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _localId = ReadWriteAttribute(jsObject: object, name: Strings.localId) - _remoteTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.remoteTimestamp) - _reportsSent = ReadWriteAttribute(jsObject: object, name: Strings.reportsSent) - _roundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.roundTripTime) - _totalRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.totalRoundTripTime) - _roundTripTimeMeasurements = ReadWriteAttribute(jsObject: object, name: Strings.roundTripTimeMeasurements) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var localId: String - - @ReadWriteAttribute - public var remoteTimestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var reportsSent: UInt64 - - @ReadWriteAttribute - public var roundTripTime: Double - - @ReadWriteAttribute - public var totalRoundTripTime: Double - - @ReadWriteAttribute - public var roundTripTimeMeasurements: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift b/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift deleted file mode 100644 index 6ef310d4..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtcpMuxPolicy.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCRtcpMuxPolicy: JSString, JSValueCompatible { - case require = "require" - - @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/RTCRtcpParameters.swift b/Sources/DOMKit/WebIDL/RTCRtcpParameters.swift deleted file mode 100644 index 4e8f02b5..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtcpParameters.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtcpParameters: BridgedDictionary { - public convenience init(cname: String, reducedSize: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.cname] = cname.jsValue - object[Strings.reducedSize] = reducedSize.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _cname = ReadWriteAttribute(jsObject: object, name: Strings.cname) - _reducedSize = ReadWriteAttribute(jsObject: object, name: Strings.reducedSize) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var cname: String - - @ReadWriteAttribute - public var reducedSize: Bool -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift b/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift deleted file mode 100644 index ca406d40..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpCapabilities.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpCapabilities: BridgedDictionary { - public convenience init(codecs: [RTCRtpCodecCapability], headerExtensions: [RTCRtpHeaderExtensionCapability]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.codecs] = codecs.jsValue - object[Strings.headerExtensions] = headerExtensions.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _codecs = ReadWriteAttribute(jsObject: object, name: Strings.codecs) - _headerExtensions = ReadWriteAttribute(jsObject: object, name: Strings.headerExtensions) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var codecs: [RTCRtpCodecCapability] - - @ReadWriteAttribute - public var headerExtensions: [RTCRtpHeaderExtensionCapability] -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift b/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift deleted file mode 100644 index d2687c60..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpCodecCapability.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpCodecCapability: BridgedDictionary { - public convenience init(scalabilityModes: [String], mimeType: String, clockRate: UInt32, channels: UInt16, sdpFmtpLine: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.scalabilityModes] = scalabilityModes.jsValue - object[Strings.mimeType] = mimeType.jsValue - object[Strings.clockRate] = clockRate.jsValue - object[Strings.channels] = channels.jsValue - object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _scalabilityModes = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityModes) - _mimeType = ReadWriteAttribute(jsObject: object, name: Strings.mimeType) - _clockRate = ReadWriteAttribute(jsObject: object, name: Strings.clockRate) - _channels = ReadWriteAttribute(jsObject: object, name: Strings.channels) - _sdpFmtpLine = ReadWriteAttribute(jsObject: object, name: Strings.sdpFmtpLine) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var scalabilityModes: [String] - - @ReadWriteAttribute - public var mimeType: String - - @ReadWriteAttribute - public var clockRate: UInt32 - - @ReadWriteAttribute - public var channels: UInt16 - - @ReadWriteAttribute - public var sdpFmtpLine: String -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift deleted file mode 100644 index 18e7edf9..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpCodecParameters.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpCodecParameters: BridgedDictionary { - public convenience init(payloadType: UInt8, mimeType: String, clockRate: UInt32, channels: UInt16, sdpFmtpLine: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.payloadType] = payloadType.jsValue - object[Strings.mimeType] = mimeType.jsValue - object[Strings.clockRate] = clockRate.jsValue - object[Strings.channels] = channels.jsValue - object[Strings.sdpFmtpLine] = sdpFmtpLine.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _payloadType = ReadWriteAttribute(jsObject: object, name: Strings.payloadType) - _mimeType = ReadWriteAttribute(jsObject: object, name: Strings.mimeType) - _clockRate = ReadWriteAttribute(jsObject: object, name: Strings.clockRate) - _channels = ReadWriteAttribute(jsObject: object, name: Strings.channels) - _sdpFmtpLine = ReadWriteAttribute(jsObject: object, name: Strings.sdpFmtpLine) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var payloadType: UInt8 - - @ReadWriteAttribute - public var mimeType: String - - @ReadWriteAttribute - public var clockRate: UInt32 - - @ReadWriteAttribute - public var channels: UInt16 - - @ReadWriteAttribute - public var sdpFmtpLine: String -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift deleted file mode 100644 index a8135981..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpCodingParameters.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpCodingParameters: BridgedDictionary { - public convenience init(rid: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rid] = rid.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _rid = ReadWriteAttribute(jsObject: object, name: Strings.rid) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var rid: String -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift b/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift deleted file mode 100644 index 8839b01d..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpContributingSource.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpContributingSource: BridgedDictionary { - public convenience init(timestamp: DOMHighResTimeStamp, source: UInt32, audioLevel: Double, rtpTimestamp: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue - object[Strings.source] = source.jsValue - object[Strings.audioLevel] = audioLevel.jsValue - object[Strings.rtpTimestamp] = rtpTimestamp.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _source = ReadWriteAttribute(jsObject: object, name: Strings.source) - _audioLevel = ReadWriteAttribute(jsObject: object, name: Strings.audioLevel) - _rtpTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.rtpTimestamp) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var timestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var source: UInt32 - - @ReadWriteAttribute - public var audioLevel: Double - - @ReadWriteAttribute - public var rtpTimestamp: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift b/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift deleted file mode 100644 index 7b497902..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpContributingSourceStats.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpContributingSourceStats: BridgedDictionary { - public convenience init(contributorSsrc: UInt32, inboundRtpStreamId: String, packetsContributedTo: UInt32, audioLevel: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contributorSsrc] = contributorSsrc.jsValue - object[Strings.inboundRtpStreamId] = inboundRtpStreamId.jsValue - object[Strings.packetsContributedTo] = packetsContributedTo.jsValue - object[Strings.audioLevel] = audioLevel.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _contributorSsrc = ReadWriteAttribute(jsObject: object, name: Strings.contributorSsrc) - _inboundRtpStreamId = ReadWriteAttribute(jsObject: object, name: Strings.inboundRtpStreamId) - _packetsContributedTo = ReadWriteAttribute(jsObject: object, name: Strings.packetsContributedTo) - _audioLevel = ReadWriteAttribute(jsObject: object, name: Strings.audioLevel) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var contributorSsrc: UInt32 - - @ReadWriteAttribute - public var inboundRtpStreamId: String - - @ReadWriteAttribute - public var packetsContributedTo: UInt32 - - @ReadWriteAttribute - public var audioLevel: Double -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpDecodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpDecodingParameters.swift deleted file mode 100644 index 494b3f96..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpDecodingParameters.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpDecodingParameters: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift deleted file mode 100644 index 77cd9929..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpEncodingParameters.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpEncodingParameters: BridgedDictionary { - public convenience init(priority: RTCPriorityType, networkPriority: RTCPriorityType, scalabilityMode: String, active: Bool, maxBitrate: UInt32, scaleResolutionDownBy: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.priority] = priority.jsValue - object[Strings.networkPriority] = networkPriority.jsValue - object[Strings.scalabilityMode] = scalabilityMode.jsValue - object[Strings.active] = active.jsValue - object[Strings.maxBitrate] = maxBitrate.jsValue - object[Strings.scaleResolutionDownBy] = scaleResolutionDownBy.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) - _networkPriority = ReadWriteAttribute(jsObject: object, name: Strings.networkPriority) - _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) - _active = ReadWriteAttribute(jsObject: object, name: Strings.active) - _maxBitrate = ReadWriteAttribute(jsObject: object, name: Strings.maxBitrate) - _scaleResolutionDownBy = ReadWriteAttribute(jsObject: object, name: Strings.scaleResolutionDownBy) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var priority: RTCPriorityType - - @ReadWriteAttribute - public var networkPriority: RTCPriorityType - - @ReadWriteAttribute - public var scalabilityMode: String - - @ReadWriteAttribute - public var active: Bool - - @ReadWriteAttribute - public var maxBitrate: UInt32 - - @ReadWriteAttribute - public var scaleResolutionDownBy: Double -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift deleted file mode 100644 index b39c918c..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionCapability.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpHeaderExtensionCapability: BridgedDictionary { - public convenience init(uri: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.uri] = uri.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _uri = ReadWriteAttribute(jsObject: object, name: Strings.uri) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var uri: String -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift deleted file mode 100644 index c9a07502..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpHeaderExtensionParameters.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpHeaderExtensionParameters: BridgedDictionary { - public convenience init(uri: String, id: UInt16, encrypted: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.uri] = uri.jsValue - object[Strings.id] = id.jsValue - object[Strings.encrypted] = encrypted.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _uri = ReadWriteAttribute(jsObject: object, name: Strings.uri) - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _encrypted = ReadWriteAttribute(jsObject: object, name: Strings.encrypted) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var uri: String - - @ReadWriteAttribute - public var id: UInt16 - - @ReadWriteAttribute - public var encrypted: Bool -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpParameters.swift deleted file mode 100644 index c7676a33..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpParameters.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpParameters: BridgedDictionary { - public convenience init(headerExtensions: [RTCRtpHeaderExtensionParameters], rtcp: RTCRtcpParameters, codecs: [RTCRtpCodecParameters]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.headerExtensions] = headerExtensions.jsValue - object[Strings.rtcp] = rtcp.jsValue - object[Strings.codecs] = codecs.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _headerExtensions = ReadWriteAttribute(jsObject: object, name: Strings.headerExtensions) - _rtcp = ReadWriteAttribute(jsObject: object, name: Strings.rtcp) - _codecs = ReadWriteAttribute(jsObject: object, name: Strings.codecs) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var headerExtensions: [RTCRtpHeaderExtensionParameters] - - @ReadWriteAttribute - public var rtcp: RTCRtcpParameters - - @ReadWriteAttribute - public var codecs: [RTCRtpCodecParameters] -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpReceiveParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpReceiveParameters.swift deleted file mode 100644 index 564f62d6..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpReceiveParameters.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpReceiveParameters: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift deleted file mode 100644 index aab9ec22..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpReceiver.swift +++ /dev/null @@ -1,58 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpReceiver: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpReceiver].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) - _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) - _transport = ReadonlyAttribute(jsObject: jsObject, name: Strings.transport) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var transform: RTCRtpTransform? - - @ReadonlyAttribute - public var track: MediaStreamTrack - - @ReadonlyAttribute - public var transport: RTCDtlsTransport? - - @inlinable public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { - let this = constructor - return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue]).fromJSValue()! - } - - @inlinable public func getParameters() -> RTCRtpReceiveParameters { - let this = jsObject - return this[Strings.getParameters].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getContributingSources() -> [RTCRtpContributingSource] { - let this = jsObject - return this[Strings.getContributingSources].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getSynchronizationSources() -> [RTCRtpSynchronizationSource] { - let this = jsObject - return this[Strings.getSynchronizationSources].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getStats() -> JSPromise { - let this = jsObject - return this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getStats() async throws -> RTCStatsReport { - let this = jsObject - let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift b/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift deleted file mode 100644 index 72555739..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpScriptTransform.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpScriptTransform: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpScriptTransform].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(worker: Worker, options: JSValue? = nil, transfer: [JSObject]? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [worker.jsValue, options?.jsValue ?? .undefined, transfer?.jsValue ?? .undefined])) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift b/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift deleted file mode 100644 index afe33bd0..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpSendParameters.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpSendParameters: BridgedDictionary { - public convenience init(degradationPreference: RTCDegradationPreference, transactionId: String, encodings: [RTCRtpEncodingParameters]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.degradationPreference] = degradationPreference.jsValue - object[Strings.transactionId] = transactionId.jsValue - object[Strings.encodings] = encodings.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _degradationPreference = ReadWriteAttribute(jsObject: object, name: Strings.degradationPreference) - _transactionId = ReadWriteAttribute(jsObject: object, name: Strings.transactionId) - _encodings = ReadWriteAttribute(jsObject: object, name: Strings.encodings) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var degradationPreference: RTCDegradationPreference - - @ReadWriteAttribute - public var transactionId: String - - @ReadWriteAttribute - public var encodings: [RTCRtpEncodingParameters] -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpSender.swift b/Sources/DOMKit/WebIDL/RTCRtpSender.swift deleted file mode 100644 index 05a23cd6..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpSender.swift +++ /dev/null @@ -1,93 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpSender: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpSender].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) - _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) - _transport = ReadonlyAttribute(jsObject: jsObject, name: Strings.transport) - _dtmf = ReadonlyAttribute(jsObject: jsObject, name: Strings.dtmf) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var transform: RTCRtpTransform? - - @inlinable public func generateKeyFrame(rids: [String]? = nil) -> JSPromise { - let this = jsObject - return this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func generateKeyFrame(rids: [String]? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.generateKeyFrame].function!(this: this, arguments: [rids?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @ReadonlyAttribute - public var track: MediaStreamTrack? - - @ReadonlyAttribute - public var transport: RTCDtlsTransport? - - @inlinable public static func getCapabilities(kind: String) -> RTCRtpCapabilities? { - let this = constructor - return this[Strings.getCapabilities].function!(this: this, arguments: [kind.jsValue]).fromJSValue()! - } - - @inlinable public func setParameters(parameters: RTCRtpSendParameters) -> JSPromise { - let this = jsObject - return this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func setParameters(parameters: RTCRtpSendParameters) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.setParameters].function!(this: this, arguments: [parameters.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func getParameters() -> RTCRtpSendParameters { - let this = jsObject - return this[Strings.getParameters].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func replaceTrack(withTrack: MediaStreamTrack?) -> JSPromise { - let this = jsObject - return this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func replaceTrack(withTrack: MediaStreamTrack?) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.replaceTrack].function!(this: this, arguments: [withTrack.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func setStreams(streams: MediaStream...) { - let this = jsObject - _ = this[Strings.setStreams].function!(this: this, arguments: streams.map(\.jsValue)) - } - - @inlinable public func getStats() -> JSPromise { - let this = jsObject - return this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getStats() async throws -> RTCStatsReport { - let this = jsObject - let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var dtmf: RTCDTMFSender? -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift deleted file mode 100644 index efe5d101..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpStreamStats.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpStreamStats: BridgedDictionary { - public convenience init(ssrc: UInt32, kind: String, transportId: String, codecId: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.ssrc] = ssrc.jsValue - object[Strings.kind] = kind.jsValue - object[Strings.transportId] = transportId.jsValue - object[Strings.codecId] = codecId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _ssrc = ReadWriteAttribute(jsObject: object, name: Strings.ssrc) - _kind = ReadWriteAttribute(jsObject: object, name: Strings.kind) - _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) - _codecId = ReadWriteAttribute(jsObject: object, name: Strings.codecId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var ssrc: UInt32 - - @ReadWriteAttribute - public var kind: String - - @ReadWriteAttribute - public var transportId: String - - @ReadWriteAttribute - public var codecId: String -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpSynchronizationSource.swift b/Sources/DOMKit/WebIDL/RTCRtpSynchronizationSource.swift deleted file mode 100644 index daa41f00..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpSynchronizationSource.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpSynchronizationSource: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift deleted file mode 100644 index 1268032f..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiver.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpTransceiver: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCRtpTransceiver].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _mid = ReadonlyAttribute(jsObject: jsObject, name: Strings.mid) - _sender = ReadonlyAttribute(jsObject: jsObject, name: Strings.sender) - _receiver = ReadonlyAttribute(jsObject: jsObject, name: Strings.receiver) - _direction = ReadWriteAttribute(jsObject: jsObject, name: Strings.direction) - _currentDirection = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentDirection) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var mid: String? - - @ReadonlyAttribute - public var sender: RTCRtpSender - - @ReadonlyAttribute - public var receiver: RTCRtpReceiver - - @ReadWriteAttribute - public var direction: RTCRtpTransceiverDirection - - @ReadonlyAttribute - public var currentDirection: RTCRtpTransceiverDirection? - - @inlinable public func stop() { - let this = jsObject - _ = this[Strings.stop].function!(this: this, arguments: []) - } - - @inlinable public func setCodecPreferences(codecs: [RTCRtpCodecCapability]) { - let this = jsObject - _ = this[Strings.setCodecPreferences].function!(this: this, arguments: [codecs.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift deleted file mode 100644 index e9adedfc..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiverDirection.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCRtpTransceiverDirection: JSString, JSValueCompatible { - case sendrecv = "sendrecv" - case sendonly = "sendonly" - case recvonly = "recvonly" - case inactive = "inactive" - case stopped = "stopped" - - @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/RTCRtpTransceiverInit.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift deleted file mode 100644 index 9cce717a..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiverInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpTransceiverInit: BridgedDictionary { - public convenience init(direction: RTCRtpTransceiverDirection, streams: [MediaStream], sendEncodings: [RTCRtpEncodingParameters]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.direction] = direction.jsValue - object[Strings.streams] = streams.jsValue - object[Strings.sendEncodings] = sendEncodings.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _direction = ReadWriteAttribute(jsObject: object, name: Strings.direction) - _streams = ReadWriteAttribute(jsObject: object, name: Strings.streams) - _sendEncodings = ReadWriteAttribute(jsObject: object, name: Strings.sendEncodings) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var direction: RTCRtpTransceiverDirection - - @ReadWriteAttribute - public var streams: [MediaStream] - - @ReadWriteAttribute - public var sendEncodings: [RTCRtpEncodingParameters] -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift b/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift deleted file mode 100644 index 0a5efcb6..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpTransceiverStats.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCRtpTransceiverStats: BridgedDictionary { - public convenience init(senderId: String, receiverId: String, mid: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.senderId] = senderId.jsValue - object[Strings.receiverId] = receiverId.jsValue - object[Strings.mid] = mid.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _senderId = ReadWriteAttribute(jsObject: object, name: Strings.senderId) - _receiverId = ReadWriteAttribute(jsObject: object, name: Strings.receiverId) - _mid = ReadWriteAttribute(jsObject: object, name: Strings.mid) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var senderId: String - - @ReadWriteAttribute - public var receiverId: String - - @ReadWriteAttribute - public var mid: String -} diff --git a/Sources/DOMKit/WebIDL/RTCRtpTransform.swift b/Sources/DOMKit/WebIDL/RTCRtpTransform.swift deleted file mode 100644 index 1d2a895b..00000000 --- a/Sources/DOMKit/WebIDL/RTCRtpTransform.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_RTCRtpTransform: ConvertibleToJSValue {} -extension RTCRtpScriptTransform: Any_RTCRtpTransform {} -extension SFrameTransform: Any_RTCRtpTransform {} - -public enum RTCRtpTransform: JSValueCompatible, Any_RTCRtpTransform { - case rTCRtpScriptTransform(RTCRtpScriptTransform) - case sFrameTransform(SFrameTransform) - - public static func construct(from value: JSValue) -> Self? { - if let rTCRtpScriptTransform: RTCRtpScriptTransform = value.fromJSValue() { - return .rTCRtpScriptTransform(rTCRtpScriptTransform) - } - if let sFrameTransform: SFrameTransform = value.fromJSValue() { - return .sFrameTransform(sFrameTransform) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .rTCRtpScriptTransform(rTCRtpScriptTransform): - return rTCRtpScriptTransform.jsValue - case let .sFrameTransform(sFrameTransform): - return sFrameTransform.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransport.swift b/Sources/DOMKit/WebIDL/RTCSctpTransport.swift deleted file mode 100644 index b3b2103a..00000000 --- a/Sources/DOMKit/WebIDL/RTCSctpTransport.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCSctpTransport: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCSctpTransport].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _transport = ReadonlyAttribute(jsObject: jsObject, name: Strings.transport) - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _maxMessageSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxMessageSize) - _maxChannels = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxChannels) - _onstatechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstatechange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var transport: RTCDtlsTransport - - @ReadonlyAttribute - public var state: RTCSctpTransportState - - @ReadonlyAttribute - public var maxMessageSize: Double - - @ReadonlyAttribute - public var maxChannels: UInt16? - - @ClosureAttribute1Optional - public var onstatechange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift b/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift deleted file mode 100644 index 8b4c2e04..00000000 --- a/Sources/DOMKit/WebIDL/RTCSctpTransportState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCSctpTransportState: JSString, JSValueCompatible { - case connecting = "connecting" - case connected = "connected" - 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/RTCSctpTransportStats.swift b/Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift deleted file mode 100644 index 0950e508..00000000 --- a/Sources/DOMKit/WebIDL/RTCSctpTransportStats.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCSctpTransportStats: BridgedDictionary { - public convenience init(transportId: String, smoothedRoundTripTime: Double, congestionWindow: UInt32, receiverWindow: UInt32, mtu: UInt32, unackData: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transportId] = transportId.jsValue - object[Strings.smoothedRoundTripTime] = smoothedRoundTripTime.jsValue - object[Strings.congestionWindow] = congestionWindow.jsValue - object[Strings.receiverWindow] = receiverWindow.jsValue - object[Strings.mtu] = mtu.jsValue - object[Strings.unackData] = unackData.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _transportId = ReadWriteAttribute(jsObject: object, name: Strings.transportId) - _smoothedRoundTripTime = ReadWriteAttribute(jsObject: object, name: Strings.smoothedRoundTripTime) - _congestionWindow = ReadWriteAttribute(jsObject: object, name: Strings.congestionWindow) - _receiverWindow = ReadWriteAttribute(jsObject: object, name: Strings.receiverWindow) - _mtu = ReadWriteAttribute(jsObject: object, name: Strings.mtu) - _unackData = ReadWriteAttribute(jsObject: object, name: Strings.unackData) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var transportId: String - - @ReadWriteAttribute - public var smoothedRoundTripTime: Double - - @ReadWriteAttribute - public var congestionWindow: UInt32 - - @ReadWriteAttribute - public var receiverWindow: UInt32 - - @ReadWriteAttribute - public var mtu: UInt32 - - @ReadWriteAttribute - public var unackData: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/RTCSdpType.swift b/Sources/DOMKit/WebIDL/RTCSdpType.swift deleted file mode 100644 index 95d13ae5..00000000 --- a/Sources/DOMKit/WebIDL/RTCSdpType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCSdpType: JSString, JSValueCompatible { - case offer = "offer" - case pranswer = "pranswer" - case answer = "answer" - case rollback = "rollback" - - @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/RTCSentRtpStreamStats.swift b/Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift deleted file mode 100644 index 854586f5..00000000 --- a/Sources/DOMKit/WebIDL/RTCSentRtpStreamStats.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCSentRtpStreamStats: BridgedDictionary { - public convenience init(packetsSent: UInt32, bytesSent: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.packetsSent] = packetsSent.jsValue - object[Strings.bytesSent] = bytesSent.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _packetsSent = ReadWriteAttribute(jsObject: object, name: Strings.packetsSent) - _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var packetsSent: UInt32 - - @ReadWriteAttribute - public var bytesSent: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift b/Sources/DOMKit/WebIDL/RTCSessionDescription.swift deleted file mode 100644 index 079654a7..00000000 --- a/Sources/DOMKit/WebIDL/RTCSessionDescription.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCSessionDescription: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCSessionDescription].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _sdp = ReadonlyAttribute(jsObject: jsObject, name: Strings.sdp) - self.jsObject = jsObject - } - - @inlinable public convenience init(descriptionInitDict: RTCSessionDescriptionInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptionInitDict.jsValue])) - } - - @ReadonlyAttribute - public var type: RTCSdpType - - @ReadonlyAttribute - public var sdp: String - - @inlinable public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift b/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift deleted file mode 100644 index 94039695..00000000 --- a/Sources/DOMKit/WebIDL/RTCSessionDescriptionInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCSessionDescriptionInit: BridgedDictionary { - public convenience init(type: RTCSdpType, sdp: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.sdp] = sdp.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _sdp = ReadWriteAttribute(jsObject: object, name: Strings.sdp) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: RTCSdpType - - @ReadWriteAttribute - public var sdp: String -} diff --git a/Sources/DOMKit/WebIDL/RTCSignalingState.swift b/Sources/DOMKit/WebIDL/RTCSignalingState.swift deleted file mode 100644 index cc377a28..00000000 --- a/Sources/DOMKit/WebIDL/RTCSignalingState.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCSignalingState: JSString, JSValueCompatible { - case stable = "stable" - case haveLocalOffer = "have-local-offer" - case haveRemoteOffer = "have-remote-offer" - case haveLocalPranswer = "have-local-pranswer" - case haveRemotePranswer = "have-remote-pranswer" - 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/RTCStats.swift b/Sources/DOMKit/WebIDL/RTCStats.swift deleted file mode 100644 index 4035f9d0..00000000 --- a/Sources/DOMKit/WebIDL/RTCStats.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCStats: BridgedDictionary { - public convenience init(timestamp: DOMHighResTimeStamp, type: RTCStatsType, id: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue - object[Strings.type] = type.jsValue - object[Strings.id] = id.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var timestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var type: RTCStatsType - - @ReadWriteAttribute - public var id: String -} diff --git a/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift b/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift deleted file mode 100644 index 0e4c8719..00000000 --- a/Sources/DOMKit/WebIDL/RTCStatsIceCandidatePairState.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCStatsIceCandidatePairState: JSString, JSValueCompatible { - case frozen = "frozen" - case waiting = "waiting" - case inProgress = "in-progress" - case failed = "failed" - case succeeded = "succeeded" - - @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/RTCStatsReport.swift b/Sources/DOMKit/WebIDL/RTCStatsReport.swift deleted file mode 100644 index 3961eebe..00000000 --- a/Sources/DOMKit/WebIDL/RTCStatsReport.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCStatsReport: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.RTCStatsReport].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Map-like! -} diff --git a/Sources/DOMKit/WebIDL/RTCStatsType.swift b/Sources/DOMKit/WebIDL/RTCStatsType.swift deleted file mode 100644 index aee82e6f..00000000 --- a/Sources/DOMKit/WebIDL/RTCStatsType.swift +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RTCStatsType: JSString, JSValueCompatible { - case codec = "codec" - case inboundRtp = "inbound-rtp" - case outboundRtp = "outbound-rtp" - case remoteInboundRtp = "remote-inbound-rtp" - case remoteOutboundRtp = "remote-outbound-rtp" - case mediaSource = "media-source" - case csrc = "csrc" - case peerConnection = "peer-connection" - case dataChannel = "data-channel" - case stream = "stream" - case track = "track" - case transceiver = "transceiver" - case sender = "sender" - case receiver = "receiver" - case transport = "transport" - case sctpTransport = "sctp-transport" - case candidatePair = "candidate-pair" - case localCandidate = "local-candidate" - case remoteCandidate = "remote-candidate" - case certificate = "certificate" - case iceServer = "ice-server" - - @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/RTCTrackEvent.swift b/Sources/DOMKit/WebIDL/RTCTrackEvent.swift deleted file mode 100644 index f8c0694d..00000000 --- a/Sources/DOMKit/WebIDL/RTCTrackEvent.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCTrackEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RTCTrackEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _receiver = ReadonlyAttribute(jsObject: jsObject, name: Strings.receiver) - _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) - _streams = ReadonlyAttribute(jsObject: jsObject, name: Strings.streams) - _transceiver = ReadonlyAttribute(jsObject: jsObject, name: Strings.transceiver) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: RTCTrackEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var receiver: RTCRtpReceiver - - @ReadonlyAttribute - public var track: MediaStreamTrack - - @ReadonlyAttribute - public var streams: [MediaStream] - - @ReadonlyAttribute - public var transceiver: RTCRtpTransceiver -} diff --git a/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift b/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift deleted file mode 100644 index 8743372d..00000000 --- a/Sources/DOMKit/WebIDL/RTCTrackEventInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCTrackEventInit: BridgedDictionary { - public convenience init(receiver: RTCRtpReceiver, track: MediaStreamTrack, streams: [MediaStream], transceiver: RTCRtpTransceiver) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.receiver] = receiver.jsValue - object[Strings.track] = track.jsValue - object[Strings.streams] = streams.jsValue - object[Strings.transceiver] = transceiver.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _receiver = ReadWriteAttribute(jsObject: object, name: Strings.receiver) - _track = ReadWriteAttribute(jsObject: object, name: Strings.track) - _streams = ReadWriteAttribute(jsObject: object, name: Strings.streams) - _transceiver = ReadWriteAttribute(jsObject: object, name: Strings.transceiver) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var receiver: RTCRtpReceiver - - @ReadWriteAttribute - public var track: MediaStreamTrack - - @ReadWriteAttribute - public var streams: [MediaStream] - - @ReadWriteAttribute - public var transceiver: RTCRtpTransceiver -} diff --git a/Sources/DOMKit/WebIDL/RTCTransportStats.swift b/Sources/DOMKit/WebIDL/RTCTransportStats.swift deleted file mode 100644 index 90ea2335..00000000 --- a/Sources/DOMKit/WebIDL/RTCTransportStats.swift +++ /dev/null @@ -1,100 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCTransportStats: BridgedDictionary { - public convenience init(packetsSent: UInt64, packetsReceived: UInt64, bytesSent: UInt64, bytesReceived: UInt64, rtcpTransportStatsId: String, iceRole: RTCIceRole, iceLocalUsernameFragment: String, dtlsState: RTCDtlsTransportState, iceState: RTCIceTransportState, selectedCandidatePairId: String, localCertificateId: String, remoteCertificateId: String, tlsVersion: String, dtlsCipher: String, srtpCipher: String, tlsGroup: String, selectedCandidatePairChanges: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.packetsSent] = packetsSent.jsValue - object[Strings.packetsReceived] = packetsReceived.jsValue - object[Strings.bytesSent] = bytesSent.jsValue - object[Strings.bytesReceived] = bytesReceived.jsValue - object[Strings.rtcpTransportStatsId] = rtcpTransportStatsId.jsValue - object[Strings.iceRole] = iceRole.jsValue - object[Strings.iceLocalUsernameFragment] = iceLocalUsernameFragment.jsValue - object[Strings.dtlsState] = dtlsState.jsValue - object[Strings.iceState] = iceState.jsValue - object[Strings.selectedCandidatePairId] = selectedCandidatePairId.jsValue - object[Strings.localCertificateId] = localCertificateId.jsValue - object[Strings.remoteCertificateId] = remoteCertificateId.jsValue - object[Strings.tlsVersion] = tlsVersion.jsValue - object[Strings.dtlsCipher] = dtlsCipher.jsValue - object[Strings.srtpCipher] = srtpCipher.jsValue - object[Strings.tlsGroup] = tlsGroup.jsValue - object[Strings.selectedCandidatePairChanges] = selectedCandidatePairChanges.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _packetsSent = ReadWriteAttribute(jsObject: object, name: Strings.packetsSent) - _packetsReceived = ReadWriteAttribute(jsObject: object, name: Strings.packetsReceived) - _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) - _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) - _rtcpTransportStatsId = ReadWriteAttribute(jsObject: object, name: Strings.rtcpTransportStatsId) - _iceRole = ReadWriteAttribute(jsObject: object, name: Strings.iceRole) - _iceLocalUsernameFragment = ReadWriteAttribute(jsObject: object, name: Strings.iceLocalUsernameFragment) - _dtlsState = ReadWriteAttribute(jsObject: object, name: Strings.dtlsState) - _iceState = ReadWriteAttribute(jsObject: object, name: Strings.iceState) - _selectedCandidatePairId = ReadWriteAttribute(jsObject: object, name: Strings.selectedCandidatePairId) - _localCertificateId = ReadWriteAttribute(jsObject: object, name: Strings.localCertificateId) - _remoteCertificateId = ReadWriteAttribute(jsObject: object, name: Strings.remoteCertificateId) - _tlsVersion = ReadWriteAttribute(jsObject: object, name: Strings.tlsVersion) - _dtlsCipher = ReadWriteAttribute(jsObject: object, name: Strings.dtlsCipher) - _srtpCipher = ReadWriteAttribute(jsObject: object, name: Strings.srtpCipher) - _tlsGroup = ReadWriteAttribute(jsObject: object, name: Strings.tlsGroup) - _selectedCandidatePairChanges = ReadWriteAttribute(jsObject: object, name: Strings.selectedCandidatePairChanges) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var packetsSent: UInt64 - - @ReadWriteAttribute - public var packetsReceived: UInt64 - - @ReadWriteAttribute - public var bytesSent: UInt64 - - @ReadWriteAttribute - public var bytesReceived: UInt64 - - @ReadWriteAttribute - public var rtcpTransportStatsId: String - - @ReadWriteAttribute - public var iceRole: RTCIceRole - - @ReadWriteAttribute - public var iceLocalUsernameFragment: String - - @ReadWriteAttribute - public var dtlsState: RTCDtlsTransportState - - @ReadWriteAttribute - public var iceState: RTCIceTransportState - - @ReadWriteAttribute - public var selectedCandidatePairId: String - - @ReadWriteAttribute - public var localCertificateId: String - - @ReadWriteAttribute - public var remoteCertificateId: String - - @ReadWriteAttribute - public var tlsVersion: String - - @ReadWriteAttribute - public var dtlsCipher: String - - @ReadWriteAttribute - public var srtpCipher: String - - @ReadWriteAttribute - public var tlsGroup: String - - @ReadWriteAttribute - public var selectedCandidatePairChanges: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/RTCVideoHandlerStats.swift b/Sources/DOMKit/WebIDL/RTCVideoHandlerStats.swift deleted file mode 100644 index 34b5e39a..00000000 --- a/Sources/DOMKit/WebIDL/RTCVideoHandlerStats.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCVideoHandlerStats: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCVideoReceiverStats.swift b/Sources/DOMKit/WebIDL/RTCVideoReceiverStats.swift deleted file mode 100644 index 00ad618f..00000000 --- a/Sources/DOMKit/WebIDL/RTCVideoReceiverStats.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCVideoReceiverStats: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift b/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift deleted file mode 100644 index 4ff128e3..00000000 --- a/Sources/DOMKit/WebIDL/RTCVideoSenderStats.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCVideoSenderStats: BridgedDictionary { - public convenience init(mediaSourceId: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mediaSourceId] = mediaSourceId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mediaSourceId = ReadWriteAttribute(jsObject: object, name: Strings.mediaSourceId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mediaSourceId: String -} diff --git a/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift b/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift deleted file mode 100644 index e6b1af60..00000000 --- a/Sources/DOMKit/WebIDL/RTCVideoSourceStats.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RTCVideoSourceStats: BridgedDictionary { - public convenience init(width: UInt32, height: UInt32, bitDepth: UInt32, frames: UInt32, framesPerSecond: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.width] = width.jsValue - object[Strings.height] = height.jsValue - object[Strings.bitDepth] = bitDepth.jsValue - object[Strings.frames] = frames.jsValue - object[Strings.framesPerSecond] = framesPerSecond.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) - _bitDepth = ReadWriteAttribute(jsObject: object, name: Strings.bitDepth) - _frames = ReadWriteAttribute(jsObject: object, name: Strings.frames) - _framesPerSecond = ReadWriteAttribute(jsObject: object, name: Strings.framesPerSecond) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var width: UInt32 - - @ReadWriteAttribute - public var height: UInt32 - - @ReadWriteAttribute - public var bitDepth: UInt32 - - @ReadWriteAttribute - public var frames: UInt32 - - @ReadWriteAttribute - public var framesPerSecond: Double -} diff --git a/Sources/DOMKit/WebIDL/Range.swift b/Sources/DOMKit/WebIDL/Range.swift index 63ac21f0..aefbda5f 100644 --- a/Sources/DOMKit/WebIDL/Range.swift +++ b/Sources/DOMKit/WebIDL/Range.swift @@ -11,21 +11,6 @@ public class Range: AbstractRange { super.init(unsafelyWrapping: jsObject) } - @inlinable public func createContextualFragment(fragment: String) -> DocumentFragment { - let this = jsObject - return this[Strings.createContextualFragment].function!(this: this, arguments: [fragment.jsValue]).fromJSValue()! - } - - @inlinable public func getClientRects() -> DOMRectList { - let this = jsObject - return this[Strings.getClientRects].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getBoundingClientRect() -> DOMRect { - let this = jsObject - return this[Strings.getBoundingClientRect].function!(this: this, arguments: []).fromJSValue()! - } - @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } diff --git a/Sources/DOMKit/WebIDL/ReadOptions.swift b/Sources/DOMKit/WebIDL/ReadOptions.swift deleted file mode 100644 index ff9093d0..00000000 --- a/Sources/DOMKit/WebIDL/ReadOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ReadOptions: BridgedDictionary { - public convenience init(signal: AbortSignal?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var signal: AbortSignal? -} diff --git a/Sources/DOMKit/WebIDL/RedEyeReduction.swift b/Sources/DOMKit/WebIDL/RedEyeReduction.swift deleted file mode 100644 index a9f0cd37..00000000 --- a/Sources/DOMKit/WebIDL/RedEyeReduction.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RedEyeReduction: JSString, JSValueCompatible { - case never = "never" - case always = "always" - case controllable = "controllable" - - @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/Region.swift b/Sources/DOMKit/WebIDL/Region.swift deleted file mode 100644 index 3449b145..00000000 --- a/Sources/DOMKit/WebIDL/Region.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Region: JSBridgedClass {} -public extension Region { - @inlinable var regionOverset: String { ReadonlyAttribute[Strings.regionOverset, in: jsObject] } - - @inlinable func getRegionFlowRanges() -> [Range]? { - let this = jsObject - return this[Strings.getRegionFlowRanges].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/RelatedApplication.swift b/Sources/DOMKit/WebIDL/RelatedApplication.swift deleted file mode 100644 index b9a47d7d..00000000 --- a/Sources/DOMKit/WebIDL/RelatedApplication.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RelatedApplication: BridgedDictionary { - public convenience init(platform: String, url: String, id: String, version: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.platform] = platform.jsValue - object[Strings.url] = url.jsValue - object[Strings.id] = id.jsValue - object[Strings.version] = version.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _platform = ReadWriteAttribute(jsObject: object, name: Strings.platform) - _url = ReadWriteAttribute(jsObject: object, name: Strings.url) - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - _version = ReadWriteAttribute(jsObject: object, name: Strings.version) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var platform: String - - @ReadWriteAttribute - public var url: String - - @ReadWriteAttribute - public var id: String - - @ReadWriteAttribute - public var version: String -} diff --git a/Sources/DOMKit/WebIDL/RelativeOrientationReadingValues.swift b/Sources/DOMKit/WebIDL/RelativeOrientationReadingValues.swift deleted file mode 100644 index e53f1403..00000000 --- a/Sources/DOMKit/WebIDL/RelativeOrientationReadingValues.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RelativeOrientationReadingValues: BridgedDictionary { - public convenience init() { - let object = JSObject.global[Strings.Object].function!.new() - - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - super.init(unsafelyWrapping: object) - } -} diff --git a/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift b/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift deleted file mode 100644 index 179fdb96..00000000 --- a/Sources/DOMKit/WebIDL/RelativeOrientationSensor.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RelativeOrientationSensor: OrientationSensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RelativeOrientationSensor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(sensorOptions: OrientationSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) - } -} diff --git a/Sources/DOMKit/WebIDL/RemotePlayback.swift b/Sources/DOMKit/WebIDL/RemotePlayback.swift deleted file mode 100644 index 45810a18..00000000 --- a/Sources/DOMKit/WebIDL/RemotePlayback.swift +++ /dev/null @@ -1,56 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RemotePlayback: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.RemotePlayback].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _onconnecting = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnecting) - _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) - super.init(unsafelyWrapping: jsObject) - } - - // XXX: member 'watchAvailability' is ignored - - // XXX: member 'watchAvailability' is ignored - - @inlinable public func cancelWatchAvailability(id: Int32? = nil) -> JSPromise { - let this = jsObject - return this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func cancelWatchAvailability(id: Int32? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.cancelWatchAvailability].function!(this: this, arguments: [id?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @ReadonlyAttribute - public var state: RemotePlaybackState - - @ClosureAttribute1Optional - public var onconnecting: EventHandler - - @ClosureAttribute1Optional - public var onconnect: EventHandler - - @ClosureAttribute1Optional - public var ondisconnect: EventHandler - - @inlinable public func prompt() -> JSPromise { - let this = jsObject - return this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func prompt() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.prompt].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/RemotePlaybackState.swift b/Sources/DOMKit/WebIDL/RemotePlaybackState.swift deleted file mode 100644 index cfea0faa..00000000 --- a/Sources/DOMKit/WebIDL/RemotePlaybackState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum RemotePlaybackState: JSString, JSValueCompatible { - case connecting = "connecting" - case connected = "connected" - case disconnected = "disconnected" - - @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/RenderingContext.swift b/Sources/DOMKit/WebIDL/RenderingContext.swift index 3653bb19..021b4565 100644 --- a/Sources/DOMKit/WebIDL/RenderingContext.swift +++ b/Sources/DOMKit/WebIDL/RenderingContext.swift @@ -12,7 +12,7 @@ extension WebGLRenderingContext: Any_RenderingContext {} public enum RenderingContext: JSValueCompatible, Any_RenderingContext { case canvasRenderingContext2D(CanvasRenderingContext2D) - case gPUCanvasContext(GPUCanvasContext) + case gpuCanvasContext(GPUCanvasContext) case imageBitmapRenderingContext(ImageBitmapRenderingContext) case webGL2RenderingContext(WebGL2RenderingContext) case webGLRenderingContext(WebGLRenderingContext) @@ -21,8 +21,8 @@ public enum RenderingContext: JSValueCompatible, Any_RenderingContext { if let canvasRenderingContext2D: CanvasRenderingContext2D = value.fromJSValue() { return .canvasRenderingContext2D(canvasRenderingContext2D) } - if let gPUCanvasContext: GPUCanvasContext = value.fromJSValue() { - return .gPUCanvasContext(gPUCanvasContext) + if let gpuCanvasContext: GPUCanvasContext = value.fromJSValue() { + return .gpuCanvasContext(gpuCanvasContext) } if let imageBitmapRenderingContext: ImageBitmapRenderingContext = value.fromJSValue() { return .imageBitmapRenderingContext(imageBitmapRenderingContext) @@ -40,8 +40,8 @@ public enum RenderingContext: JSValueCompatible, Any_RenderingContext { switch self { case let .canvasRenderingContext2D(canvasRenderingContext2D): return canvasRenderingContext2D.jsValue - case let .gPUCanvasContext(gPUCanvasContext): - return gPUCanvasContext.jsValue + case let .gpuCanvasContext(gpuCanvasContext): + return gpuCanvasContext.jsValue case let .imageBitmapRenderingContext(imageBitmapRenderingContext): return imageBitmapRenderingContext.jsValue case let .webGL2RenderingContext(webGL2RenderingContext): diff --git a/Sources/DOMKit/WebIDL/Report.swift b/Sources/DOMKit/WebIDL/Report.swift deleted file mode 100644 index 71dc619a..00000000 --- a/Sources/DOMKit/WebIDL/Report.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Report: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Report].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - _body = ReadonlyAttribute(jsObject: jsObject, name: Strings.body) - self.jsObject = jsObject - } - - @inlinable public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var type: String - - @ReadonlyAttribute - public var url: String - - @ReadonlyAttribute - public var body: ReportBody? -} diff --git a/Sources/DOMKit/WebIDL/ReportBody.swift b/Sources/DOMKit/WebIDL/ReportBody.swift deleted file mode 100644 index 0d640797..00000000 --- a/Sources/DOMKit/WebIDL/ReportBody.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ReportBody: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReportBody].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ReportingObserver.swift b/Sources/DOMKit/WebIDL/ReportingObserver.swift deleted file mode 100644 index 255c3d65..00000000 --- a/Sources/DOMKit/WebIDL/ReportingObserver.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ReportingObserver: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReportingObserver].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: constructor is ignored - - @inlinable public func observe() { - let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: []) - } - - @inlinable public func disconnect() { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: []) - } - - @inlinable public func takeRecords() -> ReportList { - let this = jsObject - return this[Strings.takeRecords].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift b/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift deleted file mode 100644 index 92df9f8d..00000000 --- a/Sources/DOMKit/WebIDL/ReportingObserverOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ReportingObserverOptions: BridgedDictionary { - public convenience init(types: [String], buffered: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.types] = types.jsValue - object[Strings.buffered] = buffered.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _types = ReadWriteAttribute(jsObject: object, name: Strings.types) - _buffered = ReadWriteAttribute(jsObject: object, name: Strings.buffered) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var types: [String] - - @ReadWriteAttribute - public var buffered: Bool -} diff --git a/Sources/DOMKit/WebIDL/Request.swift b/Sources/DOMKit/WebIDL/Request.swift index b060f112..39f25ce8 100644 --- a/Sources/DOMKit/WebIDL/Request.swift +++ b/Sources/DOMKit/WebIDL/Request.swift @@ -24,7 +24,6 @@ public class Request: JSBridgedClass, Body { _isReloadNavigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.isReloadNavigation) _isHistoryNavigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.isHistoryNavigation) _signal = ReadonlyAttribute(jsObject: jsObject, name: Strings.signal) - _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) self.jsObject = jsObject } @@ -81,7 +80,4 @@ public class Request: JSBridgedClass, Body { let this = jsObject return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } - - @ReadonlyAttribute - public var priority: FetchPriority } diff --git a/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift b/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift deleted file mode 100644 index 9ed8ddd1..00000000 --- a/Sources/DOMKit/WebIDL/RequestDeviceOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RequestDeviceOptions: BridgedDictionary { - public convenience init(filters: [BluetoothLEScanFilterInit], optionalServices: [BluetoothServiceUUID], optionalManufacturerData: [UInt16], acceptAllDevices: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue - object[Strings.optionalServices] = optionalServices.jsValue - object[Strings.optionalManufacturerData] = optionalManufacturerData.jsValue - object[Strings.acceptAllDevices] = acceptAllDevices.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) - _optionalServices = ReadWriteAttribute(jsObject: object, name: Strings.optionalServices) - _optionalManufacturerData = ReadWriteAttribute(jsObject: object, name: Strings.optionalManufacturerData) - _acceptAllDevices = ReadWriteAttribute(jsObject: object, name: Strings.acceptAllDevices) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var filters: [BluetoothLEScanFilterInit] - - @ReadWriteAttribute - public var optionalServices: [BluetoothServiceUUID] - - @ReadWriteAttribute - public var optionalManufacturerData: [UInt16] - - @ReadWriteAttribute - public var acceptAllDevices: Bool -} diff --git a/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift b/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift deleted file mode 100644 index a5030ad2..00000000 --- a/Sources/DOMKit/WebIDL/RequestInfo_or_seq_of_RequestInfo.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_RequestInfo_or_seq_of_RequestInfo: ConvertibleToJSValue {} -extension RequestInfo: Any_RequestInfo_or_seq_of_RequestInfo {} -extension Array: Any_RequestInfo_or_seq_of_RequestInfo where Element == RequestInfo {} - -public enum RequestInfo_or_seq_of_RequestInfo: JSValueCompatible, Any_RequestInfo_or_seq_of_RequestInfo { - case requestInfo(RequestInfo) - case seq_of_RequestInfo([RequestInfo]) - - public static func construct(from value: JSValue) -> Self? { - if let requestInfo: RequestInfo = value.fromJSValue() { - return .requestInfo(requestInfo) - } - if let seq_of_RequestInfo: [RequestInfo] = value.fromJSValue() { - return .seq_of_RequestInfo(seq_of_RequestInfo) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .requestInfo(requestInfo): - return requestInfo.jsValue - case let .seq_of_RequestInfo(seq_of_RequestInfo): - return seq_of_RequestInfo.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/RequestInit.swift b/Sources/DOMKit/WebIDL/RequestInit.swift index be07f0fa..edeebffe 100644 --- a/Sources/DOMKit/WebIDL/RequestInit.swift +++ b/Sources/DOMKit/WebIDL/RequestInit.swift @@ -4,7 +4,7 @@ import JavaScriptEventLoop import JavaScriptKit public class RequestInit: BridgedDictionary { - public convenience init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue, priority: FetchPriority) { + public convenience init(method: String, headers: HeadersInit, body: BodyInit?, referrer: String, referrerPolicy: ReferrerPolicy, mode: RequestMode, credentials: RequestCredentials, cache: RequestCache, redirect: RequestRedirect, integrity: String, keepalive: Bool, signal: AbortSignal?, window: JSValue) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.method] = method.jsValue object[Strings.headers] = headers.jsValue @@ -19,7 +19,6 @@ public class RequestInit: BridgedDictionary { object[Strings.keepalive] = keepalive.jsValue object[Strings.signal] = signal.jsValue object[Strings.window] = window.jsValue - object[Strings.priority] = priority.jsValue self.init(unsafelyWrapping: object) } @@ -37,7 +36,6 @@ public class RequestInit: BridgedDictionary { _keepalive = ReadWriteAttribute(jsObject: object, name: Strings.keepalive) _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) _window = ReadWriteAttribute(jsObject: object, name: Strings.window) - _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) super.init(unsafelyWrapping: object) } @@ -79,7 +77,4 @@ public class RequestInit: BridgedDictionary { @ReadWriteAttribute public var window: JSValue - - @ReadWriteAttribute - public var priority: FetchPriority } diff --git a/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift b/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift deleted file mode 100644 index 8393ba15..00000000 --- a/Sources/DOMKit/WebIDL/ResidentKeyRequirement.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ResidentKeyRequirement: JSString, JSValueCompatible { - case discouraged = "discouraged" - case preferred = "preferred" - case required = "required" - - @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/ResizeObserver.swift b/Sources/DOMKit/WebIDL/ResizeObserver.swift deleted file mode 100644 index f53c89d7..00000000 --- a/Sources/DOMKit/WebIDL/ResizeObserver.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ResizeObserver: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserver].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: constructor is ignored - - @inlinable public func observe(target: Element, options: ResizeObserverOptions? = nil) { - let this = jsObject - _ = this[Strings.observe].function!(this: this, arguments: [target.jsValue, options?.jsValue ?? .undefined]) - } - - @inlinable public func unobserve(target: Element) { - let this = jsObject - _ = this[Strings.unobserve].function!(this: this, arguments: [target.jsValue]) - } - - @inlinable public func disconnect() { - let this = jsObject - _ = this[Strings.disconnect].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift b/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift deleted file mode 100644 index cdc11842..00000000 --- a/Sources/DOMKit/WebIDL/ResizeObserverBoxOptions.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ResizeObserverBoxOptions: JSString, JSValueCompatible { - case borderBox = "border-box" - case contentBox = "content-box" - case devicePixelContentBox = "device-pixel-content-box" - - @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/ResizeObserverEntry.swift b/Sources/DOMKit/WebIDL/ResizeObserverEntry.swift deleted file mode 100644 index 65a359ba..00000000 --- a/Sources/DOMKit/WebIDL/ResizeObserverEntry.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ResizeObserverEntry: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserverEntry].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) - _contentRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentRect) - _borderBoxSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.borderBoxSize) - _contentBoxSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.contentBoxSize) - _devicePixelContentBoxSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePixelContentBoxSize) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var target: Element - - @ReadonlyAttribute - public var contentRect: DOMRectReadOnly - - @ReadonlyAttribute - public var borderBoxSize: [ResizeObserverSize] - - @ReadonlyAttribute - public var contentBoxSize: [ResizeObserverSize] - - @ReadonlyAttribute - public var devicePixelContentBoxSize: [ResizeObserverSize] -} diff --git a/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift b/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift deleted file mode 100644 index 3e650e53..00000000 --- a/Sources/DOMKit/WebIDL/ResizeObserverOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ResizeObserverOptions: BridgedDictionary { - public convenience init(box: ResizeObserverBoxOptions) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.box] = box.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _box = ReadWriteAttribute(jsObject: object, name: Strings.box) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var box: ResizeObserverBoxOptions -} diff --git a/Sources/DOMKit/WebIDL/ResizeObserverSize.swift b/Sources/DOMKit/WebIDL/ResizeObserverSize.swift deleted file mode 100644 index 440108a8..00000000 --- a/Sources/DOMKit/WebIDL/ResizeObserverSize.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ResizeObserverSize: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ResizeObserverSize].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _inlineSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineSize) - _blockSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockSize) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var inlineSize: Double - - @ReadonlyAttribute - public var blockSize: Double -} diff --git a/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift b/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift deleted file mode 100644 index 6c9b47b2..00000000 --- a/Sources/DOMKit/WebIDL/RsaHashedImportParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RsaHashedImportParams: BridgedDictionary { - public convenience init(hash: HashAlgorithmIdentifier) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var hash: HashAlgorithmIdentifier -} diff --git a/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift deleted file mode 100644 index ac2475c5..00000000 --- a/Sources/DOMKit/WebIDL/RsaHashedKeyAlgorithm.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RsaHashedKeyAlgorithm: BridgedDictionary { - public convenience init(hash: KeyAlgorithm) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var hash: KeyAlgorithm -} diff --git a/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift b/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift deleted file mode 100644 index 974e14bf..00000000 --- a/Sources/DOMKit/WebIDL/RsaHashedKeyGenParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RsaHashedKeyGenParams: BridgedDictionary { - public convenience init(hash: HashAlgorithmIdentifier) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.hash] = hash.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var hash: HashAlgorithmIdentifier -} diff --git a/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift b/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift deleted file mode 100644 index 5e2d64e7..00000000 --- a/Sources/DOMKit/WebIDL/RsaKeyAlgorithm.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RsaKeyAlgorithm: BridgedDictionary { - public convenience init(modulusLength: UInt32, publicExponent: BigInteger) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.modulusLength] = modulusLength.jsValue - object[Strings.publicExponent] = publicExponent.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _modulusLength = ReadWriteAttribute(jsObject: object, name: Strings.modulusLength) - _publicExponent = ReadWriteAttribute(jsObject: object, name: Strings.publicExponent) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var modulusLength: UInt32 - - @ReadWriteAttribute - public var publicExponent: BigInteger -} diff --git a/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift b/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift deleted file mode 100644 index 9c3f2dd1..00000000 --- a/Sources/DOMKit/WebIDL/RsaKeyGenParams.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RsaKeyGenParams: BridgedDictionary { - public convenience init(modulusLength: UInt32, publicExponent: BigInteger) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.modulusLength] = modulusLength.jsValue - object[Strings.publicExponent] = publicExponent.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _modulusLength = ReadWriteAttribute(jsObject: object, name: Strings.modulusLength) - _publicExponent = ReadWriteAttribute(jsObject: object, name: Strings.publicExponent) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var modulusLength: UInt32 - - @ReadWriteAttribute - public var publicExponent: BigInteger -} diff --git a/Sources/DOMKit/WebIDL/RsaOaepParams.swift b/Sources/DOMKit/WebIDL/RsaOaepParams.swift deleted file mode 100644 index 12e41e55..00000000 --- a/Sources/DOMKit/WebIDL/RsaOaepParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RsaOaepParams: BridgedDictionary { - public convenience init(label: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.label] = label.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _label = ReadWriteAttribute(jsObject: object, name: Strings.label) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var label: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift b/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift deleted file mode 100644 index b3ac8fa3..00000000 --- a/Sources/DOMKit/WebIDL/RsaOtherPrimesInfo.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RsaOtherPrimesInfo: BridgedDictionary { - public convenience init(r: String, d: String, t: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.r] = r.jsValue - object[Strings.d] = d.jsValue - object[Strings.t] = t.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _r = ReadWriteAttribute(jsObject: object, name: Strings.r) - _d = ReadWriteAttribute(jsObject: object, name: Strings.d) - _t = ReadWriteAttribute(jsObject: object, name: Strings.t) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var r: String - - @ReadWriteAttribute - public var d: String - - @ReadWriteAttribute - public var t: String -} diff --git a/Sources/DOMKit/WebIDL/RsaPssParams.swift b/Sources/DOMKit/WebIDL/RsaPssParams.swift deleted file mode 100644 index f92a9b95..00000000 --- a/Sources/DOMKit/WebIDL/RsaPssParams.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class RsaPssParams: BridgedDictionary { - public convenience init(saltLength: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.saltLength] = saltLength.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _saltLength = ReadWriteAttribute(jsObject: object, name: Strings.saltLength) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var saltLength: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/SFrameTransform.swift b/Sources/DOMKit/WebIDL/SFrameTransform.swift deleted file mode 100644 index 4d01afc7..00000000 --- a/Sources/DOMKit/WebIDL/SFrameTransform.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SFrameTransform: JSBridgedClass, GenericTransformStream { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SFrameTransform].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - self.jsObject = jsObject - } - - @inlinable public convenience init(options: SFrameTransformOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @inlinable public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) -> JSPromise { - let this = jsObject - return this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue, keyID?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func setEncryptionKey(key: CryptoKey, keyID: CryptoKeyID? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.setEncryptionKey].function!(this: this, arguments: [key.jsValue, keyID?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @ClosureAttribute1Optional - public var onerror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift deleted file mode 100644 index 2738a4d7..00000000 --- a/Sources/DOMKit/WebIDL/SFrameTransformErrorEvent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SFrameTransformErrorEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SFrameTransformErrorEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _errorType = ReadonlyAttribute(jsObject: jsObject, name: Strings.errorType) - _keyID = ReadonlyAttribute(jsObject: jsObject, name: Strings.keyID) - _frame = ReadonlyAttribute(jsObject: jsObject, name: Strings.frame) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: SFrameTransformErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var errorType: SFrameTransformErrorEventType - - @ReadonlyAttribute - public var keyID: CryptoKeyID? - - @ReadonlyAttribute - public var frame: JSValue -} diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift deleted file mode 100644 index f712406d..00000000 --- a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SFrameTransformErrorEventInit: BridgedDictionary { - public convenience init(errorType: SFrameTransformErrorEventType, frame: JSValue, keyID: CryptoKeyID?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.errorType] = errorType.jsValue - object[Strings.frame] = frame.jsValue - object[Strings.keyID] = keyID.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _errorType = ReadWriteAttribute(jsObject: object, name: Strings.errorType) - _frame = ReadWriteAttribute(jsObject: object, name: Strings.frame) - _keyID = ReadWriteAttribute(jsObject: object, name: Strings.keyID) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var errorType: SFrameTransformErrorEventType - - @ReadWriteAttribute - public var frame: JSValue - - @ReadWriteAttribute - public var keyID: CryptoKeyID? -} diff --git a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift b/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift deleted file mode 100644 index 3b52fba0..00000000 --- a/Sources/DOMKit/WebIDL/SFrameTransformErrorEventType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum SFrameTransformErrorEventType: JSString, JSValueCompatible { - case authentication = "authentication" - case keyID = "keyID" - case syntax = "syntax" - - @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/SFrameTransformOptions.swift b/Sources/DOMKit/WebIDL/SFrameTransformOptions.swift deleted file mode 100644 index 5a9978f5..00000000 --- a/Sources/DOMKit/WebIDL/SFrameTransformOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SFrameTransformOptions: BridgedDictionary { - public convenience init(role: SFrameTransformRole) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.role] = role.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _role = ReadWriteAttribute(jsObject: object, name: Strings.role) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var role: SFrameTransformRole -} diff --git a/Sources/DOMKit/WebIDL/SFrameTransformRole.swift b/Sources/DOMKit/WebIDL/SFrameTransformRole.swift deleted file mode 100644 index 50997bda..00000000 --- a/Sources/DOMKit/WebIDL/SFrameTransformRole.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum SFrameTransformRole: JSString, JSValueCompatible { - case encrypt = "encrypt" - case decrypt = "decrypt" - - @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/SVGAnimateElement.swift b/Sources/DOMKit/WebIDL/SVGAnimateElement.swift deleted file mode 100644 index ad005500..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimateElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimateElement: SVGAnimationElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift b/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift deleted file mode 100644 index d3ac9dd7..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimateMotionElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimateMotionElement: SVGAnimationElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateMotionElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift b/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift deleted file mode 100644 index 0b33e500..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimateTransformElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimateTransformElement: SVGAnimationElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimateTransformElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift b/Sources/DOMKit/WebIDL/SVGAnimationElement.swift deleted file mode 100644 index 85c4f074..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimationElement.swift +++ /dev/null @@ -1,63 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimationElement: SVGElement, SVGTests { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimationElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _targetElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetElement) - _onbegin = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbegin) - _onend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onend) - _onrepeat = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onrepeat) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var targetElement: SVGElement? - - @ClosureAttribute1Optional - public var onbegin: EventHandler - - @ClosureAttribute1Optional - public var onend: EventHandler - - @ClosureAttribute1Optional - public var onrepeat: EventHandler - - @inlinable public func getStartTime() -> Float { - let this = jsObject - return this[Strings.getStartTime].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getCurrentTime() -> Float { - let this = jsObject - return this[Strings.getCurrentTime].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getSimpleDuration() -> Float { - let this = jsObject - return this[Strings.getSimpleDuration].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func beginElement() { - let this = jsObject - _ = this[Strings.beginElement].function!(this: this, arguments: []) - } - - @inlinable public func beginElementAt(offset: Float) { - let this = jsObject - _ = this[Strings.beginElementAt].function!(this: this, arguments: [offset.jsValue]) - } - - @inlinable public func endElement() { - let this = jsObject - _ = this[Strings.endElement].function!(this: this, arguments: []) - } - - @inlinable public func endElementAt(offset: Float) { - let this = jsObject - _ = this[Strings.endElementAt].function!(this: this, arguments: [offset.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGClipPathElement.swift b/Sources/DOMKit/WebIDL/SVGClipPathElement.swift deleted file mode 100644 index 0b8a8441..00000000 --- a/Sources/DOMKit/WebIDL/SVGClipPathElement.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGClipPathElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGClipPathElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _clipPathUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.clipPathUnits) - _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var clipPathUnits: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var transform: SVGAnimatedTransformList -} diff --git a/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift b/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift deleted file mode 100644 index c41e8538..00000000 --- a/Sources/DOMKit/WebIDL/SVGComponentTransferFunctionElement.swift +++ /dev/null @@ -1,52 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGComponentTransferFunctionElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGComponentTransferFunctionElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _tableValues = ReadonlyAttribute(jsObject: jsObject, name: Strings.tableValues) - _slope = ReadonlyAttribute(jsObject: jsObject, name: Strings.slope) - _intercept = ReadonlyAttribute(jsObject: jsObject, name: Strings.intercept) - _amplitude = ReadonlyAttribute(jsObject: jsObject, name: Strings.amplitude) - _exponent = ReadonlyAttribute(jsObject: jsObject, name: Strings.exponent) - _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: UInt16 = 0 - - public static let SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: UInt16 = 1 - - public static let SVG_FECOMPONENTTRANSFER_TYPE_TABLE: UInt16 = 2 - - public static let SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: UInt16 = 3 - - public static let SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: UInt16 = 4 - - public static let SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: UInt16 = 5 - - @ReadonlyAttribute - public var type: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var tableValues: SVGAnimatedNumberList - - @ReadonlyAttribute - public var slope: SVGAnimatedNumber - - @ReadonlyAttribute - public var intercept: SVGAnimatedNumber - - @ReadonlyAttribute - public var amplitude: SVGAnimatedNumber - - @ReadonlyAttribute - public var exponent: SVGAnimatedNumber - - @ReadonlyAttribute - public var offset: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGDiscardElement.swift b/Sources/DOMKit/WebIDL/SVGDiscardElement.swift deleted file mode 100644 index 8a54ee61..00000000 --- a/Sources/DOMKit/WebIDL/SVGDiscardElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGDiscardElement: SVGAnimationElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGDiscardElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGElement.swift b/Sources/DOMKit/WebIDL/SVGElement.swift index 66b31fee..73487e5d 100644 --- a/Sources/DOMKit/WebIDL/SVGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGElement.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class SVGElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement, ElementCSSInlineStyle { +public class SVGElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift b/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift deleted file mode 100644 index 16a56103..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEBlendElement.swift +++ /dev/null @@ -1,58 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEBlendElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEBlendElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _in2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in2) - _mode = ReadonlyAttribute(jsObject: jsObject, name: Strings.mode) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_FEBLEND_MODE_UNKNOWN: UInt16 = 0 - - public static let SVG_FEBLEND_MODE_NORMAL: UInt16 = 1 - - public static let SVG_FEBLEND_MODE_MULTIPLY: UInt16 = 2 - - public static let SVG_FEBLEND_MODE_SCREEN: UInt16 = 3 - - public static let SVG_FEBLEND_MODE_DARKEN: UInt16 = 4 - - public static let SVG_FEBLEND_MODE_LIGHTEN: UInt16 = 5 - - public static let SVG_FEBLEND_MODE_OVERLAY: UInt16 = 6 - - public static let SVG_FEBLEND_MODE_COLOR_DODGE: UInt16 = 7 - - public static let SVG_FEBLEND_MODE_COLOR_BURN: UInt16 = 8 - - public static let SVG_FEBLEND_MODE_HARD_LIGHT: UInt16 = 9 - - public static let SVG_FEBLEND_MODE_SOFT_LIGHT: UInt16 = 10 - - public static let SVG_FEBLEND_MODE_DIFFERENCE: UInt16 = 11 - - public static let SVG_FEBLEND_MODE_EXCLUSION: UInt16 = 12 - - public static let SVG_FEBLEND_MODE_HUE: UInt16 = 13 - - public static let SVG_FEBLEND_MODE_SATURATION: UInt16 = 14 - - public static let SVG_FEBLEND_MODE_COLOR: UInt16 = 15 - - public static let SVG_FEBLEND_MODE_LUMINOSITY: UInt16 = 16 - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var in2: SVGAnimatedString - - @ReadonlyAttribute - public var mode: SVGAnimatedEnumeration -} diff --git a/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift b/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift deleted file mode 100644 index 3fab0881..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEColorMatrixElement.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEColorMatrixElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEColorMatrixElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _values = ReadonlyAttribute(jsObject: jsObject, name: Strings.values) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_FECOLORMATRIX_TYPE_UNKNOWN: UInt16 = 0 - - public static let SVG_FECOLORMATRIX_TYPE_MATRIX: UInt16 = 1 - - public static let SVG_FECOLORMATRIX_TYPE_SATURATE: UInt16 = 2 - - public static let SVG_FECOLORMATRIX_TYPE_HUEROTATE: UInt16 = 3 - - public static let SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: UInt16 = 4 - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var type: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var values: SVGAnimatedNumberList -} diff --git a/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift b/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift deleted file mode 100644 index b7dadf98..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEComponentTransferElement.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEComponentTransferElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEComponentTransferElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var in1: SVGAnimatedString -} diff --git a/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift b/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift deleted file mode 100644 index 2bd9f6f0..00000000 --- a/Sources/DOMKit/WebIDL/SVGFECompositeElement.swift +++ /dev/null @@ -1,54 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFECompositeElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFECompositeElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _in2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in2) - _operator = ReadonlyAttribute(jsObject: jsObject, name: Strings.operator) - _k1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.k1) - _k2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.k2) - _k3 = ReadonlyAttribute(jsObject: jsObject, name: Strings.k3) - _k4 = ReadonlyAttribute(jsObject: jsObject, name: Strings.k4) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_FECOMPOSITE_OPERATOR_UNKNOWN: UInt16 = 0 - - public static let SVG_FECOMPOSITE_OPERATOR_OVER: UInt16 = 1 - - public static let SVG_FECOMPOSITE_OPERATOR_IN: UInt16 = 2 - - public static let SVG_FECOMPOSITE_OPERATOR_OUT: UInt16 = 3 - - public static let SVG_FECOMPOSITE_OPERATOR_ATOP: UInt16 = 4 - - public static let SVG_FECOMPOSITE_OPERATOR_XOR: UInt16 = 5 - - public static let SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: UInt16 = 6 - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var in2: SVGAnimatedString - - @ReadonlyAttribute - public var `operator`: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var k1: SVGAnimatedNumber - - @ReadonlyAttribute - public var k2: SVGAnimatedNumber - - @ReadonlyAttribute - public var k3: SVGAnimatedNumber - - @ReadonlyAttribute - public var k4: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift b/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift deleted file mode 100644 index b67f63ee..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEConvolveMatrixElement.swift +++ /dev/null @@ -1,68 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEConvolveMatrixElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEConvolveMatrixElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _orderX = ReadonlyAttribute(jsObject: jsObject, name: Strings.orderX) - _orderY = ReadonlyAttribute(jsObject: jsObject, name: Strings.orderY) - _kernelMatrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelMatrix) - _divisor = ReadonlyAttribute(jsObject: jsObject, name: Strings.divisor) - _bias = ReadonlyAttribute(jsObject: jsObject, name: Strings.bias) - _targetX = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetX) - _targetY = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetY) - _edgeMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.edgeMode) - _kernelUnitLengthX = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthX) - _kernelUnitLengthY = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthY) - _preserveAlpha = ReadonlyAttribute(jsObject: jsObject, name: Strings.preserveAlpha) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_EDGEMODE_UNKNOWN: UInt16 = 0 - - public static let SVG_EDGEMODE_DUPLICATE: UInt16 = 1 - - public static let SVG_EDGEMODE_WRAP: UInt16 = 2 - - public static let SVG_EDGEMODE_NONE: UInt16 = 3 - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var orderX: SVGAnimatedInteger - - @ReadonlyAttribute - public var orderY: SVGAnimatedInteger - - @ReadonlyAttribute - public var kernelMatrix: SVGAnimatedNumberList - - @ReadonlyAttribute - public var divisor: SVGAnimatedNumber - - @ReadonlyAttribute - public var bias: SVGAnimatedNumber - - @ReadonlyAttribute - public var targetX: SVGAnimatedInteger - - @ReadonlyAttribute - public var targetY: SVGAnimatedInteger - - @ReadonlyAttribute - public var edgeMode: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var kernelUnitLengthX: SVGAnimatedNumber - - @ReadonlyAttribute - public var kernelUnitLengthY: SVGAnimatedNumber - - @ReadonlyAttribute - public var preserveAlpha: SVGAnimatedBoolean -} diff --git a/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift b/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift deleted file mode 100644 index d3aebc5e..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEDiffuseLightingElement.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEDiffuseLightingElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDiffuseLightingElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _surfaceScale = ReadonlyAttribute(jsObject: jsObject, name: Strings.surfaceScale) - _diffuseConstant = ReadonlyAttribute(jsObject: jsObject, name: Strings.diffuseConstant) - _kernelUnitLengthX = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthX) - _kernelUnitLengthY = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthY) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var surfaceScale: SVGAnimatedNumber - - @ReadonlyAttribute - public var diffuseConstant: SVGAnimatedNumber - - @ReadonlyAttribute - public var kernelUnitLengthX: SVGAnimatedNumber - - @ReadonlyAttribute - public var kernelUnitLengthY: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift b/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift deleted file mode 100644 index 05d31d85..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEDisplacementMapElement.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEDisplacementMapElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDisplacementMapElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _in2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in2) - _scale = ReadonlyAttribute(jsObject: jsObject, name: Strings.scale) - _xChannelSelector = ReadonlyAttribute(jsObject: jsObject, name: Strings.xChannelSelector) - _yChannelSelector = ReadonlyAttribute(jsObject: jsObject, name: Strings.yChannelSelector) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_CHANNEL_UNKNOWN: UInt16 = 0 - - public static let SVG_CHANNEL_R: UInt16 = 1 - - public static let SVG_CHANNEL_G: UInt16 = 2 - - public static let SVG_CHANNEL_B: UInt16 = 3 - - public static let SVG_CHANNEL_A: UInt16 = 4 - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var in2: SVGAnimatedString - - @ReadonlyAttribute - public var scale: SVGAnimatedNumber - - @ReadonlyAttribute - public var xChannelSelector: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var yChannelSelector: SVGAnimatedEnumeration -} diff --git a/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift b/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift deleted file mode 100644 index e58dacdb..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEDistantLightElement.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEDistantLightElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDistantLightElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _azimuth = ReadonlyAttribute(jsObject: jsObject, name: Strings.azimuth) - _elevation = ReadonlyAttribute(jsObject: jsObject, name: Strings.elevation) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var azimuth: SVGAnimatedNumber - - @ReadonlyAttribute - public var elevation: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift b/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift deleted file mode 100644 index 27c3f5e4..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEDropShadowElement.swift +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEDropShadowElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEDropShadowElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _dx = ReadonlyAttribute(jsObject: jsObject, name: Strings.dx) - _dy = ReadonlyAttribute(jsObject: jsObject, name: Strings.dy) - _stdDeviationX = ReadonlyAttribute(jsObject: jsObject, name: Strings.stdDeviationX) - _stdDeviationY = ReadonlyAttribute(jsObject: jsObject, name: Strings.stdDeviationY) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var dx: SVGAnimatedNumber - - @ReadonlyAttribute - public var dy: SVGAnimatedNumber - - @ReadonlyAttribute - public var stdDeviationX: SVGAnimatedNumber - - @ReadonlyAttribute - public var stdDeviationY: SVGAnimatedNumber - - @inlinable public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { - let this = jsObject - _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue, stdDeviationY.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift b/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift deleted file mode 100644 index 2ae73b65..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEFloodElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEFloodElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFloodElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift deleted file mode 100644 index 91b4c54a..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEFuncAElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEFuncAElement: SVGComponentTransferFunctionElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncAElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift deleted file mode 100644 index 422f56e5..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEFuncBElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEFuncBElement: SVGComponentTransferFunctionElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncBElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift deleted file mode 100644 index 6d8938ca..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEFuncGElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEFuncGElement: SVGComponentTransferFunctionElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncGElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift b/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift deleted file mode 100644 index 5acbcb17..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEFuncRElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEFuncRElement: SVGComponentTransferFunctionElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEFuncRElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift b/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift deleted file mode 100644 index da889749..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEGaussianBlurElement.swift +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEGaussianBlurElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEGaussianBlurElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _stdDeviationX = ReadonlyAttribute(jsObject: jsObject, name: Strings.stdDeviationX) - _stdDeviationY = ReadonlyAttribute(jsObject: jsObject, name: Strings.stdDeviationY) - _edgeMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.edgeMode) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_EDGEMODE_UNKNOWN: UInt16 = 0 - - public static let SVG_EDGEMODE_DUPLICATE: UInt16 = 1 - - public static let SVG_EDGEMODE_WRAP: UInt16 = 2 - - public static let SVG_EDGEMODE_NONE: UInt16 = 3 - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var stdDeviationX: SVGAnimatedNumber - - @ReadonlyAttribute - public var stdDeviationY: SVGAnimatedNumber - - @ReadonlyAttribute - public var edgeMode: SVGAnimatedEnumeration - - @inlinable public func setStdDeviation(stdDeviationX: Float, stdDeviationY: Float) { - let this = jsObject - _ = this[Strings.setStdDeviation].function!(this: this, arguments: [stdDeviationX.jsValue, stdDeviationY.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGFEImageElement.swift b/Sources/DOMKit/WebIDL/SVGFEImageElement.swift deleted file mode 100644 index ecc3ee0b..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEImageElement.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEImageElement: SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEImageElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _preserveAspectRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.preserveAspectRatio) - _crossOrigin = ReadonlyAttribute(jsObject: jsObject, name: Strings.crossOrigin) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var preserveAspectRatio: SVGAnimatedPreserveAspectRatio - - @ReadonlyAttribute - public var crossOrigin: SVGAnimatedString -} diff --git a/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift b/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift deleted file mode 100644 index 476c1437..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEMergeElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEMergeElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMergeElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift b/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift deleted file mode 100644 index c9099e17..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEMergeNodeElement.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEMergeNodeElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMergeNodeElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var in1: SVGAnimatedString -} diff --git a/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift b/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift deleted file mode 100644 index 8ff23d2a..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEMorphologyElement.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEMorphologyElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEMorphologyElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _operator = ReadonlyAttribute(jsObject: jsObject, name: Strings.operator) - _radiusX = ReadonlyAttribute(jsObject: jsObject, name: Strings.radiusX) - _radiusY = ReadonlyAttribute(jsObject: jsObject, name: Strings.radiusY) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_MORPHOLOGY_OPERATOR_UNKNOWN: UInt16 = 0 - - public static let SVG_MORPHOLOGY_OPERATOR_ERODE: UInt16 = 1 - - public static let SVG_MORPHOLOGY_OPERATOR_DILATE: UInt16 = 2 - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var `operator`: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var radiusX: SVGAnimatedNumber - - @ReadonlyAttribute - public var radiusY: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift b/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift deleted file mode 100644 index 2d03b416..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEOffsetElement.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEOffsetElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEOffsetElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _dx = ReadonlyAttribute(jsObject: jsObject, name: Strings.dx) - _dy = ReadonlyAttribute(jsObject: jsObject, name: Strings.dy) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var dx: SVGAnimatedNumber - - @ReadonlyAttribute - public var dy: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift b/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift deleted file mode 100644 index 00c052ab..00000000 --- a/Sources/DOMKit/WebIDL/SVGFEPointLightElement.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFEPointLightElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFEPointLightElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x: SVGAnimatedNumber - - @ReadonlyAttribute - public var y: SVGAnimatedNumber - - @ReadonlyAttribute - public var z: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift b/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift deleted file mode 100644 index bd700136..00000000 --- a/Sources/DOMKit/WebIDL/SVGFESpecularLightingElement.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFESpecularLightingElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFESpecularLightingElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - _surfaceScale = ReadonlyAttribute(jsObject: jsObject, name: Strings.surfaceScale) - _specularConstant = ReadonlyAttribute(jsObject: jsObject, name: Strings.specularConstant) - _specularExponent = ReadonlyAttribute(jsObject: jsObject, name: Strings.specularExponent) - _kernelUnitLengthX = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthX) - _kernelUnitLengthY = ReadonlyAttribute(jsObject: jsObject, name: Strings.kernelUnitLengthY) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var in1: SVGAnimatedString - - @ReadonlyAttribute - public var surfaceScale: SVGAnimatedNumber - - @ReadonlyAttribute - public var specularConstant: SVGAnimatedNumber - - @ReadonlyAttribute - public var specularExponent: SVGAnimatedNumber - - @ReadonlyAttribute - public var kernelUnitLengthX: SVGAnimatedNumber - - @ReadonlyAttribute - public var kernelUnitLengthY: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift b/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift deleted file mode 100644 index cd423069..00000000 --- a/Sources/DOMKit/WebIDL/SVGFESpotLightElement.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFESpotLightElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFESpotLightElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) - _pointsAtX = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointsAtX) - _pointsAtY = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointsAtY) - _pointsAtZ = ReadonlyAttribute(jsObject: jsObject, name: Strings.pointsAtZ) - _specularExponent = ReadonlyAttribute(jsObject: jsObject, name: Strings.specularExponent) - _limitingConeAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.limitingConeAngle) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x: SVGAnimatedNumber - - @ReadonlyAttribute - public var y: SVGAnimatedNumber - - @ReadonlyAttribute - public var z: SVGAnimatedNumber - - @ReadonlyAttribute - public var pointsAtX: SVGAnimatedNumber - - @ReadonlyAttribute - public var pointsAtY: SVGAnimatedNumber - - @ReadonlyAttribute - public var pointsAtZ: SVGAnimatedNumber - - @ReadonlyAttribute - public var specularExponent: SVGAnimatedNumber - - @ReadonlyAttribute - public var limitingConeAngle: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGFETileElement.swift b/Sources/DOMKit/WebIDL/SVGFETileElement.swift deleted file mode 100644 index 7862eb1d..00000000 --- a/Sources/DOMKit/WebIDL/SVGFETileElement.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFETileElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFETileElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _in1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.in1) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var in1: SVGAnimatedString -} diff --git a/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift b/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift deleted file mode 100644 index 617f4d0b..00000000 --- a/Sources/DOMKit/WebIDL/SVGFETurbulenceElement.swift +++ /dev/null @@ -1,48 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFETurbulenceElement: SVGElement, SVGFilterPrimitiveStandardAttributes { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFETurbulenceElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseFrequencyX = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseFrequencyX) - _baseFrequencyY = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseFrequencyY) - _numOctaves = ReadonlyAttribute(jsObject: jsObject, name: Strings.numOctaves) - _seed = ReadonlyAttribute(jsObject: jsObject, name: Strings.seed) - _stitchTiles = ReadonlyAttribute(jsObject: jsObject, name: Strings.stitchTiles) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_TURBULENCE_TYPE_UNKNOWN: UInt16 = 0 - - public static let SVG_TURBULENCE_TYPE_FRACTALNOISE: UInt16 = 1 - - public static let SVG_TURBULENCE_TYPE_TURBULENCE: UInt16 = 2 - - public static let SVG_STITCHTYPE_UNKNOWN: UInt16 = 0 - - public static let SVG_STITCHTYPE_STITCH: UInt16 = 1 - - public static let SVG_STITCHTYPE_NOSTITCH: UInt16 = 2 - - @ReadonlyAttribute - public var baseFrequencyX: SVGAnimatedNumber - - @ReadonlyAttribute - public var baseFrequencyY: SVGAnimatedNumber - - @ReadonlyAttribute - public var numOctaves: SVGAnimatedInteger - - @ReadonlyAttribute - public var seed: SVGAnimatedNumber - - @ReadonlyAttribute - public var stitchTiles: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var type: SVGAnimatedEnumeration -} diff --git a/Sources/DOMKit/WebIDL/SVGFilterElement.swift b/Sources/DOMKit/WebIDL/SVGFilterElement.swift deleted file mode 100644 index 9c7b8d7a..00000000 --- a/Sources/DOMKit/WebIDL/SVGFilterElement.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGFilterElement: SVGElement, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGFilterElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _filterUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.filterUnits) - _primitiveUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.primitiveUnits) - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var filterUnits: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var primitiveUnits: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var x: SVGAnimatedLength - - @ReadonlyAttribute - public var y: SVGAnimatedLength - - @ReadonlyAttribute - public var width: SVGAnimatedLength - - @ReadonlyAttribute - public var height: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift b/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift deleted file mode 100644 index 65789732..00000000 --- a/Sources/DOMKit/WebIDL/SVGFilterPrimitiveStandardAttributes.swift +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol SVGFilterPrimitiveStandardAttributes: JSBridgedClass {} -public extension SVGFilterPrimitiveStandardAttributes { - @inlinable var x: SVGAnimatedLength { ReadonlyAttribute[Strings.x, in: jsObject] } - - @inlinable var y: SVGAnimatedLength { ReadonlyAttribute[Strings.y, in: jsObject] } - - @inlinable var width: SVGAnimatedLength { ReadonlyAttribute[Strings.width, in: jsObject] } - - @inlinable var height: SVGAnimatedLength { ReadonlyAttribute[Strings.height, in: jsObject] } - - @inlinable var result: SVGAnimatedString { ReadonlyAttribute[Strings.result, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/SVGMPathElement.swift b/Sources/DOMKit/WebIDL/SVGMPathElement.swift deleted file mode 100644 index 91025cd4..00000000 --- a/Sources/DOMKit/WebIDL/SVGMPathElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGMPathElement: SVGElement, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGMPathElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGMaskElement.swift b/Sources/DOMKit/WebIDL/SVGMaskElement.swift deleted file mode 100644 index ecc9e382..00000000 --- a/Sources/DOMKit/WebIDL/SVGMaskElement.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGMaskElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGMaskElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _maskUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.maskUnits) - _maskContentUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.maskContentUnits) - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var maskUnits: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var maskContentUnits: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var x: SVGAnimatedLength - - @ReadonlyAttribute - public var y: SVGAnimatedLength - - @ReadonlyAttribute - public var width: SVGAnimatedLength - - @ReadonlyAttribute - public var height: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGSVGElement.swift b/Sources/DOMKit/WebIDL/SVGSVGElement.swift index e397e987..33a8bc88 100644 --- a/Sources/DOMKit/WebIDL/SVGSVGElement.swift +++ b/Sources/DOMKit/WebIDL/SVGSVGElement.swift @@ -123,29 +123,4 @@ public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHand let this = jsObject _ = this[Strings.forceRedraw].function!(this: this, arguments: []) } - - @inlinable public func pauseAnimations() { - let this = jsObject - _ = this[Strings.pauseAnimations].function!(this: this, arguments: []) - } - - @inlinable public func unpauseAnimations() { - let this = jsObject - _ = this[Strings.unpauseAnimations].function!(this: this, arguments: []) - } - - @inlinable public func animationsPaused() -> Bool { - let this = jsObject - return this[Strings.animationsPaused].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getCurrentTime() -> Float { - let this = jsObject - return this[Strings.getCurrentTime].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func setCurrentTime(seconds: Float) { - let this = jsObject - _ = this[Strings.setCurrentTime].function!(this: this, arguments: [seconds.jsValue]) - } } diff --git a/Sources/DOMKit/WebIDL/SVGSetElement.swift b/Sources/DOMKit/WebIDL/SVGSetElement.swift deleted file mode 100644 index bdcbff03..00000000 --- a/Sources/DOMKit/WebIDL/SVGSetElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGSetElement: SVGAnimationElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGSetElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/Sanitizer.swift b/Sources/DOMKit/WebIDL/Sanitizer.swift deleted file mode 100644 index d37e0644..00000000 --- a/Sources/DOMKit/WebIDL/Sanitizer.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Sanitizer: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Sanitizer].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(config: SanitizerConfig? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [config?.jsValue ?? .undefined])) - } - - @inlinable public func sanitize(input: Document_or_DocumentFragment) -> DocumentFragment { - let this = jsObject - return this[Strings.sanitize].function!(this: this, arguments: [input.jsValue]).fromJSValue()! - } - - @inlinable public func sanitizeFor(element: String, input: String) -> Element? { - let this = jsObject - return this[Strings.sanitizeFor].function!(this: this, arguments: [element.jsValue, input.jsValue]).fromJSValue()! - } - - @inlinable public func getConfiguration() -> SanitizerConfig { - let this = jsObject - return this[Strings.getConfiguration].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public static func getDefaultConfiguration() -> SanitizerConfig { - let this = constructor - return this[Strings.getDefaultConfiguration].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/SanitizerConfig.swift b/Sources/DOMKit/WebIDL/SanitizerConfig.swift deleted file mode 100644 index 90e564c3..00000000 --- a/Sources/DOMKit/WebIDL/SanitizerConfig.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SanitizerConfig: BridgedDictionary { - public convenience init(allowElements: [String], blockElements: [String], dropElements: [String], allowAttributes: AttributeMatchList, dropAttributes: AttributeMatchList, allowCustomElements: Bool, allowComments: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowElements] = allowElements.jsValue - object[Strings.blockElements] = blockElements.jsValue - object[Strings.dropElements] = dropElements.jsValue - object[Strings.allowAttributes] = allowAttributes.jsValue - object[Strings.dropAttributes] = dropAttributes.jsValue - object[Strings.allowCustomElements] = allowCustomElements.jsValue - object[Strings.allowComments] = allowComments.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _allowElements = ReadWriteAttribute(jsObject: object, name: Strings.allowElements) - _blockElements = ReadWriteAttribute(jsObject: object, name: Strings.blockElements) - _dropElements = ReadWriteAttribute(jsObject: object, name: Strings.dropElements) - _allowAttributes = ReadWriteAttribute(jsObject: object, name: Strings.allowAttributes) - _dropAttributes = ReadWriteAttribute(jsObject: object, name: Strings.dropAttributes) - _allowCustomElements = ReadWriteAttribute(jsObject: object, name: Strings.allowCustomElements) - _allowComments = ReadWriteAttribute(jsObject: object, name: Strings.allowComments) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var allowElements: [String] - - @ReadWriteAttribute - public var blockElements: [String] - - @ReadWriteAttribute - public var dropElements: [String] - - @ReadWriteAttribute - public var allowAttributes: AttributeMatchList - - @ReadWriteAttribute - public var dropAttributes: AttributeMatchList - - @ReadWriteAttribute - public var allowCustomElements: Bool - - @ReadWriteAttribute - public var allowComments: Bool -} diff --git a/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift b/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift deleted file mode 100644 index 28db174d..00000000 --- a/Sources/DOMKit/WebIDL/SaveFilePickerOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SaveFilePickerOptions: BridgedDictionary { - public convenience init(suggestedName: String?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.suggestedName] = suggestedName.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _suggestedName = ReadWriteAttribute(jsObject: object, name: Strings.suggestedName) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var suggestedName: String? -} diff --git a/Sources/DOMKit/WebIDL/Scheduler.swift b/Sources/DOMKit/WebIDL/Scheduler.swift deleted file mode 100644 index 9edfa33e..00000000 --- a/Sources/DOMKit/WebIDL/Scheduler.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Scheduler: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Scheduler].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: member 'postTask' is ignored - - // XXX: member 'postTask' is ignored -} diff --git a/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift b/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift deleted file mode 100644 index c0e5e4ff..00000000 --- a/Sources/DOMKit/WebIDL/SchedulerPostTaskOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SchedulerPostTaskOptions: BridgedDictionary { - public convenience init(signal: AbortSignal, priority: TaskPriority, delay: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue - object[Strings.priority] = priority.jsValue - object[Strings.delay] = delay.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) - _delay = ReadWriteAttribute(jsObject: object, name: Strings.delay) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var signal: AbortSignal - - @ReadWriteAttribute - public var priority: TaskPriority - - @ReadWriteAttribute - public var delay: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/Scheduling.swift b/Sources/DOMKit/WebIDL/Scheduling.swift deleted file mode 100644 index ae9a18ea..00000000 --- a/Sources/DOMKit/WebIDL/Scheduling.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Scheduling: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Scheduling].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func isInputPending(isInputPendingOptions: IsInputPendingOptions? = nil) -> Bool { - let this = jsObject - return this[Strings.isInputPending].function!(this: this, arguments: [isInputPendingOptions?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/Screen.swift b/Sources/DOMKit/WebIDL/Screen.swift deleted file mode 100644 index d9441297..00000000 --- a/Sources/DOMKit/WebIDL/Screen.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Screen: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Screen].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _availWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.availWidth) - _availHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.availHeight) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _colorDepth = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorDepth) - _pixelDepth = ReadonlyAttribute(jsObject: jsObject, name: Strings.pixelDepth) - _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var availWidth: Int32 - - @ReadonlyAttribute - public var availHeight: Int32 - - @ReadonlyAttribute - public var width: Int32 - - @ReadonlyAttribute - public var height: Int32 - - @ReadonlyAttribute - public var colorDepth: UInt32 - - @ReadonlyAttribute - public var pixelDepth: UInt32 - - @ReadonlyAttribute - public var orientation: ScreenOrientation -} diff --git a/Sources/DOMKit/WebIDL/ScreenIdleState.swift b/Sources/DOMKit/WebIDL/ScreenIdleState.swift deleted file mode 100644 index d2d67ab3..00000000 --- a/Sources/DOMKit/WebIDL/ScreenIdleState.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ScreenIdleState: JSString, JSValueCompatible { - case locked = "locked" - case unlocked = "unlocked" - - @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/ScreenOrientation.swift b/Sources/DOMKit/WebIDL/ScreenOrientation.swift deleted file mode 100644 index 2257eb80..00000000 --- a/Sources/DOMKit/WebIDL/ScreenOrientation.swift +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ScreenOrientation: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ScreenOrientation].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _angle = ReadonlyAttribute(jsObject: jsObject, name: Strings.angle) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func lock(orientation: OrientationLockType) -> JSPromise { - let this = jsObject - return this[Strings.lock].function!(this: this, arguments: [orientation.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func lock(orientation: OrientationLockType) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.lock].function!(this: this, arguments: [orientation.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func unlock() { - let this = jsObject - _ = this[Strings.unlock].function!(this: this, arguments: []) - } - - @ReadonlyAttribute - public var type: OrientationType - - @ReadonlyAttribute - public var angle: UInt16 - - @ClosureAttribute1Optional - public var onchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift b/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift deleted file mode 100644 index 1e0ec540..00000000 --- a/Sources/DOMKit/WebIDL/ScriptProcessorNode.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ScriptProcessorNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ScriptProcessorNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onaudioprocess = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaudioprocess) - _bufferSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.bufferSize) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var onaudioprocess: EventHandler - - @ReadonlyAttribute - public var bufferSize: Int32 -} diff --git a/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift b/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift deleted file mode 100644 index 449997b7..00000000 --- a/Sources/DOMKit/WebIDL/ScriptingPolicyReportBody.swift +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ScriptingPolicyReportBody: ReportBody { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ScriptingPolicyReportBody].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _violationType = ReadonlyAttribute(jsObject: jsObject, name: Strings.violationType) - _violationURL = ReadonlyAttribute(jsObject: jsObject, name: Strings.violationURL) - _violationSample = ReadonlyAttribute(jsObject: jsObject, name: Strings.violationSample) - _lineno = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineno) - _colno = ReadonlyAttribute(jsObject: jsObject, name: Strings.colno) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var violationType: String - - @ReadonlyAttribute - public var violationURL: String? - - @ReadonlyAttribute - public var violationSample: String? - - @ReadonlyAttribute - public var lineno: UInt32 - - @ReadonlyAttribute - public var colno: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift b/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift deleted file mode 100644 index d8f93cf5..00000000 --- a/Sources/DOMKit/WebIDL/ScriptingPolicyViolationType.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ScriptingPolicyViolationType: JSString, JSValueCompatible { - case externalScript = "externalScript" - case inlineScript = "inlineScript" - case inlineEventHandler = "inlineEventHandler" - case eval = "eval" - - @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/ScrollBehavior.swift b/Sources/DOMKit/WebIDL/ScrollBehavior.swift deleted file mode 100644 index a76ba1cb..00000000 --- a/Sources/DOMKit/WebIDL/ScrollBehavior.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ScrollBehavior: JSString, JSValueCompatible { - case auto = "auto" - case smooth = "smooth" - - @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/ScrollDirection.swift b/Sources/DOMKit/WebIDL/ScrollDirection.swift deleted file mode 100644 index 5747c841..00000000 --- a/Sources/DOMKit/WebIDL/ScrollDirection.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ScrollDirection: JSString, JSValueCompatible { - case block = "block" - case inline = "inline" - case horizontal = "horizontal" - case vertical = "vertical" - - @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/ScrollIntoViewOptions.swift b/Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift deleted file mode 100644 index 23f42432..00000000 --- a/Sources/DOMKit/WebIDL/ScrollIntoViewOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ScrollIntoViewOptions: BridgedDictionary { - public convenience init(block: ScrollLogicalPosition, inline: ScrollLogicalPosition) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.block] = block.jsValue - object[Strings.inline] = inline.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _block = ReadWriteAttribute(jsObject: object, name: Strings.block) - _inline = ReadWriteAttribute(jsObject: object, name: Strings.inline) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var block: ScrollLogicalPosition - - @ReadWriteAttribute - public var inline: ScrollLogicalPosition -} diff --git a/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift b/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift deleted file mode 100644 index 9f11f0bf..00000000 --- a/Sources/DOMKit/WebIDL/ScrollLogicalPosition.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ScrollLogicalPosition: JSString, JSValueCompatible { - case start = "start" - case center = "center" - case end = "end" - case nearest = "nearest" - - @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/ScrollOptions.swift b/Sources/DOMKit/WebIDL/ScrollOptions.swift deleted file mode 100644 index 93ba5ad2..00000000 --- a/Sources/DOMKit/WebIDL/ScrollOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ScrollOptions: BridgedDictionary { - public convenience init(behavior: ScrollBehavior) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.behavior] = behavior.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _behavior = ReadWriteAttribute(jsObject: object, name: Strings.behavior) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var behavior: ScrollBehavior -} diff --git a/Sources/DOMKit/WebIDL/ScrollSetting.swift b/Sources/DOMKit/WebIDL/ScrollSetting.swift deleted file mode 100644 index 1f65bac5..00000000 --- a/Sources/DOMKit/WebIDL/ScrollSetting.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ScrollSetting: JSString, JSValueCompatible { - case _empty = "" - case up = "up" - - @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/ScrollTimeline.swift b/Sources/DOMKit/WebIDL/ScrollTimeline.swift deleted file mode 100644 index 52c7bc7c..00000000 --- a/Sources/DOMKit/WebIDL/ScrollTimeline.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ScrollTimeline: AnimationTimeline { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ScrollTimeline].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) - _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) - _scrollOffsets = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollOffsets) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: ScrollTimelineOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var source: Element? - - @ReadonlyAttribute - public var orientation: ScrollDirection - - @ReadonlyAttribute - public var scrollOffsets: [ScrollTimelineOffset] -} diff --git a/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift b/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift deleted file mode 100644 index 9cc03128..00000000 --- a/Sources/DOMKit/WebIDL/ScrollTimelineAutoKeyword.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ScrollTimelineAutoKeyword: JSString, JSValueCompatible { - 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 } -} diff --git a/Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift b/Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift deleted file mode 100644 index 444d845d..00000000 --- a/Sources/DOMKit/WebIDL/ScrollTimelineOffset.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_ScrollTimelineOffset: ConvertibleToJSValue {} -extension ContainerBasedOffset: Any_ScrollTimelineOffset {} -extension ElementBasedOffset: Any_ScrollTimelineOffset {} - -public enum ScrollTimelineOffset: JSValueCompatible, Any_ScrollTimelineOffset { - case containerBasedOffset(ContainerBasedOffset) - case elementBasedOffset(ElementBasedOffset) - - public static func construct(from value: JSValue) -> Self? { - if let containerBasedOffset: ContainerBasedOffset = value.fromJSValue() { - return .containerBasedOffset(containerBasedOffset) - } - if let elementBasedOffset: ElementBasedOffset = value.fromJSValue() { - return .elementBasedOffset(elementBasedOffset) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .containerBasedOffset(containerBasedOffset): - return containerBasedOffset.jsValue - case let .elementBasedOffset(elementBasedOffset): - return elementBasedOffset.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift b/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift deleted file mode 100644 index 8702e66f..00000000 --- a/Sources/DOMKit/WebIDL/ScrollTimelineOptions.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ScrollTimelineOptions: BridgedDictionary { - public convenience init(source: Element?, orientation: ScrollDirection, scrollOffsets: [ScrollTimelineOffset]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.source] = source.jsValue - object[Strings.orientation] = orientation.jsValue - object[Strings.scrollOffsets] = scrollOffsets.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _source = ReadWriteAttribute(jsObject: object, name: Strings.source) - _orientation = ReadWriteAttribute(jsObject: object, name: Strings.orientation) - _scrollOffsets = ReadWriteAttribute(jsObject: object, name: Strings.scrollOffsets) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var source: Element? - - @ReadWriteAttribute - public var orientation: ScrollDirection - - @ReadWriteAttribute - public var scrollOffsets: [ScrollTimelineOffset] -} diff --git a/Sources/DOMKit/WebIDL/ScrollToOptions.swift b/Sources/DOMKit/WebIDL/ScrollToOptions.swift deleted file mode 100644 index c48ba4d7..00000000 --- a/Sources/DOMKit/WebIDL/ScrollToOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ScrollToOptions: BridgedDictionary { - public convenience init(left: Double, top: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.left] = left.jsValue - object[Strings.top] = top.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _left = ReadWriteAttribute(jsObject: object, name: Strings.left) - _top = ReadWriteAttribute(jsObject: object, name: Strings.top) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var left: Double - - @ReadWriteAttribute - public var top: Double -} diff --git a/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift b/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift deleted file mode 100644 index 0e9881e7..00000000 --- a/Sources/DOMKit/WebIDL/SecurePaymentConfirmationRequest.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SecurePaymentConfirmationRequest: BridgedDictionary { - public convenience init(challenge: BufferSource, rpId: String, credentialIds: [BufferSource], instrument: PaymentCredentialInstrument, timeout: UInt32, payeeOrigin: String, extensions: AuthenticationExtensionsClientInputs) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.challenge] = challenge.jsValue - object[Strings.rpId] = rpId.jsValue - object[Strings.credentialIds] = credentialIds.jsValue - object[Strings.instrument] = instrument.jsValue - object[Strings.timeout] = timeout.jsValue - object[Strings.payeeOrigin] = payeeOrigin.jsValue - object[Strings.extensions] = extensions.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _challenge = ReadWriteAttribute(jsObject: object, name: Strings.challenge) - _rpId = ReadWriteAttribute(jsObject: object, name: Strings.rpId) - _credentialIds = ReadWriteAttribute(jsObject: object, name: Strings.credentialIds) - _instrument = ReadWriteAttribute(jsObject: object, name: Strings.instrument) - _timeout = ReadWriteAttribute(jsObject: object, name: Strings.timeout) - _payeeOrigin = ReadWriteAttribute(jsObject: object, name: Strings.payeeOrigin) - _extensions = ReadWriteAttribute(jsObject: object, name: Strings.extensions) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var challenge: BufferSource - - @ReadWriteAttribute - public var rpId: String - - @ReadWriteAttribute - public var credentialIds: [BufferSource] - - @ReadWriteAttribute - public var instrument: PaymentCredentialInstrument - - @ReadWriteAttribute - public var timeout: UInt32 - - @ReadWriteAttribute - public var payeeOrigin: String - - @ReadWriteAttribute - public var extensions: AuthenticationExtensionsClientInputs -} diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift deleted file mode 100644 index 283c3d91..00000000 --- a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEvent.swift +++ /dev/null @@ -1,64 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SecurityPolicyViolationEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SecurityPolicyViolationEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _documentURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.documentURI) - _referrer = ReadonlyAttribute(jsObject: jsObject, name: Strings.referrer) - _blockedURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.blockedURI) - _effectiveDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.effectiveDirective) - _violatedDirective = ReadonlyAttribute(jsObject: jsObject, name: Strings.violatedDirective) - _originalPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.originalPolicy) - _sourceFile = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceFile) - _sample = ReadonlyAttribute(jsObject: jsObject, name: Strings.sample) - _disposition = ReadonlyAttribute(jsObject: jsObject, name: Strings.disposition) - _statusCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusCode) - _lineNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.lineNumber) - _columnNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.columnNumber) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: SecurityPolicyViolationEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var documentURI: String - - @ReadonlyAttribute - public var referrer: String - - @ReadonlyAttribute - public var blockedURI: String - - @ReadonlyAttribute - public var effectiveDirective: String - - @ReadonlyAttribute - public var violatedDirective: String - - @ReadonlyAttribute - public var originalPolicy: String - - @ReadonlyAttribute - public var sourceFile: String - - @ReadonlyAttribute - public var sample: String - - @ReadonlyAttribute - public var disposition: SecurityPolicyViolationEventDisposition - - @ReadonlyAttribute - public var statusCode: UInt16 - - @ReadonlyAttribute - public var lineNumber: UInt32 - - @ReadonlyAttribute - public var columnNumber: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift deleted file mode 100644 index 98493676..00000000 --- a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventDisposition.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum SecurityPolicyViolationEventDisposition: JSString, JSValueCompatible { - case enforce = "enforce" - case report = "report" - - @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/SecurityPolicyViolationEventInit.swift b/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift deleted file mode 100644 index c14064df..00000000 --- a/Sources/DOMKit/WebIDL/SecurityPolicyViolationEventInit.swift +++ /dev/null @@ -1,75 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SecurityPolicyViolationEventInit: BridgedDictionary { - public convenience init(documentURI: String, referrer: String, blockedURI: String, violatedDirective: String, effectiveDirective: String, originalPolicy: String, sourceFile: String, sample: String, disposition: SecurityPolicyViolationEventDisposition, statusCode: UInt16, lineNumber: UInt32, columnNumber: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.documentURI] = documentURI.jsValue - object[Strings.referrer] = referrer.jsValue - object[Strings.blockedURI] = blockedURI.jsValue - object[Strings.violatedDirective] = violatedDirective.jsValue - object[Strings.effectiveDirective] = effectiveDirective.jsValue - object[Strings.originalPolicy] = originalPolicy.jsValue - object[Strings.sourceFile] = sourceFile.jsValue - object[Strings.sample] = sample.jsValue - object[Strings.disposition] = disposition.jsValue - object[Strings.statusCode] = statusCode.jsValue - object[Strings.lineNumber] = lineNumber.jsValue - object[Strings.columnNumber] = columnNumber.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _documentURI = ReadWriteAttribute(jsObject: object, name: Strings.documentURI) - _referrer = ReadWriteAttribute(jsObject: object, name: Strings.referrer) - _blockedURI = ReadWriteAttribute(jsObject: object, name: Strings.blockedURI) - _violatedDirective = ReadWriteAttribute(jsObject: object, name: Strings.violatedDirective) - _effectiveDirective = ReadWriteAttribute(jsObject: object, name: Strings.effectiveDirective) - _originalPolicy = ReadWriteAttribute(jsObject: object, name: Strings.originalPolicy) - _sourceFile = ReadWriteAttribute(jsObject: object, name: Strings.sourceFile) - _sample = ReadWriteAttribute(jsObject: object, name: Strings.sample) - _disposition = ReadWriteAttribute(jsObject: object, name: Strings.disposition) - _statusCode = ReadWriteAttribute(jsObject: object, name: Strings.statusCode) - _lineNumber = ReadWriteAttribute(jsObject: object, name: Strings.lineNumber) - _columnNumber = ReadWriteAttribute(jsObject: object, name: Strings.columnNumber) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var documentURI: String - - @ReadWriteAttribute - public var referrer: String - - @ReadWriteAttribute - public var blockedURI: String - - @ReadWriteAttribute - public var violatedDirective: String - - @ReadWriteAttribute - public var effectiveDirective: String - - @ReadWriteAttribute - public var originalPolicy: String - - @ReadWriteAttribute - public var sourceFile: String - - @ReadWriteAttribute - public var sample: String - - @ReadWriteAttribute - public var disposition: SecurityPolicyViolationEventDisposition - - @ReadWriteAttribute - public var statusCode: UInt16 - - @ReadWriteAttribute - public var lineNumber: UInt32 - - @ReadWriteAttribute - public var columnNumber: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/Selection.swift b/Sources/DOMKit/WebIDL/Selection.swift deleted file mode 100644 index 794eb7f6..00000000 --- a/Sources/DOMKit/WebIDL/Selection.swift +++ /dev/null @@ -1,116 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Selection: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Selection].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _anchorNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchorNode) - _anchorOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchorOffset) - _focusNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.focusNode) - _focusOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.focusOffset) - _isCollapsed = ReadonlyAttribute(jsObject: jsObject, name: Strings.isCollapsed) - _rangeCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeCount) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var anchorNode: Node? - - @ReadonlyAttribute - public var anchorOffset: UInt32 - - @ReadonlyAttribute - public var focusNode: Node? - - @ReadonlyAttribute - public var focusOffset: UInt32 - - @ReadonlyAttribute - public var isCollapsed: Bool - - @ReadonlyAttribute - public var rangeCount: UInt32 - - @ReadonlyAttribute - public var type: String - - @inlinable public func getRangeAt(index: UInt32) -> Range { - let this = jsObject - return this[Strings.getRangeAt].function!(this: this, arguments: [index.jsValue]).fromJSValue()! - } - - @inlinable public func addRange(range: Range) { - let this = jsObject - _ = this[Strings.addRange].function!(this: this, arguments: [range.jsValue]) - } - - @inlinable public func removeRange(range: Range) { - let this = jsObject - _ = this[Strings.removeRange].function!(this: this, arguments: [range.jsValue]) - } - - @inlinable public func removeAllRanges() { - let this = jsObject - _ = this[Strings.removeAllRanges].function!(this: this, arguments: []) - } - - @inlinable public func empty() { - let this = jsObject - _ = this[Strings.empty].function!(this: this, arguments: []) - } - - @inlinable public func collapse(node: Node?, offset: UInt32? = nil) { - let this = jsObject - _ = this[Strings.collapse].function!(this: this, arguments: [node.jsValue, offset?.jsValue ?? .undefined]) - } - - @inlinable public func setPosition(node: Node?, offset: UInt32? = nil) { - let this = jsObject - _ = this[Strings.setPosition].function!(this: this, arguments: [node.jsValue, offset?.jsValue ?? .undefined]) - } - - @inlinable public func collapseToStart() { - let this = jsObject - _ = this[Strings.collapseToStart].function!(this: this, arguments: []) - } - - @inlinable public func collapseToEnd() { - let this = jsObject - _ = this[Strings.collapseToEnd].function!(this: this, arguments: []) - } - - @inlinable public func extend(node: Node, offset: UInt32? = nil) { - let this = jsObject - _ = this[Strings.extend].function!(this: this, arguments: [node.jsValue, offset?.jsValue ?? .undefined]) - } - - @inlinable public func setBaseAndExtent(anchorNode: Node, anchorOffset: UInt32, focusNode: Node, focusOffset: UInt32) { - let this = jsObject - _ = this[Strings.setBaseAndExtent].function!(this: this, arguments: [anchorNode.jsValue, anchorOffset.jsValue, focusNode.jsValue, focusOffset.jsValue]) - } - - @inlinable public func selectAllChildren(node: Node) { - let this = jsObject - _ = this[Strings.selectAllChildren].function!(this: this, arguments: [node.jsValue]) - } - - @inlinable public func deleteFromDocument() { - let this = jsObject - _ = this[Strings.deleteFromDocument].function!(this: this, arguments: []) - } - - @inlinable public func containsNode(node: Node, allowPartialContainment: Bool? = nil) -> Bool { - let this = jsObject - return this[Strings.containsNode].function!(this: this, arguments: [node.jsValue, allowPartialContainment?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/Sensor.swift b/Sources/DOMKit/WebIDL/Sensor.swift deleted file mode 100644 index cf070f51..00000000 --- a/Sources/DOMKit/WebIDL/Sensor.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Sensor: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Sensor].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _activated = ReadonlyAttribute(jsObject: jsObject, name: Strings.activated) - _hasReading = ReadonlyAttribute(jsObject: jsObject, name: Strings.hasReading) - _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - _onreading = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreading) - _onactivate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onactivate) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var activated: Bool - - @ReadonlyAttribute - public var hasReading: Bool - - @ReadonlyAttribute - public var timestamp: DOMHighResTimeStamp? - - @inlinable public func start() { - let this = jsObject - _ = this[Strings.start].function!(this: this, arguments: []) - } - - @inlinable public func stop() { - let this = jsObject - _ = this[Strings.stop].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var onreading: EventHandler - - @ClosureAttribute1Optional - public var onactivate: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/SensorErrorEvent.swift b/Sources/DOMKit/WebIDL/SensorErrorEvent.swift deleted file mode 100644 index 4e303955..00000000 --- a/Sources/DOMKit/WebIDL/SensorErrorEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SensorErrorEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SensorErrorEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, errorEventInitDict: SensorErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, errorEventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var error: DOMException -} diff --git a/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift b/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift deleted file mode 100644 index 453dce12..00000000 --- a/Sources/DOMKit/WebIDL/SensorErrorEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SensorErrorEventInit: 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 -} diff --git a/Sources/DOMKit/WebIDL/SensorOptions.swift b/Sources/DOMKit/WebIDL/SensorOptions.swift deleted file mode 100644 index 1a439197..00000000 --- a/Sources/DOMKit/WebIDL/SensorOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SensorOptions: BridgedDictionary { - public convenience init(frequency: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.frequency] = frequency.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _frequency = ReadWriteAttribute(jsObject: object, name: Strings.frequency) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var frequency: Double -} diff --git a/Sources/DOMKit/WebIDL/SequenceEffect.swift b/Sources/DOMKit/WebIDL/SequenceEffect.swift deleted file mode 100644 index 67b4da7e..00000000 --- a/Sources/DOMKit/WebIDL/SequenceEffect.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SequenceEffect: GroupEffect { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SequenceEffect].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(children: [AnimationEffect]?, timing: Double_or_EffectTiming? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [children.jsValue, timing?.jsValue ?? .undefined])) - } - - @inlinable override public func clone() -> Self { - let this = jsObject - return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/Serial.swift b/Sources/DOMKit/WebIDL/Serial.swift deleted file mode 100644 index 8e7ea3f3..00000000 --- a/Sources/DOMKit/WebIDL/Serial.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Serial: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Serial].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var onconnect: EventHandler - - @ClosureAttribute1Optional - public var ondisconnect: EventHandler - - @inlinable public func getPorts() -> JSPromise { - let this = jsObject - return this[Strings.getPorts].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getPorts() async throws -> [SerialPort] { - let this = jsObject - let _promise: JSPromise = this[Strings.getPorts].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func requestPort(options: SerialPortRequestOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestPort(options: SerialPortRequestOptions? = nil) async throws -> SerialPort { - let this = jsObject - let _promise: JSPromise = this[Strings.requestPort].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/SerialInputSignals.swift b/Sources/DOMKit/WebIDL/SerialInputSignals.swift deleted file mode 100644 index 9a395b37..00000000 --- a/Sources/DOMKit/WebIDL/SerialInputSignals.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SerialInputSignals: BridgedDictionary { - public convenience init(dataCarrierDetect: Bool, clearToSend: Bool, ringIndicator: Bool, dataSetReady: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataCarrierDetect] = dataCarrierDetect.jsValue - object[Strings.clearToSend] = clearToSend.jsValue - object[Strings.ringIndicator] = ringIndicator.jsValue - object[Strings.dataSetReady] = dataSetReady.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _dataCarrierDetect = ReadWriteAttribute(jsObject: object, name: Strings.dataCarrierDetect) - _clearToSend = ReadWriteAttribute(jsObject: object, name: Strings.clearToSend) - _ringIndicator = ReadWriteAttribute(jsObject: object, name: Strings.ringIndicator) - _dataSetReady = ReadWriteAttribute(jsObject: object, name: Strings.dataSetReady) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var dataCarrierDetect: Bool - - @ReadWriteAttribute - public var clearToSend: Bool - - @ReadWriteAttribute - public var ringIndicator: Bool - - @ReadWriteAttribute - public var dataSetReady: Bool -} diff --git a/Sources/DOMKit/WebIDL/SerialOptions.swift b/Sources/DOMKit/WebIDL/SerialOptions.swift deleted file mode 100644 index 6220c5a0..00000000 --- a/Sources/DOMKit/WebIDL/SerialOptions.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SerialOptions: BridgedDictionary { - public convenience init(baudRate: UInt32, dataBits: UInt8, stopBits: UInt8, parity: ParityType, bufferSize: UInt32, flowControl: FlowControlType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.baudRate] = baudRate.jsValue - object[Strings.dataBits] = dataBits.jsValue - object[Strings.stopBits] = stopBits.jsValue - object[Strings.parity] = parity.jsValue - object[Strings.bufferSize] = bufferSize.jsValue - object[Strings.flowControl] = flowControl.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _baudRate = ReadWriteAttribute(jsObject: object, name: Strings.baudRate) - _dataBits = ReadWriteAttribute(jsObject: object, name: Strings.dataBits) - _stopBits = ReadWriteAttribute(jsObject: object, name: Strings.stopBits) - _parity = ReadWriteAttribute(jsObject: object, name: Strings.parity) - _bufferSize = ReadWriteAttribute(jsObject: object, name: Strings.bufferSize) - _flowControl = ReadWriteAttribute(jsObject: object, name: Strings.flowControl) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var baudRate: UInt32 - - @ReadWriteAttribute - public var dataBits: UInt8 - - @ReadWriteAttribute - public var stopBits: UInt8 - - @ReadWriteAttribute - public var parity: ParityType - - @ReadWriteAttribute - public var bufferSize: UInt32 - - @ReadWriteAttribute - public var flowControl: FlowControlType -} diff --git a/Sources/DOMKit/WebIDL/SerialOutputSignals.swift b/Sources/DOMKit/WebIDL/SerialOutputSignals.swift deleted file mode 100644 index d0057349..00000000 --- a/Sources/DOMKit/WebIDL/SerialOutputSignals.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SerialOutputSignals: BridgedDictionary { - public convenience init(dataTerminalReady: Bool, requestToSend: Bool, break: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.dataTerminalReady] = dataTerminalReady.jsValue - object[Strings.requestToSend] = requestToSend.jsValue - object[Strings.break] = `break`.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _dataTerminalReady = ReadWriteAttribute(jsObject: object, name: Strings.dataTerminalReady) - _requestToSend = ReadWriteAttribute(jsObject: object, name: Strings.requestToSend) - _break = ReadWriteAttribute(jsObject: object, name: Strings.break) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var dataTerminalReady: Bool - - @ReadWriteAttribute - public var requestToSend: Bool - - @ReadWriteAttribute - public var `break`: Bool -} diff --git a/Sources/DOMKit/WebIDL/SerialPort.swift b/Sources/DOMKit/WebIDL/SerialPort.swift deleted file mode 100644 index b076707e..00000000 --- a/Sources/DOMKit/WebIDL/SerialPort.swift +++ /dev/null @@ -1,81 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SerialPort: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SerialPort].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) - _readable = ReadonlyAttribute(jsObject: jsObject, name: Strings.readable) - _writable = ReadonlyAttribute(jsObject: jsObject, name: Strings.writable) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var onconnect: EventHandler - - @ClosureAttribute1Optional - public var ondisconnect: EventHandler - - @ReadonlyAttribute - public var readable: ReadableStream - - @ReadonlyAttribute - public var writable: WritableStream - - @inlinable public func getInfo() -> SerialPortInfo { - let this = jsObject - return this[Strings.getInfo].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func open(options: SerialOptions) -> JSPromise { - let this = jsObject - return this[Strings.open].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func open(options: SerialOptions) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func setSignals(signals: SerialOutputSignals? = nil) -> JSPromise { - let this = jsObject - return this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func setSignals(signals: SerialOutputSignals? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.setSignals].function!(this: this, arguments: [signals?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func getSignals() -> JSPromise { - let this = jsObject - return this[Strings.getSignals].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getSignals() async throws -> SerialInputSignals { - let this = jsObject - let _promise: JSPromise = this[Strings.getSignals].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @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 - } -} diff --git a/Sources/DOMKit/WebIDL/SerialPortFilter.swift b/Sources/DOMKit/WebIDL/SerialPortFilter.swift deleted file mode 100644 index 496ebfe0..00000000 --- a/Sources/DOMKit/WebIDL/SerialPortFilter.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SerialPortFilter: BridgedDictionary { - public convenience init(usbVendorId: UInt16, usbProductId: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usbVendorId] = usbVendorId.jsValue - object[Strings.usbProductId] = usbProductId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _usbVendorId = ReadWriteAttribute(jsObject: object, name: Strings.usbVendorId) - _usbProductId = ReadWriteAttribute(jsObject: object, name: Strings.usbProductId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var usbVendorId: UInt16 - - @ReadWriteAttribute - public var usbProductId: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/SerialPortInfo.swift b/Sources/DOMKit/WebIDL/SerialPortInfo.swift deleted file mode 100644 index 6aa61803..00000000 --- a/Sources/DOMKit/WebIDL/SerialPortInfo.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SerialPortInfo: BridgedDictionary { - public convenience init(usbVendorId: UInt16, usbProductId: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usbVendorId] = usbVendorId.jsValue - object[Strings.usbProductId] = usbProductId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _usbVendorId = ReadWriteAttribute(jsObject: object, name: Strings.usbVendorId) - _usbProductId = ReadWriteAttribute(jsObject: object, name: Strings.usbProductId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var usbVendorId: UInt16 - - @ReadWriteAttribute - public var usbProductId: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift b/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift deleted file mode 100644 index af4c44bc..00000000 --- a/Sources/DOMKit/WebIDL/SerialPortRequestOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SerialPortRequestOptions: BridgedDictionary { - public convenience init(filters: [SerialPortFilter]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var filters: [SerialPortFilter] -} diff --git a/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift b/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift deleted file mode 100644 index 2b787a3d..00000000 --- a/Sources/DOMKit/WebIDL/ServiceEventHandlers.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol ServiceEventHandlers: JSBridgedClass {} -public extension ServiceEventHandlers { - @inlinable var onserviceadded: EventHandler { - get { ClosureAttribute1Optional[Strings.onserviceadded, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onserviceadded, in: jsObject] = newValue } - } - - @inlinable var onservicechanged: EventHandler { - get { ClosureAttribute1Optional[Strings.onservicechanged, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onservicechanged, in: jsObject] = newValue } - } - - @inlinable var onserviceremoved: EventHandler { - get { ClosureAttribute1Optional[Strings.onserviceremoved, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onserviceremoved, in: jsObject] = newValue } - } -} diff --git a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift index 65173f2e..67ea90db 100644 --- a/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift +++ b/Sources/DOMKit/WebIDL/ServiceWorkerRegistration.swift @@ -7,13 +7,6 @@ public class ServiceWorkerRegistration: EventTarget { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ServiceWorkerRegistration].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _backgroundFetch = ReadonlyAttribute(jsObject: jsObject, name: Strings.backgroundFetch) - _sync = ReadonlyAttribute(jsObject: jsObject, name: Strings.sync) - _index = ReadonlyAttribute(jsObject: jsObject, name: Strings.index) - _cookies = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookies) - _paymentManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.paymentManager) - _periodicSync = ReadonlyAttribute(jsObject: jsObject, name: Strings.periodicSync) - _pushManager = ReadonlyAttribute(jsObject: jsObject, name: Strings.pushManager) _installing = ReadonlyAttribute(jsObject: jsObject, name: Strings.installing) _waiting = ReadonlyAttribute(jsObject: jsObject, name: Strings.waiting) _active = ReadonlyAttribute(jsObject: jsObject, name: Strings.active) @@ -24,51 +17,6 @@ public class ServiceWorkerRegistration: EventTarget { super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var backgroundFetch: BackgroundFetchManager - - @ReadonlyAttribute - public var sync: SyncManager - - @ReadonlyAttribute - public var index: ContentIndex - - @ReadonlyAttribute - public var cookies: CookieStoreManager - - @inlinable public func showNotification(title: String, options: NotificationOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.showNotification].function!(this: this, arguments: [title.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func showNotification(title: String, options: NotificationOptions? = nil) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.showNotification].function!(this: this, arguments: [title.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func getNotifications(filter: GetNotificationOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getNotifications(filter: GetNotificationOptions? = nil) async throws -> [Notification] { - let this = jsObject - let _promise: JSPromise = this[Strings.getNotifications].function!(this: this, arguments: [filter?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var paymentManager: PaymentManager - - @ReadonlyAttribute - public var periodicSync: PeriodicSyncManager - - @ReadonlyAttribute - public var pushManager: PushManager - @ReadonlyAttribute public var installing: ServiceWorker? diff --git a/Sources/DOMKit/WebIDL/SetHTMLOptions.swift b/Sources/DOMKit/WebIDL/SetHTMLOptions.swift deleted file mode 100644 index 0cf84de5..00000000 --- a/Sources/DOMKit/WebIDL/SetHTMLOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SetHTMLOptions: BridgedDictionary { - public convenience init(sanitizer: Sanitizer) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sanitizer] = sanitizer.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _sanitizer = ReadWriteAttribute(jsObject: object, name: Strings.sanitizer) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var sanitizer: Sanitizer -} diff --git a/Sources/DOMKit/WebIDL/ShadowRoot.swift b/Sources/DOMKit/WebIDL/ShadowRoot.swift index 410bcc77..524a002f 100644 --- a/Sources/DOMKit/WebIDL/ShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/ShadowRoot.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class ShadowRoot: DocumentFragment, InnerHTML, DocumentOrShadowRoot { +public class ShadowRoot: DocumentFragment, DocumentOrShadowRoot { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ShadowRoot].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/ShareData.swift b/Sources/DOMKit/WebIDL/ShareData.swift deleted file mode 100644 index 915e6609..00000000 --- a/Sources/DOMKit/WebIDL/ShareData.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ShareData: BridgedDictionary { - public convenience init(files: [File], title: String, text: String, url: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.files] = files.jsValue - object[Strings.title] = title.jsValue - object[Strings.text] = text.jsValue - object[Strings.url] = url.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _files = ReadWriteAttribute(jsObject: object, name: Strings.files) - _title = ReadWriteAttribute(jsObject: object, name: Strings.title) - _text = ReadWriteAttribute(jsObject: object, name: Strings.text) - _url = ReadWriteAttribute(jsObject: object, name: Strings.url) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var files: [File] - - @ReadWriteAttribute - public var title: String - - @ReadWriteAttribute - public var text: String - - @ReadWriteAttribute - public var url: String -} diff --git a/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift b/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift deleted file mode 100644 index e45ede8e..00000000 --- a/Sources/DOMKit/WebIDL/SpatialNavigationDirection.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum SpatialNavigationDirection: JSString, JSValueCompatible { - case up = "up" - case down = "down" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift b/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift deleted file mode 100644 index 7208e0a4..00000000 --- a/Sources/DOMKit/WebIDL/SpatialNavigationSearchOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpatialNavigationSearchOptions: BridgedDictionary { - public convenience init(candidates: [Node]?, container: Node?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.candidates] = candidates.jsValue - object[Strings.container] = container.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _candidates = ReadWriteAttribute(jsObject: object, name: Strings.candidates) - _container = ReadWriteAttribute(jsObject: object, name: Strings.container) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var candidates: [Node]? - - @ReadWriteAttribute - public var container: Node? -} diff --git a/Sources/DOMKit/WebIDL/SpeechGrammar.swift b/Sources/DOMKit/WebIDL/SpeechGrammar.swift deleted file mode 100644 index 0ceba22e..00000000 --- a/Sources/DOMKit/WebIDL/SpeechGrammar.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechGrammar: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechGrammar].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) - _weight = ReadWriteAttribute(jsObject: jsObject, name: Strings.weight) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var src: String - - @ReadWriteAttribute - public var weight: Float -} diff --git a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift b/Sources/DOMKit/WebIDL/SpeechGrammarList.swift deleted file mode 100644 index bd0332bb..00000000 --- a/Sources/DOMKit/WebIDL/SpeechGrammarList.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechGrammarList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechGrammarList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> SpeechGrammar { - jsObject[key].fromJSValue()! - } - - @inlinable public func addFromURI(src: String, weight: Float? = nil) { - let this = jsObject - _ = this[Strings.addFromURI].function!(this: this, arguments: [src.jsValue, weight?.jsValue ?? .undefined]) - } - - @inlinable public func addFromString(string: String, weight: Float? = nil) { - let this = jsObject - _ = this[Strings.addFromString].function!(this: this, arguments: [string.jsValue, weight?.jsValue ?? .undefined]) - } -} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognition.swift b/Sources/DOMKit/WebIDL/SpeechRecognition.swift deleted file mode 100644 index ba2cbbdb..00000000 --- a/Sources/DOMKit/WebIDL/SpeechRecognition.swift +++ /dev/null @@ -1,95 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechRecognition: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognition].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _grammars = ReadWriteAttribute(jsObject: jsObject, name: Strings.grammars) - _lang = ReadWriteAttribute(jsObject: jsObject, name: Strings.lang) - _continuous = ReadWriteAttribute(jsObject: jsObject, name: Strings.continuous) - _interimResults = ReadWriteAttribute(jsObject: jsObject, name: Strings.interimResults) - _maxAlternatives = ReadWriteAttribute(jsObject: jsObject, name: Strings.maxAlternatives) - _onaudiostart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaudiostart) - _onsoundstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsoundstart) - _onspeechstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onspeechstart) - _onspeechend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onspeechend) - _onsoundend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsoundend) - _onaudioend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaudioend) - _onresult = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresult) - _onnomatch = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onnomatch) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - _onstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstart) - _onend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onend) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @ReadWriteAttribute - public var grammars: SpeechGrammarList - - @ReadWriteAttribute - public var lang: String - - @ReadWriteAttribute - public var continuous: Bool - - @ReadWriteAttribute - public var interimResults: Bool - - @ReadWriteAttribute - public var maxAlternatives: UInt32 - - @inlinable public func start() { - let this = jsObject - _ = this[Strings.start].function!(this: this, arguments: []) - } - - @inlinable public func stop() { - let this = jsObject - _ = this[Strings.stop].function!(this: this, arguments: []) - } - - @inlinable public func abort() { - let this = jsObject - _ = this[Strings.abort].function!(this: this, arguments: []) - } - - @ClosureAttribute1Optional - public var onaudiostart: EventHandler - - @ClosureAttribute1Optional - public var onsoundstart: EventHandler - - @ClosureAttribute1Optional - public var onspeechstart: EventHandler - - @ClosureAttribute1Optional - public var onspeechend: EventHandler - - @ClosureAttribute1Optional - public var onsoundend: EventHandler - - @ClosureAttribute1Optional - public var onaudioend: EventHandler - - @ClosureAttribute1Optional - public var onresult: EventHandler - - @ClosureAttribute1Optional - public var onnomatch: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler - - @ClosureAttribute1Optional - public var onstart: EventHandler - - @ClosureAttribute1Optional - public var onend: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift deleted file mode 100644 index 506ca310..00000000 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionAlternative.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechRecognitionAlternative: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionAlternative].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _transcript = ReadonlyAttribute(jsObject: jsObject, name: Strings.transcript) - _confidence = ReadonlyAttribute(jsObject: jsObject, name: Strings.confidence) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var transcript: String - - @ReadonlyAttribute - public var confidence: Float -} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift deleted file mode 100644 index d4d631dd..00000000 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorCode.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum SpeechRecognitionErrorCode: JSString, JSValueCompatible { - case noSpeech = "no-speech" - case aborted = "aborted" - case audioCapture = "audio-capture" - case network = "network" - case notAllowed = "not-allowed" - case serviceNotAllowed = "service-not-allowed" - case badGrammar = "bad-grammar" - case languageNotSupported = "language-not-supported" - - @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/SpeechRecognitionErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift deleted file mode 100644 index 4423e691..00000000 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechRecognitionErrorEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionErrorEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) - _message = ReadonlyAttribute(jsObject: jsObject, name: Strings.message) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: SpeechRecognitionErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var error: SpeechRecognitionErrorCode - - @ReadonlyAttribute - public var message: String -} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift deleted file mode 100644 index e920e554..00000000 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionErrorEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechRecognitionErrorEventInit: BridgedDictionary { - public convenience init(error: SpeechRecognitionErrorCode, message: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.error] = error.jsValue - object[Strings.message] = message.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _error = ReadWriteAttribute(jsObject: object, name: Strings.error) - _message = ReadWriteAttribute(jsObject: object, name: Strings.message) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var error: SpeechRecognitionErrorCode - - @ReadWriteAttribute - public var message: String -} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift deleted file mode 100644 index 31504966..00000000 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechRecognitionEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _resultIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.resultIndex) - _results = ReadonlyAttribute(jsObject: jsObject, name: Strings.results) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: SpeechRecognitionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var resultIndex: UInt32 - - @ReadonlyAttribute - public var results: SpeechRecognitionResultList -} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift deleted file mode 100644 index 3983275c..00000000 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechRecognitionEventInit: BridgedDictionary { - public convenience init(resultIndex: UInt32, results: SpeechRecognitionResultList) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.resultIndex] = resultIndex.jsValue - object[Strings.results] = results.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _resultIndex = ReadWriteAttribute(jsObject: object, name: Strings.resultIndex) - _results = ReadWriteAttribute(jsObject: object, name: Strings.results) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var resultIndex: UInt32 - - @ReadWriteAttribute - public var results: SpeechRecognitionResultList -} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift deleted file mode 100644 index 17a04f81..00000000 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionResult.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechRecognitionResult: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionResult].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _isFinal = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFinal) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> SpeechRecognitionAlternative { - jsObject[key].fromJSValue()! - } - - @ReadonlyAttribute - public var isFinal: Bool -} diff --git a/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift b/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift deleted file mode 100644 index 66f66136..00000000 --- a/Sources/DOMKit/WebIDL/SpeechRecognitionResultList.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechRecognitionResultList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechRecognitionResultList].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 subscript(key: Int) -> SpeechRecognitionResult { - jsObject[key].fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift b/Sources/DOMKit/WebIDL/SpeechSynthesis.swift deleted file mode 100644 index 36667dbe..00000000 --- a/Sources/DOMKit/WebIDL/SpeechSynthesis.swift +++ /dev/null @@ -1,53 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechSynthesis: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesis].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _pending = ReadonlyAttribute(jsObject: jsObject, name: Strings.pending) - _speaking = ReadonlyAttribute(jsObject: jsObject, name: Strings.speaking) - _paused = ReadonlyAttribute(jsObject: jsObject, name: Strings.paused) - _onvoiceschanged = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onvoiceschanged) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var pending: Bool - - @ReadonlyAttribute - public var speaking: Bool - - @ReadonlyAttribute - public var paused: Bool - - @ClosureAttribute1Optional - public var onvoiceschanged: EventHandler - - @inlinable public func speak(utterance: SpeechSynthesisUtterance) { - let this = jsObject - _ = this[Strings.speak].function!(this: this, arguments: [utterance.jsValue]) - } - - @inlinable public func cancel() { - let this = jsObject - _ = this[Strings.cancel].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 getVoices() -> [SpeechSynthesisVoice] { - let this = jsObject - return this[Strings.getVoices].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift deleted file mode 100644 index 224aff9c..00000000 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorCode.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum SpeechSynthesisErrorCode: JSString, JSValueCompatible { - case canceled = "canceled" - case interrupted = "interrupted" - case audioBusy = "audio-busy" - case audioHardware = "audio-hardware" - case network = "network" - case synthesisUnavailable = "synthesis-unavailable" - case synthesisFailed = "synthesis-failed" - case languageUnavailable = "language-unavailable" - case voiceUnavailable = "voice-unavailable" - case textTooLong = "text-too-long" - case invalidArgument = "invalid-argument" - case notAllowed = "not-allowed" - - @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/SpeechSynthesisErrorEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift deleted file mode 100644 index 92f70538..00000000 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechSynthesisErrorEvent: SpeechSynthesisEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisErrorEvent].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: SpeechSynthesisErrorEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var error: SpeechSynthesisErrorCode -} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift deleted file mode 100644 index 888b0c1a..00000000 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisErrorEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechSynthesisErrorEventInit: BridgedDictionary { - public convenience init(error: SpeechSynthesisErrorCode) { - 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: SpeechSynthesisErrorCode -} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift deleted file mode 100644 index cc6ea283..00000000 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisEvent.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechSynthesisEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _utterance = ReadonlyAttribute(jsObject: jsObject, name: Strings.utterance) - _charIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.charIndex) - _charLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.charLength) - _elapsedTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.elapsedTime) - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: SpeechSynthesisEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var utterance: SpeechSynthesisUtterance - - @ReadonlyAttribute - public var charIndex: UInt32 - - @ReadonlyAttribute - public var charLength: UInt32 - - @ReadonlyAttribute - public var elapsedTime: Float - - @ReadonlyAttribute - public var name: String -} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift deleted file mode 100644 index c3f887bd..00000000 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisEventInit.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechSynthesisEventInit: BridgedDictionary { - public convenience init(utterance: SpeechSynthesisUtterance, charIndex: UInt32, charLength: UInt32, elapsedTime: Float, name: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.utterance] = utterance.jsValue - object[Strings.charIndex] = charIndex.jsValue - object[Strings.charLength] = charLength.jsValue - object[Strings.elapsedTime] = elapsedTime.jsValue - object[Strings.name] = name.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _utterance = ReadWriteAttribute(jsObject: object, name: Strings.utterance) - _charIndex = ReadWriteAttribute(jsObject: object, name: Strings.charIndex) - _charLength = ReadWriteAttribute(jsObject: object, name: Strings.charLength) - _elapsedTime = ReadWriteAttribute(jsObject: object, name: Strings.elapsedTime) - _name = ReadWriteAttribute(jsObject: object, name: Strings.name) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var utterance: SpeechSynthesisUtterance - - @ReadWriteAttribute - public var charIndex: UInt32 - - @ReadWriteAttribute - public var charLength: UInt32 - - @ReadWriteAttribute - public var elapsedTime: Float - - @ReadWriteAttribute - public var name: String -} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift deleted file mode 100644 index 6c5304fa..00000000 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisUtterance.swift +++ /dev/null @@ -1,68 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechSynthesisUtterance: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisUtterance].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) - _lang = ReadWriteAttribute(jsObject: jsObject, name: Strings.lang) - _voice = ReadWriteAttribute(jsObject: jsObject, name: Strings.voice) - _volume = ReadWriteAttribute(jsObject: jsObject, name: Strings.volume) - _rate = ReadWriteAttribute(jsObject: jsObject, name: Strings.rate) - _pitch = ReadWriteAttribute(jsObject: jsObject, name: Strings.pitch) - _onstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstart) - _onend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onend) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - _onpause = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpause) - _onresume = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresume) - _onmark = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmark) - _onboundary = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onboundary) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(text: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [text?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var text: String - - @ReadWriteAttribute - public var lang: String - - @ReadWriteAttribute - public var voice: SpeechSynthesisVoice? - - @ReadWriteAttribute - public var volume: Float - - @ReadWriteAttribute - public var rate: Float - - @ReadWriteAttribute - public var pitch: Float - - @ClosureAttribute1Optional - public var onstart: EventHandler - - @ClosureAttribute1Optional - public var onend: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler - - @ClosureAttribute1Optional - public var onpause: EventHandler - - @ClosureAttribute1Optional - public var onresume: EventHandler - - @ClosureAttribute1Optional - public var onmark: EventHandler - - @ClosureAttribute1Optional - public var onboundary: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift b/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift deleted file mode 100644 index 4dd8af22..00000000 --- a/Sources/DOMKit/WebIDL/SpeechSynthesisVoice.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SpeechSynthesisVoice: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SpeechSynthesisVoice].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _voiceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.voiceURI) - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _lang = ReadonlyAttribute(jsObject: jsObject, name: Strings.lang) - _localService = ReadonlyAttribute(jsObject: jsObject, name: Strings.localService) - _default = ReadonlyAttribute(jsObject: jsObject, name: Strings.default) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var voiceURI: String - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var lang: String - - @ReadonlyAttribute - public var localService: Bool - - @ReadonlyAttribute - public var `default`: Bool -} diff --git a/Sources/DOMKit/WebIDL/StartInDirectory.swift b/Sources/DOMKit/WebIDL/StartInDirectory.swift deleted file mode 100644 index 8f4c2550..00000000 --- a/Sources/DOMKit/WebIDL/StartInDirectory.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_StartInDirectory: ConvertibleToJSValue {} -extension FileSystemHandle: Any_StartInDirectory {} -extension WellKnownDirectory: Any_StartInDirectory {} - -public enum StartInDirectory: JSValueCompatible, Any_StartInDirectory { - case fileSystemHandle(FileSystemHandle) - case wellKnownDirectory(WellKnownDirectory) - - public static func construct(from value: JSValue) -> Self? { - if let fileSystemHandle: FileSystemHandle = value.fromJSValue() { - return .fileSystemHandle(fileSystemHandle) - } - if let wellKnownDirectory: WellKnownDirectory = value.fromJSValue() { - return .wellKnownDirectory(wellKnownDirectory) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .fileSystemHandle(fileSystemHandle): - return fileSystemHandle.jsValue - case let .wellKnownDirectory(wellKnownDirectory): - return wellKnownDirectory.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/StereoPannerNode.swift b/Sources/DOMKit/WebIDL/StereoPannerNode.swift deleted file mode 100644 index b85da5e4..00000000 --- a/Sources/DOMKit/WebIDL/StereoPannerNode.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class StereoPannerNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.StereoPannerNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _pan = ReadonlyAttribute(jsObject: jsObject, name: Strings.pan) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: StereoPannerOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var pan: AudioParam -} diff --git a/Sources/DOMKit/WebIDL/StereoPannerOptions.swift b/Sources/DOMKit/WebIDL/StereoPannerOptions.swift deleted file mode 100644 index 8c42c5d1..00000000 --- a/Sources/DOMKit/WebIDL/StereoPannerOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class StereoPannerOptions: BridgedDictionary { - public convenience init(pan: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.pan] = pan.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _pan = ReadWriteAttribute(jsObject: object, name: Strings.pan) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var pan: Float -} diff --git a/Sources/DOMKit/WebIDL/StorageEstimate.swift b/Sources/DOMKit/WebIDL/StorageEstimate.swift deleted file mode 100644 index 0f3c2cda..00000000 --- a/Sources/DOMKit/WebIDL/StorageEstimate.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class StorageEstimate: BridgedDictionary { - public convenience init(usage: UInt64, quota: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usage] = usage.jsValue - object[Strings.quota] = quota.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _usage = ReadWriteAttribute(jsObject: object, name: Strings.usage) - _quota = ReadWriteAttribute(jsObject: object, name: Strings.quota) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var usage: UInt64 - - @ReadWriteAttribute - public var quota: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/StorageManager.swift b/Sources/DOMKit/WebIDL/StorageManager.swift deleted file mode 100644 index ae572810..00000000 --- a/Sources/DOMKit/WebIDL/StorageManager.swift +++ /dev/null @@ -1,62 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class StorageManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.StorageManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func getDirectory() -> JSPromise { - let this = jsObject - return this[Strings.getDirectory].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDirectory() async throws -> FileSystemDirectoryHandle { - let this = jsObject - let _promise: JSPromise = this[Strings.getDirectory].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func persisted() -> JSPromise { - let this = jsObject - return this[Strings.persisted].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func persisted() async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.persisted].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func persist() -> JSPromise { - let this = jsObject - return this[Strings.persist].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func persist() async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.persist].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func estimate() -> JSPromise { - let this = jsObject - return this[Strings.estimate].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func estimate() async throws -> StorageEstimate { - let this = jsObject - let _promise: JSPromise = this[Strings.estimate].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift b/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift deleted file mode 100644 index 58aca04f..00000000 --- a/Sources/DOMKit/WebIDL/String_or_seq_of_UUID.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_String_or_seq_of_UUID: ConvertibleToJSValue {} -extension String: Any_String_or_seq_of_UUID {} -extension Array: Any_String_or_seq_of_UUID where Element == UUID {} - -public enum String_or_seq_of_UUID: JSValueCompatible, Any_String_or_seq_of_UUID { - case string(String) - case seq_of_UUID([UUID]) - - public static func construct(from value: JSValue) -> Self? { - if let string: String = value.fromJSValue() { - return .string(string) - } - if let seq_of_UUID: [UUID] = value.fromJSValue() { - return .seq_of_UUID(seq_of_UUID) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .string(string): - return string.jsValue - case let .seq_of_UUID(seq_of_UUID): - return seq_of_UUID.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index 1f1494c0..b532df0e 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -5,185 +5,50 @@ import JavaScriptKit @usableFromInline enum Strings { static let _self: JSString = "self" - @usableFromInline static let ANGLE_instanced_arrays: JSString = "ANGLE_instanced_arrays" @usableFromInline static let AbortController: JSString = "AbortController" @usableFromInline static let AbortSignal: JSString = "AbortSignal" - @usableFromInline static let AbsoluteOrientationSensor: JSString = "AbsoluteOrientationSensor" @usableFromInline static let AbstractRange: JSString = "AbstractRange" - @usableFromInline static let Accelerometer: JSString = "Accelerometer" @usableFromInline static let AddSearchProvider: JSString = "AddSearchProvider" - @usableFromInline static let AmbientLightSensor: JSString = "AmbientLightSensor" - @usableFromInline static let AnalyserNode: JSString = "AnalyserNode" @usableFromInline static let Animation: JSString = "Animation" @usableFromInline static let AnimationEffect: JSString = "AnimationEffect" - @usableFromInline static let AnimationEvent: JSString = "AnimationEvent" - @usableFromInline static let AnimationNodeList: JSString = "AnimationNodeList" - @usableFromInline static let AnimationPlaybackEvent: JSString = "AnimationPlaybackEvent" @usableFromInline static let AnimationTimeline: JSString = "AnimationTimeline" @usableFromInline static let Attr: JSString = "Attr" - @usableFromInline static let AttributionReporting: JSString = "AttributionReporting" - @usableFromInline static let AudioBuffer: JSString = "AudioBuffer" - @usableFromInline static let AudioBufferSourceNode: JSString = "AudioBufferSourceNode" - @usableFromInline static let AudioContext: JSString = "AudioContext" @usableFromInline static let AudioData: JSString = "AudioData" @usableFromInline static let AudioDecoder: JSString = "AudioDecoder" - @usableFromInline static let AudioDestinationNode: JSString = "AudioDestinationNode" @usableFromInline static let AudioEncoder: JSString = "AudioEncoder" - @usableFromInline static let AudioListener: JSString = "AudioListener" - @usableFromInline static let AudioNode: JSString = "AudioNode" - @usableFromInline static let AudioParam: JSString = "AudioParam" - @usableFromInline static let AudioParamMap: JSString = "AudioParamMap" - @usableFromInline static let AudioProcessingEvent: JSString = "AudioProcessingEvent" - @usableFromInline static let AudioScheduledSourceNode: JSString = "AudioScheduledSourceNode" @usableFromInline static let AudioTrack: JSString = "AudioTrack" @usableFromInline static let AudioTrackList: JSString = "AudioTrackList" - @usableFromInline static let AudioWorklet: JSString = "AudioWorklet" - @usableFromInline static let AudioWorkletNode: JSString = "AudioWorkletNode" - @usableFromInline static let AuthenticatorAssertionResponse: JSString = "AuthenticatorAssertionResponse" - @usableFromInline static let AuthenticatorAttestationResponse: JSString = "AuthenticatorAttestationResponse" - @usableFromInline static let AuthenticatorResponse: JSString = "AuthenticatorResponse" - @usableFromInline static let BackgroundFetchManager: JSString = "BackgroundFetchManager" - @usableFromInline static let BackgroundFetchRecord: JSString = "BackgroundFetchRecord" - @usableFromInline static let BackgroundFetchRegistration: JSString = "BackgroundFetchRegistration" @usableFromInline static let BarProp: JSString = "BarProp" - @usableFromInline static let BarcodeDetector: JSString = "BarcodeDetector" - @usableFromInline static let BaseAudioContext: JSString = "BaseAudioContext" - @usableFromInline static let Baseline: JSString = "Baseline" - @usableFromInline static let BatteryManager: JSString = "BatteryManager" - @usableFromInline static let BeforeInstallPromptEvent: JSString = "BeforeInstallPromptEvent" @usableFromInline static let BeforeUnloadEvent: JSString = "BeforeUnloadEvent" - @usableFromInline static let BiquadFilterNode: JSString = "BiquadFilterNode" @usableFromInline static let Blob: JSString = "Blob" @usableFromInline static let BlobEvent: JSString = "BlobEvent" - @usableFromInline static let Bluetooth: JSString = "Bluetooth" - @usableFromInline static let BluetoothAdvertisingEvent: JSString = "BluetoothAdvertisingEvent" - @usableFromInline static let BluetoothCharacteristicProperties: JSString = "BluetoothCharacteristicProperties" - @usableFromInline static let BluetoothDevice: JSString = "BluetoothDevice" - @usableFromInline static let BluetoothManufacturerDataMap: JSString = "BluetoothManufacturerDataMap" - @usableFromInline static let BluetoothPermissionResult: JSString = "BluetoothPermissionResult" - @usableFromInline static let BluetoothRemoteGATTCharacteristic: JSString = "BluetoothRemoteGATTCharacteristic" - @usableFromInline static let BluetoothRemoteGATTDescriptor: JSString = "BluetoothRemoteGATTDescriptor" - @usableFromInline static let BluetoothRemoteGATTServer: JSString = "BluetoothRemoteGATTServer" - @usableFromInline static let BluetoothRemoteGATTService: JSString = "BluetoothRemoteGATTService" - @usableFromInline static let BluetoothServiceDataMap: JSString = "BluetoothServiceDataMap" - @usableFromInline static let BluetoothUUID: JSString = "BluetoothUUID" @usableFromInline static let BroadcastChannel: JSString = "BroadcastChannel" - @usableFromInline static let BrowserCaptureMediaStreamTrack: JSString = "BrowserCaptureMediaStreamTrack" @usableFromInline static let ByteLengthQueuingStrategy: JSString = "ByteLengthQueuingStrategy" @usableFromInline static let CDATASection: JSString = "CDATASection" - @usableFromInline static let CSPViolationReportBody: JSString = "CSPViolationReportBody" @usableFromInline static let CSS: JSString = "CSS" - @usableFromInline static let CSSAnimation: JSString = "CSSAnimation" - @usableFromInline static let CSSColor: JSString = "CSSColor" - @usableFromInline static let CSSColorValue: JSString = "CSSColorValue" - @usableFromInline static let CSSConditionRule: JSString = "CSSConditionRule" - @usableFromInline static let CSSContainerRule: JSString = "CSSContainerRule" - @usableFromInline static let CSSCounterStyleRule: JSString = "CSSCounterStyleRule" - @usableFromInline static let CSSFontFaceRule: JSString = "CSSFontFaceRule" - @usableFromInline static let CSSFontFeatureValuesMap: JSString = "CSSFontFeatureValuesMap" - @usableFromInline static let CSSFontFeatureValuesRule: JSString = "CSSFontFeatureValuesRule" - @usableFromInline static let CSSFontPaletteValuesRule: JSString = "CSSFontPaletteValuesRule" @usableFromInline static let CSSGroupingRule: JSString = "CSSGroupingRule" - @usableFromInline static let CSSHSL: JSString = "CSSHSL" - @usableFromInline static let CSSHWB: JSString = "CSSHWB" - @usableFromInline static let CSSImageValue: JSString = "CSSImageValue" @usableFromInline static let CSSImportRule: JSString = "CSSImportRule" - @usableFromInline static let CSSKeyframeRule: JSString = "CSSKeyframeRule" - @usableFromInline static let CSSKeyframesRule: JSString = "CSSKeyframesRule" - @usableFromInline static let CSSKeywordValue: JSString = "CSSKeywordValue" - @usableFromInline static let CSSLCH: JSString = "CSSLCH" - @usableFromInline static let CSSLab: JSString = "CSSLab" - @usableFromInline static let CSSLayerBlockRule: JSString = "CSSLayerBlockRule" - @usableFromInline static let CSSLayerStatementRule: JSString = "CSSLayerStatementRule" @usableFromInline static let CSSMarginRule: JSString = "CSSMarginRule" - @usableFromInline static let CSSMathClamp: JSString = "CSSMathClamp" - @usableFromInline static let CSSMathInvert: JSString = "CSSMathInvert" - @usableFromInline static let CSSMathMax: JSString = "CSSMathMax" - @usableFromInline static let CSSMathMin: JSString = "CSSMathMin" - @usableFromInline static let CSSMathNegate: JSString = "CSSMathNegate" - @usableFromInline static let CSSMathProduct: JSString = "CSSMathProduct" - @usableFromInline static let CSSMathSum: JSString = "CSSMathSum" - @usableFromInline static let CSSMathValue: JSString = "CSSMathValue" - @usableFromInline static let CSSMatrixComponent: JSString = "CSSMatrixComponent" - @usableFromInline static let CSSMediaRule: JSString = "CSSMediaRule" @usableFromInline static let CSSNamespaceRule: JSString = "CSSNamespaceRule" - @usableFromInline static let CSSNestingRule: JSString = "CSSNestingRule" - @usableFromInline static let CSSNumericArray: JSString = "CSSNumericArray" - @usableFromInline static let CSSNumericValue: JSString = "CSSNumericValue" - @usableFromInline static let CSSOKLCH: JSString = "CSSOKLCH" - @usableFromInline static let CSSOKLab: JSString = "CSSOKLab" @usableFromInline static let CSSPageRule: JSString = "CSSPageRule" - @usableFromInline static let CSSParserAtRule: JSString = "CSSParserAtRule" - @usableFromInline static let CSSParserBlock: JSString = "CSSParserBlock" - @usableFromInline static let CSSParserDeclaration: JSString = "CSSParserDeclaration" - @usableFromInline static let CSSParserFunction: JSString = "CSSParserFunction" - @usableFromInline static let CSSParserQualifiedRule: JSString = "CSSParserQualifiedRule" - @usableFromInline static let CSSParserRule: JSString = "CSSParserRule" - @usableFromInline static let CSSParserValue: JSString = "CSSParserValue" - @usableFromInline static let CSSPerspective: JSString = "CSSPerspective" - @usableFromInline static let CSSPropertyRule: JSString = "CSSPropertyRule" @usableFromInline static let CSSPseudoElement: JSString = "CSSPseudoElement" - @usableFromInline static let CSSRGB: JSString = "CSSRGB" - @usableFromInline static let CSSRotate: JSString = "CSSRotate" @usableFromInline static let CSSRule: JSString = "CSSRule" @usableFromInline static let CSSRuleList: JSString = "CSSRuleList" - @usableFromInline static let CSSScale: JSString = "CSSScale" - @usableFromInline static let CSSScrollTimelineRule: JSString = "CSSScrollTimelineRule" - @usableFromInline static let CSSSkew: JSString = "CSSSkew" - @usableFromInline static let CSSSkewX: JSString = "CSSSkewX" - @usableFromInline static let CSSSkewY: JSString = "CSSSkewY" @usableFromInline static let CSSStyleDeclaration: JSString = "CSSStyleDeclaration" @usableFromInline static let CSSStyleRule: JSString = "CSSStyleRule" @usableFromInline static let CSSStyleSheet: JSString = "CSSStyleSheet" - @usableFromInline static let CSSStyleValue: JSString = "CSSStyleValue" - @usableFromInline static let CSSSupportsRule: JSString = "CSSSupportsRule" - @usableFromInline static let CSSTransformComponent: JSString = "CSSTransformComponent" - @usableFromInline static let CSSTransformValue: JSString = "CSSTransformValue" - @usableFromInline static let CSSTransition: JSString = "CSSTransition" - @usableFromInline static let CSSTranslate: JSString = "CSSTranslate" - @usableFromInline static let CSSUnitValue: JSString = "CSSUnitValue" - @usableFromInline static let CSSUnparsedValue: JSString = "CSSUnparsedValue" - @usableFromInline static let CSSVariableReferenceValue: JSString = "CSSVariableReferenceValue" - @usableFromInline static let CSSViewportRule: JSString = "CSSViewportRule" @usableFromInline static let Cache: JSString = "Cache" @usableFromInline static let CacheStorage: JSString = "CacheStorage" - @usableFromInline static let CanvasCaptureMediaStreamTrack: JSString = "CanvasCaptureMediaStreamTrack" @usableFromInline static let CanvasFilter: JSString = "CanvasFilter" @usableFromInline static let CanvasGradient: JSString = "CanvasGradient" @usableFromInline static let CanvasPattern: JSString = "CanvasPattern" @usableFromInline static let CanvasRenderingContext2D: JSString = "CanvasRenderingContext2D" - @usableFromInline static let CaretPosition: JSString = "CaretPosition" - @usableFromInline static let ChannelMergerNode: JSString = "ChannelMergerNode" - @usableFromInline static let ChannelSplitterNode: JSString = "ChannelSplitterNode" - @usableFromInline static let CharacterBoundsUpdateEvent: JSString = "CharacterBoundsUpdateEvent" @usableFromInline static let CharacterData: JSString = "CharacterData" - @usableFromInline static let Clipboard: JSString = "Clipboard" - @usableFromInline static let ClipboardEvent: JSString = "ClipboardEvent" - @usableFromInline static let ClipboardItem: JSString = "ClipboardItem" - @usableFromInline static let CloseEvent: JSString = "CloseEvent" - @usableFromInline static let CloseWatcher: JSString = "CloseWatcher" @usableFromInline static let Comment: JSString = "Comment" @usableFromInline static let CompositionEvent: JSString = "CompositionEvent" - @usableFromInline static let CompressionStream: JSString = "CompressionStream" - @usableFromInline static let ComputePressureObserver: JSString = "ComputePressureObserver" - @usableFromInline static let ConstantSourceNode: JSString = "ConstantSourceNode" - @usableFromInline static let ContactAddress: JSString = "ContactAddress" - @usableFromInline static let ContactsManager: JSString = "ContactsManager" - @usableFromInline static let ContentIndex: JSString = "ContentIndex" - @usableFromInline static let ConvolverNode: JSString = "ConvolverNode" - @usableFromInline static let CookieChangeEvent: JSString = "CookieChangeEvent" - @usableFromInline static let CookieStore: JSString = "CookieStore" - @usableFromInline static let CookieStoreManager: JSString = "CookieStoreManager" @usableFromInline static let CountQueuingStrategy: JSString = "CountQueuingStrategy" - @usableFromInline static let CrashReportBody: JSString = "CrashReportBody" - @usableFromInline static let Credential: JSString = "Credential" - @usableFromInline static let CredentialsContainer: JSString = "CredentialsContainer" - @usableFromInline static let CropTarget: JSString = "CropTarget" - @usableFromInline static let Crypto: JSString = "Crypto" - @usableFromInline static let CryptoKey: JSString = "CryptoKey" @usableFromInline static let CustomElementRegistry: JSString = "CustomElementRegistry" @usableFromInline static let CustomEvent: JSString = "CustomEvent" - @usableFromInline static let CustomStateSet: JSString = "CustomStateSet" @usableFromInline static let DOMException: JSString = "DOMException" @usableFromInline static let DOMImplementation: JSString = "DOMImplementation" @usableFromInline static let DOMMatrix: JSString = "DOMMatrix" @@ -198,137 +63,29 @@ import JavaScriptKit @usableFromInline static let DOMStringList: JSString = "DOMStringList" @usableFromInline static let DOMStringMap: JSString = "DOMStringMap" @usableFromInline static let DOMTokenList: JSString = "DOMTokenList" - @usableFromInline static let DataCue: JSString = "DataCue" @usableFromInline static let DataTransfer: JSString = "DataTransfer" @usableFromInline static let DataTransferItem: JSString = "DataTransferItem" @usableFromInline static let DataTransferItemList: JSString = "DataTransferItemList" - @usableFromInline static let DecompressionStream: JSString = "DecompressionStream" - @usableFromInline static let DelayNode: JSString = "DelayNode" - @usableFromInline static let DeprecationReportBody: JSString = "DeprecationReportBody" - @usableFromInline static let DeviceMotionEvent: JSString = "DeviceMotionEvent" - @usableFromInline static let DeviceMotionEventAcceleration: JSString = "DeviceMotionEventAcceleration" - @usableFromInline static let DeviceMotionEventRotationRate: JSString = "DeviceMotionEventRotationRate" - @usableFromInline static let DeviceOrientationEvent: JSString = "DeviceOrientationEvent" - @usableFromInline static let DevicePosture: JSString = "DevicePosture" - @usableFromInline static let DigitalGoodsService: JSString = "DigitalGoodsService" @usableFromInline static let Document: JSString = "Document" @usableFromInline static let DocumentFragment: JSString = "DocumentFragment" @usableFromInline static let DocumentTimeline: JSString = "DocumentTimeline" @usableFromInline static let DocumentType: JSString = "DocumentType" @usableFromInline static let DragEvent: JSString = "DragEvent" - @usableFromInline static let DynamicsCompressorNode: JSString = "DynamicsCompressorNode" - @usableFromInline static let EXT_blend_minmax: JSString = "EXT_blend_minmax" - @usableFromInline static let EXT_clip_cull_distance: JSString = "EXT_clip_cull_distance" - @usableFromInline static let EXT_color_buffer_float: JSString = "EXT_color_buffer_float" - @usableFromInline static let EXT_color_buffer_half_float: JSString = "EXT_color_buffer_half_float" - @usableFromInline static let EXT_disjoint_timer_query: JSString = "EXT_disjoint_timer_query" - @usableFromInline static let EXT_disjoint_timer_query_webgl2: JSString = "EXT_disjoint_timer_query_webgl2" - @usableFromInline static let EXT_float_blend: JSString = "EXT_float_blend" - @usableFromInline static let EXT_frag_depth: JSString = "EXT_frag_depth" - @usableFromInline static let EXT_sRGB: JSString = "EXT_sRGB" - @usableFromInline static let EXT_shader_texture_lod: JSString = "EXT_shader_texture_lod" - @usableFromInline static let EXT_texture_compression_bptc: JSString = "EXT_texture_compression_bptc" - @usableFromInline static let EXT_texture_compression_rgtc: JSString = "EXT_texture_compression_rgtc" - @usableFromInline static let EXT_texture_filter_anisotropic: JSString = "EXT_texture_filter_anisotropic" - @usableFromInline static let EXT_texture_norm16: JSString = "EXT_texture_norm16" - @usableFromInline static let EditContext: JSString = "EditContext" @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 EventCounts: JSString = "EventCounts" @usableFromInline static let EventSource: JSString = "EventSource" @usableFromInline static let EventTarget: JSString = "EventTarget" @usableFromInline static let External: JSString = "External" - @usableFromInline static let EyeDropper: JSString = "EyeDropper" - @usableFromInline static let FaceDetector: JSString = "FaceDetector" - @usableFromInline static let FederatedCredential: JSString = "FederatedCredential" @usableFromInline static let File: JSString = "File" @usableFromInline static let FileList: JSString = "FileList" @usableFromInline static let FileReader: JSString = "FileReader" - @usableFromInline static let FileSystem: JSString = "FileSystem" - @usableFromInline static let FileSystemDirectoryEntry: JSString = "FileSystemDirectoryEntry" - @usableFromInline static let FileSystemDirectoryHandle: JSString = "FileSystemDirectoryHandle" - @usableFromInline static let FileSystemDirectoryReader: JSString = "FileSystemDirectoryReader" - @usableFromInline static let FileSystemEntry: JSString = "FileSystemEntry" - @usableFromInline static let FileSystemFileEntry: JSString = "FileSystemFileEntry" - @usableFromInline static let FileSystemFileHandle: JSString = "FileSystemFileHandle" - @usableFromInline static let FileSystemHandle: JSString = "FileSystemHandle" - @usableFromInline static let FileSystemWritableFileStream: JSString = "FileSystemWritableFileStream" @usableFromInline static let FocusEvent: JSString = "FocusEvent" - @usableFromInline static let Font: JSString = "Font" - @usableFromInline static let FontFace: JSString = "FontFace" - @usableFromInline static let FontFaceFeatures: JSString = "FontFaceFeatures" - @usableFromInline static let FontFacePalette: JSString = "FontFacePalette" - @usableFromInline static let FontFacePalettes: JSString = "FontFacePalettes" - @usableFromInline static let FontFaceSet: JSString = "FontFaceSet" - @usableFromInline static let FontFaceSetLoadEvent: JSString = "FontFaceSetLoadEvent" - @usableFromInline static let FontFaceVariationAxis: JSString = "FontFaceVariationAxis" - @usableFromInline static let FontFaceVariations: JSString = "FontFaceVariations" - @usableFromInline static let FontManager: JSString = "FontManager" - @usableFromInline static let FontMetadata: JSString = "FontMetadata" - @usableFromInline static let FontMetrics: JSString = "FontMetrics" @usableFromInline static let FormData: JSString = "FormData" @usableFromInline static let FormDataEvent: JSString = "FormDataEvent" - @usableFromInline static let FragmentDirective: JSString = "FragmentDirective" - @usableFromInline static let GPU: JSString = "GPU" - @usableFromInline static let GPUAdapter: JSString = "GPUAdapter" - @usableFromInline static let GPUBindGroup: JSString = "GPUBindGroup" - @usableFromInline static let GPUBindGroupLayout: JSString = "GPUBindGroupLayout" - @usableFromInline static let GPUBuffer: JSString = "GPUBuffer" - @usableFromInline static let GPUBufferUsage: JSString = "GPUBufferUsage" - @usableFromInline static let GPUCanvasContext: JSString = "GPUCanvasContext" - @usableFromInline static let GPUColorWrite: JSString = "GPUColorWrite" - @usableFromInline static let GPUCommandBuffer: JSString = "GPUCommandBuffer" - @usableFromInline static let GPUCommandEncoder: JSString = "GPUCommandEncoder" - @usableFromInline static let GPUCompilationInfo: JSString = "GPUCompilationInfo" - @usableFromInline static let GPUCompilationMessage: JSString = "GPUCompilationMessage" - @usableFromInline static let GPUComputePassEncoder: JSString = "GPUComputePassEncoder" - @usableFromInline static let GPUComputePipeline: JSString = "GPUComputePipeline" - @usableFromInline static let GPUDevice: JSString = "GPUDevice" - @usableFromInline static let GPUDeviceLostInfo: JSString = "GPUDeviceLostInfo" - @usableFromInline static let GPUExternalTexture: JSString = "GPUExternalTexture" - @usableFromInline static let GPUMapMode: JSString = "GPUMapMode" - @usableFromInline static let GPUOutOfMemoryError: JSString = "GPUOutOfMemoryError" - @usableFromInline static let GPUPipelineLayout: JSString = "GPUPipelineLayout" - @usableFromInline static let GPUQuerySet: JSString = "GPUQuerySet" - @usableFromInline static let GPUQueue: JSString = "GPUQueue" - @usableFromInline static let GPURenderBundle: JSString = "GPURenderBundle" - @usableFromInline static let GPURenderBundleEncoder: JSString = "GPURenderBundleEncoder" - @usableFromInline static let GPURenderPassEncoder: JSString = "GPURenderPassEncoder" - @usableFromInline static let GPURenderPipeline: JSString = "GPURenderPipeline" - @usableFromInline static let GPUSampler: JSString = "GPUSampler" - @usableFromInline static let GPUShaderModule: JSString = "GPUShaderModule" - @usableFromInline static let GPUShaderStage: JSString = "GPUShaderStage" - @usableFromInline static let GPUSupportedFeatures: JSString = "GPUSupportedFeatures" - @usableFromInline static let GPUSupportedLimits: JSString = "GPUSupportedLimits" - @usableFromInline static let GPUTexture: JSString = "GPUTexture" - @usableFromInline static let GPUTextureUsage: JSString = "GPUTextureUsage" - @usableFromInline static let GPUTextureView: JSString = "GPUTextureView" - @usableFromInline static let GPUUncapturedErrorEvent: JSString = "GPUUncapturedErrorEvent" - @usableFromInline static let GPUValidationError: JSString = "GPUValidationError" - @usableFromInline static let GainNode: JSString = "GainNode" - @usableFromInline static let Gamepad: JSString = "Gamepad" - @usableFromInline static let GamepadButton: JSString = "GamepadButton" - @usableFromInline static let GamepadEvent: JSString = "GamepadEvent" - @usableFromInline static let GamepadHapticActuator: JSString = "GamepadHapticActuator" - @usableFromInline static let GamepadPose: JSString = "GamepadPose" - @usableFromInline static let GamepadTouch: JSString = "GamepadTouch" - @usableFromInline static let Geolocation: JSString = "Geolocation" - @usableFromInline static let GeolocationCoordinates: JSString = "GeolocationCoordinates" - @usableFromInline static let GeolocationPosition: JSString = "GeolocationPosition" - @usableFromInline static let GeolocationPositionError: JSString = "GeolocationPositionError" - @usableFromInline static let GeolocationSensor: JSString = "GeolocationSensor" - @usableFromInline static let Global: JSString = "Global" - @usableFromInline static let GravitySensor: JSString = "GravitySensor" - @usableFromInline static let GroupEffect: JSString = "GroupEffect" - @usableFromInline static let Gyroscope: JSString = "Gyroscope" - @usableFromInline static let HID: JSString = "HID" - @usableFromInline static let HIDConnectionEvent: JSString = "HIDConnectionEvent" - @usableFromInline static let HIDDevice: JSString = "HIDDevice" - @usableFromInline static let HIDInputReportEvent: JSString = "HIDInputReportEvent" @usableFromInline static let HTMLAllCollection: JSString = "HTMLAllCollection" @usableFromInline static let HTMLAnchorElement: JSString = "HTMLAnchorElement" @usableFromInline static let HTMLAreaElement: JSString = "HTMLAreaElement" @@ -381,7 +138,6 @@ import JavaScriptKit @usableFromInline static let HTMLParagraphElement: JSString = "HTMLParagraphElement" @usableFromInline static let HTMLParamElement: JSString = "HTMLParamElement" @usableFromInline static let HTMLPictureElement: JSString = "HTMLPictureElement" - @usableFromInline static let HTMLPortalElement: JSString = "HTMLPortalElement" @usableFromInline static let HTMLPreElement: JSString = "HTMLPreElement" @usableFromInline static let HTMLProgressElement: JSString = "HTMLProgressElement" @usableFromInline static let HTMLQuoteElement: JSString = "HTMLQuoteElement" @@ -407,228 +163,57 @@ import JavaScriptKit @usableFromInline static let HTMLVideoElement: JSString = "HTMLVideoElement" @usableFromInline static let HashChangeEvent: JSString = "HashChangeEvent" @usableFromInline static let Headers: JSString = "Headers" - @usableFromInline static let Highlight: JSString = "Highlight" - @usableFromInline static let HighlightRegistry: JSString = "HighlightRegistry" @usableFromInline static let History: JSString = "History" - @usableFromInline static let Hz: JSString = "Hz" - @usableFromInline static let IDBCursor: JSString = "IDBCursor" - @usableFromInline static let IDBCursorWithValue: JSString = "IDBCursorWithValue" - @usableFromInline static let IDBDatabase: JSString = "IDBDatabase" - @usableFromInline static let IDBFactory: JSString = "IDBFactory" - @usableFromInline static let IDBIndex: JSString = "IDBIndex" - @usableFromInline static let IDBKeyRange: JSString = "IDBKeyRange" - @usableFromInline static let IDBObjectStore: JSString = "IDBObjectStore" - @usableFromInline static let IDBOpenDBRequest: JSString = "IDBOpenDBRequest" - @usableFromInline static let IDBRequest: JSString = "IDBRequest" - @usableFromInline static let IDBTransaction: JSString = "IDBTransaction" - @usableFromInline static let IDBVersionChangeEvent: JSString = "IDBVersionChangeEvent" - @usableFromInline static let IIRFilterNode: JSString = "IIRFilterNode" - @usableFromInline static let IdleDeadline: JSString = "IdleDeadline" - @usableFromInline static let IdleDetector: JSString = "IdleDetector" @usableFromInline static let ImageBitmap: JSString = "ImageBitmap" @usableFromInline static let ImageBitmapRenderingContext: JSString = "ImageBitmapRenderingContext" - @usableFromInline static let ImageCapture: JSString = "ImageCapture" @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 Ink: JSString = "Ink" - @usableFromInline static let InkPresenter: JSString = "InkPresenter" - @usableFromInline static let InputDeviceCapabilities: JSString = "InputDeviceCapabilities" @usableFromInline static let InputDeviceInfo: JSString = "InputDeviceInfo" @usableFromInline static let InputEvent: JSString = "InputEvent" - @usableFromInline static let Instance: JSString = "Instance" - @usableFromInline static let InteractionCounts: JSString = "InteractionCounts" - @usableFromInline static let IntersectionObserver: JSString = "IntersectionObserver" - @usableFromInline static let IntersectionObserverEntry: JSString = "IntersectionObserverEntry" - @usableFromInline static let InterventionReportBody: JSString = "InterventionReportBody" @usableFromInline static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" - @usableFromInline static let KHR_parallel_shader_compile: JSString = "KHR_parallel_shader_compile" - @usableFromInline static let Keyboard: JSString = "Keyboard" @usableFromInline static let KeyboardEvent: JSString = "KeyboardEvent" - @usableFromInline static let KeyboardLayoutMap: JSString = "KeyboardLayoutMap" @usableFromInline static let KeyframeEffect: JSString = "KeyframeEffect" - @usableFromInline static let LargestContentfulPaint: JSString = "LargestContentfulPaint" - @usableFromInline static let LayoutShift: JSString = "LayoutShift" - @usableFromInline static let LayoutShiftAttribution: JSString = "LayoutShiftAttribution" - @usableFromInline static let LinearAccelerationSensor: JSString = "LinearAccelerationSensor" @usableFromInline static let Location: JSString = "Location" - @usableFromInline static let Lock: JSString = "Lock" - @usableFromInline static let LockManager: JSString = "LockManager" - @usableFromInline static let MIDIAccess: JSString = "MIDIAccess" - @usableFromInline static let MIDIConnectionEvent: JSString = "MIDIConnectionEvent" - @usableFromInline static let MIDIInput: JSString = "MIDIInput" - @usableFromInline static let MIDIInputMap: JSString = "MIDIInputMap" - @usableFromInline static let MIDIMessageEvent: JSString = "MIDIMessageEvent" - @usableFromInline static let MIDIOutput: JSString = "MIDIOutput" - @usableFromInline static let MIDIOutputMap: JSString = "MIDIOutputMap" - @usableFromInline static let MIDIPort: JSString = "MIDIPort" - @usableFromInline static let ML: JSString = "ML" - @usableFromInline static let MLContext: JSString = "MLContext" - @usableFromInline static let MLGraph: JSString = "MLGraph" - @usableFromInline static let MLGraphBuilder: JSString = "MLGraphBuilder" - @usableFromInline static let MLOperand: JSString = "MLOperand" - @usableFromInline static let MLOperator: JSString = "MLOperator" - @usableFromInline static let Magnetometer: JSString = "Magnetometer" - @usableFromInline static let MathMLElement: JSString = "MathMLElement" - @usableFromInline static let MediaCapabilities: JSString = "MediaCapabilities" @usableFromInline static let MediaDeviceInfo: JSString = "MediaDeviceInfo" @usableFromInline static let MediaDevices: JSString = "MediaDevices" - @usableFromInline static let MediaElementAudioSourceNode: JSString = "MediaElementAudioSourceNode" - @usableFromInline static let MediaEncryptedEvent: JSString = "MediaEncryptedEvent" @usableFromInline static let MediaError: JSString = "MediaError" - @usableFromInline static let MediaKeyMessageEvent: JSString = "MediaKeyMessageEvent" - @usableFromInline static let MediaKeySession: JSString = "MediaKeySession" - @usableFromInline static let MediaKeyStatusMap: JSString = "MediaKeyStatusMap" - @usableFromInline static let MediaKeySystemAccess: JSString = "MediaKeySystemAccess" - @usableFromInline static let MediaKeys: JSString = "MediaKeys" @usableFromInline static let MediaList: JSString = "MediaList" - @usableFromInline static let MediaMetadata: JSString = "MediaMetadata" - @usableFromInline static let MediaQueryList: JSString = "MediaQueryList" - @usableFromInline static let MediaQueryListEvent: JSString = "MediaQueryListEvent" @usableFromInline static let MediaRecorder: JSString = "MediaRecorder" @usableFromInline static let MediaRecorderErrorEvent: JSString = "MediaRecorderErrorEvent" - @usableFromInline static let MediaSession: JSString = "MediaSession" @usableFromInline static let MediaSource: JSString = "MediaSource" @usableFromInline static let MediaStream: JSString = "MediaStream" - @usableFromInline static let MediaStreamAudioDestinationNode: JSString = "MediaStreamAudioDestinationNode" - @usableFromInline static let MediaStreamAudioSourceNode: JSString = "MediaStreamAudioSourceNode" @usableFromInline static let MediaStreamTrack: JSString = "MediaStreamTrack" - @usableFromInline static let MediaStreamTrackAudioSourceNode: JSString = "MediaStreamTrackAudioSourceNode" @usableFromInline static let MediaStreamTrackEvent: JSString = "MediaStreamTrackEvent" - @usableFromInline static let Memory: JSString = "Memory" @usableFromInline static let MessageChannel: JSString = "MessageChannel" @usableFromInline static let MessageEvent: JSString = "MessageEvent" @usableFromInline static let MessagePort: JSString = "MessagePort" @usableFromInline static let MimeType: JSString = "MimeType" @usableFromInline static let MimeTypeArray: JSString = "MimeTypeArray" - @usableFromInline static let Module: JSString = "Module" @usableFromInline static let MouseEvent: JSString = "MouseEvent" @usableFromInline static let MutationEvent: JSString = "MutationEvent" @usableFromInline static let MutationObserver: JSString = "MutationObserver" @usableFromInline static let MutationRecord: JSString = "MutationRecord" - @usableFromInline static let NDEFMessage: JSString = "NDEFMessage" - @usableFromInline static let NDEFReader: JSString = "NDEFReader" - @usableFromInline static let NDEFReadingEvent: JSString = "NDEFReadingEvent" - @usableFromInline static let NDEFRecord: JSString = "NDEFRecord" - @usableFromInline static let NamedFlow: JSString = "NamedFlow" - @usableFromInline static let NamedFlowMap: JSString = "NamedFlowMap" @usableFromInline static let NamedNodeMap: JSString = "NamedNodeMap" - @usableFromInline static let NavigateEvent: JSString = "NavigateEvent" - @usableFromInline static let Navigation: JSString = "Navigation" - @usableFromInline static let NavigationCurrentEntryChangeEvent: JSString = "NavigationCurrentEntryChangeEvent" - @usableFromInline static let NavigationDestination: JSString = "NavigationDestination" - @usableFromInline static let NavigationEvent: JSString = "NavigationEvent" - @usableFromInline static let NavigationHistoryEntry: JSString = "NavigationHistoryEntry" @usableFromInline static let NavigationPreloadManager: JSString = "NavigationPreloadManager" - @usableFromInline static let NavigationTransition: JSString = "NavigationTransition" @usableFromInline static let Navigator: JSString = "Navigator" - @usableFromInline static let NavigatorUAData: JSString = "NavigatorUAData" - @usableFromInline static let NetworkInformation: JSString = "NetworkInformation" @usableFromInline static let Node: JSString = "Node" @usableFromInline static let NodeIterator: JSString = "NodeIterator" @usableFromInline static let NodeList: JSString = "NodeList" - @usableFromInline static let Notification: JSString = "Notification" - @usableFromInline static let OES_draw_buffers_indexed: JSString = "OES_draw_buffers_indexed" - @usableFromInline static let OES_element_index_uint: JSString = "OES_element_index_uint" - @usableFromInline static let OES_fbo_render_mipmap: JSString = "OES_fbo_render_mipmap" - @usableFromInline static let OES_standard_derivatives: JSString = "OES_standard_derivatives" - @usableFromInline static let OES_texture_float: JSString = "OES_texture_float" - @usableFromInline static let OES_texture_float_linear: JSString = "OES_texture_float_linear" - @usableFromInline static let OES_texture_half_float: JSString = "OES_texture_half_float" - @usableFromInline static let OES_texture_half_float_linear: JSString = "OES_texture_half_float_linear" - @usableFromInline static let OES_vertex_array_object: JSString = "OES_vertex_array_object" - @usableFromInline static let OTPCredential: JSString = "OTPCredential" - @usableFromInline static let OVR_multiview2: JSString = "OVR_multiview2" @usableFromInline static let Object: JSString = "Object" - @usableFromInline static let OfflineAudioCompletionEvent: JSString = "OfflineAudioCompletionEvent" - @usableFromInline static let OfflineAudioContext: JSString = "OfflineAudioContext" @usableFromInline static let OffscreenCanvas: JSString = "OffscreenCanvas" @usableFromInline static let OffscreenCanvasRenderingContext2D: JSString = "OffscreenCanvasRenderingContext2D" - @usableFromInline static let OrientationSensor: JSString = "OrientationSensor" - @usableFromInline static let OscillatorNode: JSString = "OscillatorNode" @usableFromInline static let OverconstrainedError: JSString = "OverconstrainedError" @usableFromInline static let PageTransitionEvent: JSString = "PageTransitionEvent" - @usableFromInline static let PannerNode: JSString = "PannerNode" - @usableFromInline static let PasswordCredential: JSString = "PasswordCredential" @usableFromInline static let Path2D: JSString = "Path2D" - @usableFromInline static let PaymentInstruments: JSString = "PaymentInstruments" - @usableFromInline static let PaymentManager: JSString = "PaymentManager" - @usableFromInline static let PaymentMethodChangeEvent: JSString = "PaymentMethodChangeEvent" - @usableFromInline static let PaymentRequest: JSString = "PaymentRequest" - @usableFromInline static let PaymentRequestUpdateEvent: JSString = "PaymentRequestUpdateEvent" - @usableFromInline static let PaymentResponse: JSString = "PaymentResponse" @usableFromInline static let Performance: JSString = "Performance" - @usableFromInline static let PerformanceElementTiming: JSString = "PerformanceElementTiming" - @usableFromInline static let PerformanceEntry: JSString = "PerformanceEntry" - @usableFromInline static let PerformanceEventTiming: JSString = "PerformanceEventTiming" - @usableFromInline static let PerformanceLongTaskTiming: JSString = "PerformanceLongTaskTiming" - @usableFromInline static let PerformanceMark: JSString = "PerformanceMark" - @usableFromInline static let PerformanceMeasure: JSString = "PerformanceMeasure" - @usableFromInline static let PerformanceNavigation: JSString = "PerformanceNavigation" - @usableFromInline static let PerformanceNavigationTiming: JSString = "PerformanceNavigationTiming" - @usableFromInline static let PerformanceObserver: JSString = "PerformanceObserver" - @usableFromInline static let PerformanceObserverEntryList: JSString = "PerformanceObserverEntryList" - @usableFromInline static let PerformancePaintTiming: JSString = "PerformancePaintTiming" - @usableFromInline static let PerformanceResourceTiming: JSString = "PerformanceResourceTiming" - @usableFromInline static let PerformanceServerTiming: JSString = "PerformanceServerTiming" - @usableFromInline static let PerformanceTiming: JSString = "PerformanceTiming" - @usableFromInline static let PeriodicSyncManager: JSString = "PeriodicSyncManager" - @usableFromInline static let PeriodicWave: JSString = "PeriodicWave" - @usableFromInline static let PermissionStatus: JSString = "PermissionStatus" - @usableFromInline static let Permissions: JSString = "Permissions" - @usableFromInline static let PermissionsPolicy: JSString = "PermissionsPolicy" - @usableFromInline static let PermissionsPolicyViolationReportBody: JSString = "PermissionsPolicyViolationReportBody" - @usableFromInline static let PictureInPictureEvent: JSString = "PictureInPictureEvent" - @usableFromInline static let PictureInPictureWindow: JSString = "PictureInPictureWindow" @usableFromInline static let Plugin: JSString = "Plugin" @usableFromInline static let PluginArray: JSString = "PluginArray" - @usableFromInline static let PointerEvent: JSString = "PointerEvent" @usableFromInline static let PopStateEvent: JSString = "PopStateEvent" - @usableFromInline static let PortalActivateEvent: JSString = "PortalActivateEvent" - @usableFromInline static let PortalHost: JSString = "PortalHost" - @usableFromInline static let Presentation: JSString = "Presentation" - @usableFromInline static let PresentationAvailability: JSString = "PresentationAvailability" - @usableFromInline static let PresentationConnection: JSString = "PresentationConnection" - @usableFromInline static let PresentationConnectionAvailableEvent: JSString = "PresentationConnectionAvailableEvent" - @usableFromInline static let PresentationConnectionCloseEvent: JSString = "PresentationConnectionCloseEvent" - @usableFromInline static let PresentationConnectionList: JSString = "PresentationConnectionList" - @usableFromInline static let PresentationReceiver: JSString = "PresentationReceiver" - @usableFromInline static let PresentationRequest: JSString = "PresentationRequest" @usableFromInline static let ProcessingInstruction: JSString = "ProcessingInstruction" - @usableFromInline static let Profiler: JSString = "Profiler" @usableFromInline static let ProgressEvent: JSString = "ProgressEvent" @usableFromInline static let PromiseRejectionEvent: JSString = "PromiseRejectionEvent" - @usableFromInline static let ProximitySensor: JSString = "ProximitySensor" - @usableFromInline static let PublicKeyCredential: JSString = "PublicKeyCredential" - @usableFromInline static let PushManager: JSString = "PushManager" - @usableFromInline static let PushSubscription: JSString = "PushSubscription" - @usableFromInline static let PushSubscriptionOptions: JSString = "PushSubscriptionOptions" - @usableFromInline static let Q: JSString = "Q" - @usableFromInline static let RTCCertificate: JSString = "RTCCertificate" - @usableFromInline static let RTCDTMFSender: JSString = "RTCDTMFSender" - @usableFromInline static let RTCDTMFToneChangeEvent: JSString = "RTCDTMFToneChangeEvent" - @usableFromInline static let RTCDataChannel: JSString = "RTCDataChannel" - @usableFromInline static let RTCDataChannelEvent: JSString = "RTCDataChannelEvent" - @usableFromInline static let RTCDtlsTransport: JSString = "RTCDtlsTransport" - @usableFromInline static let RTCEncodedAudioFrame: JSString = "RTCEncodedAudioFrame" - @usableFromInline static let RTCEncodedVideoFrame: JSString = "RTCEncodedVideoFrame" - @usableFromInline static let RTCError: JSString = "RTCError" - @usableFromInline static let RTCErrorEvent: JSString = "RTCErrorEvent" - @usableFromInline static let RTCIceCandidate: JSString = "RTCIceCandidate" - @usableFromInline static let RTCIceTransport: JSString = "RTCIceTransport" - @usableFromInline static let RTCIdentityAssertion: JSString = "RTCIdentityAssertion" - @usableFromInline static let RTCPeerConnection: JSString = "RTCPeerConnection" - @usableFromInline static let RTCPeerConnectionIceErrorEvent: JSString = "RTCPeerConnectionIceErrorEvent" - @usableFromInline static let RTCPeerConnectionIceEvent: JSString = "RTCPeerConnectionIceEvent" - @usableFromInline static let RTCRtpReceiver: JSString = "RTCRtpReceiver" - @usableFromInline static let RTCRtpScriptTransform: JSString = "RTCRtpScriptTransform" - @usableFromInline static let RTCRtpSender: JSString = "RTCRtpSender" - @usableFromInline static let RTCRtpTransceiver: JSString = "RTCRtpTransceiver" - @usableFromInline static let RTCSctpTransport: JSString = "RTCSctpTransport" - @usableFromInline static let RTCSessionDescription: JSString = "RTCSessionDescription" - @usableFromInline static let RTCStatsReport: JSString = "RTCStatsReport" - @usableFromInline static let RTCTrackEvent: JSString = "RTCTrackEvent" @usableFromInline static let RadioNodeList: JSString = "RadioNodeList" @usableFromInline static let Range: JSString = "Range" @usableFromInline static let ReadableByteStreamController: JSString = "ReadableByteStreamController" @@ -637,23 +222,10 @@ import JavaScriptKit @usableFromInline static let ReadableStreamBYOBRequest: JSString = "ReadableStreamBYOBRequest" @usableFromInline static let ReadableStreamDefaultController: JSString = "ReadableStreamDefaultController" @usableFromInline static let ReadableStreamDefaultReader: JSString = "ReadableStreamDefaultReader" - @usableFromInline static let RelativeOrientationSensor: JSString = "RelativeOrientationSensor" - @usableFromInline static let RemotePlayback: JSString = "RemotePlayback" - @usableFromInline static let Report: JSString = "Report" - @usableFromInline static let ReportBody: JSString = "ReportBody" - @usableFromInline static let ReportingObserver: JSString = "ReportingObserver" @usableFromInline static let Request: JSString = "Request" - @usableFromInline static let ResizeObserver: JSString = "ResizeObserver" - @usableFromInline static let ResizeObserverEntry: JSString = "ResizeObserverEntry" - @usableFromInline static let ResizeObserverSize: JSString = "ResizeObserverSize" @usableFromInline static let Response: JSString = "Response" - @usableFromInline static let SFrameTransform: JSString = "SFrameTransform" - @usableFromInline static let SFrameTransformErrorEvent: JSString = "SFrameTransformErrorEvent" @usableFromInline static let SVGAElement: JSString = "SVGAElement" @usableFromInline static let SVGAngle: JSString = "SVGAngle" - @usableFromInline static let SVGAnimateElement: JSString = "SVGAnimateElement" - @usableFromInline static let SVGAnimateMotionElement: JSString = "SVGAnimateMotionElement" - @usableFromInline static let SVGAnimateTransformElement: JSString = "SVGAnimateTransformElement" @usableFromInline static let SVGAnimatedAngle: JSString = "SVGAnimatedAngle" @usableFromInline static let SVGAnimatedBoolean: JSString = "SVGAnimatedBoolean" @usableFromInline static let SVGAnimatedEnumeration: JSString = "SVGAnimatedEnumeration" @@ -666,41 +238,11 @@ import JavaScriptKit @usableFromInline static let SVGAnimatedRect: JSString = "SVGAnimatedRect" @usableFromInline static let SVGAnimatedString: JSString = "SVGAnimatedString" @usableFromInline static let SVGAnimatedTransformList: JSString = "SVGAnimatedTransformList" - @usableFromInline static let SVGAnimationElement: JSString = "SVGAnimationElement" @usableFromInline static let SVGCircleElement: JSString = "SVGCircleElement" - @usableFromInline static let SVGClipPathElement: JSString = "SVGClipPathElement" - @usableFromInline static let SVGComponentTransferFunctionElement: JSString = "SVGComponentTransferFunctionElement" @usableFromInline static let SVGDefsElement: JSString = "SVGDefsElement" @usableFromInline static let SVGDescElement: JSString = "SVGDescElement" - @usableFromInline static let SVGDiscardElement: JSString = "SVGDiscardElement" @usableFromInline static let SVGElement: JSString = "SVGElement" @usableFromInline static let SVGEllipseElement: JSString = "SVGEllipseElement" - @usableFromInline static let SVGFEBlendElement: JSString = "SVGFEBlendElement" - @usableFromInline static let SVGFEColorMatrixElement: JSString = "SVGFEColorMatrixElement" - @usableFromInline static let SVGFEComponentTransferElement: JSString = "SVGFEComponentTransferElement" - @usableFromInline static let SVGFECompositeElement: JSString = "SVGFECompositeElement" - @usableFromInline static let SVGFEConvolveMatrixElement: JSString = "SVGFEConvolveMatrixElement" - @usableFromInline static let SVGFEDiffuseLightingElement: JSString = "SVGFEDiffuseLightingElement" - @usableFromInline static let SVGFEDisplacementMapElement: JSString = "SVGFEDisplacementMapElement" - @usableFromInline static let SVGFEDistantLightElement: JSString = "SVGFEDistantLightElement" - @usableFromInline static let SVGFEDropShadowElement: JSString = "SVGFEDropShadowElement" - @usableFromInline static let SVGFEFloodElement: JSString = "SVGFEFloodElement" - @usableFromInline static let SVGFEFuncAElement: JSString = "SVGFEFuncAElement" - @usableFromInline static let SVGFEFuncBElement: JSString = "SVGFEFuncBElement" - @usableFromInline static let SVGFEFuncGElement: JSString = "SVGFEFuncGElement" - @usableFromInline static let SVGFEFuncRElement: JSString = "SVGFEFuncRElement" - @usableFromInline static let SVGFEGaussianBlurElement: JSString = "SVGFEGaussianBlurElement" - @usableFromInline static let SVGFEImageElement: JSString = "SVGFEImageElement" - @usableFromInline static let SVGFEMergeElement: JSString = "SVGFEMergeElement" - @usableFromInline static let SVGFEMergeNodeElement: JSString = "SVGFEMergeNodeElement" - @usableFromInline static let SVGFEMorphologyElement: JSString = "SVGFEMorphologyElement" - @usableFromInline static let SVGFEOffsetElement: JSString = "SVGFEOffsetElement" - @usableFromInline static let SVGFEPointLightElement: JSString = "SVGFEPointLightElement" - @usableFromInline static let SVGFESpecularLightingElement: JSString = "SVGFESpecularLightingElement" - @usableFromInline static let SVGFESpotLightElement: JSString = "SVGFESpotLightElement" - @usableFromInline static let SVGFETileElement: JSString = "SVGFETileElement" - @usableFromInline static let SVGFETurbulenceElement: JSString = "SVGFETurbulenceElement" - @usableFromInline static let SVGFilterElement: JSString = "SVGFilterElement" @usableFromInline static let SVGForeignObjectElement: JSString = "SVGForeignObjectElement" @usableFromInline static let SVGGElement: JSString = "SVGGElement" @usableFromInline static let SVGGeometryElement: JSString = "SVGGeometryElement" @@ -711,9 +253,7 @@ import JavaScriptKit @usableFromInline static let SVGLengthList: JSString = "SVGLengthList" @usableFromInline static let SVGLineElement: JSString = "SVGLineElement" @usableFromInline static let SVGLinearGradientElement: JSString = "SVGLinearGradientElement" - @usableFromInline static let SVGMPathElement: JSString = "SVGMPathElement" @usableFromInline static let SVGMarkerElement: JSString = "SVGMarkerElement" - @usableFromInline static let SVGMaskElement: JSString = "SVGMaskElement" @usableFromInline static let SVGMetadataElement: JSString = "SVGMetadataElement" @usableFromInline static let SVGNumber: JSString = "SVGNumber" @usableFromInline static let SVGNumberList: JSString = "SVGNumberList" @@ -727,7 +267,6 @@ import JavaScriptKit @usableFromInline static let SVGRectElement: JSString = "SVGRectElement" @usableFromInline static let SVGSVGElement: JSString = "SVGSVGElement" @usableFromInline static let SVGScriptElement: JSString = "SVGScriptElement" - @usableFromInline static let SVGSetElement: JSString = "SVGSetElement" @usableFromInline static let SVGStopElement: JSString = "SVGStopElement" @usableFromInline static let SVGStringList: JSString = "SVGStringList" @usableFromInline static let SVGStyleElement: JSString = "SVGStyleElement" @@ -745,21 +284,6 @@ import JavaScriptKit @usableFromInline static let SVGUseElement: JSString = "SVGUseElement" @usableFromInline static let SVGUseElementShadowRoot: JSString = "SVGUseElementShadowRoot" @usableFromInline static let SVGViewElement: JSString = "SVGViewElement" - @usableFromInline static let Sanitizer: JSString = "Sanitizer" - @usableFromInline static let Scheduler: JSString = "Scheduler" - @usableFromInline static let Scheduling: JSString = "Scheduling" - @usableFromInline static let Screen: JSString = "Screen" - @usableFromInline static let ScreenOrientation: JSString = "ScreenOrientation" - @usableFromInline static let ScriptProcessorNode: JSString = "ScriptProcessorNode" - @usableFromInline static let ScriptingPolicyReportBody: JSString = "ScriptingPolicyReportBody" - @usableFromInline static let ScrollTimeline: JSString = "ScrollTimeline" - @usableFromInline static let SecurityPolicyViolationEvent: JSString = "SecurityPolicyViolationEvent" - @usableFromInline static let Selection: JSString = "Selection" - @usableFromInline static let Sensor: JSString = "Sensor" - @usableFromInline static let SensorErrorEvent: JSString = "SensorErrorEvent" - @usableFromInline static let SequenceEffect: JSString = "SequenceEffect" - @usableFromInline static let Serial: JSString = "Serial" - @usableFromInline static let SerialPort: JSString = "SerialPort" @usableFromInline static let ServiceWorker: JSString = "ServiceWorker" @usableFromInline static let ServiceWorkerContainer: JSString = "ServiceWorkerContainer" @usableFromInline static let ServiceWorkerRegistration: JSString = "ServiceWorkerRegistration" @@ -768,150 +292,37 @@ import JavaScriptKit @usableFromInline static let SharedWorker: JSString = "SharedWorker" @usableFromInline static let SourceBuffer: JSString = "SourceBuffer" @usableFromInline static let SourceBufferList: JSString = "SourceBufferList" - @usableFromInline static let SpeechGrammar: JSString = "SpeechGrammar" - @usableFromInline static let SpeechGrammarList: JSString = "SpeechGrammarList" - @usableFromInline static let SpeechRecognition: JSString = "SpeechRecognition" - @usableFromInline static let SpeechRecognitionAlternative: JSString = "SpeechRecognitionAlternative" - @usableFromInline static let SpeechRecognitionErrorEvent: JSString = "SpeechRecognitionErrorEvent" - @usableFromInline static let SpeechRecognitionEvent: JSString = "SpeechRecognitionEvent" - @usableFromInline static let SpeechRecognitionResult: JSString = "SpeechRecognitionResult" - @usableFromInline static let SpeechRecognitionResultList: JSString = "SpeechRecognitionResultList" - @usableFromInline static let SpeechSynthesis: JSString = "SpeechSynthesis" - @usableFromInline static let SpeechSynthesisErrorEvent: JSString = "SpeechSynthesisErrorEvent" - @usableFromInline static let SpeechSynthesisEvent: JSString = "SpeechSynthesisEvent" - @usableFromInline static let SpeechSynthesisUtterance: JSString = "SpeechSynthesisUtterance" - @usableFromInline static let SpeechSynthesisVoice: JSString = "SpeechSynthesisVoice" @usableFromInline static let StaticRange: JSString = "StaticRange" - @usableFromInline static let StereoPannerNode: JSString = "StereoPannerNode" @usableFromInline static let Storage: JSString = "Storage" @usableFromInline static let StorageEvent: JSString = "StorageEvent" - @usableFromInline static let StorageManager: JSString = "StorageManager" - @usableFromInline static let StylePropertyMap: JSString = "StylePropertyMap" - @usableFromInline static let StylePropertyMapReadOnly: JSString = "StylePropertyMapReadOnly" @usableFromInline static let StyleSheet: JSString = "StyleSheet" @usableFromInline static let StyleSheetList: JSString = "StyleSheetList" @usableFromInline static let SubmitEvent: JSString = "SubmitEvent" - @usableFromInline static let SubtleCrypto: JSString = "SubtleCrypto" - @usableFromInline static let SyncManager: JSString = "SyncManager" - @usableFromInline static let Table: JSString = "Table" - @usableFromInline static let TaskAttributionTiming: JSString = "TaskAttributionTiming" - @usableFromInline static let TaskController: JSString = "TaskController" - @usableFromInline static let TaskPriorityChangeEvent: JSString = "TaskPriorityChangeEvent" - @usableFromInline static let TaskSignal: JSString = "TaskSignal" - @usableFromInline static let TestUtils: JSString = "TestUtils" @usableFromInline static let Text: JSString = "Text" - @usableFromInline static let TextDecoder: JSString = "TextDecoder" - @usableFromInline static let TextDecoderStream: JSString = "TextDecoderStream" - @usableFromInline static let TextDetector: JSString = "TextDetector" - @usableFromInline static let TextEncoder: JSString = "TextEncoder" - @usableFromInline static let TextEncoderStream: JSString = "TextEncoderStream" - @usableFromInline static let TextFormat: JSString = "TextFormat" - @usableFromInline static let TextFormatUpdateEvent: JSString = "TextFormatUpdateEvent" @usableFromInline static let TextMetrics: JSString = "TextMetrics" @usableFromInline static let TextTrack: JSString = "TextTrack" @usableFromInline static let TextTrackCue: JSString = "TextTrackCue" @usableFromInline static let TextTrackCueList: JSString = "TextTrackCueList" @usableFromInline static let TextTrackList: JSString = "TextTrackList" - @usableFromInline static let TextUpdateEvent: JSString = "TextUpdateEvent" - @usableFromInline static let TimeEvent: JSString = "TimeEvent" @usableFromInline static let TimeRanges: JSString = "TimeRanges" - @usableFromInline static let Touch: JSString = "Touch" - @usableFromInline static let TouchEvent: JSString = "TouchEvent" - @usableFromInline static let TouchList: JSString = "TouchList" @usableFromInline static let TrackEvent: JSString = "TrackEvent" @usableFromInline static let TransformStream: JSString = "TransformStream" @usableFromInline static let TransformStreamDefaultController: JSString = "TransformStreamDefaultController" - @usableFromInline static let TransitionEvent: JSString = "TransitionEvent" @usableFromInline static let TreeWalker: JSString = "TreeWalker" - @usableFromInline static let TrustedHTML: JSString = "TrustedHTML" - @usableFromInline static let TrustedScript: JSString = "TrustedScript" - @usableFromInline static let TrustedScriptURL: JSString = "TrustedScriptURL" - @usableFromInline static let TrustedTypePolicy: JSString = "TrustedTypePolicy" - @usableFromInline static let TrustedTypePolicyFactory: JSString = "TrustedTypePolicyFactory" @usableFromInline static let UIEvent: JSString = "UIEvent" @usableFromInline static let URL: JSString = "URL" - @usableFromInline static let URLPattern: JSString = "URLPattern" @usableFromInline static let URLSearchParams: JSString = "URLSearchParams" - @usableFromInline static let USB: JSString = "USB" - @usableFromInline static let USBAlternateInterface: JSString = "USBAlternateInterface" - @usableFromInline static let USBConfiguration: JSString = "USBConfiguration" - @usableFromInline static let USBConnectionEvent: JSString = "USBConnectionEvent" - @usableFromInline static let USBDevice: JSString = "USBDevice" - @usableFromInline static let USBEndpoint: JSString = "USBEndpoint" - @usableFromInline static let USBInTransferResult: JSString = "USBInTransferResult" - @usableFromInline static let USBInterface: JSString = "USBInterface" - @usableFromInline static let USBIsochronousInTransferPacket: JSString = "USBIsochronousInTransferPacket" - @usableFromInline static let USBIsochronousInTransferResult: JSString = "USBIsochronousInTransferResult" - @usableFromInline static let USBIsochronousOutTransferPacket: JSString = "USBIsochronousOutTransferPacket" - @usableFromInline static let USBIsochronousOutTransferResult: JSString = "USBIsochronousOutTransferResult" - @usableFromInline static let USBOutTransferResult: JSString = "USBOutTransferResult" - @usableFromInline static let USBPermissionResult: JSString = "USBPermissionResult" - @usableFromInline static let UncalibratedMagnetometer: JSString = "UncalibratedMagnetometer" - @usableFromInline static let VTTCue: JSString = "VTTCue" - @usableFromInline static let VTTRegion: JSString = "VTTRegion" @usableFromInline static let ValidityState: JSString = "ValidityState" - @usableFromInline static let ValueEvent: JSString = "ValueEvent" @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 VideoPlaybackQuality: JSString = "VideoPlaybackQuality" @usableFromInline static let VideoTrack: JSString = "VideoTrack" @usableFromInline static let VideoTrackList: JSString = "VideoTrackList" - @usableFromInline static let VirtualKeyboard: JSString = "VirtualKeyboard" - @usableFromInline static let VisualViewport: JSString = "VisualViewport" - @usableFromInline static let WEBGL_blend_equation_advanced_coherent: JSString = "WEBGL_blend_equation_advanced_coherent" - @usableFromInline static let WEBGL_color_buffer_float: JSString = "WEBGL_color_buffer_float" - @usableFromInline static let WEBGL_compressed_texture_astc: JSString = "WEBGL_compressed_texture_astc" - @usableFromInline static let WEBGL_compressed_texture_etc: JSString = "WEBGL_compressed_texture_etc" - @usableFromInline static let WEBGL_compressed_texture_etc1: JSString = "WEBGL_compressed_texture_etc1" - @usableFromInline static let WEBGL_compressed_texture_pvrtc: JSString = "WEBGL_compressed_texture_pvrtc" - @usableFromInline static let WEBGL_compressed_texture_s3tc: JSString = "WEBGL_compressed_texture_s3tc" - @usableFromInline static let WEBGL_compressed_texture_s3tc_srgb: JSString = "WEBGL_compressed_texture_s3tc_srgb" - @usableFromInline static let WEBGL_debug_renderer_info: JSString = "WEBGL_debug_renderer_info" - @usableFromInline static let WEBGL_debug_shaders: JSString = "WEBGL_debug_shaders" - @usableFromInline static let WEBGL_depth_texture: JSString = "WEBGL_depth_texture" - @usableFromInline static let WEBGL_draw_buffers: JSString = "WEBGL_draw_buffers" - @usableFromInline static let WEBGL_draw_instanced_base_vertex_base_instance: JSString = "WEBGL_draw_instanced_base_vertex_base_instance" - @usableFromInline static let WEBGL_lose_context: JSString = "WEBGL_lose_context" - @usableFromInline static let WEBGL_multi_draw: JSString = "WEBGL_multi_draw" - @usableFromInline static let WEBGL_multi_draw_instanced_base_vertex_base_instance: JSString = "WEBGL_multi_draw_instanced_base_vertex_base_instance" - @usableFromInline static let WakeLock: JSString = "WakeLock" - @usableFromInline static let WakeLockSentinel: JSString = "WakeLockSentinel" - @usableFromInline static let WaveShaperNode: JSString = "WaveShaperNode" - @usableFromInline static let WebAssembly: JSString = "WebAssembly" - @usableFromInline static let WebGL2RenderingContext: JSString = "WebGL2RenderingContext" - @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 WebGLQuery: JSString = "WebGLQuery" - @usableFromInline static let WebGLRenderbuffer: JSString = "WebGLRenderbuffer" - @usableFromInline static let WebGLRenderingContext: JSString = "WebGLRenderingContext" - @usableFromInline static let WebGLSampler: JSString = "WebGLSampler" - @usableFromInline static let WebGLShader: JSString = "WebGLShader" - @usableFromInline static let WebGLShaderPrecisionFormat: JSString = "WebGLShaderPrecisionFormat" - @usableFromInline static let WebGLSync: JSString = "WebGLSync" - @usableFromInline static let WebGLTexture: JSString = "WebGLTexture" - @usableFromInline static let WebGLTimerQueryEXT: JSString = "WebGLTimerQueryEXT" - @usableFromInline static let WebGLTransformFeedback: JSString = "WebGLTransformFeedback" - @usableFromInline static let WebGLUniformLocation: JSString = "WebGLUniformLocation" - @usableFromInline static let WebGLVertexArrayObject: JSString = "WebGLVertexArrayObject" - @usableFromInline static let WebGLVertexArrayObjectOES: JSString = "WebGLVertexArrayObjectOES" - @usableFromInline static let WebSocket: JSString = "WebSocket" - @usableFromInline static let WebTransport: JSString = "WebTransport" - @usableFromInline static let WebTransportBidirectionalStream: JSString = "WebTransportBidirectionalStream" - @usableFromInline static let WebTransportDatagramDuplexStream: JSString = "WebTransportDatagramDuplexStream" - @usableFromInline static let WebTransportError: JSString = "WebTransportError" @usableFromInline static let WheelEvent: JSString = "WheelEvent" @usableFromInline static let Window: JSString = "Window" - @usableFromInline static let WindowControlsOverlay: JSString = "WindowControlsOverlay" - @usableFromInline static let WindowControlsOverlayGeometryChangeEvent: JSString = "WindowControlsOverlayGeometryChangeEvent" @usableFromInline static let Worker: JSString = "Worker" @usableFromInline static let Worklet: JSString = "Worklet" - @usableFromInline static let WorkletAnimation: JSString = "WorkletAnimation" @usableFromInline static let WritableStream: JSString = "WritableStream" @usableFromInline static let WritableStreamDefaultController: JSString = "WritableStreamDefaultController" @usableFromInline static let WritableStreamDefaultWriter: JSString = "WritableStreamDefaultWriter" @@ -919,87 +330,24 @@ import JavaScriptKit @usableFromInline static let XMLHttpRequest: JSString = "XMLHttpRequest" @usableFromInline static let XMLHttpRequestEventTarget: JSString = "XMLHttpRequestEventTarget" @usableFromInline static let XMLHttpRequestUpload: JSString = "XMLHttpRequestUpload" - @usableFromInline static let XMLSerializer: JSString = "XMLSerializer" @usableFromInline static let XPathEvaluator: JSString = "XPathEvaluator" @usableFromInline static let XPathExpression: JSString = "XPathExpression" @usableFromInline static let XPathResult: JSString = "XPathResult" - @usableFromInline static let XRAnchor: JSString = "XRAnchor" - @usableFromInline static let XRAnchorSet: JSString = "XRAnchorSet" - @usableFromInline static let XRBoundedReferenceSpace: JSString = "XRBoundedReferenceSpace" - @usableFromInline static let XRCPUDepthInformation: JSString = "XRCPUDepthInformation" - @usableFromInline static let XRCompositionLayer: JSString = "XRCompositionLayer" - @usableFromInline static let XRCubeLayer: JSString = "XRCubeLayer" - @usableFromInline static let XRCylinderLayer: JSString = "XRCylinderLayer" - @usableFromInline static let XRDepthInformation: JSString = "XRDepthInformation" - @usableFromInline static let XREquirectLayer: JSString = "XREquirectLayer" - @usableFromInline static let XRFrame: JSString = "XRFrame" - @usableFromInline static let XRHand: JSString = "XRHand" - @usableFromInline static let XRHitTestResult: JSString = "XRHitTestResult" - @usableFromInline static let XRHitTestSource: JSString = "XRHitTestSource" - @usableFromInline static let XRInputSource: JSString = "XRInputSource" - @usableFromInline static let XRInputSourceArray: JSString = "XRInputSourceArray" - @usableFromInline static let XRInputSourceEvent: JSString = "XRInputSourceEvent" - @usableFromInline static let XRInputSourcesChangeEvent: JSString = "XRInputSourcesChangeEvent" - @usableFromInline static let XRJointPose: JSString = "XRJointPose" - @usableFromInline static let XRJointSpace: JSString = "XRJointSpace" - @usableFromInline static let XRLayer: JSString = "XRLayer" - @usableFromInline static let XRLayerEvent: JSString = "XRLayerEvent" - @usableFromInline static let XRLightEstimate: JSString = "XRLightEstimate" - @usableFromInline static let XRLightProbe: JSString = "XRLightProbe" - @usableFromInline static let XRMediaBinding: JSString = "XRMediaBinding" - @usableFromInline static let XRPermissionStatus: JSString = "XRPermissionStatus" - @usableFromInline static let XRPose: JSString = "XRPose" - @usableFromInline static let XRProjectionLayer: JSString = "XRProjectionLayer" - @usableFromInline static let XRQuadLayer: JSString = "XRQuadLayer" - @usableFromInline static let XRRay: JSString = "XRRay" - @usableFromInline static let XRReferenceSpace: JSString = "XRReferenceSpace" - @usableFromInline static let XRReferenceSpaceEvent: JSString = "XRReferenceSpaceEvent" - @usableFromInline static let XRRenderState: JSString = "XRRenderState" - @usableFromInline static let XRRigidTransform: JSString = "XRRigidTransform" - @usableFromInline static let XRSession: JSString = "XRSession" - @usableFromInline static let XRSessionEvent: JSString = "XRSessionEvent" - @usableFromInline static let XRSpace: JSString = "XRSpace" - @usableFromInline static let XRSubImage: JSString = "XRSubImage" - @usableFromInline static let XRSystem: JSString = "XRSystem" - @usableFromInline static let XRTransientInputHitTestResult: JSString = "XRTransientInputHitTestResult" - @usableFromInline static let XRTransientInputHitTestSource: JSString = "XRTransientInputHitTestSource" - @usableFromInline static let XRView: JSString = "XRView" - @usableFromInline static let XRViewerPose: JSString = "XRViewerPose" - @usableFromInline static let XRViewport: JSString = "XRViewport" - @usableFromInline static let XRWebGLBinding: JSString = "XRWebGLBinding" - @usableFromInline static let XRWebGLDepthInformation: JSString = "XRWebGLDepthInformation" - @usableFromInline static let XRWebGLLayer: JSString = "XRWebGLLayer" - @usableFromInline static let XRWebGLSubImage: JSString = "XRWebGLSubImage" @usableFromInline static let XSLTProcessor: JSString = "XSLTProcessor" @usableFromInline static let a: JSString = "a" @usableFromInline static let aLink: JSString = "aLink" - @usableFromInline static let aTranspose: JSString = "aTranspose" @usableFromInline static let abbr: JSString = "abbr" @usableFromInline static let abort: JSString = "abort" @usableFromInline static let aborted: JSString = "aborted" - @usableFromInline static let abs: JSString = "abs" - @usableFromInline static let absolute: JSString = "absolute" - @usableFromInline static let acceleration: JSString = "acceleration" - @usableFromInline static let accelerationIncludingGravity: JSString = "accelerationIncludingGravity" @usableFromInline static let accept: JSString = "accept" - @usableFromInline static let acceptAllDevices: JSString = "acceptAllDevices" @usableFromInline static let acceptCharset: JSString = "acceptCharset" - @usableFromInline static let access: JSString = "access" @usableFromInline static let accessKey: JSString = "accessKey" @usableFromInline static let accessKeyLabel: JSString = "accessKeyLabel" - @usableFromInline static let accuracy: JSString = "accuracy" @usableFromInline static let action: JSString = "action" - @usableFromInline static let actions: JSString = "actions" - @usableFromInline static let activate: JSString = "activate" - @usableFromInline static let activated: JSString = "activated" - @usableFromInline static let activation: JSString = "activation" - @usableFromInline static let activations: JSString = "activations" @usableFromInline static let active: JSString = "active" @usableFromInline static let activeCues: JSString = "activeCues" - @usableFromInline static let activeDuration: JSString = "activeDuration" @usableFromInline static let activeElement: JSString = "activeElement" @usableFromInline static let activeSourceBuffers: JSString = "activeSourceBuffers" - @usableFromInline static let activeTexture: JSString = "activeTexture" @usableFromInline static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" @usableFromInline static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" @usableFromInline static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" @@ -1008,114 +356,54 @@ import JavaScriptKit @usableFromInline static let addAll: JSString = "addAll" @usableFromInline static let addColorStop: JSString = "addColorStop" @usableFromInline static let addCue: JSString = "addCue" - @usableFromInline static let addFromString: JSString = "addFromString" - @usableFromInline static let addFromURI: JSString = "addFromURI" @usableFromInline static let addModule: JSString = "addModule" @usableFromInline static let addPath: JSString = "addPath" - @usableFromInline static let addRange: JSString = "addRange" - @usableFromInline static let addRemoteCandidate: JSString = "addRemoteCandidate" @usableFromInline static let addRule: JSString = "addRule" @usableFromInline static let addSourceBuffer: JSString = "addSourceBuffer" @usableFromInline static let addTextTrack: JSString = "addTextTrack" @usableFromInline static let addTrack: JSString = "addTrack" - @usableFromInline static let addTransceiver: JSString = "addTransceiver" - @usableFromInline static let added: JSString = "added" @usableFromInline static let addedNodes: JSString = "addedNodes" - @usableFromInline static let additionalData: JSString = "additionalData" - @usableFromInline static let additionalDisplayItems: JSString = "additionalDisplayItems" - @usableFromInline static let additiveSymbols: JSString = "additiveSymbols" - @usableFromInline static let address: JSString = "address" - @usableFromInline static let addressLine: JSString = "addressLine" - @usableFromInline static let addressModeU: JSString = "addressModeU" - @usableFromInline static let addressModeV: JSString = "addressModeV" - @usableFromInline static let addressModeW: JSString = "addressModeW" @usableFromInline static let adoptNode: JSString = "adoptNode" - @usableFromInline static let adoptPredecessor: JSString = "adoptPredecessor" @usableFromInline static let adoptedStyleSheets: JSString = "adoptedStyleSheets" - @usableFromInline static let advance: JSString = "advance" @usableFromInline static let advanced: JSString = "advanced" - @usableFromInline static let advances: JSString = "advances" @usableFromInline static let after: JSString = "after" - @usableFromInline static let album: JSString = "album" @usableFromInline static let alert: JSString = "alert" - @usableFromInline static let alg: JSString = "alg" - @usableFromInline static let algorithm: JSString = "algorithm" @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 allowAttributes: JSString = "allowAttributes" - @usableFromInline static let allowComments: JSString = "allowComments" - @usableFromInline static let allowCredentials: JSString = "allowCredentials" - @usableFromInline static let allowCustomElements: JSString = "allowCustomElements" - @usableFromInline static let allowElements: JSString = "allowElements" @usableFromInline static let allowFullscreen: JSString = "allowFullscreen" - @usableFromInline static let allowPooling: JSString = "allowPooling" - @usableFromInline static let allowWithoutGesture: JSString = "allowWithoutGesture" - @usableFromInline static let allowedDevices: JSString = "allowedDevices" - @usableFromInline static let allowedFeatures: JSString = "allowedFeatures" - @usableFromInline static let allowedManufacturerData: JSString = "allowedManufacturerData" - @usableFromInline static let allowedServices: JSString = "allowedServices" - @usableFromInline static let allowsFeature: JSString = "allowsFeature" @usableFromInline static let alpha: JSString = "alpha" @usableFromInline static let alphaSideData: JSString = "alphaSideData" - @usableFromInline static let alphaToCoverageEnabled: JSString = "alphaToCoverageEnabled" @usableFromInline static let alphabeticBaseline: JSString = "alphabeticBaseline" @usableFromInline static let alt: JSString = "alt" @usableFromInline static let altKey: JSString = "altKey" - @usableFromInline static let alternate: JSString = "alternate" - @usableFromInline static let alternateSetting: JSString = "alternateSetting" - @usableFromInline static let alternates: JSString = "alternates" - @usableFromInline static let altitude: JSString = "altitude" - @usableFromInline static let altitudeAccuracy: JSString = "altitudeAccuracy" - @usableFromInline static let altitudeAngle: JSString = "altitudeAngle" - @usableFromInline static let amount: JSString = "amount" - @usableFromInline static let amplitude: JSString = "amplitude" @usableFromInline static let ancestorOrigins: JSString = "ancestorOrigins" - @usableFromInline static let anchorNode: JSString = "anchorNode" - @usableFromInline static let anchorOffset: JSString = "anchorOffset" - @usableFromInline static let anchorSpace: JSString = "anchorSpace" @usableFromInline static let anchors: JSString = "anchors" @usableFromInline static let angle: JSString = "angle" - @usableFromInline static let angularAcceleration: JSString = "angularAcceleration" - @usableFromInline static let angularVelocity: JSString = "angularVelocity" @usableFromInline static let animVal: JSString = "animVal" @usableFromInline static let animate: JSString = "animate" @usableFromInline static let animated: JSString = "animated" @usableFromInline static let animatedInstanceRoot: JSString = "animatedInstanceRoot" @usableFromInline static let animatedPoints: JSString = "animatedPoints" - @usableFromInline static let animationName: JSString = "animationName" - @usableFromInline static let animationWorklet: JSString = "animationWorklet" - @usableFromInline static let animationsPaused: JSString = "animationsPaused" - @usableFromInline static let animatorName: JSString = "animatorName" - @usableFromInline static let annotation: JSString = "annotation" - @usableFromInline static let antialias: JSString = "antialias" - @usableFromInline static let anticipatedRemoval: JSString = "anticipatedRemoval" @usableFromInline static let appCodeName: JSString = "appCodeName" @usableFromInline static let appName: JSString = "appName" @usableFromInline static let appVersion: JSString = "appVersion" - @usableFromInline static let appearance: JSString = "appearance" @usableFromInline static let append: JSString = "append" @usableFromInline static let appendBuffer: JSString = "appendBuffer" @usableFromInline static let appendChild: JSString = "appendChild" @usableFromInline static let appendData: JSString = "appendData" @usableFromInline static let appendItem: JSString = "appendItem" @usableFromInline static let appendMedium: JSString = "appendMedium" - @usableFromInline static let appendRule: JSString = "appendRule" @usableFromInline static let appendWindowEnd: JSString = "appendWindowEnd" @usableFromInline static let appendWindowStart: JSString = "appendWindowStart" - @usableFromInline static let appid: JSString = "appid" - @usableFromInline static let appidExclude: JSString = "appidExclude" @usableFromInline static let applets: JSString = "applets" - @usableFromInline static let applicationServerKey: JSString = "applicationServerKey" @usableFromInline static let applyConstraints: JSString = "applyConstraints" @usableFromInline static let arc: JSString = "arc" @usableFromInline static let arcTo: JSString = "arcTo" - @usableFromInline static let architecture: JSString = "architecture" @usableFromInline static let archive: JSString = "archive" @usableFromInline static let areas: JSString = "areas" - @usableFromInline static let args: JSString = "args" @usableFromInline static let ariaAtomic: JSString = "ariaAtomic" @usableFromInline static let ariaAutoComplete: JSString = "ariaAutoComplete" @usableFromInline static let ariaBusy: JSString = "ariaBusy" @@ -1157,592 +445,197 @@ import JavaScriptKit @usableFromInline static let ariaValueNow: JSString = "ariaValueNow" @usableFromInline static let ariaValueText: JSString = "ariaValueText" @usableFromInline static let arrayBuffer: JSString = "arrayBuffer" - @usableFromInline static let arrayLayerCount: JSString = "arrayLayerCount" - @usableFromInline static let arrayStride: JSString = "arrayStride" - @usableFromInline static let artist: JSString = "artist" - @usableFromInline static let artwork: JSString = "artwork" @usableFromInline static let `as`: JSString = "as" - @usableFromInline static let ascentOverride: JSString = "ascentOverride" - @usableFromInline static let aspect: JSString = "aspect" @usableFromInline static let aspectRatio: JSString = "aspectRatio" - @usableFromInline static let assert: JSString = "assert" - @usableFromInline static let assertion: JSString = "assertion" @usableFromInline static let assign: JSString = "assign" @usableFromInline static let assignedElements: JSString = "assignedElements" @usableFromInline static let assignedNodes: JSString = "assignedNodes" @usableFromInline static let assignedSlot: JSString = "assignedSlot" @usableFromInline static let async: JSString = "async" - @usableFromInline static let atRules: JSString = "atRules" @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 attachedElements: JSString = "attachedElements" - @usableFromInline static let attack: JSString = "attack" - @usableFromInline static let attestation: JSString = "attestation" - @usableFromInline static let attestationObject: JSString = "attestationObject" @usableFromInline static let attrChange: JSString = "attrChange" @usableFromInline static let attrName: JSString = "attrName" @usableFromInline static let attributeFilter: JSString = "attributeFilter" @usableFromInline static let attributeName: JSString = "attributeName" @usableFromInline static let attributeNamespace: JSString = "attributeNamespace" @usableFromInline static let attributeOldValue: JSString = "attributeOldValue" - @usableFromInline static let attributeStyleMap: JSString = "attributeStyleMap" @usableFromInline static let attributes: JSString = "attributes" - @usableFromInline static let attribution: JSString = "attribution" - @usableFromInline static let attributionDestination: JSString = "attributionDestination" - @usableFromInline static let attributionExpiry: JSString = "attributionExpiry" - @usableFromInline static let attributionReportTo: JSString = "attributionReportTo" - @usableFromInline static let attributionReporting: JSString = "attributionReporting" - @usableFromInline static let attributionSourceEventId: JSString = "attributionSourceEventId" - @usableFromInline static let attributionSourceId: JSString = "attributionSourceId" - @usableFromInline static let attributionSourcePriority: JSString = "attributionSourcePriority" @usableFromInline static let audio: JSString = "audio" @usableFromInline static let audioBitrateMode: JSString = "audioBitrateMode" @usableFromInline static let audioBitsPerSecond: JSString = "audioBitsPerSecond" - @usableFromInline static let audioCapabilities: JSString = "audioCapabilities" - @usableFromInline static let audioLevel: JSString = "audioLevel" @usableFromInline static let audioTracks: JSString = "audioTracks" - @usableFromInline static let audioWorklet: JSString = "audioWorklet" - @usableFromInline static let authenticatedSignedWrites: JSString = "authenticatedSignedWrites" - @usableFromInline static let authenticatorAttachment: JSString = "authenticatorAttachment" - @usableFromInline static let authenticatorData: JSString = "authenticatorData" - @usableFromInline static let authenticatorSelection: JSString = "authenticatorSelection" @usableFromInline static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" @usableFromInline static let autoGainControl: JSString = "autoGainControl" - @usableFromInline static let autoIncrement: JSString = "autoIncrement" - @usableFromInline static let autoPad: JSString = "autoPad" - @usableFromInline static let autoPictureInPicture: JSString = "autoPictureInPicture" @usableFromInline static let autocapitalize: JSString = "autocapitalize" @usableFromInline static let autocomplete: JSString = "autocomplete" @usableFromInline static let autofocus: JSString = "autofocus" - @usableFromInline static let automationRate: JSString = "automationRate" @usableFromInline static let autoplay: JSString = "autoplay" - @usableFromInline static let availHeight: JSString = "availHeight" - @usableFromInline static let availWidth: JSString = "availWidth" - @usableFromInline static let availableBlockSize: JSString = "availableBlockSize" - @usableFromInline static let availableIncomingBitrate: JSString = "availableIncomingBitrate" - @usableFromInline static let availableInlineSize: JSString = "availableInlineSize" - @usableFromInline static let availableOutgoingBitrate: JSString = "availableOutgoingBitrate" - @usableFromInline static let averagePool2d: JSString = "averagePool2d" - @usableFromInline static let averageRtcpInterval: JSString = "averageRtcpInterval" - @usableFromInline static let ax: JSString = "ax" - @usableFromInline static let axes: JSString = "axes" @usableFromInline static let axis: JSString = "axis" - @usableFromInline static let axisTag: JSString = "axisTag" - @usableFromInline static let ay: JSString = "ay" - @usableFromInline static let azimuth: JSString = "azimuth" - @usableFromInline static let azimuthAngle: JSString = "azimuthAngle" @usableFromInline static let b: JSString = "b" - @usableFromInline static let bTranspose: JSString = "bTranspose" @usableFromInline static let back: JSString = "back" @usableFromInline static let background: JSString = "background" - @usableFromInline static let backgroundColor: JSString = "backgroundColor" - @usableFromInline static let backgroundFetch: JSString = "backgroundFetch" @usableFromInline static let badInput: JSString = "badInput" - @usableFromInline static let badge: JSString = "badge" - @usableFromInline static let base64Certificate: JSString = "base64Certificate" - @usableFromInline static let baseArrayLayer: JSString = "baseArrayLayer" - @usableFromInline static let baseFrequencyX: JSString = "baseFrequencyX" - @usableFromInline static let baseFrequencyY: JSString = "baseFrequencyY" - @usableFromInline static let baseLatency: JSString = "baseLatency" - @usableFromInline static let baseLayer: JSString = "baseLayer" - @usableFromInline static let baseMipLevel: JSString = "baseMipLevel" - @usableFromInline static let basePalette: JSString = "basePalette" @usableFromInline static let baseURI: JSString = "baseURI" @usableFromInline static let baseURL: JSString = "baseURL" @usableFromInline static let baseVal: JSString = "baseVal" - @usableFromInline static let baselines: JSString = "baselines" - @usableFromInline static let batchNormalization: JSString = "batchNormalization" - @usableFromInline static let baudRate: JSString = "baudRate" @usableFromInline static let before: JSString = "before" - @usableFromInline static let beginComputePass: JSString = "beginComputePass" - @usableFromInline static let beginElement: JSString = "beginElement" - @usableFromInline static let beginElementAt: JSString = "beginElementAt" - @usableFromInline static let beginOcclusionQuery: JSString = "beginOcclusionQuery" @usableFromInline static let beginPath: JSString = "beginPath" - @usableFromInline static let beginQuery: JSString = "beginQuery" - @usableFromInline static let beginQueryEXT: JSString = "beginQueryEXT" - @usableFromInline static let beginRenderPass: JSString = "beginRenderPass" - @usableFromInline static let beginTransformFeedback: JSString = "beginTransformFeedback" @usableFromInline static let behavior: JSString = "behavior" - @usableFromInline static let beta: JSString = "beta" @usableFromInline static let bezierCurveTo: JSString = "bezierCurveTo" @usableFromInline static let bgColor: JSString = "bgColor" - @usableFromInline static let bias: JSString = "bias" - @usableFromInline static let binaryType: JSString = "binaryType" - @usableFromInline static let bindAttribLocation: JSString = "bindAttribLocation" - @usableFromInline static let bindBuffer: JSString = "bindBuffer" - @usableFromInline static let bindBufferBase: JSString = "bindBufferBase" - @usableFromInline static let bindBufferRange: JSString = "bindBufferRange" - @usableFromInline static let bindFramebuffer: JSString = "bindFramebuffer" - @usableFromInline static let bindGroupLayouts: JSString = "bindGroupLayouts" - @usableFromInline static let bindRenderbuffer: JSString = "bindRenderbuffer" - @usableFromInline static let bindSampler: JSString = "bindSampler" - @usableFromInline static let bindTexture: JSString = "bindTexture" - @usableFromInline static let bindTransformFeedback: JSString = "bindTransformFeedback" - @usableFromInline static let bindVertexArray: JSString = "bindVertexArray" - @usableFromInline static let bindVertexArrayOES: JSString = "bindVertexArrayOES" - @usableFromInline static let binding: JSString = "binding" - @usableFromInline static let bitDepth: JSString = "bitDepth" - @usableFromInline static let bitness: JSString = "bitness" @usableFromInline static let bitrate: JSString = "bitrate" @usableFromInline static let bitrateMode: JSString = "bitrateMode" @usableFromInline static let bitsPerSecond: JSString = "bitsPerSecond" - @usableFromInline static let blend: JSString = "blend" - @usableFromInline static let blendColor: JSString = "blendColor" - @usableFromInline static let blendEquation: JSString = "blendEquation" - @usableFromInline static let blendEquationSeparate: JSString = "blendEquationSeparate" - @usableFromInline static let blendEquationSeparateiOES: JSString = "blendEquationSeparateiOES" - @usableFromInline static let blendEquationiOES: JSString = "blendEquationiOES" - @usableFromInline static let blendFunc: JSString = "blendFunc" - @usableFromInline static let blendFuncSeparate: JSString = "blendFuncSeparate" - @usableFromInline static let blendFuncSeparateiOES: JSString = "blendFuncSeparateiOES" - @usableFromInline static let blendFunciOES: JSString = "blendFunciOES" - @usableFromInline static let blendTextureSourceAlpha: JSString = "blendTextureSourceAlpha" - @usableFromInline static let blitFramebuffer: JSString = "blitFramebuffer" @usableFromInline static let blob: JSString = "blob" - @usableFromInline static let block: JSString = "block" - @usableFromInline static let blockElements: JSString = "blockElements" - @usableFromInline static let blockFragmentationOffset: JSString = "blockFragmentationOffset" - @usableFromInline static let blockFragmentationType: JSString = "blockFragmentationType" - @usableFromInline static let blockSize: JSString = "blockSize" - @usableFromInline static let blockedURI: JSString = "blockedURI" - @usableFromInline static let blockedURL: JSString = "blockedURL" @usableFromInline static let blocking: JSString = "blocking" - @usableFromInline static let bluetooth: JSString = "bluetooth" @usableFromInline static let blur: JSString = "blur" @usableFromInline static let body: JSString = "body" @usableFromInline static let bodyUsed: JSString = "bodyUsed" @usableFromInline static let booleanValue: JSString = "booleanValue" @usableFromInline static let border: JSString = "border" - @usableFromInline static let borderBoxSize: JSString = "borderBoxSize" @usableFromInline static let bottom: JSString = "bottom" - @usableFromInline static let bound: JSString = "bound" - @usableFromInline static let boundingBox: JSString = "boundingBox" - @usableFromInline static let boundingBoxAscent: JSString = "boundingBoxAscent" - @usableFromInline static let boundingBoxDescent: JSString = "boundingBoxDescent" - @usableFromInline static let boundingBoxLeft: JSString = "boundingBoxLeft" - @usableFromInline static let boundingBoxRight: JSString = "boundingBoxRight" - @usableFromInline static let boundingClientRect: JSString = "boundingClientRect" - @usableFromInline static let boundingRect: JSString = "boundingRect" - @usableFromInline static let boundsGeometry: JSString = "boundsGeometry" - @usableFromInline static let box: JSString = "box" - @usableFromInline static let brand: JSString = "brand" - @usableFromInline static let brands: JSString = "brands" - @usableFromInline static let `break`: JSString = "break" - @usableFromInline static let breakdown: JSString = "breakdown" - @usableFromInline static let brightness: JSString = "brightness" - @usableFromInline static let broadcast: JSString = "broadcast" @usableFromInline static let btoa: JSString = "btoa" @usableFromInline static let bubbles: JSString = "bubbles" - @usableFromInline static let buffer: JSString = "buffer" - @usableFromInline static let bufferData: JSString = "bufferData" - @usableFromInline static let bufferSize: JSString = "bufferSize" - @usableFromInline static let bufferSubData: JSString = "bufferSubData" @usableFromInline static let buffered: JSString = "buffered" - @usableFromInline static let bufferedAmount: JSString = "bufferedAmount" - @usableFromInline static let bufferedAmountLowThreshold: JSString = "bufferedAmountLowThreshold" - @usableFromInline static let buffers: JSString = "buffers" - @usableFromInline static let build: JSString = "build" - @usableFromInline static let bundlePolicy: JSString = "bundlePolicy" - @usableFromInline static let burstDiscardCount: JSString = "burstDiscardCount" - @usableFromInline static let burstDiscardRate: JSString = "burstDiscardRate" - @usableFromInline static let burstLossCount: JSString = "burstLossCount" - @usableFromInline static let burstLossRate: JSString = "burstLossRate" - @usableFromInline static let burstPacketsDiscarded: JSString = "burstPacketsDiscarded" - @usableFromInline static let burstPacketsLost: JSString = "burstPacketsLost" @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 bytes: JSString = "bytes" - @usableFromInline static let bytesDiscardedOnSend: JSString = "bytesDiscardedOnSend" - @usableFromInline static let bytesPerRow: JSString = "bytesPerRow" - @usableFromInline static let bytesReceived: JSString = "bytesReceived" - @usableFromInline static let bytesSent: JSString = "bytesSent" - @usableFromInline static let bytesWritten: JSString = "bytesWritten" @usableFromInline static let c: JSString = "c" @usableFromInline static let cache: JSString = "cache" @usableFromInline static let cacheName: JSString = "cacheName" @usableFromInline static let caches: JSString = "caches" @usableFromInline static let canConstructInDedicatedWorker: JSString = "canConstructInDedicatedWorker" - @usableFromInline static let canGoBack: JSString = "canGoBack" - @usableFromInline static let canGoForward: JSString = "canGoForward" - @usableFromInline static let canInsertDTMF: JSString = "canInsertDTMF" - @usableFromInline static let canMakePayment: JSString = "canMakePayment" @usableFromInline static let canPlayType: JSString = "canPlayType" - @usableFromInline static let canShare: JSString = "canShare" - @usableFromInline static let canTransition: JSString = "canTransition" - @usableFromInline static let canTrickleIceCandidates: JSString = "canTrickleIceCandidates" @usableFromInline static let cancel: JSString = "cancel" - @usableFromInline static let cancelAndHoldAtTime: JSString = "cancelAndHoldAtTime" @usableFromInline static let cancelAnimationFrame: JSString = "cancelAnimationFrame" @usableFromInline static let cancelBubble: JSString = "cancelBubble" - @usableFromInline static let cancelIdleCallback: JSString = "cancelIdleCallback" - @usableFromInline static let cancelScheduledValues: JSString = "cancelScheduledValues" - @usableFromInline static let cancelVideoFrameCallback: JSString = "cancelVideoFrameCallback" - @usableFromInline static let cancelWatchAvailability: JSString = "cancelWatchAvailability" @usableFromInline static let cancelable: JSString = "cancelable" - @usableFromInline static let candidate: JSString = "candidate" - @usableFromInline static let candidateType: JSString = "candidateType" - @usableFromInline static let candidates: JSString = "candidates" - @usableFromInline static let canonicalUUID: JSString = "canonicalUUID" @usableFromInline static let canvas: JSString = "canvas" @usableFromInline static let caption: JSString = "caption" @usableFromInline static let capture: JSString = "capture" @usableFromInline static let captureEvents: JSString = "captureEvents" - @usableFromInline static let captureStream: JSString = "captureStream" - @usableFromInline static let captureTime: JSString = "captureTime" - @usableFromInline static let caretPositionFromPoint: JSString = "caretPositionFromPoint" - @usableFromInline static let category: JSString = "category" - @usableFromInline static let ceil: JSString = "ceil" @usableFromInline static let cellIndex: JSString = "cellIndex" @usableFromInline static let cellPadding: JSString = "cellPadding" @usableFromInline static let cellSpacing: JSString = "cellSpacing" @usableFromInline static let cells: JSString = "cells" - @usableFromInline static let centralAngle: JSString = "centralAngle" - @usableFromInline static let centralHorizontalAngle: JSString = "centralHorizontalAngle" - @usableFromInline static let certificates: JSString = "certificates" @usableFromInline static let ch: JSString = "ch" @usableFromInline static let chOff: JSString = "chOff" - @usableFromInline static let challenge: JSString = "challenge" @usableFromInline static let changeType: JSString = "changeType" - @usableFromInline static let changed: JSString = "changed" - @usableFromInline static let changedTouches: JSString = "changedTouches" - @usableFromInline static let channel: JSString = "channel" @usableFromInline static let channelCount: JSString = "channelCount" - @usableFromInline static let channelCountMode: JSString = "channelCountMode" - @usableFromInline static let channelInterpretation: JSString = "channelInterpretation" - @usableFromInline static let channels: JSString = "channels" @usableFromInline static let charCode: JSString = "charCode" - @usableFromInline static let charIndex: JSString = "charIndex" - @usableFromInline static let charLength: JSString = "charLength" - @usableFromInline static let characterBounds: JSString = "characterBounds" - @usableFromInline static let characterBoundsRangeStart: JSString = "characterBoundsRangeStart" @usableFromInline static let characterData: JSString = "characterData" @usableFromInline static let characterDataOldValue: JSString = "characterDataOldValue" @usableFromInline static let characterSet: JSString = "characterSet" - @usableFromInline static let characterVariant: JSString = "characterVariant" - @usableFromInline static let characteristic: JSString = "characteristic" - @usableFromInline static let charging: JSString = "charging" - @usableFromInline static let chargingTime: JSString = "chargingTime" @usableFromInline static let charset: JSString = "charset" - @usableFromInline static let check: JSString = "check" @usableFromInline static let checkEnclosure: JSString = "checkEnclosure" - @usableFromInline static let checkFramebufferStatus: JSString = "checkFramebufferStatus" @usableFromInline static let checkIntersection: JSString = "checkIntersection" @usableFromInline static let checkValidity: JSString = "checkValidity" @usableFromInline static let checked: JSString = "checked" - @usableFromInline static let childDisplay: JSString = "childDisplay" @usableFromInline static let childElementCount: JSString = "childElementCount" @usableFromInline static let childList: JSString = "childList" @usableFromInline static let childNodes: JSString = "childNodes" @usableFromInline static let children: JSString = "children" - @usableFromInline static let chromaticAberrationCorrection: JSString = "chromaticAberrationCorrection" - @usableFromInline static let circuitBreakerTriggerCount: JSString = "circuitBreakerTriggerCount" @usableFromInline static let cite: JSString = "cite" - @usableFromInline static let city: JSString = "city" - @usableFromInline static let claimInterface: JSString = "claimInterface" - @usableFromInline static let claimed: JSString = "claimed" - @usableFromInline static let clamp: JSString = "clamp" - @usableFromInline static let classCode: JSString = "classCode" @usableFromInline static let classList: JSString = "classList" @usableFromInline static let className: JSString = "className" @usableFromInline static let clear: JSString = "clear" - @usableFromInline static let clearAppBadge: JSString = "clearAppBadge" - @usableFromInline static let clearBuffer: JSString = "clearBuffer" - @usableFromInline static let clearBufferfi: JSString = "clearBufferfi" - @usableFromInline static let clearBufferfv: JSString = "clearBufferfv" - @usableFromInline static let clearBufferiv: JSString = "clearBufferiv" - @usableFromInline static let clearBufferuiv: JSString = "clearBufferuiv" - @usableFromInline static let clearClientBadge: JSString = "clearClientBadge" - @usableFromInline static let clearColor: JSString = "clearColor" @usableFromInline static let clearData: JSString = "clearData" - @usableFromInline static let clearDepth: JSString = "clearDepth" - @usableFromInline static let clearHalt: JSString = "clearHalt" @usableFromInline static let clearInterval: JSString = "clearInterval" @usableFromInline static let clearLiveSeekableRange: JSString = "clearLiveSeekableRange" - @usableFromInline static let clearMarks: JSString = "clearMarks" - @usableFromInline static let clearMeasures: JSString = "clearMeasures" @usableFromInline static let clearParameters: JSString = "clearParameters" @usableFromInline static let clearRect: JSString = "clearRect" - @usableFromInline static let clearResourceTimings: JSString = "clearResourceTimings" - @usableFromInline static let clearStencil: JSString = "clearStencil" @usableFromInline static let clearTimeout: JSString = "clearTimeout" - @usableFromInline static let clearToSend: JSString = "clearToSend" - @usableFromInline static let clearValue: JSString = "clearValue" - @usableFromInline static let clearWatch: JSString = "clearWatch" @usableFromInline static let click: JSString = "click" - @usableFromInline static let clientDataJSON: JSString = "clientDataJSON" - @usableFromInline static let clientHeight: JSString = "clientHeight" @usableFromInline static let clientId: JSString = "clientId" @usableFromInline static let clientInformation: JSString = "clientInformation" - @usableFromInline static let clientLeft: JSString = "clientLeft" - @usableFromInline static let clientTop: JSString = "clientTop" - @usableFromInline static let clientWaitSync: JSString = "clientWaitSync" - @usableFromInline static let clientWidth: JSString = "clientWidth" @usableFromInline static let clientX: JSString = "clientX" @usableFromInline static let clientY: JSString = "clientY" @usableFromInline static let clip: JSString = "clip" - @usableFromInline static let clipPathUnits: JSString = "clipPathUnits" - @usableFromInline static let clipboard: JSString = "clipboard" - @usableFromInline static let clipboardData: JSString = "clipboardData" @usableFromInline static let clipped: JSString = "clipped" - @usableFromInline static let clockRate: JSString = "clockRate" @usableFromInline static let clone: JSString = "clone" @usableFromInline static let cloneContents: JSString = "cloneContents" @usableFromInline static let cloneNode: JSString = "cloneNode" @usableFromInline static let cloneRange: JSString = "cloneRange" @usableFromInline static let close: JSString = "close" - @usableFromInline static let closeCode: JSString = "closeCode" @usableFromInline static let closePath: JSString = "closePath" @usableFromInline static let closed: JSString = "closed" @usableFromInline static let closest: JSString = "closest" - @usableFromInline static let cm: JSString = "cm" - @usableFromInline static let cmp: JSString = "cmp" - @usableFromInline static let cname: JSString = "cname" - @usableFromInline static let coalescedEvents: JSString = "coalescedEvents" @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 codecId: JSString = "codecId" - @usableFromInline static let codecType: JSString = "codecType" - @usableFromInline static let codecs: JSString = "codecs" @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 collapseToEnd: JSString = "collapseToEnd" - @usableFromInline static let collapseToStart: JSString = "collapseToStart" @usableFromInline static let collapsed: JSString = "collapsed" - @usableFromInline static let collections: JSString = "collections" @usableFromInline static let colno: JSString = "colno" @usableFromInline static let color: JSString = "color" - @usableFromInline static let colorAttachments: JSString = "colorAttachments" - @usableFromInline static let colorDepth: JSString = "colorDepth" - @usableFromInline static let colorFormat: JSString = "colorFormat" - @usableFromInline static let colorFormats: JSString = "colorFormats" - @usableFromInline static let colorGamut: JSString = "colorGamut" - @usableFromInline static let colorMask: JSString = "colorMask" - @usableFromInline static let colorMaskiOES: JSString = "colorMaskiOES" @usableFromInline static let colorSpace: JSString = "colorSpace" @usableFromInline static let colorSpaceConversion: JSString = "colorSpaceConversion" - @usableFromInline static let colorTemperature: JSString = "colorTemperature" - @usableFromInline static let colorTexture: JSString = "colorTexture" @usableFromInline static let cols: JSString = "cols" - @usableFromInline static let column: JSString = "column" - @usableFromInline static let columnNumber: JSString = "columnNumber" @usableFromInline static let commit: JSString = "commit" @usableFromInline static let commitStyles: JSString = "commitStyles" - @usableFromInline static let committed: JSString = "committed" @usableFromInline static let commonAncestorContainer: JSString = "commonAncestorContainer" @usableFromInline static let compact: JSString = "compact" - @usableFromInline static let companyIdentifier: JSString = "companyIdentifier" - @usableFromInline static let compare: JSString = "compare" @usableFromInline static let compareBoundaryPoints: JSString = "compareBoundaryPoints" @usableFromInline static let compareDocumentPosition: JSString = "compareDocumentPosition" @usableFromInline static let comparePoint: JSString = "comparePoint" @usableFromInline static let compatMode: JSString = "compatMode" - @usableFromInline static let compilationInfo: JSString = "compilationInfo" - @usableFromInline static let compile: JSString = "compile" - @usableFromInline static let compileShader: JSString = "compileShader" - @usableFromInline static let compileStreaming: JSString = "compileStreaming" @usableFromInline static let complete: JSString = "complete" @usableFromInline static let completeFramesOnly: JSString = "completeFramesOnly" @usableFromInline static let completed: JSString = "completed" - @usableFromInline static let component: JSString = "component" @usableFromInline static let composed: JSString = "composed" @usableFromInline static let composedPath: JSString = "composedPath" @usableFromInline static let composite: JSString = "composite" - @usableFromInline static let compositingAlphaMode: JSString = "compositingAlphaMode" - @usableFromInline static let compositionEnd: JSString = "compositionEnd" - @usableFromInline static let compositionRangeEnd: JSString = "compositionRangeEnd" - @usableFromInline static let compositionRangeStart: JSString = "compositionRangeStart" - @usableFromInline static let compositionStart: JSString = "compositionStart" - @usableFromInline static let compressedTexImage2D: JSString = "compressedTexImage2D" - @usableFromInline static let compressedTexImage3D: JSString = "compressedTexImage3D" - @usableFromInline static let compressedTexSubImage2D: JSString = "compressedTexSubImage2D" - @usableFromInline static let compressedTexSubImage3D: JSString = "compressedTexSubImage3D" - @usableFromInline static let compute: JSString = "compute" @usableFromInline static let computedOffset: JSString = "computedOffset" - @usableFromInline static let computedStyleMap: JSString = "computedStyleMap" - @usableFromInline static let concat: JSString = "concat" - @usableFromInline static let concealedSamples: JSString = "concealedSamples" - @usableFromInline static let concealmentEvents: JSString = "concealmentEvents" - @usableFromInline static let conditionText: JSString = "conditionText" - @usableFromInline static let coneInnerAngle: JSString = "coneInnerAngle" - @usableFromInline static let coneOuterAngle: JSString = "coneOuterAngle" - @usableFromInline static let coneOuterGain: JSString = "coneOuterGain" - @usableFromInline static let confidence: JSString = "confidence" @usableFromInline static let config: JSString = "config" - @usableFromInline static let configuration: JSString = "configuration" - @usableFromInline static let configurationName: JSString = "configurationName" - @usableFromInline static let configurationValue: JSString = "configurationValue" - @usableFromInline static let configurations: JSString = "configurations" @usableFromInline static let configure: JSString = "configure" @usableFromInline static let confirm: JSString = "confirm" - @usableFromInline static let congestionWindow: JSString = "congestionWindow" - @usableFromInline static let connect: JSString = "connect" - @usableFromInline static let connectEnd: JSString = "connectEnd" - @usableFromInline static let connectStart: JSString = "connectStart" - @usableFromInline static let connected: JSString = "connected" - @usableFromInline static let connection: JSString = "connection" - @usableFromInline static let connectionList: JSString = "connectionList" - @usableFromInline static let connectionState: JSString = "connectionState" - @usableFromInline static let connections: JSString = "connections" - @usableFromInline static let consentExpiredTimestamp: JSString = "consentExpiredTimestamp" - @usableFromInline static let consentRequestBytesSent: JSString = "consentRequestBytesSent" - @usableFromInline static let consentRequestsSent: JSString = "consentRequestsSent" - @usableFromInline static let console: JSString = "console" @usableFromInline static let consolidate: JSString = "consolidate" - @usableFromInline static let constant: JSString = "constant" - @usableFromInline static let constants: JSString = "constants" @usableFromInline static let constraint: JSString = "constraint" - @usableFromInline static let consume: JSString = "consume" - @usableFromInline static let contacts: JSString = "contacts" - @usableFromInline static let container: JSString = "container" - @usableFromInline static let containerId: JSString = "containerId" - @usableFromInline static let containerName: JSString = "containerName" - @usableFromInline static let containerSrc: JSString = "containerSrc" - @usableFromInline static let containerType: JSString = "containerType" @usableFromInline static let contains: JSString = "contains" - @usableFromInline static let containsNode: JSString = "containsNode" @usableFromInline static let content: JSString = "content" - @usableFromInline static let contentBoxSize: JSString = "contentBoxSize" @usableFromInline static let contentDocument: JSString = "contentDocument" @usableFromInline static let contentEditable: JSString = "contentEditable" - @usableFromInline static let contentHint: JSString = "contentHint" - @usableFromInline static let contentRect: JSString = "contentRect" @usableFromInline static let contentType: JSString = "contentType" @usableFromInline static let contentWindow: JSString = "contentWindow" - @usableFromInline static let contents: JSString = "contents" - @usableFromInline static let context: JSString = "context" - @usableFromInline static let contextTime: JSString = "contextTime" - @usableFromInline static let `continue`: JSString = "continue" - @usableFromInline static let continuePrimaryKey: JSString = "continuePrimaryKey" - @usableFromInline static let continuous: JSString = "continuous" - @usableFromInline static let contrast: JSString = "contrast" - @usableFromInline static let contributingSources: JSString = "contributingSources" - @usableFromInline static let contributorSsrc: JSString = "contributorSsrc" @usableFromInline static let control: JSString = "control" - @usableFromInline static let controlBound: JSString = "controlBound" - @usableFromInline static let controlTransferIn: JSString = "controlTransferIn" - @usableFromInline static let controlTransferOut: JSString = "controlTransferOut" @usableFromInline static let controller: JSString = "controller" @usableFromInline static let controls: JSString = "controls" - @usableFromInline static let conv2d: JSString = "conv2d" - @usableFromInline static let convTranspose2d: JSString = "convTranspose2d" - @usableFromInline static let convertPointFromNode: JSString = "convertPointFromNode" - @usableFromInline static let convertQuadFromNode: JSString = "convertQuadFromNode" - @usableFromInline static let convertRectFromNode: JSString = "convertRectFromNode" @usableFromInline static let convertToBlob: JSString = "convertToBlob" @usableFromInline static let convertToSpecifiedUnits: JSString = "convertToSpecifiedUnits" @usableFromInline static let cookie: JSString = "cookie" @usableFromInline static let cookieEnabled: JSString = "cookieEnabled" - @usableFromInline static let cookieStore: JSString = "cookieStore" - @usableFromInline static let cookies: JSString = "cookies" @usableFromInline static let coords: JSString = "coords" - @usableFromInline static let copyBufferSubData: JSString = "copyBufferSubData" - @usableFromInline static let copyBufferToBuffer: JSString = "copyBufferToBuffer" - @usableFromInline static let copyBufferToTexture: JSString = "copyBufferToTexture" - @usableFromInline static let copyExternalImageToTexture: JSString = "copyExternalImageToTexture" - @usableFromInline static let copyFromChannel: JSString = "copyFromChannel" - @usableFromInline static let copyTexImage2D: JSString = "copyTexImage2D" - @usableFromInline static let copyTexSubImage2D: JSString = "copyTexSubImage2D" - @usableFromInline static let copyTexSubImage3D: JSString = "copyTexSubImage3D" - @usableFromInline static let copyTextureToBuffer: JSString = "copyTextureToBuffer" - @usableFromInline static let copyTextureToTexture: JSString = "copyTextureToTexture" @usableFromInline static let copyTo: JSString = "copyTo" - @usableFromInline static let copyToChannel: JSString = "copyToChannel" - @usableFromInline static let cornerPoints: JSString = "cornerPoints" @usableFromInline static let correspondingElement: JSString = "correspondingElement" @usableFromInline static let correspondingUseElement: JSString = "correspondingUseElement" - @usableFromInline static let corruptedVideoFrames: JSString = "corruptedVideoFrames" - @usableFromInline static let cos: JSString = "cos" - @usableFromInline static let count: JSString = "count" - @usableFromInline static let countReset: JSString = "countReset" - @usableFromInline static let counter: JSString = "counter" - @usableFromInline static let country: JSString = "country" - @usableFromInline static let cqb: JSString = "cqb" - @usableFromInline static let cqh: JSString = "cqh" - @usableFromInline static let cqi: JSString = "cqi" - @usableFromInline static let cqmax: JSString = "cqmax" - @usableFromInline static let cqmin: JSString = "cqmin" - @usableFromInline static let cqw: JSString = "cqw" - @usableFromInline static let create: JSString = "create" - @usableFromInline static let createAnalyser: JSString = "createAnalyser" - @usableFromInline static let createAnchor: JSString = "createAnchor" @usableFromInline static let createAttribute: JSString = "createAttribute" @usableFromInline static let createAttributeNS: JSString = "createAttributeNS" - @usableFromInline static let createBidirectionalStream: JSString = "createBidirectionalStream" - @usableFromInline static let createBindGroup: JSString = "createBindGroup" - @usableFromInline static let createBindGroupLayout: JSString = "createBindGroupLayout" - @usableFromInline static let createBiquadFilter: JSString = "createBiquadFilter" - @usableFromInline static let createBuffer: JSString = "createBuffer" - @usableFromInline static let createBufferSource: JSString = "createBufferSource" @usableFromInline static let createCDATASection: JSString = "createCDATASection" @usableFromInline static let createCaption: JSString = "createCaption" - @usableFromInline static let createChannelMerger: JSString = "createChannelMerger" - @usableFromInline static let createChannelSplitter: JSString = "createChannelSplitter" - @usableFromInline static let createCommandEncoder: JSString = "createCommandEncoder" @usableFromInline static let createComment: JSString = "createComment" - @usableFromInline static let createComputePipeline: JSString = "createComputePipeline" - @usableFromInline static let createComputePipelineAsync: JSString = "createComputePipelineAsync" @usableFromInline static let createConicGradient: JSString = "createConicGradient" - @usableFromInline static let createConstantSource: JSString = "createConstantSource" - @usableFromInline static let createContext: JSString = "createContext" - @usableFromInline static let createContextualFragment: JSString = "createContextualFragment" - @usableFromInline static let createConvolver: JSString = "createConvolver" - @usableFromInline static let createCubeLayer: JSString = "createCubeLayer" - @usableFromInline static let createCylinderLayer: JSString = "createCylinderLayer" - @usableFromInline static let createDataChannel: JSString = "createDataChannel" - @usableFromInline static let createDelay: JSString = "createDelay" @usableFromInline static let createDocument: JSString = "createDocument" @usableFromInline static let createDocumentFragment: JSString = "createDocumentFragment" @usableFromInline static let createDocumentType: JSString = "createDocumentType" - @usableFromInline static let createDynamicsCompressor: JSString = "createDynamicsCompressor" @usableFromInline static let createElement: JSString = "createElement" @usableFromInline static let createElementNS: JSString = "createElementNS" - @usableFromInline static let createEquirectLayer: JSString = "createEquirectLayer" @usableFromInline static let createEvent: JSString = "createEvent" - @usableFromInline static let createFramebuffer: JSString = "createFramebuffer" - @usableFromInline static let createGain: JSString = "createGain" - @usableFromInline static let createHTML: JSString = "createHTML" @usableFromInline static let createHTMLDocument: JSString = "createHTMLDocument" - @usableFromInline static let createIIRFilter: JSString = "createIIRFilter" @usableFromInline static let createImageBitmap: JSString = "createImageBitmap" @usableFromInline static let createImageData: JSString = "createImageData" - @usableFromInline static let createIndex: JSString = "createIndex" @usableFromInline static let createLinearGradient: JSString = "createLinearGradient" - @usableFromInline static let createMediaElementSource: JSString = "createMediaElementSource" - @usableFromInline static let createMediaKeys: JSString = "createMediaKeys" - @usableFromInline static let createMediaStreamDestination: JSString = "createMediaStreamDestination" - @usableFromInline static let createMediaStreamSource: JSString = "createMediaStreamSource" - @usableFromInline static let createMediaStreamTrackSource: JSString = "createMediaStreamTrackSource" - @usableFromInline static let createObjectStore: JSString = "createObjectStore" @usableFromInline static let createObjectURL: JSString = "createObjectURL" - @usableFromInline static let createOscillator: JSString = "createOscillator" - @usableFromInline static let createPanner: JSString = "createPanner" @usableFromInline static let createPattern: JSString = "createPattern" - @usableFromInline static let createPeriodicWave: JSString = "createPeriodicWave" - @usableFromInline static let createPipelineLayout: JSString = "createPipelineLayout" @usableFromInline static let createProcessingInstruction: JSString = "createProcessingInstruction" - @usableFromInline static let createProgram: JSString = "createProgram" - @usableFromInline static let createProjectionLayer: JSString = "createProjectionLayer" - @usableFromInline static let createQuadLayer: JSString = "createQuadLayer" - @usableFromInline static let createQuery: JSString = "createQuery" - @usableFromInline static let createQueryEXT: JSString = "createQueryEXT" - @usableFromInline static let createQuerySet: JSString = "createQuerySet" @usableFromInline static let createRadialGradient: JSString = "createRadialGradient" @usableFromInline static let createRange: JSString = "createRange" - @usableFromInline static let createReader: JSString = "createReader" - @usableFromInline static let createRenderBundleEncoder: JSString = "createRenderBundleEncoder" - @usableFromInline static let createRenderPipeline: JSString = "createRenderPipeline" - @usableFromInline static let createRenderPipelineAsync: JSString = "createRenderPipelineAsync" - @usableFromInline static let createRenderbuffer: JSString = "createRenderbuffer" @usableFromInline static let createSVGAngle: JSString = "createSVGAngle" @usableFromInline static let createSVGLength: JSString = "createSVGLength" @usableFromInline static let createSVGMatrix: JSString = "createSVGMatrix" @@ -1751,517 +644,170 @@ import JavaScriptKit @usableFromInline static let createSVGRect: JSString = "createSVGRect" @usableFromInline static let createSVGTransform: JSString = "createSVGTransform" @usableFromInline static let createSVGTransformFromMatrix: JSString = "createSVGTransformFromMatrix" - @usableFromInline static let createSampler: JSString = "createSampler" - @usableFromInline static let createScript: JSString = "createScript" - @usableFromInline static let createScriptProcessor: JSString = "createScriptProcessor" - @usableFromInline static let createScriptURL: JSString = "createScriptURL" - @usableFromInline static let createSession: JSString = "createSession" - @usableFromInline static let createShader: JSString = "createShader" - @usableFromInline static let createShaderModule: JSString = "createShaderModule" - @usableFromInline static let createStereoPanner: JSString = "createStereoPanner" @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 createTransformFeedback: JSString = "createTransformFeedback" - @usableFromInline static let createUnidirectionalStream: JSString = "createUnidirectionalStream" - @usableFromInline static let createVertexArray: JSString = "createVertexArray" - @usableFromInline static let createVertexArrayOES: JSString = "createVertexArrayOES" - @usableFromInline static let createView: JSString = "createView" - @usableFromInline static let createWaveShaper: JSString = "createWaveShaper" - @usableFromInline static let createWritable: JSString = "createWritable" - @usableFromInline static let creationTime: JSString = "creationTime" - @usableFromInline static let credProps: JSString = "credProps" - @usableFromInline static let credential: JSString = "credential" - @usableFromInline static let credentialIds: JSString = "credentialIds" - @usableFromInline static let credentialType: JSString = "credentialType" @usableFromInline static let credentials: JSString = "credentials" - @usableFromInline static let cropTo: JSString = "cropTo" @usableFromInline static let crossOrigin: JSString = "crossOrigin" @usableFromInline static let crossOriginIsolated: JSString = "crossOriginIsolated" - @usableFromInline static let crv: JSString = "crv" - @usableFromInline static let crypto: JSString = "crypto" - @usableFromInline static let csp: JSString = "csp" @usableFromInline static let cssFloat: JSString = "cssFloat" @usableFromInline static let cssRules: JSString = "cssRules" @usableFromInline static let cssText: JSString = "cssText" @usableFromInline static let ctrlKey: JSString = "ctrlKey" @usableFromInline static let cues: JSString = "cues" - @usableFromInline static let cullFace: JSString = "cullFace" - @usableFromInline static let cullMode: JSString = "cullMode" - @usableFromInline static let currency: JSString = "currency" - @usableFromInline static let currentDirection: JSString = "currentDirection" - @usableFromInline static let currentEntry: JSString = "currentEntry" @usableFromInline static let currentIteration: JSString = "currentIteration" - @usableFromInline static let currentLocalDescription: JSString = "currentLocalDescription" @usableFromInline static let currentNode: JSString = "currentNode" - @usableFromInline static let currentRect: JSString = "currentRect" - @usableFromInline static let currentRemoteDescription: JSString = "currentRemoteDescription" - @usableFromInline static let currentRoundTripTime: JSString = "currentRoundTripTime" @usableFromInline static let currentScale: JSString = "currentScale" @usableFromInline static let currentScript: JSString = "currentScript" @usableFromInline static let currentSrc: JSString = "currentSrc" @usableFromInline static let currentTarget: JSString = "currentTarget" @usableFromInline static let currentTime: JSString = "currentTime" @usableFromInline static let currentTranslate: JSString = "currentTranslate" - @usableFromInline static let cursor: JSString = "cursor" - @usableFromInline static let curve: JSString = "curve" @usableFromInline static let customElements: JSString = "customElements" @usableFromInline static let customError: JSString = "customError" - @usableFromInline static let customSections: JSString = "customSections" @usableFromInline static let cx: JSString = "cx" @usableFromInline static let cy: JSString = "cy" @usableFromInline static let d: JSString = "d" @usableFromInline static let data: JSString = "data" - @usableFromInline static let dataBits: JSString = "dataBits" - @usableFromInline static let dataCarrierDetect: JSString = "dataCarrierDetect" - @usableFromInline static let dataChannelIdentifier: JSString = "dataChannelIdentifier" - @usableFromInline static let dataChannelsAccepted: JSString = "dataChannelsAccepted" - @usableFromInline static let dataChannelsClosed: JSString = "dataChannelsClosed" - @usableFromInline static let dataChannelsOpened: JSString = "dataChannelsOpened" - @usableFromInline static let dataChannelsRequested: JSString = "dataChannelsRequested" - @usableFromInline static let dataFormatPreference: JSString = "dataFormatPreference" - @usableFromInline static let dataPrefix: JSString = "dataPrefix" - @usableFromInline static let dataSetReady: JSString = "dataSetReady" - @usableFromInline static let dataTerminalReady: JSString = "dataTerminalReady" @usableFromInline static let dataTransfer: JSString = "dataTransfer" - @usableFromInline static let databases: JSString = "databases" - @usableFromInline static let datagrams: JSString = "datagrams" @usableFromInline static let dataset: JSString = "dataset" @usableFromInline static let dateTime: JSString = "dateTime" - @usableFromInline static let db: JSString = "db" - @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 decodedBodySize: JSString = "decodedBodySize" @usableFromInline static let decoderConfig: JSString = "decoderConfig" - @usableFromInline static let decoderImplementation: JSString = "decoderImplementation" @usableFromInline static let decoding: JSString = "decoding" - @usableFromInline static let decodingInfo: JSString = "decodingInfo" - @usableFromInline static let decrypt: JSString = "decrypt" @usableFromInline static let `default`: JSString = "default" @usableFromInline static let defaultChecked: JSString = "defaultChecked" - @usableFromInline static let defaultFrameRate: JSString = "defaultFrameRate" @usableFromInline static let defaultMuted: JSString = "defaultMuted" @usableFromInline static let defaultPlaybackRate: JSString = "defaultPlaybackRate" - @usableFromInline static let defaultPolicy: JSString = "defaultPolicy" @usableFromInline static let defaultPrevented: JSString = "defaultPrevented" - @usableFromInline static let defaultQueue: JSString = "defaultQueue" - @usableFromInline static let defaultRequest: JSString = "defaultRequest" - @usableFromInline static let defaultSampleRate: JSString = "defaultSampleRate" @usableFromInline static let defaultSelected: JSString = "defaultSelected" @usableFromInline static let defaultValue: JSString = "defaultValue" @usableFromInline static let defaultView: JSString = "defaultView" @usableFromInline static let `defer`: JSString = "defer" @usableFromInline static let define: JSString = "define" - @usableFromInline static let deg: JSString = "deg" - @usableFromInline static let degradationPreference: JSString = "degradationPreference" @usableFromInline static let delay: JSString = "delay" - @usableFromInline static let delayTime: JSString = "delayTime" @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 deleteDatabase: JSString = "deleteDatabase" - @usableFromInline static let deleteFramebuffer: JSString = "deleteFramebuffer" - @usableFromInline static let deleteFromDocument: JSString = "deleteFromDocument" - @usableFromInline static let deleteIndex: JSString = "deleteIndex" @usableFromInline static let deleteMedium: JSString = "deleteMedium" - @usableFromInline static let deleteObjectStore: JSString = "deleteObjectStore" - @usableFromInline static let deleteProgram: JSString = "deleteProgram" - @usableFromInline static let deleteQuery: JSString = "deleteQuery" - @usableFromInline static let deleteQueryEXT: JSString = "deleteQueryEXT" - @usableFromInline static let deleteRenderbuffer: JSString = "deleteRenderbuffer" @usableFromInline static let deleteRow: JSString = "deleteRow" @usableFromInline static let deleteRule: JSString = "deleteRule" - @usableFromInline static let deleteSampler: JSString = "deleteSampler" - @usableFromInline static let deleteShader: JSString = "deleteShader" - @usableFromInline static let deleteSync: JSString = "deleteSync" @usableFromInline static let deleteTFoot: JSString = "deleteTFoot" @usableFromInline static let deleteTHead: JSString = "deleteTHead" - @usableFromInline static let deleteTexture: JSString = "deleteTexture" - @usableFromInline static let deleteTransformFeedback: JSString = "deleteTransformFeedback" - @usableFromInline static let deleteVertexArray: JSString = "deleteVertexArray" - @usableFromInline static let deleteVertexArrayOES: JSString = "deleteVertexArrayOES" - @usableFromInline static let deleted: JSString = "deleted" @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 dependencies: JSString = "dependencies" - @usableFromInline static let dependentLocality: JSString = "dependentLocality" - @usableFromInline static let depth: JSString = "depth" - @usableFromInline static let depthBias: JSString = "depthBias" - @usableFromInline static let depthBiasClamp: JSString = "depthBiasClamp" - @usableFromInline static let depthBiasSlopeScale: JSString = "depthBiasSlopeScale" - @usableFromInline static let depthClearValue: JSString = "depthClearValue" - @usableFromInline static let depthCompare: JSString = "depthCompare" - @usableFromInline static let depthDataFormat: JSString = "depthDataFormat" - @usableFromInline static let depthFailOp: JSString = "depthFailOp" - @usableFromInline static let depthFar: JSString = "depthFar" - @usableFromInline static let depthFormat: JSString = "depthFormat" - @usableFromInline static let depthFunc: JSString = "depthFunc" - @usableFromInline static let depthLoadOp: JSString = "depthLoadOp" - @usableFromInline static let depthMask: JSString = "depthMask" - @usableFromInline static let depthNear: JSString = "depthNear" - @usableFromInline static let depthOrArrayLayers: JSString = "depthOrArrayLayers" - @usableFromInline static let depthRange: JSString = "depthRange" - @usableFromInline static let depthReadOnly: JSString = "depthReadOnly" - @usableFromInline static let depthSensing: JSString = "depthSensing" - @usableFromInline static let depthStencil: JSString = "depthStencil" - @usableFromInline static let depthStencilAttachment: JSString = "depthStencilAttachment" - @usableFromInline static let depthStencilFormat: JSString = "depthStencilFormat" - @usableFromInline static let depthStencilTexture: JSString = "depthStencilTexture" - @usableFromInline static let depthStoreOp: JSString = "depthStoreOp" - @usableFromInline static let depthUsage: JSString = "depthUsage" - @usableFromInline static let depthWriteEnabled: JSString = "depthWriteEnabled" - @usableFromInline static let deriveBits: JSString = "deriveBits" - @usableFromInline static let deriveKey: JSString = "deriveKey" - @usableFromInline static let descentOverride: JSString = "descentOverride" @usableFromInline static let description: JSString = "description" - @usableFromInline static let descriptor: JSString = "descriptor" @usableFromInline static let deselectAll: JSString = "deselectAll" @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 destroy: JSString = "destroy" @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 details: JSString = "details" - @usableFromInline static let detect: JSString = "detect" - @usableFromInline static let detune: JSString = "detune" - @usableFromInline static let device: JSString = "device" - @usableFromInline static let deviceClass: JSString = "deviceClass" @usableFromInline static let deviceId: JSString = "deviceId" - @usableFromInline static let deviceMemory: JSString = "deviceMemory" - @usableFromInline static let devicePixelContentBoxSize: JSString = "devicePixelContentBoxSize" - @usableFromInline static let devicePixelRatio: JSString = "devicePixelRatio" - @usableFromInline static let devicePosture: JSString = "devicePosture" - @usableFromInline static let devicePreference: JSString = "devicePreference" - @usableFromInline static let deviceProtocol: JSString = "deviceProtocol" - @usableFromInline static let deviceSubclass: JSString = "deviceSubclass" - @usableFromInline static let deviceVersionMajor: JSString = "deviceVersionMajor" - @usableFromInline static let deviceVersionMinor: JSString = "deviceVersionMinor" - @usableFromInline static let deviceVersionSubminor: JSString = "deviceVersionSubminor" - @usableFromInline static let devices: JSString = "devices" - @usableFromInline static let diameter: JSString = "diameter" - @usableFromInline static let didTimeout: JSString = "didTimeout" - @usableFromInline static let diffuseConstant: JSString = "diffuseConstant" - @usableFromInline static let digest: JSString = "digest" - @usableFromInline static let dilations: JSString = "dilations" - @usableFromInline static let dimension: JSString = "dimension" - @usableFromInline static let dimensions: JSString = "dimensions" @usableFromInline static let dir: JSString = "dir" @usableFromInline static let dirName: JSString = "dirName" @usableFromInline static let direction: JSString = "direction" - @usableFromInline static let dirxml: JSString = "dirxml" @usableFromInline static let disable: JSString = "disable" - @usableFromInline static let disableNormalization: JSString = "disableNormalization" - @usableFromInline static let disablePictureInPicture: JSString = "disablePictureInPicture" - @usableFromInline static let disableRemotePlayback: JSString = "disableRemotePlayback" - @usableFromInline static let disableVertexAttribArray: JSString = "disableVertexAttribArray" @usableFromInline static let disabled: JSString = "disabled" - @usableFromInline static let disableiOES: JSString = "disableiOES" - @usableFromInline static let dischargingTime: JSString = "dischargingTime" @usableFromInline static let disconnect: JSString = "disconnect" - @usableFromInline static let dispatch: JSString = "dispatch" @usableFromInline static let dispatchEvent: JSString = "dispatchEvent" - @usableFromInline static let dispatchIndirect: JSString = "dispatchIndirect" - @usableFromInline static let display: JSString = "display" @usableFromInline static let displayAspectHeight: JSString = "displayAspectHeight" @usableFromInline static let displayAspectWidth: JSString = "displayAspectWidth" @usableFromInline static let displayHeight: JSString = "displayHeight" - @usableFromInline static let displayItems: JSString = "displayItems" - @usableFromInline static let displayName: JSString = "displayName" - @usableFromInline static let displaySurface: JSString = "displaySurface" @usableFromInline static let displayWidth: JSString = "displayWidth" - @usableFromInline static let disposition: JSString = "disposition" - @usableFromInline static let distance: JSString = "distance" - @usableFromInline static let distanceModel: JSString = "distanceModel" - @usableFromInline static let distinctiveIdentifier: JSString = "distinctiveIdentifier" - @usableFromInline static let div: JSString = "div" - @usableFromInline static let divisor: JSString = "divisor" @usableFromInline static let doctype: JSString = "doctype" @usableFromInline static let document: JSString = "document" @usableFromInline static let documentElement: JSString = "documentElement" @usableFromInline static let documentURI: JSString = "documentURI" - @usableFromInline static let documentURL: JSString = "documentURL" - @usableFromInline static let domComplete: JSString = "domComplete" - @usableFromInline static let domContentLoadedEventEnd: JSString = "domContentLoadedEventEnd" - @usableFromInline static let domContentLoadedEventStart: JSString = "domContentLoadedEventStart" - @usableFromInline static let domInteractive: JSString = "domInteractive" - @usableFromInline static let domLoading: JSString = "domLoading" - @usableFromInline static let domOverlay: JSString = "domOverlay" - @usableFromInline static let domOverlayState: JSString = "domOverlayState" @usableFromInline static let domain: JSString = "domain" - @usableFromInline static let domainLookupEnd: JSString = "domainLookupEnd" - @usableFromInline static let domainLookupStart: JSString = "domainLookupStart" - @usableFromInline static let dominantBaseline: JSString = "dominantBaseline" @usableFromInline static let done: JSString = "done" - @usableFromInline static let downlink: JSString = "downlink" - @usableFromInline static let downlinkMax: JSString = "downlinkMax" @usableFromInline static let download: JSString = "download" - @usableFromInline static let downloadTotal: JSString = "downloadTotal" - @usableFromInline static let downloaded: JSString = "downloaded" - @usableFromInline static let dp: JSString = "dp" - @usableFromInline static let dpcm: JSString = "dpcm" - @usableFromInline static let dpi: JSString = "dpi" - @usableFromInline static let dppx: JSString = "dppx" - @usableFromInline static let dq: JSString = "dq" @usableFromInline static let draggable: JSString = "draggable" - @usableFromInline static let draw: JSString = "draw" - @usableFromInline static let drawArrays: JSString = "drawArrays" - @usableFromInline static let drawArraysInstanced: JSString = "drawArraysInstanced" - @usableFromInline static let drawArraysInstancedANGLE: JSString = "drawArraysInstancedANGLE" - @usableFromInline static let drawArraysInstancedBaseInstanceWEBGL: JSString = "drawArraysInstancedBaseInstanceWEBGL" - @usableFromInline static let drawBuffers: JSString = "drawBuffers" - @usableFromInline static let drawBuffersWEBGL: JSString = "drawBuffersWEBGL" - @usableFromInline static let drawElements: JSString = "drawElements" - @usableFromInline static let drawElementsInstanced: JSString = "drawElementsInstanced" - @usableFromInline static let drawElementsInstancedANGLE: JSString = "drawElementsInstancedANGLE" - @usableFromInline static let drawElementsInstancedBaseVertexBaseInstanceWEBGL: JSString = "drawElementsInstancedBaseVertexBaseInstanceWEBGL" @usableFromInline static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded" @usableFromInline static let drawImage: JSString = "drawImage" - @usableFromInline static let drawIndexed: JSString = "drawIndexed" - @usableFromInline static let drawIndexedIndirect: JSString = "drawIndexedIndirect" - @usableFromInline static let drawIndirect: JSString = "drawIndirect" - @usableFromInline static let drawRangeElements: JSString = "drawRangeElements" - @usableFromInline static let drawingBufferHeight: JSString = "drawingBufferHeight" - @usableFromInline static let drawingBufferWidth: JSString = "drawingBufferWidth" - @usableFromInline static let dropAttributes: JSString = "dropAttributes" @usableFromInline static let dropEffect: JSString = "dropEffect" - @usableFromInline static let dropElements: JSString = "dropElements" - @usableFromInline static let droppedEntriesCount: JSString = "droppedEntriesCount" - @usableFromInline static let droppedVideoFrames: JSString = "droppedVideoFrames" - @usableFromInline static let dstFactor: JSString = "dstFactor" - @usableFromInline static let dtlsCipher: JSString = "dtlsCipher" - @usableFromInline static let dtlsState: JSString = "dtlsState" - @usableFromInline static let dtmf: JSString = "dtmf" - @usableFromInline static let durability: JSString = "durability" @usableFromInline static let duration: JSString = "duration" - @usableFromInline static let durationThreshold: JSString = "durationThreshold" - @usableFromInline static let dvb: JSString = "dvb" - @usableFromInline static let dvh: JSString = "dvh" - @usableFromInline static let dvi: JSString = "dvi" - @usableFromInline static let dvmax: JSString = "dvmax" - @usableFromInline static let dvmin: JSString = "dvmin" - @usableFromInline static let dvw: JSString = "dvw" @usableFromInline static let dx: JSString = "dx" @usableFromInline static let dy: JSString = "dy" @usableFromInline static let e: JSString = "e" @usableFromInline static let easing: JSString = "easing" @usableFromInline static let echoCancellation: JSString = "echoCancellation" - @usableFromInline static let echoReturnLoss: JSString = "echoReturnLoss" - @usableFromInline static let echoReturnLossEnhancement: JSString = "echoReturnLossEnhancement" - @usableFromInline static let edge: JSString = "edge" - @usableFromInline static let edgeMode: JSString = "edgeMode" - @usableFromInline static let editContext: JSString = "editContext" @usableFromInline static let effect: JSString = "effect" @usableFromInline static let effectAllowed: JSString = "effectAllowed" - @usableFromInline static let effectiveDirective: JSString = "effectiveDirective" - @usableFromInline static let effectiveType: JSString = "effectiveType" - @usableFromInline static let elapsedTime: JSString = "elapsedTime" @usableFromInline static let element: JSString = "element" - @usableFromInline static let elementFromPoint: JSString = "elementFromPoint" - @usableFromInline static let elementSources: JSString = "elementSources" - @usableFromInline static let elementTiming: JSString = "elementTiming" @usableFromInline static let elements: JSString = "elements" - @usableFromInline static let elementsFromPoint: JSString = "elementsFromPoint" - @usableFromInline static let elevation: JSString = "elevation" @usableFromInline static let ellipse: JSString = "ellipse" - @usableFromInline static let elu: JSString = "elu" - @usableFromInline static let em: JSString = "em" @usableFromInline static let emHeightAscent: JSString = "emHeightAscent" @usableFromInline static let emHeightDescent: JSString = "emHeightDescent" - @usableFromInline static let email: JSString = "email" @usableFromInline static let embeds: JSString = "embeds" - @usableFromInline static let empty: JSString = "empty" - @usableFromInline static let emptyHTML: JSString = "emptyHTML" - @usableFromInline static let emptyScript: JSString = "emptyScript" - @usableFromInline static let emulatedPosition: JSString = "emulatedPosition" @usableFromInline static let enable: JSString = "enable" - @usableFromInline static let enableHighAccuracy: JSString = "enableHighAccuracy" - @usableFromInline static let enableVertexAttribArray: JSString = "enableVertexAttribArray" @usableFromInline static let enabled: JSString = "enabled" @usableFromInline static let enabledPlugin: JSString = "enabledPlugin" - @usableFromInline static let enableiOES: JSString = "enableiOES" @usableFromInline static let encode: JSString = "encode" - @usableFromInline static let encodeInto: JSString = "encodeInto" @usableFromInline static let encodeQueueSize: JSString = "encodeQueueSize" - @usableFromInline static let encodedBodySize: JSString = "encodedBodySize" - @usableFromInline static let encoderImplementation: JSString = "encoderImplementation" @usableFromInline static let encoding: JSString = "encoding" - @usableFromInline static let encodingInfo: JSString = "encodingInfo" - @usableFromInline static let encodings: JSString = "encodings" - @usableFromInline static let encrypt: JSString = "encrypt" - @usableFromInline static let encrypted: JSString = "encrypted" - @usableFromInline static let encryptionScheme: JSString = "encryptionScheme" @usableFromInline static let enctype: JSString = "enctype" @usableFromInline static let end: JSString = "end" @usableFromInline static let endContainer: JSString = "endContainer" @usableFromInline static let endDelay: JSString = "endDelay" - @usableFromInline static let endElement: JSString = "endElement" - @usableFromInline static let endElementAt: JSString = "endElementAt" - @usableFromInline static let endOcclusionQuery: JSString = "endOcclusionQuery" @usableFromInline static let endOfStream: JSString = "endOfStream" @usableFromInline static let endOffset: JSString = "endOffset" - @usableFromInline static let endQuery: JSString = "endQuery" - @usableFromInline static let endQueryEXT: JSString = "endQueryEXT" @usableFromInline static let endTime: JSString = "endTime" - @usableFromInline static let endTransformFeedback: JSString = "endTransformFeedback" @usableFromInline static let ended: JSString = "ended" @usableFromInline static let endings: JSString = "endings" - @usableFromInline static let endpoint: JSString = "endpoint" - @usableFromInline static let endpointNumber: JSString = "endpointNumber" - @usableFromInline static let endpoints: JSString = "endpoints" @usableFromInline static let enqueue: JSString = "enqueue" @usableFromInline static let enterKeyHint: JSString = "enterKeyHint" - @usableFromInline static let entityTypes: JSString = "entityTypes" - @usableFromInline static let entries: JSString = "entries" - @usableFromInline static let entryPoint: JSString = "entryPoint" - @usableFromInline static let entryType: JSString = "entryType" - @usableFromInline static let entryTypes: JSString = "entryTypes" @usableFromInline static let enumerateDevices: JSString = "enumerateDevices" - @usableFromInline static let environmentBlendMode: JSString = "environmentBlendMode" - @usableFromInline static let epsilon: JSString = "epsilon" - @usableFromInline static let equals: JSString = "equals" @usableFromInline static let error: JSString = "error" - @usableFromInline static let errorCode: JSString = "errorCode" - @usableFromInline static let errorDetail: JSString = "errorDetail" - @usableFromInline static let errorText: JSString = "errorText" - @usableFromInline static let errorType: JSString = "errorType" @usableFromInline static let escape: JSString = "escape" - @usableFromInline static let estimate: JSString = "estimate" - @usableFromInline static let estimatedPlayoutTimestamp: JSString = "estimatedPlayoutTimestamp" @usableFromInline static let evaluate: JSString = "evaluate" @usableFromInline static let event: JSString = "event" - @usableFromInline static let eventCounts: JSString = "eventCounts" @usableFromInline static let eventPhase: JSString = "eventPhase" - @usableFromInline static let ex: JSString = "ex" @usableFromInline static let exact: JSString = "exact" - @usableFromInline static let excludeAcceptAllOption: JSString = "excludeAcceptAllOption" - @usableFromInline static let excludeCredentials: JSString = "excludeCredentials" - @usableFromInline static let exclusive: JSString = "exclusive" - @usableFromInline static let exec: JSString = "exec" @usableFromInline static let execCommand: JSString = "execCommand" - @usableFromInline static let executeBundles: JSString = "executeBundles" - @usableFromInline static let exitFullscreen: JSString = "exitFullscreen" - @usableFromInline static let exitPictureInPicture: JSString = "exitPictureInPicture" - @usableFromInline static let exitPointerLock: JSString = "exitPointerLock" - @usableFromInline static let exp: JSString = "exp" - @usableFromInline static let expectedDisplayTime: JSString = "expectedDisplayTime" - @usableFromInline static let expectedImprovement: JSString = "expectedImprovement" - @usableFromInline static let expiration: JSString = "expiration" - @usableFromInline static let expirationTime: JSString = "expirationTime" - @usableFromInline static let expired: JSString = "expired" - @usableFromInline static let expires: JSString = "expires" - @usableFromInline static let exponent: JSString = "exponent" - @usableFromInline static let exponentialRampToValueAtTime: JSString = "exponentialRampToValueAtTime" - @usableFromInline static let exportKey: JSString = "exportKey" - @usableFromInline static let exports: JSString = "exports" - @usableFromInline static let exposureCompensation: JSString = "exposureCompensation" - @usableFromInline static let exposureMode: JSString = "exposureMode" - @usableFromInline static let exposureTime: JSString = "exposureTime" - @usableFromInline static let ext: JSString = "ext" - @usableFromInline static let extend: JSString = "extend" @usableFromInline static let extends: JSString = "extends" - @usableFromInline static let extensions: JSString = "extensions" @usableFromInline static let external: JSString = "external" - @usableFromInline static let externalTexture: JSString = "externalTexture" @usableFromInline static let extractContents: JSString = "extractContents" - @usableFromInline static let extractable: JSString = "extractable" - @usableFromInline static let eye: JSString = "eye" @usableFromInline static let f: JSString = "f" @usableFromInline static let face: JSString = "face" @usableFromInline static let facingMode: JSString = "facingMode" - @usableFromInline static let factors: JSString = "factors" - @usableFromInline static let failIfMajorPerformanceCaveat: JSString = "failIfMajorPerformanceCaveat" - @usableFromInline static let failOp: JSString = "failOp" - @usableFromInline static let failureReason: JSString = "failureReason" - @usableFromInline static let fallback: JSString = "fallback" - @usableFromInline static let family: JSString = "family" - @usableFromInline static let fastMode: JSString = "fastMode" @usableFromInline static let fastSeek: JSString = "fastSeek" - @usableFromInline static let fatal: JSString = "fatal" - @usableFromInline static let featureId: JSString = "featureId" - @usableFromInline static let featureReports: JSString = "featureReports" - @usableFromInline static let featureSettings: JSString = "featureSettings" - @usableFromInline static let features: JSString = "features" - @usableFromInline static let fecPacketsDiscarded: JSString = "fecPacketsDiscarded" - @usableFromInline static let fecPacketsReceived: JSString = "fecPacketsReceived" - @usableFromInline static let fecPacketsSent: JSString = "fecPacketsSent" - @usableFromInline static let federated: JSString = "federated" - @usableFromInline static let feedback: JSString = "feedback" - @usableFromInline static let feedforward: JSString = "feedforward" - @usableFromInline static let fenceSync: JSString = "fenceSync" @usableFromInline static let fetch: JSString = "fetch" - @usableFromInline static let fetchStart: JSString = "fetchStart" - @usableFromInline static let fetchpriority: JSString = "fetchpriority" - @usableFromInline static let fftSize: JSString = "fftSize" @usableFromInline static let fgColor: JSString = "fgColor" @usableFromInline static let filename: JSString = "filename" @usableFromInline static let files: JSString = "files" - @usableFromInline static let filesystem: JSString = "filesystem" @usableFromInline static let fill: JSString = "fill" - @usableFromInline static let fillJointRadii: JSString = "fillJointRadii" - @usableFromInline static let fillLightMode: JSString = "fillLightMode" - @usableFromInline static let fillPoses: JSString = "fillPoses" @usableFromInline static let fillRect: JSString = "fillRect" @usableFromInline static let fillStyle: JSString = "fillStyle" @usableFromInline static let fillText: JSString = "fillText" @usableFromInline static let filter: JSString = "filter" - @usableFromInline static let filterLayout: JSString = "filterLayout" - @usableFromInline static let filterUnits: JSString = "filterUnits" - @usableFromInline static let filters: JSString = "filters" - @usableFromInline static let findRule: JSString = "findRule" - @usableFromInline static let fingerprint: JSString = "fingerprint" - @usableFromInline static let fingerprintAlgorithm: JSString = "fingerprintAlgorithm" @usableFromInline static let finish: JSString = "finish" @usableFromInline static let finished: JSString = "finished" - @usableFromInline static let firCount: JSString = "firCount" - @usableFromInline static let firesTouchEvents: JSString = "firesTouchEvents" @usableFromInline static let firstChild: JSString = "firstChild" @usableFromInline static let firstElementChild: JSString = "firstElementChild" - @usableFromInline static let firstEmptyRegionIndex: JSString = "firstEmptyRegionIndex" - @usableFromInline static let firstRequestTimestamp: JSString = "firstRequestTimestamp" - @usableFromInline static let fixedBlockSize: JSString = "fixedBlockSize" - @usableFromInline static let fixedFoveation: JSString = "fixedFoveation" - @usableFromInline static let fixedInlineSize: JSString = "fixedInlineSize" @usableFromInline static let flatten: JSString = "flatten" - @usableFromInline static let flex: JSString = "flex" @usableFromInline static let flipX: JSString = "flipX" @usableFromInline static let flipY: JSString = "flipY" - @usableFromInline static let floor: JSString = "floor" - @usableFromInline static let flowControl: JSString = "flowControl" @usableFromInline static let flush: JSString = "flush" @usableFromInline static let focus: JSString = "focus" - @usableFromInline static let focusDistance: JSString = "focusDistance" - @usableFromInline static let focusMode: JSString = "focusMode" - @usableFromInline static let focusNode: JSString = "focusNode" - @usableFromInline static let focusOffset: JSString = "focusOffset" - @usableFromInline static let focusableAreas: JSString = "focusableAreas" @usableFromInline static let font: JSString = "font" @usableFromInline static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent" @usableFromInline static let fontBoundingBoxDescent: JSString = "fontBoundingBoxDescent" - @usableFromInline static let fontFamily: JSString = "fontFamily" @usableFromInline static let fontKerning: JSString = "fontKerning" @usableFromInline static let fontStretch: JSString = "fontStretch" @usableFromInline static let fontVariantCaps: JSString = "fontVariantCaps" - @usableFromInline static let fontfaces: JSString = "fontfaces" - @usableFromInline static let fonts: JSString = "fonts" - @usableFromInline static let force: JSString = "force" - @usableFromInline static let forceFallbackAdapter: JSString = "forceFallbackAdapter" @usableFromInline static let forceRedraw: JSString = "forceRedraw" - @usableFromInline static let forget: JSString = "forget" @usableFromInline static let form: JSString = "form" @usableFromInline static let formAction: JSString = "formAction" @usableFromInline static let formData: JSString = "formData" @@ -2270,157 +816,51 @@ import JavaScriptKit @usableFromInline static let formNoValidate: JSString = "formNoValidate" @usableFromInline static let formTarget: JSString = "formTarget" @usableFromInline static let format: JSString = "format" - @usableFromInline static let formats: JSString = "formats" @usableFromInline static let forms: JSString = "forms" @usableFromInline static let forward: JSString = "forward" - @usableFromInline static let forwardX: JSString = "forwardX" - @usableFromInline static let forwardY: JSString = "forwardY" - @usableFromInline static let forwardZ: JSString = "forwardZ" - @usableFromInline static let foundation: JSString = "foundation" @usableFromInline static let fr: JSString = "fr" - @usableFromInline static let fractionLost: JSString = "fractionLost" - @usableFromInline static let fragment: JSString = "fragment" - @usableFromInline static let fragmentDirective: JSString = "fragmentDirective" @usableFromInline static let frame: JSString = "frame" - @usableFromInline static let frameBitDepth: JSString = "frameBitDepth" @usableFromInline static let frameBorder: JSString = "frameBorder" @usableFromInline static let frameCount: JSString = "frameCount" @usableFromInline static let frameElement: JSString = "frameElement" - @usableFromInline static let frameHeight: JSString = "frameHeight" - @usableFromInline static let frameId: JSString = "frameId" @usableFromInline static let frameIndex: JSString = "frameIndex" @usableFromInline static let frameOffset: JSString = "frameOffset" @usableFromInline static let frameRate: JSString = "frameRate" - @usableFromInline static let frameWidth: JSString = "frameWidth" - @usableFromInline static let framebuffer: JSString = "framebuffer" - @usableFromInline static let framebufferHeight: JSString = "framebufferHeight" - @usableFromInline static let framebufferRenderbuffer: JSString = "framebufferRenderbuffer" - @usableFromInline static let framebufferScaleFactor: JSString = "framebufferScaleFactor" - @usableFromInline static let framebufferTexture2D: JSString = "framebufferTexture2D" - @usableFromInline static let framebufferTextureLayer: JSString = "framebufferTextureLayer" - @usableFromInline static let framebufferTextureMultiviewOVR: JSString = "framebufferTextureMultiviewOVR" - @usableFromInline static let framebufferWidth: JSString = "framebufferWidth" @usableFromInline static let framerate: JSString = "framerate" @usableFromInline static let frames: JSString = "frames" - @usableFromInline static let framesDecoded: JSString = "framesDecoded" - @usableFromInline static let framesDiscardedOnSend: JSString = "framesDiscardedOnSend" - @usableFromInline static let framesDropped: JSString = "framesDropped" - @usableFromInline static let framesEncoded: JSString = "framesEncoded" - @usableFromInline static let framesPerSecond: JSString = "framesPerSecond" - @usableFromInline static let framesReceived: JSString = "framesReceived" - @usableFromInline static let framesSent: JSString = "framesSent" - @usableFromInline static let freeTrialPeriod: JSString = "freeTrialPeriod" - @usableFromInline static let frequency: JSString = "frequency" - @usableFromInline static let frequencyBinCount: JSString = "frequencyBinCount" - @usableFromInline static let from: JSString = "from" - @usableFromInline static let fromBox: JSString = "fromBox" @usableFromInline static let fromFloat32Array: JSString = "fromFloat32Array" @usableFromInline static let fromFloat64Array: JSString = "fromFloat64Array" - @usableFromInline static let fromLiteral: JSString = "fromLiteral" @usableFromInline static let fromMatrix: JSString = "fromMatrix" @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 fullFramesLost: JSString = "fullFramesLost" - @usableFromInline static let fullName: JSString = "fullName" - @usableFromInline static let fullPath: JSString = "fullPath" @usableFromInline static let fullRange: JSString = "fullRange" - @usableFromInline static let fullVersionList: JSString = "fullVersionList" - @usableFromInline static let fullscreen: JSString = "fullscreen" - @usableFromInline static let fullscreenElement: JSString = "fullscreenElement" - @usableFromInline static let fullscreenEnabled: JSString = "fullscreenEnabled" @usableFromInline static let fx: JSString = "fx" @usableFromInline static let fy: JSString = "fy" - @usableFromInline static let g: JSString = "g" - @usableFromInline static let gain: JSString = "gain" - @usableFromInline static let gamepad: JSString = "gamepad" - @usableFromInline static let gamma: JSString = "gamma" - @usableFromInline static let gapDiscardRate: JSString = "gapDiscardRate" - @usableFromInline static let gapLossRate: JSString = "gapLossRate" - @usableFromInline static let gather: JSString = "gather" - @usableFromInline static let gatherPolicy: JSString = "gatherPolicy" - @usableFromInline static let gatheringState: JSString = "gatheringState" - @usableFromInline static let gatt: JSString = "gatt" - @usableFromInline static let gc: JSString = "gc" - @usableFromInline static let gemm: JSString = "gemm" - @usableFromInline static let generateAssertion: JSString = "generateAssertion" - @usableFromInline static let generateCertificate: JSString = "generateCertificate" - @usableFromInline static let generateKey: JSString = "generateKey" - @usableFromInline static let generateKeyFrame: JSString = "generateKeyFrame" - @usableFromInline static let generateMipmap: JSString = "generateMipmap" - @usableFromInline static let generateRequest: JSString = "generateRequest" - @usableFromInline static let geolocation: JSString = "geolocation" @usableFromInline static let get: JSString = "get" - @usableFromInline static let getActiveAttrib: JSString = "getActiveAttrib" - @usableFromInline static let getActiveUniform: JSString = "getActiveUniform" - @usableFromInline static let getActiveUniformBlockName: JSString = "getActiveUniformBlockName" - @usableFromInline static let getActiveUniformBlockParameter: JSString = "getActiveUniformBlockParameter" - @usableFromInline static let getActiveUniforms: JSString = "getActiveUniforms" @usableFromInline static let getAll: JSString = "getAll" - @usableFromInline static let getAllKeys: JSString = "getAllKeys" @usableFromInline static let getAllResponseHeaders: JSString = "getAllResponseHeaders" - @usableFromInline static let getAllowlistForFeature: JSString = "getAllowlistForFeature" @usableFromInline static let getAnimations: JSString = "getAnimations" @usableFromInline static let getAsFile: JSString = "getAsFile" - @usableFromInline static let getAsFileSystemHandle: JSString = "getAsFileSystemHandle" - @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" @usableFromInline static let getAttributeNode: JSString = "getAttributeNode" @usableFromInline static let getAttributeNodeNS: JSString = "getAttributeNodeNS" - @usableFromInline static let getAttributeType: JSString = "getAttributeType" @usableFromInline static let getAudioTracks: JSString = "getAudioTracks" - @usableFromInline static let getAuthenticatorData: JSString = "getAuthenticatorData" - @usableFromInline static let getAutoplayPolicy: JSString = "getAutoplayPolicy" - @usableFromInline static let getAvailability: JSString = "getAvailability" @usableFromInline static let getBBox: JSString = "getBBox" - @usableFromInline static let getBattery: JSString = "getBattery" - @usableFromInline static let getBindGroupLayout: JSString = "getBindGroupLayout" - @usableFromInline static let getBoundingClientRect: JSString = "getBoundingClientRect" @usableFromInline static let getBounds: JSString = "getBounds" - @usableFromInline static let getBoxQuads: JSString = "getBoxQuads" - @usableFromInline static let getBufferParameter: JSString = "getBufferParameter" - @usableFromInline static let getBufferSubData: JSString = "getBufferSubData" - @usableFromInline static let getByteFrequencyData: JSString = "getByteFrequencyData" - @usableFromInline static let getByteTimeDomainData: JSString = "getByteTimeDomainData" @usableFromInline static let getCTM: JSString = "getCTM" @usableFromInline static let getCapabilities: JSString = "getCapabilities" - @usableFromInline static let getChannelData: JSString = "getChannelData" @usableFromInline static let getCharNumAtPosition: JSString = "getCharNumAtPosition" - @usableFromInline static let getCharacteristic: JSString = "getCharacteristic" - @usableFromInline static let getCharacteristics: JSString = "getCharacteristics" - @usableFromInline static let getClientExtensionResults: JSString = "getClientExtensionResults" - @usableFromInline static let getClientRect: JSString = "getClientRect" - @usableFromInline static let getClientRects: JSString = "getClientRects" - @usableFromInline static let getCoalescedEvents: JSString = "getCoalescedEvents" @usableFromInline static let getComputedStyle: JSString = "getComputedStyle" @usableFromInline static let getComputedTextLength: JSString = "getComputedTextLength" @usableFromInline static let getComputedTiming: JSString = "getComputedTiming" - @usableFromInline static let getConfiguration: JSString = "getConfiguration" @usableFromInline static let getConstraints: JSString = "getConstraints" - @usableFromInline static let getContent: JSString = "getContent" @usableFromInline static let getContext: JSString = "getContext" @usableFromInline static let getContextAttributes: JSString = "getContextAttributes" - @usableFromInline static let getContributingSources: JSString = "getContributingSources" - @usableFromInline static let getCueAsHTML: JSString = "getCueAsHTML" @usableFromInline static let getCueById: JSString = "getCueById" - @usableFromInline static let getCurrentTexture: JSString = "getCurrentTexture" - @usableFromInline static let getCurrentTime: JSString = "getCurrentTime" @usableFromInline static let getData: JSString = "getData" - @usableFromInline static let getDefaultConfiguration: JSString = "getDefaultConfiguration" - @usableFromInline static let getDepthInMeters: JSString = "getDepthInMeters" - @usableFromInline static let getDepthInformation: JSString = "getDepthInformation" - @usableFromInline static let getDescriptor: JSString = "getDescriptor" - @usableFromInline static let getDescriptors: JSString = "getDescriptors" - @usableFromInline static let getDetails: JSString = "getDetails" - @usableFromInline static let getDevices: JSString = "getDevices" - @usableFromInline static let getDigitalGoodsService: JSString = "getDigitalGoodsService" - @usableFromInline static let getDirectory: JSString = "getDirectory" - @usableFromInline static let getDirectoryHandle: JSString = "getDirectoryHandle" - @usableFromInline static let getDisplayMedia: JSString = "getDisplayMedia" @usableFromInline static let getElementById: JSString = "getElementById" @usableFromInline static let getElementsByClassName: JSString = "getElementsByClassName" @usableFromInline static let getElementsByName: JSString = "getElementsByName" @@ -2428,218 +868,65 @@ import JavaScriptKit @usableFromInline static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" @usableFromInline static let getEnclosureList: JSString = "getEnclosureList" @usableFromInline static let getEndPositionOfChar: JSString = "getEndPositionOfChar" - @usableFromInline static let getEntries: JSString = "getEntries" - @usableFromInline static let getEntriesByName: JSString = "getEntriesByName" - @usableFromInline static let getEntriesByType: JSString = "getEntriesByType" - @usableFromInline static let getError: JSString = "getError" - @usableFromInline static let getExtension: JSString = "getExtension" @usableFromInline static let getExtentOfChar: JSString = "getExtentOfChar" - @usableFromInline static let getFile: JSString = "getFile" - @usableFromInline static let getFileHandle: JSString = "getFileHandle" - @usableFromInline static let getFingerprints: JSString = "getFingerprints" - @usableFromInline static let getFloatFrequencyData: JSString = "getFloatFrequencyData" - @usableFromInline static let getFloatTimeDomainData: JSString = "getFloatTimeDomainData" - @usableFromInline static let getFragDataLocation: JSString = "getFragDataLocation" - @usableFromInline static let getFramebufferAttachmentParameter: JSString = "getFramebufferAttachmentParameter" - @usableFromInline static let getFrequencyResponse: JSString = "getFrequencyResponse" - @usableFromInline static let getGamepads: JSString = "getGamepads" - @usableFromInline static let getHighEntropyValues: JSString = "getHighEntropyValues" - @usableFromInline static let getHitTestResults: JSString = "getHitTestResults" - @usableFromInline static let getHitTestResultsForTransientInput: JSString = "getHitTestResultsForTransientInput" - @usableFromInline static let getIdentityAssertion: JSString = "getIdentityAssertion" - @usableFromInline static let getIds: JSString = "getIds" @usableFromInline static let getImageData: JSString = "getImageData" - @usableFromInline static let getIncludedService: JSString = "getIncludedService" - @usableFromInline static let getIncludedServices: JSString = "getIncludedServices" - @usableFromInline static let getIndexedParameter: JSString = "getIndexedParameter" - @usableFromInline static let getInfo: JSString = "getInfo" - @usableFromInline static let getInstalledRelatedApps: JSString = "getInstalledRelatedApps" - @usableFromInline static let getInternalformatParameter: JSString = "getInternalformatParameter" @usableFromInline static let getIntersectionList: JSString = "getIntersectionList" - @usableFromInline static let getJointPose: JSString = "getJointPose" - @usableFromInline static let getKey: JSString = "getKey" @usableFromInline static let getKeyframes: JSString = "getKeyframes" - @usableFromInline static let getLayoutMap: JSString = "getLayoutMap" - @usableFromInline static let getLightEstimate: JSString = "getLightEstimate" @usableFromInline static let getLineDash: JSString = "getLineDash" - @usableFromInline static let getLocalCandidates: JSString = "getLocalCandidates" - @usableFromInline static let getLocalParameters: JSString = "getLocalParameters" - @usableFromInline static let getMappedRange: JSString = "getMappedRange" - @usableFromInline static let getMetadata: JSString = "getMetadata" @usableFromInline static let getModifierState: JSString = "getModifierState" @usableFromInline static let getNamedItemNS: JSString = "getNamedItemNS" - @usableFromInline static let getNativeFramebufferScaleFactor: JSString = "getNativeFramebufferScaleFactor" - @usableFromInline static let getNotifications: JSString = "getNotifications" @usableFromInline static let getNumberOfChars: JSString = "getNumberOfChars" - @usableFromInline static let getOffsetReferenceSpace: JSString = "getOffsetReferenceSpace" - @usableFromInline static let getOutputTimestamp: JSString = "getOutputTimestamp" @usableFromInline static let getParameter: JSString = "getParameter" - @usableFromInline static let getParameters: JSString = "getParameters" - @usableFromInline static let getPhotoCapabilities: JSString = "getPhotoCapabilities" - @usableFromInline static let getPhotoSettings: JSString = "getPhotoSettings" @usableFromInline static let getPointAtLength: JSString = "getPointAtLength" - @usableFromInline static let getPorts: JSString = "getPorts" - @usableFromInline static let getPose: JSString = "getPose" - @usableFromInline static let getPredictedEvents: JSString = "getPredictedEvents" - @usableFromInline static let getPreferredFormat: JSString = "getPreferredFormat" - @usableFromInline static let getPrimaryService: JSString = "getPrimaryService" - @usableFromInline static let getPrimaryServices: JSString = "getPrimaryServices" - @usableFromInline static let getProgramInfoLog: JSString = "getProgramInfoLog" - @usableFromInline static let getProgramParameter: JSString = "getProgramParameter" - @usableFromInline static let getProperties: JSString = "getProperties" @usableFromInline static let getPropertyPriority: JSString = "getPropertyPriority" - @usableFromInline static let getPropertyType: JSString = "getPropertyType" @usableFromInline static let getPropertyValue: JSString = "getPropertyValue" - @usableFromInline static let getPublicKey: JSString = "getPublicKey" - @usableFromInline static let getPublicKeyAlgorithm: JSString = "getPublicKeyAlgorithm" - @usableFromInline static let getQuery: JSString = "getQuery" - @usableFromInline static let getQueryEXT: JSString = "getQueryEXT" - @usableFromInline static let getQueryObjectEXT: JSString = "getQueryObjectEXT" - @usableFromInline static let getQueryParameter: JSString = "getQueryParameter" - @usableFromInline static let getRandomValues: JSString = "getRandomValues" - @usableFromInline static let getRangeAt: JSString = "getRangeAt" @usableFromInline static let getReader: JSString = "getReader" - @usableFromInline static let getReceivers: JSString = "getReceivers" - @usableFromInline static let getReflectionCubeMap: JSString = "getReflectionCubeMap" - @usableFromInline static let getRegionFlowRanges: JSString = "getRegionFlowRanges" - @usableFromInline static let getRegions: JSString = "getRegions" - @usableFromInline static let getRegionsByContent: JSString = "getRegionsByContent" @usableFromInline static let getRegistration: JSString = "getRegistration" @usableFromInline static let getRegistrations: JSString = "getRegistrations" - @usableFromInline static let getRemoteCandidates: JSString = "getRemoteCandidates" - @usableFromInline static let getRemoteCertificates: JSString = "getRemoteCertificates" - @usableFromInline static let getRemoteParameters: JSString = "getRemoteParameters" - @usableFromInline static let getRenderbufferParameter: JSString = "getRenderbufferParameter" @usableFromInline static let getResponseHeader: JSString = "getResponseHeader" @usableFromInline static let getRootNode: JSString = "getRootNode" @usableFromInline static let getRotationOfChar: JSString = "getRotationOfChar" @usableFromInline static let getSVGDocument: JSString = "getSVGDocument" - @usableFromInline static let getSamplerParameter: JSString = "getSamplerParameter" @usableFromInline static let getScreenCTM: JSString = "getScreenCTM" - @usableFromInline static let getSelectedCandidatePair: JSString = "getSelectedCandidatePair" - @usableFromInline static let getSelection: JSString = "getSelection" - @usableFromInline static let getSenders: JSString = "getSenders" - @usableFromInline static let getService: JSString = "getService" @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 getSignals: JSString = "getSignals" - @usableFromInline static let getSimpleDuration: JSString = "getSimpleDuration" - @usableFromInline static let getSpatialNavigationContainer: JSString = "getSpatialNavigationContainer" @usableFromInline static let getStartDate: JSString = "getStartDate" @usableFromInline static let getStartPositionOfChar: JSString = "getStartPositionOfChar" - @usableFromInline static let getStartTime: JSString = "getStartTime" @usableFromInline static let getState: JSString = "getState" - @usableFromInline static let getStats: JSString = "getStats" - @usableFromInline static let getSubImage: JSString = "getSubImage" @usableFromInline static let getSubStringLength: JSString = "getSubStringLength" - @usableFromInline static let getSubscription: JSString = "getSubscription" - @usableFromInline static let getSubscriptions: JSString = "getSubscriptions" @usableFromInline static let getSupportedConstraints: JSString = "getSupportedConstraints" - @usableFromInline static let getSupportedExtensions: JSString = "getSupportedExtensions" - @usableFromInline static let getSupportedFormats: JSString = "getSupportedFormats" - @usableFromInline static let getSupportedProfiles: JSString = "getSupportedProfiles" - @usableFromInline static let getSyncParameter: JSString = "getSyncParameter" - @usableFromInline static let getSynchronizationSources: JSString = "getSynchronizationSources" - @usableFromInline static let getTags: JSString = "getTags" - @usableFromInline static let getTargetRanges: JSString = "getTargetRanges" - @usableFromInline static let getTexParameter: JSString = "getTexParameter" - @usableFromInline static let getTextFormats: JSString = "getTextFormats" @usableFromInline static let getTiming: JSString = "getTiming" - @usableFromInline static let getTitlebarAreaRect: JSString = "getTitlebarAreaRect" @usableFromInline static let getTotalLength: JSString = "getTotalLength" @usableFromInline static let getTrackById: JSString = "getTrackById" @usableFromInline static let getTracks: JSString = "getTracks" - @usableFromInline static let getTransceivers: JSString = "getTransceivers" @usableFromInline static let getTransform: JSString = "getTransform" - @usableFromInline static let getTransformFeedbackVarying: JSString = "getTransformFeedbackVarying" - @usableFromInline static let getTranslatedShaderSource: JSString = "getTranslatedShaderSource" - @usableFromInline static let getTransports: JSString = "getTransports" - @usableFromInline static let getType: JSString = "getType" - @usableFromInline static let getUniform: JSString = "getUniform" - @usableFromInline static let getUniformBlockIndex: JSString = "getUniformBlockIndex" - @usableFromInline static let getUniformIndices: JSString = "getUniformIndices" - @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 getVideoPlaybackQuality: JSString = "getVideoPlaybackQuality" @usableFromInline static let getVideoTracks: JSString = "getVideoTracks" - @usableFromInline static let getViewSubImage: JSString = "getViewSubImage" - @usableFromInline static let getViewerPose: JSString = "getViewerPose" - @usableFromInline static let getViewport: JSString = "getViewport" - @usableFromInline static let getVoices: JSString = "getVoices" @usableFromInline static let getWriter: JSString = "getWriter" @usableFromInline static let globalAlpha: JSString = "globalAlpha" @usableFromInline static let globalCompositeOperation: JSString = "globalCompositeOperation" - @usableFromInline static let glyphsRendered: JSString = "glyphsRendered" @usableFromInline static let go: JSString = "go" - @usableFromInline static let gpu: JSString = "gpu" - @usableFromInline static let grabFrame: JSString = "grabFrame" - @usableFromInline static let grad: JSString = "grad" @usableFromInline static let gradientTransform: JSString = "gradientTransform" @usableFromInline static let gradientUnits: JSString = "gradientUnits" - @usableFromInline static let grammars: JSString = "grammars" - @usableFromInline static let granted: JSString = "granted" - @usableFromInline static let gripSpace: JSString = "gripSpace" - @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 groups: JSString = "groups" - @usableFromInline static let grow: JSString = "grow" - @usableFromInline static let gru: JSString = "gru" - @usableFromInline static let gruCell: JSString = "gruCell" - @usableFromInline static let h: JSString = "h" - @usableFromInline static let hadRecentInput: JSString = "hadRecentInput" - @usableFromInline static let hand: JSString = "hand" - @usableFromInline static let handedness: JSString = "handedness" - @usableFromInline static let handle: JSString = "handle" @usableFromInline static let handled: JSString = "handled" @usableFromInline static let hangingBaseline: JSString = "hangingBaseline" - @usableFromInline static let hapticActuators: JSString = "hapticActuators" - @usableFromInline static let hardSigmoid: JSString = "hardSigmoid" - @usableFromInline static let hardSwish: JSString = "hardSwish" @usableFromInline static let hardwareAcceleration: JSString = "hardwareAcceleration" @usableFromInline static let hardwareConcurrency: JSString = "hardwareConcurrency" @usableFromInline static let has: JSString = "has" - @usableFromInline static let hasAlphaChannel: JSString = "hasAlphaChannel" @usableFromInline static let hasAttribute: JSString = "hasAttribute" @usableFromInline static let hasAttributeNS: JSString = "hasAttributeNS" @usableFromInline static let hasAttributes: JSString = "hasAttributes" @usableFromInline static let hasChildNodes: JSString = "hasChildNodes" - @usableFromInline static let hasDynamicOffset: JSString = "hasDynamicOffset" @usableFromInline static let hasFeature: JSString = "hasFeature" @usableFromInline static let hasFocus: JSString = "hasFocus" - @usableFromInline static let hasNull: JSString = "hasNull" - @usableFromInline static let hasOrientation: JSString = "hasOrientation" - @usableFromInline static let hasPointerCapture: JSString = "hasPointerCapture" - @usableFromInline static let hasPosition: JSString = "hasPosition" - @usableFromInline static let hasPreferredState: JSString = "hasPreferredState" - @usableFromInline static let hasReading: JSString = "hasReading" - @usableFromInline static let hasStorageAccess: JSString = "hasStorageAccess" @usableFromInline static let hash: JSString = "hash" - @usableFromInline static let hashChange: JSString = "hashChange" - @usableFromInline static let hdrMetadataType: JSString = "hdrMetadataType" @usableFromInline static let head: JSString = "head" - @usableFromInline static let headerBytesReceived: JSString = "headerBytesReceived" - @usableFromInline static let headerBytesSent: JSString = "headerBytesSent" - @usableFromInline static let headerExtensions: JSString = "headerExtensions" @usableFromInline static let headerValue: JSString = "headerValue" @usableFromInline static let headers: JSString = "headers" - @usableFromInline static let heading: JSString = "heading" @usableFromInline static let height: JSString = "height" - @usableFromInline static let held: JSString = "held" - @usableFromInline static let hid: JSString = "hid" @usableFromInline static let hidden: JSString = "hidden" - @usableFromInline static let hide: JSString = "hide" @usableFromInline static let high: JSString = "high" @usableFromInline static let highWaterMark: JSString = "highWaterMark" - @usableFromInline static let highlights: JSString = "highlights" - @usableFromInline static let hint: JSString = "hint" - @usableFromInline static let hints: JSString = "hints" @usableFromInline static let history: JSString = "history" @usableFromInline static let host: JSString = "host" @usableFromInline static let hostname: JSString = "hostname" @@ -2648,382 +935,132 @@ import JavaScriptKit @usableFromInline static let hspace: JSString = "hspace" @usableFromInline static let htmlFor: JSString = "htmlFor" @usableFromInline static let httpEquiv: JSString = "httpEquiv" - @usableFromInline static let httpRequestStatusCode: JSString = "httpRequestStatusCode" - @usableFromInline static let hugeFramesSent: JSString = "hugeFramesSent" - @usableFromInline static let ic: JSString = "ic" - @usableFromInline static let iceCandidatePoolSize: JSString = "iceCandidatePoolSize" - @usableFromInline static let iceConnectionState: JSString = "iceConnectionState" - @usableFromInline static let iceGatheringState: JSString = "iceGatheringState" - @usableFromInline static let iceLite: JSString = "iceLite" - @usableFromInline static let iceLocalUsernameFragment: JSString = "iceLocalUsernameFragment" - @usableFromInline static let iceRestart: JSString = "iceRestart" - @usableFromInline static let iceRole: JSString = "iceRole" - @usableFromInline static let iceServers: JSString = "iceServers" - @usableFromInline static let iceState: JSString = "iceState" - @usableFromInline static let iceTransport: JSString = "iceTransport" - @usableFromInline static let iceTransportPolicy: JSString = "iceTransportPolicy" - @usableFromInline static let icon: JSString = "icon" - @usableFromInline static let iconMustBeShown: JSString = "iconMustBeShown" - @usableFromInline static let iconURL: JSString = "iconURL" - @usableFromInline static let iconURLs: JSString = "iconURLs" - @usableFromInline static let icons: JSString = "icons" @usableFromInline static let id: JSString = "id" @usableFromInline static let ideal: JSString = "ideal" - @usableFromInline static let identifier: JSString = "identifier" - @usableFromInline static let identity: JSString = "identity" @usableFromInline static let ideographicBaseline: JSString = "ideographicBaseline" - @usableFromInline static let idp: JSString = "idp" - @usableFromInline static let idpErrorInfo: JSString = "idpErrorInfo" - @usableFromInline static let idpLoginUrl: JSString = "idpLoginUrl" - @usableFromInline static let ifAvailable: JSString = "ifAvailable" - @usableFromInline static let ignoreBOM: JSString = "ignoreBOM" - @usableFromInline static let ignoreDepthValues: JSString = "ignoreDepthValues" @usableFromInline static let ignoreMethod: JSString = "ignoreMethod" @usableFromInline static let ignoreSearch: JSString = "ignoreSearch" @usableFromInline static let ignoreVary: JSString = "ignoreVary" - @usableFromInline static let illuminance: JSString = "illuminance" - @usableFromInline static let imag: JSString = "imag" @usableFromInline static let image: JSString = "image" - @usableFromInline static let imageHeight: JSString = "imageHeight" - @usableFromInline static let imageIndex: JSString = "imageIndex" @usableFromInline static let imageOrientation: JSString = "imageOrientation" @usableFromInline static let imageSizes: JSString = "imageSizes" @usableFromInline static let imageSmoothingEnabled: JSString = "imageSmoothingEnabled" @usableFromInline static let imageSmoothingQuality: JSString = "imageSmoothingQuality" @usableFromInline static let imageSrcset: JSString = "imageSrcset" - @usableFromInline static let imageWidth: JSString = "imageWidth" @usableFromInline static let images: JSString = "images" @usableFromInline static let implementation: JSString = "implementation" - @usableFromInline static let importExternalTexture: JSString = "importExternalTexture" - @usableFromInline static let importKey: JSString = "importKey" @usableFromInline static let importNode: JSString = "importNode" @usableFromInline static let importStylesheet: JSString = "importStylesheet" - @usableFromInline static let imports: JSString = "imports" - @usableFromInline static let `in`: JSString = "in" - @usableFromInline static let in1: JSString = "in1" - @usableFromInline static let in2: JSString = "in2" @usableFromInline static let inBandMetadataTrackDispatchType: JSString = "inBandMetadataTrackDispatchType" - @usableFromInline static let inboundRtpStreamId: JSString = "inboundRtpStreamId" - @usableFromInline static let includeContinuous: JSString = "includeContinuous" @usableFromInline static let includeUncontrolled: JSString = "includeUncontrolled" - @usableFromInline static let includes: JSString = "includes" - @usableFromInline static let incomingBidirectionalStreams: JSString = "incomingBidirectionalStreams" - @usableFromInline static let incomingHighWaterMark: JSString = "incomingHighWaterMark" - @usableFromInline static let incomingMaxAge: JSString = "incomingMaxAge" - @usableFromInline static let incomingUnidirectionalStreams: JSString = "incomingUnidirectionalStreams" @usableFromInline static let indeterminate: JSString = "indeterminate" @usableFromInline static let index: JSString = "index" - @usableFromInline static let indexNames: JSString = "indexNames" - @usableFromInline static let indexedDB: JSString = "indexedDB" - @usableFromInline static let indicate: JSString = "indicate" @usableFromInline static let inert: JSString = "inert" - @usableFromInline static let info: JSString = "info" - @usableFromInline static let inherits: JSString = "inherits" @usableFromInline static let initCompositionEvent: JSString = "initCompositionEvent" @usableFromInline static let initCustomEvent: JSString = "initCustomEvent" - @usableFromInline static let initData: JSString = "initData" - @usableFromInline static let initDataType: JSString = "initDataType" - @usableFromInline static let initDataTypes: JSString = "initDataTypes" @usableFromInline static let initEvent: JSString = "initEvent" @usableFromInline static let initKeyboardEvent: JSString = "initKeyboardEvent" @usableFromInline static let initMessageEvent: JSString = "initMessageEvent" @usableFromInline static let initMouseEvent: JSString = "initMouseEvent" @usableFromInline static let initMutationEvent: JSString = "initMutationEvent" @usableFromInline static let initStorageEvent: JSString = "initStorageEvent" - @usableFromInline static let initTimeEvent: JSString = "initTimeEvent" @usableFromInline static let initUIEvent: JSString = "initUIEvent" - @usableFromInline static let initial: JSString = "initial" - @usableFromInline static let initialHiddenState: JSString = "initialHiddenState" - @usableFromInline static let initialValue: JSString = "initialValue" @usableFromInline static let initialize: JSString = "initialize" - @usableFromInline static let initiatorType: JSString = "initiatorType" - @usableFromInline static let ink: JSString = "ink" - @usableFromInline static let inline: JSString = "inline" - @usableFromInline static let inlineSize: JSString = "inlineSize" - @usableFromInline static let inlineVerticalFieldOfView: JSString = "inlineVerticalFieldOfView" - @usableFromInline static let innerHTML: JSString = "innerHTML" - @usableFromInline static let innerHeight: JSString = "innerHeight" @usableFromInline static let innerText: JSString = "innerText" - @usableFromInline static let innerWidth: JSString = "innerWidth" - @usableFromInline static let input: JSString = "input" - @usableFromInline static let inputBuffer: JSString = "inputBuffer" @usableFromInline static let inputEncoding: JSString = "inputEncoding" - @usableFromInline static let inputLayout: JSString = "inputLayout" @usableFromInline static let inputMode: JSString = "inputMode" - @usableFromInline static let inputReports: JSString = "inputReports" - @usableFromInline static let inputSource: JSString = "inputSource" - @usableFromInline static let inputSources: JSString = "inputSources" @usableFromInline static let inputType: JSString = "inputType" - @usableFromInline static let inputs: JSString = "inputs" @usableFromInline static let insertAdjacentElement: JSString = "insertAdjacentElement" - @usableFromInline static let insertAdjacentHTML: JSString = "insertAdjacentHTML" @usableFromInline static let insertAdjacentText: JSString = "insertAdjacentText" @usableFromInline static let insertBefore: JSString = "insertBefore" @usableFromInline static let insertCell: JSString = "insertCell" - @usableFromInline static let insertDTMF: JSString = "insertDTMF" @usableFromInline static let insertData: JSString = "insertData" - @usableFromInline static let insertDebugMarker: JSString = "insertDebugMarker" @usableFromInline static let insertItemBefore: JSString = "insertItemBefore" @usableFromInline static let insertNode: JSString = "insertNode" @usableFromInline static let insertRow: JSString = "insertRow" @usableFromInline static let insertRule: JSString = "insertRule" - @usableFromInline static let insertedSamplesForDeceleration: JSString = "insertedSamplesForDeceleration" @usableFromInline static let installing: JSString = "installing" - @usableFromInline static let instance: JSString = "instance" - @usableFromInline static let instanceNormalization: JSString = "instanceNormalization" @usableFromInline static let instanceRoot: JSString = "instanceRoot" - @usableFromInline static let instantiate: JSString = "instantiate" - @usableFromInline static let instantiateStreaming: JSString = "instantiateStreaming" - @usableFromInline static let instrument: JSString = "instrument" - @usableFromInline static let instruments: JSString = "instruments" @usableFromInline static let integrity: JSString = "integrity" - @usableFromInline static let interactionCounts: JSString = "interactionCounts" - @usableFromInline static let interactionId: JSString = "interactionId" - @usableFromInline static let interactionMode: JSString = "interactionMode" - @usableFromInline static let intercept: JSString = "intercept" - @usableFromInline static let interfaceClass: JSString = "interfaceClass" - @usableFromInline static let interfaceName: JSString = "interfaceName" - @usableFromInline static let interfaceNumber: JSString = "interfaceNumber" - @usableFromInline static let interfaceProtocol: JSString = "interfaceProtocol" - @usableFromInline static let interfaceSubclass: JSString = "interfaceSubclass" - @usableFromInline static let interfaces: JSString = "interfaces" - @usableFromInline static let interimResults: JSString = "interimResults" - @usableFromInline static let intersectionRatio: JSString = "intersectionRatio" - @usableFromInline static let intersectionRect: JSString = "intersectionRect" @usableFromInline static let intersectsNode: JSString = "intersectsNode" - @usableFromInline static let interval: JSString = "interval" - @usableFromInline static let introductoryPrice: JSString = "introductoryPrice" - @usableFromInline static let introductoryPriceCycles: JSString = "introductoryPriceCycles" - @usableFromInline static let introductoryPricePeriod: JSString = "introductoryPricePeriod" @usableFromInline static let invalidIteratorState: JSString = "invalidIteratorState" - @usableFromInline static let invalidateFramebuffer: JSString = "invalidateFramebuffer" - @usableFromInline static let invalidateSubFramebuffer: JSString = "invalidateSubFramebuffer" @usableFromInline static let inverse: JSString = "inverse" @usableFromInline static let invertSelf: JSString = "invertSelf" - @usableFromInline static let invertStereo: JSString = "invertStereo" @usableFromInline static let `is`: JSString = "is" @usableFromInline static let is2D: JSString = "is2D" - @usableFromInline static let isAbsolute: JSString = "isAbsolute" - @usableFromInline static let isArray: JSString = "isArray" - @usableFromInline static let isBuffer: JSString = "isBuffer" - @usableFromInline static let isBufferedBytes: JSString = "isBufferedBytes" - @usableFromInline static let isCollapsed: JSString = "isCollapsed" @usableFromInline static let isComposing: JSString = "isComposing" - @usableFromInline static let isConditionalMediationAvailable: JSString = "isConditionalMediationAvailable" @usableFromInline static let isConfigSupported: JSString = "isConfigSupported" @usableFromInline static let isConnected: JSString = "isConnected" - @usableFromInline static let isConstant: JSString = "isConstant" @usableFromInline static let isContentEditable: JSString = "isContentEditable" @usableFromInline static let isContextLost: JSString = "isContextLost" @usableFromInline static let isDefaultNamespace: JSString = "isDefaultNamespace" - @usableFromInline static let isDirectory: JSString = "isDirectory" - @usableFromInline static let isEnabled: JSString = "isEnabled" @usableFromInline static let isEqualNode: JSString = "isEqualNode" - @usableFromInline static let isFallbackAdapter: JSString = "isFallbackAdapter" - @usableFromInline static let isFile: JSString = "isFile" - @usableFromInline static let isFinal: JSString = "isFinal" - @usableFromInline static let isFirstPersonObserver: JSString = "isFirstPersonObserver" - @usableFromInline static let isFramebuffer: JSString = "isFramebuffer" - @usableFromInline static let isHTML: JSString = "isHTML" @usableFromInline static let isHistoryNavigation: JSString = "isHistoryNavigation" @usableFromInline static let isIdentity: JSString = "isIdentity" - @usableFromInline static let isInComposition: JSString = "isInComposition" - @usableFromInline static let isInputPending: JSString = "isInputPending" - @usableFromInline static let isIntersecting: JSString = "isIntersecting" - @usableFromInline static let isLinear: JSString = "isLinear" @usableFromInline static let isMap: JSString = "isMap" - @usableFromInline static let isPayment: JSString = "isPayment" @usableFromInline static let isPointInFill: JSString = "isPointInFill" @usableFromInline static let isPointInPath: JSString = "isPointInPath" @usableFromInline static let isPointInRange: JSString = "isPointInRange" @usableFromInline static let isPointInStroke: JSString = "isPointInStroke" - @usableFromInline static let isPrimary: JSString = "isPrimary" - @usableFromInline static let isProgram: JSString = "isProgram" - @usableFromInline static let isQuery: JSString = "isQuery" - @usableFromInline static let isQueryEXT: JSString = "isQueryEXT" - @usableFromInline static let isRange: JSString = "isRange" @usableFromInline static let isReloadNavigation: JSString = "isReloadNavigation" - @usableFromInline static let isRenderbuffer: JSString = "isRenderbuffer" - @usableFromInline static let isSameEntry: JSString = "isSameEntry" @usableFromInline static let isSameNode: JSString = "isSameNode" - @usableFromInline static let isSampler: JSString = "isSampler" - @usableFromInline static let isScript: JSString = "isScript" - @usableFromInline static let isScriptURL: JSString = "isScriptURL" @usableFromInline static let isSecureContext: JSString = "isSecureContext" - @usableFromInline static let isSessionSupported: JSString = "isSessionSupported" - @usableFromInline static let isShader: JSString = "isShader" - @usableFromInline static let isStatic: JSString = "isStatic" - @usableFromInline static let isSync: JSString = "isSync" - @usableFromInline static let isTexture: JSString = "isTexture" - @usableFromInline static let isTransformFeedback: JSString = "isTransformFeedback" @usableFromInline static let isTrusted: JSString = "isTrusted" @usableFromInline static let isTypeSupported: JSString = "isTypeSupported" - @usableFromInline static let isUserVerifyingPlatformAuthenticatorAvailable: JSString = "isUserVerifyingPlatformAuthenticatorAvailable" - @usableFromInline static let isVertexArray: JSString = "isVertexArray" - @usableFromInline static let isVertexArrayOES: JSString = "isVertexArrayOES" - @usableFromInline static let isVisible: JSString = "isVisible" - @usableFromInline static let isVolatile: JSString = "isVolatile" - @usableFromInline static let iso: JSString = "iso" - @usableFromInline static let isochronousTransferIn: JSString = "isochronousTransferIn" - @usableFromInline static let isochronousTransferOut: JSString = "isochronousTransferOut" - @usableFromInline static let isolated: JSString = "isolated" - @usableFromInline static let issuerCertificateId: JSString = "issuerCertificateId" @usableFromInline static let item: JSString = "item" - @usableFromInline static let itemId: JSString = "itemId" @usableFromInline static let items: JSString = "items" @usableFromInline static let iterateNext: JSString = "iterateNext" - @usableFromInline static let iterationComposite: JSString = "iterationComposite" @usableFromInline static let iterationStart: JSString = "iterationStart" @usableFromInline static let iterations: JSString = "iterations" - @usableFromInline static let iv: JSString = "iv" @usableFromInline static let javaEnabled: JSString = "javaEnabled" - @usableFromInline static let jitter: JSString = "jitter" - @usableFromInline static let jitterBufferDelay: JSString = "jitterBufferDelay" - @usableFromInline static let jitterBufferEmittedCount: JSString = "jitterBufferEmittedCount" - @usableFromInline static let jointName: JSString = "jointName" @usableFromInline static let json: JSString = "json" - @usableFromInline static let k: JSString = "k" - @usableFromInline static let k1: JSString = "k1" - @usableFromInline static let k2: JSString = "k2" - @usableFromInline static let k3: JSString = "k3" - @usableFromInline static let k4: JSString = "k4" - @usableFromInline static let kHz: JSString = "kHz" - @usableFromInline static let keepDimensions: JSString = "keepDimensions" - @usableFromInline static let keepExistingData: JSString = "keepExistingData" @usableFromInline static let keepalive: JSString = "keepalive" - @usableFromInline static let kernelMatrix: JSString = "kernelMatrix" - @usableFromInline static let kernelUnitLengthX: JSString = "kernelUnitLengthX" - @usableFromInline static let kernelUnitLengthY: JSString = "kernelUnitLengthY" @usableFromInline static let key: JSString = "key" @usableFromInline static let keyCode: JSString = "keyCode" @usableFromInline static let keyFrame: JSString = "keyFrame" - @usableFromInline static let keyFramesDecoded: JSString = "keyFramesDecoded" - @usableFromInline static let keyFramesEncoded: JSString = "keyFramesEncoded" - @usableFromInline static let keyID: JSString = "keyID" - @usableFromInline static let keyPath: JSString = "keyPath" - @usableFromInline static let keyStatuses: JSString = "keyStatuses" - @usableFromInline static let keySystem: JSString = "keySystem" - @usableFromInline static let keySystemAccess: JSString = "keySystemAccess" - @usableFromInline static let keySystemConfiguration: JSString = "keySystemConfiguration" - @usableFromInline static let keyText: JSString = "keyText" - @usableFromInline static let key_ops: JSString = "key_ops" - @usableFromInline static let keyboard: JSString = "keyboard" @usableFromInline static let keys: JSString = "keys" @usableFromInline static let kind: JSString = "kind" - @usableFromInline static let knee: JSString = "knee" - @usableFromInline static let kty: JSString = "kty" - @usableFromInline static let l: JSString = "l" - @usableFromInline static let l2Pool2d: JSString = "l2Pool2d" @usableFromInline static let label: JSString = "label" @usableFromInline static let labels: JSString = "labels" - @usableFromInline static let landmarks: JSString = "landmarks" @usableFromInline static let lang: JSString = "lang" @usableFromInline static let language: JSString = "language" @usableFromInline static let languages: JSString = "languages" - @usableFromInline static let largeBlob: JSString = "largeBlob" - @usableFromInline static let lastChance: JSString = "lastChance" @usableFromInline static let lastChild: JSString = "lastChild" @usableFromInline static let lastElementChild: JSString = "lastElementChild" @usableFromInline static let lastEventId: JSString = "lastEventId" - @usableFromInline static let lastInputTime: JSString = "lastInputTime" @usableFromInline static let lastModified: JSString = "lastModified" - @usableFromInline static let lastPacketReceivedTimestamp: JSString = "lastPacketReceivedTimestamp" - @usableFromInline static let lastPacketSentTimestamp: JSString = "lastPacketSentTimestamp" - @usableFromInline static let lastRequestTimestamp: JSString = "lastRequestTimestamp" - @usableFromInline static let lastResponseTimestamp: JSString = "lastResponseTimestamp" @usableFromInline static let latency: JSString = "latency" - @usableFromInline static let latencyHint: JSString = "latencyHint" @usableFromInline static let latencyMode: JSString = "latencyMode" - @usableFromInline static let latitude: JSString = "latitude" - @usableFromInline static let layer: JSString = "layer" - @usableFromInline static let layerName: JSString = "layerName" - @usableFromInline static let layers: JSString = "layers" @usableFromInline static let layout: JSString = "layout" - @usableFromInline static let layoutWorklet: JSString = "layoutWorklet" - @usableFromInline static let leakyRelu: JSString = "leakyRelu" @usableFromInline static let left: JSString = "left" @usableFromInline static let length: JSString = "length" @usableFromInline static let lengthAdjust: JSString = "lengthAdjust" @usableFromInline static let lengthComputable: JSString = "lengthComputable" @usableFromInline static let letterSpacing: JSString = "letterSpacing" - @usableFromInline static let level: JSString = "level" - @usableFromInline static let lh: JSString = "lh" - @usableFromInline static let limitingConeAngle: JSString = "limitingConeAngle" - @usableFromInline static let limits: JSString = "limits" - @usableFromInline static let line: JSString = "line" - @usableFromInline static let lineAlign: JSString = "lineAlign" @usableFromInline static let lineCap: JSString = "lineCap" @usableFromInline static let lineDashOffset: JSString = "lineDashOffset" - @usableFromInline static let lineGapOverride: JSString = "lineGapOverride" @usableFromInline static let lineJoin: JSString = "lineJoin" - @usableFromInline static let lineNum: JSString = "lineNum" - @usableFromInline static let lineNumber: JSString = "lineNumber" - @usableFromInline static let linePos: JSString = "linePos" @usableFromInline static let lineTo: JSString = "lineTo" @usableFromInline static let lineWidth: JSString = "lineWidth" - @usableFromInline static let linear: JSString = "linear" - @usableFromInline static let linearAcceleration: JSString = "linearAcceleration" - @usableFromInline static let linearRampToValueAtTime: JSString = "linearRampToValueAtTime" - @usableFromInline static let linearVelocity: JSString = "linearVelocity" @usableFromInline static let lineno: JSString = "lineno" - @usableFromInline static let lines: JSString = "lines" @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 listPurchaseHistory: JSString = "listPurchaseHistory" - @usableFromInline static let listPurchases: JSString = "listPurchases" - @usableFromInline static let listener: JSString = "listener" @usableFromInline static let load: JSString = "load" - @usableFromInline static let loadEventEnd: JSString = "loadEventEnd" - @usableFromInline static let loadEventStart: JSString = "loadEventStart" - @usableFromInline static let loadOp: JSString = "loadOp" - @usableFromInline static let loadTime: JSString = "loadTime" @usableFromInline static let loaded: JSString = "loaded" @usableFromInline static let loading: JSString = "loading" - @usableFromInline static let local: JSString = "local" - @usableFromInline static let localCandidateId: JSString = "localCandidateId" - @usableFromInline static let localCertificateId: JSString = "localCertificateId" - @usableFromInline static let localDescription: JSString = "localDescription" - @usableFromInline static let localId: JSString = "localId" @usableFromInline static let localName: JSString = "localName" - @usableFromInline static let localService: JSString = "localService" @usableFromInline static let localStorage: JSString = "localStorage" - @usableFromInline static let localTime: JSString = "localTime" @usableFromInline static let location: JSString = "location" @usableFromInline static let locationbar: JSString = "locationbar" - @usableFromInline static let locations: JSString = "locations" - @usableFromInline static let lock: JSString = "lock" @usableFromInline static let locked: JSString = "locked" - @usableFromInline static let locks: JSString = "locks" - @usableFromInline static let lodMaxClamp: JSString = "lodMaxClamp" - @usableFromInline static let lodMinClamp: JSString = "lodMinClamp" - @usableFromInline static let log: JSString = "log" - @usableFromInline static let logicalMaximum: JSString = "logicalMaximum" - @usableFromInline static let logicalMinimum: JSString = "logicalMinimum" - @usableFromInline static let logicalSurface: JSString = "logicalSurface" @usableFromInline static let longDesc: JSString = "longDesc" - @usableFromInline static let longitude: JSString = "longitude" @usableFromInline static let lookupNamespaceURI: JSString = "lookupNamespaceURI" @usableFromInline static let lookupPrefix: JSString = "lookupPrefix" @usableFromInline static let loop: JSString = "loop" - @usableFromInline static let loopEnd: JSString = "loopEnd" - @usableFromInline static let loopStart: JSString = "loopStart" - @usableFromInline static let loseContext: JSString = "loseContext" - @usableFromInline static let lost: JSString = "lost" @usableFromInline static let low: JSString = "low" - @usableFromInline static let lower: JSString = "lower" - @usableFromInline static let lowerBound: JSString = "lowerBound" - @usableFromInline static let lowerOpen: JSString = "lowerOpen" - @usableFromInline static let lowerVerticalAngle: JSString = "lowerVerticalAngle" @usableFromInline static let lowsrc: JSString = "lowsrc" - @usableFromInline static let lvb: JSString = "lvb" - @usableFromInline static let lvh: JSString = "lvh" - @usableFromInline static let lvi: JSString = "lvi" - @usableFromInline static let lvmax: JSString = "lvmax" - @usableFromInline static let lvmin: JSString = "lvmin" - @usableFromInline static let lvw: JSString = "lvw" @usableFromInline static let m11: JSString = "m11" @usableFromInline static let m12: JSString = "m12" @usableFromInline static let m13: JSString = "m13" @@ -3040,139 +1077,34 @@ import JavaScriptKit @usableFromInline static let m42: JSString = "m42" @usableFromInline static let m43: JSString = "m43" @usableFromInline static let m44: JSString = "m44" - @usableFromInline static let magFilter: JSString = "magFilter" - @usableFromInline static let makeReadOnly: JSString = "makeReadOnly" - @usableFromInline static let makeXRCompatible: JSString = "makeXRCompatible" - @usableFromInline static let manufacturer: JSString = "manufacturer" - @usableFromInline static let manufacturerData: JSString = "manufacturerData" - @usableFromInline static let manufacturerName: JSString = "manufacturerName" - @usableFromInline static let mapAsync: JSString = "mapAsync" - @usableFromInline static let mappedAtCreation: JSString = "mappedAtCreation" - @usableFromInline static let mapping: JSString = "mapping" @usableFromInline static let marginHeight: JSString = "marginHeight" @usableFromInline static let marginWidth: JSString = "marginWidth" - @usableFromInline static let mark: JSString = "mark" @usableFromInline static let markerHeight: JSString = "markerHeight" @usableFromInline static let markerUnits: JSString = "markerUnits" @usableFromInline static let markerWidth: JSString = "markerWidth" @usableFromInline static let markers: JSString = "markers" - @usableFromInline static let mask: JSString = "mask" - @usableFromInline static let maskContentUnits: JSString = "maskContentUnits" - @usableFromInline static let maskUnits: JSString = "maskUnits" @usableFromInline static let match: JSString = "match" @usableFromInline static let matchAll: JSString = "matchAll" - @usableFromInline static let matchMedia: JSString = "matchMedia" @usableFromInline static let matches: JSString = "matches" - @usableFromInline static let matmul: JSString = "matmul" @usableFromInline static let matrix: JSString = "matrix" @usableFromInline static let matrixTransform: JSString = "matrixTransform" @usableFromInline static let max: JSString = "max" - @usableFromInline static let maxActions: JSString = "maxActions" - @usableFromInline static let maxAlternatives: JSString = "maxAlternatives" - @usableFromInline static let maxAnisotropy: JSString = "maxAnisotropy" - @usableFromInline static let maxBindGroups: JSString = "maxBindGroups" - @usableFromInline static let maxBitrate: JSString = "maxBitrate" - @usableFromInline static let maxBufferSize: JSString = "maxBufferSize" - @usableFromInline static let maxChannelCount: JSString = "maxChannelCount" - @usableFromInline static let maxChannels: JSString = "maxChannels" - @usableFromInline static let maxComputeInvocationsPerWorkgroup: JSString = "maxComputeInvocationsPerWorkgroup" - @usableFromInline static let maxComputeWorkgroupSizeX: JSString = "maxComputeWorkgroupSizeX" - @usableFromInline static let maxComputeWorkgroupSizeY: JSString = "maxComputeWorkgroupSizeY" - @usableFromInline static let maxComputeWorkgroupSizeZ: JSString = "maxComputeWorkgroupSizeZ" - @usableFromInline static let maxComputeWorkgroupStorageSize: JSString = "maxComputeWorkgroupStorageSize" - @usableFromInline static let maxComputeWorkgroupsPerDimension: JSString = "maxComputeWorkgroupsPerDimension" - @usableFromInline static let maxContentSize: JSString = "maxContentSize" - @usableFromInline static let maxDatagramSize: JSString = "maxDatagramSize" - @usableFromInline static let maxDecibels: JSString = "maxDecibels" - @usableFromInline static let maxDelayTime: JSString = "maxDelayTime" - @usableFromInline static let maxDetectedFaces: JSString = "maxDetectedFaces" - @usableFromInline static let maxDistance: JSString = "maxDistance" - @usableFromInline static let maxDynamicStorageBuffersPerPipelineLayout: JSString = "maxDynamicStorageBuffersPerPipelineLayout" - @usableFromInline static let maxDynamicUniformBuffersPerPipelineLayout: JSString = "maxDynamicUniformBuffersPerPipelineLayout" - @usableFromInline static let maxInterStageShaderComponents: JSString = "maxInterStageShaderComponents" @usableFromInline static let maxLength: JSString = "maxLength" - @usableFromInline static let maxMessageSize: JSString = "maxMessageSize" - @usableFromInline static let maxPacketLifeTime: JSString = "maxPacketLifeTime" - @usableFromInline static let maxPool2d: JSString = "maxPool2d" - @usableFromInline static let maxRetransmits: JSString = "maxRetransmits" - @usableFromInline static let maxSampledTexturesPerShaderStage: JSString = "maxSampledTexturesPerShaderStage" - @usableFromInline static let maxSamplersPerShaderStage: JSString = "maxSamplersPerShaderStage" - @usableFromInline static let maxSamplingFrequency: JSString = "maxSamplingFrequency" - @usableFromInline static let maxStorageBufferBindingSize: JSString = "maxStorageBufferBindingSize" - @usableFromInline static let maxStorageBuffersPerShaderStage: JSString = "maxStorageBuffersPerShaderStage" - @usableFromInline static let maxStorageTexturesPerShaderStage: JSString = "maxStorageTexturesPerShaderStage" - @usableFromInline static let maxTextureArrayLayers: JSString = "maxTextureArrayLayers" - @usableFromInline static let maxTextureDimension1D: JSString = "maxTextureDimension1D" - @usableFromInline static let maxTextureDimension2D: JSString = "maxTextureDimension2D" - @usableFromInline static let maxTextureDimension3D: JSString = "maxTextureDimension3D" - @usableFromInline static let maxTouchPoints: JSString = "maxTouchPoints" - @usableFromInline static let maxUniformBufferBindingSize: JSString = "maxUniformBufferBindingSize" - @usableFromInline static let maxUniformBuffersPerShaderStage: JSString = "maxUniformBuffersPerShaderStage" - @usableFromInline static let maxValue: JSString = "maxValue" - @usableFromInline static let maxVertexAttributes: JSString = "maxVertexAttributes" - @usableFromInline static let maxVertexBufferArrayStride: JSString = "maxVertexBufferArrayStride" - @usableFromInline static let maxVertexBuffers: JSString = "maxVertexBuffers" - @usableFromInline static let maximum: JSString = "maximum" - @usableFromInline static let maximumAge: JSString = "maximumAge" - @usableFromInline static let maximumValue: JSString = "maximumValue" - @usableFromInline static let mayUseGATT: JSString = "mayUseGATT" - @usableFromInline static let measure: JSString = "measure" - @usableFromInline static let measureElement: JSString = "measureElement" @usableFromInline static let measureText: JSString = "measureText" - @usableFromInline static let measureUserAgentSpecificMemory: JSString = "measureUserAgentSpecificMemory" @usableFromInline static let media: JSString = "media" - @usableFromInline static let mediaCapabilities: JSString = "mediaCapabilities" @usableFromInline static let mediaDevices: JSString = "mediaDevices" - @usableFromInline static let mediaElement: JSString = "mediaElement" - @usableFromInline static let mediaKeys: JSString = "mediaKeys" - @usableFromInline static let mediaSession: JSString = "mediaSession" - @usableFromInline static let mediaSourceId: JSString = "mediaSourceId" - @usableFromInline static let mediaStream: JSString = "mediaStream" - @usableFromInline static let mediaStreamTrack: JSString = "mediaStreamTrack" @usableFromInline static let mediaText: JSString = "mediaText" - @usableFromInline static let mediaTime: JSString = "mediaTime" - @usableFromInline static let mediaType: JSString = "mediaType" - @usableFromInline static let mediation: JSString = "mediation" @usableFromInline static let meetOrSlice: JSString = "meetOrSlice" @usableFromInline static let menubar: JSString = "menubar" @usableFromInline static let message: JSString = "message" - @usableFromInline static let messageType: JSString = "messageType" - @usableFromInline static let messages: JSString = "messages" - @usableFromInline static let messagesReceived: JSString = "messagesReceived" - @usableFromInline static let messagesSent: JSString = "messagesSent" @usableFromInline static let metaKey: JSString = "metaKey" - @usableFromInline static let metadata: JSString = "metadata" @usableFromInline static let method: JSString = "method" - @usableFromInline static let methodData: JSString = "methodData" - @usableFromInline static let methodDetails: JSString = "methodDetails" - @usableFromInline static let methodName: JSString = "methodName" - @usableFromInline static let mid: JSString = "mid" @usableFromInline static let mimeType: JSString = "mimeType" @usableFromInline static let mimeTypes: JSString = "mimeTypes" @usableFromInline static let min: JSString = "min" - @usableFromInline static let minBindingSize: JSString = "minBindingSize" - @usableFromInline static let minContentSize: JSString = "minContentSize" - @usableFromInline static let minDecibels: JSString = "minDecibels" - @usableFromInline static let minFilter: JSString = "minFilter" - @usableFromInline static let minInterval: JSString = "minInterval" @usableFromInline static let minLength: JSString = "minLength" - @usableFromInline static let minRtt: JSString = "minRtt" - @usableFromInline static let minSamplingFrequency: JSString = "minSamplingFrequency" - @usableFromInline static let minStorageBufferOffsetAlignment: JSString = "minStorageBufferOffsetAlignment" - @usableFromInline static let minUniformBufferOffsetAlignment: JSString = "minUniformBufferOffsetAlignment" - @usableFromInline static let minValue: JSString = "minValue" - @usableFromInline static let minimumValue: JSString = "minimumValue" - @usableFromInline static let mipLevel: JSString = "mipLevel" - @usableFromInline static let mipLevelCount: JSString = "mipLevelCount" - @usableFromInline static let mipLevels: JSString = "mipLevels" - @usableFromInline static let mipmapFilter: JSString = "mipmapFilter" @usableFromInline static let miterLimit: JSString = "miterLimit" - @usableFromInline static let ml: JSString = "ml" - @usableFromInline static let mm: JSString = "mm" - @usableFromInline static let mobile: JSString = "mobile" - @usableFromInline static let mockSensorType: JSString = "mockSensorType" @usableFromInline static let mode: JSString = "mode" - @usableFromInline static let model: JSString = "model" @usableFromInline static let modifierAltGraph: JSString = "modifierAltGraph" @usableFromInline static let modifierCapsLock: JSString = "modifierCapsLock" @usableFromInline static let modifierFn: JSString = "modifierFn" @@ -3183,63 +1115,23 @@ import JavaScriptKit @usableFromInline static let modifierSuper: JSString = "modifierSuper" @usableFromInline static let modifierSymbol: JSString = "modifierSymbol" @usableFromInline static let modifierSymbolLock: JSString = "modifierSymbolLock" - @usableFromInline static let modifiers: JSString = "modifiers" - @usableFromInline static let module: JSString = "module" - @usableFromInline static let modulusLength: JSString = "modulusLength" - @usableFromInline static let moveBy: JSString = "moveBy" @usableFromInline static let moveTo: JSString = "moveTo" - @usableFromInline static let movementX: JSString = "movementX" - @usableFromInline static let movementY: JSString = "movementY" - @usableFromInline static let ms: JSString = "ms" - @usableFromInline static let mtu: JSString = "mtu" - @usableFromInline static let mul: JSString = "mul" - @usableFromInline static let multiDrawArraysInstancedBaseInstanceWEBGL: JSString = "multiDrawArraysInstancedBaseInstanceWEBGL" - @usableFromInline static let multiDrawArraysInstancedWEBGL: JSString = "multiDrawArraysInstancedWEBGL" - @usableFromInline static let multiDrawArraysWEBGL: JSString = "multiDrawArraysWEBGL" - @usableFromInline static let multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL: JSString = "multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL" - @usableFromInline static let multiDrawElementsInstancedWEBGL: JSString = "multiDrawElementsInstancedWEBGL" - @usableFromInline static let multiDrawElementsWEBGL: JSString = "multiDrawElementsWEBGL" - @usableFromInline static let multiEntry: JSString = "multiEntry" @usableFromInline static let multiple: JSString = "multiple" @usableFromInline static let multiply: JSString = "multiply" @usableFromInline static let multiplySelf: JSString = "multiplySelf" - @usableFromInline static let multisample: JSString = "multisample" - @usableFromInline static let multisampled: JSString = "multisampled" - @usableFromInline static let mutable: JSString = "mutable" @usableFromInline static let muted: JSString = "muted" - @usableFromInline static let n: JSString = "n" - @usableFromInline static let nackCount: JSString = "nackCount" @usableFromInline static let name: JSString = "name" - @usableFromInline static let nameList: JSString = "nameList" - @usableFromInline static let namePrefix: JSString = "namePrefix" - @usableFromInline static let namedCurve: JSString = "namedCurve" - @usableFromInline static let namedFlows: JSString = "namedFlows" @usableFromInline static let namedItem: JSString = "namedItem" @usableFromInline static let namespaceURI: JSString = "namespaceURI" - @usableFromInline static let nativeProjectionScaleFactor: JSString = "nativeProjectionScaleFactor" @usableFromInline static let naturalHeight: JSString = "naturalHeight" @usableFromInline static let naturalWidth: JSString = "naturalWidth" - @usableFromInline static let navigate: JSString = "navigate" - @usableFromInline static let navigation: JSString = "navigation" @usableFromInline static let navigationPreload: JSString = "navigationPreload" - @usableFromInline static let navigationStart: JSString = "navigationStart" - @usableFromInline static let navigationType: JSString = "navigationType" - @usableFromInline static let navigationUI: JSString = "navigationUI" @usableFromInline static let navigator: JSString = "navigator" - @usableFromInline static let near: JSString = "near" - @usableFromInline static let needsRedraw: JSString = "needsRedraw" - @usableFromInline static let neg: JSString = "neg" - @usableFromInline static let negative: JSString = "negative" - @usableFromInline static let negotiated: JSString = "negotiated" - @usableFromInline static let networkPriority: JSString = "networkPriority" @usableFromInline static let networkState: JSString = "networkState" - @usableFromInline static let newSubscription: JSString = "newSubscription" @usableFromInline static let newURL: JSString = "newURL" @usableFromInline static let newValue: JSString = "newValue" @usableFromInline static let newValueSpecifiedUnits: JSString = "newValueSpecifiedUnits" - @usableFromInline static let newVersion: JSString = "newVersion" @usableFromInline static let nextElementSibling: JSString = "nextElementSibling" - @usableFromInline static let nextHopProtocol: JSString = "nextHopProtocol" @usableFromInline static let nextNode: JSString = "nextNode" @usableFromInline static let nextSibling: JSString = "nextSibling" @usableFromInline static let noHref: JSString = "noHref" @@ -3248,115 +1140,48 @@ import JavaScriptKit @usableFromInline static let noShade: JSString = "noShade" @usableFromInline static let noValidate: JSString = "noValidate" @usableFromInline static let noWrap: JSString = "noWrap" - @usableFromInline static let node: JSString = "node" @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 nominated: JSString = "nominated" @usableFromInline static let nonce: JSString = "nonce" - @usableFromInline static let normDepthBufferFromNormView: JSString = "normDepthBufferFromNormView" @usableFromInline static let normalize: JSString = "normalize" - @usableFromInline static let notification: JSString = "notification" - @usableFromInline static let notify: JSString = "notify" @usableFromInline static let now: JSString = "now" - @usableFromInline static let numIncomingStreamsCreated: JSString = "numIncomingStreamsCreated" - @usableFromInline static let numOctaves: JSString = "numOctaves" - @usableFromInline static let numOutgoingStreamsCreated: JSString = "numOutgoingStreamsCreated" - @usableFromInline static let numReceivedDatagramsDropped: JSString = "numReceivedDatagramsDropped" - @usableFromInline static let number: JSString = "number" @usableFromInline static let numberOfChannels: JSString = "numberOfChannels" @usableFromInline static let numberOfFrames: JSString = "numberOfFrames" - @usableFromInline static let numberOfInputs: JSString = "numberOfInputs" @usableFromInline static let numberOfItems: JSString = "numberOfItems" - @usableFromInline static let numberOfOutputs: JSString = "numberOfOutputs" @usableFromInline static let numberValue: JSString = "numberValue" - @usableFromInline static let objectStore: JSString = "objectStore" - @usableFromInline static let objectStoreNames: JSString = "objectStoreNames" @usableFromInline static let observe: JSString = "observe" - @usableFromInline static let occlusionQuerySet: JSString = "occlusionQuerySet" - @usableFromInline static let offerToReceiveAudio: JSString = "offerToReceiveAudio" - @usableFromInline static let offerToReceiveVideo: JSString = "offerToReceiveVideo" @usableFromInline static let offset: JSString = "offset" - @usableFromInline static let offsetHeight: JSString = "offsetHeight" - @usableFromInline static let offsetLeft: JSString = "offsetLeft" - @usableFromInline static let offsetNode: JSString = "offsetNode" - @usableFromInline static let offsetParent: JSString = "offsetParent" - @usableFromInline static let offsetRay: JSString = "offsetRay" - @usableFromInline static let offsetTop: JSString = "offsetTop" - @usableFromInline static let offsetWidth: JSString = "offsetWidth" - @usableFromInline static let offsetX: JSString = "offsetX" - @usableFromInline static let offsetY: JSString = "offsetY" @usableFromInline static let ok: JSString = "ok" - @usableFromInline static let oldSubscription: JSString = "oldSubscription" @usableFromInline static let oldURL: JSString = "oldURL" @usableFromInline static let oldValue: JSString = "oldValue" - @usableFromInline static let oldVersion: JSString = "oldVersion" @usableFromInline static let onLine: JSString = "onLine" - @usableFromInline static let onSubmittedWorkDone: JSString = "onSubmittedWorkDone" @usableFromInline static let onabort: JSString = "onabort" - @usableFromInline static let onactivate: JSString = "onactivate" @usableFromInline static let onaddsourcebuffer: JSString = "onaddsourcebuffer" @usableFromInline static let onaddtrack: JSString = "onaddtrack" - @usableFromInline static let onadvertisementreceived: JSString = "onadvertisementreceived" @usableFromInline static let onafterprint: JSString = "onafterprint" - @usableFromInline static let onanimationcancel: JSString = "onanimationcancel" - @usableFromInline static let onanimationend: JSString = "onanimationend" - @usableFromInline static let onanimationiteration: JSString = "onanimationiteration" - @usableFromInline static let onanimationstart: JSString = "onanimationstart" - @usableFromInline static let onappinstalled: JSString = "onappinstalled" - @usableFromInline static let onaudioend: JSString = "onaudioend" - @usableFromInline static let onaudioprocess: JSString = "onaudioprocess" - @usableFromInline static let onaudiostart: JSString = "onaudiostart" @usableFromInline static let onauxclick: JSString = "onauxclick" - @usableFromInline static let onavailabilitychanged: JSString = "onavailabilitychanged" - @usableFromInline static let onbeforeinstallprompt: JSString = "onbeforeinstallprompt" @usableFromInline static let onbeforeprint: JSString = "onbeforeprint" @usableFromInline static let onbeforeunload: JSString = "onbeforeunload" - @usableFromInline static let onbeforexrselect: JSString = "onbeforexrselect" - @usableFromInline static let onbegin: JSString = "onbegin" - @usableFromInline static let onblocked: JSString = "onblocked" @usableFromInline static let onblur: JSString = "onblur" - @usableFromInline static let onboundary: JSString = "onboundary" - @usableFromInline static let onbufferedamountlow: JSString = "onbufferedamountlow" @usableFromInline static let oncancel: JSString = "oncancel" @usableFromInline static let oncanplay: JSString = "oncanplay" @usableFromInline static let oncanplaythrough: JSString = "oncanplaythrough" @usableFromInline static let once: JSString = "once" @usableFromInline static let onchange: JSString = "onchange" - @usableFromInline static let oncharacterboundsupdate: JSString = "oncharacterboundsupdate" - @usableFromInline static let oncharacteristicvaluechanged: JSString = "oncharacteristicvaluechanged" - @usableFromInline static let onchargingchange: JSString = "onchargingchange" - @usableFromInline static let onchargingtimechange: JSString = "onchargingtimechange" @usableFromInline static let onclick: JSString = "onclick" @usableFromInline static let onclose: JSString = "onclose" - @usableFromInline static let onclosing: JSString = "onclosing" - @usableFromInline static let oncompassneedscalibration: JSString = "oncompassneedscalibration" - @usableFromInline static let oncomplete: JSString = "oncomplete" - @usableFromInline static let oncompositionend: JSString = "oncompositionend" - @usableFromInline static let oncompositionstart: JSString = "oncompositionstart" - @usableFromInline static let onconnect: JSString = "onconnect" - @usableFromInline static let onconnecting: JSString = "onconnecting" - @usableFromInline static let onconnectionavailable: JSString = "onconnectionavailable" - @usableFromInline static let onconnectionstatechange: JSString = "onconnectionstatechange" @usableFromInline static let oncontextlost: JSString = "oncontextlost" @usableFromInline static let oncontextmenu: JSString = "oncontextmenu" @usableFromInline static let oncontextrestored: JSString = "oncontextrestored" @usableFromInline static let oncontrollerchange: JSString = "oncontrollerchange" @usableFromInline static let oncopy: JSString = "oncopy" @usableFromInline static let oncuechange: JSString = "oncuechange" - @usableFromInline static let oncurrententrychange: JSString = "oncurrententrychange" @usableFromInline static let oncut: JSString = "oncut" @usableFromInline static let ondataavailable: JSString = "ondataavailable" - @usableFromInline static let ondatachannel: JSString = "ondatachannel" @usableFromInline static let ondblclick: JSString = "ondblclick" @usableFromInline static let ondevicechange: JSString = "ondevicechange" - @usableFromInline static let ondevicemotion: JSString = "ondevicemotion" - @usableFromInline static let ondeviceorientation: JSString = "ondeviceorientation" - @usableFromInline static let ondeviceorientationabsolute: JSString = "ondeviceorientationabsolute" - @usableFromInline static let ondischargingtimechange: JSString = "ondischargingtimechange" - @usableFromInline static let ondisconnect: JSString = "ondisconnect" - @usableFromInline static let ondispose: JSString = "ondispose" @usableFromInline static let ondrag: JSString = "ondrag" @usableFromInline static let ondragend: JSString = "ondragend" @usableFromInline static let ondragenter: JSString = "ondragenter" @@ -3365,60 +1190,28 @@ import JavaScriptKit @usableFromInline static let ondragstart: JSString = "ondragstart" @usableFromInline static let ondrop: JSString = "ondrop" @usableFromInline static let ondurationchange: JSString = "ondurationchange" - @usableFromInline static let oneRealm: JSString = "oneRealm" @usableFromInline static let onemptied: JSString = "onemptied" - @usableFromInline static let onencrypted: JSString = "onencrypted" - @usableFromInline static let onend: JSString = "onend" @usableFromInline static let onended: JSString = "onended" @usableFromInline static let onenter: JSString = "onenter" - @usableFromInline static let onenterpictureinpicture: JSString = "onenterpictureinpicture" @usableFromInline static let onerror: JSString = "onerror" @usableFromInline static let onexit: JSString = "onexit" @usableFromInline static let onfinish: JSString = "onfinish" @usableFromInline static let onfocus: JSString = "onfocus" @usableFromInline static let onformdata: JSString = "onformdata" - @usableFromInline static let onframeratechange: JSString = "onframeratechange" - @usableFromInline static let onfreeze: JSString = "onfreeze" - @usableFromInline static let onfullscreenchange: JSString = "onfullscreenchange" - @usableFromInline static let onfullscreenerror: JSString = "onfullscreenerror" - @usableFromInline static let ongamepadconnected: JSString = "ongamepadconnected" - @usableFromInline static let ongamepaddisconnected: JSString = "ongamepaddisconnected" - @usableFromInline static let ongatheringstatechange: JSString = "ongatheringstatechange" - @usableFromInline static let ongattserverdisconnected: JSString = "ongattserverdisconnected" - @usableFromInline static let ongeometrychange: JSString = "ongeometrychange" - @usableFromInline static let ongotpointercapture: JSString = "ongotpointercapture" @usableFromInline static let onhashchange: JSString = "onhashchange" - @usableFromInline static let onicecandidate: JSString = "onicecandidate" - @usableFromInline static let onicecandidateerror: JSString = "onicecandidateerror" - @usableFromInline static let oniceconnectionstatechange: JSString = "oniceconnectionstatechange" - @usableFromInline static let onicegatheringstatechange: JSString = "onicegatheringstatechange" @usableFromInline static let oninput: JSString = "oninput" - @usableFromInline static let oninputreport: JSString = "oninputreport" - @usableFromInline static let oninputsourceschange: JSString = "oninputsourceschange" @usableFromInline static let oninvalid: JSString = "oninvalid" - @usableFromInline static let onisolationchange: JSString = "onisolationchange" @usableFromInline static let onkeydown: JSString = "onkeydown" @usableFromInline static let onkeypress: JSString = "onkeypress" - @usableFromInline static let onkeystatuseschange: JSString = "onkeystatuseschange" @usableFromInline static let onkeyup: JSString = "onkeyup" @usableFromInline static let onlanguagechange: JSString = "onlanguagechange" - @usableFromInline static let onlayoutchange: JSString = "onlayoutchange" - @usableFromInline static let onleavepictureinpicture: JSString = "onleavepictureinpicture" - @usableFromInline static let onlevelchange: JSString = "onlevelchange" @usableFromInline static let onload: JSString = "onload" @usableFromInline static let onloadeddata: JSString = "onloadeddata" @usableFromInline static let onloadedmetadata: JSString = "onloadedmetadata" @usableFromInline static let onloadend: JSString = "onloadend" - @usableFromInline static let onloading: JSString = "onloading" - @usableFromInline static let onloadingdone: JSString = "onloadingdone" - @usableFromInline static let onloadingerror: JSString = "onloadingerror" @usableFromInline static let onloadstart: JSString = "onloadstart" - @usableFromInline static let onlostpointercapture: JSString = "onlostpointercapture" - @usableFromInline static let only: JSString = "only" - @usableFromInline static let onmark: JSString = "onmark" @usableFromInline static let onmessage: JSString = "onmessage" @usableFromInline static let onmessageerror: JSString = "onmessageerror" - @usableFromInline static let onmidimessage: JSString = "onmidimessage" @usableFromInline static let onmousedown: JSString = "onmousedown" @usableFromInline static let onmouseenter: JSString = "onmouseenter" @usableFromInline static let onmouseleave: JSString = "onmouseleave" @@ -3427,107 +1220,45 @@ import JavaScriptKit @usableFromInline static let onmouseover: JSString = "onmouseover" @usableFromInline static let onmouseup: JSString = "onmouseup" @usableFromInline static let onmute: JSString = "onmute" - @usableFromInline static let onnavigate: JSString = "onnavigate" - @usableFromInline static let onnavigateerror: JSString = "onnavigateerror" - @usableFromInline static let onnavigatefrom: JSString = "onnavigatefrom" - @usableFromInline static let onnavigatesuccess: JSString = "onnavigatesuccess" - @usableFromInline static let onnavigateto: JSString = "onnavigateto" - @usableFromInline static let onnegotiationneeded: JSString = "onnegotiationneeded" - @usableFromInline static let onnomatch: JSString = "onnomatch" @usableFromInline static let onoffline: JSString = "onoffline" @usableFromInline static let ononline: JSString = "ononline" @usableFromInline static let onopen: JSString = "onopen" - @usableFromInline static let onorientationchange: JSString = "onorientationchange" @usableFromInline static let onpagehide: JSString = "onpagehide" @usableFromInline static let onpageshow: JSString = "onpageshow" @usableFromInline static let onpaste: JSString = "onpaste" @usableFromInline static let onpause: JSString = "onpause" - @usableFromInline static let onpaymentmethodchange: JSString = "onpaymentmethodchange" @usableFromInline static let onplay: JSString = "onplay" @usableFromInline static let onplaying: JSString = "onplaying" - @usableFromInline static let onpointercancel: JSString = "onpointercancel" - @usableFromInline static let onpointerdown: JSString = "onpointerdown" - @usableFromInline static let onpointerenter: JSString = "onpointerenter" - @usableFromInline static let onpointerleave: JSString = "onpointerleave" - @usableFromInline static let onpointerlockchange: JSString = "onpointerlockchange" - @usableFromInline static let onpointerlockerror: JSString = "onpointerlockerror" - @usableFromInline static let onpointermove: JSString = "onpointermove" - @usableFromInline static let onpointerout: JSString = "onpointerout" - @usableFromInline static let onpointerover: JSString = "onpointerover" - @usableFromInline static let onpointerrawupdate: JSString = "onpointerrawupdate" - @usableFromInline static let onpointerup: JSString = "onpointerup" @usableFromInline static let onpopstate: JSString = "onpopstate" - @usableFromInline static let onportalactivate: JSString = "onportalactivate" - @usableFromInline static let onprioritychange: JSString = "onprioritychange" - @usableFromInline static let onprocessorerror: JSString = "onprocessorerror" @usableFromInline static let onprogress: JSString = "onprogress" @usableFromInline static let onratechange: JSString = "onratechange" - @usableFromInline static let onreading: JSString = "onreading" - @usableFromInline static let onreadingerror: JSString = "onreadingerror" @usableFromInline static let onreadystatechange: JSString = "onreadystatechange" - @usableFromInline static let onredraw: JSString = "onredraw" - @usableFromInline static let onreflectionchange: JSString = "onreflectionchange" @usableFromInline static let onrejectionhandled: JSString = "onrejectionhandled" - @usableFromInline static let onrelease: JSString = "onrelease" @usableFromInline static let onremove: JSString = "onremove" @usableFromInline static let onremovesourcebuffer: JSString = "onremovesourcebuffer" @usableFromInline static let onremovetrack: JSString = "onremovetrack" - @usableFromInline static let onrepeat: JSString = "onrepeat" @usableFromInline static let onreset: JSString = "onreset" @usableFromInline static let onresize: JSString = "onresize" - @usableFromInline static let onresourcetimingbufferfull: JSString = "onresourcetimingbufferfull" - @usableFromInline static let onresult: JSString = "onresult" @usableFromInline static let onresume: JSString = "onresume" @usableFromInline static let onscroll: JSString = "onscroll" @usableFromInline static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" @usableFromInline static let onseeked: JSString = "onseeked" @usableFromInline static let onseeking: JSString = "onseeking" @usableFromInline static let onselect: JSString = "onselect" - @usableFromInline static let onselectedcandidatepairchange: JSString = "onselectedcandidatepairchange" - @usableFromInline static let onselectend: JSString = "onselectend" - @usableFromInline static let onselectionchange: JSString = "onselectionchange" - @usableFromInline static let onselectstart: JSString = "onselectstart" - @usableFromInline static let onserviceadded: JSString = "onserviceadded" - @usableFromInline static let onservicechanged: JSString = "onservicechanged" - @usableFromInline static let onserviceremoved: JSString = "onserviceremoved" - @usableFromInline static let onshow: JSString = "onshow" - @usableFromInline static let onsignalingstatechange: JSString = "onsignalingstatechange" @usableFromInline static let onslotchange: JSString = "onslotchange" - @usableFromInline static let onsoundend: JSString = "onsoundend" - @usableFromInline static let onsoundstart: JSString = "onsoundstart" @usableFromInline static let onsourceclose: JSString = "onsourceclose" @usableFromInline static let onsourceended: JSString = "onsourceended" @usableFromInline static let onsourceopen: JSString = "onsourceopen" - @usableFromInline static let onspeechend: JSString = "onspeechend" - @usableFromInline static let onspeechstart: JSString = "onspeechstart" - @usableFromInline static let onsqueeze: JSString = "onsqueeze" - @usableFromInline static let onsqueezeend: JSString = "onsqueezeend" - @usableFromInline static let onsqueezestart: JSString = "onsqueezestart" @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 onsuccess: JSString = "onsuccess" @usableFromInline static let onsuspend: JSString = "onsuspend" - @usableFromInline static let onterminate: JSString = "onterminate" - @usableFromInline static let ontextformatupdate: JSString = "ontextformatupdate" - @usableFromInline static let ontextupdate: JSString = "ontextupdate" @usableFromInline static let ontimeout: JSString = "ontimeout" @usableFromInline static let ontimeupdate: JSString = "ontimeupdate" @usableFromInline static let ontoggle: JSString = "ontoggle" - @usableFromInline static let ontonechange: JSString = "ontonechange" - @usableFromInline static let ontouchcancel: JSString = "ontouchcancel" - @usableFromInline static let ontouchend: JSString = "ontouchend" - @usableFromInline static let ontouchmove: JSString = "ontouchmove" - @usableFromInline static let ontouchstart: JSString = "ontouchstart" - @usableFromInline static let ontrack: JSString = "ontrack" - @usableFromInline static let ontransitioncancel: JSString = "ontransitioncancel" - @usableFromInline static let ontransitionend: JSString = "ontransitionend" - @usableFromInline static let ontransitionrun: JSString = "ontransitionrun" - @usableFromInline static let ontransitionstart: JSString = "ontransitionstart" - @usableFromInline static let onuncapturederror: JSString = "onuncapturederror" @usableFromInline static let onunhandledrejection: JSString = "onunhandledrejection" @usableFromInline static let onunload: JSString = "onunload" @usableFromInline static let onunmute: JSString = "onunmute" @@ -3535,131 +1266,47 @@ import JavaScriptKit @usableFromInline static let onupdateend: JSString = "onupdateend" @usableFromInline static let onupdatefound: JSString = "onupdatefound" @usableFromInline static let onupdatestart: JSString = "onupdatestart" - @usableFromInline static let onupgradeneeded: JSString = "onupgradeneeded" - @usableFromInline static let onversionchange: JSString = "onversionchange" @usableFromInline static let onvisibilitychange: JSString = "onvisibilitychange" - @usableFromInline static let onvoiceschanged: JSString = "onvoiceschanged" @usableFromInline static let onvolumechange: JSString = "onvolumechange" @usableFromInline static let onwaiting: JSString = "onwaiting" - @usableFromInline static let onwaitingforkey: JSString = "onwaitingforkey" @usableFromInline static let onwebkitanimationend: JSString = "onwebkitanimationend" @usableFromInline static let onwebkitanimationiteration: JSString = "onwebkitanimationiteration" @usableFromInline static let onwebkitanimationstart: JSString = "onwebkitanimationstart" @usableFromInline static let onwebkittransitionend: JSString = "onwebkittransitionend" @usableFromInline static let onwheel: JSString = "onwheel" @usableFromInline static let open: JSString = "open" - @usableFromInline static let openCursor: JSString = "openCursor" - @usableFromInline static let openKeyCursor: JSString = "openKeyCursor" - @usableFromInline static let opened: JSString = "opened" @usableFromInline static let opener: JSString = "opener" - @usableFromInline static let operation: JSString = "operation" - @usableFromInline static let `operator`: JSString = "operator" @usableFromInline static let optimizeForLatency: JSString = "optimizeForLatency" @usableFromInline static let optimum: JSString = "optimum" - @usableFromInline static let optionalFeatures: JSString = "optionalFeatures" - @usableFromInline static let optionalManufacturerData: JSString = "optionalManufacturerData" - @usableFromInline static let optionalServices: JSString = "optionalServices" @usableFromInline static let options: JSString = "options" - @usableFromInline static let orderX: JSString = "orderX" - @usableFromInline static let orderY: JSString = "orderY" - @usableFromInline static let ordered: JSString = "ordered" - @usableFromInline static let organization: JSString = "organization" @usableFromInline static let orient: JSString = "orient" @usableFromInline static let orientAngle: JSString = "orientAngle" @usableFromInline static let orientType: JSString = "orientType" - @usableFromInline static let orientation: JSString = "orientation" - @usableFromInline static let orientationX: JSString = "orientationX" - @usableFromInline static let orientationY: JSString = "orientationY" - @usableFromInline static let orientationZ: JSString = "orientationZ" @usableFromInline static let origin: JSString = "origin" @usableFromInline static let originAgentCluster: JSString = "originAgentCluster" - @usableFromInline static let originPolicyIds: JSString = "originPolicyIds" @usableFromInline static let originTime: JSString = "originTime" - @usableFromInline static let originalPolicy: JSString = "originalPolicy" - @usableFromInline static let ornaments: JSString = "ornaments" @usableFromInline static let oscpu: JSString = "oscpu" - @usableFromInline static let oth: JSString = "oth" - @usableFromInline static let otp: JSString = "otp" - @usableFromInline static let outerHTML: JSString = "outerHTML" - @usableFromInline static let outerHeight: JSString = "outerHeight" @usableFromInline static let outerText: JSString = "outerText" - @usableFromInline static let outerWidth: JSString = "outerWidth" - @usableFromInline static let outgoingHighWaterMark: JSString = "outgoingHighWaterMark" - @usableFromInline static let outgoingMaxAge: JSString = "outgoingMaxAge" @usableFromInline static let output: JSString = "output" - @usableFromInline static let outputBuffer: JSString = "outputBuffer" - @usableFromInline static let outputChannelCount: JSString = "outputChannelCount" - @usableFromInline static let outputLatency: JSString = "outputLatency" - @usableFromInline static let outputPadding: JSString = "outputPadding" - @usableFromInline static let outputReports: JSString = "outputReports" - @usableFromInline static let outputSizes: JSString = "outputSizes" - @usableFromInline static let outputs: JSString = "outputs" - @usableFromInline static let overlaysContent: JSString = "overlaysContent" - @usableFromInline static let overrideColors: JSString = "overrideColors" @usableFromInline static let overrideMimeType: JSString = "overrideMimeType" - @usableFromInline static let oversample: JSString = "oversample" - @usableFromInline static let overset: JSString = "overset" - @usableFromInline static let overwrite: JSString = "overwrite" @usableFromInline static let ownerDocument: JSString = "ownerDocument" @usableFromInline static let ownerElement: JSString = "ownerElement" @usableFromInline static let ownerNode: JSString = "ownerNode" @usableFromInline static let ownerRule: JSString = "ownerRule" @usableFromInline static let ownerSVGElement: JSString = "ownerSVGElement" - @usableFromInline static let p: JSString = "p" @usableFromInline static let p1: JSString = "p1" @usableFromInline static let p2: JSString = "p2" @usableFromInline static let p3: JSString = "p3" @usableFromInline static let p4: JSString = "p4" - @usableFromInline static let packetSize: JSString = "packetSize" - @usableFromInline static let packets: JSString = "packets" - @usableFromInline static let packetsContributedTo: JSString = "packetsContributedTo" - @usableFromInline static let packetsDiscarded: JSString = "packetsDiscarded" - @usableFromInline static let packetsDiscardedOnSend: JSString = "packetsDiscardedOnSend" - @usableFromInline static let packetsDuplicated: JSString = "packetsDuplicated" - @usableFromInline static let packetsFailedDecryption: JSString = "packetsFailedDecryption" - @usableFromInline static let packetsLost: JSString = "packetsLost" - @usableFromInline static let packetsReceived: JSString = "packetsReceived" - @usableFromInline static let packetsRepaired: JSString = "packetsRepaired" - @usableFromInline static let packetsSent: JSString = "packetsSent" - @usableFromInline static let pad: JSString = "pad" - @usableFromInline static let padding: JSString = "padding" - @usableFromInline static let pageLeft: JSString = "pageLeft" - @usableFromInline static let pageTop: JSString = "pageTop" - @usableFromInline static let pageX: JSString = "pageX" - @usableFromInline static let pageXOffset: JSString = "pageXOffset" - @usableFromInline static let pageY: JSString = "pageY" - @usableFromInline static let pageYOffset: JSString = "pageYOffset" - @usableFromInline static let paintWorklet: JSString = "paintWorklet" - @usableFromInline static let palettes: JSString = "palettes" - @usableFromInline static let pan: JSString = "pan" @usableFromInline static let panTiltZoom: JSString = "panTiltZoom" - @usableFromInline static let panningModel: JSString = "panningModel" - @usableFromInline static let parameterData: JSString = "parameterData" - @usableFromInline static let parameters: JSString = "parameters" @usableFromInline static let parent: JSString = "parent" @usableFromInline static let parentElement: JSString = "parentElement" - @usableFromInline static let parentId: JSString = "parentId" @usableFromInline static let parentNode: JSString = "parentNode" @usableFromInline static let parentRule: JSString = "parentRule" @usableFromInline static let parentStyleSheet: JSString = "parentStyleSheet" - @usableFromInline static let parity: JSString = "parity" - @usableFromInline static let parse: JSString = "parse" - @usableFromInline static let parseAll: JSString = "parseAll" - @usableFromInline static let parseCommaValueList: JSString = "parseCommaValueList" - @usableFromInline static let parseDeclaration: JSString = "parseDeclaration" - @usableFromInline static let parseDeclarationList: JSString = "parseDeclarationList" @usableFromInline static let parseFromString: JSString = "parseFromString" - @usableFromInline static let parseRule: JSString = "parseRule" - @usableFromInline static let parseRuleList: JSString = "parseRuleList" - @usableFromInline static let parseStylesheet: JSString = "parseStylesheet" - @usableFromInline static let parseValue: JSString = "parseValue" - @usableFromInline static let parseValueList: JSString = "parseValueList" - @usableFromInline static let part: JSString = "part" - @usableFromInline static let partialFramesLost: JSString = "partialFramesLost" - @usableFromInline static let passOp: JSString = "passOp" @usableFromInline static let passive: JSString = "passive" @usableFromInline static let password: JSString = "password" - @usableFromInline static let path: JSString = "path" @usableFromInline static let pathLength: JSString = "pathLength" @usableFromInline static let pathname: JSString = "pathname" @usableFromInline static let pattern: JSString = "pattern" @@ -3668,351 +1315,125 @@ import JavaScriptKit @usableFromInline static let patternTransform: JSString = "patternTransform" @usableFromInline static let patternUnits: JSString = "patternUnits" @usableFromInline static let pause: JSString = "pause" - @usableFromInline static let pauseAnimations: JSString = "pauseAnimations" @usableFromInline static let pauseOnExit: JSString = "pauseOnExit" - @usableFromInline static let pauseTransformFeedback: JSString = "pauseTransformFeedback" @usableFromInline static let paused: JSString = "paused" - @usableFromInline static let payeeOrigin: JSString = "payeeOrigin" - @usableFromInline static let payloadType: JSString = "payloadType" - @usableFromInline static let payment: JSString = "payment" - @usableFromInline static let paymentManager: JSString = "paymentManager" - @usableFromInline static let paymentMethod: JSString = "paymentMethod" - @usableFromInline static let paymentMethodErrors: JSString = "paymentMethodErrors" - @usableFromInline static let paymentRequestId: JSString = "paymentRequestId" - @usableFromInline static let paymentRequestOrigin: JSString = "paymentRequestOrigin" - @usableFromInline static let pc: JSString = "pc" @usableFromInline static let pdfViewerEnabled: JSString = "pdfViewerEnabled" - @usableFromInline static let peerIdentity: JSString = "peerIdentity" @usableFromInline static let pending: JSString = "pending" - @usableFromInline static let pendingLocalDescription: JSString = "pendingLocalDescription" - @usableFromInline static let pendingRemoteDescription: JSString = "pendingRemoteDescription" - @usableFromInline static let perDscpPacketsReceived: JSString = "perDscpPacketsReceived" - @usableFromInline static let perDscpPacketsSent: JSString = "perDscpPacketsSent" - @usableFromInline static let percent: JSString = "percent" - @usableFromInline static let percentHint: JSString = "percentHint" - @usableFromInline static let percentageBlockSize: JSString = "percentageBlockSize" - @usableFromInline static let percentageInlineSize: JSString = "percentageInlineSize" @usableFromInline static let performance: JSString = "performance" - @usableFromInline static let performanceTime: JSString = "performanceTime" - @usableFromInline static let periodicSync: JSString = "periodicSync" - @usableFromInline static let periodicWave: JSString = "periodicWave" - @usableFromInline static let permission: JSString = "permission" - @usableFromInline static let permissionState: JSString = "permissionState" - @usableFromInline static let permissions: JSString = "permissions" - @usableFromInline static let permissionsPolicy: JSString = "permissionsPolicy" - @usableFromInline static let permutation: JSString = "permutation" @usableFromInline static let persist: JSString = "persist" @usableFromInline static let persisted: JSString = "persisted" - @usableFromInline static let persistentState: JSString = "persistentState" @usableFromInline static let personalbar: JSString = "personalbar" @usableFromInline static let phase: JSString = "phase" - @usableFromInline static let phone: JSString = "phone" - @usableFromInline static let physicalMaximum: JSString = "physicalMaximum" - @usableFromInline static let physicalMinimum: JSString = "physicalMinimum" - @usableFromInline static let pictureInPictureElement: JSString = "pictureInPictureElement" - @usableFromInline static let pictureInPictureEnabled: JSString = "pictureInPictureEnabled" - @usableFromInline static let pictureInPictureWindow: JSString = "pictureInPictureWindow" @usableFromInline static let ping: JSString = "ping" @usableFromInline static let pipeThrough: JSString = "pipeThrough" @usableFromInline static let pipeTo: JSString = "pipeTo" - @usableFromInline static let pitch: JSString = "pitch" - @usableFromInline static let pixelDepth: JSString = "pixelDepth" - @usableFromInline static let pixelStorei: JSString = "pixelStorei" @usableFromInline static let placeholder: JSString = "placeholder" @usableFromInline static let planeIndex: JSString = "planeIndex" @usableFromInline static let platform: JSString = "platform" - @usableFromInline static let platformVersion: JSString = "platformVersion" @usableFromInline static let play: JSString = "play" @usableFromInline static let playState: JSString = "playState" @usableFromInline static let playbackRate: JSString = "playbackRate" - @usableFromInline static let playbackState: JSString = "playbackState" - @usableFromInline static let playbackTime: JSString = "playbackTime" @usableFromInline static let played: JSString = "played" @usableFromInline static let playsInline: JSString = "playsInline" - @usableFromInline static let pliCount: JSString = "pliCount" @usableFromInline static let plugins: JSString = "plugins" @usableFromInline static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" - @usableFromInline static let pointerId: JSString = "pointerId" - @usableFromInline static let pointerLockElement: JSString = "pointerLockElement" - @usableFromInline static let pointerMovementScrolls: JSString = "pointerMovementScrolls" - @usableFromInline static let pointerType: JSString = "pointerType" @usableFromInline static let points: JSString = "points" - @usableFromInline static let pointsAtX: JSString = "pointsAtX" - @usableFromInline static let pointsAtY: JSString = "pointsAtY" - @usableFromInline static let pointsAtZ: JSString = "pointsAtZ" - @usableFromInline static let pointsOfInterest: JSString = "pointsOfInterest" - @usableFromInline static let polygonOffset: JSString = "polygonOffset" - @usableFromInline static let popDebugGroup: JSString = "popDebugGroup" - @usableFromInline static let popErrorScope: JSString = "popErrorScope" - @usableFromInline static let populateMatrix: JSString = "populateMatrix" @usableFromInline static let port: JSString = "port" @usableFromInline static let port1: JSString = "port1" @usableFromInline static let port2: JSString = "port2" - @usableFromInline static let portalHost: JSString = "portalHost" @usableFromInline static let ports: JSString = "ports" - @usableFromInline static let pose: JSString = "pose" @usableFromInline static let position: JSString = "position" - @usableFromInline static let positionAlign: JSString = "positionAlign" - @usableFromInline static let positionX: JSString = "positionX" - @usableFromInline static let positionY: JSString = "positionY" - @usableFromInline static let positionZ: JSString = "positionZ" @usableFromInline static let postMessage: JSString = "postMessage" - @usableFromInline static let postalCode: JSString = "postalCode" @usableFromInline static let poster: JSString = "poster" - @usableFromInline static let postscriptName: JSString = "postscriptName" - @usableFromInline static let pow: JSString = "pow" - @usableFromInline static let powerEfficient: JSString = "powerEfficient" - @usableFromInline static let powerPreference: JSString = "powerPreference" @usableFromInline static let preMultiplySelf: JSString = "preMultiplySelf" - @usableFromInline static let precision: JSString = "precision" - @usableFromInline static let predictedDisplayTime: JSString = "predictedDisplayTime" - @usableFromInline static let predictedEvents: JSString = "predictedEvents" @usableFromInline static let preferAnimation: JSString = "preferAnimation" - @usableFromInline static let preferCurrentTab: JSString = "preferCurrentTab" - @usableFromInline static let preferredReflectionFormat: JSString = "preferredReflectionFormat" @usableFromInline static let prefix: JSString = "prefix" @usableFromInline static let preload: JSString = "preload" @usableFromInline static let preloadResponse: JSString = "preloadResponse" - @usableFromInline static let prelude: JSString = "prelude" - @usableFromInline static let premultipliedAlpha: JSString = "premultipliedAlpha" @usableFromInline static let premultiplyAlpha: JSString = "premultiplyAlpha" @usableFromInline static let prepend: JSString = "prepend" - @usableFromInline static let presentation: JSString = "presentation" - @usableFromInline static let presentationArea: JSString = "presentationArea" - @usableFromInline static let presentationStyle: JSString = "presentationStyle" - @usableFromInline static let presentationTime: JSString = "presentationTime" - @usableFromInline static let presentedFrames: JSString = "presentedFrames" - @usableFromInline static let preserveAlpha: JSString = "preserveAlpha" @usableFromInline static let preserveAspectRatio: JSString = "preserveAspectRatio" - @usableFromInline static let preserveDrawingBuffer: JSString = "preserveDrawingBuffer" @usableFromInline static let preservesPitch: JSString = "preservesPitch" - @usableFromInline static let pressed: JSString = "pressed" - @usableFromInline static let pressure: JSString = "pressure" @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 preventSilentAccess: JSString = "preventSilentAccess" @usableFromInline static let previousElementSibling: JSString = "previousElementSibling" @usableFromInline static let previousNode: JSString = "previousNode" - @usableFromInline static let previousPriority: JSString = "previousPriority" - @usableFromInline static let previousRect: JSString = "previousRect" @usableFromInline static let previousSibling: JSString = "previousSibling" - @usableFromInline static let price: JSString = "price" @usableFromInline static let primaries: JSString = "primaries" - @usableFromInline static let primaryKey: JSString = "primaryKey" - @usableFromInline static let primaryLightDirection: JSString = "primaryLightDirection" - @usableFromInline static let primaryLightIntensity: JSString = "primaryLightIntensity" - @usableFromInline static let primitive: JSString = "primitive" - @usableFromInline static let primitiveUnits: JSString = "primitiveUnits" @usableFromInline static let print: JSString = "print" - @usableFromInline static let priority: JSString = "priority" - @usableFromInline static let privateKey: JSString = "privateKey" - @usableFromInline static let probeSpace: JSString = "probeSpace" - @usableFromInline static let processingDuration: JSString = "processingDuration" - @usableFromInline static let processingEnd: JSString = "processingEnd" - @usableFromInline static let processingStart: JSString = "processingStart" - @usableFromInline static let processorOptions: JSString = "processorOptions" - @usableFromInline static let produceCropTarget: JSString = "produceCropTarget" @usableFromInline static let product: JSString = "product" - @usableFromInline static let productId: JSString = "productId" - @usableFromInline static let productName: JSString = "productName" @usableFromInline static let productSub: JSString = "productSub" - @usableFromInline static let profile: JSString = "profile" - @usableFromInline static let profiles: JSString = "profiles" @usableFromInline static let progress: JSString = "progress" - @usableFromInline static let projectionMatrix: JSString = "projectionMatrix" @usableFromInline static let promise: JSString = "promise" @usableFromInline static let prompt: JSString = "prompt" - @usableFromInline static let properties: JSString = "properties" - @usableFromInline static let propertyName: JSString = "propertyName" @usableFromInline static let `protocol`: JSString = "protocol" - @usableFromInline static let protocolCode: JSString = "protocolCode" - @usableFromInline static let protocols: JSString = "protocols" - @usableFromInline static let provider: JSString = "provider" - @usableFromInline static let providers: JSString = "providers" @usableFromInline static let pseudo: JSString = "pseudo" @usableFromInline static let pseudoElement: JSString = "pseudoElement" - @usableFromInline static let pt: JSString = "pt" - @usableFromInline static let pubKeyCredParams: JSString = "pubKeyCredParams" - @usableFromInline static let `public`: JSString = "public" - @usableFromInline static let publicExponent: JSString = "publicExponent" @usableFromInline static let publicId: JSString = "publicId" - @usableFromInline static let publicKey: JSString = "publicKey" @usableFromInline static let pull: JSString = "pull" - @usableFromInline static let pulse: JSString = "pulse" - @usableFromInline static let purchaseToken: JSString = "purchaseToken" - @usableFromInline static let pushDebugGroup: JSString = "pushDebugGroup" - @usableFromInline static let pushErrorScope: JSString = "pushErrorScope" - @usableFromInline static let pushManager: JSString = "pushManager" @usableFromInline static let pushState: JSString = "pushState" @usableFromInline static let put: JSString = "put" @usableFromInline static let putImageData: JSString = "putImageData" - @usableFromInline static let px: JSString = "px" - @usableFromInline static let q: JSString = "q" - @usableFromInline static let qi: JSString = "qi" - @usableFromInline static let qpSum: JSString = "qpSum" @usableFromInline static let quadraticCurveTo: JSString = "quadraticCurveTo" @usableFromInline static let quality: JSString = "quality" - @usableFromInline static let qualityLimitationDurations: JSString = "qualityLimitationDurations" - @usableFromInline static let qualityLimitationReason: JSString = "qualityLimitationReason" - @usableFromInline static let qualityLimitationResolutionChanges: JSString = "qualityLimitationResolutionChanges" - @usableFromInline static let quaternion: JSString = "quaternion" - @usableFromInline static let query: JSString = "query" @usableFromInline static let queryCommandEnabled: JSString = "queryCommandEnabled" @usableFromInline static let queryCommandIndeterm: JSString = "queryCommandIndeterm" @usableFromInline static let queryCommandState: JSString = "queryCommandState" @usableFromInline static let queryCommandSupported: JSString = "queryCommandSupported" @usableFromInline static let queryCommandValue: JSString = "queryCommandValue" - @usableFromInline static let queryCounterEXT: JSString = "queryCounterEXT" - @usableFromInline static let queryIndex: JSString = "queryIndex" - @usableFromInline static let queryPermission: JSString = "queryPermission" @usableFromInline static let querySelector: JSString = "querySelector" @usableFromInline static let querySelectorAll: JSString = "querySelectorAll" - @usableFromInline static let querySet: JSString = "querySet" - @usableFromInline static let queue: JSString = "queue" - @usableFromInline static let quota: JSString = "quota" @usableFromInline static let r: JSString = "r" - @usableFromInline static let rad: JSString = "rad" - @usableFromInline static let radius: JSString = "radius" - @usableFromInline static let radiusX: JSString = "radiusX" - @usableFromInline static let radiusY: JSString = "radiusY" - @usableFromInline static let randomUUID: JSString = "randomUUID" - @usableFromInline static let range: JSString = "range" - @usableFromInline static let rangeCount: JSString = "rangeCount" - @usableFromInline static let rangeEnd: JSString = "rangeEnd" - @usableFromInline static let rangeMax: JSString = "rangeMax" - @usableFromInline static let rangeMin: JSString = "rangeMin" @usableFromInline static let rangeOverflow: JSString = "rangeOverflow" - @usableFromInline static let rangeStart: JSString = "rangeStart" @usableFromInline static let rangeUnderflow: JSString = "rangeUnderflow" - @usableFromInline static let rate: JSString = "rate" - @usableFromInline static let ratio: JSString = "ratio" - @usableFromInline static let rawId: JSString = "rawId" - @usableFromInline static let rawValue: JSString = "rawValue" - @usableFromInline static let rawValueToMeters: JSString = "rawValueToMeters" @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 readBuffer: JSString = "readBuffer" @usableFromInline static let readOnly: JSString = "readOnly" - @usableFromInline static let readPixels: JSString = "readPixels" - @usableFromInline static let readText: JSString = "readText" - @usableFromInline static let readValue: JSString = "readValue" @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 real: JSString = "real" @usableFromInline static let reason: JSString = "reason" - @usableFromInline static let receiveFeatureReport: JSString = "receiveFeatureReport" - @usableFromInline static let receiveTime: JSString = "receiveTime" - @usableFromInline static let receivedAlert: JSString = "receivedAlert" - @usableFromInline static let receiver: JSString = "receiver" - @usableFromInline static let receiverId: JSString = "receiverId" - @usableFromInline static let receiverWindow: JSString = "receiverWindow" - @usableFromInline static let recipient: JSString = "recipient" - @usableFromInline static let recommendedViewportScale: JSString = "recommendedViewportScale" - @usableFromInline static let reconnect: JSString = "reconnect" - @usableFromInline static let recordType: JSString = "recordType" - @usableFromInline static let records: JSString = "records" - @usableFromInline static let recordsAvailable: JSString = "recordsAvailable" @usableFromInline static let rect: JSString = "rect" - @usableFromInline static let recurrentBias: JSString = "recurrentBias" - @usableFromInline static let recursive: JSString = "recursive" - @usableFromInline static let redEyeReduction: JSString = "redEyeReduction" @usableFromInline static let redirect: JSString = "redirect" - @usableFromInline static let redirectCount: JSString = "redirectCount" - @usableFromInline static let redirectEnd: JSString = "redirectEnd" - @usableFromInline static let redirectStart: JSString = "redirectStart" @usableFromInline static let redirected: JSString = "redirected" - @usableFromInline static let reduceL1: JSString = "reduceL1" - @usableFromInline static let reduceL2: JSString = "reduceL2" - @usableFromInline static let reduceLogSum: JSString = "reduceLogSum" - @usableFromInline static let reduceLogSumExp: JSString = "reduceLogSumExp" - @usableFromInline static let reduceMax: JSString = "reduceMax" - @usableFromInline static let reduceMean: JSString = "reduceMean" - @usableFromInline static let reduceMin: JSString = "reduceMin" - @usableFromInline static let reduceProduct: JSString = "reduceProduct" - @usableFromInline static let reduceSum: JSString = "reduceSum" - @usableFromInline static let reduceSumSquare: JSString = "reduceSumSquare" - @usableFromInline static let reducedSize: JSString = "reducedSize" - @usableFromInline static let reduction: JSString = "reduction" - @usableFromInline static let refDistance: JSString = "refDistance" @usableFromInline static let refX: JSString = "refX" @usableFromInline static let refY: JSString = "refY" - @usableFromInline static let referenceFrame: JSString = "referenceFrame" @usableFromInline static let referenceNode: JSString = "referenceNode" - @usableFromInline static let referenceSpace: JSString = "referenceSpace" @usableFromInline static let referrer: JSString = "referrer" @usableFromInline static let referrerPolicy: JSString = "referrerPolicy" - @usableFromInline static let referringDevice: JSString = "referringDevice" - @usableFromInline static let reflectionFormat: JSString = "reflectionFormat" @usableFromInline static let refresh: JSString = "refresh" - @usableFromInline static let region: JSString = "region" - @usableFromInline static let regionAnchorX: JSString = "regionAnchorX" - @usableFromInline static let regionAnchorY: JSString = "regionAnchorY" - @usableFromInline static let regionOverset: JSString = "regionOverset" @usableFromInline static let register: JSString = "register" - @usableFromInline static let registerAttributionSource: JSString = "registerAttributionSource" - @usableFromInline static let registerProperty: JSString = "registerProperty" @usableFromInline static let registerProtocolHandler: JSString = "registerProtocolHandler" - @usableFromInline static let registration: JSString = "registration" @usableFromInline static let rel: JSString = "rel" @usableFromInline static let relList: JSString = "relList" - @usableFromInline static let relatedAddress: JSString = "relatedAddress" @usableFromInline static let relatedNode: JSString = "relatedNode" - @usableFromInline static let relatedPort: JSString = "relatedPort" @usableFromInline static let relatedTarget: JSString = "relatedTarget" - @usableFromInline static let relativeTo: JSString = "relativeTo" - @usableFromInline static let relayProtocol: JSString = "relayProtocol" - @usableFromInline static let relayedSource: JSString = "relayedSource" - @usableFromInline static let release: JSString = "release" @usableFromInline static let releaseEvents: JSString = "releaseEvents" - @usableFromInline static let releaseInterface: JSString = "releaseInterface" @usableFromInline static let releaseLock: JSString = "releaseLock" - @usableFromInline static let releasePointerCapture: JSString = "releasePointerCapture" - @usableFromInline static let released: JSString = "released" - @usableFromInline static let reliableWrite: JSString = "reliableWrite" @usableFromInline static let reload: JSString = "reload" - @usableFromInline static let relu: JSString = "relu" - @usableFromInline static let rem: JSString = "rem" - @usableFromInline static let remote: JSString = "remote" - @usableFromInline static let remoteCandidateId: JSString = "remoteCandidateId" - @usableFromInline static let remoteCertificateId: JSString = "remoteCertificateId" - @usableFromInline static let remoteDescription: JSString = "remoteDescription" - @usableFromInline static let remoteId: JSString = "remoteId" - @usableFromInline static let remoteTimestamp: JSString = "remoteTimestamp" @usableFromInline static let remove: JSString = "remove" - @usableFromInline static let removeAllRanges: JSString = "removeAllRanges" @usableFromInline static let removeAttribute: JSString = "removeAttribute" @usableFromInline static let removeAttributeNS: JSString = "removeAttributeNS" @usableFromInline static let removeAttributeNode: JSString = "removeAttributeNode" @usableFromInline static let removeChild: JSString = "removeChild" @usableFromInline static let removeCue: JSString = "removeCue" - @usableFromInline static let removeEntry: JSString = "removeEntry" @usableFromInline static let removeItem: JSString = "removeItem" @usableFromInline static let removeNamedItem: JSString = "removeNamedItem" @usableFromInline static let removeNamedItemNS: JSString = "removeNamedItemNS" @usableFromInline static let removeParameter: JSString = "removeParameter" @usableFromInline static let removeProperty: JSString = "removeProperty" - @usableFromInline static let removeRange: JSString = "removeRange" @usableFromInline static let removeRule: JSString = "removeRule" @usableFromInline static let removeSourceBuffer: JSString = "removeSourceBuffer" @usableFromInline static let removeTrack: JSString = "removeTrack" - @usableFromInline static let removed: JSString = "removed" @usableFromInline static let removedNodes: JSString = "removedNodes" - @usableFromInline static let removedSamplesForAcceleration: JSString = "removedSamplesForAcceleration" - @usableFromInline static let renderState: JSString = "renderState" - @usableFromInline static let renderTime: JSString = "renderTime" - @usableFromInline static let renderbufferStorage: JSString = "renderbufferStorage" - @usableFromInline static let renderbufferStorageMultisample: JSString = "renderbufferStorageMultisample" - @usableFromInline static let renderedBuffer: JSString = "renderedBuffer" - @usableFromInline static let renotify: JSString = "renotify" @usableFromInline static let `repeat`: JSString = "repeat" @usableFromInline static let repetitionCount: JSString = "repetitionCount" @usableFromInline static let replace: JSString = "replace" @@ -4022,864 +1443,294 @@ import JavaScriptKit @usableFromInline static let replaceItem: JSString = "replaceItem" @usableFromInline static let replaceState: JSString = "replaceState" @usableFromInline static let replaceSync: JSString = "replaceSync" - @usableFromInline static let replaceTrack: JSString = "replaceTrack" @usableFromInline static let replaceWith: JSString = "replaceWith" @usableFromInline static let replacesClientId: JSString = "replacesClientId" - @usableFromInline static let reportCount: JSString = "reportCount" @usableFromInline static let reportError: JSString = "reportError" - @usableFromInline static let reportId: JSString = "reportId" - @usableFromInline static let reportSize: JSString = "reportSize" @usableFromInline static let reportValidity: JSString = "reportValidity" - @usableFromInline static let reportsReceived: JSString = "reportsReceived" - @usableFromInline static let reportsSent: JSString = "reportsSent" @usableFromInline static let request: JSString = "request" - @usableFromInline static let requestAdapter: JSString = "requestAdapter" - @usableFromInline static let requestBytesSent: JSString = "requestBytesSent" @usableFromInline static let requestData: JSString = "requestData" - @usableFromInline static let requestDevice: JSString = "requestDevice" - @usableFromInline static let requestFrame: JSString = "requestFrame" - @usableFromInline static let requestFullscreen: JSString = "requestFullscreen" - @usableFromInline static let requestHitTestSource: JSString = "requestHitTestSource" - @usableFromInline static let requestHitTestSourceForTransientInput: JSString = "requestHitTestSourceForTransientInput" - @usableFromInline static let requestId: JSString = "requestId" - @usableFromInline static let requestLightProbe: JSString = "requestLightProbe" - @usableFromInline static let requestMIDIAccess: JSString = "requestMIDIAccess" - @usableFromInline static let requestMediaKeySystemAccess: JSString = "requestMediaKeySystemAccess" - @usableFromInline static let requestPermission: JSString = "requestPermission" - @usableFromInline static let requestPictureInPicture: JSString = "requestPictureInPicture" - @usableFromInline static let requestPointerLock: JSString = "requestPointerLock" - @usableFromInline static let requestPort: JSString = "requestPort" - @usableFromInline static let requestPresenter: JSString = "requestPresenter" - @usableFromInline static let requestReferenceSpace: JSString = "requestReferenceSpace" - @usableFromInline static let requestSession: JSString = "requestSession" - @usableFromInline static let requestStart: JSString = "requestStart" - @usableFromInline static let requestStorageAccess: JSString = "requestStorageAccess" @usableFromInline static let requestSubmit: JSString = "requestSubmit" - @usableFromInline static let requestToSend: JSString = "requestToSend" - @usableFromInline static let requestType: JSString = "requestType" - @usableFromInline static let requestViewportScale: JSString = "requestViewportScale" - @usableFromInline static let requestedSamplingFrequency: JSString = "requestedSamplingFrequency" - @usableFromInline static let requestsReceived: JSString = "requestsReceived" - @usableFromInline static let requestsSent: JSString = "requestsSent" - @usableFromInline static let requireInteraction: JSString = "requireInteraction" - @usableFromInline static let requireResidentKey: JSString = "requireResidentKey" @usableFromInline static let required: JSString = "required" @usableFromInline static let requiredExtensions: JSString = "requiredExtensions" - @usableFromInline static let requiredFeatures: JSString = "requiredFeatures" - @usableFromInline static let requiredLimits: JSString = "requiredLimits" - @usableFromInline static let resample2d: JSString = "resample2d" @usableFromInline static let reset: JSString = "reset" - @usableFromInline static let resetAfter: JSString = "resetAfter" @usableFromInline static let resetTransform: JSString = "resetTransform" - @usableFromInline static let reshape: JSString = "reshape" - @usableFromInline static let residentKey: JSString = "residentKey" - @usableFromInline static let resizeBy: JSString = "resizeBy" @usableFromInline static let resizeHeight: JSString = "resizeHeight" @usableFromInline static let resizeMode: JSString = "resizeMode" @usableFromInline static let resizeQuality: JSString = "resizeQuality" - @usableFromInline static let resizeTo: JSString = "resizeTo" @usableFromInline static let resizeWidth: JSString = "resizeWidth" - @usableFromInline static let resolution: JSString = "resolution" - @usableFromInline static let resolve: JSString = "resolve" - @usableFromInline static let resolveQuerySet: JSString = "resolveQuerySet" - @usableFromInline static let resolveTarget: JSString = "resolveTarget" - @usableFromInline static let resource: JSString = "resource" - @usableFromInline static let resourceId: JSString = "resourceId" - @usableFromInline static let resources: JSString = "resources" @usableFromInline static let respond: JSString = "respond" @usableFromInline static let respondWithNewView: JSString = "respondWithNewView" @usableFromInline static let response: JSString = "response" - @usableFromInline static let responseBytesSent: JSString = "responseBytesSent" - @usableFromInline static let responseEnd: JSString = "responseEnd" - @usableFromInline static let responseReady: JSString = "responseReady" - @usableFromInline static let responseStart: JSString = "responseStart" @usableFromInline static let responseText: JSString = "responseText" @usableFromInline static let responseType: JSString = "responseType" @usableFromInline static let responseURL: JSString = "responseURL" @usableFromInline static let responseXML: JSString = "responseXML" - @usableFromInline static let responsesReceived: JSString = "responsesReceived" - @usableFromInline static let responsesSent: JSString = "responsesSent" - @usableFromInline static let restartIce: JSString = "restartIce" @usableFromInline static let restore: JSString = "restore" - @usableFromInline static let restoreContext: JSString = "restoreContext" - @usableFromInline static let restrictOwnAudio: JSString = "restrictOwnAudio" @usableFromInline static let result: JSString = "result" - @usableFromInline static let resultIndex: JSString = "resultIndex" @usableFromInline static let resultType: JSString = "resultType" @usableFromInline static let resultingClientId: JSString = "resultingClientId" - @usableFromInline static let results: JSString = "results" @usableFromInline static let resume: JSString = "resume" - @usableFromInline static let resumeTransformFeedback: JSString = "resumeTransformFeedback" - @usableFromInline static let retransmissionsReceived: JSString = "retransmissionsReceived" - @usableFromInline static let retransmissionsSent: JSString = "retransmissionsSent" - @usableFromInline static let retransmittedBytesSent: JSString = "retransmittedBytesSent" - @usableFromInline static let retransmittedPacketsSent: JSString = "retransmittedPacketsSent" - @usableFromInline static let retry: JSString = "retry" - @usableFromInline static let returnSequence: JSString = "returnSequence" @usableFromInline static let returnValue: JSString = "returnValue" @usableFromInline static let rev: JSString = "rev" @usableFromInline static let reverse: JSString = "reverse" @usableFromInline static let reversed: JSString = "reversed" - @usableFromInline static let revoke: JSString = "revoke" @usableFromInline static let revokeObjectURL: JSString = "revokeObjectURL" - @usableFromInline static let rid: JSString = "rid" @usableFromInline static let right: JSString = "right" - @usableFromInline static let ringIndicator: JSString = "ringIndicator" - @usableFromInline static let rk: JSString = "rk" - @usableFromInline static let rlh: JSString = "rlh" - @usableFromInline static let robustness: JSString = "robustness" @usableFromInline static let role: JSString = "role" - @usableFromInline static let rollback: JSString = "rollback" - @usableFromInline static let rolloffFactor: JSString = "rolloffFactor" @usableFromInline static let root: JSString = "root" - @usableFromInline static let rootBounds: JSString = "rootBounds" @usableFromInline static let rootElement: JSString = "rootElement" - @usableFromInline static let rootMargin: JSString = "rootMargin" @usableFromInline static let rotate: JSString = "rotate" @usableFromInline static let rotateAxisAngle: JSString = "rotateAxisAngle" @usableFromInline static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" @usableFromInline static let rotateFromVector: JSString = "rotateFromVector" @usableFromInline static let rotateFromVectorSelf: JSString = "rotateFromVectorSelf" @usableFromInline static let rotateSelf: JSString = "rotateSelf" - @usableFromInline static let rotationAngle: JSString = "rotationAngle" - @usableFromInline static let rotationRate: JSString = "rotationRate" @usableFromInline static let roundRect: JSString = "roundRect" - @usableFromInline static let roundTripTime: JSString = "roundTripTime" - @usableFromInline static let roundTripTimeMeasurements: JSString = "roundTripTimeMeasurements" - @usableFromInline static let roundingType: JSString = "roundingType" @usableFromInline static let rowIndex: JSString = "rowIndex" @usableFromInline static let rowSpan: JSString = "rowSpan" @usableFromInline static let rows: JSString = "rows" - @usableFromInline static let rowsPerImage: JSString = "rowsPerImage" - @usableFromInline static let rp: JSString = "rp" - @usableFromInline static let rpId: JSString = "rpId" - @usableFromInline static let rssi: JSString = "rssi" - @usableFromInline static let rtcp: JSString = "rtcp" - @usableFromInline static let rtcpMuxPolicy: JSString = "rtcpMuxPolicy" - @usableFromInline static let rtcpTransportStatsId: JSString = "rtcpTransportStatsId" - @usableFromInline static let rtpTimestamp: JSString = "rtpTimestamp" - @usableFromInline static let rtt: JSString = "rtt" - @usableFromInline static let rttVariation: JSString = "rttVariation" - @usableFromInline static let rtxSsrc: JSString = "rtxSsrc" @usableFromInline static let rules: JSString = "rules" @usableFromInline static let rx: JSString = "rx" @usableFromInline static let ry: JSString = "ry" - @usableFromInline static let s: JSString = "s" - @usableFromInline static let sRGBHex: JSString = "sRGBHex" - @usableFromInline static let salt: JSString = "salt" - @usableFromInline static let saltLength: JSString = "saltLength" - @usableFromInline static let sameDocument: JSString = "sameDocument" - @usableFromInline static let sameSite: JSString = "sameSite" - @usableFromInline static let sample: JSString = "sample" - @usableFromInline static let sampleCount: JSString = "sampleCount" - @usableFromInline static let sampleCoverage: JSString = "sampleCoverage" - @usableFromInline static let sampleInterval: JSString = "sampleInterval" @usableFromInline static let sampleRate: JSString = "sampleRate" @usableFromInline static let sampleSize: JSString = "sampleSize" - @usableFromInline static let sampleType: JSString = "sampleType" - @usableFromInline static let sampler: JSString = "sampler" - @usableFromInline static let samplerParameterf: JSString = "samplerParameterf" - @usableFromInline static let samplerParameteri: JSString = "samplerParameteri" - @usableFromInline static let samplerate: JSString = "samplerate" - @usableFromInline static let samples: JSString = "samples" - @usableFromInline static let samplesDecodedWithCelt: JSString = "samplesDecodedWithCelt" - @usableFromInline static let samplesDecodedWithSilk: JSString = "samplesDecodedWithSilk" - @usableFromInline static let samplesEncodedWithCelt: JSString = "samplesEncodedWithCelt" - @usableFromInline static let samplesEncodedWithSilk: JSString = "samplesEncodedWithSilk" @usableFromInline static let sandbox: JSString = "sandbox" - @usableFromInline static let sanitize: JSString = "sanitize" - @usableFromInline static let sanitizeFor: JSString = "sanitizeFor" - @usableFromInline static let sanitizer: JSString = "sanitizer" - @usableFromInline static let saturation: JSString = "saturation" @usableFromInline static let save: JSString = "save" - @usableFromInline static let saveData: JSString = "saveData" @usableFromInline static let scalabilityMode: JSString = "scalabilityMode" - @usableFromInline static let scalabilityModes: JSString = "scalabilityModes" @usableFromInline static let scale: JSString = "scale" @usableFromInline static let scale3d: JSString = "scale3d" @usableFromInline static let scale3dSelf: JSString = "scale3dSelf" - @usableFromInline static let scaleFactor: JSString = "scaleFactor" @usableFromInline static let scaleNonUniform: JSString = "scaleNonUniform" - @usableFromInline static let scaleResolutionDownBy: JSString = "scaleResolutionDownBy" @usableFromInline static let scaleSelf: JSString = "scaleSelf" - @usableFromInline static let scales: JSString = "scales" - @usableFromInline static let scan: JSString = "scan" - @usableFromInline static let scheduler: JSString = "scheduler" - @usableFromInline static let scheduling: JSString = "scheduling" @usableFromInline static let scheme: JSString = "scheme" - @usableFromInline static let scissor: JSString = "scissor" @usableFromInline static let scope: JSString = "scope" - @usableFromInline static let screen: JSString = "screen" - @usableFromInline static let screenLeft: JSString = "screenLeft" - @usableFromInline static let screenState: JSString = "screenState" - @usableFromInline static let screenTop: JSString = "screenTop" @usableFromInline static let screenX: JSString = "screenX" @usableFromInline static let screenY: JSString = "screenY" @usableFromInline static let scriptURL: JSString = "scriptURL" @usableFromInline static let scripts: JSString = "scripts" - @usableFromInline static let scroll: JSString = "scroll" @usableFromInline static let scrollAmount: JSString = "scrollAmount" - @usableFromInline static let scrollBy: JSString = "scrollBy" @usableFromInline static let scrollDelay: JSString = "scrollDelay" - @usableFromInline static let scrollHeight: JSString = "scrollHeight" - @usableFromInline static let scrollIntoView: JSString = "scrollIntoView" - @usableFromInline static let scrollLeft: JSString = "scrollLeft" - @usableFromInline static let scrollOffsets: JSString = "scrollOffsets" @usableFromInline static let scrollPathIntoView: JSString = "scrollPathIntoView" @usableFromInline static let scrollRestoration: JSString = "scrollRestoration" - @usableFromInline static let scrollTo: JSString = "scrollTo" - @usableFromInline static let scrollTop: JSString = "scrollTop" - @usableFromInline static let scrollWidth: JSString = "scrollWidth" - @usableFromInline static let scrollX: JSString = "scrollX" - @usableFromInline static let scrollY: JSString = "scrollY" @usableFromInline static let scrollbars: JSString = "scrollbars" @usableFromInline static let scrolling: JSString = "scrolling" - @usableFromInline static let scrollingElement: JSString = "scrollingElement" - @usableFromInline static let sctp: JSString = "sctp" - @usableFromInline static let sctpCauseCode: JSString = "sctpCauseCode" - @usableFromInline static let sdp: JSString = "sdp" - @usableFromInline static let sdpFmtpLine: JSString = "sdpFmtpLine" - @usableFromInline static let sdpLineNumber: JSString = "sdpLineNumber" - @usableFromInline static let sdpMLineIndex: JSString = "sdpMLineIndex" - @usableFromInline static let sdpMid: JSString = "sdpMid" @usableFromInline static let search: JSString = "search" @usableFromInline static let searchParams: JSString = "searchParams" @usableFromInline static let sectionRowIndex: JSString = "sectionRowIndex" - @usableFromInline static let secure: JSString = "secure" - @usableFromInline static let secureConnectionStart: JSString = "secureConnectionStart" - @usableFromInline static let seed: JSString = "seed" - @usableFromInline static let seek: JSString = "seek" - @usableFromInline static let seekOffset: JSString = "seekOffset" - @usableFromInline static let seekTime: JSString = "seekTime" @usableFromInline static let seekable: JSString = "seekable" @usableFromInline static let seeking: JSString = "seeking" - @usableFromInline static let segments: JSString = "segments" @usableFromInline static let select: JSString = "select" - @usableFromInline static let selectAllChildren: JSString = "selectAllChildren" - @usableFromInline static let selectAlternateInterface: JSString = "selectAlternateInterface" - @usableFromInline static let selectAudioOutput: JSString = "selectAudioOutput" - @usableFromInline static let selectConfiguration: JSString = "selectConfiguration" @usableFromInline static let selectNode: JSString = "selectNode" @usableFromInline static let selectNodeContents: JSString = "selectNodeContents" @usableFromInline static let selectSubString: JSString = "selectSubString" @usableFromInline static let selected: JSString = "selected" - @usableFromInline static let selectedCandidatePairChanges: JSString = "selectedCandidatePairChanges" - @usableFromInline static let selectedCandidatePairId: JSString = "selectedCandidatePairId" @usableFromInline static let selectedIndex: JSString = "selectedIndex" @usableFromInline static let selectedOptions: JSString = "selectedOptions" @usableFromInline static let selectedTrack: JSString = "selectedTrack" - @usableFromInline static let selectionBound: JSString = "selectionBound" @usableFromInline static let selectionDirection: JSString = "selectionDirection" @usableFromInline static let selectionEnd: JSString = "selectionEnd" @usableFromInline static let selectionStart: JSString = "selectionStart" @usableFromInline static let selectorText: JSString = "selectorText" @usableFromInline static let send: JSString = "send" - @usableFromInline static let sendBeacon: JSString = "sendBeacon" - @usableFromInline static let sendEncodings: JSString = "sendEncodings" - @usableFromInline static let sendFeatureReport: JSString = "sendFeatureReport" - @usableFromInline static let sendReport: JSString = "sendReport" - @usableFromInline static let sender: JSString = "sender" - @usableFromInline static let senderId: JSString = "senderId" - @usableFromInline static let sentAlert: JSString = "sentAlert" - @usableFromInline static let serial: JSString = "serial" - @usableFromInline static let serialNumber: JSString = "serialNumber" - @usableFromInline static let serializeToString: JSString = "serializeToString" - @usableFromInline static let serverCertificateHashes: JSString = "serverCertificateHashes" - @usableFromInline static let serverTiming: JSString = "serverTiming" - @usableFromInline static let service: JSString = "service" - @usableFromInline static let serviceData: JSString = "serviceData" @usableFromInline static let serviceWorker: JSString = "serviceWorker" - @usableFromInline static let services: JSString = "services" - @usableFromInline static let session: JSString = "session" - @usableFromInline static let sessionId: JSString = "sessionId" @usableFromInline static let sessionStorage: JSString = "sessionStorage" - @usableFromInline static let sessionTypes: JSString = "sessionTypes" @usableFromInline static let set: JSString = "set" - @usableFromInline static let setAppBadge: JSString = "setAppBadge" @usableFromInline static let setAttribute: JSString = "setAttribute" @usableFromInline static let setAttributeNS: JSString = "setAttributeNS" @usableFromInline static let setAttributeNode: JSString = "setAttributeNode" @usableFromInline static let setAttributeNodeNS: JSString = "setAttributeNodeNS" - @usableFromInline static let setBaseAndExtent: JSString = "setBaseAndExtent" - @usableFromInline static let setBindGroup: JSString = "setBindGroup" - @usableFromInline static let setBlendConstant: JSString = "setBlendConstant" - @usableFromInline static let setCameraActive: JSString = "setCameraActive" - @usableFromInline static let setClientBadge: JSString = "setClientBadge" - @usableFromInline static let setCodecPreferences: JSString = "setCodecPreferences" - @usableFromInline static let setConfiguration: JSString = "setConfiguration" - @usableFromInline static let setCurrentTime: JSString = "setCurrentTime" @usableFromInline static let setCustomValidity: JSString = "setCustomValidity" @usableFromInline static let setData: JSString = "setData" @usableFromInline static let setDragImage: JSString = "setDragImage" - @usableFromInline static let setEncryptionKey: JSString = "setEncryptionKey" @usableFromInline static let setEnd: JSString = "setEnd" @usableFromInline static let setEndAfter: JSString = "setEndAfter" @usableFromInline static let setEndBefore: JSString = "setEndBefore" @usableFromInline static let setFormValue: JSString = "setFormValue" - @usableFromInline static let setHTML: JSString = "setHTML" @usableFromInline static let setHeaderValue: JSString = "setHeaderValue" - @usableFromInline static let setIdentityProvider: JSString = "setIdentityProvider" - @usableFromInline static let setIndexBuffer: JSString = "setIndexBuffer" @usableFromInline static let setInterval: JSString = "setInterval" @usableFromInline static let setKeyframes: JSString = "setKeyframes" @usableFromInline static let setLineDash: JSString = "setLineDash" @usableFromInline static let setLiveSeekableRange: JSString = "setLiveSeekableRange" @usableFromInline static let setMatrix: JSString = "setMatrix" @usableFromInline static let setMatrixValue: JSString = "setMatrixValue" - @usableFromInline static let setMediaKeys: JSString = "setMediaKeys" - @usableFromInline static let setMicrophoneActive: JSString = "setMicrophoneActive" @usableFromInline static let setNamedItem: JSString = "setNamedItem" @usableFromInline static let setNamedItemNS: JSString = "setNamedItemNS" @usableFromInline static let setOrientToAngle: JSString = "setOrientToAngle" @usableFromInline static let setOrientToAuto: JSString = "setOrientToAuto" - @usableFromInline static let setOrientation: JSString = "setOrientation" @usableFromInline static let setParameter: JSString = "setParameter" - @usableFromInline static let setParameters: JSString = "setParameters" - @usableFromInline static let setPeriodicWave: JSString = "setPeriodicWave" - @usableFromInline static let setPipeline: JSString = "setPipeline" - @usableFromInline static let setPointerCapture: JSString = "setPointerCapture" - @usableFromInline static let setPosition: JSString = "setPosition" - @usableFromInline static let setPositionState: JSString = "setPositionState" - @usableFromInline static let setPriority: JSString = "setPriority" @usableFromInline static let setProperty: JSString = "setProperty" @usableFromInline static let setRangeText: JSString = "setRangeText" @usableFromInline static let setRequestHeader: JSString = "setRequestHeader" - @usableFromInline static let setResourceTimingBufferSize: JSString = "setResourceTimingBufferSize" @usableFromInline static let setRotate: JSString = "setRotate" @usableFromInline static let setScale: JSString = "setScale" - @usableFromInline static let setScissorRect: JSString = "setScissorRect" @usableFromInline static let setSelectionRange: JSString = "setSelectionRange" - @usableFromInline static let setServerCertificate: JSString = "setServerCertificate" - @usableFromInline static let setSignals: JSString = "setSignals" - @usableFromInline static let setSinkId: JSString = "setSinkId" @usableFromInline static let setSkewX: JSString = "setSkewX" @usableFromInline static let setSkewY: JSString = "setSkewY" @usableFromInline static let setStart: JSString = "setStart" @usableFromInline static let setStartAfter: JSString = "setStartAfter" @usableFromInline static let setStartBefore: JSString = "setStartBefore" - @usableFromInline static let setStdDeviation: JSString = "setStdDeviation" - @usableFromInline static let setStencilReference: JSString = "setStencilReference" - @usableFromInline static let setStreams: JSString = "setStreams" - @usableFromInline static let setTargetAtTime: JSString = "setTargetAtTime" @usableFromInline static let setTimeout: JSString = "setTimeout" @usableFromInline static let setTransform: JSString = "setTransform" @usableFromInline static let setTranslate: JSString = "setTranslate" @usableFromInline static let setValidity: JSString = "setValidity" - @usableFromInline static let setValueAtTime: JSString = "setValueAtTime" - @usableFromInline static let setValueCurveAtTime: JSString = "setValueCurveAtTime" - @usableFromInline static let setVertexBuffer: JSString = "setVertexBuffer" - @usableFromInline static let setViewport: JSString = "setViewport" - @usableFromInline static let shaderLocation: JSString = "shaderLocation" - @usableFromInline static let shaderSource: JSString = "shaderSource" @usableFromInline static let shadowBlur: JSString = "shadowBlur" @usableFromInline static let shadowColor: JSString = "shadowColor" @usableFromInline static let shadowOffsetX: JSString = "shadowOffsetX" @usableFromInline static let shadowOffsetY: JSString = "shadowOffsetY" @usableFromInline static let shadowRoot: JSString = "shadowRoot" @usableFromInline static let shape: JSString = "shape" - @usableFromInline static let share: JSString = "share" - @usableFromInline static let sharpness: JSString = "sharpness" @usableFromInline static let sheet: JSString = "sheet" @usableFromInline static let shiftKey: JSString = "shiftKey" @usableFromInline static let show: JSString = "show" - @usableFromInline static let showDirectoryPicker: JSString = "showDirectoryPicker" @usableFromInline static let showModal: JSString = "showModal" - @usableFromInline static let showNotification: JSString = "showNotification" - @usableFromInline static let showOpenFilePicker: JSString = "showOpenFilePicker" @usableFromInline static let showPicker: JSString = "showPicker" - @usableFromInline static let showSaveFilePicker: JSString = "showSaveFilePicker" - @usableFromInline static let sigmoid: JSString = "sigmoid" - @usableFromInline static let sign: JSString = "sign" @usableFromInline static let signal: JSString = "signal" - @usableFromInline static let signalingState: JSString = "signalingState" - @usableFromInline static let signature: JSString = "signature" - @usableFromInline static let silent: JSString = "silent" - @usableFromInline static let silentConcealedSamples: JSString = "silentConcealedSamples" - @usableFromInline static let sin: JSString = "sin" @usableFromInline static let singleNodeValue: JSString = "singleNodeValue" - @usableFromInline static let sinkId: JSString = "sinkId" @usableFromInline static let size: JSString = "size" @usableFromInline static let sizes: JSString = "sizes" - @usableFromInline static let sizing: JSString = "sizing" @usableFromInline static let skewX: JSString = "skewX" @usableFromInline static let skewXSelf: JSString = "skewXSelf" @usableFromInline static let skewY: JSString = "skewY" @usableFromInline static let skewYSelf: JSString = "skewYSelf" - @usableFromInline static let sliCount: JSString = "sliCount" @usableFromInline static let slice: JSString = "slice" - @usableFromInline static let slope: JSString = "slope" @usableFromInline static let slot: JSString = "slot" @usableFromInline static let slotAssignment: JSString = "slotAssignment" - @usableFromInline static let smooth: JSString = "smooth" - @usableFromInline static let smoothedRoundTripTime: JSString = "smoothedRoundTripTime" - @usableFromInline static let smoothedRtt: JSString = "smoothedRtt" - @usableFromInline static let smoothingTimeConstant: JSString = "smoothingTimeConstant" - @usableFromInline static let snapToLines: JSString = "snapToLines" @usableFromInline static let snapshotItem: JSString = "snapshotItem" @usableFromInline static let snapshotLength: JSString = "snapshotLength" - @usableFromInline static let softmax: JSString = "softmax" - @usableFromInline static let softplus: JSString = "softplus" - @usableFromInline static let softsign: JSString = "softsign" - @usableFromInline static let software: JSString = "software" @usableFromInline static let sort: JSString = "sort" - @usableFromInline static let sortingCode: JSString = "sortingCode" @usableFromInline static let source: JSString = "source" @usableFromInline static let sourceAnimation: JSString = "sourceAnimation" @usableFromInline static let sourceBuffer: JSString = "sourceBuffer" @usableFromInline static let sourceBuffers: JSString = "sourceBuffers" - @usableFromInline static let sourceCapabilities: JSString = "sourceCapabilities" - @usableFromInline static let sourceFile: JSString = "sourceFile" - @usableFromInline static let sourceMap: JSString = "sourceMap" - @usableFromInline static let sources: JSString = "sources" - @usableFromInline static let space: JSString = "space" @usableFromInline static let spacing: JSString = "spacing" @usableFromInline static let span: JSString = "span" - @usableFromInline static let spatialIndex: JSString = "spatialIndex" - @usableFromInline static let spatialNavigationSearch: JSString = "spatialNavigationSearch" - @usableFromInline static let spatialRendering: JSString = "spatialRendering" - @usableFromInline static let speak: JSString = "speak" - @usableFromInline static let speakAs: JSString = "speakAs" - @usableFromInline static let speaking: JSString = "speaking" @usableFromInline static let specified: JSString = "specified" - @usableFromInline static let specularConstant: JSString = "specularConstant" - @usableFromInline static let specularExponent: JSString = "specularExponent" - @usableFromInline static let speechSynthesis: JSString = "speechSynthesis" - @usableFromInline static let speed: JSString = "speed" @usableFromInline static let spellcheck: JSString = "spellcheck" - @usableFromInline static let sphericalHarmonicsCoefficients: JSString = "sphericalHarmonicsCoefficients" - @usableFromInline static let split: JSString = "split" @usableFromInline static let splitText: JSString = "splitText" @usableFromInline static let spreadMethod: JSString = "spreadMethod" - @usableFromInline static let squeeze: JSString = "squeeze" @usableFromInline static let src: JSString = "src" @usableFromInline static let srcElement: JSString = "srcElement" - @usableFromInline static let srcFactor: JSString = "srcFactor" @usableFromInline static let srcObject: JSString = "srcObject" @usableFromInline static let srcdoc: JSString = "srcdoc" @usableFromInline static let srclang: JSString = "srclang" @usableFromInline static let srcset: JSString = "srcset" - @usableFromInline static let srtpCipher: JSString = "srtpCipher" - @usableFromInline static let ssrc: JSString = "ssrc" - @usableFromInline static let stackId: JSString = "stackId" - @usableFromInline static let stacks: JSString = "stacks" @usableFromInline static let standby: JSString = "standby" @usableFromInline static let start: JSString = "start" @usableFromInline static let startContainer: JSString = "startContainer" - @usableFromInline static let startIn: JSString = "startIn" @usableFromInline static let startMessages: JSString = "startMessages" - @usableFromInline static let startNotifications: JSString = "startNotifications" @usableFromInline static let startOffset: JSString = "startOffset" - @usableFromInline static let startRendering: JSString = "startRendering" @usableFromInline static let startTime: JSString = "startTime" @usableFromInline static let state: JSString = "state" - @usableFromInline static let states: JSString = "states" @usableFromInline static let status: JSString = "status" - @usableFromInline static let statusCode: JSString = "statusCode" - @usableFromInline static let statusMessage: JSString = "statusMessage" @usableFromInline static let statusText: JSString = "statusText" @usableFromInline static let statusbar: JSString = "statusbar" - @usableFromInline static let stdDeviationX: JSString = "stdDeviationX" - @usableFromInline static let stdDeviationY: JSString = "stdDeviationY" - @usableFromInline static let steal: JSString = "steal" - @usableFromInline static let steepness: JSString = "steepness" - @usableFromInline static let stencil: JSString = "stencil" - @usableFromInline static let stencilBack: JSString = "stencilBack" - @usableFromInline static let stencilClearValue: JSString = "stencilClearValue" - @usableFromInline static let stencilFront: JSString = "stencilFront" - @usableFromInline static let stencilFunc: JSString = "stencilFunc" - @usableFromInline static let stencilFuncSeparate: JSString = "stencilFuncSeparate" - @usableFromInline static let stencilLoadOp: JSString = "stencilLoadOp" - @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 stencilReadMask: JSString = "stencilReadMask" - @usableFromInline static let stencilReadOnly: JSString = "stencilReadOnly" - @usableFromInline static let stencilStoreOp: JSString = "stencilStoreOp" - @usableFromInline static let stencilWriteMask: JSString = "stencilWriteMask" @usableFromInline static let step: JSString = "step" @usableFromInline static let stepDown: JSString = "stepDown" @usableFromInline static let stepMismatch: JSString = "stepMismatch" - @usableFromInline static let stepMode: JSString = "stepMode" @usableFromInline static let stepUp: JSString = "stepUp" - @usableFromInline static let stitchTiles: JSString = "stitchTiles" @usableFromInline static let stop: JSString = "stop" - @usableFromInline static let stopBits: JSString = "stopBits" @usableFromInline static let stopImmediatePropagation: JSString = "stopImmediatePropagation" - @usableFromInline static let stopNotifications: JSString = "stopNotifications" @usableFromInline static let stopPropagation: JSString = "stopPropagation" - @usableFromInline static let stopped: JSString = "stopped" - @usableFromInline static let storage: JSString = "storage" @usableFromInline static let storageArea: JSString = "storageArea" - @usableFromInline static let storageTexture: JSString = "storageTexture" - @usableFromInline static let store: JSString = "store" - @usableFromInline static let storeOp: JSString = "storeOp" @usableFromInline static let stream: JSString = "stream" - @usableFromInline static let streamErrorCode: JSString = "streamErrorCode" - @usableFromInline static let streams: JSString = "streams" - @usableFromInline static let stretch: JSString = "stretch" @usableFromInline static let stride: JSString = "stride" - @usableFromInline static let strides: JSString = "strides" @usableFromInline static let stringValue: JSString = "stringValue" - @usableFromInline static let strings: JSString = "strings" - @usableFromInline static let stripIndexFormat: JSString = "stripIndexFormat" @usableFromInline static let stroke: JSString = "stroke" @usableFromInline static let strokeRect: JSString = "strokeRect" @usableFromInline static let strokeStyle: JSString = "strokeStyle" @usableFromInline static let strokeText: JSString = "strokeText" @usableFromInline static let structuredClone: JSString = "structuredClone" @usableFromInline static let style: JSString = "style" - @usableFromInline static let styleMap: JSString = "styleMap" @usableFromInline static let styleSheet: JSString = "styleSheet" @usableFromInline static let styleSheets: JSString = "styleSheets" - @usableFromInline static let styleset: JSString = "styleset" - @usableFromInline static let stylistic: JSString = "stylistic" - @usableFromInline static let sub: JSString = "sub" - @usableFromInline static let subclassCode: JSString = "subclassCode" @usableFromInline static let submit: JSString = "submit" @usableFromInline static let submitter: JSString = "submitter" - @usableFromInline static let subscribe: JSString = "subscribe" - @usableFromInline static let subscriptionPeriod: JSString = "subscriptionPeriod" @usableFromInline static let substringData: JSString = "substringData" - @usableFromInline static let subtle: JSString = "subtle" @usableFromInline static let subtree: JSString = "subtree" - @usableFromInline static let suffix: JSString = "suffix" @usableFromInline static let suffixes: JSString = "suffixes" - @usableFromInline static let suggestedName: JSString = "suggestedName" @usableFromInline static let summary: JSString = "summary" - @usableFromInline static let support: JSString = "support" @usableFromInline static let supported: JSString = "supported" - @usableFromInline static let supportedContentEncodings: JSString = "supportedContentEncodings" - @usableFromInline static let supportedEntryTypes: JSString = "supportedEntryTypes" - @usableFromInline static let supportedFrameRates: JSString = "supportedFrameRates" - @usableFromInline static let supportedMethods: JSString = "supportedMethods" - @usableFromInline static let supportedSources: JSString = "supportedSources" @usableFromInline static let supports: JSString = "supports" - @usableFromInline static let suppressLocalAudioPlayback: JSString = "suppressLocalAudioPlayback" - @usableFromInline static let surfaceDimensions: JSString = "surfaceDimensions" - @usableFromInline static let surfaceId: JSString = "surfaceId" - @usableFromInline static let surfaceScale: JSString = "surfaceScale" @usableFromInline static let surroundContents: JSString = "surroundContents" - @usableFromInline static let suspend: JSString = "suspend" @usableFromInline static let suspendRedraw: JSString = "suspendRedraw" - @usableFromInline static let svb: JSString = "svb" @usableFromInline static let svc: JSString = "svc" - @usableFromInline static let svh: JSString = "svh" - @usableFromInline static let svi: JSString = "svi" - @usableFromInline static let svmax: JSString = "svmax" - @usableFromInline static let svmin: JSString = "svmin" - @usableFromInline static let svw: JSString = "svw" - @usableFromInline static let swash: JSString = "swash" - @usableFromInline static let symbols: JSString = "symbols" - @usableFromInline static let sync: JSString = "sync" - @usableFromInline static let synchronizationSource: JSString = "synchronizationSource" - @usableFromInline static let syntax: JSString = "syntax" - @usableFromInline static let sysex: JSString = "sysex" - @usableFromInline static let sysexEnabled: JSString = "sysexEnabled" - @usableFromInline static let system: JSString = "system" @usableFromInline static let systemId: JSString = "systemId" @usableFromInline static let systemLanguage: JSString = "systemLanguage" - @usableFromInline static let t: JSString = "t" @usableFromInline static let tBodies: JSString = "tBodies" @usableFromInline static let tFoot: JSString = "tFoot" @usableFromInline static let tHead: JSString = "tHead" @usableFromInline static let tabIndex: JSString = "tabIndex" - @usableFromInline static let table: JSString = "table" - @usableFromInline static let tableValues: JSString = "tableValues" - @usableFromInline static let tag: JSString = "tag" - @usableFromInline static let tagLength: JSString = "tagLength" @usableFromInline static let tagName: JSString = "tagName" @usableFromInline static let taintEnabled: JSString = "taintEnabled" - @usableFromInline static let takePhoto: JSString = "takePhoto" @usableFromInline static let takeRecords: JSString = "takeRecords" - @usableFromInline static let tan: JSString = "tan" - @usableFromInline static let tangentialPressure: JSString = "tangentialPressure" - @usableFromInline static let tanh: JSString = "tanh" @usableFromInline static let target: JSString = "target" - @usableFromInline static let targetBitrate: JSString = "targetBitrate" - @usableFromInline static let targetElement: JSString = "targetElement" @usableFromInline static let targetOrigin: JSString = "targetOrigin" - @usableFromInline static let targetRanges: JSString = "targetRanges" - @usableFromInline static let targetRayMode: JSString = "targetRayMode" - @usableFromInline static let targetRaySpace: JSString = "targetRaySpace" - @usableFromInline static let targetTouches: JSString = "targetTouches" - @usableFromInline static let targetX: JSString = "targetX" - @usableFromInline static let targetY: JSString = "targetY" - @usableFromInline static let targets: JSString = "targets" - @usableFromInline static let tcpType: JSString = "tcpType" @usableFromInline static let tee: JSString = "tee" - @usableFromInline static let tel: JSString = "tel" - @usableFromInline static let temporalIndex: JSString = "temporalIndex" @usableFromInline static let temporalLayerId: JSString = "temporalLayerId" @usableFromInline static let terminate: JSString = "terminate" - @usableFromInline static let test: JSString = "test" - @usableFromInline static let texImage2D: JSString = "texImage2D" - @usableFromInline static let texImage3D: JSString = "texImage3D" - @usableFromInline static let texParameterf: JSString = "texParameterf" - @usableFromInline static let texParameteri: JSString = "texParameteri" - @usableFromInline static let texStorage2D: JSString = "texStorage2D" - @usableFromInline static let texStorage3D: JSString = "texStorage3D" - @usableFromInline static let texSubImage2D: JSString = "texSubImage2D" - @usableFromInline static let texSubImage3D: JSString = "texSubImage3D" @usableFromInline static let text: JSString = "text" @usableFromInline static let textAlign: JSString = "textAlign" @usableFromInline static let textBaseline: JSString = "textBaseline" - @usableFromInline static let textColor: JSString = "textColor" @usableFromInline static let textContent: JSString = "textContent" - @usableFromInline static let textFormats: JSString = "textFormats" @usableFromInline static let textLength: JSString = "textLength" @usableFromInline static let textRendering: JSString = "textRendering" @usableFromInline static let textTracks: JSString = "textTracks" - @usableFromInline static let texture: JSString = "texture" - @usableFromInline static let textureArrayLength: JSString = "textureArrayLength" - @usableFromInline static let textureHeight: JSString = "textureHeight" - @usableFromInline static let textureType: JSString = "textureType" - @usableFromInline static let textureWidth: JSString = "textureWidth" - @usableFromInline static let threshold: JSString = "threshold" - @usableFromInline static let thresholds: JSString = "thresholds" @usableFromInline static let throwIfAborted: JSString = "throwIfAborted" - @usableFromInline static let tilt: JSString = "tilt" - @usableFromInline static let tiltX: JSString = "tiltX" - @usableFromInline static let tiltY: JSString = "tiltY" - @usableFromInline static let time: JSString = "time" - @usableFromInline static let timeEnd: JSString = "timeEnd" - @usableFromInline static let timeLog: JSString = "timeLog" @usableFromInline static let timeOrigin: JSString = "timeOrigin" - @usableFromInline static let timeRemaining: JSString = "timeRemaining" @usableFromInline static let timeStamp: JSString = "timeStamp" @usableFromInline static let timecode: JSString = "timecode" @usableFromInline static let timeline: JSString = "timeline" - @usableFromInline static let timelineTime: JSString = "timelineTime" @usableFromInline static let timeout: JSString = "timeout" @usableFromInline static let timestamp: JSString = "timestamp" @usableFromInline static let timestampOffset: JSString = "timestampOffset" - @usableFromInline static let timestampWrites: JSString = "timestampWrites" - @usableFromInline static let timing: JSString = "timing" @usableFromInline static let title: JSString = "title" - @usableFromInline static let titlebarAreaRect: JSString = "titlebarAreaRect" - @usableFromInline static let tlsGroup: JSString = "tlsGroup" - @usableFromInline static let tlsVersion: JSString = "tlsVersion" - @usableFromInline static let to: JSString = "to" - @usableFromInline static let toBox: JSString = "toBox" @usableFromInline static let toDataURL: JSString = "toDataURL" @usableFromInline static let toFloat32Array: JSString = "toFloat32Array" @usableFromInline static let toFloat64Array: JSString = "toFloat64Array" @usableFromInline static let toJSON: JSString = "toJSON" - @usableFromInline static let toMatrix: JSString = "toMatrix" - @usableFromInline static let toRecords: JSString = "toRecords" @usableFromInline static let toString: JSString = "toString" - @usableFromInline static let toSum: JSString = "toSum" @usableFromInline static let toggle: JSString = "toggle" @usableFromInline static let toggleAttribute: JSString = "toggleAttribute" - @usableFromInline static let tone: JSString = "tone" - @usableFromInline static let toneBuffer: JSString = "toneBuffer" @usableFromInline static let tooLong: JSString = "tooLong" @usableFromInline static let tooShort: JSString = "tooShort" @usableFromInline static let toolbar: JSString = "toolbar" @usableFromInline static let top: JSString = "top" - @usableFromInline static let topOrigin: JSString = "topOrigin" - @usableFromInline static let topology: JSString = "topology" - @usableFromInline static let torch: JSString = "torch" @usableFromInline static let total: JSString = "total" - @usableFromInline static let totalAudioEnergy: JSString = "totalAudioEnergy" - @usableFromInline static let totalDecodeTime: JSString = "totalDecodeTime" - @usableFromInline static let totalEncodeTime: JSString = "totalEncodeTime" - @usableFromInline static let totalEncodedBytesTarget: JSString = "totalEncodedBytesTarget" - @usableFromInline static let totalInterFrameDelay: JSString = "totalInterFrameDelay" - @usableFromInline static let totalPacketSendDelay: JSString = "totalPacketSendDelay" - @usableFromInline static let totalProcessingDelay: JSString = "totalProcessingDelay" - @usableFromInline static let totalRequestsSent: JSString = "totalRequestsSent" - @usableFromInline static let totalResponsesReceived: JSString = "totalResponsesReceived" - @usableFromInline static let totalRoundTripTime: JSString = "totalRoundTripTime" - @usableFromInline static let totalSamplesDecoded: JSString = "totalSamplesDecoded" - @usableFromInline static let totalSamplesDuration: JSString = "totalSamplesDuration" - @usableFromInline static let totalSamplesReceived: JSString = "totalSamplesReceived" - @usableFromInline static let totalSamplesSent: JSString = "totalSamplesSent" - @usableFromInline static let totalSquaredInterFrameDelay: JSString = "totalSquaredInterFrameDelay" - @usableFromInline static let totalVideoFrames: JSString = "totalVideoFrames" - @usableFromInline static let touchEvents: JSString = "touchEvents" - @usableFromInline static let touchId: JSString = "touchId" - @usableFromInline static let touchType: JSString = "touchType" - @usableFromInline static let touched: JSString = "touched" - @usableFromInline static let touches: JSString = "touches" - @usableFromInline static let trace: JSString = "trace" @usableFromInline static let track: JSString = "track" - @usableFromInline static let trackIdentifier: JSString = "trackIdentifier" - @usableFromInline static let trackedAnchors: JSString = "trackedAnchors" @usableFromInline static let tracks: JSString = "tracks" - @usableFromInline static let transaction: JSString = "transaction" - @usableFromInline static let transactionId: JSString = "transactionId" - @usableFromInline static let transceiver: JSString = "transceiver" - @usableFromInline static let transcript: JSString = "transcript" @usableFromInline static let transfer: JSString = "transfer" @usableFromInline static let transferControlToOffscreen: JSString = "transferControlToOffscreen" @usableFromInline static let transferFromImageBitmap: JSString = "transferFromImageBitmap" - @usableFromInline static let transferFunction: JSString = "transferFunction" - @usableFromInline static let transferIn: JSString = "transferIn" - @usableFromInline static let transferOut: JSString = "transferOut" - @usableFromInline static let transferSize: JSString = "transferSize" @usableFromInline static let transferToImageBitmap: JSString = "transferToImageBitmap" @usableFromInline static let transform: JSString = "transform" - @usableFromInline static let transformFeedbackVaryings: JSString = "transformFeedbackVaryings" @usableFromInline static let transformPoint: JSString = "transformPoint" @usableFromInline static let transformToDocument: JSString = "transformToDocument" @usableFromInline static let transformToFragment: JSString = "transformToFragment" - @usableFromInline static let transition: JSString = "transition" - @usableFromInline static let transitionProperty: JSString = "transitionProperty" - @usableFromInline static let transitionWhile: JSString = "transitionWhile" @usableFromInline static let translate: JSString = "translate" @usableFromInline static let translateSelf: JSString = "translateSelf" - @usableFromInline static let transport: JSString = "transport" - @usableFromInline static let transportId: JSString = "transportId" - @usableFromInline static let transports: JSString = "transports" - @usableFromInline static let transpose: JSString = "transpose" - @usableFromInline static let traverseTo: JSString = "traverseTo" @usableFromInline static let trueSpeed: JSString = "trueSpeed" - @usableFromInline static let truncate: JSString = "truncate" - @usableFromInline static let trustedTypes: JSString = "trustedTypes" - @usableFromInline static let turn: JSString = "turn" - @usableFromInline static let twist: JSString = "twist" - @usableFromInline static let txPower: JSString = "txPower" @usableFromInline static let type: JSString = "type" @usableFromInline static let typeMismatch: JSString = "typeMismatch" @usableFromInline static let types: JSString = "types" - @usableFromInline static let uaFullVersion: JSString = "uaFullVersion" - @usableFromInline static let unackData: JSString = "unackData" - @usableFromInline static let unclippedDepth: JSString = "unclippedDepth" - @usableFromInline static let unconfigure: JSString = "unconfigure" - @usableFromInline static let underlineColor: JSString = "underlineColor" - @usableFromInline static let underlineStyle: JSString = "underlineStyle" - @usableFromInline static let underlineThickness: JSString = "underlineThickness" - @usableFromInline static let unicodeRange: JSString = "unicodeRange" - @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 uniform1ui: JSString = "uniform1ui" - @usableFromInline static let uniform1uiv: JSString = "uniform1uiv" - @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 uniform2ui: JSString = "uniform2ui" - @usableFromInline static let uniform2uiv: JSString = "uniform2uiv" - @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 uniform3ui: JSString = "uniform3ui" - @usableFromInline static let uniform3uiv: JSString = "uniform3uiv" - @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 uniform4ui: JSString = "uniform4ui" - @usableFromInline static let uniform4uiv: JSString = "uniform4uiv" - @usableFromInline static let uniformBlockBinding: JSString = "uniformBlockBinding" - @usableFromInline static let uniformMatrix2fv: JSString = "uniformMatrix2fv" - @usableFromInline static let uniformMatrix2x3fv: JSString = "uniformMatrix2x3fv" - @usableFromInline static let uniformMatrix2x4fv: JSString = "uniformMatrix2x4fv" - @usableFromInline static let uniformMatrix3fv: JSString = "uniformMatrix3fv" - @usableFromInline static let uniformMatrix3x2fv: JSString = "uniformMatrix3x2fv" - @usableFromInline static let uniformMatrix3x4fv: JSString = "uniformMatrix3x4fv" - @usableFromInline static let uniformMatrix4fv: JSString = "uniformMatrix4fv" - @usableFromInline static let uniformMatrix4x2fv: JSString = "uniformMatrix4x2fv" - @usableFromInline static let uniformMatrix4x3fv: JSString = "uniformMatrix4x3fv" - @usableFromInline static let unique: JSString = "unique" - @usableFromInline static let unit: JSString = "unit" - @usableFromInline static let unitExponent: JSString = "unitExponent" - @usableFromInline static let unitFactorCurrentExponent: JSString = "unitFactorCurrentExponent" - @usableFromInline static let unitFactorLengthExponent: JSString = "unitFactorLengthExponent" - @usableFromInline static let unitFactorLuminousIntensityExponent: JSString = "unitFactorLuminousIntensityExponent" - @usableFromInline static let unitFactorMassExponent: JSString = "unitFactorMassExponent" - @usableFromInline static let unitFactorTemperatureExponent: JSString = "unitFactorTemperatureExponent" - @usableFromInline static let unitFactorTimeExponent: JSString = "unitFactorTimeExponent" - @usableFromInline static let unitSystem: JSString = "unitSystem" @usableFromInline static let unitType: JSString = "unitType" - @usableFromInline static let unloadEventEnd: JSString = "unloadEventEnd" - @usableFromInline static let unloadEventStart: JSString = "unloadEventStart" - @usableFromInline static let unlock: JSString = "unlock" - @usableFromInline static let unmap: JSString = "unmap" - @usableFromInline static let unobserve: JSString = "unobserve" - @usableFromInline static let unpauseAnimations: JSString = "unpauseAnimations" @usableFromInline static let unregister: JSString = "unregister" @usableFromInline static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" - @usableFromInline static let unsubscribe: JSString = "unsubscribe" @usableFromInline static let unsuspendRedraw: JSString = "unsuspendRedraw" @usableFromInline static let unsuspendRedrawAll: JSString = "unsuspendRedrawAll" - @usableFromInline static let unwrapKey: JSString = "unwrapKey" - @usableFromInline static let upX: JSString = "upX" - @usableFromInline static let upY: JSString = "upY" - @usableFromInline static let upZ: JSString = "upZ" @usableFromInline static let update: JSString = "update" - @usableFromInline static let updateCharacterBounds: JSString = "updateCharacterBounds" - @usableFromInline static let updateControlBound: JSString = "updateControlBound" - @usableFromInline static let updateCurrentEntry: JSString = "updateCurrentEntry" - @usableFromInline static let updateInkTrailStartPoint: JSString = "updateInkTrailStartPoint" @usableFromInline static let updatePlaybackRate: JSString = "updatePlaybackRate" - @usableFromInline static let updateRangeEnd: JSString = "updateRangeEnd" - @usableFromInline static let updateRangeStart: JSString = "updateRangeStart" - @usableFromInline static let updateRenderState: JSString = "updateRenderState" - @usableFromInline static let updateSelection: JSString = "updateSelection" - @usableFromInline static let updateSelectionBound: JSString = "updateSelectionBound" - @usableFromInline static let updateTargetFrameRate: JSString = "updateTargetFrameRate" - @usableFromInline static let updateText: JSString = "updateText" @usableFromInline static let updateTiming: JSString = "updateTiming" @usableFromInline static let updateViaCache: JSString = "updateViaCache" - @usableFromInline static let updateWith: JSString = "updateWith" @usableFromInline static let updating: JSString = "updating" @usableFromInline static let upgrade: JSString = "upgrade" @usableFromInline static let upload: JSString = "upload" - @usableFromInline static let uploadTotal: JSString = "uploadTotal" - @usableFromInline static let uploaded: JSString = "uploaded" - @usableFromInline static let upper: JSString = "upper" - @usableFromInline static let upperBound: JSString = "upperBound" - @usableFromInline static let upperOpen: JSString = "upperOpen" - @usableFromInline static let upperVerticalAngle: JSString = "upperVerticalAngle" - @usableFromInline static let uri: JSString = "uri" @usableFromInline static let url: JSString = "url" - @usableFromInline static let urls: JSString = "urls" - @usableFromInline static let usableWithDarkBackground: JSString = "usableWithDarkBackground" - @usableFromInline static let usableWithLightBackground: JSString = "usableWithLightBackground" - @usableFromInline static let usage: JSString = "usage" - @usableFromInline static let usageMaximum: JSString = "usageMaximum" - @usableFromInline static let usageMinimum: JSString = "usageMinimum" - @usableFromInline static let usagePage: JSString = "usagePage" - @usableFromInline static let usagePreference: JSString = "usagePreference" - @usableFromInline static let usages: JSString = "usages" - @usableFromInline static let usb: JSString = "usb" - @usableFromInline static let usbProductId: JSString = "usbProductId" - @usableFromInline static let usbVendorId: JSString = "usbVendorId" - @usableFromInline static let usbVersionMajor: JSString = "usbVersionMajor" - @usableFromInline static let usbVersionMinor: JSString = "usbVersionMinor" - @usableFromInline static let usbVersionSubminor: JSString = "usbVersionSubminor" - @usableFromInline static let use: JSString = "use" @usableFromInline static let useMap: JSString = "useMap" - @usableFromInline static let useProgram: JSString = "useProgram" - @usableFromInline static let user: JSString = "user" @usableFromInline static let userAgent: JSString = "userAgent" - @usableFromInline static let userAgentData: JSString = "userAgentData" - @usableFromInline static let userChoice: JSString = "userChoice" - @usableFromInline static let userHandle: JSString = "userHandle" - @usableFromInline static let userHint: JSString = "userHint" - @usableFromInline static let userInitiated: JSString = "userInitiated" - @usableFromInline static let userState: JSString = "userState" - @usableFromInline static let userVerification: JSString = "userVerification" - @usableFromInline static let userVisibleOnly: JSString = "userVisibleOnly" @usableFromInline static let username: JSString = "username" - @usableFromInline static let usernameFragment: JSString = "usernameFragment" - @usableFromInline static let usernameHint: JSString = "usernameHint" - @usableFromInline static let usesDepthValues: JSString = "usesDepthValues" - @usableFromInline static let utterance: JSString = "utterance" - @usableFromInline static let uuid: JSString = "uuid" - @usableFromInline static let uuids: JSString = "uuids" - @usableFromInline static let uvm: JSString = "uvm" @usableFromInline static let vAlign: JSString = "vAlign" @usableFromInline static let vLink: JSString = "vLink" @usableFromInline static let valid: JSString = "valid" - @usableFromInline static let validate: JSString = "validate" - @usableFromInline static let validateAssertion: JSString = "validateAssertion" - @usableFromInline static let validateProgram: JSString = "validateProgram" @usableFromInline static let validationMessage: JSString = "validationMessage" @usableFromInline static let validity: JSString = "validity" @usableFromInline static let value: JSString = "value" @@ -4888,138 +1739,47 @@ import JavaScriptKit @usableFromInline static let valueAsString: JSString = "valueAsString" @usableFromInline static let valueInSpecifiedUnits: JSString = "valueInSpecifiedUnits" @usableFromInline static let valueMissing: JSString = "valueMissing" - @usableFromInline static let valueOf: JSString = "valueOf" @usableFromInline static let valueType: JSString = "valueType" - @usableFromInline static let values: JSString = "values" - @usableFromInline static let variable: JSString = "variable" - @usableFromInline static let variant: JSString = "variant" - @usableFromInline static let variationSettings: JSString = "variationSettings" - @usableFromInline static let variations: JSString = "variations" - @usableFromInline static let vb: JSString = "vb" @usableFromInline static let vendor: JSString = "vendor" - @usableFromInline static let vendorId: JSString = "vendorId" @usableFromInline static let vendorSub: JSString = "vendorSub" - @usableFromInline static let verify: JSString = "verify" @usableFromInline static let version: JSString = "version" - @usableFromInline static let vertex: JSString = "vertex" - @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 vertexAttribDivisor: JSString = "vertexAttribDivisor" - @usableFromInline static let vertexAttribDivisorANGLE: JSString = "vertexAttribDivisorANGLE" - @usableFromInline static let vertexAttribI4i: JSString = "vertexAttribI4i" - @usableFromInline static let vertexAttribI4iv: JSString = "vertexAttribI4iv" - @usableFromInline static let vertexAttribI4ui: JSString = "vertexAttribI4ui" - @usableFromInline static let vertexAttribI4uiv: JSString = "vertexAttribI4uiv" - @usableFromInline static let vertexAttribIPointer: JSString = "vertexAttribIPointer" - @usableFromInline static let vertexAttribPointer: JSString = "vertexAttribPointer" - @usableFromInline static let vertical: JSString = "vertical" - @usableFromInline static let vh: JSString = "vh" - @usableFromInline static let vi: JSString = "vi" - @usableFromInline static let vibrate: JSString = "vibrate" @usableFromInline static let video: JSString = "video" @usableFromInline static let videoBitsPerSecond: JSString = "videoBitsPerSecond" - @usableFromInline static let videoCapabilities: JSString = "videoCapabilities" @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 viewBox: JSString = "viewBox" - @usableFromInline static let viewDimension: JSString = "viewDimension" - @usableFromInline static let viewFormats: JSString = "viewFormats" - @usableFromInline static let viewPixelHeight: JSString = "viewPixelHeight" - @usableFromInline static let viewPixelWidth: JSString = "viewPixelWidth" - @usableFromInline static let viewport: JSString = "viewport" - @usableFromInline static let viewportAnchorX: JSString = "viewportAnchorX" - @usableFromInline static let viewportAnchorY: JSString = "viewportAnchorY" @usableFromInline static let viewportElement: JSString = "viewportElement" - @usableFromInline static let views: JSString = "views" - @usableFromInline static let violatedDirective: JSString = "violatedDirective" - @usableFromInline static let violationSample: JSString = "violationSample" - @usableFromInline static let violationType: JSString = "violationType" - @usableFromInline static let violationURL: JSString = "violationURL" - @usableFromInline static let virtualKeyboard: JSString = "virtualKeyboard" - @usableFromInline static let virtualKeyboardPolicy: JSString = "virtualKeyboardPolicy" - @usableFromInline static let visibility: JSString = "visibility" @usableFromInline static let visibilityState: JSString = "visibilityState" @usableFromInline static let visible: JSString = "visible" @usableFromInline static let visibleRect: JSString = "visibleRect" - @usableFromInline static let visualViewport: JSString = "visualViewport" @usableFromInline static let vlinkColor: JSString = "vlinkColor" - @usableFromInline static let vmax: JSString = "vmax" - @usableFromInline static let vmin: JSString = "vmin" - @usableFromInline static let voice: JSString = "voice" - @usableFromInline static let voiceActivityFlag: JSString = "voiceActivityFlag" - @usableFromInline static let voiceURI: JSString = "voiceURI" @usableFromInline static let volume: JSString = "volume" @usableFromInline static let vspace: JSString = "vspace" - @usableFromInline static let vw: JSString = "vw" @usableFromInline static let w: JSString = "w" - @usableFromInline static let waitSync: JSString = "waitSync" @usableFromInline static let waiting: JSString = "waiting" - @usableFromInline static let wakeLock: JSString = "wakeLock" - @usableFromInline static let warn: JSString = "warn" - @usableFromInline static let wasClean: JSString = "wasClean" - @usableFromInline static let wasDiscarded: JSString = "wasDiscarded" - @usableFromInline static let watchAdvertisements: JSString = "watchAdvertisements" - @usableFromInline static let watchingAdvertisements: JSString = "watchingAdvertisements" - @usableFromInline static let webdriver: JSString = "webdriver" - @usableFromInline static let webkitEntries: JSString = "webkitEntries" - @usableFromInline static let webkitGetAsEntry: JSString = "webkitGetAsEntry" @usableFromInline static let webkitMatchesSelector: JSString = "webkitMatchesSelector" - @usableFromInline static let webkitRelativePath: JSString = "webkitRelativePath" - @usableFromInline static let webkitdirectory: JSString = "webkitdirectory" - @usableFromInline static let weight: JSString = "weight" @usableFromInline static let whatToShow: JSString = "whatToShow" @usableFromInline static let whenDefined: JSString = "whenDefined" @usableFromInline static let which: JSString = "which" - @usableFromInline static let whiteBalanceMode: JSString = "whiteBalanceMode" @usableFromInline static let wholeText: JSString = "wholeText" @usableFromInline static let width: JSString = "width" @usableFromInline static let willReadFrequently: JSString = "willReadFrequently" @usableFromInline static let willValidate: JSString = "willValidate" @usableFromInline static let window: JSString = "window" - @usableFromInline static let windowControlsOverlay: JSString = "windowControlsOverlay" - @usableFromInline static let windowDimensions: JSString = "windowDimensions" @usableFromInline static let withCredentials: JSString = "withCredentials" @usableFromInline static let wordSpacing: JSString = "wordSpacing" - @usableFromInline static let workerStart: JSString = "workerStart" - @usableFromInline static let wow64: JSString = "wow64" @usableFromInline static let wrap: JSString = "wrap" - @usableFromInline static let wrapKey: JSString = "wrapKey" @usableFromInline static let writable: JSString = "writable" - @usableFromInline static let writableAuxiliaries: JSString = "writableAuxiliaries" @usableFromInline static let writableType: JSString = "writableType" @usableFromInline static let write: JSString = "write" - @usableFromInline static let writeBuffer: JSString = "writeBuffer" - @usableFromInline static let writeMask: JSString = "writeMask" - @usableFromInline static let writeText: JSString = "writeText" - @usableFromInline static let writeTexture: JSString = "writeTexture" - @usableFromInline static let writeTimestamp: JSString = "writeTimestamp" - @usableFromInline static let writeValue: JSString = "writeValue" - @usableFromInline static let writeValueWithResponse: JSString = "writeValueWithResponse" - @usableFromInline static let writeValueWithoutResponse: JSString = "writeValueWithoutResponse" - @usableFromInline static let writeWithoutResponse: JSString = "writeWithoutResponse" @usableFromInline static let writeln: JSString = "writeln" - @usableFromInline static let written: JSString = "written" @usableFromInline static let x: JSString = "x" @usableFromInline static let x1: JSString = "x1" @usableFromInline static let x2: JSString = "x2" - @usableFromInline static let xBias: JSString = "xBias" - @usableFromInline static let xChannelSelector: JSString = "xChannelSelector" - @usableFromInline static let xr: JSString = "xr" - @usableFromInline static let xrCompatible: JSString = "xrCompatible" @usableFromInline static let y: JSString = "y" @usableFromInline static let y1: JSString = "y1" @usableFromInline static let y2: JSString = "y2" - @usableFromInline static let yBias: JSString = "yBias" - @usableFromInline static let yChannelSelector: JSString = "yChannelSelector" @usableFromInline static let z: JSString = "z" - @usableFromInline static let zBias: JSString = "zBias" - @usableFromInline static let zoom: JSString = "zoom" } diff --git a/Sources/DOMKit/WebIDL/StylePropertyMap.swift b/Sources/DOMKit/WebIDL/StylePropertyMap.swift deleted file mode 100644 index 377e230a..00000000 --- a/Sources/DOMKit/WebIDL/StylePropertyMap.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class StylePropertyMap: StylePropertyMapReadOnly { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.StylePropertyMap].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func set(property: String, values: CSSStyleValue_or_String...) { - let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [property.jsValue] + values.map(\.jsValue)) - } - - @inlinable public func append(property: String, values: CSSStyleValue_or_String...) { - let this = jsObject - _ = this[Strings.append].function!(this: this, arguments: [property.jsValue] + values.map(\.jsValue)) - } - - @inlinable public func delete(property: String) { - let this = jsObject - _ = this[Strings.delete].function!(this: this, arguments: [property.jsValue]) - } - - @inlinable public func clear() { - let this = jsObject - _ = this[Strings.clear].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift b/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift deleted file mode 100644 index ba1e0570..00000000 --- a/Sources/DOMKit/WebIDL/StylePropertyMapReadOnly.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class StylePropertyMapReadOnly: JSBridgedClass, Sequence { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.StylePropertyMapReadOnly].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) - self.jsObject = jsObject - } - - public typealias Element = String - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) - } - - @inlinable public func get(property: String) -> JSValue { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [property.jsValue]).fromJSValue()! - } - - @inlinable public func getAll(property: String) -> [CSSStyleValue] { - let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [property.jsValue]).fromJSValue()! - } - - @inlinable public func has(property: String) -> Bool { - let this = jsObject - return this[Strings.has].function!(this: this, arguments: [property.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var size: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/SubtleCrypto.swift b/Sources/DOMKit/WebIDL/SubtleCrypto.swift deleted file mode 100644 index 180b4882..00000000 --- a/Sources/DOMKit/WebIDL/SubtleCrypto.swift +++ /dev/null @@ -1,172 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SubtleCrypto: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SubtleCrypto].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.encrypt].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.decrypt].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.sign].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, data.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, signature.jsValue, data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.verify].function!(this: this, arguments: [algorithm.jsValue, key.jsValue, signature.jsValue, data.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue, data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func digest(algorithm: AlgorithmIdentifier, data: BufferSource) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.digest].function!(this: this, arguments: [algorithm.jsValue, data.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { - let this = jsObject - return this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func generateKey(algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.generateKey].function!(this: this, arguments: [algorithm.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { - let this = jsObject - return this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue, baseKey.jsValue, derivedKeyType.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.deriveKey].function!(this: this, arguments: [algorithm.jsValue, baseKey.jsValue, derivedKeyType.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) -> JSPromise { - let this = jsObject - return this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue, baseKey.jsValue, length.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: UInt32) async throws -> ArrayBuffer { - let this = jsObject - let _promise: JSPromise = this[Strings.deriveBits].function!(this: this, arguments: [algorithm.jsValue, baseKey.jsValue, length.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func importKey(format: KeyFormat, keyData: BufferSource_or_JsonWebKey, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { - let this = jsObject - return this[Strings.importKey].function!(this: this, arguments: [format.jsValue, keyData.jsValue, algorithm.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func importKey(format: KeyFormat, keyData: BufferSource_or_JsonWebKey, algorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { - let this = jsObject - let _promise: JSPromise = this[Strings.importKey].function!(this: this, arguments: [format.jsValue, keyData.jsValue, algorithm.jsValue, extractable.jsValue, keyUsages.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func exportKey(format: KeyFormat, key: CryptoKey) -> JSPromise { - let this = jsObject - return this[Strings.exportKey].function!(this: this, arguments: [format.jsValue, key.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func exportKey(format: KeyFormat, key: CryptoKey) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.exportKey].function!(this: this, arguments: [format.jsValue, key.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) -> JSPromise { - let this = jsObject - return this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue, key.jsValue, wrappingKey.jsValue, wrapAlgorithm.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier) async throws -> JSValue { - let this = jsObject - let _promise: JSPromise = this[Strings.wrapKey].function!(this: this, arguments: [format.jsValue, key.jsValue, wrappingKey.jsValue, wrapAlgorithm.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) -> JSPromise { - let _arg0 = format.jsValue - let _arg1 = wrappedKey.jsValue - let _arg2 = unwrappingKey.jsValue - let _arg3 = unwrapAlgorithm.jsValue - let _arg4 = unwrappedKeyAlgorithm.jsValue - let _arg5 = extractable.jsValue - let _arg6 = keyUsages.jsValue - let this = jsObject - return this[Strings.unwrapKey].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Bool, keyUsages: [KeyUsage]) async throws -> CryptoKey { - let _arg0 = format.jsValue - let _arg1 = wrappedKey.jsValue - let _arg2 = unwrappingKey.jsValue - let _arg3 = unwrapAlgorithm.jsValue - let _arg4 = unwrappedKeyAlgorithm.jsValue - let _arg5 = extractable.jsValue - let _arg6 = keyUsages.jsValue - let this = jsObject - let _promise: JSPromise = this[Strings.unwrapKey].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/SyncEventInit.swift b/Sources/DOMKit/WebIDL/SyncEventInit.swift deleted file mode 100644 index fff664f6..00000000 --- a/Sources/DOMKit/WebIDL/SyncEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SyncEventInit: BridgedDictionary { - public convenience init(tag: String, lastChance: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.tag] = tag.jsValue - object[Strings.lastChance] = lastChance.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _tag = ReadWriteAttribute(jsObject: object, name: Strings.tag) - _lastChance = ReadWriteAttribute(jsObject: object, name: Strings.lastChance) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var tag: String - - @ReadWriteAttribute - public var lastChance: Bool -} diff --git a/Sources/DOMKit/WebIDL/SyncManager.swift b/Sources/DOMKit/WebIDL/SyncManager.swift deleted file mode 100644 index 55f20a87..00000000 --- a/Sources/DOMKit/WebIDL/SyncManager.swift +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SyncManager: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SyncManager].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func register(tag: String) -> JSPromise { - let this = jsObject - return this[Strings.register].function!(this: this, arguments: [tag.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func register(tag: String) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.register].function!(this: this, arguments: [tag.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func getTags() -> JSPromise { - let this = jsObject - return this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getTags() async throws -> [String] { - let this = jsObject - let _promise: JSPromise = this[Strings.getTags].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/Table.swift b/Sources/DOMKit/WebIDL/Table.swift deleted file mode 100644 index 1d30e1f9..00000000 --- a/Sources/DOMKit/WebIDL/Table.swift +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Table: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Table].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - self.jsObject = jsObject - } - - @inlinable public convenience init(descriptor: TableDescriptor, value: JSValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [descriptor.jsValue, value?.jsValue ?? .undefined])) - } - - @inlinable public func grow(delta: UInt32, value: JSValue? = nil) -> UInt32 { - let this = jsObject - return this[Strings.grow].function!(this: this, arguments: [delta.jsValue, value?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func get(index: UInt32) -> JSValue { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [index.jsValue]).fromJSValue()! - } - - @inlinable public func set(index: UInt32, value: JSValue? = nil) { - let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [index.jsValue, value?.jsValue ?? .undefined]) - } - - @ReadonlyAttribute - public var length: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/TableDescriptor.swift b/Sources/DOMKit/WebIDL/TableDescriptor.swift deleted file mode 100644 index 1f9fbe78..00000000 --- a/Sources/DOMKit/WebIDL/TableDescriptor.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TableDescriptor: BridgedDictionary { - public convenience init(element: TableKind, initial: UInt32, maximum: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.element] = element.jsValue - object[Strings.initial] = initial.jsValue - object[Strings.maximum] = maximum.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _element = ReadWriteAttribute(jsObject: object, name: Strings.element) - _initial = ReadWriteAttribute(jsObject: object, name: Strings.initial) - _maximum = ReadWriteAttribute(jsObject: object, name: Strings.maximum) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var element: TableKind - - @ReadWriteAttribute - public var initial: UInt32 - - @ReadWriteAttribute - public var maximum: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/TableKind.swift b/Sources/DOMKit/WebIDL/TableKind.swift deleted file mode 100644 index 6662bd31..00000000 --- a/Sources/DOMKit/WebIDL/TableKind.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum TableKind: JSString, JSValueCompatible { - case externref = "externref" - case anyfunc = "anyfunc" - - @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/TaskAttributionTiming.swift b/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift deleted file mode 100644 index cfdd0863..00000000 --- a/Sources/DOMKit/WebIDL/TaskAttributionTiming.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TaskAttributionTiming: PerformanceEntry { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TaskAttributionTiming].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _containerType = ReadonlyAttribute(jsObject: jsObject, name: Strings.containerType) - _containerSrc = ReadonlyAttribute(jsObject: jsObject, name: Strings.containerSrc) - _containerId = ReadonlyAttribute(jsObject: jsObject, name: Strings.containerId) - _containerName = ReadonlyAttribute(jsObject: jsObject, name: Strings.containerName) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var containerType: String - - @ReadonlyAttribute - public var containerSrc: String - - @ReadonlyAttribute - public var containerId: String - - @ReadonlyAttribute - public var containerName: String - - @inlinable override public func toJSON() -> JSObject { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/TaskController.swift b/Sources/DOMKit/WebIDL/TaskController.swift deleted file mode 100644 index 7f732b55..00000000 --- a/Sources/DOMKit/WebIDL/TaskController.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TaskController: AbortController { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TaskController].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(init: TaskControllerInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) - } - - @inlinable public func setPriority(priority: TaskPriority) { - let this = jsObject - _ = this[Strings.setPriority].function!(this: this, arguments: [priority.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/TaskControllerInit.swift b/Sources/DOMKit/WebIDL/TaskControllerInit.swift deleted file mode 100644 index 73c60f90..00000000 --- a/Sources/DOMKit/WebIDL/TaskControllerInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TaskControllerInit: BridgedDictionary { - public convenience init(priority: TaskPriority) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.priority] = priority.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _priority = ReadWriteAttribute(jsObject: object, name: Strings.priority) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var priority: TaskPriority -} diff --git a/Sources/DOMKit/WebIDL/TaskPriority.swift b/Sources/DOMKit/WebIDL/TaskPriority.swift deleted file mode 100644 index fb20e3d8..00000000 --- a/Sources/DOMKit/WebIDL/TaskPriority.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum TaskPriority: JSString, JSValueCompatible { - case userBlocking = "user-blocking" - case userVisible = "user-visible" - case background = "background" - - @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/TaskPriorityChangeEvent.swift b/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift deleted file mode 100644 index e04b95c1..00000000 --- a/Sources/DOMKit/WebIDL/TaskPriorityChangeEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TaskPriorityChangeEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TaskPriorityChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _previousPriority = ReadonlyAttribute(jsObject: jsObject, name: Strings.previousPriority) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, priorityChangeEventInitDict: TaskPriorityChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, priorityChangeEventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var previousPriority: TaskPriority -} diff --git a/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift b/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift deleted file mode 100644 index 2b5def85..00000000 --- a/Sources/DOMKit/WebIDL/TaskPriorityChangeEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TaskPriorityChangeEventInit: BridgedDictionary { - public convenience init(previousPriority: TaskPriority) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.previousPriority] = previousPriority.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _previousPriority = ReadWriteAttribute(jsObject: object, name: Strings.previousPriority) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var previousPriority: TaskPriority -} diff --git a/Sources/DOMKit/WebIDL/TaskSignal.swift b/Sources/DOMKit/WebIDL/TaskSignal.swift deleted file mode 100644 index 04233472..00000000 --- a/Sources/DOMKit/WebIDL/TaskSignal.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TaskSignal: AbortSignal { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TaskSignal].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _priority = ReadonlyAttribute(jsObject: jsObject, name: Strings.priority) - _onprioritychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onprioritychange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var priority: TaskPriority - - @ClosureAttribute1Optional - public var onprioritychange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/TestUtils.swift b/Sources/DOMKit/WebIDL/TestUtils.swift deleted file mode 100644 index 23438935..00000000 --- a/Sources/DOMKit/WebIDL/TestUtils.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum TestUtils { - @inlinable public static var jsObject: JSObject { - JSObject.global[Strings.TestUtils].object! - } - - @inlinable public static func gc() -> JSPromise { - let this = JSObject.global[Strings.TestUtils].object! - return this[Strings.gc].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func gc() async throws { - let this = JSObject.global[Strings.TestUtils].object! - let _promise: JSPromise = this[Strings.gc].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/TexImageSource.swift b/Sources/DOMKit/WebIDL/TexImageSource.swift deleted file mode 100644 index 3a265f58..00000000 --- a/Sources/DOMKit/WebIDL/TexImageSource.swift +++ /dev/null @@ -1,67 +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) - - 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/Text.swift b/Sources/DOMKit/WebIDL/Text.swift index c6bb9fa3..63922264 100644 --- a/Sources/DOMKit/WebIDL/Text.swift +++ b/Sources/DOMKit/WebIDL/Text.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class Text: CharacterData, GeometryUtils, Slottable { +public class Text: CharacterData, Slottable { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Text].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/TextDecodeOptions.swift b/Sources/DOMKit/WebIDL/TextDecodeOptions.swift deleted file mode 100644 index b1c5f850..00000000 --- a/Sources/DOMKit/WebIDL/TextDecodeOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextDecodeOptions: BridgedDictionary { - public convenience init(stream: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.stream] = stream.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _stream = ReadWriteAttribute(jsObject: object, name: Strings.stream) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var stream: Bool -} diff --git a/Sources/DOMKit/WebIDL/TextDecoder.swift b/Sources/DOMKit/WebIDL/TextDecoder.swift deleted file mode 100644 index ef616ba7..00000000 --- a/Sources/DOMKit/WebIDL/TextDecoder.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextDecoder: JSBridgedClass, TextDecoderCommon { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextDecoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue ?? .undefined, options?.jsValue ?? .undefined])) - } - - @inlinable public func decode(input: BufferSource? = nil, options: TextDecodeOptions? = nil) -> String { - let this = jsObject - return this[Strings.decode].function!(this: this, arguments: [input?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/TextDecoderCommon.swift b/Sources/DOMKit/WebIDL/TextDecoderCommon.swift deleted file mode 100644 index d2e70f26..00000000 --- a/Sources/DOMKit/WebIDL/TextDecoderCommon.swift +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol TextDecoderCommon: JSBridgedClass {} -public extension TextDecoderCommon { - @inlinable var encoding: String { ReadonlyAttribute[Strings.encoding, in: jsObject] } - - @inlinable var fatal: Bool { ReadonlyAttribute[Strings.fatal, in: jsObject] } - - @inlinable var ignoreBOM: Bool { ReadonlyAttribute[Strings.ignoreBOM, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/TextDecoderOptions.swift b/Sources/DOMKit/WebIDL/TextDecoderOptions.swift deleted file mode 100644 index b935dd84..00000000 --- a/Sources/DOMKit/WebIDL/TextDecoderOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextDecoderOptions: BridgedDictionary { - public convenience init(fatal: Bool, ignoreBOM: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fatal] = fatal.jsValue - object[Strings.ignoreBOM] = ignoreBOM.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _fatal = ReadWriteAttribute(jsObject: object, name: Strings.fatal) - _ignoreBOM = ReadWriteAttribute(jsObject: object, name: Strings.ignoreBOM) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var fatal: Bool - - @ReadWriteAttribute - public var ignoreBOM: Bool -} diff --git a/Sources/DOMKit/WebIDL/TextDecoderStream.swift b/Sources/DOMKit/WebIDL/TextDecoderStream.swift deleted file mode 100644 index 4dc556af..00000000 --- a/Sources/DOMKit/WebIDL/TextDecoderStream.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextDecoderStream: JSBridgedClass, TextDecoderCommon, GenericTransformStream { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextDecoderStream].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(label: String? = nil, options: TextDecoderOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [label?.jsValue ?? .undefined, options?.jsValue ?? .undefined])) - } -} diff --git a/Sources/DOMKit/WebIDL/TextDetector.swift b/Sources/DOMKit/WebIDL/TextDetector.swift deleted file mode 100644 index 1320196f..00000000 --- a/Sources/DOMKit/WebIDL/TextDetector.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextDetector: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextDetector].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @inlinable public func detect(image: ImageBitmapSource) -> JSPromise { - let this = jsObject - return this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func detect(image: ImageBitmapSource) async throws -> [DetectedText] { - let this = jsObject - let _promise: JSPromise = this[Strings.detect].function!(this: this, arguments: [image.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/TextEncoder.swift b/Sources/DOMKit/WebIDL/TextEncoder.swift deleted file mode 100644 index 8d3e8596..00000000 --- a/Sources/DOMKit/WebIDL/TextEncoder.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextEncoder: JSBridgedClass, TextEncoderCommon { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextEncoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @inlinable public func encode(input: String? = nil) -> Uint8Array { - let this = jsObject - return this[Strings.encode].function!(this: this, arguments: [input?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func encodeInto(source: String, destination: Uint8Array) -> TextEncoderEncodeIntoResult { - let this = jsObject - return this[Strings.encodeInto].function!(this: this, arguments: [source.jsValue, destination.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/TextEncoderCommon.swift b/Sources/DOMKit/WebIDL/TextEncoderCommon.swift deleted file mode 100644 index b5cecbcf..00000000 --- a/Sources/DOMKit/WebIDL/TextEncoderCommon.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol TextEncoderCommon: JSBridgedClass {} -public extension TextEncoderCommon { - @inlinable var encoding: String { ReadonlyAttribute[Strings.encoding, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift b/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift deleted file mode 100644 index 9f2e0e03..00000000 --- a/Sources/DOMKit/WebIDL/TextEncoderEncodeIntoResult.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextEncoderEncodeIntoResult: BridgedDictionary { - public convenience init(read: UInt64, written: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.read] = read.jsValue - object[Strings.written] = written.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _read = ReadWriteAttribute(jsObject: object, name: Strings.read) - _written = ReadWriteAttribute(jsObject: object, name: Strings.written) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var read: UInt64 - - @ReadWriteAttribute - public var written: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/TextEncoderStream.swift b/Sources/DOMKit/WebIDL/TextEncoderStream.swift deleted file mode 100644 index 15533b0b..00000000 --- a/Sources/DOMKit/WebIDL/TextEncoderStream.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextEncoderStream: JSBridgedClass, TextEncoderCommon, GenericTransformStream { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextEncoderStream].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } -} diff --git a/Sources/DOMKit/WebIDL/TextFormat.swift b/Sources/DOMKit/WebIDL/TextFormat.swift deleted file mode 100644 index 5143ef8d..00000000 --- a/Sources/DOMKit/WebIDL/TextFormat.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextFormat: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TextFormat].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _rangeStart = ReadWriteAttribute(jsObject: jsObject, name: Strings.rangeStart) - _rangeEnd = ReadWriteAttribute(jsObject: jsObject, name: Strings.rangeEnd) - _textColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.textColor) - _backgroundColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.backgroundColor) - _underlineStyle = ReadWriteAttribute(jsObject: jsObject, name: Strings.underlineStyle) - _underlineThickness = ReadWriteAttribute(jsObject: jsObject, name: Strings.underlineThickness) - _underlineColor = ReadWriteAttribute(jsObject: jsObject, name: Strings.underlineColor) - self.jsObject = jsObject - } - - @inlinable public convenience init(options: TextFormatInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var rangeStart: UInt32 - - @ReadWriteAttribute - public var rangeEnd: UInt32 - - @ReadWriteAttribute - public var textColor: String - - @ReadWriteAttribute - public var backgroundColor: String - - @ReadWriteAttribute - public var underlineStyle: String - - @ReadWriteAttribute - public var underlineThickness: String - - @ReadWriteAttribute - public var underlineColor: String -} diff --git a/Sources/DOMKit/WebIDL/TextFormatInit.swift b/Sources/DOMKit/WebIDL/TextFormatInit.swift deleted file mode 100644 index 8c5d0097..00000000 --- a/Sources/DOMKit/WebIDL/TextFormatInit.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextFormatInit: BridgedDictionary { - public convenience init(rangeStart: UInt32, rangeEnd: UInt32, textColor: String, backgroundColor: String, underlineStyle: String, underlineThickness: String, underlineColor: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rangeStart] = rangeStart.jsValue - object[Strings.rangeEnd] = rangeEnd.jsValue - object[Strings.textColor] = textColor.jsValue - object[Strings.backgroundColor] = backgroundColor.jsValue - object[Strings.underlineStyle] = underlineStyle.jsValue - object[Strings.underlineThickness] = underlineThickness.jsValue - object[Strings.underlineColor] = underlineColor.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _rangeStart = ReadWriteAttribute(jsObject: object, name: Strings.rangeStart) - _rangeEnd = ReadWriteAttribute(jsObject: object, name: Strings.rangeEnd) - _textColor = ReadWriteAttribute(jsObject: object, name: Strings.textColor) - _backgroundColor = ReadWriteAttribute(jsObject: object, name: Strings.backgroundColor) - _underlineStyle = ReadWriteAttribute(jsObject: object, name: Strings.underlineStyle) - _underlineThickness = ReadWriteAttribute(jsObject: object, name: Strings.underlineThickness) - _underlineColor = ReadWriteAttribute(jsObject: object, name: Strings.underlineColor) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var rangeStart: UInt32 - - @ReadWriteAttribute - public var rangeEnd: UInt32 - - @ReadWriteAttribute - public var textColor: String - - @ReadWriteAttribute - public var backgroundColor: String - - @ReadWriteAttribute - public var underlineStyle: String - - @ReadWriteAttribute - public var underlineThickness: String - - @ReadWriteAttribute - public var underlineColor: String -} diff --git a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift deleted file mode 100644 index 26c7c78e..00000000 --- a/Sources/DOMKit/WebIDL/TextFormatUpdateEvent.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextFormatUpdateEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TextFormatUpdateEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: TextFormatUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @inlinable public func getTextFormats() -> [TextFormat] { - let this = jsObject - return this[Strings.getTextFormats].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift b/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift deleted file mode 100644 index 2dc74c8f..00000000 --- a/Sources/DOMKit/WebIDL/TextFormatUpdateEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextFormatUpdateEventInit: BridgedDictionary { - public convenience init(textFormats: [TextFormat]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textFormats] = textFormats.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _textFormats = ReadWriteAttribute(jsObject: object, name: Strings.textFormats) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var textFormats: [TextFormat] -} diff --git a/Sources/DOMKit/WebIDL/TextUpdateEvent.swift b/Sources/DOMKit/WebIDL/TextUpdateEvent.swift deleted file mode 100644 index c4515dbb..00000000 --- a/Sources/DOMKit/WebIDL/TextUpdateEvent.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextUpdateEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TextUpdateEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _updateRangeStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.updateRangeStart) - _updateRangeEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.updateRangeEnd) - _text = ReadonlyAttribute(jsObject: jsObject, name: Strings.text) - _selectionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionStart) - _selectionEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectionEnd) - _compositionStart = ReadonlyAttribute(jsObject: jsObject, name: Strings.compositionStart) - _compositionEnd = ReadonlyAttribute(jsObject: jsObject, name: Strings.compositionEnd) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: TextUpdateEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var updateRangeStart: UInt32 - - @ReadonlyAttribute - public var updateRangeEnd: UInt32 - - @ReadonlyAttribute - public var text: String - - @ReadonlyAttribute - public var selectionStart: UInt32 - - @ReadonlyAttribute - public var selectionEnd: UInt32 - - @ReadonlyAttribute - public var compositionStart: UInt32 - - @ReadonlyAttribute - public var compositionEnd: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift b/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift deleted file mode 100644 index 1b489b6d..00000000 --- a/Sources/DOMKit/WebIDL/TextUpdateEventInit.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TextUpdateEventInit: BridgedDictionary { - public convenience init(updateRangeStart: UInt32, updateRangeEnd: UInt32, text: String, selectionStart: UInt32, selectionEnd: UInt32, compositionStart: UInt32, compositionEnd: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.updateRangeStart] = updateRangeStart.jsValue - object[Strings.updateRangeEnd] = updateRangeEnd.jsValue - object[Strings.text] = text.jsValue - object[Strings.selectionStart] = selectionStart.jsValue - object[Strings.selectionEnd] = selectionEnd.jsValue - object[Strings.compositionStart] = compositionStart.jsValue - object[Strings.compositionEnd] = compositionEnd.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _updateRangeStart = ReadWriteAttribute(jsObject: object, name: Strings.updateRangeStart) - _updateRangeEnd = ReadWriteAttribute(jsObject: object, name: Strings.updateRangeEnd) - _text = ReadWriteAttribute(jsObject: object, name: Strings.text) - _selectionStart = ReadWriteAttribute(jsObject: object, name: Strings.selectionStart) - _selectionEnd = ReadWriteAttribute(jsObject: object, name: Strings.selectionEnd) - _compositionStart = ReadWriteAttribute(jsObject: object, name: Strings.compositionStart) - _compositionEnd = ReadWriteAttribute(jsObject: object, name: Strings.compositionEnd) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var updateRangeStart: UInt32 - - @ReadWriteAttribute - public var updateRangeEnd: UInt32 - - @ReadWriteAttribute - public var text: String - - @ReadWriteAttribute - public var selectionStart: UInt32 - - @ReadWriteAttribute - public var selectionEnd: UInt32 - - @ReadWriteAttribute - public var compositionStart: UInt32 - - @ReadWriteAttribute - public var compositionEnd: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/TimeEvent.swift b/Sources/DOMKit/WebIDL/TimeEvent.swift deleted file mode 100644 index 42adcf48..00000000 --- a/Sources/DOMKit/WebIDL/TimeEvent.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TimeEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TimeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _view = ReadonlyAttribute(jsObject: jsObject, name: Strings.view) - _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var view: WindowProxy? - - @ReadonlyAttribute - public var detail: Int32 - - @inlinable public func initTimeEvent(typeArg: String, viewArg: Window?, detailArg: Int32) { - let this = jsObject - _ = this[Strings.initTimeEvent].function!(this: this, arguments: [typeArg.jsValue, viewArg.jsValue, detailArg.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/TimerHandler.swift b/Sources/DOMKit/WebIDL/TimerHandler.swift index 7610b41b..8c848736 100644 --- a/Sources/DOMKit/WebIDL/TimerHandler.swift +++ b/Sources/DOMKit/WebIDL/TimerHandler.swift @@ -8,12 +8,12 @@ extension JSFunction: Any_TimerHandler {} extension String: Any_TimerHandler {} public enum TimerHandler: JSValueCompatible, Any_TimerHandler { - case jSFunction(JSFunction) + case jsFunction(JSFunction) case string(String) public static func construct(from value: JSValue) -> Self? { - if let jSFunction: JSFunction = value.fromJSValue() { - return .jSFunction(jSFunction) + if let jsFunction: JSFunction = value.fromJSValue() { + return .jsFunction(jsFunction) } if let string: String = value.fromJSValue() { return .string(string) @@ -23,8 +23,8 @@ public enum TimerHandler: JSValueCompatible, Any_TimerHandler { public var jsValue: JSValue { switch self { - case let .jSFunction(jSFunction): - return jSFunction.jsValue + case let .jsFunction(jsFunction): + return jsFunction.jsValue case let .string(string): return string.jsValue } diff --git a/Sources/DOMKit/WebIDL/TokenBinding.swift b/Sources/DOMKit/WebIDL/TokenBinding.swift deleted file mode 100644 index e7a93f6c..00000000 --- a/Sources/DOMKit/WebIDL/TokenBinding.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TokenBinding: BridgedDictionary { - public convenience init(status: String, id: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.status] = status.jsValue - object[Strings.id] = id.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _status = ReadWriteAttribute(jsObject: object, name: Strings.status) - _id = ReadWriteAttribute(jsObject: object, name: Strings.id) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var status: String - - @ReadWriteAttribute - public var id: String -} diff --git a/Sources/DOMKit/WebIDL/TokenBindingStatus.swift b/Sources/DOMKit/WebIDL/TokenBindingStatus.swift deleted file mode 100644 index c0e83bd4..00000000 --- a/Sources/DOMKit/WebIDL/TokenBindingStatus.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum TokenBindingStatus: JSString, JSValueCompatible { - case present = "present" - case supported = "supported" - - @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/Touch.swift b/Sources/DOMKit/WebIDL/Touch.swift deleted file mode 100644 index 202ab1b6..00000000 --- a/Sources/DOMKit/WebIDL/Touch.swift +++ /dev/null @@ -1,78 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class Touch: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Touch].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _identifier = ReadonlyAttribute(jsObject: jsObject, name: Strings.identifier) - _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) - _screenX = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenX) - _screenY = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenY) - _clientX = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientX) - _clientY = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientY) - _pageX = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageX) - _pageY = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageY) - _radiusX = ReadonlyAttribute(jsObject: jsObject, name: Strings.radiusX) - _radiusY = ReadonlyAttribute(jsObject: jsObject, name: Strings.radiusY) - _rotationAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.rotationAngle) - _force = ReadonlyAttribute(jsObject: jsObject, name: Strings.force) - _altitudeAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.altitudeAngle) - _azimuthAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.azimuthAngle) - _touchType = ReadonlyAttribute(jsObject: jsObject, name: Strings.touchType) - self.jsObject = jsObject - } - - @inlinable public convenience init(touchInitDict: TouchInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [touchInitDict.jsValue])) - } - - @ReadonlyAttribute - public var identifier: Int32 - - @ReadonlyAttribute - public var target: EventTarget - - @ReadonlyAttribute - public var screenX: Double - - @ReadonlyAttribute - public var screenY: Double - - @ReadonlyAttribute - public var clientX: Double - - @ReadonlyAttribute - public var clientY: Double - - @ReadonlyAttribute - public var pageX: Double - - @ReadonlyAttribute - public var pageY: Double - - @ReadonlyAttribute - public var radiusX: Float - - @ReadonlyAttribute - public var radiusY: Float - - @ReadonlyAttribute - public var rotationAngle: Float - - @ReadonlyAttribute - public var force: Float - - @ReadonlyAttribute - public var altitudeAngle: Float - - @ReadonlyAttribute - public var azimuthAngle: Float - - @ReadonlyAttribute - public var touchType: TouchType -} diff --git a/Sources/DOMKit/WebIDL/TouchEvent.swift b/Sources/DOMKit/WebIDL/TouchEvent.swift deleted file mode 100644 index 34b0dd20..00000000 --- a/Sources/DOMKit/WebIDL/TouchEvent.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TouchEvent: UIEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TouchEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _touches = ReadonlyAttribute(jsObject: jsObject, name: Strings.touches) - _targetTouches = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetTouches) - _changedTouches = ReadonlyAttribute(jsObject: jsObject, name: Strings.changedTouches) - _altKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.altKey) - _metaKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.metaKey) - _ctrlKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.ctrlKey) - _shiftKey = ReadonlyAttribute(jsObject: jsObject, name: Strings.shiftKey) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: TouchEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var touches: TouchList - - @ReadonlyAttribute - public var targetTouches: TouchList - - @ReadonlyAttribute - public var changedTouches: TouchList - - @ReadonlyAttribute - public var altKey: Bool - - @ReadonlyAttribute - public var metaKey: Bool - - @ReadonlyAttribute - public var ctrlKey: Bool - - @ReadonlyAttribute - public var shiftKey: Bool -} diff --git a/Sources/DOMKit/WebIDL/TouchEventInit.swift b/Sources/DOMKit/WebIDL/TouchEventInit.swift deleted file mode 100644 index c4eb8d0b..00000000 --- a/Sources/DOMKit/WebIDL/TouchEventInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TouchEventInit: BridgedDictionary { - public convenience init(touches: [Touch], targetTouches: [Touch], changedTouches: [Touch]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.touches] = touches.jsValue - object[Strings.targetTouches] = targetTouches.jsValue - object[Strings.changedTouches] = changedTouches.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _touches = ReadWriteAttribute(jsObject: object, name: Strings.touches) - _targetTouches = ReadWriteAttribute(jsObject: object, name: Strings.targetTouches) - _changedTouches = ReadWriteAttribute(jsObject: object, name: Strings.changedTouches) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var touches: [Touch] - - @ReadWriteAttribute - public var targetTouches: [Touch] - - @ReadWriteAttribute - public var changedTouches: [Touch] -} diff --git a/Sources/DOMKit/WebIDL/TouchInit.swift b/Sources/DOMKit/WebIDL/TouchInit.swift deleted file mode 100644 index 7c27d875..00000000 --- a/Sources/DOMKit/WebIDL/TouchInit.swift +++ /dev/null @@ -1,90 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TouchInit: BridgedDictionary { - public convenience init(identifier: Int32, target: EventTarget, clientX: Double, clientY: Double, screenX: Double, screenY: Double, pageX: Double, pageY: Double, radiusX: Float, radiusY: Float, rotationAngle: Float, force: Float, altitudeAngle: Double, azimuthAngle: Double, touchType: TouchType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.identifier] = identifier.jsValue - object[Strings.target] = target.jsValue - object[Strings.clientX] = clientX.jsValue - object[Strings.clientY] = clientY.jsValue - object[Strings.screenX] = screenX.jsValue - object[Strings.screenY] = screenY.jsValue - object[Strings.pageX] = pageX.jsValue - object[Strings.pageY] = pageY.jsValue - object[Strings.radiusX] = radiusX.jsValue - object[Strings.radiusY] = radiusY.jsValue - object[Strings.rotationAngle] = rotationAngle.jsValue - object[Strings.force] = force.jsValue - object[Strings.altitudeAngle] = altitudeAngle.jsValue - object[Strings.azimuthAngle] = azimuthAngle.jsValue - object[Strings.touchType] = touchType.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _identifier = ReadWriteAttribute(jsObject: object, name: Strings.identifier) - _target = ReadWriteAttribute(jsObject: object, name: Strings.target) - _clientX = ReadWriteAttribute(jsObject: object, name: Strings.clientX) - _clientY = ReadWriteAttribute(jsObject: object, name: Strings.clientY) - _screenX = ReadWriteAttribute(jsObject: object, name: Strings.screenX) - _screenY = ReadWriteAttribute(jsObject: object, name: Strings.screenY) - _pageX = ReadWriteAttribute(jsObject: object, name: Strings.pageX) - _pageY = ReadWriteAttribute(jsObject: object, name: Strings.pageY) - _radiusX = ReadWriteAttribute(jsObject: object, name: Strings.radiusX) - _radiusY = ReadWriteAttribute(jsObject: object, name: Strings.radiusY) - _rotationAngle = ReadWriteAttribute(jsObject: object, name: Strings.rotationAngle) - _force = ReadWriteAttribute(jsObject: object, name: Strings.force) - _altitudeAngle = ReadWriteAttribute(jsObject: object, name: Strings.altitudeAngle) - _azimuthAngle = ReadWriteAttribute(jsObject: object, name: Strings.azimuthAngle) - _touchType = ReadWriteAttribute(jsObject: object, name: Strings.touchType) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var identifier: Int32 - - @ReadWriteAttribute - public var target: EventTarget - - @ReadWriteAttribute - public var clientX: Double - - @ReadWriteAttribute - public var clientY: Double - - @ReadWriteAttribute - public var screenX: Double - - @ReadWriteAttribute - public var screenY: Double - - @ReadWriteAttribute - public var pageX: Double - - @ReadWriteAttribute - public var pageY: Double - - @ReadWriteAttribute - public var radiusX: Float - - @ReadWriteAttribute - public var radiusY: Float - - @ReadWriteAttribute - public var rotationAngle: Float - - @ReadWriteAttribute - public var force: Float - - @ReadWriteAttribute - public var altitudeAngle: Double - - @ReadWriteAttribute - public var azimuthAngle: Double - - @ReadWriteAttribute - public var touchType: TouchType -} diff --git a/Sources/DOMKit/WebIDL/TouchList.swift b/Sources/DOMKit/WebIDL/TouchList.swift deleted file mode 100644 index 86c70909..00000000 --- a/Sources/DOMKit/WebIDL/TouchList.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TouchList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TouchList].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 subscript(key: Int) -> Touch? { - jsObject[key].fromJSValue() - } -} diff --git a/Sources/DOMKit/WebIDL/TouchType.swift b/Sources/DOMKit/WebIDL/TouchType.swift deleted file mode 100644 index 54db8c02..00000000 --- a/Sources/DOMKit/WebIDL/TouchType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum TouchType: JSString, JSValueCompatible { - case direct = "direct" - case stylus = "stylus" - - @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/TransactionAutomationMode.swift b/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift deleted file mode 100644 index 0ecf24c3..00000000 --- a/Sources/DOMKit/WebIDL/TransactionAutomationMode.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum TransactionAutomationMode: JSString, JSValueCompatible { - case none = "none" - case autoaccept = "autoaccept" - case autoreject = "autoreject" - - @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/TransferFunction.swift b/Sources/DOMKit/WebIDL/TransferFunction.swift deleted file mode 100644 index b651bc4a..00000000 --- a/Sources/DOMKit/WebIDL/TransferFunction.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum TransferFunction: JSString, JSValueCompatible { - case srgb = "srgb" - case pq = "pq" - case hlg = "hlg" - - @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/TransitionEvent.swift b/Sources/DOMKit/WebIDL/TransitionEvent.swift deleted file mode 100644 index 167077f8..00000000 --- a/Sources/DOMKit/WebIDL/TransitionEvent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TransitionEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TransitionEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _propertyName = ReadonlyAttribute(jsObject: jsObject, name: Strings.propertyName) - _elapsedTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.elapsedTime) - _pseudoElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.pseudoElement) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, transitionEventInitDict: TransitionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, transitionEventInitDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var propertyName: String - - @ReadonlyAttribute - public var elapsedTime: Double - - @ReadonlyAttribute - public var pseudoElement: String -} diff --git a/Sources/DOMKit/WebIDL/TransitionEventInit.swift b/Sources/DOMKit/WebIDL/TransitionEventInit.swift deleted file mode 100644 index 48a8c1be..00000000 --- a/Sources/DOMKit/WebIDL/TransitionEventInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TransitionEventInit: BridgedDictionary { - public convenience init(propertyName: String, elapsedTime: Double, pseudoElement: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.propertyName] = propertyName.jsValue - object[Strings.elapsedTime] = elapsedTime.jsValue - object[Strings.pseudoElement] = pseudoElement.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _propertyName = ReadWriteAttribute(jsObject: object, name: Strings.propertyName) - _elapsedTime = ReadWriteAttribute(jsObject: object, name: Strings.elapsedTime) - _pseudoElement = ReadWriteAttribute(jsObject: object, name: Strings.pseudoElement) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var propertyName: String - - @ReadWriteAttribute - public var elapsedTime: Double - - @ReadWriteAttribute - public var pseudoElement: String -} diff --git a/Sources/DOMKit/WebIDL/TrustedHTML.swift b/Sources/DOMKit/WebIDL/TrustedHTML.swift deleted file mode 100644 index 93921148..00000000 --- a/Sources/DOMKit/WebIDL/TrustedHTML.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TrustedHTML: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedHTML].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } - - @inlinable public func toJSON() -> String { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public static func fromLiteral(templateStringsArray: JSObject) -> Self { - let this = constructor - return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/TrustedScript.swift b/Sources/DOMKit/WebIDL/TrustedScript.swift deleted file mode 100644 index 606aaa12..00000000 --- a/Sources/DOMKit/WebIDL/TrustedScript.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TrustedScript: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedScript].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } - - @inlinable public func toJSON() -> String { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public static func fromLiteral(templateStringsArray: JSObject) -> Self { - let this = constructor - return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/TrustedScriptURL.swift b/Sources/DOMKit/WebIDL/TrustedScriptURL.swift deleted file mode 100644 index 084ede19..00000000 --- a/Sources/DOMKit/WebIDL/TrustedScriptURL.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TrustedScriptURL: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedScriptURL].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! - } - - @inlinable public func toJSON() -> String { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public static func fromLiteral(templateStringsArray: JSObject) -> Self { - let this = constructor - return this[Strings.fromLiteral].function!(this: this, arguments: [templateStringsArray.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/TrustedType.swift b/Sources/DOMKit/WebIDL/TrustedType.swift deleted file mode 100644 index 059c32ac..00000000 --- a/Sources/DOMKit/WebIDL/TrustedType.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_TrustedType: ConvertibleToJSValue {} -extension TrustedHTML: Any_TrustedType {} -extension TrustedScript: Any_TrustedType {} -extension TrustedScriptURL: Any_TrustedType {} - -public enum TrustedType: JSValueCompatible, Any_TrustedType { - case trustedHTML(TrustedHTML) - case trustedScript(TrustedScript) - case trustedScriptURL(TrustedScriptURL) - - public static func construct(from value: JSValue) -> Self? { - if let trustedHTML: TrustedHTML = value.fromJSValue() { - return .trustedHTML(trustedHTML) - } - if let trustedScript: TrustedScript = value.fromJSValue() { - return .trustedScript(trustedScript) - } - if let trustedScriptURL: TrustedScriptURL = value.fromJSValue() { - return .trustedScriptURL(trustedScriptURL) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .trustedHTML(trustedHTML): - return trustedHTML.jsValue - case let .trustedScript(trustedScript): - return trustedScript.jsValue - case let .trustedScriptURL(trustedScriptURL): - return trustedScriptURL.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift deleted file mode 100644 index 8fb5e993..00000000 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicy.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TrustedTypePolicy: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedTypePolicy].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var name: String - - @inlinable public func createHTML(input: String, arguments: JSValue...) -> TrustedHTML { - let this = jsObject - return this[Strings.createHTML].function!(this: this, arguments: [input.jsValue] + arguments.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func createScript(input: String, arguments: JSValue...) -> TrustedScript { - let this = jsObject - return this[Strings.createScript].function!(this: this, arguments: [input.jsValue] + arguments.map(\.jsValue)).fromJSValue()! - } - - @inlinable public func createScriptURL(input: String, arguments: JSValue...) -> TrustedScriptURL { - let this = jsObject - return this[Strings.createScriptURL].function!(this: this, arguments: [input.jsValue] + arguments.map(\.jsValue)).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift b/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift deleted file mode 100644 index 2bb4f844..00000000 --- a/Sources/DOMKit/WebIDL/TrustedTypePolicyFactory.swift +++ /dev/null @@ -1,53 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class TrustedTypePolicyFactory: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TrustedTypePolicyFactory].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _emptyHTML = ReadonlyAttribute(jsObject: jsObject, name: Strings.emptyHTML) - _emptyScript = ReadonlyAttribute(jsObject: jsObject, name: Strings.emptyScript) - _defaultPolicy = ReadonlyAttribute(jsObject: jsObject, name: Strings.defaultPolicy) - self.jsObject = jsObject - } - - // XXX: member 'createPolicy' is ignored - - @inlinable public func isHTML(value: JSValue) -> Bool { - let this = jsObject - return this[Strings.isHTML].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public func isScript(value: JSValue) -> Bool { - let this = jsObject - return this[Strings.isScript].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @inlinable public func isScriptURL(value: JSValue) -> Bool { - let this = jsObject - return this[Strings.isScriptURL].function!(this: this, arguments: [value.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var emptyHTML: TrustedHTML - - @ReadonlyAttribute - public var emptyScript: TrustedScript - - @inlinable public func getAttributeType(tagName: String, attribute: String, elementNs: String? = nil, attrNs: String? = nil) -> String? { - let this = jsObject - return this[Strings.getAttributeType].function!(this: this, arguments: [tagName.jsValue, attribute.jsValue, elementNs?.jsValue ?? .undefined, attrNs?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func getPropertyType(tagName: String, property: String, elementNs: String? = nil) -> String? { - let this = jsObject - return this[Strings.getPropertyType].function!(this: this, arguments: [tagName.jsValue, property.jsValue, elementNs?.jsValue ?? .undefined]).fromJSValue()! - } - - @ReadonlyAttribute - public var defaultPolicy: TrustedTypePolicy? -} diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index 13f5c863..b22c422a 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -3,125 +3,26 @@ import JavaScriptEventLoop import JavaScriptKit -public typealias GLuint64EXT = UInt64 - -public typealias HashAlgorithmIdentifier = AlgorithmIdentifier -public typealias BigInteger = Uint8Array -public typealias NamedCurve = String -public typealias ClipboardItemData = JSPromise -public typealias ClipboardItems = [ClipboardItem] -public typealias CookieList = [CookieListItem] - -public typealias CSSColorPercent = CSSColorRGBComp -public typealias CSSColorNumber = CSSColorRGBComp -public typealias CSSColorAngle = CSSColorRGBComp - -public typealias DOMHighResTimeStamp = Double -public typealias EpochTimeStamp = UInt64 - public typealias CanvasFilterInput = [String: JSValue] public typealias EventHandler = EventHandlerNonNull? public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? -public typealias ProfilerResource = String - -public typealias Megabit = Double -public typealias Millisecond = UInt64 -public typealias PerformanceEntryList = [PerformanceEntry] - -public typealias ReportList = [Report] -public typealias AttributeMatchList = [String: [String]] -public typealias ContainerBasedOffset = CSSPerspectiveValue - -public typealias HTMLString = String -public typealias ScriptString = String -public typealias ScriptURLString = String - -public typealias UUID = String - -public typealias BluetoothCharacteristicUUID = BluetoothServiceUUID -public typealias BluetoothDescriptorUUID = BluetoothServiceUUID - -public typealias COSEAlgorithmIdentifier = Int32 -public typealias UvmEntry = [UInt32] -public typealias UvmEntries = [UvmEntry] - -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 GLint64 = Int64 -public typealias GLuint64 = UInt64 - -public typealias GPUBufferUsageFlags = UInt32 -public typealias GPUMapModeFlags = UInt32 -public typealias GPUTextureUsageFlags = UInt32 -public typealias GPUShaderStageFlags = UInt32 - -public typealias GPUPipelineConstantValue = Double -public typealias GPUColorWriteFlags = UInt32 -public typealias GPUComputePassTimestampWrites = [GPUComputePassTimestampWrite] -public typealias GPURenderPassTimestampWrites = [GPURenderPassTimestampWrite] - -public typealias GPUBufferDynamicOffset = UInt32 -public typealias GPUStencilValue = UInt32 -public typealias GPUSampleMask = UInt32 -public typealias GPUDepthBias = Int32 -public typealias GPUSize64 = UInt64 -public typealias GPUIntegerCoordinate = UInt32 -public typealias GPUIndex32 = UInt32 -public typealias GPUSize32 = UInt32 -public typealias GPUSignedOffset32 = Int32 -public typealias GPUFlagsConstant = UInt32 +public typealias DOMHighResTimeStamp = Double +public typealias EpochTimeStamp = UInt64 -public typealias BufferSource = BinaryData public typealias DOMTimeStamp = UInt64 -public typealias MLNamedOperands = [String: MLOperand] - -public typealias MLNamedInputs = [String: MLInput_or_MLResource] -public typealias MLNamedOutputs = [String: MLResource] - -public typealias SmallCryptoKeyID = UInt64 -public typealias ComputePressureUpdateCallback = ([ComputePressureRecord], ComputePressureObserver) -> Void -public typealias AnimatorInstanceConstructor = (JSValue, JSValue) -> JSValue public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void -public typealias ErrorCallback = (DOMException) -> Void -public typealias FileSystemEntryCallback = (FileSystemEntry) -> Void -public typealias FileSystemEntriesCallback = ([FileSystemEntry]) -> Void -public typealias FileCallback = (File) -> Void -public typealias PositionCallback = (GeolocationPosition) -> Void -public typealias PositionErrorCallback = (GeolocationPositionError) -> 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 IntersectionObserverCallback = ([IntersectionObserverEntry], IntersectionObserver) -> Void public typealias NavigatorUserMediaSuccessCallback = (MediaStream) -> Void public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void -public typealias MediaSessionActionHandler = (MediaSessionActionDetails) -> Void -public typealias NotificationPermissionCallback = (NotificationPermission) -> Void -public typealias PerformanceObserverCallback = (PerformanceObserverEntryList, PerformanceObserver, PerformanceObserverCallbackOptions) -> Void -public typealias RemotePlaybackAvailabilityCallback = (Bool) -> Void -public typealias ReportingObserverCallback = ([Report], ReportingObserver) -> Void -public typealias IdleRequestCallback = (IdleDeadline) -> Void -public typealias ResizeObserverCallback = ([ResizeObserverEntry], ResizeObserver) -> Void -public typealias SchedulerPostTaskCallback = () -> JSValue public typealias UnderlyingSourceStartCallback = (ReadableStreamController) -> JSValue public typealias UnderlyingSourcePullCallback = (ReadableStreamController) -> JSPromise public typealias UnderlyingSourceCancelCallback = (JSValue) -> JSPromise @@ -133,23 +34,9 @@ public typealias TransformerStartCallback = (TransformStreamDefaultController) - public typealias TransformerFlushCallback = (TransformStreamDefaultController) -> JSPromise public typealias TransformerTransformCallback = (JSValue, TransformStreamDefaultController) -> JSPromise public typealias QueuingStrategySize = (JSValue) -> Double -public typealias CreateHTMLCallback = (String, JSValue...) -> String -public typealias CreateScriptCallback = (String, JSValue...) -> String -public typealias CreateScriptURLCallback = (String, JSValue...) -> String -public typealias VideoFrameRequestCallback = (DOMHighResTimeStamp, VideoFrameMetadata) -> Void -public typealias EffectCallback = (Double?, CSSPseudoElement_or_Element, Animation) -> Void -public typealias LockGrantedCallback = (Lock?) -> JSPromise -public typealias DecodeErrorCallback = (DOMException) -> Void -public typealias DecodeSuccessCallback = (AudioBuffer) -> Void -public typealias AudioWorkletProcessCallback = ([[Float32Array]], [[Float32Array]], JSObject) -> Bool 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 typealias VoidFunction = () -> Void -public typealias GenerateAssertionCallback = (String, String, RTCIdentityProviderOptions) -> JSPromise -public typealias ValidateAssertionCallback = (String, String) -> JSPromise -public typealias RTCPeerConnectionErrorCallback = (DOMException) -> Void -public typealias RTCSessionDescriptionCallback = (RTCSessionDescriptionInit) -> Void -public typealias XRFrameRequestCallback = (DOMHighResTimeStamp, XRFrame) -> Void diff --git a/Sources/DOMKit/WebIDL/UADataValues.swift b/Sources/DOMKit/WebIDL/UADataValues.swift deleted file mode 100644 index f72ac9fa..00000000 --- a/Sources/DOMKit/WebIDL/UADataValues.swift +++ /dev/null @@ -1,65 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class UADataValues: BridgedDictionary { - public convenience init(brands: [NavigatorUABrandVersion], mobile: Bool, architecture: String, bitness: String, model: String, platform: String, platformVersion: String, uaFullVersion: String, wow64: Bool, fullVersionList: [NavigatorUABrandVersion]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.brands] = brands.jsValue - object[Strings.mobile] = mobile.jsValue - object[Strings.architecture] = architecture.jsValue - object[Strings.bitness] = bitness.jsValue - object[Strings.model] = model.jsValue - object[Strings.platform] = platform.jsValue - object[Strings.platformVersion] = platformVersion.jsValue - object[Strings.uaFullVersion] = uaFullVersion.jsValue - object[Strings.wow64] = wow64.jsValue - object[Strings.fullVersionList] = fullVersionList.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _brands = ReadWriteAttribute(jsObject: object, name: Strings.brands) - _mobile = ReadWriteAttribute(jsObject: object, name: Strings.mobile) - _architecture = ReadWriteAttribute(jsObject: object, name: Strings.architecture) - _bitness = ReadWriteAttribute(jsObject: object, name: Strings.bitness) - _model = ReadWriteAttribute(jsObject: object, name: Strings.model) - _platform = ReadWriteAttribute(jsObject: object, name: Strings.platform) - _platformVersion = ReadWriteAttribute(jsObject: object, name: Strings.platformVersion) - _uaFullVersion = ReadWriteAttribute(jsObject: object, name: Strings.uaFullVersion) - _wow64 = ReadWriteAttribute(jsObject: object, name: Strings.wow64) - _fullVersionList = ReadWriteAttribute(jsObject: object, name: Strings.fullVersionList) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var brands: [NavigatorUABrandVersion] - - @ReadWriteAttribute - public var mobile: Bool - - @ReadWriteAttribute - public var architecture: String - - @ReadWriteAttribute - public var bitness: String - - @ReadWriteAttribute - public var model: String - - @ReadWriteAttribute - public var platform: String - - @ReadWriteAttribute - public var platformVersion: String - - @ReadWriteAttribute - public var uaFullVersion: String - - @ReadWriteAttribute - public var wow64: Bool - - @ReadWriteAttribute - public var fullVersionList: [NavigatorUABrandVersion] -} diff --git a/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift b/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift deleted file mode 100644 index 027232bc..00000000 --- a/Sources/DOMKit/WebIDL/UALowEntropyJSON.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class UALowEntropyJSON: BridgedDictionary { - public convenience init(brands: [NavigatorUABrandVersion], mobile: Bool, platform: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.brands] = brands.jsValue - object[Strings.mobile] = mobile.jsValue - object[Strings.platform] = platform.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _brands = ReadWriteAttribute(jsObject: object, name: Strings.brands) - _mobile = ReadWriteAttribute(jsObject: object, name: Strings.mobile) - _platform = ReadWriteAttribute(jsObject: object, name: Strings.platform) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var brands: [NavigatorUABrandVersion] - - @ReadWriteAttribute - public var mobile: Bool - - @ReadWriteAttribute - public var platform: String -} diff --git a/Sources/DOMKit/WebIDL/UIEvent.swift b/Sources/DOMKit/WebIDL/UIEvent.swift index eb9fe8d3..7cc090b2 100644 --- a/Sources/DOMKit/WebIDL/UIEvent.swift +++ b/Sources/DOMKit/WebIDL/UIEvent.swift @@ -7,16 +7,12 @@ public class UIEvent: Event { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.UIEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _sourceCapabilities = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceCapabilities) _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) } - @ReadonlyAttribute - public var sourceCapabilities: InputDeviceCapabilities? - @inlinable public convenience init(type: String, eventInitDict: UIEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } diff --git a/Sources/DOMKit/WebIDL/UIEventInit.swift b/Sources/DOMKit/WebIDL/UIEventInit.swift index f832a8ae..f9b8d8fb 100644 --- a/Sources/DOMKit/WebIDL/UIEventInit.swift +++ b/Sources/DOMKit/WebIDL/UIEventInit.swift @@ -4,9 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class UIEventInit: BridgedDictionary { - public convenience init(sourceCapabilities: InputDeviceCapabilities?, view: Window?, detail: Int32, which: UInt32) { + public convenience init(view: Window?, detail: Int32, which: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.sourceCapabilities] = sourceCapabilities.jsValue object[Strings.view] = view.jsValue object[Strings.detail] = detail.jsValue object[Strings.which] = which.jsValue @@ -14,16 +13,12 @@ public class UIEventInit: BridgedDictionary { } public required init(unsafelyWrapping object: JSObject) { - _sourceCapabilities = ReadWriteAttribute(jsObject: object, name: Strings.sourceCapabilities) _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 sourceCapabilities: InputDeviceCapabilities? - @ReadWriteAttribute public var view: Window? diff --git a/Sources/DOMKit/WebIDL/URLPattern.swift b/Sources/DOMKit/WebIDL/URLPattern.swift deleted file mode 100644 index 9c9a6651..00000000 --- a/Sources/DOMKit/WebIDL/URLPattern.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class URLPattern: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.URLPattern].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) - _username = ReadonlyAttribute(jsObject: jsObject, name: Strings.username) - _password = ReadonlyAttribute(jsObject: jsObject, name: Strings.password) - _hostname = ReadonlyAttribute(jsObject: jsObject, name: Strings.hostname) - _port = ReadonlyAttribute(jsObject: jsObject, name: Strings.port) - _pathname = ReadonlyAttribute(jsObject: jsObject, name: Strings.pathname) - _search = ReadonlyAttribute(jsObject: jsObject, name: Strings.search) - _hash = ReadonlyAttribute(jsObject: jsObject, name: Strings.hash) - self.jsObject = jsObject - } - - @inlinable public convenience init(input: URLPatternInput? = nil, baseURL: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [input?.jsValue ?? .undefined, baseURL?.jsValue ?? .undefined])) - } - - @inlinable public func test(input: URLPatternInput? = nil, baseURL: String? = nil) -> Bool { - let this = jsObject - return this[Strings.test].function!(this: this, arguments: [input?.jsValue ?? .undefined, baseURL?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func exec(input: URLPatternInput? = nil, baseURL: String? = nil) -> URLPatternResult? { - let this = jsObject - return this[Strings.exec].function!(this: this, arguments: [input?.jsValue ?? .undefined, baseURL?.jsValue ?? .undefined]).fromJSValue()! - } - - @ReadonlyAttribute - public var `protocol`: String - - @ReadonlyAttribute - public var username: String - - @ReadonlyAttribute - public var password: String - - @ReadonlyAttribute - public var hostname: String - - @ReadonlyAttribute - public var port: String - - @ReadonlyAttribute - public var pathname: String - - @ReadonlyAttribute - public var search: String - - @ReadonlyAttribute - public var hash: String -} diff --git a/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift b/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift deleted file mode 100644 index 8e6bebe4..00000000 --- a/Sources/DOMKit/WebIDL/URLPatternComponentResult.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class URLPatternComponentResult: BridgedDictionary { - public convenience init(input: String, groups: [String: String?]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.input] = input.jsValue - object[Strings.groups] = groups.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _input = ReadWriteAttribute(jsObject: object, name: Strings.input) - _groups = ReadWriteAttribute(jsObject: object, name: Strings.groups) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var input: String - - @ReadWriteAttribute - public var groups: [String: String?] -} diff --git a/Sources/DOMKit/WebIDL/URLPatternInit.swift b/Sources/DOMKit/WebIDL/URLPatternInit.swift deleted file mode 100644 index f71b535b..00000000 --- a/Sources/DOMKit/WebIDL/URLPatternInit.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class URLPatternInit: BridgedDictionary { - public convenience init(protocol: String, username: String, password: String, hostname: String, port: String, pathname: String, search: String, hash: String, baseURL: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.protocol] = `protocol`.jsValue - object[Strings.username] = username.jsValue - object[Strings.password] = password.jsValue - object[Strings.hostname] = hostname.jsValue - object[Strings.port] = port.jsValue - object[Strings.pathname] = pathname.jsValue - object[Strings.search] = search.jsValue - object[Strings.hash] = hash.jsValue - object[Strings.baseURL] = baseURL.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) - _username = ReadWriteAttribute(jsObject: object, name: Strings.username) - _password = ReadWriteAttribute(jsObject: object, name: Strings.password) - _hostname = ReadWriteAttribute(jsObject: object, name: Strings.hostname) - _port = ReadWriteAttribute(jsObject: object, name: Strings.port) - _pathname = ReadWriteAttribute(jsObject: object, name: Strings.pathname) - _search = ReadWriteAttribute(jsObject: object, name: Strings.search) - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - _baseURL = ReadWriteAttribute(jsObject: object, name: Strings.baseURL) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var `protocol`: String - - @ReadWriteAttribute - public var username: String - - @ReadWriteAttribute - public var password: String - - @ReadWriteAttribute - public var hostname: String - - @ReadWriteAttribute - public var port: String - - @ReadWriteAttribute - public var pathname: String - - @ReadWriteAttribute - public var search: String - - @ReadWriteAttribute - public var hash: String - - @ReadWriteAttribute - public var baseURL: String -} diff --git a/Sources/DOMKit/WebIDL/URLPatternInput.swift b/Sources/DOMKit/WebIDL/URLPatternInput.swift deleted file mode 100644 index d24fd28f..00000000 --- a/Sources/DOMKit/WebIDL/URLPatternInput.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_URLPatternInput: ConvertibleToJSValue {} -extension String: Any_URLPatternInput {} -extension URLPatternInit: Any_URLPatternInput {} - -public enum URLPatternInput: JSValueCompatible, Any_URLPatternInput { - case string(String) - case uRLPatternInit(URLPatternInit) - - public static func construct(from value: JSValue) -> Self? { - if let string: String = value.fromJSValue() { - return .string(string) - } - if let uRLPatternInit: URLPatternInit = value.fromJSValue() { - return .uRLPatternInit(uRLPatternInit) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .string(string): - return string.jsValue - case let .uRLPatternInit(uRLPatternInit): - return uRLPatternInit.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/URLPatternResult.swift b/Sources/DOMKit/WebIDL/URLPatternResult.swift deleted file mode 100644 index c66ecf59..00000000 --- a/Sources/DOMKit/WebIDL/URLPatternResult.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class URLPatternResult: BridgedDictionary { - public convenience init(inputs: [URLPatternInput], protocol: URLPatternComponentResult, username: URLPatternComponentResult, password: URLPatternComponentResult, hostname: URLPatternComponentResult, port: URLPatternComponentResult, pathname: URLPatternComponentResult, search: URLPatternComponentResult, hash: URLPatternComponentResult) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.inputs] = inputs.jsValue - object[Strings.protocol] = `protocol`.jsValue - object[Strings.username] = username.jsValue - object[Strings.password] = password.jsValue - object[Strings.hostname] = hostname.jsValue - object[Strings.port] = port.jsValue - object[Strings.pathname] = pathname.jsValue - object[Strings.search] = search.jsValue - object[Strings.hash] = hash.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _inputs = ReadWriteAttribute(jsObject: object, name: Strings.inputs) - _protocol = ReadWriteAttribute(jsObject: object, name: Strings.protocol) - _username = ReadWriteAttribute(jsObject: object, name: Strings.username) - _password = ReadWriteAttribute(jsObject: object, name: Strings.password) - _hostname = ReadWriteAttribute(jsObject: object, name: Strings.hostname) - _port = ReadWriteAttribute(jsObject: object, name: Strings.port) - _pathname = ReadWriteAttribute(jsObject: object, name: Strings.pathname) - _search = ReadWriteAttribute(jsObject: object, name: Strings.search) - _hash = ReadWriteAttribute(jsObject: object, name: Strings.hash) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var inputs: [URLPatternInput] - - @ReadWriteAttribute - public var `protocol`: URLPatternComponentResult - - @ReadWriteAttribute - public var username: URLPatternComponentResult - - @ReadWriteAttribute - public var password: URLPatternComponentResult - - @ReadWriteAttribute - public var hostname: URLPatternComponentResult - - @ReadWriteAttribute - public var port: URLPatternComponentResult - - @ReadWriteAttribute - public var pathname: URLPatternComponentResult - - @ReadWriteAttribute - public var search: URLPatternComponentResult - - @ReadWriteAttribute - public var hash: URLPatternComponentResult -} diff --git a/Sources/DOMKit/WebIDL/USB.swift b/Sources/DOMKit/WebIDL/USB.swift deleted file mode 100644 index f97bbc9b..00000000 --- a/Sources/DOMKit/WebIDL/USB.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USB: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.USB].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onconnect) - _ondisconnect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondisconnect) - super.init(unsafelyWrapping: jsObject) - } - - @ClosureAttribute1Optional - public var onconnect: EventHandler - - @ClosureAttribute1Optional - public var ondisconnect: EventHandler - - @inlinable public func getDevices() -> JSPromise { - let this = jsObject - return this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDevices() async throws -> [USBDevice] { - let this = jsObject - let _promise: JSPromise = this[Strings.getDevices].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func requestDevice(options: USBDeviceRequestOptions) -> JSPromise { - let this = jsObject - return this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestDevice(options: USBDeviceRequestOptions) async throws -> USBDevice { - let this = jsObject - let _promise: JSPromise = this[Strings.requestDevice].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/USBAlternateInterface.swift b/Sources/DOMKit/WebIDL/USBAlternateInterface.swift deleted file mode 100644 index cbc8f3ed..00000000 --- a/Sources/DOMKit/WebIDL/USBAlternateInterface.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBAlternateInterface: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBAlternateInterface].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _alternateSetting = ReadonlyAttribute(jsObject: jsObject, name: Strings.alternateSetting) - _interfaceClass = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceClass) - _interfaceSubclass = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceSubclass) - _interfaceProtocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceProtocol) - _interfaceName = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceName) - _endpoints = ReadonlyAttribute(jsObject: jsObject, name: Strings.endpoints) - self.jsObject = jsObject - } - - @inlinable public convenience init(deviceInterface: USBInterface, alternateSetting: UInt8) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [deviceInterface.jsValue, alternateSetting.jsValue])) - } - - @ReadonlyAttribute - public var alternateSetting: UInt8 - - @ReadonlyAttribute - public var interfaceClass: UInt8 - - @ReadonlyAttribute - public var interfaceSubclass: UInt8 - - @ReadonlyAttribute - public var interfaceProtocol: UInt8 - - @ReadonlyAttribute - public var interfaceName: String? - - @ReadonlyAttribute - public var endpoints: [USBEndpoint] -} diff --git a/Sources/DOMKit/WebIDL/USBConfiguration.swift b/Sources/DOMKit/WebIDL/USBConfiguration.swift deleted file mode 100644 index ebd3dbee..00000000 --- a/Sources/DOMKit/WebIDL/USBConfiguration.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBConfiguration: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBConfiguration].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _configurationValue = ReadonlyAttribute(jsObject: jsObject, name: Strings.configurationValue) - _configurationName = ReadonlyAttribute(jsObject: jsObject, name: Strings.configurationName) - _interfaces = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaces) - self.jsObject = jsObject - } - - @inlinable public convenience init(device: USBDevice, configurationValue: UInt8) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [device.jsValue, configurationValue.jsValue])) - } - - @ReadonlyAttribute - public var configurationValue: UInt8 - - @ReadonlyAttribute - public var configurationName: String? - - @ReadonlyAttribute - public var interfaces: [USBInterface] -} diff --git a/Sources/DOMKit/WebIDL/USBConnectionEvent.swift b/Sources/DOMKit/WebIDL/USBConnectionEvent.swift deleted file mode 100644 index 0edb961c..00000000 --- a/Sources/DOMKit/WebIDL/USBConnectionEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBConnectionEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.USBConnectionEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _device = ReadonlyAttribute(jsObject: jsObject, name: Strings.device) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: USBConnectionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var device: USBDevice -} diff --git a/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift b/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift deleted file mode 100644 index 48706613..00000000 --- a/Sources/DOMKit/WebIDL/USBConnectionEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBConnectionEventInit: BridgedDictionary { - public convenience init(device: USBDevice) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.device] = device.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _device = ReadWriteAttribute(jsObject: object, name: Strings.device) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var device: USBDevice -} diff --git a/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift b/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift deleted file mode 100644 index facee2e3..00000000 --- a/Sources/DOMKit/WebIDL/USBControlTransferParameters.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBControlTransferParameters: BridgedDictionary { - public convenience init(requestType: USBRequestType, recipient: USBRecipient, request: UInt8, value: UInt16, index: UInt16) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.requestType] = requestType.jsValue - object[Strings.recipient] = recipient.jsValue - object[Strings.request] = request.jsValue - object[Strings.value] = value.jsValue - object[Strings.index] = index.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _requestType = ReadWriteAttribute(jsObject: object, name: Strings.requestType) - _recipient = ReadWriteAttribute(jsObject: object, name: Strings.recipient) - _request = ReadWriteAttribute(jsObject: object, name: Strings.request) - _value = ReadWriteAttribute(jsObject: object, name: Strings.value) - _index = ReadWriteAttribute(jsObject: object, name: Strings.index) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var requestType: USBRequestType - - @ReadWriteAttribute - public var recipient: USBRecipient - - @ReadWriteAttribute - public var request: UInt8 - - @ReadWriteAttribute - public var value: UInt16 - - @ReadWriteAttribute - public var index: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/USBDevice.swift b/Sources/DOMKit/WebIDL/USBDevice.swift deleted file mode 100644 index c40dcd88..00000000 --- a/Sources/DOMKit/WebIDL/USBDevice.swift +++ /dev/null @@ -1,262 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBDevice: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBDevice].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _usbVersionMajor = ReadonlyAttribute(jsObject: jsObject, name: Strings.usbVersionMajor) - _usbVersionMinor = ReadonlyAttribute(jsObject: jsObject, name: Strings.usbVersionMinor) - _usbVersionSubminor = ReadonlyAttribute(jsObject: jsObject, name: Strings.usbVersionSubminor) - _deviceClass = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceClass) - _deviceSubclass = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceSubclass) - _deviceProtocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceProtocol) - _vendorId = ReadonlyAttribute(jsObject: jsObject, name: Strings.vendorId) - _productId = ReadonlyAttribute(jsObject: jsObject, name: Strings.productId) - _deviceVersionMajor = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceVersionMajor) - _deviceVersionMinor = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceVersionMinor) - _deviceVersionSubminor = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceVersionSubminor) - _manufacturerName = ReadonlyAttribute(jsObject: jsObject, name: Strings.manufacturerName) - _productName = ReadonlyAttribute(jsObject: jsObject, name: Strings.productName) - _serialNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.serialNumber) - _configuration = ReadonlyAttribute(jsObject: jsObject, name: Strings.configuration) - _configurations = ReadonlyAttribute(jsObject: jsObject, name: Strings.configurations) - _opened = ReadonlyAttribute(jsObject: jsObject, name: Strings.opened) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var usbVersionMajor: UInt8 - - @ReadonlyAttribute - public var usbVersionMinor: UInt8 - - @ReadonlyAttribute - public var usbVersionSubminor: UInt8 - - @ReadonlyAttribute - public var deviceClass: UInt8 - - @ReadonlyAttribute - public var deviceSubclass: UInt8 - - @ReadonlyAttribute - public var deviceProtocol: UInt8 - - @ReadonlyAttribute - public var vendorId: UInt16 - - @ReadonlyAttribute - public var productId: UInt16 - - @ReadonlyAttribute - public var deviceVersionMajor: UInt8 - - @ReadonlyAttribute - public var deviceVersionMinor: UInt8 - - @ReadonlyAttribute - public var deviceVersionSubminor: UInt8 - - @ReadonlyAttribute - public var manufacturerName: String? - - @ReadonlyAttribute - public var productName: String? - - @ReadonlyAttribute - public var serialNumber: String? - - @ReadonlyAttribute - public var configuration: USBConfiguration? - - @ReadonlyAttribute - public var configurations: [USBConfiguration] - - @ReadonlyAttribute - public var opened: Bool - - @inlinable public func open() -> JSPromise { - let this = jsObject - return this[Strings.open].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func open() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: []).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 forget() -> JSPromise { - let this = jsObject - return this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func forget() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.forget].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func selectConfiguration(configurationValue: UInt8) -> JSPromise { - let this = jsObject - return this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func selectConfiguration(configurationValue: UInt8) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.selectConfiguration].function!(this: this, arguments: [configurationValue.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func claimInterface(interfaceNumber: UInt8) -> JSPromise { - let this = jsObject - return this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func claimInterface(interfaceNumber: UInt8) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.claimInterface].function!(this: this, arguments: [interfaceNumber.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func releaseInterface(interfaceNumber: UInt8) -> JSPromise { - let this = jsObject - return this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func releaseInterface(interfaceNumber: UInt8) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.releaseInterface].function!(this: this, arguments: [interfaceNumber.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) -> JSPromise { - let this = jsObject - return this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue, alternateSetting.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func selectAlternateInterface(interfaceNumber: UInt8, alternateSetting: UInt8) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.selectAlternateInterface].function!(this: this, arguments: [interfaceNumber.jsValue, alternateSetting.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) -> JSPromise { - let this = jsObject - return this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue, length.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func controlTransferIn(setup: USBControlTransferParameters, length: UInt16) async throws -> USBInTransferResult { - let this = jsObject - let _promise: JSPromise = this[Strings.controlTransferIn].function!(this: this, arguments: [setup.jsValue, length.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) -> JSPromise { - let this = jsObject - return this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue, data?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func controlTransferOut(setup: USBControlTransferParameters, data: BufferSource? = nil) async throws -> USBOutTransferResult { - let this = jsObject - let _promise: JSPromise = this[Strings.controlTransferOut].function!(this: this, arguments: [setup.jsValue, data?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func clearHalt(direction: USBDirection, endpointNumber: UInt8) -> JSPromise { - let this = jsObject - return this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue, endpointNumber.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func clearHalt(direction: USBDirection, endpointNumber: UInt8) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.clearHalt].function!(this: this, arguments: [direction.jsValue, endpointNumber.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func transferIn(endpointNumber: UInt8, length: UInt32) -> JSPromise { - let this = jsObject - return this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue, length.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func transferIn(endpointNumber: UInt8, length: UInt32) async throws -> USBInTransferResult { - let this = jsObject - let _promise: JSPromise = this[Strings.transferIn].function!(this: this, arguments: [endpointNumber.jsValue, length.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func transferOut(endpointNumber: UInt8, data: BufferSource) -> JSPromise { - let this = jsObject - return this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue, data.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func transferOut(endpointNumber: UInt8, data: BufferSource) async throws -> USBOutTransferResult { - let this = jsObject - let _promise: JSPromise = this[Strings.transferOut].function!(this: this, arguments: [endpointNumber.jsValue, data.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) -> JSPromise { - let this = jsObject - return this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue, packetLengths.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func isochronousTransferIn(endpointNumber: UInt8, packetLengths: [UInt32]) async throws -> USBIsochronousInTransferResult { - let this = jsObject - let _promise: JSPromise = this[Strings.isochronousTransferIn].function!(this: this, arguments: [endpointNumber.jsValue, packetLengths.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) -> JSPromise { - let this = jsObject - return this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue, data.jsValue, packetLengths.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func isochronousTransferOut(endpointNumber: UInt8, data: BufferSource, packetLengths: [UInt32]) async throws -> USBIsochronousOutTransferResult { - let this = jsObject - let _promise: JSPromise = this[Strings.isochronousTransferOut].function!(this: this, arguments: [endpointNumber.jsValue, data.jsValue, packetLengths.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func reset() -> JSPromise { - let this = jsObject - return this[Strings.reset].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func reset() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.reset].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } -} diff --git a/Sources/DOMKit/WebIDL/USBDeviceFilter.swift b/Sources/DOMKit/WebIDL/USBDeviceFilter.swift deleted file mode 100644 index ed7612d7..00000000 --- a/Sources/DOMKit/WebIDL/USBDeviceFilter.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBDeviceFilter: BridgedDictionary { - public convenience init(vendorId: UInt16, productId: UInt16, classCode: UInt8, subclassCode: UInt8, protocolCode: UInt8, serialNumber: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.vendorId] = vendorId.jsValue - object[Strings.productId] = productId.jsValue - object[Strings.classCode] = classCode.jsValue - object[Strings.subclassCode] = subclassCode.jsValue - object[Strings.protocolCode] = protocolCode.jsValue - object[Strings.serialNumber] = serialNumber.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _vendorId = ReadWriteAttribute(jsObject: object, name: Strings.vendorId) - _productId = ReadWriteAttribute(jsObject: object, name: Strings.productId) - _classCode = ReadWriteAttribute(jsObject: object, name: Strings.classCode) - _subclassCode = ReadWriteAttribute(jsObject: object, name: Strings.subclassCode) - _protocolCode = ReadWriteAttribute(jsObject: object, name: Strings.protocolCode) - _serialNumber = ReadWriteAttribute(jsObject: object, name: Strings.serialNumber) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var vendorId: UInt16 - - @ReadWriteAttribute - public var productId: UInt16 - - @ReadWriteAttribute - public var classCode: UInt8 - - @ReadWriteAttribute - public var subclassCode: UInt8 - - @ReadWriteAttribute - public var protocolCode: UInt8 - - @ReadWriteAttribute - public var serialNumber: String -} diff --git a/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift b/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift deleted file mode 100644 index 3eb302b1..00000000 --- a/Sources/DOMKit/WebIDL/USBDeviceRequestOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBDeviceRequestOptions: BridgedDictionary { - public convenience init(filters: [USBDeviceFilter]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var filters: [USBDeviceFilter] -} diff --git a/Sources/DOMKit/WebIDL/USBDirection.swift b/Sources/DOMKit/WebIDL/USBDirection.swift deleted file mode 100644 index 94554433..00000000 --- a/Sources/DOMKit/WebIDL/USBDirection.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum USBDirection: JSString, JSValueCompatible { - case `in` = "in" - case out = "out" - - @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/USBEndpoint.swift b/Sources/DOMKit/WebIDL/USBEndpoint.swift deleted file mode 100644 index afafd821..00000000 --- a/Sources/DOMKit/WebIDL/USBEndpoint.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBEndpoint: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBEndpoint].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _endpointNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.endpointNumber) - _direction = ReadonlyAttribute(jsObject: jsObject, name: Strings.direction) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _packetSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.packetSize) - self.jsObject = jsObject - } - - @inlinable public convenience init(alternate: USBAlternateInterface, endpointNumber: UInt8, direction: USBDirection) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [alternate.jsValue, endpointNumber.jsValue, direction.jsValue])) - } - - @ReadonlyAttribute - public var endpointNumber: UInt8 - - @ReadonlyAttribute - public var direction: USBDirection - - @ReadonlyAttribute - public var type: USBEndpointType - - @ReadonlyAttribute - public var packetSize: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/USBEndpointType.swift b/Sources/DOMKit/WebIDL/USBEndpointType.swift deleted file mode 100644 index 788df343..00000000 --- a/Sources/DOMKit/WebIDL/USBEndpointType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum USBEndpointType: JSString, JSValueCompatible { - case bulk = "bulk" - case interrupt = "interrupt" - case isochronous = "isochronous" - - @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/USBInTransferResult.swift b/Sources/DOMKit/WebIDL/USBInTransferResult.swift deleted file mode 100644 index 31b13e10..00000000 --- a/Sources/DOMKit/WebIDL/USBInTransferResult.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBInTransferResult: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBInTransferResult].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) - self.jsObject = jsObject - } - - @inlinable public convenience init(status: USBTransferStatus, data: DataView? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue, data?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var data: DataView? - - @ReadonlyAttribute - public var status: USBTransferStatus -} diff --git a/Sources/DOMKit/WebIDL/USBInterface.swift b/Sources/DOMKit/WebIDL/USBInterface.swift deleted file mode 100644 index 4a1f3d93..00000000 --- a/Sources/DOMKit/WebIDL/USBInterface.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBInterface: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBInterface].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _interfaceNumber = ReadonlyAttribute(jsObject: jsObject, name: Strings.interfaceNumber) - _alternate = ReadonlyAttribute(jsObject: jsObject, name: Strings.alternate) - _alternates = ReadonlyAttribute(jsObject: jsObject, name: Strings.alternates) - _claimed = ReadonlyAttribute(jsObject: jsObject, name: Strings.claimed) - self.jsObject = jsObject - } - - @inlinable public convenience init(configuration: USBConfiguration, interfaceNumber: UInt8) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [configuration.jsValue, interfaceNumber.jsValue])) - } - - @ReadonlyAttribute - public var interfaceNumber: UInt8 - - @ReadonlyAttribute - public var alternate: USBAlternateInterface - - @ReadonlyAttribute - public var alternates: [USBAlternateInterface] - - @ReadonlyAttribute - public var claimed: Bool -} diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift deleted file mode 100644 index e7f6ff47..00000000 --- a/Sources/DOMKit/WebIDL/USBIsochronousInTransferPacket.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBIsochronousInTransferPacket: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousInTransferPacket].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) - self.jsObject = jsObject - } - - @inlinable public convenience init(status: USBTransferStatus, data: DataView? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue, data?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var data: DataView? - - @ReadonlyAttribute - public var status: USBTransferStatus -} diff --git a/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift deleted file mode 100644 index 14be528d..00000000 --- a/Sources/DOMKit/WebIDL/USBIsochronousInTransferResult.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBIsochronousInTransferResult: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousInTransferResult].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - _packets = ReadonlyAttribute(jsObject: jsObject, name: Strings.packets) - self.jsObject = jsObject - } - - @inlinable public convenience init(packets: [USBIsochronousInTransferPacket], data: DataView? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue, data?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var data: DataView? - - @ReadonlyAttribute - public var packets: [USBIsochronousInTransferPacket] -} diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift deleted file mode 100644 index 21f3c1e8..00000000 --- a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferPacket.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBIsochronousOutTransferPacket: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousOutTransferPacket].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _bytesWritten = ReadonlyAttribute(jsObject: jsObject, name: Strings.bytesWritten) - _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) - self.jsObject = jsObject - } - - @inlinable public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue, bytesWritten?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var bytesWritten: UInt32 - - @ReadonlyAttribute - public var status: USBTransferStatus -} diff --git a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift deleted file mode 100644 index c08b561b..00000000 --- a/Sources/DOMKit/WebIDL/USBIsochronousOutTransferResult.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBIsochronousOutTransferResult: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBIsochronousOutTransferResult].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _packets = ReadonlyAttribute(jsObject: jsObject, name: Strings.packets) - self.jsObject = jsObject - } - - @inlinable public convenience init(packets: [USBIsochronousOutTransferPacket]) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [packets.jsValue])) - } - - @ReadonlyAttribute - public var packets: [USBIsochronousOutTransferPacket] -} diff --git a/Sources/DOMKit/WebIDL/USBOutTransferResult.swift b/Sources/DOMKit/WebIDL/USBOutTransferResult.swift deleted file mode 100644 index 6f934e5e..00000000 --- a/Sources/DOMKit/WebIDL/USBOutTransferResult.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBOutTransferResult: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.USBOutTransferResult].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _bytesWritten = ReadonlyAttribute(jsObject: jsObject, name: Strings.bytesWritten) - _status = ReadonlyAttribute(jsObject: jsObject, name: Strings.status) - self.jsObject = jsObject - } - - @inlinable public convenience init(status: USBTransferStatus, bytesWritten: UInt32? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [status.jsValue, bytesWritten?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var bytesWritten: UInt32 - - @ReadonlyAttribute - public var status: USBTransferStatus -} diff --git a/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift deleted file mode 100644 index 3db2823b..00000000 --- a/Sources/DOMKit/WebIDL/USBPermissionDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBPermissionDescriptor: BridgedDictionary { - public convenience init(filters: [USBDeviceFilter]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.filters] = filters.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _filters = ReadWriteAttribute(jsObject: object, name: Strings.filters) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var filters: [USBDeviceFilter] -} diff --git a/Sources/DOMKit/WebIDL/USBPermissionResult.swift b/Sources/DOMKit/WebIDL/USBPermissionResult.swift deleted file mode 100644 index 0bc6dd25..00000000 --- a/Sources/DOMKit/WebIDL/USBPermissionResult.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBPermissionResult: PermissionStatus { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.USBPermissionResult].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _devices = ReadWriteAttribute(jsObject: jsObject, name: Strings.devices) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var devices: [USBDevice] -} diff --git a/Sources/DOMKit/WebIDL/USBPermissionStorage.swift b/Sources/DOMKit/WebIDL/USBPermissionStorage.swift deleted file mode 100644 index 79d2bf4b..00000000 --- a/Sources/DOMKit/WebIDL/USBPermissionStorage.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class USBPermissionStorage: BridgedDictionary { - public convenience init(allowedDevices: [AllowedUSBDevice]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowedDevices] = allowedDevices.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _allowedDevices = ReadWriteAttribute(jsObject: object, name: Strings.allowedDevices) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var allowedDevices: [AllowedUSBDevice] -} diff --git a/Sources/DOMKit/WebIDL/USBRecipient.swift b/Sources/DOMKit/WebIDL/USBRecipient.swift deleted file mode 100644 index 9904f9a6..00000000 --- a/Sources/DOMKit/WebIDL/USBRecipient.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum USBRecipient: JSString, JSValueCompatible { - case device = "device" - case interface = "interface" - case endpoint = "endpoint" - case other = "other" - - @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/USBRequestType.swift b/Sources/DOMKit/WebIDL/USBRequestType.swift deleted file mode 100644 index 11a63ba9..00000000 --- a/Sources/DOMKit/WebIDL/USBRequestType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum USBRequestType: JSString, JSValueCompatible { - case standard = "standard" - case `class` = "class" - case vendor = "vendor" - - @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/USBTransferStatus.swift b/Sources/DOMKit/WebIDL/USBTransferStatus.swift deleted file mode 100644 index b606d552..00000000 --- a/Sources/DOMKit/WebIDL/USBTransferStatus.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum USBTransferStatus: JSString, JSValueCompatible { - case ok = "ok" - case stall = "stall" - case babble = "babble" - - @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/Uint32List.swift b/Sources/DOMKit/WebIDL/Uint32List.swift deleted file mode 100644 index 846c355b..00000000 --- a/Sources/DOMKit/WebIDL/Uint32List.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Uint32List: ConvertibleToJSValue {} -extension Uint32Array: Any_Uint32List {} -extension Array: Any_Uint32List where Element == GLuint {} - -public enum Uint32List: JSValueCompatible, Any_Uint32List { - case uint32Array(Uint32Array) - case seq_of_GLuint([GLuint]) - - public static func construct(from value: JSValue) -> Self? { - if let uint32Array: Uint32Array = value.fromJSValue() { - return .uint32Array(uint32Array) - } - if let seq_of_GLuint: [GLuint] = value.fromJSValue() { - return .seq_of_GLuint(seq_of_GLuint) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .uint32Array(uint32Array): - return uint32Array.jsValue - case let .seq_of_GLuint(seq_of_GLuint): - return seq_of_GLuint.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift b/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift deleted file mode 100644 index 7f972e97..00000000 --- a/Sources/DOMKit/WebIDL/UncalibratedMagnetometer.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class UncalibratedMagnetometer: Sensor { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.UncalibratedMagnetometer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _z = ReadonlyAttribute(jsObject: jsObject, name: Strings.z) - _xBias = ReadonlyAttribute(jsObject: jsObject, name: Strings.xBias) - _yBias = ReadonlyAttribute(jsObject: jsObject, name: Strings.yBias) - _zBias = ReadonlyAttribute(jsObject: jsObject, name: Strings.zBias) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(sensorOptions: MagnetometerSensorOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [sensorOptions?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var x: Double? - - @ReadonlyAttribute - public var y: Double? - - @ReadonlyAttribute - public var z: Double? - - @ReadonlyAttribute - public var xBias: Double? - - @ReadonlyAttribute - public var yBias: Double? - - @ReadonlyAttribute - public var zBias: Double? -} diff --git a/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift b/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift deleted file mode 100644 index ee4e1cb3..00000000 --- a/Sources/DOMKit/WebIDL/UncalibratedMagnetometerReadingValues.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class UncalibratedMagnetometerReadingValues: BridgedDictionary { - public convenience init(x: Double?, y: Double?, z: Double?, xBias: Double?, yBias: Double?, zBias: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - object[Strings.z] = z.jsValue - object[Strings.xBias] = xBias.jsValue - object[Strings.yBias] = yBias.jsValue - object[Strings.zBias] = zBias.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - _z = ReadWriteAttribute(jsObject: object, name: Strings.z) - _xBias = ReadWriteAttribute(jsObject: object, name: Strings.xBias) - _yBias = ReadWriteAttribute(jsObject: object, name: Strings.yBias) - _zBias = ReadWriteAttribute(jsObject: object, name: Strings.zBias) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var x: Double? - - @ReadWriteAttribute - public var y: Double? - - @ReadWriteAttribute - public var z: Double? - - @ReadWriteAttribute - public var xBias: Double? - - @ReadWriteAttribute - public var yBias: Double? - - @ReadWriteAttribute - public var zBias: Double? -} diff --git a/Sources/DOMKit/WebIDL/UserIdleState.swift b/Sources/DOMKit/WebIDL/UserIdleState.swift deleted file mode 100644 index 39a67c87..00000000 --- a/Sources/DOMKit/WebIDL/UserIdleState.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum UserIdleState: JSString, JSValueCompatible { - case active = "active" - case idle = "idle" - - @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/UserVerificationRequirement.swift b/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift deleted file mode 100644 index f2228d3c..00000000 --- a/Sources/DOMKit/WebIDL/UserVerificationRequirement.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum UserVerificationRequirement: JSString, JSValueCompatible { - case required = "required" - case preferred = "preferred" - case discouraged = "discouraged" - - @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/VTTCue.swift b/Sources/DOMKit/WebIDL/VTTCue.swift deleted file mode 100644 index 08fac506..00000000 --- a/Sources/DOMKit/WebIDL/VTTCue.swift +++ /dev/null @@ -1,61 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VTTCue: TextTrackCue { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VTTCue].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _region = ReadWriteAttribute(jsObject: jsObject, name: Strings.region) - _vertical = ReadWriteAttribute(jsObject: jsObject, name: Strings.vertical) - _snapToLines = ReadWriteAttribute(jsObject: jsObject, name: Strings.snapToLines) - _line = ReadWriteAttribute(jsObject: jsObject, name: Strings.line) - _lineAlign = ReadWriteAttribute(jsObject: jsObject, name: Strings.lineAlign) - _position = ReadWriteAttribute(jsObject: jsObject, name: Strings.position) - _positionAlign = ReadWriteAttribute(jsObject: jsObject, name: Strings.positionAlign) - _size = ReadWriteAttribute(jsObject: jsObject, name: Strings.size) - _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) - _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(startTime: Double, endTime: Double, text: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [startTime.jsValue, endTime.jsValue, text.jsValue])) - } - - @ReadWriteAttribute - public var region: VTTRegion? - - @ReadWriteAttribute - public var vertical: DirectionSetting - - @ReadWriteAttribute - public var snapToLines: Bool - - @ReadWriteAttribute - public var line: LineAndPositionSetting - - @ReadWriteAttribute - public var lineAlign: LineAlignSetting - - @ReadWriteAttribute - public var position: LineAndPositionSetting - - @ReadWriteAttribute - public var positionAlign: PositionAlignSetting - - @ReadWriteAttribute - public var size: Double - - @ReadWriteAttribute - public var align: AlignSetting - - @ReadWriteAttribute - public var text: String - - @inlinable public func getCueAsHTML() -> DocumentFragment { - let this = jsObject - return this[Strings.getCueAsHTML].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/VTTRegion.swift b/Sources/DOMKit/WebIDL/VTTRegion.swift deleted file mode 100644 index 424d8519..00000000 --- a/Sources/DOMKit/WebIDL/VTTRegion.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VTTRegion: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VTTRegion].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadWriteAttribute(jsObject: jsObject, name: Strings.id) - _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) - _lines = ReadWriteAttribute(jsObject: jsObject, name: Strings.lines) - _regionAnchorX = ReadWriteAttribute(jsObject: jsObject, name: Strings.regionAnchorX) - _regionAnchorY = ReadWriteAttribute(jsObject: jsObject, name: Strings.regionAnchorY) - _viewportAnchorX = ReadWriteAttribute(jsObject: jsObject, name: Strings.viewportAnchorX) - _viewportAnchorY = ReadWriteAttribute(jsObject: jsObject, name: Strings.viewportAnchorY) - _scroll = ReadWriteAttribute(jsObject: jsObject, name: Strings.scroll) - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @ReadWriteAttribute - public var id: String - - @ReadWriteAttribute - public var width: Double - - @ReadWriteAttribute - public var lines: UInt32 - - @ReadWriteAttribute - public var regionAnchorX: Double - - @ReadWriteAttribute - public var regionAnchorY: Double - - @ReadWriteAttribute - public var viewportAnchorX: Double - - @ReadWriteAttribute - public var viewportAnchorY: Double - - @ReadWriteAttribute - public var scroll: ScrollSetting -} diff --git a/Sources/DOMKit/WebIDL/ValueEvent.swift b/Sources/DOMKit/WebIDL/ValueEvent.swift deleted file mode 100644 index 1145d599..00000000 --- a/Sources/DOMKit/WebIDL/ValueEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ValueEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ValueEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadonlyAttribute(jsObject: jsObject, name: Strings.value) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, initDict: ValueEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, initDict?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var value: JSValue -} diff --git a/Sources/DOMKit/WebIDL/ValueEventInit.swift b/Sources/DOMKit/WebIDL/ValueEventInit.swift deleted file mode 100644 index 46b076b8..00000000 --- a/Sources/DOMKit/WebIDL/ValueEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ValueEventInit: BridgedDictionary { - public convenience init(value: JSValue) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.value] = value.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _value = ReadWriteAttribute(jsObject: object, name: Strings.value) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var value: JSValue -} diff --git a/Sources/DOMKit/WebIDL/ValueType.swift b/Sources/DOMKit/WebIDL/ValueType.swift deleted file mode 100644 index acc88c0e..00000000 --- a/Sources/DOMKit/WebIDL/ValueType.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ValueType: JSString, JSValueCompatible { - case i32 = "i32" - case i64 = "i64" - case f32 = "f32" - case f64 = "f64" - case v128 = "v128" - case externref = "externref" - case anyfunc = "anyfunc" - - @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/VibratePattern.swift b/Sources/DOMKit/WebIDL/VibratePattern.swift deleted file mode 100644 index 9325923d..00000000 --- a/Sources/DOMKit/WebIDL/VibratePattern.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_VibratePattern: ConvertibleToJSValue {} -extension UInt32: Any_VibratePattern {} -extension Array: Any_VibratePattern where Element == UInt32 {} - -public enum VibratePattern: JSValueCompatible, Any_VibratePattern { - case uInt32(UInt32) - case seq_of_UInt32([UInt32]) - - public static func construct(from value: JSValue) -> Self? { - if let uInt32: UInt32 = value.fromJSValue() { - return .uInt32(uInt32) - } - if let seq_of_UInt32: [UInt32] = value.fromJSValue() { - return .seq_of_UInt32(seq_of_UInt32) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .uInt32(uInt32): - return uInt32.jsValue - case let .seq_of_UInt32(seq_of_UInt32): - return seq_of_UInt32.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/VideoConfiguration.swift b/Sources/DOMKit/WebIDL/VideoConfiguration.swift deleted file mode 100644 index fbb45126..00000000 --- a/Sources/DOMKit/WebIDL/VideoConfiguration.swift +++ /dev/null @@ -1,65 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoConfiguration: BridgedDictionary { - public convenience init(contentType: String, width: UInt32, height: UInt32, bitrate: UInt64, framerate: Double, hasAlphaChannel: Bool, hdrMetadataType: HdrMetadataType, colorGamut: ColorGamut, transferFunction: TransferFunction, scalabilityMode: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.contentType] = contentType.jsValue - object[Strings.width] = width.jsValue - object[Strings.height] = height.jsValue - object[Strings.bitrate] = bitrate.jsValue - object[Strings.framerate] = framerate.jsValue - object[Strings.hasAlphaChannel] = hasAlphaChannel.jsValue - object[Strings.hdrMetadataType] = hdrMetadataType.jsValue - object[Strings.colorGamut] = colorGamut.jsValue - object[Strings.transferFunction] = transferFunction.jsValue - object[Strings.scalabilityMode] = scalabilityMode.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _contentType = ReadWriteAttribute(jsObject: object, name: Strings.contentType) - _width = ReadWriteAttribute(jsObject: object, name: Strings.width) - _height = ReadWriteAttribute(jsObject: object, name: Strings.height) - _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) - _framerate = ReadWriteAttribute(jsObject: object, name: Strings.framerate) - _hasAlphaChannel = ReadWriteAttribute(jsObject: object, name: Strings.hasAlphaChannel) - _hdrMetadataType = ReadWriteAttribute(jsObject: object, name: Strings.hdrMetadataType) - _colorGamut = ReadWriteAttribute(jsObject: object, name: Strings.colorGamut) - _transferFunction = ReadWriteAttribute(jsObject: object, name: Strings.transferFunction) - _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var contentType: String - - @ReadWriteAttribute - public var width: UInt32 - - @ReadWriteAttribute - public var height: UInt32 - - @ReadWriteAttribute - public var bitrate: UInt64 - - @ReadWriteAttribute - public var framerate: Double - - @ReadWriteAttribute - public var hasAlphaChannel: Bool - - @ReadWriteAttribute - public var hdrMetadataType: HdrMetadataType - - @ReadWriteAttribute - public var colorGamut: ColorGamut - - @ReadWriteAttribute - public var transferFunction: TransferFunction - - @ReadWriteAttribute - public var scalabilityMode: String -} diff --git a/Sources/DOMKit/WebIDL/VideoFrameMetadata.swift b/Sources/DOMKit/WebIDL/VideoFrameMetadata.swift deleted file mode 100644 index 36de932f..00000000 --- a/Sources/DOMKit/WebIDL/VideoFrameMetadata.swift +++ /dev/null @@ -1,65 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoFrameMetadata: BridgedDictionary { - public convenience init(presentationTime: DOMHighResTimeStamp, expectedDisplayTime: DOMHighResTimeStamp, width: UInt32, height: UInt32, mediaTime: Double, presentedFrames: UInt32, processingDuration: Double, captureTime: DOMHighResTimeStamp, receiveTime: DOMHighResTimeStamp, rtpTimestamp: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.presentationTime] = presentationTime.jsValue - object[Strings.expectedDisplayTime] = expectedDisplayTime.jsValue - object[Strings.width] = width.jsValue - object[Strings.height] = height.jsValue - object[Strings.mediaTime] = mediaTime.jsValue - object[Strings.presentedFrames] = presentedFrames.jsValue - object[Strings.processingDuration] = processingDuration.jsValue - object[Strings.captureTime] = captureTime.jsValue - object[Strings.receiveTime] = receiveTime.jsValue - object[Strings.rtpTimestamp] = rtpTimestamp.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _presentationTime = ReadWriteAttribute(jsObject: object, name: Strings.presentationTime) - _expectedDisplayTime = ReadWriteAttribute(jsObject: object, name: Strings.expectedDisplayTime) - _width = ReadWriteAttribute(jsObject: object, name: Strings.width) - _height = ReadWriteAttribute(jsObject: object, name: Strings.height) - _mediaTime = ReadWriteAttribute(jsObject: object, name: Strings.mediaTime) - _presentedFrames = ReadWriteAttribute(jsObject: object, name: Strings.presentedFrames) - _processingDuration = ReadWriteAttribute(jsObject: object, name: Strings.processingDuration) - _captureTime = ReadWriteAttribute(jsObject: object, name: Strings.captureTime) - _receiveTime = ReadWriteAttribute(jsObject: object, name: Strings.receiveTime) - _rtpTimestamp = ReadWriteAttribute(jsObject: object, name: Strings.rtpTimestamp) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var presentationTime: DOMHighResTimeStamp - - @ReadWriteAttribute - public var expectedDisplayTime: DOMHighResTimeStamp - - @ReadWriteAttribute - public var width: UInt32 - - @ReadWriteAttribute - public var height: UInt32 - - @ReadWriteAttribute - public var mediaTime: Double - - @ReadWriteAttribute - public var presentedFrames: UInt32 - - @ReadWriteAttribute - public var processingDuration: Double - - @ReadWriteAttribute - public var captureTime: DOMHighResTimeStamp - - @ReadWriteAttribute - public var receiveTime: DOMHighResTimeStamp - - @ReadWriteAttribute - public var rtpTimestamp: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift b/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift deleted file mode 100644 index 2df11cad..00000000 --- a/Sources/DOMKit/WebIDL/VideoPlaybackQuality.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoPlaybackQuality: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoPlaybackQuality].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _creationTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.creationTime) - _droppedVideoFrames = ReadonlyAttribute(jsObject: jsObject, name: Strings.droppedVideoFrames) - _totalVideoFrames = ReadonlyAttribute(jsObject: jsObject, name: Strings.totalVideoFrames) - _corruptedVideoFrames = ReadonlyAttribute(jsObject: jsObject, name: Strings.corruptedVideoFrames) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var creationTime: DOMHighResTimeStamp - - @ReadonlyAttribute - public var droppedVideoFrames: UInt32 - - @ReadonlyAttribute - public var totalVideoFrames: UInt32 - - @ReadonlyAttribute - public var corruptedVideoFrames: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/VirtualKeyboard.swift b/Sources/DOMKit/WebIDL/VirtualKeyboard.swift deleted file mode 100644 index 7be9438b..00000000 --- a/Sources/DOMKit/WebIDL/VirtualKeyboard.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VirtualKeyboard: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VirtualKeyboard].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _boundingRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundingRect) - _overlaysContent = ReadWriteAttribute(jsObject: jsObject, name: Strings.overlaysContent) - _ongeometrychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ongeometrychange) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func show() { - let this = jsObject - _ = this[Strings.show].function!(this: this, arguments: []) - } - - @inlinable public func hide() { - let this = jsObject - _ = this[Strings.hide].function!(this: this, arguments: []) - } - - @ReadonlyAttribute - public var boundingRect: DOMRect - - @ReadWriteAttribute - public var overlaysContent: Bool - - @ClosureAttribute1Optional - public var ongeometrychange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/VisualViewport.swift b/Sources/DOMKit/WebIDL/VisualViewport.swift deleted file mode 100644 index 8b47da06..00000000 --- a/Sources/DOMKit/WebIDL/VisualViewport.swift +++ /dev/null @@ -1,52 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VisualViewport: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VisualViewport].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _offsetLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetLeft) - _offsetTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.offsetTop) - _pageLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageLeft) - _pageTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageTop) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _scale = ReadonlyAttribute(jsObject: jsObject, name: Strings.scale) - _segments = ReadonlyAttribute(jsObject: jsObject, name: Strings.segments) - _onresize = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresize) - _onscroll = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onscroll) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var offsetLeft: Double - - @ReadonlyAttribute - public var offsetTop: Double - - @ReadonlyAttribute - public var pageLeft: Double - - @ReadonlyAttribute - public var pageTop: Double - - @ReadonlyAttribute - public var width: Double - - @ReadonlyAttribute - public var height: Double - - @ReadonlyAttribute - public var scale: Double - - @ReadonlyAttribute - public var segments: [DOMRect]? - - @ClosureAttribute1Optional - public var onresize: EventHandler - - @ClosureAttribute1Optional - public var onscroll: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift b/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift deleted file mode 100644 index 8e7e3b92..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_blend_equation_advanced_coherent.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_blend_equation_advanced_coherent: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_blend_equation_advanced_coherent].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let MULTIPLY: GLenum = 0x9294 - - public static let SCREEN: GLenum = 0x9295 - - public static let OVERLAY: GLenum = 0x9296 - - public static let DARKEN: GLenum = 0x9297 - - public static let LIGHTEN: GLenum = 0x9298 - - public static let COLORDODGE: GLenum = 0x9299 - - public static let COLORBURN: GLenum = 0x929A - - public static let HARDLIGHT: GLenum = 0x929B - - public static let SOFTLIGHT: GLenum = 0x929C - - public static let DIFFERENCE: GLenum = 0x929E - - public static let EXCLUSION: GLenum = 0x92A0 - - public static let HSL_HUE: GLenum = 0x92AD - - public static let HSL_SATURATION: GLenum = 0x92AE - - public static let HSL_COLOR: GLenum = 0x92AF - - public static let HSL_LUMINOSITY: GLenum = 0x92B0 -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift b/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift deleted file mode 100644 index 02dc1b87..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_color_buffer_float.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_color_buffer_float: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_color_buffer_float].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let RGBA32F_EXT: GLenum = 0x8814 - - public static let FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum = 0x8211 - - public static let UNSIGNED_NORMALIZED_EXT: GLenum = 0x8C17 -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift deleted file mode 100644 index 4f9aec25..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_astc.swift +++ /dev/null @@ -1,75 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_compressed_texture_astc: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_astc].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum = 0x93B0 - - public static let COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum = 0x93B1 - - public static let COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum = 0x93B2 - - public static let COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum = 0x93B3 - - public static let COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum = 0x93B4 - - public static let COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum = 0x93B5 - - public static let COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum = 0x93B6 - - public static let COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum = 0x93B7 - - public static let COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum = 0x93B8 - - public static let COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum = 0x93B9 - - public static let COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum = 0x93BA - - public static let COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum = 0x93BB - - public static let COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum = 0x93BC - - public static let COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum = 0x93BD - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum = 0x93D0 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum = 0x93D1 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum = 0x93D2 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum = 0x93D3 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum = 0x93D4 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum = 0x93D5 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum = 0x93D6 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum = 0x93D7 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum = 0x93D8 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum = 0x93D9 - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum = 0x93DA - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum = 0x93DB - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum = 0x93DC - - public static let COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum = 0x93DD - - @inlinable public func getSupportedProfiles() -> [String] { - let this = jsObject - return this[Strings.getSupportedProfiles].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift deleted file mode 100644 index 182e0d13..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_compressed_texture_etc: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_etc].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COMPRESSED_R11_EAC: GLenum = 0x9270 - - public static let COMPRESSED_SIGNED_R11_EAC: GLenum = 0x9271 - - public static let COMPRESSED_RG11_EAC: GLenum = 0x9272 - - public static let COMPRESSED_SIGNED_RG11_EAC: GLenum = 0x9273 - - public static let COMPRESSED_RGB8_ETC2: GLenum = 0x9274 - - public static let COMPRESSED_SRGB8_ETC2: GLenum = 0x9275 - - public static let COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum = 0x9276 - - public static let COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum = 0x9277 - - public static let COMPRESSED_RGBA8_ETC2_EAC: GLenum = 0x9278 - - public static let COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: GLenum = 0x9279 -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift deleted file mode 100644 index 0bef73eb..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_etc1.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_compressed_texture_etc1: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_etc1].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COMPRESSED_RGB_ETC1_WEBGL: GLenum = 0x8D64 -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift deleted file mode 100644 index 4411ac98..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_pvrtc.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_compressed_texture_pvrtc: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_pvrtc].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COMPRESSED_RGB_PVRTC_4BPPV1_IMG: GLenum = 0x8C00 - - public static let COMPRESSED_RGB_PVRTC_2BPPV1_IMG: GLenum = 0x8C01 - - public static let COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: GLenum = 0x8C02 - - public static let COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: GLenum = 0x8C03 -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift deleted file mode 100644 index 8c362d23..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_compressed_texture_s3tc: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_s3tc].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum = 0x83F0 - - public static let COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum = 0x83F1 - - public static let COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum = 0x83F2 - - public static let COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum = 0x83F3 -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift b/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift deleted file mode 100644 index 9957a01e..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_compressed_texture_s3tc_srgb.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_compressed_texture_s3tc_srgb: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_compressed_texture_s3tc_srgb].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum = 0x8C4C - - public static let COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum = 0x8C4D - - public static let COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum = 0x8C4E - - public static let COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum = 0x8C4F -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift b/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift deleted file mode 100644 index 3d8bd655..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_debug_renderer_info.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_debug_renderer_info: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_debug_renderer_info].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let UNMASKED_VENDOR_WEBGL: GLenum = 0x9245 - - public static let UNMASKED_RENDERER_WEBGL: GLenum = 0x9246 -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift b/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift deleted file mode 100644 index 4fdb8eac..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_debug_shaders.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_debug_shaders: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_debug_shaders].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func getTranslatedShaderSource(shader: WebGLShader) -> String { - let this = jsObject - return this[Strings.getTranslatedShaderSource].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift b/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift deleted file mode 100644 index c8a79297..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_depth_texture.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_depth_texture: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_depth_texture].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let UNSIGNED_INT_24_8_WEBGL: GLenum = 0x84FA -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift deleted file mode 100644 index 8248c399..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_draw_buffers.swift +++ /dev/null @@ -1,87 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_draw_buffers: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_draw_buffers].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let COLOR_ATTACHMENT0_WEBGL: GLenum = 0x8CE0 - - public static let COLOR_ATTACHMENT1_WEBGL: GLenum = 0x8CE1 - - public static let COLOR_ATTACHMENT2_WEBGL: GLenum = 0x8CE2 - - public static let COLOR_ATTACHMENT3_WEBGL: GLenum = 0x8CE3 - - public static let COLOR_ATTACHMENT4_WEBGL: GLenum = 0x8CE4 - - public static let COLOR_ATTACHMENT5_WEBGL: GLenum = 0x8CE5 - - public static let COLOR_ATTACHMENT6_WEBGL: GLenum = 0x8CE6 - - public static let COLOR_ATTACHMENT7_WEBGL: GLenum = 0x8CE7 - - public static let COLOR_ATTACHMENT8_WEBGL: GLenum = 0x8CE8 - - public static let COLOR_ATTACHMENT9_WEBGL: GLenum = 0x8CE9 - - public static let COLOR_ATTACHMENT10_WEBGL: GLenum = 0x8CEA - - public static let COLOR_ATTACHMENT11_WEBGL: GLenum = 0x8CEB - - public static let COLOR_ATTACHMENT12_WEBGL: GLenum = 0x8CEC - - public static let COLOR_ATTACHMENT13_WEBGL: GLenum = 0x8CED - - public static let COLOR_ATTACHMENT14_WEBGL: GLenum = 0x8CEE - - public static let COLOR_ATTACHMENT15_WEBGL: GLenum = 0x8CEF - - public static let DRAW_BUFFER0_WEBGL: GLenum = 0x8825 - - public static let DRAW_BUFFER1_WEBGL: GLenum = 0x8826 - - public static let DRAW_BUFFER2_WEBGL: GLenum = 0x8827 - - public static let DRAW_BUFFER3_WEBGL: GLenum = 0x8828 - - public static let DRAW_BUFFER4_WEBGL: GLenum = 0x8829 - - public static let DRAW_BUFFER5_WEBGL: GLenum = 0x882A - - public static let DRAW_BUFFER6_WEBGL: GLenum = 0x882B - - public static let DRAW_BUFFER7_WEBGL: GLenum = 0x882C - - public static let DRAW_BUFFER8_WEBGL: GLenum = 0x882D - - public static let DRAW_BUFFER9_WEBGL: GLenum = 0x882E - - public static let DRAW_BUFFER10_WEBGL: GLenum = 0x882F - - public static let DRAW_BUFFER11_WEBGL: GLenum = 0x8830 - - public static let DRAW_BUFFER12_WEBGL: GLenum = 0x8831 - - public static let DRAW_BUFFER13_WEBGL: GLenum = 0x8832 - - public static let DRAW_BUFFER14_WEBGL: GLenum = 0x8833 - - public static let DRAW_BUFFER15_WEBGL: GLenum = 0x8834 - - public static let MAX_COLOR_ATTACHMENTS_WEBGL: GLenum = 0x8CDF - - public static let MAX_DRAW_BUFFERS_WEBGL: GLenum = 0x8824 - - @inlinable public func drawBuffersWEBGL(buffers: [GLenum]) { - let this = jsObject - _ = this[Strings.drawBuffersWEBGL].function!(this: this, arguments: [buffers.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift deleted file mode 100644 index 41319a30..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_draw_instanced_base_vertex_base_instance.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_draw_instanced_base_vertex_base_instance: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_draw_instanced_base_vertex_base_instance].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func drawArraysInstancedBaseInstanceWEBGL(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei, baseInstance: GLuint) { - let this = jsObject - _ = this[Strings.drawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue, instanceCount.jsValue, baseInstance.jsValue]) - } - - @inlinable public func drawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei, baseVertex: GLint, baseInstance: GLuint) { - let _arg0 = mode.jsValue - let _arg1 = count.jsValue - let _arg2 = type.jsValue - let _arg3 = offset.jsValue - let _arg4 = instanceCount.jsValue - let _arg5 = baseVertex.jsValue - let _arg6 = baseInstance.jsValue - let this = jsObject - _ = this[Strings.drawElementsInstancedBaseVertexBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) - } -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift b/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift deleted file mode 100644 index ad9e54df..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_lose_context.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_lose_context: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_lose_context].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func loseContext() { - let this = jsObject - _ = this[Strings.loseContext].function!(this: this, arguments: []) - } - - @inlinable public func restoreContext() { - let this = jsObject - _ = this[Strings.restoreContext].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift deleted file mode 100644 index d02af26f..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw.swift +++ /dev/null @@ -1,64 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_multi_draw: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_multi_draw].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array_or_seq_of_GLint, firstsOffset: GLuint, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, drawcount: GLsizei) { - let _arg0 = mode.jsValue - let _arg1 = firstsList.jsValue - let _arg2 = firstsOffset.jsValue - let _arg3 = countsList.jsValue - let _arg4 = countsOffset.jsValue - let _arg5 = drawcount.jsValue - let this = jsObject - _ = this[Strings.multiDrawArraysWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } - - @inlinable public func multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array_or_seq_of_GLint, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array_or_seq_of_GLsizei, offsetsOffset: GLuint, drawcount: GLsizei) { - let _arg0 = mode.jsValue - let _arg1 = countsList.jsValue - let _arg2 = countsOffset.jsValue - let _arg3 = type.jsValue - let _arg4 = offsetsList.jsValue - let _arg5 = offsetsOffset.jsValue - let _arg6 = drawcount.jsValue - let this = jsObject - _ = this[Strings.multiDrawElementsWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) - } - - @inlinable public func multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array_or_seq_of_GLint, firstsOffset: GLuint, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, drawcount: GLsizei) { - let _arg0 = mode.jsValue - let _arg1 = firstsList.jsValue - let _arg2 = firstsOffset.jsValue - let _arg3 = countsList.jsValue - let _arg4 = countsOffset.jsValue - let _arg5 = instanceCountsList.jsValue - let _arg6 = instanceCountsOffset.jsValue - let _arg7 = drawcount.jsValue - let this = jsObject - _ = this[Strings.multiDrawArraysInstancedWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) - } - - @inlinable public func multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array_or_seq_of_GLint, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array_or_seq_of_GLsizei, offsetsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, drawcount: GLsizei) { - let _arg0 = mode.jsValue - let _arg1 = countsList.jsValue - let _arg2 = countsOffset.jsValue - let _arg3 = type.jsValue - let _arg4 = offsetsList.jsValue - let _arg5 = offsetsOffset.jsValue - let _arg6 = instanceCountsList.jsValue - let _arg7 = instanceCountsOffset.jsValue - let _arg8 = drawcount.jsValue - let this = jsObject - _ = this[Strings.multiDrawElementsInstancedWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) - } -} diff --git a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift b/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift deleted file mode 100644 index 5ed8ef55..00000000 --- a/Sources/DOMKit/WebIDL/WEBGL_multi_draw_instanced_base_vertex_base_instance.swift +++ /dev/null @@ -1,47 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WEBGL_multi_draw_instanced_base_vertex_base_instance: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WEBGL_multi_draw_instanced_base_vertex_base_instance].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func multiDrawArraysInstancedBaseInstanceWEBGL(mode: GLenum, firstsList: Int32Array_or_seq_of_GLint, firstsOffset: GLuint, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, baseInstancesList: Uint32Array_or_seq_of_GLuint, baseInstancesOffset: GLuint, drawCount: GLsizei) { - let _arg0 = mode.jsValue - let _arg1 = firstsList.jsValue - let _arg2 = firstsOffset.jsValue - let _arg3 = countsList.jsValue - let _arg4 = countsOffset.jsValue - let _arg5 = instanceCountsList.jsValue - let _arg6 = instanceCountsOffset.jsValue - let _arg7 = baseInstancesList.jsValue - let _arg8 = baseInstancesOffset.jsValue - let _arg9 = drawCount.jsValue - let this = jsObject - _ = this[Strings.multiDrawArraysInstancedBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) - } - - @inlinable public func multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(mode: GLenum, countsList: Int32Array_or_seq_of_GLsizei, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array_or_seq_of_GLsizei, offsetsOffset: GLuint, instanceCountsList: Int32Array_or_seq_of_GLsizei, instanceCountsOffset: GLuint, baseVerticesList: Int32Array_or_seq_of_GLint, baseVerticesOffset: GLuint, baseInstancesList: Uint32Array_or_seq_of_GLuint, baseInstancesOffset: GLuint, drawCount: GLsizei) { - let _arg0 = mode.jsValue - let _arg1 = countsList.jsValue - let _arg2 = countsOffset.jsValue - let _arg3 = type.jsValue - let _arg4 = offsetsList.jsValue - let _arg5 = offsetsOffset.jsValue - let _arg6 = instanceCountsList.jsValue - let _arg7 = instanceCountsOffset.jsValue - let _arg8 = baseVerticesList.jsValue - let _arg9 = baseVerticesOffset.jsValue - let _arg10 = baseInstancesList.jsValue - let _arg11 = baseInstancesOffset.jsValue - let _arg12 = drawCount.jsValue - let this = jsObject - _ = this[Strings.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12]) - } -} diff --git a/Sources/DOMKit/WebIDL/WakeLock.swift b/Sources/DOMKit/WebIDL/WakeLock.swift deleted file mode 100644 index 21767377..00000000 --- a/Sources/DOMKit/WebIDL/WakeLock.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WakeLock: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WakeLock].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func request(type: WakeLockType? = nil) -> JSPromise { - let this = jsObject - return this[Strings.request].function!(this: this, arguments: [type?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func request(type: WakeLockType? = nil) async throws -> WakeLockSentinel { - let this = jsObject - let _promise: JSPromise = this[Strings.request].function!(this: this, arguments: [type?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift b/Sources/DOMKit/WebIDL/WakeLockSentinel.swift deleted file mode 100644 index 6e008719..00000000 --- a/Sources/DOMKit/WebIDL/WakeLockSentinel.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WakeLockSentinel: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WakeLockSentinel].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _released = ReadonlyAttribute(jsObject: jsObject, name: Strings.released) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _onrelease = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onrelease) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var released: Bool - - @ReadonlyAttribute - public var type: WakeLockType - - @inlinable public func release() -> JSPromise { - let this = jsObject - return this[Strings.release].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func release() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.release].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @ClosureAttribute1Optional - public var onrelease: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/WakeLockType.swift b/Sources/DOMKit/WebIDL/WakeLockType.swift deleted file mode 100644 index baf95bad..00000000 --- a/Sources/DOMKit/WebIDL/WakeLockType.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum WakeLockType: JSString, JSValueCompatible { - case screen = "screen" - - @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/WatchAdvertisementsOptions.swift b/Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift deleted file mode 100644 index 8f6933c1..00000000 --- a/Sources/DOMKit/WebIDL/WatchAdvertisementsOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WatchAdvertisementsOptions: BridgedDictionary { - public convenience init(signal: AbortSignal) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.signal] = signal.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var signal: AbortSignal -} diff --git a/Sources/DOMKit/WebIDL/WaveShaperNode.swift b/Sources/DOMKit/WebIDL/WaveShaperNode.swift deleted file mode 100644 index f4737b9f..00000000 --- a/Sources/DOMKit/WebIDL/WaveShaperNode.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WaveShaperNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WaveShaperNode].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _curve = ReadWriteAttribute(jsObject: jsObject, name: Strings.curve) - _oversample = ReadWriteAttribute(jsObject: jsObject, name: Strings.oversample) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(context: BaseAudioContext, options: WaveShaperOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) - } - - @ReadWriteAttribute - public var curve: Float32Array? - - @ReadWriteAttribute - public var oversample: OverSampleType -} diff --git a/Sources/DOMKit/WebIDL/WaveShaperOptions.swift b/Sources/DOMKit/WebIDL/WaveShaperOptions.swift deleted file mode 100644 index abf27776..00000000 --- a/Sources/DOMKit/WebIDL/WaveShaperOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WaveShaperOptions: BridgedDictionary { - public convenience init(curve: [Float], oversample: OverSampleType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.curve] = curve.jsValue - object[Strings.oversample] = oversample.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _curve = ReadWriteAttribute(jsObject: object, name: Strings.curve) - _oversample = ReadWriteAttribute(jsObject: object, name: Strings.oversample) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var curve: [Float] - - @ReadWriteAttribute - public var oversample: OverSampleType -} diff --git a/Sources/DOMKit/WebIDL/WebAssembly.swift b/Sources/DOMKit/WebIDL/WebAssembly.swift deleted file mode 100644 index 9707adf5..00000000 --- a/Sources/DOMKit/WebIDL/WebAssembly.swift +++ /dev/null @@ -1,75 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum WebAssembly { - @inlinable public static var jsObject: JSObject { - JSObject.global[Strings.WebAssembly].object! - } - - @inlinable public static func validate(bytes: BufferSource) -> Bool { - let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.validate].function!(this: this, arguments: [bytes.jsValue]).fromJSValue()! - } - - @inlinable public static func compile(bytes: BufferSource) -> JSPromise { - let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.compile].function!(this: this, arguments: [bytes.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func compile(bytes: BufferSource) async throws -> Module { - let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.compile].function!(this: this, arguments: [bytes.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) -> JSPromise { - let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func instantiate(bytes: BufferSource, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { - let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [bytes.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) -> JSPromise { - let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func instantiate(moduleObject: Module, importObject: JSObject? = nil) async throws -> Instance { - let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.instantiate].function!(this: this, arguments: [moduleObject.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public static func compileStreaming(source: JSPromise) -> JSPromise { - let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func compileStreaming(source: JSPromise) async throws -> Module { - let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.compileStreaming].function!(this: this, arguments: [source.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) -> JSPromise { - let this = JSObject.global[Strings.WebAssembly].object! - return this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func instantiateStreaming(source: JSPromise, importObject: JSObject? = nil) async throws -> WebAssemblyInstantiatedSource { - let this = JSObject.global[Strings.WebAssembly].object! - let _promise: JSPromise = this[Strings.instantiateStreaming].function!(this: this, arguments: [source.jsValue, importObject?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift b/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift deleted file mode 100644 index 42562d11..00000000 --- a/Sources/DOMKit/WebIDL/WebAssemblyInstantiatedSource.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebAssemblyInstantiatedSource: BridgedDictionary { - public convenience init(module: Module, instance: Instance) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.module] = module.jsValue - object[Strings.instance] = instance.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _module = ReadWriteAttribute(jsObject: object, name: Strings.module) - _instance = ReadWriteAttribute(jsObject: object, name: Strings.instance) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var module: Module - - @ReadWriteAttribute - public var instance: Instance -} diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift deleted file mode 100644 index 3ee19c40..00000000 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContext.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGL2RenderingContext: JSBridgedClass, WebGLRenderingContextBase, WebGL2RenderingContextBase, WebGL2RenderingContextOverloads { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGL2RenderingContext].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift deleted file mode 100644 index 2071c82e..00000000 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContextBase.swift +++ /dev/null @@ -1,1162 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol WebGL2RenderingContextBase: JSBridgedClass {} -public extension WebGL2RenderingContextBase { - @inlinable static var READ_BUFFER: GLenum { 0x0C02 } - - @inlinable static var UNPACK_ROW_LENGTH: GLenum { 0x0CF2 } - - @inlinable static var UNPACK_SKIP_ROWS: GLenum { 0x0CF3 } - - @inlinable static var UNPACK_SKIP_PIXELS: GLenum { 0x0CF4 } - - @inlinable static var PACK_ROW_LENGTH: GLenum { 0x0D02 } - - @inlinable static var PACK_SKIP_ROWS: GLenum { 0x0D03 } - - @inlinable static var PACK_SKIP_PIXELS: GLenum { 0x0D04 } - - @inlinable static var COLOR: GLenum { 0x1800 } - - @inlinable static var DEPTH: GLenum { 0x1801 } - - @inlinable static var STENCIL: GLenum { 0x1802 } - - @inlinable static var RED: GLenum { 0x1903 } - - @inlinable static var RGB8: GLenum { 0x8051 } - - @inlinable static var RGBA8: GLenum { 0x8058 } - - @inlinable static var RGB10_A2: GLenum { 0x8059 } - - @inlinable static var TEXTURE_BINDING_3D: GLenum { 0x806A } - - @inlinable static var UNPACK_SKIP_IMAGES: GLenum { 0x806D } - - @inlinable static var UNPACK_IMAGE_HEIGHT: GLenum { 0x806E } - - @inlinable static var TEXTURE_3D: GLenum { 0x806F } - - @inlinable static var TEXTURE_WRAP_R: GLenum { 0x8072 } - - @inlinable static var MAX_3D_TEXTURE_SIZE: GLenum { 0x8073 } - - @inlinable static var UNSIGNED_INT_2_10_10_10_REV: GLenum { 0x8368 } - - @inlinable static var MAX_ELEMENTS_VERTICES: GLenum { 0x80E8 } - - @inlinable static var MAX_ELEMENTS_INDICES: GLenum { 0x80E9 } - - @inlinable static var TEXTURE_MIN_LOD: GLenum { 0x813A } - - @inlinable static var TEXTURE_MAX_LOD: GLenum { 0x813B } - - @inlinable static var TEXTURE_BASE_LEVEL: GLenum { 0x813C } - - @inlinable static var TEXTURE_MAX_LEVEL: GLenum { 0x813D } - - @inlinable static var MIN: GLenum { 0x8007 } - - @inlinable static var MAX: GLenum { 0x8008 } - - @inlinable static var DEPTH_COMPONENT24: GLenum { 0x81A6 } - - @inlinable static var MAX_TEXTURE_LOD_BIAS: GLenum { 0x84FD } - - @inlinable static var TEXTURE_COMPARE_MODE: GLenum { 0x884C } - - @inlinable static var TEXTURE_COMPARE_FUNC: GLenum { 0x884D } - - @inlinable static var CURRENT_QUERY: GLenum { 0x8865 } - - @inlinable static var QUERY_RESULT: GLenum { 0x8866 } - - @inlinable static var QUERY_RESULT_AVAILABLE: GLenum { 0x8867 } - - @inlinable static var STREAM_READ: GLenum { 0x88E1 } - - @inlinable static var STREAM_COPY: GLenum { 0x88E2 } - - @inlinable static var STATIC_READ: GLenum { 0x88E5 } - - @inlinable static var STATIC_COPY: GLenum { 0x88E6 } - - @inlinable static var DYNAMIC_READ: GLenum { 0x88E9 } - - @inlinable static var DYNAMIC_COPY: GLenum { 0x88EA } - - @inlinable static var MAX_DRAW_BUFFERS: GLenum { 0x8824 } - - @inlinable static var DRAW_BUFFER0: GLenum { 0x8825 } - - @inlinable static var DRAW_BUFFER1: GLenum { 0x8826 } - - @inlinable static var DRAW_BUFFER2: GLenum { 0x8827 } - - @inlinable static var DRAW_BUFFER3: GLenum { 0x8828 } - - @inlinable static var DRAW_BUFFER4: GLenum { 0x8829 } - - @inlinable static var DRAW_BUFFER5: GLenum { 0x882A } - - @inlinable static var DRAW_BUFFER6: GLenum { 0x882B } - - @inlinable static var DRAW_BUFFER7: GLenum { 0x882C } - - @inlinable static var DRAW_BUFFER8: GLenum { 0x882D } - - @inlinable static var DRAW_BUFFER9: GLenum { 0x882E } - - @inlinable static var DRAW_BUFFER10: GLenum { 0x882F } - - @inlinable static var DRAW_BUFFER11: GLenum { 0x8830 } - - @inlinable static var DRAW_BUFFER12: GLenum { 0x8831 } - - @inlinable static var DRAW_BUFFER13: GLenum { 0x8832 } - - @inlinable static var DRAW_BUFFER14: GLenum { 0x8833 } - - @inlinable static var DRAW_BUFFER15: GLenum { 0x8834 } - - @inlinable static var MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8B49 } - - @inlinable static var MAX_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8B4A } - - @inlinable static var SAMPLER_3D: GLenum { 0x8B5F } - - @inlinable static var SAMPLER_2D_SHADOW: GLenum { 0x8B62 } - - @inlinable static var FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum { 0x8B8B } - - @inlinable static var PIXEL_PACK_BUFFER: GLenum { 0x88EB } - - @inlinable static var PIXEL_UNPACK_BUFFER: GLenum { 0x88EC } - - @inlinable static var PIXEL_PACK_BUFFER_BINDING: GLenum { 0x88ED } - - @inlinable static var PIXEL_UNPACK_BUFFER_BINDING: GLenum { 0x88EF } - - @inlinable static var FLOAT_MAT2x3: GLenum { 0x8B65 } - - @inlinable static var FLOAT_MAT2x4: GLenum { 0x8B66 } - - @inlinable static var FLOAT_MAT3x2: GLenum { 0x8B67 } - - @inlinable static var FLOAT_MAT3x4: GLenum { 0x8B68 } - - @inlinable static var FLOAT_MAT4x2: GLenum { 0x8B69 } - - @inlinable static var FLOAT_MAT4x3: GLenum { 0x8B6A } - - @inlinable static var SRGB: GLenum { 0x8C40 } - - @inlinable static var SRGB8: GLenum { 0x8C41 } - - @inlinable static var SRGB8_ALPHA8: GLenum { 0x8C43 } - - @inlinable static var COMPARE_REF_TO_TEXTURE: GLenum { 0x884E } - - @inlinable static var RGBA32F: GLenum { 0x8814 } - - @inlinable static var RGB32F: GLenum { 0x8815 } - - @inlinable static var RGBA16F: GLenum { 0x881A } - - @inlinable static var RGB16F: GLenum { 0x881B } - - @inlinable static var VERTEX_ATTRIB_ARRAY_INTEGER: GLenum { 0x88FD } - - @inlinable static var MAX_ARRAY_TEXTURE_LAYERS: GLenum { 0x88FF } - - @inlinable static var MIN_PROGRAM_TEXEL_OFFSET: GLenum { 0x8904 } - - @inlinable static var MAX_PROGRAM_TEXEL_OFFSET: GLenum { 0x8905 } - - @inlinable static var MAX_VARYING_COMPONENTS: GLenum { 0x8B4B } - - @inlinable static var TEXTURE_2D_ARRAY: GLenum { 0x8C1A } - - @inlinable static var TEXTURE_BINDING_2D_ARRAY: GLenum { 0x8C1D } - - @inlinable static var R11F_G11F_B10F: GLenum { 0x8C3A } - - @inlinable static var UNSIGNED_INT_10F_11F_11F_REV: GLenum { 0x8C3B } - - @inlinable static var RGB9_E5: GLenum { 0x8C3D } - - @inlinable static var UNSIGNED_INT_5_9_9_9_REV: GLenum { 0x8C3E } - - @inlinable static var TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum { 0x8C7F } - - @inlinable static var MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum { 0x8C80 } - - @inlinable static var TRANSFORM_FEEDBACK_VARYINGS: GLenum { 0x8C83 } - - @inlinable static var TRANSFORM_FEEDBACK_BUFFER_START: GLenum { 0x8C84 } - - @inlinable static var TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum { 0x8C85 } - - @inlinable static var TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum { 0x8C88 } - - @inlinable static var RASTERIZER_DISCARD: GLenum { 0x8C89 } - - @inlinable static var MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum { 0x8C8A } - - @inlinable static var MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum { 0x8C8B } - - @inlinable static var INTERLEAVED_ATTRIBS: GLenum { 0x8C8C } - - @inlinable static var SEPARATE_ATTRIBS: GLenum { 0x8C8D } - - @inlinable static var TRANSFORM_FEEDBACK_BUFFER: GLenum { 0x8C8E } - - @inlinable static var TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum { 0x8C8F } - - @inlinable static var RGBA32UI: GLenum { 0x8D70 } - - @inlinable static var RGB32UI: GLenum { 0x8D71 } - - @inlinable static var RGBA16UI: GLenum { 0x8D76 } - - @inlinable static var RGB16UI: GLenum { 0x8D77 } - - @inlinable static var RGBA8UI: GLenum { 0x8D7C } - - @inlinable static var RGB8UI: GLenum { 0x8D7D } - - @inlinable static var RGBA32I: GLenum { 0x8D82 } - - @inlinable static var RGB32I: GLenum { 0x8D83 } - - @inlinable static var RGBA16I: GLenum { 0x8D88 } - - @inlinable static var RGB16I: GLenum { 0x8D89 } - - @inlinable static var RGBA8I: GLenum { 0x8D8E } - - @inlinable static var RGB8I: GLenum { 0x8D8F } - - @inlinable static var RED_INTEGER: GLenum { 0x8D94 } - - @inlinable static var RGB_INTEGER: GLenum { 0x8D98 } - - @inlinable static var RGBA_INTEGER: GLenum { 0x8D99 } - - @inlinable static var SAMPLER_2D_ARRAY: GLenum { 0x8DC1 } - - @inlinable static var SAMPLER_2D_ARRAY_SHADOW: GLenum { 0x8DC4 } - - @inlinable static var SAMPLER_CUBE_SHADOW: GLenum { 0x8DC5 } - - @inlinable static var UNSIGNED_INT_VEC2: GLenum { 0x8DC6 } - - @inlinable static var UNSIGNED_INT_VEC3: GLenum { 0x8DC7 } - - @inlinable static var UNSIGNED_INT_VEC4: GLenum { 0x8DC8 } - - @inlinable static var INT_SAMPLER_2D: GLenum { 0x8DCA } - - @inlinable static var INT_SAMPLER_3D: GLenum { 0x8DCB } - - @inlinable static var INT_SAMPLER_CUBE: GLenum { 0x8DCC } - - @inlinable static var INT_SAMPLER_2D_ARRAY: GLenum { 0x8DCF } - - @inlinable static var UNSIGNED_INT_SAMPLER_2D: GLenum { 0x8DD2 } - - @inlinable static var UNSIGNED_INT_SAMPLER_3D: GLenum { 0x8DD3 } - - @inlinable static var UNSIGNED_INT_SAMPLER_CUBE: GLenum { 0x8DD4 } - - @inlinable static var UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum { 0x8DD7 } - - @inlinable static var DEPTH_COMPONENT32F: GLenum { 0x8CAC } - - @inlinable static var DEPTH32F_STENCIL8: GLenum { 0x8CAD } - - @inlinable static var FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum { 0x8DAD } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum { 0x8210 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum { 0x8211 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum { 0x8212 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum { 0x8213 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum { 0x8214 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum { 0x8215 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum { 0x8216 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum { 0x8217 } - - @inlinable static var FRAMEBUFFER_DEFAULT: GLenum { 0x8218 } - - @inlinable static var UNSIGNED_INT_24_8: GLenum { 0x84FA } - - @inlinable static var DEPTH24_STENCIL8: GLenum { 0x88F0 } - - @inlinable static var UNSIGNED_NORMALIZED: GLenum { 0x8C17 } - - @inlinable static var DRAW_FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } - - @inlinable static var READ_FRAMEBUFFER: GLenum { 0x8CA8 } - - @inlinable static var DRAW_FRAMEBUFFER: GLenum { 0x8CA9 } - - @inlinable static var READ_FRAMEBUFFER_BINDING: GLenum { 0x8CAA } - - @inlinable static var RENDERBUFFER_SAMPLES: GLenum { 0x8CAB } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum { 0x8CD4 } - - @inlinable static var MAX_COLOR_ATTACHMENTS: GLenum { 0x8CDF } - - @inlinable static var COLOR_ATTACHMENT1: GLenum { 0x8CE1 } - - @inlinable static var COLOR_ATTACHMENT2: GLenum { 0x8CE2 } - - @inlinable static var COLOR_ATTACHMENT3: GLenum { 0x8CE3 } - - @inlinable static var COLOR_ATTACHMENT4: GLenum { 0x8CE4 } - - @inlinable static var COLOR_ATTACHMENT5: GLenum { 0x8CE5 } - - @inlinable static var COLOR_ATTACHMENT6: GLenum { 0x8CE6 } - - @inlinable static var COLOR_ATTACHMENT7: GLenum { 0x8CE7 } - - @inlinable static var COLOR_ATTACHMENT8: GLenum { 0x8CE8 } - - @inlinable static var COLOR_ATTACHMENT9: GLenum { 0x8CE9 } - - @inlinable static var COLOR_ATTACHMENT10: GLenum { 0x8CEA } - - @inlinable static var COLOR_ATTACHMENT11: GLenum { 0x8CEB } - - @inlinable static var COLOR_ATTACHMENT12: GLenum { 0x8CEC } - - @inlinable static var COLOR_ATTACHMENT13: GLenum { 0x8CED } - - @inlinable static var COLOR_ATTACHMENT14: GLenum { 0x8CEE } - - @inlinable static var COLOR_ATTACHMENT15: GLenum { 0x8CEF } - - @inlinable static var FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum { 0x8D56 } - - @inlinable static var MAX_SAMPLES: GLenum { 0x8D57 } - - @inlinable static var HALF_FLOAT: GLenum { 0x140B } - - @inlinable static var RG: GLenum { 0x8227 } - - @inlinable static var RG_INTEGER: GLenum { 0x8228 } - - @inlinable static var R8: GLenum { 0x8229 } - - @inlinable static var RG8: GLenum { 0x822B } - - @inlinable static var R16F: GLenum { 0x822D } - - @inlinable static var R32F: GLenum { 0x822E } - - @inlinable static var RG16F: GLenum { 0x822F } - - @inlinable static var RG32F: GLenum { 0x8230 } - - @inlinable static var R8I: GLenum { 0x8231 } - - @inlinable static var R8UI: GLenum { 0x8232 } - - @inlinable static var R16I: GLenum { 0x8233 } - - @inlinable static var R16UI: GLenum { 0x8234 } - - @inlinable static var R32I: GLenum { 0x8235 } - - @inlinable static var R32UI: GLenum { 0x8236 } - - @inlinable static var RG8I: GLenum { 0x8237 } - - @inlinable static var RG8UI: GLenum { 0x8238 } - - @inlinable static var RG16I: GLenum { 0x8239 } - - @inlinable static var RG16UI: GLenum { 0x823A } - - @inlinable static var RG32I: GLenum { 0x823B } - - @inlinable static var RG32UI: GLenum { 0x823C } - - @inlinable static var VERTEX_ARRAY_BINDING: GLenum { 0x85B5 } - - @inlinable static var R8_SNORM: GLenum { 0x8F94 } - - @inlinable static var RG8_SNORM: GLenum { 0x8F95 } - - @inlinable static var RGB8_SNORM: GLenum { 0x8F96 } - - @inlinable static var RGBA8_SNORM: GLenum { 0x8F97 } - - @inlinable static var SIGNED_NORMALIZED: GLenum { 0x8F9C } - - @inlinable static var COPY_READ_BUFFER: GLenum { 0x8F36 } - - @inlinable static var COPY_WRITE_BUFFER: GLenum { 0x8F37 } - - @inlinable static var COPY_READ_BUFFER_BINDING: GLenum { 0x8F36 } - - @inlinable static var COPY_WRITE_BUFFER_BINDING: GLenum { 0x8F37 } - - @inlinable static var UNIFORM_BUFFER: GLenum { 0x8A11 } - - @inlinable static var UNIFORM_BUFFER_BINDING: GLenum { 0x8A28 } - - @inlinable static var UNIFORM_BUFFER_START: GLenum { 0x8A29 } - - @inlinable static var UNIFORM_BUFFER_SIZE: GLenum { 0x8A2A } - - @inlinable static var MAX_VERTEX_UNIFORM_BLOCKS: GLenum { 0x8A2B } - - @inlinable static var MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum { 0x8A2D } - - @inlinable static var MAX_COMBINED_UNIFORM_BLOCKS: GLenum { 0x8A2E } - - @inlinable static var MAX_UNIFORM_BUFFER_BINDINGS: GLenum { 0x8A2F } - - @inlinable static var MAX_UNIFORM_BLOCK_SIZE: GLenum { 0x8A30 } - - @inlinable static var MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8A31 } - - @inlinable static var MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8A33 } - - @inlinable static var UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum { 0x8A34 } - - @inlinable static var ACTIVE_UNIFORM_BLOCKS: GLenum { 0x8A36 } - - @inlinable static var UNIFORM_TYPE: GLenum { 0x8A37 } - - @inlinable static var UNIFORM_SIZE: GLenum { 0x8A38 } - - @inlinable static var UNIFORM_BLOCK_INDEX: GLenum { 0x8A3A } - - @inlinable static var UNIFORM_OFFSET: GLenum { 0x8A3B } - - @inlinable static var UNIFORM_ARRAY_STRIDE: GLenum { 0x8A3C } - - @inlinable static var UNIFORM_MATRIX_STRIDE: GLenum { 0x8A3D } - - @inlinable static var UNIFORM_IS_ROW_MAJOR: GLenum { 0x8A3E } - - @inlinable static var UNIFORM_BLOCK_BINDING: GLenum { 0x8A3F } - - @inlinable static var UNIFORM_BLOCK_DATA_SIZE: GLenum { 0x8A40 } - - @inlinable static var UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum { 0x8A42 } - - @inlinable static var UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum { 0x8A43 } - - @inlinable static var UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum { 0x8A44 } - - @inlinable static var UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum { 0x8A46 } - - @inlinable static var INVALID_INDEX: GLenum { 0xFFFF_FFFF } - - @inlinable static var MAX_VERTEX_OUTPUT_COMPONENTS: GLenum { 0x9122 } - - @inlinable static var MAX_FRAGMENT_INPUT_COMPONENTS: GLenum { 0x9125 } - - @inlinable static var MAX_SERVER_WAIT_TIMEOUT: GLenum { 0x9111 } - - @inlinable static var OBJECT_TYPE: GLenum { 0x9112 } - - @inlinable static var SYNC_CONDITION: GLenum { 0x9113 } - - @inlinable static var SYNC_STATUS: GLenum { 0x9114 } - - @inlinable static var SYNC_FLAGS: GLenum { 0x9115 } - - @inlinable static var SYNC_FENCE: GLenum { 0x9116 } - - @inlinable static var SYNC_GPU_COMMANDS_COMPLETE: GLenum { 0x9117 } - - @inlinable static var UNSIGNALED: GLenum { 0x9118 } - - @inlinable static var SIGNALED: GLenum { 0x9119 } - - @inlinable static var ALREADY_SIGNALED: GLenum { 0x911A } - - @inlinable static var TIMEOUT_EXPIRED: GLenum { 0x911B } - - @inlinable static var CONDITION_SATISFIED: GLenum { 0x911C } - - @inlinable static var WAIT_FAILED: GLenum { 0x911D } - - @inlinable static var SYNC_FLUSH_COMMANDS_BIT: GLenum { 0x0000_0001 } - - @inlinable static var VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum { 0x88FE } - - @inlinable static var ANY_SAMPLES_PASSED: GLenum { 0x8C2F } - - @inlinable static var ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum { 0x8D6A } - - @inlinable static var SAMPLER_BINDING: GLenum { 0x8919 } - - @inlinable static var RGB10_A2UI: GLenum { 0x906F } - - @inlinable static var INT_2_10_10_10_REV: GLenum { 0x8D9F } - - @inlinable static var TRANSFORM_FEEDBACK: GLenum { 0x8E22 } - - @inlinable static var TRANSFORM_FEEDBACK_PAUSED: GLenum { 0x8E23 } - - @inlinable static var TRANSFORM_FEEDBACK_ACTIVE: GLenum { 0x8E24 } - - @inlinable static var TRANSFORM_FEEDBACK_BINDING: GLenum { 0x8E25 } - - @inlinable static var TEXTURE_IMMUTABLE_FORMAT: GLenum { 0x912F } - - @inlinable static var MAX_ELEMENT_INDEX: GLenum { 0x8D6B } - - @inlinable static var TEXTURE_IMMUTABLE_LEVELS: GLenum { 0x82DF } - - @inlinable static var TIMEOUT_IGNORED: GLint64 { -1 } - - @inlinable static var MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum { 0x9247 } - - @inlinable func copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) { - let this = jsObject - _ = this[Strings.copyBufferSubData].function!(this: this, arguments: [readTarget.jsValue, writeTarget.jsValue, readOffset.jsValue, writeOffset.jsValue, size.jsValue]) - } - - @inlinable func getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset: GLuint? = nil, length: GLuint? = nil) { - let this = jsObject - _ = this[Strings.getBufferSubData].function!(this: this, arguments: [target.jsValue, srcByteOffset.jsValue, dstBuffer.jsValue, dstOffset?.jsValue ?? .undefined, length?.jsValue ?? .undefined]) - } - - @inlinable func blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum) { - let _arg0 = srcX0.jsValue - let _arg1 = srcY0.jsValue - let _arg2 = srcX1.jsValue - let _arg3 = srcY1.jsValue - let _arg4 = dstX0.jsValue - let _arg5 = dstY0.jsValue - let _arg6 = dstX1.jsValue - let _arg7 = dstY1.jsValue - let _arg8 = mask.jsValue - let _arg9 = filter.jsValue - let this = jsObject - _ = this[Strings.blitFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) - } - - @inlinable func framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, layer: GLint) { - let this = jsObject - _ = this[Strings.framebufferTextureLayer].function!(this: this, arguments: [target.jsValue, attachment.jsValue, texture.jsValue, level.jsValue, layer.jsValue]) - } - - @inlinable func invalidateFramebuffer(target: GLenum, attachments: [GLenum]) { - let this = jsObject - _ = this[Strings.invalidateFramebuffer].function!(this: this, arguments: [target.jsValue, attachments.jsValue]) - } - - @inlinable func invalidateSubFramebuffer(target: GLenum, attachments: [GLenum], x: GLint, y: GLint, width: GLsizei, height: GLsizei) { - let _arg0 = target.jsValue - let _arg1 = attachments.jsValue - let _arg2 = x.jsValue - let _arg3 = y.jsValue - let _arg4 = width.jsValue - let _arg5 = height.jsValue - let this = jsObject - _ = this[Strings.invalidateSubFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } - - @inlinable func readBuffer(src: GLenum) { - let this = jsObject - _ = this[Strings.readBuffer].function!(this: this, arguments: [src.jsValue]) - } - - @inlinable func getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getInternalformatParameter].function!(this: this, arguments: [target.jsValue, internalformat.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { - let this = jsObject - _ = this[Strings.renderbufferStorageMultisample].function!(this: this, arguments: [target.jsValue, samples.jsValue, internalformat.jsValue, width.jsValue, height.jsValue]) - } - - @inlinable func texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { - let this = jsObject - _ = this[Strings.texStorage2D].function!(this: this, arguments: [target.jsValue, levels.jsValue, internalformat.jsValue, width.jsValue, height.jsValue]) - } - - @inlinable func texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) { - let _arg0 = target.jsValue - let _arg1 = levels.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = width.jsValue - let _arg4 = height.jsValue - let _arg5 = depth.jsValue - let this = jsObject - _ = this[Strings.texStorage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } - - @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = width.jsValue - let _arg4 = height.jsValue - let _arg5 = depth.jsValue - let _arg6 = border.jsValue - let _arg7 = format.jsValue - let _arg8 = type.jsValue - let _arg9 = pboOffset.jsValue - let this = jsObject - _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) - } - - @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = width.jsValue - let _arg4 = height.jsValue - let _arg5 = depth.jsValue - let _arg6 = border.jsValue - let _arg7 = format.jsValue - let _arg8 = type.jsValue - let _arg9 = source.jsValue - let this = jsObject - _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) - } - - @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView?) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = width.jsValue - let _arg4 = height.jsValue - let _arg5 = depth.jsValue - let _arg6 = border.jsValue - let _arg7 = format.jsValue - let _arg8 = type.jsValue - let _arg9 = srcData.jsValue - let this = jsObject - _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) - } - - @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = width.jsValue - let _arg4 = height.jsValue - let _arg5 = depth.jsValue - let _arg6 = border.jsValue - let _arg7 = format.jsValue - let _arg8 = type.jsValue - let _arg9 = srcData.jsValue - let _arg10 = srcOffset.jsValue - let this = jsObject - _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) - } - - @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = xoffset.jsValue - let _arg3 = yoffset.jsValue - let _arg4 = zoffset.jsValue - let _arg5 = width.jsValue - let _arg6 = height.jsValue - let _arg7 = depth.jsValue - let _arg8 = format.jsValue - let _arg9 = type.jsValue - let _arg10 = pboOffset.jsValue - let this = jsObject - _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) - } - - @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = xoffset.jsValue - let _arg3 = yoffset.jsValue - let _arg4 = zoffset.jsValue - let _arg5 = width.jsValue - let _arg6 = height.jsValue - let _arg7 = depth.jsValue - let _arg8 = format.jsValue - let _arg9 = type.jsValue - let _arg10 = source.jsValue - let this = jsObject - _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) - } - - @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView?, srcOffset: GLuint? = nil) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = xoffset.jsValue - let _arg3 = yoffset.jsValue - let _arg4 = zoffset.jsValue - let _arg5 = width.jsValue - let _arg6 = height.jsValue - let _arg7 = depth.jsValue - let _arg8 = format.jsValue - let _arg9 = type.jsValue - let _arg10 = srcData.jsValue - let _arg11 = srcOffset?.jsValue ?? .undefined - let this = jsObject - _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) - } - - @inlinable func copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: 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 = zoffset.jsValue - let _arg5 = x.jsValue - let _arg6 = y.jsValue - let _arg7 = width.jsValue - let _arg8 = height.jsValue - let this = jsObject - _ = this[Strings.copyTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) - } - - @inlinable func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = width.jsValue - let _arg4 = height.jsValue - let _arg5 = depth.jsValue - let _arg6 = border.jsValue - let _arg7 = imageSize.jsValue - let _arg8 = offset.jsValue - let this = jsObject - _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) - } - - @inlinable func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = width.jsValue - let _arg4 = height.jsValue - let _arg5 = depth.jsValue - let _arg6 = border.jsValue - let _arg7 = srcData.jsValue - let _arg8 = srcOffset?.jsValue ?? .undefined - let _arg9 = srcLengthOverride?.jsValue ?? .undefined - let this = jsObject - _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) - } - - @inlinable func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = xoffset.jsValue - let _arg3 = yoffset.jsValue - let _arg4 = zoffset.jsValue - let _arg5 = width.jsValue - let _arg6 = height.jsValue - let _arg7 = depth.jsValue - let _arg8 = format.jsValue - let _arg9 = imageSize.jsValue - let _arg10 = offset.jsValue - let this = jsObject - _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) - } - - @inlinable func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = xoffset.jsValue - let _arg3 = yoffset.jsValue - let _arg4 = zoffset.jsValue - let _arg5 = width.jsValue - let _arg6 = height.jsValue - let _arg7 = depth.jsValue - let _arg8 = format.jsValue - let _arg9 = srcData.jsValue - let _arg10 = srcOffset?.jsValue ?? .undefined - let _arg11 = srcLengthOverride?.jsValue ?? .undefined - let this = jsObject - _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) - } - - @inlinable func getFragDataLocation(program: WebGLProgram, name: String) -> GLint { - let this = jsObject - return this[Strings.getFragDataLocation].function!(this: this, arguments: [program.jsValue, name.jsValue]).fromJSValue()! - } - - @inlinable func uniform1ui(location: WebGLUniformLocation?, v0: GLuint) { - let this = jsObject - _ = this[Strings.uniform1ui].function!(this: this, arguments: [location.jsValue, v0.jsValue]) - } - - @inlinable func uniform2ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint) { - let this = jsObject - _ = this[Strings.uniform2ui].function!(this: this, arguments: [location.jsValue, v0.jsValue, v1.jsValue]) - } - - @inlinable func uniform3ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint) { - let this = jsObject - _ = this[Strings.uniform3ui].function!(this: this, arguments: [location.jsValue, v0.jsValue, v1.jsValue, v2.jsValue]) - } - - @inlinable func uniform4ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) { - let this = jsObject - _ = this[Strings.uniform4ui].function!(this: this, arguments: [location.jsValue, v0.jsValue, v1.jsValue, v2.jsValue, v3.jsValue]) - } - - @inlinable func uniform1uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform1uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform2uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform2uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform3uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform3uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform4uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform4uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniformMatrix3x2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniformMatrix4x2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniformMatrix2x3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniformMatrix4x3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniformMatrix2x4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniformMatrix3x4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) { - let this = jsObject - _ = this[Strings.vertexAttribI4i].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) - } - - @inlinable func vertexAttribI4iv(index: GLuint, values: Int32List) { - let this = jsObject - _ = this[Strings.vertexAttribI4iv].function!(this: this, arguments: [index.jsValue, values.jsValue]) - } - - @inlinable func vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) { - let this = jsObject - _ = this[Strings.vertexAttribI4ui].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) - } - - @inlinable func vertexAttribI4uiv(index: GLuint, values: Uint32List) { - let this = jsObject - _ = this[Strings.vertexAttribI4uiv].function!(this: this, arguments: [index.jsValue, values.jsValue]) - } - - @inlinable func vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr) { - let this = jsObject - _ = this[Strings.vertexAttribIPointer].function!(this: this, arguments: [index.jsValue, size.jsValue, type.jsValue, stride.jsValue, offset.jsValue]) - } - - @inlinable func vertexAttribDivisor(index: GLuint, divisor: GLuint) { - let this = jsObject - _ = this[Strings.vertexAttribDivisor].function!(this: this, arguments: [index.jsValue, divisor.jsValue]) - } - - @inlinable func drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) { - let this = jsObject - _ = this[Strings.drawArraysInstanced].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue, instanceCount.jsValue]) - } - - @inlinable func drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) { - let this = jsObject - _ = this[Strings.drawElementsInstanced].function!(this: this, arguments: [mode.jsValue, count.jsValue, type.jsValue, offset.jsValue, instanceCount.jsValue]) - } - - @inlinable func drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr) { - let _arg0 = mode.jsValue - let _arg1 = start.jsValue - let _arg2 = end.jsValue - let _arg3 = count.jsValue - let _arg4 = type.jsValue - let _arg5 = offset.jsValue - let this = jsObject - _ = this[Strings.drawRangeElements].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } - - @inlinable func drawBuffers(buffers: [GLenum]) { - let this = jsObject - _ = this[Strings.drawBuffers].function!(this: this, arguments: [buffers.jsValue]) - } - - @inlinable func clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset: GLuint? = nil) { - let this = jsObject - _ = this[Strings.clearBufferfv].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, values.jsValue, srcOffset?.jsValue ?? .undefined]) - } - - @inlinable func clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset: GLuint? = nil) { - let this = jsObject - _ = this[Strings.clearBufferiv].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, values.jsValue, srcOffset?.jsValue ?? .undefined]) - } - - @inlinable func clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset: GLuint? = nil) { - let this = jsObject - _ = this[Strings.clearBufferuiv].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, values.jsValue, srcOffset?.jsValue ?? .undefined]) - } - - @inlinable func clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) { - let this = jsObject - _ = this[Strings.clearBufferfi].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, depth.jsValue, stencil.jsValue]) - } - - @inlinable func createQuery() -> WebGLQuery? { - let this = jsObject - return this[Strings.createQuery].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func deleteQuery(query: WebGLQuery?) { - let this = jsObject - _ = this[Strings.deleteQuery].function!(this: this, arguments: [query.jsValue]) - } - - @inlinable func isQuery(query: WebGLQuery?) -> GLboolean { - let this = jsObject - return this[Strings.isQuery].function!(this: this, arguments: [query.jsValue]).fromJSValue()! - } - - @inlinable func beginQuery(target: GLenum, query: WebGLQuery) { - let this = jsObject - _ = this[Strings.beginQuery].function!(this: this, arguments: [target.jsValue, query.jsValue]) - } - - @inlinable func endQuery(target: GLenum) { - let this = jsObject - _ = this[Strings.endQuery].function!(this: this, arguments: [target.jsValue]) - } - - @inlinable func getQuery(target: GLenum, pname: GLenum) -> WebGLQuery? { - let this = jsObject - return this[Strings.getQuery].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getQueryParameter(query: WebGLQuery, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getQueryParameter].function!(this: this, arguments: [query.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func createSampler() -> WebGLSampler? { - let this = jsObject - return this[Strings.createSampler].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func deleteSampler(sampler: WebGLSampler?) { - let this = jsObject - _ = this[Strings.deleteSampler].function!(this: this, arguments: [sampler.jsValue]) - } - - @inlinable func isSampler(sampler: WebGLSampler?) -> GLboolean { - let this = jsObject - return this[Strings.isSampler].function!(this: this, arguments: [sampler.jsValue]).fromJSValue()! - } - - @inlinable func bindSampler(unit: GLuint, sampler: WebGLSampler?) { - let this = jsObject - _ = this[Strings.bindSampler].function!(this: this, arguments: [unit.jsValue, sampler.jsValue]) - } - - @inlinable func samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint) { - let this = jsObject - _ = this[Strings.samplerParameteri].function!(this: this, arguments: [sampler.jsValue, pname.jsValue, param.jsValue]) - } - - @inlinable func samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat) { - let this = jsObject - _ = this[Strings.samplerParameterf].function!(this: this, arguments: [sampler.jsValue, pname.jsValue, param.jsValue]) - } - - @inlinable func getSamplerParameter(sampler: WebGLSampler, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getSamplerParameter].function!(this: this, arguments: [sampler.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func fenceSync(condition: GLenum, flags: GLbitfield) -> WebGLSync? { - let this = jsObject - return this[Strings.fenceSync].function!(this: this, arguments: [condition.jsValue, flags.jsValue]).fromJSValue()! - } - - @inlinable func isSync(sync: WebGLSync?) -> GLboolean { - let this = jsObject - return this[Strings.isSync].function!(this: this, arguments: [sync.jsValue]).fromJSValue()! - } - - @inlinable func deleteSync(sync: WebGLSync?) { - let this = jsObject - _ = this[Strings.deleteSync].function!(this: this, arguments: [sync.jsValue]) - } - - @inlinable func clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64) -> GLenum { - let this = jsObject - return this[Strings.clientWaitSync].function!(this: this, arguments: [sync.jsValue, flags.jsValue, timeout.jsValue]).fromJSValue()! - } - - @inlinable func waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64) { - let this = jsObject - _ = this[Strings.waitSync].function!(this: this, arguments: [sync.jsValue, flags.jsValue, timeout.jsValue]) - } - - @inlinable func getSyncParameter(sync: WebGLSync, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getSyncParameter].function!(this: this, arguments: [sync.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func createTransformFeedback() -> WebGLTransformFeedback? { - let this = jsObject - return this[Strings.createTransformFeedback].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func deleteTransformFeedback(tf: WebGLTransformFeedback?) { - let this = jsObject - _ = this[Strings.deleteTransformFeedback].function!(this: this, arguments: [tf.jsValue]) - } - - @inlinable func isTransformFeedback(tf: WebGLTransformFeedback?) -> GLboolean { - let this = jsObject - return this[Strings.isTransformFeedback].function!(this: this, arguments: [tf.jsValue]).fromJSValue()! - } - - @inlinable func bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback?) { - let this = jsObject - _ = this[Strings.bindTransformFeedback].function!(this: this, arguments: [target.jsValue, tf.jsValue]) - } - - @inlinable func beginTransformFeedback(primitiveMode: GLenum) { - let this = jsObject - _ = this[Strings.beginTransformFeedback].function!(this: this, arguments: [primitiveMode.jsValue]) - } - - @inlinable func endTransformFeedback() { - let this = jsObject - _ = this[Strings.endTransformFeedback].function!(this: this, arguments: []) - } - - @inlinable func transformFeedbackVaryings(program: WebGLProgram, varyings: [String], bufferMode: GLenum) { - let this = jsObject - _ = this[Strings.transformFeedbackVaryings].function!(this: this, arguments: [program.jsValue, varyings.jsValue, bufferMode.jsValue]) - } - - @inlinable func getTransformFeedbackVarying(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { - let this = jsObject - return this[Strings.getTransformFeedbackVarying].function!(this: this, arguments: [program.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable func pauseTransformFeedback() { - let this = jsObject - _ = this[Strings.pauseTransformFeedback].function!(this: this, arguments: []) - } - - @inlinable func resumeTransformFeedback() { - let this = jsObject - _ = this[Strings.resumeTransformFeedback].function!(this: this, arguments: []) - } - - @inlinable func bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer?) { - let this = jsObject - _ = this[Strings.bindBufferBase].function!(this: this, arguments: [target.jsValue, index.jsValue, buffer.jsValue]) - } - - @inlinable func bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer?, offset: GLintptr, size: GLsizeiptr) { - let this = jsObject - _ = this[Strings.bindBufferRange].function!(this: this, arguments: [target.jsValue, index.jsValue, buffer.jsValue, offset.jsValue, size.jsValue]) - } - - @inlinable func getIndexedParameter(target: GLenum, index: GLuint) -> JSValue { - let this = jsObject - return this[Strings.getIndexedParameter].function!(this: this, arguments: [target.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable func getUniformIndices(program: WebGLProgram, uniformNames: [String]) -> [GLuint]? { - let this = jsObject - return this[Strings.getUniformIndices].function!(this: this, arguments: [program.jsValue, uniformNames.jsValue]).fromJSValue()! - } - - @inlinable func getActiveUniforms(program: WebGLProgram, uniformIndices: [GLuint], pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getActiveUniforms].function!(this: this, arguments: [program.jsValue, uniformIndices.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getUniformBlockIndex(program: WebGLProgram, uniformBlockName: String) -> GLuint { - let this = jsObject - return this[Strings.getUniformBlockIndex].function!(this: this, arguments: [program.jsValue, uniformBlockName.jsValue]).fromJSValue()! - } - - @inlinable func getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getActiveUniformBlockParameter].function!(this: this, arguments: [program.jsValue, uniformBlockIndex.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint) -> String? { - let this = jsObject - return this[Strings.getActiveUniformBlockName].function!(this: this, arguments: [program.jsValue, uniformBlockIndex.jsValue]).fromJSValue()! - } - - @inlinable func uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint) { - let this = jsObject - _ = this[Strings.uniformBlockBinding].function!(this: this, arguments: [program.jsValue, uniformBlockIndex.jsValue, uniformBlockBinding.jsValue]) - } - - @inlinable func createVertexArray() -> WebGLVertexArrayObject? { - let this = jsObject - return this[Strings.createVertexArray].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func deleteVertexArray(vertexArray: WebGLVertexArrayObject?) { - let this = jsObject - _ = this[Strings.deleteVertexArray].function!(this: this, arguments: [vertexArray.jsValue]) - } - - @inlinable func isVertexArray(vertexArray: WebGLVertexArrayObject?) -> GLboolean { - let this = jsObject - return this[Strings.isVertexArray].function!(this: this, arguments: [vertexArray.jsValue]).fromJSValue()! - } - - @inlinable func bindVertexArray(array: WebGLVertexArrayObject?) { - let this = jsObject - _ = this[Strings.bindVertexArray].function!(this: this, arguments: [array.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift deleted file mode 100644 index 659213d5..00000000 --- a/Sources/DOMKit/WebIDL/WebGL2RenderingContextOverloads.swift +++ /dev/null @@ -1,317 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol WebGL2RenderingContextOverloads: JSBridgedClass {} -public extension WebGL2RenderingContextOverloads { - @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, srcData: BufferSource?, usage: GLenum) { - let this = jsObject - _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, srcData.jsValue, usage.jsValue]) - } - - @inlinable func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource) { - let this = jsObject - _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue, dstByteOffset.jsValue, srcData.jsValue]) - } - - @inlinable func bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length: GLuint? = nil) { - let this = jsObject - _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, srcData.jsValue, usage.jsValue, srcOffset.jsValue, length?.jsValue ?? .undefined]) - } - - @inlinable func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length: GLuint? = nil) { - let this = jsObject - _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue, dstByteOffset.jsValue, srcData.jsValue, srcOffset.jsValue, length?.jsValue ?? .undefined]) - } - - @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 texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { - 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 = pboOffset.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, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { - 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 = source.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, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { - 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 = srcData.jsValue - let _arg9 = srcOffset.jsValue - let this = jsObject - _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) - } - - @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { - 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 = pboOffset.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, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { - 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 = source.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, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { - 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 = srcData.jsValue - let _arg9 = srcOffset.jsValue - let this = jsObject - _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) - } - - @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { - 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 = imageSize.jsValue - let _arg7 = offset.jsValue - let this = jsObject - _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) - } - - @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { - 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 = srcData.jsValue - let _arg7 = srcOffset?.jsValue ?? .undefined - let _arg8 = srcLengthOverride?.jsValue ?? .undefined - let this = jsObject - _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) - } - - @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { - 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 = imageSize.jsValue - let _arg8 = offset.jsValue - let this = jsObject - _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) - } - - @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { - 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 = srcData.jsValue - let _arg8 = srcOffset?.jsValue ?? .undefined - let _arg9 = srcLengthOverride?.jsValue ?? .undefined - let this = jsObject - _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) - } - - @inlinable func uniform1fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform2fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform3fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform4fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform1iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform2iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform3iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniform4iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { - let this = jsObject - _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) - } - - @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: 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 = dstData.jsValue - let this = jsObject - _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) - } - - @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr) { - 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 = offset.jsValue - let this = jsObject - _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) - } - - @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint) { - 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 = dstData.jsValue - let _arg7 = dstOffset.jsValue - let this = jsObject - _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) - } -} 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 631a301d..00000000 --- a/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift +++ /dev/null @@ -1,65 +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, xrCompatible: 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 - object[Strings.xrCompatible] = xrCompatible.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) - _xrCompatible = ReadWriteAttribute(jsObject: object, name: Strings.xrCompatible) - 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 - - @ReadWriteAttribute - public var xrCompatible: 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/WebGLQuery.swift b/Sources/DOMKit/WebIDL/WebGLQuery.swift deleted file mode 100644 index 901356e4..00000000 --- a/Sources/DOMKit/WebIDL/WebGLQuery.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLQuery: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLQuery].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 8f5c158c..00000000 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift +++ /dev/null @@ -1,1229 +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]) - } - - @inlinable func makeXRCompatible() -> JSPromise { - let this = jsObject - return this[Strings.makeXRCompatible].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable func makeXRCompatible() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.makeXRCompatible].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } -} 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/WebGLSampler.swift b/Sources/DOMKit/WebIDL/WebGLSampler.swift deleted file mode 100644 index 1b6c94e3..00000000 --- a/Sources/DOMKit/WebIDL/WebGLSampler.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLSampler: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSampler].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} 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/WebGLSync.swift b/Sources/DOMKit/WebIDL/WebGLSync.swift deleted file mode 100644 index 38271eb1..00000000 --- a/Sources/DOMKit/WebIDL/WebGLSync.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLSync: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSync].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} 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/WebGLTimerQueryEXT.swift b/Sources/DOMKit/WebIDL/WebGLTimerQueryEXT.swift deleted file mode 100644 index f618444f..00000000 --- a/Sources/DOMKit/WebIDL/WebGLTimerQueryEXT.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLTimerQueryEXT: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTimerQueryEXT].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift b/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift deleted file mode 100644 index 981c92d1..00000000 --- a/Sources/DOMKit/WebIDL/WebGLTransformFeedback.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLTransformFeedback: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTransformFeedback].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 - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift b/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift deleted file mode 100644 index 2ca909eb..00000000 --- a/Sources/DOMKit/WebIDL/WebGLVertexArrayObject.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLVertexArrayObject: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLVertexArrayObject].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift b/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift deleted file mode 100644 index ae43038a..00000000 --- a/Sources/DOMKit/WebIDL/WebGLVertexArrayObjectOES.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLVertexArrayObjectOES: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLVertexArrayObjectOES].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/WebSocket.swift b/Sources/DOMKit/WebIDL/WebSocket.swift deleted file mode 100644 index 9dcecc6e..00000000 --- a/Sources/DOMKit/WebIDL/WebSocket.swift +++ /dev/null @@ -1,74 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebSocket: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebSocket].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _url = ReadonlyAttribute(jsObject: jsObject, name: Strings.url) - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) - _bufferedAmount = ReadonlyAttribute(jsObject: jsObject, name: Strings.bufferedAmount) - _onopen = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onopen) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - _onclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onclose) - _extensions = ReadonlyAttribute(jsObject: jsObject, name: Strings.extensions) - _protocol = ReadonlyAttribute(jsObject: jsObject, name: Strings.protocol) - _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) - _binaryType = ReadWriteAttribute(jsObject: jsObject, name: Strings.binaryType) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(url: String, protocols: String_or_seq_of_String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue, protocols?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var url: String - - public static let CONNECTING: UInt16 = 0 - - public static let OPEN: UInt16 = 1 - - public static let CLOSING: UInt16 = 2 - - public static let CLOSED: UInt16 = 3 - - @ReadonlyAttribute - public var readyState: UInt16 - - @ReadonlyAttribute - public var bufferedAmount: UInt64 - - @ClosureAttribute1Optional - public var onopen: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler - - @ClosureAttribute1Optional - public var onclose: EventHandler - - @ReadonlyAttribute - public var extensions: String - - @ReadonlyAttribute - public var `protocol`: String - - @inlinable public func close(code: UInt16? = nil, reason: String? = nil) { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: [code?.jsValue ?? .undefined, reason?.jsValue ?? .undefined]) - } - - @ClosureAttribute1Optional - public var onmessage: EventHandler - - @ReadWriteAttribute - public var binaryType: BinaryType - - @inlinable public func send(data: Blob_or_BufferSource_or_String) { - let this = jsObject - _ = this[Strings.send].function!(this: this, arguments: [data.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/WebTransport.swift b/Sources/DOMKit/WebIDL/WebTransport.swift deleted file mode 100644 index be25378b..00000000 --- a/Sources/DOMKit/WebIDL/WebTransport.swift +++ /dev/null @@ -1,79 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebTransport: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebTransport].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) - _closed = ReadonlyAttribute(jsObject: jsObject, name: Strings.closed) - _datagrams = ReadonlyAttribute(jsObject: jsObject, name: Strings.datagrams) - _incomingBidirectionalStreams = ReadonlyAttribute(jsObject: jsObject, name: Strings.incomingBidirectionalStreams) - _incomingUnidirectionalStreams = ReadonlyAttribute(jsObject: jsObject, name: Strings.incomingUnidirectionalStreams) - self.jsObject = jsObject - } - - @inlinable public convenience init(url: String, options: WebTransportOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue, options?.jsValue ?? .undefined])) - } - - @inlinable public func getStats() -> JSPromise { - let this = jsObject - return this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getStats() async throws -> WebTransportStats { - let this = jsObject - let _promise: JSPromise = this[Strings.getStats].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var ready: JSPromise - - @ReadonlyAttribute - public var closed: JSPromise - - @inlinable public func close(closeInfo: WebTransportCloseInfo? = nil) { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: [closeInfo?.jsValue ?? .undefined]) - } - - @ReadonlyAttribute - public var datagrams: WebTransportDatagramDuplexStream - - @inlinable public func createBidirectionalStream() -> JSPromise { - let this = jsObject - return this[Strings.createBidirectionalStream].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func createBidirectionalStream() async throws -> WebTransportBidirectionalStream { - let this = jsObject - let _promise: JSPromise = this[Strings.createBidirectionalStream].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var incomingBidirectionalStreams: ReadableStream - - @inlinable public func createUnidirectionalStream() -> JSPromise { - let this = jsObject - return this[Strings.createUnidirectionalStream].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func createUnidirectionalStream() async throws -> WritableStream { - let this = jsObject - let _promise: JSPromise = this[Strings.createUnidirectionalStream].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var incomingUnidirectionalStreams: ReadableStream -} diff --git a/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift b/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift deleted file mode 100644 index 113622c6..00000000 --- a/Sources/DOMKit/WebIDL/WebTransportBidirectionalStream.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebTransportBidirectionalStream: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebTransportBidirectionalStream].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 - } - - @ReadonlyAttribute - public var readable: ReadableStream - - @ReadonlyAttribute - public var writable: WritableStream -} diff --git a/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift b/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift deleted file mode 100644 index 65ef2ca0..00000000 --- a/Sources/DOMKit/WebIDL/WebTransportCloseInfo.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebTransportCloseInfo: BridgedDictionary { - public convenience init(closeCode: UInt32, reason: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.closeCode] = closeCode.jsValue - object[Strings.reason] = reason.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _closeCode = ReadWriteAttribute(jsObject: object, name: Strings.closeCode) - _reason = ReadWriteAttribute(jsObject: object, name: Strings.reason) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var closeCode: UInt32 - - @ReadWriteAttribute - public var reason: String -} diff --git a/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift b/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift deleted file mode 100644 index 0b0ae6fd..00000000 --- a/Sources/DOMKit/WebIDL/WebTransportDatagramDuplexStream.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebTransportDatagramDuplexStream: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebTransportDatagramDuplexStream].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) - _maxDatagramSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.maxDatagramSize) - _incomingMaxAge = ReadWriteAttribute(jsObject: jsObject, name: Strings.incomingMaxAge) - _outgoingMaxAge = ReadWriteAttribute(jsObject: jsObject, name: Strings.outgoingMaxAge) - _incomingHighWaterMark = ReadWriteAttribute(jsObject: jsObject, name: Strings.incomingHighWaterMark) - _outgoingHighWaterMark = ReadWriteAttribute(jsObject: jsObject, name: Strings.outgoingHighWaterMark) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var readable: ReadableStream - - @ReadonlyAttribute - public var writable: WritableStream - - @ReadonlyAttribute - public var maxDatagramSize: UInt32 - - @ReadWriteAttribute - public var incomingMaxAge: Double? - - @ReadWriteAttribute - public var outgoingMaxAge: Double? - - @ReadWriteAttribute - public var incomingHighWaterMark: Int32 - - @ReadWriteAttribute - public var outgoingHighWaterMark: Int32 -} diff --git a/Sources/DOMKit/WebIDL/WebTransportError.swift b/Sources/DOMKit/WebIDL/WebTransportError.swift deleted file mode 100644 index 7e2a576d..00000000 --- a/Sources/DOMKit/WebIDL/WebTransportError.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebTransportError: DOMException { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebTransportError].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) - _streamErrorCode = ReadonlyAttribute(jsObject: jsObject, name: Strings.streamErrorCode) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(init: WebTransportErrorInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var source: WebTransportErrorSource - - @ReadonlyAttribute - public var streamErrorCode: UInt8? -} diff --git a/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift b/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift deleted file mode 100644 index e5467b1e..00000000 --- a/Sources/DOMKit/WebIDL/WebTransportErrorInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebTransportErrorInit: BridgedDictionary { - public convenience init(streamErrorCode: UInt8, message: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.streamErrorCode] = streamErrorCode.jsValue - object[Strings.message] = message.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _streamErrorCode = ReadWriteAttribute(jsObject: object, name: Strings.streamErrorCode) - _message = ReadWriteAttribute(jsObject: object, name: Strings.message) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var streamErrorCode: UInt8 - - @ReadWriteAttribute - public var message: String -} diff --git a/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift b/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift deleted file mode 100644 index 3c59aea4..00000000 --- a/Sources/DOMKit/WebIDL/WebTransportErrorSource.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum WebTransportErrorSource: JSString, JSValueCompatible { - case stream = "stream" - case session = "session" - - @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/WebTransportHash.swift b/Sources/DOMKit/WebIDL/WebTransportHash.swift deleted file mode 100644 index d79fba0b..00000000 --- a/Sources/DOMKit/WebIDL/WebTransportHash.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebTransportHash: BridgedDictionary { - public convenience init(algorithm: String, value: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.algorithm] = algorithm.jsValue - object[Strings.value] = value.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _algorithm = ReadWriteAttribute(jsObject: object, name: Strings.algorithm) - _value = ReadWriteAttribute(jsObject: object, name: Strings.value) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var algorithm: String - - @ReadWriteAttribute - public var value: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/WebTransportOptions.swift b/Sources/DOMKit/WebIDL/WebTransportOptions.swift deleted file mode 100644 index 072313f4..00000000 --- a/Sources/DOMKit/WebIDL/WebTransportOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebTransportOptions: BridgedDictionary { - public convenience init(allowPooling: Bool, serverCertificateHashes: [WebTransportHash]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.allowPooling] = allowPooling.jsValue - object[Strings.serverCertificateHashes] = serverCertificateHashes.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _allowPooling = ReadWriteAttribute(jsObject: object, name: Strings.allowPooling) - _serverCertificateHashes = ReadWriteAttribute(jsObject: object, name: Strings.serverCertificateHashes) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var allowPooling: Bool - - @ReadWriteAttribute - public var serverCertificateHashes: [WebTransportHash] -} diff --git a/Sources/DOMKit/WebIDL/WebTransportStats.swift b/Sources/DOMKit/WebIDL/WebTransportStats.swift deleted file mode 100644 index 5aba84a6..00000000 --- a/Sources/DOMKit/WebIDL/WebTransportStats.swift +++ /dev/null @@ -1,75 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebTransportStats: BridgedDictionary { - public convenience init(timestamp: DOMHighResTimeStamp, bytesSent: UInt64, packetsSent: UInt64, packetsLost: UInt64, numOutgoingStreamsCreated: UInt32, numIncomingStreamsCreated: UInt32, bytesReceived: UInt64, packetsReceived: UInt64, smoothedRtt: DOMHighResTimeStamp, rttVariation: DOMHighResTimeStamp, minRtt: DOMHighResTimeStamp, numReceivedDatagramsDropped: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.timestamp] = timestamp.jsValue - object[Strings.bytesSent] = bytesSent.jsValue - object[Strings.packetsSent] = packetsSent.jsValue - object[Strings.packetsLost] = packetsLost.jsValue - object[Strings.numOutgoingStreamsCreated] = numOutgoingStreamsCreated.jsValue - object[Strings.numIncomingStreamsCreated] = numIncomingStreamsCreated.jsValue - object[Strings.bytesReceived] = bytesReceived.jsValue - object[Strings.packetsReceived] = packetsReceived.jsValue - object[Strings.smoothedRtt] = smoothedRtt.jsValue - object[Strings.rttVariation] = rttVariation.jsValue - object[Strings.minRtt] = minRtt.jsValue - object[Strings.numReceivedDatagramsDropped] = numReceivedDatagramsDropped.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _bytesSent = ReadWriteAttribute(jsObject: object, name: Strings.bytesSent) - _packetsSent = ReadWriteAttribute(jsObject: object, name: Strings.packetsSent) - _packetsLost = ReadWriteAttribute(jsObject: object, name: Strings.packetsLost) - _numOutgoingStreamsCreated = ReadWriteAttribute(jsObject: object, name: Strings.numOutgoingStreamsCreated) - _numIncomingStreamsCreated = ReadWriteAttribute(jsObject: object, name: Strings.numIncomingStreamsCreated) - _bytesReceived = ReadWriteAttribute(jsObject: object, name: Strings.bytesReceived) - _packetsReceived = ReadWriteAttribute(jsObject: object, name: Strings.packetsReceived) - _smoothedRtt = ReadWriteAttribute(jsObject: object, name: Strings.smoothedRtt) - _rttVariation = ReadWriteAttribute(jsObject: object, name: Strings.rttVariation) - _minRtt = ReadWriteAttribute(jsObject: object, name: Strings.minRtt) - _numReceivedDatagramsDropped = ReadWriteAttribute(jsObject: object, name: Strings.numReceivedDatagramsDropped) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var timestamp: DOMHighResTimeStamp - - @ReadWriteAttribute - public var bytesSent: UInt64 - - @ReadWriteAttribute - public var packetsSent: UInt64 - - @ReadWriteAttribute - public var packetsLost: UInt64 - - @ReadWriteAttribute - public var numOutgoingStreamsCreated: UInt32 - - @ReadWriteAttribute - public var numIncomingStreamsCreated: UInt32 - - @ReadWriteAttribute - public var bytesReceived: UInt64 - - @ReadWriteAttribute - public var packetsReceived: UInt64 - - @ReadWriteAttribute - public var smoothedRtt: DOMHighResTimeStamp - - @ReadWriteAttribute - public var rttVariation: DOMHighResTimeStamp - - @ReadWriteAttribute - public var minRtt: DOMHighResTimeStamp - - @ReadWriteAttribute - public var numReceivedDatagramsDropped: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/WellKnownDirectory.swift b/Sources/DOMKit/WebIDL/WellKnownDirectory.swift deleted file mode 100644 index f33605cb..00000000 --- a/Sources/DOMKit/WebIDL/WellKnownDirectory.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum WellKnownDirectory: JSString, JSValueCompatible { - case desktop = "desktop" - case documents = "documents" - case downloads = "downloads" - case music = "music" - case pictures = "pictures" - case videos = "videos" - - @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/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index b3a15425..30d5e273 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -7,24 +7,6 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Window].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) - _onorientationchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onorientationchange) - _attributionReporting = ReadonlyAttribute(jsObject: jsObject, name: Strings.attributionReporting) - _cookieStore = ReadonlyAttribute(jsObject: jsObject, name: Strings.cookieStore) - _screen = ReadonlyAttribute(jsObject: jsObject, name: Strings.screen) - _innerWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.innerWidth) - _innerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.innerHeight) - _scrollX = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollX) - _pageXOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageXOffset) - _scrollY = ReadonlyAttribute(jsObject: jsObject, name: Strings.scrollY) - _pageYOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.pageYOffset) - _screenX = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenX) - _screenLeft = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenLeft) - _screenY = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenY) - _screenTop = ReadonlyAttribute(jsObject: jsObject, name: Strings.screenTop) - _outerWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.outerWidth) - _outerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.outerHeight) - _devicePixelRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.devicePixelRatio) _event = ReadonlyAttribute(jsObject: jsObject, name: Strings.event) _window = ReadonlyAttribute(jsObject: jsObject, name: Strings.window) _self = ReadonlyAttribute(jsObject: jsObject, name: Strings._self) @@ -51,189 +33,17 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind _clientInformation = ReadonlyAttribute(jsObject: jsObject, name: Strings.clientInformation) _originAgentCluster = ReadonlyAttribute(jsObject: jsObject, name: Strings.originAgentCluster) _external = ReadonlyAttribute(jsObject: jsObject, name: Strings.external) - _onappinstalled = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onappinstalled) - _onbeforeinstallprompt = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onbeforeinstallprompt) - _navigation = ReadonlyAttribute(jsObject: jsObject, name: Strings.navigation) - _ondeviceorientation = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondeviceorientation) - _ondeviceorientationabsolute = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondeviceorientationabsolute) - _oncompassneedscalibration = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncompassneedscalibration) - _ondevicemotion = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondevicemotion) - _portalHost = ReadonlyAttribute(jsObject: jsObject, name: Strings.portalHost) - _speechSynthesis = ReadonlyAttribute(jsObject: jsObject, name: Strings.speechSynthesis) - _visualViewport = ReadonlyAttribute(jsObject: jsObject, name: Strings.visualViewport) super.init(unsafelyWrapping: jsObject) } - @ReadonlyAttribute - public var orientation: Int16 - - @ClosureAttribute1Optional - public var onorientationchange: EventHandler - - @ReadonlyAttribute - public var attributionReporting: AttributionReporting - - @ReadonlyAttribute - public var cookieStore: CookieStore - - @inlinable public func navigate(dir: SpatialNavigationDirection) { - let this = jsObject - _ = this[Strings.navigate].function!(this: this, arguments: [dir.jsValue]) - } - - @inlinable public func matchMedia(query: String) -> MediaQueryList { - let this = jsObject - return this[Strings.matchMedia].function!(this: this, arguments: [query.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var screen: Screen - - @inlinable public func moveTo(x: Int32, y: Int32) { - let this = jsObject - _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } - - @inlinable public func moveBy(x: Int32, y: Int32) { - let this = jsObject - _ = this[Strings.moveBy].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } - - @inlinable public func resizeTo(width: Int32, height: Int32) { - let this = jsObject - _ = this[Strings.resizeTo].function!(this: this, arguments: [width.jsValue, height.jsValue]) - } - - @inlinable public func resizeBy(x: Int32, y: Int32) { - let this = jsObject - _ = this[Strings.resizeBy].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } - - @ReadonlyAttribute - public var innerWidth: Int32 - - @ReadonlyAttribute - public var innerHeight: Int32 - - @ReadonlyAttribute - public var scrollX: Double - - @ReadonlyAttribute - public var pageXOffset: Double - - @ReadonlyAttribute - public var scrollY: Double - - @ReadonlyAttribute - public var pageYOffset: Double - - @inlinable public func scroll(options: ScrollToOptions? = nil) { - let this = jsObject - _ = this[Strings.scroll].function!(this: this, arguments: [options?.jsValue ?? .undefined]) - } - - @inlinable public func scroll(x: Double, y: Double) { - let this = jsObject - _ = this[Strings.scroll].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } - - @inlinable public func scrollTo(options: ScrollToOptions? = nil) { - let this = jsObject - _ = this[Strings.scrollTo].function!(this: this, arguments: [options?.jsValue ?? .undefined]) - } - - @inlinable public func scrollTo(x: Double, y: Double) { - let this = jsObject - _ = this[Strings.scrollTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } - - @inlinable public func scrollBy(options: ScrollToOptions? = nil) { - let this = jsObject - _ = this[Strings.scrollBy].function!(this: this, arguments: [options?.jsValue ?? .undefined]) - } - - @inlinable public func scrollBy(x: Double, y: Double) { - let this = jsObject - _ = this[Strings.scrollBy].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } - - @ReadonlyAttribute - public var screenX: Int32 - - @ReadonlyAttribute - public var screenLeft: Int32 - - @ReadonlyAttribute - public var screenY: Int32 - - @ReadonlyAttribute - public var screenTop: Int32 - - @ReadonlyAttribute - public var outerWidth: Int32 - - @ReadonlyAttribute - public var outerHeight: Int32 - - @ReadonlyAttribute - public var devicePixelRatio: Double - @inlinable public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { let this = jsObject return this[Strings.getComputedStyle].function!(this: this, arguments: [elt.jsValue, pseudoElt?.jsValue ?? .undefined]).fromJSValue()! } - @inlinable public func getDigitalGoodsService(serviceProvider: String) -> JSPromise { - let this = jsObject - return this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func getDigitalGoodsService(serviceProvider: String) async throws -> DigitalGoodsService { - let this = jsObject - let _promise: JSPromise = this[Strings.getDigitalGoodsService].function!(this: this, arguments: [serviceProvider.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - @ReadonlyAttribute public var event: Event? - @inlinable public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func showOpenFilePicker(options: OpenFilePickerOptions? = nil) async throws -> [FileSystemFileHandle] { - let this = jsObject - let _promise: JSPromise = this[Strings.showOpenFilePicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func showSaveFilePicker(options: SaveFilePickerOptions? = nil) async throws -> FileSystemFileHandle { - let this = jsObject - let _promise: JSPromise = this[Strings.showSaveFilePicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func showDirectoryPicker(options: DirectoryPickerOptions? = nil) async throws -> FileSystemDirectoryHandle { - let this = jsObject - let _promise: JSPromise = this[Strings.showDirectoryPicker].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - @ReadonlyAttribute public var window: WindowProxy @@ -382,46 +192,4 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind @ReadonlyAttribute public var external: External - - @ClosureAttribute1Optional - public var onappinstalled: EventHandler - - @ClosureAttribute1Optional - public var onbeforeinstallprompt: EventHandler - - @ReadonlyAttribute - public var navigation: Navigation - - @ClosureAttribute1Optional - public var ondeviceorientation: EventHandler - - @ClosureAttribute1Optional - public var ondeviceorientationabsolute: EventHandler - - @ClosureAttribute1Optional - public var oncompassneedscalibration: EventHandler - - @ClosureAttribute1Optional - public var ondevicemotion: EventHandler - - @ReadonlyAttribute - public var portalHost: PortalHost? - - // XXX: member 'requestIdleCallback' is ignored - - @inlinable public func cancelIdleCallback(handle: UInt32) { - let this = jsObject - _ = this[Strings.cancelIdleCallback].function!(this: this, arguments: [handle.jsValue]) - } - - @inlinable public func getSelection() -> Selection? { - let this = jsObject - return this[Strings.getSelection].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var speechSynthesis: SpeechSynthesis - - @ReadonlyAttribute - public var visualViewport: VisualViewport } diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift deleted file mode 100644 index cec15a74..00000000 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlay.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WindowControlsOverlay: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WindowControlsOverlay].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _visible = ReadonlyAttribute(jsObject: jsObject, name: Strings.visible) - _ongeometrychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ongeometrychange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var visible: Bool - - @inlinable public func getTitlebarAreaRect() -> DOMRect { - let this = jsObject - return this[Strings.getTitlebarAreaRect].function!(this: this, arguments: []).fromJSValue()! - } - - @ClosureAttribute1Optional - public var ongeometrychange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift deleted file mode 100644 index 8f180156..00000000 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WindowControlsOverlayGeometryChangeEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WindowControlsOverlayGeometryChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _titlebarAreaRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.titlebarAreaRect) - _visible = ReadonlyAttribute(jsObject: jsObject, name: Strings.visible) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: WindowControlsOverlayGeometryChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var titlebarAreaRect: DOMRect - - @ReadonlyAttribute - public var visible: Bool -} diff --git a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift b/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift deleted file mode 100644 index d6df0bf0..00000000 --- a/Sources/DOMKit/WebIDL/WindowControlsOverlayGeometryChangeEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WindowControlsOverlayGeometryChangeEventInit: BridgedDictionary { - public convenience init(titlebarAreaRect: DOMRect, visible: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.titlebarAreaRect] = titlebarAreaRect.jsValue - object[Strings.visible] = visible.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _titlebarAreaRect = ReadWriteAttribute(jsObject: object, name: Strings.titlebarAreaRect) - _visible = ReadWriteAttribute(jsObject: object, name: Strings.visible) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var titlebarAreaRect: DOMRect - - @ReadWriteAttribute - public var visible: Bool -} diff --git a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift index 4f7d1d61..53bf2dc3 100644 --- a/Sources/DOMKit/WebIDL/WindowEventHandlers.swift +++ b/Sources/DOMKit/WebIDL/WindowEventHandlers.swift @@ -5,16 +5,6 @@ import JavaScriptKit public protocol WindowEventHandlers: JSBridgedClass {} public extension WindowEventHandlers { - @inlinable var ongamepadconnected: EventHandler { - get { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] = newValue } - } - - @inlinable var ongamepaddisconnected: EventHandler { - get { ClosureAttribute1Optional[Strings.ongamepaddisconnected, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.ongamepaddisconnected, in: jsObject] = newValue } - } - @inlinable var onafterprint: EventHandler { get { ClosureAttribute1Optional[Strings.onafterprint, in: jsObject] } nonmutating set { ClosureAttribute1Optional[Strings.onafterprint, in: jsObject] = newValue } @@ -94,9 +84,4 @@ public extension WindowEventHandlers { get { ClosureAttribute1Optional[Strings.onunload, in: jsObject] } nonmutating set { ClosureAttribute1Optional[Strings.onunload, in: jsObject] = newValue } } - - @inlinable var onportalactivate: EventHandler { - get { ClosureAttribute1Optional[Strings.onportalactivate, in: jsObject] } - nonmutating set { ClosureAttribute1Optional[Strings.onportalactivate, in: jsObject] = newValue } - } } diff --git a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift index 4c116857..d94fd8fa 100644 --- a/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift +++ b/Sources/DOMKit/WebIDL/WindowOrWorkerGlobalScope.swift @@ -5,10 +5,6 @@ import JavaScriptKit public protocol WindowOrWorkerGlobalScope: JSBridgedClass {} public extension WindowOrWorkerGlobalScope { - @inlinable var indexedDB: IDBFactory { ReadonlyAttribute[Strings.indexedDB, in: jsObject] } - - @inlinable var crypto: Crypto { ReadonlyAttribute[Strings.crypto, in: jsObject] } - @inlinable func fetch(input: RequestInfo, init: RequestInit? = nil) -> JSPromise { let this = jsObject return this[Strings.fetch].function!(this: this, arguments: [input.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! @@ -21,8 +17,6 @@ public extension WindowOrWorkerGlobalScope { return try await _promise.value.fromJSValue()! } - @inlinable var performance: Performance { ReadonlyAttribute[Strings.performance, in: jsObject] } - @inlinable var origin: String { ReadonlyAttribute[Strings.origin, in: jsObject] } @inlinable var isSecureContext: Bool { ReadonlyAttribute[Strings.isSecureContext, in: jsObject] } @@ -107,11 +101,7 @@ public extension WindowOrWorkerGlobalScope { return this[Strings.structuredClone].function!(this: this, arguments: [value.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } - @inlinable var originPolicyIds: [String] { ReadonlyAttribute[Strings.originPolicyIds, in: jsObject] } - - @inlinable var scheduler: Scheduler { ReadonlyAttribute[Strings.scheduler, in: jsObject] } + @inlinable var performance: Performance { ReadonlyAttribute[Strings.performance, in: jsObject] } @inlinable var caches: CacheStorage { ReadonlyAttribute[Strings.caches, in: jsObject] } - - @inlinable var trustedTypes: TrustedTypePolicyFactory { ReadonlyAttribute[Strings.trustedTypes, in: jsObject] } } diff --git a/Sources/DOMKit/WebIDL/WorkletAnimation.swift b/Sources/DOMKit/WebIDL/WorkletAnimation.swift deleted file mode 100644 index ada0c24e..00000000 --- a/Sources/DOMKit/WebIDL/WorkletAnimation.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WorkletAnimation: Animation { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WorkletAnimation].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _animatorName = ReadonlyAttribute(jsObject: jsObject, name: Strings.animatorName) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(animatorName: String, effects: AnimationEffect_or_seq_of_AnimationEffect? = nil, timeline: AnimationTimeline? = nil, options: JSValue? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [animatorName.jsValue, effects?.jsValue ?? .undefined, timeline?.jsValue ?? .undefined, options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var animatorName: String -} diff --git a/Sources/DOMKit/WebIDL/WriteCommandType.swift b/Sources/DOMKit/WebIDL/WriteCommandType.swift deleted file mode 100644 index c6b802be..00000000 --- a/Sources/DOMKit/WebIDL/WriteCommandType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum WriteCommandType: JSString, JSValueCompatible { - case write = "write" - case seek = "seek" - case truncate = "truncate" - - @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/WriteParams.swift b/Sources/DOMKit/WebIDL/WriteParams.swift deleted file mode 100644 index e612a1c1..00000000 --- a/Sources/DOMKit/WebIDL/WriteParams.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WriteParams: BridgedDictionary { - public convenience init(type: WriteCommandType, size: UInt64?, position: UInt64?, data: Blob_or_BufferSource_or_String?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.size] = size.jsValue - object[Strings.position] = position.jsValue - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _size = ReadWriteAttribute(jsObject: object, name: Strings.size) - _position = ReadWriteAttribute(jsObject: object, name: Strings.position) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: WriteCommandType - - @ReadWriteAttribute - public var size: UInt64? - - @ReadWriteAttribute - public var position: UInt64? - - @ReadWriteAttribute - public var data: Blob_or_BufferSource_or_String? -} diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift index 33a98489..a30fb7ea 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift @@ -15,7 +15,7 @@ public enum XMLHttpRequestBodyInit: JSValueCompatible, Any_XMLHttpRequestBodyIni case bufferSource(BufferSource) case formData(FormData) case string(String) - case uRLSearchParams(URLSearchParams) + case urlSearchParams(URLSearchParams) public static func construct(from value: JSValue) -> Self? { if let blob: Blob = value.fromJSValue() { @@ -30,8 +30,8 @@ public enum XMLHttpRequestBodyInit: JSValueCompatible, Any_XMLHttpRequestBodyIni if let string: String = value.fromJSValue() { return .string(string) } - if let uRLSearchParams: URLSearchParams = value.fromJSValue() { - return .uRLSearchParams(uRLSearchParams) + if let urlSearchParams: URLSearchParams = value.fromJSValue() { + return .urlSearchParams(urlSearchParams) } return nil } @@ -46,8 +46,8 @@ public enum XMLHttpRequestBodyInit: JSValueCompatible, Any_XMLHttpRequestBodyIni return formData.jsValue case let .string(string): return string.jsValue - case let .uRLSearchParams(uRLSearchParams): - return uRLSearchParams.jsValue + case let .urlSearchParams(urlSearchParams): + return urlSearchParams.jsValue } } } diff --git a/Sources/DOMKit/WebIDL/XMLSerializer.swift b/Sources/DOMKit/WebIDL/XMLSerializer.swift deleted file mode 100644 index d13cf486..00000000 --- a/Sources/DOMKit/WebIDL/XMLSerializer.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XMLSerializer: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XMLSerializer].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @inlinable public func serializeToString(root: Node) -> String { - let this = jsObject - return this[Strings.serializeToString].function!(this: this, arguments: [root.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/XRAnchor.swift b/Sources/DOMKit/WebIDL/XRAnchor.swift deleted file mode 100644 index 95dc991b..00000000 --- a/Sources/DOMKit/WebIDL/XRAnchor.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRAnchor: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRAnchor].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _anchorSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchorSpace) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var anchorSpace: XRSpace - - @inlinable public func delete() { - let this = jsObject - _ = this[Strings.delete].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/XRAnchorSet.swift b/Sources/DOMKit/WebIDL/XRAnchorSet.swift deleted file mode 100644 index f069fecb..00000000 --- a/Sources/DOMKit/WebIDL/XRAnchorSet.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRAnchorSet: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRAnchorSet].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - // XXX: make me Set-like! -} diff --git a/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift b/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift deleted file mode 100644 index 7ddd390a..00000000 --- a/Sources/DOMKit/WebIDL/XRBoundedReferenceSpace.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRBoundedReferenceSpace: XRReferenceSpace { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRBoundedReferenceSpace].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _boundsGeometry = ReadonlyAttribute(jsObject: jsObject, name: Strings.boundsGeometry) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var boundsGeometry: [DOMPointReadOnly] -} diff --git a/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift b/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift deleted file mode 100644 index 26177977..00000000 --- a/Sources/DOMKit/WebIDL/XRCPUDepthInformation.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRCPUDepthInformation: XRDepthInformation { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRCPUDepthInformation].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var data: ArrayBuffer - - @inlinable public func getDepthInMeters(x: Float, y: Float) -> Float { - let this = jsObject - return this[Strings.getDepthInMeters].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/XRCompositionLayer.swift b/Sources/DOMKit/WebIDL/XRCompositionLayer.swift deleted file mode 100644 index 3c05260f..00000000 --- a/Sources/DOMKit/WebIDL/XRCompositionLayer.swift +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRCompositionLayer: XRLayer { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRCompositionLayer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _layout = ReadonlyAttribute(jsObject: jsObject, name: Strings.layout) - _blendTextureSourceAlpha = ReadWriteAttribute(jsObject: jsObject, name: Strings.blendTextureSourceAlpha) - _chromaticAberrationCorrection = ReadWriteAttribute(jsObject: jsObject, name: Strings.chromaticAberrationCorrection) - _mipLevels = ReadonlyAttribute(jsObject: jsObject, name: Strings.mipLevels) - _needsRedraw = ReadonlyAttribute(jsObject: jsObject, name: Strings.needsRedraw) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var layout: XRLayerLayout - - @ReadWriteAttribute - public var blendTextureSourceAlpha: Bool - - @ReadWriteAttribute - public var chromaticAberrationCorrection: Bool? - - @ReadonlyAttribute - public var mipLevels: UInt32 - - @ReadonlyAttribute - public var needsRedraw: Bool - - @inlinable public func destroy() { - let this = jsObject - _ = this[Strings.destroy].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/XRCubeLayer.swift b/Sources/DOMKit/WebIDL/XRCubeLayer.swift deleted file mode 100644 index 38a39794..00000000 --- a/Sources/DOMKit/WebIDL/XRCubeLayer.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRCubeLayer: XRCompositionLayer { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRCubeLayer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) - _orientation = ReadWriteAttribute(jsObject: jsObject, name: Strings.orientation) - _onredraw = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onredraw) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var space: XRSpace - - @ReadWriteAttribute - public var orientation: DOMPointReadOnly - - @ClosureAttribute1Optional - public var onredraw: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift b/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift deleted file mode 100644 index c12e3fdb..00000000 --- a/Sources/DOMKit/WebIDL/XRCubeLayerInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRCubeLayerInit: BridgedDictionary { - public convenience init(orientation: DOMPointReadOnly?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.orientation] = orientation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _orientation = ReadWriteAttribute(jsObject: object, name: Strings.orientation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var orientation: DOMPointReadOnly? -} diff --git a/Sources/DOMKit/WebIDL/XRCylinderLayer.swift b/Sources/DOMKit/WebIDL/XRCylinderLayer.swift deleted file mode 100644 index 182c74e3..00000000 --- a/Sources/DOMKit/WebIDL/XRCylinderLayer.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRCylinderLayer: XRCompositionLayer { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRCylinderLayer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) - _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) - _radius = ReadWriteAttribute(jsObject: jsObject, name: Strings.radius) - _centralAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.centralAngle) - _aspectRatio = ReadWriteAttribute(jsObject: jsObject, name: Strings.aspectRatio) - _onredraw = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onredraw) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var space: XRSpace - - @ReadWriteAttribute - public var transform: XRRigidTransform - - @ReadWriteAttribute - public var radius: Float - - @ReadWriteAttribute - public var centralAngle: Float - - @ReadWriteAttribute - public var aspectRatio: Float - - @ClosureAttribute1Optional - public var onredraw: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift b/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift deleted file mode 100644 index b5f4add7..00000000 --- a/Sources/DOMKit/WebIDL/XRCylinderLayerInit.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRCylinderLayerInit: BridgedDictionary { - public convenience init(textureType: XRTextureType, transform: XRRigidTransform?, radius: Float, centralAngle: Float, aspectRatio: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textureType] = textureType.jsValue - object[Strings.transform] = transform.jsValue - object[Strings.radius] = radius.jsValue - object[Strings.centralAngle] = centralAngle.jsValue - object[Strings.aspectRatio] = aspectRatio.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _textureType = ReadWriteAttribute(jsObject: object, name: Strings.textureType) - _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) - _radius = ReadWriteAttribute(jsObject: object, name: Strings.radius) - _centralAngle = ReadWriteAttribute(jsObject: object, name: Strings.centralAngle) - _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var textureType: XRTextureType - - @ReadWriteAttribute - public var transform: XRRigidTransform? - - @ReadWriteAttribute - public var radius: Float - - @ReadWriteAttribute - public var centralAngle: Float - - @ReadWriteAttribute - public var aspectRatio: Float -} diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift deleted file mode 100644 index 4d3dae89..00000000 --- a/Sources/DOMKit/WebIDL/XRDOMOverlayInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRDOMOverlayInit: BridgedDictionary { - public convenience init(root: Element) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.root] = root.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _root = ReadWriteAttribute(jsObject: object, name: Strings.root) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var root: Element -} diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift deleted file mode 100644 index 625c7ecb..00000000 --- a/Sources/DOMKit/WebIDL/XRDOMOverlayState.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRDOMOverlayState: BridgedDictionary { - public convenience init(type: XRDOMOverlayType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: XRDOMOverlayType -} diff --git a/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift b/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift deleted file mode 100644 index d394f0c9..00000000 --- a/Sources/DOMKit/WebIDL/XRDOMOverlayType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRDOMOverlayType: JSString, JSValueCompatible { - case screen = "screen" - case floating = "floating" - case headLocked = "head-locked" - - @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/XRDepthDataFormat.swift b/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift deleted file mode 100644 index 8a3c2645..00000000 --- a/Sources/DOMKit/WebIDL/XRDepthDataFormat.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRDepthDataFormat: JSString, JSValueCompatible { - case luminanceAlpha = "luminance-alpha" - case float32 = "float32" - - @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/XRDepthInformation.swift b/Sources/DOMKit/WebIDL/XRDepthInformation.swift deleted file mode 100644 index 5b411708..00000000 --- a/Sources/DOMKit/WebIDL/XRDepthInformation.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRDepthInformation: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRDepthInformation].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _normDepthBufferFromNormView = ReadonlyAttribute(jsObject: jsObject, name: Strings.normDepthBufferFromNormView) - _rawValueToMeters = ReadonlyAttribute(jsObject: jsObject, name: Strings.rawValueToMeters) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var width: UInt32 - - @ReadonlyAttribute - public var height: UInt32 - - @ReadonlyAttribute - public var normDepthBufferFromNormView: XRRigidTransform - - @ReadonlyAttribute - public var rawValueToMeters: Float -} diff --git a/Sources/DOMKit/WebIDL/XRDepthStateInit.swift b/Sources/DOMKit/WebIDL/XRDepthStateInit.swift deleted file mode 100644 index d8178c7c..00000000 --- a/Sources/DOMKit/WebIDL/XRDepthStateInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRDepthStateInit: BridgedDictionary { - public convenience init(usagePreference: [XRDepthUsage], dataFormatPreference: [XRDepthDataFormat]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.usagePreference] = usagePreference.jsValue - object[Strings.dataFormatPreference] = dataFormatPreference.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _usagePreference = ReadWriteAttribute(jsObject: object, name: Strings.usagePreference) - _dataFormatPreference = ReadWriteAttribute(jsObject: object, name: Strings.dataFormatPreference) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var usagePreference: [XRDepthUsage] - - @ReadWriteAttribute - public var dataFormatPreference: [XRDepthDataFormat] -} diff --git a/Sources/DOMKit/WebIDL/XRDepthUsage.swift b/Sources/DOMKit/WebIDL/XRDepthUsage.swift deleted file mode 100644 index 3b5a99d4..00000000 --- a/Sources/DOMKit/WebIDL/XRDepthUsage.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRDepthUsage: JSString, JSValueCompatible { - case cpuOptimized = "cpu-optimized" - case gpuOptimized = "gpu-optimized" - - @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/XREnvironmentBlendMode.swift b/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift deleted file mode 100644 index 81ff1a66..00000000 --- a/Sources/DOMKit/WebIDL/XREnvironmentBlendMode.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XREnvironmentBlendMode: JSString, JSValueCompatible { - case opaque = "opaque" - case alphaBlend = "alpha-blend" - case additive = "additive" - - @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/XREquirectLayer.swift b/Sources/DOMKit/WebIDL/XREquirectLayer.swift deleted file mode 100644 index a1638e39..00000000 --- a/Sources/DOMKit/WebIDL/XREquirectLayer.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XREquirectLayer: XRCompositionLayer { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XREquirectLayer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) - _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) - _radius = ReadWriteAttribute(jsObject: jsObject, name: Strings.radius) - _centralHorizontalAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.centralHorizontalAngle) - _upperVerticalAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.upperVerticalAngle) - _lowerVerticalAngle = ReadWriteAttribute(jsObject: jsObject, name: Strings.lowerVerticalAngle) - _onredraw = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onredraw) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var space: XRSpace - - @ReadWriteAttribute - public var transform: XRRigidTransform - - @ReadWriteAttribute - public var radius: Float - - @ReadWriteAttribute - public var centralHorizontalAngle: Float - - @ReadWriteAttribute - public var upperVerticalAngle: Float - - @ReadWriteAttribute - public var lowerVerticalAngle: Float - - @ClosureAttribute1Optional - public var onredraw: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift b/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift deleted file mode 100644 index 24b64452..00000000 --- a/Sources/DOMKit/WebIDL/XREquirectLayerInit.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XREquirectLayerInit: BridgedDictionary { - public convenience init(textureType: XRTextureType, transform: XRRigidTransform?, radius: Float, centralHorizontalAngle: Float, upperVerticalAngle: Float, lowerVerticalAngle: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textureType] = textureType.jsValue - object[Strings.transform] = transform.jsValue - object[Strings.radius] = radius.jsValue - object[Strings.centralHorizontalAngle] = centralHorizontalAngle.jsValue - object[Strings.upperVerticalAngle] = upperVerticalAngle.jsValue - object[Strings.lowerVerticalAngle] = lowerVerticalAngle.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _textureType = ReadWriteAttribute(jsObject: object, name: Strings.textureType) - _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) - _radius = ReadWriteAttribute(jsObject: object, name: Strings.radius) - _centralHorizontalAngle = ReadWriteAttribute(jsObject: object, name: Strings.centralHorizontalAngle) - _upperVerticalAngle = ReadWriteAttribute(jsObject: object, name: Strings.upperVerticalAngle) - _lowerVerticalAngle = ReadWriteAttribute(jsObject: object, name: Strings.lowerVerticalAngle) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var textureType: XRTextureType - - @ReadWriteAttribute - public var transform: XRRigidTransform? - - @ReadWriteAttribute - public var radius: Float - - @ReadWriteAttribute - public var centralHorizontalAngle: Float - - @ReadWriteAttribute - public var upperVerticalAngle: Float - - @ReadWriteAttribute - public var lowerVerticalAngle: Float -} diff --git a/Sources/DOMKit/WebIDL/XREye.swift b/Sources/DOMKit/WebIDL/XREye.swift deleted file mode 100644 index f5a41446..00000000 --- a/Sources/DOMKit/WebIDL/XREye.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XREye: JSString, JSValueCompatible { - case none = "none" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/XRFrame.swift b/Sources/DOMKit/WebIDL/XRFrame.swift deleted file mode 100644 index f3f0a6ef..00000000 --- a/Sources/DOMKit/WebIDL/XRFrame.swift +++ /dev/null @@ -1,83 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRFrame: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRFrame].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _trackedAnchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.trackedAnchors) - _session = ReadonlyAttribute(jsObject: jsObject, name: Strings.session) - _predictedDisplayTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.predictedDisplayTime) - self.jsObject = jsObject - } - - @inlinable public func createAnchor(pose: XRRigidTransform, space: XRSpace) -> JSPromise { - let this = jsObject - return this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue, space.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func createAnchor(pose: XRRigidTransform, space: XRSpace) async throws -> XRAnchor { - let this = jsObject - let _promise: JSPromise = this[Strings.createAnchor].function!(this: this, arguments: [pose.jsValue, space.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var trackedAnchors: XRAnchorSet - - @inlinable public func getDepthInformation(view: XRView) -> XRCPUDepthInformation? { - let this = jsObject - return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue]).fromJSValue()! - } - - @inlinable public func getJointPose(joint: XRJointSpace, baseSpace: XRSpace) -> XRJointPose? { - let this = jsObject - return this[Strings.getJointPose].function!(this: this, arguments: [joint.jsValue, baseSpace.jsValue]).fromJSValue()! - } - - @inlinable public func fillJointRadii(jointSpaces: [XRJointSpace], radii: Float32Array) -> Bool { - let this = jsObject - return this[Strings.fillJointRadii].function!(this: this, arguments: [jointSpaces.jsValue, radii.jsValue]).fromJSValue()! - } - - @inlinable public func fillPoses(spaces: [XRSpace], baseSpace: XRSpace, transforms: Float32Array) -> Bool { - let this = jsObject - return this[Strings.fillPoses].function!(this: this, arguments: [spaces.jsValue, baseSpace.jsValue, transforms.jsValue]).fromJSValue()! - } - - @inlinable public func getHitTestResults(hitTestSource: XRHitTestSource) -> [XRHitTestResult] { - let this = jsObject - return this[Strings.getHitTestResults].function!(this: this, arguments: [hitTestSource.jsValue]).fromJSValue()! - } - - @inlinable public func getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource) -> [XRTransientInputHitTestResult] { - let this = jsObject - return this[Strings.getHitTestResultsForTransientInput].function!(this: this, arguments: [hitTestSource.jsValue]).fromJSValue()! - } - - @inlinable public func getLightEstimate(lightProbe: XRLightProbe) -> XRLightEstimate? { - let this = jsObject - return this[Strings.getLightEstimate].function!(this: this, arguments: [lightProbe.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var session: XRSession - - @ReadonlyAttribute - public var predictedDisplayTime: DOMHighResTimeStamp - - @inlinable public func getViewerPose(referenceSpace: XRReferenceSpace) -> XRViewerPose? { - let this = jsObject - return this[Strings.getViewerPose].function!(this: this, arguments: [referenceSpace.jsValue]).fromJSValue()! - } - - @inlinable public func getPose(space: XRSpace, baseSpace: XRSpace) -> XRPose? { - let this = jsObject - return this[Strings.getPose].function!(this: this, arguments: [space.jsValue, baseSpace.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/XRHand.swift b/Sources/DOMKit/WebIDL/XRHand.swift deleted file mode 100644 index bd7b774f..00000000 --- a/Sources/DOMKit/WebIDL/XRHand.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRHand: JSBridgedClass, Sequence { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRHand].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) - self.jsObject = jsObject - } - - public typealias Element = XRHandJoint - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) - } - - @ReadonlyAttribute - public var size: UInt32 - - @inlinable public func get(key: XRHandJoint) -> XRJointSpace { - let this = jsObject - return this[Strings.get].function!(this: this, arguments: [key.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/XRHandJoint.swift b/Sources/DOMKit/WebIDL/XRHandJoint.swift deleted file mode 100644 index efa483d8..00000000 --- a/Sources/DOMKit/WebIDL/XRHandJoint.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRHandJoint: JSString, JSValueCompatible { - case wrist = "wrist" - case thumbMetacarpal = "thumb-metacarpal" - case thumbPhalanxProximal = "thumb-phalanx-proximal" - case thumbPhalanxDistal = "thumb-phalanx-distal" - case thumbTip = "thumb-tip" - case indexFingerMetacarpal = "index-finger-metacarpal" - case indexFingerPhalanxProximal = "index-finger-phalanx-proximal" - case indexFingerPhalanxIntermediate = "index-finger-phalanx-intermediate" - case indexFingerPhalanxDistal = "index-finger-phalanx-distal" - case indexFingerTip = "index-finger-tip" - case middleFingerMetacarpal = "middle-finger-metacarpal" - case middleFingerPhalanxProximal = "middle-finger-phalanx-proximal" - case middleFingerPhalanxIntermediate = "middle-finger-phalanx-intermediate" - case middleFingerPhalanxDistal = "middle-finger-phalanx-distal" - case middleFingerTip = "middle-finger-tip" - case ringFingerMetacarpal = "ring-finger-metacarpal" - case ringFingerPhalanxProximal = "ring-finger-phalanx-proximal" - case ringFingerPhalanxIntermediate = "ring-finger-phalanx-intermediate" - case ringFingerPhalanxDistal = "ring-finger-phalanx-distal" - case ringFingerTip = "ring-finger-tip" - case pinkyFingerMetacarpal = "pinky-finger-metacarpal" - case pinkyFingerPhalanxProximal = "pinky-finger-phalanx-proximal" - case pinkyFingerPhalanxIntermediate = "pinky-finger-phalanx-intermediate" - case pinkyFingerPhalanxDistal = "pinky-finger-phalanx-distal" - case pinkyFingerTip = "pinky-finger-tip" - - @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/XRHandedness.swift b/Sources/DOMKit/WebIDL/XRHandedness.swift deleted file mode 100644 index 804ac708..00000000 --- a/Sources/DOMKit/WebIDL/XRHandedness.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRHandedness: JSString, JSValueCompatible { - case none = "none" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift b/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift deleted file mode 100644 index 77306b09..00000000 --- a/Sources/DOMKit/WebIDL/XRHitTestOptionsInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRHitTestOptionsInit: BridgedDictionary { - public convenience init(space: XRSpace, entityTypes: [XRHitTestTrackableType], offsetRay: XRRay) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.space] = space.jsValue - object[Strings.entityTypes] = entityTypes.jsValue - object[Strings.offsetRay] = offsetRay.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _space = ReadWriteAttribute(jsObject: object, name: Strings.space) - _entityTypes = ReadWriteAttribute(jsObject: object, name: Strings.entityTypes) - _offsetRay = ReadWriteAttribute(jsObject: object, name: Strings.offsetRay) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var space: XRSpace - - @ReadWriteAttribute - public var entityTypes: [XRHitTestTrackableType] - - @ReadWriteAttribute - public var offsetRay: XRRay -} diff --git a/Sources/DOMKit/WebIDL/XRHitTestResult.swift b/Sources/DOMKit/WebIDL/XRHitTestResult.swift deleted file mode 100644 index ca741634..00000000 --- a/Sources/DOMKit/WebIDL/XRHitTestResult.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRHitTestResult: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRHitTestResult].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func createAnchor() -> JSPromise { - let this = jsObject - return this[Strings.createAnchor].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func createAnchor() async throws -> XRAnchor { - let this = jsObject - let _promise: JSPromise = this[Strings.createAnchor].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func getPose(baseSpace: XRSpace) -> XRPose? { - let this = jsObject - return this[Strings.getPose].function!(this: this, arguments: [baseSpace.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/XRHitTestSource.swift b/Sources/DOMKit/WebIDL/XRHitTestSource.swift deleted file mode 100644 index 0c28a0cb..00000000 --- a/Sources/DOMKit/WebIDL/XRHitTestSource.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRHitTestSource: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRHitTestSource].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func cancel() { - let this = jsObject - _ = this[Strings.cancel].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift b/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift deleted file mode 100644 index 4d14174c..00000000 --- a/Sources/DOMKit/WebIDL/XRHitTestTrackableType.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRHitTestTrackableType: JSString, JSValueCompatible { - case point = "point" - case plane = "plane" - case mesh = "mesh" - - @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/XRInputSource.swift b/Sources/DOMKit/WebIDL/XRInputSource.swift deleted file mode 100644 index e2714954..00000000 --- a/Sources/DOMKit/WebIDL/XRInputSource.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRInputSource: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRInputSource].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _gamepad = ReadonlyAttribute(jsObject: jsObject, name: Strings.gamepad) - _hand = ReadonlyAttribute(jsObject: jsObject, name: Strings.hand) - _handedness = ReadonlyAttribute(jsObject: jsObject, name: Strings.handedness) - _targetRayMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetRayMode) - _targetRaySpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.targetRaySpace) - _gripSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.gripSpace) - _profiles = ReadonlyAttribute(jsObject: jsObject, name: Strings.profiles) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var gamepad: Gamepad? - - @ReadonlyAttribute - public var hand: XRHand? - - @ReadonlyAttribute - public var handedness: XRHandedness - - @ReadonlyAttribute - public var targetRayMode: XRTargetRayMode - - @ReadonlyAttribute - public var targetRaySpace: XRSpace - - @ReadonlyAttribute - public var gripSpace: XRSpace? - - @ReadonlyAttribute - public var profiles: [String] -} diff --git a/Sources/DOMKit/WebIDL/XRInputSourceArray.swift b/Sources/DOMKit/WebIDL/XRInputSourceArray.swift deleted file mode 100644 index c727222a..00000000 --- a/Sources/DOMKit/WebIDL/XRInputSourceArray.swift +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRInputSourceArray: JSBridgedClass, Sequence { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourceArray].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - self.jsObject = jsObject - } - - public typealias Element = XRInputSource - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) - } - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> XRInputSource { - jsObject[key].fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift deleted file mode 100644 index c3a04521..00000000 --- a/Sources/DOMKit/WebIDL/XRInputSourceEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRInputSourceEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourceEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _frame = ReadonlyAttribute(jsObject: jsObject, name: Strings.frame) - _inputSource = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputSource) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: XRInputSourceEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var frame: XRFrame - - @ReadonlyAttribute - public var inputSource: XRInputSource -} diff --git a/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift b/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift deleted file mode 100644 index e35e9ac3..00000000 --- a/Sources/DOMKit/WebIDL/XRInputSourceEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRInputSourceEventInit: BridgedDictionary { - public convenience init(frame: XRFrame, inputSource: XRInputSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.frame] = frame.jsValue - object[Strings.inputSource] = inputSource.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _frame = ReadWriteAttribute(jsObject: object, name: Strings.frame) - _inputSource = ReadWriteAttribute(jsObject: object, name: Strings.inputSource) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var frame: XRFrame - - @ReadWriteAttribute - public var inputSource: XRInputSource -} diff --git a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift deleted file mode 100644 index c888ef75..00000000 --- a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEvent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRInputSourcesChangeEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRInputSourcesChangeEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _session = ReadonlyAttribute(jsObject: jsObject, name: Strings.session) - _added = ReadonlyAttribute(jsObject: jsObject, name: Strings.added) - _removed = ReadonlyAttribute(jsObject: jsObject, name: Strings.removed) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: XRInputSourcesChangeEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var session: XRSession - - @ReadonlyAttribute - public var added: [XRInputSource] - - @ReadonlyAttribute - public var removed: [XRInputSource] -} diff --git a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift b/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift deleted file mode 100644 index 341e506d..00000000 --- a/Sources/DOMKit/WebIDL/XRInputSourcesChangeEventInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRInputSourcesChangeEventInit: BridgedDictionary { - public convenience init(session: XRSession, added: [XRInputSource], removed: [XRInputSource]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.session] = session.jsValue - object[Strings.added] = added.jsValue - object[Strings.removed] = removed.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _session = ReadWriteAttribute(jsObject: object, name: Strings.session) - _added = ReadWriteAttribute(jsObject: object, name: Strings.added) - _removed = ReadWriteAttribute(jsObject: object, name: Strings.removed) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var session: XRSession - - @ReadWriteAttribute - public var added: [XRInputSource] - - @ReadWriteAttribute - public var removed: [XRInputSource] -} diff --git a/Sources/DOMKit/WebIDL/XRInteractionMode.swift b/Sources/DOMKit/WebIDL/XRInteractionMode.swift deleted file mode 100644 index c3bb2dba..00000000 --- a/Sources/DOMKit/WebIDL/XRInteractionMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRInteractionMode: JSString, JSValueCompatible { - case screenSpace = "screen-space" - case worldSpace = "world-space" - - @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/XRJointPose.swift b/Sources/DOMKit/WebIDL/XRJointPose.swift deleted file mode 100644 index 503adc0d..00000000 --- a/Sources/DOMKit/WebIDL/XRJointPose.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRJointPose: XRPose { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRJointPose].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _radius = ReadonlyAttribute(jsObject: jsObject, name: Strings.radius) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var radius: Float -} diff --git a/Sources/DOMKit/WebIDL/XRJointSpace.swift b/Sources/DOMKit/WebIDL/XRJointSpace.swift deleted file mode 100644 index 7afe8a8b..00000000 --- a/Sources/DOMKit/WebIDL/XRJointSpace.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRJointSpace: XRSpace { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRJointSpace].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _jointName = ReadonlyAttribute(jsObject: jsObject, name: Strings.jointName) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var jointName: XRHandJoint -} diff --git a/Sources/DOMKit/WebIDL/XRLayer.swift b/Sources/DOMKit/WebIDL/XRLayer.swift deleted file mode 100644 index 8fe6bd4e..00000000 --- a/Sources/DOMKit/WebIDL/XRLayer.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRLayer: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRLayer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/XRLayerEvent.swift b/Sources/DOMKit/WebIDL/XRLayerEvent.swift deleted file mode 100644 index ba2b056e..00000000 --- a/Sources/DOMKit/WebIDL/XRLayerEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRLayerEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRLayerEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _layer = ReadonlyAttribute(jsObject: jsObject, name: Strings.layer) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: XRLayerEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var layer: XRLayer -} diff --git a/Sources/DOMKit/WebIDL/XRLayerEventInit.swift b/Sources/DOMKit/WebIDL/XRLayerEventInit.swift deleted file mode 100644 index b5408f33..00000000 --- a/Sources/DOMKit/WebIDL/XRLayerEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRLayerEventInit: BridgedDictionary { - public convenience init(layer: XRLayer) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.layer] = layer.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _layer = ReadWriteAttribute(jsObject: object, name: Strings.layer) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var layer: XRLayer -} diff --git a/Sources/DOMKit/WebIDL/XRLayerInit.swift b/Sources/DOMKit/WebIDL/XRLayerInit.swift deleted file mode 100644 index 435e7e9f..00000000 --- a/Sources/DOMKit/WebIDL/XRLayerInit.swift +++ /dev/null @@ -1,55 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRLayerInit: BridgedDictionary { - public convenience init(space: XRSpace, colorFormat: GLenum, depthFormat: GLenum?, mipLevels: UInt32, viewPixelWidth: UInt32, viewPixelHeight: UInt32, layout: XRLayerLayout, isStatic: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.space] = space.jsValue - object[Strings.colorFormat] = colorFormat.jsValue - object[Strings.depthFormat] = depthFormat.jsValue - object[Strings.mipLevels] = mipLevels.jsValue - object[Strings.viewPixelWidth] = viewPixelWidth.jsValue - object[Strings.viewPixelHeight] = viewPixelHeight.jsValue - object[Strings.layout] = layout.jsValue - object[Strings.isStatic] = isStatic.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _space = ReadWriteAttribute(jsObject: object, name: Strings.space) - _colorFormat = ReadWriteAttribute(jsObject: object, name: Strings.colorFormat) - _depthFormat = ReadWriteAttribute(jsObject: object, name: Strings.depthFormat) - _mipLevels = ReadWriteAttribute(jsObject: object, name: Strings.mipLevels) - _viewPixelWidth = ReadWriteAttribute(jsObject: object, name: Strings.viewPixelWidth) - _viewPixelHeight = ReadWriteAttribute(jsObject: object, name: Strings.viewPixelHeight) - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - _isStatic = ReadWriteAttribute(jsObject: object, name: Strings.isStatic) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var space: XRSpace - - @ReadWriteAttribute - public var colorFormat: GLenum - - @ReadWriteAttribute - public var depthFormat: GLenum? - - @ReadWriteAttribute - public var mipLevels: UInt32 - - @ReadWriteAttribute - public var viewPixelWidth: UInt32 - - @ReadWriteAttribute - public var viewPixelHeight: UInt32 - - @ReadWriteAttribute - public var layout: XRLayerLayout - - @ReadWriteAttribute - public var isStatic: Bool -} diff --git a/Sources/DOMKit/WebIDL/XRLayerLayout.swift b/Sources/DOMKit/WebIDL/XRLayerLayout.swift deleted file mode 100644 index cd3f56ca..00000000 --- a/Sources/DOMKit/WebIDL/XRLayerLayout.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRLayerLayout: JSString, JSValueCompatible { - case `default` = "default" - case mono = "mono" - case stereo = "stereo" - case stereoLeftRight = "stereo-left-right" - case stereoTopBottom = "stereo-top-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 } -} diff --git a/Sources/DOMKit/WebIDL/XRLightEstimate.swift b/Sources/DOMKit/WebIDL/XRLightEstimate.swift deleted file mode 100644 index 0d104bc3..00000000 --- a/Sources/DOMKit/WebIDL/XRLightEstimate.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRLightEstimate: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRLightEstimate].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _sphericalHarmonicsCoefficients = ReadonlyAttribute(jsObject: jsObject, name: Strings.sphericalHarmonicsCoefficients) - _primaryLightDirection = ReadonlyAttribute(jsObject: jsObject, name: Strings.primaryLightDirection) - _primaryLightIntensity = ReadonlyAttribute(jsObject: jsObject, name: Strings.primaryLightIntensity) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var sphericalHarmonicsCoefficients: Float32Array - - @ReadonlyAttribute - public var primaryLightDirection: DOMPointReadOnly - - @ReadonlyAttribute - public var primaryLightIntensity: DOMPointReadOnly -} diff --git a/Sources/DOMKit/WebIDL/XRLightProbe.swift b/Sources/DOMKit/WebIDL/XRLightProbe.swift deleted file mode 100644 index dc5410e1..00000000 --- a/Sources/DOMKit/WebIDL/XRLightProbe.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRLightProbe: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRLightProbe].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _probeSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.probeSpace) - _onreflectionchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreflectionchange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var probeSpace: XRSpace - - @ClosureAttribute1Optional - public var onreflectionchange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/XRLightProbeInit.swift b/Sources/DOMKit/WebIDL/XRLightProbeInit.swift deleted file mode 100644 index 002e9501..00000000 --- a/Sources/DOMKit/WebIDL/XRLightProbeInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRLightProbeInit: BridgedDictionary { - public convenience init(reflectionFormat: XRReflectionFormat) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.reflectionFormat] = reflectionFormat.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _reflectionFormat = ReadWriteAttribute(jsObject: object, name: Strings.reflectionFormat) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var reflectionFormat: XRReflectionFormat -} diff --git a/Sources/DOMKit/WebIDL/XRMediaBinding.swift b/Sources/DOMKit/WebIDL/XRMediaBinding.swift deleted file mode 100644 index 06161ba3..00000000 --- a/Sources/DOMKit/WebIDL/XRMediaBinding.swift +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRMediaBinding: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRMediaBinding].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public convenience init(session: XRSession) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue])) - } - - @inlinable public func createQuadLayer(video: HTMLVideoElement, init: XRMediaQuadLayerInit? = nil) -> XRQuadLayer { - let this = jsObject - return this[Strings.createQuadLayer].function!(this: this, arguments: [video.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createCylinderLayer(video: HTMLVideoElement, init: XRMediaCylinderLayerInit? = nil) -> XRCylinderLayer { - let this = jsObject - return this[Strings.createCylinderLayer].function!(this: this, arguments: [video.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createEquirectLayer(video: HTMLVideoElement, init: XRMediaEquirectLayerInit? = nil) -> XREquirectLayer { - let this = jsObject - return this[Strings.createEquirectLayer].function!(this: this, arguments: [video.jsValue, `init`?.jsValue ?? .undefined]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift deleted file mode 100644 index 61f74bc8..00000000 --- a/Sources/DOMKit/WebIDL/XRMediaCylinderLayerInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRMediaCylinderLayerInit: BridgedDictionary { - public convenience init(transform: XRRigidTransform?, radius: Float, centralAngle: Float, aspectRatio: Float?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transform] = transform.jsValue - object[Strings.radius] = radius.jsValue - object[Strings.centralAngle] = centralAngle.jsValue - object[Strings.aspectRatio] = aspectRatio.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) - _radius = ReadWriteAttribute(jsObject: object, name: Strings.radius) - _centralAngle = ReadWriteAttribute(jsObject: object, name: Strings.centralAngle) - _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var transform: XRRigidTransform? - - @ReadWriteAttribute - public var radius: Float - - @ReadWriteAttribute - public var centralAngle: Float - - @ReadWriteAttribute - public var aspectRatio: Float? -} diff --git a/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift deleted file mode 100644 index 91d30fc0..00000000 --- a/Sources/DOMKit/WebIDL/XRMediaEquirectLayerInit.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRMediaEquirectLayerInit: BridgedDictionary { - public convenience init(transform: XRRigidTransform?, radius: Float, centralHorizontalAngle: Float, upperVerticalAngle: Float, lowerVerticalAngle: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transform] = transform.jsValue - object[Strings.radius] = radius.jsValue - object[Strings.centralHorizontalAngle] = centralHorizontalAngle.jsValue - object[Strings.upperVerticalAngle] = upperVerticalAngle.jsValue - object[Strings.lowerVerticalAngle] = lowerVerticalAngle.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) - _radius = ReadWriteAttribute(jsObject: object, name: Strings.radius) - _centralHorizontalAngle = ReadWriteAttribute(jsObject: object, name: Strings.centralHorizontalAngle) - _upperVerticalAngle = ReadWriteAttribute(jsObject: object, name: Strings.upperVerticalAngle) - _lowerVerticalAngle = ReadWriteAttribute(jsObject: object, name: Strings.lowerVerticalAngle) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var transform: XRRigidTransform? - - @ReadWriteAttribute - public var radius: Float - - @ReadWriteAttribute - public var centralHorizontalAngle: Float - - @ReadWriteAttribute - public var upperVerticalAngle: Float - - @ReadWriteAttribute - public var lowerVerticalAngle: Float -} diff --git a/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift deleted file mode 100644 index 2a6d6a0e..00000000 --- a/Sources/DOMKit/WebIDL/XRMediaLayerInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRMediaLayerInit: BridgedDictionary { - public convenience init(space: XRSpace, layout: XRLayerLayout, invertStereo: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.space] = space.jsValue - object[Strings.layout] = layout.jsValue - object[Strings.invertStereo] = invertStereo.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _space = ReadWriteAttribute(jsObject: object, name: Strings.space) - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - _invertStereo = ReadWriteAttribute(jsObject: object, name: Strings.invertStereo) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var space: XRSpace - - @ReadWriteAttribute - public var layout: XRLayerLayout - - @ReadWriteAttribute - public var invertStereo: Bool -} diff --git a/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift b/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift deleted file mode 100644 index 60142942..00000000 --- a/Sources/DOMKit/WebIDL/XRMediaQuadLayerInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRMediaQuadLayerInit: BridgedDictionary { - public convenience init(transform: XRRigidTransform?, width: Float?, height: Float?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.transform] = transform.jsValue - object[Strings.width] = width.jsValue - object[Strings.height] = height.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) - _width = ReadWriteAttribute(jsObject: object, name: Strings.width) - _height = ReadWriteAttribute(jsObject: object, name: Strings.height) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var transform: XRRigidTransform? - - @ReadWriteAttribute - public var width: Float? - - @ReadWriteAttribute - public var height: Float? -} diff --git a/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift deleted file mode 100644 index c7e0efbc..00000000 --- a/Sources/DOMKit/WebIDL/XRPermissionDescriptor.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRPermissionDescriptor: BridgedDictionary { - public convenience init(mode: XRSessionMode, requiredFeatures: [JSValue], optionalFeatures: [JSValue]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.mode] = mode.jsValue - object[Strings.requiredFeatures] = requiredFeatures.jsValue - object[Strings.optionalFeatures] = optionalFeatures.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode) - _requiredFeatures = ReadWriteAttribute(jsObject: object, name: Strings.requiredFeatures) - _optionalFeatures = ReadWriteAttribute(jsObject: object, name: Strings.optionalFeatures) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var mode: XRSessionMode - - @ReadWriteAttribute - public var requiredFeatures: [JSValue] - - @ReadWriteAttribute - public var optionalFeatures: [JSValue] -} diff --git a/Sources/DOMKit/WebIDL/XRPermissionStatus.swift b/Sources/DOMKit/WebIDL/XRPermissionStatus.swift deleted file mode 100644 index 1be8ea8c..00000000 --- a/Sources/DOMKit/WebIDL/XRPermissionStatus.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRPermissionStatus: PermissionStatus { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRPermissionStatus].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _granted = ReadWriteAttribute(jsObject: jsObject, name: Strings.granted) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var granted: [JSValue] -} diff --git a/Sources/DOMKit/WebIDL/XRPose.swift b/Sources/DOMKit/WebIDL/XRPose.swift deleted file mode 100644 index 242f60c5..00000000 --- a/Sources/DOMKit/WebIDL/XRPose.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRPose: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRPose].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) - _linearVelocity = ReadonlyAttribute(jsObject: jsObject, name: Strings.linearVelocity) - _angularVelocity = ReadonlyAttribute(jsObject: jsObject, name: Strings.angularVelocity) - _emulatedPosition = ReadonlyAttribute(jsObject: jsObject, name: Strings.emulatedPosition) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var transform: XRRigidTransform - - @ReadonlyAttribute - public var linearVelocity: DOMPointReadOnly? - - @ReadonlyAttribute - public var angularVelocity: DOMPointReadOnly? - - @ReadonlyAttribute - public var emulatedPosition: Bool -} diff --git a/Sources/DOMKit/WebIDL/XRProjectionLayer.swift b/Sources/DOMKit/WebIDL/XRProjectionLayer.swift deleted file mode 100644 index 81431750..00000000 --- a/Sources/DOMKit/WebIDL/XRProjectionLayer.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRProjectionLayer: XRCompositionLayer { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRProjectionLayer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _textureWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureWidth) - _textureHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureHeight) - _textureArrayLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureArrayLength) - _ignoreDepthValues = ReadonlyAttribute(jsObject: jsObject, name: Strings.ignoreDepthValues) - _fixedFoveation = ReadWriteAttribute(jsObject: jsObject, name: Strings.fixedFoveation) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var textureWidth: UInt32 - - @ReadonlyAttribute - public var textureHeight: UInt32 - - @ReadonlyAttribute - public var textureArrayLength: UInt32 - - @ReadonlyAttribute - public var ignoreDepthValues: Bool - - @ReadWriteAttribute - public var fixedFoveation: Float? -} diff --git a/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift b/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift deleted file mode 100644 index 1c5bca0f..00000000 --- a/Sources/DOMKit/WebIDL/XRProjectionLayerInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRProjectionLayerInit: BridgedDictionary { - public convenience init(textureType: XRTextureType, colorFormat: GLenum, depthFormat: GLenum, scaleFactor: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textureType] = textureType.jsValue - object[Strings.colorFormat] = colorFormat.jsValue - object[Strings.depthFormat] = depthFormat.jsValue - object[Strings.scaleFactor] = scaleFactor.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _textureType = ReadWriteAttribute(jsObject: object, name: Strings.textureType) - _colorFormat = ReadWriteAttribute(jsObject: object, name: Strings.colorFormat) - _depthFormat = ReadWriteAttribute(jsObject: object, name: Strings.depthFormat) - _scaleFactor = ReadWriteAttribute(jsObject: object, name: Strings.scaleFactor) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var textureType: XRTextureType - - @ReadWriteAttribute - public var colorFormat: GLenum - - @ReadWriteAttribute - public var depthFormat: GLenum - - @ReadWriteAttribute - public var scaleFactor: Double -} diff --git a/Sources/DOMKit/WebIDL/XRQuadLayer.swift b/Sources/DOMKit/WebIDL/XRQuadLayer.swift deleted file mode 100644 index 8a3b147c..00000000 --- a/Sources/DOMKit/WebIDL/XRQuadLayer.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRQuadLayer: XRCompositionLayer { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRQuadLayer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _space = ReadWriteAttribute(jsObject: jsObject, name: Strings.space) - _transform = ReadWriteAttribute(jsObject: jsObject, name: Strings.transform) - _width = ReadWriteAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadWriteAttribute(jsObject: jsObject, name: Strings.height) - _onredraw = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onredraw) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var space: XRSpace - - @ReadWriteAttribute - public var transform: XRRigidTransform - - @ReadWriteAttribute - public var width: Float - - @ReadWriteAttribute - public var height: Float - - @ClosureAttribute1Optional - public var onredraw: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift b/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift deleted file mode 100644 index 2f8c83ec..00000000 --- a/Sources/DOMKit/WebIDL/XRQuadLayerInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRQuadLayerInit: BridgedDictionary { - public convenience init(textureType: XRTextureType, transform: XRRigidTransform?, width: Float, height: Float) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.textureType] = textureType.jsValue - object[Strings.transform] = transform.jsValue - object[Strings.width] = width.jsValue - object[Strings.height] = height.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _textureType = ReadWriteAttribute(jsObject: object, name: Strings.textureType) - _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) - _width = ReadWriteAttribute(jsObject: object, name: Strings.width) - _height = ReadWriteAttribute(jsObject: object, name: Strings.height) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var textureType: XRTextureType - - @ReadWriteAttribute - public var transform: XRRigidTransform? - - @ReadWriteAttribute - public var width: Float - - @ReadWriteAttribute - public var height: Float -} diff --git a/Sources/DOMKit/WebIDL/XRRay.swift b/Sources/DOMKit/WebIDL/XRRay.swift deleted file mode 100644 index 7d4d2509..00000000 --- a/Sources/DOMKit/WebIDL/XRRay.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRRay: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRRay].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _origin = ReadonlyAttribute(jsObject: jsObject, name: Strings.origin) - _direction = ReadonlyAttribute(jsObject: jsObject, name: Strings.direction) - _matrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.matrix) - self.jsObject = jsObject - } - - @inlinable public convenience init(origin: DOMPointInit? = nil, direction: XRRayDirectionInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [origin?.jsValue ?? .undefined, direction?.jsValue ?? .undefined])) - } - - @inlinable public convenience init(transform: XRRigidTransform) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [transform.jsValue])) - } - - @ReadonlyAttribute - public var origin: DOMPointReadOnly - - @ReadonlyAttribute - public var direction: DOMPointReadOnly - - @ReadonlyAttribute - public var matrix: Float32Array -} diff --git a/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift b/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift deleted file mode 100644 index 80f39144..00000000 --- a/Sources/DOMKit/WebIDL/XRRayDirectionInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRRayDirectionInit: BridgedDictionary { - public convenience init(x: Double, y: Double, z: Double, w: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.x] = x.jsValue - object[Strings.y] = y.jsValue - object[Strings.z] = z.jsValue - object[Strings.w] = w.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _x = ReadWriteAttribute(jsObject: object, name: Strings.x) - _y = ReadWriteAttribute(jsObject: object, name: Strings.y) - _z = ReadWriteAttribute(jsObject: object, name: Strings.z) - _w = ReadWriteAttribute(jsObject: object, name: Strings.w) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var x: Double - - @ReadWriteAttribute - public var y: Double - - @ReadWriteAttribute - public var z: Double - - @ReadWriteAttribute - public var w: Double -} diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift b/Sources/DOMKit/WebIDL/XRReferenceSpace.swift deleted file mode 100644 index 29be4cfe..00000000 --- a/Sources/DOMKit/WebIDL/XRReferenceSpace.swift +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRReferenceSpace: XRSpace { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRReferenceSpace].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _onreset = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onreset) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func getOffsetReferenceSpace(originOffset: XRRigidTransform) -> Self { - let this = jsObject - return this[Strings.getOffsetReferenceSpace].function!(this: this, arguments: [originOffset.jsValue]).fromJSValue()! - } - - @ClosureAttribute1Optional - public var onreset: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift deleted file mode 100644 index 59ffdd0d..00000000 --- a/Sources/DOMKit/WebIDL/XRReferenceSpaceEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRReferenceSpaceEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRReferenceSpaceEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _referenceSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.referenceSpace) - _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: XRReferenceSpaceEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var referenceSpace: XRReferenceSpace - - @ReadonlyAttribute - public var transform: XRRigidTransform? -} diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift deleted file mode 100644 index 00b54c62..00000000 --- a/Sources/DOMKit/WebIDL/XRReferenceSpaceEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRReferenceSpaceEventInit: BridgedDictionary { - public convenience init(referenceSpace: XRReferenceSpace, transform: XRRigidTransform?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.referenceSpace] = referenceSpace.jsValue - object[Strings.transform] = transform.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _referenceSpace = ReadWriteAttribute(jsObject: object, name: Strings.referenceSpace) - _transform = ReadWriteAttribute(jsObject: object, name: Strings.transform) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var referenceSpace: XRReferenceSpace - - @ReadWriteAttribute - public var transform: XRRigidTransform? -} diff --git a/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift b/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift deleted file mode 100644 index 5020209c..00000000 --- a/Sources/DOMKit/WebIDL/XRReferenceSpaceType.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRReferenceSpaceType: JSString, JSValueCompatible { - case viewer = "viewer" - case local = "local" - case localFloor = "local-floor" - case boundedFloor = "bounded-floor" - case unbounded = "unbounded" - - @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/XRReflectionFormat.swift b/Sources/DOMKit/WebIDL/XRReflectionFormat.swift deleted file mode 100644 index 9c6353ba..00000000 --- a/Sources/DOMKit/WebIDL/XRReflectionFormat.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRReflectionFormat: JSString, JSValueCompatible { - case srgba8 = "srgba8" - case rgba16f = "rgba16f" - - @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/XRRenderState.swift b/Sources/DOMKit/WebIDL/XRRenderState.swift deleted file mode 100644 index 8768f81e..00000000 --- a/Sources/DOMKit/WebIDL/XRRenderState.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRRenderState: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRRenderState].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _depthNear = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthNear) - _depthFar = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthFar) - _inlineVerticalFieldOfView = ReadonlyAttribute(jsObject: jsObject, name: Strings.inlineVerticalFieldOfView) - _baseLayer = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseLayer) - _layers = ReadonlyAttribute(jsObject: jsObject, name: Strings.layers) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var depthNear: Double - - @ReadonlyAttribute - public var depthFar: Double - - @ReadonlyAttribute - public var inlineVerticalFieldOfView: Double? - - @ReadonlyAttribute - public var baseLayer: XRWebGLLayer? - - @ReadonlyAttribute - public var layers: [XRLayer] -} diff --git a/Sources/DOMKit/WebIDL/XRRenderStateInit.swift b/Sources/DOMKit/WebIDL/XRRenderStateInit.swift deleted file mode 100644 index f6e54575..00000000 --- a/Sources/DOMKit/WebIDL/XRRenderStateInit.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRRenderStateInit: BridgedDictionary { - public convenience init(depthNear: Double, depthFar: Double, inlineVerticalFieldOfView: Double, baseLayer: XRWebGLLayer?, layers: [XRLayer]?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.depthNear] = depthNear.jsValue - object[Strings.depthFar] = depthFar.jsValue - object[Strings.inlineVerticalFieldOfView] = inlineVerticalFieldOfView.jsValue - object[Strings.baseLayer] = baseLayer.jsValue - object[Strings.layers] = layers.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _depthNear = ReadWriteAttribute(jsObject: object, name: Strings.depthNear) - _depthFar = ReadWriteAttribute(jsObject: object, name: Strings.depthFar) - _inlineVerticalFieldOfView = ReadWriteAttribute(jsObject: object, name: Strings.inlineVerticalFieldOfView) - _baseLayer = ReadWriteAttribute(jsObject: object, name: Strings.baseLayer) - _layers = ReadWriteAttribute(jsObject: object, name: Strings.layers) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var depthNear: Double - - @ReadWriteAttribute - public var depthFar: Double - - @ReadWriteAttribute - public var inlineVerticalFieldOfView: Double - - @ReadWriteAttribute - public var baseLayer: XRWebGLLayer? - - @ReadWriteAttribute - public var layers: [XRLayer]? -} diff --git a/Sources/DOMKit/WebIDL/XRRigidTransform.swift b/Sources/DOMKit/WebIDL/XRRigidTransform.swift deleted file mode 100644 index 5515bbcb..00000000 --- a/Sources/DOMKit/WebIDL/XRRigidTransform.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRRigidTransform: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRRigidTransform].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _position = ReadonlyAttribute(jsObject: jsObject, name: Strings.position) - _orientation = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientation) - _matrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.matrix) - _inverse = ReadonlyAttribute(jsObject: jsObject, name: Strings.inverse) - self.jsObject = jsObject - } - - @inlinable public convenience init(position: DOMPointInit? = nil, orientation: DOMPointInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [position?.jsValue ?? .undefined, orientation?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var position: DOMPointReadOnly - - @ReadonlyAttribute - public var orientation: DOMPointReadOnly - - @ReadonlyAttribute - public var matrix: Float32Array - - @ReadonlyAttribute - public var inverse: XRRigidTransform -} diff --git a/Sources/DOMKit/WebIDL/XRSession.swift b/Sources/DOMKit/WebIDL/XRSession.swift deleted file mode 100644 index 084ecb6c..00000000 --- a/Sources/DOMKit/WebIDL/XRSession.swift +++ /dev/null @@ -1,180 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRSession: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRSession].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _environmentBlendMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.environmentBlendMode) - _interactionMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.interactionMode) - _depthUsage = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthUsage) - _depthDataFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthDataFormat) - _domOverlayState = ReadonlyAttribute(jsObject: jsObject, name: Strings.domOverlayState) - _preferredReflectionFormat = ReadonlyAttribute(jsObject: jsObject, name: Strings.preferredReflectionFormat) - _visibilityState = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibilityState) - _frameRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameRate) - _supportedFrameRates = ReadonlyAttribute(jsObject: jsObject, name: Strings.supportedFrameRates) - _renderState = ReadonlyAttribute(jsObject: jsObject, name: Strings.renderState) - _inputSources = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputSources) - _onend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onend) - _oninputsourceschange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oninputsourceschange) - _onselect = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onselect) - _onselectstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onselectstart) - _onselectend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onselectend) - _onsqueeze = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsqueeze) - _onsqueezestart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsqueezestart) - _onsqueezeend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsqueezeend) - _onvisibilitychange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onvisibilitychange) - _onframeratechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onframeratechange) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var environmentBlendMode: XREnvironmentBlendMode - - @ReadonlyAttribute - public var interactionMode: XRInteractionMode - - @ReadonlyAttribute - public var depthUsage: XRDepthUsage - - @ReadonlyAttribute - public var depthDataFormat: XRDepthDataFormat - - @ReadonlyAttribute - public var domOverlayState: XRDOMOverlayState? - - @inlinable public func requestHitTestSource(options: XRHitTestOptionsInit) -> JSPromise { - let this = jsObject - return this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestHitTestSource(options: XRHitTestOptionsInit) async throws -> XRHitTestSource { - let this = jsObject - let _promise: JSPromise = this[Strings.requestHitTestSource].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) -> JSPromise { - let this = jsObject - return this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestHitTestSourceForTransientInput(options: XRTransientInputHitTestOptionsInit) async throws -> XRTransientInputHitTestSource { - let this = jsObject - let _promise: JSPromise = this[Strings.requestHitTestSourceForTransientInput].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func requestLightProbe(options: XRLightProbeInit? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestLightProbe(options: XRLightProbeInit? = nil) async throws -> XRLightProbe { - let this = jsObject - let _promise: JSPromise = this[Strings.requestLightProbe].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ReadonlyAttribute - public var preferredReflectionFormat: XRReflectionFormat - - @ReadonlyAttribute - public var visibilityState: XRVisibilityState - - @ReadonlyAttribute - public var frameRate: Float? - - @ReadonlyAttribute - public var supportedFrameRates: Float32Array? - - @ReadonlyAttribute - public var renderState: XRRenderState - - @ReadonlyAttribute - public var inputSources: XRInputSourceArray - - @inlinable public func updateRenderState(state: XRRenderStateInit? = nil) { - let this = jsObject - _ = this[Strings.updateRenderState].function!(this: this, arguments: [state?.jsValue ?? .undefined]) - } - - @inlinable public func updateTargetFrameRate(rate: Float) -> JSPromise { - let this = jsObject - return this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func updateTargetFrameRate(rate: Float) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.updateTargetFrameRate].function!(this: this, arguments: [rate.jsValue]).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func requestReferenceSpace(type: XRReferenceSpaceType) -> JSPromise { - let this = jsObject - return this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestReferenceSpace(type: XRReferenceSpaceType) async throws -> XRReferenceSpace { - let this = jsObject - let _promise: JSPromise = this[Strings.requestReferenceSpace].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - // XXX: member 'requestAnimationFrame' is ignored - - @inlinable public func cancelAnimationFrame(handle: UInt32) { - let this = jsObject - _ = this[Strings.cancelAnimationFrame].function!(this: this, arguments: [handle.jsValue]) - } - - @inlinable public func end() -> JSPromise { - let this = jsObject - return this[Strings.end].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func end() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.end].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @ClosureAttribute1Optional - public var onend: EventHandler - - @ClosureAttribute1Optional - public var oninputsourceschange: EventHandler - - @ClosureAttribute1Optional - public var onselect: EventHandler - - @ClosureAttribute1Optional - public var onselectstart: EventHandler - - @ClosureAttribute1Optional - public var onselectend: EventHandler - - @ClosureAttribute1Optional - public var onsqueeze: EventHandler - - @ClosureAttribute1Optional - public var onsqueezestart: EventHandler - - @ClosureAttribute1Optional - public var onsqueezeend: EventHandler - - @ClosureAttribute1Optional - public var onvisibilitychange: EventHandler - - @ClosureAttribute1Optional - public var onframeratechange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/XRSessionEvent.swift b/Sources/DOMKit/WebIDL/XRSessionEvent.swift deleted file mode 100644 index fff62442..00000000 --- a/Sources/DOMKit/WebIDL/XRSessionEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRSessionEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRSessionEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _session = ReadonlyAttribute(jsObject: jsObject, name: Strings.session) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInitDict: XRSessionEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) - } - - @ReadonlyAttribute - public var session: XRSession -} diff --git a/Sources/DOMKit/WebIDL/XRSessionEventInit.swift b/Sources/DOMKit/WebIDL/XRSessionEventInit.swift deleted file mode 100644 index 1323c5c0..00000000 --- a/Sources/DOMKit/WebIDL/XRSessionEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRSessionEventInit: BridgedDictionary { - public convenience init(session: XRSession) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.session] = session.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _session = ReadWriteAttribute(jsObject: object, name: Strings.session) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var session: XRSession -} diff --git a/Sources/DOMKit/WebIDL/XRSessionInit.swift b/Sources/DOMKit/WebIDL/XRSessionInit.swift deleted file mode 100644 index 6cc5e3e1..00000000 --- a/Sources/DOMKit/WebIDL/XRSessionInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRSessionInit: BridgedDictionary { - public convenience init(depthSensing: XRDepthStateInit, domOverlay: XRDOMOverlayInit?, requiredFeatures: [JSValue], optionalFeatures: [JSValue]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.depthSensing] = depthSensing.jsValue - object[Strings.domOverlay] = domOverlay.jsValue - object[Strings.requiredFeatures] = requiredFeatures.jsValue - object[Strings.optionalFeatures] = optionalFeatures.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _depthSensing = ReadWriteAttribute(jsObject: object, name: Strings.depthSensing) - _domOverlay = ReadWriteAttribute(jsObject: object, name: Strings.domOverlay) - _requiredFeatures = ReadWriteAttribute(jsObject: object, name: Strings.requiredFeatures) - _optionalFeatures = ReadWriteAttribute(jsObject: object, name: Strings.optionalFeatures) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var depthSensing: XRDepthStateInit - - @ReadWriteAttribute - public var domOverlay: XRDOMOverlayInit? - - @ReadWriteAttribute - public var requiredFeatures: [JSValue] - - @ReadWriteAttribute - public var optionalFeatures: [JSValue] -} diff --git a/Sources/DOMKit/WebIDL/XRSessionMode.swift b/Sources/DOMKit/WebIDL/XRSessionMode.swift deleted file mode 100644 index daad4132..00000000 --- a/Sources/DOMKit/WebIDL/XRSessionMode.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRSessionMode: JSString, JSValueCompatible { - case inline = "inline" - case immersiveVr = "immersive-vr" - case immersiveAr = "immersive-ar" - - @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/XRSessionSupportedPermissionDescriptor.swift b/Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift deleted file mode 100644 index 2170bb7c..00000000 --- a/Sources/DOMKit/WebIDL/XRSessionSupportedPermissionDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRSessionSupportedPermissionDescriptor: BridgedDictionary { - public convenience init(mode: XRSessionMode) { - 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: XRSessionMode -} diff --git a/Sources/DOMKit/WebIDL/XRSpace.swift b/Sources/DOMKit/WebIDL/XRSpace.swift deleted file mode 100644 index 1f2bdf76..00000000 --- a/Sources/DOMKit/WebIDL/XRSpace.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRSpace: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRSpace].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/XRSubImage.swift b/Sources/DOMKit/WebIDL/XRSubImage.swift deleted file mode 100644 index 7efde5be..00000000 --- a/Sources/DOMKit/WebIDL/XRSubImage.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRSubImage: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRSubImage].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _viewport = ReadonlyAttribute(jsObject: jsObject, name: Strings.viewport) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var viewport: XRViewport -} diff --git a/Sources/DOMKit/WebIDL/XRSystem.swift b/Sources/DOMKit/WebIDL/XRSystem.swift deleted file mode 100644 index 8f5f303e..00000000 --- a/Sources/DOMKit/WebIDL/XRSystem.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRSystem: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRSystem].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _ondevicechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondevicechange) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public func isSessionSupported(mode: XRSessionMode) -> JSPromise { - let this = jsObject - return this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func isSessionSupported(mode: XRSessionMode) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.isSessionSupported].function!(this: this, arguments: [mode.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) -> JSPromise { - let this = jsObject - return this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func requestSession(mode: XRSessionMode, options: XRSessionInit? = nil) async throws -> XRSession { - let this = jsObject - let _promise: JSPromise = this[Strings.requestSession].function!(this: this, arguments: [mode.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @ClosureAttribute1Optional - public var ondevicechange: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/XRTargetRayMode.swift b/Sources/DOMKit/WebIDL/XRTargetRayMode.swift deleted file mode 100644 index 0370ca15..00000000 --- a/Sources/DOMKit/WebIDL/XRTargetRayMode.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRTargetRayMode: JSString, JSValueCompatible { - case gaze = "gaze" - case trackedPointer = "tracked-pointer" - case screen = "screen" - - @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/XRTextureType.swift b/Sources/DOMKit/WebIDL/XRTextureType.swift deleted file mode 100644 index efd57a77..00000000 --- a/Sources/DOMKit/WebIDL/XRTextureType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRTextureType: JSString, JSValueCompatible { - case texture = "texture" - case textureArray = "texture-array" - - @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/XRTransientInputHitTestOptionsInit.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift deleted file mode 100644 index b5cb6c84..00000000 --- a/Sources/DOMKit/WebIDL/XRTransientInputHitTestOptionsInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRTransientInputHitTestOptionsInit: BridgedDictionary { - public convenience init(profile: String, entityTypes: [XRHitTestTrackableType], offsetRay: XRRay) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.profile] = profile.jsValue - object[Strings.entityTypes] = entityTypes.jsValue - object[Strings.offsetRay] = offsetRay.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _profile = ReadWriteAttribute(jsObject: object, name: Strings.profile) - _entityTypes = ReadWriteAttribute(jsObject: object, name: Strings.entityTypes) - _offsetRay = ReadWriteAttribute(jsObject: object, name: Strings.offsetRay) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var profile: String - - @ReadWriteAttribute - public var entityTypes: [XRHitTestTrackableType] - - @ReadWriteAttribute - public var offsetRay: XRRay -} diff --git a/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift deleted file mode 100644 index cce87a65..00000000 --- a/Sources/DOMKit/WebIDL/XRTransientInputHitTestResult.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRTransientInputHitTestResult: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRTransientInputHitTestResult].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _inputSource = ReadonlyAttribute(jsObject: jsObject, name: Strings.inputSource) - _results = ReadonlyAttribute(jsObject: jsObject, name: Strings.results) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var inputSource: XRInputSource - - @ReadonlyAttribute - public var results: [XRHitTestResult] -} diff --git a/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift b/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift deleted file mode 100644 index 5566a4a9..00000000 --- a/Sources/DOMKit/WebIDL/XRTransientInputHitTestSource.swift +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRTransientInputHitTestSource: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRTransientInputHitTestSource].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func cancel() { - let this = jsObject - _ = this[Strings.cancel].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/XRView.swift b/Sources/DOMKit/WebIDL/XRView.swift deleted file mode 100644 index 8892c782..00000000 --- a/Sources/DOMKit/WebIDL/XRView.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRView: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRView].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _isFirstPersonObserver = ReadonlyAttribute(jsObject: jsObject, name: Strings.isFirstPersonObserver) - _eye = ReadonlyAttribute(jsObject: jsObject, name: Strings.eye) - _projectionMatrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.projectionMatrix) - _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) - _recommendedViewportScale = ReadonlyAttribute(jsObject: jsObject, name: Strings.recommendedViewportScale) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var isFirstPersonObserver: Bool - - @ReadonlyAttribute - public var eye: XREye - - @ReadonlyAttribute - public var projectionMatrix: Float32Array - - @ReadonlyAttribute - public var transform: XRRigidTransform - - @ReadonlyAttribute - public var recommendedViewportScale: Double? - - @inlinable public func requestViewportScale(scale: Double?) { - let this = jsObject - _ = this[Strings.requestViewportScale].function!(this: this, arguments: [scale.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/XRViewerPose.swift b/Sources/DOMKit/WebIDL/XRViewerPose.swift deleted file mode 100644 index f1d94602..00000000 --- a/Sources/DOMKit/WebIDL/XRViewerPose.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRViewerPose: XRPose { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRViewerPose].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _views = ReadonlyAttribute(jsObject: jsObject, name: Strings.views) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var views: [XRView] -} diff --git a/Sources/DOMKit/WebIDL/XRViewport.swift b/Sources/DOMKit/WebIDL/XRViewport.swift deleted file mode 100644 index a5d871a2..00000000 --- a/Sources/DOMKit/WebIDL/XRViewport.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRViewport: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRViewport].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var x: Int32 - - @ReadonlyAttribute - public var y: Int32 - - @ReadonlyAttribute - public var width: Int32 - - @ReadonlyAttribute - public var height: Int32 -} diff --git a/Sources/DOMKit/WebIDL/XRVisibilityState.swift b/Sources/DOMKit/WebIDL/XRVisibilityState.swift deleted file mode 100644 index a8585df9..00000000 --- a/Sources/DOMKit/WebIDL/XRVisibilityState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum XRVisibilityState: JSString, JSValueCompatible { - case visible = "visible" - case visibleBlurred = "visible-blurred" - case hidden = "hidden" - - @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/XRWebGLBinding.swift b/Sources/DOMKit/WebIDL/XRWebGLBinding.swift deleted file mode 100644 index 9cbf741a..00000000 --- a/Sources/DOMKit/WebIDL/XRWebGLBinding.swift +++ /dev/null @@ -1,71 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRWebGLBinding: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLBinding].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _nativeProjectionScaleFactor = ReadonlyAttribute(jsObject: jsObject, name: Strings.nativeProjectionScaleFactor) - _usesDepthValues = ReadonlyAttribute(jsObject: jsObject, name: Strings.usesDepthValues) - self.jsObject = jsObject - } - - @inlinable public func getDepthInformation(view: XRView) -> XRWebGLDepthInformation? { - let this = jsObject - return this[Strings.getDepthInformation].function!(this: this, arguments: [view.jsValue]).fromJSValue()! - } - - @inlinable public func getReflectionCubeMap(lightProbe: XRLightProbe) -> WebGLTexture? { - let this = jsObject - return this[Strings.getReflectionCubeMap].function!(this: this, arguments: [lightProbe.jsValue]).fromJSValue()! - } - - @inlinable public convenience init(session: XRSession, context: XRWebGLRenderingContext) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue, context.jsValue])) - } - - @ReadonlyAttribute - public var nativeProjectionScaleFactor: Double - - @ReadonlyAttribute - public var usesDepthValues: Bool - - @inlinable public func createProjectionLayer(init: XRProjectionLayerInit? = nil) -> XRProjectionLayer { - let this = jsObject - return this[Strings.createProjectionLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createQuadLayer(init: XRQuadLayerInit? = nil) -> XRQuadLayer { - let this = jsObject - return this[Strings.createQuadLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createCylinderLayer(init: XRCylinderLayerInit? = nil) -> XRCylinderLayer { - let this = jsObject - return this[Strings.createCylinderLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createEquirectLayer(init: XREquirectLayerInit? = nil) -> XREquirectLayer { - let this = jsObject - return this[Strings.createEquirectLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func createCubeLayer(init: XRCubeLayerInit? = nil) -> XRCubeLayer { - let this = jsObject - return this[Strings.createCubeLayer].function!(this: this, arguments: [`init`?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func getSubImage(layer: XRCompositionLayer, frame: XRFrame, eye: XREye? = nil) -> XRWebGLSubImage { - let this = jsObject - return this[Strings.getSubImage].function!(this: this, arguments: [layer.jsValue, frame.jsValue, eye?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func getViewSubImage(layer: XRProjectionLayer, view: XRView) -> XRWebGLSubImage { - let this = jsObject - return this[Strings.getViewSubImage].function!(this: this, arguments: [layer.jsValue, view.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift b/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift deleted file mode 100644 index bb8d3550..00000000 --- a/Sources/DOMKit/WebIDL/XRWebGLDepthInformation.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRWebGLDepthInformation: XRDepthInformation { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLDepthInformation].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _texture = ReadonlyAttribute(jsObject: jsObject, name: Strings.texture) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var texture: WebGLTexture -} diff --git a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift b/Sources/DOMKit/WebIDL/XRWebGLLayer.swift deleted file mode 100644 index 4da60803..00000000 --- a/Sources/DOMKit/WebIDL/XRWebGLLayer.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRWebGLLayer: XRLayer { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLLayer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _antialias = ReadonlyAttribute(jsObject: jsObject, name: Strings.antialias) - _ignoreDepthValues = ReadonlyAttribute(jsObject: jsObject, name: Strings.ignoreDepthValues) - _fixedFoveation = ReadWriteAttribute(jsObject: jsObject, name: Strings.fixedFoveation) - _framebuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.framebuffer) - _framebufferWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.framebufferWidth) - _framebufferHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.framebufferHeight) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(session: XRSession, context: XRWebGLRenderingContext, layerInit: XRWebGLLayerInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [session.jsValue, context.jsValue, layerInit?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var antialias: Bool - - @ReadonlyAttribute - public var ignoreDepthValues: Bool - - @ReadWriteAttribute - public var fixedFoveation: Float? - - @ReadonlyAttribute - public var framebuffer: WebGLFramebuffer? - - @ReadonlyAttribute - public var framebufferWidth: UInt32 - - @ReadonlyAttribute - public var framebufferHeight: UInt32 - - @inlinable public func getViewport(view: XRView) -> XRViewport? { - let this = jsObject - return this[Strings.getViewport].function!(this: this, arguments: [view.jsValue]).fromJSValue()! - } - - @inlinable public static func getNativeFramebufferScaleFactor(session: XRSession) -> Double { - let this = constructor - return this[Strings.getNativeFramebufferScaleFactor].function!(this: this, arguments: [session.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift b/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift deleted file mode 100644 index 6137963e..00000000 --- a/Sources/DOMKit/WebIDL/XRWebGLLayerInit.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRWebGLLayerInit: BridgedDictionary { - public convenience init(antialias: Bool, depth: Bool, stencil: Bool, alpha: Bool, ignoreDepthValues: Bool, framebufferScaleFactor: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.antialias] = antialias.jsValue - object[Strings.depth] = depth.jsValue - object[Strings.stencil] = stencil.jsValue - object[Strings.alpha] = alpha.jsValue - object[Strings.ignoreDepthValues] = ignoreDepthValues.jsValue - object[Strings.framebufferScaleFactor] = framebufferScaleFactor.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _antialias = ReadWriteAttribute(jsObject: object, name: Strings.antialias) - _depth = ReadWriteAttribute(jsObject: object, name: Strings.depth) - _stencil = ReadWriteAttribute(jsObject: object, name: Strings.stencil) - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _ignoreDepthValues = ReadWriteAttribute(jsObject: object, name: Strings.ignoreDepthValues) - _framebufferScaleFactor = ReadWriteAttribute(jsObject: object, name: Strings.framebufferScaleFactor) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var antialias: Bool - - @ReadWriteAttribute - public var depth: Bool - - @ReadWriteAttribute - public var stencil: Bool - - @ReadWriteAttribute - public var alpha: Bool - - @ReadWriteAttribute - public var ignoreDepthValues: Bool - - @ReadWriteAttribute - public var framebufferScaleFactor: Double -} diff --git a/Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift deleted file mode 100644 index 3af5527b..00000000 --- a/Sources/DOMKit/WebIDL/XRWebGLRenderingContext.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_XRWebGLRenderingContext: ConvertibleToJSValue {} -extension WebGL2RenderingContext: Any_XRWebGLRenderingContext {} -extension WebGLRenderingContext: Any_XRWebGLRenderingContext {} - -public enum XRWebGLRenderingContext: JSValueCompatible, Any_XRWebGLRenderingContext { - case webGL2RenderingContext(WebGL2RenderingContext) - case webGLRenderingContext(WebGLRenderingContext) - - public static func construct(from value: JSValue) -> Self? { - if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { - return .webGL2RenderingContext(webGL2RenderingContext) - } - if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { - return .webGLRenderingContext(webGLRenderingContext) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .webGL2RenderingContext(webGL2RenderingContext): - return webGL2RenderingContext.jsValue - case let .webGLRenderingContext(webGLRenderingContext): - return webGLRenderingContext.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift b/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift deleted file mode 100644 index e2198df2..00000000 --- a/Sources/DOMKit/WebIDL/XRWebGLSubImage.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class XRWebGLSubImage: XRSubImage { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.XRWebGLSubImage].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _colorTexture = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorTexture) - _depthStencilTexture = ReadonlyAttribute(jsObject: jsObject, name: Strings.depthStencilTexture) - _imageIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.imageIndex) - _textureWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureWidth) - _textureHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.textureHeight) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var colorTexture: WebGLTexture - - @ReadonlyAttribute - public var depthStencilTexture: WebGLTexture? - - @ReadonlyAttribute - public var imageIndex: UInt32? - - @ReadonlyAttribute - public var textureWidth: UInt32 - - @ReadonlyAttribute - public var textureHeight: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/console.swift b/Sources/DOMKit/WebIDL/console.swift deleted file mode 100644 index d61e67e0..00000000 --- a/Sources/DOMKit/WebIDL/console.swift +++ /dev/null @@ -1,105 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum console { - @inlinable public static var jsObject: JSObject { - JSObject.global[Strings.console].object! - } - - @inlinable public static func assert(condition: Bool? = nil, data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.assert].function!(this: this, arguments: [condition?.jsValue ?? .undefined] + data.map(\.jsValue)) - } - - @inlinable public static func clear() { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.clear].function!(this: this, arguments: []) - } - - @inlinable public static func debug(data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.debug].function!(this: this, arguments: data.map(\.jsValue)) - } - - @inlinable public static func error(data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.error].function!(this: this, arguments: data.map(\.jsValue)) - } - - @inlinable public static func info(data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.info].function!(this: this, arguments: data.map(\.jsValue)) - } - - @inlinable public static func log(data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.log].function!(this: this, arguments: data.map(\.jsValue)) - } - - @inlinable public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.table].function!(this: this, arguments: [tabularData?.jsValue ?? .undefined, properties?.jsValue ?? .undefined]) - } - - @inlinable public static func trace(data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.trace].function!(this: this, arguments: data.map(\.jsValue)) - } - - @inlinable public static func warn(data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.warn].function!(this: this, arguments: data.map(\.jsValue)) - } - - @inlinable public static func dir(item: JSValue? = nil, options: JSObject? = nil) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.dir].function!(this: this, arguments: [item?.jsValue ?? .undefined, options?.jsValue ?? .undefined]) - } - - @inlinable public static func dirxml(data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.dirxml].function!(this: this, arguments: data.map(\.jsValue)) - } - - @inlinable public static func count(label: String? = nil) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.count].function!(this: this, arguments: [label?.jsValue ?? .undefined]) - } - - @inlinable public static func countReset(label: String? = nil) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.countReset].function!(this: this, arguments: [label?.jsValue ?? .undefined]) - } - - @inlinable public static func group(data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.group].function!(this: this, arguments: data.map(\.jsValue)) - } - - @inlinable public static func groupCollapsed(data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.groupCollapsed].function!(this: this, arguments: data.map(\.jsValue)) - } - - @inlinable public static func groupEnd() { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.groupEnd].function!(this: this, arguments: []) - } - - @inlinable public static func time(label: String? = nil) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.time].function!(this: this, arguments: [label?.jsValue ?? .undefined]) - } - - @inlinable public static func timeLog(label: String? = nil, data: JSValue...) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.timeLog].function!(this: this, arguments: [label?.jsValue ?? .undefined] + data.map(\.jsValue)) - } - - @inlinable public static func timeEnd(label: String? = nil) { - let this = JSObject.global[Strings.console].object! - _ = this[Strings.timeEnd].function!(this: this, arguments: [label?.jsValue ?? .undefined]) - } -} diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index aaace3e9..a5fb2d5c 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -47,7 +47,7 @@ enum DeclarationMerger { // print(byName.filter { $0.value.count > 1 }.map { "\($0.key ?? ""): \($0.value.map { type(of: $0).type }))" }.joined(separator: "\n")) func all(_: T.Type) -> [T] { - byType[T.type]!.map { $0 as! T } + byType[T.type]?.map { $0 as! T } ?? [] } let mixins = Dictionary( diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js index ba3e659c..0c2096d3 100644 --- a/parse-idl/parse-all.js +++ b/parse-idl/parse-all.js @@ -2,4 +2,6 @@ import { parseAll } from "@webref/idl"; import fs from "node:fs/promises"; const parsedFiles = await parseAll(); -console.log(JSON.stringify(Object.values(parsedFiles), null, 2)); +// console.log(Object.keys(parsedFiles).join('\n')) +// console.log(JSON.stringify(Object.values(parsedFiles), null, 2)); +console.log(JSON.stringify(['cssom', 'css-pseudo', 'dom', 'fetch', 'FileAPI', 'html', 'geometry', 'hr-time', 'media-source', 'mediacapture-streams', 'mediastream-recording', 'referrer-policy', 'streams', 'SVG', 'uievents', 'wai-aria', 'webcodecs', 'webidl', 'web-animations', 'xhr', 'service-workers', 'url'].map(key => parsedFiles[key]), null, 2)); From 2edf07e3f23a674f5794bb7bc76bc1f97a61fb34 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 22 Apr 2022 20:33:19 -0400 Subject: [PATCH 117/124] fix UnionType crash --- Sources/WebIDLToSwift/UnionType.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/WebIDLToSwift/UnionType.swift b/Sources/WebIDLToSwift/UnionType.swift index 5025b128..430dd7db 100644 --- a/Sources/WebIDLToSwift/UnionType.swift +++ b/Sources/WebIDLToSwift/UnionType.swift @@ -23,6 +23,7 @@ class UnionType: Hashable, Equatable { struct SlimIDLType: Hashable, Encodable { let value: TypeValue let nullable: Bool + let inlineTypeName: String func hash(into hasher: inout Hasher) { hasher.combine(inlineTypeName) @@ -33,16 +34,15 @@ struct SlimIDLType: Hashable, Encodable { } init(_ type: IDLType) { - value = .init(type.value) + let value = TypeValue(type.value) + self.value = value nullable = type.nullable - } - - var inlineTypeName: String { - if nullable { - return "nullable_\(value.inlineTypeName)" + + if type.nullable { + inlineTypeName = "nullable_\(value.inlineTypeName)" + } else { + inlineTypeName = value.inlineTypeName } - - return value.inlineTypeName } enum TypeValue: Encodable { From a0d56679f20afd7597588302f40a7ff1088d58f5 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 22 Apr 2022 20:38:37 -0400 Subject: [PATCH 118/124] add typed accessors to unions --- .../DOMKit/WebIDL/ArrayBuffer_or_String.swift | 14 +++++++ ...udioTrack_or_TextTrack_or_VideoTrack.swift | 21 ++++++++++ Sources/DOMKit/WebIDL/BlobPart.swift | 21 ++++++++++ .../DOMKit/WebIDL/Blob_or_MediaSource.swift | 14 +++++++ Sources/DOMKit/WebIDL/BodyInit.swift | 14 +++++++ .../Bool_or_MediaTrackConstraints.swift | 14 +++++++ Sources/DOMKit/WebIDL/BufferSource.swift | 14 +++++++ .../WebIDL/CSSPseudoElement_or_Element.swift | 14 +++++++ ...terInput_or_seq_of_CanvasFilterInput.swift | 14 +++++++ .../WebIDL/CanvasFilter_or_String.swift | 14 +++++++ ...sGradient_or_CanvasPattern_or_String.swift | 21 ++++++++++ Sources/DOMKit/WebIDL/CanvasImageSource.swift | 42 +++++++++++++++++++ ...o_or_seq_of_CompositeOperationOrAuto.swift | 14 +++++++ Sources/DOMKit/WebIDL/ConstrainBoolean.swift | 14 +++++++ .../DOMKit/WebIDL/ConstrainDOMString.swift | 21 ++++++++++ Sources/DOMKit/WebIDL/ConstrainDouble.swift | 14 +++++++ Sources/DOMKit/WebIDL/ConstrainULong.swift | 14 +++++++ .../WebIDL/DOMPointInit_or_Double.swift | 14 +++++++ ...ble_or_seq_of_DOMPointInit_or_Double.swift | 21 ++++++++++ .../Document_or_XMLHttpRequestBodyInit.swift | 14 +++++++ .../Double_or_KeyframeAnimationOptions.swift | 14 +++++++ .../Double_or_KeyframeEffectOptions.swift | 14 +++++++ Sources/DOMKit/WebIDL/Double_or_String.swift | 14 +++++++ .../ElementCreationOptions_or_String.swift | 14 +++++++ .../WebIDL/Element_or_HTMLCollection.swift | 14 +++++++ .../Element_or_ProcessingInstruction.swift | 14 +++++++ .../WebIDL/Element_or_RadioNodeList.swift | 14 +++++++ Sources/DOMKit/WebIDL/Element_or_Text.swift | 14 +++++++ Sources/DOMKit/WebIDL/Event_or_String.swift | 14 +++++++ .../WebIDL/File_or_FormData_or_String.swift | 21 ++++++++++ .../DOMKit/WebIDL/FormDataEntryValue.swift | 14 +++++++ ...HTMLCanvasElement_or_OffscreenCanvas.swift | 14 +++++++ .../DOMKit/WebIDL/HTMLElement_or_Int32.swift | 14 +++++++ ...OptGroupElement_or_HTMLOptionElement.swift | 14 +++++++ .../DOMKit/WebIDL/HTMLOrSVGImageElement.swift | 14 +++++++ .../WebIDL/HTMLOrSVGScriptElement.swift | 14 +++++++ Sources/DOMKit/WebIDL/HeadersInit.swift | 14 +++++++ Sources/DOMKit/WebIDL/ImageBitmapSource.swift | 21 ++++++++++ Sources/DOMKit/WebIDL/ImageBufferSource.swift | 14 +++++++ .../DOMKit/WebIDL/MediaList_or_String.swift | 14 +++++++ Sources/DOMKit/WebIDL/MediaProvider.swift | 21 ++++++++++ .../DOMKit/WebIDL/MessageEventSource.swift | 21 ++++++++++ Sources/DOMKit/WebIDL/Node_or_String.swift | 14 +++++++ .../WebIDL/OffscreenRenderingContext.swift | 35 ++++++++++++++++ Sources/DOMKit/WebIDL/Path2D_or_String.swift | 14 +++++++ .../WebIDL/ReadableStreamController.swift | 14 +++++++ .../DOMKit/WebIDL/ReadableStreamReader.swift | 14 +++++++ Sources/DOMKit/WebIDL/RenderingContext.swift | 35 ++++++++++++++++ Sources/DOMKit/WebIDL/RequestInfo.swift | 14 +++++++ .../WebIDL/String_or_WorkerOptions.swift | 14 +++++++ ...ng_to_String_or_seq_of_seq_of_String.swift | 21 ++++++++++ .../WebIDL/String_or_seq_of_Double.swift | 14 +++++++ .../WebIDL/String_or_seq_of_String.swift | 14 +++++++ Sources/DOMKit/WebIDL/TimerHandler.swift | 14 +++++++ .../WebIDL/XMLHttpRequestBodyInit.swift | 35 ++++++++++++++++ ...ble_Double_or_seq_of_nullable_Double.swift | 14 +++++++ .../UnionType+SwiftRepresentable.swift | 15 +++++++ 57 files changed, 960 insertions(+) diff --git a/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift b/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift index 923e272e..9fc28f17 100644 --- a/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift +++ b/Sources/DOMKit/WebIDL/ArrayBuffer_or_String.swift @@ -11,6 +11,20 @@ public enum ArrayBuffer_or_String: JSValueCompatible, Any_ArrayBuffer_or_String case arrayBuffer(ArrayBuffer) case string(String) + var arrayBuffer: ArrayBuffer? { + switch self { + case let .arrayBuffer(arrayBuffer): return arrayBuffer + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let arrayBuffer: ArrayBuffer = value.fromJSValue() { return .arrayBuffer(arrayBuffer) diff --git a/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift index 4dd6bed2..10ac922e 100644 --- a/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift +++ b/Sources/DOMKit/WebIDL/AudioTrack_or_TextTrack_or_VideoTrack.swift @@ -13,6 +13,27 @@ public enum AudioTrack_or_TextTrack_or_VideoTrack: JSValueCompatible, Any_AudioT case textTrack(TextTrack) case videoTrack(VideoTrack) + var audioTrack: AudioTrack? { + switch self { + case let .audioTrack(audioTrack): return audioTrack + default: return nil + } + } + + var textTrack: TextTrack? { + switch self { + case let .textTrack(textTrack): return textTrack + default: return nil + } + } + + var videoTrack: VideoTrack? { + switch self { + case let .videoTrack(videoTrack): return videoTrack + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let audioTrack: AudioTrack = value.fromJSValue() { return .audioTrack(audioTrack) diff --git a/Sources/DOMKit/WebIDL/BlobPart.swift b/Sources/DOMKit/WebIDL/BlobPart.swift index a3491bb5..ea19e902 100644 --- a/Sources/DOMKit/WebIDL/BlobPart.swift +++ b/Sources/DOMKit/WebIDL/BlobPart.swift @@ -13,6 +13,27 @@ public enum BlobPart: JSValueCompatible, Any_BlobPart { case bufferSource(BufferSource) case string(String) + var blob: Blob? { + switch self { + case let .blob(blob): return blob + default: return nil + } + } + + var bufferSource: BufferSource? { + switch self { + case let .bufferSource(bufferSource): return bufferSource + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let blob: Blob = value.fromJSValue() { return .blob(blob) diff --git a/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift b/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift index ad90e925..a2466748 100644 --- a/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift +++ b/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift @@ -11,6 +11,20 @@ public enum Blob_or_MediaSource: JSValueCompatible, Any_Blob_or_MediaSource { case blob(Blob) case mediaSource(MediaSource) + var blob: Blob? { + switch self { + case let .blob(blob): return blob + default: return nil + } + } + + var mediaSource: MediaSource? { + switch self { + case let .mediaSource(mediaSource): return mediaSource + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let blob: Blob = value.fromJSValue() { return .blob(blob) diff --git a/Sources/DOMKit/WebIDL/BodyInit.swift b/Sources/DOMKit/WebIDL/BodyInit.swift index 23eab0f2..3c876844 100644 --- a/Sources/DOMKit/WebIDL/BodyInit.swift +++ b/Sources/DOMKit/WebIDL/BodyInit.swift @@ -11,6 +11,20 @@ public enum BodyInit: JSValueCompatible, Any_BodyInit { case readableStream(ReadableStream) case xmlHttpRequestBodyInit(XMLHttpRequestBodyInit) + var readableStream: ReadableStream? { + switch self { + case let .readableStream(readableStream): return readableStream + default: return nil + } + } + + var xmlHttpRequestBodyInit: XMLHttpRequestBodyInit? { + switch self { + case let .xmlHttpRequestBodyInit(xmlHttpRequestBodyInit): return xmlHttpRequestBodyInit + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let readableStream: ReadableStream = value.fromJSValue() { return .readableStream(readableStream) diff --git a/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift b/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift index f2f7e943..1c9c71e0 100644 --- a/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift +++ b/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift @@ -11,6 +11,20 @@ public enum Bool_or_MediaTrackConstraints: JSValueCompatible, Any_Bool_or_MediaT 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) diff --git a/Sources/DOMKit/WebIDL/BufferSource.swift b/Sources/DOMKit/WebIDL/BufferSource.swift index 2bf068de..6e6a2f33 100644 --- a/Sources/DOMKit/WebIDL/BufferSource.swift +++ b/Sources/DOMKit/WebIDL/BufferSource.swift @@ -11,6 +11,20 @@ public enum BufferSource: JSValueCompatible, Any_BufferSource { case arrayBuffer(ArrayBuffer) case arrayBufferView(ArrayBufferView) + var arrayBuffer: ArrayBuffer? { + switch self { + case let .arrayBuffer(arrayBuffer): return arrayBuffer + default: return nil + } + } + + var arrayBufferView: ArrayBufferView? { + switch self { + case let .arrayBufferView(arrayBufferView): return arrayBufferView + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let arrayBuffer: ArrayBuffer = value.fromJSValue() { return .arrayBuffer(arrayBuffer) diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift index 56e57709..3c06e5d5 100644 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift +++ b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift @@ -11,6 +11,20 @@ public enum CSSPseudoElement_or_Element: JSValueCompatible, Any_CSSPseudoElement case cssPseudoElement(CSSPseudoElement) case element(Element) + var cssPseudoElement: CSSPseudoElement? { + switch self { + case let .cssPseudoElement(cssPseudoElement): return cssPseudoElement + default: return nil + } + } + + var element: Element? { + switch self { + case let .element(element): return element + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let cssPseudoElement: CSSPseudoElement = value.fromJSValue() { return .cssPseudoElement(cssPseudoElement) diff --git a/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift b/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift index 94cd22d2..2989a091 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilterInput_or_seq_of_CanvasFilterInput.swift @@ -11,6 +11,20 @@ public enum CanvasFilterInput_or_seq_of_CanvasFilterInput: JSValueCompatible, An case canvasFilterInput(CanvasFilterInput) case seq_of_CanvasFilterInput([CanvasFilterInput]) + var canvasFilterInput: CanvasFilterInput? { + switch self { + case let .canvasFilterInput(canvasFilterInput): return canvasFilterInput + default: return nil + } + } + + var seq_of_CanvasFilterInput: [CanvasFilterInput]? { + switch self { + case let .seq_of_CanvasFilterInput(seq_of_CanvasFilterInput): return seq_of_CanvasFilterInput + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let canvasFilterInput: CanvasFilterInput = value.fromJSValue() { return .canvasFilterInput(canvasFilterInput) diff --git a/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift b/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift index eb038b02..6b4acf85 100644 --- a/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift +++ b/Sources/DOMKit/WebIDL/CanvasFilter_or_String.swift @@ -11,6 +11,20 @@ public enum CanvasFilter_or_String: JSValueCompatible, Any_CanvasFilter_or_Strin case canvasFilter(CanvasFilter) case string(String) + var canvasFilter: CanvasFilter? { + switch self { + case let .canvasFilter(canvasFilter): return canvasFilter + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let canvasFilter: CanvasFilter = value.fromJSValue() { return .canvasFilter(canvasFilter) diff --git a/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift b/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift index 6334c577..77e1d93d 100644 --- a/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift +++ b/Sources/DOMKit/WebIDL/CanvasGradient_or_CanvasPattern_or_String.swift @@ -13,6 +13,27 @@ public enum CanvasGradient_or_CanvasPattern_or_String: JSValueCompatible, Any_Ca case canvasPattern(CanvasPattern) case string(String) + var canvasGradient: CanvasGradient? { + switch self { + case let .canvasGradient(canvasGradient): return canvasGradient + default: return nil + } + } + + var canvasPattern: CanvasPattern? { + switch self { + case let .canvasPattern(canvasPattern): return canvasPattern + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let canvasGradient: CanvasGradient = value.fromJSValue() { return .canvasGradient(canvasGradient) diff --git a/Sources/DOMKit/WebIDL/CanvasImageSource.swift b/Sources/DOMKit/WebIDL/CanvasImageSource.swift index 02a12145..c1ba2291 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageSource.swift +++ b/Sources/DOMKit/WebIDL/CanvasImageSource.swift @@ -19,6 +19,48 @@ public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { case offscreenCanvas(OffscreenCanvas) case videoFrame(VideoFrame) + var htmlCanvasElement: HTMLCanvasElement? { + switch self { + case let .htmlCanvasElement(htmlCanvasElement): return htmlCanvasElement + default: return nil + } + } + + var htmlOrSVGImageElement: HTMLOrSVGImageElement? { + switch self { + case let .htmlOrSVGImageElement(htmlOrSVGImageElement): return htmlOrSVGImageElement + 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 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) diff --git a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift index d2062c5a..ff36a42d 100644 --- a/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift +++ b/Sources/DOMKit/WebIDL/CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto.swift @@ -11,6 +11,20 @@ public enum CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto: JSValue case compositeOperationOrAuto(CompositeOperationOrAuto) case seq_of_CompositeOperationOrAuto([CompositeOperationOrAuto]) + var compositeOperationOrAuto: CompositeOperationOrAuto? { + switch self { + case let .compositeOperationOrAuto(compositeOperationOrAuto): return compositeOperationOrAuto + default: return nil + } + } + + var seq_of_CompositeOperationOrAuto: [CompositeOperationOrAuto]? { + switch self { + case let .seq_of_CompositeOperationOrAuto(seq_of_CompositeOperationOrAuto): return seq_of_CompositeOperationOrAuto + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let compositeOperationOrAuto: CompositeOperationOrAuto = value.fromJSValue() { return .compositeOperationOrAuto(compositeOperationOrAuto) diff --git a/Sources/DOMKit/WebIDL/ConstrainBoolean.swift b/Sources/DOMKit/WebIDL/ConstrainBoolean.swift index e0f7a70c..38559275 100644 --- a/Sources/DOMKit/WebIDL/ConstrainBoolean.swift +++ b/Sources/DOMKit/WebIDL/ConstrainBoolean.swift @@ -11,6 +11,20 @@ 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) diff --git a/Sources/DOMKit/WebIDL/ConstrainDOMString.swift b/Sources/DOMKit/WebIDL/ConstrainDOMString.swift index aed2199e..5c2cb816 100644 --- a/Sources/DOMKit/WebIDL/ConstrainDOMString.swift +++ b/Sources/DOMKit/WebIDL/ConstrainDOMString.swift @@ -13,6 +13,27 @@ public enum ConstrainDOMString: JSValueCompatible, Any_ConstrainDOMString { 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) diff --git a/Sources/DOMKit/WebIDL/ConstrainDouble.swift b/Sources/DOMKit/WebIDL/ConstrainDouble.swift index 2ec0b242..41993e8a 100644 --- a/Sources/DOMKit/WebIDL/ConstrainDouble.swift +++ b/Sources/DOMKit/WebIDL/ConstrainDouble.swift @@ -11,6 +11,20 @@ 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) diff --git a/Sources/DOMKit/WebIDL/ConstrainULong.swift b/Sources/DOMKit/WebIDL/ConstrainULong.swift index c6af86e4..614cf30b 100644 --- a/Sources/DOMKit/WebIDL/ConstrainULong.swift +++ b/Sources/DOMKit/WebIDL/ConstrainULong.swift @@ -11,6 +11,20 @@ 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) diff --git a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift index bdc7d948..8fdec85e 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double.swift @@ -11,6 +11,20 @@ public enum DOMPointInit_or_Double: JSValueCompatible, Any_DOMPointInit_or_Doubl case domPointInit(DOMPointInit) case double(Double) + var domPointInit: DOMPointInit? { + switch self { + case let .domPointInit(domPointInit): return domPointInit + 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 domPointInit: DOMPointInit = value.fromJSValue() { return .domPointInit(domPointInit) diff --git a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift index 3e6d04d0..e8a88b4d 100644 --- a/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift +++ b/Sources/DOMKit/WebIDL/DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double.swift @@ -13,6 +13,27 @@ public enum DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double: JSValueComp case double(Double) case seq_of_DOMPointInit_or_Double([DOMPointInit_or_Double]) + var domPointInit: DOMPointInit? { + switch self { + case let .domPointInit(domPointInit): return domPointInit + default: return nil + } + } + + var double: Double? { + switch self { + case let .double(double): return double + default: return nil + } + } + + var seq_of_DOMPointInit_or_Double: [DOMPointInit_or_Double]? { + switch self { + case let .seq_of_DOMPointInit_or_Double(seq_of_DOMPointInit_or_Double): return seq_of_DOMPointInit_or_Double + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let domPointInit: DOMPointInit = value.fromJSValue() { return .domPointInit(domPointInit) diff --git a/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift b/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift index 399e4df1..73264860 100644 --- a/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift +++ b/Sources/DOMKit/WebIDL/Document_or_XMLHttpRequestBodyInit.swift @@ -11,6 +11,20 @@ public enum Document_or_XMLHttpRequestBodyInit: JSValueCompatible, Any_Document_ case document(Document) case xmlHttpRequestBodyInit(XMLHttpRequestBodyInit) + var document: Document? { + switch self { + case let .document(document): return document + default: return nil + } + } + + var xmlHttpRequestBodyInit: XMLHttpRequestBodyInit? { + switch self { + case let .xmlHttpRequestBodyInit(xmlHttpRequestBodyInit): return xmlHttpRequestBodyInit + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let document: Document = value.fromJSValue() { return .document(document) diff --git a/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift b/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift index 0c5c2cce..41f4906b 100644 --- a/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift +++ b/Sources/DOMKit/WebIDL/Double_or_KeyframeAnimationOptions.swift @@ -11,6 +11,20 @@ public enum Double_or_KeyframeAnimationOptions: JSValueCompatible, Any_Double_or case double(Double) case keyframeAnimationOptions(KeyframeAnimationOptions) + var double: Double? { + switch self { + case let .double(double): return double + default: return nil + } + } + + var keyframeAnimationOptions: KeyframeAnimationOptions? { + switch self { + case let .keyframeAnimationOptions(keyframeAnimationOptions): return keyframeAnimationOptions + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let double: Double = value.fromJSValue() { return .double(double) diff --git a/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift b/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift index 59fcf900..67a79f8d 100644 --- a/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift +++ b/Sources/DOMKit/WebIDL/Double_or_KeyframeEffectOptions.swift @@ -11,6 +11,20 @@ public enum Double_or_KeyframeEffectOptions: JSValueCompatible, Any_Double_or_Ke case double(Double) case keyframeEffectOptions(KeyframeEffectOptions) + var double: Double? { + switch self { + case let .double(double): return double + default: return nil + } + } + + var keyframeEffectOptions: KeyframeEffectOptions? { + switch self { + case let .keyframeEffectOptions(keyframeEffectOptions): return keyframeEffectOptions + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let double: Double = value.fromJSValue() { return .double(double) diff --git a/Sources/DOMKit/WebIDL/Double_or_String.swift b/Sources/DOMKit/WebIDL/Double_or_String.swift index af9ad128..b74a49c8 100644 --- a/Sources/DOMKit/WebIDL/Double_or_String.swift +++ b/Sources/DOMKit/WebIDL/Double_or_String.swift @@ -11,6 +11,20 @@ public enum Double_or_String: JSValueCompatible, Any_Double_or_String { case double(Double) case string(String) + var double: Double? { + switch self { + case let .double(double): return double + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let double: Double = value.fromJSValue() { return .double(double) diff --git a/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift b/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift index 6164bf12..72a7769f 100644 --- a/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift +++ b/Sources/DOMKit/WebIDL/ElementCreationOptions_or_String.swift @@ -11,6 +11,20 @@ public enum ElementCreationOptions_or_String: JSValueCompatible, Any_ElementCrea case elementCreationOptions(ElementCreationOptions) case string(String) + var elementCreationOptions: ElementCreationOptions? { + switch self { + case let .elementCreationOptions(elementCreationOptions): return elementCreationOptions + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let elementCreationOptions: ElementCreationOptions = value.fromJSValue() { return .elementCreationOptions(elementCreationOptions) diff --git a/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift b/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift index 17722f48..eb92bcd6 100644 --- a/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift +++ b/Sources/DOMKit/WebIDL/Element_or_HTMLCollection.swift @@ -11,6 +11,20 @@ public enum Element_or_HTMLCollection: JSValueCompatible, Any_Element_or_HTMLCol case element(Element) case htmlCollection(HTMLCollection) + var element: Element? { + switch self { + case let .element(element): return element + default: return nil + } + } + + var htmlCollection: HTMLCollection? { + switch self { + case let .htmlCollection(htmlCollection): return htmlCollection + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let element: Element = value.fromJSValue() { return .element(element) diff --git a/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift index 0a55b74c..6c9b4e0e 100644 --- a/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift +++ b/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift @@ -11,6 +11,20 @@ public enum Element_or_ProcessingInstruction: JSValueCompatible, Any_Element_or_ case element(Element) case processingInstruction(ProcessingInstruction) + var element: Element? { + switch self { + case let .element(element): return element + default: return nil + } + } + + var processingInstruction: ProcessingInstruction? { + switch self { + case let .processingInstruction(processingInstruction): return processingInstruction + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let element: Element = value.fromJSValue() { return .element(element) diff --git a/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift b/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift index c41cf3ac..1b9a126d 100644 --- a/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift +++ b/Sources/DOMKit/WebIDL/Element_or_RadioNodeList.swift @@ -11,6 +11,20 @@ public enum Element_or_RadioNodeList: JSValueCompatible, Any_Element_or_RadioNod case element(Element) case radioNodeList(RadioNodeList) + var element: Element? { + switch self { + case let .element(element): return element + default: return nil + } + } + + var radioNodeList: RadioNodeList? { + switch self { + case let .radioNodeList(radioNodeList): return radioNodeList + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let element: Element = value.fromJSValue() { return .element(element) diff --git a/Sources/DOMKit/WebIDL/Element_or_Text.swift b/Sources/DOMKit/WebIDL/Element_or_Text.swift index e4aea1ce..1f9dc971 100644 --- a/Sources/DOMKit/WebIDL/Element_or_Text.swift +++ b/Sources/DOMKit/WebIDL/Element_or_Text.swift @@ -11,6 +11,20 @@ public enum Element_or_Text: JSValueCompatible, Any_Element_or_Text { case element(Element) case text(Text) + var element: Element? { + switch self { + case let .element(element): return element + default: return nil + } + } + + var text: Text? { + switch self { + case let .text(text): return text + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let element: Element = value.fromJSValue() { return .element(element) diff --git a/Sources/DOMKit/WebIDL/Event_or_String.swift b/Sources/DOMKit/WebIDL/Event_or_String.swift index a4055d40..24c91293 100644 --- a/Sources/DOMKit/WebIDL/Event_or_String.swift +++ b/Sources/DOMKit/WebIDL/Event_or_String.swift @@ -11,6 +11,20 @@ public enum Event_or_String: JSValueCompatible, Any_Event_or_String { case event(Event) case string(String) + var event: Event? { + switch self { + case let .event(event): return event + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let event: Event = value.fromJSValue() { return .event(event) diff --git a/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift b/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift index aef3a63e..c420970c 100644 --- a/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift +++ b/Sources/DOMKit/WebIDL/File_or_FormData_or_String.swift @@ -13,6 +13,27 @@ public enum File_or_FormData_or_String: JSValueCompatible, Any_File_or_FormData_ case formData(FormData) case string(String) + var file: File? { + switch self { + case let .file(file): return file + default: return nil + } + } + + var formData: FormData? { + switch self { + case let .formData(formData): return formData + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let file: File = value.fromJSValue() { return .file(file) diff --git a/Sources/DOMKit/WebIDL/FormDataEntryValue.swift b/Sources/DOMKit/WebIDL/FormDataEntryValue.swift index d01d9e44..14b0433d 100644 --- a/Sources/DOMKit/WebIDL/FormDataEntryValue.swift +++ b/Sources/DOMKit/WebIDL/FormDataEntryValue.swift @@ -11,6 +11,20 @@ public enum FormDataEntryValue: JSValueCompatible, Any_FormDataEntryValue { case file(File) case string(String) + var file: File? { + switch self { + case let .file(file): return file + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let file: File = value.fromJSValue() { return .file(file) diff --git a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift index 7ff34aad..99288d31 100644 --- a/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift +++ b/Sources/DOMKit/WebIDL/HTMLCanvasElement_or_OffscreenCanvas.swift @@ -11,6 +11,20 @@ public enum HTMLCanvasElement_or_OffscreenCanvas: JSValueCompatible, Any_HTMLCan case htmlCanvasElement(HTMLCanvasElement) case offscreenCanvas(OffscreenCanvas) + var htmlCanvasElement: HTMLCanvasElement? { + switch self { + case let .htmlCanvasElement(htmlCanvasElement): return htmlCanvasElement + default: return nil + } + } + + var offscreenCanvas: OffscreenCanvas? { + switch self { + case let .offscreenCanvas(offscreenCanvas): return offscreenCanvas + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let htmlCanvasElement: HTMLCanvasElement = value.fromJSValue() { return .htmlCanvasElement(htmlCanvasElement) diff --git a/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift b/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift index 9b81f44a..d32bd33d 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement_or_Int32.swift @@ -11,6 +11,20 @@ public enum HTMLElement_or_Int32: JSValueCompatible, Any_HTMLElement_or_Int32 { case htmlElement(HTMLElement) case int32(Int32) + var htmlElement: HTMLElement? { + switch self { + case let .htmlElement(htmlElement): return htmlElement + default: return nil + } + } + + var int32: Int32? { + switch self { + case let .int32(int32): return int32 + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let htmlElement: HTMLElement = value.fromJSValue() { return .htmlElement(htmlElement) diff --git a/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift b/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift index 3a6edabd..470cc23f 100644 --- a/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOptGroupElement_or_HTMLOptionElement.swift @@ -11,6 +11,20 @@ public enum HTMLOptGroupElement_or_HTMLOptionElement: JSValueCompatible, Any_HTM case htmlOptGroupElement(HTMLOptGroupElement) case htmlOptionElement(HTMLOptionElement) + var htmlOptGroupElement: HTMLOptGroupElement? { + switch self { + case let .htmlOptGroupElement(htmlOptGroupElement): return htmlOptGroupElement + default: return nil + } + } + + var htmlOptionElement: HTMLOptionElement? { + switch self { + case let .htmlOptionElement(htmlOptionElement): return htmlOptionElement + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let htmlOptGroupElement: HTMLOptGroupElement = value.fromJSValue() { return .htmlOptGroupElement(htmlOptGroupElement) diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift index 99c1871c..d4b2c2d8 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift @@ -11,6 +11,20 @@ public enum HTMLOrSVGImageElement: JSValueCompatible, Any_HTMLOrSVGImageElement case htmlImageElement(HTMLImageElement) case svgImageElement(SVGImageElement) + var htmlImageElement: HTMLImageElement? { + switch self { + case let .htmlImageElement(htmlImageElement): return htmlImageElement + default: return nil + } + } + + var svgImageElement: SVGImageElement? { + switch self { + case let .svgImageElement(svgImageElement): return svgImageElement + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let htmlImageElement: HTMLImageElement = value.fromJSValue() { return .htmlImageElement(htmlImageElement) diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift index 8bc32187..cd4ac958 100644 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift @@ -11,6 +11,20 @@ public enum HTMLOrSVGScriptElement: JSValueCompatible, Any_HTMLOrSVGScriptElemen case htmlScriptElement(HTMLScriptElement) case svgScriptElement(SVGScriptElement) + var htmlScriptElement: HTMLScriptElement? { + switch self { + case let .htmlScriptElement(htmlScriptElement): return htmlScriptElement + default: return nil + } + } + + var svgScriptElement: SVGScriptElement? { + switch self { + case let .svgScriptElement(svgScriptElement): return svgScriptElement + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let htmlScriptElement: HTMLScriptElement = value.fromJSValue() { return .htmlScriptElement(htmlScriptElement) diff --git a/Sources/DOMKit/WebIDL/HeadersInit.swift b/Sources/DOMKit/WebIDL/HeadersInit.swift index dcae6c17..ca6a8236 100644 --- a/Sources/DOMKit/WebIDL/HeadersInit.swift +++ b/Sources/DOMKit/WebIDL/HeadersInit.swift @@ -11,6 +11,20 @@ public enum HeadersInit: JSValueCompatible, Any_HeadersInit { case record_String_to_String([String: String]) case seq_of_seq_of_String([[String]]) + var record_String_to_String: [String: String]? { + switch self { + case let .record_String_to_String(record_String_to_String): return record_String_to_String + default: return nil + } + } + + var seq_of_seq_of_String: [[String]]? { + switch self { + case let .seq_of_seq_of_String(seq_of_seq_of_String): return seq_of_seq_of_String + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let record_String_to_String: [String: String] = value.fromJSValue() { return .record_String_to_String(record_String_to_String) diff --git a/Sources/DOMKit/WebIDL/ImageBitmapSource.swift b/Sources/DOMKit/WebIDL/ImageBitmapSource.swift index bd1ec6f8..a6b7f91c 100644 --- a/Sources/DOMKit/WebIDL/ImageBitmapSource.swift +++ b/Sources/DOMKit/WebIDL/ImageBitmapSource.swift @@ -13,6 +13,27 @@ public enum ImageBitmapSource: JSValueCompatible, Any_ImageBitmapSource { case canvasImageSource(CanvasImageSource) case imageData(ImageData) + var blob: Blob? { + switch self { + case let .blob(blob): return blob + default: return nil + } + } + + var canvasImageSource: CanvasImageSource? { + switch self { + case let .canvasImageSource(canvasImageSource): return canvasImageSource + default: return nil + } + } + + var imageData: ImageData? { + switch self { + case let .imageData(imageData): return imageData + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let blob: Blob = value.fromJSValue() { return .blob(blob) diff --git a/Sources/DOMKit/WebIDL/ImageBufferSource.swift b/Sources/DOMKit/WebIDL/ImageBufferSource.swift index 6252e898..0aa23282 100644 --- a/Sources/DOMKit/WebIDL/ImageBufferSource.swift +++ b/Sources/DOMKit/WebIDL/ImageBufferSource.swift @@ -11,6 +11,20 @@ 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) diff --git a/Sources/DOMKit/WebIDL/MediaList_or_String.swift b/Sources/DOMKit/WebIDL/MediaList_or_String.swift index 2ec77c17..1cdfebe4 100644 --- a/Sources/DOMKit/WebIDL/MediaList_or_String.swift +++ b/Sources/DOMKit/WebIDL/MediaList_or_String.swift @@ -11,6 +11,20 @@ public enum MediaList_or_String: JSValueCompatible, Any_MediaList_or_String { case mediaList(MediaList) case string(String) + var mediaList: MediaList? { + switch self { + case let .mediaList(mediaList): return mediaList + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let mediaList: MediaList = value.fromJSValue() { return .mediaList(mediaList) diff --git a/Sources/DOMKit/WebIDL/MediaProvider.swift b/Sources/DOMKit/WebIDL/MediaProvider.swift index 229ee101..159b49e0 100644 --- a/Sources/DOMKit/WebIDL/MediaProvider.swift +++ b/Sources/DOMKit/WebIDL/MediaProvider.swift @@ -13,6 +13,27 @@ public enum MediaProvider: JSValueCompatible, Any_MediaProvider { case mediaSource(MediaSource) case mediaStream(MediaStream) + var blob: Blob? { + switch self { + case let .blob(blob): return blob + default: return nil + } + } + + var mediaSource: MediaSource? { + switch self { + case let .mediaSource(mediaSource): return mediaSource + default: return nil + } + } + + var mediaStream: MediaStream? { + switch self { + case let .mediaStream(mediaStream): return mediaStream + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let blob: Blob = value.fromJSValue() { return .blob(blob) diff --git a/Sources/DOMKit/WebIDL/MessageEventSource.swift b/Sources/DOMKit/WebIDL/MessageEventSource.swift index b3ad48ac..bbbe2129 100644 --- a/Sources/DOMKit/WebIDL/MessageEventSource.swift +++ b/Sources/DOMKit/WebIDL/MessageEventSource.swift @@ -13,6 +13,27 @@ public enum MessageEventSource: JSValueCompatible, Any_MessageEventSource { case serviceWorker(ServiceWorker) case windowProxy(WindowProxy) + var messagePort: MessagePort? { + switch self { + case let .messagePort(messagePort): return messagePort + default: return nil + } + } + + var serviceWorker: ServiceWorker? { + switch self { + case let .serviceWorker(serviceWorker): return serviceWorker + default: return nil + } + } + + var windowProxy: WindowProxy? { + switch self { + case let .windowProxy(windowProxy): return windowProxy + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let messagePort: MessagePort = value.fromJSValue() { return .messagePort(messagePort) diff --git a/Sources/DOMKit/WebIDL/Node_or_String.swift b/Sources/DOMKit/WebIDL/Node_or_String.swift index f1424800..9efca3bf 100644 --- a/Sources/DOMKit/WebIDL/Node_or_String.swift +++ b/Sources/DOMKit/WebIDL/Node_or_String.swift @@ -11,6 +11,20 @@ public enum Node_or_String: JSValueCompatible, Any_Node_or_String { case node(Node) case string(String) + var node: Node? { + switch self { + case let .node(node): return node + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let node: Node = value.fromJSValue() { return .node(node) diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift b/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift index db97277e..ab247b2e 100644 --- a/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift +++ b/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift @@ -17,6 +17,41 @@ public enum OffscreenRenderingContext: JSValueCompatible, Any_OffscreenRendering case webGL2RenderingContext(WebGL2RenderingContext) case webGLRenderingContext(WebGLRenderingContext) + var gpuCanvasContext: GPUCanvasContext? { + switch self { + case let .gpuCanvasContext(gpuCanvasContext): return gpuCanvasContext + default: return nil + } + } + + var imageBitmapRenderingContext: ImageBitmapRenderingContext? { + switch self { + case let .imageBitmapRenderingContext(imageBitmapRenderingContext): return imageBitmapRenderingContext + default: return nil + } + } + + var offscreenCanvasRenderingContext2D: OffscreenCanvasRenderingContext2D? { + switch self { + case let .offscreenCanvasRenderingContext2D(offscreenCanvasRenderingContext2D): return offscreenCanvasRenderingContext2D + default: return nil + } + } + + var webGL2RenderingContext: WebGL2RenderingContext? { + switch self { + case let .webGL2RenderingContext(webGL2RenderingContext): return webGL2RenderingContext + default: return nil + } + } + + var webGLRenderingContext: WebGLRenderingContext? { + switch self { + case let .webGLRenderingContext(webGLRenderingContext): return webGLRenderingContext + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let gpuCanvasContext: GPUCanvasContext = value.fromJSValue() { return .gpuCanvasContext(gpuCanvasContext) diff --git a/Sources/DOMKit/WebIDL/Path2D_or_String.swift b/Sources/DOMKit/WebIDL/Path2D_or_String.swift index 32d02492..f0b175c5 100644 --- a/Sources/DOMKit/WebIDL/Path2D_or_String.swift +++ b/Sources/DOMKit/WebIDL/Path2D_or_String.swift @@ -11,6 +11,20 @@ public enum Path2D_or_String: JSValueCompatible, Any_Path2D_or_String { case path2D(Path2D) case string(String) + var path2D: Path2D? { + switch self { + case let .path2D(path2D): return path2D + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let path2D: Path2D = value.fromJSValue() { return .path2D(path2D) diff --git a/Sources/DOMKit/WebIDL/ReadableStreamController.swift b/Sources/DOMKit/WebIDL/ReadableStreamController.swift index beab5a57..35f64ee7 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamController.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamController.swift @@ -11,6 +11,20 @@ public enum ReadableStreamController: JSValueCompatible, Any_ReadableStreamContr 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) diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamReader.swift index 16d6ec44..03543e03 100644 --- a/Sources/DOMKit/WebIDL/ReadableStreamReader.swift +++ b/Sources/DOMKit/WebIDL/ReadableStreamReader.swift @@ -11,6 +11,20 @@ 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) diff --git a/Sources/DOMKit/WebIDL/RenderingContext.swift b/Sources/DOMKit/WebIDL/RenderingContext.swift index 021b4565..1b10d3eb 100644 --- a/Sources/DOMKit/WebIDL/RenderingContext.swift +++ b/Sources/DOMKit/WebIDL/RenderingContext.swift @@ -17,6 +17,41 @@ public enum RenderingContext: JSValueCompatible, Any_RenderingContext { case webGL2RenderingContext(WebGL2RenderingContext) case webGLRenderingContext(WebGLRenderingContext) + var canvasRenderingContext2D: CanvasRenderingContext2D? { + switch self { + case let .canvasRenderingContext2D(canvasRenderingContext2D): return canvasRenderingContext2D + default: return nil + } + } + + var gpuCanvasContext: GPUCanvasContext? { + switch self { + case let .gpuCanvasContext(gpuCanvasContext): return gpuCanvasContext + default: return nil + } + } + + var imageBitmapRenderingContext: ImageBitmapRenderingContext? { + switch self { + case let .imageBitmapRenderingContext(imageBitmapRenderingContext): return imageBitmapRenderingContext + default: return nil + } + } + + var webGL2RenderingContext: WebGL2RenderingContext? { + switch self { + case let .webGL2RenderingContext(webGL2RenderingContext): return webGL2RenderingContext + default: return nil + } + } + + var webGLRenderingContext: WebGLRenderingContext? { + switch self { + case let .webGLRenderingContext(webGLRenderingContext): return webGLRenderingContext + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let canvasRenderingContext2D: CanvasRenderingContext2D = value.fromJSValue() { return .canvasRenderingContext2D(canvasRenderingContext2D) diff --git a/Sources/DOMKit/WebIDL/RequestInfo.swift b/Sources/DOMKit/WebIDL/RequestInfo.swift index 6748724a..2019247c 100644 --- a/Sources/DOMKit/WebIDL/RequestInfo.swift +++ b/Sources/DOMKit/WebIDL/RequestInfo.swift @@ -11,6 +11,20 @@ public enum RequestInfo: JSValueCompatible, Any_RequestInfo { case request(Request) case string(String) + var request: Request? { + switch self { + case let .request(request): return request + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let request: Request = value.fromJSValue() { return .request(request) diff --git a/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift b/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift index fa3b15d1..e17ceccb 100644 --- a/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift +++ b/Sources/DOMKit/WebIDL/String_or_WorkerOptions.swift @@ -11,6 +11,20 @@ public enum String_or_WorkerOptions: JSValueCompatible, Any_String_or_WorkerOpti case string(String) case workerOptions(WorkerOptions) + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + + var workerOptions: WorkerOptions? { + switch self { + case let .workerOptions(workerOptions): return workerOptions + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let string: String = value.fromJSValue() { return .string(string) diff --git a/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift b/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift index f0afe12d..fd8a1617 100644 --- a/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift +++ b/Sources/DOMKit/WebIDL/String_or_record_String_to_String_or_seq_of_seq_of_String.swift @@ -13,6 +13,27 @@ public enum String_or_record_String_to_String_or_seq_of_seq_of_String: JSValueCo case record_String_to_String([String: String]) case seq_of_seq_of_String([[String]]) + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + + var record_String_to_String: [String: String]? { + switch self { + case let .record_String_to_String(record_String_to_String): return record_String_to_String + default: return nil + } + } + + var seq_of_seq_of_String: [[String]]? { + switch self { + case let .seq_of_seq_of_String(seq_of_seq_of_String): return seq_of_seq_of_String + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let string: String = value.fromJSValue() { return .string(string) diff --git a/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift b/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift index 0cd68d11..88d5c5c3 100644 --- a/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift +++ b/Sources/DOMKit/WebIDL/String_or_seq_of_Double.swift @@ -11,6 +11,20 @@ public enum String_or_seq_of_Double: JSValueCompatible, Any_String_or_seq_of_Dou case string(String) case seq_of_Double([Double]) + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + + var seq_of_Double: [Double]? { + switch self { + case let .seq_of_Double(seq_of_Double): return seq_of_Double + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let string: String = value.fromJSValue() { return .string(string) diff --git a/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift b/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift index fdd3419b..76ffbade 100644 --- a/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift +++ b/Sources/DOMKit/WebIDL/String_or_seq_of_String.swift @@ -11,6 +11,20 @@ public enum String_or_seq_of_String: JSValueCompatible, Any_String_or_seq_of_Str case string(String) case seq_of_String([String]) + 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 string: String = value.fromJSValue() { return .string(string) diff --git a/Sources/DOMKit/WebIDL/TimerHandler.swift b/Sources/DOMKit/WebIDL/TimerHandler.swift index 8c848736..c4a63ae6 100644 --- a/Sources/DOMKit/WebIDL/TimerHandler.swift +++ b/Sources/DOMKit/WebIDL/TimerHandler.swift @@ -11,6 +11,20 @@ public enum TimerHandler: JSValueCompatible, Any_TimerHandler { case jsFunction(JSFunction) case string(String) + var jsFunction: JSFunction? { + switch self { + case let .jsFunction(jsFunction): return jsFunction + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let jsFunction: JSFunction = value.fromJSValue() { return .jsFunction(jsFunction) diff --git a/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift b/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift index a30fb7ea..fc361f42 100644 --- a/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift +++ b/Sources/DOMKit/WebIDL/XMLHttpRequestBodyInit.swift @@ -17,6 +17,41 @@ public enum XMLHttpRequestBodyInit: JSValueCompatible, Any_XMLHttpRequestBodyIni case string(String) case urlSearchParams(URLSearchParams) + var blob: Blob? { + switch self { + case let .blob(blob): return blob + default: return nil + } + } + + var bufferSource: BufferSource? { + switch self { + case let .bufferSource(bufferSource): return bufferSource + default: return nil + } + } + + var formData: FormData? { + switch self { + case let .formData(formData): return formData + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + + var urlSearchParams: URLSearchParams? { + switch self { + case let .urlSearchParams(urlSearchParams): return urlSearchParams + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let blob: Blob = value.fromJSValue() { return .blob(blob) diff --git a/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift b/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift index 15b262ad..bd62b198 100644 --- a/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift +++ b/Sources/DOMKit/WebIDL/nullable_Double_or_seq_of_nullable_Double.swift @@ -11,6 +11,20 @@ public enum nullable_Double_or_seq_of_nullable_Double: JSValueCompatible, Any_nu case nullable_Double(Double?) case seq_of_nullable_Double([Double?]) + var nullable_Double: Double?? { + switch self { + case let .nullable_Double(nullable_Double): return nullable_Double + default: return nil + } + } + + var seq_of_nullable_Double: [Double?]? { + switch self { + case let .seq_of_nullable_Double(seq_of_nullable_Double): return seq_of_nullable_Double + default: return nil + } + } + public static func construct(from value: JSValue) -> Self? { if let nullable_Double: Double? = value.fromJSValue() { return .nullable_Double(nullable_Double) diff --git a/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift b/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift index 10819c3f..9624df68 100644 --- a/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift +++ b/Sources/WebIDLToSwift/UnionType+SwiftRepresentable.swift @@ -33,6 +33,8 @@ extension UnionType: SwiftRepresentable { public enum \(name): JSValueCompatible, Any_\(name) { \(lines: cases) + \(lines: accessors) + public static func construct(from value: JSValue) -> Self? { \(lines: constructors) return nil @@ -59,6 +61,19 @@ extension UnionType: SwiftRepresentable { } } + var accessors: [SwiftSource] { + zip(sortedTypes, sortedNames).map { type, name in + """ + var \(name): \(type)? { + switch self { + case let .\(name)(\(name)): return \(name) + default: return nil + } + } + """ + } + } + var constructors: [SwiftSource] { zip(sortedTypes, sortedNames).map { type, name in """ From 9bc4426e062ff646c9d3579d406cd4b43151a6f2 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 22 Apr 2022 20:42:02 -0400 Subject: [PATCH 119/124] hand-implement RenderingContext, OffscreenRenderingContext --- .../OffscreenRenderingContext.swift | 80 ++++++++--------- .../DOMKit/ECMAScript/RenderingContext.swift | 88 +++++++++++++++++++ Sources/DOMKit/WebIDL/RenderingContext.swift | 88 ------------------- Sources/WebIDLToSwift/IDLBuilder.swift | 2 + 4 files changed, 130 insertions(+), 128 deletions(-) rename Sources/DOMKit/{WebIDL => ECMAScript}/OffscreenRenderingContext.swift (51%) create mode 100644 Sources/DOMKit/ECMAScript/RenderingContext.swift delete mode 100644 Sources/DOMKit/WebIDL/RenderingContext.swift diff --git a/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift b/Sources/DOMKit/ECMAScript/OffscreenRenderingContext.swift similarity index 51% rename from Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift rename to Sources/DOMKit/ECMAScript/OffscreenRenderingContext.swift index ab247b2e..12bcb462 100644 --- a/Sources/DOMKit/WebIDL/OffscreenRenderingContext.swift +++ b/Sources/DOMKit/ECMAScript/OffscreenRenderingContext.swift @@ -4,25 +4,25 @@ import JavaScriptEventLoop import JavaScriptKit public protocol Any_OffscreenRenderingContext: ConvertibleToJSValue {} -extension GPUCanvasContext: Any_OffscreenRenderingContext {} +//extension GPUCanvasContext: Any_OffscreenRenderingContext {} extension ImageBitmapRenderingContext: Any_OffscreenRenderingContext {} extension OffscreenCanvasRenderingContext2D: Any_OffscreenRenderingContext {} -extension WebGL2RenderingContext: Any_OffscreenRenderingContext {} -extension WebGLRenderingContext: Any_OffscreenRenderingContext {} +//extension WebGL2RenderingContext: Any_OffscreenRenderingContext {} +//extension WebGLRenderingContext: Any_OffscreenRenderingContext {} public enum OffscreenRenderingContext: JSValueCompatible, Any_OffscreenRenderingContext { - case gpuCanvasContext(GPUCanvasContext) +// case gpuCanvasContext(GPUCanvasContext) case imageBitmapRenderingContext(ImageBitmapRenderingContext) case offscreenCanvasRenderingContext2D(OffscreenCanvasRenderingContext2D) - case webGL2RenderingContext(WebGL2RenderingContext) - case webGLRenderingContext(WebGLRenderingContext) +// case webGL2RenderingContext(WebGL2RenderingContext) +// case webGLRenderingContext(WebGLRenderingContext) - var gpuCanvasContext: GPUCanvasContext? { - switch self { - case let .gpuCanvasContext(gpuCanvasContext): return gpuCanvasContext - default: return nil - } - } +// var gpuCanvasContext: GPUCanvasContext? { +// switch self { +// case let .gpuCanvasContext(gpuCanvasContext): return gpuCanvasContext +// default: return nil +// } +// } var imageBitmapRenderingContext: ImageBitmapRenderingContext? { switch self { @@ -38,51 +38,51 @@ public enum OffscreenRenderingContext: JSValueCompatible, Any_OffscreenRendering } } - var webGL2RenderingContext: WebGL2RenderingContext? { - switch self { - case let .webGL2RenderingContext(webGL2RenderingContext): return webGL2RenderingContext - default: return nil - } - } - - var webGLRenderingContext: WebGLRenderingContext? { - switch self { - case let .webGLRenderingContext(webGLRenderingContext): return webGLRenderingContext - default: return nil - } - } +// var webGL2RenderingContext: WebGL2RenderingContext? { +// switch self { +// case let .webGL2RenderingContext(webGL2RenderingContext): return webGL2RenderingContext +// default: return nil +// } +// } +// +// var webGLRenderingContext: WebGLRenderingContext? { +// switch self { +// case let .webGLRenderingContext(webGLRenderingContext): return webGLRenderingContext +// default: return nil +// } +// } public static func construct(from value: JSValue) -> Self? { - if let gpuCanvasContext: GPUCanvasContext = value.fromJSValue() { - return .gpuCanvasContext(gpuCanvasContext) - } +// if let gpuCanvasContext: GPUCanvasContext = value.fromJSValue() { +// return .gpuCanvasContext(gpuCanvasContext) +// } if let imageBitmapRenderingContext: ImageBitmapRenderingContext = value.fromJSValue() { return .imageBitmapRenderingContext(imageBitmapRenderingContext) } if let offscreenCanvasRenderingContext2D: OffscreenCanvasRenderingContext2D = value.fromJSValue() { return .offscreenCanvasRenderingContext2D(offscreenCanvasRenderingContext2D) } - if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { - return .webGL2RenderingContext(webGL2RenderingContext) - } - if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { - return .webGLRenderingContext(webGLRenderingContext) - } +// if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { +// return .webGL2RenderingContext(webGL2RenderingContext) +// } +// if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { +// return .webGLRenderingContext(webGLRenderingContext) +// } return nil } public var jsValue: JSValue { switch self { - case let .gpuCanvasContext(gpuCanvasContext): - return gpuCanvasContext.jsValue +// case let .gpuCanvasContext(gpuCanvasContext): +// return gpuCanvasContext.jsValue case let .imageBitmapRenderingContext(imageBitmapRenderingContext): return imageBitmapRenderingContext.jsValue case let .offscreenCanvasRenderingContext2D(offscreenCanvasRenderingContext2D): return offscreenCanvasRenderingContext2D.jsValue - case let .webGL2RenderingContext(webGL2RenderingContext): - return webGL2RenderingContext.jsValue - case let .webGLRenderingContext(webGLRenderingContext): - return webGLRenderingContext.jsValue +// case let .webGL2RenderingContext(webGL2RenderingContext): +// return webGL2RenderingContext.jsValue +// case let .webGLRenderingContext(webGLRenderingContext): +// return webGLRenderingContext.jsValue } } } diff --git a/Sources/DOMKit/ECMAScript/RenderingContext.swift b/Sources/DOMKit/ECMAScript/RenderingContext.swift new file mode 100644 index 00000000..ad42b922 --- /dev/null +++ b/Sources/DOMKit/ECMAScript/RenderingContext.swift @@ -0,0 +1,88 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_RenderingContext: ConvertibleToJSValue {} +extension CanvasRenderingContext2D: Any_RenderingContext {} +//extension GPUCanvasContext: Any_RenderingContext {} +extension ImageBitmapRenderingContext: Any_RenderingContext {} +//extension WebGL2RenderingContext: Any_RenderingContext {} +//extension WebGLRenderingContext: Any_RenderingContext {} + +public enum RenderingContext: JSValueCompatible, Any_RenderingContext { + case canvasRenderingContext2D(CanvasRenderingContext2D) +// case gpuCanvasContext(GPUCanvasContext) + case imageBitmapRenderingContext(ImageBitmapRenderingContext) +// case webGL2RenderingContext(WebGL2RenderingContext) +// case webGLRenderingContext(WebGLRenderingContext) + + var canvasRenderingContext2D: CanvasRenderingContext2D? { + switch self { + case let .canvasRenderingContext2D(canvasRenderingContext2D): return canvasRenderingContext2D + default: return nil + } + } + +// var gpuCanvasContext: GPUCanvasContext? { +// switch self { +// case let .gpuCanvasContext(gpuCanvasContext): return gpuCanvasContext +// default: return nil +// } +// } + + var imageBitmapRenderingContext: ImageBitmapRenderingContext? { + switch self { + case let .imageBitmapRenderingContext(imageBitmapRenderingContext): return imageBitmapRenderingContext + default: return nil + } + } + +// var webGL2RenderingContext: WebGL2RenderingContext? { +// switch self { +// case let .webGL2RenderingContext(webGL2RenderingContext): return webGL2RenderingContext +// default: return nil +// } +// } +// +// var webGLRenderingContext: WebGLRenderingContext? { +// switch self { +// case let .webGLRenderingContext(webGLRenderingContext): return webGLRenderingContext +// default: return nil +// } +// } + + public static func construct(from value: JSValue) -> Self? { + if let canvasRenderingContext2D: CanvasRenderingContext2D = value.fromJSValue() { + return .canvasRenderingContext2D(canvasRenderingContext2D) + } +// if let gpuCanvasContext: GPUCanvasContext = value.fromJSValue() { +// return .gpuCanvasContext(gpuCanvasContext) +// } + if let imageBitmapRenderingContext: ImageBitmapRenderingContext = value.fromJSValue() { + return .imageBitmapRenderingContext(imageBitmapRenderingContext) + } +// if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { +// return .webGL2RenderingContext(webGL2RenderingContext) +// } +// if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { +// return .webGLRenderingContext(webGLRenderingContext) +// } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .canvasRenderingContext2D(canvasRenderingContext2D): + return canvasRenderingContext2D.jsValue +// case let .gpuCanvasContext(gpuCanvasContext): +// return gpuCanvasContext.jsValue + case let .imageBitmapRenderingContext(imageBitmapRenderingContext): + return imageBitmapRenderingContext.jsValue +// case let .webGL2RenderingContext(webGL2RenderingContext): +// return webGL2RenderingContext.jsValue +// case let .webGLRenderingContext(webGLRenderingContext): +// return webGLRenderingContext.jsValue + } + } +} diff --git a/Sources/DOMKit/WebIDL/RenderingContext.swift b/Sources/DOMKit/WebIDL/RenderingContext.swift deleted file mode 100644 index 1b10d3eb..00000000 --- a/Sources/DOMKit/WebIDL/RenderingContext.swift +++ /dev/null @@ -1,88 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_RenderingContext: ConvertibleToJSValue {} -extension CanvasRenderingContext2D: Any_RenderingContext {} -extension GPUCanvasContext: Any_RenderingContext {} -extension ImageBitmapRenderingContext: Any_RenderingContext {} -extension WebGL2RenderingContext: Any_RenderingContext {} -extension WebGLRenderingContext: Any_RenderingContext {} - -public enum RenderingContext: JSValueCompatible, Any_RenderingContext { - case canvasRenderingContext2D(CanvasRenderingContext2D) - case gpuCanvasContext(GPUCanvasContext) - case imageBitmapRenderingContext(ImageBitmapRenderingContext) - case webGL2RenderingContext(WebGL2RenderingContext) - case webGLRenderingContext(WebGLRenderingContext) - - var canvasRenderingContext2D: CanvasRenderingContext2D? { - switch self { - case let .canvasRenderingContext2D(canvasRenderingContext2D): return canvasRenderingContext2D - default: return nil - } - } - - var gpuCanvasContext: GPUCanvasContext? { - switch self { - case let .gpuCanvasContext(gpuCanvasContext): return gpuCanvasContext - default: return nil - } - } - - var imageBitmapRenderingContext: ImageBitmapRenderingContext? { - switch self { - case let .imageBitmapRenderingContext(imageBitmapRenderingContext): return imageBitmapRenderingContext - default: return nil - } - } - - var webGL2RenderingContext: WebGL2RenderingContext? { - switch self { - case let .webGL2RenderingContext(webGL2RenderingContext): return webGL2RenderingContext - default: return nil - } - } - - var webGLRenderingContext: WebGLRenderingContext? { - switch self { - case let .webGLRenderingContext(webGLRenderingContext): return webGLRenderingContext - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let canvasRenderingContext2D: CanvasRenderingContext2D = value.fromJSValue() { - return .canvasRenderingContext2D(canvasRenderingContext2D) - } - if let gpuCanvasContext: GPUCanvasContext = value.fromJSValue() { - return .gpuCanvasContext(gpuCanvasContext) - } - if let imageBitmapRenderingContext: ImageBitmapRenderingContext = value.fromJSValue() { - return .imageBitmapRenderingContext(imageBitmapRenderingContext) - } - if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { - return .webGL2RenderingContext(webGL2RenderingContext) - } - if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { - return .webGLRenderingContext(webGLRenderingContext) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .canvasRenderingContext2D(canvasRenderingContext2D): - return canvasRenderingContext2D.jsValue - case let .gpuCanvasContext(gpuCanvasContext): - return gpuCanvasContext.jsValue - case let .imageBitmapRenderingContext(imageBitmapRenderingContext): - return imageBitmapRenderingContext.jsValue - case let .webGL2RenderingContext(webGL2RenderingContext): - return webGL2RenderingContext.jsValue - case let .webGLRenderingContext(webGLRenderingContext): - return webGLRenderingContext.jsValue - } - } -} diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index de3521fa..f08a6a8a 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -21,6 +21,8 @@ enum IDLBuilder { "BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray", // RotationMatrixType "DOMMatrix_or_Float32Array_or_Float64Array", + "OffscreenRenderingContext", + "RenderingContext", ] static let outDir = "Sources/DOMKit/WebIDL/" From 62549750ff778205024cd82d720c66f216f25d92 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 22 Apr 2022 20:57:18 -0400 Subject: [PATCH 120/124] cut some more --- .../CanvasImageSource.swift | 26 +- Sources/DOMKit/ECMAScript/Support.swift | 7 +- Sources/DOMKit/WebIDL/AlphaOption.swift | 22 -- Sources/DOMKit/WebIDL/AppendMode.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/AudioTrack.swift | 4 - Sources/DOMKit/WebIDL/BitrateMode.swift | 22 -- Sources/DOMKit/WebIDL/BlobEvent.swift | 24 -- Sources/DOMKit/WebIDL/BlobEventInit.swift | 25 -- .../DOMKit/WebIDL/Blob_or_MediaSource.swift | 46 --- .../Bool_or_MediaTrackConstraints.swift | 46 --- Sources/DOMKit/WebIDL/CSSPseudoElement.swift | 29 -- .../WebIDL/CSSPseudoElement_or_Element.swift | 46 --- .../CameraDevicePermissionDescriptor.swift | 20 -- Sources/DOMKit/WebIDL/CodecState.swift | 23 -- Sources/DOMKit/WebIDL/ConstrainBoolean.swift | 46 --- .../WebIDL/ConstrainBooleanParameters.swift | 25 -- .../DOMKit/WebIDL/ConstrainDOMString.swift | 60 ---- .../WebIDL/ConstrainDOMStringParameters.swift | 25 -- Sources/DOMKit/WebIDL/ConstrainDouble.swift | 46 --- .../DOMKit/WebIDL/ConstrainDoubleRange.swift | 25 -- Sources/DOMKit/WebIDL/ConstrainULong.swift | 46 --- .../DOMKit/WebIDL/ConstrainULongRange.swift | 25 -- .../WebIDL/DevicePermissionDescriptor.swift | 20 -- Sources/DOMKit/WebIDL/Document.swift | 4 - Sources/DOMKit/WebIDL/DoubleRange.swift | 25 -- Sources/DOMKit/WebIDL/Element.swift | 5 - 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 -- Sources/DOMKit/WebIDL/EndOfStreamError.swift | 22 -- Sources/DOMKit/WebIDL/GetSVGDocument.swift | 12 - Sources/DOMKit/WebIDL/HTMLMediaElement.swift | 4 +- .../DOMKit/WebIDL/HTMLOrSVGImageElement.swift | 46 --- .../WebIDL/HTMLOrSVGScriptElement.swift | 46 --- .../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/InputDeviceInfo.swift | 17 - Sources/DOMKit/WebIDL/LatencyMode.swift | 22 -- Sources/DOMKit/WebIDL/MediaDeviceInfo.swift | 35 -- Sources/DOMKit/WebIDL/MediaDeviceKind.swift | 23 -- Sources/DOMKit/WebIDL/MediaDevices.swift | 45 --- Sources/DOMKit/WebIDL/MediaProvider.swift | 60 ---- Sources/DOMKit/WebIDL/MediaRecorder.swift | 94 ----- .../WebIDL/MediaRecorderErrorEvent.swift | 20 -- .../WebIDL/MediaRecorderErrorEventInit.swift | 20 -- .../DOMKit/WebIDL/MediaRecorderOptions.swift | 40 --- Sources/DOMKit/WebIDL/MediaSource.swift | 78 ----- Sources/DOMKit/WebIDL/MediaStream.swift | 75 ---- .../WebIDL/MediaStreamConstraints.swift | 25 -- Sources/DOMKit/WebIDL/MediaStreamTrack.swift | 85 ----- .../DOMKit/WebIDL/MediaStreamTrackEvent.swift | 20 -- .../WebIDL/MediaStreamTrackEventInit.swift | 20 -- .../DOMKit/WebIDL/MediaStreamTrackState.swift | 22 -- .../WebIDL/MediaTrackCapabilities.swift | 90 ----- .../WebIDL/MediaTrackConstraintSet.swift | 90 ----- .../DOMKit/WebIDL/MediaTrackConstraints.swift | 20 -- .../DOMKit/WebIDL/MediaTrackSettings.swift | 90 ----- .../MediaTrackSupportedConstraints.swift | 90 ----- Sources/DOMKit/WebIDL/Navigator.swift | 6 - .../DOMKit/WebIDL/OverconstrainedError.swift | 20 -- Sources/DOMKit/WebIDL/PlaneLayout.swift | 25 -- Sources/DOMKit/WebIDL/ReadyState.swift | 23 -- Sources/DOMKit/WebIDL/RecordingState.swift | 23 -- Sources/DOMKit/WebIDL/SVGAElement.swift | 88 ----- Sources/DOMKit/WebIDL/SVGAngle.swift | 50 --- Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift | 22 -- .../DOMKit/WebIDL/SVGAnimatedBoolean.swift | 22 -- .../WebIDL/SVGAnimatedEnumeration.swift | 22 -- .../DOMKit/WebIDL/SVGAnimatedInteger.swift | 22 -- Sources/DOMKit/WebIDL/SVGAnimatedLength.swift | 22 -- .../DOMKit/WebIDL/SVGAnimatedLengthList.swift | 22 -- Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift | 22 -- .../DOMKit/WebIDL/SVGAnimatedNumberList.swift | 22 -- Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift | 11 - .../SVGAnimatedPreserveAspectRatio.swift | 22 -- Sources/DOMKit/WebIDL/SVGAnimatedRect.swift | 22 -- Sources/DOMKit/WebIDL/SVGAnimatedString.swift | 22 -- .../WebIDL/SVGAnimatedTransformList.swift | 22 -- .../DOMKit/WebIDL/SVGBoundingBoxOptions.swift | 35 -- Sources/DOMKit/WebIDL/SVGCircleElement.swift | 24 -- Sources/DOMKit/WebIDL/SVGDefsElement.swift | 12 - Sources/DOMKit/WebIDL/SVGDescElement.swift | 12 - Sources/DOMKit/WebIDL/SVGElement.swift | 22 -- .../DOMKit/WebIDL/SVGElementInstance.swift | 11 - Sources/DOMKit/WebIDL/SVGEllipseElement.swift | 28 -- Sources/DOMKit/WebIDL/SVGFitToViewBox.swift | 11 - .../WebIDL/SVGForeignObjectElement.swift | 28 -- Sources/DOMKit/WebIDL/SVGGElement.swift | 12 - .../DOMKit/WebIDL/SVGGeometryElement.swift | 36 -- .../DOMKit/WebIDL/SVGGradientElement.swift | 32 -- .../DOMKit/WebIDL/SVGGraphicsElement.swift | 31 -- Sources/DOMKit/WebIDL/SVGImageElement.swift | 36 -- Sources/DOMKit/WebIDL/SVGLength.swift | 62 ---- Sources/DOMKit/WebIDL/SVGLengthList.swift | 58 ---- Sources/DOMKit/WebIDL/SVGLineElement.swift | 28 -- .../WebIDL/SVGLinearGradientElement.swift | 28 -- Sources/DOMKit/WebIDL/SVGMarkerElement.swift | 66 ---- .../DOMKit/WebIDL/SVGMetadataElement.swift | 12 - Sources/DOMKit/WebIDL/SVGNumber.swift | 18 - Sources/DOMKit/WebIDL/SVGNumberList.swift | 58 ---- Sources/DOMKit/WebIDL/SVGPathElement.swift | 12 - Sources/DOMKit/WebIDL/SVGPatternElement.swift | 40 --- Sources/DOMKit/WebIDL/SVGPointList.swift | 58 ---- Sources/DOMKit/WebIDL/SVGPolygonElement.swift | 12 - .../DOMKit/WebIDL/SVGPolylineElement.swift | 12 - .../WebIDL/SVGPreserveAspectRatio.swift | 50 --- .../WebIDL/SVGRadialGradientElement.swift | 36 -- Sources/DOMKit/WebIDL/SVGRectElement.swift | 36 -- Sources/DOMKit/WebIDL/SVGSVGElement.swift | 126 ------- Sources/DOMKit/WebIDL/SVGScriptElement.swift | 20 -- Sources/DOMKit/WebIDL/SVGStopElement.swift | 16 - Sources/DOMKit/WebIDL/SVGStringList.swift | 58 ---- Sources/DOMKit/WebIDL/SVGStyleElement.swift | 24 -- Sources/DOMKit/WebIDL/SVGSwitchElement.swift | 12 - Sources/DOMKit/WebIDL/SVGSymbolElement.swift | 12 - Sources/DOMKit/WebIDL/SVGTSpanElement.swift | 12 - Sources/DOMKit/WebIDL/SVGTests.swift | 11 - .../DOMKit/WebIDL/SVGTextContentElement.swift | 71 ---- Sources/DOMKit/WebIDL/SVGTextElement.swift | 12 - .../DOMKit/WebIDL/SVGTextPathElement.swift | 36 -- .../WebIDL/SVGTextPositioningElement.swift | 32 -- Sources/DOMKit/WebIDL/SVGTitleElement.swift | 12 - Sources/DOMKit/WebIDL/SVGTransform.swift | 70 ---- Sources/DOMKit/WebIDL/SVGTransformList.swift | 68 ---- Sources/DOMKit/WebIDL/SVGURIReference.swift | 9 - Sources/DOMKit/WebIDL/SVGUnitTypes.swift | 20 -- Sources/DOMKit/WebIDL/SVGUseElement.swift | 36 -- .../WebIDL/SVGUseElementShadowRoot.swift | 12 - Sources/DOMKit/WebIDL/SVGViewElement.swift | 12 - Sources/DOMKit/WebIDL/ShadowAnimation.swift | 20 -- Sources/DOMKit/WebIDL/SourceBuffer.swift | 88 ----- Sources/DOMKit/WebIDL/SourceBufferList.swift | 28 -- Sources/DOMKit/WebIDL/Strings.swift | 322 ------------------ Sources/DOMKit/WebIDL/SvcOutputMetadata.swift | 20 -- Sources/DOMKit/WebIDL/TextTrack.swift | 4 - Sources/DOMKit/WebIDL/Typedefs.swift | 7 - Sources/DOMKit/WebIDL/ULongRange.swift | 25 -- .../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 -- .../DOMKit/WebIDL/VideoFacingModeEnum.swift | 24 -- 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 -- .../DOMKit/WebIDL/VideoResizeModeEnum.swift | 22 -- Sources/DOMKit/WebIDL/VideoTrack.swift | 4 - .../WebIDL/VideoTransferCharacteristics.swift | 23 -- Sources/WebIDLToSwift/IDLBuilder.swift | 8 +- parse-idl/parse-all.js | 25 +- 184 files changed, 49 insertions(+), 6397 deletions(-) rename Sources/DOMKit/{WebIDL => ECMAScript}/CanvasImageSource.swift (86%) delete mode 100644 Sources/DOMKit/WebIDL/AlphaOption.swift delete mode 100644 Sources/DOMKit/WebIDL/AppendMode.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/BitrateMode.swift delete mode 100644 Sources/DOMKit/WebIDL/BlobEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/BlobEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift delete mode 100644 Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSPseudoElement.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift delete mode 100644 Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/CodecState.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainBoolean.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainDOMString.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainDouble.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainULong.swift delete mode 100644 Sources/DOMKit/WebIDL/ConstrainULongRange.swift delete mode 100644 Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift delete mode 100644 Sources/DOMKit/WebIDL/DoubleRange.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/EndOfStreamError.swift delete mode 100644 Sources/DOMKit/WebIDL/GetSVGDocument.swift delete mode 100644 Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift delete mode 100644 Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.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/InputDeviceInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/LatencyMode.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaDeviceInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaDeviceKind.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaDevices.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaProvider.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaRecorder.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaRecorderOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaSource.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStream.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamConstraints.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrack.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaStreamTrackState.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaTrackConstraints.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaTrackSettings.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift delete mode 100644 Sources/DOMKit/WebIDL/OverconstrainedError.swift delete mode 100644 Sources/DOMKit/WebIDL/PlaneLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadyState.swift delete mode 100644 Sources/DOMKit/WebIDL/RecordingState.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAngle.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedLength.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedRect.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedString.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGCircleElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGDefsElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGDescElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGElementInstance.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGEllipseElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGFitToViewBox.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGGElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGGeometryElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGGradientElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGGraphicsElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGImageElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGLength.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGLengthList.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGLineElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGMarkerElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGMetadataElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGNumber.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGNumberList.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGPathElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGPatternElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGPointList.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGPolygonElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGPolylineElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGRectElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGSVGElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGScriptElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGStopElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGStringList.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGStyleElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGSwitchElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGSymbolElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGTSpanElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGTests.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGTextContentElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGTextElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGTextPathElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGTitleElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGTransform.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGTransformList.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGURIReference.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGUnitTypes.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGUseElement.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift delete mode 100644 Sources/DOMKit/WebIDL/SVGViewElement.swift delete mode 100644 Sources/DOMKit/WebIDL/ShadowAnimation.swift delete mode 100644 Sources/DOMKit/WebIDL/SourceBuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/SourceBufferList.swift delete mode 100644 Sources/DOMKit/WebIDL/SvcOutputMetadata.swift delete mode 100644 Sources/DOMKit/WebIDL/ULongRange.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/VideoFacingModeEnum.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/VideoResizeModeEnum.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift diff --git a/Sources/DOMKit/WebIDL/CanvasImageSource.swift b/Sources/DOMKit/ECMAScript/CanvasImageSource.swift similarity index 86% rename from Sources/DOMKit/WebIDL/CanvasImageSource.swift rename to Sources/DOMKit/ECMAScript/CanvasImageSource.swift index c1ba2291..9c93d9b6 100644 --- a/Sources/DOMKit/WebIDL/CanvasImageSource.swift +++ b/Sources/DOMKit/ECMAScript/CanvasImageSource.swift @@ -9,7 +9,7 @@ extension HTMLOrSVGImageElement: Any_CanvasImageSource {} extension HTMLVideoElement: Any_CanvasImageSource {} extension ImageBitmap: Any_CanvasImageSource {} extension OffscreenCanvas: Any_CanvasImageSource {} -extension VideoFrame: Any_CanvasImageSource {} +//extension VideoFrame: Any_CanvasImageSource {} public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { case htmlCanvasElement(HTMLCanvasElement) @@ -17,7 +17,7 @@ public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { case htmlVideoElement(HTMLVideoElement) case imageBitmap(ImageBitmap) case offscreenCanvas(OffscreenCanvas) - case videoFrame(VideoFrame) +// case videoFrame(VideoFrame) var htmlCanvasElement: HTMLCanvasElement? { switch self { @@ -54,12 +54,12 @@ public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { } } - var videoFrame: VideoFrame? { - switch self { - case let .videoFrame(videoFrame): return videoFrame - 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() { @@ -77,9 +77,9 @@ public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { if let offscreenCanvas: OffscreenCanvas = value.fromJSValue() { return .offscreenCanvas(offscreenCanvas) } - if let videoFrame: VideoFrame = value.fromJSValue() { - return .videoFrame(videoFrame) - } +// if let videoFrame: VideoFrame = value.fromJSValue() { +// return .videoFrame(videoFrame) +// } return nil } @@ -95,8 +95,8 @@ public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource { return imageBitmap.jsValue case let .offscreenCanvas(offscreenCanvas): return offscreenCanvas.jsValue - case let .videoFrame(videoFrame): - return videoFrame.jsValue +// case let .videoFrame(videoFrame): +// return videoFrame.jsValue } } } diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index 346486b8..c06317b6 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -14,6 +14,9 @@ public extension HTMLElement { public let globalThis = Window(from: JSObject.global.jsValue)! public typealias Uint8ClampedArray = JSUInt8ClampedArray -//public typealias CSSColorValue_or_CSSStyleValue = CSSStyleValue -//public typealias Any_CSSColorValue_or_CSSStyleValue = CSSStyleValue +// public typealias CSSColorValue_or_CSSStyleValue = CSSStyleValue +// public typealias Any_CSSColorValue_or_CSSStyleValue = CSSStyleValue +public typealias Blob_or_MediaSource = Blob +public typealias HTMLOrSVGImageElement = HTMLImageElement +public typealias HTMLOrSVGScriptElement = HTMLScriptElement public typealias CustomElementConstructor = JSFunction 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/AppendMode.swift b/Sources/DOMKit/WebIDL/AppendMode.swift deleted file mode 100644 index 23431206..00000000 --- a/Sources/DOMKit/WebIDL/AppendMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AppendMode: JSString, JSValueCompatible { - case segments = "segments" - case sequence = "sequence" - - @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/AudioTrack.swift b/Sources/DOMKit/WebIDL/AudioTrack.swift index a04c4ffb..5ff80c06 100644 --- a/Sources/DOMKit/WebIDL/AudioTrack.swift +++ b/Sources/DOMKit/WebIDL/AudioTrack.swift @@ -14,7 +14,6 @@ public class AudioTrack: JSBridgedClass { _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) _enabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.enabled) - _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) self.jsObject = jsObject } @@ -32,7 +31,4 @@ public class AudioTrack: JSBridgedClass { @ReadWriteAttribute public var enabled: Bool - - @ReadonlyAttribute - public var sourceBuffer: SourceBuffer? } diff --git a/Sources/DOMKit/WebIDL/BitrateMode.swift b/Sources/DOMKit/WebIDL/BitrateMode.swift deleted file mode 100644 index b0001ae7..00000000 --- a/Sources/DOMKit/WebIDL/BitrateMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 } -} diff --git a/Sources/DOMKit/WebIDL/BlobEvent.swift b/Sources/DOMKit/WebIDL/BlobEvent.swift deleted file mode 100644 index 2f09f782..00000000 --- a/Sources/DOMKit/WebIDL/BlobEvent.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/BlobEventInit.swift b/Sources/DOMKit/WebIDL/BlobEventInit.swift deleted file mode 100644 index adb0fd32..00000000 --- a/Sources/DOMKit/WebIDL/BlobEventInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift b/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift deleted file mode 100644 index a2466748..00000000 --- a/Sources/DOMKit/WebIDL/Blob_or_MediaSource.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Blob_or_MediaSource: ConvertibleToJSValue {} -extension Blob: Any_Blob_or_MediaSource {} -extension MediaSource: Any_Blob_or_MediaSource {} - -public enum Blob_or_MediaSource: JSValueCompatible, Any_Blob_or_MediaSource { - case blob(Blob) - case mediaSource(MediaSource) - - var blob: Blob? { - switch self { - case let .blob(blob): return blob - default: return nil - } - } - - var mediaSource: MediaSource? { - switch self { - case let .mediaSource(mediaSource): return mediaSource - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let blob: Blob = value.fromJSValue() { - return .blob(blob) - } - if let mediaSource: MediaSource = value.fromJSValue() { - return .mediaSource(mediaSource) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .blob(blob): - return blob.jsValue - case let .mediaSource(mediaSource): - return mediaSource.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift b/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift deleted file mode 100644 index 1c9c71e0..00000000 --- a/Sources/DOMKit/WebIDL/Bool_or_MediaTrackConstraints.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 - } - } -} diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement.swift deleted file mode 100644 index f3302eaf..00000000 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement.swift +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSPseudoElement: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPseudoElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _element = ReadonlyAttribute(jsObject: jsObject, name: Strings.element) - _parent = ReadonlyAttribute(jsObject: jsObject, name: Strings.parent) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var type: String - - @ReadonlyAttribute - public var element: Element - - @ReadonlyAttribute - public var parent: CSSPseudoElement_or_Element - - @inlinable public func pseudo(type: String) -> CSSPseudoElement? { - let this = jsObject - return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift b/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift deleted file mode 100644 index 3c06e5d5..00000000 --- a/Sources/DOMKit/WebIDL/CSSPseudoElement_or_Element.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_CSSPseudoElement_or_Element: ConvertibleToJSValue {} -extension CSSPseudoElement: Any_CSSPseudoElement_or_Element {} -extension Element: Any_CSSPseudoElement_or_Element {} - -public enum CSSPseudoElement_or_Element: JSValueCompatible, Any_CSSPseudoElement_or_Element { - case cssPseudoElement(CSSPseudoElement) - case element(Element) - - var cssPseudoElement: CSSPseudoElement? { - switch self { - case let .cssPseudoElement(cssPseudoElement): return cssPseudoElement - default: return nil - } - } - - var element: Element? { - switch self { - case let .element(element): return element - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let cssPseudoElement: CSSPseudoElement = value.fromJSValue() { - return .cssPseudoElement(cssPseudoElement) - } - if let element: Element = value.fromJSValue() { - return .element(element) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .cssPseudoElement(cssPseudoElement): - return cssPseudoElement.jsValue - case let .element(element): - return element.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift b/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift deleted file mode 100644 index ee012fa8..00000000 --- a/Sources/DOMKit/WebIDL/CameraDevicePermissionDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} 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/ConstrainBoolean.swift b/Sources/DOMKit/WebIDL/ConstrainBoolean.swift deleted file mode 100644 index 38559275..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainBoolean.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 - } - } -} diff --git a/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift b/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift deleted file mode 100644 index aed2cd3b..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainBooleanParameters.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/ConstrainDOMString.swift b/Sources/DOMKit/WebIDL/ConstrainDOMString.swift deleted file mode 100644 index 5c2cb816..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainDOMString.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 - } - } -} diff --git a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift b/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift deleted file mode 100644 index 8a51b973..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainDOMStringParameters.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/ConstrainDouble.swift b/Sources/DOMKit/WebIDL/ConstrainDouble.swift deleted file mode 100644 index 41993e8a..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainDouble.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 - } - } -} diff --git a/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift b/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift deleted file mode 100644 index 9ee176e9..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainDoubleRange.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/ConstrainULong.swift b/Sources/DOMKit/WebIDL/ConstrainULong.swift deleted file mode 100644 index 614cf30b..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainULong.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 - } - } -} diff --git a/Sources/DOMKit/WebIDL/ConstrainULongRange.swift b/Sources/DOMKit/WebIDL/ConstrainULongRange.swift deleted file mode 100644 index 5a87be30..00000000 --- a/Sources/DOMKit/WebIDL/ConstrainULongRange.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift b/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift deleted file mode 100644 index 92ae09de..00000000 --- a/Sources/DOMKit/WebIDL/DevicePermissionDescriptor.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/Document.swift b/Sources/DOMKit/WebIDL/Document.swift index 7f15e6fc..e4c2ae73 100644 --- a/Sources/DOMKit/WebIDL/Document.swift +++ b/Sources/DOMKit/WebIDL/Document.swift @@ -48,7 +48,6 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN _anchors = ReadonlyAttribute(jsObject: jsObject, name: Strings.anchors) _applets = ReadonlyAttribute(jsObject: jsObject, name: Strings.applets) _all = ReadonlyAttribute(jsObject: jsObject, name: Strings.all) - _rootElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.rootElement) _timeline = ReadonlyAttribute(jsObject: jsObject, name: Strings.timeline) super.init(unsafelyWrapping: jsObject) } @@ -348,9 +347,6 @@ public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentN @ReadonlyAttribute public var all: HTMLAllCollection - @ReadonlyAttribute - public var rootElement: SVGSVGElement? - @ReadonlyAttribute public var timeline: DocumentTimeline } diff --git a/Sources/DOMKit/WebIDL/DoubleRange.swift b/Sources/DOMKit/WebIDL/DoubleRange.swift deleted file mode 100644 index b58107cf..00000000 --- a/Sources/DOMKit/WebIDL/DoubleRange.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/Element.swift b/Sources/DOMKit/WebIDL/Element.swift index f5cedce7..6e400022 100644 --- a/Sources/DOMKit/WebIDL/Element.swift +++ b/Sources/DOMKit/WebIDL/Element.swift @@ -20,11 +20,6 @@ public class Element: Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slo super.init(unsafelyWrapping: jsObject) } - @inlinable public func pseudo(type: String) -> CSSPseudoElement? { - let this = jsObject - return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } - @ReadonlyAttribute public var namespaceURI: String? 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/EndOfStreamError.swift b/Sources/DOMKit/WebIDL/EndOfStreamError.swift deleted file mode 100644 index aa1ad8a9..00000000 --- a/Sources/DOMKit/WebIDL/EndOfStreamError.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum EndOfStreamError: JSString, JSValueCompatible { - case network = "network" - case decode = "decode" - - @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/GetSVGDocument.swift b/Sources/DOMKit/WebIDL/GetSVGDocument.swift deleted file mode 100644 index 224ca574..00000000 --- a/Sources/DOMKit/WebIDL/GetSVGDocument.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol GetSVGDocument: JSBridgedClass {} -public extension GetSVGDocument { - @inlinable func getSVGDocument() -> Document { - let this = jsObject - return this[Strings.getSVGDocument].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift index 505b4239..fe74c1b3 100644 --- a/Sources/DOMKit/WebIDL/HTMLMediaElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLMediaElement.swift @@ -9,7 +9,6 @@ public class HTMLMediaElement: HTMLElement { public required init(unsafelyWrapping jsObject: JSObject) { _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) _src = ReadWriteAttribute(jsObject: jsObject, name: Strings.src) - _srcObject = ReadWriteAttribute(jsObject: jsObject, name: Strings.srcObject) _currentSrc = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentSrc) _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Strings.crossOrigin) _networkState = ReadonlyAttribute(jsObject: jsObject, name: Strings.networkState) @@ -44,8 +43,7 @@ public class HTMLMediaElement: HTMLElement { @ReadWriteAttribute public var src: String - @ReadWriteAttribute - public var srcObject: MediaProvider? + // XXX: member 'srcObject' is ignored @ReadonlyAttribute public var currentSrc: String diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift deleted file mode 100644 index d4b2c2d8..00000000 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGImageElement.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_HTMLOrSVGImageElement: ConvertibleToJSValue {} -extension HTMLImageElement: Any_HTMLOrSVGImageElement {} -extension SVGImageElement: Any_HTMLOrSVGImageElement {} - -public enum HTMLOrSVGImageElement: JSValueCompatible, Any_HTMLOrSVGImageElement { - case htmlImageElement(HTMLImageElement) - case svgImageElement(SVGImageElement) - - var htmlImageElement: HTMLImageElement? { - switch self { - case let .htmlImageElement(htmlImageElement): return htmlImageElement - default: return nil - } - } - - var svgImageElement: SVGImageElement? { - switch self { - case let .svgImageElement(svgImageElement): return svgImageElement - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let htmlImageElement: HTMLImageElement = value.fromJSValue() { - return .htmlImageElement(htmlImageElement) - } - if let svgImageElement: SVGImageElement = value.fromJSValue() { - return .svgImageElement(svgImageElement) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .htmlImageElement(htmlImageElement): - return htmlImageElement.jsValue - case let .svgImageElement(svgImageElement): - return svgImageElement.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift b/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift deleted file mode 100644 index cd4ac958..00000000 --- a/Sources/DOMKit/WebIDL/HTMLOrSVGScriptElement.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_HTMLOrSVGScriptElement: ConvertibleToJSValue {} -extension HTMLScriptElement: Any_HTMLOrSVGScriptElement {} -extension SVGScriptElement: Any_HTMLOrSVGScriptElement {} - -public enum HTMLOrSVGScriptElement: JSValueCompatible, Any_HTMLOrSVGScriptElement { - case htmlScriptElement(HTMLScriptElement) - case svgScriptElement(SVGScriptElement) - - var htmlScriptElement: HTMLScriptElement? { - switch self { - case let .htmlScriptElement(htmlScriptElement): return htmlScriptElement - default: return nil - } - } - - var svgScriptElement: SVGScriptElement? { - switch self { - case let .svgScriptElement(svgScriptElement): return svgScriptElement - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let htmlScriptElement: HTMLScriptElement = value.fromJSValue() { - return .htmlScriptElement(htmlScriptElement) - } - if let svgScriptElement: SVGScriptElement = value.fromJSValue() { - return .svgScriptElement(svgScriptElement) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .htmlScriptElement(htmlScriptElement): - return htmlScriptElement.jsValue - case let .svgScriptElement(svgScriptElement): - return svgScriptElement.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/InputDeviceInfo.swift b/Sources/DOMKit/WebIDL/InputDeviceInfo.swift deleted file mode 100644 index d6170195..00000000 --- a/Sources/DOMKit/WebIDL/InputDeviceInfo.swift +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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()! - } -} 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/MediaDeviceInfo.swift b/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift deleted file mode 100644 index 1f063478..00000000 --- a/Sources/DOMKit/WebIDL/MediaDeviceInfo.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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()! - } -} diff --git a/Sources/DOMKit/WebIDL/MediaDeviceKind.swift b/Sources/DOMKit/WebIDL/MediaDeviceKind.swift deleted file mode 100644 index a19daab0..00000000 --- a/Sources/DOMKit/WebIDL/MediaDeviceKind.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 } -} diff --git a/Sources/DOMKit/WebIDL/MediaDevices.swift b/Sources/DOMKit/WebIDL/MediaDevices.swift deleted file mode 100644 index a65b2d59..00000000 --- a/Sources/DOMKit/WebIDL/MediaDevices.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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()! - } -} diff --git a/Sources/DOMKit/WebIDL/MediaProvider.swift b/Sources/DOMKit/WebIDL/MediaProvider.swift deleted file mode 100644 index 159b49e0..00000000 --- a/Sources/DOMKit/WebIDL/MediaProvider.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_MediaProvider: ConvertibleToJSValue {} -extension Blob: Any_MediaProvider {} -extension MediaSource: Any_MediaProvider {} -extension MediaStream: Any_MediaProvider {} - -public enum MediaProvider: JSValueCompatible, Any_MediaProvider { - case blob(Blob) - case mediaSource(MediaSource) - case mediaStream(MediaStream) - - var blob: Blob? { - switch self { - case let .blob(blob): return blob - default: return nil - } - } - - var mediaSource: MediaSource? { - switch self { - case let .mediaSource(mediaSource): return mediaSource - default: return nil - } - } - - var mediaStream: MediaStream? { - switch self { - case let .mediaStream(mediaStream): return mediaStream - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let blob: Blob = value.fromJSValue() { - return .blob(blob) - } - if let mediaSource: MediaSource = value.fromJSValue() { - return .mediaSource(mediaSource) - } - if let mediaStream: MediaStream = value.fromJSValue() { - return .mediaStream(mediaStream) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .blob(blob): - return blob.jsValue - case let .mediaSource(mediaSource): - return mediaSource.jsValue - case let .mediaStream(mediaStream): - return mediaStream.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/MediaRecorder.swift b/Sources/DOMKit/WebIDL/MediaRecorder.swift deleted file mode 100644 index 9336c57b..00000000 --- a/Sources/DOMKit/WebIDL/MediaRecorder.swift +++ /dev/null @@ -1,94 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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()! - } -} diff --git a/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift b/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift deleted file mode 100644 index c4b4cc09..00000000 --- a/Sources/DOMKit/WebIDL/MediaRecorderErrorEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift b/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift deleted file mode 100644 index 4c773a67..00000000 --- a/Sources/DOMKit/WebIDL/MediaRecorderErrorEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift b/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift deleted file mode 100644 index 3a4300b0..00000000 --- a/Sources/DOMKit/WebIDL/MediaRecorderOptions.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/MediaSource.swift b/Sources/DOMKit/WebIDL/MediaSource.swift deleted file mode 100644 index a8e5ee5c..00000000 --- a/Sources/DOMKit/WebIDL/MediaSource.swift +++ /dev/null @@ -1,78 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaSource: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaSource].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _sourceBuffers = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffers) - _activeSourceBuffers = ReadonlyAttribute(jsObject: jsObject, name: Strings.activeSourceBuffers) - _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) - _duration = ReadWriteAttribute(jsObject: jsObject, name: Strings.duration) - _onsourceopen = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsourceopen) - _onsourceended = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsourceended) - _onsourceclose = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onsourceclose) - _canConstructInDedicatedWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.canConstructInDedicatedWorker) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init() { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) - } - - @ReadonlyAttribute - public var sourceBuffers: SourceBufferList - - @ReadonlyAttribute - public var activeSourceBuffers: SourceBufferList - - @ReadonlyAttribute - public var readyState: ReadyState - - @ReadWriteAttribute - public var duration: Double - - @ClosureAttribute1Optional - public var onsourceopen: EventHandler - - @ClosureAttribute1Optional - public var onsourceended: EventHandler - - @ClosureAttribute1Optional - public var onsourceclose: EventHandler - - @ReadonlyAttribute - public var canConstructInDedicatedWorker: Bool - - @inlinable public func addSourceBuffer(type: String) -> SourceBuffer { - let this = jsObject - return this[Strings.addSourceBuffer].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } - - @inlinable public func removeSourceBuffer(sourceBuffer: SourceBuffer) { - let this = jsObject - _ = this[Strings.removeSourceBuffer].function!(this: this, arguments: [sourceBuffer.jsValue]) - } - - @inlinable public func endOfStream(error: EndOfStreamError? = nil) { - let this = jsObject - _ = this[Strings.endOfStream].function!(this: this, arguments: [error?.jsValue ?? .undefined]) - } - - @inlinable public func setLiveSeekableRange(start: Double, end: Double) { - let this = jsObject - _ = this[Strings.setLiveSeekableRange].function!(this: this, arguments: [start.jsValue, end.jsValue]) - } - - @inlinable public func clearLiveSeekableRange() { - let this = jsObject - _ = this[Strings.clearLiveSeekableRange].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()! - } -} diff --git a/Sources/DOMKit/WebIDL/MediaStream.swift b/Sources/DOMKit/WebIDL/MediaStream.swift deleted file mode 100644 index 819dac5a..00000000 --- a/Sources/DOMKit/WebIDL/MediaStream.swift +++ /dev/null @@ -1,75 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaStream: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStream].function! } - - public required init(unsafelyWrapping 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: [])) - } - - @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 id: String - - @inlinable public func getAudioTracks() -> [MediaStreamTrack] { - let this = jsObject - return this[Strings.getAudioTracks].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getVideoTracks() -> [MediaStreamTrack] { - let this = jsObject - return this[Strings.getVideoTracks].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getTracks() -> [MediaStreamTrack] { - let this = jsObject - return this[Strings.getTracks].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getTrackById(trackId: String) -> MediaStreamTrack? { - let this = jsObject - return this[Strings.getTrackById].function!(this: this, arguments: [trackId.jsValue]).fromJSValue()! - } - - @inlinable public func addTrack(track: MediaStreamTrack) { - let this = jsObject - _ = this[Strings.addTrack].function!(this: this, arguments: [track.jsValue]) - } - - @inlinable public func removeTrack(track: MediaStreamTrack) { - let this = jsObject - _ = this[Strings.removeTrack].function!(this: this, arguments: [track.jsValue]) - } - - @inlinable public func clone() -> Self { - let this = jsObject - return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! - } - - @ReadonlyAttribute - public var active: Bool - - @ClosureAttribute1Optional - public var onaddtrack: EventHandler - - @ClosureAttribute1Optional - public var onremovetrack: EventHandler -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift b/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift deleted file mode 100644 index b2ee4cce..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamConstraints.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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.video] = video.jsValue - object[Strings.audio] = audio.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _video = ReadWriteAttribute(jsObject: object, name: Strings.video) - _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var video: Bool_or_MediaTrackConstraints - - @ReadWriteAttribute - public var audio: Bool_or_MediaTrackConstraints -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift b/Sources/DOMKit/WebIDL/MediaStreamTrack.swift deleted file mode 100644 index 450347d9..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamTrack.swift +++ /dev/null @@ -1,85 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 - } -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift deleted file mode 100644 index 21d98e5a..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift deleted file mode 100644 index 2bab9838..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift b/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift deleted file mode 100644 index d08534a1..00000000 --- a/Sources/DOMKit/WebIDL/MediaStreamTrackState.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 } -} diff --git a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift b/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift deleted file mode 100644 index 41982ba3..00000000 --- a/Sources/DOMKit/WebIDL/MediaTrackCapabilities.swift +++ /dev/null @@ -1,90 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift deleted file mode 100644 index 1489baaa..00000000 --- a/Sources/DOMKit/WebIDL/MediaTrackConstraintSet.swift +++ /dev/null @@ -1,90 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift b/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift deleted file mode 100644 index 5307db8a..00000000 --- a/Sources/DOMKit/WebIDL/MediaTrackConstraints.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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] -} diff --git a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift b/Sources/DOMKit/WebIDL/MediaTrackSettings.swift deleted file mode 100644 index 84d866a3..00000000 --- a/Sources/DOMKit/WebIDL/MediaTrackSettings.swift +++ /dev/null @@ -1,90 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift b/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift deleted file mode 100644 index bcbfd4ba..00000000 --- a/Sources/DOMKit/WebIDL/MediaTrackSupportedConstraints.swift +++ /dev/null @@ -1,90 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} diff --git a/Sources/DOMKit/WebIDL/Navigator.swift b/Sources/DOMKit/WebIDL/Navigator.swift index 0928de76..f697818a 100644 --- a/Sources/DOMKit/WebIDL/Navigator.swift +++ b/Sources/DOMKit/WebIDL/Navigator.swift @@ -9,16 +9,10 @@ public class Navigator: JSBridgedClass, NavigatorID, NavigatorLanguage, Navigato public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _mediaDevices = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaDevices) _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) self.jsObject = jsObject } - @ReadonlyAttribute - public var mediaDevices: MediaDevices - - // XXX: member 'getUserMedia' is ignored - @ReadonlyAttribute public var serviceWorker: ServiceWorkerContainer } diff --git a/Sources/DOMKit/WebIDL/OverconstrainedError.swift b/Sources/DOMKit/WebIDL/OverconstrainedError.swift deleted file mode 100644 index 61499735..00000000 --- a/Sources/DOMKit/WebIDL/OverconstrainedError.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} 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/ReadyState.swift b/Sources/DOMKit/WebIDL/ReadyState.swift deleted file mode 100644 index e61a7157..00000000 --- a/Sources/DOMKit/WebIDL/ReadyState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum ReadyState: JSString, JSValueCompatible { - case closed = "closed" - case open = "open" - 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 } -} diff --git a/Sources/DOMKit/WebIDL/RecordingState.swift b/Sources/DOMKit/WebIDL/RecordingState.swift deleted file mode 100644 index 7e057605..00000000 --- a/Sources/DOMKit/WebIDL/RecordingState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 } -} diff --git a/Sources/DOMKit/WebIDL/SVGAElement.swift b/Sources/DOMKit/WebIDL/SVGAElement.swift deleted file mode 100644 index 9a21d289..00000000 --- a/Sources/DOMKit/WebIDL/SVGAElement.swift +++ /dev/null @@ -1,88 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAElement: SVGGraphicsElement, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGAElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _target = ReadonlyAttribute(jsObject: jsObject, name: Strings.target) - _download = ReadWriteAttribute(jsObject: jsObject, name: Strings.download) - _ping = ReadWriteAttribute(jsObject: jsObject, name: Strings.ping) - _rel = ReadWriteAttribute(jsObject: jsObject, name: Strings.rel) - _relList = ReadonlyAttribute(jsObject: jsObject, name: Strings.relList) - _hreflang = ReadWriteAttribute(jsObject: jsObject, name: Strings.hreflang) - _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) - _text = ReadWriteAttribute(jsObject: jsObject, name: Strings.text) - _referrerPolicy = ReadWriteAttribute(jsObject: jsObject, name: Strings.referrerPolicy) - _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) - _hash = ReadWriteAttribute(jsObject: jsObject, name: Strings.hash) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var target: SVGAnimatedString - - @ReadWriteAttribute - public var download: String - - @ReadWriteAttribute - public var ping: String - - @ReadWriteAttribute - public var rel: String - - @ReadonlyAttribute - public var relList: DOMTokenList - - @ReadWriteAttribute - public var hreflang: String - - @ReadWriteAttribute - public var type: String - - @ReadWriteAttribute - public var text: String - - @ReadWriteAttribute - public var referrerPolicy: String - - @ReadonlyAttribute - 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 - - @ReadWriteAttribute - public var hash: String -} diff --git a/Sources/DOMKit/WebIDL/SVGAngle.swift b/Sources/DOMKit/WebIDL/SVGAngle.swift deleted file mode 100644 index 22490a6c..00000000 --- a/Sources/DOMKit/WebIDL/SVGAngle.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAngle: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAngle].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _unitType = ReadonlyAttribute(jsObject: jsObject, name: Strings.unitType) - _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) - _valueInSpecifiedUnits = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueInSpecifiedUnits) - _valueAsString = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueAsString) - self.jsObject = jsObject - } - - public static let SVG_ANGLETYPE_UNKNOWN: UInt16 = 0 - - public static let SVG_ANGLETYPE_UNSPECIFIED: UInt16 = 1 - - public static let SVG_ANGLETYPE_DEG: UInt16 = 2 - - public static let SVG_ANGLETYPE_RAD: UInt16 = 3 - - public static let SVG_ANGLETYPE_GRAD: UInt16 = 4 - - @ReadonlyAttribute - public var unitType: UInt16 - - @ReadWriteAttribute - public var value: Float - - @ReadWriteAttribute - public var valueInSpecifiedUnits: Float - - @ReadWriteAttribute - public var valueAsString: String - - @inlinable public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { - let this = jsObject - _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue, valueInSpecifiedUnits.jsValue]) - } - - @inlinable public func convertToSpecifiedUnits(unitType: UInt16) { - let this = jsObject - _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift b/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift deleted file mode 100644 index 8e927078..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedAngle.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedAngle: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedAngle].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var baseVal: SVGAngle - - @ReadonlyAttribute - public var animVal: SVGAngle -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift b/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift deleted file mode 100644 index 6704b5d2..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedBoolean.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedBoolean: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedBoolean].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var baseVal: Bool - - @ReadonlyAttribute - public var animVal: Bool -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift b/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift deleted file mode 100644 index b1081a6d..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedEnumeration.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedEnumeration: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedEnumeration].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var baseVal: UInt16 - - @ReadonlyAttribute - public var animVal: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift b/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift deleted file mode 100644 index 759adcba..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedInteger.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedInteger: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedInteger].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var baseVal: Int32 - - @ReadonlyAttribute - public var animVal: Int32 -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift b/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift deleted file mode 100644 index 2a613d5f..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedLength.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedLength: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedLength].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var baseVal: SVGLength - - @ReadonlyAttribute - public var animVal: SVGLength -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift b/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift deleted file mode 100644 index bc6125af..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedLengthList.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedLengthList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedLengthList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var baseVal: SVGLengthList - - @ReadonlyAttribute - public var animVal: SVGLengthList -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift b/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift deleted file mode 100644 index 7897194b..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedNumber.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedNumber: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedNumber].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var baseVal: Float - - @ReadonlyAttribute - public var animVal: Float -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift b/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift deleted file mode 100644 index edb008e5..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedNumberList.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedNumberList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedNumberList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var baseVal: SVGNumberList - - @ReadonlyAttribute - public var animVal: SVGNumberList -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift b/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift deleted file mode 100644 index 32fa2fe2..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedPoints.swift +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol SVGAnimatedPoints: JSBridgedClass {} -public extension SVGAnimatedPoints { - @inlinable var points: SVGPointList { ReadonlyAttribute[Strings.points, in: jsObject] } - - @inlinable var animatedPoints: SVGPointList { ReadonlyAttribute[Strings.animatedPoints, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift b/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift deleted file mode 100644 index 2f42ede5..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedPreserveAspectRatio.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedPreserveAspectRatio: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedPreserveAspectRatio].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var baseVal: SVGPreserveAspectRatio - - @ReadonlyAttribute - public var animVal: SVGPreserveAspectRatio -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift b/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift deleted file mode 100644 index 45cf4212..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedRect.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedRect: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedRect].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var baseVal: DOMRect - - @ReadonlyAttribute - public var animVal: DOMRectReadOnly -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedString.swift b/Sources/DOMKit/WebIDL/SVGAnimatedString.swift deleted file mode 100644 index 97965f5b..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedString.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedString: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedString].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadWriteAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var baseVal: String - - @ReadonlyAttribute - public var animVal: String -} diff --git a/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift b/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift deleted file mode 100644 index d8b3fb27..00000000 --- a/Sources/DOMKit/WebIDL/SVGAnimatedTransformList.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGAnimatedTransformList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGAnimatedTransformList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _baseVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.baseVal) - _animVal = ReadonlyAttribute(jsObject: jsObject, name: Strings.animVal) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var baseVal: SVGTransformList - - @ReadonlyAttribute - public var animVal: SVGTransformList -} diff --git a/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift b/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift deleted file mode 100644 index 682c82f2..00000000 --- a/Sources/DOMKit/WebIDL/SVGBoundingBoxOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGBoundingBoxOptions: BridgedDictionary { - public convenience init(fill: Bool, stroke: Bool, markers: Bool, clipped: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.fill] = fill.jsValue - object[Strings.stroke] = stroke.jsValue - object[Strings.markers] = markers.jsValue - object[Strings.clipped] = clipped.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _fill = ReadWriteAttribute(jsObject: object, name: Strings.fill) - _stroke = ReadWriteAttribute(jsObject: object, name: Strings.stroke) - _markers = ReadWriteAttribute(jsObject: object, name: Strings.markers) - _clipped = ReadWriteAttribute(jsObject: object, name: Strings.clipped) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var fill: Bool - - @ReadWriteAttribute - public var stroke: Bool - - @ReadWriteAttribute - public var markers: Bool - - @ReadWriteAttribute - public var clipped: Bool -} diff --git a/Sources/DOMKit/WebIDL/SVGCircleElement.swift b/Sources/DOMKit/WebIDL/SVGCircleElement.swift deleted file mode 100644 index 20e95399..00000000 --- a/Sources/DOMKit/WebIDL/SVGCircleElement.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGCircleElement: SVGGeometryElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGCircleElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _cx = ReadonlyAttribute(jsObject: jsObject, name: Strings.cx) - _cy = ReadonlyAttribute(jsObject: jsObject, name: Strings.cy) - _r = ReadonlyAttribute(jsObject: jsObject, name: Strings.r) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var cx: SVGAnimatedLength - - @ReadonlyAttribute - public var cy: SVGAnimatedLength - - @ReadonlyAttribute - public var r: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGDefsElement.swift b/Sources/DOMKit/WebIDL/SVGDefsElement.swift deleted file mode 100644 index 466aed8a..00000000 --- a/Sources/DOMKit/WebIDL/SVGDefsElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGDefsElement: SVGGraphicsElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGDefsElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGDescElement.swift b/Sources/DOMKit/WebIDL/SVGDescElement.swift deleted file mode 100644 index 92024f1a..00000000 --- a/Sources/DOMKit/WebIDL/SVGDescElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGDescElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGDescElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGElement.swift b/Sources/DOMKit/WebIDL/SVGElement.swift deleted file mode 100644 index 73487e5d..00000000 --- a/Sources/DOMKit/WebIDL/SVGElement.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _ownerSVGElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerSVGElement) - _viewportElement = ReadonlyAttribute(jsObject: jsObject, name: Strings.viewportElement) - super.init(unsafelyWrapping: jsObject) - } - - // XXX: member 'className' is ignored - - @ReadonlyAttribute - public var ownerSVGElement: SVGSVGElement? - - @ReadonlyAttribute - public var viewportElement: SVGElement? -} diff --git a/Sources/DOMKit/WebIDL/SVGElementInstance.swift b/Sources/DOMKit/WebIDL/SVGElementInstance.swift deleted file mode 100644 index 57b55643..00000000 --- a/Sources/DOMKit/WebIDL/SVGElementInstance.swift +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol SVGElementInstance: JSBridgedClass {} -public extension SVGElementInstance { - @inlinable var correspondingElement: SVGElement? { ReadonlyAttribute[Strings.correspondingElement, in: jsObject] } - - @inlinable var correspondingUseElement: SVGUseElement? { ReadonlyAttribute[Strings.correspondingUseElement, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/SVGEllipseElement.swift b/Sources/DOMKit/WebIDL/SVGEllipseElement.swift deleted file mode 100644 index 783f83f8..00000000 --- a/Sources/DOMKit/WebIDL/SVGEllipseElement.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGEllipseElement: SVGGeometryElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGEllipseElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _cx = ReadonlyAttribute(jsObject: jsObject, name: Strings.cx) - _cy = ReadonlyAttribute(jsObject: jsObject, name: Strings.cy) - _rx = ReadonlyAttribute(jsObject: jsObject, name: Strings.rx) - _ry = ReadonlyAttribute(jsObject: jsObject, name: Strings.ry) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var cx: SVGAnimatedLength - - @ReadonlyAttribute - public var cy: SVGAnimatedLength - - @ReadonlyAttribute - public var rx: SVGAnimatedLength - - @ReadonlyAttribute - public var ry: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift b/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift deleted file mode 100644 index 2dc8f733..00000000 --- a/Sources/DOMKit/WebIDL/SVGFitToViewBox.swift +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol SVGFitToViewBox: JSBridgedClass {} -public extension SVGFitToViewBox { - @inlinable var viewBox: SVGAnimatedRect { ReadonlyAttribute[Strings.viewBox, in: jsObject] } - - @inlinable var preserveAspectRatio: SVGAnimatedPreserveAspectRatio { ReadonlyAttribute[Strings.preserveAspectRatio, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift b/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift deleted file mode 100644 index 24613b44..00000000 --- a/Sources/DOMKit/WebIDL/SVGForeignObjectElement.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGForeignObjectElement: SVGGraphicsElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGForeignObjectElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x: SVGAnimatedLength - - @ReadonlyAttribute - public var y: SVGAnimatedLength - - @ReadonlyAttribute - public var width: SVGAnimatedLength - - @ReadonlyAttribute - public var height: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGGElement.swift b/Sources/DOMKit/WebIDL/SVGGElement.swift deleted file mode 100644 index a0ae9619..00000000 --- a/Sources/DOMKit/WebIDL/SVGGElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGGElement: SVGGraphicsElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGGElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGGeometryElement.swift b/Sources/DOMKit/WebIDL/SVGGeometryElement.swift deleted file mode 100644 index b604708c..00000000 --- a/Sources/DOMKit/WebIDL/SVGGeometryElement.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGGeometryElement: SVGGraphicsElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGGeometryElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _pathLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.pathLength) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var pathLength: SVGAnimatedNumber - - @inlinable public func isPointInFill(point: DOMPointInit? = nil) -> Bool { - let this = jsObject - return this[Strings.isPointInFill].function!(this: this, arguments: [point?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func isPointInStroke(point: DOMPointInit? = nil) -> Bool { - let this = jsObject - return this[Strings.isPointInStroke].function!(this: this, arguments: [point?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func getTotalLength() -> Float { - let this = jsObject - return this[Strings.getTotalLength].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getPointAtLength(distance: Float) -> DOMPoint { - let this = jsObject - return this[Strings.getPointAtLength].function!(this: this, arguments: [distance.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/SVGGradientElement.swift b/Sources/DOMKit/WebIDL/SVGGradientElement.swift deleted file mode 100644 index 7356b768..00000000 --- a/Sources/DOMKit/WebIDL/SVGGradientElement.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGGradientElement: SVGElement, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGGradientElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _gradientUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.gradientUnits) - _gradientTransform = ReadonlyAttribute(jsObject: jsObject, name: Strings.gradientTransform) - _spreadMethod = ReadonlyAttribute(jsObject: jsObject, name: Strings.spreadMethod) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_SPREADMETHOD_UNKNOWN: UInt16 = 0 - - public static let SVG_SPREADMETHOD_PAD: UInt16 = 1 - - public static let SVG_SPREADMETHOD_REFLECT: UInt16 = 2 - - public static let SVG_SPREADMETHOD_REPEAT: UInt16 = 3 - - @ReadonlyAttribute - public var gradientUnits: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var gradientTransform: SVGAnimatedTransformList - - @ReadonlyAttribute - public var spreadMethod: SVGAnimatedEnumeration -} diff --git a/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift b/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift deleted file mode 100644 index 40f0b8f8..00000000 --- a/Sources/DOMKit/WebIDL/SVGGraphicsElement.swift +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGGraphicsElement: SVGElement, SVGTests { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGGraphicsElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _transform = ReadonlyAttribute(jsObject: jsObject, name: Strings.transform) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var transform: SVGAnimatedTransformList - - @inlinable public func getBBox(options: SVGBoundingBoxOptions? = nil) -> DOMRect { - let this = jsObject - return this[Strings.getBBox].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func getCTM() -> DOMMatrix? { - let this = jsObject - return this[Strings.getCTM].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getScreenCTM() -> DOMMatrix? { - let this = jsObject - return this[Strings.getScreenCTM].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/SVGImageElement.swift b/Sources/DOMKit/WebIDL/SVGImageElement.swift deleted file mode 100644 index ad4145f1..00000000 --- a/Sources/DOMKit/WebIDL/SVGImageElement.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGImageElement: SVGGraphicsElement, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGImageElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _preserveAspectRatio = ReadonlyAttribute(jsObject: jsObject, name: Strings.preserveAspectRatio) - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Strings.crossOrigin) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x: SVGAnimatedLength - - @ReadonlyAttribute - public var y: SVGAnimatedLength - - @ReadonlyAttribute - public var width: SVGAnimatedLength - - @ReadonlyAttribute - public var height: SVGAnimatedLength - - @ReadonlyAttribute - public var preserveAspectRatio: SVGAnimatedPreserveAspectRatio - - @ReadWriteAttribute - public var crossOrigin: String? -} diff --git a/Sources/DOMKit/WebIDL/SVGLength.swift b/Sources/DOMKit/WebIDL/SVGLength.swift deleted file mode 100644 index d498133a..00000000 --- a/Sources/DOMKit/WebIDL/SVGLength.swift +++ /dev/null @@ -1,62 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGLength: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGLength].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _unitType = ReadonlyAttribute(jsObject: jsObject, name: Strings.unitType) - _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) - _valueInSpecifiedUnits = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueInSpecifiedUnits) - _valueAsString = ReadWriteAttribute(jsObject: jsObject, name: Strings.valueAsString) - self.jsObject = jsObject - } - - public static let SVG_LENGTHTYPE_UNKNOWN: UInt16 = 0 - - public static let SVG_LENGTHTYPE_NUMBER: UInt16 = 1 - - public static let SVG_LENGTHTYPE_PERCENTAGE: UInt16 = 2 - - public static let SVG_LENGTHTYPE_EMS: UInt16 = 3 - - public static let SVG_LENGTHTYPE_EXS: UInt16 = 4 - - public static let SVG_LENGTHTYPE_PX: UInt16 = 5 - - public static let SVG_LENGTHTYPE_CM: UInt16 = 6 - - public static let SVG_LENGTHTYPE_MM: UInt16 = 7 - - public static let SVG_LENGTHTYPE_IN: UInt16 = 8 - - public static let SVG_LENGTHTYPE_PT: UInt16 = 9 - - public static let SVG_LENGTHTYPE_PC: UInt16 = 10 - - @ReadonlyAttribute - public var unitType: UInt16 - - @ReadWriteAttribute - public var value: Float - - @ReadWriteAttribute - public var valueInSpecifiedUnits: Float - - @ReadWriteAttribute - public var valueAsString: String - - @inlinable public func newValueSpecifiedUnits(unitType: UInt16, valueInSpecifiedUnits: Float) { - let this = jsObject - _ = this[Strings.newValueSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue, valueInSpecifiedUnits.jsValue]) - } - - @inlinable public func convertToSpecifiedUnits(unitType: UInt16) { - let this = jsObject - _ = this[Strings.convertToSpecifiedUnits].function!(this: this, arguments: [unitType.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGLengthList.swift b/Sources/DOMKit/WebIDL/SVGLengthList.swift deleted file mode 100644 index 003689b9..00000000 --- a/Sources/DOMKit/WebIDL/SVGLengthList.swift +++ /dev/null @@ -1,58 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGLengthList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGLengthList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var length: UInt32 - - @ReadonlyAttribute - public var numberOfItems: UInt32 - - @inlinable public func clear() { - let this = jsObject - _ = this[Strings.clear].function!(this: this, arguments: []) - } - - @inlinable public func initialize(newItem: SVGLength) -> SVGLength { - let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - @inlinable public subscript(key: Int) -> SVGLength { - jsObject[key].fromJSValue()! - } - - @inlinable public func insertItemBefore(newItem: SVGLength, index: UInt32) -> SVGLength { - let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func replaceItem(newItem: SVGLength, index: UInt32) -> SVGLength { - let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func removeItem(index: UInt32) -> SVGLength { - let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! - } - - @inlinable public func appendItem(newItem: SVGLength) -> SVGLength { - let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - // XXX: unsupported setter for keys of type UInt32 -} diff --git a/Sources/DOMKit/WebIDL/SVGLineElement.swift b/Sources/DOMKit/WebIDL/SVGLineElement.swift deleted file mode 100644 index 116f3712..00000000 --- a/Sources/DOMKit/WebIDL/SVGLineElement.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGLineElement: SVGGeometryElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGLineElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x1) - _y1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.y1) - _x2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x2) - _y2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.y2) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x1: SVGAnimatedLength - - @ReadonlyAttribute - public var y1: SVGAnimatedLength - - @ReadonlyAttribute - public var x2: SVGAnimatedLength - - @ReadonlyAttribute - public var y2: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift b/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift deleted file mode 100644 index 92c46de6..00000000 --- a/Sources/DOMKit/WebIDL/SVGLinearGradientElement.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGLinearGradientElement: SVGGradientElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGLinearGradientElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x1) - _y1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.y1) - _x2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.x2) - _y2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.y2) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x1: SVGAnimatedLength - - @ReadonlyAttribute - public var y1: SVGAnimatedLength - - @ReadonlyAttribute - public var x2: SVGAnimatedLength - - @ReadonlyAttribute - public var y2: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGMarkerElement.swift b/Sources/DOMKit/WebIDL/SVGMarkerElement.swift deleted file mode 100644 index bf908210..00000000 --- a/Sources/DOMKit/WebIDL/SVGMarkerElement.swift +++ /dev/null @@ -1,66 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGMarkerElement: SVGElement, SVGFitToViewBox { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGMarkerElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _refX = ReadonlyAttribute(jsObject: jsObject, name: Strings.refX) - _refY = ReadonlyAttribute(jsObject: jsObject, name: Strings.refY) - _markerUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.markerUnits) - _markerWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.markerWidth) - _markerHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.markerHeight) - _orientType = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientType) - _orientAngle = ReadonlyAttribute(jsObject: jsObject, name: Strings.orientAngle) - _orient = ReadWriteAttribute(jsObject: jsObject, name: Strings.orient) - super.init(unsafelyWrapping: jsObject) - } - - public static let SVG_MARKERUNITS_UNKNOWN: UInt16 = 0 - - public static let SVG_MARKERUNITS_USERSPACEONUSE: UInt16 = 1 - - public static let SVG_MARKERUNITS_STROKEWIDTH: UInt16 = 2 - - public static let SVG_MARKER_ORIENT_UNKNOWN: UInt16 = 0 - - public static let SVG_MARKER_ORIENT_AUTO: UInt16 = 1 - - public static let SVG_MARKER_ORIENT_ANGLE: UInt16 = 2 - - @ReadonlyAttribute - public var refX: SVGAnimatedLength - - @ReadonlyAttribute - public var refY: SVGAnimatedLength - - @ReadonlyAttribute - public var markerUnits: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var markerWidth: SVGAnimatedLength - - @ReadonlyAttribute - public var markerHeight: SVGAnimatedLength - - @ReadonlyAttribute - public var orientType: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var orientAngle: SVGAnimatedAngle - - @ReadWriteAttribute - public var orient: String - - @inlinable public func setOrientToAuto() { - let this = jsObject - _ = this[Strings.setOrientToAuto].function!(this: this, arguments: []) - } - - @inlinable public func setOrientToAngle(angle: SVGAngle) { - let this = jsObject - _ = this[Strings.setOrientToAngle].function!(this: this, arguments: [angle.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGMetadataElement.swift b/Sources/DOMKit/WebIDL/SVGMetadataElement.swift deleted file mode 100644 index 972c3a21..00000000 --- a/Sources/DOMKit/WebIDL/SVGMetadataElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGMetadataElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGMetadataElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGNumber.swift b/Sources/DOMKit/WebIDL/SVGNumber.swift deleted file mode 100644 index d6e5531d..00000000 --- a/Sources/DOMKit/WebIDL/SVGNumber.swift +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGNumber: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGNumber].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _value = ReadWriteAttribute(jsObject: jsObject, name: Strings.value) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var value: Float -} diff --git a/Sources/DOMKit/WebIDL/SVGNumberList.swift b/Sources/DOMKit/WebIDL/SVGNumberList.swift deleted file mode 100644 index a9769598..00000000 --- a/Sources/DOMKit/WebIDL/SVGNumberList.swift +++ /dev/null @@ -1,58 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGNumberList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGNumberList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var length: UInt32 - - @ReadonlyAttribute - public var numberOfItems: UInt32 - - @inlinable public func clear() { - let this = jsObject - _ = this[Strings.clear].function!(this: this, arguments: []) - } - - @inlinable public func initialize(newItem: SVGNumber) -> SVGNumber { - let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - @inlinable public subscript(key: Int) -> SVGNumber { - jsObject[key].fromJSValue()! - } - - @inlinable public func insertItemBefore(newItem: SVGNumber, index: UInt32) -> SVGNumber { - let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func replaceItem(newItem: SVGNumber, index: UInt32) -> SVGNumber { - let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func removeItem(index: UInt32) -> SVGNumber { - let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! - } - - @inlinable public func appendItem(newItem: SVGNumber) -> SVGNumber { - let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - // XXX: unsupported setter for keys of type UInt32 -} diff --git a/Sources/DOMKit/WebIDL/SVGPathElement.swift b/Sources/DOMKit/WebIDL/SVGPathElement.swift deleted file mode 100644 index a0fba634..00000000 --- a/Sources/DOMKit/WebIDL/SVGPathElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGPathElement: SVGGeometryElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGPathElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGPatternElement.swift b/Sources/DOMKit/WebIDL/SVGPatternElement.swift deleted file mode 100644 index 47c75487..00000000 --- a/Sources/DOMKit/WebIDL/SVGPatternElement.swift +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGPatternElement: SVGElement, SVGFitToViewBox, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGPatternElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _patternUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.patternUnits) - _patternContentUnits = ReadonlyAttribute(jsObject: jsObject, name: Strings.patternContentUnits) - _patternTransform = ReadonlyAttribute(jsObject: jsObject, name: Strings.patternTransform) - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var patternUnits: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var patternContentUnits: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var patternTransform: SVGAnimatedTransformList - - @ReadonlyAttribute - public var x: SVGAnimatedLength - - @ReadonlyAttribute - public var y: SVGAnimatedLength - - @ReadonlyAttribute - public var width: SVGAnimatedLength - - @ReadonlyAttribute - public var height: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGPointList.swift b/Sources/DOMKit/WebIDL/SVGPointList.swift deleted file mode 100644 index e6527352..00000000 --- a/Sources/DOMKit/WebIDL/SVGPointList.swift +++ /dev/null @@ -1,58 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGPointList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGPointList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var length: UInt32 - - @ReadonlyAttribute - public var numberOfItems: UInt32 - - @inlinable public func clear() { - let this = jsObject - _ = this[Strings.clear].function!(this: this, arguments: []) - } - - @inlinable public func initialize(newItem: DOMPoint) -> DOMPoint { - let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - @inlinable public subscript(key: Int) -> DOMPoint { - jsObject[key].fromJSValue()! - } - - @inlinable public func insertItemBefore(newItem: DOMPoint, index: UInt32) -> DOMPoint { - let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func replaceItem(newItem: DOMPoint, index: UInt32) -> DOMPoint { - let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func removeItem(index: UInt32) -> DOMPoint { - let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! - } - - @inlinable public func appendItem(newItem: DOMPoint) -> DOMPoint { - let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - // XXX: unsupported setter for keys of type UInt32 -} diff --git a/Sources/DOMKit/WebIDL/SVGPolygonElement.swift b/Sources/DOMKit/WebIDL/SVGPolygonElement.swift deleted file mode 100644 index 7effcea5..00000000 --- a/Sources/DOMKit/WebIDL/SVGPolygonElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGPolygonElement: SVGGeometryElement, SVGAnimatedPoints { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGPolygonElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGPolylineElement.swift b/Sources/DOMKit/WebIDL/SVGPolylineElement.swift deleted file mode 100644 index d6c37154..00000000 --- a/Sources/DOMKit/WebIDL/SVGPolylineElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGPolylineElement: SVGGeometryElement, SVGAnimatedPoints { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGPolylineElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift b/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift deleted file mode 100644 index b50dd291..00000000 --- a/Sources/DOMKit/WebIDL/SVGPreserveAspectRatio.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGPreserveAspectRatio: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGPreserveAspectRatio].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _align = ReadWriteAttribute(jsObject: jsObject, name: Strings.align) - _meetOrSlice = ReadWriteAttribute(jsObject: jsObject, name: Strings.meetOrSlice) - self.jsObject = jsObject - } - - public static let SVG_PRESERVEASPECTRATIO_UNKNOWN: UInt16 = 0 - - public static let SVG_PRESERVEASPECTRATIO_NONE: UInt16 = 1 - - public static let SVG_PRESERVEASPECTRATIO_XMINYMIN: UInt16 = 2 - - public static let SVG_PRESERVEASPECTRATIO_XMIDYMIN: UInt16 = 3 - - public static let SVG_PRESERVEASPECTRATIO_XMAXYMIN: UInt16 = 4 - - public static let SVG_PRESERVEASPECTRATIO_XMINYMID: UInt16 = 5 - - public static let SVG_PRESERVEASPECTRATIO_XMIDYMID: UInt16 = 6 - - public static let SVG_PRESERVEASPECTRATIO_XMAXYMID: UInt16 = 7 - - public static let SVG_PRESERVEASPECTRATIO_XMINYMAX: UInt16 = 8 - - public static let SVG_PRESERVEASPECTRATIO_XMIDYMAX: UInt16 = 9 - - public static let SVG_PRESERVEASPECTRATIO_XMAXYMAX: UInt16 = 10 - - public static let SVG_MEETORSLICE_UNKNOWN: UInt16 = 0 - - public static let SVG_MEETORSLICE_MEET: UInt16 = 1 - - public static let SVG_MEETORSLICE_SLICE: UInt16 = 2 - - @ReadWriteAttribute - public var align: UInt16 - - @ReadWriteAttribute - public var meetOrSlice: UInt16 -} diff --git a/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift b/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift deleted file mode 100644 index 4415ffd4..00000000 --- a/Sources/DOMKit/WebIDL/SVGRadialGradientElement.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGRadialGradientElement: SVGGradientElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGRadialGradientElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _cx = ReadonlyAttribute(jsObject: jsObject, name: Strings.cx) - _cy = ReadonlyAttribute(jsObject: jsObject, name: Strings.cy) - _r = ReadonlyAttribute(jsObject: jsObject, name: Strings.r) - _fx = ReadonlyAttribute(jsObject: jsObject, name: Strings.fx) - _fy = ReadonlyAttribute(jsObject: jsObject, name: Strings.fy) - _fr = ReadonlyAttribute(jsObject: jsObject, name: Strings.fr) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var cx: SVGAnimatedLength - - @ReadonlyAttribute - public var cy: SVGAnimatedLength - - @ReadonlyAttribute - public var r: SVGAnimatedLength - - @ReadonlyAttribute - public var fx: SVGAnimatedLength - - @ReadonlyAttribute - public var fy: SVGAnimatedLength - - @ReadonlyAttribute - public var fr: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGRectElement.swift b/Sources/DOMKit/WebIDL/SVGRectElement.swift deleted file mode 100644 index ac3ac6bd..00000000 --- a/Sources/DOMKit/WebIDL/SVGRectElement.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGRectElement: SVGGeometryElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGRectElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _rx = ReadonlyAttribute(jsObject: jsObject, name: Strings.rx) - _ry = ReadonlyAttribute(jsObject: jsObject, name: Strings.ry) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x: SVGAnimatedLength - - @ReadonlyAttribute - public var y: SVGAnimatedLength - - @ReadonlyAttribute - public var width: SVGAnimatedLength - - @ReadonlyAttribute - public var height: SVGAnimatedLength - - @ReadonlyAttribute - public var rx: SVGAnimatedLength - - @ReadonlyAttribute - public var ry: SVGAnimatedLength -} diff --git a/Sources/DOMKit/WebIDL/SVGSVGElement.swift b/Sources/DOMKit/WebIDL/SVGSVGElement.swift deleted file mode 100644 index 33a8bc88..00000000 --- a/Sources/DOMKit/WebIDL/SVGSVGElement.swift +++ /dev/null @@ -1,126 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGSVGElement: SVGGraphicsElement, SVGFitToViewBox, WindowEventHandlers { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGSVGElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _currentScale = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentScale) - _currentTranslate = ReadonlyAttribute(jsObject: jsObject, name: Strings.currentTranslate) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x: SVGAnimatedLength - - @ReadonlyAttribute - public var y: SVGAnimatedLength - - @ReadonlyAttribute - public var width: SVGAnimatedLength - - @ReadonlyAttribute - public var height: SVGAnimatedLength - - @ReadWriteAttribute - public var currentScale: Float - - @ReadonlyAttribute - public var currentTranslate: DOMPointReadOnly - - @inlinable public func getIntersectionList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { - let this = jsObject - return this[Strings.getIntersectionList].function!(this: this, arguments: [rect.jsValue, referenceElement.jsValue]).fromJSValue()! - } - - @inlinable public func getEnclosureList(rect: DOMRectReadOnly, referenceElement: SVGElement?) -> NodeList { - let this = jsObject - return this[Strings.getEnclosureList].function!(this: this, arguments: [rect.jsValue, referenceElement.jsValue]).fromJSValue()! - } - - @inlinable public func checkIntersection(element: SVGElement, rect: DOMRectReadOnly) -> Bool { - let this = jsObject - return this[Strings.checkIntersection].function!(this: this, arguments: [element.jsValue, rect.jsValue]).fromJSValue()! - } - - @inlinable public func checkEnclosure(element: SVGElement, rect: DOMRectReadOnly) -> Bool { - let this = jsObject - return this[Strings.checkEnclosure].function!(this: this, arguments: [element.jsValue, rect.jsValue]).fromJSValue()! - } - - @inlinable public func deselectAll() { - let this = jsObject - _ = this[Strings.deselectAll].function!(this: this, arguments: []) - } - - @inlinable public func createSVGNumber() -> SVGNumber { - let this = jsObject - return this[Strings.createSVGNumber].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createSVGLength() -> SVGLength { - let this = jsObject - return this[Strings.createSVGLength].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createSVGAngle() -> SVGAngle { - let this = jsObject - return this[Strings.createSVGAngle].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createSVGPoint() -> DOMPoint { - let this = jsObject - return this[Strings.createSVGPoint].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createSVGMatrix() -> DOMMatrix { - let this = jsObject - return this[Strings.createSVGMatrix].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createSVGRect() -> DOMRect { - let this = jsObject - return this[Strings.createSVGRect].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createSVGTransform() -> SVGTransform { - let this = jsObject - return this[Strings.createSVGTransform].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { - let this = jsObject - return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func getElementById(elementId: String) -> Element { - let this = jsObject - return this[Strings.getElementById].function!(this: this, arguments: [elementId.jsValue]).fromJSValue()! - } - - @inlinable public func suspendRedraw(maxWaitMilliseconds: UInt32) -> UInt32 { - let this = jsObject - return this[Strings.suspendRedraw].function!(this: this, arguments: [maxWaitMilliseconds.jsValue]).fromJSValue()! - } - - @inlinable public func unsuspendRedraw(suspendHandleID: UInt32) { - let this = jsObject - _ = this[Strings.unsuspendRedraw].function!(this: this, arguments: [suspendHandleID.jsValue]) - } - - @inlinable public func unsuspendRedrawAll() { - let this = jsObject - _ = this[Strings.unsuspendRedrawAll].function!(this: this, arguments: []) - } - - @inlinable public func forceRedraw() { - let this = jsObject - _ = this[Strings.forceRedraw].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGScriptElement.swift b/Sources/DOMKit/WebIDL/SVGScriptElement.swift deleted file mode 100644 index 2420b54f..00000000 --- a/Sources/DOMKit/WebIDL/SVGScriptElement.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGScriptElement: SVGElement, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGScriptElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) - _crossOrigin = ReadWriteAttribute(jsObject: jsObject, name: Strings.crossOrigin) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var type: String - - @ReadWriteAttribute - public var crossOrigin: String? -} diff --git a/Sources/DOMKit/WebIDL/SVGStopElement.swift b/Sources/DOMKit/WebIDL/SVGStopElement.swift deleted file mode 100644 index f965aa11..00000000 --- a/Sources/DOMKit/WebIDL/SVGStopElement.swift +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGStopElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGStopElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _offset = ReadonlyAttribute(jsObject: jsObject, name: Strings.offset) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var offset: SVGAnimatedNumber -} diff --git a/Sources/DOMKit/WebIDL/SVGStringList.swift b/Sources/DOMKit/WebIDL/SVGStringList.swift deleted file mode 100644 index 56195983..00000000 --- a/Sources/DOMKit/WebIDL/SVGStringList.swift +++ /dev/null @@ -1,58 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGStringList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGStringList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var length: UInt32 - - @ReadonlyAttribute - public var numberOfItems: UInt32 - - @inlinable public func clear() { - let this = jsObject - _ = this[Strings.clear].function!(this: this, arguments: []) - } - - @inlinable public func initialize(newItem: String) -> String { - let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - @inlinable public subscript(key: Int) -> String { - jsObject[key].fromJSValue()! - } - - @inlinable public func insertItemBefore(newItem: String, index: UInt32) -> String { - let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func replaceItem(newItem: String, index: UInt32) -> String { - let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func removeItem(index: UInt32) -> String { - let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! - } - - @inlinable public func appendItem(newItem: String) -> String { - let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - // XXX: unsupported setter for keys of type UInt32 -} diff --git a/Sources/DOMKit/WebIDL/SVGStyleElement.swift b/Sources/DOMKit/WebIDL/SVGStyleElement.swift deleted file mode 100644 index 108541ec..00000000 --- a/Sources/DOMKit/WebIDL/SVGStyleElement.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGStyleElement: SVGElement, LinkStyle { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGStyleElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadWriteAttribute(jsObject: jsObject, name: Strings.type) - _media = ReadWriteAttribute(jsObject: jsObject, name: Strings.media) - _title = ReadWriteAttribute(jsObject: jsObject, name: Strings.title) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var type: String - - @ReadWriteAttribute - public var media: String - - @ReadWriteAttribute - public var title: String -} diff --git a/Sources/DOMKit/WebIDL/SVGSwitchElement.swift b/Sources/DOMKit/WebIDL/SVGSwitchElement.swift deleted file mode 100644 index d75a5584..00000000 --- a/Sources/DOMKit/WebIDL/SVGSwitchElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGSwitchElement: SVGGraphicsElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGSwitchElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGSymbolElement.swift b/Sources/DOMKit/WebIDL/SVGSymbolElement.swift deleted file mode 100644 index 81551625..00000000 --- a/Sources/DOMKit/WebIDL/SVGSymbolElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGSymbolElement: SVGGraphicsElement, SVGFitToViewBox { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGSymbolElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGTSpanElement.swift b/Sources/DOMKit/WebIDL/SVGTSpanElement.swift deleted file mode 100644 index 552134c8..00000000 --- a/Sources/DOMKit/WebIDL/SVGTSpanElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGTSpanElement: SVGTextPositioningElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTSpanElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGTests.swift b/Sources/DOMKit/WebIDL/SVGTests.swift deleted file mode 100644 index 904e0da3..00000000 --- a/Sources/DOMKit/WebIDL/SVGTests.swift +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol SVGTests: JSBridgedClass {} -public extension SVGTests { - @inlinable var requiredExtensions: SVGStringList { ReadonlyAttribute[Strings.requiredExtensions, in: jsObject] } - - @inlinable var systemLanguage: SVGStringList { ReadonlyAttribute[Strings.systemLanguage, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/SVGTextContentElement.swift b/Sources/DOMKit/WebIDL/SVGTextContentElement.swift deleted file mode 100644 index b06704ff..00000000 --- a/Sources/DOMKit/WebIDL/SVGTextContentElement.swift +++ /dev/null @@ -1,71 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGTextContentElement: SVGGraphicsElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextContentElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _textLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.textLength) - _lengthAdjust = ReadonlyAttribute(jsObject: jsObject, name: Strings.lengthAdjust) - super.init(unsafelyWrapping: jsObject) - } - - public static let LENGTHADJUST_UNKNOWN: UInt16 = 0 - - public static let LENGTHADJUST_SPACING: UInt16 = 1 - - public static let LENGTHADJUST_SPACINGANDGLYPHS: UInt16 = 2 - - @ReadonlyAttribute - public var textLength: SVGAnimatedLength - - @ReadonlyAttribute - public var lengthAdjust: SVGAnimatedEnumeration - - @inlinable public func getNumberOfChars() -> Int32 { - let this = jsObject - return this[Strings.getNumberOfChars].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getComputedTextLength() -> Float { - let this = jsObject - return this[Strings.getComputedTextLength].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func getSubStringLength(charnum: UInt32, nchars: UInt32) -> Float { - let this = jsObject - return this[Strings.getSubStringLength].function!(this: this, arguments: [charnum.jsValue, nchars.jsValue]).fromJSValue()! - } - - @inlinable public func getStartPositionOfChar(charnum: UInt32) -> DOMPoint { - let this = jsObject - return this[Strings.getStartPositionOfChar].function!(this: this, arguments: [charnum.jsValue]).fromJSValue()! - } - - @inlinable public func getEndPositionOfChar(charnum: UInt32) -> DOMPoint { - let this = jsObject - return this[Strings.getEndPositionOfChar].function!(this: this, arguments: [charnum.jsValue]).fromJSValue()! - } - - @inlinable public func getExtentOfChar(charnum: UInt32) -> DOMRect { - let this = jsObject - return this[Strings.getExtentOfChar].function!(this: this, arguments: [charnum.jsValue]).fromJSValue()! - } - - @inlinable public func getRotationOfChar(charnum: UInt32) -> Float { - let this = jsObject - return this[Strings.getRotationOfChar].function!(this: this, arguments: [charnum.jsValue]).fromJSValue()! - } - - @inlinable public func getCharNumAtPosition(point: DOMPointInit? = nil) -> Int32 { - let this = jsObject - return this[Strings.getCharNumAtPosition].function!(this: this, arguments: [point?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func selectSubString(charnum: UInt32, nchars: UInt32) { - let this = jsObject - _ = this[Strings.selectSubString].function!(this: this, arguments: [charnum.jsValue, nchars.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGTextElement.swift b/Sources/DOMKit/WebIDL/SVGTextElement.swift deleted file mode 100644 index 774cb1c2..00000000 --- a/Sources/DOMKit/WebIDL/SVGTextElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGTextElement: SVGTextPositioningElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGTextPathElement.swift b/Sources/DOMKit/WebIDL/SVGTextPathElement.swift deleted file mode 100644 index f9fc9c17..00000000 --- a/Sources/DOMKit/WebIDL/SVGTextPathElement.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGTextPathElement: SVGTextContentElement, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextPathElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _startOffset = ReadonlyAttribute(jsObject: jsObject, name: Strings.startOffset) - _method = ReadonlyAttribute(jsObject: jsObject, name: Strings.method) - _spacing = ReadonlyAttribute(jsObject: jsObject, name: Strings.spacing) - super.init(unsafelyWrapping: jsObject) - } - - public static let TEXTPATH_METHODTYPE_UNKNOWN: UInt16 = 0 - - public static let TEXTPATH_METHODTYPE_ALIGN: UInt16 = 1 - - public static let TEXTPATH_METHODTYPE_STRETCH: UInt16 = 2 - - public static let TEXTPATH_SPACINGTYPE_UNKNOWN: UInt16 = 0 - - public static let TEXTPATH_SPACINGTYPE_AUTO: UInt16 = 1 - - public static let TEXTPATH_SPACINGTYPE_EXACT: UInt16 = 2 - - @ReadonlyAttribute - public var startOffset: SVGAnimatedLength - - @ReadonlyAttribute - public var method: SVGAnimatedEnumeration - - @ReadonlyAttribute - public var spacing: SVGAnimatedEnumeration -} diff --git a/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift b/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift deleted file mode 100644 index 2c890286..00000000 --- a/Sources/DOMKit/WebIDL/SVGTextPositioningElement.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGTextPositioningElement: SVGTextContentElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTextPositioningElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _dx = ReadonlyAttribute(jsObject: jsObject, name: Strings.dx) - _dy = ReadonlyAttribute(jsObject: jsObject, name: Strings.dy) - _rotate = ReadonlyAttribute(jsObject: jsObject, name: Strings.rotate) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x: SVGAnimatedLengthList - - @ReadonlyAttribute - public var y: SVGAnimatedLengthList - - @ReadonlyAttribute - public var dx: SVGAnimatedLengthList - - @ReadonlyAttribute - public var dy: SVGAnimatedLengthList - - @ReadonlyAttribute - public var rotate: SVGAnimatedNumberList -} diff --git a/Sources/DOMKit/WebIDL/SVGTitleElement.swift b/Sources/DOMKit/WebIDL/SVGTitleElement.swift deleted file mode 100644 index ff2db400..00000000 --- a/Sources/DOMKit/WebIDL/SVGTitleElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGTitleElement: SVGElement { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGTitleElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGTransform.swift b/Sources/DOMKit/WebIDL/SVGTransform.swift deleted file mode 100644 index 907ec023..00000000 --- a/Sources/DOMKit/WebIDL/SVGTransform.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGTransform: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGTransform].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _matrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.matrix) - _angle = ReadonlyAttribute(jsObject: jsObject, name: Strings.angle) - self.jsObject = jsObject - } - - public static let SVG_TRANSFORM_UNKNOWN: UInt16 = 0 - - public static let SVG_TRANSFORM_MATRIX: UInt16 = 1 - - public static let SVG_TRANSFORM_TRANSLATE: UInt16 = 2 - - public static let SVG_TRANSFORM_SCALE: UInt16 = 3 - - public static let SVG_TRANSFORM_ROTATE: UInt16 = 4 - - public static let SVG_TRANSFORM_SKEWX: UInt16 = 5 - - public static let SVG_TRANSFORM_SKEWY: UInt16 = 6 - - @ReadonlyAttribute - public var type: UInt16 - - @ReadonlyAttribute - public var matrix: DOMMatrix - - @ReadonlyAttribute - public var angle: Float - - @inlinable public func setMatrix(matrix: DOMMatrix2DInit? = nil) { - let this = jsObject - _ = this[Strings.setMatrix].function!(this: this, arguments: [matrix?.jsValue ?? .undefined]) - } - - @inlinable public func setTranslate(tx: Float, ty: Float) { - let this = jsObject - _ = this[Strings.setTranslate].function!(this: this, arguments: [tx.jsValue, ty.jsValue]) - } - - @inlinable public func setScale(sx: Float, sy: Float) { - let this = jsObject - _ = this[Strings.setScale].function!(this: this, arguments: [sx.jsValue, sy.jsValue]) - } - - @inlinable public func setRotate(angle: Float, cx: Float, cy: Float) { - let this = jsObject - _ = this[Strings.setRotate].function!(this: this, arguments: [angle.jsValue, cx.jsValue, cy.jsValue]) - } - - @inlinable public func setSkewX(angle: Float) { - let this = jsObject - _ = this[Strings.setSkewX].function!(this: this, arguments: [angle.jsValue]) - } - - @inlinable public func setSkewY(angle: Float) { - let this = jsObject - _ = this[Strings.setSkewY].function!(this: this, arguments: [angle.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGTransformList.swift b/Sources/DOMKit/WebIDL/SVGTransformList.swift deleted file mode 100644 index 2cac5c85..00000000 --- a/Sources/DOMKit/WebIDL/SVGTransformList.swift +++ /dev/null @@ -1,68 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGTransformList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGTransformList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _numberOfItems = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfItems) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var length: UInt32 - - @ReadonlyAttribute - public var numberOfItems: UInt32 - - @inlinable public func clear() { - let this = jsObject - _ = this[Strings.clear].function!(this: this, arguments: []) - } - - @inlinable public func initialize(newItem: SVGTransform) -> SVGTransform { - let this = jsObject - return this[Strings.initialize].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - @inlinable public subscript(key: Int) -> SVGTransform { - jsObject[key].fromJSValue()! - } - - @inlinable public func insertItemBefore(newItem: SVGTransform, index: UInt32) -> SVGTransform { - let this = jsObject - return this[Strings.insertItemBefore].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func replaceItem(newItem: SVGTransform, index: UInt32) -> SVGTransform { - let this = jsObject - return this[Strings.replaceItem].function!(this: this, arguments: [newItem.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable public func removeItem(index: UInt32) -> SVGTransform { - let this = jsObject - return this[Strings.removeItem].function!(this: this, arguments: [index.jsValue]).fromJSValue()! - } - - @inlinable public func appendItem(newItem: SVGTransform) -> SVGTransform { - let this = jsObject - return this[Strings.appendItem].function!(this: this, arguments: [newItem.jsValue]).fromJSValue()! - } - - // XXX: unsupported setter for keys of type UInt32 - - @inlinable public func createSVGTransformFromMatrix(matrix: DOMMatrix2DInit? = nil) -> SVGTransform { - let this = jsObject - return this[Strings.createSVGTransformFromMatrix].function!(this: this, arguments: [matrix?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func consolidate() -> SVGTransform? { - let this = jsObject - return this[Strings.consolidate].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/SVGURIReference.swift b/Sources/DOMKit/WebIDL/SVGURIReference.swift deleted file mode 100644 index 6d5d1048..00000000 --- a/Sources/DOMKit/WebIDL/SVGURIReference.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol SVGURIReference: JSBridgedClass {} -public extension SVGURIReference { - @inlinable var href: SVGAnimatedString { ReadonlyAttribute[Strings.href, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/SVGUnitTypes.swift b/Sources/DOMKit/WebIDL/SVGUnitTypes.swift deleted file mode 100644 index 6aa1bf78..00000000 --- a/Sources/DOMKit/WebIDL/SVGUnitTypes.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGUnitTypes: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.SVGUnitTypes].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - public static let SVG_UNIT_TYPE_UNKNOWN: UInt16 = 0 - - public static let SVG_UNIT_TYPE_USERSPACEONUSE: UInt16 = 1 - - public static let SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: UInt16 = 2 -} diff --git a/Sources/DOMKit/WebIDL/SVGUseElement.swift b/Sources/DOMKit/WebIDL/SVGUseElement.swift deleted file mode 100644 index 7e45cd6c..00000000 --- a/Sources/DOMKit/WebIDL/SVGUseElement.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGUseElement: SVGGraphicsElement, SVGURIReference { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGUseElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _x = ReadonlyAttribute(jsObject: jsObject, name: Strings.x) - _y = ReadonlyAttribute(jsObject: jsObject, name: Strings.y) - _width = ReadonlyAttribute(jsObject: jsObject, name: Strings.width) - _height = ReadonlyAttribute(jsObject: jsObject, name: Strings.height) - _instanceRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.instanceRoot) - _animatedInstanceRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.animatedInstanceRoot) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var x: SVGAnimatedLength - - @ReadonlyAttribute - public var y: SVGAnimatedLength - - @ReadonlyAttribute - public var width: SVGAnimatedLength - - @ReadonlyAttribute - public var height: SVGAnimatedLength - - @ReadonlyAttribute - public var instanceRoot: SVGElement? - - @ReadonlyAttribute - public var animatedInstanceRoot: SVGElement? -} diff --git a/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift b/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift deleted file mode 100644 index d00b0273..00000000 --- a/Sources/DOMKit/WebIDL/SVGUseElementShadowRoot.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGUseElementShadowRoot: ShadowRoot { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGUseElementShadowRoot].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/SVGViewElement.swift b/Sources/DOMKit/WebIDL/SVGViewElement.swift deleted file mode 100644 index 70d79dcf..00000000 --- a/Sources/DOMKit/WebIDL/SVGViewElement.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SVGViewElement: SVGElement, SVGFitToViewBox { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SVGViewElement].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/ShadowAnimation.swift b/Sources/DOMKit/WebIDL/ShadowAnimation.swift deleted file mode 100644 index ff82aa73..00000000 --- a/Sources/DOMKit/WebIDL/ShadowAnimation.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ShadowAnimation: Animation { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ShadowAnimation].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _sourceAnimation = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceAnimation) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(source: Animation, newTarget: CSSPseudoElement_or_Element) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [source.jsValue, newTarget.jsValue])) - } - - @ReadonlyAttribute - public var sourceAnimation: Animation -} diff --git a/Sources/DOMKit/WebIDL/SourceBuffer.swift b/Sources/DOMKit/WebIDL/SourceBuffer.swift deleted file mode 100644 index 209ca8dc..00000000 --- a/Sources/DOMKit/WebIDL/SourceBuffer.swift +++ /dev/null @@ -1,88 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SourceBuffer: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SourceBuffer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _mode = ReadWriteAttribute(jsObject: jsObject, name: Strings.mode) - _updating = ReadonlyAttribute(jsObject: jsObject, name: Strings.updating) - _buffered = ReadonlyAttribute(jsObject: jsObject, name: Strings.buffered) - _timestampOffset = ReadWriteAttribute(jsObject: jsObject, name: Strings.timestampOffset) - _audioTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioTracks) - _videoTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoTracks) - _textTracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.textTracks) - _appendWindowStart = ReadWriteAttribute(jsObject: jsObject, name: Strings.appendWindowStart) - _appendWindowEnd = ReadWriteAttribute(jsObject: jsObject, name: Strings.appendWindowEnd) - _onupdatestart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onupdatestart) - _onupdate = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onupdate) - _onupdateend = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onupdateend) - _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) - _onabort = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onabort) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var mode: AppendMode - - @ReadonlyAttribute - public var updating: Bool - - @ReadonlyAttribute - public var buffered: TimeRanges - - @ReadWriteAttribute - public var timestampOffset: Double - - @ReadonlyAttribute - public var audioTracks: AudioTrackList - - @ReadonlyAttribute - public var videoTracks: VideoTrackList - - @ReadonlyAttribute - public var textTracks: TextTrackList - - @ReadWriteAttribute - public var appendWindowStart: Double - - @ReadWriteAttribute - public var appendWindowEnd: Double - - @ClosureAttribute1Optional - public var onupdatestart: EventHandler - - @ClosureAttribute1Optional - public var onupdate: EventHandler - - @ClosureAttribute1Optional - public var onupdateend: EventHandler - - @ClosureAttribute1Optional - public var onerror: EventHandler - - @ClosureAttribute1Optional - public var onabort: EventHandler - - @inlinable public func appendBuffer(data: BufferSource) { - let this = jsObject - _ = this[Strings.appendBuffer].function!(this: this, arguments: [data.jsValue]) - } - - @inlinable public func abort() { - let this = jsObject - _ = this[Strings.abort].function!(this: this, arguments: []) - } - - @inlinable public func changeType(type: String) { - let this = jsObject - _ = this[Strings.changeType].function!(this: this, arguments: [type.jsValue]) - } - - @inlinable public func remove(start: Double, end: Double) { - let this = jsObject - _ = this[Strings.remove].function!(this: this, arguments: [start.jsValue, end.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/SourceBufferList.swift b/Sources/DOMKit/WebIDL/SourceBufferList.swift deleted file mode 100644 index 28798d08..00000000 --- a/Sources/DOMKit/WebIDL/SourceBufferList.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SourceBufferList: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.SourceBufferList].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _onaddsourcebuffer = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddsourcebuffer) - _onremovesourcebuffer = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovesourcebuffer) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var length: UInt32 - - @ClosureAttribute1Optional - public var onaddsourcebuffer: EventHandler - - @ClosureAttribute1Optional - public var onremovesourcebuffer: EventHandler - - @inlinable public subscript(key: Int) -> SourceBuffer { - jsObject[key].fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift index b532df0e..9aeb34a1 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -13,15 +13,11 @@ import JavaScriptKit @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" @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" @@ -31,7 +27,6 @@ import JavaScriptKit @usableFromInline static let CSSMarginRule: JSString = "CSSMarginRule" @usableFromInline static let CSSNamespaceRule: JSString = "CSSNamespaceRule" @usableFromInline static let CSSPageRule: JSString = "CSSPageRule" - @usableFromInline static let CSSPseudoElement: JSString = "CSSPseudoElement" @usableFromInline static let CSSRule: JSString = "CSSRule" @usableFromInline static let CSSRuleList: JSString = "CSSRuleList" @usableFromInline static let CSSStyleDeclaration: JSString = "CSSStyleDeclaration" @@ -73,8 +68,6 @@ import JavaScriptKit @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" @@ -167,25 +160,13 @@ import JavaScriptKit @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" @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 MediaList: JSString = "MediaList" - @usableFromInline static let MediaRecorder: JSString = "MediaRecorder" - @usableFromInline static let MediaRecorderErrorEvent: JSString = "MediaRecorderErrorEvent" - @usableFromInline static let MediaSource: JSString = "MediaSource" - @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" @@ -204,7 +185,6 @@ import JavaScriptKit @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" @@ -224,74 +204,11 @@ import JavaScriptKit @usableFromInline static let ReadableStreamDefaultReader: JSString = "ReadableStreamDefaultReader" @usableFromInline static let Request: JSString = "Request" @usableFromInline static let Response: JSString = "Response" - @usableFromInline static let SVGAElement: JSString = "SVGAElement" - @usableFromInline static let SVGAngle: JSString = "SVGAngle" - @usableFromInline static let SVGAnimatedAngle: JSString = "SVGAnimatedAngle" - @usableFromInline static let SVGAnimatedBoolean: JSString = "SVGAnimatedBoolean" - @usableFromInline static let SVGAnimatedEnumeration: JSString = "SVGAnimatedEnumeration" - @usableFromInline static let SVGAnimatedInteger: JSString = "SVGAnimatedInteger" - @usableFromInline static let SVGAnimatedLength: JSString = "SVGAnimatedLength" - @usableFromInline static let SVGAnimatedLengthList: JSString = "SVGAnimatedLengthList" - @usableFromInline static let SVGAnimatedNumber: JSString = "SVGAnimatedNumber" - @usableFromInline static let SVGAnimatedNumberList: JSString = "SVGAnimatedNumberList" - @usableFromInline static let SVGAnimatedPreserveAspectRatio: JSString = "SVGAnimatedPreserveAspectRatio" - @usableFromInline static let SVGAnimatedRect: JSString = "SVGAnimatedRect" - @usableFromInline static let SVGAnimatedString: JSString = "SVGAnimatedString" - @usableFromInline static let SVGAnimatedTransformList: JSString = "SVGAnimatedTransformList" - @usableFromInline static let SVGCircleElement: JSString = "SVGCircleElement" - @usableFromInline static let SVGDefsElement: JSString = "SVGDefsElement" - @usableFromInline static let SVGDescElement: JSString = "SVGDescElement" - @usableFromInline static let SVGElement: JSString = "SVGElement" - @usableFromInline static let SVGEllipseElement: JSString = "SVGEllipseElement" - @usableFromInline static let SVGForeignObjectElement: JSString = "SVGForeignObjectElement" - @usableFromInline static let SVGGElement: JSString = "SVGGElement" - @usableFromInline static let SVGGeometryElement: JSString = "SVGGeometryElement" - @usableFromInline static let SVGGradientElement: JSString = "SVGGradientElement" - @usableFromInline static let SVGGraphicsElement: JSString = "SVGGraphicsElement" - @usableFromInline static let SVGImageElement: JSString = "SVGImageElement" - @usableFromInline static let SVGLength: JSString = "SVGLength" - @usableFromInline static let SVGLengthList: JSString = "SVGLengthList" - @usableFromInline static let SVGLineElement: JSString = "SVGLineElement" - @usableFromInline static let SVGLinearGradientElement: JSString = "SVGLinearGradientElement" - @usableFromInline static let SVGMarkerElement: JSString = "SVGMarkerElement" - @usableFromInline static let SVGMetadataElement: JSString = "SVGMetadataElement" - @usableFromInline static let SVGNumber: JSString = "SVGNumber" - @usableFromInline static let SVGNumberList: JSString = "SVGNumberList" - @usableFromInline static let SVGPathElement: JSString = "SVGPathElement" - @usableFromInline static let SVGPatternElement: JSString = "SVGPatternElement" - @usableFromInline static let SVGPointList: JSString = "SVGPointList" - @usableFromInline static let SVGPolygonElement: JSString = "SVGPolygonElement" - @usableFromInline static let SVGPolylineElement: JSString = "SVGPolylineElement" - @usableFromInline static let SVGPreserveAspectRatio: JSString = "SVGPreserveAspectRatio" - @usableFromInline static let SVGRadialGradientElement: JSString = "SVGRadialGradientElement" - @usableFromInline static let SVGRectElement: JSString = "SVGRectElement" - @usableFromInline static let SVGSVGElement: JSString = "SVGSVGElement" - @usableFromInline static let SVGScriptElement: JSString = "SVGScriptElement" - @usableFromInline static let SVGStopElement: JSString = "SVGStopElement" - @usableFromInline static let SVGStringList: JSString = "SVGStringList" - @usableFromInline static let SVGStyleElement: JSString = "SVGStyleElement" - @usableFromInline static let SVGSwitchElement: JSString = "SVGSwitchElement" - @usableFromInline static let SVGSymbolElement: JSString = "SVGSymbolElement" - @usableFromInline static let SVGTSpanElement: JSString = "SVGTSpanElement" - @usableFromInline static let SVGTextContentElement: JSString = "SVGTextContentElement" - @usableFromInline static let SVGTextElement: JSString = "SVGTextElement" - @usableFromInline static let SVGTextPathElement: JSString = "SVGTextPathElement" - @usableFromInline static let SVGTextPositioningElement: JSString = "SVGTextPositioningElement" - @usableFromInline static let SVGTitleElement: JSString = "SVGTitleElement" - @usableFromInline static let SVGTransform: JSString = "SVGTransform" - @usableFromInline static let SVGTransformList: JSString = "SVGTransformList" - @usableFromInline static let SVGUnitTypes: JSString = "SVGUnitTypes" - @usableFromInline static let SVGUseElement: JSString = "SVGUseElement" - @usableFromInline static let SVGUseElementShadowRoot: JSString = "SVGUseElementShadowRoot" - @usableFromInline static let SVGViewElement: JSString = "SVGViewElement" @usableFromInline static let ServiceWorker: JSString = "ServiceWorker" @usableFromInline static let ServiceWorkerContainer: JSString = "ServiceWorkerContainer" @usableFromInline static let ServiceWorkerRegistration: JSString = "ServiceWorkerRegistration" - @usableFromInline static let ShadowAnimation: JSString = "ShadowAnimation" @usableFromInline static let ShadowRoot: JSString = "ShadowRoot" @usableFromInline static let SharedWorker: JSString = "SharedWorker" - @usableFromInline static let SourceBuffer: JSString = "SourceBuffer" - @usableFromInline static let SourceBufferList: JSString = "SourceBufferList" @usableFromInline static let StaticRange: JSString = "StaticRange" @usableFromInline static let Storage: JSString = "Storage" @usableFromInline static let StorageEvent: JSString = "StorageEvent" @@ -313,10 +230,6 @@ import JavaScriptKit @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" @@ -347,7 +260,6 @@ import JavaScriptKit @usableFromInline static let active: JSString = "active" @usableFromInline static let activeCues: JSString = "activeCues" @usableFromInline static let activeElement: JSString = "activeElement" - @usableFromInline static let activeSourceBuffers: JSString = "activeSourceBuffers" @usableFromInline static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" @usableFromInline static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" @usableFromInline static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" @@ -359,47 +271,32 @@ import JavaScriptKit @usableFromInline static let addModule: JSString = "addModule" @usableFromInline static let addPath: JSString = "addPath" @usableFromInline static let addRule: JSString = "addRule" - @usableFromInline static let addSourceBuffer: JSString = "addSourceBuffer" @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 adoptedStyleSheets: JSString = "adoptedStyleSheets" - @usableFromInline static let advanced: JSString = "advanced" @usableFromInline static let after: JSString = "after" @usableFromInline static let alert: JSString = "alert" @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 angle: JSString = "angle" - @usableFromInline static let animVal: JSString = "animVal" @usableFromInline static let animate: JSString = "animate" - @usableFromInline static let animated: JSString = "animated" - @usableFromInline static let animatedInstanceRoot: JSString = "animatedInstanceRoot" - @usableFromInline static let animatedPoints: JSString = "animatedPoints" @usableFromInline static let appCodeName: JSString = "appCodeName" @usableFromInline static let appName: JSString = "appName" @usableFromInline static let appVersion: JSString = "appVersion" @usableFromInline static let append: JSString = "append" - @usableFromInline static let appendBuffer: JSString = "appendBuffer" @usableFromInline static let appendChild: JSString = "appendChild" @usableFromInline static let appendData: JSString = "appendData" - @usableFromInline static let appendItem: JSString = "appendItem" @usableFromInline static let appendMedium: JSString = "appendMedium" - @usableFromInline static let appendWindowEnd: JSString = "appendWindowEnd" - @usableFromInline static let appendWindowStart: JSString = "appendWindowStart" @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" @@ -446,7 +343,6 @@ import JavaScriptKit @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 assign: JSString = "assign" @usableFromInline static let assignedElements: JSString = "assignedElements" @usableFromInline static let assignedNodes: JSString = "assignedNodes" @@ -462,12 +358,8 @@ import JavaScriptKit @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 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" @usableFromInline static let autocapitalize: JSString = "autocapitalize" @usableFromInline static let autocomplete: JSString = "autocomplete" @usableFromInline static let autofocus: JSString = "autofocus" @@ -479,15 +371,11 @@ import JavaScriptKit @usableFromInline static let badInput: JSString = "badInput" @usableFromInline static let baseURI: JSString = "baseURI" @usableFromInline static let baseURL: JSString = "baseURL" - @usableFromInline static let baseVal: JSString = "baseVal" @usableFromInline static let before: JSString = "before" @usableFromInline static let beginPath: JSString = "beginPath" @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" @usableFromInline static let blur: JSString = "blur" @@ -502,12 +390,10 @@ import JavaScriptKit @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" @usableFromInline static let caches: JSString = "caches" - @usableFromInline static let canConstructInDedicatedWorker: JSString = "canConstructInDedicatedWorker" @usableFromInline static let canPlayType: JSString = "canPlayType" @usableFromInline static let cancel: JSString = "cancel" @usableFromInline static let cancelAnimationFrame: JSString = "cancelAnimationFrame" @@ -523,15 +409,11 @@ import JavaScriptKit @usableFromInline static let cells: JSString = "cells" @usableFromInline static let ch: JSString = "ch" @usableFromInline static let chOff: JSString = "chOff" - @usableFromInline static let changeType: JSString = "changeType" - @usableFromInline static let channelCount: JSString = "channelCount" @usableFromInline static let charCode: JSString = "charCode" @usableFromInline static let characterData: JSString = "characterData" @usableFromInline static let characterDataOldValue: JSString = "characterDataOldValue" @usableFromInline static let characterSet: JSString = "characterSet" @usableFromInline static let charset: JSString = "charset" - @usableFromInline static let checkEnclosure: JSString = "checkEnclosure" - @usableFromInline static let checkIntersection: JSString = "checkIntersection" @usableFromInline static let checkValidity: JSString = "checkValidity" @usableFromInline static let checked: JSString = "checked" @usableFromInline static let childElementCount: JSString = "childElementCount" @@ -544,7 +426,6 @@ import JavaScriptKit @usableFromInline static let clear: JSString = "clear" @usableFromInline static let clearData: JSString = "clearData" @usableFromInline static let clearInterval: JSString = "clearInterval" - @usableFromInline static let clearLiveSeekableRange: JSString = "clearLiveSeekableRange" @usableFromInline static let clearParameters: JSString = "clearParameters" @usableFromInline static let clearRect: JSString = "clearRect" @usableFromInline static let clearTimeout: JSString = "clearTimeout" @@ -554,7 +435,6 @@ import JavaScriptKit @usableFromInline static let clientX: JSString = "clientX" @usableFromInline static let clientY: JSString = "clientY" @usableFromInline static let clip: JSString = "clip" - @usableFromInline static let clipped: JSString = "clipped" @usableFromInline static let clone: JSString = "clone" @usableFromInline static let cloneContents: JSString = "cloneContents" @usableFromInline static let cloneNode: JSString = "cloneNode" @@ -566,10 +446,6 @@ import JavaScriptKit @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" @@ -587,17 +463,11 @@ import JavaScriptKit @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 consolidate: JSString = "consolidate" - @usableFromInline static let constraint: JSString = "constraint" @usableFromInline static let contains: JSString = "contains" @usableFromInline static let content: JSString = "content" @usableFromInline static let contentDocument: JSString = "contentDocument" @@ -608,13 +478,9 @@ import JavaScriptKit @usableFromInline static let controller: JSString = "controller" @usableFromInline static let controls: JSString = "controls" @usableFromInline static let convertToBlob: JSString = "convertToBlob" - @usableFromInline static let convertToSpecifiedUnits: JSString = "convertToSpecifiedUnits" @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 correspondingElement: JSString = "correspondingElement" - @usableFromInline static let correspondingUseElement: JSString = "correspondingUseElement" @usableFromInline static let createAttribute: JSString = "createAttribute" @usableFromInline static let createAttributeNS: JSString = "createAttributeNS" @usableFromInline static let createCDATASection: JSString = "createCDATASection" @@ -636,14 +502,6 @@ import JavaScriptKit @usableFromInline static let createProcessingInstruction: JSString = "createProcessingInstruction" @usableFromInline static let createRadialGradient: JSString = "createRadialGradient" @usableFromInline static let createRange: JSString = "createRange" - @usableFromInline static let createSVGAngle: JSString = "createSVGAngle" - @usableFromInline static let createSVGLength: JSString = "createSVGLength" - @usableFromInline static let createSVGMatrix: JSString = "createSVGMatrix" - @usableFromInline static let createSVGNumber: JSString = "createSVGNumber" - @usableFromInline static let createSVGPoint: JSString = "createSVGPoint" - @usableFromInline static let createSVGRect: JSString = "createSVGRect" - @usableFromInline static let createSVGTransform: JSString = "createSVGTransform" - @usableFromInline static let createSVGTransformFromMatrix: JSString = "createSVGTransformFromMatrix" @usableFromInline static let createTBody: JSString = "createTBody" @usableFromInline static let createTFoot: JSString = "createTFoot" @usableFromInline static let createTHead: JSString = "createTHead" @@ -658,16 +516,12 @@ import JavaScriptKit @usableFromInline static let cues: JSString = "cues" @usableFromInline static let currentIteration: JSString = "currentIteration" @usableFromInline static let currentNode: JSString = "currentNode" - @usableFromInline static let currentScale: JSString = "currentScale" @usableFromInline static let currentScript: JSString = "currentScript" @usableFromInline static let currentSrc: JSString = "currentSrc" @usableFromInline static let currentTarget: JSString = "currentTarget" @usableFromInline static let currentTime: JSString = "currentTime" - @usableFromInline static let currentTranslate: JSString = "currentTranslate" @usableFromInline static let customElements: JSString = "customElements" @usableFromInline static let customError: JSString = "customError" - @usableFromInline static let cx: JSString = "cx" - @usableFromInline static let cy: JSString = "cy" @usableFromInline static let d: JSString = "d" @usableFromInline static let data: JSString = "data" @usableFromInline static let dataTransfer: JSString = "dataTransfer" @@ -675,8 +529,6 @@ import JavaScriptKit @usableFromInline static let dateTime: JSString = "dateTime" @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" @@ -705,16 +557,12 @@ import JavaScriptKit @usableFromInline static let deltaY: JSString = "deltaY" @usableFromInline static let deltaZ: JSString = "deltaZ" @usableFromInline static let description: JSString = "description" - @usableFromInline static let deselectAll: JSString = "deselectAll" @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" @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" @@ -722,10 +570,6 @@ import JavaScriptKit @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" @@ -738,14 +582,10 @@ import JavaScriptKit @usableFromInline static let drawImage: JSString = "drawImage" @usableFromInline static let dropEffect: JSString = "dropEffect" @usableFromInline static let duration: JSString = "duration" - @usableFromInline static let dx: JSString = "dx" - @usableFromInline static let dy: JSString = "dy" @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 element: JSString = "element" @usableFromInline static let elements: JSString = "elements" @usableFromInline static let ellipse: JSString = "ellipse" @usableFromInline static let emHeightAscent: JSString = "emHeightAscent" @@ -754,34 +594,28 @@ import JavaScriptKit @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" @usableFromInline static let endContainer: JSString = "endContainer" @usableFromInline static let endDelay: JSString = "endDelay" - @usableFromInline static let endOfStream: JSString = "endOfStream" @usableFromInline static let endOffset: JSString = "endOffset" @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 enumerateDevices: JSString = "enumerateDevices" @usableFromInline static let error: JSString = "error" @usableFromInline static let escape: JSString = "escape" @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" @@ -807,7 +641,6 @@ import JavaScriptKit @usableFromInline static let fontKerning: JSString = "fontKerning" @usableFromInline static let fontStretch: JSString = "fontStretch" @usableFromInline static let fontVariantCaps: JSString = "fontVariantCaps" - @usableFromInline static let forceRedraw: JSString = "forceRedraw" @usableFromInline static let form: JSString = "form" @usableFromInline static let formAction: JSString = "formAction" @usableFromInline static let formData: JSString = "formData" @@ -815,18 +648,11 @@ import JavaScriptKit @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 fr: JSString = "fr" @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" @@ -834,9 +660,6 @@ import JavaScriptKit @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 fx: JSString = "fx" - @usableFromInline static let fy: JSString = "fy" @usableFromInline static let get: JSString = "get" @usableFromInline static let getAll: JSString = "getAll" @usableFromInline static let getAllResponseHeaders: JSString = "getAllResponseHeaders" @@ -847,16 +670,9 @@ import JavaScriptKit @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 getBBox: JSString = "getBBox" @usableFromInline static let getBounds: JSString = "getBounds" - @usableFromInline static let getCTM: JSString = "getCTM" - @usableFromInline static let getCapabilities: JSString = "getCapabilities" - @usableFromInline static let getCharNumAtPosition: JSString = "getCharNumAtPosition" @usableFromInline static let getComputedStyle: JSString = "getComputedStyle" - @usableFromInline static let getComputedTextLength: JSString = "getComputedTextLength" @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" @@ -866,18 +682,12 @@ import JavaScriptKit @usableFromInline static let getElementsByName: JSString = "getElementsByName" @usableFromInline static let getElementsByTagName: JSString = "getElementsByTagName" @usableFromInline static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" - @usableFromInline static let getEnclosureList: JSString = "getEnclosureList" - @usableFromInline static let getEndPositionOfChar: JSString = "getEndPositionOfChar" - @usableFromInline static let getExtentOfChar: JSString = "getExtentOfChar" @usableFromInline static let getImageData: JSString = "getImageData" - @usableFromInline static let getIntersectionList: JSString = "getIntersectionList" @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 getNumberOfChars: JSString = "getNumberOfChars" @usableFromInline static let getParameter: JSString = "getParameter" - @usableFromInline static let getPointAtLength: JSString = "getPointAtLength" @usableFromInline static let getPropertyPriority: JSString = "getPropertyPriority" @usableFromInline static let getPropertyValue: JSString = "getPropertyValue" @usableFromInline static let getReader: JSString = "getReader" @@ -885,32 +695,18 @@ import JavaScriptKit @usableFromInline static let getRegistrations: JSString = "getRegistrations" @usableFromInline static let getResponseHeader: JSString = "getResponseHeader" @usableFromInline static let getRootNode: JSString = "getRootNode" - @usableFromInline static let getRotationOfChar: JSString = "getRotationOfChar" @usableFromInline static let getSVGDocument: JSString = "getSVGDocument" - @usableFromInline static let getScreenCTM: JSString = "getScreenCTM" - @usableFromInline static let getSettings: JSString = "getSettings" @usableFromInline static let getStartDate: JSString = "getStartDate" - @usableFromInline static let getStartPositionOfChar: JSString = "getStartPositionOfChar" @usableFromInline static let getState: JSString = "getState" - @usableFromInline static let getSubStringLength: JSString = "getSubStringLength" - @usableFromInline static let getSupportedConstraints: JSString = "getSupportedConstraints" @usableFromInline static let getTiming: JSString = "getTiming" - @usableFromInline static let getTotalLength: JSString = "getTotalLength" @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" @usableFromInline static let go: JSString = "go" - @usableFromInline static let gradientTransform: JSString = "gradientTransform" - @usableFromInline static let gradientUnits: JSString = "gradientUnits" - @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" @@ -936,12 +732,10 @@ import JavaScriptKit @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" @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" @@ -965,7 +759,6 @@ import JavaScriptKit @usableFromInline static let initMutationEvent: JSString = "initMutationEvent" @usableFromInline static let initStorageEvent: JSString = "initStorageEvent" @usableFromInline static let initUIEvent: JSString = "initUIEvent" - @usableFromInline static let initialize: JSString = "initialize" @usableFromInline static let innerText: JSString = "innerText" @usableFromInline static let inputEncoding: JSString = "inputEncoding" @usableFromInline static let inputMode: JSString = "inputMode" @@ -975,12 +768,10 @@ import JavaScriptKit @usableFromInline static let insertBefore: JSString = "insertBefore" @usableFromInline static let insertCell: JSString = "insertCell" @usableFromInline static let insertData: JSString = "insertData" - @usableFromInline static let insertItemBefore: JSString = "insertItemBefore" @usableFromInline static let insertNode: JSString = "insertNode" @usableFromInline static let insertRow: JSString = "insertRow" @usableFromInline static let insertRule: JSString = "insertRule" @usableFromInline static let installing: JSString = "installing" - @usableFromInline static let instanceRoot: JSString = "instanceRoot" @usableFromInline static let integrity: JSString = "integrity" @usableFromInline static let intersectsNode: JSString = "intersectsNode" @usableFromInline static let invalidIteratorState: JSString = "invalidIteratorState" @@ -989,7 +780,6 @@ import JavaScriptKit @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" @@ -998,7 +788,6 @@ import JavaScriptKit @usableFromInline static let isHistoryNavigation: JSString = "isHistoryNavigation" @usableFromInline static let isIdentity: JSString = "isIdentity" @usableFromInline static let isMap: JSString = "isMap" - @usableFromInline static let isPointInFill: JSString = "isPointInFill" @usableFromInline static let isPointInPath: JSString = "isPointInPath" @usableFromInline static let isPointInRange: JSString = "isPointInRange" @usableFromInline static let isPointInStroke: JSString = "isPointInStroke" @@ -1006,7 +795,6 @@ import JavaScriptKit @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" @@ -1017,7 +805,6 @@ import JavaScriptKit @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" @@ -1029,12 +816,8 @@ import JavaScriptKit @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 latencyMode: JSString = "latencyMode" - @usableFromInline static let layout: JSString = "layout" @usableFromInline static let left: JSString = "left" @usableFromInline static let length: JSString = "length" - @usableFromInline static let lengthAdjust: JSString = "lengthAdjust" @usableFromInline static let lengthComputable: JSString = "lengthComputable" @usableFromInline static let letterSpacing: JSString = "letterSpacing" @usableFromInline static let lineCap: JSString = "lineCap" @@ -1079,27 +862,19 @@ import JavaScriptKit @usableFromInline static let m44: JSString = "m44" @usableFromInline static let marginHeight: JSString = "marginHeight" @usableFromInline static let marginWidth: JSString = "marginWidth" - @usableFromInline static let markerHeight: JSString = "markerHeight" - @usableFromInline static let markerUnits: JSString = "markerUnits" - @usableFromInline static let markerWidth: JSString = "markerWidth" - @usableFromInline static let markers: JSString = "markers" @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" @usableFromInline static let measureText: JSString = "measureText" @usableFromInline static let media: JSString = "media" - @usableFromInline static let mediaDevices: JSString = "mediaDevices" @usableFromInline static let mediaText: JSString = "mediaText" - @usableFromInline static let meetOrSlice: JSString = "meetOrSlice" @usableFromInline static let menubar: JSString = "menubar" @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" @@ -1130,7 +905,6 @@ import JavaScriptKit @usableFromInline static let networkState: JSString = "networkState" @usableFromInline static let newURL: JSString = "newURL" @usableFromInline static let newValue: JSString = "newValue" - @usableFromInline static let newValueSpecifiedUnits: JSString = "newValueSpecifiedUnits" @usableFromInline static let nextElementSibling: JSString = "nextElementSibling" @usableFromInline static let nextNode: JSString = "nextNode" @usableFromInline static let nextSibling: JSString = "nextSibling" @@ -1143,13 +917,9 @@ import JavaScriptKit @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" - @usableFromInline static let numberOfChannels: JSString = "numberOfChannels" - @usableFromInline static let numberOfFrames: JSString = "numberOfFrames" - @usableFromInline static let numberOfItems: JSString = "numberOfItems" @usableFromInline static let numberValue: JSString = "numberValue" @usableFromInline static let observe: JSString = "observe" @usableFromInline static let offset: JSString = "offset" @@ -1158,7 +928,6 @@ import JavaScriptKit @usableFromInline static let oldValue: JSString = "oldValue" @usableFromInline static let onLine: JSString = "onLine" @usableFromInline static let onabort: JSString = "onabort" - @usableFromInline static let onaddsourcebuffer: JSString = "onaddsourcebuffer" @usableFromInline static let onaddtrack: JSString = "onaddtrack" @usableFromInline static let onafterprint: JSString = "onafterprint" @usableFromInline static let onauxclick: JSString = "onauxclick" @@ -1179,9 +948,7 @@ import JavaScriptKit @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" @usableFromInline static let ondragend: JSString = "ondragend" @usableFromInline static let ondragenter: JSString = "ondragenter" @@ -1219,7 +986,6 @@ import JavaScriptKit @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" @@ -1235,24 +1001,17 @@ import JavaScriptKit @usableFromInline static let onreadystatechange: JSString = "onreadystatechange" @usableFromInline static let onrejectionhandled: JSString = "onrejectionhandled" @usableFromInline static let onremove: JSString = "onremove" - @usableFromInline static let onremovesourcebuffer: JSString = "onremovesourcebuffer" @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" @usableFromInline static let onseeking: JSString = "onseeking" @usableFromInline static let onselect: JSString = "onselect" @usableFromInline static let onslotchange: JSString = "onslotchange" - @usableFromInline static let onsourceclose: JSString = "onsourceclose" - @usableFromInline static let onsourceended: JSString = "onsourceended" - @usableFromInline static let onsourceopen: JSString = "onsourceopen" @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" @@ -1261,11 +1020,7 @@ import JavaScriptKit @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 onupdate: JSString = "onupdate" - @usableFromInline static let onupdateend: JSString = "onupdateend" @usableFromInline static let onupdatefound: JSString = "onupdatefound" - @usableFromInline static let onupdatestart: JSString = "onupdatestart" @usableFromInline static let onvisibilitychange: JSString = "onvisibilitychange" @usableFromInline static let onvolumechange: JSString = "onvolumechange" @usableFromInline static let onwaiting: JSString = "onwaiting" @@ -1276,29 +1031,22 @@ import JavaScriptKit @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 orient: JSString = "orient" - @usableFromInline static let orientAngle: JSString = "orientAngle" - @usableFromInline static let orientType: JSString = "orientType" @usableFromInline static let origin: JSString = "origin" @usableFromInline static let originAgentCluster: JSString = "originAgentCluster" @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" @usableFromInline static let ownerNode: JSString = "ownerNode" @usableFromInline static let ownerRule: JSString = "ownerRule" - @usableFromInline static let ownerSVGElement: JSString = "ownerSVGElement" @usableFromInline static let p1: JSString = "p1" @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" @@ -1307,13 +1055,9 @@ import JavaScriptKit @usableFromInline static let parseFromString: JSString = "parseFromString" @usableFromInline static let passive: JSString = "passive" @usableFromInline static let password: JSString = "password" - @usableFromInline static let pathLength: JSString = "pathLength" @usableFromInline static let pathname: JSString = "pathname" @usableFromInline static let pattern: JSString = "pattern" - @usableFromInline static let patternContentUnits: JSString = "patternContentUnits" @usableFromInline static let patternMismatch: JSString = "patternMismatch" - @usableFromInline static let patternTransform: JSString = "patternTransform" - @usableFromInline static let patternUnits: JSString = "patternUnits" @usableFromInline static let pause: JSString = "pause" @usableFromInline static let pauseOnExit: JSString = "pauseOnExit" @usableFromInline static let paused: JSString = "paused" @@ -1328,7 +1072,6 @@ import JavaScriptKit @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" @@ -1337,7 +1080,6 @@ import JavaScriptKit @usableFromInline static let playsInline: JSString = "playsInline" @usableFromInline static let plugins: JSString = "plugins" @usableFromInline static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" - @usableFromInline static let points: JSString = "points" @usableFromInline static let port: JSString = "port" @usableFromInline static let port1: JSString = "port1" @usableFromInline static let port2: JSString = "port2" @@ -1346,13 +1088,11 @@ import JavaScriptKit @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" @usableFromInline static let premultiplyAlpha: JSString = "premultiplyAlpha" @usableFromInline static let prepend: JSString = "prepend" - @usableFromInline static let preserveAspectRatio: JSString = "preserveAspectRatio" @usableFromInline static let preservesPitch: JSString = "preservesPitch" @usableFromInline static let prevValue: JSString = "prevValue" @usableFromInline static let preventAbort: JSString = "preventAbort" @@ -1363,7 +1103,6 @@ import JavaScriptKit @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" @@ -1371,7 +1110,6 @@ import JavaScriptKit @usableFromInline static let promise: JSString = "promise" @usableFromInline static let prompt: JSString = "prompt" @usableFromInline static let `protocol`: JSString = "protocol" - @usableFromInline static let pseudo: JSString = "pseudo" @usableFromInline static let pseudoElement: JSString = "pseudoElement" @usableFromInline static let publicId: JSString = "publicId" @usableFromInline static let pull: JSString = "pull" @@ -1387,7 +1125,6 @@ import JavaScriptKit @usableFromInline static let queryCommandValue: JSString = "queryCommandValue" @usableFromInline static let querySelector: JSString = "querySelector" @usableFromInline static let querySelectorAll: JSString = "querySelectorAll" - @usableFromInline static let r: JSString = "r" @usableFromInline static let rangeOverflow: JSString = "rangeOverflow" @usableFromInline static let rangeUnderflow: JSString = "rangeUnderflow" @usableFromInline static let read: JSString = "read" @@ -1404,8 +1141,6 @@ import JavaScriptKit @usableFromInline static let rect: JSString = "rect" @usableFromInline static let redirect: JSString = "redirect" @usableFromInline static let redirected: JSString = "redirected" - @usableFromInline static let refX: JSString = "refX" - @usableFromInline static let refY: JSString = "refY" @usableFromInline static let referenceNode: JSString = "referenceNode" @usableFromInline static let referrer: JSString = "referrer" @usableFromInline static let referrerPolicy: JSString = "referrerPolicy" @@ -1425,22 +1160,17 @@ import JavaScriptKit @usableFromInline static let removeAttributeNode: JSString = "removeAttributeNode" @usableFromInline static let removeChild: JSString = "removeChild" @usableFromInline static let removeCue: JSString = "removeCue" - @usableFromInline static let removeItem: JSString = "removeItem" @usableFromInline static let removeNamedItem: JSString = "removeNamedItem" @usableFromInline static let removeNamedItemNS: JSString = "removeNamedItemNS" @usableFromInline static let removeParameter: JSString = "removeParameter" @usableFromInline static let removeProperty: JSString = "removeProperty" @usableFromInline static let removeRule: JSString = "removeRule" - @usableFromInline static let removeSourceBuffer: JSString = "removeSourceBuffer" - @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" @usableFromInline static let replaceData: JSString = "replaceData" - @usableFromInline static let replaceItem: JSString = "replaceItem" @usableFromInline static let replaceState: JSString = "replaceState" @usableFromInline static let replaceSync: JSString = "replaceSync" @usableFromInline static let replaceWith: JSString = "replaceWith" @@ -1448,14 +1178,11 @@ import JavaScriptKit @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 requiredExtensions: JSString = "requiredExtensions" @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" @@ -1469,7 +1196,6 @@ import JavaScriptKit @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" @@ -1478,7 +1204,6 @@ import JavaScriptKit @usableFromInline static let right: JSString = "right" @usableFromInline static let role: JSString = "role" @usableFromInline static let root: JSString = "root" - @usableFromInline static let rootElement: JSString = "rootElement" @usableFromInline static let rotate: JSString = "rotate" @usableFromInline static let rotateAxisAngle: JSString = "rotateAxisAngle" @usableFromInline static let rotateAxisAngleSelf: JSString = "rotateAxisAngleSelf" @@ -1490,13 +1215,8 @@ import JavaScriptKit @usableFromInline static let rowSpan: JSString = "rowSpan" @usableFromInline static let rows: JSString = "rows" @usableFromInline static let rules: JSString = "rules" - @usableFromInline static let rx: JSString = "rx" - @usableFromInline static let ry: JSString = "ry" - @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 scalabilityMode: JSString = "scalabilityMode" @usableFromInline static let scale: JSString = "scale" @usableFromInline static let scale3d: JSString = "scale3d" @usableFromInline static let scale3dSelf: JSString = "scale3dSelf" @@ -1522,11 +1242,9 @@ import JavaScriptKit @usableFromInline static let select: JSString = "select" @usableFromInline static let selectNode: JSString = "selectNode" @usableFromInline static let selectNodeContents: JSString = "selectNodeContents" - @usableFromInline static let selectSubString: JSString = "selectSubString" @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" @@ -1550,28 +1268,19 @@ import JavaScriptKit @usableFromInline static let setInterval: JSString = "setInterval" @usableFromInline static let setKeyframes: JSString = "setKeyframes" @usableFromInline static let setLineDash: JSString = "setLineDash" - @usableFromInline static let setLiveSeekableRange: JSString = "setLiveSeekableRange" - @usableFromInline static let setMatrix: JSString = "setMatrix" @usableFromInline static let setMatrixValue: JSString = "setMatrixValue" @usableFromInline static let setNamedItem: JSString = "setNamedItem" @usableFromInline static let setNamedItemNS: JSString = "setNamedItemNS" - @usableFromInline static let setOrientToAngle: JSString = "setOrientToAngle" - @usableFromInline static let setOrientToAuto: JSString = "setOrientToAuto" @usableFromInline static let setParameter: JSString = "setParameter" @usableFromInline static let setProperty: JSString = "setProperty" @usableFromInline static let setRangeText: JSString = "setRangeText" @usableFromInline static let setRequestHeader: JSString = "setRequestHeader" - @usableFromInline static let setRotate: JSString = "setRotate" - @usableFromInline static let setScale: JSString = "setScale" @usableFromInline static let setSelectionRange: JSString = "setSelectionRange" - @usableFromInline static let setSkewX: JSString = "setSkewX" - @usableFromInline static let setSkewY: JSString = "setSkewY" @usableFromInline static let setStart: JSString = "setStart" @usableFromInline static let setStartAfter: JSString = "setStartAfter" @usableFromInline static let setStartBefore: JSString = "setStartBefore" @usableFromInline static let setTimeout: JSString = "setTimeout" @usableFromInline static let setTransform: JSString = "setTransform" - @usableFromInline static let setTranslate: JSString = "setTranslate" @usableFromInline static let setValidity: JSString = "setValidity" @usableFromInline static let shadowBlur: JSString = "shadowBlur" @usableFromInline static let shadowColor: JSString = "shadowColor" @@ -1599,18 +1308,12 @@ import JavaScriptKit @usableFromInline static let snapshotLength: JSString = "snapshotLength" @usableFromInline static let sort: JSString = "sort" @usableFromInline static let source: JSString = "source" - @usableFromInline static let sourceAnimation: JSString = "sourceAnimation" - @usableFromInline static let sourceBuffer: JSString = "sourceBuffer" - @usableFromInline static let sourceBuffers: JSString = "sourceBuffers" - @usableFromInline static let spacing: JSString = "spacing" @usableFromInline static let span: JSString = "span" @usableFromInline static let specified: JSString = "specified" @usableFromInline static let spellcheck: JSString = "spellcheck" @usableFromInline static let splitText: JSString = "splitText" - @usableFromInline static let spreadMethod: JSString = "spreadMethod" @usableFromInline static let src: JSString = "src" @usableFromInline static let srcElement: JSString = "srcElement" - @usableFromInline static let srcObject: JSString = "srcObject" @usableFromInline static let srcdoc: JSString = "srcdoc" @usableFromInline static let srclang: JSString = "srclang" @usableFromInline static let srcset: JSString = "srcset" @@ -1633,7 +1336,6 @@ import JavaScriptKit @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" @@ -1649,13 +1351,9 @@ import JavaScriptKit @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 suspendRedraw: JSString = "suspendRedraw" - @usableFromInline static let svc: JSString = "svc" @usableFromInline static let systemId: JSString = "systemId" - @usableFromInline static let systemLanguage: JSString = "systemLanguage" @usableFromInline static let tBodies: JSString = "tBodies" @usableFromInline static let tFoot: JSString = "tFoot" @usableFromInline static let tHead: JSString = "tHead" @@ -1666,7 +1364,6 @@ import JavaScriptKit @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" @@ -1678,11 +1375,8 @@ import JavaScriptKit @usableFromInline static let throwIfAborted: JSString = "throwIfAborted" @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 timestamp: JSString = "timestamp" - @usableFromInline static let timestampOffset: JSString = "timestampOffset" @usableFromInline static let title: JSString = "title" @usableFromInline static let toDataURL: JSString = "toDataURL" @usableFromInline static let toFloat32Array: JSString = "toFloat32Array" @@ -1697,7 +1391,6 @@ import JavaScriptKit @usableFromInline static let top: JSString = "top" @usableFromInline static let total: JSString = "total" @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" @@ -1712,16 +1405,12 @@ import JavaScriptKit @usableFromInline static let type: JSString = "type" @usableFromInline static let typeMismatch: JSString = "typeMismatch" @usableFromInline static let types: JSString = "types" - @usableFromInline static let unitType: JSString = "unitType" @usableFromInline static let unregister: JSString = "unregister" @usableFromInline static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" - @usableFromInline static let unsuspendRedraw: JSString = "unsuspendRedraw" - @usableFromInline static let unsuspendRedrawAll: JSString = "unsuspendRedrawAll" @usableFromInline static let update: JSString = "update" @usableFromInline static let updatePlaybackRate: JSString = "updatePlaybackRate" @usableFromInline static let updateTiming: JSString = "updateTiming" @usableFromInline static let updateViaCache: JSString = "updateViaCache" - @usableFromInline static let updating: JSString = "updating" @usableFromInline static let upgrade: JSString = "upgrade" @usableFromInline static let upload: JSString = "upload" @usableFromInline static let url: JSString = "url" @@ -1736,24 +1425,17 @@ import JavaScriptKit @usableFromInline static let value: JSString = "value" @usableFromInline static let valueAsDate: JSString = "valueAsDate" @usableFromInline static let valueAsNumber: JSString = "valueAsNumber" - @usableFromInline static let valueAsString: JSString = "valueAsString" - @usableFromInline static let valueInSpecifiedUnits: JSString = "valueInSpecifiedUnits" @usableFromInline static let valueMissing: JSString = "valueMissing" @usableFromInline static let valueType: JSString = "valueType" @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 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 viewBox: JSString = "viewBox" - @usableFromInline static let viewportElement: JSString = "viewportElement" @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" @@ -1776,10 +1458,6 @@ import JavaScriptKit @usableFromInline static let write: JSString = "write" @usableFromInline static let writeln: JSString = "writeln" @usableFromInline static let x: JSString = "x" - @usableFromInline static let x1: JSString = "x1" - @usableFromInline static let x2: JSString = "x2" @usableFromInline static let y: JSString = "y" - @usableFromInline static let y1: JSString = "y1" - @usableFromInline static let y2: JSString = "y2" @usableFromInline static let z: JSString = "z" } 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/TextTrack.swift b/Sources/DOMKit/WebIDL/TextTrack.swift index 79b2f496..4de86043 100644 --- a/Sources/DOMKit/WebIDL/TextTrack.swift +++ b/Sources/DOMKit/WebIDL/TextTrack.swift @@ -16,7 +16,6 @@ public class TextTrack: EventTarget { _cues = ReadonlyAttribute(jsObject: jsObject, name: Strings.cues) _activeCues = ReadonlyAttribute(jsObject: jsObject, name: Strings.activeCues) _oncuechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.oncuechange) - _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) super.init(unsafelyWrapping: jsObject) } @@ -56,7 +55,4 @@ public class TextTrack: EventTarget { @ClosureAttribute1Optional public var oncuechange: EventHandler - - @ReadonlyAttribute - public var sourceBuffer: SourceBuffer? } diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift index b22c422a..f1ae5f59 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -21,8 +21,6 @@ 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 NavigatorUserMediaSuccessCallback = (MediaStream) -> Void -public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void public typealias UnderlyingSourceStartCallback = (ReadableStreamController) -> JSValue public typealias UnderlyingSourcePullCallback = (ReadableStreamController) -> JSPromise public typealias UnderlyingSourceCancelCallback = (JSValue) -> JSPromise @@ -34,9 +32,4 @@ public typealias TransformerStartCallback = (TransformStreamDefaultController) - public typealias TransformerFlushCallback = (TransformStreamDefaultController) -> JSPromise public typealias TransformerTransformCallback = (JSValue, TransformStreamDefaultController) -> JSPromise public typealias QueuingStrategySize = (JSValue) -> Double -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 typealias VoidFunction = () -> Void diff --git a/Sources/DOMKit/WebIDL/ULongRange.swift b/Sources/DOMKit/WebIDL/ULongRange.swift deleted file mode 100644 index cf578d6c..00000000 --- a/Sources/DOMKit/WebIDL/ULongRange.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 -} 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 c6fdfd98..00000000 --- a/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift +++ /dev/null @@ -1,75 +0,0 @@ -// 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 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/VideoFacingModeEnum.swift b/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift deleted file mode 100644 index 9d325b8a..00000000 --- a/Sources/DOMKit/WebIDL/VideoFacingModeEnum.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 } -} 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/VideoResizeModeEnum.swift b/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift deleted file mode 100644 index 78582a71..00000000 --- a/Sources/DOMKit/WebIDL/VideoResizeModeEnum.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -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 } -} diff --git a/Sources/DOMKit/WebIDL/VideoTrack.swift b/Sources/DOMKit/WebIDL/VideoTrack.swift index 6942a46c..5177c9b5 100644 --- a/Sources/DOMKit/WebIDL/VideoTrack.swift +++ b/Sources/DOMKit/WebIDL/VideoTrack.swift @@ -14,7 +14,6 @@ public class VideoTrack: JSBridgedClass { _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) - _sourceBuffer = ReadonlyAttribute(jsObject: jsObject, name: Strings.sourceBuffer) self.jsObject = jsObject } @@ -32,7 +31,4 @@ public class VideoTrack: JSBridgedClass { @ReadWriteAttribute public var selected: Bool - - @ReadonlyAttribute - public var sourceBuffer: SourceBuffer? } 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 } -} diff --git a/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index f08a6a8a..4e8d140c 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -16,13 +16,15 @@ enum IDLBuilder { "Client_or_MessagePort_or_ServiceWorker", "ExtendableMessageEventInit", // redundant unions "CSSColorValue_or_CSSStyleValue", + // need types from specs not yet included + "ShadowAnimation", "MediaProvider", "Blob_or_MediaSource", + "OffscreenRenderingContext", "RenderingContext", "CanvasImageSource", + "HTMLOrSVGImageElement", "HTMLOrSVGScriptElement", // implemented manually // ArrayBufferView "BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray", // RotationMatrixType "DOMMatrix_or_Float32Array_or_Float64Array", - "OffscreenRenderingContext", - "RenderingContext", ] static let outDir = "Sources/DOMKit/WebIDL/" @@ -103,6 +105,8 @@ enum IDLBuilder { "AudioBufferSourceNode": ["start"], // XPathNSResolver "XPathEvaluatorBase": ["createExpression", "createNSResolver", "evaluate"], + // disabled pending addition of more specs + "HTMLMediaElement": ["srcObject"], ], types: merged.types )) { diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js index 0c2096d3..4c49c4fe 100644 --- a/parse-idl/parse-all.js +++ b/parse-idl/parse-all.js @@ -4,4 +4,27 @@ import fs from "node:fs/promises"; const parsedFiles = await parseAll(); // console.log(Object.keys(parsedFiles).join('\n')) // console.log(JSON.stringify(Object.values(parsedFiles), null, 2)); -console.log(JSON.stringify(['cssom', 'css-pseudo', 'dom', 'fetch', 'FileAPI', 'html', 'geometry', 'hr-time', 'media-source', 'mediacapture-streams', 'mediastream-recording', 'referrer-policy', 'streams', 'SVG', 'uievents', 'wai-aria', 'webcodecs', 'webidl', 'web-animations', 'xhr', 'service-workers', 'url'].map(key => parsedFiles[key]), null, 2)); +console.log( + JSON.stringify( + [ + "cssom", + "dom", + "fetch", + "FileAPI", + "html", + "geometry", + "hr-time", + "referrer-policy", + "streams", + "uievents", + "wai-aria", + "webidl", + "web-animations", + "xhr", + "service-workers", + "url", + ].map((key) => parsedFiles[key]), + null, + 2 + ) +); From 8392de9a44ec1e71cf0a175c1dca57d34fddb4cb Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Fri, 22 Apr 2022 21:17:17 -0400 Subject: [PATCH 121/124] cut more --- Sources/DOMKit/WebIDL/Blob.swift | 5 +- Sources/DOMKit/WebIDL/Body.swift | 2 +- Sources/DOMKit/WebIDL/BodyInit.swift | 46 ------- .../WebIDL/ByteLengthQueuingStrategy.swift | 26 ---- Sources/DOMKit/WebIDL/CSS.swift | 15 -- Sources/DOMKit/WebIDL/CSSGroupingRule.swift | 26 ---- Sources/DOMKit/WebIDL/CSSImportRule.swift | 24 ---- Sources/DOMKit/WebIDL/CSSMarginRule.swift | 20 --- Sources/DOMKit/WebIDL/CSSNamespaceRule.swift | 20 --- Sources/DOMKit/WebIDL/CSSPageRule.swift | 20 --- Sources/DOMKit/WebIDL/CSSRule.swift | 46 ------- Sources/DOMKit/WebIDL/CSSRuleList.swift | 22 --- .../DOMKit/WebIDL/CSSStyleDeclaration.swift | 54 -------- Sources/DOMKit/WebIDL/CSSStyleRule.swift | 20 --- Sources/DOMKit/WebIDL/CSSStyleSheet.swift | 65 --------- Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift | 30 ---- Sources/DOMKit/WebIDL/ClosureAttribute.swift | 128 ------------------ .../DOMKit/WebIDL/CountQueuingStrategy.swift | 26 ---- .../DOMKit/WebIDL/DocumentOrShadowRoot.swift | 7 - .../DOMKit/WebIDL/ElementCSSInlineStyle.swift | 9 -- .../Element_or_ProcessingInstruction.swift | 46 ------- .../WebIDL/GenericTransformStream.swift | 11 -- Sources/DOMKit/WebIDL/HTMLElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLLinkElement.swift | 2 +- Sources/DOMKit/WebIDL/HTMLStyleElement.swift | 2 +- Sources/DOMKit/WebIDL/LinkStyle.swift | 9 -- Sources/DOMKit/WebIDL/MediaList.swift | 36 ----- .../DOMKit/WebIDL/MediaList_or_String.swift | 46 ------- .../DOMKit/WebIDL/ProcessingInstruction.swift | 2 +- Sources/DOMKit/WebIDL/QueuingStrategy.swift | 25 ---- .../DOMKit/WebIDL/QueuingStrategyInit.swift | 20 --- .../WebIDL/ReadableByteStreamController.swift | 37 ----- Sources/DOMKit/WebIDL/ReadableStream.swift | 67 --------- .../WebIDL/ReadableStreamBYOBReadResult.swift | 25 ---- .../WebIDL/ReadableStreamBYOBReader.swift | 35 ----- .../WebIDL/ReadableStreamBYOBRequest.swift | 28 ---- .../WebIDL/ReadableStreamController.swift | 46 ------- .../ReadableStreamDefaultController.swift | 33 ----- .../ReadableStreamDefaultReadResult.swift | 25 ---- .../WebIDL/ReadableStreamDefaultReader.swift | 35 ----- .../WebIDL/ReadableStreamGenericReader.swift | 21 --- .../ReadableStreamGetReaderOptions.swift | 20 --- .../ReadableStreamIteratorOptions.swift | 20 --- .../DOMKit/WebIDL/ReadableStreamReader.swift | 46 ------- .../WebIDL/ReadableStreamReaderMode.swift | 21 --- .../DOMKit/WebIDL/ReadableStreamType.swift | 21 --- .../DOMKit/WebIDL/ReadableWritablePair.swift | 25 ---- Sources/DOMKit/WebIDL/StreamPipeOptions.swift | 35 ----- Sources/DOMKit/WebIDL/Strings.swift | 81 ----------- Sources/DOMKit/WebIDL/StyleSheet.swift | 42 ------ Sources/DOMKit/WebIDL/StyleSheetList.swift | 22 --- Sources/DOMKit/WebIDL/TransformStream.swift | 26 ---- .../TransformStreamDefaultController.swift | 33 ----- Sources/DOMKit/WebIDL/Transformer.swift | 40 ------ Sources/DOMKit/WebIDL/Typedefs.swift | 11 -- Sources/DOMKit/WebIDL/UnderlyingSink.swift | 40 ------ Sources/DOMKit/WebIDL/UnderlyingSource.swift | 40 ------ Sources/DOMKit/WebIDL/Window.swift | 5 - Sources/DOMKit/WebIDL/WritableStream.swift | 51 ------- .../WritableStreamDefaultController.swift | 23 ---- .../WebIDL/WritableStreamDefaultWriter.swift | 71 ---------- Sources/WebIDLToSwift/IDLBuilder.swift | 4 +- Sources/WebIDLToSwift/MergeDeclarations.swift | 33 ++++- .../WebIDL+SwiftRepresentation.swift | 5 + parse-idl/parse-all.js | 2 - 65 files changed, 44 insertions(+), 1837 deletions(-) delete mode 100644 Sources/DOMKit/WebIDL/BodyInit.swift delete mode 100644 Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift delete mode 100644 Sources/DOMKit/WebIDL/CSS.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSGroupingRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSImportRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSMarginRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSNamespaceRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSPageRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSRuleList.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSStyleRule.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSStyleSheet.swift delete mode 100644 Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift delete mode 100644 Sources/DOMKit/WebIDL/CountQueuingStrategy.swift delete mode 100644 Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift delete mode 100644 Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift delete mode 100644 Sources/DOMKit/WebIDL/GenericTransformStream.swift delete mode 100644 Sources/DOMKit/WebIDL/LinkStyle.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaList.swift delete mode 100644 Sources/DOMKit/WebIDL/MediaList_or_String.swift delete mode 100644 Sources/DOMKit/WebIDL/QueuingStrategy.swift delete mode 100644 Sources/DOMKit/WebIDL/QueuingStrategyInit.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableByteStreamController.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStream.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamController.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamReader.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableStreamType.swift delete mode 100644 Sources/DOMKit/WebIDL/ReadableWritablePair.swift delete mode 100644 Sources/DOMKit/WebIDL/StreamPipeOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/StyleSheet.swift delete mode 100644 Sources/DOMKit/WebIDL/StyleSheetList.swift delete mode 100644 Sources/DOMKit/WebIDL/TransformStream.swift delete mode 100644 Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift delete mode 100644 Sources/DOMKit/WebIDL/Transformer.swift delete mode 100644 Sources/DOMKit/WebIDL/UnderlyingSink.swift delete mode 100644 Sources/DOMKit/WebIDL/UnderlyingSource.swift delete mode 100644 Sources/DOMKit/WebIDL/WritableStream.swift delete mode 100644 Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift delete mode 100644 Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift diff --git a/Sources/DOMKit/WebIDL/Blob.swift b/Sources/DOMKit/WebIDL/Blob.swift index 8fd4dbcd..c8eb905a 100644 --- a/Sources/DOMKit/WebIDL/Blob.swift +++ b/Sources/DOMKit/WebIDL/Blob.swift @@ -29,10 +29,7 @@ public class Blob: JSBridgedClass { return this[Strings.slice].function!(this: this, arguments: [start?.jsValue ?? .undefined, end?.jsValue ?? .undefined, contentType?.jsValue ?? .undefined]).fromJSValue()! } - @inlinable public func stream() -> ReadableStream { - let this = jsObject - return this[Strings.stream].function!(this: this, arguments: []).fromJSValue()! - } + // XXX: member 'stream' is ignored @inlinable public func text() -> JSPromise { let this = jsObject diff --git a/Sources/DOMKit/WebIDL/Body.swift b/Sources/DOMKit/WebIDL/Body.swift index 758f2fba..687e62b6 100644 --- a/Sources/DOMKit/WebIDL/Body.swift +++ b/Sources/DOMKit/WebIDL/Body.swift @@ -5,7 +5,7 @@ import JavaScriptKit public protocol Body: JSBridgedClass {} public extension Body { - @inlinable var body: ReadableStream? { ReadonlyAttribute[Strings.body, in: jsObject] } + // XXX: attribute 'body' is ignored @inlinable var bodyUsed: Bool { ReadonlyAttribute[Strings.bodyUsed, in: jsObject] } diff --git a/Sources/DOMKit/WebIDL/BodyInit.swift b/Sources/DOMKit/WebIDL/BodyInit.swift deleted file mode 100644 index 3c876844..00000000 --- a/Sources/DOMKit/WebIDL/BodyInit.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_BodyInit: ConvertibleToJSValue {} -extension ReadableStream: Any_BodyInit {} -extension XMLHttpRequestBodyInit: Any_BodyInit {} - -public enum BodyInit: JSValueCompatible, Any_BodyInit { - case readableStream(ReadableStream) - case xmlHttpRequestBodyInit(XMLHttpRequestBodyInit) - - var readableStream: ReadableStream? { - switch self { - case let .readableStream(readableStream): return readableStream - default: return nil - } - } - - var xmlHttpRequestBodyInit: XMLHttpRequestBodyInit? { - switch self { - case let .xmlHttpRequestBodyInit(xmlHttpRequestBodyInit): return xmlHttpRequestBodyInit - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let readableStream: ReadableStream = value.fromJSValue() { - return .readableStream(readableStream) - } - if let xmlHttpRequestBodyInit: XMLHttpRequestBodyInit = value.fromJSValue() { - return .xmlHttpRequestBodyInit(xmlHttpRequestBodyInit) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .readableStream(readableStream): - return readableStream.jsValue - case let .xmlHttpRequestBodyInit(xmlHttpRequestBodyInit): - return xmlHttpRequestBodyInit.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift deleted file mode 100644 index 480f696d..00000000 --- a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift +++ /dev/null @@ -1,26 +0,0 @@ -// 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/CSS.swift b/Sources/DOMKit/WebIDL/CSS.swift deleted file mode 100644 index 2a92a515..00000000 --- a/Sources/DOMKit/WebIDL/CSS.swift +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum CSS { - @inlinable public static var jsObject: JSObject { - JSObject.global[Strings.CSS].object! - } - - @inlinable public static func escape(ident: String) -> String { - let this = JSObject.global[Strings.CSS].object! - return this[Strings.escape].function!(this: this, arguments: [ident.jsValue]).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift b/Sources/DOMKit/WebIDL/CSSGroupingRule.swift deleted file mode 100644 index 6a90100c..00000000 --- a/Sources/DOMKit/WebIDL/CSSGroupingRule.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSGroupingRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSGroupingRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var cssRules: CSSRuleList - - @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - let this = jsObject - return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue, index?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func deleteRule(index: UInt32) { - let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/CSSImportRule.swift b/Sources/DOMKit/WebIDL/CSSImportRule.swift deleted file mode 100644 index 91e427cf..00000000 --- a/Sources/DOMKit/WebIDL/CSSImportRule.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSImportRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSImportRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadonlyAttribute(jsObject: jsObject, name: Strings.href) - _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) - _styleSheet = ReadonlyAttribute(jsObject: jsObject, name: Strings.styleSheet) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var href: String - - @ReadonlyAttribute - public var media: MediaList - - @ReadonlyAttribute - public var styleSheet: CSSStyleSheet -} diff --git a/Sources/DOMKit/WebIDL/CSSMarginRule.swift b/Sources/DOMKit/WebIDL/CSSMarginRule.swift deleted file mode 100644 index d36e5ec7..00000000 --- a/Sources/DOMKit/WebIDL/CSSMarginRule.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSMarginRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSMarginRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var name: String - - @ReadonlyAttribute - public var style: CSSStyleDeclaration -} diff --git a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift b/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift deleted file mode 100644 index 83b63037..00000000 --- a/Sources/DOMKit/WebIDL/CSSNamespaceRule.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSNamespaceRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSNamespaceRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _namespaceURI = ReadonlyAttribute(jsObject: jsObject, name: Strings.namespaceURI) - _prefix = ReadonlyAttribute(jsObject: jsObject, name: Strings.prefix) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var namespaceURI: String - - @ReadonlyAttribute - public var prefix: String -} diff --git a/Sources/DOMKit/WebIDL/CSSPageRule.swift b/Sources/DOMKit/WebIDL/CSSPageRule.swift deleted file mode 100644 index 2755c719..00000000 --- a/Sources/DOMKit/WebIDL/CSSPageRule.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSPageRule: CSSGroupingRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPageRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) - _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var selectorText: String - - @ReadonlyAttribute - public var style: CSSStyleDeclaration -} diff --git a/Sources/DOMKit/WebIDL/CSSRule.swift b/Sources/DOMKit/WebIDL/CSSRule.swift deleted file mode 100644 index 33a1dfd1..00000000 --- a/Sources/DOMKit/WebIDL/CSSRule.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSRule: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSRule].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _cssText = ReadWriteAttribute(jsObject: jsObject, name: Strings.cssText) - _parentRule = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentRule) - _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentStyleSheet) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var cssText: String - - @ReadonlyAttribute - public var parentRule: CSSRule? - - @ReadonlyAttribute - public var parentStyleSheet: CSSStyleSheet? - - @ReadonlyAttribute - public var type: UInt16 - - public static let STYLE_RULE: UInt16 = 1 - - public static let CHARSET_RULE: UInt16 = 2 - - public static let IMPORT_RULE: UInt16 = 3 - - public static let MEDIA_RULE: UInt16 = 4 - - public static let FONT_FACE_RULE: UInt16 = 5 - - public static let PAGE_RULE: UInt16 = 6 - - public static let MARGIN_RULE: UInt16 = 9 - - public static let NAMESPACE_RULE: UInt16 = 10 -} diff --git a/Sources/DOMKit/WebIDL/CSSRuleList.swift b/Sources/DOMKit/WebIDL/CSSRuleList.swift deleted file mode 100644 index bbfcbcb8..00000000 --- a/Sources/DOMKit/WebIDL/CSSRuleList.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSRuleList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSRuleList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - self.jsObject = jsObject - } - - @inlinable public subscript(key: Int) -> CSSRule? { - jsObject[key].fromJSValue() - } - - @ReadonlyAttribute - public var length: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift b/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift deleted file mode 100644 index 94b41299..00000000 --- a/Sources/DOMKit/WebIDL/CSSStyleDeclaration.swift +++ /dev/null @@ -1,54 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSStyleDeclaration: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleDeclaration].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _cssText = ReadWriteAttribute(jsObject: jsObject, name: Strings.cssText) - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _parentRule = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentRule) - _cssFloat = ReadWriteAttribute(jsObject: jsObject, name: Strings.cssFloat) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var cssText: String - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> String { - jsObject[key].fromJSValue()! - } - - @inlinable public func getPropertyValue(property: String) -> String { - let this = jsObject - return this[Strings.getPropertyValue].function!(this: this, arguments: [property.jsValue]).fromJSValue()! - } - - @inlinable public func getPropertyPriority(property: String) -> String { - let this = jsObject - return this[Strings.getPropertyPriority].function!(this: this, arguments: [property.jsValue]).fromJSValue()! - } - - @inlinable public func setProperty(property: String, value: String, priority: String? = nil) { - let this = jsObject - _ = this[Strings.setProperty].function!(this: this, arguments: [property.jsValue, value.jsValue, priority?.jsValue ?? .undefined]) - } - - @inlinable public func removeProperty(property: String) -> String { - let this = jsObject - return this[Strings.removeProperty].function!(this: this, arguments: [property.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var parentRule: CSSRule? - - @ReadWriteAttribute - public var cssFloat: String -} diff --git a/Sources/DOMKit/WebIDL/CSSStyleRule.swift b/Sources/DOMKit/WebIDL/CSSStyleRule.swift deleted file mode 100644 index ad59f9c0..00000000 --- a/Sources/DOMKit/WebIDL/CSSStyleRule.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSStyleRule: CSSRule { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleRule].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _selectorText = ReadWriteAttribute(jsObject: jsObject, name: Strings.selectorText) - _style = ReadonlyAttribute(jsObject: jsObject, name: Strings.style) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var selectorText: String - - @ReadonlyAttribute - public var style: CSSStyleDeclaration -} diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift b/Sources/DOMKit/WebIDL/CSSStyleSheet.swift deleted file mode 100644 index 8a5cad13..00000000 --- a/Sources/DOMKit/WebIDL/CSSStyleSheet.swift +++ /dev/null @@ -1,65 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSStyleSheet: StyleSheet { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSStyleSheet].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _ownerRule = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerRule) - _cssRules = ReadonlyAttribute(jsObject: jsObject, name: Strings.cssRules) - _rules = ReadonlyAttribute(jsObject: jsObject, name: Strings.rules) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(options: CSSStyleSheetInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [options?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var ownerRule: CSSRule? - - @ReadonlyAttribute - public var cssRules: CSSRuleList - - @inlinable public func insertRule(rule: String, index: UInt32? = nil) -> UInt32 { - let this = jsObject - return this[Strings.insertRule].function!(this: this, arguments: [rule.jsValue, index?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func deleteRule(index: UInt32) { - let this = jsObject - _ = this[Strings.deleteRule].function!(this: this, arguments: [index.jsValue]) - } - - @inlinable public func replace(text: String) -> JSPromise { - let this = jsObject - return this[Strings.replace].function!(this: this, arguments: [text.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func replace(text: String) async throws -> CSSStyleSheet { - let this = jsObject - let _promise: JSPromise = this[Strings.replace].function!(this: this, arguments: [text.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func replaceSync(text: String) { - let this = jsObject - _ = this[Strings.replaceSync].function!(this: this, arguments: [text.jsValue]) - } - - @ReadonlyAttribute - public var rules: CSSRuleList - - @inlinable public func addRule(selector: String? = nil, style: String? = nil, index: UInt32? = nil) -> Int32 { - let this = jsObject - return this[Strings.addRule].function!(this: this, arguments: [selector?.jsValue ?? .undefined, style?.jsValue ?? .undefined, index?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func removeRule(index: UInt32? = nil) { - let this = jsObject - _ = this[Strings.removeRule].function!(this: this, arguments: [index?.jsValue ?? .undefined]) - } -} diff --git a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift b/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift deleted file mode 100644 index fa75a1d8..00000000 --- a/Sources/DOMKit/WebIDL/CSSStyleSheetInit.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class CSSStyleSheetInit: BridgedDictionary { - public convenience init(baseURL: String, media: MediaList_or_String, disabled: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.baseURL] = baseURL.jsValue - object[Strings.media] = media.jsValue - object[Strings.disabled] = disabled.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _baseURL = ReadWriteAttribute(jsObject: object, name: Strings.baseURL) - _media = ReadWriteAttribute(jsObject: object, name: Strings.media) - _disabled = ReadWriteAttribute(jsObject: object, name: Strings.disabled) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var baseURL: String - - @ReadWriteAttribute - public var media: MediaList_or_String - - @ReadWriteAttribute - public var disabled: Bool -} diff --git a/Sources/DOMKit/WebIDL/ClosureAttribute.swift b/Sources/DOMKit/WebIDL/ClosureAttribute.swift index 5bb26ecc..82e24bb3 100644 --- a/Sources/DOMKit/WebIDL/ClosureAttribute.swift +++ b/Sources/DOMKit/WebIDL/ClosureAttribute.swift @@ -4,70 +4,6 @@ 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 @@ -260,70 +196,6 @@ 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 deleted file mode 100644 index 5362a092..00000000 --- a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift +++ /dev/null @@ -1,26 +0,0 @@ -// 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/DocumentOrShadowRoot.swift b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift index 97f66e21..2eaba575 100644 --- a/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift +++ b/Sources/DOMKit/WebIDL/DocumentOrShadowRoot.swift @@ -5,13 +5,6 @@ import JavaScriptKit public protocol DocumentOrShadowRoot: JSBridgedClass {} public extension DocumentOrShadowRoot { - @inlinable var styleSheets: StyleSheetList { ReadonlyAttribute[Strings.styleSheets, in: jsObject] } - - @inlinable var adoptedStyleSheets: [CSSStyleSheet] { - get { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.adoptedStyleSheets, in: jsObject] = newValue } - } - @inlinable var activeElement: Element? { ReadonlyAttribute[Strings.activeElement, in: jsObject] } @inlinable func getAnimations() -> [Animation] { diff --git a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift b/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift deleted file mode 100644 index bab4ce71..00000000 --- a/Sources/DOMKit/WebIDL/ElementCSSInlineStyle.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol ElementCSSInlineStyle: JSBridgedClass {} -public extension ElementCSSInlineStyle { - @inlinable var style: CSSStyleDeclaration { ReadonlyAttribute[Strings.style, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift deleted file mode 100644 index 6c9b4e0e..00000000 --- a/Sources/DOMKit/WebIDL/Element_or_ProcessingInstruction.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Element_or_ProcessingInstruction: ConvertibleToJSValue {} -extension Element: Any_Element_or_ProcessingInstruction {} -extension ProcessingInstruction: Any_Element_or_ProcessingInstruction {} - -public enum Element_or_ProcessingInstruction: JSValueCompatible, Any_Element_or_ProcessingInstruction { - case element(Element) - case processingInstruction(ProcessingInstruction) - - var element: Element? { - switch self { - case let .element(element): return element - default: return nil - } - } - - var processingInstruction: ProcessingInstruction? { - switch self { - case let .processingInstruction(processingInstruction): return processingInstruction - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let element: Element = value.fromJSValue() { - return .element(element) - } - if let processingInstruction: ProcessingInstruction = value.fromJSValue() { - return .processingInstruction(processingInstruction) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .element(element): - return element.jsValue - case let .processingInstruction(processingInstruction): - return processingInstruction.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/GenericTransformStream.swift b/Sources/DOMKit/WebIDL/GenericTransformStream.swift deleted file mode 100644 index a5773286..00000000 --- a/Sources/DOMKit/WebIDL/GenericTransformStream.swift +++ /dev/null @@ -1,11 +0,0 @@ -// 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/HTMLElement.swift b/Sources/DOMKit/WebIDL/HTMLElement.swift index fe44ca3d..fd504169 100644 --- a/Sources/DOMKit/WebIDL/HTMLElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLElement.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class HTMLElement: Element, ElementCSSInlineStyle, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement { +public class HTMLElement: Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift index bbc35a39..78cffb76 100644 --- a/Sources/DOMKit/WebIDL/HTMLLinkElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLLinkElement.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class HTMLLinkElement: HTMLElement, LinkStyle { +public class HTMLLinkElement: HTMLElement { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLLinkElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift index 9aa39e44..adabe306 100644 --- a/Sources/DOMKit/WebIDL/HTMLStyleElement.swift +++ b/Sources/DOMKit/WebIDL/HTMLStyleElement.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class HTMLStyleElement: HTMLElement, LinkStyle { +public class HTMLStyleElement: HTMLElement { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HTMLStyleElement].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/LinkStyle.swift b/Sources/DOMKit/WebIDL/LinkStyle.swift deleted file mode 100644 index 962c0bcc..00000000 --- a/Sources/DOMKit/WebIDL/LinkStyle.swift +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol LinkStyle: JSBridgedClass {} -public extension LinkStyle { - @inlinable var sheet: CSSStyleSheet? { ReadonlyAttribute[Strings.sheet, in: jsObject] } -} diff --git a/Sources/DOMKit/WebIDL/MediaList.swift b/Sources/DOMKit/WebIDL/MediaList.swift deleted file mode 100644 index 1bd2b789..00000000 --- a/Sources/DOMKit/WebIDL/MediaList.swift +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class MediaList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _mediaText = ReadWriteAttribute(jsObject: jsObject, name: Strings.mediaText) - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - self.jsObject = jsObject - } - - @ReadWriteAttribute - public var mediaText: String - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> String? { - jsObject[key].fromJSValue() - } - - @inlinable public func appendMedium(medium: String) { - let this = jsObject - _ = this[Strings.appendMedium].function!(this: this, arguments: [medium.jsValue]) - } - - @inlinable public func deleteMedium(medium: String) { - let this = jsObject - _ = this[Strings.deleteMedium].function!(this: this, arguments: [medium.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/MediaList_or_String.swift b/Sources/DOMKit/WebIDL/MediaList_or_String.swift deleted file mode 100644 index 1cdfebe4..00000000 --- a/Sources/DOMKit/WebIDL/MediaList_or_String.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_MediaList_or_String: ConvertibleToJSValue {} -extension MediaList: Any_MediaList_or_String {} -extension String: Any_MediaList_or_String {} - -public enum MediaList_or_String: JSValueCompatible, Any_MediaList_or_String { - case mediaList(MediaList) - case string(String) - - var mediaList: MediaList? { - switch self { - case let .mediaList(mediaList): return mediaList - default: return nil - } - } - - var string: String? { - switch self { - case let .string(string): return string - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let mediaList: MediaList = value.fromJSValue() { - return .mediaList(mediaList) - } - if let string: String = value.fromJSValue() { - return .string(string) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .mediaList(mediaList): - return mediaList.jsValue - case let .string(string): - return string.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift index bd59094c..15913be1 100644 --- a/Sources/DOMKit/WebIDL/ProcessingInstruction.swift +++ b/Sources/DOMKit/WebIDL/ProcessingInstruction.swift @@ -3,7 +3,7 @@ import JavaScriptEventLoop import JavaScriptKit -public class ProcessingInstruction: CharacterData, LinkStyle { +public class ProcessingInstruction: CharacterData { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ProcessingInstruction].function! } public required init(unsafelyWrapping jsObject: JSObject) { diff --git a/Sources/DOMKit/WebIDL/QueuingStrategy.swift b/Sources/DOMKit/WebIDL/QueuingStrategy.swift deleted file mode 100644 index 03b8b2e9..00000000 --- a/Sources/DOMKit/WebIDL/QueuingStrategy.swift +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 2a51a702..00000000 --- a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// 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 deleted file mode 100644 index 81277212..00000000 --- a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift +++ /dev/null @@ -1,37 +0,0 @@ -// 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 deleted file mode 100644 index c14936b2..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStream.swift +++ /dev/null @@ -1,67 +0,0 @@ -// 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 deleted file mode 100644 index 63ef6097..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 588d7eb2..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift +++ /dev/null @@ -1,35 +0,0 @@ -// 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 deleted file mode 100644 index 9a1d23f6..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift +++ /dev/null @@ -1,28 +0,0 @@ -// 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 deleted file mode 100644 index 35f64ee7..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamController.swift +++ /dev/null @@ -1,46 +0,0 @@ -// 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 deleted file mode 100644 index 0b2c0f9d..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift +++ /dev/null @@ -1,33 +0,0 @@ -// 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 deleted file mode 100644 index ea49a802..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index b4116c98..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift +++ /dev/null @@ -1,35 +0,0 @@ -// 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 deleted file mode 100644 index d3206c23..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift +++ /dev/null @@ -1,21 +0,0 @@ -// 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 deleted file mode 100644 index 82edb7bc..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// 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 deleted file mode 100644 index 4ba41ccb..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// 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 deleted file mode 100644 index 03543e03..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamReader.swift +++ /dev/null @@ -1,46 +0,0 @@ -// 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 deleted file mode 100644 index 2e2b80e3..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift +++ /dev/null @@ -1,21 +0,0 @@ -// 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 deleted file mode 100644 index a2c88e92..00000000 --- a/Sources/DOMKit/WebIDL/ReadableStreamType.swift +++ /dev/null @@ -1,21 +0,0 @@ -// 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 deleted file mode 100644 index fb2fb13b..00000000 --- a/Sources/DOMKit/WebIDL/ReadableWritablePair.swift +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 5ef69c77..00000000 --- a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// 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 9aeb34a1..0318a71e 100644 --- a/Sources/DOMKit/WebIDL/Strings.swift +++ b/Sources/DOMKit/WebIDL/Strings.swift @@ -19,19 +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 CSS: JSString = "CSS" - @usableFromInline static let CSSGroupingRule: JSString = "CSSGroupingRule" - @usableFromInline static let CSSImportRule: JSString = "CSSImportRule" - @usableFromInline static let CSSMarginRule: JSString = "CSSMarginRule" - @usableFromInline static let CSSNamespaceRule: JSString = "CSSNamespaceRule" - @usableFromInline static let CSSPageRule: JSString = "CSSPageRule" - @usableFromInline static let CSSRule: JSString = "CSSRule" - @usableFromInline static let CSSRuleList: JSString = "CSSRuleList" - @usableFromInline static let CSSStyleDeclaration: JSString = "CSSStyleDeclaration" - @usableFromInline static let CSSStyleRule: JSString = "CSSStyleRule" - @usableFromInline static let CSSStyleSheet: JSString = "CSSStyleSheet" @usableFromInline static let Cache: JSString = "Cache" @usableFromInline static let CacheStorage: JSString = "CacheStorage" @usableFromInline static let CanvasFilter: JSString = "CanvasFilter" @@ -41,7 +29,6 @@ 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" @@ -166,7 +153,6 @@ import JavaScriptKit @usableFromInline static let KeyframeEffect: JSString = "KeyframeEffect" @usableFromInline static let Location: JSString = "Location" @usableFromInline static let MediaError: JSString = "MediaError" - @usableFromInline static let MediaList: JSString = "MediaList" @usableFromInline static let MessageChannel: JSString = "MessageChannel" @usableFromInline static let MessageEvent: JSString = "MessageEvent" @usableFromInline static let MessagePort: JSString = "MessagePort" @@ -196,12 +182,6 @@ 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" @@ -212,8 +192,6 @@ import JavaScriptKit @usableFromInline static let StaticRange: JSString = "StaticRange" @usableFromInline static let Storage: JSString = "Storage" @usableFromInline static let StorageEvent: JSString = "StorageEvent" - @usableFromInline static let StyleSheet: JSString = "StyleSheet" - @usableFromInline static let StyleSheetList: JSString = "StyleSheetList" @usableFromInline static let SubmitEvent: JSString = "SubmitEvent" @usableFromInline static let Text: JSString = "Text" @usableFromInline static let TextMetrics: JSString = "TextMetrics" @@ -223,8 +201,6 @@ 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" @@ -236,9 +212,6 @@ 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" @@ -270,11 +243,9 @@ import JavaScriptKit @usableFromInline static let addCue: JSString = "addCue" @usableFromInline static let addModule: JSString = "addModule" @usableFromInline static let addPath: JSString = "addPath" - @usableFromInline static let addRule: JSString = "addRule" @usableFromInline static let addTextTrack: JSString = "addTextTrack" @usableFromInline static let addedNodes: JSString = "addedNodes" @usableFromInline static let adoptNode: JSString = "adoptNode" - @usableFromInline static let adoptedStyleSheets: JSString = "adoptedStyleSheets" @usableFromInline static let after: JSString = "after" @usableFromInline static let alert: JSString = "alert" @usableFromInline static let align: JSString = "align" @@ -295,7 +266,6 @@ import JavaScriptKit @usableFromInline static let append: JSString = "append" @usableFromInline static let appendChild: JSString = "appendChild" @usableFromInline static let appendData: JSString = "appendData" - @usableFromInline static let appendMedium: JSString = "appendMedium" @usableFromInline static let applets: JSString = "applets" @usableFromInline static let arc: JSString = "arc" @usableFromInline static let arcTo: JSString = "arcTo" @@ -359,7 +329,6 @@ 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" @@ -370,7 +339,6 @@ import JavaScriptKit @usableFromInline static let background: JSString = "background" @usableFromInline static let badInput: JSString = "badInput" @usableFromInline static let baseURI: JSString = "baseURI" - @usableFromInline static let baseURL: JSString = "baseURL" @usableFromInline static let before: JSString = "before" @usableFromInline static let beginPath: JSString = "beginPath" @usableFromInline static let behavior: JSString = "behavior" @@ -389,7 +357,6 @@ 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" @@ -509,9 +476,6 @@ import JavaScriptKit @usableFromInline static let credentials: JSString = "credentials" @usableFromInline static let crossOrigin: JSString = "crossOrigin" @usableFromInline static let crossOriginIsolated: JSString = "crossOriginIsolated" - @usableFromInline static let cssFloat: JSString = "cssFloat" - @usableFromInline static let cssRules: JSString = "cssRules" - @usableFromInline static let cssText: JSString = "cssText" @usableFromInline static let ctrlKey: JSString = "ctrlKey" @usableFromInline static let cues: JSString = "cues" @usableFromInline static let currentIteration: JSString = "currentIteration" @@ -547,9 +511,7 @@ import JavaScriptKit @usableFromInline static let deleteCell: JSString = "deleteCell" @usableFromInline static let deleteContents: JSString = "deleteContents" @usableFromInline static let deleteData: JSString = "deleteData" - @usableFromInline static let deleteMedium: JSString = "deleteMedium" @usableFromInline static let deleteRow: JSString = "deleteRow" - @usableFromInline static let deleteRule: JSString = "deleteRule" @usableFromInline static let deleteTFoot: JSString = "deleteTFoot" @usableFromInline static let deleteTHead: JSString = "deleteTHead" @usableFromInline static let deltaMode: JSString = "deltaMode" @@ -558,7 +520,6 @@ 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" @@ -575,7 +536,6 @@ 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" @@ -603,10 +563,8 @@ 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 escape: JSString = "escape" @usableFromInline static let evaluate: JSString = "evaluate" @usableFromInline static let event: JSString = "event" @usableFromInline static let eventPhase: JSString = "eventPhase" @@ -633,7 +591,6 @@ 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" @@ -671,7 +628,6 @@ import JavaScriptKit @usableFromInline static let getAttributeNode: JSString = "getAttributeNode" @usableFromInline static let getAttributeNodeNS: JSString = "getAttributeNodeNS" @usableFromInline static let getBounds: JSString = "getBounds" - @usableFromInline static let getComputedStyle: JSString = "getComputedStyle" @usableFromInline static let getComputedTiming: JSString = "getComputedTiming" @usableFromInline static let getContext: JSString = "getContext" @usableFromInline static let getContextAttributes: JSString = "getContextAttributes" @@ -688,9 +644,6 @@ import JavaScriptKit @usableFromInline static let getModifierState: JSString = "getModifierState" @usableFromInline static let getNamedItemNS: JSString = "getNamedItemNS" @usableFromInline static let getParameter: JSString = "getParameter" - @usableFromInline static let getPropertyPriority: JSString = "getPropertyPriority" - @usableFromInline static let getPropertyValue: JSString = "getPropertyValue" - @usableFromInline static let getReader: JSString = "getReader" @usableFromInline static let getRegistration: JSString = "getRegistration" @usableFromInline static let getRegistrations: JSString = "getRegistrations" @usableFromInline static let getResponseHeader: JSString = "getResponseHeader" @@ -701,7 +654,6 @@ 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" @@ -722,7 +674,6 @@ 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" @@ -770,7 +721,6 @@ import JavaScriptKit @usableFromInline static let insertData: JSString = "insertData" @usableFromInline static let insertNode: JSString = "insertNode" @usableFromInline static let insertRow: JSString = "insertRow" - @usableFromInline static let insertRule: JSString = "insertRule" @usableFromInline static let installing: JSString = "installing" @usableFromInline static let integrity: JSString = "integrity" @usableFromInline static let intersectsNode: JSString = "intersectsNode" @@ -837,7 +787,6 @@ 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" @@ -870,7 +819,6 @@ import JavaScriptKit @usableFromInline static let maxLength: JSString = "maxLength" @usableFromInline static let measureText: JSString = "measureText" @usableFromInline static let media: JSString = "media" - @usableFromInline static let mediaText: JSString = "mediaText" @usableFromInline static let menubar: JSString = "menubar" @usableFromInline static let message: JSString = "message" @usableFromInline static let metaKey: JSString = "metaKey" @@ -1041,8 +989,6 @@ import JavaScriptKit @usableFromInline static let overrideMimeType: JSString = "overrideMimeType" @usableFromInline static let ownerDocument: JSString = "ownerDocument" @usableFromInline static let ownerElement: JSString = "ownerElement" - @usableFromInline static let ownerNode: JSString = "ownerNode" - @usableFromInline static let ownerRule: JSString = "ownerRule" @usableFromInline static let p1: JSString = "p1" @usableFromInline static let p2: JSString = "p2" @usableFromInline static let p3: JSString = "p3" @@ -1050,8 +996,6 @@ import JavaScriptKit @usableFromInline static let parent: JSString = "parent" @usableFromInline static let parentElement: JSString = "parentElement" @usableFromInline static let parentNode: JSString = "parentNode" - @usableFromInline static let parentRule: JSString = "parentRule" - @usableFromInline static let parentStyleSheet: JSString = "parentStyleSheet" @usableFromInline static let parseFromString: JSString = "parseFromString" @usableFromInline static let passive: JSString = "passive" @usableFromInline static let password: JSString = "password" @@ -1069,8 +1013,6 @@ 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" @@ -1095,9 +1037,6 @@ 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" @@ -1112,7 +1051,6 @@ 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" @@ -1127,14 +1065,11 @@ 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" @@ -1152,7 +1087,6 @@ 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" @@ -1163,8 +1097,6 @@ import JavaScriptKit @usableFromInline static let removeNamedItem: JSString = "removeNamedItem" @usableFromInline static let removeNamedItemNS: JSString = "removeNamedItemNS" @usableFromInline static let removeParameter: JSString = "removeParameter" - @usableFromInline static let removeProperty: JSString = "removeProperty" - @usableFromInline static let removeRule: JSString = "removeRule" @usableFromInline static let removedNodes: JSString = "removedNodes" @usableFromInline static let `repeat`: JSString = "repeat" @usableFromInline static let replace: JSString = "replace" @@ -1172,7 +1104,6 @@ import JavaScriptKit @usableFromInline static let replaceChildren: JSString = "replaceChildren" @usableFromInline static let replaceData: JSString = "replaceData" @usableFromInline static let replaceState: JSString = "replaceState" - @usableFromInline static let replaceSync: JSString = "replaceSync" @usableFromInline static let replaceWith: JSString = "replaceWith" @usableFromInline static let replacesClientId: JSString = "replacesClientId" @usableFromInline static let reportError: JSString = "reportError" @@ -1185,8 +1116,6 @@ 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" @@ -1248,7 +1177,6 @@ import JavaScriptKit @usableFromInline static let selectionDirection: JSString = "selectionDirection" @usableFromInline static let selectionEnd: JSString = "selectionEnd" @usableFromInline static let selectionStart: JSString = "selectionStart" - @usableFromInline static let selectorText: JSString = "selectorText" @usableFromInline static let send: JSString = "send" @usableFromInline static let serviceWorker: JSString = "serviceWorker" @usableFromInline static let sessionStorage: JSString = "sessionStorage" @@ -1272,7 +1200,6 @@ import JavaScriptKit @usableFromInline static let setNamedItem: JSString = "setNamedItem" @usableFromInline static let setNamedItemNS: JSString = "setNamedItemNS" @usableFromInline static let setParameter: JSString = "setParameter" - @usableFromInline static let setProperty: JSString = "setProperty" @usableFromInline static let setRangeText: JSString = "setRangeText" @usableFromInline static let setRequestHeader: JSString = "setRequestHeader" @usableFromInline static let setSelectionRange: JSString = "setSelectionRange" @@ -1288,7 +1215,6 @@ import JavaScriptKit @usableFromInline static let shadowOffsetY: JSString = "shadowOffsetY" @usableFromInline static let shadowRoot: JSString = "shadowRoot" @usableFromInline static let shape: JSString = "shape" - @usableFromInline static let sheet: JSString = "sheet" @usableFromInline static let shiftKey: JSString = "shiftKey" @usableFromInline static let show: JSString = "show" @usableFromInline static let showModal: JSString = "showModal" @@ -1335,16 +1261,12 @@ import JavaScriptKit @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" @usableFromInline static let strokeStyle: JSString = "strokeStyle" @usableFromInline static let strokeText: JSString = "strokeText" @usableFromInline static let structuredClone: JSString = "structuredClone" - @usableFromInline static let style: JSString = "style" - @usableFromInline static let styleSheet: JSString = "styleSheet" - @usableFromInline static let styleSheets: JSString = "styleSheets" @usableFromInline static let submit: JSString = "submit" @usableFromInline static let submitter: JSString = "submitter" @usableFromInline static let substringData: JSString = "substringData" @@ -1363,7 +1285,6 @@ 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" @@ -1453,8 +1374,6 @@ 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/StyleSheet.swift b/Sources/DOMKit/WebIDL/StyleSheet.swift deleted file mode 100644 index f8c4a456..00000000 --- a/Sources/DOMKit/WebIDL/StyleSheet.swift +++ /dev/null @@ -1,42 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class StyleSheet: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.StyleSheet].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _href = ReadonlyAttribute(jsObject: jsObject, name: Strings.href) - _ownerNode = ReadonlyAttribute(jsObject: jsObject, name: Strings.ownerNode) - _parentStyleSheet = ReadonlyAttribute(jsObject: jsObject, name: Strings.parentStyleSheet) - _title = ReadonlyAttribute(jsObject: jsObject, name: Strings.title) - _media = ReadonlyAttribute(jsObject: jsObject, name: Strings.media) - _disabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.disabled) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var type: String - - @ReadonlyAttribute - public var href: String? - - @ReadonlyAttribute - public var ownerNode: Element_or_ProcessingInstruction? - - @ReadonlyAttribute - public var parentStyleSheet: CSSStyleSheet? - - @ReadonlyAttribute - public var title: String? - - @ReadonlyAttribute - public var media: MediaList - - @ReadWriteAttribute - public var disabled: Bool -} diff --git a/Sources/DOMKit/WebIDL/StyleSheetList.swift b/Sources/DOMKit/WebIDL/StyleSheetList.swift deleted file mode 100644 index 6adfa0eb..00000000 --- a/Sources/DOMKit/WebIDL/StyleSheetList.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class StyleSheetList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.StyleSheetList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - self.jsObject = jsObject - } - - @inlinable public subscript(key: Int) -> CSSStyleSheet? { - jsObject[key].fromJSValue() - } - - @ReadonlyAttribute - public var length: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/TransformStream.swift b/Sources/DOMKit/WebIDL/TransformStream.swift deleted file mode 100644 index 8c846726..00000000 --- a/Sources/DOMKit/WebIDL/TransformStream.swift +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index eb2e5927..00000000 --- a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift +++ /dev/null @@ -1,33 +0,0 @@ -// 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 deleted file mode 100644 index d1a8bce6..00000000 --- a/Sources/DOMKit/WebIDL/Transformer.swift +++ /dev/null @@ -1,40 +0,0 @@ -// 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 f1ae5f59..a44e06f7 100644 --- a/Sources/DOMKit/WebIDL/Typedefs.swift +++ b/Sources/DOMKit/WebIDL/Typedefs.swift @@ -21,15 +21,4 @@ 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 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 VoidFunction = () -> Void diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift deleted file mode 100644 index e4f52ec2..00000000 --- a/Sources/DOMKit/WebIDL/UnderlyingSink.swift +++ /dev/null @@ -1,40 +0,0 @@ -// 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 deleted file mode 100644 index 65db6d2f..00000000 --- a/Sources/DOMKit/WebIDL/UnderlyingSource.swift +++ /dev/null @@ -1,40 +0,0 @@ -// 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/Window.swift b/Sources/DOMKit/WebIDL/Window.swift index 30d5e273..1588fbb8 100644 --- a/Sources/DOMKit/WebIDL/Window.swift +++ b/Sources/DOMKit/WebIDL/Window.swift @@ -36,11 +36,6 @@ public class Window: EventTarget, GlobalEventHandlers, WindowEventHandlers, Wind super.init(unsafelyWrapping: jsObject) } - @inlinable public func getComputedStyle(elt: Element, pseudoElt: String? = nil) -> CSSStyleDeclaration { - let this = jsObject - return this[Strings.getComputedStyle].function!(this: this, arguments: [elt.jsValue, pseudoElt?.jsValue ?? .undefined]).fromJSValue()! - } - @ReadonlyAttribute public var event: Event? diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift deleted file mode 100644 index 779b06d5..00000000 --- a/Sources/DOMKit/WebIDL/WritableStream.swift +++ /dev/null @@ -1,51 +0,0 @@ -// 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 deleted file mode 100644 index b6ab0100..00000000 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift +++ /dev/null @@ -1,23 +0,0 @@ -// 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 deleted file mode 100644 index bd266356..00000000 --- a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift +++ /dev/null @@ -1,71 +0,0 @@ -// 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/Sources/WebIDLToSwift/IDLBuilder.swift b/Sources/WebIDLToSwift/IDLBuilder.swift index 4e8d140c..cfbf229a 100644 --- a/Sources/WebIDLToSwift/IDLBuilder.swift +++ b/Sources/WebIDLToSwift/IDLBuilder.swift @@ -19,7 +19,7 @@ enum IDLBuilder { // need types from specs not yet included "ShadowAnimation", "MediaProvider", "Blob_or_MediaSource", "OffscreenRenderingContext", "RenderingContext", "CanvasImageSource", - "HTMLOrSVGImageElement", "HTMLOrSVGScriptElement", + "HTMLOrSVGImageElement", "HTMLOrSVGScriptElement", "BodyInit", // implemented manually // ArrayBufferView "BigInt64Array_or_BigUint64Array_or_DataView_or_Float32Array_or_Float64Array_or_Int16Array_or_Int32Array_or_Int8Array_or_Uint16Array_or_Uint32Array_or_Uint8Array_or_Uint8ClampedArray", @@ -107,6 +107,8 @@ enum IDLBuilder { "XPathEvaluatorBase": ["createExpression", "createNSResolver", "evaluate"], // disabled pending addition of more specs "HTMLMediaElement": ["srcObject"], + "Blob": ["stream"], + "Body": ["body"], ], types: merged.types )) { diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index a5fb2d5c..a58e249b 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -10,6 +10,8 @@ enum DeclarationMerger { ] static let validExposures: Set = ["Window"] + static let ignoredParents: Set = ["LinkStyle"] + private static func addAsync(_ members: [IDLNode]) -> [IDLNode] { members.flatMap { member -> [IDLNode] in if let operation = member as? IDLOperation, @@ -65,13 +67,15 @@ enum DeclarationMerger { } let includes = Dictionary(grouping: all(IDLIncludes.self)) { $0.target } - .mapValues { $0.map(\.includes) } + .mapValues { $0.map(\.includes).filter { !Self.ignoredParents.contains($0) } } let mergedInterfaces = Dictionary( grouping: all(IDLInterface.self).map { MergedInterface( name: $0.name, - parentClasses: [$0.inheritance].compactMap { $0 }, + parentClasses: [$0.inheritance] + .compactMap { $0 } + .filter { !Self.ignoredParents.contains($0) }, members: addAsync($0.members.array) as! [IDLInterfaceMember], exposed: Set( $0.extAttrs @@ -100,7 +104,9 @@ enum DeclarationMerger { grouping: all(IDLDictionary.self).map { MergedDictionary( name: $0.name, - inheritance: [$0.inheritance].compactMap { $0 }, + inheritance: [$0.inheritance] + .compactMap { $0 } + .filter { !Self.ignoredParents.contains($0) }, members: $0.members ) }, @@ -134,6 +140,25 @@ enum DeclarationMerger { allTypes.removeAll(where: { ignoredTypedefs.contains($0.name) }) let mergedTypes = Dictionary(uniqueKeysWithValues: allTypes.map { ($0.name, $0) }) + // var unionAliases: [String: String] = [:] + // let unions = Set( + // Dictionary( + // all(IDLTypedef.self).compactMap { type -> (Set, UnionType)? in + // if case let .union(types) = type.idlType.value { + // let typeSet = Set(types.map(SlimIDLType.init)) + // return (typeSet, UnionType(types: typeSet, friendlyName: type.name)) + // } + // return nil + // }, + // uniquingKeysWith: { old, new in + // unionAliases[new.name] = old.name + // return old + // } + // ).values + // ) + + // print(unionAliases) + let arrays: [DeclarationFile] = Array(mergedInterfaces.values) + Array(mergedDictionaries.values) @@ -145,6 +170,7 @@ enum DeclarationMerger { + all(IDLEnum.self), interfaces: mergedInterfaces, types: mergedTypes + // unions: unions ) } @@ -152,6 +178,7 @@ enum DeclarationMerger { let declarations: [DeclarationFile] let interfaces: [String: MergedInterface] let types: [String: IDLTypealias] + // let unions: Set } } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index 0393ddb2..0a5c4005 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -21,6 +21,11 @@ extension IDLAttribute: SwiftRepresentable, Initializable { } var swiftRepresentation: SwiftSource { + if Context.ignored[Context.className.source]?.contains(name) ?? false { + return """ + // XXX: attribute '\(name)' is ignored + """ + } if Context.override { assert(!Context.static) // can't do property wrappers on override declarations diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js index 4c49c4fe..de36842c 100644 --- a/parse-idl/parse-all.js +++ b/parse-idl/parse-all.js @@ -7,7 +7,6 @@ const parsedFiles = await parseAll(); console.log( JSON.stringify( [ - "cssom", "dom", "fetch", "FileAPI", @@ -15,7 +14,6 @@ console.log( "geometry", "hr-time", "referrer-policy", - "streams", "uievents", "wai-aria", "webidl", From 38840363484970cb54f9be62220cc8e4db93fc8b Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Sat, 30 Apr 2022 13:35:01 +0100 Subject: [PATCH 122/124] Use macOS Monterey and Xcode 13.3.1 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e70c82c9..9589fc4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ on: jobs: macos_test: - runs-on: macos-11.0 + runs-on: macos-12.0 steps: - uses: actions/checkout@v2 @@ -15,7 +15,7 @@ jobs: shell: bash run: | set -ex - sudo xcode-select --switch /Applications/Xcode_12.3.app/Contents/Developer/ + sudo xcode-select --switch /Applications/Xcode_13.3.1.app/Contents/Developer/ brew install swiftwasm/tap/carton From 4e9716d60302050b27a568b3f82f524875e4d6d0 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Sat, 30 Apr 2022 13:39:55 +0100 Subject: [PATCH 123/124] Use `macos-12` image name --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9589fc4b..bbd84f3a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ on: jobs: macos_test: - runs-on: macos-12.0 + runs-on: macos-12 steps: - uses: actions/checkout@v2 From 96688c3176f4e53b524d2136b42e5299a7521be6 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 30 Apr 2022 12:46:30 -0400 Subject: [PATCH 124/124] Add BodyInit typealias --- Sources/DOMKit/ECMAScript/Support.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/DOMKit/ECMAScript/Support.swift b/Sources/DOMKit/ECMAScript/Support.swift index c06317b6..4bc3794a 100644 --- a/Sources/DOMKit/ECMAScript/Support.swift +++ b/Sources/DOMKit/ECMAScript/Support.swift @@ -19,4 +19,5 @@ public typealias Uint8ClampedArray = JSUInt8ClampedArray public typealias Blob_or_MediaSource = Blob public typealias HTMLOrSVGImageElement = HTMLImageElement public typealias HTMLOrSVGScriptElement = HTMLScriptElement +public typealias BodyInit = XMLHttpRequestBodyInit public typealias CustomElementConstructor = JSFunction